mneme-ai 2.77.0 → 2.79.0
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/commands/immune.d.ts +18 -0
- package/dist/commands/immune.d.ts.map +1 -0
- package/dist/commands/immune.js +96 -0
- package/dist/commands/immune.js.map +1 -0
- package/dist/commands/notary.d.ts +23 -0
- package/dist/commands/notary.d.ts.map +1 -0
- package/dist/commands/notary.js +89 -0
- package/dist/commands/notary.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +43 -0
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2.78.0 — `mneme immune selftest`
|
|
3
|
+
*
|
|
4
|
+
* WORM-CANARY for humans. Two checks:
|
|
5
|
+
* 1. Mneme's OWN output: render a worst-case version-mismatch agent block
|
|
6
|
+
* (one carrying an upgrade autoAction) and prove it has zero worm
|
|
7
|
+
* signatures — Mneme informs, never commands.
|
|
8
|
+
* 2. This repo's agent files (CLAUDE.md / AGENTS.md / .cursorrules /
|
|
9
|
+
* .windsurfrules): scan the live Mneme block (or whole file) for any
|
|
10
|
+
* worm directive that may have been written by an OLDER Mneme.
|
|
11
|
+
*
|
|
12
|
+
* Exit 0 when clean, 1 when a worm directive is found.
|
|
13
|
+
*/
|
|
14
|
+
export declare function immuneCommand(opts: {
|
|
15
|
+
cwd: string;
|
|
16
|
+
json?: boolean;
|
|
17
|
+
}): Promise<number>;
|
|
18
|
+
//# sourceMappingURL=immune.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"immune.d.ts","sourceRoot":"","sources":["../../src/commands/immune.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAaH,wBAAsB,aAAa,CAAC,IAAI,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAgE1F"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2.78.0 — `mneme immune selftest`
|
|
3
|
+
*
|
|
4
|
+
* WORM-CANARY for humans. Two checks:
|
|
5
|
+
* 1. Mneme's OWN output: render a worst-case version-mismatch agent block
|
|
6
|
+
* (one carrying an upgrade autoAction) and prove it has zero worm
|
|
7
|
+
* signatures — Mneme informs, never commands.
|
|
8
|
+
* 2. This repo's agent files (CLAUDE.md / AGENTS.md / .cursorrules /
|
|
9
|
+
* .windsurfrules): scan the live Mneme block (or whole file) for any
|
|
10
|
+
* worm directive that may have been written by an OLDER Mneme.
|
|
11
|
+
*
|
|
12
|
+
* Exit 0 when clean, 1 when a worm directive is found.
|
|
13
|
+
*/
|
|
14
|
+
import { writeSync } from "node:fs";
|
|
15
|
+
import * as core from "@mneme-ai/core";
|
|
16
|
+
const AGENT_FILES = ["CLAUDE.md", "AGENTS.md", ".cursorrules", ".windsurfrules"];
|
|
17
|
+
// fd-1 synchronous write — survives the immediate process.exit() the action
|
|
18
|
+
// handler calls (an async stdout pipe would otherwise be truncated on Windows).
|
|
19
|
+
function out(s) {
|
|
20
|
+
try {
|
|
21
|
+
writeSync(1, s);
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
process.stdout.write(s);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export async function immuneCommand(opts) {
|
|
28
|
+
const { scanForWormSignatures, KNOWN_WORM_PAYLOAD } = core.immune;
|
|
29
|
+
const { renderMnemeBlock, readMnemeBlock } = core.notifier;
|
|
30
|
+
// Check 1 — Mneme's own worst-case output.
|
|
31
|
+
const ownBlock = renderMnemeBlock({
|
|
32
|
+
id: "version-up-to-date",
|
|
33
|
+
severity: "info",
|
|
34
|
+
title: "Mneme update available",
|
|
35
|
+
body: "installed v0.0.0, npm latest v9.9.9. The user can run `mneme upgrade` when convenient.",
|
|
36
|
+
autoAction: { tool: "mneme.system.upgrade", args: { mode: "install", force: true } },
|
|
37
|
+
});
|
|
38
|
+
const ownScan = scanForWormSignatures(ownBlock);
|
|
39
|
+
const control = scanForWormSignatures(KNOWN_WORM_PAYLOAD); // positive control
|
|
40
|
+
// Check 2 — this repo's persistent agent files.
|
|
41
|
+
const fileScans = [];
|
|
42
|
+
for (const f of AGENT_FILES) {
|
|
43
|
+
let block = null;
|
|
44
|
+
try {
|
|
45
|
+
block = readMnemeBlock(opts.cwd, f);
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
block = null;
|
|
49
|
+
}
|
|
50
|
+
if (block === null)
|
|
51
|
+
continue; // file or Mneme block absent — nothing to scan
|
|
52
|
+
const scan = scanForWormSignatures(block);
|
|
53
|
+
fileScans.push({
|
|
54
|
+
file: f,
|
|
55
|
+
clean: scan.clean,
|
|
56
|
+
findings: scan.findings.length,
|
|
57
|
+
detail: scan.findings.map((x) => `${x.kind}: "${x.match}"`),
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
const dirtyFiles = fileScans.filter((s) => !s.clean);
|
|
61
|
+
const ok = ownScan.clean && !control.clean && dirtyFiles.length === 0;
|
|
62
|
+
if (opts.json) {
|
|
63
|
+
out(JSON.stringify({
|
|
64
|
+
ok,
|
|
65
|
+
ownOutputClean: ownScan.clean,
|
|
66
|
+
canaryCatchesKnownPayload: !control.clean,
|
|
67
|
+
ownFindings: ownScan.findings,
|
|
68
|
+
files: fileScans,
|
|
69
|
+
}, null, 2) + "\n");
|
|
70
|
+
return ok ? 0 : 1;
|
|
71
|
+
}
|
|
72
|
+
const lines = [];
|
|
73
|
+
lines.push("🧬 MNEME IMMUNE SELFTEST — WORM-CANARY");
|
|
74
|
+
lines.push("");
|
|
75
|
+
lines.push(` ${ownScan.clean ? "🟢" : "🔴"} Mneme's own agent-file output: ${ownScan.clean ? "no worm signatures (informs, never commands)" : `${ownScan.findings.length} signature(s)!`}`);
|
|
76
|
+
for (const f of ownScan.findings)
|
|
77
|
+
lines.push(` └─ ${f.kind}: "${f.match}"`);
|
|
78
|
+
lines.push(` ${!control.clean ? "🟢" : "🔴"} Canary self-test: ${!control.clean ? "catches the known pre-v2.78 worm payload (positive control)" : "FAILED to catch the known payload — canary is broken!"}`);
|
|
79
|
+
if (fileScans.length === 0) {
|
|
80
|
+
lines.push(" · No Mneme blocks found in this repo's agent files (nothing to scan).");
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
for (const s of fileScans) {
|
|
84
|
+
lines.push(` ${s.clean ? "🟢" : "🔴"} ${s.file}: ${s.clean ? "clean" : `${s.findings} worm signature(s)!`}`);
|
|
85
|
+
for (const d of s.detail)
|
|
86
|
+
lines.push(` └─ ${d}`);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
lines.push("");
|
|
90
|
+
lines.push(ok
|
|
91
|
+
? " ✅ CLEAN — Mneme is not a worm. It states version availability as informational context; upgrades are user-initiated only."
|
|
92
|
+
: " ❌ WORM DIRECTIVE present — see above. (If a repo file is dirty, an OLDER Mneme wrote it; run `mneme upgrade` then re-run this.)");
|
|
93
|
+
out(lines.join("\n") + "\n");
|
|
94
|
+
return ok ? 0 : 1;
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=immune.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"immune.js","sourceRoot":"","sources":["../../src/commands/immune.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AAEvC,MAAM,WAAW,GAAG,CAAC,WAAW,EAAE,WAAW,EAAE,cAAc,EAAE,gBAAgB,CAAC,CAAC;AAEjF,4EAA4E;AAC5E,gFAAgF;AAChF,SAAS,GAAG,CAAC,CAAS;IACpB,IAAI,CAAC;QAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAAC,CAAC;IAAC,MA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
|
|
|
1
|
+
/**
|
|
2
|
+
* v2.79.0 — `mneme notary <action>`
|
|
3
|
+
*
|
|
4
|
+
* Portable proof-of-provenance receipts (Ed25519). Verify with a public key
|
|
5
|
+
* alone — no Mneme, no network, no shared secret.
|
|
6
|
+
*
|
|
7
|
+
* mneme notary pubkey — show this repo's issuer public key + fingerprint
|
|
8
|
+
* mneme notary issue --subject S [--kind K] [--payload JSON] [--no-payload] [--prev ID]
|
|
9
|
+
* mneme notary verify <file|-> — verify a receipt OFFLINE (exit 0 valid, 1 invalid)
|
|
10
|
+
*/
|
|
11
|
+
export interface NotaryOpts {
|
|
12
|
+
cwd: string;
|
|
13
|
+
action: string;
|
|
14
|
+
subject?: string;
|
|
15
|
+
kind?: string;
|
|
16
|
+
payload?: string;
|
|
17
|
+
noPayload?: boolean;
|
|
18
|
+
prev?: string;
|
|
19
|
+
file?: string;
|
|
20
|
+
json?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export declare function notaryCommand(opts: NotaryOpts): Promise<number>;
|
|
23
|
+
//# sourceMappingURL=notary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notary.d.ts","sourceRoot":"","sources":["../../src/commands/notary.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAUH,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAID,wBAAsB,aAAa,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CA8CrE"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2.79.0 — `mneme notary <action>`
|
|
3
|
+
*
|
|
4
|
+
* Portable proof-of-provenance receipts (Ed25519). Verify with a public key
|
|
5
|
+
* alone — no Mneme, no network, no shared secret.
|
|
6
|
+
*
|
|
7
|
+
* mneme notary pubkey — show this repo's issuer public key + fingerprint
|
|
8
|
+
* mneme notary issue --subject S [--kind K] [--payload JSON] [--no-payload] [--prev ID]
|
|
9
|
+
* mneme notary verify <file|-> — verify a receipt OFFLINE (exit 0 valid, 1 invalid)
|
|
10
|
+
*/
|
|
11
|
+
import { writeSync, readFileSync } from "node:fs";
|
|
12
|
+
import * as core from "@mneme-ai/core";
|
|
13
|
+
import { parseJsonArg } from "../util/json_arg.js";
|
|
14
|
+
function out(s) {
|
|
15
|
+
try {
|
|
16
|
+
writeSync(1, s);
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
process.stdout.write(s);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
const KINDS = new Set(["claim-verdict", "protocol-hop", "memory-capsule", "reasoning-trace", "generic"]);
|
|
23
|
+
export async function notaryCommand(opts) {
|
|
24
|
+
const { getIssuerKeyPair, issueReceipt, verifyReceipt } = core.notary;
|
|
25
|
+
if (opts.action === "pubkey" || opts.action === "keygen") {
|
|
26
|
+
const kp = getIssuerKeyPair(opts.cwd);
|
|
27
|
+
if (opts.json) {
|
|
28
|
+
out(JSON.stringify({ alg: "ed25519", fingerprint: kp.fingerprint, publicKeyB64: kp.publicKeyB64 }, null, 2) + "\n");
|
|
29
|
+
return 0;
|
|
30
|
+
}
|
|
31
|
+
out(`🪪 MNEME NOTARY — issuer public key (this repo)\n\n alg: ed25519\n fingerprint: ${kp.fingerprint}\n publicKey: ${kp.publicKeyB64}\n\n Share the public key. Anyone can verify your receipts offline with it.\n The private key stays in .mneme/notary/issuer.key (never shared).\n`);
|
|
32
|
+
return 0;
|
|
33
|
+
}
|
|
34
|
+
if (opts.action === "issue") {
|
|
35
|
+
if (!opts.subject) {
|
|
36
|
+
out("✗ issue requires --subject\n");
|
|
37
|
+
return 2;
|
|
38
|
+
}
|
|
39
|
+
const kind = opts.kind && KINDS.has(opts.kind) ? opts.kind : "generic";
|
|
40
|
+
let payload = undefined;
|
|
41
|
+
if (opts.payload) {
|
|
42
|
+
try {
|
|
43
|
+
payload = parseJsonArg(opts.payload);
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
out("✗ --payload is not valid JSON\n");
|
|
47
|
+
return 2;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
const r = issueReceipt(opts.cwd, {
|
|
51
|
+
kind, subject: opts.subject, payload,
|
|
52
|
+
includePayload: !opts.noPayload, prev: opts.prev ?? null,
|
|
53
|
+
});
|
|
54
|
+
out(JSON.stringify(r, null, 2) + "\n");
|
|
55
|
+
return 0;
|
|
56
|
+
}
|
|
57
|
+
if (opts.action === "verify") {
|
|
58
|
+
let raw;
|
|
59
|
+
try {
|
|
60
|
+
raw = opts.file && opts.file !== "-" ? readFileSync(opts.file, "utf8") : readFileSync(0, "utf8");
|
|
61
|
+
}
|
|
62
|
+
catch (e) {
|
|
63
|
+
out(`✗ cannot read receipt: ${e.message}\n`);
|
|
64
|
+
return 2;
|
|
65
|
+
}
|
|
66
|
+
let receipt;
|
|
67
|
+
try {
|
|
68
|
+
receipt = JSON.parse(raw);
|
|
69
|
+
}
|
|
70
|
+
catch {
|
|
71
|
+
out("✗ receipt is not valid JSON\n");
|
|
72
|
+
return 2;
|
|
73
|
+
}
|
|
74
|
+
const v = verifyReceipt(receipt);
|
|
75
|
+
if (opts.json) {
|
|
76
|
+
out(JSON.stringify(v, null, 2) + "\n");
|
|
77
|
+
return v.valid ? 0 : 1;
|
|
78
|
+
}
|
|
79
|
+
if (v.valid) {
|
|
80
|
+
out(`🟢 VALID — signature verifies offline against the embedded public key.\n issuer: ${v.issuerFingerprint}\n kind: ${v.kind}\n subject: ${v.subject}\n`);
|
|
81
|
+
return 0;
|
|
82
|
+
}
|
|
83
|
+
out(`🔴 INVALID — ${v.reason}\n`);
|
|
84
|
+
return 1;
|
|
85
|
+
}
|
|
86
|
+
out(`✗ Unknown notary action "${opts.action}". Try: pubkey | issue | verify\n`);
|
|
87
|
+
return 2;
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=notary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notary.js","sourceRoot":"","sources":["../../src/commands/notary.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,SAAS,GAAG,CAAC,CAAS;IACpB,IAAI,CAAC;QAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAAC,CAAC;IAAC,MAAM,CAAC;QAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAAC,CAAC;AAC7D,CAAC;AAcD,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,CAAC,eAAe,EAAE,cAAc,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,SAAS,CAAC,CAAC,CAAC;AAEzG,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,IAAgB;IAClD,MAAM,EAAE,gBAAgB,EAAE,YAAY,EAAE,aAAa,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC;IAEtE,IAAI,IAAI,CAAC,MAAM,KAAK,QAAQ,IAAI,IAAI,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;QACzD,MAAM,EAAE,GAAG,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACtC,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;YAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG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AAM,IAAI,CAAC,CAAC;QAClC,OAAO,CAAC,CAAC;IACX,CAAC;IAED,GAAG,CAAC,4BAA4B,IAAI,CAAC,MAAM,mCAAmC,CAAC,CAAC;IAChF,OAAO,CAAC,CAAC;AACX,CAAC"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAuIA,wBAAsB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAuIA,wBAAsB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAq1MvD"}
|
package/dist/index.js
CHANGED
|
@@ -4166,6 +4166,49 @@ export async function run(argv) {
|
|
|
4166
4166
|
const { uiCommand } = await import("./commands/ui.js");
|
|
4167
4167
|
await uiCommand({ cwd: process.cwd(), version: getVersion() });
|
|
4168
4168
|
});
|
|
4169
|
+
// v2.78.0 — WORM-CANARY selftest. Prove Mneme is not an AI worm: its
|
|
4170
|
+
// agent-file output carries no imperative directives, and any worm payload
|
|
4171
|
+
// an OLDER Mneme may have written into this repo's CLAUDE.md/etc is detected.
|
|
4172
|
+
program
|
|
4173
|
+
.command("immune <action>")
|
|
4174
|
+
.description("🧬 IMMUNE — `mneme immune selftest` runs the WORM-CANARY: proves Mneme never injects a self-upgrade/self-propagation directive into AI agent files (CLAUDE.md/AGENTS.md/.cursorrules/.windsurfrules), and scans this repo's files for any worm payload left by an older Mneme.")
|
|
4175
|
+
.option("--json", "machine-readable output", false)
|
|
4176
|
+
.action(async (action, opts) => {
|
|
4177
|
+
if (action !== "selftest") {
|
|
4178
|
+
ui.error(`Unknown immune action "${action}". Try: selftest`);
|
|
4179
|
+
process.exit(2);
|
|
4180
|
+
}
|
|
4181
|
+
const { immuneCommand } = await import("./commands/immune.js");
|
|
4182
|
+
process.exit(await immuneCommand({ cwd: process.cwd(), json: !!opts.json }));
|
|
4183
|
+
});
|
|
4184
|
+
// v2.79.0 — NOTARY. Portable, offline-verifiable proof-of-provenance receipts
|
|
4185
|
+
// (Ed25519). Verify with a public key alone — no Mneme, no network, no secret.
|
|
4186
|
+
// The TRUST FABRIC spine for cross-protocol routing, portable memory, and the
|
|
4187
|
+
// AI flight recorder.
|
|
4188
|
+
program
|
|
4189
|
+
.command("notary <action>")
|
|
4190
|
+
.description("🪪 NOTARY — Ed25519-signed proof receipts anyone verifies OFFLINE with a public key (no Mneme, no network, no shared secret). actions: pubkey | issue | verify <file|->. Mneme's first asymmetric-crypto primitive.")
|
|
4191
|
+
.option("--subject <s>", "what the receipt attests (issue)")
|
|
4192
|
+
.option("--kind <k>", "claim-verdict | protocol-hop | memory-capsule | reasoning-trace | generic", "generic")
|
|
4193
|
+
.option("--payload <json>", "JSON payload to attest (issue)")
|
|
4194
|
+
.option("--hash-only", "privacy: omit the inline payload, attest only its hash (issue)", false)
|
|
4195
|
+
.option("--prev <id>", "previous receiptId to chain onto (issue)")
|
|
4196
|
+
.option("--file <path>", "receipt file to verify (use '-' for stdin)")
|
|
4197
|
+
.option("--json", "machine-readable output", false)
|
|
4198
|
+
.action(async (action, o) => {
|
|
4199
|
+
const { notaryCommand } = await import("./commands/notary.js");
|
|
4200
|
+
process.exit(await notaryCommand({
|
|
4201
|
+
cwd: process.cwd(),
|
|
4202
|
+
action,
|
|
4203
|
+
subject: o.subject,
|
|
4204
|
+
kind: o.kind,
|
|
4205
|
+
payload: o.payload,
|
|
4206
|
+
noPayload: !!o.hashOnly,
|
|
4207
|
+
prev: o.prev,
|
|
4208
|
+
file: o.file,
|
|
4209
|
+
json: !!o.json,
|
|
4210
|
+
}));
|
|
4211
|
+
});
|
|
4169
4212
|
program
|
|
4170
4213
|
.command("atlas")
|
|
4171
4214
|
.description("🗺 ATLAS HELP — six-layer discovery (TASTE · BLOOM · HOT · TAGS · INTENT · FULL). AI agents read 200 bytes here instead of 14 KB from --help.")
|