@voltro/protocol 0.51.0 → 0.53.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/dist/index.js CHANGED
@@ -1,165 +1,263 @@
1
- import { A as e, B as t, C as n, D as r, E as i, F as a, G as o, H as ee, I as te, L as ne, M as re, N as s, O as ie, P as ae, R as oe, S as se, T as ce, U as le, V as ue, W as de, _ as fe, a as c, b as pe, c as me, d as he, f as ge, g as _e, h as l, i as ve, j as ye, k as be, l as xe, m as Se, n as Ce, o as we, p as Te, r as Ee, s as De, t as Oe, u as ke, v as u, w as Ae, x as je, y as Me, z as Ne } from "./scopes-B0kGvAnI.js";
2
- import { a as Pe, c as Fe, i as Ie, n as Le, o as Re, r as ze, s as Be, t as Ve } from "./serverErrorBus-BeN9pOpY.js";
3
- import { Context as He, Layer as Ue, Schema as d } from "effect";
4
- import { Rpc as f } from "@effect/rpc";
1
+ import { A as e, B as t, C as n, D as r, E as i, F as a, G as o, H as s, I as c, L as ee, M as te, N as l, O as ne, P as re, R as ie, S as ae, T as oe, U as se, V as ce, W as le, _ as ue, a as u, b as de, c as fe, d as pe, f as me, g as he, h as d, i as ge, j as _e, k as ve, l as ye, m as be, n as xe, o as Se, p as Ce, r as we, s as Te, t as Ee, u as De, v as f, w as Oe, x as ke, y as Ae, z as je } from "./scopes-B0kGvAnI.js";
2
+ import { a as Me, c as Ne, i as Pe, n as Fe, o as Ie, r as Le, s as Re, t as ze } from "./serverErrorBus-BeN9pOpY.js";
3
+ import { Context as Be, Layer as Ve, Schema as p } from "effect";
4
+ import { Rpc as m } from "@effect/rpc";
5
5
  //#region src/rowPatch.ts
6
- var We = d.Union(d.String, d.Number), p = d.Record({
7
- key: d.String,
8
- value: d.Unknown
9
- }).pipe(d.filter((e) => "id" in e, { message: () => "patch row must carry an id" })), m = d.Union(d.Struct({
10
- op: d.Literal("add"),
11
- path: d.String,
12
- value: p
13
- }), d.Struct({
14
- op: d.Literal("replace"),
15
- path: d.String,
16
- value: p
17
- }), d.Struct({
18
- op: d.Literal("remove"),
19
- path: d.String
20
- })), h = d.Struct({
21
- ops: d.Array(m),
22
- order: d.Array(We)
23
- }), g = (e) => `/${String(e).replace(/~/g, "~0").replace(/\//g, "~1")}`, Ge = (e) => (e.startsWith("/") ? e.slice(1) : e).replace(/~1/g, "/").replace(/~0/g, "~"), _ = (e) => {
6
+ var He = p.Union(p.String, p.Number), Ue = p.Record({
7
+ key: p.String,
8
+ value: p.Unknown
9
+ }).pipe(p.filter((e) => "id" in e, { message: () => "patch row must carry an id" })), We = p.Union(p.Struct({
10
+ op: p.Literal("add"),
11
+ path: p.String,
12
+ value: Ue
13
+ }), p.Struct({
14
+ op: p.Literal("replace"),
15
+ path: p.String,
16
+ value: Ue
17
+ }), p.Struct({
18
+ op: p.Literal("remove"),
19
+ path: p.String
20
+ }), p.Struct({
21
+ op: p.Literal("mergeCells"),
22
+ path: p.String,
23
+ value: p.Record({
24
+ key: p.String,
25
+ value: p.Unknown
26
+ })
27
+ })), Ge = p.Struct({
28
+ ops: p.Array(We),
29
+ order: p.Array(He)
30
+ }), h = (e) => `/${String(e).replace(/~/g, "~0").replace(/\//g, "~1")}`, Ke = (e) => (e.startsWith("/") ? e.slice(1) : e).replace(/~1/g, "/").replace(/~0/g, "~"), g = (e) => {
24
31
  let t = Object.keys(e).sort(), n = {};
25
32
  for (let r of t) n[r] = e[r];
26
33
  return JSON.stringify(n);
27
- }, Ke = (e, t) => _(e) === _(t), qe = (e, t) => {
28
- let n = /* @__PURE__ */ new Map();
29
- for (let t of e) n.set(t.id, t);
30
- let r = [], i = [], a = /* @__PURE__ */ new Set();
34
+ }, qe = (e, t) => g(e) === g(t), Je = (e, t) => {
35
+ if (e instanceof Uint8Array && t instanceof Uint8Array) {
36
+ if (e.length !== t.length) return !1;
37
+ for (let n = 0; n < e.length; n += 1) if (e[n] !== t[n]) return !1;
38
+ return !0;
39
+ }
40
+ return g({
41
+ id: 0,
42
+ v: e
43
+ }) === g({
44
+ id: 0,
45
+ v: t
46
+ });
47
+ }, Ye = (e, t, n = {}) => {
48
+ let r = /* @__PURE__ */ new Map();
49
+ for (let t of e) r.set(t.id, t);
50
+ let i = [], a = [], o = /* @__PURE__ */ new Set(), s = n.crdt, c = (e, t) => {
51
+ if (s === void 0 || s.columns.size === 0) return;
52
+ let n = {}, r = !1;
53
+ for (let i of s.columns) {
54
+ if (!(i in t) || Je(e[i], t[i])) continue;
55
+ let a = s.incremental(i, e[i], t[i]);
56
+ if (a === void 0) return;
57
+ n[i] = a, r = !0;
58
+ }
59
+ if (!r) return;
60
+ let i = {};
61
+ for (let [e, n] of Object.entries(t)) s.columns.has(e) || (i[e] = n);
62
+ return {
63
+ scalars: i,
64
+ merges: n
65
+ };
66
+ };
31
67
  for (let e of t) {
32
- i.push(e.id), a.add(e.id);
33
- let t = n.get(e.id);
34
- t === void 0 ? r.push({
68
+ a.push(e.id), o.add(e.id);
69
+ let t = r.get(e.id);
70
+ if (t === void 0) i.push({
35
71
  op: "add",
36
- path: g(e.id),
37
- value: e
38
- }) : Ke(t, e) || r.push({
39
- op: "replace",
40
- path: g(e.id),
72
+ path: h(e.id),
41
73
  value: e
42
74
  });
75
+ else if (!qe(t, e)) {
76
+ let n = c(t, e);
77
+ n === void 0 ? i.push({
78
+ op: "replace",
79
+ path: h(e.id),
80
+ value: e
81
+ }) : (qe(Object.fromEntries(Object.entries(t).filter(([e]) => !s.columns.has(e))), n.scalars) || i.push({
82
+ op: "replace",
83
+ path: h(e.id),
84
+ value: n.scalars
85
+ }), i.push({
86
+ op: "mergeCells",
87
+ path: h(e.id),
88
+ value: n.merges
89
+ }));
90
+ }
43
91
  }
44
- for (let t of e) a.has(t.id) || r.push({
92
+ for (let t of e) o.has(t.id) || i.push({
45
93
  op: "remove",
46
- path: g(t.id)
94
+ path: h(t.id)
47
95
  });
48
96
  return {
49
- ops: r,
50
- order: i
97
+ ops: i,
98
+ order: a
51
99
  };
52
- }, Je = (e) => e.every((e) => {
100
+ }, Xe = (e) => e.every((e) => {
53
101
  let t = e.id;
54
102
  return typeof t == "string" || typeof t == "number";
55
- }), Ye = (e, t) => {
56
- let n = /* @__PURE__ */ new Map();
57
- for (let t of e) n.set(t.id, t);
58
- for (let e of t.ops) (e.op === "add" || e.op === "replace") && n.set(e.value.id, e.value);
59
- let r = [];
103
+ }), Ze = (e, t, n = {}) => {
104
+ let r = /* @__PURE__ */ new Map();
105
+ for (let t of e) r.set(t.id, t);
106
+ for (let e of t.ops) {
107
+ if (e.op === "mergeCells") {
108
+ let t = Ke(e.path), i = r.get(t) ?? r.get(Number(t)), a = r.has(t) ? t : Number(t);
109
+ if (i === void 0) continue;
110
+ let o = { ...i };
111
+ for (let [t, r] of Object.entries(e.value)) o[t] = n.mergeCell === void 0 ? r : n.mergeCell(t, i[t], r);
112
+ r.set(a, o);
113
+ continue;
114
+ }
115
+ (e.op === "add" || e.op === "replace") && r.set(e.value.id, e.value);
116
+ }
117
+ let i = [];
60
118
  for (let e of t.order) {
61
- let t = n.get(e);
62
- t !== void 0 && r.push(t);
119
+ let t = r.get(e);
120
+ t !== void 0 && i.push(t);
63
121
  }
64
- return r;
65
- }, v = (e) => d.Union(d.Struct({
66
- _tag: d.Literal("snapshot"),
67
- revision: d.Number,
122
+ return i;
123
+ }, Qe = (e) => p.Union(p.Struct({
124
+ _tag: p.Literal("snapshot"),
125
+ revision: p.Number,
68
126
  data: e,
69
- computed: d.optional(d.Boolean)
70
- }), d.Struct({
71
- _tag: d.Literal("delta"),
72
- revision: d.Number,
73
- emittedAt: d.Number,
74
- patch: h
75
- }), d.Struct({
76
- _tag: d.Literal("error"),
77
- error: d.Unknown,
78
- revision: d.optional(d.Number)
79
- })), y = (e, t) => {
127
+ computed: p.optional(p.Boolean)
128
+ }), p.Struct({
129
+ _tag: p.Literal("delta"),
130
+ revision: p.Number,
131
+ emittedAt: p.Number,
132
+ patch: Ge
133
+ }), p.Struct({
134
+ _tag: p.Literal("error"),
135
+ error: p.Unknown,
136
+ revision: p.optional(p.Number)
137
+ })), $e = (e, t) => {
80
138
  let n = `${e ?? "this procedure"} input`;
81
139
  return t === !0 ? `${n} (guarded — the guard did NOT run: the payload failed to decode first, so this says nothing about access)` : n;
82
- }, Xe = (e) => {
140
+ }, et = (e) => {
83
141
  let t = e.ast;
84
142
  return t._tag === "TypeLiteral" && (t.propertySignatures?.length ?? 0) === 0 && (t.indexSignatures?.length ?? 0) === 0;
85
- }, b = (e, t, n) => {
86
- let r = y(t, n), i = e.annotations({
143
+ }, _ = (e, t, n) => {
144
+ let r = $e(t, n), i = e.annotations({
87
145
  parseOptions: { onExcessProperty: "error" },
88
146
  parseIssueTitle: () => r
89
147
  });
90
- return Xe(e) ? d.filter((e) => typeof e == "object" && e && Object.keys(e).length > 0 ? `this procedure declares no input; received: ${Object.keys(e).join(", ")}` : void 0)(i).annotations({ identifier: r }) : i;
91
- }, x = class extends d.TaggedError()("BusinessRuleViolation", {
92
- rule: d.String,
93
- params: d.optional(d.Record({
94
- key: d.String,
95
- value: d.Unknown
148
+ return et(e) ? p.filter((e) => typeof e == "object" && e && Object.keys(e).length > 0 ? `this procedure declares no input; received: ${Object.keys(e).join(", ")}` : void 0)(i).annotations({ identifier: r }) : i;
149
+ }, v = class extends p.TaggedError()("BusinessRuleViolation", {
150
+ rule: p.String,
151
+ params: p.optional(p.Record({
152
+ key: p.String,
153
+ value: p.Unknown
96
154
  })),
97
- field: d.optional(d.String),
98
- message: d.optional(d.String),
99
- severity: d.Literal("error", "warning")
100
- }) {}, S = class extends d.TaggedError()("ApprovalRequired", {
101
- approvalId: d.String,
102
- procedure: d.String,
103
- expiresAt: d.String,
104
- requiredScopes: d.Array(d.String),
105
- reason: d.NullOr(d.String),
106
- created: d.Boolean
107
- }) {}, C = class extends d.TaggedError()("ApprovalNotFound", { approvalId: d.String }) {}, w = class extends d.TaggedError()("ApprovalSelfApproval", {
108
- approvalId: d.String,
109
- subjectId: d.NullOr(d.String)
110
- }) {}, T = class extends d.TaggedError()("ApprovalRejected", {
111
- approvalId: d.String,
112
- decidedBy: d.NullOr(d.String),
113
- note: d.NullOr(d.String)
114
- }) {}, E = class extends d.TaggedError()("ApprovalExpired", {
115
- approvalId: d.String,
116
- expiredAt: d.String
117
- }) {}, D = class extends d.TaggedError()("ApprovalNotPending", {
118
- approvalId: d.String,
119
- status: d.String
120
- }) {}, O = class extends d.TaggedError()("ApprovalForbidden", {
121
- approvalId: d.String,
122
- required: d.NullOr(d.String),
123
- message: d.String
124
- }) {}, k = class extends d.TaggedError()("ApprovalUnavailable", {
125
- procedure: d.String,
126
- message: d.String
127
- }) {}, A = d.Union(S, T, E, k), j = d.Union(C, w, E, D, O, k), M = d.Struct({
128
- id: d.String,
129
- procedure: d.String,
130
- kind: d.Literal("mutation", "action"),
131
- requestedBy: d.NullOr(d.String),
132
- status: d.Literal("pending", "approved", "rejected", "expired", "consumed"),
133
- reason: d.NullOr(d.String),
134
- requiredScopes: d.Array(d.String),
135
- requestedAt: d.String,
136
- expiresAt: d.String,
137
- decidedBy: d.NullOr(d.String),
138
- decidedAt: d.NullOr(d.String),
139
- note: d.NullOr(d.String),
140
- relation: d.Literal("to-decide", "requested")
141
- }), N = "channel:", P = Symbol.for("@voltro/protocol/reactivityChannels"), Ze = globalThis, F = Ze[P] ?? (Ze[P] = /* @__PURE__ */ new Map()), Qe = /^[a-z][a-z0-9-]*(\.[a-z0-9-]+)*$/, $e = (e) => {
142
- if (!Qe.test(e)) throw Error(`reactivityChannel('${e}'): invalid channel name.\n Use lowercase kebab segments separated by dots — \`presence\`, \`job-queue\`,
155
+ field: p.optional(p.String),
156
+ message: p.optional(p.String),
157
+ severity: p.Literal("error", "warning")
158
+ }) {}, y = p.Struct({
159
+ field: p.String,
160
+ message: p.String,
161
+ params: p.optional(p.Record({
162
+ key: p.String,
163
+ value: p.Unknown
164
+ }))
165
+ }), b = class extends p.TaggedError()("ValidationError", {
166
+ field: p.String,
167
+ message: p.String,
168
+ params: p.optional(p.Record({
169
+ key: p.String,
170
+ value: p.Unknown
171
+ }))
172
+ }) {}, x = class extends p.TaggedError()("ValidationErrors", { issues: p.Array(y).pipe(p.minItems(1)) }) {}, tt = (e) => {
173
+ if (typeof e != "object" || !e) return [];
174
+ let t = e._tag;
175
+ if (t === "ValidationError") {
176
+ let t = e;
177
+ return [{
178
+ field: t.field,
179
+ message: t.message,
180
+ ...t.params === void 0 ? {} : { params: t.params }
181
+ }];
182
+ }
183
+ if (t === "ValidationErrors") {
184
+ let t = e;
185
+ return Array.isArray(t.issues) ? t.issues : [];
186
+ }
187
+ if (t === "BusinessRuleViolation") {
188
+ let t = e;
189
+ if (typeof t.field != "string" || t.field.length === 0) return [];
190
+ let n = typeof t.message == "string" && t.message.length > 0 ? t.message : String(t.rule ?? "validation.invalid");
191
+ return [{
192
+ field: t.field,
193
+ message: n,
194
+ ...t.params === void 0 ? {} : { params: t.params }
195
+ }];
196
+ }
197
+ return [];
198
+ }, S = class extends p.TaggedError()("ApprovalRequired", {
199
+ approvalId: p.String,
200
+ procedure: p.String,
201
+ expiresAt: p.String,
202
+ requiredScopes: p.Array(p.String),
203
+ reason: p.NullOr(p.String),
204
+ created: p.Boolean
205
+ }) {}, C = class extends p.TaggedError()("ApprovalNotFound", { approvalId: p.String }) {}, w = class extends p.TaggedError()("ApprovalSelfApproval", {
206
+ approvalId: p.String,
207
+ subjectId: p.NullOr(p.String)
208
+ }) {}, nt = class extends p.TaggedError()("ApprovalRejected", {
209
+ approvalId: p.String,
210
+ decidedBy: p.NullOr(p.String),
211
+ note: p.NullOr(p.String)
212
+ }) {}, T = class extends p.TaggedError()("ApprovalExpired", {
213
+ approvalId: p.String,
214
+ expiredAt: p.String
215
+ }) {}, rt = class extends p.TaggedError()("ApprovalNotPending", {
216
+ approvalId: p.String,
217
+ status: p.String
218
+ }) {}, it = class extends p.TaggedError()("ApprovalForbidden", {
219
+ approvalId: p.String,
220
+ required: p.NullOr(p.String),
221
+ message: p.String
222
+ }) {}, E = class extends p.TaggedError()("ApprovalUnavailable", {
223
+ procedure: p.String,
224
+ message: p.String
225
+ }) {}, at = p.Union(S, nt, T, E), ot = p.Union(C, w, T, rt, it, E), st = p.Struct({
226
+ id: p.String,
227
+ procedure: p.String,
228
+ kind: p.Literal("mutation", "action"),
229
+ requestedBy: p.NullOr(p.String),
230
+ status: p.Literal("pending", "approved", "rejected", "expired", "consumed"),
231
+ reason: p.NullOr(p.String),
232
+ requiredScopes: p.Array(p.String),
233
+ requestedAt: p.String,
234
+ expiresAt: p.String,
235
+ decidedBy: p.NullOr(p.String),
236
+ decidedAt: p.NullOr(p.String),
237
+ note: p.NullOr(p.String),
238
+ relation: p.Literal("to-decide", "requested")
239
+ }), D = "channel:", O = Symbol.for("@voltro/protocol/reactivityChannels"), k = globalThis, A = k[O] ?? (k[O] = /* @__PURE__ */ new Map()), ct = /^[a-z][a-z0-9-]*(\.[a-z0-9-]+)*$/, lt = (e) => {
240
+ if (!ct.test(e)) throw Error(`reactivityChannel('${e}'): invalid channel name.\n Use lowercase kebab segments separated by dots — \`presence\`, \`job-queue\`,
143
241
  \`billing.usage\`. A \`:\` is refused because it is the namespace separator in
144
- the routing key (\`${N}<name>\`), and an uppercase letter is\n refused because a key that differs only by case reads as one channel and
242
+ the routing key (\`${D}<name>\`), and an uppercase letter is\n refused because a key that differs only by case reads as one channel and
145
243
  routes as two.`);
146
- let t = F.get(e);
244
+ let t = A.get(e);
147
245
  if (t !== void 0) return t;
148
- let n = `${N}${e}`, r = Object.freeze({
246
+ let n = `${D}${e}`, r = Object.freeze({
149
247
  kind: "reactivity-channel",
150
248
  name: e,
151
249
  key: n,
152
250
  toString: () => n
153
251
  });
154
- return F.set(e, r), r;
155
- }, et = (e) => typeof e == "object" && !!e && e.kind === "reactivity-channel", tt = (e) => e.startsWith(N), nt = () => new Set([...F.values()].map((e) => e.key)), I = (e) => et(e) ? e.key : e, rt = (e) => e === void 0 ? [] : Array.isArray(e) ? e.map(I) : [I(e)], it = (e) => e === void 0 ? void 0 : Array.isArray(e) ? e.map(I) : I(e), at = (e) => {
156
- let t = nt(), n = [];
157
- for (let r of e) for (let e of rt(r.source)) !tt(e) || t.has(e) || n.push({
252
+ return A.set(e, r), r;
253
+ }, j = (e) => typeof e == "object" && !!e && e.kind === "reactivity-channel", M = (e) => e.startsWith(D), N = () => new Set([...A.values()].map((e) => e.key)), P = (e) => j(e) ? e.key : e, F = (e) => e === void 0 ? [] : Array.isArray(e) ? e.map(P) : [P(e)], I = (e) => e === void 0 ? void 0 : Array.isArray(e) ? e.map(P) : P(e), ut = (e) => {
254
+ let t = N(), n = [];
255
+ for (let r of e) for (let e of F(r.source)) !M(e) || t.has(e) || n.push({
158
256
  procedure: r.name,
159
257
  key: e
160
258
  });
161
259
  return n;
162
- }, ot = (e, t) => {
260
+ }, dt = (e, t) => {
163
261
  let n = e?.injectExternalChange;
164
262
  return n !== void 0 && (n.call(e, {
165
263
  table: t.key,
@@ -168,8 +266,8 @@ var We = d.Union(d.String, d.Number), p = d.Record({
168
266
  old: {},
169
267
  origin: "inline"
170
268
  }), !0);
171
- }, st = (e) => e.internal !== !0, L = (e) => {
172
- if (ct(e), Array.isArray(e.guards) && e.guards.length === 0) throw Error(`${e.name}: \`guards: []\` is empty, so it enforces nothing — but it reads\n at the call site as if this procedure were protected. Omit the field for an
269
+ }, ft = (e) => e.internal !== !0, L = (e) => {
270
+ if (pt(e), Array.isArray(e.guards) && e.guards.length === 0) throw Error(`${e.name}: \`guards: []\` is empty, so it enforces nothing — but it reads\n at the call site as if this procedure were protected. Omit the field for an
173
271
  unguarded procedure, or list the scopes required to call it.`);
174
272
  let t = typeof e.source == "string" ? [e.source] : Array.isArray(e.source) ? e.source : void 0;
175
273
  if (t !== void 0 && (t.length === 0 || t.some((e) => String(e).trim() === ""))) throw Error(`${e.name}: \`source\` is empty, so this query declares reactivity and\n subscribes to nothing — it serves one snapshot and never updates again,
@@ -186,7 +284,7 @@ var We = d.Union(d.String, d.Number), p = d.Record({
186
284
  let n = [e.publicApi === void 0 ? void 0 : "publicApi", e.exposeAsTool === void 0 ? void 0 : "exposeAsTool"].filter((e) => e !== void 0);
187
285
  if (n.length === 0) return e;
188
286
  throw Error(`${e.name}: \`internal: true\` cannot be combined with ${n.map((e) => `\`${e}\``).join(" or ")}. \`internal\` takes the procedure OFF the wire; those put it back ON a different one (${n.includes("publicApi") ? "a REST route" : "an agent tool"}), and that surface is projected without consulting the flag — so the procedure would be unreachable from your client and reachable from the internet. Drop \`internal: true\` if the wider surface is intended, or remove the ${n.join(" / ")} annotation if it is not.`);
189
- }, ct = (e) => {
287
+ }, pt = (e) => {
190
288
  let t = e.requiresApproval;
191
289
  if (t !== void 0) {
192
290
  if (!Array.isArray(t.approvers) || t.approvers.length === 0) throw Error(`${e.name}: \`requiresApproval.approvers\` is empty, so NOBODY can approve this\n procedure and every call would park forever. Name the scope(s) an approver must hold
@@ -196,20 +294,20 @@ var We = d.Union(d.String, d.Number), p = d.Record({
196
294
  human from every other, and the second-pair-of-eyes control would enforce nothing.
197
295
  Give the procedure a \`guards:\` decision, or drop \`requiresApproval\`.`);
198
296
  }
199
- }, lt = (e) => e.action !== void 0 && e.resourceType !== void 0, ut = (e) => e.openAccess !== void 0 || e.guards !== void 0 && e.guards.length > 0, R = (e, t, n) => {
297
+ }, mt = (e) => e.action !== void 0 && e.resourceType !== void 0, ht = (e) => e.openAccess !== void 0 || e.guards !== void 0 && e.guards.length > 0, R = (e, t, n) => {
200
298
  if (n === void 0) return t;
201
299
  if (n.trim() === "") throw Error(`${e}: \`openAccess\` needs a REASON, not an empty string. It is the sentence a\n reviewer reads to decide whether this procedure should really be callable
202
300
  without an authorization check — e.g. \`openAccess: 'public pricing, no caller data'\`.`);
203
301
  if (t !== void 0 && t.length > 0) throw Error(`${e}: \`openAccess\` and \`guards\` are two different access decisions, so\n declaring both says the procedure is protected AND open. Keep the guards if a
204
302
  caller must hold a scope; drop them if anyone may call it.`);
205
- return [u(n.trim())];
303
+ return [f(n.trim())];
206
304
  }, z = (e) => L({
207
305
  kind: "query",
208
306
  name: e.name,
209
307
  input: e.input,
210
308
  output: e.output,
211
- error: e.error ?? d.Never,
212
- source: it(e.source),
309
+ error: e.error ?? p.Never,
310
+ source: I(e.source),
213
311
  cache: e.cache,
214
312
  guards: R(e.name, e.guards, e.openAccess),
215
313
  openAccess: e.openAccess,
@@ -222,7 +320,7 @@ var We = d.Union(d.String, d.Number), p = d.Record({
222
320
  name: e.name,
223
321
  input: e.input,
224
322
  output: e.output,
225
- error: e.error ?? d.Never,
323
+ error: e.error ?? p.Never,
226
324
  target: e.target,
227
325
  guards: R(e.name, e.guards, e.openAccess),
228
326
  openAccess: e.openAccess,
@@ -236,7 +334,7 @@ var We = d.Union(d.String, d.Number), p = d.Record({
236
334
  name: e.name,
237
335
  input: e.input,
238
336
  output: e.output,
239
- error: e.error ?? d.Never,
337
+ error: e.error ?? p.Never,
240
338
  guards: R(e.name, e.guards, e.openAccess),
241
339
  openAccess: e.openAccess,
242
340
  source: e.source,
@@ -246,50 +344,50 @@ var We = d.Union(d.String, d.Number), p = d.Record({
246
344
  requiresApproval: e.requiresApproval,
247
345
  internal: e.internal,
248
346
  overridesPlugin: e.overridesPlugin
249
- }), dt = (e) => L({
347
+ }), gt = (e) => L({
250
348
  kind: "stream",
251
349
  name: e.name,
252
350
  input: e.input,
253
351
  element: e.element,
254
- error: e.error ?? d.Never,
352
+ error: e.error ?? p.Never,
255
353
  internal: e.internal,
256
354
  overridesPlugin: e.overridesPlugin,
257
355
  guards: R(e.name, e.guards, e.openAccess),
258
356
  openAccess: e.openAccess
259
- }), H = (e, t) => t && t.length > 0 ? d.Union(e, ...t) : e, U = (e) => e !== void 0 && e.some((e) => !l(e)), ft = (e, t) => U(t) ? d.Union(e, c, s) : e, pt = (e) => d.Union(e, x), mt = (e, t) => t === void 0 ? e : d.Union(e, A), W = (e, t) => {
357
+ }), H = (e, t) => t && t.length > 0 ? p.Union(e, ...t) : e, U = (e) => e !== void 0 && e.some((e) => !d(e)), _t = (e, t) => U(t) ? p.Union(e, u, l) : e, vt = (e) => p.Union(e, v), yt = (e) => p.Union(e, b, x), bt = (e, t) => t === void 0 ? e : p.Union(e, at), W = (e, t) => {
260
358
  if (t === "stream") return e.error;
261
- let n = ft(e.error, e.guards);
262
- return t === "query" ? n : mt(t === "mutation" ? pt(n) : n, e.requiresApproval);
263
- }, ht = (e, t) => f.make(e.name, {
264
- payload: b(e.input, e.name, U(e.guards)),
265
- success: v(e.output),
359
+ let n = _t(e.error, e.guards);
360
+ return t === "query" ? n : bt(yt(t === "mutation" ? vt(n) : n), e.requiresApproval);
361
+ }, xt = (e, t) => m.make(e.name, {
362
+ payload: _(e.input, e.name, U(e.guards)),
363
+ success: Qe(e.output),
266
364
  error: H(W(e, "query"), t),
267
365
  stream: !0
268
- }), gt = (e, t) => f.make(e.name, {
269
- payload: b(e.input, e.name, U(e.guards)),
366
+ }), St = (e, t) => m.make(e.name, {
367
+ payload: _(e.input, e.name, U(e.guards)),
270
368
  success: e.output,
271
369
  error: H(W(e, "mutation"), t)
272
- }), _t = (e, t) => f.make(e.name, {
273
- payload: b(e.input, e.name, U(e.guards)),
370
+ }), Ct = (e, t) => m.make(e.name, {
371
+ payload: _(e.input, e.name, U(e.guards)),
274
372
  success: e.output,
275
373
  error: H(W(e, "action"), t)
276
- }), vt = (e, t) => f.make(e.name, {
277
- payload: b(e.input, e.name, U(e.guards)),
374
+ }), wt = (e, t) => m.make(e.name, {
375
+ payload: _(e.input, e.name, U(e.guards)),
278
376
  success: e.element,
279
377
  error: H(e.error, t),
280
378
  stream: !0
281
- }), yt = (e) => {
379
+ }), Tt = (e) => {
282
380
  if (typeof e != "object" || !e) return;
283
381
  let t = e._tag;
284
382
  return typeof t == "string" ? t : void 0;
285
- }, bt = (e) => {
383
+ }, Et = (e) => {
286
384
  switch (e.kind) {
287
- case "query": return ht(e);
288
- case "mutation": return gt(e);
289
- case "action": return _t(e);
290
- case "stream": return vt(e);
385
+ case "query": return xt(e);
386
+ case "mutation": return St(e);
387
+ case "action": return Ct(e);
388
+ case "stream": return wt(e);
291
389
  }
292
- }, xt = (e) => {
390
+ }, Dt = (e) => {
293
391
  let t = e.input, n = t === void 0 ? {} : { input: t }, r = e.output, i = r === void 0 ? {} : { output: r };
294
392
  if (e.kind === "query") return {
295
393
  kind: "query",
@@ -330,7 +428,7 @@ var We = d.Union(d.String, d.Number), p = d.Record({
330
428
  ..."shapeItem" in e && e.shapeItem !== void 0 ? { shapeItem: e.shapeItem } : {}
331
429
  }))
332
430
  };
333
- }, St = 7500, Ct = (e) => typeof e == "object" && !!e && e.kind === "event", wt = (e) => {
431
+ }, Ot = 7500, kt = (e) => typeof e == "object" && !!e && e.kind === "event", At = (e) => {
334
432
  if (e.name.length === 0) throw Error("defineEvent: `name` must not be empty");
335
433
  if (/\s/.test(e.name)) throw Error(`defineEvent("${e.name}"): \`name\` must not contain whitespace.\n The name is used as a broker subject segment. NATS refuses a subject with
336
434
  whitespace and delivers nothing — silently, and only on that broker, so an
@@ -359,75 +457,75 @@ var We = d.Union(d.String, d.Number), p = d.Record({
359
457
  name: e.name,
360
458
  key: e.key,
361
459
  payload: e.payload,
362
- guards: e.openAccess === void 0 ? e.guards : [u(e.openAccess.trim())],
460
+ guards: e.openAccess === void 0 ? e.guards : [f(e.openAccess.trim())],
363
461
  openAccess: e.openAccess,
364
462
  rewind: e.rewind,
365
463
  webhook: e.webhook,
366
464
  delivery: e.delivery
367
465
  };
368
- }, Tt = (e) => d.Struct({
369
- _tag: d.Literal("event"),
370
- origin: d.String,
371
- n: d.Number,
372
- emittedAt: d.Number,
466
+ }, jt = (e) => p.Struct({
467
+ _tag: p.Literal("event"),
468
+ origin: p.String,
469
+ n: p.Number,
470
+ emittedAt: p.Number,
373
471
  payload: e
374
- }), Et = d.Struct({
375
- _tag: d.Literal("gap"),
376
- missed: d.Number,
377
- reason: d.Literal("buffer", "resume")
378
- }), Dt = d.Struct({ _tag: d.Literal("attached") }), Ot = (e) => d.Union(Dt, Tt(e), Et), kt = d.Struct({
379
- origin: d.String,
380
- n: d.Number
381
- }), At = (e) => d.Struct({
472
+ }), Mt = p.Struct({
473
+ _tag: p.Literal("gap"),
474
+ missed: p.Number,
475
+ reason: p.Literal("buffer", "resume")
476
+ }), Nt = p.Struct({ _tag: p.Literal("attached") }), Pt = (e) => p.Union(Nt, jt(e), Mt), Ft = p.Struct({
477
+ origin: p.String,
478
+ n: p.Number
479
+ }), G = (e) => p.Struct({
382
480
  key: e,
383
- resume: d.optional(d.Array(kt))
384
- }), jt = (e, t) => {
385
- let n = e.guards !== void 0 && e.guards.some((e) => !l(e)) ? d.Union(c, s) : d.Never, r = t && t.length > 0 ? d.Union(n, ...t) : n;
386
- return f.make(e.name, {
387
- payload: b(At(e.key), e.name, U(e.guards)),
388
- success: Ot(e.payload),
481
+ resume: p.optional(p.Array(Ft))
482
+ }), It = (e, t) => {
483
+ let n = e.guards !== void 0 && e.guards.some((e) => !d(e)) ? p.Union(u, l) : p.Never, r = t && t.length > 0 ? p.Union(n, ...t) : n;
484
+ return m.make(e.name, {
485
+ payload: _(G(e.key), e.name, U(e.guards)),
486
+ success: Pt(e.payload),
389
487
  error: r,
390
488
  stream: !0
391
489
  });
392
- }, Mt = class extends d.TaggedError()("EventPayloadInvalid", {
393
- event: d.String,
394
- message: d.String
395
- }) {}, Nt = class extends d.TaggedError()("EventKeyInvalid", {
396
- event: d.String,
397
- message: d.String
398
- }) {}, Pt = class extends d.TaggedError()("EventPayloadTooLarge", {
399
- event: d.String,
400
- bytes: d.Number,
401
- limit: d.Number
402
- }) {}, Ft = (e) => {
490
+ }, Lt = class extends p.TaggedError()("EventPayloadInvalid", {
491
+ event: p.String,
492
+ message: p.String
493
+ }) {}, Rt = class extends p.TaggedError()("EventKeyInvalid", {
494
+ event: p.String,
495
+ message: p.String
496
+ }) {}, zt = class extends p.TaggedError()("EventPayloadTooLarge", {
497
+ event: p.String,
498
+ bytes: p.Number,
499
+ limit: p.Number
500
+ }) {}, Bt = (e) => {
403
501
  if (typeof e != "object" || !e) return JSON.stringify(e) ?? "null";
404
502
  let t = Object.entries(e).filter(([, e]) => e !== void 0).sort(([e], [t]) => e < t ? -1 : +(e > t));
405
503
  return JSON.stringify(t);
406
- }, It = "\0", Lt = (e, t, n) => [
504
+ }, Vt = "\0", Ht = (e, t, n) => [
407
505
  e ?? "~",
408
506
  t,
409
- Ft(n)
410
- ].join("\0"), Rt = (e) => {
507
+ Bt(n)
508
+ ].join("\0"), Ut = (e) => {
411
509
  let [t = "~", n = "", r = ""] = e.split("\0");
412
510
  return {
413
511
  tenantId: t === "~" ? null : t,
414
512
  event: n,
415
513
  key: r
416
514
  };
417
- }, zt = (e) => e.split("\0").join(" · "), Bt = (e) => e, Vt = (e) => e, Ht = (e) => {
515
+ }, Wt = (e) => e.split("\0").join(" · "), Gt = (e) => e, Kt = (e) => e, qt = (e) => {
418
516
  let t = e.alias?.trim(), n = e.instance?.trim(), r = t !== void 0 && t !== "" ? t : e.base;
419
517
  return n !== void 0 && n !== "" ? `${r}#${n}` : r;
420
- }, Ut = (e) => {
518
+ }, Jt = (e) => {
421
519
  if (e.length !== 0) return (t, n) => e.reduceRight((e, t) => t(e, n), t);
422
- }, Wt = (e, t) => {
423
- let n = He.GenericTag(e);
520
+ }, Yt = (e, t) => {
521
+ let n = Be.GenericTag(e);
424
522
  return {
425
523
  Tag: n,
426
- Live: Ue.succeed(n, t)
524
+ Live: Ve.succeed(n, t)
427
525
  };
428
- }, Gt = (e, t, n) => {
526
+ }, Xt = (e, t, n) => {
429
527
  if (!t) return { ok: !0 };
430
- let r = G(n);
528
+ let r = K(n);
431
529
  if (!r) return {
432
530
  ok: !1,
433
531
  reason: `cannot parse runningVersion "${n}"`
@@ -435,12 +533,12 @@ var We = d.Union(d.String, d.Number), p = d.Record({
435
533
  let i = t.trim();
436
534
  if (i === "*" || i === "") return { ok: !0 };
437
535
  let a = i.split(/\s+/).filter((e) => e.length > 0);
438
- for (let i of a) if (!Kt(i, r)) return {
536
+ for (let i of a) if (!Zt(i, r)) return {
439
537
  ok: !1,
440
538
  reason: `plugin "${e}" requires framework ${t}, running ${n}`
441
539
  };
442
540
  return { ok: !0 };
443
- }, G = (e) => {
541
+ }, K = (e) => {
444
542
  let t = /^(\d+)\.(\d+)\.(\d+)(?:-([0-9a-zA-Z.-]+))?$/.exec(e.trim());
445
543
  return t ? {
446
544
  major: Number(t[1]),
@@ -448,228 +546,228 @@ var We = d.Union(d.String, d.Number), p = d.Record({
448
546
  patch: Number(t[3]),
449
547
  pre: t[4] ?? ""
450
548
  } : null;
451
- }, K = (e, t) => e.major === t.major ? e.minor === t.minor ? e.patch === t.patch ? e.pre && !t.pre ? -1 : !e.pre && t.pre ? 1 : e.pre && t.pre ? e.pre < t.pre ? -1 : +(e.pre > t.pre) : 0 : e.patch - t.patch : e.minor - t.minor : e.major - t.major, Kt = (e, t) => {
549
+ }, q = (e, t) => e.major === t.major ? e.minor === t.minor ? e.patch === t.patch ? e.pre && !t.pre ? -1 : !e.pre && t.pre ? 1 : e.pre && t.pre ? e.pre < t.pre ? -1 : +(e.pre > t.pre) : 0 : e.patch - t.patch : e.minor - t.minor : e.major - t.major, Zt = (e, t) => {
452
550
  if (e === "*") return !0;
453
551
  if (e.startsWith("^")) {
454
- let n = G(e.slice(1));
455
- return !n || t.major !== n.major ? !1 : K(t, n) >= 0;
552
+ let n = K(e.slice(1));
553
+ return !n || t.major !== n.major ? !1 : q(t, n) >= 0;
456
554
  }
457
555
  if (e.startsWith("~")) {
458
- let n = G(e.slice(1));
459
- return !n || t.major !== n.major || t.minor !== n.minor ? !1 : K(t, n) >= 0;
556
+ let n = K(e.slice(1));
557
+ return !n || t.major !== n.major || t.minor !== n.minor ? !1 : q(t, n) >= 0;
460
558
  }
461
559
  let n = /^(>=|<=|>|<)(.+)$/.exec(e);
462
560
  if (n) {
463
- let e = n[1], r = G(n[2]);
561
+ let e = n[1], r = K(n[2]);
464
562
  if (!r) return !1;
465
- let i = K(t, r);
563
+ let i = q(t, r);
466
564
  if (e === ">=") return i >= 0;
467
565
  if (e === "<=") return i <= 0;
468
566
  if (e === ">") return i > 0;
469
567
  if (e === "<") return i < 0;
470
568
  }
471
- let r = G(e);
472
- return r ? K(t, r) === 0 : !1;
473
- }, q = d.Literal("running", "succeeded", "failed", "cancelled", "suspended"), qt = d.Literal("cancel", "terminate", "abandon"), Jt = d.Struct({
474
- mode: d.String,
475
- dueAt: d.NullOr(d.Number),
476
- retryAfterMs: d.NullOr(d.Number),
477
- intentId: d.NullOr(d.String)
478
- }), Yt = d.Struct({
479
- id: d.String,
480
- workflowName: d.String,
481
- executionId: d.NullOr(d.String),
482
- status: d.Literal("running", "queued", "dropped", "skipped"),
483
- deferral: d.optional(Jt)
484
- }), J = d.Struct({
485
- id: d.String,
486
- tag: d.String,
487
- executionId: d.String,
488
- status: q,
489
- payload: d.Unknown,
490
- workflowVersion: d.NullOr(d.String),
491
- workflowPatches: d.NullOr(d.Unknown),
492
- output: d.NullOr(d.Unknown),
493
- subject: d.NullOr(d.Unknown),
494
- source: d.NullOr(d.String),
495
- errorTag: d.NullOr(d.String),
496
- errorMessage: d.NullOr(d.String),
497
- cancelled: d.Boolean,
498
- startedAt: d.Date,
499
- completedAt: d.NullOr(d.Date),
500
- durationMs: d.NullOr(d.Number),
501
- traceId: d.NullOr(d.String),
502
- parentExecutionId: d.NullOr(d.String),
503
- parentClosePolicy: d.NullOr(qt)
504
- }), Xt = d.Struct({
505
- tag: d.optional(d.String),
506
- status: d.optional(q),
507
- limit: d.optional(d.Number)
508
- }), Zt = d.Struct({
509
- id: d.String,
510
- runId: d.String,
511
- stepName: d.String,
512
- attempt: d.Number,
513
- status: d.Literal("running", "succeeded", "failed"),
514
- input: d.NullOr(d.Unknown),
515
- retryPolicy: d.NullOr(d.Unknown),
516
- output: d.NullOr(d.Unknown),
517
- errorTag: d.NullOr(d.String),
518
- errorMessage: d.NullOr(d.String),
519
- errorCause: d.NullOr(d.Unknown),
520
- startedAt: d.Date,
521
- completedAt: d.NullOr(d.Date),
522
- durationMs: d.NullOr(d.Number)
523
- }), Qt = d.Struct({
524
- id: d.String,
525
- runId: d.String,
526
- eventType: d.String,
527
- payload: d.NullOr(d.Unknown),
528
- occurredAt: d.Date,
529
- stepName: d.NullOr(d.String),
530
- attempt: d.NullOr(d.Number)
531
- }), $t = d.Struct({
532
- id: d.String,
533
- name: d.String,
534
- payload: d.Unknown,
535
- source: d.String,
536
- subject: d.NullOr(d.Unknown),
537
- traceId: d.NullOr(d.String),
538
- occurredAt: d.Date
539
- }), en = d.Struct({
540
- id: d.String,
541
- eventId: d.String,
542
- eventName: d.String,
543
- triggerId: d.String,
544
- workflowName: d.String,
545
- executionId: d.NullOr(d.String),
546
- status: d.Literal("starting", "started", "skipped", "failed"),
547
- idempotencyKey: d.String,
548
- skipped: d.Boolean,
549
- errorMessage: d.NullOr(d.String),
550
- createdAt: d.Date,
551
- completedAt: d.NullOr(d.Date)
552
- }), tn = d.Struct({ id: d.String }), Y = d.Struct({ runId: d.String }), nn = d.Struct({
553
- name: d.optional(d.String),
554
- limit: d.optional(d.Number)
555
- }), rn = d.Struct({ eventId: d.String }), X = d.Struct({
556
- workflowName: d.String,
557
- executionId: d.String
558
- }), an = d.Struct({
559
- id: d.String,
560
- signalName: d.String,
561
- payload: d.optional(d.Unknown)
562
- }), on = d.Struct({
563
- id: d.String,
564
- updateName: d.String,
565
- payload: d.optional(d.Unknown),
566
- timeoutMs: d.optional(d.Number)
567
- }), sn = d.Struct({
568
- eventId: d.String,
569
- updateId: d.String,
570
- completedEventId: d.String,
571
- result: d.Unknown
572
- }), cn = z({
569
+ let r = K(e);
570
+ return r ? q(t, r) === 0 : !1;
571
+ }, J = p.Literal("running", "succeeded", "failed", "cancelled", "suspended"), Qt = p.Literal("cancel", "terminate", "abandon"), $t = p.Struct({
572
+ mode: p.String,
573
+ dueAt: p.NullOr(p.Number),
574
+ retryAfterMs: p.NullOr(p.Number),
575
+ intentId: p.NullOr(p.String)
576
+ }), en = p.Struct({
577
+ id: p.String,
578
+ workflowName: p.String,
579
+ executionId: p.NullOr(p.String),
580
+ status: p.Literal("running", "queued", "dropped", "skipped"),
581
+ deferral: p.optional($t)
582
+ }), Y = p.Struct({
583
+ id: p.String,
584
+ tag: p.String,
585
+ executionId: p.String,
586
+ status: J,
587
+ payload: p.Unknown,
588
+ workflowVersion: p.NullOr(p.String),
589
+ workflowPatches: p.NullOr(p.Unknown),
590
+ output: p.NullOr(p.Unknown),
591
+ subject: p.NullOr(p.Unknown),
592
+ source: p.NullOr(p.String),
593
+ errorTag: p.NullOr(p.String),
594
+ errorMessage: p.NullOr(p.String),
595
+ cancelled: p.Boolean,
596
+ startedAt: p.Date,
597
+ completedAt: p.NullOr(p.Date),
598
+ durationMs: p.NullOr(p.Number),
599
+ traceId: p.NullOr(p.String),
600
+ parentExecutionId: p.NullOr(p.String),
601
+ parentClosePolicy: p.NullOr(Qt)
602
+ }), tn = p.Struct({
603
+ tag: p.optional(p.String),
604
+ status: p.optional(J),
605
+ limit: p.optional(p.Number)
606
+ }), nn = p.Struct({
607
+ id: p.String,
608
+ runId: p.String,
609
+ stepName: p.String,
610
+ attempt: p.Number,
611
+ status: p.Literal("running", "succeeded", "failed"),
612
+ input: p.NullOr(p.Unknown),
613
+ retryPolicy: p.NullOr(p.Unknown),
614
+ output: p.NullOr(p.Unknown),
615
+ errorTag: p.NullOr(p.String),
616
+ errorMessage: p.NullOr(p.String),
617
+ errorCause: p.NullOr(p.Unknown),
618
+ startedAt: p.Date,
619
+ completedAt: p.NullOr(p.Date),
620
+ durationMs: p.NullOr(p.Number)
621
+ }), rn = p.Struct({
622
+ id: p.String,
623
+ runId: p.String,
624
+ eventType: p.String,
625
+ payload: p.NullOr(p.Unknown),
626
+ occurredAt: p.Date,
627
+ stepName: p.NullOr(p.String),
628
+ attempt: p.NullOr(p.Number)
629
+ }), an = p.Struct({
630
+ id: p.String,
631
+ name: p.String,
632
+ payload: p.Unknown,
633
+ source: p.String,
634
+ subject: p.NullOr(p.Unknown),
635
+ traceId: p.NullOr(p.String),
636
+ occurredAt: p.Date
637
+ }), on = p.Struct({
638
+ id: p.String,
639
+ eventId: p.String,
640
+ eventName: p.String,
641
+ triggerId: p.String,
642
+ workflowName: p.String,
643
+ executionId: p.NullOr(p.String),
644
+ status: p.Literal("starting", "started", "skipped", "failed"),
645
+ idempotencyKey: p.String,
646
+ skipped: p.Boolean,
647
+ errorMessage: p.NullOr(p.String),
648
+ createdAt: p.Date,
649
+ completedAt: p.NullOr(p.Date)
650
+ }), sn = p.Struct({ id: p.String }), X = p.Struct({ runId: p.String }), cn = p.Struct({
651
+ name: p.optional(p.String),
652
+ limit: p.optional(p.Number)
653
+ }), ln = p.Struct({ eventId: p.String }), Z = p.Struct({
654
+ workflowName: p.String,
655
+ executionId: p.String
656
+ }), un = p.Struct({
657
+ id: p.String,
658
+ signalName: p.String,
659
+ payload: p.optional(p.Unknown)
660
+ }), dn = p.Struct({
661
+ id: p.String,
662
+ updateName: p.String,
663
+ payload: p.optional(p.Unknown),
664
+ timeoutMs: p.optional(p.Number)
665
+ }), fn = p.Struct({
666
+ eventId: p.String,
667
+ updateId: p.String,
668
+ completedEventId: p.String,
669
+ result: p.Unknown
670
+ }), pn = z({
573
671
  name: "__voltro.workflow.run",
574
672
  source: "_voltro_workflow_runs",
575
- input: tn,
576
- output: d.Array(J)
577
- }), ln = z({
673
+ input: sn,
674
+ output: p.Array(Y)
675
+ }), mn = z({
578
676
  name: "__voltro.workflow.runs",
579
677
  source: "_voltro_workflow_runs",
580
- input: Xt,
581
- output: d.Array(J)
582
- }), un = z({
678
+ input: tn,
679
+ output: p.Array(Y)
680
+ }), hn = z({
583
681
  name: "__voltro.workflow.run.steps",
584
682
  source: "_voltro_workflow_run_steps",
585
- input: Y,
586
- output: d.Array(Zt)
587
- }), dn = z({
683
+ input: X,
684
+ output: p.Array(nn)
685
+ }), gn = z({
588
686
  name: "__voltro.workflow.run.events",
589
687
  source: "_voltro_workflow_run_events",
590
- input: Y,
591
- output: d.Array(Qt)
592
- }), fn = z({
688
+ input: X,
689
+ output: p.Array(rn)
690
+ }), _n = z({
593
691
  name: "__voltro.workflow.domainEvents",
594
692
  source: "_voltro_workflow_events",
595
- input: nn,
596
- output: d.Array($t)
597
- }), pn = z({
693
+ input: cn,
694
+ output: p.Array(an)
695
+ }), vn = z({
598
696
  name: "__voltro.workflow.event.deliveries",
599
697
  source: "_voltro_workflow_event_deliveries",
600
- input: rn,
601
- output: d.Array(en)
602
- }), mn = V({
698
+ input: ln,
699
+ output: p.Array(on)
700
+ }), yn = V({
603
701
  name: "__voltro.workflow.cancel",
604
- input: X,
605
- output: d.Struct({ ok: d.Boolean })
606
- }), hn = V({
702
+ input: Z,
703
+ output: p.Struct({ ok: p.Boolean })
704
+ }), bn = V({
607
705
  name: "__voltro.workflow.resume",
608
- input: X,
609
- output: d.Struct({ ok: d.Boolean })
610
- }), gn = V({
706
+ input: Z,
707
+ output: p.Struct({ ok: p.Boolean })
708
+ }), xn = V({
611
709
  name: "__voltro.workflow.signal",
612
- input: an,
613
- output: d.Struct({ eventId: d.String })
614
- }), _n = V({
710
+ input: un,
711
+ output: p.Struct({ eventId: p.String })
712
+ }), Sn = V({
615
713
  name: "__voltro.workflow.update",
616
- input: on,
617
- output: sn
618
- }), vn = "__voltro.undo.log", yn = "__voltro.undo.apply", bn = "__voltro.undo.redo", xn = d.Struct({
619
- id: d.String,
620
- tag: d.String,
621
- label: d.NullOr(d.String),
622
- undone: d.Boolean,
623
- crossesAction: d.Boolean,
624
- createdAt: d.String
625
- }), Sn = class extends d.TaggedError()("UndoNotFound", { invocationId: d.String }) {}, Cn = class extends d.TaggedError()("UndoForbidden", { invocationId: d.String }) {}, wn = class extends d.TaggedError()("UndoConflict", {
626
- invocationId: d.String,
627
- reason: d.Literal("conflict", "action")
628
- }) {}, Tn = d.Union(Sn, Cn, wn), En = z({
629
- name: vn,
714
+ input: dn,
715
+ output: fn
716
+ }), Cn = "__voltro.undo.log", wn = "__voltro.undo.apply", Tn = "__voltro.undo.redo", En = p.Struct({
717
+ id: p.String,
718
+ tag: p.String,
719
+ label: p.NullOr(p.String),
720
+ undone: p.Boolean,
721
+ crossesAction: p.Boolean,
722
+ createdAt: p.String
723
+ }), Dn = class extends p.TaggedError()("UndoNotFound", { invocationId: p.String }) {}, On = class extends p.TaggedError()("UndoForbidden", { invocationId: p.String }) {}, kn = class extends p.TaggedError()("UndoConflict", {
724
+ invocationId: p.String,
725
+ reason: p.Literal("conflict", "action")
726
+ }) {}, An = p.Union(Dn, On, kn), jn = z({
727
+ name: Cn,
630
728
  source: "_voltro_undo_log",
631
- input: d.Struct({ limit: d.optional(d.Number) }),
632
- output: d.Array(xn),
729
+ input: p.Struct({ limit: p.optional(p.Number) }),
730
+ output: p.Array(En),
633
731
  openAccess: "subject-scoped by construction: lists only the calling subject's own undoable actions"
634
- }), Dn = B({
635
- name: yn,
636
- input: d.Struct({ invocationId: d.String }),
637
- output: d.Struct({ ok: d.Boolean }),
638
- error: Tn,
732
+ }), Mn = B({
733
+ name: wn,
734
+ input: p.Struct({ invocationId: p.String }),
735
+ output: p.Struct({ ok: p.Boolean }),
736
+ error: An,
639
737
  openAccess: "subject-scoped by construction: undo is per-actor — another subject's invocation fails typed with UndoForbidden"
640
- }), On = B({
641
- name: bn,
642
- input: d.Struct({ invocationId: d.String }),
643
- output: d.Struct({ ok: d.Boolean }),
644
- error: Tn,
738
+ }), Nn = B({
739
+ name: Tn,
740
+ input: p.Struct({ invocationId: p.String }),
741
+ output: p.Struct({ ok: p.Boolean }),
742
+ error: An,
645
743
  openAccess: "subject-scoped by construction: redo is per-actor — another subject's invocation fails typed with UndoForbidden"
646
- }), kn = class extends d.TaggedError()("TenantScopeViolation", {
647
- table: d.String,
648
- reason: d.String
649
- }) {}, An = class extends d.TaggedError()("StoreOperationFailed", {
650
- operation: d.String,
651
- table: d.String,
652
- cause: d.String
653
- }) {}, jn = class extends d.TaggedError()("TableValidationFailed", {
654
- table: d.String,
655
- summary: d.String,
656
- issues: d.Array(d.Struct({
657
- path: d.String,
658
- message: d.String
744
+ }), Pn = class extends p.TaggedError()("TenantScopeViolation", {
745
+ table: p.String,
746
+ reason: p.String
747
+ }) {}, Fn = class extends p.TaggedError()("StoreOperationFailed", {
748
+ operation: p.String,
749
+ table: p.String,
750
+ cause: p.String
751
+ }) {}, In = class extends p.TaggedError()("TableValidationFailed", {
752
+ table: p.String,
753
+ summary: p.String,
754
+ issues: p.Array(p.Struct({
755
+ path: p.String,
756
+ message: p.String
659
757
  }))
660
- }) {}, Mn = class extends d.TaggedError()("TenantRowNotFound", {
661
- table: d.String,
662
- id: d.String,
663
- reason: d.String
664
- }) {}, Nn = class extends d.TaggedError()("ServerOnlyColumnWrite", {
665
- table: d.String,
666
- columns: d.Array(d.String)
667
- }) {}, Pn = class extends d.TaggedError()("ConstraintViolation", {
668
- kind: d.Literal("foreignKey", "foreignKeyInUse", "unique", "notNull", "check"),
669
- table: d.String,
670
- operation: d.String,
671
- constraint: d.optional(d.String),
672
- column: d.optional(d.String)
758
+ }) {}, Ln = class extends p.TaggedError()("TenantRowNotFound", {
759
+ table: p.String,
760
+ id: p.String,
761
+ reason: p.String
762
+ }) {}, Rn = class extends p.TaggedError()("ServerOnlyColumnWrite", {
763
+ table: p.String,
764
+ columns: p.Array(p.String)
765
+ }) {}, zn = class extends p.TaggedError()("ConstraintViolation", {
766
+ kind: p.Literal("foreignKey", "foreignKeyInUse", "unique", "notNull", "check"),
767
+ table: p.String,
768
+ operation: p.String,
769
+ constraint: p.optional(p.String),
770
+ column: p.optional(p.String)
673
771
  }) {
674
772
  get message() {
675
773
  let e = this.constraint ?? this.column, t = e === void 0 ? `on ${this.table}` : `${e} on ${this.table}`;
@@ -681,80 +779,85 @@ var We = d.Union(d.String, d.Number), p = d.Record({
681
779
  case "check": return `check constraint ${t}: the row does not satisfy it`;
682
780
  }
683
781
  }
684
- }, Fn = "__voltro.approvals.pending", Z = "__voltro.approvals.decide", In = z({
685
- name: Fn,
782
+ }, Bn = "__voltro.approvals.pending", Vn = "__voltro.approvals.decide", Hn = z({
783
+ name: Bn,
686
784
  source: "_voltro_approvals",
687
- input: d.Struct({ limit: d.optional(d.Number) }),
688
- output: d.Array(M),
785
+ input: p.Struct({ limit: p.optional(p.Number) }),
786
+ output: p.Array(st),
689
787
  openAccess: "the answer is scoped to the caller — a row appears only if they requested it or hold its recorded approver scopes, so an anonymous caller sees nothing"
690
- }), Ln = B({
691
- name: Z,
692
- input: d.Struct({
693
- approvalId: d.String,
694
- decision: d.Literal("approve", "reject"),
695
- note: d.optional(d.String)
788
+ }), Un = B({
789
+ name: Vn,
790
+ input: p.Struct({
791
+ approvalId: p.String,
792
+ decision: p.Literal("approve", "reject"),
793
+ note: p.optional(p.String)
696
794
  }),
697
- output: d.Struct({
698
- approvalId: d.String,
699
- status: d.Literal("approved", "rejected")
795
+ output: p.Struct({
796
+ approvalId: p.String,
797
+ status: p.Literal("approved", "rejected")
700
798
  }),
701
- error: j,
799
+ error: ot,
702
800
  openAccess: "the approver authority is the PENDING ROW's own recorded scopes (plus an unconditional self-approval refusal), checked in-handler — a descriptor-level scope would have to be the union of every approval-requiring procedure in the app"
703
- }), Rn = "__voltro.connections.list", zn = "__voltro.connections.start", Bn = "__voltro.connections.submitToken", Vn = "__voltro.connections.disconnect", Q = d.Literal("oauth2", "pat"), Hn = d.Literal("disconnected", "connected", "expired", "revoked", "error"), Un = d.Struct({
704
- connectionId: d.String,
801
+ }), Wn = "__voltro.connections.list", Gn = "__voltro.connections.start", Kn = "__voltro.connections.submitToken", qn = "__voltro.connections.disconnect", Q = p.Literal("oauth2", "pat"), Jn = p.Literal("disconnected", "connected", "expired", "revoked", "error"), Yn = p.Struct({
802
+ connectionId: p.String,
705
803
  kind: Q,
706
- label: d.String,
707
- status: Hn,
708
- accountId: d.NullOr(d.String),
709
- accountLabel: d.NullOr(d.String),
710
- scopes: d.Array(d.String),
711
- expiresAt: d.NullOr(d.String),
712
- lastError: d.NullOr(d.String),
713
- connectedAt: d.NullOr(d.String)
714
- }), Wn = class extends d.TaggedError()("ConnectionNotDeclared", { connectionId: d.String }) {}, Gn = class extends d.TaggedError()("ConnectionSubjectRequired", { connectionId: d.String }) {}, Kn = class extends d.TaggedError()("ConnectionKindMismatch", {
715
- connectionId: d.String,
804
+ label: p.String,
805
+ status: Jn,
806
+ accountId: p.NullOr(p.String),
807
+ accountLabel: p.NullOr(p.String),
808
+ scopes: p.Array(p.String),
809
+ expiresAt: p.NullOr(p.String),
810
+ lastError: p.NullOr(p.String),
811
+ connectedAt: p.NullOr(p.String)
812
+ }), Xn = class extends p.TaggedError()("ConnectionNotDeclared", { connectionId: p.String }) {}, Zn = class extends p.TaggedError()("ConnectionSubjectRequired", { connectionId: p.String }) {}, Qn = class extends p.TaggedError()("ConnectionKindMismatch", {
813
+ connectionId: p.String,
716
814
  expected: Q,
717
815
  actual: Q
718
- }) {}, qn = class extends d.TaggedError()("ConnectionHandshakeFailed", {
719
- connectionId: d.String,
720
- reason: d.String,
721
- transient: d.Boolean
722
- }) {}, $ = d.Union(Wn, Gn, Kn, qn), Jn = z({
723
- name: Rn,
816
+ }) {}, $n = class extends p.TaggedError()("ConnectionHandshakeFailed", {
817
+ connectionId: p.String,
818
+ reason: p.String,
819
+ transient: p.Boolean
820
+ }) {}, $ = p.Union(Xn, Zn, Qn, $n), er = z({
821
+ name: Wn,
724
822
  source: "_voltro_connections",
725
- input: d.Struct({}),
726
- output: d.Array(Un),
823
+ input: p.Struct({}),
824
+ output: p.Array(Yn),
727
825
  openAccess: "self-scoped read: projects the declared connections for the calling subject only (its own connect/disconnect state)"
728
- }), Yn = V({
729
- name: zn,
730
- input: d.Struct({
731
- connectionId: d.String,
732
- redirectTo: d.optional(d.String)
826
+ }), tr = V({
827
+ name: Gn,
828
+ input: p.Struct({
829
+ connectionId: p.String,
830
+ redirectTo: p.optional(p.String)
733
831
  }),
734
- output: d.Struct({
735
- authorizeUrl: d.String,
736
- state: d.String
832
+ output: p.Struct({
833
+ authorizeUrl: p.String,
834
+ state: p.String
737
835
  }),
738
836
  error: $,
739
837
  openAccess: "self-service: begins an oauth handshake that stores a credential for the calling subject only; anonymous callers fail typed with ConnectionSubjectRequired"
740
- }), Xn = B({
741
- name: Bn,
742
- input: d.Struct({
743
- connectionId: d.String,
744
- token: d.String
838
+ }), nr = B({
839
+ name: Kn,
840
+ input: p.Struct({
841
+ connectionId: p.String,
842
+ token: p.String
745
843
  }),
746
- output: d.Struct({ ok: d.Boolean }),
844
+ output: p.Struct({ ok: p.Boolean }),
747
845
  error: $,
748
846
  openAccess: "self-service: stores a pasted token as the calling subject's own credential; anonymous callers fail typed with ConnectionSubjectRequired"
749
- }), Zn = B({
750
- name: Vn,
751
- input: d.Struct({ connectionId: d.String }),
752
- output: d.Struct({ ok: d.Boolean }),
847
+ }), rr = B({
848
+ name: qn,
849
+ input: p.Struct({ connectionId: p.String }),
850
+ output: p.Struct({ ok: p.Boolean }),
753
851
  error: $,
754
852
  openAccess: "self-service: deletes only the calling subject's own credential row for this connection"
755
- }), Qn = (e) => {
853
+ }), ir = (e) => {
756
854
  let t = e instanceof Date ? e.getTime() : typeof e == "number" ? e : typeof e == "string" ? new Date(e).getTime() : 0;
757
855
  return Number.isNaN(t) ? 0 : t;
758
- }, $n = 1;
856
+ }, ar = 4001, or = /* @__PURE__ */ new Set(["/rpc", "/ws"]), sr = (e) => {
857
+ if (!e.path.startsWith("/")) throw Error(`defineWebSocket: path must be absolute, got '${e.path}'`);
858
+ if (or.has(e.path)) throw Error(`defineWebSocket: '${e.path}' is the framework's own socket surface — mount the gateway elsewhere`);
859
+ if (e.auth !== "subject" && e.auth !== "public") throw Error(`defineWebSocket: auth must be 'subject' or 'public' (explicitly — an unauthenticated socket has to be a decision somebody wrote down), got '${String(e.auth)}'`);
860
+ return e;
861
+ }, cr = 1;
759
862
  //#endregion
760
- export { Oe as ADMIN_SCOPE, Ce as APIKEY_ISSUE_ORG_SCOPE, Ee as APIKEY_ISSUE_OTHER_SCOPE, ve as APIKEY_ISSUE_SELF_SCOPE, Z as APPROVALS_DECIDE_TAG, Fn as APPROVALS_PENDING_TAG, j as ApprovalDecisionErrors, A as ApprovalErrors, E as ApprovalExpired, O as ApprovalForbidden, C as ApprovalNotFound, D as ApprovalNotPending, T as ApprovalRejected, S as ApprovalRequired, w as ApprovalSelfApproval, k as ApprovalUnavailable, Ae as AuthMiddleware, x as BusinessRuleViolation, Rn as CONNECTIONS_LIST_TAG, Vn as CONNECTION_DISCONNECT_TAG, zn as CONNECTION_START_TAG, Bn as CONNECTION_SUBMIT_TOKEN_TAG, qn as ConnectionHandshakeFailed, ce as ConnectionInfo, i as ConnectionInfoMiddleware, Q as ConnectionKind, Kn as ConnectionKindMismatch, Wn as ConnectionNotDeclared, Un as ConnectionState, Hn as ConnectionStatus, Gn as ConnectionSubjectRequired, Pn as ConstraintViolation, r as DEFAULT_SCOPE_CACHE_MAX_ENTRIES, ie as DEFAULT_SCOPE_CACHE_TTL_MS, It as EVENT_ROUTE_SEP, Nt as EventKeyInvalid, Mt as EventPayloadInvalid, Pt as EventPayloadTooLarge, be as IMPERSONATION_METADATA_KEY, St as MAX_EVENT_ENVELOPE_BYTES, $n as PROTOCOL_VERSION, M as PendingApproval, N as REACTIVITY_CHANNEL_PREFIX, c as ScopeError, Nn as ServerOnlyColumnWrite, An as StoreOperationFailed, e as Subject, ye as SubjectIdentity, re as SubjectService, jn as TableValidationFailed, Mn as TenantRowNotFound, kn as TenantScopeViolation, yn as UNDO_APPLY_TAG, vn as UNDO_LOG_TAG, bn as UNDO_REDO_TAG, s as Unauthenticated, wn as UndoConflict, Cn as UndoForbidden, xn as UndoLogEntry, Sn as UndoNotFound, X as WorkflowControlInputSchema, $t as WorkflowDomainEventRowSchema, nn as WorkflowDomainEventsInputSchema, rn as WorkflowEventDeliveriesInputSchema, en as WorkflowEventDeliveryRowSchema, qt as WorkflowParentClosePolicySchema, Qt as WorkflowRunEventRowSchema, Yt as WorkflowRunHandleSchema, tn as WorkflowRunRefSchema, J as WorkflowRunRowSchema, q as WorkflowRunStatusSchema, Zt as WorkflowRunStepRowSchema, Y as WorkflowRunTableRefSchema, Xt as WorkflowRunsInputSchema, an as WorkflowSignalInputSchema, Jt as WorkflowStartDeferralSchema, on as WorkflowUpdateInputSchema, sn as WorkflowUpdateResultSchema, _t as actionToRpc, we as advisoryResourceGuardWarning, ae as anonymousSubject, Ye as applyRowPatch, a as applyScopeDecision, Ln as approvalsDecideDescriptor, In as approvalsPendingQueryDescriptor, te as assertAuthenticated, ze as beginIdempotent, Gt as checkFrameworkCompat, De as checkGuards, me as checkGuardsEffect, ne as composeAuthStrategies, Ut as composeRpcInterceptors, Zn as connectionDisconnectDescriptor, Yn as connectionStartDescriptor, Xn as connectionSubmitTokenDescriptor, Jn as connectionsListQueryDescriptor, nt as declaredReactivityChannelKeys, V as defineAction, wt as defineEvent, B as defineMutation, Bt as definePlugin, Vt as definePluginRoute, Wt as definePluginService, z as defineQuery, dt as defineStream, qe as diffRows, xe as effectiveScopes, Ft as encodeEventKey, yt as errorTag, Dt as eventAttached, Tt as eventEnvelope, Et as eventGap, kt as eventResumePoint, Lt as eventRoute, Ot as eventStreamEvent, At as eventSubscribeInput, jt as eventToRpc, Ie as failIdempotent, ke as findAdvisoryResourceGuards, Pe as finishIdempotent, zt as formatEventRoute, he as getPolicyGuardResolver, ge as getResourceScopeResolver, ut as hasAccessDecision, oe as hasCallbackRoutes, Te as hasEffectiveScope, U as hasEnforcedGuard, Se as hasScope, g as idToPath, Re as idempotencyScope, y as inputLabel, Ct as isEventDescriptor, Je as isIdKeyed, l as isOpenAccess, _e as isPolicyCheck, lt as isPolicyGuard, et as isReactivityChannel, tt as isReactivityChannelKey, Ne as isSystemSubject, st as isWireReachable, t as makeScopeCache, Be as memoryIdempotencyStore, fe as missingAccessDecision, gt as mutationToRpc, xt as normalizeDescriptor, it as normalizeSource, u as openAccessSpec, Rt as parseEventRoute, Ge as pathToId, Ht as pluginInstanceName, ot as publishReactivity, Ve as publishServerError, ht as queryToRpc, ue as rawImpersonationMark, $e as reactivityChannel, Me as requireScope, m as rowPatchOpSchema, h as rowPatchSchema, ee as scopeCacheKey, pe as setEffectiveScopes, je as setPolicyGuardResolver, se as setResourceScopeResolver, rt as sourceKeys, vt as streamToRpc, b as strictInput, le as subjectIdentity, n as subjectScopes, Le as subscribeServerErrors, v as subscriptionEvent, de as systemSubject, o as tenantScopedSubject, bt as toRpc, Qn as tsMs, at as undeclaredChannelKeys, Dn as undoApplyDescriptor, En as undoLogQueryDescriptor, On as undoRedoDescriptor, W as wireErrorUnion, mn as workflowCancelDescriptor, fn as workflowDomainEventsQueryDescriptor, pn as workflowEventDeliveriesQueryDescriptor, hn as workflowResumeDescriptor, dn as workflowRunEventsQueryDescriptor, cn as workflowRunQueryDescriptor, un as workflowRunStepsQueryDescriptor, ln as workflowRunsQueryDescriptor, gn as workflowSignalDescriptor, _n as workflowUpdateDescriptor, Fe as wsMutationIdempotencyScope };
863
+ export { Ee as ADMIN_SCOPE, xe as APIKEY_ISSUE_ORG_SCOPE, we as APIKEY_ISSUE_OTHER_SCOPE, ge as APIKEY_ISSUE_SELF_SCOPE, Vn as APPROVALS_DECIDE_TAG, Bn as APPROVALS_PENDING_TAG, ot as ApprovalDecisionErrors, at as ApprovalErrors, T as ApprovalExpired, it as ApprovalForbidden, C as ApprovalNotFound, rt as ApprovalNotPending, nt as ApprovalRejected, S as ApprovalRequired, w as ApprovalSelfApproval, E as ApprovalUnavailable, Oe as AuthMiddleware, v as BusinessRuleViolation, Wn as CONNECTIONS_LIST_TAG, qn as CONNECTION_DISCONNECT_TAG, Gn as CONNECTION_START_TAG, Kn as CONNECTION_SUBMIT_TOKEN_TAG, $n as ConnectionHandshakeFailed, oe as ConnectionInfo, i as ConnectionInfoMiddleware, Q as ConnectionKind, Qn as ConnectionKindMismatch, Xn as ConnectionNotDeclared, Yn as ConnectionState, Jn as ConnectionStatus, Zn as ConnectionSubjectRequired, zn as ConstraintViolation, r as DEFAULT_SCOPE_CACHE_MAX_ENTRIES, ne as DEFAULT_SCOPE_CACHE_TTL_MS, Vt as EVENT_ROUTE_SEP, Rt as EventKeyInvalid, Lt as EventPayloadInvalid, zt as EventPayloadTooLarge, ar as GATEWAY_CREDENTIAL_EXPIRED_CLOSE_CODE, ve as IMPERSONATION_METADATA_KEY, Ot as MAX_EVENT_ENVELOPE_BYTES, cr as PROTOCOL_VERSION, st as PendingApproval, D as REACTIVITY_CHANNEL_PREFIX, u as ScopeError, Rn as ServerOnlyColumnWrite, Fn as StoreOperationFailed, e as Subject, _e as SubjectIdentity, te as SubjectService, In as TableValidationFailed, Ln as TenantRowNotFound, Pn as TenantScopeViolation, wn as UNDO_APPLY_TAG, Cn as UNDO_LOG_TAG, Tn as UNDO_REDO_TAG, l as Unauthenticated, kn as UndoConflict, On as UndoForbidden, En as UndoLogEntry, Dn as UndoNotFound, b as ValidationError, x as ValidationErrors, y as ValidationIssue, Z as WorkflowControlInputSchema, an as WorkflowDomainEventRowSchema, cn as WorkflowDomainEventsInputSchema, ln as WorkflowEventDeliveriesInputSchema, on as WorkflowEventDeliveryRowSchema, Qt as WorkflowParentClosePolicySchema, rn as WorkflowRunEventRowSchema, en as WorkflowRunHandleSchema, sn as WorkflowRunRefSchema, Y as WorkflowRunRowSchema, J as WorkflowRunStatusSchema, nn as WorkflowRunStepRowSchema, X as WorkflowRunTableRefSchema, tn as WorkflowRunsInputSchema, un as WorkflowSignalInputSchema, $t as WorkflowStartDeferralSchema, dn as WorkflowUpdateInputSchema, fn as WorkflowUpdateResultSchema, Ct as actionToRpc, Se as advisoryResourceGuardWarning, re as anonymousSubject, Ze as applyRowPatch, a as applyScopeDecision, Un as approvalsDecideDescriptor, Hn as approvalsPendingQueryDescriptor, c as assertAuthenticated, Le as beginIdempotent, Xt as checkFrameworkCompat, Te as checkGuards, fe as checkGuardsEffect, ee as composeAuthStrategies, Jt as composeRpcInterceptors, rr as connectionDisconnectDescriptor, tr as connectionStartDescriptor, nr as connectionSubmitTokenDescriptor, er as connectionsListQueryDescriptor, N as declaredReactivityChannelKeys, V as defineAction, At as defineEvent, B as defineMutation, Gt as definePlugin, Kt as definePluginRoute, Yt as definePluginService, z as defineQuery, gt as defineStream, sr as defineWebSocket, Ye as diffRows, ye as effectiveScopes, Bt as encodeEventKey, Tt as errorTag, Nt as eventAttached, jt as eventEnvelope, Mt as eventGap, Ft as eventResumePoint, Ht as eventRoute, Pt as eventStreamEvent, G as eventSubscribeInput, It as eventToRpc, Pe as failIdempotent, tt as fieldIssuesOf, De as findAdvisoryResourceGuards, Me as finishIdempotent, Wt as formatEventRoute, pe as getPolicyGuardResolver, me as getResourceScopeResolver, ht as hasAccessDecision, ie as hasCallbackRoutes, Ce as hasEffectiveScope, U as hasEnforcedGuard, be as hasScope, h as idToPath, Ie as idempotencyScope, $e as inputLabel, kt as isEventDescriptor, Xe as isIdKeyed, d as isOpenAccess, he as isPolicyCheck, mt as isPolicyGuard, j as isReactivityChannel, M as isReactivityChannelKey, je as isSystemSubject, ft as isWireReachable, t as makeScopeCache, Re as memoryIdempotencyStore, ue as missingAccessDecision, St as mutationToRpc, Dt as normalizeDescriptor, I as normalizeSource, f as openAccessSpec, Ut as parseEventRoute, Ke as pathToId, qt as pluginInstanceName, dt as publishReactivity, ze as publishServerError, xt as queryToRpc, ce as rawImpersonationMark, lt as reactivityChannel, Ae as requireScope, We as rowPatchOpSchema, Ge as rowPatchSchema, s as scopeCacheKey, de as setEffectiveScopes, ke as setPolicyGuardResolver, ae as setResourceScopeResolver, F as sourceKeys, wt as streamToRpc, _ as strictInput, se as subjectIdentity, n as subjectScopes, Fe as subscribeServerErrors, Qe as subscriptionEvent, le as systemSubject, o as tenantScopedSubject, Et as toRpc, ir as tsMs, ut as undeclaredChannelKeys, Mn as undoApplyDescriptor, jn as undoLogQueryDescriptor, Nn as undoRedoDescriptor, W as wireErrorUnion, yn as workflowCancelDescriptor, _n as workflowDomainEventsQueryDescriptor, vn as workflowEventDeliveriesQueryDescriptor, bn as workflowResumeDescriptor, gn as workflowRunEventsQueryDescriptor, pn as workflowRunQueryDescriptor, hn as workflowRunStepsQueryDescriptor, mn as workflowRunsQueryDescriptor, xn as workflowSignalDescriptor, Sn as workflowUpdateDescriptor, Ne as wsMutationIdempotencyScope };