@cello-protocol/cli 0.0.295 → 0.0.296
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/bin/cello.js +2 -1
- package/dist/bin/cello.js.map +1 -1
- package/dist/commands.d.ts +18 -14
- package/dist/commands.d.ts.map +1 -1
- package/dist/commands.js +424 -25
- package/dist/commands.js.map +1 -1
- package/dist/parity-commands.d.ts +9 -9
- package/dist/parity-commands.d.ts.map +1 -1
- package/dist/parity-commands.js +14 -13
- package/dist/parity-commands.js.map +1 -1
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +86 -31
- package/dist/registry.js.map +1 -1
- package/package.json +4 -4
package/dist/bin/cello.js
CHANGED
|
@@ -91,7 +91,8 @@ async function main() {
|
|
|
91
91
|
celloDir,
|
|
92
92
|
daemonBin,
|
|
93
93
|
logger,
|
|
94
|
-
|
|
94
|
+
// DOD-M15-CLIJSON-1: progress is for the human, so it goes to stderr; stdout is the JSON result.
|
|
95
|
+
onProgress: (line) => process.stderr.write(line + "\n"),
|
|
95
96
|
};
|
|
96
97
|
const result = await spec.run(ctx, args);
|
|
97
98
|
// Report the outcome, never the intent: stdout carries the result, stderr the structured failure.
|
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,+BAA+B,CAAC;AACvC,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,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAChG,OAAO,EAAE,WAAW,EAAuB,MAAM,gBAAg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AAC,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/commands.d.ts
CHANGED
|
@@ -75,9 +75,8 @@ export declare function logout(celloDir: string, onProgress?: (line: string) =>
|
|
|
75
75
|
pollMs?: number;
|
|
76
76
|
}): Promise<CommandResult>;
|
|
77
77
|
/**
|
|
78
|
-
* register(celloDir, agent,
|
|
79
|
-
* - Refuse any token
|
|
80
|
-
* is asked.
|
|
78
|
+
* register(celloDir, agent, token):
|
|
79
|
+
* - Refuse any token, before the daemon is asked: registration tokens are retired.
|
|
81
80
|
* - Read the lock file to find the daemon's socket (the daemon must be running).
|
|
82
81
|
* - With no token, pair this device first if it is not yet paired: print the approve link and
|
|
83
82
|
* code, then wait for the approval.
|
|
@@ -90,7 +89,7 @@ export declare function logout(celloDir: string, onProgress?: (line: string) =>
|
|
|
90
89
|
* with no display, or any session over SSH. Opening is best effort and never blocks the wait.
|
|
91
90
|
*/
|
|
92
91
|
export declare function browserOpener(platform?: NodeJS.Platform, env?: Record<string, string | undefined>): string | null;
|
|
93
|
-
export declare function register(celloDir: string, agent: string,
|
|
92
|
+
export declare function register(celloDir: string, agent: string, token: string, onProgress?: (line: string) => void): Promise<CommandResult>;
|
|
94
93
|
/**
|
|
95
94
|
* createAgent(celloDir, name):
|
|
96
95
|
* - Connect to the daemon, send 'cello_create_agent' with { name }.
|
|
@@ -135,21 +134,26 @@ export declare function sessions(celloDir: string, opts?: {
|
|
|
135
134
|
* daemon-wide bot credentials (narrow, dedicated surface; NOT folded into the parked `cello
|
|
136
135
|
* config`, since a bot token has no sensible default and can't wait for M9-CFG-001). */
|
|
137
136
|
/**
|
|
138
|
-
* `cello attestations` —
|
|
137
|
+
* `cello attestations` — the M10E REVIEW system (008-ENDRENAME).
|
|
139
138
|
*
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
|
|
139
|
+
* Namespaces, service-event marks, rights, the owner index, claim-service and activity counts — a
|
|
140
|
+
* review earned at a service event, which nothing can refuse or withdraw. The person-to-person
|
|
141
|
+
* ENDORSEMENT (vouch + accept/refuse) that used to live under `issue`/`issued` here is now
|
|
142
|
+
* `cello endorsements`; those two sub-verbs refuse with a rename line.
|
|
143
|
+
*/
|
|
144
|
+
export declare function attestations(celloDir: string, sub: string, args: string[]): Promise<CommandResult>;
|
|
145
|
+
/**
|
|
146
|
+
* `cello endorsements` — YOUR words about ANOTHER agent, and what became of them (008-ENDRENAME).
|
|
147
|
+
*
|
|
148
|
+
* Split from `cello attestations` so the two systems stop sharing a word. `cello attestations` is
|
|
149
|
+
* the M10E review system, where nothing can be refused; an ENDORSEMENT is a PERSON vouching for a
|
|
150
|
+
* PERSON, which the subject accepts or refuses. The receiving direction is `cello endorsement-consent`.
|
|
145
151
|
*
|
|
146
152
|
* Subcommands:
|
|
147
|
-
* issue <pubkey> <text…> —
|
|
153
|
+
* issue <pubkey> <text…> — vouch for something you have seen them do
|
|
148
154
|
* issued — what happened to the ones you wrote
|
|
149
|
-
*
|
|
150
|
-
* The receiving direction — what others wrote about YOU — is `cello attestation-consent`.
|
|
151
155
|
*/
|
|
152
|
-
export declare function
|
|
156
|
+
export declare function endorsements(celloDir: string, sub: string, args: string[]): Promise<CommandResult>;
|
|
153
157
|
/**
|
|
154
158
|
* `cello trust-signals` — inspect and manage the operator's trust-signal wallet.
|
|
155
159
|
*
|
package/dist/commands.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AAAA;;GAEG;AAOH,OAAO,EAmBL,KAAK,SAAS,EACd,KAAK,MAAM,EACZ,MAAM,wBAAwB,CAAC;AAyBhC;;;;;;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;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB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;;;;;GAMG;AACH,wBAAsB,QAAQ,CAC5B,QAAQ,EAAE,MAAM,EAChB,IAAI,GAAE;IAAE,MAAM,CAAC,EAAE,aAAa,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAO,GACpD,OAAO,CAAC,aAAa,CAAC,CAqBxB;AAED;;yFAEyF;AACzF;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAChC,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EAAE,GACb,OAAO,CAAC,aAAa,CAAC,CAkYxB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,YAAY,CAChC,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EAAE,GACb,OAAO,CAAC,aAAa,CAAC,CA+IxB;AAED;;;;;;;;;GASG;AACH,wBAAsB,YAAY,CAChC,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EAAE,GACb,OAAO,CAAC,aAAa,CAAC,CAsOxB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,WAAW,CAC/B,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9B,OAAO,CAAC,aAAa,CAAC,CA4BxB;AAED,wBAAsB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAgBjH"}
|
package/dist/commands.js
CHANGED
|
@@ -356,9 +356,8 @@ waitOpts) {
|
|
|
356
356
|
};
|
|
357
357
|
}
|
|
358
358
|
/**
|
|
359
|
-
* register(celloDir, agent,
|
|
360
|
-
* - Refuse any token
|
|
361
|
-
* is asked.
|
|
359
|
+
* register(celloDir, agent, token):
|
|
360
|
+
* - Refuse any token, before the daemon is asked: registration tokens are retired.
|
|
362
361
|
* - Read the lock file to find the daemon's socket (the daemon must be running).
|
|
363
362
|
* - With no token, pair this device first if it is not yet paired: print the approve link and
|
|
364
363
|
* code, then wait for the approval.
|
|
@@ -394,7 +393,7 @@ function openBrowser(url) {
|
|
|
394
393
|
function displayCode(code) {
|
|
395
394
|
return code.length === 8 ? `${code.slice(0, 4)}-${code.slice(4)}` : code;
|
|
396
395
|
}
|
|
397
|
-
export async function register(celloDir, agent,
|
|
396
|
+
export async function register(celloDir, agent, token, onProgress) {
|
|
398
397
|
// Failures print JSON on stdout, with the prose in `guidance` on stderr, so a script that parses
|
|
399
398
|
// the output reads the reason instead of a parse error.
|
|
400
399
|
const fail = (reason, guidance) => ({
|
|
@@ -405,9 +404,8 @@ export async function register(celloDir, agent, devToken, onProgress) {
|
|
|
405
404
|
if (!agent) {
|
|
406
405
|
return fail("missing_agent_name", "You didn't name an agent to register. Usage: cello register-agent <agent>. See your agents with 'cello status'.");
|
|
407
406
|
}
|
|
408
|
-
//
|
|
409
|
-
|
|
410
|
-
if (devToken !== "" && !devToken.startsWith("DEV-")) {
|
|
407
|
+
// Every registration pairs this device; no directory accepts a token.
|
|
408
|
+
if (token !== "") {
|
|
411
409
|
return fail("token_retired", "CELLO no longer uses registration tokens. Run 'cello register-agent <name>' with no token; the first time on this machine it shows a link to approve this device.");
|
|
412
410
|
}
|
|
413
411
|
const lockFilePath = join(celloDir, "daemon.lock");
|
|
@@ -417,7 +415,7 @@ export async function register(celloDir, agent, devToken, onProgress) {
|
|
|
417
415
|
}
|
|
418
416
|
try {
|
|
419
417
|
const { result, sharePubkey } = await withIpc(lock.socketPath, async (client) => {
|
|
420
|
-
|
|
418
|
+
{
|
|
421
419
|
// This device presents its own credential, pairing first if it has none.
|
|
422
420
|
const start = (await client.send("cello_pair_start"));
|
|
423
421
|
if (!start.ok)
|
|
@@ -432,7 +430,7 @@ export async function register(celloDir, agent, devToken, onProgress) {
|
|
|
432
430
|
onProgress?.("This device is paired.");
|
|
433
431
|
}
|
|
434
432
|
}
|
|
435
|
-
const reg = (await client.send("cello_register", { agent
|
|
433
|
+
const reg = (await client.send("cello_register", { agent }));
|
|
436
434
|
if (!reg.ok)
|
|
437
435
|
return { result: reg, sharePubkey: undefined };
|
|
438
436
|
const list = (await client.send("cello_list_agents"));
|
|
@@ -706,21 +704,422 @@ export async function sessions(celloDir, opts = {}) {
|
|
|
706
704
|
* daemon-wide bot credentials (narrow, dedicated surface; NOT folded into the parked `cello
|
|
707
705
|
* config`, since a bot token has no sensible default and can't wait for M9-CFG-001). */
|
|
708
706
|
/**
|
|
709
|
-
* `cello attestations` —
|
|
707
|
+
* `cello attestations` — the M10E REVIEW system (008-ENDRENAME).
|
|
710
708
|
*
|
|
711
|
-
*
|
|
712
|
-
*
|
|
713
|
-
*
|
|
714
|
-
*
|
|
715
|
-
|
|
709
|
+
* Namespaces, service-event marks, rights, the owner index, claim-service and activity counts — a
|
|
710
|
+
* review earned at a service event, which nothing can refuse or withdraw. The person-to-person
|
|
711
|
+
* ENDORSEMENT (vouch + accept/refuse) that used to live under `issue`/`issued` here is now
|
|
712
|
+
* `cello endorsements`; those two sub-verbs refuse with a rename line.
|
|
713
|
+
*/
|
|
714
|
+
export async function attestations(celloDir, sub, args) {
|
|
715
|
+
// 008-ENDRENAME — `issue`/`issued` are the person-to-person ENDORSEMENT, now `cello endorsements`.
|
|
716
|
+
// A CLI is typed by a person, so point them at the new name and act on nothing, rather than
|
|
717
|
+
// silently aliasing. The MCP tools keep deprecated aliases; a typed command does not need one.
|
|
718
|
+
if (sub === "issue" || sub === "issued") {
|
|
719
|
+
return { exitCode: 1, output: `renamed: use \`cello endorsements ${sub}\`` };
|
|
720
|
+
}
|
|
721
|
+
const lockFilePath = join(celloDir, "daemon.lock");
|
|
722
|
+
const lock = await readLock(lockFilePath);
|
|
723
|
+
if (!lock) {
|
|
724
|
+
return { exitCode: 1, output: "No daemon running. Run 'cello login' first." };
|
|
725
|
+
}
|
|
726
|
+
// M10E 003-NSCLIENT — attestation namespaces.
|
|
727
|
+
if (sub === "namespace") {
|
|
728
|
+
const [action, ns, ...flags] = args;
|
|
729
|
+
if (action === "create") {
|
|
730
|
+
let mode;
|
|
731
|
+
let condition;
|
|
732
|
+
let scored = false;
|
|
733
|
+
let ttl;
|
|
734
|
+
for (let i = 0; i < flags.length; i++) {
|
|
735
|
+
if (flags[i] === "--mode")
|
|
736
|
+
mode = flags[++i];
|
|
737
|
+
else if (flags[i] === "--scored")
|
|
738
|
+
scored = true;
|
|
739
|
+
else if (flags[i] === "--ttl")
|
|
740
|
+
ttl = Number(flags[++i]);
|
|
741
|
+
else if (flags[i] === "--condition")
|
|
742
|
+
condition = flags[++i];
|
|
743
|
+
}
|
|
744
|
+
if (!ns || !mode || !condition) {
|
|
745
|
+
return {
|
|
746
|
+
exitCode: 1,
|
|
747
|
+
output: 'Usage: cello attestations namespace create <ns> --mode <public|private> [--scored] [--ttl <days>] --condition "<words>"\n' +
|
|
748
|
+
"\n" +
|
|
749
|
+
" <ns> 1–3 dotted segments, e.g. reviews.prop_8821\n" +
|
|
750
|
+
" --mode public (anyone reads the reviews) or private (chosen readers)\n" +
|
|
751
|
+
" --scored a 1–5 rating plus text; omit for text-only\n" +
|
|
752
|
+
" --ttl how many days a reviewer has, 7–180 (default 30)\n" +
|
|
753
|
+
" --condition the plain-words rule under which the right to review is granted",
|
|
754
|
+
};
|
|
755
|
+
}
|
|
756
|
+
try {
|
|
757
|
+
const params = { namespace: ns, mode, scored, condition };
|
|
758
|
+
if (ttl !== undefined)
|
|
759
|
+
params.ttl_days = ttl;
|
|
760
|
+
const result = (await withIpc(lock.socketPath, (client) => client.send("cello_attestations_namespace_create", params)));
|
|
761
|
+
if (!result.ok)
|
|
762
|
+
return { exitCode: 1, output: `${result.reason}\n${result.guidance ?? ""}`.trim() };
|
|
763
|
+
return { exitCode: 0, output: result.guidance ?? "Created." };
|
|
764
|
+
}
|
|
765
|
+
catch (err) {
|
|
766
|
+
return { exitCode: 1, output: `Could not reach the daemon: ${err instanceof Error ? err.message : String(err)}` };
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
if (action === "close") {
|
|
770
|
+
if (!ns)
|
|
771
|
+
return { exitCode: 1, output: "Usage: cello attestations namespace close <ns>" };
|
|
772
|
+
try {
|
|
773
|
+
const result = (await withIpc(lock.socketPath, (client) => client.send("cello_attestations_namespace_close", { namespace: ns })));
|
|
774
|
+
if (!result.ok)
|
|
775
|
+
return { exitCode: 1, output: `${result.reason}\n${result.guidance ?? ""}`.trim() };
|
|
776
|
+
return { exitCode: 0, output: result.guidance ?? "Closed." };
|
|
777
|
+
}
|
|
778
|
+
catch (err) {
|
|
779
|
+
return { exitCode: 1, output: `Could not reach the daemon: ${err instanceof Error ? err.message : String(err)}` };
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
return { exitCode: 1, output: "Usage:\n cello attestations namespace create <ns> --mode <public|private> [--scored] [--ttl <days>] --condition \"<words>\"\n cello attestations namespace close <ns>" };
|
|
783
|
+
}
|
|
784
|
+
if (sub === "index") {
|
|
785
|
+
let owner;
|
|
786
|
+
let after;
|
|
787
|
+
for (let i = 0; i < args.length; i++) {
|
|
788
|
+
if (args[i] === "--after")
|
|
789
|
+
after = args[++i];
|
|
790
|
+
else if (!args[i].startsWith("--"))
|
|
791
|
+
owner = args[i];
|
|
792
|
+
}
|
|
793
|
+
try {
|
|
794
|
+
const params = {};
|
|
795
|
+
if (owner)
|
|
796
|
+
params.owner_pubkey = owner;
|
|
797
|
+
if (after)
|
|
798
|
+
params.after = after;
|
|
799
|
+
const result = (await withIpc(lock.socketPath, (client) => client.send("cello_attestations_index", params)));
|
|
800
|
+
if (!result.ok)
|
|
801
|
+
return { exitCode: 1, output: `${result.reason}\n${result.guidance ?? ""}`.trim() };
|
|
802
|
+
const entries = result.entries ?? [];
|
|
803
|
+
if (entries.length === 0)
|
|
804
|
+
return { exitCode: 0, output: "No namespaces." };
|
|
805
|
+
const lines = entries.map((e) => {
|
|
806
|
+
const ttl = e.right_ttl_days === null ? "—" : `${e.right_ttl_days}d`;
|
|
807
|
+
const state = e.closed_at === null ? "open" : "closed";
|
|
808
|
+
const flag = e.verified ? "" : " UNVERIFIED";
|
|
809
|
+
return ` ${e.namespace.padEnd(28)} ${(e.mode ?? "—").padEnd(8)} ${(e.template ?? "—").padEnd(7)} ${ttl.padEnd(5)} ${state}${flag}`;
|
|
810
|
+
});
|
|
811
|
+
const more = result.next ? `\n\n More — cello attestations index ${owner ?? ""} --after ${result.next}` : "";
|
|
812
|
+
return { exitCode: 0, output: lines.join("\n") + more };
|
|
813
|
+
}
|
|
814
|
+
catch (err) {
|
|
815
|
+
return { exitCode: 1, output: `Could not reach the daemon: ${err instanceof Error ? err.message : String(err)}` };
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
// M10E 005-SVCCLIENT — mark a service event while a session is open.
|
|
819
|
+
if (sub === "mark") {
|
|
820
|
+
const [sessionId, ns, ...flags] = args;
|
|
821
|
+
let originChannel;
|
|
822
|
+
for (let i = 0; i < flags.length; i++) {
|
|
823
|
+
if (flags[i] === "--origin-channel")
|
|
824
|
+
originChannel = flags[++i];
|
|
825
|
+
}
|
|
826
|
+
if (!sessionId || !ns) {
|
|
827
|
+
return { exitCode: 1, output: "Usage: cello attestations mark <session-id> <namespace> [--origin-channel <pubkey>]" };
|
|
828
|
+
}
|
|
829
|
+
try {
|
|
830
|
+
const params = { session_id: sessionId, namespace: ns };
|
|
831
|
+
if (originChannel)
|
|
832
|
+
params.origin_channel = originChannel;
|
|
833
|
+
const result = (await withIpc(lock.socketPath, (client) => client.send("cello_attestations_mark", params)));
|
|
834
|
+
if (!result.ok)
|
|
835
|
+
return { exitCode: 1, output: `${result.reason}\n${result.guidance ?? ""}`.trim() };
|
|
836
|
+
return { exitCode: 0, output: result.guidance ?? "Marked." };
|
|
837
|
+
}
|
|
838
|
+
catch (err) {
|
|
839
|
+
return { exitCode: 1, output: `Could not reach the daemon: ${err instanceof Error ? err.message : String(err)}` };
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
// M10E 005-SVCCLIENT — the rights this agent holds (expired ones shown, flagged).
|
|
843
|
+
if (sub === "rights") {
|
|
844
|
+
let after;
|
|
845
|
+
for (let i = 0; i < args.length; i++) {
|
|
846
|
+
if (args[i] === "--after")
|
|
847
|
+
after = args[++i];
|
|
848
|
+
}
|
|
849
|
+
try {
|
|
850
|
+
const params = {};
|
|
851
|
+
if (after)
|
|
852
|
+
params.after = after;
|
|
853
|
+
const result = (await withIpc(lock.socketPath, (client) => client.send("cello_attestations_rights", params)));
|
|
854
|
+
if (!result.ok)
|
|
855
|
+
return { exitCode: 1, output: `${result.reason}\n${result.guidance ?? ""}`.trim() };
|
|
856
|
+
const rights = result.rights ?? [];
|
|
857
|
+
if (rights.length === 0)
|
|
858
|
+
return { exitCode: 0, output: "No rights." };
|
|
859
|
+
const lines = rights.map((r) => {
|
|
860
|
+
const flag = r.expired ? " EXPIRED" : "";
|
|
861
|
+
return ` ${r.namespace.padEnd(28)} ${(r.template ?? "—").padEnd(7)} ${r.subject_pubkey.slice(0, 16)}… ${r.right_id.slice(0, 16)}…${flag}`;
|
|
862
|
+
});
|
|
863
|
+
const more = result.next ? `\n\n More — cello attestations rights --after ${result.next}` : "";
|
|
864
|
+
return { exitCode: 0, output: lines.join("\n") + more };
|
|
865
|
+
}
|
|
866
|
+
catch (err) {
|
|
867
|
+
return { exitCode: 1, output: `Could not reach the daemon: ${err instanceof Error ? err.message : String(err)}` };
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
// M10E 013-PRIVATE — the readers of a PRIVATE namespace (owner only).
|
|
871
|
+
// cello attestations readers list <ns>
|
|
872
|
+
// cello attestations readers add|remove <ns> <pubkey>
|
|
873
|
+
if (sub === "readers") {
|
|
874
|
+
const [action, ns, pubkey] = args;
|
|
875
|
+
if (action === "list") {
|
|
876
|
+
if (!ns)
|
|
877
|
+
return { exitCode: 1, output: "Usage: cello attestations readers list <ns>" };
|
|
878
|
+
try {
|
|
879
|
+
const result = (await withIpc(lock.socketPath, (client) => client.send("cello_attestations_readers_list", { namespace: ns })));
|
|
880
|
+
if (!result.ok)
|
|
881
|
+
return { exitCode: 1, output: `${result.reason}\n${result.guidance ?? ""}`.trim() };
|
|
882
|
+
const readers = result.readers ?? [];
|
|
883
|
+
const body = readers.length === 0 ? "No readers." : readers.map((r) => ` ${r}`).join("\n");
|
|
884
|
+
return { exitCode: 0, output: `${body}\n\n ${result.guidance ?? ""}`.trimEnd() };
|
|
885
|
+
}
|
|
886
|
+
catch (err) {
|
|
887
|
+
return { exitCode: 1, output: `Could not reach the daemon: ${err instanceof Error ? err.message : String(err)}` };
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
if (action === "add" || action === "remove") {
|
|
891
|
+
if (!ns || !pubkey || !/^[0-9a-f]{64}$/i.test(pubkey)) {
|
|
892
|
+
return { exitCode: 1, output: `Usage: cello attestations readers ${action} <ns> <pubkey-64hex>` };
|
|
893
|
+
}
|
|
894
|
+
try {
|
|
895
|
+
const verb = action === "add" ? "cello_attestations_readers_add" : "cello_attestations_readers_remove";
|
|
896
|
+
const result = (await withIpc(lock.socketPath, (client) => client.send(verb, { namespace: ns, pubkey: pubkey.toLowerCase() })));
|
|
897
|
+
if (!result.ok)
|
|
898
|
+
return { exitCode: 1, output: `${result.reason}\n${result.guidance ?? ""}`.trim() };
|
|
899
|
+
return { exitCode: 0, output: result.guidance ?? "Reader list updated." };
|
|
900
|
+
}
|
|
901
|
+
catch (err) {
|
|
902
|
+
return { exitCode: 1, output: `Could not reach the daemon: ${err instanceof Error ? err.message : String(err)}` };
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
return { exitCode: 1, output: "Usage:\n cello attestations readers list <ns>\n cello attestations readers add <ns> <pubkey>\n cello attestations readers remove <ns> <pubkey>" };
|
|
906
|
+
}
|
|
907
|
+
// M10E 011-CLAIM — write a review for a right you hold. Text after `--`, so it can contain flags
|
|
908
|
+
// or dashes without being parsed. `cello attestations write <right-id> [--rating N] [--origin-channel pk] -- <text…>`
|
|
909
|
+
if (sub === "write") {
|
|
910
|
+
const [rightId, ...rest] = args;
|
|
911
|
+
let rating;
|
|
912
|
+
let originChannel;
|
|
913
|
+
const textParts = [];
|
|
914
|
+
for (let i = 0; i < rest.length; i++) {
|
|
915
|
+
if (rest[i] === "--rating")
|
|
916
|
+
rating = Number(rest[++i]);
|
|
917
|
+
else if (rest[i] === "--origin-channel")
|
|
918
|
+
originChannel = rest[++i];
|
|
919
|
+
else if (rest[i] === "--") {
|
|
920
|
+
textParts.push(...rest.slice(i + 1));
|
|
921
|
+
break;
|
|
922
|
+
}
|
|
923
|
+
else
|
|
924
|
+
textParts.push(rest[i]);
|
|
925
|
+
}
|
|
926
|
+
const text = textParts.join(" ").trim();
|
|
927
|
+
if (!rightId || text.length === 0) {
|
|
928
|
+
return { exitCode: 1, output: 'Usage: cello attestations write <right-id> [--rating <1-5>] [--origin-channel <pubkey>] -- <review text>' };
|
|
929
|
+
}
|
|
930
|
+
try {
|
|
931
|
+
const params = { right_id: rightId, text };
|
|
932
|
+
if (rating !== undefined)
|
|
933
|
+
params.rating = rating;
|
|
934
|
+
if (originChannel)
|
|
935
|
+
params.origin_channel = originChannel;
|
|
936
|
+
const result = (await withIpc(lock.socketPath, (client) => client.send("cello_attestations_write", params)));
|
|
937
|
+
if (!result.ok)
|
|
938
|
+
return { exitCode: 1, output: `${result.reason}\n${result.guidance ?? ""}`.trim() };
|
|
939
|
+
return { exitCode: 0, output: result.guidance ?? "Review submitted." };
|
|
940
|
+
}
|
|
941
|
+
catch (err) {
|
|
942
|
+
return { exitCode: 1, output: `Could not reach the daemon: ${err instanceof Error ? err.message : String(err)}` };
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
// M10E 011-CLAIM — the reviews you have written, each with its submission outcome.
|
|
946
|
+
if (sub === "written") {
|
|
947
|
+
try {
|
|
948
|
+
const result = (await withIpc(lock.socketPath, (client) => client.send("cello_attestations_written", {})));
|
|
949
|
+
if (!result.ok)
|
|
950
|
+
return { exitCode: 1, output: `${result.reason}\n${result.guidance ?? ""}`.trim() };
|
|
951
|
+
const claimed = result.claimed ?? [];
|
|
952
|
+
if (claimed.length === 0)
|
|
953
|
+
return { exitCode: 0, output: "No reviews written." };
|
|
954
|
+
const lines = claimed.map((c) => {
|
|
955
|
+
const score = c.rating === null ? "—" : `${c.rating}/5`;
|
|
956
|
+
return ` ${c.namespace.padEnd(28)} ${c.subject_pubkey.slice(0, 16)}… ${score.padEnd(4)} ${c.outcome.padEnd(8)} ${c.submission_id.slice(0, 16)}…`;
|
|
957
|
+
});
|
|
958
|
+
const note = result.results_unavailable ? `\n\n Outcomes could not be read now (${result.results_unavailable}); they show 'pending'. Nothing is lost.` : "";
|
|
959
|
+
return { exitCode: 0, output: lines.join("\n") + note };
|
|
960
|
+
}
|
|
961
|
+
catch (err) {
|
|
962
|
+
return { exitCode: 1, output: `Could not reach the daemon: ${err instanceof Error ? err.message : String(err)}` };
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
// M10E 007-NOTICES — file a service-received claim for a session that earned no right.
|
|
966
|
+
if (sub === "claim-service") {
|
|
967
|
+
const [sessionId, ns] = args;
|
|
968
|
+
if (!sessionId || !ns) {
|
|
969
|
+
return { exitCode: 1, output: "Usage: cello attestations claim-service <session-id> <namespace>" };
|
|
970
|
+
}
|
|
971
|
+
try {
|
|
972
|
+
const result = (await withIpc(lock.socketPath, (client) => client.send("cello_attestations_claim_service", { session_id: sessionId, namespace: ns })));
|
|
973
|
+
if (!result.ok)
|
|
974
|
+
return { exitCode: 1, output: `${result.reason}\n${result.guidance ?? ""}`.trim() };
|
|
975
|
+
return { exitCode: 0, output: result.guidance ?? "Claim filed." };
|
|
976
|
+
}
|
|
977
|
+
catch (err) {
|
|
978
|
+
return { exitCode: 1, output: `Could not reach the daemon: ${err instanceof Error ? err.message : String(err)}` };
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
// M10E 015-READ — a buyer reads a namespace's summary from a MAJORITY of directories.
|
|
982
|
+
// cello attestations summary <owner> <namespace>
|
|
983
|
+
if (sub === "summary") {
|
|
984
|
+
const [owner, ns] = args;
|
|
985
|
+
if (!owner || !ns)
|
|
986
|
+
return { exitCode: 1, output: "Usage: cello attestations summary <owner-pubkey> <namespace>" };
|
|
987
|
+
try {
|
|
988
|
+
const result = (await withIpc(lock.socketPath, (client) => client.send("cello_attestations_summary", { owner_pubkey: owner, namespace: ns })));
|
|
989
|
+
if (!result.ok)
|
|
990
|
+
return { exitCode: 1, output: `${result.reason}\n${result.guidance ?? ""}`.trim() };
|
|
991
|
+
const avg = result.average_rating === null || result.average_rating === undefined ? "—" : result.average_rating.toFixed(2);
|
|
992
|
+
return { exitCode: 0, output: ` ${ns}\n reviews: ${result.count ?? 0}\n average rating: ${avg}\n removed by ruling: ${result.removed_count ?? 0}\n unmarked claims: ${result.unmarked_claims ?? 0}\n directories agreed: ${result.agreed ?? 0} of ${result.validators ?? 0}` };
|
|
993
|
+
}
|
|
994
|
+
catch (err) {
|
|
995
|
+
return { exitCode: 1, output: `Could not reach the daemon: ${err instanceof Error ? err.message : String(err)}` };
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
// M10E 015-READ — the reviews themselves, each verified against the majority root.
|
|
999
|
+
// cello attestations reviews <owner> <namespace>
|
|
1000
|
+
if (sub === "reviews") {
|
|
1001
|
+
const [owner, ns] = args;
|
|
1002
|
+
if (!owner || !ns)
|
|
1003
|
+
return { exitCode: 1, output: "Usage: cello attestations reviews <owner-pubkey> <namespace>" };
|
|
1004
|
+
try {
|
|
1005
|
+
const result = (await withIpc(lock.socketPath, (client) => client.send("cello_attestations_reviews", { owner_pubkey: owner, namespace: ns })));
|
|
1006
|
+
if (!result.ok)
|
|
1007
|
+
return { exitCode: 1, output: `${result.reason}\n${result.guidance ?? ""}`.trim() };
|
|
1008
|
+
const reviews = result.reviews ?? [];
|
|
1009
|
+
const removed = result.removed ?? [];
|
|
1010
|
+
// Review text is quoted, untrusted data — shown indented under a label, never as a bare line
|
|
1011
|
+
// that could read as an instruction.
|
|
1012
|
+
const body = reviews.length === 0 ? "No reviews." : reviews.map((r) => {
|
|
1013
|
+
const score = r.rating === null ? "—" : `${r.rating}/5`;
|
|
1014
|
+
return ` [${r.index}] ${score} review (quoted, untrusted):\n ${r.quoted_text.replace(/\n/g, "\n ")}`;
|
|
1015
|
+
}).join("\n");
|
|
1016
|
+
const removedBlock = removed.length === 0 ? "" : "\n\n Removed by ruling:\n" + removed.map((rm) => ` ${rm.attestation_hash.slice(0, 16)}… reason: ${rm.reason}`).join("\n");
|
|
1017
|
+
return { exitCode: 0, output: ` ${ns} — ${result.count ?? 0} verified, ${result.agreed ?? 0} directories agreed\n${body}${removedBlock}` };
|
|
1018
|
+
}
|
|
1019
|
+
catch (err) {
|
|
1020
|
+
return { exitCode: 1, output: `Could not reach the daemon: ${err instanceof Error ? err.message : String(err)}` };
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
// M10E 015-READ — a channel's deals and average rating, read from the home directory.
|
|
1024
|
+
// cello attestations deals <channel-pubkey>
|
|
1025
|
+
if (sub === "deals") {
|
|
1026
|
+
const [channel] = args;
|
|
1027
|
+
if (!channel)
|
|
1028
|
+
return { exitCode: 1, output: "Usage: cello attestations deals <channel-pubkey>" };
|
|
1029
|
+
try {
|
|
1030
|
+
const result = (await withIpc(lock.socketPath, (client) => client.send("cello_attestations_deals", { channel_pubkey: channel })));
|
|
1031
|
+
if (!result.ok)
|
|
1032
|
+
return { exitCode: 1, output: `${result.reason}\n${result.guidance ?? ""}`.trim() };
|
|
1033
|
+
const avg = result.average_rating === null || result.average_rating === undefined ? "—" : result.average_rating.toFixed(2);
|
|
1034
|
+
return { exitCode: 0, output: ` channel ${channel.slice(0, 16)}…\n deals: ${result.deals ?? 0}\n average rating: ${avg}` };
|
|
1035
|
+
}
|
|
1036
|
+
catch (err) {
|
|
1037
|
+
return { exitCode: 1, output: `Could not reach the daemon: ${err instanceof Error ? err.message : String(err)}` };
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
// M10E 015-READ — the judge's client: build, sign and submit a removal ruling to every node.
|
|
1041
|
+
// cello attestations rule <attestation-hash> --owner <pubkey> --namespace <ns> --reason <text> [--evidence <hash>…]
|
|
1042
|
+
if (sub === "rule") {
|
|
1043
|
+
const [attHash, ...rest] = args;
|
|
1044
|
+
let owner;
|
|
1045
|
+
let ns;
|
|
1046
|
+
let reason;
|
|
1047
|
+
const evidence = [];
|
|
1048
|
+
for (let i = 0; i < rest.length; i++) {
|
|
1049
|
+
if (rest[i] === "--owner")
|
|
1050
|
+
owner = rest[++i];
|
|
1051
|
+
else if (rest[i] === "--namespace")
|
|
1052
|
+
ns = rest[++i];
|
|
1053
|
+
else if (rest[i] === "--reason")
|
|
1054
|
+
reason = rest[++i];
|
|
1055
|
+
else if (rest[i] === "--evidence") {
|
|
1056
|
+
const h = rest[++i];
|
|
1057
|
+
if (h)
|
|
1058
|
+
evidence.push(h);
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
if (!attHash || !owner || !ns || !reason) {
|
|
1062
|
+
return { exitCode: 1, output: "Usage: cello attestations rule <attestation-hash> --owner <pubkey> --namespace <ns> --reason <text> [--evidence <hash>…]" };
|
|
1063
|
+
}
|
|
1064
|
+
try {
|
|
1065
|
+
const result = (await withIpc(lock.socketPath, (client) => client.send("cello_attestations_rule", { attestation_hash: attHash, owner_pubkey: owner, namespace: ns, reason, evidence_hashes: evidence })));
|
|
1066
|
+
if (!result.ok)
|
|
1067
|
+
return { exitCode: 1, output: `${result.reason}\n${result.guidance ?? ""}`.trim() };
|
|
1068
|
+
const rows = (result.results ?? []).map((n) => ` ${n.node_id.padEnd(16)} ${n.error ? `error: ${n.error}` : `countersigns: ${n.countersigns ?? 0}${n.in_force ? " (in force)" : ""}`}`).join("\n");
|
|
1069
|
+
return { exitCode: 0, output: ` ${rows}\n\n ${result.guidance ?? ""}`.trimEnd() };
|
|
1070
|
+
}
|
|
1071
|
+
catch (err) {
|
|
1072
|
+
return { exitCode: 1, output: `Could not reach the daemon: ${err instanceof Error ? err.message : String(err)}` };
|
|
1073
|
+
}
|
|
1074
|
+
}
|
|
1075
|
+
// M10E 007-NOTICES — the public activity counts for an owner's namespace.
|
|
1076
|
+
if (sub === "activity") {
|
|
1077
|
+
const [owner, ns] = args;
|
|
1078
|
+
if (!owner || !ns) {
|
|
1079
|
+
return { exitCode: 1, output: "Usage: cello attestations activity <pubkey> <namespace>" };
|
|
1080
|
+
}
|
|
1081
|
+
try {
|
|
1082
|
+
const result = (await withIpc(lock.socketPath, (client) => client.send("cello_attestations_activity", { owner_pubkey: owner, namespace: ns })));
|
|
1083
|
+
if (!result.ok)
|
|
1084
|
+
return { exitCode: 1, output: `${result.reason}\n${result.guidance ?? ""}`.trim() };
|
|
1085
|
+
return { exitCode: 0, output: ` ${ns}\n service events: ${result.service_events ?? 0}\n unmarked claims: ${result.unmarked_claims ?? 0}` };
|
|
1086
|
+
}
|
|
1087
|
+
catch (err) {
|
|
1088
|
+
return { exitCode: 1, output: `Could not reach the daemon: ${err instanceof Error ? err.message : String(err)}` };
|
|
1089
|
+
}
|
|
1090
|
+
}
|
|
1091
|
+
return {
|
|
1092
|
+
exitCode: 1,
|
|
1093
|
+
output: "Usage:\n" +
|
|
1094
|
+
" cello attestations namespace create <ns> … — open a review namespace\n" +
|
|
1095
|
+
" cello attestations namespace close <ns> — stop a namespace granting new rights\n" +
|
|
1096
|
+
" cello attestations index [<pubkey>] — list an owner's namespaces\n" +
|
|
1097
|
+
" cello attestations mark <session-id> <ns> — mark a service event during a session\n" +
|
|
1098
|
+
" cello attestations rights — the rights to review that you hold\n" +
|
|
1099
|
+
" cello attestations write <right-id> -- <text> — write a review for a right you hold\n" +
|
|
1100
|
+
" cello attestations written — the reviews you have written, with outcomes\n" +
|
|
1101
|
+
" cello attestations claim-service <sid> <ns> — claim a dodged service event (no right)\n" +
|
|
1102
|
+
" cello attestations activity <pubkey> <ns> — service-event and unmarked-claim counts\n" +
|
|
1103
|
+
" cello attestations summary <owner> <ns> — a namespace's review summary, from a majority of directories\n" +
|
|
1104
|
+
" cello attestations reviews <owner> <ns> — the reviews, each verified against the majority root\n" +
|
|
1105
|
+
" cello attestations deals <channel> — the deals a channel is credited with\n" +
|
|
1106
|
+
" cello attestations rule <att-hash> --owner <pk> --namespace <ns> --reason <text> — a judge removes a false review\n" +
|
|
1107
|
+
"\n" +
|
|
1108
|
+
"To vouch for another agent in your own words, that is 'cello endorsements' (008-ENDRENAME).",
|
|
1109
|
+
};
|
|
1110
|
+
}
|
|
1111
|
+
/**
|
|
1112
|
+
* `cello endorsements` — YOUR words about ANOTHER agent, and what became of them (008-ENDRENAME).
|
|
1113
|
+
*
|
|
1114
|
+
* Split from `cello attestations` so the two systems stop sharing a word. `cello attestations` is
|
|
1115
|
+
* the M10E review system, where nothing can be refused; an ENDORSEMENT is a PERSON vouching for a
|
|
1116
|
+
* PERSON, which the subject accepts or refuses. The receiving direction is `cello endorsement-consent`.
|
|
716
1117
|
*
|
|
717
1118
|
* Subcommands:
|
|
718
|
-
* issue <pubkey> <text…> —
|
|
1119
|
+
* issue <pubkey> <text…> — vouch for something you have seen them do
|
|
719
1120
|
* issued — what happened to the ones you wrote
|
|
720
|
-
*
|
|
721
|
-
* The receiving direction — what others wrote about YOU — is `cello attestation-consent`.
|
|
722
1121
|
*/
|
|
723
|
-
export async function
|
|
1122
|
+
export async function endorsements(celloDir, sub, args) {
|
|
724
1123
|
const lockFilePath = join(celloDir, "daemon.lock");
|
|
725
1124
|
const lock = await readLock(lockFilePath);
|
|
726
1125
|
if (!lock) {
|
|
@@ -812,18 +1211,18 @@ export async function attestations(celloDir, sub, args) {
|
|
|
812
1211
|
if (!subject || body.length === 0) {
|
|
813
1212
|
return {
|
|
814
1213
|
exitCode: 1,
|
|
815
|
-
output: "Usage: cello
|
|
1214
|
+
output: "Usage: cello endorsements issue <subject-pubkey> <what you are endorsing them for…>\n" +
|
|
816
1215
|
"\n" +
|
|
817
1216
|
"The text: MAXIMUM 500 CHARACTERS — a testimonial, not a document. Line breaks are fine;\n" +
|
|
818
1217
|
"no other control characters, and no < or >.\n" +
|
|
819
1218
|
"\n" +
|
|
820
1219
|
"If your text contains something that looks like a flag (a leading '-', or '-h'), put `--`\n" +
|
|
821
1220
|
"before it so it is read as text:\n" +
|
|
822
|
-
" cello
|
|
1221
|
+
" cello endorsements issue <pubkey> -- cut p99 by -30ms on the auth path",
|
|
823
1222
|
};
|
|
824
1223
|
}
|
|
825
1224
|
try {
|
|
826
|
-
const result = (await withIpc(lock.socketPath, (client) => client.send("
|
|
1225
|
+
const result = (await withIpc(lock.socketPath, (client) => client.send("cello_endorsements_issue", { subject_pubkey: subject, body })));
|
|
827
1226
|
if (!result.ok) {
|
|
828
1227
|
return { exitCode: 1, output: `${result.reason}\n${result.guidance ?? ""}`.trim() };
|
|
829
1228
|
}
|
|
@@ -836,10 +1235,10 @@ export async function attestations(celloDir, sub, args) {
|
|
|
836
1235
|
return {
|
|
837
1236
|
exitCode: 1,
|
|
838
1237
|
output: "Usage:\n" +
|
|
839
|
-
" cello
|
|
840
|
-
" cello
|
|
1238
|
+
" cello endorsements issue <pubkey> <text…> — vouch for something you have seen them do\n" +
|
|
1239
|
+
" cello endorsements issued — what happened to the ones you wrote\n" +
|
|
841
1240
|
"\n" +
|
|
842
|
-
"What others wrote about YOU is 'cello
|
|
1241
|
+
"What others wrote about YOU is 'cello endorsement-consent'.",
|
|
843
1242
|
};
|
|
844
1243
|
}
|
|
845
1244
|
/**
|