@botpress/runtime 1.13.8 → 1.13.9

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.
@@ -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.8", adk: "1.13.8", sdk: "5.0.2", llmz: "0.0.35", zai: "2.5.6", cognitive: "0.3.3" };
51
+ define_PACKAGE_VERSIONS_default = { runtime: "1.13.9", adk: "1.13.9", sdk: "5.0.2", llmz: "0.0.35", zai: "2.5.6", cognitive: "0.3.3" };
52
52
  }
53
53
  });
54
54
 
@@ -10657,7 +10657,7 @@ var require_form_data = __commonJS({
10657
10657
  var parseUrl = __require("url").parse;
10658
10658
  var fs3 = __require("fs");
10659
10659
  var Stream2 = __require("stream").Stream;
10660
- var crypto3 = __require("crypto");
10660
+ var crypto2 = __require("crypto");
10661
10661
  var mime = require_mime_types();
10662
10662
  var asynckit = require_asynckit();
10663
10663
  var setToStringTag = require_es_set_tostringtag();
@@ -10863,7 +10863,7 @@ var require_form_data = __commonJS({
10863
10863
  return Buffer.concat([dataBuffer, Buffer.from(this._lastBoundary())]);
10864
10864
  };
10865
10865
  FormData3.prototype._generateBoundary = function() {
10866
- this._boundary = "--------------------------" + crypto3.randomBytes(12).toString("hex");
10866
+ this._boundary = "--------------------------" + crypto2.randomBytes(12).toString("hex");
10867
10867
  };
10868
10868
  FormData3.prototype.getLengthSync = function() {
10869
10869
  var knownLength = this._overheadLength + this._valueLength;
@@ -34318,47 +34318,6 @@ var init_asset = __esm({
34318
34318
  }
34319
34319
  });
34320
34320
 
34321
- // src/utilities/trigger-tags.ts
34322
- var trigger_tags_exports = {};
34323
- __export(trigger_tags_exports, {
34324
- getTriggerSubscriptionTags: () => getTriggerSubscriptionTags,
34325
- getTriggerTagName: () => getTriggerTagName,
34326
- getTriggerTagValue: () => getTriggerTagValue,
34327
- isConversationSubscribedToTrigger: () => isConversationSubscribedToTrigger
34328
- });
34329
- import crypto2 from "crypto";
34330
- var hashString, getTriggerTagName, getTriggerTagValue, getTriggerSubscriptionTags, isConversationSubscribedToTrigger;
34331
- var init_trigger_tags = __esm({
34332
- "src/utilities/trigger-tags.ts"() {
34333
- "use strict";
34334
- init_define_BUILD();
34335
- init_define_PACKAGE_VERSIONS();
34336
- hashString = (str) => {
34337
- return crypto2.createHash("md5").update(str).digest("hex").substring(0, 5).toUpperCase();
34338
- };
34339
- getTriggerTagName = (triggerName) => {
34340
- return `trigger${hashString(triggerName)}`;
34341
- };
34342
- getTriggerTagValue = (key) => {
34343
- return key ?? "*";
34344
- };
34345
- getTriggerSubscriptionTags = (triggerName, key) => {
34346
- return {
34347
- name: getTriggerTagName(triggerName),
34348
- value: getTriggerTagValue(key)
34349
- };
34350
- };
34351
- isConversationSubscribedToTrigger = (conversationTags, triggerName, triggerKey) => {
34352
- const tagName = getTriggerTagName(triggerName);
34353
- const tagValue = conversationTags[tagName];
34354
- if (!tagValue) {
34355
- return false;
34356
- }
34357
- return tagValue === "*" || tagValue === triggerKey;
34358
- };
34359
- }
34360
- });
34361
-
34362
34321
  // src/primitives/conversation-instance.ts
34363
34322
  var BaseConversationInstance;
34364
34323
  var init_conversation_instance = __esm({
@@ -34473,38 +34432,6 @@ var init_conversation_instance = __esm({
34473
34432
  });
34474
34433
  }
34475
34434
  }
34476
- /**
34477
- * Subscribe to a trigger
34478
- */
34479
- async subscribeToTrigger(triggerName, key) {
34480
- const { getTriggerSubscriptionTags: getTriggerSubscriptionTags2, isConversationSubscribedToTrigger: isConversationSubscribedToTrigger2 } = await Promise.resolve().then(() => (init_trigger_tags(), trigger_tags_exports));
34481
- if (isConversationSubscribedToTrigger2(this.tags, triggerName, key)) {
34482
- return;
34483
- }
34484
- const { name, value } = getTriggerSubscriptionTags2(triggerName, key);
34485
- await this.client.updateConversation({
34486
- id: this.id,
34487
- tags: {
34488
- [name]: value
34489
- }
34490
- });
34491
- }
34492
- /**
34493
- * Unsubscribe from a trigger
34494
- */
34495
- async unsubscribeFromTrigger(triggerName, key) {
34496
- const { getTriggerSubscriptionTags: getTriggerSubscriptionTags2, isConversationSubscribedToTrigger: isConversationSubscribedToTrigger2 } = await Promise.resolve().then(() => (init_trigger_tags(), trigger_tags_exports));
34497
- if (!isConversationSubscribedToTrigger2(this.tags, triggerName, key)) {
34498
- return;
34499
- }
34500
- const { name } = getTriggerSubscriptionTags2(triggerName, key);
34501
- await this.client.updateConversation({
34502
- id: this.id,
34503
- tags: {
34504
- [name]: ""
34505
- }
34506
- });
34507
- }
34508
34435
  };
34509
34436
  }
34510
34437
  });
@@ -36811,7 +36738,7 @@ var init_source_website = __esm({
36811
36738
  type: "website",
36812
36739
  state: State,
36813
36740
  async handler({ input, step: step2, state, client: client2 }) {
36814
- const crypto3 = await import("crypto");
36741
+ const crypto2 = await import("crypto");
36815
36742
  console.log(
36816
36743
  `Starting sync for WebsiteSource [${this.id}] in mode [${this.mode}, maxPages=${this.maxPages}, maxDepth=${this.maxDepth}, baseUrl=${this.baseUrl}, sitemapUrl=${this.sitemapUrl}]`
36817
36744
  );
@@ -36893,7 +36820,7 @@ var init_source_website = __esm({
36893
36820
  content,
36894
36821
  metadata: fetchMetadata
36895
36822
  } = await this.fetchUrl(sitemapUrl.loc);
36896
- const hash = crypto3.createHash("sha256").update(content).digest("hex");
36823
+ const hash = crypto2.createHash("sha256").update(content).digest("hex");
36897
36824
  let contentType = fetchedContentType;
36898
36825
  if (!contentType) {
36899
36826
  contentType = content.includes("<html") ? "text/html" : "text/markdown";
@@ -43890,7 +43817,7 @@ var init_source_directory = __esm({
43890
43817
  const glob2 = await Promise.resolve().then(() => (init_esm9(), esm_exports3));
43891
43818
  const path4 = await import("path");
43892
43819
  const fs3 = await import("fs/promises");
43893
- const crypto3 = await import("crypto");
43820
+ const crypto2 = await import("crypto");
43894
43821
  const directory = path4.resolve(adk.environment.agent.directory, this.directoryPath);
43895
43822
  const tags = {
43896
43823
  [WellKnownTags.knowledge.KNOWLEDGE]: "knowledge-base",
@@ -43952,7 +43879,7 @@ var init_source_directory = __esm({
43952
43879
  const upsertFile = async (local) => {
43953
43880
  const key = `data_source://${this.type}/${this.id}/${local.rel}`;
43954
43881
  const content = await fs3.readFile(local.abs);
43955
- const hash = crypto3.createHash("sha256").update(content).digest("hex");
43882
+ const hash = crypto2.createHash("sha256").update(content).digest("hex");
43956
43883
  const { file } = await client2.getFile({ id: key }).catch(() => ({ file: null }));
43957
43884
  if (!input.force && file?.metadata?.hash === hash) {
43958
43885
  console.log(`Skipping unchanged file: ${local.rel}`);
@@ -44070,19 +43997,11 @@ var init_conversation = __esm({
44070
43997
  /** @internal */
44071
43998
  schema;
44072
43999
  #handler;
44073
- #startFromTrigger;
44074
44000
  constructor(props) {
44075
44001
  this.channel = props.channel;
44076
44002
  this.events = props.events ?? [];
44077
44003
  this.schema = props.state ?? z13.object({}).passthrough();
44078
44004
  this.#handler = props.handler;
44079
- if (props.startFromTrigger) {
44080
- this.#startFromTrigger = props.startFromTrigger;
44081
- }
44082
- }
44083
- /** @internal */
44084
- get startFromTrigger() {
44085
- return this.#startFromTrigger;
44086
44005
  }
44087
44006
  /** @internal */
44088
44007
  getDefinition() {
@@ -44526,7 +44445,6 @@ var init_runtime = __esm({
44526
44445
  init_structured_logging();
44527
44446
  init_environment();
44528
44447
  init_runtime2();
44529
- init_trigger_tags();
44530
44448
  init_types2();
44531
44449
  init_errors();
44532
44450
  init_state();