@botpress/runtime 1.10.1 → 1.10.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.
@@ -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.10.1", adk: "1.10.1", sdk: "4.20.2", llmz: "0.0.33", zai: "2.5.0", cognitive: "0.2.0" };
51
+ define_PACKAGE_VERSIONS_default = { runtime: "1.10.2", adk: "1.10.2", sdk: "4.20.2", llmz: "0.0.33", zai: "2.5.0", cognitive: "0.2.0" };
52
52
  }
53
53
  });
54
54
 
@@ -34175,16 +34175,13 @@ var init_conversation_instance = __esm({
34175
34175
  );
34176
34176
  }
34177
34177
  this.TrackedState = existingState;
34178
- const tags = context2.get("tags", { optional: true });
34179
- const existingTags = tags?.find(
34180
- (t) => t.type === "conversation" && t.id === conversation.id
34181
- );
34182
- if (!existingTags) {
34183
- throw new Error(
34184
- `Conversation tags not found for conversation ${conversation.id}. Make sure TrackedTags.loadAll() is called before creating conversation instances.`
34185
- );
34186
- }
34187
- this.TrackedTags = existingTags;
34178
+ const tags = TrackedTags.create({
34179
+ type: "conversation",
34180
+ id: conversation.id,
34181
+ client: client._inner,
34182
+ initialTags: conversation.tags
34183
+ });
34184
+ this.TrackedTags = tags;
34188
34185
  }
34189
34186
  get tags() {
34190
34187
  return this.TrackedTags.tags;
@@ -44927,7 +44924,7 @@ var init_workflow_instance = __esm({
44927
44924
  schema: definition?.stateSchema,
44928
44925
  name: BUILT_IN_STATES.workflowState
44929
44926
  });
44930
- this.TrackedTags = TrackedTags2.create({
44927
+ this.TrackedTags = TrackedTags.create({
44931
44928
  type: "workflow",
44932
44929
  client: client._inner,
44933
44930
  id: workflow.id,
@@ -44965,6 +44962,13 @@ var init_workflow_instance = __esm({
44965
44962
  if (!adk.project.workflows.find((w) => w.name === workflow.name)) {
44966
44963
  throw new Error(`No ADK Workflow definition found for "${workflow.name}"`);
44967
44964
  }
44965
+ TrackedTags.create({
44966
+ type: "workflow",
44967
+ client: client._inner,
44968
+ id: workflow.id,
44969
+ initialTags: workflow.tags
44970
+ });
44971
+ await TrackedTags.loadAll();
44968
44972
  return new _BaseWorkflowInstance(workflow, client);
44969
44973
  }
44970
44974
  /**
@@ -44978,11 +44982,16 @@ var init_workflow_instance = __esm({
44978
44982
  });
44979
44983
  return executeFunc(props);
44980
44984
  }
44985
+ /**
44986
+ * Cancel the workflow execution.
44987
+ * Note: This should be called from within a proper bot handler context.
44988
+ * If calling from a conversation handler, ensure TrackedTags.loadAll() has been called.
44989
+ */
44981
44990
  async cancel() {
44991
+ await TrackedTags.loadAll();
44982
44992
  const { workflow } = await updateWorkflow({
44983
44993
  id: this.id,
44984
- status: "cancelled",
44985
- failureReason: "Cancelled by user"
44994
+ status: "cancelled"
44986
44995
  });
44987
44996
  Object.assign(this.workflow, workflow);
44988
44997
  }
@@ -46125,7 +46134,7 @@ var init_handlers2 = __esm({
46125
46134
  });
46126
46135
 
46127
46136
  // src/runtime/tracked-tags.ts
46128
- var TrackedTags2;
46137
+ var TrackedTags;
46129
46138
  var init_tracked_tags = __esm({
46130
46139
  "src/runtime/tracked-tags.ts"() {
46131
46140
  "use strict";
@@ -46133,7 +46142,7 @@ var init_tracked_tags = __esm({
46133
46142
  init_define_PACKAGE_VERSIONS();
46134
46143
  init_context3();
46135
46144
  init_tracing();
46136
- TrackedTags2 = class _TrackedTags {
46145
+ TrackedTags = class _TrackedTags {
46137
46146
  type;
46138
46147
  id;
46139
46148
  client;