@signet-auth/vercel-ai 0.4.5 → 0.5.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.
@@ -32,6 +32,8 @@ export interface SignetCallbackOptions {
32
32
  target?: string;
33
33
  /** Whether to include tool args hash in the receipt (default: true). */
34
34
  hashArgs?: boolean;
35
+ /** Custom warning logger. Defaults to console.warn. Set to `() => {}` to silence. */
36
+ onWarn?: (message: string, error: unknown) => void;
35
37
  }
36
38
  /**
37
39
  * Create Vercel AI SDK callbacks that sign every tool call with Signet.
package/dist/src/index.js CHANGED
@@ -31,6 +31,7 @@ export function createSignetCallbacks(secretKey, signerName, options = {}) {
31
31
  const signerOwner = options.signerOwner ?? "";
32
32
  const target = options.target ?? "vercel-ai://local";
33
33
  const hashArgs = options.hashArgs ?? true;
34
+ const warn = options.onWarn ?? ((msg, err) => console.warn(msg, err));
34
35
  const receipts = [];
35
36
  return {
36
37
  receipts,
@@ -48,7 +49,7 @@ export function createSignetCallbacks(secretKey, signerName, options = {}) {
48
49
  }
49
50
  catch (err) {
50
51
  // Never block tool execution, but log for debugging
51
- console.warn("[signet] Failed to sign tool call:", err);
52
+ warn("[signet] Failed to sign tool call:", err);
52
53
  }
53
54
  },
54
55
  experimental_onToolCallFinish({ toolCallId, toolName, result, durationMs, }) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signet-auth/vercel-ai",
3
- "version": "0.4.5",
3
+ "version": "0.5.0",
4
4
  "description": "Vercel AI SDK callbacks for signing Signet tool-call receipts",
5
5
  "keywords": [
6
6
  "signet",
@@ -22,7 +22,9 @@
22
22
  "type": "module",
23
23
  "main": "dist/src/index.js",
24
24
  "types": "dist/src/index.d.ts",
25
- "files": ["dist/"],
25
+ "files": [
26
+ "dist/"
27
+ ],
26
28
  "scripts": {
27
29
  "build": "npx tsc",
28
30
  "test": "npx tsc -p tsconfig.test.json && node --test dist-test/tests/vercel-ai.test.js"
@@ -31,7 +33,7 @@
31
33
  "access": "public"
32
34
  },
33
35
  "dependencies": {
34
- "@signet-auth/core": "^0.4.5"
36
+ "@signet-auth/core": "^0.5.0"
35
37
  },
36
38
  "devDependencies": {
37
39
  "@types/node": "^22",