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

Function reject

ui/src/stores/approval.ts:73–106  ·  view source on GitHub ↗
(requestId: string, reason?: string)

Source from the content-addressed store, hash-verified

71 * 拒绝请求
72 */
73 const reject = async (requestId: string, reason?: string) => {
74 const request = pendingApprovals.value.get(requestId);
75 if (!request) {
76 console.warn(`Approval request ${requestId} not found`);
77 return;
78 }
79
80 // 记录到历史
81 approvalHistory.value.push({
82 ...request,
83 decision: "rejected",
84 reason,
85 decidedAt: Date.now(),
86 });
87
88 // 发送到后端
89 const { getInstance } = useWebSocket();
90 const ws = getInstance();
91 if (ws) {
92 ws.send({
93 type: "permission_decision",
94 payload: {
95 request_id: requestId,
96 decision: "reject",
97 reason,
98 },
99 });
100 } else {
101 console.error("WebSocket not connected, cannot send rejection decision");
102 }
103
104 // 从待审批列表中移除
105 pendingApprovals.value.delete(requestId);
106 };
107
108 /**
109 * 获取指定消息的待审批请求

Callers 1

connectMethod · 0.85

Calls 5

useWebSocketFunction · 0.90
getInstanceFunction · 0.85
getMethod · 0.45
sendMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected