@usesigil/kit 0.15.0 → 0.16.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 (229) hide show
  1. package/dist/agent-bootstrap.d.ts +118 -0
  2. package/dist/agent-bootstrap.d.ts.map +1 -0
  3. package/dist/agent-bootstrap.js +211 -0
  4. package/dist/agent-bootstrap.js.map +1 -0
  5. package/dist/agent-errors.d.ts +3 -3
  6. package/dist/agent-errors.d.ts.map +1 -1
  7. package/dist/agent-errors.js +227 -142
  8. package/dist/agent-errors.js.map +1 -1
  9. package/dist/build-unsigned.d.ts +152 -0
  10. package/dist/build-unsigned.d.ts.map +1 -0
  11. package/dist/build-unsigned.js +152 -0
  12. package/dist/build-unsigned.js.map +1 -0
  13. package/dist/constraints/index.d.ts +23 -0
  14. package/dist/constraints/index.d.ts.map +1 -0
  15. package/dist/constraints/index.js +24 -0
  16. package/dist/constraints/index.js.map +1 -0
  17. package/dist/create-vault.d.ts +10 -1
  18. package/dist/create-vault.d.ts.map +1 -1
  19. package/dist/create-vault.js +10 -2
  20. package/dist/create-vault.js.map +1 -1
  21. package/dist/dashboard/constraint-builders.d.ts +82 -0
  22. package/dist/dashboard/constraint-builders.d.ts.map +1 -0
  23. package/dist/dashboard/constraint-builders.js +204 -0
  24. package/dist/dashboard/constraint-builders.js.map +1 -0
  25. package/dist/dashboard/errors.d.ts +37 -0
  26. package/dist/dashboard/errors.d.ts.map +1 -1
  27. package/dist/dashboard/errors.js +76 -0
  28. package/dist/dashboard/errors.js.map +1 -1
  29. package/dist/dashboard/from-json.d.ts.map +1 -1
  30. package/dist/dashboard/from-json.js +1 -2
  31. package/dist/dashboard/from-json.js.map +1 -1
  32. package/dist/dashboard/index.d.ts +29 -3
  33. package/dist/dashboard/index.d.ts.map +1 -1
  34. package/dist/dashboard/index.js +36 -1
  35. package/dist/dashboard/index.js.map +1 -1
  36. package/dist/dashboard/mutations.d.ts +60 -1
  37. package/dist/dashboard/mutations.d.ts.map +1 -1
  38. package/dist/dashboard/mutations.js +127 -20
  39. package/dist/dashboard/mutations.js.map +1 -1
  40. package/dist/dashboard/post-assertion-validation.d.ts +88 -0
  41. package/dist/dashboard/post-assertion-validation.d.ts.map +1 -0
  42. package/dist/dashboard/post-assertion-validation.js +191 -0
  43. package/dist/dashboard/post-assertion-validation.js.map +1 -0
  44. package/dist/dashboard/reads.d.ts +93 -1
  45. package/dist/dashboard/reads.d.ts.map +1 -1
  46. package/dist/dashboard/reads.js +238 -9
  47. package/dist/dashboard/reads.js.map +1 -1
  48. package/dist/dashboard/types.d.ts +147 -11
  49. package/dist/dashboard/types.d.ts.map +1 -1
  50. package/dist/errors/codes.js +1 -1
  51. package/dist/events.d.ts.map +1 -1
  52. package/dist/events.js +2 -1
  53. package/dist/events.js.map +1 -1
  54. package/dist/generated/accounts/pendingAgentPermissionsUpdate.d.ts +12 -0
  55. package/dist/generated/accounts/pendingAgentPermissionsUpdate.d.ts.map +1 -1
  56. package/dist/generated/accounts/pendingAgentPermissionsUpdate.js +3 -1
  57. package/dist/generated/accounts/pendingAgentPermissionsUpdate.js.map +1 -1
  58. package/dist/generated/accounts/pendingCloseConstraints.d.ts +12 -0
  59. package/dist/generated/accounts/pendingCloseConstraints.d.ts.map +1 -1
  60. package/dist/generated/accounts/pendingCloseConstraints.js +4 -2
  61. package/dist/generated/accounts/pendingCloseConstraints.js.map +1 -1
  62. package/dist/generated/accounts/pendingConstraintsUpdate.d.ts +14 -0
  63. package/dist/generated/accounts/pendingConstraintsUpdate.d.ts.map +1 -1
  64. package/dist/generated/accounts/pendingConstraintsUpdate.js +4 -2
  65. package/dist/generated/accounts/pendingConstraintsUpdate.js.map +1 -1
  66. package/dist/generated/accounts/pendingPolicyUpdate.d.ts +24 -4
  67. package/dist/generated/accounts/pendingPolicyUpdate.d.ts.map +1 -1
  68. package/dist/generated/accounts/pendingPolicyUpdate.js +6 -4
  69. package/dist/generated/accounts/pendingPolicyUpdate.js.map +1 -1
  70. package/dist/generated/accounts/policyConfig.d.ts +28 -10
  71. package/dist/generated/accounts/policyConfig.d.ts.map +1 -1
  72. package/dist/generated/accounts/policyConfig.js +4 -4
  73. package/dist/generated/accounts/policyConfig.js.map +1 -1
  74. package/dist/generated/accounts/sessionAuthority.d.ts +18 -4
  75. package/dist/generated/accounts/sessionAuthority.d.ts.map +1 -1
  76. package/dist/generated/accounts/sessionAuthority.js +3 -3
  77. package/dist/generated/accounts/sessionAuthority.js.map +1 -1
  78. package/dist/generated/errors/sigil.d.ts +95 -81
  79. package/dist/generated/errors/sigil.d.ts.map +1 -1
  80. package/dist/generated/errors/sigil.js +107 -86
  81. package/dist/generated/errors/sigil.js.map +1 -1
  82. package/dist/generated/event-discriminators.d.ts.map +1 -1
  83. package/dist/generated/event-discriminators.js +2 -1
  84. package/dist/generated/event-discriminators.js.map +1 -1
  85. package/dist/generated/instructions/cleanupOrphanConstraintsPda.d.ts +67 -0
  86. package/dist/generated/instructions/cleanupOrphanConstraintsPda.d.ts.map +1 -0
  87. package/dist/generated/instructions/cleanupOrphanConstraintsPda.js +120 -0
  88. package/dist/generated/instructions/cleanupOrphanConstraintsPda.js.map +1 -0
  89. package/dist/generated/instructions/freezeVault.d.ts +8 -5
  90. package/dist/generated/instructions/freezeVault.d.ts.map +1 -1
  91. package/dist/generated/instructions/freezeVault.js +14 -3
  92. package/dist/generated/instructions/freezeVault.js.map +1 -1
  93. package/dist/generated/instructions/index.d.ts +1 -0
  94. package/dist/generated/instructions/index.d.ts.map +1 -1
  95. package/dist/generated/instructions/index.js +1 -0
  96. package/dist/generated/instructions/index.js.map +1 -1
  97. package/dist/generated/instructions/initializeVault.d.ts +0 -4
  98. package/dist/generated/instructions/initializeVault.d.ts.map +1 -1
  99. package/dist/generated/instructions/initializeVault.js +0 -2
  100. package/dist/generated/instructions/initializeVault.js.map +1 -1
  101. package/dist/generated/instructions/queuePolicyUpdate.d.ts +8 -8
  102. package/dist/generated/instructions/queuePolicyUpdate.d.ts.map +1 -1
  103. package/dist/generated/instructions/queuePolicyUpdate.js +4 -4
  104. package/dist/generated/instructions/queuePolicyUpdate.js.map +1 -1
  105. package/dist/generated/programs/sigil.d.ts +29 -25
  106. package/dist/generated/programs/sigil.d.ts.map +1 -1
  107. package/dist/generated/programs/sigil.js +37 -25
  108. package/dist/generated/programs/sigil.js.map +1 -1
  109. package/dist/generated/types/accountConstraint.d.ts +16 -1
  110. package/dist/generated/types/accountConstraint.d.ts.map +1 -1
  111. package/dist/generated/types/accountConstraint.js +2 -0
  112. package/dist/generated/types/accountConstraint.js.map +1 -1
  113. package/dist/generated/types/accountConstraintZC.d.ts +7 -0
  114. package/dist/generated/types/accountConstraintZC.d.ts.map +1 -1
  115. package/dist/generated/types/accountConstraintZC.js +4 -2
  116. package/dist/generated/types/accountConstraintZC.js.map +1 -1
  117. package/dist/generated/types/constraintEntry.d.ts +0 -4
  118. package/dist/generated/types/constraintEntry.d.ts.map +1 -1
  119. package/dist/generated/types/constraintEntry.js +1 -3
  120. package/dist/generated/types/constraintEntry.js.map +1 -1
  121. package/dist/generated/types/constraintEntryZC.d.ts +17 -12
  122. package/dist/generated/types/constraintEntryZC.d.ts.map +1 -1
  123. package/dist/generated/types/constraintEntryZC.js +2 -2
  124. package/dist/generated/types/constraintEntryZC.js.map +1 -1
  125. package/dist/generated/types/index.d.ts +1 -0
  126. package/dist/generated/types/index.d.ts.map +1 -1
  127. package/dist/generated/types/index.js +1 -0
  128. package/dist/generated/types/index.js.map +1 -1
  129. package/dist/generated/types/orphanConstraintsPdaCleaned.d.ts +22 -0
  130. package/dist/generated/types/orphanConstraintsPdaCleaned.d.ts.map +1 -0
  131. package/dist/generated/types/orphanConstraintsPdaCleaned.js +26 -0
  132. package/dist/generated/types/orphanConstraintsPdaCleaned.js.map +1 -0
  133. package/dist/generated/types/vaultFrozen.d.ts +12 -0
  134. package/dist/generated/types/vaultFrozen.d.ts.map +1 -1
  135. package/dist/generated/types/vaultFrozen.js +3 -1
  136. package/dist/generated/types/vaultFrozen.js.map +1 -1
  137. package/dist/index.d.ts +11 -1
  138. package/dist/index.d.ts.map +1 -1
  139. package/dist/index.js +22 -1
  140. package/dist/index.js.map +1 -1
  141. package/dist/inscribe.d.ts +0 -4
  142. package/dist/inscribe.d.ts.map +1 -1
  143. package/dist/inscribe.js +0 -1
  144. package/dist/inscribe.js.map +1 -1
  145. package/dist/kit-adapter.d.ts +1 -1
  146. package/dist/kit-adapter.d.ts.map +1 -1
  147. package/dist/kit-adapter.js +1 -1
  148. package/dist/kit-adapter.js.map +1 -1
  149. package/dist/logger.d.ts +48 -0
  150. package/dist/logger.d.ts.map +1 -1
  151. package/dist/logger.js +36 -0
  152. package/dist/logger.js.map +1 -1
  153. package/dist/owner-transaction.d.ts +8 -0
  154. package/dist/owner-transaction.d.ts.map +1 -1
  155. package/dist/owner-transaction.js +1 -0
  156. package/dist/owner-transaction.js.map +1 -1
  157. package/dist/post-assertions/cross-field-lte.d.ts +134 -0
  158. package/dist/post-assertions/cross-field-lte.d.ts.map +1 -0
  159. package/dist/post-assertions/cross-field-lte.js +129 -0
  160. package/dist/post-assertions/cross-field-lte.js.map +1 -0
  161. package/dist/post-assertions/index.d.ts +28 -0
  162. package/dist/post-assertions/index.d.ts.map +1 -0
  163. package/dist/post-assertions/index.js +28 -0
  164. package/dist/post-assertions/index.js.map +1 -0
  165. package/dist/post-assertions/presets/flash-trade.d.ts +139 -0
  166. package/dist/post-assertions/presets/flash-trade.d.ts.map +1 -0
  167. package/dist/post-assertions/presets/flash-trade.js +154 -0
  168. package/dist/post-assertions/presets/flash-trade.js.map +1 -0
  169. package/dist/presets.d.ts +1 -7
  170. package/dist/presets.d.ts.map +1 -1
  171. package/dist/presets.js +0 -5
  172. package/dist/presets.js.map +1 -1
  173. package/dist/preview-create-vault.d.ts +280 -0
  174. package/dist/preview-create-vault.d.ts.map +1 -0
  175. package/dist/preview-create-vault.js +477 -0
  176. package/dist/preview-create-vault.js.map +1 -0
  177. package/dist/protocol-registry/annotations/drift.json +7 -0
  178. package/dist/protocol-registry/annotations/flash-trade.json +7 -0
  179. package/dist/protocol-registry/annotations/jupiter-borrow.json +7 -0
  180. package/dist/protocol-registry/annotations/jupiter-earn.json +7 -0
  181. package/dist/protocol-registry/annotations/jupiter-lend.json +7 -0
  182. package/dist/protocol-registry/annotations/jupiter.json +7 -0
  183. package/dist/protocol-registry/annotations/kamino.json +7 -0
  184. package/dist/protocol-registry/index.d.ts +45 -0
  185. package/dist/protocol-registry/index.d.ts.map +1 -0
  186. package/dist/protocol-registry/index.js +76 -0
  187. package/dist/protocol-registry/index.js.map +1 -0
  188. package/dist/protocol-tier.d.ts +157 -0
  189. package/dist/protocol-tier.d.ts.map +1 -0
  190. package/dist/protocol-tier.js +104 -0
  191. package/dist/protocol-tier.js.map +1 -0
  192. package/dist/seal.d.ts.map +1 -1
  193. package/dist/seal.js +26 -2
  194. package/dist/seal.js.map +1 -1
  195. package/dist/sigil.d.ts +0 -4
  196. package/dist/sigil.d.ts.map +1 -1
  197. package/dist/simulation.d.ts.map +1 -1
  198. package/dist/simulation.js +72 -91
  199. package/dist/simulation.js.map +1 -1
  200. package/dist/testing/devnet.d.ts.map +1 -1
  201. package/dist/testing/devnet.js +0 -1
  202. package/dist/testing/devnet.js.map +1 -1
  203. package/dist/testing/errors/expect.d.ts +137 -0
  204. package/dist/testing/errors/expect.d.ts.map +1 -0
  205. package/dist/testing/errors/expect.js +372 -0
  206. package/dist/testing/errors/expect.js.map +1 -0
  207. package/dist/testing/errors/index.d.ts +3 -0
  208. package/dist/testing/errors/index.d.ts.map +1 -0
  209. package/dist/testing/errors/index.js +8 -0
  210. package/dist/testing/errors/index.js.map +1 -0
  211. package/dist/testing/errors/names.generated.d.ts +188 -0
  212. package/dist/testing/errors/names.generated.d.ts.map +1 -0
  213. package/dist/testing/errors/names.generated.js +183 -0
  214. package/dist/testing/errors/names.generated.js.map +1 -0
  215. package/dist/testing/index.d.ts +1 -0
  216. package/dist/testing/index.d.ts.map +1 -1
  217. package/dist/testing/index.js +8 -0
  218. package/dist/testing/index.js.map +1 -1
  219. package/dist/testing/mock-rpc.d.ts +8 -0
  220. package/dist/testing/mock-rpc.d.ts.map +1 -1
  221. package/dist/testing/mock-rpc.js +14 -0
  222. package/dist/testing/mock-rpc.js.map +1 -1
  223. package/dist/testing/mock-state.js +2 -2
  224. package/dist/testing/mock-state.js.map +1 -1
  225. package/package.json +15 -3
  226. package/dist/integrations/protocol-handler.d.ts +0 -59
  227. package/dist/integrations/protocol-handler.d.ts.map +0 -1
  228. package/dist/integrations/protocol-handler.js +0 -9
  229. package/dist/integrations/protocol-handler.js.map +0 -1
@@ -0,0 +1,118 @@
1
+ /**
2
+ * `@usesigil/kit/agent-bootstrap` — Handoff-prompt composition.
3
+ *
4
+ * FE↔BE contract v2.2 commitment C5. Produces the canonical prompt text
5
+ * that gets pasted into Claude Desktop / ChatGPT / CLI agents after a
6
+ * vault is created. Centralizing the template here means the CLI, the
7
+ * MCP server, and the dashboard `/onboard/complete` screen all emit
8
+ * WORD-IDENTICAL handoff text — no drift, no re-interpretation.
9
+ *
10
+ * FE is free to render the prompt in any format (plain text paste, JSON
11
+ * bundle with MCP endpoint, Claude Desktop deep-link). This module only
12
+ * owns the prompt STRING; formatting is the caller's responsibility.
13
+ *
14
+ * @see FRONTEND-BACKEND-CONTRACT.md §3.4 — handoff prompt UX
15
+ * @see FRONTEND-BACKEND-CONTRACT.md §5a C5 — commitment text
16
+ */
17
+ import type { Network } from "./types.js";
18
+ /**
19
+ * Return the canonical handoff-prompt template string with
20
+ * `${placeholder}` slots intact. Consumers that want to do their own
21
+ * substitution (e.g., localize the template, inject extra context) call
22
+ * this and interpolate themselves. Most consumers should use
23
+ * `composeAgentBootstrap()` instead.
24
+ *
25
+ * Return value is a stable string — calling this multiple times returns
26
+ * the exact same text.
27
+ */
28
+ export declare function getHandoffPromptTemplate(): string;
29
+ /**
30
+ * Map a Sigil capability tier (0 / 1 / 2) to the friendly names used in
31
+ * the handoff prompt. Mirrors the internal `CAPABILITY_GRANTS` table at
32
+ * `src/advanced-analytics.ts:490`.
33
+ *
34
+ * - `0` = Disabled (no permissions; agent shouldn't be registered)
35
+ * - `1` = Observer (NonSpending actions only)
36
+ * - `2` = Operator (Spending + NonSpending)
37
+ *
38
+ * Invalid tiers return an empty array — the caller sees "Permissions: "
39
+ * (empty) rather than a crash. That's still a failure signal but a
40
+ * non-blocking one.
41
+ */
42
+ export declare function capabilityTierToNames(tier: number): readonly string[];
43
+ /**
44
+ * Input to `composeAgentBootstrap()`. Shape matches what the FE already
45
+ * has in scope at the `/onboard/complete` handoff screen (per §3.4):
46
+ *
47
+ * - `vaultAddress` / `agentAddress` / `ownerAddress` — base58 pubkeys.
48
+ * - `network` — cluster the vault was deployed to.
49
+ * - `dailyLimitUsd` — 6-decimal USD bigint (e.g., 500_000_000n for $500).
50
+ * Formatted into "$X" in the prompt.
51
+ * - `approvedProtocols` — array of friendly protocol names (caller
52
+ * resolves via `resolveProtocolName()` or the new
53
+ * `lookupProtocolAnnotation()`).
54
+ * - `capabilityTier` — the agent's capability number (0/1/2).
55
+ */
56
+ export interface AgentBootstrapConfig {
57
+ readonly vaultAddress: string;
58
+ readonly agentAddress: string;
59
+ readonly ownerAddress: string;
60
+ readonly network: Network;
61
+ readonly dailyLimitUsd: bigint;
62
+ readonly approvedProtocols: readonly string[];
63
+ readonly capabilityTier: number;
64
+ }
65
+ /**
66
+ * Output of `composeAgentBootstrap()`. Same identifiers the FE already
67
+ * has in scope — the interesting additions are:
68
+ *
69
+ * - `onboardingPrompt` — fully-substituted template, ready to paste
70
+ * into Claude Desktop / ChatGPT / CLI.
71
+ * - `capabilities` — friendly capability names (derived from the
72
+ * `capabilityTier`), surfaced separately so FE can render a chip
73
+ * list alongside the raw prompt.
74
+ */
75
+ export interface AgentBootstrap {
76
+ readonly agentWallet: string;
77
+ readonly vaultPubkey: string;
78
+ readonly onboardingPrompt: string;
79
+ readonly capabilities: readonly string[];
80
+ }
81
+ /**
82
+ * Compose the handoff-prompt bundle for a freshly-created vault.
83
+ *
84
+ * Fills the template's `${placeholder}` slots with vault-specific data
85
+ * and returns both the rendered prompt AND the structured fields the FE
86
+ * wants to display separately (capability chips, pubkey truncation, etc.).
87
+ *
88
+ * ## Determinism
89
+ *
90
+ * Given identical input, the output is byte-identical across calls. The
91
+ * prompt string has no timestamps, no random suffixes, no whitespace
92
+ * drift — pasting into two separate LLM contexts produces the same
93
+ * conversation seed.
94
+ *
95
+ * ## What it does NOT do
96
+ *
97
+ * - No RPC fetch. Input is already in FE scope by the time this runs.
98
+ * - No capability-bitmask decoding. `capabilityTier` is a small int
99
+ * (0/1/2); the FE provides it from `AgentEntry.capability`.
100
+ * - No localization. Prompt text is English-only — LLMs handle
101
+ * translation downstream if needed.
102
+ *
103
+ * @example
104
+ * ```ts
105
+ * const bootstrap = composeAgentBootstrap({
106
+ * vaultAddress: "VAULT...",
107
+ * agentAddress: "AGENT...",
108
+ * ownerAddress: "OWNER...",
109
+ * network: "devnet",
110
+ * dailyLimitUsd: 500_000_000n,
111
+ * approvedProtocols: ["Jupiter", "Flash Trade"],
112
+ * capabilityTier: 2,
113
+ * });
114
+ * console.log(bootstrap.onboardingPrompt); // full prompt for Claude Desktop
115
+ * ```
116
+ */
117
+ export declare function composeAgentBootstrap(config: AgentBootstrapConfig): AgentBootstrap;
118
+ //# sourceMappingURL=agent-bootstrap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-bootstrap.d.ts","sourceRoot":"","sources":["../src/agent-bootstrap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAsC1C;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,IAAI,MAAM,CAEjD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAWrE;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,iBAAiB,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9C,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;CACjC;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;CAC1C;AAmCD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,oBAAoB,GAC3B,cAAc,CA2DhB"}
@@ -0,0 +1,211 @@
1
+ /**
2
+ * `@usesigil/kit/agent-bootstrap` — Handoff-prompt composition.
3
+ *
4
+ * FE↔BE contract v2.2 commitment C5. Produces the canonical prompt text
5
+ * that gets pasted into Claude Desktop / ChatGPT / CLI agents after a
6
+ * vault is created. Centralizing the template here means the CLI, the
7
+ * MCP server, and the dashboard `/onboard/complete` screen all emit
8
+ * WORD-IDENTICAL handoff text — no drift, no re-interpretation.
9
+ *
10
+ * FE is free to render the prompt in any format (plain text paste, JSON
11
+ * bundle with MCP endpoint, Claude Desktop deep-link). This module only
12
+ * owns the prompt STRING; formatting is the caller's responsibility.
13
+ *
14
+ * @see FRONTEND-BACKEND-CONTRACT.md §3.4 — handoff prompt UX
15
+ * @see FRONTEND-BACKEND-CONTRACT.md §5a C5 — commitment text
16
+ */
17
+ /**
18
+ * Canonical handoff-prompt template. Uses `${placeholder}` slots for the
19
+ * vault-specific data. Consumers either call `composeAgentBootstrap()`
20
+ * (which fills the slots from a VaultConfig) or call
21
+ * `getHandoffPromptTemplate()` and do their own substitution.
22
+ *
23
+ * The template is intentionally plain prose — it's going into an LLM's
24
+ * context window, and structured markup like JSON front-matter or
25
+ * XML-style tags adds noise without improving comprehension. The
26
+ * imperative voice ("Use the Sigil MCP tool...") is deliberate: it
27
+ * primes the model to reach for the right tool without being verbose.
28
+ *
29
+ * `${placeholder}` names:
30
+ * - network — "devnet" | "mainnet-beta"
31
+ * - agentAddress — the agent wallet's base58 pubkey
32
+ * - vaultAddress — the vault PDA base58 pubkey
33
+ * - ownerAddress — the owner wallet's base58 pubkey
34
+ * - dailyLimitUsd — human-readable USD amount (e.g., "$500")
35
+ * - protocolNames — comma-separated friendly names
36
+ * - capabilityNames — comma-separated capability labels
37
+ */
38
+ const HANDOFF_PROMPT_TEMPLATE = `You are an autonomous agent operating a Sigil vault on \${network}.
39
+
40
+ Your wallet: \${agentAddress}
41
+ The vault you control: \${vaultAddress}
42
+ Your owner's wallet (read-only reference): \${ownerAddress}
43
+
44
+ Daily spending limit: \${dailyLimitUsd}
45
+ Approved protocols: \${protocolNames}
46
+ Permissions: \${capabilityNames}
47
+
48
+ Use the Sigil MCP tool \`seal_transaction\` to execute any on-chain action.
49
+ The vault will reject any tx that exceeds the rules above — this is by design.
50
+
51
+ If you need help, use \`request_help\` to surface a question to your owner.`;
52
+ /**
53
+ * Return the canonical handoff-prompt template string with
54
+ * `${placeholder}` slots intact. Consumers that want to do their own
55
+ * substitution (e.g., localize the template, inject extra context) call
56
+ * this and interpolate themselves. Most consumers should use
57
+ * `composeAgentBootstrap()` instead.
58
+ *
59
+ * Return value is a stable string — calling this multiple times returns
60
+ * the exact same text.
61
+ */
62
+ export function getHandoffPromptTemplate() {
63
+ return HANDOFF_PROMPT_TEMPLATE;
64
+ }
65
+ /**
66
+ * Map a Sigil capability tier (0 / 1 / 2) to the friendly names used in
67
+ * the handoff prompt. Mirrors the internal `CAPABILITY_GRANTS` table at
68
+ * `src/advanced-analytics.ts:490`.
69
+ *
70
+ * - `0` = Disabled (no permissions; agent shouldn't be registered)
71
+ * - `1` = Observer (NonSpending actions only)
72
+ * - `2` = Operator (Spending + NonSpending)
73
+ *
74
+ * Invalid tiers return an empty array — the caller sees "Permissions: "
75
+ * (empty) rather than a crash. That's still a failure signal but a
76
+ * non-blocking one.
77
+ */
78
+ export function capabilityTierToNames(tier) {
79
+ switch (tier) {
80
+ case 0:
81
+ return [];
82
+ case 1:
83
+ return ["NonSpending"];
84
+ case 2:
85
+ return ["Spending", "NonSpending"];
86
+ default:
87
+ return [];
88
+ }
89
+ }
90
+ /**
91
+ * Format a 6-decimal USD bigint as `"$X"` for the prompt.
92
+ *
93
+ * 500_000_000n → "$500"
94
+ * 750_000_000n → "$750"
95
+ * 100_500_000n → "$100.5"
96
+ *
97
+ * Keeps fractional cents only when non-zero; avoids `"$500.00"` visual
98
+ * noise for round amounts. Not a general-purpose formatter — caller
99
+ * should use `formatUsd()` elsewhere.
100
+ *
101
+ * Rejects negative amounts loudly. A negative daily-limit in an LLM
102
+ * system prompt is a user-visible garbage signal ("$-100.-5"), and
103
+ * negative 6-decimal USD is never a legitimate config in the vault
104
+ * setup flow. Fail-fast here protects every downstream prompt
105
+ * consumer (CLI, MCP, dashboard) uniformly.
106
+ */
107
+ function formatDailyLimitUsd(amount) {
108
+ if (amount < 0n) {
109
+ throw new RangeError(`composeAgentBootstrap: dailyLimitUsd must be >= 0 (got ${amount.toString()}). Negative USD limits are not a valid vault config.`);
110
+ }
111
+ const dollars = amount / 1000000n;
112
+ const fractional = amount % 1000000n;
113
+ if (fractional === 0n)
114
+ return `$${dollars.toString()}`;
115
+ // 6-decimal USD — cents are the leading two digits of the micro remainder.
116
+ // Trim trailing zeros from the fractional representation so $100.50 stays
117
+ // readable but $100.500000 doesn't happen.
118
+ const fracStr = fractional.toString().padStart(6, "0").replace(/0+$/, "");
119
+ return `$${dollars.toString()}.${fracStr}`;
120
+ }
121
+ /**
122
+ * Compose the handoff-prompt bundle for a freshly-created vault.
123
+ *
124
+ * Fills the template's `${placeholder}` slots with vault-specific data
125
+ * and returns both the rendered prompt AND the structured fields the FE
126
+ * wants to display separately (capability chips, pubkey truncation, etc.).
127
+ *
128
+ * ## Determinism
129
+ *
130
+ * Given identical input, the output is byte-identical across calls. The
131
+ * prompt string has no timestamps, no random suffixes, no whitespace
132
+ * drift — pasting into two separate LLM contexts produces the same
133
+ * conversation seed.
134
+ *
135
+ * ## What it does NOT do
136
+ *
137
+ * - No RPC fetch. Input is already in FE scope by the time this runs.
138
+ * - No capability-bitmask decoding. `capabilityTier` is a small int
139
+ * (0/1/2); the FE provides it from `AgentEntry.capability`.
140
+ * - No localization. Prompt text is English-only — LLMs handle
141
+ * translation downstream if needed.
142
+ *
143
+ * @example
144
+ * ```ts
145
+ * const bootstrap = composeAgentBootstrap({
146
+ * vaultAddress: "VAULT...",
147
+ * agentAddress: "AGENT...",
148
+ * ownerAddress: "OWNER...",
149
+ * network: "devnet",
150
+ * dailyLimitUsd: 500_000_000n,
151
+ * approvedProtocols: ["Jupiter", "Flash Trade"],
152
+ * capabilityTier: 2,
153
+ * });
154
+ * console.log(bootstrap.onboardingPrompt); // full prompt for Claude Desktop
155
+ * ```
156
+ */
157
+ export function composeAgentBootstrap(config) {
158
+ const capabilities = capabilityTierToNames(config.capabilityTier);
159
+ const dailyLimitUsd = formatDailyLimitUsd(config.dailyLimitUsd);
160
+ const protocolNames = config.approvedProtocols.join(", ");
161
+ const capabilityNames = capabilities.join(", ");
162
+ // Substitution table. Keyed on the BARE placeholder name (no `${...}`
163
+ // wrapper) so we can build one regex that matches every slot in one
164
+ // pass.
165
+ const subs = {
166
+ network: config.network,
167
+ agentAddress: config.agentAddress,
168
+ vaultAddress: config.vaultAddress,
169
+ ownerAddress: config.ownerAddress,
170
+ dailyLimitUsd,
171
+ protocolNames,
172
+ capabilityNames,
173
+ };
174
+ // SINGLE-PASS substitution. Two layered injection vectors this guards:
175
+ //
176
+ // 1. Dollar-sign back-references (`$&`, `$'`, `` $` ``, `$1`…`$9`)
177
+ // in the REPLACEMENT string would, under
178
+ // `String.prototype.replace(regex, str)`, be interpreted as
179
+ // match-context references. The callback form bypasses that —
180
+ // the callback's return value is inserted literally.
181
+ //
182
+ // 2. `${placeholder}` LITERAL INSIDE a value would, under SEQUENTIAL
183
+ // `.replaceAll(placeholder, value)` passes, get re-substituted by
184
+ // a LATER pass (e.g., `protocolNames = "X ${capabilityNames} Y"`
185
+ // gets rewritten when the capabilityNames pass runs). A single
186
+ // pass that resolves every placeholder once and only once makes
187
+ // the substitution idempotent — values are inserted literally,
188
+ // never re-scanned.
189
+ //
190
+ // `approvedProtocols` is free-form (MCP callers, third-party partners)
191
+ // so protocol names containing `$&` or `${capabilityNames}` or
192
+ // anything else render literally, regardless of caller trust.
193
+ const PLACEHOLDER_RE = /\$\{(\w+)\}/g;
194
+ const onboardingPrompt = HANDOFF_PROMPT_TEMPLATE.replace(PLACEHOLDER_RE, (match, name) => {
195
+ // Unknown placeholder → keep the original. The template is a
196
+ // module-level constant, so unknown placeholders indicate a
197
+ // template+subs mismatch (bug in THIS file, not caller input) —
198
+ // preserving the `${...}` marker makes such bugs visible in the
199
+ // rendered output instead of silently swallowed.
200
+ return Object.prototype.hasOwnProperty.call(subs, name)
201
+ ? subs[name]
202
+ : match;
203
+ });
204
+ return {
205
+ agentWallet: config.agentAddress,
206
+ vaultPubkey: config.vaultAddress,
207
+ onboardingPrompt,
208
+ capabilities,
209
+ };
210
+ }
211
+ //# sourceMappingURL=agent-bootstrap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-bootstrap.js","sourceRoot":"","sources":["../src/agent-bootstrap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM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AChC,gBAAgB;QAChB,YAAY;KACb,CAAC;AACJ,CAAC"}
@@ -5,7 +5,7 @@
5
5
  * Every error includes a category, retryability flag, and
6
6
  * recovery actions that tell the agent exactly what to do next.
7
7
  *
8
- * Maps all 81 on-chain error codes (6000-6080) plus 34 SDK
8
+ * Maps all 88 on-chain error codes (6000-6087) plus 34 SDK
9
9
  * error codes (7000-7033) to AgentError with machine-readable metadata.
10
10
  *
11
11
  * Zero dependency on @solana/web3.js or @coral-xyz/anchor.
@@ -52,7 +52,7 @@ export declare const SDK_ERROR_CODES: Record<number, string>;
52
52
  * Convert any error into a structured AgentError.
53
53
  *
54
54
  * Handles:
55
- * - On-chain Anchor errors (code 6000-6080)
55
+ * - On-chain Anchor errors (code 6000-6087)
56
56
  * - SDK errors (code 7000-7033)
57
57
  * - Network/RPC errors (from message patterns)
58
58
  * - Unknown errors (wrapped as FATAL)
@@ -161,7 +161,7 @@ export declare class SigilSdkError extends Error implements AgentError {
161
161
  * Returns a SigilSdkError (extends Error) so instanceof Error checks still work.
162
162
  *
163
163
  * Processing order:
164
- * 1. Try on-chain error extraction via toAgentError() (numeric codes 6000-6080)
164
+ * 1. Try on-chain error extraction via toAgentError() (numeric codes 6000-6087)
165
165
  * 2. Pattern-match SDK error messages (11 patterns from seal.ts throw sites)
166
166
  * 3. Fallback to UNKNOWN/FATAL
167
167
  */
@@ -1 +1 @@
1
- {"version":3,"file":"agent-errors.d.ts","sourceRoot":"","sources":["../src/agent-errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAMH,MAAM,MAAM,aAAa,GACrB,kBAAkB,GAClB,WAAW,GACX,YAAY,GACZ,YAAY,GACZ,oBAAoB,GACpB,cAAc,GACd,kBAAkB,GAClB,wBAAwB,GACxB,qBAAqB,GACrB,OAAO,CAAC;AAEZ,MAAM,WAAW,cAAc;IAC7B,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,+CAA+C;IAC/C,WAAW,EAAE,MAAM,CAAC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