@botpress/runtime 1.13.0 → 1.13.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/definition.js +25 -4
- package/dist/definition.js.map +2 -2
- package/dist/internal.js +25 -4
- package/dist/internal.js.map +2 -2
- package/dist/library.js +25 -4
- package/dist/library.js.map +2 -2
- package/dist/primitives/conversation-instance.d.ts +7 -1
- package/dist/primitives/conversation-instance.d.ts.map +1 -1
- package/dist/runtime/handlers/conversation.d.ts.map +1 -1
- package/dist/runtime/handlers/event.d.ts.map +1 -1
- package/dist/runtime.js +45 -6
- 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.13.
|
|
51
|
+
define_PACKAGE_VERSIONS_default = { runtime: "1.13.2", adk: "1.13.2", sdk: "5.0.2", llmz: "0.0.35", zai: "2.5.5", cognitive: "0.3.3" };
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
54
|
|
|
@@ -38113,10 +38113,16 @@ var init_conversation_instance = __esm({
|
|
|
38113
38113
|
init_define_BUILD();
|
|
38114
38114
|
init_define_PACKAGE_VERSIONS();
|
|
38115
38115
|
init_runtime2();
|
|
38116
|
-
BaseConversationInstance = class {
|
|
38116
|
+
BaseConversationInstance = class _BaseConversationInstance {
|
|
38117
38117
|
id;
|
|
38118
38118
|
channel;
|
|
38119
38119
|
integration;
|
|
38120
|
+
/**
|
|
38121
|
+
* The integration alias (e.g., "telegram1", "telegram2").
|
|
38122
|
+
* This is useful when you have multiple instances of the same integration
|
|
38123
|
+
* with different configurations (multi-integration setup).
|
|
38124
|
+
*/
|
|
38125
|
+
alias;
|
|
38120
38126
|
conversation;
|
|
38121
38127
|
// @internal
|
|
38122
38128
|
client;
|
|
@@ -38124,10 +38130,25 @@ var init_conversation_instance = __esm({
|
|
|
38124
38130
|
TrackedState;
|
|
38125
38131
|
// @internal
|
|
38126
38132
|
TrackedTags;
|
|
38127
|
-
|
|
38133
|
+
/**
|
|
38134
|
+
* Extract integration alias from tags (e.g., "telegram3:id" -> "telegram3")
|
|
38135
|
+
* @internal
|
|
38136
|
+
*/
|
|
38137
|
+
static extractAliasFromTags(tags) {
|
|
38138
|
+
if (!tags) return void 0;
|
|
38139
|
+
for (const tagKey of Object.keys(tags)) {
|
|
38140
|
+
const colonIndex = tagKey.indexOf(":");
|
|
38141
|
+
if (colonIndex > 0) {
|
|
38142
|
+
return tagKey.substring(0, colonIndex);
|
|
38143
|
+
}
|
|
38144
|
+
}
|
|
38145
|
+
return void 0;
|
|
38146
|
+
}
|
|
38147
|
+
constructor(conversation, client2, alias) {
|
|
38128
38148
|
this.id = conversation.id;
|
|
38129
|
-
this.channel = `${conversation.integration}.${conversation.channel}`;
|
|
38130
38149
|
this.integration = conversation.integration;
|
|
38150
|
+
this.alias = alias ?? _BaseConversationInstance.extractAliasFromTags(conversation.tags) ?? conversation.integration;
|
|
38151
|
+
this.channel = `${this.alias}.${conversation.channel}`;
|
|
38131
38152
|
this.conversation = conversation;
|
|
38132
38153
|
this.client = client2;
|
|
38133
38154
|
const states = context.get("states", { optional: true });
|