@voltro/plugin-ai-flows 0.90.0 → 0.91.1

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.
@@ -1,5 +1,5 @@
1
- import { nativeMediaInputs as e } from "./mediaInputs.js";
2
- import { FlowCapabilityMissing as t } from "./errors.js";
1
+ import { FlowCapabilityMissing as e } from "./errors.js";
2
+ import { nativeMediaInputs as t } from "./mediaInputs.js";
3
3
  import { audioParams as n, imageParams as r, videoParams as i } from "./mediaParams.js";
4
4
  import { Effect as a } from "effect";
5
5
  import { estimateCostUsd as o, gatewayCostUsd as s, generateImage as c, generateSpeech as l, generateVideo as u, isMeteredUsage as d } from "@voltro/ai";
@@ -47,16 +47,16 @@ var f = (e) => ({
47
47
  }), _ = (o, s) => (d) => {
48
48
  let p = d.model, _ = (e) => s?.resolveModel?.(e) ?? f(e);
49
49
  return a.gen(function* () {
50
- let s = yield* e(d.modality, d.inputs).pipe(a.mapError((e) => new t({
50
+ let s = yield* t(d.modality, d.inputs).pipe(a.mapError((t) => new e({
51
51
  capability: `media:${d.modality}`,
52
- message: e
52
+ message: t
53
53
  })));
54
54
  if (d.modality === "image") {
55
- let e = yield* r(d.params).pipe(a.mapError((e) => new t({
55
+ let t = yield* r(d.params).pipe(a.mapError((t) => new e({
56
56
  capability: "media:image",
57
- message: e
57
+ message: t
58
58
  }))), n = s.referenceImageUrl, i = s.maskImageUrl, l = yield* c({
59
- ...e,
59
+ ...t,
60
60
  prompt: d.prompt,
61
61
  ...n === void 0 ? {} : { inputs: {
62
62
  images: [n],
@@ -64,17 +64,17 @@ var f = (e) => ({
64
64
  } },
65
65
  ...p ? { provider: _(p) } : {}
66
66
  });
67
- if (l.images.length === 0) return yield* a.fail(new t({
67
+ if (l.images.length === 0) return yield* a.fail(new e({
68
68
  capability: "media:image",
69
69
  message: "no image produced"
70
70
  }));
71
71
  let u = [];
72
- for (let [e, n] of l.images.entries()) {
72
+ for (let [t, n] of l.images.entries()) {
73
73
  let r = yield* o.put({
74
74
  data: n.data,
75
75
  mediaType: n.mediaType,
76
76
  run: d.run
77
- }).pipe(a.mapError(() => new t({
77
+ }).pipe(a.mapError(() => new e({
78
78
  capability: "media:image",
79
79
  message: "media persistence failed",
80
80
  receipt: g(l.usage, l.providerMetadata, p)
@@ -82,7 +82,7 @@ var f = (e) => ({
82
82
  u.push({
83
83
  url: r.url,
84
84
  mediaType: n.mediaType,
85
- role: e === 0 ? "primary" : "variant",
85
+ role: t === 0 ? "primary" : "variant",
86
86
  ...r.refId === void 0 ? {} : { storageRefId: r.refId },
87
87
  ...n.providerMetadata === void 0 ? {} : { providerMetadata: n.providerMetadata }
88
88
  });
@@ -94,18 +94,18 @@ var f = (e) => ({
94
94
  };
95
95
  }
96
96
  if (d.modality === "audio") {
97
- let e = yield* n(d.params).pipe(a.mapError((e) => new t({
97
+ let t = yield* n(d.params).pipe(a.mapError((t) => new e({
98
98
  capability: "media:audio",
99
- message: e
99
+ message: t
100
100
  }))), r = yield* l({
101
- ...e,
101
+ ...t,
102
102
  text: d.prompt,
103
103
  ...p ? { provider: _(p) } : {}
104
104
  }), i = yield* o.put({
105
105
  data: r.audio.data,
106
106
  mediaType: r.audio.mediaType,
107
107
  run: d.run
108
- }).pipe(a.mapError(() => new t({
108
+ }).pipe(a.mapError(() => new e({
109
109
  capability: "media:audio",
110
110
  message: "media persistence failed",
111
111
  receipt: g(r.usage, r.providerMetadata, p)
@@ -121,9 +121,9 @@ var f = (e) => ({
121
121
  usage: h(r.usage)
122
122
  };
123
123
  }
124
- let { maxInlineBytes: f, providerOptions: v, ...y } = yield* i(d.params).pipe(a.mapError((e) => new t({
124
+ let { maxInlineBytes: f, providerOptions: v, ...y } = yield* i(d.params).pipe(a.mapError((t) => new e({
125
125
  capability: "media:video",
126
- message: e
126
+ message: t
127
127
  }))), b = yield* u({
128
128
  prompt: d.prompt,
129
129
  inputs: {
@@ -142,7 +142,7 @@ var f = (e) => ({
142
142
  ...v === void 0 ? {} : { providerOptions: v },
143
143
  ...f === void 0 ? {} : { maxInlineBytes: f }
144
144
  }), x;
145
- if (b.video.url) x = o.ingestUrl ? yield* o.ingestUrl(b.video.url, d.run).pipe(a.mapError(() => new t({
145
+ if (b.video.url) x = o.ingestUrl ? yield* o.ingestUrl(b.video.url, d.run).pipe(a.mapError(() => new e({
146
146
  capability: "media:video",
147
147
  message: "media persistence failed",
148
148
  receipt: g(b.usage, b.providerMetadata, p)
@@ -151,12 +151,12 @@ var f = (e) => ({
151
151
  data: b.video.data,
152
152
  mediaType: b.video.mediaType,
153
153
  run: d.run
154
- }).pipe(a.mapError(() => new t({
154
+ }).pipe(a.mapError(() => new e({
155
155
  capability: "media:video",
156
156
  message: "media persistence failed",
157
157
  receipt: g(b.usage, b.providerMetadata, p)
158
158
  })));
159
- else return yield* a.fail(new t({
159
+ else return yield* a.fail(new e({
160
160
  capability: "media:video",
161
161
  message: "no video produced"
162
162
  }));
@@ -170,9 +170,9 @@ var f = (e) => ({
170
170
  ...m(b.usage, b.providerMetadata, p),
171
171
  usage: h(b.usage)
172
172
  };
173
- }).pipe(a.catch((e) => e instanceof t ? a.fail(e) : a.fail(new t({
173
+ }).pipe(a.catch((t) => t instanceof e ? a.fail(t) : a.fail(new e({
174
174
  capability: `media:${d.modality}`,
175
- message: String(e.message ?? e)
175
+ message: String(t.message ?? t)
176
176
  }))));
177
177
  };
178
178
  export { _ as makeMediaGenerator };
@@ -1,9 +1,9 @@
1
1
  import { aiFlowRunsTable as e, aiFlowsTable as t } from "./table.js";
2
- import { FLOW_RUN_WORKFLOW as n, flowRunWorkflow as r, humanResponseSignalName as i } from "./workflow.js";
3
- import { FlowCancelReceipt as a, FlowReviewInput as o, FlowReviewReceipt as s, FlowStartReceipt as c } from "./ir.js";
4
- import { FlowBriefIncomplete as l, FlowNotAwaitingResponse as u, FlowReviewDeliveryError as d, FlowRunNotFound as f } from "./errors.js";
5
- import { resolveIr as p } from "./engine.js";
6
- import { recordFlowStartReceipt as m } from "./startReceipt.js";
2
+ import { resolveIr as n } from "./engine.js";
3
+ import { recordFlowStartReceipt as r } from "./startReceipt.js";
4
+ import { FLOW_RUN_WORKFLOW as i, flowRunWorkflow as a, humanResponseSignalName as o } from "./workflow.js";
5
+ import { FlowBriefIncomplete as s, FlowNotAwaitingResponse as c, FlowReviewDeliveryError as l, FlowRunNotFound as u } from "./errors.js";
6
+ import { FlowCancelReceipt as d, FlowReviewInput as f, FlowReviewReceipt as p, FlowStartReceipt as m } from "./ir.js";
7
7
  import { Effect as h, Result as g, Schema as _ } from "effect";
8
8
  import { WorkflowControlResultSchema as v } from "@voltro/protocol";
9
9
  import { and as y, eq as b, inSet as x, queryFor as S } from "@voltro/database";
@@ -12,133 +12,133 @@ var C = () => globalThis.crypto?.randomUUID?.() ?? `req-${Date.now().toString(36
12
12
  let t = e.workflows;
13
13
  if (!t) throw Error("workflow runtime unavailable; no flow start was submitted");
14
14
  return t;
15
- }), D = (t, r) => h.gen(function* () {
15
+ }), D = (t, a) => h.gen(function* () {
16
16
  yield* E(t);
17
- let i = yield* p(t, r.flowRef), a = r.input ?? {}, o = i.brief.filter((e) => e.required && e.type !== "boolean" && (a[e.key] === void 0 || a[e.key] === null || a[e.key] === "")).map((e) => e.key);
18
- if (o.length > 0) return yield* h.fail(new l({
19
- missing: o,
20
- message: `missing required brief field(s): ${o.join(", ")}`
17
+ let o = yield* n(t, a.flowRef), c = a.input ?? {}, l = o.brief.filter((e) => e.required && e.type !== "boolean" && (c[e.key] === void 0 || c[e.key] === null || c[e.key] === "")).map((e) => e.key);
18
+ if (l.length > 0) return yield* h.fail(new s({
19
+ missing: l,
20
+ message: `missing required brief field(s): ${l.join(", ")}`
21
21
  }));
22
- let s = C(), u = `run-${s}`, d = r.source ?? "manual";
22
+ let u = C(), d = `run-${u}`, f = a.source ?? "manual";
23
23
  return yield* h.promise(() => t.transaction(async (t) => {
24
- let o = t.workflows;
25
- if (!o) throw Error("workflow runtime unavailable in transaction; no flow start was submitted");
24
+ let n = t.workflows;
25
+ if (!n) throw Error("workflow runtime unavailable in transaction; no flow start was submitted");
26
26
  await t.store.insert(e.tableName, {
27
- id: u,
28
- flowRef: r.flowRef,
29
- flowName: i.name,
30
- mode: i.mode,
27
+ id: d,
28
+ flowRef: a.flowRef,
29
+ flowName: o.name,
30
+ mode: o.mode,
31
31
  status: "pending",
32
- source: d,
33
- requestId: s,
34
- input: a,
32
+ source: f,
33
+ requestId: u,
34
+ input: c,
35
35
  ownerId: w(t)
36
36
  });
37
- let l = await m(t, u, await o.start(n, {
38
- runId: u,
39
- flowRef: r.flowRef,
40
- input: a,
41
- source: d,
42
- requestId: s
37
+ let s = await r(t, d, await n.start(i, {
38
+ runId: d,
39
+ flowRef: a.flowRef,
40
+ input: c,
41
+ source: f,
42
+ requestId: u
43
43
  }));
44
- return c.make({
45
- runId: u,
46
- requestId: s,
47
- admission: l
44
+ return m.make({
45
+ runId: d,
46
+ requestId: u,
47
+ admission: s
48
48
  });
49
49
  }));
50
- }), O = (t, i) => h.gen(function* () {
50
+ }), O = (t, n) => h.gen(function* () {
51
51
  return yield* E(t), yield* h.tryPromise({
52
52
  try: () => t.transaction(async (t) => {
53
- let a = t.workflows;
54
- if (!a) throw Error("workflow runtime unavailable in transaction; no flow start was submitted");
55
- let o = (await t.store.query(S(e).where(b("id", i.runId)).descriptor))[0];
56
- if (!o) throw new f({
57
- runId: i.runId,
53
+ let o = t.workflows;
54
+ if (!o) throw Error("workflow runtime unavailable in transaction; no flow start was submitted");
55
+ let s = (await t.store.query(S(e).where(b("id", n.runId)).descriptor))[0];
56
+ if (!s) throw new u({
57
+ runId: n.runId,
58
58
  message: "run not found"
59
59
  });
60
- let s = o.requestId;
61
- if (typeof s != "string" || s.length === 0) throw Error("stored flow run has no valid requestId; retry refused without changing the run");
62
- let l = _.decodeUnknownResult(r.payloadSchema.pipe(_.check(_.makeFilter((e) => e.runId === i.runId && e.flowRef.length > 0))))({
63
- ...o,
64
- runId: o.id
60
+ let c = s.requestId;
61
+ if (typeof c != "string" || c.length === 0) throw Error("stored flow run has no valid requestId; retry refused without changing the run");
62
+ let l = _.decodeUnknownResult(a.payloadSchema.pipe(_.check(_.makeFilter((e) => e.runId === n.runId && e.flowRef.length > 0))))({
63
+ ...s,
64
+ runId: s.id
65
65
  });
66
66
  if (g.isFailure(l)) throw Error("stored workflow payload is incomplete or invalid; retry refused without changing the run");
67
- let u = await m(t, i.runId, await a.start(n, l.success));
68
- return c.make({
69
- runId: i.runId,
70
- requestId: s,
71
- admission: u
67
+ let d = await r(t, n.runId, await o.start(i, l.success));
68
+ return m.make({
69
+ runId: n.runId,
70
+ requestId: c,
71
+ admission: d
72
72
  });
73
73
  }),
74
74
  catch: (e) => e
75
- }).pipe(h.catch((e) => e instanceof f ? h.fail(e) : h.die(e)));
76
- }), k = (t, i) => h.gen(function* () {
77
- let o = yield* T(t, i.runId);
78
- if (!o) return yield* h.fail(new f({
79
- runId: i.runId,
75
+ }).pipe(h.catch((e) => e instanceof u ? h.fail(e) : h.die(e)));
76
+ }), k = (t, n) => h.gen(function* () {
77
+ let r = yield* T(t, n.runId);
78
+ if (!r) return yield* h.fail(new u({
79
+ runId: n.runId,
80
80
  message: "run not found"
81
81
  }));
82
- if (A(o.status)) return a.make({
83
- runId: i.runId,
84
- status: o.status,
82
+ if (A(r.status)) return d.make({
83
+ runId: n.runId,
84
+ status: r.status,
85
85
  engine: "not-requested",
86
86
  control: null
87
87
  });
88
- let s = (/* @__PURE__ */ new Date()).toISOString();
88
+ let o = (/* @__PURE__ */ new Date()).toISOString();
89
89
  yield* h.promise(() => t.store.updateMany(e.tableName, {
90
90
  status: "cancelling",
91
- cancelledAt: s
92
- }, { where: y(b("id", i.runId), x("status", [
91
+ cancelledAt: o
92
+ }, { where: y(b("id", n.runId), x("status", [
93
93
  "pending",
94
94
  "running",
95
95
  "waiting"
96
96
  ])) }));
97
- let c = yield* T(t, i.runId);
98
- if (!c) return yield* h.fail(new f({
99
- runId: i.runId,
97
+ let s = yield* T(t, n.runId);
98
+ if (!s) return yield* h.fail(new u({
99
+ runId: n.runId,
100
100
  message: "run not found"
101
101
  }));
102
- if (A(c.status)) return a.make({
103
- runId: i.runId,
104
- status: c.status,
102
+ if (A(s.status)) return d.make({
103
+ runId: n.runId,
104
+ status: s.status,
105
105
  engine: "not-requested",
106
106
  control: null
107
107
  });
108
- let l = t.workflows, u = _.decodeUnknownOption(_.Struct({
109
- runId: _.Literal(i.runId),
108
+ let c = t.workflows, l = _.decodeUnknownOption(_.Struct({
109
+ runId: _.Literal(n.runId),
110
110
  flowRef: _.NonEmptyString,
111
111
  requestId: _.NonEmptyString,
112
112
  input: _.Record(_.String, _.Unknown),
113
113
  source: _.Literals(["manual", "cron"])
114
114
  }))({
115
- ...o,
116
- runId: o.id
117
- }), d = l === void 0 || u._tag === "None" ? null : yield* h.flatMap(r.executionId(u.value), (e) => h.tryPromise(async () => {
118
- let t = _.decodeUnknownSync(v)(await l.cancel(n, e));
115
+ ...r,
116
+ runId: r.id
117
+ }), f = c === void 0 || l._tag === "None" ? null : yield* h.flatMap(a.executionId(l.value), (e) => h.tryPromise(async () => {
118
+ let t = _.decodeUnknownSync(v)(await c.cancel(i, e));
119
119
  if (t.operation !== "cancel" || t.snapshot.workflowName !== "flow.run" || t.snapshot.executionId !== e) throw Error("workflow cancellation receipt does not match the flow execution");
120
120
  return t;
121
- })).pipe(h.catch(() => h.succeed(null))), p = d === null ? l === void 0 || u._tag === "None" ? "unreachable" : "unknown" : d.snapshot.status === "cancelled" && (d.kind === "confirmed" || d.kind === "already-terminal") ? "cancelled" : d.kind === "accepted" ? "accepted" : d.kind === "already-terminal" ? "already-terminal" : "unknown", m = y(b("id", i.runId), b("status", "cancelling"), b("cancelledAt", c.cancelledAt));
121
+ })).pipe(h.catch(() => h.succeed(null))), p = f === null ? c === void 0 || l._tag === "None" ? "unreachable" : "unknown" : f.snapshot.status === "cancelled" && (f.kind === "confirmed" || f.kind === "already-terminal") ? "cancelled" : f.kind === "accepted" ? "accepted" : f.kind === "already-terminal" ? "already-terminal" : "unknown", m = y(b("id", n.runId), b("status", "cancelling"), b("cancelledAt", s.cancelledAt));
122
122
  if (p === "cancelled") yield* h.promise(() => t.store.updateMany(e.tableName, {
123
123
  status: "cancelled",
124
- completedAt: c.completedAt ?? (/* @__PURE__ */ new Date()).toISOString()
124
+ completedAt: s.completedAt ?? (/* @__PURE__ */ new Date()).toISOString()
125
125
  }, { where: m }));
126
- else if (d?.kind === "already-terminal") {
127
- let n = _.decodeUnknownOption(r.successSchema)(d.snapshot.output), a = d.snapshot.status === "failed" ? "failed" : n._tag === "Some" && n.value.runId === i.runId && n.value.status !== "waiting" ? n.value.status : void 0;
128
- a !== void 0 && (yield* h.promise(() => t.store.updateMany(e.tableName, {
129
- status: a,
130
- completedAt: c.completedAt ?? (/* @__PURE__ */ new Date()).toISOString(),
131
- ...a === "cancelled" ? {} : { cancelledAt: null }
126
+ else if (f?.kind === "already-terminal") {
127
+ let r = _.decodeUnknownOption(a.successSchema)(f.snapshot.output), i = f.snapshot.status === "failed" ? "failed" : r._tag === "Some" && r.value.runId === n.runId && r.value.status !== "waiting" ? r.value.status : void 0;
128
+ i !== void 0 && (yield* h.promise(() => t.store.updateMany(e.tableName, {
129
+ status: i,
130
+ completedAt: s.completedAt ?? (/* @__PURE__ */ new Date()).toISOString(),
131
+ ...i === "cancelled" ? {} : { cancelledAt: null }
132
132
  }, { where: m })));
133
133
  }
134
- let g = yield* T(t, i.runId);
135
- return g ? yield* _.decodeUnknownEffect(a)({
136
- runId: i.runId,
134
+ let g = yield* T(t, n.runId);
135
+ return g ? yield* _.decodeUnknownEffect(d)({
136
+ runId: n.runId,
137
137
  status: g.status,
138
138
  engine: p,
139
- control: d
140
- }).pipe(h.orDie) : yield* h.fail(new f({
141
- runId: i.runId,
139
+ control: f
140
+ }).pipe(h.orDie) : yield* h.fail(new u({
141
+ runId: n.runId,
142
142
  message: "run not found"
143
143
  }));
144
144
  }), A = (e) => e === "succeeded" || e === "failed" || e === "cancelled", j = (e) => {
@@ -146,30 +146,30 @@ var C = () => globalThis.crypto?.randomUUID?.() ?? `req-${Date.now().toString(36
146
146
  if (t?.length !== 1 || n?.type !== "human" || !Number.isSafeInteger(n.id) || n.id < 0) throw Error("expected exactly one waiting human step with a nonnegative integer index");
147
147
  return n.id;
148
148
  }, M = (e, t) => h.gen(function* () {
149
- let a = (e, n) => new d({
149
+ let n = (e, n) => new l({
150
150
  runId: t.runId,
151
151
  reason: e,
152
152
  message: n
153
- }), c = yield* _.decodeUnknownEffect(o, { onExcessProperty: "error" })(t).pipe(h.mapError(() => a("invalid-response", "review response requires runId, displayed stepIndex and a valid response")));
154
- if (c.response.decision === void 0 && c.response.text === void 0 && c.response.value === void 0) return yield* h.fail(a("invalid-response", "review response must contain a decision, text or value"));
155
- let l = e.workflows;
156
- if (!l) return yield* h.fail(a("runtime-unavailable", "workflow runtime unavailable; review was not sent"));
157
- let p = yield* T(e, t.runId);
158
- if (!p) return yield* h.fail(new f({
153
+ }), r = yield* _.decodeUnknownEffect(f, { onExcessProperty: "error" })(t).pipe(h.mapError(() => n("invalid-response", "review response requires runId, displayed stepIndex and a valid response")));
154
+ if (r.response.decision === void 0 && r.response.text === void 0 && r.response.value === void 0) return yield* h.fail(n("invalid-response", "review response must contain a decision, text or value"));
155
+ let s = e.workflows;
156
+ if (!s) return yield* h.fail(n("runtime-unavailable", "workflow runtime unavailable; review was not sent"));
157
+ let d = yield* T(e, t.runId);
158
+ if (!d) return yield* h.fail(new u({
159
159
  runId: t.runId,
160
160
  message: "run not found"
161
161
  }));
162
- let m = p.status;
163
- if (m !== "waiting") return yield* h.fail(new u({
162
+ let m = d.status;
163
+ if (m !== "waiting") return yield* h.fail(new c({
164
164
  runId: t.runId,
165
165
  status: m ?? "unknown",
166
166
  message: `run is "${m}", not awaiting a response`
167
167
  }));
168
168
  let g = yield* h.try({
169
- try: () => j(p),
170
- catch: () => a("invalid-run", "stored run has no unambiguous waiting review")
169
+ try: () => j(d),
170
+ catch: () => n("invalid-run", "stored run has no unambiguous waiting review")
171
171
  });
172
- if (g !== c.stepIndex) return yield* h.fail(new u({
172
+ if (g !== r.stepIndex) return yield* h.fail(new c({
173
173
  runId: t.runId,
174
174
  status: m,
175
175
  message: "this review is no longer waiting; reload the run before answering"
@@ -181,27 +181,27 @@ var C = () => globalThis.crypto?.randomUUID?.() ?? `req-${Date.now().toString(36
181
181
  input: _.Record(_.String, _.Unknown),
182
182
  source: _.Literals(["manual", "cron"])
183
183
  }))({
184
- ...p,
185
- runId: p.id
186
- }).pipe(h.mapError(() => a("invalid-run", "stored workflow payload is incomplete; review was not sent"))), y = yield* r.executionId(v), b = {
187
- ...c.response,
184
+ ...d,
185
+ runId: d.id
186
+ }).pipe(h.mapError(() => n("invalid-run", "stored workflow payload is incomplete; review was not sent"))), y = yield* a.executionId(v), b = {
187
+ ...r.response,
188
188
  respondedAt: (/* @__PURE__ */ new Date()).toISOString()
189
189
  }, x = yield* h.tryPromise({
190
- try: () => l.signal({
191
- workflowName: n,
190
+ try: () => s.signal({
191
+ workflowName: i,
192
192
  executionId: y
193
- }, i(g), b),
194
- catch: () => a("delivery-unknown", "review delivery was not confirmed; observe the run before retrying")
195
- }), S = yield* _.decodeUnknownEffect(_.Struct({ eventId: _.NonEmptyString }))(x).pipe(h.mapError(() => a("delivery-unknown", "workflow runtime returned no valid review delivery receipt")));
196
- return yield* _.decodeUnknownEffect(s)({
193
+ }, o(g), b),
194
+ catch: () => n("delivery-unknown", "review delivery was not confirmed; observe the run before retrying")
195
+ }), S = yield* _.decodeUnknownEffect(_.Struct({ eventId: _.NonEmptyString }))(x).pipe(h.mapError(() => n("delivery-unknown", "workflow runtime returned no valid review delivery receipt")));
196
+ return yield* _.decodeUnknownEffect(p)({
197
197
  runId: t.runId,
198
198
  stepIndex: g,
199
199
  executionId: y,
200
200
  eventId: S.eventId,
201
201
  status: "accepted"
202
- }).pipe(h.mapError(() => a("delivery-unknown", "workflow runtime returned no valid review delivery receipt")));
202
+ }).pipe(h.mapError(() => n("delivery-unknown", "workflow runtime returned no valid review delivery receipt")));
203
203
  }), N = (e, n) => h.promise(() => e.store.query(S(t).where(b("id", n.id)).descriptor)).pipe(h.map((e) => e[0])), P = (e) => h.promise(() => e.store.query(S(t).descriptor)), F = (e, n) => h.promise(() => e.store.insert(t.tableName, {
204
204
  id: n.id ?? `flow-${C()}`,
205
205
  ...n
206
206
  })), I = (e, n) => h.promise(() => e.store.update(t.tableName, n.id, n.patch)), L = (e, n) => h.promise(() => e.store.delete(t.tableName, n.id));
207
- export { k as cancelFlow, F as createFlow, L as deleteFlow, N as getFlow, i as humanResponseSignalName, D as launchFlow, P as listFlows, M as respondToFlow, O as retryFlow, I as updateFlow, j as waitingStepIndex };
207
+ export { k as cancelFlow, F as createFlow, L as deleteFlow, N as getFlow, o as humanResponseSignalName, D as launchFlow, P as listFlows, M as respondToFlow, O as retryFlow, I as updateFlow, j as waitingStepIndex };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voltro/plugin-ai-flows",
3
- "version": "0.90.0",
3
+ "version": "0.91.1",
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,19 +58,19 @@
58
58
  "node": ">=24.0.0"
59
59
  },
60
60
  "dependencies": {
61
- "@voltro/ai": "0.90.0",
62
- "@voltro/client": "0.90.0",
63
- "@voltro/database": "0.90.0",
64
- "@voltro/env": "0.90.0",
65
- "@voltro/plugin-audit": "0.90.0",
66
- "@voltro/plugin-multitenancy": "0.90.0",
67
- "@voltro/plugin-soft-delete": "0.90.0",
68
- "@voltro/protocol": "0.90.0",
69
- "@voltro/runtime": "0.90.0",
70
- "@voltro/workflow": "0.90.0"
61
+ "@voltro/ai": "0.91.1",
62
+ "@voltro/client": "0.91.1",
63
+ "@voltro/database": "0.91.1",
64
+ "@voltro/env": "0.91.1",
65
+ "@voltro/plugin-audit": "0.91.1",
66
+ "@voltro/plugin-multitenancy": "0.91.1",
67
+ "@voltro/plugin-soft-delete": "0.91.1",
68
+ "@voltro/protocol": "0.91.1",
69
+ "@voltro/runtime": "0.91.1",
70
+ "@voltro/workflow": "0.91.1"
71
71
  },
72
72
  "peerDependencies": {
73
- "effect": "4.1.2"
73
+ "effect": "4.1.4"
74
74
  },
75
75
  "publishConfig": {
76
76
  "access": "public"