@cello-protocol/cli 0.0.306 → 0.0.308

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.
Files changed (234) hide show
  1. package/.claude-plugin/marketplace.json +15 -0
  2. package/README.md +107 -0
  3. package/dist/cli.d.ts +2 -0
  4. package/dist/cli.js +602 -0
  5. package/dist/daemon/account-page-assets.d.ts +4 -0
  6. package/dist/daemon/account-page-assets.js +160 -0
  7. package/dist/daemon/account-page.d.ts +14 -0
  8. package/dist/daemon/account-page.js +104 -0
  9. package/dist/daemon/address.d.ts +10 -0
  10. package/dist/daemon/address.js +34 -0
  11. package/dist/daemon/away.d.ts +31 -0
  12. package/dist/daemon/away.js +65 -0
  13. package/dist/daemon/channel-store.d.ts +112 -0
  14. package/dist/daemon/channel-store.js +284 -0
  15. package/dist/daemon/channels.d.ts +46 -0
  16. package/dist/daemon/channels.js +1049 -0
  17. package/dist/daemon/contacts.d.ts +26 -0
  18. package/dist/daemon/contacts.js +74 -0
  19. package/dist/daemon/engine.d.ts +82 -0
  20. package/dist/daemon/engine.js +2882 -0
  21. package/dist/daemon/errors.d.ts +5 -0
  22. package/dist/daemon/errors.js +16 -0
  23. package/dist/daemon/governance.d.ts +66 -0
  24. package/dist/daemon/governance.js +514 -0
  25. package/dist/daemon/guards.d.ts +36 -0
  26. package/dist/daemon/guards.js +140 -0
  27. package/dist/daemon/issuer-client.d.ts +56 -0
  28. package/dist/daemon/issuer-client.js +143 -0
  29. package/dist/daemon/link.d.ts +30 -0
  30. package/dist/daemon/link.js +191 -0
  31. package/dist/daemon/log.d.ts +1 -0
  32. package/dist/daemon/log.js +4 -0
  33. package/dist/daemon/main.d.ts +1 -0
  34. package/dist/daemon/main.js +513 -0
  35. package/dist/daemon/paths.d.ts +6 -0
  36. package/dist/daemon/paths.js +21 -0
  37. package/dist/daemon/pii.d.ts +24 -0
  38. package/dist/daemon/pii.js +147 -0
  39. package/dist/daemon/policy-cadence.d.ts +33 -0
  40. package/dist/daemon/policy-cadence.js +59 -0
  41. package/dist/daemon/policy-proposals.d.ts +41 -0
  42. package/dist/daemon/policy-proposals.js +83 -0
  43. package/dist/daemon/policy-store.d.ts +47 -0
  44. package/dist/daemon/policy-store.js +144 -0
  45. package/dist/daemon/presented.d.ts +36 -0
  46. package/dist/daemon/presented.js +94 -0
  47. package/dist/daemon/rate-limit.d.ts +17 -0
  48. package/dist/daemon/rate-limit.js +44 -0
  49. package/dist/daemon/reach.d.ts +62 -0
  50. package/dist/daemon/reach.js +204 -0
  51. package/dist/daemon/screening.d.ts +97 -0
  52. package/dist/daemon/screening.js +362 -0
  53. package/dist/daemon/settings.d.ts +125 -0
  54. package/dist/daemon/settings.js +73 -0
  55. package/dist/daemon/signal-rules.d.ts +55 -0
  56. package/dist/daemon/signal-rules.js +127 -0
  57. package/dist/daemon/signal-store.d.ts +53 -0
  58. package/dist/daemon/signal-store.js +114 -0
  59. package/dist/daemon/store.d.ts +189 -0
  60. package/dist/daemon/store.js +477 -0
  61. package/dist/daemon/tiers.d.ts +14 -0
  62. package/dist/daemon/tiers.js +9 -0
  63. package/dist/daemon/wallet.d.ts +73 -0
  64. package/dist/daemon/wallet.js +429 -0
  65. package/dist/daemon/who-label.d.ts +3 -0
  66. package/dist/daemon/who-label.js +11 -0
  67. package/dist/guidance.d.ts +39 -0
  68. package/dist/guidance.js +98 -0
  69. package/dist/hermes-bridge.d.ts +34 -0
  70. package/dist/hermes-bridge.js +223 -0
  71. package/dist/install-mcp.d.ts +6 -0
  72. package/dist/install-mcp.js +77 -0
  73. package/dist/ipc/client.d.ts +18 -0
  74. package/dist/ipc/client.js +107 -0
  75. package/dist/ipc/operations.d.ts +30 -0
  76. package/dist/ipc/operations.js +846 -0
  77. package/dist/ipc/protocol.d.ts +21 -0
  78. package/dist/ipc/protocol.js +1 -0
  79. package/dist/issuer-list-sign.d.ts +12 -0
  80. package/dist/issuer-list-sign.js +43 -0
  81. package/dist/local-operations.d.ts +2 -0
  82. package/dist/local-operations.js +73 -0
  83. package/dist/mcp-tools.d.ts +14 -0
  84. package/dist/mcp-tools.js +45 -0
  85. package/dist/mcp.d.ts +2 -0
  86. package/dist/mcp.js +160 -0
  87. package/dist/protocol/aead.d.ts +4 -0
  88. package/dist/protocol/aead.js +35 -0
  89. package/dist/protocol/cbor.d.ts +40 -0
  90. package/dist/protocol/cbor.js +106 -0
  91. package/dist/protocol/chain.d.ts +44 -0
  92. package/dist/protocol/chain.js +126 -0
  93. package/dist/protocol/channel.d.ts +153 -0
  94. package/dist/protocol/channel.js +298 -0
  95. package/dist/protocol/encode.d.ts +6 -0
  96. package/dist/protocol/encode.js +21 -0
  97. package/dist/protocol/identity.d.ts +27 -0
  98. package/dist/protocol/identity.js +94 -0
  99. package/dist/protocol/issuer-list.d.ts +56 -0
  100. package/dist/protocol/issuer-list.js +193 -0
  101. package/dist/protocol/issuer-roots.d.ts +6 -0
  102. package/dist/protocol/issuer-roots.js +10 -0
  103. package/dist/protocol/key-agreement.d.ts +20 -0
  104. package/dist/protocol/key-agreement.js +88 -0
  105. package/dist/protocol/merkle.d.ts +16 -0
  106. package/dist/protocol/merkle.js +166 -0
  107. package/dist/protocol/ml-dsa.d.ts +28 -0
  108. package/dist/protocol/ml-dsa.js +58 -0
  109. package/dist/protocol/ml-kem.d.ts +14 -0
  110. package/dist/protocol/ml-kem.js +57 -0
  111. package/dist/protocol/pq-errors.d.ts +9 -0
  112. package/dist/protocol/pq-errors.js +23 -0
  113. package/dist/protocol/pq-warnings.d.ts +1 -0
  114. package/dist/protocol/pq-warnings.js +18 -0
  115. package/dist/protocol/presented-signals.d.ts +17 -0
  116. package/dist/protocol/presented-signals.js +92 -0
  117. package/dist/protocol/salt.d.ts +5 -0
  118. package/dist/protocol/salt.js +47 -0
  119. package/dist/protocol/seal.d.ts +58 -0
  120. package/dist/protocol/seal.js +220 -0
  121. package/dist/protocol/signal.d.ts +54 -0
  122. package/dist/protocol/signal.js +266 -0
  123. package/dist/protocol/status.d.ts +41 -0
  124. package/dist/protocol/status.js +64 -0
  125. package/dist/protocol/structures.d.ts +359 -0
  126. package/dist/protocol/structures.js +296 -0
  127. package/dist/protocol/transcript.d.ts +61 -0
  128. package/dist/protocol/transcript.js +319 -0
  129. package/dist/protocol/wire.d.ts +212 -0
  130. package/dist/protocol/wire.js +161 -0
  131. package/dist/require-node.d.ts +1 -0
  132. package/dist/require-node.js +10 -0
  133. package/dist/screener/affordance.d.ts +1 -0
  134. package/dist/screener/affordance.js +2 -0
  135. package/dist/screener/classifier-selfcheck.d.ts +29 -0
  136. package/dist/screener/classifier-selfcheck.js +56 -0
  137. package/dist/screener/exfil.d.ts +11 -0
  138. package/dist/screener/exfil.js +45 -0
  139. package/dist/screener/gitleaks-rules.d.ts +9 -0
  140. package/dist/screener/gitleaks-rules.js +226 -0
  141. package/dist/screener/inbound.d.ts +25 -0
  142. package/dist/screener/inbound.js +102 -0
  143. package/dist/screener/injection-classifier-onnx.d.ts +20 -0
  144. package/dist/screener/injection-classifier-onnx.js +89 -0
  145. package/dist/screener/injection-classifier-wasm.d.ts +2 -0
  146. package/dist/screener/injection-classifier-wasm.js +97 -0
  147. package/dist/screener/injection-patterns.d.ts +8 -0
  148. package/dist/screener/injection-patterns.js +48 -0
  149. package/dist/screener/injection-windows.d.ts +9 -0
  150. package/dist/screener/injection-windows.js +37 -0
  151. package/dist/screener/language.d.ts +15 -0
  152. package/dist/screener/language.js +71 -0
  153. package/dist/screener/linear-regex.d.ts +8 -0
  154. package/dist/screener/linear-regex.js +27 -0
  155. package/dist/screener/model-installer.d.ts +14 -0
  156. package/dist/screener/model-installer.js +61 -0
  157. package/dist/screener/outbound.d.ts +19 -0
  158. package/dist/screener/outbound.js +62 -0
  159. package/dist/screener/sanitize.d.ts +44 -0
  160. package/dist/screener/sanitize.js +361 -0
  161. package/dist/screener/scan-variants.d.ts +5 -0
  162. package/dist/screener/scan-variants.js +146 -0
  163. package/dist/screener/screener-model-manifest.d.ts +16 -0
  164. package/dist/screener/screener-model-manifest.js +20 -0
  165. package/dist/screener/screener-state.d.ts +29 -0
  166. package/dist/screener/screener-state.js +119 -0
  167. package/dist/screener/secrets.d.ts +18 -0
  168. package/dist/screener/secrets.js +84 -0
  169. package/dist/screener/worker.d.ts +6 -0
  170. package/dist/screener/worker.js +83 -0
  171. package/dist/setup.d.ts +9 -0
  172. package/dist/setup.js +259 -0
  173. package/dist/shipped-issuer-list.d.ts +1 -0
  174. package/dist/shipped-issuer-list.js +3 -0
  175. package/dist/signals-text.d.ts +46 -0
  176. package/dist/signals-text.js +81 -0
  177. package/dist/verify-seal.d.ts +9 -0
  178. package/dist/verify-seal.js +30 -0
  179. package/hermes/plugin/__init__.py +1066 -0
  180. package/hermes/plugin/plugin.yaml +30 -0
  181. package/hermes/skills/cello-bridge-setup/SKILL.md +48 -0
  182. package/hermes/skills/cello-policy/SKILL.md +44 -0
  183. package/package.json +48 -16
  184. package/plugins/cello/.claude-plugin/plugin.json +19 -0
  185. package/plugins/cello/.mcp.json +7 -0
  186. package/plugins/cello/skills/cello/SKILL.md +117 -0
  187. package/dist/arg-parse.d.ts +0 -19
  188. package/dist/arg-parse.d.ts.map +0 -1
  189. package/dist/arg-parse.js +0 -29
  190. package/dist/arg-parse.js.map +0 -1
  191. package/dist/bin/cello.d.ts +0 -15
  192. package/dist/bin/cello.d.ts.map +0 -1
  193. package/dist/bin/cello.js +0 -110
  194. package/dist/bin/cello.js.map +0 -1
  195. package/dist/cli-args.d.ts +0 -62
  196. package/dist/cli-args.d.ts.map +0 -1
  197. package/dist/cli-args.js +0 -129
  198. package/dist/cli-args.js.map +0 -1
  199. package/dist/commands.d.ts +0 -196
  200. package/dist/commands.d.ts.map +0 -1
  201. package/dist/commands.js +0 -1544
  202. package/dist/commands.js.map +0 -1
  203. package/dist/hermes/assets.d.ts +0 -41
  204. package/dist/hermes/assets.d.ts.map +0 -1
  205. package/dist/hermes/assets.js +0 -2281
  206. package/dist/hermes/assets.js.map +0 -1
  207. package/dist/hermes/install-hermes.d.ts +0 -50
  208. package/dist/hermes/install-hermes.d.ts.map +0 -1
  209. package/dist/hermes/install-hermes.js +0 -232
  210. package/dist/hermes/install-hermes.js.map +0 -1
  211. package/dist/json-out.d.ts +0 -41
  212. package/dist/json-out.d.ts.map +0 -1
  213. package/dist/json-out.js +0 -59
  214. package/dist/json-out.js.map +0 -1
  215. package/dist/node-runtime-guard-init.d.ts +0 -6
  216. package/dist/node-runtime-guard-init.d.ts.map +0 -1
  217. package/dist/node-runtime-guard-init.js +0 -7
  218. package/dist/node-runtime-guard-init.js.map +0 -1
  219. package/dist/node-runtime-guard.d.ts +0 -48
  220. package/dist/node-runtime-guard.d.ts.map +0 -1
  221. package/dist/node-runtime-guard.js +0 -79
  222. package/dist/node-runtime-guard.js.map +0 -1
  223. package/dist/parity-commands.d.ts +0 -427
  224. package/dist/parity-commands.d.ts.map +0 -1
  225. package/dist/parity-commands.js +0 -953
  226. package/dist/parity-commands.js.map +0 -1
  227. package/dist/registry.d.ts +0 -120
  228. package/dist/registry.d.ts.map +0 -1
  229. package/dist/registry.js +0 -2169
  230. package/dist/registry.js.map +0 -1
  231. package/dist/screener-commands.d.ts +0 -85
  232. package/dist/screener-commands.d.ts.map +0 -1
  233. package/dist/screener-commands.js +0 -313
  234. package/dist/screener-commands.js.map +0 -1
package/dist/cli-args.js DELETED
@@ -1,129 +0,0 @@
1
- /**
2
- * CLI argument handling — validation that runs BEFORE dispatch, kept out of src/bin/cello.ts so the
3
- * usage surface is testable without spawning the binary.
4
- *
5
- * The rules it enforces: USAGE lists EVERY dispatchable command; every subcommand answers
6
- * --help/-h; an unrecognized flag is REJECTED rather than coerced into a positional (otherwise
7
- * `cello register --help` tries to register an agent literally named "--help").
8
- *
9
- * This module does not OWN the command list, the help text, or the flag table — it DERIVES all
10
- * three from the registry (registry.ts), the single source of truth. That is what makes drift
11
- * between dispatch, `cello --help`, and `cello <cmd> --help` structurally impossible rather than
12
- * 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 flags that come BEFORE any command — `cello --version`, `cello --help`.
22
- *
23
- * They were treated as unknown COMMANDS, so `cello --version` printed the entire help text and
24
- * exited 1. That is the first thing anyone runs to check an install, and it answered by looking
25
- * broken while being fine. `--help` had the same shape: correct output, exit 1, which is what a
26
- * script checks. The comment in `USAGE` above has always called it "the top-level `cello --help`" —
27
- * the text existed for a flag the dispatcher never actually recognised.
28
- *
29
- * Kept as a pure function here rather than an `if` in the bin, so it is testable without spawning
30
- * the binary — the reason every other argument rule lives in this module.
31
- */
32
- export function topLevelFlag(command) {
33
- if (command === "--version" || command === "-v")
34
- return "version";
35
- if (command === "--help" || command === "-h")
36
- return "help";
37
- return undefined;
38
- }
39
- /**
40
- * The top-level `cello --help`.
41
- *
42
- * Opens with what CELLO is + the onboarding path a first-time user needs. The command list is a
43
- * DESCRIBED table rendered from each registry entry's `summary`. Arguments stay in per-command
44
- * `--help`.
45
- */
46
- export const USAGE = "CELLO — a peer-to-peer identity & trust layer for agent-to-agent communication.\n" +
47
- "\n" +
48
- "First-time setup: cello login → cello create-agent <name> → cello register-agent <name> → cello status\n" +
49
- " ('cello login' starts the local daemon. The first registration on this machine prints a link and a code: open it on any device, sign in with your invited email, and approve.)\n" +
50
- "\n" +
51
- "Usage: cello <command> [args]\n" +
52
- "\n" +
53
- renderCommandsTable() +
54
- "\n" +
55
- "\n" +
56
- "Run 'cello <command> --help' for details on any command.\n" +
57
- // Scoped deliberately: only the parity commands (jsonOut) honor the full §3 contract — JSON on
58
- // stdout, structured error on stderr. Some older commands (login, logout, backup, …) still print
59
- // human text. Claiming the contract for EVERY command would be a promise the binary does not
60
- // keep, made to precisely the reader who would script against it.
61
- //
62
- // DOD-M15-CLIJSON-1: this sentence USED to name `register-agent` among the human-text commands,
63
- // and that is no longer true — it prints JSON on stdout and its guidance on stderr, on BOTH the
64
- // success and failure paths. Leaving the old wording would have told the one reader it is
65
- // addressed to — someone deciding whether to script onboarding — not to, about the command that
66
- // now supports it.
67
- "The session and agent commands (agents, use-agent, initiate-session, send, receive, close-session,\n" +
68
- "…) print JSON and exit non-zero on failure, so any bash-capable agent can drive CELLO with no MCP\n" +
69
- "dependency. Where a command has an MCP tool, it carries the SAME name: cello send ↔ cello_send.";
70
- /** Per-command help — the registry entry's own text, verbatim. */
71
- export function helpForCommand(command, args = []) {
72
- // SUB-VERB HELP WINS. `-h` is answered here, before dispatch, so a per-verb help block inside
73
- // a command's own handler could never run — `cello doc propose -h` printed the whole doc list,
74
- // which names propose's six flags and explains none of them.
75
- const sub = args.find((a) => !a.startsWith("-"));
76
- if (sub) {
77
- const spec = findCommand(command);
78
- // M16 041-HELPTRUTH item 7: a verb carrying its own `help` answers `cello <cmd> <verb> -h` with
79
- // just that verb's usage line and paragraph — the same text the full page is assembled from, so
80
- // the two cannot drift. `subHelp` (the `doc` verbs) is the older mechanism and still honoured.
81
- const verbHelp = spec?.verbs?.find((v) => v.name === sub)?.help;
82
- if (verbHelp)
83
- return verbHelp;
84
- const detail = spec?.subHelp?.[sub];
85
- if (detail)
86
- return detail;
87
- }
88
- return findCommand(command)?.help ?? USAGE;
89
- }
90
- /**
91
- * Validate a subcommand's arguments BEFORE dispatch.
92
- * - --help / -h ANYWHERE → help. This is a dedicated pre-scan so help wins even when it
93
- * follows an unknown flag or sits where a value-consuming flag would swallow it — asking for
94
- * help must never be masked by another argument error.
95
- * - any other dash-prefixed token the command does not recognize → unknown_flag
96
- * (never silently coerced into a positional).
97
- * - after a POSIX `--` terminator, everything is a positional VALUE, verbatim.
98
- */
99
- export function checkArgs(command, args) {
100
- // The help check MUST respect the `--` terminator too. It used to scan the whole argv, so
101
- // `cello attestations issue <pubkey> -- she walked me through the -h flag` printed help instead
102
- // of issuing the signal — the terminator was honoured for unknown flags and ignored for help,
103
- // which is the surprising half. Commands that take free prose (issue, consent refuse, contact
104
- // set-away) are exactly the ones where a bare `-h` appears as ordinary text.
105
- const terminator = args.indexOf("--");
106
- const flagArgs = terminator === -1 ? args : args.slice(0, terminator);
107
- if (flagArgs.some((a) => a === "--help" || a === "-h"))
108
- return { kind: "help" };
109
- const known = flagsFor(command);
110
- for (let i = 0; i < args.length; i++) {
111
- const arg = args[i];
112
- if (arg === "--")
113
- break; // POSIX end-of-flags — everything after is a positional value
114
- if (arg.startsWith("-")) {
115
- if (/^-\d+$/.test(arg) && command === "quarantined") {
116
- continue;
117
- }
118
- const spec = known.get(arg);
119
- if (!spec)
120
- return { kind: "unknown_flag", flag: arg };
121
- if (spec.consumesValue)
122
- i++; // its value is not itself a flag
123
- }
124
- }
125
- return { kind: "ok" };
126
- }
127
- /** The registry, re-exported for callers that want to enumerate commands (e.g. the dispatcher). */
128
- export { COMMANDS };
129
- //# sourceMappingURL=cli-args.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cli-args.js","sourceRoot":"","sources":["../src/cli-args.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEnG,gGAAgG;AAChG,6EAA6E;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,6FAA6F;AAC7F,MAAM,CAAC,MAAM,cAAc,GAAwB,IAAI,GAAG,CAAC,YAAY,EAAE,CAAC,CAAC;AAI3E;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,YAAY,CAAC,OAA2B;IACtD,IAAI,OAAO,KAAK,WAAW,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IAClE,IAAI,OAAO,KAAK,QA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IACH,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AACxB,CAAC;AAED,mGAAmG;AACnG,OAAO,EAAE,QAAQ,EAAE,CAAC"}
@@ -1,196 +0,0 @@
1
- /**
2
- * CLI command implementations for the `cello` binary.
3
- */
4
- import { type IpcClient, type Logger } from "@cello-protocol/daemon";
5
- /**
6
- * M8C-LOGINSTART-1 CORE: bring every loaded agent online. Called by `cello login` after the daemon
7
- * is up. login ALWAYS completes — a per-agent start failure is COLLECTED, never thrown, so one bad
8
- * agent can't abort login. `cello_start_agent` is idempotent, so re-login is safe. The per-agent
9
- * `autoStart: false` opt-out is PARKED until the M9 config store lands (D14).
10
- * Lives here rather than inline in login() so it is unit-testable against an in-process daemon.
11
- */
12
- export declare function autoStartAllAgents(client: IpcClient): Promise<{
13
- started: string[];
14
- failed: Array<{
15
- name: string;
16
- reason: string;
17
- }>;
18
- started_channels: string[];
19
- failed_channels: Array<{
20
- name: string;
21
- reason: string;
22
- }>;
23
- }>;
24
- export interface CommandResult {
25
- exitCode: number;
26
- /**
27
- * STDOUT. For a command whose help promises JSON, this must be JSON and NOTHING ELSE — see
28
- * `guidance` below for why that had to be written down.
29
- */
30
- output: string;
31
- /**
32
- * STDERR — guidance for a human, kept OUT of the data stream.
33
- *
34
- * DOD-M15-CLIJSON-1: `register-agent` used to append its "Next: run cello status…" hint to
35
- * `output`, after the JSON. It exits 0, the registration succeeds, and every consumer that parses
36
- * the output dies on the trailing prose — with a parse error naming a byte offset, so it reads as
37
- * "registration is broken" when registration is fine. Five end-to-end journeys died at their first
38
- * line on it.
39
- *
40
- * The hint is worth keeping: it is what tells a new operator that registration is asynchronous and
41
- * may take a minute. It just belongs on stderr, which is what stderr is for. A human sees both
42
- * streams in a terminal and loses nothing; a script sees clean JSON.
43
- */
44
- guidance?: string;
45
- }
46
- export declare function login(celloDir: string, daemonBin: string, logger: Logger): Promise<CommandResult>;
47
- /**
48
- * One line when the classifier is not installed-and-verified, empty when it is.
49
- *
50
- * Never throws and never blocks login: a screener check that could break sign-in would be a worse
51
- * defect than the one it reports.
52
- */
53
- export declare function screenerLoginLine(stateImpl?: () => Promise<{
54
- state: string;
55
- problem?: string;
56
- }>): Promise<string>;
57
- /**
58
- * M8C-LOGINSTART-1: compose the operator-facing auto-start summary — every failed agent enumerated
59
- * by name + reason. Pure + exported so the enumeration string is directly testable.
60
- */
61
- export declare function formatLoginSummary(result: {
62
- started: string[];
63
- failed: Array<{
64
- name: string;
65
- reason: string;
66
- }>;
67
- started_channels?: string[];
68
- failed_channels?: Array<{
69
- name: string;
70
- reason: string;
71
- }>;
72
- }): string;
73
- export declare function logout(celloDir: string, onProgress?: (line: string) => void, waitOpts?: {
74
- timeoutMs?: number;
75
- pollMs?: number;
76
- }): Promise<CommandResult>;
77
- /**
78
- * register(celloDir, agent, token):
79
- * - Refuse any token, before the daemon is asked: registration tokens are retired.
80
- * - Read the lock file to find the daemon's socket (the daemon must be running).
81
- * - With no token, pair this device first if it is not yet paired: print the approve link and
82
- * code, then wait for the approval.
83
- * - Send 'cello_register'. The daemon runs keygen and the FROST DKG with the directory, then
84
- * persists the agent's key material and registration state.
85
- * - Print structured JSON; exit 0 on success, 1 on failure.
86
- */
87
- /**
88
- * The OS opener for the approve link, or null where there is no browser to open: a Linux machine
89
- * with no display, any session over SSH, or anywhere CELLO_NO_BROWSER is set non-empty (test
90
- * harnesses). Opening is best effort and never blocks the wait.
91
- */
92
- export declare function browserOpener(platform?: NodeJS.Platform, env?: Record<string, string | undefined>): string | null;
93
- export declare function register(celloDir: string, agent: string, token: string, onProgress?: (line: string) => void): Promise<CommandResult>;
94
- /**
95
- * pairStatus(celloDir): report whether THIS DEVICE is paired — i.e. whether a directory-signed
96
- * daemon credential has been stored because the owner approved the device. Read-only and
97
- * non-blocking: it reads the pairing store, never opening, polling or waiting on a pairing, so it is
98
- * safe to call on every status poll. A hosted host agent uses it as the reliable, non-log signal
99
- * for "approved but not registered": paired:true plus an agent the directory does not yet know means
100
- * step 2 ('cello register-agent') can be finished with the stored credential WITHOUT opening a new
101
- * pairing (which would kill a live code). pending distinguishes "a code is live, still waiting" from
102
- * "no pairing at all".
103
- */
104
- export declare function pairStatus(celloDir: string): Promise<CommandResult>;
105
- /**
106
- * createAgent(celloDir, name):
107
- * - Connect to the daemon, send 'cello_create_agent' with { name }.
108
- * - The daemon generates a fresh K_local seed, writes it as an `agents` row in the encrypted DB
109
- * (PERSIST-002 — no key file), and wires the agent in so it can be registered immediately.
110
- */
111
- export declare function createAgent(celloDir: string, name: string): Promise<CommandResult>;
112
- /**
113
- * refreshShares(celloDir, name): M8B DOD-REFRESH-1.
114
- * - Connect to the daemon, send 'cello_refresh_shares' with { agent }.
115
- * - The daemon runs a proactive share refresh across the consortium: every shareholder rotates its
116
- * share to a new epoch, the group public key is unchanged, and old-epoch shares no longer sign.
117
- */
118
- export declare function refreshShares(celloDir: string, name: string): Promise<CommandResult>;
119
- /**
120
- * relayReceipts(celloDir, name): M8B DOD-RELAYSIG-1.
121
- * - Connect to the daemon, send 'cello_get_relay_receipts' with { agent }.
122
- * - Returns the agent's durably-stored, signature-verified relay ordering-record receipts.
123
- */
124
- export declare function relayReceipts(celloDir: string, name: string): Promise<CommandResult>;
125
- /**
126
- * removeAgent(celloDir, name) — CELLO-M7-REMOVE-001 (DOD-REMOVE-1):
127
- * - Connect to the daemon, send 'cello_remove_agent' with { name }.
128
- * - The daemon RETIRES the agent (state=retired; row, keys, and history KEPT for accountability) and
129
- * FREES the human name for reuse. One-way.
130
- */
131
- export declare function removeAgent(celloDir: string, name: string): Promise<CommandResult>;
132
- export declare function status(celloDir: string): Promise<CommandResult>;
133
- export type SessionFilter = "open" | "closed" | "failed" | "all";
134
- /**
135
- * `cello sessions [--open|--closed|--failed|--all] [--limit N]` — the full, queryable session
136
- * history (the discovery surface `cello status` deliberately does NOT dump). Defaults to OPEN
137
- * (live + resumable) so a long-lived agent's failed/closed history doesn't flood it, and caps the
138
- * count at the daemon's default limit. Output reports `totalMatched` so the operator can tell when
139
- * results were truncated.
140
- */
141
- export declare function sessions(celloDir: string, opts?: {
142
- filter?: SessionFilter;
143
- limit?: number;
144
- }): Promise<CommandResult>;
145
- /** M8C-TGDOOR-1: `cello telegram set-token <bot_token> <allowlisted_chat_id>` — persists the
146
- * daemon-wide bot credentials (narrow, dedicated surface; NOT folded into the parked `cello
147
- * config`, since a bot token has no sensible default and can't wait for M9-CFG-001). */
148
- /**
149
- * `cello attestations` — the M10E REVIEW system (008-ENDRENAME).
150
- *
151
- * Namespaces, service-event marks, rights, the owner index, claim-service and activity counts — a
152
- * review earned at a service event, which nothing can refuse or withdraw. The person-to-person
153
- * ENDORSEMENT (vouch + accept/refuse) that used to live under `issue`/`issued` here is now
154
- * `cello endorsements`; those two sub-verbs refuse with a rename line.
155
- */
156
- export declare function attestations(celloDir: string, sub: string, args: string[]): Promise<CommandResult>;
157
- /**
158
- * `cello endorsements` — YOUR words about ANOTHER agent, and what became of them (008-ENDRENAME).
159
- *
160
- * Split from `cello attestations` so the two systems stop sharing a word. `cello attestations` is
161
- * the M10E review system, where nothing can be refused; an ENDORSEMENT is a PERSON vouching for a
162
- * PERSON, which the subject accepts or refuses. The receiving direction is `cello endorsement-consent`.
163
- *
164
- * Subcommands:
165
- * issue <pubkey> <text…> — vouch for something you have seen them do
166
- * issued — what happened to the ones you wrote
167
- */
168
- export declare function endorsements(celloDir: string, sub: string, args: string[]): Promise<CommandResult>;
169
- /**
170
- * `cello trust-signals` — inspect and manage the operator's trust-signal wallet.
171
- *
172
- * Subcommands:
173
- * list — tabular view of all signals (includes default column)
174
- * view <hash-prefix> — full decoded payload for one signal
175
- * enable <hash-prefix> — include signal in the default presentation bundle
176
- * disable <hash-prefix> — exclude signal from the default bundle
177
- * revoke <hash-prefix> — tombstone at the directory AND hard-delete locally
178
- */
179
- export declare function trustSignals(celloDir: string, sub: string, args: string[]): Promise<CommandResult>;
180
- /**
181
- * M16 018-PUBCOLLECT — the terminal side of the four channel publishing verbs.
182
- *
183
- * These are IPC-only by order 018: an MCP tool would put "publish to every subscriber" in reach of
184
- * anything that can drive an agent's tools, and a channel's posts are the publisher's own name on
185
- * the record. The caller here is a person at a terminal, deliberately.
186
- *
187
- * ⚠️ **A REFUSAL THAT ARRIVED IS NOT AN UNREACHABLE DAEMON, and the two must not print the same.**
188
- * Most refusals come back as `{ ok: false, reason }`, but a handler that THROWS becomes an IPC
189
- * error response — which still travelled over a working socket. Printing that as
190
- * `{"daemon":"unreachable"}` sends the operator to check the socket, the lock file and the process,
191
- * none of which is the problem: the daemon answered, and what it said was `channel_group_key_unavailable`.
192
- * Only a failure to connect is reported as unreachable.
193
- */
194
- export declare function channelVerb(celloDir: string, verb: string, params: Record<string, unknown>): Promise<CommandResult>;
195
- export declare function telegramSetToken(celloDir: string, botToken: string, chatId: string): Promise<CommandResult>;
196
- //# sourceMappingURL=commands.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AAAA;;GAEG;AAQH,OAAO,EAmBL,KAAK,SAAS,EACd,KAAK,MAAM,EACZ,MAAM,wBAAwB,CAAC;AAuChC;;;;;;GAMG;AACH,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,SAAS,GAChB,OAAO,CAAC;IACT,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAChD,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,eAAe,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC1D,CAAC,CAgCD;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;;;;;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