intercomm-aimfp 0.4.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/README.md +353 -0
- package/dist/claude-tui.d.ts +7 -0
- package/dist/claude-tui.d.ts.map +1 -0
- package/dist/claude-tui.js +55 -0
- package/dist/claude-tui.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +144 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +14 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +44 -0
- package/dist/config.js.map +1 -0
- package/dist/db.d.ts +9 -0
- package/dist/db.d.ts.map +1 -0
- package/dist/db.js +117 -0
- package/dist/db.js.map +1 -0
- package/dist/fs-wrapper.d.ts +3 -0
- package/dist/fs-wrapper.d.ts.map +1 -0
- package/dist/fs-wrapper.js +9 -0
- package/dist/fs-wrapper.js.map +1 -0
- package/dist/git-wrapper.d.ts +11 -0
- package/dist/git-wrapper.d.ts.map +1 -0
- package/dist/git-wrapper.js +44 -0
- package/dist/git-wrapper.js.map +1 -0
- package/dist/mcp-entry.d.ts +3 -0
- package/dist/mcp-entry.d.ts.map +1 -0
- package/dist/mcp-entry.js +8 -0
- package/dist/mcp-entry.js.map +1 -0
- package/dist/mcp-server.d.ts +2 -0
- package/dist/mcp-server.d.ts.map +1 -0
- package/dist/mcp-server.js +557 -0
- package/dist/mcp-server.js.map +1 -0
- package/dist/orchestrate.d.ts +52 -0
- package/dist/orchestrate.d.ts.map +1 -0
- package/dist/orchestrate.js +226 -0
- package/dist/orchestrate.js.map +1 -0
- package/dist/protocol.d.ts +3 -0
- package/dist/protocol.d.ts.map +1 -0
- package/dist/protocol.js +33 -0
- package/dist/protocol.js.map +1 -0
- package/dist/store.d.ts +26 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/store.js +186 -0
- package/dist/store.js.map +1 -0
- package/dist/task-contract.d.ts +4 -0
- package/dist/task-contract.d.ts.map +1 -0
- package/dist/task-contract.js +111 -0
- package/dist/task-contract.js.map +1 -0
- package/dist/tmux-wrapper.d.ts +17 -0
- package/dist/tmux-wrapper.d.ts.map +1 -0
- package/dist/tmux-wrapper.js +66 -0
- package/dist/tmux-wrapper.js.map +1 -0
- package/dist/types.d.ts +92 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +56 -0
- package/dist/types.js.map +1 -0
- package/package.json +35 -0
- package/system-prompt.md +245 -0
|
@@ -0,0 +1,557 @@
|
|
|
1
|
+
// MCP server — 19 tool handlers (register + communication + management +
|
|
2
|
+
// get_protocol + worktrees + orchestration: spawn/wake/scan/approve/teardown +
|
|
3
|
+
// assign + escalate). The coordination protocol is auto-injected via the
|
|
4
|
+
// `instructions` field at construction. Auto-init DB at server startup.
|
|
5
|
+
import { randomUUID } from "node:crypto";
|
|
6
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
7
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
8
|
+
import { z } from "zod";
|
|
9
|
+
import { dirname } from "node:path";
|
|
10
|
+
import { WORKTREE_STATUSES } from "./types.js";
|
|
11
|
+
import { buildTaskContract, parseTaskContract } from "./task-contract.js";
|
|
12
|
+
import { worktreePath, worktreesDir, rootMismatchWarning, ENV_DB_ROOT } from "./config.js";
|
|
13
|
+
import { loadProtocol } from "./protocol.js";
|
|
14
|
+
import { initDb, closeDb } from "./db.js";
|
|
15
|
+
import { ensureDir } from "./fs-wrapper.js";
|
|
16
|
+
import { addWorktree, removeWorktree } from "./git-wrapper.js";
|
|
17
|
+
import * as tmux from "./tmux-wrapper.js";
|
|
18
|
+
import * as orchestrate from "./orchestrate.js";
|
|
19
|
+
import * as store from "./store.js";
|
|
20
|
+
const createState = (root) => ({
|
|
21
|
+
identity: null,
|
|
22
|
+
root,
|
|
23
|
+
sessionId: randomUUID(),
|
|
24
|
+
});
|
|
25
|
+
// --- Result helpers ---
|
|
26
|
+
const textResult = (text) => ({
|
|
27
|
+
content: [{ type: "text", text }],
|
|
28
|
+
});
|
|
29
|
+
const errorResult = (text) => ({
|
|
30
|
+
content: [{ type: "text", text: `Error: ${text}` }],
|
|
31
|
+
isError: true,
|
|
32
|
+
});
|
|
33
|
+
const requireIdentity = (state) => {
|
|
34
|
+
if (!state.identity)
|
|
35
|
+
return errorResult("Not registered. Call intercomm_register first.");
|
|
36
|
+
// Refresh last_active AND (when tmux-backed) re-resolve our OWN pane so the stored
|
|
37
|
+
// tmux_target never goes stale — this keeps the master wakeable for worker
|
|
38
|
+
// escalations (Phase 2.5b P1-b). currentPaneTarget() returns '' off-tmux, in which
|
|
39
|
+
// case touchInstance leaves tmux_target untouched.
|
|
40
|
+
store.touchInstance(state.identity.id, tmux.currentPaneTarget());
|
|
41
|
+
return null;
|
|
42
|
+
};
|
|
43
|
+
const requireMaster = (state) => {
|
|
44
|
+
const err = requireIdentity(state);
|
|
45
|
+
if (err)
|
|
46
|
+
return err;
|
|
47
|
+
if (state.identity.role !== "master")
|
|
48
|
+
return errorResult("Master-only action.");
|
|
49
|
+
return null;
|
|
50
|
+
};
|
|
51
|
+
// --- Message type enum for zod ---
|
|
52
|
+
const SEND_TYPES = [
|
|
53
|
+
"task",
|
|
54
|
+
"status",
|
|
55
|
+
"question",
|
|
56
|
+
"answer",
|
|
57
|
+
"announce",
|
|
58
|
+
"done",
|
|
59
|
+
];
|
|
60
|
+
// claude --permission-mode values (the orchestration tools launch workers with one).
|
|
61
|
+
const PERM_MODES = [
|
|
62
|
+
"acceptEdits",
|
|
63
|
+
"auto",
|
|
64
|
+
"bypassPermissions",
|
|
65
|
+
"default",
|
|
66
|
+
"dontAsk",
|
|
67
|
+
"plan",
|
|
68
|
+
];
|
|
69
|
+
// AIMFP work-hierarchy tables a thin-pointer contract may target (mirrors AimfpTargetType).
|
|
70
|
+
const AIMFP_TARGET_TYPES = [
|
|
71
|
+
"task",
|
|
72
|
+
"milestone",
|
|
73
|
+
"subtask",
|
|
74
|
+
"sidequest",
|
|
75
|
+
"item",
|
|
76
|
+
];
|
|
77
|
+
// Prompt pushed to a worker when intercomm_assign wakes it — points it at the
|
|
78
|
+
// thin-pointer flow: read the contract, bootstrap AIMFP, continue the entity.
|
|
79
|
+
const ASSIGN_WAKE_PROMPT = "You have a new InterComm task. Call intercomm_read to get your task contract, " +
|
|
80
|
+
"then run aimfp_run(is_new_session=true) in your worktree and continue the assigned " +
|
|
81
|
+
"aimfp_target entity. Do NOT ask the user anything — report back to master via InterComm.";
|
|
82
|
+
// --- Handlers ---
|
|
83
|
+
const handleRegister = (state, args) => {
|
|
84
|
+
initDb(state.root);
|
|
85
|
+
if (state.identity) {
|
|
86
|
+
return errorResult(`Already registered as "${state.identity.id}" (${state.identity.role}). Restart to re-register.`);
|
|
87
|
+
}
|
|
88
|
+
const instance = store.registerAs(args.role, state.sessionId, tmux.currentPaneTarget());
|
|
89
|
+
state.identity = { id: instance.id, role: instance.role };
|
|
90
|
+
return textResult(`Registered as "${instance.id}" (${instance.role}). Session: ${state.sessionId.slice(0, 8)}`);
|
|
91
|
+
};
|
|
92
|
+
const handleSend = (state, args) => {
|
|
93
|
+
const err = requireIdentity(state);
|
|
94
|
+
if (err)
|
|
95
|
+
return err;
|
|
96
|
+
const recipient = store.getInstance(args.to);
|
|
97
|
+
if (!recipient)
|
|
98
|
+
return errorResult(`No instance registered with id "${args.to}"`);
|
|
99
|
+
store.insertMessage(state.identity.id, args.to, args.type, args.message);
|
|
100
|
+
return textResult(`Sent (${args.type}) to ${args.to}`);
|
|
101
|
+
};
|
|
102
|
+
const handleBroadcast = (state, args) => {
|
|
103
|
+
const err = requireIdentity(state);
|
|
104
|
+
if (err)
|
|
105
|
+
return err;
|
|
106
|
+
store.insertMessage(state.identity.id, "all", args.type, args.message);
|
|
107
|
+
return textResult(`Broadcast (${args.type}) to all`);
|
|
108
|
+
};
|
|
109
|
+
const handleRead = (state, args) => {
|
|
110
|
+
const err = requireIdentity(state);
|
|
111
|
+
if (err)
|
|
112
|
+
return err;
|
|
113
|
+
const messages = store.readNewMessages(state.identity.id, args.all);
|
|
114
|
+
if (messages.length === 0)
|
|
115
|
+
return textResult("No new messages.");
|
|
116
|
+
const lines = [
|
|
117
|
+
`--- ${messages.length} message(s) ---`,
|
|
118
|
+
...messages.map((m) => m.type === "task"
|
|
119
|
+
? `${store.formatMessageForDisplay(m)}\n${formatTaskContract(m.content)}`
|
|
120
|
+
: store.formatMessageForDisplay(m)),
|
|
121
|
+
];
|
|
122
|
+
return textResult(lines.join("\n"));
|
|
123
|
+
};
|
|
124
|
+
// Worker-side access to parseTaskContract: render a task message's contract as
|
|
125
|
+
// a validated summary (or a parse error) so the worker never has to reach into
|
|
126
|
+
// the server's source to parse it — it gets the result through intercomm_read.
|
|
127
|
+
const formatTaskContract = (content) => {
|
|
128
|
+
const parsed = parseTaskContract(content);
|
|
129
|
+
if (!parsed.ok) {
|
|
130
|
+
return ` ⚠ INVALID task contract: ${parsed.error} — send a question to master; do NOT act.`;
|
|
131
|
+
}
|
|
132
|
+
const c = parsed.contract;
|
|
133
|
+
const t = c.aimfp_target;
|
|
134
|
+
const ident = [
|
|
135
|
+
t.id != null ? `id=${t.id}` : null,
|
|
136
|
+
t.slug ? `slug=${t.slug}` : null,
|
|
137
|
+
].filter(Boolean).join(", ");
|
|
138
|
+
return [
|
|
139
|
+
` ✓ task contract (role=${c.role}):`,
|
|
140
|
+
` aimfp_target: ${t.type} (${ident})`,
|
|
141
|
+
` role_instructions: ${c.role_instructions}`,
|
|
142
|
+
` reportBack: [${c.reportBack.join(", ")}]`,
|
|
143
|
+
].join("\n");
|
|
144
|
+
};
|
|
145
|
+
const handleStatus = (state) => {
|
|
146
|
+
const instances = store.getAllInstances();
|
|
147
|
+
if (instances.length === 0)
|
|
148
|
+
return textResult("No instances registered.");
|
|
149
|
+
const myId = state.identity?.id ?? "(not registered)";
|
|
150
|
+
const lines = [
|
|
151
|
+
`You are: ${myId}`,
|
|
152
|
+
"Instances:",
|
|
153
|
+
...instances.map((inst) => store.formatInstanceForDisplay(inst, store.getWorktree(inst.id))),
|
|
154
|
+
];
|
|
155
|
+
return textResult(lines.join("\n"));
|
|
156
|
+
};
|
|
157
|
+
const handleSignoff = (state) => {
|
|
158
|
+
const err = requireIdentity(state);
|
|
159
|
+
if (err)
|
|
160
|
+
return err;
|
|
161
|
+
const id = state.identity.id;
|
|
162
|
+
store.deactivateInstance(id);
|
|
163
|
+
state.identity = null;
|
|
164
|
+
return textResult(`Signed off "${id}". Instance deactivated.`);
|
|
165
|
+
};
|
|
166
|
+
const handleClear = (state, args) => {
|
|
167
|
+
const err = requireMaster(state);
|
|
168
|
+
if (err)
|
|
169
|
+
return err;
|
|
170
|
+
const deleted = store.clearOldMessages(args.keep);
|
|
171
|
+
return textResult(`Cleared ${deleted} old messages (kept last ${args.keep}).`);
|
|
172
|
+
};
|
|
173
|
+
// Master-side access to buildTaskContract: assemble a thin-pointer contract from
|
|
174
|
+
// structured args, record it as a `task` message, and (by default) wake the
|
|
175
|
+
// worker. This is how the master assigns work without hand-authoring the JSON or
|
|
176
|
+
// reaching into the server's source — the contract shape lives behind the tool.
|
|
177
|
+
const handleAssign = async (state, args) => {
|
|
178
|
+
const err = requireMaster(state);
|
|
179
|
+
if (err)
|
|
180
|
+
return err;
|
|
181
|
+
const recipient = store.getInstance(args.worker);
|
|
182
|
+
if (!recipient)
|
|
183
|
+
return errorResult(`No instance registered with id "${args.worker}"`);
|
|
184
|
+
const slug = args.target_slug?.trim();
|
|
185
|
+
if (args.target_id == null && !slug) {
|
|
186
|
+
return errorResult("Provide target_id and/or target_slug to point at an AIMFP entity.");
|
|
187
|
+
}
|
|
188
|
+
const target = {
|
|
189
|
+
type: args.target_type,
|
|
190
|
+
...(args.target_id != null ? { id: args.target_id } : {}),
|
|
191
|
+
...(slug ? { slug } : {}),
|
|
192
|
+
};
|
|
193
|
+
const ident = [
|
|
194
|
+
args.target_id != null ? `id=${args.target_id}` : null,
|
|
195
|
+
slug ? `slug=${slug}` : null,
|
|
196
|
+
].filter(Boolean).join(", ");
|
|
197
|
+
const content = buildTaskContract({
|
|
198
|
+
role: args.role,
|
|
199
|
+
role_instructions: args.role_instructions,
|
|
200
|
+
aimfp_target: target,
|
|
201
|
+
reportBack: args.report_back,
|
|
202
|
+
});
|
|
203
|
+
store.insertMessage(state.identity.id, args.worker, "task", content);
|
|
204
|
+
if (!args.wake) {
|
|
205
|
+
return textResult(`Assigned ${args.target_type} (${ident}) to ${args.worker} — not woken; it reads the contract via intercomm_read.`);
|
|
206
|
+
}
|
|
207
|
+
const res = await orchestrate.wakeWorker(args.worker, ASSIGN_WAKE_PROMPT);
|
|
208
|
+
const wokeNote = res.resolved
|
|
209
|
+
? `woke it (${res.target})`
|
|
210
|
+
: `could NOT wake it (no live pane: ${res.target || "—"}) — contract is persisted, wake manually`;
|
|
211
|
+
return textResult(`Assigned ${args.target_type} (${ident}) to ${args.worker}; ${wokeNote}.`);
|
|
212
|
+
};
|
|
213
|
+
// --- Worktree handlers (multi-agent parallelization addon) ---
|
|
214
|
+
//
|
|
215
|
+
// InterComm's git footprint is ONLY worktree add/remove (filesystem isolation).
|
|
216
|
+
// Branch creation + merges are AIMFP directives run by the agents — never here.
|
|
217
|
+
const handleWorktreeAdd = (state, args) => {
|
|
218
|
+
const err = requireMaster(state);
|
|
219
|
+
if (err)
|
|
220
|
+
return err;
|
|
221
|
+
const base = args.base?.trim() || "main";
|
|
222
|
+
const path = args.path?.trim() || worktreePath(state.root, args.worker_id);
|
|
223
|
+
ensureDir(dirname(path));
|
|
224
|
+
const res = addWorktree(state.root, path, base);
|
|
225
|
+
if (!res.ok)
|
|
226
|
+
return errorResult(`git worktree add failed: ${res.error}`);
|
|
227
|
+
store.upsertWorktree(args.worker_id, path, base);
|
|
228
|
+
return textResult(`Worktree for ${args.worker_id} created at ${path} (detached from ${base}). ` +
|
|
229
|
+
`The worker should run AIMFP git_create_branch inside it to make its branch.`);
|
|
230
|
+
};
|
|
231
|
+
const handleWorktreeList = (state) => {
|
|
232
|
+
const err = requireIdentity(state);
|
|
233
|
+
if (err)
|
|
234
|
+
return err;
|
|
235
|
+
const worktrees = store.getAllWorktrees();
|
|
236
|
+
if (worktrees.length === 0)
|
|
237
|
+
return textResult("No worktrees registered.");
|
|
238
|
+
const lines = [
|
|
239
|
+
`--- ${worktrees.length} worktree(s) ---`,
|
|
240
|
+
...worktrees.map(store.formatWorktreeForDisplay),
|
|
241
|
+
];
|
|
242
|
+
return textResult(lines.join("\n"));
|
|
243
|
+
};
|
|
244
|
+
const handleWorktreeSetStatus = (state, args) => {
|
|
245
|
+
const err = requireMaster(state);
|
|
246
|
+
if (err)
|
|
247
|
+
return err;
|
|
248
|
+
if (!store.getWorktree(args.worker_id)) {
|
|
249
|
+
return errorResult(`No worktree registered for "${args.worker_id}"`);
|
|
250
|
+
}
|
|
251
|
+
store.setWorktreeStatus(args.worker_id, args.status, args.branch?.trim());
|
|
252
|
+
const branchNote = args.branch?.trim() ? `, branch=${args.branch.trim()}` : "";
|
|
253
|
+
return textResult(`Worktree ${args.worker_id} → ${args.status}${branchNote}`);
|
|
254
|
+
};
|
|
255
|
+
const handleWorktreeRemove = (state, args) => {
|
|
256
|
+
const err = requireMaster(state);
|
|
257
|
+
if (err)
|
|
258
|
+
return err;
|
|
259
|
+
const wt = store.getWorktree(args.worker_id);
|
|
260
|
+
if (!wt)
|
|
261
|
+
return errorResult(`No worktree registered for "${args.worker_id}"`);
|
|
262
|
+
const res = removeWorktree(state.root, wt.path, args.force);
|
|
263
|
+
if (!res.ok) {
|
|
264
|
+
return errorResult(`git worktree remove failed: ${res.error} (retry with force=true if it has changes)`);
|
|
265
|
+
}
|
|
266
|
+
store.markWorktreeRemoved(args.worker_id);
|
|
267
|
+
return textResult(`Worktree ${args.worker_id} removed (${wt.path}).`);
|
|
268
|
+
};
|
|
269
|
+
// --- Orchestration handlers (the tool-driven multi-agent lifecycle) ---
|
|
270
|
+
//
|
|
271
|
+
// Thin: each parses args, calls an orchestrate sequence, and formats the report.
|
|
272
|
+
// All master-only. They retire spawn/scan/kill-workers.sh as runtime dependencies.
|
|
273
|
+
const handleSpawn = async (state, args) => {
|
|
274
|
+
const err = requireMaster(state);
|
|
275
|
+
if (err)
|
|
276
|
+
return err;
|
|
277
|
+
if (args.count < 1)
|
|
278
|
+
return errorResult("count must be >= 1");
|
|
279
|
+
const reports = await orchestrate.spawnWorkers({
|
|
280
|
+
root: state.root,
|
|
281
|
+
count: args.count,
|
|
282
|
+
prefix: args.prefix,
|
|
283
|
+
permMode: args.perm_mode,
|
|
284
|
+
claudeCmd: args.claude_cmd,
|
|
285
|
+
worktrees: args.worktrees,
|
|
286
|
+
worktreeBase: args.worktree_base,
|
|
287
|
+
bootstrap: args.bootstrap?.trim() ?? "",
|
|
288
|
+
readyTimeoutMs: args.ready_timeout * 1000,
|
|
289
|
+
wake: args.wake,
|
|
290
|
+
});
|
|
291
|
+
const lines = reports.map((r) => `session=${r.session} state=${r.state} ready=${r.ready ? "yes" : "no"} woken=${r.woken ? "yes" : "no"} worktree=${r.worktree || "-"}`);
|
|
292
|
+
// Nested-root guard: if the bus root was NOT explicitly pinned and differs from the
|
|
293
|
+
// launch cwd, this project may be nested inside another git repo and the worktrees
|
|
294
|
+
// could be of the wrong repo (Run-1 bug). Surface a warning before the master proceeds.
|
|
295
|
+
const pinned = process.env[ENV_DB_ROOT]?.trim();
|
|
296
|
+
const warning = pinned ? null : rootMismatchWarning(state.root, process.cwd());
|
|
297
|
+
return textResult([
|
|
298
|
+
...(warning ? [warning, ""] : []),
|
|
299
|
+
`Spawned ${reports.length} worker(s) — bus root: ${state.root}${args.worktrees ? `, worktrees under: ${worktreesDir(state.root)}` : ""}`,
|
|
300
|
+
...lines,
|
|
301
|
+
"Workers self-register asynchronously — call intercomm_status to confirm the session<->id<->worktree mapping. Use intercomm_scan/intercomm_approve for any pane left on a dialog.",
|
|
302
|
+
].join("\n"));
|
|
303
|
+
};
|
|
304
|
+
const handleWake = async (state, args) => {
|
|
305
|
+
const err = requireMaster(state);
|
|
306
|
+
if (err)
|
|
307
|
+
return err;
|
|
308
|
+
const res = await orchestrate.wakeWorker(args.worker, args.message);
|
|
309
|
+
if (!res.resolved) {
|
|
310
|
+
return errorResult(`No live tmux pane for "${args.worker}" (resolved target: ${res.target || "—"}).`);
|
|
311
|
+
}
|
|
312
|
+
return textResult(`Woke ${args.worker} (${res.target}).`);
|
|
313
|
+
};
|
|
314
|
+
// Worker -> master no-poll escalation (Phase 2.5b, Option B): the server persists
|
|
315
|
+
// the question to the bus AND does the tmux wake on the worker's behalf — the worker
|
|
316
|
+
// never touches tmux, so role enforcement stays intact. The DB write is the source of
|
|
317
|
+
// truth; the wake is best-effort, so a busy / off-tmux / stale master still recovers
|
|
318
|
+
// the escalation on its next intercomm_read. Returns a structured {persisted, woke, reason?}.
|
|
319
|
+
const handleEscalate = async (state, args) => {
|
|
320
|
+
const err = requireIdentity(state);
|
|
321
|
+
if (err)
|
|
322
|
+
return err;
|
|
323
|
+
if (state.identity.role === "master") {
|
|
324
|
+
return errorResult("intercomm_escalate is a worker->master tool; the master coordinates with the user directly.");
|
|
325
|
+
}
|
|
326
|
+
const fromId = state.identity.id;
|
|
327
|
+
// Persist FIRST (source of truth). kind + needs_user are encoded in the content so
|
|
328
|
+
// the record is self-describing even if the wake is missed entirely (P1-a).
|
|
329
|
+
const tag = `[escalation kind=${args.kind}${args.needs_user ? " needs_user" : ""}]`;
|
|
330
|
+
store.insertMessage(fromId, "master", "question", `${tag} ${args.message}`);
|
|
331
|
+
const report = (woke, reason) => textResult(`${woke ? "Escalation persisted and master woken." : "Escalation persisted (master not woken — it will see the question on its next intercomm_read)."}\n` +
|
|
332
|
+
`{"persisted": true, "woke": ${woke}${reason ? `, "reason": "${reason}"` : ""}}`);
|
|
333
|
+
// Degradation (never fail): no live master, or a master that is not in tmux, falls
|
|
334
|
+
// back to message-only. getActiveMaster already excludes stale (>30s) masters.
|
|
335
|
+
const master = store.getActiveMaster();
|
|
336
|
+
if (!master)
|
|
337
|
+
return report(false, "no active (non-stale) master registered");
|
|
338
|
+
if (!master.tmuxTarget)
|
|
339
|
+
return report(false, "master not in tmux (message-only)");
|
|
340
|
+
// Best-effort wake — wakeWorker verifies the pane still resolves (P1-d). A definitive
|
|
341
|
+
// non-resolve downgrades the master to message-only by clearing its target (P1-b).
|
|
342
|
+
const wake = await orchestrate.wakeWorker("master", orchestrate.escalationWakeText(fromId, args.kind, args.needs_user, args.message));
|
|
343
|
+
if (!wake.woke) {
|
|
344
|
+
if (!wake.resolved)
|
|
345
|
+
store.setInstanceTmuxTarget("master", "");
|
|
346
|
+
return report(false, wake.resolved ? "wake send failed" : "master pane no longer resolves (downgraded to message-only)");
|
|
347
|
+
}
|
|
348
|
+
return report(true);
|
|
349
|
+
};
|
|
350
|
+
const handleScan = (state, args) => {
|
|
351
|
+
const err = requireMaster(state);
|
|
352
|
+
if (err)
|
|
353
|
+
return err;
|
|
354
|
+
const reports = orchestrate.scanWorkers(args.prefix);
|
|
355
|
+
if (reports.length === 0)
|
|
356
|
+
return textResult(`No worker sessions found (prefix: ${args.prefix}-).`);
|
|
357
|
+
const lines = reports.map((r) => `session=${r.session} state=${r.state}${r.needsAttention ? " <- needs intercomm_approve" : ""}`);
|
|
358
|
+
const blocked = reports.filter((r) => r.needsAttention).length;
|
|
359
|
+
return textResult([
|
|
360
|
+
`--- ${reports.length} worker pane(s) ---`,
|
|
361
|
+
...lines,
|
|
362
|
+
`${blocked} of ${reports.length} need attention.`,
|
|
363
|
+
].join("\n"));
|
|
364
|
+
};
|
|
365
|
+
const handleApprove = async (state, args) => {
|
|
366
|
+
const err = requireMaster(state);
|
|
367
|
+
if (err)
|
|
368
|
+
return err;
|
|
369
|
+
const r = await orchestrate.approveWorker(args.worker, args.timeout * 1000);
|
|
370
|
+
if (!r.resolved) {
|
|
371
|
+
return errorResult(`No live tmux pane for "${args.worker}" (target: ${r.target || "—"}).`);
|
|
372
|
+
}
|
|
373
|
+
const note = r.cleared
|
|
374
|
+
? " (cleared)"
|
|
375
|
+
: r.before === "ready" || r.before === "running" || r.before === "idle"
|
|
376
|
+
? " (nothing to clear)"
|
|
377
|
+
: " (still blocked — retry, or inspect the pane)";
|
|
378
|
+
return textResult(`Approve ${args.worker}: ${r.before} -> ${r.after}${note}`);
|
|
379
|
+
};
|
|
380
|
+
const handleTeardown = (state, args) => {
|
|
381
|
+
const err = requireMaster(state);
|
|
382
|
+
if (err)
|
|
383
|
+
return err;
|
|
384
|
+
const r = orchestrate.teardownWorkers(state.root, args.prefix, args.worktrees);
|
|
385
|
+
return textResult([
|
|
386
|
+
`Torn down ${r.killed.length} session(s): ${r.killed.join(", ") || "(none)"}`,
|
|
387
|
+
`Worktrees removed: ${r.worktreesRemoved.join(", ") || "(none)"}`,
|
|
388
|
+
`Instance rows reaped: ${r.reaped.join(", ") || "(none)"}`,
|
|
389
|
+
].join("\n"));
|
|
390
|
+
};
|
|
391
|
+
// --- Tool registration ---
|
|
392
|
+
const registerTools = (server, state) => {
|
|
393
|
+
server.registerTool("intercomm_register", {
|
|
394
|
+
description: "Register this instance as master or worker. Initializes DB if needed. Master deactivates all existing instances. Worker auto-assigns lowest available worker-N name. Default role: worker.",
|
|
395
|
+
inputSchema: {
|
|
396
|
+
role: z.enum(["master", "worker"]).default("worker").describe("Role to register as (default: worker)"),
|
|
397
|
+
},
|
|
398
|
+
}, (args) => handleRegister(state, args));
|
|
399
|
+
server.registerTool("intercomm_send", {
|
|
400
|
+
description: "Send a direct message to a specific peer.",
|
|
401
|
+
inputSchema: {
|
|
402
|
+
to: z.string().describe("Recipient peer id"),
|
|
403
|
+
message: z.string().describe("Message content"),
|
|
404
|
+
type: z.enum(SEND_TYPES).default("status").describe("Message type"),
|
|
405
|
+
},
|
|
406
|
+
}, (args) => handleSend(state, args));
|
|
407
|
+
server.registerTool("intercomm_broadcast", {
|
|
408
|
+
description: "Broadcast a message to all registered peers.",
|
|
409
|
+
inputSchema: {
|
|
410
|
+
message: z.string().describe("Message content"),
|
|
411
|
+
type: z.enum(SEND_TYPES).default("announce").describe("Message type"),
|
|
412
|
+
},
|
|
413
|
+
}, (args) => handleBroadcast(state, args));
|
|
414
|
+
server.registerTool("intercomm_read", {
|
|
415
|
+
description: "Read ALL new messages since last check (any type). Updates read cursor.",
|
|
416
|
+
inputSchema: {
|
|
417
|
+
all: z.boolean().default(false).describe("Re-read all messages from the beginning"),
|
|
418
|
+
},
|
|
419
|
+
}, (args) => handleRead(state, args));
|
|
420
|
+
server.registerTool("intercomm_status", {
|
|
421
|
+
description: "Show all instances: id, role, active, last_active.",
|
|
422
|
+
}, () => handleStatus(state));
|
|
423
|
+
server.registerTool("intercomm_signoff", {
|
|
424
|
+
description: "Cleanly deactivate this instance and sign off. Use before shutting down.",
|
|
425
|
+
}, () => handleSignoff(state));
|
|
426
|
+
server.registerTool("intercomm_get_protocol", {
|
|
427
|
+
description: "Re-read the full InterComm master/worker coordination protocol on demand. The same text is auto-injected as the server's MCP instructions on connect; use this to refresh it after a long session / context compaction. No registration required.",
|
|
428
|
+
}, () => textResult(loadProtocol()));
|
|
429
|
+
server.registerTool("intercomm_clear", {
|
|
430
|
+
description: "Delete messages older than threshold. Master-only.",
|
|
431
|
+
inputSchema: {
|
|
432
|
+
keep: z.number().int().min(0).default(100).describe("Number of recent messages to retain (default: 100)"),
|
|
433
|
+
},
|
|
434
|
+
}, (args) => handleClear(state, args));
|
|
435
|
+
server.registerTool("intercomm_assign", {
|
|
436
|
+
description: "Master-only. Assign work to a worker as a thin-pointer task contract: build {role, role_instructions, aimfp_target, reportBack} from these args, record it as a `task` message, and (by default) wake the worker. The worker reads it via intercomm_read, then runs aimfp_run in its worktree and continues the referenced AIMFP entity. Provide target_id and/or target_slug. InterComm never resolves the pointer — AIMFP does, worker-side.",
|
|
437
|
+
inputSchema: {
|
|
438
|
+
worker: z.string().describe("Worker id to assign (e.g. worker-1)"),
|
|
439
|
+
role: z.string().default("worker").describe("Worker role label (default: worker)"),
|
|
440
|
+
role_instructions: z.string().min(1).describe("Role guidance / hard boundaries for this worker (e.g. assigned files, a distinct AIMFP user identity so aimfp-{user}-{number} branches don't collide)"),
|
|
441
|
+
target_type: z.enum(AIMFP_TARGET_TYPES).describe("AIMFP entity table the worker continues"),
|
|
442
|
+
target_id: z.number().int().optional().describe("AIMFP entity integer id (provide this and/or target_slug)"),
|
|
443
|
+
target_slug: z.string().optional().describe("AIMFP entity stable slug (provide this and/or target_id)"),
|
|
444
|
+
report_back: z.array(z.string()).default(["branch", "commit"]).describe("Fields the worker must report on done (default: branch, commit)"),
|
|
445
|
+
wake: z.boolean().default(true).describe("Wake the worker after recording the contract (default: true)"),
|
|
446
|
+
},
|
|
447
|
+
}, (args) => handleAssign(state, args));
|
|
448
|
+
// --- Worktree / orchestration tools (multi-agent addon) ---
|
|
449
|
+
server.registerTool("intercomm_worktree_add", {
|
|
450
|
+
description: "Master-only. Create an isolated git worktree (detached HEAD) for a worker and register it. InterComm only isolates files — the worker runs AIMFP git_create_branch inside the worktree to make its branch.",
|
|
451
|
+
inputSchema: {
|
|
452
|
+
worker_id: z.string().describe("Worker id this worktree belongs to (e.g. worker-1)"),
|
|
453
|
+
base: z.string().default("main").describe("Git ref to check out detached (default: main)"),
|
|
454
|
+
path: z.string().optional().describe("Worktree path (default: sibling .intercomm-worktrees/<worker_id>)"),
|
|
455
|
+
},
|
|
456
|
+
}, (args) => handleWorktreeAdd(state, args));
|
|
457
|
+
server.registerTool("intercomm_worktree_list", {
|
|
458
|
+
description: "List all registered worktrees and their lifecycle status (the master's merge-queue view).",
|
|
459
|
+
}, () => handleWorktreeList(state));
|
|
460
|
+
server.registerTool("intercomm_worktree_set_status", {
|
|
461
|
+
description: "Master-only. Update a worktree's lifecycle status, optionally recording the branch the worker reported back.",
|
|
462
|
+
inputSchema: {
|
|
463
|
+
worker_id: z.string().describe("Worker id whose worktree to update"),
|
|
464
|
+
status: z.enum(WORKTREE_STATUSES).describe("New lifecycle status"),
|
|
465
|
+
branch: z.string().optional().describe("Branch the worker reported (e.g. aimfp-worker-1-001); leave empty to keep current"),
|
|
466
|
+
},
|
|
467
|
+
}, (args) => handleWorktreeSetStatus(state, args));
|
|
468
|
+
server.registerTool("intercomm_worktree_remove", {
|
|
469
|
+
description: "Master-only. Remove a worker's git worktree and mark it removed in the registry.",
|
|
470
|
+
inputSchema: {
|
|
471
|
+
worker_id: z.string().describe("Worker id whose worktree to remove"),
|
|
472
|
+
force: z.boolean().default(false).describe("Pass --force to git worktree remove (drops uncommitted changes)"),
|
|
473
|
+
},
|
|
474
|
+
}, (args) => handleWorktreeRemove(state, args));
|
|
475
|
+
// --- Orchestration tools (tool-driven lifecycle; retire the shell scripts) ---
|
|
476
|
+
server.registerTool("intercomm_spawn", {
|
|
477
|
+
description: "Master-only. Spawn N Claude Code workers in detached tmux sessions (retires spawn-workers.sh). Non-blocking: creates sessions, launches claude with INTERCOMM_DB_ROOT pinned to the shared DB, optionally one git worktree per worker, auto-clears first-run dialogs, and wakes each to self-register. Returns session ids; workers register asynchronously (does NOT wait on registration).",
|
|
478
|
+
inputSchema: {
|
|
479
|
+
count: z.number().int().min(1).describe("Number of workers to spawn"),
|
|
480
|
+
prefix: z.string().default("worker").describe("tmux session-name prefix (default: worker)"),
|
|
481
|
+
perm_mode: z.enum(PERM_MODES).default("acceptEdits").describe("claude --permission-mode (default: acceptEdits)"),
|
|
482
|
+
claude_cmd: z.string().default("claude").describe("Claude binary to launch (default: claude)"),
|
|
483
|
+
worktrees: z.boolean().default(false).describe("Launch each worker in its own isolated git worktree (branch-per-agent)"),
|
|
484
|
+
worktree_base: z.string().default("main").describe("Git ref each worktree checks out detached (default: main)"),
|
|
485
|
+
bootstrap: z.string().optional().describe("Setup command run inside each new worktree (e.g. 'npm install')"),
|
|
486
|
+
ready_timeout: z.number().int().min(1).default(20).describe("Per-session seconds to clear boot dialogs before giving up (default: 20)"),
|
|
487
|
+
wake: z.boolean().default(true).describe("Push the register prompt after each worker boots (default: true)"),
|
|
488
|
+
},
|
|
489
|
+
}, (args) => handleSpawn(state, args));
|
|
490
|
+
server.registerTool("intercomm_wake", {
|
|
491
|
+
description: "Master-only. Push a prompt into a worker's tmux pane (retires manual `tmux send-keys`). Accepts a worker id (resolved via its stored tmux_target) or a raw tmux target. The no-poll way to hand a worker its next task.",
|
|
492
|
+
inputSchema: {
|
|
493
|
+
worker: z.string().describe("Worker id (e.g. worker-1) or raw tmux target (session:window.pane)"),
|
|
494
|
+
message: z.string().describe("Prompt text to type and submit in the worker's Claude TUI"),
|
|
495
|
+
},
|
|
496
|
+
}, (args) => handleWake(state, args));
|
|
497
|
+
server.registerTool("intercomm_escalate", {
|
|
498
|
+
description: "Worker->master no-poll escalation. Raise a question or decision to the master WITHOUT polling: the server persists it as a `question` on the bus AND wakes the master in its tmux pane on your behalf (you never touch tmux). The DB write is the source of truth and the wake is best-effort — a busy, off-tmux, or stale master still sees it on its next intercomm_read. Set needs_user when the master must confer with the human before answering. Returns {persisted, woke, reason?}.",
|
|
499
|
+
inputSchema: {
|
|
500
|
+
message: z.string().min(1).describe("Your question, or the decision/approval you need from the master"),
|
|
501
|
+
kind: z.enum(["question", "decision"]).default("question").describe("question = you need info/an answer; decision = you need the master to choose or approve a course of action"),
|
|
502
|
+
needs_user: z.boolean().default(false).describe("True if the master must confer with the human user before answering (e.g. scope or policy calls)"),
|
|
503
|
+
},
|
|
504
|
+
}, (args) => handleEscalate(state, args));
|
|
505
|
+
server.registerTool("intercomm_scan", {
|
|
506
|
+
description: "Master-only. Report each worker pane's state (retires scan-workers.sh): trust/mcp_approval/bypass/blocked/ready/running/idle. Surfaces workers frozen on a permission dialog (which cannot report over the bus).",
|
|
507
|
+
inputSchema: {
|
|
508
|
+
prefix: z.string().default("worker").describe("tmux session-name prefix to scan (default: worker)"),
|
|
509
|
+
},
|
|
510
|
+
}, (args) => handleScan(state, args));
|
|
511
|
+
server.registerTool("intercomm_approve", {
|
|
512
|
+
description: "Master-only. Clear a worker's blocking dialog (retires manual `tmux send-keys '1' Enter`): trust, MCP-approval, bypass warning, or a tool permission prompt. Reports the before/after pane state.",
|
|
513
|
+
inputSchema: {
|
|
514
|
+
worker: z.string().describe("Worker id or raw tmux target to approve"),
|
|
515
|
+
timeout: z.number().int().min(1).default(5).describe("Seconds to keep clearing dialogs (default: 5)"),
|
|
516
|
+
},
|
|
517
|
+
}, (args) => handleApprove(state, args));
|
|
518
|
+
server.registerTool("intercomm_teardown", {
|
|
519
|
+
description: "Master-only. Tear down all workers in one shot (retires kill-workers.sh + the raw SQL reap): kill the tmux sessions, remove their git worktrees (worktree mode), and REAP the instance rows so a stale active=1 cannot drift the next worker's number.",
|
|
520
|
+
inputSchema: {
|
|
521
|
+
prefix: z.string().default("worker").describe("tmux session-name prefix to tear down (default: worker)"),
|
|
522
|
+
worktrees: z.boolean().default(false).describe("Also git worktree remove --force each worker's worktree"),
|
|
523
|
+
},
|
|
524
|
+
}, (args) => handleTeardown(state, args));
|
|
525
|
+
};
|
|
526
|
+
// --- Factory (the only place with `new`) ---
|
|
527
|
+
export const createAndRunServer = async (root) => {
|
|
528
|
+
const state = createState(root);
|
|
529
|
+
// Auto-init DB at startup
|
|
530
|
+
initDb(root);
|
|
531
|
+
// The master/worker coordination protocol is delivered to every connected
|
|
532
|
+
// instance automatically via the `instructions` field (the same mechanism
|
|
533
|
+
// AIMFP uses for its rules) — no per-project CLAUDE.md embedding or paste.
|
|
534
|
+
const server = new McpServer({
|
|
535
|
+
name: "intercomm-aimfp",
|
|
536
|
+
version: "0.4.0",
|
|
537
|
+
}, {
|
|
538
|
+
instructions: loadProtocol(),
|
|
539
|
+
});
|
|
540
|
+
registerTools(server, state);
|
|
541
|
+
// Cleanup on exit
|
|
542
|
+
const cleanup = () => {
|
|
543
|
+
if (state.identity) {
|
|
544
|
+
try {
|
|
545
|
+
store.deactivateInstance(state.identity.id);
|
|
546
|
+
}
|
|
547
|
+
catch { /* best effort */ }
|
|
548
|
+
}
|
|
549
|
+
closeDb();
|
|
550
|
+
};
|
|
551
|
+
process.on("exit", cleanup);
|
|
552
|
+
process.on("SIGINT", () => { cleanup(); process.exit(0); });
|
|
553
|
+
process.on("SIGTERM", () => { cleanup(); process.exit(0); });
|
|
554
|
+
const transport = new StdioServerTransport();
|
|
555
|
+
await server.connect(transport);
|
|
556
|
+
};
|
|
557
|
+
//# sourceMappingURL=mcp-server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-server.js","sourceRoot":"","sources":["../src/mcp-server.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,+EAA+E;AAC/E,yEAAyE;AACzE,wEAAwE;AAExE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AASpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC3F,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,KAAK,IAAI,MAAM,mBAAmB,CAAC;AAC1C,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAC;AAChD,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AAUpC,MAAM,WA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+
import { type PaneState } from "./claude-tui.js";
|
|
2
|
+
export type SpawnOptions = {
|
|
3
|
+
readonly root: string;
|
|
4
|
+
readonly count: number;
|
|
5
|
+
readonly prefix: string;
|
|
6
|
+
readonly permMode: string;
|
|
7
|
+
readonly claudeCmd: string;
|
|
8
|
+
readonly worktrees: boolean;
|
|
9
|
+
readonly worktreeBase: string;
|
|
10
|
+
readonly bootstrap: string;
|
|
11
|
+
readonly readyTimeoutMs: number;
|
|
12
|
+
readonly wake: boolean;
|
|
13
|
+
};
|
|
14
|
+
export type SpawnReport = {
|
|
15
|
+
readonly session: string;
|
|
16
|
+
readonly state: PaneState;
|
|
17
|
+
readonly ready: boolean;
|
|
18
|
+
readonly woken: boolean;
|
|
19
|
+
readonly worktree: string;
|
|
20
|
+
};
|
|
21
|
+
export type ScanReport = {
|
|
22
|
+
readonly session: string;
|
|
23
|
+
readonly state: PaneState;
|
|
24
|
+
readonly needsAttention: boolean;
|
|
25
|
+
};
|
|
26
|
+
export type ApproveReport = {
|
|
27
|
+
readonly target: string;
|
|
28
|
+
readonly resolved: boolean;
|
|
29
|
+
readonly before: PaneState;
|
|
30
|
+
readonly after: PaneState;
|
|
31
|
+
readonly cleared: boolean;
|
|
32
|
+
};
|
|
33
|
+
export type TeardownReport = {
|
|
34
|
+
readonly killed: readonly string[];
|
|
35
|
+
readonly worktreesRemoved: readonly string[];
|
|
36
|
+
readonly reaped: readonly string[];
|
|
37
|
+
};
|
|
38
|
+
export declare const pickSessionNames: (prefix: string, count: number) => string[];
|
|
39
|
+
export declare const wakePromptText: (session: string, worktrees: boolean) => string;
|
|
40
|
+
export declare const escalationWakeText: (fromId: string, kind: "question" | "decision", needsUser: boolean, message: string) => string;
|
|
41
|
+
export declare const resolveTarget: (idOrTarget: string) => string;
|
|
42
|
+
export declare const clearDialogs: (target: string, deadlineMs: number) => Promise<PaneState>;
|
|
43
|
+
export declare const spawnWorkers: (opts: SpawnOptions) => Promise<SpawnReport[]>;
|
|
44
|
+
export declare const wakeWorker: (idOrTarget: string, message: string) => Promise<{
|
|
45
|
+
resolved: boolean;
|
|
46
|
+
woke: boolean;
|
|
47
|
+
target: string;
|
|
48
|
+
}>;
|
|
49
|
+
export declare const scanWorkers: (prefix: string) => ScanReport[];
|
|
50
|
+
export declare const approveWorker: (idOrTarget: string, deadlineMs: number) => Promise<ApproveReport>;
|
|
51
|
+
export declare const teardownWorkers: (root: string, prefix: string, worktrees: boolean) => TeardownReport;
|
|
52
|
+
//# sourceMappingURL=orchestrate.d.ts.map
|