@honeybee-ai/waggle-cli 1.0.19 → 1.0.21
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/brood.d.ts +23 -9
- package/dist/brood.js +110 -1
- package/dist/brood.js.map +1 -1
- package/dist/cli.js +279 -936
- package/dist/cli.js.map +1 -7
- package/dist/commands/carapace.js +20 -5
- package/dist/commands/carapace.js.map +1 -1
- package/dist/commands/eval.d.ts +1 -0
- package/dist/commands/eval.js +221 -0
- package/dist/commands/eval.js.map +1 -0
- package/dist/commands/mcp.d.ts +13 -0
- package/dist/commands/mcp.js +17 -0
- package/dist/commands/mcp.js.map +1 -0
- package/dist/commands/scan.js +8 -8
- package/dist/commands/scan.js.map +1 -1
- package/dist/commands/up.js +13 -30
- package/dist/commands/up.js.map +1 -1
- package/dist/lib/capture.d.ts +6 -0
- package/dist/lib/capture.js +29 -0
- package/dist/lib/capture.js.map +1 -0
- package/dist/mcp/docs.d.ts +16 -0
- package/dist/mcp/docs.js +192 -0
- package/dist/mcp/docs.js.map +1 -0
- package/dist/mcp/handler.d.ts +27 -0
- package/dist/mcp/handler.js +397 -0
- package/dist/mcp/handler.js.map +1 -0
- package/dist/mcp/server.d.ts +19 -0
- package/dist/mcp/server.js +105 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/templates.d.ts +9 -0
- package/dist/mcp/templates.js +46 -0
- package/dist/mcp/templates.js.map +1 -0
- package/dist/repl/addressing.d.ts +34 -0
- package/dist/repl/addressing.js +103 -0
- package/dist/repl/addressing.js.map +1 -0
- package/dist/repl/agent-loop.d.ts +8 -0
- package/dist/repl/agent-loop.js +57 -0
- package/dist/repl/agent-loop.js.map +1 -0
- package/dist/repl/bang.d.ts +13 -0
- package/dist/repl/bang.js +207 -0
- package/dist/repl/bang.js.map +1 -0
- package/dist/repl/file-tools.d.ts +4 -0
- package/dist/repl/file-tools.js +121 -0
- package/dist/repl/file-tools.js.map +1 -0
- package/dist/repl/index-readline.d.ts +7 -0
- package/dist/repl/index-readline.js +91 -0
- package/dist/repl/index-readline.js.map +1 -0
- package/dist/repl/index.d.ts +1 -0
- package/dist/repl/index.js +341 -0
- package/dist/repl/index.js.map +1 -0
- package/dist/repl/input.d.ts +36 -0
- package/dist/repl/input.js +312 -0
- package/dist/repl/input.js.map +1 -0
- package/dist/repl/providers.d.ts +21 -0
- package/dist/repl/providers.js +373 -0
- package/dist/repl/providers.js.map +1 -0
- package/dist/repl/renderer.d.ts +38 -0
- package/dist/repl/renderer.js +167 -0
- package/dist/repl/renderer.js.map +1 -0
- package/dist/repl/system-pane.d.ts +28 -0
- package/dist/repl/system-pane.js +194 -0
- package/dist/repl/system-pane.js.map +1 -0
- package/dist/repl/system-prompt.d.ts +3 -0
- package/dist/repl/system-prompt.js +74 -0
- package/dist/repl/system-prompt.js.map +1 -0
- package/dist/repl/tool-handlers.d.ts +5 -0
- package/dist/repl/tool-handlers.js +118 -0
- package/dist/repl/tool-handlers.js.map +1 -0
- package/dist/repl/tools.d.ts +2 -0
- package/dist/repl/tools.js +205 -0
- package/dist/repl/tools.js.map +1 -0
- package/dist/repl/tui.d.ts +41 -0
- package/dist/repl/tui.js +280 -0
- package/dist/repl/tui.js.map +1 -0
- package/dist/repl/types.d.ts +53 -0
- package/dist/repl/types.js +3 -0
- package/dist/repl/types.js.map +1 -0
- package/dist/repl/ws-client.d.ts +39 -0
- package/dist/repl/ws-client.js +144 -0
- package/dist/repl/ws-client.js.map +1 -0
- package/dist/wgl.js +1396 -0
- package/dist/wgl.js.map +7 -0
- package/package.json +6 -8
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
// System pane formatters — right pane content for tool output
|
|
2
|
+
// Each formatter returns pre-colored ANSI string[] lines
|
|
3
|
+
import { dim, green, red, yellow, gray, cyan, brightAmber } from './renderer.js';
|
|
4
|
+
/** Tool call header line for system pane */
|
|
5
|
+
export function formatToolHeader(name, args) {
|
|
6
|
+
const argStr = Object.entries(args).map(([k, v]) => {
|
|
7
|
+
const val = typeof v === 'string' && v.length > 30 ? v.slice(0, 27) + '...' : JSON.stringify(v);
|
|
8
|
+
return `${k}=${val}`;
|
|
9
|
+
}).join(', ');
|
|
10
|
+
return brightAmber(`\u25B8 ${name}`) + dim(`(${argStr})`);
|
|
11
|
+
}
|
|
12
|
+
/** Thin separator line */
|
|
13
|
+
export function formatSeparator(width) {
|
|
14
|
+
return gray('\u2508'.repeat(Math.min(width, 40)));
|
|
15
|
+
}
|
|
16
|
+
/** File read → path header + numbered lines */
|
|
17
|
+
export function formatFileRead(path, content, paneWidth) {
|
|
18
|
+
const lines = [];
|
|
19
|
+
lines.push(dim(path));
|
|
20
|
+
lines.push(formatSeparator(paneWidth));
|
|
21
|
+
const contentLines = content.split('\n');
|
|
22
|
+
const gutterWidth = String(contentLines.length).length;
|
|
23
|
+
for (let i = 0; i < contentLines.length; i++) {
|
|
24
|
+
const lineNum = String(i + 1).padStart(gutterWidth);
|
|
25
|
+
lines.push(gray(`${lineNum}\u2502`) + ` ${contentLines[i]}`);
|
|
26
|
+
}
|
|
27
|
+
return lines;
|
|
28
|
+
}
|
|
29
|
+
/** File write → confirmation with path */
|
|
30
|
+
export function formatFileWrite(path, content) {
|
|
31
|
+
const lineCount = content.split('\n').length;
|
|
32
|
+
const byteCount = Buffer.byteLength(content, 'utf-8');
|
|
33
|
+
return [
|
|
34
|
+
green('\u2714') + ` ${path}`,
|
|
35
|
+
dim(` ${lineCount} lines, ${byteCount} bytes written`),
|
|
36
|
+
];
|
|
37
|
+
}
|
|
38
|
+
/** Grep results → file:line:content with pattern highlighted */
|
|
39
|
+
export function formatGrepResult(pattern, resultText, paneWidth) {
|
|
40
|
+
const lines = [];
|
|
41
|
+
lines.push(dim(`pattern: ${pattern}`));
|
|
42
|
+
lines.push(formatSeparator(paneWidth));
|
|
43
|
+
const resultLines = resultText.split('\n');
|
|
44
|
+
if (resultLines.length === 1 && resultLines[0] === 'No matches found') {
|
|
45
|
+
lines.push(dim(' No matches found'));
|
|
46
|
+
return lines;
|
|
47
|
+
}
|
|
48
|
+
// Each line is "path:lineNum: content" from grepFiles
|
|
49
|
+
for (const line of resultLines) {
|
|
50
|
+
if (!line)
|
|
51
|
+
continue;
|
|
52
|
+
const colonIdx = line.indexOf(':');
|
|
53
|
+
if (colonIdx === -1) {
|
|
54
|
+
lines.push(line);
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
const secondColon = line.indexOf(':', colonIdx + 1);
|
|
58
|
+
if (secondColon === -1) {
|
|
59
|
+
lines.push(line);
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
const filePath = line.slice(0, colonIdx);
|
|
63
|
+
const lineNum = line.slice(colonIdx + 1, secondColon);
|
|
64
|
+
const content = line.slice(secondColon + 1).trimStart();
|
|
65
|
+
// Highlight pattern matches in content
|
|
66
|
+
let highlighted = content;
|
|
67
|
+
try {
|
|
68
|
+
const re = new RegExp(`(${escapeRegex(pattern)})`, 'gi');
|
|
69
|
+
highlighted = content.replace(re, yellow('$1'));
|
|
70
|
+
}
|
|
71
|
+
catch { /* invalid regex, show plain */ }
|
|
72
|
+
lines.push(gray(`${filePath}:${lineNum}:`) + ` ${highlighted}`);
|
|
73
|
+
}
|
|
74
|
+
return lines;
|
|
75
|
+
}
|
|
76
|
+
/** Scan result → PASS/WARN/BLOCK with score */
|
|
77
|
+
export function formatScanResult(resultText) {
|
|
78
|
+
const lines = [];
|
|
79
|
+
try {
|
|
80
|
+
const data = JSON.parse(resultText);
|
|
81
|
+
const action = data.action ?? 'UNKNOWN';
|
|
82
|
+
const score = data.score ?? 0;
|
|
83
|
+
if (action === 'PASS') {
|
|
84
|
+
lines.push(green('PASS') + dim(` (score: ${score})`));
|
|
85
|
+
}
|
|
86
|
+
else if (action === 'WARN') {
|
|
87
|
+
lines.push(yellow('WARN') + dim(` (score: ${score})`));
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
lines.push(red('BLOCK') + dim(` (score: ${score})`));
|
|
91
|
+
}
|
|
92
|
+
if (data.findings && data.findings.length > 0) {
|
|
93
|
+
for (const finding of data.findings.slice(0, 5)) {
|
|
94
|
+
lines.push(dim(` \u2022 ${finding.pattern ?? finding.type ?? 'unknown'}: ${finding.score ?? 0}`));
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
catch {
|
|
99
|
+
// Not JSON — show raw
|
|
100
|
+
lines.push(dim(resultText.slice(0, 200)));
|
|
101
|
+
}
|
|
102
|
+
return lines;
|
|
103
|
+
}
|
|
104
|
+
/** Generic tool result — truncated text */
|
|
105
|
+
export function formatGenericResult(resultText, maxLines = 15) {
|
|
106
|
+
const lines = resultText.split('\n');
|
|
107
|
+
if (lines.length <= maxLines) {
|
|
108
|
+
return lines.map(l => dim(l));
|
|
109
|
+
}
|
|
110
|
+
const shown = lines.slice(0, maxLines - 1).map(l => dim(l));
|
|
111
|
+
shown.push(dim(`... (${lines.length - maxLines + 1} more lines)`));
|
|
112
|
+
return shown;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Format tool output for the system pane based on tool name.
|
|
116
|
+
* Dispatches to the appropriate formatter.
|
|
117
|
+
*/
|
|
118
|
+
export function formatForSystemPane(name, args, resultText, paneWidth) {
|
|
119
|
+
const lines = [];
|
|
120
|
+
switch (name) {
|
|
121
|
+
case 'read_file':
|
|
122
|
+
lines.push(...formatFileRead(String(args.path ?? ''), resultText, paneWidth));
|
|
123
|
+
break;
|
|
124
|
+
case 'write_file':
|
|
125
|
+
lines.push(...formatFileWrite(String(args.path ?? ''), String(args.content ?? '')));
|
|
126
|
+
break;
|
|
127
|
+
case 'grep_files':
|
|
128
|
+
lines.push(...formatGrepResult(String(args.pattern ?? ''), resultText, paneWidth));
|
|
129
|
+
break;
|
|
130
|
+
case 'scan_text':
|
|
131
|
+
lines.push(...formatScanResult(resultText));
|
|
132
|
+
break;
|
|
133
|
+
case 'list_files':
|
|
134
|
+
lines.push(...formatGenericResult(resultText, 20));
|
|
135
|
+
break;
|
|
136
|
+
case 'msg_send':
|
|
137
|
+
case 'msg_broadcast':
|
|
138
|
+
case 'agent_status':
|
|
139
|
+
lines.push(...formatGenericResult(resultText, 20));
|
|
140
|
+
break;
|
|
141
|
+
default:
|
|
142
|
+
lines.push(...formatGenericResult(resultText));
|
|
143
|
+
break;
|
|
144
|
+
}
|
|
145
|
+
lines.push(''); // blank line separator between tool outputs
|
|
146
|
+
return lines;
|
|
147
|
+
}
|
|
148
|
+
// ─── Bang command result formatters ────────────────────────────────
|
|
149
|
+
/** Format bang command result for system pane */
|
|
150
|
+
export function formatBangResult(title, resultLines, paneWidth) {
|
|
151
|
+
const lines = [];
|
|
152
|
+
lines.push(brightAmber(`! ${title}`));
|
|
153
|
+
lines.push(formatSeparator(paneWidth));
|
|
154
|
+
for (const line of resultLines) {
|
|
155
|
+
lines.push(dim(line));
|
|
156
|
+
}
|
|
157
|
+
lines.push('');
|
|
158
|
+
return lines;
|
|
159
|
+
}
|
|
160
|
+
// ─── WS event formatters ──────────────────────────────────────────
|
|
161
|
+
/** Format a live WS event for system pane */
|
|
162
|
+
export function formatWsEvent(event) {
|
|
163
|
+
const lines = [];
|
|
164
|
+
// Skip metrics push — too noisy
|
|
165
|
+
if (event.type === '_metrics')
|
|
166
|
+
return lines;
|
|
167
|
+
const time = event.timestamp ? new Date(event.timestamp).toLocaleTimeString() : '';
|
|
168
|
+
const agent = event.agentId ? gray(`[${event.agentId}]`) : '';
|
|
169
|
+
lines.push(cyan('\u25C6') + ` ${event.type} ${agent} ${dim(time)}`);
|
|
170
|
+
if (event.data && Object.keys(event.data).length > 0) {
|
|
171
|
+
const dataStr = JSON.stringify(event.data);
|
|
172
|
+
if (dataStr.length <= 80) {
|
|
173
|
+
lines.push(dim(` ${dataStr}`));
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
lines.push(dim(` ${dataStr.slice(0, 77)}...`));
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
return lines;
|
|
180
|
+
}
|
|
181
|
+
/** Format a waggle delivery confirmation for chat pane */
|
|
182
|
+
export function formatWaggleConfirmation(to, content) {
|
|
183
|
+
const preview = content.length > 50 ? content.slice(0, 47) + '...' : content;
|
|
184
|
+
return dim(`\u25B8 waggle -> ${to}: ${preview}`);
|
|
185
|
+
}
|
|
186
|
+
/** Format a control action confirmation for chat pane */
|
|
187
|
+
export function formatControlConfirmation(verb, target, reason) {
|
|
188
|
+
const reasonStr = reason ? ` (${reason})` : '';
|
|
189
|
+
return dim(`\u25B8 ${verb} ${target}${reasonStr}`);
|
|
190
|
+
}
|
|
191
|
+
function escapeRegex(s) {
|
|
192
|
+
return s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
193
|
+
}
|
|
194
|
+
//# sourceMappingURL=system-pane.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system-pane.js","sourceRoot":"","sources":["../../src/repl/system-pane.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,yDAAyD;AAEzD,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAA0B,MAAM,eAAe,CAAC;AAGzG,4CAA4C;AAC5C,MAAM,UAAU,gBAAgB,CAAC,IAAY,EAAE,IAA6B;IAC1E,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE;QACjD,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QAChG,OAAO,GAAG,CAAC,IAAI,GAAG,EAAE,CAA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AU,IAAI,IAAI,MAAM,GAAG,SAAS,EAAE,CAAC,CAAC;AACrD,CAAC;AAED,SAAS,WAAW,CAAC,CAAS;IAC5B,OAAO,CAAC,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;AAClD,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// Queen system prompt builder
|
|
2
|
+
import { existsSync } from 'node:fs';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
export function buildSystemPrompt(provider, tools) {
|
|
5
|
+
const cwd = process.cwd();
|
|
6
|
+
const hasBrood = existsSync(join(cwd, 'brood.yaml'));
|
|
7
|
+
const hasWglrc = existsSync(join(cwd, '.wglrc')) || existsSync(join(cwd, '.wglrc.yaml')) || existsSync(join(cwd, '.wglrc.json'));
|
|
8
|
+
const hasAcpSpec = findAcpSpec(cwd);
|
|
9
|
+
const toolList = tools.map(t => `- ${t.function.name}: ${t.function.description}`).join('\n');
|
|
10
|
+
return `You are Honeybee, the conversational AI interface for Honeybee AI (honeyb.dev).
|
|
11
|
+
|
|
12
|
+
You help users build, manage, and monitor multi-agent systems. You have tools to read/write files, search code, scan for security issues, and coordinate AI agents through ACP (Agent Coordination Protocol).
|
|
13
|
+
|
|
14
|
+
## Your Capabilities
|
|
15
|
+
|
|
16
|
+
${toolList}
|
|
17
|
+
|
|
18
|
+
## Honeybee Platform Knowledge
|
|
19
|
+
|
|
20
|
+
### ACP (Agent Coordination Protocol)
|
|
21
|
+
An open YAML spec for multi-agent coordination. Key primitives:
|
|
22
|
+
- **Roles**: Agent types with capabilities and scope
|
|
23
|
+
- **Phases**: Workflow stages with exit conditions
|
|
24
|
+
- **State**: Shared key-value store between agents
|
|
25
|
+
- **Events**: Pub/sub notifications (agents publish, others subscribe)
|
|
26
|
+
- **Claims**: Mutex locks on resources (prevents conflicts)
|
|
27
|
+
|
|
28
|
+
### brood.yaml
|
|
29
|
+
"Docker-compose for AI agents." Defines multi-hive clusters:
|
|
30
|
+
\`\`\`yaml
|
|
31
|
+
name: my-project
|
|
32
|
+
provider: cerebras/llama-3.3-70b
|
|
33
|
+
hives:
|
|
34
|
+
main:
|
|
35
|
+
acp: spec.acp.yaml
|
|
36
|
+
dances: logic.js
|
|
37
|
+
agents:
|
|
38
|
+
- role: worker
|
|
39
|
+
type: worker
|
|
40
|
+
\`\`\`
|
|
41
|
+
|
|
42
|
+
### Key Commands (you can use these via tools)
|
|
43
|
+
- \`wgl up\` / \`wgl down\` — Start/stop local agent clusters
|
|
44
|
+
- \`wgl status\` — Show coordination state
|
|
45
|
+
- \`wgl protocol validate\` — Validate ACP specs
|
|
46
|
+
- \`wgl scan\` — Check text for prompt injection (Carapace)
|
|
47
|
+
|
|
48
|
+
## Current Environment
|
|
49
|
+
- Working directory: ${cwd}
|
|
50
|
+
- Provider: ${provider.providerName ?? provider.type} (${provider.model})
|
|
51
|
+
- brood.yaml: ${hasBrood ? 'found' : 'not found'}
|
|
52
|
+
- .wglrc config: ${hasWglrc ? 'found' : 'not found'}
|
|
53
|
+
- ACP spec: ${hasAcpSpec ?? 'not found'}
|
|
54
|
+
|
|
55
|
+
## Behavior
|
|
56
|
+
- Be concise and helpful. You're a terminal assistant — respect the medium.
|
|
57
|
+
- When asked to create brood.yaml or ACP specs, write them directly using write_file.
|
|
58
|
+
- When asked about running agents, check status first.
|
|
59
|
+
- Suggest tools and workflows proactively when relevant.
|
|
60
|
+
- For complex requests, break them into steps and explain your plan.
|
|
61
|
+
- If the user references an @name, that's an agent or queen they want to message.`;
|
|
62
|
+
}
|
|
63
|
+
function findAcpSpec(cwd) {
|
|
64
|
+
try {
|
|
65
|
+
const { readdirSync } = require('node:fs');
|
|
66
|
+
const files = readdirSync(cwd);
|
|
67
|
+
const spec = files.find((f) => f.endsWith('.acp.yaml') || f.endsWith('.acp.json'));
|
|
68
|
+
return spec ?? null;
|
|
69
|
+
}
|
|
70
|
+
catch {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
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2C,CAAC;AACnF,CAAC;AAED,SAAS,WAAW,CAAC,GAAW;IAC9B,IAAI,CAAC;QACH,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;QAC3C,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,CAAa,CAAC;QAC3C,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC;QAC3F,OAAO,IAAI,IAAI,IAAI,CAAC;IACtB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { getToolCallArgs } from './providers.js';
|
|
2
|
+
import { readFile, writeFile, listFiles, grepFiles } from './file-tools.js';
|
|
3
|
+
/**
|
|
4
|
+
* Capture console output from a function (for wrapping existing CLI commands).
|
|
5
|
+
*/
|
|
6
|
+
async function captureOutput(fn) {
|
|
7
|
+
const lines = [];
|
|
8
|
+
const origLog = console.log;
|
|
9
|
+
const origErr = console.error;
|
|
10
|
+
const origExit = process.exit;
|
|
11
|
+
console.log = (...args) => lines.push(args.map(String).join(' '));
|
|
12
|
+
console.error = (...args) => lines.push(args.map(String).join(' '));
|
|
13
|
+
process.exit = (() => { throw new Error('__EXIT__'); });
|
|
14
|
+
try {
|
|
15
|
+
await fn();
|
|
16
|
+
}
|
|
17
|
+
catch (err) {
|
|
18
|
+
if (err.message !== '__EXIT__') {
|
|
19
|
+
lines.push(`Error: ${err.message}`);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
finally {
|
|
23
|
+
console.log = origLog;
|
|
24
|
+
console.error = origErr;
|
|
25
|
+
process.exit = origExit;
|
|
26
|
+
}
|
|
27
|
+
return lines.join('\n') || '(no output)';
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Execute a tool call and return the result as a string.
|
|
31
|
+
*/
|
|
32
|
+
export async function executeTool(tc) {
|
|
33
|
+
const args = getToolCallArgs(tc);
|
|
34
|
+
const name = tc.function.name;
|
|
35
|
+
try {
|
|
36
|
+
switch (name) {
|
|
37
|
+
// ─── File tools ─────────────────────────────────────────────
|
|
38
|
+
case 'read_file':
|
|
39
|
+
return readFile(String(args.path ?? ''));
|
|
40
|
+
case 'write_file':
|
|
41
|
+
return writeFile(String(args.path ?? ''), String(args.content ?? ''));
|
|
42
|
+
case 'list_files':
|
|
43
|
+
return listFiles(args.dir ? String(args.dir) : undefined, args.pattern ? String(args.pattern) : undefined);
|
|
44
|
+
case 'grep_files':
|
|
45
|
+
return grepFiles(String(args.pattern ?? ''), args.path ? String(args.path) : undefined, args.glob ? String(args.glob) : undefined);
|
|
46
|
+
// ─── CLI tools (captured) ───────────────────────────────────
|
|
47
|
+
case 'scan_text': {
|
|
48
|
+
const text = String(args.text ?? '');
|
|
49
|
+
return await captureOutput(async () => {
|
|
50
|
+
const { scan } = await import('../commands/scan.js');
|
|
51
|
+
await scan([text, '--json']);
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
case 'wgl_status':
|
|
55
|
+
return await captureOutput(async () => {
|
|
56
|
+
const { status } = await import('../commands/status.js');
|
|
57
|
+
await status();
|
|
58
|
+
});
|
|
59
|
+
case 'wgl_team':
|
|
60
|
+
return await captureOutput(async () => {
|
|
61
|
+
const { team } = await import('../commands/team.js');
|
|
62
|
+
await team();
|
|
63
|
+
});
|
|
64
|
+
// ─── Messaging tools (captured) ────────────────────────────
|
|
65
|
+
case 'msg_send':
|
|
66
|
+
return await captureOutput(async () => {
|
|
67
|
+
const { msg } = await import('../commands/msg.js');
|
|
68
|
+
await msg(['send', String(args.to ?? ''), String(args.content ?? '')]);
|
|
69
|
+
});
|
|
70
|
+
case 'msg_broadcast':
|
|
71
|
+
return await captureOutput(async () => {
|
|
72
|
+
const { msg } = await import('../commands/msg.js');
|
|
73
|
+
await msg(['broadcast', String(args.content ?? '')]);
|
|
74
|
+
});
|
|
75
|
+
case 'agent_status':
|
|
76
|
+
return await captureOutput(async () => {
|
|
77
|
+
const { team } = await import('../commands/team.js');
|
|
78
|
+
await team();
|
|
79
|
+
});
|
|
80
|
+
// ─── ACP tools (captured) ──────────────────────────────────
|
|
81
|
+
case 'state_get':
|
|
82
|
+
return await captureOutput(async () => {
|
|
83
|
+
const { state } = await import('../commands/state.js');
|
|
84
|
+
const cmdArgs = args.key ? ['get', String(args.key)] : ['get'];
|
|
85
|
+
await state(cmdArgs);
|
|
86
|
+
});
|
|
87
|
+
case 'state_set':
|
|
88
|
+
return await captureOutput(async () => {
|
|
89
|
+
const { state } = await import('../commands/state.js');
|
|
90
|
+
await state(['set', String(args.key ?? ''), String(args.value ?? '')]);
|
|
91
|
+
});
|
|
92
|
+
case 'events_list':
|
|
93
|
+
return await captureOutput(async () => {
|
|
94
|
+
const { events } = await import('../commands/events.js');
|
|
95
|
+
const cmdArgs = ['list'];
|
|
96
|
+
if (args.type)
|
|
97
|
+
cmdArgs.push('--type', String(args.type));
|
|
98
|
+
if (args.since)
|
|
99
|
+
cmdArgs.push('--since', String(args.since));
|
|
100
|
+
await events(cmdArgs);
|
|
101
|
+
});
|
|
102
|
+
case 'events_publish':
|
|
103
|
+
return await captureOutput(async () => {
|
|
104
|
+
const { events } = await import('../commands/events.js');
|
|
105
|
+
const cmdArgs = ['publish', '--type', String(args.type ?? '')];
|
|
106
|
+
if (args.data)
|
|
107
|
+
cmdArgs.push('--data', String(args.data));
|
|
108
|
+
await events(cmdArgs);
|
|
109
|
+
});
|
|
110
|
+
default:
|
|
111
|
+
return `Unknown tool: ${name}`;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
catch (err) {
|
|
115
|
+
return `Tool error: ${err instanceof Error ? err.message : String(err)}`;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=tool-handlers.js.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,MAAM,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC;oBACzB,IAAI,IAAI,CAAC,IAAI;wBAAE,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;oBACzD,IAAI,IAAI,CAAC,KAAK;wBAAE,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;oBAC5D,MAAM,MAAM,CAAC,OAAO,CAAC,CAAC;gBACxB,CAAC,CAAC,CAAC;YAEL,KAAK,gBAAgB;gBACnB,OAAO,MAAM,aAAa,CAAC,KAAK,IAAI,EAAE;oBACpC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,MAAM,CAAC,uBAAuB,CAAC,CAAC;oBACzD,MAAM,OAAO,GAAG,CAAC,SAAS,EAAE,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC;oBAC/D,IAAI,IAAI,CAAC,IAAI;wBAAE,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;oBACzD,MAAM,MAAM,CAAC,OAAO,CAAC,CAAC;gBACxB,CAAC,CAAC,CAAC;YAEL;gBACE,OAAO,iBAAiB,IAAI,EAAE,CAAC;QACnC,CAAC;IACH,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,eAAe,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;IAC3E,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
export const REPL_TOOLS = [
|
|
2
|
+
// ─── File tools (direct fs, not propolis) ─────────────────────────
|
|
3
|
+
{
|
|
4
|
+
type: 'function',
|
|
5
|
+
function: {
|
|
6
|
+
name: 'read_file',
|
|
7
|
+
description: 'Read the contents of a file',
|
|
8
|
+
parameters: {
|
|
9
|
+
type: 'object',
|
|
10
|
+
properties: {
|
|
11
|
+
path: { type: 'string', description: 'File path (relative to cwd or absolute)' },
|
|
12
|
+
},
|
|
13
|
+
required: ['path'],
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
type: 'function',
|
|
19
|
+
function: {
|
|
20
|
+
name: 'write_file',
|
|
21
|
+
description: 'Write content to a file (creates directories if needed)',
|
|
22
|
+
parameters: {
|
|
23
|
+
type: 'object',
|
|
24
|
+
properties: {
|
|
25
|
+
path: { type: 'string', description: 'File path to write to' },
|
|
26
|
+
content: { type: 'string', description: 'Content to write' },
|
|
27
|
+
},
|
|
28
|
+
required: ['path', 'content'],
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
type: 'function',
|
|
34
|
+
function: {
|
|
35
|
+
name: 'list_files',
|
|
36
|
+
description: 'List files in a directory',
|
|
37
|
+
parameters: {
|
|
38
|
+
type: 'object',
|
|
39
|
+
properties: {
|
|
40
|
+
dir: { type: 'string', description: 'Directory to list (default: cwd)' },
|
|
41
|
+
pattern: { type: 'string', description: 'Glob pattern filter (e.g. "*.yaml")' },
|
|
42
|
+
},
|
|
43
|
+
required: [],
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
type: 'function',
|
|
49
|
+
function: {
|
|
50
|
+
name: 'grep_files',
|
|
51
|
+
description: 'Search for a pattern in files',
|
|
52
|
+
parameters: {
|
|
53
|
+
type: 'object',
|
|
54
|
+
properties: {
|
|
55
|
+
pattern: { type: 'string', description: 'Search pattern (regex)' },
|
|
56
|
+
path: { type: 'string', description: 'File or directory to search in (default: cwd)' },
|
|
57
|
+
glob: { type: 'string', description: 'File glob filter (e.g. "*.ts")' },
|
|
58
|
+
},
|
|
59
|
+
required: ['pattern'],
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
// ─── CLI tools (captured stdout) ─────────────────────────────────
|
|
64
|
+
{
|
|
65
|
+
type: 'function',
|
|
66
|
+
function: {
|
|
67
|
+
name: 'scan_text',
|
|
68
|
+
description: 'Scan text for prompt injection attacks using Carapace',
|
|
69
|
+
parameters: {
|
|
70
|
+
type: 'object',
|
|
71
|
+
properties: {
|
|
72
|
+
text: { type: 'string', description: 'Text to scan for injection' },
|
|
73
|
+
},
|
|
74
|
+
required: ['text'],
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
type: 'function',
|
|
80
|
+
function: {
|
|
81
|
+
name: 'wgl_status',
|
|
82
|
+
description: 'Show current coordination status (protocol, phase, claims, events)',
|
|
83
|
+
parameters: {
|
|
84
|
+
type: 'object',
|
|
85
|
+
properties: {},
|
|
86
|
+
required: [],
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
type: 'function',
|
|
92
|
+
function: {
|
|
93
|
+
name: 'wgl_team',
|
|
94
|
+
description: 'Show connected agents and their roles',
|
|
95
|
+
parameters: {
|
|
96
|
+
type: 'object',
|
|
97
|
+
properties: {},
|
|
98
|
+
required: [],
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
// ─── Messaging tools ─────────────────────────────────────────────
|
|
103
|
+
{
|
|
104
|
+
type: 'function',
|
|
105
|
+
function: {
|
|
106
|
+
name: 'msg_send',
|
|
107
|
+
description: 'Send a message to a specific agent',
|
|
108
|
+
parameters: {
|
|
109
|
+
type: 'object',
|
|
110
|
+
properties: {
|
|
111
|
+
to: { type: 'string', description: 'Target agent ID' },
|
|
112
|
+
content: { type: 'string', description: 'Message content' },
|
|
113
|
+
},
|
|
114
|
+
required: ['to', 'content'],
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
type: 'function',
|
|
120
|
+
function: {
|
|
121
|
+
name: 'msg_broadcast',
|
|
122
|
+
description: 'Broadcast a message to all agents',
|
|
123
|
+
parameters: {
|
|
124
|
+
type: 'object',
|
|
125
|
+
properties: {
|
|
126
|
+
content: { type: 'string', description: 'Message to broadcast' },
|
|
127
|
+
},
|
|
128
|
+
required: ['content'],
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
type: 'function',
|
|
134
|
+
function: {
|
|
135
|
+
name: 'agent_status',
|
|
136
|
+
description: 'Get status of agents (roles, control status, run info)',
|
|
137
|
+
parameters: {
|
|
138
|
+
type: 'object',
|
|
139
|
+
properties: {},
|
|
140
|
+
required: [],
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
// ─── ACP tools ────────────────────────────────────────────────────
|
|
145
|
+
{
|
|
146
|
+
type: 'function',
|
|
147
|
+
function: {
|
|
148
|
+
name: 'state_get',
|
|
149
|
+
description: 'Get shared state (all keys or a specific key)',
|
|
150
|
+
parameters: {
|
|
151
|
+
type: 'object',
|
|
152
|
+
properties: {
|
|
153
|
+
key: { type: 'string', description: 'Specific key to get (omit for all state)' },
|
|
154
|
+
},
|
|
155
|
+
required: [],
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
type: 'function',
|
|
161
|
+
function: {
|
|
162
|
+
name: 'state_set',
|
|
163
|
+
description: 'Set a shared state value',
|
|
164
|
+
parameters: {
|
|
165
|
+
type: 'object',
|
|
166
|
+
properties: {
|
|
167
|
+
key: { type: 'string', description: 'State key' },
|
|
168
|
+
value: { type: 'string', description: 'Value to set' },
|
|
169
|
+
},
|
|
170
|
+
required: ['key', 'value'],
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
type: 'function',
|
|
176
|
+
function: {
|
|
177
|
+
name: 'events_list',
|
|
178
|
+
description: 'List recent events',
|
|
179
|
+
parameters: {
|
|
180
|
+
type: 'object',
|
|
181
|
+
properties: {
|
|
182
|
+
type: { type: 'string', description: 'Filter by event type' },
|
|
183
|
+
since: { type: 'string', description: 'Event ID to start from' },
|
|
184
|
+
},
|
|
185
|
+
required: [],
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
type: 'function',
|
|
191
|
+
function: {
|
|
192
|
+
name: 'events_publish',
|
|
193
|
+
description: 'Publish an event to the coordination bus',
|
|
194
|
+
parameters: {
|
|
195
|
+
type: 'object',
|
|
196
|
+
properties: {
|
|
197
|
+
type: { type: 'string', description: 'Event type (e.g. "task.complete")' },
|
|
198
|
+
data: { type: 'string', description: 'Event data as JSON string' },
|
|
199
|
+
},
|
|
200
|
+
required: ['type'],
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
];
|
|
205
|
+
//# sourceMappingURL=tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/repl/tools.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,UAAU,GAAc;IACnC,qEAAqE;IACrE;QACE,IAAI,EAAE,UAAU;QAChB,QAAQ,EAAE;YACR,IAAI,EAAE,WAAW;YACjB,WAAW,EAAE,6BAA6B;YAC1C,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,yCAAyC,EAAE;iBACjF;gBACD,QAAQ,EAAE,CAAC,MAAM,CAAC;aACnB;SACF;KACF;IACD;QACE,IAAI,EAAE,UAAU;QAChB,QAAQ,EAAE;YACR,IAAI,EAAE,YAAY;YAClB,WAAW,EAAE,yDAAyD;YACtE,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,IAA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