@synergenius/flow-weaver-pack-weaver 0.9.3 → 0.9.4

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.
Files changed (74) hide show
  1. package/dist/bot/ansi.d.ts +13 -0
  2. package/dist/bot/ansi.d.ts.map +1 -0
  3. package/dist/bot/ansi.js +13 -0
  4. package/dist/bot/ansi.js.map +1 -0
  5. package/dist/bot/assistant-core.d.ts.map +1 -1
  6. package/dist/bot/assistant-core.js +26 -19
  7. package/dist/bot/assistant-core.js.map +1 -1
  8. package/dist/bot/assistant-tools.d.ts +3 -2
  9. package/dist/bot/assistant-tools.d.ts.map +1 -1
  10. package/dist/bot/assistant-tools.js +6 -284
  11. package/dist/bot/assistant-tools.js.map +1 -1
  12. package/dist/bot/conversation-store.d.ts.map +1 -1
  13. package/dist/bot/conversation-store.js +1 -1
  14. package/dist/bot/conversation-store.js.map +1 -1
  15. package/dist/bot/error-classifier.d.ts +27 -0
  16. package/dist/bot/error-classifier.d.ts.map +1 -0
  17. package/dist/bot/error-classifier.js +71 -0
  18. package/dist/bot/error-classifier.js.map +1 -0
  19. package/dist/bot/error-guide.d.ts +2 -7
  20. package/dist/bot/error-guide.d.ts.map +1 -1
  21. package/dist/bot/error-guide.js +2 -31
  22. package/dist/bot/error-guide.js.map +1 -1
  23. package/dist/bot/paths.d.ts +11 -0
  24. package/dist/bot/paths.d.ts.map +1 -0
  25. package/dist/bot/paths.js +26 -0
  26. package/dist/bot/paths.js.map +1 -0
  27. package/dist/bot/retry-utils.d.ts +2 -16
  28. package/dist/bot/retry-utils.d.ts.map +1 -1
  29. package/dist/bot/retry-utils.js +2 -61
  30. package/dist/bot/retry-utils.js.map +1 -1
  31. package/dist/bot/safety.d.ts +10 -0
  32. package/dist/bot/safety.d.ts.map +1 -0
  33. package/dist/bot/safety.js +14 -0
  34. package/dist/bot/safety.js.map +1 -0
  35. package/dist/bot/steering.js +2 -2
  36. package/dist/bot/steering.js.map +1 -1
  37. package/dist/bot/task-queue.d.ts.map +1 -1
  38. package/dist/bot/task-queue.js +2 -15
  39. package/dist/bot/task-queue.js.map +1 -1
  40. package/dist/bot/terminal-renderer.d.ts.map +1 -1
  41. package/dist/bot/terminal-renderer.js +12 -13
  42. package/dist/bot/terminal-renderer.js.map +1 -1
  43. package/dist/bot/tool-registry.d.ts +24 -0
  44. package/dist/bot/tool-registry.d.ts.map +1 -0
  45. package/dist/bot/tool-registry.js +458 -0
  46. package/dist/bot/tool-registry.js.map +1 -0
  47. package/dist/bot/weaver-tools.d.ts +2 -2
  48. package/dist/bot/weaver-tools.d.ts.map +1 -1
  49. package/dist/bot/weaver-tools.js +4 -95
  50. package/dist/bot/weaver-tools.js.map +1 -1
  51. package/dist/cli-handlers.d.ts.map +1 -1
  52. package/dist/cli-handlers.js +1 -2
  53. package/dist/cli-handlers.js.map +1 -1
  54. package/dist/node-types/agent-execute.d.ts.map +1 -1
  55. package/dist/node-types/agent-execute.js +4 -8
  56. package/dist/node-types/agent-execute.js.map +1 -1
  57. package/flowweaver.manifest.json +1 -1
  58. package/package.json +1 -1
  59. package/src/bot/ansi.ts +12 -0
  60. package/src/bot/assistant-core.ts +25 -19
  61. package/src/bot/assistant-tools.ts +7 -294
  62. package/src/bot/conversation-store.ts +1 -1
  63. package/src/bot/error-classifier.ts +90 -0
  64. package/src/bot/error-guide.ts +2 -32
  65. package/src/bot/paths.ts +27 -0
  66. package/src/bot/retry-utils.ts +2 -74
  67. package/src/bot/safety.ts +16 -0
  68. package/src/bot/steering.ts +2 -2
  69. package/src/bot/task-queue.ts +2 -16
  70. package/src/bot/terminal-renderer.ts +11 -14
  71. package/src/bot/tool-registry.ts +477 -0
  72. package/src/bot/weaver-tools.ts +4 -95
  73. package/src/cli-handlers.ts +1 -2
  74. package/src/node-types/agent-execute.ts +3 -6
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Unified tool registry — single source of truth for all weaver tool definitions.
3
+ * Merges assistant-tools.ts ASSISTANT_TOOLS and weaver-tools.ts WEAVER_TOOLS
4
+ * into one registry with metadata (category, contexts, verboseOutput).
5
+ */
6
+ import type { ToolDefinition } from '@synergenius/flow-weaver/agent';
7
+ export interface WeaverTool extends ToolDefinition {
8
+ verboseOutput?: boolean;
9
+ category: 'bot-management' | 'queue' | 'flow-weaver' | 'project' | 'knowledge' | 'conversation' | 'ci' | 'web';
10
+ contexts: Array<'bot' | 'assistant'>;
11
+ }
12
+ export declare const ALL_TOOLS: WeaverTool[];
13
+ export declare const BOT_TOOLS: ToolDefinition[];
14
+ export declare const ASSISTANT_TOOLS: ToolDefinition[];
15
+ export declare const VERBOSE_TOOL_NAMES: Set<string>;
16
+ /**
17
+ * Generate a prompt section grouping assistant tools by category.
18
+ */
19
+ export declare function generateToolPromptSection(): string;
20
+ /**
21
+ * Generate a comma-separated list of tools that produce verbose output.
22
+ */
23
+ export declare function generateVerboseToolList(): string;
24
+ //# sourceMappingURL=tool-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-registry.d.ts","sourceRoot":"","sources":["../../src/bot/tool-registry.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAErE,MAAM,WAAW,UAAW,SAAQ,cAAc;IAChD,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,EAAE,gBAAgB,GAAG,OAAO,GAAG,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,cAAc,GAAG,IAAI,GAAG,KAAK,CAAC;IAC/G,QAAQ,EAAE,KAAK,CAAC,KAAK,GAAG,WAAW,CAAC,CAAC;CACtC;AAED,eAAO,MAAM,SAAS,EAAE,UAAU,EA8ajC,CAAC;AAIF,eAAO,MAAM,SAAS,EAAE,cAAc,EAAsD,CAAC;AAC7F,eAAO,MAAM,eAAe,EAAE,cAAc,EAA4D,CAAC;AACzG,eAAO,MAAM,kBAAkB,aAAmE,CAAC;AAEnG;;GAEG;AACH,wBAAgB,yBAAyB,IAAI,MAAM,CAclD;AAED;;GAEG;AACH,wBAAgB,uBAAuB,IAAI,MAAM,CAEhD"}
@@ -0,0 +1,458 @@
1
+ /**
2
+ * Unified tool registry — single source of truth for all weaver tool definitions.
3
+ * Merges assistant-tools.ts ASSISTANT_TOOLS and weaver-tools.ts WEAVER_TOOLS
4
+ * into one registry with metadata (category, contexts, verboseOutput).
5
+ */
6
+ export const ALL_TOOLS = [
7
+ // ── Bot management (assistant only) ──────────────────────────────
8
+ {
9
+ name: 'bot_spawn',
10
+ description: 'Start a new bot session. Returns the bot name and status.',
11
+ inputSchema: {
12
+ type: 'object',
13
+ properties: {
14
+ name: { type: 'string', description: 'Unique name for this bot (e.g. "fix-templates")' },
15
+ project_dir: { type: 'string', description: 'Project directory for the bot to work in' },
16
+ parallel: { type: 'number', description: 'Number of parallel tasks (1-5, default 1)' },
17
+ deadline: { type: 'string', description: 'Stop time in HH:MM format (optional)' },
18
+ branch: { type: 'string', description: 'Git branch for commits (keeps main clean, good for overnight runs)' },
19
+ },
20
+ required: ['name'],
21
+ },
22
+ category: 'bot-management',
23
+ contexts: ['assistant'],
24
+ },
25
+ {
26
+ name: 'bot_list',
27
+ description: 'List all bot sessions with their status, task counts, and cost.',
28
+ inputSchema: { type: 'object', properties: {}, required: [] },
29
+ category: 'bot-management',
30
+ contexts: ['assistant'],
31
+ },
32
+ {
33
+ name: 'bot_status',
34
+ description: 'Get detailed status of a specific bot including queue and recent activity.',
35
+ inputSchema: {
36
+ type: 'object',
37
+ properties: { name: { type: 'string', description: 'Bot name' } },
38
+ required: ['name'],
39
+ },
40
+ category: 'bot-management',
41
+ contexts: ['assistant'],
42
+ },
43
+ {
44
+ name: 'bot_pause',
45
+ description: 'Pause a running bot. It will finish its current task then wait.',
46
+ inputSchema: {
47
+ type: 'object',
48
+ properties: { name: { type: 'string', description: 'Bot name' } },
49
+ required: ['name'],
50
+ },
51
+ category: 'bot-management',
52
+ contexts: ['assistant'],
53
+ },
54
+ {
55
+ name: 'bot_resume',
56
+ description: 'Resume a paused bot.',
57
+ inputSchema: {
58
+ type: 'object',
59
+ properties: { name: { type: 'string', description: 'Bot name' } },
60
+ required: ['name'],
61
+ },
62
+ category: 'bot-management',
63
+ contexts: ['assistant'],
64
+ },
65
+ {
66
+ name: 'bot_stop',
67
+ description: 'Gracefully stop a bot (finishes current task, then exits).',
68
+ inputSchema: {
69
+ type: 'object',
70
+ properties: { name: { type: 'string', description: 'Bot name' } },
71
+ required: ['name'],
72
+ },
73
+ category: 'bot-management',
74
+ contexts: ['assistant'],
75
+ },
76
+ {
77
+ name: 'bot_logs',
78
+ description: 'Get recent output log from a bot.',
79
+ inputSchema: {
80
+ type: 'object',
81
+ properties: {
82
+ name: { type: 'string', description: 'Bot name' },
83
+ lines: { type: 'number', description: 'Number of lines to return (default 30)' },
84
+ },
85
+ required: ['name'],
86
+ },
87
+ verboseOutput: true,
88
+ category: 'bot-management',
89
+ contexts: ['assistant'],
90
+ },
91
+ // ── Queue management (assistant only) ────────────────────────────
92
+ {
93
+ name: 'queue_add',
94
+ description: 'Add a task to a bot\'s queue.',
95
+ inputSchema: {
96
+ type: 'object',
97
+ properties: {
98
+ bot: { type: 'string', description: 'Bot name' },
99
+ instruction: { type: 'string', description: 'Task instruction' },
100
+ targets: { type: 'array', items: { type: 'string' }, description: 'Target files (optional)' },
101
+ },
102
+ required: ['bot', 'instruction'],
103
+ },
104
+ category: 'queue',
105
+ contexts: ['assistant'],
106
+ },
107
+ {
108
+ name: 'queue_add_batch',
109
+ description: 'Add multiple tasks to a bot\'s queue at once.',
110
+ inputSchema: {
111
+ type: 'object',
112
+ properties: {
113
+ bot: { type: 'string', description: 'Bot name' },
114
+ tasks: {
115
+ type: 'array',
116
+ items: {
117
+ type: 'object',
118
+ properties: {
119
+ instruction: { type: 'string' },
120
+ targets: { type: 'array', items: { type: 'string' } },
121
+ },
122
+ required: ['instruction'],
123
+ },
124
+ description: 'Array of tasks to add',
125
+ },
126
+ },
127
+ required: ['bot', 'tasks'],
128
+ },
129
+ category: 'queue',
130
+ contexts: ['assistant'],
131
+ },
132
+ {
133
+ name: 'queue_list',
134
+ description: 'List all tasks in a bot\'s queue with their status.',
135
+ inputSchema: {
136
+ type: 'object',
137
+ properties: { bot: { type: 'string', description: 'Bot name' } },
138
+ required: ['bot'],
139
+ },
140
+ category: 'queue',
141
+ contexts: ['assistant'],
142
+ },
143
+ {
144
+ name: 'queue_retry',
145
+ description: 'Reset all failed tasks in a bot\'s queue to pending.',
146
+ inputSchema: {
147
+ type: 'object',
148
+ properties: { bot: { type: 'string', description: 'Bot name' } },
149
+ required: ['bot'],
150
+ },
151
+ category: 'queue',
152
+ contexts: ['assistant'],
153
+ },
154
+ // ── Flow-weaver tools ────────────────────────────────────────────
155
+ {
156
+ name: 'validate',
157
+ description: 'Run flow-weaver validate on a workflow file. Returns JSON with errors and warnings. Use this FIRST to discover issues, and AFTER patching to confirm fixes.',
158
+ inputSchema: { type: 'object', properties: { file: { type: 'string', description: 'Path to the workflow file to validate' } }, required: ['file'] },
159
+ category: 'flow-weaver',
160
+ contexts: ['bot'],
161
+ },
162
+ {
163
+ name: 'fw_validate',
164
+ description: 'Validate a workflow or directory of workflows. Returns errors and warnings.',
165
+ inputSchema: {
166
+ type: 'object',
167
+ properties: { path: { type: 'string', description: 'File or directory path' } },
168
+ required: ['path'],
169
+ },
170
+ category: 'flow-weaver',
171
+ contexts: ['assistant'],
172
+ },
173
+ {
174
+ name: 'fw_diagram',
175
+ description: 'Generate a text diagram of a workflow.',
176
+ inputSchema: {
177
+ type: 'object',
178
+ properties: { file: { type: 'string', description: 'Workflow file path' } },
179
+ required: ['file'],
180
+ },
181
+ verboseOutput: true,
182
+ category: 'flow-weaver',
183
+ contexts: ['assistant'],
184
+ },
185
+ {
186
+ name: 'fw_describe',
187
+ description: 'Get a natural language description of a workflow.',
188
+ inputSchema: {
189
+ type: 'object',
190
+ properties: { file: { type: 'string', description: 'Workflow file path' } },
191
+ required: ['file'],
192
+ },
193
+ verboseOutput: true,
194
+ category: 'flow-weaver',
195
+ contexts: ['assistant'],
196
+ },
197
+ {
198
+ name: 'fw_docs',
199
+ description: 'Look up Flow Weaver documentation by topic. Topics: concepts, jsdoc-grammar, advanced-annotations, built-in-nodes, scaffold, node-conversion, patterns, error-codes, debugging, export-interface.',
200
+ inputSchema: {
201
+ type: 'object',
202
+ properties: { topic: { type: 'string', description: 'Documentation topic slug' } },
203
+ required: ['topic'],
204
+ },
205
+ verboseOutput: true,
206
+ category: 'flow-weaver',
207
+ contexts: ['assistant'],
208
+ },
209
+ {
210
+ name: 'fw_diagram_mermaid',
211
+ description: 'Generate a Mermaid diagram of a workflow (can be rendered in any Mermaid viewer).',
212
+ inputSchema: {
213
+ type: 'object',
214
+ properties: { file: { type: 'string', description: 'Workflow file path' } },
215
+ required: ['file'],
216
+ },
217
+ verboseOutput: true,
218
+ category: 'flow-weaver',
219
+ contexts: ['assistant'],
220
+ },
221
+ // ── Project tools (shared or context-specific) ───────────────────
222
+ {
223
+ name: 'read_file',
224
+ description: 'Read a file and return its contents.',
225
+ inputSchema: {
226
+ type: 'object',
227
+ properties: { file: { type: 'string', description: 'File path' } },
228
+ required: ['file'],
229
+ },
230
+ category: 'project',
231
+ contexts: ['bot', 'assistant'],
232
+ },
233
+ {
234
+ name: 'list_files',
235
+ description: 'List files in a directory, optionally filtered by regex pattern.',
236
+ inputSchema: {
237
+ type: 'object',
238
+ properties: {
239
+ directory: { type: 'string', description: 'Directory to list' },
240
+ pattern: { type: 'string', description: 'Optional regex filter pattern' },
241
+ },
242
+ required: ['directory'],
243
+ },
244
+ category: 'project',
245
+ contexts: ['bot', 'assistant'],
246
+ },
247
+ {
248
+ name: 'run_shell',
249
+ description: 'Run a shell command (read-only operations recommended). Blocked: rm -rf, git push, sudo.',
250
+ inputSchema: {
251
+ type: 'object',
252
+ properties: { command: { type: 'string', description: 'Shell command to execute' } },
253
+ required: ['command'],
254
+ },
255
+ category: 'project',
256
+ contexts: ['bot', 'assistant'],
257
+ },
258
+ {
259
+ name: 'patch_file',
260
+ description: 'Apply surgical find-and-replace patches to a file. Each patch must have exact "find" and "replace" strings. Preferred over write_file for modifications.',
261
+ inputSchema: {
262
+ type: 'object',
263
+ properties: {
264
+ file: { type: 'string', description: 'Path to the file to patch' },
265
+ patches: {
266
+ type: 'array',
267
+ items: {
268
+ type: 'object',
269
+ properties: {
270
+ find: { type: 'string', description: 'Exact string to find' },
271
+ replace: { type: 'string', description: 'String to replace with' },
272
+ },
273
+ required: ['find', 'replace'],
274
+ },
275
+ description: 'Array of find/replace patches',
276
+ },
277
+ },
278
+ required: ['file', 'patches'],
279
+ },
280
+ category: 'project',
281
+ contexts: ['bot'],
282
+ },
283
+ {
284
+ name: 'write_file',
285
+ description: 'Write content to a file (creates or overwrites). Use patch_file instead for modifications to existing files.',
286
+ inputSchema: {
287
+ type: 'object',
288
+ properties: {
289
+ file: { type: 'string', description: 'Path to the file to write' },
290
+ content: { type: 'string', description: 'Complete file content' },
291
+ },
292
+ required: ['file', 'content'],
293
+ },
294
+ category: 'project',
295
+ contexts: ['bot'],
296
+ },
297
+ {
298
+ name: 'tsc_check',
299
+ description: 'Run TypeScript compiler check (no emit). Returns errors if any.',
300
+ inputSchema: { type: 'object', properties: {}, required: [] },
301
+ verboseOutput: true,
302
+ category: 'project',
303
+ contexts: ['bot'],
304
+ },
305
+ {
306
+ name: 'run_tests',
307
+ description: 'Run project tests. Returns structured results with pass/fail counts.',
308
+ inputSchema: { type: 'object', properties: { pattern: { type: 'string', description: 'Test file pattern (optional)' } }, required: [] },
309
+ verboseOutput: true,
310
+ category: 'project',
311
+ contexts: ['bot'],
312
+ },
313
+ {
314
+ name: 'project_list',
315
+ description: 'List known project directories that have been used with weaver.',
316
+ inputSchema: { type: 'object', properties: {}, required: [] },
317
+ category: 'project',
318
+ contexts: ['assistant'],
319
+ },
320
+ {
321
+ name: 'project_context',
322
+ description: 'Read package.json and .weaver-plan.md from a project directory to understand its context.',
323
+ inputSchema: {
324
+ type: 'object',
325
+ properties: { directory: { type: 'string', description: 'Absolute path to project directory' } },
326
+ required: ['directory'],
327
+ },
328
+ category: 'project',
329
+ contexts: ['assistant'],
330
+ },
331
+ // ── Knowledge tools ──────────────────────────────────────────────
332
+ {
333
+ name: 'knowledge_list',
334
+ description: 'List all stored knowledge entries for the current project.',
335
+ inputSchema: { type: 'object', properties: {}, required: [] },
336
+ category: 'knowledge',
337
+ contexts: ['assistant'],
338
+ },
339
+ {
340
+ name: 'knowledge_search',
341
+ description: 'Search stored knowledge by keyword.',
342
+ inputSchema: {
343
+ type: 'object',
344
+ properties: { query: { type: 'string', description: 'Search query' } },
345
+ required: ['query'],
346
+ },
347
+ category: 'knowledge',
348
+ contexts: ['assistant'],
349
+ },
350
+ {
351
+ name: 'learn',
352
+ description: 'Store a fact for future tasks. Key should be descriptive (e.g. "file:src/agent.ts:port-issue").',
353
+ inputSchema: { type: 'object', properties: { key: { type: 'string' }, value: { type: 'string' } }, required: ['key', 'value'] },
354
+ category: 'knowledge',
355
+ contexts: ['bot'],
356
+ },
357
+ {
358
+ name: 'recall',
359
+ description: 'Look up stored knowledge. Returns matching entries.',
360
+ inputSchema: { type: 'object', properties: { query: { type: 'string' } }, required: ['query'] },
361
+ category: 'knowledge',
362
+ contexts: ['bot'],
363
+ },
364
+ // ── Conversation management (assistant only) ─────────────────────
365
+ {
366
+ name: 'conversation_list',
367
+ description: 'List saved assistant conversations with message counts and timestamps.',
368
+ inputSchema: { type: 'object', properties: {}, required: [] },
369
+ category: 'conversation',
370
+ contexts: ['assistant'],
371
+ },
372
+ {
373
+ name: 'conversation_delete',
374
+ description: 'Delete a saved conversation by ID.',
375
+ inputSchema: {
376
+ type: 'object',
377
+ properties: { id: { type: 'string', description: 'Conversation ID to delete' } },
378
+ required: ['id'],
379
+ },
380
+ category: 'conversation',
381
+ contexts: ['assistant'],
382
+ },
383
+ {
384
+ name: 'conversation_summary',
385
+ description: 'Get a summary of the current conversation (message count, tokens, bots spawned).',
386
+ inputSchema: { type: 'object', properties: {}, required: [] },
387
+ category: 'conversation',
388
+ contexts: ['assistant'],
389
+ },
390
+ // ── CI/CD (assistant only) ───────────────────────────────────────
391
+ {
392
+ name: 'github_status',
393
+ description: 'Check GitHub Actions status for a branch or PR. Requires gh CLI installed.',
394
+ inputSchema: {
395
+ type: 'object',
396
+ properties: {
397
+ branch: { type: 'string', description: 'Branch name (optional, defaults to current)' },
398
+ pr: { type: 'number', description: 'PR number (optional, checks PR status instead of branch)' },
399
+ },
400
+ required: [],
401
+ },
402
+ category: 'ci',
403
+ contexts: ['assistant'],
404
+ },
405
+ // ── Web access (shared) ──────────────────────────────────────────
406
+ {
407
+ name: 'web_fetch',
408
+ description: 'Fetch HTTP content from a URL. Returns text body (max 10KB).',
409
+ inputSchema: {
410
+ type: 'object',
411
+ properties: {
412
+ url: { type: 'string', description: 'URL to fetch' },
413
+ method: { type: 'string', description: 'HTTP method (default GET)', enum: ['GET', 'POST'] },
414
+ },
415
+ required: ['url'],
416
+ },
417
+ category: 'web',
418
+ contexts: ['bot', 'assistant'],
419
+ },
420
+ // ── Bot-only interactive ─────────────────────────────────────────
421
+ {
422
+ name: 'ask_user',
423
+ description: 'Ask the user a question and wait for response. Use when you need a decision.',
424
+ inputSchema: { type: 'object', properties: { question: { type: 'string' } }, required: ['question'] },
425
+ category: 'project',
426
+ contexts: ['bot'],
427
+ },
428
+ ];
429
+ // ── Derived exports ──────────────────────────────────────────────────
430
+ export const BOT_TOOLS = ALL_TOOLS.filter(t => t.contexts.includes('bot'));
431
+ export const ASSISTANT_TOOLS = ALL_TOOLS.filter(t => t.contexts.includes('assistant'));
432
+ export const VERBOSE_TOOL_NAMES = new Set(ALL_TOOLS.filter(t => t.verboseOutput).map(t => t.name));
433
+ /**
434
+ * Generate a prompt section grouping assistant tools by category.
435
+ */
436
+ export function generateToolPromptSection() {
437
+ const groups = new Map();
438
+ for (const t of ALL_TOOLS.filter(t => t.contexts.includes('assistant'))) {
439
+ const list = groups.get(t.category) ?? [];
440
+ list.push(t);
441
+ groups.set(t.category, list);
442
+ }
443
+ const lines = [];
444
+ for (const [cat, tools] of groups) {
445
+ lines.push(`${cat}:`);
446
+ for (const t of tools)
447
+ lines.push(` - ${t.name}: ${t.description}`);
448
+ lines.push('');
449
+ }
450
+ return lines.join('\n');
451
+ }
452
+ /**
453
+ * Generate a comma-separated list of tools that produce verbose output.
454
+ */
455
+ export function generateVerboseToolList() {
456
+ return [...VERBOSE_TOOL_NAMES].join(', ');
457
+ }
458
+ //# sourceMappingURL=tool-registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-registry.js","sourceRoot":"","sources":["../../src/bot/tool-registry.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAUH,MAAM,CAAC,MAAM,SAAS,GAAiB;IACrC,oEAAoE;IACpE;QACE,IAAI,EAAE,WAAW;QACjB,WAAW,EAAE,2DAA2D;QACxE,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,iDAAiD,EAAE;gBACxF,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,0CAA0C,EAAE;gBACxF,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,2CAA2C,EAAE;gBACtF,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,sCAAsC,EAAE;gBACjF,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,oEAAoE,EAAE;aAC9G;YACD,QAAQ,EAAE,CAAC,MAAM,CAAC;SACnB;QACD,QAAQ,EAAE,gBAAgB;QAC1B,QAAQ,EAAE,CAAC,WAAW,CAAC;KACxB;IACD;QACE,IAAI,EAAE,UAAU;QAChB,WAAW,EAAE,iEAAiE;QAC9E,WAAW,EAAE,EAAE,IAAI,EAA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AE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AAEnG;;GAEG;AACH,MAAM,UAAU,yBAAyB;IACvC,MAAM,MAAM,GAAG,IAAI,GAAG,EAAwB,CAAC;IAC/C,KAAK,MAAM,CAAC,IAAI,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC;QACxE,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;QAC1C,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACb,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IAC/B,CAAC;IACD,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,EAAE,CAAC;QAClC,KAAK,CAAC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC;QACtB,KAAK,MAAM,CAAC,IAAI,KAAK;YAAE,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;QACrE,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjB,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,uBAAuB;IACrC,OAAO,CAAC,GAAG,kBAAkB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC5C,CAAC"}
@@ -5,8 +5,8 @@
5
5
  * run_shell, list_files, write_file. Tool execution delegates to step-executor
6
6
  * with all safety guards (path traversal, shrink detection, blocked commands).
7
7
  */
8
- import type { ToolDefinition } from '@synergenius/flow-weaver/agent';
9
- export declare const WEAVER_TOOLS: ToolDefinition[];
8
+ import { BOT_TOOLS as WEAVER_TOOLS } from './tool-registry.js';
9
+ export { WEAVER_TOOLS };
10
10
  /**
11
11
  * Execute a weaver tool call. Delegates to step-executor with safety guards.
12
12
  * Bound to a specific project directory via closure.
@@ -1 +1 @@
1
- {"version":3,"file":"weaver-tools.d.ts","sourceRoot":"","sources":["../../src/bot/weaver-tools.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAErE,eAAO,MAAM,YAAY,EAAE,cAAc,EA6FxC,CAAC;AAYF;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,IAEnD,MAAM,MAAM,EACZ,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAmGjD"}
1
+ {"version":3,"file":"weaver-tools.d.ts","sourceRoot":"","sources":["../../src/bot/weaver-tools.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,EAAE,SAAS,IAAI,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAG/D,OAAO,EAAE,YAAY,EAAE,CAAC;AAYxB;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,IAEnD,MAAM,MAAM,EACZ,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAmGjD"}
@@ -7,100 +7,9 @@
7
7
  */
8
8
  import { execFileSync } from 'node:child_process';
9
9
  import { executeStep } from './step-executor.js';
10
- export const WEAVER_TOOLS = [
11
- {
12
- name: 'validate',
13
- description: 'Run flow-weaver validate on a workflow file. Returns JSON with errors and warnings. Use this FIRST to discover issues, and AFTER patching to confirm fixes.',
14
- inputSchema: { type: 'object', properties: { file: { type: 'string', description: 'Path to the workflow file to validate' } }, required: ['file'] },
15
- },
16
- {
17
- name: 'read_file',
18
- description: 'Read a file and return its full contents. Use this to understand file structure before patching.',
19
- inputSchema: { type: 'object', properties: { file: { type: 'string', description: 'Path to the file to read' } }, required: ['file'] },
20
- },
21
- {
22
- name: 'patch_file',
23
- description: 'Apply surgical find-and-replace patches to a file. Each patch must have exact "find" and "replace" strings. Preferred over write_file for modifications.',
24
- inputSchema: {
25
- type: 'object',
26
- properties: {
27
- file: { type: 'string', description: 'Path to the file to patch' },
28
- patches: {
29
- type: 'array',
30
- items: {
31
- type: 'object',
32
- properties: {
33
- find: { type: 'string', description: 'Exact string to find' },
34
- replace: { type: 'string', description: 'String to replace with' },
35
- },
36
- required: ['find', 'replace'],
37
- },
38
- description: 'Array of find/replace patches',
39
- },
40
- },
41
- required: ['file', 'patches'],
42
- },
43
- },
44
- {
45
- name: 'run_shell',
46
- description: 'Execute a shell command and return output. Use for: npx flow-weaver validate, git status, etc. Blocked: rm -rf, git push, sudo.',
47
- inputSchema: { type: 'object', properties: { command: { type: 'string', description: 'Shell command to execute' } }, required: ['command'] },
48
- },
49
- {
50
- name: 'list_files',
51
- description: 'List files in a directory, optionally filtered by regex pattern.',
52
- inputSchema: {
53
- type: 'object',
54
- properties: {
55
- directory: { type: 'string', description: 'Directory to list' },
56
- pattern: { type: 'string', description: 'Optional regex filter pattern' },
57
- },
58
- required: ['directory'],
59
- },
60
- },
61
- {
62
- name: 'write_file',
63
- description: 'Write content to a file (creates or overwrites). Use patch_file instead for modifications to existing files.',
64
- inputSchema: {
65
- type: 'object',
66
- properties: {
67
- file: { type: 'string', description: 'Path to the file to write' },
68
- content: { type: 'string', description: 'Complete file content' },
69
- },
70
- required: ['file', 'content'],
71
- },
72
- },
73
- {
74
- name: 'web_fetch',
75
- description: 'Fetch HTTP content. Returns text body (max 10KB).',
76
- inputSchema: { type: 'object', properties: { url: { type: 'string' }, method: { type: 'string', enum: ['GET', 'POST'] } }, required: ['url'] },
77
- },
78
- {
79
- name: 'tsc_check',
80
- description: 'Run TypeScript compiler check (no emit). Returns errors if any.',
81
- inputSchema: { type: 'object', properties: {}, required: [] },
82
- },
83
- {
84
- name: 'run_tests',
85
- description: 'Run project tests. Returns structured results with pass/fail counts.',
86
- inputSchema: { type: 'object', properties: { pattern: { type: 'string', description: 'Test file pattern (optional)' } }, required: [] },
87
- },
88
- {
89
- name: 'ask_user',
90
- description: 'Ask the user a question and wait for response. Use when you need a decision.',
91
- inputSchema: { type: 'object', properties: { question: { type: 'string' } }, required: ['question'] },
92
- },
93
- {
94
- name: 'learn',
95
- description: 'Store a fact for future tasks. Key should be descriptive (e.g. "file:src/agent.ts:port-issue").',
96
- inputSchema: { type: 'object', properties: { key: { type: 'string' }, value: { type: 'string' } }, required: ['key', 'value'] },
97
- },
98
- {
99
- name: 'recall',
100
- description: 'Look up stored knowledge. Returns matching entries.',
101
- inputSchema: { type: 'object', properties: { query: { type: 'string' } }, required: ['query'] },
102
- },
103
- ];
10
+ import { BOT_TOOLS as WEAVER_TOOLS } from './tool-registry.js';
11
+ import { isBlockedUrl } from './safety.js';
12
+ export { WEAVER_TOOLS };
104
13
  /** Map tool names to step-executor operations. */
105
14
  const OPERATION_MAP = {
106
15
  validate: 'run-shell',
@@ -121,7 +30,7 @@ export function createWeaverExecutor(projectDir) {
121
30
  case 'web_fetch': {
122
31
  const url = String(args.url);
123
32
  // Safety: block localhost, internal IPs
124
- if (/localhost|127\.0\.0\.1|0\.0\.0\.0|10\.\d|172\.(1[6-9]|2\d|3[01])\.|192\.168\./i.test(url)) {
33
+ if (isBlockedUrl(url)) {
125
34
  return { result: 'Blocked: cannot fetch internal/localhost URLs.', isError: true };
126
35
  }
127
36
  const resp = await fetch(url, { method: args.method ?? 'GET', signal: AbortSignal.timeout(15_000) });