@typia/vercel 12.0.2 → 13.0.0-dev.20260425
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/lib/_virtual/VercelParameterConverter.mjs +4 -0
- package/lib/_virtual/VercelParameterConverter.mjs.map +1 -0
- package/lib/_virtual/VercelToolsRegistrar.mjs +4 -0
- package/lib/_virtual/VercelToolsRegistrar.mjs.map +1 -0
- package/lib/_virtual/_commonjsHelpers.mjs +6 -0
- package/lib/_virtual/_commonjsHelpers.mjs.map +1 -0
- package/lib/_virtual/index.mjs +4 -0
- package/lib/_virtual/index.mjs.map +1 -0
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +5 -125
- package/lib/index.mjs.map +1 -1
- package/lib/index2.mjs +142 -0
- package/lib/index2.mjs.map +1 -0
- package/lib/internal/VercelParameterConverter.js.map +1 -1
- package/lib/internal/VercelParameterConverter.mjs +5 -6
- package/lib/internal/VercelParameterConverter.mjs.map +1 -1
- package/lib/internal/VercelParameterConverter2.mjs +21 -0
- package/lib/internal/VercelParameterConverter2.mjs.map +1 -0
- package/lib/internal/VercelToolsRegistrar.js.map +1 -1
- package/lib/internal/VercelToolsRegistrar.mjs +5 -123
- package/lib/internal/VercelToolsRegistrar.mjs.map +1 -1
- package/lib/internal/VercelToolsRegistrar2.mjs +151 -0
- package/lib/internal/VercelToolsRegistrar2.mjs.map +1 -0
- package/package.json +8 -9
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VercelParameterConverter.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VercelToolsRegistrar.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_commonjsHelpers.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAOA,kFAA+E;AAC/E,0EAAuE;AAEvE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4EG;AACH,uBAA8B,KAoB7B;IACC,OAAO,2CAAoB,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC7C,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBACE,UAAkC;IAElC,OAAO,mDAAwB,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;AACtD,CAAC"}
|
package/lib/index.mjs
CHANGED
|
@@ -1,128 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { getDefaultExportFromCjs } from './_virtual/_commonjsHelpers.mjs';
|
|
2
|
+
import { __require as requireLib } from './index2.mjs';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
*
|
|
7
|
-
* Transforms TypeScript class methods via `typia.llm.controller<Class>()` or
|
|
8
|
-
* OpenAPI operations via `HttpLlm.controller()` into Vercel AI SDK tools that
|
|
9
|
-
* can be used with any LLM provider (OpenAI, Anthropic, Google, etc.).
|
|
10
|
-
*
|
|
11
|
-
* Every tool call is validated by typia. If the LLM provides invalid arguments,
|
|
12
|
-
* returns a validation error formatted by {@link LlmJson.stringify} so the LLM
|
|
13
|
-
* can auto-correct in the next turn.
|
|
14
|
-
*
|
|
15
|
-
* ## Example with OpenAI
|
|
16
|
-
*
|
|
17
|
-
* ```typescript
|
|
18
|
-
* import { generateText } from "ai";
|
|
19
|
-
* import { openai } from "@ai-sdk/openai";
|
|
20
|
-
* import typia from "typia";
|
|
21
|
-
* import { toVercelTools } from "@typia/vercel";
|
|
22
|
-
*
|
|
23
|
-
* class Calculator {
|
|
24
|
-
* /** Add two numbers together. */
|
|
25
|
-
* add(props: { a: number; b: number }): { value: number } {
|
|
26
|
-
* return { value: props.a + props.b };
|
|
27
|
-
* }
|
|
28
|
-
* }
|
|
29
|
-
*
|
|
30
|
-
* const controller = typia.llm.controller<Calculator>("calc", new Calculator());
|
|
31
|
-
* const tools = toVercelTools({ controllers: [controller] });
|
|
32
|
-
*
|
|
33
|
-
* const result = await generateText({
|
|
34
|
-
* model: openai("gpt-4o"),
|
|
35
|
-
* tools,
|
|
36
|
-
* prompt: "What is 15 + 27?",
|
|
37
|
-
* });
|
|
38
|
-
* ```
|
|
39
|
-
*
|
|
40
|
-
* ## Example with Anthropic
|
|
41
|
-
*
|
|
42
|
-
* ```typescript
|
|
43
|
-
* import { anthropic } from "@ai-sdk/anthropic";
|
|
44
|
-
* import { toVercelTools } from "@typia/vercel";
|
|
45
|
-
* import { generateText } from "ai";
|
|
46
|
-
*
|
|
47
|
-
* const result = await generateText({
|
|
48
|
-
* model: anthropic("claude-sonnet-4-20250514"),
|
|
49
|
-
* tools: toVercelTools({ controllers: [controller] }),
|
|
50
|
-
* prompt: "Calculate 100 * 50",
|
|
51
|
-
* });
|
|
52
|
-
* ```
|
|
53
|
-
*
|
|
54
|
-
* ## Example with HTTP Controller (OpenAPI)
|
|
55
|
-
*
|
|
56
|
-
* ```typescript
|
|
57
|
-
* import { openai } from "@ai-sdk/openai";
|
|
58
|
-
* import { HttpLlm } from "@typia/utils";
|
|
59
|
-
* import { toVercelTools } from "@typia/vercel";
|
|
60
|
-
* import { generateText } from "ai";
|
|
61
|
-
*
|
|
62
|
-
* const controller = HttpLlm.controller({
|
|
63
|
-
* name: "shopping",
|
|
64
|
-
* document: await fetch("https://api.example.com/swagger.json").then(
|
|
65
|
-
* (r) => r.json(),
|
|
66
|
-
* ),
|
|
67
|
-
* connection: { host: "https://api.example.com" },
|
|
68
|
-
* });
|
|
69
|
-
*
|
|
70
|
-
* const result = await generateText({
|
|
71
|
-
* model: openai("gpt-4o"),
|
|
72
|
-
* tools: toVercelTools({ controllers: [controller] }),
|
|
73
|
-
* prompt: "Search for laptops under $1000",
|
|
74
|
-
* });
|
|
75
|
-
* ```
|
|
76
|
-
*
|
|
77
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
78
|
-
* @param props Conversion properties
|
|
79
|
-
* @returns Record of Vercel AI SDK Tools keyed by tool name
|
|
80
|
-
*/
|
|
81
|
-
function toVercelTools(props) {
|
|
82
|
-
return VercelToolsRegistrar.convert(props);
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Convert LLM parameters schema to Vercel AI SDK schema format.
|
|
86
|
-
*
|
|
87
|
-
* Transforms {@link ILlmSchema.IParameters} into Vercel AI SDK's `Schema` type
|
|
88
|
-
* for use with `generateObject()`. Use with `typia.llm.structuredOutput<T>()`
|
|
89
|
-
* or `typia.llm.parameters<T>()`.
|
|
90
|
-
*
|
|
91
|
-
* ## Example
|
|
92
|
-
*
|
|
93
|
-
* ```typescript
|
|
94
|
-
* import { openai } from "@ai-sdk/openai";
|
|
95
|
-
* import { toVercelSchema } from "@typia/vercel";
|
|
96
|
-
* import { generateObject } from "ai";
|
|
97
|
-
* import typia from "typia";
|
|
98
|
-
*
|
|
99
|
-
* interface IMember {
|
|
100
|
-
* name: string;
|
|
101
|
-
* age: number;
|
|
102
|
-
* }
|
|
103
|
-
*
|
|
104
|
-
* const output = typia.llm.structuredOutput<IMember>();
|
|
105
|
-
* const schema = toVercelSchema(output.parameters);
|
|
106
|
-
*
|
|
107
|
-
* const { object } = await generateObject({
|
|
108
|
-
* model: openai("gpt-4o"),
|
|
109
|
-
* schema,
|
|
110
|
-
* prompt: "Generate a member named John who is 30 years old",
|
|
111
|
-
* });
|
|
112
|
-
*
|
|
113
|
-
* const coerced = output.coerce(object);
|
|
114
|
-
* const result = output.validate(coerced);
|
|
115
|
-
* ```
|
|
116
|
-
*
|
|
117
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
118
|
-
* @param parameters LLM parameters schema from
|
|
119
|
-
* `typia.llm.structuredOutput<T>().parameters` or
|
|
120
|
-
* `typia.llm.parameters<T>()`
|
|
121
|
-
* @returns Vercel AI SDK Schema for `generateObject()`
|
|
122
|
-
*/
|
|
123
|
-
function toVercelSchema(parameters) {
|
|
124
|
-
return VercelParameterConverter.convert(parameters);
|
|
125
|
-
}
|
|
4
|
+
var libExports = requireLib();
|
|
5
|
+
var index = /*@__PURE__*/getDefaultExportFromCjs(libExports);
|
|
126
6
|
|
|
127
|
-
export {
|
|
7
|
+
export { index as default };
|
|
128
8
|
//# sourceMappingURL=index.mjs.map
|
package/lib/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["index.js?commonjs-entry"],"sourcesContent":["import { getDefaultExportFromCjs } from \"\u0000commonjsHelpers.js\";\nimport { __require as requireLib } from \"/home/samchon/github/samchon/typia@next/packages/vercel/lib/index.js\";\nvar libExports = requireLib();\nexport { libExports as __moduleExports };\nexport default /*@__PURE__*/getDefaultExportFromCjs(libExports);"],"names":[],"mappings":";;;AAEA,IAAI,UAAU,GAAG,UAAU,EAAE;AAE7B,YAAe,aAAa,uBAAuB,CAAC,UAAU,CAAC;;;;"}
|
package/lib/index2.mjs
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { __exports as lib } from './_virtual/index.mjs';
|
|
2
|
+
import { __require as requireVercelParameterConverter } from './internal/VercelParameterConverter2.mjs';
|
|
3
|
+
import { __require as requireVercelToolsRegistrar } from './internal/VercelToolsRegistrar2.mjs';
|
|
4
|
+
|
|
5
|
+
var hasRequiredLib;
|
|
6
|
+
|
|
7
|
+
function requireLib () {
|
|
8
|
+
if (hasRequiredLib) return lib;
|
|
9
|
+
hasRequiredLib = 1;
|
|
10
|
+
Object.defineProperty(lib, "__esModule", { value: true });
|
|
11
|
+
lib.toVercelTools = toVercelTools;
|
|
12
|
+
lib.toVercelSchema = toVercelSchema;
|
|
13
|
+
const VercelParameterConverter_1 = requireVercelParameterConverter();
|
|
14
|
+
const VercelToolsRegistrar_1 = requireVercelToolsRegistrar();
|
|
15
|
+
/**
|
|
16
|
+
* Convert typia controllers to Vercel AI SDK tools.
|
|
17
|
+
*
|
|
18
|
+
* Transforms TypeScript class methods via `typia.llm.controller<Class>()` or
|
|
19
|
+
* OpenAPI operations via `HttpLlm.controller()` into Vercel AI SDK tools that
|
|
20
|
+
* can be used with any LLM provider (OpenAI, Anthropic, Google, etc.).
|
|
21
|
+
*
|
|
22
|
+
* Every tool call is validated by typia. If the LLM provides invalid arguments,
|
|
23
|
+
* returns a validation error formatted by {@link LlmJson.stringify} so the LLM
|
|
24
|
+
* can auto-correct in the next turn.
|
|
25
|
+
*
|
|
26
|
+
* ## Example with OpenAI
|
|
27
|
+
*
|
|
28
|
+
* ```typescript
|
|
29
|
+
* import { generateText } from "ai";
|
|
30
|
+
* import { openai } from "@ai-sdk/openai";
|
|
31
|
+
* import typia from "typia";
|
|
32
|
+
* import { toVercelTools } from "@typia/vercel";
|
|
33
|
+
*
|
|
34
|
+
* class Calculator {
|
|
35
|
+
* /** Add two numbers together. */
|
|
36
|
+
* add(props: { a: number; b: number }): { value: number } {
|
|
37
|
+
* return { value: props.a + props.b };
|
|
38
|
+
* }
|
|
39
|
+
* }
|
|
40
|
+
*
|
|
41
|
+
* const controller = typia.llm.controller<Calculator>("calc", new Calculator());
|
|
42
|
+
* const tools = toVercelTools({ controllers: [controller] });
|
|
43
|
+
*
|
|
44
|
+
* const result = await generateText({
|
|
45
|
+
* model: openai("gpt-4o"),
|
|
46
|
+
* tools,
|
|
47
|
+
* prompt: "What is 15 + 27?",
|
|
48
|
+
* });
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
51
|
+
* ## Example with Anthropic
|
|
52
|
+
*
|
|
53
|
+
* ```typescript
|
|
54
|
+
* import { anthropic } from "@ai-sdk/anthropic";
|
|
55
|
+
* import { toVercelTools } from "@typia/vercel";
|
|
56
|
+
* import { generateText } from "ai";
|
|
57
|
+
*
|
|
58
|
+
* const result = await generateText({
|
|
59
|
+
* model: anthropic("claude-sonnet-4-20250514"),
|
|
60
|
+
* tools: toVercelTools({ controllers: [controller] }),
|
|
61
|
+
* prompt: "Calculate 100 * 50",
|
|
62
|
+
* });
|
|
63
|
+
* ```
|
|
64
|
+
*
|
|
65
|
+
* ## Example with HTTP Controller (OpenAPI)
|
|
66
|
+
*
|
|
67
|
+
* ```typescript
|
|
68
|
+
* import { openai } from "@ai-sdk/openai";
|
|
69
|
+
* import { HttpLlm } from "@typia/utils";
|
|
70
|
+
* import { toVercelTools } from "@typia/vercel";
|
|
71
|
+
* import { generateText } from "ai";
|
|
72
|
+
*
|
|
73
|
+
* const controller = HttpLlm.controller({
|
|
74
|
+
* name: "shopping",
|
|
75
|
+
* document: await fetch("https://api.example.com/swagger.json").then(
|
|
76
|
+
* (r) => r.json(),
|
|
77
|
+
* ),
|
|
78
|
+
* connection: { host: "https://api.example.com" },
|
|
79
|
+
* });
|
|
80
|
+
*
|
|
81
|
+
* const result = await generateText({
|
|
82
|
+
* model: openai("gpt-4o"),
|
|
83
|
+
* tools: toVercelTools({ controllers: [controller] }),
|
|
84
|
+
* prompt: "Search for laptops under $1000",
|
|
85
|
+
* });
|
|
86
|
+
* ```
|
|
87
|
+
*
|
|
88
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
89
|
+
* @param props Conversion properties
|
|
90
|
+
* @returns Record of Vercel AI SDK Tools keyed by tool name
|
|
91
|
+
*/
|
|
92
|
+
function toVercelTools(props) {
|
|
93
|
+
return VercelToolsRegistrar_1.VercelToolsRegistrar.convert(props);
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Convert LLM parameters schema to Vercel AI SDK schema format.
|
|
97
|
+
*
|
|
98
|
+
* Transforms {@link ILlmSchema.IParameters} into Vercel AI SDK's `Schema` type
|
|
99
|
+
* for use with `generateObject()`. Use with `typia.llm.structuredOutput<T>()`
|
|
100
|
+
* or `typia.llm.parameters<T>()`.
|
|
101
|
+
*
|
|
102
|
+
* ## Example
|
|
103
|
+
*
|
|
104
|
+
* ```typescript
|
|
105
|
+
* import { openai } from "@ai-sdk/openai";
|
|
106
|
+
* import { toVercelSchema } from "@typia/vercel";
|
|
107
|
+
* import { generateObject } from "ai";
|
|
108
|
+
* import typia from "typia";
|
|
109
|
+
*
|
|
110
|
+
* interface IMember {
|
|
111
|
+
* name: string;
|
|
112
|
+
* age: number;
|
|
113
|
+
* }
|
|
114
|
+
*
|
|
115
|
+
* const output = typia.llm.structuredOutput<IMember>();
|
|
116
|
+
* const schema = toVercelSchema(output.parameters);
|
|
117
|
+
*
|
|
118
|
+
* const { object } = await generateObject({
|
|
119
|
+
* model: openai("gpt-4o"),
|
|
120
|
+
* schema,
|
|
121
|
+
* prompt: "Generate a member named John who is 30 years old",
|
|
122
|
+
* });
|
|
123
|
+
*
|
|
124
|
+
* const coerced = output.coerce(object);
|
|
125
|
+
* const result = output.validate(coerced);
|
|
126
|
+
* ```
|
|
127
|
+
*
|
|
128
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
129
|
+
* @param parameters LLM parameters schema from
|
|
130
|
+
* `typia.llm.structuredOutput<T>().parameters` or
|
|
131
|
+
* `typia.llm.parameters<T>()`
|
|
132
|
+
* @returns Vercel AI SDK Schema for `generateObject()`
|
|
133
|
+
*/
|
|
134
|
+
function toVercelSchema(parameters) {
|
|
135
|
+
return VercelParameterConverter_1.VercelParameterConverter.convert(parameters);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
return lib;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export { requireLib as __require };
|
|
142
|
+
//# sourceMappingURL=index2.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index2.mjs","sources":["index.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toVercelTools = toVercelTools;\nexports.toVercelSchema = toVercelSchema;\nconst VercelParameterConverter_1 = require(\"./internal/VercelParameterConverter\");\nconst VercelToolsRegistrar_1 = require(\"./internal/VercelToolsRegistrar\");\n/**\n * Convert typia controllers to Vercel AI SDK tools.\n *\n * Transforms TypeScript class methods via `typia.llm.controller<Class>()` or\n * OpenAPI operations via `HttpLlm.controller()` into Vercel AI SDK tools that\n * can be used with any LLM provider (OpenAI, Anthropic, Google, etc.).\n *\n * Every tool call is validated by typia. If the LLM provides invalid arguments,\n * returns a validation error formatted by {@link LlmJson.stringify} so the LLM\n * can auto-correct in the next turn.\n *\n * ## Example with OpenAI\n *\n * ```typescript\n * import { generateText } from \"ai\";\n * import { openai } from \"@ai-sdk/openai\";\n * import typia from \"typia\";\n * import { toVercelTools } from \"@typia/vercel\";\n *\n * class Calculator {\n * /** Add two numbers together. */\n * add(props: { a: number; b: number }): { value: number } {\n * return { value: props.a + props.b };\n * }\n * }\n *\n * const controller = typia.llm.controller<Calculator>(\"calc\", new Calculator());\n * const tools = toVercelTools({ controllers: [controller] });\n *\n * const result = await generateText({\n * model: openai(\"gpt-4o\"),\n * tools,\n * prompt: \"What is 15 + 27?\",\n * });\n * ```\n *\n * ## Example with Anthropic\n *\n * ```typescript\n * import { anthropic } from \"@ai-sdk/anthropic\";\n * import { toVercelTools } from \"@typia/vercel\";\n * import { generateText } from \"ai\";\n *\n * const result = await generateText({\n * model: anthropic(\"claude-sonnet-4-20250514\"),\n * tools: toVercelTools({ controllers: [controller] }),\n * prompt: \"Calculate 100 * 50\",\n * });\n * ```\n *\n * ## Example with HTTP Controller (OpenAPI)\n *\n * ```typescript\n * import { openai } from \"@ai-sdk/openai\";\n * import { HttpLlm } from \"@typia/utils\";\n * import { toVercelTools } from \"@typia/vercel\";\n * import { generateText } from \"ai\";\n *\n * const controller = HttpLlm.controller({\n * name: \"shopping\",\n * document: await fetch(\"https://api.example.com/swagger.json\").then(\n * (r) => r.json(),\n * ),\n * connection: { host: \"https://api.example.com\" },\n * });\n *\n * const result = await generateText({\n * model: openai(\"gpt-4o\"),\n * tools: toVercelTools({ controllers: [controller] }),\n * prompt: \"Search for laptops under $1000\",\n * });\n * ```\n *\n * @author Jeongho Nam - https://github.com/samchon\n * @param props Conversion properties\n * @returns Record of Vercel AI SDK Tools keyed by tool name\n */\nfunction toVercelTools(props) {\n return VercelToolsRegistrar_1.VercelToolsRegistrar.convert(props);\n}\n/**\n * Convert LLM parameters schema to Vercel AI SDK schema format.\n *\n * Transforms {@link ILlmSchema.IParameters} into Vercel AI SDK's `Schema` type\n * for use with `generateObject()`. Use with `typia.llm.structuredOutput<T>()`\n * or `typia.llm.parameters<T>()`.\n *\n * ## Example\n *\n * ```typescript\n * import { openai } from \"@ai-sdk/openai\";\n * import { toVercelSchema } from \"@typia/vercel\";\n * import { generateObject } from \"ai\";\n * import typia from \"typia\";\n *\n * interface IMember {\n * name: string;\n * age: number;\n * }\n *\n * const output = typia.llm.structuredOutput<IMember>();\n * const schema = toVercelSchema(output.parameters);\n *\n * const { object } = await generateObject({\n * model: openai(\"gpt-4o\"),\n * schema,\n * prompt: \"Generate a member named John who is 30 years old\",\n * });\n *\n * const coerced = output.coerce(object);\n * const result = output.validate(coerced);\n * ```\n *\n * @author Jeongho Nam - https://github.com/samchon\n * @param parameters LLM parameters schema from\n * `typia.llm.structuredOutput<T>().parameters` or\n * `typia.llm.parameters<T>()`\n * @returns Vercel AI SDK Schema for `generateObject()`\n */\nfunction toVercelSchema(parameters) {\n return VercelParameterConverter_1.VercelParameterConverter.convert(parameters);\n}\n//# sourceMappingURL=index.js.map"],"names":["require$$0","require$$1"],"mappings":";;;;;;;;;AACA,CAAA,MAAM,CAAC,cAAc,CAAC,GAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,CAAA,GAAA,CAAA,aAAqB,GAAG,aAAa;AACrC,CAAA,GAAA,CAAA,cAAsB,GAAG,cAAc;CACvC,MAAM,0BAA0B,GAAGA,+BAAA,EAA8C;CACjF,MAAM,sBAAsB,GAAGC,2BAAA,EAA0C;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;CACA,SAAS,aAAa,CAAC,KAAK,EAAE;KAC1B,OAAO,sBAAsB,CAAC,oBAAoB,CAAC,OAAO,CAAC,KAAK,CAAC;AACrE,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;CACA,SAAS,cAAc,CAAC,UAAU,EAAE;KAChC,OAAO,0BAA0B,CAAC,wBAAwB,CAAC,OAAO,CAAC,UAAU,CAAC;AAClF,CAAA;AACA;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VercelParameterConverter.js","sourceRoot":"","sources":["../../src/internal/VercelParameterConverter.ts"],"names":[],"mappings":";;;AACA,2BAAwC;AAGxC,IAAiB,wBAAwB,CAGxC;AAHD,WAAiB,wBAAwB;IAC1B,gCAAO,GAAG,CAAC,UAAkC,EAAkB,EAAE,CAC5E,IAAA,eAAU,EAAS,UAAyB,CAAC,CAAC;AAClD,CAAC,EAHgB,wBAAwB,
|
|
1
|
+
{"version":3,"file":"VercelParameterConverter.js","sourceRoot":"","sources":["../../src/internal/VercelParameterConverter.ts"],"names":[],"mappings":";;;AACA,2BAAwC;AAGxC,IAAiB,wBAAwB,CAGxC;AAHD,WAAiB,wBAAwB;IAC1B,gCAAO,GAAG,CAAC,UAAkC,EAAkB,EAAE,CAC5E,IAAA,eAAU,EAAS,UAAyB,CAAC,CAAC;AAClD,CAAC,EAHgB,wBAAwB,aAAxB,wBAAwB,GAAxB,wBAAwB,QAGxC"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getDefaultExportFromCjs } from '../_virtual/_commonjsHelpers.mjs';
|
|
2
|
+
import { __require as requireVercelParameterConverter } from './VercelParameterConverter2.mjs';
|
|
2
3
|
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
VercelParameterConverter.convert = (parameters) => jsonSchema(parameters);
|
|
6
|
-
})(VercelParameterConverter || (VercelParameterConverter = {}));
|
|
4
|
+
var VercelParameterConverterExports = requireVercelParameterConverter();
|
|
5
|
+
var VercelParameterConverter = /*@__PURE__*/getDefaultExportFromCjs(VercelParameterConverterExports);
|
|
7
6
|
|
|
8
|
-
export { VercelParameterConverter };
|
|
7
|
+
export { VercelParameterConverter as default };
|
|
9
8
|
//# sourceMappingURL=VercelParameterConverter.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VercelParameterConverter.mjs","sources":["
|
|
1
|
+
{"version":3,"file":"VercelParameterConverter.mjs","sources":["VercelParameterConverter.js?commonjs-entry"],"sourcesContent":["import { getDefaultExportFromCjs } from \"\u0000commonjsHelpers.js\";\nimport { __require as requireVercelParameterConverter } from \"/home/samchon/github/samchon/typia@next/packages/vercel/lib/internal/VercelParameterConverter.js\";\nvar VercelParameterConverterExports = requireVercelParameterConverter();\nexport { VercelParameterConverterExports as __moduleExports };\nexport default /*@__PURE__*/getDefaultExportFromCjs(VercelParameterConverterExports);"],"names":[],"mappings":";;;AAEA,IAAI,+BAA+B,GAAG,+BAA+B,EAAE;AAEvE,+BAAe,aAAa,uBAAuB,CAAC,+BAA+B,CAAC;;;;"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { __exports as VercelParameterConverter } from '../_virtual/VercelParameterConverter.mjs';
|
|
2
|
+
import require$$0 from 'ai';
|
|
3
|
+
|
|
4
|
+
var hasRequiredVercelParameterConverter;
|
|
5
|
+
|
|
6
|
+
function requireVercelParameterConverter () {
|
|
7
|
+
if (hasRequiredVercelParameterConverter) return VercelParameterConverter;
|
|
8
|
+
hasRequiredVercelParameterConverter = 1;
|
|
9
|
+
Object.defineProperty(VercelParameterConverter, "__esModule", { value: true });
|
|
10
|
+
VercelParameterConverter.VercelParameterConverter = void 0;
|
|
11
|
+
const ai_1 = require$$0;
|
|
12
|
+
var VercelParameterConverter$1;
|
|
13
|
+
(function (VercelParameterConverter) {
|
|
14
|
+
VercelParameterConverter.convert = (parameters) => (0, ai_1.jsonSchema)(parameters);
|
|
15
|
+
})(VercelParameterConverter$1 || (VercelParameterConverter.VercelParameterConverter = VercelParameterConverter$1 = {}));
|
|
16
|
+
|
|
17
|
+
return VercelParameterConverter;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { requireVercelParameterConverter as __require };
|
|
21
|
+
//# sourceMappingURL=VercelParameterConverter2.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VercelParameterConverter2.mjs","sources":["VercelParameterConverter.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.VercelParameterConverter = void 0;\nconst ai_1 = require(\"ai\");\nvar VercelParameterConverter;\n(function (VercelParameterConverter) {\n VercelParameterConverter.convert = (parameters) => (0, ai_1.jsonSchema)(parameters);\n})(VercelParameterConverter || (exports.VercelParameterConverter = VercelParameterConverter = {}));\n//# sourceMappingURL=VercelParameterConverter.js.map"],"names":["VercelParameterConverter_1","VercelParameterConverter"],"mappings":";;;;;;;;AACA,CAAA,MAAM,CAAC,cAAc,CAACA,wBAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,CAAAA,wBAAA,CAAA,wBAAgC,GAAG,MAAM;CACzC,MAAM,IAAI,GAAG,UAAa;AAC1B,CAAA,IAAIC,0BAAwB;CAC5B,CAAC,UAAU,wBAAwB,EAAE;AACrC,KAAI,wBAAwB,CAAC,OAAO,GAAG,CAAC,UAAU,KAAK,IAAI,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC;CACvF,CAAC,EAAEA,0BAAwB,KAAKD,wBAAA,CAAA,wBAAgC,GAAGC,0BAAwB,GAAG,EAAE,CAAC,CAAC;AAClG;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VercelToolsRegistrar.js","sourceRoot":"","sources":["../../src/internal/VercelToolsRegistrar.ts"],"names":[],"mappings":";;;;;;;;;;;;AAOA,wCAAgD;AAChD,2BAAgC;AAEhC,yEAAsE;AAEtE,IAAiB,oBAAoB,CAqJpC;AArJD,WAAiB,oBAAoB;IACnC;;;;;OAKG;IACU,4BAAO,GAAG,CAAC,KAGvB,EAAwB,EAAE;;QACzB,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"VercelToolsRegistrar.js","sourceRoot":"","sources":["../../src/internal/VercelToolsRegistrar.ts"],"names":[],"mappings":";;;;;;;;;;;;AAOA,wCAAgD;AAChD,2BAAgC;AAEhC,yEAAsE;AAEtE,IAAiB,oBAAoB,CAqJpC;AArJD,WAAiB,oBAAoB;IACnC;;;;;OAKG;IACU,4BAAO,GAAG,CAAC,KAGvB,EAAwB,EAAE;;QACzB,MAAM,MAAM,SAAY,KAAK,CAAC,MAAM,mCAAI,KAAK,CAAC;QAC9C,MAAM,KAAK,GAAyB,EAAE,CAAC;QAEvC,6BAA6B;QAC7B,IAAI,MA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AU;qBACpC,CAAC;gBACzB,IAAI,CAAC;oBACH,MAAM,MAAM,GAAY,MAAM,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;oBACvD,OAAO,MAAM,KAAK,SAAS;wBACzB,CAAC,CAAE,EAAE,OAAO,EAAE,IAAI,EAAwB;wBAC1C,CAAC,CAAE,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAwB,CAAC;gBAC7D,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,OAAO;wBACL,OAAO,EAAE,KAAK;wBACd,KAAK,EACH,KAAK,YAAY,KAAK;4BACpB,CAAC,CAAC,GAAG,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,OAAO,EAAE;4BACnC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;qBACC,CAAC;gBACzB,CAAC;YACH,CAAC,CAAA;SACF,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC,EArJgB,oBAAoB,aAApB,oBAAoB,GAApB,oBAAoB,QAqJpC"}
|
|
@@ -1,126 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { VercelParameterConverter } from './VercelParameterConverter.mjs';
|
|
1
|
+
import { getDefaultExportFromCjs } from '../_virtual/_commonjsHelpers.mjs';
|
|
2
|
+
import { __require as requireVercelToolsRegistrar } from './VercelToolsRegistrar2.mjs';
|
|
4
3
|
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Convert typia controllers to Vercel AI SDK tools.
|
|
9
|
-
*
|
|
10
|
-
* @param props Conversion properties
|
|
11
|
-
* @returns Record of Vercel AI SDK Tools
|
|
12
|
-
*/
|
|
13
|
-
VercelToolsRegistrar.convert = (props) => {
|
|
14
|
-
const prefix = props.prefix ?? false;
|
|
15
|
-
const tools = {};
|
|
16
|
-
// check duplicate tool names
|
|
17
|
-
if (prefix === false && props.controllers.length >= 2) {
|
|
18
|
-
const names = new Map();
|
|
19
|
-
const duplicates = [];
|
|
20
|
-
for (const controller of props.controllers) {
|
|
21
|
-
for (const func of controller.application.functions) {
|
|
22
|
-
const existing = names.get(func.name);
|
|
23
|
-
if (existing !== undefined)
|
|
24
|
-
duplicates.push(`"${func.name}" in "${controller.name}" (conflicts with "${existing}")`);
|
|
25
|
-
else
|
|
26
|
-
names.set(func.name, controller.name);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
if (duplicates.length > 0)
|
|
30
|
-
throw new Error(`Duplicate tool names found:\n - ${duplicates.join("\n - ")}`);
|
|
31
|
-
}
|
|
32
|
-
// convert controllers to tools
|
|
33
|
-
for (const controller of props.controllers) {
|
|
34
|
-
if (controller.protocol === "class") {
|
|
35
|
-
registerClassController({ tools, controller, prefix });
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
registerHttpController({ tools, controller, prefix });
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
return tools;
|
|
42
|
-
};
|
|
43
|
-
const registerClassController = (props) => {
|
|
44
|
-
const { tools, controller, prefix } = props;
|
|
45
|
-
const execute = controller.execute;
|
|
46
|
-
for (const func of controller.application.functions) {
|
|
47
|
-
const toolName = prefix
|
|
48
|
-
? `${controller.name}_${func.name}`
|
|
49
|
-
: func.name;
|
|
50
|
-
const method = execute[func.name];
|
|
51
|
-
if (typeof method !== "function") {
|
|
52
|
-
throw new Error(`Method "${func.name}" not found on controller "${controller.name}"`);
|
|
53
|
-
}
|
|
54
|
-
tools[toolName] = createTool({
|
|
55
|
-
name: toolName,
|
|
56
|
-
func,
|
|
57
|
-
execute: async (args) => method.call(execute, args),
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
const registerHttpController = (props) => {
|
|
62
|
-
const { tools, controller, prefix } = props;
|
|
63
|
-
const application = controller.application;
|
|
64
|
-
const connection = controller.connection;
|
|
65
|
-
for (const func of application.functions) {
|
|
66
|
-
const toolName = prefix
|
|
67
|
-
? `${controller.name}_${func.name}`
|
|
68
|
-
: func.name;
|
|
69
|
-
tools[toolName] = createTool({
|
|
70
|
-
name: toolName,
|
|
71
|
-
func,
|
|
72
|
-
execute: async (args) => {
|
|
73
|
-
if (controller.execute !== undefined) {
|
|
74
|
-
const response = await controller.execute({
|
|
75
|
-
connection,
|
|
76
|
-
application,
|
|
77
|
-
function: func,
|
|
78
|
-
arguments: args,
|
|
79
|
-
});
|
|
80
|
-
return response.body;
|
|
81
|
-
}
|
|
82
|
-
return HttpLlm.execute({
|
|
83
|
-
application,
|
|
84
|
-
function: func,
|
|
85
|
-
connection,
|
|
86
|
-
input: args,
|
|
87
|
-
});
|
|
88
|
-
},
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
const createTool = (props) => {
|
|
93
|
-
const { name, func, execute } = props;
|
|
94
|
-
return tool({
|
|
95
|
-
description: func.description ?? "",
|
|
96
|
-
inputSchema: VercelParameterConverter.convert(func.parameters),
|
|
97
|
-
execute: async (args) => {
|
|
98
|
-
const coerced = LlmJson.coerce(args, func.parameters);
|
|
99
|
-
const validation = func.validate(coerced);
|
|
100
|
-
if (!validation.success)
|
|
101
|
-
return {
|
|
102
|
-
success: false,
|
|
103
|
-
error: `Type errors in "${name}" arguments:\n\n` +
|
|
104
|
-
`\`\`\`json\n${LlmJson.stringify(validation)}\n\`\`\``,
|
|
105
|
-
};
|
|
106
|
-
try {
|
|
107
|
-
const result = await execute(validation.data);
|
|
108
|
-
return result === undefined
|
|
109
|
-
? { success: true }
|
|
110
|
-
: { success: true, data: result };
|
|
111
|
-
}
|
|
112
|
-
catch (error) {
|
|
113
|
-
return {
|
|
114
|
-
success: false,
|
|
115
|
-
error: error instanceof Error
|
|
116
|
-
? `${error.name}: ${error.message}`
|
|
117
|
-
: String(error),
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
});
|
|
122
|
-
};
|
|
123
|
-
})(VercelToolsRegistrar || (VercelToolsRegistrar = {}));
|
|
4
|
+
var VercelToolsRegistrarExports = requireVercelToolsRegistrar();
|
|
5
|
+
var VercelToolsRegistrar = /*@__PURE__*/getDefaultExportFromCjs(VercelToolsRegistrarExports);
|
|
124
6
|
|
|
125
|
-
export { VercelToolsRegistrar };
|
|
7
|
+
export { VercelToolsRegistrar as default };
|
|
126
8
|
//# sourceMappingURL=VercelToolsRegistrar.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VercelToolsRegistrar.mjs","sources":["
|
|
1
|
+
{"version":3,"file":"VercelToolsRegistrar.mjs","sources":["VercelToolsRegistrar.js?commonjs-entry"],"sourcesContent":["import { getDefaultExportFromCjs } from \"\u0000commonjsHelpers.js\";\nimport { __require as requireVercelToolsRegistrar } from \"/home/samchon/github/samchon/typia@next/packages/vercel/lib/internal/VercelToolsRegistrar.js\";\nvar VercelToolsRegistrarExports = requireVercelToolsRegistrar();\nexport { VercelToolsRegistrarExports as __moduleExports };\nexport default /*@__PURE__*/getDefaultExportFromCjs(VercelToolsRegistrarExports);"],"names":[],"mappings":";;;AAEA,IAAI,2BAA2B,GAAG,2BAA2B,EAAE;AAE/D,2BAAe,aAAa,uBAAuB,CAAC,2BAA2B,CAAC;;;;"}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { __exports as VercelToolsRegistrar } from '../_virtual/VercelToolsRegistrar.mjs';
|
|
2
|
+
import require$$0$1 from '@typia/utils';
|
|
3
|
+
import require$$0 from 'ai';
|
|
4
|
+
import { __require as requireVercelParameterConverter } from './VercelParameterConverter2.mjs';
|
|
5
|
+
|
|
6
|
+
var hasRequiredVercelToolsRegistrar;
|
|
7
|
+
|
|
8
|
+
function requireVercelToolsRegistrar () {
|
|
9
|
+
if (hasRequiredVercelToolsRegistrar) return VercelToolsRegistrar;
|
|
10
|
+
hasRequiredVercelToolsRegistrar = 1;
|
|
11
|
+
var __awaiter = (VercelToolsRegistrar && VercelToolsRegistrar.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
13
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
14
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
15
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
16
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
17
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(VercelToolsRegistrar, "__esModule", { value: true });
|
|
21
|
+
VercelToolsRegistrar.VercelToolsRegistrar = void 0;
|
|
22
|
+
const utils_1 = require$$0$1;
|
|
23
|
+
const ai_1 = require$$0;
|
|
24
|
+
const VercelParameterConverter_1 = requireVercelParameterConverter();
|
|
25
|
+
var VercelToolsRegistrar$1;
|
|
26
|
+
(function (VercelToolsRegistrar) {
|
|
27
|
+
/**
|
|
28
|
+
* Convert typia controllers to Vercel AI SDK tools.
|
|
29
|
+
*
|
|
30
|
+
* @param props Conversion properties
|
|
31
|
+
* @returns Record of Vercel AI SDK Tools
|
|
32
|
+
*/
|
|
33
|
+
VercelToolsRegistrar.convert = (props) => {
|
|
34
|
+
var _a;
|
|
35
|
+
const prefix = (_a = props.prefix) !== null && _a !== void 0 ? _a : false;
|
|
36
|
+
const tools = {};
|
|
37
|
+
// check duplicate tool names
|
|
38
|
+
if (prefix === false && props.controllers.length >= 2) {
|
|
39
|
+
const names = new Map();
|
|
40
|
+
const duplicates = [];
|
|
41
|
+
for (const controller of props.controllers) {
|
|
42
|
+
for (const func of controller.application.functions) {
|
|
43
|
+
const existing = names.get(func.name);
|
|
44
|
+
if (existing !== undefined)
|
|
45
|
+
duplicates.push(`"${func.name}" in "${controller.name}" (conflicts with "${existing}")`);
|
|
46
|
+
else
|
|
47
|
+
names.set(func.name, controller.name);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
if (duplicates.length > 0)
|
|
51
|
+
throw new Error(`Duplicate tool names found:\n - ${duplicates.join("\n - ")}`);
|
|
52
|
+
}
|
|
53
|
+
// convert controllers to tools
|
|
54
|
+
for (const controller of props.controllers) {
|
|
55
|
+
if (controller.protocol === "class") {
|
|
56
|
+
registerClassController({ tools, controller, prefix });
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
registerHttpController({ tools, controller, prefix });
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return tools;
|
|
63
|
+
};
|
|
64
|
+
const registerClassController = (props) => {
|
|
65
|
+
const { tools, controller, prefix } = props;
|
|
66
|
+
const execute = controller.execute;
|
|
67
|
+
for (const func of controller.application.functions) {
|
|
68
|
+
const toolName = prefix
|
|
69
|
+
? `${controller.name}_${func.name}`
|
|
70
|
+
: func.name;
|
|
71
|
+
const method = execute[func.name];
|
|
72
|
+
if (typeof method !== "function") {
|
|
73
|
+
throw new Error(`Method "${func.name}" not found on controller "${controller.name}"`);
|
|
74
|
+
}
|
|
75
|
+
tools[toolName] = createTool({
|
|
76
|
+
name: toolName,
|
|
77
|
+
func,
|
|
78
|
+
execute: (args) => __awaiter(this, void 0, void 0, function* () { return method.call(execute, args); }),
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
const registerHttpController = (props) => {
|
|
83
|
+
const { tools, controller, prefix } = props;
|
|
84
|
+
const application = controller.application;
|
|
85
|
+
const connection = controller.connection;
|
|
86
|
+
for (const func of application.functions) {
|
|
87
|
+
const toolName = prefix
|
|
88
|
+
? `${controller.name}_${func.name}`
|
|
89
|
+
: func.name;
|
|
90
|
+
tools[toolName] = createTool({
|
|
91
|
+
name: toolName,
|
|
92
|
+
func,
|
|
93
|
+
execute: (args) => __awaiter(this, void 0, void 0, function* () {
|
|
94
|
+
if (controller.execute !== undefined) {
|
|
95
|
+
const response = yield controller.execute({
|
|
96
|
+
connection,
|
|
97
|
+
application,
|
|
98
|
+
function: func,
|
|
99
|
+
arguments: args,
|
|
100
|
+
});
|
|
101
|
+
return response.body;
|
|
102
|
+
}
|
|
103
|
+
return utils_1.HttpLlm.execute({
|
|
104
|
+
application,
|
|
105
|
+
function: func,
|
|
106
|
+
connection,
|
|
107
|
+
input: args,
|
|
108
|
+
});
|
|
109
|
+
}),
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
const createTool = (props) => {
|
|
114
|
+
var _a;
|
|
115
|
+
const { name, func, execute } = props;
|
|
116
|
+
return (0, ai_1.tool)({
|
|
117
|
+
description: (_a = func.description) !== null && _a !== void 0 ? _a : "",
|
|
118
|
+
inputSchema: VercelParameterConverter_1.VercelParameterConverter.convert(func.parameters),
|
|
119
|
+
execute: (args) => __awaiter(this, void 0, void 0, function* () {
|
|
120
|
+
const coerced = utils_1.LlmJson.coerce(args, func.parameters);
|
|
121
|
+
const validation = func.validate(coerced);
|
|
122
|
+
if (!validation.success)
|
|
123
|
+
return {
|
|
124
|
+
success: false,
|
|
125
|
+
error: `Type errors in "${name}" arguments:\n\n` +
|
|
126
|
+
`\`\`\`json\n${utils_1.LlmJson.stringify(validation)}\n\`\`\``,
|
|
127
|
+
};
|
|
128
|
+
try {
|
|
129
|
+
const result = yield execute(validation.data);
|
|
130
|
+
return result === undefined
|
|
131
|
+
? { success: true }
|
|
132
|
+
: { success: true, data: result };
|
|
133
|
+
}
|
|
134
|
+
catch (error) {
|
|
135
|
+
return {
|
|
136
|
+
success: false,
|
|
137
|
+
error: error instanceof Error
|
|
138
|
+
? `${error.name}: ${error.message}`
|
|
139
|
+
: String(error),
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
}),
|
|
143
|
+
});
|
|
144
|
+
};
|
|
145
|
+
})(VercelToolsRegistrar$1 || (VercelToolsRegistrar.VercelToolsRegistrar = VercelToolsRegistrar$1 = {}));
|
|
146
|
+
|
|
147
|
+
return VercelToolsRegistrar;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export { requireVercelToolsRegistrar as __require };
|
|
151
|
+
//# sourceMappingURL=VercelToolsRegistrar2.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VercelToolsRegistrar2.mjs","sources":["VercelToolsRegistrar.js"],"sourcesContent":["\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.VercelToolsRegistrar = void 0;\nconst utils_1 = require(\"@typia/utils\");\nconst ai_1 = require(\"ai\");\nconst VercelParameterConverter_1 = require(\"./VercelParameterConverter\");\nvar VercelToolsRegistrar;\n(function (VercelToolsRegistrar) {\n /**\n * Convert typia controllers to Vercel AI SDK tools.\n *\n * @param props Conversion properties\n * @returns Record of Vercel AI SDK Tools\n */\n VercelToolsRegistrar.convert = (props) => {\n var _a;\n const prefix = (_a = props.prefix) !== null && _a !== void 0 ? _a : false;\n const tools = {};\n // check duplicate tool names\n if (prefix === false && props.controllers.length >= 2) {\n const names = new Map();\n const duplicates = [];\n for (const controller of props.controllers) {\n for (const func of controller.application.functions) {\n const existing = names.get(func.name);\n if (existing !== undefined)\n duplicates.push(`\"${func.name}\" in \"${controller.name}\" (conflicts with \"${existing}\")`);\n else\n names.set(func.name, controller.name);\n }\n }\n if (duplicates.length > 0)\n throw new Error(`Duplicate tool names found:\\n - ${duplicates.join(\"\\n - \")}`);\n }\n // convert controllers to tools\n for (const controller of props.controllers) {\n if (controller.protocol === \"class\") {\n registerClassController({ tools, controller, prefix });\n }\n else {\n registerHttpController({ tools, controller, prefix });\n }\n }\n return tools;\n };\n const registerClassController = (props) => {\n const { tools, controller, prefix } = props;\n const execute = controller.execute;\n for (const func of controller.application.functions) {\n const toolName = prefix\n ? `${controller.name}_${func.name}`\n : func.name;\n const method = execute[func.name];\n if (typeof method !== \"function\") {\n throw new Error(`Method \"${func.name}\" not found on controller \"${controller.name}\"`);\n }\n tools[toolName] = createTool({\n name: toolName,\n func,\n execute: (args) => __awaiter(this, void 0, void 0, function* () { return method.call(execute, args); }),\n });\n }\n };\n const registerHttpController = (props) => {\n const { tools, controller, prefix } = props;\n const application = controller.application;\n const connection = controller.connection;\n for (const func of application.functions) {\n const toolName = prefix\n ? `${controller.name}_${func.name}`\n : func.name;\n tools[toolName] = createTool({\n name: toolName,\n func,\n execute: (args) => __awaiter(this, void 0, void 0, function* () {\n if (controller.execute !== undefined) {\n const response = yield controller.execute({\n connection,\n application,\n function: func,\n arguments: args,\n });\n return response.body;\n }\n return utils_1.HttpLlm.execute({\n application,\n function: func,\n connection,\n input: args,\n });\n }),\n });\n }\n };\n const createTool = (props) => {\n var _a;\n const { name, func, execute } = props;\n return (0, ai_1.tool)({\n description: (_a = func.description) !== null && _a !== void 0 ? _a : \"\",\n inputSchema: VercelParameterConverter_1.VercelParameterConverter.convert(func.parameters),\n execute: (args) => __awaiter(this, void 0, void 0, function* () {\n const coerced = utils_1.LlmJson.coerce(args, func.parameters);\n const validation = func.validate(coerced);\n if (!validation.success)\n return {\n success: false,\n error: `Type errors in \"${name}\" arguments:\\n\\n` +\n `\\`\\`\\`json\\n${utils_1.LlmJson.stringify(validation)}\\n\\`\\`\\``,\n };\n try {\n const result = yield execute(validation.data);\n return result === undefined\n ? { success: true }\n : { success: true, data: result };\n }\n catch (error) {\n return {\n success: false,\n error: error instanceof Error\n ? `${error.name}: ${error.message}`\n : String(error),\n };\n }\n }),\n });\n };\n})(VercelToolsRegistrar || (exports.VercelToolsRegistrar = VercelToolsRegistrar = {}));\n//# s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C7C,OAAO,MAAM,KAAK;2BACZ,EAAE,OAAO,EAAE,IAAI;2BACf,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE;AACzD,iBAAA;iBACgB,OAAO,KAAK,EAAE;AAC9B,qBAAoB,OAAO;yBACH,OAAO,EAAE,KAAK;yBACd,KAAK,EAAE,KAAK,YAAY;+BAClB,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,OAAO,CAAC;+BAChC,MAAM,CAAC,KAAK,CAAC;sBACtB;AACrB,iBAAA;AACA,aAAA,CAAa,CAAC;AACd,UAAS,CAAC;KACV,CAAK;CACL,CAAC,EAAEA,sBAAoB,KAAKJ,oBAAA,CAAA,oBAA4B,GAAGI,sBAAoB,GAAG,EAAE,CAAC,CAAC;AACtF;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typia/vercel",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "13.0.0-dev.20260425",
|
|
4
4
|
"description": "Vercel AI SDK integration for typia",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
},
|
|
23
23
|
"homepage": "https://typia.io",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@typia/interface": "^
|
|
26
|
-
"@typia/utils": "^
|
|
25
|
+
"@typia/interface": "^13.0.0-dev.20260425",
|
|
26
|
+
"@typia/utils": "^13.0.0-dev.20260425"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"ai": ">=6.0.0"
|
|
@@ -31,15 +31,15 @@
|
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@rollup/plugin-commonjs": "^29.0.0",
|
|
33
33
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
34
|
-
"@rollup/plugin-typescript": "^12.3.0",
|
|
35
34
|
"@types/json-schema": "^7.0.15",
|
|
35
|
+
"@typescript/native-preview": "7.0.0-dev.20260421.2",
|
|
36
36
|
"ai": "^6.0.116",
|
|
37
37
|
"rimraf": "^6.1.2",
|
|
38
38
|
"rollup": "^4.56.0",
|
|
39
39
|
"rollup-plugin-auto-external": "^2.0.0",
|
|
40
40
|
"rollup-plugin-node-externals": "^8.1.2",
|
|
41
41
|
"tinyglobby": "^0.2.12",
|
|
42
|
-
"
|
|
42
|
+
"ttsc": "^0.4.2"
|
|
43
43
|
},
|
|
44
44
|
"sideEffects": false,
|
|
45
45
|
"files": [
|
|
@@ -62,15 +62,14 @@
|
|
|
62
62
|
"chatgpt",
|
|
63
63
|
"gemini",
|
|
64
64
|
"validation",
|
|
65
|
-
"json-schema"
|
|
66
|
-
"typescript"
|
|
65
|
+
"json-schema"
|
|
67
66
|
],
|
|
68
67
|
"publishConfig": {
|
|
69
68
|
"access": "public"
|
|
70
69
|
},
|
|
71
70
|
"scripts": {
|
|
72
|
-
"build": "rimraf lib &&
|
|
73
|
-
"dev": "
|
|
71
|
+
"build": "rimraf lib && ttsc && rollup -c",
|
|
72
|
+
"dev": "ttsc --watch"
|
|
74
73
|
},
|
|
75
74
|
"module": "lib/index.mjs",
|
|
76
75
|
"types": "lib/index.d.ts"
|