32 lines
1.0 KiB
JavaScript
32 lines
1.0 KiB
JavaScript
|
|
/**
|
||
|
|
* 前端工具UI调试脚本
|
||
|
|
* 在浏览器控制台中运行以检查工具UI注册状态
|
||
|
|
*/
|
||
|
|
|
||
|
|
// 检查 assistant-ui 工具UI注册状态
|
||
|
|
console.log("🔍 Checking Assistant UI Tool Registration...");
|
||
|
|
|
||
|
|
// 检查是否有工具UI组件
|
||
|
|
console.log("AssistantRuntimeProvider:", typeof window.AssistantRuntimeProvider);
|
||
|
|
console.log("makeAssistantToolUI:", typeof window.makeAssistantToolUI);
|
||
|
|
|
||
|
|
// 检查页面上的组件
|
||
|
|
const toolUIElements = document.querySelectorAll('[data-tool-ui]');
|
||
|
|
console.log(`Found ${toolUIElements.length} tool UI elements:`, toolUIElements);
|
||
|
|
|
||
|
|
// 检查React组件树中的工具UI
|
||
|
|
if (window.React && window.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) {
|
||
|
|
console.log("React DevTools available - can inspect component tree");
|
||
|
|
}
|
||
|
|
|
||
|
|
// 监听网络请求
|
||
|
|
const originalFetch = window.fetch;
|
||
|
|
window.fetch = function(...args) {
|
||
|
|
if (args[0].includes('/api/chat')) {
|
||
|
|
console.log("🌐 Chat API request:", args);
|
||
|
|
}
|
||
|
|
return originalFetch.apply(this, args);
|
||
|
|
};
|
||
|
|
|
||
|
|
console.log("✅ Tool UI debugging setup complete");
|