run402 4.93.2 → 4.95.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 (316) hide show
  1. package/README.md +61 -59
  2. package/cli.mjs +40 -47
  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 +2 -2
  11. package/lib/admin.mjs +6 -6
  12. package/lib/agent.mjs +20 -18
  13. package/lib/ai.mjs +5 -5
  14. package/lib/approve.mjs +81 -0
  15. package/lib/apps.mjs +12 -12
  16. package/lib/archives.mjs +371 -8
  17. package/lib/argparse.mjs +5 -5
  18. package/lib/assets.mjs +14 -14
  19. package/lib/auth.mjs +34 -34
  20. package/lib/billing.mjs +6 -6
  21. package/lib/branches.mjs +7 -7
  22. package/lib/buzz-doctor.mjs +2 -2
  23. package/lib/buzz-notifications.mjs +5 -5
  24. package/lib/buzz.mjs +3 -3
  25. package/lib/buzz.test.mjs +1 -1
  26. package/lib/cache.mjs +1 -1
  27. package/lib/cdn.mjs +2 -2
  28. package/lib/ci.mjs +12 -12
  29. package/lib/claims.mjs +2 -2
  30. package/lib/cold-start.mjs +21 -21
  31. package/lib/command-manifest.mjs +55 -70
  32. package/lib/config.mjs +28 -28
  33. package/lib/contacts.mjs +16 -16
  34. package/lib/contracts.mjs +12 -12
  35. package/lib/credentials.mjs +33 -33
  36. package/lib/daemon-path.mjs +1 -1
  37. package/lib/delegates.mjs +14 -14
  38. package/lib/deliveries.mjs +6 -6
  39. package/lib/deploy-rehearse-discovery.test.mjs +7 -7
  40. package/lib/deploy-v2.mjs +241 -193
  41. package/lib/deploy.mjs +21 -53
  42. package/lib/dev.mjs +3 -3
  43. package/lib/doctor-source-scan.mjs +1 -1
  44. package/lib/doctor.mjs +63 -63
  45. package/lib/domains.mjs +27 -27
  46. package/lib/email.mjs +38 -38
  47. package/lib/errors.mjs +40 -24
  48. package/lib/escalations.mjs +5 -5
  49. package/lib/events.mjs +32 -25
  50. package/lib/feedback.mjs +12 -12
  51. package/lib/functions.mjs +34 -34
  52. package/lib/gitvault-daemon.mjs +1 -1
  53. package/lib/gitvault-scaffold.mjs +2 -2
  54. package/lib/gitvault.mjs +2 -2
  55. package/lib/grants.mjs +7 -7
  56. package/lib/image.mjs +10 -10
  57. package/lib/init.mjs +69 -69
  58. package/lib/jobs.mjs +15 -15
  59. package/lib/lightning-wallet.mjs +28 -28
  60. package/lib/live.mjs +1 -1
  61. package/lib/login.mjs +207 -0
  62. package/lib/logout.mjs +53 -0
  63. package/lib/logs.mjs +8 -8
  64. package/lib/messages.mjs +5 -5
  65. package/lib/next-actions.mjs +16 -16
  66. package/lib/org-context.mjs +13 -13
  67. package/lib/{org.mjs → orgs.mjs} +215 -167
  68. package/lib/pay.mjs +1 -1
  69. package/lib/projects.mjs +70 -84
  70. package/lib/redeem.mjs +7 -8
  71. package/lib/remote-helper-session.mjs +12 -12
  72. package/lib/repos.mjs +83 -83
  73. package/lib/rooms.mjs +105 -69
  74. package/lib/sdk-errors.mjs +10 -5
  75. package/lib/sdk.mjs +3 -3
  76. package/lib/secrets.mjs +13 -13
  77. package/lib/service.mjs +5 -5
  78. package/lib/session-proofs.mjs +21 -0
  79. package/lib/sign-in.mjs +296 -0
  80. package/lib/sites.mjs +22 -22
  81. package/lib/snapshots.mjs +10 -10
  82. package/lib/stats.mjs +2 -2
  83. package/lib/status.mjs +25 -25
  84. package/lib/subdomains.mjs +30 -30
  85. package/lib/subscriptions.mjs +10 -10
  86. package/lib/tier.mjs +29 -22
  87. package/lib/transfer.mjs +59 -86
  88. package/lib/up.mjs +14 -14
  89. package/lib/wallet-context.mjs +4 -4
  90. package/lib/wallet-context.test.mjs +3 -3
  91. package/lib/wallets.mjs +197 -32
  92. package/lib/webhook-secret.mjs +6 -6
  93. package/lib/webhooks.mjs +8 -8
  94. package/lib/whoami.mjs +102 -0
  95. package/package.json +1 -1
  96. package/sdk/core-dist/config.js +52 -18
  97. package/sdk/core-dist/control-plane-session.js +31 -6
  98. package/sdk/core-dist/keystore.js +7 -7
  99. package/sdk/core-dist/profiles.js +9 -7
  100. package/sdk/core-dist/{allowance-auth.js → wallet-auth.js} +15 -15
  101. package/{core-dist/allowance.js → sdk/core-dist/wallet.js} +20 -20
  102. package/{core-dist/write-auth-session.js → sdk/core-dist/write-approvals.js} +19 -19
  103. package/sdk/dist/actions.d.ts +4 -4
  104. package/sdk/dist/actions.d.ts.map +1 -1
  105. package/sdk/dist/app-up.d.ts +2 -2
  106. package/sdk/dist/app-up.d.ts.map +1 -1
  107. package/sdk/dist/config.d.ts +1 -2
  108. package/sdk/dist/config.d.ts.map +1 -1
  109. package/sdk/dist/config.js.map +1 -1
  110. package/sdk/dist/control-plane-credentials.d.ts +8 -8
  111. package/sdk/dist/control-plane-credentials.js +7 -7
  112. package/sdk/dist/credentials.d.ts +20 -20
  113. package/sdk/dist/credentials.d.ts.map +1 -1
  114. package/sdk/dist/credentials.js +1 -1
  115. package/sdk/dist/errors.d.ts +26 -28
  116. package/sdk/dist/errors.d.ts.map +1 -1
  117. package/sdk/dist/errors.js +35 -38
  118. package/sdk/dist/errors.js.map +1 -1
  119. package/sdk/dist/index.d.ts +29 -16
  120. package/sdk/dist/index.d.ts.map +1 -1
  121. package/sdk/dist/index.js +30 -17
  122. package/sdk/dist/index.js.map +1 -1
  123. package/sdk/dist/kernel.d.ts +1 -1
  124. package/sdk/dist/kernel.d.ts.map +1 -1
  125. package/sdk/dist/kernel.js +10 -9
  126. package/sdk/dist/kernel.js.map +1 -1
  127. package/sdk/dist/namespaces/admin.d.ts +52 -121
  128. package/sdk/dist/namespaces/admin.d.ts.map +1 -1
  129. package/sdk/dist/namespaces/admin.js +41 -45
  130. package/sdk/dist/namespaces/admin.js.map +1 -1
  131. package/sdk/dist/namespaces/agent.d.ts +2 -2
  132. package/sdk/dist/namespaces/agent.d.ts.map +1 -1
  133. package/sdk/dist/namespaces/agent.js +2 -2
  134. package/sdk/dist/namespaces/agent.js.map +1 -1
  135. package/sdk/dist/namespaces/ai.d.ts +2 -2
  136. package/sdk/dist/namespaces/ai.js +3 -3
  137. package/sdk/dist/namespaces/ai.js.map +1 -1
  138. package/sdk/dist/namespaces/assets.js +1 -1
  139. package/sdk/dist/namespaces/assets.js.map +1 -1
  140. package/sdk/dist/namespaces/billing.d.ts +6 -3
  141. package/sdk/dist/namespaces/billing.d.ts.map +1 -1
  142. package/sdk/dist/namespaces/billing.js.map +1 -1
  143. package/sdk/dist/namespaces/buzz-notifications.types.d.ts +1 -1
  144. package/sdk/dist/namespaces/buzz.d.ts +2 -2
  145. package/sdk/dist/namespaces/buzz.d.ts.map +1 -1
  146. package/sdk/dist/namespaces/buzz.js +2 -2
  147. package/sdk/dist/namespaces/buzz.js.map +1 -1
  148. package/sdk/dist/namespaces/buzz.types.d.ts +2 -2
  149. package/sdk/dist/namespaces/buzz.types.d.ts.map +1 -1
  150. package/sdk/dist/namespaces/ci.js +3 -3
  151. package/sdk/dist/namespaces/ci.js.map +1 -1
  152. package/sdk/dist/namespaces/credentials.types.d.ts +1 -1
  153. package/sdk/dist/namespaces/deploy.d.ts +1 -1
  154. package/sdk/dist/namespaces/deploy.d.ts.map +1 -1
  155. package/sdk/dist/namespaces/deploy.js +31 -32
  156. package/sdk/dist/namespaces/deploy.js.map +1 -1
  157. package/sdk/dist/namespaces/deploy.types.d.ts +6 -6
  158. package/sdk/dist/namespaces/deploy.types.d.ts.map +1 -1
  159. package/sdk/dist/namespaces/domains.d.ts +10 -2
  160. package/sdk/dist/namespaces/domains.d.ts.map +1 -1
  161. package/sdk/dist/namespaces/domains.js +10 -5
  162. package/sdk/dist/namespaces/domains.js.map +1 -1
  163. package/sdk/dist/namespaces/errors.js +1 -1
  164. package/sdk/dist/namespaces/escalations.d.ts +1 -1
  165. package/sdk/dist/namespaces/escalations.js +1 -1
  166. package/sdk/dist/namespaces/escalations.types.d.ts +2 -2
  167. package/sdk/dist/namespaces/escalations.types.d.ts.map +1 -1
  168. package/sdk/dist/namespaces/events.types.d.ts +1 -1
  169. package/sdk/dist/namespaces/functions.d.ts +1 -1
  170. package/sdk/dist/namespaces/functions.js +2 -2
  171. package/sdk/dist/namespaces/functions.js.map +1 -1
  172. package/sdk/dist/namespaces/gitvault.crypto.d.ts +1 -1
  173. package/sdk/dist/namespaces/gitvault.d.ts +26 -26
  174. package/sdk/dist/namespaces/gitvault.d.ts.map +1 -1
  175. package/sdk/dist/namespaces/gitvault.js +113 -113
  176. package/sdk/dist/namespaces/gitvault.js.map +1 -1
  177. package/sdk/dist/namespaces/me.d.ts +120 -0
  178. package/sdk/dist/namespaces/me.d.ts.map +1 -0
  179. package/sdk/dist/namespaces/me.js +34 -0
  180. package/sdk/dist/namespaces/me.js.map +1 -0
  181. package/sdk/dist/namespaces/org.d.ts +108 -6
  182. package/sdk/dist/namespaces/org.d.ts.map +1 -1
  183. package/sdk/dist/namespaces/org.js +63 -7
  184. package/sdk/dist/namespaces/org.js.map +1 -1
  185. package/sdk/dist/namespaces/org.types.d.ts +29 -9
  186. package/sdk/dist/namespaces/org.types.d.ts.map +1 -1
  187. package/sdk/dist/namespaces/pay.js +3 -3
  188. package/sdk/dist/namespaces/pay.js.map +1 -1
  189. package/sdk/dist/namespaces/projects.d.ts +9 -9
  190. package/sdk/dist/namespaces/projects.js +15 -15
  191. package/sdk/dist/namespaces/projects.js.map +1 -1
  192. package/sdk/dist/namespaces/projects.types.d.ts +28 -12
  193. package/sdk/dist/namespaces/projects.types.d.ts.map +1 -1
  194. package/sdk/dist/namespaces/rooms.d.ts +7 -7
  195. package/sdk/dist/namespaces/rooms.js +17 -17
  196. package/sdk/dist/namespaces/rooms.js.map +1 -1
  197. package/sdk/dist/namespaces/rooms.types.d.ts +9 -9
  198. package/sdk/dist/namespaces/rooms.types.d.ts.map +1 -1
  199. package/sdk/dist/namespaces/service.d.ts +1 -1
  200. package/sdk/dist/namespaces/service.js +1 -1
  201. package/sdk/dist/namespaces/{operator-session.d.ts → session.d.ts} +135 -51
  202. package/sdk/dist/namespaces/session.d.ts.map +1 -0
  203. package/sdk/dist/namespaces/{operator-session.js → session.js} +118 -30
  204. package/sdk/dist/namespaces/session.js.map +1 -0
  205. package/sdk/dist/namespaces/subdomains.d.ts +5 -5
  206. package/sdk/dist/namespaces/subdomains.d.ts.map +1 -1
  207. package/sdk/dist/namespaces/subdomains.js +6 -6
  208. package/sdk/dist/namespaces/subdomains.js.map +1 -1
  209. package/sdk/dist/namespaces/tier.d.ts +44 -21
  210. package/sdk/dist/namespaces/tier.d.ts.map +1 -1
  211. package/sdk/dist/namespaces/tier.js +7 -7
  212. package/sdk/dist/namespaces/tier.js.map +1 -1
  213. package/sdk/dist/namespaces/transfers.d.ts +119 -85
  214. package/sdk/dist/namespaces/transfers.d.ts.map +1 -1
  215. package/sdk/dist/namespaces/transfers.js +31 -38
  216. package/sdk/dist/namespaces/transfers.js.map +1 -1
  217. package/sdk/dist/namespaces/vouchers.d.ts +9 -10
  218. package/sdk/dist/namespaces/vouchers.d.ts.map +1 -1
  219. package/sdk/dist/namespaces/vouchers.js +4 -5
  220. package/sdk/dist/namespaces/vouchers.js.map +1 -1
  221. package/sdk/dist/namespaces/wallets.d.ts +72 -3
  222. package/sdk/dist/namespaces/wallets.d.ts.map +1 -1
  223. package/sdk/dist/namespaces/wallets.js +141 -3
  224. package/sdk/dist/namespaces/wallets.js.map +1 -1
  225. package/sdk/dist/namespaces/write-approval.d.ts +101 -0
  226. package/sdk/dist/namespaces/write-approval.d.ts.map +1 -0
  227. package/sdk/dist/namespaces/write-approval.js +62 -0
  228. package/sdk/dist/namespaces/write-approval.js.map +1 -0
  229. package/sdk/dist/node/actions-node.d.ts +3 -3
  230. package/sdk/dist/node/actions-node.d.ts.map +1 -1
  231. package/sdk/dist/node/actions-node.js +44 -44
  232. package/sdk/dist/node/actions-node.js.map +1 -1
  233. package/sdk/dist/node/assets-node.js +6 -6
  234. package/sdk/dist/node/assets-node.js.map +1 -1
  235. package/sdk/dist/node/{bearer-claim-key.d.ts → bearer-redeem-key.d.ts} +12 -12
  236. package/sdk/dist/node/bearer-redeem-key.d.ts.map +1 -0
  237. package/sdk/dist/node/{bearer-claim-key.js → bearer-redeem-key.js} +21 -21
  238. package/sdk/dist/node/bearer-redeem-key.js.map +1 -0
  239. package/sdk/dist/node/ci.d.ts +1 -1
  240. package/sdk/dist/node/ci.d.ts.map +1 -1
  241. package/sdk/dist/node/ci.js +6 -6
  242. package/sdk/dist/node/ci.js.map +1 -1
  243. package/sdk/dist/node/credentials.d.ts +18 -17
  244. package/sdk/dist/node/credentials.d.ts.map +1 -1
  245. package/sdk/dist/node/credentials.js +29 -28
  246. package/sdk/dist/node/credentials.js.map +1 -1
  247. package/sdk/dist/node/deploy-manifest.d.ts +3 -5
  248. package/sdk/dist/node/deploy-manifest.d.ts.map +1 -1
  249. package/sdk/dist/node/deploy-manifest.js +3 -12
  250. package/sdk/dist/node/deploy-manifest.js.map +1 -1
  251. package/sdk/dist/node/funding-recovery.d.ts +1 -1
  252. package/sdk/dist/node/funding-recovery.d.ts.map +1 -1
  253. package/sdk/dist/node/funding-recovery.js +1 -1
  254. package/sdk/dist/node/funding-recovery.js.map +1 -1
  255. package/sdk/dist/node/gitvault-apply.d.ts +1 -1
  256. package/sdk/dist/node/gitvault-apply.d.ts.map +1 -1
  257. package/sdk/dist/node/gitvault-apply.js +1 -1
  258. package/sdk/dist/node/gitvault-apply.js.map +1 -1
  259. package/sdk/dist/node/gitvault-handoff.d.ts +22 -22
  260. package/sdk/dist/node/gitvault-handoff.d.ts.map +1 -1
  261. package/sdk/dist/node/gitvault-handoff.js +45 -45
  262. package/sdk/dist/node/gitvault-handoff.js.map +1 -1
  263. package/sdk/dist/node/gitvault-prewarm.js +7 -7
  264. package/sdk/dist/node/gitvault-prewarm.js.map +1 -1
  265. package/sdk/dist/node/gitvault-restore.d.ts +1 -1
  266. package/sdk/dist/node/gitvault-restore.js +1 -1
  267. package/sdk/dist/node/index.d.ts +16 -16
  268. package/sdk/dist/node/index.d.ts.map +1 -1
  269. package/sdk/dist/node/index.js +15 -15
  270. package/sdk/dist/node/index.js.map +1 -1
  271. package/sdk/dist/node/manifest-export.js +2 -2
  272. package/sdk/dist/node/manifest-export.js.map +1 -1
  273. package/sdk/dist/node/org-adopt.d.ts +49 -0
  274. package/sdk/dist/node/org-adopt.d.ts.map +1 -0
  275. package/sdk/dist/node/org-adopt.js +77 -0
  276. package/sdk/dist/node/org-adopt.js.map +1 -0
  277. package/sdk/dist/node/paid-fetch.d.ts +7 -7
  278. package/sdk/dist/node/paid-fetch.d.ts.map +1 -1
  279. package/sdk/dist/node/paid-fetch.js +54 -54
  280. package/sdk/dist/node/paid-fetch.js.map +1 -1
  281. package/sdk/dist/node/preflight.d.ts +1 -1
  282. package/sdk/dist/node/preflight.d.ts.map +1 -1
  283. package/sdk/dist/node/preflight.js +1 -1
  284. package/sdk/dist/node/preflight.js.map +1 -1
  285. package/sdk/dist/node/sites-node.js +1 -1
  286. package/sdk/dist/node/sites-node.js.map +1 -1
  287. package/sdk/dist/node/source-scan.d.ts +1 -1
  288. package/sdk/dist/node/source-scan.js +2 -2
  289. package/sdk/dist/node/source-scan.js.map +1 -1
  290. package/sdk/dist/scoped.d.ts +11 -11
  291. package/sdk/dist/scoped.d.ts.map +1 -1
  292. package/sdk/dist/scoped.js +5 -5
  293. package/sdk/dist/scoped.js.map +1 -1
  294. package/core-dist/operator-session.js +0 -154
  295. package/lib/allowance.mjs +0 -355
  296. package/lib/cloud.mjs +0 -256
  297. package/lib/core.mjs +0 -123
  298. package/lib/operator-proofs.mjs +0 -22
  299. package/lib/operator.mjs +0 -771
  300. package/sdk/core-dist/operator-session.js +0 -154
  301. package/sdk/dist/namespaces/allowance.d.ts +0 -79
  302. package/sdk/dist/namespaces/allowance.d.ts.map +0 -1
  303. package/sdk/dist/namespaces/allowance.js +0 -149
  304. package/sdk/dist/namespaces/allowance.js.map +0 -1
  305. package/sdk/dist/namespaces/operator-session.d.ts.map +0 -1
  306. package/sdk/dist/namespaces/operator-session.js.map +0 -1
  307. package/sdk/dist/namespaces/operator.d.ts +0 -359
  308. package/sdk/dist/namespaces/operator.d.ts.map +0 -1
  309. package/sdk/dist/namespaces/operator.js +0 -272
  310. package/sdk/dist/namespaces/operator.js.map +0 -1
  311. package/sdk/dist/node/bearer-claim-key.d.ts.map +0 -1
  312. package/sdk/dist/node/bearer-claim-key.js.map +0 -1
  313. package/sdk/dist/node/operator-claim.d.ts +0 -49
  314. package/sdk/dist/node/operator-claim.d.ts.map +0 -1
  315. package/sdk/dist/node/operator-claim.js +0 -77
  316. package/sdk/dist/node/operator-claim.js.map +0 -1
package/lib/pay.mjs CHANGED
@@ -30,7 +30,7 @@ Examples:
30
30
  run402 pay https://seller.example/translate --method POST \
31
31
  --body '{"text":"hello"}' --max-usd 0.05 --idempotency-key translation:1
32
32
 
33
- The command uses the same allowance wallet and bounded x402 buyer as the SDK.
33
+ The command uses the same wallet and bounded x402 buyer as the SDK.
34
34
  An unpriced URL is passed through with payment: null.
35
35
  On trusted Run402 PAYMENT_INTENT_PENDING, wait for Retry-After and repeat this
36
36
  identical command with the same payer and --idempotency-key. Never change the key.
package/lib/projects.mjs CHANGED
@@ -1,8 +1,7 @@
1
1
  import { readFileSync } from "fs";
2
- import { allowanceAuthHeaders, resolveProjectId, getActiveProjectId, isCoreApiTarget } from "./config.mjs";
3
- import { loadLiveOperatorSession } from "../core-dist/operator-session.js";
2
+ import { walletAuthHeaders, resolveProjectId, getActiveProjectId, isCoreApiTarget } from "./config.mjs";
4
3
  import { loadLiveControlPlaneSession } from "../core-dist/control-plane-session.js";
5
- import { withAutoApprove } from "./operator.mjs";
4
+ import { withAutoApprove } from "./sign-in.mjs";
6
5
  import { getSdk } from "./sdk.mjs";
7
6
  import { reportSdkError, fail, parseFlagJson } from "./sdk-errors.mjs";
8
7
  import { stampOrgFromProject } from "./org-context.mjs";
@@ -15,27 +14,26 @@ Usage:
15
14
 
16
15
  Subcommands:
17
16
  quote Show pricing tiers
18
- provision [--tier <tier>] [--name <n>] [--org <id>] Provision a new Postgres project
19
- use <id> Set the active project (used as default for other commands)
20
- list [--org <id>] [--all] List your projects from the server (name, site_url, custom domains, org_id, active marker)
21
- rename <id> --name <label> Rename a project (fix an auto-generated name)
17
+ provision [--tier <tier>] [--name <n>] [--org <org_id>] Provision a new Postgres project
18
+ use <project_id> Set the active project (used as default for other commands)
19
+ list [--org <org_id>] [--all] List your projects from the server (name, site_url, custom domains, org_id, active marker)
20
+ rename <project_id> --name <label> Rename a project (fix an auto-generated name)
22
21
  tenant-payments [project_id] [--status <s>] List redacted tenant x402 payments for priced routes
23
- get [id] Authoritative server read: status, org, tier, active deploy, mailbox, usage vs limits (live; no keys)
22
+ get [project_id] Authoritative server read: status, org, tier, active deploy, mailbox, usage vs limits (live; no keys)
24
23
  current Show the active project pointer and validation status
25
- sql "<query>" [--project <id>] [--file <path>] [--params '<json>'] Run a SQL query (supports parameterized queries)
26
- rest <table> [--query "<params>"] [--project <id>] Query a table via the REST API (PostgREST)
27
- usage [id] Show compute/storage usage for a project
28
- costs [id] [--window <w>] Show admin-only per-project revenue/cost/margin
29
- schema [id] Inspect the database schema
30
- apply-expose [id] <manifest_json> Apply a declarative authorization manifest
31
- apply-expose [id] --file <path> Apply a manifest from a JSON file
32
- validate-expose [id] <manifest_json> Validate an authorization manifest without applying it
33
- validate-expose [id] --file <path> Validate a manifest file without mutating the project
34
- get-expose [id] Get the current authorization manifest
35
- delete [id] --confirm Immediately and irreversibly delete a project (cascade purge) and remove from local state. Requires --confirm.
36
- promote-user [id] <email> Promote a user to project_admin role
37
- demote-user [id] <email> Demote a user from project_admin role
38
- export [id] [archive options] Export a portable Run402 Core archive
24
+ sql "<query>" [--project <project_id>] [--file <path>] [--params '<json>'] Run a SQL query (supports parameterized queries)
25
+ rest <table> [--query "<params>"] [--project <project_id>] Query a table via the REST API (PostgREST)
26
+ usage [project_id] Show compute/storage usage for a project
27
+ costs [project_id] [--window <w>] Show admin-only per-project revenue/cost/margin
28
+ schema [project_id] Inspect the database schema
29
+ apply-expose [project_id] <manifest_json> Apply a declarative authorization manifest
30
+ apply-expose [project_id] --file <path> Apply a manifest from a JSON file
31
+ validate-expose [project_id] <manifest_json> Validate an authorization manifest without applying it
32
+ validate-expose [project_id] --file <path> Validate a manifest file without mutating the project
33
+ get-expose [project_id] Get the current authorization manifest
34
+ delete [project_id] --confirm Immediately and irreversibly delete a project (cascade purge) and remove from local state. Requires --confirm.
35
+ promote-user [project_id] <email> Promote a user to project_admin role
36
+ demote-user [project_id] <email> Demote a user from project_admin role
39
37
 
40
38
  Examples:
41
39
  run402 projects quote
@@ -60,7 +58,6 @@ Examples:
60
58
  run402 projects apply-expose prj_abc123 --file manifest.json
61
59
  run402 projects get-expose prj_abc123
62
60
  run402 projects delete prj_abc123 --confirm
63
- run402 projects export prj_abc123 --wait --output ./project.r402ar --json
64
61
 
65
62
  Global options (any command):
66
63
  --wallet <name> Use a named wallet (profile) for this command. Precedence:
@@ -68,23 +65,23 @@ Global options (any command):
68
65
  'run402 wallets use' default > 'default'. See 'run402 wallets'.
69
66
 
70
67
  Notes:
71
- - <id> is the project_id shown in 'run402 projects list' (prefix: 'prj_')
72
- - Most commands that take <id> default to the active project when omitted
73
- (set it with 'run402 projects use <id>'). Project IDs start with 'prj_';
68
+ - <project_id> is the project_id shown in 'run402 projects list' (prefix: 'prj_')
69
+ - Most commands that take <project_id> default to the active project when omitted
70
+ (set it with 'run402 projects use <project_id>'). Project IDs start with 'prj_';
74
71
  any first positional that doesn't is treated as the next argument instead.
75
72
  - 'list', 'get', and 'use' are SERVER-authoritative project identity flows.
76
73
  Local project keys live under 'run402 credentials project-keys ...'.
77
74
  - 'list' is a SERVER read, not the local key cache: it shows every project the
78
75
  active wallet can reach (membership-scoped), with name, site_url, custom
79
- domains, and org_id. '--org <id>' filters to one org; '--all' reads the
80
- cross-wallet inventory for every wallet controlling your operator email
81
- (run 'run402 operator login' first for the union, else it falls back to the
82
- current wallet's slice). The 'active' marker still comes from local state.
76
+ domains, and org_id. '--org <org_id>' filters to one org; '--all' reads every
77
+ project you can reach across all your orgs (as your sign-in session after
78
+ 'run402 login', else as the current wallet). The 'active' marker still
79
+ comes from local state.
83
80
  - 'rename' fixes a project's display name. You must be an org admin (or hold a
84
81
  project:write grant) on the owning org; it works even if the project was
85
82
  never provisioned from this machine.
86
83
  - 'rest' uses PostgREST query syntax (table name + optional query string)
87
- - 'provision' requires a funded allowance on Run402 Cloud. Against a
84
+ - 'provision' requires a funded wallet on Run402 Cloud. Against a
88
85
  configured Run402 Core target, it creates a local Core project without
89
86
  payment.
90
87
  - 'apply-expose' declares the full authorization surface (tables, views, RPCs)
@@ -109,17 +106,16 @@ const SUB_HELP = {
109
106
  list: `run402 projects list — List your projects from the server
110
107
 
111
108
  Usage:
112
- run402 projects list [--org <id>] [--all]
109
+ run402 projects list [--org <org_id>] [--all]
113
110
 
114
111
  Options:
115
- --org <id> Filter to projects owned by one org (organization).
112
+ --org <org_id> Filter to projects owned by one org (organization).
116
113
  Authorize-before-reveal: a non-member or guessed id is a
117
114
  403; a non-UUID id is a 400.
118
- --all Read the cross-wallet inventory across every wallet
119
- controlling your operator email. Run 'run402 operator
120
- login' first for the union; without a session it falls
121
- back to the current wallet's slice. Mutually exclusive
122
- with --org.
115
+ --all Read every project you can reach across all your orgs
116
+ (GET /agent/v1/me/projects). After 'run402 login' it
117
+ reads as your sign-in session; without one, as the
118
+ current wallet. Mutually exclusive with --org.
123
119
 
124
120
  Notes:
125
121
  - This is a SERVER read (membership-scoped), not the local keystore. Each row
@@ -137,10 +133,10 @@ Examples:
137
133
  rename: `run402 projects rename — Rename a project
138
134
 
139
135
  Usage:
140
- run402 projects rename <id> --name <label>
136
+ run402 projects rename <project_id> --name <label>
141
137
 
142
138
  Arguments:
143
- <id> Project ID (prefix: 'prj_'). Required.
139
+ <project_id> Project ID (prefix: 'prj_'). Required.
144
140
 
145
141
  Options:
146
142
  --name <label> New display name (1-200 chars, no control characters).
@@ -185,20 +181,20 @@ Notes:
185
181
  provision: `run402 projects provision — Provision a new Postgres project
186
182
 
187
183
  Usage:
188
- run402 projects provision [--tier <tier>] [--name <name>] [--org <id>] [--idempotency-key <key>]
184
+ run402 projects provision [--tier <tier>] [--name <name>] [--org <org_id>] [--idempotency-key <key>]
189
185
 
190
186
  Options:
191
187
  --tier <tier> Tier for the new project (default: prototype)
192
188
  --name <name> Human-readable name for the project
193
- --org <id> Provision into an EXISTING org (needs developer+ on it).
189
+ --org <org_id> Provision into an EXISTING org (needs developer+ on it).
194
190
  Omit for the cold-start path. Tier is org-governed.
195
191
  --idempotency-key <key> Retry-safe key: re-running with the same key returns
196
192
  the existing project instead of duplicating it. Auto-derived
197
193
  from --name when omitted; an unnamed provision stays un-keyed.
198
194
 
199
195
  Notes:
200
- - Payment is automatic via x402 on Run402 Cloud; requires a funded allowance.
201
- Against a configured Run402 Core target, no Cloud tier/allowance/payment is
196
+ - Payment is automatic via x402 on Run402 Cloud; requires a funded wallet.
197
+ Against a configured Run402 Core target, no Cloud tier/wallet/payment is
202
198
  required.
203
199
  - The new project becomes the active project after provisioning
204
200
 
@@ -211,8 +207,8 @@ Examples:
211
207
  sql: `run402 projects sql — Run a SQL query against a project's database
212
208
 
213
209
  Usage:
214
- run402 projects sql "<query>" [--project <id>] [options]
215
- run402 projects sql --file <path> [--project <id>] [options]
210
+ run402 projects sql "<query>" [--project <project_id>] [options]
211
+ run402 projects sql --file <path> [--project <project_id>] [options]
216
212
 
217
213
  Legacy (still supported):
218
214
  run402 projects sql <prj_id> "<query>" [options]
@@ -221,7 +217,7 @@ Arguments:
221
217
  <query> Inline SQL query (quote it to preserve spaces)
222
218
 
223
219
  Options:
224
- --project <id> Project ID (defaults to the active project; a leading
220
+ --project <project_id> Project ID (defaults to the active project; a leading
225
221
  prj_... positional is also still accepted)
226
222
  --file <path> Read SQL from a file instead of an inline query
227
223
  --params '<json>' JSON array of parameters for a parameterized query
@@ -234,10 +230,10 @@ Examples:
234
230
  costs: `run402 projects costs — Show admin-only per-project finance
235
231
 
236
232
  Usage:
237
- run402 projects costs [id] [--window <24h|7d|30d|90d>]
233
+ run402 projects costs [project_id] [--window <24h|7d|30d|90d>]
238
234
 
239
235
  Arguments:
240
- [id] Project ID (defaults to the active project if omitted)
236
+ [project_id] Project ID (defaults to the active project if omitted)
241
237
 
242
238
  Options:
243
239
  --window <w> Finance window (default: 30d). One of: 24h, 7d, 30d, 90d
@@ -246,7 +242,7 @@ Environment:
246
242
  RUN402_ADMIN_COOKIE Optional admin OAuth cookie header, e.g. "run402_admin=..."
247
243
 
248
244
  Notes:
249
- - Platform-admin only. The configured allowance wallet must be an admin
245
+ - Platform-admin only. The configured wallet must be an admin
250
246
  wallet, or RUN402_ADMIN_COOKIE must contain an admin OAuth cookie.
251
247
  - Project service keys are not enough for this endpoint.
252
248
  - Output is the gateway's per-project finance JSON: revenue, direct cost,
@@ -260,12 +256,12 @@ Examples:
260
256
  "validate-expose": `run402 projects validate-expose — Validate an authorization manifest without applying it
261
257
 
262
258
  Usage:
263
- run402 projects validate-expose [id] <manifest_json> [options]
264
- run402 projects validate-expose [id] --file <path> [options]
265
- cat manifest.json | run402 projects validate-expose [id] [options]
259
+ run402 projects validate-expose [project_id] <manifest_json> [options]
260
+ run402 projects validate-expose [project_id] --file <path> [options]
261
+ cat manifest.json | run402 projects validate-expose [project_id] [options]
266
262
 
267
263
  Arguments:
268
- [id] Optional project ID. When omitted, the active project is
264
+ [project_id] Optional project ID. When omitted, the active project is
269
265
  used if one is set; otherwise validation is projectless.
270
266
  <manifest_json> Inline auth/expose manifest JSON.
271
267
 
@@ -330,7 +326,7 @@ async function provision(args) {
330
326
  code: "BAD_USAGE",
331
327
  message: "--org must not be empty.",
332
328
  details: { field: "--org" },
333
- hint: "Pass an org id (run402 org list), or omit --org for the cold-start path.",
329
+ hint: "Pass an org id (run402 orgs list), or omit --org for the cold-start path.",
334
330
  });
335
331
  }
336
332
  // Validate --name when provided. Omitted --name lets the server pick a
@@ -361,10 +357,10 @@ async function provision(args) {
361
357
  });
362
358
  }
363
359
  }
364
- // Aggressive early exit when no agent allowance is configured — but only when
365
- // there's also no operator (control-plane) session, since a wallet-less human
366
- // provisions into an org via their operator approval instead of a wallet.
367
- if (!isCoreApiTarget() && !loadLiveControlPlaneSession()) allowanceAuthHeaders("/projects/v1");
360
+ // Aggressive early exit when no local wallet is configured — but only when
361
+ // there's also no sign-in session, since a wallet-less person provisions
362
+ // into an org via a write approval instead of a wallet.
363
+ if (!isCoreApiTarget() && !loadLiveControlPlaneSession()) walletAuthHeaders("/projects/v1");
368
364
 
369
365
  const activeBefore = getActiveProjectId();
370
366
  try {
@@ -454,7 +450,7 @@ async function validateExpose(args = []) {
454
450
  fail({
455
451
  code: "BAD_USAGE",
456
452
  message: `Unexpected extra argument: ${arg}`,
457
- hint: "run402 projects validate-expose [id] <manifest_json>",
453
+ hint: "run402 projects validate-expose [project_id] <manifest_json>",
458
454
  });
459
455
  }
460
456
  }
@@ -462,7 +458,7 @@ async function validateExpose(args = []) {
462
458
  fail({
463
459
  code: "BAD_USAGE",
464
460
  message: "Provide either inline manifest JSON or --file <path>, not both.",
465
- hint: "run402 projects validate-expose [id] --file manifest.json",
461
+ hint: "run402 projects validate-expose [project_id] --file manifest.json",
466
462
  });
467
463
  }
468
464
  if (migrationFile && migrationSql !== null) {
@@ -495,7 +491,7 @@ async function validateExpose(args = []) {
495
491
  }
496
492
  const activeProjectId = getActiveProjectId();
497
493
  const project = projectFlag || projectId || activeProjectId || undefined;
498
- if (!project) allowanceAuthHeaders("/projects/v1/expose/validate");
494
+ if (!project) walletAuthHeaders("/projects/v1/expose/validate");
499
495
  const migration = migrationFile ? readFileSync(migrationFile, "utf-8") : migrationSql;
500
496
 
501
497
  try {
@@ -525,25 +521,24 @@ async function list(args = []) {
525
521
  fail({
526
522
  code: "BAD_USAGE",
527
523
  message: "--all and --org are mutually exclusive.",
528
- hint: "--all reads the cross-wallet operator inventory; --org filters the membership-scoped list to one org.",
524
+ hint: "--all reads every project across all your orgs; --org filters the membership-scoped list to one org.",
529
525
  });
530
526
  }
531
527
 
532
- // `--all` reads the operator email-union inventory across every wallet
533
- // controlling your verified email. Pass the cached operator-session token
534
- // when present (cross-wallet union); otherwise the SDK falls back to SIWX
535
- // wallet auth and the gateway returns just this wallet's slice.
528
+ // `--all` reads every project the caller can reach across all its orgs.
529
+ // Pass the cached sign-in session token when present; otherwise the SDK
530
+ // uses the credential provider and the gateway returns this wallet's slice.
536
531
  const opts = {};
537
532
  if (all) {
538
533
  opts.all = true;
539
- const session = loadLiveOperatorSession();
540
- if (session) opts.token = session.operator_session_token;
534
+ const session = loadLiveControlPlaneSession();
535
+ if (session) opts.token = session.control_plane_session_token;
541
536
  } else if (org) {
542
537
  opts.org = org;
543
538
  }
544
539
 
545
540
  // Active marker comes from local state; the inventory itself is the server
546
- // read (NOT the keystore), so it surfaces every project the wallet/email can
541
+ // read (NOT the keystore), so it surfaces every project the principal can
547
542
  // reach — including ones never provisioned from this machine.
548
543
  const activeId = getActiveProjectId();
549
544
 
@@ -574,7 +569,7 @@ async function rename(projectId, args = []) {
574
569
  fail({
575
570
  code: "BAD_USAGE",
576
571
  message: "Missing --name.",
577
- hint: "run402 projects rename <id> --name \"My Site\"",
572
+ hint: "run402 projects rename <project_id> --name \"My Site\"",
578
573
  });
579
574
  }
580
575
  try {
@@ -652,7 +647,7 @@ function commandMoved(name) {
652
647
  fail({
653
648
  code: "COMMAND_MOVED",
654
649
  message: `run402 projects ${name} moved to the explicit local credential-cache surface.`,
655
- hint: "Use `run402 credentials project-keys status/export --project <id>`.",
650
+ hint: "Use `run402 credentials project-keys status/export --project <project_id>`.",
656
651
  details: {
657
652
  old_command: `projects ${name}`,
658
653
  new_command: name === "keys" ? "credentials project-keys export --reveal" : "credentials project-keys status",
@@ -661,12 +656,12 @@ function commandMoved(name) {
661
656
  next_actions: [
662
657
  {
663
658
  type: "run_command",
664
- command: "run402 credentials project-keys status --project <id>",
659
+ command: "run402 credentials project-keys status --project <project_id>",
665
660
  why: "Inspect cached key presence without revealing secrets.",
666
661
  },
667
662
  {
668
663
  type: "run_command",
669
- command: "run402 credentials project-keys export --project <id> --reveal",
664
+ command: "run402 credentials project-keys export --project <project_id> --reveal",
670
665
  why: "Reveal cached project keys only when you explicitly need secret material.",
671
666
  },
672
667
  ],
@@ -736,7 +731,7 @@ async function rest(projectId, restArgs = []) {
736
731
  if (!table) {
737
732
  fail({
738
733
  code: "BAD_USAGE",
739
- message: "Missing <table> argument. Usage: run402 projects rest <table> [--query \"<query>\"] [--project <id>]",
734
+ message: "Missing <table> argument. Usage: run402 projects rest <table> [--query \"<query>\"] [--project <project_id>]",
740
735
  hint: "Run 'run402 projects schema' to list tables.",
741
736
  });
742
737
  }
@@ -889,10 +884,6 @@ const FLAGS_BY_SUB = {
889
884
  values: ["--project", "--file", "--migration-file", "--migration-sql"],
890
885
  },
891
886
  delete: { known: ["--project", "--confirm"], values: ["--project"] },
892
- export: {
893
- known: ["--project", "--scope", "--auth", "--consistency", "--idempotency-key", "--output", "--poll-interval", "--timeout", "--wait", "--json", "--json-stream"],
894
- values: ["--project", "--scope", "--auth", "--consistency", "--idempotency-key", "--output", "--poll-interval", "--timeout"],
895
- },
896
887
  };
897
888
 
898
889
  function validateFlags(sub, args) {
@@ -940,11 +931,6 @@ export async function run(sub, args) {
940
931
  case "validate-expose": await validateExpose(args); break;
941
932
  case "get-expose": { const { projectId } = resolveProjectSelector(args, { rejectBareFirst: true }); await getExpose(projectId); break; }
942
933
  case "delete": { const { projectId, rest } = resolveProjectSelector(args, { rejectBareFirst: true }); await deleteProject(projectId, rest); break; }
943
- case "export": {
944
- const { run } = await import("./cloud.mjs");
945
- await run("archives", ["create", ...args]);
946
- break;
947
- }
948
934
  case "promote-user": { const { projectId, rest } = resolveProjectSelector(args); await promoteUser(projectId, rest[0]); break; }
949
935
  case "demote-user": { const { projectId, rest } = resolveProjectSelector(args); await demoteUser(projectId, rest[0]); break; }
950
936
  default:
package/lib/redeem.mjs CHANGED
@@ -2,14 +2,13 @@ import { getSdk } from "./sdk.mjs";
2
2
  import { reportSdkError, fail } from "./sdk-errors.mjs";
3
3
  import { assertKnownFlags, normalizeArgv, positionalArgs } from "./argparse.mjs";
4
4
 
5
- const HELP = `run402 redeem — Redeem a promo code for run402 credit
5
+ const HELP = `run402 redeem — Redeem a promo code into your organization's allowance
6
6
 
7
7
  Usage:
8
8
  run402 redeem <code> [--json]
9
9
 
10
- A promo code credits your organization with run402 prepaid credit. That credit
11
- spends like any other prepaid balance — a tier purchase settles from it with no
12
- on-chain payment.
10
+ A promo code adds to your organization's allowance, which spends like any
11
+ other allowance — a tier purchase settles from it with no on-chain payment.
13
12
 
14
13
  Notes:
15
14
  - Order does not matter. This works as your very first authenticated call
@@ -17,7 +16,7 @@ Notes:
17
16
  - Codes are forgiving: case-insensitive and hyphens are optional, so
18
17
  'R402-K8F3-Q2W9' and 'r402k8f3q2w9' are the same code.
19
18
  - Retrying is safe. A repeat by the same organization returns the original
20
- result with "already_redeemed": true and never credits twice.
19
+ result with "already_redeemed": true and never adds the amount twice.
21
20
  - Being in a grace state does not block you. Redeeming is how an owner funds
22
21
  a renewal, so it is never gated.
23
22
  - One gift per organization, per issuer: past the lifetime ceiling for a
@@ -64,10 +63,10 @@ export async function run(args = []) {
64
63
  // in a field a human skims past.
65
64
  console.error("");
66
65
  console.error(
67
- ` Voucher ${usd(data.amount_usd_micros)} credited` +
68
- `${data.already_redeemed ? " (already redeemed " + data.redeemed_at + " — no second credit)" : ""}`,
66
+ ` Voucher ${usd(data.amount_usd_micros)} added` +
67
+ `${data.already_redeemed ? " (already redeemed " + data.redeemed_at + " — not added twice)" : ""}`,
69
68
  );
70
- console.error(` Balance ${usd(data.balance_usd_micros)} available`);
69
+ console.error(` Allowance ${usd(data.balance_usd_micros)}`);
71
70
  const next = Array.isArray(data.next_actions) ? data.next_actions.find((a) => a?.cli) : null;
72
71
  if (next?.cli) console.error(`\n Next: ${next.cli}`);
73
72
  console.error("");
@@ -146,7 +146,7 @@ const { getSdk } = await sdkModP;
146
146
  const { resolveWalletCore, enforceWalletExistsCore, WalletSelectionError } = await walletModP;
147
147
  const { gitvaultRemoteAddressForm, gitvaultSlugReleasedInfo, parseGitvaultRemoteUrl, gitvaultDegradedReadNote } = await isoModP;
148
148
  const { GITVAULT_R402_REF_NAMESPACE, hardenedGit, resolveGitInvocationRepo, readPinnedGitvaultRepo, pinGitvaultRepo, readGitvaultRestoreMarker, readGitvaultAutoGcThreshold, predialGitvaultObjectStore } = await nodeModP;
149
- const { allowanceFile, projectCredentialsFile, profileStateFile } = await configModP;
149
+ const { walletFile, projectCredentialsFile, profileStateFile } = await configModP;
150
150
 
151
151
  /**
152
152
  * Per-session SDK construction cache (gitvault-first-op-premium task 2.2).
@@ -167,10 +167,10 @@ const { allowanceFile, projectCredentialsFile, profileStateFile } = await config
167
167
  * doc comment calls out as reasons a fresh instance mattered for tests that
168
168
  * mutate them between calls in one process) and INVALIDATED on the mtime of
169
169
  * the three files whose bytes actually determine signer/credential material
170
- * (allowance, project-credentials keystore, profile state) — a wallet
170
+ * (wallet, project-credentials keystore, profile state) — a wallet
171
171
  * rotation, `run402 init`, or any other on-disk change is picked up on the
172
172
  * very next call, no daemon restart required. A file that does not exist
173
- * yet (fresh wallet, no allowance) signs into the key as `null`, so its
173
+ * yet (fresh wallet, no local wallet) signs into the key as `null`, so its
174
174
  * LATER appearance also busts the cache. The in-process fallback host calls
175
175
  * this at most once per process anyway, so it degrades to exactly today's
176
176
  * behavior there — this only changes anything for the daemon.
@@ -189,7 +189,7 @@ function sdkCacheKey() {
189
189
  const wallet = process.env.RUN402_WALLET ?? "";
190
190
  const configDir = process.env.RUN402_CONFIG_DIR ?? "";
191
191
  const apiBase = process.env.RUN402_API_BASE ?? "";
192
- const files = [mtimeOf(allowanceFile()), mtimeOf(projectCredentialsFile()), mtimeOf(profileStateFile())];
192
+ const files = [mtimeOf(walletFile()), mtimeOf(projectCredentialsFile()), mtimeOf(profileStateFile())];
193
193
  return `${wallet} ${configDir} ${apiBase} ${files.join(",")}`;
194
194
  }
195
195
 
@@ -214,7 +214,7 @@ const note = (line) => process.stderr.write(`git-remote-run402: ${line}\n`);
214
214
  * selection at all — a `.run402.json` binding, and even the global
215
215
  * `wallets use` default, would silently never reach it; only the
216
216
  * `RUN402_WALLET` env layer would work, so a bound checkout's `git push
217
- * run402 main` would use the WRONG wallet's (usually empty) allowance.
217
+ * run402 main` would use the WRONG (usually empty) wallet.
218
218
  *
219
219
  * Shares `resolveWalletCore`/`enforceWalletExistsCore` with the CLI
220
220
  * (`cli/lib/wallet-context.mjs`) — ONE implementation, minus the CLI's
@@ -253,19 +253,19 @@ function walletSourceLabel(resolved) {
253
253
  }
254
254
 
255
255
  /**
256
- * The allowance-missing/malformed family (`core/src/allowance.ts`'s own
256
+ * The wallet-missing/malformed family (`core/src/wallet.ts`'s own
257
257
  * throws) all end with "Back up the file and run 'run402 init' to recreate
258
258
  * it." — a remedy that assumes the resolved wallet is the one you meant.
259
259
  * That is only true when NOTHING selected a wallet (the bare default); when
260
260
  * an env var or a binding DID name one, the remedy is actively harmful —
261
- * `run402 init` recreates the DEFAULT wallet's allowance, a DIFFERENT
262
- * wallet than the one that was actually resolved and whose allowance is
261
+ * `run402 init` recreates the DEFAULT wallet's key file, a DIFFERENT
262
+ * wallet than the one that was actually resolved and whose key file is
263
263
  * actually missing/broken. Replace
264
264
  * it with the resolved wallet's name and how selection works, so the fix is
265
265
  * "correct the selection" rather than "recreate the wrong wallet".
266
266
  */
267
- function enrichAllowanceError(message) {
268
- if (!resolvedWallet || !/allowance\.json/.test(message)) return message;
267
+ function enrichWalletError(message) {
268
+ if (!resolvedWallet || !/wallet\.json/.test(message)) return message;
269
269
  const source = walletSourceLabel(resolvedWallet);
270
270
  const stripped = message.replace(/\s*Back up the file and run 'run402 init' to recreate it\.?/, "").trim();
271
271
  if (!source) {
@@ -276,13 +276,13 @@ function enrichAllowanceError(message) {
276
276
  return (
277
277
  `${stripped} Resolved wallet '${resolvedWallet.name}' via ${source} ` +
278
278
  "(order: RUN402_WALLET env > .run402.json binding > 'wallets use' default > default). " +
279
- `Wrong wallet? Fix selection instead. Right wallet, just no allowance yet? 'run402 wallets new ${resolvedWallet.name}'.`
279
+ `Wrong wallet? Fix selection instead. Right wallet, just not created yet? 'run402 wallets new ${resolvedWallet.name}'.`
280
280
  );
281
281
  }
282
282
 
283
283
  function describeError(err) {
284
284
  const code = err?.code ?? err?.body?.code ?? null;
285
- const message = enrichAllowanceError(err?.message ?? err?.body?.message ?? String(err));
285
+ const message = enrichWalletError(err?.message ?? err?.body?.message ?? String(err));
286
286
  // SLUG_RELEASED is never auto-followed — but the successor slug (design D6)
287
287
  // is exactly the fact a human/agent reading stderr needs to act on it.
288
288
  const released = gitvaultSlugReleasedInfo(err);