@atbash/cli 0.6.0-dev.1 → 0.6.1-dev.2
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/README.md +57 -8
- package/dist/bin/atbash.js +6 -3
- package/dist/bin/atbash.js.map +1 -1
- package/dist/commands/config-cmd.js +15 -15
- package/dist/commands/config-cmd.js.map +1 -1
- package/dist/commands/connect.d.ts +84 -24
- package/dist/commands/connect.js +289 -73
- package/dist/commands/connect.js.map +1 -1
- package/dist/commands/held.js +2 -2
- package/dist/commands/held.js.map +1 -1
- package/dist/commands/history.js +1 -1
- package/dist/commands/history.js.map +1 -1
- package/dist/commands/judge.js +2 -2
- package/dist/commands/judge.js.map +1 -1
- package/dist/commands/mcp-cmd.d.ts +13 -0
- package/dist/commands/mcp-cmd.js +216 -0
- package/dist/commands/mcp-cmd.js.map +1 -0
- package/dist/commands/policy.js +1 -1
- package/dist/commands/policy.js.map +1 -1
- package/dist/commands/setup.d.ts +390 -8
- package/dist/commands/setup.js +1873 -164
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/stats.js +1 -1
- package/dist/commands/stats.js.map +1 -1
- package/dist/commands/status.js +1 -1
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/tier.js +1 -1
- package/dist/commands/tier.js.map +1 -1
- package/dist/commands/tools.js +3 -3
- package/dist/commands/tools.js.map +1 -1
- package/dist/commands/whoami.js +1 -1
- package/dist/commands/whoami.js.map +1 -1
- package/dist/shared/atbash-targets.d.ts +49 -0
- package/dist/shared/atbash-targets.js +63 -0
- package/dist/shared/atbash-targets.js.map +1 -0
- package/dist/shared/openclaw-runtime.d.ts +221 -0
- package/dist/shared/openclaw-runtime.js +476 -0
- package/dist/shared/openclaw-runtime.js.map +1 -0
- package/dist/shared/win-exec.d.ts +63 -0
- package/dist/shared/win-exec.js +147 -0
- package/dist/shared/win-exec.js.map +1 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -565,12 +565,40 @@ npx --yes @atbash/cli setup
|
|
|
565
565
|
| `--host <url>` | Deployment to check the agent's registration against |
|
|
566
566
|
| `--runtime <ids...>` | Only configure these runtimes (currently: `openclaw`) |
|
|
567
567
|
| `--dry-run` | Show which files would change, and the diffs, then exit WITHOUT writing |
|
|
568
|
-
| `-y, --yes` | Do not ask for confirmation before writing |
|
|
568
|
+
| `-y, --yes` | Do not ask for confirmation before writing (does **not** consent to replacing the agent — see `--replace-key`) |
|
|
569
|
+
| `--replace-key` | Consent to changing which agent this machine signs as, when the key supplied names a different agent than the one already here. Needed only for non-interactive runs |
|
|
569
570
|
| `--no-install` | Write the key file and configs only; install no packages |
|
|
570
571
|
| `--skip-verify` | Make no network calls at all |
|
|
571
572
|
| `--allow-unrecognized-host` | Permit a `--host` outside the built-in Atbash allowlist |
|
|
572
573
|
| `--home <dir>` | Home directory to configure (for testing) |
|
|
573
574
|
|
|
575
|
+
**Onboarding a different agent on a machine that already has one.**
|
|
576
|
+
|
|
577
|
+
Supply the new agent's key and setup will offer to switch. This is the one change
|
|
578
|
+
it makes that is a *substitution* rather than an addition: afterwards every
|
|
579
|
+
integration reading `~/.config/atbash/guard-client-key` signs as the new agent, so
|
|
580
|
+
tool calls are attributed to it. So it is asked on its own:
|
|
581
|
+
|
|
582
|
+
```
|
|
583
|
+
This machine is about to change which agent it signs as.
|
|
584
|
+
now: 0237722e87b6636d67ee495f57e27eae0e2624a382d0603c3b3a396643f230bf94
|
|
585
|
+
new: 02b95c249d84f417e3e395a127425428b540671cc15881eb828c17b722a53fc599
|
|
586
|
+
Every integration on this machine reading ~/.config/atbash/guard-client-key
|
|
587
|
+
will switch to the new agent. The current key is archived first, to
|
|
588
|
+
~/.config/atbash/keys/0237722e….key, so the old agent stays recoverable.
|
|
589
|
+
|
|
590
|
+
Replace the agent this machine signs as? [y/N]
|
|
591
|
+
```
|
|
592
|
+
|
|
593
|
+
Answer **no** and nothing is changed at all — the run stops rather than configuring
|
|
594
|
+
a runtime for an agent whose key was never installed, which would leave the machine
|
|
595
|
+
signing as one agent while the dashboard shows another.
|
|
596
|
+
|
|
597
|
+
`-y/--yes` deliberately does **not** answer this question: agreeing to write files
|
|
598
|
+
is not the same as agreeing to become a different agent. A script that means it
|
|
599
|
+
passes `--replace-key`. A fresh machine, or a re-run with the same agent, never sees
|
|
600
|
+
the prompt.
|
|
601
|
+
|
|
574
602
|
If no key is supplied, setup looks in order at `--key`, `--key-file`, `--keys-dir`,
|
|
575
603
|
`ATBASH_AGENT_KEY`, the existing `~/.config/atbash/guard-client-key`, your
|
|
576
604
|
`atbash config`, and finally a hidden prompt that accepts **either** a key or a path.
|
|
@@ -582,11 +610,11 @@ Wherever it comes from, the key is written once to
|
|
|
582
610
|
|
|
583
611
|
- It never transmits the private key. The only network call is a registration
|
|
584
612
|
check, and that sends the **public** key.
|
|
585
|
-
- It never writes the private key into an MCP client config. The
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
613
|
+
- It never writes the private key into an MCP client config. The entry it writes
|
|
614
|
+
points at `atbash mcp`, which reads the key from `guard-client-key` and hands it
|
|
615
|
+
to the server through the child process environment — so the config file carries
|
|
616
|
+
no credential, and an entry you previously hand-wired with one has the key
|
|
617
|
+
removed.
|
|
590
618
|
- It never edits your application source. Code-level integrations (LangChain,
|
|
591
619
|
LangGraph, AutoGen, Eliza, the SDK boundary) stay yours to write.
|
|
592
620
|
- It never rewrites a config that uses comments or trailing commas — reserializing
|
|
@@ -598,6 +626,27 @@ Wherever it comes from, the key is written once to
|
|
|
598
626
|
Every file it changes is copied to a `.atbash-bak` alongside it first, and repeat
|
|
599
627
|
runs are idempotent.
|
|
600
628
|
|
|
629
|
+
### `atbash mcp`
|
|
630
|
+
|
|
631
|
+
Runs the Atbash MCP server, reading the agent key from `~/.config/atbash/guard-client-key` instead of from a config file. You do not normally run this by hand — it is what `atbash setup` puts in your MCP client's server list:
|
|
632
|
+
|
|
633
|
+
```json
|
|
634
|
+
{ "mcpServers": { "atbash": { "command": "npx", "args": ["--yes", "@atbash/cli", "mcp"] } } }
|
|
635
|
+
```
|
|
636
|
+
|
|
637
|
+
| Flag | Description |
|
|
638
|
+
|------|-------------|
|
|
639
|
+
| `--key-file <path>` | Agent key file to read (default: `~/.config/atbash/guard-client-key`) |
|
|
640
|
+
| `--endpoint <url>` | Atbash endpoint the server should use |
|
|
641
|
+
|
|
642
|
+
**Why this exists.** `@atbash/mcp` reads its identity from `ATBASH_AGENT_PRIVKEY` and has no key-file fallback, so the wiring in its own docs puts a raw private key inside `claude_desktop_config.json` — a file people sync between machines and paste into help requests. This launcher keeps the key in the 0600 file and passes it to the server through the child process environment, so nothing secret is written to a config file.
|
|
643
|
+
|
|
644
|
+
An `ATBASH_AGENT_PRIVKEY` already present in the environment still wins, so if you deliberately inject the key at launch time nothing changes for you.
|
|
645
|
+
|
|
646
|
+
**Known issue it works around.** Every published `@atbash/mcp` (0.1.0–0.1.3) fails to start: they import `getOrgTierInfo` as a named export from `@atbash/sdk`, and `@atbash/sdk@0.3.24` removed it, so their `^0.3.19` range resolves to a version that cannot satisfy the import. This launcher installs the compatible pair together (`@atbash/mcp@0.1.3` with `@atbash/sdk@0.3.23`). That pinned SDK is itself deprecated — the real fix is republishing `@atbash/mcp` against `@atbash/sdk@^0.7`.
|
|
647
|
+
|
|
648
|
+
First launch takes ~10–15s while npx caches the packages, then about a second. A client with a short startup timeout may fail once and succeed on retry.
|
|
649
|
+
|
|
601
650
|
### `atbash judge <action>`
|
|
602
651
|
|
|
603
652
|
Submit a pending action for judgment. The action string is the exact operation the agent is about to execute — a transfer, a command, a mutation.
|
|
@@ -881,7 +930,7 @@ atbash set org-name my-org
|
|
|
881
930
|
atbash set provider openai
|
|
882
931
|
atbash set model gpt-4o
|
|
883
932
|
atbash set endpoint https://custom-endpoint.example.com
|
|
884
|
-
atbash set
|
|
933
|
+
atbash set network public # or "private" — pins the fleet-wide chain
|
|
885
934
|
|
|
886
935
|
# Remove a single value (reverts to default)
|
|
887
936
|
atbash unset provider
|
|
@@ -894,7 +943,7 @@ atbash unset endpoint
|
|
|
894
943
|
| Org name | `--org` | `ATBASH_ORG_NAME` | `atbash set org-name <name>` |
|
|
895
944
|
| API endpoint | `--endpoint` | `ATBASH_ENDPOINT` | `atbash set endpoint <url>` |
|
|
896
945
|
| Self-hosted judge signing key | `--verify-pubkey` (judge) | `ATBASH_JUDGE_VERIFY_PUBKEY` | config key `judgeVerifyPubKey` |
|
|
897
|
-
|
|
|
946
|
+
| Default chain network | — | `ATBASH_DEFAULT_CHAIN_NETWORK` | `atbash set network public\|private` |
|
|
898
947
|
|
|
899
948
|
> **Self-hosted judge:** the SDK only accepts an endpoint outside the trusted allowlist
|
|
900
949
|
> when the judge's 66-hex response-signing pubkey is supplied too, so every verdict can be
|
package/dist/bin/atbash.js
CHANGED
|
@@ -21,12 +21,13 @@ const held_1 = require("../commands/held");
|
|
|
21
21
|
const connect_1 = require("../commands/connect");
|
|
22
22
|
const scan_1 = require("../commands/scan");
|
|
23
23
|
const setup_1 = require("../commands/setup");
|
|
24
|
+
const mcp_cmd_1 = require("../commands/mcp-cmd");
|
|
24
25
|
const github_scan_1 = require("../commands/github-scan");
|
|
25
26
|
// ── Autocomplete ────────────────────────────────────────────────
|
|
26
27
|
const commands = [
|
|
27
28
|
"judge", "whoami", "policy", "tier", "tools", "held",
|
|
28
29
|
"history", "stats", "status", "keygen", "set", "unset",
|
|
29
|
-
"wipe", "config", "connect", "scan", "setup", "github-scan", "help",
|
|
30
|
+
"wipe", "config", "connect", "scan", "setup", "mcp", "github-scan", "help",
|
|
30
31
|
];
|
|
31
32
|
const subcommands = {
|
|
32
33
|
judge: [
|
|
@@ -43,6 +44,7 @@ const subcommands = {
|
|
|
43
44
|
tools: ["--agent", "--org", "--count", "--json", "inspect", "count"],
|
|
44
45
|
held: ["--org", "--count", "--json", "reviews"],
|
|
45
46
|
connect: ["--host", "--home"],
|
|
47
|
+
mcp: ["--key-file", "--endpoint"],
|
|
46
48
|
scan: ["--home", "--introspect", "--api-key", "--model", "--threats", "--policy", "--fail-on", "--json"],
|
|
47
49
|
setup: ["--key", "--key-file", "--keys-dir", "--host", "--runtime", "--dry-run", "--yes", "--no-install", "--skip-verify", "--home"],
|
|
48
50
|
"github-scan": [
|
|
@@ -59,8 +61,8 @@ const subcommands = {
|
|
|
59
61
|
"--include-bots",
|
|
60
62
|
"--json",
|
|
61
63
|
],
|
|
62
|
-
set: ["agent-key", "org-name", "endpoint", "
|
|
63
|
-
unset: ["agent-key", "org-name", "endpoint", "
|
|
64
|
+
set: ["agent-key", "org-name", "endpoint", "network", "provider", "model"],
|
|
65
|
+
unset: ["agent-key", "org-name", "endpoint", "network", "provider", "model"],
|
|
64
66
|
show: ["--agent-key", "--endpoint", "--json"],
|
|
65
67
|
inspect: ["--endpoint"],
|
|
66
68
|
reviews: ["--org", "--count", "--json"],
|
|
@@ -115,6 +117,7 @@ program
|
|
|
115
117
|
(0, connect_1.registerConnectCommand)(program);
|
|
116
118
|
(0, scan_1.registerScanCommand)(program);
|
|
117
119
|
(0, setup_1.registerSetupCommand)(program);
|
|
120
|
+
(0, mcp_cmd_1.registerMcpCommand)(program);
|
|
118
121
|
// External scanning
|
|
119
122
|
(0, github_scan_1.registerGithubScanCommand)(program);
|
|
120
123
|
async function main() {
|
package/dist/bin/atbash.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atbash.js","sourceRoot":"","sources":["../../src/bin/atbash.ts"],"names":[],"mappings":";;;;;;AACA,yCAAoC;AACpC,wDAAgC;AAChC,qCAAgE;AAChE,6CAAyD;AACzD,+CAA2D;AAC3D,+CAA2D;AAC3D,iDAA6D;AAC7D,6CAAyD;AACzD,uDAA+D;AAC/D,+CAA2D;AAC3D,+CAA2D;AAC3D,2CAAuD;AACvD,6CAAyD;AACzD,2CAAuD;AACvD,iDAA6D;AAC7D,2CAAuD;AACvD,6CAAyD;AACzD,yDAAoE;AAEpE,mEAAmE;AACnE,MAAM,QAAQ,G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;AAE9B,oBAAoB;AACpB,IAAA,0BAAmB,EAAC,OAAO,CAAC,CAAC;AAE7B,OAAO;AACP,IAAA,gCAAsB,EAAC,OAAO,CAAC,CAAC;AAChC,IAAA,4BAAoB,EAAC,OAAO,CAAC,CAAC;AAC9B,IAAA,8BAAqB,EAAC,OAAO,CAAC,CAAC;AAE/B,QAAQ;AACR,IAAA,8BAAqB,EAAC,OAAO,CAAC,CAAC;AAC/B,IAAA,kCAAqB,EAAC,OAAO,CAAC,CAAC;AAE/B,aAAa;AACb,IAAA,gCAAsB,EAAC,OAAO,CAAC,CAAC;AAChC,IAAA,0BAAmB,EAAC,OAAO,CAAC,CAAC;AAC7B,IAAA,4BAAoB,EAAC,OAAO,CAAC,CAAC;AAC9B,IAAA,4BAAkB,EAAC,OAAO,CAAC,CAAC;AAE5B,oBAAoB;AACpB,IAAA,uCAAyB,EAAC,OAAO,CAAC,CAAC;AAEnC,KAAK,UAAU,IAAI;IACjB,MAAM,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACvC,MAAM,IAAA,uBAAiB,GAAE,CAAC;AAC5B,CAAC;AAED,IAAI,EAAE,CAAC"}
|
|
@@ -13,7 +13,7 @@ function registerConfigCommand(program) {
|
|
|
13
13
|
program
|
|
14
14
|
.command("set")
|
|
15
15
|
.description("Save a configuration value")
|
|
16
|
-
.argument("<key-type>", "What to set: agent-key, org-name, endpoint,
|
|
16
|
+
.argument("<key-type>", "What to set: agent-key, org-name, endpoint, network, provider, model")
|
|
17
17
|
.argument("<value>", "The value to save")
|
|
18
18
|
.action((keyType, value) => {
|
|
19
19
|
const config = (0, sdk_1.loadUserConfig)();
|
|
@@ -60,41 +60,41 @@ function registerConfigCommand(program) {
|
|
|
60
60
|
console.log(chalk_1.default.green(`Model saved: ${config.providerModel}`));
|
|
61
61
|
break;
|
|
62
62
|
}
|
|
63
|
-
case "
|
|
64
|
-
const clean = value.trim().
|
|
65
|
-
if (
|
|
66
|
-
console.error(chalk_1.default.red(
|
|
63
|
+
case "network": {
|
|
64
|
+
const clean = value.trim().toLowerCase();
|
|
65
|
+
if (clean !== "public" && clean !== "private") {
|
|
66
|
+
console.error(chalk_1.default.red('Invalid network — must be "public" or "private".'));
|
|
67
67
|
process.exit(1);
|
|
68
68
|
}
|
|
69
|
-
config.
|
|
69
|
+
config.defaultChainNetwork = clean;
|
|
70
70
|
(0, sdk_1.saveUserConfig)(config);
|
|
71
|
-
console.log(chalk_1.default.green(`
|
|
71
|
+
console.log(chalk_1.default.green(`Default chain network saved: ${clean}`));
|
|
72
72
|
break;
|
|
73
73
|
}
|
|
74
74
|
default:
|
|
75
75
|
console.error(chalk_1.default.red(`Unknown key type: ${keyType}`));
|
|
76
|
-
console.error(chalk_1.default.dim("Valid: agent-key, org-name, endpoint,
|
|
76
|
+
console.error(chalk_1.default.dim("Valid: agent-key, org-name, endpoint, network, provider, model"));
|
|
77
77
|
process.exit(1);
|
|
78
78
|
}
|
|
79
79
|
});
|
|
80
80
|
program
|
|
81
81
|
.command("unset")
|
|
82
82
|
.description("Remove a single configuration value")
|
|
83
|
-
.argument("<key-type>", "What to unset: agent-key, org-name, endpoint,
|
|
83
|
+
.argument("<key-type>", "What to unset: agent-key, org-name, endpoint, network, provider, model")
|
|
84
84
|
.action((keyType) => {
|
|
85
85
|
const config = (0, sdk_1.loadUserConfig)();
|
|
86
86
|
const keyMap = {
|
|
87
87
|
"agent-key": "agentKey",
|
|
88
88
|
"org-name": "orgName",
|
|
89
89
|
endpoint: "judgeEndpoint",
|
|
90
|
-
|
|
90
|
+
network: "defaultChainNetwork",
|
|
91
91
|
provider: "provider",
|
|
92
92
|
model: "providerModel",
|
|
93
93
|
};
|
|
94
94
|
const configKey = keyMap[keyType];
|
|
95
95
|
if (!configKey) {
|
|
96
96
|
console.error(chalk_1.default.red(`Unknown key type: ${keyType}`));
|
|
97
|
-
console.error(chalk_1.default.dim("Valid: agent-key, org-name, endpoint,
|
|
97
|
+
console.error(chalk_1.default.dim("Valid: agent-key, org-name, endpoint, network, provider, model"));
|
|
98
98
|
process.exit(1);
|
|
99
99
|
}
|
|
100
100
|
if (config[configKey] === undefined) {
|
|
@@ -126,7 +126,7 @@ function registerConfigCommand(program) {
|
|
|
126
126
|
publicKey: config.agentKey ? (0, sdk_1.derivePublicKey)(config.agentKey) : null,
|
|
127
127
|
orgName: config.orgName || null,
|
|
128
128
|
endpoint: config.judgeEndpoint || sdk_1.DEFAULT_ENDPOINT,
|
|
129
|
-
|
|
129
|
+
defaultChainNetwork: config.defaultChainNetwork || "private",
|
|
130
130
|
provider: config.provider || null,
|
|
131
131
|
model: config.providerModel || null,
|
|
132
132
|
}, null, 2));
|
|
@@ -155,11 +155,11 @@ function registerConfigCommand(program) {
|
|
|
155
155
|
else {
|
|
156
156
|
console.log(` Endpoint: ${chalk_1.default.dim(`default (${sdk_1.DEFAULT_ENDPOINT})`)}`);
|
|
157
157
|
}
|
|
158
|
-
if (config.
|
|
159
|
-
console.log(`
|
|
158
|
+
if (config.defaultChainNetwork) {
|
|
159
|
+
console.log(` Chain network: ${chalk_1.default.white(config.defaultChainNetwork)}`);
|
|
160
160
|
}
|
|
161
161
|
else {
|
|
162
|
-
console.log(`
|
|
162
|
+
console.log(` Chain network: ${chalk_1.default.dim("default (private)")}`);
|
|
163
163
|
}
|
|
164
164
|
console.log();
|
|
165
165
|
console.log(chalk_1.default.bold(" Provider"));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-cmd.js","sourceRoot":"","sources":["../../src/commands/config-cmd.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"config-cmd.js","sourceRoot":"","sources":["../../src/commands/config-cmd.ts"],"names":[],"mappings":";;;;;AAeA,sDAyMC;AAvND,kDAA0B;AAC1B,qCAOqB;AAErB,SAAS,OAAO,CAAC,GAAW;IAC1B,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,KAAK,GAAG,GAAG,C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,QAAQ,IAAI,SAAS,CAAC,EAAE,CACjE,CAAC;QACF,IAAI,MAAM,CAAC,aAAa,EAAE,CAAC;YACzB,OAAO,CAAC,GAAG,CAAC,qBAAqB,eAAK,CAAC,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;QACxE,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -14,25 +14,6 @@ import { Command } from "commander";
|
|
|
14
14
|
* The discovery mirrors the dashboard's src/lib/scan/discover.ts and produces
|
|
15
15
|
* the same relay-safe payload the session endpoint expects.
|
|
16
16
|
*/
|
|
17
|
-
/**
|
|
18
|
-
* Official Atbash deployments that legitimately serve the onboarding flow.
|
|
19
|
-
*
|
|
20
|
-
* The pairing screen builds `--host` from the page you opened, so every origin
|
|
21
|
-
* that can host onboarding must appear here. If production were missing, the real
|
|
22
|
-
* atbash.ai would be flagged "unrecognized destination" — a false alarm on the
|
|
23
|
-
* genuine article, which is worse than silence: it teaches people and agents to
|
|
24
|
-
* wave through the one warning that actually catches a swapped host.
|
|
25
|
-
*
|
|
26
|
-
* Matched on EXACT hostname, never a suffix — "atbash.ai.evil.com" must not pass.
|
|
27
|
-
* Deliberately not a *.vercel.app wildcard: that would bless anyone's preview.
|
|
28
|
-
*/
|
|
29
|
-
export declare const KNOWN_HOSTS: Set<string>;
|
|
30
|
-
/**
|
|
31
|
-
* Used when neither --host nor ATBASH_HOST is given. Still the dev deployment,
|
|
32
|
-
* because it is the one running the current connector API; switch this to
|
|
33
|
-
* https://atbash.ai once production serves it (KNOWN_HOSTS already allows it).
|
|
34
|
-
*/
|
|
35
|
-
export declare const DEFAULT_HOST = "https://chromia-verified-ai-dev-two.vercel.app";
|
|
36
17
|
interface DeclaredTool {
|
|
37
18
|
name: string;
|
|
38
19
|
description?: string;
|
|
@@ -53,6 +34,7 @@ type Agent = {
|
|
|
53
34
|
detail: string;
|
|
54
35
|
declaredTools: DeclaredTool[];
|
|
55
36
|
surfaceEvidence?: SurfaceEvidence;
|
|
37
|
+
governance?: Governance;
|
|
56
38
|
} | {
|
|
57
39
|
type: "config";
|
|
58
40
|
label: string;
|
|
@@ -61,6 +43,7 @@ type Agent = {
|
|
|
61
43
|
mcpServers: Record<string, unknown>;
|
|
62
44
|
};
|
|
63
45
|
};
|
|
46
|
+
declare const MAX_RELAY_SERVERS = 200;
|
|
64
47
|
/** One-line skill description from SKILL.md frontmatter `description:` or first heading.
|
|
65
48
|
* Frontmatter is parsed with a real YAML parser (handles quotes, block scalars,
|
|
66
49
|
* folded/multiline values and nested maps that the previous regex mis-read). */
|
|
@@ -70,10 +53,6 @@ declare function describeSkill(text: string | undefined, fallback: string): stri
|
|
|
70
53
|
declare function safeDescription(raw: string): string | undefined;
|
|
71
54
|
/** Walk a skills root (bounded) → declared tools. Mirrors src/lib/scan/adapters/local-skills.ts. */
|
|
72
55
|
declare function enumerateSkills(root: string, maxDepth?: number, cap?: number): DeclaredTool[];
|
|
73
|
-
export declare const MCP_CONFIGS: {
|
|
74
|
-
label: string;
|
|
75
|
-
segs: string[];
|
|
76
|
-
}[];
|
|
77
56
|
/**
|
|
78
57
|
* THE sanitization boundary. Reduce an mcpServers map to the SANITIZED structural
|
|
79
58
|
* signal the hosted scanner needs — server name, host+path of the endpoint, and
|
|
@@ -87,6 +66,54 @@ export declare const MCP_CONFIGS: {
|
|
|
87
66
|
* size against the input size and label the result partial — see `discover()`.
|
|
88
67
|
*/
|
|
89
68
|
declare function relaySafeServers(servers: Record<string, unknown>): Record<string, unknown>;
|
|
69
|
+
/**
|
|
70
|
+
* Atbash's own wiring on this machine — is the boundary actually in place?
|
|
71
|
+
*
|
|
72
|
+
* The relay reported an agent's TOOL SURFACE and nothing about whether Atbash
|
|
73
|
+
* governs it, so the dashboard's "re-scan to confirm it reports as enforcing"
|
|
74
|
+
* had nothing to read. Worse, the two failures that matter most are invisible in
|
|
75
|
+
* a file listing: a plugin installed but never enabled, and a plugin enabled but
|
|
76
|
+
* pointed at no key. Both leave a machine that looks wired and enforces nothing.
|
|
77
|
+
*
|
|
78
|
+
* FILE READS ONLY. No processes are spawned, so this stays inside the read-only
|
|
79
|
+
* promise the onboarding page makes about this command. Everything below is a
|
|
80
|
+
* documented location:
|
|
81
|
+
*
|
|
82
|
+
* - OpenClaw: the plugin entry in `~/.openclaw/openclaw.json`. Both the current
|
|
83
|
+
* `openclaw` key and the legacy `atbash-plugin` key count, since the dashboard
|
|
84
|
+
* recognizes either.
|
|
85
|
+
* - Hermes: plugins are OPT-IN via a `plugins.enabled` allow-list in
|
|
86
|
+
* `~/.hermes/config.yaml` (hermes_cli/plugins.py:_get_enabled_plugins — a
|
|
87
|
+
* missing key means nothing loads), and the plugin reads its key path from
|
|
88
|
+
* `~/.hermes/.env`.
|
|
89
|
+
*
|
|
90
|
+
* `enforcing` is only ever true when BOTH the hook is switched on and a key path
|
|
91
|
+
* is configured. Reporting enforcement on the strength of an installed package
|
|
92
|
+
* would recreate the exact false green this is meant to catch.
|
|
93
|
+
*/
|
|
94
|
+
interface Governance {
|
|
95
|
+
installed: boolean;
|
|
96
|
+
enforcing: boolean;
|
|
97
|
+
entry?: string;
|
|
98
|
+
keyPathConfigured: boolean;
|
|
99
|
+
agentPubkey?: string;
|
|
100
|
+
/**
|
|
101
|
+
* Every agent this machine has been wired to, newest-known last.
|
|
102
|
+
*
|
|
103
|
+
* A machine governs exactly ONE agent at a time: the plugin config names one
|
|
104
|
+
* key path and that file holds one identity, so each `atbash setup` run
|
|
105
|
+
* displaces the previous agent and archives its key under
|
|
106
|
+
* `~/.config/atbash/keys/<pubkey>.key`. On a real box that had quietly rotated
|
|
107
|
+
* five times, nothing anywhere said so — the browser could not tell "already
|
|
108
|
+
* protected" from "protected, but for a different agent than the one you are
|
|
109
|
+
* onboarding".
|
|
110
|
+
*
|
|
111
|
+
* Only PUBLIC keys leave the machine, and only from filenames — the archived
|
|
112
|
+
* files are never opened. The current agent's key is included so the caller can
|
|
113
|
+
* mark which of the list is live without a second lookup.
|
|
114
|
+
*/
|
|
115
|
+
knownAgents?: string[];
|
|
116
|
+
}
|
|
90
117
|
/** Enumerate the agents/MCP tools configured on this machine. Read-only. */
|
|
91
118
|
declare function discover(home: string): Agent[];
|
|
92
119
|
/**
|
|
@@ -104,6 +131,39 @@ declare function readAllMcpServers(home: string): {
|
|
|
104
131
|
label: string;
|
|
105
132
|
servers: Record<string, unknown>;
|
|
106
133
|
}[];
|
|
134
|
+
/**
|
|
135
|
+
* Vet the SHAPE of a relay destination — a separate, earlier question than
|
|
136
|
+
* whether the host is one of ours.
|
|
137
|
+
*
|
|
138
|
+
* `--host` is copied off a web page and everything `discover()` finds is POSTed
|
|
139
|
+
* to it, so the string itself is attacker-influenced. Four refusals:
|
|
140
|
+
*
|
|
141
|
+
* - **Unparseable.** Anything unrecognized is refused rather than tried.
|
|
142
|
+
* - **Credentials** (`user:pass@`). They have no use here, and they are how a
|
|
143
|
+
* lookalike URL hides its real host from someone skimming a pasted command.
|
|
144
|
+
* - **A query string or fragment.** The endpoint path is APPENDED to this
|
|
145
|
+
* value, so a `?` or `#` swallows it and sends the payload somewhere nobody
|
|
146
|
+
* reviewed: `https://h/?x=` + `/api/agent-scan/...` requests `/` instead.
|
|
147
|
+
* - **Plain HTTP**, except to loopback so a local dev server still works.
|
|
148
|
+
*
|
|
149
|
+
* The KNOWN_HOSTS allowlist is the SEPARATE gate applied after this one, and it
|
|
150
|
+
* is what makes a swapped host non-exfiltrating; this is the shape check that
|
|
151
|
+
* keeps a well-formed-looking URL from quietly redirecting the request. Both
|
|
152
|
+
* must pass before anything is sent.
|
|
153
|
+
*/
|
|
154
|
+
export interface HostVerdict {
|
|
155
|
+
/** Normalized `scheme://host[/path]`; the raw trimmed input if unparseable. */
|
|
156
|
+
host: string;
|
|
157
|
+
hostname: string;
|
|
158
|
+
isLoopback: boolean;
|
|
159
|
+
/** An official Atbash deployment, or this machine for local development. */
|
|
160
|
+
recognized: boolean;
|
|
161
|
+
/** Non-null means refuse to send. User-facing text. */
|
|
162
|
+
problem: string | null;
|
|
163
|
+
/** Optional remediation line shown after `problem`. */
|
|
164
|
+
hint?: string;
|
|
165
|
+
}
|
|
166
|
+
export declare function checkRelayHost(raw: string): HostVerdict;
|
|
107
167
|
export declare function registerConnectCommand(program: Command): void;
|
|
108
|
-
export { discover, enumerateSkills, describeSkill, relaySafeServers, safeDescription, readAllMcpServers };
|
|
168
|
+
export { discover, enumerateSkills, describeSkill, relaySafeServers, safeDescription, readAllMcpServers, MAX_RELAY_SERVERS };
|
|
109
169
|
export type { Agent, DeclaredTool };
|