reevesagents 1.4.0 → 1.6.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/CHANGELOG.md +29 -0
- package/README.md +21 -6
- package/dist/chunk-7YW57CWK.js +55 -0
- package/dist/chunk-ICFJOMFZ.js +66 -0
- package/dist/{chunk-BELIYZTN.js → chunk-J2DD52HJ.js} +271 -2
- package/dist/chunk-JDJW3WST.js +136 -0
- package/dist/{chunk-33EB4RUP.js → chunk-S4JLBMK4.js} +2 -2
- package/dist/{chunk-KL5YFLQF.js → chunk-T7SPF4ZP.js} +272 -26
- package/dist/{chunk-EX5LH2KW.js → chunk-VYLFTVIQ.js} +2 -148
- package/dist/{chunk-NJWOKVBZ.js → chunk-WDJ6RTES.js} +2 -2
- package/dist/cli.js +167 -17
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -2
- package/dist/{router-MGXDADKM.js → router-L5IRXRCH.js} +315 -208
- package/dist/{server-KHY23W6D.js → server-AP4NN6RT.js} +118 -29
- package/dist/{server-L5DTU6U2.js → server-Y5EO5QYV.js} +19 -20
- package/dist/{tui-launch-2UWK76V3.js → tui-launch-AGR3JF4I.js} +2 -2
- package/dist/web/app.css +10 -0
- package/dist/web/app.js +57 -3
- package/dist/web/index.html +19 -0
- package/package.json +4 -2
- package/skills/reevesagents/SKILL.md +64 -0
- package/dist/chunk-PEOJCUQI.js +0 -29
|
@@ -1,27 +1,35 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
installSkills,
|
|
4
|
+
skillsStatus
|
|
5
|
+
} from "./chunk-JDJW3WST.js";
|
|
6
|
+
import {
|
|
7
|
+
sweepAgents,
|
|
8
|
+
sweepAgentsThrottled
|
|
9
|
+
} from "./chunk-7YW57CWK.js";
|
|
2
10
|
import {
|
|
3
11
|
REEVESAGENTS_VERSION,
|
|
4
|
-
attach,
|
|
5
|
-
attachAll,
|
|
6
12
|
createRunApproval,
|
|
7
|
-
detach,
|
|
8
|
-
hostStatus,
|
|
9
13
|
listRunApprovals,
|
|
10
14
|
readRunApproval,
|
|
11
15
|
resolveRunApproval
|
|
12
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-VYLFTVIQ.js";
|
|
13
17
|
import {
|
|
14
18
|
ALLOWED_KEYS,
|
|
15
19
|
BIN,
|
|
16
20
|
CONFIG_FIELDS,
|
|
17
21
|
PROVIDER_DEFS,
|
|
18
22
|
archiveAndRemoveRun,
|
|
23
|
+
attach,
|
|
24
|
+
attachAll,
|
|
19
25
|
coerceExtraArgs,
|
|
20
26
|
deleteAgent,
|
|
21
27
|
deletePreset,
|
|
22
28
|
deleteRunHistory,
|
|
29
|
+
detach,
|
|
23
30
|
detectAvailable,
|
|
24
31
|
findAgent,
|
|
32
|
+
hostStatus,
|
|
25
33
|
interrupt,
|
|
26
34
|
isProvider,
|
|
27
35
|
killAgent,
|
|
@@ -43,7 +51,7 @@ import {
|
|
|
43
51
|
startRunFromPreset,
|
|
44
52
|
startRunWithHead,
|
|
45
53
|
stopRun
|
|
46
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-T7SPF4ZP.js";
|
|
47
55
|
import "./chunk-D24DQQ6V.js";
|
|
48
56
|
|
|
49
57
|
// src/mcp/server.ts
|
|
@@ -311,7 +319,10 @@ var TOOLS = [
|
|
|
311
319
|
name: "list",
|
|
312
320
|
description: "List every live run and the agents in each, with their ids, status, provider, and tmux info. Start here to find a run_id or agent_id for the other tools. Ended runs are in list_history.",
|
|
313
321
|
inputSchema: { type: "object", properties: {} },
|
|
314
|
-
handler: () =>
|
|
322
|
+
handler: () => {
|
|
323
|
+
sweepAgentsThrottled();
|
|
324
|
+
return ok(listRuns().map((run) => ({ ...run, agents: listAgents(run.id) })));
|
|
325
|
+
}
|
|
315
326
|
},
|
|
316
327
|
{
|
|
317
328
|
name: "list_providers",
|
|
@@ -458,15 +469,21 @@ var TOOLS = [
|
|
|
458
469
|
inputSchema: { type: "object", properties: {} },
|
|
459
470
|
handler: () => ok(runDoctor().checks)
|
|
460
471
|
},
|
|
472
|
+
{
|
|
473
|
+
name: "reap",
|
|
474
|
+
description: "Sweep for zombie agents and end them: any whose tmux window has died, plus any older than max_lifetime_ms when that is set above 0 (see get_config). Returns each reaped agent with the reason (window-gone or lifetime-exceeded) and its age. This runs on its own in the background; call it to force an immediate sweep, e.g. after a crash or before relying on list.",
|
|
475
|
+
inputSchema: { type: "object", properties: {} },
|
|
476
|
+
handler: () => ok(sweepAgents())
|
|
477
|
+
},
|
|
461
478
|
{
|
|
462
479
|
name: "get_config",
|
|
463
|
-
description: "Read the global reevesagents settings: peek_interval_ms, peek_lines, max_depth, max_agents (the per-run agent cap), ready_delay_ms, default_permissions, and language. Check max_agents here when a spawn is rejected for hitting the cap.",
|
|
480
|
+
description: "Read the global reevesagents settings: peek_interval_ms, peek_lines, max_depth, max_agents (the per-run agent cap), ready_delay_ms, max_lifetime_ms (auto-reap agents older than this; 0 disables), default_permissions, and language. Check max_agents here when a spawn is rejected for hitting the cap.",
|
|
464
481
|
inputSchema: { type: "object", properties: {} },
|
|
465
482
|
handler: () => ok(loadConfig().global)
|
|
466
483
|
},
|
|
467
484
|
{
|
|
468
485
|
name: "set_config",
|
|
469
|
-
description: 'Change one or more global settings and save them. Pass only the fields to change. Counts must be positive integers (ready_delay_ms may be 0); default_permissions is ask or skip; language is a supported code such as en or tr. Example: raise the per-run agent cap with { "max_agents": 20 }. Returns the saved settings.',
|
|
486
|
+
description: 'Change one or more global settings and save them. Pass only the fields to change. Counts must be positive integers (ready_delay_ms and max_lifetime_ms may be 0); default_permissions is ask or skip; language is a supported code such as en or tr. Example: raise the per-run agent cap with { "max_agents": 20 }, or auto-kill agents running longer than an hour with { "max_lifetime_ms": 3600000 }. Returns the saved settings.',
|
|
470
487
|
inputSchema: {
|
|
471
488
|
type: "object",
|
|
472
489
|
properties: {
|
|
@@ -475,6 +492,7 @@ var TOOLS = [
|
|
|
475
492
|
max_depth: { type: "number", description: "Spawn recursion cap." },
|
|
476
493
|
max_agents: { type: "number", description: "Max agents per run." },
|
|
477
494
|
ready_delay_ms: { type: "number", description: "Delay before the startup prompt is injected." },
|
|
495
|
+
max_lifetime_ms: { type: "number", description: "Auto-reap any agent older than this many ms on the next sweep. 0 disables lifetime reaping." },
|
|
478
496
|
default_permissions: { type: "string", enum: ["ask", "skip"], description: "Permission mode used when a spawn omits one." },
|
|
479
497
|
language: { type: "string", description: "UI language code for the TUI and web UI, e.g. en, tr." }
|
|
480
498
|
}
|
|
@@ -572,6 +590,17 @@ var TOOLS = [
|
|
|
572
590
|
required: ["key"]
|
|
573
591
|
},
|
|
574
592
|
handler: (a) => ok(detach(asString(a.key)))
|
|
593
|
+
},
|
|
594
|
+
{
|
|
595
|
+
name: "install_skills",
|
|
596
|
+
description: "Install the reevesagents Agent Skill so skill-aware CLIs (Claude Code, Codex, Kimi, OpenCode) learn to drive reevesagents on their own. Writes one SKILL.md to the two shared skill directories under the home dir. Pass no arguments; call with status omitted to install, or read the returned rows to see where it landed. The user must restart their CLIs to pick it up.",
|
|
597
|
+
inputSchema: {
|
|
598
|
+
type: "object",
|
|
599
|
+
properties: {
|
|
600
|
+
status: { type: "boolean", description: "When true, only report where the skill is installed without writing anything." }
|
|
601
|
+
}
|
|
602
|
+
},
|
|
603
|
+
handler: (a) => ok(a.status === true ? skillsStatus() : installSkills())
|
|
575
604
|
}
|
|
576
605
|
];
|
|
577
606
|
var MCP_TOOLS = TOOLS.map(({ name, description, inputSchema }) => ({ name, description, inputSchema }));
|
|
@@ -585,43 +614,103 @@ function handleAgentMcpTool(name, a) {
|
|
|
585
614
|
return fail(e instanceof Error ? e.message : String(e));
|
|
586
615
|
}
|
|
587
616
|
}
|
|
617
|
+
var GUIDE_URI = "reevesagents://guide";
|
|
618
|
+
var MCP_INSTRUCTIONS = `reevesagents lets you, from this session, run and steer other AI coding CLIs (Claude Code, Codex, Kimi, Qwen, OpenCode, Hermes, and more), each in its own tmux window. Delegate slices of work to other models, then poll or redirect them. reevesagents never proxies model traffic; each CLI uses its own login.
|
|
619
|
+
|
|
620
|
+
Drive loop:
|
|
621
|
+
1. list_providers - the CLIs installed here and their models. Spawn only these.
|
|
622
|
+
2. spawn { provider, task } - start an agent; returns agent_id and run_id. Omit run_id to keep agents in one run (a team); pass run_id to add to an existing run. Set permissions:"skip" for an autonomous worker when no human is there to approve its prompts.
|
|
623
|
+
3. read { agent_id } - the agent's recent output. spawn is fire-and-forget: it returns ids, not answers, so poll read until the agent replies or its output settles. A freshly spawned agent may sit at a login or trust prompt; read first to check.
|
|
624
|
+
4. send_text { agent_id, text } then send_key { agent_id, key: "enter" } - type a message, then submit it. send_text alone does NOT submit.
|
|
625
|
+
5. kill { agent_id } or stop { run_id } when done.
|
|
626
|
+
|
|
627
|
+
Team in one call sequence: spawn several providers with run_id omitted and one task each, then poll read on each agent_id. Every id comes from spawn or list. Full worked example: read the reevesagents://guide resource.`;
|
|
628
|
+
var GUIDE_TEXT = `# reevesagents: drive a team of AI CLIs
|
|
629
|
+
|
|
630
|
+
You can spawn and steer other coding CLIs from here. Each agent is a real CLI in its own tmux window on this machine. reevesagents never proxies model traffic or stores credentials; each CLI uses its own login.
|
|
631
|
+
|
|
632
|
+
## Worked example: hand a task to Codex, then steer it
|
|
633
|
+
1. list_providers confirm "codex" is installed here
|
|
634
|
+
2. spawn { "provider": "codex", "task": "summarize README.md" }
|
|
635
|
+
returns { "agent_id": "ab12...", "run_id": "cd34..." }
|
|
636
|
+
3. read { "agent_id": "ab12..." } poll until it answers (spawn is fire-and-forget)
|
|
637
|
+
4. send_text { "agent_id": "ab12...", "text": "now write tests for it" }
|
|
638
|
+
send_key { "agent_id": "ab12...", "key": "enter" } send_text alone does NOT submit
|
|
639
|
+
5. kill { "agent_id": "ab12..." } stop it when finished
|
|
640
|
+
|
|
641
|
+
## Spawn a team
|
|
642
|
+
Spawn several agents with run_id omitted so they land in one run, then poll each:
|
|
643
|
+
spawn { "provider": "cc", "task": "lead: coordinate the others", "permissions": "skip" }
|
|
644
|
+
spawn { "provider": "codex", "task": "worker: the API slice", "permissions": "skip" }
|
|
645
|
+
spawn { "provider": "kimi", "task": "worker: the docs" }
|
|
646
|
+
Then read each agent_id, and send_text + send_key enter to redirect any of them.
|
|
647
|
+
|
|
648
|
+
## Notes
|
|
649
|
+
- send_text types but does not submit; always follow it with send_key enter.
|
|
650
|
+
- Omit run_id on spawn to add agents to the run you started; pass run_id to target a specific run.
|
|
651
|
+
- permissions:"skip" runs a worker autonomously (no per-action approval); use it when no human will sit and approve.
|
|
652
|
+
- A freshly spawned agent may sit at a login or trust screen; read its output before sending work.
|
|
653
|
+
- list shows every run and agent; read shows recent output (20 lines by default).
|
|
654
|
+
- Spawned agents are plain CLIs and cannot spawn others unless you attach this MCP to them too.`;
|
|
655
|
+
function listMcpResources() {
|
|
656
|
+
return [
|
|
657
|
+
{
|
|
658
|
+
uri: PROVIDER_CATALOG_URI,
|
|
659
|
+
name: "Providers and models",
|
|
660
|
+
description: "CLI providers this machine can launch and their known models.",
|
|
661
|
+
mimeType: "application/json"
|
|
662
|
+
},
|
|
663
|
+
{
|
|
664
|
+
uri: GUIDE_URI,
|
|
665
|
+
name: "Getting started",
|
|
666
|
+
description: "What reevesagents is and a worked example of driving an agent.",
|
|
667
|
+
mimeType: "text/markdown"
|
|
668
|
+
}
|
|
669
|
+
];
|
|
670
|
+
}
|
|
671
|
+
function readMcpResource(uri) {
|
|
672
|
+
if (uri === PROVIDER_CATALOG_URI) {
|
|
673
|
+
return { uri, mimeType: "application/json", text: JSON.stringify(buildProviderCatalog()) };
|
|
674
|
+
}
|
|
675
|
+
if (uri === GUIDE_URI) {
|
|
676
|
+
return { uri, mimeType: "text/markdown", text: GUIDE_TEXT };
|
|
677
|
+
}
|
|
678
|
+
throw new Error(`Unknown resource: ${uri}`);
|
|
679
|
+
}
|
|
680
|
+
var BACKGROUND_REAP_INTERVAL_MS = 3e4;
|
|
588
681
|
async function startAgentMcpServer() {
|
|
589
682
|
const server = new Server(
|
|
590
683
|
{ name: "reevesagents", version: REEVESAGENTS_VERSION },
|
|
591
|
-
{ capabilities: { tools: {}, resources: {} } }
|
|
684
|
+
{ capabilities: { tools: {}, resources: {} }, instructions: MCP_INSTRUCTIONS }
|
|
592
685
|
);
|
|
686
|
+
const reapTimer = setInterval(() => {
|
|
687
|
+
try {
|
|
688
|
+
sweepAgents();
|
|
689
|
+
} catch {
|
|
690
|
+
}
|
|
691
|
+
}, BACKGROUND_REAP_INTERVAL_MS);
|
|
692
|
+
reapTimer.unref();
|
|
593
693
|
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: MCP_TOOLS }));
|
|
594
694
|
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
595
695
|
const { name, arguments: args = {} } = request.params;
|
|
596
696
|
return handleAgentMcpTool(name, args);
|
|
597
697
|
});
|
|
598
|
-
server.setRequestHandler(ListResourcesRequestSchema, async () => ({
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
uri: PROVIDER_CATALOG_URI,
|
|
602
|
-
name: "Providers and models",
|
|
603
|
-
description: "CLI providers this machine can launch and their known models.",
|
|
604
|
-
mimeType: "application/json"
|
|
605
|
-
}
|
|
606
|
-
]
|
|
698
|
+
server.setRequestHandler(ListResourcesRequestSchema, async () => ({ resources: listMcpResources() }));
|
|
699
|
+
server.setRequestHandler(ReadResourceRequestSchema, async (request) => ({
|
|
700
|
+
contents: [readMcpResource(request.params.uri)]
|
|
607
701
|
}));
|
|
608
|
-
server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
|
|
609
|
-
const { uri } = request.params;
|
|
610
|
-
if (uri !== PROVIDER_CATALOG_URI) throw new Error(`Unknown resource: ${uri}`);
|
|
611
|
-
return {
|
|
612
|
-
contents: [
|
|
613
|
-
{ uri, mimeType: "application/json", text: JSON.stringify(buildProviderCatalog()) }
|
|
614
|
-
]
|
|
615
|
-
};
|
|
616
|
-
});
|
|
617
702
|
const transport = new StdioServerTransport();
|
|
618
703
|
await server.connect(transport);
|
|
619
704
|
}
|
|
620
705
|
export {
|
|
706
|
+
GUIDE_TEXT,
|
|
707
|
+
MCP_INSTRUCTIONS,
|
|
621
708
|
MCP_TOOLS,
|
|
622
709
|
buildProviderCatalog,
|
|
623
710
|
handleAgentMcpTool,
|
|
711
|
+
listMcpResources,
|
|
712
|
+
readMcpResource,
|
|
624
713
|
sessionRunIsLive,
|
|
625
714
|
startAgentMcpServer
|
|
626
715
|
};
|
|
627
|
-
//# sourceMappingURL=server-
|
|
716
|
+
//# sourceMappingURL=server-AP4NN6RT.js.map
|
|
@@ -2,32 +2,32 @@
|
|
|
2
2
|
import {
|
|
3
3
|
localeCatalog,
|
|
4
4
|
translatePhrase
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-J2DD52HJ.js";
|
|
6
6
|
import {
|
|
7
7
|
modelValuesForProvider
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-WDJ6RTES.js";
|
|
9
9
|
import {
|
|
10
10
|
REEVESAGENTS_VERSION,
|
|
11
|
-
attach,
|
|
12
|
-
attachAll,
|
|
13
|
-
detach,
|
|
14
|
-
hostStatus,
|
|
15
11
|
listRunApprovals,
|
|
16
12
|
resolveRunApproval
|
|
17
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-VYLFTVIQ.js";
|
|
18
14
|
import {
|
|
19
15
|
CONFIG_FIELDS,
|
|
20
16
|
LANGUAGE_OPTIONS,
|
|
21
17
|
PROVIDERS,
|
|
22
18
|
archiveAndRemoveRun,
|
|
19
|
+
attach,
|
|
20
|
+
attachAll,
|
|
23
21
|
autoCleanupRuns,
|
|
24
22
|
coerceExtraArgs,
|
|
25
23
|
computeRunStatus,
|
|
26
24
|
deleteAgent,
|
|
27
25
|
deletePreset,
|
|
28
26
|
deleteRunHistory,
|
|
27
|
+
detach,
|
|
29
28
|
detectAvailable,
|
|
30
29
|
findAgent,
|
|
30
|
+
hostStatus,
|
|
31
31
|
isLanguageCode,
|
|
32
32
|
killAgent,
|
|
33
33
|
listAgents,
|
|
@@ -48,8 +48,9 @@ import {
|
|
|
48
48
|
spawnWorker,
|
|
49
49
|
startRun,
|
|
50
50
|
startRunFromPreset,
|
|
51
|
-
stopRun
|
|
52
|
-
|
|
51
|
+
stopRun,
|
|
52
|
+
verifyServerLaunch
|
|
53
|
+
} from "./chunk-T7SPF4ZP.js";
|
|
53
54
|
import "./chunk-D24DQQ6V.js";
|
|
54
55
|
|
|
55
56
|
// src/web/server.ts
|
|
@@ -585,12 +586,8 @@ function sanitizeNickname(raw) {
|
|
|
585
586
|
function sanitizeRunName(raw) {
|
|
586
587
|
return raw.trim().replace(/[^\p{L}\p{N} _.-]/gu, " ").replace(/\s+/g, " ").trim().slice(0, 80).trim();
|
|
587
588
|
}
|
|
588
|
-
function normalizeModel(
|
|
589
|
-
|
|
590
|
-
if (!modelValuesForProvider(provider).includes(model)) {
|
|
591
|
-
throw new Error("unknown model for provider");
|
|
592
|
-
}
|
|
593
|
-
return model;
|
|
589
|
+
function normalizeModel(raw) {
|
|
590
|
+
return typeof raw === "string" ? raw.trim() : "";
|
|
594
591
|
}
|
|
595
592
|
function normalizePermissionsInput(raw) {
|
|
596
593
|
if (raw === void 0 || raw === null || raw === "") return void 0;
|
|
@@ -611,7 +608,7 @@ async function createTerminal(body) {
|
|
|
611
608
|
const provider = body.provider;
|
|
612
609
|
const normalizedProvider = normalizeProvider(provider);
|
|
613
610
|
if (!normalizedProvider) throw new Error("unknown provider");
|
|
614
|
-
const model = normalizeModel(
|
|
611
|
+
const model = normalizeModel(body.model);
|
|
615
612
|
const permissions = normalizePermissionsInput(body.permissions);
|
|
616
613
|
const auth_mode = parseAuthModeInput(body.auth_mode);
|
|
617
614
|
const effort = parseEffortInput(body.effort);
|
|
@@ -658,8 +655,10 @@ function detachMcpHostAction(body) {
|
|
|
658
655
|
const result = detach(key);
|
|
659
656
|
return { result, hosts: hostStatus() };
|
|
660
657
|
}
|
|
661
|
-
function attachAllMcpHostsAction() {
|
|
662
|
-
|
|
658
|
+
async function attachAllMcpHostsAction() {
|
|
659
|
+
const results = attachAll();
|
|
660
|
+
const verify = await verifyServerLaunch();
|
|
661
|
+
return { results, hosts: hostStatus(), verify };
|
|
663
662
|
}
|
|
664
663
|
function configPayload() {
|
|
665
664
|
const config = loadConfig().global;
|
|
@@ -830,7 +829,7 @@ async function handleRequest(req, res, ctx) {
|
|
|
830
829
|
}
|
|
831
830
|
if (method === "POST" && path === "/api/mcp-hosts/attach-all") {
|
|
832
831
|
try {
|
|
833
|
-
sendJson(res, 200, attachAllMcpHostsAction());
|
|
832
|
+
sendJson(res, 200, await attachAllMcpHostsAction());
|
|
834
833
|
} catch (err) {
|
|
835
834
|
sendJson(res, 400, { error: errMessage(err) });
|
|
836
835
|
}
|
|
@@ -1017,4 +1016,4 @@ async function startWebServer(options = {}) {
|
|
|
1017
1016
|
export {
|
|
1018
1017
|
startWebServer
|
|
1019
1018
|
};
|
|
1020
|
-
//# sourceMappingURL=server-
|
|
1019
|
+
//# sourceMappingURL=server-Y5EO5QYV.js.map
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import {
|
|
3
3
|
closeTuiWebServer,
|
|
4
4
|
startWebFromTui
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-S4JLBMK4.js";
|
|
6
6
|
export {
|
|
7
7
|
closeTuiWebServer,
|
|
8
8
|
startWebFromTui
|
|
9
9
|
};
|
|
10
|
-
//# sourceMappingURL=tui-launch-
|
|
10
|
+
//# sourceMappingURL=tui-launch-AGR3JF4I.js.map
|
package/dist/web/app.css
CHANGED
|
@@ -1722,6 +1722,16 @@ button { letter-spacing: 0; }
|
|
|
1722
1722
|
line-height: 1.4;
|
|
1723
1723
|
}
|
|
1724
1724
|
|
|
1725
|
+
.dialog-notice {
|
|
1726
|
+
border: 1px solid color-mix(in srgb, var(--ok) 42%, var(--border));
|
|
1727
|
+
border-radius: var(--r-2);
|
|
1728
|
+
padding: var(--s-2) var(--s-3);
|
|
1729
|
+
color: var(--ok);
|
|
1730
|
+
background: color-mix(in srgb, var(--ok) 11%, var(--panel));
|
|
1731
|
+
font-size: var(--fs-sm);
|
|
1732
|
+
line-height: 1.4;
|
|
1733
|
+
}
|
|
1734
|
+
|
|
1725
1735
|
.dialog-actions {
|
|
1726
1736
|
display: flex;
|
|
1727
1737
|
justify-content: flex-end;
|
package/dist/web/app.js
CHANGED
|
@@ -105,6 +105,7 @@
|
|
|
105
105
|
'web.stopAgentError': 'Could not stop agent: {{message}}',
|
|
106
106
|
'web.stopRunConfirm': 'Stop run "{{name}}"? Every agent in it will be stopped.',
|
|
107
107
|
'web.stopRunError': 'Could not stop run: {{message}}',
|
|
108
|
+
'web.deletePresetConfirm': 'Delete preset "{{name}}"?',
|
|
108
109
|
'web.deleteRunConfirm': 'Delete stopped run "{{name}}"? A simple history record will be kept.',
|
|
109
110
|
'web.deleteRunError': 'Could not delete stopped run: {{message}}',
|
|
110
111
|
'web.deleteAgentConfirm': 'Delete stopped agent "{{name}}"? This removes the saved agent record.',
|
|
@@ -244,6 +245,7 @@
|
|
|
244
245
|
mcpHostList: document.getElementById('mcp-host-list'),
|
|
245
246
|
mcpEmpty: document.getElementById('mcp-empty'),
|
|
246
247
|
mcpError: document.getElementById('mcp-error'),
|
|
248
|
+
mcpNotice: document.getElementById('mcp-notice'),
|
|
247
249
|
mcpAttachAll: document.getElementById('mcp-attach-all'),
|
|
248
250
|
mcpClose: document.getElementById('mcp-close'),
|
|
249
251
|
doctorBtn: document.getElementById('doctor-btn'),
|
|
@@ -256,6 +258,14 @@
|
|
|
256
258
|
aboutDialog: document.getElementById('about-dialog'),
|
|
257
259
|
aboutList: document.getElementById('about-list'),
|
|
258
260
|
aboutClose: document.getElementById('about-close'),
|
|
261
|
+
welcomeDialog: document.getElementById('welcome-dialog'),
|
|
262
|
+
welcomeTitle: document.getElementById('welcome-title'),
|
|
263
|
+
welcomeSubtitle: document.getElementById('welcome-subtitle'),
|
|
264
|
+
welcomeIntro: document.getElementById('welcome-intro'),
|
|
265
|
+
welcomeDoorRun: document.getElementById('welcome-door-run'),
|
|
266
|
+
welcomeDoorConnect: document.getElementById('welcome-door-connect'),
|
|
267
|
+
welcomeConnect: document.getElementById('welcome-connect'),
|
|
268
|
+
welcomeClose: document.getElementById('welcome-close'),
|
|
259
269
|
configBtn: document.getElementById('config-btn'),
|
|
260
270
|
configDialog: document.getElementById('config-dialog'),
|
|
261
271
|
configList: document.getElementById('config-list'),
|
|
@@ -279,6 +289,7 @@
|
|
|
279
289
|
let language = 'en'
|
|
280
290
|
let languages = []
|
|
281
291
|
let messages = WEB_EN
|
|
292
|
+
let welcomeChecked = false
|
|
282
293
|
let selectedId = null
|
|
283
294
|
let session = null // { id, ws, term, fit, observer }
|
|
284
295
|
let createContext = { kind: 'run', runId: '' }
|
|
@@ -330,6 +341,7 @@
|
|
|
330
341
|
renderSidebar()
|
|
331
342
|
reconcileCreateDialog()
|
|
332
343
|
reconcileSelectedAgent()
|
|
344
|
+
if (!welcomeChecked) { welcomeChecked = true; maybeShowWelcome() }
|
|
333
345
|
}
|
|
334
346
|
|
|
335
347
|
function subscribe() {
|
|
@@ -403,6 +415,13 @@
|
|
|
403
415
|
el.presetsBtn.textContent = t('web.presets')
|
|
404
416
|
el.doctorBtn.textContent = t('web.doctor')
|
|
405
417
|
el.aboutBtn.textContent = t('web.about')
|
|
418
|
+
el.welcomeTitle.textContent = t('setup.title')
|
|
419
|
+
el.welcomeSubtitle.textContent = t('setup.subtitle')
|
|
420
|
+
el.welcomeIntro.textContent = t('setup.intro')
|
|
421
|
+
el.welcomeDoorRun.textContent = `${t('setup.startRun')} (${t('setup.startRunHint')})`
|
|
422
|
+
el.welcomeDoorConnect.textContent = `${t('setup.connectAll')} (${t('setup.connectAllHint')})`
|
|
423
|
+
el.welcomeConnect.textContent = t('web.agentControl')
|
|
424
|
+
el.welcomeClose.textContent = t('setup.done')
|
|
406
425
|
el.mcpDialogTitle.textContent = t('web.mcpTitle')
|
|
407
426
|
el.mcpDialogSubtitle.textContent = t('web.mcpSubtitle')
|
|
408
427
|
el.mcpEmpty.textContent = t('web.mcpEmpty')
|
|
@@ -1656,8 +1675,23 @@
|
|
|
1656
1675
|
}
|
|
1657
1676
|
}
|
|
1658
1677
|
|
|
1678
|
+
// Show a one-time getting-started popup on a browser's first visit. The flag
|
|
1679
|
+
// lives in localStorage, so it never nags after the first dismissal.
|
|
1680
|
+
function maybeShowWelcome() {
|
|
1681
|
+
let seen
|
|
1682
|
+
try {
|
|
1683
|
+
seen = window.localStorage.getItem('reeves.welcomed') === '1'
|
|
1684
|
+
} catch {
|
|
1685
|
+
return
|
|
1686
|
+
}
|
|
1687
|
+
if (seen) return
|
|
1688
|
+
try { window.localStorage.setItem('reeves.welcomed', '1') } catch { /* private mode: skip persistence */ }
|
|
1689
|
+
el.welcomeDialog.showModal()
|
|
1690
|
+
}
|
|
1691
|
+
|
|
1659
1692
|
function openMcpDialog() {
|
|
1660
1693
|
setMcpError(null)
|
|
1694
|
+
setMcpNotice(null)
|
|
1661
1695
|
mcpHosts = []
|
|
1662
1696
|
mcpLoading = true
|
|
1663
1697
|
mcpLoadFailed = false
|
|
@@ -1773,6 +1807,12 @@
|
|
|
1773
1807
|
el.mcpError.hidden = false
|
|
1774
1808
|
}
|
|
1775
1809
|
|
|
1810
|
+
function setMcpNotice(message) {
|
|
1811
|
+
if (!message) { el.mcpNotice.hidden = true; el.mcpNotice.textContent = ''; return }
|
|
1812
|
+
el.mcpNotice.textContent = message
|
|
1813
|
+
el.mcpNotice.hidden = false
|
|
1814
|
+
}
|
|
1815
|
+
|
|
1776
1816
|
function applyMcpResult(data) {
|
|
1777
1817
|
if (data && Array.isArray(data.hosts)) {
|
|
1778
1818
|
mcpLoadFailed = false
|
|
@@ -1785,12 +1825,15 @@
|
|
|
1785
1825
|
if (mcpBusy || mcpLoading) return
|
|
1786
1826
|
mcpBusy = true
|
|
1787
1827
|
setMcpError(null)
|
|
1828
|
+
setMcpNotice(null)
|
|
1788
1829
|
renderMcpHosts()
|
|
1789
1830
|
try {
|
|
1790
1831
|
const data = await api('POST', '/api/mcp-hosts/attach', { key: host.key })
|
|
1791
1832
|
applyMcpResult(data)
|
|
1792
1833
|
if (data && data.result && data.result.ok === false) {
|
|
1793
1834
|
setMcpError(t('web.mcpAttachError', { name: host.label, message: data.result.message }))
|
|
1835
|
+
} else {
|
|
1836
|
+
setMcpNotice(t('web.mcpRestartHint', { names: host.label }))
|
|
1794
1837
|
}
|
|
1795
1838
|
} catch (err) {
|
|
1796
1839
|
setMcpError(t('web.mcpAttachError', { name: host.label, message: err.message }))
|
|
@@ -1823,12 +1866,21 @@
|
|
|
1823
1866
|
if (mcpBusy || mcpLoading || mcpLoadFailed) return
|
|
1824
1867
|
mcpBusy = true
|
|
1825
1868
|
setMcpError(null)
|
|
1869
|
+
setMcpNotice(null)
|
|
1826
1870
|
renderMcpHosts()
|
|
1827
1871
|
try {
|
|
1828
1872
|
const data = await api('POST', '/api/mcp-hosts/attach-all', {})
|
|
1829
1873
|
applyMcpResult(data)
|
|
1830
|
-
const
|
|
1831
|
-
|
|
1874
|
+
const results = (data && data.results) || []
|
|
1875
|
+
const failed = results.filter(r => !r.ok)
|
|
1876
|
+
const okNames = results.filter(r => r.ok).map(r => r.label || r.key)
|
|
1877
|
+
if (data && data.verify && data.verify.ok === false) {
|
|
1878
|
+
setMcpError(t('web.mcpVerifyFailed', { detail: data.verify.detail }))
|
|
1879
|
+
} else if (failed.length > 0) {
|
|
1880
|
+
setMcpError(t('web.mcpAttachAllError', { message: failed.map(r => r.message).join('; ') }))
|
|
1881
|
+
} else if (okNames.length > 0) {
|
|
1882
|
+
setMcpNotice(t('web.mcpRestartHint', { names: okNames.join(', ') }))
|
|
1883
|
+
}
|
|
1832
1884
|
} catch (err) {
|
|
1833
1885
|
setMcpError(t('web.mcpAttachAllError', { message: err.message }))
|
|
1834
1886
|
} finally {
|
|
@@ -1984,7 +2036,7 @@
|
|
|
1984
2036
|
}
|
|
1985
2037
|
|
|
1986
2038
|
async function deletePreset(name) {
|
|
1987
|
-
if (!confirm(
|
|
2039
|
+
if (!confirm(t('web.deletePresetConfirm', { name }))) return
|
|
1988
2040
|
el.presetsError.hidden = true
|
|
1989
2041
|
try {
|
|
1990
2042
|
await api('POST', `/api/presets/${encodeURIComponent(name)}/delete`, { confirm: true })
|
|
@@ -2026,6 +2078,8 @@
|
|
|
2026
2078
|
el.doctorClose.addEventListener('click', () => el.doctorDialog.close())
|
|
2027
2079
|
el.aboutBtn.addEventListener('click', openAboutDialog)
|
|
2028
2080
|
el.aboutClose.addEventListener('click', () => el.aboutDialog.close())
|
|
2081
|
+
el.welcomeConnect.addEventListener('click', () => { el.welcomeDialog.close(); openMcpDialog() })
|
|
2082
|
+
el.welcomeClose.addEventListener('click', () => el.welcomeDialog.close())
|
|
2029
2083
|
el.configBtn.addEventListener('click', openConfigDialog)
|
|
2030
2084
|
el.configSave.addEventListener('click', saveConfig)
|
|
2031
2085
|
el.configClose.addEventListener('click', () => el.configDialog.close())
|
package/dist/web/index.html
CHANGED
|
@@ -204,6 +204,7 @@
|
|
|
204
204
|
<div id="mcp-host-list" class="mcp-host-list" aria-label="MCP host CLIs"></div>
|
|
205
205
|
<div id="mcp-empty" class="mcp-empty" hidden>No MCP-capable CLI was found on this machine.</div>
|
|
206
206
|
<div id="mcp-error" class="dialog-error" hidden></div>
|
|
207
|
+
<div id="mcp-notice" class="dialog-notice" hidden></div>
|
|
207
208
|
|
|
208
209
|
<div class="dialog-actions">
|
|
209
210
|
<button type="button" id="mcp-attach-all" class="btn btn-agent">Attach all</button>
|
|
@@ -242,6 +243,24 @@
|
|
|
242
243
|
</div>
|
|
243
244
|
</dialog>
|
|
244
245
|
|
|
246
|
+
<dialog id="welcome-dialog" class="dialog mcp-dialog">
|
|
247
|
+
<div class="mcp-panel">
|
|
248
|
+
<div class="dialog-header">
|
|
249
|
+
<div id="welcome-title" class="dialog-title">Get started</div>
|
|
250
|
+
<div id="welcome-subtitle" class="dialog-subtitle">Set up reevesagents and connect your CLIs.</div>
|
|
251
|
+
</div>
|
|
252
|
+
<div class="about-list">
|
|
253
|
+
<div id="welcome-intro"></div>
|
|
254
|
+
<div id="welcome-door-run"></div>
|
|
255
|
+
<div id="welcome-door-connect"></div>
|
|
256
|
+
</div>
|
|
257
|
+
<div class="dialog-actions">
|
|
258
|
+
<button type="button" id="welcome-connect" class="btn btn-accent">Agent control</button>
|
|
259
|
+
<button type="button" id="welcome-close" class="btn">Continue</button>
|
|
260
|
+
</div>
|
|
261
|
+
</div>
|
|
262
|
+
</dialog>
|
|
263
|
+
|
|
245
264
|
<dialog id="config-dialog" class="dialog mcp-dialog">
|
|
246
265
|
<div class="mcp-panel">
|
|
247
266
|
<div class="dialog-header">
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reevesagents",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "Local tmux-first workspace manager for AI CLI agents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"packageManager": "pnpm@10.34.1",
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
"files": [
|
|
15
15
|
"dist",
|
|
16
16
|
"!dist/**/*.map",
|
|
17
|
+
"skills",
|
|
17
18
|
"AGENTS.md",
|
|
18
19
|
"CHANGELOG.md",
|
|
19
20
|
"LICENSE"
|
|
@@ -31,7 +32,8 @@
|
|
|
31
32
|
"render-mascot": "node scripts/render-mascot.mjs",
|
|
32
33
|
"verify": "pnpm typecheck && pnpm lint && pnpm test && pnpm build && pnpm smoke:cli && pnpm check:package",
|
|
33
34
|
"verify:release": "pnpm verify && pnpm check:install-matrix",
|
|
34
|
-
"release": "release-it"
|
|
35
|
+
"release": "release-it",
|
|
36
|
+
"postinstall": "node -e \"try{process.env.npm_config_global==='true'&&process.stdout.isTTY&&!process.env.CI&&process.stdout.write('\\nReevesAgents installed. Run: reevesagents attach to connect your AI CLIs, then restart them.\\n\\n')}catch(e){}\""
|
|
35
37
|
},
|
|
36
38
|
"dependencies": {
|
|
37
39
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: reevesagents
|
|
3
|
+
description: Drive a team of other AI coding CLIs from the current session through the reevesagents MCP server. Use when the user asks to delegate work to another model, run several agents in parallel, or orchestrate a multi-agent team: spawn Claude Code, Codex, Kimi, Qwen, OpenCode and other installed CLIs each in its own tmux window, send them prompts, read their output, and stop or reap them. Assumes the reevesagents MCP server is attached to this CLI (run: reevesagents attach).
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# reevesagents: drive a team of AI CLIs
|
|
7
|
+
|
|
8
|
+
reevesagents lets you, from this session, run and steer other AI coding CLIs. Each
|
|
9
|
+
agent is a real CLI in its own tmux window on this machine. reevesagents never
|
|
10
|
+
proxies model traffic; every CLI uses its own login.
|
|
11
|
+
|
|
12
|
+
The tools below come from the reevesagents MCP server. Depending on this host they
|
|
13
|
+
may appear as bare names (`spawn`), as `mcp__reevesagents__spawn` (Claude Code,
|
|
14
|
+
Kimi), or as `reevesagents_spawn` (OpenCode). Use whichever form your tool list
|
|
15
|
+
shows; the bare names are used here.
|
|
16
|
+
|
|
17
|
+
## When to use
|
|
18
|
+
- The user wants to hand a slice of work to another model and keep working.
|
|
19
|
+
- Several independent tasks can run in parallel across different CLIs.
|
|
20
|
+
- The user asks for a team (a lead plus workers) or to orchestrate multiple agents.
|
|
21
|
+
|
|
22
|
+
## Drive loop
|
|
23
|
+
1. list_providers - the CLIs installed here and their models. Spawn only these.
|
|
24
|
+
2. spawn { provider, task } - start an agent; returns agent_id and run_id. Omit
|
|
25
|
+
run_id to keep agents in one run (a team); pass run_id to add to an existing run.
|
|
26
|
+
Set permissions:"skip" for an autonomous worker when no human will approve prompts.
|
|
27
|
+
3. read { agent_id } - the agent's recent output. spawn is fire-and-forget: it
|
|
28
|
+
returns ids, not answers, so poll read until the agent replies or its output
|
|
29
|
+
settles. A fresh agent may sit at a login or trust prompt; read first.
|
|
30
|
+
4. send_text { agent_id, text } then send_key { agent_id, key: "enter" } - type a
|
|
31
|
+
message, then submit it. send_text alone does NOT submit.
|
|
32
|
+
5. kill { agent_id } or stop { run_id } when done.
|
|
33
|
+
|
|
34
|
+
## Worked example: hand a task to Codex, then steer it
|
|
35
|
+
1. list_providers confirm "codex" is installed
|
|
36
|
+
2. spawn { "provider": "codex", "task": "summarize README.md" } -> { agent_id, run_id }
|
|
37
|
+
3. read { "agent_id": "..." } poll until it answers
|
|
38
|
+
4. send_text { "agent_id": "...", "text": "now write tests for it" }
|
|
39
|
+
send_key { "agent_id": "...", "key": "enter" }
|
|
40
|
+
5. kill { "agent_id": "..." } stop it when finished
|
|
41
|
+
|
|
42
|
+
## Spawn a team
|
|
43
|
+
Spawn several agents with run_id omitted so they land in one run, then poll each:
|
|
44
|
+
spawn { "provider": "cc", "task": "lead: coordinate the others", "permissions": "skip" }
|
|
45
|
+
spawn { "provider": "codex", "task": "worker: the API slice", "permissions": "skip" }
|
|
46
|
+
spawn { "provider": "kimi", "task": "worker: the docs" }
|
|
47
|
+
|
|
48
|
+
## Housekeeping
|
|
49
|
+
- list shows every live run and agent; list_history shows ended ones.
|
|
50
|
+
- reap ends zombie agents: any whose tmux window died, plus any older than
|
|
51
|
+
max_lifetime_ms. reevesagents also reaps in the background, but call reap to force
|
|
52
|
+
an immediate sweep.
|
|
53
|
+
- get_config / set_config read and change global settings, including the per-run
|
|
54
|
+
agent cap (max_agents) and the auto-reap age (max_lifetime_ms; 0 disables it).
|
|
55
|
+
- request_approval / resolve_approval gate a risky action behind a human or another
|
|
56
|
+
agent before it runs.
|
|
57
|
+
|
|
58
|
+
## Notes
|
|
59
|
+
- send_text types but does not submit; always follow it with send_key enter.
|
|
60
|
+
- permissions:"skip" runs a worker autonomously; use it when no human will approve.
|
|
61
|
+
- Spawned agents are plain CLIs and cannot spawn others unless reevesagents is also
|
|
62
|
+
attached to them.
|
|
63
|
+
- If a spawn is rejected because a run is at the agent cap, raise max_agents with
|
|
64
|
+
set_config.
|
package/dist/chunk-PEOJCUQI.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
stateRoot
|
|
4
|
-
} from "./chunk-KL5YFLQF.js";
|
|
5
|
-
|
|
6
|
-
// src/core/tui-open.ts
|
|
7
|
-
import { mkdirSync, readFileSync, writeFileSync } from "fs";
|
|
8
|
-
import { join } from "path";
|
|
9
|
-
function tokenPath() {
|
|
10
|
-
return join(stateRoot(), "tui-open-token");
|
|
11
|
-
}
|
|
12
|
-
function readTuiOpenToken() {
|
|
13
|
-
try {
|
|
14
|
-
return readFileSync(tokenPath(), "utf-8").trim();
|
|
15
|
-
} catch {
|
|
16
|
-
return "";
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
function writeTuiOpenToken() {
|
|
20
|
-
mkdirSync(stateRoot(), { recursive: true });
|
|
21
|
-
writeFileSync(tokenPath(), `${Date.now()}
|
|
22
|
-
`, "utf-8");
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export {
|
|
26
|
-
readTuiOpenToken,
|
|
27
|
-
writeTuiOpenToken
|
|
28
|
-
};
|
|
29
|
-
//# sourceMappingURL=chunk-PEOJCUQI.js.map
|