@firstlovecenter/ai-chat 0.2.3 → 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.
@@ -1,4 +1,5 @@
1
1
  import { GoogleAuth } from 'google-auth-library';
2
+ import { ZodType } from 'zod';
2
3
 
3
4
  /**
4
5
  * Tool typing for the agent loop.
@@ -39,8 +40,16 @@ type ToolResult = {
39
40
  message: string;
40
41
  };
41
42
  };
43
+
42
44
  type ToolDefinition<I = unknown, S = unknown> = {
43
45
  schema: ToolSchema;
46
+ /**
47
+ * Optional Zod schema for the same input. Required by the Vercel AI SDK
48
+ * route (which needs Zod to feed `tool({ parameters })`); the custom
49
+ * SSE route ignores it. Tools registered without a `zodSchema` will
50
+ * cause `buildVercelTools` to throw at config time.
51
+ */
52
+ zodSchema?: ZodType<I>;
44
53
  execute(input: I, ctx: ToolContext<S>): Promise<ToolResult>;
45
54
  };
46
55
  /** The terminal tool that closes the agent loop. The host's tool registry MUST include it. */
@@ -1,4 +1,5 @@
1
1
  import { GoogleAuth } from 'google-auth-library';
2
+ import { ZodType } from 'zod';
2
3
 
3
4
  /**
4
5
  * Tool typing for the agent loop.
@@ -39,8 +40,16 @@ type ToolResult = {
39
40
  message: string;
40
41
  };
41
42
  };
43
+
42
44
  type ToolDefinition<I = unknown, S = unknown> = {
43
45
  schema: ToolSchema;
46
+ /**
47
+ * Optional Zod schema for the same input. Required by the Vercel AI SDK
48
+ * route (which needs Zod to feed `tool({ parameters })`); the custom
49
+ * SSE route ignores it. Tools registered without a `zodSchema` will
50
+ * cause `buildVercelTools` to throw at config time.
51
+ */
52
+ zodSchema?: ZodType<I>;
44
53
  execute(input: I, ctx: ToolContext<S>): Promise<ToolResult>;
45
54
  };
46
55
  /** The terminal tool that closes the agent loop. The host's tool registry MUST include it. */