@cello-protocol/cli 0.0.44 → 0.0.46
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 +49 -103
- package/dist/cli-args.js.map +1 -1
- package/dist/commands.d.ts.map +1 -1
- package/dist/commands.js +4 -3
- package/dist/commands.js.map +1 -1
- package/dist/hermes/assets.d.ts +2 -2
- package/dist/hermes/assets.d.ts.map +1 -1
- package/dist/hermes/assets.js +11 -11
- package/dist/hermes/install-hermes.d.ts +1 -1
- package/dist/hermes/install-hermes.js +3 -3
- package/dist/hermes/install-hermes.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 +170 -0
- package/dist/parity-commands.d.ts.map +1 -0
- package/dist/parity-commands.js +326 -0
- package/dist/parity-commands.js.map +1 -0
- package/dist/registry.d.ts +86 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +754 -0
- package/dist/registry.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,86 @@
|
|
|
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
|
+
/**
|
|
35
|
+
* DOD-ONBOARD-HELP-1 §1 — the help is GROUPED, not alphabetical, and the groups render in this
|
|
36
|
+
* order. A new user reads it top-to-bottom as the order they will actually do things: get set up,
|
|
37
|
+
* bring an agent online, hold a conversation, then look at what it produced.
|
|
38
|
+
*/
|
|
39
|
+
export declare const GROUP_ORDER: readonly ["Setup", "Agents", "Messaging", "Sessions & receipts", "Contacts", "Other"];
|
|
40
|
+
export type CommandGroup = (typeof GROUP_ORDER)[number];
|
|
41
|
+
export interface CommandSpec {
|
|
42
|
+
name: string;
|
|
43
|
+
/**
|
|
44
|
+
* Which section of `cello --help` this command appears under. Registry metadata, so the table
|
|
45
|
+
* cannot drift from dispatch — adding a command FORCES choosing where a reader will find it.
|
|
46
|
+
* Within a group, commands render in DECLARATION order (logical, not alphabetical).
|
|
47
|
+
*/
|
|
48
|
+
group: CommandGroup;
|
|
49
|
+
/** One line. Rendered as this command's row in the `cello --help` Commands: table. */
|
|
50
|
+
summary: string;
|
|
51
|
+
/** Full per-command help, printed by `cello <cmd> --help`. */
|
|
52
|
+
help: string;
|
|
53
|
+
flags?: readonly FlagSpec[];
|
|
54
|
+
/**
|
|
55
|
+
* The daemon IPC handler this command calls — i.e. the SAME handler the corresponding `cello_*`
|
|
56
|
+
* MCP tool calls. Recorded here so the parity claim (DoD §9: "every cello_* MCP tool has a cello
|
|
57
|
+
* command calling the same IPC handler") is AUDITABLE from the registry itself rather than by
|
|
58
|
+
* reading each implementation. Absent for commands that are not a single IPC call (login, logout,
|
|
59
|
+
* install) or that route to sub-handlers (contact, settings, moniker, telegram).
|
|
60
|
+
*/
|
|
61
|
+
ipcMethod?: string;
|
|
62
|
+
/**
|
|
63
|
+
* True for commands that honor the §3 bash-adapter contract (JSON to stdout, structured error
|
|
64
|
+
* VERBATIM to stderr, exit code branching on ok). Such commands automatically accept `--pretty`.
|
|
65
|
+
*/
|
|
66
|
+
jsonOut?: boolean;
|
|
67
|
+
run(ctx: CommandContext, args: string[]): Promise<CliOutput>;
|
|
68
|
+
}
|
|
69
|
+
export declare const COMMANDS: readonly CommandSpec[];
|
|
70
|
+
export declare function commandNames(): string[];
|
|
71
|
+
export declare function findCommand(name: string): CommandSpec | undefined;
|
|
72
|
+
/**
|
|
73
|
+
* The flags a command recognizes, derived from its registry entry. `--pretty` is granted
|
|
74
|
+
* automatically to every command honoring the §3 JSON contract, so it can never be forgotten.
|
|
75
|
+
*/
|
|
76
|
+
export declare function flagsFor(name: string): ReadonlyMap<string, FlagSpec>;
|
|
77
|
+
/**
|
|
78
|
+
* DOD-ONBOARD-HELP-1 §1: render the `Commands:` table GROUPED and in logical order.
|
|
79
|
+
*
|
|
80
|
+
* Flat-and-arbitrary was the reopen: `register` appeared before `create-agent`, so the table
|
|
81
|
+
* literally listed step 2 above step 1. Sections in GROUP_ORDER, commands in declaration order
|
|
82
|
+
* within each — the order a reader would actually do them. Name column is padded across the WHOLE
|
|
83
|
+
* table (not per group) so the summaries line up as one column down the page.
|
|
84
|
+
*/
|
|
85
|
+
export declare function renderCommandsTable(): string;
|
|
86
|
+
//# 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,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC;AAED,qGAAqG;AACrG,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,gGAAgG;IAChG,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;;GAIG;AACH,eAAO,MAAM,WAAW,uFAOd,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAExD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,KAAK,EAAE,YAAY,CAAC;IACpB,sFAAsF;IACtF,OAAO,EA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