@ekairos/events 1.22.54-beta.development.0 → 1.22.55-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.
@@ -95,6 +95,7 @@ export type ContextReactParams<Env extends ContextEnvironment = ContextEnvironme
95
95
  execution: ContextExecution;
96
96
  returnValueHookToken?: string | null;
97
97
  };
98
+ __initialContent?: unknown;
98
99
  __benchmark?: ContextBenchmarkRecorder;
99
100
  };
100
101
  export type ContextDurableReactParams<Env extends ContextEnvironment = ContextEnvironment, RequiredDomain extends DomainSchemaResult = typeof eventsDomain, Runtime extends ContextRuntime<Env> = ContextRuntime<Env>> = Omit<ContextReactParams<Env, RequiredDomain, Runtime>, "durable"> & {
@@ -126,6 +126,13 @@ function unwrapContextReturnValueHookPayload(payload) {
126
126
  }
127
127
  throw error;
128
128
  }
129
+ function isEmptyContextContent(content) {
130
+ if (content == null)
131
+ return true;
132
+ if (typeof content !== "object")
133
+ return false;
134
+ return Object.keys(content).length === 0;
135
+ }
129
136
  async function createRuntimeOps(runtimeHandle, benchmark) {
130
137
  const runtime = await getContextRuntimeServices(runtimeHandle);
131
138
  const { db } = runtime;
@@ -495,6 +502,12 @@ export class ContextEngine {
495
502
  ].join(" "));
496
503
  }
497
504
  const shell = await ContextEngine.prepareExecutionShell(story, triggerEvent, params);
505
+ if (params.__initialContent !== undefined &&
506
+ isEmptyContextContent(shell.currentContext.content)) {
507
+ const ops = await getContextEngineOps(runtimeHandle, params.__benchmark);
508
+ const initialContent = params.__initialContent;
509
+ shell.currentContext = await ops.updateContextContent(shell.contextSelector, initialContent);
510
+ }
498
511
  let run;
499
512
  try {
500
513
  const parentWorkflowRunId = await readActiveWorkflowRunId();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ekairos/events",
3
- "version": "1.22.54-beta.development.0",
3
+ "version": "1.22.55-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.54-beta.development.0",
130
+ "@ekairos/domain": "^1.22.55-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",