@botonic/plugin-ai-agents 0.46.1 → 2.23.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.
Files changed (182) hide show
  1. package/CHANGELOG.md +209 -0
  2. package/README.md +13 -149
  3. package/package.json +23 -41
  4. package/src/index.d.ts +2 -0
  5. package/src/index.js +3 -0
  6. package/src/index.js.map +1 -0
  7. package/{lib/cjs → src/lib}/agent-builder.d.ts +5 -13
  8. package/{lib/cjs → src/lib}/agent-builder.js +31 -26
  9. package/src/lib/agent-builder.js.map +1 -0
  10. package/{lib/cjs → src/lib}/constants.d.ts +1 -3
  11. package/src/lib/constants.js +13 -0
  12. package/src/lib/constants.js.map +1 -0
  13. package/{lib/esm → src/lib}/debug-logger.d.ts +3 -5
  14. package/{lib/cjs → src/lib}/debug-logger.js +44 -29
  15. package/src/lib/debug-logger.js.map +1 -0
  16. package/src/lib/guardrails/index.js +2 -0
  17. package/src/lib/guardrails/index.js.map +1 -0
  18. package/src/lib/guardrails/input.d.ts +3 -0
  19. package/src/lib/guardrails/input.js +29 -0
  20. package/src/lib/guardrails/input.js.map +1 -0
  21. package/{lib/cjs/services → src/lib}/hubtype-api-client.d.ts +13 -5
  22. package/src/lib/hubtype-api-client.js +206 -0
  23. package/src/lib/hubtype-api-client.js.map +1 -0
  24. package/{lib/esm → src/lib}/index.d.ts +2 -7
  25. package/src/lib/index.js +111 -0
  26. package/src/lib/index.js.map +1 -0
  27. package/src/lib/openai.d.ts +1 -0
  28. package/src/lib/openai.js +21 -0
  29. package/src/lib/openai.js.map +1 -0
  30. package/src/lib/runner.d.ts +12 -0
  31. package/src/lib/runner.js +96 -0
  32. package/src/lib/runner.js.map +1 -0
  33. package/{lib/esm → src/lib}/structured-output/carousel.d.ts +1 -1
  34. package/src/lib/structured-output/carousel.js +19 -0
  35. package/src/lib/structured-output/carousel.js.map +1 -0
  36. package/{lib/cjs → src/lib}/structured-output/exit.d.ts +1 -1
  37. package/src/lib/structured-output/exit.js +7 -0
  38. package/src/lib/structured-output/exit.js.map +1 -0
  39. package/src/lib/structured-output/index.d.ts +228 -0
  40. package/src/lib/structured-output/index.js +11 -0
  41. package/src/lib/structured-output/index.js.map +1 -0
  42. package/{lib/esm/structured-output/bot-executor.d.ts → src/lib/structured-output/text-with-buttons.d.ts} +13 -13
  43. package/src/lib/structured-output/text-with-buttons.js +14 -0
  44. package/src/lib/structured-output/text-with-buttons.js.map +1 -0
  45. package/{lib/esm → src/lib}/structured-output/text.d.ts +1 -1
  46. package/src/lib/structured-output/text.js +10 -0
  47. package/src/lib/structured-output/text.js.map +1 -0
  48. package/{lib/esm → src/lib}/tools/index.d.ts +1 -1
  49. package/src/lib/tools/index.js +3 -0
  50. package/src/lib/tools/index.js.map +1 -0
  51. package/{lib/cjs → src/lib}/tools/retrieve-knowledge.d.ts +2 -2
  52. package/src/lib/tools/retrieve-knowledge.js +30 -0
  53. package/src/lib/tools/retrieve-knowledge.js.map +1 -0
  54. package/{lib/esm → src/lib}/types.d.ts +11 -21
  55. package/src/lib/types.js +2 -0
  56. package/src/lib/types.js.map +1 -0
  57. package/lib/cjs/agent-builder.js.map +0 -1
  58. package/lib/cjs/bot-config-tools.d.ts +0 -7
  59. package/lib/cjs/bot-config-tools.js +0 -19
  60. package/lib/cjs/bot-config-tools.js.map +0 -1
  61. package/lib/cjs/constants.js +0 -17
  62. package/lib/cjs/constants.js.map +0 -1
  63. package/lib/cjs/debug-logger.d.ts +0 -33
  64. package/lib/cjs/debug-logger.js.map +0 -1
  65. package/lib/cjs/guardrails/index.js +0 -5
  66. package/lib/cjs/guardrails/index.js.map +0 -1
  67. package/lib/cjs/guardrails/input.d.ts +0 -10
  68. package/lib/cjs/guardrails/input.js +0 -77
  69. package/lib/cjs/guardrails/input.js.map +0 -1
  70. package/lib/cjs/index.d.ts +0 -18
  71. package/lib/cjs/index.js +0 -134
  72. package/lib/cjs/index.js.map +0 -1
  73. package/lib/cjs/llm-config.d.ts +0 -15
  74. package/lib/cjs/llm-config.js +0 -66
  75. package/lib/cjs/llm-config.js.map +0 -1
  76. package/lib/cjs/runner.d.ts +0 -18
  77. package/lib/cjs/runner.js +0 -181
  78. package/lib/cjs/runner.js.map +0 -1
  79. package/lib/cjs/services/hubtype-api-client.js +0 -206
  80. package/lib/cjs/services/hubtype-api-client.js.map +0 -1
  81. package/lib/cjs/services/types.d.ts +0 -85
  82. package/lib/cjs/services/types.js +0 -13
  83. package/lib/cjs/services/types.js.map +0 -1
  84. package/lib/cjs/structured-output/bot-executor.d.ts +0 -49
  85. package/lib/cjs/structured-output/bot-executor.js +0 -18
  86. package/lib/cjs/structured-output/bot-executor.js.map +0 -1
  87. package/lib/cjs/structured-output/carousel.d.ts +0 -90
  88. package/lib/cjs/structured-output/carousel.js +0 -22
  89. package/lib/cjs/structured-output/carousel.js.map +0 -1
  90. package/lib/cjs/structured-output/exit.js +0 -11
  91. package/lib/cjs/structured-output/exit.js.map +0 -1
  92. package/lib/cjs/structured-output/index.d.ts +0 -603
  93. package/lib/cjs/structured-output/index.js +0 -28
  94. package/lib/cjs/structured-output/index.js.map +0 -1
  95. package/lib/cjs/structured-output/text-with-buttons.d.ts +0 -56
  96. package/lib/cjs/structured-output/text-with-buttons.js +0 -24
  97. package/lib/cjs/structured-output/text-with-buttons.js.map +0 -1
  98. package/lib/cjs/structured-output/text.d.ts +0 -23
  99. package/lib/cjs/structured-output/text.js +0 -13
  100. package/lib/cjs/structured-output/text.js.map +0 -1
  101. package/lib/cjs/tools/index.d.ts +0 -3
  102. package/lib/cjs/tools/index.js +0 -7
  103. package/lib/cjs/tools/index.js.map +0 -1
  104. package/lib/cjs/tools/retrieve-knowledge.js +0 -32
  105. package/lib/cjs/tools/retrieve-knowledge.js.map +0 -1
  106. package/lib/cjs/types.d.ts +0 -56
  107. package/lib/cjs/types.js +0 -3
  108. package/lib/cjs/types.js.map +0 -1
  109. package/lib/esm/agent-builder.d.ts +0 -37
  110. package/lib/esm/agent-builder.js +0 -106
  111. package/lib/esm/agent-builder.js.map +0 -1
  112. package/lib/esm/bot-config-tools.d.ts +0 -7
  113. package/lib/esm/bot-config-tools.js +0 -19
  114. package/lib/esm/bot-config-tools.js.map +0 -1
  115. package/lib/esm/constants.d.ts +0 -11
  116. package/lib/esm/constants.js +0 -17
  117. package/lib/esm/constants.js.map +0 -1
  118. package/lib/esm/debug-logger.js +0 -97
  119. package/lib/esm/debug-logger.js.map +0 -1
  120. package/lib/esm/guardrails/index.d.ts +0 -1
  121. package/lib/esm/guardrails/index.js +0 -5
  122. package/lib/esm/guardrails/index.js.map +0 -1
  123. package/lib/esm/guardrails/input.d.ts +0 -10
  124. package/lib/esm/guardrails/input.js +0 -77
  125. package/lib/esm/guardrails/input.js.map +0 -1
  126. package/lib/esm/index.js +0 -134
  127. package/lib/esm/index.js.map +0 -1
  128. package/lib/esm/llm-config.d.ts +0 -15
  129. package/lib/esm/llm-config.js +0 -66
  130. package/lib/esm/llm-config.js.map +0 -1
  131. package/lib/esm/runner.d.ts +0 -18
  132. package/lib/esm/runner.js +0 -181
  133. package/lib/esm/runner.js.map +0 -1
  134. package/lib/esm/services/hubtype-api-client.d.ts +0 -14
  135. package/lib/esm/services/hubtype-api-client.js +0 -206
  136. package/lib/esm/services/hubtype-api-client.js.map +0 -1
  137. package/lib/esm/services/types.d.ts +0 -85
  138. package/lib/esm/services/types.js +0 -13
  139. package/lib/esm/services/types.js.map +0 -1
  140. package/lib/esm/structured-output/bot-executor.js +0 -18
  141. package/lib/esm/structured-output/bot-executor.js.map +0 -1
  142. package/lib/esm/structured-output/carousel.js +0 -22
  143. package/lib/esm/structured-output/carousel.js.map +0 -1
  144. package/lib/esm/structured-output/exit.d.ts +0 -10
  145. package/lib/esm/structured-output/exit.js +0 -11
  146. package/lib/esm/structured-output/exit.js.map +0 -1
  147. package/lib/esm/structured-output/index.d.ts +0 -603
  148. package/lib/esm/structured-output/index.js +0 -28
  149. package/lib/esm/structured-output/index.js.map +0 -1
  150. package/lib/esm/structured-output/text-with-buttons.d.ts +0 -56
  151. package/lib/esm/structured-output/text-with-buttons.js +0 -24
  152. package/lib/esm/structured-output/text-with-buttons.js.map +0 -1
  153. package/lib/esm/structured-output/text.js +0 -13
  154. package/lib/esm/structured-output/text.js.map +0 -1
  155. package/lib/esm/tools/index.js +0 -7
  156. package/lib/esm/tools/index.js.map +0 -1
  157. package/lib/esm/tools/retrieve-knowledge.d.ts +0 -9
  158. package/lib/esm/tools/retrieve-knowledge.js +0 -32
  159. package/lib/esm/tools/retrieve-knowledge.js.map +0 -1
  160. package/lib/esm/types.js +0 -3
  161. package/lib/esm/types.js.map +0 -1
  162. package/src/agent-builder.ts +0 -183
  163. package/src/bot-config-tools.ts +0 -21
  164. package/src/constants.ts +0 -21
  165. package/src/debug-logger.ts +0 -166
  166. package/src/guardrails/index.ts +0 -1
  167. package/src/guardrails/input.ts +0 -122
  168. package/src/index.ts +0 -210
  169. package/src/llm-config.ts +0 -96
  170. package/src/runner.ts +0 -287
  171. package/src/services/hubtype-api-client.ts +0 -240
  172. package/src/services/types.ts +0 -106
  173. package/src/structured-output/bot-executor.ts +0 -21
  174. package/src/structured-output/carousel.ts +0 -24
  175. package/src/structured-output/exit.ts +0 -12
  176. package/src/structured-output/index.ts +0 -34
  177. package/src/structured-output/text-with-buttons.ts +0 -29
  178. package/src/structured-output/text.ts +0 -13
  179. package/src/tools/index.ts +0 -5
  180. package/src/tools/retrieve-knowledge.ts +0 -37
  181. package/src/types.ts +0 -110
  182. /package/{lib/cjs → src/lib}/guardrails/index.d.ts +0 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,209 @@
1
+ ## 2.23.1 (2026-03-23)
2
+
3
+ This was a version bump only for @botonic/plugin-ai-agents to align it with other projects, there were no code changes.
4
+
5
+ ## 2.22.1 (2026-03-19)
6
+
7
+ ### 🩹 Fixes
8
+
9
+ - try to improve CI speed ([#751](https://github.com/metis-ai/hubtype-product/pull/751))
10
+
11
+ ### ❤️ Thank You
12
+
13
+ - Marc Rabat @vanbasten17
14
+
15
+ ## 2.22.0 (2026-03-16)
16
+
17
+ This was a version bump only for @botonic/plugin-ai-agents to align it with other projects, there were no code changes.
18
+
19
+ ## 2.21.0 (2026-03-16)
20
+
21
+ This was a version bump only for @botonic/plugin-ai-agents to align it with other projects, there were no code changes.
22
+
23
+ ## 2.20.0 (2026-03-13)
24
+
25
+ This was a version bump only for @botonic/plugin-ai-agents to align it with other projects, there were no code changes.
26
+
27
+ ## 2.19.0 (2026-03-12)
28
+
29
+ This was a version bump only for @botonic/plugin-ai-agents to align it with other projects, there were no code changes.
30
+
31
+ ## 2.18.0 (2026-03-04)
32
+
33
+ This was a version bump only for @botonic/plugin-ai-agents to align it with other projects, there were no code changes.
34
+
35
+ ## 2.17.0 (2026-03-02)
36
+
37
+ ### 🚀 Features
38
+
39
+ - botonic working with v2 input format ([#660](https://github.com/metis-ai/hubtype-product/pull/660))
40
+
41
+ ### ❤️ Thank You
42
+
43
+ - Marc Rabat @vanbasten17
44
+
45
+ ## 2.16.0 (2026-02-23)
46
+
47
+ This was a version bump only for @botonic/plugin-ai-agents to align it with other projects, there were no code changes.
48
+
49
+ ## 2.15.0 (2026-02-13)
50
+
51
+ This was a version bump only for @botonic/plugin-ai-agents to align it with other projects, there were no code changes.
52
+
53
+ ## 2.14.0 (2026-02-05)
54
+
55
+ This was a version bump only for @botonic/plugin-ai-agents to align it with other projects, there were no code changes.
56
+
57
+ ## 2.13.4 (2026-02-02)
58
+
59
+ This was a version bump only for @botonic/plugin-ai-agents to align it with other projects, there were no code changes.
60
+
61
+ ## 2.13.3 (2026-01-30)
62
+
63
+ This was a version bump only for @botonic/plugin-ai-agents to align it with other projects, there were no code changes.
64
+
65
+ ## 2.13.2 (2026-01-30)
66
+
67
+ This was a version bump only for @botonic/plugin-ai-agents to align it with other projects, there were no code changes.
68
+
69
+ ## 2.13.1 (2026-01-30)
70
+
71
+ This was a version bump only for @botonic/plugin-ai-agents to align it with other projects, there were no code changes.
72
+
73
+ ## 2.13.0 (2026-01-29)
74
+
75
+ This was a version bump only for @botonic/plugin-ai-agents to align it with other projects, there were no code changes.
76
+
77
+ ## 2.12.0 (2026-01-28)
78
+
79
+ This was a version bump only for @botonic/plugin-ai-agents to align it with other projects, there were no code changes.
80
+
81
+ ## 2.11.5 (2026-01-28)
82
+
83
+ This was a version bump only for @botonic/plugin-ai-agents to align it with other projects, there were no code changes.
84
+
85
+ ## 2.11.4 (2026-01-28)
86
+
87
+ This was a version bump only for @botonic/plugin-ai-agents to align it with other projects, there were no code changes.
88
+
89
+ ## 2.11.3 (2026-01-28)
90
+
91
+ ### 🩹 Fixes
92
+
93
+ - update entrypoints to use .js and .d.ts extensions for module and types ([#552](https://github.com/metis-ai/hubtype-product/pull/552))
94
+
95
+ ### ❤️ Thank You
96
+
97
+ - David Hidalgo @Davidhidalgo
98
+
99
+ ## 2.11.2 (2026-01-21)
100
+
101
+ This was a version bump only for @botonic/plugin-ai-agents to align it with other projects, there were no code changes.
102
+
103
+ ## 2.11.1 (2026-01-21)
104
+
105
+ This was a version bump only for @botonic/plugin-ai-agents to align it with other projects, there were no code changes.
106
+
107
+ ## 2.11.0 (2026-01-21)
108
+
109
+ This was a version bump only for @botonic/plugin-ai-agents to align it with other projects, there were no code changes.
110
+
111
+ ## 2.10.1 (2026-01-19)
112
+
113
+ This was a version bump only for @botonic/plugin-ai-agents to align it with other projects, there were no code changes.
114
+
115
+ ## 2.10.0 (2026-01-18)
116
+
117
+ This was a version bump only for @botonic/plugin-ai-agents to align it with other projects, there were no code changes.
118
+
119
+ ## 2.9.1 (2026-01-17)
120
+
121
+ This was a version bump only for @botonic/plugin-ai-agents to align it with other projects, there were no code changes.
122
+
123
+ ## 2.9.0 (2026-01-17)
124
+
125
+ This was a version bump only for @botonic/plugin-ai-agents to align it with other projects, there were no code changes.
126
+
127
+ ## 2.8.1 (2026-01-16)
128
+
129
+ This was a version bump only for @botonic/plugin-ai-agents to align it with other projects, there were no code changes.
130
+
131
+ ## 2.8.0 (2026-01-16)
132
+
133
+ This was a version bump only for @botonic/plugin-ai-agents to align it with other projects, there were no code changes.
134
+
135
+ ## 2.7.1 (2026-01-16)
136
+
137
+ This was a version bump only for @botonic/plugin-ai-agents to align it with other projects, there were no code changes.
138
+
139
+ ## 2.7.0 (2026-01-15)
140
+
141
+ This was a version bump only for @botonic/plugin-ai-agents to align it with other projects, there were no code changes.
142
+
143
+ ## 2.6.0 (2025-12-09)
144
+
145
+ ### 🚀 Features
146
+
147
+ - plugin-flow-builder enable SmartIntents and add tests ([#469](https://github.com/metis-ai/hubtype-product/pull/469))
148
+
149
+ ### ❤️ Thank You
150
+
151
+ - Oriol Raventós @Iru89
152
+
153
+ ## 2.5.0 (2025-12-09)
154
+
155
+ This was a version bump only for @botonic/plugin-ai-agents to align it with other projects, there were no code changes.
156
+
157
+ ## 2.4.1 (2025-12-08)
158
+
159
+ This was a version bump only for @botonic/plugin-ai-agents to align it with other projects, there were no code changes.
160
+
161
+ ## 2.4.0 (2025-12-05)
162
+
163
+ This was a version bump only for @botonic/plugin-ai-agents to align it with other projects, there were no code changes.
164
+
165
+ ## 2.3.3 (2025-12-04)
166
+
167
+ This was a version bump only for @botonic/plugin-ai-agents to align it with other projects, there were no code changes.
168
+
169
+ ## 2.3.2 (2025-12-04)
170
+
171
+ This was a version bump only for @botonic/plugin-ai-agents to align it with other projects, there were no code changes.
172
+
173
+ ## 2.3.1 (2025-12-04)
174
+
175
+ This was a version bump only for @botonic/plugin-ai-agents to align it with other projects, there were no code changes.
176
+
177
+ ## 2.3.0 (2025-12-04)
178
+
179
+ This was a version bump only for @botonic/plugin-ai-agents to align it with other projects, there were no code changes.
180
+
181
+ ## 2.2.1 (2025-12-04)
182
+
183
+ This was a version bump only for @botonic/plugin-ai-agents to align it with other projects, there were no code changes.
184
+
185
+ ## 2.2.0 (2025-12-04)
186
+
187
+ ### 🚀 Features
188
+
189
+ - add custom tool and bot action ([#452](https://github.com/metis-ai/hubtype-product/pull/452))
190
+ - fine tuning botonic release #BLT-2010 ([#428](https://github.com/metis-ai/hubtype-product/pull/428))
191
+
192
+ ### ❤️ Thank You
193
+
194
+ - David Hidalgo @Davidhidalgo
195
+ - Oriol Raventós @Iru89
196
+
197
+ ## 2.1.0 (2025-12-02)
198
+
199
+ ### 🚀 Features
200
+
201
+ - fine tuning botonic release #BLT-2010 ([#428](https://github.com/metis-ai/hubtype-product/pull/428))
202
+
203
+ ### ❤️ Thank You
204
+
205
+ - David Hidalgo @Davidhidalgo
206
+
207
+ ## 2.0.1-alpha.0 (2025-11-27)
208
+
209
+ This was a version bump only for @botonic/plugin-ai-agents to align it with other projects, there were no code changes.
package/README.md CHANGED
@@ -1,156 +1,20 @@
1
- # Botonic Plugin AI Agents
1
+ # @botonic/plugin-ai-agents
2
2
 
3
- ## env variables
3
+ Botonic plugin for **AI agents** (e.g. OpenAI Agents–style flows) on the **current** framework line.
4
4
 
5
- - It is necessary to add the following variables to an `.env` file:
6
- - `AZURE_OPENAI_API_KEY`
7
- - `AZURE_OPENAI_API_BASE`
8
- - `AZURE_OPENAI_API_DEPLOYMENT_NAME`
9
- - `AZURE_OPENAI_API_VERSION`
10
- - Add these env variables to build using rspack, for target NODE and DEV.
5
+ ## Source and versions
11
6
 
12
- ```ts
13
- ...
14
- import { config } from 'dotenv'
15
- config()
16
- ...
17
- const plugins = [
18
- new rspack.EnvironmentPlugin({
19
- NODE_ENV: process.env.NODE_ENV,
20
- HUBTYPE_API_URL: process.env.HUBTYPE_API_URL || HUBTYPE_DEFAULTS.API_URL,
21
- BOTONIC_TARGET: BotonicTarget.NODE,
22
- WEBCHAT_PUSHER_KEY:
23
- process.env.WEBCHAT_PUSHER_KEY || HUBTYPE_DEFAULTS.WEBCHAT_PUSHER_KEY,
24
- ENVIRONMENT: process.env.ENVIRONMENT,
25
- AZURE_OPENAI_API_KEY: isNodeOrDev
26
- ? process.env.AZURE_OPENAI_API_KEY
27
- : undefined,
28
- AZURE_OPENAI_API_DEPLOYMENT_NAME: isNodeOrDev
29
- ? process.env.AZURE_OPENAI_API_DEPLOYMENT_NAME
30
- : undefined,
31
- AZURE_OPENAI_API_VERSION: isNodeOrDev
32
- ? process.env.AZURE_OPENAI_API_VERSION
33
- : undefined,
34
- AZURE_OPENAI_API_BASE: isNodeOrDev
35
- ? process.env.AZURE_OPENAI_API_BASE
36
- : undefined,
37
- }),
38
- new rspack.ProgressPlugin(),
39
- ]
40
- ```
41
-
42
- ## Custom Tools
43
-
44
- - It is possible to add tools from the bot code. To do this:
45
- - Add the `zod` dependency.
46
- - Create and export the definition of the tools in a file, for example: `src/server/tools.ts`.
47
-
48
- ```ts
49
- import { CustomTool } from '@botonic/plugin-ai-agents'
50
- import axios from 'axios'
51
- import z from 'zod'
52
-
53
- export const customTools: CustomTool[] = [
54
- {
55
- name: 'get_current_weather',
56
- description: 'Get current weather for a city',
57
- schema: z.object({
58
- cityName: z.string(),
59
- }),
60
- func: async (input: { cityName: string }) => {
61
- const baseURL = 'http://api.weatherapi.com/v1'
62
- const response = await axios.get(`${baseURL}/forecast.json`, {
63
- params: {
64
- key: 'WEATHER_API_TOKEN',
65
- q: input.cityName,
66
- },
67
- })
68
- const data = response.data
69
- console.log('get_current_weather', { data })
70
- return data
71
- },
72
- },
73
- ...
74
- ]
75
- ```
76
-
77
- - Add these tools to:
78
- - Update the `BotonicPluginFlowBuilderOptions`, as we did with the knowledge base, and add the `customTools`.
79
-
80
- src/server/config.ts
81
-
82
- ```ts
83
- import { PluginAiAgentOptions } from '@botonic/plugin-ai-agents'
84
- import { customTools } from './tools'
85
-
86
- ...
87
- function getFlowBuilderConfig(
88
- env: ENVIRONMENT
89
- ): BotonicPluginFlowBuilderOptions<BotPlugins, UserData> {
90
- return {
91
- ...
92
- getAiAgentResponse: async (
93
- request: BotRequest,
94
- aiAgentArgs: {
95
- name: string
96
- instructions: string
97
- }
98
- ) => {
99
- const aiAgentPlugin = request.plugins.aiAgents
100
- return await aiAgentPlugin.getInference(request, aiAgentArgs)
101
- },
102
- ...
103
- }
104
-
105
- function getAiAgentsConfig(): PluginAiAgentOptions {
106
- return {
107
- authToken: 'AUTH_TOKEN', // Used locally
108
- customTools: customTools,
109
- }
110
- }
111
- ...
112
-
113
- interface Config {
114
- // Use any for infer type for TPlugins and TExtraData
115
- // to avoid type errors with circular dependencies
116
- flowBuilder: BotonicPluginFlowBuilderOptions<any, any>
117
- aiAgents: PluginAiAgentOptions
118
- knowledgeBases: PluginKnowledgeBaseOptions
119
- }
120
-
121
- export const CONFIG: Record<ENVIRONMENT, Config> = {
122
- [ENVIRONMENT.LOCAL]: {
123
- flowBuilder: getFlowBuilderConfig(ENVIRONMENT.LOCAL),
124
- aiAgents: getAiAgentsConfig(),
125
- knowledgeBases: getKnowledgeBasesConfig(),
126
- },
127
- ...
128
- }
129
- ```
130
-
131
- ## Share customTools with flow builder frontend
132
-
133
- - Create new `src/bot-config.ts` file and add customTools. This file is used so that every time a bot is deployed, the Flow Builder frontend can know which tools are in the deployed bot and enable or disable tools for each AI Agent node.
134
-
135
- src/bot-config.ts
136
-
137
- ```ts
138
- import { BotConfigJSON } from '@botonic/core'
7
+ | Line | npm | Source |
8
+ | ----------- | ----- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
9
+ | **Legacy** | `0.x` | [github.com/hubtype/botonic](https://github.com/hubtype/botonic) |
10
+ | **Current** | `2.x` | [github.com/hubtype/hubtype-product](https://github.com/hubtype/hubtype-product) · [`libs/botonic/plugin-ai-agents`](https://github.com/hubtype/hubtype-product/tree/main/libs/botonic/plugin-ai-agents) |
139
11
 
140
- import { customTools } from './server/tools'
12
+ Keep `@botonic/*` packages on the **same major version**. Setup and configuration are documented in the Botonic docs app from hubtype-product (`nx serve botonic-docs`).
141
13
 
142
- const aiAgentTools =
143
- customTools?.map(customTool => ({
144
- name: customTool.name,
145
- description: customTool.description,
146
- })) || []
14
+ ## Installation
147
15
 
148
- /**
149
- * This is the configuration is shared with flow-builder-frontend.
150
- */
151
- export const botConfig: BotConfigJSON = {
152
- tools: aiAgentTools,
153
- payloads: [],
154
- webviews: [],
155
- }
16
+ ```bash
17
+ pnpm add @botonic/plugin-ai-agents
18
+ # or
19
+ npm install @botonic/plugin-ai-agents
156
20
  ```
package/package.json CHANGED
@@ -1,50 +1,32 @@
1
1
  {
2
2
  "name": "@botonic/plugin-ai-agents",
3
- "version": "0.46.1",
4
- "main": "./lib/cjs/index.js",
5
- "module": "./lib/esm/index.js",
6
- "description": "Use AI Agents to generate your contents",
7
- "scripts": {
8
- "build": "rm -rf lib && ../../node_modules/.bin/tsc -p tsconfig.json && ../../node_modules/.bin/tsc -p tsconfig.esm.json",
9
- "build:watch": "npm run build -- --watch",
10
- "test": "../../node_modules/.bin/jest --coverage",
11
- "prepublishOnly": "rm -rf lib && npm i && npm run build",
12
- "lint": "biome check --write src/ tests/",
13
- "lint:check": "biome check src/ tests/",
14
- "format": "biome format --write src/ tests/"
3
+ "version": "2.23.1",
4
+ "type": "module",
5
+ "types": "./src/index.d.ts",
6
+ "module": "./src/index.js",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./src/index.d.ts",
10
+ "import": "./src/index.js"
11
+ }
15
12
  },
16
13
  "dependencies": {
17
- "@botonic/core": "^0.46.1",
14
+ "@botonic/shared": "2.23.1",
18
15
  "@openai/agents": "^0.3.9",
19
- "axios": "^1.13.6",
20
16
  "openai": "^6.0.0",
21
- "uuid": "^10.0.0",
22
- "zod": "3.25.76",
23
- "zod-to-json-schema": "^3.25.1"
17
+ "tslib": "^2.3.0",
18
+ "zod": "^3.25.76"
24
19
  },
25
- "devDependencies": {
26
- "@types/uuid": "^10.0.0"
27
- },
28
- "files": [
29
- "lib/**",
30
- "src/**",
31
- "README.md"
20
+ "references": [
21
+ {
22
+ "path": "../core/tsconfig.lib.json"
23
+ },
24
+ {
25
+ "path": "../shared/tsconfig.lib.json"
26
+ }
32
27
  ],
33
- "engines": {
34
- "node": ">=22.19.0",
35
- "npm": ">=10.0.0"
36
- },
37
- "repository": {
38
- "type": "git",
39
- "url": "git+https://github.com/hubtype/botonic.git"
28
+ "publishConfig": {
29
+ "access": "public"
40
30
  },
41
- "keywords": [
42
- "bot-framework",
43
- "chatbot",
44
- "ai-agents",
45
- "conversational-app",
46
- "typescript",
47
- "javascript"
48
- ],
49
- "author": ""
50
- }
31
+ "main": "./src/index.js"
32
+ }
package/src/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export { BotonicPluginAiAgents } from './lib';
2
+ export * from './lib/types';
package/src/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export { BotonicPluginAiAgents } from './lib';
2
+ export * from './lib/types';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/botonic/plugin-ai-agents/src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,OAAO,CAAA;AAC7C,cAAc,aAAa,CAAA"}
@@ -1,10 +1,7 @@
1
- import type { CampaignV2, ContactInfo, ResolvedPlugins } from '@botonic/core';
2
- import type { z } from 'zod';
3
- import type { DebugLogger } from './debug-logger';
4
- import type { GuardrailTrackingContext } from './guardrails/input';
5
- import type { LLMConfig } from './llm-config';
6
- import type { AIAgent, GuardrailRule, Tool } from './types';
7
- interface AIAgentBuilderOptions<TPlugins extends ResolvedPlugins = ResolvedPlugins, TExtraData = any> {
1
+ import type { CampaignV2, ContactInfo, ResolvedPlugins, UserExtraData } from '@botonic/shared';
2
+ import { DebugLogger } from './debug-logger';
3
+ import { AIAgent, GuardrailRule, Tool } from './types';
4
+ interface AIAgentBuilderOptions<TPlugins extends ResolvedPlugins = ResolvedPlugins, TExtraData extends UserExtraData = UserExtraData> {
8
5
  name: string;
9
6
  instructions: string;
10
7
  tools: Tool<TPlugins, TExtraData>[];
@@ -12,18 +9,13 @@ interface AIAgentBuilderOptions<TPlugins extends ResolvedPlugins = ResolvedPlugi
12
9
  contactInfo: ContactInfo[];
13
10
  inputGuardrailRules: GuardrailRule[];
14
11
  sourceIds: string[];
15
- outputMessagesSchemas?: z.ZodObject<any>[];
16
- llmConfig: LLMConfig;
17
12
  logger: DebugLogger;
18
- guardrailTrackingContext: GuardrailTrackingContext;
19
13
  }
20
- export declare class AIAgentBuilder<TPlugins extends ResolvedPlugins = ResolvedPlugins, TExtraData = any> {
14
+ export declare class AIAgentBuilder<TPlugins extends ResolvedPlugins = ResolvedPlugins, TExtraData extends UserExtraData = UserExtraData> {
21
15
  private name;
22
16
  private instructions;
23
17
  private tools;
24
- private externalOutputMessagesSchemas;
25
18
  private inputGuardrails;
26
- llmConfig: LLMConfig;
27
19
  private logger;
28
20
  constructor(options: AIAgentBuilderOptions<TPlugins, TExtraData>);
29
21
  build(): AIAgent<TPlugins, TExtraData>;
@@ -1,46 +1,50 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AIAgentBuilder = void 0;
4
- const agents_1 = require("@openai/agents");
5
- const constants_1 = require("./constants");
6
- const guardrails_1 = require("./guardrails");
7
- const structured_output_1 = require("./structured-output");
8
- const tools_1 = require("./tools");
9
- class AIAgentBuilder {
1
+ import { Agent, } from '@openai/agents';
2
+ import { OPENAI_MODEL, OPENAI_PROVIDER } from './constants';
3
+ import { createInputGuardrail } from './guardrails';
4
+ import { OutputSchema } from './structured-output';
5
+ import { mandatoryTools, retrieveKnowledge } from './tools';
6
+ export class AIAgentBuilder {
10
7
  constructor(options) {
11
8
  this.name = options.name;
12
9
  this.instructions = this.addExtraInstructions(options.instructions, options.contactInfo, options.campaignsContext);
13
10
  this.tools = this.addHubtypeTools(options.tools, options.sourceIds);
14
- this.externalOutputMessagesSchemas = options.outputMessagesSchemas || [];
15
11
  this.inputGuardrails = [];
16
- this.llmConfig = options.llmConfig;
17
12
  this.logger = options.logger;
18
13
  if (options.inputGuardrailRules.length > 0) {
19
- const inputGuardrail = (0, guardrails_1.createInputGuardrail)(options.inputGuardrailRules, options.llmConfig, options.guardrailTrackingContext);
14
+ const inputGuardrail = createInputGuardrail(options.inputGuardrailRules);
20
15
  this.inputGuardrails.push(inputGuardrail);
21
16
  }
22
17
  }
23
18
  build() {
19
+ const modelSettings = {};
20
+ if (OPENAI_PROVIDER === 'openai') {
21
+ modelSettings.reasoning = { effort: 'none' }; // Specific to OpenAI API
22
+ modelSettings.text = { verbosity: 'medium' };
23
+ }
24
+ const hasRetrieveKnowledge = this.tools.some(t => t.name === retrieveKnowledge.name);
25
+ if (hasRetrieveKnowledge && OPENAI_PROVIDER === 'azure') {
26
+ modelSettings.toolChoice = retrieveKnowledge.name;
27
+ }
24
28
  // When using standard OpenAI API, we need to specify the model
25
29
  // Azure OpenAI uses deployment name instead
26
- const model = this.llmConfig.modelName;
27
- const hasRetrieveKnowledge = this.tools.includes(tools_1.retrieveKnowledge);
30
+ const model = OPENAI_PROVIDER === 'openai' ? OPENAI_MODEL : undefined;
28
31
  this.logger.logModelSettings({
29
- provider: constants_1.OPENAI_PROVIDER,
32
+ provider: OPENAI_PROVIDER,
30
33
  model,
31
- reasoning: this.llmConfig.modelSettings.reasoning,
32
- text: this.llmConfig.modelSettings.text,
33
- toolChoice: this.llmConfig.modelSettings.toolChoice,
34
+ reasoning: modelSettings.reasoning,
35
+ text: modelSettings.text,
36
+ toolChoice: modelSettings.toolChoice,
34
37
  hasRetrieveKnowledge,
35
38
  });
36
- return new agents_1.Agent({
39
+ return new Agent({
37
40
  name: this.name,
38
41
  model,
39
42
  instructions: this.instructions,
40
43
  tools: this.tools,
41
- outputType: (0, structured_output_1.getOutputSchema)(this.externalOutputMessagesSchemas),
44
+ outputType: OutputSchema,
42
45
  inputGuardrails: this.inputGuardrails,
43
46
  outputGuardrails: [],
47
+ modelSettings,
44
48
  });
45
49
  }
46
50
  addExtraInstructions(initialInstructions, contactInfo, campaignsContext) {
@@ -95,12 +99,13 @@ class AIAgentBuilder {
95
99
  return `<output>\n${output}\n</output>`;
96
100
  }
97
101
  addHubtypeTools(tools, sourceIds) {
98
- const hubtypeTools = [...tools_1.mandatoryTools];
99
- if (sourceIds.length > 0) {
100
- hubtypeTools.push(tools_1.retrieveKnowledge);
101
- }
102
- return [...hubtypeTools, ...tools];
102
+ // Cast needed: mandatoryTools/retrieveKnowledge are Tool<ResolvedPlugins, ExtraData> at runtime but compatible with Tool<TPlugins, TExtraData>
103
+ const hubtypeTools = [
104
+ ...mandatoryTools,
105
+ ...(sourceIds.length > 0 ? [retrieveKnowledge] : []),
106
+ ...tools,
107
+ ];
108
+ return hubtypeTools;
103
109
  }
104
110
  }
105
- exports.AIAgentBuilder = AIAgentBuilder;
106
111
  //# sourceMappingURL=agent-builder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-builder.js","sourceRoot":"","sources":["../../../../../../libs/botonic/plugin-ai-agents/src/lib/agent-builder.ts"],"names":[],"mappings":"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"}
@@ -4,8 +4,6 @@ export declare const OPENAI_MODEL: string;
4
4
  export declare const OPENAI_PROVIDER: 'openai' | 'azure';
5
5
  export declare const AZURE_OPENAI_API_KEY: string | undefined;
6
6
  export declare const AZURE_OPENAI_API_BASE: string | undefined;
7
+ export declare const AZURE_OPENAI_API_DEPLOYMENT_NAME: string;
7
8
  export declare const AZURE_OPENAI_API_VERSION: string;
8
- export declare const isProd: boolean;
9
9
  export declare const MAX_MEMORY_LENGTH = 25;
10
- export declare const DEFAULT_TIMEOUT_16_SECONDS = 16000;
11
- export declare const DEFAULT_MAX_RETRIES = 2;
@@ -0,0 +1,13 @@
1
+ var _a, _b, _c, _d, _e, _f, _g, _h;
2
+ export const HUBTYPE_API_URL = ((_a = import.meta.env) === null || _a === void 0 ? void 0 : _a['VITE_HUBTYPE_API_URL']) || 'https://api.hubtype.com';
3
+ // OpenAI Provider Configuration
4
+ export const OPENAI_API_KEY = (_b = import.meta.env) === null || _b === void 0 ? void 0 : _b['VITE_OPENAI_API_KEY']; // pragma: allowlist secret
5
+ export const OPENAI_MODEL = ((_c = import.meta.env) === null || _c === void 0 ? void 0 : _c['VITE_OPENAI_MODEL']) || 'gpt-4.1-mini';
6
+ export const OPENAI_PROVIDER = ((_d = import.meta.env) === null || _d === void 0 ? void 0 : _d['VITE_OPENAI_PROVIDER']) || 'azure';
7
+ // Azure OpenAI Configuration
8
+ export const AZURE_OPENAI_API_KEY = (_e = import.meta.env) === null || _e === void 0 ? void 0 : _e['VITE_AZURE_OPENAI_API_KEY']; // pragma: allowlist secret
9
+ export const AZURE_OPENAI_API_BASE = (_f = import.meta.env) === null || _f === void 0 ? void 0 : _f['VITE_AZURE_OPENAI_API_BASE'];
10
+ export const AZURE_OPENAI_API_DEPLOYMENT_NAME = ((_g = import.meta.env) === null || _g === void 0 ? void 0 : _g['VITE_AZURE_OPENAI_API_DEPLOYMENT_NAME']) || 'gpt-41-mini_p1';
11
+ export const AZURE_OPENAI_API_VERSION = ((_h = import.meta.env) === null || _h === void 0 ? void 0 : _h['VITE_AZURE_OPENAI_API_VERSION']) || '2025-01-01-preview';
12
+ export const MAX_MEMORY_LENGTH = 25;
13
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../libs/botonic/plugin-ai-agents/src/lib/constants.ts"],"names":[],"mappings":";AAAA,MAAM,CAAC,MAAM,eAAe,GAC1B,CAAA,MAAA,MAAM,CAAC,IAAI,CAAC,GAAG,0CAAG,sBAAsB,CAAC,KAAI,yBAAyB,CAAA;AAExE,gCAAgC;AAChC,MAAM,CAAC,MAAM,cAAc,GAAG,MAAA,MAAM,CAAC,IAAI,CAAC,GAAG,0CAAG,qBAAqB,CAAC,CAAA,CAAC,2BAA2B;AAClG,MAAM,CAAC,MAAM,YAAY,GACvB,CAAA,MAAA,MAAM,CAAC,IAAI,CAAC,GAAG,0CAAG,mBAAmB,CAAC,KAAI,cAAc,CAAA;AAC1D,MAAM,CAAC,MAAM,eAAe,GAC1B,CAAC,MAAA,MAAM,CAAC,IAAI,CAAC,GAAG,0CAAG,sBAAsB,CAAwB,KAAI,OAAO,CAAA;AAE9E,6BAA6B;AAC7B,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAA,MAAM,CAAC,IAAI,CAAC,GAAG,0CACjD,2BAA2B,CAC5B,CAAA,CAAC,2BAA2B;AAC7B,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAA,MAAM,CAAC,IAAI,CAAC,GAAG,0CAClD,4BAA4B,CAC7B,CAAA;AACD,MAAM,CAAC,MAAM,gCAAgC,GAC3C,CAAA,MAAA,MAAM,CAAC,IAAI,CAAC,GAAG,0CAAG,uCAAuC,CAAC,KAAI,gBAAgB,CAAA;AAChF,MAAM,CAAC,MAAM,wBAAwB,GACnC,CAAA,MAAA,MAAM,CAAC,IAAI,CAAC,GAAG,0CAAG,+BAA+B,CAAC,KAAI,oBAAoB,CAAA;AAE5E,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,CAAA"}
@@ -1,6 +1,5 @@
1
- import type { AiAgentArgs, ToolExecution } from '@botonic/core';
2
- import type { ModelSettings } from '@openai/agents';
3
- import type { AgenticInputMessage, MemoryOptions, RunResult } from './types';
1
+ import { AiAgentArgs } from '@botonic/shared';
2
+ import { AgenticInputMessage, MemoryOptions, RunResult } from './types';
4
3
  export interface DebugLoggerConfig {
5
4
  messageHistoryApiVersion: string;
6
5
  maxRetries: number;
@@ -24,10 +23,9 @@ export interface DebugLogger {
24
23
  logInitialConfig(config: DebugLoggerConfig): void;
25
24
  logAgentDebugInfo(aiAgentArgs: AiAgentArgs, toolNames: string[], messages: AgenticInputMessage[]): void;
26
25
  logModelSettings(settings: ModelSettingsInfo): void;
27
- logRunnerStart(model: string, modelSettings: ModelSettings): void;
26
+ logRunnerStart(): void;
28
27
  logRunResult(runResult: RunResult, startTime: number): void;
29
28
  logGuardrailTriggered(): void;
30
29
  logRunnerError(startTime: number, error: unknown): void;
31
- logToolExecution(toolExecution: ToolExecution): void;
32
30
  }
33
31
  export declare function createDebugLogger(enableDebug: boolean): DebugLogger;