@oomol-lab/open-flow 0.1.0-beta.11 → 0.1.0-beta.13

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 (52) hide show
  1. package/dist/browser/{DesignerIcon-ckcKnxxJ.js → DesignerIcon-Bzpx8BtG.js} +7 -2
  2. package/dist/browser/{_virtual_open-flow-twemoji-DJwKsM_w.js → _virtual_open-flow-twemoji-CpHJOEsk.js} +4028 -2
  3. package/dist/browser/carbon-Cn-DTyjG.js +54 -0
  4. package/dist/browser/{createResourceDialog-DhIU-HYW.js → createResourceDialog-Cdixb0WC.js} +16 -16
  5. package/dist/browser/{dist-BZ5PTFAs.js → dist-D1VYgicl.js} +426 -305
  6. package/dist/browser/{dist-Bmb2mZvW.js → dist-DYjIVIZC.js} +22 -22
  7. package/dist/browser/{dist-Ce71Szg7.js → dist-DwvhuMxw.js} +15 -15
  8. package/dist/browser/{dist-DY4qlXTK.js → dist-TJfrvoIQ.js} +21 -21
  9. package/dist/browser/{esm-C64_h7HF.js → esm-nAA6DHox.js} +1 -1
  10. package/dist/browser/flow-authoring-node.d.ts +4 -0
  11. package/dist/browser/flow-authoring.d.ts +1 -1
  12. package/dist/browser/flow-authoring.js +1528 -1443
  13. package/dist/browser/flow-change-schema.d.ts +4 -1
  14. package/dist/browser/flow-change.d.ts +42 -0
  15. package/dist/browser/flow-change.js +457 -403
  16. package/dist/browser/{flowChanges-BINNGoug.js → flowChanges-CX0dLRzD.js} +2817 -1613
  17. package/dist/browser/{flowWorkspace-Dp_b8KXF.js → flowWorkspace-BhpxeXhY.js} +51950 -50685
  18. package/dist/browser/host-conformance.d.ts +7 -0
  19. package/dist/browser/host-conformance.js +33 -0
  20. package/dist/browser/inputValues-CFlfnXlS.js +30 -0
  21. package/dist/browser/licenses.md +3 -1
  22. package/dist/browser/{select-CbQHq-GM.js → select-DCGY8Lom.js} +2580 -2003
  23. package/dist/browser/{typeScriptSession-BoV-FDl3.js → typeScriptSession-DnAmJCzu.js} +6 -6
  24. package/dist/browser/workbench.css +1 -1
  25. package/dist/browser/workbench.js +847 -780
  26. package/dist/browser/workbenchSelect-DdXtOYD1.js +30 -0
  27. package/dist/common/control-api-conformance.d.ts +6 -0
  28. package/dist/common/control-api-conformance.js +5379 -192
  29. package/dist/common/control-api.d.ts +244 -11
  30. package/dist/common/control-api.js +5535 -460
  31. package/dist/common/control-requests.d.ts +68 -0
  32. package/dist/common/control-requests.js +4949 -0
  33. package/dist/common/flow-agent.d.ts +10 -0
  34. package/dist/common/flow-encoding.d.ts +3 -1
  35. package/dist/common/flow-encoding.js +4790 -59
  36. package/dist/common/flow-json.d.ts +2 -0
  37. package/dist/common/flow-semantics.d.ts +4 -2
  38. package/dist/common/flow-semantics.js +4517 -3456
  39. package/dist/common/mcp-conformance.d.ts +2 -0
  40. package/dist/common/mcp.d.ts +545 -0
  41. package/dist/common/mcp.js +5007 -0
  42. package/dist/common/run-events.js +2 -1
  43. package/dist/common/run-lifecycle.d.ts +4 -0
  44. package/dist/common/run-lifecycle.js +30 -0
  45. package/dist/common/run-results.d.ts +56 -0
  46. package/dist/common/runtime-contract.d.ts +24 -0
  47. package/dist/common/scheduler.d.ts +29 -9
  48. package/dist/common/scheduler.js +3249 -2312
  49. package/package.json +13 -1
  50. package/dist/browser/carbon-DMCVsjHo.js +0 -53
  51. package/dist/browser/waitNotificationInputs-fzyKN6mk.js +0 -29
  52. package/dist/browser/workbenchSelect-BjbJjlNd.js +0 -435
@@ -1,5 +1,6 @@
1
1
  //#region src/execution/common/events.ts
2
2
  var e = new TextEncoder(), t = /* @__PURE__ */ new Set([
3
+ "agent",
3
4
  "condition",
4
5
  "connector",
5
6
  "javascript",
@@ -106,7 +107,7 @@ function f(e, t) {
106
107
  }
107
108
  });
108
109
  }
109
- if (_ == "node.cache-hit" || _ == "node.preview" || _ == "run.completed" || _ == "run.failed" || _ == "run.output") {
110
+ if (_ == "run.completed" || _ == "run.failed") {
110
111
  o(g);
111
112
  return;
112
113
  }
@@ -10,6 +10,8 @@ export type RunOperation = {
10
10
  readonly kind: 'wait';
11
11
  } | {
12
12
  readonly kind: 'resolve';
13
+ } | {
14
+ readonly kind: 'fail-start' | 'fail-resume';
13
15
  } | {
14
16
  readonly kind: 'commit';
15
17
  readonly status: RunTerminalStatus;
@@ -72,6 +74,8 @@ export interface RunLifecycleHarness {
72
74
  }): Promise<RunAcceptance>;
73
75
  claim(runId: string): Promise<RunClaim>;
74
76
  commit(runId: string, status: RunTerminalStatus): Promise<boolean>;
77
+ failStarting(runId: string): Promise<boolean>;
78
+ failResume(runId: string): Promise<boolean>;
75
79
  observe(runId: string): Promise<RunObservation>;
76
80
  resolve(runId: string): Promise<boolean>;
77
81
  start(runId: string): Promise<RunStart>;
@@ -91,6 +91,14 @@ function a(e, t) {
91
91
  kind: "stale",
92
92
  status: e
93
93
  };
94
+ case "fail-start":
95
+ case "fail-resume": return e == "starting" ? {
96
+ kind: "committed",
97
+ status: t.kind == "fail-start" ? "failed" : "indeterminate"
98
+ } : {
99
+ kind: "stale",
100
+ status: e
101
+ };
94
102
  case "commit": return i(e) ? {
95
103
  kind: "stale",
96
104
  status: e
@@ -115,6 +123,28 @@ async function s(e, t = "request", n = "request-a") {
115
123
  return r.runId;
116
124
  }
117
125
  var c = [
126
+ {
127
+ name: "rejects startup failures outside the start barrier and preserves their terminal",
128
+ async verify(e) {
129
+ for (let t of ["failStarting", "failResume"]) {
130
+ let n = await s(e, t);
131
+ o(await e[t](n), !1, "Failure before claim"), await e.claim(n), o(await e.commit(n, "completed"), !1, "Completion before start"), o(await e[t](n), !0, "Startup failure");
132
+ let r = t == "failStarting" ? "failed" : "indeterminate";
133
+ o(await e.observe(n), {
134
+ status: r,
135
+ terminalEvents: [r]
136
+ }, "Startup terminal"), o(await e[t](n), !1, "Repeated startup failure"), o(await e.start(n), {
137
+ kind: "stale",
138
+ status: r
139
+ }, "Start after failure"), o(await e.commit(n, "canceled"), !1, "Cancellation after failure");
140
+ }
141
+ let t = await s(e, "running");
142
+ await e.claim(t), await e.start(t), o(await e.failStarting(t), !1, "Startup failure after start"), o(await e.failResume(t), !1, "Resume failure after start"), o(await e.observe(t), {
143
+ status: "running",
144
+ terminalEvents: []
145
+ }, "Running observation");
146
+ }
147
+ },
118
148
  {
119
149
  name: "pauses and resumes the same Run through the ordinary start barrier",
120
150
  async verify(e) {
@@ -0,0 +1,56 @@
1
+ import type { JsonValue } from '../browser/flow-change.js';
2
+ export type ResultCall = {
3
+ readonly id: string;
4
+ readonly kind: 'connector';
5
+ readonly action: string;
6
+ readonly connectionId?: string;
7
+ } | {
8
+ readonly id: string;
9
+ readonly kind: 'code';
10
+ };
11
+ export interface ResultInfo {
12
+ readonly resultId: string;
13
+ readonly callId: string;
14
+ readonly toolId: string;
15
+ readonly source: {
16
+ readonly kind: 'connector';
17
+ readonly action: string;
18
+ } | {
19
+ readonly kind: 'code';
20
+ };
21
+ readonly bytes: number;
22
+ readonly digest: string;
23
+ readonly createdAt: string;
24
+ }
25
+ interface ResultEntry {
26
+ readonly pointer: string;
27
+ readonly type: 'object' | 'array' | 'string' | 'number' | 'boolean' | 'null';
28
+ readonly length?: number;
29
+ readonly complete: boolean;
30
+ readonly value?: JsonValue;
31
+ }
32
+ export interface ResultPage extends ResultEntry {
33
+ readonly offset: number;
34
+ readonly nextOffset?: number;
35
+ readonly entries?: readonly ResultEntry[];
36
+ }
37
+ export interface ResultQuery {
38
+ readonly pointer?: string;
39
+ readonly offset?: number;
40
+ readonly limit?: number;
41
+ }
42
+ export declare function parseResultQuery(value: unknown): Required<ResultQuery>;
43
+ export declare function decodeResultList(value: unknown): {
44
+ readonly version: 1;
45
+ readonly runId: string;
46
+ readonly results: readonly ResultInfo[];
47
+ readonly nextAfter?: string;
48
+ };
49
+ export declare function decodeResultRead(value: unknown): {
50
+ readonly version: 1;
51
+ readonly runId: string;
52
+ readonly result: ResultInfo;
53
+ readonly page: ResultPage;
54
+ };
55
+ export declare function readResult(value: JsonValue, query?: ResultQuery): ResultPage;
56
+ export {};
@@ -36,6 +36,30 @@ export type LlmTaskResult = {
36
36
  readonly version: 1;
37
37
  };
38
38
  export type InvokeLlmTask = (invocation: LlmTaskInvocation) => Promise<LlmTaskResult>;
39
+ export interface AgentCheckpoint {
40
+ readonly state: JsonValue;
41
+ readonly callId: string;
42
+ readonly toolId: string;
43
+ readonly input: Readonly<Record<string, JsonValue>>;
44
+ readonly rounds: number;
45
+ readonly version: 1;
46
+ }
47
+ export type AgentResult = {
48
+ readonly kind: 'completed';
49
+ readonly output: JsonValue;
50
+ } | {
51
+ readonly kind: 'suspended';
52
+ readonly checkpoint: AgentCheckpoint;
53
+ };
54
+ export interface AgentInvocation {
55
+ readonly input: Readonly<Record<string, JsonValue>>;
56
+ readonly invocationId: string;
57
+ readonly signal: AbortSignal;
58
+ readonly resume?: {
59
+ readonly action: 'approve' | 'reject';
60
+ readonly checkpoint: AgentCheckpoint;
61
+ };
62
+ }
39
63
  export interface RuntimeInvocation {
40
64
  readonly capabilities?: readonly ConnectorCapability[];
41
65
  readonly capability: (call: RuntimeCapabilityCall) => Promise<RuntimeCapabilityResponse>;
@@ -1,5 +1,6 @@
1
1
  import type { ConnectorCapability, JsonValue, WaitAction } from '../browser/flow-change.js';
2
2
  import type { PreparedFlow } from './flow-semantics.js';
3
+ import type { AgentCheckpoint } from './runtime-contract.js';
3
4
  import * as Effect from 'effect/Effect';
4
5
  export type SchedulerEvent = {
5
6
  readonly flowId: string;
@@ -17,7 +18,7 @@ export type SchedulerEvent = {
17
18
  readonly inputs: Readonly<Record<string, JsonValue>>;
18
19
  readonly jobId: string;
19
20
  readonly nodeId: string;
20
- readonly nodeKind: 'condition' | 'connector' | 'javascript' | 'llm' | 'subflow' | 'value' | 'wait';
21
+ readonly nodeKind: 'agent' | 'condition' | 'connector' | 'javascript' | 'llm' | 'subflow' | 'value' | 'wait';
21
22
  readonly nodeTitle?: string;
22
23
  readonly runId: string;
23
24
  readonly type: 'node.started';
@@ -67,7 +68,14 @@ export interface FlowRunCheckpoint {
67
68
  readonly outputs: Readonly<Record<string, JsonValue>>;
68
69
  }>>;
69
70
  readonly skipped: readonly string[];
70
- readonly version: 1;
71
+ readonly version: 2;
72
+ readonly queue: readonly FlowRunCheckpoint['wait'][];
73
+ readonly agents: Readonly<Record<string, {
74
+ readonly invocationId: string;
75
+ readonly input: Readonly<Record<string, JsonValue>>;
76
+ readonly remainingMs?: number;
77
+ readonly checkpoint: AgentCheckpoint;
78
+ }>>;
71
79
  readonly wait: {
72
80
  readonly jobId: string;
73
81
  readonly nodeId: string;
@@ -85,6 +93,7 @@ export type FlowRunOutcome = FlowRunResult | {
85
93
  };
86
94
  readonly wait: {
87
95
  readonly actions: readonly ['continue'] | readonly ['approve', 'reject'];
96
+ readonly prompt: string;
88
97
  readonly jobId: string;
89
98
  readonly nodeId: string;
90
99
  readonly waitId: string;
@@ -96,6 +105,10 @@ export interface SubflowRunResult {
96
105
  readonly target: 'subflow';
97
106
  }
98
107
  interface TaskInvocationBase {
108
+ readonly agent?: {
109
+ readonly action: 'approve' | 'reject';
110
+ readonly checkpoint: AgentCheckpoint;
111
+ };
99
112
  readonly additionalInputs: Readonly<Record<string, JsonValue>>;
100
113
  readonly blockId: string;
101
114
  readonly flowId: string;
@@ -119,21 +132,28 @@ export interface SchedulerFailure {
119
132
  readonly code: string;
120
133
  readonly message: string;
121
134
  }
122
- export interface FlowRunOptions {
123
- readonly bindingValues?: Readonly<Record<string, string>>;
135
+ export type FlowRunOptions = {
124
136
  readonly createId: () => string;
125
137
  readonly emit?: (event: SchedulerEvent) => Effect.Effect<void, Error>;
126
138
  readonly flowId: string;
127
- readonly inputs?: Readonly<Record<string, Readonly<Record<string, JsonValue>>>>;
128
139
  readonly invokeTask: (invocation: TaskInvocation) => Effect.Effect<unknown, Error>;
129
140
  readonly projectFailure?: (error: unknown) => SchedulerFailure;
130
- readonly resume?: {
141
+ readonly runId: string;
142
+ } & RunLaunch;
143
+ export type RunLaunch = {
144
+ readonly bindingValues?: Readonly<Record<string, string>>;
145
+ readonly inputs?: Readonly<Record<string, Readonly<Record<string, JsonValue>>>>;
146
+ readonly trigger: TriggerSeed;
147
+ readonly resume?: never;
148
+ } | {
149
+ readonly resume: {
131
150
  readonly action: WaitAction;
132
151
  readonly checkpoint: unknown;
133
152
  };
134
- readonly runId: string;
135
- readonly trigger?: TriggerSeed;
136
- }
153
+ readonly bindingValues?: never;
154
+ readonly inputs?: never;
155
+ readonly trigger?: never;
156
+ };
137
157
  export declare function decodeFlowRunCheckpoint(input: unknown): FlowRunCheckpoint;
138
158
  export declare function runFlow(prepared: PreparedFlow, options: FlowRunOptions): Effect.Effect<FlowRunOutcome, Error>;
139
159
  export {};