run402 4.97.0 → 4.99.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 +1 -1
- package/core-dist/binding-file.js +28 -1
- package/core-dist/wallet.js +3 -3
- package/lib/auth.mjs +1 -2
- package/lib/buzz-doctor.mjs +21 -806
- package/lib/buzz-doctor.test.mjs +7 -6
- package/lib/buzz.test.mjs +13 -2
- package/lib/doctor.mjs +72 -811
- package/lib/init.mjs +35 -576
- package/lib/org-context.mjs +39 -376
- package/lib/orgs.mjs +22 -106
- package/lib/projects.mjs +1 -2
- package/lib/repos.mjs +6 -6
- package/lib/rooms.mjs +1 -2
- package/lib/sdk-errors.mjs +26 -0
- package/lib/status.mjs +14 -154
- package/lib/up.mjs +1 -2
- package/lib/vault-scaffold.mjs +2 -3
- package/lib/vault-target.mjs +14 -141
- package/lib/wallet-context.mjs +61 -227
- package/lib/wallets.mjs +47 -310
- package/package.json +1 -2
- package/sdk/core-dist/binding-file.js +28 -1
- package/sdk/core-dist/wallet.js +3 -3
- package/sdk/dist/errors.d.ts +24 -2
- package/sdk/dist/errors.d.ts.map +1 -1
- package/sdk/dist/errors.js +44 -2
- package/sdk/dist/errors.js.map +1 -1
- package/sdk/dist/index.d.ts +18 -3
- package/sdk/dist/index.d.ts.map +1 -1
- package/sdk/dist/index.js +12 -1
- package/sdk/dist/index.js.map +1 -1
- package/sdk/dist/kernel.d.ts +34 -0
- package/sdk/dist/kernel.d.ts.map +1 -1
- package/sdk/dist/kernel.js +15 -1
- package/sdk/dist/kernel.js.map +1 -1
- package/sdk/dist/namespaces/admin.d.ts.map +1 -1
- package/sdk/dist/namespaces/admin.js +8 -0
- package/sdk/dist/namespaces/admin.js.map +1 -1
- package/sdk/dist/namespaces/agent.d.ts +2 -2
- package/sdk/dist/namespaces/agent.d.ts.map +1 -1
- package/sdk/dist/namespaces/agent.js +4 -0
- package/sdk/dist/namespaces/agent.js.map +1 -1
- package/sdk/dist/namespaces/agent.types.d.ts +5 -0
- package/sdk/dist/namespaces/agent.types.d.ts.map +1 -1
- package/sdk/dist/namespaces/apps.d.ts.map +1 -1
- package/sdk/dist/namespaces/apps.js +2 -0
- package/sdk/dist/namespaces/apps.js.map +1 -1
- package/sdk/dist/namespaces/auth.d.ts.map +1 -1
- package/sdk/dist/namespaces/auth.js +9 -0
- package/sdk/dist/namespaces/auth.js.map +1 -1
- package/sdk/dist/namespaces/branches.d.ts.map +1 -1
- package/sdk/dist/namespaces/branches.js +2 -0
- package/sdk/dist/namespaces/branches.js.map +1 -1
- package/sdk/dist/namespaces/ci.d.ts.map +1 -1
- package/sdk/dist/namespaces/ci.js +2 -0
- package/sdk/dist/namespaces/ci.js.map +1 -1
- package/sdk/dist/namespaces/credentials.d.ts +0 -23
- package/sdk/dist/namespaces/credentials.d.ts.map +1 -1
- package/sdk/dist/namespaces/credentials.js +29 -0
- package/sdk/dist/namespaces/credentials.js.map +1 -1
- package/sdk/dist/namespaces/escalations.d.ts.map +1 -1
- package/sdk/dist/namespaces/escalations.js +2 -0
- package/sdk/dist/namespaces/escalations.js.map +1 -1
- package/sdk/dist/namespaces/grants.d.ts.map +1 -1
- package/sdk/dist/namespaces/grants.js +4 -0
- package/sdk/dist/namespaces/grants.js.map +1 -1
- package/sdk/dist/namespaces/live.d.ts +0 -16
- package/sdk/dist/namespaces/live.d.ts.map +1 -1
- package/sdk/dist/namespaces/live.js +19 -0
- package/sdk/dist/namespaces/live.js.map +1 -1
- package/sdk/dist/namespaces/me.d.ts.map +1 -1
- package/sdk/dist/namespaces/me.js +3 -0
- package/sdk/dist/namespaces/me.js.map +1 -1
- package/sdk/dist/namespaces/org.d.ts.map +1 -1
- package/sdk/dist/namespaces/org.js +3 -0
- package/sdk/dist/namespaces/org.js.map +1 -1
- package/sdk/dist/namespaces/projects.d.ts.map +1 -1
- package/sdk/dist/namespaces/projects.js +5 -0
- package/sdk/dist/namespaces/projects.js.map +1 -1
- package/sdk/dist/namespaces/repos.d.ts.map +1 -1
- package/sdk/dist/namespaces/repos.js +5 -0
- package/sdk/dist/namespaces/repos.js.map +1 -1
- package/sdk/dist/namespaces/rooms.d.ts.map +1 -1
- package/sdk/dist/namespaces/rooms.js +3 -0
- package/sdk/dist/namespaces/rooms.js.map +1 -1
- package/sdk/dist/namespaces/session.d.ts.map +1 -1
- package/sdk/dist/namespaces/session.js +18 -0
- package/sdk/dist/namespaces/session.js.map +1 -1
- package/sdk/dist/namespaces/transfers.d.ts.map +1 -1
- package/sdk/dist/namespaces/transfers.js +3 -0
- package/sdk/dist/namespaces/transfers.js.map +1 -1
- package/sdk/dist/namespaces/wallets.d.ts.map +1 -1
- package/sdk/dist/namespaces/wallets.js +2 -0
- package/sdk/dist/namespaces/wallets.js.map +1 -1
- package/sdk/dist/namespaces/write-approval.d.ts.map +1 -1
- package/sdk/dist/namespaces/write-approval.js +3 -0
- package/sdk/dist/namespaces/write-approval.js.map +1 -1
- package/sdk/dist/node/actions-node.d.ts.map +1 -1
- package/sdk/dist/node/actions-node.js +3 -0
- package/sdk/dist/node/actions-node.js.map +1 -1
- package/sdk/dist/node/buzz-doctor-contract.d.ts +155 -0
- package/sdk/dist/node/buzz-doctor-contract.d.ts.map +1 -0
- package/sdk/dist/node/buzz-doctor-contract.js +385 -0
- package/sdk/dist/node/buzz-doctor-contract.js.map +1 -0
- package/sdk/dist/node/buzz-doctor.d.ts +155 -0
- package/sdk/dist/node/buzz-doctor.d.ts.map +1 -0
- package/sdk/dist/node/buzz-doctor.js +810 -0
- package/sdk/dist/node/buzz-doctor.js.map +1 -0
- package/sdk/dist/node/credentials.d.ts +9 -4
- package/sdk/dist/node/credentials.d.ts.map +1 -1
- package/sdk/dist/node/credentials.js +1 -1
- package/sdk/dist/node/credentials.js.map +1 -1
- package/sdk/dist/node/diagnostics.d.ts +45 -0
- package/sdk/dist/node/diagnostics.d.ts.map +1 -0
- package/sdk/dist/node/diagnostics.js +67 -0
- package/sdk/dist/node/diagnostics.js.map +1 -0
- package/sdk/dist/node/doctor.d.ts +101 -0
- package/sdk/dist/node/doctor.d.ts.map +1 -0
- package/sdk/dist/node/doctor.js +618 -0
- package/sdk/dist/node/doctor.js.map +1 -0
- package/sdk/dist/node/index.d.ts +57 -5
- package/sdk/dist/node/index.d.ts.map +1 -1
- package/sdk/dist/node/index.js +36 -1
- package/sdk/dist/node/index.js.map +1 -1
- package/sdk/dist/node/init.d.ts +137 -0
- package/sdk/dist/node/init.d.ts.map +1 -0
- package/sdk/dist/node/init.js +507 -0
- package/sdk/dist/node/init.js.map +1 -0
- package/sdk/dist/node/lightning-wallet.d.ts +61 -0
- package/sdk/dist/node/lightning-wallet.d.ts.map +1 -0
- package/sdk/dist/node/lightning-wallet.js +126 -0
- package/sdk/dist/node/lightning-wallet.js.map +1 -0
- package/sdk/dist/node/local-actions.d.ts +23 -0
- package/sdk/dist/node/local-actions.d.ts.map +1 -0
- package/sdk/dist/node/local-actions.js +38 -0
- package/sdk/dist/node/local-actions.js.map +1 -0
- package/sdk/dist/node/org-context.d.ts +169 -0
- package/sdk/dist/node/org-context.d.ts.map +1 -0
- package/sdk/dist/node/org-context.js +403 -0
- package/sdk/dist/node/org-context.js.map +1 -0
- package/sdk/dist/node/status.d.ts +62 -0
- package/sdk/dist/node/status.d.ts.map +1 -0
- package/sdk/dist/node/status.js +132 -0
- package/sdk/dist/node/status.js.map +1 -0
- package/sdk/dist/node/vault-target.d.ts +49 -0
- package/sdk/dist/node/vault-target.d.ts.map +1 -0
- package/sdk/dist/node/vault-target.js +109 -0
- package/sdk/dist/node/vault-target.js.map +1 -0
- package/sdk/dist/node/wallets.d.ts +242 -0
- package/sdk/dist/node/wallets.d.ts.map +1 -0
- package/sdk/dist/node/wallets.js +484 -0
- package/sdk/dist/node/wallets.js.map +1 -0
- package/sdk/dist/secret-gate.d.ts +377 -0
- package/sdk/dist/secret-gate.d.ts.map +1 -0
- package/sdk/dist/secret-gate.js +273 -0
- package/sdk/dist/secret-gate.js.map +1 -0
- package/vault-surface.json +1 -1
- package/fixtures/buzz-v0.5.2-cli-capabilities.json +0 -92
- package/fixtures/run402-buzz-doctor-v1-contract.json +0 -140
- package/lib/buzz-doctor-contract.mjs +0 -97
- package/lib/buzz-doctor-contract.test.mjs +0 -134
- package/lib/lightning-wallet.mjs +0 -115
package/README.md
CHANGED
|
@@ -76,7 +76,7 @@ run402 repos list --org org_1a2b3c
|
|
|
76
76
|
run402 repos delete --project prj_xyz --force # refuses without --force while the vault holds generations
|
|
77
77
|
```
|
|
78
78
|
|
|
79
|
-
A hosted git remote, encrypted before it leaves the machine — no deploy, no manifest, no app. `origin` is claimed additively — an existing `origin` is never touched, the run402 remote falls back to `run402` instead. A directory inside another repository is never scaffolded into that repository: the skip carries a `create_nested_repo` next action, `--nested` makes it its own nested repository (one line appended to the enclosing repository's local `.git/info/exclude`, nothing else touched), and `create` prints a `git push` next action only for a remote it actually added.
|
|
79
|
+
A hosted git remote, encrypted before it leaves the machine — no deploy, no manifest, no app. `origin` is claimed additively — an existing `origin` is never touched, the run402 remote falls back to `run402` instead. A directory inside another repository is never scaffolded into that repository: the skip carries a `create_nested_repo` next action, `--nested` makes it its own nested repository (one line appended to the enclosing repository's local `.git/info/exclude`, nothing else touched), and `create` prints a `git push` next action only for a remote it actually added. From MCP, the vault is reached through a `run` snippet against `r.repos`; the verbs that mint or redeem a one-time secret (`handoff`/`invite` keys, `resume`/`join`) refuse there with `SECRET_REQUIRES_CLI`, naming the `run402 repos` command to hand the person. See `run402 repos --help` for the full tiered surface (common: `create`/`view`/`list`; occasional: `capture`/`mirror`/`recover`/`handoff`/`resume`/`invite`/`join`; lifecycle: `rename`/`delete`; maintenance: `fsck`/`gc`/`access`/`policy`), and the CLI reference's `repos` section for the terminal-loss statement and the progressive backup warning.
|
|
80
80
|
|
|
81
81
|
**Handoff / resume.** `run402 repos handoff [--note-file <path>]` captures the actual working tree (staged/unstaged/untracked, like `git stash push -u`) into the vault and mints a single-use bearer key (`kgh1_…`, printed to stdout exactly once); `run402 repos resume <kgh1_…>` claims it on another machine, clones fresh, and reapplies the exact dirty state with `git stash apply --index`. No shared keystore, no shared wallet — the key is the whole handoff. On a wallet with no active tier, `resume` first folds the same cold-start chain `create` does (wallet → faucet → one x402 prototype payment); `--no-init` opts out, and the claim itself never waits on it. Sensitive untracked files (`.env`, `*.pem`, SSH/AWS/GPG dirs, …) are excluded from capture by default (`--include-sensitive <glob>` re-admits one). See the reference `run402.com/llms-cli.txt` for the full note-schema and flag reference.
|
|
82
82
|
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* Unknown keys are ignored on purpose: that is what makes an older client
|
|
23
23
|
* forward-compatible with a binding file written by a newer one.
|
|
24
24
|
*/
|
|
25
|
-
import { readFileSync } from "node:fs";
|
|
25
|
+
import { existsSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
26
26
|
import { dirname, join, resolve } from "node:path";
|
|
27
27
|
/** The committed binding file. Safe to check in — it names, never authorizes. */
|
|
28
28
|
export const BINDING_FILE = ".run402.json";
|
|
@@ -80,4 +80,31 @@ export function readBindingFile(dir = process.cwd()) {
|
|
|
80
80
|
return {};
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* MERGE keys into a directory's committed binding file. A `null` (or
|
|
85
|
+
* `undefined`) value removes its key; a file left with no keys is deleted
|
|
86
|
+
* rather than committed empty.
|
|
87
|
+
*
|
|
88
|
+
* The file is shared by tiers (`wallet` from `wallets bind`, `org`/`room` from
|
|
89
|
+
* `orgs bind`) and unknown keys are preserved, so one tier can never clobber
|
|
90
|
+
* another's binding.
|
|
91
|
+
*/
|
|
92
|
+
export function updateBindingFile(dir, patch) {
|
|
93
|
+
const file = bindingFilePath(dir);
|
|
94
|
+
const next = { ...readBindingFile(dir) };
|
|
95
|
+
for (const [k, v] of Object.entries(patch)) {
|
|
96
|
+
if (v === null || v === undefined)
|
|
97
|
+
delete next[k];
|
|
98
|
+
else
|
|
99
|
+
next[k] = v;
|
|
100
|
+
}
|
|
101
|
+
if (Object.keys(next).length === 0) {
|
|
102
|
+
const existed = existsSync(file);
|
|
103
|
+
if (existed)
|
|
104
|
+
rmSync(file, { force: true });
|
|
105
|
+
return { file, contents: null, removed: existed };
|
|
106
|
+
}
|
|
107
|
+
writeFileSync(file, JSON.stringify(next, null, 2) + "\n");
|
|
108
|
+
return { file, contents: next, removed: false };
|
|
109
|
+
}
|
|
83
110
|
//# sourceMappingURL=binding-file.js.map
|
package/core-dist/wallet.js
CHANGED
|
@@ -22,9 +22,9 @@ const PRIVATE_KEY_RE = /^0x[a-fA-F0-9]{64}$/;
|
|
|
22
22
|
* - `core/src/wallet-auth.ts` passes a malformed `privateKey` to
|
|
23
23
|
* `@noble/curves` which throws "expected 32 bytes, got N".
|
|
24
24
|
*
|
|
25
|
-
* The CLI's `cli/lib/config.mjs:readWallet()` wrapper and the
|
|
26
|
-
* `src/
|
|
27
|
-
* structured envelopes (`code: BAD_WALLET_FILE`).
|
|
25
|
+
* The CLI's `cli/lib/config.mjs:readWallet()` wrapper and the Node SDK's
|
|
26
|
+
* `readLocalWallet()` (`sdk/src/node/wallets.ts`) translate the throw into
|
|
27
|
+
* their own structured envelopes (`code: BAD_WALLET_FILE`).
|
|
28
28
|
*/
|
|
29
29
|
/**
|
|
30
30
|
* If a wallet file is readable by group or other (any of the low 0o077
|
package/lib/auth.mjs
CHANGED
|
@@ -710,8 +710,7 @@ function scaffoldIdent(args, flag, def) {
|
|
|
710
710
|
|
|
711
711
|
// Pure, offline generator — no SDK / network / project. Emits the conventional
|
|
712
712
|
// role-table migration, the matching requireRole gate snippet, and a
|
|
713
|
-
// first-operator bootstrap.
|
|
714
|
-
// src/tools/scaffold-roles.ts — same artifacts, different presentation.)
|
|
713
|
+
// first-operator bootstrap.
|
|
715
714
|
function scaffoldRoles(args) {
|
|
716
715
|
const table = scaffoldIdent(args, "--table", "app_roles");
|
|
717
716
|
const userCol = scaffoldIdent(args, "--user-col", "user_id");
|