@voltro/protocol 0.84.0 → 0.85.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.d.ts CHANGED
@@ -3,14 +3,16 @@ import { DataStore } from '@voltro/database';
3
3
  import { Effect } from 'effect';
4
4
  import { Layer } from 'effect';
5
5
  import { Option } from 'effect';
6
- import { Rpc } from '@effect/rpc';
7
- import { RpcMiddleware } from '@effect/rpc';
6
+ import { Rpc } from 'effect/rpc';
7
+ import { RpcMiddleware } from 'effect/rpc';
8
8
  import { Schema } from 'effect';
9
- import { SqlClient } from '@effect/sql';
10
- import { Stream } from '@effect/rpc/RpcSchema';
9
+ import { SchemaAST } from 'effect';
10
+ import { SqlClient } from 'effect/sql';
11
+ import { Stream } from 'effect/rpc/RpcSchema';
11
12
  import { VersionConflict } from '@voltro/database/wire';
13
+ import { YieldableError } from 'effect/Cause';
12
14
 
13
- export declare interface ActionProcedureDescriptor<Name extends string, Input extends Schema.Schema.Any, Output extends Schema.Schema.Any, Error extends Schema.Schema.All> {
15
+ export declare interface ActionProcedureDescriptor<Name extends string, Input extends Schema.Top, Output extends Schema.Top, Error extends Schema.Top> {
14
16
  readonly kind: 'action';
15
17
  readonly name: Name;
16
18
  readonly input: Input;
@@ -76,7 +78,7 @@ export declare interface ActionProcedureDescriptor<Name extends string, Input ex
76
78
  readonly internal: boolean | undefined;
77
79
  }
78
80
 
79
- export declare const actionToRpc: <Name extends string, Input extends Schema.Schema.Any, Output extends Schema.Schema.Any, Err extends Schema.Schema.All>(descriptor: ActionProcedureDescriptor<Name, Input, Output, Err>, extraErrors?: ExtraErrors) => Rpc.Rpc<Name, Input extends Schema.Struct.Fields ? Schema.Struct<Input> : Input, Output, Schema.Schema.All, never>;
81
+ export declare const actionToRpc: <Name extends string, Input extends Schema.Top, Output extends Schema.Top, Err extends Schema.Top>(descriptor: ActionProcedureDescriptor<Name, Input, Output, Err>, extraErrors?: ExtraErrors) => Rpc.Rpc<Name, Input extends Schema.Struct.Fields ? Schema.Struct<Input> : Input, Output, Schema.Top, never, never>;
80
82
 
81
83
  export declare const ADMIN_SCOPE = "admin:full";
82
84
 
@@ -138,7 +140,11 @@ export declare interface AnyApprovalPolicy {
138
140
  export declare type AnyCheckSpec = GuardCheckSpec | PolicyCheckSpec | AuthenticatedCheckSpec | OpenAccessSpec | ServiceAccessSpec;
139
141
 
140
142
  /** Any declared event, with the generics erased — for registries and audits. */
141
- export declare type AnyEventDescriptor = EventDescriptor<string, Schema.Schema.Any, Schema.Schema.Any>;
143
+ /** The erased descriptor every registry holds. `guards` reads the key type
144
+ * contravariantly (a policy guard is called WITH the key), so the erased form
145
+ * takes `never` there: every concrete descriptor is assignable to it, and a
146
+ * consumer that wants to call a guard must narrow first. */
147
+ export declare type AnyEventDescriptor = EventDescriptor<string, Schema.Top, Schema.Top, DeclaredAccess<never>>;
142
148
 
143
149
  /** A guard is a scope check, a relationship check, or an identity check. */
144
150
  export declare type AnyGuardSpec<Input = unknown> = GuardSpec<Input> | PolicyGuardSpec<Input> | AuthenticatedGuardSpec;
@@ -177,17 +183,15 @@ export declare const APIKEY_ISSUE_SELF_SCOPE = "apikeys:issue:self";
177
183
  export declare class ApiUnavailable extends ApiUnavailable_base {
178
184
  }
179
185
 
180
- declare const ApiUnavailable_base: Schema.TaggedErrorClass<ApiUnavailable, "ApiUnavailable", {
181
- readonly _tag: Schema.tag<"ApiUnavailable">;
182
- } & {
186
+ declare const ApiUnavailable_base: Schema.Class<ApiUnavailable, Schema.TaggedStruct<"ApiUnavailable", {
183
187
  /** The binding name on the caller (`apis.<name>`). */
184
- api: typeof Schema.String;
188
+ readonly api: Schema.String;
185
189
  /** The rpc tag that was called. */
186
- tag: typeof Schema.String;
190
+ readonly tag: Schema.String;
187
191
  /** Why no answer arrived. */
188
- reason: Schema.Literal<["timeout", "transport", "closed"]>;
189
- message: typeof Schema.String;
190
- }>;
192
+ readonly reason: Schema.Literals<readonly ["timeout", "transport", "closed"]>;
193
+ readonly message: Schema.String;
194
+ }>, YieldableError>;
191
195
 
192
196
  /** The subject a decision produces, plus what the decision took away. `removed`
193
197
  * is never non-empty for a `grant`. */
@@ -208,7 +212,7 @@ export declare const applyRowPatch: (prev: ReadonlyArray<PatchRow>, patch: RowPa
208
212
  *
209
213
  * Builds an id→row map from prev, applies `add` / `replace` (which set the
210
214
  * id → next row), then materialises the result strictly in the patch's
211
- * `order`. A `remove`d id simply isn't in `order`, so it drops out of the
215
+ * `order` (or prev's sequence when null). A `remove`d id simply isn't in `order`, so it drops out of the
212
216
  * output naturally — no key-type juggling to delete it from the map. Any
213
217
  * id in `order` that the map doesn't resolve (a desync — the client missed
214
218
  * an `add`) is skipped rather than throwing, so one dropped frame degrades
@@ -239,7 +243,7 @@ export declare const applyScopeDecision: (subject: Subject, decision: Exclude<Sc
239
243
  }>) => AppliedScopes;
240
244
 
241
245
  /** The union the `__voltro.approvals.decide` built-in advertises. */
242
- export declare const ApprovalDecisionErrors: Schema.Union<[typeof ApprovalNotFound, typeof ApprovalSelfApproval, typeof ApprovalExpired, typeof ApprovalNotPending, typeof ApprovalForbidden, typeof ApprovalUnavailable]>;
246
+ export declare const ApprovalDecisionErrors: Schema.Union<readonly [typeof ApprovalNotFound, typeof ApprovalSelfApproval, typeof ApprovalExpired, typeof ApprovalNotPending, typeof ApprovalForbidden, typeof ApprovalUnavailable]>;
243
247
 
244
248
  /**
245
249
  * The union every approval-requiring descriptor advertises on the wire.
@@ -250,31 +254,27 @@ export declare const ApprovalDecisionErrors: Schema.Union<[typeof ApprovalNotFou
250
254
  * before the executor MUST be in the error union or it crosses as an untyped
251
255
  * defect and the client cannot branch on it.
252
256
  */
253
- export declare const ApprovalErrors: Schema.Union<[typeof ApprovalRequired, typeof ApprovalRejected, typeof ApprovalExpired, typeof ApprovalUnavailable]>;
257
+ export declare const ApprovalErrors: Schema.Union<readonly [typeof ApprovalRequired, typeof ApprovalRejected, typeof ApprovalExpired, typeof ApprovalUnavailable]>;
254
258
 
255
259
  /** Past `expiresAt`. Fails closed: neither approvable nor executable. */
256
260
  export declare class ApprovalExpired extends ApprovalExpired_base {
257
261
  }
258
262
 
259
- declare const ApprovalExpired_base: Schema.TaggedErrorClass<ApprovalExpired, "ApprovalExpired", {
260
- readonly _tag: Schema.tag<"ApprovalExpired">;
261
- } & {
262
- approvalId: typeof Schema.String;
263
- expiredAt: typeof Schema.String;
264
- }>;
263
+ declare const ApprovalExpired_base: Schema.Class<ApprovalExpired, Schema.TaggedStruct<"ApprovalExpired", {
264
+ readonly approvalId: Schema.String;
265
+ readonly expiredAt: Schema.String;
266
+ }>, YieldableError>;
265
267
 
266
268
  /** The would-be approver does not satisfy the intent's own `approvers` guards. */
267
269
  export declare class ApprovalForbidden extends ApprovalForbidden_base {
268
270
  }
269
271
 
270
- declare const ApprovalForbidden_base: Schema.TaggedErrorClass<ApprovalForbidden, "ApprovalForbidden", {
271
- readonly _tag: Schema.tag<"ApprovalForbidden">;
272
- } & {
273
- approvalId: typeof Schema.String;
272
+ declare const ApprovalForbidden_base: Schema.Class<ApprovalForbidden, Schema.TaggedStruct<"ApprovalForbidden", {
273
+ readonly approvalId: Schema.String;
274
274
  /** The scope whose absence denied them, when the denial was scope-shaped. */
275
- required: Schema.NullOr<typeof Schema.String>;
276
- message: typeof Schema.String;
277
- }>;
275
+ readonly required: Schema.NullOr<Schema.String>;
276
+ readonly message: Schema.String;
277
+ }>, YieldableError>;
278
278
 
279
279
  /** The identity of an approval intent, as a wire string. */
280
280
  export declare type ApprovalId = string;
@@ -283,22 +283,18 @@ export declare type ApprovalId = string;
283
283
  export declare class ApprovalNotFound extends ApprovalNotFound_base {
284
284
  }
285
285
 
286
- declare const ApprovalNotFound_base: Schema.TaggedErrorClass<ApprovalNotFound, "ApprovalNotFound", {
287
- readonly _tag: Schema.tag<"ApprovalNotFound">;
288
- } & {
289
- approvalId: typeof Schema.String;
290
- }>;
286
+ declare const ApprovalNotFound_base: Schema.Class<ApprovalNotFound, Schema.TaggedStruct<"ApprovalNotFound", {
287
+ readonly approvalId: Schema.String;
288
+ }>, YieldableError>;
291
289
 
292
290
  /** Already decided (or already consumed) — a decision is made once. */
293
291
  export declare class ApprovalNotPending extends ApprovalNotPending_base {
294
292
  }
295
293
 
296
- declare const ApprovalNotPending_base: Schema.TaggedErrorClass<ApprovalNotPending, "ApprovalNotPending", {
297
- readonly _tag: Schema.tag<"ApprovalNotPending">;
298
- } & {
299
- approvalId: typeof Schema.String;
300
- status: typeof Schema.String;
301
- }>;
294
+ declare const ApprovalNotPending_base: Schema.Class<ApprovalNotPending, Schema.TaggedStruct<"ApprovalNotPending", {
295
+ readonly approvalId: Schema.String;
296
+ readonly status: Schema.String;
297
+ }>, YieldableError>;
302
298
 
303
299
  /**
304
300
  * Declare that a mutation/action needs a SECOND human before it takes effect.
@@ -358,13 +354,11 @@ export declare interface ApprovalPolicy<Input = unknown> {
358
354
  export declare class ApprovalRejected extends ApprovalRejected_base {
359
355
  }
360
356
 
361
- declare const ApprovalRejected_base: Schema.TaggedErrorClass<ApprovalRejected, "ApprovalRejected", {
362
- readonly _tag: Schema.tag<"ApprovalRejected">;
363
- } & {
364
- approvalId: typeof Schema.String;
365
- decidedBy: Schema.NullOr<typeof Schema.String>;
366
- note: Schema.NullOr<typeof Schema.String>;
367
- }>;
357
+ declare const ApprovalRejected_base: Schema.Class<ApprovalRejected, Schema.TaggedStruct<"ApprovalRejected", {
358
+ readonly approvalId: Schema.String;
359
+ readonly decidedBy: Schema.NullOr<Schema.String>;
360
+ readonly note: Schema.NullOr<Schema.String>;
361
+ }>, YieldableError>;
368
362
 
369
363
  /**
370
364
  * The call was RECORDED as a pending approval and did NOT run.
@@ -377,22 +371,20 @@ declare const ApprovalRejected_base: Schema.TaggedErrorClass<ApprovalRejected, "
377
371
  export declare class ApprovalRequired extends ApprovalRequired_base {
378
372
  }
379
373
 
380
- declare const ApprovalRequired_base: Schema.TaggedErrorClass<ApprovalRequired, "ApprovalRequired", {
381
- readonly _tag: Schema.tag<"ApprovalRequired">;
382
- } & {
383
- approvalId: typeof Schema.String;
384
- procedure: typeof Schema.String;
374
+ declare const ApprovalRequired_base: Schema.Class<ApprovalRequired, Schema.TaggedStruct<"ApprovalRequired", {
375
+ readonly approvalId: Schema.String;
376
+ readonly procedure: Schema.String;
385
377
  /** ISO instant past which this intent can no longer be approved. */
386
- expiresAt: typeof Schema.String;
378
+ readonly expiresAt: Schema.String;
387
379
  /** The scope(s) an approver must hold — so the UI can say who to ask. */
388
- requiredScopes: Schema.Array$<typeof Schema.String>;
380
+ readonly requiredScopes: Schema.$Array<Schema.String>;
389
381
  /** The declared `reason`, when the descriptor gave one. */
390
- reason: Schema.NullOr<typeof Schema.String>;
382
+ readonly reason: Schema.NullOr<Schema.String>;
391
383
  /** True when THIS call created the intent; false when it found the one an
392
384
  * earlier identical call had already recorded. Lets a client tell "I just
393
385
  * asked" from "still waiting". */
394
- created: typeof Schema.Boolean;
395
- }>;
386
+ readonly created: Schema.Boolean;
387
+ }>, YieldableError>;
396
388
 
397
389
  export declare const APPROVALS_DECIDE_TAG: "__voltro.approvals.decide";
398
390
 
@@ -415,13 +407,13 @@ export declare const APPROVALS_PENDING_TAG: "__voltro.approvals.pending";
415
407
  * plus the unconditional self-approval refusal.
416
408
  */
417
409
  export declare const approvalsDecideDescriptor: MutationProcedureDescriptor<"__voltro.approvals.decide", Schema.Struct<{
418
- approvalId: typeof Schema.String;
419
- decision: Schema.Literal<["approve", "reject"]>;
420
- note: Schema.optional<typeof Schema.String>;
410
+ readonly approvalId: Schema.String;
411
+ readonly decision: Schema.Literals<readonly ["approve", "reject"]>;
412
+ readonly note: Schema.optional<Schema.String>;
421
413
  }>, Schema.Struct<{
422
- approvalId: typeof Schema.String;
423
- status: Schema.Literal<["approved", "rejected"]>;
424
- }>, Schema.Union<[typeof ApprovalNotFound, typeof ApprovalSelfApproval, typeof ApprovalExpired, typeof ApprovalNotPending, typeof ApprovalForbidden, typeof ApprovalUnavailable]>>;
414
+ readonly approvalId: Schema.String;
415
+ readonly status: Schema.Literals<readonly ["approved", "rejected"]>;
416
+ }>, Schema.Union<readonly [typeof ApprovalNotFound, typeof ApprovalSelfApproval, typeof ApprovalExpired, typeof ApprovalNotPending, typeof ApprovalForbidden, typeof ApprovalUnavailable]>>;
425
417
 
426
418
  /**
427
419
  * The approver IS the requester.
@@ -434,12 +426,10 @@ export declare const approvalsDecideDescriptor: MutationProcedureDescriptor<"__v
434
426
  export declare class ApprovalSelfApproval extends ApprovalSelfApproval_base {
435
427
  }
436
428
 
437
- declare const ApprovalSelfApproval_base: Schema.TaggedErrorClass<ApprovalSelfApproval, "ApprovalSelfApproval", {
438
- readonly _tag: Schema.tag<"ApprovalSelfApproval">;
439
- } & {
440
- approvalId: typeof Schema.String;
441
- subjectId: Schema.NullOr<typeof Schema.String>;
442
- }>;
429
+ declare const ApprovalSelfApproval_base: Schema.Class<ApprovalSelfApproval, Schema.TaggedStruct<"ApprovalSelfApproval", {
430
+ readonly approvalId: Schema.String;
431
+ readonly subjectId: Schema.NullOr<Schema.String>;
432
+ }>, YieldableError>;
443
433
 
444
434
  /**
445
435
  * `__voltro.approvals.pending` — the calling subject's approval work.
@@ -457,22 +447,22 @@ declare const ApprovalSelfApproval_base: Schema.TaggedErrorClass<ApprovalSelfApp
457
447
  * caller sees an empty list.
458
448
  */
459
449
  export declare const approvalsPendingQueryDescriptor: QueryProcedureDescriptor<"__voltro.approvals.pending", Schema.Struct<{
460
- limit: Schema.optional<typeof Schema.Number>;
461
- }>, Schema.Array$<Schema.Struct<{
462
- id: typeof Schema.String;
463
- procedure: typeof Schema.String;
464
- kind: Schema.Literal<["mutation", "action"]>;
465
- requestedBy: Schema.NullOr<typeof Schema.String>;
466
- status: Schema.Literal<["pending", "approved", "rejected", "expired", "consumed"]>;
467
- reason: Schema.NullOr<typeof Schema.String>;
468
- requiredScopes: Schema.Array$<typeof Schema.String>;
469
- requestedAt: typeof Schema.String;
470
- expiresAt: typeof Schema.String;
471
- decidedBy: Schema.NullOr<typeof Schema.String>;
472
- decidedAt: Schema.NullOr<typeof Schema.String>;
473
- note: Schema.NullOr<typeof Schema.String>;
474
- relation: Schema.Literal<["to-decide", "requested"]>;
475
- }>>, typeof Schema.Never>;
450
+ readonly limit: Schema.optional<Schema.Number>;
451
+ }>, Schema.$Array<Schema.Struct<{
452
+ readonly id: Schema.String;
453
+ readonly procedure: Schema.String;
454
+ readonly kind: Schema.Literals<readonly ["mutation", "action"]>;
455
+ readonly requestedBy: Schema.NullOr<Schema.String>;
456
+ readonly status: Schema.Literals<readonly ["pending", "approved", "rejected", "expired", "consumed"]>;
457
+ readonly reason: Schema.NullOr<Schema.String>;
458
+ readonly requiredScopes: Schema.$Array<Schema.String>;
459
+ readonly requestedAt: Schema.String;
460
+ readonly expiresAt: Schema.String;
461
+ readonly decidedBy: Schema.NullOr<Schema.String>;
462
+ readonly decidedAt: Schema.NullOr<Schema.String>;
463
+ readonly note: Schema.NullOr<Schema.String>;
464
+ readonly relation: Schema.Literals<readonly ["to-decide", "requested"]>;
465
+ }>>, Schema.Never>;
476
466
 
477
467
  /** The lifecycle states a `_voltro_approvals` row moves through. */
478
468
  export declare type ApprovalStatus = 'pending' | 'approved' | 'rejected' | 'expired' | 'consumed';
@@ -489,12 +479,10 @@ export declare type ApprovalStatus = 'pending' | 'approved' | 'rejected' | 'expi
489
479
  export declare class ApprovalUnavailable extends ApprovalUnavailable_base {
490
480
  }
491
481
 
492
- declare const ApprovalUnavailable_base: Schema.TaggedErrorClass<ApprovalUnavailable, "ApprovalUnavailable", {
493
- readonly _tag: Schema.tag<"ApprovalUnavailable">;
494
- } & {
495
- procedure: typeof Schema.String;
496
- message: typeof Schema.String;
497
- }>;
482
+ declare const ApprovalUnavailable_base: Schema.Class<ApprovalUnavailable, Schema.TaggedStruct<"ApprovalUnavailable", {
483
+ readonly procedure: Schema.String;
484
+ readonly message: Schema.String;
485
+ }>, YieldableError>;
498
486
 
499
487
  /**
500
488
  * Throws `Unauthenticated` when the resolved Subject is anonymous (no
@@ -574,10 +562,7 @@ export declare interface AuthenticatedGuardSpec {
574
562
  export declare class AuthMiddleware extends AuthMiddleware_base {
575
563
  }
576
564
 
577
- declare const AuthMiddleware_base: RpcMiddleware.TagClass<AuthMiddleware, "@voltro/AuthMiddleware", {
578
- readonly provides: typeof SubjectService;
579
- readonly failure: typeof Unauthenticated;
580
- }>;
565
+ declare const AuthMiddleware_base: RpcMiddleware.ServiceClass<AuthMiddleware, "@voltro/AuthMiddleware", SubjectService, typeof Unauthenticated, never, never, false>;
581
566
 
582
567
  export declare type AuthRouteHandler = (req: AuthRouteRequest) => Promise<AuthRouteResponse>;
583
568
 
@@ -741,6 +726,21 @@ export declare type AuthSubjectGuardVerdict = {
741
726
  */
742
727
  export declare const beginIdempotent: (store: IdempotencyStore, scope: string, key: string, ttlMs: number, now: number, inFlightLeaseMs?: number) => Promise<IdempotencyOutcome>;
743
728
 
729
+ /** Bounded insertion-order storage. Appending overwrites one slot when full;
730
+ * reads never expose its circular physical order or retained array. */
731
+ export declare class BoundedRing<T> implements Iterable<T> {
732
+ private readonly slots;
733
+ private head;
734
+ private size;
735
+ private readonly capacity;
736
+ constructor(capacity: number);
737
+ get length(): number;
738
+ get(index: number): T | undefined;
739
+ push(value: T): void;
740
+ clear(): void;
741
+ [Symbol.iterator](): IterableIterator<T>;
742
+ }
743
+
744
744
  /**
745
745
  * A cross-table business rule was violated inside a mutation's transaction; the
746
746
  * write was rolled back.
@@ -754,15 +754,13 @@ export declare const beginIdempotent: (store: IdempotencyStore, scope: string, k
754
754
  export declare class BusinessRuleViolation extends BusinessRuleViolation_base {
755
755
  }
756
756
 
757
- declare const BusinessRuleViolation_base: Schema.TaggedErrorClass<BusinessRuleViolation, "BusinessRuleViolation", {
758
- readonly _tag: Schema.tag<"BusinessRuleViolation">;
759
- } & {
760
- rule: typeof Schema.String;
761
- params: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
762
- field: Schema.optional<typeof Schema.String>;
763
- message: Schema.optional<typeof Schema.String>;
764
- severity: Schema.Literal<["error", "warning"]>;
765
- }>;
757
+ declare const BusinessRuleViolation_base: Schema.Class<BusinessRuleViolation, Schema.TaggedStruct<"BusinessRuleViolation", {
758
+ readonly rule: Schema.String;
759
+ readonly params: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
760
+ readonly field: Schema.optional<Schema.String>;
761
+ readonly message: Schema.optional<Schema.String>;
762
+ readonly severity: Schema.Literals<readonly ["error", "warning"]>;
763
+ }>, YieldableError>;
766
764
 
767
765
  /** The result of a cached resolution. `fresh` distinguishes a resolution that
768
766
  * actually ran from a replayed verdict — the audit hook fires on the former
@@ -839,11 +837,11 @@ export declare interface ClientDescriptor {
839
837
  * UI (forms, query-bound pickers) and the capability map can introspect
840
838
  * it with no extra fetch. Browser-safe: the schema is already loaded
841
839
  * value-level via the rpc group, so this is the same object by reference. */
842
- readonly input?: Schema.Schema.Any | undefined;
840
+ readonly input?: Schema.Top | undefined;
843
841
  /** The procedure's output `Schema` — carried so schema-driven tables
844
842
  * (`<DataTable>` derives its columns from it) + the capability map can
845
843
  * introspect it. Same browser-safety rationale as `input`. */
846
- readonly output?: Schema.Schema.Any | undefined;
844
+ readonly output?: Schema.Top | undefined;
847
845
  }
848
846
 
849
847
  /**
@@ -1044,33 +1042,32 @@ export declare interface ConnectionCredential {
1044
1042
  * for this connection. Deletes the row; the provider-side grant (if any) is
1045
1043
  * the provider's to revoke. */
1046
1044
  export declare const connectionDisconnectDescriptor: MutationProcedureDescriptor<"__voltro.connections.disconnect", Schema.Struct<{
1047
- connectionId: typeof Schema.String;
1045
+ readonly connectionId: Schema.String;
1048
1046
  }>, Schema.Struct<{
1049
- ok: typeof Schema.Boolean;
1050
- }>, Schema.Union<[typeof ConnectionNotDeclared, typeof ConnectionSubjectRequired, typeof ConnectionKindMismatch, typeof ConnectionHandshakeFailed]>>;
1047
+ readonly ok: Schema.Boolean;
1048
+ }>, Schema.Union<readonly [typeof ConnectionNotDeclared, typeof ConnectionSubjectRequired, typeof ConnectionKindMismatch, typeof ConnectionHandshakeFailed]>>;
1051
1049
 
1052
1050
  /** The provider rejected the token / the handshake failed. `transient`
1053
1051
  * distinguishes "try again" from "the user must re-consent". */
1054
1052
  export declare class ConnectionHandshakeFailed extends ConnectionHandshakeFailed_base {
1053
+ get message(): string;
1055
1054
  }
1056
1055
 
1057
- declare const ConnectionHandshakeFailed_base: Schema.TaggedErrorClass<ConnectionHandshakeFailed, "ConnectionHandshakeFailed", {
1058
- readonly _tag: Schema.tag<"ConnectionHandshakeFailed">;
1059
- } & {
1060
- connectionId: typeof Schema.String;
1061
- reason: typeof Schema.String;
1062
- transient: typeof Schema.Boolean;
1063
- }>;
1056
+ declare const ConnectionHandshakeFailed_base: Schema.Class<ConnectionHandshakeFailed, Schema.TaggedStruct<"ConnectionHandshakeFailed", {
1057
+ readonly connectionId: Schema.String;
1058
+ readonly reason: Schema.String;
1059
+ readonly transient: Schema.Boolean;
1060
+ }>, YieldableError>;
1064
1061
 
1065
1062
  export declare class ConnectionInfo extends ConnectionInfo_base {
1066
1063
  }
1067
1064
 
1068
- declare const ConnectionInfo_base: Context.TagClass<ConnectionInfo, "@voltro/ConnectionInfo", ConnectionInfoValue>;
1065
+ declare const ConnectionInfo_base: Context.ServiceClass<ConnectionInfo, "@voltro/ConnectionInfo", ConnectionInfoValue>;
1069
1066
 
1070
1067
  /**
1071
1068
  * Second middleware on every RpcGroup that wants the
1072
1069
  * `ConnectionInfo` service available to handlers. Resolves from the
1073
- * per-call `{clientId}` the @effect/rpc transport passes in. Handlers
1070
+ * per-call `{clientId}` the `effect/rpc` transport passes in. Handlers
1074
1071
  * that re-bind the connection's subject (e.g. `auth.signin` writing
1075
1072
  * an override after a successful credential check) read clientId
1076
1073
  * from this service.
@@ -1082,9 +1079,7 @@ declare const ConnectionInfo_base: Context.TagClass<ConnectionInfo, "@voltro/Con
1082
1079
  export declare class ConnectionInfoMiddleware extends ConnectionInfoMiddleware_base {
1083
1080
  }
1084
1081
 
1085
- declare const ConnectionInfoMiddleware_base: RpcMiddleware.TagClass<ConnectionInfoMiddleware, "@voltro/ConnectionInfoMiddleware", {
1086
- readonly provides: typeof ConnectionInfo;
1087
- }>;
1082
+ declare const ConnectionInfoMiddleware_base: RpcMiddleware.ServiceClass<ConnectionInfoMiddleware, "@voltro/ConnectionInfoMiddleware", ConnectionInfo, Schema.Never, never, never, false>;
1088
1083
 
1089
1084
  export declare interface ConnectionInfoValue {
1090
1085
  /** Per-connection identifier assigned by the rpc transport. Stable for the
@@ -1135,7 +1130,7 @@ export declare interface ConnectionInfoValue {
1135
1130
  /** The two credential shapes a connection can hold. `oauth2` = an
1136
1131
  * authorization-code grant the framework refreshes; `pat` = a long-lived
1137
1132
  * personal token the user pastes and the framework only stores. */
1138
- export declare const ConnectionKind: Schema.Literal<["oauth2", "pat"]>;
1133
+ export declare const ConnectionKind: Schema.Literals<readonly ["oauth2", "pat"]>;
1139
1134
 
1140
1135
  export declare type ConnectionKind = Schema.Schema.Type<typeof ConnectionKind>;
1141
1136
 
@@ -1145,23 +1140,19 @@ export declare type ConnectionKind = Schema.Schema.Type<typeof ConnectionKind>;
1145
1140
  export declare class ConnectionKindMismatch extends ConnectionKindMismatch_base {
1146
1141
  }
1147
1142
 
1148
- declare const ConnectionKindMismatch_base: Schema.TaggedErrorClass<ConnectionKindMismatch, "ConnectionKindMismatch", {
1149
- readonly _tag: Schema.tag<"ConnectionKindMismatch">;
1150
- } & {
1151
- connectionId: typeof Schema.String;
1152
- expected: Schema.Literal<["oauth2", "pat"]>;
1153
- actual: Schema.Literal<["oauth2", "pat"]>;
1154
- }>;
1143
+ declare const ConnectionKindMismatch_base: Schema.Class<ConnectionKindMismatch, Schema.TaggedStruct<"ConnectionKindMismatch", {
1144
+ readonly connectionId: Schema.String;
1145
+ readonly expected: Schema.Literals<readonly ["oauth2", "pat"]>;
1146
+ readonly actual: Schema.Literals<readonly ["oauth2", "pat"]>;
1147
+ }>, YieldableError>;
1155
1148
 
1156
1149
  /** No connection with that id is declared in the app (no `*.connection.ts`). */
1157
1150
  export declare class ConnectionNotDeclared extends ConnectionNotDeclared_base {
1158
1151
  }
1159
1152
 
1160
- declare const ConnectionNotDeclared_base: Schema.TaggedErrorClass<ConnectionNotDeclared, "ConnectionNotDeclared", {
1161
- readonly _tag: Schema.tag<"ConnectionNotDeclared">;
1162
- } & {
1163
- connectionId: typeof Schema.String;
1164
- }>;
1153
+ declare const ConnectionNotDeclared_base: Schema.Class<ConnectionNotDeclared, Schema.TaggedStruct<"ConnectionNotDeclared", {
1154
+ readonly connectionId: Schema.String;
1155
+ }>, YieldableError>;
1165
1156
 
1166
1157
  export declare const CONNECTIONS_LIST_TAG: "__voltro.connections.list";
1167
1158
 
@@ -1174,26 +1165,26 @@ export declare const CONNECTIONS_LIST_TAG: "__voltro.connections.list";
1174
1165
  * comes back `status: 'disconnected'`. A UI can therefore render the whole
1175
1166
  * "connected accounts" settings page from this one subscription.
1176
1167
  */
1177
- export declare const connectionsListQueryDescriptor: QueryProcedureDescriptor<"__voltro.connections.list", Schema.Struct<{}>, Schema.Array$<Schema.Struct<{
1168
+ export declare const connectionsListQueryDescriptor: QueryProcedureDescriptor<"__voltro.connections.list", Schema.Struct<{}>, Schema.$Array<Schema.Struct<{
1178
1169
  /** The `defineConnection({ id })` value. */
1179
- connectionId: typeof Schema.String;
1180
- kind: Schema.Literal<["oauth2", "pat"]>;
1170
+ readonly connectionId: Schema.String;
1171
+ readonly kind: Schema.Literals<readonly ["oauth2", "pat"]>;
1181
1172
  /** Human label from the declaration; falls back to the id. */
1182
- label: typeof Schema.String;
1183
- status: Schema.Literal<["disconnected", "connected", "expired", "revoked", "error"]>;
1173
+ readonly label: Schema.String;
1174
+ readonly status: Schema.Literals<readonly ["disconnected", "connected", "expired", "revoked", "error"]>;
1184
1175
  /** Provider-side account identifier, when the declaration could resolve one. */
1185
- accountId: Schema.NullOr<typeof Schema.String>;
1176
+ readonly accountId: Schema.NullOr<Schema.String>;
1186
1177
  /** Display name for the connected account ("mario@example.com"). */
1187
- accountLabel: Schema.NullOr<typeof Schema.String>;
1178
+ readonly accountLabel: Schema.NullOr<Schema.String>;
1188
1179
  /** Granted scopes (oauth2); empty for pat. */
1189
- scopes: Schema.Array$<typeof Schema.String>;
1180
+ readonly scopes: Schema.$Array<Schema.String>;
1190
1181
  /** Access-token deadline as an ISO string, or null (pat / no expiry). */
1191
- expiresAt: Schema.NullOr<typeof Schema.String>;
1182
+ readonly expiresAt: Schema.NullOr<Schema.String>;
1192
1183
  /** Last refresh failure message, when `status` is `error` / `revoked`. */
1193
- lastError: Schema.NullOr<typeof Schema.String>;
1184
+ readonly lastError: Schema.NullOr<Schema.String>;
1194
1185
  /** When the credential was first stored, ISO. Null while disconnected. */
1195
- connectedAt: Schema.NullOr<typeof Schema.String>;
1196
- }>>, typeof Schema.Never>;
1186
+ readonly connectedAt: Schema.NullOr<Schema.String>;
1187
+ }>>, Schema.Never>;
1197
1188
 
1198
1189
  /**
1199
1190
  * `__voltro.connections.start` — begin an oauth2 handshake. Returns the
@@ -1202,36 +1193,36 @@ export declare const connectionsListQueryDescriptor: QueryProcedureDescriptor<"_
1202
1193
  * and talks to no domain table, so it must not be optimistic-patched.
1203
1194
  */
1204
1195
  export declare const connectionStartDescriptor: ActionProcedureDescriptor<"__voltro.connections.start", Schema.Struct<{
1205
- connectionId: typeof Schema.String;
1196
+ readonly connectionId: Schema.String;
1206
1197
  /** Where the callback should send the browser once the handshake lands.
1207
1198
  * Same-origin PATH only (validated server-side) — an absolute URL would
1208
1199
  * make the callback an open redirector. */
1209
- redirectTo: Schema.optional<typeof Schema.String>;
1200
+ readonly redirectTo: Schema.optional<Schema.String>;
1210
1201
  }>, Schema.Struct<{
1211
- authorizeUrl: typeof Schema.String;
1212
- state: typeof Schema.String;
1213
- }>, Schema.Union<[typeof ConnectionNotDeclared, typeof ConnectionSubjectRequired, typeof ConnectionKindMismatch, typeof ConnectionHandshakeFailed]>>;
1202
+ readonly authorizeUrl: Schema.String;
1203
+ readonly state: Schema.String;
1204
+ }>, Schema.Union<readonly [typeof ConnectionNotDeclared, typeof ConnectionSubjectRequired, typeof ConnectionKindMismatch, typeof ConnectionHandshakeFailed]>>;
1214
1205
 
1215
1206
  /** One declared connection, projected for the calling subject. */
1216
1207
  export declare const ConnectionState: Schema.Struct<{
1217
1208
  /** The `defineConnection({ id })` value. */
1218
- connectionId: typeof Schema.String;
1219
- kind: Schema.Literal<["oauth2", "pat"]>;
1209
+ readonly connectionId: Schema.String;
1210
+ readonly kind: Schema.Literals<readonly ["oauth2", "pat"]>;
1220
1211
  /** Human label from the declaration; falls back to the id. */
1221
- label: typeof Schema.String;
1222
- status: Schema.Literal<["disconnected", "connected", "expired", "revoked", "error"]>;
1212
+ readonly label: Schema.String;
1213
+ readonly status: Schema.Literals<readonly ["disconnected", "connected", "expired", "revoked", "error"]>;
1223
1214
  /** Provider-side account identifier, when the declaration could resolve one. */
1224
- accountId: Schema.NullOr<typeof Schema.String>;
1215
+ readonly accountId: Schema.NullOr<Schema.String>;
1225
1216
  /** Display name for the connected account ("mario@example.com"). */
1226
- accountLabel: Schema.NullOr<typeof Schema.String>;
1217
+ readonly accountLabel: Schema.NullOr<Schema.String>;
1227
1218
  /** Granted scopes (oauth2); empty for pat. */
1228
- scopes: Schema.Array$<typeof Schema.String>;
1219
+ readonly scopes: Schema.$Array<Schema.String>;
1229
1220
  /** Access-token deadline as an ISO string, or null (pat / no expiry). */
1230
- expiresAt: Schema.NullOr<typeof Schema.String>;
1221
+ readonly expiresAt: Schema.NullOr<Schema.String>;
1231
1222
  /** Last refresh failure message, when `status` is `error` / `revoked`. */
1232
- lastError: Schema.NullOr<typeof Schema.String>;
1223
+ readonly lastError: Schema.NullOr<Schema.String>;
1233
1224
  /** When the credential was first stored, ISO. Null while disconnected. */
1234
- connectedAt: Schema.NullOr<typeof Schema.String>;
1225
+ readonly connectedAt: Schema.NullOr<Schema.String>;
1235
1226
  }>;
1236
1227
 
1237
1228
  export declare type ConnectionState = Schema.Schema.Type<typeof ConnectionState>;
@@ -1251,7 +1242,7 @@ export declare type ConnectionState = Schema.Schema.Type<typeof ConnectionState>
1251
1242
  * - `error` — the last refresh failed transiently (5xx / network).
1252
1243
  * The tokens are retained and the next use retries.
1253
1244
  */
1254
- export declare const ConnectionStatus: Schema.Literal<["disconnected", "connected", "expired", "revoked", "error"]>;
1245
+ export declare const ConnectionStatus: Schema.Literals<readonly ["disconnected", "connected", "expired", "revoked", "error"]>;
1255
1246
 
1256
1247
  export declare type ConnectionStatus = Schema.Schema.Type<typeof ConnectionStatus>;
1257
1248
 
@@ -1260,22 +1251,20 @@ export declare type ConnectionStatus = Schema.Schema.Type<typeof ConnectionStatu
1260
1251
  export declare class ConnectionSubjectRequired extends ConnectionSubjectRequired_base {
1261
1252
  }
1262
1253
 
1263
- declare const ConnectionSubjectRequired_base: Schema.TaggedErrorClass<ConnectionSubjectRequired, "ConnectionSubjectRequired", {
1264
- readonly _tag: Schema.tag<"ConnectionSubjectRequired">;
1265
- } & {
1266
- connectionId: typeof Schema.String;
1267
- }>;
1254
+ declare const ConnectionSubjectRequired_base: Schema.Class<ConnectionSubjectRequired, Schema.TaggedStruct<"ConnectionSubjectRequired", {
1255
+ readonly connectionId: Schema.String;
1256
+ }>, YieldableError>;
1268
1257
 
1269
1258
  /**
1270
1259
  * `__voltro.connections.submitToken` — store a pasted personal access token.
1271
1260
  * A mutation (it writes the credential row) targeting no user table.
1272
1261
  */
1273
1262
  export declare const connectionSubmitTokenDescriptor: MutationProcedureDescriptor<"__voltro.connections.submitToken", Schema.Struct<{
1274
- connectionId: typeof Schema.String;
1275
- token: typeof Schema.String;
1263
+ readonly connectionId: Schema.String;
1264
+ readonly token: Schema.String;
1276
1265
  }>, Schema.Struct<{
1277
- ok: typeof Schema.Boolean;
1278
- }>, Schema.Union<[typeof ConnectionNotDeclared, typeof ConnectionSubjectRequired, typeof ConnectionKindMismatch, typeof ConnectionHandshakeFailed]>>;
1266
+ readonly ok: Schema.Boolean;
1267
+ }>, Schema.Union<readonly [typeof ConnectionNotDeclared, typeof ConnectionSubjectRequired, typeof ConnectionKindMismatch, typeof ConnectionHandshakeFailed]>>;
1279
1268
 
1280
1269
  /**
1281
1270
  * The database refused a write because it broke an integrity rule the SCHEMA
@@ -1315,24 +1304,22 @@ export declare class ConstraintViolation extends ConstraintViolation_base {
1315
1304
  get message(): string;
1316
1305
  }
1317
1306
 
1318
- declare const ConstraintViolation_base: Schema.TaggedErrorClass<ConstraintViolation, "ConstraintViolation", {
1319
- readonly _tag: Schema.tag<"ConstraintViolation">;
1320
- } & {
1307
+ declare const ConstraintViolation_base: Schema.Class<ConstraintViolation, Schema.TaggedStruct<"ConstraintViolation", {
1321
1308
  /**
1322
1309
  * Which rule fired. `foreignKey` = the row you referenced does not exist;
1323
1310
  * `foreignKeyInUse` = this row may not go, others still reference it. They
1324
1311
  * are opposite situations with opposite fixes, so a UI branches on them
1325
1312
  * separately.
1326
1313
  */
1327
- kind: Schema.Literal<["foreignKey", "foreignKeyInUse", "unique", "notNull", "check"]>;
1314
+ readonly kind: Schema.Literals<readonly ["foreignKey", "foreignKeyInUse", "unique", "notNull", "check"]>;
1328
1315
  /** The table the write targeted — the framework's own name for it, not the driver's. */
1329
- table: typeof Schema.String;
1316
+ readonly table: Schema.String;
1330
1317
  /** Which store op was attempted: 'insert' | 'update' | 'delete' | …. */
1331
- operation: typeof Schema.String;
1318
+ readonly operation: Schema.String;
1332
1319
  /** The constraint / index name, when the dialect names one. */
1333
- constraint: Schema.optional<typeof Schema.String>;
1320
+ readonly constraint: Schema.optional<Schema.String>;
1334
1321
  /** The column, when the dialect names one instead of (or beside) a constraint. */
1335
- column: Schema.optional<typeof Schema.String>;
1322
+ readonly column: Schema.optional<Schema.String>;
1336
1323
  /**
1337
1324
  * A fuller sentence, when the FRAMEWORK raised this rather than the driver.
1338
1325
  *
@@ -1347,8 +1334,8 @@ declare const ConstraintViolation_base: Schema.TaggedErrorClass<ConstraintViolat
1347
1334
  * a row value. Absent for everything `classifyConstraintViolation` reads off
1348
1335
  * an error the database reported.
1349
1336
  */
1350
- detail: Schema.optional<typeof Schema.String>;
1351
- }>;
1337
+ readonly detail: Schema.optional<Schema.String>;
1338
+ }>, YieldableError>;
1352
1339
 
1353
1340
  /**
1354
1341
  * A handle to a cluster-coordinated periodic task the plugin armed via
@@ -1418,6 +1405,14 @@ export declare interface CoordinatedTickOutcome {
1418
1405
  readonly nextDueInMs?: number | null;
1419
1406
  }
1420
1407
 
1408
+ /** Index reuse for one subscription's immutable snapshots and returned rows.
1409
+ * Arbitrary mutable input must use applyRowPatch. A different base rebuilds
1410
+ * the index; reset releases it on snapshot replacement or owner disposal. */
1411
+ export declare const createRowPatchApplier: () => {
1412
+ readonly apply: typeof applyRowPatch;
1413
+ readonly reset: () => void;
1414
+ };
1415
+
1421
1416
  /**
1422
1417
  * What a descriptor CARRIES: the author's guards, or the erased form of their
1423
1418
  * `openAccess:` decision — never both.
@@ -1462,7 +1457,7 @@ export declare const DEFAULT_SCOPE_CACHE_MAX_ENTRIES = 10000;
1462
1457
  * purpose: the two per-request store reads then expire together. */
1463
1458
  export declare const DEFAULT_SCOPE_CACHE_TTL_MS = 30000;
1464
1459
 
1465
- export declare const defineAction: <const Name extends string, Input extends Schema.Schema.Any, Output extends Schema.Schema.Any, Error extends Schema.Schema.All = typeof Schema.Never>(options: {
1460
+ export declare const defineAction: <const Name extends string, Input extends Schema.Top, Output extends Schema.Top, Error extends Schema.Top = typeof Schema.Never>(options: {
1466
1461
  readonly name: Name;
1467
1462
  readonly input: Input;
1468
1463
  readonly output: Output;
@@ -1571,7 +1566,7 @@ export declare const defineAction: <const Name extends string, Input extends Sch
1571
1566
  * })
1572
1567
  * ```
1573
1568
  */
1574
- export declare const defineEvent: <const Name extends string, Key extends Schema.Schema.Any, Payload extends Schema.Schema.Any>(options: {
1569
+ export declare const defineEvent: <const Name extends string, Key extends Schema.Top, Payload extends Schema.Top>(options: {
1575
1570
  /**
1576
1571
  * Wire identifier, `camelCase.dotted` like an rpc tag — and it shares the rpc
1577
1572
  * tag COLLISION SPACE, so a duplicate aborts boot rather than resolving itself
@@ -1668,7 +1663,7 @@ export declare const defineEvent: <const Name extends string, Key extends Schema
1668
1663
  readonly delivery?: EventDeliverySemantics;
1669
1664
  }) => EventDescriptor<Name, Key, Payload>;
1670
1665
 
1671
- export declare const defineMutation: <const Name extends string, Input extends Schema.Schema.Any, Output extends Schema.Schema.Any, Error extends Schema.Schema.All = typeof Schema.Never>(options: {
1666
+ export declare const defineMutation: <const Name extends string, Input extends Schema.Top, Output extends Schema.Top, Error extends Schema.Top = typeof Schema.Never>(options: {
1672
1667
  readonly name: Name;
1673
1668
  readonly input: Input;
1674
1669
  readonly output: Output;
@@ -1831,11 +1826,11 @@ export declare const definePluginRoute: (route: PluginRpcRoute) => PluginRpcRout
1831
1826
  * needs resource acquisition (Layer.scoped).
1832
1827
  */
1833
1828
  export declare const definePluginService: <I, S>(identifier: string, implementation: S) => {
1834
- readonly Tag: Context.Tag<I, S>;
1829
+ readonly Tag: Context.Service<I, S>;
1835
1830
  readonly Live: Layer.Layer<I, never, never>;
1836
1831
  };
1837
1832
 
1838
- export declare const defineQuery: <const Name extends string, Input extends Schema.Schema.Any, Output extends Schema.Schema.Any, Error extends Schema.Schema.All = typeof Schema.Never>(options: {
1833
+ export declare const defineQuery: <const Name extends string, Input extends Schema.Top, Output extends Schema.Top, Error extends Schema.Top = typeof Schema.Never>(options: {
1839
1834
  readonly name: Name;
1840
1835
  readonly input: Input;
1841
1836
  readonly output: Output;
@@ -1935,7 +1930,7 @@ export declare const defineQuery: <const Name extends string, Input extends Sche
1935
1930
  * returns a `Stream<Element>` (e.g. an agent run's `AgentEvent`s); the
1936
1931
  * client consumes it via `useAgentStream`. Reusable for ANY push stream.
1937
1932
  */
1938
- export declare const defineStream: <const Name extends string, Input extends Schema.Schema.Any, Element extends Schema.Schema.Any, Error extends Schema.Schema.All = typeof Schema.Never>(options: {
1933
+ export declare const defineStream: <const Name extends string, Input extends Schema.Top, Element extends Schema.Top, Error extends Schema.Top = typeof Schema.Never>(options: {
1939
1934
  readonly name: Name;
1940
1935
  readonly input: Input;
1941
1936
  readonly element: Element;
@@ -2011,8 +2006,8 @@ export declare const diffRows: (prev: ReadonlyArray<PatchRow>, next: ReadonlyArr
2011
2006
  * - For each id in next: not in prev → `add`; in prev but content
2012
2007
  * differs → `replace`; in prev and equal → no op.
2013
2008
  * - For each id in prev but not in next → `remove`.
2014
- * - `order` is next's id sequence verbatim, so apply can reconstruct
2015
- * the exact ordering (including a pure reorder, where `ops` is empty).
2009
+ * - `order` is null for an unchanged sequence, otherwise next's IDs,
2010
+ * so apply can reconstruct the exact ordering (including a pure reorder, where `ops` is empty).
2016
2011
  *
2017
2012
  * Throws if any row lacks an `id` — the caller (dispatcher) only diffs
2018
2013
  * id-keyed result sets; a result without ids must ship a full snapshot,
@@ -2121,7 +2116,7 @@ export declare const EVENT_ROUTE_SEP = "\0";
2121
2116
 
2122
2117
  /** First element of every subscription: the stream is live from here on. */
2123
2118
  export declare const eventAttached: Schema.Struct<{
2124
- _tag: Schema.Literal<["attached"]>;
2119
+ readonly _tag: Schema.Literal<"attached">;
2125
2120
  }>;
2126
2121
 
2127
2122
  /**
@@ -2154,7 +2149,7 @@ export declare type EventDeliverySemantics = 'each' | 'latest';
2154
2149
  * Type parameters are inferred from the Schemas, and every call site — `publish`,
2155
2150
  * `useEvent`, a workflow trigger — derives its types from this one value.
2156
2151
  */
2157
- export declare interface EventDescriptor<Name extends string, Key extends Schema.Schema.Any, Payload extends Schema.Schema.Any> {
2152
+ export declare interface EventDescriptor<Name extends string, Key extends Schema.Top, Payload extends Schema.Top, Guards = DeclaredAccess<GuardedKey<Key>>> {
2158
2153
  readonly kind: 'event';
2159
2154
  readonly name: Name;
2160
2155
  readonly key: Key;
@@ -2163,7 +2158,7 @@ export declare interface EventDescriptor<Name extends string, Key extends Schema
2163
2158
  * `openAccess:` decision, never both (see `DeclaredAccess`). Re-checked when
2164
2159
  * the subject changes, not per delivery — see `EventDefinition.guards` for
2165
2160
  * why that distinction is deliberate. */
2166
- readonly guards: DeclaredAccess<Schema.Schema.Type<Key>> | undefined;
2161
+ readonly guards: Guards | undefined;
2167
2162
  /** The declared `openAccess:` reason, when there is one — what the boot gate
2168
2163
  * and `voltro doctor` read. The enforcement paths read `guards`. */
2169
2164
  readonly openAccess: string | undefined;
@@ -2191,60 +2186,54 @@ export declare interface EventDescriptor<Name extends string, Key extends Schema
2191
2186
  * every key — which is a real architecture (a single-threaded actor per room)
2192
2187
  * and not the one this framework has.
2193
2188
  */
2194
- export declare const eventEnvelope: <P extends Schema.Schema.Any>(payload: P) => Schema.Struct<{
2195
- _tag: Schema.Literal<["event"]>;
2189
+ export declare const eventEnvelope: <P extends Schema.Top>(payload: P) => Schema.Struct<{
2190
+ readonly _tag: Schema.Literal<"event">;
2196
2191
  /** Publishing instance id — serials are only comparable within one. */
2197
- origin: typeof Schema.String;
2192
+ readonly origin: Schema.String;
2198
2193
  /** Monotonic per (origin, event, tenant, key). */
2199
- n: typeof Schema.Number;
2200
- emittedAt: typeof Schema.Number;
2201
- payload: P;
2194
+ readonly n: Schema.Number;
2195
+ readonly emittedAt: Schema.Number;
2196
+ readonly payload: P;
2202
2197
  }>;
2203
2198
 
2204
2199
  /** Told to the subscriber when the SERVER knows it cannot fill a gap. */
2205
2200
  export declare const eventGap: Schema.Struct<{
2206
- _tag: Schema.Literal<["gap"]>;
2201
+ readonly _tag: Schema.Literal<"gap">;
2207
2202
  /** How many deliveries are known lost. Never a guess: a shortfall is computed
2208
2203
  * from the requested serial against what the ring still holds. */
2209
- missed: typeof Schema.Number;
2204
+ readonly missed: Schema.Number;
2210
2205
  /** `buffer` — evicted before this subscriber could be served.
2211
2206
  * `resume` — the re-attach asked for a serial older than the ring. */
2212
- reason: Schema.Literal<["buffer", "resume"]>;
2207
+ readonly reason: Schema.Literals<readonly ["buffer", "resume"]>;
2213
2208
  }>;
2214
2209
 
2215
2210
  /** The routing key did not decode against the descriptor's schema. */
2216
2211
  export declare class EventKeyInvalid extends EventKeyInvalid_base {
2217
2212
  }
2218
2213
 
2219
- declare const EventKeyInvalid_base: Schema.TaggedErrorClass<EventKeyInvalid, "EventKeyInvalid", {
2220
- readonly _tag: Schema.tag<"EventKeyInvalid">;
2221
- } & {
2222
- event: typeof Schema.String;
2223
- message: typeof Schema.String;
2224
- }>;
2214
+ declare const EventKeyInvalid_base: Schema.Class<EventKeyInvalid, Schema.TaggedStruct<"EventKeyInvalid", {
2215
+ readonly event: Schema.String;
2216
+ readonly message: Schema.String;
2217
+ }>, YieldableError>;
2225
2218
 
2226
2219
  /** The payload did not decode against the descriptor's schema. */
2227
2220
  export declare class EventPayloadInvalid extends EventPayloadInvalid_base {
2228
2221
  }
2229
2222
 
2230
- declare const EventPayloadInvalid_base: Schema.TaggedErrorClass<EventPayloadInvalid, "EventPayloadInvalid", {
2231
- readonly _tag: Schema.tag<"EventPayloadInvalid">;
2232
- } & {
2233
- event: typeof Schema.String;
2234
- message: typeof Schema.String;
2235
- }>;
2223
+ declare const EventPayloadInvalid_base: Schema.Class<EventPayloadInvalid, Schema.TaggedStruct<"EventPayloadInvalid", {
2224
+ readonly event: Schema.String;
2225
+ readonly message: Schema.String;
2226
+ }>, YieldableError>;
2236
2227
 
2237
2228
  /** The encoded envelope exceeds `MAX_EVENT_ENVELOPE_BYTES`. */
2238
2229
  export declare class EventPayloadTooLarge extends EventPayloadTooLarge_base {
2239
2230
  }
2240
2231
 
2241
- declare const EventPayloadTooLarge_base: Schema.TaggedErrorClass<EventPayloadTooLarge, "EventPayloadTooLarge", {
2242
- readonly _tag: Schema.tag<"EventPayloadTooLarge">;
2243
- } & {
2244
- event: typeof Schema.String;
2245
- bytes: typeof Schema.Number;
2246
- limit: typeof Schema.Number;
2247
- }>;
2232
+ declare const EventPayloadTooLarge_base: Schema.Class<EventPayloadTooLarge, Schema.TaggedStruct<"EventPayloadTooLarge", {
2233
+ readonly event: Schema.String;
2234
+ readonly bytes: Schema.Number;
2235
+ readonly limit: Schema.Number;
2236
+ }>, YieldableError>;
2248
2237
 
2249
2238
  export declare type EventResumePoint = {
2250
2239
  readonly origin: string;
@@ -2253,8 +2242,8 @@ export declare type EventResumePoint = {
2253
2242
 
2254
2243
  /** Where a re-attaching subscriber left off, per origin. */
2255
2244
  export declare const eventResumePoint: Schema.Struct<{
2256
- origin: typeof Schema.String;
2257
- n: typeof Schema.Number;
2245
+ readonly origin: Schema.String;
2246
+ readonly n: Schema.Number;
2258
2247
  }>;
2259
2248
 
2260
2249
  export declare const eventRoute: (tenantId: string | null, event: string, key: unknown) => string;
@@ -2277,24 +2266,24 @@ export declare type EventStreamEvent<P> = {
2277
2266
  * What a subscription emits. `attached` first, then `event`s, with `gap`
2278
2267
  * interleaved whenever the server can prove a loss.
2279
2268
  */
2280
- export declare const eventStreamEvent: <P extends Schema.Schema.Any>(payload: P) => Schema.Union<[Schema.Struct<{
2281
- _tag: Schema.Literal<["attached"]>;
2269
+ export declare const eventStreamEvent: <P extends Schema.Top>(payload: P) => Schema.Union<readonly [Schema.Struct<{
2270
+ readonly _tag: Schema.Literal<"attached">;
2282
2271
  }>, Schema.Struct<{
2283
- _tag: Schema.Literal<["event"]>;
2272
+ readonly _tag: Schema.Literal<"event">;
2284
2273
  /** Publishing instance id — serials are only comparable within one. */
2285
- origin: typeof Schema.String;
2274
+ readonly origin: Schema.String;
2286
2275
  /** Monotonic per (origin, event, tenant, key). */
2287
- n: typeof Schema.Number;
2288
- emittedAt: typeof Schema.Number;
2289
- payload: P;
2276
+ readonly n: Schema.Number;
2277
+ readonly emittedAt: Schema.Number;
2278
+ readonly payload: P;
2290
2279
  }>, Schema.Struct<{
2291
- _tag: Schema.Literal<["gap"]>;
2280
+ readonly _tag: Schema.Literal<"gap">;
2292
2281
  /** How many deliveries are known lost. Never a guess: a shortfall is computed
2293
2282
  * from the requested serial against what the ring still holds. */
2294
- missed: typeof Schema.Number;
2283
+ readonly missed: Schema.Number;
2295
2284
  /** `buffer` — evicted before this subscriber could be served.
2296
2285
  * `resume` — the re-attach asked for a serial older than the ring. */
2297
- reason: Schema.Literal<["buffer", "resume"]>;
2286
+ readonly reason: Schema.Literals<readonly ["buffer", "resume"]>;
2298
2287
  }>]>;
2299
2288
 
2300
2289
  /**
@@ -2306,11 +2295,11 @@ export declare const eventStreamEvent: <P extends Schema.Schema.Any>(payload: P)
2306
2295
  * the client knows whether it has seen this stream before — the server cannot
2307
2296
  * tell a reconnect from a fresh mount.
2308
2297
  */
2309
- export declare const eventSubscribeInput: <K extends Schema.Schema.Any>(key: K) => Schema.Struct<{
2310
- key: K;
2311
- resume: Schema.optional<Schema.Array$<Schema.Struct<{
2312
- origin: typeof Schema.String;
2313
- n: typeof Schema.Number;
2298
+ export declare const eventSubscribeInput: <K extends Schema.Top>(key: K) => Schema.Struct<{
2299
+ readonly key: K;
2300
+ readonly resume: Schema.optional<Schema.$Array<Schema.Struct<{
2301
+ readonly origin: Schema.String;
2302
+ readonly n: Schema.Number;
2314
2303
  }>>>;
2315
2304
  }>;
2316
2305
 
@@ -2323,31 +2312,31 @@ export declare const eventSubscribeInput: <K extends Schema.Schema.Any>(key: K)
2323
2312
  * with `useSubscription` instead of being a second realtime concept in the same
2324
2313
  * app.
2325
2314
  */
2326
- export declare const eventToRpc: <Name extends string, Key extends Schema.Schema.Any, Payload extends Schema.Schema.Any>(descriptor: EventDescriptor<Name, Key, Payload>, extraErrors?: ReadonlyArray<Schema.Schema.All>) => Rpc.Rpc<Name, Schema.Struct<{
2327
- key: Key;
2328
- resume: Schema.optional<Schema.Array$<Schema.Struct<{
2329
- origin: typeof Schema.String;
2330
- n: typeof Schema.Number;
2315
+ export declare const eventToRpc: <Name extends string, Key extends Schema.Top, Payload extends Schema.Top>(descriptor: EventDescriptor<Name, Key, Payload, ReadonlyArray<unknown>>, extraErrors?: ReadonlyArray<Schema.Top>) => Rpc.Rpc<Name, Schema.Struct<{
2316
+ readonly key: Key;
2317
+ readonly resume: Schema.optional<Schema.$Array<Schema.Struct<{
2318
+ readonly origin: Schema.String;
2319
+ readonly n: Schema.Number;
2331
2320
  }>>>;
2332
- }>, Stream<Schema.Union<[Schema.Struct<{
2333
- _tag: Schema.Literal<["attached"]>;
2321
+ }>, Stream<Schema.Union<readonly [Schema.Struct<{
2322
+ readonly _tag: Schema.Literal<"attached">;
2334
2323
  }>, Schema.Struct<{
2335
- _tag: Schema.Literal<["event"]>;
2324
+ readonly _tag: Schema.Literal<"event">;
2336
2325
  /** Publishing instance id — serials are only comparable within one. */
2337
- origin: typeof Schema.String;
2326
+ readonly origin: Schema.String;
2338
2327
  /** Monotonic per (origin, event, tenant, key). */
2339
- n: typeof Schema.Number;
2340
- emittedAt: typeof Schema.Number;
2341
- payload: Payload;
2328
+ readonly n: Schema.Number;
2329
+ readonly emittedAt: Schema.Number;
2330
+ readonly payload: Payload;
2342
2331
  }>, Schema.Struct<{
2343
- _tag: Schema.Literal<["gap"]>;
2332
+ readonly _tag: Schema.Literal<"gap">;
2344
2333
  /** How many deliveries are known lost. Never a guess: a shortfall is computed
2345
2334
  * from the requested serial against what the ring still holds. */
2346
- missed: typeof Schema.Number;
2335
+ readonly missed: Schema.Number;
2347
2336
  /** `buffer` — evicted before this subscriber could be served.
2348
2337
  * `resume` — the re-attach asked for a serial older than the ring. */
2349
- reason: Schema.Literal<["buffer", "resume"]>;
2350
- }>]>, Schema.Schema.Any>, typeof Schema.Never, never>;
2338
+ readonly reason: Schema.Literals<readonly ["buffer", "resume"]>;
2339
+ }>]>, Schema.Top>, Schema.Never, never, never>;
2351
2340
 
2352
2341
  /**
2353
2342
  * The WEBHOOK audience of a declared event.
@@ -2403,7 +2392,7 @@ export declare interface ExposeAsToolSpec {
2403
2392
  * by the server group (cli/dev.ts) and the generated client group
2404
2393
  * (cli/codegen.ts) so both ends agree on the wire shape.
2405
2394
  */
2406
- export declare type ExtraErrors = ReadonlyArray<Schema.Schema.All>;
2395
+ export declare type ExtraErrors = ReadonlyArray<Schema.Top>;
2407
2396
 
2408
2397
  /** Release a claim after the handler errored, so a retry can re-process. */
2409
2398
  export declare const failIdempotent: (store: IdempotencyStore, scope: string, key: string) => Promise<void>;
@@ -2447,6 +2436,14 @@ export declare const findAdvisoryResourceGuards: (procedures: ReadonlyArray<{
2447
2436
  /** Record a completed response for replay. */
2448
2437
  export declare const finishIdempotent: (store: IdempotencyStore, scope: string, key: string, response: IdempotencyResponse, now: number) => Promise<void>;
2449
2438
 
2439
+ /**
2440
+ * The schema as the generator should see it: every `Number` node checked
2441
+ * finite, so it is written as `type: number` and keeps its bounds and check
2442
+ * fragments. Decoding is untouched — the view exists only to be generated from.
2443
+ * A node with an encoding is left as it is: the generator reads its encoded side.
2444
+ */
2445
+ export declare const finiteNumberView: (ast: SchemaAST.AST, memo?: Map<SchemaAST.AST, SchemaAST.AST>) => SchemaAST.AST;
2446
+
2450
2447
  /**
2451
2448
  * The value a ONE-SHOT read of an rpc resolves to, given the first value it
2452
2449
  * delivered.
@@ -2550,6 +2547,14 @@ export declare interface GuardCheckSpec {
2550
2547
  readonly resource?: (input: unknown) => string | undefined;
2551
2548
  }
2552
2549
 
2550
+ /**
2551
+ * The key a guard sees. `Schema.Top` is the wildcard (`EventDescriptor<string,
2552
+ * Schema.Top, infer P>` in a helper's conditional type); its `Type` is
2553
+ * `unknown`, and guards over `unknown` accept no guarded descriptor. The
2554
+ * wildcard reads as `never`, like `AnyEventDescriptor`, so every event fits it.
2555
+ */
2556
+ declare type GuardedKey<Key extends Schema.Top> = Schema.Top extends Key ? never : Schema.Schema.Type<Key>;
2557
+
2553
2558
  /** One or more declarative guards on a descriptor. All must pass (AND across
2554
2559
  * entries; `mode` controls AND/OR WITHIN one entry's scope array). */
2555
2560
  export declare type Guards<Input = unknown> = ReadonlyArray<AnyGuardSpec<Input>>;
@@ -2778,17 +2783,8 @@ export declare const IMPERSONATION_METADATA_KEY: "impersonation";
2778
2783
  * concluded the guard was not being applied. It was; it never got the chance.
2779
2784
  * With a complete payload the picture flipped immediately.
2780
2785
  *
2781
- * That is the more dangerous of the two misreadings — it says "unprotected"
2782
- * about something protected — and it is the one the ordering makes easy. So a
2783
- * guarded procedure says so in the title:
2784
- *
2785
- * workAreas.create input (guarded — the guard did NOT run: the payload
2786
- * failed to decode first, so this says nothing about access)
2787
- * └─ ["type"] └─ is missing
2788
- *
2789
- * It discloses nothing new. That a procedure is guarded is already visible to
2790
- * any caller who sends a VALID payload and receives `ScopeError`, and the
2791
- * message names no scope, no resource and no field type.
2786
+ * The sentence is on the title line because that is the line a person reads
2787
+ * first, and the whole misreading happened before the second line.
2792
2788
  */
2793
2789
  export declare const inputLabel: (procedure?: string, guarded?: boolean) => string;
2794
2790
 
@@ -2918,6 +2914,22 @@ export declare const isWireReachable: (descriptor: {
2918
2914
 
2919
2915
  export declare const JSONAPI_MEDIA_TYPE = "application/vnd.api+json; charset=utf-8";
2920
2916
 
2917
+ export declare interface JsonSchemaDocument {
2918
+ readonly schema: Record<string, unknown>;
2919
+ readonly definitions: Record<string, unknown>;
2920
+ }
2921
+
2922
+ /** The schema and its named definitions, normalised, definitions kept beside the root. */
2923
+ export declare const jsonSchemaDocumentOf: (schema: Schema.Top, options?: JsonSchemaOptions) => JsonSchemaDocument;
2924
+
2925
+ /** The document as ONE object: the root with its definitions inlined under `$defs`. */
2926
+ export declare const jsonSchemaOf: (schema: Schema.Top, options?: JsonSchemaOptions) => Record<string, unknown>;
2927
+
2928
+ export declare interface JsonSchemaOptions {
2929
+ /** `false` keeps objects open (no `additionalProperties: false`). Default: closed. */
2930
+ readonly closed?: boolean;
2931
+ }
2932
+
2921
2933
  /**
2922
2934
  * Build a scope cache. Hand it to `composeAuthStrategies({ scopeCache })` and
2923
2935
  * keep the handle: `invalidate(scopeCacheKey(subject))` from the mutation that
@@ -2977,11 +2989,9 @@ export declare class MutationConnectionRequired extends MutationConnectionRequir
2977
2989
  get message(): string;
2978
2990
  }
2979
2991
 
2980
- declare const MutationConnectionRequired_base: Schema.TaggedErrorClass<MutationConnectionRequired, "MutationConnectionRequired", {
2981
- readonly _tag: Schema.tag<"MutationConnectionRequired">;
2982
- } & {
2983
- traceId: typeof Schema.String;
2984
- }>;
2992
+ declare const MutationConnectionRequired_base: Schema.Class<MutationConnectionRequired, Schema.TaggedStruct<"MutationConnectionRequired", {
2993
+ readonly traceId: Schema.String;
2994
+ }>, YieldableError>;
2985
2995
 
2986
2996
  /** Ordinary writes deduplicate across reconnects. A connection-side effect
2987
2997
  * (for example joining a room) must execute once for EACH native connection. */
@@ -2991,16 +3001,14 @@ export declare class MutationInFlight extends MutationInFlight_base {
2991
3001
  get message(): string;
2992
3002
  }
2993
3003
 
2994
- declare const MutationInFlight_base: Schema.TaggedErrorClass<MutationInFlight, "MutationInFlight", {
2995
- readonly _tag: Schema.tag<"MutationInFlight">;
2996
- } & {
2997
- traceId: typeof Schema.String;
3004
+ declare const MutationInFlight_base: Schema.Class<MutationInFlight, Schema.TaggedStruct<"MutationInFlight", {
3005
+ readonly traceId: Schema.String;
2998
3006
  /** How long to wait before replaying the same key — the first call is still
2999
3007
  * running; a replay before it finishes conflicts again. */
3000
- retryAfterMs: typeof Schema.Number;
3001
- }>;
3008
+ readonly retryAfterMs: Schema.Number;
3009
+ }>, YieldableError>;
3002
3010
 
3003
- export declare interface MutationProcedureDescriptor<Name extends string, Input extends Schema.Schema.Any, Output extends Schema.Schema.Any, Error extends Schema.Schema.All> {
3011
+ export declare interface MutationProcedureDescriptor<Name extends string, Input extends Schema.Top, Output extends Schema.Top, Error extends Schema.Top> {
3004
3012
  readonly kind: 'mutation';
3005
3013
  readonly name: Name;
3006
3014
  readonly input: Input;
@@ -3071,7 +3079,7 @@ export declare interface MutationSerialization<Input = unknown> {
3071
3079
  readonly maxPending?: number;
3072
3080
  }
3073
3081
 
3074
- export declare const mutationToRpc: <Name extends string, Input extends Schema.Schema.Any, Output extends Schema.Schema.Any, Err extends Schema.Schema.All>(descriptor: MutationProcedureDescriptor<Name, Input, Output, Err>, extraErrors?: ExtraErrors) => Rpc.Rpc<Name, Input extends Schema.Struct.Fields ? Schema.Struct<Input> : Input, Output, Schema.Schema.All, never>;
3082
+ export declare const mutationToRpc: <Name extends string, Input extends Schema.Top, Output extends Schema.Top, Err extends Schema.Top>(descriptor: MutationProcedureDescriptor<Name, Input, Output, Err>, extraErrors?: ExtraErrors) => Rpc.Rpc<Name, Input extends Schema.Struct.Fields ? Schema.Struct<Input> : Input, Output, Schema.Top, never, never>;
3075
3083
 
3076
3084
  export declare interface NestedTargetFields<Input = unknown> {
3077
3085
  /** Dot-path to the nested array within the query VALUE to patch (e.g.
@@ -3131,12 +3139,10 @@ export declare class NoRowFound extends NoRowFound_base {
3131
3139
  get message(): string;
3132
3140
  }
3133
3141
 
3134
- declare const NoRowFound_base: Schema.TaggedErrorClass<NoRowFound, "NoRowFound", {
3135
- readonly _tag: Schema.tag<"NoRowFound">;
3136
- } & {
3137
- table: typeof Schema.String;
3138
- found: typeof Schema.Number;
3139
- }>;
3142
+ declare const NoRowFound_base: Schema.Class<NoRowFound, Schema.TaggedStruct<"NoRowFound", {
3143
+ readonly table: Schema.String;
3144
+ readonly found: Schema.Number;
3145
+ }>, YieldableError>;
3140
3146
 
3141
3147
  /**
3142
3148
  * A resource guard's refusal when the resource it names does not exist — as
@@ -3156,13 +3162,11 @@ declare const NoRowFound_base: Schema.TaggedErrorClass<NoRowFound, "NoRowFound",
3156
3162
  export declare class NoSuchResource extends NoSuchResource_base {
3157
3163
  }
3158
3164
 
3159
- declare const NoSuchResource_base: Schema.TaggedErrorClass<NoSuchResource, "NoSuchResource", {
3160
- readonly _tag: Schema.tag<"NoSuchResource">;
3161
- } & {
3162
- resourceType: Schema.NullOr<typeof Schema.String>;
3163
- resourceId: typeof Schema.String;
3164
- message: typeof Schema.String;
3165
- }>;
3165
+ declare const NoSuchResource_base: Schema.Class<NoSuchResource, Schema.TaggedStruct<"NoSuchResource", {
3166
+ readonly resourceType: Schema.NullOr<Schema.String>;
3167
+ readonly resourceId: Schema.String;
3168
+ readonly message: Schema.String;
3169
+ }>, YieldableError>;
3166
3170
 
3167
3171
  /**
3168
3172
  * What a plugin contributes to the OTel layer via `contributeObservability`.
@@ -3290,7 +3294,7 @@ export declare const parseEventRoute: (route: string) => {
3290
3294
  /** The record from a link, or `null` for anything that is not a pairing link. */
3291
3295
  export declare const parsePairingLink: (url: string) => Pairing | null;
3292
3296
 
3293
- export declare const patchCellSchema: Schema.transform<typeof Schema.Unknown, typeof Schema.Unknown>;
3297
+ export declare const patchCellSchema: Schema.decodeTo<Schema.Unknown, Schema.Unknown, never, never>;
3294
3298
 
3295
3299
  /** A single row in a subscription result. Must carry an `id`; everything
3296
3300
  * else is opaque to the patch layer. */
@@ -3304,34 +3308,37 @@ export declare type PatchRow = Readonly<Record<string, unknown>> & {
3304
3308
  export declare const pathToId: (path: string) => string;
3305
3309
 
3306
3310
  export declare const PendingApproval: Schema.Struct<{
3307
- id: typeof Schema.String;
3311
+ readonly id: Schema.String;
3308
3312
  /** The rpc tag whose execution is pending. */
3309
- procedure: typeof Schema.String;
3310
- kind: Schema.Literal<["mutation", "action"]>;
3313
+ readonly procedure: Schema.String;
3314
+ readonly kind: Schema.Literals<readonly ["mutation", "action"]>;
3311
3315
  /** Subject id of whoever asked. Never the approver. */
3312
- requestedBy: Schema.NullOr<typeof Schema.String>;
3313
- status: Schema.Literal<["pending", "approved", "rejected", "expired", "consumed"]>;
3316
+ readonly requestedBy: Schema.NullOr<Schema.String>;
3317
+ readonly status: Schema.Literals<readonly ["pending", "approved", "rejected", "expired", "consumed"]>;
3314
3318
  /** The declared reason from the descriptor, if any. */
3315
- reason: Schema.NullOr<typeof Schema.String>;
3319
+ readonly reason: Schema.NullOr<Schema.String>;
3316
3320
  /** Scope(s) an approver must hold. */
3317
- requiredScopes: Schema.Array$<typeof Schema.String>;
3318
- requestedAt: typeof Schema.String;
3319
- expiresAt: typeof Schema.String;
3320
- decidedBy: Schema.NullOr<typeof Schema.String>;
3321
- decidedAt: Schema.NullOr<typeof Schema.String>;
3321
+ readonly requiredScopes: Schema.$Array<Schema.String>;
3322
+ readonly requestedAt: Schema.String;
3323
+ readonly expiresAt: Schema.String;
3324
+ readonly decidedBy: Schema.NullOr<Schema.String>;
3325
+ readonly decidedAt: Schema.NullOr<Schema.String>;
3322
3326
  /** The approver's note, when they left one. */
3323
- note: Schema.NullOr<typeof Schema.String>;
3327
+ readonly note: Schema.NullOr<Schema.String>;
3324
3328
  /**
3325
3329
  * How this row relates to the CALLING subject — the whole point of the feed.
3326
3330
  * `'to-decide'` = they may act on it; `'requested'` = they asked for it.
3327
3331
  * A row is never both: self-approval is refused, so a requester never
3328
3332
  * qualifies as its approver.
3329
3333
  */
3330
- relation: Schema.Literal<["to-decide", "requested"]>;
3334
+ readonly relation: Schema.Literals<readonly ["to-decide", "requested"]>;
3331
3335
  }>;
3332
3336
 
3333
3337
  export declare type PendingApproval = Schema.Schema.Type<typeof PendingApproval>;
3334
3338
 
3339
+ /** The normalisation above, applied to any JSON Schema fragment. */
3340
+ export declare const plainJsonSchema: (value: unknown) => unknown;
3341
+
3335
3342
  /**
3336
3343
  * Called once at app boot, after `voltro dev` resolves the plugin
3337
3344
  * list and before the rpc server starts accepting connections. Use
@@ -3404,7 +3411,7 @@ export declare interface PluginBindContext {
3404
3411
  */
3405
3412
  readonly cache?: PluginCacheHandle;
3406
3413
  /**
3407
- * The framework's already-open `SqlClient` (from `@effect/sql`) — the
3414
+ * The framework's already-open `SqlClient` (from `effect/sql`) — the
3408
3415
  * SAME pool the app's store uses, with its TLS, credentials and schema.
3409
3416
  * For SQL the store's methods cannot express, against tables that are
3410
3417
  * DECLARED (`extendSchema.tables`, or the app's own schema): it never
@@ -3728,7 +3735,7 @@ export declare interface PluginEnvVar {
3728
3735
  * Requires the plugin to ship the schema as a NAMED export from `module`.
3729
3736
  */
3730
3737
  export declare interface PluginErrorSchema {
3731
- readonly schema: Schema.Schema.All;
3738
+ readonly schema: Schema.Top;
3732
3739
  readonly import: {
3733
3740
  readonly module: string;
3734
3741
  readonly name: string;
@@ -4232,9 +4239,9 @@ export declare interface PluginMigration {
4232
4239
  */
4233
4240
  /**
4234
4241
  * The `sql` parameter the framework hands the migration is the live
4235
- * `SqlClient.SqlClient` from `@effect/sql`. The reference is type-only,
4242
+ * `SqlClient.SqlClient` from `effect/sql`. The reference is type-only,
4236
4243
  * so it adds no runtime dependency — `@voltro/protocol` still ships
4237
- * without pulling `@effect/sql` into a plugin's bundle.
4244
+ * without pulling `effect/sql` into a plugin's bundle.
4238
4245
  */
4239
4246
  export declare type PluginMigrationSqlClient = SqlClient.SqlClient;
4240
4247
 
@@ -4329,11 +4336,11 @@ export declare interface PluginRpcRoute {
4329
4336
  /** Optional human-readable description; surfaced in the dashboard. */
4330
4337
  readonly description?: string;
4331
4338
  /** Input schema — same `effect/Schema` shape user routes use. */
4332
- readonly input: Schema.Schema.Any;
4339
+ readonly input: Schema.Top;
4333
4340
  /** Output schema. */
4334
- readonly output: Schema.Schema.Any;
4341
+ readonly output: Schema.Top;
4335
4342
  /** Optional typed-error schema (TaggedError union). */
4336
- readonly error?: Schema.Schema.All;
4343
+ readonly error?: Schema.Top;
4337
4344
  /**
4338
4345
  * REACTIVE source table(s) — ONLY for `kind: 'query'`. When set, the
4339
4346
  * framework drives the query REACTIVELY: it re-runs the executor and pushes
@@ -4614,7 +4621,7 @@ export declare const problemDetails: (error: RestFormatError) => Record<string,
4614
4621
  /** A stable, non-resolving URI for an error type: the tag as a URN. */
4615
4622
  export declare const problemTypeOf: (tag: string) => string;
4616
4623
 
4617
- export declare type ProcedureDescriptor = QueryProcedureDescriptor<string, Schema.Schema.Any, Schema.Schema.Any, Schema.Schema.All> | MutationProcedureDescriptor<string, Schema.Schema.Any, Schema.Schema.Any, Schema.Schema.All> | ActionProcedureDescriptor<string, Schema.Schema.Any, Schema.Schema.Any, Schema.Schema.All> | StreamProcedureDescriptor<string, Schema.Schema.Any, Schema.Schema.Any, Schema.Schema.All>;
4624
+ export declare type ProcedureDescriptor = QueryProcedureDescriptor<string, Schema.Top, Schema.Top, Schema.Top> | MutationProcedureDescriptor<string, Schema.Top, Schema.Top, Schema.Top> | ActionProcedureDescriptor<string, Schema.Top, Schema.Top, Schema.Top> | StreamProcedureDescriptor<string, Schema.Top, Schema.Top, Schema.Top>;
4618
4625
 
4619
4626
  /** The shape of one procedure, as the pair of peers must agree on it. */
4620
4627
  export declare interface ProcedureLike {
@@ -4639,10 +4646,10 @@ export declare const procedureShapeDigest: (rpc: ProcedureLike) => string;
4639
4646
  */
4640
4647
  export declare type ProcedureWireError<D extends {
4641
4648
  readonly kind: WireProcedureKind;
4642
- readonly error: Schema.Schema.All;
4649
+ readonly error: Schema.Top;
4643
4650
  }> = Schema.Schema.Type<D['error']> | FrameworkWireError<D['kind']> | RegisteredPluginError;
4644
4651
 
4645
- export declare const PROTOCOL_VERSION: 1;
4652
+ export declare const PROTOCOL_VERSION: 2;
4646
4653
 
4647
4654
  export declare type ProtocolVersion = typeof PROTOCOL_VERSION;
4648
4655
 
@@ -4856,7 +4863,7 @@ export declare interface QueryCacheConfig {
4856
4863
  readonly scope: 'subject' | 'tenant' | 'global';
4857
4864
  }
4858
4865
 
4859
- export declare interface QueryProcedureDescriptor<Name extends string, Input extends Schema.Schema.Any, Output extends Schema.Schema.Any, Error extends Schema.Schema.All> {
4866
+ export declare interface QueryProcedureDescriptor<Name extends string, Input extends Schema.Top, Output extends Schema.Top, Error extends Schema.Top> {
4860
4867
  readonly kind: 'query';
4861
4868
  readonly name: Name;
4862
4869
  readonly input: Input;
@@ -4912,56 +4919,40 @@ export declare interface QueryProcedureDescriptor<Name extends string, Input ext
4912
4919
  readonly internal: boolean | undefined;
4913
4920
  }
4914
4921
 
4915
- export declare const queryToRpc: <Name extends string, Input extends Schema.Schema.Any, Output extends Schema.Schema.Any, Err extends Schema.Schema.All>(descriptor: QueryProcedureDescriptor<Name, Input, Output, Err>, extraErrors?: ExtraErrors) => Rpc.Rpc<Name, Input extends Schema.Struct.Fields ? Schema.Struct<Input> : Input, Stream<Schema.Union<[Schema.Struct<{
4916
- _tag: Schema.Literal<["snapshot"]>;
4917
- revision: typeof Schema.Number;
4918
- data: Output;
4919
- computed: Schema.optional<typeof Schema.Boolean>;
4920
- reconciles: Schema.optional<typeof Schema.String>;
4922
+ export declare const queryToRpc: <Name extends string, Input extends Schema.Top, Output extends Schema.Top, Err extends Schema.Top>(descriptor: QueryProcedureDescriptor<Name, Input, Output, Err>, extraErrors?: ExtraErrors) => Rpc.Rpc<Name, Input extends Schema.Struct.Fields ? Schema.Struct<Input> : Input, Stream<Schema.Union<readonly [Schema.Struct<{
4923
+ readonly _tag: Schema.Literal<"snapshot">;
4924
+ readonly revision: Schema.Number;
4925
+ readonly data: Output;
4926
+ readonly computed: Schema.optional<Schema.Boolean>;
4927
+ readonly reconciles: Schema.optional<Schema.String>;
4921
4928
  }>, Schema.Struct<{
4922
- _tag: Schema.Literal<["delta"]>;
4923
- revision: typeof Schema.Number;
4924
- emittedAt: typeof Schema.Number;
4925
- patch: Schema.Struct<{
4926
- ops: Schema.Array$<Schema.Union<[Schema.Struct<{
4927
- op: Schema.Literal<["add"]>;
4928
- path: typeof Schema.String;
4929
- value: Schema.refine<{
4930
- readonly [x: string]: unknown;
4931
- } & Readonly<Record<string, unknown>> & {
4932
- readonly id: RowId;
4933
- }, Schema.Schema<{
4934
- readonly [x: string]: unknown;
4935
- }, {
4936
- readonly [x: string]: unknown;
4937
- }, never>>;
4929
+ readonly _tag: Schema.Literal<"delta">;
4930
+ readonly revision: Schema.Number;
4931
+ readonly emittedAt: Schema.Number;
4932
+ readonly patch: Schema.Struct<{
4933
+ readonly ops: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
4934
+ readonly op: Schema.Literal<"add">;
4935
+ readonly path: Schema.String;
4936
+ readonly value: Schema.refine< PatchRow, Schema.$Record<Schema.String, Schema.decodeTo<Schema.Unknown, Schema.Unknown, never, never>>>;
4938
4937
  }>, Schema.Struct<{
4939
- op: Schema.Literal<["replace"]>;
4940
- path: typeof Schema.String;
4941
- value: Schema.refine<{
4942
- readonly [x: string]: unknown;
4943
- } & Readonly<Record<string, unknown>> & {
4944
- readonly id: RowId;
4945
- }, Schema.Schema<{
4946
- readonly [x: string]: unknown;
4947
- }, {
4948
- readonly [x: string]: unknown;
4949
- }, never>>;
4938
+ readonly op: Schema.Literal<"replace">;
4939
+ readonly path: Schema.String;
4940
+ readonly value: Schema.refine< PatchRow, Schema.$Record<Schema.String, Schema.decodeTo<Schema.Unknown, Schema.Unknown, never, never>>>;
4950
4941
  }>, Schema.Struct<{
4951
- op: Schema.Literal<["remove"]>;
4952
- path: typeof Schema.String;
4942
+ readonly op: Schema.Literal<"remove">;
4943
+ readonly path: Schema.String;
4953
4944
  }>, Schema.Struct<{
4954
- op: Schema.Literal<["mergeCells"]>;
4955
- path: typeof Schema.String;
4956
- value: Schema.Record$<typeof Schema.String, Schema.transform<typeof Schema.Unknown, typeof Schema.Unknown>>;
4945
+ readonly op: Schema.Literal<"mergeCells">;
4946
+ readonly path: Schema.String;
4947
+ readonly value: Schema.$Record<Schema.String, Schema.decodeTo<Schema.Unknown, Schema.Unknown, never, never>>;
4957
4948
  }>]>>;
4958
- order: Schema.Array$<Schema.Union<[typeof Schema.String, typeof Schema.Number]>>;
4949
+ readonly order: Schema.NullOr<Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Number]>>>;
4959
4950
  }>;
4960
4951
  }>, Schema.Struct<{
4961
- _tag: Schema.Literal<["error"]>;
4962
- error: typeof Schema.Unknown;
4963
- revision: Schema.optional<typeof Schema.Number>;
4964
- }>]>, Schema.Schema.All>, typeof Schema.Never, never>;
4952
+ readonly _tag: Schema.Literal<"error">;
4953
+ readonly error: Schema.Unknown;
4954
+ readonly revision: Schema.optional<Schema.Number>;
4955
+ }>]>, Schema.Top>, Schema.Never, never, never>;
4965
4956
 
4966
4957
  /**
4967
4958
  * The RAW mark, unvalidated, or `null`.
@@ -5159,7 +5150,18 @@ declare interface RestByteResponse {
5159
5150
  * headers CDNs purge by. A request that carries a credential (`Authorization`
5160
5151
  * or a cookie) gets `private, no-cache` and no tags, whatever is declared:
5161
5152
  * what a key or a session may see must never land in a shared cache. Every
5162
- * such answer says `Vary: Authorization, Cookie`. Errors are not affected.
5153
+ * such answer says `Vary: Authorization, Cookie`.
5154
+ *
5155
+ * With `audience`, the ANSWER decides instead of the request's cookies: an
5156
+ * answer that is the same for every reader (`'public'`) is shared even when
5157
+ * the request carries cookies (a consent choice, a signed-in reader on a
5158
+ * public page) — the cache serves it to everyone, so it says only
5159
+ * `Vary: Authorization`; an answer for this reader alone (`'private'`: a
5160
+ * members page, a running experiment) is `private, no-store`. A request with
5161
+ * `Authorization` is private either way.
5162
+ *
5163
+ * Any other answer than a 200 (a 404, a 410, a 401) of a route with `cache`
5164
+ * is `private, no-store`: one reader's "not found" can be another's page.
5163
5165
  */
5164
5166
  declare interface RestCache {
5165
5167
  /** Seconds a cache may serve the answer without asking again. */
@@ -5169,6 +5171,12 @@ declare interface RestCache {
5169
5171
  /** Purge tags from the answer as it goes on the wire, and the input.
5170
5172
  * A tag with whitespace or a comma is dropped (no header can carry it). */
5171
5173
  readonly tags?: (output: unknown, input: unknown) => ReadonlyArray<string>;
5174
+ /** Who may share the answer, decided by the answer and the reader it was
5175
+ * made for: `'public'` — every reader gets the same, cookies are ignored;
5176
+ * `'private'` — this reader's alone, never shared. Answer `'private'` for
5177
+ * a signed-in `subject` whenever anything in the answer depends on who
5178
+ * reads it. Without it, any cookie makes the answer private. */
5179
+ readonly audience?: (output: unknown, input: unknown, subject: Subject) => 'public' | 'private';
5172
5180
  }
5173
5181
 
5174
5182
  export declare type RestDates = 'iso' | 'epoch-ms';
@@ -5324,10 +5332,10 @@ declare interface RestRouteDescriptor<I, O> {
5324
5332
  * before decoding. Omit for routes that take no input. The schema's
5325
5333
  * decoded `Type` flows to the handler's `input`; its `Encoded` is left
5326
5334
  * open (`any`) so any `Schema.Struct(...)` is accepted. */
5327
- readonly input?: Schema.Schema<I, any, never>;
5335
+ readonly input?: Schema.Codec<I, any, never, never>;
5328
5336
  /** Output schema. The handler returns the decoded `Type`; the desugar
5329
5337
  * encodes it to JSON for the `200` response. */
5330
- readonly output: Schema.Schema<O, any, never>;
5338
+ readonly output: Schema.Codec<O, any, never, never>;
5331
5339
  readonly handler: (input: I, ctx: RestRouteContext) => Promise<RestHandlerResult<O>> | RestHandlerResult<O>;
5332
5340
  readonly summary?: string;
5333
5341
  readonly description?: string;
@@ -5411,10 +5419,10 @@ declare interface RestRouteProjection {
5411
5419
  /** `publicApi.idempotent` — the route honours `Idempotency-Key` (under the
5412
5420
  * app's idempotency binding); a client sends one per attempt. */
5413
5421
  readonly idempotent: boolean;
5414
- readonly input: Schema.Schema.All;
5422
+ readonly input: Schema.Top;
5415
5423
  /** The wire names of the input fields bound from the path. */
5416
5424
  readonly pathParams: ReadonlyArray<string>;
5417
- readonly output: Schema.Schema.All;
5425
+ readonly output: Schema.Top;
5418
5426
  /** The first `source` table, when the procedure declares one. */
5419
5427
  readonly source: string | undefined;
5420
5428
  /** Every failure the operation answers with a typed body, and its status:
@@ -5423,7 +5431,7 @@ declare interface RestRouteProjection {
5423
5431
  readonly errorResponses: ReadonlyArray<{
5424
5432
  readonly status: number;
5425
5433
  readonly tag: string;
5426
- readonly schema: Schema.Schema.All;
5434
+ readonly schema: Schema.Top;
5427
5435
  }>;
5428
5436
  readonly format: RestFormat;
5429
5437
  }
@@ -5442,25 +5450,25 @@ declare interface RestStreamResponse {
5442
5450
 
5443
5451
  /**
5444
5452
  * Rewrite a descriptor's schema into the shape the profile puts on the wire:
5445
- * `timestampMs` (`DateFromNumber`) becomes an RFC 3339 string under
5446
- * `dates: 'iso'`, and every struct's property names become `snake_case` under
5447
- * `naming: 'snake_case'` — as a transformation, so decoding a wire value yields
5448
- * the descriptor's own typed value and encoding the typed value yields the
5449
- * wire form. `JSONSchema.make` of the result documents the wire (a
5450
- * `format: date-time` string, the snake keys). Classes and other opaque
5451
- * transformations pass through unchanged; a struct inside one keeps its keys.
5453
+ * `timestampMs` becomes an RFC 3339 string under `dates: 'iso'`, and every
5454
+ * struct's property names become `snake_case` under `naming: 'snake_case'` —
5455
+ * as an encoding, so decoding a wire value yields the descriptor's own typed
5456
+ * value and encoding the typed value yields the wire form.
5457
+ * `Schema.toJsonSchemaDocument` of the result documents the wire (a
5458
+ * `format: date-time` string, the snake keys). Classes and other opaque codecs
5459
+ * pass through unchanged; a struct inside one keeps its keys.
5452
5460
  */
5453
- export declare const restViewSchema: (schema: Schema.Schema.All, format: RestFormat) => Schema.Schema.All;
5461
+ export declare const restViewSchema: (schema: Schema.Top, format: RestFormat) => Schema.Top;
5454
5462
 
5455
5463
  /** The id of a row, addressed in op paths as `/<id>`. */
5456
5464
  export declare type RowId = string | number;
5457
5465
 
5458
5466
  /** The full delta payload: the per-row ops plus the authoritative id
5459
- * ordering of the resulting set. */
5467
+ * ordering when it changes. */
5460
5468
  export declare interface RowPatch {
5461
5469
  readonly ops: ReadonlyArray<RowPatchOp>;
5462
- /** Id sequence of the resulting (next) row set, in order. */
5463
- readonly order: ReadonlyArray<RowId>;
5470
+ /** null preserves the previous id sequence; an array supplies the new one. */
5471
+ readonly order: ReadonlyArray<RowId> | null;
5464
5472
  }
5465
5473
 
5466
5474
  /**
@@ -5499,73 +5507,41 @@ export declare type RowPatchOp = {
5499
5507
  readonly value: Readonly<Record<string, unknown>>;
5500
5508
  };
5501
5509
 
5502
- export declare const rowPatchOpSchema: Schema.Union<[Schema.Struct<{
5503
- op: Schema.Literal<["add"]>;
5504
- path: typeof Schema.String;
5505
- value: Schema.refine<{
5506
- readonly [x: string]: unknown;
5507
- } & Readonly<Record<string, unknown>> & {
5508
- readonly id: RowId;
5509
- }, Schema.Schema<{
5510
- readonly [x: string]: unknown;
5511
- }, {
5512
- readonly [x: string]: unknown;
5513
- }, never>>;
5510
+ export declare const rowPatchOpSchema: Schema.Union<readonly [Schema.Struct<{
5511
+ readonly op: Schema.Literal<"add">;
5512
+ readonly path: Schema.String;
5513
+ readonly value: Schema.refine<PatchRow, Schema.$Record<Schema.String, Schema.decodeTo<Schema.Unknown, Schema.Unknown, never, never>>>;
5514
5514
  }>, Schema.Struct<{
5515
- op: Schema.Literal<["replace"]>;
5516
- path: typeof Schema.String;
5517
- value: Schema.refine<{
5518
- readonly [x: string]: unknown;
5519
- } & Readonly<Record<string, unknown>> & {
5520
- readonly id: RowId;
5521
- }, Schema.Schema<{
5522
- readonly [x: string]: unknown;
5523
- }, {
5524
- readonly [x: string]: unknown;
5525
- }, never>>;
5515
+ readonly op: Schema.Literal<"replace">;
5516
+ readonly path: Schema.String;
5517
+ readonly value: Schema.refine<PatchRow, Schema.$Record<Schema.String, Schema.decodeTo<Schema.Unknown, Schema.Unknown, never, never>>>;
5526
5518
  }>, Schema.Struct<{
5527
- op: Schema.Literal<["remove"]>;
5528
- path: typeof Schema.String;
5519
+ readonly op: Schema.Literal<"remove">;
5520
+ readonly path: Schema.String;
5529
5521
  }>, Schema.Struct<{
5530
- op: Schema.Literal<["mergeCells"]>;
5531
- path: typeof Schema.String;
5532
- value: Schema.Record$<typeof Schema.String, Schema.transform<typeof Schema.Unknown, typeof Schema.Unknown>>;
5522
+ readonly op: Schema.Literal<"mergeCells">;
5523
+ readonly path: Schema.String;
5524
+ readonly value: Schema.$Record<Schema.String, Schema.decodeTo<Schema.Unknown, Schema.Unknown, never, never>>;
5533
5525
  }>]>;
5534
5526
 
5535
5527
  export declare const rowPatchSchema: Schema.Struct<{
5536
- ops: Schema.Array$<Schema.Union<[Schema.Struct<{
5537
- op: Schema.Literal<["add"]>;
5538
- path: typeof Schema.String;
5539
- value: Schema.refine<{
5540
- readonly [x: string]: unknown;
5541
- } & Readonly<Record<string, unknown>> & {
5542
- readonly id: RowId;
5543
- }, Schema.Schema<{
5544
- readonly [x: string]: unknown;
5545
- }, {
5546
- readonly [x: string]: unknown;
5547
- }, never>>;
5528
+ readonly ops: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
5529
+ readonly op: Schema.Literal<"add">;
5530
+ readonly path: Schema.String;
5531
+ readonly value: Schema.refine<PatchRow, Schema.$Record<Schema.String, Schema.decodeTo<Schema.Unknown, Schema.Unknown, never, never>>>;
5548
5532
  }>, Schema.Struct<{
5549
- op: Schema.Literal<["replace"]>;
5550
- path: typeof Schema.String;
5551
- value: Schema.refine<{
5552
- readonly [x: string]: unknown;
5553
- } & Readonly<Record<string, unknown>> & {
5554
- readonly id: RowId;
5555
- }, Schema.Schema<{
5556
- readonly [x: string]: unknown;
5557
- }, {
5558
- readonly [x: string]: unknown;
5559
- }, never>>;
5533
+ readonly op: Schema.Literal<"replace">;
5534
+ readonly path: Schema.String;
5535
+ readonly value: Schema.refine<PatchRow, Schema.$Record<Schema.String, Schema.decodeTo<Schema.Unknown, Schema.Unknown, never, never>>>;
5560
5536
  }>, Schema.Struct<{
5561
- op: Schema.Literal<["remove"]>;
5562
- path: typeof Schema.String;
5537
+ readonly op: Schema.Literal<"remove">;
5538
+ readonly path: Schema.String;
5563
5539
  }>, Schema.Struct<{
5564
- op: Schema.Literal<["mergeCells"]>;
5565
- path: typeof Schema.String;
5566
- value: Schema.Record$<typeof Schema.String, Schema.transform<typeof Schema.Unknown, typeof Schema.Unknown>>;
5540
+ readonly op: Schema.Literal<"mergeCells">;
5541
+ readonly path: Schema.String;
5542
+ readonly value: Schema.$Record<Schema.String, Schema.decodeTo<Schema.Unknown, Schema.Unknown, never, never>>;
5567
5543
  }>]>>;
5568
- order: Schema.Array$<Schema.Union<[typeof Schema.String, typeof Schema.Number]>>;
5544
+ readonly order: Schema.NullOr<Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Number]>>>;
5569
5545
  }>;
5570
5546
 
5571
5547
  /**
@@ -5788,12 +5764,10 @@ export declare type ScopeDecision =
5788
5764
  export declare class ScopeError extends ScopeError_base {
5789
5765
  }
5790
5766
 
5791
- declare const ScopeError_base: Schema.TaggedErrorClass<ScopeError, "ScopeError", {
5792
- readonly _tag: Schema.tag<"ScopeError">;
5793
- } & {
5794
- required: typeof Schema.String;
5795
- message: typeof Schema.String;
5796
- }>;
5767
+ declare const ScopeError_base: Schema.Class<ScopeError, Schema.TaggedStruct<"ScopeError", {
5768
+ readonly required: Schema.String;
5769
+ readonly message: Schema.String;
5770
+ }>, YieldableError>;
5797
5771
 
5798
5772
  /** What `resolveScopes` may return. A bare array is the shorthand for
5799
5773
  * `{ kind: 'grant', scopes }` — the common case, and the reading an existing
@@ -5863,14 +5837,12 @@ export declare type ServerErrorSource = 'rest' | 'aggregate' | 'subscriber' | 'r
5863
5837
  export declare class ServerOnlyColumnWrite extends ServerOnlyColumnWrite_base {
5864
5838
  }
5865
5839
 
5866
- declare const ServerOnlyColumnWrite_base: Schema.TaggedErrorClass<ServerOnlyColumnWrite, "ServerOnlyColumnWrite", {
5867
- readonly _tag: Schema.tag<"ServerOnlyColumnWrite">;
5868
- } & {
5840
+ declare const ServerOnlyColumnWrite_base: Schema.Class<ServerOnlyColumnWrite, Schema.TaggedStruct<"ServerOnlyColumnWrite", {
5869
5841
  /** The table the write targeted. */
5870
- table: typeof Schema.String;
5842
+ readonly table: Schema.String;
5871
5843
  /** The `.serverOnly()` columns the input tried to set. */
5872
- columns: Schema.Array$<typeof Schema.String>;
5873
- }>;
5844
+ readonly columns: Schema.$Array<Schema.String>;
5845
+ }>, YieldableError>;
5874
5846
 
5875
5847
  /** A service (app) name: what `serviceCallers`, `service.callers` and a service
5876
5848
  * credential all spell the same way. At most 56 characters: the caller writes
@@ -6035,6 +6007,34 @@ export declare const shapeDigest: (text: string) => string;
6035
6007
  */
6036
6008
  export declare const sourceKeys: (source: ReactivitySourceValue | ReadonlyArray<ReactivitySourceValue> | undefined) => ReadonlyArray<string>;
6037
6009
 
6010
+ export declare type StorageAccessPolicy = typeof StorageAccessPolicySchema.Type;
6011
+
6012
+ export declare const StorageAccessPolicySchema: Schema.$Array<Schema.Struct<{
6013
+ readonly owner: Schema.optional<Schema.Boolean>;
6014
+ readonly roles: Schema.optional<Schema.$Array<Schema.String>>;
6015
+ readonly groups: Schema.optional<Schema.$Array<Schema.String>>;
6016
+ readonly scopes: Schema.optional<Schema.$Array<Schema.String>>;
6017
+ readonly tenant: Schema.optional<Schema.Boolean>;
6018
+ readonly apiKey: Schema.optional<Schema.Boolean>;
6019
+ readonly password: Schema.optional<Schema.Boolean>;
6020
+ readonly guard: Schema.optional<Schema.String>;
6021
+ }>>;
6022
+
6023
+ export declare type StorageAccessRule = typeof StorageAccessRuleSchema.Type;
6024
+
6025
+ /** Conditions within one rule are AND; rules within a policy are OR.
6026
+ * Private storage objects also allow their owner. */
6027
+ export declare const StorageAccessRuleSchema: Schema.Struct<{
6028
+ readonly owner: Schema.optional<Schema.Boolean>;
6029
+ readonly roles: Schema.optional<Schema.$Array<Schema.String>>;
6030
+ readonly groups: Schema.optional<Schema.$Array<Schema.String>>;
6031
+ readonly scopes: Schema.optional<Schema.$Array<Schema.String>>;
6032
+ readonly tenant: Schema.optional<Schema.Boolean>;
6033
+ readonly apiKey: Schema.optional<Schema.Boolean>;
6034
+ readonly password: Schema.optional<Schema.Boolean>;
6035
+ readonly guard: Schema.optional<Schema.String>;
6036
+ }>;
6037
+
6038
6038
  export declare const STORE_SCREENSHOT_PRESET_NAMES: [string, ...string[]];
6039
6039
 
6040
6040
  export declare const STORE_SCREENSHOT_PRESETS: ReadonlyArray<StoreScreenshotPreset>;
@@ -6067,13 +6067,11 @@ export declare class StoreOperationFailed extends StoreOperationFailed_base {
6067
6067
  get message(): string;
6068
6068
  }
6069
6069
 
6070
- declare const StoreOperationFailed_base: Schema.TaggedErrorClass<StoreOperationFailed, "StoreOperationFailed", {
6071
- readonly _tag: Schema.tag<"StoreOperationFailed">;
6072
- } & {
6070
+ declare const StoreOperationFailed_base: Schema.Class<StoreOperationFailed, Schema.TaggedStruct<"StoreOperationFailed", {
6073
6071
  /** Which DataStore op was attempted: 'query' | 'insert' | 'update' | 'delete' | 'hardDelete'. */
6074
- operation: typeof Schema.String;
6072
+ readonly operation: Schema.String;
6075
6073
  /** The table the op targeted. */
6076
- table: typeof Schema.String;
6074
+ readonly table: Schema.String;
6077
6075
  /**
6078
6076
  * A BOUNDED description of what went wrong.
6079
6077
  *
@@ -6091,8 +6089,8 @@ declare const StoreOperationFailed_base: Schema.TaggedErrorClass<StoreOperationF
6091
6089
  * socket address. `wireSafeCause` in `@voltro/database` builds it,
6092
6090
  * and the reasoning is there. The full detail is logged server-side.
6093
6091
  */
6094
- cause: typeof Schema.String;
6095
- }>;
6092
+ readonly cause: Schema.String;
6093
+ }>, YieldableError>;
6096
6094
 
6097
6095
  /** The PNG size the store receives: viewport × scale factor. */
6098
6096
  export declare const storeScreenshotPixels: (preset: StoreScreenshotPreset) => {
@@ -6157,7 +6155,7 @@ export declare type StrategyResolution = {
6157
6155
  * run's `AgentEvent`s), one-shot, no table, no snapshot. Backs A3's
6158
6156
  * agent runtime + any other server-push stream.
6159
6157
  */
6160
- export declare interface StreamProcedureDescriptor<Name extends string, Input extends Schema.Schema.Any, Element extends Schema.Schema.Any, Error extends Schema.Schema.All> {
6158
+ export declare interface StreamProcedureDescriptor<Name extends string, Input extends Schema.Top, Element extends Schema.Top, Error extends Schema.Top> {
6161
6159
  readonly kind: 'stream';
6162
6160
  readonly name: Name;
6163
6161
  readonly input: Input;
@@ -6176,50 +6174,40 @@ export declare interface StreamProcedureDescriptor<Name extends string, Input ex
6176
6174
  readonly openAccess: string | undefined;
6177
6175
  }
6178
6176
 
6179
- export declare const streamToRpc: <Name extends string, Input extends Schema.Schema.Any, Element extends Schema.Schema.Any, Err extends Schema.Schema.All>(descriptor: StreamProcedureDescriptor<Name, Input, Element, Err>, extraErrors?: ExtraErrors) => Rpc.Rpc<Name, Input extends Schema.Struct.Fields ? Schema.Struct<Input> : Input, Stream<Element, Schema.Schema.All>, typeof Schema.Never, never>;
6177
+ export declare const streamToRpc: <Name extends string, Input extends Schema.Top, Element extends Schema.Top, Err extends Schema.Top>(descriptor: StreamProcedureDescriptor<Name, Input, Element, Err>, extraErrors?: ExtraErrors) => Rpc.Rpc<Name, Input extends Schema.Struct.Fields ? Schema.Struct<Input> : Input, Stream<Element, Schema.Top>, Schema.Never, never, never>;
6180
6178
 
6181
6179
  /**
6182
- * Annotate a procedure's input schema so an undeclared field fails the decode
6183
- * instead of vanishing from it.
6184
- *
6185
- * Applies to the schema handed to `Rpc.make` — the PAYLOAD only. Not the
6186
- * success schema, and not `descriptor.input`, which the client still reads
6187
- * unannotated for schema-driven UI (`normalizeDescriptor`).
6188
- *
6189
- * Measured, because none of it follows from the annotation's name: it
6190
- * propagates into NESTED structs and through a UNION's members, and a
6191
- * non-struct payload (`Schema.Void`, a scalar) is unaffected — there is no
6192
- * excess property for it to have.
6180
+ * The payload schema every `Rpc.make` in this package is built with. Excess
6181
+ * keys are refused at every closed object the input reaches, and a decode
6182
+ * failure is reported under the procedure's label (see the header).
6193
6183
  */
6194
- export declare const strictInput: <S extends Schema.Schema.Any>(input: S, procedure?: string, guarded?: boolean) => S;
6184
+ export declare const strictInput: <S extends Schema.Top>(input: S, procedure?: string, guarded?: boolean) => S;
6195
6185
 
6196
- export declare const Subject: Schema.Union<[Schema.Struct<{
6197
- type: Schema.Literal<["user"]>;
6198
- id: typeof Schema.String;
6199
- tenantId: typeof Schema.String;
6200
- scopes: Schema.optional<Schema.Array$<typeof Schema.String>>;
6201
- metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
6186
+ export declare const Subject: Schema.Union<readonly [Schema.Struct<{
6187
+ readonly type: Schema.Literal<"user">;
6188
+ readonly id: Schema.String;
6189
+ readonly tenantId: Schema.String;
6190
+ readonly scopes: Schema.optional<Schema.$Array<Schema.String>>;
6191
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
6202
6192
  }>, Schema.Struct<{
6203
- type: Schema.Literal<["apiKey"]>;
6204
- id: typeof Schema.String;
6205
- tenantId: typeof Schema.String;
6206
- scopes: Schema.optional<Schema.Array$<typeof Schema.String>>;
6207
- metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
6193
+ readonly type: Schema.Literal<"apiKey">;
6194
+ readonly id: Schema.String;
6195
+ readonly tenantId: Schema.String;
6196
+ readonly scopes: Schema.optional<Schema.$Array<Schema.String>>;
6197
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
6208
6198
  }>, Schema.Struct<{
6209
- type: Schema.Literal<["serviceAccount"]>;
6210
- id: typeof Schema.String;
6211
- tenantId: typeof Schema.String;
6199
+ readonly type: Schema.Literal<"serviceAccount">;
6200
+ readonly id: Schema.String;
6201
+ readonly tenantId: Schema.String;
6212
6202
  /** Application actor used for audit columns; null means machine work with
6213
6203
  * no application actor. Identity only, never a permission grant. */
6214
- auditActorId: Schema.optionalWith<Schema.NullOr<typeof Schema.String>, {
6215
- exact: true;
6216
- }>;
6217
- scopes: Schema.optional<Schema.Array$<typeof Schema.String>>;
6218
- metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
6204
+ readonly auditActorId: Schema.optionalKey<Schema.NullOr<Schema.String>>;
6205
+ readonly scopes: Schema.optional<Schema.$Array<Schema.String>>;
6206
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
6219
6207
  }>, Schema.Struct<{
6220
- type: Schema.Literal<["anonymous"]>;
6221
- id: typeof Schema.Null;
6222
- tenantId: Schema.NullOr<typeof Schema.String>;
6208
+ readonly type: Schema.Literal<"anonymous">;
6209
+ readonly id: Schema.Null;
6210
+ readonly tenantId: Schema.NullOr<Schema.String>;
6223
6211
  /**
6224
6212
  * Set when this caller PRESENTED a credential and it was rejected — an
6225
6213
  * expired token above all. Absent when they presented none.
@@ -6236,21 +6224,21 @@ export declare const Subject: Schema.Union<[Schema.Struct<{
6236
6224
  * must not break an `openAccess` procedure that needs no session at all. The
6237
6225
  * fact travels, and only a guard that actually refuses spends it.
6238
6226
  */
6239
- credentialRejected: Schema.optional<typeof Schema.String>;
6227
+ readonly credentialRejected: Schema.optional<Schema.String>;
6240
6228
  }>, Schema.Struct<{
6241
- type: Schema.Literal<["system"]>;
6242
- id: typeof Schema.String;
6243
- tenantId: typeof Schema.Null;
6244
- scopes: Schema.optional<Schema.Array$<typeof Schema.String>>;
6245
- metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
6229
+ readonly type: Schema.Literal<"system">;
6230
+ readonly id: Schema.String;
6231
+ readonly tenantId: Schema.Null;
6232
+ readonly scopes: Schema.optional<Schema.$Array<Schema.String>>;
6233
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
6246
6234
  }>, Schema.Struct<{
6247
- type: Schema.Literal<["service"]>;
6248
- id: typeof Schema.String;
6235
+ readonly type: Schema.Literal<"service">;
6236
+ readonly id: Schema.String;
6249
6237
  /** The calling app's name, as the callee lists it in `serviceCallers`. */
6250
- service: typeof Schema.String;
6251
- tenantId: typeof Schema.Null;
6252
- scopes: Schema.optional<Schema.Array$<typeof Schema.String>>;
6253
- metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
6238
+ readonly service: Schema.String;
6239
+ readonly tenantId: Schema.Null;
6240
+ readonly scopes: Schema.optional<Schema.$Array<Schema.String>>;
6241
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
6254
6242
  }>]>;
6255
6243
 
6256
6244
  export declare type Subject = typeof Subject.Type;
@@ -6260,28 +6248,26 @@ export declare type Subject = typeof Subject.Type;
6260
6248
  * no authority and must not be inferred from user-provided metadata. */
6261
6249
  export declare const subjectAuditActorId: (subject: Subject) => string | null;
6262
6250
 
6263
- export declare const SubjectIdentity: Schema.Union<[Schema.Struct<{
6264
- type: Schema.Literal<["user"]>;
6265
- id: typeof Schema.String;
6266
- tenantId: typeof Schema.String;
6267
- metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
6251
+ export declare const SubjectIdentity: Schema.Union<readonly [Schema.Struct<{
6252
+ readonly type: Schema.Literal<"user">;
6253
+ readonly id: Schema.String;
6254
+ readonly tenantId: Schema.String;
6255
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
6268
6256
  }>, Schema.Struct<{
6269
- type: Schema.Literal<["apiKey"]>;
6270
- id: typeof Schema.String;
6271
- tenantId: typeof Schema.String;
6272
- metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
6257
+ readonly type: Schema.Literal<"apiKey">;
6258
+ readonly id: Schema.String;
6259
+ readonly tenantId: Schema.String;
6260
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
6273
6261
  }>, Schema.Struct<{
6274
- type: Schema.Literal<["serviceAccount"]>;
6275
- id: typeof Schema.String;
6276
- tenantId: typeof Schema.String;
6277
- metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
6278
- auditActorId: Schema.optionalWith<Schema.NullOr<typeof Schema.String>, {
6279
- exact: true;
6280
- }>;
6262
+ readonly type: Schema.Literal<"serviceAccount">;
6263
+ readonly id: Schema.String;
6264
+ readonly tenantId: Schema.String;
6265
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
6266
+ readonly auditActorId: Schema.optionalKey<Schema.NullOr<Schema.String>>;
6281
6267
  }>, Schema.Struct<{
6282
- type: Schema.Literal<["anonymous"]>;
6283
- id: typeof Schema.Null;
6284
- tenantId: Schema.NullOr<typeof Schema.String>;
6268
+ readonly type: Schema.Literal<"anonymous">;
6269
+ readonly id: Schema.Null;
6270
+ readonly tenantId: Schema.NullOr<Schema.String>;
6285
6271
  /**
6286
6272
  * Set when this caller PRESENTED a credential and it was rejected — an
6287
6273
  * expired token above all. Absent when they presented none.
@@ -6298,18 +6284,18 @@ export declare const SubjectIdentity: Schema.Union<[Schema.Struct<{
6298
6284
  * must not break an `openAccess` procedure that needs no session at all. The
6299
6285
  * fact travels, and only a guard that actually refuses spends it.
6300
6286
  */
6301
- credentialRejected: Schema.optional<typeof Schema.String>;
6287
+ readonly credentialRejected: Schema.optional<Schema.String>;
6302
6288
  }>, Schema.Struct<{
6303
- type: Schema.Literal<["system"]>;
6304
- id: typeof Schema.String;
6305
- tenantId: typeof Schema.Null;
6306
- metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
6289
+ readonly type: Schema.Literal<"system">;
6290
+ readonly id: Schema.String;
6291
+ readonly tenantId: Schema.Null;
6292
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
6307
6293
  }>, Schema.Struct<{
6308
- type: Schema.Literal<["service"]>;
6309
- id: typeof Schema.String;
6310
- tenantId: typeof Schema.Null;
6311
- metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
6312
- service: typeof Schema.String;
6294
+ readonly type: Schema.Literal<"service">;
6295
+ readonly id: Schema.String;
6296
+ readonly tenantId: Schema.Null;
6297
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
6298
+ readonly service: Schema.String;
6313
6299
  }>]>;
6314
6300
 
6315
6301
  export declare type SubjectIdentity = typeof SubjectIdentity.Type;
@@ -6344,7 +6330,7 @@ export declare const subjectScopes: (subject: Subject) => ReadonlyArray<string>;
6344
6330
  export declare class SubjectService extends SubjectService_base {
6345
6331
  }
6346
6332
 
6347
- declare const SubjectService_base: Context.TagClass<SubjectService, "@voltro/Subject", {
6333
+ declare const SubjectService_base: Context.ServiceClass<SubjectService, "@voltro/Subject", {
6348
6334
  readonly type: "user";
6349
6335
  readonly id: string;
6350
6336
  readonly tenantId: string;
@@ -6386,11 +6372,11 @@ declare const SubjectService_base: Context.TagClass<SubjectService, "@voltro/Sub
6386
6372
  readonly type: "service";
6387
6373
  readonly id: string;
6388
6374
  readonly tenantId: null;
6375
+ readonly service: string;
6389
6376
  readonly scopes?: readonly string[] | undefined;
6390
6377
  readonly metadata?: {
6391
6378
  readonly [x: string]: unknown;
6392
6379
  } | undefined;
6393
- readonly service: string;
6394
6380
  }>;
6395
6381
 
6396
6382
  /** Subscribe to server-primitive errors. Returns an unsubscribe fn. */
@@ -6413,55 +6399,39 @@ export declare type SubscriptionEvent<T> = {
6413
6399
  readonly revision?: number | undefined;
6414
6400
  };
6415
6401
 
6416
- export declare const subscriptionEvent: <D extends Schema.Schema.Any>(data: D) => Schema.Union<[Schema.Struct<{
6417
- _tag: Schema.Literal<["snapshot"]>;
6418
- revision: typeof Schema.Number;
6419
- data: D;
6420
- computed: Schema.optional<typeof Schema.Boolean>;
6421
- reconciles: Schema.optional<typeof Schema.String>;
6402
+ export declare const subscriptionEvent: <D extends Schema.Top>(data: D) => Schema.Union<readonly [Schema.Struct<{
6403
+ readonly _tag: Schema.Literal<"snapshot">;
6404
+ readonly revision: Schema.Number;
6405
+ readonly data: D;
6406
+ readonly computed: Schema.optional<Schema.Boolean>;
6407
+ readonly reconciles: Schema.optional<Schema.String>;
6422
6408
  }>, Schema.Struct<{
6423
- _tag: Schema.Literal<["delta"]>;
6424
- revision: typeof Schema.Number;
6425
- emittedAt: typeof Schema.Number;
6426
- patch: Schema.Struct<{
6427
- ops: Schema.Array$<Schema.Union<[Schema.Struct<{
6428
- op: Schema.Literal<["add"]>;
6429
- path: typeof Schema.String;
6430
- value: Schema.refine<{
6431
- readonly [x: string]: unknown;
6432
- } & Readonly<Record<string, unknown>> & {
6433
- readonly id: RowId;
6434
- }, Schema.Schema<{
6435
- readonly [x: string]: unknown;
6436
- }, {
6437
- readonly [x: string]: unknown;
6438
- }, never>>;
6409
+ readonly _tag: Schema.Literal<"delta">;
6410
+ readonly revision: Schema.Number;
6411
+ readonly emittedAt: Schema.Number;
6412
+ readonly patch: Schema.Struct<{
6413
+ readonly ops: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
6414
+ readonly op: Schema.Literal<"add">;
6415
+ readonly path: Schema.String;
6416
+ readonly value: Schema.refine< PatchRow, Schema.$Record<Schema.String, Schema.decodeTo<Schema.Unknown, Schema.Unknown, never, never>>>;
6439
6417
  }>, Schema.Struct<{
6440
- op: Schema.Literal<["replace"]>;
6441
- path: typeof Schema.String;
6442
- value: Schema.refine<{
6443
- readonly [x: string]: unknown;
6444
- } & Readonly<Record<string, unknown>> & {
6445
- readonly id: RowId;
6446
- }, Schema.Schema<{
6447
- readonly [x: string]: unknown;
6448
- }, {
6449
- readonly [x: string]: unknown;
6450
- }, never>>;
6418
+ readonly op: Schema.Literal<"replace">;
6419
+ readonly path: Schema.String;
6420
+ readonly value: Schema.refine< PatchRow, Schema.$Record<Schema.String, Schema.decodeTo<Schema.Unknown, Schema.Unknown, never, never>>>;
6451
6421
  }>, Schema.Struct<{
6452
- op: Schema.Literal<["remove"]>;
6453
- path: typeof Schema.String;
6422
+ readonly op: Schema.Literal<"remove">;
6423
+ readonly path: Schema.String;
6454
6424
  }>, Schema.Struct<{
6455
- op: Schema.Literal<["mergeCells"]>;
6456
- path: typeof Schema.String;
6457
- value: Schema.Record$<typeof Schema.String, Schema.transform<typeof Schema.Unknown, typeof Schema.Unknown>>;
6425
+ readonly op: Schema.Literal<"mergeCells">;
6426
+ readonly path: Schema.String;
6427
+ readonly value: Schema.$Record<Schema.String, Schema.decodeTo<Schema.Unknown, Schema.Unknown, never, never>>;
6458
6428
  }>]>>;
6459
- order: Schema.Array$<Schema.Union<[typeof Schema.String, typeof Schema.Number]>>;
6429
+ readonly order: Schema.NullOr<Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Number]>>>;
6460
6430
  }>;
6461
6431
  }>, Schema.Struct<{
6462
- _tag: Schema.Literal<["error"]>;
6463
- error: typeof Schema.Unknown;
6464
- revision: Schema.optional<typeof Schema.Number>;
6432
+ readonly _tag: Schema.Literal<"error">;
6433
+ readonly error: Schema.Unknown;
6434
+ readonly revision: Schema.optional<Schema.Number>;
6465
6435
  }>]>;
6466
6436
 
6467
6437
  export declare interface SurfaceMismatch {
@@ -6534,21 +6504,20 @@ export declare type TableName = keyof VoltroTableNames extends never ? string :
6534
6504
  * leak the original Schema instance).
6535
6505
  */
6536
6506
  export declare class TableValidationFailed extends TableValidationFailed_base {
6507
+ get message(): string;
6537
6508
  }
6538
6509
 
6539
- declare const TableValidationFailed_base: Schema.TaggedErrorClass<TableValidationFailed, "TableValidationFailed", {
6540
- readonly _tag: Schema.tag<"TableValidationFailed">;
6541
- } & {
6510
+ declare const TableValidationFailed_base: Schema.Class<TableValidationFailed, Schema.TaggedStruct<"TableValidationFailed", {
6542
6511
  /** The table the row targeted. */
6543
- table: typeof Schema.String;
6512
+ readonly table: Schema.String;
6544
6513
  /** Top-level explanation for logs + UI ("user.email failed pattern check"). */
6545
- summary: typeof Schema.String;
6514
+ readonly summary: Schema.String;
6546
6515
  /** Flat list of `{ path, message }` per failing leaf. Path uses dot-notation. */
6547
- issues: Schema.Array$<Schema.Struct<{
6548
- path: typeof Schema.String;
6549
- message: typeof Schema.String;
6516
+ readonly issues: Schema.$Array<Schema.Struct<{
6517
+ readonly path: Schema.String;
6518
+ readonly message: Schema.String;
6550
6519
  }>>;
6551
- }>;
6520
+ }>, YieldableError>;
6552
6521
 
6553
6522
  export declare type Target<Input = unknown, Row = unknown> = TargetSpec<Input, Row> | ReadonlyArray<TargetSpec<Input, Row>>;
6554
6523
 
@@ -6625,16 +6594,14 @@ export declare type TargetSpec<Input = unknown, Row = unknown> = InsertTarget<In
6625
6594
  export declare class TenantRowNotFound extends TenantRowNotFound_base {
6626
6595
  }
6627
6596
 
6628
- declare const TenantRowNotFound_base: Schema.TaggedErrorClass<TenantRowNotFound, "TenantRowNotFound", {
6629
- readonly _tag: Schema.tag<"TenantRowNotFound">;
6630
- } & {
6597
+ declare const TenantRowNotFound_base: Schema.Class<TenantRowNotFound, Schema.TaggedStruct<"TenantRowNotFound", {
6631
6598
  /** The table the keyed write targeted. */
6632
- table: typeof Schema.String;
6599
+ readonly table: Schema.String;
6633
6600
  /** The primary key the CALLER supplied. Echoing it leaks nothing. */
6634
- id: typeof Schema.String;
6601
+ readonly id: Schema.String;
6635
6602
  /** Human-readable explanation for diagnostics + UI. */
6636
- reason: typeof Schema.String;
6637
- }>;
6603
+ readonly reason: Schema.String;
6604
+ }>, YieldableError>;
6638
6605
 
6639
6606
  /**
6640
6607
  * The subject a `storeForTenant(id)` view runs as — the caller's identity,
@@ -6665,14 +6632,12 @@ export declare const tenantScopedSubject: (subject: Subject, tenantId: string) =
6665
6632
  export declare class TenantScopeViolation extends TenantScopeViolation_base {
6666
6633
  }
6667
6634
 
6668
- declare const TenantScopeViolation_base: Schema.TaggedErrorClass<TenantScopeViolation, "TenantScopeViolation", {
6669
- readonly _tag: Schema.tag<"TenantScopeViolation">;
6670
- } & {
6635
+ declare const TenantScopeViolation_base: Schema.Class<TenantScopeViolation, Schema.TaggedStruct<"TenantScopeViolation", {
6671
6636
  /** The table the violating write targeted. */
6672
- table: typeof Schema.String;
6637
+ readonly table: Schema.String;
6673
6638
  /** Human-readable explanation for diagnostics + UI. */
6674
- reason: typeof Schema.String;
6675
- }>;
6639
+ readonly reason: Schema.String;
6640
+ }>, YieldableError>;
6676
6641
 
6677
6642
  /** The subject types a selection can apply to: those with an id AND a tenant.
6678
6643
  * `anonymous` has no id to remember a selection under; `system` has no
@@ -6695,14 +6660,12 @@ export declare interface TenantSelectionIdentity {
6695
6660
  export declare class TenantSelectionRefused extends TenantSelectionRefused_base {
6696
6661
  }
6697
6662
 
6698
- declare const TenantSelectionRefused_base: Schema.TaggedErrorClass<TenantSelectionRefused, "TenantSelectionRefused", {
6699
- readonly _tag: Schema.tag<"TenantSelectionRefused">;
6700
- } & {
6701
- subjectType: typeof Schema.String;
6702
- subjectId: Schema.NullOr<typeof Schema.String>;
6703
- tenantId: typeof Schema.String;
6704
- reason: Schema.Literal<["not-a-member", "subject-has-no-tenant"]>;
6705
- }>;
6663
+ declare const TenantSelectionRefused_base: Schema.Class<TenantSelectionRefused, Schema.TaggedStruct<"TenantSelectionRefused", {
6664
+ readonly subjectType: Schema.String;
6665
+ readonly subjectId: Schema.NullOr<Schema.String>;
6666
+ readonly tenantId: Schema.String;
6667
+ readonly reason: Schema.Literals<readonly ["not-a-member", "subject-has-no-tenant"]>;
6668
+ }>, YieldableError>;
6706
6669
 
6707
6670
  /** Where `composeAuthStrategies` finds a stored selection. `@voltro/runtime`'s
6708
6671
  * `tenantSelectionStore(store)` is the framework's implementation over the
@@ -6716,56 +6679,40 @@ export declare interface TenantSelectionStore {
6716
6679
  readonly clear: (identity: TenantSelectionIdentity) => Promise<void>;
6717
6680
  }
6718
6681
 
6719
- export declare const toRpc: <Name extends string, Input extends Schema.Schema.Any, Output extends Schema.Schema.Any, Err extends Schema.Schema.All>(descriptor: QueryProcedureDescriptor<Name, Input, Output, Err> | MutationProcedureDescriptor<Name, Input, Output, Err> | ActionProcedureDescriptor<Name, Input, Output, Err> | StreamProcedureDescriptor<Name, Input, Output, Err>) => Rpc.Rpc<Name, Input extends Schema.Struct.Fields ? Schema.Struct<Input> : Input, Stream<Schema.Union<[Schema.Struct<{
6720
- _tag: Schema.Literal<["snapshot"]>;
6721
- revision: typeof Schema.Number;
6722
- data: Output;
6723
- computed: Schema.optional<typeof Schema.Boolean>;
6724
- reconciles: Schema.optional<typeof Schema.String>;
6682
+ export declare const toRpc: <Name extends string, Input extends Schema.Top, Output extends Schema.Top, Err extends Schema.Top>(descriptor: QueryProcedureDescriptor<Name, Input, Output, Err> | MutationProcedureDescriptor<Name, Input, Output, Err> | ActionProcedureDescriptor<Name, Input, Output, Err> | StreamProcedureDescriptor<Name, Input, Output, Err>) => Rpc.Rpc<Name, Input extends Schema.Struct.Fields ? Schema.Struct<Input> : Input, Stream<Schema.Union<readonly [Schema.Struct<{
6683
+ readonly _tag: Schema.Literal<"snapshot">;
6684
+ readonly revision: Schema.Number;
6685
+ readonly data: Output;
6686
+ readonly computed: Schema.optional<Schema.Boolean>;
6687
+ readonly reconciles: Schema.optional<Schema.String>;
6725
6688
  }>, Schema.Struct<{
6726
- _tag: Schema.Literal<["delta"]>;
6727
- revision: typeof Schema.Number;
6728
- emittedAt: typeof Schema.Number;
6729
- patch: Schema.Struct<{
6730
- ops: Schema.Array$<Schema.Union<[Schema.Struct<{
6731
- op: Schema.Literal<["add"]>;
6732
- path: typeof Schema.String;
6733
- value: Schema.refine<{
6734
- readonly [x: string]: unknown;
6735
- } & Readonly<Record<string, unknown>> & {
6736
- readonly id: RowId;
6737
- }, Schema.Schema<{
6738
- readonly [x: string]: unknown;
6739
- }, {
6740
- readonly [x: string]: unknown;
6741
- }, never>>;
6689
+ readonly _tag: Schema.Literal<"delta">;
6690
+ readonly revision: Schema.Number;
6691
+ readonly emittedAt: Schema.Number;
6692
+ readonly patch: Schema.Struct<{
6693
+ readonly ops: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
6694
+ readonly op: Schema.Literal<"add">;
6695
+ readonly path: Schema.String;
6696
+ readonly value: Schema.refine< PatchRow, Schema.$Record<Schema.String, Schema.decodeTo<Schema.Unknown, Schema.Unknown, never, never>>>;
6742
6697
  }>, Schema.Struct<{
6743
- op: Schema.Literal<["replace"]>;
6744
- path: typeof Schema.String;
6745
- value: Schema.refine<{
6746
- readonly [x: string]: unknown;
6747
- } & Readonly<Record<string, unknown>> & {
6748
- readonly id: RowId;
6749
- }, Schema.Schema<{
6750
- readonly [x: string]: unknown;
6751
- }, {
6752
- readonly [x: string]: unknown;
6753
- }, never>>;
6698
+ readonly op: Schema.Literal<"replace">;
6699
+ readonly path: Schema.String;
6700
+ readonly value: Schema.refine< PatchRow, Schema.$Record<Schema.String, Schema.decodeTo<Schema.Unknown, Schema.Unknown, never, never>>>;
6754
6701
  }>, Schema.Struct<{
6755
- op: Schema.Literal<["remove"]>;
6756
- path: typeof Schema.String;
6702
+ readonly op: Schema.Literal<"remove">;
6703
+ readonly path: Schema.String;
6757
6704
  }>, Schema.Struct<{
6758
- op: Schema.Literal<["mergeCells"]>;
6759
- path: typeof Schema.String;
6760
- value: Schema.Record$<typeof Schema.String, Schema.transform<typeof Schema.Unknown, typeof Schema.Unknown>>;
6705
+ readonly op: Schema.Literal<"mergeCells">;
6706
+ readonly path: Schema.String;
6707
+ readonly value: Schema.$Record<Schema.String, Schema.decodeTo<Schema.Unknown, Schema.Unknown, never, never>>;
6761
6708
  }>]>>;
6762
- order: Schema.Array$<Schema.Union<[typeof Schema.String, typeof Schema.Number]>>;
6709
+ readonly order: Schema.NullOr<Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Number]>>>;
6763
6710
  }>;
6764
6711
  }>, Schema.Struct<{
6765
- _tag: Schema.Literal<["error"]>;
6766
- error: typeof Schema.Unknown;
6767
- revision: Schema.optional<typeof Schema.Number>;
6768
- }>]>, Schema.Schema.All>, typeof Schema.Never, never> | Rpc.Rpc<Name, Input extends Schema.Struct.Fields ? Schema.Struct<Input> : Input, Output, Schema.Schema.All, never> | Rpc.Rpc<Name, Input extends Schema.Struct.Fields ? Schema.Struct<Input> : Input, Stream<Output, Schema.Schema.All>, typeof Schema.Never, never>;
6712
+ readonly _tag: Schema.Literal<"error">;
6713
+ readonly error: Schema.Unknown;
6714
+ readonly revision: Schema.optional<Schema.Number>;
6715
+ }>]>, Schema.Top>, Schema.Never, never, never> | Rpc.Rpc<Name, Input extends Schema.Struct.Fields ? Schema.Struct<Input> : Input, Output, Schema.Top, never, never> | Rpc.Rpc<Name, Input extends Schema.Struct.Fields ? Schema.Struct<Input> : Input, Stream<Output, Schema.Top>, Schema.Never, never, never>;
6769
6716
 
6770
6717
  export declare const toSnakeCase: (key: string) => string;
6771
6718
 
@@ -6777,7 +6724,7 @@ export declare const tsMs: (v: unknown) => number;
6777
6724
 
6778
6725
  /**
6779
6726
  * Typed error every handler can throw to signal "you must be signed
6780
- * in to perform this action". The framework's @effect/rpc layer
6727
+ * in to perform this action". The framework's effect/rpc layer
6781
6728
  * preserves the `_tag` across the wire, and `@voltro/client`'s error
6782
6729
  * bus surfaces it to the consuming app so the dashboard can
6783
6730
  * auto-redirect to the sign-in page (cleared session + UI swap).
@@ -6787,14 +6734,13 @@ export declare const tsMs: (v: unknown) => number;
6787
6734
  * resolved at all" — anonymous, expired token, missing cookie, etc.
6788
6735
  */
6789
6736
  export declare class Unauthenticated extends Unauthenticated_base {
6737
+ get message(): string;
6790
6738
  }
6791
6739
 
6792
- declare const Unauthenticated_base: Schema.TaggedErrorClass<Unauthenticated, "Unauthenticated", {
6793
- readonly _tag: Schema.tag<"Unauthenticated">;
6794
- } & {
6740
+ declare const Unauthenticated_base: Schema.Class<Unauthenticated, Schema.TaggedStruct<"Unauthenticated", {
6795
6741
  /** Optional context — e.g. "auth.signin required", "session expired". */
6796
- reason: Schema.optional<typeof Schema.String>;
6797
- }>;
6742
+ readonly reason: Schema.optional<Schema.String>;
6743
+ }>, YieldableError>;
6798
6744
 
6799
6745
  /**
6800
6746
  * Channel keys named by a `source:` that no `reactivityChannel()` declared.
@@ -6823,10 +6769,10 @@ export declare const UNDO_REDO_TAG: "__voltro.undo.redo";
6823
6769
  * No `target` (it writes whatever tables the change-set touched — its effects
6824
6770
  * reach the client via those tables' own reactive deltas, not optimistic). */
6825
6771
  export declare const undoApplyDescriptor: MutationProcedureDescriptor<"__voltro.undo.apply", Schema.Struct<{
6826
- invocationId: typeof Schema.String;
6772
+ readonly invocationId: Schema.String;
6827
6773
  }>, Schema.Struct<{
6828
- ok: typeof Schema.Boolean;
6829
- }>, Schema.Union<[typeof UndoNotFound, typeof UndoForbidden, typeof UndoConflict]>>;
6774
+ readonly ok: Schema.Boolean;
6775
+ }>, Schema.Union<readonly [typeof UndoNotFound, typeof UndoForbidden, typeof UndoConflict]>>;
6830
6776
 
6831
6777
  /** The row changed since the action (a concurrent writer), OR the action
6832
6778
  * crossed an external side effect — a blind restore would clobber/lie, so
@@ -6835,38 +6781,34 @@ export declare const undoApplyDescriptor: MutationProcedureDescriptor<"__voltro.
6835
6781
  export declare class UndoConflict extends UndoConflict_base {
6836
6782
  }
6837
6783
 
6838
- declare const UndoConflict_base: Schema.TaggedErrorClass<UndoConflict, "UndoConflict", {
6839
- readonly _tag: Schema.tag<"UndoConflict">;
6840
- } & {
6841
- invocationId: typeof Schema.String;
6842
- reason: Schema.Literal<["conflict", "action"]>;
6843
- }>;
6784
+ declare const UndoConflict_base: Schema.Class<UndoConflict, Schema.TaggedStruct<"UndoConflict", {
6785
+ readonly invocationId: Schema.String;
6786
+ readonly reason: Schema.Literals<readonly ["conflict", "action"]>;
6787
+ }>, YieldableError>;
6844
6788
 
6845
6789
  /** The action belongs to a different subject — undo is per-actor. */
6846
6790
  export declare class UndoForbidden extends UndoForbidden_base {
6847
6791
  }
6848
6792
 
6849
- declare const UndoForbidden_base: Schema.TaggedErrorClass<UndoForbidden, "UndoForbidden", {
6850
- readonly _tag: Schema.tag<"UndoForbidden">;
6851
- } & {
6852
- invocationId: typeof Schema.String;
6853
- }>;
6793
+ declare const UndoForbidden_base: Schema.Class<UndoForbidden, Schema.TaggedStruct<"UndoForbidden", {
6794
+ readonly invocationId: Schema.String;
6795
+ }>, YieldableError>;
6854
6796
 
6855
6797
  /** One undoable action in the calling subject's recent history. The heavy
6856
6798
  * `changes` payload is server-only — the client list needs only this. */
6857
6799
  export declare const UndoLogEntry: Schema.Struct<{
6858
6800
  /** The invocation id (= the `_voltro_undo_log` row id) to pass to apply/redo. */
6859
- id: typeof Schema.String;
6801
+ readonly id: Schema.String;
6860
6802
  /** Rpc tag of the captured mutation (e.g. `todos.create`). */
6861
- tag: typeof Schema.String;
6803
+ readonly tag: Schema.String;
6862
6804
  /** Human label ("create todo") — falls back to the tag. */
6863
- label: Schema.NullOr<typeof Schema.String>;
6805
+ readonly label: Schema.NullOr<Schema.String>;
6864
6806
  /** True once undone (so the UI shows it as redo-able). */
6865
- undone: typeof Schema.Boolean;
6807
+ readonly undone: Schema.Boolean;
6866
6808
  /** True when the action crossed an external side effect → not undoable. */
6867
- crossesAction: typeof Schema.Boolean;
6809
+ readonly crossesAction: Schema.Boolean;
6868
6810
  /** Display-only creation time (stringified). */
6869
- createdAt: typeof Schema.String;
6811
+ readonly createdAt: Schema.String;
6870
6812
  }>;
6871
6813
 
6872
6814
  export declare type UndoLogEntry = Schema.Schema.Type<typeof UndoLogEntry>;
@@ -6875,38 +6817,36 @@ export declare type UndoLogEntry = Schema.Schema.Type<typeof UndoLogEntry>;
6875
6817
  * first. Reactive (source `_voltro_undo_log`) so the list updates live as the
6876
6818
  * subject makes + undoes changes. */
6877
6819
  export declare const undoLogQueryDescriptor: QueryProcedureDescriptor<"__voltro.undo.log", Schema.Struct<{
6878
- limit: Schema.optional<typeof Schema.Number>;
6879
- }>, Schema.Array$<Schema.Struct<{
6820
+ readonly limit: Schema.optional<Schema.Number>;
6821
+ }>, Schema.$Array<Schema.Struct<{
6880
6822
  /** The invocation id (= the `_voltro_undo_log` row id) to pass to apply/redo. */
6881
- id: typeof Schema.String;
6823
+ readonly id: Schema.String;
6882
6824
  /** Rpc tag of the captured mutation (e.g. `todos.create`). */
6883
- tag: typeof Schema.String;
6825
+ readonly tag: Schema.String;
6884
6826
  /** Human label ("create todo") — falls back to the tag. */
6885
- label: Schema.NullOr<typeof Schema.String>;
6827
+ readonly label: Schema.NullOr<Schema.String>;
6886
6828
  /** True once undone (so the UI shows it as redo-able). */
6887
- undone: typeof Schema.Boolean;
6829
+ readonly undone: Schema.Boolean;
6888
6830
  /** True when the action crossed an external side effect → not undoable. */
6889
- crossesAction: typeof Schema.Boolean;
6831
+ readonly crossesAction: Schema.Boolean;
6890
6832
  /** Display-only creation time (stringified). */
6891
- createdAt: typeof Schema.String;
6892
- }>>, typeof Schema.Never>;
6833
+ readonly createdAt: Schema.String;
6834
+ }>>, Schema.Never>;
6893
6835
 
6894
6836
  /** No undo-log row for that invocation (already pruned, or wrong id). */
6895
6837
  export declare class UndoNotFound extends UndoNotFound_base {
6896
6838
  }
6897
6839
 
6898
- declare const UndoNotFound_base: Schema.TaggedErrorClass<UndoNotFound, "UndoNotFound", {
6899
- readonly _tag: Schema.tag<"UndoNotFound">;
6900
- } & {
6901
- invocationId: typeof Schema.String;
6902
- }>;
6840
+ declare const UndoNotFound_base: Schema.Class<UndoNotFound, Schema.TaggedStruct<"UndoNotFound", {
6841
+ readonly invocationId: Schema.String;
6842
+ }>, YieldableError>;
6903
6843
 
6904
6844
  /** `__voltro.undo.redo` — re-apply a previously-undone invocation's forward changes. */
6905
6845
  export declare const undoRedoDescriptor: MutationProcedureDescriptor<"__voltro.undo.redo", Schema.Struct<{
6906
- invocationId: typeof Schema.String;
6846
+ readonly invocationId: Schema.String;
6907
6847
  }>, Schema.Struct<{
6908
- ok: typeof Schema.Boolean;
6909
- }>, Schema.Union<[typeof UndoNotFound, typeof UndoForbidden, typeof UndoConflict]>>;
6848
+ readonly ok: Schema.Boolean;
6849
+ }>, Schema.Union<readonly [typeof UndoNotFound, typeof UndoForbidden, typeof UndoConflict]>>;
6910
6850
 
6911
6851
  export declare interface UpdateTarget<Input = unknown, Row = unknown, Item = Record<string, unknown>> extends NestedTargetFields<Input> {
6912
6852
  readonly table: string;
@@ -6936,13 +6876,11 @@ export declare interface UpdateTarget<Input = unknown, Row = unknown, Item = Rec
6936
6876
  export declare class ValidationError extends ValidationError_base {
6937
6877
  }
6938
6878
 
6939
- declare const ValidationError_base: Schema.TaggedErrorClass<ValidationError, "ValidationError", {
6940
- readonly _tag: Schema.tag<"ValidationError">;
6941
- } & {
6942
- field: typeof Schema.String;
6943
- message: typeof Schema.String;
6944
- params: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
6945
- }>;
6879
+ declare const ValidationError_base: Schema.Class<ValidationError, Schema.TaggedStruct<"ValidationError", {
6880
+ readonly field: Schema.String;
6881
+ readonly message: Schema.String;
6882
+ readonly params: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
6883
+ }>, YieldableError>;
6946
6884
 
6947
6885
  /** Several field-addressed failures at once — one round trip, every field
6948
6886
  * marked. `issues` is non-empty by construction (`ctx.validation.failAll`
@@ -6950,23 +6888,21 @@ declare const ValidationError_base: Schema.TaggedErrorClass<ValidationError, "Va
6950
6888
  export declare class ValidationErrors extends ValidationErrors_base {
6951
6889
  }
6952
6890
 
6953
- declare const ValidationErrors_base: Schema.TaggedErrorClass<ValidationErrors, "ValidationErrors", {
6954
- readonly _tag: Schema.tag<"ValidationErrors">;
6955
- } & {
6956
- issues: Schema.filter<Schema.Array$<Schema.Struct<{
6957
- field: typeof Schema.String;
6958
- message: typeof Schema.String;
6959
- params: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
6960
- }>>>;
6961
- }>;
6891
+ declare const ValidationErrors_base: Schema.Class<ValidationErrors, Schema.TaggedStruct<"ValidationErrors", {
6892
+ readonly issues: Schema.$Array<Schema.Struct<{
6893
+ readonly field: Schema.String;
6894
+ readonly message: Schema.String;
6895
+ readonly params: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
6896
+ }>>;
6897
+ }>, YieldableError>;
6962
6898
 
6963
6899
  /** One field-addressed validation issue: `field` is the form path
6964
6900
  * (`'email'`, `'address.city'`, `'entries.0.startsAt'`), `message` is a
6965
6901
  * message id (or verbatim text), `params` feed the message template. */
6966
6902
  export declare const ValidationIssue: Schema.Struct<{
6967
- field: typeof Schema.String;
6968
- message: typeof Schema.String;
6969
- params: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
6903
+ readonly field: Schema.String;
6904
+ readonly message: Schema.String;
6905
+ readonly params: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
6970
6906
  }>;
6971
6907
 
6972
6908
  export declare type ValidationIssueShape = Schema.Schema.Type<typeof ValidationIssue>;
@@ -7104,7 +7040,7 @@ export declare interface VoltroPlugin {
7104
7040
  * the plugin will surface a config form in the dashboard, or when
7105
7041
  * the plugin reads dynamic config from env / a config file.
7106
7042
  */
7107
- readonly configSchema?: Schema.Schema.Any;
7043
+ readonly configSchema?: Schema.Top;
7108
7044
  /**
7109
7045
  * Wraps every MUTATION handler call. Composed in declaration order
7110
7046
  * across the plugin list: outermost = first listed in app.config.ts.
@@ -7592,11 +7528,11 @@ export declare const wireAudienceOf: (descriptor: {
7592
7528
  * paths. Pass the same `extraErrors` the lifter receives.
7593
7529
  */
7594
7530
  export declare const wireErrorUnion: (descriptor: {
7595
- readonly error: Schema.Schema.All;
7531
+ readonly error: Schema.Top;
7596
7532
  readonly guards?: DeclaredAccess | undefined;
7597
7533
  readonly requiresApproval?: AnyApprovalPolicy | undefined;
7598
7534
  readonly idempotencyScope?: MutationIdempotencyScope | undefined;
7599
- }, kind: "query" | "mutation" | "action" | "stream", extraErrors?: ExtraErrors) => Schema.Schema.All;
7535
+ }, kind: "query" | "mutation" | "action" | "stream", extraErrors?: ExtraErrors) => Schema.Top;
7600
7536
 
7601
7537
  /** A procedure kind that has a wire error union. */
7602
7538
  export declare type WireProcedureKind = keyof typeof FRAMEWORK_WIRE_ERRORS;
@@ -7730,45 +7666,41 @@ export declare interface WorkflowAccessOptions<Payload = unknown> {
7730
7666
  export declare const WorkflowAccessProperty: unique symbol;
7731
7667
 
7732
7668
  export declare const workflowCancelDescriptor: ActionProcedureDescriptor<"__voltro.workflow.cancel", Schema.Struct<{
7733
- workflowName: typeof Schema.String;
7734
- executionId: typeof Schema.String;
7735
- control: Schema.optional<Schema.Struct<{
7736
- requestId: typeof Schema.NonEmptyString;
7737
- cause: Schema.optionalWith<Schema.Struct<{
7738
- reason: typeof Schema.NonEmptyString;
7739
- detail: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
7740
- }>, {
7741
- exact: true;
7742
- }>;
7669
+ readonly workflowName: Schema.String;
7670
+ readonly executionId: Schema.String;
7671
+ readonly control: Schema.optional<Schema.Struct<{
7672
+ readonly requestId: Schema.NonEmptyString;
7673
+ readonly cause: Schema.optionalKey<Schema.Struct<{
7674
+ readonly reason: Schema.NonEmptyString;
7675
+ readonly detail: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
7676
+ }>>;
7743
7677
  }>>;
7744
- }>, Schema.filter<Schema.Struct<{
7745
- operation: Schema.Literal<["cancel", "resume"]>;
7746
- kind: Schema.Literal<["accepted", "confirmed", "unknown", "already-terminal"]>;
7747
- requestId: Schema.NullOr<typeof Schema.NonEmptyString>;
7748
- snapshot: Schema.Struct<{
7749
- id: typeof Schema.String;
7750
- workflowName: typeof Schema.String;
7751
- executionId: typeof Schema.String;
7752
- status: Schema.Union<[Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>, Schema.Literal<["unknown"]>]>;
7753
- output: Schema.optional<typeof Schema.Unknown>;
7754
- error: Schema.optional<Schema.Struct<{
7755
- tag: Schema.NullOr<typeof Schema.String>;
7756
- message: typeof Schema.String;
7678
+ }>, Schema.Struct<{
7679
+ readonly operation: Schema.Literals<readonly ["cancel", "resume"]>;
7680
+ readonly kind: Schema.Literals<readonly ["accepted", "confirmed", "unknown", "already-terminal"]>;
7681
+ readonly requestId: Schema.NullOr<Schema.NonEmptyString>;
7682
+ readonly snapshot: Schema.Struct<{
7683
+ readonly id: Schema.String;
7684
+ readonly workflowName: Schema.String;
7685
+ readonly executionId: Schema.String;
7686
+ readonly status: Schema.Union<readonly [Schema.Literals<readonly ["running", "succeeded", "failed", "cancelled", "suspended"]>, Schema.Literal<"unknown">]>;
7687
+ readonly output: Schema.optional<Schema.Unknown>;
7688
+ readonly error: Schema.optional<Schema.Struct<{
7689
+ readonly tag: Schema.NullOr<Schema.String>;
7690
+ readonly message: Schema.String;
7757
7691
  }>>;
7758
7692
  }>;
7759
- }>>, typeof Schema.Never>;
7693
+ }>, Schema.Never>;
7760
7694
 
7761
7695
  export declare const WorkflowControlInputSchema: Schema.Struct<{
7762
- workflowName: typeof Schema.String;
7763
- executionId: typeof Schema.String;
7764
- control: Schema.optional<Schema.Struct<{
7765
- requestId: typeof Schema.NonEmptyString;
7766
- cause: Schema.optionalWith<Schema.Struct<{
7767
- reason: typeof Schema.NonEmptyString;
7768
- detail: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
7769
- }>, {
7770
- exact: true;
7771
- }>;
7696
+ readonly workflowName: Schema.String;
7697
+ readonly executionId: Schema.String;
7698
+ readonly control: Schema.optional<Schema.Struct<{
7699
+ readonly requestId: Schema.NonEmptyString;
7700
+ readonly cause: Schema.optionalKey<Schema.Struct<{
7701
+ readonly reason: Schema.NonEmptyString;
7702
+ readonly detail: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
7703
+ }>>;
7772
7704
  }>>;
7773
7705
  }>;
7774
7706
 
@@ -7776,616 +7708,608 @@ export declare type WorkflowControlIntent = Schema.Schema.Type<typeof WorkflowCo
7776
7708
 
7777
7709
  /** Stable caller-owned intent for retry after an uncertain transport result. */
7778
7710
  export declare const WorkflowControlIntentSchema: Schema.Struct<{
7779
- requestId: typeof Schema.NonEmptyString;
7780
- cause: Schema.optionalWith<Schema.Struct<{
7781
- reason: typeof Schema.NonEmptyString;
7782
- detail: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
7783
- }>, {
7784
- exact: true;
7785
- }>;
7711
+ readonly requestId: Schema.NonEmptyString;
7712
+ readonly cause: Schema.optionalKey<Schema.Struct<{
7713
+ readonly reason: Schema.NonEmptyString;
7714
+ readonly detail: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
7715
+ }>>;
7786
7716
  }>;
7787
7717
 
7788
7718
  export declare const workflowControlQueryDescriptor: QueryProcedureDescriptor<"__voltro.workflow.control", Schema.Struct<{
7789
- workflowName: typeof Schema.NonEmptyString;
7790
- executionId: typeof Schema.NonEmptyString;
7791
- operation: Schema.Literal<["cancel", "resume"]>;
7792
- requestId: typeof Schema.NonEmptyString;
7793
- }>, Schema.filter<Schema.Struct<{
7794
- operation: Schema.Literal<["cancel", "resume"]>;
7795
- kind: Schema.Literal<["accepted", "confirmed", "unknown", "already-terminal"]>;
7796
- requestId: Schema.NullOr<typeof Schema.NonEmptyString>;
7797
- snapshot: Schema.Struct<{
7798
- id: typeof Schema.String;
7799
- workflowName: typeof Schema.String;
7800
- executionId: typeof Schema.String;
7801
- status: Schema.Union<[Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>, Schema.Literal<["unknown"]>]>;
7802
- output: Schema.optional<typeof Schema.Unknown>;
7803
- error: Schema.optional<Schema.Struct<{
7804
- tag: Schema.NullOr<typeof Schema.String>;
7805
- message: typeof Schema.String;
7719
+ readonly workflowName: Schema.NonEmptyString;
7720
+ readonly executionId: Schema.NonEmptyString;
7721
+ readonly operation: Schema.Literals<readonly ["cancel", "resume"]>;
7722
+ readonly requestId: Schema.NonEmptyString;
7723
+ }>, Schema.Struct<{
7724
+ readonly operation: Schema.Literals<readonly ["cancel", "resume"]>;
7725
+ readonly kind: Schema.Literals<readonly ["accepted", "confirmed", "unknown", "already-terminal"]>;
7726
+ readonly requestId: Schema.NullOr<Schema.NonEmptyString>;
7727
+ readonly snapshot: Schema.Struct<{
7728
+ readonly id: Schema.String;
7729
+ readonly workflowName: Schema.String;
7730
+ readonly executionId: Schema.String;
7731
+ readonly status: Schema.Union<readonly [Schema.Literals<readonly ["running", "succeeded", "failed", "cancelled", "suspended"]>, Schema.Literal<"unknown">]>;
7732
+ readonly output: Schema.optional<Schema.Unknown>;
7733
+ readonly error: Schema.optional<Schema.Struct<{
7734
+ readonly tag: Schema.NullOr<Schema.String>;
7735
+ readonly message: Schema.String;
7806
7736
  }>>;
7807
7737
  }>;
7808
- }>>, typeof Schema.Never>;
7738
+ }>, Schema.Never>;
7809
7739
 
7810
7740
  export declare type WorkflowControlReadInput = Schema.Schema.Type<typeof WorkflowControlReadInputSchema>;
7811
7741
 
7812
7742
  export declare const WorkflowControlReadInputSchema: Schema.Struct<{
7813
- workflowName: typeof Schema.NonEmptyString;
7814
- executionId: typeof Schema.NonEmptyString;
7815
- operation: Schema.Literal<["cancel", "resume"]>;
7816
- requestId: typeof Schema.NonEmptyString;
7743
+ readonly workflowName: Schema.NonEmptyString;
7744
+ readonly executionId: Schema.NonEmptyString;
7745
+ readonly operation: Schema.Literals<readonly ["cancel", "resume"]>;
7746
+ readonly requestId: Schema.NonEmptyString;
7817
7747
  }>;
7818
7748
 
7819
7749
  export declare type WorkflowControlResult = Schema.Schema.Type<typeof WorkflowControlResultSchema>;
7820
7750
 
7821
7751
  /** Acceptance is not execution completion; null means no resident receipt. */
7822
- export declare const WorkflowControlResultSchema: Schema.filter<Schema.Struct<{
7823
- operation: Schema.Literal<["cancel", "resume"]>;
7824
- kind: Schema.Literal<["accepted", "confirmed", "unknown", "already-terminal"]>;
7825
- requestId: Schema.NullOr<typeof Schema.NonEmptyString>;
7826
- snapshot: Schema.Struct<{
7827
- id: typeof Schema.String;
7828
- workflowName: typeof Schema.String;
7829
- executionId: typeof Schema.String;
7830
- status: Schema.Union<[Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>, Schema.Literal<["unknown"]>]>;
7831
- output: Schema.optional<typeof Schema.Unknown>;
7832
- error: Schema.optional<Schema.Struct<{
7833
- tag: Schema.NullOr<typeof Schema.String>;
7834
- message: typeof Schema.String;
7752
+ export declare const WorkflowControlResultSchema: Schema.Struct<{
7753
+ readonly operation: Schema.Literals<readonly ["cancel", "resume"]>;
7754
+ readonly kind: Schema.Literals<readonly ["accepted", "confirmed", "unknown", "already-terminal"]>;
7755
+ readonly requestId: Schema.NullOr<Schema.NonEmptyString>;
7756
+ readonly snapshot: Schema.Struct<{
7757
+ readonly id: Schema.String;
7758
+ readonly workflowName: Schema.String;
7759
+ readonly executionId: Schema.String;
7760
+ readonly status: Schema.Union<readonly [Schema.Literals<readonly ["running", "succeeded", "failed", "cancelled", "suspended"]>, Schema.Literal<"unknown">]>;
7761
+ readonly output: Schema.optional<Schema.Unknown>;
7762
+ readonly error: Schema.optional<Schema.Struct<{
7763
+ readonly tag: Schema.NullOr<Schema.String>;
7764
+ readonly message: Schema.String;
7835
7765
  }>>;
7836
7766
  }>;
7837
- }>>;
7767
+ }>;
7838
7768
 
7839
7769
  export declare type WorkflowDomainEventRow = Schema.Schema.Type<typeof WorkflowDomainEventRowSchema>;
7840
7770
 
7841
7771
  export declare const WorkflowDomainEventRowSchema: Schema.Struct<{
7842
- id: typeof Schema.String;
7843
- name: typeof Schema.String;
7844
- payload: typeof Schema.Unknown;
7845
- source: typeof Schema.String;
7846
- subject: Schema.NullOr<typeof Schema.Unknown>;
7847
- traceId: Schema.NullOr<typeof Schema.String>;
7848
- occurredAt: typeof Schema.Date;
7772
+ readonly id: Schema.String;
7773
+ readonly name: Schema.String;
7774
+ readonly payload: Schema.Unknown;
7775
+ readonly source: Schema.String;
7776
+ readonly subject: Schema.NullOr<Schema.Unknown>;
7777
+ readonly traceId: Schema.NullOr<Schema.String>;
7778
+ readonly occurredAt: Schema.DateFromString;
7849
7779
  }>;
7850
7780
 
7851
7781
  export declare const WorkflowDomainEventsInputSchema: Schema.Struct<{
7852
- name: Schema.optional<typeof Schema.String>;
7853
- limit: Schema.optional<typeof Schema.Number>;
7782
+ readonly name: Schema.optional<Schema.String>;
7783
+ readonly limit: Schema.optional<Schema.Number>;
7854
7784
  }>;
7855
7785
 
7856
7786
  export declare const workflowDomainEventsQueryDescriptor: QueryProcedureDescriptor<"__voltro.workflow.domainEvents", Schema.Struct<{
7857
- name: Schema.optional<typeof Schema.String>;
7858
- limit: Schema.optional<typeof Schema.Number>;
7859
- }>, Schema.Array$<Schema.Struct<{
7860
- id: typeof Schema.String;
7861
- name: typeof Schema.String;
7862
- payload: typeof Schema.Unknown;
7863
- source: typeof Schema.String;
7864
- subject: Schema.NullOr<typeof Schema.Unknown>;
7865
- traceId: Schema.NullOr<typeof Schema.String>;
7866
- occurredAt: typeof Schema.Date;
7867
- }>>, typeof Schema.Never>;
7787
+ readonly name: Schema.optional<Schema.String>;
7788
+ readonly limit: Schema.optional<Schema.Number>;
7789
+ }>, Schema.$Array<Schema.Struct<{
7790
+ readonly id: Schema.String;
7791
+ readonly name: Schema.String;
7792
+ readonly payload: Schema.Unknown;
7793
+ readonly source: Schema.String;
7794
+ readonly subject: Schema.NullOr<Schema.Unknown>;
7795
+ readonly traceId: Schema.NullOr<Schema.String>;
7796
+ readonly occurredAt: Schema.DateFromString;
7797
+ }>>, Schema.Never>;
7868
7798
 
7869
7799
  export declare const WorkflowEventDeliveriesInputSchema: Schema.Struct<{
7870
- eventId: typeof Schema.String;
7800
+ readonly eventId: Schema.String;
7871
7801
  }>;
7872
7802
 
7873
7803
  export declare const workflowEventDeliveriesQueryDescriptor: QueryProcedureDescriptor<"__voltro.workflow.event.deliveries", Schema.Struct<{
7874
- eventId: typeof Schema.String;
7875
- }>, Schema.Array$<Schema.Struct<{
7876
- id: typeof Schema.String;
7877
- eventId: typeof Schema.String;
7878
- eventName: typeof Schema.String;
7879
- triggerId: typeof Schema.String;
7880
- workflowName: typeof Schema.String;
7881
- executionId: Schema.NullOr<typeof Schema.String>;
7882
- status: Schema.Literal<["starting", "started", "skipped", "failed"]>;
7883
- idempotencyKey: typeof Schema.String;
7884
- skipped: typeof Schema.Boolean;
7885
- errorMessage: Schema.NullOr<typeof Schema.String>;
7886
- createdAt: typeof Schema.Date;
7887
- completedAt: Schema.NullOr<typeof Schema.Date>;
7888
- }>>, typeof Schema.Never>;
7804
+ readonly eventId: Schema.String;
7805
+ }>, Schema.$Array<Schema.Struct<{
7806
+ readonly id: Schema.String;
7807
+ readonly eventId: Schema.String;
7808
+ readonly eventName: Schema.String;
7809
+ readonly triggerId: Schema.String;
7810
+ readonly workflowName: Schema.String;
7811
+ readonly executionId: Schema.NullOr<Schema.String>;
7812
+ readonly status: Schema.Literals<readonly ["starting", "started", "skipped", "failed"]>;
7813
+ readonly idempotencyKey: Schema.String;
7814
+ readonly skipped: Schema.Boolean;
7815
+ readonly errorMessage: Schema.NullOr<Schema.String>;
7816
+ readonly createdAt: Schema.DateFromString;
7817
+ readonly completedAt: Schema.NullOr<Schema.DateFromString>;
7818
+ }>>, Schema.Never>;
7889
7819
 
7890
7820
  export declare type WorkflowEventDeliveryRow = Schema.Schema.Type<typeof WorkflowEventDeliveryRowSchema>;
7891
7821
 
7892
7822
  export declare const WorkflowEventDeliveryRowSchema: Schema.Struct<{
7893
- id: typeof Schema.String;
7894
- eventId: typeof Schema.String;
7895
- eventName: typeof Schema.String;
7896
- triggerId: typeof Schema.String;
7897
- workflowName: typeof Schema.String;
7898
- executionId: Schema.NullOr<typeof Schema.String>;
7899
- status: Schema.Literal<["starting", "started", "skipped", "failed"]>;
7900
- idempotencyKey: typeof Schema.String;
7901
- skipped: typeof Schema.Boolean;
7902
- errorMessage: Schema.NullOr<typeof Schema.String>;
7903
- createdAt: typeof Schema.Date;
7904
- completedAt: Schema.NullOr<typeof Schema.Date>;
7823
+ readonly id: Schema.String;
7824
+ readonly eventId: Schema.String;
7825
+ readonly eventName: Schema.String;
7826
+ readonly triggerId: Schema.String;
7827
+ readonly workflowName: Schema.String;
7828
+ readonly executionId: Schema.NullOr<Schema.String>;
7829
+ readonly status: Schema.Literals<readonly ["starting", "started", "skipped", "failed"]>;
7830
+ readonly idempotencyKey: Schema.String;
7831
+ readonly skipped: Schema.Boolean;
7832
+ readonly errorMessage: Schema.NullOr<Schema.String>;
7833
+ readonly createdAt: Schema.DateFromString;
7834
+ readonly completedAt: Schema.NullOr<Schema.DateFromString>;
7905
7835
  }>;
7906
7836
 
7907
7837
  export declare type WorkflowParentClosePolicy = Schema.Schema.Type<typeof WorkflowParentClosePolicySchema>;
7908
7838
 
7909
- export declare const WorkflowParentClosePolicySchema: Schema.Literal<["cancel", "terminate", "abandon"]>;
7839
+ export declare const WorkflowParentClosePolicySchema: Schema.Literals<readonly ["cancel", "terminate", "abandon"]>;
7910
7840
 
7911
7841
  export declare const workflowQueuedCancelDescriptor: ActionProcedureDescriptor<"__voltro.workflow.queued.cancel", Schema.Struct<{
7912
- cause: Schema.optionalWith<Schema.Struct<{
7913
- reason: typeof Schema.NonEmptyString;
7914
- detail: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
7915
- }>, {
7916
- exact: true;
7917
- }>;
7918
- workflowName: typeof Schema.NonEmptyString;
7919
- receiptId: typeof Schema.NonEmptyString;
7920
- requestId: typeof Schema.NonEmptyString;
7921
- }>, Schema.filter<Schema.Struct<{
7922
- operation: Schema.Literal<["cancel"]>;
7923
- workflowName: typeof Schema.NonEmptyString;
7924
- receiptId: typeof Schema.NonEmptyString;
7925
- requestId: Schema.NullOr<typeof Schema.NonEmptyString>;
7926
- kind: Schema.Literal<["accepted", "confirmed", "unknown", "already-terminal"]>;
7927
- observation: Schema.Union<[Schema.Struct<{
7928
- kind: Schema.Literal<["pending"]>;
7842
+ readonly cause: Schema.optionalKey<Schema.Struct<{
7843
+ readonly reason: Schema.NonEmptyString;
7844
+ readonly detail: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
7845
+ }>>;
7846
+ readonly workflowName: Schema.NonEmptyString;
7847
+ readonly receiptId: Schema.NonEmptyString;
7848
+ readonly requestId: Schema.NonEmptyString;
7849
+ }>, Schema.Struct<{
7850
+ readonly operation: Schema.Literal<"cancel">;
7851
+ readonly workflowName: Schema.NonEmptyString;
7852
+ readonly receiptId: Schema.NonEmptyString;
7853
+ readonly requestId: Schema.NullOr<Schema.NonEmptyString>;
7854
+ readonly kind: Schema.Literals<readonly ["accepted", "confirmed", "unknown", "already-terminal"]>;
7855
+ readonly observation: Schema.Union<readonly [Schema.Struct<{
7856
+ readonly kind: Schema.Literal<"pending">;
7929
7857
  }>, Schema.Struct<{
7930
- kind: Schema.Literal<["admission"]>;
7931
- outcome: Schema.Union<[Schema.Union<[Schema.Struct<{
7932
- kind: Schema.Literal<["dropped"]>;
7933
- at: typeof Schema.Number;
7934
- retryAfterMs: typeof Schema.Number;
7858
+ readonly kind: Schema.Literal<"admission">;
7859
+ readonly outcome: Schema.Union<readonly [Schema.Union<readonly [Schema.Struct<{
7860
+ readonly kind: Schema.Literal<"dropped">;
7861
+ readonly at: Schema.Number;
7862
+ readonly retryAfterMs: Schema.Number;
7935
7863
  }>, Schema.Struct<{
7936
- kind: Schema.Literal<["skipped"]>;
7937
- at: typeof Schema.Number;
7938
- executionId: typeof Schema.String;
7939
- runId: typeof Schema.String;
7864
+ readonly kind: Schema.Literal<"skipped">;
7865
+ readonly at: Schema.Number;
7866
+ readonly executionId: Schema.String;
7867
+ readonly runId: Schema.String;
7940
7868
  }>, Schema.Struct<{
7941
- kind: Schema.Literal<["superseded"]>;
7942
- at: typeof Schema.Number;
7869
+ readonly kind: Schema.Literal<"superseded">;
7870
+ readonly at: Schema.Number;
7943
7871
  }>, Schema.Struct<{
7944
- kind: Schema.Literal<["cancelled"]>;
7945
- at: typeof Schema.Number;
7872
+ readonly kind: Schema.Literal<"cancelled">;
7873
+ readonly at: Schema.Number;
7946
7874
  }>, Schema.Struct<{
7947
- kind: Schema.Literal<["abandoned"]>;
7948
- at: typeof Schema.Number;
7949
- failureId: typeof Schema.NonEmptyString;
7875
+ readonly kind: Schema.Literal<"abandoned">;
7876
+ readonly at: Schema.Number;
7877
+ readonly failureId: Schema.NonEmptyString;
7950
7878
  }>]>, Schema.Struct<{
7951
- kind: Schema.Literal<["rejected"]>;
7952
- failureId: typeof Schema.NonEmptyString;
7879
+ readonly kind: Schema.Literal<"rejected">;
7880
+ readonly failureId: Schema.NonEmptyString;
7953
7881
  }>]>;
7954
7882
  }>, Schema.Struct<{
7955
- kind: Schema.Literal<["execution"]>;
7956
- snapshot: Schema.Struct<{
7957
- id: typeof Schema.String;
7958
- workflowName: typeof Schema.String;
7959
- executionId: typeof Schema.String;
7960
- status: Schema.Union<[Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>, Schema.Literal<["unknown"]>]>;
7961
- output: Schema.optional<typeof Schema.Unknown>;
7962
- error: Schema.optional<Schema.Struct<{
7963
- tag: Schema.NullOr<typeof Schema.String>;
7964
- message: typeof Schema.String;
7883
+ readonly kind: Schema.Literal<"execution">;
7884
+ readonly snapshot: Schema.Struct<{
7885
+ readonly id: Schema.String;
7886
+ readonly workflowName: Schema.String;
7887
+ readonly executionId: Schema.String;
7888
+ readonly status: Schema.Union<readonly [Schema.Literals<readonly ["running", "succeeded", "failed", "cancelled", "suspended"]>, Schema.Literal<"unknown">]>;
7889
+ readonly output: Schema.optional<Schema.Unknown>;
7890
+ readonly error: Schema.optional<Schema.Struct<{
7891
+ readonly tag: Schema.NullOr<Schema.String>;
7892
+ readonly message: Schema.String;
7965
7893
  }>>;
7966
7894
  }>;
7967
7895
  }>, Schema.Struct<{
7968
- kind: Schema.Literal<["unavailable"]>;
7969
- reason: Schema.Literal<["missing-request", "missing-run", "unconfirmed-generation", "unbound-submission"]>;
7896
+ readonly kind: Schema.Literal<"unavailable">;
7897
+ readonly reason: Schema.Literals<readonly ["missing-request", "missing-run", "unconfirmed-generation", "unbound-submission"]>;
7970
7898
  }>]>;
7971
- }>>, typeof Schema.Never>;
7899
+ }>, Schema.Never>;
7972
7900
 
7973
7901
  export declare type WorkflowQueuedCancelInput = typeof WorkflowQueuedCancelInputSchema.Type;
7974
7902
 
7975
7903
  export declare const WorkflowQueuedCancelInputSchema: Schema.Struct<{
7976
- cause: Schema.optionalWith<Schema.Struct<{
7977
- reason: typeof Schema.NonEmptyString;
7978
- detail: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
7979
- }>, {
7980
- exact: true;
7981
- }>;
7982
- workflowName: typeof Schema.NonEmptyString;
7983
- receiptId: typeof Schema.NonEmptyString;
7984
- requestId: typeof Schema.NonEmptyString;
7904
+ readonly cause: Schema.optionalKey<Schema.Struct<{
7905
+ readonly reason: Schema.NonEmptyString;
7906
+ readonly detail: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
7907
+ }>>;
7908
+ readonly workflowName: Schema.NonEmptyString;
7909
+ readonly receiptId: Schema.NonEmptyString;
7910
+ readonly requestId: Schema.NonEmptyString;
7985
7911
  }>;
7986
7912
 
7987
7913
  export declare type WorkflowQueuedCancellationResult = typeof WorkflowQueuedCancellationResultSchema.Type;
7988
7914
 
7989
7915
  /** A queued caller has a receipt before any execution exists. Keep admission
7990
7916
  * evidence separate from an observed execution rather than fabricating IDs. */
7991
- export declare const WorkflowQueuedCancellationResultSchema: Schema.filter<Schema.Struct<{
7992
- operation: Schema.Literal<["cancel"]>;
7993
- workflowName: typeof Schema.NonEmptyString;
7994
- receiptId: typeof Schema.NonEmptyString;
7995
- requestId: Schema.NullOr<typeof Schema.NonEmptyString>;
7996
- kind: Schema.Literal<["accepted", "confirmed", "unknown", "already-terminal"]>;
7997
- observation: Schema.Union<[Schema.Struct<{
7998
- kind: Schema.Literal<["pending"]>;
7917
+ export declare const WorkflowQueuedCancellationResultSchema: Schema.Struct<{
7918
+ readonly operation: Schema.Literal<"cancel">;
7919
+ readonly workflowName: Schema.NonEmptyString;
7920
+ readonly receiptId: Schema.NonEmptyString;
7921
+ readonly requestId: Schema.NullOr<Schema.NonEmptyString>;
7922
+ readonly kind: Schema.Literals<readonly ["accepted", "confirmed", "unknown", "already-terminal"]>;
7923
+ readonly observation: Schema.Union<readonly [Schema.Struct<{
7924
+ readonly kind: Schema.Literal<"pending">;
7999
7925
  }>, Schema.Struct<{
8000
- kind: Schema.Literal<["admission"]>;
8001
- outcome: Schema.Union<[Schema.Union<[Schema.Struct<{
8002
- kind: Schema.Literal<["dropped"]>;
8003
- at: typeof Schema.Number;
8004
- retryAfterMs: typeof Schema.Number;
7926
+ readonly kind: Schema.Literal<"admission">;
7927
+ readonly outcome: Schema.Union<readonly [Schema.Union<readonly [Schema.Struct<{
7928
+ readonly kind: Schema.Literal<"dropped">;
7929
+ readonly at: Schema.Number;
7930
+ readonly retryAfterMs: Schema.Number;
8005
7931
  }>, Schema.Struct<{
8006
- kind: Schema.Literal<["skipped"]>;
8007
- at: typeof Schema.Number;
8008
- executionId: typeof Schema.String;
8009
- runId: typeof Schema.String;
7932
+ readonly kind: Schema.Literal<"skipped">;
7933
+ readonly at: Schema.Number;
7934
+ readonly executionId: Schema.String;
7935
+ readonly runId: Schema.String;
8010
7936
  }>, Schema.Struct<{
8011
- kind: Schema.Literal<["superseded"]>;
8012
- at: typeof Schema.Number;
7937
+ readonly kind: Schema.Literal<"superseded">;
7938
+ readonly at: Schema.Number;
8013
7939
  }>, Schema.Struct<{
8014
- kind: Schema.Literal<["cancelled"]>;
8015
- at: typeof Schema.Number;
7940
+ readonly kind: Schema.Literal<"cancelled">;
7941
+ readonly at: Schema.Number;
8016
7942
  }>, Schema.Struct<{
8017
- kind: Schema.Literal<["abandoned"]>;
8018
- at: typeof Schema.Number;
8019
- failureId: typeof Schema.NonEmptyString;
7943
+ readonly kind: Schema.Literal<"abandoned">;
7944
+ readonly at: Schema.Number;
7945
+ readonly failureId: Schema.NonEmptyString;
8020
7946
  }>]>, Schema.Struct<{
8021
- kind: Schema.Literal<["rejected"]>;
8022
- failureId: typeof Schema.NonEmptyString;
7947
+ readonly kind: Schema.Literal<"rejected">;
7948
+ readonly failureId: Schema.NonEmptyString;
8023
7949
  }>]>;
8024
7950
  }>, Schema.Struct<{
8025
- kind: Schema.Literal<["execution"]>;
8026
- snapshot: Schema.Struct<{
8027
- id: typeof Schema.String;
8028
- workflowName: typeof Schema.String;
8029
- executionId: typeof Schema.String;
8030
- status: Schema.Union<[Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>, Schema.Literal<["unknown"]>]>;
8031
- output: Schema.optional<typeof Schema.Unknown>;
8032
- error: Schema.optional<Schema.Struct<{
8033
- tag: Schema.NullOr<typeof Schema.String>;
8034
- message: typeof Schema.String;
7951
+ readonly kind: Schema.Literal<"execution">;
7952
+ readonly snapshot: Schema.Struct<{
7953
+ readonly id: Schema.String;
7954
+ readonly workflowName: Schema.String;
7955
+ readonly executionId: Schema.String;
7956
+ readonly status: Schema.Union<readonly [Schema.Literals<readonly ["running", "succeeded", "failed", "cancelled", "suspended"]>, Schema.Literal<"unknown">]>;
7957
+ readonly output: Schema.optional<Schema.Unknown>;
7958
+ readonly error: Schema.optional<Schema.Struct<{
7959
+ readonly tag: Schema.NullOr<Schema.String>;
7960
+ readonly message: Schema.String;
8035
7961
  }>>;
8036
7962
  }>;
8037
7963
  }>, Schema.Struct<{
8038
- kind: Schema.Literal<["unavailable"]>;
8039
- reason: Schema.Literal<["missing-request", "missing-run", "unconfirmed-generation", "unbound-submission"]>;
7964
+ readonly kind: Schema.Literal<"unavailable">;
7965
+ readonly reason: Schema.Literals<readonly ["missing-request", "missing-run", "unconfirmed-generation", "unbound-submission"]>;
8040
7966
  }>]>;
8041
- }>>;
7967
+ }>;
8042
7968
 
8043
7969
  export declare const workflowQueuedControlQueryDescriptor: QueryProcedureDescriptor<"__voltro.workflow.queued.control", Schema.Struct<{
8044
- workflowName: typeof Schema.NonEmptyString;
8045
- receiptId: typeof Schema.NonEmptyString;
8046
- requestId: typeof Schema.NonEmptyString;
8047
- }>, Schema.filter<Schema.Struct<{
8048
- operation: Schema.Literal<["cancel"]>;
8049
- workflowName: typeof Schema.NonEmptyString;
8050
- receiptId: typeof Schema.NonEmptyString;
8051
- requestId: Schema.NullOr<typeof Schema.NonEmptyString>;
8052
- kind: Schema.Literal<["accepted", "confirmed", "unknown", "already-terminal"]>;
8053
- observation: Schema.Union<[Schema.Struct<{
8054
- kind: Schema.Literal<["pending"]>;
7970
+ readonly workflowName: Schema.NonEmptyString;
7971
+ readonly receiptId: Schema.NonEmptyString;
7972
+ readonly requestId: Schema.NonEmptyString;
7973
+ }>, Schema.Struct<{
7974
+ readonly operation: Schema.Literal<"cancel">;
7975
+ readonly workflowName: Schema.NonEmptyString;
7976
+ readonly receiptId: Schema.NonEmptyString;
7977
+ readonly requestId: Schema.NullOr<Schema.NonEmptyString>;
7978
+ readonly kind: Schema.Literals<readonly ["accepted", "confirmed", "unknown", "already-terminal"]>;
7979
+ readonly observation: Schema.Union<readonly [Schema.Struct<{
7980
+ readonly kind: Schema.Literal<"pending">;
8055
7981
  }>, Schema.Struct<{
8056
- kind: Schema.Literal<["admission"]>;
8057
- outcome: Schema.Union<[Schema.Union<[Schema.Struct<{
8058
- kind: Schema.Literal<["dropped"]>;
8059
- at: typeof Schema.Number;
8060
- retryAfterMs: typeof Schema.Number;
7982
+ readonly kind: Schema.Literal<"admission">;
7983
+ readonly outcome: Schema.Union<readonly [Schema.Union<readonly [Schema.Struct<{
7984
+ readonly kind: Schema.Literal<"dropped">;
7985
+ readonly at: Schema.Number;
7986
+ readonly retryAfterMs: Schema.Number;
8061
7987
  }>, Schema.Struct<{
8062
- kind: Schema.Literal<["skipped"]>;
8063
- at: typeof Schema.Number;
8064
- executionId: typeof Schema.String;
8065
- runId: typeof Schema.String;
7988
+ readonly kind: Schema.Literal<"skipped">;
7989
+ readonly at: Schema.Number;
7990
+ readonly executionId: Schema.String;
7991
+ readonly runId: Schema.String;
8066
7992
  }>, Schema.Struct<{
8067
- kind: Schema.Literal<["superseded"]>;
8068
- at: typeof Schema.Number;
7993
+ readonly kind: Schema.Literal<"superseded">;
7994
+ readonly at: Schema.Number;
8069
7995
  }>, Schema.Struct<{
8070
- kind: Schema.Literal<["cancelled"]>;
8071
- at: typeof Schema.Number;
7996
+ readonly kind: Schema.Literal<"cancelled">;
7997
+ readonly at: Schema.Number;
8072
7998
  }>, Schema.Struct<{
8073
- kind: Schema.Literal<["abandoned"]>;
8074
- at: typeof Schema.Number;
8075
- failureId: typeof Schema.NonEmptyString;
7999
+ readonly kind: Schema.Literal<"abandoned">;
8000
+ readonly at: Schema.Number;
8001
+ readonly failureId: Schema.NonEmptyString;
8076
8002
  }>]>, Schema.Struct<{
8077
- kind: Schema.Literal<["rejected"]>;
8078
- failureId: typeof Schema.NonEmptyString;
8003
+ readonly kind: Schema.Literal<"rejected">;
8004
+ readonly failureId: Schema.NonEmptyString;
8079
8005
  }>]>;
8080
8006
  }>, Schema.Struct<{
8081
- kind: Schema.Literal<["execution"]>;
8082
- snapshot: Schema.Struct<{
8083
- id: typeof Schema.String;
8084
- workflowName: typeof Schema.String;
8085
- executionId: typeof Schema.String;
8086
- status: Schema.Union<[Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>, Schema.Literal<["unknown"]>]>;
8087
- output: Schema.optional<typeof Schema.Unknown>;
8088
- error: Schema.optional<Schema.Struct<{
8089
- tag: Schema.NullOr<typeof Schema.String>;
8090
- message: typeof Schema.String;
8007
+ readonly kind: Schema.Literal<"execution">;
8008
+ readonly snapshot: Schema.Struct<{
8009
+ readonly id: Schema.String;
8010
+ readonly workflowName: Schema.String;
8011
+ readonly executionId: Schema.String;
8012
+ readonly status: Schema.Union<readonly [Schema.Literals<readonly ["running", "succeeded", "failed", "cancelled", "suspended"]>, Schema.Literal<"unknown">]>;
8013
+ readonly output: Schema.optional<Schema.Unknown>;
8014
+ readonly error: Schema.optional<Schema.Struct<{
8015
+ readonly tag: Schema.NullOr<Schema.String>;
8016
+ readonly message: Schema.String;
8091
8017
  }>>;
8092
8018
  }>;
8093
8019
  }>, Schema.Struct<{
8094
- kind: Schema.Literal<["unavailable"]>;
8095
- reason: Schema.Literal<["missing-request", "missing-run", "unconfirmed-generation", "unbound-submission"]>;
8020
+ readonly kind: Schema.Literal<"unavailable">;
8021
+ readonly reason: Schema.Literals<readonly ["missing-request", "missing-run", "unconfirmed-generation", "unbound-submission"]>;
8096
8022
  }>]>;
8097
- }>>, typeof Schema.Never>;
8023
+ }>, Schema.Never>;
8098
8024
 
8099
8025
  export declare type WorkflowQueuedControlTarget = typeof WorkflowQueuedControlTargetSchema.Type;
8100
8026
 
8101
8027
  export declare const WorkflowQueuedControlTargetSchema: Schema.Struct<{
8102
- workflowName: typeof Schema.NonEmptyString;
8103
- receiptId: typeof Schema.NonEmptyString;
8104
- requestId: typeof Schema.NonEmptyString;
8028
+ readonly workflowName: Schema.NonEmptyString;
8029
+ readonly receiptId: Schema.NonEmptyString;
8030
+ readonly requestId: Schema.NonEmptyString;
8105
8031
  }>;
8106
8032
 
8107
8033
  export declare type WorkflowRestartCommand = typeof WorkflowRestartCommandSchema.Type;
8108
8034
 
8109
8035
  export declare const WorkflowRestartCommandSchema: Schema.Struct<{
8110
- selection: Schema.Union<[Schema.Struct<{
8111
- kind: Schema.Literal<["failed-steps"]>;
8036
+ readonly selection: Schema.Union<readonly [Schema.Struct<{
8037
+ readonly kind: Schema.Literal<"failed-steps">;
8112
8038
  }>, Schema.Struct<{
8113
- kind: Schema.Literal<["from-step"]>;
8114
- stepName: Schema.filter<typeof Schema.NonEmptyString>;
8039
+ readonly kind: Schema.Literal<"from-step">;
8040
+ readonly stepName: Schema.NonEmptyString;
8115
8041
  }>]>;
8116
- requestId: Schema.filter<Schema.filter<typeof Schema.NonEmptyString>>;
8117
- runId: Schema.filter<typeof Schema.NonEmptyString>;
8042
+ readonly requestId: Schema.NonEmptyString;
8043
+ readonly runId: Schema.NonEmptyString;
8118
8044
  }>;
8119
8045
 
8120
8046
  export declare type WorkflowRestartObservation = typeof WorkflowRestartObservationSchema.Type;
8121
8047
 
8122
8048
  /** Pending is a durable reservation, not proof of reset or engine entry.
8123
8049
  * Entered confirms this command's generation; it does not claim run success. */
8124
- export declare const WorkflowRestartObservationSchema: Schema.Union<[Schema.Struct<{
8125
- kind: Schema.Literal<["not-found"]>;
8126
- requestId: Schema.filter<Schema.filter<typeof Schema.NonEmptyString>>;
8127
- runId: Schema.filter<typeof Schema.NonEmptyString>;
8050
+ export declare const WorkflowRestartObservationSchema: Schema.Union<readonly [Schema.Struct<{
8051
+ readonly kind: Schema.Literal<"not-found">;
8052
+ readonly requestId: Schema.NonEmptyString;
8053
+ readonly runId: Schema.NonEmptyString;
8128
8054
  }>, Schema.Struct<{
8129
- kind: Schema.Literal<["withdrawn"]>;
8130
- workflowName: Schema.filter<typeof Schema.NonEmptyString>;
8131
- withdrawnAt: Schema.filter<typeof Schema.Number>;
8132
- selection: Schema.Union<[Schema.Struct<{
8133
- kind: Schema.Literal<["failed-steps"]>;
8055
+ readonly kind: Schema.Literal<"withdrawn">;
8056
+ readonly workflowName: Schema.NonEmptyString;
8057
+ readonly withdrawnAt: Schema.Number;
8058
+ readonly selection: Schema.Union<readonly [Schema.Struct<{
8059
+ readonly kind: Schema.Literal<"failed-steps">;
8134
8060
  }>, Schema.Struct<{
8135
- kind: Schema.Literal<["from-step"]>;
8136
- stepName: Schema.filter<typeof Schema.NonEmptyString>;
8061
+ readonly kind: Schema.Literal<"from-step">;
8062
+ readonly stepName: Schema.NonEmptyString;
8137
8063
  }>]>;
8138
- requestId: Schema.filter<Schema.filter<typeof Schema.NonEmptyString>>;
8139
- runId: Schema.filter<typeof Schema.NonEmptyString>;
8064
+ readonly requestId: Schema.NonEmptyString;
8065
+ readonly runId: Schema.NonEmptyString;
8140
8066
  }>, Schema.Struct<{
8141
- kind: Schema.Literal<["pending"]>;
8142
- workflowName: Schema.filter<typeof Schema.NonEmptyString>;
8143
- executionId: Schema.filter<typeof Schema.NonEmptyString>;
8144
- originalGeneration: Schema.filter<typeof Schema.NonEmptyString>;
8145
- requestedAt: Schema.filter<typeof Schema.Number>;
8146
- dispatchAttempts: Schema.refine<number, typeof Schema.NonNegative>;
8147
- selection: Schema.Union<[Schema.Struct<{
8148
- kind: Schema.Literal<["failed-steps"]>;
8067
+ readonly kind: Schema.Literal<"pending">;
8068
+ readonly workflowName: Schema.NonEmptyString;
8069
+ readonly executionId: Schema.NonEmptyString;
8070
+ readonly originalGeneration: Schema.NonEmptyString;
8071
+ readonly requestedAt: Schema.Number;
8072
+ readonly dispatchAttempts: Schema.Number;
8073
+ readonly selection: Schema.Union<readonly [Schema.Struct<{
8074
+ readonly kind: Schema.Literal<"failed-steps">;
8149
8075
  }>, Schema.Struct<{
8150
- kind: Schema.Literal<["from-step"]>;
8151
- stepName: Schema.filter<typeof Schema.NonEmptyString>;
8076
+ readonly kind: Schema.Literal<"from-step">;
8077
+ readonly stepName: Schema.NonEmptyString;
8152
8078
  }>]>;
8153
- requestId: Schema.filter<Schema.filter<typeof Schema.NonEmptyString>>;
8154
- runId: Schema.filter<typeof Schema.NonEmptyString>;
8155
- }>, Schema.filter<Schema.Struct<{
8156
- kind: Schema.Literal<["entered"]>;
8157
- enteredGeneration: Schema.filter<typeof Schema.NonEmptyString>;
8158
- workflowName: Schema.filter<typeof Schema.NonEmptyString>;
8159
- executionId: Schema.filter<typeof Schema.NonEmptyString>;
8160
- originalGeneration: Schema.filter<typeof Schema.NonEmptyString>;
8161
- requestedAt: Schema.filter<typeof Schema.Number>;
8162
- dispatchAttempts: Schema.refine<number, typeof Schema.NonNegative>;
8163
- selection: Schema.Union<[Schema.Struct<{
8164
- kind: Schema.Literal<["failed-steps"]>;
8079
+ readonly requestId: Schema.NonEmptyString;
8080
+ readonly runId: Schema.NonEmptyString;
8081
+ }>, Schema.Struct<{
8082
+ readonly kind: Schema.Literal<"entered">;
8083
+ readonly enteredGeneration: Schema.NonEmptyString;
8084
+ readonly workflowName: Schema.NonEmptyString;
8085
+ readonly executionId: Schema.NonEmptyString;
8086
+ readonly originalGeneration: Schema.NonEmptyString;
8087
+ readonly requestedAt: Schema.Number;
8088
+ readonly dispatchAttempts: Schema.Number;
8089
+ readonly selection: Schema.Union<readonly [Schema.Struct<{
8090
+ readonly kind: Schema.Literal<"failed-steps">;
8165
8091
  }>, Schema.Struct<{
8166
- kind: Schema.Literal<["from-step"]>;
8167
- stepName: Schema.filter<typeof Schema.NonEmptyString>;
8092
+ readonly kind: Schema.Literal<"from-step">;
8093
+ readonly stepName: Schema.NonEmptyString;
8168
8094
  }>]>;
8169
- requestId: Schema.filter<Schema.filter<typeof Schema.NonEmptyString>>;
8170
- runId: Schema.filter<typeof Schema.NonEmptyString>;
8171
- }>>]>;
8095
+ readonly requestId: Schema.NonEmptyString;
8096
+ readonly runId: Schema.NonEmptyString;
8097
+ }>]>;
8172
8098
 
8173
8099
  export declare type WorkflowRestartResult = typeof WorkflowRestartResultSchema.Type;
8174
8100
 
8175
8101
  /** A refused reservation never reset the journal. Transport failures instead
8176
8102
  * require reading the original target; they are not proof of refusal. */
8177
- export declare const WorkflowRestartResultSchema: Schema.Union<[Schema.Union<[Schema.Struct<{
8178
- kind: Schema.Literal<["not-found"]>;
8179
- requestId: Schema.filter<Schema.filter<typeof Schema.NonEmptyString>>;
8180
- runId: Schema.filter<typeof Schema.NonEmptyString>;
8103
+ export declare const WorkflowRestartResultSchema: Schema.Union<readonly [Schema.Union<readonly [Schema.Struct<{
8104
+ readonly kind: Schema.Literal<"not-found">;
8105
+ readonly requestId: Schema.NonEmptyString;
8106
+ readonly runId: Schema.NonEmptyString;
8181
8107
  }>, Schema.Struct<{
8182
- kind: Schema.Literal<["withdrawn"]>;
8183
- workflowName: Schema.filter<typeof Schema.NonEmptyString>;
8184
- withdrawnAt: Schema.filter<typeof Schema.Number>;
8185
- selection: Schema.Union<[Schema.Struct<{
8186
- kind: Schema.Literal<["failed-steps"]>;
8108
+ readonly kind: Schema.Literal<"withdrawn">;
8109
+ readonly workflowName: Schema.NonEmptyString;
8110
+ readonly withdrawnAt: Schema.Number;
8111
+ readonly selection: Schema.Union<readonly [Schema.Struct<{
8112
+ readonly kind: Schema.Literal<"failed-steps">;
8187
8113
  }>, Schema.Struct<{
8188
- kind: Schema.Literal<["from-step"]>;
8189
- stepName: Schema.filter<typeof Schema.NonEmptyString>;
8114
+ readonly kind: Schema.Literal<"from-step">;
8115
+ readonly stepName: Schema.NonEmptyString;
8190
8116
  }>]>;
8191
- requestId: Schema.filter<Schema.filter<typeof Schema.NonEmptyString>>;
8192
- runId: Schema.filter<typeof Schema.NonEmptyString>;
8117
+ readonly requestId: Schema.NonEmptyString;
8118
+ readonly runId: Schema.NonEmptyString;
8193
8119
  }>, Schema.Struct<{
8194
- kind: Schema.Literal<["pending"]>;
8195
- workflowName: Schema.filter<typeof Schema.NonEmptyString>;
8196
- executionId: Schema.filter<typeof Schema.NonEmptyString>;
8197
- originalGeneration: Schema.filter<typeof Schema.NonEmptyString>;
8198
- requestedAt: Schema.filter<typeof Schema.Number>;
8199
- dispatchAttempts: Schema.refine<number, typeof Schema.NonNegative>;
8200
- selection: Schema.Union<[Schema.Struct<{
8201
- kind: Schema.Literal<["failed-steps"]>;
8120
+ readonly kind: Schema.Literal<"pending">;
8121
+ readonly workflowName: Schema.NonEmptyString;
8122
+ readonly executionId: Schema.NonEmptyString;
8123
+ readonly originalGeneration: Schema.NonEmptyString;
8124
+ readonly requestedAt: Schema.Number;
8125
+ readonly dispatchAttempts: Schema.Number;
8126
+ readonly selection: Schema.Union<readonly [Schema.Struct<{
8127
+ readonly kind: Schema.Literal<"failed-steps">;
8202
8128
  }>, Schema.Struct<{
8203
- kind: Schema.Literal<["from-step"]>;
8204
- stepName: Schema.filter<typeof Schema.NonEmptyString>;
8129
+ readonly kind: Schema.Literal<"from-step">;
8130
+ readonly stepName: Schema.NonEmptyString;
8205
8131
  }>]>;
8206
- requestId: Schema.filter<Schema.filter<typeof Schema.NonEmptyString>>;
8207
- runId: Schema.filter<typeof Schema.NonEmptyString>;
8208
- }>, Schema.filter<Schema.Struct<{
8209
- kind: Schema.Literal<["entered"]>;
8210
- enteredGeneration: Schema.filter<typeof Schema.NonEmptyString>;
8211
- workflowName: Schema.filter<typeof Schema.NonEmptyString>;
8212
- executionId: Schema.filter<typeof Schema.NonEmptyString>;
8213
- originalGeneration: Schema.filter<typeof Schema.NonEmptyString>;
8214
- requestedAt: Schema.filter<typeof Schema.Number>;
8215
- dispatchAttempts: Schema.refine<number, typeof Schema.NonNegative>;
8216
- selection: Schema.Union<[Schema.Struct<{
8217
- kind: Schema.Literal<["failed-steps"]>;
8132
+ readonly requestId: Schema.NonEmptyString;
8133
+ readonly runId: Schema.NonEmptyString;
8134
+ }>, Schema.Struct<{
8135
+ readonly kind: Schema.Literal<"entered">;
8136
+ readonly enteredGeneration: Schema.NonEmptyString;
8137
+ readonly workflowName: Schema.NonEmptyString;
8138
+ readonly executionId: Schema.NonEmptyString;
8139
+ readonly originalGeneration: Schema.NonEmptyString;
8140
+ readonly requestedAt: Schema.Number;
8141
+ readonly dispatchAttempts: Schema.Number;
8142
+ readonly selection: Schema.Union<readonly [Schema.Struct<{
8143
+ readonly kind: Schema.Literal<"failed-steps">;
8218
8144
  }>, Schema.Struct<{
8219
- kind: Schema.Literal<["from-step"]>;
8220
- stepName: Schema.filter<typeof Schema.NonEmptyString>;
8145
+ readonly kind: Schema.Literal<"from-step">;
8146
+ readonly stepName: Schema.NonEmptyString;
8221
8147
  }>]>;
8222
- requestId: Schema.filter<Schema.filter<typeof Schema.NonEmptyString>>;
8223
- runId: Schema.filter<typeof Schema.NonEmptyString>;
8224
- }>>]>, Schema.Struct<{
8225
- kind: Schema.Literal<["not-reserved"]>;
8226
- reason: Schema.Literal<["admission", "journal"]>;
8227
- requestId: Schema.filter<Schema.filter<typeof Schema.NonEmptyString>>;
8228
- runId: Schema.filter<typeof Schema.NonEmptyString>;
8148
+ readonly requestId: Schema.NonEmptyString;
8149
+ readonly runId: Schema.NonEmptyString;
8150
+ }>]>, Schema.Struct<{
8151
+ readonly kind: Schema.Literal<"not-reserved">;
8152
+ readonly reason: Schema.Literals<readonly ["admission", "journal"]>;
8153
+ readonly requestId: Schema.NonEmptyString;
8154
+ readonly runId: Schema.NonEmptyString;
8229
8155
  }>]>;
8230
8156
 
8231
8157
  export declare type WorkflowRestartSelection = typeof WorkflowRestartSelectionSchema.Type;
8232
8158
 
8233
- export declare const WorkflowRestartSelectionSchema: Schema.Union<[Schema.Struct<{
8234
- kind: Schema.Literal<["failed-steps"]>;
8159
+ export declare const WorkflowRestartSelectionSchema: Schema.Union<readonly [Schema.Struct<{
8160
+ readonly kind: Schema.Literal<"failed-steps">;
8235
8161
  }>, Schema.Struct<{
8236
- kind: Schema.Literal<["from-step"]>;
8237
- stepName: Schema.filter<typeof Schema.NonEmptyString>;
8162
+ readonly kind: Schema.Literal<"from-step">;
8163
+ readonly stepName: Schema.NonEmptyString;
8238
8164
  }>]>;
8239
8165
 
8240
8166
  export declare type WorkflowRestartTarget = typeof WorkflowRestartTargetSchema.Type;
8241
8167
 
8242
8168
  /** Persist before submitting; read this same target after an uncertain reply. */
8243
8169
  export declare const WorkflowRestartTargetSchema: Schema.Struct<{
8244
- requestId: Schema.filter<Schema.filter<typeof Schema.NonEmptyString>>;
8245
- runId: Schema.filter<typeof Schema.NonEmptyString>;
8170
+ readonly requestId: Schema.NonEmptyString;
8171
+ readonly runId: Schema.NonEmptyString;
8246
8172
  }>;
8247
8173
 
8248
8174
  export declare const workflowResumeDescriptor: ActionProcedureDescriptor<"__voltro.workflow.resume", Schema.Struct<{
8249
- workflowName: typeof Schema.String;
8250
- executionId: typeof Schema.String;
8251
- control: Schema.optional<Schema.Struct<{
8252
- requestId: typeof Schema.NonEmptyString;
8253
- cause: Schema.optionalWith<Schema.Struct<{
8254
- reason: typeof Schema.NonEmptyString;
8255
- detail: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
8256
- }>, {
8257
- exact: true;
8258
- }>;
8175
+ readonly workflowName: Schema.String;
8176
+ readonly executionId: Schema.String;
8177
+ readonly control: Schema.optional<Schema.Struct<{
8178
+ readonly requestId: Schema.NonEmptyString;
8179
+ readonly cause: Schema.optionalKey<Schema.Struct<{
8180
+ readonly reason: Schema.NonEmptyString;
8181
+ readonly detail: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
8182
+ }>>;
8259
8183
  }>>;
8260
- }>, Schema.filter<Schema.Struct<{
8261
- operation: Schema.Literal<["cancel", "resume"]>;
8262
- kind: Schema.Literal<["accepted", "confirmed", "unknown", "already-terminal"]>;
8263
- requestId: Schema.NullOr<typeof Schema.NonEmptyString>;
8264
- snapshot: Schema.Struct<{
8265
- id: typeof Schema.String;
8266
- workflowName: typeof Schema.String;
8267
- executionId: typeof Schema.String;
8268
- status: Schema.Union<[Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>, Schema.Literal<["unknown"]>]>;
8269
- output: Schema.optional<typeof Schema.Unknown>;
8270
- error: Schema.optional<Schema.Struct<{
8271
- tag: Schema.NullOr<typeof Schema.String>;
8272
- message: typeof Schema.String;
8184
+ }>, Schema.Struct<{
8185
+ readonly operation: Schema.Literals<readonly ["cancel", "resume"]>;
8186
+ readonly kind: Schema.Literals<readonly ["accepted", "confirmed", "unknown", "already-terminal"]>;
8187
+ readonly requestId: Schema.NullOr<Schema.NonEmptyString>;
8188
+ readonly snapshot: Schema.Struct<{
8189
+ readonly id: Schema.String;
8190
+ readonly workflowName: Schema.String;
8191
+ readonly executionId: Schema.String;
8192
+ readonly status: Schema.Union<readonly [Schema.Literals<readonly ["running", "succeeded", "failed", "cancelled", "suspended"]>, Schema.Literal<"unknown">]>;
8193
+ readonly output: Schema.optional<Schema.Unknown>;
8194
+ readonly error: Schema.optional<Schema.Struct<{
8195
+ readonly tag: Schema.NullOr<Schema.String>;
8196
+ readonly message: Schema.String;
8273
8197
  }>>;
8274
8198
  }>;
8275
- }>>, typeof Schema.Never>;
8199
+ }>, Schema.Never>;
8276
8200
 
8277
8201
  export declare type WorkflowRetryCommand = typeof WorkflowRetryCommandSchema.Type;
8278
8202
 
8279
8203
  /** Transport input for one deliberate retry; ownership is resolved server-side.
8280
8204
  * The optional override is encoded with the complete workflow payload schema. */
8281
8205
  export declare const WorkflowRetryCommandSchema: Schema.Struct<{
8282
- payloadOverride: Schema.optional<typeof Schema.Unknown>;
8283
- runId: Schema.filter<typeof Schema.NonEmptyString>;
8284
- requestId: Schema.filter<typeof Schema.NonEmptyString>;
8206
+ readonly payloadOverride: Schema.optional<Schema.Unknown>;
8207
+ readonly runId: Schema.NonEmptyString;
8208
+ readonly requestId: Schema.NonEmptyString;
8285
8209
  }>;
8286
8210
 
8287
8211
  export declare type WorkflowRetryObservation = typeof WorkflowRetryObservationSchema.Type;
8288
8212
 
8289
8213
  /** Observation of one durable retry intent. Engine acceptance is not workflow
8290
8214
  * completion. A prepared identity alone never proves that execution started. */
8291
- export declare const WorkflowRetryObservationSchema: Schema.Union<[Schema.Struct<{
8292
- kind: Schema.Literal<["queued"]>;
8293
- nextAttemptAt: Schema.NullOr<typeof Schema.Number>;
8294
- requestId: typeof Schema.NonEmptyString;
8295
- originalRunId: typeof Schema.NonEmptyString;
8296
- originalExecutionId: typeof Schema.NonEmptyString;
8297
- workflowName: typeof Schema.NonEmptyString;
8298
- }>, Schema.filter<Schema.Struct<{
8299
- kind: Schema.Literal<["accepted"]>;
8300
- executionId: typeof Schema.NonEmptyString;
8301
- requestId: typeof Schema.NonEmptyString;
8302
- originalRunId: typeof Schema.NonEmptyString;
8303
- originalExecutionId: typeof Schema.NonEmptyString;
8304
- workflowName: typeof Schema.NonEmptyString;
8305
- }>>, Schema.filter<Schema.Struct<{
8306
- kind: Schema.Literal<["unconfirmed"]>;
8307
- automaticRetryStopped: typeof Schema.Boolean;
8308
- nextAttemptAt: Schema.NullOr<typeof Schema.Number>;
8309
- requestId: typeof Schema.NonEmptyString;
8310
- originalRunId: typeof Schema.NonEmptyString;
8311
- originalExecutionId: typeof Schema.NonEmptyString;
8312
- workflowName: typeof Schema.NonEmptyString;
8313
- }>>, Schema.Struct<{
8314
- kind: Schema.Literal<["not-started"]>;
8315
- outcome: Schema.Union<[Schema.Struct<{
8316
- kind: Schema.Literal<["dropped"]>;
8317
- at: typeof Schema.Number;
8318
- retryAfterMs: typeof Schema.Number;
8215
+ export declare const WorkflowRetryObservationSchema: Schema.Union<readonly [Schema.Struct<{
8216
+ readonly kind: Schema.Literal<"queued">;
8217
+ readonly nextAttemptAt: Schema.NullOr<Schema.Number>;
8218
+ readonly requestId: Schema.NonEmptyString;
8219
+ readonly originalRunId: Schema.NonEmptyString;
8220
+ readonly originalExecutionId: Schema.NonEmptyString;
8221
+ readonly workflowName: Schema.NonEmptyString;
8222
+ }>, Schema.Struct<{
8223
+ readonly kind: Schema.Literal<"accepted">;
8224
+ readonly executionId: Schema.NonEmptyString;
8225
+ readonly requestId: Schema.NonEmptyString;
8226
+ readonly originalRunId: Schema.NonEmptyString;
8227
+ readonly originalExecutionId: Schema.NonEmptyString;
8228
+ readonly workflowName: Schema.NonEmptyString;
8229
+ }>, Schema.Struct<{
8230
+ readonly kind: Schema.Literal<"unconfirmed">;
8231
+ readonly automaticRetryStopped: Schema.Boolean;
8232
+ readonly nextAttemptAt: Schema.NullOr<Schema.Number>;
8233
+ readonly requestId: Schema.NonEmptyString;
8234
+ readonly originalRunId: Schema.NonEmptyString;
8235
+ readonly originalExecutionId: Schema.NonEmptyString;
8236
+ readonly workflowName: Schema.NonEmptyString;
8237
+ }>, Schema.Struct<{
8238
+ readonly kind: Schema.Literal<"not-started">;
8239
+ readonly outcome: Schema.Union<readonly [Schema.Struct<{
8240
+ readonly kind: Schema.Literal<"dropped">;
8241
+ readonly at: Schema.Number;
8242
+ readonly retryAfterMs: Schema.Number;
8319
8243
  }>, Schema.Struct<{
8320
- kind: Schema.Literal<["skipped"]>;
8321
- at: typeof Schema.Number;
8322
- executionId: typeof Schema.String;
8323
- runId: typeof Schema.String;
8244
+ readonly kind: Schema.Literal<"skipped">;
8245
+ readonly at: Schema.Number;
8246
+ readonly executionId: Schema.String;
8247
+ readonly runId: Schema.String;
8324
8248
  }>, Schema.Struct<{
8325
- kind: Schema.Literal<["superseded"]>;
8326
- at: typeof Schema.Number;
8249
+ readonly kind: Schema.Literal<"superseded">;
8250
+ readonly at: Schema.Number;
8327
8251
  }>, Schema.Struct<{
8328
- kind: Schema.Literal<["cancelled"]>;
8329
- at: typeof Schema.Number;
8252
+ readonly kind: Schema.Literal<"cancelled">;
8253
+ readonly at: Schema.Number;
8330
8254
  }>, Schema.Struct<{
8331
- kind: Schema.Literal<["abandoned"]>;
8332
- at: typeof Schema.Number;
8333
- failureId: typeof Schema.NonEmptyString;
8255
+ readonly kind: Schema.Literal<"abandoned">;
8256
+ readonly at: Schema.Number;
8257
+ readonly failureId: Schema.NonEmptyString;
8334
8258
  }>]>;
8335
- requestId: typeof Schema.NonEmptyString;
8336
- originalRunId: typeof Schema.NonEmptyString;
8337
- originalExecutionId: typeof Schema.NonEmptyString;
8338
- workflowName: typeof Schema.NonEmptyString;
8259
+ readonly requestId: Schema.NonEmptyString;
8260
+ readonly originalRunId: Schema.NonEmptyString;
8261
+ readonly originalExecutionId: Schema.NonEmptyString;
8262
+ readonly workflowName: Schema.NonEmptyString;
8339
8263
  }>, Schema.Struct<{
8340
- kind: Schema.Literal<["rejected"]>;
8341
- failureId: typeof Schema.NonEmptyString;
8342
- requestId: typeof Schema.NonEmptyString;
8343
- originalRunId: typeof Schema.NonEmptyString;
8344
- originalExecutionId: typeof Schema.NonEmptyString;
8345
- workflowName: typeof Schema.NonEmptyString;
8264
+ readonly kind: Schema.Literal<"rejected">;
8265
+ readonly failureId: Schema.NonEmptyString;
8266
+ readonly requestId: Schema.NonEmptyString;
8267
+ readonly originalRunId: Schema.NonEmptyString;
8268
+ readonly originalExecutionId: Schema.NonEmptyString;
8269
+ readonly workflowName: Schema.NonEmptyString;
8346
8270
  }>]>;
8347
8271
 
8348
8272
  export declare type WorkflowRetryTarget = typeof WorkflowRetryTargetSchema.Type;
8349
8273
 
8350
8274
  /** Persist the request ID before sending. Reuse this target after a lost reply. */
8351
8275
  export declare const WorkflowRetryTargetSchema: Schema.Struct<{
8352
- runId: Schema.filter<typeof Schema.NonEmptyString>;
8353
- requestId: Schema.filter<typeof Schema.NonEmptyString>;
8276
+ readonly runId: Schema.NonEmptyString;
8277
+ readonly requestId: Schema.NonEmptyString;
8354
8278
  }>;
8355
8279
 
8356
8280
  export declare type WorkflowRunEventRow = Schema.Schema.Type<typeof WorkflowRunEventRowSchema>;
8357
8281
 
8358
8282
  export declare const WorkflowRunEventRowSchema: Schema.Struct<{
8359
- id: typeof Schema.String;
8360
- runId: typeof Schema.String;
8361
- eventType: typeof Schema.String;
8362
- payload: Schema.NullOr<typeof Schema.Unknown>;
8363
- occurredAt: typeof Schema.Date;
8364
- stepName: Schema.NullOr<typeof Schema.String>;
8365
- attempt: Schema.NullOr<typeof Schema.Number>;
8283
+ readonly id: Schema.String;
8284
+ readonly runId: Schema.String;
8285
+ readonly eventType: Schema.String;
8286
+ readonly payload: Schema.NullOr<Schema.Unknown>;
8287
+ readonly occurredAt: Schema.DateFromString;
8288
+ readonly stepName: Schema.NullOr<Schema.String>;
8289
+ readonly attempt: Schema.NullOr<Schema.Number>;
8366
8290
  }>;
8367
8291
 
8368
8292
  export declare const workflowRunEventsQueryDescriptor: QueryProcedureDescriptor<"__voltro.workflow.run.events", Schema.Struct<{
8369
8293
  /** `_voltro_workflow_runs.id`; step/event rows reference this id. */
8370
- runId: typeof Schema.String;
8371
- }>, Schema.Array$<Schema.Struct<{
8372
- id: typeof Schema.String;
8373
- runId: typeof Schema.String;
8374
- eventType: typeof Schema.String;
8375
- payload: Schema.NullOr<typeof Schema.Unknown>;
8376
- occurredAt: typeof Schema.Date;
8377
- stepName: Schema.NullOr<typeof Schema.String>;
8378
- attempt: Schema.NullOr<typeof Schema.Number>;
8379
- }>>, typeof Schema.Never>;
8294
+ readonly runId: Schema.String;
8295
+ }>, Schema.$Array<Schema.Struct<{
8296
+ readonly id: Schema.String;
8297
+ readonly runId: Schema.String;
8298
+ readonly eventType: Schema.String;
8299
+ readonly payload: Schema.NullOr<Schema.Unknown>;
8300
+ readonly occurredAt: Schema.DateFromString;
8301
+ readonly stepName: Schema.NullOr<Schema.String>;
8302
+ readonly attempt: Schema.NullOr<Schema.Number>;
8303
+ }>>, Schema.Never>;
8380
8304
 
8381
8305
  export declare type WorkflowRunHandle = Schema.Schema.Type<typeof WorkflowRunHandleSchema>;
8382
8306
 
8383
8307
  export declare const WorkflowRunHandleSchema: Schema.Struct<{
8384
8308
  /** Stable handle callers pass to `useWorkflowRun(...)`. The durable execution
8385
8309
  * id for a started run; the durable caller-receipt id for a queued one. */
8386
- id: typeof Schema.String;
8310
+ readonly id: Schema.String;
8387
8311
  /** Workflow tag, e.g. `notes.summarise`. */
8388
- workflowName: typeof Schema.String;
8312
+ readonly workflowName: Schema.String;
8389
8313
  /**
8390
8314
  * Deterministic durable id derived from workflow name + idempotency key.
8391
8315
  *
@@ -8399,7 +8323,7 @@ export declare const WorkflowRunHandleSchema: Schema.Struct<{
8399
8323
  * For a `skipped` singleton it is the INCUMBENT's execution id — a real,
8400
8324
  * pollable run, which is the entire point of `mode: 'skip'`.
8401
8325
  */
8402
- executionId: Schema.NullOr<typeof Schema.String>;
8326
+ readonly executionId: Schema.NullOr<Schema.String>;
8403
8327
  /**
8404
8328
  * `running` — the engine has it; starting is fire-and-return.
8405
8329
  * `succeeded` — a blocking start observed successful completion.
@@ -8415,8 +8339,8 @@ export declare const WorkflowRunHandleSchema: Schema.Struct<{
8415
8339
  * a fresh start; a schedule keyed per day ran once and reported forty-seven
8416
8340
  * "starts" that were replays. See `workflow()`'s `idempotencyKey` doc.
8417
8341
  */
8418
- status: Schema.Literal<["running", "succeeded", "queued", "dropped", "skipped", "replayed"]>;
8419
- deferral: Schema.optional<Schema.Struct<{
8342
+ readonly status: Schema.Literals<readonly ["running", "succeeded", "queued", "dropped", "skipped", "replayed"]>;
8343
+ readonly deferral: Schema.optional<Schema.Struct<{
8420
8344
  /** `debounce` | `batch` | `throttle` | `concurrency` | `paused` |
8421
8345
  * `rateLimit` | `singleton` | `delayed` | `transaction` | `unacknowledged`.
8422
8346
  *
@@ -8424,179 +8348,179 @@ export declare const WorkflowRunHandleSchema: Schema.Struct<{
8424
8348
  * back. The engine may have it; recovery retries the dispatch and binds the
8425
8349
  * receipt (`id`) to whatever run results. It is not a failure: do not
8426
8350
  * report one to a user, follow the receipt. */
8427
- mode: typeof Schema.String;
8351
+ readonly mode: Schema.String;
8428
8352
  /** Epoch ms this may first be admitted. Null for a drop or a skip. */
8429
- dueAt: Schema.NullOr<typeof Schema.Number>;
8353
+ readonly dueAt: Schema.NullOr<Schema.Number>;
8430
8354
  /** How long until the rate window reopens. Null unless dropped. */
8431
- retryAfterMs: Schema.NullOr<typeof Schema.Number>;
8355
+ readonly retryAfterMs: Schema.NullOr<Schema.Number>;
8432
8356
  /** The `_voltro_workflow_pending` row holding this start. Null unless queued. */
8433
- intentId: Schema.NullOr<typeof Schema.String>;
8357
+ readonly intentId: Schema.NullOr<Schema.String>;
8434
8358
  }>>;
8435
8359
  }>;
8436
8360
 
8437
8361
  export declare const workflowRunQueryDescriptor: QueryProcedureDescriptor<"__voltro.workflow.run", Schema.Struct<{
8438
8362
  /** `_voltro_workflow_runs.id` OR durable `executionId`. */
8439
- id: typeof Schema.String;
8440
- }>, Schema.Array$<Schema.Struct<{
8441
- id: typeof Schema.String;
8442
- tag: typeof Schema.String;
8443
- executionId: typeof Schema.String;
8444
- status: Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>;
8445
- payload: typeof Schema.Unknown;
8446
- workflowVersion: Schema.NullOr<typeof Schema.String>;
8447
- workflowPatches: Schema.NullOr<typeof Schema.Unknown>;
8448
- output: Schema.NullOr<typeof Schema.Unknown>;
8449
- subject: Schema.NullOr<typeof Schema.Unknown>;
8450
- source: Schema.NullOr<typeof Schema.String>;
8451
- errorTag: Schema.NullOr<typeof Schema.String>;
8452
- errorMessage: Schema.NullOr<typeof Schema.String>;
8453
- cancelled: typeof Schema.Boolean;
8454
- startedAt: typeof Schema.Date;
8455
- completedAt: Schema.NullOr<typeof Schema.Date>;
8456
- durationMs: Schema.NullOr<typeof Schema.Number>;
8457
- traceId: Schema.NullOr<typeof Schema.String>;
8458
- parentExecutionId: Schema.NullOr<typeof Schema.String>;
8459
- parentClosePolicy: Schema.NullOr<Schema.Literal<["cancel", "terminate", "abandon"]>>;
8460
- }>>, typeof Schema.Never>;
8363
+ readonly id: Schema.String;
8364
+ }>, Schema.$Array<Schema.Struct<{
8365
+ readonly id: Schema.String;
8366
+ readonly tag: Schema.String;
8367
+ readonly executionId: Schema.String;
8368
+ readonly status: Schema.Literals<readonly ["running", "succeeded", "failed", "cancelled", "suspended"]>;
8369
+ readonly payload: Schema.Unknown;
8370
+ readonly workflowVersion: Schema.NullOr<Schema.String>;
8371
+ readonly workflowPatches: Schema.NullOr<Schema.Unknown>;
8372
+ readonly output: Schema.NullOr<Schema.Unknown>;
8373
+ readonly subject: Schema.NullOr<Schema.Unknown>;
8374
+ readonly source: Schema.NullOr<Schema.String>;
8375
+ readonly errorTag: Schema.NullOr<Schema.String>;
8376
+ readonly errorMessage: Schema.NullOr<Schema.String>;
8377
+ readonly cancelled: Schema.Boolean;
8378
+ readonly startedAt: Schema.DateFromString;
8379
+ readonly completedAt: Schema.NullOr<Schema.DateFromString>;
8380
+ readonly durationMs: Schema.NullOr<Schema.Number>;
8381
+ readonly traceId: Schema.NullOr<Schema.String>;
8382
+ readonly parentExecutionId: Schema.NullOr<Schema.String>;
8383
+ readonly parentClosePolicy: Schema.NullOr<Schema.Literals<readonly ["cancel", "terminate", "abandon"]>>;
8384
+ }>>, Schema.Never>;
8461
8385
 
8462
8386
  export declare const WorkflowRunRefSchema: Schema.Struct<{
8463
8387
  /** `_voltro_workflow_runs.id` OR durable `executionId`. */
8464
- id: typeof Schema.String;
8388
+ readonly id: Schema.String;
8465
8389
  }>;
8466
8390
 
8467
8391
  export declare type WorkflowRunRow = Schema.Schema.Type<typeof WorkflowRunRowSchema>;
8468
8392
 
8469
8393
  export declare const WorkflowRunRowSchema: Schema.Struct<{
8470
- id: typeof Schema.String;
8471
- tag: typeof Schema.String;
8472
- executionId: typeof Schema.String;
8473
- status: Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>;
8474
- payload: typeof Schema.Unknown;
8475
- workflowVersion: Schema.NullOr<typeof Schema.String>;
8476
- workflowPatches: Schema.NullOr<typeof Schema.Unknown>;
8477
- output: Schema.NullOr<typeof Schema.Unknown>;
8478
- subject: Schema.NullOr<typeof Schema.Unknown>;
8479
- source: Schema.NullOr<typeof Schema.String>;
8480
- errorTag: Schema.NullOr<typeof Schema.String>;
8481
- errorMessage: Schema.NullOr<typeof Schema.String>;
8482
- cancelled: typeof Schema.Boolean;
8483
- startedAt: typeof Schema.Date;
8484
- completedAt: Schema.NullOr<typeof Schema.Date>;
8485
- durationMs: Schema.NullOr<typeof Schema.Number>;
8486
- traceId: Schema.NullOr<typeof Schema.String>;
8487
- parentExecutionId: Schema.NullOr<typeof Schema.String>;
8488
- parentClosePolicy: Schema.NullOr<Schema.Literal<["cancel", "terminate", "abandon"]>>;
8394
+ readonly id: Schema.String;
8395
+ readonly tag: Schema.String;
8396
+ readonly executionId: Schema.String;
8397
+ readonly status: Schema.Literals<readonly ["running", "succeeded", "failed", "cancelled", "suspended"]>;
8398
+ readonly payload: Schema.Unknown;
8399
+ readonly workflowVersion: Schema.NullOr<Schema.String>;
8400
+ readonly workflowPatches: Schema.NullOr<Schema.Unknown>;
8401
+ readonly output: Schema.NullOr<Schema.Unknown>;
8402
+ readonly subject: Schema.NullOr<Schema.Unknown>;
8403
+ readonly source: Schema.NullOr<Schema.String>;
8404
+ readonly errorTag: Schema.NullOr<Schema.String>;
8405
+ readonly errorMessage: Schema.NullOr<Schema.String>;
8406
+ readonly cancelled: Schema.Boolean;
8407
+ readonly startedAt: Schema.DateFromString;
8408
+ readonly completedAt: Schema.NullOr<Schema.DateFromString>;
8409
+ readonly durationMs: Schema.NullOr<Schema.Number>;
8410
+ readonly traceId: Schema.NullOr<Schema.String>;
8411
+ readonly parentExecutionId: Schema.NullOr<Schema.String>;
8412
+ readonly parentClosePolicy: Schema.NullOr<Schema.Literals<readonly ["cancel", "terminate", "abandon"]>>;
8489
8413
  }>;
8490
8414
 
8491
8415
  export declare type WorkflowRunsInput = Schema.Schema.Type<typeof WorkflowRunsInputSchema>;
8492
8416
 
8493
8417
  export declare const WorkflowRunsInputSchema: Schema.Struct<{
8494
- tag: Schema.optional<typeof Schema.String>;
8495
- status: Schema.optional<Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>>;
8496
- limit: Schema.optional<typeof Schema.Number>;
8418
+ readonly tag: Schema.optional<Schema.String>;
8419
+ readonly status: Schema.optional<Schema.Literals<readonly ["running", "succeeded", "failed", "cancelled", "suspended"]>>;
8420
+ readonly limit: Schema.optional<Schema.Number>;
8497
8421
  }>;
8498
8422
 
8499
8423
  export declare type WorkflowRunSnapshot = Schema.Schema.Type<typeof WorkflowRunSnapshotSchema>;
8500
8424
 
8501
8425
  /** Observed execution state, distinct from admission/start handles. */
8502
8426
  export declare const WorkflowRunSnapshotSchema: Schema.Struct<{
8503
- id: typeof Schema.String;
8504
- workflowName: typeof Schema.String;
8505
- executionId: typeof Schema.String;
8506
- status: Schema.Union<[Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>, Schema.Literal<["unknown"]>]>;
8507
- output: Schema.optional<typeof Schema.Unknown>;
8508
- error: Schema.optional<Schema.Struct<{
8509
- tag: Schema.NullOr<typeof Schema.String>;
8510
- message: typeof Schema.String;
8427
+ readonly id: Schema.String;
8428
+ readonly workflowName: Schema.String;
8429
+ readonly executionId: Schema.String;
8430
+ readonly status: Schema.Union<readonly [Schema.Literals<readonly ["running", "succeeded", "failed", "cancelled", "suspended"]>, Schema.Literal<"unknown">]>;
8431
+ readonly output: Schema.optional<Schema.Unknown>;
8432
+ readonly error: Schema.optional<Schema.Struct<{
8433
+ readonly tag: Schema.NullOr<Schema.String>;
8434
+ readonly message: Schema.String;
8511
8435
  }>>;
8512
8436
  }>;
8513
8437
 
8514
8438
  export declare const workflowRunsQueryDescriptor: QueryProcedureDescriptor<"__voltro.workflow.runs", Schema.Struct<{
8515
- tag: Schema.optional<typeof Schema.String>;
8516
- status: Schema.optional<Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>>;
8517
- limit: Schema.optional<typeof Schema.Number>;
8518
- }>, Schema.Array$<Schema.Struct<{
8519
- id: typeof Schema.String;
8520
- tag: typeof Schema.String;
8521
- executionId: typeof Schema.String;
8522
- status: Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>;
8523
- payload: typeof Schema.Unknown;
8524
- workflowVersion: Schema.NullOr<typeof Schema.String>;
8525
- workflowPatches: Schema.NullOr<typeof Schema.Unknown>;
8526
- output: Schema.NullOr<typeof Schema.Unknown>;
8527
- subject: Schema.NullOr<typeof Schema.Unknown>;
8528
- source: Schema.NullOr<typeof Schema.String>;
8529
- errorTag: Schema.NullOr<typeof Schema.String>;
8530
- errorMessage: Schema.NullOr<typeof Schema.String>;
8531
- cancelled: typeof Schema.Boolean;
8532
- startedAt: typeof Schema.Date;
8533
- completedAt: Schema.NullOr<typeof Schema.Date>;
8534
- durationMs: Schema.NullOr<typeof Schema.Number>;
8535
- traceId: Schema.NullOr<typeof Schema.String>;
8536
- parentExecutionId: Schema.NullOr<typeof Schema.String>;
8537
- parentClosePolicy: Schema.NullOr<Schema.Literal<["cancel", "terminate", "abandon"]>>;
8538
- }>>, typeof Schema.Never>;
8439
+ readonly tag: Schema.optional<Schema.String>;
8440
+ readonly status: Schema.optional<Schema.Literals<readonly ["running", "succeeded", "failed", "cancelled", "suspended"]>>;
8441
+ readonly limit: Schema.optional<Schema.Number>;
8442
+ }>, Schema.$Array<Schema.Struct<{
8443
+ readonly id: Schema.String;
8444
+ readonly tag: Schema.String;
8445
+ readonly executionId: Schema.String;
8446
+ readonly status: Schema.Literals<readonly ["running", "succeeded", "failed", "cancelled", "suspended"]>;
8447
+ readonly payload: Schema.Unknown;
8448
+ readonly workflowVersion: Schema.NullOr<Schema.String>;
8449
+ readonly workflowPatches: Schema.NullOr<Schema.Unknown>;
8450
+ readonly output: Schema.NullOr<Schema.Unknown>;
8451
+ readonly subject: Schema.NullOr<Schema.Unknown>;
8452
+ readonly source: Schema.NullOr<Schema.String>;
8453
+ readonly errorTag: Schema.NullOr<Schema.String>;
8454
+ readonly errorMessage: Schema.NullOr<Schema.String>;
8455
+ readonly cancelled: Schema.Boolean;
8456
+ readonly startedAt: Schema.DateFromString;
8457
+ readonly completedAt: Schema.NullOr<Schema.DateFromString>;
8458
+ readonly durationMs: Schema.NullOr<Schema.Number>;
8459
+ readonly traceId: Schema.NullOr<Schema.String>;
8460
+ readonly parentExecutionId: Schema.NullOr<Schema.String>;
8461
+ readonly parentClosePolicy: Schema.NullOr<Schema.Literals<readonly ["cancel", "terminate", "abandon"]>>;
8462
+ }>>, Schema.Never>;
8539
8463
 
8540
8464
  export declare type WorkflowRunStatus = Schema.Schema.Type<typeof WorkflowRunStatusSchema>;
8541
8465
 
8542
- export declare const WorkflowRunStatusSchema: Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>;
8466
+ export declare const WorkflowRunStatusSchema: Schema.Literals<readonly ["running", "succeeded", "failed", "cancelled", "suspended"]>;
8543
8467
 
8544
8468
  export declare type WorkflowRunStepRow = Schema.Schema.Type<typeof WorkflowRunStepRowSchema>;
8545
8469
 
8546
8470
  export declare const WorkflowRunStepRowSchema: Schema.Struct<{
8547
- id: typeof Schema.String;
8548
- runId: typeof Schema.String;
8549
- stepName: typeof Schema.String;
8550
- attempt: typeof Schema.Number;
8551
- status: Schema.Literal<["running", "succeeded", "failed"]>;
8552
- input: Schema.NullOr<typeof Schema.Unknown>;
8553
- retryPolicy: Schema.NullOr<typeof Schema.Unknown>;
8554
- output: Schema.NullOr<typeof Schema.Unknown>;
8555
- errorTag: Schema.NullOr<typeof Schema.String>;
8556
- errorMessage: Schema.NullOr<typeof Schema.String>;
8557
- errorCause: Schema.NullOr<typeof Schema.Unknown>;
8558
- startedAt: typeof Schema.Date;
8559
- completedAt: Schema.NullOr<typeof Schema.Date>;
8560
- durationMs: Schema.NullOr<typeof Schema.Number>;
8471
+ readonly id: Schema.String;
8472
+ readonly runId: Schema.String;
8473
+ readonly stepName: Schema.String;
8474
+ readonly attempt: Schema.Number;
8475
+ readonly status: Schema.Literals<readonly ["running", "succeeded", "failed"]>;
8476
+ readonly input: Schema.NullOr<Schema.Unknown>;
8477
+ readonly retryPolicy: Schema.NullOr<Schema.Unknown>;
8478
+ readonly output: Schema.NullOr<Schema.Unknown>;
8479
+ readonly errorTag: Schema.NullOr<Schema.String>;
8480
+ readonly errorMessage: Schema.NullOr<Schema.String>;
8481
+ readonly errorCause: Schema.NullOr<Schema.Unknown>;
8482
+ readonly startedAt: Schema.DateFromString;
8483
+ readonly completedAt: Schema.NullOr<Schema.DateFromString>;
8484
+ readonly durationMs: Schema.NullOr<Schema.Number>;
8561
8485
  }>;
8562
8486
 
8563
8487
  export declare const workflowRunStepsQueryDescriptor: QueryProcedureDescriptor<"__voltro.workflow.run.steps", Schema.Struct<{
8564
8488
  /** `_voltro_workflow_runs.id`; step/event rows reference this id. */
8565
- runId: typeof Schema.String;
8566
- }>, Schema.Array$<Schema.Struct<{
8567
- id: typeof Schema.String;
8568
- runId: typeof Schema.String;
8569
- stepName: typeof Schema.String;
8570
- attempt: typeof Schema.Number;
8571
- status: Schema.Literal<["running", "succeeded", "failed"]>;
8572
- input: Schema.NullOr<typeof Schema.Unknown>;
8573
- retryPolicy: Schema.NullOr<typeof Schema.Unknown>;
8574
- output: Schema.NullOr<typeof Schema.Unknown>;
8575
- errorTag: Schema.NullOr<typeof Schema.String>;
8576
- errorMessage: Schema.NullOr<typeof Schema.String>;
8577
- errorCause: Schema.NullOr<typeof Schema.Unknown>;
8578
- startedAt: typeof Schema.Date;
8579
- completedAt: Schema.NullOr<typeof Schema.Date>;
8580
- durationMs: Schema.NullOr<typeof Schema.Number>;
8581
- }>>, typeof Schema.Never>;
8489
+ readonly runId: Schema.String;
8490
+ }>, Schema.$Array<Schema.Struct<{
8491
+ readonly id: Schema.String;
8492
+ readonly runId: Schema.String;
8493
+ readonly stepName: Schema.String;
8494
+ readonly attempt: Schema.Number;
8495
+ readonly status: Schema.Literals<readonly ["running", "succeeded", "failed"]>;
8496
+ readonly input: Schema.NullOr<Schema.Unknown>;
8497
+ readonly retryPolicy: Schema.NullOr<Schema.Unknown>;
8498
+ readonly output: Schema.NullOr<Schema.Unknown>;
8499
+ readonly errorTag: Schema.NullOr<Schema.String>;
8500
+ readonly errorMessage: Schema.NullOr<Schema.String>;
8501
+ readonly errorCause: Schema.NullOr<Schema.Unknown>;
8502
+ readonly startedAt: Schema.DateFromString;
8503
+ readonly completedAt: Schema.NullOr<Schema.DateFromString>;
8504
+ readonly durationMs: Schema.NullOr<Schema.Number>;
8505
+ }>>, Schema.Never>;
8582
8506
 
8583
8507
  export declare const WorkflowRunTableRefSchema: Schema.Struct<{
8584
8508
  /** `_voltro_workflow_runs.id`; step/event rows reference this id. */
8585
- runId: typeof Schema.String;
8509
+ readonly runId: Schema.String;
8586
8510
  }>;
8587
8511
 
8588
8512
  export declare const workflowSignalDescriptor: ActionProcedureDescriptor<"__voltro.workflow.signal", Schema.Struct<{
8589
- id: typeof Schema.String;
8590
- signalName: typeof Schema.String;
8591
- payload: Schema.optional<typeof Schema.Unknown>;
8513
+ readonly id: Schema.String;
8514
+ readonly signalName: Schema.String;
8515
+ readonly payload: Schema.optional<Schema.Unknown>;
8592
8516
  }>, Schema.Struct<{
8593
- eventId: typeof Schema.String;
8594
- }>, typeof Schema.Never>;
8517
+ readonly eventId: Schema.String;
8518
+ }>, Schema.Never>;
8595
8519
 
8596
8520
  export declare const WorkflowSignalInputSchema: Schema.Struct<{
8597
- id: typeof Schema.String;
8598
- signalName: typeof Schema.String;
8599
- payload: Schema.optional<typeof Schema.Unknown>;
8521
+ readonly id: Schema.String;
8522
+ readonly signalName: Schema.String;
8523
+ readonly payload: Schema.optional<Schema.Unknown>;
8600
8524
  }>;
8601
8525
 
8602
8526
  export declare type WorkflowStartDeferral = Schema.Schema.Type<typeof WorkflowStartDeferralSchema>;
@@ -8617,38 +8541,38 @@ export declare const WorkflowStartDeferralSchema: Schema.Struct<{
8617
8541
  * back. The engine may have it; recovery retries the dispatch and binds the
8618
8542
  * receipt (`id`) to whatever run results. It is not a failure: do not
8619
8543
  * report one to a user, follow the receipt. */
8620
- mode: typeof Schema.String;
8544
+ readonly mode: Schema.String;
8621
8545
  /** Epoch ms this may first be admitted. Null for a drop or a skip. */
8622
- dueAt: Schema.NullOr<typeof Schema.Number>;
8546
+ readonly dueAt: Schema.NullOr<Schema.Number>;
8623
8547
  /** How long until the rate window reopens. Null unless dropped. */
8624
- retryAfterMs: Schema.NullOr<typeof Schema.Number>;
8548
+ readonly retryAfterMs: Schema.NullOr<Schema.Number>;
8625
8549
  /** The `_voltro_workflow_pending` row holding this start. Null unless queued. */
8626
- intentId: Schema.NullOr<typeof Schema.String>;
8550
+ readonly intentId: Schema.NullOr<Schema.String>;
8627
8551
  }>;
8628
8552
 
8629
8553
  export declare type WorkflowStartTerminalOutcome = typeof WorkflowStartTerminalOutcomeSchema.Type;
8630
8554
 
8631
8555
  /** A settled admission outcome is not a terminal execution snapshot. In the
8632
8556
  * skipped case the identities belong to the incumbent, not to a new run. */
8633
- export declare const WorkflowStartTerminalOutcomeSchema: Schema.Union<[Schema.Struct<{
8634
- kind: Schema.Literal<["dropped"]>;
8635
- at: typeof Schema.Number;
8636
- retryAfterMs: typeof Schema.Number;
8557
+ export declare const WorkflowStartTerminalOutcomeSchema: Schema.Union<readonly [Schema.Struct<{
8558
+ readonly kind: Schema.Literal<"dropped">;
8559
+ readonly at: Schema.Number;
8560
+ readonly retryAfterMs: Schema.Number;
8637
8561
  }>, Schema.Struct<{
8638
- kind: Schema.Literal<["skipped"]>;
8639
- at: typeof Schema.Number;
8640
- executionId: typeof Schema.String;
8641
- runId: typeof Schema.String;
8562
+ readonly kind: Schema.Literal<"skipped">;
8563
+ readonly at: Schema.Number;
8564
+ readonly executionId: Schema.String;
8565
+ readonly runId: Schema.String;
8642
8566
  }>, Schema.Struct<{
8643
- kind: Schema.Literal<["superseded"]>;
8644
- at: typeof Schema.Number;
8567
+ readonly kind: Schema.Literal<"superseded">;
8568
+ readonly at: Schema.Number;
8645
8569
  }>, Schema.Struct<{
8646
- kind: Schema.Literal<["cancelled"]>;
8647
- at: typeof Schema.Number;
8570
+ readonly kind: Schema.Literal<"cancelled">;
8571
+ readonly at: Schema.Number;
8648
8572
  }>, Schema.Struct<{
8649
- kind: Schema.Literal<["abandoned"]>;
8650
- at: typeof Schema.Number;
8651
- failureId: typeof Schema.NonEmptyString;
8573
+ readonly kind: Schema.Literal<"abandoned">;
8574
+ readonly at: Schema.Number;
8575
+ readonly failureId: Schema.NonEmptyString;
8652
8576
  }>]>;
8653
8577
 
8654
8578
  /**
@@ -8662,7 +8586,7 @@ export declare const WorkflowStartTerminalOutcomeSchema: Schema.Union<[Schema.St
8662
8586
  * step-level retry-policy override, step-level resource scoping,
8663
8587
  * external observability injection.
8664
8588
  *
8665
- * The interceptor runs INSIDE `@effect/workflow`'s replay logic —
8589
+ * The interceptor runs INSIDE `effect/workflow`'s replay logic —
8666
8590
  * on a workflow resume, the framework replays cached Activity
8667
8591
  * outputs without re-running the user effect, and the interceptor
8668
8592
  * is bypassed on replay (only fires on the first execution).
@@ -8692,16 +8616,16 @@ export declare type WorkflowStepInterceptor = <Success, ErrorE, R>(next: Effect.
8692
8616
  * error union with `ScopeError` / `Unauthenticated`, exactly as it does for a
8693
8617
  * mutation, and labels the strict-input refusal as a guarded procedure's.
8694
8618
  */
8695
- export declare const workflowToRpc: <const Name extends string, Payload extends Schema.Schema.Any>(workflow: {
8619
+ export declare const workflowToRpc: <const Name extends string, Payload extends Schema.Top>(workflow: {
8696
8620
  readonly name: Name;
8697
8621
  readonly payloadSchema: Payload;
8698
- readonly errorSchema: Schema.Schema.All;
8622
+ readonly errorSchema: Schema.Top;
8699
8623
  }, extraErrors?: ExtraErrors) => Rpc.Rpc<Name, Payload extends Schema.Struct.Fields ? Schema.Struct<Payload> : Payload, Schema.Struct<{
8700
8624
  /** Stable handle callers pass to `useWorkflowRun(...)`. The durable execution
8701
8625
  * id for a started run; the durable caller-receipt id for a queued one. */
8702
- id: typeof Schema.String;
8626
+ readonly id: Schema.String;
8703
8627
  /** Workflow tag, e.g. `notes.summarise`. */
8704
- workflowName: typeof Schema.String;
8628
+ readonly workflowName: Schema.String;
8705
8629
  /**
8706
8630
  * Deterministic durable id derived from workflow name + idempotency key.
8707
8631
  *
@@ -8715,7 +8639,7 @@ export declare const workflowToRpc: <const Name extends string, Payload extends
8715
8639
  * For a `skipped` singleton it is the INCUMBENT's execution id — a real,
8716
8640
  * pollable run, which is the entire point of `mode: 'skip'`.
8717
8641
  */
8718
- executionId: Schema.NullOr<typeof Schema.String>;
8642
+ readonly executionId: Schema.NullOr<Schema.String>;
8719
8643
  /**
8720
8644
  * `running` — the engine has it; starting is fire-and-return.
8721
8645
  * `succeeded` — a blocking start observed successful completion.
@@ -8731,8 +8655,8 @@ export declare const workflowToRpc: <const Name extends string, Payload extends
8731
8655
  * a fresh start; a schedule keyed per day ran once and reported forty-seven
8732
8656
  * "starts" that were replays. See `workflow()`'s `idempotencyKey` doc.
8733
8657
  */
8734
- status: Schema.Literal<["running", "succeeded", "queued", "dropped", "skipped", "replayed"]>;
8735
- deferral: Schema.optional<Schema.Struct<{
8658
+ readonly status: Schema.Literals<readonly ["running", "succeeded", "queued", "dropped", "skipped", "replayed"]>;
8659
+ readonly deferral: Schema.optional<Schema.Struct<{
8736
8660
  /** `debounce` | `batch` | `throttle` | `concurrency` | `paused` |
8737
8661
  * `rateLimit` | `singleton` | `delayed` | `transaction` | `unacknowledged`.
8738
8662
  *
@@ -8740,42 +8664,42 @@ export declare const workflowToRpc: <const Name extends string, Payload extends
8740
8664
  * back. The engine may have it; recovery retries the dispatch and binds the
8741
8665
  * receipt (`id`) to whatever run results. It is not a failure: do not
8742
8666
  * report one to a user, follow the receipt. */
8743
- mode: typeof Schema.String;
8667
+ readonly mode: Schema.String;
8744
8668
  /** Epoch ms this may first be admitted. Null for a drop or a skip. */
8745
- dueAt: Schema.NullOr<typeof Schema.Number>;
8669
+ readonly dueAt: Schema.NullOr<Schema.Number>;
8746
8670
  /** How long until the rate window reopens. Null unless dropped. */
8747
- retryAfterMs: Schema.NullOr<typeof Schema.Number>;
8671
+ readonly retryAfterMs: Schema.NullOr<Schema.Number>;
8748
8672
  /** The `_voltro_workflow_pending` row holding this start. Null unless queued. */
8749
- intentId: Schema.NullOr<typeof Schema.String>;
8673
+ readonly intentId: Schema.NullOr<Schema.String>;
8750
8674
  }>>;
8751
- }>, Schema.Schema.All, never>;
8675
+ }>, Schema.Top, never, never>;
8752
8676
 
8753
8677
  export declare const workflowUpdateDescriptor: ActionProcedureDescriptor<"__voltro.workflow.update", Schema.Struct<{
8754
- id: typeof Schema.String;
8755
- updateName: typeof Schema.String;
8756
- payload: Schema.optional<typeof Schema.Unknown>;
8757
- timeoutMs: Schema.optional<typeof Schema.Number>;
8678
+ readonly id: Schema.String;
8679
+ readonly updateName: Schema.String;
8680
+ readonly payload: Schema.optional<Schema.Unknown>;
8681
+ readonly timeoutMs: Schema.optional<Schema.Number>;
8758
8682
  }>, Schema.Struct<{
8759
- eventId: typeof Schema.String;
8760
- updateId: typeof Schema.String;
8761
- completedEventId: typeof Schema.String;
8762
- result: typeof Schema.Unknown;
8763
- }>, typeof Schema.Never>;
8683
+ readonly eventId: Schema.String;
8684
+ readonly updateId: Schema.String;
8685
+ readonly completedEventId: Schema.String;
8686
+ readonly result: Schema.Unknown;
8687
+ }>, Schema.Never>;
8764
8688
 
8765
8689
  export declare const WorkflowUpdateInputSchema: Schema.Struct<{
8766
- id: typeof Schema.String;
8767
- updateName: typeof Schema.String;
8768
- payload: Schema.optional<typeof Schema.Unknown>;
8769
- timeoutMs: Schema.optional<typeof Schema.Number>;
8690
+ readonly id: Schema.String;
8691
+ readonly updateName: Schema.String;
8692
+ readonly payload: Schema.optional<Schema.Unknown>;
8693
+ readonly timeoutMs: Schema.optional<Schema.Number>;
8770
8694
  }>;
8771
8695
 
8772
8696
  export declare type WorkflowUpdateResult = Schema.Schema.Type<typeof WorkflowUpdateResultSchema>;
8773
8697
 
8774
8698
  export declare const WorkflowUpdateResultSchema: Schema.Struct<{
8775
- eventId: typeof Schema.String;
8776
- updateId: typeof Schema.String;
8777
- completedEventId: typeof Schema.String;
8778
- result: typeof Schema.Unknown;
8699
+ readonly eventId: Schema.String;
8700
+ readonly updateId: Schema.String;
8701
+ readonly completedEventId: Schema.String;
8702
+ readonly result: Schema.Unknown;
8779
8703
  }>;
8780
8704
 
8781
8705
  /**
@@ -8789,9 +8713,9 @@ export declare const WorkflowUpdateResultSchema: Schema.Struct<{
8789
8713
  * `ExitEncoded` defect tree a mutation used to ship for the same reason.
8790
8714
  */
8791
8715
  export declare const workflowWireErrorUnion: (workflow: {
8792
- readonly errorSchema: Schema.Schema.All;
8716
+ readonly errorSchema: Schema.Top;
8793
8717
  readonly guards?: DeclaredAccess | undefined;
8794
- }, extraErrors?: ExtraErrors) => Schema.Schema.All;
8718
+ }, extraErrors?: ExtraErrors) => Schema.Top;
8795
8719
 
8796
8720
  /**
8797
8721
  * Scope for a WS-rpc MUTATION. Unlike the REST scope (tenant + method + path),