@botpress/runtime 1.11.1 → 1.11.3

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/internal.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.1", adk: "1.11.1", sdk: "4.20.2", llmz: "0.0.33", zai: "2.5.0", cognitive: "0.2.0" };
51
+ define_PACKAGE_VERSIONS_default = { runtime: "1.11.3", adk: "1.11.3", sdk: "4.20.2", llmz: "0.0.33", zai: "2.5.0", cognitive: "0.2.0" };
52
52
  }
53
53
  });
54
54
 
@@ -37085,12 +37085,19 @@ var init_conversation = __esm({
37085
37085
  })(Typings4 || (Typings4 = {}));
37086
37086
  BaseConversation = class {
37087
37087
  channel;
37088
+ /**
37089
+ * Array of event names this conversation listens to.
37090
+ * Only events with conversationId property are allowed.
37091
+ * Empty array means no events (only messages).
37092
+ */
37093
+ events;
37088
37094
  /** @internal */
37089
37095
  schema;
37090
37096
  #handler;
37091
37097
  #startFromTrigger;
37092
37098
  constructor(props) {
37093
37099
  this.channel = props.channel;
37100
+ this.events = props.events ?? [];
37094
37101
  this.schema = props.state ?? z16.object({}).passthrough();
37095
37102
  this.#handler = props.handler;
37096
37103
  if (props.startFromTrigger) {
@@ -37103,22 +37110,17 @@ var init_conversation = __esm({
37103
37110
  }
37104
37111
  /** @internal */
37105
37112
  getDefinition() {
37106
- if (this.channel === "*") {
37107
- return {
37108
- type: "conversation",
37109
- channel: "*"
37110
- };
37111
- } else if (Array.isArray(this.channel)) {
37112
- return {
37113
- type: "conversation",
37114
- channel: this.channel
37115
- };
37116
- } else {
37113
+ const base = {
37114
+ type: "conversation",
37115
+ channel: this.channel === "*" ? "*" : Array.isArray(this.channel) ? this.channel : this.channel
37116
+ };
37117
+ if (this.events.length > 0) {
37117
37118
  return {
37118
- type: "conversation",
37119
- channel: this.channel
37119
+ ...base,
37120
+ events: [...this.events]
37120
37121
  };
37121
37122
  }
37123
+ return base;
37122
37124
  }
37123
37125
  /** @internal */
37124
37126
  async [ConversationHandler]() {