@botonic/plugin-ai-agents 0.45.0-alpha.0 → 0.45.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,49 @@
1
+ import type { BotExecutorMessage } from '@botonic/core';
2
+ import z from 'zod';
3
+ export type { BotExecutorMessage };
4
+ export declare const BotExecutorSchema: z.ZodObject<{
5
+ type: z.ZodEnum<["botExecutor"]>;
6
+ content: z.ZodObject<{
7
+ text: z.ZodString;
8
+ buttons: z.ZodArray<z.ZodObject<{
9
+ text: z.ZodString;
10
+ payload: z.ZodString;
11
+ }, "strip", z.ZodTypeAny, {
12
+ text: string;
13
+ payload: string;
14
+ }, {
15
+ text: string;
16
+ payload: string;
17
+ }>, "many">;
18
+ }, "strip", z.ZodTypeAny, {
19
+ text: string;
20
+ buttons: {
21
+ text: string;
22
+ payload: string;
23
+ }[];
24
+ }, {
25
+ text: string;
26
+ buttons: {
27
+ text: string;
28
+ payload: string;
29
+ }[];
30
+ }>;
31
+ }, "strip", z.ZodTypeAny, {
32
+ type: "botExecutor";
33
+ content: {
34
+ text: string;
35
+ buttons: {
36
+ text: string;
37
+ payload: string;
38
+ }[];
39
+ };
40
+ }, {
41
+ type: "botExecutor";
42
+ content: {
43
+ text: string;
44
+ buttons: {
45
+ text: string;
46
+ payload: string;
47
+ }[];
48
+ };
49
+ }>;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BotExecutorSchema = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const zod_1 = tslib_1.__importDefault(require("zod"));
6
+ exports.BotExecutorSchema = zod_1.default
7
+ .object({
8
+ type: zod_1.default.enum(['botExecutor']),
9
+ content: zod_1.default.object({
10
+ text: zod_1.default.string(),
11
+ buttons: zod_1.default.array(zod_1.default.object({
12
+ text: zod_1.default.string(),
13
+ payload: zod_1.default.string(),
14
+ })),
15
+ }),
16
+ })
17
+ .describe('A text message with buttons to allow the bot to execute a specific action. Use it only when asked explicitly in the prompt');
18
+ //# sourceMappingURL=bot-executor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bot-executor.js","sourceRoot":"","sources":["../../../src/structured-output/bot-executor.ts"],"names":[],"mappings":";;;;AACA,sDAAmB;AAIN,QAAA,iBAAiB,GAAG,aAAC;KAC/B,MAAM,CAAC;IACN,IAAI,EAAE,aAAC,CAAC,IAAI,CAAC,CAAC,aAAa,CAAC,CAAC;IAC7B,OAAO,EAAE,aAAC,CAAC,MAAM,CAAC;QAChB,IAAI,EAAE,aAAC,CAAC,MAAM,EAAE;QAChB,OAAO,EAAE,aAAC,CAAC,KAAK,CACd,aAAC,CAAC,MAAM,CAAC;YACP,IAAI,EAAE,aAAC,CAAC,MAAM,EAAE;YAChB,OAAO,EAAE,aAAC,CAAC,MAAM,EAAE;SACpB,CAAC,CACH;KACF,CAAC;CACH,CAAC;KACD,QAAQ,CACP,4HAA4H,CAC7H,CAAA"}
@@ -160,9 +160,63 @@ export declare const OutputSchema: z.ZodObject<{
160
160
  type: "exit";
161
161
  }, {
162
162
  type: "exit";
163
+ }>, z.ZodObject<{
164
+ type: z.ZodEnum<["botExecutor"]>;
165
+ content: z.ZodObject<{
166
+ text: z.ZodString;
167
+ buttons: z.ZodArray<z.ZodObject<{
168
+ text: z.ZodString;
169
+ payload: z.ZodString;
170
+ }, "strip", z.ZodTypeAny, {
171
+ text: string;
172
+ payload: string;
173
+ }, {
174
+ text: string;
175
+ payload: string;
176
+ }>, "many">;
177
+ }, "strip", z.ZodTypeAny, {
178
+ text: string;
179
+ buttons: {
180
+ text: string;
181
+ payload: string;
182
+ }[];
183
+ }, {
184
+ text: string;
185
+ buttons: {
186
+ text: string;
187
+ payload: string;
188
+ }[];
189
+ }>;
190
+ }, "strip", z.ZodTypeAny, {
191
+ type: "botExecutor";
192
+ content: {
193
+ text: string;
194
+ buttons: {
195
+ text: string;
196
+ payload: string;
197
+ }[];
198
+ };
199
+ }, {
200
+ type: "botExecutor";
201
+ content: {
202
+ text: string;
203
+ buttons: {
204
+ text: string;
205
+ payload: string;
206
+ }[];
207
+ };
163
208
  }>]>, "many">;
164
209
  }, "strip", z.ZodTypeAny, {
165
210
  messages: ({
211
+ type: "botExecutor";
212
+ content: {
213
+ text: string;
214
+ buttons: {
215
+ text: string;
216
+ payload: string;
217
+ }[];
218
+ };
219
+ } | {
166
220
  type: "carousel";
167
221
  content: {
168
222
  elements: {
@@ -195,6 +249,15 @@ export declare const OutputSchema: z.ZodObject<{
195
249
  })[];
196
250
  }, {
197
251
  messages: ({
252
+ type: "botExecutor";
253
+ content: {
254
+ text: string;
255
+ buttons: {
256
+ text: string;
257
+ payload: string;
258
+ }[];
259
+ };
260
+ } | {
198
261
  type: "carousel";
199
262
  content: {
200
263
  elements: {
@@ -2,13 +2,20 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.OutputSchema = void 0;
4
4
  const zod_1 = require("zod");
5
+ const bot_executor_1 = require("./bot-executor");
5
6
  const carousel_1 = require("./carousel");
6
7
  const exit_1 = require("./exit");
7
8
  const text_1 = require("./text");
8
9
  const text_with_buttons_1 = require("./text-with-buttons");
9
10
  exports.OutputSchema = zod_1.z
10
11
  .object({
11
- messages: zod_1.z.array(zod_1.z.union([text_1.TextSchema, text_with_buttons_1.TextWithButtonsSchema, carousel_1.CarouselSchema, exit_1.ExitSchema])),
12
+ messages: zod_1.z.array(zod_1.z.union([
13
+ text_1.TextSchema,
14
+ text_with_buttons_1.TextWithButtonsSchema,
15
+ carousel_1.CarouselSchema,
16
+ exit_1.ExitSchema,
17
+ bot_executor_1.BotExecutorSchema,
18
+ ])),
12
19
  })
13
20
  .describe('The messages to be sent to the user');
14
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/structured-output/index.ts"],"names":[],"mappings":";;;AACA,6BAAuB;AAEvB,yCAA2C;AAC3C,iCAAmC;AACnC,iCAAmC;AACnC,2DAA2D;AAM9C,QAAA,YAAY,GAAG,OAAC;KAC1B,MAAM,CAAC;IACN,QAAQ,EAAE,OAAC,CAAC,KAAK,CACf,OAAC,CAAC,KAAK,CAAC,CAAC,iBAAU,EAAE,yCAAqB,EAAE,yBAAc,EAAE,iBAAU,CAAC,CAAC,CACzE;CACF,CAAC;KACD,QAAQ,CAAC,qCAAqC,CAAC,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/structured-output/index.ts"],"names":[],"mappings":";;;AACA,6BAAuB;AACvB,iDAAkD;AAClD,yCAA2C;AAC3C,iCAAmC;AACnC,iCAAmC;AACnC,2DAA2D;AAM9C,QAAA,YAAY,GAAG,OAAC;KAC1B,MAAM,CAAC;IACN,QAAQ,EAAE,OAAC,CAAC,KAAK,CACf,OAAC,CAAC,KAAK,CAAC;QACN,iBAAU;QACV,yCAAqB;QACrB,yBAAc;QACd,iBAAU;QACV,gCAAiB;KAClB,CAAC,CACH;CACF,CAAC;KACD,QAAQ,CAAC,qCAAqC,CAAC,CAAA"}
@@ -0,0 +1,49 @@
1
+ import type { BotExecutorMessage } from '@botonic/core';
2
+ import z from 'zod';
3
+ export type { BotExecutorMessage };
4
+ export declare const BotExecutorSchema: z.ZodObject<{
5
+ type: z.ZodEnum<["botExecutor"]>;
6
+ content: z.ZodObject<{
7
+ text: z.ZodString;
8
+ buttons: z.ZodArray<z.ZodObject<{
9
+ text: z.ZodString;
10
+ payload: z.ZodString;
11
+ }, "strip", z.ZodTypeAny, {
12
+ text: string;
13
+ payload: string;
14
+ }, {
15
+ text: string;
16
+ payload: string;
17
+ }>, "many">;
18
+ }, "strip", z.ZodTypeAny, {
19
+ text: string;
20
+ buttons: {
21
+ text: string;
22
+ payload: string;
23
+ }[];
24
+ }, {
25
+ text: string;
26
+ buttons: {
27
+ text: string;
28
+ payload: string;
29
+ }[];
30
+ }>;
31
+ }, "strip", z.ZodTypeAny, {
32
+ type: "botExecutor";
33
+ content: {
34
+ text: string;
35
+ buttons: {
36
+ text: string;
37
+ payload: string;
38
+ }[];
39
+ };
40
+ }, {
41
+ type: "botExecutor";
42
+ content: {
43
+ text: string;
44
+ buttons: {
45
+ text: string;
46
+ payload: string;
47
+ }[];
48
+ };
49
+ }>;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BotExecutorSchema = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const zod_1 = tslib_1.__importDefault(require("zod"));
6
+ exports.BotExecutorSchema = zod_1.default
7
+ .object({
8
+ type: zod_1.default.enum(['botExecutor']),
9
+ content: zod_1.default.object({
10
+ text: zod_1.default.string(),
11
+ buttons: zod_1.default.array(zod_1.default.object({
12
+ text: zod_1.default.string(),
13
+ payload: zod_1.default.string(),
14
+ })),
15
+ }),
16
+ })
17
+ .describe('A text message with buttons to allow the bot to execute a specific action. Use it only when asked explicitly in the prompt');
18
+ //# sourceMappingURL=bot-executor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bot-executor.js","sourceRoot":"","sources":["../../../src/structured-output/bot-executor.ts"],"names":[],"mappings":";;;;AACA,sDAAmB;AAIN,QAAA,iBAAiB,GAAG,aAAC;KAC/B,MAAM,CAAC;IACN,IAAI,EAAE,aAAC,CAAC,IAAI,CAAC,CAAC,aAAa,CAAC,CAAC;IAC7B,OAAO,EAAE,aAAC,CAAC,MAAM,CAAC;QAChB,IAAI,EAAE,aAAC,CAAC,MAAM,EAAE;QAChB,OAAO,EAAE,aAAC,CAAC,KAAK,CACd,aAAC,CAAC,MAAM,CAAC;YACP,IAAI,EAAE,aAAC,CAAC,MAAM,EAAE;YAChB,OAAO,EAAE,aAAC,CAAC,MAAM,EAAE;SACpB,CAAC,CACH;KACF,CAAC;CACH,CAAC;KACD,QAAQ,CACP,4HAA4H,CAC7H,CAAA"}
@@ -160,9 +160,63 @@ export declare const OutputSchema: z.ZodObject<{
160
160
  type: "exit";
161
161
  }, {
162
162
  type: "exit";
163
+ }>, z.ZodObject<{
164
+ type: z.ZodEnum<["botExecutor"]>;
165
+ content: z.ZodObject<{
166
+ text: z.ZodString;
167
+ buttons: z.ZodArray<z.ZodObject<{
168
+ text: z.ZodString;
169
+ payload: z.ZodString;
170
+ }, "strip", z.ZodTypeAny, {
171
+ text: string;
172
+ payload: string;
173
+ }, {
174
+ text: string;
175
+ payload: string;
176
+ }>, "many">;
177
+ }, "strip", z.ZodTypeAny, {
178
+ text: string;
179
+ buttons: {
180
+ text: string;
181
+ payload: string;
182
+ }[];
183
+ }, {
184
+ text: string;
185
+ buttons: {
186
+ text: string;
187
+ payload: string;
188
+ }[];
189
+ }>;
190
+ }, "strip", z.ZodTypeAny, {
191
+ type: "botExecutor";
192
+ content: {
193
+ text: string;
194
+ buttons: {
195
+ text: string;
196
+ payload: string;
197
+ }[];
198
+ };
199
+ }, {
200
+ type: "botExecutor";
201
+ content: {
202
+ text: string;
203
+ buttons: {
204
+ text: string;
205
+ payload: string;
206
+ }[];
207
+ };
163
208
  }>]>, "many">;
164
209
  }, "strip", z.ZodTypeAny, {
165
210
  messages: ({
211
+ type: "botExecutor";
212
+ content: {
213
+ text: string;
214
+ buttons: {
215
+ text: string;
216
+ payload: string;
217
+ }[];
218
+ };
219
+ } | {
166
220
  type: "carousel";
167
221
  content: {
168
222
  elements: {
@@ -195,6 +249,15 @@ export declare const OutputSchema: z.ZodObject<{
195
249
  })[];
196
250
  }, {
197
251
  messages: ({
252
+ type: "botExecutor";
253
+ content: {
254
+ text: string;
255
+ buttons: {
256
+ text: string;
257
+ payload: string;
258
+ }[];
259
+ };
260
+ } | {
198
261
  type: "carousel";
199
262
  content: {
200
263
  elements: {
@@ -2,13 +2,20 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.OutputSchema = void 0;
4
4
  const zod_1 = require("zod");
5
+ const bot_executor_1 = require("./bot-executor");
5
6
  const carousel_1 = require("./carousel");
6
7
  const exit_1 = require("./exit");
7
8
  const text_1 = require("./text");
8
9
  const text_with_buttons_1 = require("./text-with-buttons");
9
10
  exports.OutputSchema = zod_1.z
10
11
  .object({
11
- messages: zod_1.z.array(zod_1.z.union([text_1.TextSchema, text_with_buttons_1.TextWithButtonsSchema, carousel_1.CarouselSchema, exit_1.ExitSchema])),
12
+ messages: zod_1.z.array(zod_1.z.union([
13
+ text_1.TextSchema,
14
+ text_with_buttons_1.TextWithButtonsSchema,
15
+ carousel_1.CarouselSchema,
16
+ exit_1.ExitSchema,
17
+ bot_executor_1.BotExecutorSchema,
18
+ ])),
12
19
  })
13
20
  .describe('The messages to be sent to the user');
14
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/structured-output/index.ts"],"names":[],"mappings":";;;AACA,6BAAuB;AAEvB,yCAA2C;AAC3C,iCAAmC;AACnC,iCAAmC;AACnC,2DAA2D;AAM9C,QAAA,YAAY,GAAG,OAAC;KAC1B,MAAM,CAAC;IACN,QAAQ,EAAE,OAAC,CAAC,KAAK,CACf,OAAC,CAAC,KAAK,CAAC,CAAC,iBAAU,EAAE,yCAAqB,EAAE,yBAAc,EAAE,iBAAU,CAAC,CAAC,CACzE;CACF,CAAC;KACD,QAAQ,CAAC,qCAAqC,CAAC,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/structured-output/index.ts"],"names":[],"mappings":";;;AACA,6BAAuB;AACvB,iDAAkD;AAClD,yCAA2C;AAC3C,iCAAmC;AACnC,iCAAmC;AACnC,2DAA2D;AAM9C,QAAA,YAAY,GAAG,OAAC;KAC1B,MAAM,CAAC;IACN,QAAQ,EAAE,OAAC,CAAC,KAAK,CACf,OAAC,CAAC,KAAK,CAAC;QACN,iBAAU;QACV,yCAAqB;QACrB,yBAAc;QACd,iBAAU;QACV,gCAAiB;KAClB,CAAC,CACH;CACF,CAAC;KACD,QAAQ,CAAC,qCAAqC,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botonic/plugin-ai-agents",
3
- "version": "0.45.0-alpha.0",
3
+ "version": "0.45.0-alpha.1",
4
4
  "main": "./lib/cjs/index.js",
5
5
  "module": "./lib/esm/index.js",
6
6
  "description": "Use AI Agents to generate your contents",
@@ -14,7 +14,7 @@
14
14
  "format": "biome format --write src/ tests/"
15
15
  },
16
16
  "dependencies": {
17
- "@botonic/core": "^0.45.0-alpha.0",
17
+ "@botonic/core": "^0.45.0-alpha.1",
18
18
  "@openai/agents": "^0.3.9",
19
19
  "axios": "^1.13.2",
20
20
  "openai": "^6.0.0",
@@ -0,0 +1,21 @@
1
+ import type { BotExecutorMessage } from '@botonic/core'
2
+ import z from 'zod'
3
+
4
+ export type { BotExecutorMessage }
5
+
6
+ export const BotExecutorSchema = z
7
+ .object({
8
+ type: z.enum(['botExecutor']),
9
+ content: z.object({
10
+ text: z.string(),
11
+ buttons: z.array(
12
+ z.object({
13
+ text: z.string(),
14
+ payload: z.string(),
15
+ })
16
+ ),
17
+ }),
18
+ })
19
+ .describe(
20
+ 'A text message with buttons to allow the bot to execute a specific action. Use it only when asked explicitly in the prompt'
21
+ )
@@ -1,6 +1,6 @@
1
1
  import type { OutputMessage } from '@botonic/core'
2
2
  import { z } from 'zod'
3
-
3
+ import { BotExecutorSchema } from './bot-executor'
4
4
  import { CarouselSchema } from './carousel'
5
5
  import { ExitSchema } from './exit'
6
6
  import { TextSchema } from './text'
@@ -13,7 +13,13 @@ export interface Output {
13
13
  export const OutputSchema = z
14
14
  .object({
15
15
  messages: z.array(
16
- z.union([TextSchema, TextWithButtonsSchema, CarouselSchema, ExitSchema])
16
+ z.union([
17
+ TextSchema,
18
+ TextWithButtonsSchema,
19
+ CarouselSchema,
20
+ ExitSchema,
21
+ BotExecutorSchema,
22
+ ])
17
23
  ),
18
24
  })
19
25
  .describe('The messages to be sent to the user')