@ekairos/events 1.22.43-beta.development.0 → 1.22.45-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.
- package/dist/context.contract.d.ts +0 -2
- package/dist/context.contract.js +0 -5
- package/dist/context.engine.js +12 -37
- package/dist/context.part-identity.js +5 -2
- package/dist/context.store.d.ts +2 -10
- package/dist/context.stream.d.ts +1 -3
- package/dist/context.stream.js +0 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/reactors/ai-sdk.chunk-map.d.ts +1 -0
- package/dist/reactors/ai-sdk.chunk-map.js +25 -1
- package/dist/reactors/ai-sdk.step.js +2 -0
- package/dist/schema.d.ts +0 -8
- package/dist/schema.js +0 -8
- package/dist/steps/store.steps.d.ts +0 -8
- package/dist/steps/store.steps.js +0 -16
- package/dist/stores/instant.store.d.ts +0 -8
- package/dist/stores/instant.store.js +4 -1
- package/package.json +2 -2
|
@@ -8,8 +8,6 @@ export declare const EXECUTION_STATUSES: readonly ["executing", "completed", "fa
|
|
|
8
8
|
export type ExecutionStatus = (typeof EXECUTION_STATUSES)[number];
|
|
9
9
|
export declare const STEP_STATUSES: readonly ["running", "completed", "failed"];
|
|
10
10
|
export type StepStatus = (typeof STEP_STATUSES)[number];
|
|
11
|
-
export declare const STEP_KINDS: readonly ["message", "action_execute", "action_result"];
|
|
12
|
-
export type StepKind = (typeof STEP_KINDS)[number];
|
|
13
11
|
export declare const ITEM_STATUSES: readonly ["stored", "pending", "completed"];
|
|
14
12
|
export type ItemStatus = (typeof ITEM_STATUSES)[number];
|
|
15
13
|
export declare const ITEM_TYPES: readonly ["input", "output"];
|
package/dist/context.contract.js
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
export const CONTEXT_STATUSES = ["open_idle", "open_streaming", "closed"];
|
|
2
2
|
export const EXECUTION_STATUSES = ["executing", "completed", "failed"];
|
|
3
3
|
export const STEP_STATUSES = ["running", "completed", "failed"];
|
|
4
|
-
export const STEP_KINDS = [
|
|
5
|
-
"message",
|
|
6
|
-
"action_execute",
|
|
7
|
-
"action_result",
|
|
8
|
-
];
|
|
9
4
|
export const ITEM_STATUSES = ["stored", "pending", "completed"];
|
|
10
5
|
export const ITEM_TYPES = [
|
|
11
6
|
"input",
|
package/dist/context.engine.js
CHANGED
|
@@ -368,11 +368,13 @@ async function createRuntimeOps(runtimeHandle, benchmark) {
|
|
|
368
368
|
return { stepId };
|
|
369
369
|
},
|
|
370
370
|
updateContextStep: async (params) => {
|
|
371
|
+
const update = { updatedAt: new Date() };
|
|
372
|
+
if (params.patch.status !== undefined)
|
|
373
|
+
update.status = params.patch.status;
|
|
374
|
+
if (params.patch.errorText !== undefined)
|
|
375
|
+
update.errorText = params.patch.errorText;
|
|
371
376
|
await instrumentedDb.transact([
|
|
372
|
-
instrumentedDb.tx.event_steps[params.stepId].update(
|
|
373
|
-
...params.patch,
|
|
374
|
-
updatedAt: new Date(),
|
|
375
|
-
}),
|
|
377
|
+
instrumentedDb.tx.event_steps[params.stepId].update(update),
|
|
376
378
|
]);
|
|
377
379
|
},
|
|
378
380
|
finalizeReactionStep: async (params) => {
|
|
@@ -383,11 +385,13 @@ async function createRuntimeOps(runtimeHandle, benchmark) {
|
|
|
383
385
|
mode: "close",
|
|
384
386
|
});
|
|
385
387
|
}
|
|
388
|
+
const update = { updatedAt: new Date() };
|
|
389
|
+
if (params.patch.status !== undefined)
|
|
390
|
+
update.status = params.patch.status;
|
|
391
|
+
if (params.patch.errorText !== undefined)
|
|
392
|
+
update.errorText = params.patch.errorText;
|
|
386
393
|
await instrumentedDb.transact([
|
|
387
|
-
instrumentedDb.tx.event_steps[params.stepId].update(
|
|
388
|
-
...params.patch,
|
|
389
|
-
updatedAt: new Date(),
|
|
390
|
-
}),
|
|
394
|
+
instrumentedDb.tx.event_steps[params.stepId].update(update),
|
|
391
395
|
]);
|
|
392
396
|
if (!params.reactionEventId || !params.reactionEvent) {
|
|
393
397
|
return {};
|
|
@@ -887,7 +891,6 @@ export class ContextEngine {
|
|
|
887
891
|
}));
|
|
888
892
|
}
|
|
889
893
|
story.opts.onEventCreated?.(assistantEventEffective);
|
|
890
|
-
const firstActionRequest = actionRequests?.[0];
|
|
891
894
|
await emitContextEvents({
|
|
892
895
|
silent,
|
|
893
896
|
writable,
|
|
@@ -899,10 +902,6 @@ export class ContextEngine {
|
|
|
899
902
|
executionId,
|
|
900
903
|
iteration: iter,
|
|
901
904
|
status: "running",
|
|
902
|
-
kind: firstActionRequest ? "action_execute" : "message",
|
|
903
|
-
actionName: firstActionRequest && typeof firstActionRequest.actionName === "string"
|
|
904
|
-
? firstActionRequest.actionName
|
|
905
|
-
: undefined,
|
|
906
905
|
},
|
|
907
906
|
],
|
|
908
907
|
});
|
|
@@ -919,10 +918,6 @@ export class ContextEngine {
|
|
|
919
918
|
stepId: openedStep.stepId,
|
|
920
919
|
patch: {
|
|
921
920
|
status: "completed",
|
|
922
|
-
kind: "message",
|
|
923
|
-
actionRequests: [],
|
|
924
|
-
actionResults: [],
|
|
925
|
-
continueLoop: false,
|
|
926
921
|
},
|
|
927
922
|
reactionEventId,
|
|
928
923
|
reactionEvent: completedReactionEvent,
|
|
@@ -943,7 +938,6 @@ export class ContextEngine {
|
|
|
943
938
|
executionId,
|
|
944
939
|
iteration: iter,
|
|
945
940
|
status: "completed",
|
|
946
|
-
kind: "message",
|
|
947
941
|
},
|
|
948
942
|
{
|
|
949
943
|
type: "step.completed",
|
|
@@ -1129,7 +1123,6 @@ export class ContextEngine {
|
|
|
1129
1123
|
actionRequests,
|
|
1130
1124
|
actionResults: actionResults,
|
|
1131
1125
|
}));
|
|
1132
|
-
const firstActionResult = actionResults?.[0];
|
|
1133
1126
|
const finalizedReactionStatus = continueLoop === false ? "completed" : "pending";
|
|
1134
1127
|
const finalizedReactionEvent = {
|
|
1135
1128
|
...reactionEvent,
|
|
@@ -1140,20 +1133,6 @@ export class ContextEngine {
|
|
|
1140
1133
|
stepId: openedStep.stepId,
|
|
1141
1134
|
patch: {
|
|
1142
1135
|
status: "completed",
|
|
1143
|
-
kind: actionRequests?.length ? "action_result" : "message",
|
|
1144
|
-
actionName: typeof firstActionResult?.actionRequest?.actionName === "string"
|
|
1145
|
-
? firstActionResult.actionRequest.actionName
|
|
1146
|
-
: undefined,
|
|
1147
|
-
actionInput: firstActionResult?.actionRequest?.input,
|
|
1148
|
-
actionOutput: firstActionResult?.success === true
|
|
1149
|
-
? firstActionResult?.output
|
|
1150
|
-
: undefined,
|
|
1151
|
-
actionError: firstActionResult?.success === false
|
|
1152
|
-
? String(firstActionResult?.errorText ?? "action_execution_failed")
|
|
1153
|
-
: undefined,
|
|
1154
|
-
actionRequests,
|
|
1155
|
-
actionResults,
|
|
1156
|
-
continueLoop: continueLoop !== false,
|
|
1157
1136
|
},
|
|
1158
1137
|
reactionEventId,
|
|
1159
1138
|
reactionEvent: finalizedReactionEvent,
|
|
@@ -1174,10 +1153,6 @@ export class ContextEngine {
|
|
|
1174
1153
|
executionId,
|
|
1175
1154
|
iteration: iter,
|
|
1176
1155
|
status: "completed",
|
|
1177
|
-
kind: actionRequests?.length ? "action_result" : "message",
|
|
1178
|
-
actionName: typeof firstActionResult?.actionRequest?.actionName === "string"
|
|
1179
|
-
? firstActionResult.actionRequest.actionName
|
|
1180
|
-
: undefined,
|
|
1181
1156
|
},
|
|
1182
1157
|
{
|
|
1183
1158
|
type: "step.completed",
|
|
@@ -248,8 +248,11 @@ export function assertValidContextPartChunkIdentity(input) {
|
|
|
248
248
|
if (!isActionChunk && typeof input.actionRef !== "undefined") {
|
|
249
249
|
throw new Error(`Invalid ${fieldLabel(label, "actionRef")}: only action chunks can carry actionRef.`);
|
|
250
250
|
}
|
|
251
|
-
if (isActionChunk
|
|
252
|
-
assertPartIdentityString(input.actionRef, fieldLabel(label, "actionRef"));
|
|
251
|
+
if (isActionChunk) {
|
|
252
|
+
const actionRef = assertPartIdentityString(input.actionRef, fieldLabel(label, "actionRef"));
|
|
253
|
+
if (actionRef !== providerPartId) {
|
|
254
|
+
throw new Error(`Invalid ${fieldLabel(label, "actionRef")}: action chunks require actionRef to match providerPartId.`);
|
|
255
|
+
}
|
|
253
256
|
}
|
|
254
257
|
const stepId = normalizeIdentityField(input.stepId);
|
|
255
258
|
if (!stepId)
|
package/dist/context.store.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ModelMessage } from "ai";
|
|
2
|
-
import type { ContextStatus, ExecutionStatus, StepStatus,
|
|
2
|
+
import type { ContextStatus, ExecutionStatus, StepStatus, ItemStatus, ItemType, Channel } from "./context.contract.js";
|
|
3
3
|
export type ContextIdentifier = {
|
|
4
4
|
id: string;
|
|
5
5
|
key?: never;
|
|
@@ -43,14 +43,6 @@ export type ContextStep = {
|
|
|
43
43
|
updatedAt?: Date;
|
|
44
44
|
status: StepStatus;
|
|
45
45
|
iteration: number;
|
|
46
|
-
kind?: StepKind;
|
|
47
|
-
actionName?: string;
|
|
48
|
-
actionInput?: unknown;
|
|
49
|
-
actionOutput?: unknown;
|
|
50
|
-
actionError?: string;
|
|
51
|
-
actionRequests?: any;
|
|
52
|
-
actionResults?: any;
|
|
53
|
-
continueLoop?: boolean;
|
|
54
46
|
errorText?: string;
|
|
55
47
|
};
|
|
56
48
|
export type ContextExecution = {
|
|
@@ -80,7 +72,7 @@ export interface ContextStore {
|
|
|
80
72
|
}): Promise<{
|
|
81
73
|
id: string;
|
|
82
74
|
}>;
|
|
83
|
-
updateStep(stepId: string, patch: Partial<Pick<ContextStep, "status" | "
|
|
75
|
+
updateStep(stepId: string, patch: Partial<Pick<ContextStep, "status" | "errorText" | "updatedAt">>): Promise<void>;
|
|
84
76
|
saveStepParts(params: {
|
|
85
77
|
stepId: string;
|
|
86
78
|
parts: any[];
|
package/dist/context.stream.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ContextStatus, ExecutionStatus, ItemStatus, ItemType,
|
|
1
|
+
import type { ContextStatus, ExecutionStatus, ItemStatus, ItemType, StepStatus, ContextStreamChunkType } from "./context.contract.js";
|
|
2
2
|
type IsoDateString = string;
|
|
3
3
|
type ContextStreamEventBase = {
|
|
4
4
|
type: string;
|
|
@@ -83,8 +83,6 @@ export type StepUpdatedEvent = ContextStreamEventBase & {
|
|
|
83
83
|
executionId: string;
|
|
84
84
|
iteration?: number;
|
|
85
85
|
status?: StepStatus;
|
|
86
|
-
kind?: StepKind;
|
|
87
|
-
actionName?: string;
|
|
88
86
|
};
|
|
89
87
|
export type StepCompletedEvent = ContextStreamEventBase & {
|
|
90
88
|
type: "step.completed";
|
package/dist/context.stream.js
CHANGED
|
@@ -92,8 +92,6 @@ export function parseContextStreamEvent(value) {
|
|
|
92
92
|
if (value.iteration !== undefined)
|
|
93
93
|
assertNumber(value.iteration, `${type}.iteration`);
|
|
94
94
|
assertOptionalString(value.status, `${type}.status`);
|
|
95
|
-
assertOptionalString(value.kind, `${type}.kind`);
|
|
96
|
-
assertOptionalString(value.actionName, `${type}.actionName`);
|
|
97
95
|
return value;
|
|
98
96
|
}
|
|
99
97
|
case "step.completed":
|
package/dist/index.d.ts
CHANGED
|
@@ -8,8 +8,8 @@ export { actionsToActionSpecs, actionSpecToAiSdkTool, type SerializableActionSpe
|
|
|
8
8
|
export { reactorMetadataSchema, contextPartSchema, contextPartEnvelopeSchema, contextPartContentSchema, contextMessagePartSchema, contextReasoningPartSchema, contextSourcePartSchema, contextActionPartSchema, contextEnginePartSchema, createContextPartSchema, parseContextPart, isContextPartEnvelope, parseContextPartEnvelope, normalizePartsForPersistence, } from "./context.parts.js";
|
|
9
9
|
export type { ReactorMetadata, ContextEnginePart, ContextActionPart, ContextActionStartedPart, ContextActionCompletedPart, ContextActionFailedPart, ContextPartActionMap, ContextPart, ContextPartEnvelope, ContextPartContent, ContextInlineContent, } from "./context.parts.js";
|
|
10
10
|
export { INPUT_ITEM_TYPE, INPUT_TEXT_ITEM_TYPE, OUTPUT_ITEM_TYPE, WEB_CHANNEL, AGENT_CHANNEL, EMAIL_CHANNEL, createUserItemFromUIMessages, createAssistantItemFromUIMessages, convertToUIMessage, convertItemToModelMessages, convertItemsToModelMessages, convertModelMessageToItem, isContextOutputPart, normalizeContextOutputPart, type ResponseMessage, type ContextOutputPart, type ContextOutputContentPart, } from "./context.events.js";
|
|
11
|
-
export { CONTEXT_STATUSES, EXECUTION_STATUSES, STEP_STATUSES,
|
|
12
|
-
export type { Transition, ContextStatus, ExecutionStatus, StepStatus,
|
|
11
|
+
export { CONTEXT_STATUSES, EXECUTION_STATUSES, STEP_STATUSES, ITEM_STATUSES, ITEM_TYPES, CHANNELS, TRACE_EVENT_KINDS, CONTEXT_STREAM_CHUNK_TYPES, STREAM_LIFECYCLE_CHUNK_TYPES, STREAM_TEXT_CHUNK_TYPES, STREAM_REASONING_CHUNK_TYPES, STREAM_ACTION_CHUNK_TYPES, STREAM_SOURCE_CHUNK_TYPES, STREAM_METADATA_CHUNK_TYPES, STREAM_ERROR_CHUNK_TYPES, CONTEXT_TRANSITIONS, EXECUTION_TRANSITIONS, STEP_TRANSITIONS, ITEM_TRANSITIONS, canContextTransition, canExecutionTransition, canStepTransition, canItemTransition, assertContextTransition, assertExecutionTransition, assertStepTransition, assertItemTransition, isContextStreamChunkType, assertContextPartKey, } from "./context.contract.js";
|
|
12
|
+
export type { Transition, ContextStatus, ExecutionStatus, StepStatus, ItemStatus, ItemType, Channel, TraceEventKind, ContextStreamChunkType, ContextTransition, ExecutionTransition, StepTransition, ItemTransition, } from "./context.contract.js";
|
|
13
13
|
export { DEFAULT_CODEX_TOOL_NAME, DEFAULT_CODEX_MODEL, codexToolInputSchema, buildDefaultCodexNarrative, didCodexToolExecute, createCodexContextBuilder, type CodexContextRuntimeMode, type CodexContextReasoningLevel, type CodexContextRuntime, type CodexContextEnv, type CodexToolInput, type CodexToolOutput, type CodexExecuteArgs, type CodexContextBuilderConfig, type CodexContextBuilder, } from "./codex.js";
|
|
14
14
|
export { useContext, type ContextSnapshot, type ContextStreamChunk, type UseContextOptions, } from "./react.js";
|
|
15
15
|
export { parseContextStreamEvent, assertContextStreamTransitions, validateContextStreamTimeline, } from "./context.stream.js";
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ export { didToolExecute, extractToolCallsFromParts } from "./context.toolcalls.j
|
|
|
5
5
|
export { actionsToActionSpecs, actionSpecToAiSdkTool, } from "./tools-to-model-tools.js";
|
|
6
6
|
export { reactorMetadataSchema, contextPartSchema, contextPartEnvelopeSchema, contextPartContentSchema, contextMessagePartSchema, contextReasoningPartSchema, contextSourcePartSchema, contextActionPartSchema, contextEnginePartSchema, createContextPartSchema, parseContextPart, isContextPartEnvelope, parseContextPartEnvelope, normalizePartsForPersistence, } from "./context.parts.js";
|
|
7
7
|
export { INPUT_ITEM_TYPE, INPUT_TEXT_ITEM_TYPE, OUTPUT_ITEM_TYPE, WEB_CHANNEL, AGENT_CHANNEL, EMAIL_CHANNEL, createUserItemFromUIMessages, createAssistantItemFromUIMessages, convertToUIMessage, convertItemToModelMessages, convertItemsToModelMessages, convertModelMessageToItem, isContextOutputPart, normalizeContextOutputPart, } from "./context.events.js";
|
|
8
|
-
export { CONTEXT_STATUSES, EXECUTION_STATUSES, STEP_STATUSES,
|
|
8
|
+
export { CONTEXT_STATUSES, EXECUTION_STATUSES, STEP_STATUSES, ITEM_STATUSES, ITEM_TYPES, CHANNELS, TRACE_EVENT_KINDS, CONTEXT_STREAM_CHUNK_TYPES, STREAM_LIFECYCLE_CHUNK_TYPES, STREAM_TEXT_CHUNK_TYPES, STREAM_REASONING_CHUNK_TYPES, STREAM_ACTION_CHUNK_TYPES, STREAM_SOURCE_CHUNK_TYPES, STREAM_METADATA_CHUNK_TYPES, STREAM_ERROR_CHUNK_TYPES, CONTEXT_TRANSITIONS, EXECUTION_TRANSITIONS, STEP_TRANSITIONS, ITEM_TRANSITIONS, canContextTransition, canExecutionTransition, canStepTransition, canItemTransition, assertContextTransition, assertExecutionTransition, assertStepTransition, assertItemTransition, isContextStreamChunkType, assertContextPartKey, } from "./context.contract.js";
|
|
9
9
|
export { DEFAULT_CODEX_TOOL_NAME, DEFAULT_CODEX_MODEL, codexToolInputSchema, buildDefaultCodexNarrative, didCodexToolExecute, createCodexContextBuilder, } from "./codex.js";
|
|
10
10
|
export { useContext, } from "./react.js";
|
|
11
11
|
export { parseContextStreamEvent, assertContextStreamTransitions, validateContextStreamTimeline, } from "./context.stream.js";
|
|
@@ -8,5 +8,6 @@ export type MapAiSdkChunkToContextEventParams = {
|
|
|
8
8
|
itemId?: string;
|
|
9
9
|
provider?: string;
|
|
10
10
|
sequence: number;
|
|
11
|
+
actionNameByRef?: Map<string, string>;
|
|
11
12
|
};
|
|
12
13
|
export declare function mapAiSdkChunkToContextEvent(params: MapAiSdkChunkToContextEventParams): ChunkEmittedEvent;
|
|
@@ -100,9 +100,15 @@ function buildNormalizedData(chunk) {
|
|
|
100
100
|
"id",
|
|
101
101
|
"text",
|
|
102
102
|
"delta",
|
|
103
|
+
"inputTextDelta",
|
|
104
|
+
"outputTextDelta",
|
|
103
105
|
"state",
|
|
106
|
+
"actionName",
|
|
104
107
|
"toolName",
|
|
105
108
|
"toolCallId",
|
|
109
|
+
"input",
|
|
110
|
+
"output",
|
|
111
|
+
"error",
|
|
106
112
|
"finishReason",
|
|
107
113
|
"url",
|
|
108
114
|
"title",
|
|
@@ -148,6 +154,24 @@ export function mapAiSdkChunkToContextEvent(params) {
|
|
|
148
154
|
});
|
|
149
155
|
const actionRef = readString(chunk, "toolCallId") ??
|
|
150
156
|
readString(chunk, "id");
|
|
157
|
+
let data = buildNormalizedData(chunk);
|
|
158
|
+
if (chunkType.startsWith("chunk.action_") && actionRef) {
|
|
159
|
+
const observedActionName = readString(chunk, "actionName") ??
|
|
160
|
+
readString(chunk, "toolName") ??
|
|
161
|
+
readString(data, "actionName") ??
|
|
162
|
+
readString(data, "toolName");
|
|
163
|
+
if (observedActionName) {
|
|
164
|
+
params.actionNameByRef?.set(actionRef, observedActionName);
|
|
165
|
+
}
|
|
166
|
+
const knownActionName = observedActionName ?? params.actionNameByRef?.get(actionRef);
|
|
167
|
+
if (knownActionName) {
|
|
168
|
+
data = {
|
|
169
|
+
...data,
|
|
170
|
+
actionName: readString(data, "actionName") ?? knownActionName,
|
|
171
|
+
toolName: readString(data, "toolName") ?? knownActionName,
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
}
|
|
151
175
|
return {
|
|
152
176
|
type: "chunk.emitted",
|
|
153
177
|
at: new Date().toISOString(),
|
|
@@ -164,7 +188,7 @@ export function mapAiSdkChunkToContextEvent(params) {
|
|
|
164
188
|
provider: params.provider,
|
|
165
189
|
providerChunkType,
|
|
166
190
|
sequence: params.sequence,
|
|
167
|
-
data
|
|
191
|
+
data,
|
|
168
192
|
raw: sanitizeRaw(chunk),
|
|
169
193
|
};
|
|
170
194
|
}
|
|
@@ -135,6 +135,7 @@ export async function executeAiSdkReaction(params) {
|
|
|
135
135
|
const modelId = typeof params.model === "string" ? params.model : "";
|
|
136
136
|
const mappedProvider = modelId.includes("/") ? modelId.split("/")[0] || "ai-sdk" : "ai-sdk";
|
|
137
137
|
const contextStepStreamWriter = params.contextStepStream?.getWriter();
|
|
138
|
+
const actionNameByRef = new Map();
|
|
138
139
|
try {
|
|
139
140
|
const uiStream = result
|
|
140
141
|
.toUIMessageStream({
|
|
@@ -173,6 +174,7 @@ export async function executeAiSdkReaction(params) {
|
|
|
173
174
|
itemId: params.eventId,
|
|
174
175
|
provider: mappedProvider,
|
|
175
176
|
sequence: ++chunkSequence,
|
|
177
|
+
actionNameByRef,
|
|
176
178
|
});
|
|
177
179
|
const persistedChunk = createContextStepStreamChunk({
|
|
178
180
|
at: mapped.at,
|
package/dist/schema.d.ts
CHANGED
|
@@ -30,14 +30,6 @@ export declare const eventsDomain: import("@ekairos/domain").DomainSchemaResult<
|
|
|
30
30
|
updatedAt: import("@instantdb/core").DataAttrDef<Date, false, false, false>;
|
|
31
31
|
status: import("@instantdb/core").DataAttrDef<string, false, true, false>;
|
|
32
32
|
iteration: import("@instantdb/core").DataAttrDef<number, true, true, false>;
|
|
33
|
-
kind: import("@instantdb/core").DataAttrDef<string, false, true, false>;
|
|
34
|
-
actionName: import("@instantdb/core").DataAttrDef<string, false, true, false>;
|
|
35
|
-
actionInput: import("@instantdb/core").DataAttrDef<any, false, false, false>;
|
|
36
|
-
actionOutput: import("@instantdb/core").DataAttrDef<any, false, false, false>;
|
|
37
|
-
actionError: import("@instantdb/core").DataAttrDef<string, false, false, false>;
|
|
38
|
-
actionRequests: import("@instantdb/core").DataAttrDef<any, false, false, false>;
|
|
39
|
-
actionResults: import("@instantdb/core").DataAttrDef<any, false, false, false>;
|
|
40
|
-
continueLoop: import("@instantdb/core").DataAttrDef<boolean, false, false, false>;
|
|
41
33
|
errorText: import("@instantdb/core").DataAttrDef<string, false, false, false>;
|
|
42
34
|
streamId: import("@instantdb/core").DataAttrDef<string, false, true, false>;
|
|
43
35
|
streamClientId: import("@instantdb/core").DataAttrDef<string, false, true, false>;
|
package/dist/schema.js
CHANGED
|
@@ -34,14 +34,6 @@ export const eventsDomain = domain("events")
|
|
|
34
34
|
updatedAt: i.date().optional(),
|
|
35
35
|
status: i.string().optional().indexed(), // running | completed | failed
|
|
36
36
|
iteration: i.number().indexed(),
|
|
37
|
-
kind: i.string().optional().indexed(), // message | action_execute | action_result
|
|
38
|
-
actionName: i.string().optional().indexed(),
|
|
39
|
-
actionInput: i.any().optional(),
|
|
40
|
-
actionOutput: i.any().optional(),
|
|
41
|
-
actionError: i.string().optional(),
|
|
42
|
-
actionRequests: i.any().optional(),
|
|
43
|
-
actionResults: i.any().optional(),
|
|
44
|
-
continueLoop: i.boolean().optional(),
|
|
45
37
|
errorText: i.string().optional(),
|
|
46
38
|
streamId: i.string().optional().indexed(),
|
|
47
39
|
streamClientId: i.string().optional().indexed(),
|
|
@@ -12,14 +12,6 @@ export type ContextReviewRequest = {
|
|
|
12
12
|
};
|
|
13
13
|
type ContextStepPatch = {
|
|
14
14
|
status?: "running" | "completed" | "failed";
|
|
15
|
-
kind?: "message" | "action_execute" | "action_result";
|
|
16
|
-
actionName?: string;
|
|
17
|
-
actionInput?: unknown;
|
|
18
|
-
actionOutput?: unknown;
|
|
19
|
-
actionError?: string;
|
|
20
|
-
actionRequests?: any;
|
|
21
|
-
actionResults?: any;
|
|
22
|
-
continueLoop?: boolean;
|
|
23
15
|
errorText?: string;
|
|
24
16
|
};
|
|
25
17
|
/**
|
|
@@ -567,15 +567,7 @@ export async function updateContextStep(params) {
|
|
|
567
567
|
stepId: String(params.stepId),
|
|
568
568
|
payload: {
|
|
569
569
|
status: params.patch.status,
|
|
570
|
-
kind: params.patch.kind,
|
|
571
|
-
actionName: params.patch.actionName,
|
|
572
|
-
actionInput: params.patch.actionInput,
|
|
573
|
-
actionOutput: params.patch.actionOutput,
|
|
574
|
-
actionError: params.patch.actionError,
|
|
575
570
|
iteration: params.iteration,
|
|
576
|
-
actionRequests: params.patch.actionRequests,
|
|
577
|
-
actionResults: params.patch.actionResults,
|
|
578
|
-
continueLoop: params.patch.continueLoop,
|
|
579
571
|
errorText: params.patch.errorText,
|
|
580
572
|
},
|
|
581
573
|
},
|
|
@@ -618,15 +610,7 @@ export async function finalizeReactionStep(params) {
|
|
|
618
610
|
stepId: String(params.stepId),
|
|
619
611
|
payload: {
|
|
620
612
|
status: params.patch.status,
|
|
621
|
-
kind: params.patch.kind,
|
|
622
|
-
actionName: params.patch.actionName,
|
|
623
|
-
actionInput: params.patch.actionInput,
|
|
624
|
-
actionOutput: params.patch.actionOutput,
|
|
625
|
-
actionError: params.patch.actionError,
|
|
626
613
|
iteration: params.iteration,
|
|
627
|
-
actionRequests: params.patch.actionRequests,
|
|
628
|
-
actionResults: params.patch.actionResults,
|
|
629
|
-
continueLoop: params.patch.continueLoop,
|
|
630
614
|
errorText: params.patch.errorText,
|
|
631
615
|
},
|
|
632
616
|
},
|
|
@@ -38,14 +38,6 @@ export declare class InstantStore implements ContextStore {
|
|
|
38
38
|
}>;
|
|
39
39
|
updateStep(stepId: string, patch: Partial<{
|
|
40
40
|
status: "running" | "completed" | "failed";
|
|
41
|
-
kind: "message" | "action_execute" | "action_result";
|
|
42
|
-
actionName: string;
|
|
43
|
-
actionInput: unknown;
|
|
44
|
-
actionOutput: unknown;
|
|
45
|
-
actionError: string;
|
|
46
|
-
actionRequests: any;
|
|
47
|
-
actionResults: any;
|
|
48
|
-
continueLoop: boolean;
|
|
49
41
|
errorText: string;
|
|
50
42
|
updatedAt: Date;
|
|
51
43
|
}>): Promise<void>;
|
|
@@ -517,9 +517,12 @@ export class InstantStore {
|
|
|
517
517
|
}
|
|
518
518
|
}
|
|
519
519
|
const update = {
|
|
520
|
-
...patch,
|
|
521
520
|
updatedAt: patch.updatedAt ?? new Date(),
|
|
522
521
|
};
|
|
522
|
+
if (patch.status !== undefined)
|
|
523
|
+
update.status = patch.status;
|
|
524
|
+
if (patch.errorText !== undefined)
|
|
525
|
+
update.errorText = patch.errorText;
|
|
523
526
|
await this.db.transact([this.db.tx.event_steps[stepId].update(update)]);
|
|
524
527
|
}
|
|
525
528
|
async linkItemToExecution(params) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ekairos/events",
|
|
3
|
-
"version": "1.22.
|
|
3
|
+
"version": "1.22.45-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.
|
|
130
|
+
"@ekairos/domain": "^1.22.45-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",
|