@bendyline/gezel-mcp 1.0.7 → 1.1.1
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/dist/index.d.ts +2 -2
- package/dist/index.js +7 -4
- package/dist/lint-contracts.js +2 -0
- package/dist/server.js +117 -67
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -53,8 +53,8 @@ declare const CONDITIONALLY_REGISTERED_TOOLS: {
|
|
|
53
53
|
readonly modelFacing: false;
|
|
54
54
|
};
|
|
55
55
|
readonly craftbook_update_step: {
|
|
56
|
-
readonly envVar: "
|
|
57
|
-
readonly envValue: "
|
|
56
|
+
readonly envVar: "GEZEL_CRAFTBOOK_STEP_EDITING";
|
|
57
|
+
readonly envValue: "1";
|
|
58
58
|
readonly modelFacing: true;
|
|
59
59
|
};
|
|
60
60
|
readonly request_tool_permission: {
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// src/tool-inventory.ts
|
|
4
|
+
import { resolveDistributionProfile } from "@bendyline/gezel";
|
|
4
5
|
var ALWAYS_REGISTERED_TOOLS = [
|
|
5
6
|
// Memory
|
|
6
7
|
"search_memory",
|
|
@@ -228,11 +229,13 @@ var CONDITIONALLY_REGISTERED_TOOLS = {
|
|
|
228
229
|
modelFacing: false
|
|
229
230
|
},
|
|
230
231
|
// The large surgical-step schema is useful in the explicit craftbook
|
|
231
|
-
// editor, but wasteful on every ordinary
|
|
232
|
-
//
|
|
232
|
+
// editor and in task-scoped plan authoring, but wasteful on every ordinary
|
|
233
|
+
// coordinator turn. The chat manager enables this MCP-side registration
|
|
234
|
+
// for those session types; its exact per-turn allowlist still decides
|
|
235
|
+
// whether the schema reaches the model.
|
|
233
236
|
craftbook_update_step: {
|
|
234
|
-
envVar: "
|
|
235
|
-
envValue: "
|
|
237
|
+
envVar: "GEZEL_CRAFTBOOK_STEP_EDITING",
|
|
238
|
+
envValue: "1",
|
|
236
239
|
modelFacing: true
|
|
237
240
|
},
|
|
238
241
|
request_tool_permission: {
|
package/dist/lint-contracts.js
CHANGED
|
@@ -16,6 +16,7 @@ async function loadBuiltinToolContracts() {
|
|
|
16
16
|
"GEZEL_MCP_TOOL_NAMING",
|
|
17
17
|
"GEZEL_SCRIPT_TOOLS",
|
|
18
18
|
"GEZEL_CRAFTBOOK_ID",
|
|
19
|
+
"GEZEL_CRAFTBOOK_STEP_EDITING",
|
|
19
20
|
"GEZEL_MAIL_ENABLED",
|
|
20
21
|
"GEZEL_SOCIAL_ENABLED",
|
|
21
22
|
"GEZEL_CONNECTORS_ENABLED",
|
|
@@ -30,6 +31,7 @@ async function loadBuiltinToolContracts() {
|
|
|
30
31
|
delete process.env.GEZEL_MCP_TOOL_NAMING;
|
|
31
32
|
delete process.env.GEZEL_SCRIPT_TOOLS;
|
|
32
33
|
process.env.GEZEL_CRAFTBOOK_ID = "schema-lint-craftbook";
|
|
34
|
+
process.env.GEZEL_CRAFTBOOK_STEP_EDITING = "1";
|
|
33
35
|
process.env.GEZEL_MAIL_ENABLED = "1";
|
|
34
36
|
process.env.GEZEL_SOCIAL_ENABLED = "1";
|
|
35
37
|
process.env.GEZEL_CONNECTORS_ENABLED = "1";
|
package/dist/server.js
CHANGED
|
@@ -181,6 +181,58 @@ function normalizeAssigneeArg(raw) {
|
|
|
181
181
|
return { kind: "gezel", ref: trimmed };
|
|
182
182
|
}
|
|
183
183
|
|
|
184
|
+
// src/browser-page-elements.ts
|
|
185
|
+
var INTERACTIVE_ROLES = [
|
|
186
|
+
"button",
|
|
187
|
+
"link",
|
|
188
|
+
"textbox",
|
|
189
|
+
"searchbox",
|
|
190
|
+
"combobox",
|
|
191
|
+
"checkbox",
|
|
192
|
+
"radio",
|
|
193
|
+
"switch",
|
|
194
|
+
"slider",
|
|
195
|
+
"menuitem",
|
|
196
|
+
"menuitemcheckbox",
|
|
197
|
+
"menuitemradio",
|
|
198
|
+
"tab",
|
|
199
|
+
"option",
|
|
200
|
+
"spinbutton"
|
|
201
|
+
];
|
|
202
|
+
var ELEMENT_REF_RE = new RegExp(
|
|
203
|
+
String.raw`^\s*- (` + INTERACTIVE_ROLES.join("|") + String.raw`)\s+"([^"]+)"\s+\[ref=(e\d+)\]`
|
|
204
|
+
);
|
|
205
|
+
function extractPageElementsFromYaml(yaml) {
|
|
206
|
+
const out = [];
|
|
207
|
+
const seen = /* @__PURE__ */ new Set();
|
|
208
|
+
for (const line of yaml.split("\n")) {
|
|
209
|
+
const match = line.match(ELEMENT_REF_RE);
|
|
210
|
+
if (!match) continue;
|
|
211
|
+
const role = match[1];
|
|
212
|
+
const name = match[2];
|
|
213
|
+
const ref = match[3];
|
|
214
|
+
if (!role || !name || !ref) continue;
|
|
215
|
+
const key = `${ref}:${role}:${name}`;
|
|
216
|
+
if (seen.has(key)) continue;
|
|
217
|
+
seen.add(key);
|
|
218
|
+
out.push({ role, name, ref });
|
|
219
|
+
}
|
|
220
|
+
return out;
|
|
221
|
+
}
|
|
222
|
+
function scorePageElementMatch(element, description, role) {
|
|
223
|
+
const desc = description.toLowerCase().trim();
|
|
224
|
+
const elementRole = element.role.toLowerCase();
|
|
225
|
+
const elementName = element.name.toLowerCase();
|
|
226
|
+
let score = 0;
|
|
227
|
+
if (role && elementRole === role.toLowerCase()) score += 10;
|
|
228
|
+
if (desc.length > 0 && elementName.includes(desc)) score += 5;
|
|
229
|
+
if (desc.length > 0 && elementRole.includes(desc)) score += 1;
|
|
230
|
+
for (const word of desc.split(/\s+/).filter(Boolean)) {
|
|
231
|
+
if (elementName.includes(word) || elementRole.includes(word)) score += 1;
|
|
232
|
+
}
|
|
233
|
+
return score;
|
|
234
|
+
}
|
|
235
|
+
|
|
184
236
|
// src/command-result.ts
|
|
185
237
|
function commandResultIsError(result) {
|
|
186
238
|
return !result.ok && result.approvalPending !== true;
|
|
@@ -833,6 +885,7 @@ import { z as z5 } from "zod";
|
|
|
833
885
|
import { z as z4 } from "zod";
|
|
834
886
|
|
|
835
887
|
// src/tool-inventory.ts
|
|
888
|
+
import { resolveDistributionProfile } from "@bendyline/gezel";
|
|
836
889
|
var ALWAYS_REGISTERED_TOOLS = [
|
|
837
890
|
// Memory
|
|
838
891
|
"search_memory",
|
|
@@ -1060,11 +1113,13 @@ var CONDITIONALLY_REGISTERED_TOOLS = {
|
|
|
1060
1113
|
modelFacing: false
|
|
1061
1114
|
},
|
|
1062
1115
|
// The large surgical-step schema is useful in the explicit craftbook
|
|
1063
|
-
// editor, but wasteful on every ordinary
|
|
1064
|
-
//
|
|
1116
|
+
// editor and in task-scoped plan authoring, but wasteful on every ordinary
|
|
1117
|
+
// coordinator turn. The chat manager enables this MCP-side registration
|
|
1118
|
+
// for those session types; its exact per-turn allowlist still decides
|
|
1119
|
+
// whether the schema reaches the model.
|
|
1065
1120
|
craftbook_update_step: {
|
|
1066
|
-
envVar: "
|
|
1067
|
-
envValue: "
|
|
1121
|
+
envVar: "GEZEL_CRAFTBOOK_STEP_EDITING",
|
|
1122
|
+
envValue: "1",
|
|
1068
1123
|
modelFacing: true
|
|
1069
1124
|
},
|
|
1070
1125
|
request_tool_permission: {
|
|
@@ -1098,6 +1153,9 @@ var CONDITIONALLY_REGISTERED_TOOLS = {
|
|
|
1098
1153
|
modelFacing: true
|
|
1099
1154
|
}
|
|
1100
1155
|
};
|
|
1156
|
+
function distributionWithheldTools(env = process.env) {
|
|
1157
|
+
return resolveDistributionProfile(env).allowNpmInstalls ? [] : ["npm_install"];
|
|
1158
|
+
}
|
|
1101
1159
|
var HOST_CALLBACK_TOOLS = Object.freeze(
|
|
1102
1160
|
/* @__PURE__ */ new Set(["request_tool_permission"])
|
|
1103
1161
|
);
|
|
@@ -1376,7 +1434,12 @@ var BatchReadToolOutputSchema = z4.object({
|
|
|
1376
1434
|
startLine: z4.number().int().positive().optional(),
|
|
1377
1435
|
endLine: z4.number().int().nonnegative().optional(),
|
|
1378
1436
|
completeFile: z4.boolean().optional(),
|
|
1379
|
-
code: z4.string().optional()
|
|
1437
|
+
code: z4.string().optional(),
|
|
1438
|
+
content: z4.string().optional(),
|
|
1439
|
+
totalLines: z4.number().int().nonnegative().optional(),
|
|
1440
|
+
hasMore: z4.boolean().optional(),
|
|
1441
|
+
nextStartLine: z4.number().int().positive().optional(),
|
|
1442
|
+
error: z4.string().optional()
|
|
1380
1443
|
})
|
|
1381
1444
|
)
|
|
1382
1445
|
});
|
|
@@ -3384,7 +3447,8 @@ var excludedToolNames = new Set(
|
|
|
3384
3447
|
// `GEZEL_MCP_SCHEMA_LINT` registers the whole corpus regardless of what
|
|
3385
3448
|
// this host can actually sandbox, so schema lints and tool-response
|
|
3386
3449
|
// tests see the same tools everywhere.
|
|
3387
|
-
...process.env.GEZEL_MCP_SCHEMA_LINT === "1" ? [] : unavailableToolsForPlatform(process.platform)
|
|
3450
|
+
...process.env.GEZEL_MCP_SCHEMA_LINT === "1" ? [] : unavailableToolsForPlatform(process.platform),
|
|
3451
|
+
...distributionWithheldTools()
|
|
3388
3452
|
].map(canonicalToolName)
|
|
3389
3453
|
);
|
|
3390
3454
|
if (process.env.GEZEL_MCP_LEGACY_TOOLS !== "1") {
|
|
@@ -3398,7 +3462,9 @@ if (process.env.GEZEL_MCP_LEGACY_TOOLS !== "1") {
|
|
|
3398
3462
|
excludedToolNames.add(name);
|
|
3399
3463
|
}
|
|
3400
3464
|
}
|
|
3401
|
-
if (
|
|
3465
|
+
if (process.env.GEZEL_CRAFTBOOK_STEP_EDITING !== "1") {
|
|
3466
|
+
excludedToolNames.add("craftbook_update_step");
|
|
3467
|
+
}
|
|
3402
3468
|
var allowEnv = process.env.GEZEL_MCP_ALLOW;
|
|
3403
3469
|
var allowedToolNames = allowEnv === void 0 ? null : new Set(
|
|
3404
3470
|
allowEnv.split(",").map((s) => s.trim()).filter(Boolean).map(canonicalToolName)
|
|
@@ -4216,15 +4282,26 @@ ${index.join("\n")}
|
|
|
4216
4282
|
${sections.join("\n\n")}`
|
|
4217
4283
|
}
|
|
4218
4284
|
],
|
|
4285
|
+
// Structured-first hosts need the same file slices, pagination, and
|
|
4286
|
+
// item-level errors that the formatted text exposes.
|
|
4219
4287
|
structuredContent: {
|
|
4220
4288
|
results: response.results.map(
|
|
4221
4289
|
(result) => result.status === "ok" ? {
|
|
4222
4290
|
path: result.path,
|
|
4223
4291
|
status: result.status,
|
|
4292
|
+
content: result.content,
|
|
4224
4293
|
startLine: result.startLine,
|
|
4225
4294
|
endLine: result.endLine,
|
|
4226
|
-
completeFile: result.completeFile
|
|
4227
|
-
|
|
4295
|
+
completeFile: result.completeFile,
|
|
4296
|
+
totalLines: result.totalLines,
|
|
4297
|
+
hasMore: result.hasMore,
|
|
4298
|
+
nextStartLine: result.nextStartLine
|
|
4299
|
+
} : {
|
|
4300
|
+
path: result.path,
|
|
4301
|
+
status: result.status,
|
|
4302
|
+
code: result.code,
|
|
4303
|
+
error: result.error
|
|
4304
|
+
}
|
|
4228
4305
|
)
|
|
4229
4306
|
},
|
|
4230
4307
|
...allFailed ? { isError: true } : {}
|
|
@@ -5989,7 +6066,13 @@ ${res.candidates.map((p) => ` \u2022 ${p}`).join("\n")}`
|
|
|
5989
6066
|
structuredContent: {
|
|
5990
6067
|
requestedPath: clean,
|
|
5991
6068
|
resolvedPath: res.path,
|
|
5992
|
-
fuzzy: res.fuzzy
|
|
6069
|
+
fuzzy: res.fuzzy,
|
|
6070
|
+
// Hosts may prefer structuredContent over the text blocks. Both forms
|
|
6071
|
+
// must carry the requested slice, not just its lookup metadata.
|
|
6072
|
+
content: res.content,
|
|
6073
|
+
linesReturned: res.linesReturned,
|
|
6074
|
+
totalLines: res.totalLines,
|
|
6075
|
+
hasMore: res.hasMore
|
|
5993
6076
|
}
|
|
5994
6077
|
};
|
|
5995
6078
|
}
|
|
@@ -6110,56 +6193,6 @@ ${res.candidates.map((p) => ` \u2022 ${p}`).join("\n")}`
|
|
|
6110
6193
|
};
|
|
6111
6194
|
}
|
|
6112
6195
|
);
|
|
6113
|
-
var PAGE_ELEMENT_INTERACTIVE_ROLES = [
|
|
6114
|
-
"button",
|
|
6115
|
-
"link",
|
|
6116
|
-
"textbox",
|
|
6117
|
-
"searchbox",
|
|
6118
|
-
"combobox",
|
|
6119
|
-
"checkbox",
|
|
6120
|
-
"radio",
|
|
6121
|
-
"switch",
|
|
6122
|
-
"slider",
|
|
6123
|
-
"menuitem",
|
|
6124
|
-
"menuitemcheckbox",
|
|
6125
|
-
"menuitemradio",
|
|
6126
|
-
"tab",
|
|
6127
|
-
"option",
|
|
6128
|
-
"spinbutton"
|
|
6129
|
-
];
|
|
6130
|
-
var PAGE_ELEMENT_REF_RE = new RegExp(
|
|
6131
|
-
String.raw`^\s*- (` + PAGE_ELEMENT_INTERACTIVE_ROLES.join("|") + String.raw`)\s+"([^"]+)"\s+\[ref=(e\d+)\]`
|
|
6132
|
-
);
|
|
6133
|
-
function extractPageElementsFromYaml(yaml) {
|
|
6134
|
-
const out = [];
|
|
6135
|
-
const seen = /* @__PURE__ */ new Set();
|
|
6136
|
-
for (const line of yaml.split("\n")) {
|
|
6137
|
-
const m = line.match(PAGE_ELEMENT_REF_RE);
|
|
6138
|
-
if (!m) continue;
|
|
6139
|
-
const role = m[1];
|
|
6140
|
-
const name = m[2];
|
|
6141
|
-
const ref = m[3];
|
|
6142
|
-
if (!role || !name || !ref) continue;
|
|
6143
|
-
const key = `${ref}:${role}:${name}`;
|
|
6144
|
-
if (seen.has(key)) continue;
|
|
6145
|
-
seen.add(key);
|
|
6146
|
-
out.push({ role, name, ref });
|
|
6147
|
-
}
|
|
6148
|
-
return out;
|
|
6149
|
-
}
|
|
6150
|
-
function scorePageElementMatch(el, description, role) {
|
|
6151
|
-
const desc = description.toLowerCase().trim();
|
|
6152
|
-
const elRole = el.role.toLowerCase();
|
|
6153
|
-
const elName = el.name.toLowerCase();
|
|
6154
|
-
let score = 0;
|
|
6155
|
-
if (role && elRole === role.toLowerCase()) score += 10;
|
|
6156
|
-
if (desc.length > 0 && elName.includes(desc)) score += 5;
|
|
6157
|
-
if (desc.length > 0 && elRole.includes(desc)) score += 1;
|
|
6158
|
-
for (const word of desc.split(/\s+/).filter(Boolean)) {
|
|
6159
|
-
if (elName.includes(word) || elRole.includes(word)) score += 1;
|
|
6160
|
-
}
|
|
6161
|
-
return score;
|
|
6162
|
-
}
|
|
6163
6196
|
async function findLatestSnapshotPath() {
|
|
6164
6197
|
try {
|
|
6165
6198
|
const res = await api.listProjectArtifacts(projectId, "auto/browser_snapshot", true);
|
|
@@ -7906,7 +7939,7 @@ server.tool(
|
|
|
7906
7939
|
);
|
|
7907
7940
|
server.tool(
|
|
7908
7941
|
"message_gezel",
|
|
7909
|
-
'Send a message to another gezel (status check, nudge, broadcast, or file handoff). This is async fire-and-forget: it drops the message into their active project session and their reply surfaces automatically in
|
|
7942
|
+
'Send a message to another gezel (status check, nudge, broadcast, or file handoff). This is async fire-and-forget: it drops the message into their active project session and their reply surfaces automatically in a later turn. After a successful call, END YOUR TURN immediately \u2014 remaining alive can keep the recipient parked and occupies a provider slot. Use this for fan-out and ambient updates; emit every fan-out call in the same tool-call batch before ending. For explicit consultations where you need an inline answer before continuing, use `ask_gezel`. For substantial multi-step work, use tasks + `advance_task_step`. Do NOT just say \'I\'ll talk to Maya\' in chat; that does nothing. Call this tool. When the message asks them to produce a long-form file deliverable (a review, a report, an analysis, a written design), pass `expectedDeliverable: { kind: "file", filePath: "<path>" }` \u2014 the target will be steered to `write_file` the deliverable and reply with just the path + a short precis, instead of pasting the full text into chat (the matrix #2 squisq-review failure mode).',
|
|
7910
7943
|
{
|
|
7911
7944
|
gezel: z6.string().optional().describe("Target gezel id or display name"),
|
|
7912
7945
|
// `gezelId` is the spelling models reach for; without it the slip
|
|
@@ -7961,7 +7994,9 @@ ${expectedDeliverable?.kind === "file" ? expectedDeliverable.filePath ?? "" : ""
|
|
|
7961
7994
|
}
|
|
7962
7995
|
const deliverableText = expectedDeliverable?.kind === "file" ? ` They have been asked to write ${expectedDeliverable.filePath ? `\`${expectedDeliverable.filePath}\`` : "the file"} before replying.` : "";
|
|
7963
7996
|
const responseWasDeduplicated = res.deduplicated;
|
|
7964
|
-
const
|
|
7997
|
+
const deliveryState = messageGezelDeliveryState(res);
|
|
7998
|
+
const releaseInstruction = asyncHandoffReleaseInstruction(res.toGezelName, deliveryState);
|
|
7999
|
+
const responseText = responseWasDeduplicated ? `An identical file handoff is already pending with ${res.toGezelName}; joined it instead of creating another message. ${releaseInstruction}` : deliveryState === "parked" ? `Accepted the message for ${res.toGezelName}.${deliverableText} ${releaseInstruction}` : `Dispatched the message to ${res.toGezelName}.${deliverableText} ${releaseInstruction}`;
|
|
7965
8000
|
return {
|
|
7966
8001
|
content: [
|
|
7967
8002
|
{
|
|
@@ -7972,6 +8007,15 @@ ${expectedDeliverable?.kind === "file" ? expectedDeliverable.filePath ?? "" : ""
|
|
|
7972
8007
|
};
|
|
7973
8008
|
}
|
|
7974
8009
|
);
|
|
8010
|
+
function messageGezelDeliveryState(response) {
|
|
8011
|
+
return response.deliveryState === "dispatched" ? "dispatched" : "parked";
|
|
8012
|
+
}
|
|
8013
|
+
function asyncHandoffReleaseInstruction(recipientName, deliveryState) {
|
|
8014
|
+
if (deliveryState === "parked") {
|
|
8015
|
+
return `The handoff is durably parked and has NOT entered ${recipientName}'s provider queue because your current turn still holds its slot. END YOUR TURN NOW \u2014 do not call more tools or wait \u2014 so this turn releases the slot and ${recipientName}'s turn can dispatch. Their reply will arrive asynchronously in a later turn.`;
|
|
8016
|
+
}
|
|
8017
|
+
return `${recipientName}'s turn has entered the provider queue. END YOUR TURN NOW \u2014 do not call more tools or wait \u2014 so your turn releases its provider slot. Their reply will arrive asynchronously in a later turn.`;
|
|
8018
|
+
}
|
|
7975
8019
|
function normalizeFileHandoffMessage(message, expectedDeliverable) {
|
|
7976
8020
|
if (expectedDeliverable?.kind !== "file" || !expectedDeliverable.filePath) return message;
|
|
7977
8021
|
const filePath = expectedDeliverable.filePath;
|
|
@@ -8316,7 +8360,7 @@ var DELEGATION_ROLE_SPECS = [
|
|
|
8316
8360
|
for (const { slug, jobTitle, label, hint } of DELEGATION_ROLE_SPECS) {
|
|
8317
8361
|
server.tool(
|
|
8318
8362
|
`delegate_${slug}`,
|
|
8319
|
-
`Hand a task to a project's ${label} (${hint}) \u2014 ASYNC. Auto-creates a ${label} if none exists; their reply lands in
|
|
8363
|
+
`Hand a task to a project's ${label} (${hint}) \u2014 ASYNC. Auto-creates a ${label} if none exists; their reply lands in a later turn. After a successful call, END YOUR TURN immediately so the recipient can dispatch and your provider slot is released. The target IS this tool, so you never pick a name. For work in a project you created from Default, pass \`project\` so files land in that project. For a quick synchronous question instead, use \`consult_${slug}\`.`,
|
|
8320
8364
|
{
|
|
8321
8365
|
task: z6.string().min(1).describe(
|
|
8322
8366
|
`What you want the ${label} to do. Be specific \u2014 they only see this message, not your conversation.`
|
|
@@ -8362,11 +8406,13 @@ ${expectedDeliverable?.kind === "file" ? expectedDeliverable.filePath ?? "" : ""
|
|
|
8362
8406
|
...expectedDeliverable ? { expectedDeliverable } : {}
|
|
8363
8407
|
});
|
|
8364
8408
|
const responseWasDeduplicated = res.deduplicated;
|
|
8409
|
+
const deliveryState = messageGezelDeliveryState(res);
|
|
8410
|
+
const releaseInstruction = asyncHandoffReleaseInstruction(res.toGezelName, deliveryState);
|
|
8365
8411
|
return {
|
|
8366
8412
|
content: [
|
|
8367
8413
|
{
|
|
8368
8414
|
type: "text",
|
|
8369
|
-
text: responseWasDeduplicated ? `An identical file handoff is already pending with ${res.toGezelName} (${label}); joined it instead of
|
|
8415
|
+
text: responseWasDeduplicated ? `An identical file handoff is already pending with ${res.toGezelName} (${label}); joined it instead of creating another message. ${releaseInstruction}` : `${deliveryState === "parked" ? "Accepted the handoff for" : "Dispatched the handoff to"} ${res.toGezelName} (${label}) in project "${resolvedProject}". ${releaseInstruction} [hint: ${res.toGezelName} is now on that project; the user can switch to their chat for follow-ups.]`
|
|
8370
8416
|
}
|
|
8371
8417
|
]
|
|
8372
8418
|
};
|
|
@@ -10375,12 +10421,16 @@ server.tool(
|
|
|
10375
10421
|
}
|
|
10376
10422
|
const { task, gate } = advanced;
|
|
10377
10423
|
if (gate) {
|
|
10378
|
-
const
|
|
10424
|
+
const exitHookFailed = gate.hook === "onExit";
|
|
10425
|
+
const pausedNote = exitHookFailed ? " The lifecycle script could not finish, so the task is PAUSED and the step remains incomplete. Do not retry or rewrite the deliverable; report the script/runtime problem." : gate.infrastructureError ? " The gate itself could not run, so the task is PAUSED and no deliverable attempt was consumed. Do not rewrite the deliverable; report the gate/runtime problem." : gate.paused ? " The rejection budget is exhausted \u2014 the task is now PAUSED for the user; summarize where you got stuck and what you tried." : " Address these specifically, then call `advance_task_step` again.";
|
|
10379
10426
|
const failedRun = gate.scriptRuns?.find((run) => run.error || run.runId);
|
|
10380
10427
|
const diagnosticNote = failedRun ? `
|
|
10381
10428
|
Script diagnostic: ${failedRun.scriptName}${failedRun.runId ? ` (run ${failedRun.runId})` : ""}${failedRun.error ? ` \u2014 ${failedRun.error}` : ""}. Full redacted logs are in the task note.` : "";
|
|
10382
10429
|
return errorResult(
|
|
10383
|
-
|
|
10430
|
+
exitHookFailed ? `Step "${stepId}" on ${ref} was NOT completed because its onExit script failed:
|
|
10431
|
+
|
|
10432
|
+
${gate.message}
|
|
10433
|
+
${pausedNote}${diagnosticNote}` : gate.infrastructureError ? `Step "${stepId}" on ${ref} was NOT completed because its gate could not run:
|
|
10384
10434
|
|
|
10385
10435
|
${gate.message}
|
|
10386
10436
|
${pausedNote}${diagnosticNote}` : `Step "${stepId}" on ${ref} was NOT completed \u2014 its gate rejected the work (attempt ${gate.attempt}/${gate.maxAttempts}):
|
|
@@ -10388,7 +10438,7 @@ ${pausedNote}${diagnosticNote}` : `Step "${stepId}" on ${ref} was NOT completed
|
|
|
10388
10438
|
${gate.message}
|
|
10389
10439
|
${pausedNote}`,
|
|
10390
10440
|
{
|
|
10391
|
-
code: gate.infrastructureError ? "gate_infrastructure_error" : "gate_rejected",
|
|
10441
|
+
code: exitHookFailed ? "step_exit_script_failed" : gate.infrastructureError ? "gate_infrastructure_error" : "gate_rejected",
|
|
10392
10442
|
retryable: !gate.paused && !gate.infrastructureError
|
|
10393
10443
|
}
|
|
10394
10444
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bendyline/gezel-mcp",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Gezel MCP server — gives agents access to memory, workspace, artifacts, and tools.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
"!dist/**/*.map"
|
|
56
56
|
],
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@bendyline/gezel": "1.
|
|
59
|
-
"@bendyline/gezel-client": "1.
|
|
58
|
+
"@bendyline/gezel": "1.1.1",
|
|
59
|
+
"@bendyline/gezel-client": "1.1.1",
|
|
60
60
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
61
61
|
"typescript": "^6.0.3",
|
|
62
62
|
"zod": "^4.4.3"
|