@atbash/cli 0.5.15-dev.17 → 0.5.15-dev.18

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 (37) hide show
  1. package/README.md +6 -55
  2. package/dist/bin/atbash.js +1 -4
  3. package/dist/bin/atbash.js.map +1 -1
  4. package/dist/commands/connect.d.ts +24 -84
  5. package/dist/commands/connect.js +73 -289
  6. package/dist/commands/connect.js.map +1 -1
  7. package/dist/commands/held.js +4 -0
  8. package/dist/commands/held.js.map +1 -1
  9. package/dist/commands/history.js +2 -0
  10. package/dist/commands/history.js.map +1 -1
  11. package/dist/commands/judge.js +1 -0
  12. package/dist/commands/judge.js.map +1 -1
  13. package/dist/commands/policy.js +2 -0
  14. package/dist/commands/policy.js.map +1 -1
  15. package/dist/commands/setup.d.ts +8 -390
  16. package/dist/commands/setup.js +167 -1871
  17. package/dist/commands/setup.js.map +1 -1
  18. package/dist/commands/stats.js +1 -0
  19. package/dist/commands/stats.js.map +1 -1
  20. package/dist/commands/status.js +2 -0
  21. package/dist/commands/status.js.map +1 -1
  22. package/dist/commands/tier.js +2 -0
  23. package/dist/commands/tier.js.map +1 -1
  24. package/dist/commands/tools.js +7 -1
  25. package/dist/commands/tools.js.map +1 -1
  26. package/dist/commands/whoami.js +2 -0
  27. package/dist/commands/whoami.js.map +1 -1
  28. package/package.json +2 -3
  29. package/dist/commands/mcp-cmd.d.ts +0 -13
  30. package/dist/commands/mcp-cmd.js +0 -216
  31. package/dist/commands/mcp-cmd.js.map +0 -1
  32. package/dist/shared/atbash-targets.d.ts +0 -49
  33. package/dist/shared/atbash-targets.js +0 -63
  34. package/dist/shared/atbash-targets.js.map +0 -1
  35. package/dist/shared/openclaw-runtime.d.ts +0 -221
  36. package/dist/shared/openclaw-runtime.js +0 -453
  37. package/dist/shared/openclaw-runtime.js.map +0 -1
@@ -1,216 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.resolveLauncherKey = resolveLauncherKey;
37
- exports.registerMcpCommand = registerMcpCommand;
38
- const fs = __importStar(require("fs"));
39
- const child_process_1 = require("child_process");
40
- const sdk_1 = require("@atbash/sdk");
41
- /**
42
- * `atbash mcp` — run the Atbash MCP server without putting a private key in a
43
- * config file.
44
- *
45
- * THE PROBLEM THIS SOLVES
46
- *
47
- * `@atbash/mcp` reads its agent identity from `ATBASH_AGENT_PRIVKEY` and has no
48
- * key-file fallback (verified against the published 0.1.3). The documented wiring
49
- * therefore asks the operator to paste a raw private key into their MCP client's
50
- * own config:
51
- *
52
- * { "mcpServers": { "atbash": { "command": "npx", "args": ["-y", "@atbash/mcp"],
53
- * "env": { "ATBASH_AGENT_PRIVKEY": "<the key>" } } } }
54
- *
55
- * That file is `claude_desktop_config.json` and its equivalents — files people
56
- * sync between machines, paste into issues, and screenshot when asking for help.
57
- * It made "wire up MCP for me" impossible to automate honestly: the automation's
58
- * whole job would have been to plant a secret somewhere worse than where it
59
- * already was.
60
- *
61
- * This command is the indirection that removes the problem. The client spawns
62
- * `atbash mcp`, which reads the key from the 0600 file Atbash already manages and
63
- * passes it to the server through the CHILD PROCESS ENVIRONMENT ONLY. Nothing
64
- * secret is ever written to a config file, so the client entry is:
65
- *
66
- * { "mcpServers": { "atbash": { "command": "npx", "args": ["-y", "@atbash/cli", "mcp"] } } }
67
- *
68
- * — which contains no credential at all, and is safe for `atbash setup` to write.
69
- *
70
- * STDOUT IS THE PROTOCOL. MCP speaks JSON-RPC over stdio, so a single stray
71
- * `console.log` here corrupts the stream and the client reports a broken server.
72
- * Every diagnostic in this file goes to stderr. Do not change that.
73
- */
74
- /**
75
- * The server this launcher runs, and the SDK it is run WITH.
76
- *
77
- * ⚠️ BOTH PINS ARE LOAD-BEARING. DO NOT LOOSEN THEM.
78
- *
79
- * `@atbash/mcp` declares `@atbash/sdk: ^0.3.19` and imports `getOrgTierInfo` as a
80
- * named export. `@atbash/sdk@0.3.24` REMOVED that export, so `^0.3.19` now
81
- * resolves to 0.3.25 and the server dies at import time:
82
- *
83
- * SyntaxError: The requested module '@atbash/sdk' does not provide an
84
- * export named 'getOrgTierInfo'
85
- *
86
- * That breaks EVERY published `@atbash/mcp` (0.1.0 through 0.1.3) — a plain
87
- * `npm install @atbash/mcp` cannot start at all, which is why the documented
88
- * hand-wiring produces a client reporting a failed server. Naming an SDK version
89
- * from before the removal is what makes it run; 0.3.23 is the newest that works.
90
- *
91
- * ⚠️ AND THE PIN ITSELF IS A STOPGAP. `@atbash/sdk@0.3.23` is DEPRECATED:
92
- *
93
- * npm warn deprecated @atbash/sdk@0.3.23: Old architecture with legacy chain
94
- * structure. Please upgrade to stable version @atbash/sdk@^0.5.0
95
- *
96
- * So this runs the MCP server on a legacy chain architecture. It is verified to
97
- * work — a real `atbash_check_agent` tool call round-trips against the live
98
- * deployment and returns the correct answer — but it is the newest thing that
99
- * works, not a thing that is right.
100
- *
101
- * THE REAL FIX is republishing `@atbash/mcp` against `@atbash/sdk@^0.7`, which
102
- * moves `getOrgTierInfo` onto the `Atbash` class rather than exporting it. Until
103
- * that ships, this pin is the only thing between an operator and a dead MCP
104
- * server, so treat a "dependency update" here as a regression unless the
105
- * republished package is verified to both START and serve a tool call.
106
- *
107
- * Cold start is ~12s while npx populates its cache, ~1s warm. A client with a
108
- * short startup timeout may fail its very first launch and succeed on retry.
109
- */
110
- const MCP_PKG = "@atbash/mcp";
111
- const MCP_VERSION = "0.1.3";
112
- const MCP_SDK_VERSION = "0.3.23";
113
- /** Read `privkey=` out of the agent key file, or null if it is not usable. */
114
- function privkeyFromKeyFile(keyPath) {
115
- let text;
116
- try {
117
- text = fs.readFileSync(keyPath, "utf8");
118
- }
119
- catch {
120
- return null;
121
- }
122
- if (text.trim().startsWith("{")) {
123
- try {
124
- const o = JSON.parse(text);
125
- const value = String(o.privKey ?? o.privkey ?? o.privateKey ?? "").replace(/^0x/i, "").trim();
126
- return /^[0-9a-fA-F]{64}$/.test(value) ? value.toLowerCase() : null;
127
- }
128
- catch {
129
- return null;
130
- }
131
- }
132
- for (const line of text.split(/\r?\n/)) {
133
- const match = line.trim().match(/^privkey\s*[:=]\s*(.+)$/i);
134
- if (match) {
135
- const value = match[1].replace(/^0x/i, "").trim();
136
- if (/^[0-9a-fA-F]{64}$/.test(value))
137
- return value.toLowerCase();
138
- }
139
- }
140
- return null;
141
- }
142
- /**
143
- * Where the launcher gets the key, in order.
144
- *
145
- * An `ATBASH_AGENT_PRIVKEY` already in the environment wins, so an operator who
146
- * deliberately injects the key at launch time keeps working exactly as before —
147
- * this command adds a safer default, it does not take the existing path away.
148
- */
149
- function resolveLauncherKey(keyPathOverride) {
150
- const fromEnv = process.env.ATBASH_AGENT_PRIVKEY?.replace(/^0x/i, "").trim();
151
- if (fromEnv && /^[0-9a-fA-F]{64}$/.test(fromEnv))
152
- return { privkey: fromEnv.toLowerCase(), from: "ATBASH_AGENT_PRIVKEY" };
153
- const keyPath = (0, sdk_1.resolveKeyPath)(keyPathOverride);
154
- const fromFile = privkeyFromKeyFile(keyPath);
155
- if (fromFile)
156
- return { privkey: fromFile, from: keyPath };
157
- const fromConfig = (0, sdk_1.loadUserConfig)().agentKey?.replace(/^0x/i, "").trim();
158
- if (fromConfig && /^[0-9a-fA-F]{64}$/.test(fromConfig))
159
- return { privkey: fromConfig.toLowerCase(), from: "atbash config" };
160
- return null;
161
- }
162
- function registerMcpCommand(program) {
163
- program
164
- .command("mcp")
165
- .description("Run the Atbash MCP server, reading the agent key from ~/.config/atbash/guard-client-key instead of a config file (used as the `command` in an MCP client's server list)")
166
- .option("--key-file <path>", "Agent key file to read (default: ~/.config/atbash/guard-client-key)")
167
- .option("--endpoint <url>", "Atbash endpoint the server should use")
168
- .action((opts) => {
169
- const resolved = resolveLauncherKey(opts.keyFile);
170
- if (!resolved) {
171
- // stderr: stdout belongs to the JSON-RPC stream.
172
- process.stderr.write("atbash mcp: no agent key found.\n" +
173
- `Looked at ATBASH_AGENT_PRIVKEY, ${(0, sdk_1.resolveKeyPath)(opts.keyFile)}, and the atbash config.\n` +
174
- "Run `atbash setup` on this machine first, or pass --key-file.\n");
175
- process.exit(1);
176
- }
177
- const endpoint = opts.endpoint || process.env.ATBASH_ENDPOINT;
178
- // The key goes to the CHILD ONLY. It is never written to disk here and
179
- // never echoed — the parent's own environment is left untouched.
180
- const env = {
181
- ...process.env,
182
- ATBASH_AGENT_PRIVKEY: resolved.privkey,
183
- ...(endpoint ? { ATBASH_ENDPOINT: endpoint } : {}),
184
- };
185
- // Both packages are placed in ONE npx tree so the compatible SDK sits at its
186
- // root and satisfies @atbash/mcp's own `^0.3.19` range — which is what stops
187
- // npm installing the broken 0.3.25 underneath it. Installing @atbash/mcp
188
- // alone (as a dependency of this CLI, or via a bare npx) reintroduces the
189
- // crash, so this shape is deliberate, not incidental.
190
- const command = "npx";
191
- const args = [
192
- "--yes",
193
- "-p", `${MCP_PKG}@${MCP_VERSION}`,
194
- "-p", `@atbash/sdk@${MCP_SDK_VERSION}`,
195
- "atbash-mcp",
196
- ];
197
- process.stderr.write(`atbash mcp: starting ${MCP_PKG}@${MCP_VERSION} with @atbash/sdk@${MCP_SDK_VERSION} (key from ${resolved.from})\n`);
198
- // stdio inherit: the server talks JSON-RPC directly to the client that
199
- // spawned us. Proxying it through here would add a failure point for no gain.
200
- const child = (0, child_process_1.spawn)(command, args, { env, stdio: "inherit", shell: false });
201
- child.on("error", (err) => {
202
- process.stderr.write(`atbash mcp: could not start ${MCP_PKG}: ${err.message}\n`);
203
- process.exit(1);
204
- });
205
- // Forward termination so the client's own shutdown reaches the server
206
- // rather than orphaning it.
207
- for (const signal of ["SIGINT", "SIGTERM"]) {
208
- process.on(signal, () => { if (!child.killed)
209
- child.kill(signal); });
210
- }
211
- child.on("exit", (code, signal) => {
212
- process.exit(signal ? 1 : (code ?? 0));
213
- });
214
- });
215
- }
216
- //# sourceMappingURL=mcp-cmd.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mcp-cmd.js","sourceRoot":"","sources":["../../src/commands/mcp-cmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2GA,gDAYC;AAED,gDA6DC;AAtLD,uCAAyB;AACzB,iDAAsC;AAEtC,qCAA6D;AAE7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,MAAM,OAAO,GAAG,aAAa,CAAC;AAC9B,MAAM,WAAW,GAAG,OAAO,CAAC;AAC5B,MAAM,eAAe,GAAG,QAAQ,CAAC;AAEjC,8EAA8E;AAC9E,SAAS,kBAAkB,CAAC,OAAe;IACzC,IAAI,IAAY,CAAC;IACjB,IAA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C,CAAC;QACH,sEAAsE;QACtE,4BAA4B;QAC5B,KAAK,MAAM,MAAM,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAU,EAAE,CAAC;YACpD,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM;gBAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACvE,CAAC;QACD,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE;YAChC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC;QACzC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -1,49 +0,0 @@
1
- /**
2
- * Facts about WHERE Atbash lives — the deployments it trusts, and the on-disk
3
- * locations it knows about.
4
- *
5
- * These are shared by the read-only connector (`atbash connect`) and the
6
- * write-capable configurator (`atbash setup`). They live here rather than in
7
- * either command because both must agree:
8
- *
9
- * - A host the connector will relay to must be a host setup will verify
10
- * registration against. Two different allowlists would mean a deployment that
11
- * can receive a scan but cannot confirm the agent it scanned.
12
- * - A config path the scan reports must be a path setup can find. A client that
13
- * shows up in the dashboard but not in `setup` reads as a bug in whichever of
14
- * the two the operator happened to trust first.
15
- *
16
- * When they lived in connect.ts and setup imported them from there, a refactor of
17
- * the connector could silently change the configurator's behaviour. Adding a
18
- * client here updates both callers at once, which is the point.
19
- */
20
- /**
21
- * Official Atbash deployments that legitimately serve the onboarding flow.
22
- *
23
- * The pairing screen builds `--host` from the page you opened, so every origin
24
- * that can host onboarding must appear here. If production were missing, the real
25
- * atbash.ai would be flagged "unrecognized destination" — a false alarm on the
26
- * genuine article, which is worse than silence: it teaches people and agents to
27
- * wave through the one warning that actually catches a swapped host.
28
- *
29
- * Matched on EXACT hostname, never a suffix — "atbash.ai.evil.com" must not pass.
30
- * Deliberately not a *.vercel.app wildcard: that would bless anyone's preview.
31
- */
32
- export declare const KNOWN_HOSTS: Set<string>;
33
- /**
34
- * Used when neither --host nor ATBASH_HOST is given. Still the dev deployment,
35
- * because it is the one running the current connector API; switch this to
36
- * https://atbash.ai once production serves it (KNOWN_HOSTS already allows it).
37
- */
38
- export declare const DEFAULT_HOST = "https://chromia-verified-ai-dev-two.vercel.app";
39
- /**
40
- * MCP client config locations, relative to the user's home directory.
41
- *
42
- * Claude Code (`~/.claude.json`) and Codex (`~/.codex/config.toml`) are NOT here
43
- * on purpose: each needs bespoke handling (per-project server maps, and TOML
44
- * respectively) and both callers special-case them.
45
- */
46
- export declare const MCP_CONFIGS: {
47
- label: string;
48
- segs: string[];
49
- }[];
@@ -1,63 +0,0 @@
1
- "use strict";
2
- /**
3
- * Facts about WHERE Atbash lives — the deployments it trusts, and the on-disk
4
- * locations it knows about.
5
- *
6
- * These are shared by the read-only connector (`atbash connect`) and the
7
- * write-capable configurator (`atbash setup`). They live here rather than in
8
- * either command because both must agree:
9
- *
10
- * - A host the connector will relay to must be a host setup will verify
11
- * registration against. Two different allowlists would mean a deployment that
12
- * can receive a scan but cannot confirm the agent it scanned.
13
- * - A config path the scan reports must be a path setup can find. A client that
14
- * shows up in the dashboard but not in `setup` reads as a bug in whichever of
15
- * the two the operator happened to trust first.
16
- *
17
- * When they lived in connect.ts and setup imported them from there, a refactor of
18
- * the connector could silently change the configurator's behaviour. Adding a
19
- * client here updates both callers at once, which is the point.
20
- */
21
- Object.defineProperty(exports, "__esModule", { value: true });
22
- exports.MCP_CONFIGS = exports.DEFAULT_HOST = exports.KNOWN_HOSTS = void 0;
23
- /**
24
- * Official Atbash deployments that legitimately serve the onboarding flow.
25
- *
26
- * The pairing screen builds `--host` from the page you opened, so every origin
27
- * that can host onboarding must appear here. If production were missing, the real
28
- * atbash.ai would be flagged "unrecognized destination" — a false alarm on the
29
- * genuine article, which is worse than silence: it teaches people and agents to
30
- * wave through the one warning that actually catches a swapped host.
31
- *
32
- * Matched on EXACT hostname, never a suffix — "atbash.ai.evil.com" must not pass.
33
- * Deliberately not a *.vercel.app wildcard: that would bless anyone's preview.
34
- */
35
- exports.KNOWN_HOSTS = new Set([
36
- "atbash.ai",
37
- "www.atbash.ai",
38
- "chromia-verified-ai-dev-two.vercel.app",
39
- "chromia-verified-ai-agent-scan.vercel.app",
40
- ]);
41
- /**
42
- * Used when neither --host nor ATBASH_HOST is given. Still the dev deployment,
43
- * because it is the one running the current connector API; switch this to
44
- * https://atbash.ai once production serves it (KNOWN_HOSTS already allows it).
45
- */
46
- exports.DEFAULT_HOST = "https://chromia-verified-ai-dev-two.vercel.app";
47
- /**
48
- * MCP client config locations, relative to the user's home directory.
49
- *
50
- * Claude Code (`~/.claude.json`) and Codex (`~/.codex/config.toml`) are NOT here
51
- * on purpose: each needs bespoke handling (per-project server maps, and TOML
52
- * respectively) and both callers special-case them.
53
- */
54
- exports.MCP_CONFIGS = [
55
- { label: "Claude Desktop", segs: ["Library", "Application Support", "Claude", "claude_desktop_config.json"] },
56
- { label: "Claude Desktop", segs: [".config", "Claude", "claude_desktop_config.json"] },
57
- { label: "Cursor", segs: [".cursor", "mcp.json"] },
58
- { label: "Windsurf", segs: [".codeium", "windsurf", "mcp_config.json"] },
59
- { label: "VS Code (MCP)", segs: [".vscode", "mcp.json"] },
60
- { label: "Gemini CLI", segs: [".gemini", "settings.json"] },
61
- { label: "Continue", segs: [".continue", "config.json"] },
62
- ];
63
- //# sourceMappingURL=atbash-targets.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"atbash-targets.js","sourceRoot":"","sources":["../../src/shared/atbash-targets.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;;;AAEH;;;;;;;;;;;GAWG;AACU,QAAA,WAAW,GAAG,IAAI,GAAG,CAAC;IACjC,WAAW;IACX,eAAe;IACf,wCAAwC;IACxC,2CAA2C;CAC5C,CAAC,CAAC;AAEH;;;;GAIG;AACU,QAAA,YAAY,GAAG,gDAAgD,CAAC;AAE7E;;;;;;GAMG;AACU,QAAA,WAAW,GAAwC;IAC9D,EAAE,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,SAAS,EAAE,qBAAqB,EAAE,QAAQ,EAAE,4BAA4B,CAAC,EAAE;IAC7G,EAAE,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,SAAS,EAAE,QAAQ,EAAE,4BAA4B,CAAC,EAAE;IACtF,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,SAAS,EAAE,UAAU,CAAC,EAAE;IAClD,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,iBAAiB,CAAC,EAAE;IACxE,EAAE,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC,SAAS,EAAE,UAAU,CAAC,EAAE;IACzD,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,SAAS,EAAE,eAAe,CAAC,EAAE;IAC3D,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,WAAW,EAAE,aAAa,CAAC,EAAE;CAC1D,CAAC"}
@@ -1,221 +0,0 @@
1
- /** How this OpenClaw got onto the machine — decides the UPDATE command. */
2
- export type OpenclawChannel = "brew-formula" | "brew-cask" | "npm" | "unknown";
3
- /**
4
- * Config subcommands this build has.
5
- *
6
- * Probed from `openclaw config --help`, because the boundary is not guessable
7
- * from a version number. Observed: 2026.2.1 has only `get set unset`, while both
8
- * 2026.6.6 and 2026.7.1 have `file get patch schema set unset validate`.
9
- */
10
- export interface OpenclawCaps {
11
- /**
12
- * `openclaw config patch` — "Patch config from a JSON5 object in one validated
13
- * write. Objects merge recursively, arrays/scalars replace, and null deletes a
14
- * path", with `--stdin` and `--dry-run`.
15
- *
16
- * This is EXACTLY the operation setup needs, performed by OpenClaw itself, so
17
- * where it exists we stop hand-merging JSON. That hands OpenClaw responsibility
18
- * for its own file format, key names, schema, permissions and migrations — all
19
- * the things we kept getting wrong from the outside. It also removes the
20
- * clobber hazard: a machine in the field had three
21
- * `openclaw.json.clobbered.<timestamp>` files, so OpenClaw rewrites that file
22
- * on its own and anything we hand-merge can be discarded without warning.
23
- */
24
- patch: boolean;
25
- /** `openclaw config validate` — schema check without starting the gateway. */
26
- validate: boolean;
27
- /** `openclaw config schema` — the authoritative key list for THIS build. */
28
- schema: boolean;
29
- /** `openclaw config file` — where the active config actually lives. */
30
- configFile: boolean;
31
- }
32
- export interface OpenclawRuntime {
33
- /** False when there is no OpenClaw on this machine at all. */
34
- present: boolean;
35
- /** As reported by `openclaw --version`, e.g. "2026.7.1". Undefined if unparseable. */
36
- version?: string;
37
- /** Build hash when the version line carries one — pins a build exactly. */
38
- build?: string;
39
- channel: OpenclawChannel;
40
- /** Resolved path to the binary, for diagnostics. */
41
- binPath?: string;
42
- caps: OpenclawCaps;
43
- }
44
- /**
45
- * Where the `openclaw` on PATH came from.
46
- *
47
- * Path-based rather than asked of a package manager, because shelling out to
48
- * brew and npm to answer a question we can read off a path is slow and can hang
49
- * on a bad network — and this runs before we have written anything, where a
50
- * hang looks like the command being broken.
51
- *
52
- * ⚠️ The npm case is not hypothetical or unusual: the machine that reported the
53
- * original failure ran `/Users/m4/.nvm/versions/node/v24.13.0/bin/openclaw`,
54
- * so `brew info openclaw-cli` there said "Not installed" while OpenClaw was
55
- * plainly running. Telling that user `brew upgrade openclaw-cli` would have been
56
- * useless, which is the whole reason this returns a channel at all.
57
- */
58
- export declare function detectChannel(binPath: string | undefined): OpenclawChannel;
59
- /**
60
- * The command that updates THIS install, or undefined when we cannot tell.
61
- *
62
- * Returning undefined is deliberate and better than a plausible guess: a user
63
- * told to run `brew upgrade openclaw-cli` on an npm install gets "No available
64
- * formula", concludes our instructions are wrong, and is no closer to an
65
- * upgrade. `openclaw update` is the honest fallback where the channel is
66
- * unknown — it is OpenClaw's own self-updater, and 2026.6.6's `doctor` already
67
- * recommends exactly that ("Run `openclaw update` to update via your package
68
- * manager (npm/pnpm)").
69
- */
70
- export declare function updateCommand(channel: OpenclawChannel): string;
71
- /**
72
- * Inspect the OpenClaw on this machine. Read-only: probes `--version` and
73
- * `config --help`, writes nothing, and never throws.
74
- */
75
- export declare function detectOpenclaw(binary?: string): OpenclawRuntime;
76
- /** How setup should write config on this machine. */
77
- export type WriteStrategy =
78
- /** `openclaw config patch --stdin` — OpenClaw merges and validates its own file. */
79
- "openclaw-patch"
80
- /** Hand-merge the JSON ourselves. The only option on 2026.2.x. */
81
- | "hand-merge";
82
- export declare function writeStrategy(rt: OpenclawRuntime): WriteStrategy;
83
- /**
84
- * Whether this OpenClaw is one we can wire at all, and what to say if not.
85
- *
86
- * DELIBERATELY PERMISSIVE. The floor is "there is an OpenClaw here", not "it has
87
- * the newest config commands", because 2026.2.x installs are real — the box every
88
- * CLI attestation was verified on is one — and the minimal entry-only config we
89
- * now write was confirmed to load there with the plugin reporting
90
- * `[atbash] plugin loaded` and `guard manager ready`. Narrowing support to the
91
- * versions we happen to run is the mistake that produced this whole module.
92
- *
93
- * So an older build is a DEGRADED path with an offer, never a refusal: it gets
94
- * the hand-merge, and the reason to upgrade is stated once, with the command for
95
- * its own channel. Refusal is reserved for "no OpenClaw at all", where there is
96
- * genuinely nothing to configure.
97
- */
98
- export declare function supportStatus(rt: OpenclawRuntime): {
99
- supported: boolean;
100
- degraded: boolean;
101
- /** Plain-language line for a non-technical operator. */
102
- message: string;
103
- /** The channel-correct upgrade command, when upgrading would help. */
104
- upgrade?: string;
105
- };
106
- /**
107
- * What OpenClaw says about the Atbash plugin after we have wired it.
108
- *
109
- * `state` is deliberately not a boolean. "Is this agent governed?" has more than
110
- * two answers, and collapsing them is how setup came to print a green summary
111
- * over an ungoverned machine.
112
- */
113
- export interface PluginVerdict {
114
- state:
115
- /** Present, switched on, and loaded. The only state that means governed. */
116
- "loaded"
117
- /** On disk but switched off — governs nothing, and is a deliberate act. */
118
- | "disabled"
119
- /** OpenClaw tried and failed to load it. Worse than missing: it looks wired. */
120
- | "load-error"
121
- /** OpenClaw does not know about it at all. */
122
- | "missing"
123
- /** We could not ask. Must never be reported as success. */
124
- | "unknown";
125
- entry?: string;
126
- version?: string;
127
- /** Required runtime dependencies OpenClaw reports as absent. */
128
- missingDeps?: string[];
129
- /** Raw explanation for the operator, in OpenClaw's terms where possible. */
130
- detail?: string;
131
- }
132
- /**
133
- * Ask OpenClaw whether the plugin actually loaded — the check setup never had.
134
- *
135
- * ⚠️ WHY THIS IS NOT OPTIONAL. Setup used to declare success on the strength of
136
- * having written what it meant to write. That is not the same claim: on the
137
- * machine that reported the original failure, the config entry existed and the
138
- * plugin did not, and OpenClaw said so plainly —
139
- *
140
- * plugins.entries.atbash-openclaw: plugin not found: atbash-openclaw
141
- * (stale config entry ignored; remove it from plugins config)
142
- *
143
- * — while setup reported the run as done. An owner reading that summary believes
144
- * their agent is governed. Nothing is more expensive than a false green on a
145
- * control boundary, so the last word belongs to OpenClaw, not to us.
146
- *
147
- * ⚠️ DO NOT check `hookCount` or `hookNames` here. They are 0 and empty for a
148
- * perfectly healthy plugin: hooks register when the GATEWAY starts, not when
149
- * `plugins list` runs. Verified against a plugin that was demonstrably loaded and
150
- * enforcing — it reports `hookCount: 0`. Treating that as a fault would fail
151
- * every correct install.
152
- */
153
- export declare function verifyOpenclawPlugin(rt: OpenclawRuntime, opts: {
154
- /** Entry ids that count as Atbash, current first. */
155
- entryIds: readonly string[];
156
- /** Pin the config being inspected, so this cannot read a different one. */
157
- configPath?: string;
158
- /**
159
- * The package spec that was installed, e.g. `@atbash/atbash-openclaw@dev`.
160
- * Used to catch the environment mismatch that loads cleanly and then fails
161
- * every judge call: the plugin's endpoint and chain ids are compiled in, so a
162
- * production build on a dev-onboarded agent is silently useless.
163
- */
164
- expectedSpec?: string;
165
- /**
166
- * The home directory being configured, when it is not the process's own.
167
- *
168
- * ⚠️ REQUIRED FOR A `--home` RUN, AND OMITTING IT PRODUCED A FALSE GREEN.
169
- * Pinning `OPENCLAW_CONFIG_PATH` aims OpenClaw at the right CONFIG, but
170
- * plugin discovery still walks `$HOME/.openclaw`, so the child process
171
- * happily reported the plugin from the operator's real machine while we were
172
- * asking about a different one. It printed "OpenClaw loads the plugin" about
173
- * a home directory that contained no plugin at all — precisely the false
174
- * green this whole check exists to prevent, produced by the check itself.
175
- */
176
- home?: string;
177
- binary?: string;
178
- }): PluginVerdict;
179
- /**
180
- * Ask OpenClaw whether a config is valid, when it can answer.
181
- *
182
- * This is the PREFLIGHT the command never had. Setup merged into
183
- * `~/.openclaw/openclaw.json` without ever checking whether that file currently
184
- * loads — so on a machine whose config was already broken it added its own entry
185
- * to an unloadable file, and then its `openclaw plugins install` step died on the
186
- * pre-existing breakage. Reported as an Atbash failure; it was not one.
187
- *
188
- * `undefined` means "cannot tell" (no `validate` on this build) and must be
189
- * treated as such — not as a pass and not as a failure.
190
- */
191
- /**
192
- * Does THIS build accept `hooks` on a plugin entry?
193
- *
194
- * Asked of `openclaw config schema`, never inferred from a version number or
195
- * correlated with other capabilities — the whole point of this module.
196
- *
197
- * ⚠️ WHY THIS QUESTION EXISTS. `hooks` was ADDED, not removed: it is unknown on
198
- * 2026.2.1 and valid, optional and undeprecated on 2026.6.6 and 2026.7.1, where
199
- * an entry accepts `enabled | hooks | subagent | llm | config`. Because the entry
200
- * schema is `additionalProperties: false`, the same key is FATAL on the old build
201
- * and legitimate on the new one.
202
- *
203
- * Setup never writes `hooks` — nothing under it is required, and it gates hook
204
- * families this plugin does not use (it registers only `before_tool_call`). But
205
- * it also used to DELETE an operator's `hooks` block unconditionally, and on a
206
- * build that accepts the key that is destroying their configuration:
207
- * `hooks.timeoutMs` bounds this plugin's hook latency "without changing plugin
208
- * code", which is a deliberate operator choice, not damage to repair.
209
- *
210
- * `undefined` means "cannot tell" (no `config schema` on this build). The caller
211
- * must treat that as NOT supported and strip: keeping an unrecognized key makes
212
- * OpenClaw refuse the entire config, and losing a timeout knob is a far smaller
213
- * harm than a machine whose config will not load at all.
214
- */
215
- export declare function pluginEntryAcceptsHooks(rt: OpenclawRuntime, binary?: string): boolean | undefined;
216
- export declare function validateConfig(rt: OpenclawRuntime, configPath: string, binary?: string,
217
- /** The home being configured, when not the process's own — see verifyOpenclawPlugin. */
218
- home?: string): {
219
- valid: boolean;
220
- problems: string;
221
- } | undefined;