@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
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import type { ConversationDefinitions as CD } from '@botpress/runtime/_types/conversations';
|
|
1
|
+
import type { ConversationDefinitions as CD, ConversationRoutableEvents as CRE } from '@botpress/runtime/_types/conversations';
|
|
2
2
|
export type ConversationDefinitions = CD extends never ? never : CD;
|
|
3
|
+
/**
|
|
4
|
+
* Events that can be routed to conversations (events with conversationId property).
|
|
5
|
+
* Keyed by channel, containing only the event names that have conversationId.
|
|
6
|
+
*/
|
|
7
|
+
export type ConversationRoutableEvents = CRE extends never ? never : CRE;
|
|
3
8
|
export type ConversationStates = {
|
|
4
9
|
[K in keyof ConversationDefinitions]: ConversationDefinitions[K]['state'];
|
|
5
10
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversations.d.ts","sourceRoot":"","sources":["../../src/_types/conversations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,IAAI,EAAE,EAAE,MAAM,wCAAwC,CAAA;
|
|
1
|
+
{"version":3,"file":"conversations.d.ts","sourceRoot":"","sources":["../../src/_types/conversations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,IAAI,EAAE,EAAE,0BAA0B,IAAI,GAAG,EAAE,MAAM,wCAAwC,CAAA;AAG9H,MAAM,MAAM,uBAAuB,GAAG,EAAE,SAAS,KAAK,GAAG,KAAK,GAAG,EAAE,CAAA;AAEnE;;;GAGG;AACH,MAAM,MAAM,0BAA0B,GAAG,GAAG,SAAS,KAAK,GAAG,KAAK,GAAG,GAAG,CAAA;AAExE,MAAM,MAAM,kBAAkB,GAAG;KAC9B,CAAC,IAAI,MAAM,uBAAuB,GAAG,uBAAuB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;CAC1E,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG;KAChC,CAAC,IAAI,MAAM,uBAAuB,GAAG,uBAAuB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;CAC5E,CAAA"}
|
package/dist/definition.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
|
|
|
@@ -43801,12 +43801,19 @@ var init_conversation = __esm({
|
|
|
43801
43801
|
})(Typings2 || (Typings2 = {}));
|
|
43802
43802
|
BaseConversation = class {
|
|
43803
43803
|
channel;
|
|
43804
|
+
/**
|
|
43805
|
+
* Array of event names this conversation listens to.
|
|
43806
|
+
* Only events with conversationId property are allowed.
|
|
43807
|
+
* Empty array means no events (only messages).
|
|
43808
|
+
*/
|
|
43809
|
+
events;
|
|
43804
43810
|
/** @internal */
|
|
43805
43811
|
schema;
|
|
43806
43812
|
#handler;
|
|
43807
43813
|
#startFromTrigger;
|
|
43808
43814
|
constructor(props) {
|
|
43809
43815
|
this.channel = props.channel;
|
|
43816
|
+
this.events = props.events ?? [];
|
|
43810
43817
|
this.schema = props.state ?? z13.object({}).passthrough();
|
|
43811
43818
|
this.#handler = props.handler;
|
|
43812
43819
|
if (props.startFromTrigger) {
|
|
@@ -43819,22 +43826,17 @@ var init_conversation = __esm({
|
|
|
43819
43826
|
}
|
|
43820
43827
|
/** @internal */
|
|
43821
43828
|
getDefinition() {
|
|
43822
|
-
|
|
43823
|
-
|
|
43824
|
-
|
|
43825
|
-
|
|
43826
|
-
|
|
43827
|
-
} else if (Array.isArray(this.channel)) {
|
|
43828
|
-
return {
|
|
43829
|
-
type: "conversation",
|
|
43830
|
-
channel: this.channel
|
|
43831
|
-
};
|
|
43832
|
-
} else {
|
|
43829
|
+
const base = {
|
|
43830
|
+
type: "conversation",
|
|
43831
|
+
channel: this.channel === "*" ? "*" : Array.isArray(this.channel) ? this.channel : this.channel
|
|
43832
|
+
};
|
|
43833
|
+
if (this.events.length > 0) {
|
|
43833
43834
|
return {
|
|
43834
|
-
|
|
43835
|
-
|
|
43835
|
+
...base,
|
|
43836
|
+
events: [...this.events]
|
|
43836
43837
|
};
|
|
43837
43838
|
}
|
|
43839
|
+
return base;
|
|
43838
43840
|
}
|
|
43839
43841
|
/** @internal */
|
|
43840
43842
|
async [ConversationHandler]() {
|