@cello-protocol/cli 0.0.51 → 0.0.52
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 +6 -7
- package/dist/arg-parse.d.ts.map +1 -1
- package/dist/arg-parse.js +8 -9
- package/dist/arg-parse.js.map +1 -1
- package/dist/bin/cello.d.ts +4 -4
- package/dist/bin/cello.js +6 -6
- package/dist/bin/cello.js.map +1 -1
- package/dist/cli-args.d.ts +11 -12
- package/dist/cli-args.d.ts.map +1 -1
- package/dist/cli-args.js +11 -12
- package/dist/cli-args.js.map +1 -1
- package/dist/commands.d.ts +7 -46
- package/dist/commands.d.ts.map +1 -1
- package/dist/commands.js +94 -171
- package/dist/commands.js.map +1 -1
- package/dist/json-out.d.ts.map +1 -1
- package/dist/json-out.js +3 -4
- package/dist/json-out.js.map +1 -1
- package/dist/parity-commands.d.ts +32 -16
- package/dist/parity-commands.d.ts.map +1 -1
- package/dist/parity-commands.js +103 -35
- package/dist/parity-commands.js.map +1 -1
- package/dist/registry.d.ts +8 -9
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +89 -48
- package/dist/registry.js.map +1 -1
- package/package.json +3 -3
package/dist/arg-parse.d.ts
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared argv parsing primitives.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* It lives here, not in cli-args.ts, so that BOTH the registry (which parses a command's args
|
|
5
|
+
* inside its run()) and cli-args (which validates them before dispatch) can use it without an
|
|
6
|
+
* import cycle: cli-args → registry → arg-parse, never back.
|
|
7
7
|
*/
|
|
8
8
|
/**
|
|
9
9
|
* Split a subcommand's argv into the `--agent <name>` flag and the remaining positionals.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* of dispatching. The flag's value is excluded ONLY when the flag exists.
|
|
11
|
+
* The flag's value is excluded ONLY when the flag exists. An unguarded `i === agentIdx + 1` filter
|
|
12
|
+
* is wrong: with --agent ABSENT, agentIdx is -1 and the predicate silently drops positional index 0
|
|
13
|
+
* — `cello moniker set Bob` / `cello contact list` would print usage instead of dispatching.
|
|
15
14
|
*/
|
|
16
15
|
export declare function splitAgentFlag(args: string[]): {
|
|
17
16
|
agent: string | undefined;
|
package/dist/arg-parse.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arg-parse.d.ts","sourceRoot":"","sources":["../src/arg-parse.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH
|
|
1
|
+
{"version":3,"file":"arg-parse.d.ts","sourceRoot":"","sources":["../src/arg-parse.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG;IAAE,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,UAAU,EAAE,MAAM,EAAE,CAAA;CAAE,CAalG"}
|
package/dist/arg-parse.js
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared argv parsing primitives.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* It lives here, not in cli-args.ts, so that BOTH the registry (which parses a command's args
|
|
5
|
+
* inside its run()) and cli-args (which validates them before dispatch) can use it without an
|
|
6
|
+
* import cycle: cli-args → registry → arg-parse, never back.
|
|
7
7
|
*/
|
|
8
8
|
/**
|
|
9
9
|
* Split a subcommand's argv into the `--agent <name>` flag and the remaining positionals.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* of dispatching. The flag's value is excluded ONLY when the flag exists.
|
|
11
|
+
* The flag's value is excluded ONLY when the flag exists. An unguarded `i === agentIdx + 1` filter
|
|
12
|
+
* is wrong: with --agent ABSENT, agentIdx is -1 and the predicate silently drops positional index 0
|
|
13
|
+
* — `cello moniker set Bob` / `cello contact list` would print usage instead of dispatching.
|
|
15
14
|
*/
|
|
16
15
|
export function splitAgentFlag(args) {
|
|
17
|
-
// POSIX `--` end-of-flags terminator
|
|
18
|
-
//
|
|
16
|
+
// POSIX `--` end-of-flags terminator: everything after the first `--` is a positional VALUE,
|
|
17
|
+
// verbatim — so a value that starts with `-` (a negative number, or an away text like
|
|
19
18
|
// "- back Monday") can be passed. --agent is recognized only BEFORE the terminator.
|
|
20
19
|
const ddIdx = args.indexOf("--");
|
|
21
20
|
const flagScan = ddIdx === -1 ? args : args.slice(0, ddIdx);
|
package/dist/arg-parse.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arg-parse.js","sourceRoot":"","sources":["../src/arg-parse.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH
|
|
1
|
+
{"version":3,"file":"arg-parse.js","sourceRoot":"","sources":["../src/arg-parse.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,IAAc;IAC3C,6FAA6F;IAC7F,sFAAsF;IACtF,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"}
|
package/dist/bin/cello.d.ts
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* cello — the CELLO CLI binary.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
5
|
+
* There is no dispatch switch here. Every command lives in the registry (src/registry.ts), which is
|
|
6
|
+
* also what renders `cello --help` and per-command help — so dispatch, the command table, and the
|
|
7
|
+
* help text cannot drift apart. Adding a command means adding one registry entry; this binary does
|
|
8
|
+
* not change.
|
|
9
9
|
*
|
|
10
10
|
* The bash-adapter contract (§3): a command's JSON result goes to stdout, a structured failure goes
|
|
11
11
|
* to stderr VERBATIM, and the exit code branches on it — so any bash-capable agent can drive a
|
package/dist/bin/cello.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* cello — the CELLO CLI binary.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
5
|
+
* There is no dispatch switch here. Every command lives in the registry (src/registry.ts), which is
|
|
6
|
+
* also what renders `cello --help` and per-command help — so dispatch, the command table, and the
|
|
7
|
+
* help text cannot drift apart. Adding a command means adding one registry entry; this binary does
|
|
8
|
+
* not change.
|
|
9
9
|
*
|
|
10
10
|
* The bash-adapter contract (§3): a command's JSON result goes to stdout, a structured failure goes
|
|
11
11
|
* to stderr VERBATIM, and the exit code branches on it — so any bash-capable agent can drive a
|
|
@@ -49,8 +49,8 @@ async function main() {
|
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
51
|
const args = process.argv.slice(3);
|
|
52
|
-
//
|
|
53
|
-
//
|
|
52
|
+
// Answer --help/-h on every subcommand and REJECT unknown flags BEFORE dispatch, so a flag can
|
|
53
|
+
// never be coerced into a positional argument.
|
|
54
54
|
const check = checkArgs(command, args);
|
|
55
55
|
if (check.kind === "help") {
|
|
56
56
|
process.stdout.write(helpForCommand(command) + "\n");
|
package/dist/bin/cello.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cello.js","sourceRoot":"","sources":["../../src/bin/cello.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;GAWG;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,cAAc,EAAE,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAClF,OAAO,EAAE,WAAW,EAAuB,MAAM,gBAAgB,CAAC;AAGlE,MAAM,MAAM,GAAW;IACrB,KAAK,CAAC,KAAa,EAAE,OAAgC;QACnD,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,EAAE,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;QACjG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;IACpC,CAAC;IACD,IAAI,CAAC,KAAa,EAAE,OAAgC;QAClD,MAAM,IA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,OAAO;IACT,CAAC;IAED,MAAM,GAAG,GAAmB;QAC1B,QAAQ;QACR,SAAS;QACT,MAAM;QACN,UAAU,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC;KACxD,CAAC;IAEF,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAEzC,kGAAkG;IAClG,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACzE,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACzE,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AAChC,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;IAC5B,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACjE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,OAAO,IAAI,CAAC,CAAC;IAC5C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/dist/cli-args.d.ts
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
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
|
-
*
|
|
6
|
-
* an unrecognized flag is REJECTED rather than coerced into a positional (
|
|
7
|
-
* `cello register --help`
|
|
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
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
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
13
|
*/
|
|
14
14
|
import { COMMANDS } from "./registry.js";
|
|
15
15
|
export { splitAgentFlag } from "./arg-parse.js";
|
|
@@ -19,10 +19,9 @@ export type KnownCommand = string;
|
|
|
19
19
|
/**
|
|
20
20
|
* The top-level `cello --help`.
|
|
21
21
|
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* with no per-command descriptions). Arguments stay in per-command `--help`.
|
|
22
|
+
* Opens with what CELLO is + the onboarding path a first-time user needs. The command list is a
|
|
23
|
+
* DESCRIBED table rendered from each registry entry's `summary`. Arguments stay in per-command
|
|
24
|
+
* `--help`.
|
|
26
25
|
*/
|
|
27
26
|
export declare const USAGE: string;
|
|
28
27
|
/** Per-command help — the registry entry's own text, verbatim. */
|
|
@@ -36,7 +35,7 @@ export type ArgsCheck = {
|
|
|
36
35
|
flag: string;
|
|
37
36
|
};
|
|
38
37
|
/**
|
|
39
|
-
*
|
|
38
|
+
* Validate a subcommand's arguments BEFORE dispatch.
|
|
40
39
|
* - --help / -h ANYWHERE → help. This is a dedicated pre-scan so help wins even when it
|
|
41
40
|
* follows an unknown flag or sits where a value-consuming flag would swallow it — asking for
|
|
42
41
|
* help must never be masked by another argument error.
|
package/dist/cli-args.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-args.d.ts","sourceRoot":"","sources":["../src/cli-args.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,QAAQ,EAA4D,MAAM,eAAe,CAAC;AAInG,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,6FAA6F;AAC7F,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,MAAM,CAA2B,CAAC;AAE3E,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAElC
|
|
1
|
+
{"version":3,"file":"cli-args.d.ts","sourceRoot":"","sources":["../src/cli-args.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,QAAQ,EAA4D,MAAM,eAAe,CAAC;AAInG,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,6FAA6F;AAC7F,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,MAAM,CAA2B,CAAC;AAE3E,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAElC;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,QAkBiF,CAAC;AAEpG,kEAAkE;AAClE,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED,MAAM,MAAM,SAAS,GACjB;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,GACd;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3C;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,SAAS,CAapE;AAED,mGAAmG;AACnG,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
package/dist/cli-args.js
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
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
|
-
*
|
|
6
|
-
* an unrecognized flag is REJECTED rather than coerced into a positional (
|
|
7
|
-
* `cello register --help`
|
|
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
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
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
13
|
*/
|
|
14
14
|
import { COMMANDS, commandNames, findCommand, flagsFor, renderCommandsTable } from "./registry.js";
|
|
15
15
|
// Re-exported for the dispatch layer and existing callers (its home is arg-parse.ts, which both
|
|
@@ -20,10 +20,9 @@ export const KNOWN_COMMANDS = new Set(commandNames());
|
|
|
20
20
|
/**
|
|
21
21
|
* The top-level `cello --help`.
|
|
22
22
|
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* with no per-command descriptions). Arguments stay in per-command `--help`.
|
|
23
|
+
* Opens with what CELLO is + the onboarding path a first-time user needs. The command list is a
|
|
24
|
+
* DESCRIBED table rendered from each registry entry's `summary`. Arguments stay in per-command
|
|
25
|
+
* `--help`.
|
|
27
26
|
*/
|
|
28
27
|
export const USAGE = "CELLO — a peer-to-peer identity & trust layer for agent-to-agent communication.\n" +
|
|
29
28
|
"\n" +
|
|
@@ -48,7 +47,7 @@ export function helpForCommand(command) {
|
|
|
48
47
|
return findCommand(command)?.help ?? USAGE;
|
|
49
48
|
}
|
|
50
49
|
/**
|
|
51
|
-
*
|
|
50
|
+
* Validate a subcommand's arguments BEFORE dispatch.
|
|
52
51
|
* - --help / -h ANYWHERE → help. This is a dedicated pre-scan so help wins even when it
|
|
53
52
|
* follows an unknown flag or sits where a value-consuming flag would swallow it — asking for
|
|
54
53
|
* help must never be masked by another argument error.
|
package/dist/cli-args.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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
|
|
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;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,KAAK,GAChB,mFAAmF;IACnF,IAAI;IACJ,yHAAyH;IACzH,uGAAuG;IACvG,IAAI;IACJ,iCAAiC;IACjC,IAAI;IACJ,mBAAmB,EAAE;IACrB,IAAI;IACJ,IAAI;IACJ,4DAA4D;IAC5D,+FAA+F;IAC/F,gGAAgG;IAChG,kGAAkG;IAClG,8FAA8F;IAC9F,sGAAsG;IACt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|
5
|
-
* 1. login(celloDir, daemonBin):
|
|
6
|
-
* - Call connectOrStart(celloDir) to either connect to existing or spawn new daemon
|
|
7
|
-
* - Print status (already running / started)
|
|
8
|
-
* - Close IPC connection and exit 0
|
|
9
|
-
*
|
|
10
|
-
* 2. logout(celloDir):
|
|
11
|
-
* - Read lock file to find socket path
|
|
12
|
-
* - Connect to daemon
|
|
13
|
-
* - Send 'shutdown' method
|
|
14
|
-
* - Wait for acknowledgement
|
|
15
|
-
* - Exit 0
|
|
16
|
-
*
|
|
17
|
-
* 3. status(celloDir):
|
|
18
|
-
* - Read lock file to find socket path
|
|
19
|
-
* - Connect to daemon
|
|
20
|
-
* - Send 'status' method
|
|
21
|
-
* - Print response as structured JSON
|
|
22
|
-
* - Exit 0
|
|
23
3
|
*/
|
|
24
4
|
import { type IpcClient, type Logger } from "@cello-protocol/daemon";
|
|
25
5
|
/**
|
|
26
6
|
* M8C-LOGINSTART-1 CORE: bring every loaded agent online. Called by `cello login` after the daemon
|
|
27
|
-
* is up. login ALWAYS completes — a per-agent start failure is COLLECTED, never thrown
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
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.
|
|
31
11
|
*/
|
|
32
12
|
export declare function autoStartAllAgents(client: IpcClient): Promise<{
|
|
33
13
|
started: string[];
|
|
@@ -43,7 +23,7 @@ export interface CommandResult {
|
|
|
43
23
|
export declare function login(celloDir: string, daemonBin: string, logger: Logger): Promise<CommandResult>;
|
|
44
24
|
/**
|
|
45
25
|
* M8C-LOGINSTART-1: compose the operator-facing auto-start summary — every failed agent enumerated
|
|
46
|
-
* by name + reason
|
|
26
|
+
* by name + reason. Pure + exported so the enumeration string is directly testable.
|
|
47
27
|
*/
|
|
48
28
|
export declare function formatLoginSummary(result: {
|
|
49
29
|
started: string[];
|
|
@@ -74,14 +54,14 @@ export declare function register(celloDir: string, agent: string, preAuthToken:
|
|
|
74
54
|
export declare function createAgent(celloDir: string, name: string): Promise<CommandResult>;
|
|
75
55
|
/**
|
|
76
56
|
* refreshShares(celloDir, name): M8B DOD-REFRESH-1.
|
|
77
|
-
* - Connect to the daemon, send 'cello_refresh_shares' with {
|
|
57
|
+
* - Connect to the daemon, send 'cello_refresh_shares' with { agent }.
|
|
78
58
|
* - The daemon runs a proactive share refresh across the consortium: every shareholder rotates its
|
|
79
59
|
* share to a new epoch, the group public key is unchanged, and old-epoch shares no longer sign.
|
|
80
60
|
*/
|
|
81
61
|
export declare function refreshShares(celloDir: string, name: string): Promise<CommandResult>;
|
|
82
62
|
/**
|
|
83
63
|
* relayReceipts(celloDir, name): M8B DOD-RELAYSIG-1.
|
|
84
|
-
* - Connect to the daemon, send 'cello_get_relay_receipts' with {
|
|
64
|
+
* - Connect to the daemon, send 'cello_get_relay_receipts' with { agent }.
|
|
85
65
|
* - Returns the agent's durably-stored, signature-verified relay ordering-record receipts.
|
|
86
66
|
*/
|
|
87
67
|
export declare function relayReceipts(celloDir: string, name: string): Promise<CommandResult>;
|
|
@@ -105,25 +85,6 @@ export declare function sessions(celloDir: string, opts?: {
|
|
|
105
85
|
filter?: SessionFilter;
|
|
106
86
|
limit?: number;
|
|
107
87
|
}): Promise<CommandResult>;
|
|
108
|
-
export declare function contactAdd(celloDir: string, pubkey: string, agent?: string): Promise<CommandResult>;
|
|
109
|
-
export declare function contactRemove(celloDir: string, pubkey: string, agent?: string): Promise<CommandResult>;
|
|
110
|
-
export declare function contactList(celloDir: string, agent?: string): Promise<CommandResult>;
|
|
111
|
-
/** DOD-CONTACT-VIEW-1: `cello contact tier <pubkey> <tier> [--agent <name>]`. Validation (a known
|
|
112
|
-
* 0..4 constant) lives daemon-side; the CLI surfaces the verdict verbatim. */
|
|
113
|
-
export declare function contactSetTier(celloDir: string, pubkey: string, tier: number, agent?: string): Promise<CommandResult>;
|
|
114
|
-
/** DOD-AWAY-TIER-1: `cello contact away <pubkey> <message> [--agent <name>]` — set a per-contact away
|
|
115
|
-
* message (or clear it with an empty message → null). */
|
|
116
|
-
export declare function contactSetAway(celloDir: string, pubkey: string, message: string | null, agent?: string): Promise<CommandResult>;
|
|
117
|
-
/** DOD-SETTINGS-SURFACE-1: `cello settings get [key] [--agent <name>]` — a single key, or all set
|
|
118
|
-
* values when no key. Validation lives daemon-side; the CLI surfaces the verdict verbatim. */
|
|
119
|
-
export declare function settingsGet(celloDir: string, key: string | undefined, agent?: string): Promise<CommandResult>;
|
|
120
|
-
/** DOD-SETTINGS-SURFACE-1: `cello settings set <key> <value> [--agent <name>]` — the daemon validates
|
|
121
|
-
* the key (known) and, for bound keys, a finite positive integer (rejects Infinity/negative/0). */
|
|
122
|
-
export declare function settingsSet(celloDir: string, key: string, value: string, agent?: string): Promise<CommandResult>;
|
|
123
|
-
/** MONIKER-1: `cello moniker set <name>` / `cello moniker clear` — set (string) or clear (null)
|
|
124
|
-
* the agent's outbound-name override via cello_set_moniker. Validation lives daemon-side
|
|
125
|
-
* (shared MONIKER-0 rule); the CLI surfaces the daemon's verdict verbatim. */
|
|
126
|
-
export declare function monikerSet(celloDir: string, moniker: string | null, agent?: string): Promise<CommandResult>;
|
|
127
88
|
/** M8C-TGDOOR-1: `cello telegram set-token <bot_token> <allowlisted_chat_id>` — persists the
|
|
128
89
|
* daemon-wide bot credentials (narrow, dedicated surface; NOT folded into the parked `cello
|
|
129
90
|
* config`, since a bot token has no sensible default and can't wait for M9-CFG-001). */
|
package/dist/commands.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../src/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