@haven_ai/sdk 0.1.11-alpha.0 → 0.1.12-alpha.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.
package/dist/index.d.cts CHANGED
@@ -1171,6 +1171,27 @@ declare const toolDescriptions: {
1171
1171
  };
1172
1172
  type SharedToolKey = keyof typeof toolDescriptions;
1173
1173
 
1174
+ /**
1175
+ * The generic Haven payment skill — canonical copy.
1176
+ *
1177
+ * This SDK file is the single source of truth for the generic, secret-free
1178
+ * skill content: no wallet address, no budget numbers, no per-agent values.
1179
+ * The agent learns its identity and live budget at runtime via the
1180
+ * `haven_get_agent` / `haven_get_allowances` MCP tools, so the same file works
1181
+ * for every user. `packages/connect` imports this directly to auto-install the
1182
+ * skill into runtime skills folders.
1183
+ *
1184
+ * `packages/frontend/src/lib/agent-skill-bundle.ts` keeps a deliberately
1185
+ * decoupled inline copy (the download fallback): frontend has zero
1186
+ * `@haven_ai/*` dependencies so it can deploy standalone on Vercel without an
1187
+ * unpublished SDK export. A parity test in that package's test suite imports
1188
+ * this canonical string and asserts byte-for-byte equality, so the two copies
1189
+ * cannot drift.
1190
+ */
1191
+ declare const HAVEN_SKILL_MD = "---\nname: haven-pay\ndescription: Pay for things from the user's Haven wallet within their agent rules. Use when the user asks to send, pay, tip, or transfer crypto \u2014 or when a request hits an HTTP 402 (x402) paywall.\n---\n\n# Haven: pay from a Haven wallet\n\nThis skill lets the agent make payments from the user's Haven wallet through\nthe Haven MCP tools. Every payment is checked against the agent's on-chain\nbudget before money moves; payments above the remaining budget wait for the\nuser's approval in Haven.\n\n## When to use this skill\n\n- The user asks to send money, pay someone, tip, donate, or transfer tokens.\n- A request returns HTTP 402 (x402): use the Haven pay tools to settle it,\n then retry the original request.\n\n## Identity and budget come from the tools \u2014 never assume them\n\nDo not guess the wallet address, network, or budget. Read them live:\n\n- `haven_get_agent` \u2014 agent identity, Haven wallet address, network.\n- `haven_get_allowances` \u2014 current per-token budgets and what remains.\n\nBudgets reset on a period the user chose. If a payment exceeds the remaining\nbudget it is queued for the user to approve in the Haven dashboard \u2014 this is\nnormal, not an error.\n\n## Paying\n\n- **Direct transfer:** `haven_pay` with recipient, amount, and token.\n- **x402 paywall:** `haven_quote_x402` to get a quote, then\n `haven_pay_x402_quote`. In the hosted setup the signing step happens in\n the local Haven signer; follow the tool results \u2014 they tell you the next\n action at every step. Retry the original request only when the result says\n `retry_original_x402_request`.\n- **Status:** `haven_get_payment_status` with a `payment_id` to check on\n queued or in-flight payments. Do not poll in a tight loop.\n\n## Approval semantics\n\n- A result with `pending_approval` means the payment exceeded the remaining\n budget and is waiting for the user in Haven. Tell the user, then check\n status later.\n- Never ask the user for private keys and never try to sign anything\n yourself \u2014 Haven signs. If a tool reports a missing or invalid credential,\n tell the user to re-run the Haven setup command.\n\n## Failure handling\n\nHaven errors are shaped `{ error, status, details? }` and written for\nhumans \u2014 surface the message verbatim. Common cases:\n\n- `pending_approval`: queued for the user's approval (see above).\n- `insufficient_funds`: the Haven wallet doesn't hold enough of that token.\n Suggest the user add funds in the Haven dashboard.\n- Budget exceeded: tell the user how much remains (from\n `haven_get_allowances`) and that they can raise the budget in Haven.\n\n## Revoke\n\nIf this agent's credential may have leaked, tell the user to pause or revoke\nthe agent in the Haven dashboard under Agents. New requests stop immediately\nfor that credential.\n";
1192
+ /** Directory name for the installed skill folder. */
1193
+ declare const SKILL_FOLDER_NAME = "haven-pay";
1194
+
1174
1195
  /**
1175
1196
  * x402 protocol support for the Haven SDK.
1176
1197
  *
@@ -1279,4 +1300,4 @@ declare function encodeBase64Json(value: unknown): string;
1279
1300
  */
1280
1301
  declare function decodeBase64Json<T>(value: string, label?: string): T;
1281
1302
 
1282
- export { AGENT_PAYMENT_NEXT_ACTION_VALUES, AGENT_PAYMENT_PHASE_VALUES, AGENT_PAYMENT_RAIL_VALUES, type AgentPaymentEnumSchema, AgentPaymentNextAction, AgentPaymentNextActionDescriptions, AgentPaymentNextActionSchema, AgentPaymentPhase, AgentPaymentPhaseDescriptions, AgentPaymentPhaseSchema, AgentPaymentRail, AgentPaymentRailDescriptions, AgentPaymentRailSchema, type ClaudeTool, type HavenAgent, type HavenAllowance, type HavenAllowanceSummary, HavenApiError, type HavenCatalogEntry, HavenClient, type HavenClientConfig, HavenError, type HavenPaymentReceipt, HavenPaymentStateError, HavenSigningError, HavenTimeoutError, type MachinePaymentChallenge, type MachinePaymentRail, type MachinePaymentReceipt, type MppAuthorizationOptions, type MppQuote, type MppResumeState, type OpenAITool, type PaymentIntent, type PaymentNextAction, type PaymentPhase, type PaymentRequest, type PaymentResult, type PaymentResumeState, type PaymentStatus, type PaymentStatusResult, type PendingApproval, type ResumeAuthorizedMppInput, type ResumeAuthorizedX402Input, type ResumeMppPaymentInput, type ResumeX402PaymentInput, type SharedToolKey, type SignData, type SweepEntry, type SweepResult, type ToolDescription, type X402AuthorizationOptions, type X402ExpectedAuth, type X402ExpectedContext, type X402Intent, type X402PaymentOption, type X402PaymentRequired, type X402Quote, type X402Receipt, type X402RequestSnapshot, type X402ResumeState, addressFromKey, buildMachinePaymentIdempotencyKey, buildX402ExpectedMessage, composeDescription, decodeBase64Json, decodeBase64Utf8, encodeBase64Json, encodeBase64Utf8, encodeMachinePaymentProof, encodePaymentProof, havenTools, parseMachinePaymentChallenge, parseMachinePaymentChallengeResponse, parsePaymentRequired, parsePaymentRequiredResponse, selectPaymentOption, selectStandardPaymentOption, signHash, toStandardPaymentRequirements, toolDescriptions, verifySignature, x402AuthorizationAmount };
1303
+ export { AGENT_PAYMENT_NEXT_ACTION_VALUES, AGENT_PAYMENT_PHASE_VALUES, AGENT_PAYMENT_RAIL_VALUES, type AgentPaymentEnumSchema, AgentPaymentNextAction, AgentPaymentNextActionDescriptions, AgentPaymentNextActionSchema, AgentPaymentPhase, AgentPaymentPhaseDescriptions, AgentPaymentPhaseSchema, AgentPaymentRail, AgentPaymentRailDescriptions, AgentPaymentRailSchema, type ClaudeTool, HAVEN_SKILL_MD, type HavenAgent, type HavenAllowance, type HavenAllowanceSummary, HavenApiError, type HavenCatalogEntry, HavenClient, type HavenClientConfig, HavenError, type HavenPaymentReceipt, HavenPaymentStateError, HavenSigningError, HavenTimeoutError, type MachinePaymentChallenge, type MachinePaymentRail, type MachinePaymentReceipt, type MppAuthorizationOptions, type MppQuote, type MppResumeState, type OpenAITool, type PaymentIntent, type PaymentNextAction, type PaymentPhase, type PaymentRequest, type PaymentResult, type PaymentResumeState, type PaymentStatus, type PaymentStatusResult, type PendingApproval, type ResumeAuthorizedMppInput, type ResumeAuthorizedX402Input, type ResumeMppPaymentInput, type ResumeX402PaymentInput, SKILL_FOLDER_NAME, type SharedToolKey, type SignData, type SweepEntry, type SweepResult, type ToolDescription, type X402AuthorizationOptions, type X402ExpectedAuth, type X402ExpectedContext, type X402Intent, type X402PaymentOption, type X402PaymentRequired, type X402Quote, type X402Receipt, type X402RequestSnapshot, type X402ResumeState, addressFromKey, buildMachinePaymentIdempotencyKey, buildX402ExpectedMessage, composeDescription, decodeBase64Json, decodeBase64Utf8, encodeBase64Json, encodeBase64Utf8, encodeMachinePaymentProof, encodePaymentProof, havenTools, parseMachinePaymentChallenge, parseMachinePaymentChallengeResponse, parsePaymentRequired, parsePaymentRequiredResponse, selectPaymentOption, selectStandardPaymentOption, signHash, toStandardPaymentRequirements, toolDescriptions, verifySignature, x402AuthorizationAmount };
package/dist/index.d.ts CHANGED
@@ -1171,6 +1171,27 @@ declare const toolDescriptions: {
1171
1171
  };
1172
1172
  type SharedToolKey = keyof typeof toolDescriptions;
1173
1173
 
1174
+ /**
1175
+ * The generic Haven payment skill — canonical copy.
1176
+ *
1177
+ * This SDK file is the single source of truth for the generic, secret-free
1178
+ * skill content: no wallet address, no budget numbers, no per-agent values.
1179
+ * The agent learns its identity and live budget at runtime via the
1180
+ * `haven_get_agent` / `haven_get_allowances` MCP tools, so the same file works
1181
+ * for every user. `packages/connect` imports this directly to auto-install the
1182
+ * skill into runtime skills folders.
1183
+ *
1184
+ * `packages/frontend/src/lib/agent-skill-bundle.ts` keeps a deliberately
1185
+ * decoupled inline copy (the download fallback): frontend has zero
1186
+ * `@haven_ai/*` dependencies so it can deploy standalone on Vercel without an
1187
+ * unpublished SDK export. A parity test in that package's test suite imports
1188
+ * this canonical string and asserts byte-for-byte equality, so the two copies
1189
+ * cannot drift.
1190
+ */
1191
+ declare const HAVEN_SKILL_MD = "---\nname: haven-pay\ndescription: Pay for things from the user's Haven wallet within their agent rules. Use when the user asks to send, pay, tip, or transfer crypto \u2014 or when a request hits an HTTP 402 (x402) paywall.\n---\n\n# Haven: pay from a Haven wallet\n\nThis skill lets the agent make payments from the user's Haven wallet through\nthe Haven MCP tools. Every payment is checked against the agent's on-chain\nbudget before money moves; payments above the remaining budget wait for the\nuser's approval in Haven.\n\n## When to use this skill\n\n- The user asks to send money, pay someone, tip, donate, or transfer tokens.\n- A request returns HTTP 402 (x402): use the Haven pay tools to settle it,\n then retry the original request.\n\n## Identity and budget come from the tools \u2014 never assume them\n\nDo not guess the wallet address, network, or budget. Read them live:\n\n- `haven_get_agent` \u2014 agent identity, Haven wallet address, network.\n- `haven_get_allowances` \u2014 current per-token budgets and what remains.\n\nBudgets reset on a period the user chose. If a payment exceeds the remaining\nbudget it is queued for the user to approve in the Haven dashboard \u2014 this is\nnormal, not an error.\n\n## Paying\n\n- **Direct transfer:** `haven_pay` with recipient, amount, and token.\n- **x402 paywall:** `haven_quote_x402` to get a quote, then\n `haven_pay_x402_quote`. In the hosted setup the signing step happens in\n the local Haven signer; follow the tool results \u2014 they tell you the next\n action at every step. Retry the original request only when the result says\n `retry_original_x402_request`.\n- **Status:** `haven_get_payment_status` with a `payment_id` to check on\n queued or in-flight payments. Do not poll in a tight loop.\n\n## Approval semantics\n\n- A result with `pending_approval` means the payment exceeded the remaining\n budget and is waiting for the user in Haven. Tell the user, then check\n status later.\n- Never ask the user for private keys and never try to sign anything\n yourself \u2014 Haven signs. If a tool reports a missing or invalid credential,\n tell the user to re-run the Haven setup command.\n\n## Failure handling\n\nHaven errors are shaped `{ error, status, details? }` and written for\nhumans \u2014 surface the message verbatim. Common cases:\n\n- `pending_approval`: queued for the user's approval (see above).\n- `insufficient_funds`: the Haven wallet doesn't hold enough of that token.\n Suggest the user add funds in the Haven dashboard.\n- Budget exceeded: tell the user how much remains (from\n `haven_get_allowances`) and that they can raise the budget in Haven.\n\n## Revoke\n\nIf this agent's credential may have leaked, tell the user to pause or revoke\nthe agent in the Haven dashboard under Agents. New requests stop immediately\nfor that credential.\n";
1192
+ /** Directory name for the installed skill folder. */
1193
+ declare const SKILL_FOLDER_NAME = "haven-pay";
1194
+
1174
1195
  /**
1175
1196
  * x402 protocol support for the Haven SDK.
1176
1197
  *
@@ -1279,4 +1300,4 @@ declare function encodeBase64Json(value: unknown): string;
1279
1300
  */
1280
1301
  declare function decodeBase64Json<T>(value: string, label?: string): T;
1281
1302
 
1282
- export { AGENT_PAYMENT_NEXT_ACTION_VALUES, AGENT_PAYMENT_PHASE_VALUES, AGENT_PAYMENT_RAIL_VALUES, type AgentPaymentEnumSchema, AgentPaymentNextAction, AgentPaymentNextActionDescriptions, AgentPaymentNextActionSchema, AgentPaymentPhase, AgentPaymentPhaseDescriptions, AgentPaymentPhaseSchema, AgentPaymentRail, AgentPaymentRailDescriptions, AgentPaymentRailSchema, type ClaudeTool, type HavenAgent, type HavenAllowance, type HavenAllowanceSummary, HavenApiError, type HavenCatalogEntry, HavenClient, type HavenClientConfig, HavenError, type HavenPaymentReceipt, HavenPaymentStateError, HavenSigningError, HavenTimeoutError, type MachinePaymentChallenge, type MachinePaymentRail, type MachinePaymentReceipt, type MppAuthorizationOptions, type MppQuote, type MppResumeState, type OpenAITool, type PaymentIntent, type PaymentNextAction, type PaymentPhase, type PaymentRequest, type PaymentResult, type PaymentResumeState, type PaymentStatus, type PaymentStatusResult, type PendingApproval, type ResumeAuthorizedMppInput, type ResumeAuthorizedX402Input, type ResumeMppPaymentInput, type ResumeX402PaymentInput, type SharedToolKey, type SignData, type SweepEntry, type SweepResult, type ToolDescription, type X402AuthorizationOptions, type X402ExpectedAuth, type X402ExpectedContext, type X402Intent, type X402PaymentOption, type X402PaymentRequired, type X402Quote, type X402Receipt, type X402RequestSnapshot, type X402ResumeState, addressFromKey, buildMachinePaymentIdempotencyKey, buildX402ExpectedMessage, composeDescription, decodeBase64Json, decodeBase64Utf8, encodeBase64Json, encodeBase64Utf8, encodeMachinePaymentProof, encodePaymentProof, havenTools, parseMachinePaymentChallenge, parseMachinePaymentChallengeResponse, parsePaymentRequired, parsePaymentRequiredResponse, selectPaymentOption, selectStandardPaymentOption, signHash, toStandardPaymentRequirements, toolDescriptions, verifySignature, x402AuthorizationAmount };
1303
+ export { AGENT_PAYMENT_NEXT_ACTION_VALUES, AGENT_PAYMENT_PHASE_VALUES, AGENT_PAYMENT_RAIL_VALUES, type AgentPaymentEnumSchema, AgentPaymentNextAction, AgentPaymentNextActionDescriptions, AgentPaymentNextActionSchema, AgentPaymentPhase, AgentPaymentPhaseDescriptions, AgentPaymentPhaseSchema, AgentPaymentRail, AgentPaymentRailDescriptions, AgentPaymentRailSchema, type ClaudeTool, HAVEN_SKILL_MD, type HavenAgent, type HavenAllowance, type HavenAllowanceSummary, HavenApiError, type HavenCatalogEntry, HavenClient, type HavenClientConfig, HavenError, type HavenPaymentReceipt, HavenPaymentStateError, HavenSigningError, HavenTimeoutError, type MachinePaymentChallenge, type MachinePaymentRail, type MachinePaymentReceipt, type MppAuthorizationOptions, type MppQuote, type MppResumeState, type OpenAITool, type PaymentIntent, type PaymentNextAction, type PaymentPhase, type PaymentRequest, type PaymentResult, type PaymentResumeState, type PaymentStatus, type PaymentStatusResult, type PendingApproval, type ResumeAuthorizedMppInput, type ResumeAuthorizedX402Input, type ResumeMppPaymentInput, type ResumeX402PaymentInput, SKILL_FOLDER_NAME, type SharedToolKey, type SignData, type SweepEntry, type SweepResult, type ToolDescription, type X402AuthorizationOptions, type X402ExpectedAuth, type X402ExpectedContext, type X402Intent, type X402PaymentOption, type X402PaymentRequired, type X402Quote, type X402Receipt, type X402RequestSnapshot, type X402ResumeState, addressFromKey, buildMachinePaymentIdempotencyKey, buildX402ExpectedMessage, composeDescription, decodeBase64Json, decodeBase64Utf8, encodeBase64Json, encodeBase64Utf8, encodeMachinePaymentProof, encodePaymentProof, havenTools, parseMachinePaymentChallenge, parseMachinePaymentChallengeResponse, parsePaymentRequired, parsePaymentRequiredResponse, selectPaymentOption, selectStandardPaymentOption, signHash, toStandardPaymentRequirements, toolDescriptions, verifySignature, x402AuthorizationAmount };
package/dist/index.js CHANGED
@@ -3044,6 +3044,75 @@ var havenTools = {
3044
3044
  openai: openaiTools
3045
3045
  };
3046
3046
 
3047
- export { AGENT_PAYMENT_NEXT_ACTION_VALUES, AGENT_PAYMENT_PHASE_VALUES, AGENT_PAYMENT_RAIL_VALUES, AgentPaymentNextAction, AgentPaymentNextActionDescriptions, AgentPaymentNextActionSchema, AgentPaymentPhase, AgentPaymentPhaseDescriptions, AgentPaymentPhaseSchema, AgentPaymentRail, AgentPaymentRailDescriptions, AgentPaymentRailSchema, HavenApiError, HavenClient, HavenError, HavenPaymentStateError, HavenSigningError, HavenTimeoutError, addressFromKey, buildMachinePaymentIdempotencyKey, buildX402ExpectedMessage, composeDescription, decodeBase64Json, decodeBase64Utf8, encodeBase64Json, encodeBase64Utf8, encodeMachinePaymentProof, encodePaymentProof, havenTools, parseMachinePaymentChallenge, parseMachinePaymentChallengeResponse, parsePaymentRequired, parsePaymentRequiredResponse, selectPaymentOption, selectStandardPaymentOption, signHash, toStandardPaymentRequirements, toolDescriptions, verifySignature, x402AuthorizationAmount };
3047
+ // src/skill-content.ts
3048
+ var HAVEN_SKILL_MD = `---
3049
+ name: haven-pay
3050
+ description: Pay for things from the user's Haven wallet within their agent rules. Use when the user asks to send, pay, tip, or transfer crypto \u2014 or when a request hits an HTTP 402 (x402) paywall.
3051
+ ---
3052
+
3053
+ # Haven: pay from a Haven wallet
3054
+
3055
+ This skill lets the agent make payments from the user's Haven wallet through
3056
+ the Haven MCP tools. Every payment is checked against the agent's on-chain
3057
+ budget before money moves; payments above the remaining budget wait for the
3058
+ user's approval in Haven.
3059
+
3060
+ ## When to use this skill
3061
+
3062
+ - The user asks to send money, pay someone, tip, donate, or transfer tokens.
3063
+ - A request returns HTTP 402 (x402): use the Haven pay tools to settle it,
3064
+ then retry the original request.
3065
+
3066
+ ## Identity and budget come from the tools \u2014 never assume them
3067
+
3068
+ Do not guess the wallet address, network, or budget. Read them live:
3069
+
3070
+ - \`haven_get_agent\` \u2014 agent identity, Haven wallet address, network.
3071
+ - \`haven_get_allowances\` \u2014 current per-token budgets and what remains.
3072
+
3073
+ Budgets reset on a period the user chose. If a payment exceeds the remaining
3074
+ budget it is queued for the user to approve in the Haven dashboard \u2014 this is
3075
+ normal, not an error.
3076
+
3077
+ ## Paying
3078
+
3079
+ - **Direct transfer:** \`haven_pay\` with recipient, amount, and token.
3080
+ - **x402 paywall:** \`haven_quote_x402\` to get a quote, then
3081
+ \`haven_pay_x402_quote\`. In the hosted setup the signing step happens in
3082
+ the local Haven signer; follow the tool results \u2014 they tell you the next
3083
+ action at every step. Retry the original request only when the result says
3084
+ \`retry_original_x402_request\`.
3085
+ - **Status:** \`haven_get_payment_status\` with a \`payment_id\` to check on
3086
+ queued or in-flight payments. Do not poll in a tight loop.
3087
+
3088
+ ## Approval semantics
3089
+
3090
+ - A result with \`pending_approval\` means the payment exceeded the remaining
3091
+ budget and is waiting for the user in Haven. Tell the user, then check
3092
+ status later.
3093
+ - Never ask the user for private keys and never try to sign anything
3094
+ yourself \u2014 Haven signs. If a tool reports a missing or invalid credential,
3095
+ tell the user to re-run the Haven setup command.
3096
+
3097
+ ## Failure handling
3098
+
3099
+ Haven errors are shaped \`{ error, status, details? }\` and written for
3100
+ humans \u2014 surface the message verbatim. Common cases:
3101
+
3102
+ - \`pending_approval\`: queued for the user's approval (see above).
3103
+ - \`insufficient_funds\`: the Haven wallet doesn't hold enough of that token.
3104
+ Suggest the user add funds in the Haven dashboard.
3105
+ - Budget exceeded: tell the user how much remains (from
3106
+ \`haven_get_allowances\`) and that they can raise the budget in Haven.
3107
+
3108
+ ## Revoke
3109
+
3110
+ If this agent's credential may have leaked, tell the user to pause or revoke
3111
+ the agent in the Haven dashboard under Agents. New requests stop immediately
3112
+ for that credential.
3113
+ `;
3114
+ var SKILL_FOLDER_NAME = "haven-pay";
3115
+
3116
+ export { AGENT_PAYMENT_NEXT_ACTION_VALUES, AGENT_PAYMENT_PHASE_VALUES, AGENT_PAYMENT_RAIL_VALUES, AgentPaymentNextAction, AgentPaymentNextActionDescriptions, AgentPaymentNextActionSchema, AgentPaymentPhase, AgentPaymentPhaseDescriptions, AgentPaymentPhaseSchema, AgentPaymentRail, AgentPaymentRailDescriptions, AgentPaymentRailSchema, HAVEN_SKILL_MD, HavenApiError, HavenClient, HavenError, HavenPaymentStateError, HavenSigningError, HavenTimeoutError, SKILL_FOLDER_NAME, addressFromKey, buildMachinePaymentIdempotencyKey, buildX402ExpectedMessage, composeDescription, decodeBase64Json, decodeBase64Utf8, encodeBase64Json, encodeBase64Utf8, encodeMachinePaymentProof, encodePaymentProof, havenTools, parseMachinePaymentChallenge, parseMachinePaymentChallengeResponse, parsePaymentRequired, parsePaymentRequiredResponse, selectPaymentOption, selectStandardPaymentOption, signHash, toStandardPaymentRequirements, toolDescriptions, verifySignature, x402AuthorizationAmount };
3048
3117
  //# sourceMappingURL=index.js.map
3049
3118
  //# sourceMappingURL=index.js.map