@dudko.dev/agent-web 0.0.2 → 0.0.4

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
@@ -1,5 +1,5 @@
1
1
  import * as ai from 'ai';
2
- import { LanguageModel, ToolSet, Tool, ModelMessage, generateText, streamText, tool } from 'ai';
2
+ import { LanguageModel, ToolSet, Tool, ModelMessage, generateText, streamText } from 'ai';
3
3
  import { z, ZodType } from 'zod';
4
4
  import { IDBPDatabase } from 'idb';
5
5
 
@@ -769,13 +769,17 @@ declare const normalizeUsage: (u?: {
769
769
  totalTokens?: number;
770
770
  }) => IUsage;
771
771
 
772
- type ToolConfig = Parameters<typeof tool>[0];
773
772
  /**
774
773
  * Define a host tool. Thin wrapper over the AI SDK `tool()`: pass a
775
774
  * `description`, an `inputSchema` (a Zod schema or the result of `jsonSchema()`),
776
775
  * and an `execute` function. The returned tool works unchanged on the native
777
776
  * tool-calling path.
778
777
  *
778
+ * Generic over INPUT/OUTPUT so the schema's inferred type flows into
779
+ * `execute(input)` — `Parameters<typeof tool>[0]` must NOT be used here: with
780
+ * an overloaded `tool()` it resolves to the last overload (`Tool<never, never>`),
781
+ * which rejects every real schema and types `execute` as `undefined`.
782
+ *
779
783
  * Optionally add `promptHint` — a short parameter hint like
780
784
  * "{ text: string, x?: number }" — which the prompted/salvage path shows to
781
785
  * weak local models that can't do native function-calling.
@@ -790,7 +794,7 @@ type ToolConfig = Parameters<typeof tool>[0];
790
794
  * }),
791
795
  * }
792
796
  */
793
- declare const defineTool: (config: ToolConfig & {
797
+ declare const defineTool: <INPUT = unknown, OUTPUT = unknown>(config: Tool<INPUT, OUTPUT> & {
794
798
  promptHint?: string;
795
799
  }) => AgentTool;
796
800
 
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as ai from 'ai';
2
- import { LanguageModel, ToolSet, Tool, ModelMessage, generateText, streamText, tool } from 'ai';
2
+ import { LanguageModel, ToolSet, Tool, ModelMessage, generateText, streamText } from 'ai';
3
3
  import { z, ZodType } from 'zod';
4
4
  import { IDBPDatabase } from 'idb';
5
5
 
@@ -769,13 +769,17 @@ declare const normalizeUsage: (u?: {
769
769
  totalTokens?: number;
770
770
  }) => IUsage;
771
771
 
772
- type ToolConfig = Parameters<typeof tool>[0];
773
772
  /**
774
773
  * Define a host tool. Thin wrapper over the AI SDK `tool()`: pass a
775
774
  * `description`, an `inputSchema` (a Zod schema or the result of `jsonSchema()`),
776
775
  * and an `execute` function. The returned tool works unchanged on the native
777
776
  * tool-calling path.
778
777
  *
778
+ * Generic over INPUT/OUTPUT so the schema's inferred type flows into
779
+ * `execute(input)` — `Parameters<typeof tool>[0]` must NOT be used here: with
780
+ * an overloaded `tool()` it resolves to the last overload (`Tool<never, never>`),
781
+ * which rejects every real schema and types `execute` as `undefined`.
782
+ *
779
783
  * Optionally add `promptHint` — a short parameter hint like
780
784
  * "{ text: string, x?: number }" — which the prompted/salvage path shows to
781
785
  * weak local models that can't do native function-calling.
@@ -790,7 +794,7 @@ type ToolConfig = Parameters<typeof tool>[0];
790
794
  * }),
791
795
  * }
792
796
  */
793
- declare const defineTool: (config: ToolConfig & {
797
+ declare const defineTool: <INPUT = unknown, OUTPUT = unknown>(config: Tool<INPUT, OUTPUT> & {
794
798
  promptHint?: string;
795
799
  }) => AgentTool;
796
800
 
package/dist/index.js CHANGED
@@ -130,6 +130,7 @@ var PROVIDER_PACKAGE = {
130
130
  var loadProvider = async (pkg) => {
131
131
  try {
132
132
  return await import(
133
+ /* webpackIgnore: true */
133
134
  /* @vite-ignore */
134
135
  pkg
135
136
  );