@oomol-lab/open-flow 0.1.0-beta.23 → 0.1.0-beta.26

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 (38) hide show
  1. package/dist/browser/{createResourceDialog-PKbMMpEk.js → createResourceDialog-BwI2JmPE.js} +7 -7
  2. package/dist/browser/flow-authoring.js +249 -250
  3. package/dist/browser/flow-change.d.ts +16 -7
  4. package/dist/browser/flow-change.js +824 -804
  5. package/dist/browser/{flowChanges-BUlMz4iC.js → flowChanges-BqPtWEI9.js} +2706 -2906
  6. package/dist/browser/{flowWorkspace-DLArN17T.js → flowWorkspace-CpMGzmfz.js} +37249 -35916
  7. package/dist/browser/{inputValues-CcGVt51C.js → inputValues-CeeJw_G8.js} +1 -1
  8. package/dist/browser/licenses.md +24 -0
  9. package/dist/browser/{lite-Cy6aeiL6.js → lite-BuKZ8joP.js} +50 -43
  10. package/dist/browser/{input-group-C2frNYAx.js → switch-CyZ96-UF.js} +1519 -612
  11. package/dist/browser/theme.css +30 -4
  12. package/dist/browser/ui-input.d.ts +3 -1
  13. package/dist/browser/ui.css +1 -1
  14. package/dist/browser/ui.js +10 -8
  15. package/dist/browser/warmCodeTheme-DVv4-rDO.js +35 -0
  16. package/dist/browser/workbench.css +1 -1
  17. package/dist/browser/workbench.js +753 -714
  18. package/dist/browser/{workbenchSelect-CPRUXKbf.js → workbenchSelect-BUu7CjUA.js} +504 -490
  19. package/dist/common/control-api-conformance.js +18 -18
  20. package/dist/common/control-api.d.ts +43 -15
  21. package/dist/common/control-api.js +1803 -1755
  22. package/dist/common/control-requests.js +2 -7
  23. package/dist/common/engine-contract.d.ts +2 -2
  24. package/dist/common/flow-encoding.js +587 -589
  25. package/dist/common/flow-graph.d.ts +31 -1
  26. package/dist/common/flow-schema.d.ts +11 -1
  27. package/dist/common/flow-semantics.d.ts +2 -1
  28. package/dist/common/flow-semantics.js +1542 -1457
  29. package/dist/common/mcp.d.ts +1 -0
  30. package/dist/common/mcp.js +308 -260
  31. package/dist/common/provider-triggers.js +934 -931
  32. package/dist/common/run-lifecycle.d.ts +1 -1
  33. package/dist/common/run-lifecycle.js +5 -5
  34. package/dist/common/runtime-contract.d.ts +2 -0
  35. package/dist/common/runtime-contract.js +96 -32
  36. package/dist/common/scheduler.d.ts +39 -21
  37. package/dist/common/scheduler.js +2358 -2339
  38. package/package.json +1 -1
@@ -4613,12 +4613,7 @@ var z = E(), B = Ws(), nc = A(z), rc = j({
4613
4613
  defaultOutput: z.optional()
4614
4614
  }, _c = {
4615
4615
  actions: M([hs([F("continue")]), hs([F("approve"), F("reject")])]),
4616
- prompt: z,
4617
- notification: j({
4618
- inputs: lc,
4619
- messageHandle: z,
4620
- taskId: z
4621
- }).optional()
4616
+ prompt: z
4622
4617
  }, vc = {
4623
4618
  inputsDef: A(V),
4624
4619
  options: j({
@@ -4711,7 +4706,7 @@ var z = E(), B = Ws(), nc = A(z), rc = j({
4711
4706
  taskId: z,
4712
4707
  additionalInputs: A(V).optional()
4713
4708
  }),
4714
- j({
4709
+ cs({
4715
4710
  ...Cc,
4716
4711
  kind: F("wait"),
4717
4712
  input: V,
@@ -5042,7 +5037,12 @@ function zc(e) {
5042
5037
  progress: Bc(i.progress)
5043
5038
  }
5044
5039
  };
5045
- case "run.waiting": return {
5040
+ case "run.waiting": return Array.isArray(i.waitIds) ? {
5041
+ ...r,
5042
+ kind: a,
5043
+ payload: { waitIds: i.waitIds.map((e) => R(e)) }
5044
+ } : L();
5045
+ case "wait.created": return {
5046
5046
  ...r,
5047
5047
  kind: a,
5048
5048
  payload: {
@@ -5173,7 +5173,7 @@ function Bc(e) {
5173
5173
  }
5174
5174
  //#endregion
5175
5175
  //#region src/control/common/conformance.ts
5176
- var U = "open-flow-engine/v2";
5176
+ var U = "open-flow-engine/v4";
5177
5177
  function W(e) {
5178
5178
  throw Error(e);
5179
5179
  }
@@ -5700,15 +5700,15 @@ var Yc = [
5700
5700
  headers: { "idempotency-key": t },
5701
5701
  method: "POST"
5702
5702
  }), 202, n), a = await i("wait-run", "Create Wait Run"), o = J(a.runId, "Wait Run runId"), s = a;
5703
- for (let t = 0; s.status != "waiting" && t < 200; t += 1) await new Promise((e) => setTimeout(e, 10)), s = await Y(await Z(e, `/v1/runs/${o}`), 200, "Read Wait Run");
5704
- G(s.status, "waiting", "Wait Run status");
5705
- let c = K(s.waiting, "Active Wait");
5703
+ for (let t = 0; q(s.waits, "Waits").length == 0 && t < 200; t += 1) await new Promise((e) => setTimeout(e, 10)), s = await Y(await Z(e, `/v1/runs/${o}`), 200, "Read Wait Run");
5704
+ G(s.status, "running", "Wait Run status");
5705
+ let c = K(q(s.waits, "Waits")[0], "Active Wait");
5706
5706
  G(c.actions, ["approve", "reject"], "Wait actions"), G(c.nodeId, "approval", "Wait node"), G(c.prompt, "Approve request 1?", "Wait prompt"), J(c.expiresAt, "Wait expiry"), J(c.waitingSince, "Wait start");
5707
5707
  let l = J(c.waitId, "Wait id");
5708
- G(q((await Y(await Z(e, `/v1/flows/${n}/runs?status=waiting`), 200, "List waiting Runs")).runs, "Waiting Runs").map((e) => K(e, "Waiting Run").runId), [o], "Waiting Run list");
5708
+ G(q((await Y(await Z(e, `/v1/flows/${n}/runs?pendingWait=true`), 200, "List waiting Runs")).runs, "Waiting Runs").map((e) => K(e, "Waiting Run").runId), [o], "Waiting Run list");
5709
5709
  let u = await Y(await Z(e, `/v1/runs/${o}/events`), 200, "Read waiting Run events");
5710
5710
  for (let e of q(u.events, "Run events")) zc(e);
5711
- G(u.done, !1, "Waiting events done"), q(u.events, "Waiting events").some((e) => K(e, "Waiting event").kind == "run.waiting") || W("Waiting Run must contain run.waiting."), await X(await Z(e, `/v1/runs/${o}/result`), 409, "run.not-terminal", "Read waiting Run result");
5711
+ G(u.done, !1, "Waiting events done"), q(u.events, "Waiting events").some((e) => K(e, "Waiting event").kind == "wait.created") || W("Waiting Run must contain wait.created."), await X(await Z(e, `/v1/runs/${o}/result`), 409, "run.not-terminal", "Read waiting Run result");
5712
5712
  let d = `/v1/runs/${o}/waits/${l}/resolve`, f = (t) => Z(e, d, {
5713
5713
  body: JSON.stringify({
5714
5714
  action: t,
@@ -5718,19 +5718,19 @@ var Yc = [
5718
5718
  });
5719
5719
  await X(await f("continue"), 400, "run.invalid", "Reject unsupported Wait action");
5720
5720
  let p = await Y(await f("approve"), 200, "Approve Wait");
5721
- G(p.action, "approve", "Approved action"), G(p.resolutionAccepted, !0, "Approved resolution"), G(p.status, "queued", "Resolved Run status"), J(p.resolvedAt, "Wait resolution time");
5721
+ G(p.action, "approve", "Approved action"), G(p.resolutionAccepted, !0, "Approved resolution"), G(p.status, "running", "Resolved Run status"), J(p.resolvedAt, "Wait resolution time");
5722
5722
  let m = await Y(await f("reject"), 200, "Reject resolved Wait");
5723
5723
  G(m.action, "approve", "Winning action"), G(m.resolutionAccepted, !1, "Competing resolution");
5724
5724
  for (let t = 0; s.status != "completed" && t < 200; t += 1) await new Promise((e) => setTimeout(e, 10)), s = await Y(await Z(e, `/v1/runs/${o}`), 200, "Read resumed Run");
5725
- G(s.status, "completed", "Resumed Run status"), G(s.waiting, void 0, "Completed Wait projection");
5725
+ G(s.status, "completed", "Resumed Run status"), G(s.waits, [], "Completed Wait projection");
5726
5726
  let ee = await Y(await f("approve"), 200, "Replay approved Wait");
5727
5727
  G(ee.resolutionAccepted, !0, "Replayed resolution"), G(ee.status, "completed", "Replayed terminal status");
5728
5728
  let te = await Y(await Z(e, `/v1/runs/${o}/events`), 200, "Read resumed Run events");
5729
5729
  for (let e of q(te.events, "Run events")) zc(e);
5730
5730
  G(q(te.events, "Completed events").filter((e) => K(e, "Completed event").kind == "run.resolved").length, 1, "Resolved event count");
5731
5731
  let ne = await i("wait-run-cancel", "Create cancelable Wait Run"), re = J(ne.runId, "Cancelable Wait Run id"), ie = ne;
5732
- for (let t = 0; ie.status != "waiting" && t < 200; t += 1) await new Promise((e) => setTimeout(e, 10)), ie = await Y(await Z(e, `/v1/runs/${re}`), 200, "Read cancelable Wait Run");
5733
- G(ie.status, "waiting", "Cancelable Wait status"), G((await Y(await Z(e, `/v1/runs/${re}/cancel`, {
5732
+ for (let t = 0; q(ie.waits, "Waits").length == 0 && t < 200; t += 1) await new Promise((e) => setTimeout(e, 10)), ie = await Y(await Z(e, `/v1/runs/${re}`), 200, "Read cancelable Wait Run");
5733
+ G(ie.status, "running", "Cancelable Wait status"), G((await Y(await Z(e, `/v1/runs/${re}/cancel`, {
5734
5734
  body: JSON.stringify({ version: 1 }),
5735
5735
  method: "POST"
5736
5736
  }), 200, "Cancel waiting Run")).status, "canceled", "Canceled waiting Run status");
@@ -1,3 +1,4 @@
1
+ import type { SchemaMismatch } from '../browser/flow-change.js';
1
2
  import type { CreateEventSource, UpdateEventSource, EventSource } from './event-sources.js';
2
3
  export { decodeEventSource, decodeEventSources, type CreateEventSource, type UpdateEventSource, type EventSource } from './event-sources.js';
3
4
  import type { TriggerCatalogCache } from './trigger-catalog.js';
@@ -205,6 +206,7 @@ export interface Diagnostic {
205
206
  readonly column: number;
206
207
  readonly line: number;
207
208
  readonly message: string;
209
+ readonly mismatch?: SchemaMismatch;
208
210
  readonly path: string;
209
211
  readonly values?: Readonly<Record<string, string | number>>;
210
212
  }
@@ -244,27 +246,23 @@ export interface Run {
244
246
  readonly status: RunStatus;
245
247
  readonly version: 1;
246
248
  }
247
- type RunDetailsBase = Omit<Run, 'status'> & {
249
+ export interface RunWait {
250
+ readonly actions: readonly ['continue'] | readonly ['approve', 'reject'];
251
+ readonly expiresAt: string;
252
+ readonly nodeId: string;
253
+ readonly prompt: string;
254
+ readonly waitId: string;
255
+ readonly waitingSince: string;
256
+ }
257
+ type RunDetailsBase = Run & {
248
258
  readonly closureDigest: string;
249
259
  readonly engineContract: string;
250
260
  readonly engineDigest: string;
251
261
  readonly eventsExpiresAt?: string;
252
262
  readonly modelVersion: number;
253
263
  readonly revisionDigest: string;
254
- } & ({
255
- readonly status: Exclude<RunStatus, 'waiting'>;
256
- readonly waiting?: never;
257
- } | {
258
- readonly status: 'waiting';
259
- readonly waiting: {
260
- readonly actions: readonly ['continue'] | readonly ['approve', 'reject'];
261
- readonly expiresAt: string;
262
- readonly nodeId: string;
263
- readonly prompt: string;
264
- readonly waitId: string;
265
- readonly waitingSince: string;
266
- };
267
- });
264
+ readonly waits: readonly RunWait[];
265
+ };
268
266
  export type DraftRun = RunDetailsBase & {
269
267
  readonly source: 'draft';
270
268
  };
@@ -342,6 +340,7 @@ export declare function decodeRunEvent(value: unknown): {
342
340
  readonly flowId?: undefined;
343
341
  readonly scopeId?: undefined;
344
342
  readonly progress?: undefined;
343
+ readonly waitIds?: undefined;
345
344
  readonly expiresAt?: undefined;
346
345
  readonly nodeId?: undefined;
347
346
  readonly waitingSince?: undefined;
@@ -359,6 +358,7 @@ export declare function decodeRunEvent(value: unknown): {
359
358
  readonly scopeId: string;
360
359
  readonly parentScopeId?: string | undefined;
361
360
  readonly progress?: undefined;
361
+ readonly waitIds?: undefined;
362
362
  readonly expiresAt?: undefined;
363
363
  readonly nodeId?: undefined;
364
364
  readonly waitingSince?: undefined;
@@ -375,6 +375,7 @@ export declare function decodeRunEvent(value: unknown): {
375
375
  readonly flowId: string;
376
376
  readonly scopeId: string;
377
377
  readonly progress: number;
378
+ readonly waitIds?: undefined;
378
379
  readonly expiresAt?: undefined;
379
380
  readonly nodeId?: undefined;
380
381
  readonly waitingSince?: undefined;
@@ -391,6 +392,24 @@ export declare function decodeRunEvent(value: unknown): {
391
392
  readonly flowId?: undefined;
392
393
  readonly scopeId?: undefined;
393
394
  readonly progress?: undefined;
395
+ readonly waitIds: string[];
396
+ readonly expiresAt?: undefined;
397
+ readonly nodeId?: undefined;
398
+ readonly waitingSince?: undefined;
399
+ readonly action?: undefined;
400
+ readonly resolvedAt?: undefined;
401
+ readonly waitId?: undefined;
402
+ readonly result?: undefined;
403
+ };
404
+ } | {
405
+ readonly createdAt: string;
406
+ readonly sequence: number;
407
+ readonly kind: "wait.created";
408
+ readonly payload: {
409
+ readonly flowId?: undefined;
410
+ readonly scopeId?: undefined;
411
+ readonly progress?: undefined;
412
+ readonly waitIds?: undefined;
394
413
  readonly expiresAt: string;
395
414
  readonly nodeId: string;
396
415
  readonly waitId: string;
@@ -407,6 +426,7 @@ export declare function decodeRunEvent(value: unknown): {
407
426
  readonly flowId?: undefined;
408
427
  readonly scopeId?: undefined;
409
428
  readonly progress?: undefined;
429
+ readonly waitIds?: undefined;
410
430
  readonly expiresAt?: undefined;
411
431
  readonly nodeId?: undefined;
412
432
  readonly waitingSince?: undefined;
@@ -423,6 +443,7 @@ export declare function decodeRunEvent(value: unknown): {
423
443
  readonly flowId?: undefined;
424
444
  readonly scopeId?: undefined;
425
445
  readonly progress?: undefined;
446
+ readonly waitIds?: undefined;
426
447
  readonly expiresAt?: undefined;
427
448
  readonly nodeId?: undefined;
428
449
  readonly waitingSince?: undefined;
@@ -444,6 +465,7 @@ export declare function decodeRunEvent(value: unknown): {
444
465
  readonly kind: "node.started";
445
466
  readonly payload: {
446
467
  readonly progress?: undefined;
468
+ readonly waitIds?: undefined;
447
469
  readonly expiresAt?: undefined;
448
470
  readonly waitingSince?: undefined;
449
471
  readonly action?: undefined;
@@ -464,6 +486,7 @@ export declare function decodeRunEvent(value: unknown): {
464
486
  readonly kind: "node.completed";
465
487
  readonly payload: {
466
488
  readonly progress?: undefined;
489
+ readonly waitIds?: undefined;
467
490
  readonly expiresAt?: undefined;
468
491
  readonly waitingSince?: undefined;
469
492
  readonly action?: undefined;
@@ -484,6 +507,7 @@ export declare function decodeRunEvent(value: unknown): {
484
507
  readonly kind: "node.failed";
485
508
  readonly payload: {
486
509
  readonly progress?: undefined;
510
+ readonly waitIds?: undefined;
487
511
  readonly expiresAt?: undefined;
488
512
  readonly waitingSince?: undefined;
489
513
  readonly action?: undefined;
@@ -505,6 +529,7 @@ export declare function decodeRunEvent(value: unknown): {
505
529
  readonly kind: "node.log";
506
530
  readonly payload: {
507
531
  readonly progress?: undefined;
532
+ readonly waitIds?: undefined;
508
533
  readonly expiresAt?: undefined;
509
534
  readonly waitingSince?: undefined;
510
535
  readonly action?: undefined;
@@ -523,6 +548,7 @@ export declare function decodeRunEvent(value: unknown): {
523
548
  readonly sequence: number;
524
549
  readonly kind: "node.progress";
525
550
  readonly payload: {
551
+ readonly waitIds?: undefined;
526
552
  readonly expiresAt?: undefined;
527
553
  readonly waitingSince?: undefined;
528
554
  readonly action?: undefined;
@@ -541,6 +567,7 @@ export declare function decodeRunEvent(value: unknown): {
541
567
  readonly kind: "node.artifact";
542
568
  readonly payload: {
543
569
  readonly progress?: undefined;
570
+ readonly waitIds?: undefined;
544
571
  readonly expiresAt?: undefined;
545
572
  readonly waitingSince?: undefined;
546
573
  readonly action?: undefined;
@@ -652,6 +679,7 @@ export declare class ControlClient {
652
679
  readonly cursor?: string;
653
680
  readonly limit?: number;
654
681
  readonly status?: RunStatus;
682
+ readonly pendingWait?: boolean;
655
683
  }): Promise<RunPage>;
656
684
  getRunEvents(runId: string, options?: {
657
685
  readonly after?: number;