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

Function approveAndResume

ui/src/composables/useAgentLoop.ts:394–416  ·  view source on GitHub ↗
(requestId: string)

Source from the content-addressed store, hash-verified

392 * 批准工具执行并恢复
393 */
394 const approveAndResume = async (requestId: string): Promise<AgentExecutionResult> => {
395 const approval = pendingApproval.value;
396 if (!approval || approval.id !== requestId) {
397 throw new Error("No pending approval or ID mismatch");
398 }
399
400 // 发送审批决策
401 approvalStore.approve(requestId);
402 pendingApproval.value = null;
403 isPaused.value = false;
404
405 emitThink({
406 stage: `调用工具: ${approval.toolName} (已批准)`,
407 reasoning: "用户已批准敏感操作",
408 decision: `执行 ${approval.toolName}`,
409 });
410
411 // 恢复执行
412 return execute("", "", {
413 history: history.value,
414 approvedTool: approval,
415 });
416 };
417
418 /**
419 * 拒绝工具执行

Callers

nothing calls this directly

Calls 2

emitThinkFunction · 0.85
executeFunction · 0.70

Tested by

no test coverage detected