diff --git a/web/components/UI.tsx b/web/components/UI.tsx index 98c72c9..787fd2a 100644 --- a/web/components/UI.tsx +++ b/web/components/UI.tsx @@ -206,10 +206,11 @@ interface DrawerProps { isOpen: boolean; onClose: () => void; title: string; + className?: string; children: React.ReactNode; } -export const Drawer: React.FC = ({ isOpen, onClose, title, children }) => { +export const Drawer: React.FC = ({ isOpen, onClose, title, className, children }) => { if (!isOpen) return null; return ( @@ -218,7 +219,7 @@ export const Drawer: React.FC = ({ isOpen, onClose, title, children
{/* Drawer Content */} -
+

{title}

- ))} + { handleHangup(); onClose(); }} title={`调试: ${assistant.name}`} className="w-[90vw] sm:w-[85vw] max-w-none"> +
+ + {/* Left Column: Call Interface */} +
+
+
+ {(['text', 'voice', 'video'] as const).map(m => ( + + ))} +
+
-
-
-
+
+
{mode === 'text' ? ( textSessionStarted ? ( -
-
- +
+
+
+
+ +
+
+
+

通话中

+

文本交互测试进行中

) : wsStatus === 'connecting' ? ( @@ -4468,41 +4487,57 @@ export const DebugDrawer: React.FC<{
) ) : ( -
+
{mode === 'voice' ? ( -
- -
+
+
+
+
+
+
+ +
+
+
+
+

通话进行中

+
+ + + + +

已连接

+
+
+
) : ( -
-
-
- - -
-
-
{isSwapped ? renderLocalVideo(false) : renderRemoteVideo(false)}
-
{isSwapped ? renderRemoteVideo(true) : renderLocalVideo(true)}
- -
+
+
+ + +
+
+
{isSwapped ? renderLocalVideo(false) : renderRemoteVideo(false)}
+
{isSwapped ? renderRemoteVideo(true) : renderLocalVideo(true)}
+
-
)}
)}
-
- {mode === 'voice' && ( -
- 麦克风 + {/* Hangup / Mic Select area (Left Column Bottom) */} +
+ {mode === 'voice' && callStatus === 'active' && ( +
+ 麦克风
)} -
- {mode === 'text' && textSessionStarted && ( - +
+ {mode === 'text' && textSessionStarted && ( + + )} + {mode !== 'text' && callStatus === 'active' && ( + + )} +
+
+
+
+ + {/* Right Column: Transcript */} +
+
+ +

Transcript

+
+ +
+
+ {(messages.length === 0 && !isLoading) ? ( +
+ +

暂无对话记录

+
+ ) : ( + )} - {mode === 'voice' && callStatus === 'active' && ( - - )} - setInputText(e.target.value)} - placeholder={mode === 'text' && !textSessionStarted ? "请先发起呼叫后输入消息..." : (mode === 'text' ? "输入消息..." : "输入文本模拟交互...")} - onKeyDown={e => e.key === 'Enter' && handleSend()} - disabled={mode === 'text' ? !textSessionStarted : (isLoading || callStatus !== 'active')} - className="flex-1 min-w-0" - /> - -
-
-
+
+
+ + {/* Input bar */} +
+ setInputText(e.target.value)} + placeholder={mode === 'text' && !textSessionStarted ? "请先发起呼叫后输入消息..." : (mode === 'text' ? "输入消息..." : "输入文本模拟交互...")} + onKeyDown={e => e.key === 'Enter' && handleSend()} + disabled={mode === 'text' ? !textSessionStarted : (isLoading || callStatus !== 'active')} + className="flex-1 min-w-0 border-0 bg-transparent focus-visible:ring-0 shadow-none px-3" + /> + +
+
+
{textPromptDialog.open && (
@@ -4604,7 +4666,7 @@ export const DebugDrawer: React.FC<{ )}
- {choicePromptDialog.options.map((option) => ( + {choicePromptDialog.options.map((option: any) => (
)} -
- - {isOpen && ( -
- -
-
+
{settingsPanel}
-
-
- )} + + )} ); }; diff --git a/web/services/backendApi.ts b/web/services/backendApi.ts index 50aec96..08c11cf 100644 --- a/web/services/backendApi.ts +++ b/web/services/backendApi.ts @@ -28,7 +28,7 @@ const normalizeToolIdList = (value: unknown): string[] => { return result; }; -const normalizeManualOpenerToolCalls = (value: unknown): AnyRecord[] => { +const normalizeManualOpenerToolCalls = (value: unknown): any[] => { if (!Array.isArray(value)) return []; return value .filter((item) => item && typeof item === 'object') @@ -41,7 +41,7 @@ const normalizeManualOpenerToolCalls = (value: unknown): AnyRecord[] => { toolName, }; }) - .filter(Boolean) as AnyRecord[]; + .filter(Boolean) as any[]; }; const withLimit = (path: string, limit: number = DEFAULT_LIST_LIMIT): string =>