@run402/sdk 4.93.1 → 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 (195) hide show
  1. package/README.md +21 -19
  2. package/core-dist/config.d.ts +16 -2
  3. package/core-dist/config.js +52 -18
  4. package/core-dist/control-plane-session.d.ts +29 -14
  5. package/core-dist/control-plane-session.js +31 -6
  6. package/core-dist/keystore.js +7 -7
  7. package/core-dist/profiles.d.ts +3 -3
  8. package/core-dist/profiles.js +9 -7
  9. package/core-dist/{allowance-auth.d.ts → wallet-auth.d.ts} +6 -6
  10. package/core-dist/{allowance-auth.js → wallet-auth.js} +15 -15
  11. package/core-dist/wallet.d.ts +22 -0
  12. package/core-dist/{allowance.js → wallet.js} +20 -20
  13. package/core-dist/{write-auth-session.d.ts → write-approvals.d.ts} +28 -26
  14. package/core-dist/{write-auth-session.js → write-approvals.js} +19 -19
  15. package/dist/actions.d.ts +1 -1
  16. package/dist/actions.d.ts.map +1 -1
  17. package/dist/control-plane-credentials.d.ts +8 -8
  18. package/dist/control-plane-credentials.js +7 -7
  19. package/dist/credentials.d.ts +19 -19
  20. package/dist/credentials.d.ts.map +1 -1
  21. package/dist/credentials.js +1 -1
  22. package/dist/errors.d.ts +24 -26
  23. package/dist/errors.d.ts.map +1 -1
  24. package/dist/errors.js +34 -37
  25. package/dist/errors.js.map +1 -1
  26. package/dist/index.d.ts +29 -16
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +29 -16
  29. package/dist/index.js.map +1 -1
  30. package/dist/kernel.d.ts +1 -1
  31. package/dist/kernel.d.ts.map +1 -1
  32. package/dist/kernel.js +10 -9
  33. package/dist/kernel.js.map +1 -1
  34. package/dist/namespaces/admin.d.ts +51 -120
  35. package/dist/namespaces/admin.d.ts.map +1 -1
  36. package/dist/namespaces/admin.js +41 -45
  37. package/dist/namespaces/admin.js.map +1 -1
  38. package/dist/namespaces/agent.d.ts +2 -2
  39. package/dist/namespaces/agent.d.ts.map +1 -1
  40. package/dist/namespaces/agent.js +2 -2
  41. package/dist/namespaces/agent.js.map +1 -1
  42. package/dist/namespaces/ai.d.ts +1 -1
  43. package/dist/namespaces/ai.js +1 -1
  44. package/dist/namespaces/billing.d.ts +6 -3
  45. package/dist/namespaces/billing.d.ts.map +1 -1
  46. package/dist/namespaces/billing.js.map +1 -1
  47. package/dist/namespaces/buzz-notifications.types.d.ts +1 -1
  48. package/dist/namespaces/buzz.d.ts +2 -2
  49. package/dist/namespaces/buzz.d.ts.map +1 -1
  50. package/dist/namespaces/buzz.js +2 -2
  51. package/dist/namespaces/buzz.js.map +1 -1
  52. package/dist/namespaces/buzz.types.d.ts +2 -2
  53. package/dist/namespaces/buzz.types.d.ts.map +1 -1
  54. package/dist/namespaces/credentials.types.d.ts +1 -1
  55. package/dist/namespaces/deploy.d.ts +1 -1
  56. package/dist/namespaces/deploy.js +5 -5
  57. package/dist/namespaces/deploy.js.map +1 -1
  58. package/dist/namespaces/deploy.types.d.ts +4 -4
  59. package/dist/namespaces/escalations.d.ts +1 -1
  60. package/dist/namespaces/escalations.js +1 -1
  61. package/dist/namespaces/escalations.types.d.ts +2 -2
  62. package/dist/namespaces/escalations.types.d.ts.map +1 -1
  63. package/dist/namespaces/events.types.d.ts +1 -1
  64. package/dist/namespaces/functions.d.ts +1 -1
  65. package/dist/namespaces/functions.js +1 -1
  66. package/dist/namespaces/gitvault.crypto.d.ts +1 -1
  67. package/dist/namespaces/gitvault.d.ts +24 -24
  68. package/dist/namespaces/gitvault.d.ts.map +1 -1
  69. package/dist/namespaces/gitvault.js +109 -109
  70. package/dist/namespaces/gitvault.js.map +1 -1
  71. package/dist/namespaces/me.d.ts +120 -0
  72. package/dist/namespaces/me.d.ts.map +1 -0
  73. package/dist/namespaces/me.js +34 -0
  74. package/dist/namespaces/me.js.map +1 -0
  75. package/dist/namespaces/org.d.ts +108 -6
  76. package/dist/namespaces/org.d.ts.map +1 -1
  77. package/dist/namespaces/org.js +63 -7
  78. package/dist/namespaces/org.js.map +1 -1
  79. package/dist/namespaces/org.types.d.ts +29 -9
  80. package/dist/namespaces/org.types.d.ts.map +1 -1
  81. package/dist/namespaces/pay.js +3 -3
  82. package/dist/namespaces/pay.js.map +1 -1
  83. package/dist/namespaces/projects.d.ts +9 -9
  84. package/dist/namespaces/projects.js +15 -15
  85. package/dist/namespaces/projects.js.map +1 -1
  86. package/dist/namespaces/projects.types.d.ts +28 -12
  87. package/dist/namespaces/projects.types.d.ts.map +1 -1
  88. package/dist/namespaces/rooms.d.ts +7 -7
  89. package/dist/namespaces/rooms.js +17 -17
  90. package/dist/namespaces/rooms.js.map +1 -1
  91. package/dist/namespaces/rooms.types.d.ts +9 -9
  92. package/dist/namespaces/rooms.types.d.ts.map +1 -1
  93. package/dist/namespaces/service.d.ts +1 -1
  94. package/dist/namespaces/service.js +1 -1
  95. package/dist/namespaces/{operator-session.d.ts → session.d.ts} +135 -51
  96. package/dist/namespaces/session.d.ts.map +1 -0
  97. package/dist/namespaces/{operator-session.js → session.js} +118 -30
  98. package/dist/namespaces/session.js.map +1 -0
  99. package/dist/namespaces/subdomains.d.ts +5 -5
  100. package/dist/namespaces/subdomains.d.ts.map +1 -1
  101. package/dist/namespaces/subdomains.js +6 -6
  102. package/dist/namespaces/subdomains.js.map +1 -1
  103. package/dist/namespaces/tier.d.ts +43 -20
  104. package/dist/namespaces/tier.d.ts.map +1 -1
  105. package/dist/namespaces/tier.js +7 -7
  106. package/dist/namespaces/tier.js.map +1 -1
  107. package/dist/namespaces/transfers.d.ts +74 -71
  108. package/dist/namespaces/transfers.d.ts.map +1 -1
  109. package/dist/namespaces/transfers.js +31 -38
  110. package/dist/namespaces/transfers.js.map +1 -1
  111. package/dist/namespaces/vouchers.d.ts +9 -10
  112. package/dist/namespaces/vouchers.d.ts.map +1 -1
  113. package/dist/namespaces/vouchers.js +4 -5
  114. package/dist/namespaces/vouchers.js.map +1 -1
  115. package/dist/namespaces/wallets.d.ts +72 -3
  116. package/dist/namespaces/wallets.d.ts.map +1 -1
  117. package/dist/namespaces/wallets.js +141 -3
  118. package/dist/namespaces/wallets.js.map +1 -1
  119. package/dist/namespaces/write-approval.d.ts +101 -0
  120. package/dist/namespaces/write-approval.d.ts.map +1 -0
  121. package/dist/namespaces/write-approval.js +62 -0
  122. package/dist/namespaces/write-approval.js.map +1 -0
  123. package/dist/node/actions-node.d.ts +3 -3
  124. package/dist/node/actions-node.d.ts.map +1 -1
  125. package/dist/node/actions-node.js +36 -36
  126. package/dist/node/actions-node.js.map +1 -1
  127. package/dist/node/{bearer-claim-key.d.ts → bearer-redeem-key.d.ts} +12 -12
  128. package/dist/node/bearer-redeem-key.d.ts.map +1 -0
  129. package/dist/node/{bearer-claim-key.js → bearer-redeem-key.js} +21 -21
  130. package/dist/node/bearer-redeem-key.js.map +1 -0
  131. package/dist/node/ci.d.ts +1 -1
  132. package/dist/node/ci.d.ts.map +1 -1
  133. package/dist/node/ci.js +6 -6
  134. package/dist/node/ci.js.map +1 -1
  135. package/dist/node/credentials.d.ts +17 -16
  136. package/dist/node/credentials.d.ts.map +1 -1
  137. package/dist/node/credentials.js +28 -27
  138. package/dist/node/credentials.js.map +1 -1
  139. package/dist/node/funding-recovery.d.ts +1 -1
  140. package/dist/node/funding-recovery.d.ts.map +1 -1
  141. package/dist/node/funding-recovery.js +1 -1
  142. package/dist/node/funding-recovery.js.map +1 -1
  143. package/dist/node/gitvault-apply.d.ts +1 -1
  144. package/dist/node/gitvault-apply.d.ts.map +1 -1
  145. package/dist/node/gitvault-handoff.d.ts +22 -22
  146. package/dist/node/gitvault-handoff.d.ts.map +1 -1
  147. package/dist/node/gitvault-handoff.js +45 -45
  148. package/dist/node/gitvault-handoff.js.map +1 -1
  149. package/dist/node/gitvault-prewarm.js +7 -7
  150. package/dist/node/gitvault-prewarm.js.map +1 -1
  151. package/dist/node/gitvault-restore.d.ts +1 -1
  152. package/dist/node/gitvault-restore.js +1 -1
  153. package/dist/node/index.d.ts +16 -16
  154. package/dist/node/index.d.ts.map +1 -1
  155. package/dist/node/index.js +15 -15
  156. package/dist/node/index.js.map +1 -1
  157. package/dist/node/org-adopt.d.ts +49 -0
  158. package/dist/node/org-adopt.d.ts.map +1 -0
  159. package/dist/node/org-adopt.js +77 -0
  160. package/dist/node/org-adopt.js.map +1 -0
  161. package/dist/node/paid-fetch.d.ts +7 -7
  162. package/dist/node/paid-fetch.d.ts.map +1 -1
  163. package/dist/node/paid-fetch.js +54 -54
  164. package/dist/node/paid-fetch.js.map +1 -1
  165. package/dist/node/preflight.d.ts +1 -1
  166. package/dist/node/preflight.d.ts.map +1 -1
  167. package/dist/node/preflight.js +1 -1
  168. package/dist/node/preflight.js.map +1 -1
  169. package/dist/node/source-scan.d.ts +1 -1
  170. package/dist/node/source-scan.js +2 -2
  171. package/dist/node/source-scan.js.map +1 -1
  172. package/dist/scoped.d.ts +3 -3
  173. package/dist/scoped.d.ts.map +1 -1
  174. package/dist/scoped.js +2 -2
  175. package/dist/scoped.js.map +1 -1
  176. package/package.json +1 -1
  177. package/core-dist/allowance.d.ts +0 -22
  178. package/core-dist/operator-session.d.ts +0 -80
  179. package/core-dist/operator-session.js +0 -154
  180. package/dist/namespaces/allowance.d.ts +0 -79
  181. package/dist/namespaces/allowance.d.ts.map +0 -1
  182. package/dist/namespaces/allowance.js +0 -149
  183. package/dist/namespaces/allowance.js.map +0 -1
  184. package/dist/namespaces/operator-session.d.ts.map +0 -1
  185. package/dist/namespaces/operator-session.js.map +0 -1
  186. package/dist/namespaces/operator.d.ts +0 -359
  187. package/dist/namespaces/operator.d.ts.map +0 -1
  188. package/dist/namespaces/operator.js +0 -272
  189. package/dist/namespaces/operator.js.map +0 -1
  190. package/dist/node/bearer-claim-key.d.ts.map +0 -1
  191. package/dist/node/bearer-claim-key.js.map +0 -1
  192. package/dist/node/operator-claim.d.ts +0 -49
  193. package/dist/node/operator-claim.d.ts.map +0 -1
  194. package/dist/node/operator-claim.js +0 -77
  195. package/dist/node/operator-claim.js.map +0 -1
@@ -1,12 +1,12 @@
1
1
  /**
2
- * Allowance auth helper — generates SIWX (Sign-In With X / EIP-4361) headers for Run402 API.
2
+ * SIWX auth helper — generates SIWX (Sign-In With X / EIP-4361) headers for Run402 API.
3
3
  * Uses @noble/curves (lighter than viem) for signing.
4
4
  */
5
5
  import { randomBytes } from "node:crypto";
6
6
  import { secp256k1 } from "@noble/curves/secp256k1.js";
7
7
  import { keccak_256 } from "@noble/hashes/sha3.js";
8
8
  import { bytesToHex } from "@noble/hashes/utils.js";
9
- import { readAllowance } from "./allowance.js";
9
+ import { readWallet } from "./wallet.js";
10
10
  import { getApiBase } from "./config.js";
11
11
  /**
12
12
  * EIP-55 mixed-case checksum encoding.
@@ -21,7 +21,7 @@ export function toChecksumAddress(address) {
21
21
  return checksummed;
22
22
  }
23
23
  /**
24
- * EIP-191 personal_sign: sign a message with the allowance's private key.
24
+ * EIP-191 personal_sign: sign a message with the wallet's private key.
25
25
  */
26
26
  function personalSign(privateKeyHex, address, message) {
27
27
  const msgBytes = new TextEncoder().encode(message);
@@ -86,11 +86,11 @@ export function formatSIWEMessage(opts, address) {
86
86
  return lines.join("\n");
87
87
  }
88
88
  export function buildSIWxAuthHeaders(opts) {
89
- const message = formatSIWEMessage(opts, opts.allowance.address);
90
- const signature = personalSign(opts.allowance.privateKey, opts.allowance.address, message);
89
+ const message = formatSIWEMessage(opts, opts.wallet.address);
90
+ const signature = personalSign(opts.wallet.privateKey, opts.wallet.address, message);
91
91
  const payload = {
92
92
  domain: opts.domain,
93
- address: toChecksumAddress(opts.allowance.address),
93
+ address: toChecksumAddress(opts.wallet.address),
94
94
  statement: opts.statement,
95
95
  uri: opts.uri,
96
96
  version: opts.version ?? "1",
@@ -110,18 +110,18 @@ export function buildSIWxAuthHeaders(opts) {
110
110
  }
111
111
  /**
112
112
  * Get SIWX auth headers for the Run402 API.
113
- * Returns null if no allowance is configured.
113
+ * Returns null if no local wallet is configured.
114
114
  *
115
115
  * @param path - API path (e.g. "/projects/v1") used to build the SIWE uri field.
116
116
  */
117
- export function getAllowanceAuthHeaders(path, allowancePath) {
118
- // readAllowance throws on a malformed-shape allowance file. The
119
- // CLI's higher-level readAllowance wrapper surfaces this as a structured
120
- // BAD_ALLOWANCE_FILE envelope; here we preserve the public contract that
117
+ export function getWalletAuthHeaders(path, walletPath) {
118
+ // readWallet throws on a malformed-shape wallet file. The
119
+ // CLI's higher-level readWallet wrapper surfaces this as a structured
120
+ // BAD_WALLET_FILE envelope; here we preserve the public contract that
121
121
  // this helper returns SIWxAuthHeaders | null. Re-throw so callers above
122
122
  // the CLI's wrapper (e.g. SDK paid-fetch) can decide whether to swallow it.
123
- const allowance = readAllowance(allowancePath);
124
- if (!allowance || !allowance.address || !allowance.privateKey)
123
+ const localWallet = readWallet(walletPath);
124
+ if (!localWallet || !localWallet.address || !localWallet.privateKey)
125
125
  return null;
126
126
  const apiBase = getApiBase();
127
127
  const url = new URL(apiBase);
@@ -132,7 +132,7 @@ export function getAllowanceAuthHeaders(path, allowancePath) {
132
132
  const issuedAt = now.toISOString();
133
133
  const expirationTime = new Date(now.getTime() + 5 * 60 * 1000).toISOString();
134
134
  return buildSIWxAuthHeaders({
135
- allowance,
135
+ wallet: localWallet,
136
136
  domain,
137
137
  uri,
138
138
  statement: "Sign in to Run402",
@@ -151,4 +151,4 @@ function messageChainId(chainId) {
151
151
  function payloadChainId(chainId) {
152
152
  return typeof chainId === "number" ? `eip155:${chainId}` : chainId;
153
153
  }
154
- //# sourceMappingURL=allowance-auth.js.map
154
+ //# sourceMappingURL=wallet-auth.js.map
@@ -0,0 +1,22 @@
1
+ export interface WalletData {
2
+ address: string;
3
+ privateKey: string;
4
+ created?: string;
5
+ funded?: boolean;
6
+ lastFaucet?: string;
7
+ rail?: "x402" | "mpp" | "lightning";
8
+ /** The Lightning wallet (`run402 init lightning`): a budgeted wallet on Run402's Hub. `nwc` is the pairing secret. */
9
+ lightning?: WalletLightning;
10
+ }
11
+ export interface WalletLightning {
12
+ wallet_id: string;
13
+ nwc: string;
14
+ lightning_address: string | null;
15
+ budget_sats: number;
16
+ starter_sats: number;
17
+ custody: "run402_hub";
18
+ minted_at: string;
19
+ }
20
+ export declare function readWallet(path?: string): WalletData | null;
21
+ export declare function saveWallet(data: WalletData, path?: string): void;
22
+ //# sourceMappingURL=wallet.d.ts.map
@@ -1,36 +1,36 @@
1
1
  import { readFileSync, writeFileSync, mkdirSync, existsSync, chmodSync, renameSync, statSync } from "node:fs";
2
2
  import { dirname, join } from "node:path";
3
3
  import { randomBytes } from "node:crypto";
4
- import { getAllowancePath } from "./config.js";
4
+ import { getWalletPath } from "./config.js";
5
5
  // 0x-prefixed 40-hex EVM address.
6
6
  const ADDRESS_RE = /^0x[a-fA-F0-9]{40}$/;
7
7
  // 0x-prefixed 64-hex secp256k1 private key (32 bytes).
8
8
  const PRIVATE_KEY_RE = /^0x[a-fA-F0-9]{64}$/;
9
9
  /**
10
- * Load the agent allowance from disk.
10
+ * Load the agent wallet from disk.
11
11
  *
12
- * Returns `null` for the two "no allowance configured" cases:
12
+ * Returns `null` for the two "no local wallet configured" cases:
13
13
  * - the file does not exist
14
14
  * - the file exists but is not parseable JSON (preserve existing UX —
15
- * consumers print "no_allowance" and tell the user to run init)
15
+ * consumers print "no_wallet" and tell the user to run init)
16
16
  *
17
17
  * Throws a structured `Error` when the file parses as JSON but the
18
18
  * shape is wrong (missing/wrong-type/wrong-length fields). Without this guard
19
19
  * downstream callers crash with raw stack traces:
20
- * - `cli/lib/status.mjs` reaches for `allowance.address.toLowerCase()`
20
+ * - `cli/lib/status.mjs` reaches for `wallet.address.toLowerCase()`
21
21
  * and crashes with `TypeError: Cannot read properties of undefined`.
22
- * - `core/src/allowance-auth.ts` passes a malformed `privateKey` to
22
+ * - `core/src/wallet-auth.ts` passes a malformed `privateKey` to
23
23
  * `@noble/curves` which throws "expected 32 bytes, got N".
24
24
  *
25
- * The CLI's `cli/lib/config.mjs:readAllowance()` wrapper and the MCP
25
+ * The CLI's `cli/lib/config.mjs:readWallet()` wrapper and the MCP
26
26
  * `src/tools/{status,init}.ts` callers translate the throw into their own
27
- * structured envelopes (`code: BAD_ALLOWANCE_FILE`).
27
+ * structured envelopes (`code: BAD_WALLET_FILE`).
28
28
  */
29
29
  /**
30
- * If an allowance file is readable by group or other (any of the low 0o077
30
+ * If a wallet file is readable by group or other (any of the low 0o077
31
31
  * bits set), tighten it to 0600 and warn once on stderr. This self-heals the
32
32
  * historical case where a legacy world-readable `wallet.json` (mode 0644) was
33
- * migrated to `allowance.json` via a mode-preserving rename, leaving the
33
+ * migrated to `wallet.json` via a mode-preserving rename, leaving the
34
34
  * private key exposed on a shared machine. Best-effort: POSIX-only and silent
35
35
  * on platforms without meaningful Unix modes (e.g. Windows).
36
36
  */
@@ -48,8 +48,8 @@ function selfHealPermissions(p) {
48
48
  // Best-effort; never block a read on a chmod/stat failure.
49
49
  }
50
50
  }
51
- export function readAllowance(path) {
52
- const p = path ?? getAllowancePath();
51
+ export function readWallet(path) {
52
+ const p = path ?? getWalletPath();
53
53
  if (!existsSync(p))
54
54
  return null;
55
55
  selfHealPermissions(p);
@@ -66,31 +66,31 @@ export function readAllowance(path) {
66
66
  }
67
67
  catch {
68
68
  // Preserve historical UX — completely unparseable input reads as "no
69
- // allowance configured" rather than as an error. Consumers already handle
69
+ // wallet configured" rather than as an error. Consumers already handle
70
70
  // null with a friendly "run 'run402 init'" message.
71
71
  return null;
72
72
  }
73
73
  if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
74
- throw new Error(`allowance.json must contain a JSON object (got ${Array.isArray(parsed) ? "array" : parsed === null ? "null" : typeof parsed}). Back up the file and run 'run402 init' to recreate it.`);
74
+ throw new Error(`wallet.json must contain a JSON object (got ${Array.isArray(parsed) ? "array" : parsed === null ? "null" : typeof parsed}). Back up the file and run 'run402 init' to recreate it.`);
75
75
  }
76
76
  const data = parsed;
77
77
  if (typeof data.address !== "string" || !ADDRESS_RE.test(data.address)) {
78
- throw new Error("allowance.json missing valid 'address' (expected 0x-prefixed 40-hex string). " +
78
+ throw new Error("wallet.json missing valid 'address' (expected 0x-prefixed 40-hex string). " +
79
79
  "Back up the file and run 'run402 init' to recreate it.");
80
80
  }
81
81
  if (typeof data.privateKey !== "string" || !PRIVATE_KEY_RE.test(data.privateKey)) {
82
- throw new Error("allowance.json missing valid 'privateKey' (expected 0x-prefixed 64-hex string). " +
82
+ throw new Error("wallet.json missing valid 'privateKey' (expected 0x-prefixed 64-hex string). " +
83
83
  "Back up the file and run 'run402 init' to recreate it.");
84
84
  }
85
85
  return data;
86
86
  }
87
- export function saveAllowance(data, path) {
88
- const p = path ?? getAllowancePath();
87
+ export function saveWallet(data, path) {
88
+ const p = path ?? getWalletPath();
89
89
  const dir = dirname(p);
90
90
  mkdirSync(dir, { recursive: true });
91
- const tmp = join(dir, `.allowance.${randomBytes(4).toString("hex")}.tmp`);
91
+ const tmp = join(dir, `.wallet.${randomBytes(4).toString("hex")}.tmp`);
92
92
  writeFileSync(tmp, JSON.stringify(data, null, 2), { mode: 0o600 });
93
93
  renameSync(tmp, p);
94
94
  chmodSync(p, 0o600);
95
95
  }
96
- //# sourceMappingURL=allowance.js.map
96
+ //# sourceMappingURL=wallet.js.map
@@ -1,19 +1,20 @@
1
1
  /**
2
- * Cache of **operator-approval** tokens — the passkey-fresh write-auth tokens a
3
- * wallet-less human mints to provision/deploy (gateway v1.85/v1.87). Distinct
4
- * from the control-plane session ({@link ControlPlaneSessionCache}) it pairs
5
- * with: the gateway scopes each token to one `(action, target)`, so this is a
2
+ * Cache of **write approvals** — the passkey-signed, target-scoped tokens a
3
+ * wallet-less person mints with `run402 approve` to provision, deploy, or write
4
+ * secrets from the command line. Distinct from the sign-in session
5
+ * ({@link ControlPlaneSessionCache}) it pairs with, and never a step-up. The
6
+ * gateway scopes each token to one `(action, target)`, so this is a
6
7
  * **multi-entry** cache keyed by `(api_origin, control_plane_session_hash,
7
8
  * action, target)`. An `org.project.create` approval for org Y and a
8
9
  * `project.deploy` approval for project X coexist.
9
10
  *
10
11
  * Stored at the BASE config dir (principal-scoped), mode 0600 — as sensitive as
11
- * the allowance key. The token dies with its control-plane session; the
12
+ * the wallet key. The token dies with its sign-in session; the
12
13
  * `control_plane_session_hash` binding lets the client drop a stale approval
13
- * locally rather than replay it into a `WRITE_AUTH_BINDING_MISMATCH`.
14
+ * locally rather than replay it into a `WRITE_APPROVAL_BINDING_MISMATCH`.
14
15
  */
15
- export interface WriteAuthApproval {
16
- write_auth_token: string;
16
+ export interface WriteApproval {
17
+ write_approval_token: string;
17
18
  token_type: string;
18
19
  header: string;
19
20
  /** Gateway capability: `org.project.create` | `project.deploy` | `project.secret.write`. */
@@ -30,13 +31,14 @@ export interface WriteAuthApproval {
30
31
  amr?: string[];
31
32
  minted_at: number;
32
33
  }
33
- /** The token payload from `POST /agent/v1/control-plane/write-auth/cli/token`. */
34
- export interface WriteAuthTokenResponse {
35
- write_auth_token: string;
34
+ /** The token payload from `POST /agent/v1/control-plane/write-approval/cli/token`. */
35
+ export interface WriteApprovalTokenResponse {
36
+ write_approval_token: string;
36
37
  token_type?: string;
37
38
  header?: string;
38
- /** The write-auth session; its expiry is the token's expiry. */
39
+ /** The write-approval session; its idle expiry is the token's expiry. */
39
40
  session?: {
41
+ idle_expires_at?: string | number;
40
42
  expires_at?: string | number;
41
43
  absolute_expires_at?: string | number;
42
44
  amr?: string[];
@@ -45,15 +47,15 @@ export interface WriteAuthTokenResponse {
45
47
  [k: string]: unknown;
46
48
  }
47
49
  /** A capability target — exactly one of these is set per approval. */
48
- export interface WriteAuthTargetKey {
50
+ export interface WriteApprovalTargetKey {
49
51
  org_id?: string;
50
52
  project_id?: string;
51
53
  }
52
54
  /**
53
- * Path to the approval cache: `{base}/write-auth-session.json`.
54
- * `RUN402_WRITE_AUTH_SESSION_PATH` overrides for testing.
55
+ * Path to the approval cache: `{base}/write-approvals.json`.
56
+ * `RUN402_WRITE_APPROVALS_PATH` overrides for testing.
55
57
  */
56
- export declare function getWriteAuthSessionPath(): string;
58
+ export declare function getWriteApprovalsPath(): string;
57
59
  /** Stable short hash binding an approval to a control-plane session token. */
58
60
  export declare function hashControlPlaneSession(token: string): string;
59
61
  /**
@@ -61,17 +63,17 @@ export declare function hashControlPlaneSession(token: string): string;
61
63
  * unreadable, unparseable). Throws when the file parses as JSON but the shape
62
64
  * is wrong, so a corrupted cache surfaces a clear fix-it.
63
65
  */
64
- export declare function readApprovals(path?: string): WriteAuthApproval[];
66
+ export declare function readApprovals(path?: string): WriteApproval[];
65
67
  /**
66
68
  * Persist an approval. Replaces any existing entry with the same
67
69
  * `(api_origin, control_plane_session_hash, action, target)` key and leaves
68
70
  * every other entry intact (multi-entry, non-thrashing). Atomic, mode 0600.
69
71
  */
70
- export declare function saveApproval(approval: WriteAuthApproval, path?: string): void;
71
- /** Delete the whole approval cache — local half of `operator logout`. Idempotent. */
72
+ export declare function saveApproval(approval: WriteApproval, path?: string): void;
73
+ /** Delete the whole approval cache — local half of `run402 logout`. Idempotent. */
72
74
  export declare function clearApprovals(path?: string): void;
73
75
  /** Whether an approval is past its usable life (with a small skew buffer). */
74
- export declare function isApprovalExpired(approval: WriteAuthApproval, nowMs?: number, skewMs?: number): boolean;
76
+ export declare function isApprovalExpired(approval: WriteApproval, nowMs?: number, skewMs?: number): boolean;
75
77
  /**
76
78
  * Return the cached approval matching ALL of `(apiOrigin, cpSessionHash,
77
79
  * capability, target)` and still live, or `null` if none matches or it is
@@ -82,18 +84,18 @@ export declare function loadLiveApproval(q: {
82
84
  apiOrigin: string;
83
85
  cpSessionHash: string;
84
86
  capability: string;
85
- target: WriteAuthTargetKey;
86
- }, path?: string, nowMs?: number): WriteAuthApproval | null;
87
+ target: WriteApprovalTargetKey;
88
+ }, path?: string, nowMs?: number): WriteApproval | null;
87
89
  /**
88
90
  * Build a cache entry from the gateway token response + the binding context
89
91
  * (the cp-session it was minted under, the API origin, and the `(action,
90
92
  * target)` it covers). Expiry is taken from the returned `session`.
91
93
  */
92
- export declare function approvalFromTokenResponse(resp: WriteAuthTokenResponse, binding: {
94
+ export declare function approvalFromTokenResponse(resp: WriteApprovalTokenResponse, binding: {
93
95
  action: string;
94
- target: WriteAuthTargetKey;
96
+ target: WriteApprovalTargetKey;
95
97
  apiOrigin: string;
96
98
  controlPlaneSessionHash: string;
97
99
  controlPlanePrincipalId: string;
98
- }, nowMs?: number): WriteAuthApproval;
99
- //# sourceMappingURL=write-auth-session.d.ts.map
100
+ }, nowMs?: number): WriteApproval;
101
+ //# sourceMappingURL=write-approvals.d.ts.map
@@ -4,12 +4,12 @@ import { randomBytes, createHash } from "node:crypto";
4
4
  import { getConfigBaseDir } from "./config.js";
5
5
  const DEFAULT_TTL_MS = 30 * 60 * 1000;
6
6
  /**
7
- * Path to the approval cache: `{base}/write-auth-session.json`.
8
- * `RUN402_WRITE_AUTH_SESSION_PATH` overrides for testing.
7
+ * Path to the approval cache: `{base}/write-approvals.json`.
8
+ * `RUN402_WRITE_APPROVALS_PATH` overrides for testing.
9
9
  */
10
- export function getWriteAuthSessionPath() {
11
- return (process.env.RUN402_WRITE_AUTH_SESSION_PATH ||
12
- join(getConfigBaseDir(), "write-auth-session.json"));
10
+ export function getWriteApprovalsPath() {
11
+ return (process.env.RUN402_WRITE_APPROVALS_PATH ||
12
+ join(getConfigBaseDir(), "write-approvals.json"));
13
13
  }
14
14
  /** Stable short hash binding an approval to a control-plane session token. */
15
15
  export function hashControlPlaneSession(token) {
@@ -34,8 +34,8 @@ function isApproval(x) {
34
34
  if (!x || typeof x !== "object")
35
35
  return false;
36
36
  const a = x;
37
- return (typeof a.write_auth_token === "string" &&
38
- a.write_auth_token.length > 0 &&
37
+ return (typeof a.write_approval_token === "string" &&
38
+ a.write_approval_token.length > 0 &&
39
39
  typeof a.action === "string" &&
40
40
  typeof a.api_origin === "string" &&
41
41
  typeof a.control_plane_session_hash === "string" &&
@@ -48,7 +48,7 @@ function isApproval(x) {
48
48
  * is wrong, so a corrupted cache surfaces a clear fix-it.
49
49
  */
50
50
  export function readApprovals(path) {
51
- const p = path ?? getWriteAuthSessionPath();
51
+ const p = path ?? getWriteApprovalsPath();
52
52
  if (!existsSync(p))
53
53
  return [];
54
54
  selfHealPermissions(p);
@@ -67,19 +67,19 @@ export function readApprovals(path) {
67
67
  return [];
68
68
  }
69
69
  if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
70
- throw new Error("write-auth-session.json must contain a JSON object. Delete it and re-run 'run402 operator approve' to recreate it.");
70
+ throw new Error("write-approvals.json must contain a JSON object. Delete it and re-run 'run402 approve' to recreate it.");
71
71
  }
72
72
  const approvals = parsed.approvals;
73
73
  if (!Array.isArray(approvals)) {
74
- throw new Error("write-auth-session.json missing an 'approvals' array. Delete it and re-run 'run402 operator approve'.");
74
+ throw new Error("write-approvals.json missing an 'approvals' array. Delete it and re-run 'run402 approve'.");
75
75
  }
76
76
  return approvals.filter(isApproval);
77
77
  }
78
78
  function writeApprovals(approvals, path) {
79
- const p = path ?? getWriteAuthSessionPath();
79
+ const p = path ?? getWriteApprovalsPath();
80
80
  const dir = dirname(p);
81
81
  mkdirSync(dir, { recursive: true });
82
- const tmp = join(dir, `.write-auth-session.${randomBytes(4).toString("hex")}.tmp`);
82
+ const tmp = join(dir, `.write-approvals.${randomBytes(4).toString("hex")}.tmp`);
83
83
  writeFileSync(tmp, JSON.stringify({ approvals }, null, 2), { mode: 0o600 });
84
84
  renameSync(tmp, p);
85
85
  chmodSync(p, 0o600);
@@ -103,9 +103,9 @@ export function saveApproval(approval, path) {
103
103
  existing.push(approval);
104
104
  writeApprovals(existing, path);
105
105
  }
106
- /** Delete the whole approval cache — local half of `operator logout`. Idempotent. */
106
+ /** Delete the whole approval cache — local half of `run402 logout`. Idempotent. */
107
107
  export function clearApprovals(path) {
108
- const p = path ?? getWriteAuthSessionPath();
108
+ const p = path ?? getWriteApprovalsPath();
109
109
  try {
110
110
  rmSync(p, { force: true });
111
111
  }
@@ -137,7 +137,7 @@ export function loadLiveApproval(q, path, nowMs = Date.now()) {
137
137
  }
138
138
  /** Parse a gateway-returned session expiry (ISO string or epoch) to epoch ms. */
139
139
  function sessionExpiryMs(session, nowMs) {
140
- const raw = session?.expires_at ?? session?.absolute_expires_at;
140
+ const raw = session?.idle_expires_at ?? session?.expires_at ?? session?.absolute_expires_at;
141
141
  if (typeof raw === "number" && Number.isFinite(raw))
142
142
  return raw > 1e12 ? raw : raw * 1000;
143
143
  if (typeof raw === "string") {
@@ -157,9 +157,9 @@ export function approvalFromTokenResponse(resp, binding, nowMs = Date.now()) {
157
157
  ? resp.session.amr.filter((a) => typeof a === "string")
158
158
  : undefined;
159
159
  return {
160
- write_auth_token: resp.write_auth_token,
161
- token_type: typeof resp.token_type === "string" ? resp.token_type : "write_auth",
162
- header: typeof resp.header === "string" ? resp.header : "X-Run402-Write-Auth",
160
+ write_approval_token: resp.write_approval_token,
161
+ token_type: typeof resp.token_type === "string" ? resp.token_type : "write_approval",
162
+ header: typeof resp.header === "string" ? resp.header : "X-Run402-Write-Approval",
163
163
  action: binding.action,
164
164
  ...(binding.target.org_id ? { org_id: binding.target.org_id } : {}),
165
165
  ...(binding.target.project_id ? { project_id: binding.target.project_id } : {}),
@@ -171,4 +171,4 @@ export function approvalFromTokenResponse(resp, binding, nowMs = Date.now()) {
171
171
  minted_at: nowMs,
172
172
  };
173
173
  }
174
- //# sourceMappingURL=write-auth-session.js.map
174
+ //# sourceMappingURL=write-approvals.js.map
package/dist/actions.d.ts CHANGED
@@ -130,7 +130,7 @@ export interface Run402ActionApprovalRequest {
130
130
  message: string;
131
131
  mutations: Run402ActionMutation[];
132
132
  }
133
- export type Run402ActionMutation = "allowance.create" | "allowance.faucet" | "tier.set" | "projects.provision" | "workspace.link.write" | "app.source.resolve" | "app.install" | "app.mailbox.ensure" | "app.secret.ensure" | "app.build" | "app.webhook.ensure" | "app.verify" | "identity.name.set" | "deploy.apply";
133
+ export type Run402ActionMutation = "wallets.create" | "wallets.faucet" | "tier.set" | "projects.provision" | "workspace.link.write" | "app.source.resolve" | "app.install" | "app.mailbox.ensure" | "app.secret.ensure" | "app.build" | "app.webhook.ensure" | "app.verify" | "identity.name.set" | "deploy.apply";
134
134
  export interface Run402ActionRunOptions {
135
135
  /**
136
136
  * Canonical execution mode for typed-config workflows.
@@ -1 +1 @@
1
- {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../src/actions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC5F,OAAO,KAAK,EACV,qBAAqB,EACrB,qBAAqB,EACrB,0BAA0B,EAC1B,yBAAyB,EACzB,uBAAuB,EACxB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEvD;;;GAGG;AACH,eAAO,MAAM,YAAY;;;;CAIf,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAC1B,OAAO,YAAY,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAEjD,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC;AAE3C,MAAM,MAAM,iBAAiB,GACzB,kCAAkC,GAClC,wBAAwB,GACxB,mBAAmB,CAAC;AAExB,MAAM,WAAW,kCAAkC;IACjD,IAAI,EAAE,OAAO,YAAY,CAAC,iBAAiB,CAAC;IAC5C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,mBAAmB,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,OAAO,YAAY,CAAC,OAAO,CAAC;IAClC,IAAI,EAAE,mBAAmB,CAAC;IA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kBAAkB,CAAC,aAAa,CAAC,CAAC;AAEpC,MAAM,MAAM,oBAAoB,GAC9B,kBAAkB,CAAC,cAAc,CAAC,CAAC;AAErC,MAAM,WAAW,aAAa;IAC5B,GAAG,CACD,KAAK,EAAE,kCAAkC,EACzC,IAAI,CAAC,EAAE,sBAAsB,GAC5B,OAAO,CAAC,mCAAmC,CAAC,CAAC;IAChD,GAAG,CACD,KAAK,EAAE,wBAAwB,EAC/B,IAAI,CAAC,EAAE,sBAAsB,GAC5B,OAAO,CAAC,yBAAyB,CAAC,CAAC;IACtC,GAAG,CACD,KAAK,EAAE,mBAAmB,EAC1B,IAAI,CAAC,EAAE,sBAAsB,GAC5B,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACjC,GAAG,CAAC,KAAK,EAAE,iBAAiB,EAAE,IAAI,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;CAC3F"}
@@ -1,11 +1,11 @@
1
1
  /**
2
- * Control-plane **session** credential provider (gateway v1.78). Carries a
3
- * write-capable `control_plane_session` bearer so the whole SDK authenticates as
4
- * the human principal — the token is "accepted everywhere a SIWX wallet is", so
5
- * `r.org.*`, `r.admin.transfers.*`, and `r.operator.session.*` all act as that
6
- * principal.
2
+ * **Sign-in session** credential provider (gateway v1.78). Carries a
3
+ * `control_plane_session` bearer so the whole SDK authenticates as the person's
4
+ * principal — the token is accepted everywhere a SIWX wallet is, so `r.org.*`,
5
+ * `r.admin.transfers.*`, and `r.session.*` all act as that principal. A
6
+ * `device`-grade session is read-only (`SESSION_READ_ONLY` on every mutation).
7
7
  *
8
- * Isomorphic — no Node APIs. Mint a session with `r.operator.session.verifyEmail`
8
+ * Isomorphic — no Node APIs. Mint a session with `r.session.verifyEmail`
9
9
  * / `passkeyVerify` / the loopback-PKCE `exchangeCliToken`, then:
10
10
  *
11
11
  * const r = run402({ credentials: controlPlaneSessionCredentials({ token }) });
@@ -13,7 +13,7 @@
13
13
  *
14
14
  * High-stakes writes still require a fresh passkey — an `email`/`oauth` session
15
15
  * gets {@link StepUpRequiredError}; run the step-up ceremony
16
- * (`r.operator.session.stepUpOptions`/`stepUpVerify`) and retry.
16
+ * (`r.session.stepUpOptions`/`stepUpVerify`) and retry.
17
17
  *
18
18
  * This credential authenticates control-plane operations only; it carries no
19
19
  * project anon/service keys, so {@link CredentialsProvider.getProject} returns
@@ -30,7 +30,7 @@ export interface ControlPlaneSessionCredentialsOptions {
30
30
  token?: string;
31
31
  /**
32
32
  * Lazily resolve the current token (e.g. read a cache, or rotate via
33
- * `r.operator.session.refresh`). Called before every authenticated request.
33
+ * `r.session.refresh`). Called before every authenticated request.
34
34
  */
35
35
  getToken?: () => string | Promise<string>;
36
36
  }
@@ -1,11 +1,11 @@
1
1
  /**
2
- * Control-plane **session** credential provider (gateway v1.78). Carries a
3
- * write-capable `control_plane_session` bearer so the whole SDK authenticates as
4
- * the human principal — the token is "accepted everywhere a SIWX wallet is", so
5
- * `r.org.*`, `r.admin.transfers.*`, and `r.operator.session.*` all act as that
6
- * principal.
2
+ * **Sign-in session** credential provider (gateway v1.78). Carries a
3
+ * `control_plane_session` bearer so the whole SDK authenticates as the person's
4
+ * principal — the token is accepted everywhere a SIWX wallet is, so `r.org.*`,
5
+ * `r.admin.transfers.*`, and `r.session.*` all act as that principal. A
6
+ * `device`-grade session is read-only (`SESSION_READ_ONLY` on every mutation).
7
7
  *
8
- * Isomorphic — no Node APIs. Mint a session with `r.operator.session.verifyEmail`
8
+ * Isomorphic — no Node APIs. Mint a session with `r.session.verifyEmail`
9
9
  * / `passkeyVerify` / the loopback-PKCE `exchangeCliToken`, then:
10
10
  *
11
11
  * const r = run402({ credentials: controlPlaneSessionCredentials({ token }) });
@@ -13,7 +13,7 @@
13
13
  *
14
14
  * High-stakes writes still require a fresh passkey — an `email`/`oauth` session
15
15
  * gets {@link StepUpRequiredError}; run the step-up ceremony
16
- * (`r.operator.session.stepUpOptions`/`stepUpVerify`) and retry.
16
+ * (`r.session.stepUpOptions`/`stepUpVerify`) and retry.
17
17
  *
18
18
  * This credential authenticates control-plane operations only; it carries no
19
19
  * project anon/service keys, so {@link CredentialsProvider.getProject} returns
@@ -7,7 +7,7 @@
7
7
  * lives inside provider implementations — never in the kernel.
8
8
  *
9
9
  * Node consumers use {@link NodeCredentialsProvider} from `@run402/sdk/node`
10
- * which wraps the local keystore + allowance. Sandbox consumers supply their
10
+ * which wraps the local keystore + wallet. Sandbox consumers supply their
11
11
  * own implementation bound to a session token issued by the supervisor.
12
12
  *
13
13
  * The two required methods (`getAuth`, `getProjectCredentials`) support every API call.
@@ -31,14 +31,14 @@ export interface ProjectCredentialCacheInfo {
31
31
  wallet?: string;
32
32
  profile?: string;
33
33
  }
34
- export interface AllowanceData {
34
+ export interface WalletData {
35
35
  address: string;
36
36
  privateKey: string;
37
37
  created?: string;
38
38
  funded?: boolean;
39
39
  lastFaucet?: string;
40
40
  rail?: "x402" | "mpp" | "lightning";
41
- /** The Lightning allowance: a budgeted wallet on Run402's Hub; `nwc` is the pairing secret and never leaves the machine. */
41
+ /** The Lightning wallet: a budgeted wallet on Run402's Hub; `nwc` is the pairing secret and never leaves the machine. */
42
42
  lightning?: {
43
43
  wallet_id: string;
44
44
  nwc: string;
@@ -60,27 +60,27 @@ export interface WalletIdentity {
60
60
  label: string | null;
61
61
  }
62
62
  /**
63
- * Gateway write-auth (operator-approval) capabilities. Each is scoped to a
64
- * target: `org.project.create` → an org, the others → a project.
63
+ * Gateway write-approval capabilities. Each is scoped to a target:
64
+ * `org.project.create` → an org, the others → a project.
65
65
  */
66
- export type WriteAuthCapability = "org.project.create" | "project.deploy" | "project.secret.write" | "project.archives.export" | "project.snapshots.manage" | "project.branches.manage";
66
+ export type WriteApprovalCapability = "org.project.create" | "project.deploy" | "project.secret.write" | "project.archives.export" | "project.snapshots.manage" | "project.branches.manage";
67
67
  /** A write-capability target: an org (for `org.project.create`) or a project. */
68
- export interface WriteAuthTarget {
68
+ export interface WriteApprovalTarget {
69
69
  org_id?: string;
70
70
  project_id?: string;
71
71
  }
72
72
  /**
73
73
  * Per-request metadata a typed SDK method may pass to {@link
74
74
  * CredentialsProvider.getAuth}. `capability` + `target` let a provider decide
75
- * whether (and which) operator-approval credential to attach for a gated write.
75
+ * whether (and which) write approval to attach for a gated write.
76
76
  */
77
77
  export interface AuthRequestMeta {
78
78
  /** Diagnostic: the SDK method name (e.g. "projects.provision"). */
79
79
  method?: string;
80
80
  /** The gateway write capability this request exercises, if any. */
81
- capability?: WriteAuthCapability;
81
+ capability?: WriteApprovalCapability;
82
82
  /** The capability's target. */
83
- target?: WriteAuthTarget;
83
+ target?: WriteApprovalTarget;
84
84
  }
85
85
  export interface CredentialsProvider {
86
86
  /** Sign exact UTF-8 bytes as an EIP-191 personal message without exposing key material. */
@@ -95,7 +95,7 @@ export interface CredentialsProvider {
95
95
  * overwriting headers explicitly set on the request.
96
96
  *
97
97
  * `metadata` (optional) carries the request's write capability + target so a
98
- * provider can attach a matching operator-approval credential. Providers that
98
+ * provider can attach a matching write approval. Providers that
99
99
  * ignore it (wallet-only) simply omit the parameter.
100
100
  */
101
101
  getAuth(path: string, metadata?: AuthRequestMeta): Promise<Record<string, string> | null>;
@@ -133,14 +133,14 @@ export interface CredentialsProvider {
133
133
  * is never sent unprompted and never an authorization input.
134
134
  */
135
135
  getActiveOrg?(): Promise<string | null>;
136
- /** Read the local allowance (wallet). Optional — sandbox providers may omit. */
137
- readAllowance?(): Promise<AllowanceData | null>;
138
- /** Persist the local allowance. Optional. */
139
- saveAllowance?(data: AllowanceData): Promise<void>;
140
- /** Generate a fresh allowance keypair. Optional — Node default uses secp256k1 + keccak for the Ethereum address. */
141
- createAllowance?(): Promise<AllowanceData>;
142
- /** Return the absolute path to the local allowance file, for diagnostic output. Optional. */
143
- getAllowancePath?(): string;
136
+ /** Read the local wallet (wallet). Optional — sandbox providers may omit. */
137
+ readWallet?(): Promise<WalletData | null>;
138
+ /** Persist the local wallet. Optional. */
139
+ saveWallet?(data: WalletData): Promise<void>;
140
+ /** Generate a fresh wallet keypair. Optional — Node default uses secp256k1 + keccak for the Ethereum address. */
141
+ createWallet?(): Promise<WalletData>;
142
+ /** Return the absolute path to the local wallet file, for diagnostic output. Optional. */
143
+ getWalletPath?(): string;
144
144
  /** Return safe provenance for the local project credential cache. Optional. */
145
145
  getProjectCredentialCacheInfo?(): ProjectCredentialCacheInfo;
146
146
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,aAAa,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,WAAW,CAAC;IACpC,4HAA4H;IAC5H,SAAS,CAAC,EAAE;QACV,SAAS,EAAE,MAAM,CAAC;QAClB,GAAG,EAAE,MAAM,CAAC;QACZ,iBAAiB,EAAE,MAAM,GAAG,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