@botonic/plugin-ai-agents 0.48.0 → 0.49.0-alpha.0
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.
- package/lib/cjs/agents/base-agent.d.ts +28 -0
- package/lib/cjs/agents/base-agent.js +39 -0
- package/lib/cjs/agents/base-agent.js.map +1 -0
- package/lib/cjs/agents/index.d.ts +2 -0
- package/lib/cjs/agents/index.js +8 -0
- package/lib/cjs/agents/index.js.map +1 -0
- package/lib/cjs/agents/router-agent.d.ts +25 -0
- package/lib/cjs/agents/router-agent.js +33 -0
- package/lib/cjs/agents/router-agent.js.map +1 -0
- package/lib/cjs/agents/worker-agent.d.ts +35 -0
- package/lib/cjs/{agent-builder.js → agents/worker-agent.js} +48 -49
- package/lib/cjs/agents/worker-agent.js.map +1 -0
- package/lib/cjs/bot-config-tools.js +3 -4
- package/lib/cjs/bot-config-tools.js.map +1 -1
- package/lib/cjs/debug-logger.d.ts +1 -1
- package/lib/cjs/debug-logger.js +4 -1
- package/lib/cjs/debug-logger.js.map +1 -1
- package/lib/cjs/guardrails/input.d.ts +1 -1
- package/lib/cjs/guardrails/input.js +25 -9
- package/lib/cjs/guardrails/input.js.map +1 -1
- package/lib/cjs/index.d.ts +4 -1
- package/lib/cjs/index.js +112 -51
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/llm-config.d.ts +2 -1
- package/lib/cjs/llm-config.js +3 -0
- package/lib/cjs/llm-config.js.map +1 -1
- package/lib/cjs/runners/base-runner.d.ts +26 -0
- package/lib/cjs/runners/base-runner.js +114 -0
- package/lib/cjs/runners/base-runner.js.map +1 -0
- package/lib/cjs/runners/index.d.ts +2 -0
- package/lib/cjs/runners/index.js +8 -0
- package/lib/cjs/runners/index.js.map +1 -0
- package/lib/cjs/runners/router-runner.d.ts +6 -0
- package/lib/cjs/runners/router-runner.js +29 -0
- package/lib/cjs/runners/router-runner.js.map +1 -0
- package/lib/cjs/runners/worker-runner.d.ts +10 -0
- package/lib/cjs/runners/worker-runner.js +78 -0
- package/lib/cjs/runners/worker-runner.js.map +1 -0
- package/lib/cjs/structured-output/bot-executor.d.ts +6 -42
- package/lib/cjs/structured-output/bot-executor.js +9 -9
- package/lib/cjs/structured-output/bot-executor.js.map +1 -1
- package/lib/cjs/structured-output/carousel.d.ts +6 -78
- package/lib/cjs/structured-output/carousel.js +2 -1
- package/lib/cjs/structured-output/carousel.js.map +1 -1
- package/lib/cjs/structured-output/exit.d.ts +4 -8
- package/lib/cjs/structured-output/exit.js +4 -4
- package/lib/cjs/structured-output/exit.js.map +1 -1
- package/lib/cjs/structured-output/index.d.ts +48 -553
- package/lib/cjs/structured-output/index.js +15 -0
- package/lib/cjs/structured-output/index.js.map +1 -1
- package/lib/cjs/structured-output/text-with-buttons.d.ts +10 -49
- package/lib/cjs/structured-output/text-with-buttons.js +10 -10
- package/lib/cjs/structured-output/text-with-buttons.js.map +1 -1
- package/lib/cjs/structured-output/text.d.ts +4 -18
- package/lib/cjs/structured-output/text.js +2 -1
- package/lib/cjs/structured-output/text.js.map +1 -1
- package/lib/cjs/tools/index.d.ts +1 -1
- package/lib/cjs/tools/index.js +3 -2
- package/lib/cjs/tools/index.js.map +1 -1
- package/lib/cjs/tools/retrieve-knowledge.d.ts +3 -6
- package/lib/cjs/tools/retrieve-knowledge.js +7 -5
- package/lib/cjs/tools/retrieve-knowledge.js.map +1 -1
- package/lib/cjs/types.d.ts +2 -3
- package/lib/esm/agents/base-agent.d.ts +28 -0
- package/lib/esm/agents/base-agent.js +39 -0
- package/lib/esm/agents/base-agent.js.map +1 -0
- package/lib/esm/agents/index.d.ts +2 -0
- package/lib/esm/agents/index.js +8 -0
- package/lib/esm/agents/index.js.map +1 -0
- package/lib/esm/agents/router-agent.d.ts +25 -0
- package/lib/esm/agents/router-agent.js +33 -0
- package/lib/esm/agents/router-agent.js.map +1 -0
- package/lib/esm/agents/worker-agent.d.ts +35 -0
- package/lib/esm/{agent-builder.js → agents/worker-agent.js} +48 -49
- package/lib/esm/agents/worker-agent.js.map +1 -0
- package/lib/esm/bot-config-tools.js +3 -4
- package/lib/esm/bot-config-tools.js.map +1 -1
- package/lib/esm/debug-logger.d.ts +1 -1
- package/lib/esm/debug-logger.js +4 -1
- package/lib/esm/debug-logger.js.map +1 -1
- package/lib/esm/guardrails/input.d.ts +1 -1
- package/lib/esm/guardrails/input.js +25 -9
- package/lib/esm/guardrails/input.js.map +1 -1
- package/lib/esm/index.d.ts +4 -1
- package/lib/esm/index.js +112 -51
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/llm-config.d.ts +2 -1
- package/lib/esm/llm-config.js +3 -0
- package/lib/esm/llm-config.js.map +1 -1
- package/lib/esm/runners/base-runner.d.ts +26 -0
- package/lib/esm/runners/base-runner.js +114 -0
- package/lib/esm/runners/base-runner.js.map +1 -0
- package/lib/esm/runners/index.d.ts +2 -0
- package/lib/esm/runners/index.js +8 -0
- package/lib/esm/runners/index.js.map +1 -0
- package/lib/esm/runners/router-runner.d.ts +6 -0
- package/lib/esm/runners/router-runner.js +29 -0
- package/lib/esm/runners/router-runner.js.map +1 -0
- package/lib/esm/runners/worker-runner.d.ts +10 -0
- package/lib/esm/runners/worker-runner.js +78 -0
- package/lib/esm/runners/worker-runner.js.map +1 -0
- package/lib/esm/structured-output/bot-executor.d.ts +6 -42
- package/lib/esm/structured-output/bot-executor.js +9 -9
- package/lib/esm/structured-output/bot-executor.js.map +1 -1
- package/lib/esm/structured-output/carousel.d.ts +6 -78
- package/lib/esm/structured-output/carousel.js +2 -1
- package/lib/esm/structured-output/carousel.js.map +1 -1
- package/lib/esm/structured-output/exit.d.ts +4 -8
- package/lib/esm/structured-output/exit.js +4 -4
- package/lib/esm/structured-output/exit.js.map +1 -1
- package/lib/esm/structured-output/index.d.ts +48 -553
- package/lib/esm/structured-output/index.js +15 -0
- package/lib/esm/structured-output/index.js.map +1 -1
- package/lib/esm/structured-output/text-with-buttons.d.ts +10 -49
- package/lib/esm/structured-output/text-with-buttons.js +10 -10
- package/lib/esm/structured-output/text-with-buttons.js.map +1 -1
- package/lib/esm/structured-output/text.d.ts +4 -18
- package/lib/esm/structured-output/text.js +2 -1
- package/lib/esm/structured-output/text.js.map +1 -1
- package/lib/esm/tools/index.d.ts +1 -1
- package/lib/esm/tools/index.js +3 -2
- package/lib/esm/tools/index.js.map +1 -1
- package/lib/esm/tools/retrieve-knowledge.d.ts +3 -6
- package/lib/esm/tools/retrieve-knowledge.js +7 -5
- package/lib/esm/tools/retrieve-knowledge.js.map +1 -1
- package/lib/esm/types.d.ts +2 -3
- package/package.json +6 -7
- package/src/agents/base-agent.ts +75 -0
- package/src/agents/index.ts +2 -0
- package/src/agents/router-agent.ts +71 -0
- package/src/{agent-builder.ts → agents/worker-agent.ts} +75 -77
- package/src/bot-config-tools.ts +3 -4
- package/src/debug-logger.ts +10 -4
- package/src/guardrails/input.ts +35 -9
- package/src/index.ts +216 -82
- package/src/llm-config.ts +5 -0
- package/src/runners/base-runner.ts +190 -0
- package/src/runners/index.ts +2 -0
- package/src/runners/router-runner.ts +41 -0
- package/src/runners/worker-runner.ts +112 -0
- package/src/structured-output/bot-executor.ts +3 -3
- package/src/structured-output/carousel.ts +2 -2
- package/src/structured-output/exit.ts +3 -3
- package/src/structured-output/index.ts +15 -0
- package/src/structured-output/text-with-buttons.ts +3 -3
- package/src/structured-output/text.ts +2 -2
- package/src/tools/index.ts +4 -1
- package/src/tools/retrieve-knowledge.ts +32 -29
- package/src/types.ts +2 -3
- package/lib/cjs/agent-builder.d.ts +0 -37
- package/lib/cjs/agent-builder.js.map +0 -1
- package/lib/cjs/runner.d.ts +0 -18
- package/lib/cjs/runner.js +0 -180
- package/lib/cjs/runner.js.map +0 -1
- package/lib/esm/agent-builder.d.ts +0 -37
- package/lib/esm/agent-builder.js.map +0 -1
- package/lib/esm/runner.d.ts +0 -18
- package/lib/esm/runner.js +0 -180
- package/lib/esm/runner.js.map +0 -1
- package/src/runner.ts +0 -283
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BotExecutorSchema = void 0;
|
|
4
|
-
const
|
|
5
|
-
const zod_1 =
|
|
6
|
-
exports.BotExecutorSchema = zod_1.
|
|
4
|
+
const core_1 = require("@botonic/core");
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
exports.BotExecutorSchema = zod_1.z
|
|
7
7
|
.object({
|
|
8
|
-
type: zod_1.
|
|
9
|
-
content: zod_1.
|
|
10
|
-
text: zod_1.
|
|
11
|
-
buttons: zod_1.
|
|
12
|
-
text: zod_1.
|
|
13
|
-
payload: zod_1.
|
|
8
|
+
type: zod_1.z.literal(core_1.OutputMessageType.BotExecutor),
|
|
9
|
+
content: zod_1.z.object({
|
|
10
|
+
text: zod_1.z.string(),
|
|
11
|
+
buttons: zod_1.z.array(zod_1.z.object({
|
|
12
|
+
text: zod_1.z.string(),
|
|
13
|
+
payload: zod_1.z.string(),
|
|
14
14
|
})),
|
|
15
15
|
}),
|
|
16
16
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bot-executor.js","sourceRoot":"","sources":["../../../src/structured-output/bot-executor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bot-executor.js","sourceRoot":"","sources":["../../../src/structured-output/bot-executor.ts"],"names":[],"mappings":";;;AAAA,wCAA0E;AAC1E,6BAAuB;AAIV,QAAA,iBAAiB,GAAG,OAAC;KAC/B,MAAM,CAAC;IACN,IAAI,EAAE,OAAC,CAAC,OAAO,CAAC,wBAAiB,CAAC,WAAW,CAAC;IAC9C,OAAO,EAAE,OAAC,CAAC,MAAM,CAAC;QAChB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;QAChB,OAAO,EAAE,OAAC,CAAC,KAAK,CACd,OAAC,CAAC,MAAM,CAAC;YACP,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;YAChB,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE;SACpB,CAAC,CACH;KACF,CAAC;CACH,CAAC;KACD,QAAQ,CACP,4HAA4H,CAC7H,CAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type CarouselMessage, OutputMessageType } from '@botonic/core';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
export type { CarouselMessage };
|
|
4
4
|
export declare const CarouselSchema: z.ZodObject<{
|
|
5
|
-
type: z.
|
|
5
|
+
type: z.ZodLiteral<OutputMessageType.Carousel>;
|
|
6
6
|
content: z.ZodObject<{
|
|
7
7
|
text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
8
8
|
elements: z.ZodArray<z.ZodObject<{
|
|
@@ -12,79 +12,7 @@ export declare const CarouselSchema: z.ZodObject<{
|
|
|
12
12
|
button: z.ZodObject<{
|
|
13
13
|
text: z.ZodString;
|
|
14
14
|
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
15
|
-
},
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
text: string;
|
|
20
|
-
url?: string | null | undefined;
|
|
21
|
-
}>;
|
|
22
|
-
}, "strip", z.ZodTypeAny, {
|
|
23
|
-
title: string;
|
|
24
|
-
subtitle: string;
|
|
25
|
-
image: string;
|
|
26
|
-
button: {
|
|
27
|
-
text: string;
|
|
28
|
-
url?: string | null | undefined;
|
|
29
|
-
};
|
|
30
|
-
}, {
|
|
31
|
-
title: string;
|
|
32
|
-
subtitle: string;
|
|
33
|
-
image: string;
|
|
34
|
-
button: {
|
|
35
|
-
text: string;
|
|
36
|
-
url?: string | null | undefined;
|
|
37
|
-
};
|
|
38
|
-
}>, "many">;
|
|
39
|
-
}, "strip", z.ZodTypeAny, {
|
|
40
|
-
elements: {
|
|
41
|
-
title: string;
|
|
42
|
-
subtitle: string;
|
|
43
|
-
image: string;
|
|
44
|
-
button: {
|
|
45
|
-
text: string;
|
|
46
|
-
url?: string | null | undefined;
|
|
47
|
-
};
|
|
48
|
-
}[];
|
|
49
|
-
text?: string | null | undefined;
|
|
50
|
-
}, {
|
|
51
|
-
elements: {
|
|
52
|
-
title: string;
|
|
53
|
-
subtitle: string;
|
|
54
|
-
image: string;
|
|
55
|
-
button: {
|
|
56
|
-
text: string;
|
|
57
|
-
url?: string | null | undefined;
|
|
58
|
-
};
|
|
59
|
-
}[];
|
|
60
|
-
text?: string | null | undefined;
|
|
61
|
-
}>;
|
|
62
|
-
}, "strip", z.ZodTypeAny, {
|
|
63
|
-
type: "carousel";
|
|
64
|
-
content: {
|
|
65
|
-
elements: {
|
|
66
|
-
title: string;
|
|
67
|
-
subtitle: string;
|
|
68
|
-
image: string;
|
|
69
|
-
button: {
|
|
70
|
-
text: string;
|
|
71
|
-
url?: string | null | undefined;
|
|
72
|
-
};
|
|
73
|
-
}[];
|
|
74
|
-
text?: string | null | undefined;
|
|
75
|
-
};
|
|
76
|
-
}, {
|
|
77
|
-
type: "carousel";
|
|
78
|
-
content: {
|
|
79
|
-
elements: {
|
|
80
|
-
title: string;
|
|
81
|
-
subtitle: string;
|
|
82
|
-
image: string;
|
|
83
|
-
button: {
|
|
84
|
-
text: string;
|
|
85
|
-
url?: string | null | undefined;
|
|
86
|
-
};
|
|
87
|
-
}[];
|
|
88
|
-
text?: string | null | undefined;
|
|
89
|
-
};
|
|
90
|
-
}>;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
}, z.core.$strip>>;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
}, z.core.$strip>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CarouselSchema = void 0;
|
|
4
|
+
const core_1 = require("@botonic/core");
|
|
4
5
|
const zod_1 = require("zod");
|
|
5
6
|
exports.CarouselSchema = zod_1.z
|
|
6
7
|
.object({
|
|
7
|
-
type: zod_1.z.
|
|
8
|
+
type: zod_1.z.literal(core_1.OutputMessageType.Carousel),
|
|
8
9
|
content: zod_1.z.object({
|
|
9
10
|
text: zod_1.z.string().nullable().optional(),
|
|
10
11
|
elements: zod_1.z.array(zod_1.z.object({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"carousel.js","sourceRoot":"","sources":["../../../src/structured-output/carousel.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"carousel.js","sourceRoot":"","sources":["../../../src/structured-output/carousel.ts"],"names":[],"mappings":";;;AAAA,wCAAuE;AACvE,6BAAuB;AAIV,QAAA,cAAc,GAAG,OAAC;KAC5B,MAAM,CAAC;IACN,IAAI,EAAE,OAAC,CAAC,OAAO,CAAC,wBAAiB,CAAC,QAAQ,CAAC;IAC3C,OAAO,EAAE,OAAC,CAAC,MAAM,CAAC;QAChB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;QACtC,QAAQ,EAAE,OAAC,CAAC,KAAK,CACf,OAAC,CAAC,MAAM,CAAC;YACP,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;YACjB,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE;YACpB,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;YACjB,MAAM,EAAE,OAAC,CAAC,MAAM,CAAC;gBACf,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;gBAChB,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;aACtC,CAAC;SACH,CAAC,CACH;KACF,CAAC;CACH,CAAC;KACD,QAAQ,CAAC,kDAAkD,CAAC,CAAA"}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import z from 'zod';
|
|
1
|
+
import { type ExitMessage, OutputMessageType } from '@botonic/core';
|
|
2
|
+
import { z } from 'zod';
|
|
3
3
|
export type { ExitMessage };
|
|
4
4
|
export declare const ExitSchema: z.ZodObject<{
|
|
5
|
-
type: z.
|
|
6
|
-
},
|
|
7
|
-
type: "exit";
|
|
8
|
-
}, {
|
|
9
|
-
type: "exit";
|
|
10
|
-
}>;
|
|
5
|
+
type: z.ZodLiteral<OutputMessageType.Exit>;
|
|
6
|
+
}, z.core.$strip>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ExitSchema = void 0;
|
|
4
|
-
const
|
|
5
|
-
const zod_1 =
|
|
6
|
-
exports.ExitSchema = zod_1.
|
|
4
|
+
const core_1 = require("@botonic/core");
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
exports.ExitSchema = zod_1.z
|
|
7
7
|
.object({
|
|
8
|
-
type: zod_1.
|
|
8
|
+
type: zod_1.z.literal(core_1.OutputMessageType.Exit),
|
|
9
9
|
})
|
|
10
10
|
.describe('An exit message. This message should only be used to exit the agent due to out of context or the user asking to exit the conversation');
|
|
11
11
|
//# sourceMappingURL=exit.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exit.js","sourceRoot":"","sources":["../../../src/structured-output/exit.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"exit.js","sourceRoot":"","sources":["../../../src/structured-output/exit.ts"],"names":[],"mappings":";;;AAAA,wCAAmE;AACnE,6BAAuB;AAIV,QAAA,UAAU,GAAG,OAAC;KACxB,MAAM,CAAC;IACN,IAAI,EAAE,OAAC,CAAC,OAAO,CAAC,wBAAiB,CAAC,IAAI,CAAC;CACxC,CAAC;KACD,QAAQ,CACP,uIAAuI,CACxI,CAAA"}
|