@botpress/runtime 1.11.1 → 1.11.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.
- package/dist/_types/conversations.d.ts +6 -1
- package/dist/_types/conversations.d.ts.map +1 -1
- package/dist/definition.js +16 -14
- package/dist/definition.js.map +2 -2
- package/dist/internal.js +16 -14
- package/dist/internal.js.map +2 -2
- package/dist/library.js +16 -14
- package/dist/library.js.map +2 -2
- package/dist/primitives/conversation.d.ts +84 -15
- package/dist/primitives/conversation.d.ts.map +1 -1
- package/dist/primitives/definition.d.ts +6 -0
- package/dist/primitives/definition.d.ts.map +1 -1
- package/dist/runtime/handlers/event.d.ts.map +1 -1
- package/dist/runtime.js +25 -16
- package/dist/runtime.js.map +2 -2
- package/package.json +1 -1
package/dist/library.js
CHANGED
|
@@ -48,7 +48,7 @@ var init_define_BUILD = __esm({
|
|
|
48
48
|
var define_PACKAGE_VERSIONS_default;
|
|
49
49
|
var init_define_PACKAGE_VERSIONS = __esm({
|
|
50
50
|
"<define:__PACKAGE_VERSIONS__>"() {
|
|
51
|
-
define_PACKAGE_VERSIONS_default = { runtime: "1.11.
|
|
51
|
+
define_PACKAGE_VERSIONS_default = { runtime: "1.11.2", adk: "1.11.2", sdk: "4.20.2", llmz: "0.0.33", zai: "2.5.0", cognitive: "0.2.0" };
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
54
|
|
|
@@ -38044,12 +38044,19 @@ var init_conversation = __esm({
|
|
|
38044
38044
|
})(Typings4 || (Typings4 = {}));
|
|
38045
38045
|
BaseConversation = class {
|
|
38046
38046
|
channel;
|
|
38047
|
+
/**
|
|
38048
|
+
* Array of event names this conversation listens to.
|
|
38049
|
+
* Only events with conversationId property are allowed.
|
|
38050
|
+
* Empty array means no events (only messages).
|
|
38051
|
+
*/
|
|
38052
|
+
events;
|
|
38047
38053
|
/** @internal */
|
|
38048
38054
|
schema;
|
|
38049
38055
|
#handler;
|
|
38050
38056
|
#startFromTrigger;
|
|
38051
38057
|
constructor(props) {
|
|
38052
38058
|
this.channel = props.channel;
|
|
38059
|
+
this.events = props.events ?? [];
|
|
38053
38060
|
this.schema = props.state ?? z19.object({}).passthrough();
|
|
38054
38061
|
this.#handler = props.handler;
|
|
38055
38062
|
if (props.startFromTrigger) {
|
|
@@ -38062,22 +38069,17 @@ var init_conversation = __esm({
|
|
|
38062
38069
|
}
|
|
38063
38070
|
/** @internal */
|
|
38064
38071
|
getDefinition() {
|
|
38065
|
-
|
|
38066
|
-
|
|
38067
|
-
|
|
38068
|
-
|
|
38069
|
-
|
|
38070
|
-
} else if (Array.isArray(this.channel)) {
|
|
38071
|
-
return {
|
|
38072
|
-
type: "conversation",
|
|
38073
|
-
channel: this.channel
|
|
38074
|
-
};
|
|
38075
|
-
} else {
|
|
38072
|
+
const base = {
|
|
38073
|
+
type: "conversation",
|
|
38074
|
+
channel: this.channel === "*" ? "*" : Array.isArray(this.channel) ? this.channel : this.channel
|
|
38075
|
+
};
|
|
38076
|
+
if (this.events.length > 0) {
|
|
38076
38077
|
return {
|
|
38077
|
-
|
|
38078
|
-
|
|
38078
|
+
...base,
|
|
38079
|
+
events: [...this.events]
|
|
38079
38080
|
};
|
|
38080
38081
|
}
|
|
38082
|
+
return base;
|
|
38081
38083
|
}
|
|
38082
38084
|
/** @internal */
|
|
38083
38085
|
async [ConversationHandler]() {
|