@oomol-lab/open-flow 0.1.0-beta.70 → 0.1.0-beta.72

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.
Files changed (37) hide show
  1. package/dist/browser/{FlowCanvas-CqtUDPGj.js → FlowCanvas-Dtf8_cQp.js} +31 -31
  2. package/dist/browser/{createResourceDialog-BAHYW9yu.js → createResourceDialog-BWJkjiOO.js} +2 -2
  3. package/dist/browser/{dialog-DcGOzUP2.js → dialog-CUy_fwx9.js} +4586 -4586
  4. package/dist/browser/{exportSvg-Dv5Qgrq7.js → exportSvg-BOoy7-Db.js} +1 -1
  5. package/dist/browser/flow-authoring.js +9467 -9467
  6. package/dist/browser/flow-change.d.ts +2 -14
  7. package/dist/browser/flow-change.js +23 -21
  8. package/dist/browser/{flowChanges-CYyehKer.js → flowChanges-CgSnSqqP.js} +5731 -5627
  9. package/dist/browser/{flowWorkspace-qYUZPJHR.js → flowWorkspace-Bf7H-r0t.js} +4 -4
  10. package/dist/browser/preview.js +5241 -5135
  11. package/dist/browser/workbench.js +1576 -1461
  12. package/dist/browser/{workbenchSelect-D8_vP2p5.js → workbenchSelect-C3e4J93X.js} +1 -1
  13. package/dist/command/index.js +22 -22
  14. package/dist/common/connector-proxy.d.ts +4 -1
  15. package/dist/common/control-api-conformance.js +23 -21
  16. package/dist/common/control-api.js +3454 -3452
  17. package/dist/common/control-requests.js +2032 -2032
  18. package/dist/common/decision.js +29 -6403
  19. package/dist/common/event-source-definition.d.ts +45 -0
  20. package/dist/common/event-source.d.ts +200 -1
  21. package/dist/common/event-source.js +22 -1
  22. package/dist/common/flow-schema.d.ts +2 -1
  23. package/dist/common/flow-schemaKeywords.d.ts +15 -0
  24. package/dist/common/flow-semantics.js +9797 -9795
  25. package/dist/common/integration-trigger.js +53 -6517
  26. package/dist/common/mcp.js +3389 -3389
  27. package/dist/common/openapi.js +29 -6493
  28. package/dist/common/poll-trigger.js +29 -6517
  29. package/dist/common/provider-triggers.js +6 -65
  30. package/dist/common/scheduler-checkpoint.d.ts +42 -0
  31. package/dist/common/scheduler-dependencies.d.ts +80 -0
  32. package/dist/common/scheduler-node-execution.d.ts +75 -0
  33. package/dist/common/scheduler.d.ts +5 -58
  34. package/dist/common/scheduler.js +575 -471
  35. package/dist/common/webhook-trigger.js +5 -6449
  36. package/dist/common/workflow.js +31 -916
  37. package/package.json +1 -1
@@ -0,0 +1,42 @@
1
+ import type { Graph, JsonValue } from '../browser/flow-change.js';
2
+ import type { DependenciesCheckpoint } from './scheduler-dependencies.js';
3
+ import type { ExecutableNode } from './scheduler-node-execution.js';
4
+ import type { AgentCheckpoint } from './runtime-contract.js';
5
+ export interface PendingWait {
6
+ readonly jobId: string;
7
+ readonly nodeId: string;
8
+ readonly value: JsonValue;
9
+ readonly waitId: string;
10
+ readonly pending?: JsonValue;
11
+ }
12
+ export interface PendingWorkflowCall {
13
+ readonly jobId: string;
14
+ readonly nodeId: string;
15
+ readonly childRunId: string;
16
+ readonly input: Readonly<Record<string, JsonValue>>;
17
+ }
18
+ export interface FlowRunCheckpoint {
19
+ readonly calls?: readonly PendingWorkflowCall[];
20
+ readonly bindingValues: Readonly<Record<string, string>>;
21
+ readonly inputs: Readonly<Record<string, Readonly<Record<string, JsonValue>>>>;
22
+ readonly results: Readonly<Record<string, {
23
+ readonly handled?: true;
24
+ readonly jobId: string;
25
+ readonly outputs: Readonly<Record<string, JsonValue>>;
26
+ readonly systemOutputs?: Readonly<Record<string, JsonValue>>;
27
+ }>>;
28
+ readonly counts: Readonly<Record<string, Readonly<Record<string, number>>>>;
29
+ readonly dependencies: DependenciesCheckpoint;
30
+ readonly version: 6;
31
+ readonly waits: readonly PendingWait[];
32
+ readonly agents: Readonly<Record<string, {
33
+ readonly invocationId: string;
34
+ readonly input: Readonly<Record<string, JsonValue>>;
35
+ readonly remainingMs?: number;
36
+ readonly checkpoint: AgentCheckpoint;
37
+ }>>;
38
+ }
39
+ export declare function decodeFlowRunCheckpoint(input: unknown): FlowRunCheckpoint;
40
+ export declare function validateCheckpoint(target: {
41
+ readonly graph: Graph;
42
+ }, checkpoint: FlowRunCheckpoint, resolveInputs: (nodeId: string, node: ExecutableNode) => Readonly<Record<string, JsonValue>>): void;
@@ -0,0 +1,80 @@
1
+ import type { Graph, JsonValue } from '../browser/flow-change.js';
2
+ import { z } from 'zod';
3
+ export interface DependenciesCheckpoint {
4
+ nextId: number;
5
+ iterations: Record<string, number>;
6
+ nodes: Record<string, DependencyState>;
7
+ }
8
+ interface DependencyState {
9
+ id: number;
10
+ status: 'pending' | 'running' | 'completed' | 'skipped';
11
+ input: Record<string, {
12
+ readonly execution: number;
13
+ readonly outputs: Readonly<Record<string, JsonValue>>;
14
+ readonly systemOutputs?: Readonly<Record<string, JsonValue>>;
15
+ }>;
16
+ systemOutputs?: Readonly<Record<string, JsonValue>>;
17
+ output?: Readonly<Record<string, JsonValue>>;
18
+ previous: string[];
19
+ released: string[];
20
+ jobId?: string;
21
+ seeded: boolean;
22
+ }
23
+ type InputSnapshot = DependenciesCheckpoint['nodes'][string]['input'];
24
+ export declare function dependencyValues(input: InputSnapshot): Readonly<Record<string, Readonly<Record<string, JsonValue>>>>;
25
+ export declare const dependenciesSchema: z.ZodObject<{
26
+ nextId: z.ZodNumber;
27
+ iterations: z.ZodRecord<z.ZodString, z.ZodNumber>;
28
+ nodes: z.ZodRecord<z.ZodString, z.ZodObject<{
29
+ id: z.ZodNumber;
30
+ status: z.ZodEnum<{
31
+ completed: "completed";
32
+ pending: "pending";
33
+ running: "running";
34
+ skipped: "skipped";
35
+ }>;
36
+ input: z.ZodRecord<z.ZodString, z.ZodObject<{
37
+ execution: z.ZodNumber;
38
+ outputs: z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
39
+ systemOutputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
40
+ }, z.core.$strict>>;
41
+ output: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
42
+ systemOutputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
43
+ previous: z.ZodArray<z.ZodString>;
44
+ released: z.ZodArray<z.ZodString>;
45
+ jobId: z.ZodOptional<z.ZodString>;
46
+ seeded: z.ZodBoolean;
47
+ }, z.core.$strict>>;
48
+ }, z.core.$strict>;
49
+ /** Dependency completion belongs to an invocation, never to a Run-wide latest-result table. */
50
+ export declare class Dependencies {
51
+ readonly state: DependenciesCheckpoint;
52
+ private readonly forward;
53
+ private readonly loops;
54
+ private readonly innerLoopsFirst;
55
+ private readonly outgoing;
56
+ private readonly incoming;
57
+ private readonly candidates;
58
+ private readonly frames;
59
+ private readonly graph;
60
+ constructor(graph: Graph, saved?: DependenciesCheckpoint);
61
+ private fresh;
62
+ private validate;
63
+ start(nodeId: string, outputs: Readonly<Record<string, JsonValue>>): void;
64
+ private edge;
65
+ private edgeResult;
66
+ input(nodeId: string, sourceId: string): InputSnapshot[string] | undefined;
67
+ private snapshot;
68
+ private collectInputs;
69
+ private loopSettled;
70
+ private blockedByLoop;
71
+ private continuationPending;
72
+ private selectedIncoming;
73
+ private readyAcyclic;
74
+ /** Resolve skips and iteration boundaries before admitting another invocation. */
75
+ ready(): string[];
76
+ begin(nodeId: string, jobId: string): void;
77
+ release(nodeId: string, outputs: Readonly<Record<string, JsonValue>>, handles: readonly string[], complete: boolean, systemOutputs?: Readonly<Record<string, JsonValue>>): void;
78
+ get incomplete(): boolean;
79
+ }
80
+ export {};
@@ -0,0 +1,75 @@
1
+ import type { AgentConfig } from './flow-agent.js';
2
+ import type { Graph, GraphNode, JsonValue, TriggerNode } from '../browser/flow-change.js';
3
+ import type { WebhookResponseSnapshot } from './webhook-response.js';
4
+ import type { FlowRunCheckpoint } from './scheduler-checkpoint.js';
5
+ import type { Dependencies } from './scheduler-dependencies.js';
6
+ import type { AgentCheckpoint } from './runtime-contract.js';
7
+ import type { FlowRunOptions, SchedulerEvent, SchedulerFailure } from './scheduler.js';
8
+ import * as Effect from 'effect/Effect';
9
+ import { z } from 'zod';
10
+ interface NodeExecutionContext {
11
+ readonly createId: FlowRunOptions['createId'];
12
+ readonly emit: (event: SchedulerEvent) => Effect.Effect<void, Error>;
13
+ readonly invokeTask: FlowRunOptions['invokeTask'];
14
+ readonly projectFailure: FlowRunOptions['projectFailure'];
15
+ }
16
+ export declare class PortValidationError extends Error {
17
+ }
18
+ export type ExecutableNode = Exclude<GraphNode, TriggerNode>;
19
+ export declare function usesPending(graph: Graph, nodeId: string): boolean;
20
+ export declare class NodeValidationError extends PortValidationError {
21
+ readonly code: 'node.input-invalid' | 'node.output-invalid' | 'webhook.response-status-invalid' | 'webhook.response-headers-invalid';
22
+ constructor(code: NodeValidationError['code'], error: unknown);
23
+ }
24
+ export declare function nodeFailure(error: unknown, project: FlowRunOptions['projectFailure']): SchedulerFailure;
25
+ export declare function nodeTitle(node: GraphNode): string | undefined;
26
+ export declare function jsonValue(value: unknown, description: string, depth?: number): JsonValue;
27
+ export declare const agentCheckpointSchema: z.ZodObject<{
28
+ state: z.ZodJSONSchema;
29
+ callId: z.ZodString;
30
+ toolId: z.ZodString;
31
+ input: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
32
+ rounds: z.ZodNumber;
33
+ version: z.ZodLiteral<1>;
34
+ }, z.core.$strict>;
35
+ export declare function jsonEqual(left: JsonValue, right: JsonValue): boolean;
36
+ export declare function outputRecord(value: unknown, nodeId: string): Readonly<Record<string, JsonValue>>;
37
+ export declare function agentConfig(node: ExecutableNode): AgentConfig | undefined;
38
+ export declare function agentNotice(node: ExecutableNode, values: Readonly<Record<string, JsonValue>>): {
39
+ messageHandle: string;
40
+ input: {
41
+ [k: string]: JsonValue;
42
+ };
43
+ } | undefined;
44
+ export declare function agentApproval(config: AgentConfig, checkpoint: AgentCheckpoint, inputs: Readonly<Record<string, JsonValue>>): JsonValue;
45
+ export declare function validateOutputs(nodeId: string, node: ExecutableNode, value: unknown): Readonly<Record<string, JsonValue>>;
46
+ export type NodeResult = {
47
+ readonly kind: 'calling';
48
+ readonly childRunId: string;
49
+ readonly input: Readonly<Record<string, JsonValue>>;
50
+ } | {
51
+ readonly kind: 'completed';
52
+ readonly releasedHandles?: readonly string[];
53
+ readonly outputs: Readonly<Record<string, JsonValue>>;
54
+ readonly response?: WebhookResponseSnapshot;
55
+ } | {
56
+ readonly kind: 'suspended';
57
+ readonly value: JsonValue;
58
+ readonly agent: FlowRunCheckpoint['agents'][string];
59
+ };
60
+ export declare function resolveNodeInputs(nodeId: string, node: ExecutableNode, dependencies: Pick<Dependencies, 'input'>, bindingValues: Readonly<Record<string, string>>, launchInputs?: Readonly<Record<string, JsonValue>>): Readonly<Record<string, JsonValue>>;
61
+ export declare function executeNode(context: NodeExecutionContext, input: {
62
+ readonly nodeId: string;
63
+ readonly node: ExecutableNode;
64
+ readonly jobId: string;
65
+ readonly nodeInputs: Readonly<Record<string, JsonValue>>;
66
+ readonly flowId: string;
67
+ readonly runId: string;
68
+ readonly graph: Graph;
69
+ readonly dependencies: Pick<Dependencies, 'input'>;
70
+ readonly previousIds: readonly string[];
71
+ readonly saved?: FlowRunCheckpoint['agents'][string];
72
+ readonly workflowRunId?: string;
73
+ readonly resolution?: 'approve' | 'reject';
74
+ }): Effect.Effect<NodeResult, Error>;
75
+ export {};
@@ -2,8 +2,13 @@ import type { ConnectorCapability, JsonValue, WaitAction, WaitAutoContinue } fro
2
2
  import type { PreparedFlow } from './flow-semantics.js';
3
3
  import type { WebhookResponseSnapshot } from './webhook-response.js';
4
4
  import type { PreviousNode } from '../index.js';
5
+ import type { FlowRunCheckpoint } from './scheduler-checkpoint.js';
5
6
  import type { AgentCheckpoint } from './runtime-contract.js';
6
7
  import * as Effect from 'effect/Effect';
8
+ export type { DependenciesCheckpoint } from './scheduler-dependencies.js';
9
+ export type { FlowRunCheckpoint, PendingWait, PendingWorkflowCall } from './scheduler-checkpoint.js';
10
+ export { decodeFlowRunCheckpoint } from './scheduler-checkpoint.js';
11
+ export { PortValidationError } from './scheduler-node-execution.js';
7
12
  export declare const withWaitNotificationMessage: (value: JsonValue) => JsonValue;
8
13
  export declare const normalizeWaitComment: (value?: string | null) => string | null;
9
14
  export declare const waitAutoContinueAt: (config: WaitAutoContinue, waitingSince: number) => number;
@@ -12,8 +17,6 @@ export interface WaitResolution {
12
17
  readonly resolvedAt: string;
13
18
  readonly comment: string | null;
14
19
  }
15
- export declare class PortValidationError extends Error {
16
- }
17
20
  export type SchedulerEvent = {
18
21
  readonly flowId: string;
19
22
  readonly parentJobId?: string;
@@ -81,13 +84,6 @@ export interface FlowRunResult {
81
84
  readonly outputs: Readonly<Record<string, JsonValue>>;
82
85
  }[];
83
86
  }
84
- export interface PendingWait {
85
- readonly jobId: string;
86
- readonly nodeId: string;
87
- readonly value: JsonValue;
88
- readonly waitId: string;
89
- readonly pending?: JsonValue;
90
- }
91
87
  export interface WaitRequest {
92
88
  readonly autoContinue?: WaitAutoContinue;
93
89
  readonly jobId: string;
@@ -115,53 +111,6 @@ export interface WaitHost {
115
111
  readonly resolutions: (waitIds: readonly string[], block: boolean) => Effect.Effect<Readonly<Record<string, WaitResolution>>, Error>;
116
112
  }
117
113
  export declare const waitRetentionMs = 120000;
118
- export interface DependenciesCheckpoint {
119
- nextId: number;
120
- iterations: Record<string, number>;
121
- nodes: Record<string, DependencyState>;
122
- }
123
- interface DependencyState {
124
- id: number;
125
- status: 'pending' | 'running' | 'completed' | 'skipped';
126
- input: Record<string, {
127
- readonly execution: number;
128
- readonly outputs: Readonly<Record<string, JsonValue>>;
129
- readonly systemOutputs?: Readonly<Record<string, JsonValue>>;
130
- }>;
131
- systemOutputs?: Readonly<Record<string, JsonValue>>;
132
- output?: Readonly<Record<string, JsonValue>>;
133
- previous: string[];
134
- released: string[];
135
- jobId?: string;
136
- seeded: boolean;
137
- }
138
- export interface PendingWorkflowCall {
139
- readonly jobId: string;
140
- readonly nodeId: string;
141
- readonly childRunId: string;
142
- readonly input: Readonly<Record<string, JsonValue>>;
143
- }
144
- export interface FlowRunCheckpoint {
145
- readonly calls?: readonly PendingWorkflowCall[];
146
- readonly bindingValues: Readonly<Record<string, string>>;
147
- readonly inputs: Readonly<Record<string, Readonly<Record<string, JsonValue>>>>;
148
- readonly results: Readonly<Record<string, {
149
- readonly handled?: true;
150
- readonly jobId: string;
151
- readonly outputs: Readonly<Record<string, JsonValue>>;
152
- readonly systemOutputs?: Readonly<Record<string, JsonValue>>;
153
- }>>;
154
- readonly counts: Readonly<Record<string, Readonly<Record<string, number>>>>;
155
- readonly dependencies: DependenciesCheckpoint;
156
- readonly version: 6;
157
- readonly waits: readonly PendingWait[];
158
- readonly agents: Readonly<Record<string, {
159
- readonly invocationId: string;
160
- readonly input: Readonly<Record<string, JsonValue>>;
161
- readonly remainingMs?: number;
162
- readonly checkpoint: AgentCheckpoint;
163
- }>>;
164
- }
165
114
  export type FlowRunOutcome = FlowRunResult | {
166
115
  readonly checkpoint: FlowRunCheckpoint;
167
116
  readonly kind: 'waiting';
@@ -223,6 +172,4 @@ export type RunLaunch = {
223
172
  readonly inputs?: never;
224
173
  readonly trigger?: never;
225
174
  };
226
- export declare function decodeFlowRunCheckpoint(input: unknown): FlowRunCheckpoint;
227
175
  export declare function runFlow(prepared: PreparedFlow, options: FlowRunOptions): Effect.Effect<FlowRunOutcome, Error>;
228
- export {};