@1claw/cli 0.59.9 → 0.60.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/README.md +54 -2
- package/dist/src/commands/approval.d.ts.map +1 -1
- package/dist/src/commands/approval.js +35 -16
- package/dist/src/commands/approval.js.map +1 -1
- package/dist/src/commands/browser.d.ts +21 -0
- package/dist/src/commands/browser.d.ts.map +1 -0
- package/dist/src/commands/browser.js +362 -0
- package/dist/src/commands/browser.js.map +1 -0
- package/dist/src/commands/chart.d.ts +6 -0
- package/dist/src/commands/chart.d.ts.map +1 -0
- package/dist/src/commands/chart.js +190 -0
- package/dist/src/commands/chart.js.map +1 -0
- package/dist/src/commands/connector.d.ts +3 -0
- package/dist/src/commands/connector.d.ts.map +1 -0
- package/dist/src/commands/connector.js +136 -0
- package/dist/src/commands/connector.js.map +1 -0
- package/dist/src/commands/env.js +71 -1
- package/dist/src/commands/env.js.map +1 -1
- package/dist/src/commands/notify.d.ts +3 -0
- package/dist/src/commands/notify.d.ts.map +1 -0
- package/dist/src/commands/notify.js +155 -0
- package/dist/src/commands/notify.js.map +1 -0
- package/dist/src/commands/platform.js +231 -0
- package/dist/src/commands/platform.js.map +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +9 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/local-vault.d.ts.map +1 -1
- package/dist/src/local-vault.js +43 -7
- package/dist/src/local-vault.js.map +1 -1
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @1claw/cli (v0.59.
|
|
1
|
+
# @1claw/cli (v0.59.9)
|
|
2
2
|
|
|
3
3
|
> ⭐ **Star [1clawAI/agent-templates](https://github.com/1clawAI/agent-templates)** — ready-to-run agent templates wired to 1Claw. It is our single starred repo.
|
|
4
4
|
|
|
@@ -773,6 +773,18 @@ Manage platform apps for developers building multi-tenant applications on top of
|
|
|
773
773
|
1claw platform reissue-claim <connection-id> # Reissue a claim URL (no re-provisioning)
|
|
774
774
|
1claw platform app-stats <app-id> # Connection/bootstrap/grant statistics
|
|
775
775
|
1claw platform marketplace # Browse the public platform marketplace
|
|
776
|
+
|
|
777
|
+
# Fleets — every agent one template provisioned, as one cohort.
|
|
778
|
+
# Each of these acts on all of them at once, so the mutating ones confirm
|
|
779
|
+
# first and print how many agents they are about to touch.
|
|
780
|
+
1claw platform fleet status <app-id> <template-id> # Version skew and drift
|
|
781
|
+
1claw platform fleet agents <app-id> <template-id> # List them (--drifted to filter)
|
|
782
|
+
1claw platform fleet patch <app-id> <template-id> \
|
|
783
|
+
--set system_prompt="You are..." # Guardrails/capability flags refused
|
|
784
|
+
1claw platform fleet rollout <app-id> <template-id> \
|
|
785
|
+
--dry-run # Plan; changes nothing, claims no job
|
|
786
|
+
1claw platform fleet rollout <app-id> <template-id> # Apply; skips hand-edited agents
|
|
787
|
+
1claw platform fleet pause <app-id> <template-id> # Deactivate the whole cohort
|
|
776
788
|
1claw platform upsert-user \
|
|
777
789
|
--email user@example.com # Provision or find a user (platform-only)
|
|
778
790
|
1claw platform upsert-user \
|
|
@@ -963,7 +975,9 @@ Browse the public agent directory and manage agent discoverability.
|
|
|
963
975
|
|
|
964
976
|
## Local Vault (Offline, Encrypted)
|
|
965
977
|
|
|
966
|
-
Store secrets locally in an encrypted vault — no cloud required. Secrets are encrypted at rest with AES-256-GCM using a passphrase-derived key (
|
|
978
|
+
Store secrets locally in an encrypted vault — no cloud required. Secrets are encrypted at rest with AES-256-GCM using a passphrase-derived key (**scrypt**, N=2^17, r=8).
|
|
979
|
+
|
|
980
|
+
Files written before v0.59.10 used PBKDF2 at 100k iterations. They still open, and are rewritten with scrypt the next time the vault is saved — a vault in use upgrades itself. The change matters because this file sits on your disk and its whole security is the passphrase: 100k SHA-256 rounds is a few milliseconds on a GPU, while scrypt at these parameters costs ~128MB and a few hundred milliseconds per guess.
|
|
967
981
|
|
|
968
982
|
```bash
|
|
969
983
|
1claw local init # Create local vault with passphrase
|
|
@@ -985,6 +999,44 @@ Vault file: `~/.config/1claw/local-vault.enc` (0600 permissions, safe to back up
|
|
|
985
999
|
|
|
986
1000
|
**Forgot your passphrase?** The vault is encrypted with a passphrase-derived key, so there is no recovery of the contents. To start over, run `1claw local destroy --force` (no passphrase required — it also stops any running daemon holding the old vault), then `1claw local init`.
|
|
987
1001
|
|
|
1002
|
+
## Browser Bridge (`browser`)
|
|
1003
|
+
|
|
1004
|
+
Let an agent log into a site without ever giving it the password. The agent
|
|
1005
|
+
drives the browser; the bridge types the secret.
|
|
1006
|
+
|
|
1007
|
+
```bash
|
|
1008
|
+
# Hosted — pair a machine, define what may be typed where
|
|
1009
|
+
1claw browser pair laptop --public-key "<bridge public key>"
|
|
1010
|
+
1claw browser devices # revoked devices are listed, not hidden
|
|
1011
|
+
1claw browser revoke <device-id> # what makes a leaked credential stop working
|
|
1012
|
+
|
|
1013
|
+
1claw browser binding create acme-login \
|
|
1014
|
+
--vault <vault-id> --path acme/password \
|
|
1015
|
+
--login-url https://app.acme.example/login \
|
|
1016
|
+
--hosts app.acme.example # exact match; wildcards are refused
|
|
1017
|
+
1claw browser binding list
|
|
1018
|
+
1claw browser binding rm <binding-id>
|
|
1019
|
+
|
|
1020
|
+
# Local file — no 1Claw account needed
|
|
1021
|
+
export ONECLAW_BRIDGE_VAULT_PASSPHRASE='…' # never a flag: argv shows up in ps
|
|
1022
|
+
1claw browser vault init ~/.1claw/bridge.json
|
|
1023
|
+
printf '%s' 'the-password' | 1claw browser vault add ~/.1claw/bridge.json \
|
|
1024
|
+
--id acme --url https://app.acme.example/login --hosts app.acme.example
|
|
1025
|
+
1claw browser vault list ~/.1claw/bridge.json # ids and rules, never a secret
|
|
1026
|
+
|
|
1027
|
+
# Run it
|
|
1028
|
+
1claw browser start --vault ~/.1claw/bridge.json --chrome /path/to/chrome
|
|
1029
|
+
```
|
|
1030
|
+
|
|
1031
|
+
This replaces `1claw-vault`, which shipped with `@1claw/browser-bridge`. That
|
|
1032
|
+
binary still works and prints a pointer; it goes in the next minor. It is the
|
|
1033
|
+
same file and the same format — `1claw browser vault` reads and writes through
|
|
1034
|
+
the bridge's own implementation rather than a second copy.
|
|
1035
|
+
|
|
1036
|
+
The local-file subcommands need `@1claw/browser-bridge` installed (an optional
|
|
1037
|
+
dependency) and **no account**. The hosted subcommands need an account and no
|
|
1038
|
+
extra install.
|
|
1039
|
+
|
|
988
1040
|
## Local Daemon (Secret Proxy)
|
|
989
1041
|
|
|
990
1042
|
The daemon serves secrets over a Unix socket and injects them into HTTP requests without exposing values to the AI model. This provides a trust boundary: the model knows *which* secret to use and *where* to send it, but never sees the raw value.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"approval.d.ts","sourceRoot":"","sources":["../../../src/commands/approval.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"approval.d.ts","sourceRoot":"","sources":["../../../src/commands/approval.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAqCpC,eAAO,MAAM,eAAe,SAE3B,CAAC"}
|
|
@@ -29,7 +29,10 @@ approvalCommand
|
|
|
29
29
|
printTable(result.approvals.map((a) => ({
|
|
30
30
|
id: a.id,
|
|
31
31
|
action: a.action,
|
|
32
|
-
target
|
|
32
|
+
// The sentence if there is one; the raw target otherwise.
|
|
33
|
+
target: a.human_summary
|
|
34
|
+
? truncate(a.human_summary, 40)
|
|
35
|
+
: `${a.target_type}/${a.target_id.slice(0, 8)}`,
|
|
33
36
|
risk: riskBadge(a.risk_tier),
|
|
34
37
|
status: statusBadge(a.status),
|
|
35
38
|
agent: a.agent_id.slice(0, 8),
|
|
@@ -40,7 +43,7 @@ approvalCommand
|
|
|
40
43
|
})), [
|
|
41
44
|
{ key: "id", header: "ID", width: 38 },
|
|
42
45
|
{ key: "action", header: "Action", width: 18 },
|
|
43
|
-
{ key: "target", header: "
|
|
46
|
+
{ key: "target", header: "Summary", width: 42 },
|
|
44
47
|
{ key: "risk", header: "Risk" },
|
|
45
48
|
{ key: "status", header: "Status" },
|
|
46
49
|
{ key: "agent", header: "Agent" },
|
|
@@ -90,17 +93,30 @@ approvalCommand
|
|
|
90
93
|
printJson(a);
|
|
91
94
|
return;
|
|
92
95
|
}
|
|
93
|
-
|
|
96
|
+
const rows = [
|
|
94
97
|
["ID", a.id],
|
|
95
98
|
["Action", a.action],
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
["
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
99
|
+
];
|
|
100
|
+
if (a.human_summary)
|
|
101
|
+
rows.push(["Summary", a.human_summary]);
|
|
102
|
+
rows.push(["Target Type", a.target_type], ["Target ID", a.target_id], ["Risk Tier", riskBadge(a.risk_tier)]);
|
|
103
|
+
// Only worth a line when the two disagree — otherwise it is noise.
|
|
104
|
+
if (a.declared_below_floor) {
|
|
105
|
+
rows.push([
|
|
106
|
+
"Requested Tier",
|
|
107
|
+
chalk.yellow(`${a.declared_risk_tier} (raised to ${a.risk_tier} by policy)`),
|
|
108
|
+
]);
|
|
109
|
+
}
|
|
110
|
+
rows.push(["Status", statusBadge(a.status)], ["Agent ID", a.agent_id]);
|
|
111
|
+
if (a.payload && Object.keys(a.payload).length > 0) {
|
|
112
|
+
rows.push(["Payload", JSON.stringify(a.payload)]);
|
|
113
|
+
}
|
|
114
|
+
if (a.reason)
|
|
115
|
+
rows.push(["Reason", a.reason]);
|
|
116
|
+
if (a.decision_reason)
|
|
117
|
+
rows.push(["Decision Reason", a.decision_reason]);
|
|
118
|
+
rows.push(["Created", new Date(a.created_at).toLocaleDateString()], ["Expires", a.expires_at ? new Date(a.expires_at).toLocaleDateString() : "—"]);
|
|
119
|
+
printKeyValue(rows);
|
|
104
120
|
}
|
|
105
121
|
catch (e) {
|
|
106
122
|
handleError(e);
|
|
@@ -127,16 +143,19 @@ approvalCommand
|
|
|
127
143
|
handleError(e);
|
|
128
144
|
}
|
|
129
145
|
});
|
|
146
|
+
function truncate(s, max) {
|
|
147
|
+
return s.length <= max ? s : `${s.slice(0, max - 1)}…`;
|
|
148
|
+
}
|
|
130
149
|
function riskBadge(tier) {
|
|
131
|
-
switch (tier
|
|
132
|
-
case
|
|
150
|
+
switch (tier) {
|
|
151
|
+
case 1:
|
|
133
152
|
return chalk.green("T1");
|
|
134
|
-
case
|
|
153
|
+
case 2:
|
|
135
154
|
return chalk.yellow("T2");
|
|
136
|
-
case
|
|
155
|
+
case 3:
|
|
137
156
|
return chalk.red("T3");
|
|
138
157
|
default:
|
|
139
|
-
return tier;
|
|
158
|
+
return String(tier);
|
|
140
159
|
}
|
|
141
160
|
}
|
|
142
161
|
function statusBadge(status) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"approval.js","sourceRoot":"","sources":["../../../src/commands/approval.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EACH,UAAU,EACV,aAAa,EACb,YAAY,EACZ,SAAS,EACT,SAAS,GACZ,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"approval.js","sourceRoot":"","sources":["../../../src/commands/approval.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EACH,UAAU,EACV,aAAa,EACb,YAAY,EACZ,SAAS,EACT,SAAS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OAAO,CAAC,EAAE,CAAC;QACT,WAAW,CAAC,CAAC,CAAC,CAAC;IACnB,CAAC;AACL,CAAC,CAAC,CAAC;AAEP,SAAS,QAAQ,CAAC,CAAS,EAAE,GAAW;IACpC,OAAO,CAAC,CAAC,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC;AAC3D,CAAC;AAED,SAAS,SAAS,CAAC,IAAY;IAC3B,QAAQ,IAAI,EAAE,CAAC;QACX,KAAK,CAAC;YACF,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC7B,KAAK,CAAC;YACF,OAAO,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAC9B,KAAK,CAAC;YACF,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC3B;YACI,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;AACL,CAAC;AAED,SAAS,WAAW,CAAC,MAAc;IAC/B,QAAQ,MAAM,CAAC,WAAW,EAAE,EAAE,CAAC;QAC3B,KAAK,SAAS;YACV,OAAO,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACnC,KAAK,UAAU;YACX,OAAO,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QACnC,KAAK,UAAU;YACX,OAAO,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QACjC;YACI,OAAO,MAAM,CAAC;IACtB,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
/**
|
|
3
|
+
* The browser bridge, hosted and local, under one command.
|
|
4
|
+
*
|
|
5
|
+
* There used to be a second binary — `1claw-vault`, shipped with
|
|
6
|
+
* `@1claw/browser-bridge` — because the bridge's local file backend needed
|
|
7
|
+
* managing and the main CLI had no commands for any of this. Two CLIs whose
|
|
8
|
+
* names differ by a hyphen, one of which shares a word with an unrelated
|
|
9
|
+
* subcommand (`1claw vault` manages *hosted* vaults), is a naming problem
|
|
10
|
+
* nobody can hold in their head.
|
|
11
|
+
*
|
|
12
|
+
* So: `1claw browser` for the hosted side, `1claw browser vault` for the local
|
|
13
|
+
* file. The split that matters is visible in the command itself.
|
|
14
|
+
*
|
|
15
|
+
* The local-file subcommands deliberately do **not** call `requireToken()`.
|
|
16
|
+
* The whole reason that backend exists is that someone can run the bridge with
|
|
17
|
+
* no 1Claw account, and folding it into this CLI must not quietly take that
|
|
18
|
+
* away.
|
|
19
|
+
*/
|
|
20
|
+
export declare const browserCommand: Command;
|
|
21
|
+
//# sourceMappingURL=browser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../../src/commands/browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOpC;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,cAAc,SACuD,CAAC"}
|
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
import { readFile, writeFile } from "node:fs/promises";
|
|
3
|
+
import { spawn } from "node:child_process";
|
|
4
|
+
import { api } from "../client.js";
|
|
5
|
+
import { requireToken, handleError } from "../middleware.js";
|
|
6
|
+
import { printTable, printJson, printSuccess, printKeyValue, printInfo, printError } from "../output.js";
|
|
7
|
+
/**
|
|
8
|
+
* The browser bridge, hosted and local, under one command.
|
|
9
|
+
*
|
|
10
|
+
* There used to be a second binary — `1claw-vault`, shipped with
|
|
11
|
+
* `@1claw/browser-bridge` — because the bridge's local file backend needed
|
|
12
|
+
* managing and the main CLI had no commands for any of this. Two CLIs whose
|
|
13
|
+
* names differ by a hyphen, one of which shares a word with an unrelated
|
|
14
|
+
* subcommand (`1claw vault` manages *hosted* vaults), is a naming problem
|
|
15
|
+
* nobody can hold in their head.
|
|
16
|
+
*
|
|
17
|
+
* So: `1claw browser` for the hosted side, `1claw browser vault` for the local
|
|
18
|
+
* file. The split that matters is visible in the command itself.
|
|
19
|
+
*
|
|
20
|
+
* The local-file subcommands deliberately do **not** call `requireToken()`.
|
|
21
|
+
* The whole reason that backend exists is that someone can run the bridge with
|
|
22
|
+
* no 1Claw account, and folding it into this CLI must not quietly take that
|
|
23
|
+
* away.
|
|
24
|
+
*/
|
|
25
|
+
export const browserCommand = new Command("browser")
|
|
26
|
+
.description("Browser bridge — pair devices, define bindings, run the bridge");
|
|
27
|
+
/**
|
|
28
|
+
* The vault refuses a bridge it will not speak to, and the check is on the
|
|
29
|
+
* pairing route as well as the fill routes — server-side, so a known-vulnerable
|
|
30
|
+
* build can be turned away without waiting for anyone to upgrade.
|
|
31
|
+
*
|
|
32
|
+
* The CLI is not a bridge, but it pairs *on behalf of* one, so it has to name a
|
|
33
|
+
* version. This is the protocol version it writes, not the CLI's own.
|
|
34
|
+
*/
|
|
35
|
+
const BRIDGE_PROTOCOL_VERSION = "0.1.0";
|
|
36
|
+
// ── Hosted: devices ─────────────────────────────────────────────────────────
|
|
37
|
+
browserCommand
|
|
38
|
+
.command("pair <label>")
|
|
39
|
+
.description("Pair this machine and mint its bridge credential (shown once)")
|
|
40
|
+
.requiredOption("--public-key <pin>", "The bridge's public key, pinned on first use")
|
|
41
|
+
.option("--bridge-version <v>", "Bridge version reported to the vault")
|
|
42
|
+
.option("-p, --password <password>", "Account password for the step-up re-auth")
|
|
43
|
+
.option("--json", "Output as JSON")
|
|
44
|
+
.action(async (label, opts) => {
|
|
45
|
+
try {
|
|
46
|
+
requireToken();
|
|
47
|
+
const res = await api("/browser/devices", {
|
|
48
|
+
method: "POST",
|
|
49
|
+
headers: {
|
|
50
|
+
"x-1claw-bridge-version": opts.bridgeVersion ?? BRIDGE_PROTOCOL_VERSION,
|
|
51
|
+
// Pairing is behind a step-up re-auth, deliberately: the
|
|
52
|
+
// device being paired is the one that will type secrets
|
|
53
|
+
// into pages, so a stolen session must not be enough.
|
|
54
|
+
...(opts.password ? { "X-Auth-Confirm": opts.password } : {}),
|
|
55
|
+
},
|
|
56
|
+
body: {
|
|
57
|
+
label,
|
|
58
|
+
public_key_pin: opts.publicKey,
|
|
59
|
+
bridge_version: opts.bridgeVersion ?? BRIDGE_PROTOCOL_VERSION,
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
if (opts.json)
|
|
63
|
+
return printJson(res);
|
|
64
|
+
printSuccess(`Paired "${res.label}".`);
|
|
65
|
+
printKeyValue([
|
|
66
|
+
["Device", res.device_id],
|
|
67
|
+
["Credential", res.credential],
|
|
68
|
+
]);
|
|
69
|
+
printInfo("Shown once. There is no endpoint that returns it again.");
|
|
70
|
+
}
|
|
71
|
+
catch (err) {
|
|
72
|
+
handleError(err);
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
browserCommand
|
|
76
|
+
.command("devices")
|
|
77
|
+
.description("List paired devices (revoked ones included)")
|
|
78
|
+
.option("--json", "Output as JSON")
|
|
79
|
+
.action(async (opts) => {
|
|
80
|
+
try {
|
|
81
|
+
requireToken();
|
|
82
|
+
const res = await api("/browser/devices");
|
|
83
|
+
if (opts.json)
|
|
84
|
+
return printJson(res);
|
|
85
|
+
// Revoked devices are listed rather than hidden: "was this machine
|
|
86
|
+
// ever paired" is the question people ask after a laptop goes missing.
|
|
87
|
+
printTable((res.devices ?? []).map((d) => ({
|
|
88
|
+
id: String(d.id ?? ""),
|
|
89
|
+
label: String(d.label ?? ""),
|
|
90
|
+
platform: String(d.platform ?? "—"),
|
|
91
|
+
last_seen: String(d.last_seen_at ?? "never"),
|
|
92
|
+
revoked: d.revoked_at ? String(d.revoked_at) : "—",
|
|
93
|
+
})), [
|
|
94
|
+
{ key: "id", header: "ID" },
|
|
95
|
+
{ key: "label", header: "Label" },
|
|
96
|
+
{ key: "platform", header: "Platform" },
|
|
97
|
+
{ key: "last_seen", header: "Last seen" },
|
|
98
|
+
{ key: "revoked", header: "Revoked" },
|
|
99
|
+
]);
|
|
100
|
+
}
|
|
101
|
+
catch (err) {
|
|
102
|
+
handleError(err);
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
browserCommand
|
|
106
|
+
.command("revoke <device-id>")
|
|
107
|
+
.description("Revoke a paired device — this is what makes a leaked credential stop working")
|
|
108
|
+
.action(async (deviceId) => {
|
|
109
|
+
try {
|
|
110
|
+
requireToken();
|
|
111
|
+
await api(`/browser/devices/${encodeURIComponent(deviceId)}`, { method: "DELETE" });
|
|
112
|
+
printSuccess(`Revoked ${deviceId}. It opens no sessions and authorises no fills.`);
|
|
113
|
+
}
|
|
114
|
+
catch (err) {
|
|
115
|
+
handleError(err);
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
// ── Hosted: bindings ────────────────────────────────────────────────────────
|
|
119
|
+
const binding = browserCommand
|
|
120
|
+
.command("binding")
|
|
121
|
+
.description("Which secret may be typed, and into which hosts");
|
|
122
|
+
binding
|
|
123
|
+
.command("create <name>")
|
|
124
|
+
.description("Define a binding (human only)")
|
|
125
|
+
.requiredOption("--vault <id>", "Vault holding the secret")
|
|
126
|
+
.requiredOption("--path <path>", "Secret path within the vault")
|
|
127
|
+
.requiredOption("--login-url <url>", "The page the bridge navigates to")
|
|
128
|
+
.requiredOption("--hosts <hosts>", "Comma-separated allowed hosts (exact match, no wildcards)")
|
|
129
|
+
.option("--sso-hosts <hosts>", "Comma-separated hosts a login may redirect through")
|
|
130
|
+
.option("--json", "Output as JSON")
|
|
131
|
+
.action(async (name, opts) => {
|
|
132
|
+
try {
|
|
133
|
+
requireToken();
|
|
134
|
+
const res = await api("/browser/credentials", {
|
|
135
|
+
method: "POST",
|
|
136
|
+
body: {
|
|
137
|
+
name,
|
|
138
|
+
vault_id: opts.vault,
|
|
139
|
+
secret_path: opts.path,
|
|
140
|
+
login_url: opts.loginUrl,
|
|
141
|
+
allowed_hosts: String(opts.hosts).split(",").map((h) => h.trim()).filter(Boolean),
|
|
142
|
+
...(opts.ssoHosts
|
|
143
|
+
? { sso_hosts: String(opts.ssoHosts).split(",").map((h) => h.trim()).filter(Boolean) }
|
|
144
|
+
: {}),
|
|
145
|
+
},
|
|
146
|
+
});
|
|
147
|
+
if (opts.json)
|
|
148
|
+
return printJson(res);
|
|
149
|
+
printSuccess(`Created binding "${name}".`);
|
|
150
|
+
}
|
|
151
|
+
catch (err) {
|
|
152
|
+
handleError(err);
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
binding
|
|
156
|
+
.command("list")
|
|
157
|
+
.description("List bindings")
|
|
158
|
+
.option("--json", "Output as JSON")
|
|
159
|
+
.action(async (opts) => {
|
|
160
|
+
try {
|
|
161
|
+
requireToken();
|
|
162
|
+
const res = await api("/browser/credentials");
|
|
163
|
+
if (opts.json)
|
|
164
|
+
return printJson(res);
|
|
165
|
+
printTable((res.credentials ?? []).map((c) => ({
|
|
166
|
+
id: String(c.id ?? ""),
|
|
167
|
+
name: String(c.name ?? ""),
|
|
168
|
+
login_url: String(c.login_url ?? ""),
|
|
169
|
+
hosts: Array.isArray(c.allowed_hosts) ? c.allowed_hosts.join(",") : "",
|
|
170
|
+
})), [
|
|
171
|
+
{ key: "id", header: "ID" },
|
|
172
|
+
{ key: "name", header: "Name" },
|
|
173
|
+
{ key: "login_url", header: "Login URL" },
|
|
174
|
+
{ key: "hosts", header: "Allowed hosts" },
|
|
175
|
+
]);
|
|
176
|
+
}
|
|
177
|
+
catch (err) {
|
|
178
|
+
handleError(err);
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
binding
|
|
182
|
+
.command("rm <binding-id>")
|
|
183
|
+
.description("Delete a binding")
|
|
184
|
+
.action(async (id) => {
|
|
185
|
+
try {
|
|
186
|
+
requireToken();
|
|
187
|
+
await api(`/browser/credentials/${encodeURIComponent(id)}`, { method: "DELETE" });
|
|
188
|
+
printSuccess(`Deleted binding ${id}.`);
|
|
189
|
+
}
|
|
190
|
+
catch (err) {
|
|
191
|
+
handleError(err);
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
// ── Local file: no account required ─────────────────────────────────────────
|
|
195
|
+
/**
|
|
196
|
+
* The passphrase, from the environment only.
|
|
197
|
+
*
|
|
198
|
+
* Never a flag: argv is world-readable in `ps` and lands in shell history.
|
|
199
|
+
*/
|
|
200
|
+
function passphrase() {
|
|
201
|
+
const p = process.env.ONECLAW_BRIDGE_VAULT_PASSPHRASE;
|
|
202
|
+
if (!p) {
|
|
203
|
+
printError("Set ONECLAW_BRIDGE_VAULT_PASSPHRASE — the passphrase is never taken as a flag.");
|
|
204
|
+
process.exit(1);
|
|
205
|
+
}
|
|
206
|
+
return p;
|
|
207
|
+
}
|
|
208
|
+
/** Read stdin to the end, for a secret that must not appear in argv. */
|
|
209
|
+
async function readStdin() {
|
|
210
|
+
const chunks = [];
|
|
211
|
+
for await (const c of process.stdin)
|
|
212
|
+
chunks.push(Buffer.from(c));
|
|
213
|
+
return Buffer.concat(chunks).toString("utf-8");
|
|
214
|
+
}
|
|
215
|
+
async function bridgeVaultApi() {
|
|
216
|
+
try {
|
|
217
|
+
// Resolved at run time, not build time: it is an optional dependency,
|
|
218
|
+
// so the type checker must not require it to be installed here.
|
|
219
|
+
const spec = "@1claw/browser-bridge";
|
|
220
|
+
return (await import(spec));
|
|
221
|
+
}
|
|
222
|
+
catch {
|
|
223
|
+
printError("The local-file commands need @1claw/browser-bridge, which is not installed.\n" +
|
|
224
|
+
" Install it alongside the CLI, or use `1claw browser` without `vault` for the hosted side.");
|
|
225
|
+
process.exit(1);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
async function loadFile(path) {
|
|
229
|
+
const { openVault } = await bridgeVaultApi();
|
|
230
|
+
return openVault(JSON.parse(await readFile(path, "utf-8")), passphrase());
|
|
231
|
+
}
|
|
232
|
+
async function saveFile(path, doc) {
|
|
233
|
+
const { sealVault } = await bridgeVaultApi();
|
|
234
|
+
// 0600: this file is the whole security boundary for a local backend.
|
|
235
|
+
await writeFile(path, JSON.stringify(await sealVault(doc, passphrase()), null, 2), {
|
|
236
|
+
mode: 0o600,
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
const localVault = browserCommand
|
|
240
|
+
.command("vault")
|
|
241
|
+
.description("The bridge's local encrypted file — no 1Claw account needed");
|
|
242
|
+
localVault
|
|
243
|
+
.command("init <file>")
|
|
244
|
+
.description("Create an empty vault file")
|
|
245
|
+
.action(async (file) => {
|
|
246
|
+
try {
|
|
247
|
+
await saveFile(file, { entries: [], registrations: [], captures: [] });
|
|
248
|
+
printSuccess(`Created ${file}`);
|
|
249
|
+
}
|
|
250
|
+
catch (err) {
|
|
251
|
+
handleError(err);
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
localVault
|
|
255
|
+
.command("add <file>")
|
|
256
|
+
.description("Add a credential. The secret comes from stdin, never from a flag.")
|
|
257
|
+
.requiredOption("--id <id>", "Binding id the agent will name")
|
|
258
|
+
.requiredOption("--url <url>", "Login URL the bridge navigates to")
|
|
259
|
+
.requiredOption("--hosts <hosts>", "Comma-separated allowed hosts")
|
|
260
|
+
.option("--sso <hosts>", "Comma-separated SSO hosts a login may redirect through")
|
|
261
|
+
.action(async (file, opts) => {
|
|
262
|
+
try {
|
|
263
|
+
const secret = (await readStdin()).replace(/\n$/, "");
|
|
264
|
+
if (!secret) {
|
|
265
|
+
printError("No secret on stdin. Pipe it: printf '%s' 'the-password' | 1claw browser vault add …");
|
|
266
|
+
process.exit(1);
|
|
267
|
+
}
|
|
268
|
+
const doc = await loadFile(file);
|
|
269
|
+
const entries = [...doc.entries.filter((e) => e.id !== opts.id), {
|
|
270
|
+
id: opts.id,
|
|
271
|
+
secret,
|
|
272
|
+
loginUrl: opts.url,
|
|
273
|
+
allowedHosts: String(opts.hosts).split(",").map((h) => h.trim()).filter(Boolean),
|
|
274
|
+
...(opts.sso
|
|
275
|
+
? { ssoHosts: String(opts.sso).split(",").map((h) => h.trim()).filter(Boolean) }
|
|
276
|
+
: {}),
|
|
277
|
+
}];
|
|
278
|
+
await saveFile(file, { ...doc, entries });
|
|
279
|
+
printSuccess(`Added ${opts.id}`);
|
|
280
|
+
}
|
|
281
|
+
catch (err) {
|
|
282
|
+
handleError(err);
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
localVault
|
|
286
|
+
.command("list <file>")
|
|
287
|
+
.description("List what the vault authorises — ids and rules, never a secret")
|
|
288
|
+
.action(async (file) => {
|
|
289
|
+
try {
|
|
290
|
+
const doc = await loadFile(file);
|
|
291
|
+
const rows = [];
|
|
292
|
+
for (const e of doc.entries) {
|
|
293
|
+
rows.push({ kind: "credential", id: e.id, url: e.loginUrl, detail: e.allowedHosts.join(",") });
|
|
294
|
+
}
|
|
295
|
+
for (const r of doc.registrations ?? []) {
|
|
296
|
+
rows.push({ kind: "signup", id: r.id, url: r.signupUrl, detail: r.username });
|
|
297
|
+
}
|
|
298
|
+
for (const c of doc.captures ?? []) {
|
|
299
|
+
rows.push({ kind: "capture", id: c.id, url: c.captureUrl, detail: c.allowedHosts.join(",") });
|
|
300
|
+
}
|
|
301
|
+
printTable(rows, [
|
|
302
|
+
{ key: "kind", header: "Kind" },
|
|
303
|
+
{ key: "id", header: "ID" },
|
|
304
|
+
{ key: "url", header: "URL" },
|
|
305
|
+
{ key: "detail", header: "Hosts / user" },
|
|
306
|
+
]);
|
|
307
|
+
}
|
|
308
|
+
catch (err) {
|
|
309
|
+
handleError(err);
|
|
310
|
+
}
|
|
311
|
+
});
|
|
312
|
+
localVault
|
|
313
|
+
.command("rm <file> <id>")
|
|
314
|
+
.description("Remove a credential, signup policy or capture policy by id")
|
|
315
|
+
.action(async (file, id) => {
|
|
316
|
+
try {
|
|
317
|
+
const doc = await loadFile(file);
|
|
318
|
+
await saveFile(file, {
|
|
319
|
+
...doc,
|
|
320
|
+
entries: doc.entries.filter((e) => e.id !== id),
|
|
321
|
+
registrations: (doc.registrations ?? []).filter((r) => r.id !== id),
|
|
322
|
+
captures: (doc.captures ?? []).filter((c) => c.id !== id),
|
|
323
|
+
});
|
|
324
|
+
printSuccess(`Removed ${id}`);
|
|
325
|
+
}
|
|
326
|
+
catch (err) {
|
|
327
|
+
handleError(err);
|
|
328
|
+
}
|
|
329
|
+
});
|
|
330
|
+
// ── Running the bridge ──────────────────────────────────────────────────────
|
|
331
|
+
browserCommand
|
|
332
|
+
.command("start")
|
|
333
|
+
.description("Run the bridge against a vault (hosted or local file)")
|
|
334
|
+
.option("--vault <file>", "Local vault file. Omit to use the hosted vault.")
|
|
335
|
+
.option("--chrome <path>", "Path to a Chromium binary")
|
|
336
|
+
.option("--port <port>", "Port for the gated CDP socket")
|
|
337
|
+
.allowUnknownOption(true)
|
|
338
|
+
.action(async (opts, cmd) => {
|
|
339
|
+
// Delegated rather than reimplemented. The bridge owns its own argument
|
|
340
|
+
// handling, and a second parser here would drift from it — the same way
|
|
341
|
+
// a second copy of the vault format did.
|
|
342
|
+
const args = [];
|
|
343
|
+
if (opts.vault)
|
|
344
|
+
args.push("--vault", opts.vault);
|
|
345
|
+
if (opts.chrome)
|
|
346
|
+
args.push("--chrome", opts.chrome);
|
|
347
|
+
if (opts.port)
|
|
348
|
+
args.push("--port", String(opts.port));
|
|
349
|
+
args.push(...(cmd.args ?? []));
|
|
350
|
+
const child = spawn("1claw-browser-bridge", args, { stdio: "inherit" });
|
|
351
|
+
child.on("error", (e) => {
|
|
352
|
+
if (e.code === "ENOENT") {
|
|
353
|
+
printError("1claw-browser-bridge is not on PATH.\n" +
|
|
354
|
+
" Install @1claw/browser-bridge, or run it from a checkout of the bridge repo.");
|
|
355
|
+
process.exit(1);
|
|
356
|
+
}
|
|
357
|
+
printError(String(e.message));
|
|
358
|
+
process.exit(1);
|
|
359
|
+
});
|
|
360
|
+
child.on("exit", (code) => process.exit(code ?? 0));
|
|
361
|
+
});
|
|
362
|
+
//# sourceMappingURL=browser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
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CAAC,CAAC;IACtD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC;IAE/B,MAAM,KAAK,GAAG,KAAK,CAAC,sBAAsB,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;IACxE,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,CAAwB,EAAE,EAAE;QAC3C,IAAI,CAAC,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YACtB,UAAU,CACN,wCAAwC;gBACpC,gFAAgF,CACvF,CAAC;YACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;QACD,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;QAC9B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC,CAAC,CAAC;IACH,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC;AACxD,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
export declare const diffCommand: Command;
|
|
3
|
+
export declare const applyCommand: Command;
|
|
4
|
+
/** Persist what an apply set, so the next run can tell drift from a first run. */
|
|
5
|
+
export declare function writeAppliedState(state: Record<string, unknown>): void;
|
|
6
|
+
//# sourceMappingURL=chart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chart.d.ts","sourceRoot":"","sources":["../../../src/commands/chart.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA+IpC,eAAO,MAAM,WAAW,SAoBlB,CAAC;AAEP,eAAO,MAAM,YAAY,SAgFnB,CAAC;AAEP,kFAAkF;AAClF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAGtE"}
|