@cello-protocol/cli 0.0.43 → 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.
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Shared argv parsing primitives.
3
+ *
4
+ * Extracted from cli-args.ts (DOD-CLI-PARITY-1 Phase 0) so that BOTH the registry (which parses a
5
+ * command's args inside its run()) and cli-args (which validates them before dispatch) can use it
6
+ * without an import cycle: cli-args → registry → arg-parse, never back.
7
+ */
8
+ /**
9
+ * Split a subcommand's argv into the `--agent <name>` flag and the remaining positionals.
10
+ *
11
+ * Extracted originally (MONIKER-1 review Finding 1) because the old inline filter used
12
+ * `i === agentIdx + 1` unguarded: with --agent ABSENT, agentIdx is -1 and the predicate silently
13
+ * dropped positional index 0 — `cello moniker set Bob` / `cello contact list` printed usage instead
14
+ * of dispatching. The flag's value is excluded ONLY when the flag exists.
15
+ */
16
+ export declare function splitAgentFlag(args: string[]): {
17
+ agent: string | undefined;
18
+ positional: string[];
19
+ };
20
+ //# sourceMappingURL=arg-parse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arg-parse.d.ts","sourceRoot":"","sources":["../src/arg-parse.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG;IAAE,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,UAAU,EAAE,MAAM,EAAE,CAAA;CAAE,CAalG"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Shared argv parsing primitives.
3
+ *
4
+ * Extracted from cli-args.ts (DOD-CLI-PARITY-1 Phase 0) so that BOTH the registry (which parses a
5
+ * command's args inside its run()) and cli-args (which validates them before dispatch) can use it
6
+ * without an import cycle: cli-args → registry → arg-parse, never back.
7
+ */
8
+ /**
9
+ * Split a subcommand's argv into the `--agent <name>` flag and the remaining positionals.
10
+ *
11
+ * Extracted originally (MONIKER-1 review Finding 1) because the old inline filter used
12
+ * `i === agentIdx + 1` unguarded: with --agent ABSENT, agentIdx is -1 and the predicate silently
13
+ * dropped positional index 0 — `cello moniker set Bob` / `cello contact list` printed usage instead
14
+ * of dispatching. The flag's value is excluded ONLY when the flag exists.
15
+ */
16
+ export function splitAgentFlag(args) {
17
+ // POSIX `--` end-of-flags terminator (review F1): everything after the first `--` is a positional
18
+ // VALUE, verbatim — so a value that starts with `-` (a negative number, or an away text like
19
+ // "- back Monday") can be passed. --agent is recognized only BEFORE the terminator.
20
+ const ddIdx = args.indexOf("--");
21
+ const flagScan = ddIdx === -1 ? args : args.slice(0, ddIdx);
22
+ const afterTerminator = ddIdx === -1 ? [] : args.slice(ddIdx + 1);
23
+ const agentIdx = flagScan.indexOf("--agent");
24
+ const agent = agentIdx !== -1 ? flagScan[agentIdx + 1] : undefined;
25
+ const positional = flagScan
26
+ .filter((a, i) => !(a === "--agent" || (agentIdx !== -1 && i === agentIdx + 1)))
27
+ .concat(afterTerminator);
28
+ return { agent, positional };
29
+ }
30
+ //# sourceMappingURL=arg-parse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arg-parse.js","sourceRoot":"","sources":["../src/arg-parse.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAAC,IAAc;IAC3C,kGAAkG;IAClG,6FAA6F;IAC7F,oFAAoF;IACpF,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACjC,MAAM,QAAQ,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;IAC5D,MAAM,eAAe,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;IAClE,MAAM,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAC7C,MAAM,KAAK,GAAG,QAAQ,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACnE,MAAM,UAAU,GAAG,QAAQ;SACxB,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,SAAS,IAAI,CAAC,QAAQ,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC;SAC/E,MAAM,CAAC,eAAe,CAAC,CAAC;IAC3B,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;AAC/B,CAAC"}
@@ -2,11 +2,14 @@
2
2
  /**
3
3
  * cello — the CELLO CLI binary.
4
4
  *
5
- * Commands:
6
- * cello login — Start the daemon (or connect to existing), exit 0
7
- * cello logout — Send shutdown command to daemon
8
- * cello status — Query daemon and print structured JSON response
9
- * cello register — Register a loaded agent with the directory (ML-DSA + FROST DKG)
5
+ * DOD-CLI-PARITY-1 Phase 0: this file no longer contains a dispatch switch. Every command lives in
6
+ * the registry (src/registry.ts), which is also what renders `cello --help` and per-command help —
7
+ * so dispatch, the command table, and the help text cannot drift apart. Adding a command means
8
+ * adding one registry entry; this binary does not change.
9
+ *
10
+ * The bash-adapter contract (§3): a command's JSON result goes to stdout, a structured failure goes
11
+ * to stderr VERBATIM, and the exit code branches on it — so any bash-capable agent can drive a
12
+ * CELLO node with `cello <cmd> | jq` and `$?`, with no MCP dependency.
10
13
  */
11
14
  export {};
12
15
  //# sourceMappingURL=cello.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cello.d.ts","sourceRoot":"","sources":["../../src/bin/cello.ts"],"names":[],"mappings":";AACA;;;;;;;;GAQG"}
1
+ {"version":3,"file":"cello.d.ts","sourceRoot":"","sources":["../../src/bin/cello.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;GAWG"}
package/dist/bin/cello.js CHANGED
@@ -2,17 +2,20 @@
2
2
  /**
3
3
  * cello — the CELLO CLI binary.
4
4
  *
5
- * Commands:
6
- * cello login — Start the daemon (or connect to existing), exit 0
7
- * cello logout — Send shutdown command to daemon
8
- * cello status — Query daemon and print structured JSON response
9
- * cello register — Register a loaded agent with the directory (ML-DSA + FROST DKG)
5
+ * DOD-CLI-PARITY-1 Phase 0: this file no longer contains a dispatch switch. Every command lives in
6
+ * the registry (src/registry.ts), which is also what renders `cello --help` and per-command help —
7
+ * so dispatch, the command table, and the help text cannot drift apart. Adding a command means
8
+ * adding one registry entry; this binary does not change.
9
+ *
10
+ * The bash-adapter contract (§3): a command's JSON result goes to stdout, a structured failure goes
11
+ * to stderr VERBATIM, and the exit code branches on it — so any bash-capable agent can drive a
12
+ * CELLO node with `cello <cmd> | jq` and `$?`, with no MCP dependency.
10
13
  */
11
14
  import { homedir } from "node:os";
12
15
  import { join, dirname } from "node:path";
13
16
  import { createRequire } from "node:module";
14
- import { login, logout, status, register, createAgent, removeAgent, refreshShares, relayReceipts, sessions, contactAdd, contactRemove, contactList, monikerSet, telegramSetToken } from "../commands.js";
15
- import { USAGE, KNOWN_COMMANDS, checkArgs, helpForCommand, splitAgentFlag } from "../cli-args.js";
17
+ import { KNOWN_COMMANDS, USAGE, checkArgs, helpForCommand } from "../cli-args.js";
18
+ import { findCommand } from "../registry.js";
16
19
  const logger = {
17
20
  debug(event, context) {
18
21
  const line = JSON.stringify({ level: "debug", event, ...context, ts: new Date().toISOString() });
@@ -38,173 +41,40 @@ const require = createRequire(import.meta.url);
38
41
  const daemonPkgPath = require.resolve("@cello-protocol/daemon/package.json");
39
42
  const daemonBin = join(dirname(daemonPkgPath), "dist/bin/cello-daemon.js");
40
43
  async function main() {
41
- let result;
42
- // M8B F2: answer --help/-h on every subcommand and REJECT unknown flags before
43
- // dispatch, so a flag can never be coerced into a positional argument (previously
44
- // `cello register --help` tried to register an agent literally named "--help").
45
- if (command && KNOWN_COMMANDS.has(command)) {
46
- const check = checkArgs(command, process.argv.slice(3));
47
- if (check.kind === "help") {
48
- process.stdout.write(helpForCommand(command) + "\n");
49
- process.exit(0);
50
- return;
51
- }
52
- if (check.kind === "unknown_flag") {
53
- process.stderr.write(`Unknown flag '${check.flag}' for 'cello ${command}'.\n`);
54
- process.stdout.write(helpForCommand(command) + "\n");
55
- process.exit(1);
56
- return;
57
- }
44
+ const spec = command ? findCommand(command) : undefined;
45
+ if (!spec || !KNOWN_COMMANDS.has(command)) {
46
+ // No command, or one we don't have: print the described command table.
47
+ process.stdout.write(USAGE + "\n");
48
+ process.exit(command ? 1 : 0);
49
+ return;
50
+ }
51
+ const args = process.argv.slice(3);
52
+ // M8B F2: answer --help/-h on every subcommand and REJECT unknown flags BEFORE dispatch, so a
53
+ // flag can never be coerced into a positional argument.
54
+ const check = checkArgs(command, args);
55
+ if (check.kind === "help") {
56
+ process.stdout.write(helpForCommand(command) + "\n");
57
+ process.exit(0);
58
+ return;
58
59
  }
59
- switch (command) {
60
- case "login":
61
- result = await login(celloDir, daemonBin, logger);
62
- break;
63
- case "logout":
64
- // DOD-LOGOUT-WAIT-1: logout now WAITS for the daemon to actually die before claiming
65
- // "Daemon stopped." — the immediate progress line tells the operator the command
66
- // activated and the short pause is expected.
67
- result = await logout(celloDir, (line) => process.stdout.write(line + "\n"));
68
- break;
69
- case "status":
70
- result = await status(celloDir);
71
- break;
72
- case "register": {
73
- // cello register <agent> [preAuthToken] (token falls back to CELLO_PREAUTH_TOKEN
74
- // so it need not appear in shell history). Optional phone stub follows.
75
- const agent = process.argv[3] ?? "";
76
- const preAuthToken = process.argv[4] ?? process.env.CELLO_PREAUTH_TOKEN ?? "";
77
- const phoneStub = process.argv[5] ?? "";
78
- // M8C-ONBOARD-WARN-1 (revised 2026-07-06, Andre): the pre-auth exposure "note" is REMOVED
79
- // entirely. A single-use, 24h, consumed-on-success token has no meaningful exposure risk, so
80
- // the note only drew attention to a non-issue ("this thing you weren't worried about? don't
81
- // worry about it") — pure noise on the core onboarding path. No warning at all is correct.
82
- result = await register(celloDir, agent, preAuthToken, phoneStub);
83
- break;
84
- }
85
- case "create-agent": {
86
- // cello create-agent <name> — create a fresh local agent identity (PERSIST-002 AC-004).
87
- const name = process.argv[3] ?? "";
88
- result = await createAgent(celloDir, name);
89
- break;
90
- }
91
- case "remove-agent": {
92
- // cello remove-agent <name> — retire a local agent (one-way) and free its name (REMOVE-001).
93
- const name = process.argv[3] ?? "";
94
- result = await removeAgent(celloDir, name);
95
- break;
96
- }
97
- case "refresh": {
98
- // cello refresh <name> — proactive share refresh / epoch rollover (M8B DOD-REFRESH-1).
99
- const name = process.argv[3] ?? "";
100
- result = await refreshShares(celloDir, name);
101
- break;
102
- }
103
- case "receipts": {
104
- // cello receipts <name> — list the agent's stored relay ordering receipts (M8B DOD-RELAYSIG-1).
105
- const name = process.argv[3] ?? "";
106
- result = await relayReceipts(celloDir, name);
107
- break;
108
- }
109
- case "sessions": {
110
- // cello sessions [--open|--closed|--failed|--all] [--limit N] — the full session history.
111
- // Defaults to open (live + resumable) so failed/closed don't flood it; the daemon caps the
112
- // count. (`cello status` only ever shows live/resumable, never this full list.)
113
- const args = process.argv.slice(3);
114
- let filter;
115
- if (args.includes("--all"))
116
- filter = "all";
117
- else if (args.includes("--closed"))
118
- filter = "closed";
119
- else if (args.includes("--failed"))
120
- filter = "failed";
121
- else if (args.includes("--open"))
122
- filter = "open";
123
- const limitIdx = args.indexOf("--limit");
124
- let limit;
125
- if (limitIdx !== -1 && args[limitIdx + 1] !== undefined) {
126
- const n = Number(args[limitIdx + 1]);
127
- if (Number.isFinite(n) && n > 0)
128
- limit = Math.floor(n);
129
- }
130
- result = await sessions(celloDir, { filter, limit });
131
- break;
132
- }
133
- case "contact": {
134
- // cello contact add <pubkey> [--agent <name>] | remove <pubkey> [--agent <name>] | list [--agent <name>]
135
- const { agent, positional } = splitAgentFlag(process.argv.slice(3));
136
- const [sub, pubkey] = positional;
137
- if (sub === "add" && pubkey) {
138
- result = await contactAdd(celloDir, pubkey, agent);
139
- }
140
- else if (sub === "remove" && pubkey) {
141
- result = await contactRemove(celloDir, pubkey, agent);
142
- }
143
- else if (sub === "list") {
144
- result = await contactList(celloDir, agent);
145
- }
146
- else {
147
- result = { exitCode: 1, output: "Usage: cello contact add|remove <pubkey> [--agent <name>] | cello contact list [--agent <name>]" };
148
- }
149
- break;
150
- }
151
- case "moniker": {
152
- // cello moniker set <name> [--agent <agent>] | cello moniker clear [--agent <agent>] (MONIKER-1)
153
- const { agent, positional } = splitAgentFlag(process.argv.slice(3));
154
- const [sub, name] = positional;
155
- if (sub === "set" && name) {
156
- result = await monikerSet(celloDir, name, agent);
157
- }
158
- else if (sub === "clear" && !name) {
159
- result = await monikerSet(celloDir, null, agent);
160
- }
161
- else {
162
- result = { exitCode: 1, output: helpForCommand("moniker") };
163
- }
164
- break;
165
- }
166
- case "telegram": {
167
- // cello telegram set-token <bot_token> <allowlisted_chat_id>
168
- const sub = process.argv[3];
169
- const botToken = process.argv[4];
170
- const chatId = process.argv[5];
171
- if (sub === "set-token" && botToken && chatId) {
172
- result = await telegramSetToken(celloDir, botToken, chatId);
173
- }
174
- else {
175
- result = { exitCode: 1, output: "Usage: cello telegram set-token <bot_token> <allowlisted_chat_id>" };
176
- }
177
- break;
178
- }
179
- case "install": {
180
- // cello install hermes --agent <name> [--hermes-home <path>] (HERMES-001)
181
- const args = process.argv.slice(3);
182
- const agentIdx = args.indexOf("--agent");
183
- const homeIdx = args.indexOf("--hermes-home");
184
- // Find the target positional, excluding both flags AND their values — so
185
- // `cello install --agent alice hermes` still resolves target=hermes (mirrors
186
- // the `contact` case's positional filter).
187
- const target = args.find((a, i) => !a.startsWith("-") &&
188
- !(agentIdx !== -1 && i === agentIdx + 1) &&
189
- !(homeIdx !== -1 && i === homeIdx + 1));
190
- if (target !== "hermes") {
191
- result = { exitCode: 1, output: helpForCommand("install") };
192
- break;
193
- }
194
- const { installHermes } = await import("../hermes/install-hermes.js");
195
- result = await installHermes({
196
- agentName: agentIdx !== -1 ? (args[agentIdx + 1] ?? "") : "",
197
- hermesHome: homeIdx !== -1 ? args[homeIdx + 1] : undefined,
198
- });
199
- break;
200
- }
201
- default:
202
- // M8B F1: the usage string lists EVERY command (refresh/receipts were missing).
203
- process.stdout.write(USAGE + "\n");
204
- process.exit(command ? 1 : 0);
205
- return;
60
+ if (check.kind === "unknown_flag") {
61
+ process.stderr.write(`Unknown flag '${check.flag}' for 'cello ${command}'.\n`);
62
+ process.stdout.write(helpForCommand(command) + "\n");
63
+ process.exit(1);
64
+ return;
206
65
  }
207
- process.stdout.write(result.output + "\n");
66
+ const ctx = {
67
+ celloDir,
68
+ daemonBin,
69
+ logger,
70
+ onProgress: (line) => process.stdout.write(line + "\n"),
71
+ };
72
+ const result = await spec.run(ctx, args);
73
+ // Report the outcome, never the intent: stdout carries the result, stderr the structured failure.
74
+ if (result.stdout.length > 0)
75
+ process.stdout.write(result.stdout + "\n");
76
+ if (result.stderr.length > 0)
77
+ process.stderr.write(result.stderr + "\n");
208
78
  process.exit(result.exitCode);
209
79
  }
210
80
  main().catch((err) => {
@@ -1 +1 @@
1
- {"version":3,"file":"cello.js","sourceRoot":"","sources":["../../src/bin/cello.ts"],"names":[],"mappings":";AACA;;;;;;;;GAQG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,QAAQ,EAAsB,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,gBAAgB,EAAE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@
1
1
  /**
2
- * M8B riders F1/F2 — CLI argument handling, extracted from src/bin/cello.ts so the
2
+ * CLI argument handling — validation that runs BEFORE dispatch, kept out of src/bin/cello.ts so the
3
3
  * usage surface is testable without spawning the binary.
4
4
  *
5
- * F1: USAGE lists EVERY dispatchable command (refresh and receipts were missing).
6
- * F2: every subcommand answers --help/-h, and an unrecognized flag is REJECTED
7
- * instead of being coerced into a positional argument (previously
8
- * `cello register --help` tried to register an agent literally named "--help").
5
+ * M8B riders F1/F2 (原): USAGE lists EVERY dispatchable command; every subcommand answers --help/-h;
6
+ * an unrecognized flag is REJECTED rather than coerced into a positional (previously
7
+ * `cello register --help` tried to register an agent literally named "--help").
8
+ *
9
+ * DOD-CLI-PARITY-1 Phase 0: this module no longer OWNS the command list, the help text, or the flag
10
+ * table — it DERIVES all three from the registry (registry.ts), the single source of truth. That is
11
+ * what makes drift between dispatch, `cello --help`, and `cello <cmd> --help` structurally
12
+ * impossible rather than merely discouraged.
13
+ */
14
+ import { COMMANDS } from "./registry.js";
15
+ export { splitAgentFlag } from "./arg-parse.js";
16
+ /** Every dispatchable command — derived, so it cannot fall out of step with the registry. */
17
+ export declare const KNOWN_COMMANDS: ReadonlySet<string>;
18
+ export type KnownCommand = string;
19
+ /**
20
+ * The top-level `cello --help`.
21
+ *
22
+ * CC-7 (P2-5 / DOD-ONBOARD-HELP-1): opens with what CELLO is + the onboarding path a first-time
23
+ * user needs. DOD-CLI-PARITY-1 §7 closes the remaining gap — the command list is now a DESCRIBED
24
+ * table rendered from each registry entry's `summary` (it used to be a single pipe-delimited blob
25
+ * with no per-command descriptions). Arguments stay in per-command `--help`.
9
26
  */
10
- export declare const KNOWN_COMMANDS: Set<"login" | "logout" | "status" | "register" | "create-agent" | "remove-agent" | "refresh" | "receipts" | "sessions" | "contact" | "moniker" | "telegram" | "install">;
11
- export type KnownCommand = typeof KNOWN_COMMANDS extends Set<infer T> ? T : never;
12
27
  export declare const USAGE: string;
28
+ /** Per-command help — the registry entry's own text, verbatim. */
13
29
  export declare function helpForCommand(command: string): string;
14
30
  export type ArgsCheck = {
15
31
  kind: "ok";
@@ -22,21 +38,13 @@ export type ArgsCheck = {
22
38
  /**
23
39
  * F2: validate a subcommand's arguments BEFORE dispatch.
24
40
  * - --help / -h ANYWHERE → help. This is a dedicated pre-scan so help wins even when it
25
- * follows an unknown flag or sits where --limit would consume its value — asking for
41
+ * follows an unknown flag or sits where a value-consuming flag would swallow it — asking for
26
42
  * help must never be masked by another argument error.
27
43
  * - any other dash-prefixed token the command does not recognize → unknown_flag
28
44
  * (never silently coerced into a positional).
45
+ * - after a POSIX `--` terminator, everything is a positional VALUE, verbatim.
29
46
  */
30
- /**
31
- * Split a subcommand's argv into the `--agent <name>` flag and the remaining positionals.
32
- * Extracted (MONIKER-1 review Finding 1) because the old inline filter used
33
- * `i === agentIdx + 1` unguarded: with --agent ABSENT, agentIdx is -1 and the predicate
34
- * silently dropped positional index 0 — `cello moniker set Bob` / `cello contact list`
35
- * printed usage instead of dispatching. The flag's value is excluded ONLY when the flag exists.
36
- */
37
- export declare function splitAgentFlag(args: string[]): {
38
- agent: string | undefined;
39
- positional: string[];
40
- };
41
47
  export declare function checkArgs(command: string, args: string[]): ArgsCheck;
48
+ /** The registry, re-exported for callers that want to enumerate commands (e.g. the dispatcher). */
49
+ export { COMMANDS };
42
50
  //# sourceMappingURL=cli-args.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cli-args.d.ts","sourceRoot":"","sources":["../src/cli-args.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,eAAO,MAAM,cAAc,0KAchB,CAAC;AAEZ,MAAM,MAAM,YAAY,GAAG,OAAO,cAAc,SAAS,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAIlF,eAAO,MAAM,KAAK,QAO0C,CAAC;AA8C7D,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEtD;AAUD,MAAM,M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AE,QAAQ,EAAE,CAAC"}
package/dist/cli-args.js CHANGED
@@ -1,117 +1,78 @@
1
1
  /**
2
- * M8B riders F1/F2 — CLI argument handling, extracted from src/bin/cello.ts so the
2
+ * CLI argument handling — validation that runs BEFORE dispatch, kept out of src/bin/cello.ts so the
3
3
  * usage surface is testable without spawning the binary.
4
4
  *
5
- * F1: USAGE lists EVERY dispatchable command (refresh and receipts were missing).
6
- * F2: every subcommand answers --help/-h, and an unrecognized flag is REJECTED
7
- * instead of being coerced into a positional argument (previously
8
- * `cello register --help` tried to register an agent literally named "--help").
5
+ * M8B riders F1/F2 (原): USAGE lists EVERY dispatchable command; every subcommand answers --help/-h;
6
+ * an unrecognized flag is REJECTED rather than coerced into a positional (previously
7
+ * `cello register --help` tried to register an agent literally named "--help").
8
+ *
9
+ * DOD-CLI-PARITY-1 Phase 0: this module no longer OWNS the command list, the help text, or the flag
10
+ * table — it DERIVES all three from the registry (registry.ts), the single source of truth. That is
11
+ * what makes drift between dispatch, `cello --help`, and `cello <cmd> --help` structurally
12
+ * impossible rather than merely discouraged.
13
+ */
14
+ import { COMMANDS, commandNames, findCommand, flagsFor, renderCommandsTable } from "./registry.js";
15
+ // Re-exported for the dispatch layer and existing callers (its home is arg-parse.ts, which both
16
+ // this module and the registry depend on — see the import-cycle note there).
17
+ export { splitAgentFlag } from "./arg-parse.js";
18
+ /** Every dispatchable command — derived, so it cannot fall out of step with the registry. */
19
+ export const KNOWN_COMMANDS = new Set(commandNames());
20
+ /**
21
+ * The top-level `cello --help`.
22
+ *
23
+ * CC-7 (P2-5 / DOD-ONBOARD-HELP-1): opens with what CELLO is + the onboarding path a first-time
24
+ * user needs. DOD-CLI-PARITY-1 §7 closes the remaining gap — the command list is now a DESCRIBED
25
+ * table rendered from each registry entry's `summary` (it used to be a single pipe-delimited blob
26
+ * with no per-command descriptions). Arguments stay in per-command `--help`.
9
27
  */
10
- import { MONIKER_RE } from "@cello-protocol/protocol-types";
11
- export const KNOWN_COMMANDS = new Set([
12
- "login",
13
- "logout",
14
- "status",
15
- "register",
16
- "create-agent",
17
- "remove-agent",
18
- "refresh",
19
- "receipts",
20
- "sessions",
21
- "contact",
22
- "moniker",
23
- "telegram",
24
- "install",
25
- ]);
26
- // CC-7 (P2-5 / DOD-ONBOARD-HELP-1): the top level opens with what CELLO is + the onboarding path a
27
- // first-time user needs, then the command list. (Per-command `cello <cmd> --help` was already good.)
28
28
  export const USAGE = "CELLO — a peer-to-peer identity & trust layer for agent-to-agent communication.\n" +
29
29
  "\n" +
30
30
  "First-time setup: cello login → cello create-agent <name> → cello register <name> <token> → cello status\n" +
31
31
  " (get <token> from the CELLO Operations Agent on Telegram; 'cello login' starts the local daemon.)\n" +
32
32
  "\n" +
33
- "Usage: cello <login|logout|status|register|create-agent|remove-agent|refresh|receipts|sessions|contact|moniker|telegram|install>\n" +
34
- "Run 'cello <command> --help' for details on any command.";
35
- /** Per-command usage lines (the same text the commands print on bad input). */
36
- const COMMAND_HELP = {
37
- login: "Usage: cello login — start the daemon (or connect to an existing one).",
38
- logout: "Usage: cello logout — send shutdown to the running daemon.",
39
- status: "Usage: cello status — query the daemon and print the structured status JSON.",
40
- register: "Usage: cello register <agent> <pre-auth-token> — register a LOCAL agent with the directory.\n" +
41
- " The two-step onboarding: (1) 'cello create-agent <name>' makes the local identity; (2) 'cello register <name> <token>' registers it with the directory.\n" +
42
- " The token is a single-use pre-authorization ticket from the CELLO Operations Agent on Telegram, format 'CELLO-' + 33 characters, valid 24h.\n" +
43
- " Example: cello register alice CELLO-3xY7...\n" +
44
- " Env-var form (avoids retyping): CELLO_PREAUTH_TOKEN=CELLO-3xY7... cello register alice\n" +
45
- " Quoting is only needed if a value contains spaces (agent names and tokens never do).",
46
- "create-agent": "Usage: cello create-agent <name> — create a new LOCAL agent identity (does not touch the directory).\n" +
47
- // MONIKER-0 AC2: the regex text is DERIVED from the shared constant, never hand-typed.
48
- ` Name rule: 1–64 characters, letters/digits/'-'/'_' only, no spaces (regex ${MONIKER_RE.source}).\n` +
49
- " Next step: 'cello register <name> <pre-auth-token>' to register it with the directory.",
50
- "remove-agent": "Usage: cello remove-agent <name> — retires a local agent (one-way) and frees its name.",
51
- refresh: "Usage: cello refresh <name> — proactively refresh the agent's threshold shares (new epoch).",
52
- receipts: "Usage: cello receipts <name> — list the agent's stored relay ordering receipts.",
53
- sessions: "Usage: cello sessions [--open|--closed|--failed|--all] [--limit N] — list session history (defaults to open).",
54
- contact: "Usage: cello contact add <pubkey> [--agent <name>] | cello contact remove <pubkey> [--agent <name>] | cello contact list [--agent <name>]\n" +
55
- " Per-agent contact whitelist (M8C-CONTACT-1). --agent defaults to the current/sole-online agent.\n" +
56
- " Contacts are added automatically too: initiating a session to X, or accepting X's inbound request, adds X.\n" +
57
- " Example: cello contact list --agent alice",
58
- moniker: "Usage: cello moniker set <name> [--agent <agent>] | cello moniker clear [--agent <agent>]\n" +
59
- " The agent's OUTBOUND name — what a counterparty's doorbell shows (MONIKER-1). Defaults to the agent name; 'set' stores an override, 'clear' restores the default.\n" +
60
- // MONIKER-0 AC2: the regex text is DERIVED from the shared constant, never hand-typed.
61
- ` Name rule: 1–64 characters, letters/digits/'-'/'_' only, no spaces (regex ${MONIKER_RE.source}).\n` +
62
- " Local-only: never sent to the directory; the receiver treats it as an unverified hint (like caller ID).\n" +
63
- " Example: cello moniker set Wonderland_Alice --agent alice",
64
- telegram: "Usage: cello telegram set-token <bot_token> <allowlisted_chat_id> — configure the daemon-owned Telegram doorbell (M8C-TGDOOR-1).\n" +
65
- " Starts a single long-lived poller immediately; the operator chat given is the ONLY one that ever receives doorbell events.",
66
- install: "Usage: cello install hermes --agent <name> [--hermes-home <path>] — wire the local CELLO daemon into a Hermes Agent installation.\n" +
67
- " Scaffolds the CELLO platform-adapter plugin into the Hermes home (default ~/.hermes), binds CELLO_AGENT_NAME in its .env,\n" +
68
- " and registers via 'hermes plugins enable cello' + 'hermes mcp add cello'. Idempotent — re-run to upgrade.\n" +
69
- " After installing, restart the gateway: hermes gateway restart",
70
- };
33
+ "Usage: cello <command> [args]\n" +
34
+ "\n" +
35
+ renderCommandsTable() +
36
+ "\n" +
37
+ "\n" +
38
+ "Run 'cello <command> --help' for details on any command.\n" +
39
+ // Scoped deliberately: only the parity commands (jsonOut) honor the full §3 contract — JSON on
40
+ // stdout, structured error on stderr. The older commands (login, register, …) still print human
41
+ // text, and their failures go to stdout. Claiming the contract for EVERY command would be a
42
+ // promise the binary does not keep, made to precisely the reader who would script against it.
43
+ "The session and agent commands (agents, use-agent, initiate, send, receive, close, …) print JSON\n" +
44
+ "and exit non-zero on failure, so any bash-capable agent can drive CELLO with no MCP dependency.";
45
+ /** Per-command help — the registry entry's own text, verbatim. */
71
46
  export function helpForCommand(command) {
72
- return COMMAND_HELP[command] ?? USAGE;
47
+ return findCommand(command)?.help ?? USAGE;
73
48
  }
74
- /** Flags each command recognizes. `--limit` consumes the following value. */
75
- const COMMAND_FLAGS = {
76
- sessions: new Set(["--open", "--closed", "--failed", "--all", "--limit"]),
77
- contact: new Set(["--agent"]),
78
- moniker: new Set(["--agent"]),
79
- install: new Set(["--agent", "--hermes-home"]),
80
- };
81
49
  /**
82
50
  * F2: validate a subcommand's arguments BEFORE dispatch.
83
51
  * - --help / -h ANYWHERE → help. This is a dedicated pre-scan so help wins even when it
84
- * follows an unknown flag or sits where --limit would consume its value — asking for
52
+ * follows an unknown flag or sits where a value-consuming flag would swallow it — asking for
85
53
  * help must never be masked by another argument error.
86
54
  * - any other dash-prefixed token the command does not recognize → unknown_flag
87
55
  * (never silently coerced into a positional).
56
+ * - after a POSIX `--` terminator, everything is a positional VALUE, verbatim.
88
57
  */
89
- /**
90
- * Split a subcommand's argv into the `--agent <name>` flag and the remaining positionals.
91
- * Extracted (MONIKER-1 review Finding 1) because the old inline filter used
92
- * `i === agentIdx + 1` unguarded: with --agent ABSENT, agentIdx is -1 and the predicate
93
- * silently dropped positional index 0 — `cello moniker set Bob` / `cello contact list`
94
- * printed usage instead of dispatching. The flag's value is excluded ONLY when the flag exists.
95
- */
96
- export function splitAgentFlag(args) {
97
- const agentIdx = args.indexOf("--agent");
98
- const agent = agentIdx !== -1 ? args[agentIdx + 1] : undefined;
99
- const positional = args.filter((a, i) => !(a === "--agent" || (agentIdx !== -1 && i === agentIdx + 1)));
100
- return { agent, positional };
101
- }
102
58
  export function checkArgs(command, args) {
103
59
  if (args.some((a) => a === "--help" || a === "-h"))
104
60
  return { kind: "help" };
105
- const known = COMMAND_FLAGS[command] ?? new Set();
61
+ const known = flagsFor(command);
106
62
  for (let i = 0; i < args.length; i++) {
107
63
  const arg = args[i];
64
+ if (arg === "--")
65
+ break; // POSIX end-of-flags — everything after is a positional value
108
66
  if (arg.startsWith("-")) {
109
- if (!known.has(arg))
67
+ const spec = known.get(arg);
68
+ if (!spec)
110
69
  return { kind: "unknown_flag", flag: arg };
111
- if (arg === "--limit")
112
- i++; // consumes its value
70
+ if (spec.consumesValue)
71
+ i++; // its value is not itself a flag
113
72
  }
114
73
  }
115
74
  return { kind: "ok" };
116
75
  }
76
+ /** The registry, re-exported for callers that want to enumerate commands (e.g. the dispatcher). */
77
+ export { COMMANDS };
117
78
  //# sourceMappingURL=cli-args.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cli-args.js","sourceRoot":"","sources":["../src/cli-args.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAE5D,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC;IACpC,OAAO;IACP,QAAQ;IACR,QAAQ;IACR,UAAU;IACV,cAAc;IACd,cAAc;IACd,SAAS;IACT,UAAU;IACV,UAAU;IACV,SAAS;IACT,SAAS;IACT,UAAU;IACV,SAAS;CACD,CAAC,CAAC;AAIZ,mGAAmG;AACnG,qGAAqG;AACrG,MAAM,CAAC,MAAM,KAAK,GAChB,mFAAmF;IACnF,IAAI;IACJ,mHAAmH;IACnH,uGAAuG;IACvG,IAA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