@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/CHANGELOG.md +1215 -0
- package/THIRD-PARTY-NOTICES.md +123 -605
- package/dist/{cadence-_9Izk_fL.js → cadence.js} +1 -1
- package/dist/cadenceTick.js +80 -0
- package/dist/condition.js +46 -0
- package/dist/defaults.js +18 -0
- package/dist/define.js +71 -0
- package/dist/engine.js +906 -0
- package/dist/errors.d.ts +52 -69
- package/dist/errors.js +12 -3
- package/dist/index.d.ts +267 -280
- package/dist/index.js +76 -1766
- package/dist/interpolate.js +15 -0
- package/dist/ir.d.ts +193 -193
- package/dist/ir.js +233 -2
- package/dist/jsonParams.js +12 -0
- package/dist/mediaAdapter.js +179 -0
- package/dist/mediaInputs.js +57 -0
- package/dist/mediaParams.js +42 -0
- package/dist/mediaResult.js +15 -0
- package/dist/procedures.js +208 -0
- package/dist/registry.js +6 -0
- package/dist/segments.js +33 -0
- package/dist/startReceipt.js +12 -0
- package/dist/startReconcile.js +81 -0
- package/dist/table.js +59 -0
- package/dist/textParams.js +21 -0
- package/dist/web.d.ts +169 -169
- package/dist/web.js +2 -2
- package/dist/workflow.d.ts +12 -10
- package/dist/workflow.js +8 -6
- package/package.json +12 -12
- package/dist/ir-CdDUTf98.js +0 -196
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 '
|
|
14
|
-
import { WorkflowInstance } from '
|
|
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:
|
|
252
|
-
label:
|
|
253
|
-
type: Schema.
|
|
254
|
-
required: Schema.optional<
|
|
255
|
-
placeholder: Schema.optional<
|
|
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:
|
|
339
|
-
input: Schema
|
|
340
|
-
status: Schema.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
508
|
-
readonly
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
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.
|
|
521
|
-
readonly
|
|
522
|
-
|
|
523
|
-
|
|
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.
|
|
527
|
+
readonly frequency: Schema.optional<Schema.Literals<readonly ["weekly", "monthly"]>>;
|
|
531
528
|
/** Weekdays, 0=Monday … 6=Sunday. */
|
|
532
|
-
repeats: Schema
|
|
529
|
+
readonly repeats: Schema.$Array<Schema.Number>;
|
|
533
530
|
/** Weekly cycle length: 1 | 2 | 4 (anchored by anchorDate). */
|
|
534
|
-
intervalWeeks: Schema.optional<
|
|
531
|
+
readonly intervalWeeks: Schema.optional<Schema.Number>;
|
|
535
532
|
/** ISO YYYY-MM-DD, cycle-0 week (interval > 1). */
|
|
536
|
-
anchorDate: Schema.optional<
|
|
537
|
-
weekOfMonth: Schema.optional<Schema.Union<[Schema.
|
|
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<
|
|
540
|
-
minute: Schema.optional<Schema.
|
|
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
|
|
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.
|
|
571
|
-
runId:
|
|
572
|
-
status: Schema.
|
|
573
|
-
engine: Schema.
|
|
574
|
-
control: Schema.NullOr<Schema.
|
|
575
|
-
operation: Schema.
|
|
576
|
-
kind: Schema.
|
|
577
|
-
requestId: Schema.NullOr<
|
|
578
|
-
snapshot: Schema.Struct<{
|
|
579
|
-
id:
|
|
580
|
-
workflowName:
|
|
581
|
-
executionId:
|
|
582
|
-
status: Schema.Union<[Schema.
|
|
583
|
-
output: Schema.optional<
|
|
584
|
-
error: Schema.optional<Schema.Struct<{
|
|
585
|
-
tag: Schema.NullOr<
|
|
586
|
-
message:
|
|
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.
|
|
600
|
-
readonly
|
|
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.
|
|
610
|
-
costSource: Schema.optional<Schema.
|
|
611
|
-
requestId: Schema.optional<
|
|
612
|
-
usage: Schema.optional<Schema.Struct<{
|
|
613
|
-
status: Schema.
|
|
614
|
-
unit: Schema.optional<Schema.
|
|
615
|
-
input: Schema.optional<Schema.
|
|
616
|
-
output: Schema.optional<Schema.
|
|
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:
|
|
625
|
-
mappings: Schema
|
|
626
|
-
targetKey:
|
|
627
|
-
sourceKey:
|
|
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<
|
|
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.
|
|
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.
|
|
698
|
-
readonly
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
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.
|
|
710
|
-
readonly
|
|
711
|
-
|
|
712
|
-
|
|
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.
|
|
721
|
-
readonly
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
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:
|
|
731
|
-
stepIndex: Schema.
|
|
732
|
-
response: Schema.Struct<{
|
|
733
|
-
decision: Schema.optional<Schema.
|
|
734
|
-
value: Schema.optional<
|
|
735
|
-
text: Schema.optional<
|
|
736
|
-
respondedAt: Schema.optional<
|
|
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:
|
|
745
|
-
stepIndex: Schema.
|
|
746
|
-
executionId:
|
|
747
|
-
eventId:
|
|
748
|
-
status: Schema.Literal<
|
|
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.
|
|
776
|
-
readonly
|
|
777
|
-
|
|
778
|
-
|
|
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:
|
|
820
|
-
requestId:
|
|
821
|
-
admission: Schema.Struct<{
|
|
822
|
-
id:
|
|
823
|
-
workflowName:
|
|
824
|
-
executionId: Schema.NullOr<
|
|
825
|
-
status: Schema.
|
|
826
|
-
deferral: Schema.optional<Schema.Struct<{
|
|
827
|
-
mode:
|
|
828
|
-
dueAt: Schema.NullOr<
|
|
829
|
-
retryAfterMs: Schema.NullOr<
|
|
830
|
-
intentId: Schema.NullOr<
|
|
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.
|
|
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:
|
|
866
|
-
title: Schema.optional<
|
|
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<
|
|
869
|
-
type: Schema.
|
|
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<
|
|
858
|
+
readonly outputKey: Schema.optional<Schema.String>;
|
|
872
859
|
/** Template with `{{key}}` placeholders (brief inputs + prior outputKeys). */
|
|
873
|
-
prompt: Schema.optional<
|
|
874
|
-
modality: Schema.optional<Schema.
|
|
875
|
-
model: Schema.optional<
|
|
876
|
-
params: Schema.optional<Schema
|
|
877
|
-
mediaInputs: Schema.optional<Schema
|
|
878
|
-
from: Schema.Literal<
|
|
879
|
-
url:
|
|
880
|
-
mediaType: Schema.optional<
|
|
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<
|
|
883
|
-
ref:
|
|
884
|
-
artifact: Schema.optional<Schema.
|
|
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<
|
|
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
|
|
890
|
-
reviewMode: Schema.optional<Schema.
|
|
891
|
-
options: Schema.optional<Schema
|
|
892
|
-
value:
|
|
893
|
-
label:
|
|
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:
|
|
900
|
-
op: Schema.
|
|
901
|
-
value: Schema.optional<
|
|
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<
|
|
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<
|
|
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.
|
|
1057
|
-
value: Schema.optional<
|
|
1058
|
-
text: Schema.optional<
|
|
1059
|
-
respondedAt: Schema.optional<
|
|
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
|
|
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:
|
|
1183
|
-
mediaType:
|
|
1184
|
-
role:
|
|
1185
|
-
storageRefId: Schema.optional<
|
|
1186
|
-
providerMetadata: Schema.optional<
|
|
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
|
|
1192
|
-
url:
|
|
1193
|
-
mediaType:
|
|
1194
|
-
role:
|
|
1195
|
-
storageRefId: Schema.optional<
|
|
1196
|
-
providerMetadata: Schema.optional<
|
|
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
|
|
1220
|
-
from: Schema.Literal<
|
|
1221
|
-
url:
|
|
1222
|
-
mediaType: Schema.optional<
|
|
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<
|
|
1225
|
-
ref:
|
|
1226
|
-
artifact: Schema.optional<Schema.
|
|
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<
|
|
1236
|
-
url:
|
|
1237
|
-
mediaType: Schema.optional<
|
|
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<
|
|
1240
|
-
ref:
|
|
1241
|
-
artifact: Schema.optional<Schema.
|
|
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.
|
|
1272
|
-
costSource: Schema.optional<Schema.
|
|
1273
|
-
requestId: Schema.optional<
|
|
1274
|
-
usage: Schema.optional<Schema.Struct<{
|
|
1275
|
-
status: Schema.
|
|
1276
|
-
unit: Schema.optional<Schema.
|
|
1277
|
-
input: Schema.optional<Schema.
|
|
1278
|
-
output: Schema.optional<Schema.
|
|
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
|
|
1286
|
-
url:
|
|
1287
|
-
mediaType:
|
|
1288
|
-
role:
|
|
1289
|
-
storageRefId: Schema.optional<
|
|
1290
|
-
providerMetadata: Schema.optional<
|
|
1291
|
-
}
|
|
1292
|
-
costMicroUsd: Schema.optional<Schema.
|
|
1293
|
-
costSource: Schema.optional<Schema.
|
|
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<
|
|
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.
|
|
1299
|
-
unit: Schema.optional<Schema.
|
|
1300
|
-
input: Schema.optional<Schema.
|
|
1301
|
-
output: Schema.optional<Schema.
|
|
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.
|
|
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
|
|
1352
|
-
url: Schema.
|
|
1353
|
-
mediaType:
|
|
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
|
|
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
|
|
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.
|
|
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:
|
|
1435
|
-
label:
|
|
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.
|
|
1456
|
-
options: Schema.optional<Schema
|
|
1457
|
-
value:
|
|
1458
|
-
label:
|
|
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:
|
|
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.
|
|
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.
|
|
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:
|
|
1483
|
-
title:
|
|
1484
|
-
description: Schema.optional<
|
|
1485
|
-
type: Schema.
|
|
1486
|
-
status: Schema.
|
|
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<
|
|
1476
|
+
readonly agentRef: Schema.optional<Schema.String>;
|
|
1490
1477
|
/** What a `generate` step produced. */
|
|
1491
|
-
modality: Schema.optional<Schema.
|
|
1492
|
-
startedAt: Schema.optional<
|
|
1493
|
-
completedAt: Schema.optional<
|
|
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<
|
|
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.
|
|
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<
|
|
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.
|
|
1504
|
-
unit: Schema.optional<Schema.
|
|
1505
|
-
input: Schema.optional<Schema.
|
|
1506
|
-
output: Schema.optional<Schema.
|
|
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<
|
|
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
|
|
1512
|
-
url:
|
|
1513
|
-
mediaType:
|
|
1514
|
-
role:
|
|
1515
|
-
storageRefId: Schema.optional<
|
|
1516
|
-
providerMetadata: Schema.optional<
|
|
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:
|
|
1506
|
+
readonly output: Schema.optional<Schema.Struct<{
|
|
1507
|
+
readonly text: Schema.String;
|
|
1521
1508
|
}>>;
|
|
1522
|
-
errorMessage: Schema.optional<
|
|
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<
|
|
1526
|
-
review: Schema.optional<Schema.Struct<{
|
|
1527
|
-
mode: Schema.
|
|
1528
|
-
options: Schema.optional<Schema
|
|
1529
|
-
value:
|
|
1530
|
-
label:
|
|
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:
|
|
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.
|
|
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:
|
|
1577
|
-
op: Schema.
|
|
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<
|
|
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.
|
|
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.
|
|
1619
|
-
unit: Schema.optional<Schema.
|
|
1620
|
-
input: Schema.optional<Schema.
|
|
1621
|
-
output: Schema.optional<Schema.
|
|
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.
|
|
1638
|
+
export declare const Visibility: Schema.Literals<readonly ["private", "organization", "shared"]>;
|
|
1652
1639
|
|
|
1653
1640
|
export declare type Visibility = typeof Visibility.Type;
|
|
1654
1641
|
|