@xyne/workflow-sdk 3.2.4 → 3.2.6
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/agents/builtin/chat-tools.d.ts +10 -4
- package/dist/agents/builtin/chat-tools.d.ts.map +1 -1
- package/dist/agents/builtin/chat-tools.js +15 -5
- package/dist/agents/builtin/chat-tools.js.map +1 -1
- package/dist/ai-builder/client.d.ts +2 -3
- package/dist/ai-builder/client.d.ts.map +1 -1
- package/dist/ai-builder/client.js +4 -4
- package/dist/ai-builder/client.js.map +1 -1
- package/dist/ai-builder/types.d.ts +2 -3
- package/dist/ai-builder/types.d.ts.map +1 -1
- package/dist/engine/node-path.d.ts +46 -0
- package/dist/engine/node-path.d.ts.map +1 -0
- package/dist/engine/node-path.js +56 -0
- package/dist/engine/node-path.js.map +1 -0
- package/dist/engine/workflow-executor.d.ts +50 -22
- package/dist/engine/workflow-executor.d.ts.map +1 -1
- package/dist/engine/workflow-executor.js +336 -393
- package/dist/engine/workflow-executor.js.map +1 -1
- package/dist/persistence/types.d.ts +7 -0
- package/dist/persistence/types.d.ts.map +1 -1
- package/dist/router/approval-context.d.ts +35 -0
- package/dist/router/approval-context.d.ts.map +1 -0
- package/dist/router/approval-context.js +166 -0
- package/dist/router/approval-context.js.map +1 -0
- package/dist/router/workflow-router.d.ts.map +1 -1
- package/dist/router/workflow-router.js +43 -18
- package/dist/router/workflow-router.js.map +1 -1
- package/dist/runtime/types.d.ts +7 -0
- package/dist/runtime/types.d.ts.map +1 -1
- package/dist/runtime/workflow-runtime.d.ts.map +1 -1
- package/dist/runtime/workflow-runtime.js +98 -13
- package/dist/runtime/workflow-runtime.js.map +1 -1
- package/dist/steps/base-step.d.ts +20 -4
- package/dist/steps/base-step.d.ts.map +1 -1
- package/dist/steps/base-step.js +17 -0
- package/dist/steps/base-step.js.map +1 -1
- package/dist/steps/builtin/loop.step.d.ts.map +1 -1
- package/dist/steps/builtin/loop.step.js +14 -20
- package/dist/steps/builtin/loop.step.js.map +1 -1
- package/dist/steps/builtin/parallel.step.d.ts +10 -31
- package/dist/steps/builtin/parallel.step.d.ts.map +1 -1
- package/dist/steps/builtin/parallel.step.js +32 -192
- package/dist/steps/builtin/parallel.step.js.map +1 -1
- package/package.json +2 -2
|
@@ -8,17 +8,23 @@
|
|
|
8
8
|
* {@link SandboxAdapter}, never a baked-in backend.
|
|
9
9
|
*/
|
|
10
10
|
import type { AgentTool } from '@earendil-works/pi-agent-core';
|
|
11
|
-
import type { SandboxAdapter } from '../../sandbox/types.js';
|
|
11
|
+
import type { SandboxAdapter, SandboxFileUpload } from '../../sandbox/types.js';
|
|
12
12
|
/**
|
|
13
13
|
* Wrap the built-in `run_code` {@link WorkflowTool} as a pi-agent-core
|
|
14
14
|
* {@link AgentTool}, driving a fresh sandbox per call (create → run → destroy)
|
|
15
15
|
* so each invocation is isolated. Always executes inside the host sandbox.
|
|
16
|
+
*
|
|
17
|
+
* `preloadFiles` are written into every fresh sandbox before the model's code
|
|
18
|
+
* runs — the approval chat uses this to mount the execution JSON at
|
|
19
|
+
* /mnt/files/execution.json so the model can read run data on demand without it
|
|
20
|
+
* ever entering the prompt.
|
|
16
21
|
*/
|
|
17
|
-
export declare function createRunCodeAgentTool(sandbox: SandboxAdapter): AgentTool;
|
|
22
|
+
export declare function createRunCodeAgentTool(sandbox: SandboxAdapter, preloadFiles?: SandboxFileUpload[]): AgentTool;
|
|
18
23
|
/**
|
|
19
24
|
* The full tool set available to the Ask AI chat agents. Returns `run_code` when
|
|
20
25
|
* a sandbox is configured, else an empty list (the chat still works, just without
|
|
21
|
-
* code execution).
|
|
26
|
+
* code execution). `preloadFiles` (e.g. the execution JSON) are mounted into the
|
|
27
|
+
* sandbox on every call.
|
|
22
28
|
*/
|
|
23
|
-
export declare function createChatAgentTools(sandbox: SandboxAdapter | undefined): AgentTool[];
|
|
29
|
+
export declare function createChatAgentTools(sandbox: SandboxAdapter | undefined, preloadFiles?: SandboxFileUpload[]): AgentTool[];
|
|
24
30
|
//# sourceMappingURL=chat-tools.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-tools.d.ts","sourceRoot":"","sources":["../../../src/agents/builtin/chat-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"chat-tools.d.ts","sourceRoot":"","sources":["../../../src/agents/builtin/chat-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAKhF;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,cAAc,EACvB,YAAY,CAAC,EAAE,iBAAiB,EAAE,GACjC,SAAS,CAyBX;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,cAAc,GAAG,SAAS,EACnC,YAAY,CAAC,EAAE,iBAAiB,EAAE,GACjC,SAAS,EAAE,CAEb"}
|
|
@@ -14,8 +14,13 @@ import { runCodeTool } from './run-code-tool.js';
|
|
|
14
14
|
* Wrap the built-in `run_code` {@link WorkflowTool} as a pi-agent-core
|
|
15
15
|
* {@link AgentTool}, driving a fresh sandbox per call (create → run → destroy)
|
|
16
16
|
* so each invocation is isolated. Always executes inside the host sandbox.
|
|
17
|
+
*
|
|
18
|
+
* `preloadFiles` are written into every fresh sandbox before the model's code
|
|
19
|
+
* runs — the approval chat uses this to mount the execution JSON at
|
|
20
|
+
* /mnt/files/execution.json so the model can read run data on demand without it
|
|
21
|
+
* ever entering the prompt.
|
|
17
22
|
*/
|
|
18
|
-
export function createRunCodeAgentTool(sandbox) {
|
|
23
|
+
export function createRunCodeAgentTool(sandbox, preloadFiles) {
|
|
19
24
|
return {
|
|
20
25
|
name: runCodeTool.name,
|
|
21
26
|
label: 'Run code',
|
|
@@ -25,8 +30,12 @@ export function createRunCodeAgentTool(sandbox) {
|
|
|
25
30
|
const sig = signal ?? new AbortController().signal;
|
|
26
31
|
const handle = await sandbox.create({ signal: sig });
|
|
27
32
|
try {
|
|
33
|
+
const session = bindSandboxSession(sandbox, handle);
|
|
34
|
+
if (preloadFiles && preloadFiles.length > 0) {
|
|
35
|
+
await session.writeFiles(preloadFiles);
|
|
36
|
+
}
|
|
28
37
|
const result = await runCodeTool.execute(params, {
|
|
29
|
-
sandbox:
|
|
38
|
+
sandbox: session,
|
|
30
39
|
signal: sig,
|
|
31
40
|
log: { info: () => { }, warn: () => { }, error: () => { } },
|
|
32
41
|
});
|
|
@@ -41,9 +50,10 @@ export function createRunCodeAgentTool(sandbox) {
|
|
|
41
50
|
/**
|
|
42
51
|
* The full tool set available to the Ask AI chat agents. Returns `run_code` when
|
|
43
52
|
* a sandbox is configured, else an empty list (the chat still works, just without
|
|
44
|
-
* code execution).
|
|
53
|
+
* code execution). `preloadFiles` (e.g. the execution JSON) are mounted into the
|
|
54
|
+
* sandbox on every call.
|
|
45
55
|
*/
|
|
46
|
-
export function createChatAgentTools(sandbox) {
|
|
47
|
-
return sandbox ? [createRunCodeAgentTool(sandbox)] : [];
|
|
56
|
+
export function createChatAgentTools(sandbox, preloadFiles) {
|
|
57
|
+
return sandbox ? [createRunCodeAgentTool(sandbox, preloadFiles)] : [];
|
|
48
58
|
}
|
|
49
59
|
//# sourceMappingURL=chat-tools.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-tools.js","sourceRoot":"","sources":["../../../src/agents/builtin/chat-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,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AAC,EAAE,IAAI,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE;iBACzD,CAAC,CAAC;gBACH,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;YACjG,CAAC;oBAAS,CAAC;gBACT,MAAM,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAA8B,CAAC,CAAC,CAAC;YAC5E,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAClC,OAAmC,EACnC,YAAkC;IAElC,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC,sBAAsB,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACxE,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { AiBuilderMessage, BuilderChatResponse, ApprovalChatResponse, ChatStreamHandlers, WorkflowConfig } from './types.js';
|
|
2
|
-
import type { ExecutionDetail } from '../client/types.js';
|
|
3
2
|
export interface AiBuilderClientOptions {
|
|
4
3
|
/**
|
|
5
4
|
* Workflow API base URL — the same value passed to `createWorkflowClient`
|
|
@@ -18,11 +17,11 @@ export declare class AiBuilderClient {
|
|
|
18
17
|
readonly baseUrl: string;
|
|
19
18
|
constructor(options: AiBuilderClientOptions);
|
|
20
19
|
chat(messages: AiBuilderMessage[], currentConfig: WorkflowConfig): Promise<BuilderChatResponse>;
|
|
21
|
-
approvalChat(messages: AiBuilderMessage[],
|
|
20
|
+
approvalChat(messages: AiBuilderMessage[], executionId: string, currentFormValues?: Record<string, unknown>): Promise<ApprovalChatResponse>;
|
|
22
21
|
/** Streaming builder chat — text snapshots + tool chips + final patch. */
|
|
23
22
|
chatStream(messages: AiBuilderMessage[], currentConfig: WorkflowConfig, handlers: ChatStreamHandlers, signal?: AbortSignal): Promise<void>;
|
|
24
23
|
/** Streaming approval chat — text snapshots + tool chips + final form-fill. */
|
|
25
|
-
approvalChatStream(messages: AiBuilderMessage[],
|
|
24
|
+
approvalChatStream(messages: AiBuilderMessage[], executionId: string, handlers: ChatStreamHandlers, currentFormValues?: Record<string, unknown>, signal?: AbortSignal): Promise<void>;
|
|
26
25
|
/** POST + consume an SSE response, dispatching frames to `handlers`. */
|
|
27
26
|
private _postStream;
|
|
28
27
|
private _post;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/ai-builder/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAEhB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,EACf,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/ai-builder/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAEhB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,EACf,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,sBAAsB;IACrC;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB,8DAA8D;IAC9D,UAAU,CAAC,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC3C;AAED;;;GAGG;AACH,qBAAa,eAAe;IAGd,OAAO,CAAC,QAAQ,CAAC,OAAO;IAFpC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;gBAEI,OAAO,EAAE,sBAAsB;IAItD,IAAI,CACR,QAAQ,EAAE,gBAAgB,EAAE,EAC5B,aAAa,EAAE,cAAc,GAC5B,OAAO,CAAC,mBAAmB,CAAC;IAKzB,YAAY,CAChB,QAAQ,EAAE,gBAAgB,EAAE,EAC5B,WAAW,EAAE,MAAM,EACnB,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC1C,OAAO,CAAC,oBAAoB,CAAC;IAKhC,0EAA0E;IACpE,UAAU,CACd,QAAQ,EAAE,gBAAgB,EAAE,EAC5B,aAAa,EAAE,cAAc,EAC7B,QAAQ,EAAE,kBAAkB,EAC5B,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,IAAI,CAAC;IAIhB,+EAA+E;IACzE,kBAAkB,CACtB,QAAQ,EAAE,gBAAgB,EAAE,EAC5B,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,kBAAkB,EAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC3C,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,IAAI,CAAC;IAQhB,wEAAwE;YAC1D,WAAW;YAiEX,KAAK;CAiBpB"}
|
|
@@ -13,8 +13,8 @@ export class AiBuilderClient {
|
|
|
13
13
|
const body = { messages, currentConfig };
|
|
14
14
|
return this._post(body);
|
|
15
15
|
}
|
|
16
|
-
async approvalChat(messages,
|
|
17
|
-
const body = { messages, mode: 'approval',
|
|
16
|
+
async approvalChat(messages, executionId, currentFormValues) {
|
|
17
|
+
const body = { messages, mode: 'approval', executionId, ...(currentFormValues ? { currentFormValues } : {}) };
|
|
18
18
|
return this._post(body);
|
|
19
19
|
}
|
|
20
20
|
/** Streaming builder chat — text snapshots + tool chips + final patch. */
|
|
@@ -22,8 +22,8 @@ export class AiBuilderClient {
|
|
|
22
22
|
return this._postStream({ messages, currentConfig }, handlers, signal);
|
|
23
23
|
}
|
|
24
24
|
/** Streaming approval chat — text snapshots + tool chips + final form-fill. */
|
|
25
|
-
async approvalChatStream(messages,
|
|
26
|
-
return this._postStream({ messages, mode: 'approval',
|
|
25
|
+
async approvalChatStream(messages, executionId, handlers, currentFormValues, signal) {
|
|
26
|
+
return this._postStream({ messages, mode: 'approval', executionId, ...(currentFormValues ? { currentFormValues } : {}) }, handlers, signal);
|
|
27
27
|
}
|
|
28
28
|
/** POST + consume an SSE response, dispatching frames to `handlers`. */
|
|
29
29
|
async _postStream(body, handlers, signal) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/ai-builder/client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/ai-builder/client.ts"],"names":[],"mappings":"AAmBA;;;GAGG;AACH,MAAM,OAAO,eAAe;IAGG;IAFpB,OAAO,CAAS;IAEzB,YAA6B,OAA+B;QAA/B,YAAO,GAAP,OAAO,CAAwB;QAC1D,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACpD,CAAC;IAED,KAAK,CAAC,IAAI,CACR,QAA4B,EAC5B,aAA6B;QAE7B,MAAM,IAAI,GAAyB,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC;QAC/D,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAiC,CAAC;IAC1D,CAAC;IAED,KAAK,CAAC,YAAY,CAChB,QAA4B,EAC5B,WAAmB,EACnB,iBAA2C;QAE3C,MAAM,IAAI,GAAyB,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;QACpI,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAkC,CAAC;IAC3D,CAAC;IAED,0EAA0E;IAC1E,KAAK,CAAC,UAAU,CACd,QAA4B,EAC5B,aAA6B,EAC7B,QAA4B,EAC5B,MAAoB;QAEpB,OAAO,IAAI,CAAC,WAAW,CAAC,EAAE,QAAQ,EAAE,aAAa,EAAE,EAAE,QAAQ,EA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H,CAAC;IAEO,KAAK,CAAC,KAAK,CAAC,IAA0B;QAC5C,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,IAAI,CAAC,OAAO,kBAAkB,EAAE;YACzD,MAAM,EAAE,MAAM;YACd,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE;aAC/B;YACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;SAC3B,CAAC,CAAC;QAEH,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;YACZ,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YAC1D,MAAM,IAAI,KAAK,CAAC,8BAA8B,GAAG,CAAC,MAAM,MAAM,IAAI,EAAE,CAAC,CAAC;QACxE,CAAC;QAED,OAAO,GAAG,CAAC,IAAI,EAAyD,CAAC;IAC3E,CAAC;CACF"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { WorkflowConfig } from '../types/workflow-config.js';
|
|
2
|
-
import type { ExecutionDetail } from '../client/types.js';
|
|
3
2
|
export type { WorkflowConfig };
|
|
4
3
|
export interface AiBuilderToolCall {
|
|
5
4
|
name: string;
|
|
@@ -30,11 +29,11 @@ export interface BuilderChatRequest {
|
|
|
30
29
|
mode?: 'builder';
|
|
31
30
|
currentConfig: WorkflowConfig;
|
|
32
31
|
}
|
|
33
|
-
/** Approval mode —
|
|
32
|
+
/** Approval mode — identifies the execution, may receive form fill. */
|
|
34
33
|
export interface ApprovalChatRequest {
|
|
35
34
|
messages: AiBuilderMessage[];
|
|
36
35
|
mode: 'approval';
|
|
37
|
-
|
|
36
|
+
executionId: string;
|
|
38
37
|
/** Live form values at the moment the message was sent. */
|
|
39
38
|
currentFormValues?: Record<string, unknown>;
|
|
40
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/ai-builder/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/ai-builder/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAElE,YAAY,EAAE,cAAc,EAAE,CAAC;AAE/B,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,iBAAiB,EAAE,CAAC;CAC7B;AAGD,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,OAAO,GAAG,KAAK,CAAC;QAAC,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;IAClG,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IACzD,OAAO,CAAC,EAAE,CAAC,aAAa,EAAE,cAAc,KAAK,IAAI,CAAC;IAClD,mDAAmD;IACnD,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AAED,iEAAiE;AACjE,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,aAAa,EAAE,cAAc,CAAC;CAC/B;AAED,uEAAuE;AACvE,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,IAAI,EAAE,UAAU,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,2DAA2D;IAC3D,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC7C;AAED,MAAM,MAAM,oBAAoB,GAAG,kBAAkB,GAAG,mBAAmB,CAAC;AAE5E,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,cAAc,CAAC;CAChC;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED,MAAM,MAAM,iBAAiB,GAAG,mBAAmB,GAAG,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node-path addressing for durable pause/resume.
|
|
3
|
+
*
|
|
4
|
+
* Every executing step — top-level or nested inside any control-flow branch —
|
|
5
|
+
* has a stable, content-addressed key derived from the chain of branch frames
|
|
6
|
+
* that enclose it. This key is the step's persisted `stepName`, so a step's
|
|
7
|
+
* record is the single source of truth for its state (completed / parked /
|
|
8
|
+
* awaiting review). Resume routes a payload to a step by this key; the walk
|
|
9
|
+
* memoizes completed steps by this key. No positional indices, no separate
|
|
10
|
+
* pause cursor.
|
|
11
|
+
*
|
|
12
|
+
* Grammar:
|
|
13
|
+
* record key = stepId (top level)
|
|
14
|
+
* | <framePrefix>/stepId (inside a branch)
|
|
15
|
+
* frame prefix = <controlStepKey>:<branchKey>#<iter>
|
|
16
|
+
* controlStepKey = the record key of the enclosing control-flow step
|
|
17
|
+
*
|
|
18
|
+
* Examples:
|
|
19
|
+
* "extract" top-level step
|
|
20
|
+
* "parallel_x:swot#0/inner1" step in PARALLEL branch "swot"
|
|
21
|
+
* "loop_y:body#3/summarize" step in LOOP iteration 3
|
|
22
|
+
* "parallel_x:swot#0/loop_z:body#2/deep" arbitrarily nested
|
|
23
|
+
*
|
|
24
|
+
* Because the key is computed structurally from the workflow definition, it is
|
|
25
|
+
* identical on every walk — which is what makes memoized resume work at any
|
|
26
|
+
* depth, and lets two concurrent gates (different keys) resume independently.
|
|
27
|
+
*/
|
|
28
|
+
/** The record key (persisted `stepName`) for a step at the given scope prefix. */
|
|
29
|
+
export declare function recordKey(prefix: string, stepId: string): string;
|
|
30
|
+
/**
|
|
31
|
+
* The scope prefix for a branch frame: a `<branchKey>#<iter>` frame qualified by
|
|
32
|
+
* the enclosing control step's own record key. `iter` distinguishes LOOP
|
|
33
|
+
* iterations (always 0 for single-branch control steps).
|
|
34
|
+
*/
|
|
35
|
+
export declare function framePrefix(parentPrefix: string, controlStepId: string, branchKey: string, iter: number): string;
|
|
36
|
+
/**
|
|
37
|
+
* The bare step id at the end of a record key — the last path segment, stripped
|
|
38
|
+
* of any frame qualifier. Used to map a paused record back to its config step
|
|
39
|
+
* (e.g. for the approvals queue display) and for SSE event keying.
|
|
40
|
+
*
|
|
41
|
+
* "extract" -> "extract"
|
|
42
|
+
* "parallel_x:swot#0/gate" -> "gate"
|
|
43
|
+
* "loop_y:body#3/agent_summarize" -> "agent_summarize"
|
|
44
|
+
*/
|
|
45
|
+
export declare function leafStepId(recordName: string): string;
|
|
46
|
+
//# sourceMappingURL=node-path.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-path.d.ts","sourceRoot":"","sources":["../../src/engine/node-path.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,kFAAkF;AAClF,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEhE;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CACzB,YAAY,EAAE,MAAM,EACpB,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,GACX,MAAM,CAER;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAMrD"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node-path addressing for durable pause/resume.
|
|
3
|
+
*
|
|
4
|
+
* Every executing step — top-level or nested inside any control-flow branch —
|
|
5
|
+
* has a stable, content-addressed key derived from the chain of branch frames
|
|
6
|
+
* that enclose it. This key is the step's persisted `stepName`, so a step's
|
|
7
|
+
* record is the single source of truth for its state (completed / parked /
|
|
8
|
+
* awaiting review). Resume routes a payload to a step by this key; the walk
|
|
9
|
+
* memoizes completed steps by this key. No positional indices, no separate
|
|
10
|
+
* pause cursor.
|
|
11
|
+
*
|
|
12
|
+
* Grammar:
|
|
13
|
+
* record key = stepId (top level)
|
|
14
|
+
* | <framePrefix>/stepId (inside a branch)
|
|
15
|
+
* frame prefix = <controlStepKey>:<branchKey>#<iter>
|
|
16
|
+
* controlStepKey = the record key of the enclosing control-flow step
|
|
17
|
+
*
|
|
18
|
+
* Examples:
|
|
19
|
+
* "extract" top-level step
|
|
20
|
+
* "parallel_x:swot#0/inner1" step in PARALLEL branch "swot"
|
|
21
|
+
* "loop_y:body#3/summarize" step in LOOP iteration 3
|
|
22
|
+
* "parallel_x:swot#0/loop_z:body#2/deep" arbitrarily nested
|
|
23
|
+
*
|
|
24
|
+
* Because the key is computed structurally from the workflow definition, it is
|
|
25
|
+
* identical on every walk — which is what makes memoized resume work at any
|
|
26
|
+
* depth, and lets two concurrent gates (different keys) resume independently.
|
|
27
|
+
*/
|
|
28
|
+
/** The record key (persisted `stepName`) for a step at the given scope prefix. */
|
|
29
|
+
export function recordKey(prefix, stepId) {
|
|
30
|
+
return prefix ? `${prefix}/${stepId}` : stepId;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The scope prefix for a branch frame: a `<branchKey>#<iter>` frame qualified by
|
|
34
|
+
* the enclosing control step's own record key. `iter` distinguishes LOOP
|
|
35
|
+
* iterations (always 0 for single-branch control steps).
|
|
36
|
+
*/
|
|
37
|
+
export function framePrefix(parentPrefix, controlStepId, branchKey, iter) {
|
|
38
|
+
return `${recordKey(parentPrefix, controlStepId)}:${branchKey}#${String(iter)}`;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The bare step id at the end of a record key — the last path segment, stripped
|
|
42
|
+
* of any frame qualifier. Used to map a paused record back to its config step
|
|
43
|
+
* (e.g. for the approvals queue display) and for SSE event keying.
|
|
44
|
+
*
|
|
45
|
+
* "extract" -> "extract"
|
|
46
|
+
* "parallel_x:swot#0/gate" -> "gate"
|
|
47
|
+
* "loop_y:body#3/agent_summarize" -> "agent_summarize"
|
|
48
|
+
*/
|
|
49
|
+
export function leafStepId(recordName) {
|
|
50
|
+
const lastSegment = recordName.slice(recordName.lastIndexOf('/') + 1);
|
|
51
|
+
// A leaf segment is a bare step id; a frame segment (which never appears last)
|
|
52
|
+
// would contain ':'. Guard anyway by trimming a frame qualifier if present.
|
|
53
|
+
const colon = lastSegment.indexOf(':');
|
|
54
|
+
return colon >= 0 ? lastSegment.slice(0, colon) : lastSegment;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=node-path.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-path.js","sourceRoot":"","sources":["../../src/engine/node-path.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,kFAAkF;AAClF,MAAM,UAAU,SAAS,CAAC,MAAc,EAAE,MAAc;IACtD,OAAO,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,MAAM,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;AACjD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,WAAW,CACzB,YAAoB,EACpB,aAAqB,EACrB,SAAiB,EACjB,IAAY;IAEZ,OAAO,GAAG,SAAS,CAAC,YAAY,EAAE,aAAa,CAAC,IAAI,SAAS,IAAI,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;AAClF,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,UAAU,CAAC,UAAkB;IAC3C,MAAM,WAAW,GAAG,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IACtE,+EAA+E;IAC/E,4EAA4E;IAC5E,MAAM,KAAK,GAAG,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACvC,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC;AAChE,CAAC"}
|
|
@@ -30,9 +30,28 @@ export interface ExecutorLogger {
|
|
|
30
30
|
/**
|
|
31
31
|
* Core runtime engine for executing workflows.
|
|
32
32
|
*
|
|
33
|
-
* Orchestrates: step execution, variable resolution, pause/resume
|
|
34
|
-
*
|
|
35
|
-
*
|
|
33
|
+
* Orchestrates: step execution, variable resolution, durable pause/resume at
|
|
34
|
+
* any nesting depth (content-addressed step memoization + level-triggered
|
|
35
|
+
* reconciliation), error handling (onError: continue), retry, timeout,
|
|
36
|
+
* credential resolution, and state persistence.
|
|
37
|
+
*
|
|
38
|
+
* ## Pause/resume model
|
|
39
|
+
*
|
|
40
|
+
* Every step — top-level or nested in any control-flow branch — is keyed by a
|
|
41
|
+
* **node-path** (see `node-path.ts`). The walk always starts from the root and
|
|
42
|
+
* each step self-decides from its persisted record:
|
|
43
|
+
*
|
|
44
|
+
* - `COMPLETED` → restore output, skip (memoized; never re-executes).
|
|
45
|
+
* - `EXTERNAL_WAIT` leaf → resume via `onResume` if its record carries a
|
|
46
|
+
* `resumePayload`, otherwise re-park (still waiting).
|
|
47
|
+
* - `REVIEW_WAIT` → apply the review decision (approve / retry / abort).
|
|
48
|
+
* - control step with `EXTERNAL_WAIT` → re-execute (re-enter its branches; the
|
|
49
|
+
* completed branch steps memo-skip, the parked one resumes).
|
|
50
|
+
*
|
|
51
|
+
* Pausing throws to unwind — it carries no positional path, because the records
|
|
52
|
+
* hold the position. Resume = a payload written into the target node's record +
|
|
53
|
+
* re-enqueue; the next walk reconciles. N concurrent pauses, nested arbitrarily,
|
|
54
|
+
* fall out for free.
|
|
36
55
|
*
|
|
37
56
|
* Host provides: PersistenceAdapter, StepRegistry, TriggerRegistry,
|
|
38
57
|
* ServiceRegistry, and an optional logger.
|
|
@@ -56,8 +75,9 @@ export declare class WorkflowExecutor<TServices extends Record<string, unknown>
|
|
|
56
75
|
/**
|
|
57
76
|
* Run or resume an execution by ID.
|
|
58
77
|
*
|
|
59
|
-
* Loads the execution from persistence,
|
|
60
|
-
*
|
|
78
|
+
* Loads the execution from persistence, preloads its step records into the
|
|
79
|
+
* memo map, then walks the steps from the root. Completed steps short-circuit
|
|
80
|
+
* from the memo; the one (or many) parked step(s) resume from their records.
|
|
61
81
|
*/
|
|
62
82
|
runExecution(executionId: string): Promise<void>;
|
|
63
83
|
/**
|
|
@@ -71,11 +91,10 @@ export declare class WorkflowExecutor<TServices extends Record<string, unknown>
|
|
|
71
91
|
* Create a new execution that reruns from `fromStepId`, using the source
|
|
72
92
|
* execution's cached outputs for all prior steps as the resolved context.
|
|
73
93
|
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
* agents and other stateful steps to continue from where they left off.
|
|
94
|
+
* Prior steps are written as COMPLETED records on the new execution, so the
|
|
95
|
+
* memoized walk skips them. The step at `fromStepId` receives the source
|
|
96
|
+
* row's data as `ctx.priorState` (when `inheritStepState` is true, the
|
|
97
|
+
* default), enabling agents and other stateful steps to continue.
|
|
79
98
|
*
|
|
80
99
|
* Returns the new execution ID. Caller is responsible for enqueueing it.
|
|
81
100
|
*/
|
|
@@ -83,22 +102,31 @@ export declare class WorkflowExecutor<TServices extends Record<string, unknown>
|
|
|
83
102
|
configOverrides?: Record<string, unknown>;
|
|
84
103
|
inheritStepState?: boolean;
|
|
85
104
|
}): Promise<string>;
|
|
86
|
-
private
|
|
87
|
-
private walkSteps;
|
|
88
|
-
private executeStepWithRetry;
|
|
89
|
-
private executeStep;
|
|
105
|
+
private runWorkflow;
|
|
90
106
|
/**
|
|
91
|
-
* Walk steps
|
|
107
|
+
* Walk a scope of steps (the root scope, or one control-flow branch).
|
|
92
108
|
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
109
|
+
* `prefix` is the node-path prefix for this scope (`''` at the root, a frame
|
|
110
|
+
* prefix like `parallel_x:swot#0` inside a branch). Each step is addressed by
|
|
111
|
+
* `recordKey(prefix, step.id)`. The walk always starts from the first step;
|
|
112
|
+
* memoized records short-circuit completed steps so nothing re-executes.
|
|
95
113
|
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
114
|
+
* Throws `PauseStep` to unwind when a step (leaf or control) is parked, and
|
|
115
|
+
* `AbortExecution` on a review-gate abort. Settings-driven retry / onError
|
|
116
|
+
* apply at the root only — inside a branch, errors propagate so the enclosing
|
|
117
|
+
* control step (e.g. PARALLEL) can record them.
|
|
99
118
|
*/
|
|
100
|
-
private
|
|
101
|
-
|
|
119
|
+
private walkScope;
|
|
120
|
+
/** Persist a step record + mirror it into the in-memory memo for this run. */
|
|
121
|
+
private persistStep;
|
|
122
|
+
private executeStepWithRetry;
|
|
123
|
+
/**
|
|
124
|
+
* Execute one step. Control steps recurse into their branches via the
|
|
125
|
+
* `walkBranch` closure (which addresses each branch with a node-path frame).
|
|
126
|
+
* Action steps resolve config then either `execute()` fresh or `onResume()`
|
|
127
|
+
* when `resumeData` (the parked record) is supplied.
|
|
128
|
+
*/
|
|
129
|
+
private executeStep;
|
|
102
130
|
private buildStepContext;
|
|
103
131
|
}
|
|
104
132
|
//# sourceMappingURL=workflow-executor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-executor.d.ts","sourceRoot":"","sources":["../../src/engine/workflow-executor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"workflow-executor.d.ts","sourceRoot":"","sources":["../../src/engine/workflow-executor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAoB,MAAM,qBAAqB,CAAC;AAS7E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAI3E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAQvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAoD,MAAM,wBAAwB,CAAC;AAG5G,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AA+C1D,MAAM,WAAW,eAAe;IAC9B,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,+GAA+G;IAC/G,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2EAA2E;IAC3E,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,qFAAqF;IACrF,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACx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