run402-mcp 2.49.0 → 3.1.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 (105) hide show
  1. package/README.md +5 -5
  2. package/core/dist/control-plane-session.d.ts +10 -7
  3. package/core/dist/control-plane-session.d.ts.map +1 -1
  4. package/core/dist/control-plane-session.js.map +1 -1
  5. package/core/dist/write-auth-session.d.ts +99 -0
  6. package/core/dist/write-auth-session.d.ts.map +1 -0
  7. package/core/dist/write-auth-session.js +174 -0
  8. package/core/dist/write-auth-session.js.map +1 -0
  9. package/dist/index.js +15 -15
  10. package/dist/index.js.map +1 -1
  11. package/dist/sdk.d.ts.map +1 -1
  12. package/dist/sdk.js +3 -1
  13. package/dist/sdk.js.map +1 -1
  14. package/dist/tools/contract-call.d.ts +2 -2
  15. package/dist/tools/contract-call.js +2 -2
  16. package/dist/tools/contract-call.js.map +1 -1
  17. package/dist/tools/contract-deploy.d.ts +2 -2
  18. package/dist/tools/contract-deploy.js +4 -4
  19. package/dist/tools/contract-deploy.js.map +1 -1
  20. package/dist/tools/delete-signer.d.ts +16 -0
  21. package/dist/tools/delete-signer.d.ts.map +1 -0
  22. package/dist/tools/delete-signer.js +17 -0
  23. package/dist/tools/delete-signer.js.map +1 -0
  24. package/dist/tools/{drain-contract-wallet.d.ts → drain-signer.d.ts} +5 -5
  25. package/dist/tools/drain-signer.d.ts.map +1 -0
  26. package/dist/tools/{drain-contract-wallet.js → drain-signer.js} +7 -7
  27. package/dist/tools/drain-signer.js.map +1 -0
  28. package/dist/tools/get-signer.d.ts +16 -0
  29. package/dist/tools/get-signer.d.ts.map +1 -0
  30. package/dist/tools/get-signer.js +17 -0
  31. package/dist/tools/get-signer.js.map +1 -0
  32. package/dist/tools/{list-contract-wallets.d.ts → list-signers.d.ts} +3 -3
  33. package/dist/tools/list-signers.d.ts.map +1 -0
  34. package/dist/tools/{list-contract-wallets.js → list-signers.js} +5 -5
  35. package/dist/tools/list-signers.js.map +1 -0
  36. package/dist/tools/{provision-contract-wallet.d.ts → provision-signer.d.ts} +3 -3
  37. package/dist/tools/provision-signer.d.ts.map +1 -0
  38. package/dist/tools/provision-signer.js +21 -0
  39. package/dist/tools/provision-signer.js.map +1 -0
  40. package/dist/tools/set-low-balance-alert.d.ts +2 -2
  41. package/dist/tools/set-low-balance-alert.js +2 -2
  42. package/dist/tools/set-low-balance-alert.js.map +1 -1
  43. package/dist/tools/set-recovery-address.d.ts +2 -2
  44. package/dist/tools/set-recovery-address.js +2 -2
  45. package/dist/tools/set-recovery-address.js.map +1 -1
  46. package/package.json +1 -1
  47. package/sdk/README.md +1 -1
  48. package/sdk/core-dist/control-plane-session.d.ts +10 -7
  49. package/sdk/core-dist/write-auth-session.d.ts +99 -0
  50. package/sdk/core-dist/write-auth-session.js +174 -0
  51. package/sdk/dist/credentials.d.ts +28 -1
  52. package/sdk/dist/credentials.d.ts.map +1 -1
  53. package/sdk/dist/errors.d.ts +43 -1
  54. package/sdk/dist/errors.d.ts.map +1 -1
  55. package/sdk/dist/errors.js +71 -0
  56. package/sdk/dist/errors.js.map +1 -1
  57. package/sdk/dist/index.d.ts +1 -1
  58. package/sdk/dist/index.d.ts.map +1 -1
  59. package/sdk/dist/index.js +1 -1
  60. package/sdk/dist/index.js.map +1 -1
  61. package/sdk/dist/kernel.d.ts +3 -1
  62. package/sdk/dist/kernel.d.ts.map +1 -1
  63. package/sdk/dist/kernel.js +35 -4
  64. package/sdk/dist/kernel.js.map +1 -1
  65. package/sdk/dist/namespaces/contracts.d.ts +38 -38
  66. package/sdk/dist/namespaces/contracts.d.ts.map +1 -1
  67. package/sdk/dist/namespaces/contracts.js +44 -44
  68. package/sdk/dist/namespaces/contracts.js.map +1 -1
  69. package/sdk/dist/namespaces/deploy.d.ts.map +1 -1
  70. package/sdk/dist/namespaces/deploy.js +16 -4
  71. package/sdk/dist/namespaces/deploy.js.map +1 -1
  72. package/sdk/dist/namespaces/operator.d.ts +86 -3
  73. package/sdk/dist/namespaces/operator.d.ts.map +1 -1
  74. package/sdk/dist/namespaces/operator.js +55 -0
  75. package/sdk/dist/namespaces/operator.js.map +1 -1
  76. package/sdk/dist/namespaces/projects.d.ts.map +1 -1
  77. package/sdk/dist/namespaces/projects.js +11 -0
  78. package/sdk/dist/namespaces/projects.js.map +1 -1
  79. package/sdk/dist/namespaces/transfers.d.ts +3 -3
  80. package/sdk/dist/namespaces/transfers.d.ts.map +1 -1
  81. package/sdk/dist/node/credentials.d.ts +32 -6
  82. package/sdk/dist/node/credentials.d.ts.map +1 -1
  83. package/sdk/dist/node/credentials.js +57 -4
  84. package/sdk/dist/node/credentials.js.map +1 -1
  85. package/sdk/dist/node/index.d.ts +11 -1
  86. package/sdk/dist/node/index.d.ts.map +1 -1
  87. package/sdk/dist/node/index.js +3 -1
  88. package/sdk/dist/node/index.js.map +1 -1
  89. package/sdk/dist/scoped.d.ts +8 -8
  90. package/sdk/dist/scoped.js +14 -14
  91. package/dist/tools/delete-contract-wallet.d.ts +0 -16
  92. package/dist/tools/delete-contract-wallet.d.ts.map +0 -1
  93. package/dist/tools/delete-contract-wallet.js +0 -17
  94. package/dist/tools/delete-contract-wallet.js.map +0 -1
  95. package/dist/tools/drain-contract-wallet.d.ts.map +0 -1
  96. package/dist/tools/drain-contract-wallet.js.map +0 -1
  97. package/dist/tools/get-contract-wallet.d.ts +0 -16
  98. package/dist/tools/get-contract-wallet.d.ts.map +0 -1
  99. package/dist/tools/get-contract-wallet.js +0 -17
  100. package/dist/tools/get-contract-wallet.js.map +0 -1
  101. package/dist/tools/list-contract-wallets.d.ts.map +0 -1
  102. package/dist/tools/list-contract-wallets.js.map +0 -1
  103. package/dist/tools/provision-contract-wallet.d.ts.map +0 -1
  104. package/dist/tools/provision-contract-wallet.js +0 -21
  105. package/dist/tools/provision-contract-wallet.js.map +0 -1
@@ -3,7 +3,7 @@ import { getSdk } from "../sdk.js";
3
3
  import { mapSdkError } from "../errors.js";
4
4
  export const contractCallSchema = {
5
5
  project_id: z.string().describe("The project ID"),
6
- wallet_id: z.string().describe("The KMS contract wallet ID"),
6
+ signer_id: z.string().describe("The KMS signer ID"),
7
7
  chain: z.enum(["base-mainnet", "base-sepolia"]).describe("EVM chain"),
8
8
  contract_address: z.string().describe("0x-prefixed contract address"),
9
9
  abi_fragment: z.array(z.unknown()).describe("ABI fragment containing the function definition"),
@@ -15,7 +15,7 @@ export const contractCallSchema = {
15
15
  export async function handleContractCall(args) {
16
16
  try {
17
17
  const body = await getSdk().contracts.call(args.project_id, {
18
- walletId: args.wallet_id,
18
+ signerId: args.signer_id,
19
19
  chain: args.chain,
20
20
  contractAddress: args.contract_address,
21
21
  abiFragment: args.abi_fragment,
@@ -1 +1 @@
1
- {"version":3,"file":"contract-call.js","sourceRoot":"","sources":["../../src/tools/contract-call.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;IACjD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4BAA4B,CAAC;IAC5D,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC;IACrE,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8BAA8B,CAAC;IACrE,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,CAAC,iDAAiD,CAAC;IAC9F,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC;IAC7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AgB;YACtC,WAAW,EAAE,IAAI,CAAC,YAAY;YAC9B,YAAY,EAAE,IAAI,CAAC,aAAa;YAChC,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,cAAc,EAAE,IAAI,CAAC,eAAe;SACrC,CAAC,CAAC;QACH,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,yCAAyC,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,+DAA+D,EAAE,CAAC,EAAE,CAAC;IAC5L,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,WAAW,CAAC,GAAG,EAAE,0BAA0B,CAAC,CAAC;IACtD,CAAC;AACH,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { z } from "zod";
2
2
  export declare const contractDeploySchema: {
3
3
  project_id: z.ZodString;
4
- wallet_id: z.ZodString;
4
+ signer_id: z.ZodString;
5
5
  chain: z.ZodEnum<["base-mainnet", "base-sepolia"]>;
6
6
  bytecode: z.ZodString;
7
7
  value: z.ZodOptional<z.ZodString>;
@@ -9,7 +9,7 @@ export declare const contractDeploySchema: {
9
9
  };
10
10
  export declare function handleContractDeploy(args: {
11
11
  project_id: string;
12
- wallet_id: string;
12
+ signer_id: string;
13
13
  chain: "base-mainnet" | "base-sepolia";
14
14
  bytecode: string;
15
15
  value?: string;
@@ -3,8 +3,8 @@ import { getSdk } from "../sdk.js";
3
3
  import { mapSdkError } from "../errors.js";
4
4
  export const contractDeploySchema = {
5
5
  project_id: z.string().describe("The project ID"),
6
- wallet_id: z.string().describe("The KMS contract wallet ID (cwlt_...) that will sign + own the new contract"),
7
- chain: z.enum(["base-mainnet", "base-sepolia"]).describe("EVM chain (must match the wallet's chain)"),
6
+ signer_id: z.string().describe("The KMS signer ID (cwlt_...) that will sign + own the new contract"),
7
+ chain: z.enum(["base-mainnet", "base-sepolia"]).describe("EVM chain (must match the signer's chain)"),
8
8
  bytecode: z.string().describe("Full creation calldata as 0x-prefixed hex (creation bytecode + ABI-encoded constructor args, concatenated client-side). Non-empty, even-length, ≤ 128 KB. run402 does NOT compile Solidity."),
9
9
  value: z.string().optional().describe("Optional native-token value in wei to attach to the deploy (decimal string)"),
10
10
  idempotency_key: z.string().optional().describe("Optional idempotency key — same key + same bytecode returns same call_id without re-broadcasting"),
@@ -12,7 +12,7 @@ export const contractDeploySchema = {
12
12
  export async function handleContractDeploy(args) {
13
13
  try {
14
14
  const body = await getSdk().contracts.deploy(args.project_id, {
15
- walletId: args.wallet_id,
15
+ signerId: args.signer_id,
16
16
  chain: args.chain,
17
17
  bytecode: args.bytecode,
18
18
  value: args.value,
@@ -23,7 +23,7 @@ export async function handleContractDeploy(args) {
23
23
  type: "text",
24
24
  text: "## Contract Deploy Submitted\n\n" +
25
25
  "```json\n" + JSON.stringify(body, null, 2) + "\n```\n\n" +
26
- "**Deployed contract address (deterministic CREATE)**: `" + body.contract_address + "` — returned synchronously from `(wallet.address, nonce)`. Verified against the on-chain receipt on confirmation.\n\n" +
26
+ "**Deployed contract address (deterministic CREATE)**: `" + body.contract_address + "` — returned synchronously from `(signer.address, nonce)`. Verified against the on-chain receipt on confirmation.\n\n" +
27
27
  "**Cost**: chain gas at-cost + $0.000005 KMS sign fee (same as `contract_call`).\n\n" +
28
28
  "Poll `get_contract_call_status` with `call_id` to confirm. On `status: confirmed`, the deployed contract is callable via `contract_call` at the address above.",
29
29
  }],
@@ -1 +1 @@
1
- {"version":3,"file":"contract-deploy.js","sourceRoot":"","sources":["../../src/tools/contract-deploy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,UAAU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,CAAC,eAAe;SACrC,CAAC,CAAC;QACH,OAAO;YACL,OAAO,EAAE,CAAC;oBACR,IAAI,EAAE,MAAM;oBACZ,IAAI,EACF,kCAAkC;wBAClC,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,WAAW;wBACzD,yDAAyD,GAAG,IAAI,CAAC,gBAAgB,GAAG,uHAAuH;wBAC3M,qFAAqF;wBACrF,gKAAgK;iBACnK,CAAC;SACH,CAAC;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,WAAW,CAAC,GAAG,EAAE,oBAAoB,CAAC,CAAC;IAChD,CAAC;AACH,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { z } from "zod";
2
+ export declare const deleteSignerSchema: {
3
+ project_id: z.ZodString;
4
+ signer_id: z.ZodString;
5
+ };
6
+ export declare function handleDeleteSigner(args: {
7
+ project_id: string;
8
+ signer_id: string;
9
+ }): Promise<{
10
+ content: Array<{
11
+ type: "text";
12
+ text: string;
13
+ }>;
14
+ isError?: boolean;
15
+ }>;
16
+ //# sourceMappingURL=delete-signer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete-signer.d.ts","sourceRoot":"","sources":["../../src/tools/delete-signer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,kBAAkB;;;CAG9B,CAAC;AAEF,wBAAsB,kBAAkB,CAAC,IAAI,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAOxK"}
@@ -0,0 +1,17 @@
1
+ import { z } from "zod";
2
+ import { getSdk } from "../sdk.js";
3
+ import { mapSdkError } from "../errors.js";
4
+ export const deleteSignerSchema = {
5
+ project_id: z.string().describe("The project ID"),
6
+ signer_id: z.string().describe("The KMS signer ID. Schedules KMS key deletion (7-day window). Refused if balance >= dust — drain first."),
7
+ };
8
+ export async function handleDeleteSigner(args) {
9
+ try {
10
+ const body = await getSdk().contracts.deleteSigner(args.project_id, args.signer_id);
11
+ return { content: [{ type: "text", text: "## Signer Deleted\n\n```json\n" + JSON.stringify(body, null, 2) + "\n```" }] };
12
+ }
13
+ catch (err) {
14
+ return mapSdkError(err, "deleting signer");
15
+ }
16
+ }
17
+ //# sourceMappingURL=delete-signer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete-signer.js","sourceRoot":"","sources":["../../src/tools/delete-signer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;IACjD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,yGAAyG,CAAC;CAC1I,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,IAA+C;IACtF,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,MAAM,EAAE,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QACpF,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,gCAAgC,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,OAAO,EAAE,CAAC,EAAE,CAAC;IAC3H,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,WAAW,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC;IAC7C,CAAC;AACH,CAAC"}
@@ -1,12 +1,12 @@
1
1
  import { z } from "zod";
2
- export declare const drainContractWalletSchema: {
2
+ export declare const drainSignerSchema: {
3
3
  project_id: z.ZodString;
4
- wallet_id: z.ZodString;
4
+ signer_id: z.ZodString;
5
5
  destination_address: z.ZodString;
6
6
  };
7
- export declare function handleDrainContractWallet(args: {
7
+ export declare function handleDrainSigner(args: {
8
8
  project_id: string;
9
- wallet_id: string;
9
+ signer_id: string;
10
10
  destination_address: string;
11
11
  }): Promise<{
12
12
  content: Array<{
@@ -15,4 +15,4 @@ export declare function handleDrainContractWallet(args: {
15
15
  }>;
16
16
  isError?: boolean;
17
17
  }>;
18
- //# sourceMappingURL=drain-contract-wallet.d.ts.map
18
+ //# sourceMappingURL=drain-signer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drain-signer.d.ts","sourceRoot":"","sources":["../../src/tools/drain-signer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,iBAAiB;;;;CAI7B,CAAC;AAEF,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,mBAAmB,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAOpM"}
@@ -1,18 +1,18 @@
1
1
  import { z } from "zod";
2
2
  import { getSdk } from "../sdk.js";
3
3
  import { mapSdkError } from "../errors.js";
4
- export const drainContractWalletSchema = {
4
+ export const drainSignerSchema = {
5
5
  project_id: z.string().describe("The project ID"),
6
- wallet_id: z.string().describe("The KMS contract wallet ID"),
7
- destination_address: z.string().describe("Where to send the entire native-token balance. Cost: chain gas + $0.000005 KMS sign fee. Works on suspended wallets."),
6
+ signer_id: z.string().describe("The KMS signer ID"),
7
+ destination_address: z.string().describe("Where to send the entire native-token balance. Cost: chain gas + $0.000005 KMS sign fee. Works on suspended signers."),
8
8
  };
9
- export async function handleDrainContractWallet(args) {
9
+ export async function handleDrainSigner(args) {
10
10
  try {
11
- const body = await getSdk().contracts.drain(args.project_id, args.wallet_id, args.destination_address);
11
+ const body = await getSdk().contracts.drain(args.project_id, args.signer_id, args.destination_address);
12
12
  return { content: [{ type: "text", text: "## Drain Submitted\n\n```json\n" + JSON.stringify(body, null, 2) + "\n```" }] };
13
13
  }
14
14
  catch (err) {
15
- return mapSdkError(err, "draining wallet");
15
+ return mapSdkError(err, "draining signer");
16
16
  }
17
17
  }
18
- //# sourceMappingURL=drain-contract-wallet.js.map
18
+ //# sourceMappingURL=drain-signer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drain-signer.js","sourceRoot":"","sources":["../../src/tools/drain-signer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;IACjD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC;IACnD,mBAAmB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sHAAsH,CAAC;CACjK,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,IAA4E;IAClH,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,MAAM,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;QACvG,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,iCAAiC,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,OAAO,EAAE,CAAC,EAAE,CAAC;IAC5H,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,WAAW,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC;IAC7C,CAAC;AACH,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { z } from "zod";
2
+ export declare const getSignerSchema: {
3
+ project_id: z.ZodString;
4
+ signer_id: z.ZodString;
5
+ };
6
+ export declare function handleGetSigner(args: {
7
+ project_id: string;
8
+ signer_id: string;
9
+ }): Promise<{
10
+ content: Array<{
11
+ type: "text";
12
+ text: string;
13
+ }>;
14
+ isError?: boolean;
15
+ }>;
16
+ //# sourceMappingURL=get-signer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-signer.d.ts","sourceRoot":"","sources":["../../src/tools/get-signer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,eAAe;;;CAG3B,CAAC;AAEF,wBAAsB,eAAe,CAAC,IAAI,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAOrK"}
@@ -0,0 +1,17 @@
1
+ import { z } from "zod";
2
+ import { getSdk } from "../sdk.js";
3
+ import { mapSdkError } from "../errors.js";
4
+ export const getSignerSchema = {
5
+ project_id: z.string().describe("The project ID"),
6
+ signer_id: z.string().describe("The KMS signer ID (cwlt_...)"),
7
+ };
8
+ export async function handleGetSigner(args) {
9
+ try {
10
+ const body = await getSdk().contracts.getSigner(args.project_id, args.signer_id);
11
+ return { content: [{ type: "text", text: "```json\n" + JSON.stringify(body, null, 2) + "\n```" }] };
12
+ }
13
+ catch (err) {
14
+ return mapSdkError(err, "fetching signer");
15
+ }
16
+ }
17
+ //# sourceMappingURL=get-signer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-signer.js","sourceRoot":"","sources":["../../src/tools/get-signer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;IACjD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8BAA8B,CAAC;CAC/D,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,IAA+C;IACnF,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,MAAM,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QACjF,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,OAAO,EAAE,CAAC,EAAE,CAAC;IACtG,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,WAAW,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC;IAC7C,CAAC;AACH,CAAC"}
@@ -1,8 +1,8 @@
1
1
  import { z } from "zod";
2
- export declare const listContractWalletsSchema: {
2
+ export declare const listSignersSchema: {
3
3
  project_id: z.ZodString;
4
4
  };
5
- export declare function handleListContractWallets(args: {
5
+ export declare function handleListSigners(args: {
6
6
  project_id: string;
7
7
  }): Promise<{
8
8
  content: Array<{
@@ -11,4 +11,4 @@ export declare function handleListContractWallets(args: {
11
11
  }>;
12
12
  isError?: boolean;
13
13
  }>;
14
- //# sourceMappingURL=list-contract-wallets.d.ts.map
14
+ //# sourceMappingURL=list-signers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-signers.d.ts","sourceRoot":"","sources":["../../src/tools/list-signers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,iBAAiB;;CAE7B,CAAC;AAEF,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAOpJ"}
@@ -1,16 +1,16 @@
1
1
  import { z } from "zod";
2
2
  import { getSdk } from "../sdk.js";
3
3
  import { mapSdkError } from "../errors.js";
4
- export const listContractWalletsSchema = {
4
+ export const listSignersSchema = {
5
5
  project_id: z.string().describe("The project ID"),
6
6
  };
7
- export async function handleListContractWallets(args) {
7
+ export async function handleListSigners(args) {
8
8
  try {
9
- const body = await getSdk().contracts.listWallets(args.project_id);
9
+ const body = await getSdk().contracts.listSigners(args.project_id);
10
10
  return { content: [{ type: "text", text: "```json\n" + JSON.stringify(body, null, 2) + "\n```" }] };
11
11
  }
12
12
  catch (err) {
13
- return mapSdkError(err, "listing wallets");
13
+ return mapSdkError(err, "listing signers");
14
14
  }
15
15
  }
16
- //# sourceMappingURL=list-contract-wallets.js.map
16
+ //# sourceMappingURL=list-signers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-signers.js","sourceRoot":"","sources":["../../src/tools/list-signers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;CAClD,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,IAA4B;IAClE,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,MAAM,EAAE,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACnE,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,OAAO,EAAE,CAAC,EAAE,CAAC;IACtG,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,WAAW,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC;IAC7C,CAAC;AACH,CAAC"}
@@ -1,10 +1,10 @@
1
1
  import { z } from "zod";
2
- export declare const provisionContractWalletSchema: {
2
+ export declare const provisionSignerSchema: {
3
3
  project_id: z.ZodString;
4
4
  chain: z.ZodEnum<["base-mainnet", "base-sepolia"]>;
5
5
  recovery_address: z.ZodOptional<z.ZodString>;
6
6
  };
7
- export declare function handleProvisionContractWallet(args: {
7
+ export declare function handleProvisionSigner(args: {
8
8
  project_id: string;
9
9
  chain: "base-mainnet" | "base-sepolia";
10
10
  recovery_address?: string;
@@ -15,4 +15,4 @@ export declare function handleProvisionContractWallet(args: {
15
15
  }>;
16
16
  isError?: boolean;
17
17
  }>;
18
- //# sourceMappingURL=provision-contract-wallet.d.ts.map
18
+ //# sourceMappingURL=provision-signer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provision-signer.d.ts","sourceRoot":"","sources":["../../src/tools/provision-signer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,qBAAqB;;;;CAIjC,CAAC;AAEF,wBAAsB,qBAAqB,CAAC,IAAI,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,cAAc,GAAG,cAAc,CAAC;IAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAU3N"}
@@ -0,0 +1,21 @@
1
+ import { z } from "zod";
2
+ import { getSdk } from "../sdk.js";
3
+ import { mapSdkError } from "../errors.js";
4
+ export const provisionSignerSchema = {
5
+ project_id: z.string().describe("The project ID"),
6
+ chain: z.enum(["base-mainnet", "base-sepolia"]).describe("Which EVM chain. Cost: $0.04/day rental, requires $1.20 in cash credit at creation."),
7
+ recovery_address: z.string().optional().describe("Optional 0x-prefixed address for auto-drain on day-90 deletion"),
8
+ };
9
+ export async function handleProvisionSigner(args) {
10
+ try {
11
+ const body = await getSdk().contracts.provisionSigner(args.project_id, {
12
+ chain: args.chain,
13
+ recoveryAddress: args.recovery_address,
14
+ });
15
+ return { content: [{ type: "text", text: "## KMS Signer Provisioned\n\n```json\n" + JSON.stringify(body, null, 2) + "\n```\n\n**Cost**: $0.04/day rental ($1.20/month) + $0.000005 per contract call. **Non-custodial** — see https://run402.com/humans/terms.html#non-custodial-kms-wallets" }] };
16
+ }
17
+ catch (err) {
18
+ return mapSdkError(err, "provisioning KMS signer");
19
+ }
20
+ }
21
+ //# sourceMappingURL=provision-signer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provision-signer.js","sourceRoot":"","sources":["../../src/tools/provision-signer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;IACjD,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC,CAAC,QAAQ,CAAC,qFAAqF,CAAC;IAC/I,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,gEAAgE,CAAC;CACnH,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,IAA+F;IACzI,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,MAAM,EAAE,CAAC,SAAS,CAAC,eAAe,CAAC,IAAI,CAAC,UAAU,EAAE;YACrE,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,eAAe,EAAE,IAAI,CAAC,gBAAgB;SACvC,CAAC,CAAC;QACH,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,wCAAwC,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,yKAAyK,EAAE,CAAC,EAAE,CAAC;IACrS,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,WAAW,CAAC,GAAG,EAAE,yBAAyB,CAAC,CAAC;IACrD,CAAC;AACH,CAAC"}
@@ -1,12 +1,12 @@
1
1
  import { z } from "zod";
2
2
  export declare const setLowBalanceAlertSchema: {
3
3
  project_id: z.ZodString;
4
- wallet_id: z.ZodString;
4
+ signer_id: z.ZodString;
5
5
  threshold_wei: z.ZodString;
6
6
  };
7
7
  export declare function handleSetLowBalanceAlert(args: {
8
8
  project_id: string;
9
- wallet_id: string;
9
+ signer_id: string;
10
10
  threshold_wei: string;
11
11
  }): Promise<{
12
12
  content: Array<{
@@ -3,12 +3,12 @@ import { getSdk } from "../sdk.js";
3
3
  import { mapSdkError } from "../errors.js";
4
4
  export const setLowBalanceAlertSchema = {
5
5
  project_id: z.string().describe("The project ID"),
6
- wallet_id: z.string().describe("The KMS contract wallet ID"),
6
+ signer_id: z.string().describe("The KMS signer ID"),
7
7
  threshold_wei: z.string().describe("Low-balance threshold in wei (decimal string)"),
8
8
  };
9
9
  export async function handleSetLowBalanceAlert(args) {
10
10
  try {
11
- await getSdk().contracts.setLowBalanceAlert(args.project_id, args.wallet_id, args.threshold_wei);
11
+ await getSdk().contracts.setLowBalanceAlert(args.project_id, args.signer_id, args.threshold_wei);
12
12
  return { content: [{ type: "text", text: "Low-balance threshold set to " + args.threshold_wei + " wei" }] };
13
13
  }
14
14
  catch (err) {
@@ -1 +1 @@
1
- {"version":3,"file":"set-low-balance-alert.js","sourceRoot":"","sources":["../../src/tools/set-low-balance-alert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,UAAU,EAAE,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AAU,wBAAwB,CAAC,IAAsE;IACnH,IAAI,CAAC;QACH,MAAM,MAAM,EAAE,CAAC,SAAS,CAAC,kBAAkB,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;QACjG,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,+BAA+B,GAAG,IAAI,CAAC,aAAa,GAAG,MAAM,EAAE,CAAC,EAAE,CAAC;IAC9G,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,WAAW,CAAC,GAAG,EAAE,+BAA+B,CAAC,CAAC;IAC3D,CAAC;AACH,CAAC"}
@@ -1,12 +1,12 @@
1
1
  import { z } from "zod";
2
2
  export declare const setRecoveryAddressSchema: {
3
3
  project_id: z.ZodString;
4
- wallet_id: z.ZodString;
4
+ signer_id: z.ZodString;
5
5
  recovery_address: z.ZodNullable<z.ZodString>;
6
6
  };
7
7
  export declare function handleSetRecoveryAddress(args: {
8
8
  project_id: string;
9
- wallet_id: string;
9
+ signer_id: string;
10
10
  recovery_address: string | null;
11
11
  }): Promise<{
12
12
  content: Array<{
@@ -3,12 +3,12 @@ import { getSdk } from "../sdk.js";
3
3
  import { mapSdkError } from "../errors.js";
4
4
  export const setRecoveryAddressSchema = {
5
5
  project_id: z.string().describe("The project ID"),
6
- wallet_id: z.string().describe("The KMS contract wallet ID"),
6
+ signer_id: z.string().describe("The KMS signer ID"),
7
7
  recovery_address: z.string().nullable().describe("0x-prefixed address (or null to clear). Used for auto-drain on day-90 deletion."),
8
8
  };
9
9
  export async function handleSetRecoveryAddress(args) {
10
10
  try {
11
- await getSdk().contracts.setRecovery(args.project_id, args.wallet_id, args.recovery_address);
11
+ await getSdk().contracts.setRecovery(args.project_id, args.signer_id, args.recovery_address);
12
12
  return { content: [{ type: "text", text: "Recovery address " + (args.recovery_address ? "set to " + args.recovery_address : "cleared") }] };
13
13
  }
14
14
  catch (err) {
@@ -1 +1 @@
1
- {"version":3,"file":"set-recovery-address.js","sourceRoot":"","sources":["../../src/tools/set-recovery-address.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;IACjD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4BAA4B,CAAC;IAC5D,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,iFAAiF,CAAC;CACpI,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAAC,IAAgF;IAC7H,IAAI,CAAC;QACH,MAAM,MAAM,EAAE,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAC7F,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,GAAG,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,EAAE,CAAC;IAC9I,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,WAAW,CAAC,GAAG,EAAE,0BAA0B,CAAC,CAAC;IACtD,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"set-recovery-address.js","sourceRoot":"","sources":["../../src/tools/set-recovery-address.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;IACjD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC;IACnD,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,iFAAiF,CAAC;CACpI,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAAC,IAAgF;IAC7H,IAAI,CAAC;QACH,MAAM,MAAM,EAAE,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAC7F,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,GAAG,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,EAAE,CAAC;IAC9I,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,WAAW,CAAC,GAAG,EAAE,0BAA0B,CAAC,CAAC;IACtD,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "run402-mcp",
3
- "version": "2.49.0",
3
+ "version": "3.1.0",
4
4
  "description": "MCP server for Run402 — AI-native Postgres databases with REST API, auth, storage, and row-level security. Pay with x402 USDC micropayments.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
package/sdk/README.md CHANGED
@@ -75,7 +75,7 @@ The `CredentialsProvider` interface has two required methods (`getAuth`, `getPro
75
75
  | `apps` | `browse`, `getApp`, `fork`, `publish`, `listVersions`, `updateVersion`, `deleteVersion` |
76
76
  | `tier` | `set`, `status` (tier pricing lives on `r.projects.getQuote()`) |
77
77
  | `billing` | `createEmailOrganization`, `linkWallet`, `createCheckout`, `setAutoRecharge`, `checkBalance`, `getOrganization`, `lookupOrganization`, `getHistory`, `balance`, `history` |
78
- | `contracts` | `provisionWallet`, `getWallet`, `listWallets`, `setRecovery`, `setLowBalanceAlert`, `call`, `read`, `callStatus`, `drain`, `deleteWallet` |
78
+ | `contracts` | `provisionSigner`, `getSigner`, `listSigners`, `setRecovery`, `setLowBalanceAlert`, `call`, `read`, `callStatus`, `drain`, `deleteSigner` |
79
79
  | `ai` | `translate`, `moderate`, `usage`, `generateImage` |
80
80
  | `allowance` | `status`, `create`, `export`, `faucet` |
81
81
  | `service` | `status`, `health` (no auth, no setup — works on a fresh install) |
@@ -1,11 +1,14 @@
1
1
  /**
2
- * A cached **control-plane session** — the human principal's *write-capable*
3
- * bearer, minted by the loopback-PKCE flow (`run402 operator login --loopback`).
4
- * Distinct from the device-flow {@link OperatorSession} (read-only): this one
5
- * carries `provenance` (`loopback_pkce`) and `amr`, and is accepted everywhere a
6
- * SIWX wallet is. Cached at the BASE config dir (email/principal-scoped, shared
7
- * across local named wallets), mode 0600the token is as sensitive as the
8
- * allowance key.
2
+ * A cached **control-plane session** — the human principal's bearer, minted by
3
+ * the loopback-PKCE flow (`run402 operator login --loopback`). Distinct from the
4
+ * device-flow {@link OperatorSession} (read-only): this one carries `provenance`
5
+ * (`loopback_pkce`) and `amr`. It authorizes most control-plane operations, but
6
+ * since gateway v1.85/v1.87 it is NOT sufficient on its own for the high-stakes
7
+ * writes `provision` / `deploy` / secretsthose additionally require a
8
+ * passkey-fresh **operator approval** (`X-Run402-Write-Auth`, minted by
9
+ * `run402 operator approve`; see {@link WriteAuthApproval}). Cached at the BASE
10
+ * config dir (email/principal-scoped, shared across local named wallets), mode
11
+ * 0600 — the token is as sensitive as the allowance key.
9
12
  *
10
13
  * Stored shape vs the gateway payload: the gateway returns a relative
11
14
  * `expires_in` (seconds); we persist the absolute `expires_at` (epoch ms) so a
@@ -0,0 +1,99 @@
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
6
+ * **multi-entry** cache keyed by `(api_origin, control_plane_session_hash,
7
+ * action, target)`. An `org.project.create` approval for org Y and a
8
+ * `project.deploy` approval for project X coexist.
9
+ *
10
+ * 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
+ * `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
+ */
15
+ export interface WriteAuthApproval {
16
+ write_auth_token: string;
17
+ token_type: string;
18
+ header: string;
19
+ /** Gateway capability: `org.project.create` | `project.deploy` | `project.secret.write`. */
20
+ action: string;
21
+ org_id?: string;
22
+ project_id?: string;
23
+ /** Epoch ms when the approval expires (derived from the gateway-returned session). */
24
+ expires_at: number;
25
+ /** Short hash of the control-plane session this approval is bound to. */
26
+ control_plane_session_hash: string;
27
+ control_plane_principal_id: string;
28
+ /** API origin (e.g. `https://api.run402.com`) the token was minted against. */
29
+ api_origin: string;
30
+ amr?: string[];
31
+ minted_at: number;
32
+ }
33
+ /** The token payload from `POST /agent/v1/control-plane/write-auth/cli/token`. */
34
+ export interface WriteAuthTokenResponse {
35
+ write_auth_token: string;
36
+ token_type?: string;
37
+ header?: string;
38
+ /** The write-auth session; its expiry is the token's expiry. */
39
+ session?: {
40
+ expires_at?: string | number;
41
+ absolute_expires_at?: string | number;
42
+ amr?: string[];
43
+ [k: string]: unknown;
44
+ } | null;
45
+ [k: string]: unknown;
46
+ }
47
+ /** A capability target — exactly one of these is set per approval. */
48
+ export interface WriteAuthTargetKey {
49
+ org_id?: string;
50
+ project_id?: string;
51
+ }
52
+ /**
53
+ * Path to the approval cache: `{base}/write-auth-session.json`.
54
+ * `RUN402_WRITE_AUTH_SESSION_PATH` overrides for testing.
55
+ */
56
+ export declare function getWriteAuthSessionPath(): string;
57
+ /** Stable short hash binding an approval to a control-plane session token. */
58
+ export declare function hashControlPlaneSession(token: string): string;
59
+ /**
60
+ * Read all cached approvals. Returns `[]` for the "no cache" cases (absent,
61
+ * unreadable, unparseable). Throws when the file parses as JSON but the shape
62
+ * is wrong, so a corrupted cache surfaces a clear fix-it.
63
+ */
64
+ export declare function readApprovals(path?: string): WriteAuthApproval[];
65
+ /**
66
+ * Persist an approval. Replaces any existing entry with the same
67
+ * `(api_origin, control_plane_session_hash, action, target)` key and leaves
68
+ * every other entry intact (multi-entry, non-thrashing). Atomic, mode 0600.
69
+ */
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 clearApprovals(path?: string): void;
73
+ /** 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;
75
+ /**
76
+ * Return the cached approval matching ALL of `(apiOrigin, cpSessionHash,
77
+ * capability, target)` and still live, or `null` if none matches or it is
78
+ * expired. This is the exact-match the gateway's target gate requires — a
79
+ * non-match (wrong action/target/origin/session) fails closed.
80
+ */
81
+ export declare function loadLiveApproval(q: {
82
+ apiOrigin: string;
83
+ cpSessionHash: string;
84
+ capability: string;
85
+ target: WriteAuthTargetKey;
86
+ }, path?: string, nowMs?: number): WriteAuthApproval | null;
87
+ /**
88
+ * Build a cache entry from the gateway token response + the binding context
89
+ * (the cp-session it was minted under, the API origin, and the `(action,
90
+ * target)` it covers). Expiry is taken from the returned `session`.
91
+ */
92
+ export declare function approvalFromTokenResponse(resp: WriteAuthTokenResponse, binding: {
93
+ action: string;
94
+ target: WriteAuthTargetKey;
95
+ apiOrigin: string;
96
+ controlPlaneSessionHash: string;
97
+ controlPlanePrincipalId: string;
98
+ }, nowMs?: number): WriteAuthApproval;
99
+ //# sourceMappingURL=write-auth-session.d.ts.map