@botpress/runtime 1.13.10 → 1.13.11
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 +42 -7
- package/dist/definition.js.map +2 -2
- package/dist/internal.js +42 -7
- package/dist/internal.js.map +2 -2
- package/dist/library.js +42 -7
- package/dist/library.js.map +2 -2
- package/dist/runtime/context/context.d.ts +18 -0
- package/dist/runtime/context/context.d.ts.map +1 -1
- package/dist/runtime/handlers/trigger.d.ts.map +1 -1
- package/dist/runtime/tracked-tags.d.ts +2 -0
- package/dist/runtime/tracked-tags.d.ts.map +1 -1
- package/dist/runtime.js +56 -19
- package/dist/runtime.js.map +3 -3
- package/package.json +1 -1
|
@@ -74,5 +74,23 @@ export declare const context: {
|
|
|
74
74
|
optional?: boolean;
|
|
75
75
|
}) => Required<BotContext>[T];
|
|
76
76
|
set: (key: keyof BotContext, value: any) => void;
|
|
77
|
+
/**
|
|
78
|
+
* Set a default context that will be used as a fallback when no AsyncLocalStorage context is active.
|
|
79
|
+
* This is useful for testing and script execution where code runs outside of request handlers.
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* ```typescript
|
|
83
|
+
* context.setDefaultContext({
|
|
84
|
+
* botId: 'my-bot',
|
|
85
|
+
* integrations: agentRegistry.integrations,
|
|
86
|
+
* interfaces: agentRegistry.interfaces,
|
|
87
|
+
* })
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
setDefaultContext: (data: Partial<BotContext>) => void;
|
|
91
|
+
/**
|
|
92
|
+
* Clear the default context.
|
|
93
|
+
*/
|
|
94
|
+
clearDefaultContext: () => void;
|
|
77
95
|
};
|
|
78
96
|
//# sourceMappingURL=context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/runtime/context/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,MAAM,CAA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OAAO,CAAC,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAA;IAClC,QAAQ,CAAC,EAAE,QAAQ,CAAA;IACnB,sBAAsB,CAAC,EAAE,sBAAsB,CAAA;IAC/C,YAAY,CAAC,EAAE,mBAAmB,CAAA;IAClC,UAAU,CAAC,EAAE,mBAAmB,EAAE,CAAA;IAClC,YAAY,CAAC,EAAE,qBAAqB,EAAE,CAAA;IACtC,IAAI,CAAC,EAAE,YAAY,CAAA;IACnB,MAAM,EAAE,YAAY,EAAE,CAAA;IACtB,IAAI,EAAE,WAAW,EAAE,CAAA;IACnB,OAAO,EAAE;QACP,WAAW,EAAE,MAAM,CAAA;QACnB,UAAU,EAAE,MAAM,CAAA;QAClB,6BAA6B,EAAE,MAAM,MAAM,CAAA;KAC5C,CAAA;IACD,qBAAqB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAClC,cAAc,EAAE,cAAc,CAAA;CAC/B,CAAA;AAcD,eAAO,MAAM,OAAO;sBACA,UAAU;UAItB,OAAO,QAAQ,UAAU,YAAY,MAAM,OAAO;kBAc5C,UAAU;UAMhB,CAAC,SAAS,MAAM,UAAU,wCACzB,CAAC,SACC;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,KAC5B,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;eAsBf,MAAM,UAAU,SAAS,GAAG;IAMvC;;;;;;;;;;;;OAYG;8BACuB,OAAO,CAAC,UAAU,CAAC;IAI7C;;OAEG;;CAIJ,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trigger.d.ts","sourceRoot":"","sources":["../../../src/runtime/handlers/trigger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAA;AAK9E,eAAO,MAAM,KAAK,GAAI,KAAK,iBAAiB,
|
|
1
|
+
{"version":3,"file":"trigger.d.ts","sourceRoot":"","sources":["../../../src/runtime/handlers/trigger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAA;AAK9E,eAAO,MAAM,KAAK,GAAI,KAAK,iBAAiB,SA4D3C,CAAA"}
|
|
@@ -3,6 +3,8 @@ import { Client } from '@botpress/client';
|
|
|
3
3
|
* TrackedTags manages tags for bot, user, conversation, and workflow entities.
|
|
4
4
|
* Tags are key-value pairs where values are strings or undefined.
|
|
5
5
|
* Changes are tracked and persisted automatically.
|
|
6
|
+
*
|
|
7
|
+
* Note: System tags (containing ':') are read-only and will be ignored during saves and dirty checks.
|
|
6
8
|
*/
|
|
7
9
|
export declare class TrackedTags {
|
|
8
10
|
type: 'bot' | 'user' | 'conversation' | 'workflow';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tracked-tags.d.ts","sourceRoot":"","sources":["../../src/runtime/tracked-tags.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"tracked-tags.d.ts","sourceRoot":"","sources":["../../src/runtime/tracked-tags.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAYzC;;;;;;GAMG;AACH,qBAAa,WAAW;IACtB,IAAI,EAAE,KAAK,GAAG,MAAM,GAAG,cAAc,GAAG,UAAU,CAAA;IAClD,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,MAAM,CAAA;IAEd,OAAO,CAAC,KAAK,CAAyC;IACtD,OAAO,CAAC,YAAY,CAAyC;IAC7D,OAAO,CAAC,OAAO,CAAiB;IAChC,OAAO,CAAC,OAAO,CAAiB;IAChC,OAAO,CAAC,UAAU,CAAiB;IACnC,OAAO,CAAC,eAAe,CAAY;IAEnC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAiB;IAC1C,OAAO,CAAC,MAAM,CAAC,aAAa,CAAiB;IAC7C,OAAO,CAAC,MAAM,CAAC,aAAa,CAAY;IAExC,OAAO;WAMO,MAAM,CAAC,KAAK,EAAE;QAC1B,IAAI,EAAE,KAAK,GAAG,MAAM,GAAG,cAAc,GAAG,UAAU,CAAA;QAClD,EAAE,EAAE,MAAM,CAAA;QACV,MAAM,EAAE,MAAM,CAAA;QACd,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAA;KACjD,GAAG,WAAW;WA4BK,YAAY;WAkCZ,OAAO;WA6Db,SAAS;IAIV,IAAI,CAAC,KAAK,GAAE,OAAe;IAqB3B,IAAI;IAqCV,OAAO,IAAI,OAAO;IAsBzB,IAAW,IAAI,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAmBpD;IAED,IAAW,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,EAExD;YAEa,SAAS;YAqBT,WAAW;CAyB1B"}
|
package/dist/runtime.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.11", adk: "1.13.11", sdk: "5.0.2", llmz: "0.0.37", zai: "2.5.6", cognitive: "0.3.3" };
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
54
|
|
|
@@ -14851,7 +14851,7 @@ var init_assets = __esm({
|
|
|
14851
14851
|
|
|
14852
14852
|
// src/runtime/context/context.ts
|
|
14853
14853
|
import { AsyncLocalStorage as AsyncLocalStorage2 } from "async_hooks";
|
|
14854
|
-
var storage, context2;
|
|
14854
|
+
var storage, defaultContext, context2;
|
|
14855
14855
|
var init_context3 = __esm({
|
|
14856
14856
|
"src/runtime/context/context.ts"() {
|
|
14857
14857
|
"use strict";
|
|
@@ -14859,6 +14859,7 @@ var init_context3 = __esm({
|
|
|
14859
14859
|
init_define_PACKAGE_VERSIONS();
|
|
14860
14860
|
init_singletons();
|
|
14861
14861
|
storage = getSingleton("__ADK_GLOBAL_CTX_STORAGE", () => new AsyncLocalStorage2());
|
|
14862
|
+
defaultContext = getSingleton("__ADK_GLOBAL_DEFAULT_CTX", () => ({ value: null }));
|
|
14862
14863
|
context2 = {
|
|
14863
14864
|
enterWith: (data) => {
|
|
14864
14865
|
storage.enterWith(data);
|
|
@@ -14877,7 +14878,10 @@ var init_context3 = __esm({
|
|
|
14877
14878
|
return store;
|
|
14878
14879
|
},
|
|
14879
14880
|
get: (key, opts) => {
|
|
14880
|
-
|
|
14881
|
+
let store = storage.getStore();
|
|
14882
|
+
if (!store && defaultContext.value) {
|
|
14883
|
+
store = defaultContext.value;
|
|
14884
|
+
}
|
|
14881
14885
|
if (store) {
|
|
14882
14886
|
store.states ??= [];
|
|
14883
14887
|
store.tags ??= [];
|
|
@@ -14893,6 +14897,28 @@ var init_context3 = __esm({
|
|
|
14893
14897
|
const store = storage.getStore();
|
|
14894
14898
|
if (!store) throw new Error("Cannot set context outside of `run`");
|
|
14895
14899
|
store[key] = value;
|
|
14900
|
+
},
|
|
14901
|
+
/**
|
|
14902
|
+
* Set a default context that will be used as a fallback when no AsyncLocalStorage context is active.
|
|
14903
|
+
* This is useful for testing and script execution where code runs outside of request handlers.
|
|
14904
|
+
*
|
|
14905
|
+
* @example
|
|
14906
|
+
* ```typescript
|
|
14907
|
+
* context.setDefaultContext({
|
|
14908
|
+
* botId: 'my-bot',
|
|
14909
|
+
* integrations: agentRegistry.integrations,
|
|
14910
|
+
* interfaces: agentRegistry.interfaces,
|
|
14911
|
+
* })
|
|
14912
|
+
* ```
|
|
14913
|
+
*/
|
|
14914
|
+
setDefaultContext: (data) => {
|
|
14915
|
+
defaultContext.value = data;
|
|
14916
|
+
},
|
|
14917
|
+
/**
|
|
14918
|
+
* Clear the default context.
|
|
14919
|
+
*/
|
|
14920
|
+
clearDefaultContext: () => {
|
|
14921
|
+
defaultContext.value = null;
|
|
14896
14922
|
}
|
|
14897
14923
|
};
|
|
14898
14924
|
}
|
|
@@ -44203,7 +44229,7 @@ var init_actions = __esm({
|
|
|
44203
44229
|
}
|
|
44204
44230
|
integrations ??= context2.get("integrations", { optional: true });
|
|
44205
44231
|
client2 ??= context2.get("client", { optional: true });
|
|
44206
|
-
const integration = integrations
|
|
44232
|
+
const integration = integrations?.find((i) => i.alias === integrationName);
|
|
44207
44233
|
const actionDef = integration?.definition.actions?.[actionName];
|
|
44208
44234
|
const handler = async (params) => {
|
|
44209
44235
|
integrations ??= context2.get("integrations", { optional: true });
|
|
@@ -46740,6 +46766,9 @@ var init_tracked_state = __esm({
|
|
|
46740
46766
|
});
|
|
46741
46767
|
|
|
46742
46768
|
// src/runtime/tracked-tags.ts
|
|
46769
|
+
function isSystemTag(key) {
|
|
46770
|
+
return key.includes(":");
|
|
46771
|
+
}
|
|
46743
46772
|
var TrackedTags;
|
|
46744
46773
|
var init_tracked_tags = __esm({
|
|
46745
46774
|
"src/runtime/tracked-tags.ts"() {
|
|
@@ -46919,8 +46948,8 @@ var init_tracked_tags = __esm({
|
|
|
46919
46948
|
}
|
|
46920
46949
|
}
|
|
46921
46950
|
isDirty() {
|
|
46922
|
-
const currentKeys = Object.keys(this._tags).filter((k) => !k
|
|
46923
|
-
const initialKeys = Object.keys(this._initialTags).filter((k) => !k
|
|
46951
|
+
const currentKeys = Object.keys(this._tags).filter((k) => !isSystemTag(k)).sort();
|
|
46952
|
+
const initialKeys = Object.keys(this._initialTags).filter((k) => !isSystemTag(k)).sort();
|
|
46924
46953
|
if (currentKeys.length !== initialKeys.length) {
|
|
46925
46954
|
return true;
|
|
46926
46955
|
}
|
|
@@ -46934,10 +46963,16 @@ var init_tracked_tags = __esm({
|
|
|
46934
46963
|
get tags() {
|
|
46935
46964
|
return new Proxy(this._tags, {
|
|
46936
46965
|
set: (target, prop, value) => {
|
|
46966
|
+
if (isSystemTag(prop)) {
|
|
46967
|
+
return true;
|
|
46968
|
+
}
|
|
46937
46969
|
target[prop] = value;
|
|
46938
46970
|
return true;
|
|
46939
46971
|
},
|
|
46940
46972
|
deleteProperty: (target, prop) => {
|
|
46973
|
+
if (isSystemTag(prop)) {
|
|
46974
|
+
return true;
|
|
46975
|
+
}
|
|
46941
46976
|
target[prop] = void 0;
|
|
46942
46977
|
return true;
|
|
46943
46978
|
}
|
|
@@ -46969,7 +47004,7 @@ var init_tracked_tags = __esm({
|
|
|
46969
47004
|
async persistTags(tags) {
|
|
46970
47005
|
const tagsForApi = {};
|
|
46971
47006
|
for (const [key, value] of Object.entries(tags)) {
|
|
46972
|
-
if (value !== void 0 && !key
|
|
47007
|
+
if (value !== void 0 && !isSystemTag(key)) {
|
|
46973
47008
|
tagsForApi[key] = value;
|
|
46974
47009
|
}
|
|
46975
47010
|
}
|
|
@@ -48736,34 +48771,36 @@ var init_trigger2 = __esm({
|
|
|
48736
48771
|
} else {
|
|
48737
48772
|
events.add(name);
|
|
48738
48773
|
}
|
|
48739
|
-
const [integration, event] = name.split(":");
|
|
48740
48774
|
const names = /* @__PURE__ */ new Set([name]);
|
|
48741
|
-
|
|
48742
|
-
|
|
48743
|
-
|
|
48744
|
-
|
|
48775
|
+
if (name.includes(":")) {
|
|
48776
|
+
const [integration, event] = name.split(":");
|
|
48777
|
+
const int = adk.project.integrations.find((x) => x.alias === integration || x.definition.name === integration);
|
|
48778
|
+
if (!int) {
|
|
48779
|
+
console.warn(`Integration "${integration}" not found for event "${name}". Skipping trigger registration.`);
|
|
48780
|
+
continue;
|
|
48781
|
+
}
|
|
48782
|
+
names.add(`${int.definition.name}:${event}`);
|
|
48783
|
+
names.add(`${int.alias}:${event}`);
|
|
48745
48784
|
}
|
|
48746
|
-
names.add(`${int.definition.name}:${event}`);
|
|
48747
|
-
names.add(`${int.alias}:${event}`);
|
|
48748
48785
|
for (const name2 of names) {
|
|
48749
|
-
bot2.on.event(name2, async ({ event
|
|
48786
|
+
bot2.on.event(name2, async ({ event, ctx }) => {
|
|
48750
48787
|
const conversation = context2.get("conversation", { optional: true });
|
|
48751
48788
|
await span(
|
|
48752
48789
|
"handler.trigger",
|
|
48753
48790
|
{
|
|
48754
48791
|
botId: ctx.botId,
|
|
48755
|
-
eventId:
|
|
48792
|
+
eventId: event.id,
|
|
48756
48793
|
"event.type": originalName,
|
|
48757
|
-
conversationId:
|
|
48794
|
+
conversationId: event.conversationId,
|
|
48758
48795
|
integration: conversation?.integration,
|
|
48759
48796
|
channel: conversation?.channel,
|
|
48760
|
-
userId:
|
|
48797
|
+
userId: event.userId
|
|
48761
48798
|
},
|
|
48762
48799
|
async () => {
|
|
48763
48800
|
console.log(`Evaluating trigger "${trigger.name}" for event "${originalName}" (mapped to "${name2}")`);
|
|
48764
48801
|
await trigger.handler({
|
|
48765
48802
|
event: {
|
|
48766
|
-
...
|
|
48803
|
+
...event,
|
|
48767
48804
|
type: originalName
|
|
48768
48805
|
}
|
|
48769
48806
|
});
|