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.
Files changed (259) hide show
  1. package/README.md +43 -41
  2. package/cli.mjs +34 -29
  3. package/core-dist/config.js +52 -18
  4. package/core-dist/control-plane-session.js +31 -6
  5. package/core-dist/keystore.js +7 -7
  6. package/core-dist/profiles.js +9 -7
  7. package/core-dist/{allowance-auth.js → wallet-auth.js} +15 -15
  8. package/{sdk/core-dist/allowance.js → core-dist/wallet.js} +20 -20
  9. package/{sdk/core-dist/write-auth-session.js → core-dist/write-approvals.js} +19 -19
  10. package/gitvault-surface.json +1 -1
  11. package/lib/admin.mjs +1 -1
  12. package/lib/agent.mjs +20 -18
  13. package/lib/approve.mjs +81 -0
  14. package/lib/apps.mjs +3 -3
  15. package/lib/assets.mjs +2 -2
  16. package/lib/billing.mjs +6 -6
  17. package/lib/buzz-doctor.mjs +1 -1
  18. package/lib/buzz-notifications.mjs +1 -1
  19. package/lib/buzz.mjs +1 -1
  20. package/lib/buzz.test.mjs +1 -1
  21. package/lib/ci.mjs +4 -4
  22. package/lib/cold-start.mjs +21 -21
  23. package/lib/command-manifest.mjs +20 -34
  24. package/lib/config.mjs +24 -24
  25. package/lib/contacts.mjs +13 -13
  26. package/lib/contracts.mjs +1 -1
  27. package/lib/credentials.mjs +2 -2
  28. package/lib/daemon-path.mjs +1 -1
  29. package/lib/delegates.mjs +1 -1
  30. package/lib/deliveries.mjs +4 -4
  31. package/lib/deploy-rehearse-discovery.test.mjs +7 -7
  32. package/lib/deploy-v2.mjs +232 -184
  33. package/lib/deploy.mjs +21 -53
  34. package/lib/doctor-source-scan.mjs +1 -1
  35. package/lib/doctor.mjs +57 -57
  36. package/lib/escalations.mjs +1 -1
  37. package/lib/feedback.mjs +10 -10
  38. package/lib/gitvault-daemon.mjs +1 -1
  39. package/lib/image.mjs +3 -3
  40. package/lib/init.mjs +66 -66
  41. package/lib/lightning-wallet.mjs +28 -28
  42. package/lib/login.mjs +207 -0
  43. package/lib/logout.mjs +53 -0
  44. package/lib/next-actions.mjs +15 -15
  45. package/lib/org.mjs +100 -13
  46. package/lib/pay.mjs +1 -1
  47. package/lib/projects.mjs +26 -29
  48. package/lib/redeem.mjs +7 -8
  49. package/lib/remote-helper-session.mjs +12 -12
  50. package/lib/repos.mjs +62 -62
  51. package/lib/rooms.mjs +103 -67
  52. package/lib/sdk-errors.mjs +9 -4
  53. package/lib/sdk.mjs +3 -3
  54. package/lib/service.mjs +5 -5
  55. package/lib/session-proofs.mjs +21 -0
  56. package/lib/sign-in.mjs +296 -0
  57. package/lib/sites.mjs +8 -8
  58. package/lib/stats.mjs +2 -2
  59. package/lib/status.mjs +25 -25
  60. package/lib/subdomains.mjs +19 -19
  61. package/lib/subscriptions.mjs +8 -8
  62. package/lib/tier.mjs +29 -22
  63. package/lib/transfer.mjs +58 -85
  64. package/lib/up.mjs +7 -7
  65. package/lib/wallet-context.mjs +3 -3
  66. package/lib/wallet-context.test.mjs +3 -3
  67. package/lib/wallets.mjs +196 -31
  68. package/lib/webhook-secret.mjs +6 -6
  69. package/lib/whoami.mjs +75 -0
  70. package/package.json +1 -1
  71. package/sdk/core-dist/config.js +52 -18
  72. package/sdk/core-dist/control-plane-session.js +31 -6
  73. package/sdk/core-dist/keystore.js +7 -7
  74. package/sdk/core-dist/profiles.js +9 -7
  75. package/sdk/core-dist/{allowance-auth.js → wallet-auth.js} +15 -15
  76. package/{core-dist/allowance.js → sdk/core-dist/wallet.js} +20 -20
  77. package/{core-dist/write-auth-session.js → sdk/core-dist/write-approvals.js} +19 -19
  78. package/sdk/dist/actions.d.ts +1 -1
  79. package/sdk/dist/actions.d.ts.map +1 -1
  80. package/sdk/dist/control-plane-credentials.d.ts +8 -8
  81. package/sdk/dist/control-plane-credentials.js +7 -7
  82. package/sdk/dist/credentials.d.ts +19 -19
  83. package/sdk/dist/credentials.d.ts.map +1 -1
  84. package/sdk/dist/credentials.js +1 -1
  85. package/sdk/dist/errors.d.ts +24 -26
  86. package/sdk/dist/errors.d.ts.map +1 -1
  87. package/sdk/dist/errors.js +34 -37
  88. package/sdk/dist/errors.js.map +1 -1
  89. package/sdk/dist/index.d.ts +29 -16
  90. package/sdk/dist/index.d.ts.map +1 -1
  91. package/sdk/dist/index.js +29 -16
  92. package/sdk/dist/index.js.map +1 -1
  93. package/sdk/dist/kernel.d.ts +1 -1
  94. package/sdk/dist/kernel.d.ts.map +1 -1
  95. package/sdk/dist/kernel.js +10 -9
  96. package/sdk/dist/kernel.js.map +1 -1
  97. package/sdk/dist/namespaces/admin.d.ts +51 -120
  98. package/sdk/dist/namespaces/admin.d.ts.map +1 -1
  99. package/sdk/dist/namespaces/admin.js +41 -45
  100. package/sdk/dist/namespaces/admin.js.map +1 -1
  101. package/sdk/dist/namespaces/agent.d.ts +2 -2
  102. package/sdk/dist/namespaces/agent.d.ts.map +1 -1
  103. package/sdk/dist/namespaces/agent.js +2 -2
  104. package/sdk/dist/namespaces/agent.js.map +1 -1
  105. package/sdk/dist/namespaces/ai.d.ts +1 -1
  106. package/sdk/dist/namespaces/ai.js +1 -1
  107. package/sdk/dist/namespaces/billing.d.ts +6 -3
  108. package/sdk/dist/namespaces/billing.d.ts.map +1 -1
  109. package/sdk/dist/namespaces/billing.js.map +1 -1
  110. package/sdk/dist/namespaces/buzz-notifications.types.d.ts +1 -1
  111. package/sdk/dist/namespaces/buzz.d.ts +2 -2
  112. package/sdk/dist/namespaces/buzz.d.ts.map +1 -1
  113. package/sdk/dist/namespaces/buzz.js +2 -2
  114. package/sdk/dist/namespaces/buzz.js.map +1 -1
  115. package/sdk/dist/namespaces/buzz.types.d.ts +2 -2
  116. package/sdk/dist/namespaces/buzz.types.d.ts.map +1 -1
  117. package/sdk/dist/namespaces/credentials.types.d.ts +1 -1
  118. package/sdk/dist/namespaces/deploy.d.ts +1 -1
  119. package/sdk/dist/namespaces/deploy.js +5 -5
  120. package/sdk/dist/namespaces/deploy.js.map +1 -1
  121. package/sdk/dist/namespaces/deploy.types.d.ts +4 -4
  122. package/sdk/dist/namespaces/escalations.d.ts +1 -1
  123. package/sdk/dist/namespaces/escalations.js +1 -1
  124. package/sdk/dist/namespaces/escalations.types.d.ts +2 -2
  125. package/sdk/dist/namespaces/escalations.types.d.ts.map +1 -1
  126. package/sdk/dist/namespaces/events.types.d.ts +1 -1
  127. package/sdk/dist/namespaces/functions.d.ts +1 -1
  128. package/sdk/dist/namespaces/functions.js +1 -1
  129. package/sdk/dist/namespaces/gitvault.crypto.d.ts +1 -1
  130. package/sdk/dist/namespaces/gitvault.d.ts +24 -24
  131. package/sdk/dist/namespaces/gitvault.d.ts.map +1 -1
  132. package/sdk/dist/namespaces/gitvault.js +109 -109
  133. package/sdk/dist/namespaces/gitvault.js.map +1 -1
  134. package/sdk/dist/namespaces/me.d.ts +120 -0
  135. package/sdk/dist/namespaces/me.d.ts.map +1 -0
  136. package/sdk/dist/namespaces/me.js +34 -0
  137. package/sdk/dist/namespaces/me.js.map +1 -0
  138. package/sdk/dist/namespaces/org.d.ts +108 -6
  139. package/sdk/dist/namespaces/org.d.ts.map +1 -1
  140. package/sdk/dist/namespaces/org.js +63 -7
  141. package/sdk/dist/namespaces/org.js.map +1 -1
  142. package/sdk/dist/namespaces/org.types.d.ts +29 -9
  143. package/sdk/dist/namespaces/org.types.d.ts.map +1 -1
  144. package/sdk/dist/namespaces/pay.js +3 -3
  145. package/sdk/dist/namespaces/pay.js.map +1 -1
  146. package/sdk/dist/namespaces/projects.d.ts +9 -9
  147. package/sdk/dist/namespaces/projects.js +15 -15
  148. package/sdk/dist/namespaces/projects.js.map +1 -1
  149. package/sdk/dist/namespaces/projects.types.d.ts +28 -12
  150. package/sdk/dist/namespaces/projects.types.d.ts.map +1 -1
  151. package/sdk/dist/namespaces/rooms.d.ts +7 -7
  152. package/sdk/dist/namespaces/rooms.js +17 -17
  153. package/sdk/dist/namespaces/rooms.js.map +1 -1
  154. package/sdk/dist/namespaces/rooms.types.d.ts +9 -9
  155. package/sdk/dist/namespaces/rooms.types.d.ts.map +1 -1
  156. package/sdk/dist/namespaces/service.d.ts +1 -1
  157. package/sdk/dist/namespaces/service.js +1 -1
  158. package/sdk/dist/namespaces/{operator-session.d.ts → session.d.ts} +135 -51
  159. package/sdk/dist/namespaces/session.d.ts.map +1 -0
  160. package/sdk/dist/namespaces/{operator-session.js → session.js} +118 -30
  161. package/sdk/dist/namespaces/session.js.map +1 -0
  162. package/sdk/dist/namespaces/subdomains.d.ts +5 -5
  163. package/sdk/dist/namespaces/subdomains.d.ts.map +1 -1
  164. package/sdk/dist/namespaces/subdomains.js +6 -6
  165. package/sdk/dist/namespaces/subdomains.js.map +1 -1
  166. package/sdk/dist/namespaces/tier.d.ts +43 -20
  167. package/sdk/dist/namespaces/tier.d.ts.map +1 -1
  168. package/sdk/dist/namespaces/tier.js +7 -7
  169. package/sdk/dist/namespaces/tier.js.map +1 -1
  170. package/sdk/dist/namespaces/transfers.d.ts +74 -71
  171. package/sdk/dist/namespaces/transfers.d.ts.map +1 -1
  172. package/sdk/dist/namespaces/transfers.js +31 -38
  173. package/sdk/dist/namespaces/transfers.js.map +1 -1
  174. package/sdk/dist/namespaces/vouchers.d.ts +9 -10
  175. package/sdk/dist/namespaces/vouchers.d.ts.map +1 -1
  176. package/sdk/dist/namespaces/vouchers.js +4 -5
  177. package/sdk/dist/namespaces/vouchers.js.map +1 -1
  178. package/sdk/dist/namespaces/wallets.d.ts +72 -3
  179. package/sdk/dist/namespaces/wallets.d.ts.map +1 -1
  180. package/sdk/dist/namespaces/wallets.js +141 -3
  181. package/sdk/dist/namespaces/wallets.js.map +1 -1
  182. package/sdk/dist/namespaces/write-approval.d.ts +101 -0
  183. package/sdk/dist/namespaces/write-approval.d.ts.map +1 -0
  184. package/sdk/dist/namespaces/write-approval.js +62 -0
  185. package/sdk/dist/namespaces/write-approval.js.map +1 -0
  186. package/sdk/dist/node/actions-node.d.ts +3 -3
  187. package/sdk/dist/node/actions-node.d.ts.map +1 -1
  188. package/sdk/dist/node/actions-node.js +36 -36
  189. package/sdk/dist/node/actions-node.js.map +1 -1
  190. package/sdk/dist/node/{bearer-claim-key.d.ts → bearer-redeem-key.d.ts} +12 -12
  191. package/sdk/dist/node/bearer-redeem-key.d.ts.map +1 -0
  192. package/sdk/dist/node/{bearer-claim-key.js → bearer-redeem-key.js} +21 -21
  193. package/sdk/dist/node/bearer-redeem-key.js.map +1 -0
  194. package/sdk/dist/node/ci.d.ts +1 -1
  195. package/sdk/dist/node/ci.d.ts.map +1 -1
  196. package/sdk/dist/node/ci.js +6 -6
  197. package/sdk/dist/node/ci.js.map +1 -1
  198. package/sdk/dist/node/credentials.d.ts +17 -16
  199. package/sdk/dist/node/credentials.d.ts.map +1 -1
  200. package/sdk/dist/node/credentials.js +28 -27
  201. package/sdk/dist/node/credentials.js.map +1 -1
  202. package/sdk/dist/node/funding-recovery.d.ts +1 -1
  203. package/sdk/dist/node/funding-recovery.d.ts.map +1 -1
  204. package/sdk/dist/node/funding-recovery.js +1 -1
  205. package/sdk/dist/node/funding-recovery.js.map +1 -1
  206. package/sdk/dist/node/gitvault-apply.d.ts +1 -1
  207. package/sdk/dist/node/gitvault-apply.d.ts.map +1 -1
  208. package/sdk/dist/node/gitvault-handoff.d.ts +22 -22
  209. package/sdk/dist/node/gitvault-handoff.d.ts.map +1 -1
  210. package/sdk/dist/node/gitvault-handoff.js +45 -45
  211. package/sdk/dist/node/gitvault-handoff.js.map +1 -1
  212. package/sdk/dist/node/gitvault-prewarm.js +7 -7
  213. package/sdk/dist/node/gitvault-prewarm.js.map +1 -1
  214. package/sdk/dist/node/gitvault-restore.d.ts +1 -1
  215. package/sdk/dist/node/gitvault-restore.js +1 -1
  216. package/sdk/dist/node/index.d.ts +16 -16
  217. package/sdk/dist/node/index.d.ts.map +1 -1
  218. package/sdk/dist/node/index.js +15 -15
  219. package/sdk/dist/node/index.js.map +1 -1
  220. package/sdk/dist/node/org-adopt.d.ts +49 -0
  221. package/sdk/dist/node/org-adopt.d.ts.map +1 -0
  222. package/sdk/dist/node/org-adopt.js +77 -0
  223. package/sdk/dist/node/org-adopt.js.map +1 -0
  224. package/sdk/dist/node/paid-fetch.d.ts +7 -7
  225. package/sdk/dist/node/paid-fetch.d.ts.map +1 -1
  226. package/sdk/dist/node/paid-fetch.js +54 -54
  227. package/sdk/dist/node/paid-fetch.js.map +1 -1
  228. package/sdk/dist/node/preflight.d.ts +1 -1
  229. package/sdk/dist/node/preflight.d.ts.map +1 -1
  230. package/sdk/dist/node/preflight.js +1 -1
  231. package/sdk/dist/node/preflight.js.map +1 -1
  232. package/sdk/dist/node/source-scan.d.ts +1 -1
  233. package/sdk/dist/node/source-scan.js +2 -2
  234. package/sdk/dist/node/source-scan.js.map +1 -1
  235. package/sdk/dist/scoped.d.ts +3 -3
  236. package/sdk/dist/scoped.d.ts.map +1 -1
  237. package/sdk/dist/scoped.js +2 -2
  238. package/sdk/dist/scoped.js.map +1 -1
  239. package/core-dist/operator-session.js +0 -154
  240. package/lib/allowance.mjs +0 -355
  241. package/lib/operator-proofs.mjs +0 -22
  242. package/lib/operator.mjs +0 -771
  243. package/sdk/core-dist/operator-session.js +0 -154
  244. package/sdk/dist/namespaces/allowance.d.ts +0 -79
  245. package/sdk/dist/namespaces/allowance.d.ts.map +0 -1
  246. package/sdk/dist/namespaces/allowance.js +0 -149
  247. package/sdk/dist/namespaces/allowance.js.map +0 -1
  248. package/sdk/dist/namespaces/operator-session.d.ts.map +0 -1
  249. package/sdk/dist/namespaces/operator-session.js.map +0 -1
  250. package/sdk/dist/namespaces/operator.d.ts +0 -359
  251. package/sdk/dist/namespaces/operator.d.ts.map +0 -1
  252. package/sdk/dist/namespaces/operator.js +0 -272
  253. package/sdk/dist/namespaces/operator.js.map +0 -1
  254. package/sdk/dist/node/bearer-claim-key.d.ts.map +0 -1
  255. package/sdk/dist/node/bearer-claim-key.js.map +0 -1
  256. package/sdk/dist/node/operator-claim.d.ts +0 -49
  257. package/sdk/dist/node/operator-claim.d.ts.map +0 -1
  258. package/sdk/dist/node/operator-claim.js +0 -77
  259. 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
- const HELP = `run402 deploy — Unified deploy operations
4
-
5
- Usage:
6
- run402 deploy <subcommand> [options]
7
-
8
- Subcommands:
9
- apply --manifest <file> Apply a v2 ReleaseSpec manifest
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
- if (!sub || sub === "--help" || sub === "-h") {
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 "release": {
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
- failUnknownSubcommand("deploy", sub, {
69
- hint: "Use `run402 deploy apply --manifest <file>` for deployments.",
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 apply, and scoped doctor.
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, allowance,
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, readAllowance, loadKeyStore } from "./config.mjs";
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
- "allowance",
50
+ "wallet",
51
51
  "projects",
52
52
  "api_reachable",
53
53
  "tier",
54
- "operator_health",
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 / allowance missing or error,
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: operator_health,
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/operator/scan sweep. An unknown check name is
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
- - Allowance is configured and on a valid rail (x402 / mpp)
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 allowance, tier, project,
181
- operator, runtime-staleness, and source-tree checks.
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 redactAllowanceForDiagnostics(allowance) {
268
- if (!allowance || typeof allowance !== "object") return allowance;
269
- const safe = { ...allowance };
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. Allowance.
394
- let allowanceConfigured = false;
395
- if (wanted("allowance")) try {
396
- const allowance = readAllowance();
397
- if (allowance) {
398
- allowanceConfigured = true;
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: "allowance",
400
+ name: "wallet",
401
401
  status: "ok",
402
402
  value: {
403
- rail: allowance.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: redactAllowanceForDiagnostics(allowance) }),
407
+ ...(verbose && { details: redactWalletForDiagnostics(localWallet) }),
408
408
  },
409
409
  });
410
410
  } else {
411
411
  checks.push({
412
- name: "allowance",
412
+ name: "wallet",
413
413
  status: "missing",
414
- hint: "Run 'run402 init' to create an allowance.",
414
+ hint: "Run 'run402 init' to create a wallet.",
415
415
  });
416
416
  }
417
417
  } catch (err) {
418
418
  checks.push({
419
- name: "allowance",
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 allowance.json (verified
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
- // allowance check above actually passed; pre-init installs are pointed
438
+ // wallet check above actually passed; pre-init installs are pointed
439
439
  // at `run402 init` first.
440
440
  ...(projectCount === 0 && {
441
- hint: allowanceConfigured
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 subscribe, renew, or reactivate the tier.",
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. Operator health snapshot (v1.55 + v1.56 verification attempt detail).
554
- // The checks below all ride the SAME operator-status read (runtime_staleness
555
- // and recovery_posture reuse the response operator_health already pulled),
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("operator_health") || wanted("runtime_staleness") || wanted("recovery_posture")) try {
561
+ if (wanted("account_health") || wanted("runtime_staleness") || wanted("recovery_posture")) try {
561
562
  const sdk = getSdk();
562
- const status = await sdk.admin.getOperatorStatus();
563
+ const status = await sdk.me.status();
563
564
  const gaps = [];
564
- if (status.operator_contact.email_status !== "verified") {
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 operator.
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(`operator email not verified${attemptsLine}: ${ch.hint}`);
575
+ gaps.push(`contact email not verified${attemptsLine}: ${ch.hint}`);
575
576
  } else {
576
- gaps.push(`operator email not verified (${status.operator_contact.email_status}) — run 'run402 agent contact --email ...' then reply to the challenge`);
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.operator_contact.passkey_status !== "verified") {
580
- gaps.push("operator passkey not bound — run 'run402 agent passkey enroll' after email verification");
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.operator_reachability;
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("operator_health")) {
603
+ if (wanted("account_health")) {
603
604
  if (gaps.length > 0) {
604
605
  checks.push({
605
- name: "operator_health",
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: "operator_health", status: "ok" });
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 operator status fetched above to avoid a second round-trip.
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: "operator status has no 'runtime' block; requires v1.69+ gateway." }),
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 operator-status
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: "operator status has no 'recovery_posture' block; requires a gitvault-recovery-custody gateway." }),
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
- // Operator status endpoint may not be reachable if the operator-binding
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("operator_health")) checks.push({
704
- name: "operator_health",
703
+ if (wanted("account_health")) checks.push({
704
+ name: "account_health",
705
705
  status: "skipped",
706
- message: describeCheckFailure("operator status check", err),
707
- ...(verbose && { hint: "GET /agent/v1/operator/status not reachable; requires v1.55+ gateway." }),
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("operator status check", err),
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("operator status check", err),
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 apply."
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
  }
@@ -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 operator email is accepted
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 { allowanceAuthHeaders } from "./config.mjs";
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 an allowance (run402 allowance create)
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 hand_to_operator. That is
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 hand_to_operator next action
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 an allowance (run402 allowance create)
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
- hand_to_operator next action, show your human urls.site and
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 allowance check so oversized payloads surface
94
- // a structured size error instead of being masked by a missing-allowance
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 allowance is configured.
115
- allowanceAuthHeaders("/feedback/v1");
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;
@@ -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, allowance, env-derived config) fresh per
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 allowance (run402 allowance create && run402 allowance fund)
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 allowance targets — Base Sepolia on the prototype tier, Base
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 allowance (run402 allowance create && run402 allowance fund)
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