@ekairos/events 1.22.51-beta.development.0 → 1.22.53-beta.development.0

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.
@@ -501,21 +501,29 @@ export class ContextEngine {
501
501
  let returnValueHook = null;
502
502
  let returnValueHookPromise = null;
503
503
  if (parentWorkflowRunId) {
504
- const { createHook } = await import("workflow");
505
- const hook = createHook({
506
- token: `context:return:${shell.execution.id}`,
507
- metadata: {
508
- kind: "context.returnValue",
509
- contextId: shell.currentContext.id,
510
- executionId: shell.execution.id,
504
+ try {
505
+ const { createHook } = await import("workflow");
506
+ const hook = createHook({
507
+ token: `context:return:${shell.execution.id}`,
508
+ metadata: {
509
+ kind: "context.returnValue",
510
+ contextId: shell.currentContext.id,
511
+ executionId: shell.execution.id,
512
+ parentWorkflowRunId,
513
+ },
514
+ });
515
+ returnValueHook = {
516
+ token: hook.token,
511
517
  parentWorkflowRunId,
512
- },
513
- });
514
- returnValueHook = {
515
- token: hook.token,
516
- parentWorkflowRunId,
517
- };
518
- returnValueHookPromise = Promise.resolve(hook);
518
+ };
519
+ returnValueHookPromise = Promise.resolve(hook);
520
+ }
521
+ catch (error) {
522
+ const message = error instanceof Error ? error.message : String(error);
523
+ if (!message.includes("createHook() can only be called inside a workflow function")) {
524
+ throw error;
525
+ }
526
+ }
519
527
  }
520
528
  const payload = {
521
529
  contextKey,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ekairos/events",
3
- "version": "1.22.51-beta.development.0",
3
+ "version": "1.22.53-beta.development.0",
4
4
  "description": "Ekairos Events - Context-first workflow runtime",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -127,7 +127,7 @@
127
127
  },
128
128
  "dependencies": {
129
129
  "@ai-sdk/openai": "^2.0.52",
130
- "@ekairos/domain": "^1.22.51-beta.development.0",
130
+ "@ekairos/domain": "^1.22.53-beta.development.0",
131
131
  "@instantdb/admin": "0.22.158",
132
132
  "@instantdb/core": "0.22.142",
133
133
  "@vercel/mcp-adapter": "^1.0.0",