run402 4.93.2 → 4.94.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 +43 -41
- package/cli.mjs +34 -29
- package/core-dist/config.js +52 -18
- package/core-dist/control-plane-session.js +31 -6
- package/core-dist/keystore.js +7 -7
- package/core-dist/profiles.js +9 -7
- package/core-dist/{allowance-auth.js → wallet-auth.js} +15 -15
- package/{sdk/core-dist/allowance.js → core-dist/wallet.js} +20 -20
- package/{sdk/core-dist/write-auth-session.js → core-dist/write-approvals.js} +19 -19
- package/gitvault-surface.json +1 -1
- package/lib/admin.mjs +1 -1
- package/lib/agent.mjs +20 -18
- package/lib/approve.mjs +81 -0
- package/lib/apps.mjs +3 -3
- package/lib/assets.mjs +2 -2
- package/lib/billing.mjs +6 -6
- package/lib/buzz-doctor.mjs +1 -1
- package/lib/buzz-notifications.mjs +1 -1
- package/lib/buzz.mjs +1 -1
- package/lib/buzz.test.mjs +1 -1
- package/lib/ci.mjs +4 -4
- package/lib/cold-start.mjs +21 -21
- package/lib/command-manifest.mjs +20 -34
- package/lib/config.mjs +24 -24
- package/lib/contacts.mjs +13 -13
- package/lib/contracts.mjs +1 -1
- package/lib/credentials.mjs +2 -2
- package/lib/daemon-path.mjs +1 -1
- package/lib/delegates.mjs +1 -1
- package/lib/deliveries.mjs +4 -4
- package/lib/deploy-rehearse-discovery.test.mjs +7 -7
- package/lib/deploy-v2.mjs +232 -184
- package/lib/deploy.mjs +21 -53
- package/lib/doctor-source-scan.mjs +1 -1
- package/lib/doctor.mjs +57 -57
- package/lib/escalations.mjs +1 -1
- package/lib/feedback.mjs +10 -10
- package/lib/gitvault-daemon.mjs +1 -1
- package/lib/image.mjs +3 -3
- package/lib/init.mjs +66 -66
- package/lib/lightning-wallet.mjs +28 -28
- package/lib/login.mjs +207 -0
- package/lib/logout.mjs +53 -0
- package/lib/next-actions.mjs +15 -15
- package/lib/org.mjs +100 -13
- package/lib/pay.mjs +1 -1
- package/lib/projects.mjs +26 -29
- package/lib/redeem.mjs +7 -8
- package/lib/remote-helper-session.mjs +12 -12
- package/lib/repos.mjs +62 -62
- package/lib/rooms.mjs +103 -67
- package/lib/sdk-errors.mjs +9 -4
- package/lib/sdk.mjs +3 -3
- package/lib/service.mjs +5 -5
- package/lib/session-proofs.mjs +21 -0
- package/lib/sign-in.mjs +296 -0
- package/lib/sites.mjs +8 -8
- package/lib/stats.mjs +2 -2
- package/lib/status.mjs +25 -25
- package/lib/subdomains.mjs +19 -19
- package/lib/subscriptions.mjs +8 -8
- package/lib/tier.mjs +29 -22
- package/lib/transfer.mjs +58 -85
- package/lib/up.mjs +7 -7
- package/lib/wallet-context.mjs +3 -3
- package/lib/wallet-context.test.mjs +3 -3
- package/lib/wallets.mjs +196 -31
- package/lib/webhook-secret.mjs +6 -6
- package/lib/whoami.mjs +75 -0
- package/package.json +1 -1
- package/sdk/core-dist/config.js +52 -18
- package/sdk/core-dist/control-plane-session.js +31 -6
- package/sdk/core-dist/keystore.js +7 -7
- package/sdk/core-dist/profiles.js +9 -7
- package/sdk/core-dist/{allowance-auth.js → wallet-auth.js} +15 -15
- package/{core-dist/allowance.js → sdk/core-dist/wallet.js} +20 -20
- package/{core-dist/write-auth-session.js → sdk/core-dist/write-approvals.js} +19 -19
- package/sdk/dist/actions.d.ts +1 -1
- package/sdk/dist/actions.d.ts.map +1 -1
- package/sdk/dist/control-plane-credentials.d.ts +8 -8
- package/sdk/dist/control-plane-credentials.js +7 -7
- package/sdk/dist/credentials.d.ts +19 -19
- package/sdk/dist/credentials.d.ts.map +1 -1
- package/sdk/dist/credentials.js +1 -1
- package/sdk/dist/errors.d.ts +24 -26
- package/sdk/dist/errors.d.ts.map +1 -1
- package/sdk/dist/errors.js +34 -37
- package/sdk/dist/errors.js.map +1 -1
- package/sdk/dist/index.d.ts +29 -16
- package/sdk/dist/index.d.ts.map +1 -1
- package/sdk/dist/index.js +29 -16
- package/sdk/dist/index.js.map +1 -1
- package/sdk/dist/kernel.d.ts +1 -1
- package/sdk/dist/kernel.d.ts.map +1 -1
- package/sdk/dist/kernel.js +10 -9
- package/sdk/dist/kernel.js.map +1 -1
- package/sdk/dist/namespaces/admin.d.ts +51 -120
- package/sdk/dist/namespaces/admin.d.ts.map +1 -1
- package/sdk/dist/namespaces/admin.js +41 -45
- 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 +2 -2
- package/sdk/dist/namespaces/agent.js.map +1 -1
- package/sdk/dist/namespaces/ai.d.ts +1 -1
- package/sdk/dist/namespaces/ai.js +1 -1
- package/sdk/dist/namespaces/billing.d.ts +6 -3
- package/sdk/dist/namespaces/billing.d.ts.map +1 -1
- package/sdk/dist/namespaces/billing.js.map +1 -1
- package/sdk/dist/namespaces/buzz-notifications.types.d.ts +1 -1
- package/sdk/dist/namespaces/buzz.d.ts +2 -2
- package/sdk/dist/namespaces/buzz.d.ts.map +1 -1
- package/sdk/dist/namespaces/buzz.js +2 -2
- package/sdk/dist/namespaces/buzz.js.map +1 -1
- package/sdk/dist/namespaces/buzz.types.d.ts +2 -2
- package/sdk/dist/namespaces/buzz.types.d.ts.map +1 -1
- package/sdk/dist/namespaces/credentials.types.d.ts +1 -1
- package/sdk/dist/namespaces/deploy.d.ts +1 -1
- package/sdk/dist/namespaces/deploy.js +5 -5
- package/sdk/dist/namespaces/deploy.js.map +1 -1
- package/sdk/dist/namespaces/deploy.types.d.ts +4 -4
- package/sdk/dist/namespaces/escalations.d.ts +1 -1
- package/sdk/dist/namespaces/escalations.js +1 -1
- package/sdk/dist/namespaces/escalations.types.d.ts +2 -2
- package/sdk/dist/namespaces/escalations.types.d.ts.map +1 -1
- package/sdk/dist/namespaces/events.types.d.ts +1 -1
- package/sdk/dist/namespaces/functions.d.ts +1 -1
- package/sdk/dist/namespaces/functions.js +1 -1
- package/sdk/dist/namespaces/gitvault.crypto.d.ts +1 -1
- package/sdk/dist/namespaces/gitvault.d.ts +24 -24
- package/sdk/dist/namespaces/gitvault.d.ts.map +1 -1
- package/sdk/dist/namespaces/gitvault.js +109 -109
- package/sdk/dist/namespaces/gitvault.js.map +1 -1
- package/sdk/dist/namespaces/me.d.ts +120 -0
- package/sdk/dist/namespaces/me.d.ts.map +1 -0
- package/sdk/dist/namespaces/me.js +34 -0
- package/sdk/dist/namespaces/me.js.map +1 -0
- package/sdk/dist/namespaces/org.d.ts +108 -6
- package/sdk/dist/namespaces/org.d.ts.map +1 -1
- package/sdk/dist/namespaces/org.js +63 -7
- package/sdk/dist/namespaces/org.js.map +1 -1
- package/sdk/dist/namespaces/org.types.d.ts +29 -9
- package/sdk/dist/namespaces/org.types.d.ts.map +1 -1
- package/sdk/dist/namespaces/pay.js +3 -3
- package/sdk/dist/namespaces/pay.js.map +1 -1
- package/sdk/dist/namespaces/projects.d.ts +9 -9
- package/sdk/dist/namespaces/projects.js +15 -15
- package/sdk/dist/namespaces/projects.js.map +1 -1
- package/sdk/dist/namespaces/projects.types.d.ts +28 -12
- package/sdk/dist/namespaces/projects.types.d.ts.map +1 -1
- package/sdk/dist/namespaces/rooms.d.ts +7 -7
- package/sdk/dist/namespaces/rooms.js +17 -17
- package/sdk/dist/namespaces/rooms.js.map +1 -1
- package/sdk/dist/namespaces/rooms.types.d.ts +9 -9
- package/sdk/dist/namespaces/rooms.types.d.ts.map +1 -1
- package/sdk/dist/namespaces/service.d.ts +1 -1
- package/sdk/dist/namespaces/service.js +1 -1
- package/sdk/dist/namespaces/{operator-session.d.ts → session.d.ts} +135 -51
- package/sdk/dist/namespaces/session.d.ts.map +1 -0
- package/sdk/dist/namespaces/{operator-session.js → session.js} +118 -30
- package/sdk/dist/namespaces/session.js.map +1 -0
- package/sdk/dist/namespaces/subdomains.d.ts +5 -5
- package/sdk/dist/namespaces/subdomains.d.ts.map +1 -1
- package/sdk/dist/namespaces/subdomains.js +6 -6
- package/sdk/dist/namespaces/subdomains.js.map +1 -1
- package/sdk/dist/namespaces/tier.d.ts +43 -20
- package/sdk/dist/namespaces/tier.d.ts.map +1 -1
- package/sdk/dist/namespaces/tier.js +7 -7
- package/sdk/dist/namespaces/tier.js.map +1 -1
- package/sdk/dist/namespaces/transfers.d.ts +74 -71
- package/sdk/dist/namespaces/transfers.d.ts.map +1 -1
- package/sdk/dist/namespaces/transfers.js +31 -38
- package/sdk/dist/namespaces/transfers.js.map +1 -1
- package/sdk/dist/namespaces/vouchers.d.ts +9 -10
- package/sdk/dist/namespaces/vouchers.d.ts.map +1 -1
- package/sdk/dist/namespaces/vouchers.js +4 -5
- package/sdk/dist/namespaces/vouchers.js.map +1 -1
- package/sdk/dist/namespaces/wallets.d.ts +72 -3
- package/sdk/dist/namespaces/wallets.d.ts.map +1 -1
- package/sdk/dist/namespaces/wallets.js +141 -3
- package/sdk/dist/namespaces/wallets.js.map +1 -1
- package/sdk/dist/namespaces/write-approval.d.ts +101 -0
- package/sdk/dist/namespaces/write-approval.d.ts.map +1 -0
- package/sdk/dist/namespaces/write-approval.js +62 -0
- package/sdk/dist/namespaces/write-approval.js.map +1 -0
- package/sdk/dist/node/actions-node.d.ts +3 -3
- package/sdk/dist/node/actions-node.d.ts.map +1 -1
- package/sdk/dist/node/actions-node.js +36 -36
- package/sdk/dist/node/actions-node.js.map +1 -1
- package/sdk/dist/node/{bearer-claim-key.d.ts → bearer-redeem-key.d.ts} +12 -12
- package/sdk/dist/node/bearer-redeem-key.d.ts.map +1 -0
- package/sdk/dist/node/{bearer-claim-key.js → bearer-redeem-key.js} +21 -21
- package/sdk/dist/node/bearer-redeem-key.js.map +1 -0
- package/sdk/dist/node/ci.d.ts +1 -1
- package/sdk/dist/node/ci.d.ts.map +1 -1
- package/sdk/dist/node/ci.js +6 -6
- package/sdk/dist/node/ci.js.map +1 -1
- package/sdk/dist/node/credentials.d.ts +17 -16
- package/sdk/dist/node/credentials.d.ts.map +1 -1
- package/sdk/dist/node/credentials.js +28 -27
- package/sdk/dist/node/credentials.js.map +1 -1
- package/sdk/dist/node/funding-recovery.d.ts +1 -1
- package/sdk/dist/node/funding-recovery.d.ts.map +1 -1
- package/sdk/dist/node/funding-recovery.js +1 -1
- package/sdk/dist/node/funding-recovery.js.map +1 -1
- package/sdk/dist/node/gitvault-apply.d.ts +1 -1
- package/sdk/dist/node/gitvault-apply.d.ts.map +1 -1
- package/sdk/dist/node/gitvault-handoff.d.ts +22 -22
- package/sdk/dist/node/gitvault-handoff.d.ts.map +1 -1
- package/sdk/dist/node/gitvault-handoff.js +45 -45
- package/sdk/dist/node/gitvault-handoff.js.map +1 -1
- package/sdk/dist/node/gitvault-prewarm.js +7 -7
- package/sdk/dist/node/gitvault-prewarm.js.map +1 -1
- package/sdk/dist/node/gitvault-restore.d.ts +1 -1
- package/sdk/dist/node/gitvault-restore.js +1 -1
- package/sdk/dist/node/index.d.ts +16 -16
- package/sdk/dist/node/index.d.ts.map +1 -1
- package/sdk/dist/node/index.js +15 -15
- package/sdk/dist/node/index.js.map +1 -1
- package/sdk/dist/node/org-adopt.d.ts +49 -0
- package/sdk/dist/node/org-adopt.d.ts.map +1 -0
- package/sdk/dist/node/org-adopt.js +77 -0
- package/sdk/dist/node/org-adopt.js.map +1 -0
- package/sdk/dist/node/paid-fetch.d.ts +7 -7
- package/sdk/dist/node/paid-fetch.d.ts.map +1 -1
- package/sdk/dist/node/paid-fetch.js +54 -54
- package/sdk/dist/node/paid-fetch.js.map +1 -1
- package/sdk/dist/node/preflight.d.ts +1 -1
- package/sdk/dist/node/preflight.d.ts.map +1 -1
- package/sdk/dist/node/preflight.js +1 -1
- package/sdk/dist/node/preflight.js.map +1 -1
- package/sdk/dist/node/source-scan.d.ts +1 -1
- package/sdk/dist/node/source-scan.js +2 -2
- package/sdk/dist/node/source-scan.js.map +1 -1
- package/sdk/dist/scoped.d.ts +3 -3
- package/sdk/dist/scoped.d.ts.map +1 -1
- package/sdk/dist/scoped.js +2 -2
- package/sdk/dist/scoped.js.map +1 -1
- package/core-dist/operator-session.js +0 -154
- package/lib/allowance.mjs +0 -355
- package/lib/operator-proofs.mjs +0 -22
- package/lib/operator.mjs +0 -771
- package/sdk/core-dist/operator-session.js +0 -154
- package/sdk/dist/namespaces/allowance.d.ts +0 -79
- package/sdk/dist/namespaces/allowance.d.ts.map +0 -1
- package/sdk/dist/namespaces/allowance.js +0 -149
- package/sdk/dist/namespaces/allowance.js.map +0 -1
- package/sdk/dist/namespaces/operator-session.d.ts.map +0 -1
- package/sdk/dist/namespaces/operator-session.js.map +0 -1
- package/sdk/dist/namespaces/operator.d.ts +0 -359
- package/sdk/dist/namespaces/operator.d.ts.map +0 -1
- package/sdk/dist/namespaces/operator.js +0 -272
- package/sdk/dist/namespaces/operator.js.map +0 -1
- package/sdk/dist/node/bearer-claim-key.d.ts.map +0 -1
- package/sdk/dist/node/bearer-claim-key.js.map +0 -1
- package/sdk/dist/node/operator-claim.d.ts +0 -49
- package/sdk/dist/node/operator-claim.d.ts.map +0 -1
- package/sdk/dist/node/operator-claim.js +0 -77
- package/sdk/dist/node/operator-claim.js.map +0 -1
package/lib/deploy.mjs
CHANGED
|
@@ -1,72 +1,40 @@
|
|
|
1
1
|
import { failUnknownSubcommand } from "./argparse.mjs";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
rehearse <plan_id> Rehearse a persisted plan on a contained branch
|
|
11
|
-
resume <operation_id> Resume a stuck operation
|
|
12
|
-
list [--project <id>] List recent deploy operations
|
|
13
|
-
events <operation_id> Fetch event stream for an operation
|
|
14
|
-
verify <operation_id> Verify gateway and edge coherence
|
|
15
|
-
diagnose <url> Diagnose public URL routing
|
|
16
|
-
resolve --url <url> Low-level resolve diagnostics
|
|
17
|
-
release ... Inspect release inventory and diffs
|
|
18
|
-
|
|
19
|
-
Examples:
|
|
20
|
-
run402 deploy apply --manifest app.json
|
|
21
|
-
run402 deploy resume op_123
|
|
22
|
-
run402 deploy release active --project prj_123
|
|
23
|
-
|
|
24
|
-
Manifest sketch:
|
|
25
|
-
{
|
|
26
|
-
"database": {
|
|
27
|
-
"migrations": [{ "id": "001_init", "sql_path": "schema.sql" }]
|
|
28
|
-
},
|
|
29
|
-
"site": {
|
|
30
|
-
"replace": { "index.html": { "path": "dist/index.html" } }
|
|
31
|
-
},
|
|
32
|
-
"functions": {
|
|
33
|
-
"replace": {
|
|
34
|
-
"api": {
|
|
35
|
-
"runtime": "node22",
|
|
36
|
-
"source": { "path": "api.mjs" }
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
"secrets": { "require": ["OPENAI_API_KEY"] },
|
|
41
|
-
"subdomains": { "set": ["my-app"] }
|
|
42
|
-
}
|
|
43
|
-
`;
|
|
3
|
+
/**
|
|
4
|
+
* `run402 deploy` is the one word that is both a verb and a family: bare
|
|
5
|
+
* `run402 deploy [--manifest <path>] [--project <project_id>] …` performs the
|
|
6
|
+
* deploy, and `run402 deploy <subcommand>` dispatches the family. Every
|
|
7
|
+
* subcommand and the deploy itself live in deploy-v2.mjs; this file only
|
|
8
|
+
* decides which one the argv names.
|
|
9
|
+
*/
|
|
44
10
|
|
|
45
11
|
export async function run(args) {
|
|
46
12
|
const sub = args[0];
|
|
47
|
-
|
|
48
|
-
console.log(HELP);
|
|
49
|
-
process.exit(0);
|
|
50
|
-
}
|
|
13
|
+
const { runDeployV2 } = await import("./deploy-v2.mjs");
|
|
51
14
|
|
|
52
15
|
switch (sub) {
|
|
53
|
-
case "apply":
|
|
54
16
|
case "rehearse":
|
|
55
17
|
case "promote":
|
|
56
18
|
case "resume":
|
|
19
|
+
case "status":
|
|
57
20
|
case "list":
|
|
58
21
|
case "events":
|
|
59
22
|
case "verify":
|
|
60
|
-
case "diagnose":
|
|
61
23
|
case "resolve":
|
|
62
|
-
case "
|
|
63
|
-
const { runDeployV2 } = await import("./deploy-v2.mjs");
|
|
24
|
+
case "releases":
|
|
64
25
|
await runDeployV2(sub, args.slice(1));
|
|
65
26
|
return;
|
|
66
|
-
}
|
|
67
27
|
default:
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
28
|
+
break;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// A bare word that is not a subcommand is a typo, never a manifest: the
|
|
32
|
+
// deploy takes no positionals. Everything else — no arguments at all, a
|
|
33
|
+
// flag, --help — is the deploy itself.
|
|
34
|
+
if (typeof sub === "string" && !sub.startsWith("-")) {
|
|
35
|
+
failUnknownSubcommand("deploy", sub, {
|
|
36
|
+
hint: "Use `run402 deploy --manifest <path>` to deploy, or one of the subcommands.",
|
|
37
|
+
});
|
|
71
38
|
}
|
|
39
|
+
await runDeployV2("deploy", args);
|
|
72
40
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// Shared with Node up, deploy
|
|
1
|
+
// Shared with Node up, deploy, and scoped doctor.
|
|
2
2
|
export { scanFileContent, scanSourceTree, scanSourceFiles, resolveScanRoot, readDeclaredCapabilities, SCAN_SEVERITY, _testOnly_hallucinatedNames, _testOnly_authProperties } from "#sdk/node";
|
package/lib/doctor.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { resolveApplicationScope, loadApplicationScanInput, scanDeploymentSource
|
|
|
2
2
|
/**
|
|
3
3
|
* run402 doctor — Health and config diagnostics.
|
|
4
4
|
*
|
|
5
|
-
* Reports the state of the local Run402 setup: config dir,
|
|
5
|
+
* Reports the state of the local Run402 setup: config dir, wallet,
|
|
6
6
|
* tier, project selection, API reachability. Agent-friendly: with
|
|
7
7
|
* `--json`, emits a structured report the agent can branch on without
|
|
8
8
|
* parsing English output.
|
|
@@ -14,7 +14,7 @@ import { resolveApplicationScope, loadApplicationScanInput, scanDeploymentSource
|
|
|
14
14
|
|
|
15
15
|
import { existsSync, statSync } from "node:fs";
|
|
16
16
|
import { GITVAULT_BYO_NO_PAYLOAD_COPY_STATEMENT } from "#sdk";
|
|
17
|
-
import { configDir,
|
|
17
|
+
import { configDir, readWallet, loadKeyStore } from "./config.mjs";
|
|
18
18
|
import { resolveGitvaultTarget } from "./gitvault-target.mjs";
|
|
19
19
|
import { getSdk } from "./sdk.mjs";
|
|
20
20
|
import {
|
|
@@ -47,11 +47,11 @@ const DOCTOR_VALUE_FLAGS = ["--scan-dir", "--dir", "--manifest", "--buzz-agent",
|
|
|
47
47
|
const DOCTOR_CHECK_NAMES = [
|
|
48
48
|
"config_dir",
|
|
49
49
|
"cli_update",
|
|
50
|
-
"
|
|
50
|
+
"wallet",
|
|
51
51
|
"projects",
|
|
52
52
|
"api_reachable",
|
|
53
53
|
"tier",
|
|
54
|
-
"
|
|
54
|
+
"account_health",
|
|
55
55
|
"runtime_staleness",
|
|
56
56
|
"recovery_posture",
|
|
57
57
|
"gitvault",
|
|
@@ -87,10 +87,10 @@ Output:
|
|
|
87
87
|
checks: [{ name, status, severity, value?, hint?, message? }] }
|
|
88
88
|
\`ok\` answers ONE question — can this agent ship from here — and is true
|
|
89
89
|
exactly when \`blocking[]\` is empty. Every check carries a \`severity\`:
|
|
90
|
-
blocking would stop a deploy: config_dir /
|
|
90
|
+
blocking would stop a deploy: config_dir / wallet missing or error,
|
|
91
91
|
api_reachable error, tier inactive / frozen / past_due /
|
|
92
92
|
dormant / missing / error, error-severity source_scan findings
|
|
93
|
-
advisory a warning that never stops a deploy:
|
|
93
|
+
advisory a warning that never stops a deploy: account_health,
|
|
94
94
|
recovery_posture, gitvault, runtime_staleness, cli_update gaps
|
|
95
95
|
info ok / skipped / unknown
|
|
96
96
|
Agents: branch on \`ok\`; read \`warnings[]\` (one entry per gap) for the
|
|
@@ -127,7 +127,7 @@ Options:
|
|
|
127
127
|
source-tree scan, is suppressed rather than merely hidden: a
|
|
128
128
|
skipped check's network/filesystem work never runs at all, so
|
|
129
129
|
\`doctor --only gitvault\` costs one gitvault read, not a
|
|
130
|
-
config/tier/
|
|
130
|
+
config/tier/account/scan sweep. An unknown check name is
|
|
131
131
|
BAD_USAGE listing the valid names below. Not used with --buzz
|
|
132
132
|
(buzz mode is its own separate, always-complete check set).
|
|
133
133
|
--buzz Run only the zero-mutation Buzz setup preflight
|
|
@@ -148,7 +148,7 @@ Telemetry:
|
|
|
148
148
|
Checks performed:
|
|
149
149
|
- Config directory exists and is writable
|
|
150
150
|
- Installed run402 CLI version and update guidance
|
|
151
|
-
-
|
|
151
|
+
- Wallet is configured and on a valid rail (x402 / mpp)
|
|
152
152
|
- Keystore has at least one wallet
|
|
153
153
|
- API_BASE is reachable (network check via /health)
|
|
154
154
|
- Active tier resolves and is not 'past_due' / 'frozen' / 'dormant'. A wallet
|
|
@@ -177,8 +177,8 @@ Checks performed:
|
|
|
177
177
|
Buzz mode checks (in order):
|
|
178
178
|
session_shell, node_runtime, run402_cli, buzz_cli, buzz_agent_target,
|
|
179
179
|
run402_api, run402_console, buzz_relay, wallet_profile.
|
|
180
|
-
Buzz mode is read-only and skips the ordinary
|
|
181
|
-
|
|
180
|
+
Buzz mode is read-only and skips the ordinary wallet, tier, project,
|
|
181
|
+
account, runtime-staleness, and source-tree checks.
|
|
182
182
|
|
|
183
183
|
Exit codes:
|
|
184
184
|
0 — ok: true (advisory warnings never change the exit code)
|
|
@@ -264,9 +264,9 @@ export function buildDoctorReport(rawChecks) {
|
|
|
264
264
|
return { ok: blocking.length === 0, blocking, warnings, checks };
|
|
265
265
|
}
|
|
266
266
|
|
|
267
|
-
function
|
|
268
|
-
if (!
|
|
269
|
-
const safe = { ...
|
|
267
|
+
function redactWalletForDiagnostics(localWallet) {
|
|
268
|
+
if (!localWallet || typeof localWallet !== "object") return localWallet;
|
|
269
|
+
const safe = { ...localWallet };
|
|
270
270
|
delete safe.privateKey;
|
|
271
271
|
if (typeof safe.funded === "boolean") safe.faucet_used = safe.funded;
|
|
272
272
|
delete safe.funded;
|
|
@@ -390,39 +390,39 @@ export async function run(sub, args = []) {
|
|
|
390
390
|
});
|
|
391
391
|
}
|
|
392
392
|
|
|
393
|
-
// 2.
|
|
394
|
-
let
|
|
395
|
-
if (wanted("
|
|
396
|
-
const
|
|
397
|
-
if (
|
|
398
|
-
|
|
393
|
+
// 2. Wallet.
|
|
394
|
+
let walletConfigured = false;
|
|
395
|
+
if (wanted("wallet")) try {
|
|
396
|
+
const localWallet = readWallet();
|
|
397
|
+
if (localWallet) {
|
|
398
|
+
walletConfigured = true;
|
|
399
399
|
checks.push({
|
|
400
|
-
name: "
|
|
400
|
+
name: "wallet",
|
|
401
401
|
status: "ok",
|
|
402
402
|
value: {
|
|
403
|
-
rail:
|
|
403
|
+
rail: localWallet.rail,
|
|
404
404
|
// Don't surface amounts or addresses unless --verbose; agents
|
|
405
405
|
// checking for config presence don't need wallet details. Never
|
|
406
406
|
// include keystore secrets in diagnostics, even in verbose mode.
|
|
407
|
-
...(verbose && { details:
|
|
407
|
+
...(verbose && { details: redactWalletForDiagnostics(localWallet) }),
|
|
408
408
|
},
|
|
409
409
|
});
|
|
410
410
|
} else {
|
|
411
411
|
checks.push({
|
|
412
|
-
name: "
|
|
412
|
+
name: "wallet",
|
|
413
413
|
status: "missing",
|
|
414
|
-
hint: "Run 'run402 init' to create
|
|
414
|
+
hint: "Run 'run402 init' to create a wallet.",
|
|
415
415
|
});
|
|
416
416
|
}
|
|
417
417
|
} catch (err) {
|
|
418
418
|
checks.push({
|
|
419
|
-
name: "
|
|
419
|
+
name: "wallet",
|
|
420
420
|
status: "error",
|
|
421
421
|
message: err instanceof Error ? err.message : String(err),
|
|
422
422
|
});
|
|
423
423
|
}
|
|
424
424
|
|
|
425
|
-
// 3. Project keystore. The wallet itself lives in
|
|
425
|
+
// 3. Project keystore. The wallet itself lives in wallet.json (verified
|
|
426
426
|
// by check 2 above); this checks the per-project keys (anon_key /
|
|
427
427
|
// service_key) that `run402 projects provision` writes. An empty store is
|
|
428
428
|
// normal for fresh installs that haven't provisioned a project yet, so
|
|
@@ -435,10 +435,10 @@ export async function run(sub, args = []) {
|
|
|
435
435
|
status: "ok",
|
|
436
436
|
value: { project_count: projectCount },
|
|
437
437
|
// State-aware parenthetical: only claim the wallet is set up when the
|
|
438
|
-
//
|
|
438
|
+
// wallet check above actually passed; pre-init installs are pointed
|
|
439
439
|
// at `run402 init` first.
|
|
440
440
|
...(projectCount === 0 && {
|
|
441
|
-
hint:
|
|
441
|
+
hint: walletConfigured
|
|
442
442
|
? "No projects yet — run 'run402 projects provision' to create one (wallet is already set up)."
|
|
443
443
|
: "No projects yet — run 'run402 init' to set up the wallet first, then 'run402 projects provision'.",
|
|
444
444
|
}),
|
|
@@ -539,7 +539,7 @@ export async function run(sub, args = []) {
|
|
|
539
539
|
: `organization lifecycle is '${lifecycle}' — the control plane is gated until the tier is reactivated`,
|
|
540
540
|
hint: status === "unknown"
|
|
541
541
|
? "Tier resolved, but organization lifecycle could not be determined. Check `run402 tier status` before assuming the account is healthy."
|
|
542
|
-
: "Run 'run402 tier set prototype' to
|
|
542
|
+
: "Run 'run402 tier set prototype' to set, renew, or reactivate the tier.",
|
|
543
543
|
});
|
|
544
544
|
}
|
|
545
545
|
} catch (err) {
|
|
@@ -550,41 +550,42 @@ export async function run(sub, args = []) {
|
|
|
550
550
|
});
|
|
551
551
|
}
|
|
552
552
|
|
|
553
|
-
// 6.
|
|
554
|
-
// The checks below all ride the SAME
|
|
555
|
-
// and recovery_posture reuse the response
|
|
553
|
+
// 6. Account health snapshot (v1.55 + v1.56 verification attempt detail).
|
|
554
|
+
// The checks below all ride the SAME `GET /agent/v1/me/status` read
|
|
555
|
+
// (runtime_staleness and recovery_posture reuse the response account_health
|
|
556
|
+
// already pulled),
|
|
556
557
|
// so the whole block is gated on wanting ANY — --only runtime_staleness
|
|
557
558
|
// alone still needs this read, but --only-ing none skips it entirely, same
|
|
558
559
|
// "don't do the work of a check nobody asked for" discipline the rest of
|
|
559
560
|
// --only follows.
|
|
560
|
-
if (wanted("
|
|
561
|
+
if (wanted("account_health") || wanted("runtime_staleness") || wanted("recovery_posture")) try {
|
|
561
562
|
const sdk = getSdk();
|
|
562
|
-
const status = await sdk.
|
|
563
|
+
const status = await sdk.me.status();
|
|
563
564
|
const gaps = [];
|
|
564
|
-
if (status.
|
|
565
|
+
if (status.contact.email_status !== "verified") {
|
|
565
566
|
// v1.56: prefer the structured email_verification.last_challenge.hint
|
|
566
567
|
// over the generic "email not verified" message. The gateway computes
|
|
567
|
-
// a per-reason remediation hint that's actionable for the
|
|
568
|
+
// a per-reason remediation hint that's actionable for the reader.
|
|
568
569
|
const ev = status.email_verification;
|
|
569
570
|
const ch = ev?.last_challenge;
|
|
570
571
|
if (ch && ch.hint) {
|
|
571
572
|
const attemptsLine = ch.attempt_count > 0
|
|
572
573
|
? ` (${ch.attempt_count}/${ch.attempt_count + ch.remaining_attempts} attempts used, ${ch.remaining_attempts} remaining)`
|
|
573
574
|
: "";
|
|
574
|
-
gaps.push(`
|
|
575
|
+
gaps.push(`contact email not verified${attemptsLine}: ${ch.hint}`);
|
|
575
576
|
} else {
|
|
576
|
-
gaps.push(`
|
|
577
|
+
gaps.push(`contact email not verified (${status.contact.email_status}) — run 'run402 agent contact --email ...' then reply to the challenge`);
|
|
577
578
|
}
|
|
578
579
|
}
|
|
579
|
-
if (status.
|
|
580
|
-
gaps.push("
|
|
580
|
+
if (status.contact.passkey_status !== "verified") {
|
|
581
|
+
gaps.push("contact passkey not bound — run 'run402 login' (or 'run402 agent passkey enroll') after email verification");
|
|
581
582
|
}
|
|
582
583
|
// recovery-event-reachability: org-level reachability of mandatory
|
|
583
584
|
// (recovery/security) notifications. Distinct from the per-wallet contact
|
|
584
585
|
// check above — an org can be reachable via a member's verified email
|
|
585
586
|
// even when this wallet has no contact, and vice versa. Omitted by older
|
|
586
587
|
// gateways.
|
|
587
|
-
const reach = status.
|
|
588
|
+
const reach = status.reachability;
|
|
588
589
|
if (reach && reach.reachable === false) {
|
|
589
590
|
const skipped = reach.skipped_last_90d > 0
|
|
590
591
|
? ` (${reach.skipped_last_90d} notification(s) already skipped in the last 90 days)`
|
|
@@ -599,16 +600,16 @@ export async function run(sub, args = []) {
|
|
|
599
600
|
gaps.push(`${item.kind}: ${item.detail}`);
|
|
600
601
|
}
|
|
601
602
|
}
|
|
602
|
-
if (wanted("
|
|
603
|
+
if (wanted("account_health")) {
|
|
603
604
|
if (gaps.length > 0) {
|
|
604
605
|
checks.push({
|
|
605
|
-
name: "
|
|
606
|
+
name: "account_health",
|
|
606
607
|
status: "warning",
|
|
607
608
|
value: { gaps },
|
|
608
609
|
hint: "Address the above gaps; they're what 'run402 notifications' is designed to surface.",
|
|
609
610
|
});
|
|
610
611
|
} else {
|
|
611
|
-
checks.push({ name: "
|
|
612
|
+
checks.push({ name: "account_health", status: "ok" });
|
|
612
613
|
}
|
|
613
614
|
}
|
|
614
615
|
|
|
@@ -618,7 +619,7 @@ export async function run(sub, args = []) {
|
|
|
618
619
|
// gateway's current build — a plain redeploy with unchanged source does
|
|
619
620
|
// NOT refresh it (apply's release diff keys on the source code_hash, not
|
|
620
621
|
// the wrapper). Read-only signal; refreshing is strictly opt-in. Reuses
|
|
621
|
-
// the
|
|
622
|
+
// the account status fetched above to avoid a second round-trip.
|
|
622
623
|
if (wanted("runtime_staleness")) {
|
|
623
624
|
const runtime = status.runtime;
|
|
624
625
|
if (runtime && typeof runtime.stale_function_count === "number") {
|
|
@@ -644,13 +645,13 @@ export async function run(sub, args = []) {
|
|
|
644
645
|
checks.push({
|
|
645
646
|
name: "runtime_staleness",
|
|
646
647
|
status: "skipped",
|
|
647
|
-
...(verbose && { hint: "
|
|
648
|
+
...(verbose && { hint: "account status has no 'runtime' block; requires v1.69+ gateway." }),
|
|
648
649
|
});
|
|
649
650
|
}
|
|
650
651
|
}
|
|
651
652
|
|
|
652
653
|
// 6c. Org recovery posture (gitvault-recovery-custody). One entry per
|
|
653
|
-
// vault-owning org the caller can see; rides the same
|
|
654
|
+
// vault-owning org the caller can see; rides the same account-status
|
|
654
655
|
// read. Evidence levels, not guarantees: "configured" names what the
|
|
655
656
|
// platform VERIFIED — it can never observe whether an off-platform
|
|
656
657
|
// passkey or saved code still exists. The two headline facts mirror the
|
|
@@ -664,7 +665,7 @@ export async function run(sub, args = []) {
|
|
|
664
665
|
checks.push({
|
|
665
666
|
name: "recovery_posture",
|
|
666
667
|
status: "skipped",
|
|
667
|
-
...(verbose && { hint: "
|
|
668
|
+
...(verbose && { hint: "account status has no 'recovery_posture' block; requires a gitvault-recovery-custody gateway." }),
|
|
668
669
|
});
|
|
669
670
|
} else if (posture.length === 0) {
|
|
670
671
|
// No vault-owning org in the caller's view — nothing to lose, nothing to advise.
|
|
@@ -696,25 +697,24 @@ export async function run(sub, args = []) {
|
|
|
696
697
|
}
|
|
697
698
|
}
|
|
698
699
|
} catch (err) {
|
|
699
|
-
//
|
|
700
|
-
// substrate isn't deployed yet on the target API. Don't fail the whole
|
|
700
|
+
// The account status endpoint may not be reachable on the target API. Don't fail the whole
|
|
701
701
|
// doctor over it — emit as a soft warning. The runtime-staleness check
|
|
702
702
|
// rides on the same fetch, so skip it for the same reason.
|
|
703
|
-
if (wanted("
|
|
704
|
-
name: "
|
|
703
|
+
if (wanted("account_health")) checks.push({
|
|
704
|
+
name: "account_health",
|
|
705
705
|
status: "skipped",
|
|
706
|
-
message: describeCheckFailure("
|
|
707
|
-
...(verbose && { hint: "GET /agent/v1/
|
|
706
|
+
message: describeCheckFailure("account status check", err),
|
|
707
|
+
...(verbose && { hint: "GET /agent/v1/me/status not reachable." }),
|
|
708
708
|
});
|
|
709
709
|
if (wanted("runtime_staleness")) checks.push({
|
|
710
710
|
name: "runtime_staleness",
|
|
711
711
|
status: "skipped",
|
|
712
|
-
message: describeCheckFailure("
|
|
712
|
+
message: describeCheckFailure("account status check", err),
|
|
713
713
|
});
|
|
714
714
|
if (wanted("recovery_posture")) checks.push({
|
|
715
715
|
name: "recovery_posture",
|
|
716
716
|
status: "skipped",
|
|
717
|
-
message: describeCheckFailure("
|
|
717
|
+
message: describeCheckFailure("account status check", err),
|
|
718
718
|
});
|
|
719
719
|
}
|
|
720
720
|
|
|
@@ -978,7 +978,7 @@ export async function run(sub, args = []) {
|
|
|
978
978
|
details: findings,
|
|
979
979
|
},
|
|
980
980
|
hint: errorFindings.length > 0
|
|
981
|
-
? scanDirOverride ? "Findings are from the explicit arbitrary scan directory; they do not establish that an application deploy will be refused." : "Fix the findings in this application. The same scoped source scan gates up and deploy
|
|
981
|
+
? scanDirOverride ? "Findings are from the explicit arbitrary scan directory; they do not establish that an application deploy will be refused." : "Fix the findings in this application. The same scoped source scan gates up and deploy."
|
|
982
982
|
: "Source scan emitted warnings (non-blocking). Review and address when convenient.",
|
|
983
983
|
});
|
|
984
984
|
}
|
package/lib/escalations.mjs
CHANGED
|
@@ -65,7 +65,7 @@ Delivery:
|
|
|
65
65
|
|
|
66
66
|
Contacts are attention policy, never authorization — adding someone says
|
|
67
67
|
"page this human", never "this human may do anything". Owner + passkey
|
|
68
|
-
step-up to change. An address with no verified
|
|
68
|
+
step-up to change. An address with no verified contact email is accepted
|
|
69
69
|
with a warning rather than rejected (the person you most want on a level-2
|
|
70
70
|
chain may hold no platform credential at all).
|
|
71
71
|
|
package/lib/feedback.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { walletAuthHeaders } from "./config.mjs";
|
|
2
2
|
import { getSdk } from "./sdk.mjs";
|
|
3
3
|
import { reportSdkError, fail } from "./sdk-errors.mjs";
|
|
4
4
|
import { assertKnownFlags, normalizeArgv, failUnknownSubcommand, flagValue, positionalArgs } from "./argparse.mjs";
|
|
@@ -13,14 +13,14 @@ Notes:
|
|
|
13
13
|
answer from a human, raise an escalation instead:
|
|
14
14
|
run402 escalations raise "<what you need>" --severity high
|
|
15
15
|
- Requires an active tier (run402 tier set <tier>)
|
|
16
|
-
- Requires
|
|
16
|
+
- Requires a wallet (run402 init)
|
|
17
17
|
- Messages are capped at 8 KB (8192 bytes UTF-8) to keep the developer
|
|
18
18
|
inbox useful and prevent payload-dump misuse. Trim or summarize long
|
|
19
19
|
content (e.g. stack traces) before sending.
|
|
20
20
|
|
|
21
21
|
Finishing a deploy — the promotion consent flow:
|
|
22
22
|
When a commit or promote response reaches status "ready" with a public
|
|
23
|
-
site, it carries a next_actions entry of type
|
|
23
|
+
site, it carries a next_actions entry of type hand_to_member. That is
|
|
24
24
|
Run402 asking, through you, whether it may promote what your human built
|
|
25
25
|
on @run402com — for free, credited to your presence name (credited_as)
|
|
26
26
|
and to your human. Show your human both links (urls.site, urls.console),
|
|
@@ -57,7 +57,7 @@ Arguments:
|
|
|
57
57
|
|
|
58
58
|
Flags:
|
|
59
59
|
--project <id> Project this feedback concerns. Required to relay a
|
|
60
|
-
promotion consent (the
|
|
60
|
+
promotion consent (the hand_to_member next action
|
|
61
61
|
from a deploy response) — the server resolves the
|
|
62
62
|
project's site URL, org, and your presence name for
|
|
63
63
|
the delivered message.
|
|
@@ -67,11 +67,11 @@ Flags:
|
|
|
67
67
|
|
|
68
68
|
Notes:
|
|
69
69
|
- Requires an active tier (run402 tier set <tier>)
|
|
70
|
-
- Requires
|
|
70
|
+
- Requires a wallet (run402 init)
|
|
71
71
|
- Messages are capped at 8 KB (8192 bytes UTF-8) to keep the developer
|
|
72
72
|
inbox useful and prevent payload-dump misuse.
|
|
73
73
|
- Finishing a deploy: when a commit/promote response carries a
|
|
74
|
-
|
|
74
|
+
hand_to_member next action, show your human urls.site and
|
|
75
75
|
urls.console, relay that Run402 would like to promote what they built
|
|
76
76
|
on @run402com for free (credited to credited_as and to them), and ask
|
|
77
77
|
yes or no. On yes: run402 feedback send "promote: yes" --project <id>
|
|
@@ -90,8 +90,8 @@ async function send(args) {
|
|
|
90
90
|
if (!text) {
|
|
91
91
|
fail({ code: "BAD_USAGE", message: "Missing message text." });
|
|
92
92
|
}
|
|
93
|
-
// Cap check runs BEFORE the
|
|
94
|
-
// a structured size error instead of being masked by a missing-
|
|
93
|
+
// Cap check runs BEFORE the wallet check so oversized payloads surface
|
|
94
|
+
// a structured size error instead of being masked by a missing-wallet
|
|
95
95
|
// exit.
|
|
96
96
|
const bytes = Buffer.byteLength(text, "utf-8");
|
|
97
97
|
if (bytes > MESSAGE_MAX_BYTES) {
|
|
@@ -111,8 +111,8 @@ async function send(args) {
|
|
|
111
111
|
details: { flag: "--handle", length: handle.length, max: 64 },
|
|
112
112
|
});
|
|
113
113
|
}
|
|
114
|
-
// Preserve the aggressive early exit when no
|
|
115
|
-
|
|
114
|
+
// Preserve the aggressive early exit when no local wallet is configured.
|
|
115
|
+
walletAuthHeaders("/feedback/v1");
|
|
116
116
|
|
|
117
117
|
const opts = {};
|
|
118
118
|
if (projectId) opts.project_id = projectId;
|
package/lib/gitvault-daemon.mjs
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Holds the WARM things — the loaded session module (whose top-level await
|
|
5
5
|
* pulls the whole SDK graph), the owned dispatcher's live h2 connection,
|
|
6
6
|
* signer precomputation, the paid stack — and re-reads the SMALL things
|
|
7
|
-
* (keystore, pins, wallet binding,
|
|
7
|
+
* (keystore, pins, wallet binding, wallet, env-derived config) fresh per
|
|
8
8
|
* forwarded session, so no cache-invalidation class exists (D2).
|
|
9
9
|
*
|
|
10
10
|
* SINGLE-SESSION BY DESIGN (D6 as applied): a session is {cwd, env}
|
package/lib/image.mjs
CHANGED
|
@@ -29,9 +29,9 @@ Output (without --output):
|
|
|
29
29
|
{ "aspect": "square", "content_type": "image/png", "image": "<base64>" }
|
|
30
30
|
|
|
31
31
|
Notes:
|
|
32
|
-
- Requires a funded
|
|
32
|
+
- Requires a funded wallet (run402 init && run402 wallets fund)
|
|
33
33
|
- Payments are processed automatically via x402 micropayments (USDC on the
|
|
34
|
-
network your
|
|
34
|
+
network your wallet targets — Base Sepolia on the prototype tier, Base
|
|
35
35
|
mainnet on paid tiers) or over Lightning from a rail: lightning wallet
|
|
36
36
|
- Use --output to save directly to a file instead of printing base64
|
|
37
37
|
`;
|
|
@@ -56,7 +56,7 @@ Options:
|
|
|
56
56
|
run402 org use, or the active project's owning org)
|
|
57
57
|
|
|
58
58
|
Notes:
|
|
59
|
-
- Requires a funded
|
|
59
|
+
- Requires a funded wallet (run402 init && run402 wallets fund)
|
|
60
60
|
- Payments are processed automatically via x402 micropayments, or over
|
|
61
61
|
Lightning from a rail: lightning wallet
|
|
62
62
|
- Use --output to save directly to a file instead of printing base64
|