MCPcopy Create free account
hub / github.com/astercloud/aster / answerQuestion

Function answerQuestion

ui/src/composables/useChat.ts:498–519  ·  view source on GitHub ↗
(requestId: string, answers: Record<string, any>)

Source from the content-addressed store, hash-verified

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();

Callers

nothing calls this directly

Calls 2

getInstanceFunction · 0.85
sendMethod · 0.45

Tested by

no test coverage detected