@voltro/plugin-ai-flows 0.84.0 → 0.86.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/index.d.ts CHANGED
@@ -10,9 +10,10 @@ import { Schema } from 'effect';
10
10
  import { Table } from '@voltro/database';
11
11
  import { TableLike } from '@voltro/database';
12
12
  import { VoltroPlugin } from '@voltro/protocol';
13
- import { WorkflowEngine } from '@effect/workflow/WorkflowEngine';
14
- import { WorkflowInstance } from '@effect/workflow/WorkflowEngine';
13
+ import { WorkflowEngine } from 'effect/workflow/WorkflowEngine';
14
+ import { WorkflowInstance } from 'effect/workflow/WorkflowEngine';
15
15
  import { WorkflowRunHandle } from '@voltro/protocol';
16
+ import { YieldableError } from 'effect/Cause';
16
17
 
17
18
  /** The handle a flow row records for an ADMITTED start: the execution the
18
19
  * engine owns. `id` is that execution too — the stable handle callers pass on. */
@@ -54,8 +55,8 @@ export declare const aiFlowRunsTable: Table<"_voltro_ai_flow_runs", FieldDefinit
54
55
  readonly workflowName: string;
55
56
  readonly deferral?: {
56
57
  readonly mode: string;
57
- readonly retryAfterMs: number | null;
58
58
  readonly dueAt: number | null;
59
+ readonly retryAfterMs: number | null;
59
60
  readonly intentId: string | null;
60
61
  } | undefined;
61
62
  } | null, "json", boolean>;
@@ -248,11 +249,11 @@ export declare const aiFlowsTables: ReadonlyArray<TableLike>;
248
249
 
249
250
  /** A launch-form field. The run `input` is keyed by these `key`s. */
250
251
  export declare const BriefField: Schema.Struct<{
251
- key: typeof Schema.String;
252
- label: typeof Schema.String;
253
- type: Schema.Literal<["text", "textarea", "number", "boolean"]>;
254
- required: Schema.optional<typeof Schema.Boolean>;
255
- placeholder: Schema.optional<typeof Schema.String>;
252
+ readonly key: Schema.String;
253
+ readonly label: Schema.String;
254
+ readonly type: Schema.Literals<readonly ["text", "textarea", "number", "boolean"]>;
255
+ readonly required: Schema.optional<Schema.Boolean>;
256
+ readonly placeholder: Schema.optional<Schema.String>;
256
257
  }>;
257
258
 
258
259
  /** An INTERFACE for the same reason as {@link FlowStep} — it is reached from an
@@ -312,32 +313,32 @@ export declare const cadenceMatches: (cadence: FlowCadence, now: Date) => boolea
312
313
  export declare const cancelFlow: (ctx: AppContext, args: {
313
314
  runId: string;
314
315
  }) => Effect.Effect<{
315
- readonly status: "failed" | "pending" | "cancelled" | "running" | "succeeded" | "waiting" | "cancelling";
316
316
  readonly runId: string;
317
+ readonly status: "failed" | "pending" | "waiting" | "cancelled" | "running" | "succeeded" | "cancelling";
318
+ readonly engine: "unknown" | "unreachable" | "cancelled" | "accepted" | "already-terminal" | "not-requested";
317
319
  readonly control: {
320
+ readonly operation: "resume" | "cancel";
318
321
  readonly kind: "unknown" | "accepted" | "confirmed" | "already-terminal";
322
+ readonly requestId: string | null;
319
323
  readonly snapshot: {
320
324
  readonly status: "unknown" | "failed" | "cancelled" | "running" | "succeeded" | "suspended";
321
325
  readonly id: string;
326
+ readonly executionId: string;
327
+ readonly workflowName: string;
322
328
  readonly error?: {
323
- readonly message: string;
324
329
  readonly tag: string | null;
330
+ readonly message: string;
325
331
  } | undefined;
326
332
  readonly output?: unknown;
327
- readonly executionId: string;
328
- readonly workflowName: string;
329
333
  };
330
- readonly operation: "resume" | "cancel";
331
- readonly requestId: string | null;
332
334
  } | null;
333
- readonly engine: "unknown" | "unreachable" | "cancelled" | "accepted" | "already-terminal" | "not-requested";
334
335
  }, FlowRunNotFound, never>;
335
336
 
336
337
  /** Staged follow-up when `chainTo.requireConfirmation` is set. */
337
338
  export declare const ChainPending: Schema.Struct<{
338
- flowRef: typeof Schema.String;
339
- input: Schema.Record$<typeof Schema.String, typeof Schema.Unknown>;
340
- status: Schema.Literal<["pending", "confirmed", "dismissed"]>;
339
+ readonly flowRef: Schema.String;
340
+ readonly input: Schema.$Record<Schema.String, Schema.Unknown>;
341
+ readonly status: Schema.Literals<readonly ["pending", "confirmed", "dismissed"]>;
341
342
  }>;
342
343
 
343
344
  /** An INTERFACE — reached from `aiFlowRuns.chainPending`; see {@link BriefField}. */
@@ -356,17 +357,17 @@ export declare const clearRegistry: () => void;
356
357
  export declare const collectRefs: (text: string) => ReadonlyArray<string>;
357
358
 
358
359
  /** The comparison a `when:` performs. */
359
- export declare const ConditionOp: Schema.Literal<["truthy", "falsy", "eq", "neq", "contains"]>;
360
+ export declare const ConditionOp: Schema.Literals<readonly ["truthy", "falsy", "eq", "neq", "contains"]>;
360
361
 
361
362
  export declare type ConditionOp = typeof ConditionOp.Type;
362
363
 
363
364
  /** A run's cost verdict over its steps: every step gateway-priced → `actual`; none unpriced → `estimated`; any unpriced → `incomplete`; no priced step → `unknown`. */
364
- export declare const CostCompleteness: Schema.Literal<["actual", "estimated", "incomplete", "unknown"]>;
365
+ export declare const CostCompleteness: Schema.Literals<readonly ["actual", "estimated", "incomplete", "unknown"]>;
365
366
 
366
367
  export declare type CostCompleteness = typeof CostCompleteness.Type;
367
368
 
368
369
  /** Where a cost figure came from. `unpriced` means the number beside it is a placeholder, not a price. */
369
- export declare const CostSource: Schema.Literal<["gateway", "estimated", "unpriced"]>;
370
+ export declare const CostSource: Schema.Literals<readonly ["gateway", "estimated", "unpriced"]>;
370
371
 
371
372
  export declare type CostSource = typeof CostSource.Type;
372
373
 
@@ -504,42 +505,38 @@ export declare const FLOW_RUNS_TTL_HOURS_DEFAULT: number;
504
505
  declare class FlowAgentUnavailable extends FlowAgentUnavailable_base {
505
506
  }
506
507
 
507
- declare const FlowAgentUnavailable_base: Schema.TaggedErrorClass<FlowAgentUnavailable, "FlowAgentUnavailable", {
508
- readonly _tag: Schema.tag<"FlowAgentUnavailable">;
509
- } & {
510
- agentRef: typeof Schema.String;
511
- reason: Schema.Literal<["not-found", "access-revoked", "model-unusable"]>;
512
- message: typeof Schema.String;
513
- publicMessage: Schema.optional<typeof Schema.String>;
514
- }>;
508
+ declare const FlowAgentUnavailable_base: Schema.Class<FlowAgentUnavailable, Schema.TaggedStruct<"FlowAgentUnavailable", {
509
+ readonly agentRef: Schema.String;
510
+ readonly reason: Schema.Literals<readonly ["not-found", "access-revoked", "model-unusable"]>;
511
+ readonly message: Schema.String;
512
+ readonly publicMessage: Schema.optional<Schema.String>;
513
+ }>, YieldableError>;
515
514
 
516
515
  /** A required brief field was blank at launch. */
517
516
  declare class FlowBriefIncomplete extends FlowBriefIncomplete_base {
518
517
  }
519
518
 
520
- declare const FlowBriefIncomplete_base: Schema.TaggedErrorClass<FlowBriefIncomplete, "FlowBriefIncomplete", {
521
- readonly _tag: Schema.tag<"FlowBriefIncomplete">;
522
- } & {
523
- missing: Schema.Array$<typeof Schema.String>;
524
- message: typeof Schema.String;
525
- }>;
519
+ declare const FlowBriefIncomplete_base: Schema.Class<FlowBriefIncomplete, Schema.TaggedStruct<"FlowBriefIncomplete", {
520
+ readonly missing: Schema.$Array<Schema.String>;
521
+ readonly message: Schema.String;
522
+ }>, YieldableError>;
526
523
 
527
524
  /** Schedule spec — richer than a single cron expr (weekly interval + anchor,
528
525
  * monthly weekOfMonth), evaluated by the shared `cadenceMatches` predicate. */
529
526
  export declare const FlowCadence: Schema.Struct<{
530
- frequency: Schema.optional<Schema.Literal<["weekly", "monthly"]>>;
527
+ readonly frequency: Schema.optional<Schema.Literals<readonly ["weekly", "monthly"]>>;
531
528
  /** Weekdays, 0=Monday … 6=Sunday. */
532
- repeats: Schema.Array$<typeof Schema.Number>;
529
+ readonly repeats: Schema.$Array<Schema.Number>;
533
530
  /** Weekly cycle length: 1 | 2 | 4 (anchored by anchorDate). */
534
- intervalWeeks: Schema.optional<typeof Schema.Number>;
531
+ readonly intervalWeeks: Schema.optional<Schema.Number>;
535
532
  /** ISO YYYY-MM-DD, cycle-0 week (interval > 1). */
536
- anchorDate: Schema.optional<typeof Schema.String>;
537
- weekOfMonth: Schema.optional<Schema.Union<[Schema.Literal<[1, 2, 3, 4]>, Schema.Literal<["last"]>]>>;
533
+ readonly anchorDate: Schema.optional<Schema.String>;
534
+ readonly weekOfMonth: Schema.optional<Schema.Union<readonly [Schema.Literals<readonly [1, 2, 3, 4]>, Schema.Literal<"last">]>>;
538
535
  /** 0-23, default 9. */
539
- hour: Schema.optional<typeof Schema.Number>;
540
- minute: Schema.optional<Schema.Literal<[0, 15, 30, 45]>>;
536
+ readonly hour: Schema.optional<Schema.Number>;
537
+ readonly minute: Schema.optional<Schema.Literals<readonly [0, 15, 30, 45]>>;
541
538
  /** Brief for unattended cron runs. */
542
- defaultInput: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
539
+ readonly defaultInput: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
543
540
  }>;
544
541
 
545
542
  /**
@@ -567,27 +564,27 @@ export declare interface FlowCadence {
567
564
  * The row never claims `cancelled` on its own: a confirmed engine cancellation
568
565
  * is the only receipt that reports a `cancelled` row, every other request
569
566
  * outcome leaves the row `cancelling` (or a completion that won a race). */
570
- export declare const FlowCancelReceipt: Schema.filter<Schema.Struct<{
571
- runId: typeof Schema.NonEmptyString;
572
- status: Schema.Literal<["pending", "running", "waiting", "cancelling", "succeeded", "failed", "cancelled"]>;
573
- engine: Schema.Literal<["cancelled", "accepted", "unknown", "already-terminal", "unreachable", "not-requested"]>;
574
- control: Schema.NullOr<Schema.filter<Schema.Struct<{
575
- operation: Schema.Literal<["cancel", "resume"]>;
576
- kind: Schema.Literal<["accepted", "confirmed", "unknown", "already-terminal"]>;
577
- requestId: Schema.NullOr<typeof Schema.NonEmptyString>;
578
- snapshot: Schema.Struct<{
579
- id: typeof Schema.String;
580
- workflowName: typeof Schema.String;
581
- executionId: typeof Schema.String;
582
- status: Schema.Union<[Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>, Schema.Literal<["unknown"]>]>;
583
- output: Schema.optional<typeof Schema.Unknown>;
584
- error: Schema.optional<Schema.Struct<{
585
- tag: Schema.NullOr<typeof Schema.String>;
586
- message: typeof Schema.String;
567
+ export declare const FlowCancelReceipt: Schema.Struct<{
568
+ readonly runId: Schema.NonEmptyString;
569
+ readonly status: Schema.Literals<readonly ["pending", "running", "waiting", "cancelling", "succeeded", "failed", "cancelled"]>;
570
+ readonly engine: Schema.Literals<readonly ["cancelled", "accepted", "unknown", "already-terminal", "unreachable", "not-requested"]>;
571
+ readonly control: Schema.NullOr<Schema.Struct<{
572
+ readonly operation: Schema.Literals<readonly ["cancel", "resume"]>;
573
+ readonly kind: Schema.Literals<readonly ["accepted", "confirmed", "unknown", "already-terminal"]>;
574
+ readonly requestId: Schema.NullOr<Schema.NonEmptyString>;
575
+ readonly snapshot: Schema.Struct<{
576
+ readonly id: Schema.String;
577
+ readonly workflowName: Schema.String;
578
+ readonly executionId: Schema.String;
579
+ readonly status: Schema.Union<readonly [Schema.Literals<readonly ["running", "succeeded", "failed", "cancelled", "suspended"]>, Schema.Literal<"unknown">]>;
580
+ readonly output: Schema.optional<Schema.Unknown>;
581
+ readonly error: Schema.optional<Schema.Struct<{
582
+ readonly tag: Schema.NullOr<Schema.String>;
583
+ readonly message: Schema.String;
587
584
  }>>;
588
585
  }>;
589
- }>>>;
590
- }>>;
586
+ }>>;
587
+ }>;
591
588
 
592
589
  export declare type FlowCancelReceipt = typeof FlowCancelReceipt.Type;
593
590
 
@@ -596,37 +593,35 @@ export declare type FlowCancelReceipt = typeof FlowCancelReceipt.Type;
596
593
  declare class FlowCapabilityMissing extends FlowCapabilityMissing_base {
597
594
  }
598
595
 
599
- declare const FlowCapabilityMissing_base: Schema.TaggedErrorClass<FlowCapabilityMissing, "FlowCapabilityMissing", {
600
- readonly _tag: Schema.tag<"FlowCapabilityMissing">;
601
- } & {
602
- capability: typeof Schema.String;
603
- message: typeof Schema.String;
596
+ declare const FlowCapabilityMissing_base: Schema.Class<FlowCapabilityMissing, Schema.TaggedStruct<"FlowCapabilityMissing", {
597
+ readonly capability: Schema.String;
598
+ readonly message: Schema.String;
604
599
  /** A charge that happened before the failure — the generation succeeded and
605
600
  * was billed, then storing its artifact did not. The engine records it on
606
601
  * the failed step, so the run's cost is not reported as unknown when it is
607
602
  * merely incomplete. */
608
- receipt: Schema.optional<Schema.Struct<{
609
- costMicroUsd: Schema.optional<Schema.filter<typeof Schema.Finite>>;
610
- costSource: Schema.optional<Schema.Literal<["gateway", "estimated", "unpriced"]>>;
611
- requestId: Schema.optional<typeof Schema.NonEmptyString>;
612
- usage: Schema.optional<Schema.Struct<{
613
- status: Schema.Literal<["reported", "unreported"]>;
614
- unit: Schema.optional<Schema.Literal<["tokens", "characters", "seconds"]>>;
615
- input: Schema.optional<Schema.filter<typeof Schema.Finite>>;
616
- output: Schema.optional<Schema.filter<typeof Schema.Finite>>;
603
+ readonly receipt: Schema.optional<Schema.Struct<{
604
+ readonly costMicroUsd: Schema.optional<Schema.Finite>;
605
+ readonly costSource: Schema.optional<Schema.Literals<readonly ["gateway", "estimated", "unpriced"]>>;
606
+ readonly requestId: Schema.optional<Schema.NonEmptyString>;
607
+ readonly usage: Schema.optional<Schema.Struct<{
608
+ readonly status: Schema.Literals<readonly ["reported", "unreported"]>;
609
+ readonly unit: Schema.optional<Schema.Literals<readonly ["tokens", "characters", "seconds"]>>;
610
+ readonly input: Schema.optional<Schema.Finite>;
611
+ readonly output: Schema.optional<Schema.Finite>;
617
612
  }>>;
618
613
  }>>;
619
- }>;
614
+ }>, YieldableError>;
620
615
 
621
616
  /** Follow-up flow spec. On success, map source → the child's brief. */
622
617
  export declare const FlowChain: Schema.Struct<{
623
618
  /** Child flow id (data) or name (code). */
624
- flowRef: typeof Schema.String;
625
- mappings: Schema.Array$<Schema.Struct<{
626
- targetKey: typeof Schema.String;
627
- sourceKey: typeof Schema.String;
619
+ readonly flowRef: Schema.String;
620
+ readonly mappings: Schema.$Array<Schema.Struct<{
621
+ readonly targetKey: Schema.String;
622
+ readonly sourceKey: Schema.String;
628
623
  }>>;
629
- requireConfirmation: Schema.optional<typeof Schema.Boolean>;
624
+ readonly requireConfirmation: Schema.optional<Schema.Boolean>;
630
625
  }>;
631
626
 
632
627
  /** An INTERFACE — reached from `aiFlows.chainTo`; see {@link BriefField}. */
@@ -685,7 +680,7 @@ export declare interface FlowLifecycleEvent {
685
680
  /** Execution mode. Replaces the legacy `allowDeviation` boolean — a mode is not
686
681
  * a boolean. `deterministic` runs the plan verbatim (resumable per step);
687
682
  * `agentic` lets an orchestrator LLM adapt the plan via the four tools. */
688
- export declare const FlowMode: Schema.Literal<["deterministic", "agentic"]>;
683
+ export declare const FlowMode: Schema.Literals<readonly ["deterministic", "agentic"]>;
689
684
 
690
685
  export declare type FlowMode = typeof FlowMode.Type;
691
686
 
@@ -694,46 +689,40 @@ export declare type FlowMode = typeof FlowMode.Type;
694
689
  declare class FlowNotAwaitingResponse extends FlowNotAwaitingResponse_base {
695
690
  }
696
691
 
697
- declare const FlowNotAwaitingResponse_base: Schema.TaggedErrorClass<FlowNotAwaitingResponse, "FlowNotAwaitingResponse", {
698
- readonly _tag: Schema.tag<"FlowNotAwaitingResponse">;
699
- } & {
700
- runId: typeof Schema.String;
701
- status: typeof Schema.String;
702
- message: typeof Schema.String;
703
- }>;
692
+ declare const FlowNotAwaitingResponse_base: Schema.Class<FlowNotAwaitingResponse, Schema.TaggedStruct<"FlowNotAwaitingResponse", {
693
+ readonly runId: Schema.String;
694
+ readonly status: Schema.String;
695
+ readonly message: Schema.String;
696
+ }>, YieldableError>;
704
697
 
705
698
  /** A flow (definition) could not be resolved by ref (code name or row id). */
706
699
  declare class FlowNotFound extends FlowNotFound_base {
707
700
  }
708
701
 
709
- declare const FlowNotFound_base: Schema.TaggedErrorClass<FlowNotFound, "FlowNotFound", {
710
- readonly _tag: Schema.tag<"FlowNotFound">;
711
- } & {
712
- flowRef: typeof Schema.String;
713
- message: typeof Schema.String;
714
- }>;
702
+ declare const FlowNotFound_base: Schema.Class<FlowNotFound, Schema.TaggedStruct<"FlowNotFound", {
703
+ readonly flowRef: Schema.String;
704
+ readonly message: Schema.String;
705
+ }>, YieldableError>;
715
706
 
716
707
  /** No review-delivery confirmation. Unknown delivery may already have been consumed. */
717
708
  declare class FlowReviewDeliveryError extends FlowReviewDeliveryError_base {
718
709
  }
719
710
 
720
- declare const FlowReviewDeliveryError_base: Schema.TaggedErrorClass<FlowReviewDeliveryError, "FlowReviewDeliveryError", {
721
- readonly _tag: Schema.tag<"FlowReviewDeliveryError">;
722
- } & {
723
- runId: typeof Schema.String;
724
- reason: Schema.Literal<["runtime-unavailable", "invalid-run", "invalid-response", "delivery-unknown"]>;
725
- message: typeof Schema.String;
726
- }>;
711
+ declare const FlowReviewDeliveryError_base: Schema.Class<FlowReviewDeliveryError, Schema.TaggedStruct<"FlowReviewDeliveryError", {
712
+ readonly runId: Schema.String;
713
+ readonly reason: Schema.Literals<readonly ["runtime-unavailable", "invalid-run", "invalid-response", "delivery-unknown"]>;
714
+ readonly message: Schema.String;
715
+ }>, YieldableError>;
727
716
 
728
717
  /** Bind the answer to the review actually displayed, not the latest waiting step. */
729
718
  export declare const FlowReviewInput: Schema.Struct<{
730
- runId: typeof Schema.NonEmptyString;
731
- stepIndex: Schema.filter<typeof Schema.Int>;
732
- response: Schema.Struct<{
733
- decision: Schema.optional<Schema.Literal<["approve", "reject"]>>;
734
- value: Schema.optional<typeof Schema.String>;
735
- text: Schema.optional<typeof Schema.String>;
736
- respondedAt: Schema.optional<typeof Schema.String>;
719
+ readonly runId: Schema.NonEmptyString;
720
+ readonly stepIndex: Schema.Int;
721
+ readonly response: Schema.Struct<{
722
+ readonly decision: Schema.optional<Schema.Literals<readonly ["approve", "reject"]>>;
723
+ readonly value: Schema.optional<Schema.String>;
724
+ readonly text: Schema.optional<Schema.String>;
725
+ readonly respondedAt: Schema.optional<Schema.String>;
737
726
  }>;
738
727
  }>;
739
728
 
@@ -741,11 +730,11 @@ export declare type FlowReviewInput = typeof FlowReviewInput.Type;
741
730
 
742
731
  /** Delivery accepted; consumption and the run's eventual outcome remain reactive state. */
743
732
  export declare const FlowReviewReceipt: Schema.Struct<{
744
- runId: typeof Schema.NonEmptyString;
745
- stepIndex: Schema.filter<typeof Schema.Int>;
746
- executionId: typeof Schema.NonEmptyString;
747
- eventId: typeof Schema.NonEmptyString;
748
- status: Schema.Literal<["accepted"]>;
733
+ readonly runId: Schema.NonEmptyString;
734
+ readonly stepIndex: Schema.Int;
735
+ readonly executionId: Schema.NonEmptyString;
736
+ readonly eventId: Schema.NonEmptyString;
737
+ readonly status: Schema.Literal<"accepted">;
749
738
  }>;
750
739
 
751
740
  export declare type FlowReviewReceipt = typeof FlowReviewReceipt.Type;
@@ -772,12 +761,10 @@ export declare interface FlowRunContext {
772
761
  declare class FlowRunNotFound extends FlowRunNotFound_base {
773
762
  }
774
763
 
775
- declare const FlowRunNotFound_base: Schema.TaggedErrorClass<FlowRunNotFound, "FlowRunNotFound", {
776
- readonly _tag: Schema.tag<"FlowRunNotFound">;
777
- } & {
778
- runId: typeof Schema.String;
779
- message: typeof Schema.String;
780
- }>;
764
+ declare const FlowRunNotFound_base: Schema.Class<FlowRunNotFound, Schema.TaggedStruct<"FlowRunNotFound", {
765
+ readonly runId: Schema.String;
766
+ readonly message: Schema.String;
767
+ }>, YieldableError>;
781
768
 
782
769
  /** The workflow payload shape (server executor input). */
783
770
  export declare interface FlowRunPayload {
@@ -816,18 +803,18 @@ export declare const flowSegments: (steps: ReadonlyArray<FlowStep>) => ReadonlyA
816
803
 
817
804
  /** Submission evidence, separate from the flow run's execution status. */
818
805
  export declare const FlowStartReceipt: Schema.Struct<{
819
- runId: typeof Schema.NonEmptyString;
820
- requestId: typeof Schema.NonEmptyString;
821
- admission: Schema.Struct<{
822
- id: typeof Schema.String;
823
- workflowName: typeof Schema.String;
824
- executionId: Schema.NullOr<typeof Schema.String>;
825
- status: Schema.Literal<["running", "succeeded", "queued", "dropped", "skipped", "replayed"]>;
826
- deferral: Schema.optional<Schema.Struct<{
827
- mode: typeof Schema.String;
828
- dueAt: Schema.NullOr<typeof Schema.Number>;
829
- retryAfterMs: Schema.NullOr<typeof Schema.Number>;
830
- intentId: Schema.NullOr<typeof Schema.String>;
806
+ readonly runId: Schema.NonEmptyString;
807
+ readonly requestId: Schema.NonEmptyString;
808
+ readonly admission: Schema.Struct<{
809
+ readonly id: Schema.String;
810
+ readonly workflowName: Schema.String;
811
+ readonly executionId: Schema.NullOr<Schema.String>;
812
+ readonly status: Schema.Literals<readonly ["running", "succeeded", "queued", "dropped", "skipped", "replayed"]>;
813
+ readonly deferral: Schema.optional<Schema.Struct<{
814
+ readonly mode: Schema.String;
815
+ readonly dueAt: Schema.NullOr<Schema.Number>;
816
+ readonly retryAfterMs: Schema.NullOr<Schema.Number>;
817
+ readonly intentId: Schema.NullOr<Schema.String>;
831
818
  }>>;
832
819
  }>;
833
820
  }>;
@@ -851,7 +838,7 @@ export declare interface FlowStartReconciliation {
851
838
  }
852
839
 
853
840
  /** Flow-definition lifecycle. */
854
- export declare const FlowStatus: Schema.Literal<["draft", "active", "archived"]>;
841
+ export declare const FlowStatus: Schema.Literals<readonly ["draft", "active", "archived"]>;
855
842
 
856
843
  export declare type FlowStatus = typeof FlowStatus.Type;
857
844
 
@@ -862,43 +849,43 @@ export declare type FlowStatus = typeof FlowStatus.Type;
862
849
  * `{{outputKey}}` in `prompt` / media refs.
863
850
  */
864
851
  export declare const FlowStep: Schema.Struct<{
865
- id: typeof Schema.String;
866
- title: Schema.optional<typeof Schema.String>;
852
+ readonly id: Schema.String;
853
+ readonly title: Schema.optional<Schema.String>;
867
854
  /** Informational; shown under the step in the run timeline. */
868
- description: Schema.optional<typeof Schema.String>;
869
- type: Schema.Literal<["agent", "generate", "structured", "note", "human"]>;
855
+ readonly description: Schema.optional<Schema.String>;
856
+ readonly type: Schema.Literals<readonly ["agent", "generate", "structured", "note", "human"]>;
870
857
  /** Sanitized [\w.-]; the result-bundle key + the `{{ref}}` name. */
871
- outputKey: Schema.optional<typeof Schema.String>;
858
+ readonly outputKey: Schema.optional<Schema.String>;
872
859
  /** Template with `{{key}}` placeholders (brief inputs + prior outputKeys). */
873
- prompt: Schema.optional<typeof Schema.String>;
874
- modality: Schema.optional<Schema.Literal<["text", "image", "video", "audio"]>>;
875
- model: Schema.optional<typeof Schema.String>;
876
- params: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
877
- mediaInputs: Schema.optional<Schema.Record$<typeof Schema.String, Schema.Union<[Schema.Struct<{
878
- from: Schema.Literal<["upload"]>;
879
- url: typeof Schema.String;
880
- mediaType: Schema.optional<typeof Schema.NonEmptyString>;
860
+ readonly prompt: Schema.optional<Schema.String>;
861
+ readonly modality: Schema.optional<Schema.Literals<readonly ["text", "image", "video", "audio"]>>;
862
+ readonly model: Schema.optional<Schema.String>;
863
+ readonly params: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
864
+ readonly mediaInputs: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.Struct<{
865
+ readonly from: Schema.Literal<"upload">;
866
+ readonly url: Schema.String;
867
+ readonly mediaType: Schema.optional<Schema.NonEmptyString>;
881
868
  }>, Schema.Struct<{
882
- from: Schema.Literal<["step"]>;
883
- ref: typeof Schema.String;
884
- artifact: Schema.optional<Schema.filter<typeof Schema.Int>>;
869
+ readonly from: Schema.Literal<"step">;
870
+ readonly ref: Schema.String;
871
+ readonly artifact: Schema.optional<Schema.Int>;
885
872
  }>]>>>;
886
873
  /** Allowed sub-agent id/name, resolved and authorized by the host. */
887
- agentRef: Schema.optional<typeof Schema.String>;
874
+ readonly agentRef: Schema.optional<Schema.String>;
888
875
  /** JSON Schema of the desired object, preserved and validated at run. */
889
- schema: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
890
- reviewMode: Schema.optional<Schema.Literal<["approve", "choice", "text"]>>;
891
- options: Schema.optional<Schema.Array$<Schema.Struct<{
892
- value: typeof Schema.String;
893
- label: typeof Schema.String;
876
+ readonly schema: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
877
+ readonly reviewMode: Schema.optional<Schema.Literals<readonly ["approve", "choice", "text"]>>;
878
+ readonly options: Schema.optional<Schema.$Array<Schema.Struct<{
879
+ readonly value: Schema.String;
880
+ readonly label: Schema.String;
894
881
  }>>>;
895
882
  /** Gate this step on a prior value. Absent → the step always runs. A step
896
883
  * whose condition is false is SKIPPED, not failed: it produces no output, so
897
884
  * anything referencing its `outputKey` sees an absent value. */
898
- when: Schema.optional<Schema.Struct<{
899
- ref: typeof Schema.String;
900
- op: Schema.Literal<["truthy", "falsy", "eq", "neq", "contains"]>;
901
- value: Schema.optional<typeof Schema.Unknown>;
885
+ readonly when: Schema.optional<Schema.Struct<{
886
+ readonly ref: Schema.String;
887
+ readonly op: Schema.Literals<readonly ["truthy", "falsy", "eq", "neq", "contains"]>;
888
+ readonly value: Schema.optional<Schema.Unknown>;
902
889
  }>>;
903
890
  /**
904
891
  * Fan-out group. CONSECUTIVE steps sharing a group name run CONCURRENTLY,
@@ -909,12 +896,12 @@ export declare const FlowStep: Schema.Struct<{
909
896
  * step may not join a group either: it suspends the whole workflow, which is
910
897
  * not a thing one branch of a fan-out can do.
911
898
  */
912
- group: Schema.optional<typeof Schema.String>;
899
+ readonly group: Schema.optional<Schema.String>;
913
900
  /** `human` step only — how long the run parks awaiting this review before it
914
901
  * fails, in milliseconds. Omitted → the flow's `humanTimeoutMs`, then the
915
902
  * engine/plugin default (see `resolveHumanReviewTimeoutMs`). `0` means WAIT
916
903
  * FOREVER (the park is slot-free, so an unbounded wait costs no worker). */
917
- timeoutMs: Schema.optional<typeof Schema.Number>;
904
+ readonly timeoutMs: Schema.optional<Schema.Number>;
918
905
  }>;
919
906
 
920
907
  /**
@@ -1053,10 +1040,10 @@ export declare const HUMAN_REVIEW_TIMEOUT_HOURS_DEFAULT: number;
1053
1040
 
1054
1041
  /** The HITL answer; the engine projects it after consuming the durable signal. */
1055
1042
  export declare const HumanResponse: Schema.Struct<{
1056
- decision: Schema.optional<Schema.Literal<["approve", "reject"]>>;
1057
- value: Schema.optional<typeof Schema.String>;
1058
- text: Schema.optional<typeof Schema.String>;
1059
- respondedAt: Schema.optional<typeof Schema.String>;
1043
+ readonly decision: Schema.optional<Schema.Literals<readonly ["approve", "reject"]>>;
1044
+ readonly value: Schema.optional<Schema.String>;
1045
+ readonly text: Schema.optional<Schema.String>;
1046
+ readonly respondedAt: Schema.optional<Schema.String>;
1060
1047
  }>;
1061
1048
 
1062
1049
  /** An INTERFACE — reached from `aiFlowRuns.humanResponse`; see {@link BriefField}. */
@@ -1111,7 +1098,7 @@ export declare const interpolate: (text: string, context: Record<string, unknown
1111
1098
  export declare const isTruthy: (v: unknown) => boolean;
1112
1099
 
1113
1100
  /** A JSON value (for `params` / `input` / a `structured` step's JSON Schema). */
1114
- export declare const Json: Schema.Record$<typeof Schema.String, typeof Schema.Unknown>;
1101
+ export declare const Json: Schema.$Record<Schema.String, Schema.Unknown>;
1115
1102
 
1116
1103
  export declare type Json = typeof Json.Type;
1117
1104
 
@@ -1131,8 +1118,8 @@ export declare const launchFlow: (ctx: AppContext, args: {
1131
1118
  readonly workflowName: string;
1132
1119
  readonly deferral?: {
1133
1120
  readonly mode: string;
1134
- readonly retryAfterMs: number | null;
1135
1121
  readonly dueAt: number | null;
1122
+ readonly retryAfterMs: number | null;
1136
1123
  readonly intentId: string | null;
1137
1124
  } | undefined;
1138
1125
  };
@@ -1179,22 +1166,22 @@ export declare const MAX_STEPS_MIN = 1;
1179
1166
  /** One persisted media artifact. Storage identity is not a provider request ID.
1180
1167
  * Exactly one artifact per result has role `primary`; other roles are host-defined. */
1181
1168
  export declare const MediaArtifact: Schema.Struct<{
1182
- url: typeof Schema.NonEmptyString;
1183
- mediaType: typeof Schema.NonEmptyString;
1184
- role: typeof Schema.NonEmptyString;
1185
- storageRefId: Schema.optional<typeof Schema.NonEmptyString>;
1186
- providerMetadata: Schema.optional<typeof Schema.Unknown>;
1169
+ readonly url: Schema.NonEmptyString;
1170
+ readonly mediaType: Schema.NonEmptyString;
1171
+ readonly role: Schema.NonEmptyString;
1172
+ readonly storageRefId: Schema.optional<Schema.NonEmptyString>;
1173
+ readonly providerMetadata: Schema.optional<Schema.Unknown>;
1187
1174
  }>;
1188
1175
 
1189
1176
  export declare type MediaArtifact = typeof MediaArtifact.Type;
1190
1177
 
1191
- export declare const MediaArtifacts: Schema.filter<Schema.Array$<Schema.Struct<{
1192
- url: typeof Schema.NonEmptyString;
1193
- mediaType: typeof Schema.NonEmptyString;
1194
- role: typeof Schema.NonEmptyString;
1195
- storageRefId: Schema.optional<typeof Schema.NonEmptyString>;
1196
- providerMetadata: Schema.optional<typeof Schema.Unknown>;
1197
- }>>>;
1178
+ export declare const MediaArtifacts: Schema.$Array<Schema.Struct<{
1179
+ readonly url: Schema.NonEmptyString;
1180
+ readonly mediaType: Schema.NonEmptyString;
1181
+ readonly role: Schema.NonEmptyString;
1182
+ readonly storageRefId: Schema.optional<Schema.NonEmptyString>;
1183
+ readonly providerMetadata: Schema.optional<Schema.Unknown>;
1184
+ }>>;
1198
1185
 
1199
1186
  /** Host-supplied media generator for image/video/audio steps — `@voltro/ai`'s
1200
1187
  * `generateImage` / `generateVideo` / `generateSpeech` plug in here via the
@@ -1216,14 +1203,14 @@ export declare type MediaGenerator = (args: {
1216
1203
  readonly run: FlowRunContext;
1217
1204
  }) => Effect.Effect<MediaResult, FlowCapabilityMissing, unknown>;
1218
1205
 
1219
- export declare const MediaInputs: Schema.Record$<typeof Schema.String, Schema.Union<[Schema.Struct<{
1220
- from: Schema.Literal<["upload"]>;
1221
- url: typeof Schema.String;
1222
- mediaType: Schema.optional<typeof Schema.NonEmptyString>;
1206
+ export declare const MediaInputs: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.Struct<{
1207
+ readonly from: Schema.Literal<"upload">;
1208
+ readonly url: Schema.String;
1209
+ readonly mediaType: Schema.optional<Schema.NonEmptyString>;
1223
1210
  }>, Schema.Struct<{
1224
- from: Schema.Literal<["step"]>;
1225
- ref: typeof Schema.String;
1226
- artifact: Schema.optional<Schema.filter<typeof Schema.Int>>;
1211
+ readonly from: Schema.Literal<"step">;
1212
+ readonly ref: Schema.String;
1213
+ readonly artifact: Schema.optional<Schema.Int>;
1227
1214
  }>]>>;
1228
1215
 
1229
1216
  export declare type MediaInputs = typeof MediaInputs.Type;
@@ -1231,14 +1218,14 @@ export declare type MediaInputs = typeof MediaInputs.Type;
1231
1218
  /** A media-input slot — an absolute HTTP(S) uploaded URL or a reference to a
1232
1219
  * brief field/prior step's URL output. Keyed by capability slot name
1233
1220
  * (`referenceImageUrl`, `lastFrameImageUrl`, `referenceVideoUrl`, …). */
1234
- export declare const MediaInputSlot: Schema.Union<[Schema.Struct<{
1235
- from: Schema.Literal<["upload"]>;
1236
- url: typeof Schema.String;
1237
- mediaType: Schema.optional<typeof Schema.NonEmptyString>;
1221
+ export declare const MediaInputSlot: Schema.Union<readonly [Schema.Struct<{
1222
+ readonly from: Schema.Literal<"upload">;
1223
+ readonly url: Schema.String;
1224
+ readonly mediaType: Schema.optional<Schema.NonEmptyString>;
1238
1225
  }>, Schema.Struct<{
1239
- from: Schema.Literal<["step"]>;
1240
- ref: typeof Schema.String;
1241
- artifact: Schema.optional<Schema.filter<typeof Schema.Int>>;
1226
+ readonly from: Schema.Literal<"step">;
1227
+ readonly ref: Schema.String;
1228
+ readonly artifact: Schema.optional<Schema.Int>;
1242
1229
  }>]>;
1243
1230
 
1244
1231
  export declare type MediaInputSlot = typeof MediaInputSlot.Type;
@@ -1268,43 +1255,43 @@ export declare interface MediaPersist {
1268
1255
  * succeeded one; the run's `costCompleteness` counts it.
1269
1256
  */
1270
1257
  export declare const MediaReceipt: Schema.Struct<{
1271
- costMicroUsd: Schema.optional<Schema.filter<typeof Schema.Finite>>;
1272
- costSource: Schema.optional<Schema.Literal<["gateway", "estimated", "unpriced"]>>;
1273
- requestId: Schema.optional<typeof Schema.NonEmptyString>;
1274
- usage: Schema.optional<Schema.Struct<{
1275
- status: Schema.Literal<["reported", "unreported"]>;
1276
- unit: Schema.optional<Schema.Literal<["tokens", "characters", "seconds"]>>;
1277
- input: Schema.optional<Schema.filter<typeof Schema.Finite>>;
1278
- output: Schema.optional<Schema.filter<typeof Schema.Finite>>;
1258
+ readonly costMicroUsd: Schema.optional<Schema.Finite>;
1259
+ readonly costSource: Schema.optional<Schema.Literals<readonly ["gateway", "estimated", "unpriced"]>>;
1260
+ readonly requestId: Schema.optional<Schema.NonEmptyString>;
1261
+ readonly usage: Schema.optional<Schema.Struct<{
1262
+ readonly status: Schema.Literals<readonly ["reported", "unreported"]>;
1263
+ readonly unit: Schema.optional<Schema.Literals<readonly ["tokens", "characters", "seconds"]>>;
1264
+ readonly input: Schema.optional<Schema.Finite>;
1265
+ readonly output: Schema.optional<Schema.Finite>;
1279
1266
  }>>;
1280
1267
  }>;
1281
1268
 
1282
1269
  export declare type MediaReceipt = typeof MediaReceipt.Type;
1283
1270
 
1284
1271
  export declare const MediaResult: Schema.Struct<{
1285
- artifacts: Schema.filter<Schema.Array$<Schema.Struct<{
1286
- url: typeof Schema.NonEmptyString;
1287
- mediaType: typeof Schema.NonEmptyString;
1288
- role: typeof Schema.NonEmptyString;
1289
- storageRefId: Schema.optional<typeof Schema.NonEmptyString>;
1290
- providerMetadata: Schema.optional<typeof Schema.Unknown>;
1291
- }>>>;
1292
- costMicroUsd: Schema.optional<Schema.filter<typeof Schema.Finite>>;
1293
- costSource: Schema.optional<Schema.Literal<["gateway", "estimated", "unpriced"]>>;
1272
+ readonly artifacts: Schema.$Array<Schema.Struct<{
1273
+ readonly url: Schema.NonEmptyString;
1274
+ readonly mediaType: Schema.NonEmptyString;
1275
+ readonly role: Schema.NonEmptyString;
1276
+ readonly storageRefId: Schema.optional<Schema.NonEmptyString>;
1277
+ readonly providerMetadata: Schema.optional<Schema.Unknown>;
1278
+ }>>;
1279
+ readonly costMicroUsd: Schema.optional<Schema.Finite>;
1280
+ readonly costSource: Schema.optional<Schema.Literals<readonly ["gateway", "estimated", "unpriced"]>>;
1294
1281
  /** A provider/usage correlation only, never a storage reference. */
1295
- requestId: Schema.optional<typeof Schema.NonEmptyString>;
1282
+ readonly requestId: Schema.optional<Schema.NonEmptyString>;
1296
1283
  /** What the generation consumed — the quantity behind `costMicroUsd`. */
1297
- usage: Schema.optional<Schema.Struct<{
1298
- status: Schema.Literal<["reported", "unreported"]>;
1299
- unit: Schema.optional<Schema.Literal<["tokens", "characters", "seconds"]>>;
1300
- input: Schema.optional<Schema.filter<typeof Schema.Finite>>;
1301
- output: Schema.optional<Schema.filter<typeof Schema.Finite>>;
1284
+ readonly usage: Schema.optional<Schema.Struct<{
1285
+ readonly status: Schema.Literals<readonly ["reported", "unreported"]>;
1286
+ readonly unit: Schema.optional<Schema.Literals<readonly ["tokens", "characters", "seconds"]>>;
1287
+ readonly input: Schema.optional<Schema.Finite>;
1288
+ readonly output: Schema.optional<Schema.Finite>;
1302
1289
  }>>;
1303
1290
  }>;
1304
1291
 
1305
1292
  export declare type MediaResult = typeof MediaResult.Type;
1306
1293
 
1307
- export declare const Modality: Schema.Literal<["text", "image", "video", "audio"]>;
1294
+ export declare const Modality: Schema.Literals<readonly ["text", "image", "video", "audio"]>;
1308
1295
 
1309
1296
  export declare type Modality = typeof Modality.Type;
1310
1297
 
@@ -1348,14 +1335,14 @@ export declare const registerFlow: (ir: FlowIR) => void;
1348
1335
  /** Test seam — forget the recorded tunables. */
1349
1336
  export declare const resetAiFlowsDefaults: () => void;
1350
1337
 
1351
- declare const ResolvedMediaInputRefs: Schema.Record$<typeof Schema.String, Schema.Struct<{
1352
- url: Schema.filter<typeof Schema.String>;
1353
- mediaType: typeof Schema.NonEmptyString;
1338
+ declare const ResolvedMediaInputRefs: Schema.$Record<Schema.String, Schema.Struct<{
1339
+ readonly url: Schema.String;
1340
+ readonly mediaType: Schema.NonEmptyString;
1354
1341
  }>>;
1355
1342
 
1356
1343
  declare type ResolvedMediaInputRefs = typeof ResolvedMediaInputRefs.Type;
1357
1344
 
1358
- declare const ResolvedMediaInputs: Schema.Record$<typeof Schema.String, Schema.filter<typeof Schema.String>>;
1345
+ declare const ResolvedMediaInputs: Schema.$Record<Schema.String, Schema.String>;
1359
1346
 
1360
1347
  declare type ResolvedMediaInputs = typeof ResolvedMediaInputs.Type;
1361
1348
 
@@ -1397,11 +1384,11 @@ export declare const resolveMaxChainDepth: (deps?: {
1397
1384
  * this sender, projects the consumed answer into humanResponse. A lost delivery
1398
1385
  * acknowledgement is unknown, never a fabricated successful response. */
1399
1386
  export declare const respondToFlow: (ctx: AppContext, args: FlowReviewInput) => Effect.Effect<{
1400
- readonly status: "accepted";
1401
1387
  readonly runId: string;
1388
+ readonly stepIndex: number;
1402
1389
  readonly executionId: string;
1403
1390
  readonly eventId: string;
1404
- readonly stepIndex: number;
1391
+ readonly status: "accepted";
1405
1392
  }, FlowRunNotFound | FlowNotAwaitingResponse | FlowReviewDeliveryError, never>;
1406
1393
 
1407
1394
  /** Resubmit the persisted input under the same requestId. The returned admission
@@ -1419,20 +1406,20 @@ export declare const retryFlow: (ctx: AppContext, args: {
1419
1406
  readonly workflowName: string;
1420
1407
  readonly deferral?: {
1421
1408
  readonly mode: string;
1422
- readonly retryAfterMs: number | null;
1423
1409
  readonly dueAt: number | null;
1410
+ readonly retryAfterMs: number | null;
1424
1411
  readonly intentId: string | null;
1425
1412
  } | undefined;
1426
1413
  };
1427
1414
  }, FlowRunNotFound, never>;
1428
1415
 
1429
- export declare const ReviewMode: Schema.Literal<["approve", "choice", "text"]>;
1416
+ export declare const ReviewMode: Schema.Literals<readonly ["approve", "choice", "text"]>;
1430
1417
 
1431
1418
  export declare type ReviewMode = typeof ReviewMode.Type;
1432
1419
 
1433
1420
  export declare const ReviewOption: Schema.Struct<{
1434
- value: typeof Schema.String;
1435
- label: typeof Schema.String;
1421
+ readonly value: Schema.String;
1422
+ readonly label: Schema.String;
1436
1423
  }>;
1437
1424
 
1438
1425
  export declare type ReviewOption = typeof ReviewOption.Type;
@@ -1452,18 +1439,18 @@ export declare const runCadenceTick: (ctx: AppContext, now?: Date) => Promise<{
1452
1439
 
1453
1440
  /** Human-review config projected onto a `waiting` run step. */
1454
1441
  export declare const RunReview: Schema.Struct<{
1455
- mode: Schema.Literal<["approve", "choice", "text"]>;
1456
- options: Schema.optional<Schema.Array$<Schema.Struct<{
1457
- value: typeof Schema.String;
1458
- label: typeof Schema.String;
1442
+ readonly mode: Schema.Literals<readonly ["approve", "choice", "text"]>;
1443
+ readonly options: Schema.optional<Schema.$Array<Schema.Struct<{
1444
+ readonly value: Schema.String;
1445
+ readonly label: Schema.String;
1459
1446
  }>>>;
1460
- prompt: typeof Schema.String;
1447
+ readonly prompt: Schema.String;
1461
1448
  }>;
1462
1449
 
1463
1450
  export declare type RunReview = typeof RunReview.Type;
1464
1451
 
1465
1452
  /** What triggered a run. */
1466
- export declare const RunSource: Schema.Literal<["manual", "cron"]>;
1453
+ export declare const RunSource: Schema.Literals<readonly ["manual", "cron"]>;
1467
1454
 
1468
1455
  export declare type RunSource = typeof RunSource.Type;
1469
1456
 
@@ -1474,62 +1461,62 @@ export declare type RunSource = typeof RunSource.Type;
1474
1461
  * confirmed: the row carries that uncertainty until the engine stops the run
1475
1462
  * (cooperatively, by interruption, or through a later confirmed request).
1476
1463
  * Only `succeeded`, `failed` and `cancelled` are terminal. */
1477
- export declare const RunStatus: Schema.Literal<["pending", "running", "waiting", "cancelling", "succeeded", "failed", "cancelled"]>;
1464
+ export declare const RunStatus: Schema.Literals<readonly ["pending", "running", "waiting", "cancelling", "succeeded", "failed", "cancelled"]>;
1478
1465
 
1479
1466
  export declare type RunStatus = typeof RunStatus.Type;
1480
1467
 
1481
1468
  export declare const RunStep: Schema.Struct<{
1482
- id: typeof Schema.Number;
1483
- title: typeof Schema.String;
1484
- description: Schema.optional<typeof Schema.String>;
1485
- type: Schema.Literal<["agent", "generate", "structured", "note", "human"]>;
1486
- status: Schema.Literal<["pending", "running", "waiting", "succeeded", "failed", "skipped"]>;
1469
+ readonly id: Schema.Number;
1470
+ readonly title: Schema.String;
1471
+ readonly description: Schema.optional<Schema.String>;
1472
+ readonly type: Schema.Literals<readonly ["agent", "generate", "structured", "note", "human"]>;
1473
+ readonly status: Schema.Literals<readonly ["pending", "running", "waiting", "succeeded", "failed", "skipped"]>;
1487
1474
  /** The agent an `agent` step delegated to — a field, so a run view never
1488
1475
  * parses it out of `title`. */
1489
- agentRef: Schema.optional<typeof Schema.String>;
1476
+ readonly agentRef: Schema.optional<Schema.String>;
1490
1477
  /** What a `generate` step produced. */
1491
- modality: Schema.optional<Schema.Literal<["text", "image", "video", "audio"]>>;
1492
- startedAt: Schema.optional<typeof Schema.String>;
1493
- completedAt: Schema.optional<typeof Schema.String>;
1478
+ readonly modality: Schema.optional<Schema.Literals<readonly ["text", "image", "video", "audio"]>>;
1479
+ readonly startedAt: Schema.optional<Schema.String>;
1480
+ readonly completedAt: Schema.optional<Schema.String>;
1494
1481
  /** Per-step cost in micro-USD (the app view projects to €/cents). */
1495
- costMicroUsd: Schema.optional<typeof Schema.Number>;
1482
+ readonly costMicroUsd: Schema.optional<Schema.Number>;
1496
1483
  /** Where that number came from — the gateway's actual charge, a price-table
1497
1484
  * estimate, or nothing (`unpriced`: the 0 above is not a price). */
1498
- costSource: Schema.optional<Schema.Literal<["gateway", "estimated", "unpriced"]>>;
1485
+ readonly costSource: Schema.optional<Schema.Literals<readonly ["gateway", "estimated", "unpriced"]>>;
1499
1486
  /** Links a media step to its generation/usage record. */
1500
- requestId: Schema.optional<typeof Schema.String>;
1487
+ readonly requestId: Schema.optional<Schema.String>;
1501
1488
  /** What the step consumed — also on a FAILED step that was charged. */
1502
- usage: Schema.optional<Schema.Struct<{
1503
- status: Schema.Literal<["reported", "unreported"]>;
1504
- unit: Schema.optional<Schema.Literal<["tokens", "characters", "seconds"]>>;
1505
- input: Schema.optional<Schema.filter<typeof Schema.Finite>>;
1506
- output: Schema.optional<Schema.filter<typeof Schema.Finite>>;
1489
+ readonly usage: Schema.optional<Schema.Struct<{
1490
+ readonly status: Schema.Literals<readonly ["reported", "unreported"]>;
1491
+ readonly unit: Schema.optional<Schema.Literals<readonly ["tokens", "characters", "seconds"]>>;
1492
+ readonly input: Schema.optional<Schema.Finite>;
1493
+ readonly output: Schema.optional<Schema.Finite>;
1507
1494
  }>>;
1508
1495
  /** Hosted media artifact URL (image/video/audio), via storage. */
1509
- url: Schema.optional<typeof Schema.String>;
1496
+ readonly url: Schema.optional<Schema.String>;
1510
1497
  /** All media variants, including roles and storage references; url projects the primary artifact. */
1511
- artifacts: Schema.optional<Schema.filter<Schema.Array$<Schema.Struct<{
1512
- url: typeof Schema.NonEmptyString;
1513
- mediaType: typeof Schema.NonEmptyString;
1514
- role: typeof Schema.NonEmptyString;
1515
- storageRefId: Schema.optional<typeof Schema.NonEmptyString>;
1516
- providerMetadata: Schema.optional<typeof Schema.Unknown>;
1517
- }>>>>;
1498
+ readonly artifacts: Schema.optional<Schema.$Array<Schema.Struct<{
1499
+ readonly url: Schema.NonEmptyString;
1500
+ readonly mediaType: Schema.NonEmptyString;
1501
+ readonly role: Schema.NonEmptyString;
1502
+ readonly storageRefId: Schema.optional<Schema.NonEmptyString>;
1503
+ readonly providerMetadata: Schema.optional<Schema.Unknown>;
1504
+ }>>>;
1518
1505
  /** Inline text output (rendered as markdown). */
1519
- output: Schema.optional<Schema.Struct<{
1520
- text: typeof Schema.String;
1506
+ readonly output: Schema.optional<Schema.Struct<{
1507
+ readonly text: Schema.String;
1521
1508
  }>>;
1522
- errorMessage: Schema.optional<typeof Schema.String>;
1509
+ readonly errorMessage: Schema.optional<Schema.String>;
1523
1510
  /** Why a `skipped` step was skipped — the rendered condition, so the timeline
1524
1511
  * says "{{approved}} is not set" instead of leaving a silent gap. */
1525
- skipReason: Schema.optional<typeof Schema.String>;
1526
- review: Schema.optional<Schema.Struct<{
1527
- mode: Schema.Literal<["approve", "choice", "text"]>;
1528
- options: Schema.optional<Schema.Array$<Schema.Struct<{
1529
- value: typeof Schema.String;
1530
- label: typeof Schema.String;
1512
+ readonly skipReason: Schema.optional<Schema.String>;
1513
+ readonly review: Schema.optional<Schema.Struct<{
1514
+ readonly mode: Schema.Literals<readonly ["approve", "choice", "text"]>;
1515
+ readonly options: Schema.optional<Schema.$Array<Schema.Struct<{
1516
+ readonly value: Schema.String;
1517
+ readonly label: Schema.String;
1531
1518
  }>>>;
1532
- prompt: typeof Schema.String;
1519
+ readonly prompt: Schema.String;
1533
1520
  }>>;
1534
1521
  }>;
1535
1522
 
@@ -1561,7 +1548,7 @@ export declare interface RunStep {
1561
1548
  readonly review?: RunReview | undefined;
1562
1549
  }
1563
1550
 
1564
- export declare const RunStepStatus: Schema.Literal<["pending", "running", "waiting", "succeeded", "failed", "skipped"]>;
1551
+ export declare const RunStepStatus: Schema.Literals<readonly ["pending", "running", "waiting", "succeeded", "failed", "skipped"]>;
1565
1552
 
1566
1553
  export declare type RunStepStatus = typeof RunStepStatus.Type;
1567
1554
 
@@ -1573,10 +1560,10 @@ export declare const setAiFlowsDefaults: (defaults: AiFlowsDefaults) => void;
1573
1560
 
1574
1561
  declare const StepCondition: Schema.Struct<{
1575
1562
  /** A brief-field key or an EARLIER step's `outputKey`. */
1576
- ref: typeof Schema.String;
1577
- op: Schema.Literal<["truthy", "falsy", "eq", "neq", "contains"]>;
1563
+ readonly ref: Schema.String;
1564
+ readonly op: Schema.Literals<readonly ["truthy", "falsy", "eq", "neq", "contains"]>;
1578
1565
  /** The right-hand side for `eq` / `neq` / `contains`. Ignored by the unary ops. */
1579
- value: Schema.optional<typeof Schema.Unknown>;
1566
+ readonly value: Schema.optional<Schema.Unknown>;
1580
1567
  }>;
1581
1568
 
1582
1569
  /** An INTERFACE, for the same api-report reason as `FlowStep` — it is reached
@@ -1600,7 +1587,7 @@ declare interface StepControls {
1600
1587
  }
1601
1588
 
1602
1589
  /** The five step types. `generate` fans out to four modalities. */
1603
- export declare const StepType: Schema.Literal<["agent", "generate", "structured", "note", "human"]>;
1590
+ export declare const StepType: Schema.Literals<readonly ["agent", "generate", "structured", "note", "human"]>;
1604
1591
 
1605
1592
  export declare type StepType = typeof StepType.Type;
1606
1593
 
@@ -1615,10 +1602,10 @@ export declare type StepType = typeof StepType.Type;
1615
1602
  * later, or reconciled against an invoice.
1616
1603
  */
1617
1604
  export declare const StepUsage: Schema.Struct<{
1618
- status: Schema.Literal<["reported", "unreported"]>;
1619
- unit: Schema.optional<Schema.Literal<["tokens", "characters", "seconds"]>>;
1620
- input: Schema.optional<Schema.filter<typeof Schema.Finite>>;
1621
- output: Schema.optional<Schema.filter<typeof Schema.Finite>>;
1605
+ readonly status: Schema.Literals<readonly ["reported", "unreported"]>;
1606
+ readonly unit: Schema.optional<Schema.Literals<readonly ["tokens", "characters", "seconds"]>>;
1607
+ readonly input: Schema.optional<Schema.Finite>;
1608
+ readonly output: Schema.optional<Schema.Finite>;
1622
1609
  }>;
1623
1610
 
1624
1611
  export declare type StepUsage = typeof StepUsage.Type;
@@ -1648,7 +1635,7 @@ export declare const updateFlow: (ctx: AppContext, args: {
1648
1635
  export declare const validateFlow: (ir: FlowIR) => void;
1649
1636
 
1650
1637
  /** Gallery scope. `shared` → per-subject share list; `organization` → tenant. */
1651
- export declare const Visibility: Schema.Literal<["private", "organization", "shared"]>;
1638
+ export declare const Visibility: Schema.Literals<readonly ["private", "organization", "shared"]>;
1652
1639
 
1653
1640
  export declare type Visibility = typeof Visibility.Type;
1654
1641