@agentica/core 0.43.2 → 0.44.0-dev.20260313

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.
Files changed (205) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +218 -218
  3. package/lib/constants/AgenticaSystemPrompt.js +1 -1
  4. package/lib/constants/AgenticaSystemPrompt.js.map +1 -1
  5. package/lib/context/AgenticaOperation.d.ts +3 -2
  6. package/lib/context/internal/AgenticaOperationComposer.js.map +1 -1
  7. package/lib/context/internal/AgenticaTokenUsageAggregator.js.map +1 -1
  8. package/lib/context/internal/__IChatInitialApplication.d.ts +1 -1
  9. package/lib/errors/AgenticaJsonParseError.d.ts +5 -8
  10. package/lib/errors/AgenticaJsonParseError.js +11 -6
  11. package/lib/errors/AgenticaJsonParseError.js.map +1 -1
  12. package/lib/errors/AgenticaValidationError.d.ts +1 -1
  13. package/lib/events/AgenticaExecuteEvent.d.ts +1 -1
  14. package/lib/events/AgenticaJsonParseErrorEvent.d.ts +2 -2
  15. package/lib/factory/events.d.ts +2 -3
  16. package/lib/factory/events.js +1 -2
  17. package/lib/factory/events.js.map +1 -1
  18. package/lib/functional/assertHttpController.d.ts +2 -3
  19. package/lib/functional/assertHttpController.js +3939 -2656
  20. package/lib/functional/assertHttpController.js.map +1 -1
  21. package/lib/functional/assertHttpLlmApplication.d.ts +3 -3
  22. package/lib/functional/assertHttpLlmApplication.js +3939 -2656
  23. package/lib/functional/assertHttpLlmApplication.js.map +1 -1
  24. package/lib/functional/assertMcpController.d.ts +2 -2
  25. package/lib/functional/assertMcpController.js +202 -629
  26. package/lib/functional/assertMcpController.js.map +1 -1
  27. package/lib/functional/createMcpLlmApplication.d.ts +6 -0
  28. package/lib/functional/createMcpLlmApplication.js +56 -0
  29. package/lib/functional/createMcpLlmApplication.js.map +1 -0
  30. package/lib/functional/validateHttpController.d.ts +3 -3
  31. package/lib/functional/validateHttpController.js +3367 -2268
  32. package/lib/functional/validateHttpController.js.map +1 -1
  33. package/lib/functional/validateHttpLlmApplication.d.ts +3 -4
  34. package/lib/functional/validateHttpLlmApplication.js +3367 -2268
  35. package/lib/functional/validateHttpLlmApplication.js.map +1 -1
  36. package/lib/functional/validateMcpController.d.ts +2 -2
  37. package/lib/functional/validateMcpController.js +388 -1161
  38. package/lib/functional/validateMcpController.js.map +1 -1
  39. package/lib/histories/AgenticaExecuteHistory.d.ts +1 -1
  40. package/lib/index.mjs +21256 -18948
  41. package/lib/index.mjs.map +1 -1
  42. package/lib/orchestrate/call.js +43 -56
  43. package/lib/orchestrate/call.js.map +1 -1
  44. package/lib/orchestrate/cancel.js +9 -66
  45. package/lib/orchestrate/cancel.js.map +1 -1
  46. package/lib/orchestrate/initialize.js +4 -947
  47. package/lib/orchestrate/initialize.js.map +1 -1
  48. package/lib/orchestrate/select.js +11 -68
  49. package/lib/orchestrate/select.js.map +1 -1
  50. package/lib/structures/IAgenticaController.d.ts +143 -151
  51. package/lib/structures/IMcpTool.d.ts +52 -0
  52. package/lib/structures/IMcpTool.js +3 -0
  53. package/lib/structures/IMcpTool.js.map +1 -0
  54. package/lib/utils/ChatGptCompletionMessageUtil.js +16 -5
  55. package/lib/utils/ChatGptCompletionMessageUtil.js.map +1 -1
  56. package/lib/utils/ChatGptCompletionMessageUtil.spec.js +0 -5
  57. package/lib/utils/ChatGptCompletionMessageUtil.spec.js.map +1 -1
  58. package/package.json +7 -9
  59. package/prompts/cancel.md +5 -5
  60. package/prompts/common.md +3 -3
  61. package/prompts/describe.md +7 -7
  62. package/prompts/execute.md +122 -122
  63. package/prompts/initialize.md +3 -3
  64. package/prompts/json_parse_error.md +35 -33
  65. package/prompts/select.md +7 -7
  66. package/prompts/validate.md +123 -123
  67. package/prompts/validate_repeated.md +31 -31
  68. package/src/Agentica.ts +367 -367
  69. package/src/MicroAgentica.ts +357 -357
  70. package/src/constants/AgenticaConstant.ts +4 -4
  71. package/src/constants/AgenticaDefaultPrompt.ts +44 -44
  72. package/src/constants/AgenticaSystemPrompt.ts +1 -1
  73. package/src/constants/index.ts +2 -2
  74. package/src/context/AgenticaContext.ts +136 -136
  75. package/src/context/AgenticaContextRequestResult.ts +14 -14
  76. package/src/context/AgenticaOperation.ts +73 -72
  77. package/src/context/AgenticaOperationCollection.ts +49 -49
  78. package/src/context/AgenticaOperationSelection.ts +9 -9
  79. package/src/context/AgenticaTokenUsage.ts +186 -186
  80. package/src/context/MicroAgenticaContext.ts +99 -99
  81. package/src/context/index.ts +5 -5
  82. package/src/context/internal/AgenticaOperationComposer.ts +177 -177
  83. package/src/context/internal/AgenticaTokenUsageAggregator.ts +66 -66
  84. package/src/context/internal/__IChatCancelFunctionsApplication.ts +23 -23
  85. package/src/context/internal/__IChatFunctionReference.ts +21 -21
  86. package/src/context/internal/__IChatInitialApplication.ts +15 -15
  87. package/src/context/internal/__IChatSelectFunctionsApplication.ts +24 -24
  88. package/src/context/internal/isAgenticaContext.ts +11 -11
  89. package/src/errors/AgenticaJsonParseError.ts +52 -47
  90. package/src/errors/AgenticaValidationError.ts +49 -49
  91. package/src/errors/index.ts +2 -2
  92. package/src/events/AgenticaAssistantMessageEvent.ts +12 -12
  93. package/src/events/AgenticaCallEvent.ts +27 -27
  94. package/src/events/AgenticaCancelEvent.ts +9 -9
  95. package/src/events/AgenticaDescribeEvent.ts +14 -14
  96. package/src/events/AgenticaEvent.ts +59 -59
  97. package/src/events/AgenticaEvent.type.ts +19 -19
  98. package/src/events/AgenticaEventBase.ts +18 -18
  99. package/src/events/AgenticaEventSource.ts +6 -6
  100. package/src/events/AgenticaExecuteEvent.ts +45 -45
  101. package/src/events/AgenticaInitializeEvent.ts +7 -7
  102. package/src/events/AgenticaJsonParseErrorEvent.ts +16 -15
  103. package/src/events/AgenticaRequestEvent.ts +27 -27
  104. package/src/events/AgenticaResponseEvent.ts +32 -32
  105. package/src/events/AgenticaSelectEvent.ts +11 -11
  106. package/src/events/AgenticaUserMessageEvent.ts +12 -12
  107. package/src/events/AgenticaValidateEvent.ts +32 -32
  108. package/src/events/MicroAgenticaEvent.ts +45 -45
  109. package/src/events/index.ts +15 -15
  110. package/src/factory/events.ts +357 -359
  111. package/src/factory/histories.ts +348 -348
  112. package/src/factory/index.ts +3 -3
  113. package/src/factory/operations.ts +16 -16
  114. package/src/functional/assertHttpController.ts +106 -104
  115. package/src/functional/assertHttpLlmApplication.ts +52 -57
  116. package/src/functional/assertMcpController.ts +47 -44
  117. package/src/functional/createMcpLlmApplication.ts +72 -0
  118. package/src/functional/index.ts +7 -7
  119. package/src/functional/validateHttpController.ts +113 -110
  120. package/src/functional/validateHttpLlmApplication.ts +65 -70
  121. package/src/functional/validateMcpController.ts +53 -50
  122. package/src/histories/AgenticaAssistantMessageHistory.ts +10 -10
  123. package/src/histories/AgenticaCancelHistory.ts +8 -8
  124. package/src/histories/AgenticaDescribeHistory.ts +18 -18
  125. package/src/histories/AgenticaExecuteHistory.ts +64 -64
  126. package/src/histories/AgenticaHistory.ts +28 -28
  127. package/src/histories/AgenticaHistoryBase.ts +35 -35
  128. package/src/histories/AgenticaSelectHistory.ts +8 -8
  129. package/src/histories/AgenticaSystemMessageHistory.ts +10 -10
  130. package/src/histories/AgenticaUserMessageHistory.ts +11 -11
  131. package/src/histories/MicroAgenticaHistory.ts +19 -19
  132. package/src/histories/contents/AgenticaUserMessageAudioContent.ts +21 -21
  133. package/src/histories/contents/AgenticaUserMessageContent.ts +19 -19
  134. package/src/histories/contents/AgenticaUserMessageContentBase.ts +6 -6
  135. package/src/histories/contents/AgenticaUserMessageFileContent.ts +25 -25
  136. package/src/histories/contents/AgenticaUserMessageImageContent.ts +33 -33
  137. package/src/histories/contents/AgenticaUserMessageTextContent.ts +15 -15
  138. package/src/histories/contents/index.ts +5 -5
  139. package/src/histories/index.ts +10 -10
  140. package/src/index.ts +15 -15
  141. package/src/json/IAgenticaEventJson.ts +265 -265
  142. package/src/json/IAgenticaEventJson.type.ts +19 -19
  143. package/src/json/IAgenticaHistoryJson.ts +165 -165
  144. package/src/json/IAgenticaHistoryJson.type.ts +19 -19
  145. package/src/json/IAgenticaOperationJson.ts +36 -36
  146. package/src/json/IAgenticaOperationSelectionJson.ts +26 -26
  147. package/src/json/IAgenticaTokenUsageJson.ts +107 -107
  148. package/src/json/IMicroAgenticaEventJson.ts +22 -22
  149. package/src/json/IMicroAgenticaHistoryJson.ts +25 -25
  150. package/src/json/index.ts +7 -7
  151. package/src/orchestrate/call.ts +542 -558
  152. package/src/orchestrate/cancel.ts +265 -269
  153. package/src/orchestrate/describe.ts +66 -66
  154. package/src/orchestrate/execute.ts +61 -61
  155. package/src/orchestrate/index.ts +6 -6
  156. package/src/orchestrate/initialize.ts +102 -102
  157. package/src/orchestrate/internal/cancelFunctionFromContext.ts +33 -33
  158. package/src/orchestrate/internal/selectFunctionFromContext.ts +34 -34
  159. package/src/orchestrate/select.ts +320 -322
  160. package/src/structures/IAgenticaConfig.ts +83 -83
  161. package/src/structures/IAgenticaConfigBase.ts +87 -87
  162. package/src/structures/IAgenticaController.ts +143 -151
  163. package/src/structures/IAgenticaExecutor.ts +167 -167
  164. package/src/structures/IAgenticaProps.ts +78 -78
  165. package/src/structures/IAgenticaSystemPrompt.ts +236 -236
  166. package/src/structures/IAgenticaVendor.ts +54 -54
  167. package/src/structures/IMcpTool.ts +60 -0
  168. package/src/structures/IMicroAgenticaConfig.ts +56 -56
  169. package/src/structures/IMicroAgenticaExecutor.ts +67 -67
  170. package/src/structures/IMicroAgenticaProps.ts +77 -77
  171. package/src/structures/IMicroAgenticaSystemPrompt.ts +169 -169
  172. package/src/structures/index.ts +10 -10
  173. package/src/transformers/transformHistory.ts +172 -172
  174. package/src/utils/AssistantMessageEmptyError.ts +20 -20
  175. package/src/utils/AsyncQueue.spec.ts +355 -355
  176. package/src/utils/AsyncQueue.ts +95 -95
  177. package/src/utils/ByteArrayUtil.ts +5 -5
  178. package/src/utils/ChatGptCompletionMessageUtil.spec.ts +314 -320
  179. package/src/utils/ChatGptCompletionMessageUtil.ts +210 -195
  180. package/src/utils/ChatGptCompletionStreamingUtil.spec.ts +909 -909
  181. package/src/utils/ChatGptCompletionStreamingUtil.ts +91 -91
  182. package/src/utils/ChatGptTokenUsageAggregator.spec.ts +226 -226
  183. package/src/utils/ChatGptTokenUsageAggregator.ts +57 -57
  184. package/src/utils/MPSC.spec.ts +276 -276
  185. package/src/utils/MPSC.ts +42 -42
  186. package/src/utils/Singleton.spec.ts +138 -138
  187. package/src/utils/Singleton.ts +42 -42
  188. package/src/utils/StreamUtil.spec.ts +512 -512
  189. package/src/utils/StreamUtil.ts +87 -87
  190. package/src/utils/__map_take.spec.ts +140 -140
  191. package/src/utils/__map_take.ts +13 -13
  192. package/src/utils/__retry.spec.ts +198 -198
  193. package/src/utils/__retry.ts +18 -18
  194. package/src/utils/assertExecuteFailure.ts +16 -16
  195. package/src/utils/index.ts +4 -4
  196. package/src/utils/request.ts +140 -140
  197. package/src/utils/types.ts +50 -50
  198. package/lib/context/internal/AgenticaOperationComposer.spec.d.ts +0 -1
  199. package/lib/context/internal/AgenticaOperationComposer.spec.js +0 -353
  200. package/lib/context/internal/AgenticaOperationComposer.spec.js.map +0 -1
  201. package/lib/utils/JsonUtil.d.ts +0 -8
  202. package/lib/utils/JsonUtil.js +0 -350
  203. package/lib/utils/JsonUtil.js.map +0 -1
  204. package/src/context/internal/AgenticaOperationComposer.spec.ts +0 -401
  205. package/src/utils/JsonUtil.ts +0 -462
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Wrtn Technologies
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Wrtn Technologies
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,218 +1,218 @@
1
- # Agentica, AI Function Calling Framework
2
-
3
- ![Agentica - ReadMe Diagram](https://github.com/user-attachments/assets/ecd06d51-b818-41c8-ab31-f0e40f48034e)
4
-
5
- <!-- Github/NPM Badges -->
6
- <p align="center">
7
- <a href="https://github.com/wrtnlabs/agentica/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="MIT License"/></a>
8
- <a href="https://www.npmjs.com/package/@agentica/core"><img src="https://img.shields.io/npm/v/@agentica/core.svg" alt="NPM Version"/></a>
9
- <a href="https://www.npmjs.com/package/@agentica/core"><img src="https://img.shields.io/npm/dm/@agentica/core.svg" alt="NPM Downloads"/></a>
10
- <a href="https://dormoshe.io/newsletters/373"><img src="https://img.shields.io/badge/DorMoshe%20Newsletter-Top%20%236%20of%201K-orange?style=flat&logo=rss" alt="Newsletter Top #6"/></a>
11
- <a href="https://github.com/wrtnlabs/agentica/actions?query=workflow%3Abuild"><img src="https://github.com/wrtnlabs/agentica/workflows/build/badge.svg" alt="Build Status"/></a>
12
- </p>
13
-
14
- <!-- Youtube + Discord -->
15
- <p align="center">
16
- <a href="https://www.youtube.com/@wrtnlabs">
17
- <img src="https://img.shields.io/badge/YouTube%20Tutorial-0d1117?style=social&logo=youtube" alt="YouTube"/>
18
- </a>
19
- &nbsp;
20
- <a href="https://discord.gg/aMhRmzkqCx">
21
- <img src="https://img.shields.io/badge/Discord-0d1117?style=social&logo=discord" alt="Discord"/>
22
- </a>
23
- </p>
24
-
25
- <p align="center">
26
- <a href="https://www.bloomberg.com/news/videos/2025-03-31/wtrn-on-series-b-funding-growth-strategy-video">
27
- <img src="https://wrtnlabs.io/agentica/images/badges/fund-raising-news-202503.svg" />
28
- </a>
29
- &nbsp;&nbsp;
30
- <a href="https://github.com/wrtnlabs">
31
- <img src="https://wrtnlabs.io/agentica/images/badges/open-source-mission.svg" />
32
- </a>
33
- </p>
34
-
35
- Agentic AI framework specialized in AI Function Calling.
36
-
37
- Don't be afraid of AI agent development. Just list functions from three protocols below. This is everything you should do for AI agent development.
38
-
39
- - TypeScript Class
40
- - Swagger/OpenAPI Document
41
- - MCP (Model Context Protocol) Server
42
-
43
- Wanna make an e-commerce agent? Bring in e-commerce functions. Need a newspaper agent? Get API functions from the newspaper company. Just prepare any functions that you need, then it becomes an AI agent.
44
-
45
- Are you a TypeScript developer? Then you're already an AI developer. Familiar with backend development? You're already well-versed in AI development. Anyone who can make functions can make AI agents.
46
-
47
- <!-- eslint-skip -->
48
-
49
- ```typescript
50
-
51
- import { Agentica, assertHttpController } from "@agentica/core";
52
- import OpenAI from "openai";
53
- import typia from "typia";
54
-
55
- import { MobileFileSystem } from "./services/MobileFileSystem";
56
-
57
- const agent = new Agentica({
58
- vendor: {
59
- api: new OpenAI({ apiKey: "********" }),
60
- model: "gpt-4o-mini",
61
- },
62
- controllers: [
63
- // functions from TypeScript class
64
- typia.llm.controller<MobileFileSystem>(
65
- "filesystem",
66
- new MobileFileSystem(),
67
- ),
68
- // functions from Swagger/OpenAPI
69
- assertHttpController({
70
- name: "shopping",
71
- model: "chatgpt",
72
- document: await fetch(
73
- "https://shopping-be.wrtn.ai/editor/swagger.json",
74
- ).then(r => r.json()),
75
- connection: {
76
- host: "https://shopping-be.wrtn.ai",
77
- headers: { Authorization: "Bearer ********" },
78
- },
79
- }),
80
- ],
81
- });
82
- await agent.conversate("I wanna buy MacBook Pro");
83
-
84
- ```
85
-
86
- ## 📦 Setup
87
-
88
- ```bash
89
- $ npx agentica start <directory>
90
-
91
- ----------------------------------------
92
- Agentica Setup Wizard
93
- ----------------------------------------
94
- ? Package Manager (use arrow keys)
95
- > npm
96
- pnpm
97
- yarn (berry is not supported)
98
- ? Project Type
99
- NodeJS Agent Server
100
- > NestJS Agent Server
101
- React Client Application
102
- Standalone Application
103
- ? Embedded Controllers (multi-selectable)
104
- (none)
105
- Google Calendar
106
- Google News
107
- > Github
108
- Reddit
109
- Slack
110
- ...
111
- ```
112
-
113
- The setup wizard helps you create a new project tailored to your needs.
114
-
115
- For reference, when selecting a project type, any option other than "Standalone Application" will implement the [WebSocket Protocol](https://wrtnlabs.io/agentica/docs/websocket/) for client-server communication.
116
-
117
- For comprehensive setup instructions, visit our [Getting Started](https://wrtnlabs.io/agentica/docs/) guide.
118
-
119
- ## 💻 Playground
120
-
121
- Experience Agentica firsthand through our [interactive playground](https://wrtnlabs.io/agentica/playground) before installing.
122
-
123
- Our demonstrations showcase the power and simplicity of Agentica's function calling capabilities across different integration methods.
124
-
125
- - [TypeScript Class](https://wrtnlabs.io/agentica/playground/bbs)
126
- - [Swagger/OpenAPI Document](https://wrtnlabs.io/agentica/playground/uploader)
127
- - [Enterprise E-commerce Agent](https://wrtnlabs.io/agentica/playground/shopping)
128
-
129
- ![E-commerce Agent Demo](https://github.com/user-attachments/assets/fbfa9f93-304c-4728-933e-deb8ecd7a2af)
130
-
131
- <!--
132
- @todo this section would be changed after making tutorial playground
133
- -->
134
-
135
- ## 📚 Documentation Resources
136
-
137
- Find comprehensive resources at our [official website](https://wrtnlabs.io/agentica).
138
-
139
- - [Home](https://wrtnlabs.io/agentica)
140
- - [Guide Documents](https://wrtnlabs.io/agentica/docs)
141
- - [Setup](https://wrtnlabs.io/agentica/docs/setup/cli/)
142
- - [Concepts](https://wrtnlabs.io/agentica/docs/concepts/function-calling/)
143
- - [Core Library](https://wrtnlabs.io/agentica/docs/core/)
144
- - [WebSocket Protocol](https://wrtnlabs.io/agentica/docs/websocket/)
145
- - [Plugin Modules](https://wrtnlabs.io/agentica/docs/plugins/benchmark/)
146
- - [Tutorial](https://wrtnlabs.io/agentica/tutorial)
147
- - [Productivity](https://wrtnlabs.io/agentica/tutorial/productivity/arxiv/)
148
- - [Coding](https://wrtnlabs.io/agentica/tutorial/coding/file-system/)
149
- - [React Native](https://wrtnlabs.io/agentica/tutorial/react-native/sms/)
150
- - [Enterprise](https://wrtnlabs.io/agentica/tutorial/enterprise/shopping/)
151
- - [API Documents](https://wrtnlabs.io/agentica/api)
152
- - [Youtube](https://www.youtube.com/@wrtnlabs)
153
- - [Paper](https://wrtnlabs.io/agentica/paper)
154
-
155
- https://github.com/user-attachments/assets/2f2a4cdc-6cf1-4304-b82d-04a8ed0be0dd
156
-
157
- > Tutorial Videos: https://www.youtube.com/@wrtnlabs
158
-
159
- ## 🌟 Why Agentica?
160
-
161
- ```mermaid
162
- flowchart
163
- subgraph "JSON Schema Specification"
164
- schemav4("JSON Schema v4 ~ v7") --upgrades--> emended[["OpenAPI v3.1 (emended)"]]
165
- schema2910("JSON Schema 2019-03") --upgrades--> emended
166
- schema2020("JSON Schema 2020-12") --emends--> emended
167
- end
168
- subgraph "Agentica"
169
- emended --"Artificial Intelligence"--> fc{{"AI Function Calling"}}
170
- fc --"OpenAI"--> chatgpt("ChatGPT")
171
- fc --"Google"--> gemini("Gemini")
172
- fc --"Anthropic"--> claude("Claude")
173
- fc --"High-Flyer"--> deepseek("DeepSeek")
174
- fc --"Meta"--> llama("Llama")
175
- chatgpt --"3.1"--> custom(["Custom JSON Schema"])
176
- gemini --"3.0"--> custom(["Custom JSON Schema"])
177
- claude --"3.1"--> standard(["Standard JSON Schema"])
178
- deepseek --"3.1"--> standard
179
- llama --"3.1"--> standard
180
- end
181
- ```
182
-
183
- Agentica enhances AI function calling by the following strategies:
184
-
185
- - [**Compiler Driven Development**](https://wrtnlabs.io/agentica/docs/concepts/compiler-driven-development): constructs function calling schema automatically by compiler skills without hand-writing.
186
- - [**JSON Schema Conversion**](https://wrtnlabs.io/agentica/docs/core/vendor/#schema-specification): automatically handles specification differences between LLM vendors, ensuring seamless integration regardless of your chosen AI model.
187
- - [**Validation Feedback**](https://wrtnlabs.io/agentica/docs/concepts/function-calling#validation-feedback): detects and corrects AI mistakes in argument composition, dramatically reducing errors and improving reliability.
188
- - [**Selector Agent**](https://wrtnlabs.io/agentica/docs/concepts/function-calling#orchestration-strategy): filtering candidate functions to minimize context usage, optimize performance, and reduce token consumption.
189
-
190
- Thanks to these innovations, Agentica makes AI function calling easier, safer, and more accurate than before. Development becomes more intuitive since you only need to prepare functions relevant to your specific use case, and scaling your agent's capabilities is as simple as adding or removing functions.
191
-
192
- In 2023, when OpenAI announced function calling, many predicted that function calling-driven AI development would become the mainstream. However, in reality, due to the difficulty and instability of function calling, the trend in AI development became agent workflow. Agent workflow, which is inflexible and must be created for specific purposes, has conquered the AI agent ecosystem.
193
-
194
- By the way, as Agentica has resolved the difficulty and instability problems of function calling, the time has come to embrace function-driven AI development once again.
195
-
196
- | Type | Workflow | Vanilla Function Calling | Agentica Function Calling |
197
- | ----------- | ------------- | ------------------------ | ------------------------- |
198
- | Purpose | ❌ Specific | 🟢 General | 🟢 General |
199
- | Difficulty | ❌ Difficult | ❌ Difficult | 🟢 Easy |
200
- | Stability | 🟢 Stable | ❌ Unstable | 🟢 Stable |
201
- | Flexibility | ❌ Inflexible | 🟢 Flexible | 🟢 Flexible |
202
-
203
- ## 💬 Community & Support
204
-
205
- For support, questions, or to provide feedback, join our Discord community:
206
-
207
- [![Discord](https://dcbadge.limes.pink/api/server/https://discord.gg/aMhRmzkqCx)](https://discord.gg/aMhRmzkqCx)
208
-
209
- ## ⚖️ License
210
-
211
- Agentica is open-source and available under the [MIT License](https://github.com/wrtnlabs/agentica/blob/master/LICENSE).
212
-
213
- <p align="center">
214
- <img src="https://github.com/user-attachments/assets/ecd0b82e-bfb7-4eb5-ae97-75be0cb22f10" alt="Wrtn Labs Logo" />
215
- </p>
216
- <div align="center">
217
- Agentica is maintained by <a href="https://wrtnlabs.io">Wrtn Technologies</a> &mdash; Empowering developers to transform TypeScript functions and OpenAPI specs into powerful AI agents.
218
- </div>
1
+ # Agentica, AI Function Calling Framework
2
+
3
+ ![Agentica - ReadMe Diagram](https://github.com/user-attachments/assets/ecd06d51-b818-41c8-ab31-f0e40f48034e)
4
+
5
+ <!-- Github/NPM Badges -->
6
+ <p align="center">
7
+ <a href="https://github.com/wrtnlabs/agentica/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="MIT License"/></a>
8
+ <a href="https://www.npmjs.com/package/@agentica/core"><img src="https://img.shields.io/npm/v/@agentica/core.svg" alt="NPM Version"/></a>
9
+ <a href="https://www.npmjs.com/package/@agentica/core"><img src="https://img.shields.io/npm/dm/@agentica/core.svg" alt="NPM Downloads"/></a>
10
+ <a href="https://dormoshe.io/newsletters/373"><img src="https://img.shields.io/badge/DorMoshe%20Newsletter-Top%20%236%20of%201K-orange?style=flat&logo=rss" alt="Newsletter Top #6"/></a>
11
+ <a href="https://github.com/wrtnlabs/agentica/actions?query=workflow%3Abuild"><img src="https://github.com/wrtnlabs/agentica/workflows/build/badge.svg" alt="Build Status"/></a>
12
+ </p>
13
+
14
+ <!-- Youtube + Discord -->
15
+ <p align="center">
16
+ <a href="https://www.youtube.com/@wrtnlabs">
17
+ <img src="https://img.shields.io/badge/YouTube%20Tutorial-0d1117?style=social&logo=youtube" alt="YouTube"/>
18
+ </a>
19
+ &nbsp;
20
+ <a href="https://discord.gg/aMhRmzkqCx">
21
+ <img src="https://img.shields.io/badge/Discord-0d1117?style=social&logo=discord" alt="Discord"/>
22
+ </a>
23
+ </p>
24
+
25
+ <p align="center">
26
+ <a href="https://www.bloomberg.com/news/videos/2025-03-31/wtrn-on-series-b-funding-growth-strategy-video">
27
+ <img src="https://wrtnlabs.io/agentica/images/badges/fund-raising-news-202503.svg" />
28
+ </a>
29
+ &nbsp;&nbsp;
30
+ <a href="https://github.com/wrtnlabs">
31
+ <img src="https://wrtnlabs.io/agentica/images/badges/open-source-mission.svg" />
32
+ </a>
33
+ </p>
34
+
35
+ Agentic AI framework specialized in AI Function Calling.
36
+
37
+ Don't be afraid of AI agent development. Just list functions from three protocols below. This is everything you should do for AI agent development.
38
+
39
+ - TypeScript Class
40
+ - Swagger/OpenAPI Document
41
+ - MCP (Model Context Protocol) Server
42
+
43
+ Wanna make an e-commerce agent? Bring in e-commerce functions. Need a newspaper agent? Get API functions from the newspaper company. Just prepare any functions that you need, then it becomes an AI agent.
44
+
45
+ Are you a TypeScript developer? Then you're already an AI developer. Familiar with backend development? You're already well-versed in AI development. Anyone who can make functions can make AI agents.
46
+
47
+ <!-- eslint-skip -->
48
+
49
+ ```typescript
50
+
51
+ import { Agentica, assertHttpController } from "@agentica/core";
52
+ import OpenAI from "openai";
53
+ import typia from "typia";
54
+
55
+ import { MobileFileSystem } from "./services/MobileFileSystem";
56
+
57
+ const agent = new Agentica({
58
+ vendor: {
59
+ api: new OpenAI({ apiKey: "********" }),
60
+ model: "gpt-4o-mini",
61
+ },
62
+ controllers: [
63
+ // functions from TypeScript class
64
+ typia.llm.controller<MobileFileSystem>(
65
+ "filesystem",
66
+ new MobileFileSystem(),
67
+ ),
68
+ // functions from Swagger/OpenAPI
69
+ assertHttpController({
70
+ name: "shopping",
71
+ model: "chatgpt",
72
+ document: await fetch(
73
+ "https://shopping-be.wrtn.ai/editor/swagger.json",
74
+ ).then(r => r.json()),
75
+ connection: {
76
+ host: "https://shopping-be.wrtn.ai",
77
+ headers: { Authorization: "Bearer ********" },
78
+ },
79
+ }),
80
+ ],
81
+ });
82
+ await agent.conversate("I wanna buy MacBook Pro");
83
+
84
+ ```
85
+
86
+ ## 📦 Setup
87
+
88
+ ```bash
89
+ $ npx agentica start <directory>
90
+
91
+ ----------------------------------------
92
+ Agentica Setup Wizard
93
+ ----------------------------------------
94
+ ? Package Manager (use arrow keys)
95
+ > npm
96
+ pnpm
97
+ yarn (berry is not supported)
98
+ ? Project Type
99
+ NodeJS Agent Server
100
+ > NestJS Agent Server
101
+ React Client Application
102
+ Standalone Application
103
+ ? Embedded Controllers (multi-selectable)
104
+ (none)
105
+ Google Calendar
106
+ Google News
107
+ > Github
108
+ Reddit
109
+ Slack
110
+ ...
111
+ ```
112
+
113
+ The setup wizard helps you create a new project tailored to your needs.
114
+
115
+ For reference, when selecting a project type, any option other than "Standalone Application" will implement the [WebSocket Protocol](https://wrtnlabs.io/agentica/docs/websocket/) for client-server communication.
116
+
117
+ For comprehensive setup instructions, visit our [Getting Started](https://wrtnlabs.io/agentica/docs/) guide.
118
+
119
+ ## 💻 Playground
120
+
121
+ Experience Agentica firsthand through our [interactive playground](https://wrtnlabs.io/agentica/playground) before installing.
122
+
123
+ Our demonstrations showcase the power and simplicity of Agentica's function calling capabilities across different integration methods.
124
+
125
+ - [TypeScript Class](https://wrtnlabs.io/agentica/playground/bbs)
126
+ - [Swagger/OpenAPI Document](https://wrtnlabs.io/agentica/playground/uploader)
127
+ - [Enterprise E-commerce Agent](https://wrtnlabs.io/agentica/playground/shopping)
128
+
129
+ ![E-commerce Agent Demo](https://github.com/user-attachments/assets/fbfa9f93-304c-4728-933e-deb8ecd7a2af)
130
+
131
+ <!--
132
+ @todo this section would be changed after making tutorial playground
133
+ -->
134
+
135
+ ## 📚 Documentation Resources
136
+
137
+ Find comprehensive resources at our [official website](https://wrtnlabs.io/agentica).
138
+
139
+ - [Home](https://wrtnlabs.io/agentica)
140
+ - [Guide Documents](https://wrtnlabs.io/agentica/docs)
141
+ - [Setup](https://wrtnlabs.io/agentica/docs/setup/cli/)
142
+ - [Concepts](https://wrtnlabs.io/agentica/docs/concepts/function-calling/)
143
+ - [Core Library](https://wrtnlabs.io/agentica/docs/core/)
144
+ - [WebSocket Protocol](https://wrtnlabs.io/agentica/docs/websocket/)
145
+ - [Plugin Modules](https://wrtnlabs.io/agentica/docs/plugins/benchmark/)
146
+ - [Tutorial](https://wrtnlabs.io/agentica/tutorial)
147
+ - [Productivity](https://wrtnlabs.io/agentica/tutorial/productivity/arxiv/)
148
+ - [Coding](https://wrtnlabs.io/agentica/tutorial/coding/file-system/)
149
+ - [React Native](https://wrtnlabs.io/agentica/tutorial/react-native/sms/)
150
+ - [Enterprise](https://wrtnlabs.io/agentica/tutorial/enterprise/shopping/)
151
+ - [API Documents](https://wrtnlabs.io/agentica/api)
152
+ - [Youtube](https://www.youtube.com/@wrtnlabs)
153
+ - [Paper](https://wrtnlabs.io/agentica/paper)
154
+
155
+ https://github.com/user-attachments/assets/2f2a4cdc-6cf1-4304-b82d-04a8ed0be0dd
156
+
157
+ > Tutorial Videos: https://www.youtube.com/@wrtnlabs
158
+
159
+ ## 🌟 Why Agentica?
160
+
161
+ ```mermaid
162
+ flowchart
163
+ subgraph "JSON Schema Specification"
164
+ schemav4("JSON Schema v4 ~ v7") --upgrades--> emended[["OpenAPI v3.1 (emended)"]]
165
+ schema2910("JSON Schema 2019-03") --upgrades--> emended
166
+ schema2020("JSON Schema 2020-12") --emends--> emended
167
+ end
168
+ subgraph "Agentica"
169
+ emended --"Artificial Intelligence"--> fc{{"AI Function Calling"}}
170
+ fc --"OpenAI"--> chatgpt("ChatGPT")
171
+ fc --"Google"--> gemini("Gemini")
172
+ fc --"Anthropic"--> claude("Claude")
173
+ fc --"High-Flyer"--> deepseek("DeepSeek")
174
+ fc --"Meta"--> llama("Llama")
175
+ chatgpt --"3.1"--> custom(["Custom JSON Schema"])
176
+ gemini --"3.0"--> custom(["Custom JSON Schema"])
177
+ claude --"3.1"--> standard(["Standard JSON Schema"])
178
+ deepseek --"3.1"--> standard
179
+ llama --"3.1"--> standard
180
+ end
181
+ ```
182
+
183
+ Agentica enhances AI function calling by the following strategies:
184
+
185
+ - [**Compiler Driven Development**](https://wrtnlabs.io/agentica/docs/concepts/compiler-driven-development): constructs function calling schema automatically by compiler skills without hand-writing.
186
+ - [**JSON Schema Conversion**](https://wrtnlabs.io/agentica/docs/core/vendor/#schema-specification): automatically handles specification differences between LLM vendors, ensuring seamless integration regardless of your chosen AI model.
187
+ - [**Validation Feedback**](https://wrtnlabs.io/agentica/docs/concepts/function-calling#validation-feedback): detects and corrects AI mistakes in argument composition, dramatically reducing errors and improving reliability.
188
+ - [**Selector Agent**](https://wrtnlabs.io/agentica/docs/concepts/function-calling#orchestration-strategy): filtering candidate functions to minimize context usage, optimize performance, and reduce token consumption.
189
+
190
+ Thanks to these innovations, Agentica makes AI function calling easier, safer, and more accurate than before. Development becomes more intuitive since you only need to prepare functions relevant to your specific use case, and scaling your agent's capabilities is as simple as adding or removing functions.
191
+
192
+ In 2023, when OpenAI announced function calling, many predicted that function calling-driven AI development would become the mainstream. However, in reality, due to the difficulty and instability of function calling, the trend in AI development became agent workflow. Agent workflow, which is inflexible and must be created for specific purposes, has conquered the AI agent ecosystem.
193
+
194
+ By the way, as Agentica has resolved the difficulty and instability problems of function calling, the time has come to embrace function-driven AI development once again.
195
+
196
+ | Type | Workflow | Vanilla Function Calling | Agentica Function Calling |
197
+ | ----------- | ------------- | ------------------------ | ------------------------- |
198
+ | Purpose | ❌ Specific | 🟢 General | 🟢 General |
199
+ | Difficulty | ❌ Difficult | ❌ Difficult | 🟢 Easy |
200
+ | Stability | 🟢 Stable | ❌ Unstable | 🟢 Stable |
201
+ | Flexibility | ❌ Inflexible | 🟢 Flexible | 🟢 Flexible |
202
+
203
+ ## 💬 Community & Support
204
+
205
+ For support, questions, or to provide feedback, join our Discord community:
206
+
207
+ [![Discord](https://dcbadge.limes.pink/api/server/https://discord.gg/aMhRmzkqCx)](https://discord.gg/aMhRmzkqCx)
208
+
209
+ ## ⚖️ License
210
+
211
+ Agentica is open-source and available under the [MIT License](https://github.com/wrtnlabs/agentica/blob/master/LICENSE).
212
+
213
+ <p align="center">
214
+ <img src="https://github.com/user-attachments/assets/ecd0b82e-bfb7-4eb5-ae97-75be0cb22f10" alt="Wrtn Labs Logo" />
215
+ </p>
216
+ <div align="center">
217
+ Agentica is maintained by <a href="https://wrtnlabs.io">Wrtn Technologies</a> &mdash; Empowering developers to transform TypeScript functions and OpenAPI specs into powerful AI agents.
218
+ </div>
@@ -8,7 +8,7 @@ exports.AgenticaSystemPrompt = {
8
8
  DESCRIBE: "You are a helpful assistant describing return values of function calls.\n\nAbove messages are the list of function call histories. When describing the return values, please do not too much shortly summarize them. Instead, provide detailed descriptions as much as.\n\nAlso, its content format must be markdown. If required, utilize the mermaid syntax for drawing some diagrams. When image contents are, just put them through the markdown image syntax.\n\nAt last, if user's language locale code is different with your description, please translate it to the user's language.",
9
9
  EXECUTE: "# AI Function Calling System Prompt\n\nYou are a function calling assistant specialized in precise JSON schema compliance.\n\n## Core Rules\n\n### 1. Schema Compliance\n\n- Follow the provided JSON schema exactly\n- Never deviate from specified data types, formats, or constraints\n- Include all required properties—no exceptions\n- Only use properties that exist in the schema\n\n### 2. Required Properties\n\nEvery property marked as required MUST be included. Zero tolerance for omissions.\n\n### 3. Null vs Undefined\n\nUse explicit `null` values, not property omission.\n```json\n// Schema: { \"optionalField\": { \"type\": [\"string\", \"null\"] } }\n// ❌ Wrong: { }\n// ✅ Correct: { \"optionalField\": null }\n```\n\n### 4. Const/Enum Values\n\nUse ONLY the exact values defined in the schema. No synonyms, no approximations.\n```json\n// Schema: { \"status\": { \"enum\": [\"pending\", \"approved\", \"rejected\"] } }\n// ❌ Wrong: \"waiting\", \"PENDING\", \"approve\"\n// ✅ Correct: \"pending\"\n```\n\n### 5. Property Descriptions\n\nRead property descriptions carefully. They contain:\n- Purpose and business context\n- Format requirements and examples\n- Validation constraints\n- Relationship context\n\nConstruct values that reflect accurate understanding of the description.\n\n### 6. Discriminator Handling\n\nFor union types with discriminators, always include the discriminator property with the exact value from the mapping.\n```json\n// ✅ Correct\n{\n \"accountType\": \"user\",\n \"username\": \"john_doe\"\n}\n\n// ❌ Wrong - missing discriminator\n{ \"username\": \"john_doe\" }\n```\n\n### 7. No Property Invention\n\nNever create properties that don't exist in the schema. The schema is the only source of truth.\n```json\n// Schema defines: { \"name\": {...}, \"age\": {...} }\n// ❌ Wrong: { \"name\": \"John\", \"age\": 25, \"email\": \"...\" }\n// ✅ Correct: { \"name\": \"John\", \"age\": 25 }\n```\n\n---\n\n## Validation Feedback\n\nYour function call is validated after each attempt. If the arguments don't satisfy type constraints, you receive an `IValidation.IFailure` containing the errors. You then correct the arguments and retry.\n\nFollow the `expected` field and `description` field from validation errors exactly.\n\nIn some cases, validation may impose constraints stricter than the schema — for example, available options may have narrowed or items may have been exhausted at runtime. When this happens, validation feedback overrides the schema.\n\n---\n\n## Handling Missing Information\n\nWhen information is insufficient:\n\n1. Identify what's missing\n2. Ask concise, clear questions\n3. Explain why the information is needed\n4. Provide examples when helpful\n\nDon't guess parameter values when you lack sufficient information.\n\n---\n\n## Function Execution\n\nWhen you have all required information, execute the function immediately. No permission seeking, no plan explanation, no confirmation requests.\n\n**Exception**: If the function description explicitly requires user confirmation, follow those instructions.\n\n---\n\n## Process\n\n1. **Analyze** - Parse the schema, identify all requirements\n2. **Validate** - Check if conversation provides all required information\n3. **Construct** - Build arguments matching the schema exactly\n4. **Verify** - Confirm all required properties present, all values schema-compliant\n\n---\n\n## Quality Checklist\n\nBefore making the function call:\n\n- [ ] All required properties included\n- [ ] Every property exists in the schema\n- [ ] Explicit `null` used instead of property omission\n- [ ] Discriminator properties included for union types\n- [ ] All const/enum values exact matches\n- [ ] Values reflect property descriptions\n- [ ] Arguments would pass JSON schema validation\n- [ ] If validation feedback was received, corrections follow its `expected` and `description` fields exactly",
10
10
  INITIALIZE: "You are a helpful assistant.\n\nUse the supplied tools to assist the user.",
11
- JSON_PARSE_ERROR: "# JSON Parsing Error - Function Call Arguments Invalid\n\n## 🚨 Critical Error: Invalid JSON Format\n\nThe `arguments` field in your function call contains invalid JSON syntax and cannot be parsed.\n\n### Error Message\n\nHere is the `Error.message` occurred from the `JSON.parse()` function:\n\n```\n${{ERROR_MESSAGE}}\n```\n\n### Issue Location:\n- Function call `arguments` field contains malformed JSON\n- The JSON string failed `JSON.parse()` validation\n- Function execution cannot proceed\n\n### Required Action:\n- Review the error message above and determine whether the JSON is recoverable\n- If the syntax error is minor (e.g. trailing comma, missing quote), fix it and retry\n- If the JSON is severely malformed or structurally broken, **discard the previous output entirely** and reconstruct the `arguments` from scratch based on the function's parameter schema\n- Do not attempt to patch heavily corrupted JSON — rebuilding from zero is faster and more reliable\n\n### Common JSON Syntax Requirements:\n- Use double quotes for all keys and string values\n- Remove trailing commas\n- Use lowercase `true`/`false` for booleans\n- Use lowercase `null` for null values\n- Properly escape special characters in strings\n\n**Retry the function call immediately with valid JSON.**",
11
+ JSON_PARSE_ERROR: "# JSON Parse Failure in Function Call Arguments\n\n## Error Report\n\nThe `arguments` field in your function call contains invalid JSON that could not be fully parsed. Below is the `IJsonParseResult.IFailure` object describing what went wrong.\n\n### Failure Details\n\n- `success`: Always `false` indicates parsing did not fully succeed.\n- `data`: Partially recovered data from the malformed JSON. May be incomplete or `undefined` if nothing could be salvaged.\n- `input`: The original raw JSON string you produced, preserved for reference.\n- `errors`: List of specific issues found during parsing.\n - `path`: Dot-notation path from root (`$input`) to the error location (e.g. `$input.user.email`).\n - `expected`: What the parser expected at that position (e.g. `quoted string`, `\":\"`, `JSON value`).\n - `description`: Human-readable explanation of what was actually found and what went wrong.\n\n```json\n${{FAILURE}}\n```\n\n## Recovery Instructions\n\n- Review each error above and determine whether the JSON is recoverable.\n- If the syntax error is minor (e.g. trailing comma, missing quote), fix it and retry.\n- If the JSON is severely malformed or structurally broken, **discard the previous output entirely** and reconstruct the `arguments` from scratch based on the function's parameter schema.\n- Do not attempt to patch heavily corrupted JSON — rebuilding from zero is faster and more reliable.\n\n## Common JSON Syntax Requirements\n\n- Use double quotes for all keys and string values.\n- Remove trailing commas.\n- Use lowercase `true`/`false` for booleans and `null` for null values.\n- Properly escape special characters in strings.\n\n**Retry the function call immediately with valid JSON.**",
12
12
  SELECT: "You are a helpful assistant for selecting functions to call.\n\nUse the supplied tools to select some functions of `getApiFunctions()` returned.\n\nWhen selecting functions to call, pay attention to the relationship between functions. In particular, check the prerequisites between each function.\n\nIf you can't find any proper function to select, just type your own message. By the way, when typing your own message, please consider the user's language locale code. If your message is different with the user's language, please translate it to the user's.",
13
13
  VALIDATE: "# AI Function Calling Corrector Agent\n\nYou analyze validation failures and generate corrected function arguments. You receive `IValidation.IFailure` with detailed error information and produce corrected arguments that achieve 100% compliance.\n\nErrors are presented with inline `❌` comments at the exact location:\n\n```json\n{\n \"user\": {\n \"email\": \"invalid\" // ❌ [{\"path\":\"$input.user.email\",\"expected\":\"string & Format<'email'>\"}]\n }\n}\n```\n\n---\n\n## 1. Validation Error Structure\n\n```typescript\ninterface IValidation.IError {\n path: string; // Location: \"$input.user.email\"\n expected: string; // Values/types actually valid in current runtime state\n value: unknown; // Your value that failed\n description?: string; // Authoritative instructions — follow exactly when present\n}\n```\n\n| Field | Role | Priority |\n|-------|------|----------|\n| `path` | Exact error location in your input | Use to locate what to fix |\n| `expected` | What is **actually valid right now** — may be stricter than schema | **Overrides schema** |\n| `value` | What you provided (rejected) | Reference only |\n| `description` | Binding instructions: available items, banned types, required actions | **Highest — follow exactly** |\n\n---\n\n## 2. Validation Feedback Overrides Schema\n\nThe JSON schema describes the **general** structure. Validation feedback reflects the **actual runtime state** — a strict subset of what the schema allows. Options get consumed, items get exhausted, domain constraints narrow during orchestration.\n\n```\nValidation feedback > JSON schema — no exceptions\n```\n\n| Situation | Action |\n|-----------|--------|\n| Schema says `string`, but `expected` lists 5 specific values | Use only those 5 values |\n| Schema enum has 8 items, but `expected` shows only 2 | Use only those 2 — the rest are consumed |\n| Schema union includes type `\"X\"`, but feedback says `\"X\"` is banned | NEVER retry `\"X\"` — no parameter variation helps |\n| Feedback says items are already loaded | Stop requesting them — they are in your conversation history |\n\nWhen validation feedback and schema conflict, **always obey validation feedback**.\n\n---\n\n## 3. Correction Strategy\n\n### 3.1 Error Coverage\n\nAddress **every** error in `IValidation.IFailure.errors`. No partial fixes.\n\n### 3.2 Think Beyond Error Boundaries\n\nDon't just fix the exact `path`. Analyze surrounding structure:\n\n1. **Direct fix** — Correct the property at `IError.path`\n2. **Sibling analysis** — Check related properties at the same level\n3. **Parent/child** — Ensure proper nesting and hierarchy\n4. **Cross-schema** — Verify all required properties exist at correct locations\n\n### 3.3 Property Placement Verification\n\nAI systems frequently misplace properties. Detect and correct:\n\n**Elevation error** — Property at parent level instead of nested:\n```json\n// ❌ Wrong\n{ \"user\": { \"name\": \"John\" }, \"email\": \"john@email.com\" }\n\n// ✅ Correct\n{ \"user\": { \"name\": \"John\", \"email\": \"john@email.com\" } }\n```\n\n**Depth error** — Property too deep in structure:\n```json\n// ❌ Wrong\n{ \"order\": { \"items\": [{ \"product\": \"Widget\", \"totalAmount\": 100 }] } }\n\n// ✅ Correct\n{ \"order\": { \"totalAmount\": 100, \"items\": [{ \"product\": \"Widget\" }] } }\n```\n\n**Sibling confusion** — Property in wrong sibling object:\n```json\n// ❌ Wrong\n{ \"billing\": { \"address\": \"123 Main St\", \"phone\": \"555-1234\" }, \"contact\": { \"email\": \"user@email.com\" } }\n\n// ✅ Correct\n{ \"billing\": { \"address\": \"123 Main St\" }, \"contact\": { \"email\": \"user@email.com\", \"phone\": \"555-1234\" } }\n```\n\n---\n\n## 4. Critical Rules\n\n1. **Never add properties that don't exist in the schema.** If you think a property \"should exist for completeness\" — stop and verify.\n\n2. **Every property at its schema-defined location.** If you're grouping by intuition instead of schema — stop and verify.\n\n3. **Use exact enum/const values.** No approximations, no synonyms.\n\n4. **When `description` contains instructions, follow them exactly.** The `description` field carries binding directives about what to do next — it is not optional context.\n\n5. **Never retry a value or type that validation has rejected.** If the type itself is banned or exhausted, no parameter change will make it valid. Choose from the alternatives in `expected`, or follow the `description` field's directive.\n\n---\n\n## 5. Pre-Submission Verification\n\nFor every property you write:\n1. Does this property exist in the schema? → If unsure, verify explicitly.\n2. Is it at the correct hierarchical level? → If unsure, check schema structure.\n3. Does the value comply with `expected` from any prior validation error? → If `expected` is stricter than schema, use `expected`.",
14
14
  VALIDATE_REPEATED: "# Recursive Error Pattern Analysis\n\n## Historical Error Input\n\nYou have been provided with `IValidation.IError[][]` containing **previous historical error arrays** from multiple failed correction attempts. Each inner array contains the complete error list from one **previous** correction attempt.\n\n**CRITICAL**: Compare the current validation errors (shown in the validation failure message above) with this historical data to identify recurring patterns.\n\n${{HISTORICAL_ERRORS}}\n\n## Critical Response Protocol\n\n**When error paths recur across current + historical attempts:**\n\n🚨 **NEVER apply the same correction strategy that failed before**\n\n🚨 **Think fundamentally deeper - analyze root architectural causes:**\n\n- Why was the wrong approach chosen repeatedly?\n- What business context was misunderstood?\n- Which schema requirements were overlooked?\n- How should the entire structure be redesigned from first principles?\n\n**For recurring errors, perform complete reconstruction instead of incremental fixes:**\n\n- Analyze the complete business scenario requirements\n- Examine the full schema interface definition in detail\n- Redesign the entire AST structure using proper architectural patterns\n- Enhance with comprehensive business context and realistic data\n\n**Success means: the error path never appears in future correction cycles.**",
@@ -1 +1 @@
1
- {"version":3,"file":"AgenticaSystemPrompt.js","sourceRoot":"","sources":["../../src/constants/AgenticaSystemPrompt.ts"],"names":[],"mappings":";;;AAAA,gDAAgD;AACnC,QAAA,oBAAoB,GAAG;IAClC,MAAM,EACJ,mQAAmQ;IACrQ,MAAM,EACJ,scAAsc;IACxc,QAAQ,EACN,+jBAA+jB;IACjkB,OAAO,EACL,uzHAAuzH;IACzzH,UAAU,EACR,4EAA4E;IAC9E,gBAAgB,EACd,ywCAAywC;IAC3wC,MAAM,EACJ,+iBAA+iB;IACjjB,QAAQ,EACN,kvJAAkvJ;IACpvJ,iBAAiB,EACf,61CAA61C;CACh2C,CAAC"}
1
+ {"version":3,"file":"AgenticaSystemPrompt.js","sourceRoot":"","sources":["../../src/constants/AgenticaSystemPrompt.ts"],"names":[],"mappings":";;;AAAA,gDAAgD;AACnC,QAAA,oBAAoB,GAAG;IAClC,MAAM,EACJ,mQAAmQ;IACrQ,MAAM,EACJ,scAAsc;IACxc,QAAQ,EACN,+jBAA+jB;IACjkB,OAAO,EACL,uzHAAuzH;IACzzH,UAAU,EACR,4EAA4E;IAC9E,gBAAgB,EACd,4rDAA4rD;IAC9rD,MAAM,EACJ,+iBAA+iB;IACjjB,QAAQ,EACN,kvJAAkvJ;IACpvJ,iBAAiB,EACf,61CAA61C;CACh2C,CAAC"}
@@ -1,4 +1,5 @@
1
- import type { IHttpLlmFunction, ILlmFunction, IMcpLlmFunction } from "@samchon/openapi";
1
+ import type { IHttpLlmFunction } from "@typia/interface";
2
+ import type { ILlmFunction } from "typia";
2
3
  import type { IAgenticaOperationJson } from "../json/IAgenticaOperationJson";
3
4
  import type { IAgenticaController } from "../structures/IAgenticaController";
4
5
  /**
@@ -20,7 +21,7 @@ export type AgenticaOperation = AgenticaOperation.Class | AgenticaOperation.Http
20
21
  export declare namespace AgenticaOperation {
21
22
  export type Class = Base<"class", IAgenticaController.IClass, ILlmFunction>;
22
23
  export type Http = Base<"http", IAgenticaController.IHttp, IHttpLlmFunction>;
23
- export type Mcp = Base<"mcp", IAgenticaController.IMcp, IMcpLlmFunction>;
24
+ export type Mcp = Base<"mcp", IAgenticaController.IMcp, ILlmFunction>;
24
25
  interface Base<Protocol extends "http" | "class" | "mcp", Controller extends object, Function extends object> {
25
26
  /**
26
27
  * Protocol discriminator.
@@ -1 +1 @@
1
- {"version":3,"file":"AgenticaOperationComposer.js","sourceRoot":"","sources":["../../../src/context/internal/AgenticaOperationComposer.ts"],"names":[],"mappings":";;;AAgBA,0BAwCC;AAKD,sCAkBC;AAKD,4CAiBC;AAKD,8CAiBC;AAKD,0CAqBC;AAKD,wBAkBC;AAtKD,uDAAoD;AAEpD;;;;;;;GAOG;AACH,SAAgB,OAAO,CAAC,KAGvB;;IACC,MAAM,MAAM,GAAY,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE;QAC/D,MAAM,KAAK,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,CAEjC,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,WAAW,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,IAAsB,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAC5F,CAAC,IAAI,EAAE,CAAC;QACT,OAAO,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,IAAI,KAAK,KAAK,CAAC,MAAM,CAAC;IAC9C,CAAC,CAAC,EAAE,CAAC,CAAC;IAEN,MAAM,KAAK,GAAwB,aAAa,CAAC;QAC/C,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,MAAM,EAAE,CAAC,IAAY,EAAE,eAAuB,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,eA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AE,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;IAChC,MAAM,SAAS,GAAkC,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC;IACvE,SAAS,CAAC,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC1C,SAAS,CAAC,KAAK,CAAC,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACtD,SAAS,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACxD,SAAS,CAAC,MAAM,CAAC,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACxD,SAAS,CAAC,MAAM,CAAC,SAAS,GAAG,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAChE,SAAS,CAAC,MAAM,CAAC,mBAAmB,GAAG,GAAG,CACxC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,mBAAmB,CACxC,CAAC;IACF,SAAS,CAAC,MAAM,CAAC,mBAAmB,GAAG,GAAG,CACxC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,mBAAmB,CACxC,CAAC;AACJ,CAAC;AAEY,QAAA,4BAA4B,GAAG;IAC1C,SAAS;CACV,CAAC"}
1
+ {"version":3,"file":"AgenticaTokenUsageAggregator.js","sourceRoot":"","sources":["../../../src/context/internal/AgenticaTokenUsageAggregator.ts"],"names":[],"mappings":";;;AAKA,8BAwDC;AAxDD,SAAgB,SAAS,CAAC,KAIzB;;IACC,OAAO;IACP,YAAY;IACZ,OAAO;IACP,MAAM,SAAS,GAAkC,KAAK,C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AC,CAAC;SAC/B,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;IAChC,MAAM,SAAS,GAAkC,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC;IACvE,SAAS,CAAC,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC1C,SAAS,CAAC,KAAK,CAAC,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACtD,SAAS,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACxD,SAAS,CAAC,MAAM,CAAC,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACxD,SAAS,CAAC,MAAM,CAAC,SAAS,GAAG,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAChE,SAAS,CAAC,MAAM,CAAC,mBAAmB,GAAG,GAAG,CACxC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,mBAAmB,CACxC,CAAC;IACF,SAAS,CAAC,MAAM,CAAC,mBAAmB,GAAG,GAAG,CACxC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,mBAAmB,CACxC,CAAC;AACJ,CAAC;AAEY,QAAA,4BAA4B,GAAG;IAC1C,SAAS;CACV,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { IHttpLlmFunction } from "@samchon/openapi";
1
+ import type { IHttpLlmFunction } from "@typia/interface";
2
2
  export interface __IChatInitialApplication {
3
3
  /**
4
4
  * Get list of API functions.
@@ -1,17 +1,14 @@
1
+ import type { IJsonParseResult } from "typia";
1
2
  export declare class AgenticaJsonParseError extends Error {
2
- readonly arguments: string;
3
- readonly reason: string;
4
- constructor(props: AgenticaJsonParseError.IProps);
3
+ readonly failure: IJsonParseResult.IFailure;
4
+ constructor(failure: IJsonParseResult.IFailure);
5
5
  get name(): "AgenticaJsonParseError";
6
6
  toJSON(): AgenticaJsonParseError.IJson;
7
7
  }
8
8
  export declare namespace AgenticaJsonParseError {
9
- interface IProps {
10
- arguments: string;
11
- reason: string;
12
- }
13
- interface IJson extends IProps {
9
+ interface IJson {
14
10
  name: "AgenticaJsonParseError";
11
+ failure: IJsonParseResult.IFailure;
15
12
  message: string;
16
13
  }
17
14
  }