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/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
  }
package/lib/dev.mjs CHANGED
@@ -29,12 +29,12 @@ import { fail } from "./sdk-errors.mjs";
29
29
  const HELP = `run402 dev — Run Astro dev with Run402 context
30
30
 
31
31
  Usage:
32
- run402 dev [--port <n>] [--host <h>] [--project <id>]
32
+ run402 dev [--port <n>] [--host <h>] [--project <project_id>]
33
33
 
34
34
  Options:
35
35
  --port <n> Astro dev port (default 4321)
36
36
  --host <h> Astro dev host (default localhost)
37
- --project <id> Project id (default: RUN402_PROJECT_ID env var)
37
+ --project <project_id> Project id (default: RUN402_PROJECT_ID env var)
38
38
 
39
39
  The command:
40
40
  1. Loads .env.local from the current directory (if present)
@@ -85,7 +85,7 @@ export async function run(sub, args = []) {
85
85
  fail({
86
86
  code: "BAD_USAGE",
87
87
  message: "Missing RUN402_PROJECT_ID.",
88
- hint: "Set it in .env.local (or pass --project <id>). Run 'run402 projects provision' first if you don't have one.",
88
+ hint: "Set it in .env.local (or pass --project <project_id>). Run 'run402 projects provision' first if you don't have one.",
89
89
  });
90
90
  }
91
91
  if (!process.env.RUN402_SERVICE_KEY) {
@@ -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",
@@ -75,7 +75,7 @@ function collectRepeatableFlag(args, flag) {
75
75
  const HELP = `run402 doctor — Health and config diagnostics
76
76
 
77
77
  Usage:
78
- run402 doctor [--verbose] [--refresh] [--no-scan] [--scan-dir <D>] [--project <id>]
78
+ run402 doctor [--verbose] [--refresh] [--no-scan] [--scan-dir <D>] [--project <project_id>]
79
79
  [--only <check> ...]
80
80
  run402 --wallet <profile> doctor --buzz --buzz-agent <npub-or-hex>
81
81
 
@@ -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
@@ -117,7 +117,7 @@ Options:
117
117
  --dir D Select the application directory for deployment diagnostics.
118
118
  --manifest P Explicitly select a manifest (executable configs are trusted code).
119
119
  --scan-dir D Advanced arbitrary scan; does not claim deployment readiness
120
- --project <id> Target THIS project's gitvault check instead of the repo-standing
120
+ --project <project_id> Target THIS project's gitvault check instead of the repo-standing
121
121
  default (the 4.38.0 pin / run402 remote / RUN402_PROJECT_ID / active
122
122
  project, in that order — see \`gitvault-target.mjs\`). Scoped to the
123
123
  gitvault check only; every other check is wallet/machine-wide, not
@@ -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.
@@ -674,7 +675,7 @@ export async function run(sub, args = []) {
674
675
  for (const org of posture) {
675
676
  const label = `org ${org.org_id} (${org.vault_count} vault${org.vault_count === 1 ? "" : "s"})`;
676
677
  if (org.control_plane_configured === false) {
677
- gaps.push(`${label}: no human owner with a working control-plane login — if this org's agent machine dies, nobody can sign in to recover it. Invite a backup human (run402 org invite create ${org.org_id} --email <their-email> --role owner) and have them complete login at console.run402.com.`);
678
+ gaps.push(`${label}: no human owner with a working control-plane login — if this org's agent machine dies, nobody can sign in to recover it. Invite a backup human (run402 orgs invite create ${org.org_id} --email <their-email> --role owner) and have them complete login at console.run402.com.`);
678
679
  }
679
680
  if (org.source_backup_configured === false) {
680
681
  gaps.push(`${label}: no human member holds a working source-access key — vault history has no member-side decryption backup. Have a member complete source enrollment at console.run402.com/account → Source access.`);
@@ -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
 
@@ -735,7 +735,7 @@ export async function run(sub, args = []) {
735
735
  // with its own pinned repo id or run402/origin remote, doctor checks THAT
736
736
  // vault, not the profile's active project — the same pin > remote >
737
737
  // RUN402_PROJECT_ID env > active-project order every other gitvault verb
738
- // follows (`gitvault-target.mjs`). An explicit `--project <id>` outranks
738
+ // follows (`gitvault-target.mjs`). An explicit `--project <project_id>` outranks
739
739
  // all of that (the resolver's own top tier), same as every other gitvault
740
740
  // verb's `--project`.
741
741
  if (wanted("gitvault")) {
@@ -848,7 +848,7 @@ export async function run(sub, args = []) {
848
848
  if (gv.gitvault_policy === "required" && !gv.keystore.holds_repo_key) {
849
849
  gaps.push(
850
850
  "gitvault_policy is 'required' but this machine holds no key for the vault — a deploy from here is refused with GITVAULT_CLIENT_UPGRADE_REQUIRED. " +
851
- "Run 'run402 repos create --project <id>' (idempotent; resolves to the existing repo), or 'run402 repos policy grandfathered --reason <why>' to un-gate the project.",
851
+ "Run 'run402 repos create --project <project_id>' (idempotent; resolves to the existing repo), or 'run402 repos policy grandfathered --reason <why>' to un-gate the project.",
852
852
  );
853
853
  } else if (gv.gitvault_policy === "required" && !gv.keystore.can_sign) {
854
854
  gaps.push("gitvault_policy is 'required' and this keystore is read-only (no signing key) — it can verify but cannot publish the capture a deploy needs");
@@ -921,7 +921,7 @@ export async function run(sub, args = []) {
921
921
  status: gaps.length > 0 ? "warning" : "ok",
922
922
  value: gaps.length > 0 ? { ...value, gaps } : value,
923
923
  hint: (gv.vault === null
924
- ? `No vault for this project (that is a normal shape). Allocate one with 'run402 repos create --project <id>'. Keystore: ${gv.keystore.root}`
924
+ ? `No vault for this project (that is a normal shape). Allocate one with 'run402 repos create --project <project_id>'. Keystore: ${gv.keystore.root}`
925
925
  : gv.durability_statement
926
926
  ? `Back up ${gv.keystore.root} anyway — ${gv.durability_statement} (covering_recipients: ${gv.covering_recipients})`
927
927
  : `Back up ${gv.keystore.root} — whole-machine or whole-keystore loss is terminal for vault history.`) + byoDisclosure,
@@ -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
  }
package/lib/domains.mjs CHANGED
@@ -9,24 +9,24 @@ Usage:
9
9
  run402 domains <subcommand> [args...]
10
10
 
11
11
  Subcommands:
12
- connect <domain> [--project <id>] [--web] [--authority hosted-zone] [--email-send] [...]
13
- list [--project <id>] [--include-managed]
14
- status <domain> [--project <id>]
15
- dns <domain> [--project <id>] [--format json|bind]
16
- check <domain> [--project <id>]
17
- apply <domain> [--project <id>] [--authority auto|provider-connect|delegated-subdomain|hosted-zone]
18
- repair <domain> [--project <id>]
19
- test-receive <domain> --to <local-part|address> [--project <id>]
20
- wait <domain> [--project <id>] [--until active|safe|receive-active] [--timeout-ms <n>] [--interval-ms <n>]
21
- activate <domain> [--project <id>]
22
- disconnect <domain> --confirm [--project <id>]
12
+ connect <domain> [--project <project_id>] [--web] [--authority hosted-zone] [--email-send] [...]
13
+ list [--project <project_id>] [--include-managed]
14
+ status <domain> [--project <project_id>]
15
+ dns <domain> [--project <project_id>] [--format json|bind]
16
+ check <domain> [--project <project_id>]
17
+ apply <domain> [--project <project_id>] [--authority auto|provider-connect|delegated-subdomain|hosted-zone]
18
+ repair <domain> [--project <project_id>]
19
+ test-receive <domain> --to <local-part|address> [--project <project_id>]
20
+ wait <domain> [--project <project_id>] [--until active|safe|receive-active] [--timeout-ms <n>] [--interval-ms <n>]
21
+ activate <domain> [--project <project_id>]
22
+ disconnect <domain> --confirm [--project <project_id>]
23
23
  `;
24
24
 
25
25
  const SUB_HELP = {
26
26
  connect: `run402 domains connect — connect a ProjectDomain capability
27
27
 
28
28
  Usage:
29
- run402 domains connect <domain> --project <id> [--web] [--email-send] [--email-receive] [options]
29
+ run402 domains connect <domain> --project <project_id> [--web] [--email-send] [--email-receive] [options]
30
30
 
31
31
  Examples:
32
32
  run402 domains connect kysigned.com --project prj_123 --email-send --email-receive --mailbox-addresses primary --addresses info
@@ -42,52 +42,52 @@ Examples:
42
42
  list: `run402 domains list — list project domains
43
43
 
44
44
  Usage:
45
- run402 domains list --project <id>
45
+ run402 domains list --project <project_id>
46
46
  `,
47
47
  status: `run402 domains status — show one ProjectDomain aggregate
48
48
 
49
49
  Usage:
50
- run402 domains status <domain> --project <id>
50
+ run402 domains status <domain> --project <project_id>
51
51
  `,
52
52
  dns: `run402 domains dns — print required DNS records
53
53
 
54
54
  Usage:
55
- run402 domains dns <domain> --project <id> [--format json|bind]
55
+ run402 domains dns <domain> --project <project_id> [--format json|bind]
56
56
  `,
57
57
  check: `run402 domains check — refresh ProjectDomain observations and checks
58
58
 
59
59
  Usage:
60
- run402 domains check <domain> --project <id>
60
+ run402 domains check <domain> --project <project_id>
61
61
  `,
62
62
  apply: `run402 domains apply — apply safe provider-managed changes
63
63
 
64
64
  Usage:
65
- run402 domains apply <domain> --project <id> [--authority auto|provider-connect|delegated-subdomain|hosted-zone]
65
+ run402 domains apply <domain> --project <project_id> [--authority auto|provider-connect|delegated-subdomain|hosted-zone]
66
66
  `,
67
67
  repair: `run402 domains repair — repair Run402-owned domain infrastructure
68
68
 
69
69
  Usage:
70
- run402 domains repair <domain> --project <id>
70
+ run402 domains repair <domain> --project <project_id>
71
71
  `,
72
72
  "test-receive": `run402 domains test-receive — create an inbound receive test token
73
73
 
74
74
  Usage:
75
- run402 domains test-receive <domain> --project <id> --to <local-part|address>
75
+ run402 domains test-receive <domain> --project <project_id> --to <local-part|address>
76
76
  `,
77
77
  wait: `run402 domains wait — poll until a ProjectDomain is ready
78
78
 
79
79
  Usage:
80
- run402 domains wait <domain> --project <id> [--until active|safe|receive-active] [--timeout-ms <n>] [--interval-ms <n>]
80
+ run402 domains wait <domain> --project <project_id> [--until active|safe|receive-active] [--timeout-ms <n>] [--interval-ms <n>]
81
81
  `,
82
82
  activate: `run402 domains activate — activate custom mailbox addresses
83
83
 
84
84
  Usage:
85
- run402 domains activate <domain> --project <id>
85
+ run402 domains activate <domain> --project <project_id>
86
86
  `,
87
87
  disconnect: `run402 domains disconnect — disconnect a ProjectDomain
88
88
 
89
89
  Usage:
90
- run402 domains disconnect <domain> --project <id> --confirm
90
+ run402 domains disconnect <domain> --project <project_id> --confirm
91
91
  `,
92
92
  };
93
93
 
@@ -300,14 +300,14 @@ async function connect(args) {
300
300
  ], CONNECT_VALUE_FLAGS);
301
301
  const rest = positionalArgs(parsed, CONNECT_VALUE_FLAGS);
302
302
  const domain = rest[0];
303
- if (!domain) fail({ code: "BAD_USAGE", message: "Missing <domain>.", hint: "run402 domains connect <domain> --project <id> --web" });
303
+ if (!domain) fail({ code: "BAD_USAGE", message: "Missing <domain>.", hint: "run402 domains connect <domain> --project <project_id> --web" });
304
304
  if (rest.length > 1) fail({ code: "BAD_USAGE", message: `Unexpected argument for domains connect: ${rest[1]}` });
305
305
  if (parsed.includes("--create-mailboxes") && parsed.includes("--no-create-mailboxes")) {
306
306
  fail({ code: "BAD_FLAG", message: "Choose only one of --create-mailboxes or --no-create-mailboxes." });
307
307
  }
308
308
  const projectId = resolveProjectId(flagValue(parsed, "--project"));
309
309
  try {
310
- const result = await getSdk().domains.ensure(projectId, domain, { desired: desiredFromConnectFlags(domain, parsed) });
310
+ const result = await getSdk().domains.connect(projectId, { domain, desired: desiredFromConnectFlags(domain, parsed) });
311
311
  print(result);
312
312
  printHandoff(result);
313
313
  } catch (err) {
@@ -328,7 +328,7 @@ async function list(args) {
328
328
  async function status(args) {
329
329
  const { projectId, rest } = parseCommon(args);
330
330
  const domain = rest[0];
331
- if (!domain) fail({ code: "BAD_USAGE", message: "Missing <domain>.", hint: "run402 domains status <domain> [--project <id>]" });
331
+ if (!domain) fail({ code: "BAD_USAGE", message: "Missing <domain>.", hint: "run402 domains status <domain> [--project <project_id>]" });
332
332
  if (rest.length > 1) fail({ code: "BAD_USAGE", message: `Unexpected argument for domains status: ${rest[1]}` });
333
333
  try {
334
334
  print(await getSdk().domains.get(projectId, domain));
@@ -366,7 +366,7 @@ async function action(name, args) {
366
366
  assertKnownFlags(parsed, [...valueFlags, "--help", "-h"], valueFlags);
367
367
  const rest = positionalArgs(parsed, valueFlags);
368
368
  const domain = rest[0];
369
- if (!domain) fail({ code: "BAD_USAGE", message: `Missing <domain>.`, hint: `run402 domains ${name} <domain> [--project <id>]` });
369
+ if (!domain) fail({ code: "BAD_USAGE", message: `Missing <domain>.`, hint: `run402 domains ${name} <domain> [--project <project_id>]` });
370
370
  if (rest.length > 1) fail({ code: "BAD_USAGE", message: `Unexpected argument for domains ${name}: ${rest[1]}` });
371
371
  const projectId = resolveProjectId(flagValue(parsed, "--project"));
372
372
  try {
@@ -398,7 +398,7 @@ async function disconnect(args) {
398
398
  assertKnownFlags(parsed, [...valueFlags, "--confirm", "--help", "-h"], valueFlags);
399
399
  const rest = positionalArgs(parsed, valueFlags);
400
400
  const domain = rest[0];
401
- if (!domain) fail({ code: "BAD_USAGE", message: "Missing <domain>.", hint: "run402 domains disconnect <domain> --confirm [--project <id>]" });
401
+ if (!domain) fail({ code: "BAD_USAGE", message: "Missing <domain>.", hint: "run402 domains disconnect <domain> --confirm [--project <project_id>]" });
402
402
  if (!parsed.includes("--confirm")) {
403
403
  fail({
404
404
  code: "CONFIRMATION_REQUIRED",