(requestId: string, answers: Record<string, any>)
| 496 | |
| 497 | // 回答 AskUser 问题 |
| 498 | const answerQuestion = async (requestId: string, answers: Record<string, any>) => { |
| 499 | const ws = getInstance(); |
| 500 | if (!ws || !wsConnected.value) return; |
| 501 | |
| 502 | ws.send({ |
| 503 | type: "user_answer", |
| 504 | payload: { |
| 505 | request_id: requestId, |
| 506 | answers, |
| 507 | }, |
| 508 | }); |
| 509 | |
| 510 | // 更新消息状态 |
| 511 | const msgIndex = chatStore.messages.findIndex((m) => m.type === "ask-user" && (m as AskUserMessage).content.request_id === requestId); |
| 512 | if (msgIndex !== -1) { |
| 513 | const msg = chatStore.messages[msgIndex] as AskUserMessage; |
| 514 | msg.content.answered = true; |
| 515 | msg.content.answers = answers; |
| 516 | } |
| 517 | |
| 518 | pendingAskUser.value = null; |
| 519 | }; |
| 520 | |
| 521 | const controlTool = async (toolCallId: string, action: "cancel" | "pause" | "resume") => { |
| 522 | const ws = getInstance(); |
nothing calls this directly
no test coverage detected