toolwire 0.1.1

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.js ADDED
@@ -0,0 +1,674 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropNames = Object.getOwnPropertyNames;
3
+ var __esm = (fn, res) => function __init() {
4
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
5
+ };
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+
11
+ // node_modules/tsup/assets/esm_shims.js
12
+ import path from "path";
13
+ import { fileURLToPath } from "url";
14
+ var init_esm_shims = __esm({
15
+ "node_modules/tsup/assets/esm_shims.js"() {
16
+ "use strict";
17
+ }
18
+ });
19
+
20
+ // src/schema.ts
21
+ import { createRequire } from "module";
22
+ import * as zodNs from "zod";
23
+ function resolveJsonSchema(schema) {
24
+ const hit = cache.get(schema);
25
+ if (hit !== void 0) return hit;
26
+ const result = compute(schema);
27
+ cache.set(schema, result);
28
+ return result;
29
+ }
30
+ function compute(schema) {
31
+ const toJSONSchemaV4 = zodNs["toJSONSchema"];
32
+ if (typeof toJSONSchemaV4 === "function") {
33
+ const { $schema: _$schema, ...clean } = toJSONSchemaV4(schema);
34
+ return clean;
35
+ }
36
+ try {
37
+ const pkg = _require("zod-to-json-schema");
38
+ const { $schema: _$schema, ...clean } = pkg.zodToJsonSchema(schema, {
39
+ $refStrategy: "none"
40
+ });
41
+ return clean;
42
+ } catch {
43
+ throw new Error(
44
+ "toolwire: Cannot convert Zod schema to JSON Schema.\n \u2022 Zod v4: ensure zod@^4.0.0 is installed.\n \u2022 Zod v3: run `npm install zod-to-json-schema`.\n \u2022 Or supply a pre-computed schema via the `_jsonSchema` option in tool()."
45
+ );
46
+ }
47
+ }
48
+ var _require, cache;
49
+ var init_schema = __esm({
50
+ "src/schema.ts"() {
51
+ "use strict";
52
+ init_esm_shims();
53
+ _require = createRequire(import.meta.url);
54
+ cache = /* @__PURE__ */ new WeakMap();
55
+ }
56
+ });
57
+
58
+ // src/tool.ts
59
+ function tool(config) {
60
+ if (!NAME_RE.test(config.name)) {
61
+ throw new Error(
62
+ `toolwire: Invalid tool name "${config.name}". Names must be 1\u201364 characters containing only letters, digits, underscores, or hyphens.`
63
+ );
64
+ }
65
+ const inputSchema = config._jsonSchema ?? resolveJsonSchema(config.input);
66
+ const outputSchema = config.output ? resolveJsonSchema(config.output) : void 0;
67
+ const def = {
68
+ name: config.name,
69
+ description: config.description,
70
+ input: config.input,
71
+ output: config.output,
72
+ handler: config.handler,
73
+ timeout: config.timeout ?? DEFAULTS.timeout,
74
+ retries: config.retries ?? DEFAULTS.retries,
75
+ annotations: config.annotations ?? {},
76
+ inputSchema,
77
+ outputSchema
78
+ };
79
+ return Object.freeze(def);
80
+ }
81
+ var NAME_RE, DEFAULTS;
82
+ var init_tool = __esm({
83
+ "src/tool.ts"() {
84
+ "use strict";
85
+ init_esm_shims();
86
+ init_schema();
87
+ NAME_RE = /^[a-zA-Z0-9_-]{1,64}$/;
88
+ DEFAULTS = {
89
+ timeout: 3e4,
90
+ retries: 0
91
+ };
92
+ }
93
+ });
94
+
95
+ // src/errors.ts
96
+ function err(code, toolName, message, llmMessage, retryable, extras) {
97
+ return { code, toolName, message, llmMessage, retryable, ...extras };
98
+ }
99
+ function makeNotFoundError(toolName, available) {
100
+ const list = available.length > 0 ? `Available tools: ${available.join(", ")}.` : "No tools are currently registered.";
101
+ return err(
102
+ "NOT_FOUND",
103
+ toolName,
104
+ `Tool "${toolName}" is not registered`,
105
+ `The tool "${toolName}" does not exist. ${list} Please use one of the available tools.`,
106
+ true
107
+ );
108
+ }
109
+ function makeDisabledError(toolName) {
110
+ return err(
111
+ "DISABLED",
112
+ toolName,
113
+ `Tool "${toolName}" is currently disabled`,
114
+ `The tool "${toolName}" is currently disabled and cannot be called. Please try a different approach or wait until it is re-enabled.`,
115
+ false
116
+ );
117
+ }
118
+ function makeValidationInputError(toolName, issues) {
119
+ const lines = issues.map((i) => ` - ${i.path.length > 0 ? i.path.join(".") : "(root)"}: ${i.message}`).join("\n");
120
+ return err(
121
+ "VALIDATION_INPUT",
122
+ toolName,
123
+ `Invalid input for tool "${toolName}"`,
124
+ `Your call to "${toolName}" had invalid arguments:
125
+ ${lines}
126
+
127
+ Please fix these and try again.`,
128
+ true,
129
+ { issues }
130
+ );
131
+ }
132
+ function makeValidationOutputError(toolName, issues) {
133
+ return err(
134
+ "VALIDATION_OUTPUT",
135
+ toolName,
136
+ `Tool "${toolName}" returned an invalid response format`,
137
+ `The tool "${toolName}" returned an unexpected response and could not be used. This is a bug in the tool implementation, not in your call. Please try a different approach.`,
138
+ false,
139
+ { issues }
140
+ );
141
+ }
142
+ function makeTimeoutError(toolName, timeoutMs) {
143
+ return err(
144
+ "TIMEOUT",
145
+ toolName,
146
+ `Tool "${toolName}" timed out after ${timeoutMs}ms`,
147
+ `The tool "${toolName}" timed out after ${timeoutMs}ms. This may be a temporary issue \u2014 please wait a moment before retrying.`,
148
+ true,
149
+ { retryAfterMs: Math.min(timeoutMs, 5e3) }
150
+ );
151
+ }
152
+ function makeExecutionError(toolName, cause, attempts) {
153
+ const msg = cause instanceof Error ? cause.message : String(cause);
154
+ const attemptStr = attempts > 1 ? ` after ${attempts} attempt(s)` : "";
155
+ return err(
156
+ "EXECUTION",
157
+ toolName,
158
+ `Tool "${toolName}" failed${attemptStr}: ${msg}`,
159
+ `The tool "${toolName}" encountered an error${attemptStr}: ${msg}. All retries have been exhausted \u2014 please try a different approach.`,
160
+ false,
161
+ { cause }
162
+ );
163
+ }
164
+ function makeFailure(toolName, error, durationMs) {
165
+ return { success: false, toolName, error, durationMs };
166
+ }
167
+ var init_errors = __esm({
168
+ "src/errors.ts"() {
169
+ "use strict";
170
+ init_esm_shims();
171
+ }
172
+ });
173
+
174
+ // src/middleware.ts
175
+ async function runBefore(middleware, toolName, args) {
176
+ let current = args;
177
+ for (const mw of middleware) {
178
+ if (mw.beforeCall) {
179
+ const next = await mw.beforeCall(toolName, current);
180
+ if (next !== void 0) current = next;
181
+ }
182
+ }
183
+ return current;
184
+ }
185
+ async function runAfter(middleware, toolName, args, result) {
186
+ let current = result;
187
+ for (let i = middleware.length - 1; i >= 0; i--) {
188
+ const mw = middleware[i];
189
+ if (mw?.afterCall) {
190
+ const next = await mw.afterCall(toolName, args, current);
191
+ if (next !== void 0) current = next;
192
+ }
193
+ }
194
+ return current;
195
+ }
196
+ async function runOnError(middleware, toolName, args, failure) {
197
+ for (const mw of middleware) {
198
+ if (mw.onError) {
199
+ const recovery = await mw.onError(toolName, args, failure);
200
+ if (recovery !== void 0) return recovery;
201
+ }
202
+ }
203
+ return failure;
204
+ }
205
+ var init_middleware = __esm({
206
+ "src/middleware.ts"() {
207
+ "use strict";
208
+ init_esm_shims();
209
+ }
210
+ });
211
+
212
+ // src/adapters/anthropic.ts
213
+ function toAnthropic(tools) {
214
+ return tools.map((t) => ({
215
+ name: t.name,
216
+ description: t.description,
217
+ input_schema: t.inputSchema
218
+ }));
219
+ }
220
+ var init_anthropic = __esm({
221
+ "src/adapters/anthropic.ts"() {
222
+ "use strict";
223
+ init_esm_shims();
224
+ }
225
+ });
226
+
227
+ // src/adapters/gemini.ts
228
+ function toGemini(tools) {
229
+ return {
230
+ functionDeclarations: tools.map((t) => ({
231
+ name: t.name,
232
+ description: t.description,
233
+ parametersJsonSchema: t.inputSchema
234
+ }))
235
+ };
236
+ }
237
+ var init_gemini = __esm({
238
+ "src/adapters/gemini.ts"() {
239
+ "use strict";
240
+ init_esm_shims();
241
+ }
242
+ });
243
+
244
+ // src/adapters/openai.ts
245
+ function toOpenAI(tools, options) {
246
+ return tools.map((t) => {
247
+ const fn = {
248
+ name: t.name,
249
+ description: t.description,
250
+ parameters: t.inputSchema
251
+ };
252
+ if (options?.strict !== void 0) {
253
+ fn.strict = options.strict;
254
+ }
255
+ return { type: "function", function: fn };
256
+ });
257
+ }
258
+ var init_openai = __esm({
259
+ "src/adapters/openai.ts"() {
260
+ "use strict";
261
+ init_esm_shims();
262
+ }
263
+ });
264
+
265
+ // src/adapters/vercel-ai.ts
266
+ function toVercelAI(tools) {
267
+ return Object.fromEntries(
268
+ tools.map((t) => [
269
+ t.name,
270
+ {
271
+ description: t.description,
272
+ parameters: t.input
273
+ }
274
+ ])
275
+ );
276
+ }
277
+ var init_vercel_ai = __esm({
278
+ "src/adapters/vercel-ai.ts"() {
279
+ "use strict";
280
+ init_esm_shims();
281
+ }
282
+ });
283
+
284
+ // src/discovery.ts
285
+ var discovery_exports = {};
286
+ __export(discovery_exports, {
287
+ fromDir: () => fromDir,
288
+ fromManifest: () => fromManifest
289
+ });
290
+ import { readdir } from "fs/promises";
291
+ import { join, resolve } from "path";
292
+ import { pathToFileURL } from "url";
293
+ async function fromDir(dirPath) {
294
+ const absPath = resolve(dirPath);
295
+ let files;
296
+ try {
297
+ files = await readdir(absPath);
298
+ } catch (err2) {
299
+ throw new Error(
300
+ `toolwire: Cannot read directory "${absPath}": ${err2 instanceof Error ? err2.message : String(err2)}`
301
+ );
302
+ }
303
+ const toolFiles = files.filter((f) => /\.(js|mjs|cjs)$/.test(f));
304
+ const discovered = [];
305
+ for (const file of toolFiles) {
306
+ const fileUrl = pathToFileURL(join(absPath, file)).href;
307
+ try {
308
+ const mod = await import(fileUrl);
309
+ discovered.push(...extractTools(mod));
310
+ } catch (err2) {
311
+ console.warn(
312
+ `toolwire: Skipping "${file}" (failed to import):`,
313
+ err2 instanceof Error ? err2.message : err2
314
+ );
315
+ }
316
+ }
317
+ return new ToolRegistry(discovered);
318
+ }
319
+ async function fromManifest(url) {
320
+ let manifest;
321
+ try {
322
+ const response = await fetch(url);
323
+ if (!response.ok) {
324
+ throw new Error(`HTTP ${response.status} ${response.statusText}`);
325
+ }
326
+ manifest = await response.json();
327
+ } catch (err2) {
328
+ throw new Error(
329
+ `toolwire: Failed to fetch manifest from "${url}": ${err2 instanceof Error ? err2.message : String(err2)}`
330
+ );
331
+ }
332
+ if (manifest.version !== "1.0" || !Array.isArray(manifest.tools)) {
333
+ throw new Error(
334
+ 'toolwire: Invalid manifest. Expected { version: "1.0", tools: [...] }'
335
+ );
336
+ }
337
+ const { z } = await import("zod");
338
+ const tools = manifest.tools.map(
339
+ (entry) => tool({
340
+ name: entry.name,
341
+ description: entry.description,
342
+ input: z.record(z.string(), z.unknown()),
343
+ _jsonSchema: entry.inputSchema,
344
+ handler: async (input) => {
345
+ const res = await fetch(entry.endpoint, {
346
+ method: "POST",
347
+ headers: { "Content-Type": "application/json" },
348
+ body: JSON.stringify(input)
349
+ });
350
+ if (!res.ok) throw new Error(`HTTP ${res.status}: ${res.statusText}`);
351
+ return res.json();
352
+ }
353
+ })
354
+ );
355
+ return new ToolRegistry(tools);
356
+ }
357
+ function isToolDefinition(value) {
358
+ return typeof value === "object" && value !== null && typeof value["name"] === "string" && typeof value["description"] === "string" && typeof value["handler"] === "function";
359
+ }
360
+ function extractTools(mod) {
361
+ if (isToolDefinition(mod["default"])) {
362
+ return [mod["default"]];
363
+ }
364
+ if (Array.isArray(mod["tools"])) {
365
+ const found = mod["tools"].filter(isToolDefinition);
366
+ if (found.length > 0) return found;
367
+ }
368
+ return Object.entries(mod).filter(([key]) => key !== "default" && key !== "tools").map(([, value]) => value).filter(isToolDefinition);
369
+ }
370
+ var init_discovery = __esm({
371
+ "src/discovery.ts"() {
372
+ "use strict";
373
+ init_esm_shims();
374
+ init_registry();
375
+ init_tool();
376
+ }
377
+ });
378
+
379
+ // src/registry.ts
380
+ function registry(tools = [], options = {}) {
381
+ return new ToolRegistry(tools, options);
382
+ }
383
+ async function withTimeout(fn, ms, toolName) {
384
+ const controller = new AbortController();
385
+ const timer = setTimeout(() => {
386
+ controller.abort(
387
+ new DOMException(`Tool "${toolName}" timed out after ${ms}ms`, "AbortError")
388
+ );
389
+ }, ms);
390
+ const execution = Promise.resolve().then(() => fn(controller.signal));
391
+ const timeoutRace = new Promise((_, reject) => {
392
+ controller.signal.addEventListener("abort", () => reject(controller.signal.reason), {
393
+ once: true
394
+ });
395
+ });
396
+ try {
397
+ return await Promise.race([execution, timeoutRace]);
398
+ } finally {
399
+ clearTimeout(timer);
400
+ execution.catch(() => void 0);
401
+ }
402
+ }
403
+ function isAbortError(err2) {
404
+ return err2 instanceof Error && (err2.name === "AbortError" || err2 instanceof DOMException && err2.name === "AbortError");
405
+ }
406
+ function sleep(ms) {
407
+ return new Promise((resolve2) => setTimeout(resolve2, ms));
408
+ }
409
+ var ToolRegistry;
410
+ var init_registry = __esm({
411
+ "src/registry.ts"() {
412
+ "use strict";
413
+ init_esm_shims();
414
+ init_errors();
415
+ init_middleware();
416
+ init_anthropic();
417
+ init_gemini();
418
+ init_openai();
419
+ init_vercel_ai();
420
+ ToolRegistry = class {
421
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
422
+ tools = /* @__PURE__ */ new Map();
423
+ disabledTools = /* @__PURE__ */ new Set();
424
+ _middleware = [];
425
+ options;
426
+ constructor(tools = [], options = {}) {
427
+ this.options = options;
428
+ for (const t of tools) {
429
+ this.tools.set(t.name, t);
430
+ }
431
+ }
432
+ // ---------------------------------------------------------------------------
433
+ // Tool management
434
+ // ---------------------------------------------------------------------------
435
+ /** Add one or more tools. Returns `this` for chaining. */
436
+ register(tools) {
437
+ const list = Array.isArray(tools) ? tools : [tools];
438
+ for (const t of list) this.tools.set(t.name, t);
439
+ return this;
440
+ }
441
+ /**
442
+ * Replace a registered tool in-place (hot-swap).
443
+ * Useful for swapping slow tools with cached versions mid-run.
444
+ */
445
+ swap(name, newTool) {
446
+ if (!this.tools.has(name)) {
447
+ throw new Error(`toolwire: Cannot swap "${name}" \u2014 it is not registered.`);
448
+ }
449
+ this.tools.set(name, newTool);
450
+ return this;
451
+ }
452
+ /** Temporarily prevent a tool from being called. */
453
+ disable(name) {
454
+ if (!this.tools.has(name)) {
455
+ throw new Error(`toolwire: Cannot disable "${name}" \u2014 it is not registered.`);
456
+ }
457
+ this.disabledTools.add(name);
458
+ return this;
459
+ }
460
+ /** Re-enable a previously disabled tool. */
461
+ enable(name) {
462
+ if (!this.tools.has(name)) {
463
+ throw new Error(`toolwire: Cannot enable "${name}" \u2014 it is not registered.`);
464
+ }
465
+ this.disabledTools.delete(name);
466
+ return this;
467
+ }
468
+ /** Add middleware. Returns `this` for chaining. */
469
+ use(middleware) {
470
+ const list = Array.isArray(middleware) ? middleware : [middleware];
471
+ this._middleware.push(...list);
472
+ return this;
473
+ }
474
+ /** Return the names of all registered tools (including disabled ones). */
475
+ list() {
476
+ return [...this.tools.keys()];
477
+ }
478
+ /** Return a tool definition by name, or undefined if not found. */
479
+ get(name) {
480
+ return this.tools.get(name);
481
+ }
482
+ /**
483
+ * Return a human-readable list of enabled tools.
484
+ * Handy for injecting into a system prompt.
485
+ */
486
+ describe() {
487
+ const enabled = [...this.tools.values()].filter(
488
+ (t) => !this.disabledTools.has(t.name)
489
+ );
490
+ if (enabled.length === 0) return "No tools are currently available.";
491
+ return enabled.map((t) => `- ${t.name}: ${t.description}`).join("\n");
492
+ }
493
+ // ---------------------------------------------------------------------------
494
+ // Execution
495
+ // ---------------------------------------------------------------------------
496
+ /**
497
+ * Execute a tool call from an LLM.
498
+ * Always resolves (never throws) — check `result.success` to distinguish outcomes.
499
+ */
500
+ async call(request) {
501
+ const start = Date.now();
502
+ const { name: toolName, arguments: rawArgs } = request;
503
+ const toolDef = this.tools.get(toolName);
504
+ if (!toolDef) {
505
+ return runOnError(
506
+ this._middleware,
507
+ toolName,
508
+ rawArgs,
509
+ makeFailure(toolName, makeNotFoundError(toolName, this.list()), Date.now() - start)
510
+ );
511
+ }
512
+ if (this.disabledTools.has(toolName)) {
513
+ return runOnError(
514
+ this._middleware,
515
+ toolName,
516
+ rawArgs,
517
+ makeFailure(toolName, makeDisabledError(toolName), Date.now() - start)
518
+ );
519
+ }
520
+ const parsed = toolDef.input.safeParse(rawArgs);
521
+ if (!parsed.success) {
522
+ return runOnError(
523
+ this._middleware,
524
+ toolName,
525
+ rawArgs,
526
+ makeFailure(
527
+ toolName,
528
+ makeValidationInputError(toolName, parsed.error.issues),
529
+ Date.now() - start
530
+ )
531
+ );
532
+ }
533
+ let args = parsed.data;
534
+ try {
535
+ args = await runBefore(this._middleware, toolName, args);
536
+ } catch (err2) {
537
+ return runOnError(
538
+ this._middleware,
539
+ toolName,
540
+ rawArgs,
541
+ makeFailure(toolName, makeExecutionError(toolName, err2, 1), Date.now() - start)
542
+ );
543
+ }
544
+ const timeout = toolDef.timeout ?? this.options.defaultTimeout ?? 3e4;
545
+ const maxAttempts = toolDef.retries + 1;
546
+ let lastError;
547
+ for (let attempt = 0; attempt < maxAttempts; attempt++) {
548
+ try {
549
+ const data = await withTimeout(
550
+ (signal) => toolDef.handler(args, { signal, attempt }),
551
+ timeout,
552
+ toolName
553
+ );
554
+ let output = data;
555
+ if (toolDef.output) {
556
+ const outParsed = toolDef.output.safeParse(data);
557
+ if (!outParsed.success) {
558
+ return runOnError(
559
+ this._middleware,
560
+ toolName,
561
+ rawArgs,
562
+ makeFailure(
563
+ toolName,
564
+ makeValidationOutputError(toolName, outParsed.error.issues),
565
+ Date.now() - start
566
+ )
567
+ );
568
+ }
569
+ output = outParsed.data;
570
+ }
571
+ const raw = {
572
+ success: true,
573
+ data: output,
574
+ toolName,
575
+ durationMs: Date.now() - start
576
+ };
577
+ return await runAfter(this._middleware, toolName, rawArgs, raw);
578
+ } catch (err2) {
579
+ lastError = err2;
580
+ if (isAbortError(err2)) {
581
+ return runOnError(
582
+ this._middleware,
583
+ toolName,
584
+ rawArgs,
585
+ makeFailure(toolName, makeTimeoutError(toolName, timeout), Date.now() - start)
586
+ );
587
+ }
588
+ if (attempt < maxAttempts - 1) {
589
+ await sleep(100 * 2 ** attempt);
590
+ }
591
+ }
592
+ }
593
+ return runOnError(
594
+ this._middleware,
595
+ toolName,
596
+ rawArgs,
597
+ makeFailure(
598
+ toolName,
599
+ makeExecutionError(toolName, lastError, maxAttempts),
600
+ Date.now() - start
601
+ )
602
+ );
603
+ }
604
+ // ---------------------------------------------------------------------------
605
+ // Provider adapters
606
+ // ---------------------------------------------------------------------------
607
+ /** Export tool schemas in OpenAI function-calling format. */
608
+ toOpenAI(options) {
609
+ return toOpenAI(this.enabledTools(), options);
610
+ }
611
+ /** Export tool schemas in Anthropic tool-use format. */
612
+ toAnthropic() {
613
+ return toAnthropic(this.enabledTools());
614
+ }
615
+ /** Export tool schemas in Google Gemini format. */
616
+ toGemini() {
617
+ return toGemini(this.enabledTools());
618
+ }
619
+ /** Export tool schemas in Vercel AI SDK format (passes Zod schemas directly). */
620
+ toVercelAI() {
621
+ return toVercelAI(this.enabledTools());
622
+ }
623
+ // ---------------------------------------------------------------------------
624
+ // Static factory methods
625
+ // ---------------------------------------------------------------------------
626
+ /** Load tools from a directory of compiled JS/MJS files. */
627
+ static async fromDir(dirPath) {
628
+ const { fromDir: fromDir2 } = await Promise.resolve().then(() => (init_discovery(), discovery_exports));
629
+ return fromDir2(dirPath);
630
+ }
631
+ /** Load tools from a remote JSON manifest. */
632
+ static async fromManifest(url) {
633
+ const { fromManifest: fromManifest2 } = await Promise.resolve().then(() => (init_discovery(), discovery_exports));
634
+ return fromManifest2(url);
635
+ }
636
+ // ---------------------------------------------------------------------------
637
+ // Private helpers
638
+ // ---------------------------------------------------------------------------
639
+ enabledTools() {
640
+ return [...this.tools.values()].filter((t) => !this.disabledTools.has(t.name));
641
+ }
642
+ };
643
+ }
644
+ });
645
+
646
+ // src/index.ts
647
+ init_esm_shims();
648
+ init_tool();
649
+ init_registry();
650
+ init_openai();
651
+ init_anthropic();
652
+ init_gemini();
653
+ init_vercel_ai();
654
+ init_discovery();
655
+ init_errors();
656
+ export {
657
+ ToolRegistry,
658
+ fromDir,
659
+ fromManifest,
660
+ makeDisabledError,
661
+ makeExecutionError,
662
+ makeFailure,
663
+ makeNotFoundError,
664
+ makeTimeoutError,
665
+ makeValidationInputError,
666
+ makeValidationOutputError,
667
+ registry,
668
+ toAnthropic,
669
+ toGemini,
670
+ toOpenAI,
671
+ toVercelAI,
672
+ tool
673
+ };
674
+ //# sourceMappingURL=index.js.map