@voltro/plugin-ai-flows 0.74.0 → 0.76.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.
@@ -9,7 +9,7 @@ Generated from the resolved runtime dependency closure (73 packages).
9
9
 
10
10
  ---
11
11
 
12
- ## @ai-sdk/anthropic@4.0.49
12
+ ## @ai-sdk/anthropic@4.0.56
13
13
 
14
14
  License: Apache-2.0
15
15
 
@@ -29,7 +29,7 @@ See the License for the specific language governing permissions and
29
29
  limitations under the License.
30
30
  ```
31
31
 
32
- ## @ai-sdk/openai@4.0.58
32
+ ## @ai-sdk/openai@4.0.69
33
33
 
34
34
  License: Apache-2.0
35
35
 
@@ -49,7 +49,7 @@ See the License for the specific language governing permissions and
49
49
  limitations under the License.
50
50
  ```
51
51
 
52
- ## @ai-sdk/provider@4.0.10
52
+ ## @ai-sdk/provider@4.0.17
53
53
 
54
54
  License: Apache-2.0
55
55
 
@@ -69,7 +69,7 @@ See the License for the specific language governing permissions and
69
69
  limitations under the License.
70
70
  ```
71
71
 
72
- ## @ai-sdk/provider-utils@5.0.36
72
+ ## @ai-sdk/provider-utils@5.0.43
73
73
 
74
74
  License: Apache-2.0
75
75
 
@@ -131,7 +131,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
131
131
  SOFTWARE.
132
132
  ```
133
133
 
134
- ## @effect/platform-node@0.108.1
134
+ ## @effect/platform-node@0.108.2
135
135
 
136
136
  License: MIT
137
137
 
@@ -3616,7 +3616,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3616
3616
  SOFTWARE.
3617
3617
  ```
3618
3618
 
3619
- ## @upstash/redis@1.38.3
3619
+ ## @upstash/redis@1.38.4
3620
3620
 
3621
3621
  License: MIT
3622
3622
 
@@ -4377,7 +4377,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
4377
4377
  SOFTWARE.
4378
4378
  ```
4379
4379
 
4380
- ## jose@6.2.10
4380
+ ## jose@6.2.12
4381
4381
 
4382
4382
  License: MIT
4383
4383
 
package/dist/errors.d.ts CHANGED
@@ -39,6 +39,21 @@ declare const FlowCapabilityMissing_base: Schema.TaggedErrorClass<FlowCapability
39
39
  } & {
40
40
  capability: typeof Schema.String;
41
41
  message: typeof Schema.String;
42
+ /** A charge that happened before the failure — the generation succeeded and
43
+ * was billed, then storing its artifact did not. The engine records it on
44
+ * the failed step, so the run's cost is not reported as unknown when it is
45
+ * merely incomplete. */
46
+ receipt: Schema.optional<Schema.Struct<{
47
+ costMicroUsd: Schema.optional<Schema.filter<typeof Schema.Finite>>;
48
+ costSource: Schema.optional<Schema.Literal<["gateway", "estimated", "unpriced"]>>;
49
+ requestId: Schema.optional<typeof Schema.NonEmptyString>;
50
+ usage: Schema.optional<Schema.Struct<{
51
+ status: Schema.Literal<["reported", "unreported"]>;
52
+ unit: Schema.optional<Schema.Literal<["tokens", "characters", "seconds"]>>;
53
+ input: Schema.optional<Schema.filter<typeof Schema.Finite>>;
54
+ output: Schema.optional<Schema.filter<typeof Schema.Finite>>;
55
+ }>>;
56
+ }>>;
42
57
  }>;
43
58
 
44
59
  /** A step's input still contains an unresolved `{{ref}}` (its producing step
package/dist/errors.js CHANGED
@@ -1,38 +1,40 @@
1
- import { Schema as e } from "effect";
1
+ import { C as e } from "./ir-BW5JRUiH.js";
2
+ import { Schema as t } from "effect";
2
3
  //#region src/errors.ts
3
- var t = class extends e.TaggedError()("FlowNotFound", {
4
- flowRef: e.String,
5
- message: e.String
6
- }) {}, n = class extends e.TaggedError()("FlowRunNotFound", {
7
- runId: e.String,
8
- message: e.String
9
- }) {}, r = class extends e.TaggedError()("FlowValidationError", {
10
- flowRef: e.String,
11
- message: e.String,
12
- issues: e.optional(e.Array(e.String))
13
- }) {}, i = class extends e.TaggedError()("FlowDependencyError", {
14
- stepId: e.String,
15
- unresolvedRef: e.String,
16
- message: e.String
17
- }) {}, a = class extends e.TaggedError()("FlowBriefIncomplete", {
18
- missing: e.Array(e.String),
19
- message: e.String
20
- }) {}, o = class extends e.TaggedError()("FlowNotAwaitingResponse", {
21
- runId: e.String,
22
- status: e.String,
23
- message: e.String
24
- }) {}, s = class extends e.TaggedError()("FlowReviewDeliveryError", {
25
- runId: e.String,
26
- reason: e.Literal("runtime-unavailable", "invalid-run", "invalid-response", "delivery-unknown"),
27
- message: e.String
28
- }) {}, c = class extends e.TaggedError()("FlowCapabilityMissing", {
29
- capability: e.String,
30
- message: e.String
31
- }) {}, l = class extends e.TaggedError()("FlowAgentUnavailable", {
32
- agentRef: e.String,
33
- reason: e.Literal("not-found", "access-revoked", "model-unusable"),
34
- message: e.String,
35
- publicMessage: e.optional(e.String)
4
+ var n = class extends t.TaggedError()("FlowNotFound", {
5
+ flowRef: t.String,
6
+ message: t.String
7
+ }) {}, r = class extends t.TaggedError()("FlowRunNotFound", {
8
+ runId: t.String,
9
+ message: t.String
10
+ }) {}, i = class extends t.TaggedError()("FlowValidationError", {
11
+ flowRef: t.String,
12
+ message: t.String,
13
+ issues: t.optional(t.Array(t.String))
14
+ }) {}, a = class extends t.TaggedError()("FlowDependencyError", {
15
+ stepId: t.String,
16
+ unresolvedRef: t.String,
17
+ message: t.String
18
+ }) {}, o = class extends t.TaggedError()("FlowBriefIncomplete", {
19
+ missing: t.Array(t.String),
20
+ message: t.String
21
+ }) {}, s = class extends t.TaggedError()("FlowNotAwaitingResponse", {
22
+ runId: t.String,
23
+ status: t.String,
24
+ message: t.String
25
+ }) {}, c = class extends t.TaggedError()("FlowReviewDeliveryError", {
26
+ runId: t.String,
27
+ reason: t.Literal("runtime-unavailable", "invalid-run", "invalid-response", "delivery-unknown"),
28
+ message: t.String
29
+ }) {}, l = class extends t.TaggedError()("FlowCapabilityMissing", {
30
+ capability: t.String,
31
+ message: t.String,
32
+ receipt: t.optional(e)
33
+ }) {}, u = class extends t.TaggedError()("FlowAgentUnavailable", {
34
+ agentRef: t.String,
35
+ reason: t.Literal("not-found", "access-revoked", "model-unusable"),
36
+ message: t.String,
37
+ publicMessage: t.optional(t.String)
36
38
  }) {};
37
39
  //#endregion
38
- export { l as FlowAgentUnavailable, a as FlowBriefIncomplete, c as FlowCapabilityMissing, i as FlowDependencyError, o as FlowNotAwaitingResponse, t as FlowNotFound, s as FlowReviewDeliveryError, n as FlowRunNotFound, r as FlowValidationError };
40
+ export { u as FlowAgentUnavailable, o as FlowBriefIncomplete, l as FlowCapabilityMissing, a as FlowDependencyError, s as FlowNotAwaitingResponse, n as FlowNotFound, c as FlowReviewDeliveryError, r as FlowRunNotFound, i as FlowValidationError };
package/dist/index.d.ts CHANGED
@@ -293,24 +293,38 @@ export declare const buildFlowRunExecute: (ctx: AppContext, deps?: EngineDeps) =
293
293
  export declare const cadenceMatches: (cadence: FlowCadence, now: Date) => boolean;
294
294
 
295
295
  /**
296
- * Cancel a run on BOTH sides in one operation: the row (what the UI and the
297
- * cadence read) and the workflow execution (what actually runs, or waits at a
298
- * human step). Either half alone drifts — a row marked cancelled over a
299
- * suspended execution, or a cancelled execution under a row that still says
300
- * `waiting` — and a reader of one side never learns about the other.
296
+ * Request cancellation on both sides: the row prevents further cooperative
297
+ * steps, and the workflow facade interrupts a running or suspended execution.
298
+ * The row status alone is not an engine acknowledgement. Only a confirmed
299
+ * cancelled snapshot yields engine='cancelled'; accepted and unknown receipts
300
+ * retain their uncertainty, including a lost acknowledgement.
301
301
  *
302
- * The row is patched first, so a cooperative check between steps sees it even
303
- * if the engine's interrupt is slow; the execution's own interrupt handler
304
- * (`buildFlowRunExecute`) writes the same terminal fields again, harmlessly.
305
- * An execution that cannot be reached (no runtime, not started) leaves the row
306
- * cancelled and says so in `engine`.
302
+ * Already completed flows are not rewritten. The conditional row update also
303
+ * protects a completion committed after the initial read. Repeated requests
304
+ * retain the original terminal timestamps but can retry engine cancellation.
307
305
  */
308
306
  export declare const cancelFlow: (ctx: AppContext, args: {
309
307
  runId: string;
310
308
  }) => Effect.Effect<{
311
- runId: string;
312
- status: RunStatus;
313
- engine: "unreachable" | "cancelled";
309
+ readonly status: "failed" | "pending" | "cancelled" | "running" | "succeeded" | "waiting";
310
+ readonly runId: string;
311
+ readonly control: {
312
+ readonly snapshot: {
313
+ readonly status: "unknown" | "failed" | "cancelled" | "running" | "succeeded" | "suspended";
314
+ readonly id: string;
315
+ readonly error?: {
316
+ readonly message: string;
317
+ readonly tag: string | null;
318
+ } | undefined;
319
+ readonly output?: unknown;
320
+ readonly executionId: string;
321
+ readonly workflowName: string;
322
+ };
323
+ readonly kind: "unknown" | "accepted" | "confirmed" | "already-terminal";
324
+ readonly operation: "resume" | "cancel";
325
+ readonly requestId: string | null;
326
+ } | null;
327
+ readonly engine: "unknown" | "unreachable" | "cancelled" | "accepted" | "already-terminal" | "not-requested";
314
328
  }, FlowRunNotFound, never>;
315
329
 
316
330
  /** Staged follow-up when `chainTo.requireConfirmation` is set. */
@@ -535,6 +549,32 @@ export declare interface FlowCadence {
535
549
  readonly defaultInput?: Json | undefined;
536
550
  }
537
551
 
552
+ /** Row state and engine acknowledgement are separate observations. Retain the
553
+ * control request identity so an accepted/unknown request can be observed. */
554
+ export declare const FlowCancelReceipt: Schema.filter<Schema.Struct<{
555
+ runId: typeof Schema.NonEmptyString;
556
+ status: Schema.Literal<["pending", "running", "waiting", "succeeded", "failed", "cancelled"]>;
557
+ engine: Schema.Literal<["cancelled", "accepted", "unknown", "already-terminal", "unreachable", "not-requested"]>;
558
+ control: Schema.NullOr<Schema.filter<Schema.Struct<{
559
+ operation: Schema.Literal<["cancel", "resume"]>;
560
+ kind: Schema.Literal<["accepted", "confirmed", "unknown", "already-terminal"]>;
561
+ requestId: Schema.NullOr<typeof Schema.NonEmptyString>;
562
+ snapshot: Schema.Struct<{
563
+ id: typeof Schema.String;
564
+ workflowName: typeof Schema.String;
565
+ executionId: typeof Schema.String;
566
+ status: Schema.Union<[Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>, Schema.Literal<["unknown"]>]>;
567
+ output: Schema.optional<typeof Schema.Unknown>;
568
+ error: Schema.optional<Schema.Struct<{
569
+ tag: Schema.NullOr<typeof Schema.String>;
570
+ message: typeof Schema.String;
571
+ }>>;
572
+ }>;
573
+ }>>>;
574
+ }>>;
575
+
576
+ export declare type FlowCancelReceipt = typeof FlowCancelReceipt.Type;
577
+
538
578
  /** A generation step required a capability the host did not provide (e.g. a
539
579
  * media modality with no configured generator, or storage for the artifact). */
540
580
  declare class FlowCapabilityMissing extends FlowCapabilityMissing_base {
@@ -545,6 +585,21 @@ declare const FlowCapabilityMissing_base: Schema.TaggedErrorClass<FlowCapability
545
585
  } & {
546
586
  capability: typeof Schema.String;
547
587
  message: typeof Schema.String;
588
+ /** A charge that happened before the failure — the generation succeeded and
589
+ * was billed, then storing its artifact did not. The engine records it on
590
+ * the failed step, so the run's cost is not reported as unknown when it is
591
+ * merely incomplete. */
592
+ receipt: Schema.optional<Schema.Struct<{
593
+ costMicroUsd: Schema.optional<Schema.filter<typeof Schema.Finite>>;
594
+ costSource: Schema.optional<Schema.Literal<["gateway", "estimated", "unpriced"]>>;
595
+ requestId: Schema.optional<typeof Schema.NonEmptyString>;
596
+ usage: Schema.optional<Schema.Struct<{
597
+ status: Schema.Literal<["reported", "unreported"]>;
598
+ unit: Schema.optional<Schema.Literal<["tokens", "characters", "seconds"]>>;
599
+ input: Schema.optional<Schema.filter<typeof Schema.Finite>>;
600
+ output: Schema.optional<Schema.filter<typeof Schema.Finite>>;
601
+ }>>;
602
+ }>>;
548
603
  }>;
549
604
 
550
605
  /** Follow-up flow spec. On success, map source → the child's brief. */
@@ -1190,6 +1245,26 @@ export declare interface MediaPersist {
1190
1245
  readonly ingestUrl?: (url: string, run: FlowRunContext) => Effect.Effect<StoredMedia, unknown, unknown>;
1191
1246
  }
1192
1247
 
1248
+ /**
1249
+ * The evidence of a charge that happened BEFORE a step failed — a provider that
1250
+ * generated (and billed) while a later part of the step, typically storing the
1251
+ * artifact, did not succeed. A failed step that carries one is priced like a
1252
+ * succeeded one; the run's `costCompleteness` counts it.
1253
+ */
1254
+ export declare const MediaReceipt: Schema.Struct<{
1255
+ costMicroUsd: Schema.optional<Schema.filter<typeof Schema.Finite>>;
1256
+ costSource: Schema.optional<Schema.Literal<["gateway", "estimated", "unpriced"]>>;
1257
+ requestId: Schema.optional<typeof Schema.NonEmptyString>;
1258
+ usage: Schema.optional<Schema.Struct<{
1259
+ status: Schema.Literal<["reported", "unreported"]>;
1260
+ unit: Schema.optional<Schema.Literal<["tokens", "characters", "seconds"]>>;
1261
+ input: Schema.optional<Schema.filter<typeof Schema.Finite>>;
1262
+ output: Schema.optional<Schema.filter<typeof Schema.Finite>>;
1263
+ }>>;
1264
+ }>;
1265
+
1266
+ export declare type MediaReceipt = typeof MediaReceipt.Type;
1267
+
1193
1268
  export declare const MediaResult: Schema.Struct<{
1194
1269
  artifacts: Schema.filter<Schema.Array$<Schema.Struct<{
1195
1270
  url: typeof Schema.NonEmptyString;
@@ -1202,6 +1277,13 @@ export declare const MediaResult: Schema.Struct<{
1202
1277
  costSource: Schema.optional<Schema.Literal<["gateway", "estimated", "unpriced"]>>;
1203
1278
  /** A provider/usage correlation only, never a storage reference. */
1204
1279
  requestId: Schema.optional<typeof Schema.NonEmptyString>;
1280
+ /** What the generation consumed — the quantity behind `costMicroUsd`. */
1281
+ usage: Schema.optional<Schema.Struct<{
1282
+ status: Schema.Literal<["reported", "unreported"]>;
1283
+ unit: Schema.optional<Schema.Literal<["tokens", "characters", "seconds"]>>;
1284
+ input: Schema.optional<Schema.filter<typeof Schema.Finite>>;
1285
+ output: Schema.optional<Schema.filter<typeof Schema.Finite>>;
1286
+ }>>;
1205
1287
  }>;
1206
1288
 
1207
1289
  export declare type MediaResult = typeof MediaResult.Type;
@@ -1384,6 +1466,13 @@ export declare const RunStep: Schema.Struct<{
1384
1466
  costSource: Schema.optional<Schema.Literal<["gateway", "estimated", "unpriced"]>>;
1385
1467
  /** Links a media step to its generation/usage record. */
1386
1468
  requestId: Schema.optional<typeof Schema.String>;
1469
+ /** What the step consumed — also on a FAILED step that was charged. */
1470
+ usage: Schema.optional<Schema.Struct<{
1471
+ status: Schema.Literal<["reported", "unreported"]>;
1472
+ unit: Schema.optional<Schema.Literal<["tokens", "characters", "seconds"]>>;
1473
+ input: Schema.optional<Schema.filter<typeof Schema.Finite>>;
1474
+ output: Schema.optional<Schema.filter<typeof Schema.Finite>>;
1475
+ }>>;
1387
1476
  /** Hosted media artifact URL (image/video/audio), via storage. */
1388
1477
  url: Schema.optional<typeof Schema.String>;
1389
1478
  /** All media variants, including roles and storage references; url projects the primary artifact. */
@@ -1426,6 +1515,8 @@ export declare interface RunStep {
1426
1515
  readonly costMicroUsd?: number | undefined;
1427
1516
  readonly costSource?: CostSource | undefined;
1428
1517
  readonly requestId?: string | undefined;
1518
+ /** What the step consumed — also on a FAILED step that was charged. */
1519
+ readonly usage?: StepUsage | undefined;
1429
1520
  readonly url?: string | undefined;
1430
1521
  readonly artifacts?: ReadonlyArray<MediaArtifact> | undefined;
1431
1522
  readonly output?: {
@@ -1479,6 +1570,25 @@ export declare const StepType: Schema.Literal<["agent", "generate", "structured"
1479
1570
 
1480
1571
  export declare type StepType = typeof StepType.Type;
1481
1572
 
1573
+ /**
1574
+ * What a step CONSUMED, in the provider's own unit — the quantity a cost was, or
1575
+ * could have been, priced from. `reported`: the provider said so. `unreported`:
1576
+ * the call returned no tally, so there is nothing to price and nothing to
1577
+ * dispute, and saying that is different from saying zero.
1578
+ *
1579
+ * Without it a step priced `unpriced` read the same whether the provider had
1580
+ * reported 7/150 tokens or nothing at all — and only the first can be priced
1581
+ * later, or reconciled against an invoice.
1582
+ */
1583
+ export declare const StepUsage: Schema.Struct<{
1584
+ status: Schema.Literal<["reported", "unreported"]>;
1585
+ unit: Schema.optional<Schema.Literal<["tokens", "characters", "seconds"]>>;
1586
+ input: Schema.optional<Schema.filter<typeof Schema.Finite>>;
1587
+ output: Schema.optional<Schema.filter<typeof Schema.Finite>>;
1588
+ }>;
1589
+
1590
+ export declare type StepUsage = typeof StepUsage.Type;
1591
+
1482
1592
  /** A persisted artifact — a hosted URL + optional storage ref id. */
1483
1593
  export declare interface StoredMedia {
1484
1594
  readonly url: string;