@botpress/runtime 1.7.4 → 1.7.6
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/dist/define-config.d.ts +18 -18
- package/dist/definition.js +564 -562
- package/dist/definition.js.map +3 -3
- package/dist/internal.js +564 -562
- package/dist/internal.js.map +3 -3
- package/dist/library.js +564 -562
- package/dist/library.js.map +3 -3
- package/dist/primitives/data-sources/source-base.d.ts +49 -49
- package/dist/primitives/data-sources/source-directory.d.ts +23 -23
- package/dist/primitives/data-sources/source-directory.d.ts.map +1 -1
- package/dist/primitives/data-sources/source-table.d.ts +24 -24
- package/dist/primitives/data-sources/source-website.d.ts +31 -31
- package/dist/primitives/index.d.ts +23 -23
- package/dist/primitives/workflow-instance.d.ts +4 -4
- package/dist/runtime/actions/computed-columns.d.ts +10 -10
- package/dist/runtime/actions/index.d.ts +10 -10
- package/dist/runtime/autonomous.d.ts +3 -1
- package/dist/runtime/autonomous.d.ts.map +1 -1
- package/dist/runtime/chat/chat.d.ts +43 -163
- package/dist/runtime/chat/chat.d.ts.map +1 -1
- package/dist/runtime/chat/components.d.ts +76 -76
- package/dist/runtime/chat/transcript.d.ts +10 -10
- package/dist/runtime/events.d.ts +21 -21
- package/dist/runtime/tracked-state-schema.d.ts +7 -7
- package/dist/runtime/workflows/knowledge-indexing.d.ts +21 -21
- package/dist/runtime.js +649 -576
- package/dist/runtime.js.map +4 -4
- package/package.json +3 -3
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
* These actions are defined in the runtime and don't need to be created by users
|
|
4
4
|
*/
|
|
5
5
|
export declare const BuiltInActions: {
|
|
6
|
-
tablesRecomputeRows: import("../../primitives/action").BaseAction<import("@
|
|
7
|
-
tableId: import("@
|
|
8
|
-
botId: import("@
|
|
9
|
-
schema: import("@
|
|
10
|
-
requests: import("@
|
|
11
|
-
row: import("@
|
|
12
|
-
columnsToRecompute: import("@
|
|
6
|
+
tablesRecomputeRows: import("../../primitives/action").BaseAction<import("@botpress/sdk").ZodObject<{
|
|
7
|
+
tableId: import("@botpress/sdk").ZodString;
|
|
8
|
+
botId: import("@botpress/sdk").ZodString;
|
|
9
|
+
schema: import("@botpress/sdk").ZodAny;
|
|
10
|
+
requests: import("@botpress/sdk").ZodArray<import("@botpress/sdk").ZodObject<{
|
|
11
|
+
row: import("@botpress/sdk").ZodRecord<import("@botpress/sdk").ZodString, import("@botpress/sdk").ZodAny>;
|
|
12
|
+
columnsToRecompute: import("@botpress/sdk").ZodArray<import("@botpress/sdk").ZodString, "many">;
|
|
13
13
|
}, "strip", {
|
|
14
14
|
row: Record<string, any>;
|
|
15
15
|
columnsToRecompute: string[];
|
|
@@ -33,9 +33,9 @@ export declare const BuiltInActions: {
|
|
|
33
33
|
}[];
|
|
34
34
|
tableId: string;
|
|
35
35
|
schema?: any;
|
|
36
|
-
}>, import("@
|
|
37
|
-
isFinished: import("@
|
|
38
|
-
rows: import("@
|
|
36
|
+
}>, import("@botpress/sdk").ZodObject<{
|
|
37
|
+
isFinished: import("@botpress/sdk").ZodBoolean;
|
|
38
|
+
rows: import("@botpress/sdk").ZodArray<import("@botpress/sdk").ZodAny, "many">;
|
|
39
39
|
}, "strip", {
|
|
40
40
|
rows: any[];
|
|
41
41
|
isFinished: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ExecutionProps as LlmzExecutionProps } from 'llmz/dist/llmz';
|
|
2
2
|
import { type Chat as LlmzChat, type ValueOrGetter, type Context as LlmzContext } from 'llmz';
|
|
3
|
-
import { Iteration as LlmzIteration, Tool as LlmzTool, Traces as _Traces, ThinkSignal as _ThinkSignal, SnapshotSignal as _SnapshotSignal, Citation as _Citation, CitationsManager as _CitationsManager } from 'llmz';
|
|
3
|
+
import { Iteration as LlmzIteration, Tool as LlmzTool, Traces as _Traces, ThinkSignal as _ThinkSignal, SnapshotSignal as _SnapshotSignal, Citation as _Citation, CitationsManager as _CitationsManager, Component as LlmzComponent } from 'llmz';
|
|
4
4
|
import { Exit as LlmzExit, type ExitResult as LlmzExitResult } from 'llmz';
|
|
5
5
|
import { ObjectInstance as LlmzObject } from 'llmz';
|
|
6
6
|
import { CognitiveBeta } from '@botpress/cognitive';
|
|
@@ -19,6 +19,8 @@ export declare namespace Autonomous {
|
|
|
19
19
|
type IterationController = Parameters<NonNullable<LlmzExecutionProps['onIterationEnd']>>[1];
|
|
20
20
|
const Tool: typeof LlmzTool;
|
|
21
21
|
type Tool = InstanceType<typeof Tool>;
|
|
22
|
+
const Component: typeof LlmzComponent;
|
|
23
|
+
type Component = InstanceType<typeof Component>;
|
|
22
24
|
const Exit: typeof LlmzExit;
|
|
23
25
|
const Object: typeof LlmzObject;
|
|
24
26
|
type Citation = _Citation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autonomous.d.ts","sourceRoot":"","sources":["../../src/runtime/autonomous.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,IAAI,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AAE1E,OAAO,EAAY,KAAK,IAAI,IAAI,QAAQ,EAAE,KAAK,aAAa,EAAE,KAAK,OAAO,IAAI,WAAW,EAAE,MAAM,MAAM,CAAA;AACvG,OAAO,EACL,SAAS,IAAI,aAAa,EAC1B,IAAI,IAAI,QAAQ,EAChB,MAAM,IAAI,OAAO,EACjB,WAAW,IAAI,YAAY,EAC3B,cAAc,IAAI,eAAe,EACjC,QAAQ,IAAI,SAAS,EACrB,gBAAgB,IAAI,iBAAiB,
|
|
1
|
+
{"version":3,"file":"autonomous.d.ts","sourceRoot":"","sources":["../../src/runtime/autonomous.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,IAAI,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AAE1E,OAAO,EAAY,KAAK,IAAI,IAAI,QAAQ,EAAE,KAAK,aAAa,EAAE,KAAK,OAAO,IAAI,WAAW,EAAE,MAAM,MAAM,CAAA;AACvG,OAAO,EACL,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C,UAAU,CAAC,aAAa,CAAC,CAAA;IAEtF,KAAY,cAAc,GAAG;QAC3B,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAA;QACvB,YAAY,CAAC,EAAE,WAAW,CAAA;QAC1B,YAAY,EAAE,KAAK,GAAG,KAAK,EAAE,CAAA;KAC9B,CAAA;IAED;;OAEG;IACH,SAAgB,yBAAyB,CAAC,cAAc,EAAE,aAAa,EAAE,GAAG,YAAY,CAAC,OAAO,QAAQ,CAAC,CA8GxG;CAgWF"}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
import { Chat, RenderedComponent } from 'llmz';
|
|
1
|
+
import { Chat, DefaultComponents, RenderedComponent } from 'llmz';
|
|
2
2
|
import { TranscriptItem } from './transcript';
|
|
3
3
|
import { AnyIncomingEvent, AnyIncomingMessage } from '@botpress/sdk/dist/bot';
|
|
4
4
|
import { BotContext } from '../context/context';
|
|
5
|
-
type Msg = {
|
|
5
|
+
export type Msg = {
|
|
6
6
|
type: string;
|
|
7
7
|
payload: Record<string, any>;
|
|
8
8
|
tags?: Record<string, any>;
|
|
9
9
|
};
|
|
10
|
+
export type Component = (typeof DefaultComponents)[keyof typeof DefaultComponents];
|
|
11
|
+
export type ComponentHandler = (message: RenderedComponent) => Promise<void> | void;
|
|
12
|
+
export type ComponentRegistration = {
|
|
13
|
+
component: Component;
|
|
14
|
+
handler?: ComponentHandler;
|
|
15
|
+
};
|
|
10
16
|
export declare class BotpressChat extends Chat {
|
|
11
17
|
private _transcript;
|
|
12
18
|
private client;
|
|
@@ -14,169 +20,44 @@ export declare class BotpressChat extends Chat {
|
|
|
14
20
|
private botId;
|
|
15
21
|
private logger;
|
|
16
22
|
private citations;
|
|
23
|
+
private componentRegistry;
|
|
17
24
|
constructor(context: BotContext);
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
type: "leaf";
|
|
34
|
-
name: string;
|
|
35
|
-
description: string;
|
|
36
|
-
aliases: never[];
|
|
37
|
-
examples: {
|
|
38
|
-
name: string;
|
|
39
|
-
description: string;
|
|
40
|
-
code: string;
|
|
41
|
-
}[];
|
|
42
|
-
leaf: {
|
|
43
|
-
props: import("@bpinternal/zui").ZodObject<{
|
|
44
|
-
url: import("@bpinternal/zui").ZodString;
|
|
45
|
-
alt: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
46
|
-
}, "strip", {
|
|
47
|
-
url: string;
|
|
48
|
-
alt?: string | undefined;
|
|
49
|
-
}, {
|
|
50
|
-
url: string;
|
|
51
|
-
alt?: string | undefined;
|
|
52
|
-
}>;
|
|
53
|
-
};
|
|
54
|
-
}> | import("llmz").Component<{
|
|
55
|
-
type: "leaf";
|
|
56
|
-
name: string;
|
|
57
|
-
description: string;
|
|
58
|
-
aliases: never[];
|
|
59
|
-
examples: {
|
|
60
|
-
name: string;
|
|
61
|
-
description: string;
|
|
62
|
-
code: string;
|
|
63
|
-
}[];
|
|
64
|
-
leaf: {
|
|
65
|
-
props: import("@bpinternal/zui").ZodObject<{
|
|
66
|
-
url: import("@bpinternal/zui").ZodString;
|
|
67
|
-
name: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
68
|
-
}, "strip", {
|
|
69
|
-
url: string;
|
|
70
|
-
name?: string | undefined;
|
|
71
|
-
}, {
|
|
72
|
-
url: string;
|
|
73
|
-
name?: string | undefined;
|
|
74
|
-
}>;
|
|
75
|
-
};
|
|
76
|
-
}> | import("llmz").Component<{
|
|
77
|
-
type: "leaf";
|
|
78
|
-
name: string;
|
|
79
|
-
description: string;
|
|
80
|
-
aliases: never[];
|
|
81
|
-
examples: {
|
|
82
|
-
name: string;
|
|
83
|
-
description: string;
|
|
84
|
-
code: string;
|
|
85
|
-
}[];
|
|
86
|
-
leaf: {
|
|
87
|
-
props: import("@bpinternal/zui").ZodObject<{
|
|
88
|
-
url: import("@bpinternal/zui").ZodString;
|
|
89
|
-
title: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
90
|
-
}, "strip", {
|
|
91
|
-
url: string;
|
|
92
|
-
title?: string | undefined;
|
|
93
|
-
}, {
|
|
94
|
-
url: string;
|
|
95
|
-
title?: string | undefined;
|
|
96
|
-
}>;
|
|
97
|
-
};
|
|
98
|
-
}> | import("llmz").Component<{
|
|
99
|
-
type: "container";
|
|
100
|
-
name: string;
|
|
101
|
-
description: string;
|
|
102
|
-
aliases: never[];
|
|
103
|
-
examples: {
|
|
104
|
-
name: string;
|
|
105
|
-
description: string;
|
|
106
|
-
code: string;
|
|
107
|
-
}[];
|
|
108
|
-
container: {
|
|
109
|
-
props: import("@bpinternal/zui").ZodObject<{
|
|
110
|
-
title: import("@bpinternal/zui").ZodString;
|
|
111
|
-
subtitle: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
112
|
-
}, "strip", {
|
|
113
|
-
title: string;
|
|
114
|
-
subtitle?: string | undefined;
|
|
115
|
-
}, {
|
|
116
|
-
title: string;
|
|
117
|
-
subtitle?: string | undefined;
|
|
118
|
-
}>;
|
|
119
|
-
children: ({
|
|
120
|
-
description: string;
|
|
121
|
-
component: {
|
|
122
|
-
type: "leaf";
|
|
123
|
-
name: string;
|
|
124
|
-
description: string;
|
|
125
|
-
aliases: never[];
|
|
126
|
-
examples: {
|
|
127
|
-
name: string;
|
|
128
|
-
description: string;
|
|
129
|
-
code: string;
|
|
130
|
-
}[];
|
|
131
|
-
leaf: {
|
|
132
|
-
props: import("@bpinternal/zui").ZodObject<{
|
|
133
|
-
url: import("@bpinternal/zui").ZodString;
|
|
134
|
-
alt: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
135
|
-
}, "strip", {
|
|
136
|
-
url: string;
|
|
137
|
-
alt?: string | undefined;
|
|
138
|
-
}, {
|
|
139
|
-
url: string;
|
|
140
|
-
alt?: string | undefined;
|
|
141
|
-
}>;
|
|
142
|
-
};
|
|
143
|
-
};
|
|
144
|
-
} | {
|
|
145
|
-
description: string;
|
|
146
|
-
component: {
|
|
147
|
-
type: "leaf";
|
|
148
|
-
description: string;
|
|
149
|
-
name: string;
|
|
150
|
-
aliases: string[];
|
|
151
|
-
examples: {
|
|
152
|
-
name: string;
|
|
153
|
-
description: string;
|
|
154
|
-
code: string;
|
|
155
|
-
}[];
|
|
156
|
-
leaf: {
|
|
157
|
-
props: import("@bpinternal/zui").ZodObject<{
|
|
158
|
-
action: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodEnum<["say", "url", "postback"]>>;
|
|
159
|
-
label: import("@bpinternal/zui").ZodString;
|
|
160
|
-
value: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
161
|
-
url: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
162
|
-
}, "strip", {
|
|
163
|
-
label: string;
|
|
164
|
-
action: "say" | "url" | "postback";
|
|
165
|
-
value?: string | undefined;
|
|
166
|
-
url?: string | undefined;
|
|
167
|
-
}, {
|
|
168
|
-
label: string;
|
|
169
|
-
value?: string | undefined;
|
|
170
|
-
action?: "say" | "url" | "postback" | undefined;
|
|
171
|
-
url?: string | undefined;
|
|
172
|
-
}>;
|
|
173
|
-
};
|
|
174
|
-
};
|
|
175
|
-
})[];
|
|
176
|
-
};
|
|
177
|
-
}>)[]>;
|
|
25
|
+
/**
|
|
26
|
+
* Register a component with an optional handler
|
|
27
|
+
*/
|
|
28
|
+
registerComponent(registration: ComponentRegistration): this;
|
|
29
|
+
/**
|
|
30
|
+
* Remove a component by name
|
|
31
|
+
*/
|
|
32
|
+
removeComponent(name: string): this;
|
|
33
|
+
/**
|
|
34
|
+
* Get all registered components
|
|
35
|
+
*/
|
|
36
|
+
getComponents(): Promise<Component[]>;
|
|
37
|
+
/**
|
|
38
|
+
* Clear the entire transcript
|
|
39
|
+
*/
|
|
178
40
|
clearTranscript(): Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
* Prepend items to the transcript
|
|
43
|
+
*/
|
|
179
44
|
prependToTranscript(items: TranscriptItem[]): Promise<void>;
|
|
45
|
+
/**
|
|
46
|
+
* Remove a message from the transcript by ID
|
|
47
|
+
*/
|
|
48
|
+
removeMessage(messageId: string): Promise<boolean>;
|
|
49
|
+
/**
|
|
50
|
+
* Remove messages from the transcript by predicate
|
|
51
|
+
*/
|
|
52
|
+
removeMessages(predicate: (item: TranscriptItem) => boolean): Promise<number>;
|
|
53
|
+
/**
|
|
54
|
+
* Get a copy of the current transcript
|
|
55
|
+
*/
|
|
56
|
+
getTranscript(): Promise<TranscriptItem[]>;
|
|
57
|
+
/**
|
|
58
|
+
* Replace the entire transcript
|
|
59
|
+
*/
|
|
60
|
+
setTranscript(items: TranscriptItem[]): Promise<void>;
|
|
180
61
|
fetchTranscript(): Promise<TranscriptItem[]>;
|
|
181
62
|
compactTranscript(): Promise<void>;
|
|
182
63
|
saveTranscript(): Promise<void>;
|
|
@@ -196,5 +77,4 @@ export declare class BotpressChat extends Chat {
|
|
|
196
77
|
}): Promise<void>;
|
|
197
78
|
addMessage(message: AnyIncomingMessage<any>): Promise<void>;
|
|
198
79
|
}
|
|
199
|
-
export {};
|
|
200
80
|
//# sourceMappingURL=chat.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../../src/runtime/chat/chat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../../src/runtime/chat/chat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAkB,iBAAiB,EAAc,MAAM,MAAM,CAAA;AAE7F,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,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AAO,CAAC;IAUxD;;OAEG;IACG,cAAc,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;IAUnF;;OAEG;IACG,aAAa,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC;IAOhD;;OAEG;IACG,aAAa,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAIrD,eAAe;IAqBf,iBAAiB;IAiDjB,cAAc;IAkCd,WAAW,CAAC,OAAO,EAAE,GAAG;IAsCxB,MAAM,CAAC,OAAO,EAAE,iBAAiB;IAmEvC;;;;OAIG;IACG,6BAA6B,CAAC,OAAO,EAAE,kBAAkB,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC;IA6BjG,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAC,GAAG,CAAC,GAAG;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,GAAG,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE;IAgBrG,UAAU,CAAC,OAAO,EAAE,kBAAkB,CAAC,GAAG,CAAC;CAuClD"}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { Message } from '@botpress/client';
|
|
2
2
|
import { z } from '@botpress/sdk';
|
|
3
3
|
export declare const DefaultMessageTypes: {
|
|
4
|
-
text: import("@
|
|
5
|
-
text: import("@
|
|
4
|
+
text: import("@botpress/sdk").ZodObject<{
|
|
5
|
+
text: import("@botpress/sdk").ZodString;
|
|
6
6
|
}, "strip", {
|
|
7
7
|
text: string;
|
|
8
8
|
}, {
|
|
9
9
|
text: string;
|
|
10
10
|
}>;
|
|
11
|
-
audio: import("@
|
|
12
|
-
audioUrl: import("@
|
|
11
|
+
audio: import("@botpress/sdk").ZodObject<{
|
|
12
|
+
audioUrl: import("@botpress/sdk").ZodString;
|
|
13
13
|
}, "strip", {
|
|
14
14
|
audioUrl: string;
|
|
15
15
|
}, {
|
|
16
16
|
audioUrl: string;
|
|
17
17
|
}>;
|
|
18
|
-
card: import("@
|
|
19
|
-
title: import("@
|
|
20
|
-
subtitle: import("@
|
|
21
|
-
imageUrl: import("@
|
|
22
|
-
actions: import("@
|
|
23
|
-
action: import("@
|
|
24
|
-
label: import("@
|
|
25
|
-
value: import("@
|
|
18
|
+
card: import("@botpress/sdk").ZodObject<{
|
|
19
|
+
title: import("@botpress/sdk").ZodString;
|
|
20
|
+
subtitle: import("@botpress/sdk").ZodOptional<import("@botpress/sdk").ZodString>;
|
|
21
|
+
imageUrl: import("@botpress/sdk").ZodOptional<import("@botpress/sdk").ZodString>;
|
|
22
|
+
actions: import("@botpress/sdk").ZodArray<import("@botpress/sdk").ZodObject<{
|
|
23
|
+
action: import("@botpress/sdk").ZodEnum<["postback", "url", "say"]>;
|
|
24
|
+
label: import("@botpress/sdk").ZodString;
|
|
25
|
+
value: import("@botpress/sdk").ZodString;
|
|
26
26
|
}, "strip", {
|
|
27
27
|
value: string;
|
|
28
28
|
action: "url" | "postback" | "say";
|
|
@@ -51,22 +51,22 @@ export declare const DefaultMessageTypes: {
|
|
|
51
51
|
subtitle?: string | undefined;
|
|
52
52
|
imageUrl?: string | undefined;
|
|
53
53
|
}>;
|
|
54
|
-
image: import("@
|
|
55
|
-
imageUrl: import("@
|
|
54
|
+
image: import("@botpress/sdk").ZodObject<{
|
|
55
|
+
imageUrl: import("@botpress/sdk").ZodString;
|
|
56
56
|
}, "strip", {
|
|
57
57
|
imageUrl: string;
|
|
58
58
|
}, {
|
|
59
59
|
imageUrl: string;
|
|
60
60
|
}>;
|
|
61
|
-
carousel: import("@
|
|
62
|
-
items: import("@
|
|
63
|
-
title: import("@
|
|
64
|
-
subtitle: import("@
|
|
65
|
-
imageUrl: import("@
|
|
66
|
-
actions: import("@
|
|
67
|
-
action: import("@
|
|
68
|
-
label: import("@
|
|
69
|
-
value: import("@
|
|
61
|
+
carousel: import("@botpress/sdk").ZodObject<{
|
|
62
|
+
items: import("@botpress/sdk").ZodArray<import("@botpress/sdk").ZodObject<{
|
|
63
|
+
title: import("@botpress/sdk").ZodString;
|
|
64
|
+
subtitle: import("@botpress/sdk").ZodOptional<import("@botpress/sdk").ZodString>;
|
|
65
|
+
imageUrl: import("@botpress/sdk").ZodOptional<import("@botpress/sdk").ZodString>;
|
|
66
|
+
actions: import("@botpress/sdk").ZodArray<import("@botpress/sdk").ZodObject<{
|
|
67
|
+
action: import("@botpress/sdk").ZodEnum<["postback", "url", "say"]>;
|
|
68
|
+
label: import("@botpress/sdk").ZodString;
|
|
69
|
+
value: import("@botpress/sdk").ZodString;
|
|
70
70
|
}, "strip", {
|
|
71
71
|
value: string;
|
|
72
72
|
action: "url" | "postback" | "say";
|
|
@@ -118,11 +118,11 @@ export declare const DefaultMessageTypes: {
|
|
|
118
118
|
imageUrl?: string | undefined;
|
|
119
119
|
}[];
|
|
120
120
|
}>;
|
|
121
|
-
choice: import("@
|
|
122
|
-
text: import("@
|
|
123
|
-
options: import("@
|
|
124
|
-
label: import("@
|
|
125
|
-
value: import("@
|
|
121
|
+
choice: import("@botpress/sdk").ZodObject<{
|
|
122
|
+
text: import("@botpress/sdk").ZodString;
|
|
123
|
+
options: import("@botpress/sdk").ZodArray<import("@botpress/sdk").ZodObject<{
|
|
124
|
+
label: import("@botpress/sdk").ZodString;
|
|
125
|
+
value: import("@botpress/sdk").ZodString;
|
|
126
126
|
}, "strip", {
|
|
127
127
|
value: string;
|
|
128
128
|
label: string;
|
|
@@ -143,11 +143,11 @@ export declare const DefaultMessageTypes: {
|
|
|
143
143
|
}[];
|
|
144
144
|
text: string;
|
|
145
145
|
}>;
|
|
146
|
-
dropdown: import("@
|
|
147
|
-
text: import("@
|
|
148
|
-
options: import("@
|
|
149
|
-
label: import("@
|
|
150
|
-
value: import("@
|
|
146
|
+
dropdown: import("@botpress/sdk").ZodObject<{
|
|
147
|
+
text: import("@botpress/sdk").ZodString;
|
|
148
|
+
options: import("@botpress/sdk").ZodArray<import("@botpress/sdk").ZodObject<{
|
|
149
|
+
label: import("@botpress/sdk").ZodString;
|
|
150
|
+
value: import("@botpress/sdk").ZodString;
|
|
151
151
|
}, "strip", {
|
|
152
152
|
value: string;
|
|
153
153
|
label: string;
|
|
@@ -168,9 +168,9 @@ export declare const DefaultMessageTypes: {
|
|
|
168
168
|
}[];
|
|
169
169
|
text: string;
|
|
170
170
|
}>;
|
|
171
|
-
file: import("@
|
|
172
|
-
fileUrl: import("@
|
|
173
|
-
title: import("@
|
|
171
|
+
file: import("@botpress/sdk").ZodObject<{
|
|
172
|
+
fileUrl: import("@botpress/sdk").ZodString;
|
|
173
|
+
title: import("@botpress/sdk").ZodOptional<import("@botpress/sdk").ZodString>;
|
|
174
174
|
}, "strip", {
|
|
175
175
|
fileUrl: string;
|
|
176
176
|
title?: string | undefined;
|
|
@@ -178,11 +178,11 @@ export declare const DefaultMessageTypes: {
|
|
|
178
178
|
fileUrl: string;
|
|
179
179
|
title?: string | undefined;
|
|
180
180
|
}>;
|
|
181
|
-
location: import("@
|
|
182
|
-
latitude: import("@
|
|
183
|
-
longitude: import("@
|
|
184
|
-
address: import("@
|
|
185
|
-
title: import("@
|
|
181
|
+
location: import("@botpress/sdk").ZodObject<{
|
|
182
|
+
latitude: import("@botpress/sdk").ZodNumber;
|
|
183
|
+
longitude: import("@botpress/sdk").ZodNumber;
|
|
184
|
+
address: import("@botpress/sdk").ZodOptional<import("@botpress/sdk").ZodString>;
|
|
185
|
+
title: import("@botpress/sdk").ZodOptional<import("@botpress/sdk").ZodString>;
|
|
186
186
|
}, "strip", {
|
|
187
187
|
latitude: number;
|
|
188
188
|
longitude: number;
|
|
@@ -194,18 +194,18 @@ export declare const DefaultMessageTypes: {
|
|
|
194
194
|
title?: string | undefined;
|
|
195
195
|
address?: string | undefined;
|
|
196
196
|
}>;
|
|
197
|
-
video: import("@
|
|
198
|
-
videoUrl: import("@
|
|
197
|
+
video: import("@botpress/sdk").ZodObject<{
|
|
198
|
+
videoUrl: import("@botpress/sdk").ZodString;
|
|
199
199
|
}, "strip", {
|
|
200
200
|
videoUrl: string;
|
|
201
201
|
}, {
|
|
202
202
|
videoUrl: string;
|
|
203
203
|
}>;
|
|
204
|
-
bloc: import("@
|
|
205
|
-
items: import("@
|
|
206
|
-
type: import("@
|
|
207
|
-
payload: import("@
|
|
208
|
-
text: import("@
|
|
204
|
+
bloc: import("@botpress/sdk").ZodObject<{
|
|
205
|
+
items: import("@botpress/sdk").ZodArray<import("@botpress/sdk").ZodUnion<[import("@botpress/sdk").ZodObject<{
|
|
206
|
+
type: import("@botpress/sdk").ZodLiteral<"text">;
|
|
207
|
+
payload: import("@botpress/sdk").ZodObject<{
|
|
208
|
+
text: import("@botpress/sdk").ZodString;
|
|
209
209
|
}, "strip", {
|
|
210
210
|
text: string;
|
|
211
211
|
}, {
|
|
@@ -221,10 +221,10 @@ export declare const DefaultMessageTypes: {
|
|
|
221
221
|
payload: {
|
|
222
222
|
text: string;
|
|
223
223
|
};
|
|
224
|
-
}>, import("@
|
|
225
|
-
type: import("@
|
|
226
|
-
payload: import("@
|
|
227
|
-
markdown: import("@
|
|
224
|
+
}>, import("@botpress/sdk").ZodObject<{
|
|
225
|
+
type: import("@botpress/sdk").ZodLiteral<"markdown">;
|
|
226
|
+
payload: import("@botpress/sdk").ZodObject<{
|
|
227
|
+
markdown: import("@botpress/sdk").ZodString;
|
|
228
228
|
}, "strip", {
|
|
229
229
|
markdown: string;
|
|
230
230
|
}, {
|
|
@@ -240,10 +240,10 @@ export declare const DefaultMessageTypes: {
|
|
|
240
240
|
payload: {
|
|
241
241
|
markdown: string;
|
|
242
242
|
};
|
|
243
|
-
}>, import("@
|
|
244
|
-
type: import("@
|
|
245
|
-
payload: import("@
|
|
246
|
-
imageUrl: import("@
|
|
243
|
+
}>, import("@botpress/sdk").ZodObject<{
|
|
244
|
+
type: import("@botpress/sdk").ZodLiteral<"image">;
|
|
245
|
+
payload: import("@botpress/sdk").ZodObject<{
|
|
246
|
+
imageUrl: import("@botpress/sdk").ZodString;
|
|
247
247
|
}, "strip", {
|
|
248
248
|
imageUrl: string;
|
|
249
249
|
}, {
|
|
@@ -259,10 +259,10 @@ export declare const DefaultMessageTypes: {
|
|
|
259
259
|
payload: {
|
|
260
260
|
imageUrl: string;
|
|
261
261
|
};
|
|
262
|
-
}>, import("@
|
|
263
|
-
type: import("@
|
|
264
|
-
payload: import("@
|
|
265
|
-
audioUrl: import("@
|
|
262
|
+
}>, import("@botpress/sdk").ZodObject<{
|
|
263
|
+
type: import("@botpress/sdk").ZodLiteral<"audio">;
|
|
264
|
+
payload: import("@botpress/sdk").ZodObject<{
|
|
265
|
+
audioUrl: import("@botpress/sdk").ZodString;
|
|
266
266
|
}, "strip", {
|
|
267
267
|
audioUrl: string;
|
|
268
268
|
}, {
|
|
@@ -278,10 +278,10 @@ export declare const DefaultMessageTypes: {
|
|
|
278
278
|
payload: {
|
|
279
279
|
audioUrl: string;
|
|
280
280
|
};
|
|
281
|
-
}>, import("@
|
|
282
|
-
type: import("@
|
|
283
|
-
payload: import("@
|
|
284
|
-
videoUrl: import("@
|
|
281
|
+
}>, import("@botpress/sdk").ZodObject<{
|
|
282
|
+
type: import("@botpress/sdk").ZodLiteral<"video">;
|
|
283
|
+
payload: import("@botpress/sdk").ZodObject<{
|
|
284
|
+
videoUrl: import("@botpress/sdk").ZodString;
|
|
285
285
|
}, "strip", {
|
|
286
286
|
videoUrl: string;
|
|
287
287
|
}, {
|
|
@@ -297,11 +297,11 @@ export declare const DefaultMessageTypes: {
|
|
|
297
297
|
payload: {
|
|
298
298
|
videoUrl: string;
|
|
299
299
|
};
|
|
300
|
-
}>, import("@
|
|
301
|
-
type: import("@
|
|
302
|
-
payload: import("@
|
|
303
|
-
fileUrl: import("@
|
|
304
|
-
title: import("@
|
|
300
|
+
}>, import("@botpress/sdk").ZodObject<{
|
|
301
|
+
type: import("@botpress/sdk").ZodLiteral<"file">;
|
|
302
|
+
payload: import("@botpress/sdk").ZodObject<{
|
|
303
|
+
fileUrl: import("@botpress/sdk").ZodString;
|
|
304
|
+
title: import("@botpress/sdk").ZodOptional<import("@botpress/sdk").ZodString>;
|
|
305
305
|
}, "strip", {
|
|
306
306
|
fileUrl: string;
|
|
307
307
|
title?: string | undefined;
|
|
@@ -321,13 +321,13 @@ export declare const DefaultMessageTypes: {
|
|
|
321
321
|
fileUrl: string;
|
|
322
322
|
title?: string | undefined;
|
|
323
323
|
};
|
|
324
|
-
}>, import("@
|
|
325
|
-
type: import("@
|
|
326
|
-
payload: import("@
|
|
327
|
-
latitude: import("@
|
|
328
|
-
longitude: import("@
|
|
329
|
-
address: import("@
|
|
330
|
-
title: import("@
|
|
324
|
+
}>, import("@botpress/sdk").ZodObject<{
|
|
325
|
+
type: import("@botpress/sdk").ZodLiteral<"location">;
|
|
326
|
+
payload: import("@botpress/sdk").ZodObject<{
|
|
327
|
+
latitude: import("@botpress/sdk").ZodNumber;
|
|
328
|
+
longitude: import("@botpress/sdk").ZodNumber;
|
|
329
|
+
address: import("@botpress/sdk").ZodOptional<import("@botpress/sdk").ZodString>;
|
|
330
|
+
title: import("@botpress/sdk").ZodOptional<import("@botpress/sdk").ZodString>;
|
|
331
331
|
}, "strip", {
|
|
332
332
|
latitude: number;
|
|
333
333
|
longitude: number;
|
|
@@ -32,15 +32,15 @@ export type TranscriptSummaryMessage = {
|
|
|
32
32
|
attachments?: Array<TranscriptAttachment>;
|
|
33
33
|
};
|
|
34
34
|
export type TranscriptItem = TranscriptAssistantMessage | TranscriptUserMessage | TranscriptEventMessage | TranscriptSummaryMessage;
|
|
35
|
-
export declare const TranscriptSchema: import("@
|
|
36
|
-
id: import("@
|
|
37
|
-
role: import("@
|
|
38
|
-
name: import("@
|
|
39
|
-
createdAt: import("@
|
|
40
|
-
content: import("@
|
|
41
|
-
attachments: import("@
|
|
42
|
-
type: import("@
|
|
43
|
-
url: import("@
|
|
35
|
+
export declare const TranscriptSchema: import("@botpress/sdk").ZodArray<import("@botpress/sdk").ZodObject<{
|
|
36
|
+
id: import("@botpress/sdk").ZodString;
|
|
37
|
+
role: import("@botpress/sdk").ZodUnion<[import("@botpress/sdk").ZodLiteral<"assistant">, import("@botpress/sdk").ZodLiteral<"user">, import("@botpress/sdk").ZodLiteral<"event">, import("@botpress/sdk").ZodLiteral<"summary">]>;
|
|
38
|
+
name: import("@botpress/sdk").ZodOptional<import("@botpress/sdk").ZodString>;
|
|
39
|
+
createdAt: import("@botpress/sdk").ZodOptional<import("@botpress/sdk").ZodString>;
|
|
40
|
+
content: import("@botpress/sdk").ZodOptional<import("@botpress/sdk").ZodString>;
|
|
41
|
+
attachments: import("@botpress/sdk").ZodOptional<import("@botpress/sdk").ZodArray<import("@botpress/sdk").ZodObject<{
|
|
42
|
+
type: import("@botpress/sdk").ZodLiteral<"image">;
|
|
43
|
+
url: import("@botpress/sdk").ZodString;
|
|
44
44
|
}, "strip", {
|
|
45
45
|
url: string;
|
|
46
46
|
type: "image";
|
|
@@ -48,7 +48,7 @@ export declare const TranscriptSchema: import("@bpinternal/zui").ZodArray<import
|
|
|
48
48
|
url: string;
|
|
49
49
|
type: "image";
|
|
50
50
|
}>, "many">>;
|
|
51
|
-
payload: import("@
|
|
51
|
+
payload: import("@botpress/sdk").ZodOptional<import("@botpress/sdk").ZodUnknown>;
|
|
52
52
|
}, "strip", {
|
|
53
53
|
id: string;
|
|
54
54
|
role: "assistant" | "user" | "event" | "summary";
|