@botonic/plugin-ai-agents 0.57.0-rslib-esm.1 → 0.57.0-rslib-esm.2

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.
@@ -47,6 +47,11 @@ export declare const OutputSchema: z.ZodObject<{
47
47
  payload: z.ZodString;
48
48
  }, z.core.$strip>>;
49
49
  }, z.core.$strip>;
50
+ }, z.core.$strip>, z.ZodObject<{
51
+ type: z.ZodLiteral<import("@botonic/core").OutputMessageType.RequestContactInfo>;
52
+ content: z.ZodObject<{
53
+ text: z.ZodString;
54
+ }, z.core.$strip>;
50
55
  }, z.core.$strip>]>>;
51
56
  }, z.core.$strip>;
52
57
  export declare function getOutputSchema(externalOutputMessagesSchemas: z.ZodObject<any>[]): z.ZodObject<{
@@ -93,6 +98,11 @@ export declare function getOutputSchema(externalOutputMessagesSchemas: z.ZodObje
93
98
  payload: z.ZodString;
94
99
  }, z.core.$strip>>;
95
100
  }, z.core.$strip>;
101
+ }, z.core.$strip>, z.ZodObject<{
102
+ type: z.ZodLiteral<import("@botonic/core").OutputMessageType.RequestContactInfo>;
103
+ content: z.ZodObject<{
104
+ text: z.ZodString;
105
+ }, z.core.$strip>;
96
106
  }, z.core.$strip>, ...z.ZodObject<any, z.core.$strip>[]]>>;
97
107
  }, z.core.$strip>;
98
108
  export declare function getOutputInstructions(): string;
@@ -2,6 +2,7 @@ import { z } from "zod";
2
2
  import { BotExecutorSchema } from "./bot-executor.js";
3
3
  import { CarouselSchema } from "./carousel.js";
4
4
  import { ExitSchema } from "./exit.js";
5
+ import { RequestContactInfoSchema } from "./request-contact-info.js";
5
6
  import { TextSchema } from "./text.js";
6
7
  import { TextWithButtonsSchema } from "./text-with-buttons.js";
7
8
 
@@ -17,12 +18,15 @@ import { TextWithButtonsSchema } from "./text-with-buttons.js";
17
18
 
18
19
 
19
20
 
21
+
22
+
20
23
  const baseMessageSchemas = [
21
24
  TextSchema,
22
25
  TextWithButtonsSchema,
23
26
  CarouselSchema,
24
27
  ExitSchema,
25
- BotExecutorSchema
28
+ BotExecutorSchema,
29
+ RequestContactInfoSchema
26
30
  ];
27
31
  const OutputSchema = z.object({
28
32
  messages: z.array(z.union(baseMessageSchemas))
@@ -1 +1 @@
1
- {"version":3,"file":"structured-output/index.js","sources":["../../src/structured-output/index.ts"],"sourcesContent":["import type { OutputMessage } from '@botonic/core'\nimport { z } from 'zod'\nimport { BotExecutorSchema } from './bot-executor'\nimport { CarouselSchema } from './carousel'\nimport { ExitSchema } from './exit'\nimport { TextSchema } from './text'\nimport { TextWithButtonsSchema } from './text-with-buttons'\n\nexport interface Output {\n messages: OutputMessage[]\n}\n\nconst baseMessageSchemas = [\n TextSchema,\n TextWithButtonsSchema,\n CarouselSchema,\n ExitSchema,\n BotExecutorSchema,\n] as const\nexport const OutputSchema = z\n .object({\n messages: z.array(z.union(baseMessageSchemas)),\n })\n .describe('The messages to be sent to the user')\n\nexport function getOutputSchema(\n externalOutputMessagesSchemas: z.ZodObject<any>[]\n) {\n return z.object({\n messages: z.array(\n z.union([...baseMessageSchemas, ...externalOutputMessagesSchemas])\n ),\n })\n}\n\nexport function getOutputInstructions(): string {\n const example = {\n messages: [\n {\n type: 'text',\n content: {\n text: 'Hello, how can I help you today?',\n },\n },\n ],\n }\n const output = `Return a JSON that follows the output schema provided. Never return multiple output schemas concatenated by a line break.\\n<example>\\n${JSON.stringify(example)}\\n</example>`\n return `<output>\\n${output}\\n</output>`\n}\n"],"names":["z","BotExecutorSchema","CarouselSchema","ExitSchema","TextSchema","TextWithButtonsSchema","baseMessageSchemas","OutputSchema","getOutputSchema","externalOutputMessagesSchemas","getOutputInstructions","example","output","JSON"],"mappings":";;;;;;;;;;;;;AACuB;AAC2B;AACP;AACR;AACA;AACwB;AAM3D,MAAMM,kBAAkBA,GAAG;IACzBF,UAAUA;IACVC,qBAAqBA;IACrBH,cAAcA;IACdC,UAAUA;IACVF,iBAAiBA;CAClB;AACM,MAAMM,YAAYA,GAAGP,QACnB,CAAC;IACN,UAAUA,OAAO,CAACA,OAAO,CAACM,kBAAkBA;AAC9C,GACC,QAAQ,CAAC,uCAAsC;AAE3C,SAASE,eAAeA,CAC7BC,6BAAiD;IAEjD,OAAOT,QAAQ,CAAC;QACd,UAAUA,OAAO,CACfA,OAAO,CAAC;eAAIM,kBAAkBA;eAAKG;SAA8B;IAErE;AACF;AAEO,SAASC,qBAAqBA;IACnC,MAAMC,UAAU;QACd,UAAU;YACR;gBACE,MAAM;gBACN,SAAS;oBACP,MAAM;gBACR;YACF;SACD;IACH;IACA,MAAMC,SAAS,CAAC,sIAAsI,EAAEC,KAAK,SAAS,CAACF,SAAS,YAAY,CAAC;IAC7L,OAAO,CAAC,UAAU,EAAEC,OAAO,WAAW,CAAC;AACzC"}
1
+ {"version":3,"file":"structured-output/index.js","sources":["../../src/structured-output/index.ts"],"sourcesContent":["import type { OutputMessage } from '@botonic/core'\nimport { z } from 'zod'\nimport { BotExecutorSchema } from './bot-executor'\nimport { CarouselSchema } from './carousel'\nimport { ExitSchema } from './exit'\nimport { RequestContactInfoSchema } from './request-contact-info'\nimport { TextSchema } from './text'\nimport { TextWithButtonsSchema } from './text-with-buttons'\n\nexport interface Output {\n messages: OutputMessage[]\n}\n\nconst baseMessageSchemas = [\n TextSchema,\n TextWithButtonsSchema,\n CarouselSchema,\n ExitSchema,\n BotExecutorSchema,\n RequestContactInfoSchema,\n] as const\nexport const OutputSchema = z\n .object({\n messages: z.array(z.union(baseMessageSchemas)),\n })\n .describe('The messages to be sent to the user')\n\nexport function getOutputSchema(\n externalOutputMessagesSchemas: z.ZodObject<any>[]\n) {\n return z.object({\n messages: z.array(\n z.union([...baseMessageSchemas, ...externalOutputMessagesSchemas])\n ),\n })\n}\n\nexport function getOutputInstructions(): string {\n const example = {\n messages: [\n {\n type: 'text',\n content: {\n text: 'Hello, how can I help you today?',\n },\n },\n ],\n }\n const output = `Return a JSON that follows the output schema provided. Never return multiple output schemas concatenated by a line break.\\n<example>\\n${JSON.stringify(example)}\\n</example>`\n return `<output>\\n${output}\\n</output>`\n}\n"],"names":["z","BotExecutorSchema","CarouselSchema","ExitSchema","RequestContactInfoSchema","TextSchema","TextWithButtonsSchema","baseMessageSchemas","OutputSchema","getOutputSchema","externalOutputMessagesSchemas","getOutputInstructions","example","output","JSON"],"mappings":";;;;;;;;;;;;;;;AACuB;AAC2B;AACP;AACR;AAC8B;AAC9B;AACwB;AAM3D,MAAMO,kBAAkBA,GAAG;IACzBF,UAAUA;IACVC,qBAAqBA;IACrBJ,cAAcA;IACdC,UAAUA;IACVF,iBAAiBA;IACjBG,wBAAwBA;CACzB;AACM,MAAMI,YAAYA,GAAGR,QACnB,CAAC;IACN,UAAUA,OAAO,CAACA,OAAO,CAACO,kBAAkBA;AAC9C,GACC,QAAQ,CAAC,uCAAsC;AAE3C,SAASE,eAAeA,CAC7BC,6BAAiD;IAEjD,OAAOV,QAAQ,CAAC;QACd,UAAUA,OAAO,CACfA,OAAO,CAAC;eAAIO,kBAAkBA;eAAKG;SAA8B;IAErE;AACF;AAEO,SAASC,qBAAqBA;IACnC,MAAMC,UAAU;QACd,UAAU;YACR;gBACE,MAAM;gBACN,SAAS;oBACP,MAAM;gBACR;YACF;SACD;IACH;IACA,MAAMC,SAAS,CAAC,sIAAsI,EAAEC,KAAK,SAAS,CAACF,SAAS,YAAY,CAAC;IAC7L,OAAO,CAAC,UAAU,EAAEC,OAAO,WAAW,CAAC;AACzC"}
@@ -0,0 +1,9 @@
1
+ import { OutputMessageType, type RequestContactInfoMessage } from '@botonic/core';
2
+ import { z } from 'zod';
3
+ export type { RequestContactInfoMessage };
4
+ export declare const RequestContactInfoSchema: z.ZodObject<{
5
+ type: z.ZodLiteral<OutputMessageType.RequestContactInfo>;
6
+ content: z.ZodObject<{
7
+ text: z.ZodString;
8
+ }, z.core.$strip>;
9
+ }, z.core.$strip>;
@@ -0,0 +1,17 @@
1
+ import { OutputMessageType } from "@botonic/core";
2
+ import { z } from "zod";
3
+
4
+
5
+
6
+
7
+
8
+ const RequestContactInfoSchema = z.object({
9
+ type: z.literal(OutputMessageType.RequestContactInfo),
10
+ content: z.object({
11
+ text: z.string().describe('The text of the message')
12
+ })
13
+ }).describe('A message to request phone number from the user. Use it only when asked explicitly in the prompt.');
14
+
15
+ export { RequestContactInfoSchema };
16
+
17
+ //# sourceMappingURL=request-contact-info.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"structured-output/request-contact-info.js","sources":["../../src/structured-output/request-contact-info.ts"],"sourcesContent":["import {\n OutputMessageType,\n type RequestContactInfoMessage,\n} from '@botonic/core'\nimport { z } from 'zod'\n\nexport type { RequestContactInfoMessage }\n\nexport const RequestContactInfoSchema = z\n .object({\n type: z.literal(OutputMessageType.RequestContactInfo),\n content: z.object({\n text: z.string().describe('The text of the message'),\n }),\n })\n .describe(\n 'A message to request phone number from the user. Use it only when asked explicitly in the prompt.'\n )\n"],"names":["OutputMessageType","z","RequestContactInfoSchema"],"mappings":";;;;;AAGsB;AACC;AAIhB,MAAME,wBAAwBA,GAAGD,QAC/B,CAAC;IACN,MAAMA,SAAS,CAACD,oCAAoC;IACpD,SAASC,QAAQ,CAAC;QAChB,MAAMA,QAAQ,GAAG,QAAQ,CAAC;IAC5B;AACF,GACC,QAAQ,CACP,qGACD"}
package/package.json CHANGED
@@ -1,21 +1,21 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@botonic/plugin-ai-agents",
4
- "version": "0.57.0-rslib-esm.1",
4
+ "version": "0.57.0-rslib-esm.2",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",
7
7
  "description": "Use AI Agents to generate your contents",
8
8
  "scripts": {
9
9
  "build": "rslib build --no-env",
10
10
  "build:watch": "rslib build --watch --no-env",
11
- "test": "../../node_modules/.bin/jest --coverage",
11
+ "test": "vitest run --coverage",
12
12
  "prepublishOnly": "npm run build && npm run test && npm run lint",
13
13
  "lint": "biome check --write src/ tests/",
14
14
  "lint:check": "biome check src/ tests/",
15
15
  "format": "biome format --write src/ tests/"
16
16
  },
17
17
  "dependencies": {
18
- "@botonic/core": "0.57.0-rslib-esm.1",
18
+ "@botonic/core": "0.57.0-rslib-esm.2",
19
19
  "@openai/agents": "^0.10.1",
20
20
  "axios": "^1.18.1",
21
21
  "openai": "^6.36.0",
@@ -3,6 +3,7 @@ import { z } from 'zod'
3
3
  import { BotExecutorSchema } from './bot-executor'
4
4
  import { CarouselSchema } from './carousel'
5
5
  import { ExitSchema } from './exit'
6
+ import { RequestContactInfoSchema } from './request-contact-info'
6
7
  import { TextSchema } from './text'
7
8
  import { TextWithButtonsSchema } from './text-with-buttons'
8
9
 
@@ -16,6 +17,7 @@ const baseMessageSchemas = [
16
17
  CarouselSchema,
17
18
  ExitSchema,
18
19
  BotExecutorSchema,
20
+ RequestContactInfoSchema,
19
21
  ] as const
20
22
  export const OutputSchema = z
21
23
  .object({
@@ -0,0 +1,18 @@
1
+ import {
2
+ OutputMessageType,
3
+ type RequestContactInfoMessage,
4
+ } from '@botonic/core'
5
+ import { z } from 'zod'
6
+
7
+ export type { RequestContactInfoMessage }
8
+
9
+ export const RequestContactInfoSchema = z
10
+ .object({
11
+ type: z.literal(OutputMessageType.RequestContactInfo),
12
+ content: z.object({
13
+ text: z.string().describe('The text of the message'),
14
+ }),
15
+ })
16
+ .describe(
17
+ 'A message to request phone number from the user. Use it only when asked explicitly in the prompt.'
18
+ )