@voltro/protocol 0.34.0 → 0.36.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,30 +1,30 @@
1
- import { A as e, B as t, C as n, D as r, E as i, F as a, H as ee, I as te, L as ne, M as re, N as ie, O as ae, P as oe, R as o, S as se, T as s, U as ce, V as le, _ as ue, a as de, b as fe, c as pe, d as me, f as he, g as ge, h as _e, 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 Ae, w as je, x as Me, y as Ne, z as Pe } from "./auth-B6YZuSBr.js";
2
- import { a as Fe, c as Ie, i as Le, n as Re, o as ze, r as Be, s as Ve, t as He } from "./serverErrorBus-BeN9pOpY.js";
3
- import { Context as Ue, Layer as We, Schema as c } from "effect";
4
- import { Rpc as l } from "@effect/rpc";
1
+ import { A as e, B as t, C as n, D as r, E as i, F as a, H as o, I as ee, L as te, M as ne, N as re, O as ie, P as ae, R as s, S as oe, T as c, U as se, V as ce, _ as le, a as ue, b as de, c as fe, d as pe, f as me, g as he, h as ge, i as _e, j as ve, k as ye, l as be, m as xe, n as Se, o as Ce, p as we, r as Te, s as Ee, t as De, u as Oe, v as ke, w as Ae, x as je, y as Me, z as Ne } from "./auth-B6YZuSBr.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 l } from "effect";
4
+ import { Rpc as u } from "@effect/rpc";
5
5
  //#region src/rowPatch.ts
6
- var Ge = c.Union(c.String, c.Number), u = c.Record({
7
- key: c.String,
8
- value: c.Unknown
9
- }).pipe(c.filter((e) => "id" in e, { message: () => "patch row must carry an id" })), d = c.Union(c.Struct({
10
- op: c.Literal("add"),
11
- path: c.String,
12
- value: u
13
- }), c.Struct({
14
- op: c.Literal("replace"),
15
- path: c.String,
16
- value: u
17
- }), c.Struct({
18
- op: c.Literal("remove"),
19
- path: c.String
20
- })), f = c.Struct({
21
- ops: c.Array(d),
22
- order: c.Array(Ge)
23
- }), p = (e) => `/${String(e).replace(/~/g, "~0").replace(/\//g, "~1")}`, Ke = (e) => (e.startsWith("/") ? e.slice(1) : e).replace(/~1/g, "/").replace(/~0/g, "~"), m = (e) => {
6
+ var We = l.Union(l.String, l.Number), d = l.Record({
7
+ key: l.String,
8
+ value: l.Unknown
9
+ }).pipe(l.filter((e) => "id" in e, { message: () => "patch row must carry an id" })), f = l.Union(l.Struct({
10
+ op: l.Literal("add"),
11
+ path: l.String,
12
+ value: d
13
+ }), l.Struct({
14
+ op: l.Literal("replace"),
15
+ path: l.String,
16
+ value: d
17
+ }), l.Struct({
18
+ op: l.Literal("remove"),
19
+ path: l.String
20
+ })), p = l.Struct({
21
+ ops: l.Array(f),
22
+ order: l.Array(We)
23
+ }), m = (e) => `/${String(e).replace(/~/g, "~0").replace(/\//g, "~1")}`, Ge = (e) => (e.startsWith("/") ? e.slice(1) : e).replace(/~1/g, "/").replace(/~0/g, "~"), h = (e) => {
24
24
  let t = Object.keys(e).sort(), n = {};
25
25
  for (let r of t) n[r] = e[r];
26
26
  return JSON.stringify(n);
27
- }, qe = (e, t) => m(e) === m(t), Je = (e, t) => {
27
+ }, Ke = (e, t) => h(e) === h(t), qe = (e, t) => {
28
28
  let n = /* @__PURE__ */ new Map();
29
29
  for (let t of e) n.set(t.id, t);
30
30
  let r = [], i = [], a = /* @__PURE__ */ new Set();
@@ -33,26 +33,26 @@ var Ge = c.Union(c.String, c.Number), u = c.Record({
33
33
  let t = n.get(e.id);
34
34
  t === void 0 ? r.push({
35
35
  op: "add",
36
- path: p(e.id),
36
+ path: m(e.id),
37
37
  value: e
38
- }) : qe(t, e) || r.push({
38
+ }) : Ke(t, e) || r.push({
39
39
  op: "replace",
40
- path: p(e.id),
40
+ path: m(e.id),
41
41
  value: e
42
42
  });
43
43
  }
44
44
  for (let t of e) a.has(t.id) || r.push({
45
45
  op: "remove",
46
- path: p(t.id)
46
+ path: m(t.id)
47
47
  });
48
48
  return {
49
49
  ops: r,
50
50
  order: i
51
51
  };
52
- }, Ye = (e) => e.every((e) => {
52
+ }, Je = (e) => e.every((e) => {
53
53
  let t = e.id;
54
54
  return typeof t == "string" || typeof t == "number";
55
- }), Xe = (e, t) => {
55
+ }), Ye = (e, t) => {
56
56
  let n = /* @__PURE__ */ new Map();
57
57
  for (let t of e) n.set(t.id, t);
58
58
  for (let e of t.ops) (e.op === "add" || e.op === "replace") && n.set(e.value.id, e.value);
@@ -62,87 +62,87 @@ var Ge = c.Union(c.String, c.Number), u = c.Record({
62
62
  t !== void 0 && r.push(t);
63
63
  }
64
64
  return r;
65
- }, h = (e) => c.Union(c.Struct({
66
- _tag: c.Literal("snapshot"),
67
- revision: c.Number,
65
+ }, g = (e) => l.Union(l.Struct({
66
+ _tag: l.Literal("snapshot"),
67
+ revision: l.Number,
68
68
  data: e,
69
- computed: c.optional(c.Boolean)
70
- }), c.Struct({
71
- _tag: c.Literal("delta"),
72
- revision: c.Number,
73
- emittedAt: c.Number,
74
- patch: f
75
- }), c.Struct({
76
- _tag: c.Literal("error"),
77
- error: c.Unknown,
78
- revision: c.optional(c.Number)
79
- })), g = class extends c.TaggedError()("BusinessRuleViolation", {
80
- rule: c.String,
81
- params: c.optional(c.Record({
82
- key: c.String,
83
- value: c.Unknown
69
+ computed: l.optional(l.Boolean)
70
+ }), l.Struct({
71
+ _tag: l.Literal("delta"),
72
+ revision: l.Number,
73
+ emittedAt: l.Number,
74
+ patch: p
75
+ }), l.Struct({
76
+ _tag: l.Literal("error"),
77
+ error: l.Unknown,
78
+ revision: l.optional(l.Number)
79
+ })), _ = class extends l.TaggedError()("BusinessRuleViolation", {
80
+ rule: l.String,
81
+ params: l.optional(l.Record({
82
+ key: l.String,
83
+ value: l.Unknown
84
84
  })),
85
- field: c.optional(c.String),
86
- message: c.optional(c.String),
87
- severity: c.Literal("error", "warning")
88
- }) {}, _ = class extends c.TaggedError()("ApprovalRequired", {
89
- approvalId: c.String,
90
- procedure: c.String,
91
- expiresAt: c.String,
92
- requiredScopes: c.Array(c.String),
93
- reason: c.NullOr(c.String),
94
- created: c.Boolean
95
- }) {}, v = class extends c.TaggedError()("ApprovalNotFound", { approvalId: c.String }) {}, y = class extends c.TaggedError()("ApprovalSelfApproval", {
96
- approvalId: c.String,
97
- subjectId: c.NullOr(c.String)
98
- }) {}, b = class extends c.TaggedError()("ApprovalRejected", {
99
- approvalId: c.String,
100
- decidedBy: c.NullOr(c.String),
101
- note: c.NullOr(c.String)
102
- }) {}, x = class extends c.TaggedError()("ApprovalExpired", {
103
- approvalId: c.String,
104
- expiredAt: c.String
105
- }) {}, S = class extends c.TaggedError()("ApprovalNotPending", {
106
- approvalId: c.String,
107
- status: c.String
108
- }) {}, C = class extends c.TaggedError()("ApprovalForbidden", {
109
- approvalId: c.String,
110
- required: c.NullOr(c.String),
111
- message: c.String
112
- }) {}, w = class extends c.TaggedError()("ApprovalUnavailable", {
113
- procedure: c.String,
114
- message: c.String
115
- }) {}, T = c.Union(_, b, x, w), E = c.Union(v, y, x, S, C, w), D = c.Struct({
116
- id: c.String,
117
- procedure: c.String,
118
- kind: c.Literal("mutation", "action"),
119
- requestedBy: c.NullOr(c.String),
120
- status: c.Literal("pending", "approved", "rejected", "expired", "consumed"),
121
- reason: c.NullOr(c.String),
122
- requiredScopes: c.Array(c.String),
123
- requestedAt: c.String,
124
- expiresAt: c.String,
125
- decidedBy: c.NullOr(c.String),
126
- decidedAt: c.NullOr(c.String),
127
- note: c.NullOr(c.String),
128
- relation: c.Literal("to-decide", "requested")
129
- }), O = "channel:", k = Symbol.for("@voltro/protocol/reactivityChannels"), A = globalThis, j = A[k] ?? (A[k] = /* @__PURE__ */ new Map()), Ze = /^[a-z][a-z0-9-]*(\.[a-z0-9-]+)*$/, Qe = (e) => {
130
- if (!Ze.test(e)) throw Error(`reactivityChannel('${e}'): invalid channel name.\n Use lowercase kebab segments separated by dots — \`presence\`, \`job-queue\`,
85
+ field: l.optional(l.String),
86
+ message: l.optional(l.String),
87
+ severity: l.Literal("error", "warning")
88
+ }) {}, v = class extends l.TaggedError()("ApprovalRequired", {
89
+ approvalId: l.String,
90
+ procedure: l.String,
91
+ expiresAt: l.String,
92
+ requiredScopes: l.Array(l.String),
93
+ reason: l.NullOr(l.String),
94
+ created: l.Boolean
95
+ }) {}, y = class extends l.TaggedError()("ApprovalNotFound", { approvalId: l.String }) {}, b = class extends l.TaggedError()("ApprovalSelfApproval", {
96
+ approvalId: l.String,
97
+ subjectId: l.NullOr(l.String)
98
+ }) {}, x = class extends l.TaggedError()("ApprovalRejected", {
99
+ approvalId: l.String,
100
+ decidedBy: l.NullOr(l.String),
101
+ note: l.NullOr(l.String)
102
+ }) {}, S = class extends l.TaggedError()("ApprovalExpired", {
103
+ approvalId: l.String,
104
+ expiredAt: l.String
105
+ }) {}, C = class extends l.TaggedError()("ApprovalNotPending", {
106
+ approvalId: l.String,
107
+ status: l.String
108
+ }) {}, w = class extends l.TaggedError()("ApprovalForbidden", {
109
+ approvalId: l.String,
110
+ required: l.NullOr(l.String),
111
+ message: l.String
112
+ }) {}, T = class extends l.TaggedError()("ApprovalUnavailable", {
113
+ procedure: l.String,
114
+ message: l.String
115
+ }) {}, E = l.Union(v, x, S, T), D = l.Union(y, b, S, C, w, T), O = l.Struct({
116
+ id: l.String,
117
+ procedure: l.String,
118
+ kind: l.Literal("mutation", "action"),
119
+ requestedBy: l.NullOr(l.String),
120
+ status: l.Literal("pending", "approved", "rejected", "expired", "consumed"),
121
+ reason: l.NullOr(l.String),
122
+ requiredScopes: l.Array(l.String),
123
+ requestedAt: l.String,
124
+ expiresAt: l.String,
125
+ decidedBy: l.NullOr(l.String),
126
+ decidedAt: l.NullOr(l.String),
127
+ note: l.NullOr(l.String),
128
+ relation: l.Literal("to-decide", "requested")
129
+ }), k = "channel:", A = Symbol.for("@voltro/protocol/reactivityChannels"), j = globalThis, M = j[A] ?? (j[A] = /* @__PURE__ */ new Map()), Xe = /^[a-z][a-z0-9-]*(\.[a-z0-9-]+)*$/, Ze = (e) => {
130
+ if (!Xe.test(e)) throw Error(`reactivityChannel('${e}'): invalid channel name.\n Use lowercase kebab segments separated by dots — \`presence\`, \`job-queue\`,
131
131
  \`billing.usage\`. A \`:\` is refused because it is the namespace separator in
132
- the routing key (\`${O}<name>\`), and an uppercase letter is\n refused because a key that differs only by case reads as one channel and
132
+ the routing key (\`${k}<name>\`), and an uppercase letter is\n refused because a key that differs only by case reads as one channel and
133
133
  routes as two.`);
134
- let t = j.get(e);
134
+ let t = M.get(e);
135
135
  if (t !== void 0) return t;
136
- let n = `${O}${e}`, r = Object.freeze({
136
+ let n = `${k}${e}`, r = Object.freeze({
137
137
  kind: "reactivity-channel",
138
138
  name: e,
139
139
  key: n,
140
140
  toString: () => n
141
141
  });
142
- return j.set(e, r), r;
143
- }, M = (e) => typeof e == "object" && !!e && e.kind === "reactivity-channel", N = (e) => e.startsWith(O), P = () => new Set([...j.values()].map((e) => e.key)), F = (e) => M(e) ? e.key : e, I = (e) => e === void 0 ? [] : Array.isArray(e) ? e.map(F) : [F(e)], L = (e) => e === void 0 ? void 0 : Array.isArray(e) ? e.map(F) : F(e), $e = (e) => {
144
- let t = P(), n = [];
145
- for (let r of e) for (let e of I(r.source)) !N(e) || t.has(e) || n.push({
142
+ return M.set(e, r), r;
143
+ }, N = (e) => typeof e == "object" && !!e && e.kind === "reactivity-channel", P = (e) => e.startsWith(k), F = () => new Set([...M.values()].map((e) => e.key)), I = (e) => N(e) ? e.key : e, L = (e) => e === void 0 ? [] : Array.isArray(e) ? e.map(I) : [I(e)], Qe = (e) => e === void 0 ? void 0 : Array.isArray(e) ? e.map(I) : I(e), $e = (e) => {
144
+ let t = F(), n = [];
145
+ for (let r of e) for (let e of L(r.source)) !P(e) || t.has(e) || n.push({
146
146
  procedure: r.name,
147
147
  key: e
148
148
  });
@@ -153,7 +153,8 @@ var Ge = c.Union(c.String, c.Number), u = c.Record({
153
153
  table: t.key,
154
154
  op: "update",
155
155
  new: {},
156
- old: {}
156
+ old: {},
157
+ origin: "inline"
157
158
  }), !0);
158
159
  }, tt = (e) => e.internal !== !0, R = (e) => {
159
160
  if (nt(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
@@ -189,14 +190,14 @@ var Ge = c.Union(c.String, c.Number), u = c.Record({
189
190
  without an authorization check — e.g. \`openAccess: 'public pricing, no caller data'\`.`);
190
191
  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
191
192
  caller must hold a scope; drop them if anyone may call it.`);
192
- return [o(n.trim())];
193
+ return [s(n.trim())];
193
194
  }, B = (e) => R({
194
195
  kind: "query",
195
196
  name: e.name,
196
197
  input: e.input,
197
198
  output: e.output,
198
- error: e.error ?? c.Never,
199
- source: L(e.source),
199
+ error: e.error ?? l.Never,
200
+ source: Qe(e.source),
200
201
  cache: e.cache,
201
202
  guards: z(e.name, e.guards, e.openAccess),
202
203
  openAccess: e.openAccess,
@@ -209,7 +210,7 @@ var Ge = c.Union(c.String, c.Number), u = c.Record({
209
210
  name: e.name,
210
211
  input: e.input,
211
212
  output: e.output,
212
- error: e.error ?? c.Never,
213
+ error: e.error ?? l.Never,
213
214
  target: e.target,
214
215
  guards: z(e.name, e.guards, e.openAccess),
215
216
  openAccess: e.openAccess,
@@ -223,7 +224,7 @@ var Ge = c.Union(c.String, c.Number), u = c.Record({
223
224
  name: e.name,
224
225
  input: e.input,
225
226
  output: e.output,
226
- error: e.error ?? c.Never,
227
+ error: e.error ?? l.Never,
227
228
  guards: z(e.name, e.guards, e.openAccess),
228
229
  openAccess: e.openAccess,
229
230
  source: e.source,
@@ -238,25 +239,25 @@ var Ge = c.Union(c.String, c.Number), u = c.Record({
238
239
  name: e.name,
239
240
  input: e.input,
240
241
  element: e.element,
241
- error: e.error ?? c.Never,
242
+ error: e.error ?? l.Never,
242
243
  internal: e.internal,
243
244
  overridesPlugin: e.overridesPlugin,
244
245
  guards: z(e.name, e.guards, e.openAccess),
245
246
  openAccess: e.openAccess
246
- }), U = (e, t) => t && t.length > 0 ? c.Union(e, ...t) : e, W = (e, t) => t && t.some((e) => !a(e)) ? c.Union(e, s) : e, ot = (e) => c.Union(e, g), st = (e, t) => t === void 0 ? e : c.Union(e, T), ct = (e, t) => l.make(e.name, {
247
+ }), U = (e, t) => t && t.length > 0 ? l.Union(e, ...t) : e, W = (e, t) => t && t.some((e) => !a(e)) ? l.Union(e, c) : e, ot = (e) => l.Union(e, _), st = (e, t) => t === void 0 ? e : l.Union(e, E), ct = (e, t) => u.make(e.name, {
247
248
  payload: e.input,
248
- success: h(e.output),
249
+ success: g(e.output),
249
250
  error: U(W(e.error, e.guards), t),
250
251
  stream: !0
251
- }), lt = (e, t) => l.make(e.name, {
252
+ }), lt = (e, t) => u.make(e.name, {
252
253
  payload: e.input,
253
254
  success: e.output,
254
255
  error: U(st(ot(W(e.error, e.guards)), e.requiresApproval), t)
255
- }), ut = (e, t) => l.make(e.name, {
256
+ }), ut = (e, t) => u.make(e.name, {
256
257
  payload: e.input,
257
258
  success: e.output,
258
259
  error: U(st(W(e.error, e.guards), e.requiresApproval), t)
259
- }), dt = (e, t) => l.make(e.name, {
260
+ }), dt = (e, t) => u.make(e.name, {
260
261
  payload: e.input,
261
262
  success: e.element,
262
263
  error: U(e.error, t),
@@ -296,12 +297,12 @@ var Ge = c.Union(c.String, c.Number), u = c.Record({
296
297
  ...n,
297
298
  ...i
298
299
  };
299
- let ee = Array.isArray(a) ? a : [a];
300
+ let o = Array.isArray(a) ? a : [a];
300
301
  return {
301
302
  kind: "mutation",
302
303
  ...n,
303
304
  ...i,
304
- targets: ee.map((e) => ({
305
+ targets: o.map((e) => ({
305
306
  table: e.table,
306
307
  op: e.op,
307
308
  ..."order" in e && e.order !== void 0 ? { order: e.order } : {},
@@ -321,6 +322,13 @@ var Ge = c.Union(c.String, c.Number), u = c.Record({
321
322
  Use a dot for namespacing: "orders.paid".`);
322
323
  if (e.guards !== void 0 && e.guards.length === 0) throw Error(`defineEvent("${e.name}"): \`guards: []\` is empty, so it enforces nothing —\n but it reads at the call site as if the event were protected. Omit the field
323
324
  for an unguarded event, or list the scopes that may subscribe.`);
325
+ if (e.openAccess !== void 0) {
326
+ if (e.openAccess.trim() === "") throw Error(`defineEvent("${e.name}"): \`openAccess\` needs a REASON, not an empty string. It is\n the sentence a reviewer reads to decide whether anyone should really be able to
327
+ subscribe without an authorization check — e.g. \`openAccess: 'public scoreboard,
328
+ no caller data'\`.`);
329
+ if (e.guards !== void 0 && e.guards.length > 0) throw Error(`defineEvent("${e.name}"): \`openAccess\` and \`guards\` are two different access\n decisions, so declaring both says the event is protected AND open. Keep the guards
330
+ if a subscriber must hold a scope; drop them if anyone may listen.`);
331
+ }
324
332
  if (e.webhook?.rateLimit !== void 0 && e.webhook.rateLimit.perMinute < 1) throw Error(`defineEvent("${e.name}"): \`webhook.rateLimit.perMinute\` is ${e.webhook.rateLimit.perMinute}, which defers every delivery forever.\n There is no "unlimited" spelling here — omit \`rateLimit\` for no ceiling.`);
325
333
  if (e.webhook?.version !== void 0 && e.webhook.version < 1) throw Error(`defineEvent("${e.name}"): \`webhook.version\` must be >= 1 (default 1).\n A subscriber pinned to 1 would read this event as BEHIND its own version,
326
334
  which is the opposite of what a version bump is for.`);
@@ -335,45 +343,46 @@ var Ge = c.Union(c.String, c.Number), u = c.Record({
335
343
  name: e.name,
336
344
  key: e.key,
337
345
  payload: e.payload,
338
- guards: e.guards,
346
+ guards: e.openAccess === void 0 ? e.guards : [s(e.openAccess.trim())],
347
+ openAccess: e.openAccess,
339
348
  rewind: e.rewind,
340
349
  webhook: e.webhook,
341
350
  delivery: e.delivery
342
351
  };
343
- }, vt = (e) => c.Struct({
344
- _tag: c.Literal("event"),
345
- origin: c.String,
346
- n: c.Number,
347
- emittedAt: c.Number,
352
+ }, vt = (e) => l.Struct({
353
+ _tag: l.Literal("event"),
354
+ origin: l.String,
355
+ n: l.Number,
356
+ emittedAt: l.Number,
348
357
  payload: e
349
- }), yt = c.Struct({
350
- _tag: c.Literal("gap"),
351
- missed: c.Number,
352
- reason: c.Literal("buffer", "resume")
353
- }), bt = c.Struct({ _tag: c.Literal("attached") }), xt = (e) => c.Union(bt, vt(e), yt), G = c.Struct({
354
- origin: c.String,
355
- n: c.Number
356
- }), St = (e) => c.Struct({
358
+ }), yt = l.Struct({
359
+ _tag: l.Literal("gap"),
360
+ missed: l.Number,
361
+ reason: l.Literal("buffer", "resume")
362
+ }), bt = l.Struct({ _tag: l.Literal("attached") }), xt = (e) => l.Union(bt, vt(e), yt), G = l.Struct({
363
+ origin: l.String,
364
+ n: l.Number
365
+ }), St = (e) => l.Struct({
357
366
  key: e,
358
- resume: c.optional(c.Array(G))
367
+ resume: l.optional(l.Array(G))
359
368
  }), Ct = (e, t) => {
360
- let n = e.guards && e.guards.length > 0 ? s : c.Never, r = t && t.length > 0 ? c.Union(n, ...t) : n;
361
- return l.make(e.name, {
369
+ let n = e.guards !== void 0 && e.guards.some((e) => !a(e)) ? c : l.Never, r = t && t.length > 0 ? l.Union(n, ...t) : n;
370
+ return u.make(e.name, {
362
371
  payload: St(e.key),
363
372
  success: xt(e.payload),
364
373
  error: r,
365
374
  stream: !0
366
375
  });
367
- }, wt = class extends c.TaggedError()("EventPayloadInvalid", {
368
- event: c.String,
369
- message: c.String
370
- }) {}, Tt = class extends c.TaggedError()("EventKeyInvalid", {
371
- event: c.String,
372
- message: c.String
373
- }) {}, Et = class extends c.TaggedError()("EventPayloadTooLarge", {
374
- event: c.String,
375
- bytes: c.Number,
376
- limit: c.Number
376
+ }, wt = class extends l.TaggedError()("EventPayloadInvalid", {
377
+ event: l.String,
378
+ message: l.String
379
+ }) {}, Tt = class extends l.TaggedError()("EventKeyInvalid", {
380
+ event: l.String,
381
+ message: l.String
382
+ }) {}, Et = class extends l.TaggedError()("EventPayloadTooLarge", {
383
+ event: l.String,
384
+ bytes: l.Number,
385
+ limit: l.Number
377
386
  }) {}, Dt = (e) => {
378
387
  if (typeof e != "object" || !e) return JSON.stringify(e) ?? "null";
379
388
  let t = Object.entries(e).filter(([, e]) => e !== void 0).sort(([e], [t]) => e < t ? -1 : +(e > t));
@@ -395,10 +404,10 @@ var Ge = c.Union(c.String, c.Number), u = c.Record({
395
404
  }, Ft = (e) => {
396
405
  if (e.length !== 0) return (t, n) => e.reduceRight((e, t) => t(e, n), t);
397
406
  }, It = (e, t) => {
398
- let n = Ue.GenericTag(e);
407
+ let n = He.GenericTag(e);
399
408
  return {
400
409
  Tag: n,
401
- Live: We.succeed(n, t)
410
+ Live: Ue.succeed(n, t)
402
411
  };
403
412
  }, Lt = (e, t, n) => {
404
413
  if (!t) return { ok: !0 };
@@ -445,246 +454,253 @@ var Ge = c.Union(c.String, c.Number), u = c.Record({
445
454
  }
446
455
  let r = K(e);
447
456
  return r ? q(t, r) === 0 : !1;
448
- }, J = c.Literal("running", "succeeded", "failed", "cancelled", "suspended"), zt = c.Literal("cancel", "terminate", "abandon"), Bt = c.Struct({
449
- mode: c.String,
450
- dueAt: c.NullOr(c.Number),
451
- retryAfterMs: c.NullOr(c.Number),
452
- intentId: c.NullOr(c.String)
453
- }), Vt = c.Struct({
454
- id: c.String,
455
- workflowName: c.String,
456
- executionId: c.NullOr(c.String),
457
- status: c.Literal("running", "queued", "dropped", "skipped"),
458
- deferral: c.optional(Bt)
459
- }), Y = c.Struct({
460
- id: c.String,
461
- tag: c.String,
462
- executionId: c.String,
457
+ }, J = l.Literal("running", "succeeded", "failed", "cancelled", "suspended"), zt = l.Literal("cancel", "terminate", "abandon"), Bt = l.Struct({
458
+ mode: l.String,
459
+ dueAt: l.NullOr(l.Number),
460
+ retryAfterMs: l.NullOr(l.Number),
461
+ intentId: l.NullOr(l.String)
462
+ }), Vt = l.Struct({
463
+ id: l.String,
464
+ workflowName: l.String,
465
+ executionId: l.NullOr(l.String),
466
+ status: l.Literal("running", "queued", "dropped", "skipped"),
467
+ deferral: l.optional(Bt)
468
+ }), Y = l.Struct({
469
+ id: l.String,
470
+ tag: l.String,
471
+ executionId: l.String,
463
472
  status: J,
464
- payload: c.Unknown,
465
- workflowVersion: c.NullOr(c.String),
466
- workflowPatches: c.NullOr(c.Unknown),
467
- output: c.NullOr(c.Unknown),
468
- subject: c.NullOr(c.Unknown),
469
- source: c.NullOr(c.String),
470
- errorTag: c.NullOr(c.String),
471
- errorMessage: c.NullOr(c.String),
472
- cancelled: c.Boolean,
473
- startedAt: c.Date,
474
- completedAt: c.NullOr(c.Date),
475
- durationMs: c.NullOr(c.Number),
476
- traceId: c.NullOr(c.String),
477
- parentExecutionId: c.NullOr(c.String),
478
- parentClosePolicy: c.NullOr(zt)
479
- }), Ht = c.Struct({
480
- tag: c.optional(c.String),
481
- status: c.optional(J),
482
- limit: c.optional(c.Number)
483
- }), Ut = c.Struct({
484
- id: c.String,
485
- runId: c.String,
486
- stepName: c.String,
487
- attempt: c.Number,
488
- status: c.Literal("running", "succeeded", "failed"),
489
- input: c.NullOr(c.Unknown),
490
- retryPolicy: c.NullOr(c.Unknown),
491
- output: c.NullOr(c.Unknown),
492
- errorTag: c.NullOr(c.String),
493
- errorMessage: c.NullOr(c.String),
494
- errorCause: c.NullOr(c.Unknown),
495
- startedAt: c.Date,
496
- completedAt: c.NullOr(c.Date),
497
- durationMs: c.NullOr(c.Number)
498
- }), Wt = c.Struct({
499
- id: c.String,
500
- runId: c.String,
501
- eventType: c.String,
502
- payload: c.NullOr(c.Unknown),
503
- occurredAt: c.Date,
504
- stepName: c.NullOr(c.String),
505
- attempt: c.NullOr(c.Number)
506
- }), Gt = c.Struct({
507
- id: c.String,
508
- name: c.String,
509
- payload: c.Unknown,
510
- source: c.String,
511
- subject: c.NullOr(c.Unknown),
512
- traceId: c.NullOr(c.String),
513
- occurredAt: c.Date
514
- }), Kt = c.Struct({
515
- id: c.String,
516
- eventId: c.String,
517
- eventName: c.String,
518
- triggerId: c.String,
519
- workflowName: c.String,
520
- executionId: c.NullOr(c.String),
521
- status: c.Literal("starting", "started", "skipped", "failed"),
522
- idempotencyKey: c.String,
523
- skipped: c.Boolean,
524
- errorMessage: c.NullOr(c.String),
525
- createdAt: c.Date,
526
- completedAt: c.NullOr(c.Date)
527
- }), qt = c.Struct({ id: c.String }), X = c.Struct({ runId: c.String }), Jt = c.Struct({
528
- name: c.optional(c.String),
529
- limit: c.optional(c.Number)
530
- }), Yt = c.Struct({ eventId: c.String }), Z = c.Struct({
531
- workflowName: c.String,
532
- executionId: c.String
533
- }), Xt = c.Struct({
534
- id: c.String,
535
- signalName: c.String,
536
- payload: c.optional(c.Unknown)
537
- }), Zt = c.Struct({
538
- id: c.String,
539
- updateName: c.String,
540
- payload: c.optional(c.Unknown),
541
- timeoutMs: c.optional(c.Number)
542
- }), Qt = c.Struct({
543
- eventId: c.String,
544
- updateId: c.String,
545
- completedEventId: c.String,
546
- result: c.Unknown
473
+ payload: l.Unknown,
474
+ workflowVersion: l.NullOr(l.String),
475
+ workflowPatches: l.NullOr(l.Unknown),
476
+ output: l.NullOr(l.Unknown),
477
+ subject: l.NullOr(l.Unknown),
478
+ source: l.NullOr(l.String),
479
+ errorTag: l.NullOr(l.String),
480
+ errorMessage: l.NullOr(l.String),
481
+ cancelled: l.Boolean,
482
+ startedAt: l.Date,
483
+ completedAt: l.NullOr(l.Date),
484
+ durationMs: l.NullOr(l.Number),
485
+ traceId: l.NullOr(l.String),
486
+ parentExecutionId: l.NullOr(l.String),
487
+ parentClosePolicy: l.NullOr(zt)
488
+ }), Ht = l.Struct({
489
+ tag: l.optional(l.String),
490
+ status: l.optional(J),
491
+ limit: l.optional(l.Number)
492
+ }), Ut = l.Struct({
493
+ id: l.String,
494
+ runId: l.String,
495
+ stepName: l.String,
496
+ attempt: l.Number,
497
+ status: l.Literal("running", "succeeded", "failed"),
498
+ input: l.NullOr(l.Unknown),
499
+ retryPolicy: l.NullOr(l.Unknown),
500
+ output: l.NullOr(l.Unknown),
501
+ errorTag: l.NullOr(l.String),
502
+ errorMessage: l.NullOr(l.String),
503
+ errorCause: l.NullOr(l.Unknown),
504
+ startedAt: l.Date,
505
+ completedAt: l.NullOr(l.Date),
506
+ durationMs: l.NullOr(l.Number)
507
+ }), Wt = l.Struct({
508
+ id: l.String,
509
+ runId: l.String,
510
+ eventType: l.String,
511
+ payload: l.NullOr(l.Unknown),
512
+ occurredAt: l.Date,
513
+ stepName: l.NullOr(l.String),
514
+ attempt: l.NullOr(l.Number)
515
+ }), Gt = l.Struct({
516
+ id: l.String,
517
+ name: l.String,
518
+ payload: l.Unknown,
519
+ source: l.String,
520
+ subject: l.NullOr(l.Unknown),
521
+ traceId: l.NullOr(l.String),
522
+ occurredAt: l.Date
523
+ }), Kt = l.Struct({
524
+ id: l.String,
525
+ eventId: l.String,
526
+ eventName: l.String,
527
+ triggerId: l.String,
528
+ workflowName: l.String,
529
+ executionId: l.NullOr(l.String),
530
+ status: l.Literal("starting", "started", "skipped", "failed"),
531
+ idempotencyKey: l.String,
532
+ skipped: l.Boolean,
533
+ errorMessage: l.NullOr(l.String),
534
+ createdAt: l.Date,
535
+ completedAt: l.NullOr(l.Date)
536
+ }), qt = l.Struct({ id: l.String }), X = l.Struct({ runId: l.String }), Jt = l.Struct({
537
+ name: l.optional(l.String),
538
+ limit: l.optional(l.Number)
539
+ }), Yt = l.Struct({ eventId: l.String }), Z = l.Struct({
540
+ workflowName: l.String,
541
+ executionId: l.String
542
+ }), Xt = l.Struct({
543
+ id: l.String,
544
+ signalName: l.String,
545
+ payload: l.optional(l.Unknown)
546
+ }), Zt = l.Struct({
547
+ id: l.String,
548
+ updateName: l.String,
549
+ payload: l.optional(l.Unknown),
550
+ timeoutMs: l.optional(l.Number)
551
+ }), Qt = l.Struct({
552
+ eventId: l.String,
553
+ updateId: l.String,
554
+ completedEventId: l.String,
555
+ result: l.Unknown
547
556
  }), $t = B({
548
557
  name: "__voltro.workflow.run",
549
558
  source: "_voltro_workflow_runs",
550
559
  input: qt,
551
- output: c.Array(Y)
560
+ output: l.Array(Y)
552
561
  }), en = B({
553
562
  name: "__voltro.workflow.runs",
554
563
  source: "_voltro_workflow_runs",
555
564
  input: Ht,
556
- output: c.Array(Y)
565
+ output: l.Array(Y)
557
566
  }), tn = B({
558
567
  name: "__voltro.workflow.run.steps",
559
568
  source: "_voltro_workflow_run_steps",
560
569
  input: X,
561
- output: c.Array(Ut)
570
+ output: l.Array(Ut)
562
571
  }), nn = B({
563
572
  name: "__voltro.workflow.run.events",
564
573
  source: "_voltro_workflow_run_events",
565
574
  input: X,
566
- output: c.Array(Wt)
575
+ output: l.Array(Wt)
567
576
  }), rn = B({
568
577
  name: "__voltro.workflow.domainEvents",
569
578
  source: "_voltro_workflow_events",
570
579
  input: Jt,
571
- output: c.Array(Gt)
580
+ output: l.Array(Gt)
572
581
  }), an = B({
573
582
  name: "__voltro.workflow.event.deliveries",
574
583
  source: "_voltro_workflow_event_deliveries",
575
584
  input: Yt,
576
- output: c.Array(Kt)
585
+ output: l.Array(Kt)
577
586
  }), on = H({
578
587
  name: "__voltro.workflow.cancel",
579
588
  input: Z,
580
- output: c.Struct({ ok: c.Boolean })
589
+ output: l.Struct({ ok: l.Boolean })
581
590
  }), sn = H({
582
591
  name: "__voltro.workflow.resume",
583
592
  input: Z,
584
- output: c.Struct({ ok: c.Boolean })
593
+ output: l.Struct({ ok: l.Boolean })
585
594
  }), cn = H({
586
595
  name: "__voltro.workflow.signal",
587
596
  input: Xt,
588
- output: c.Struct({ eventId: c.String })
597
+ output: l.Struct({ eventId: l.String })
589
598
  }), ln = H({
590
599
  name: "__voltro.workflow.update",
591
600
  input: Zt,
592
601
  output: Qt
593
- }), un = "__voltro.undo.log", dn = "__voltro.undo.apply", fn = "__voltro.undo.redo", pn = c.Struct({
594
- id: c.String,
595
- tag: c.String,
596
- label: c.NullOr(c.String),
597
- undone: c.Boolean,
598
- crossesAction: c.Boolean,
599
- createdAt: c.String
600
- }), mn = class extends c.TaggedError()("UndoNotFound", { invocationId: c.String }) {}, hn = class extends c.TaggedError()("UndoForbidden", { invocationId: c.String }) {}, gn = class extends c.TaggedError()("UndoConflict", {
601
- invocationId: c.String,
602
- reason: c.Literal("conflict", "action")
603
- }) {}, _n = c.Union(mn, hn, gn), vn = B({
602
+ }), un = "__voltro.undo.log", dn = "__voltro.undo.apply", fn = "__voltro.undo.redo", pn = l.Struct({
603
+ id: l.String,
604
+ tag: l.String,
605
+ label: l.NullOr(l.String),
606
+ undone: l.Boolean,
607
+ crossesAction: l.Boolean,
608
+ createdAt: l.String
609
+ }), mn = class extends l.TaggedError()("UndoNotFound", { invocationId: l.String }) {}, hn = class extends l.TaggedError()("UndoForbidden", { invocationId: l.String }) {}, gn = class extends l.TaggedError()("UndoConflict", {
610
+ invocationId: l.String,
611
+ reason: l.Literal("conflict", "action")
612
+ }) {}, _n = l.Union(mn, hn, gn), vn = B({
604
613
  name: un,
605
614
  source: "_voltro_undo_log",
606
- input: c.Struct({ limit: c.optional(c.Number) }),
607
- output: c.Array(pn)
615
+ input: l.Struct({ limit: l.optional(l.Number) }),
616
+ output: l.Array(pn),
617
+ openAccess: "subject-scoped by construction: lists only the calling subject's own undoable actions"
608
618
  }), yn = V({
609
619
  name: dn,
610
- input: c.Struct({ invocationId: c.String }),
611
- output: c.Struct({ ok: c.Boolean }),
612
- error: _n
620
+ input: l.Struct({ invocationId: l.String }),
621
+ output: l.Struct({ ok: l.Boolean }),
622
+ error: _n,
623
+ openAccess: "subject-scoped by construction: undo is per-actor — another subject's invocation fails typed with UndoForbidden"
613
624
  }), bn = V({
614
625
  name: fn,
615
- input: c.Struct({ invocationId: c.String }),
616
- output: c.Struct({ ok: c.Boolean }),
617
- error: _n
626
+ input: l.Struct({ invocationId: l.String }),
627
+ output: l.Struct({ ok: l.Boolean }),
628
+ error: _n,
629
+ openAccess: "subject-scoped by construction: redo is per-actor — another subject's invocation fails typed with UndoForbidden"
618
630
  }), xn = "__voltro.approvals.pending", Sn = "__voltro.approvals.decide", Cn = B({
619
631
  name: xn,
620
632
  source: "_voltro_approvals",
621
- input: c.Struct({ limit: c.optional(c.Number) }),
622
- output: c.Array(D),
633
+ input: l.Struct({ limit: l.optional(l.Number) }),
634
+ output: l.Array(O),
623
635
  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"
624
636
  }), wn = V({
625
637
  name: Sn,
626
- input: c.Struct({
627
- approvalId: c.String,
628
- decision: c.Literal("approve", "reject"),
629
- note: c.optional(c.String)
638
+ input: l.Struct({
639
+ approvalId: l.String,
640
+ decision: l.Literal("approve", "reject"),
641
+ note: l.optional(l.String)
630
642
  }),
631
- output: c.Struct({
632
- approvalId: c.String,
633
- status: c.Literal("approved", "rejected")
643
+ output: l.Struct({
644
+ approvalId: l.String,
645
+ status: l.Literal("approved", "rejected")
634
646
  }),
635
- error: E,
647
+ error: D,
636
648
  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"
637
- }), Tn = "__voltro.connections.list", En = "__voltro.connections.start", Dn = "__voltro.connections.submitToken", On = "__voltro.connections.disconnect", Q = c.Literal("oauth2", "pat"), kn = c.Literal("disconnected", "connected", "expired", "revoked", "error"), An = c.Struct({
638
- connectionId: c.String,
649
+ }), Tn = "__voltro.connections.list", En = "__voltro.connections.start", Dn = "__voltro.connections.submitToken", On = "__voltro.connections.disconnect", Q = l.Literal("oauth2", "pat"), kn = l.Literal("disconnected", "connected", "expired", "revoked", "error"), An = l.Struct({
650
+ connectionId: l.String,
639
651
  kind: Q,
640
- label: c.String,
652
+ label: l.String,
641
653
  status: kn,
642
- accountId: c.NullOr(c.String),
643
- accountLabel: c.NullOr(c.String),
644
- scopes: c.Array(c.String),
645
- expiresAt: c.NullOr(c.String),
646
- lastError: c.NullOr(c.String),
647
- connectedAt: c.NullOr(c.String)
648
- }), jn = class extends c.TaggedError()("ConnectionNotDeclared", { connectionId: c.String }) {}, Mn = class extends c.TaggedError()("ConnectionSubjectRequired", { connectionId: c.String }) {}, Nn = class extends c.TaggedError()("ConnectionKindMismatch", {
649
- connectionId: c.String,
654
+ accountId: l.NullOr(l.String),
655
+ accountLabel: l.NullOr(l.String),
656
+ scopes: l.Array(l.String),
657
+ expiresAt: l.NullOr(l.String),
658
+ lastError: l.NullOr(l.String),
659
+ connectedAt: l.NullOr(l.String)
660
+ }), jn = class extends l.TaggedError()("ConnectionNotDeclared", { connectionId: l.String }) {}, Mn = class extends l.TaggedError()("ConnectionSubjectRequired", { connectionId: l.String }) {}, Nn = class extends l.TaggedError()("ConnectionKindMismatch", {
661
+ connectionId: l.String,
650
662
  expected: Q,
651
663
  actual: Q
652
- }) {}, Pn = class extends c.TaggedError()("ConnectionHandshakeFailed", {
653
- connectionId: c.String,
654
- reason: c.String,
655
- transient: c.Boolean
656
- }) {}, $ = c.Union(jn, Mn, Nn, Pn), Fn = B({
664
+ }) {}, Pn = class extends l.TaggedError()("ConnectionHandshakeFailed", {
665
+ connectionId: l.String,
666
+ reason: l.String,
667
+ transient: l.Boolean
668
+ }) {}, $ = l.Union(jn, Mn, Nn, Pn), Fn = B({
657
669
  name: Tn,
658
670
  source: "_voltro_connections",
659
- input: c.Struct({}),
660
- output: c.Array(An)
671
+ input: l.Struct({}),
672
+ output: l.Array(An),
673
+ openAccess: "self-scoped read: projects the declared connections for the calling subject only (its own connect/disconnect state)"
661
674
  }), In = H({
662
675
  name: En,
663
- input: c.Struct({
664
- connectionId: c.String,
665
- redirectTo: c.optional(c.String)
676
+ input: l.Struct({
677
+ connectionId: l.String,
678
+ redirectTo: l.optional(l.String)
666
679
  }),
667
- output: c.Struct({
668
- authorizeUrl: c.String,
669
- state: c.String
680
+ output: l.Struct({
681
+ authorizeUrl: l.String,
682
+ state: l.String
670
683
  }),
671
- error: $
684
+ error: $,
685
+ openAccess: "self-service: begins an oauth handshake that stores a credential for the calling subject only; anonymous callers fail typed with ConnectionSubjectRequired"
672
686
  }), Ln = V({
673
687
  name: Dn,
674
- input: c.Struct({
675
- connectionId: c.String,
676
- token: c.String
688
+ input: l.Struct({
689
+ connectionId: l.String,
690
+ token: l.String
677
691
  }),
678
- output: c.Struct({ ok: c.Boolean }),
679
- error: $
692
+ output: l.Struct({ ok: l.Boolean }),
693
+ error: $,
694
+ openAccess: "self-service: stores a pasted token as the calling subject's own credential; anonymous callers fail typed with ConnectionSubjectRequired"
680
695
  }), Rn = V({
681
696
  name: On,
682
- input: c.Struct({ connectionId: c.String }),
683
- output: c.Struct({ ok: c.Boolean }),
684
- error: $
697
+ input: l.Struct({ connectionId: l.String }),
698
+ output: l.Struct({ ok: l.Boolean }),
699
+ error: $,
700
+ openAccess: "self-service: deletes only the calling subject's own credential row for this connection"
685
701
  }), zn = (e) => {
686
702
  let t = e instanceof Date ? e.getTime() : typeof e == "number" ? e : typeof e == "string" ? new Date(e).getTime() : 0;
687
703
  return Number.isNaN(t) ? 0 : t;
688
704
  }, Bn = 1;
689
705
  //#endregion
690
- export { Me as ADMIN_SCOPE, se as APIKEY_ISSUE_ORG_SCOPE, n as APIKEY_ISSUE_OTHER_SCOPE, je as APIKEY_ISSUE_SELF_SCOPE, Sn as APPROVALS_DECIDE_TAG, xn as APPROVALS_PENDING_TAG, E as ApprovalDecisionErrors, T as ApprovalErrors, x as ApprovalExpired, C as ApprovalForbidden, v as ApprovalNotFound, S as ApprovalNotPending, b as ApprovalRejected, _ as ApprovalRequired, y as ApprovalSelfApproval, w as ApprovalUnavailable, Oe as AuthMiddleware, g as BusinessRuleViolation, Tn as CONNECTIONS_LIST_TAG, On as CONNECTION_DISCONNECT_TAG, En as CONNECTION_START_TAG, Dn as CONNECTION_SUBMIT_TOKEN_TAG, Pn as ConnectionHandshakeFailed, Ce as ConnectionInfo, Ee as ConnectionInfoMiddleware, Q as ConnectionKind, Nn as ConnectionKindMismatch, jn as ConnectionNotDeclared, An as ConnectionState, kn as ConnectionStatus, Mn as ConnectionSubjectRequired, ve as DEFAULT_SCOPE_CACHE_MAX_ENTRIES, de as DEFAULT_SCOPE_CACHE_TTL_MS, Ot as EVENT_ROUTE_SEP, Tt as EventKeyInvalid, wt as EventPayloadInvalid, Et as EventPayloadTooLarge, ht as MAX_EVENT_ENVELOPE_BYTES, Bn as PROTOCOL_VERSION, D as PendingApproval, O as REACTIVITY_CHANNEL_PREFIX, s as ScopeError, we as Subject, De as SubjectIdentity, pe as SubjectService, dn as UNDO_APPLY_TAG, un as UNDO_LOG_TAG, fn as UNDO_REDO_TAG, xe as Unauthenticated, gn as UndoConflict, hn as UndoForbidden, pn as UndoLogEntry, mn as UndoNotFound, Z as WorkflowControlInputSchema, Gt as WorkflowDomainEventRowSchema, Jt as WorkflowDomainEventsInputSchema, Yt as WorkflowEventDeliveriesInputSchema, Kt as WorkflowEventDeliveryRowSchema, zt as WorkflowParentClosePolicySchema, Wt as WorkflowRunEventRowSchema, Vt as WorkflowRunHandleSchema, qt as WorkflowRunRefSchema, Y as WorkflowRunRowSchema, J as WorkflowRunStatusSchema, Ut as WorkflowRunStepRowSchema, X as WorkflowRunTableRefSchema, Ht as WorkflowRunsInputSchema, Xt as WorkflowSignalInputSchema, Bt as WorkflowStartDeferralSchema, Zt as WorkflowUpdateInputSchema, Qt as WorkflowUpdateResultSchema, ut as actionToRpc, i as advisoryResourceGuardWarning, ke as anonymousSubject, Xe as applyRowPatch, me as applyScopeDecision, wn as approvalsDecideDescriptor, Cn as approvalsPendingQueryDescriptor, he as assertAuthenticated, Be as beginIdempotent, Lt as checkFrameworkCompat, r as checkGuards, ae as checkGuardsEffect, Te as composeAuthStrategies, Ft as composeRpcInterceptors, Rn as connectionDisconnectDescriptor, In as connectionStartDescriptor, Ln as connectionSubmitTokenDescriptor, Fn as connectionsListQueryDescriptor, P as declaredReactivityChannelKeys, H as defineAction, _t as defineEvent, V as defineMutation, Mt as definePlugin, Nt as definePluginRoute, It as definePluginService, B as defineQuery, at as defineStream, Je as diffRows, be as effectiveScopes, Dt as encodeEventKey, ft as errorTag, bt as eventAttached, vt as eventEnvelope, yt as eventGap, G as eventResumePoint, kt as eventRoute, xt as eventStreamEvent, St as eventSubscribeInput, Ct as eventToRpc, Le as failIdempotent, e as findAdvisoryResourceGuards, Fe as finishIdempotent, jt as formatEventRoute, ye as getPolicyGuardResolver, re as getResourceScopeResolver, it as hasAccessDecision, Se as hasCallbackRoutes, ie as hasEffectiveScope, oe as hasScope, p as idToPath, ze as idempotencyScope, gt as isEventDescriptor, Ye as isIdKeyed, a as isOpenAccess, te as isPolicyCheck, rt as isPolicyGuard, M as isReactivityChannel, N as isReactivityChannelKey, _e as isSystemSubject, tt as isWireReachable, ge as makeScopeCache, Ve as memoryIdempotencyStore, ne as missingAccessDecision, lt as mutationToRpc, mt as normalizeDescriptor, L as normalizeSource, o as openAccessSpec, At as parseEventRoute, Ke as pathToId, Pt as pluginInstanceName, et as publishReactivity, He as publishServerError, ct as queryToRpc, Qe as reactivityChannel, Pe as requireScope, d as rowPatchOpSchema, f as rowPatchSchema, ue as scopeCacheKey, t as setEffectiveScopes, le as setPolicyGuardResolver, ee as setResourceScopeResolver, I as sourceKeys, dt as streamToRpc, Ae as subjectIdentity, ce as subjectScopes, Re as subscribeServerErrors, h as subscriptionEvent, Ne as systemSubject, fe as tenantScopedSubject, pt as toRpc, zn as tsMs, $e as undeclaredChannelKeys, yn as undoApplyDescriptor, vn as undoLogQueryDescriptor, bn as undoRedoDescriptor, on as workflowCancelDescriptor, rn as workflowDomainEventsQueryDescriptor, an as workflowEventDeliveriesQueryDescriptor, sn as workflowResumeDescriptor, nn as workflowRunEventsQueryDescriptor, $t as workflowRunQueryDescriptor, tn as workflowRunStepsQueryDescriptor, en as workflowRunsQueryDescriptor, cn as workflowSignalDescriptor, ln as workflowUpdateDescriptor, Ie as wsMutationIdempotencyScope };
706
+ export { je as ADMIN_SCOPE, oe as APIKEY_ISSUE_ORG_SCOPE, n as APIKEY_ISSUE_OTHER_SCOPE, Ae as APIKEY_ISSUE_SELF_SCOPE, Sn as APPROVALS_DECIDE_TAG, xn as APPROVALS_PENDING_TAG, D as ApprovalDecisionErrors, E as ApprovalErrors, S as ApprovalExpired, w as ApprovalForbidden, y as ApprovalNotFound, C as ApprovalNotPending, x as ApprovalRejected, v as ApprovalRequired, b as ApprovalSelfApproval, T as ApprovalUnavailable, De as AuthMiddleware, _ as BusinessRuleViolation, Tn as CONNECTIONS_LIST_TAG, On as CONNECTION_DISCONNECT_TAG, En as CONNECTION_START_TAG, Dn as CONNECTION_SUBMIT_TOKEN_TAG, Pn as ConnectionHandshakeFailed, Se as ConnectionInfo, Te as ConnectionInfoMiddleware, Q as ConnectionKind, Nn as ConnectionKindMismatch, jn as ConnectionNotDeclared, An as ConnectionState, kn as ConnectionStatus, Mn as ConnectionSubjectRequired, _e as DEFAULT_SCOPE_CACHE_MAX_ENTRIES, ue as DEFAULT_SCOPE_CACHE_TTL_MS, Ot as EVENT_ROUTE_SEP, Tt as EventKeyInvalid, wt as EventPayloadInvalid, Et as EventPayloadTooLarge, ht as MAX_EVENT_ENVELOPE_BYTES, Bn as PROTOCOL_VERSION, O as PendingApproval, k as REACTIVITY_CHANNEL_PREFIX, c as ScopeError, Ce as Subject, Ee as SubjectIdentity, fe as SubjectService, dn as UNDO_APPLY_TAG, un as UNDO_LOG_TAG, fn as UNDO_REDO_TAG, be as Unauthenticated, gn as UndoConflict, hn as UndoForbidden, pn as UndoLogEntry, mn as UndoNotFound, Z as WorkflowControlInputSchema, Gt as WorkflowDomainEventRowSchema, Jt as WorkflowDomainEventsInputSchema, Yt as WorkflowEventDeliveriesInputSchema, Kt as WorkflowEventDeliveryRowSchema, zt as WorkflowParentClosePolicySchema, Wt as WorkflowRunEventRowSchema, Vt as WorkflowRunHandleSchema, qt as WorkflowRunRefSchema, Y as WorkflowRunRowSchema, J as WorkflowRunStatusSchema, Ut as WorkflowRunStepRowSchema, X as WorkflowRunTableRefSchema, Ht as WorkflowRunsInputSchema, Xt as WorkflowSignalInputSchema, Bt as WorkflowStartDeferralSchema, Zt as WorkflowUpdateInputSchema, Qt as WorkflowUpdateResultSchema, ut as actionToRpc, i as advisoryResourceGuardWarning, Oe as anonymousSubject, Ye as applyRowPatch, pe as applyScopeDecision, wn as approvalsDecideDescriptor, Cn as approvalsPendingQueryDescriptor, me as assertAuthenticated, ze as beginIdempotent, Lt as checkFrameworkCompat, r as checkGuards, ie as checkGuardsEffect, we as composeAuthStrategies, Ft as composeRpcInterceptors, Rn as connectionDisconnectDescriptor, In as connectionStartDescriptor, Ln as connectionSubmitTokenDescriptor, Fn as connectionsListQueryDescriptor, F as declaredReactivityChannelKeys, H as defineAction, _t as defineEvent, V as defineMutation, Mt as definePlugin, Nt as definePluginRoute, It as definePluginService, B as defineQuery, at as defineStream, qe as diffRows, ye as effectiveScopes, Dt as encodeEventKey, ft as errorTag, bt as eventAttached, vt as eventEnvelope, yt as eventGap, G as eventResumePoint, kt as eventRoute, xt as eventStreamEvent, St as eventSubscribeInput, Ct as eventToRpc, Ie as failIdempotent, e as findAdvisoryResourceGuards, Pe as finishIdempotent, jt as formatEventRoute, ve as getPolicyGuardResolver, ne as getResourceScopeResolver, it as hasAccessDecision, xe as hasCallbackRoutes, re as hasEffectiveScope, ae as hasScope, m as idToPath, Re as idempotencyScope, gt as isEventDescriptor, Je as isIdKeyed, a as isOpenAccess, ee as isPolicyCheck, rt as isPolicyGuard, N as isReactivityChannel, P as isReactivityChannelKey, ge as isSystemSubject, tt as isWireReachable, he as makeScopeCache, Be as memoryIdempotencyStore, te as missingAccessDecision, lt as mutationToRpc, mt as normalizeDescriptor, Qe as normalizeSource, s as openAccessSpec, At as parseEventRoute, Ge as pathToId, Pt as pluginInstanceName, et as publishReactivity, Ve as publishServerError, ct as queryToRpc, Ze as reactivityChannel, Ne as requireScope, f as rowPatchOpSchema, p as rowPatchSchema, le as scopeCacheKey, t as setEffectiveScopes, ce as setPolicyGuardResolver, o as setResourceScopeResolver, L as sourceKeys, dt as streamToRpc, ke as subjectIdentity, se as subjectScopes, Le as subscribeServerErrors, g as subscriptionEvent, Me as systemSubject, de as tenantScopedSubject, pt as toRpc, zn as tsMs, $e as undeclaredChannelKeys, yn as undoApplyDescriptor, vn as undoLogQueryDescriptor, bn as undoRedoDescriptor, on as workflowCancelDescriptor, rn as workflowDomainEventsQueryDescriptor, an as workflowEventDeliveriesQueryDescriptor, sn as workflowResumeDescriptor, nn as workflowRunEventsQueryDescriptor, $t as workflowRunQueryDescriptor, tn as workflowRunStepsQueryDescriptor, en as workflowRunsQueryDescriptor, cn as workflowSignalDescriptor, ln as workflowUpdateDescriptor, Fe as wsMutationIdempotencyScope };