run402 4.93.2 → 4.94.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (259) hide show
  1. package/README.md +43 -41
  2. package/cli.mjs +34 -29
  3. package/core-dist/config.js +52 -18
  4. package/core-dist/control-plane-session.js +31 -6
  5. package/core-dist/keystore.js +7 -7
  6. package/core-dist/profiles.js +9 -7
  7. package/core-dist/{allowance-auth.js → wallet-auth.js} +15 -15
  8. package/{sdk/core-dist/allowance.js → core-dist/wallet.js} +20 -20
  9. package/{sdk/core-dist/write-auth-session.js → core-dist/write-approvals.js} +19 -19
  10. package/gitvault-surface.json +1 -1
  11. package/lib/admin.mjs +1 -1
  12. package/lib/agent.mjs +20 -18
  13. package/lib/approve.mjs +81 -0
  14. package/lib/apps.mjs +3 -3
  15. package/lib/assets.mjs +2 -2
  16. package/lib/billing.mjs +6 -6
  17. package/lib/buzz-doctor.mjs +1 -1
  18. package/lib/buzz-notifications.mjs +1 -1
  19. package/lib/buzz.mjs +1 -1
  20. package/lib/buzz.test.mjs +1 -1
  21. package/lib/ci.mjs +4 -4
  22. package/lib/cold-start.mjs +21 -21
  23. package/lib/command-manifest.mjs +20 -34
  24. package/lib/config.mjs +24 -24
  25. package/lib/contacts.mjs +13 -13
  26. package/lib/contracts.mjs +1 -1
  27. package/lib/credentials.mjs +2 -2
  28. package/lib/daemon-path.mjs +1 -1
  29. package/lib/delegates.mjs +1 -1
  30. package/lib/deliveries.mjs +4 -4
  31. package/lib/deploy-rehearse-discovery.test.mjs +7 -7
  32. package/lib/deploy-v2.mjs +232 -184
  33. package/lib/deploy.mjs +21 -53
  34. package/lib/doctor-source-scan.mjs +1 -1
  35. package/lib/doctor.mjs +57 -57
  36. package/lib/escalations.mjs +1 -1
  37. package/lib/feedback.mjs +10 -10
  38. package/lib/gitvault-daemon.mjs +1 -1
  39. package/lib/image.mjs +3 -3
  40. package/lib/init.mjs +66 -66
  41. package/lib/lightning-wallet.mjs +28 -28
  42. package/lib/login.mjs +207 -0
  43. package/lib/logout.mjs +53 -0
  44. package/lib/next-actions.mjs +15 -15
  45. package/lib/org.mjs +100 -13
  46. package/lib/pay.mjs +1 -1
  47. package/lib/projects.mjs +26 -29
  48. package/lib/redeem.mjs +7 -8
  49. package/lib/remote-helper-session.mjs +12 -12
  50. package/lib/repos.mjs +62 -62
  51. package/lib/rooms.mjs +103 -67
  52. package/lib/sdk-errors.mjs +9 -4
  53. package/lib/sdk.mjs +3 -3
  54. package/lib/service.mjs +5 -5
  55. package/lib/session-proofs.mjs +21 -0
  56. package/lib/sign-in.mjs +296 -0
  57. package/lib/sites.mjs +8 -8
  58. package/lib/stats.mjs +2 -2
  59. package/lib/status.mjs +25 -25
  60. package/lib/subdomains.mjs +19 -19
  61. package/lib/subscriptions.mjs +8 -8
  62. package/lib/tier.mjs +29 -22
  63. package/lib/transfer.mjs +58 -85
  64. package/lib/up.mjs +7 -7
  65. package/lib/wallet-context.mjs +3 -3
  66. package/lib/wallet-context.test.mjs +3 -3
  67. package/lib/wallets.mjs +196 -31
  68. package/lib/webhook-secret.mjs +6 -6
  69. package/lib/whoami.mjs +75 -0
  70. package/package.json +1 -1
  71. package/sdk/core-dist/config.js +52 -18
  72. package/sdk/core-dist/control-plane-session.js +31 -6
  73. package/sdk/core-dist/keystore.js +7 -7
  74. package/sdk/core-dist/profiles.js +9 -7
  75. package/sdk/core-dist/{allowance-auth.js → wallet-auth.js} +15 -15
  76. package/{core-dist/allowance.js → sdk/core-dist/wallet.js} +20 -20
  77. package/{core-dist/write-auth-session.js → sdk/core-dist/write-approvals.js} +19 -19
  78. package/sdk/dist/actions.d.ts +1 -1
  79. package/sdk/dist/actions.d.ts.map +1 -1
  80. package/sdk/dist/control-plane-credentials.d.ts +8 -8
  81. package/sdk/dist/control-plane-credentials.js +7 -7
  82. package/sdk/dist/credentials.d.ts +19 -19
  83. package/sdk/dist/credentials.d.ts.map +1 -1
  84. package/sdk/dist/credentials.js +1 -1
  85. package/sdk/dist/errors.d.ts +24 -26
  86. package/sdk/dist/errors.d.ts.map +1 -1
  87. package/sdk/dist/errors.js +34 -37
  88. package/sdk/dist/errors.js.map +1 -1
  89. package/sdk/dist/index.d.ts +29 -16
  90. package/sdk/dist/index.d.ts.map +1 -1
  91. package/sdk/dist/index.js +29 -16
  92. package/sdk/dist/index.js.map +1 -1
  93. package/sdk/dist/kernel.d.ts +1 -1
  94. package/sdk/dist/kernel.d.ts.map +1 -1
  95. package/sdk/dist/kernel.js +10 -9
  96. package/sdk/dist/kernel.js.map +1 -1
  97. package/sdk/dist/namespaces/admin.d.ts +51 -120
  98. package/sdk/dist/namespaces/admin.d.ts.map +1 -1
  99. package/sdk/dist/namespaces/admin.js +41 -45
  100. package/sdk/dist/namespaces/admin.js.map +1 -1
  101. package/sdk/dist/namespaces/agent.d.ts +2 -2
  102. package/sdk/dist/namespaces/agent.d.ts.map +1 -1
  103. package/sdk/dist/namespaces/agent.js +2 -2
  104. package/sdk/dist/namespaces/agent.js.map +1 -1
  105. package/sdk/dist/namespaces/ai.d.ts +1 -1
  106. package/sdk/dist/namespaces/ai.js +1 -1
  107. package/sdk/dist/namespaces/billing.d.ts +6 -3
  108. package/sdk/dist/namespaces/billing.d.ts.map +1 -1
  109. package/sdk/dist/namespaces/billing.js.map +1 -1
  110. package/sdk/dist/namespaces/buzz-notifications.types.d.ts +1 -1
  111. package/sdk/dist/namespaces/buzz.d.ts +2 -2
  112. package/sdk/dist/namespaces/buzz.d.ts.map +1 -1
  113. package/sdk/dist/namespaces/buzz.js +2 -2
  114. package/sdk/dist/namespaces/buzz.js.map +1 -1
  115. package/sdk/dist/namespaces/buzz.types.d.ts +2 -2
  116. package/sdk/dist/namespaces/buzz.types.d.ts.map +1 -1
  117. package/sdk/dist/namespaces/credentials.types.d.ts +1 -1
  118. package/sdk/dist/namespaces/deploy.d.ts +1 -1
  119. package/sdk/dist/namespaces/deploy.js +5 -5
  120. package/sdk/dist/namespaces/deploy.js.map +1 -1
  121. package/sdk/dist/namespaces/deploy.types.d.ts +4 -4
  122. package/sdk/dist/namespaces/escalations.d.ts +1 -1
  123. package/sdk/dist/namespaces/escalations.js +1 -1
  124. package/sdk/dist/namespaces/escalations.types.d.ts +2 -2
  125. package/sdk/dist/namespaces/escalations.types.d.ts.map +1 -1
  126. package/sdk/dist/namespaces/events.types.d.ts +1 -1
  127. package/sdk/dist/namespaces/functions.d.ts +1 -1
  128. package/sdk/dist/namespaces/functions.js +1 -1
  129. package/sdk/dist/namespaces/gitvault.crypto.d.ts +1 -1
  130. package/sdk/dist/namespaces/gitvault.d.ts +24 -24
  131. package/sdk/dist/namespaces/gitvault.d.ts.map +1 -1
  132. package/sdk/dist/namespaces/gitvault.js +109 -109
  133. package/sdk/dist/namespaces/gitvault.js.map +1 -1
  134. package/sdk/dist/namespaces/me.d.ts +120 -0
  135. package/sdk/dist/namespaces/me.d.ts.map +1 -0
  136. package/sdk/dist/namespaces/me.js +34 -0
  137. package/sdk/dist/namespaces/me.js.map +1 -0
  138. package/sdk/dist/namespaces/org.d.ts +108 -6
  139. package/sdk/dist/namespaces/org.d.ts.map +1 -1
  140. package/sdk/dist/namespaces/org.js +63 -7
  141. package/sdk/dist/namespaces/org.js.map +1 -1
  142. package/sdk/dist/namespaces/org.types.d.ts +29 -9
  143. package/sdk/dist/namespaces/org.types.d.ts.map +1 -1
  144. package/sdk/dist/namespaces/pay.js +3 -3
  145. package/sdk/dist/namespaces/pay.js.map +1 -1
  146. package/sdk/dist/namespaces/projects.d.ts +9 -9
  147. package/sdk/dist/namespaces/projects.js +15 -15
  148. package/sdk/dist/namespaces/projects.js.map +1 -1
  149. package/sdk/dist/namespaces/projects.types.d.ts +28 -12
  150. package/sdk/dist/namespaces/projects.types.d.ts.map +1 -1
  151. package/sdk/dist/namespaces/rooms.d.ts +7 -7
  152. package/sdk/dist/namespaces/rooms.js +17 -17
  153. package/sdk/dist/namespaces/rooms.js.map +1 -1
  154. package/sdk/dist/namespaces/rooms.types.d.ts +9 -9
  155. package/sdk/dist/namespaces/rooms.types.d.ts.map +1 -1
  156. package/sdk/dist/namespaces/service.d.ts +1 -1
  157. package/sdk/dist/namespaces/service.js +1 -1
  158. package/sdk/dist/namespaces/{operator-session.d.ts → session.d.ts} +135 -51
  159. package/sdk/dist/namespaces/session.d.ts.map +1 -0
  160. package/sdk/dist/namespaces/{operator-session.js → session.js} +118 -30
  161. package/sdk/dist/namespaces/session.js.map +1 -0
  162. package/sdk/dist/namespaces/subdomains.d.ts +5 -5
  163. package/sdk/dist/namespaces/subdomains.d.ts.map +1 -1
  164. package/sdk/dist/namespaces/subdomains.js +6 -6
  165. package/sdk/dist/namespaces/subdomains.js.map +1 -1
  166. package/sdk/dist/namespaces/tier.d.ts +43 -20
  167. package/sdk/dist/namespaces/tier.d.ts.map +1 -1
  168. package/sdk/dist/namespaces/tier.js +7 -7
  169. package/sdk/dist/namespaces/tier.js.map +1 -1
  170. package/sdk/dist/namespaces/transfers.d.ts +74 -71
  171. package/sdk/dist/namespaces/transfers.d.ts.map +1 -1
  172. package/sdk/dist/namespaces/transfers.js +31 -38
  173. package/sdk/dist/namespaces/transfers.js.map +1 -1
  174. package/sdk/dist/namespaces/vouchers.d.ts +9 -10
  175. package/sdk/dist/namespaces/vouchers.d.ts.map +1 -1
  176. package/sdk/dist/namespaces/vouchers.js +4 -5
  177. package/sdk/dist/namespaces/vouchers.js.map +1 -1
  178. package/sdk/dist/namespaces/wallets.d.ts +72 -3
  179. package/sdk/dist/namespaces/wallets.d.ts.map +1 -1
  180. package/sdk/dist/namespaces/wallets.js +141 -3
  181. package/sdk/dist/namespaces/wallets.js.map +1 -1
  182. package/sdk/dist/namespaces/write-approval.d.ts +101 -0
  183. package/sdk/dist/namespaces/write-approval.d.ts.map +1 -0
  184. package/sdk/dist/namespaces/write-approval.js +62 -0
  185. package/sdk/dist/namespaces/write-approval.js.map +1 -0
  186. package/sdk/dist/node/actions-node.d.ts +3 -3
  187. package/sdk/dist/node/actions-node.d.ts.map +1 -1
  188. package/sdk/dist/node/actions-node.js +36 -36
  189. package/sdk/dist/node/actions-node.js.map +1 -1
  190. package/sdk/dist/node/{bearer-claim-key.d.ts → bearer-redeem-key.d.ts} +12 -12
  191. package/sdk/dist/node/bearer-redeem-key.d.ts.map +1 -0
  192. package/sdk/dist/node/{bearer-claim-key.js → bearer-redeem-key.js} +21 -21
  193. package/sdk/dist/node/bearer-redeem-key.js.map +1 -0
  194. package/sdk/dist/node/ci.d.ts +1 -1
  195. package/sdk/dist/node/ci.d.ts.map +1 -1
  196. package/sdk/dist/node/ci.js +6 -6
  197. package/sdk/dist/node/ci.js.map +1 -1
  198. package/sdk/dist/node/credentials.d.ts +17 -16
  199. package/sdk/dist/node/credentials.d.ts.map +1 -1
  200. package/sdk/dist/node/credentials.js +28 -27
  201. package/sdk/dist/node/credentials.js.map +1 -1
  202. package/sdk/dist/node/funding-recovery.d.ts +1 -1
  203. package/sdk/dist/node/funding-recovery.d.ts.map +1 -1
  204. package/sdk/dist/node/funding-recovery.js +1 -1
  205. package/sdk/dist/node/funding-recovery.js.map +1 -1
  206. package/sdk/dist/node/gitvault-apply.d.ts +1 -1
  207. package/sdk/dist/node/gitvault-apply.d.ts.map +1 -1
  208. package/sdk/dist/node/gitvault-handoff.d.ts +22 -22
  209. package/sdk/dist/node/gitvault-handoff.d.ts.map +1 -1
  210. package/sdk/dist/node/gitvault-handoff.js +45 -45
  211. package/sdk/dist/node/gitvault-handoff.js.map +1 -1
  212. package/sdk/dist/node/gitvault-prewarm.js +7 -7
  213. package/sdk/dist/node/gitvault-prewarm.js.map +1 -1
  214. package/sdk/dist/node/gitvault-restore.d.ts +1 -1
  215. package/sdk/dist/node/gitvault-restore.js +1 -1
  216. package/sdk/dist/node/index.d.ts +16 -16
  217. package/sdk/dist/node/index.d.ts.map +1 -1
  218. package/sdk/dist/node/index.js +15 -15
  219. package/sdk/dist/node/index.js.map +1 -1
  220. package/sdk/dist/node/org-adopt.d.ts +49 -0
  221. package/sdk/dist/node/org-adopt.d.ts.map +1 -0
  222. package/sdk/dist/node/org-adopt.js +77 -0
  223. package/sdk/dist/node/org-adopt.js.map +1 -0
  224. package/sdk/dist/node/paid-fetch.d.ts +7 -7
  225. package/sdk/dist/node/paid-fetch.d.ts.map +1 -1
  226. package/sdk/dist/node/paid-fetch.js +54 -54
  227. package/sdk/dist/node/paid-fetch.js.map +1 -1
  228. package/sdk/dist/node/preflight.d.ts +1 -1
  229. package/sdk/dist/node/preflight.d.ts.map +1 -1
  230. package/sdk/dist/node/preflight.js +1 -1
  231. package/sdk/dist/node/preflight.js.map +1 -1
  232. package/sdk/dist/node/source-scan.d.ts +1 -1
  233. package/sdk/dist/node/source-scan.js +2 -2
  234. package/sdk/dist/node/source-scan.js.map +1 -1
  235. package/sdk/dist/scoped.d.ts +3 -3
  236. package/sdk/dist/scoped.d.ts.map +1 -1
  237. package/sdk/dist/scoped.js +2 -2
  238. package/sdk/dist/scoped.js.map +1 -1
  239. package/core-dist/operator-session.js +0 -154
  240. package/lib/allowance.mjs +0 -355
  241. package/lib/operator-proofs.mjs +0 -22
  242. package/lib/operator.mjs +0 -771
  243. package/sdk/core-dist/operator-session.js +0 -154
  244. package/sdk/dist/namespaces/allowance.d.ts +0 -79
  245. package/sdk/dist/namespaces/allowance.d.ts.map +0 -1
  246. package/sdk/dist/namespaces/allowance.js +0 -149
  247. package/sdk/dist/namespaces/allowance.js.map +0 -1
  248. package/sdk/dist/namespaces/operator-session.d.ts.map +0 -1
  249. package/sdk/dist/namespaces/operator-session.js.map +0 -1
  250. package/sdk/dist/namespaces/operator.d.ts +0 -359
  251. package/sdk/dist/namespaces/operator.d.ts.map +0 -1
  252. package/sdk/dist/namespaces/operator.js +0 -272
  253. package/sdk/dist/namespaces/operator.js.map +0 -1
  254. package/sdk/dist/node/bearer-claim-key.d.ts.map +0 -1
  255. package/sdk/dist/node/bearer-claim-key.js.map +0 -1
  256. package/sdk/dist/node/operator-claim.d.ts +0 -49
  257. package/sdk/dist/node/operator-claim.d.ts.map +0 -1
  258. package/sdk/dist/node/operator-claim.js +0 -77
  259. package/sdk/dist/node/operator-claim.js.map +0 -1
package/lib/buzz.test.mjs CHANGED
@@ -84,7 +84,7 @@ describe("run402 buzz CLI", () => {
84
84
  return {
85
85
  buzz_human_adoption_offer_id: `buzzhao_${"1".repeat(32)}`,
86
86
  status: "available",
87
- handoff_url: `https://console.run402.com/buzz/adoptions/buzzhao_${"1".repeat(32)}`,
87
+ offer_url: `https://console.run402.com/buzz/adoptions/buzzhao_${"1".repeat(32)}`,
88
88
  };
89
89
  },
90
90
  },
package/lib/ci.mjs CHANGED
@@ -34,7 +34,7 @@ Subcommands:
34
34
  `;
35
35
 
36
36
  const SUB_HELP = {
37
- link: `run402 ci link github — Link GitHub Actions OIDC for deploy apply
37
+ link: `run402 ci link github — Link GitHub Actions OIDC for run402 deploy
38
38
 
39
39
  Usage:
40
40
  run402 ci link github [--project <id>] [--manifest <path>] [--repo <owner/repo>] [--branch <name> | --environment <name>] [--repository-id <id>] [--workflow <path>] [--expires-at <iso>] [--route-scope <pattern> ...] [--force]
@@ -245,7 +245,7 @@ ${environmentLine} steps:
245
245
  - name: Deploy to run402
246
246
  # Redirect stdin from /dev/null: a CI runner's stdin is a FIFO/file that
247
247
  # older run402 CLIs counted as a second manifest source alongside --manifest.
248
- run: npx --yes run402@${RUN402_VERSION} deploy apply --manifest ${shellQuote(manifest)} --project ${shellQuote(projectId)} < /dev/null
248
+ run: npx --yes run402@${RUN402_VERSION} deploy --manifest ${shellQuote(manifest)} --project ${shellQuote(projectId)} < /dev/null
249
249
  `;
250
250
  }
251
251
 
@@ -328,8 +328,8 @@ async function linkGithub(args) {
328
328
  signedDelegation = signCiDelegation(values, { apiBase: API });
329
329
  } catch (err) {
330
330
  fail({
331
- code: "NO_ALLOWANCE",
332
- message: err?.message || "No local allowance configured.",
331
+ code: "NO_WALLET",
332
+ message: err?.message || "No local wallet configured.",
333
333
  hint: "Run: run402 init",
334
334
  });
335
335
  }
@@ -1,11 +1,11 @@
1
1
  /**
2
2
  * `cold-start.mjs` — the minimal x402/Base-Sepolia cold-start chain
3
- * (kygit-handoff design D5): allowance → faucet → one x402 prototype
3
+ * (kygit-handoff design D5): wallet → faucet → one x402 prototype
4
4
  * payment. `repos create` (and so `kygit create`) folds this in when it is
5
5
  * refused `NO_ACTIVE_TIER`, so `kygit create` on a genuinely fresh machine
6
6
  * ends with a vault, no human signup, no cloud dashboard.
7
7
  *
8
- * This is the SAME shape `run402 init` already walks (allowance create →
8
+ * This is the SAME shape `run402 init` already walks (create the wallet →
9
9
  * balance check → faucet → tier), factored down to the x402/Base-Sepolia
10
10
  * default rail only (MPP/Tempo is `init`'s own separate concern — an agent
11
11
  * hitting NO_ACTIVE_TIER mid-`repos create` gets the default rail, not a
@@ -15,7 +15,7 @@
15
15
  * create` needs when it discovers there is no tier and nothing else has
16
16
  * set one up yet.
17
17
  *
18
- * add-room-invite design D9 splits the funded-wallet half (allowance →
18
+ * add-room-invite design D9 splits the funded-wallet half (wallet →
19
19
  * faucet-if-empty → brief settlement poll) out as {@link ensureFundedWallet}
20
20
  * — `rooms join <key>` needs exactly that half, with NO tier purchase and NO
21
21
  * project creation (the claim itself is the one x402 payment that funds the
@@ -23,42 +23,42 @@
23
23
  * `ensureFundedWallet` followed by the tier step — so every EXISTING caller
24
24
  * (`repos create`/`resume`/`join`) is unchanged.
25
25
  */
26
- import { readAllowance, saveAllowance } from "./config.mjs";
26
+ import { readWallet, saveWallet } from "./config.mjs";
27
27
  import { getSdk } from "./sdk.mjs";
28
28
 
29
29
  const USDC_ABI = [{ name: "balanceOf", type: "function", stateMutability: "view", inputs: [{ name: "account", type: "address" }], outputs: [{ name: "", type: "uint256" }] }];
30
30
  const USDC_SEPOLIA = "0x036CbD53842c5426634e7929541eC2318f3dCF7e";
31
31
 
32
32
  /**
33
- * Allowance → faucet-if-empty → brief settlement poll. NO tier purchase, no
33
+ * Wallet → faucet-if-empty → brief settlement poll. NO tier purchase, no
34
34
  * project creation — the caller decides what (if anything) to pay for next.
35
35
  *
36
36
  * @param {(line: string) => void} announce Called once per step, so the
37
37
  * caller can print each one it took (client-surface spec: "announcing
38
38
  * each step").
39
- * @returns {Promise<{allowance_created: boolean, faucet_requested: boolean, address: string}>}
39
+ * @returns {Promise<{wallet_created: boolean, faucet_requested: boolean, address: string}>}
40
40
  */
41
41
  export async function ensureFundedWallet(announce = () => {}) {
42
- const out = { allowance_created: false, faucet_requested: false, address: "" };
42
+ const out = { wallet_created: false, faucet_requested: false, address: "" };
43
43
 
44
- let allowance = readAllowance();
45
- if (!allowance) {
44
+ let localWallet = readWallet();
45
+ if (!localWallet) {
46
46
  const { generatePrivateKey, privateKeyToAccount } = await import("viem/accounts");
47
47
  const privateKey = generatePrivateKey();
48
48
  const account = privateKeyToAccount(privateKey);
49
- allowance = { address: account.address, privateKey, created: new Date().toISOString(), funded: false, rail: "x402" };
50
- saveAllowance(allowance);
51
- out.allowance_created = true;
52
- announce(`allowance created: ${allowance.address}`);
49
+ localWallet = { address: account.address, privateKey, created: new Date().toISOString(), funded: false, rail: "x402" };
50
+ saveWallet(localWallet);
51
+ out.wallet_created = true;
52
+ announce(`wallet created: ${localWallet.address}`);
53
53
  }
54
- out.address = allowance.address;
54
+ out.address = localWallet.address;
55
55
 
56
56
  const { createPublicClient, http } = await import("viem");
57
57
  const { baseSepolia } = await import("viem/chains");
58
58
  const client = createPublicClient({ chain: baseSepolia, transport: http() });
59
59
  let balance = 0;
60
60
  try {
61
- balance = Number(await client.readContract({ address: USDC_SEPOLIA, abi: USDC_ABI, functionName: "balanceOf", args: [allowance.address] }));
61
+ balance = Number(await client.readContract({ address: USDC_SEPOLIA, abi: USDC_ABI, functionName: "balanceOf", args: [localWallet.address] }));
62
62
  } catch {
63
63
  /* an RPC hiccup here is not fatal — the payment below will surface a real failure if the balance really is zero */
64
64
  }
@@ -67,19 +67,19 @@ export async function ensureFundedWallet(announce = () => {}) {
67
67
  // The faucet is throttled (0.25 USDC / 24h): a throttle refusal is
68
68
  // surfaced with its wait and NEVER retried silently (client-surface
69
69
  // spec) — this call is not wrapped in a swallowing catch.
70
- await getSdk().allowance.faucet(allowance.address);
70
+ await getSdk().wallets.faucet(localWallet.address);
71
71
  out.faucet_requested = true;
72
72
  announce("faucet requested — waiting briefly for on-chain confirmation");
73
73
  for (let i = 0; i < 30; i++) {
74
74
  await new Promise((r) => setTimeout(r, 1000));
75
75
  try {
76
- balance = Number(await client.readContract({ address: USDC_SEPOLIA, abi: USDC_ABI, functionName: "balanceOf", args: [allowance.address] }));
76
+ balance = Number(await client.readContract({ address: USDC_SEPOLIA, abi: USDC_ABI, functionName: "balanceOf", args: [localWallet.address] }));
77
77
  if (balance > 0) break;
78
78
  } catch {
79
79
  /* keep polling */
80
80
  }
81
81
  }
82
- saveAllowance({ ...allowance, funded: true, lastFaucet: new Date().toISOString() });
82
+ saveWallet({ ...localWallet, funded: true, lastFaucet: new Date().toISOString() });
83
83
  }
84
84
 
85
85
  return out;
@@ -91,13 +91,13 @@ export async function ensureFundedWallet(announce = () => {}) {
91
91
  * no edits.
92
92
  *
93
93
  * @param {(line: string) => void} announce Called once per step.
94
- * @returns {Promise<{allowance_created: boolean, faucet_requested: boolean, tier: object|null}>}
94
+ * @returns {Promise<{wallet_created: boolean, faucet_requested: boolean, tier: object|null}>}
95
95
  */
96
96
  export async function foldColdStartChain(announce = () => {}) {
97
97
  const funded = await ensureFundedWallet(announce);
98
98
 
99
- announce("subscribing to the prototype tier (one x402 testnet payment, perpetual)");
99
+ announce("setting the prototype tier (one x402 testnet payment; the free tier, no lease)");
100
100
  const tier = await getSdk().tier.set("prototype");
101
101
  announce(`prototype tier active${tier?.status === "already_active" ? " (already active)" : ""}`);
102
- return { allowance_created: funded.allowance_created, faucet_requested: funded.faucet_requested, tier };
102
+ return { wallet_created: funded.wallet_created, faucet_requested: funded.faucet_requested, tier };
103
103
  }
@@ -107,6 +107,8 @@ export const COMMAND_MANIFEST = [
107
107
  { path: ["wallets", "unbind"], positionals: [], projectScoped: false, legacyPositionalProject: false, minimalArgs: [] },
108
108
  { path: ["wallets", "import"], positionals: [p("name")], projectScoped: false, legacyPositionalProject: false, minimalArgs: ["gate-import-wallet", "--key", "__FIXTURE_FILE__"] },
109
109
  { path: ["wallets", "rm"], positionals: [p("name")], projectScoped: false, legacyPositionalProject: false, minimalArgs: ["no-such-wallet", "--yes"] },
110
+ { path: ["wallets", "fund"], positionals: [], projectScoped: false, legacyPositionalProject: false, minimalArgs: [], skipBehavioral: "polls on-chain funding with sleeps" },
111
+ { path: ["wallets", "balance"], positionals: [], projectScoped: false, legacyPositionalProject: false, minimalArgs: [] },
110
112
  { path: ["wallets", "lightning"], positionals: [p("action", { required: false })], projectScoped: false, legacyPositionalProject: false, minimalArgs: ["status"] },
111
113
 
112
114
  // ── credentials (gateway project credentials) ────────────────────────────
@@ -124,14 +126,6 @@ export const COMMAND_MANIFEST = [
124
126
  { path: ["credentials", "project-keys", "export"], positionals: [], projectScoped: true, legacyPositionalProject: false, minimalArgs: ["--reveal"] },
125
127
  { path: ["credentials", "project-keys", "remove"], positionals: [], projectScoped: true, legacyPositionalProject: false, minimalArgs: [] },
126
128
 
127
- // ── allowance ────────────────────────────────────────────────────────────
128
- { path: ["allowance", "status"], positionals: [], projectScoped: false, legacyPositionalProject: false, minimalArgs: [] },
129
- { path: ["allowance", "create"], positionals: [], projectScoped: false, legacyPositionalProject: false, minimalArgs: [], skipBehavioral: "creates a real local wallet key outside the gate's scratch profile" },
130
- { path: ["allowance", "fund"], positionals: [], projectScoped: false, legacyPositionalProject: false, minimalArgs: [], skipBehavioral: "polls on-chain funding with sleeps" },
131
- { path: ["allowance", "balance"], positionals: [], projectScoped: false, legacyPositionalProject: false, minimalArgs: [] },
132
- { path: ["allowance", "export"], positionals: [], projectScoped: false, legacyPositionalProject: false, minimalArgs: [] },
133
- { path: ["allowance", "checkout"], positionals: [], projectScoped: false, legacyPositionalProject: false, minimalArgs: ["--amount", "5000000"] },
134
- { path: ["allowance", "history"], positionals: [], projectScoped: false, legacyPositionalProject: false, minimalArgs: [] },
135
129
 
136
130
  // ── tier ─────────────────────────────────────────────────────────────────
137
131
  { path: ["tier", "status"], positionals: [], projectScoped: false, legacyPositionalProject: false, minimalArgs: [] },
@@ -186,18 +180,21 @@ export const COMMAND_MANIFEST = [
186
180
  { path: ["core", "projects", "import"], positionals: [p("archive_path")], projectScoped: false, legacyPositionalProject: false, minimalArgs: ["__FIXTURE_FILE__", "--name", "gate-import"] },
187
181
 
188
182
  // ── deploy (unified deploy v2) ───────────────────────────────────────────
189
- { path: ["deploy", "apply"], positionals: [], projectScoped: true, legacyPositionalProject: false, minimalArgs: ["--spec", "{}", "--check"], runStyle: "deployV2" },
183
+ // Bare `run402 deploy` IS the deploy (a verb); the family's subcommands
184
+ // follow. Dispatched flat through deploy.mjs so the gate exercises the
185
+ // same argv decision a person's shell does.
186
+ { path: ["deploy"], positionals: [], projectScoped: true, legacyPositionalProject: false, minimalArgs: ["--spec", "{}", "--check"], runStyle: "flat" },
190
187
  { path: ["deploy", "rehearse"], positionals: [p("plan_id", { required: false })], projectScoped: true, legacyPositionalProject: false, minimalArgs: ["plan_gate1"], runStyle: "deployV2" },
191
188
  { path: ["deploy", "promote"], positionals: [p("release_id")], projectScoped: true, legacyPositionalProject: false, minimalArgs: ["rel_gate1"], runStyle: "deployV2" },
192
189
  { path: ["deploy", "resume"], positionals: [p("operation_id")], projectScoped: true, legacyPositionalProject: false, minimalArgs: ["op_gate1"], runStyle: "deployV2" },
190
+ { path: ["deploy", "status"], positionals: [p("operation_id")], projectScoped: true, legacyPositionalProject: false, minimalArgs: ["op_gate1"], runStyle: "deployV2" },
193
191
  { path: ["deploy", "list"], positionals: [], projectScoped: true, legacyPositionalProject: false, minimalArgs: [], runStyle: "deployV2" },
194
192
  { path: ["deploy", "events"], positionals: [p("operation_id")], projectScoped: true, legacyPositionalProject: false, minimalArgs: ["op_gate1"], runStyle: "deployV2" },
195
193
  { path: ["deploy", "verify"], positionals: [p("operation_id", { required: false })], projectScoped: true, legacyPositionalProject: false, minimalArgs: ["op_gate1"], runStyle: "deployV2" },
196
- { path: ["deploy", "release", "get"], positionals: [p("release_id")], projectScoped: true, legacyPositionalProject: false, minimalArgs: ["rel_gate1"], runStyle: "deployV2" },
197
- { path: ["deploy", "release", "active"], positionals: [], projectScoped: true, legacyPositionalProject: false, minimalArgs: [], runStyle: "deployV2" },
198
- { path: ["deploy", "release", "diff"], positionals: [], projectScoped: true, legacyPositionalProject: false, minimalArgs: ["--from", "empty", "--to", "active"], runStyle: "deployV2" },
199
- { path: ["deploy", "diagnose"], positionals: [p("url")], projectScoped: true, legacyPositionalProject: false, minimalArgs: ["https://example.com/"], runStyle: "deployV2" },
200
- { path: ["deploy", "resolve"], positionals: [], projectScoped: true, legacyPositionalProject: false, minimalArgs: ["--url", "https://example.com/"], runStyle: "deployV2" },
194
+ { path: ["deploy", "releases", "get"], positionals: [p("release_id")], projectScoped: true, legacyPositionalProject: false, minimalArgs: ["rel_gate1"], runStyle: "deployV2" },
195
+ { path: ["deploy", "releases", "active"], positionals: [], projectScoped: true, legacyPositionalProject: false, minimalArgs: [], runStyle: "deployV2" },
196
+ { path: ["deploy", "releases", "diff"], positionals: [], projectScoped: true, legacyPositionalProject: false, minimalArgs: ["--from", "empty", "--to", "active"], runStyle: "deployV2" },
197
+ { path: ["deploy", "resolve"], positionals: [p("url", { required: false })], projectScoped: true, legacyPositionalProject: false, minimalArgs: ["https://example.com/"], runStyle: "deployV2" },
201
198
 
202
199
  // ── ci ───────────────────────────────────────────────────────────────────
203
200
  { path: ["ci", "link"], positionals: [p("provider")], projectScoped: true, legacyPositionalProject: false, minimalArgs: ["github"] },
@@ -210,7 +207,6 @@ export const COMMAND_MANIFEST = [
210
207
  { path: ["transfer", "preview"], positionals: [p("transfer_id")], projectScoped: false, legacyPositionalProject: false, minimalArgs: ["tr_gate1"] },
211
208
  { path: ["transfer", "list"], positionals: [], projectScoped: false, legacyPositionalProject: false, minimalArgs: [] },
212
209
  { path: ["transfer", "accept"], positionals: [p("transfer_id")], projectScoped: false, legacyPositionalProject: false, minimalArgs: ["tr_gate1"] },
213
- { path: ["transfer", "claim"], positionals: [p("transfer_id")], projectScoped: false, legacyPositionalProject: false, minimalArgs: ["tr_gate1"] },
214
210
  { path: ["transfer", "cancel"], positionals: [p("transfer_id")], projectScoped: false, legacyPositionalProject: false, minimalArgs: ["tr_gate1"] },
215
211
 
216
212
  // ── org ──────────────────────────────────────────────────────────────────
@@ -266,9 +262,11 @@ export const COMMAND_MANIFEST = [
266
262
  // add-room-invite design D9: `rooms join` is one verb, two forms — no
267
263
  // positional registers a presence (the behaviorally-tested path, unchanged
268
264
  // by the optional positional below since minimalArgs stays empty); a
269
- // `kri1_…` positional claims a room seat first (a real x402 payment + an
265
+ // `kri1_…` positional redeems the key first (a real x402 payment + an
270
266
  // org-membership mutation), so that form is never behaviorally exercised
271
267
  // here — the same reasoning `repos join`'s own row states.
268
+ { path: ["rooms", "list"], positionals: [], projectScoped: true, legacyPositionalProject: false, minimalArgs: [], runStyle: "sub" },
269
+ { path: ["rooms", "get"], positionals: [p("room_key")], projectScoped: true, legacyPositionalProject: false, minimalArgs: ["run402-dev"], runStyle: "sub" },
272
270
  { path: ["rooms", "join"], positionals: [p("key", { required: false })], projectScoped: true, legacyPositionalProject: false, minimalArgs: [], runStyle: "sub" },
273
271
  { path: ["rooms", "invite"], positionals: [], projectScoped: true, legacyPositionalProject: false, minimalArgs: [], runStyle: "sub", skipBehavioral: "mints a single-use bearer key from a live room, registering the inviter's presence and posting a real room message — never run against the gate's own checkout" },
274
272
  { path: ["rooms", "leave"], positionals: [], projectScoped: true, legacyPositionalProject: false, minimalArgs: [], runStyle: "sub" },
@@ -375,7 +373,7 @@ export const COMMAND_MANIFEST = [
375
373
  { path: ["sites", "deploy-dir"], positionals: [p("dir")], projectScoped: true, legacyPositionalProject: false, minimalArgs: ["__SCRATCH_DIR__"] },
376
374
 
377
375
  // ── subdomains ───────────────────────────────────────────────────────────
378
- { path: ["subdomains", "claim"], positionals: [p("name")], projectScoped: true, legacyPositionalProject: false, minimalArgs: ["gate-sub"] },
376
+ { path: ["subdomains", "add"], positionals: [p("name")], projectScoped: true, legacyPositionalProject: false, minimalArgs: ["gate-sub"] },
379
377
  { path: ["subdomains", "list"], positionals: [], projectScoped: true, legacyPositionalProject: false, minimalArgs: [] },
380
378
  { path: ["subdomains", "delete"], positionals: [p("name")], projectScoped: true, legacyPositionalProject: false, minimalArgs: ["gate-sub", "--confirm"] },
381
379
 
@@ -427,18 +425,16 @@ export const COMMAND_MANIFEST = [
427
425
  { path: ["email", "webhooks", "deliveries"], positionals: [], projectScoped: true, legacyPositionalProject: false, minimalArgs: [] },
428
426
  { path: ["email", "webhooks", "redrive"], positionals: [p("delivery_id")], projectScoped: true, legacyPositionalProject: false, minimalArgs: ["dlv_gate1"] },
429
427
 
430
- // ── message / agent / operator ───────────────────────────────────────────
428
+ // ── message / agent / sign-in ────────────────────────────────────────────
431
429
  { path: ["feedback", "send"], positionals: [p("words", { variadic: true })], projectScoped: true, legacyPositionalProject: false, minimalArgs: ["hello", "from", "the", "gate"] },
432
430
  { path: ["agent", "contact"], positionals: [], projectScoped: false, legacyPositionalProject: false, minimalArgs: ["--name", "gate-agent"] },
433
431
  { path: ["agent", "status"], positionals: [], projectScoped: false, legacyPositionalProject: false, minimalArgs: [] },
434
432
  { path: ["agent", "verify-email"], positionals: [], projectScoped: false, legacyPositionalProject: false, minimalArgs: [] },
435
433
  { path: ["agent", "passkey"], positionals: [p("action")], projectScoped: false, legacyPositionalProject: false, minimalArgs: ["enroll"] },
436
- { path: ["operator", "login"], positionals: [], projectScoped: false, legacyPositionalProject: false, minimalArgs: [], skipBehavioral: "opens a browser / loopback listener" },
437
- { path: ["operator", "logout"], positionals: [], projectScoped: false, legacyPositionalProject: false, minimalArgs: [] },
438
- { path: ["operator", "overview"], positionals: [], projectScoped: false, legacyPositionalProject: false, minimalArgs: [] },
439
- { path: ["operator", "whoami"], positionals: [], projectScoped: false, legacyPositionalProject: false, minimalArgs: [] },
440
- { path: ["operator", "claim-wallet-org"], positionals: [], projectScoped: false, legacyPositionalProject: false, minimalArgs: [] },
441
- { path: ["operator", "approve"], positionals: [], projectScoped: false, legacyPositionalProject: false, minimalArgs: ["--action", "org.project.create", "--org", "org_gate1", "--no-open"] },
434
+ { path: ["login"], positionals: [], projectScoped: false, legacyPositionalProject: false, minimalArgs: [], runStyle: "flat", skipBehavioral: "opens a browser / loopback listener" },
435
+ { path: ["logout"], positionals: [], projectScoped: false, legacyPositionalProject: false, minimalArgs: [], runStyle: "flat" },
436
+ { path: ["whoami"], positionals: [], projectScoped: false, legacyPositionalProject: false, minimalArgs: [], runStyle: "flat", skipBehavioral: "requires live principal authentication" },
437
+ { path: ["approve"], positionals: [], projectScoped: false, legacyPositionalProject: false, minimalArgs: ["--action", "org.project.create", "--org", "org_gate1", "--no-open"], runStyle: "flat" },
442
438
 
443
439
  // ── auth ─────────────────────────────────────────────────────────────────
444
440
  { path: ["auth", "magic-link"], positionals: [], projectScoped: true, legacyPositionalProject: false, minimalArgs: ["--email", "gate@example.com", "--redirect", "https://example.com/cb"] },
@@ -497,7 +493,6 @@ export const COMMAND_MANIFEST = [
497
493
  // Families deliberately absent from the manifest, consumed by the gate's
498
494
  // completeness check against cli.mjs's dispatch switch.
499
495
  export const SKIPPED_FAMILIES = {
500
- "apply": "pure alias for `deploy apply` (covered by the deploy family)",
501
496
  "dev": "interactive wrapper that spawns `astro dev`",
502
497
  // RESERVED, not dispatched: every `run402 message …` fails with
503
498
  // COMMAND_REMOVED pointing at `feedback send` / `messages send` /
@@ -538,15 +533,6 @@ export const SKIPPED_FAMILIES = {
538
533
  export const RESERVED_SUBCOMMANDS = {
539
534
  "source-access:export": "moved to `repos recovery-bundle` — the artifact `repos recover --bundle` consumes belongs to the repos family",
540
535
  "source-access:status": "moved to `repos access` — your own wrapper custody rides its member_custody block; the org advisory is `doctor --only recovery_posture`",
541
- "rooms:who": "renamed to `rooms join` — an interrogative must not name a write",
542
- "rooms:send": "moved to `messages send` — the verb acts on a message",
543
- // The routes and SDK methods for room list/get exist (agent-room-lifecycle);
544
- // only these two SPELLINGS are held back, because they were freed from
545
- // meaning "list/get MESSAGES" and a reused spelling changes meaning without
546
- // ever failing. One major, then they may name the room.
547
- "rooms:list": "moved to `messages list` — the verb acts on a message",
548
- "rooms:get": "moved to `messages get` — the verb acts on a message",
549
- "rooms:ack": "moved to `messages ack` — the verb acts on a message",
550
536
  "escalations:contacts": "merged into `contacts` — the ladder and Telegram channels are one question",
551
537
  // Every `gitvault <verb>` spelling. Nine
552
538
  // answer COMMAND_MOVED naming their `repos` successor; `push` and
package/lib/config.mjs CHANGED
@@ -12,22 +12,22 @@ import {
12
12
  getLegacyProjectsPath,
13
13
  getProfileStatePath,
14
14
  getProjectCredentialsPath,
15
- getAllowancePath,
15
+ getWalletPath,
16
16
  configureApiBase,
17
17
  isCoreApiTarget,
18
18
  readApiTargetConfig,
19
19
  } from "../core-dist/config.js";
20
- import { readAllowance as coreReadAllowance, saveAllowance as coreSaveAllowance } from "../core-dist/allowance.js";
20
+ import { readWallet as coreReadWallet, saveWallet as coreSaveWallet } from "../core-dist/wallet.js";
21
21
  import { loadKeyStore, getProject, saveProject, updateProject, removeProject, saveKeyStore, getActiveProjectId, setActiveProjectId } from "../core-dist/keystore.js";
22
- import { getAllowanceAuthHeaders as coreGetAllowanceAuthHeaders } from "../core-dist/allowance-auth.js";
22
+ import { getWalletAuthHeaders as coreGetWalletAuthHeaders } from "../core-dist/wallet-auth.js";
23
23
  import { fail } from "./sdk-errors.mjs";
24
24
  import { initializeWalletAction, selectProjectAction } from "./next-actions.mjs";
25
25
 
26
26
  // Wallet-dependent paths are exposed as getters (preferred — they always
27
27
  // reflect the active profile, even if some future code path imports this module
28
- // before wallet resolution). Production code (init/doctor/allowance) uses these.
28
+ // before wallet resolution). Production code (init/doctor/wallet) uses these.
29
29
  export function configDir() { return getConfigDir(); }
30
- export function allowanceFile() { return getAllowancePath(); }
30
+ export function walletFile() { return getWalletPath(); }
31
31
  export function projectCredentialsFile() { return getProjectCredentialsPath(); }
32
32
  export function profileStateFile() { return getProfileStatePath(); }
33
33
  export function legacyProjectsFile() { return getLegacyProjectsPath(); }
@@ -45,7 +45,7 @@ export function activeProfile() { return getActiveProfile(); }
45
45
  // module, and tests set RUN402_CONFIG_DIR before importing. New code should
46
46
  // prefer the getters above.
47
47
  export const CONFIG_DIR = getConfigDir();
48
- export const ALLOWANCE_FILE = getAllowancePath();
48
+ export const WALLET_FILE = getWalletPath();
49
49
  export const PROJECTS_FILE = getProjectCredentialsPath();
50
50
  export const PROJECT_CREDENTIALS_FILE = getProjectCredentialsPath();
51
51
  export const PROFILE_STATE_FILE = getProfileStatePath();
@@ -54,40 +54,40 @@ export const PROFILE_STATE_FILE = getProfileStatePath();
54
54
  export const API = getApiBase();
55
55
 
56
56
  /**
57
- * Wraps core's `readAllowance()` and converts the malformed-shape throw
57
+ * Wraps core's `readWallet()` and converts the malformed-shape throw
58
58
  * into the canonical CLI failure envelope. Without this guard, every
59
- * CLI subcommand that touches the allowance leaks a Node stack trace and
60
- * source paths the moment a user has a malformed `allowance.json`.
59
+ * CLI subcommand that touches the wallet leaks a Node stack trace and
60
+ * source paths the moment a user has a malformed `wallet.json`.
61
61
  *
62
62
  * The unparseable-JSON case still returns `null` (matching the historical
63
- * "no_allowance" UX); only valid-JSON-but-wrong-shape becomes a structured
64
- * error with `code: BAD_ALLOWANCE_FILE`.
63
+ * "no_wallet" UX); only valid-JSON-but-wrong-shape becomes a structured
64
+ * error with `code: BAD_WALLET_FILE`.
65
65
  */
66
- export function readAllowance() {
66
+ export function readWallet() {
67
67
  try {
68
- return coreReadAllowance();
68
+ return coreReadWallet();
69
69
  } catch (err) {
70
70
  fail({
71
- code: "BAD_ALLOWANCE_FILE",
72
- message: err?.message ?? "allowance.json is malformed",
73
- hint: "Back up ~/.config/run402/allowance.json and run 'run402 init' to recreate it.",
74
- details: { path: allowanceFile() },
71
+ code: "BAD_WALLET_FILE",
72
+ message: err?.message ?? "wallet.json is malformed",
73
+ hint: "Back up ~/.config/run402/wallet.json and run 'run402 init' to recreate it.",
74
+ details: { path: walletFile() },
75
75
  next_actions: [initializeWalletAction()],
76
76
  });
77
77
  }
78
78
  }
79
79
 
80
- export function saveAllowance(data) {
81
- coreSaveAllowance(data);
80
+ export function saveWallet(data) {
81
+ coreSaveWallet(data);
82
82
  }
83
83
 
84
- export function allowanceAuthHeaders(path) {
85
- const headers = coreGetAllowanceAuthHeaders(path);
84
+ export function walletAuthHeaders(path) {
85
+ const headers = coreGetWalletAuthHeaders(path);
86
86
  if (!headers) {
87
87
  fail({
88
- code: "NO_ALLOWANCE",
89
- message: "No agent allowance found.",
90
- hint: "Run: run402 allowance create",
88
+ code: "NO_WALLET",
89
+ message: "No local wallet found.",
90
+ hint: "Run: run402 init",
91
91
  next_actions: [initializeWalletAction()],
92
92
  });
93
93
  }
package/lib/contacts.mjs CHANGED
@@ -18,11 +18,11 @@
18
18
  * `--kind` flag nobody could answer without looking it up.
19
19
  *
20
20
  * HTTP paths are unchanged (`/agent/v1/notifications/channels*`,
21
- * `/orgs/v1/:org_id/escalation-contacts*`); the allowance auth headers below
21
+ * `/orgs/v1/:org_id/escalation-contacts*`); the SIWX auth headers below
22
22
  * are PATH-scoped and must keep naming the real routes.
23
23
  */
24
- import { allowanceAuthHeaders } from "./config.mjs";
25
- import { operatorProofs } from "./operator-proofs.mjs";
24
+ import { walletAuthHeaders } from "./config.mjs";
25
+ import { sessionProofs } from "./session-proofs.mjs";
26
26
  import { getSdk } from "./sdk.mjs";
27
27
  import { reportSdkError, fail } from "./sdk-errors.mjs";
28
28
  import {
@@ -59,7 +59,7 @@ Two kinds, one question:
59
59
  Every row carries \`kind\`. \`rm\` takes either kind's id and works out which.
60
60
 
61
61
  Notes:
62
- - Adding an address with no verified operator email is ACCEPTED with a
62
+ - Adding an address with no verified contact email is ACCEPTED with a
63
63
  reachability warning — you must be able to configure the chain before the
64
64
  humans are bound.
65
65
  - What actually landed is \`run402 deliveries\`.
@@ -69,7 +69,7 @@ async function preferences(args) {
69
69
  const parsedArgs = normalizeArgv(args);
70
70
  assertKnownFlags(parsedArgs, ["--help", "-h"]);
71
71
  const positionals = positionalArgs(parsedArgs);
72
- allowanceAuthHeaders("/agent/v1/notifications/preferences");
72
+ walletAuthHeaders("/agent/v1/notifications/preferences");
73
73
 
74
74
  if (positionals.length === 0) {
75
75
  // GET preferences
@@ -104,7 +104,7 @@ async function preferences(args) {
104
104
  }
105
105
  }
106
106
  try {
107
- const data = await getSdk().admin.setNotificationPreferences(patch, operatorProofs("/agent/v1/notifications/preferences"));
107
+ const data = await getSdk().admin.setNotificationPreferences(patch, sessionProofs("/agent/v1/notifications/preferences"));
108
108
  console.log(JSON.stringify(data, null, 2));
109
109
  } catch (err) {
110
110
  reportSdkError(err);
@@ -185,7 +185,7 @@ async function channelsConnect(args) {
185
185
  fail({ code: "BAD_USAGE", message: `Unexpected argument for notifications channels connect: ${positionals[1]}` });
186
186
  }
187
187
 
188
- const proofs = operatorProofs("/agent/v1/notifications/channels/telegram");
188
+ const proofs = sessionProofs("/agent/v1/notifications/channels/telegram");
189
189
  let pending;
190
190
  try {
191
191
  pending = await getSdk().admin.channels.connectTelegram(label ? { label } : {}, proofs);
@@ -215,7 +215,7 @@ async function channelsConnect(args) {
215
215
  }
216
216
 
217
217
  async function channelsList() {
218
- allowanceAuthHeaders("/agent/v1/notifications/channels");
218
+ walletAuthHeaders("/agent/v1/notifications/channels");
219
219
  try {
220
220
  console.log(JSON.stringify(await getSdk().admin.channels.list(), null, 2));
221
221
  } catch (err) {
@@ -232,9 +232,9 @@ async function channelsRevoke(args) {
232
232
  command: "run402 notifications channels revoke <binding_id>",
233
233
  missing: "Missing <binding_id>.",
234
234
  });
235
- allowanceAuthHeaders("/agent/v1/notifications/channels/telegram");
235
+ walletAuthHeaders("/agent/v1/notifications/channels/telegram");
236
236
  try {
237
- console.log(JSON.stringify(await getSdk().admin.channels.revokeTelegram(bindingId, operatorProofs("/agent/v1/notifications/channels/telegram")), null, 2));
237
+ console.log(JSON.stringify(await getSdk().admin.channels.revokeTelegram(bindingId, sessionProofs("/agent/v1/notifications/channels/telegram")), null, 2));
238
238
  } catch (err) {
239
239
  reportSdkError(err);
240
240
  }
@@ -280,7 +280,7 @@ async function test(args) {
280
280
  const source = flagValue(parsedArgs, "--source");
281
281
  if (source !== null) assertAllowedValue(source, ["app", "platform"], "--source");
282
282
  const eventType = flagValue(parsedArgs, "--type");
283
- allowanceAuthHeaders("/agent/v1/notifications/test");
283
+ walletAuthHeaders("/agent/v1/notifications/test");
284
284
  const opts = {};
285
285
  if (source) opts.source = source;
286
286
  if (eventType) opts.eventType = eventType;
@@ -319,7 +319,7 @@ async function listContacts(args) {
319
319
  }
320
320
 
321
321
  try {
322
- allowanceAuthHeaders("/agent/v1/notifications/channels");
322
+ walletAuthHeaders("/agent/v1/notifications/channels");
323
323
  const res = await sdk.admin.channels.list();
324
324
  for (const ch of res.telegram ?? []) {
325
325
  rows.push({ kind: "telegram", id: ch.binding_id ?? ch.id, ...ch });
@@ -354,7 +354,7 @@ async function removeContact(args) {
354
354
  return;
355
355
  }
356
356
  }
357
- allowanceAuthHeaders("/agent/v1/notifications/channels");
357
+ walletAuthHeaders("/agent/v1/notifications/channels");
358
358
  const chans = await sdk.admin.channels.list();
359
359
  const chan = (chans.telegram ?? []).find((c) => (c.binding_id ?? c.id) === id);
360
360
  if (chan) {
package/lib/contracts.mjs CHANGED
@@ -14,7 +14,7 @@ import {
14
14
  const HELP = `run402 contracts — KMS-backed Ethereum signers for smart-contract calls
15
15
 
16
16
  Pricing: $0.04/day per signer ($1.20/month) plus $0.000005 per contract call.
17
- Signer creation requires $1.20 in cash credit (30 days of rent).
17
+ Signer creation requires $1.20 of allowance (30 days of rent).
18
18
  Non-custodial: see https://run402.com/humans/terms.html#non-custodial-kms-wallets
19
19
 
20
20
  Usage:
@@ -48,7 +48,7 @@ Notes:
48
48
  - 'issue', 'rotate' and 'revoke' need owner membership on the project's org
49
49
  plus a fresh step-up, so a scoped agent credential can never escalate
50
50
  itself into a permanent root. Authenticate with a wallet (SIWX) or a
51
- control-plane session ('run402 operator login --step-up').
51
+ sign-in session ('run402 login').
52
52
  - 'token' is the exception: a delegate can mint one with no human present.
53
53
  - Secrets are returned EXACTLY ONCE and are never recoverable. Full JSON goes
54
54
  to stdout so you can pipe it; the warnings go to stderr.
@@ -126,7 +126,7 @@ anon/service keys, or "rotatable" once it holds credentials it can revoke
126
126
  individually.
127
127
 
128
128
  There is deliberately NO deadline: retirement is gated on conditions (every
129
- tenant migrated, 30 consecutive days of zero legacy-key use, explicit operator
129
+ tenant migrated, 30 consecutive days of zero legacy-key use, explicit staff
130
130
  approval), not a date. Read retirement.gated_on rather than planning against a
131
131
  date the platform has not committed to.
132
132
  `,
@@ -4,7 +4,7 @@
4
4
  * builtins (pinned by the import-graph gate test), so it must stay tiny.
5
5
  *
6
6
  * The socket lives INSIDE the client configuration directory — the same
7
- * 0700 trust boundary that already holds the allowance private key and the
7
+ * 0700 trust boundary that already holds the wallet private key and the
8
8
  * gitvault keystore — and its path is keyed by CLI version, so a CLI
9
9
  * upgrade resolves a NEW path: the new client never reaches the old daemon,
10
10
  * which idles out on its own. Windows uses a named pipe whose name carries
package/lib/delegates.mjs CHANGED
@@ -32,7 +32,7 @@ Notes:
32
32
  - A delegate can never be an owner, and is revocable and expiring.
33
33
  - The token is shown ONCE and is not recoverable. Store it immediately;
34
34
  if you lose it, 'rotate' issues a new one.
35
- - Use it with: RUN402_DELEGATE_TOKEN=<token> run402 deploy apply ...
35
+ - Use it with: RUN402_DELEGATE_TOKEN=<token> run402 deploy ...
36
36
  - JSON in, JSON out.
37
37
 
38
38
  Why this exists:
@@ -7,12 +7,12 @@
7
7
  * produces them, which is now `contacts` and `subscriptions`.
8
8
  *
9
9
  * HTTP paths are unchanged (`/agent/v1/notifications*`) — this is client
10
- * vocabulary, and the allowance auth headers below are PATH-scoped, so they
10
+ * vocabulary, and the SIWX auth headers below are PATH-scoped, so they
11
11
  * must keep naming the real route. Renaming them would ship broken auth
12
12
  * against a live path, which is exactly how the `feedback` rename nearly went
13
13
  * wrong.
14
14
  */
15
- import { allowanceAuthHeaders } from "./config.mjs";
15
+ import { walletAuthHeaders } from "./config.mjs";
16
16
  import { getSdk } from "./sdk.mjs";
17
17
  import { reportSdkError, fail } from "./sdk-errors.mjs";
18
18
  import {
@@ -47,7 +47,7 @@ async function list(args) {
47
47
  if (extra.length > 0) {
48
48
  fail({ code: "BAD_USAGE", message: `Unexpected argument for notifications list: ${extra[0]}` });
49
49
  }
50
- allowanceAuthHeaders("/agent/v1/notifications");
50
+ walletAuthHeaders("/agent/v1/notifications");
51
51
  const opts = {};
52
52
  const type = flagValue(parsedArgs, "--type");
53
53
  const since = flagValue(parsedArgs, "--since");
@@ -72,7 +72,7 @@ async function get(args) {
72
72
  if (positionals.length !== 1) {
73
73
  fail({ code: "BAD_USAGE", message: "Usage: run402 notifications get <id>" });
74
74
  }
75
- allowanceAuthHeaders("/agent/v1/notifications");
75
+ walletAuthHeaders("/agent/v1/notifications");
76
76
  try {
77
77
  const data = await getSdk().admin.getNotification(positionals[0]);
78
78
  console.log(JSON.stringify(data, null, 2));
@@ -3,21 +3,21 @@ import assert from "node:assert/strict";
3
3
  import { mkdtempSync, rmSync, writeFileSync } from "node:fs";
4
4
  import { join } from "node:path";
5
5
  import { tmpdir } from "node:os";
6
- import { discoverRehearseManifest } from "./deploy-v2.mjs";
6
+ import { discoverDeployManifest } from "./deploy-v2.mjs";
7
7
 
8
- describe("deploy rehearse — manifest discovery (the way up does it)", () => {
8
+ describe("deploy / deploy rehearse — manifest discovery (the way up does it)", () => {
9
9
  it("prefers run402.json, then run402.deploy.json, then app.json, then executable configs", () => {
10
10
  const dir = mkdtempSync(join(tmpdir(), "run402-rehearse-discover-"));
11
11
  try {
12
- assert.equal(discoverRehearseManifest(dir), null);
12
+ assert.equal(discoverDeployManifest(dir), null);
13
13
  writeFileSync(join(dir, "run402.deploy.ts"), "export default {}");
14
- assert.equal(discoverRehearseManifest(dir), join(dir, "run402.deploy.ts"));
14
+ assert.equal(discoverDeployManifest(dir), join(dir, "run402.deploy.ts"));
15
15
  writeFileSync(join(dir, "app.json"), "{}");
16
- assert.equal(discoverRehearseManifest(dir), join(dir, "app.json"));
16
+ assert.equal(discoverDeployManifest(dir), join(dir, "app.json"));
17
17
  writeFileSync(join(dir, "run402.deploy.json"), "{}");
18
- assert.equal(discoverRehearseManifest(dir), join(dir, "run402.deploy.json"));
18
+ assert.equal(discoverDeployManifest(dir), join(dir, "run402.deploy.json"));
19
19
  writeFileSync(join(dir, "run402.json"), "{}");
20
- assert.equal(discoverRehearseManifest(dir), join(dir, "run402.json"));
20
+ assert.equal(discoverDeployManifest(dir), join(dir, "run402.json"));
21
21
  } finally {
22
22
  rmSync(dir, { recursive: true, force: true });
23
23
  }