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/functions.mjs CHANGED
@@ -31,7 +31,7 @@ export function parseLogSinceFlag(since) {
31
31
  return new Date(ms).toISOString();
32
32
  }
33
33
 
34
- /** `--request-id <id>` must be a req_ / fnrun_ / fnatt_ correlation id. */
34
+ /** `--request-id <request_id>` must be a req_ / fnrun_ / fnatt_ correlation id. */
35
35
  export function assertLogRequestIdFlag(requestId) {
36
36
  if (requestId !== undefined && !FUNCTION_LOG_REQUEST_ID_RE.test(requestId)) {
37
37
  fail({
@@ -77,29 +77,29 @@ Usage:
77
77
  run402 functions <subcommand> [args...]
78
78
 
79
79
  Subcommands:
80
- deploy <name> --file <file> [--project <id>] [--timeout <s>] [--memory <mb>] [--deps <pkg,...>] [--schedule <cron>]
80
+ deploy <name> --file <file> [--project <project_id>] [--timeout <s>] [--memory <mb>] [--deps <pkg,...>] [--schedule <cron>]
81
81
  Deploy a function to a project
82
- invoke <name> [--project <id>] [--method <M>] [--body <json> | --body-file <path>] [--idempotency-key <key>] [--wait] [--timeout-ms <ms>] [--poll-interval-ms <ms>] [--raw]
82
+ invoke <name> [--project <project_id>] [--method <M>] [--body <json> | --body-file <path>] [--idempotency-key <key>] [--wait] [--timeout-ms <ms>] [--poll-interval-ms <ms>] [--raw]
83
83
  Invoke a deployed function. Default
84
84
  wraps the SDK result as JSON on stdout.
85
85
  --raw prints the response body verbatim
86
86
  (string body → text + newline, JSON
87
87
  body → pretty-printed JSON).
88
- logs [<name>] [--project <id>] [--tail <n>] [--since <ts>] [--request-id <id>] [--app|--platform|--all] [--follow]
88
+ logs [<name>] [--project <project_id>] [--tail <n>] [--since <ts>] [--request-id <request_id>] [--app|--platform|--all] [--follow]
89
89
  Get function logs (app output by default;
90
90
  omit <name> with --request-id to search
91
91
  every function)
92
92
  runs <action> ... Create, inspect, cancel, redrive, and
93
93
  wait for durable function runs
94
- update <name> [--project <id>] [--schedule <cron>] [--schedule-remove] [--timeout <s>] [--memory <mb>]
94
+ update <name> [--project <project_id>] [--schedule <cron>] [--schedule-remove] [--timeout <s>] [--memory <mb>]
95
95
  Update function schedule or config without re-deploying
96
- rebuild [<name>] [--all] [--project <id>]
96
+ rebuild [<name>] [--all] [--project <project_id>]
97
97
  Refresh function(s) onto the current platform
98
98
  runtime (re-bundles from stored source; no
99
99
  source change). Pass <name> for one function
100
100
  or --all for every function in the project.
101
- list [--project <id>] List all functions for a project
102
- delete <name> [--project <id>] Delete a function
101
+ list [--project <project_id>] List all functions for a project
102
+ delete <name> [--project <project_id>] Delete a function
103
103
 
104
104
  Legacy (still supported): a leading prj_... positional selects the project,
105
105
  e.g. run402 functions deploy prj_abc123 stripe-webhook --file handler.ts
@@ -138,7 +138,7 @@ const SUB_HELP = {
138
138
  deploy: `run402 functions deploy — Deploy a function to a project
139
139
 
140
140
  Usage:
141
- run402 functions deploy <name> --file <file> [--project <id>] [options]
141
+ run402 functions deploy <name> --file <file> [--project <project_id>] [options]
142
142
 
143
143
  Legacy (still supported):
144
144
  run402 functions deploy <project_id> <name> --file <file> [options]
@@ -147,7 +147,7 @@ Arguments:
147
147
  <name> Function name (used in the invoke URL path)
148
148
 
149
149
  Options:
150
- --project <id> Target project ID (defaults to the active project)
150
+ --project <project_id> Target project ID (defaults to the active project)
151
151
  --file <file> Required: path to the function source file
152
152
  --timeout <s> Runtime timeout in seconds
153
153
  --memory <mb> Memory in MB
@@ -183,7 +183,7 @@ Examples:
183
183
  invoke: `run402 functions invoke — Invoke a deployed function
184
184
 
185
185
  Usage:
186
- run402 functions invoke <name> [--project <id>] [options]
186
+ run402 functions invoke <name> [--project <project_id>] [options]
187
187
 
188
188
  Legacy (still supported):
189
189
  run402 functions invoke <project_id> <name> [options]
@@ -192,7 +192,7 @@ Arguments:
192
192
  <name> Function name
193
193
 
194
194
  Options:
195
- --project <id> Target project ID (defaults to the active project)
195
+ --project <project_id> Target project ID (defaults to the active project)
196
196
  --method <M> HTTP method (default POST)
197
197
  --body <json> Inline JSON request body (ignored for GET/HEAD). The CLI
198
198
  validates it before sending; shell-corrupted JSON fails.
@@ -232,8 +232,8 @@ Examples:
232
232
  logs: `run402 functions logs — Fetch or tail function logs
233
233
 
234
234
  Usage:
235
- run402 functions logs <name> [--project <id>] [options]
236
- run402 functions logs --request-id <id> [--project <id>] [options]
235
+ run402 functions logs <name> [--project <project_id>] [options]
236
+ run402 functions logs --request-id <request_id> [--project <project_id>] [options]
237
237
 
238
238
  Legacy (still supported):
239
239
  run402 functions logs <project_id> <name> [options]
@@ -244,11 +244,11 @@ Arguments:
244
244
  and each entry carries its "function".
245
245
 
246
246
  Options:
247
- --project <id> Target project ID (defaults to the active project)
247
+ --project <project_id> Target project ID (defaults to the active project)
248
248
  --tail <n> Number of most-recent entries (default 50, max 1000).
249
249
  Bounds the read BEFORE the origin filter below.
250
250
  --since <ts> ISO timestamp or epoch ms; only entries after this
251
- --request-id <id> Only entries correlated to this req_ (the
251
+ --request-id <request_id> Only entries correlated to this req_ (the
252
252
  x-run402-request-id response header), fnrun_, or fnatt_ id
253
253
  --app Only the function's own output (default). Lambda runtime
254
254
  lines (INIT_START, START/END/REPORT RequestId, billed
@@ -274,12 +274,12 @@ Examples:
274
274
  runs: `run402 functions runs — Manage durable function runs
275
275
 
276
276
  Usage:
277
- run402 functions runs create <function_name> --event-type <type> --idempotency-key <key> [--project <id>] [options]
278
- run402 functions runs list <function_name> [--project <id>] [options]
279
- run402 functions runs get <run_id> [--project <id>]
280
- run402 functions runs logs <run_id> [--project <id>] [--tail <n>] [--since <ts>]
281
- run402 functions runs cancel <run_id> [--project <id>]
282
- run402 functions runs redrive <run_id> [--project <id>] [options]
277
+ run402 functions runs create <function_name> --event-type <type> --idempotency-key <key> [--project <project_id>] [options]
278
+ run402 functions runs list <function_name> [--project <project_id>] [options]
279
+ run402 functions runs get <run_id> [--project <project_id>]
280
+ run402 functions runs logs <run_id> [--project <project_id>] [--tail <n>] [--since <ts>]
281
+ run402 functions runs cancel <run_id> [--project <project_id>]
282
+ run402 functions runs redrive <run_id> [--project <project_id>] [options]
283
283
 
284
284
  Legacy (still supported): a leading prj_... positional selects the project,
285
285
  e.g. run402 functions runs get <project_id> <run_id>
@@ -313,7 +313,7 @@ Examples:
313
313
  update: `run402 functions update — Update function config without re-deploying
314
314
 
315
315
  Usage:
316
- run402 functions update <name> [--project <id>] [options]
316
+ run402 functions update <name> [--project <project_id>] [options]
317
317
 
318
318
  Legacy (still supported):
319
319
  run402 functions update <project_id> <name> [options]
@@ -322,7 +322,7 @@ Arguments:
322
322
  <name> Function name
323
323
 
324
324
  Options:
325
- --project <id> Target project ID (defaults to the active project)
325
+ --project <project_id> Target project ID (defaults to the active project)
326
326
  --schedule <cron> New cron schedule (pass '' to clear)
327
327
  --schedule-remove Explicitly remove the schedule
328
328
  --timeout <s> Runtime timeout in seconds
@@ -339,8 +339,8 @@ Examples:
339
339
  rebuild: `run402 functions rebuild — Refresh function(s) onto the current platform runtime
340
340
 
341
341
  Usage:
342
- run402 functions rebuild <name> [--project <id>]
343
- run402 functions rebuild --all [--project <id>]
342
+ run402 functions rebuild <name> [--project <project_id>]
343
+ run402 functions rebuild --all [--project <project_id>]
344
344
 
345
345
  Legacy (still supported):
346
346
  run402 functions rebuild <project_id> <name>
@@ -350,7 +350,7 @@ Arguments:
350
350
  <name> Function name to rebuild (omit when using --all)
351
351
 
352
352
  Options:
353
- --project <id> Target project ID (defaults to the active project)
353
+ --project <project_id> Target project ID (defaults to the active project)
354
354
  --all Rebuild every function in the project
355
355
 
356
356
  What it does:
@@ -382,13 +382,13 @@ Examples:
382
382
  list: `run402 functions list — List all functions for a project
383
383
 
384
384
  Usage:
385
- run402 functions list [--project <id>]
385
+ run402 functions list [--project <project_id>]
386
386
 
387
387
  Legacy (still supported):
388
388
  run402 functions list <project_id>
389
389
 
390
390
  Options:
391
- --project <id> Target project ID (defaults to the active project)
391
+ --project <project_id> Target project ID (defaults to the active project)
392
392
 
393
393
  Examples:
394
394
  run402 functions list --project prj_abc123
@@ -396,7 +396,7 @@ Examples:
396
396
  delete: `run402 functions delete — Delete a function from a project
397
397
 
398
398
  Usage:
399
- run402 functions delete <name> [--project <id>]
399
+ run402 functions delete <name> [--project <project_id>]
400
400
 
401
401
  Legacy (still supported):
402
402
  run402 functions delete <project_id> <name>
@@ -405,7 +405,7 @@ Arguments:
405
405
  <name> Function name to delete
406
406
 
407
407
  Options:
408
- --project <id> Target project ID (defaults to the active project)
408
+ --project <project_id> Target project ID (defaults to the active project)
409
409
 
410
410
  Examples:
411
411
  run402 functions delete stripe-webhook --project prj_abc123
@@ -532,7 +532,7 @@ function validateInvokeJsonBody(value, source, projectId, name) {
532
532
  }
533
533
 
534
534
  async function logs(projectId, name, args) {
535
- const usage = "run402 functions logs <name> [--project <id>] [--tail <n>] [--since <ts>] [--request-id <id>] [--app|--platform|--all] [--follow] | run402 functions logs --request-id <id> [--project <id>]";
535
+ const usage = "run402 functions logs <name> [--project <project_id>] [--tail <n>] [--since <ts>] [--request-id <request_id>] [--app|--platform|--all] [--follow] | run402 functions logs --request-id <request_id> [--project <project_id>]";
536
536
  assertRequiredProject(projectId, usage);
537
537
  assertKnownFlags(
538
538
  args,
@@ -921,7 +921,7 @@ async function update(projectId, name, args) {
921
921
 
922
922
  const UNLOCKED_DEPS_HINT =
923
923
  "Function was deployed before dependency locking — redeploy from source " +
924
- "(run402 functions deploy <id> <name> --file <file>) to refresh its runtime instead.";
924
+ "(run402 functions deploy <project_id> <name> --file <file>) to refresh its runtime instead.";
925
925
 
926
926
  // Annotate a `rebuild --all` batch with an actionable hint on per-function
927
927
  // CANNOT_REBUILD_UNLOCKED_DEPS refusals. The batch endpoint returns 200 with
@@ -1031,7 +1031,7 @@ export async function run(sub, args) {
1031
1031
  console.log(SUB_HELP[sub] || HELP);
1032
1032
  process.exit(0);
1033
1033
  }
1034
- // Project selection (CLI-wide convention): `--project <id>` wins, else a
1034
+ // Project selection (CLI-wide convention): `--project <project_id>` wins, else a
1035
1035
  // legacy leading `prj_...` positional, else the active project. Computed
1036
1036
  // lazily so unknown subcommands never trip project resolution.
1037
1037
  const select = () => resolveProjectSelector(args);
@@ -4,7 +4,7 @@
4
4
  * Holds the WARM things — the loaded session module (whose top-level await
5
5
  * pulls the whole SDK graph), the owned dispatcher's live h2 connection,
6
6
  * signer precomputation, the paid stack — and re-reads the SMALL things
7
- * (keystore, pins, wallet binding, allowance, env-derived config) fresh per
7
+ * (keystore, pins, wallet binding, wallet, env-derived config) fresh per
8
8
  * forwarded session, so no cache-invalidation class exists (D2).
9
9
  *
10
10
  * SINGLE-SESSION BY DESIGN (D6 as applied): a session is {cwd, env}
@@ -33,7 +33,7 @@ import { resolveOwningOrgId } from "./org-context.mjs";
33
33
  * @param {string} [options.orgId] Explicit owning org. Resolved via `resolveOwningOrgId` when omitted.
34
34
  * @param {boolean} [options.createRepoIfMissing] Opt into `git init`-ing `repoDir` when it is not a repository yet.
35
35
  * @param {boolean} [options.nested] Scaffold `repoDir` as its OWN repository even when it lies inside another one (`Gitvault.scaffoldRemote`'s `nested`).
36
- * @param {string} [options.nestedCommand] The caller's own `--nested` spelling for the `create_nested_repo` next_action (default: the SDK's `run402 repos create --nested --project <id>`).
36
+ * @param {string} [options.nestedCommand] The caller's own `--nested` spelling for the `create_nested_repo` next_action (default: the SDK's `run402 repos create --nested --project <project_id>`).
37
37
  * @returns {Promise<{status: "scaffolded"|"skipped"|"error", reason?: string, toplevel?: string|null, next_actions?: object[], gitvault: object|null, gitvault_skipped?: string, gitvault_error?: {code: string, message: string}}>}
38
38
  */
39
39
  export async function scaffoldGitvaultRemote({ repoDir = process.cwd(), projectId, orgId, createRepoIfMissing = false, nested = false, nestedCommand } = {}) {
@@ -74,7 +74,7 @@ export async function scaffoldGitvaultRemote({ repoDir = process.cwd(), projectI
74
74
  }
75
75
  // `allocated: false` is stated, not left to be inferred: this is local
76
76
  // git only — no vault exists for the project yet (allocation happens
77
- // lazily on first push, or explicitly via `run402 repos create --project <id>`).
77
+ // lazily on first push, or explicitly via `run402 repos create --project <project_id>`).
78
78
  out.status = "scaffolded";
79
79
  out.gitvault = { ...remote, allocated: false };
80
80
  } catch (err) {
package/lib/gitvault.mjs CHANGED
@@ -30,7 +30,7 @@ one answers a structured COMMAND_MOVED/COMMAND_REMOVED error for exactly one
30
30
  release; after that the spelling is reserved and answers nothing at all.
31
31
 
32
32
  Moved:
33
- gitvault init -> repos create --project <id> (or repos create <name> for a NEW project)
33
+ gitvault init -> repos create --project <project_id> (or repos create <name> for a NEW project)
34
34
  gitvault status -> repos view
35
35
  gitvault snapshot -> repos snapshot
36
36
  gitvault policy -> repos policy
@@ -49,7 +49,7 @@ Run \`run402 repos --help\` for the current surface.
49
49
 
50
50
  /** Renamed verbs: `gitvault <key>` -> the exact `repos` command that means the same thing now. */
51
51
  const MOVED = {
52
- init: { command: "run402 repos create --project <id>", why: "repos create absorbs allocation — pass --project to adopt an existing project, or a name to provision a new one." },
52
+ init: { command: "run402 repos create --project <project_id>", why: "repos create absorbs allocation — pass --project to adopt an existing project, or a name to provision a new one." },
53
53
  status: { command: "run402 repos view", why: "repos view is the side-effect-free repo inspection command; it never materializes refs the way status --refs used to." },
54
54
  snapshot: { command: "run402 repos snapshot", why: "same verb, new noun." },
55
55
  policy: { command: "run402 repos policy", why: "same verb, new noun." },
package/lib/grants.mjs CHANGED
@@ -15,9 +15,9 @@ Usage:
15
15
  run402 grants <subcommand> [args...]
16
16
 
17
17
  Subcommands:
18
- create <wallet> --capability <cap> [--project <id>] [--policy <json>] [--expires <iso8601>]
18
+ create <wallet> --capability <cap> [--project <project_id>] [--policy <json>] [--expires <iso8601>]
19
19
  Issue a capability grant (owner of the project's org)
20
- revoke <grant_id> [--project <id>]
20
+ revoke <grant_id> [--project <project_id>]
21
21
  Revoke a capability grant
22
22
 
23
23
  Legacy (still supported):
@@ -40,7 +40,7 @@ const SUB_HELP = {
40
40
  create: `run402 grants create — issue a per-project capability grant
41
41
 
42
42
  Usage:
43
- run402 grants create <wallet> --capability <cap> [--project <id>] [--policy <json>] [--expires <iso8601>]
43
+ run402 grants create <wallet> --capability <cap> [--project <project_id>] [--policy <json>] [--expires <iso8601>]
44
44
 
45
45
  Legacy (still supported):
46
46
  run402 grants create <project_id> <wallet> <capability> [options]
@@ -49,7 +49,7 @@ Arguments:
49
49
  <wallet> EVM address or named wallet the grant is issued to
50
50
 
51
51
  Options:
52
- --project <id> Project to grant access to (defaults to the active project)
52
+ --project <project_id> Project to grant access to (defaults to the active project)
53
53
  --capability <cap> e.g. deploy, functions:write (alternative to the legacy positional)
54
54
  --policy <json> Capability-scoping policy object (gateway-interpreted)
55
55
  --expires <iso8601> Expiry timestamp; omit for a non-expiring grant
@@ -59,7 +59,7 @@ Requires you to be an owner of the project's org.
59
59
  revoke: `run402 grants revoke — revoke a per-project capability grant
60
60
 
61
61
  Usage:
62
- run402 grants revoke <grant_id> [--project <id>]
62
+ run402 grants revoke <grant_id> [--project <project_id>]
63
63
 
64
64
  Legacy (still supported):
65
65
  run402 grants revoke <project_id> <grant_id>
@@ -81,7 +81,7 @@ async function create(args) {
81
81
  const pos = requirePositionalCount(rest, CREATE_VALUE_FLAGS, {
82
82
  min: expected,
83
83
  max: expected,
84
- command: "run402 grants create <wallet> --capability <cap> [--project <id>] [--policy <json>] [--expires <iso8601>]",
84
+ command: "run402 grants create <wallet> --capability <cap> [--project <project_id>] [--policy <json>] [--expires <iso8601>]",
85
85
  missing: capabilityFlag ? "Missing <wallet>." : "Missing <wallet> and/or <capability>.",
86
86
  });
87
87
  const wallet = pos[0];
@@ -107,7 +107,7 @@ async function revoke(args) {
107
107
  const [grantId] = requirePositionalCount(rest, ["--project"], {
108
108
  min: 1,
109
109
  max: 1,
110
- command: "run402 grants revoke <grant_id> [--project <id>]",
110
+ command: "run402 grants revoke <grant_id> [--project <project_id>]",
111
111
  missing: "Missing <grant_id>.",
112
112
  });
113
113
  try {
package/lib/image.mjs CHANGED
@@ -17,7 +17,7 @@ Options:
17
17
  --org <org_id> The paying organization when the wallet belongs to more
18
18
  than one (Lightning rail); x402 ignores it. Omitted, it
19
19
  is the current org (RUN402_ORG, the .run402.json binding,
20
- run402 org use, or the active project's owning org)
20
+ run402 orgs use, or the active project's owning org)
21
21
  --help, -h Show this help message
22
22
 
23
23
  Examples:
@@ -29,9 +29,9 @@ Output (without --output):
29
29
  { "aspect": "square", "content_type": "image/png", "image": "<base64>" }
30
30
 
31
31
  Notes:
32
- - Requires a funded allowance (run402 allowance create && run402 allowance fund)
32
+ - Requires a funded wallet (run402 init && run402 wallets fund)
33
33
  - Payments are processed automatically via x402 micropayments (USDC on the
34
- network your allowance targets — Base Sepolia on the prototype tier, Base
34
+ network your wallet targets — Base Sepolia on the prototype tier, Base
35
35
  mainnet on paid tiers) or over Lightning from a rail: lightning wallet
36
36
  - Use --output to save directly to a file instead of printing base64
37
37
  `;
@@ -53,10 +53,10 @@ Options:
53
53
  --org <org_id> The paying organization when the wallet belongs to more
54
54
  than one (Lightning rail); x402 ignores it. Omitted, it
55
55
  is the current org (RUN402_ORG, the .run402.json binding,
56
- run402 org use, or the active project's owning org)
56
+ run402 orgs use, or the active project's owning org)
57
57
 
58
58
  Notes:
59
- - Requires a funded allowance (run402 allowance create && run402 allowance fund)
59
+ - Requires a funded wallet (run402 init && run402 wallets fund)
60
60
  - Payments are processed automatically via x402 micropayments, or over
61
61
  Lightning from a rail: lightning wallet
62
62
  - Use --output to save directly to a file instead of printing base64
@@ -112,7 +112,7 @@ export async function run(sub, args) {
112
112
 
113
113
  // The paying organization rides the ONE shared org chain (--org, then
114
114
  // RUN402_ORG / RUN402_ROOM / RUN402_PROJECT_ID, then the .run402.json
115
- // binding, then `org use` / the active project's owning org). Only the
115
+ // binding, then `orgs use` / the active project's owning org). Only the
116
116
  // Lightning rail reads it — a multi-org principal is refused
117
117
  // ORGANIZATION_SELECTION_REQUIRED without one — and x402 ignores it, so
118
118
  // resolving it is never a reason to refuse an x402 purchase: `optional`
@@ -150,12 +150,12 @@ function reportOrgSelectionError(err, org) {
150
150
  code,
151
151
  message: err.message,
152
152
  hint:
153
- `Pass --org <org_id> (one of: ${ids.join(", ") || "run402 org list"}) or select a current organization with ` +
154
- "run402 org use <org_id>. Only the Lightning rail needs it; x402 ignores it.",
153
+ `Pass --org <org_id> (one of: ${ids.join(", ") || "run402 orgs list"}) or select a current organization with ` +
154
+ "run402 orgs use <org_id>. Only the Lightning rail needs it; x402 ignores it.",
155
155
  details: { ...details, organization_ids: ids, org_source: org?.source ?? null, org_source_detail: org?.sourceDetail ?? null },
156
156
  next_actions: err.nextActions ?? [
157
157
  nextAction("edit_request", { command: 'run402 image generate "<prompt>" --org <org_id>', why: "Name the paying organization on this call." }),
158
- nextAction("edit_request", { command: "run402 org use <org_id>", why: "Select a current organization for this profile." }),
158
+ nextAction("edit_request", { command: "run402 orgs use <org_id>", why: "Select a current organization for this profile." }),
159
159
  ],
160
160
  });
161
161
  }
@@ -165,7 +165,7 @@ function reportOrgSelectionError(err, org) {
165
165
  message: err.message,
166
166
  hint:
167
167
  `The paying organization ${org.orgId} came from ${org.sourceDetail} (${org.source}) and this principal holds no billing role there. ` +
168
- "Pass --org <org_id> for an organization you can bill, or run: run402 org use <org_id>",
168
+ "Pass --org <org_id> for an organization you can bill, or run: run402 orgs use <org_id>",
169
169
  details: { ...details, org_source: org.source, org_source_detail: org.sourceDetail },
170
170
  next_actions: err.nextActions,
171
171
  });