@haven_ai/connect 0.1.10-alpha.0 → 0.1.11-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/cli.js CHANGED
@@ -7,7 +7,6 @@ import { join, resolve, dirname } from 'path';
7
7
  import { execFile, spawn } from 'child_process';
8
8
  import { promisify } from 'util';
9
9
  import { registeredToolNames, MCP_VERSION, ensureConsent, computeConsentHash, loadCredentials, consentInputFromClient } from '@haven_ai/mcp';
10
- import { SKILL_FOLDER_NAME, HAVEN_SKILL_MD } from '@haven_ai/sdk';
11
10
  import { ensureSignerConsent, computeSignerConsentHash, loadSignerCredentials, createEdgeSigner, toolSchemas } from '@haven_ai/signer';
12
11
 
13
12
  // src/api.ts
@@ -208,9 +207,9 @@ var MCP_RUNTIME_MANIFEST = {
208
207
  mcpPackage: "@haven_ai/mcp",
209
208
  mcpVersion: MCP_VERSION,
210
209
  sdkPackage: "@haven_ai/sdk",
211
- sdkVersion: "0.1.10-alpha.0",
210
+ sdkVersion: "0.1.11-alpha.0",
212
211
  signerPackage: "@haven_ai/signer",
213
- signerVersion: "0.1.10-alpha.0",
212
+ signerVersion: "0.1.11-alpha.0",
214
213
  minimumNodeVersion: "20.0.0",
215
214
  supportedClients: ["codex-cli", "codex-desktop", "claude-code"],
216
215
  requiredTools: registeredToolNames()
@@ -1151,6 +1150,75 @@ async function assertFileExists(path, label) {
1151
1150
  throw new Error(`Missing ${label}: ${path}`);
1152
1151
  }
1153
1152
  }
1153
+
1154
+ // src/skill-content.ts
1155
+ var HAVEN_SKILL_MD = `---
1156
+ name: haven-pay
1157
+ 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.
1158
+ ---
1159
+
1160
+ # Haven: pay from a Haven wallet
1161
+
1162
+ This skill lets the agent make payments from the user's Haven wallet through
1163
+ the Haven MCP tools. Every payment is checked against the agent's on-chain
1164
+ budget before money moves; payments above the remaining budget wait for the
1165
+ user's approval in Haven.
1166
+
1167
+ ## When to use this skill
1168
+
1169
+ - The user asks to send money, pay someone, tip, donate, or transfer tokens.
1170
+ - A request returns HTTP 402 (x402): use the Haven pay tools to settle it,
1171
+ then retry the original request.
1172
+
1173
+ ## Identity and budget come from the tools \u2014 never assume them
1174
+
1175
+ Do not guess the wallet address, network, or budget. Read them live:
1176
+
1177
+ - \`haven_get_agent\` \u2014 agent identity, Haven wallet address, network.
1178
+ - \`haven_get_allowances\` \u2014 current per-token budgets and what remains.
1179
+
1180
+ Budgets reset on a period the user chose. If a payment exceeds the remaining
1181
+ budget it is queued for the user to approve in the Haven dashboard \u2014 this is
1182
+ normal, not an error.
1183
+
1184
+ ## Paying
1185
+
1186
+ - **Direct transfer:** \`haven_pay\` with recipient, amount, and token.
1187
+ - **x402 paywall:** \`haven_quote_x402\` to get a quote, then
1188
+ \`haven_pay_x402_quote\`. In the hosted setup the signing step happens in
1189
+ the local Haven signer; follow the tool results \u2014 they tell you the next
1190
+ action at every step. Retry the original request only when the result says
1191
+ \`retry_original_x402_request\`.
1192
+ - **Status:** \`haven_get_payment_status\` with a \`payment_id\` to check on
1193
+ queued or in-flight payments. Do not poll in a tight loop.
1194
+
1195
+ ## Approval semantics
1196
+
1197
+ - A result with \`pending_approval\` means the payment exceeded the remaining
1198
+ budget and is waiting for the user in Haven. Tell the user, then check
1199
+ status later.
1200
+ - Never ask the user for private keys and never try to sign anything
1201
+ yourself \u2014 Haven signs. If a tool reports a missing or invalid credential,
1202
+ tell the user to re-run the Haven setup command.
1203
+
1204
+ ## Failure handling
1205
+
1206
+ Haven errors are shaped \`{ error, status, details? }\` and written for
1207
+ humans \u2014 surface the message verbatim. Common cases:
1208
+
1209
+ - \`pending_approval\`: queued for the user's approval (see above).
1210
+ - \`insufficient_funds\`: the Haven wallet doesn't hold enough of that token.
1211
+ Suggest the user add funds in the Haven dashboard.
1212
+ - Budget exceeded: tell the user how much remains (from
1213
+ \`haven_get_allowances\`) and that they can raise the budget in Haven.
1214
+
1215
+ ## Revoke
1216
+
1217
+ If this agent's credential may have leaked, tell the user to pause or revoke
1218
+ the agent in the Haven dashboard under Agents. New requests stop immediately
1219
+ for that credential.
1220
+ `;
1221
+ var SKILL_FOLDER_NAME = "haven-pay";
1154
1222
  async function acknowledgeLocalSignerConsent(signerPath, log) {
1155
1223
  try {
1156
1224
  const input = await buildSignerConsentInput(signerPath);
@@ -1528,7 +1596,7 @@ function localRuntimePrepareErrorCode(err) {
1528
1596
  }
1529
1597
 
1530
1598
  // src/runtime.ts
1531
- var CONNECTOR_VERSION = "0.1.2";
1599
+ var CONNECTOR_VERSION = "0.1.11-alpha.0";
1532
1600
  async function runConnect(options, deps = {}) {
1533
1601
  const connectorVersion = options.connectorVersion ?? CONNECTOR_VERSION;
1534
1602
  const api = deps.api ?? createConnectApiClient(options.apiBaseUrl);