@ai11y/agent 0.0.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.
@@ -0,0 +1,17 @@
1
+ //#region src/llm-provider.ts
2
+ /**
3
+ * Create a LangChain LLM instance for OpenAI
4
+ */
5
+ async function createLLM(config) {
6
+ const { ChatOpenAI } = await import("@langchain/openai");
7
+ return new ChatOpenAI({
8
+ modelName: config.model || "gpt-5-nano",
9
+ temperature: config.temperature ?? 0,
10
+ openAIApiKey: config.apiKey,
11
+ configuration: config.baseURL ? { baseURL: config.baseURL } : void 0
12
+ });
13
+ }
14
+
15
+ //#endregion
16
+ export { createLLM };
17
+ //# sourceMappingURL=llm-provider.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"llm-provider.mjs","names":[],"sources":["../src/llm-provider.ts"],"sourcesContent":["/**\n * LLM Provider Factory\n * Creates LangChain-compatible LLM instances for OpenAI\n */\n\nimport type { BaseChatModel } from \"@langchain/core/language_models/chat_models\";\nimport type { ServerConfig } from \"./types.js\";\n\n/**\n * Create a LangChain LLM instance for OpenAI\n */\nexport async function createLLM(config: ServerConfig): Promise<BaseChatModel> {\n\tconst { ChatOpenAI } = await import(\"@langchain/openai\");\n\treturn new ChatOpenAI({\n\t\tmodelName: config.model || \"gpt-5-nano\",\n\t\ttemperature: config.temperature ?? 0,\n\t\topenAIApiKey: config.apiKey,\n\t\tconfiguration: config.baseURL\n\t\t\t? {\n\t\t\t\t\tbaseURL: config.baseURL,\n\t\t\t\t}\n\t\t\t: undefined,\n\t});\n}\n"],"mappings":";;;;AAWA,eAAsB,UAAU,QAA8C;CAC7E,MAAM,EAAE,eAAe,MAAM,OAAO;AACpC,QAAO,IAAI,WAAW;EACrB,WAAW,OAAO,SAAS;EAC3B,aAAa,OAAO,eAAe;EACnC,cAAc,OAAO;EACrB,eAAe,OAAO,UACnB,EACA,SAAS,OAAO,SAChB,GACA;EACH,CAAC"}
@@ -0,0 +1,52 @@
1
+ import { Ai11yContext, Instruction, ToolDefinition, ToolExecutor } from "@ai11y/core";
2
+
3
+ //#region src/tool-registry.d.ts
4
+
5
+ /**
6
+ * Registry for managing tools that can be called by the LLM agent.
7
+ * This allows extending the agent with custom tools.
8
+ */
9
+ declare class ToolRegistry {
10
+ private tools;
11
+ /**
12
+ * Register a new tool
13
+ * @returns this for method chaining
14
+ */
15
+ register(definition: ToolDefinition, executor: ToolExecutor): this;
16
+ /**
17
+ * Unregister a tool
18
+ */
19
+ unregister(name: string): void;
20
+ /**
21
+ * Get all registered tool definitions for OpenAI function calling
22
+ */
23
+ getToolDefinitions(): Array<{
24
+ type: "function";
25
+ function: ToolDefinition;
26
+ }>;
27
+ /**
28
+ * Execute a tool call
29
+ */
30
+ executeToolCall(toolName: string, args: Record<string, unknown>, context: Ai11yContext): Promise<unknown>;
31
+ /**
32
+ * Convert OpenAI tool call to our Instruction format
33
+ */
34
+ convertToolCall(toolCall: {
35
+ type: "function";
36
+ function: {
37
+ name: string;
38
+ arguments: string;
39
+ };
40
+ }): Instruction | null;
41
+ /**
42
+ * Check if a tool is registered
43
+ */
44
+ hasTool(name: string): boolean;
45
+ }
46
+ /**
47
+ * Default tool registry with built-in tools
48
+ */
49
+ declare function createDefaultToolRegistry(): ToolRegistry;
50
+ //#endregion
51
+ export { ToolRegistry, createDefaultToolRegistry };
52
+ //# sourceMappingURL=tool-registry.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-registry.d.mts","names":[],"sources":["../src/tool-registry.ts"],"sourcesContent":[],"mappings":";;;;;;AAWA;;AAUgD,cAVnC,YAAA,CAUmC;EAoBpC,QAAA,KAAA;EAFW;;;;EA+BlB,QAAA,CAAA,UAAA,EAjDiB,cAiDjB,EAAA,QAAA,EAjD2C,YAiD3C,CAAA,EAAA,IAAA;EAAW;AA0ChB;;;;;;wBAzEuB;;cAEX;;;;;0CAaJ,kCACG,eACP;;;;;;;;;;MAcC;;;;;;;;;iBA0CW,yBAAA,CAAA,GAA6B"}
@@ -0,0 +1,181 @@
1
+ //#region src/tool-registry.ts
2
+ /**
3
+ * Registry for managing tools that can be called by the LLM agent.
4
+ * This allows extending the agent with custom tools.
5
+ */
6
+ var ToolRegistry = class {
7
+ tools = /* @__PURE__ */ new Map();
8
+ /**
9
+ * Register a new tool
10
+ * @returns this for method chaining
11
+ */
12
+ register(definition, executor) {
13
+ if (this.tools.has(definition.name)) throw new Error(`Tool "${definition.name}" is already registered`);
14
+ this.tools.set(definition.name, {
15
+ definition,
16
+ executor
17
+ });
18
+ return this;
19
+ }
20
+ /**
21
+ * Unregister a tool
22
+ */
23
+ unregister(name) {
24
+ this.tools.delete(name);
25
+ }
26
+ /**
27
+ * Get all registered tool definitions for OpenAI function calling
28
+ */
29
+ getToolDefinitions() {
30
+ return Array.from(this.tools.values()).map(({ definition }) => ({
31
+ type: "function",
32
+ function: definition
33
+ }));
34
+ }
35
+ /**
36
+ * Execute a tool call
37
+ */
38
+ async executeToolCall(toolName, args, context) {
39
+ const tool = this.tools.get(toolName);
40
+ if (!tool) throw new Error(`Tool "${toolName}" is not registered`);
41
+ return tool.executor(args, context);
42
+ }
43
+ /**
44
+ * Convert OpenAI tool call to our Instruction format
45
+ */
46
+ convertToolCall(toolCall) {
47
+ if (!this.tools.get(toolCall.function.name)) return null;
48
+ const args = JSON.parse(toolCall.function.arguments);
49
+ if (toolCall.function.name === "navigate") return {
50
+ action: "navigate",
51
+ route: args.route
52
+ };
53
+ if (toolCall.function.name === "click") return {
54
+ action: "click",
55
+ id: args.markerId
56
+ };
57
+ if (toolCall.function.name === "highlight") return {
58
+ action: "highlight",
59
+ id: args.markerId
60
+ };
61
+ if (toolCall.function.name === "scroll") return {
62
+ action: "scroll",
63
+ id: args.markerId
64
+ };
65
+ if (toolCall.function.name === "fillInput") return {
66
+ action: "fillInput",
67
+ id: args.markerId,
68
+ value: args.value
69
+ };
70
+ return null;
71
+ }
72
+ /**
73
+ * Check if a tool is registered
74
+ */
75
+ hasTool(name) {
76
+ return this.tools.has(name);
77
+ }
78
+ };
79
+ /**
80
+ * Default tool registry with built-in tools
81
+ */
82
+ function createDefaultToolRegistry() {
83
+ const registry = new ToolRegistry();
84
+ registry.register({
85
+ name: "click",
86
+ description: "Click an interactive element (link, button, etc.) by its marker ID. When markerId is in inViewMarkerIds use only 'click'. When markerId is NOT in inViewMarkerIds you MUST call 'scroll' first (same response) then 'click'—both calls required. Never omit the click when the user asked to click.",
87
+ parameters: {
88
+ type: "object",
89
+ properties: { markerId: {
90
+ type: "string",
91
+ description: "The ID of the marker to click. If NOT in inViewMarkerIds, you must call 'scroll' with this markerId first, then 'click' with this same markerId—two tool calls."
92
+ } },
93
+ required: ["markerId"]
94
+ }
95
+ }, async (args) => {
96
+ return {
97
+ success: true,
98
+ markerId: args.markerId
99
+ };
100
+ });
101
+ registry.register({
102
+ name: "scroll",
103
+ description: "Scroll to a UI element by its marker ID to bring it into view. Use when user only wants to see/navigate (single scroll). When user asked to CLICK or interact (increment, press, submit, fill) and the element is not in view: you MUST call scroll first AND then call 'click' (or fillInput etc.) in the same response—never scroll only when they asked for an action. For relative scrolling ('scroll to next'/'previous'): skip markers in inViewMarkerIds.",
104
+ parameters: {
105
+ type: "object",
106
+ properties: { markerId: {
107
+ type: "string",
108
+ description: "The ID of the marker to scroll to. If user asked to click/interact, you must also call the action tool (click, fillInput) after this scroll in the same response."
109
+ } },
110
+ required: ["markerId"]
111
+ }
112
+ }, async (args) => {
113
+ return {
114
+ success: true,
115
+ markerId: args.markerId
116
+ };
117
+ });
118
+ registry.register({
119
+ name: "highlight",
120
+ description: "Highlight a UI element by its marker ID to draw the user's attention. This will also scroll the element into view.",
121
+ parameters: {
122
+ type: "object",
123
+ properties: { markerId: {
124
+ type: "string",
125
+ description: "The ID of the marker to highlight"
126
+ } },
127
+ required: ["markerId"]
128
+ }
129
+ }, async (args) => {
130
+ return {
131
+ success: true,
132
+ markerId: args.markerId
133
+ };
134
+ });
135
+ registry.register({
136
+ name: "navigate",
137
+ description: "Navigate to a different route/page using a route path (e.g., '/billing', '/integrations'). Use only when 'navigate to [X]' refers to a route path, not a UI element. If X matches a marker, use 'scroll' instead (navigate to element = scroll to it).",
138
+ parameters: {
139
+ type: "object",
140
+ properties: { route: {
141
+ type: "string",
142
+ description: "The route path to navigate to (e.g., '/billing', '/integrations', '/')."
143
+ } },
144
+ required: ["route"]
145
+ }
146
+ }, async (args) => {
147
+ return {
148
+ success: true,
149
+ route: args.route
150
+ };
151
+ });
152
+ registry.register({
153
+ name: "fillInput",
154
+ description: "Fill a form field (input, textarea, or select) with a value by its marker ID. Emits native browser events to trigger React onChange handlers and form validation. Use when the user wants to enter text into a form field or select an option from a dropdown. For select elements, the value should match one of the available option values. IMPORTANT: Do NOT fill password fields - politely inform the user that sending passwords over the wire is a security risk and they should enter it manually.",
155
+ parameters: {
156
+ type: "object",
157
+ properties: {
158
+ markerId: {
159
+ type: "string",
160
+ description: "The ID of the marker for the input/textarea/select element to fill"
161
+ },
162
+ value: {
163
+ type: "string",
164
+ description: "The value to fill the field with. For select elements, this must match one of the available option values."
165
+ }
166
+ },
167
+ required: ["markerId", "value"]
168
+ }
169
+ }, async (args) => {
170
+ return {
171
+ success: true,
172
+ markerId: args.markerId,
173
+ value: args.value
174
+ };
175
+ });
176
+ return registry;
177
+ }
178
+
179
+ //#endregion
180
+ export { ToolRegistry, createDefaultToolRegistry };
181
+ //# sourceMappingURL=tool-registry.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-registry.mjs","names":[],"sources":["../src/tool-registry.ts"],"sourcesContent":["import type {\n\tAi11yContext,\n\tInstruction,\n\tToolDefinition,\n\tToolExecutor,\n} from \"@ai11y/core\";\n\n/**\n * Registry for managing tools that can be called by the LLM agent.\n * This allows extending the agent with custom tools.\n */\nexport class ToolRegistry {\n\tprivate tools = new Map<\n\t\tstring,\n\t\t{ definition: ToolDefinition; executor: ToolExecutor }\n\t>();\n\n\t/**\n\t * Register a new tool\n\t * @returns this for method chaining\n\t */\n\tregister(definition: ToolDefinition, executor: ToolExecutor): this {\n\t\tif (this.tools.has(definition.name)) {\n\t\t\tthrow new Error(`Tool \"${definition.name}\" is already registered`);\n\t\t}\n\t\tthis.tools.set(definition.name, { definition, executor });\n\t\treturn this;\n\t}\n\n\t/**\n\t * Unregister a tool\n\t */\n\tunregister(name: string): void {\n\t\tthis.tools.delete(name);\n\t}\n\n\t/**\n\t * Get all registered tool definitions for OpenAI function calling\n\t */\n\tgetToolDefinitions(): Array<{\n\t\ttype: \"function\";\n\t\tfunction: ToolDefinition;\n\t}> {\n\t\treturn Array.from(this.tools.values()).map(({ definition }) => ({\n\t\t\ttype: \"function\" as const,\n\t\t\tfunction: definition,\n\t\t}));\n\t}\n\n\t/**\n\t * Execute a tool call\n\t */\n\tasync executeToolCall(\n\t\ttoolName: string,\n\t\targs: Record<string, unknown>,\n\t\tcontext: Ai11yContext,\n\t): Promise<unknown> {\n\t\tconst tool = this.tools.get(toolName);\n\t\tif (!tool) {\n\t\t\tthrow new Error(`Tool \"${toolName}\" is not registered`);\n\t\t}\n\t\treturn tool.executor(args, context);\n\t}\n\n\t/**\n\t * Convert OpenAI tool call to our Instruction format\n\t */\n\tconvertToolCall(toolCall: {\n\t\ttype: \"function\";\n\t\tfunction: { name: string; arguments: string };\n\t}): Instruction | null {\n\t\tconst tool = this.tools.get(toolCall.function.name);\n\t\tif (!tool) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst args = JSON.parse(toolCall.function.arguments);\n\n\t\tif (toolCall.function.name === \"navigate\") {\n\t\t\treturn { action: \"navigate\", route: args.route };\n\t\t}\n\t\tif (toolCall.function.name === \"click\") {\n\t\t\treturn { action: \"click\", id: args.markerId };\n\t\t}\n\t\tif (toolCall.function.name === \"highlight\") {\n\t\t\treturn { action: \"highlight\", id: args.markerId };\n\t\t}\n\t\tif (toolCall.function.name === \"scroll\") {\n\t\t\treturn { action: \"scroll\", id: args.markerId };\n\t\t}\n\t\tif (toolCall.function.name === \"fillInput\") {\n\t\t\treturn {\n\t\t\t\taction: \"fillInput\",\n\t\t\t\tid: args.markerId,\n\t\t\t\tvalue: args.value,\n\t\t\t};\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Check if a tool is registered\n\t */\n\thasTool(name: string): boolean {\n\t\treturn this.tools.has(name);\n\t}\n}\n\n/**\n * Default tool registry with built-in tools\n */\nexport function createDefaultToolRegistry(): ToolRegistry {\n\tconst registry = new ToolRegistry();\n\n\tregistry.register(\n\t\t{\n\t\t\tname: \"click\",\n\t\t\tdescription:\n\t\t\t\t\"Click an interactive element (link, button, etc.) by its marker ID. When markerId is in inViewMarkerIds use only 'click'. When markerId is NOT in inViewMarkerIds you MUST call 'scroll' first (same response) then 'click'—both calls required. Never omit the click when the user asked to click.\",\n\t\t\tparameters: {\n\t\t\t\ttype: \"object\",\n\t\t\t\tproperties: {\n\t\t\t\t\tmarkerId: {\n\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\"The ID of the marker to click. If NOT in inViewMarkerIds, you must call 'scroll' with this markerId first, then 'click' with this same markerId—two tool calls.\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\trequired: [\"markerId\"],\n\t\t\t},\n\t\t},\n\t\tasync (args) => {\n\t\t\treturn { success: true, markerId: args.markerId };\n\t\t},\n\t);\n\n\tregistry.register(\n\t\t{\n\t\t\tname: \"scroll\",\n\t\t\tdescription:\n\t\t\t\t\"Scroll to a UI element by its marker ID to bring it into view. Use when user only wants to see/navigate (single scroll). When user asked to CLICK or interact (increment, press, submit, fill) and the element is not in view: you MUST call scroll first AND then call 'click' (or fillInput etc.) in the same response—never scroll only when they asked for an action. For relative scrolling ('scroll to next'/'previous'): skip markers in inViewMarkerIds.\",\n\t\t\tparameters: {\n\t\t\t\ttype: \"object\",\n\t\t\t\tproperties: {\n\t\t\t\t\tmarkerId: {\n\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\"The ID of the marker to scroll to. If user asked to click/interact, you must also call the action tool (click, fillInput) after this scroll in the same response.\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\trequired: [\"markerId\"],\n\t\t\t},\n\t\t},\n\t\tasync (args) => {\n\t\t\treturn { success: true, markerId: args.markerId };\n\t\t},\n\t);\n\n\tregistry.register(\n\t\t{\n\t\t\tname: \"highlight\",\n\t\t\tdescription:\n\t\t\t\t\"Highlight a UI element by its marker ID to draw the user's attention. This will also scroll the element into view.\",\n\t\t\tparameters: {\n\t\t\t\ttype: \"object\",\n\t\t\t\tproperties: {\n\t\t\t\t\tmarkerId: {\n\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\tdescription: \"The ID of the marker to highlight\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\trequired: [\"markerId\"],\n\t\t\t},\n\t\t},\n\t\tasync (args) => {\n\t\t\treturn { success: true, markerId: args.markerId };\n\t\t},\n\t);\n\n\tregistry.register(\n\t\t{\n\t\t\tname: \"navigate\",\n\t\t\tdescription:\n\t\t\t\t\"Navigate to a different route/page using a route path (e.g., '/billing', '/integrations'). Use only when 'navigate to [X]' refers to a route path, not a UI element. If X matches a marker, use 'scroll' instead (navigate to element = scroll to it).\",\n\t\t\tparameters: {\n\t\t\t\ttype: \"object\",\n\t\t\t\tproperties: {\n\t\t\t\t\troute: {\n\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\"The route path to navigate to (e.g., '/billing', '/integrations', '/').\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\trequired: [\"route\"],\n\t\t\t},\n\t\t},\n\t\tasync (args) => {\n\t\t\treturn { success: true, route: args.route };\n\t\t},\n\t);\n\n\tregistry.register(\n\t\t{\n\t\t\tname: \"fillInput\",\n\t\t\tdescription:\n\t\t\t\t\"Fill a form field (input, textarea, or select) with a value by its marker ID. Emits native browser events to trigger React onChange handlers and form validation. Use when the user wants to enter text into a form field or select an option from a dropdown. For select elements, the value should match one of the available option values. IMPORTANT: Do NOT fill password fields - politely inform the user that sending passwords over the wire is a security risk and they should enter it manually.\",\n\t\t\tparameters: {\n\t\t\t\ttype: \"object\",\n\t\t\t\tproperties: {\n\t\t\t\t\tmarkerId: {\n\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\"The ID of the marker for the input/textarea/select element to fill\",\n\t\t\t\t\t},\n\t\t\t\t\tvalue: {\n\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\"The value to fill the field with. For select elements, this must match one of the available option values.\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\trequired: [\"markerId\", \"value\"],\n\t\t\t},\n\t\t},\n\t\tasync (args) => {\n\t\t\treturn {\n\t\t\t\tsuccess: true,\n\t\t\t\tmarkerId: args.markerId,\n\t\t\t\tvalue: args.value,\n\t\t\t};\n\t\t},\n\t);\n\n\treturn registry;\n}\n"],"mappings":";;;;;AAWA,IAAa,eAAb,MAA0B;CACzB,AAAQ,wBAAQ,IAAI,KAGjB;;;;;CAMH,SAAS,YAA4B,UAA8B;AAClE,MAAI,KAAK,MAAM,IAAI,WAAW,KAAK,CAClC,OAAM,IAAI,MAAM,SAAS,WAAW,KAAK,yBAAyB;AAEnE,OAAK,MAAM,IAAI,WAAW,MAAM;GAAE;GAAY;GAAU,CAAC;AACzD,SAAO;;;;;CAMR,WAAW,MAAoB;AAC9B,OAAK,MAAM,OAAO,KAAK;;;;;CAMxB,qBAGG;AACF,SAAO,MAAM,KAAK,KAAK,MAAM,QAAQ,CAAC,CAAC,KAAK,EAAE,kBAAkB;GAC/D,MAAM;GACN,UAAU;GACV,EAAE;;;;;CAMJ,MAAM,gBACL,UACA,MACA,SACmB;EACnB,MAAM,OAAO,KAAK,MAAM,IAAI,SAAS;AACrC,MAAI,CAAC,KACJ,OAAM,IAAI,MAAM,SAAS,SAAS,qBAAqB;AAExD,SAAO,KAAK,SAAS,MAAM,QAAQ;;;;;CAMpC,gBAAgB,UAGO;AAEtB,MAAI,CADS,KAAK,MAAM,IAAI,SAAS,SAAS,KAAK,CAElD,QAAO;EAGR,MAAM,OAAO,KAAK,MAAM,SAAS,SAAS,UAAU;AAEpD,MAAI,SAAS,SAAS,SAAS,WAC9B,QAAO;GAAE,QAAQ;GAAY,OAAO,KAAK;GAAO;AAEjD,MAAI,SAAS,SAAS,SAAS,QAC9B,QAAO;GAAE,QAAQ;GAAS,IAAI,KAAK;GAAU;AAE9C,MAAI,SAAS,SAAS,SAAS,YAC9B,QAAO;GAAE,QAAQ;GAAa,IAAI,KAAK;GAAU;AAElD,MAAI,SAAS,SAAS,SAAS,SAC9B,QAAO;GAAE,QAAQ;GAAU,IAAI,KAAK;GAAU;AAE/C,MAAI,SAAS,SAAS,SAAS,YAC9B,QAAO;GACN,QAAQ;GACR,IAAI,KAAK;GACT,OAAO,KAAK;GACZ;AAGF,SAAO;;;;;CAMR,QAAQ,MAAuB;AAC9B,SAAO,KAAK,MAAM,IAAI,KAAK;;;;;;AAO7B,SAAgB,4BAA0C;CACzD,MAAM,WAAW,IAAI,cAAc;AAEnC,UAAS,SACR;EACC,MAAM;EACN,aACC;EACD,YAAY;GACX,MAAM;GACN,YAAY,EACX,UAAU;IACT,MAAM;IACN,aACC;IACD,EACD;GACD,UAAU,CAAC,WAAW;GACtB;EACD,EACD,OAAO,SAAS;AACf,SAAO;GAAE,SAAS;GAAM,UAAU,KAAK;GAAU;GAElD;AAED,UAAS,SACR;EACC,MAAM;EACN,aACC;EACD,YAAY;GACX,MAAM;GACN,YAAY,EACX,UAAU;IACT,MAAM;IACN,aACC;IACD,EACD;GACD,UAAU,CAAC,WAAW;GACtB;EACD,EACD,OAAO,SAAS;AACf,SAAO;GAAE,SAAS;GAAM,UAAU,KAAK;GAAU;GAElD;AAED,UAAS,SACR;EACC,MAAM;EACN,aACC;EACD,YAAY;GACX,MAAM;GACN,YAAY,EACX,UAAU;IACT,MAAM;IACN,aAAa;IACb,EACD;GACD,UAAU,CAAC,WAAW;GACtB;EACD,EACD,OAAO,SAAS;AACf,SAAO;GAAE,SAAS;GAAM,UAAU,KAAK;GAAU;GAElD;AAED,UAAS,SACR;EACC,MAAM;EACN,aACC;EACD,YAAY;GACX,MAAM;GACN,YAAY,EACX,OAAO;IACN,MAAM;IACN,aACC;IACD,EACD;GACD,UAAU,CAAC,QAAQ;GACnB;EACD,EACD,OAAO,SAAS;AACf,SAAO;GAAE,SAAS;GAAM,OAAO,KAAK;GAAO;GAE5C;AAED,UAAS,SACR;EACC,MAAM;EACN,aACC;EACD,YAAY;GACX,MAAM;GACN,YAAY;IACX,UAAU;KACT,MAAM;KACN,aACC;KACD;IACD,OAAO;KACN,MAAM;KACN,aACC;KACD;IACD;GACD,UAAU,CAAC,YAAY,QAAQ;GAC/B;EACD,EACD,OAAO,SAAS;AACf,SAAO;GACN,SAAS;GACT,UAAU,KAAK;GACf,OAAO,KAAK;GACZ;GAEF;AAED,QAAO"}
@@ -0,0 +1,14 @@
1
+ //#region src/types.d.ts
2
+ /**
3
+ * Server configuration
4
+ */
5
+ interface ServerConfig {
6
+ provider: "openai";
7
+ apiKey: string;
8
+ model?: string;
9
+ temperature?: number;
10
+ baseURL?: string;
11
+ }
12
+ //#endregion
13
+ export { ServerConfig };
14
+ //# sourceMappingURL=types.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.mts","names":[],"sources":["../src/types.ts"],"sourcesContent":[],"mappings":";;AAGA;;UAAiB,YAAA"}
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "@ai11y/agent",
3
+ "version": "0.0.1",
4
+ "type": "module",
5
+ "main": "./dist/index.mjs",
6
+ "types": "./dist/index.d.mts",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.mts",
10
+ "import": "./dist/index.mjs"
11
+ },
12
+ "./fastify": {
13
+ "types": "./dist/fastify.d.mts",
14
+ "import": "./dist/fastify.mjs"
15
+ }
16
+ },
17
+ "dependencies": {
18
+ "@langchain/core": "1.1.8",
19
+ "@langchain/openai": "1.2.0",
20
+ "zod": "4.2.1",
21
+ "@ai11y/core": "0.0.1"
22
+ },
23
+ "peerDependencies": {
24
+ "fastify": "5.7.4"
25
+ },
26
+ "devDependencies": {
27
+ "@types/node": "25.0.3",
28
+ "fastify": "5.7.4",
29
+ "tsdown": "0.18.1",
30
+ "tsx": "4.21.0",
31
+ "typescript": "5.9.3"
32
+ },
33
+ "publishConfig": {
34
+ "access": "public"
35
+ },
36
+ "scripts": {
37
+ "build": "tsdown",
38
+ "watch": "tsdown --watch"
39
+ }
40
+ }