@voltro/protocol 0.83.1 → 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
 
@@ -4266,6 +4273,9 @@ export declare interface PluginPrivacyDeclaration {
4266
4273
  * loosely so the plugin doesn't need to depend on `@voltro/runtime`.
4267
4274
  */
4268
4275
  export declare interface PluginRouteContext {
4276
+ /** Request-scoped transaction for mutation routes. Reuse it instead of opening
4277
+ * a transaction on the plugin's bound root store. Absent on direct calls. */
4278
+ readonly mutationStore?: DataStore;
4269
4279
  readonly request: {
4270
4280
  readonly subject: Subject;
4271
4281
  readonly traceId: string;
@@ -4326,11 +4336,11 @@ export declare interface PluginRpcRoute {
4326
4336
  /** Optional human-readable description; surfaced in the dashboard. */
4327
4337
  readonly description?: string;
4328
4338
  /** Input schema — same `effect/Schema` shape user routes use. */
4329
- readonly input: Schema.Schema.Any;
4339
+ readonly input: Schema.Top;
4330
4340
  /** Output schema. */
4331
- readonly output: Schema.Schema.Any;
4341
+ readonly output: Schema.Top;
4332
4342
  /** Optional typed-error schema (TaggedError union). */
4333
- readonly error?: Schema.Schema.All;
4343
+ readonly error?: Schema.Top;
4334
4344
  /**
4335
4345
  * REACTIVE source table(s) — ONLY for `kind: 'query'`. When set, the
4336
4346
  * framework drives the query REACTIVELY: it re-runs the executor and pushes
@@ -4611,7 +4621,7 @@ export declare const problemDetails: (error: RestFormatError) => Record<string,
4611
4621
  /** A stable, non-resolving URI for an error type: the tag as a URN. */
4612
4622
  export declare const problemTypeOf: (tag: string) => string;
4613
4623
 
4614
- 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>;
4615
4625
 
4616
4626
  /** The shape of one procedure, as the pair of peers must agree on it. */
4617
4627
  export declare interface ProcedureLike {
@@ -4636,10 +4646,10 @@ export declare const procedureShapeDigest: (rpc: ProcedureLike) => string;
4636
4646
  */
4637
4647
  export declare type ProcedureWireError<D extends {
4638
4648
  readonly kind: WireProcedureKind;
4639
- readonly error: Schema.Schema.All;
4649
+ readonly error: Schema.Top;
4640
4650
  }> = Schema.Schema.Type<D['error']> | FrameworkWireError<D['kind']> | RegisteredPluginError;
4641
4651
 
4642
- export declare const PROTOCOL_VERSION: 1;
4652
+ export declare const PROTOCOL_VERSION: 2;
4643
4653
 
4644
4654
  export declare type ProtocolVersion = typeof PROTOCOL_VERSION;
4645
4655
 
@@ -4853,7 +4863,7 @@ export declare interface QueryCacheConfig {
4853
4863
  readonly scope: 'subject' | 'tenant' | 'global';
4854
4864
  }
4855
4865
 
4856
- 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> {
4857
4867
  readonly kind: 'query';
4858
4868
  readonly name: Name;
4859
4869
  readonly input: Input;
@@ -4909,56 +4919,40 @@ export declare interface QueryProcedureDescriptor<Name extends string, Input ext
4909
4919
  readonly internal: boolean | undefined;
4910
4920
  }
4911
4921
 
4912
- 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<{
4913
- _tag: Schema.Literal<["snapshot"]>;
4914
- revision: typeof Schema.Number;
4915
- data: Output;
4916
- computed: Schema.optional<typeof Schema.Boolean>;
4917
- 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>;
4918
4928
  }>, Schema.Struct<{
4919
- _tag: Schema.Literal<["delta"]>;
4920
- revision: typeof Schema.Number;
4921
- emittedAt: typeof Schema.Number;
4922
- patch: Schema.Struct<{
4923
- ops: Schema.Array$<Schema.Union<[Schema.Struct<{
4924
- op: Schema.Literal<["add"]>;
4925
- path: typeof Schema.String;
4926
- value: Schema.refine<{
4927
- readonly [x: string]: unknown;
4928
- } & Readonly<Record<string, unknown>> & {
4929
- readonly id: RowId;
4930
- }, Schema.Schema<{
4931
- readonly [x: string]: unknown;
4932
- }, {
4933
- readonly [x: string]: unknown;
4934
- }, 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>>>;
4935
4937
  }>, Schema.Struct<{
4936
- op: Schema.Literal<["replace"]>;
4937
- path: typeof Schema.String;
4938
- value: Schema.refine<{
4939
- readonly [x: string]: unknown;
4940
- } & Readonly<Record<string, unknown>> & {
4941
- readonly id: RowId;
4942
- }, Schema.Schema<{
4943
- readonly [x: string]: unknown;
4944
- }, {
4945
- readonly [x: string]: unknown;
4946
- }, 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>>>;
4947
4941
  }>, Schema.Struct<{
4948
- op: Schema.Literal<["remove"]>;
4949
- path: typeof Schema.String;
4942
+ readonly op: Schema.Literal<"remove">;
4943
+ readonly path: Schema.String;
4950
4944
  }>, Schema.Struct<{
4951
- op: Schema.Literal<["mergeCells"]>;
4952
- path: typeof Schema.String;
4953
- 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>>;
4954
4948
  }>]>>;
4955
- 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]>>>;
4956
4950
  }>;
4957
4951
  }>, Schema.Struct<{
4958
- _tag: Schema.Literal<["error"]>;
4959
- error: typeof Schema.Unknown;
4960
- revision: Schema.optional<typeof Schema.Number>;
4961
- }>]>, 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>;
4962
4956
 
4963
4957
  /**
4964
4958
  * The RAW mark, unvalidated, or `null`.
@@ -5156,7 +5150,18 @@ declare interface RestByteResponse {
5156
5150
  * headers CDNs purge by. A request that carries a credential (`Authorization`
5157
5151
  * or a cookie) gets `private, no-cache` and no tags, whatever is declared:
5158
5152
  * what a key or a session may see must never land in a shared cache. Every
5159
- * 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.
5160
5165
  */
5161
5166
  declare interface RestCache {
5162
5167
  /** Seconds a cache may serve the answer without asking again. */
@@ -5166,6 +5171,12 @@ declare interface RestCache {
5166
5171
  /** Purge tags from the answer as it goes on the wire, and the input.
5167
5172
  * A tag with whitespace or a comma is dropped (no header can carry it). */
5168
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';
5169
5180
  }
5170
5181
 
5171
5182
  export declare type RestDates = 'iso' | 'epoch-ms';
@@ -5321,10 +5332,10 @@ declare interface RestRouteDescriptor<I, O> {
5321
5332
  * before decoding. Omit for routes that take no input. The schema's
5322
5333
  * decoded `Type` flows to the handler's `input`; its `Encoded` is left
5323
5334
  * open (`any`) so any `Schema.Struct(...)` is accepted. */
5324
- readonly input?: Schema.Schema<I, any, never>;
5335
+ readonly input?: Schema.Codec<I, any, never, never>;
5325
5336
  /** Output schema. The handler returns the decoded `Type`; the desugar
5326
5337
  * encodes it to JSON for the `200` response. */
5327
- readonly output: Schema.Schema<O, any, never>;
5338
+ readonly output: Schema.Codec<O, any, never, never>;
5328
5339
  readonly handler: (input: I, ctx: RestRouteContext) => Promise<RestHandlerResult<O>> | RestHandlerResult<O>;
5329
5340
  readonly summary?: string;
5330
5341
  readonly description?: string;
@@ -5408,10 +5419,10 @@ declare interface RestRouteProjection {
5408
5419
  /** `publicApi.idempotent` — the route honours `Idempotency-Key` (under the
5409
5420
  * app's idempotency binding); a client sends one per attempt. */
5410
5421
  readonly idempotent: boolean;
5411
- readonly input: Schema.Schema.All;
5422
+ readonly input: Schema.Top;
5412
5423
  /** The wire names of the input fields bound from the path. */
5413
5424
  readonly pathParams: ReadonlyArray<string>;
5414
- readonly output: Schema.Schema.All;
5425
+ readonly output: Schema.Top;
5415
5426
  /** The first `source` table, when the procedure declares one. */
5416
5427
  readonly source: string | undefined;
5417
5428
  /** Every failure the operation answers with a typed body, and its status:
@@ -5420,7 +5431,7 @@ declare interface RestRouteProjection {
5420
5431
  readonly errorResponses: ReadonlyArray<{
5421
5432
  readonly status: number;
5422
5433
  readonly tag: string;
5423
- readonly schema: Schema.Schema.All;
5434
+ readonly schema: Schema.Top;
5424
5435
  }>;
5425
5436
  readonly format: RestFormat;
5426
5437
  }
@@ -5439,25 +5450,25 @@ declare interface RestStreamResponse {
5439
5450
 
5440
5451
  /**
5441
5452
  * Rewrite a descriptor's schema into the shape the profile puts on the wire:
5442
- * `timestampMs` (`DateFromNumber`) becomes an RFC 3339 string under
5443
- * `dates: 'iso'`, and every struct's property names become `snake_case` under
5444
- * `naming: 'snake_case'` — as a transformation, so decoding a wire value yields
5445
- * the descriptor's own typed value and encoding the typed value yields the
5446
- * wire form. `JSONSchema.make` of the result documents the wire (a
5447
- * `format: date-time` string, the snake keys). Classes and other opaque
5448
- * 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.
5449
5460
  */
5450
- 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;
5451
5462
 
5452
5463
  /** The id of a row, addressed in op paths as `/<id>`. */
5453
5464
  export declare type RowId = string | number;
5454
5465
 
5455
5466
  /** The full delta payload: the per-row ops plus the authoritative id
5456
- * ordering of the resulting set. */
5467
+ * ordering when it changes. */
5457
5468
  export declare interface RowPatch {
5458
5469
  readonly ops: ReadonlyArray<RowPatchOp>;
5459
- /** Id sequence of the resulting (next) row set, in order. */
5460
- readonly order: ReadonlyArray<RowId>;
5470
+ /** null preserves the previous id sequence; an array supplies the new one. */
5471
+ readonly order: ReadonlyArray<RowId> | null;
5461
5472
  }
5462
5473
 
5463
5474
  /**
@@ -5496,73 +5507,41 @@ export declare type RowPatchOp = {
5496
5507
  readonly value: Readonly<Record<string, unknown>>;
5497
5508
  };
5498
5509
 
5499
- export declare const rowPatchOpSchema: Schema.Union<[Schema.Struct<{
5500
- op: Schema.Literal<["add"]>;
5501
- path: typeof Schema.String;
5502
- value: Schema.refine<{
5503
- readonly [x: string]: unknown;
5504
- } & Readonly<Record<string, unknown>> & {
5505
- readonly id: RowId;
5506
- }, Schema.Schema<{
5507
- readonly [x: string]: unknown;
5508
- }, {
5509
- readonly [x: string]: unknown;
5510
- }, 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>>>;
5511
5514
  }>, Schema.Struct<{
5512
- op: Schema.Literal<["replace"]>;
5513
- path: typeof Schema.String;
5514
- value: Schema.refine<{
5515
- readonly [x: string]: unknown;
5516
- } & Readonly<Record<string, unknown>> & {
5517
- readonly id: RowId;
5518
- }, Schema.Schema<{
5519
- readonly [x: string]: unknown;
5520
- }, {
5521
- readonly [x: string]: unknown;
5522
- }, 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>>>;
5523
5518
  }>, Schema.Struct<{
5524
- op: Schema.Literal<["remove"]>;
5525
- path: typeof Schema.String;
5519
+ readonly op: Schema.Literal<"remove">;
5520
+ readonly path: Schema.String;
5526
5521
  }>, Schema.Struct<{
5527
- op: Schema.Literal<["mergeCells"]>;
5528
- path: typeof Schema.String;
5529
- 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>>;
5530
5525
  }>]>;
5531
5526
 
5532
5527
  export declare const rowPatchSchema: Schema.Struct<{
5533
- ops: Schema.Array$<Schema.Union<[Schema.Struct<{
5534
- op: Schema.Literal<["add"]>;
5535
- path: typeof Schema.String;
5536
- value: Schema.refine<{
5537
- readonly [x: string]: unknown;
5538
- } & Readonly<Record<string, unknown>> & {
5539
- readonly id: RowId;
5540
- }, Schema.Schema<{
5541
- readonly [x: string]: unknown;
5542
- }, {
5543
- readonly [x: string]: unknown;
5544
- }, 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>>>;
5545
5532
  }>, Schema.Struct<{
5546
- op: Schema.Literal<["replace"]>;
5547
- path: typeof Schema.String;
5548
- value: Schema.refine<{
5549
- readonly [x: string]: unknown;
5550
- } & Readonly<Record<string, unknown>> & {
5551
- readonly id: RowId;
5552
- }, Schema.Schema<{
5553
- readonly [x: string]: unknown;
5554
- }, {
5555
- readonly [x: string]: unknown;
5556
- }, 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>>>;
5557
5536
  }>, Schema.Struct<{
5558
- op: Schema.Literal<["remove"]>;
5559
- path: typeof Schema.String;
5537
+ readonly op: Schema.Literal<"remove">;
5538
+ readonly path: Schema.String;
5560
5539
  }>, Schema.Struct<{
5561
- op: Schema.Literal<["mergeCells"]>;
5562
- path: typeof Schema.String;
5563
- 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>>;
5564
5543
  }>]>>;
5565
- 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]>>>;
5566
5545
  }>;
5567
5546
 
5568
5547
  /**
@@ -5785,12 +5764,10 @@ export declare type ScopeDecision =
5785
5764
  export declare class ScopeError extends ScopeError_base {
5786
5765
  }
5787
5766
 
5788
- declare const ScopeError_base: Schema.TaggedErrorClass<ScopeError, "ScopeError", {
5789
- readonly _tag: Schema.tag<"ScopeError">;
5790
- } & {
5791
- required: typeof Schema.String;
5792
- message: typeof Schema.String;
5793
- }>;
5767
+ declare const ScopeError_base: Schema.Class<ScopeError, Schema.TaggedStruct<"ScopeError", {
5768
+ readonly required: Schema.String;
5769
+ readonly message: Schema.String;
5770
+ }>, YieldableError>;
5794
5771
 
5795
5772
  /** What `resolveScopes` may return. A bare array is the shorthand for
5796
5773
  * `{ kind: 'grant', scopes }` — the common case, and the reading an existing
@@ -5860,14 +5837,12 @@ export declare type ServerErrorSource = 'rest' | 'aggregate' | 'subscriber' | 'r
5860
5837
  export declare class ServerOnlyColumnWrite extends ServerOnlyColumnWrite_base {
5861
5838
  }
5862
5839
 
5863
- declare const ServerOnlyColumnWrite_base: Schema.TaggedErrorClass<ServerOnlyColumnWrite, "ServerOnlyColumnWrite", {
5864
- readonly _tag: Schema.tag<"ServerOnlyColumnWrite">;
5865
- } & {
5840
+ declare const ServerOnlyColumnWrite_base: Schema.Class<ServerOnlyColumnWrite, Schema.TaggedStruct<"ServerOnlyColumnWrite", {
5866
5841
  /** The table the write targeted. */
5867
- table: typeof Schema.String;
5842
+ readonly table: Schema.String;
5868
5843
  /** The `.serverOnly()` columns the input tried to set. */
5869
- columns: Schema.Array$<typeof Schema.String>;
5870
- }>;
5844
+ readonly columns: Schema.$Array<Schema.String>;
5845
+ }>, YieldableError>;
5871
5846
 
5872
5847
  /** A service (app) name: what `serviceCallers`, `service.callers` and a service
5873
5848
  * credential all spell the same way. At most 56 characters: the caller writes
@@ -6032,6 +6007,34 @@ export declare const shapeDigest: (text: string) => string;
6032
6007
  */
6033
6008
  export declare const sourceKeys: (source: ReactivitySourceValue | ReadonlyArray<ReactivitySourceValue> | undefined) => ReadonlyArray<string>;
6034
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
+
6035
6038
  export declare const STORE_SCREENSHOT_PRESET_NAMES: [string, ...string[]];
6036
6039
 
6037
6040
  export declare const STORE_SCREENSHOT_PRESETS: ReadonlyArray<StoreScreenshotPreset>;
@@ -6064,13 +6067,11 @@ export declare class StoreOperationFailed extends StoreOperationFailed_base {
6064
6067
  get message(): string;
6065
6068
  }
6066
6069
 
6067
- declare const StoreOperationFailed_base: Schema.TaggedErrorClass<StoreOperationFailed, "StoreOperationFailed", {
6068
- readonly _tag: Schema.tag<"StoreOperationFailed">;
6069
- } & {
6070
+ declare const StoreOperationFailed_base: Schema.Class<StoreOperationFailed, Schema.TaggedStruct<"StoreOperationFailed", {
6070
6071
  /** Which DataStore op was attempted: 'query' | 'insert' | 'update' | 'delete' | 'hardDelete'. */
6071
- operation: typeof Schema.String;
6072
+ readonly operation: Schema.String;
6072
6073
  /** The table the op targeted. */
6073
- table: typeof Schema.String;
6074
+ readonly table: Schema.String;
6074
6075
  /**
6075
6076
  * A BOUNDED description of what went wrong.
6076
6077
  *
@@ -6088,8 +6089,8 @@ declare const StoreOperationFailed_base: Schema.TaggedErrorClass<StoreOperationF
6088
6089
  * socket address. `wireSafeCause` in `@voltro/database` builds it,
6089
6090
  * and the reasoning is there. The full detail is logged server-side.
6090
6091
  */
6091
- cause: typeof Schema.String;
6092
- }>;
6092
+ readonly cause: Schema.String;
6093
+ }>, YieldableError>;
6093
6094
 
6094
6095
  /** The PNG size the store receives: viewport × scale factor. */
6095
6096
  export declare const storeScreenshotPixels: (preset: StoreScreenshotPreset) => {
@@ -6154,7 +6155,7 @@ export declare type StrategyResolution = {
6154
6155
  * run's `AgentEvent`s), one-shot, no table, no snapshot. Backs A3's
6155
6156
  * agent runtime + any other server-push stream.
6156
6157
  */
6157
- 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> {
6158
6159
  readonly kind: 'stream';
6159
6160
  readonly name: Name;
6160
6161
  readonly input: Input;
@@ -6173,50 +6174,40 @@ export declare interface StreamProcedureDescriptor<Name extends string, Input ex
6173
6174
  readonly openAccess: string | undefined;
6174
6175
  }
6175
6176
 
6176
- 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>;
6177
6178
 
6178
6179
  /**
6179
- * Annotate a procedure's input schema so an undeclared field fails the decode
6180
- * instead of vanishing from it.
6181
- *
6182
- * Applies to the schema handed to `Rpc.make` — the PAYLOAD only. Not the
6183
- * success schema, and not `descriptor.input`, which the client still reads
6184
- * unannotated for schema-driven UI (`normalizeDescriptor`).
6185
- *
6186
- * Measured, because none of it follows from the annotation's name: it
6187
- * propagates into NESTED structs and through a UNION's members, and a
6188
- * non-struct payload (`Schema.Void`, a scalar) is unaffected — there is no
6189
- * 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).
6190
6183
  */
6191
- 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;
6192
6185
 
6193
- export declare const Subject: Schema.Union<[Schema.Struct<{
6194
- type: Schema.Literal<["user"]>;
6195
- id: typeof Schema.String;
6196
- tenantId: typeof Schema.String;
6197
- scopes: Schema.optional<Schema.Array$<typeof Schema.String>>;
6198
- 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>>;
6199
6192
  }>, Schema.Struct<{
6200
- type: Schema.Literal<["apiKey"]>;
6201
- id: typeof Schema.String;
6202
- tenantId: typeof Schema.String;
6203
- scopes: Schema.optional<Schema.Array$<typeof Schema.String>>;
6204
- 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>>;
6205
6198
  }>, Schema.Struct<{
6206
- type: Schema.Literal<["serviceAccount"]>;
6207
- id: typeof Schema.String;
6208
- tenantId: typeof Schema.String;
6199
+ readonly type: Schema.Literal<"serviceAccount">;
6200
+ readonly id: Schema.String;
6201
+ readonly tenantId: Schema.String;
6209
6202
  /** Application actor used for audit columns; null means machine work with
6210
6203
  * no application actor. Identity only, never a permission grant. */
6211
- auditActorId: Schema.optionalWith<Schema.NullOr<typeof Schema.String>, {
6212
- exact: true;
6213
- }>;
6214
- scopes: Schema.optional<Schema.Array$<typeof Schema.String>>;
6215
- 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>>;
6216
6207
  }>, Schema.Struct<{
6217
- type: Schema.Literal<["anonymous"]>;
6218
- id: typeof Schema.Null;
6219
- tenantId: Schema.NullOr<typeof Schema.String>;
6208
+ readonly type: Schema.Literal<"anonymous">;
6209
+ readonly id: Schema.Null;
6210
+ readonly tenantId: Schema.NullOr<Schema.String>;
6220
6211
  /**
6221
6212
  * Set when this caller PRESENTED a credential and it was rejected — an
6222
6213
  * expired token above all. Absent when they presented none.
@@ -6233,21 +6224,21 @@ export declare const Subject: Schema.Union<[Schema.Struct<{
6233
6224
  * must not break an `openAccess` procedure that needs no session at all. The
6234
6225
  * fact travels, and only a guard that actually refuses spends it.
6235
6226
  */
6236
- credentialRejected: Schema.optional<typeof Schema.String>;
6227
+ readonly credentialRejected: Schema.optional<Schema.String>;
6237
6228
  }>, Schema.Struct<{
6238
- type: Schema.Literal<["system"]>;
6239
- id: typeof Schema.String;
6240
- tenantId: typeof Schema.Null;
6241
- scopes: Schema.optional<Schema.Array$<typeof Schema.String>>;
6242
- 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>>;
6243
6234
  }>, Schema.Struct<{
6244
- type: Schema.Literal<["service"]>;
6245
- id: typeof Schema.String;
6235
+ readonly type: Schema.Literal<"service">;
6236
+ readonly id: Schema.String;
6246
6237
  /** The calling app's name, as the callee lists it in `serviceCallers`. */
6247
- service: typeof Schema.String;
6248
- tenantId: typeof Schema.Null;
6249
- scopes: Schema.optional<Schema.Array$<typeof Schema.String>>;
6250
- 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>>;
6251
6242
  }>]>;
6252
6243
 
6253
6244
  export declare type Subject = typeof Subject.Type;
@@ -6257,28 +6248,26 @@ export declare type Subject = typeof Subject.Type;
6257
6248
  * no authority and must not be inferred from user-provided metadata. */
6258
6249
  export declare const subjectAuditActorId: (subject: Subject) => string | null;
6259
6250
 
6260
- export declare const SubjectIdentity: Schema.Union<[Schema.Struct<{
6261
- type: Schema.Literal<["user"]>;
6262
- id: typeof Schema.String;
6263
- tenantId: typeof Schema.String;
6264
- 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>>;
6265
6256
  }>, Schema.Struct<{
6266
- type: Schema.Literal<["apiKey"]>;
6267
- id: typeof Schema.String;
6268
- tenantId: typeof Schema.String;
6269
- 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>>;
6270
6261
  }>, Schema.Struct<{
6271
- type: Schema.Literal<["serviceAccount"]>;
6272
- id: typeof Schema.String;
6273
- tenantId: typeof Schema.String;
6274
- metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
6275
- auditActorId: Schema.optionalWith<Schema.NullOr<typeof Schema.String>, {
6276
- exact: true;
6277
- }>;
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>>;
6278
6267
  }>, Schema.Struct<{
6279
- type: Schema.Literal<["anonymous"]>;
6280
- id: typeof Schema.Null;
6281
- tenantId: Schema.NullOr<typeof Schema.String>;
6268
+ readonly type: Schema.Literal<"anonymous">;
6269
+ readonly id: Schema.Null;
6270
+ readonly tenantId: Schema.NullOr<Schema.String>;
6282
6271
  /**
6283
6272
  * Set when this caller PRESENTED a credential and it was rejected — an
6284
6273
  * expired token above all. Absent when they presented none.
@@ -6295,18 +6284,18 @@ export declare const SubjectIdentity: Schema.Union<[Schema.Struct<{
6295
6284
  * must not break an `openAccess` procedure that needs no session at all. The
6296
6285
  * fact travels, and only a guard that actually refuses spends it.
6297
6286
  */
6298
- credentialRejected: Schema.optional<typeof Schema.String>;
6287
+ readonly credentialRejected: Schema.optional<Schema.String>;
6299
6288
  }>, Schema.Struct<{
6300
- type: Schema.Literal<["system"]>;
6301
- id: typeof Schema.String;
6302
- tenantId: typeof Schema.Null;
6303
- 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>>;
6304
6293
  }>, Schema.Struct<{
6305
- type: Schema.Literal<["service"]>;
6306
- id: typeof Schema.String;
6307
- tenantId: typeof Schema.Null;
6308
- metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
6309
- 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;
6310
6299
  }>]>;
6311
6300
 
6312
6301
  export declare type SubjectIdentity = typeof SubjectIdentity.Type;
@@ -6341,7 +6330,7 @@ export declare const subjectScopes: (subject: Subject) => ReadonlyArray<string>;
6341
6330
  export declare class SubjectService extends SubjectService_base {
6342
6331
  }
6343
6332
 
6344
- declare const SubjectService_base: Context.TagClass<SubjectService, "@voltro/Subject", {
6333
+ declare const SubjectService_base: Context.ServiceClass<SubjectService, "@voltro/Subject", {
6345
6334
  readonly type: "user";
6346
6335
  readonly id: string;
6347
6336
  readonly tenantId: string;
@@ -6383,11 +6372,11 @@ declare const SubjectService_base: Context.TagClass<SubjectService, "@voltro/Sub
6383
6372
  readonly type: "service";
6384
6373
  readonly id: string;
6385
6374
  readonly tenantId: null;
6375
+ readonly service: string;
6386
6376
  readonly scopes?: readonly string[] | undefined;
6387
6377
  readonly metadata?: {
6388
6378
  readonly [x: string]: unknown;
6389
6379
  } | undefined;
6390
- readonly service: string;
6391
6380
  }>;
6392
6381
 
6393
6382
  /** Subscribe to server-primitive errors. Returns an unsubscribe fn. */
@@ -6410,55 +6399,39 @@ export declare type SubscriptionEvent<T> = {
6410
6399
  readonly revision?: number | undefined;
6411
6400
  };
6412
6401
 
6413
- export declare const subscriptionEvent: <D extends Schema.Schema.Any>(data: D) => Schema.Union<[Schema.Struct<{
6414
- _tag: Schema.Literal<["snapshot"]>;
6415
- revision: typeof Schema.Number;
6416
- data: D;
6417
- computed: Schema.optional<typeof Schema.Boolean>;
6418
- 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>;
6419
6408
  }>, Schema.Struct<{
6420
- _tag: Schema.Literal<["delta"]>;
6421
- revision: typeof Schema.Number;
6422
- emittedAt: typeof Schema.Number;
6423
- patch: Schema.Struct<{
6424
- ops: Schema.Array$<Schema.Union<[Schema.Struct<{
6425
- op: Schema.Literal<["add"]>;
6426
- path: typeof Schema.String;
6427
- value: Schema.refine<{
6428
- readonly [x: string]: unknown;
6429
- } & Readonly<Record<string, unknown>> & {
6430
- readonly id: RowId;
6431
- }, Schema.Schema<{
6432
- readonly [x: string]: unknown;
6433
- }, {
6434
- readonly [x: string]: unknown;
6435
- }, 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>>>;
6436
6417
  }>, Schema.Struct<{
6437
- op: Schema.Literal<["replace"]>;
6438
- path: typeof Schema.String;
6439
- value: Schema.refine<{
6440
- readonly [x: string]: unknown;
6441
- } & Readonly<Record<string, unknown>> & {
6442
- readonly id: RowId;
6443
- }, Schema.Schema<{
6444
- readonly [x: string]: unknown;
6445
- }, {
6446
- readonly [x: string]: unknown;
6447
- }, 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>>>;
6448
6421
  }>, Schema.Struct<{
6449
- op: Schema.Literal<["remove"]>;
6450
- path: typeof Schema.String;
6422
+ readonly op: Schema.Literal<"remove">;
6423
+ readonly path: Schema.String;
6451
6424
  }>, Schema.Struct<{
6452
- op: Schema.Literal<["mergeCells"]>;
6453
- path: typeof Schema.String;
6454
- 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>>;
6455
6428
  }>]>>;
6456
- 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]>>>;
6457
6430
  }>;
6458
6431
  }>, Schema.Struct<{
6459
- _tag: Schema.Literal<["error"]>;
6460
- error: typeof Schema.Unknown;
6461
- revision: Schema.optional<typeof Schema.Number>;
6432
+ readonly _tag: Schema.Literal<"error">;
6433
+ readonly error: Schema.Unknown;
6434
+ readonly revision: Schema.optional<Schema.Number>;
6462
6435
  }>]>;
6463
6436
 
6464
6437
  export declare interface SurfaceMismatch {
@@ -6531,21 +6504,20 @@ export declare type TableName = keyof VoltroTableNames extends never ? string :
6531
6504
  * leak the original Schema instance).
6532
6505
  */
6533
6506
  export declare class TableValidationFailed extends TableValidationFailed_base {
6507
+ get message(): string;
6534
6508
  }
6535
6509
 
6536
- declare const TableValidationFailed_base: Schema.TaggedErrorClass<TableValidationFailed, "TableValidationFailed", {
6537
- readonly _tag: Schema.tag<"TableValidationFailed">;
6538
- } & {
6510
+ declare const TableValidationFailed_base: Schema.Class<TableValidationFailed, Schema.TaggedStruct<"TableValidationFailed", {
6539
6511
  /** The table the row targeted. */
6540
- table: typeof Schema.String;
6512
+ readonly table: Schema.String;
6541
6513
  /** Top-level explanation for logs + UI ("user.email failed pattern check"). */
6542
- summary: typeof Schema.String;
6514
+ readonly summary: Schema.String;
6543
6515
  /** Flat list of `{ path, message }` per failing leaf. Path uses dot-notation. */
6544
- issues: Schema.Array$<Schema.Struct<{
6545
- path: typeof Schema.String;
6546
- message: typeof Schema.String;
6516
+ readonly issues: Schema.$Array<Schema.Struct<{
6517
+ readonly path: Schema.String;
6518
+ readonly message: Schema.String;
6547
6519
  }>>;
6548
- }>;
6520
+ }>, YieldableError>;
6549
6521
 
6550
6522
  export declare type Target<Input = unknown, Row = unknown> = TargetSpec<Input, Row> | ReadonlyArray<TargetSpec<Input, Row>>;
6551
6523
 
@@ -6622,16 +6594,14 @@ export declare type TargetSpec<Input = unknown, Row = unknown> = InsertTarget<In
6622
6594
  export declare class TenantRowNotFound extends TenantRowNotFound_base {
6623
6595
  }
6624
6596
 
6625
- declare const TenantRowNotFound_base: Schema.TaggedErrorClass<TenantRowNotFound, "TenantRowNotFound", {
6626
- readonly _tag: Schema.tag<"TenantRowNotFound">;
6627
- } & {
6597
+ declare const TenantRowNotFound_base: Schema.Class<TenantRowNotFound, Schema.TaggedStruct<"TenantRowNotFound", {
6628
6598
  /** The table the keyed write targeted. */
6629
- table: typeof Schema.String;
6599
+ readonly table: Schema.String;
6630
6600
  /** The primary key the CALLER supplied. Echoing it leaks nothing. */
6631
- id: typeof Schema.String;
6601
+ readonly id: Schema.String;
6632
6602
  /** Human-readable explanation for diagnostics + UI. */
6633
- reason: typeof Schema.String;
6634
- }>;
6603
+ readonly reason: Schema.String;
6604
+ }>, YieldableError>;
6635
6605
 
6636
6606
  /**
6637
6607
  * The subject a `storeForTenant(id)` view runs as — the caller's identity,
@@ -6662,14 +6632,12 @@ export declare const tenantScopedSubject: (subject: Subject, tenantId: string) =
6662
6632
  export declare class TenantScopeViolation extends TenantScopeViolation_base {
6663
6633
  }
6664
6634
 
6665
- declare const TenantScopeViolation_base: Schema.TaggedErrorClass<TenantScopeViolation, "TenantScopeViolation", {
6666
- readonly _tag: Schema.tag<"TenantScopeViolation">;
6667
- } & {
6635
+ declare const TenantScopeViolation_base: Schema.Class<TenantScopeViolation, Schema.TaggedStruct<"TenantScopeViolation", {
6668
6636
  /** The table the violating write targeted. */
6669
- table: typeof Schema.String;
6637
+ readonly table: Schema.String;
6670
6638
  /** Human-readable explanation for diagnostics + UI. */
6671
- reason: typeof Schema.String;
6672
- }>;
6639
+ readonly reason: Schema.String;
6640
+ }>, YieldableError>;
6673
6641
 
6674
6642
  /** The subject types a selection can apply to: those with an id AND a tenant.
6675
6643
  * `anonymous` has no id to remember a selection under; `system` has no
@@ -6692,14 +6660,12 @@ export declare interface TenantSelectionIdentity {
6692
6660
  export declare class TenantSelectionRefused extends TenantSelectionRefused_base {
6693
6661
  }
6694
6662
 
6695
- declare const TenantSelectionRefused_base: Schema.TaggedErrorClass<TenantSelectionRefused, "TenantSelectionRefused", {
6696
- readonly _tag: Schema.tag<"TenantSelectionRefused">;
6697
- } & {
6698
- subjectType: typeof Schema.String;
6699
- subjectId: Schema.NullOr<typeof Schema.String>;
6700
- tenantId: typeof Schema.String;
6701
- reason: Schema.Literal<["not-a-member", "subject-has-no-tenant"]>;
6702
- }>;
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>;
6703
6669
 
6704
6670
  /** Where `composeAuthStrategies` finds a stored selection. `@voltro/runtime`'s
6705
6671
  * `tenantSelectionStore(store)` is the framework's implementation over the
@@ -6713,56 +6679,40 @@ export declare interface TenantSelectionStore {
6713
6679
  readonly clear: (identity: TenantSelectionIdentity) => Promise<void>;
6714
6680
  }
6715
6681
 
6716
- 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<{
6717
- _tag: Schema.Literal<["snapshot"]>;
6718
- revision: typeof Schema.Number;
6719
- data: Output;
6720
- computed: Schema.optional<typeof Schema.Boolean>;
6721
- 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>;
6722
6688
  }>, Schema.Struct<{
6723
- _tag: Schema.Literal<["delta"]>;
6724
- revision: typeof Schema.Number;
6725
- emittedAt: typeof Schema.Number;
6726
- patch: Schema.Struct<{
6727
- ops: Schema.Array$<Schema.Union<[Schema.Struct<{
6728
- op: Schema.Literal<["add"]>;
6729
- path: typeof Schema.String;
6730
- value: Schema.refine<{
6731
- readonly [x: string]: unknown;
6732
- } & Readonly<Record<string, unknown>> & {
6733
- readonly id: RowId;
6734
- }, Schema.Schema<{
6735
- readonly [x: string]: unknown;
6736
- }, {
6737
- readonly [x: string]: unknown;
6738
- }, 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>>>;
6739
6697
  }>, Schema.Struct<{
6740
- op: Schema.Literal<["replace"]>;
6741
- path: typeof Schema.String;
6742
- value: Schema.refine<{
6743
- readonly [x: string]: unknown;
6744
- } & Readonly<Record<string, unknown>> & {
6745
- readonly id: RowId;
6746
- }, Schema.Schema<{
6747
- readonly [x: string]: unknown;
6748
- }, {
6749
- readonly [x: string]: unknown;
6750
- }, 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>>>;
6751
6701
  }>, Schema.Struct<{
6752
- op: Schema.Literal<["remove"]>;
6753
- path: typeof Schema.String;
6702
+ readonly op: Schema.Literal<"remove">;
6703
+ readonly path: Schema.String;
6754
6704
  }>, Schema.Struct<{
6755
- op: Schema.Literal<["mergeCells"]>;
6756
- path: typeof Schema.String;
6757
- 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>>;
6758
6708
  }>]>>;
6759
- 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]>>>;
6760
6710
  }>;
6761
6711
  }>, Schema.Struct<{
6762
- _tag: Schema.Literal<["error"]>;
6763
- error: typeof Schema.Unknown;
6764
- revision: Schema.optional<typeof Schema.Number>;
6765
- }>]>, 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>;
6766
6716
 
6767
6717
  export declare const toSnakeCase: (key: string) => string;
6768
6718
 
@@ -6774,7 +6724,7 @@ export declare const tsMs: (v: unknown) => number;
6774
6724
 
6775
6725
  /**
6776
6726
  * Typed error every handler can throw to signal "you must be signed
6777
- * in to perform this action". The framework's @effect/rpc layer
6727
+ * in to perform this action". The framework's effect/rpc layer
6778
6728
  * preserves the `_tag` across the wire, and `@voltro/client`'s error
6779
6729
  * bus surfaces it to the consuming app so the dashboard can
6780
6730
  * auto-redirect to the sign-in page (cleared session + UI swap).
@@ -6784,14 +6734,13 @@ export declare const tsMs: (v: unknown) => number;
6784
6734
  * resolved at all" — anonymous, expired token, missing cookie, etc.
6785
6735
  */
6786
6736
  export declare class Unauthenticated extends Unauthenticated_base {
6737
+ get message(): string;
6787
6738
  }
6788
6739
 
6789
- declare const Unauthenticated_base: Schema.TaggedErrorClass<Unauthenticated, "Unauthenticated", {
6790
- readonly _tag: Schema.tag<"Unauthenticated">;
6791
- } & {
6740
+ declare const Unauthenticated_base: Schema.Class<Unauthenticated, Schema.TaggedStruct<"Unauthenticated", {
6792
6741
  /** Optional context — e.g. "auth.signin required", "session expired". */
6793
- reason: Schema.optional<typeof Schema.String>;
6794
- }>;
6742
+ readonly reason: Schema.optional<Schema.String>;
6743
+ }>, YieldableError>;
6795
6744
 
6796
6745
  /**
6797
6746
  * Channel keys named by a `source:` that no `reactivityChannel()` declared.
@@ -6820,10 +6769,10 @@ export declare const UNDO_REDO_TAG: "__voltro.undo.redo";
6820
6769
  * No `target` (it writes whatever tables the change-set touched — its effects
6821
6770
  * reach the client via those tables' own reactive deltas, not optimistic). */
6822
6771
  export declare const undoApplyDescriptor: MutationProcedureDescriptor<"__voltro.undo.apply", Schema.Struct<{
6823
- invocationId: typeof Schema.String;
6772
+ readonly invocationId: Schema.String;
6824
6773
  }>, Schema.Struct<{
6825
- ok: typeof Schema.Boolean;
6826
- }>, Schema.Union<[typeof UndoNotFound, typeof UndoForbidden, typeof UndoConflict]>>;
6774
+ readonly ok: Schema.Boolean;
6775
+ }>, Schema.Union<readonly [typeof UndoNotFound, typeof UndoForbidden, typeof UndoConflict]>>;
6827
6776
 
6828
6777
  /** The row changed since the action (a concurrent writer), OR the action
6829
6778
  * crossed an external side effect — a blind restore would clobber/lie, so
@@ -6832,38 +6781,34 @@ export declare const undoApplyDescriptor: MutationProcedureDescriptor<"__voltro.
6832
6781
  export declare class UndoConflict extends UndoConflict_base {
6833
6782
  }
6834
6783
 
6835
- declare const UndoConflict_base: Schema.TaggedErrorClass<UndoConflict, "UndoConflict", {
6836
- readonly _tag: Schema.tag<"UndoConflict">;
6837
- } & {
6838
- invocationId: typeof Schema.String;
6839
- reason: Schema.Literal<["conflict", "action"]>;
6840
- }>;
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>;
6841
6788
 
6842
6789
  /** The action belongs to a different subject — undo is per-actor. */
6843
6790
  export declare class UndoForbidden extends UndoForbidden_base {
6844
6791
  }
6845
6792
 
6846
- declare const UndoForbidden_base: Schema.TaggedErrorClass<UndoForbidden, "UndoForbidden", {
6847
- readonly _tag: Schema.tag<"UndoForbidden">;
6848
- } & {
6849
- invocationId: typeof Schema.String;
6850
- }>;
6793
+ declare const UndoForbidden_base: Schema.Class<UndoForbidden, Schema.TaggedStruct<"UndoForbidden", {
6794
+ readonly invocationId: Schema.String;
6795
+ }>, YieldableError>;
6851
6796
 
6852
6797
  /** One undoable action in the calling subject's recent history. The heavy
6853
6798
  * `changes` payload is server-only — the client list needs only this. */
6854
6799
  export declare const UndoLogEntry: Schema.Struct<{
6855
6800
  /** The invocation id (= the `_voltro_undo_log` row id) to pass to apply/redo. */
6856
- id: typeof Schema.String;
6801
+ readonly id: Schema.String;
6857
6802
  /** Rpc tag of the captured mutation (e.g. `todos.create`). */
6858
- tag: typeof Schema.String;
6803
+ readonly tag: Schema.String;
6859
6804
  /** Human label ("create todo") — falls back to the tag. */
6860
- label: Schema.NullOr<typeof Schema.String>;
6805
+ readonly label: Schema.NullOr<Schema.String>;
6861
6806
  /** True once undone (so the UI shows it as redo-able). */
6862
- undone: typeof Schema.Boolean;
6807
+ readonly undone: Schema.Boolean;
6863
6808
  /** True when the action crossed an external side effect → not undoable. */
6864
- crossesAction: typeof Schema.Boolean;
6809
+ readonly crossesAction: Schema.Boolean;
6865
6810
  /** Display-only creation time (stringified). */
6866
- createdAt: typeof Schema.String;
6811
+ readonly createdAt: Schema.String;
6867
6812
  }>;
6868
6813
 
6869
6814
  export declare type UndoLogEntry = Schema.Schema.Type<typeof UndoLogEntry>;
@@ -6872,38 +6817,36 @@ export declare type UndoLogEntry = Schema.Schema.Type<typeof UndoLogEntry>;
6872
6817
  * first. Reactive (source `_voltro_undo_log`) so the list updates live as the
6873
6818
  * subject makes + undoes changes. */
6874
6819
  export declare const undoLogQueryDescriptor: QueryProcedureDescriptor<"__voltro.undo.log", Schema.Struct<{
6875
- limit: Schema.optional<typeof Schema.Number>;
6876
- }>, Schema.Array$<Schema.Struct<{
6820
+ readonly limit: Schema.optional<Schema.Number>;
6821
+ }>, Schema.$Array<Schema.Struct<{
6877
6822
  /** The invocation id (= the `_voltro_undo_log` row id) to pass to apply/redo. */
6878
- id: typeof Schema.String;
6823
+ readonly id: Schema.String;
6879
6824
  /** Rpc tag of the captured mutation (e.g. `todos.create`). */
6880
- tag: typeof Schema.String;
6825
+ readonly tag: Schema.String;
6881
6826
  /** Human label ("create todo") — falls back to the tag. */
6882
- label: Schema.NullOr<typeof Schema.String>;
6827
+ readonly label: Schema.NullOr<Schema.String>;
6883
6828
  /** True once undone (so the UI shows it as redo-able). */
6884
- undone: typeof Schema.Boolean;
6829
+ readonly undone: Schema.Boolean;
6885
6830
  /** True when the action crossed an external side effect → not undoable. */
6886
- crossesAction: typeof Schema.Boolean;
6831
+ readonly crossesAction: Schema.Boolean;
6887
6832
  /** Display-only creation time (stringified). */
6888
- createdAt: typeof Schema.String;
6889
- }>>, typeof Schema.Never>;
6833
+ readonly createdAt: Schema.String;
6834
+ }>>, Schema.Never>;
6890
6835
 
6891
6836
  /** No undo-log row for that invocation (already pruned, or wrong id). */
6892
6837
  export declare class UndoNotFound extends UndoNotFound_base {
6893
6838
  }
6894
6839
 
6895
- declare const UndoNotFound_base: Schema.TaggedErrorClass<UndoNotFound, "UndoNotFound", {
6896
- readonly _tag: Schema.tag<"UndoNotFound">;
6897
- } & {
6898
- invocationId: typeof Schema.String;
6899
- }>;
6840
+ declare const UndoNotFound_base: Schema.Class<UndoNotFound, Schema.TaggedStruct<"UndoNotFound", {
6841
+ readonly invocationId: Schema.String;
6842
+ }>, YieldableError>;
6900
6843
 
6901
6844
  /** `__voltro.undo.redo` — re-apply a previously-undone invocation's forward changes. */
6902
6845
  export declare const undoRedoDescriptor: MutationProcedureDescriptor<"__voltro.undo.redo", Schema.Struct<{
6903
- invocationId: typeof Schema.String;
6846
+ readonly invocationId: Schema.String;
6904
6847
  }>, Schema.Struct<{
6905
- ok: typeof Schema.Boolean;
6906
- }>, Schema.Union<[typeof UndoNotFound, typeof UndoForbidden, typeof UndoConflict]>>;
6848
+ readonly ok: Schema.Boolean;
6849
+ }>, Schema.Union<readonly [typeof UndoNotFound, typeof UndoForbidden, typeof UndoConflict]>>;
6907
6850
 
6908
6851
  export declare interface UpdateTarget<Input = unknown, Row = unknown, Item = Record<string, unknown>> extends NestedTargetFields<Input> {
6909
6852
  readonly table: string;
@@ -6933,13 +6876,11 @@ export declare interface UpdateTarget<Input = unknown, Row = unknown, Item = Rec
6933
6876
  export declare class ValidationError extends ValidationError_base {
6934
6877
  }
6935
6878
 
6936
- declare const ValidationError_base: Schema.TaggedErrorClass<ValidationError, "ValidationError", {
6937
- readonly _tag: Schema.tag<"ValidationError">;
6938
- } & {
6939
- field: typeof Schema.String;
6940
- message: typeof Schema.String;
6941
- params: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
6942
- }>;
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>;
6943
6884
 
6944
6885
  /** Several field-addressed failures at once — one round trip, every field
6945
6886
  * marked. `issues` is non-empty by construction (`ctx.validation.failAll`
@@ -6947,23 +6888,21 @@ declare const ValidationError_base: Schema.TaggedErrorClass<ValidationError, "Va
6947
6888
  export declare class ValidationErrors extends ValidationErrors_base {
6948
6889
  }
6949
6890
 
6950
- declare const ValidationErrors_base: Schema.TaggedErrorClass<ValidationErrors, "ValidationErrors", {
6951
- readonly _tag: Schema.tag<"ValidationErrors">;
6952
- } & {
6953
- issues: Schema.filter<Schema.Array$<Schema.Struct<{
6954
- field: typeof Schema.String;
6955
- message: typeof Schema.String;
6956
- params: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
6957
- }>>>;
6958
- }>;
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>;
6959
6898
 
6960
6899
  /** One field-addressed validation issue: `field` is the form path
6961
6900
  * (`'email'`, `'address.city'`, `'entries.0.startsAt'`), `message` is a
6962
6901
  * message id (or verbatim text), `params` feed the message template. */
6963
6902
  export declare const ValidationIssue: Schema.Struct<{
6964
- field: typeof Schema.String;
6965
- message: typeof Schema.String;
6966
- 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>>;
6967
6906
  }>;
6968
6907
 
6969
6908
  export declare type ValidationIssueShape = Schema.Schema.Type<typeof ValidationIssue>;
@@ -7101,7 +7040,7 @@ export declare interface VoltroPlugin {
7101
7040
  * the plugin will surface a config form in the dashboard, or when
7102
7041
  * the plugin reads dynamic config from env / a config file.
7103
7042
  */
7104
- readonly configSchema?: Schema.Schema.Any;
7043
+ readonly configSchema?: Schema.Top;
7105
7044
  /**
7106
7045
  * Wraps every MUTATION handler call. Composed in declaration order
7107
7046
  * across the plugin list: outermost = first listed in app.config.ts.
@@ -7589,11 +7528,11 @@ export declare const wireAudienceOf: (descriptor: {
7589
7528
  * paths. Pass the same `extraErrors` the lifter receives.
7590
7529
  */
7591
7530
  export declare const wireErrorUnion: (descriptor: {
7592
- readonly error: Schema.Schema.All;
7531
+ readonly error: Schema.Top;
7593
7532
  readonly guards?: DeclaredAccess | undefined;
7594
7533
  readonly requiresApproval?: AnyApprovalPolicy | undefined;
7595
7534
  readonly idempotencyScope?: MutationIdempotencyScope | undefined;
7596
- }, kind: "query" | "mutation" | "action" | "stream", extraErrors?: ExtraErrors) => Schema.Schema.All;
7535
+ }, kind: "query" | "mutation" | "action" | "stream", extraErrors?: ExtraErrors) => Schema.Top;
7597
7536
 
7598
7537
  /** A procedure kind that has a wire error union. */
7599
7538
  export declare type WireProcedureKind = keyof typeof FRAMEWORK_WIRE_ERRORS;
@@ -7727,45 +7666,41 @@ export declare interface WorkflowAccessOptions<Payload = unknown> {
7727
7666
  export declare const WorkflowAccessProperty: unique symbol;
7728
7667
 
7729
7668
  export declare const workflowCancelDescriptor: ActionProcedureDescriptor<"__voltro.workflow.cancel", Schema.Struct<{
7730
- workflowName: typeof Schema.String;
7731
- executionId: typeof Schema.String;
7732
- control: Schema.optional<Schema.Struct<{
7733
- requestId: typeof Schema.NonEmptyString;
7734
- cause: Schema.optionalWith<Schema.Struct<{
7735
- reason: typeof Schema.NonEmptyString;
7736
- detail: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
7737
- }>, {
7738
- exact: true;
7739
- }>;
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
+ }>>;
7740
7677
  }>>;
7741
- }>, Schema.filter<Schema.Struct<{
7742
- operation: Schema.Literal<["cancel", "resume"]>;
7743
- kind: Schema.Literal<["accepted", "confirmed", "unknown", "already-terminal"]>;
7744
- requestId: Schema.NullOr<typeof Schema.NonEmptyString>;
7745
- snapshot: Schema.Struct<{
7746
- id: typeof Schema.String;
7747
- workflowName: typeof Schema.String;
7748
- executionId: typeof Schema.String;
7749
- status: Schema.Union<[Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>, Schema.Literal<["unknown"]>]>;
7750
- output: Schema.optional<typeof Schema.Unknown>;
7751
- error: Schema.optional<Schema.Struct<{
7752
- tag: Schema.NullOr<typeof Schema.String>;
7753
- 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;
7754
7691
  }>>;
7755
7692
  }>;
7756
- }>>, typeof Schema.Never>;
7693
+ }>, Schema.Never>;
7757
7694
 
7758
7695
  export declare const WorkflowControlInputSchema: Schema.Struct<{
7759
- workflowName: typeof Schema.String;
7760
- executionId: typeof Schema.String;
7761
- control: Schema.optional<Schema.Struct<{
7762
- requestId: typeof Schema.NonEmptyString;
7763
- cause: Schema.optionalWith<Schema.Struct<{
7764
- reason: typeof Schema.NonEmptyString;
7765
- detail: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
7766
- }>, {
7767
- exact: true;
7768
- }>;
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
+ }>>;
7769
7704
  }>>;
7770
7705
  }>;
7771
7706
 
@@ -7773,616 +7708,608 @@ export declare type WorkflowControlIntent = Schema.Schema.Type<typeof WorkflowCo
7773
7708
 
7774
7709
  /** Stable caller-owned intent for retry after an uncertain transport result. */
7775
7710
  export declare const WorkflowControlIntentSchema: Schema.Struct<{
7776
- requestId: typeof Schema.NonEmptyString;
7777
- cause: Schema.optionalWith<Schema.Struct<{
7778
- reason: typeof Schema.NonEmptyString;
7779
- detail: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
7780
- }>, {
7781
- exact: true;
7782
- }>;
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
+ }>>;
7783
7716
  }>;
7784
7717
 
7785
7718
  export declare const workflowControlQueryDescriptor: QueryProcedureDescriptor<"__voltro.workflow.control", Schema.Struct<{
7786
- workflowName: typeof Schema.NonEmptyString;
7787
- executionId: typeof Schema.NonEmptyString;
7788
- operation: Schema.Literal<["cancel", "resume"]>;
7789
- requestId: typeof Schema.NonEmptyString;
7790
- }>, Schema.filter<Schema.Struct<{
7791
- operation: Schema.Literal<["cancel", "resume"]>;
7792
- kind: Schema.Literal<["accepted", "confirmed", "unknown", "already-terminal"]>;
7793
- requestId: Schema.NullOr<typeof Schema.NonEmptyString>;
7794
- snapshot: Schema.Struct<{
7795
- id: typeof Schema.String;
7796
- workflowName: typeof Schema.String;
7797
- executionId: typeof Schema.String;
7798
- status: Schema.Union<[Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>, Schema.Literal<["unknown"]>]>;
7799
- output: Schema.optional<typeof Schema.Unknown>;
7800
- error: Schema.optional<Schema.Struct<{
7801
- tag: Schema.NullOr<typeof Schema.String>;
7802
- 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;
7803
7736
  }>>;
7804
7737
  }>;
7805
- }>>, typeof Schema.Never>;
7738
+ }>, Schema.Never>;
7806
7739
 
7807
7740
  export declare type WorkflowControlReadInput = Schema.Schema.Type<typeof WorkflowControlReadInputSchema>;
7808
7741
 
7809
7742
  export declare const WorkflowControlReadInputSchema: Schema.Struct<{
7810
- workflowName: typeof Schema.NonEmptyString;
7811
- executionId: typeof Schema.NonEmptyString;
7812
- operation: Schema.Literal<["cancel", "resume"]>;
7813
- 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;
7814
7747
  }>;
7815
7748
 
7816
7749
  export declare type WorkflowControlResult = Schema.Schema.Type<typeof WorkflowControlResultSchema>;
7817
7750
 
7818
7751
  /** Acceptance is not execution completion; null means no resident receipt. */
7819
- export declare const WorkflowControlResultSchema: Schema.filter<Schema.Struct<{
7820
- operation: Schema.Literal<["cancel", "resume"]>;
7821
- kind: Schema.Literal<["accepted", "confirmed", "unknown", "already-terminal"]>;
7822
- requestId: Schema.NullOr<typeof Schema.NonEmptyString>;
7823
- snapshot: Schema.Struct<{
7824
- id: typeof Schema.String;
7825
- workflowName: typeof Schema.String;
7826
- executionId: typeof Schema.String;
7827
- status: Schema.Union<[Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>, Schema.Literal<["unknown"]>]>;
7828
- output: Schema.optional<typeof Schema.Unknown>;
7829
- error: Schema.optional<Schema.Struct<{
7830
- tag: Schema.NullOr<typeof Schema.String>;
7831
- 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;
7832
7765
  }>>;
7833
7766
  }>;
7834
- }>>;
7767
+ }>;
7835
7768
 
7836
7769
  export declare type WorkflowDomainEventRow = Schema.Schema.Type<typeof WorkflowDomainEventRowSchema>;
7837
7770
 
7838
7771
  export declare const WorkflowDomainEventRowSchema: Schema.Struct<{
7839
- id: typeof Schema.String;
7840
- name: typeof Schema.String;
7841
- payload: typeof Schema.Unknown;
7842
- source: typeof Schema.String;
7843
- subject: Schema.NullOr<typeof Schema.Unknown>;
7844
- traceId: Schema.NullOr<typeof Schema.String>;
7845
- 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;
7846
7779
  }>;
7847
7780
 
7848
7781
  export declare const WorkflowDomainEventsInputSchema: Schema.Struct<{
7849
- name: Schema.optional<typeof Schema.String>;
7850
- limit: Schema.optional<typeof Schema.Number>;
7782
+ readonly name: Schema.optional<Schema.String>;
7783
+ readonly limit: Schema.optional<Schema.Number>;
7851
7784
  }>;
7852
7785
 
7853
7786
  export declare const workflowDomainEventsQueryDescriptor: QueryProcedureDescriptor<"__voltro.workflow.domainEvents", Schema.Struct<{
7854
- name: Schema.optional<typeof Schema.String>;
7855
- limit: Schema.optional<typeof Schema.Number>;
7856
- }>, Schema.Array$<Schema.Struct<{
7857
- id: typeof Schema.String;
7858
- name: typeof Schema.String;
7859
- payload: typeof Schema.Unknown;
7860
- source: typeof Schema.String;
7861
- subject: Schema.NullOr<typeof Schema.Unknown>;
7862
- traceId: Schema.NullOr<typeof Schema.String>;
7863
- occurredAt: typeof Schema.Date;
7864
- }>>, 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>;
7865
7798
 
7866
7799
  export declare const WorkflowEventDeliveriesInputSchema: Schema.Struct<{
7867
- eventId: typeof Schema.String;
7800
+ readonly eventId: Schema.String;
7868
7801
  }>;
7869
7802
 
7870
7803
  export declare const workflowEventDeliveriesQueryDescriptor: QueryProcedureDescriptor<"__voltro.workflow.event.deliveries", Schema.Struct<{
7871
- eventId: typeof Schema.String;
7872
- }>, Schema.Array$<Schema.Struct<{
7873
- id: typeof Schema.String;
7874
- eventId: typeof Schema.String;
7875
- eventName: typeof Schema.String;
7876
- triggerId: typeof Schema.String;
7877
- workflowName: typeof Schema.String;
7878
- executionId: Schema.NullOr<typeof Schema.String>;
7879
- status: Schema.Literal<["starting", "started", "skipped", "failed"]>;
7880
- idempotencyKey: typeof Schema.String;
7881
- skipped: typeof Schema.Boolean;
7882
- errorMessage: Schema.NullOr<typeof Schema.String>;
7883
- createdAt: typeof Schema.Date;
7884
- completedAt: Schema.NullOr<typeof Schema.Date>;
7885
- }>>, 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>;
7886
7819
 
7887
7820
  export declare type WorkflowEventDeliveryRow = Schema.Schema.Type<typeof WorkflowEventDeliveryRowSchema>;
7888
7821
 
7889
7822
  export declare const WorkflowEventDeliveryRowSchema: Schema.Struct<{
7890
- id: typeof Schema.String;
7891
- eventId: typeof Schema.String;
7892
- eventName: typeof Schema.String;
7893
- triggerId: typeof Schema.String;
7894
- workflowName: typeof Schema.String;
7895
- executionId: Schema.NullOr<typeof Schema.String>;
7896
- status: Schema.Literal<["starting", "started", "skipped", "failed"]>;
7897
- idempotencyKey: typeof Schema.String;
7898
- skipped: typeof Schema.Boolean;
7899
- errorMessage: Schema.NullOr<typeof Schema.String>;
7900
- createdAt: typeof Schema.Date;
7901
- 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>;
7902
7835
  }>;
7903
7836
 
7904
7837
  export declare type WorkflowParentClosePolicy = Schema.Schema.Type<typeof WorkflowParentClosePolicySchema>;
7905
7838
 
7906
- export declare const WorkflowParentClosePolicySchema: Schema.Literal<["cancel", "terminate", "abandon"]>;
7839
+ export declare const WorkflowParentClosePolicySchema: Schema.Literals<readonly ["cancel", "terminate", "abandon"]>;
7907
7840
 
7908
7841
  export declare const workflowQueuedCancelDescriptor: ActionProcedureDescriptor<"__voltro.workflow.queued.cancel", Schema.Struct<{
7909
- cause: Schema.optionalWith<Schema.Struct<{
7910
- reason: typeof Schema.NonEmptyString;
7911
- detail: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
7912
- }>, {
7913
- exact: true;
7914
- }>;
7915
- workflowName: typeof Schema.NonEmptyString;
7916
- receiptId: typeof Schema.NonEmptyString;
7917
- requestId: typeof Schema.NonEmptyString;
7918
- }>, Schema.filter<Schema.Struct<{
7919
- operation: Schema.Literal<["cancel"]>;
7920
- workflowName: typeof Schema.NonEmptyString;
7921
- receiptId: typeof Schema.NonEmptyString;
7922
- requestId: Schema.NullOr<typeof Schema.NonEmptyString>;
7923
- kind: Schema.Literal<["accepted", "confirmed", "unknown", "already-terminal"]>;
7924
- observation: Schema.Union<[Schema.Struct<{
7925
- 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">;
7926
7857
  }>, Schema.Struct<{
7927
- kind: Schema.Literal<["admission"]>;
7928
- outcome: Schema.Union<[Schema.Union<[Schema.Struct<{
7929
- kind: Schema.Literal<["dropped"]>;
7930
- at: typeof Schema.Number;
7931
- 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;
7932
7863
  }>, Schema.Struct<{
7933
- kind: Schema.Literal<["skipped"]>;
7934
- at: typeof Schema.Number;
7935
- executionId: typeof Schema.String;
7936
- 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;
7937
7868
  }>, Schema.Struct<{
7938
- kind: Schema.Literal<["superseded"]>;
7939
- at: typeof Schema.Number;
7869
+ readonly kind: Schema.Literal<"superseded">;
7870
+ readonly at: Schema.Number;
7940
7871
  }>, Schema.Struct<{
7941
- kind: Schema.Literal<["cancelled"]>;
7942
- at: typeof Schema.Number;
7872
+ readonly kind: Schema.Literal<"cancelled">;
7873
+ readonly at: Schema.Number;
7943
7874
  }>, Schema.Struct<{
7944
- kind: Schema.Literal<["abandoned"]>;
7945
- at: typeof Schema.Number;
7946
- failureId: typeof Schema.NonEmptyString;
7875
+ readonly kind: Schema.Literal<"abandoned">;
7876
+ readonly at: Schema.Number;
7877
+ readonly failureId: Schema.NonEmptyString;
7947
7878
  }>]>, Schema.Struct<{
7948
- kind: Schema.Literal<["rejected"]>;
7949
- failureId: typeof Schema.NonEmptyString;
7879
+ readonly kind: Schema.Literal<"rejected">;
7880
+ readonly failureId: Schema.NonEmptyString;
7950
7881
  }>]>;
7951
7882
  }>, Schema.Struct<{
7952
- kind: Schema.Literal<["execution"]>;
7953
- snapshot: Schema.Struct<{
7954
- id: typeof Schema.String;
7955
- workflowName: typeof Schema.String;
7956
- executionId: typeof Schema.String;
7957
- status: Schema.Union<[Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>, Schema.Literal<["unknown"]>]>;
7958
- output: Schema.optional<typeof Schema.Unknown>;
7959
- error: Schema.optional<Schema.Struct<{
7960
- tag: Schema.NullOr<typeof Schema.String>;
7961
- 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;
7962
7893
  }>>;
7963
7894
  }>;
7964
7895
  }>, Schema.Struct<{
7965
- kind: Schema.Literal<["unavailable"]>;
7966
- 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"]>;
7967
7898
  }>]>;
7968
- }>>, typeof Schema.Never>;
7899
+ }>, Schema.Never>;
7969
7900
 
7970
7901
  export declare type WorkflowQueuedCancelInput = typeof WorkflowQueuedCancelInputSchema.Type;
7971
7902
 
7972
7903
  export declare const WorkflowQueuedCancelInputSchema: Schema.Struct<{
7973
- cause: Schema.optionalWith<Schema.Struct<{
7974
- reason: typeof Schema.NonEmptyString;
7975
- detail: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
7976
- }>, {
7977
- exact: true;
7978
- }>;
7979
- workflowName: typeof Schema.NonEmptyString;
7980
- receiptId: typeof Schema.NonEmptyString;
7981
- 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;
7982
7911
  }>;
7983
7912
 
7984
7913
  export declare type WorkflowQueuedCancellationResult = typeof WorkflowQueuedCancellationResultSchema.Type;
7985
7914
 
7986
7915
  /** A queued caller has a receipt before any execution exists. Keep admission
7987
7916
  * evidence separate from an observed execution rather than fabricating IDs. */
7988
- export declare const WorkflowQueuedCancellationResultSchema: Schema.filter<Schema.Struct<{
7989
- operation: Schema.Literal<["cancel"]>;
7990
- workflowName: typeof Schema.NonEmptyString;
7991
- receiptId: typeof Schema.NonEmptyString;
7992
- requestId: Schema.NullOr<typeof Schema.NonEmptyString>;
7993
- kind: Schema.Literal<["accepted", "confirmed", "unknown", "already-terminal"]>;
7994
- observation: Schema.Union<[Schema.Struct<{
7995
- 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">;
7996
7925
  }>, Schema.Struct<{
7997
- kind: Schema.Literal<["admission"]>;
7998
- outcome: Schema.Union<[Schema.Union<[Schema.Struct<{
7999
- kind: Schema.Literal<["dropped"]>;
8000
- at: typeof Schema.Number;
8001
- 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;
8002
7931
  }>, Schema.Struct<{
8003
- kind: Schema.Literal<["skipped"]>;
8004
- at: typeof Schema.Number;
8005
- executionId: typeof Schema.String;
8006
- 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;
8007
7936
  }>, Schema.Struct<{
8008
- kind: Schema.Literal<["superseded"]>;
8009
- at: typeof Schema.Number;
7937
+ readonly kind: Schema.Literal<"superseded">;
7938
+ readonly at: Schema.Number;
8010
7939
  }>, Schema.Struct<{
8011
- kind: Schema.Literal<["cancelled"]>;
8012
- at: typeof Schema.Number;
7940
+ readonly kind: Schema.Literal<"cancelled">;
7941
+ readonly at: Schema.Number;
8013
7942
  }>, Schema.Struct<{
8014
- kind: Schema.Literal<["abandoned"]>;
8015
- at: typeof Schema.Number;
8016
- failureId: typeof Schema.NonEmptyString;
7943
+ readonly kind: Schema.Literal<"abandoned">;
7944
+ readonly at: Schema.Number;
7945
+ readonly failureId: Schema.NonEmptyString;
8017
7946
  }>]>, Schema.Struct<{
8018
- kind: Schema.Literal<["rejected"]>;
8019
- failureId: typeof Schema.NonEmptyString;
7947
+ readonly kind: Schema.Literal<"rejected">;
7948
+ readonly failureId: Schema.NonEmptyString;
8020
7949
  }>]>;
8021
7950
  }>, Schema.Struct<{
8022
- kind: Schema.Literal<["execution"]>;
8023
- snapshot: Schema.Struct<{
8024
- id: typeof Schema.String;
8025
- workflowName: typeof Schema.String;
8026
- executionId: typeof Schema.String;
8027
- status: Schema.Union<[Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>, Schema.Literal<["unknown"]>]>;
8028
- output: Schema.optional<typeof Schema.Unknown>;
8029
- error: Schema.optional<Schema.Struct<{
8030
- tag: Schema.NullOr<typeof Schema.String>;
8031
- 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;
8032
7961
  }>>;
8033
7962
  }>;
8034
7963
  }>, Schema.Struct<{
8035
- kind: Schema.Literal<["unavailable"]>;
8036
- 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"]>;
8037
7966
  }>]>;
8038
- }>>;
7967
+ }>;
8039
7968
 
8040
7969
  export declare const workflowQueuedControlQueryDescriptor: QueryProcedureDescriptor<"__voltro.workflow.queued.control", Schema.Struct<{
8041
- workflowName: typeof Schema.NonEmptyString;
8042
- receiptId: typeof Schema.NonEmptyString;
8043
- requestId: typeof Schema.NonEmptyString;
8044
- }>, Schema.filter<Schema.Struct<{
8045
- operation: Schema.Literal<["cancel"]>;
8046
- workflowName: typeof Schema.NonEmptyString;
8047
- receiptId: typeof Schema.NonEmptyString;
8048
- requestId: Schema.NullOr<typeof Schema.NonEmptyString>;
8049
- kind: Schema.Literal<["accepted", "confirmed", "unknown", "already-terminal"]>;
8050
- observation: Schema.Union<[Schema.Struct<{
8051
- 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">;
8052
7981
  }>, Schema.Struct<{
8053
- kind: Schema.Literal<["admission"]>;
8054
- outcome: Schema.Union<[Schema.Union<[Schema.Struct<{
8055
- kind: Schema.Literal<["dropped"]>;
8056
- at: typeof Schema.Number;
8057
- 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;
8058
7987
  }>, Schema.Struct<{
8059
- kind: Schema.Literal<["skipped"]>;
8060
- at: typeof Schema.Number;
8061
- executionId: typeof Schema.String;
8062
- 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;
8063
7992
  }>, Schema.Struct<{
8064
- kind: Schema.Literal<["superseded"]>;
8065
- at: typeof Schema.Number;
7993
+ readonly kind: Schema.Literal<"superseded">;
7994
+ readonly at: Schema.Number;
8066
7995
  }>, Schema.Struct<{
8067
- kind: Schema.Literal<["cancelled"]>;
8068
- at: typeof Schema.Number;
7996
+ readonly kind: Schema.Literal<"cancelled">;
7997
+ readonly at: Schema.Number;
8069
7998
  }>, Schema.Struct<{
8070
- kind: Schema.Literal<["abandoned"]>;
8071
- at: typeof Schema.Number;
8072
- failureId: typeof Schema.NonEmptyString;
7999
+ readonly kind: Schema.Literal<"abandoned">;
8000
+ readonly at: Schema.Number;
8001
+ readonly failureId: Schema.NonEmptyString;
8073
8002
  }>]>, Schema.Struct<{
8074
- kind: Schema.Literal<["rejected"]>;
8075
- failureId: typeof Schema.NonEmptyString;
8003
+ readonly kind: Schema.Literal<"rejected">;
8004
+ readonly failureId: Schema.NonEmptyString;
8076
8005
  }>]>;
8077
8006
  }>, Schema.Struct<{
8078
- kind: Schema.Literal<["execution"]>;
8079
- snapshot: Schema.Struct<{
8080
- id: typeof Schema.String;
8081
- workflowName: typeof Schema.String;
8082
- executionId: typeof Schema.String;
8083
- status: Schema.Union<[Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>, Schema.Literal<["unknown"]>]>;
8084
- output: Schema.optional<typeof Schema.Unknown>;
8085
- error: Schema.optional<Schema.Struct<{
8086
- tag: Schema.NullOr<typeof Schema.String>;
8087
- 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;
8088
8017
  }>>;
8089
8018
  }>;
8090
8019
  }>, Schema.Struct<{
8091
- kind: Schema.Literal<["unavailable"]>;
8092
- 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"]>;
8093
8022
  }>]>;
8094
- }>>, typeof Schema.Never>;
8023
+ }>, Schema.Never>;
8095
8024
 
8096
8025
  export declare type WorkflowQueuedControlTarget = typeof WorkflowQueuedControlTargetSchema.Type;
8097
8026
 
8098
8027
  export declare const WorkflowQueuedControlTargetSchema: Schema.Struct<{
8099
- workflowName: typeof Schema.NonEmptyString;
8100
- receiptId: typeof Schema.NonEmptyString;
8101
- requestId: typeof Schema.NonEmptyString;
8028
+ readonly workflowName: Schema.NonEmptyString;
8029
+ readonly receiptId: Schema.NonEmptyString;
8030
+ readonly requestId: Schema.NonEmptyString;
8102
8031
  }>;
8103
8032
 
8104
8033
  export declare type WorkflowRestartCommand = typeof WorkflowRestartCommandSchema.Type;
8105
8034
 
8106
8035
  export declare const WorkflowRestartCommandSchema: Schema.Struct<{
8107
- selection: Schema.Union<[Schema.Struct<{
8108
- kind: Schema.Literal<["failed-steps"]>;
8036
+ readonly selection: Schema.Union<readonly [Schema.Struct<{
8037
+ readonly kind: Schema.Literal<"failed-steps">;
8109
8038
  }>, Schema.Struct<{
8110
- kind: Schema.Literal<["from-step"]>;
8111
- stepName: Schema.filter<typeof Schema.NonEmptyString>;
8039
+ readonly kind: Schema.Literal<"from-step">;
8040
+ readonly stepName: Schema.NonEmptyString;
8112
8041
  }>]>;
8113
- requestId: Schema.filter<Schema.filter<typeof Schema.NonEmptyString>>;
8114
- runId: Schema.filter<typeof Schema.NonEmptyString>;
8042
+ readonly requestId: Schema.NonEmptyString;
8043
+ readonly runId: Schema.NonEmptyString;
8115
8044
  }>;
8116
8045
 
8117
8046
  export declare type WorkflowRestartObservation = typeof WorkflowRestartObservationSchema.Type;
8118
8047
 
8119
8048
  /** Pending is a durable reservation, not proof of reset or engine entry.
8120
8049
  * Entered confirms this command's generation; it does not claim run success. */
8121
- export declare const WorkflowRestartObservationSchema: Schema.Union<[Schema.Struct<{
8122
- kind: Schema.Literal<["not-found"]>;
8123
- requestId: Schema.filter<Schema.filter<typeof Schema.NonEmptyString>>;
8124
- 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;
8125
8054
  }>, Schema.Struct<{
8126
- kind: Schema.Literal<["withdrawn"]>;
8127
- workflowName: Schema.filter<typeof Schema.NonEmptyString>;
8128
- withdrawnAt: Schema.filter<typeof Schema.Number>;
8129
- selection: Schema.Union<[Schema.Struct<{
8130
- 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">;
8131
8060
  }>, Schema.Struct<{
8132
- kind: Schema.Literal<["from-step"]>;
8133
- stepName: Schema.filter<typeof Schema.NonEmptyString>;
8061
+ readonly kind: Schema.Literal<"from-step">;
8062
+ readonly stepName: Schema.NonEmptyString;
8134
8063
  }>]>;
8135
- requestId: Schema.filter<Schema.filter<typeof Schema.NonEmptyString>>;
8136
- runId: Schema.filter<typeof Schema.NonEmptyString>;
8064
+ readonly requestId: Schema.NonEmptyString;
8065
+ readonly runId: Schema.NonEmptyString;
8137
8066
  }>, Schema.Struct<{
8138
- kind: Schema.Literal<["pending"]>;
8139
- workflowName: Schema.filter<typeof Schema.NonEmptyString>;
8140
- executionId: Schema.filter<typeof Schema.NonEmptyString>;
8141
- originalGeneration: Schema.filter<typeof Schema.NonEmptyString>;
8142
- requestedAt: Schema.filter<typeof Schema.Number>;
8143
- dispatchAttempts: Schema.refine<number, typeof Schema.NonNegative>;
8144
- selection: Schema.Union<[Schema.Struct<{
8145
- 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">;
8146
8075
  }>, Schema.Struct<{
8147
- kind: Schema.Literal<["from-step"]>;
8148
- stepName: Schema.filter<typeof Schema.NonEmptyString>;
8076
+ readonly kind: Schema.Literal<"from-step">;
8077
+ readonly stepName: Schema.NonEmptyString;
8149
8078
  }>]>;
8150
- requestId: Schema.filter<Schema.filter<typeof Schema.NonEmptyString>>;
8151
- runId: Schema.filter<typeof Schema.NonEmptyString>;
8152
- }>, Schema.filter<Schema.Struct<{
8153
- kind: Schema.Literal<["entered"]>;
8154
- enteredGeneration: Schema.filter<typeof Schema.NonEmptyString>;
8155
- workflowName: Schema.filter<typeof Schema.NonEmptyString>;
8156
- executionId: Schema.filter<typeof Schema.NonEmptyString>;
8157
- originalGeneration: Schema.filter<typeof Schema.NonEmptyString>;
8158
- requestedAt: Schema.filter<typeof Schema.Number>;
8159
- dispatchAttempts: Schema.refine<number, typeof Schema.NonNegative>;
8160
- selection: Schema.Union<[Schema.Struct<{
8161
- 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">;
8162
8091
  }>, Schema.Struct<{
8163
- kind: Schema.Literal<["from-step"]>;
8164
- stepName: Schema.filter<typeof Schema.NonEmptyString>;
8092
+ readonly kind: Schema.Literal<"from-step">;
8093
+ readonly stepName: Schema.NonEmptyString;
8165
8094
  }>]>;
8166
- requestId: Schema.filter<Schema.filter<typeof Schema.NonEmptyString>>;
8167
- runId: Schema.filter<typeof Schema.NonEmptyString>;
8168
- }>>]>;
8095
+ readonly requestId: Schema.NonEmptyString;
8096
+ readonly runId: Schema.NonEmptyString;
8097
+ }>]>;
8169
8098
 
8170
8099
  export declare type WorkflowRestartResult = typeof WorkflowRestartResultSchema.Type;
8171
8100
 
8172
8101
  /** A refused reservation never reset the journal. Transport failures instead
8173
8102
  * require reading the original target; they are not proof of refusal. */
8174
- export declare const WorkflowRestartResultSchema: Schema.Union<[Schema.Union<[Schema.Struct<{
8175
- kind: Schema.Literal<["not-found"]>;
8176
- requestId: Schema.filter<Schema.filter<typeof Schema.NonEmptyString>>;
8177
- 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;
8178
8107
  }>, Schema.Struct<{
8179
- kind: Schema.Literal<["withdrawn"]>;
8180
- workflowName: Schema.filter<typeof Schema.NonEmptyString>;
8181
- withdrawnAt: Schema.filter<typeof Schema.Number>;
8182
- selection: Schema.Union<[Schema.Struct<{
8183
- 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">;
8184
8113
  }>, Schema.Struct<{
8185
- kind: Schema.Literal<["from-step"]>;
8186
- stepName: Schema.filter<typeof Schema.NonEmptyString>;
8114
+ readonly kind: Schema.Literal<"from-step">;
8115
+ readonly stepName: Schema.NonEmptyString;
8187
8116
  }>]>;
8188
- requestId: Schema.filter<Schema.filter<typeof Schema.NonEmptyString>>;
8189
- runId: Schema.filter<typeof Schema.NonEmptyString>;
8117
+ readonly requestId: Schema.NonEmptyString;
8118
+ readonly runId: Schema.NonEmptyString;
8190
8119
  }>, Schema.Struct<{
8191
- kind: Schema.Literal<["pending"]>;
8192
- workflowName: Schema.filter<typeof Schema.NonEmptyString>;
8193
- executionId: Schema.filter<typeof Schema.NonEmptyString>;
8194
- originalGeneration: Schema.filter<typeof Schema.NonEmptyString>;
8195
- requestedAt: Schema.filter<typeof Schema.Number>;
8196
- dispatchAttempts: Schema.refine<number, typeof Schema.NonNegative>;
8197
- selection: Schema.Union<[Schema.Struct<{
8198
- 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">;
8199
8128
  }>, Schema.Struct<{
8200
- kind: Schema.Literal<["from-step"]>;
8201
- stepName: Schema.filter<typeof Schema.NonEmptyString>;
8129
+ readonly kind: Schema.Literal<"from-step">;
8130
+ readonly stepName: Schema.NonEmptyString;
8202
8131
  }>]>;
8203
- requestId: Schema.filter<Schema.filter<typeof Schema.NonEmptyString>>;
8204
- runId: Schema.filter<typeof Schema.NonEmptyString>;
8205
- }>, Schema.filter<Schema.Struct<{
8206
- kind: Schema.Literal<["entered"]>;
8207
- enteredGeneration: Schema.filter<typeof Schema.NonEmptyString>;
8208
- workflowName: Schema.filter<typeof Schema.NonEmptyString>;
8209
- executionId: Schema.filter<typeof Schema.NonEmptyString>;
8210
- originalGeneration: Schema.filter<typeof Schema.NonEmptyString>;
8211
- requestedAt: Schema.filter<typeof Schema.Number>;
8212
- dispatchAttempts: Schema.refine<number, typeof Schema.NonNegative>;
8213
- selection: Schema.Union<[Schema.Struct<{
8214
- 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">;
8215
8144
  }>, Schema.Struct<{
8216
- kind: Schema.Literal<["from-step"]>;
8217
- stepName: Schema.filter<typeof Schema.NonEmptyString>;
8145
+ readonly kind: Schema.Literal<"from-step">;
8146
+ readonly stepName: Schema.NonEmptyString;
8218
8147
  }>]>;
8219
- requestId: Schema.filter<Schema.filter<typeof Schema.NonEmptyString>>;
8220
- runId: Schema.filter<typeof Schema.NonEmptyString>;
8221
- }>>]>, Schema.Struct<{
8222
- kind: Schema.Literal<["not-reserved"]>;
8223
- reason: Schema.Literal<["admission", "journal"]>;
8224
- requestId: Schema.filter<Schema.filter<typeof Schema.NonEmptyString>>;
8225
- 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;
8226
8155
  }>]>;
8227
8156
 
8228
8157
  export declare type WorkflowRestartSelection = typeof WorkflowRestartSelectionSchema.Type;
8229
8158
 
8230
- export declare const WorkflowRestartSelectionSchema: Schema.Union<[Schema.Struct<{
8231
- kind: Schema.Literal<["failed-steps"]>;
8159
+ export declare const WorkflowRestartSelectionSchema: Schema.Union<readonly [Schema.Struct<{
8160
+ readonly kind: Schema.Literal<"failed-steps">;
8232
8161
  }>, Schema.Struct<{
8233
- kind: Schema.Literal<["from-step"]>;
8234
- stepName: Schema.filter<typeof Schema.NonEmptyString>;
8162
+ readonly kind: Schema.Literal<"from-step">;
8163
+ readonly stepName: Schema.NonEmptyString;
8235
8164
  }>]>;
8236
8165
 
8237
8166
  export declare type WorkflowRestartTarget = typeof WorkflowRestartTargetSchema.Type;
8238
8167
 
8239
8168
  /** Persist before submitting; read this same target after an uncertain reply. */
8240
8169
  export declare const WorkflowRestartTargetSchema: Schema.Struct<{
8241
- requestId: Schema.filter<Schema.filter<typeof Schema.NonEmptyString>>;
8242
- runId: Schema.filter<typeof Schema.NonEmptyString>;
8170
+ readonly requestId: Schema.NonEmptyString;
8171
+ readonly runId: Schema.NonEmptyString;
8243
8172
  }>;
8244
8173
 
8245
8174
  export declare const workflowResumeDescriptor: ActionProcedureDescriptor<"__voltro.workflow.resume", Schema.Struct<{
8246
- workflowName: typeof Schema.String;
8247
- executionId: typeof Schema.String;
8248
- control: Schema.optional<Schema.Struct<{
8249
- requestId: typeof Schema.NonEmptyString;
8250
- cause: Schema.optionalWith<Schema.Struct<{
8251
- reason: typeof Schema.NonEmptyString;
8252
- detail: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
8253
- }>, {
8254
- exact: true;
8255
- }>;
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
+ }>>;
8256
8183
  }>>;
8257
- }>, Schema.filter<Schema.Struct<{
8258
- operation: Schema.Literal<["cancel", "resume"]>;
8259
- kind: Schema.Literal<["accepted", "confirmed", "unknown", "already-terminal"]>;
8260
- requestId: Schema.NullOr<typeof Schema.NonEmptyString>;
8261
- snapshot: Schema.Struct<{
8262
- id: typeof Schema.String;
8263
- workflowName: typeof Schema.String;
8264
- executionId: typeof Schema.String;
8265
- status: Schema.Union<[Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>, Schema.Literal<["unknown"]>]>;
8266
- output: Schema.optional<typeof Schema.Unknown>;
8267
- error: Schema.optional<Schema.Struct<{
8268
- tag: Schema.NullOr<typeof Schema.String>;
8269
- 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;
8270
8197
  }>>;
8271
8198
  }>;
8272
- }>>, typeof Schema.Never>;
8199
+ }>, Schema.Never>;
8273
8200
 
8274
8201
  export declare type WorkflowRetryCommand = typeof WorkflowRetryCommandSchema.Type;
8275
8202
 
8276
8203
  /** Transport input for one deliberate retry; ownership is resolved server-side.
8277
8204
  * The optional override is encoded with the complete workflow payload schema. */
8278
8205
  export declare const WorkflowRetryCommandSchema: Schema.Struct<{
8279
- payloadOverride: Schema.optional<typeof Schema.Unknown>;
8280
- runId: Schema.filter<typeof Schema.NonEmptyString>;
8281
- requestId: Schema.filter<typeof Schema.NonEmptyString>;
8206
+ readonly payloadOverride: Schema.optional<Schema.Unknown>;
8207
+ readonly runId: Schema.NonEmptyString;
8208
+ readonly requestId: Schema.NonEmptyString;
8282
8209
  }>;
8283
8210
 
8284
8211
  export declare type WorkflowRetryObservation = typeof WorkflowRetryObservationSchema.Type;
8285
8212
 
8286
8213
  /** Observation of one durable retry intent. Engine acceptance is not workflow
8287
8214
  * completion. A prepared identity alone never proves that execution started. */
8288
- export declare const WorkflowRetryObservationSchema: Schema.Union<[Schema.Struct<{
8289
- kind: Schema.Literal<["queued"]>;
8290
- nextAttemptAt: Schema.NullOr<typeof Schema.Number>;
8291
- requestId: typeof Schema.NonEmptyString;
8292
- originalRunId: typeof Schema.NonEmptyString;
8293
- originalExecutionId: typeof Schema.NonEmptyString;
8294
- workflowName: typeof Schema.NonEmptyString;
8295
- }>, Schema.filter<Schema.Struct<{
8296
- kind: Schema.Literal<["accepted"]>;
8297
- executionId: typeof Schema.NonEmptyString;
8298
- requestId: typeof Schema.NonEmptyString;
8299
- originalRunId: typeof Schema.NonEmptyString;
8300
- originalExecutionId: typeof Schema.NonEmptyString;
8301
- workflowName: typeof Schema.NonEmptyString;
8302
- }>>, Schema.filter<Schema.Struct<{
8303
- kind: Schema.Literal<["unconfirmed"]>;
8304
- automaticRetryStopped: typeof Schema.Boolean;
8305
- nextAttemptAt: Schema.NullOr<typeof Schema.Number>;
8306
- requestId: typeof Schema.NonEmptyString;
8307
- originalRunId: typeof Schema.NonEmptyString;
8308
- originalExecutionId: typeof Schema.NonEmptyString;
8309
- workflowName: typeof Schema.NonEmptyString;
8310
- }>>, Schema.Struct<{
8311
- kind: Schema.Literal<["not-started"]>;
8312
- outcome: Schema.Union<[Schema.Struct<{
8313
- kind: Schema.Literal<["dropped"]>;
8314
- at: typeof Schema.Number;
8315
- 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;
8316
8243
  }>, Schema.Struct<{
8317
- kind: Schema.Literal<["skipped"]>;
8318
- at: typeof Schema.Number;
8319
- executionId: typeof Schema.String;
8320
- 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;
8321
8248
  }>, Schema.Struct<{
8322
- kind: Schema.Literal<["superseded"]>;
8323
- at: typeof Schema.Number;
8249
+ readonly kind: Schema.Literal<"superseded">;
8250
+ readonly at: Schema.Number;
8324
8251
  }>, Schema.Struct<{
8325
- kind: Schema.Literal<["cancelled"]>;
8326
- at: typeof Schema.Number;
8252
+ readonly kind: Schema.Literal<"cancelled">;
8253
+ readonly at: Schema.Number;
8327
8254
  }>, Schema.Struct<{
8328
- kind: Schema.Literal<["abandoned"]>;
8329
- at: typeof Schema.Number;
8330
- failureId: typeof Schema.NonEmptyString;
8255
+ readonly kind: Schema.Literal<"abandoned">;
8256
+ readonly at: Schema.Number;
8257
+ readonly failureId: Schema.NonEmptyString;
8331
8258
  }>]>;
8332
- requestId: typeof Schema.NonEmptyString;
8333
- originalRunId: typeof Schema.NonEmptyString;
8334
- originalExecutionId: typeof Schema.NonEmptyString;
8335
- workflowName: typeof Schema.NonEmptyString;
8259
+ readonly requestId: Schema.NonEmptyString;
8260
+ readonly originalRunId: Schema.NonEmptyString;
8261
+ readonly originalExecutionId: Schema.NonEmptyString;
8262
+ readonly workflowName: Schema.NonEmptyString;
8336
8263
  }>, Schema.Struct<{
8337
- kind: Schema.Literal<["rejected"]>;
8338
- failureId: typeof Schema.NonEmptyString;
8339
- requestId: typeof Schema.NonEmptyString;
8340
- originalRunId: typeof Schema.NonEmptyString;
8341
- originalExecutionId: typeof Schema.NonEmptyString;
8342
- 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;
8343
8270
  }>]>;
8344
8271
 
8345
8272
  export declare type WorkflowRetryTarget = typeof WorkflowRetryTargetSchema.Type;
8346
8273
 
8347
8274
  /** Persist the request ID before sending. Reuse this target after a lost reply. */
8348
8275
  export declare const WorkflowRetryTargetSchema: Schema.Struct<{
8349
- runId: Schema.filter<typeof Schema.NonEmptyString>;
8350
- requestId: Schema.filter<typeof Schema.NonEmptyString>;
8276
+ readonly runId: Schema.NonEmptyString;
8277
+ readonly requestId: Schema.NonEmptyString;
8351
8278
  }>;
8352
8279
 
8353
8280
  export declare type WorkflowRunEventRow = Schema.Schema.Type<typeof WorkflowRunEventRowSchema>;
8354
8281
 
8355
8282
  export declare const WorkflowRunEventRowSchema: Schema.Struct<{
8356
- id: typeof Schema.String;
8357
- runId: typeof Schema.String;
8358
- eventType: typeof Schema.String;
8359
- payload: Schema.NullOr<typeof Schema.Unknown>;
8360
- occurredAt: typeof Schema.Date;
8361
- stepName: Schema.NullOr<typeof Schema.String>;
8362
- 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>;
8363
8290
  }>;
8364
8291
 
8365
8292
  export declare const workflowRunEventsQueryDescriptor: QueryProcedureDescriptor<"__voltro.workflow.run.events", Schema.Struct<{
8366
8293
  /** `_voltro_workflow_runs.id`; step/event rows reference this id. */
8367
- runId: typeof Schema.String;
8368
- }>, Schema.Array$<Schema.Struct<{
8369
- id: typeof Schema.String;
8370
- runId: typeof Schema.String;
8371
- eventType: typeof Schema.String;
8372
- payload: Schema.NullOr<typeof Schema.Unknown>;
8373
- occurredAt: typeof Schema.Date;
8374
- stepName: Schema.NullOr<typeof Schema.String>;
8375
- attempt: Schema.NullOr<typeof Schema.Number>;
8376
- }>>, 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>;
8377
8304
 
8378
8305
  export declare type WorkflowRunHandle = Schema.Schema.Type<typeof WorkflowRunHandleSchema>;
8379
8306
 
8380
8307
  export declare const WorkflowRunHandleSchema: Schema.Struct<{
8381
8308
  /** Stable handle callers pass to `useWorkflowRun(...)`. The durable execution
8382
8309
  * id for a started run; the durable caller-receipt id for a queued one. */
8383
- id: typeof Schema.String;
8310
+ readonly id: Schema.String;
8384
8311
  /** Workflow tag, e.g. `notes.summarise`. */
8385
- workflowName: typeof Schema.String;
8312
+ readonly workflowName: Schema.String;
8386
8313
  /**
8387
8314
  * Deterministic durable id derived from workflow name + idempotency key.
8388
8315
  *
@@ -8396,7 +8323,7 @@ export declare const WorkflowRunHandleSchema: Schema.Struct<{
8396
8323
  * For a `skipped` singleton it is the INCUMBENT's execution id — a real,
8397
8324
  * pollable run, which is the entire point of `mode: 'skip'`.
8398
8325
  */
8399
- executionId: Schema.NullOr<typeof Schema.String>;
8326
+ readonly executionId: Schema.NullOr<Schema.String>;
8400
8327
  /**
8401
8328
  * `running` — the engine has it; starting is fire-and-return.
8402
8329
  * `succeeded` — a blocking start observed successful completion.
@@ -8412,8 +8339,8 @@ export declare const WorkflowRunHandleSchema: Schema.Struct<{
8412
8339
  * a fresh start; a schedule keyed per day ran once and reported forty-seven
8413
8340
  * "starts" that were replays. See `workflow()`'s `idempotencyKey` doc.
8414
8341
  */
8415
- status: Schema.Literal<["running", "succeeded", "queued", "dropped", "skipped", "replayed"]>;
8416
- deferral: Schema.optional<Schema.Struct<{
8342
+ readonly status: Schema.Literals<readonly ["running", "succeeded", "queued", "dropped", "skipped", "replayed"]>;
8343
+ readonly deferral: Schema.optional<Schema.Struct<{
8417
8344
  /** `debounce` | `batch` | `throttle` | `concurrency` | `paused` |
8418
8345
  * `rateLimit` | `singleton` | `delayed` | `transaction` | `unacknowledged`.
8419
8346
  *
@@ -8421,179 +8348,179 @@ export declare const WorkflowRunHandleSchema: Schema.Struct<{
8421
8348
  * back. The engine may have it; recovery retries the dispatch and binds the
8422
8349
  * receipt (`id`) to whatever run results. It is not a failure: do not
8423
8350
  * report one to a user, follow the receipt. */
8424
- mode: typeof Schema.String;
8351
+ readonly mode: Schema.String;
8425
8352
  /** Epoch ms this may first be admitted. Null for a drop or a skip. */
8426
- dueAt: Schema.NullOr<typeof Schema.Number>;
8353
+ readonly dueAt: Schema.NullOr<Schema.Number>;
8427
8354
  /** How long until the rate window reopens. Null unless dropped. */
8428
- retryAfterMs: Schema.NullOr<typeof Schema.Number>;
8355
+ readonly retryAfterMs: Schema.NullOr<Schema.Number>;
8429
8356
  /** The `_voltro_workflow_pending` row holding this start. Null unless queued. */
8430
- intentId: Schema.NullOr<typeof Schema.String>;
8357
+ readonly intentId: Schema.NullOr<Schema.String>;
8431
8358
  }>>;
8432
8359
  }>;
8433
8360
 
8434
8361
  export declare const workflowRunQueryDescriptor: QueryProcedureDescriptor<"__voltro.workflow.run", Schema.Struct<{
8435
8362
  /** `_voltro_workflow_runs.id` OR durable `executionId`. */
8436
- id: typeof Schema.String;
8437
- }>, Schema.Array$<Schema.Struct<{
8438
- id: typeof Schema.String;
8439
- tag: typeof Schema.String;
8440
- executionId: typeof Schema.String;
8441
- status: Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>;
8442
- payload: typeof Schema.Unknown;
8443
- workflowVersion: Schema.NullOr<typeof Schema.String>;
8444
- workflowPatches: Schema.NullOr<typeof Schema.Unknown>;
8445
- output: Schema.NullOr<typeof Schema.Unknown>;
8446
- subject: Schema.NullOr<typeof Schema.Unknown>;
8447
- source: Schema.NullOr<typeof Schema.String>;
8448
- errorTag: Schema.NullOr<typeof Schema.String>;
8449
- errorMessage: Schema.NullOr<typeof Schema.String>;
8450
- cancelled: typeof Schema.Boolean;
8451
- startedAt: typeof Schema.Date;
8452
- completedAt: Schema.NullOr<typeof Schema.Date>;
8453
- durationMs: Schema.NullOr<typeof Schema.Number>;
8454
- traceId: Schema.NullOr<typeof Schema.String>;
8455
- parentExecutionId: Schema.NullOr<typeof Schema.String>;
8456
- parentClosePolicy: Schema.NullOr<Schema.Literal<["cancel", "terminate", "abandon"]>>;
8457
- }>>, 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>;
8458
8385
 
8459
8386
  export declare const WorkflowRunRefSchema: Schema.Struct<{
8460
8387
  /** `_voltro_workflow_runs.id` OR durable `executionId`. */
8461
- id: typeof Schema.String;
8388
+ readonly id: Schema.String;
8462
8389
  }>;
8463
8390
 
8464
8391
  export declare type WorkflowRunRow = Schema.Schema.Type<typeof WorkflowRunRowSchema>;
8465
8392
 
8466
8393
  export declare const WorkflowRunRowSchema: Schema.Struct<{
8467
- id: typeof Schema.String;
8468
- tag: typeof Schema.String;
8469
- executionId: typeof Schema.String;
8470
- status: Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>;
8471
- payload: typeof Schema.Unknown;
8472
- workflowVersion: Schema.NullOr<typeof Schema.String>;
8473
- workflowPatches: Schema.NullOr<typeof Schema.Unknown>;
8474
- output: Schema.NullOr<typeof Schema.Unknown>;
8475
- subject: Schema.NullOr<typeof Schema.Unknown>;
8476
- source: Schema.NullOr<typeof Schema.String>;
8477
- errorTag: Schema.NullOr<typeof Schema.String>;
8478
- errorMessage: Schema.NullOr<typeof Schema.String>;
8479
- cancelled: typeof Schema.Boolean;
8480
- startedAt: typeof Schema.Date;
8481
- completedAt: Schema.NullOr<typeof Schema.Date>;
8482
- durationMs: Schema.NullOr<typeof Schema.Number>;
8483
- traceId: Schema.NullOr<typeof Schema.String>;
8484
- parentExecutionId: Schema.NullOr<typeof Schema.String>;
8485
- 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"]>>;
8486
8413
  }>;
8487
8414
 
8488
8415
  export declare type WorkflowRunsInput = Schema.Schema.Type<typeof WorkflowRunsInputSchema>;
8489
8416
 
8490
8417
  export declare const WorkflowRunsInputSchema: Schema.Struct<{
8491
- tag: Schema.optional<typeof Schema.String>;
8492
- status: Schema.optional<Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>>;
8493
- 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>;
8494
8421
  }>;
8495
8422
 
8496
8423
  export declare type WorkflowRunSnapshot = Schema.Schema.Type<typeof WorkflowRunSnapshotSchema>;
8497
8424
 
8498
8425
  /** Observed execution state, distinct from admission/start handles. */
8499
8426
  export declare const WorkflowRunSnapshotSchema: Schema.Struct<{
8500
- id: typeof Schema.String;
8501
- workflowName: typeof Schema.String;
8502
- executionId: typeof Schema.String;
8503
- status: Schema.Union<[Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>, Schema.Literal<["unknown"]>]>;
8504
- output: Schema.optional<typeof Schema.Unknown>;
8505
- error: Schema.optional<Schema.Struct<{
8506
- tag: Schema.NullOr<typeof Schema.String>;
8507
- 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;
8508
8435
  }>>;
8509
8436
  }>;
8510
8437
 
8511
8438
  export declare const workflowRunsQueryDescriptor: QueryProcedureDescriptor<"__voltro.workflow.runs", Schema.Struct<{
8512
- tag: Schema.optional<typeof Schema.String>;
8513
- status: Schema.optional<Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>>;
8514
- limit: Schema.optional<typeof Schema.Number>;
8515
- }>, Schema.Array$<Schema.Struct<{
8516
- id: typeof Schema.String;
8517
- tag: typeof Schema.String;
8518
- executionId: typeof Schema.String;
8519
- status: Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>;
8520
- payload: typeof Schema.Unknown;
8521
- workflowVersion: Schema.NullOr<typeof Schema.String>;
8522
- workflowPatches: Schema.NullOr<typeof Schema.Unknown>;
8523
- output: Schema.NullOr<typeof Schema.Unknown>;
8524
- subject: Schema.NullOr<typeof Schema.Unknown>;
8525
- source: Schema.NullOr<typeof Schema.String>;
8526
- errorTag: Schema.NullOr<typeof Schema.String>;
8527
- errorMessage: Schema.NullOr<typeof Schema.String>;
8528
- cancelled: typeof Schema.Boolean;
8529
- startedAt: typeof Schema.Date;
8530
- completedAt: Schema.NullOr<typeof Schema.Date>;
8531
- durationMs: Schema.NullOr<typeof Schema.Number>;
8532
- traceId: Schema.NullOr<typeof Schema.String>;
8533
- parentExecutionId: Schema.NullOr<typeof Schema.String>;
8534
- parentClosePolicy: Schema.NullOr<Schema.Literal<["cancel", "terminate", "abandon"]>>;
8535
- }>>, 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>;
8536
8463
 
8537
8464
  export declare type WorkflowRunStatus = Schema.Schema.Type<typeof WorkflowRunStatusSchema>;
8538
8465
 
8539
- export declare const WorkflowRunStatusSchema: Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>;
8466
+ export declare const WorkflowRunStatusSchema: Schema.Literals<readonly ["running", "succeeded", "failed", "cancelled", "suspended"]>;
8540
8467
 
8541
8468
  export declare type WorkflowRunStepRow = Schema.Schema.Type<typeof WorkflowRunStepRowSchema>;
8542
8469
 
8543
8470
  export declare const WorkflowRunStepRowSchema: Schema.Struct<{
8544
- id: typeof Schema.String;
8545
- runId: typeof Schema.String;
8546
- stepName: typeof Schema.String;
8547
- attempt: typeof Schema.Number;
8548
- status: Schema.Literal<["running", "succeeded", "failed"]>;
8549
- input: Schema.NullOr<typeof Schema.Unknown>;
8550
- retryPolicy: Schema.NullOr<typeof Schema.Unknown>;
8551
- output: Schema.NullOr<typeof Schema.Unknown>;
8552
- errorTag: Schema.NullOr<typeof Schema.String>;
8553
- errorMessage: Schema.NullOr<typeof Schema.String>;
8554
- errorCause: Schema.NullOr<typeof Schema.Unknown>;
8555
- startedAt: typeof Schema.Date;
8556
- completedAt: Schema.NullOr<typeof Schema.Date>;
8557
- 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>;
8558
8485
  }>;
8559
8486
 
8560
8487
  export declare const workflowRunStepsQueryDescriptor: QueryProcedureDescriptor<"__voltro.workflow.run.steps", Schema.Struct<{
8561
8488
  /** `_voltro_workflow_runs.id`; step/event rows reference this id. */
8562
- runId: typeof Schema.String;
8563
- }>, Schema.Array$<Schema.Struct<{
8564
- id: typeof Schema.String;
8565
- runId: typeof Schema.String;
8566
- stepName: typeof Schema.String;
8567
- attempt: typeof Schema.Number;
8568
- status: Schema.Literal<["running", "succeeded", "failed"]>;
8569
- input: Schema.NullOr<typeof Schema.Unknown>;
8570
- retryPolicy: Schema.NullOr<typeof Schema.Unknown>;
8571
- output: Schema.NullOr<typeof Schema.Unknown>;
8572
- errorTag: Schema.NullOr<typeof Schema.String>;
8573
- errorMessage: Schema.NullOr<typeof Schema.String>;
8574
- errorCause: Schema.NullOr<typeof Schema.Unknown>;
8575
- startedAt: typeof Schema.Date;
8576
- completedAt: Schema.NullOr<typeof Schema.Date>;
8577
- durationMs: Schema.NullOr<typeof Schema.Number>;
8578
- }>>, 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>;
8579
8506
 
8580
8507
  export declare const WorkflowRunTableRefSchema: Schema.Struct<{
8581
8508
  /** `_voltro_workflow_runs.id`; step/event rows reference this id. */
8582
- runId: typeof Schema.String;
8509
+ readonly runId: Schema.String;
8583
8510
  }>;
8584
8511
 
8585
8512
  export declare const workflowSignalDescriptor: ActionProcedureDescriptor<"__voltro.workflow.signal", Schema.Struct<{
8586
- id: typeof Schema.String;
8587
- signalName: typeof Schema.String;
8588
- payload: Schema.optional<typeof Schema.Unknown>;
8513
+ readonly id: Schema.String;
8514
+ readonly signalName: Schema.String;
8515
+ readonly payload: Schema.optional<Schema.Unknown>;
8589
8516
  }>, Schema.Struct<{
8590
- eventId: typeof Schema.String;
8591
- }>, typeof Schema.Never>;
8517
+ readonly eventId: Schema.String;
8518
+ }>, Schema.Never>;
8592
8519
 
8593
8520
  export declare const WorkflowSignalInputSchema: Schema.Struct<{
8594
- id: typeof Schema.String;
8595
- signalName: typeof Schema.String;
8596
- payload: Schema.optional<typeof Schema.Unknown>;
8521
+ readonly id: Schema.String;
8522
+ readonly signalName: Schema.String;
8523
+ readonly payload: Schema.optional<Schema.Unknown>;
8597
8524
  }>;
8598
8525
 
8599
8526
  export declare type WorkflowStartDeferral = Schema.Schema.Type<typeof WorkflowStartDeferralSchema>;
@@ -8614,38 +8541,38 @@ export declare const WorkflowStartDeferralSchema: Schema.Struct<{
8614
8541
  * back. The engine may have it; recovery retries the dispatch and binds the
8615
8542
  * receipt (`id`) to whatever run results. It is not a failure: do not
8616
8543
  * report one to a user, follow the receipt. */
8617
- mode: typeof Schema.String;
8544
+ readonly mode: Schema.String;
8618
8545
  /** Epoch ms this may first be admitted. Null for a drop or a skip. */
8619
- dueAt: Schema.NullOr<typeof Schema.Number>;
8546
+ readonly dueAt: Schema.NullOr<Schema.Number>;
8620
8547
  /** How long until the rate window reopens. Null unless dropped. */
8621
- retryAfterMs: Schema.NullOr<typeof Schema.Number>;
8548
+ readonly retryAfterMs: Schema.NullOr<Schema.Number>;
8622
8549
  /** The `_voltro_workflow_pending` row holding this start. Null unless queued. */
8623
- intentId: Schema.NullOr<typeof Schema.String>;
8550
+ readonly intentId: Schema.NullOr<Schema.String>;
8624
8551
  }>;
8625
8552
 
8626
8553
  export declare type WorkflowStartTerminalOutcome = typeof WorkflowStartTerminalOutcomeSchema.Type;
8627
8554
 
8628
8555
  /** A settled admission outcome is not a terminal execution snapshot. In the
8629
8556
  * skipped case the identities belong to the incumbent, not to a new run. */
8630
- export declare const WorkflowStartTerminalOutcomeSchema: Schema.Union<[Schema.Struct<{
8631
- kind: Schema.Literal<["dropped"]>;
8632
- at: typeof Schema.Number;
8633
- 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;
8634
8561
  }>, Schema.Struct<{
8635
- kind: Schema.Literal<["skipped"]>;
8636
- at: typeof Schema.Number;
8637
- executionId: typeof Schema.String;
8638
- 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;
8639
8566
  }>, Schema.Struct<{
8640
- kind: Schema.Literal<["superseded"]>;
8641
- at: typeof Schema.Number;
8567
+ readonly kind: Schema.Literal<"superseded">;
8568
+ readonly at: Schema.Number;
8642
8569
  }>, Schema.Struct<{
8643
- kind: Schema.Literal<["cancelled"]>;
8644
- at: typeof Schema.Number;
8570
+ readonly kind: Schema.Literal<"cancelled">;
8571
+ readonly at: Schema.Number;
8645
8572
  }>, Schema.Struct<{
8646
- kind: Schema.Literal<["abandoned"]>;
8647
- at: typeof Schema.Number;
8648
- failureId: typeof Schema.NonEmptyString;
8573
+ readonly kind: Schema.Literal<"abandoned">;
8574
+ readonly at: Schema.Number;
8575
+ readonly failureId: Schema.NonEmptyString;
8649
8576
  }>]>;
8650
8577
 
8651
8578
  /**
@@ -8659,7 +8586,7 @@ export declare const WorkflowStartTerminalOutcomeSchema: Schema.Union<[Schema.St
8659
8586
  * step-level retry-policy override, step-level resource scoping,
8660
8587
  * external observability injection.
8661
8588
  *
8662
- * The interceptor runs INSIDE `@effect/workflow`'s replay logic —
8589
+ * The interceptor runs INSIDE `effect/workflow`'s replay logic —
8663
8590
  * on a workflow resume, the framework replays cached Activity
8664
8591
  * outputs without re-running the user effect, and the interceptor
8665
8592
  * is bypassed on replay (only fires on the first execution).
@@ -8689,16 +8616,16 @@ export declare type WorkflowStepInterceptor = <Success, ErrorE, R>(next: Effect.
8689
8616
  * error union with `ScopeError` / `Unauthenticated`, exactly as it does for a
8690
8617
  * mutation, and labels the strict-input refusal as a guarded procedure's.
8691
8618
  */
8692
- 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: {
8693
8620
  readonly name: Name;
8694
8621
  readonly payloadSchema: Payload;
8695
- readonly errorSchema: Schema.Schema.All;
8622
+ readonly errorSchema: Schema.Top;
8696
8623
  }, extraErrors?: ExtraErrors) => Rpc.Rpc<Name, Payload extends Schema.Struct.Fields ? Schema.Struct<Payload> : Payload, Schema.Struct<{
8697
8624
  /** Stable handle callers pass to `useWorkflowRun(...)`. The durable execution
8698
8625
  * id for a started run; the durable caller-receipt id for a queued one. */
8699
- id: typeof Schema.String;
8626
+ readonly id: Schema.String;
8700
8627
  /** Workflow tag, e.g. `notes.summarise`. */
8701
- workflowName: typeof Schema.String;
8628
+ readonly workflowName: Schema.String;
8702
8629
  /**
8703
8630
  * Deterministic durable id derived from workflow name + idempotency key.
8704
8631
  *
@@ -8712,7 +8639,7 @@ export declare const workflowToRpc: <const Name extends string, Payload extends
8712
8639
  * For a `skipped` singleton it is the INCUMBENT's execution id — a real,
8713
8640
  * pollable run, which is the entire point of `mode: 'skip'`.
8714
8641
  */
8715
- executionId: Schema.NullOr<typeof Schema.String>;
8642
+ readonly executionId: Schema.NullOr<Schema.String>;
8716
8643
  /**
8717
8644
  * `running` — the engine has it; starting is fire-and-return.
8718
8645
  * `succeeded` — a blocking start observed successful completion.
@@ -8728,8 +8655,8 @@ export declare const workflowToRpc: <const Name extends string, Payload extends
8728
8655
  * a fresh start; a schedule keyed per day ran once and reported forty-seven
8729
8656
  * "starts" that were replays. See `workflow()`'s `idempotencyKey` doc.
8730
8657
  */
8731
- status: Schema.Literal<["running", "succeeded", "queued", "dropped", "skipped", "replayed"]>;
8732
- deferral: Schema.optional<Schema.Struct<{
8658
+ readonly status: Schema.Literals<readonly ["running", "succeeded", "queued", "dropped", "skipped", "replayed"]>;
8659
+ readonly deferral: Schema.optional<Schema.Struct<{
8733
8660
  /** `debounce` | `batch` | `throttle` | `concurrency` | `paused` |
8734
8661
  * `rateLimit` | `singleton` | `delayed` | `transaction` | `unacknowledged`.
8735
8662
  *
@@ -8737,42 +8664,42 @@ export declare const workflowToRpc: <const Name extends string, Payload extends
8737
8664
  * back. The engine may have it; recovery retries the dispatch and binds the
8738
8665
  * receipt (`id`) to whatever run results. It is not a failure: do not
8739
8666
  * report one to a user, follow the receipt. */
8740
- mode: typeof Schema.String;
8667
+ readonly mode: Schema.String;
8741
8668
  /** Epoch ms this may first be admitted. Null for a drop or a skip. */
8742
- dueAt: Schema.NullOr<typeof Schema.Number>;
8669
+ readonly dueAt: Schema.NullOr<Schema.Number>;
8743
8670
  /** How long until the rate window reopens. Null unless dropped. */
8744
- retryAfterMs: Schema.NullOr<typeof Schema.Number>;
8671
+ readonly retryAfterMs: Schema.NullOr<Schema.Number>;
8745
8672
  /** The `_voltro_workflow_pending` row holding this start. Null unless queued. */
8746
- intentId: Schema.NullOr<typeof Schema.String>;
8673
+ readonly intentId: Schema.NullOr<Schema.String>;
8747
8674
  }>>;
8748
- }>, Schema.Schema.All, never>;
8675
+ }>, Schema.Top, never, never>;
8749
8676
 
8750
8677
  export declare const workflowUpdateDescriptor: ActionProcedureDescriptor<"__voltro.workflow.update", Schema.Struct<{
8751
- id: typeof Schema.String;
8752
- updateName: typeof Schema.String;
8753
- payload: Schema.optional<typeof Schema.Unknown>;
8754
- 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>;
8755
8682
  }>, Schema.Struct<{
8756
- eventId: typeof Schema.String;
8757
- updateId: typeof Schema.String;
8758
- completedEventId: typeof Schema.String;
8759
- result: typeof Schema.Unknown;
8760
- }>, 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>;
8761
8688
 
8762
8689
  export declare const WorkflowUpdateInputSchema: Schema.Struct<{
8763
- id: typeof Schema.String;
8764
- updateName: typeof Schema.String;
8765
- payload: Schema.optional<typeof Schema.Unknown>;
8766
- 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>;
8767
8694
  }>;
8768
8695
 
8769
8696
  export declare type WorkflowUpdateResult = Schema.Schema.Type<typeof WorkflowUpdateResultSchema>;
8770
8697
 
8771
8698
  export declare const WorkflowUpdateResultSchema: Schema.Struct<{
8772
- eventId: typeof Schema.String;
8773
- updateId: typeof Schema.String;
8774
- completedEventId: typeof Schema.String;
8775
- result: typeof Schema.Unknown;
8699
+ readonly eventId: Schema.String;
8700
+ readonly updateId: Schema.String;
8701
+ readonly completedEventId: Schema.String;
8702
+ readonly result: Schema.Unknown;
8776
8703
  }>;
8777
8704
 
8778
8705
  /**
@@ -8786,9 +8713,9 @@ export declare const WorkflowUpdateResultSchema: Schema.Struct<{
8786
8713
  * `ExitEncoded` defect tree a mutation used to ship for the same reason.
8787
8714
  */
8788
8715
  export declare const workflowWireErrorUnion: (workflow: {
8789
- readonly errorSchema: Schema.Schema.All;
8716
+ readonly errorSchema: Schema.Top;
8790
8717
  readonly guards?: DeclaredAccess | undefined;
8791
- }, extraErrors?: ExtraErrors) => Schema.Schema.All;
8718
+ }, extraErrors?: ExtraErrors) => Schema.Top;
8792
8719
 
8793
8720
  /**
8794
8721
  * Scope for a WS-rpc MUTATION. Unlike the REST scope (tenant + method + path),