@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/ir.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as e, B as t, C as n, D as r, E as i, F as a, H as o, I as s, L as c, M as l, N as u, O as d, P as f, R as p, S as m, T as h, V as g, _, a as v, b as y, c as b, d as x, f as S, g as C, h as w, i as T, j as E, k as D, l as O, m as k, n as A, o as j, p as M, r as N, s as P, t as F, u as I, v as L, w as R, x as z, y as B, z as V } from "./ir-
|
|
1
|
+
import { A as e, B as t, C as n, D as r, E as i, F as a, H as o, I as s, L as c, M as l, N as u, O as d, P as f, R as p, S as m, T as h, V as g, _, a as v, b as y, c as b, d as x, f as S, g as C, h as w, i as T, j as E, k as D, l as O, m as k, n as A, o as j, p as M, r as N, s as P, t as F, u as I, v as L, w as R, x as z, y as B, z as V } from "./ir-Cjk1kQl9.js";
|
|
2
2
|
export { F as BriefField, A as ChainPending, p as ConditionOp, N as CostCompleteness, T as CostSource, v as FlowCadence, j as FlowCancelReceipt, P as FlowChain, b as FlowMode, O as FlowReviewInput, I as FlowReviewReceipt, x as FlowStartReceipt, S as FlowStatus, M as FlowStep, k as HumanResponse, w as Json, C as MAX_STEPS_DEFAULT, _ as MAX_STEPS_MAX, L as MAX_STEPS_MIN, B as MediaArtifact, y as MediaArtifacts, z as MediaInputSlot, m as MediaInputs, n as MediaReceipt, R as Modality, h as ReviewMode, i as ReviewOption, r as RunReview, d as RunSource, D as RunStatus, e as RunStep, E as RunStepStatus, V as StepCondition, l as StepType, u as StepUsage, f as Visibility, a as clampMaxSteps, t as describeCondition, g as evaluateCondition, o as isTruthy, s as normalizeFlow, c as sanitizeOutputKey };
|
package/dist/web.d.ts
CHANGED
|
@@ -2,11 +2,11 @@ import { Schema } from 'effect';
|
|
|
2
2
|
|
|
3
3
|
/** A launch-form field. The run `input` is keyed by these `key`s. */
|
|
4
4
|
export declare const BriefField: Schema.Struct<{
|
|
5
|
-
key:
|
|
6
|
-
label:
|
|
7
|
-
type: Schema.
|
|
8
|
-
required: Schema.optional<
|
|
9
|
-
placeholder: Schema.optional<
|
|
5
|
+
readonly key: Schema.String;
|
|
6
|
+
readonly label: Schema.String;
|
|
7
|
+
readonly type: Schema.Literals<readonly ["text", "textarea", "number", "boolean"]>;
|
|
8
|
+
readonly required: Schema.optional<Schema.Boolean>;
|
|
9
|
+
readonly placeholder: Schema.optional<Schema.String>;
|
|
10
10
|
}>;
|
|
11
11
|
|
|
12
12
|
/** An INTERFACE for the same reason as {@link FlowStep} — it is reached from an
|
|
@@ -29,12 +29,12 @@ export declare interface BriefField {
|
|
|
29
29
|
export declare const cadenceMatches: (cadence: FlowCadence, now: Date) => boolean;
|
|
30
30
|
|
|
31
31
|
/** The comparison a `when:` performs. */
|
|
32
|
-
declare const ConditionOp: Schema.
|
|
32
|
+
declare const ConditionOp: Schema.Literals<readonly ["truthy", "falsy", "eq", "neq", "contains"]>;
|
|
33
33
|
|
|
34
34
|
declare type ConditionOp = typeof ConditionOp.Type;
|
|
35
35
|
|
|
36
36
|
/** Where a cost figure came from. `unpriced` means the number beside it is a placeholder, not a price. */
|
|
37
|
-
declare const CostSource: Schema.
|
|
37
|
+
declare const CostSource: Schema.Literals<readonly ["gateway", "estimated", "unpriced"]>;
|
|
38
38
|
|
|
39
39
|
declare type CostSource = typeof CostSource.Type;
|
|
40
40
|
|
|
@@ -43,19 +43,19 @@ export declare const DEFAULT_FLOW_RPC_TAGS: FlowRpcTags;
|
|
|
43
43
|
/** Schedule spec — richer than a single cron expr (weekly interval + anchor,
|
|
44
44
|
* monthly weekOfMonth), evaluated by the shared `cadenceMatches` predicate. */
|
|
45
45
|
export declare const FlowCadence: Schema.Struct<{
|
|
46
|
-
frequency: Schema.optional<Schema.
|
|
46
|
+
readonly frequency: Schema.optional<Schema.Literals<readonly ["weekly", "monthly"]>>;
|
|
47
47
|
/** Weekdays, 0=Monday … 6=Sunday. */
|
|
48
|
-
repeats: Schema
|
|
48
|
+
readonly repeats: Schema.$Array<Schema.Number>;
|
|
49
49
|
/** Weekly cycle length: 1 | 2 | 4 (anchored by anchorDate). */
|
|
50
|
-
intervalWeeks: Schema.optional<
|
|
50
|
+
readonly intervalWeeks: Schema.optional<Schema.Number>;
|
|
51
51
|
/** ISO YYYY-MM-DD, cycle-0 week (interval > 1). */
|
|
52
|
-
anchorDate: Schema.optional<
|
|
53
|
-
weekOfMonth: Schema.optional<Schema.Union<[Schema.
|
|
52
|
+
readonly anchorDate: Schema.optional<Schema.String>;
|
|
53
|
+
readonly weekOfMonth: Schema.optional<Schema.Union<readonly [Schema.Literals<readonly [1, 2, 3, 4]>, Schema.Literal<"last">]>>;
|
|
54
54
|
/** 0-23, default 9. */
|
|
55
|
-
hour: Schema.optional<
|
|
56
|
-
minute: Schema.optional<Schema.
|
|
55
|
+
readonly hour: Schema.optional<Schema.Number>;
|
|
56
|
+
readonly minute: Schema.optional<Schema.Literals<readonly [0, 15, 30, 45]>>;
|
|
57
57
|
/** Brief for unattended cron runs. */
|
|
58
|
-
defaultInput: Schema.optional<Schema
|
|
58
|
+
readonly defaultInput: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
59
59
|
}>;
|
|
60
60
|
|
|
61
61
|
/**
|
|
@@ -81,12 +81,12 @@ export declare interface FlowCadence {
|
|
|
81
81
|
/** Follow-up flow spec. On success, map source → the child's brief. */
|
|
82
82
|
export declare const FlowChain: Schema.Struct<{
|
|
83
83
|
/** Child flow id (data) or name (code). */
|
|
84
|
-
flowRef:
|
|
85
|
-
mappings: Schema
|
|
86
|
-
targetKey:
|
|
87
|
-
sourceKey:
|
|
84
|
+
readonly flowRef: Schema.String;
|
|
85
|
+
readonly mappings: Schema.$Array<Schema.Struct<{
|
|
86
|
+
readonly targetKey: Schema.String;
|
|
87
|
+
readonly sourceKey: Schema.String;
|
|
88
88
|
}>>;
|
|
89
|
-
requireConfirmation: Schema.optional<
|
|
89
|
+
readonly requireConfirmation: Schema.optional<Schema.Boolean>;
|
|
90
90
|
}>;
|
|
91
91
|
|
|
92
92
|
/** An INTERFACE — reached from `aiFlows.chainTo`; see {@link BriefField}. */
|
|
@@ -110,19 +110,19 @@ export declare interface FlowHookOptions {
|
|
|
110
110
|
/** Execution mode. Replaces the legacy `allowDeviation` boolean — a mode is not
|
|
111
111
|
* a boolean. `deterministic` runs the plan verbatim (resumable per step);
|
|
112
112
|
* `agentic` lets an orchestrator LLM adapt the plan via the four tools. */
|
|
113
|
-
export declare const FlowMode: Schema.
|
|
113
|
+
export declare const FlowMode: Schema.Literals<readonly ["deterministic", "agentic"]>;
|
|
114
114
|
|
|
115
115
|
export declare type FlowMode = typeof FlowMode.Type;
|
|
116
116
|
|
|
117
117
|
/** Bind the answer to the review actually displayed, not the latest waiting step. */
|
|
118
118
|
export declare const FlowReviewInput: Schema.Struct<{
|
|
119
|
-
runId:
|
|
120
|
-
stepIndex: Schema.
|
|
121
|
-
response: Schema.Struct<{
|
|
122
|
-
decision: Schema.optional<Schema.
|
|
123
|
-
value: Schema.optional<
|
|
124
|
-
text: Schema.optional<
|
|
125
|
-
respondedAt: Schema.optional<
|
|
119
|
+
readonly runId: Schema.NonEmptyString;
|
|
120
|
+
readonly stepIndex: Schema.Int;
|
|
121
|
+
readonly response: Schema.Struct<{
|
|
122
|
+
readonly decision: Schema.optional<Schema.Literals<readonly ["approve", "reject"]>>;
|
|
123
|
+
readonly value: Schema.optional<Schema.String>;
|
|
124
|
+
readonly text: Schema.optional<Schema.String>;
|
|
125
|
+
readonly respondedAt: Schema.optional<Schema.String>;
|
|
126
126
|
}>;
|
|
127
127
|
}>;
|
|
128
128
|
|
|
@@ -130,11 +130,11 @@ export declare type FlowReviewInput = typeof FlowReviewInput.Type;
|
|
|
130
130
|
|
|
131
131
|
/** Delivery accepted; consumption and the run's eventual outcome remain reactive state. */
|
|
132
132
|
export declare const FlowReviewReceipt: Schema.Struct<{
|
|
133
|
-
runId:
|
|
134
|
-
stepIndex: Schema.
|
|
135
|
-
executionId:
|
|
136
|
-
eventId:
|
|
137
|
-
status: Schema.Literal<
|
|
133
|
+
readonly runId: Schema.NonEmptyString;
|
|
134
|
+
readonly stepIndex: Schema.Int;
|
|
135
|
+
readonly executionId: Schema.NonEmptyString;
|
|
136
|
+
readonly eventId: Schema.NonEmptyString;
|
|
137
|
+
readonly status: Schema.Literal<"accepted">;
|
|
138
138
|
}>;
|
|
139
139
|
|
|
140
140
|
export declare type FlowReviewReceipt = typeof FlowReviewReceipt.Type;
|
|
@@ -191,18 +191,18 @@ export declare interface FlowRunView {
|
|
|
191
191
|
|
|
192
192
|
/** Submission evidence, separate from the flow run's execution status. */
|
|
193
193
|
declare const FlowStartReceipt: Schema.Struct<{
|
|
194
|
-
runId:
|
|
195
|
-
requestId:
|
|
196
|
-
admission: Schema.Struct<{
|
|
197
|
-
id:
|
|
198
|
-
workflowName:
|
|
199
|
-
executionId: Schema.NullOr<
|
|
200
|
-
status: Schema.
|
|
201
|
-
deferral: Schema.optional<Schema.Struct<{
|
|
202
|
-
mode:
|
|
203
|
-
dueAt: Schema.NullOr<
|
|
204
|
-
retryAfterMs: Schema.NullOr<
|
|
205
|
-
intentId: Schema.NullOr<
|
|
194
|
+
readonly runId: Schema.NonEmptyString;
|
|
195
|
+
readonly requestId: Schema.NonEmptyString;
|
|
196
|
+
readonly admission: Schema.Struct<{
|
|
197
|
+
readonly id: Schema.String;
|
|
198
|
+
readonly workflowName: Schema.String;
|
|
199
|
+
readonly executionId: Schema.NullOr<Schema.String>;
|
|
200
|
+
readonly status: Schema.Literals<readonly ["running", "succeeded", "queued", "dropped", "skipped", "replayed"]>;
|
|
201
|
+
readonly deferral: Schema.optional<Schema.Struct<{
|
|
202
|
+
readonly mode: Schema.String;
|
|
203
|
+
readonly dueAt: Schema.NullOr<Schema.Number>;
|
|
204
|
+
readonly retryAfterMs: Schema.NullOr<Schema.Number>;
|
|
205
|
+
readonly intentId: Schema.NullOr<Schema.String>;
|
|
206
206
|
}>>;
|
|
207
207
|
}>;
|
|
208
208
|
}>;
|
|
@@ -210,7 +210,7 @@ declare const FlowStartReceipt: Schema.Struct<{
|
|
|
210
210
|
declare type FlowStartReceipt = typeof FlowStartReceipt.Type;
|
|
211
211
|
|
|
212
212
|
/** Flow-definition lifecycle. */
|
|
213
|
-
export declare const FlowStatus: Schema.
|
|
213
|
+
export declare const FlowStatus: Schema.Literals<readonly ["draft", "active", "archived"]>;
|
|
214
214
|
|
|
215
215
|
export declare type FlowStatus = typeof FlowStatus.Type;
|
|
216
216
|
|
|
@@ -221,43 +221,43 @@ export declare type FlowStatus = typeof FlowStatus.Type;
|
|
|
221
221
|
* `{{outputKey}}` in `prompt` / media refs.
|
|
222
222
|
*/
|
|
223
223
|
export declare const FlowStep: Schema.Struct<{
|
|
224
|
-
id:
|
|
225
|
-
title: Schema.optional<
|
|
224
|
+
readonly id: Schema.String;
|
|
225
|
+
readonly title: Schema.optional<Schema.String>;
|
|
226
226
|
/** Informational; shown under the step in the run timeline. */
|
|
227
|
-
description: Schema.optional<
|
|
228
|
-
type: Schema.
|
|
227
|
+
readonly description: Schema.optional<Schema.String>;
|
|
228
|
+
readonly type: Schema.Literals<readonly ["agent", "generate", "structured", "note", "human"]>;
|
|
229
229
|
/** Sanitized [\w.-]; the result-bundle key + the `{{ref}}` name. */
|
|
230
|
-
outputKey: Schema.optional<
|
|
230
|
+
readonly outputKey: Schema.optional<Schema.String>;
|
|
231
231
|
/** Template with `{{key}}` placeholders (brief inputs + prior outputKeys). */
|
|
232
|
-
prompt: Schema.optional<
|
|
233
|
-
modality: Schema.optional<Schema.
|
|
234
|
-
model: Schema.optional<
|
|
235
|
-
params: Schema.optional<Schema
|
|
236
|
-
mediaInputs: Schema.optional<Schema
|
|
237
|
-
from: Schema.Literal<
|
|
238
|
-
url:
|
|
239
|
-
mediaType: Schema.optional<
|
|
232
|
+
readonly prompt: Schema.optional<Schema.String>;
|
|
233
|
+
readonly modality: Schema.optional<Schema.Literals<readonly ["text", "image", "video", "audio"]>>;
|
|
234
|
+
readonly model: Schema.optional<Schema.String>;
|
|
235
|
+
readonly params: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
236
|
+
readonly mediaInputs: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.Struct<{
|
|
237
|
+
readonly from: Schema.Literal<"upload">;
|
|
238
|
+
readonly url: Schema.String;
|
|
239
|
+
readonly mediaType: Schema.optional<Schema.NonEmptyString>;
|
|
240
240
|
}>, Schema.Struct<{
|
|
241
|
-
from: Schema.Literal<
|
|
242
|
-
ref:
|
|
243
|
-
artifact: Schema.optional<Schema.
|
|
241
|
+
readonly from: Schema.Literal<"step">;
|
|
242
|
+
readonly ref: Schema.String;
|
|
243
|
+
readonly artifact: Schema.optional<Schema.Int>;
|
|
244
244
|
}>]>>>;
|
|
245
245
|
/** Allowed sub-agent id/name, resolved and authorized by the host. */
|
|
246
|
-
agentRef: Schema.optional<
|
|
246
|
+
readonly agentRef: Schema.optional<Schema.String>;
|
|
247
247
|
/** JSON Schema of the desired object, preserved and validated at run. */
|
|
248
|
-
schema: Schema.optional<Schema
|
|
249
|
-
reviewMode: Schema.optional<Schema.
|
|
250
|
-
options: Schema.optional<Schema
|
|
251
|
-
value:
|
|
252
|
-
label:
|
|
248
|
+
readonly schema: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
249
|
+
readonly reviewMode: Schema.optional<Schema.Literals<readonly ["approve", "choice", "text"]>>;
|
|
250
|
+
readonly options: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
251
|
+
readonly value: Schema.String;
|
|
252
|
+
readonly label: Schema.String;
|
|
253
253
|
}>>>;
|
|
254
254
|
/** Gate this step on a prior value. Absent → the step always runs. A step
|
|
255
255
|
* whose condition is false is SKIPPED, not failed: it produces no output, so
|
|
256
256
|
* anything referencing its `outputKey` sees an absent value. */
|
|
257
|
-
when: Schema.optional<Schema.Struct<{
|
|
258
|
-
ref:
|
|
259
|
-
op: Schema.
|
|
260
|
-
value: Schema.optional<
|
|
257
|
+
readonly when: Schema.optional<Schema.Struct<{
|
|
258
|
+
readonly ref: Schema.String;
|
|
259
|
+
readonly op: Schema.Literals<readonly ["truthy", "falsy", "eq", "neq", "contains"]>;
|
|
260
|
+
readonly value: Schema.optional<Schema.Unknown>;
|
|
261
261
|
}>>;
|
|
262
262
|
/**
|
|
263
263
|
* Fan-out group. CONSECUTIVE steps sharing a group name run CONCURRENTLY,
|
|
@@ -268,12 +268,12 @@ export declare const FlowStep: Schema.Struct<{
|
|
|
268
268
|
* step may not join a group either: it suspends the whole workflow, which is
|
|
269
269
|
* not a thing one branch of a fan-out can do.
|
|
270
270
|
*/
|
|
271
|
-
group: Schema.optional<
|
|
271
|
+
readonly group: Schema.optional<Schema.String>;
|
|
272
272
|
/** `human` step only — how long the run parks awaiting this review before it
|
|
273
273
|
* fails, in milliseconds. Omitted → the flow's `humanTimeoutMs`, then the
|
|
274
274
|
* engine/plugin default (see `resolveHumanReviewTimeoutMs`). `0` means WAIT
|
|
275
275
|
* FOREVER (the park is slot-free, so an unbounded wait costs no worker). */
|
|
276
|
-
timeoutMs: Schema.optional<
|
|
276
|
+
readonly timeoutMs: Schema.optional<Schema.Number>;
|
|
277
277
|
}>;
|
|
278
278
|
|
|
279
279
|
/**
|
|
@@ -321,10 +321,10 @@ export declare interface FlowStep {
|
|
|
321
321
|
|
|
322
322
|
/** The HITL answer; the engine projects it after consuming the durable signal. */
|
|
323
323
|
export declare const HumanResponse: Schema.Struct<{
|
|
324
|
-
decision: Schema.optional<Schema.
|
|
325
|
-
value: Schema.optional<
|
|
326
|
-
text: Schema.optional<
|
|
327
|
-
respondedAt: Schema.optional<
|
|
324
|
+
readonly decision: Schema.optional<Schema.Literals<readonly ["approve", "reject"]>>;
|
|
325
|
+
readonly value: Schema.optional<Schema.String>;
|
|
326
|
+
readonly text: Schema.optional<Schema.String>;
|
|
327
|
+
readonly respondedAt: Schema.optional<Schema.String>;
|
|
328
328
|
}>;
|
|
329
329
|
|
|
330
330
|
/** An INTERFACE — reached from `aiFlowRuns.humanResponse`; see {@link BriefField}. */
|
|
@@ -336,7 +336,7 @@ export declare interface HumanResponse {
|
|
|
336
336
|
}
|
|
337
337
|
|
|
338
338
|
/** A JSON value (for `params` / `input` / a `structured` step's JSON Schema). */
|
|
339
|
-
declare const Json: Schema
|
|
339
|
+
declare const Json: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
340
340
|
|
|
341
341
|
declare type Json = typeof Json.Type;
|
|
342
342
|
|
|
@@ -351,28 +351,28 @@ export declare type LaunchFlowResult = FlowStartReceipt;
|
|
|
351
351
|
/** One persisted media artifact. Storage identity is not a provider request ID.
|
|
352
352
|
* Exactly one artifact per result has role `primary`; other roles are host-defined. */
|
|
353
353
|
declare const MediaArtifact: Schema.Struct<{
|
|
354
|
-
url:
|
|
355
|
-
mediaType:
|
|
356
|
-
role:
|
|
357
|
-
storageRefId: Schema.optional<
|
|
358
|
-
providerMetadata: Schema.optional<
|
|
354
|
+
readonly url: Schema.NonEmptyString;
|
|
355
|
+
readonly mediaType: Schema.NonEmptyString;
|
|
356
|
+
readonly role: Schema.NonEmptyString;
|
|
357
|
+
readonly storageRefId: Schema.optional<Schema.NonEmptyString>;
|
|
358
|
+
readonly providerMetadata: Schema.optional<Schema.Unknown>;
|
|
359
359
|
}>;
|
|
360
360
|
|
|
361
361
|
declare type MediaArtifact = typeof MediaArtifact.Type;
|
|
362
362
|
|
|
363
|
-
declare const MediaInputs: Schema
|
|
364
|
-
from: Schema.Literal<
|
|
365
|
-
url:
|
|
366
|
-
mediaType: Schema.optional<
|
|
363
|
+
declare const MediaInputs: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.Struct<{
|
|
364
|
+
readonly from: Schema.Literal<"upload">;
|
|
365
|
+
readonly url: Schema.String;
|
|
366
|
+
readonly mediaType: Schema.optional<Schema.NonEmptyString>;
|
|
367
367
|
}>, Schema.Struct<{
|
|
368
|
-
from: Schema.Literal<
|
|
369
|
-
ref:
|
|
370
|
-
artifact: Schema.optional<Schema.
|
|
368
|
+
readonly from: Schema.Literal<"step">;
|
|
369
|
+
readonly ref: Schema.String;
|
|
370
|
+
readonly artifact: Schema.optional<Schema.Int>;
|
|
371
371
|
}>]>>;
|
|
372
372
|
|
|
373
373
|
declare type MediaInputs = typeof MediaInputs.Type;
|
|
374
374
|
|
|
375
|
-
export declare const Modality: Schema.
|
|
375
|
+
export declare const Modality: Schema.Literals<readonly ["text", "image", "video", "audio"]>;
|
|
376
376
|
|
|
377
377
|
export declare type Modality = typeof Modality.Type;
|
|
378
378
|
|
|
@@ -383,25 +383,25 @@ export declare type Modality = typeof Modality.Type;
|
|
|
383
383
|
*/
|
|
384
384
|
export declare const nextRuns: (cadence: FlowCadence, from: Date, count?: number) => ReadonlyArray<Date>;
|
|
385
385
|
|
|
386
|
-
export declare const ReviewMode: Schema.
|
|
386
|
+
export declare const ReviewMode: Schema.Literals<readonly ["approve", "choice", "text"]>;
|
|
387
387
|
|
|
388
388
|
export declare type ReviewMode = typeof ReviewMode.Type;
|
|
389
389
|
|
|
390
390
|
export declare const ReviewOption: Schema.Struct<{
|
|
391
|
-
value:
|
|
392
|
-
label:
|
|
391
|
+
readonly value: Schema.String;
|
|
392
|
+
readonly label: Schema.String;
|
|
393
393
|
}>;
|
|
394
394
|
|
|
395
395
|
export declare type ReviewOption = typeof ReviewOption.Type;
|
|
396
396
|
|
|
397
397
|
/** Human-review config projected onto a `waiting` run step. */
|
|
398
398
|
export declare const RunReview: Schema.Struct<{
|
|
399
|
-
mode: Schema.
|
|
400
|
-
options: Schema.optional<Schema
|
|
401
|
-
value:
|
|
402
|
-
label:
|
|
399
|
+
readonly mode: Schema.Literals<readonly ["approve", "choice", "text"]>;
|
|
400
|
+
readonly options: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
401
|
+
readonly value: Schema.String;
|
|
402
|
+
readonly label: Schema.String;
|
|
403
403
|
}>>>;
|
|
404
|
-
prompt:
|
|
404
|
+
readonly prompt: Schema.String;
|
|
405
405
|
}>;
|
|
406
406
|
|
|
407
407
|
export declare type RunReview = typeof RunReview.Type;
|
|
@@ -413,62 +413,62 @@ export declare type RunReview = typeof RunReview.Type;
|
|
|
413
413
|
* confirmed: the row carries that uncertainty until the engine stops the run
|
|
414
414
|
* (cooperatively, by interruption, or through a later confirmed request).
|
|
415
415
|
* Only `succeeded`, `failed` and `cancelled` are terminal. */
|
|
416
|
-
export declare const RunStatus: Schema.
|
|
416
|
+
export declare const RunStatus: Schema.Literals<readonly ["pending", "running", "waiting", "cancelling", "succeeded", "failed", "cancelled"]>;
|
|
417
417
|
|
|
418
418
|
export declare type RunStatus = typeof RunStatus.Type;
|
|
419
419
|
|
|
420
420
|
export declare const RunStep: Schema.Struct<{
|
|
421
|
-
id:
|
|
422
|
-
title:
|
|
423
|
-
description: Schema.optional<
|
|
424
|
-
type: Schema.
|
|
425
|
-
status: Schema.
|
|
421
|
+
readonly id: Schema.Number;
|
|
422
|
+
readonly title: Schema.String;
|
|
423
|
+
readonly description: Schema.optional<Schema.String>;
|
|
424
|
+
readonly type: Schema.Literals<readonly ["agent", "generate", "structured", "note", "human"]>;
|
|
425
|
+
readonly status: Schema.Literals<readonly ["pending", "running", "waiting", "succeeded", "failed", "skipped"]>;
|
|
426
426
|
/** The agent an `agent` step delegated to — a field, so a run view never
|
|
427
427
|
* parses it out of `title`. */
|
|
428
|
-
agentRef: Schema.optional<
|
|
428
|
+
readonly agentRef: Schema.optional<Schema.String>;
|
|
429
429
|
/** What a `generate` step produced. */
|
|
430
|
-
modality: Schema.optional<Schema.
|
|
431
|
-
startedAt: Schema.optional<
|
|
432
|
-
completedAt: Schema.optional<
|
|
430
|
+
readonly modality: Schema.optional<Schema.Literals<readonly ["text", "image", "video", "audio"]>>;
|
|
431
|
+
readonly startedAt: Schema.optional<Schema.String>;
|
|
432
|
+
readonly completedAt: Schema.optional<Schema.String>;
|
|
433
433
|
/** Per-step cost in micro-USD (the app view projects to €/cents). */
|
|
434
|
-
costMicroUsd: Schema.optional<
|
|
434
|
+
readonly costMicroUsd: Schema.optional<Schema.Number>;
|
|
435
435
|
/** Where that number came from — the gateway's actual charge, a price-table
|
|
436
436
|
* estimate, or nothing (`unpriced`: the 0 above is not a price). */
|
|
437
|
-
costSource: Schema.optional<Schema.
|
|
437
|
+
readonly costSource: Schema.optional<Schema.Literals<readonly ["gateway", "estimated", "unpriced"]>>;
|
|
438
438
|
/** Links a media step to its generation/usage record. */
|
|
439
|
-
requestId: Schema.optional<
|
|
439
|
+
readonly requestId: Schema.optional<Schema.String>;
|
|
440
440
|
/** What the step consumed — also on a FAILED step that was charged. */
|
|
441
|
-
usage: Schema.optional<Schema.Struct<{
|
|
442
|
-
status: Schema.
|
|
443
|
-
unit: Schema.optional<Schema.
|
|
444
|
-
input: Schema.optional<Schema.
|
|
445
|
-
output: Schema.optional<Schema.
|
|
441
|
+
readonly usage: Schema.optional<Schema.Struct<{
|
|
442
|
+
readonly status: Schema.Literals<readonly ["reported", "unreported"]>;
|
|
443
|
+
readonly unit: Schema.optional<Schema.Literals<readonly ["tokens", "characters", "seconds"]>>;
|
|
444
|
+
readonly input: Schema.optional<Schema.Finite>;
|
|
445
|
+
readonly output: Schema.optional<Schema.Finite>;
|
|
446
446
|
}>>;
|
|
447
447
|
/** Hosted media artifact URL (image/video/audio), via storage. */
|
|
448
|
-
url: Schema.optional<
|
|
448
|
+
readonly url: Schema.optional<Schema.String>;
|
|
449
449
|
/** All media variants, including roles and storage references; url projects the primary artifact. */
|
|
450
|
-
artifacts: Schema.optional<Schema
|
|
451
|
-
url:
|
|
452
|
-
mediaType:
|
|
453
|
-
role:
|
|
454
|
-
storageRefId: Schema.optional<
|
|
455
|
-
providerMetadata: Schema.optional<
|
|
456
|
-
}
|
|
450
|
+
readonly artifacts: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
451
|
+
readonly url: Schema.NonEmptyString;
|
|
452
|
+
readonly mediaType: Schema.NonEmptyString;
|
|
453
|
+
readonly role: Schema.NonEmptyString;
|
|
454
|
+
readonly storageRefId: Schema.optional<Schema.NonEmptyString>;
|
|
455
|
+
readonly providerMetadata: Schema.optional<Schema.Unknown>;
|
|
456
|
+
}>>>;
|
|
457
457
|
/** Inline text output (rendered as markdown). */
|
|
458
|
-
output: Schema.optional<Schema.Struct<{
|
|
459
|
-
text:
|
|
458
|
+
readonly output: Schema.optional<Schema.Struct<{
|
|
459
|
+
readonly text: Schema.String;
|
|
460
460
|
}>>;
|
|
461
|
-
errorMessage: Schema.optional<
|
|
461
|
+
readonly errorMessage: Schema.optional<Schema.String>;
|
|
462
462
|
/** Why a `skipped` step was skipped — the rendered condition, so the timeline
|
|
463
463
|
* says "{{approved}} is not set" instead of leaving a silent gap. */
|
|
464
|
-
skipReason: Schema.optional<
|
|
465
|
-
review: Schema.optional<Schema.Struct<{
|
|
466
|
-
mode: Schema.
|
|
467
|
-
options: Schema.optional<Schema
|
|
468
|
-
value:
|
|
469
|
-
label:
|
|
464
|
+
readonly skipReason: Schema.optional<Schema.String>;
|
|
465
|
+
readonly review: Schema.optional<Schema.Struct<{
|
|
466
|
+
readonly mode: Schema.Literals<readonly ["approve", "choice", "text"]>;
|
|
467
|
+
readonly options: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
468
|
+
readonly value: Schema.String;
|
|
469
|
+
readonly label: Schema.String;
|
|
470
470
|
}>>>;
|
|
471
|
-
prompt:
|
|
471
|
+
readonly prompt: Schema.String;
|
|
472
472
|
}>>;
|
|
473
473
|
}>;
|
|
474
474
|
|
|
@@ -500,16 +500,16 @@ export declare interface RunStep {
|
|
|
500
500
|
readonly review?: RunReview | undefined;
|
|
501
501
|
}
|
|
502
502
|
|
|
503
|
-
declare const RunStepStatus: Schema.
|
|
503
|
+
declare const RunStepStatus: Schema.Literals<readonly ["pending", "running", "waiting", "succeeded", "failed", "skipped"]>;
|
|
504
504
|
|
|
505
505
|
declare type RunStepStatus = typeof RunStepStatus.Type;
|
|
506
506
|
|
|
507
507
|
declare const StepCondition: Schema.Struct<{
|
|
508
508
|
/** A brief-field key or an EARLIER step's `outputKey`. */
|
|
509
|
-
ref:
|
|
510
|
-
op: Schema.
|
|
509
|
+
readonly ref: Schema.String;
|
|
510
|
+
readonly op: Schema.Literals<readonly ["truthy", "falsy", "eq", "neq", "contains"]>;
|
|
511
511
|
/** The right-hand side for `eq` / `neq` / `contains`. Ignored by the unary ops. */
|
|
512
|
-
value: Schema.optional<
|
|
512
|
+
readonly value: Schema.optional<Schema.Unknown>;
|
|
513
513
|
}>;
|
|
514
514
|
|
|
515
515
|
/** An INTERFACE, for the same api-report reason as `FlowStep` — it is reached
|
|
@@ -522,7 +522,7 @@ declare interface StepCondition {
|
|
|
522
522
|
}
|
|
523
523
|
|
|
524
524
|
/** The five step types. `generate` fans out to four modalities. */
|
|
525
|
-
export declare const StepType: Schema.
|
|
525
|
+
export declare const StepType: Schema.Literals<readonly ["agent", "generate", "structured", "note", "human"]>;
|
|
526
526
|
|
|
527
527
|
export declare type StepType = typeof StepType.Type;
|
|
528
528
|
|
|
@@ -537,10 +537,10 @@ export declare type StepType = typeof StepType.Type;
|
|
|
537
537
|
* later, or reconciled against an invoice.
|
|
538
538
|
*/
|
|
539
539
|
declare const StepUsage: Schema.Struct<{
|
|
540
|
-
status: Schema.
|
|
541
|
-
unit: Schema.optional<Schema.
|
|
542
|
-
input: Schema.optional<Schema.
|
|
543
|
-
output: Schema.optional<Schema.
|
|
540
|
+
readonly status: Schema.Literals<readonly ["reported", "unreported"]>;
|
|
541
|
+
readonly unit: Schema.optional<Schema.Literals<readonly ["tokens", "characters", "seconds"]>>;
|
|
542
|
+
readonly input: Schema.optional<Schema.Finite>;
|
|
543
|
+
readonly output: Schema.optional<Schema.Finite>;
|
|
544
544
|
}>;
|
|
545
545
|
|
|
546
546
|
declare type StepUsage = typeof StepUsage.Type;
|
|
@@ -569,41 +569,41 @@ export declare const useFlowReview: (runId: string | undefined, options?: FlowHo
|
|
|
569
569
|
/** `true` when there is a review this caller can answer right now. */
|
|
570
570
|
canRespond: boolean;
|
|
571
571
|
respond: (runId: string, stepIndex: number, response: HumanResponse) => Promise<{
|
|
572
|
-
readonly status: "accepted";
|
|
573
572
|
readonly runId: string;
|
|
573
|
+
readonly stepIndex: number;
|
|
574
574
|
readonly executionId: string;
|
|
575
575
|
readonly eventId: string;
|
|
576
|
-
readonly
|
|
576
|
+
readonly status: "accepted";
|
|
577
577
|
}>;
|
|
578
578
|
approve: (runId: string, stepIndex: number, text?: string) => Promise<{
|
|
579
|
-
readonly status: "accepted";
|
|
580
579
|
readonly runId: string;
|
|
580
|
+
readonly stepIndex: number;
|
|
581
581
|
readonly executionId: string;
|
|
582
582
|
readonly eventId: string;
|
|
583
|
-
readonly
|
|
583
|
+
readonly status: "accepted";
|
|
584
584
|
}>;
|
|
585
585
|
reject: (runId: string, stepIndex: number, text?: string) => Promise<{
|
|
586
|
-
readonly status: "accepted";
|
|
587
586
|
readonly runId: string;
|
|
587
|
+
readonly stepIndex: number;
|
|
588
588
|
readonly executionId: string;
|
|
589
589
|
readonly eventId: string;
|
|
590
|
-
readonly
|
|
590
|
+
readonly status: "accepted";
|
|
591
591
|
}>;
|
|
592
592
|
/** Pick one of a `choice` review's options. */
|
|
593
593
|
choose: (runId: string, stepIndex: number, value: string) => Promise<{
|
|
594
|
-
readonly status: "accepted";
|
|
595
594
|
readonly runId: string;
|
|
595
|
+
readonly stepIndex: number;
|
|
596
596
|
readonly executionId: string;
|
|
597
597
|
readonly eventId: string;
|
|
598
|
-
readonly
|
|
598
|
+
readonly status: "accepted";
|
|
599
599
|
}>;
|
|
600
600
|
/** Answer a `text` review. */
|
|
601
601
|
submitText: (runId: string, stepIndex: number, text: string) => Promise<{
|
|
602
|
-
readonly status: "accepted";
|
|
603
602
|
readonly runId: string;
|
|
603
|
+
readonly stepIndex: number;
|
|
604
604
|
readonly executionId: string;
|
|
605
605
|
readonly eventId: string;
|
|
606
|
-
readonly
|
|
606
|
+
readonly status: "accepted";
|
|
607
607
|
}>;
|
|
608
608
|
pending: boolean;
|
|
609
609
|
error: unknown;
|
|
@@ -646,8 +646,8 @@ export declare const useLaunchFlow: (options?: FlowHookOptions) => {
|
|
|
646
646
|
readonly workflowName: string;
|
|
647
647
|
readonly deferral?: {
|
|
648
648
|
readonly mode: string;
|
|
649
|
-
readonly retryAfterMs: number | null;
|
|
650
649
|
readonly dueAt: number | null;
|
|
650
|
+
readonly retryAfterMs: number | null;
|
|
651
651
|
readonly intentId: string | null;
|
|
652
652
|
} | undefined;
|
|
653
653
|
};
|
|
@@ -664,8 +664,8 @@ export declare const useLaunchFlow: (options?: FlowHookOptions) => {
|
|
|
664
664
|
readonly workflowName: string;
|
|
665
665
|
readonly deferral?: {
|
|
666
666
|
readonly mode: string;
|
|
667
|
-
readonly retryAfterMs: number | null;
|
|
668
667
|
readonly dueAt: number | null;
|
|
668
|
+
readonly retryAfterMs: number | null;
|
|
669
669
|
readonly intentId: string | null;
|
|
670
670
|
} | undefined;
|
|
671
671
|
};
|
|
@@ -683,41 +683,41 @@ export declare const useLaunchFlow: (options?: FlowHookOptions) => {
|
|
|
683
683
|
*/
|
|
684
684
|
export declare const useRespondToFlow: (options?: FlowHookOptions) => {
|
|
685
685
|
respond: (runId: string, stepIndex: number, response: HumanResponse) => Promise<{
|
|
686
|
-
readonly status: "accepted";
|
|
687
686
|
readonly runId: string;
|
|
687
|
+
readonly stepIndex: number;
|
|
688
688
|
readonly executionId: string;
|
|
689
689
|
readonly eventId: string;
|
|
690
|
-
readonly
|
|
690
|
+
readonly status: "accepted";
|
|
691
691
|
}>;
|
|
692
692
|
approve: (runId: string, stepIndex: number, text?: string) => Promise<{
|
|
693
|
-
readonly status: "accepted";
|
|
694
693
|
readonly runId: string;
|
|
694
|
+
readonly stepIndex: number;
|
|
695
695
|
readonly executionId: string;
|
|
696
696
|
readonly eventId: string;
|
|
697
|
-
readonly
|
|
697
|
+
readonly status: "accepted";
|
|
698
698
|
}>;
|
|
699
699
|
reject: (runId: string, stepIndex: number, text?: string) => Promise<{
|
|
700
|
-
readonly status: "accepted";
|
|
701
700
|
readonly runId: string;
|
|
701
|
+
readonly stepIndex: number;
|
|
702
702
|
readonly executionId: string;
|
|
703
703
|
readonly eventId: string;
|
|
704
|
-
readonly
|
|
704
|
+
readonly status: "accepted";
|
|
705
705
|
}>;
|
|
706
706
|
/** Pick one of a `choice` review's options. */
|
|
707
707
|
choose: (runId: string, stepIndex: number, value: string) => Promise<{
|
|
708
|
-
readonly status: "accepted";
|
|
709
708
|
readonly runId: string;
|
|
709
|
+
readonly stepIndex: number;
|
|
710
710
|
readonly executionId: string;
|
|
711
711
|
readonly eventId: string;
|
|
712
|
-
readonly
|
|
712
|
+
readonly status: "accepted";
|
|
713
713
|
}>;
|
|
714
714
|
/** Answer a `text` review. */
|
|
715
715
|
submitText: (runId: string, stepIndex: number, text: string) => Promise<{
|
|
716
|
-
readonly status: "accepted";
|
|
717
716
|
readonly runId: string;
|
|
717
|
+
readonly stepIndex: number;
|
|
718
718
|
readonly executionId: string;
|
|
719
719
|
readonly eventId: string;
|
|
720
|
-
readonly
|
|
720
|
+
readonly status: "accepted";
|
|
721
721
|
}>;
|
|
722
722
|
pending: boolean;
|
|
723
723
|
error: unknown;
|
|
@@ -735,8 +735,8 @@ export declare const useRetryFlow: (options?: FlowHookOptions) => {
|
|
|
735
735
|
readonly workflowName: string;
|
|
736
736
|
readonly deferral?: {
|
|
737
737
|
readonly mode: string;
|
|
738
|
-
readonly retryAfterMs: number | null;
|
|
739
738
|
readonly dueAt: number | null;
|
|
739
|
+
readonly retryAfterMs: number | null;
|
|
740
740
|
readonly intentId: string | null;
|
|
741
741
|
} | undefined;
|
|
742
742
|
};
|
|
@@ -746,7 +746,7 @@ export declare const useRetryFlow: (options?: FlowHookOptions) => {
|
|
|
746
746
|
};
|
|
747
747
|
|
|
748
748
|
/** Gallery scope. `shared` → per-subject share list; `organization` → tenant. */
|
|
749
|
-
export declare const Visibility: Schema.
|
|
749
|
+
export declare const Visibility: Schema.Literals<readonly ["private", "organization", "shared"]>;
|
|
750
750
|
|
|
751
751
|
export declare type Visibility = typeof Visibility.Type;
|
|
752
752
|
|