@bendyline/gezel-mcp 1.2.0 → 1.2.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 +3 -291
- package/dist/index.js +16 -396
- package/dist/server.js +1000 -1668
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,402 +1,22 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// src/tool-inventory.ts
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"insert_at_marker",
|
|
21
|
-
"delete_path",
|
|
22
|
-
"make_dir",
|
|
23
|
-
"rename",
|
|
24
|
-
"copy_artifact_to_workspace",
|
|
25
|
-
"validate",
|
|
26
|
-
// Execution (Node / npm / playwright)
|
|
27
|
-
"npm_install",
|
|
28
|
-
"list_package_scripts",
|
|
29
|
-
"run_package_script",
|
|
30
|
-
"run_npx",
|
|
31
|
-
"run_nodejs_script",
|
|
32
|
-
"derive_file",
|
|
33
|
-
"list_packages",
|
|
34
|
-
"run_playwright_script",
|
|
35
|
-
// Artifacts (project-scoped)
|
|
36
|
-
"list_artifacts",
|
|
37
|
-
"read_artifact",
|
|
38
|
-
"read_artifacts",
|
|
39
|
-
"write_artifact",
|
|
40
|
-
"grep_artifact",
|
|
41
|
-
"browser_find_page_element",
|
|
42
|
-
// Documents (shared library)
|
|
43
|
-
"list_documents",
|
|
44
|
-
"read_document",
|
|
45
|
-
"write_document",
|
|
46
|
-
"delete_document",
|
|
47
|
-
"search_documents",
|
|
48
|
-
// Team / gezels
|
|
49
|
-
"list_gezels",
|
|
50
|
-
"create_gezel",
|
|
51
|
-
"list_gilde",
|
|
52
|
-
"list_project_types",
|
|
53
|
-
"apply_project_type",
|
|
54
|
-
"start_project_from_type",
|
|
55
|
-
"export_ai_app",
|
|
56
|
-
"import_ai_app",
|
|
57
|
-
"ensure_gezel",
|
|
58
|
-
"update_gezel",
|
|
59
|
-
"message_gezel",
|
|
60
|
-
"ask_gezel",
|
|
61
|
-
"ask_specialist",
|
|
62
|
-
// Role-typed delegation (always registered; surfaced per session only
|
|
63
|
-
// when the `tools.gezels-as-roles` behavior is active — see
|
|
64
|
-
// role-tool-filter.ts + builtin-toolsets.ts `role-delegation*` groups).
|
|
65
|
-
"delegate_developer",
|
|
66
|
-
"consult_developer",
|
|
67
|
-
"delegate_designer",
|
|
68
|
-
"consult_designer",
|
|
69
|
-
"delegate_reviewer",
|
|
70
|
-
"consult_reviewer",
|
|
71
|
-
"delegate_planner",
|
|
72
|
-
"consult_planner",
|
|
73
|
-
"delegate_researcher",
|
|
74
|
-
"consult_researcher",
|
|
75
|
-
"delegate_builder",
|
|
76
|
-
"consult_builder",
|
|
77
|
-
"delegate_writer",
|
|
78
|
-
"consult_writer",
|
|
79
|
-
"delegate_image_generator",
|
|
80
|
-
"consult_image_generator",
|
|
81
|
-
"delegate_voorman",
|
|
82
|
-
"consult_voorman",
|
|
83
|
-
"delegate_meester",
|
|
84
|
-
"consult_meester",
|
|
85
|
-
// User
|
|
86
|
-
"ask_user_question",
|
|
87
|
-
// Projects
|
|
88
|
-
"list_projects",
|
|
89
|
-
"start_project",
|
|
90
|
-
"fetch_repo",
|
|
91
|
-
"fetch_diff",
|
|
92
|
-
"update_project",
|
|
93
|
-
"list_project_gezels",
|
|
94
|
-
"add_gezel_to_project",
|
|
95
|
-
"remove_gezel_from_project",
|
|
96
|
-
"list_suggested_work",
|
|
97
|
-
"enable_suggested_work",
|
|
98
|
-
"disable_suggested_work",
|
|
99
|
-
// Tasks
|
|
100
|
-
"list_tasks",
|
|
101
|
-
"get_task",
|
|
102
|
-
"create_task",
|
|
103
|
-
"start_plan",
|
|
104
|
-
"update_task",
|
|
105
|
-
"set_outcomes",
|
|
106
|
-
"verify_outcome",
|
|
107
|
-
"add_verification_step",
|
|
108
|
-
"spawn_task_instances",
|
|
109
|
-
"list_task_children",
|
|
110
|
-
"set_task_status",
|
|
111
|
-
"manage_task",
|
|
112
|
-
"activate_task",
|
|
113
|
-
"assign_task",
|
|
114
|
-
"add_task_step",
|
|
115
|
-
"advance_task_step",
|
|
116
|
-
"read_task_notes",
|
|
117
|
-
"write_task_note",
|
|
118
|
-
// History
|
|
119
|
-
"search_history",
|
|
120
|
-
"search_sessions",
|
|
121
|
-
// Handboek (built-in documentation)
|
|
122
|
-
"how_do_i",
|
|
123
|
-
// Images
|
|
124
|
-
"render_image",
|
|
125
|
-
"generate_image",
|
|
126
|
-
"describe_image",
|
|
127
|
-
"read_image_metadata",
|
|
128
|
-
// Video
|
|
129
|
-
"generate_video",
|
|
130
|
-
// Audio (whisper.cpp STT + Kokoro TTS)
|
|
131
|
-
"transcribe_audio",
|
|
132
|
-
"synthesize_speech",
|
|
133
|
-
// Web
|
|
134
|
-
"fetch_url",
|
|
135
|
-
"web_search",
|
|
136
|
-
"wikipedia_search",
|
|
137
|
-
"wikimedia_image_search",
|
|
138
|
-
"wikipedia_read",
|
|
139
|
-
// Search / files
|
|
140
|
-
"search",
|
|
141
|
-
"grep_files",
|
|
142
|
-
"find_files",
|
|
143
|
-
"diff_files",
|
|
144
|
-
"read_image_as_base64",
|
|
145
|
-
// Code intelligence (workspace content index)
|
|
146
|
-
"outline_file",
|
|
147
|
-
"find_symbol",
|
|
148
|
-
"read_symbol",
|
|
149
|
-
"find_references",
|
|
150
|
-
"map_repo",
|
|
151
|
-
"search_code",
|
|
152
|
-
"file_review",
|
|
153
|
-
"list_file_issues",
|
|
154
|
-
"get_file_issue",
|
|
155
|
-
"set_file_issue_status",
|
|
156
|
-
// Security intelligence (static security analysis over the index)
|
|
157
|
-
"security_scan",
|
|
158
|
-
"security_overview",
|
|
159
|
-
"scan_findings",
|
|
160
|
-
"map_attack_surface",
|
|
161
|
-
"list_dependencies",
|
|
162
|
-
"trace_taint",
|
|
163
|
-
// Document intelligence (converted office docs)
|
|
164
|
-
"search_docs",
|
|
165
|
-
"read_doc_as_markdown",
|
|
166
|
-
// Image intelligence (workspace image library)
|
|
167
|
-
"search_images",
|
|
168
|
-
"find_similar_images",
|
|
169
|
-
"describe_folder",
|
|
170
|
-
// Entity intelligence (meta-boekwachter: cross-file entities)
|
|
171
|
-
"find_entity",
|
|
172
|
-
"list_entity_mentions",
|
|
173
|
-
// Archives
|
|
174
|
-
"list_archive",
|
|
175
|
-
"extract_archive",
|
|
176
|
-
// Git
|
|
177
|
-
"run_git",
|
|
178
|
-
// Scripts
|
|
179
|
-
"list_scripts",
|
|
180
|
-
"run_installed_script",
|
|
181
|
-
"get_script_run",
|
|
182
|
-
// Craftbooks (procedures)
|
|
183
|
-
"list_craftbooks",
|
|
184
|
-
"suggest_craftbook",
|
|
185
|
-
"invoke_craftbook",
|
|
186
|
-
"import_skill",
|
|
187
|
-
// Craftbook editing (template authoring + step surgery)
|
|
188
|
-
"craftbook_read",
|
|
189
|
-
"craftbook_write",
|
|
190
|
-
"craftbook_add_step",
|
|
191
|
-
"set_step_deliverable",
|
|
192
|
-
"craftbook_remove_step",
|
|
193
|
-
"craftbook_reorder_steps",
|
|
194
|
-
"craftbook_set_entry",
|
|
195
|
-
"craftbook_update",
|
|
196
|
-
"export_task_craftbook",
|
|
197
|
-
// GitHub (PR + workflow operations)
|
|
198
|
-
"github_pr_list",
|
|
199
|
-
"github_pr_view",
|
|
200
|
-
"github_pr_files",
|
|
201
|
-
"github_pr_file",
|
|
202
|
-
"github_pr_diff",
|
|
203
|
-
"github_pr_comments",
|
|
204
|
-
"github_pr_comment",
|
|
205
|
-
"github_pr_create",
|
|
206
|
-
"github_workflow_runs",
|
|
207
|
-
"github_check_status"
|
|
208
|
-
];
|
|
209
|
-
var CONDITIONALLY_REGISTERED_TOOLS = {
|
|
210
|
-
// Compatibility aliases consolidated into smaller primary tools. Hidden
|
|
211
|
-
// from model sessions by default; direct MCP clients can opt in while they
|
|
212
|
-
// migrate by setting GEZEL_MCP_LEGACY_TOOLS=1.
|
|
213
|
-
create_gezel_from_gilde: {
|
|
214
|
-
envVar: "GEZEL_MCP_LEGACY_TOOLS",
|
|
215
|
-
envValue: "1",
|
|
216
|
-
modelFacing: false
|
|
217
|
-
},
|
|
218
|
-
start_job: { envVar: "GEZEL_MCP_LEGACY_TOOLS", envValue: "1", modelFacing: false },
|
|
219
|
-
list_project_local_gezels: {
|
|
220
|
-
envVar: "GEZEL_MCP_LEGACY_TOOLS",
|
|
221
|
-
envValue: "1",
|
|
222
|
-
modelFacing: false
|
|
223
|
-
},
|
|
224
|
-
craftbook_create: {
|
|
225
|
-
envVar: "GEZEL_MCP_LEGACY_TOOLS",
|
|
226
|
-
envValue: "1",
|
|
227
|
-
modelFacing: false
|
|
228
|
-
},
|
|
229
|
-
craftbook_replace: {
|
|
230
|
-
envVar: "GEZEL_MCP_LEGACY_TOOLS",
|
|
231
|
-
envValue: "1",
|
|
232
|
-
modelFacing: false
|
|
233
|
-
},
|
|
234
|
-
// The large surgical-step schema is useful in the explicit craftbook
|
|
235
|
-
// editor and in task-scoped plan authoring, but wasteful on every ordinary
|
|
236
|
-
// coordinator turn. The chat manager enables this MCP-side registration
|
|
237
|
-
// for those session types; its exact per-turn allowlist still decides
|
|
238
|
-
// whether the schema reaches the model.
|
|
239
|
-
craftbook_update_step: {
|
|
240
|
-
envVar: "GEZEL_CRAFTBOOK_STEP_EDITING",
|
|
241
|
-
envValue: "1",
|
|
242
|
-
modelFacing: true
|
|
243
|
-
},
|
|
244
|
-
request_tool_permission: {
|
|
245
|
-
envVar: "GEZEL_PERMISSION_PROMPT",
|
|
246
|
-
envValue: "1",
|
|
247
|
-
modelFacing: false
|
|
248
|
-
},
|
|
249
|
-
// Observation-table tools — registered only for projects that actually hold
|
|
250
|
-
// a tabular corpus (the chat manager sets GEZEL_TABLES_ENABLED after a
|
|
251
|
-
// directory probe). The tool listing is injected into every system prompt,
|
|
252
|
-
// so three tools a project can never use are pure prompt cost at depth —
|
|
253
|
-
// and a model that sees a tool tends to reach for it.
|
|
254
|
-
list_tables: { envVar: "GEZEL_TABLES_ENABLED", envValue: "1", modelFacing: true },
|
|
255
|
-
describe_table: { envVar: "GEZEL_TABLES_ENABLED", envValue: "1", modelFacing: true },
|
|
256
|
-
query_table: { envVar: "GEZEL_TABLES_ENABLED", envValue: "1", modelFacing: true },
|
|
257
|
-
// Email write tools — registered only for mail-enabled projects (the chat
|
|
258
|
-
// manager sets GEZEL_MAIL_ENABLED when project.mail is configured).
|
|
259
|
-
draft_email: { envVar: "GEZEL_MAIL_ENABLED", envValue: "1", modelFacing: true },
|
|
260
|
-
queue_email: { envVar: "GEZEL_MAIL_ENABLED", envValue: "1", modelFacing: true },
|
|
261
|
-
send_email: { envVar: "GEZEL_MAIL_ENABLED", envValue: "1", modelFacing: true },
|
|
262
|
-
// Social post write tools — registered only for projects with a social-type
|
|
263
|
-
// connector binding (the chat manager sets GEZEL_SOCIAL_ENABLED).
|
|
264
|
-
draft_post: { envVar: "GEZEL_SOCIAL_ENABLED", envValue: "1", modelFacing: true },
|
|
265
|
-
queue_post: { envVar: "GEZEL_SOCIAL_ENABLED", envValue: "1", modelFacing: true },
|
|
266
|
-
publish_post: { envVar: "GEZEL_SOCIAL_ENABLED", envValue: "1", modelFacing: true },
|
|
267
|
-
// Generic connector writes are draft-only and appear only for projects
|
|
268
|
-
// with at least one connector binding.
|
|
269
|
-
draft_connector_action: {
|
|
270
|
-
envVar: "GEZEL_CONNECTORS_ENABLED",
|
|
271
|
-
envValue: "1",
|
|
272
|
-
modelFacing: true
|
|
273
|
-
}
|
|
274
|
-
};
|
|
275
|
-
var HOST_CALLBACK_TOOLS = Object.freeze(
|
|
276
|
-
/* @__PURE__ */ new Set(["request_tool_permission"])
|
|
277
|
-
);
|
|
278
|
-
var RENAMED_TOOLS = {
|
|
279
|
-
readdir: "list_dir",
|
|
280
|
-
readFile: "read_file",
|
|
281
|
-
read_multiple_files: "read_files",
|
|
282
|
-
writeFile: "write_file",
|
|
283
|
-
appendToFile: "append_to_file",
|
|
284
|
-
replaceInFile: "replace_in_file",
|
|
285
|
-
replaceLines: "replace_lines",
|
|
286
|
-
applyPatch: "apply_patch",
|
|
287
|
-
insertAtMarker: "insert_at_marker",
|
|
288
|
-
rm: "delete_path",
|
|
289
|
-
mkdir: "make_dir",
|
|
290
|
-
draftEmail: "draft_email",
|
|
291
|
-
queueEmail: "queue_email",
|
|
292
|
-
sendEmail: "send_email",
|
|
293
|
-
// Familiar coding-agent vocabulary improves tool selection for local
|
|
294
|
-
// models. The old semantic name remains a hidden dispatch alias.
|
|
295
|
-
search_files: "grep_files",
|
|
296
|
-
// Not part of the snake_case sweep — a later, semantic rename. `run_script`
|
|
297
|
-
// read as "run a script", so models that had just written `derive.mjs`
|
|
298
|
-
// called it with a file path and got a "script not found" dead end; the
|
|
299
|
-
// 2026-08-02 core suite caught gemma4-e4b doing this 6 times in one trial
|
|
300
|
-
// and then fabricating the output it could not compute. Measured, not
|
|
301
|
-
// assumed: forcing `prompt.derive-by-execution` (whose text names
|
|
302
|
-
// `derive_file` and `run_nodejs_script` outright) did NOT redirect it —
|
|
303
|
-
// the model still reached for `run_script`. The name is the pull, so the
|
|
304
|
-
// name changes; `run_script` stays callable here forever.
|
|
305
|
-
run_script: "run_installed_script"
|
|
306
|
-
};
|
|
307
|
-
var TOOL_NAME_TOMBSTONES = {
|
|
308
|
-
update_task_step: { replacement: void 0, reason: "no such MCP tool" },
|
|
309
|
-
commitProjectGit: { replacement: void 0, reason: "UI/client method, not an MCP tool" },
|
|
310
|
-
pushProjectGit: { replacement: void 0, reason: "UI/client method, not an MCP tool" },
|
|
311
|
-
listAudioVoices: { replacement: void 0, reason: "UI/client method, not an MCP tool" },
|
|
312
|
-
create_project: { replacement: "start_project", reason: "removed project-creation tool" },
|
|
313
|
-
inspect_git_workdir: { replacement: "run_git", reason: "foreign coding-agent tool" },
|
|
314
|
-
ensureGezel: { replacement: "ensure_gezel", reason: "client method, not an MCP tool" },
|
|
315
|
-
pushProjectGithub: { replacement: void 0, reason: "client method, not an MCP tool" },
|
|
316
|
-
AskUserQuestion: { replacement: "ask_user_question", reason: "foreign coding-agent tool" },
|
|
317
|
-
WebSearch: { replacement: "web_search", reason: "foreign coding-agent tool" },
|
|
318
|
-
Grep: { replacement: "grep_files", reason: "foreign coding-agent tool" },
|
|
319
|
-
Read: { replacement: "read_file", reason: "foreign coding-agent tool" },
|
|
320
|
-
Edit: { replacement: "replace_in_file", reason: "foreign coding-agent tool" },
|
|
321
|
-
Agent: { replacement: "message_gezel", reason: "foreign coding-agent tool" },
|
|
322
|
-
Bash: { replacement: void 0, reason: "foreign shell tool; no unrestricted shell is exposed" },
|
|
323
|
-
ExitPlanMode: { replacement: void 0, reason: "foreign coding-agent control tool" }
|
|
324
|
-
};
|
|
325
|
-
var CANONICAL_TOOL_NAMES = Object.freeze([
|
|
326
|
-
...ALWAYS_REGISTERED_TOOLS,
|
|
327
|
-
...Object.keys(CONDITIONALLY_REGISTERED_TOOLS)
|
|
328
|
-
]);
|
|
329
|
-
var LEGACY_TOOL_NAMES = Object.freeze(
|
|
330
|
-
Object.keys(RENAMED_TOOLS)
|
|
331
|
-
);
|
|
332
|
-
var aliasesByCanonical = /* @__PURE__ */ new Map();
|
|
333
|
-
for (const [alias, canonical] of Object.entries(RENAMED_TOOLS)) {
|
|
334
|
-
const aliases = aliasesByCanonical.get(canonical) ?? [];
|
|
335
|
-
aliases.push(alias);
|
|
336
|
-
aliasesByCanonical.set(canonical, aliases);
|
|
337
|
-
}
|
|
338
|
-
var TOOL_REGISTRY = Object.freeze(
|
|
339
|
-
Object.fromEntries(
|
|
340
|
-
CANONICAL_TOOL_NAMES.map((canonicalName) => {
|
|
341
|
-
const conditional = CONDITIONALLY_REGISTERED_TOOLS[canonicalName];
|
|
342
|
-
const aliases = Object.freeze([
|
|
343
|
-
...aliasesByCanonical.get(canonicalName) ?? []
|
|
344
|
-
]);
|
|
345
|
-
const entry = conditional ? {
|
|
346
|
-
canonicalName,
|
|
347
|
-
registration: "conditional",
|
|
348
|
-
gate: { envVar: conditional.envVar, envValue: conditional.envValue },
|
|
349
|
-
aliases,
|
|
350
|
-
advertisedByDefault: false,
|
|
351
|
-
modelFacing: conditional.modelFacing
|
|
352
|
-
} : {
|
|
353
|
-
canonicalName,
|
|
354
|
-
registration: "always",
|
|
355
|
-
aliases,
|
|
356
|
-
advertisedByDefault: true,
|
|
357
|
-
modelFacing: true
|
|
358
|
-
};
|
|
359
|
-
return [canonicalName, Object.freeze(entry)];
|
|
360
|
-
})
|
|
361
|
-
)
|
|
362
|
-
);
|
|
363
|
-
var BUILTIN_TOOL_NAMES = Object.freeze([
|
|
364
|
-
...CANONICAL_TOOL_NAMES,
|
|
365
|
-
...LEGACY_TOOL_NAMES
|
|
366
|
-
]);
|
|
367
|
-
var RESERVED_TOOL_NAMES = Object.freeze([
|
|
368
|
-
...BUILTIN_TOOL_NAMES,
|
|
369
|
-
...Object.keys(TOOL_NAME_TOMBSTONES)
|
|
370
|
-
]);
|
|
371
|
-
var LEGACY_SPELLING_BY_CANONICAL = Object.fromEntries(
|
|
372
|
-
Object.entries(RENAMED_TOOLS).map(([legacy, canonical]) => [canonical, legacy])
|
|
373
|
-
);
|
|
374
|
-
function normalizeToolNameSpelling(name) {
|
|
375
|
-
return name.toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
376
|
-
}
|
|
377
|
-
function canonicalToolName(name) {
|
|
378
|
-
const direct = RENAMED_TOOLS[name];
|
|
379
|
-
if (direct) return direct;
|
|
380
|
-
return name;
|
|
381
|
-
}
|
|
382
|
-
function resolveToolNameSpelling(requested, knownNames) {
|
|
383
|
-
if (knownNames.has(requested)) return requested;
|
|
384
|
-
if (requested in TOOL_NAME_TOMBSTONES) return requested;
|
|
385
|
-
const viaRename = RENAMED_TOOLS[requested];
|
|
386
|
-
if (viaRename && knownNames.has(viaRename)) return viaRename;
|
|
387
|
-
const viaLegacy = LEGACY_SPELLING_BY_CANONICAL[requested];
|
|
388
|
-
if (viaLegacy && knownNames.has(viaLegacy)) return viaLegacy;
|
|
389
|
-
const wanted = normalizeToolNameSpelling(requested);
|
|
390
|
-
if (!wanted) return requested;
|
|
391
|
-
for (const candidate of knownNames) {
|
|
392
|
-
if (normalizeToolNameSpelling(candidate) === wanted) return candidate;
|
|
393
|
-
}
|
|
394
|
-
for (const [legacy, canonical] of Object.entries(RENAMED_TOOLS)) {
|
|
395
|
-
if (normalizeToolNameSpelling(legacy) === wanted && knownNames.has(canonical)) return canonical;
|
|
396
|
-
if (normalizeToolNameSpelling(canonical) === wanted && knownNames.has(legacy)) return legacy;
|
|
397
|
-
}
|
|
398
|
-
return requested;
|
|
399
|
-
}
|
|
4
|
+
import {
|
|
5
|
+
ALWAYS_REGISTERED_TOOLS,
|
|
6
|
+
BUILTIN_TOOL_NAMES,
|
|
7
|
+
CANONICAL_TOOL_NAMES,
|
|
8
|
+
CONDITIONALLY_REGISTERED_TOOLS,
|
|
9
|
+
HOST_CALLBACK_TOOLS,
|
|
10
|
+
LEGACY_SPELLING_BY_CANONICAL,
|
|
11
|
+
LEGACY_TOOL_NAMES,
|
|
12
|
+
RESERVED_TOOL_NAMES,
|
|
13
|
+
TOOL_NAME_TOMBSTONES,
|
|
14
|
+
TOOL_REGISTRY,
|
|
15
|
+
distributionWithheldTools,
|
|
16
|
+
normalizeToolNameSpelling,
|
|
17
|
+
resolveToolNameSpelling
|
|
18
|
+
} from "@bendyline/gezel/local-loop";
|
|
19
|
+
import { canonicalToolName, RENAMED_TOOLS } from "@bendyline/gezel";
|
|
400
20
|
|
|
401
21
|
// src/validate.ts
|
|
402
22
|
import ts2 from "typescript";
|