@enderfga/claw-orchestrator 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +218 -0
- package/assets/banner.jpg +0 -0
- package/configs/council-reviewer-prompt.md +82 -0
- package/configs/council-system-prompt.md +141 -0
- package/dist/bin/cli.d.ts +13 -0
- package/dist/bin/cli.js +460 -0
- package/dist/bin/cli.js.map +1 -0
- package/dist/src/base-oneshot-session.d.ts +87 -0
- package/dist/src/base-oneshot-session.js +228 -0
- package/dist/src/base-oneshot-session.js.map +1 -0
- package/dist/src/circuit-breaker.d.ts +21 -0
- package/dist/src/circuit-breaker.js +49 -0
- package/dist/src/circuit-breaker.js.map +1 -0
- package/dist/src/consensus.d.ts +20 -0
- package/dist/src/consensus.js +52 -0
- package/dist/src/consensus.js.map +1 -0
- package/dist/src/constants.d.ts +129 -0
- package/dist/src/constants.js +138 -0
- package/dist/src/constants.js.map +1 -0
- package/dist/src/council.d.ts +67 -0
- package/dist/src/council.js +914 -0
- package/dist/src/council.js.map +1 -0
- package/dist/src/embedded-server.d.ts +25 -0
- package/dist/src/embedded-server.js +360 -0
- package/dist/src/embedded-server.js.map +1 -0
- package/dist/src/inbox-manager.d.ts +38 -0
- package/dist/src/inbox-manager.js +111 -0
- package/dist/src/inbox-manager.js.map +1 -0
- package/dist/src/index.d.ts +63 -0
- package/dist/src/index.js +973 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/logger.d.ts +16 -0
- package/dist/src/logger.js +44 -0
- package/dist/src/logger.js.map +1 -0
- package/dist/src/models.d.ts +69 -0
- package/dist/src/models.js +299 -0
- package/dist/src/models.js.map +1 -0
- package/dist/src/openai-compat.d.ts +224 -0
- package/dist/src/openai-compat.js +756 -0
- package/dist/src/openai-compat.js.map +1 -0
- package/dist/src/persistent-codex-app-session.d.ts +108 -0
- package/dist/src/persistent-codex-app-session.js +465 -0
- package/dist/src/persistent-codex-app-session.js.map +1 -0
- package/dist/src/persistent-codex-session.d.ts +37 -0
- package/dist/src/persistent-codex-session.js +208 -0
- package/dist/src/persistent-codex-session.js.map +1 -0
- package/dist/src/persistent-cursor-session.d.ts +21 -0
- package/dist/src/persistent-cursor-session.js +241 -0
- package/dist/src/persistent-cursor-session.js.map +1 -0
- package/dist/src/persistent-custom-session.d.ts +78 -0
- package/dist/src/persistent-custom-session.js +938 -0
- package/dist/src/persistent-custom-session.js.map +1 -0
- package/dist/src/persistent-gemini-session.d.ts +21 -0
- package/dist/src/persistent-gemini-session.js +216 -0
- package/dist/src/persistent-gemini-session.js.map +1 -0
- package/dist/src/persistent-session.d.ts +80 -0
- package/dist/src/persistent-session.js +745 -0
- package/dist/src/persistent-session.js.map +1 -0
- package/dist/src/proxy/anthropic-adapter.d.ts +136 -0
- package/dist/src/proxy/anthropic-adapter.js +392 -0
- package/dist/src/proxy/anthropic-adapter.js.map +1 -0
- package/dist/src/proxy/handler.d.ts +39 -0
- package/dist/src/proxy/handler.js +365 -0
- package/dist/src/proxy/handler.js.map +1 -0
- package/dist/src/proxy/schema-cleaner.d.ts +11 -0
- package/dist/src/proxy/schema-cleaner.js +34 -0
- package/dist/src/proxy/schema-cleaner.js.map +1 -0
- package/dist/src/proxy/thought-cache.d.ts +19 -0
- package/dist/src/proxy/thought-cache.js +53 -0
- package/dist/src/proxy/thought-cache.js.map +1 -0
- package/dist/src/session-manager.d.ts +317 -0
- package/dist/src/session-manager.js +1528 -0
- package/dist/src/session-manager.js.map +1 -0
- package/dist/src/types.d.ts +513 -0
- package/dist/src/types.js +8 -0
- package/dist/src/types.js.map +1 -0
- package/dist/src/validation.d.ts +31 -0
- package/dist/src/validation.js +104 -0
- package/dist/src/validation.js.map +1 -0
- package/openclaw.plugin.json +122 -0
- package/package.json +84 -0
- package/skills/SKILL.md +184 -0
- package/skills/references/claude-cli-tracking.md +25 -0
- package/skills/references/cli.md +187 -0
- package/skills/references/council.md +210 -0
- package/skills/references/getting-started.md +133 -0
- package/skills/references/inbox.md +81 -0
- package/skills/references/multi-engine.md +382 -0
- package/skills/references/openai-compat.md +203 -0
- package/skills/references/sessions.md +191 -0
- package/skills/references/tools.md +418 -0
- package/skills/references/ultra.md +126 -0
package/dist/bin/cli.js
ADDED
|
@@ -0,0 +1,460 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* clawo CLI — connects to the Claw Orchestrator embedded server (auto-started by the plugin)
|
|
4
|
+
*
|
|
5
|
+
* When the plugin is installed, the embedded server starts automatically.
|
|
6
|
+
* This CLI is just an HTTP client — zero configuration needed.
|
|
7
|
+
*
|
|
8
|
+
* For standalone use (no OpenClaw), run: clawo serve
|
|
9
|
+
*
|
|
10
|
+
* Note: this file is also exposed as `claude-code-skill` for backward
|
|
11
|
+
* compatibility with v2.x installations. The alias will be removed in v3.1.
|
|
12
|
+
*/
|
|
13
|
+
import { Command } from 'commander';
|
|
14
|
+
import { createRequire } from 'node:module';
|
|
15
|
+
function getBaseUrl() {
|
|
16
|
+
return process.env.CLAUDE_CODE_API_URL || 'http://127.0.0.1:18796';
|
|
17
|
+
}
|
|
18
|
+
function getCliVersion() {
|
|
19
|
+
try {
|
|
20
|
+
const _require = createRequire(import.meta.url);
|
|
21
|
+
// From dist/bin/cli.js, package.json sits two levels up (dist/bin/ → dist/ → root).
|
|
22
|
+
const pkg = _require('../../package.json');
|
|
23
|
+
return pkg.version || '0.0.0';
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
return '0.0.0';
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
// ─── HTTP Client ─────────────────────────────────────────────────────────────
|
|
30
|
+
async function api(path, method = 'GET', body) {
|
|
31
|
+
const opts = {
|
|
32
|
+
method,
|
|
33
|
+
headers: { 'Content-Type': 'application/json' },
|
|
34
|
+
};
|
|
35
|
+
if (body)
|
|
36
|
+
opts.body = JSON.stringify(body);
|
|
37
|
+
try {
|
|
38
|
+
const base = getBaseUrl();
|
|
39
|
+
const resp = await fetch(`${base}${path}`, opts);
|
|
40
|
+
return (await resp.json());
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
return { ok: false, error: `Cannot connect to ${getBaseUrl()} — is the plugin running?` };
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
// ─── CLI ─────────────────────────────────────────────────────────────────────
|
|
47
|
+
const program = new Command();
|
|
48
|
+
// Use argv[1] basename so the help text reflects which alias the user invoked
|
|
49
|
+
// (clawo vs. claude-code-skill). Both binaries point at this same file.
|
|
50
|
+
const invokedAs = (process.argv[1] || '').split('/').pop() || 'clawo';
|
|
51
|
+
program.name(invokedAs).description('Claw Orchestrator CLI').version(getCliVersion());
|
|
52
|
+
// Serve (standalone mode — no OpenClaw needed)
|
|
53
|
+
program
|
|
54
|
+
.command('serve')
|
|
55
|
+
.description('Start standalone embedded server (for use without OpenClaw)')
|
|
56
|
+
.option('-p, --port <port>', 'Port', '18796')
|
|
57
|
+
.option('-H, --host <host>', 'Bind address (default: 127.0.0.1, use 0.0.0.0 for remote access)')
|
|
58
|
+
.action(async (opts) => {
|
|
59
|
+
const { SessionManager } = await import('../src/session-manager.js');
|
|
60
|
+
const { EmbeddedServer } = await import('../src/embedded-server.js');
|
|
61
|
+
// Serve mode targets long-running multi-caller setups (OpenAI-compat
|
|
62
|
+
// bridge for OpenClaw main agent + cron + subagents + webchat). Default
|
|
63
|
+
// bumps over the in-plugin defaults are intentional:
|
|
64
|
+
// - maxConcurrentSessions=32: each distinct caller gets its own
|
|
65
|
+
// sys-<hash> session, 5 is too low for prod multi-caller use.
|
|
66
|
+
// - sessionTtlMinutes=60: faster reaping of idle one-off callers.
|
|
67
|
+
// Both env-overridable so ops can tune without a code change.
|
|
68
|
+
const maxSessions = parseInt(process.env.OPENCLAW_SERVE_MAX_SESSIONS || '', 10) || 32;
|
|
69
|
+
const ttlMinutes = parseInt(process.env.OPENCLAW_SERVE_TTL_MINUTES || '', 10) || 60;
|
|
70
|
+
const manager = new SessionManager({
|
|
71
|
+
maxConcurrentSessions: maxSessions,
|
|
72
|
+
sessionTtlMinutes: ttlMinutes,
|
|
73
|
+
});
|
|
74
|
+
const server = new EmbeddedServer(manager, parseInt(opts.port), opts.host);
|
|
75
|
+
const port = await server.start();
|
|
76
|
+
if (port) {
|
|
77
|
+
console.log(`Standalone server running on http://127.0.0.1:${port}`);
|
|
78
|
+
console.log('Press Ctrl+C to stop');
|
|
79
|
+
process.on('SIGINT', async () => {
|
|
80
|
+
await server.stop();
|
|
81
|
+
await manager.shutdown();
|
|
82
|
+
process.exit(0);
|
|
83
|
+
});
|
|
84
|
+
process.on('SIGTERM', async () => {
|
|
85
|
+
await server.stop();
|
|
86
|
+
await manager.shutdown();
|
|
87
|
+
process.exit(0);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
// Session commands
|
|
92
|
+
program
|
|
93
|
+
.command('session-start [name]')
|
|
94
|
+
.description('Start a persistent coding session (Claude Code, Codex, Gemini, or Cursor)')
|
|
95
|
+
.option('-d, --cwd <dir>', 'Working directory')
|
|
96
|
+
.option('-e, --engine <engine>', 'Engine: claude (default), codex, gemini, or cursor')
|
|
97
|
+
.option('-m, --model <model>', 'Model to use')
|
|
98
|
+
.option('--permission-mode <mode>', 'Permission mode', 'acceptEdits')
|
|
99
|
+
.option('--effort <level>', 'Effort level')
|
|
100
|
+
.option('--allowed-tools <tools>', 'Comma-separated tools to auto-approve')
|
|
101
|
+
.option('--disallowed-tools <tools>', 'Comma-separated tools to deny')
|
|
102
|
+
.option('--max-turns <n>', 'Max agent loop turns')
|
|
103
|
+
.option('--max-budget <usd>', 'Max API spend')
|
|
104
|
+
.option('--system-prompt <prompt>', 'Replace system prompt')
|
|
105
|
+
.option('--append-system-prompt <prompt>', 'Append to system prompt')
|
|
106
|
+
.option('--agents <json>', 'Custom sub-agents JSON')
|
|
107
|
+
.option('--agent <name>', 'Default agent')
|
|
108
|
+
.option('--bare', 'Minimal mode')
|
|
109
|
+
.option('-w, --worktree [name]', 'Git worktree')
|
|
110
|
+
.option('--fallback-model <model>', 'Fallback model')
|
|
111
|
+
.option('--json-schema <schema>', 'JSON Schema for structured output')
|
|
112
|
+
.option('--mcp-config <paths>', 'MCP config files')
|
|
113
|
+
.option('--settings <pathOrJson>', 'Settings.json')
|
|
114
|
+
.option('--skip-persistence', 'Disable session persistence')
|
|
115
|
+
.option('--betas <headers>', 'Custom beta headers')
|
|
116
|
+
.option('--enable-agent-teams', 'Enable agent teams')
|
|
117
|
+
.option('--enable-auto-mode', 'Enable auto permission mode')
|
|
118
|
+
.option('--resume-session-id <id>', 'Resume existing session by ID')
|
|
119
|
+
.option('--base-url <url>', 'Custom API endpoint (for proxy)')
|
|
120
|
+
.option('--add-dir <dirs>', 'Comma-separated additional working directories')
|
|
121
|
+
.action(async (name, opts) => {
|
|
122
|
+
const body = { name: name || `session-${Date.now()}` };
|
|
123
|
+
if (opts.cwd)
|
|
124
|
+
body.cwd = opts.cwd;
|
|
125
|
+
if (opts.engine)
|
|
126
|
+
body.engine = opts.engine;
|
|
127
|
+
if (opts.model)
|
|
128
|
+
body.model = opts.model;
|
|
129
|
+
if (opts.permissionMode)
|
|
130
|
+
body.permissionMode = opts.permissionMode;
|
|
131
|
+
if (opts.effort)
|
|
132
|
+
body.effort = opts.effort;
|
|
133
|
+
if (opts.allowedTools)
|
|
134
|
+
body.allowedTools = opts.allowedTools
|
|
135
|
+
.split(',')
|
|
136
|
+
.map((s) => s.trim())
|
|
137
|
+
.filter(Boolean);
|
|
138
|
+
if (opts.disallowedTools)
|
|
139
|
+
body.disallowedTools = opts.disallowedTools
|
|
140
|
+
.split(',')
|
|
141
|
+
.map((s) => s.trim())
|
|
142
|
+
.filter(Boolean);
|
|
143
|
+
if (opts.resumeSessionId)
|
|
144
|
+
body.resumeSessionId = opts.resumeSessionId;
|
|
145
|
+
if (opts.baseUrl)
|
|
146
|
+
body.baseUrl = opts.baseUrl;
|
|
147
|
+
if (opts.addDir)
|
|
148
|
+
body.addDir = opts.addDir
|
|
149
|
+
.split(',')
|
|
150
|
+
.map((s) => s.trim())
|
|
151
|
+
.filter(Boolean);
|
|
152
|
+
if (opts.enableAutoMode)
|
|
153
|
+
body.enableAutoMode = true;
|
|
154
|
+
if (opts.maxTurns) {
|
|
155
|
+
const v = parseInt(opts.maxTurns);
|
|
156
|
+
if (isNaN(v) || v <= 0) {
|
|
157
|
+
console.error('--max-turns must be a positive integer');
|
|
158
|
+
process.exit(1);
|
|
159
|
+
}
|
|
160
|
+
body.maxTurns = v;
|
|
161
|
+
}
|
|
162
|
+
if (opts.maxBudget) {
|
|
163
|
+
const v = parseFloat(opts.maxBudget);
|
|
164
|
+
if (isNaN(v) || v <= 0) {
|
|
165
|
+
console.error('--max-budget must be a positive number');
|
|
166
|
+
process.exit(1);
|
|
167
|
+
}
|
|
168
|
+
body.maxBudgetUsd = v;
|
|
169
|
+
}
|
|
170
|
+
if (opts.systemPrompt)
|
|
171
|
+
body.systemPrompt = opts.systemPrompt;
|
|
172
|
+
if (opts.appendSystemPrompt)
|
|
173
|
+
body.appendSystemPrompt = opts.appendSystemPrompt;
|
|
174
|
+
if (opts.agents) {
|
|
175
|
+
try {
|
|
176
|
+
body.agents = JSON.parse(opts.agents);
|
|
177
|
+
}
|
|
178
|
+
catch (e) {
|
|
179
|
+
console.error(`Invalid JSON in --agents: ${e.message}`);
|
|
180
|
+
process.exit(1);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
if (opts.agent)
|
|
184
|
+
body.agent = opts.agent;
|
|
185
|
+
if (opts.bare)
|
|
186
|
+
body.bare = true;
|
|
187
|
+
if (opts.worktree !== undefined)
|
|
188
|
+
body.worktree = typeof opts.worktree === 'string' ? opts.worktree : true;
|
|
189
|
+
if (opts.fallbackModel)
|
|
190
|
+
body.fallbackModel = opts.fallbackModel;
|
|
191
|
+
if (opts.jsonSchema)
|
|
192
|
+
body.jsonSchema = opts.jsonSchema;
|
|
193
|
+
if (opts.mcpConfig)
|
|
194
|
+
body.mcpConfig = opts.mcpConfig
|
|
195
|
+
.split(',')
|
|
196
|
+
.map((s) => s.trim())
|
|
197
|
+
.filter(Boolean);
|
|
198
|
+
if (opts.settings)
|
|
199
|
+
body.settings = opts.settings;
|
|
200
|
+
if (opts.skipPersistence)
|
|
201
|
+
body.noSessionPersistence = true;
|
|
202
|
+
if (opts.betas)
|
|
203
|
+
body.betas = opts.betas
|
|
204
|
+
.split(',')
|
|
205
|
+
.map((s) => s.trim())
|
|
206
|
+
.filter(Boolean);
|
|
207
|
+
if (opts.enableAgentTeams)
|
|
208
|
+
body.enableAgentTeams = true;
|
|
209
|
+
const result = await api('/session/start', 'POST', body);
|
|
210
|
+
if (result.ok) {
|
|
211
|
+
console.log(`Session '${body.name}' started!`);
|
|
212
|
+
if (result.claudeSessionId)
|
|
213
|
+
console.log(`Claude Session ID: ${result.claudeSessionId}`);
|
|
214
|
+
}
|
|
215
|
+
else
|
|
216
|
+
console.error(`Failed: ${result.error}`);
|
|
217
|
+
});
|
|
218
|
+
program
|
|
219
|
+
.command('session-send <name> <message>')
|
|
220
|
+
.description('Send a message to a session')
|
|
221
|
+
.option('--effort <level>', 'Effort level')
|
|
222
|
+
.option('--plan', 'Plan mode')
|
|
223
|
+
.option('-t, --timeout <ms>', 'Timeout', '300000')
|
|
224
|
+
.option('-s, --stream', 'Collect streaming chunks and include in output')
|
|
225
|
+
.action(async (name, message, opts) => {
|
|
226
|
+
const result = await api('/session/send', 'POST', {
|
|
227
|
+
name,
|
|
228
|
+
message,
|
|
229
|
+
effort: opts.effort,
|
|
230
|
+
plan: opts.plan,
|
|
231
|
+
timeout: parseInt(opts.timeout),
|
|
232
|
+
stream: opts.stream || undefined,
|
|
233
|
+
});
|
|
234
|
+
if (result.ok) {
|
|
235
|
+
console.log(result.output);
|
|
236
|
+
if (opts.stream && Array.isArray(result.chunks) && result.chunks.length > 0) {
|
|
237
|
+
console.log(`\n[${result.chunks.length} streaming chunks collected]`);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
else
|
|
241
|
+
console.error(`Failed: ${result.error}`);
|
|
242
|
+
});
|
|
243
|
+
program
|
|
244
|
+
.command('session-stop <name>')
|
|
245
|
+
.description('Stop a session')
|
|
246
|
+
.action(async (name) => {
|
|
247
|
+
const r = await api('/session/stop', 'POST', { name });
|
|
248
|
+
if (r.ok)
|
|
249
|
+
console.log(`Session '${name}' stopped.`);
|
|
250
|
+
else
|
|
251
|
+
console.error(`Failed: ${r.error}`);
|
|
252
|
+
});
|
|
253
|
+
program
|
|
254
|
+
.command('session-list')
|
|
255
|
+
.description('List sessions')
|
|
256
|
+
.action(async () => {
|
|
257
|
+
const r = await api('/session/list');
|
|
258
|
+
if (!r.ok) {
|
|
259
|
+
console.error(`Failed: ${r.error}`);
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
const sessions = r.sessions;
|
|
263
|
+
if (!sessions.length) {
|
|
264
|
+
console.log('No active sessions.');
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
for (const s of sessions)
|
|
268
|
+
console.log(` ${s.name} — ${s.model || 'default'} (${s.cwd})`);
|
|
269
|
+
});
|
|
270
|
+
program
|
|
271
|
+
.command('session-status <name>')
|
|
272
|
+
.description('Get session status')
|
|
273
|
+
.action(async (name) => {
|
|
274
|
+
const r = await api('/session/status', 'POST', { name });
|
|
275
|
+
if (!r.ok) {
|
|
276
|
+
console.error(`Failed: ${r.error}`);
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
const s = r.stats;
|
|
280
|
+
console.log(`Session: ${name}`);
|
|
281
|
+
console.log(` Turns: ${s.turns}, Tools: ${s.toolCalls}, Cost: $${s.costUsd}`);
|
|
282
|
+
console.log(` Tokens: ${s.tokensIn} in / ${s.tokensOut} out`);
|
|
283
|
+
console.log(` Uptime: ${s.uptime}s`);
|
|
284
|
+
});
|
|
285
|
+
program
|
|
286
|
+
.command('session-grep <name> <pattern>')
|
|
287
|
+
.description('Search session history')
|
|
288
|
+
.option('-n, --limit <n>', 'Max results', '50')
|
|
289
|
+
.action(async (name, pattern, opts) => {
|
|
290
|
+
const r = await api('/session/grep', 'POST', { name, pattern, limit: parseInt(opts.limit) });
|
|
291
|
+
if (!r.ok) {
|
|
292
|
+
console.error(`Failed: ${r.error}`);
|
|
293
|
+
return;
|
|
294
|
+
}
|
|
295
|
+
console.log(`Found ${r.count} match(es)`);
|
|
296
|
+
for (const m of r.matches)
|
|
297
|
+
console.log(` [${m.time}] ${m.type}`);
|
|
298
|
+
});
|
|
299
|
+
program
|
|
300
|
+
.command('session-compact <name>')
|
|
301
|
+
.description('Compact session')
|
|
302
|
+
.option('--summary <text>', 'Custom summary')
|
|
303
|
+
.action(async (name, opts) => {
|
|
304
|
+
const r = await api('/session/compact', 'POST', { name, summary: opts.summary });
|
|
305
|
+
if (r.ok)
|
|
306
|
+
console.log('Compacted.');
|
|
307
|
+
else
|
|
308
|
+
console.error(`Failed: ${r.error}`);
|
|
309
|
+
});
|
|
310
|
+
// Agent management
|
|
311
|
+
program
|
|
312
|
+
.command('agents-list')
|
|
313
|
+
.description('List agents')
|
|
314
|
+
.option('-d, --cwd <dir>')
|
|
315
|
+
.action(async (opts) => {
|
|
316
|
+
const q = opts.cwd ? `?cwd=${encodeURIComponent(opts.cwd)}` : '';
|
|
317
|
+
const r = await api(`/agents${q}`);
|
|
318
|
+
if (!r.ok) {
|
|
319
|
+
console.error(`Failed: ${r.error}`);
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
322
|
+
const agents = r.agents;
|
|
323
|
+
if (!agents.length) {
|
|
324
|
+
console.log('No agents found.');
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
for (const a of agents)
|
|
328
|
+
console.log(` ${a.name}${a.description ? ` — ${a.description}` : ''}`);
|
|
329
|
+
});
|
|
330
|
+
program
|
|
331
|
+
.command('agents-create <name>')
|
|
332
|
+
.description('Create agent')
|
|
333
|
+
.option('-d, --cwd <dir>')
|
|
334
|
+
.option('--description <desc>')
|
|
335
|
+
.option('--prompt <prompt>')
|
|
336
|
+
.action(async (name, opts) => {
|
|
337
|
+
const r = await api('/agents/create', 'POST', {
|
|
338
|
+
name,
|
|
339
|
+
cwd: opts.cwd,
|
|
340
|
+
description: opts.description,
|
|
341
|
+
prompt: opts.prompt,
|
|
342
|
+
});
|
|
343
|
+
if (r.ok)
|
|
344
|
+
console.log(`Agent '${name}' created at: ${r.path}`);
|
|
345
|
+
else
|
|
346
|
+
console.error(`Failed: ${r.error}`);
|
|
347
|
+
});
|
|
348
|
+
// Skills
|
|
349
|
+
program
|
|
350
|
+
.command('skills-list')
|
|
351
|
+
.description('List skills')
|
|
352
|
+
.option('-d, --cwd <dir>')
|
|
353
|
+
.action(async (opts) => {
|
|
354
|
+
const q = opts.cwd ? `?cwd=${encodeURIComponent(opts.cwd)}` : '';
|
|
355
|
+
const r = await api(`/skills${q}`);
|
|
356
|
+
if (!r.ok) {
|
|
357
|
+
console.error(`Failed: ${r.error}`);
|
|
358
|
+
return;
|
|
359
|
+
}
|
|
360
|
+
const skills = r.skills;
|
|
361
|
+
if (!skills.length) {
|
|
362
|
+
console.log('No skills found.');
|
|
363
|
+
return;
|
|
364
|
+
}
|
|
365
|
+
for (const s of skills)
|
|
366
|
+
console.log(` ${s.name}${s.description ? ` — ${s.description}` : ''}`);
|
|
367
|
+
});
|
|
368
|
+
program
|
|
369
|
+
.command('skills-create <name>')
|
|
370
|
+
.description('Create skill')
|
|
371
|
+
.option('-d, --cwd <dir>')
|
|
372
|
+
.option('--description <desc>')
|
|
373
|
+
.option('--prompt <prompt>')
|
|
374
|
+
.option('--trigger <t>')
|
|
375
|
+
.action(async (name, opts) => {
|
|
376
|
+
const r = await api('/skills/create', 'POST', {
|
|
377
|
+
name,
|
|
378
|
+
cwd: opts.cwd,
|
|
379
|
+
description: opts.description,
|
|
380
|
+
prompt: opts.prompt,
|
|
381
|
+
trigger: opts.trigger,
|
|
382
|
+
});
|
|
383
|
+
if (r.ok)
|
|
384
|
+
console.log(`Skill '${name}' created at: ${r.path}`);
|
|
385
|
+
else
|
|
386
|
+
console.error(`Failed: ${r.error}`);
|
|
387
|
+
});
|
|
388
|
+
// Rules
|
|
389
|
+
program
|
|
390
|
+
.command('rules-list')
|
|
391
|
+
.description('List rules')
|
|
392
|
+
.option('-d, --cwd <dir>')
|
|
393
|
+
.action(async (opts) => {
|
|
394
|
+
const q = opts.cwd ? `?cwd=${encodeURIComponent(opts.cwd)}` : '';
|
|
395
|
+
const r = await api(`/rules${q}`);
|
|
396
|
+
if (!r.ok) {
|
|
397
|
+
console.error(`Failed: ${r.error}`);
|
|
398
|
+
return;
|
|
399
|
+
}
|
|
400
|
+
const rules = r.rules;
|
|
401
|
+
if (!rules.length) {
|
|
402
|
+
console.log('No rules found.');
|
|
403
|
+
return;
|
|
404
|
+
}
|
|
405
|
+
for (const rule of rules) {
|
|
406
|
+
let info = ` ${rule.name}`;
|
|
407
|
+
if (rule.description)
|
|
408
|
+
info += ` — ${rule.description}`;
|
|
409
|
+
if (rule.paths)
|
|
410
|
+
info += ` [paths: ${rule.paths}]`;
|
|
411
|
+
if (rule.condition)
|
|
412
|
+
info += ` [if: ${rule.condition}]`;
|
|
413
|
+
console.log(info);
|
|
414
|
+
}
|
|
415
|
+
});
|
|
416
|
+
program
|
|
417
|
+
.command('rules-create <name>')
|
|
418
|
+
.description('Create rule')
|
|
419
|
+
.option('-d, --cwd <dir>')
|
|
420
|
+
.option('--description <desc>')
|
|
421
|
+
.option('--content <text>')
|
|
422
|
+
.option('--paths <glob>')
|
|
423
|
+
.option('--condition <expr>')
|
|
424
|
+
.action(async (name, opts) => {
|
|
425
|
+
const r = await api('/rules/create', 'POST', {
|
|
426
|
+
name,
|
|
427
|
+
cwd: opts.cwd,
|
|
428
|
+
description: opts.description,
|
|
429
|
+
content: opts.content,
|
|
430
|
+
paths: opts.paths,
|
|
431
|
+
condition: opts.condition,
|
|
432
|
+
});
|
|
433
|
+
if (r.ok)
|
|
434
|
+
console.log(`Rule '${name}' created at: ${r.path}`);
|
|
435
|
+
else
|
|
436
|
+
console.error(`Failed: ${r.error}`);
|
|
437
|
+
});
|
|
438
|
+
// Agent teams
|
|
439
|
+
program
|
|
440
|
+
.command('session-team-list <name>')
|
|
441
|
+
.description('List teammates')
|
|
442
|
+
.action(async (name) => {
|
|
443
|
+
const r = await api('/session/team-list', 'POST', { name });
|
|
444
|
+
if (r.ok)
|
|
445
|
+
console.log(r.response || 'No team info');
|
|
446
|
+
else
|
|
447
|
+
console.error(`Failed: ${r.error}`);
|
|
448
|
+
});
|
|
449
|
+
program
|
|
450
|
+
.command('session-team-send <name> <teammate> <message>')
|
|
451
|
+
.description('Message teammate')
|
|
452
|
+
.action(async (name, teammate, message) => {
|
|
453
|
+
const r = await api('/session/team-send', 'POST', { name, teammate, message });
|
|
454
|
+
if (r.ok)
|
|
455
|
+
console.log(r.output || 'Sent');
|
|
456
|
+
else
|
|
457
|
+
console.error(`Failed: ${r.error}`);
|
|
458
|
+
});
|
|
459
|
+
program.parse();
|
|
460
|
+
//# sourceMappingURL=cli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../bin/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,SAAS,UAAU;IACjB,OAAO,OAAO,CAAC,GAAG,CAAC,mBAAmB,IAAI,wBAAwB,CAAC;AACrE,CAAC;AAED,SAAS,aAAa;IACpB,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAChD,oFAAoF;QACpF,MAAM,GAAG,GAAG,QAAQ,CAAC,oBAAoB,CAAyB,CAAC;QACnE,OAAO,GAAG,CAAC,OAAO,IAAI,OAAO,C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AAE;QAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,CAAC;;QACrC,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC;AAC3C,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base class for one-shot (process-per-send) session engines.
|
|
3
|
+
*
|
|
4
|
+
* Shared by Codex, Gemini, and Cursor — eliminates ~200 LOC of duplication
|
|
5
|
+
* per engine. Subclasses only implement _run() (engine-specific CLI invocation)
|
|
6
|
+
* and optionally override _cleanupProc() for extra cleanup (readline, streams).
|
|
7
|
+
*/
|
|
8
|
+
import { ChildProcess } from 'node:child_process';
|
|
9
|
+
import { EventEmitter } from 'node:events';
|
|
10
|
+
import { type SessionConfig, type SessionStats, type EffortLevel, type ISession, type SessionSendOptions, type TurnResult, type CostBreakdown } from './types.js';
|
|
11
|
+
/**
|
|
12
|
+
* Parameterizes engine-specific behavior without requiring method overrides.
|
|
13
|
+
* Passed to the BaseOneShotSession constructor by each subclass.
|
|
14
|
+
*/
|
|
15
|
+
export interface OneShotEngineConfig {
|
|
16
|
+
/** Prefix for session ID generation, e.g. 'codex', 'gemini', 'cursor' */
|
|
17
|
+
enginePrefix: string;
|
|
18
|
+
/** Fallback model for pricing lookups when session has no explicit model */
|
|
19
|
+
defaultModel: string;
|
|
20
|
+
/** Model name shown in getCost() output; defaults to defaultModel if omitted */
|
|
21
|
+
defaultModelDisplay?: string;
|
|
22
|
+
/** Whether this engine tracks cached token pricing (Codex=false, Gemini/Cursor=true) */
|
|
23
|
+
supportsCachedTokens: boolean;
|
|
24
|
+
/** Human-readable engine name for compact() no-op message */
|
|
25
|
+
engineDisplayName: string;
|
|
26
|
+
}
|
|
27
|
+
export declare abstract class BaseOneShotSession extends EventEmitter implements ISession {
|
|
28
|
+
protected options: SessionConfig;
|
|
29
|
+
protected engineBin: string;
|
|
30
|
+
protected engineCfg: OneShotEngineConfig;
|
|
31
|
+
private _isReady;
|
|
32
|
+
private _isPaused;
|
|
33
|
+
private _isBusy;
|
|
34
|
+
protected currentProc: ChildProcess | null;
|
|
35
|
+
private currentRequestId;
|
|
36
|
+
private _startTime;
|
|
37
|
+
private _history;
|
|
38
|
+
sessionId?: string;
|
|
39
|
+
protected _stats: {
|
|
40
|
+
turns: number;
|
|
41
|
+
toolCalls: number;
|
|
42
|
+
toolErrors: number;
|
|
43
|
+
tokensIn: number;
|
|
44
|
+
tokensOut: number;
|
|
45
|
+
cachedTokens: number;
|
|
46
|
+
costUsd: number;
|
|
47
|
+
lastActivity: string | null;
|
|
48
|
+
};
|
|
49
|
+
constructor(config: SessionConfig, bin: string, engineCfg: OneShotEngineConfig);
|
|
50
|
+
get pid(): number | undefined;
|
|
51
|
+
get isReady(): boolean;
|
|
52
|
+
get isPaused(): boolean;
|
|
53
|
+
get isBusy(): boolean;
|
|
54
|
+
start(): Promise<this>;
|
|
55
|
+
send(message: string | unknown[], options?: SessionSendOptions): Promise<TurnResult | {
|
|
56
|
+
requestId: number;
|
|
57
|
+
sent: boolean;
|
|
58
|
+
}>;
|
|
59
|
+
/** Engine-specific: spawn the CLI and return a TurnResult. */
|
|
60
|
+
protected abstract _run(message: string, options: SessionSendOptions): Promise<TurnResult>;
|
|
61
|
+
getStats(): SessionStats & {
|
|
62
|
+
sessionId?: string;
|
|
63
|
+
uptime: number;
|
|
64
|
+
};
|
|
65
|
+
getHistory(limit?: number): Array<{
|
|
66
|
+
time: string;
|
|
67
|
+
type: string;
|
|
68
|
+
event: unknown;
|
|
69
|
+
}>;
|
|
70
|
+
compact(_summary?: string): Promise<TurnResult>;
|
|
71
|
+
getEffort(): EffortLevel;
|
|
72
|
+
setEffort(level: EffortLevel): void;
|
|
73
|
+
getCost(): CostBreakdown;
|
|
74
|
+
resolveModel(alias: string): string;
|
|
75
|
+
pause(): void;
|
|
76
|
+
resume(): void;
|
|
77
|
+
stop(): void;
|
|
78
|
+
/** Override in subclasses that need extra cleanup (readline, stream destroy). */
|
|
79
|
+
protected _cleanupProc(): void;
|
|
80
|
+
protected _getModelPricing(): import("./models.js").ModelPricing;
|
|
81
|
+
protected _recordTurnComplete(): void;
|
|
82
|
+
protected _addHistory(event: {
|
|
83
|
+
text: string;
|
|
84
|
+
code: number | null;
|
|
85
|
+
}): void;
|
|
86
|
+
protected _updateCost(): void;
|
|
87
|
+
}
|