@cello-protocol/cli 0.0.44 → 0.0.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/arg-parse.d.ts +20 -0
- package/dist/arg-parse.d.ts.map +1 -0
- package/dist/arg-parse.js +30 -0
- package/dist/arg-parse.js.map +1 -0
- package/dist/bin/cello.d.ts +8 -5
- package/dist/bin/cello.d.ts.map +1 -1
- package/dist/bin/cello.js +42 -197
- package/dist/bin/cello.js.map +1 -1
- package/dist/cli-args.d.ts +27 -19
- package/dist/cli-args.d.ts.map +1 -1
- package/dist/cli-args.js +47 -102
- package/dist/cli-args.js.map +1 -1
- package/dist/json-out.d.ts +41 -0
- package/dist/json-out.d.ts.map +1 -0
- package/dist/json-out.js +60 -0
- package/dist/json-out.js.map +1 -0
- package/dist/parity-commands.d.ts +161 -0
- package/dist/parity-commands.d.ts.map +1 -0
- package/dist/parity-commands.js +317 -0
- package/dist/parity-commands.js.map +1 -0
- package/dist/registry.d.ts +69 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +641 -0
- package/dist/registry.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DOD-CLI-PARITY-1 Phases 1-2 — every daemon capability that was MCP-only, reachable from `cello`.
|
|
3
|
+
*
|
|
4
|
+
* Bash is the universal agent adapter: with these commands any bash-capable agent (not just Claude
|
|
5
|
+
* Code or Hermes) operates a CELLO node — connect, send, receive, seal — with no MCP dependency.
|
|
6
|
+
*
|
|
7
|
+
* Each command is a THIN PASS-THROUGH: parse args → call the SAME daemon IPC handler the
|
|
8
|
+
* corresponding cello_* MCP tool calls → emit the response under the §3 contract (json-out.ts).
|
|
9
|
+
* No daemon changes, no second IPC client, no logic that the daemon owns (validation, tier bounds,
|
|
10
|
+
* agent_id resolution) is duplicated here — the CLI surfaces the daemon's verdict, verbatim.
|
|
11
|
+
*
|
|
12
|
+
* ── The per-invocation current-agent problem (why `use-agent` persists) ──────────────────────
|
|
13
|
+
* The daemon's "current agent" is PER-CONNECTION state. The MCP shim holds one long-lived socket,
|
|
14
|
+
* so `cello_use_agent` sticks for the whole session. The CLI is the opposite: a fresh process and a
|
|
15
|
+
* fresh connection per invocation, torn down microseconds later. A naive `cello use-agent alice`
|
|
16
|
+
* pass-through would therefore set state on a dying socket and report ok:true while changing NOTHING
|
|
17
|
+
* for the next command — a fabricated success of exactly the kind §3 forbids.
|
|
18
|
+
*
|
|
19
|
+
* So the selection is DURABLE: `use-agent` calls the real handler (which validates the agent and
|
|
20
|
+
* auto-starts it — AUTOSTART-1) and, only if the daemon says ok, persists the name. Every
|
|
21
|
+
* agent-scoped command then REPLAYS `cello_use_agent` on its new connection before dispatching.
|
|
22
|
+
* That is not a parallel path — it is the same replay the MCP proxy performs after a reconnect
|
|
23
|
+
* (ipc-proxy.ts invariant 1), reusing the existing handler.
|
|
24
|
+
*
|
|
25
|
+
* Agent resolution, in order: explicit `--agent` > the persisted selection > (omitted, so the
|
|
26
|
+
* daemon applies its own sole-online-agent fallback, and stays ambiguous → no_current_agent when
|
|
27
|
+
* two or more are online). If a replay FAILS, the command STOPS and surfaces that error — it never
|
|
28
|
+
* shrugs and lets the daemon's fallback quietly run the work as a different agent.
|
|
29
|
+
*/
|
|
30
|
+
import { join } from "node:path";
|
|
31
|
+
import { readFile, writeFile, unlink } from "node:fs/promises";
|
|
32
|
+
import { connectToDaemon, readLock } from "@cello-protocol/daemon";
|
|
33
|
+
import { emitIpcResult, emitTransportError } from "./json-out.js";
|
|
34
|
+
/** Where `cello use-agent` records the selection: a plain text file the operator can read/delete. */
|
|
35
|
+
function currentAgentPath(celloDir) {
|
|
36
|
+
return join(celloDir, "current-agent");
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The persisted agent selection, or undefined if none was ever made.
|
|
40
|
+
*
|
|
41
|
+
* ENOENT — never selected — is the ONLY swallowed error (review F4). A blanket catch here would let
|
|
42
|
+
* an unreadable file (EACCES, EISDIR, a corrupt mount) read as "no selection", after which the
|
|
43
|
+
* daemon's sole-online fallback would quietly run the command as whatever agent happens to be up:
|
|
44
|
+
* the operator's selection silently replaced by a different identity, exit 0. Anything that is not
|
|
45
|
+
* "the file isn't there" is a real failure and is thrown.
|
|
46
|
+
*/
|
|
47
|
+
export async function readCurrentAgent(celloDir) {
|
|
48
|
+
try {
|
|
49
|
+
const raw = (await readFile(currentAgentPath(celloDir), "utf8")).trim();
|
|
50
|
+
return raw.length > 0 ? raw : undefined;
|
|
51
|
+
}
|
|
52
|
+
catch (err) {
|
|
53
|
+
if (err?.code === "ENOENT")
|
|
54
|
+
return undefined; // never selected
|
|
55
|
+
throw err;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Forget the persisted selection. Called by `stop-agent` (review F1): the daemon clears an agent
|
|
60
|
+
* from every connection's current-agent state when it is stopped, so the CLI's durable mirror of
|
|
61
|
+
* that state must be cleared too. Leaving it behind was a genuine defect — see stopAgent().
|
|
62
|
+
*/
|
|
63
|
+
async function clearCurrentAgent(celloDir) {
|
|
64
|
+
try {
|
|
65
|
+
await unlink(currentAgentPath(celloDir));
|
|
66
|
+
}
|
|
67
|
+
catch (err) {
|
|
68
|
+
if (err?.code !== "ENOENT")
|
|
69
|
+
throw err;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
async function writeCurrentAgent(celloDir, name) {
|
|
73
|
+
await writeFile(currentAgentPath(celloDir), name + "\n", "utf8");
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Open a daemon connection, establish the current agent (if one is selected), run `fn`, and always
|
|
77
|
+
* close. Transport failures come back as structured JSON on stderr — so a bash agent branches on
|
|
78
|
+
* the same shape whether the daemon rejected the call or never received it.
|
|
79
|
+
*/
|
|
80
|
+
async function withDaemon(celloDir, opts, agentScoped, fn) {
|
|
81
|
+
const lock = await readLock(join(celloDir, "daemon.lock"));
|
|
82
|
+
if (!lock) {
|
|
83
|
+
return emitTransportError("daemon_not_running", "No daemon is running. Start it with 'cello login', then retry.", opts);
|
|
84
|
+
}
|
|
85
|
+
let client;
|
|
86
|
+
try {
|
|
87
|
+
client = await connectToDaemon(lock.socketPath);
|
|
88
|
+
}
|
|
89
|
+
catch (err) {
|
|
90
|
+
return emitTransportError("daemon_unreachable", `Could not connect to the daemon at ${lock.socketPath}: ${err instanceof Error ? err.message : String(err)}. It may be mid-shutdown — check 'cello status'.`, opts);
|
|
91
|
+
}
|
|
92
|
+
try {
|
|
93
|
+
await client.send("ipc.connect", { clientType: "cli" });
|
|
94
|
+
if (agentScoped) {
|
|
95
|
+
// Review F2 — an EMPTY --agent must never be treated as "no --agent". `--agent "$VAR"` with
|
|
96
|
+
// VAR unset yields "", which is not nullish: it would suppress the persisted selection, fail
|
|
97
|
+
// the truthiness check below, run NO replay, and let the daemon's sole-online fallback execute
|
|
98
|
+
// the command as whatever agent happened to be up — exit 0, wrong identity, silently. That is
|
|
99
|
+
// the exact misroute this module exists to prevent, and the bash idiom makes it likely.
|
|
100
|
+
if (opts.agent !== undefined && opts.agent.trim() === "") {
|
|
101
|
+
return emitTransportError("missing_agent_value", "--agent was given an empty value (an unset shell variable?). Name an agent explicitly, or omit --agent to use the selection from 'cello use-agent'.", opts);
|
|
102
|
+
}
|
|
103
|
+
const selected = opts.agent ?? (await readCurrentAgent(celloDir));
|
|
104
|
+
if (selected) {
|
|
105
|
+
// Review F1 — the replay must not RESURRECT a stopped agent. cello_use_agent auto-starts an
|
|
106
|
+
// offline agent (AUTOSTART-1), so replaying it blindly meant `cello stop-agent alice` could
|
|
107
|
+
// be silently undone by the very next read-only command (`cello inbox`), bringing alice back
|
|
108
|
+
// online and reachable with no signal. Stopping an agent is kill-switch-adjacent; a command
|
|
109
|
+
// that reads must never re-arm it. The MCP surface never does this — the daemon clears the
|
|
110
|
+
// agent from every connection on stop, and later calls get no_current_agent.
|
|
111
|
+
//
|
|
112
|
+
// So: only replay an agent that is ALREADY ONLINE. An offline selection fails loud, naming
|
|
113
|
+
// the remedy, rather than quietly starting it or quietly running as someone else.
|
|
114
|
+
if (!(await isAgentOnline(client, selected))) {
|
|
115
|
+
return emitTransportError("selected_agent_offline", `Agent '${selected}' is not online, so this command was not run as it. Bring it online with 'cello start-agent ${selected}' (or select another with 'cello use-agent <name>'). It is NOT auto-started here: that would silently undo a deliberate 'cello stop-agent'.`, opts);
|
|
116
|
+
}
|
|
117
|
+
// The agent is online — claim it for this connection. A refusal (retired/unknown) stops the
|
|
118
|
+
// command: continuing would let the sole-online fallback run it as a DIFFERENT agent.
|
|
119
|
+
const used = (await client.send("cello_use_agent", { name: selected }));
|
|
120
|
+
if (used.ok !== true) {
|
|
121
|
+
// Defensive: cello_use_agent is ok-bearing on every path today, but if it ever returned an
|
|
122
|
+
// ok-less body, emitIpcResult would print IT as this command's successful result. Fail loud
|
|
123
|
+
// on any shape that is not an explicit ok:false, rather than pass off the wrong body.
|
|
124
|
+
if (used.ok === false)
|
|
125
|
+
return emitIpcResult(used, opts);
|
|
126
|
+
return emitTransportError("unexpected_replay_response", `Selecting agent '${selected}' returned an unrecognized response, so the command was not run. This is a daemon/CLI version mismatch — check 'cello status'.`, opts);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
// No selection at all → send nothing, and let the daemon apply its own documented fallback
|
|
130
|
+
// (sole online agent; ambiguous → no_current_agent). Guessing here would misroute.
|
|
131
|
+
}
|
|
132
|
+
const result = await fn(client);
|
|
133
|
+
return emitIpcResult(result, opts);
|
|
134
|
+
}
|
|
135
|
+
catch (err) {
|
|
136
|
+
return emitTransportError("ipc_error", `The daemon call failed: ${err instanceof Error ? err.message : String(err)}`, opts);
|
|
137
|
+
}
|
|
138
|
+
finally {
|
|
139
|
+
client.close();
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Is this agent currently ONLINE? Asked via cello_list_agents (a real handler, no new IPC path) so
|
|
144
|
+
* the replay can refuse to auto-start a stopped agent (review F1). Fails CLOSED: any unexpected
|
|
145
|
+
* shape reads as "not online", which fails the command loud rather than resurrecting an agent the
|
|
146
|
+
* operator deliberately stopped.
|
|
147
|
+
*/
|
|
148
|
+
async function isAgentOnline(client, name) {
|
|
149
|
+
const res = (await client.send("cello_list_agents"));
|
|
150
|
+
return (res.agents ?? []).some((a) => a.name === name && a.state === "online");
|
|
151
|
+
}
|
|
152
|
+
/** The common case: one IPC call, agent-scoped unless stated otherwise. */
|
|
153
|
+
function ipcCommand(celloDir, method, params, opts, agentScoped = true) {
|
|
154
|
+
return withDaemon(celloDir, opts, agentScoped, async (client) => {
|
|
155
|
+
return (await client.send(method, params));
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
/** Drop undefined values so an omitted optional param is ABSENT, not an explicit `undefined`. */
|
|
159
|
+
function defined(params) {
|
|
160
|
+
return Object.fromEntries(Object.entries(params).filter(([, v]) => v !== undefined));
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* The ONE place a CLI command's daemon IPC method is named (review T2).
|
|
164
|
+
*
|
|
165
|
+
* The registry's `ipcMethod` field is set FROM this map, and every function below dispatches FROM
|
|
166
|
+
* this map — so the field that DoD §9's parity test audits is, by construction, the literal that is
|
|
167
|
+
* actually sent. Previously the two were independent strings: the registry could say
|
|
168
|
+
* `cello_contact_set_moniker` while the code called `cello_contact_set_away`, and the audit — which
|
|
169
|
+
* only read the metadata — would happily pass. A comment-in-a-field is not a guarantee; this is.
|
|
170
|
+
*/
|
|
171
|
+
export const IPC_METHODS = {
|
|
172
|
+
agents: "cello_list_agents",
|
|
173
|
+
"start-agent": "cello_start_agent",
|
|
174
|
+
"stop-agent": "cello_stop_agent",
|
|
175
|
+
"use-agent": "cello_use_agent",
|
|
176
|
+
inbox: "cello_check_notifications",
|
|
177
|
+
transcript: "cello_get_transcript",
|
|
178
|
+
"sealed-receipt": "cello_get_sealed_receipt",
|
|
179
|
+
initiate: "cello_initiate_session",
|
|
180
|
+
send: "cello_send",
|
|
181
|
+
receive: "cello_receive",
|
|
182
|
+
"receive-session": "cello_receive_session",
|
|
183
|
+
close: "cello_close_session",
|
|
184
|
+
"await-session": "cello_await_session",
|
|
185
|
+
"contact-add": "cello_contact_add",
|
|
186
|
+
"contact-remove": "cello_contact_remove",
|
|
187
|
+
"contact-list": "cello_contact_list",
|
|
188
|
+
"contact-set-tier": "cello_contact_set_tier",
|
|
189
|
+
"contact-set-away": "cello_contact_set_away",
|
|
190
|
+
"contact-set-moniker": "cello_contact_set_moniker",
|
|
191
|
+
};
|
|
192
|
+
// ─── Group A: agent lifecycle ──────────────────────────────────────────────────────────────────
|
|
193
|
+
/** `cello agents` → cello_list_agents. Daemon-wide, not agent-scoped. */
|
|
194
|
+
export function listAgents(celloDir, opts) {
|
|
195
|
+
return ipcCommand(celloDir, IPC_METHODS.agents, {}, opts, false);
|
|
196
|
+
}
|
|
197
|
+
/** `cello start-agent <name>` → cello_start_agent. Brings an agent online WITHOUT claiming current. */
|
|
198
|
+
export function startAgent(celloDir, name, opts) {
|
|
199
|
+
return ipcCommand(celloDir, IPC_METHODS["start-agent"], { name }, opts, false);
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* `cello stop-agent <name>` → cello_stop_agent.
|
|
203
|
+
*
|
|
204
|
+
* Also CLEARS the persisted selection when it names this agent (review F1). The daemon clears a
|
|
205
|
+
* stopped agent from every connection's current-agent state; the CLI's durable mirror of that state
|
|
206
|
+
* must follow, or the next command would try to act as an agent the operator just stopped.
|
|
207
|
+
*/
|
|
208
|
+
export async function stopAgent(celloDir, name, opts) {
|
|
209
|
+
const out = await ipcCommand(celloDir, IPC_METHODS["stop-agent"], { name }, opts, false);
|
|
210
|
+
if (out.exitCode === 0 && (await readCurrentAgent(celloDir)) === name) {
|
|
211
|
+
await clearCurrentAgent(celloDir);
|
|
212
|
+
}
|
|
213
|
+
return out;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* `cello use-agent <name>` → cello_use_agent, and — only if the daemon accepts it — persists the
|
|
217
|
+
* selection so it survives this process. The handler auto-starts the agent if offline (AUTOSTART-1).
|
|
218
|
+
* A rejected selection is NEVER written: a later command must not silently act as an agent the
|
|
219
|
+
* daemon refused.
|
|
220
|
+
*/
|
|
221
|
+
export async function useAgent(celloDir, name, opts) {
|
|
222
|
+
const out = await ipcCommand(celloDir, IPC_METHODS["use-agent"], { name }, opts, false);
|
|
223
|
+
if (out.exitCode === 0)
|
|
224
|
+
await writeCurrentAgent(celloDir, name);
|
|
225
|
+
return out;
|
|
226
|
+
}
|
|
227
|
+
/** `cello inbox [--scope current|all]` → cello_check_notifications (the push-loss reconciler). */
|
|
228
|
+
export function inbox(celloDir, opts) {
|
|
229
|
+
return ipcCommand(celloDir, IPC_METHODS.inbox, defined({ scope: opts.scope }), opts);
|
|
230
|
+
}
|
|
231
|
+
/** `cello transcript <session-id>` → cello_get_transcript (durable, survives a daemon restart). */
|
|
232
|
+
export function transcript(celloDir, sessionId, opts) {
|
|
233
|
+
return ipcCommand(celloDir, IPC_METHODS.transcript, { session_id: sessionId }, opts);
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* `cello sealed-receipt <session-id>` → cello_get_sealed_receipt.
|
|
237
|
+
*
|
|
238
|
+
* NOT in the brief's mapping table, which listed cello_get_sealed_receipt as "already covered by
|
|
239
|
+
* `receipts`". It is not: `cello receipts <name>` calls cello_get_relay_receipts — a DIFFERENT
|
|
240
|
+
* handler (relay ordering receipts). The notarized bilateral SEAL receipt — the artifact the whole
|
|
241
|
+
* close ceremony exists to produce, and the one an arbitrator reads — had no CLI surface at all.
|
|
242
|
+
* Added under the standing rule: a real, non-stub handler with no CLI command gets one.
|
|
243
|
+
*/
|
|
244
|
+
export function sealedReceipt(celloDir, sessionId, opts) {
|
|
245
|
+
return ipcCommand(celloDir, IPC_METHODS["sealed-receipt"], { session_id: sessionId }, opts);
|
|
246
|
+
}
|
|
247
|
+
// Review F3: the WHOLE address book now speaks the §3 contract, not just the three new sub-verbs.
|
|
248
|
+
// Previously add/remove/list/tier/away went through the legacy path (errors pretty-printed to
|
|
249
|
+
// STDOUT, no --pretty) while the new set-moniker used the parity path (errors to stderr) — so a
|
|
250
|
+
// bash script branching on stderr got DIFFERENT conventions between sub-verbs of the same command.
|
|
251
|
+
// One command, one contract. (Behavior change, journaled: contact failures now print JSON on stderr
|
|
252
|
+
// rather than stdout; the exit codes were already correct.)
|
|
253
|
+
/** `cello contact add <pubkey>` → cello_contact_add. */
|
|
254
|
+
export function contactAdd(celloDir, pubkey, opts) {
|
|
255
|
+
return ipcCommand(celloDir, IPC_METHODS["contact-add"], { pubkey }, opts);
|
|
256
|
+
}
|
|
257
|
+
/** `cello contact remove <pubkey>` → cello_contact_remove. */
|
|
258
|
+
export function contactRemove(celloDir, pubkey, opts) {
|
|
259
|
+
return ipcCommand(celloDir, IPC_METHODS["contact-remove"], { pubkey }, opts);
|
|
260
|
+
}
|
|
261
|
+
/** `cello contact list` → cello_contact_list. */
|
|
262
|
+
export function contactList(celloDir, opts) {
|
|
263
|
+
return ipcCommand(celloDir, IPC_METHODS["contact-list"], {}, opts);
|
|
264
|
+
}
|
|
265
|
+
/** `cello contact set-tier <pubkey> <tier>` → cello_contact_set_tier. */
|
|
266
|
+
export function contactSetTier(celloDir, pubkey, tier, opts) {
|
|
267
|
+
return ipcCommand(celloDir, IPC_METHODS["contact-set-tier"], { pubkey, tier }, opts);
|
|
268
|
+
}
|
|
269
|
+
/** `cello contact set-away <pubkey> <message>` → cello_contact_set_away (empty message clears it). */
|
|
270
|
+
export function contactSetAway(celloDir, pubkey, message, opts) {
|
|
271
|
+
return ipcCommand(celloDir, IPC_METHODS["contact-set-away"], { pubkey, message }, opts);
|
|
272
|
+
}
|
|
273
|
+
/** `cello contact set-moniker <pubkey> <moniker>` → cello_contact_set_moniker (per-CONTACT pet name). */
|
|
274
|
+
export function contactSetMoniker(celloDir, pubkey, moniker, opts) {
|
|
275
|
+
return ipcCommand(celloDir, IPC_METHODS["contact-set-moniker"], { pubkey, moniker }, opts);
|
|
276
|
+
}
|
|
277
|
+
// ─── Group B: live conversation (mirrors the MCP params EXACTLY) ───────────────────────────────
|
|
278
|
+
/** `cello initiate <target-pubkey>` → cello_initiate_session. Prints the session_id. */
|
|
279
|
+
export function initiate(celloDir, targetPubkey, opts) {
|
|
280
|
+
return ipcCommand(celloDir, IPC_METHODS.initiate, { target_pubkey: targetPubkey }, opts);
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* `cello send <session-id> <message>` → cello_send.
|
|
284
|
+
*
|
|
285
|
+
* Honors read-before-write exactly as the MCP tool does: if the daemon returns session_not_current
|
|
286
|
+
* (with its cursor), that verdict is surfaced VERBATIM and the command exits non-zero. It is never
|
|
287
|
+
* auto-fixed by silently reading the transcript first — the operator/agent must catch up explicitly,
|
|
288
|
+
* because a send that "worked" after a hidden read is a send whose ordering guarantees are a fiction.
|
|
289
|
+
*/
|
|
290
|
+
export function send(celloDir, sessionId, content, opts) {
|
|
291
|
+
return ipcCommand(celloDir, "cello_send", defined({ session_id: sessionId, content, governance_decisions: opts.governanceDecisions }), opts);
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* `cello receive <session-id> [--since-seq N] [--timeout-ms N]` → cello_receive.
|
|
295
|
+
* Mirrors the MCP semantics exactly: with since_seq it is a stateless catch-up BATCH (no replay
|
|
296
|
+
* race, timeout ignored); without it, it BLOCKS for the next live message until timeout_ms.
|
|
297
|
+
*/
|
|
298
|
+
export function receive(celloDir, sessionId, opts) {
|
|
299
|
+
return ipcCommand(celloDir, "cello_receive", defined({ session_id: sessionId, timeout_ms: opts.timeoutMs, since_seq: opts.sinceSeq }), opts);
|
|
300
|
+
}
|
|
301
|
+
/** `cello receive-session <session-id> [--timeout-ms N]` → cello_receive_session. */
|
|
302
|
+
export function receiveSession(celloDir, sessionId, opts) {
|
|
303
|
+
return ipcCommand(celloDir, "cello_receive_session", defined({ session_id: sessionId, timeout_ms: opts.timeoutMs }), opts);
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* `cello close <session-id> [--force]` → cello_close_session. Normally triggers the bilateral seal
|
|
307
|
+
* ceremony. --force is passed ONLY when asked for (mirroring the shim), since it forfeits the seal.
|
|
308
|
+
*/
|
|
309
|
+
export function closeSession(celloDir, sessionId, opts) {
|
|
310
|
+
const params = opts.force ? { session_id: sessionId, force: true } : { session_id: sessionId };
|
|
311
|
+
return ipcCommand(celloDir, IPC_METHODS.close, params, opts);
|
|
312
|
+
}
|
|
313
|
+
/** `cello await-session [--timeout-ms N]` → cello_await_session. Blocks for an inbound doorbell. */
|
|
314
|
+
export function awaitSession(celloDir, opts) {
|
|
315
|
+
return ipcCommand(celloDir, IPC_METHODS["await-session"], defined({ timeout_ms: opts.timeoutMs }), opts);
|
|
316
|
+
}
|
|
317
|
+
//# sourceMappingURL=parity-commands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parity-commands.js","sourceRoot":"","sources":["../src/parity-commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAkB,MAAM,wBAAwB,CAAC;AACnF,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAwC,MAAM,eAAe,CAAC;AAUxG,qGAAqG;AACrG,SAAS,gBAAgB,CAAC,QAAgB;IACxC,OAAO,IAAI,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAC;AACzC,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,QAAgB;IACrD,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,CAAC,MAAM,QAAQ,CAAC,gBAAgB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AAE,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,EACxF,IAAI,CACL,CAAC;AACJ,CAAC;AAED,qFAAqF;AACrF,MAAM,UAAU,cAAc,CAC5B,QAAgB,EAChB,SAAiB,EACjB,IAA4C;IAE5C,OAAO,UAAU,CACf,QAAQ,EACR,uBAAuB,EACvB,OAAO,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,EAC9D,IAAI,CACL,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,YAAY,CAC1B,QAAgB,EAChB,SAAiB,EACjB,IAAyC;IAEzC,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC;IAC/F,OAAO,UAAU,CAAC,QAAQ,EAAE,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;AAC/D,CAAC;AAED,oGAAoG;AACpG,MAAM,UAAU,YAAY,CAC1B,QAAgB,EAChB,IAA4C;IAE5C,OAAO,UAAU,CAAC,QAAQ,EAAE,WAAW,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC;AAC3G,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DOD-CLI-PARITY-1 §4 — the command REGISTRY: the single source of truth for the `cello` CLI.
|
|
3
|
+
*
|
|
4
|
+
* Each entry carries { name, summary, help, flags, run }. Everything derives from this one table:
|
|
5
|
+
* - dispatch (src/bin/cello.ts) — no switch to keep in sync,
|
|
6
|
+
* - the `cello --help` described `Commands:` table — rendered from each entry's `summary`
|
|
7
|
+
* (this is DOD-ONBOARD-HELP-1's remaining gap; the old surface was a pipe-delimited blob),
|
|
8
|
+
* - per-command `cello <cmd> --help` — the pre-existing help text, moved here VERBATIM,
|
|
9
|
+
* - the recognized-flag set used to reject unknown flags before dispatch.
|
|
10
|
+
*
|
|
11
|
+
* Consequence, and the reason for the refactor: the help table, per-command help, and dispatch
|
|
12
|
+
* CANNOT DRIFT, and adding a command FORCES adding its one-line summary.
|
|
13
|
+
*/
|
|
14
|
+
import type { Logger } from "@cello-protocol/daemon";
|
|
15
|
+
/** What a command needs from the process to run. Injected so dispatch is testable in-process. */
|
|
16
|
+
export interface CommandContext {
|
|
17
|
+
celloDir: string;
|
|
18
|
+
daemonBin: string;
|
|
19
|
+
logger: Logger;
|
|
20
|
+
/** Progress lines printed BEFORE the result (e.g. logout's "Shutting down…"). */
|
|
21
|
+
onProgress?: (line: string) => void;
|
|
22
|
+
}
|
|
23
|
+
/** The (stdout, stderr, exitCode) triple a command produces. See json-out.ts for the §3 contract. */
|
|
24
|
+
export interface CliOutput {
|
|
25
|
+
stdout: string;
|
|
26
|
+
stderr: string;
|
|
27
|
+
exitCode: number;
|
|
28
|
+
}
|
|
29
|
+
export interface FlagSpec {
|
|
30
|
+
name: string;
|
|
31
|
+
/** The flag takes the NEXT argv token as its value (so a dash-prefixed value isn't misread). */
|
|
32
|
+
consumesValue?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export interface CommandSpec {
|
|
35
|
+
name: string;
|
|
36
|
+
/** One line. Rendered as this command's row in the `cello --help` Commands: table. */
|
|
37
|
+
summary: string;
|
|
38
|
+
/** Full per-command help, printed by `cello <cmd> --help`. */
|
|
39
|
+
help: string;
|
|
40
|
+
flags?: readonly FlagSpec[];
|
|
41
|
+
/**
|
|
42
|
+
* The daemon IPC handler this command calls — i.e. the SAME handler the corresponding `cello_*`
|
|
43
|
+
* MCP tool calls. Recorded here so the parity claim (DoD §9: "every cello_* MCP tool has a cello
|
|
44
|
+
* command calling the same IPC handler") is AUDITABLE from the registry itself rather than by
|
|
45
|
+
* reading each implementation. Absent for commands that are not a single IPC call (login, logout,
|
|
46
|
+
* install) or that route to sub-handlers (contact, settings, moniker, telegram).
|
|
47
|
+
*/
|
|
48
|
+
ipcMethod?: string;
|
|
49
|
+
/**
|
|
50
|
+
* True for commands that honor the §3 bash-adapter contract (JSON to stdout, structured error
|
|
51
|
+
* VERBATIM to stderr, exit code branching on ok). Such commands automatically accept `--pretty`.
|
|
52
|
+
*/
|
|
53
|
+
jsonOut?: boolean;
|
|
54
|
+
run(ctx: CommandContext, args: string[]): Promise<CliOutput>;
|
|
55
|
+
}
|
|
56
|
+
export declare const COMMANDS: readonly CommandSpec[];
|
|
57
|
+
export declare function commandNames(): string[];
|
|
58
|
+
export declare function findCommand(name: string): CommandSpec | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* The flags a command recognizes, derived from its registry entry. `--pretty` is granted
|
|
61
|
+
* automatically to every command honoring the §3 JSON contract, so it can never be forgotten.
|
|
62
|
+
*/
|
|
63
|
+
export declare function flagsFor(name: string): ReadonlyMap<string, FlagSpec>;
|
|
64
|
+
/**
|
|
65
|
+
* DOD-ONBOARD-HELP-1: render the described `Commands:` table — each command on its own line with
|
|
66
|
+
* its one-line summary (git / `claude --help` style). Arguments stay in per-command `--help`.
|
|
67
|
+
*/
|
|
68
|
+
export declare function renderCommandsTable(): string;
|
|
69
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAiDrD,iGAAiG;AACjG,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,iFAAiF;IACjF,UAAU,CAAC,EAAE,C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