@voltro/plugin-ai-flows 0.71.0 → 0.72.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.
@@ -45,7 +45,8 @@ var n = e.Literal("truthy", "falsy", "eq", "neq", "contains"), r = e.Struct({
45
45
  label: e.String
46
46
  }), v = e.Union(e.Struct({
47
47
  from: e.Literal("upload"),
48
- url: e.String
48
+ url: e.String,
49
+ mediaType: e.optional(e.NonEmptyString)
49
50
  }), e.Struct({
50
51
  from: e.Literal("step"),
51
52
  ref: e.String,
@@ -106,7 +107,7 @@ var n = e.Literal("truthy", "falsy", "eq", "neq", "contains"), r = e.Struct({
106
107
  mode: g,
107
108
  options: e.optional(e.Array(_)),
108
109
  prompt: e.String
109
- }), k = e.Struct({
110
+ }), k = e.Literal("gateway", "estimated", "unpriced"), A = e.Literal("actual", "estimated", "incomplete", "unknown"), j = e.Struct({
110
111
  id: e.Number,
111
112
  title: e.String,
112
113
  description: e.optional(e.String),
@@ -115,6 +116,7 @@ var n = e.Literal("truthy", "falsy", "eq", "neq", "contains"), r = e.Struct({
115
116
  startedAt: e.optional(e.String),
116
117
  completedAt: e.optional(e.String),
117
118
  costMicroUsd: e.optional(e.Number),
119
+ costSource: e.optional(k),
118
120
  requestId: e.optional(e.String),
119
121
  url: e.optional(e.String),
120
122
  artifacts: e.optional(S),
@@ -122,29 +124,29 @@ var n = e.Literal("truthy", "falsy", "eq", "neq", "contains"), r = e.Struct({
122
124
  errorMessage: e.optional(e.String),
123
125
  skipReason: e.optional(e.String),
124
126
  review: e.optional(O)
125
- }), A = e.Struct({
127
+ }), M = e.Struct({
126
128
  decision: e.optional(e.Literal("approve", "reject")),
127
129
  value: e.optional(e.String),
128
130
  text: e.optional(e.String),
129
131
  respondedAt: e.optional(e.String)
130
- }), j = e.Struct({
132
+ }), N = e.Struct({
131
133
  runId: e.NonEmptyString,
132
134
  stepIndex: e.Int.pipe(e.nonNegative()),
133
- response: A
134
- }), M = e.Struct({
135
+ response: M
136
+ }), P = e.Struct({
135
137
  runId: e.NonEmptyString,
136
138
  stepIndex: e.Int.pipe(e.nonNegative()),
137
139
  executionId: e.NonEmptyString,
138
140
  eventId: e.NonEmptyString,
139
141
  status: e.Literal("accepted")
140
- }), N = e.Struct({
142
+ }), F = e.Struct({
141
143
  flowRef: e.String,
142
144
  input: b,
143
145
  status: e.Literal("pending", "confirmed", "dismissed")
144
- }), P = 30, F = 1, I = 100, L = (e) => e == null || !Number.isFinite(e) ? 30 : Math.min(100, Math.max(1, Math.trunc(e))), R = (e) => e.replace(/[^\w.-]/g, "_"), z = (e) => {
146
+ }), I = 30, L = 1, R = 100, z = (e) => e == null || !Number.isFinite(e) ? 30 : Math.min(100, Math.max(1, Math.trunc(e))), B = (e) => e.replace(/[^\w.-]/g, "_"), V = (e) => {
145
147
  let t = (e.steps ?? []).map((e) => e.outputKey ? {
146
148
  ...e,
147
- outputKey: R(e.outputKey)
149
+ outputKey: B(e.outputKey)
148
150
  } : e), n = e.orchestratorModel || e.orchestratorInstructions ? {
149
151
  ...e.orchestratorModel ? { model: e.orchestratorModel } : {},
150
152
  ...e.orchestratorInstructions ? { instructions: e.orchestratorInstructions } : {}
@@ -153,7 +155,7 @@ var n = e.Literal("truthy", "falsy", "eq", "neq", "contains"), r = e.Struct({
153
155
  name: e.name,
154
156
  mode: e.mode ?? "deterministic",
155
157
  steps: t,
156
- maxSteps: L(e.maxSteps),
158
+ maxSteps: z(e.maxSteps),
157
159
  brief: e.brief ?? [],
158
160
  ...n ? { orchestrator: n } : {},
159
161
  ...e.chain ? { chain: e.chain } : {},
@@ -162,4 +164,4 @@ var n = e.Literal("truthy", "falsy", "eq", "neq", "contains"), r = e.Struct({
162
164
  };
163
165
  };
164
166
  //#endregion
165
- export { L as A, O as C, D, k as E, s as F, o as I, i as L, R as M, n as N, m as O, r as P, _ as S, f as T, S as _, l as a, h as b, c, A as d, b as f, x as g, F as h, T as i, z as j, d as k, u as l, I as m, N as n, j as o, P as p, E as r, M as s, w as t, C as u, v, p as w, g as x, y };
167
+ export { m as A, g as C, f as D, p as E, n as F, r as I, s as L, z as M, V as N, j as O, B as P, o as R, h as S, O as T, L as _, E as a, v as b, N as c, u as d, C as f, R as g, I as h, k as i, d as j, D as k, P as l, b as m, F as n, T as o, M as p, A as r, l as s, w as t, c as u, x as v, _ as w, y as x, S as y, i as z };
package/dist/ir.d.ts CHANGED
@@ -42,6 +42,16 @@ export declare const ConditionOp: Schema.Literal<["truthy", "falsy", "eq", "neq"
42
42
 
43
43
  export declare type ConditionOp = typeof ConditionOp.Type;
44
44
 
45
+ /** A run's cost verdict over its steps: every step gateway-priced → `actual`; none unpriced → `estimated`; any unpriced → `incomplete`; no priced step → `unknown`. */
46
+ export declare const CostCompleteness: Schema.Literal<["actual", "estimated", "incomplete", "unknown"]>;
47
+
48
+ export declare type CostCompleteness = typeof CostCompleteness.Type;
49
+
50
+ /** Where a cost figure came from. `unpriced` means the number beside it is a placeholder, not a price. */
51
+ export declare const CostSource: Schema.Literal<["gateway", "estimated", "unpriced"]>;
52
+
53
+ export declare type CostSource = typeof CostSource.Type;
54
+
45
55
  /** A one-line rendering for the run timeline and the editor preview. Exported
46
56
  * so the reason a step was skipped is the SAME sentence in both places. */
47
57
  export declare const describeCondition: (condition: StepCondition) => string;
@@ -229,6 +239,7 @@ export declare const FlowStep: Schema.Struct<{
229
239
  mediaInputs: Schema.optional<Schema.Record$<typeof Schema.String, Schema.Union<[Schema.Struct<{
230
240
  from: Schema.Literal<["upload"]>;
231
241
  url: typeof Schema.String;
242
+ mediaType: Schema.optional<typeof Schema.NonEmptyString>;
232
243
  }>, Schema.Struct<{
233
244
  from: Schema.Literal<["step"]>;
234
245
  ref: typeof Schema.String;
@@ -377,6 +388,7 @@ export declare const MediaArtifacts: Schema.filter<Schema.Array$<Schema.Struct<{
377
388
  export declare const MediaInputs: Schema.Record$<typeof Schema.String, Schema.Union<[Schema.Struct<{
378
389
  from: Schema.Literal<["upload"]>;
379
390
  url: typeof Schema.String;
391
+ mediaType: Schema.optional<typeof Schema.NonEmptyString>;
380
392
  }>, Schema.Struct<{
381
393
  from: Schema.Literal<["step"]>;
382
394
  ref: typeof Schema.String;
@@ -391,6 +403,7 @@ export declare type MediaInputs = typeof MediaInputs.Type;
391
403
  export declare const MediaInputSlot: Schema.Union<[Schema.Struct<{
392
404
  from: Schema.Literal<["upload"]>;
393
405
  url: typeof Schema.String;
406
+ mediaType: Schema.optional<typeof Schema.NonEmptyString>;
394
407
  }>, Schema.Struct<{
395
408
  from: Schema.Literal<["step"]>;
396
409
  ref: typeof Schema.String;
@@ -455,6 +468,9 @@ export declare const RunStep: Schema.Struct<{
455
468
  completedAt: Schema.optional<typeof Schema.String>;
456
469
  /** Per-step cost in micro-USD (the app view projects to €/cents). */
457
470
  costMicroUsd: Schema.optional<typeof Schema.Number>;
471
+ /** Where that number came from — the gateway's actual charge, a price-table
472
+ * estimate, or nothing (`unpriced`: the 0 above is not a price). */
473
+ costSource: Schema.optional<Schema.Literal<["gateway", "estimated", "unpriced"]>>;
458
474
  /** Links a media step to its generation/usage record. */
459
475
  requestId: Schema.optional<typeof Schema.String>;
460
476
  /** Hosted media artifact URL (image/video/audio), via storage. */
@@ -497,6 +513,7 @@ export declare interface RunStep {
497
513
  readonly startedAt?: string | undefined;
498
514
  readonly completedAt?: string | undefined;
499
515
  readonly costMicroUsd?: number | undefined;
516
+ readonly costSource?: CostSource | undefined;
500
517
  readonly requestId?: string | undefined;
501
518
  readonly url?: string | undefined;
502
519
  readonly artifacts?: ReadonlyArray<MediaArtifact> | undefined;
package/dist/ir.js CHANGED
@@ -1,2 +1,2 @@
1
- import { A as e, C as t, D as n, E as r, F as i, I as a, L as o, M as s, N as c, O as l, P as u, S as d, T as f, _ as p, a as m, b as h, c as g, d as _, f as v, g as y, h as b, i as x, j as S, k as C, l as w, m as T, n as E, o as D, p as O, r as k, s as A, t as j, u as M, v as N, w as P, x as F, y as I } from "./ir-B0rox9qW.js";
2
- export { j as BriefField, E as ChainPending, c as ConditionOp, k as FlowCadence, x as FlowChain, m as FlowMode, D as FlowReviewInput, A as FlowReviewReceipt, g as FlowStartReceipt, w as FlowStatus, M as FlowStep, _ as HumanResponse, v as Json, O as MAX_STEPS_DEFAULT, T as MAX_STEPS_MAX, b as MAX_STEPS_MIN, y as MediaArtifact, p as MediaArtifacts, N as MediaInputSlot, I as MediaInputs, h as Modality, F as ReviewMode, d as ReviewOption, t as RunReview, P as RunSource, f as RunStatus, r as RunStep, n as RunStepStatus, u as StepCondition, l as StepType, C as Visibility, e as clampMaxSteps, i as describeCondition, a as evaluateCondition, o as isTruthy, S as normalizeFlow, s as sanitizeOutputKey };
1
+ import { A as e, C as t, D as n, E as r, F as i, I as a, L as o, M as s, N as c, O as l, P as u, R as d, S as f, T as p, _ as m, a as h, b as g, c as _, d as v, f as y, g as b, h as x, i as S, j as C, k as w, l as T, m as E, n as D, o as O, p as k, r as A, s as j, t as M, u as N, v as P, w as F, x as I, y as L, z as R } from "./ir-BP8rOTuf.js";
2
+ export { M as BriefField, D as ChainPending, i as ConditionOp, A as CostCompleteness, S as CostSource, h as FlowCadence, O as FlowChain, j as FlowMode, _ as FlowReviewInput, T as FlowReviewReceipt, N as FlowStartReceipt, v as FlowStatus, y as FlowStep, k as HumanResponse, E as Json, x as MAX_STEPS_DEFAULT, b as MAX_STEPS_MAX, m as MAX_STEPS_MIN, P as MediaArtifact, L as MediaArtifacts, g as MediaInputSlot, I as MediaInputs, f as Modality, t as ReviewMode, F as ReviewOption, p as RunReview, r as RunSource, n as RunStatus, l as RunStep, w as RunStepStatus, a as StepCondition, e as StepType, C as Visibility, s as clampMaxSteps, o as describeCondition, d as evaluateCondition, R as isTruthy, c as normalizeFlow, u as sanitizeOutputKey };
package/dist/web.d.ts CHANGED
@@ -33,6 +33,11 @@ declare const ConditionOp: Schema.Literal<["truthy", "falsy", "eq", "neq", "cont
33
33
 
34
34
  declare type ConditionOp = typeof ConditionOp.Type;
35
35
 
36
+ /** Where a cost figure came from. `unpriced` means the number beside it is a placeholder, not a price. */
37
+ declare const CostSource: Schema.Literal<["gateway", "estimated", "unpriced"]>;
38
+
39
+ declare type CostSource = typeof CostSource.Type;
40
+
36
41
  export declare const DEFAULT_FLOW_RPC_TAGS: FlowRpcTags;
37
42
 
38
43
  /** Schedule spec — richer than a single cron expr (weekly interval + anchor,
@@ -231,6 +236,7 @@ export declare const FlowStep: Schema.Struct<{
231
236
  mediaInputs: Schema.optional<Schema.Record$<typeof Schema.String, Schema.Union<[Schema.Struct<{
232
237
  from: Schema.Literal<["upload"]>;
233
238
  url: typeof Schema.String;
239
+ mediaType: Schema.optional<typeof Schema.NonEmptyString>;
234
240
  }>, Schema.Struct<{
235
241
  from: Schema.Literal<["step"]>;
236
242
  ref: typeof Schema.String;
@@ -357,6 +363,7 @@ declare type MediaArtifact = typeof MediaArtifact.Type;
357
363
  declare const MediaInputs: Schema.Record$<typeof Schema.String, Schema.Union<[Schema.Struct<{
358
364
  from: Schema.Literal<["upload"]>;
359
365
  url: typeof Schema.String;
366
+ mediaType: Schema.optional<typeof Schema.NonEmptyString>;
360
367
  }>, Schema.Struct<{
361
368
  from: Schema.Literal<["step"]>;
362
369
  ref: typeof Schema.String;
@@ -416,6 +423,9 @@ export declare const RunStep: Schema.Struct<{
416
423
  completedAt: Schema.optional<typeof Schema.String>;
417
424
  /** Per-step cost in micro-USD (the app view projects to €/cents). */
418
425
  costMicroUsd: Schema.optional<typeof Schema.Number>;
426
+ /** Where that number came from — the gateway's actual charge, a price-table
427
+ * estimate, or nothing (`unpriced`: the 0 above is not a price). */
428
+ costSource: Schema.optional<Schema.Literal<["gateway", "estimated", "unpriced"]>>;
419
429
  /** Links a media step to its generation/usage record. */
420
430
  requestId: Schema.optional<typeof Schema.String>;
421
431
  /** Hosted media artifact URL (image/video/audio), via storage. */
@@ -458,6 +468,7 @@ export declare interface RunStep {
458
468
  readonly startedAt?: string | undefined;
459
469
  readonly completedAt?: string | undefined;
460
470
  readonly costMicroUsd?: number | undefined;
471
+ readonly costSource?: CostSource | undefined;
461
472
  readonly requestId?: string | undefined;
462
473
  readonly url?: string | undefined;
463
474
  readonly artifacts?: ReadonlyArray<MediaArtifact> | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voltro/plugin-ai-flows",
3
- "version": "0.71.0",
3
+ "version": "0.72.0",
4
4
  "description": "AI Flows — durable multi-step AI pipelines (deterministic + agentic) with human-in-the-loop, chaining, and cadence. Author flows in code (defineFlow) or as data (visual editor rows); one engine runs both on @voltro/workflow durability, @voltro/ai generation, storage artifacts, and notifications.",
5
5
  "keywords": [
6
6
  "voltro",
@@ -58,16 +58,16 @@
58
58
  "node": ">=24.0.0"
59
59
  },
60
60
  "dependencies": {
61
- "@voltro/ai": "0.71.0",
62
- "@voltro/client": "0.71.0",
63
- "@voltro/database": "0.71.0",
64
- "@voltro/env": "0.71.0",
65
- "@voltro/plugin-audit": "0.71.0",
66
- "@voltro/plugin-multitenancy": "0.71.0",
67
- "@voltro/plugin-soft-delete": "0.71.0",
68
- "@voltro/protocol": "0.71.0",
69
- "@voltro/runtime": "0.71.0",
70
- "@voltro/workflow": "0.71.0"
61
+ "@voltro/ai": "0.72.0",
62
+ "@voltro/client": "0.72.0",
63
+ "@voltro/database": "0.72.0",
64
+ "@voltro/env": "0.72.0",
65
+ "@voltro/plugin-audit": "0.72.0",
66
+ "@voltro/plugin-multitenancy": "0.72.0",
67
+ "@voltro/plugin-soft-delete": "0.72.0",
68
+ "@voltro/protocol": "0.72.0",
69
+ "@voltro/runtime": "0.72.0",
70
+ "@voltro/workflow": "0.72.0"
71
71
  },
72
72
  "peerDependencies": {
73
73
  "effect": "^3.22.1"