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