agenthub-multiagent-mcp 1.60.0 → 1.64.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/brain/memvidBrain.d.ts +22 -0
- package/dist/brain/memvidBrain.d.ts.map +1 -1
- package/dist/brain/memvidBrain.js +41 -2
- package/dist/brain/memvidBrain.js.map +1 -1
- package/dist/brain/memvidBrain.test.js +90 -0
- package/dist/brain/memvidBrain.test.js.map +1 -1
- package/dist/brain/migrate.d.ts +43 -0
- package/dist/brain/migrate.d.ts.map +1 -1
- package/dist/brain/migrate.js +148 -23
- package/dist/brain/migrate.js.map +1 -1
- package/dist/brain/migrate.test.js +194 -1
- package/dist/brain/migrate.test.js.map +1 -1
- package/dist/channel.js +48 -6
- package/dist/channel.js.map +1 -1
- package/dist/channelDiagnostics.d.ts +53 -0
- package/dist/channelDiagnostics.d.ts.map +1 -1
- package/dist/channelDiagnostics.js +91 -0
- package/dist/channelDiagnostics.js.map +1 -1
- package/dist/channelDiagnostics.test.js +109 -1
- package/dist/channelDiagnostics.test.js.map +1 -1
- package/dist/client.d.ts +17 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +32 -0
- package/dist/client.js.map +1 -1
- package/dist/daemon.js +16 -22
- package/dist/daemon.js.map +1 -1
- package/dist/index.js +36 -3
- package/dist/index.js.map +1 -1
- package/dist/lib/pending-items.d.ts +63 -0
- package/dist/lib/pending-items.d.ts.map +1 -0
- package/dist/lib/pending-items.js +96 -0
- package/dist/lib/pending-items.js.map +1 -0
- package/dist/pinSweep.d.ts +83 -0
- package/dist/pinSweep.d.ts.map +1 -0
- package/dist/pinSweep.js +105 -0
- package/dist/pinSweep.js.map +1 -0
- package/dist/pinSweep.test.d.ts +12 -0
- package/dist/pinSweep.test.d.ts.map +1 -0
- package/dist/pinSweep.test.js +110 -0
- package/dist/pinSweep.test.js.map +1 -0
- package/dist/pinSweepCli.d.ts +20 -0
- package/dist/pinSweepCli.d.ts.map +1 -0
- package/dist/pinSweepCli.js +287 -0
- package/dist/pinSweepCli.js.map +1 -0
- package/dist/run-claude.sh +36 -5
- package/dist/sessionCapture.d.ts.map +1 -1
- package/dist/sessionCapture.js +7 -1
- package/dist/sessionCapture.js.map +1 -1
- package/dist/sessionCapture.test.js +20 -0
- package/dist/sessionCapture.test.js.map +1 -1
- package/dist/setup.js +11 -0
- package/dist/setup.js.map +1 -1
- package/dist/shiftFiles.d.ts +33 -0
- package/dist/shiftFiles.d.ts.map +1 -0
- package/dist/shiftFiles.js +57 -0
- package/dist/shiftFiles.js.map +1 -0
- package/dist/shiftFiles.test.d.ts +2 -0
- package/dist/shiftFiles.test.d.ts.map +1 -0
- package/dist/shiftFiles.test.js +141 -0
- package/dist/shiftFiles.test.js.map +1 -0
- package/dist/skillInstaller.d.ts.map +1 -1
- package/dist/skillInstaller.gate.test.js +2 -0
- package/dist/skillInstaller.gate.test.js.map +1 -1
- package/dist/skillInstaller.js +8 -0
- package/dist/skillInstaller.js.map +1 -1
- package/dist/skillInstaller.test.js +8 -1
- package/dist/skillInstaller.test.js.map +1 -1
- package/dist/tools/goshtiRead.d.ts +72 -0
- package/dist/tools/goshtiRead.d.ts.map +1 -0
- package/dist/tools/goshtiRead.js +274 -0
- package/dist/tools/goshtiRead.js.map +1 -0
- package/dist/tools/goshtiRead.test.d.ts +8 -0
- package/dist/tools/goshtiRead.test.d.ts.map +1 -0
- package/dist/tools/goshtiRead.test.js +182 -0
- package/dist/tools/goshtiRead.test.js.map +1 -0
- package/dist/tools/inboxBounds.d.ts +80 -0
- package/dist/tools/inboxBounds.d.ts.map +1 -0
- package/dist/tools/inboxBounds.js +105 -0
- package/dist/tools/inboxBounds.js.map +1 -0
- package/dist/tools/inboxBounds.test.d.ts +15 -0
- package/dist/tools/inboxBounds.test.d.ts.map +1 -0
- package/dist/tools/inboxBounds.test.js +135 -0
- package/dist/tools/inboxBounds.test.js.map +1 -0
- package/dist/tools/index.d.ts +11 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +79 -18
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/intakeRequests.d.ts +35 -0
- package/dist/tools/intakeRequests.d.ts.map +1 -0
- package/dist/tools/intakeRequests.js +344 -0
- package/dist/tools/intakeRequests.js.map +1 -0
- package/dist/tools/intakeRequests.test.d.ts +8 -0
- package/dist/tools/intakeRequests.test.d.ts.map +1 -0
- package/dist/tools/intakeRequests.test.js +183 -0
- package/dist/tools/intakeRequests.test.js.map +1 -0
- package/dist/tools/pushedItemsSafety.test.d.ts +12 -0
- package/dist/tools/pushedItemsSafety.test.d.ts.map +1 -0
- package/dist/tools/pushedItemsSafety.test.js +179 -0
- package/dist/tools/pushedItemsSafety.test.js.map +1 -0
- package/dist/tools/tools.test.js +17 -5
- package/dist/tools/tools.test.js.map +1 -1
- package/dist/tools/wrapperCost.test.d.ts +13 -0
- package/dist/tools/wrapperCost.test.d.ts.map +1 -0
- package/dist/tools/wrapperCost.test.js +149 -0
- package/dist/tools/wrapperCost.test.js.map +1 -0
- package/dist/websocket.d.ts +30 -1
- package/dist/websocket.d.ts.map +1 -1
- package/dist/websocket.js +40 -3
- package/dist/websocket.js.map +1 -1
- package/dist/websocketQueue.test.d.ts +10 -0
- package/dist/websocketQueue.test.d.ts.map +1 -0
- package/dist/websocketQueue.test.js +78 -0
- package/dist/websocketQueue.test.js.map +1 -0
- package/package.json +4 -4
- package/skills/catalog.json +23 -10
- package/skills/commands/close-session.md +144 -144
- package/skills/commands/start-session.md +25 -6
- package/skills/manifest.json +8 -1
- package/skills/skills/code-brain-hook/SKILL.md +61 -61
- package/skills/skills/file-bug/SKILL.md +75 -75
- package/skills/skills/inbox/SKILL.md +99 -0
- package/skills/skills/multiagent-brainstorm/SKILL.md +164 -164
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Intake request MCP tools (add-intake-requests §6.1).
|
|
3
|
+
*
|
|
4
|
+
* `file_request` records an ask; `request_triage` is how whoever triages it —
|
|
5
|
+
* the org's Business Analyst, or an admin — moves it along; and
|
|
6
|
+
* `request_scope_check` is the gate an agent MUST pass before merging work
|
|
7
|
+
* that was auto-approved.
|
|
8
|
+
*
|
|
9
|
+
* Refusals are returned, never thrown, and each known server code gets its own
|
|
10
|
+
* sentence: a proposal waiting on a person, a disabled feature, and a scope
|
|
11
|
+
* check that did not pass all demand different next steps, and a model that
|
|
12
|
+
* collapses them into "failed" will do the wrong one.
|
|
13
|
+
*/
|
|
14
|
+
import type { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
15
|
+
import type { ApiClient, SessionControlResult } from "../client.js";
|
|
16
|
+
export declare const INTAKE_REQUEST_TOOLS: readonly ["file_request", "request_triage", "request_scope_check"];
|
|
17
|
+
export type IntakeRequestToolName = (typeof INTAKE_REQUEST_TOOLS)[number];
|
|
18
|
+
export declare function isIntakeRequestTool(name: string): name is IntakeRequestToolName;
|
|
19
|
+
export declare function registerIntakeRequestTools(): Tool[];
|
|
20
|
+
/** Structured refusal returned to the model instead of a thrown error. */
|
|
21
|
+
export interface IntakeRequestFailure {
|
|
22
|
+
ok: false;
|
|
23
|
+
error: string;
|
|
24
|
+
status: number;
|
|
25
|
+
message: string;
|
|
26
|
+
review_id?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Turn a failed request call into a refusal the model can act on.
|
|
30
|
+
*/
|
|
31
|
+
export declare function describeIntakeRequestFailure(tool: IntakeRequestToolName, ref: string, result: Extract<SessionControlResult, {
|
|
32
|
+
ok: false;
|
|
33
|
+
}>): IntakeRequestFailure;
|
|
34
|
+
export declare function handleIntakeRequestToolCall(name: IntakeRequestToolName, args: Record<string, unknown>, client: ApiClient, boundProjectId: () => string | undefined): Promise<unknown>;
|
|
35
|
+
//# sourceMappingURL=intakeRequests.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intakeRequests.d.ts","sourceRoot":"","sources":["../../src/tools/intakeRequests.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC/D,OAAO,KAAK,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEpE,eAAO,MAAM,oBAAoB,oEAAqE,CAAC;AAEvG,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1E,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,qBAAqB,CAE/E;AAeD,wBAAgB,0BAA0B,IAAI,IAAI,EAAE,CAkGnD;AAED,0EAA0E;AAC1E,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,KAAK,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAwBD;;GAEG;AACH,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,qBAAqB,EAC3B,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,OAAO,CAAC,oBAAoB,EAAE;IAAE,EAAE,EAAE,KAAK,CAAA;CAAE,CAAC,GACnD,oBAAoB,CAsDtB;AAED,wBAAsB,2BAA2B,CAC/C,IAAI,EAAE,qBAAqB,EAC3B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,MAAM,EAAE,SAAS,EACjB,cAAc,EAAE,MAAM,MAAM,GAAG,SAAS,GACvC,OAAO,CAAC,OAAO,CAAC,CAwIlB"}
|
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Intake request MCP tools (add-intake-requests §6.1).
|
|
3
|
+
*
|
|
4
|
+
* `file_request` records an ask; `request_triage` is how whoever triages it —
|
|
5
|
+
* the org's Business Analyst, or an admin — moves it along; and
|
|
6
|
+
* `request_scope_check` is the gate an agent MUST pass before merging work
|
|
7
|
+
* that was auto-approved.
|
|
8
|
+
*
|
|
9
|
+
* Refusals are returned, never thrown, and each known server code gets its own
|
|
10
|
+
* sentence: a proposal waiting on a person, a disabled feature, and a scope
|
|
11
|
+
* check that did not pass all demand different next steps, and a model that
|
|
12
|
+
* collapses them into "failed" will do the wrong one.
|
|
13
|
+
*/
|
|
14
|
+
export const INTAKE_REQUEST_TOOLS = ["file_request", "request_triage", "request_scope_check"];
|
|
15
|
+
export function isIntakeRequestTool(name) {
|
|
16
|
+
return INTAKE_REQUEST_TOOLS.includes(name);
|
|
17
|
+
}
|
|
18
|
+
const REQUEST_REF_DESCRIPTION = "The request's ticket key (e.g. AGHUB-1402) or id.";
|
|
19
|
+
const CHANGE_KINDS = [
|
|
20
|
+
"docs",
|
|
21
|
+
"copy",
|
|
22
|
+
"config-flag",
|
|
23
|
+
"dependency-patch",
|
|
24
|
+
"feature",
|
|
25
|
+
"fix",
|
|
26
|
+
"schema",
|
|
27
|
+
"security",
|
|
28
|
+
];
|
|
29
|
+
export function registerIntakeRequestTools() {
|
|
30
|
+
return [
|
|
31
|
+
{
|
|
32
|
+
name: "file_request",
|
|
33
|
+
description: "File an intake request — someone in the org needs something (add-intake-requests). " +
|
|
34
|
+
"The request is recorded with your owner as the requester and routed straight to the org's " +
|
|
35
|
+
"Business Analyst (or an admin when nobody holds that role) for triage. This records an ASK, " +
|
|
36
|
+
"not work: it is never claimable and nobody should start building until it is approved. " +
|
|
37
|
+
"Use report_bug for defects and create_task for work already decided. (requires agent_register first)",
|
|
38
|
+
inputSchema: {
|
|
39
|
+
type: "object",
|
|
40
|
+
properties: {
|
|
41
|
+
title: { type: "string", description: "Short summary of what is needed." },
|
|
42
|
+
description: {
|
|
43
|
+
type: "string",
|
|
44
|
+
description: "Who needs it, why, and what 'done' looks like. The triager reads this first.",
|
|
45
|
+
},
|
|
46
|
+
project_id: {
|
|
47
|
+
type: "string",
|
|
48
|
+
description: "Project to file in. Defaults to the project this agent is bound to.",
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
required: ["title"],
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: "request_triage",
|
|
56
|
+
description: "Triage an intake request you were routed (you must be its assignee, or an org admin). Actions: " +
|
|
57
|
+
"`ask` (questions → the requester; their reply comment returns it to triage), " +
|
|
58
|
+
"`propose` (a change_kind + summary; an allowlisted kind is auto-approved and delivery starts, " +
|
|
59
|
+
"any other kind waits for a PERSON who is an org admin to approve — you cannot approve it), " +
|
|
60
|
+
"`reject` (reason required), `duplicate` (original_request required), and " +
|
|
61
|
+
"`retry_delivery` (an approved request whose delivery epic was not created). " +
|
|
62
|
+
"While a proposal awaits approval every action but retry_delivery is refused with proposal_pending. " +
|
|
63
|
+
"An auto-approved request MUST pass request_scope_check before its pull request merges. " +
|
|
64
|
+
"(requires agent_register first)",
|
|
65
|
+
inputSchema: {
|
|
66
|
+
type: "object",
|
|
67
|
+
properties: {
|
|
68
|
+
request: { type: "string", description: REQUEST_REF_DESCRIPTION },
|
|
69
|
+
action: {
|
|
70
|
+
type: "string",
|
|
71
|
+
enum: ["ask", "propose", "reject", "duplicate", "retry_delivery"],
|
|
72
|
+
},
|
|
73
|
+
questions: { type: "string", description: "ask: the questions for the requester." },
|
|
74
|
+
change_kind: {
|
|
75
|
+
type: "string",
|
|
76
|
+
enum: [...CHANGE_KINDS],
|
|
77
|
+
description: "propose: what the change is. feature, fix, schema and security always need a person's " +
|
|
78
|
+
"approval; the others are auto-approved only if the project allowlisted them.",
|
|
79
|
+
},
|
|
80
|
+
summary: { type: "string", description: "propose: what will change and why." },
|
|
81
|
+
openspec_change: {
|
|
82
|
+
type: "string",
|
|
83
|
+
description: "propose: the OpenSpec change id that will deliver it, if drafted.",
|
|
84
|
+
},
|
|
85
|
+
reason: { type: "string", description: "reject: why, for the requester." },
|
|
86
|
+
original_request: {
|
|
87
|
+
type: "string",
|
|
88
|
+
description: "duplicate: key or id of the request this one duplicates.",
|
|
89
|
+
},
|
|
90
|
+
project_id: {
|
|
91
|
+
type: "string",
|
|
92
|
+
description: "Project the request is in. Defaults to the bound project.",
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
required: ["request", "action"],
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
name: "request_scope_check",
|
|
100
|
+
description: "Check an auto-approved request's pull request against what its change kind may touch, BEFORE " +
|
|
101
|
+
"merging it. The server lists the PR's changed files from GitHub and compares every path " +
|
|
102
|
+
"(including a renamed file's old path). Only `passed: true` means you may merge. Any file outside " +
|
|
103
|
+
"scope, or a check that could not run, returns `passed: false` and opens an exception for a " +
|
|
104
|
+
"person to decide — do not merge, and do not work around it; call this again after they decide. " +
|
|
105
|
+
"Human-approved requests do not need it (scope_check_not_applicable). (requires agent_register first)",
|
|
106
|
+
inputSchema: {
|
|
107
|
+
type: "object",
|
|
108
|
+
properties: {
|
|
109
|
+
request: { type: "string", description: REQUEST_REF_DESCRIPTION },
|
|
110
|
+
pr_url: {
|
|
111
|
+
type: "string",
|
|
112
|
+
description: "The delivering pull request: https://github.com/<owner>/<repo>/pull/<number>.",
|
|
113
|
+
},
|
|
114
|
+
project_id: {
|
|
115
|
+
type: "string",
|
|
116
|
+
description: "Project the request is in. Defaults to the bound project.",
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
required: ["request", "pr_url"],
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
];
|
|
123
|
+
}
|
|
124
|
+
function requireString(args, key) {
|
|
125
|
+
const value = args[key];
|
|
126
|
+
if (typeof value !== "string" || value.trim() === "") {
|
|
127
|
+
throw new Error(`${key} is required`);
|
|
128
|
+
}
|
|
129
|
+
return value.trim();
|
|
130
|
+
}
|
|
131
|
+
function optionalString(args, key) {
|
|
132
|
+
const value = args[key];
|
|
133
|
+
return typeof value === "string" && value.trim() !== "" ? value.trim() : undefined;
|
|
134
|
+
}
|
|
135
|
+
function record(value) {
|
|
136
|
+
return value && typeof value === "object" ? value : {};
|
|
137
|
+
}
|
|
138
|
+
function str(data, key) {
|
|
139
|
+
const value = data[key];
|
|
140
|
+
return typeof value === "string" && value !== "" ? value : undefined;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Turn a failed request call into a refusal the model can act on.
|
|
144
|
+
*/
|
|
145
|
+
export function describeIntakeRequestFailure(tool, ref, result) {
|
|
146
|
+
const { status, error } = result;
|
|
147
|
+
const serverMessage = result.message;
|
|
148
|
+
const raw = record(result.data);
|
|
149
|
+
const reviewId = str(raw, "review_id");
|
|
150
|
+
let message;
|
|
151
|
+
switch (error) {
|
|
152
|
+
case "requests_disabled":
|
|
153
|
+
message =
|
|
154
|
+
`UNAVAILABLE: intake requests are switched off on this AgentHub server (${error}, HTTP ${status}). ` +
|
|
155
|
+
`This is server configuration, not a permission denial — an operator must set ` +
|
|
156
|
+
`AGENTHUB_REQUESTS_ENABLED=true. Do not retry.`;
|
|
157
|
+
break;
|
|
158
|
+
case "proposal_pending":
|
|
159
|
+
message =
|
|
160
|
+
`WAITING: a proposal for request ${ref} is awaiting a person's approval` +
|
|
161
|
+
`${reviewId ? ` (review ${reviewId})` : ""}. The approver decides next; you cannot approve it ` +
|
|
162
|
+
`or take another triage action until they do.`;
|
|
163
|
+
break;
|
|
164
|
+
case "request_already_decided":
|
|
165
|
+
message = `Request ${ref} was already decided${serverMessage ? `: ${serverMessage}` : ""}.`;
|
|
166
|
+
break;
|
|
167
|
+
case "invalid_request_transition":
|
|
168
|
+
message =
|
|
169
|
+
`REFUSED: that action does not fit the request's current state` +
|
|
170
|
+
`${serverMessage ? ` — ${serverMessage}` : ""}. Nothing was changed.`;
|
|
171
|
+
break;
|
|
172
|
+
case "scope_check_not_applicable":
|
|
173
|
+
message =
|
|
174
|
+
`Request ${ref} does not need a scope check: it is not an auto-approved request in delivery ` +
|
|
175
|
+
`(a person already approved it, or it has not been approved).`;
|
|
176
|
+
break;
|
|
177
|
+
case "not_triager":
|
|
178
|
+
message =
|
|
179
|
+
`DENIED: only the request's assignee or an org admin can triage ${ref}. ` +
|
|
180
|
+
`If it was routed to someone else, leave it to them.`;
|
|
181
|
+
break;
|
|
182
|
+
case "requester_required":
|
|
183
|
+
case "human_required":
|
|
184
|
+
message = `DENIED (${error}, HTTP ${status})${serverMessage ? `: ${serverMessage}` : ""}.`;
|
|
185
|
+
break;
|
|
186
|
+
case "request_not_found":
|
|
187
|
+
case "project_not_found":
|
|
188
|
+
message = `Not found (${error}, HTTP ${status}): check the request key and project.`;
|
|
189
|
+
break;
|
|
190
|
+
default:
|
|
191
|
+
message =
|
|
192
|
+
serverMessage ||
|
|
193
|
+
result.detail ||
|
|
194
|
+
`${tool} failed: ${error} (HTTP ${status}).`;
|
|
195
|
+
}
|
|
196
|
+
return { ok: false, error, status, message, ...(reviewId ? { review_id: reviewId } : {}) };
|
|
197
|
+
}
|
|
198
|
+
export async function handleIntakeRequestToolCall(name, args, client, boundProjectId) {
|
|
199
|
+
const projectId = optionalString(args, "project_id") || boundProjectId();
|
|
200
|
+
if (!projectId) {
|
|
201
|
+
throw new Error("Not bound to a project. Pass project_id, or call agent_register with a project first.");
|
|
202
|
+
}
|
|
203
|
+
switch (name) {
|
|
204
|
+
case "file_request": {
|
|
205
|
+
const title = requireString(args, "title");
|
|
206
|
+
const result = await client.fileRequest(projectId, title, optionalString(args, "description") || "");
|
|
207
|
+
if (!result.ok)
|
|
208
|
+
return describeIntakeRequestFailure(name, title, result);
|
|
209
|
+
const request = record(result.data.request);
|
|
210
|
+
const routing = record(result.data.routing);
|
|
211
|
+
const key = str(request, "key") || str(request, "id") || "";
|
|
212
|
+
const target = str(routing, "target_id");
|
|
213
|
+
return {
|
|
214
|
+
ok: true,
|
|
215
|
+
request_id: str(request, "id"),
|
|
216
|
+
key,
|
|
217
|
+
request_state: str(request, "request_state"),
|
|
218
|
+
routing: result.data.routing ?? null,
|
|
219
|
+
message: `Filed request ${key}. ` +
|
|
220
|
+
(target
|
|
221
|
+
? `Routed to ${str(routing, "target_type")} ${target} for triage` +
|
|
222
|
+
(str(routing, "delivery") && str(routing, "delivery") !== "sent"
|
|
223
|
+
? ` (notification ${str(routing, "delivery")}: ${str(routing, "delivery_detail") || "unknown"})`
|
|
224
|
+
: "") +
|
|
225
|
+
"."
|
|
226
|
+
: "It could not be routed automatically; it will surface in the stall report.") +
|
|
227
|
+
" Nobody should start building until it is approved.",
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
case "request_triage": {
|
|
231
|
+
const ref = requireString(args, "request");
|
|
232
|
+
const action = requireString(args, "action");
|
|
233
|
+
const body = { action };
|
|
234
|
+
for (const [from, to] of [
|
|
235
|
+
["questions", "questions"],
|
|
236
|
+
["change_kind", "change_kind"],
|
|
237
|
+
["summary", "summary"],
|
|
238
|
+
["openspec_change", "openspec_change"],
|
|
239
|
+
["reason", "reason"],
|
|
240
|
+
["original_request", "original_request_id"],
|
|
241
|
+
]) {
|
|
242
|
+
const value = optionalString(args, from);
|
|
243
|
+
if (value)
|
|
244
|
+
body[to] = value;
|
|
245
|
+
}
|
|
246
|
+
if (typeof body.original_request_id === "string") {
|
|
247
|
+
body.original_request_id = await resolveRequestId(client, projectId, body.original_request_id);
|
|
248
|
+
}
|
|
249
|
+
const result = await client.triageRequest(projectId, ref, body);
|
|
250
|
+
if (!result.ok)
|
|
251
|
+
return describeIntakeRequestFailure(name, ref, result);
|
|
252
|
+
const request = record(result.data.request);
|
|
253
|
+
const epic = record(result.data.epic);
|
|
254
|
+
const outcome = str(result.data, "outcome") || action;
|
|
255
|
+
const state = str(request, "request_state");
|
|
256
|
+
const deliveryError = str(result.data, "delivery_error");
|
|
257
|
+
let message;
|
|
258
|
+
switch (outcome) {
|
|
259
|
+
case "awaiting_approval":
|
|
260
|
+
message =
|
|
261
|
+
`Proposal recorded for ${ref}. It is WAITING for a person who is an org admin to approve ` +
|
|
262
|
+
`(review ${str(result.data, "review_id")}). Do not start delivery.`;
|
|
263
|
+
break;
|
|
264
|
+
case "auto_approved":
|
|
265
|
+
message =
|
|
266
|
+
`${ref} was AUTO-APPROVED because its change kind is on the project's allowlist — no person ` +
|
|
267
|
+
`approved it. ` +
|
|
268
|
+
(deliveryError
|
|
269
|
+
? `Delivery did not start (${deliveryError}); call request_triage with retry_delivery.`
|
|
270
|
+
: `Delivery epic ${str(epic, "key") || ""} created. Before merging its pull request you MUST ` +
|
|
271
|
+
`call request_scope_check and merge only if it passes.`);
|
|
272
|
+
break;
|
|
273
|
+
default:
|
|
274
|
+
message = `${action} applied to ${ref}; it is now ${state}.`;
|
|
275
|
+
}
|
|
276
|
+
return {
|
|
277
|
+
ok: true,
|
|
278
|
+
outcome,
|
|
279
|
+
request_state: state,
|
|
280
|
+
...(str(result.data, "review_id") ? { review_id: str(result.data, "review_id") } : {}),
|
|
281
|
+
...(str(epic, "key") ? { epic_key: str(epic, "key"), epic_id: str(epic, "id") } : {}),
|
|
282
|
+
...(deliveryError ? { delivery_error: deliveryError } : {}),
|
|
283
|
+
...(result.data.requester_notified !== undefined ? { requester_notified: result.data.requester_notified } : {}),
|
|
284
|
+
message,
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
case "request_scope_check": {
|
|
288
|
+
const ref = requireString(args, "request");
|
|
289
|
+
const prUrl = requireString(args, "pr_url");
|
|
290
|
+
const result = await client.requestScopeCheck(projectId, ref, prUrl);
|
|
291
|
+
if (!result.ok)
|
|
292
|
+
return describeIntakeRequestFailure(name, ref, result);
|
|
293
|
+
const check = record(result.data.result);
|
|
294
|
+
const passed = check.passed === true;
|
|
295
|
+
const outcome = str(check, "outcome") || "";
|
|
296
|
+
const outside = Array.isArray(check.outside_paths) ? check.outside_paths : [];
|
|
297
|
+
const reviewId = str(check, "review_id");
|
|
298
|
+
let message;
|
|
299
|
+
if (passed) {
|
|
300
|
+
message =
|
|
301
|
+
outcome === "exception_approved"
|
|
302
|
+
? `PASSED by exception: files outside scope were approved by a person (review ${reviewId}). You may merge ${prUrl}.`
|
|
303
|
+
: `PASSED: every changed file is within scope. You may merge ${prUrl}.`;
|
|
304
|
+
}
|
|
305
|
+
else if (outcome === "awaiting_exception") {
|
|
306
|
+
message =
|
|
307
|
+
`DO NOT MERGE: ${prUrl} is waiting on a person to decide an exception (review ${reviewId}). ` +
|
|
308
|
+
`Check again after they decide.`;
|
|
309
|
+
}
|
|
310
|
+
else if (outcome === "check_failed") {
|
|
311
|
+
message =
|
|
312
|
+
`DO NOT MERGE: the scope check could not run (${str(check, "error")}), which counts as out of ` +
|
|
313
|
+
`scope. A person must approve an exception (review ${reviewId}) before this can merge.`;
|
|
314
|
+
}
|
|
315
|
+
else {
|
|
316
|
+
message =
|
|
317
|
+
`DO NOT MERGE: ${outside.length} file(s) are outside what this change kind permits: ` +
|
|
318
|
+
`${outside.slice(0, 20).join(", ")}${outside.length > 20 ? ", …" : ""}. Remove them from the pull ` +
|
|
319
|
+
`request, or wait for a person to approve the exception (review ${reviewId}).`;
|
|
320
|
+
}
|
|
321
|
+
return {
|
|
322
|
+
ok: true,
|
|
323
|
+
passed,
|
|
324
|
+
outcome,
|
|
325
|
+
checked_files: check.checked_files,
|
|
326
|
+
outside_paths: outside,
|
|
327
|
+
...(str(check, "error") ? { error: str(check, "error") } : {}),
|
|
328
|
+
...(reviewId ? { review_id: reviewId } : {}),
|
|
329
|
+
message,
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
/** Resolve a request key to its id; ids pass through untouched. */
|
|
335
|
+
async function resolveRequestId(client, projectId, ref) {
|
|
336
|
+
const result = await client.getRequest(projectId, ref);
|
|
337
|
+
if (result.ok) {
|
|
338
|
+
const id = str(record(result.data.request), "id");
|
|
339
|
+
if (id)
|
|
340
|
+
return id;
|
|
341
|
+
}
|
|
342
|
+
return ref;
|
|
343
|
+
}
|
|
344
|
+
//# sourceMappingURL=intakeRequests.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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C;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Intake request MCP tools (add-intake-requests §6.1).
|
|
3
|
+
*
|
|
4
|
+
* Handlers against a mocked ApiClient for result/refusal shaping, and the real
|
|
5
|
+
* ApiClient with fetch stubbed for the wire contract.
|
|
6
|
+
*/
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=intakeRequests.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intakeRequests.test.d.ts","sourceRoot":"","sources":["../../src/tools/intakeRequests.test.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Intake request MCP tools (add-intake-requests §6.1).
|
|
3
|
+
*
|
|
4
|
+
* Handlers against a mocked ApiClient for result/refusal shaping, and the real
|
|
5
|
+
* ApiClient with fetch stubbed for the wire contract.
|
|
6
|
+
*/
|
|
7
|
+
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
8
|
+
import { handleIntakeRequestToolCall, isIntakeRequestTool, registerIntakeRequestTools, } from "./intakeRequests.js";
|
|
9
|
+
import { ApiClient } from "../client.js";
|
|
10
|
+
function mockClient(overrides = {}) {
|
|
11
|
+
return {
|
|
12
|
+
fileRequest: vi.fn(),
|
|
13
|
+
triageRequest: vi.fn(),
|
|
14
|
+
requestScopeCheck: vi.fn(),
|
|
15
|
+
getRequest: vi.fn(),
|
|
16
|
+
...overrides,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
const ok = (data, status = 200) => ({ ok: true, status, data });
|
|
20
|
+
const fail = (status, error, data = {}) => ({
|
|
21
|
+
ok: false,
|
|
22
|
+
status,
|
|
23
|
+
error,
|
|
24
|
+
message: typeof data.message === "string" ? data.message : undefined,
|
|
25
|
+
data: { error, ...data },
|
|
26
|
+
});
|
|
27
|
+
const bound = () => "proj-1";
|
|
28
|
+
describe("intake request tool registration", () => {
|
|
29
|
+
it("registers file_request, request_triage and request_scope_check", () => {
|
|
30
|
+
expect(registerIntakeRequestTools().map((t) => t.name)).toEqual([
|
|
31
|
+
"file_request",
|
|
32
|
+
"request_triage",
|
|
33
|
+
"request_scope_check",
|
|
34
|
+
]);
|
|
35
|
+
expect(isIntakeRequestTool("request_triage")).toBe(true);
|
|
36
|
+
expect(isIntakeRequestTool("report_bug")).toBe(false);
|
|
37
|
+
});
|
|
38
|
+
it("offers exactly the server's change-kind catalog", () => {
|
|
39
|
+
const triage = registerIntakeRequestTools().find((t) => t.name === "request_triage");
|
|
40
|
+
const kinds = triage.inputSchema.properties.change_kind.enum;
|
|
41
|
+
expect(kinds).toEqual(["docs", "copy", "config-flag", "dependency-patch", "feature", "fix", "schema", "security"]);
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
describe("file_request", () => {
|
|
45
|
+
it("files in the bound project and reports routing", async () => {
|
|
46
|
+
const client = mockClient({
|
|
47
|
+
fileRequest: vi.fn().mockResolvedValue(ok({
|
|
48
|
+
request: { id: "r-1", key: "AGHUB-9", request_state: "triaging" },
|
|
49
|
+
routing: { target_type: "agent", target_id: "ba-agent", reason: "ba_holder", delivery: "queued", delivery_detail: "agent_offline" },
|
|
50
|
+
}, 201)),
|
|
51
|
+
});
|
|
52
|
+
const result = (await handleIntakeRequestToolCall("file_request", { title: "Export invoices", description: "Finance needs CSV" }, client, bound));
|
|
53
|
+
expect(client.fileRequest).toHaveBeenCalledWith("proj-1", "Export invoices", "Finance needs CSV");
|
|
54
|
+
expect(result.ok).toBe(true);
|
|
55
|
+
expect(result.key).toBe("AGHUB-9");
|
|
56
|
+
expect(result.message).toContain("ba-agent");
|
|
57
|
+
expect(result.message).toContain("agent_offline");
|
|
58
|
+
});
|
|
59
|
+
it("uses an explicit project_id over the bound one, and needs one of them", async () => {
|
|
60
|
+
const client = mockClient({ fileRequest: vi.fn().mockResolvedValue(ok({ request: { key: "X-1" } }, 201)) });
|
|
61
|
+
await handleIntakeRequestToolCall("file_request", { title: "t", project_id: "other" }, client, bound);
|
|
62
|
+
expect(client.fileRequest).toHaveBeenCalledWith("other", "t", "");
|
|
63
|
+
await expect(handleIntakeRequestToolCall("file_request", { title: "t" }, client, () => undefined)).rejects.toThrow(/project/);
|
|
64
|
+
});
|
|
65
|
+
it("reports requests being switched off as unavailable, not denied", async () => {
|
|
66
|
+
const client = mockClient({ fileRequest: vi.fn().mockResolvedValue(fail(503, "requests_disabled")) });
|
|
67
|
+
const result = (await handleIntakeRequestToolCall("file_request", { title: "t" }, client, bound));
|
|
68
|
+
expect(result.ok).toBe(false);
|
|
69
|
+
expect(result.message).toMatch(/^UNAVAILABLE/);
|
|
70
|
+
expect(result.message).toContain("AGENTHUB_REQUESTS_ENABLED");
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
describe("request_triage", () => {
|
|
74
|
+
it("maps original_request to the server's original_request_id, resolving a key", async () => {
|
|
75
|
+
const client = mockClient({
|
|
76
|
+
getRequest: vi.fn().mockResolvedValue(ok({ request: { id: "orig-id", key: "AGHUB-1" } })),
|
|
77
|
+
triageRequest: vi.fn().mockResolvedValue(ok({ outcome: "duplicate", request: { request_state: "duplicate" } })),
|
|
78
|
+
});
|
|
79
|
+
const result = (await handleIntakeRequestToolCall("request_triage", { request: "AGHUB-2", action: "duplicate", original_request: "AGHUB-1" }, client, bound));
|
|
80
|
+
expect(client.getRequest).toHaveBeenCalledWith("proj-1", "AGHUB-1");
|
|
81
|
+
expect(client.triageRequest).toHaveBeenCalledWith("proj-1", "AGHUB-2", {
|
|
82
|
+
action: "duplicate",
|
|
83
|
+
original_request_id: "orig-id",
|
|
84
|
+
});
|
|
85
|
+
expect(result.request_state).toBe("duplicate");
|
|
86
|
+
});
|
|
87
|
+
it("says a non-allowlisted proposal is waiting for a person", async () => {
|
|
88
|
+
const client = mockClient({
|
|
89
|
+
triageRequest: vi.fn().mockResolvedValue(ok({ outcome: "awaiting_approval", review_id: "rev-1", request: { request_state: "triaging" } })),
|
|
90
|
+
});
|
|
91
|
+
const result = (await handleIntakeRequestToolCall("request_triage", { request: "AGHUB-2", action: "propose", change_kind: "feature", summary: "CSV export" }, client, bound));
|
|
92
|
+
expect(result.outcome).toBe("awaiting_approval");
|
|
93
|
+
expect(result.review_id).toBe("rev-1");
|
|
94
|
+
expect(result.message).toContain("WAITING");
|
|
95
|
+
expect(result.message).toContain("Do not start delivery");
|
|
96
|
+
});
|
|
97
|
+
it("tells an auto-approved proposal to scope-check before merging", async () => {
|
|
98
|
+
const client = mockClient({
|
|
99
|
+
triageRequest: vi.fn().mockResolvedValue(ok({ outcome: "auto_approved", epic: { id: "e-1", key: "AGHUB-E3" }, request: { request_state: "in_delivery" } })),
|
|
100
|
+
});
|
|
101
|
+
const result = (await handleIntakeRequestToolCall("request_triage", { request: "AGHUB-2", action: "propose", change_kind: "docs", summary: "doc it" }, client, bound));
|
|
102
|
+
expect(result.epic_key).toBe("AGHUB-E3");
|
|
103
|
+
expect(result.message).toContain("no person approved it");
|
|
104
|
+
expect(result.message).toContain("request_scope_check");
|
|
105
|
+
});
|
|
106
|
+
it("relays proposal_pending with the review it is waiting on", async () => {
|
|
107
|
+
const client = mockClient({
|
|
108
|
+
triageRequest: vi.fn().mockResolvedValue(fail(409, "proposal_pending", { review_id: "rev-7" })),
|
|
109
|
+
});
|
|
110
|
+
const result = (await handleIntakeRequestToolCall("request_triage", { request: "AGHUB-2", action: "reject", reason: "no" }, client, bound));
|
|
111
|
+
expect(result.ok).toBe(false);
|
|
112
|
+
expect(result.error).toBe("proposal_pending");
|
|
113
|
+
expect(result.review_id).toBe("rev-7");
|
|
114
|
+
expect(result.message).toMatch(/^WAITING/);
|
|
115
|
+
});
|
|
116
|
+
it("explains not_triager as someone else's request", async () => {
|
|
117
|
+
const client = mockClient({ triageRequest: vi.fn().mockResolvedValue(fail(403, "not_triager")) });
|
|
118
|
+
const result = (await handleIntakeRequestToolCall("request_triage", { request: "AGHUB-2", action: "ask", questions: "?" }, client, bound));
|
|
119
|
+
expect(result.message).toMatch(/^DENIED/);
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
describe("request_scope_check", () => {
|
|
123
|
+
const check = (result) => mockClient({ requestScopeCheck: vi.fn().mockResolvedValue(ok({ result })) });
|
|
124
|
+
it("only a pass says the pull request may merge", async () => {
|
|
125
|
+
const passed = (await handleIntakeRequestToolCall("request_scope_check", { request: "AGHUB-2", pr_url: "https://github.com/acme/app/pull/4" }, check({ passed: true, outcome: "pass", checked_files: 3 }), bound));
|
|
126
|
+
expect(passed.passed).toBe(true);
|
|
127
|
+
expect(passed.message).toMatch(/^PASSED/);
|
|
128
|
+
for (const outcome of ["outside_scope", "check_failed", "awaiting_exception"]) {
|
|
129
|
+
const result = (await handleIntakeRequestToolCall("request_scope_check", { request: "AGHUB-2", pr_url: "https://github.com/acme/app/pull/4" }, check({ passed: false, outcome, outside_paths: ["server/main.go"], error: "github_error", review_id: "rev-9" }), bound));
|
|
130
|
+
expect(result.passed).toBe(false);
|
|
131
|
+
expect(result.message).toMatch(/^DO NOT MERGE/);
|
|
132
|
+
expect(result.review_id).toBe("rev-9");
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
it("names the out-of-scope files", async () => {
|
|
136
|
+
const result = (await handleIntakeRequestToolCall("request_scope_check", { request: "AGHUB-2", pr_url: "https://github.com/acme/app/pull/4" }, check({ passed: false, outcome: "outside_scope", outside_paths: ["server/main.go", "go.mod"], review_id: "r" }), bound));
|
|
137
|
+
expect(result.outside_paths).toEqual(["server/main.go", "go.mod"]);
|
|
138
|
+
expect(result.message).toContain("server/main.go");
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
describe("ApiClient intake request calls", () => {
|
|
142
|
+
afterEach(() => vi.unstubAllGlobals());
|
|
143
|
+
function stubFetch(status, body) {
|
|
144
|
+
const fetchMock = vi.fn().mockResolvedValue(new Response(typeof body === "string" ? body : JSON.stringify(body), { status }));
|
|
145
|
+
vi.stubGlobal("fetch", fetchMock);
|
|
146
|
+
return fetchMock;
|
|
147
|
+
}
|
|
148
|
+
it("posts to the project-scoped request routes with encoded refs", async () => {
|
|
149
|
+
const client = new ApiClient("https://hub.example/api", "key");
|
|
150
|
+
let fetchMock = stubFetch(201, { request: { key: "A-1" } });
|
|
151
|
+
await client.fileRequest("p 1", "t", "d");
|
|
152
|
+
expect(fetchMock.mock.calls[0][0]).toBe("https://hub.example/api/projects/p%201/requests");
|
|
153
|
+
expect(JSON.parse(fetchMock.mock.calls[0][1].body)).toEqual({ title: "t", description: "d" });
|
|
154
|
+
fetchMock = stubFetch(200, {});
|
|
155
|
+
await client.triageRequest("p1", "A-1", { action: "ask", questions: "?" });
|
|
156
|
+
expect(fetchMock.mock.calls[0][0]).toBe("https://hub.example/api/projects/p1/requests/A-1/triage");
|
|
157
|
+
fetchMock = stubFetch(200, {});
|
|
158
|
+
await client.requestScopeCheck("p1", "A-1", "https://github.com/a/b/pull/1");
|
|
159
|
+
expect(fetchMock.mock.calls[0][0]).toBe("https://hub.example/api/projects/p1/requests/A-1/scope-check");
|
|
160
|
+
expect(JSON.parse(fetchMock.mock.calls[0][1].body)).toEqual({ pr_url: "https://github.com/a/b/pull/1" });
|
|
161
|
+
});
|
|
162
|
+
it("keeps the error body so review_id survives a 409", async () => {
|
|
163
|
+
stubFetch(409, { error: "proposal_pending", message: "waiting", review_id: "rev-3" });
|
|
164
|
+
const client = new ApiClient("https://hub.example/api", "key");
|
|
165
|
+
const result = await client.triageRequest("p1", "A-1", { action: "reject" });
|
|
166
|
+
expect(result.ok).toBe(false);
|
|
167
|
+
if (!result.ok) {
|
|
168
|
+
expect(result.error).toBe("proposal_pending");
|
|
169
|
+
expect(result.data?.review_id).toBe("rev-3");
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
it("carries the status through a non-JSON error body", async () => {
|
|
173
|
+
stubFetch(502, "<html>bad gateway</html>");
|
|
174
|
+
const client = new ApiClient("https://hub.example/api", "key");
|
|
175
|
+
const result = await client.fileRequest("p1", "t", "");
|
|
176
|
+
expect(result.ok).toBe(false);
|
|
177
|
+
if (!result.ok) {
|
|
178
|
+
expect(result.status).toBe(502);
|
|
179
|
+
expect(result.detail).toContain("HTTP 502");
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
});
|
|
183
|
+
//# sourceMappingURL=intakeRequests.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intakeRequests.test.js","sourceRoot":"","sources":["../../src/tools/intakeRequests.test.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC7D,OAAO,EACL,2BAA2B,EAC3B,mBAAmB,EACnB,0BAA0B,GAC3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAKzC,SAAS,UAAU,CAAC,YAAgE,EAAE;IACpF,OAAO;QACL,WAAW,EAAE,EAAE,CAAC,EAAE,EAAE;QACpB,aAAa,EAAE,EAAE,CAAC,EAAE,EAAE;QACtB,iBAAiB,EAAE,EAAE,CAAC,EAAE,EAAE;QAC1B,UAAU,EAAE,EAAE,CAAC,EAAE,EAAE;QACnB,GAAG,SAAS;KACW,CAAC;AAC5B,CAAC;AAED,MAAM,EAAE,GAAG,CAAC,IAA6B,EAAE,MAAM,GAAG,GAAG,EAAwB,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;AAC/G,MAAM,IAAI,GAAG,CAAC,MAAc,EAAE,KAAa,EAAE,OAAgC,EAAE,EAAwB,EAAE,CAAC,CAAC;IACzG,EAAE,EAAE,KAAK;IACT,MAAM;IACN,KAAK;IACL,OAAO,EAAE,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ,CAAC,CA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MAAM,MAAM,GAAG,IAAI,SAAS,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC;QAC/D,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;QACvD,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC9B,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;YACf,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAChC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QAC9C,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* fix-inbox-delivery-and-tool-wrapping §2 — pushed items are consumed only once
|
|
3
|
+
* the response carrying them exists.
|
|
4
|
+
*
|
|
5
|
+
* The bug: wrapWithPendingItems drained the WebSocket queue at the TOP of the
|
|
6
|
+
* function, before two fallible network calls. A fetch that threw or hit its
|
|
7
|
+
* 45s deadline sent control to the catch, which returned the unwrapped result —
|
|
8
|
+
* and the drained messages were gone. Never in a response, never re-queued,
|
|
9
|
+
* never pushed again.
|
|
10
|
+
*/
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=pushedItemsSafety.test.d.ts.map
|