@voltro/protocol 0.84.0 → 0.86.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.
Files changed (65) hide show
  1. package/CHANGELOG.md +1215 -0
  2. package/README.md +14 -0
  3. package/THIRD-PARTY-NOTICES.md +5 -89
  4. package/dist/apikey.d.ts +32 -34
  5. package/dist/approval.js +64 -0
  6. package/dist/approvalDescriptors.js +26 -0
  7. package/dist/auth.js +369 -0
  8. package/dist/boundedRing.js +27 -0
  9. package/dist/businessRule.js +11 -0
  10. package/dist/connection.js +73 -0
  11. package/dist/devActivity.js +4 -0
  12. package/dist/errorValue.js +21 -0
  13. package/dist/event.js +104 -0
  14. package/dist/idempotency.js +66 -0
  15. package/dist/identity.js +5 -9
  16. package/dist/index.d.ts +1494 -1366
  17. package/dist/index.js +42 -1411
  18. package/dist/inspect.d.ts +88 -88
  19. package/dist/inspect.js +14 -190
  20. package/dist/inspectBackfill.js +52 -0
  21. package/dist/inspectCommandRejection.js +21 -0
  22. package/dist/inspectProjection.js +133 -0
  23. package/dist/inspectStorageProjection.js +86 -0
  24. package/dist/inspectValueIdentity.js +4 -0
  25. package/dist/inspectWorkflowExecution.js +34 -0
  26. package/dist/inspectWorkflowQueuedStart.js +31 -0
  27. package/dist/jsonSchema.js +54 -0
  28. package/dist/jwt.d.ts +32 -34
  29. package/dist/outbox.js +10 -0
  30. package/dist/pairing.js +75 -0
  31. package/dist/plugin.js +61 -0
  32. package/dist/pluginNaming.js +32 -0
  33. package/dist/procedure.js +262 -0
  34. package/dist/publicApi.js +344 -0
  35. package/dist/reactivityChannel.js +34 -0
  36. package/dist/rest.d.ts +105 -57
  37. package/dist/rest.js +259 -437
  38. package/dist/restFormat.js +163 -0
  39. package/dist/rowEquality.js +31 -0
  40. package/dist/rowPatch.js +182 -0
  41. package/dist/schemaShape.js +67 -0
  42. package/dist/scopes.js +240 -0
  43. package/dist/serverErrorBus.js +15 -0
  44. package/dist/serviceCall.js +14 -0
  45. package/dist/session.d.ts +90 -96
  46. package/dist/session.js +13 -15
  47. package/dist/{sessionHeader-DriTZhmv.js → sessionHeader.js} +1 -1
  48. package/dist/storageAccess.js +14 -0
  49. package/dist/storeErrors.js +66 -0
  50. package/dist/storeScreenshots.js +90 -0
  51. package/dist/strictInput.js +27 -0
  52. package/dist/subscriptionEvent.js +37 -0
  53. package/dist/tenantSelection.js +40 -0
  54. package/dist/time.js +7 -0
  55. package/dist/undo.js +38 -0
  56. package/dist/validation.js +39 -0
  57. package/dist/webSocketGateway.js +10 -0
  58. package/dist/workflow.js +297 -0
  59. package/dist/workflowAccess.js +61 -0
  60. package/dist/workflowRestart.js +45 -0
  61. package/dist/workflowRetry.js +44 -0
  62. package/dist/workflowStartOutcome.js +30 -0
  63. package/package.json +4 -8
  64. package/dist/restFormat-EZ8k9ZcQ.js +0 -304
  65. package/dist/scopes-Di756ENh.js +0 -518
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
@@ -558,7 +546,7 @@ export declare interface AuthenticatedGuardSpec {
558
546
  * an auth resolver before reaching its handler. The application provides
559
547
  * the resolver via `Layer.succeed(AuthMiddleware, AuthMiddleware.of(fn))`,
560
548
  * where `fn` receives `{headers, payload, rpc, clientId}` and returns an
561
- * `Effect<Subject, Unauthenticated>` — typically by inspecting headers / Bearer token and
549
+ * `Effect<Subject, Unauthenticated | RequestedTenantRefused>` — typically by inspecting headers / Bearer token and
562
550
  * looking the caller up.
563
551
  *
564
552
  * `provides: SubjectService` means the resolver's return value is placed
@@ -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, Schema.Union<readonly [typeof Unauthenticated, typeof RequestedTenantRefused]>, never, never, false>;
581
566
 
582
567
  export declare type AuthRouteHandler = (req: AuthRouteRequest) => Promise<AuthRouteResponse>;
583
568
 
@@ -741,6 +726,26 @@ 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
+ /** Bind a process-local authority refresh to an independent subject snapshot.
730
+ * Neither the resolver nor its credentials become serializable subject fields.
731
+ * Request and durable-execution hosts use the same identity-preserving refresh. */
732
+ export declare const bindSubjectAuthority: (subject: Subject, resolve: () => Promise<Subject>) => Subject;
733
+
734
+ /** Bounded insertion-order storage. Appending overwrites one slot when full;
735
+ * reads never expose its circular physical order or retained array. */
736
+ export declare class BoundedRing<T> implements Iterable<T> {
737
+ private readonly slots;
738
+ private head;
739
+ private size;
740
+ private readonly capacity;
741
+ constructor(capacity: number);
742
+ get length(): number;
743
+ get(index: number): T | undefined;
744
+ push(value: T): void;
745
+ clear(): void;
746
+ [Symbol.iterator](): IterableIterator<T>;
747
+ }
748
+
744
749
  /**
745
750
  * A cross-table business rule was violated inside a mutation's transaction; the
746
751
  * write was rolled back.
@@ -754,15 +759,13 @@ export declare const beginIdempotent: (store: IdempotencyStore, scope: string, k
754
759
  export declare class BusinessRuleViolation extends BusinessRuleViolation_base {
755
760
  }
756
761
 
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
- }>;
762
+ declare const BusinessRuleViolation_base: Schema.Class<BusinessRuleViolation, Schema.TaggedStruct<"BusinessRuleViolation", {
763
+ readonly rule: Schema.String;
764
+ readonly params: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
765
+ readonly field: Schema.optional<Schema.String>;
766
+ readonly message: Schema.optional<Schema.String>;
767
+ readonly severity: Schema.Literals<readonly ["error", "warning"]>;
768
+ }>, YieldableError>;
766
769
 
767
770
  /** The result of a cached resolution. `fresh` distinguishes a resolution that
768
771
  * actually ran from a replayed verdict — the audit hook fires on the former
@@ -811,7 +814,10 @@ export declare const checkGuards: (subject: Subject, guards: ReadonlyArray<AnyCh
811
814
  * guard has a `resource`, it extracts the resource id from `input` and asks the
812
815
  * resolver whether the caller holds each scope on THAT resource. A globally-held
813
816
  * scope (or the `admin:full` bypass) still satisfies without a resolver call;
814
- * only the gap ("no global grant") falls through to the resolver. A failed
817
+ * only the gap ("no global grant") falls through to the resolver. A guard with
818
+ * `resourceOnly: true` always requires the resource resolver's verdict, even
819
+ * for globally-held scopes or `admin:full`, and refuses if its resource or
820
+ * resolver is unavailable. A failed
815
821
  * resolver Effect is treated as a denial (fail-closed).
816
822
  *
817
823
  * Returns a typed `ScopeError` naming the first unmet scope, or `null` when
@@ -839,11 +845,11 @@ export declare interface ClientDescriptor {
839
845
  * UI (forms, query-bound pickers) and the capability map can introspect
840
846
  * it with no extra fetch. Browser-safe: the schema is already loaded
841
847
  * value-level via the rpc group, so this is the same object by reference. */
842
- readonly input?: Schema.Schema.Any | undefined;
848
+ readonly input?: Schema.Top | undefined;
843
849
  /** The procedure's output `Schema` — carried so schema-driven tables
844
850
  * (`<DataTable>` derives its columns from it) + the capability map can
845
851
  * introspect it. Same browser-safety rationale as `input`. */
846
- readonly output?: Schema.Schema.Any | undefined;
852
+ readonly output?: Schema.Top | undefined;
847
853
  }
848
854
 
849
855
  /**
@@ -895,15 +901,15 @@ export declare const composeAuthStrategies: (strategies: ReadonlyArray<AuthStrat
895
901
  /** What an unauthenticated caller is — see {@link AnonymousPolicy}.
896
902
  * Default `'no-tenant'`. Ignored when `fallback` is supplied. */
897
903
  readonly anonymous?: AnonymousPolicyOrDevTenant;
898
- /**
899
- * The subject's memberships — the ONE source, strategy-independent. Read
900
- * only when a stored tenant selection exists for the subject and names a
901
- * tenant other than the credential's, and then on every such request: a
902
- * membership revoked a moment ago must not keep a selection alive, and a
903
- * switch made a moment ago must be visible on the next call, so there is
904
- * no staleness window to configure here. Requires `tenantSelection`.
905
- */
904
+ /** Fresh strategy-independent memberships. Explicit requested tenants are
905
+ * checked on every resolution, including the credential tenant. Stored
906
+ * selections read memberships only when they differ from the credential.
907
+ * Requires `tenantSelection` or `requestedTenant`. */
906
908
  readonly memberships?: MembershipsSource;
909
+ /** Request-local tenant hint, checked against fresh `memberships` before
910
+ * scopes and guards. Explicit targets bypass the stored selection without
911
+ * changing it. Invalid hints fail closed, never fall back. */
912
+ readonly requestedTenant?: RequestedTenantSource;
907
913
  /**
908
914
  * Where a subject's tenant selection is stored. Read for every matched
909
915
  * user / apiKey / serviceAccount subject (one point lookup); a stored
@@ -1044,33 +1050,32 @@ export declare interface ConnectionCredential {
1044
1050
  * for this connection. Deletes the row; the provider-side grant (if any) is
1045
1051
  * the provider's to revoke. */
1046
1052
  export declare const connectionDisconnectDescriptor: MutationProcedureDescriptor<"__voltro.connections.disconnect", Schema.Struct<{
1047
- connectionId: typeof Schema.String;
1053
+ readonly connectionId: Schema.String;
1048
1054
  }>, Schema.Struct<{
1049
- ok: typeof Schema.Boolean;
1050
- }>, Schema.Union<[typeof ConnectionNotDeclared, typeof ConnectionSubjectRequired, typeof ConnectionKindMismatch, typeof ConnectionHandshakeFailed]>>;
1055
+ readonly ok: Schema.Boolean;
1056
+ }>, Schema.Union<readonly [typeof ConnectionNotDeclared, typeof ConnectionSubjectRequired, typeof ConnectionKindMismatch, typeof ConnectionHandshakeFailed]>>;
1051
1057
 
1052
1058
  /** The provider rejected the token / the handshake failed. `transient`
1053
1059
  * distinguishes "try again" from "the user must re-consent". */
1054
1060
  export declare class ConnectionHandshakeFailed extends ConnectionHandshakeFailed_base {
1061
+ get message(): string;
1055
1062
  }
1056
1063
 
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
- }>;
1064
+ declare const ConnectionHandshakeFailed_base: Schema.Class<ConnectionHandshakeFailed, Schema.TaggedStruct<"ConnectionHandshakeFailed", {
1065
+ readonly connectionId: Schema.String;
1066
+ readonly reason: Schema.String;
1067
+ readonly transient: Schema.Boolean;
1068
+ }>, YieldableError>;
1064
1069
 
1065
1070
  export declare class ConnectionInfo extends ConnectionInfo_base {
1066
1071
  }
1067
1072
 
1068
- declare const ConnectionInfo_base: Context.TagClass<ConnectionInfo, "@voltro/ConnectionInfo", ConnectionInfoValue>;
1073
+ declare const ConnectionInfo_base: Context.ServiceClass<ConnectionInfo, "@voltro/ConnectionInfo", ConnectionInfoValue>;
1069
1074
 
1070
1075
  /**
1071
1076
  * Second middleware on every RpcGroup that wants the
1072
1077
  * `ConnectionInfo` service available to handlers. Resolves from the
1073
- * per-call `{clientId}` the @effect/rpc transport passes in. Handlers
1078
+ * per-call `{clientId}` the `effect/rpc` transport passes in. Handlers
1074
1079
  * that re-bind the connection's subject (e.g. `auth.signin` writing
1075
1080
  * an override after a successful credential check) read clientId
1076
1081
  * from this service.
@@ -1082,9 +1087,7 @@ declare const ConnectionInfo_base: Context.TagClass<ConnectionInfo, "@voltro/Con
1082
1087
  export declare class ConnectionInfoMiddleware extends ConnectionInfoMiddleware_base {
1083
1088
  }
1084
1089
 
1085
- declare const ConnectionInfoMiddleware_base: RpcMiddleware.TagClass<ConnectionInfoMiddleware, "@voltro/ConnectionInfoMiddleware", {
1086
- readonly provides: typeof ConnectionInfo;
1087
- }>;
1090
+ declare const ConnectionInfoMiddleware_base: RpcMiddleware.ServiceClass<ConnectionInfoMiddleware, "@voltro/ConnectionInfoMiddleware", ConnectionInfo, Schema.Never, never, never, false>;
1088
1091
 
1089
1092
  export declare interface ConnectionInfoValue {
1090
1093
  /** Per-connection identifier assigned by the rpc transport. Stable for the
@@ -1135,7 +1138,7 @@ export declare interface ConnectionInfoValue {
1135
1138
  /** The two credential shapes a connection can hold. `oauth2` = an
1136
1139
  * authorization-code grant the framework refreshes; `pat` = a long-lived
1137
1140
  * personal token the user pastes and the framework only stores. */
1138
- export declare const ConnectionKind: Schema.Literal<["oauth2", "pat"]>;
1141
+ export declare const ConnectionKind: Schema.Literals<readonly ["oauth2", "pat"]>;
1139
1142
 
1140
1143
  export declare type ConnectionKind = Schema.Schema.Type<typeof ConnectionKind>;
1141
1144
 
@@ -1145,23 +1148,19 @@ export declare type ConnectionKind = Schema.Schema.Type<typeof ConnectionKind>;
1145
1148
  export declare class ConnectionKindMismatch extends ConnectionKindMismatch_base {
1146
1149
  }
1147
1150
 
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
- }>;
1151
+ declare const ConnectionKindMismatch_base: Schema.Class<ConnectionKindMismatch, Schema.TaggedStruct<"ConnectionKindMismatch", {
1152
+ readonly connectionId: Schema.String;
1153
+ readonly expected: Schema.Literals<readonly ["oauth2", "pat"]>;
1154
+ readonly actual: Schema.Literals<readonly ["oauth2", "pat"]>;
1155
+ }>, YieldableError>;
1155
1156
 
1156
1157
  /** No connection with that id is declared in the app (no `*.connection.ts`). */
1157
1158
  export declare class ConnectionNotDeclared extends ConnectionNotDeclared_base {
1158
1159
  }
1159
1160
 
1160
- declare const ConnectionNotDeclared_base: Schema.TaggedErrorClass<ConnectionNotDeclared, "ConnectionNotDeclared", {
1161
- readonly _tag: Schema.tag<"ConnectionNotDeclared">;
1162
- } & {
1163
- connectionId: typeof Schema.String;
1164
- }>;
1161
+ declare const ConnectionNotDeclared_base: Schema.Class<ConnectionNotDeclared, Schema.TaggedStruct<"ConnectionNotDeclared", {
1162
+ readonly connectionId: Schema.String;
1163
+ }>, YieldableError>;
1165
1164
 
1166
1165
  export declare const CONNECTIONS_LIST_TAG: "__voltro.connections.list";
1167
1166
 
@@ -1174,26 +1173,26 @@ export declare const CONNECTIONS_LIST_TAG: "__voltro.connections.list";
1174
1173
  * comes back `status: 'disconnected'`. A UI can therefore render the whole
1175
1174
  * "connected accounts" settings page from this one subscription.
1176
1175
  */
1177
- export declare const connectionsListQueryDescriptor: QueryProcedureDescriptor<"__voltro.connections.list", Schema.Struct<{}>, Schema.Array$<Schema.Struct<{
1176
+ export declare const connectionsListQueryDescriptor: QueryProcedureDescriptor<"__voltro.connections.list", Schema.Struct<{}>, Schema.$Array<Schema.Struct<{
1178
1177
  /** The `defineConnection({ id })` value. */
1179
- connectionId: typeof Schema.String;
1180
- kind: Schema.Literal<["oauth2", "pat"]>;
1178
+ readonly connectionId: Schema.String;
1179
+ readonly kind: Schema.Literals<readonly ["oauth2", "pat"]>;
1181
1180
  /** Human label from the declaration; falls back to the id. */
1182
- label: typeof Schema.String;
1183
- status: Schema.Literal<["disconnected", "connected", "expired", "revoked", "error"]>;
1181
+ readonly label: Schema.String;
1182
+ readonly status: Schema.Literals<readonly ["disconnected", "connected", "expired", "revoked", "error"]>;
1184
1183
  /** Provider-side account identifier, when the declaration could resolve one. */
1185
- accountId: Schema.NullOr<typeof Schema.String>;
1184
+ readonly accountId: Schema.NullOr<Schema.String>;
1186
1185
  /** Display name for the connected account ("mario@example.com"). */
1187
- accountLabel: Schema.NullOr<typeof Schema.String>;
1186
+ readonly accountLabel: Schema.NullOr<Schema.String>;
1188
1187
  /** Granted scopes (oauth2); empty for pat. */
1189
- scopes: Schema.Array$<typeof Schema.String>;
1188
+ readonly scopes: Schema.$Array<Schema.String>;
1190
1189
  /** Access-token deadline as an ISO string, or null (pat / no expiry). */
1191
- expiresAt: Schema.NullOr<typeof Schema.String>;
1190
+ readonly expiresAt: Schema.NullOr<Schema.String>;
1192
1191
  /** Last refresh failure message, when `status` is `error` / `revoked`. */
1193
- lastError: Schema.NullOr<typeof Schema.String>;
1192
+ readonly lastError: Schema.NullOr<Schema.String>;
1194
1193
  /** When the credential was first stored, ISO. Null while disconnected. */
1195
- connectedAt: Schema.NullOr<typeof Schema.String>;
1196
- }>>, typeof Schema.Never>;
1194
+ readonly connectedAt: Schema.NullOr<Schema.String>;
1195
+ }>>, Schema.Never>;
1197
1196
 
1198
1197
  /**
1199
1198
  * `__voltro.connections.start` — begin an oauth2 handshake. Returns the
@@ -1202,36 +1201,36 @@ export declare const connectionsListQueryDescriptor: QueryProcedureDescriptor<"_
1202
1201
  * and talks to no domain table, so it must not be optimistic-patched.
1203
1202
  */
1204
1203
  export declare const connectionStartDescriptor: ActionProcedureDescriptor<"__voltro.connections.start", Schema.Struct<{
1205
- connectionId: typeof Schema.String;
1204
+ readonly connectionId: Schema.String;
1206
1205
  /** Where the callback should send the browser once the handshake lands.
1207
1206
  * Same-origin PATH only (validated server-side) — an absolute URL would
1208
1207
  * make the callback an open redirector. */
1209
- redirectTo: Schema.optional<typeof Schema.String>;
1208
+ readonly redirectTo: Schema.optional<Schema.String>;
1210
1209
  }>, Schema.Struct<{
1211
- authorizeUrl: typeof Schema.String;
1212
- state: typeof Schema.String;
1213
- }>, Schema.Union<[typeof ConnectionNotDeclared, typeof ConnectionSubjectRequired, typeof ConnectionKindMismatch, typeof ConnectionHandshakeFailed]>>;
1210
+ readonly authorizeUrl: Schema.String;
1211
+ readonly state: Schema.String;
1212
+ }>, Schema.Union<readonly [typeof ConnectionNotDeclared, typeof ConnectionSubjectRequired, typeof ConnectionKindMismatch, typeof ConnectionHandshakeFailed]>>;
1214
1213
 
1215
1214
  /** One declared connection, projected for the calling subject. */
1216
1215
  export declare const ConnectionState: Schema.Struct<{
1217
1216
  /** The `defineConnection({ id })` value. */
1218
- connectionId: typeof Schema.String;
1219
- kind: Schema.Literal<["oauth2", "pat"]>;
1217
+ readonly connectionId: Schema.String;
1218
+ readonly kind: Schema.Literals<readonly ["oauth2", "pat"]>;
1220
1219
  /** Human label from the declaration; falls back to the id. */
1221
- label: typeof Schema.String;
1222
- status: Schema.Literal<["disconnected", "connected", "expired", "revoked", "error"]>;
1220
+ readonly label: Schema.String;
1221
+ readonly status: Schema.Literals<readonly ["disconnected", "connected", "expired", "revoked", "error"]>;
1223
1222
  /** Provider-side account identifier, when the declaration could resolve one. */
1224
- accountId: Schema.NullOr<typeof Schema.String>;
1223
+ readonly accountId: Schema.NullOr<Schema.String>;
1225
1224
  /** Display name for the connected account ("mario@example.com"). */
1226
- accountLabel: Schema.NullOr<typeof Schema.String>;
1225
+ readonly accountLabel: Schema.NullOr<Schema.String>;
1227
1226
  /** Granted scopes (oauth2); empty for pat. */
1228
- scopes: Schema.Array$<typeof Schema.String>;
1227
+ readonly scopes: Schema.$Array<Schema.String>;
1229
1228
  /** Access-token deadline as an ISO string, or null (pat / no expiry). */
1230
- expiresAt: Schema.NullOr<typeof Schema.String>;
1229
+ readonly expiresAt: Schema.NullOr<Schema.String>;
1231
1230
  /** Last refresh failure message, when `status` is `error` / `revoked`. */
1232
- lastError: Schema.NullOr<typeof Schema.String>;
1231
+ readonly lastError: Schema.NullOr<Schema.String>;
1233
1232
  /** When the credential was first stored, ISO. Null while disconnected. */
1234
- connectedAt: Schema.NullOr<typeof Schema.String>;
1233
+ readonly connectedAt: Schema.NullOr<Schema.String>;
1235
1234
  }>;
1236
1235
 
1237
1236
  export declare type ConnectionState = Schema.Schema.Type<typeof ConnectionState>;
@@ -1251,7 +1250,7 @@ export declare type ConnectionState = Schema.Schema.Type<typeof ConnectionState>
1251
1250
  * - `error` — the last refresh failed transiently (5xx / network).
1252
1251
  * The tokens are retained and the next use retries.
1253
1252
  */
1254
- export declare const ConnectionStatus: Schema.Literal<["disconnected", "connected", "expired", "revoked", "error"]>;
1253
+ export declare const ConnectionStatus: Schema.Literals<readonly ["disconnected", "connected", "expired", "revoked", "error"]>;
1255
1254
 
1256
1255
  export declare type ConnectionStatus = Schema.Schema.Type<typeof ConnectionStatus>;
1257
1256
 
@@ -1260,22 +1259,20 @@ export declare type ConnectionStatus = Schema.Schema.Type<typeof ConnectionStatu
1260
1259
  export declare class ConnectionSubjectRequired extends ConnectionSubjectRequired_base {
1261
1260
  }
1262
1261
 
1263
- declare const ConnectionSubjectRequired_base: Schema.TaggedErrorClass<ConnectionSubjectRequired, "ConnectionSubjectRequired", {
1264
- readonly _tag: Schema.tag<"ConnectionSubjectRequired">;
1265
- } & {
1266
- connectionId: typeof Schema.String;
1267
- }>;
1262
+ declare const ConnectionSubjectRequired_base: Schema.Class<ConnectionSubjectRequired, Schema.TaggedStruct<"ConnectionSubjectRequired", {
1263
+ readonly connectionId: Schema.String;
1264
+ }>, YieldableError>;
1268
1265
 
1269
1266
  /**
1270
1267
  * `__voltro.connections.submitToken` — store a pasted personal access token.
1271
1268
  * A mutation (it writes the credential row) targeting no user table.
1272
1269
  */
1273
1270
  export declare const connectionSubmitTokenDescriptor: MutationProcedureDescriptor<"__voltro.connections.submitToken", Schema.Struct<{
1274
- connectionId: typeof Schema.String;
1275
- token: typeof Schema.String;
1271
+ readonly connectionId: Schema.String;
1272
+ readonly token: Schema.String;
1276
1273
  }>, Schema.Struct<{
1277
- ok: typeof Schema.Boolean;
1278
- }>, Schema.Union<[typeof ConnectionNotDeclared, typeof ConnectionSubjectRequired, typeof ConnectionKindMismatch, typeof ConnectionHandshakeFailed]>>;
1274
+ readonly ok: Schema.Boolean;
1275
+ }>, Schema.Union<readonly [typeof ConnectionNotDeclared, typeof ConnectionSubjectRequired, typeof ConnectionKindMismatch, typeof ConnectionHandshakeFailed]>>;
1279
1276
 
1280
1277
  /**
1281
1278
  * The database refused a write because it broke an integrity rule the SCHEMA
@@ -1315,24 +1312,22 @@ export declare class ConstraintViolation extends ConstraintViolation_base {
1315
1312
  get message(): string;
1316
1313
  }
1317
1314
 
1318
- declare const ConstraintViolation_base: Schema.TaggedErrorClass<ConstraintViolation, "ConstraintViolation", {
1319
- readonly _tag: Schema.tag<"ConstraintViolation">;
1320
- } & {
1315
+ declare const ConstraintViolation_base: Schema.Class<ConstraintViolation, Schema.TaggedStruct<"ConstraintViolation", {
1321
1316
  /**
1322
1317
  * Which rule fired. `foreignKey` = the row you referenced does not exist;
1323
1318
  * `foreignKeyInUse` = this row may not go, others still reference it. They
1324
1319
  * are opposite situations with opposite fixes, so a UI branches on them
1325
1320
  * separately.
1326
1321
  */
1327
- kind: Schema.Literal<["foreignKey", "foreignKeyInUse", "unique", "notNull", "check"]>;
1322
+ readonly kind: Schema.Literals<readonly ["foreignKey", "foreignKeyInUse", "unique", "notNull", "check"]>;
1328
1323
  /** The table the write targeted — the framework's own name for it, not the driver's. */
1329
- table: typeof Schema.String;
1324
+ readonly table: Schema.String;
1330
1325
  /** Which store op was attempted: 'insert' | 'update' | 'delete' | …. */
1331
- operation: typeof Schema.String;
1326
+ readonly operation: Schema.String;
1332
1327
  /** The constraint / index name, when the dialect names one. */
1333
- constraint: Schema.optional<typeof Schema.String>;
1328
+ readonly constraint: Schema.optional<Schema.String>;
1334
1329
  /** The column, when the dialect names one instead of (or beside) a constraint. */
1335
- column: Schema.optional<typeof Schema.String>;
1330
+ readonly column: Schema.optional<Schema.String>;
1336
1331
  /**
1337
1332
  * A fuller sentence, when the FRAMEWORK raised this rather than the driver.
1338
1333
  *
@@ -1347,8 +1342,8 @@ declare const ConstraintViolation_base: Schema.TaggedErrorClass<ConstraintViolat
1347
1342
  * a row value. Absent for everything `classifyConstraintViolation` reads off
1348
1343
  * an error the database reported.
1349
1344
  */
1350
- detail: Schema.optional<typeof Schema.String>;
1351
- }>;
1345
+ readonly detail: Schema.optional<Schema.String>;
1346
+ }>, YieldableError>;
1352
1347
 
1353
1348
  /**
1354
1349
  * A handle to a cluster-coordinated periodic task the plugin armed via
@@ -1418,6 +1413,17 @@ export declare interface CoordinatedTickOutcome {
1418
1413
  readonly nextDueInMs?: number | null;
1419
1414
  }
1420
1415
 
1416
+ /** Index reuse for one subscription's immutable snapshots and returned rows.
1417
+ * Arbitrary mutable input must use applyRowPatch. A different base rebuilds
1418
+ * the index; reset releases it on snapshot replacement or owner disposal. */
1419
+ export declare const createRowPatchApplier: () => {
1420
+ readonly apply: typeof applyRowPatch;
1421
+ readonly reset: () => void;
1422
+ };
1423
+
1424
+ /** The latest authenticated authority for a request or live subscription. */
1425
+ export declare const currentSubjectAuthority: (subject: Subject) => Subject;
1426
+
1421
1427
  /**
1422
1428
  * What a descriptor CARRIES: the author's guards, or the erased form of their
1423
1429
  * `openAccess:` decision — never both.
@@ -1462,7 +1468,7 @@ export declare const DEFAULT_SCOPE_CACHE_MAX_ENTRIES = 10000;
1462
1468
  * purpose: the two per-request store reads then expire together. */
1463
1469
  export declare const DEFAULT_SCOPE_CACHE_TTL_MS = 30000;
1464
1470
 
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: {
1471
+ 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
1472
  readonly name: Name;
1467
1473
  readonly input: Input;
1468
1474
  readonly output: Output;
@@ -1571,7 +1577,7 @@ export declare const defineAction: <const Name extends string, Input extends Sch
1571
1577
  * })
1572
1578
  * ```
1573
1579
  */
1574
- export declare const defineEvent: <const Name extends string, Key extends Schema.Schema.Any, Payload extends Schema.Schema.Any>(options: {
1580
+ export declare const defineEvent: <const Name extends string, Key extends Schema.Top, Payload extends Schema.Top>(options: {
1575
1581
  /**
1576
1582
  * Wire identifier, `camelCase.dotted` like an rpc tag — and it shares the rpc
1577
1583
  * tag COLLISION SPACE, so a duplicate aborts boot rather than resolving itself
@@ -1668,7 +1674,7 @@ export declare const defineEvent: <const Name extends string, Key extends Schema
1668
1674
  readonly delivery?: EventDeliverySemantics;
1669
1675
  }) => EventDescriptor<Name, Key, Payload>;
1670
1676
 
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: {
1677
+ 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
1678
  readonly name: Name;
1673
1679
  readonly input: Input;
1674
1680
  readonly output: Output;
@@ -1831,11 +1837,11 @@ export declare const definePluginRoute: (route: PluginRpcRoute) => PluginRpcRout
1831
1837
  * needs resource acquisition (Layer.scoped).
1832
1838
  */
1833
1839
  export declare const definePluginService: <I, S>(identifier: string, implementation: S) => {
1834
- readonly Tag: Context.Tag<I, S>;
1840
+ readonly Tag: Context.Service<I, S>;
1835
1841
  readonly Live: Layer.Layer<I, never, never>;
1836
1842
  };
1837
1843
 
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: {
1844
+ 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
1845
  readonly name: Name;
1840
1846
  readonly input: Input;
1841
1847
  readonly output: Output;
@@ -1935,7 +1941,7 @@ export declare const defineQuery: <const Name extends string, Input extends Sche
1935
1941
  * returns a `Stream<Element>` (e.g. an agent run's `AgentEvent`s); the
1936
1942
  * client consumes it via `useAgentStream`. Reusable for ANY push stream.
1937
1943
  */
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: {
1944
+ 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
1945
  readonly name: Name;
1940
1946
  readonly input: Input;
1941
1947
  readonly element: Element;
@@ -1995,6 +2001,38 @@ export declare interface DeleteTarget<Input = unknown> extends NestedTargetField
1995
2001
  readonly identify?: ((input: Input) => string | ReadonlyArray<string>) | undefined;
1996
2002
  }
1997
2003
 
2004
+ /** The HMR custom event `voltro dev` publishes its activity on. */
2005
+ export declare const DEV_ACTIVITY_EVENT = "voltro:dev-activity";
2006
+
2007
+ /** What `voltro dev` reports over {@link DEV_ACTIVITY_EVENT}. A `document`
2008
+ * message describes ONE document request (`id` is per server process); a
2009
+ * `compile` message says whether Vite is transforming browser modules. */
2010
+ export declare type DevActivityMessage = {
2011
+ readonly type: 'document';
2012
+ readonly id: number;
2013
+ /** Path + search exactly as the browser asked for it. */
2014
+ readonly url: string;
2015
+ /** `start` once, when the request arrives; then whichever the server
2016
+ * is doing as it changes — `compiling` while Vite transforms modules
2017
+ * for it, `rendering` once a server render runs, `waiting` for
2018
+ * anything else (Vite's own html, a middleware). */
2019
+ readonly phase: 'start' | 'waiting' | 'compiling' | 'rendering';
2020
+ } | {
2021
+ readonly type: 'document';
2022
+ readonly id: number;
2023
+ readonly url: string;
2024
+ readonly phase: 'end';
2025
+ /** `document`: the browser got a page to show. `redirect`: it will ask
2026
+ * for `location` next. `no-document`: nothing will replace this page
2027
+ * (204/205, an attachment). `aborted`: the browser went away first. */
2028
+ readonly outcome: 'document' | 'redirect' | 'no-document' | 'aborted';
2029
+ readonly location?: string;
2030
+ } | {
2031
+ readonly type: 'compile';
2032
+ readonly consumer: 'client';
2033
+ readonly active: boolean;
2034
+ };
2035
+
1998
2036
  /** Pair, list and revoke devices (`devices: true`) for the caller's tenant.
1999
2037
  * One scope, not three: a device always acts as itself, in the pairer's
2000
2038
  * tenant, so there is no self / org / other distinction to draw.
@@ -2011,8 +2049,8 @@ export declare const diffRows: (prev: ReadonlyArray<PatchRow>, next: ReadonlyArr
2011
2049
  * - For each id in next: not in prev → `add`; in prev but content
2012
2050
  * differs → `replace`; in prev and equal → no op.
2013
2051
  * - 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).
2052
+ * - `order` is null for an unchanged sequence, otherwise next's IDs,
2053
+ * so apply can reconstruct the exact ordering (including a pure reorder, where `ops` is empty).
2016
2054
  *
2017
2055
  * Throws if any row lacks an `id` — the caller (dispatcher) only diffs
2018
2056
  * id-keyed result sets; a result without ids must ship a full snapshot,
@@ -2064,6 +2102,13 @@ export declare const encodeRestError: (format: RestFormat, error: RestFormatErro
2064
2102
  */
2065
2103
  export declare const encodeRestSuccess: (format: RestFormat, value: unknown, ctx: RestFormatContext) => RestFormatResponse;
2066
2104
 
2105
+ export declare interface EnqueueOptions {
2106
+ /** Deduplicate while an earlier intent is still pending, not permanently. */
2107
+ readonly idempotencyKey?: string;
2108
+ readonly maxAttempts?: number;
2109
+ readonly delayMs?: number;
2110
+ }
2111
+
2067
2112
  /**
2068
2113
  * The text to SHOW for a failure value — its `message`, else its `_tag`, else
2069
2114
  * `String(value)`.
@@ -2081,8 +2126,8 @@ export declare const errorMessage: (err: unknown) => string;
2081
2126
  /**
2082
2127
  * Read the `_tag` off a thrown error value, or `undefined` when it has none.
2083
2128
  *
2084
- * It lives here, beside `toRpc`, because `toRpc` is what puts the tag on the
2085
- * wire — one file owns both ends of that contract. It used to live in
2129
+ * It lives in protocol because `toRpc` (procedure.ts) is what puts the tag on
2130
+ * the wire — one package owns both ends of that contract. It used to live in
2086
2131
  * `@voltro/client`, and being there had a cost nobody could see from inside the
2087
2132
  * framework: an app's shared error handler lived in a package that pulled only
2088
2133
  * `@voltro/i18n`, so reading a tag meant taking a dependency on the whole client
@@ -2121,7 +2166,7 @@ export declare const EVENT_ROUTE_SEP = "\0";
2121
2166
 
2122
2167
  /** First element of every subscription: the stream is live from here on. */
2123
2168
  export declare const eventAttached: Schema.Struct<{
2124
- _tag: Schema.Literal<["attached"]>;
2169
+ readonly _tag: Schema.Literal<"attached">;
2125
2170
  }>;
2126
2171
 
2127
2172
  /**
@@ -2154,7 +2199,7 @@ export declare type EventDeliverySemantics = 'each' | 'latest';
2154
2199
  * Type parameters are inferred from the Schemas, and every call site — `publish`,
2155
2200
  * `useEvent`, a workflow trigger — derives its types from this one value.
2156
2201
  */
2157
- export declare interface EventDescriptor<Name extends string, Key extends Schema.Schema.Any, Payload extends Schema.Schema.Any> {
2202
+ export declare interface EventDescriptor<Name extends string, Key extends Schema.Top, Payload extends Schema.Top, Guards = DeclaredAccess<GuardedKey<Key>>> {
2158
2203
  readonly kind: 'event';
2159
2204
  readonly name: Name;
2160
2205
  readonly key: Key;
@@ -2163,7 +2208,7 @@ export declare interface EventDescriptor<Name extends string, Key extends Schema
2163
2208
  * `openAccess:` decision, never both (see `DeclaredAccess`). Re-checked when
2164
2209
  * the subject changes, not per delivery — see `EventDefinition.guards` for
2165
2210
  * why that distinction is deliberate. */
2166
- readonly guards: DeclaredAccess<Schema.Schema.Type<Key>> | undefined;
2211
+ readonly guards: Guards | undefined;
2167
2212
  /** The declared `openAccess:` reason, when there is one — what the boot gate
2168
2213
  * and `voltro doctor` read. The enforcement paths read `guards`. */
2169
2214
  readonly openAccess: string | undefined;
@@ -2191,60 +2236,54 @@ export declare interface EventDescriptor<Name extends string, Key extends Schema
2191
2236
  * every key — which is a real architecture (a single-threaded actor per room)
2192
2237
  * and not the one this framework has.
2193
2238
  */
2194
- export declare const eventEnvelope: <P extends Schema.Schema.Any>(payload: P) => Schema.Struct<{
2195
- _tag: Schema.Literal<["event"]>;
2239
+ export declare const eventEnvelope: <P extends Schema.Top>(payload: P) => Schema.Struct<{
2240
+ readonly _tag: Schema.Literal<"event">;
2196
2241
  /** Publishing instance id — serials are only comparable within one. */
2197
- origin: typeof Schema.String;
2242
+ readonly origin: Schema.String;
2198
2243
  /** Monotonic per (origin, event, tenant, key). */
2199
- n: typeof Schema.Number;
2200
- emittedAt: typeof Schema.Number;
2201
- payload: P;
2244
+ readonly n: Schema.Number;
2245
+ readonly emittedAt: Schema.Number;
2246
+ readonly payload: P;
2202
2247
  }>;
2203
2248
 
2204
2249
  /** Told to the subscriber when the SERVER knows it cannot fill a gap. */
2205
2250
  export declare const eventGap: Schema.Struct<{
2206
- _tag: Schema.Literal<["gap"]>;
2251
+ readonly _tag: Schema.Literal<"gap">;
2207
2252
  /** How many deliveries are known lost. Never a guess: a shortfall is computed
2208
2253
  * from the requested serial against what the ring still holds. */
2209
- missed: typeof Schema.Number;
2254
+ readonly missed: Schema.Number;
2210
2255
  /** `buffer` — evicted before this subscriber could be served.
2211
2256
  * `resume` — the re-attach asked for a serial older than the ring. */
2212
- reason: Schema.Literal<["buffer", "resume"]>;
2257
+ readonly reason: Schema.Literals<readonly ["buffer", "resume"]>;
2213
2258
  }>;
2214
2259
 
2215
2260
  /** The routing key did not decode against the descriptor's schema. */
2216
2261
  export declare class EventKeyInvalid extends EventKeyInvalid_base {
2217
2262
  }
2218
2263
 
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
- }>;
2264
+ declare const EventKeyInvalid_base: Schema.Class<EventKeyInvalid, Schema.TaggedStruct<"EventKeyInvalid", {
2265
+ readonly event: Schema.String;
2266
+ readonly message: Schema.String;
2267
+ }>, YieldableError>;
2225
2268
 
2226
2269
  /** The payload did not decode against the descriptor's schema. */
2227
2270
  export declare class EventPayloadInvalid extends EventPayloadInvalid_base {
2228
2271
  }
2229
2272
 
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
- }>;
2273
+ declare const EventPayloadInvalid_base: Schema.Class<EventPayloadInvalid, Schema.TaggedStruct<"EventPayloadInvalid", {
2274
+ readonly event: Schema.String;
2275
+ readonly message: Schema.String;
2276
+ }>, YieldableError>;
2236
2277
 
2237
2278
  /** The encoded envelope exceeds `MAX_EVENT_ENVELOPE_BYTES`. */
2238
2279
  export declare class EventPayloadTooLarge extends EventPayloadTooLarge_base {
2239
2280
  }
2240
2281
 
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
- }>;
2282
+ declare const EventPayloadTooLarge_base: Schema.Class<EventPayloadTooLarge, Schema.TaggedStruct<"EventPayloadTooLarge", {
2283
+ readonly event: Schema.String;
2284
+ readonly bytes: Schema.Number;
2285
+ readonly limit: Schema.Number;
2286
+ }>, YieldableError>;
2248
2287
 
2249
2288
  export declare type EventResumePoint = {
2250
2289
  readonly origin: string;
@@ -2253,8 +2292,8 @@ export declare type EventResumePoint = {
2253
2292
 
2254
2293
  /** Where a re-attaching subscriber left off, per origin. */
2255
2294
  export declare const eventResumePoint: Schema.Struct<{
2256
- origin: typeof Schema.String;
2257
- n: typeof Schema.Number;
2295
+ readonly origin: Schema.String;
2296
+ readonly n: Schema.Number;
2258
2297
  }>;
2259
2298
 
2260
2299
  export declare const eventRoute: (tenantId: string | null, event: string, key: unknown) => string;
@@ -2277,24 +2316,24 @@ export declare type EventStreamEvent<P> = {
2277
2316
  * What a subscription emits. `attached` first, then `event`s, with `gap`
2278
2317
  * interleaved whenever the server can prove a loss.
2279
2318
  */
2280
- export declare const eventStreamEvent: <P extends Schema.Schema.Any>(payload: P) => Schema.Union<[Schema.Struct<{
2281
- _tag: Schema.Literal<["attached"]>;
2319
+ export declare const eventStreamEvent: <P extends Schema.Top>(payload: P) => Schema.Union<readonly [Schema.Struct<{
2320
+ readonly _tag: Schema.Literal<"attached">;
2282
2321
  }>, Schema.Struct<{
2283
- _tag: Schema.Literal<["event"]>;
2322
+ readonly _tag: Schema.Literal<"event">;
2284
2323
  /** Publishing instance id — serials are only comparable within one. */
2285
- origin: typeof Schema.String;
2324
+ readonly origin: Schema.String;
2286
2325
  /** Monotonic per (origin, event, tenant, key). */
2287
- n: typeof Schema.Number;
2288
- emittedAt: typeof Schema.Number;
2289
- payload: P;
2326
+ readonly n: Schema.Number;
2327
+ readonly emittedAt: Schema.Number;
2328
+ readonly payload: P;
2290
2329
  }>, Schema.Struct<{
2291
- _tag: Schema.Literal<["gap"]>;
2330
+ readonly _tag: Schema.Literal<"gap">;
2292
2331
  /** How many deliveries are known lost. Never a guess: a shortfall is computed
2293
2332
  * from the requested serial against what the ring still holds. */
2294
- missed: typeof Schema.Number;
2333
+ readonly missed: Schema.Number;
2295
2334
  /** `buffer` — evicted before this subscriber could be served.
2296
2335
  * `resume` — the re-attach asked for a serial older than the ring. */
2297
- reason: Schema.Literal<["buffer", "resume"]>;
2336
+ readonly reason: Schema.Literals<readonly ["buffer", "resume"]>;
2298
2337
  }>]>;
2299
2338
 
2300
2339
  /**
@@ -2306,11 +2345,11 @@ export declare const eventStreamEvent: <P extends Schema.Schema.Any>(payload: P)
2306
2345
  * the client knows whether it has seen this stream before — the server cannot
2307
2346
  * tell a reconnect from a fresh mount.
2308
2347
  */
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;
2348
+ export declare const eventSubscribeInput: <K extends Schema.Top>(key: K) => Schema.Struct<{
2349
+ readonly key: K;
2350
+ readonly resume: Schema.optional<Schema.$Array<Schema.Struct<{
2351
+ readonly origin: Schema.String;
2352
+ readonly n: Schema.Number;
2314
2353
  }>>>;
2315
2354
  }>;
2316
2355
 
@@ -2323,31 +2362,31 @@ export declare const eventSubscribeInput: <K extends Schema.Schema.Any>(key: K)
2323
2362
  * with `useSubscription` instead of being a second realtime concept in the same
2324
2363
  * app.
2325
2364
  */
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;
2365
+ 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<{
2366
+ readonly key: Key;
2367
+ readonly resume: Schema.optional<Schema.$Array<Schema.Struct<{
2368
+ readonly origin: Schema.String;
2369
+ readonly n: Schema.Number;
2331
2370
  }>>>;
2332
- }>, Stream<Schema.Union<[Schema.Struct<{
2333
- _tag: Schema.Literal<["attached"]>;
2371
+ }>, Stream<Schema.Union<readonly [Schema.Struct<{
2372
+ readonly _tag: Schema.Literal<"attached">;
2334
2373
  }>, Schema.Struct<{
2335
- _tag: Schema.Literal<["event"]>;
2374
+ readonly _tag: Schema.Literal<"event">;
2336
2375
  /** Publishing instance id — serials are only comparable within one. */
2337
- origin: typeof Schema.String;
2376
+ readonly origin: Schema.String;
2338
2377
  /** Monotonic per (origin, event, tenant, key). */
2339
- n: typeof Schema.Number;
2340
- emittedAt: typeof Schema.Number;
2341
- payload: Payload;
2378
+ readonly n: Schema.Number;
2379
+ readonly emittedAt: Schema.Number;
2380
+ readonly payload: Payload;
2342
2381
  }>, Schema.Struct<{
2343
- _tag: Schema.Literal<["gap"]>;
2382
+ readonly _tag: Schema.Literal<"gap">;
2344
2383
  /** How many deliveries are known lost. Never a guess: a shortfall is computed
2345
2384
  * from the requested serial against what the ring still holds. */
2346
- missed: typeof Schema.Number;
2385
+ readonly missed: Schema.Number;
2347
2386
  /** `buffer` — evicted before this subscriber could be served.
2348
2387
  * `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>;
2388
+ readonly reason: Schema.Literals<readonly ["buffer", "resume"]>;
2389
+ }>]>, Schema.Top>, Schema.Never, never, never>;
2351
2390
 
2352
2391
  /**
2353
2392
  * The WEBHOOK audience of a declared event.
@@ -2403,7 +2442,7 @@ export declare interface ExposeAsToolSpec {
2403
2442
  * by the server group (cli/dev.ts) and the generated client group
2404
2443
  * (cli/codegen.ts) so both ends agree on the wire shape.
2405
2444
  */
2406
- export declare type ExtraErrors = ReadonlyArray<Schema.Schema.All>;
2445
+ export declare type ExtraErrors = ReadonlyArray<Schema.Top>;
2407
2446
 
2408
2447
  /** Release a claim after the handler errored, so a retry can re-process. */
2409
2448
  export declare const failIdempotent: (store: IdempotencyStore, scope: string, key: string) => Promise<void>;
@@ -2447,6 +2486,14 @@ export declare const findAdvisoryResourceGuards: (procedures: ReadonlyArray<{
2447
2486
  /** Record a completed response for replay. */
2448
2487
  export declare const finishIdempotent: (store: IdempotencyStore, scope: string, key: string, response: IdempotencyResponse, now: number) => Promise<void>;
2449
2488
 
2489
+ /**
2490
+ * The schema as the generator should see it: every `Number` node checked
2491
+ * finite, so it is written as `type: number` and keeps its bounds and check
2492
+ * fragments. Decoding is untouched — the view exists only to be generated from.
2493
+ * A node with an encoding is left as it is: the generator reads its encoded side.
2494
+ */
2495
+ export declare const finiteNumberView: (ast: SchemaAST.AST, memo?: Map<SchemaAST.AST, SchemaAST.AST>) => SchemaAST.AST;
2496
+
2450
2497
  /**
2451
2498
  * The value a ONE-SHOT read of an rpc resolves to, given the first value it
2452
2499
  * delivered.
@@ -2484,10 +2531,10 @@ export declare const formatEventRoute: (route: string) => string;
2484
2531
  * test pins it against `wireErrorUnion` per kind, so the two cannot drift.
2485
2532
  */
2486
2533
  export declare const FRAMEWORK_WIRE_ERRORS: {
2487
- readonly query: readonly [typeof ScopeError, typeof Unauthenticated];
2488
- readonly stream: readonly [typeof ScopeError, typeof Unauthenticated];
2489
- readonly action: readonly [typeof ScopeError, typeof Unauthenticated, typeof ValidationError, typeof ValidationErrors];
2490
- readonly mutation: readonly [typeof ScopeError, typeof Unauthenticated, typeof BusinessRuleViolation, typeof MutationInFlight, typeof VersionConflict, typeof ValidationError, typeof ValidationErrors];
2534
+ readonly query: readonly [typeof ScopeError, typeof Unauthenticated, typeof RequestedTenantRefused];
2535
+ readonly stream: readonly [typeof ScopeError, typeof Unauthenticated, typeof RequestedTenantRefused];
2536
+ readonly action: readonly [typeof ScopeError, typeof Unauthenticated, typeof RequestedTenantRefused, typeof ValidationError, typeof ValidationErrors];
2537
+ readonly mutation: readonly [typeof ScopeError, typeof Unauthenticated, typeof RequestedTenantRefused, typeof BusinessRuleViolation, typeof MutationInFlight, typeof VersionConflict, typeof ValidationError, typeof ValidationErrors];
2491
2538
  };
2492
2539
 
2493
2540
  /** The error values {@link FRAMEWORK_WIRE_ERRORS} admits for `Kind`. */
@@ -2548,8 +2595,19 @@ export declare interface GuardCheckSpec {
2548
2595
  * global-scope check (the extractor is advisory), exactly as before.
2549
2596
  */
2550
2597
  readonly resource?: (input: unknown) => string | undefined;
2598
+ /** Require an explicit resource resolver verdict, even for globally held
2599
+ * scopes and `admin:full`. Missing resolver/resource refuses access. */
2600
+ readonly resourceOnly?: boolean;
2551
2601
  }
2552
2602
 
2603
+ /**
2604
+ * The key a guard sees. `Schema.Top` is the wildcard (`EventDescriptor<string,
2605
+ * Schema.Top, infer P>` in a helper's conditional type); its `Type` is
2606
+ * `unknown`, and guards over `unknown` accept no guarded descriptor. The
2607
+ * wildcard reads as `never`, like `AnyEventDescriptor`, so every event fits it.
2608
+ */
2609
+ declare type GuardedKey<Key extends Schema.Top> = Schema.Top extends Key ? never : Schema.Schema.Type<Key>;
2610
+
2553
2611
  /** One or more declarative guards on a descriptor. All must pass (AND across
2554
2612
  * entries; `mode` controls AND/OR WITHIN one entry's scope array). */
2555
2613
  export declare type Guards<Input = unknown> = ReadonlyArray<AnyGuardSpec<Input>>;
@@ -2778,17 +2836,8 @@ export declare const IMPERSONATION_METADATA_KEY: "impersonation";
2778
2836
  * concluded the guard was not being applied. It was; it never got the chance.
2779
2837
  * With a complete payload the picture flipped immediately.
2780
2838
  *
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.
2839
+ * The sentence is on the title line because that is the line a person reads
2840
+ * first, and the whole misreading happened before the second line.
2792
2841
  */
2793
2842
  export declare const inputLabel: (procedure?: string, guarded?: boolean) => string;
2794
2843
 
@@ -2918,6 +2967,22 @@ export declare const isWireReachable: (descriptor: {
2918
2967
 
2919
2968
  export declare const JSONAPI_MEDIA_TYPE = "application/vnd.api+json; charset=utf-8";
2920
2969
 
2970
+ export declare interface JsonSchemaDocument {
2971
+ readonly schema: Record<string, unknown>;
2972
+ readonly definitions: Record<string, unknown>;
2973
+ }
2974
+
2975
+ /** The schema and its named definitions, normalised, definitions kept beside the root. */
2976
+ export declare const jsonSchemaDocumentOf: (schema: Schema.Top, options?: JsonSchemaOptions) => JsonSchemaDocument;
2977
+
2978
+ /** The document as ONE object: the root with its definitions inlined under `$defs`. */
2979
+ export declare const jsonSchemaOf: (schema: Schema.Top, options?: JsonSchemaOptions) => Record<string, unknown>;
2980
+
2981
+ export declare interface JsonSchemaOptions {
2982
+ /** `false` keeps objects open (no `additionalProperties: false`). Default: closed. */
2983
+ readonly closed?: boolean;
2984
+ }
2985
+
2921
2986
  /**
2922
2987
  * Build a scope cache. Hand it to `composeAuthStrategies({ scopeCache })` and
2923
2988
  * keep the handle: `invalidate(scopeCacheKey(subject))` from the mutation that
@@ -2971,17 +3036,34 @@ export declare const missingAccessDecision: (procedure?: string) => ScopeError;
2971
3036
  * fits several tries. */
2972
3037
  export declare const MUTATION_IN_FLIGHT_RETRY_AFTER_MS = 1000;
2973
3038
 
3039
+ /** Transaction-bound context for a plugin's required database contribution.
3040
+ * The executor result is available before the business transaction commits. */
3041
+ export declare interface MutationCommitContext extends RpcInterceptorContext {
3042
+ readonly kind: 'mutation';
3043
+ readonly store: DataStore;
3044
+ readonly output: unknown;
3045
+ /** Same enqueue facade as the executor, bound to this replay attempt. */
3046
+ readonly outbox?: OutboxEnqueueFacade;
3047
+ /** Runner invocation time, including guards and rolled-back retries. */
3048
+ readonly startedAt?: number;
3049
+ /** Elapsed milliseconds before required contribution work. */
3050
+ readonly durationMs?: number;
3051
+ }
3052
+
3053
+ /** Required transactional work, not an external side effect. A failure rolls
3054
+ * back the mutation. The hook may run again after a rolled-back contention
3055
+ * attempt, so all effects must remain on the supplied transaction store. */
3056
+ export declare type MutationCommitHook = (context: MutationCommitContext) => Effect.Effect<void, unknown>;
3057
+
2974
3058
  /** A connection-scoped RPC cannot execute or replay without a live WebSocket.
2975
3059
  * This is a transport precondition, not an authorization or membership grant. */
2976
3060
  export declare class MutationConnectionRequired extends MutationConnectionRequired_base {
2977
3061
  get message(): string;
2978
3062
  }
2979
3063
 
2980
- declare const MutationConnectionRequired_base: Schema.TaggedErrorClass<MutationConnectionRequired, "MutationConnectionRequired", {
2981
- readonly _tag: Schema.tag<"MutationConnectionRequired">;
2982
- } & {
2983
- traceId: typeof Schema.String;
2984
- }>;
3064
+ declare const MutationConnectionRequired_base: Schema.Class<MutationConnectionRequired, Schema.TaggedStruct<"MutationConnectionRequired", {
3065
+ readonly traceId: Schema.String;
3066
+ }>, YieldableError>;
2985
3067
 
2986
3068
  /** Ordinary writes deduplicate across reconnects. A connection-side effect
2987
3069
  * (for example joining a room) must execute once for EACH native connection. */
@@ -2991,16 +3073,14 @@ export declare class MutationInFlight extends MutationInFlight_base {
2991
3073
  get message(): string;
2992
3074
  }
2993
3075
 
2994
- declare const MutationInFlight_base: Schema.TaggedErrorClass<MutationInFlight, "MutationInFlight", {
2995
- readonly _tag: Schema.tag<"MutationInFlight">;
2996
- } & {
2997
- traceId: typeof Schema.String;
3076
+ declare const MutationInFlight_base: Schema.Class<MutationInFlight, Schema.TaggedStruct<"MutationInFlight", {
3077
+ readonly traceId: Schema.String;
2998
3078
  /** How long to wait before replaying the same key — the first call is still
2999
3079
  * running; a replay before it finishes conflicts again. */
3000
- retryAfterMs: typeof Schema.Number;
3001
- }>;
3080
+ readonly retryAfterMs: Schema.Number;
3081
+ }>, YieldableError>;
3002
3082
 
3003
- export declare interface MutationProcedureDescriptor<Name extends string, Input extends Schema.Schema.Any, Output extends Schema.Schema.Any, Error extends Schema.Schema.All> {
3083
+ export declare interface MutationProcedureDescriptor<Name extends string, Input extends Schema.Top, Output extends Schema.Top, Error extends Schema.Top> {
3004
3084
  readonly kind: 'mutation';
3005
3085
  readonly name: Name;
3006
3086
  readonly input: Input;
@@ -3071,7 +3151,7 @@ export declare interface MutationSerialization<Input = unknown> {
3071
3151
  readonly maxPending?: number;
3072
3152
  }
3073
3153
 
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>;
3154
+ 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
3155
 
3076
3156
  export declare interface NestedTargetFields<Input = unknown> {
3077
3157
  /** Dot-path to the nested array within the query VALUE to patch (e.g.
@@ -3131,12 +3211,10 @@ export declare class NoRowFound extends NoRowFound_base {
3131
3211
  get message(): string;
3132
3212
  }
3133
3213
 
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
- }>;
3214
+ declare const NoRowFound_base: Schema.Class<NoRowFound, Schema.TaggedStruct<"NoRowFound", {
3215
+ readonly table: Schema.String;
3216
+ readonly found: Schema.Number;
3217
+ }>, YieldableError>;
3140
3218
 
3141
3219
  /**
3142
3220
  * A resource guard's refusal when the resource it names does not exist — as
@@ -3156,13 +3234,11 @@ declare const NoRowFound_base: Schema.TaggedErrorClass<NoRowFound, "NoRowFound",
3156
3234
  export declare class NoSuchResource extends NoSuchResource_base {
3157
3235
  }
3158
3236
 
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
- }>;
3237
+ declare const NoSuchResource_base: Schema.Class<NoSuchResource, Schema.TaggedStruct<"NoSuchResource", {
3238
+ readonly resourceType: Schema.NullOr<Schema.String>;
3239
+ readonly resourceId: Schema.String;
3240
+ readonly message: Schema.String;
3241
+ }>, YieldableError>;
3166
3242
 
3167
3243
  /**
3168
3244
  * What a plugin contributes to the OTel layer via `contributeObservability`.
@@ -3248,6 +3324,30 @@ export declare const openAccessSpec: (reason: string) => OpenAccessSpec;
3248
3324
  */
3249
3325
  export declare const orderByBearerPrefix: (strategies: ReadonlyArray<AuthStrategy>, headers: Readonly<Record<string, string | undefined>>) => ReadonlyArray<AuthStrategy>;
3250
3326
 
3327
+ /** Enqueue-only capability bound to the caller's actual transaction store. */
3328
+ export declare interface OutboxEnqueueFacade {
3329
+ /** Returns the stable delivery identity. Delivery happens after commit. */
3330
+ enqueue(effect: string, payload: Record<string, unknown>, options?: EnqueueOptions): Promise<string>;
3331
+ }
3332
+
3333
+ /** Stable delivery context, shared by app and plugin handlers. */
3334
+ export declare interface OutboxHandlerContext {
3335
+ readonly outboxId: string;
3336
+ readonly idempotencyKey: string | null;
3337
+ readonly payload: Record<string, unknown>;
3338
+ readonly attempt: number;
3339
+ readonly subjectId: string | null;
3340
+ readonly tenantId: string | null;
3341
+ readonly traceId: string | null;
3342
+ }
3343
+
3344
+ /** Delivery happens after commit and may repeat; handlers must be idempotent. */
3345
+ export declare interface OutboxHandlerDefinition<R = never> {
3346
+ readonly effect: string;
3347
+ readonly handler: (context: OutboxHandlerContext) => Promise<unknown> | Effect.Effect<unknown, unknown, R>;
3348
+ readonly maxAttempts?: number;
3349
+ }
3350
+
3251
3351
  export declare interface Pairing {
3252
3352
  /** The api's base url as the DEVICE reaches it — a LAN address, never `localhost`. */
3253
3353
  readonly api: string;
@@ -3290,7 +3390,7 @@ export declare const parseEventRoute: (route: string) => {
3290
3390
  /** The record from a link, or `null` for anything that is not a pairing link. */
3291
3391
  export declare const parsePairingLink: (url: string) => Pairing | null;
3292
3392
 
3293
- export declare const patchCellSchema: Schema.transform<typeof Schema.Unknown, typeof Schema.Unknown>;
3393
+ export declare const patchCellSchema: Schema.decodeTo<Schema.Unknown, Schema.Unknown, never, never>;
3294
3394
 
3295
3395
  /** A single row in a subscription result. Must carry an `id`; everything
3296
3396
  * else is opaque to the patch layer. */
@@ -3304,34 +3404,37 @@ export declare type PatchRow = Readonly<Record<string, unknown>> & {
3304
3404
  export declare const pathToId: (path: string) => string;
3305
3405
 
3306
3406
  export declare const PendingApproval: Schema.Struct<{
3307
- id: typeof Schema.String;
3407
+ readonly id: Schema.String;
3308
3408
  /** The rpc tag whose execution is pending. */
3309
- procedure: typeof Schema.String;
3310
- kind: Schema.Literal<["mutation", "action"]>;
3409
+ readonly procedure: Schema.String;
3410
+ readonly kind: Schema.Literals<readonly ["mutation", "action"]>;
3311
3411
  /** Subject id of whoever asked. Never the approver. */
3312
- requestedBy: Schema.NullOr<typeof Schema.String>;
3313
- status: Schema.Literal<["pending", "approved", "rejected", "expired", "consumed"]>;
3412
+ readonly requestedBy: Schema.NullOr<Schema.String>;
3413
+ readonly status: Schema.Literals<readonly ["pending", "approved", "rejected", "expired", "consumed"]>;
3314
3414
  /** The declared reason from the descriptor, if any. */
3315
- reason: Schema.NullOr<typeof Schema.String>;
3415
+ readonly reason: Schema.NullOr<Schema.String>;
3316
3416
  /** 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>;
3417
+ readonly requiredScopes: Schema.$Array<Schema.String>;
3418
+ readonly requestedAt: Schema.String;
3419
+ readonly expiresAt: Schema.String;
3420
+ readonly decidedBy: Schema.NullOr<Schema.String>;
3421
+ readonly decidedAt: Schema.NullOr<Schema.String>;
3322
3422
  /** The approver's note, when they left one. */
3323
- note: Schema.NullOr<typeof Schema.String>;
3423
+ readonly note: Schema.NullOr<Schema.String>;
3324
3424
  /**
3325
3425
  * How this row relates to the CALLING subject — the whole point of the feed.
3326
3426
  * `'to-decide'` = they may act on it; `'requested'` = they asked for it.
3327
3427
  * A row is never both: self-approval is refused, so a requester never
3328
3428
  * qualifies as its approver.
3329
3429
  */
3330
- relation: Schema.Literal<["to-decide", "requested"]>;
3430
+ readonly relation: Schema.Literals<readonly ["to-decide", "requested"]>;
3331
3431
  }>;
3332
3432
 
3333
3433
  export declare type PendingApproval = Schema.Schema.Type<typeof PendingApproval>;
3334
3434
 
3435
+ /** The normalisation above, applied to any JSON Schema fragment. */
3436
+ export declare const plainJsonSchema: (value: unknown) => unknown;
3437
+
3335
3438
  /**
3336
3439
  * Called once at app boot, after `voltro dev` resolves the plugin
3337
3440
  * list and before the rpc server starts accepting connections. Use
@@ -3404,7 +3507,7 @@ export declare interface PluginBindContext {
3404
3507
  */
3405
3508
  readonly cache?: PluginCacheHandle;
3406
3509
  /**
3407
- * The framework's already-open `SqlClient` (from `@effect/sql`) — the
3510
+ * The framework's already-open `SqlClient` (from `effect/sql`) — the
3408
3511
  * SAME pool the app's store uses, with its TLS, credentials and schema.
3409
3512
  * For SQL the store's methods cannot express, against tables that are
3410
3513
  * DECLARED (`extendSchema.tables`, or the app's own schema): it never
@@ -3728,7 +3831,7 @@ export declare interface PluginEnvVar {
3728
3831
  * Requires the plugin to ship the schema as a NAMED export from `module`.
3729
3832
  */
3730
3833
  export declare interface PluginErrorSchema {
3731
- readonly schema: Schema.Schema.All;
3834
+ readonly schema: Schema.Top;
3732
3835
  readonly import: {
3733
3836
  readonly module: string;
3734
3837
  readonly name: string;
@@ -3819,6 +3922,9 @@ export declare interface PluginHttpRoute {
3819
3922
  * handler branches on: exempting `/saml` exempts `POST /saml/anything`.
3820
3923
  */
3821
3924
  readonly originGuard?: 'exempt';
3925
+ readonly cors?: RestCors;
3926
+ /** Bearer-only routes must discard cookie authority before authentication. */
3927
+ readonly credentials?: 'bearer';
3822
3928
  }
3823
3929
 
3824
3930
  /**
@@ -4232,9 +4338,9 @@ export declare interface PluginMigration {
4232
4338
  */
4233
4339
  /**
4234
4340
  * The `sql` parameter the framework hands the migration is the live
4235
- * `SqlClient.SqlClient` from `@effect/sql`. The reference is type-only,
4341
+ * `SqlClient.SqlClient` from `effect/sql`. The reference is type-only,
4236
4342
  * so it adds no runtime dependency — `@voltro/protocol` still ships
4237
- * without pulling `@effect/sql` into a plugin's bundle.
4343
+ * without pulling `effect/sql` into a plugin's bundle.
4238
4344
  */
4239
4345
  export declare type PluginMigrationSqlClient = SqlClient.SqlClient;
4240
4346
 
@@ -4250,7 +4356,7 @@ export declare type PluginMigrationSqlClient = SqlClient.SqlClient;
4250
4356
  * boot log + `/_voltro/inspect/plugins` so operators audit what each
4251
4357
  * plugin asks for before installing.
4252
4358
  */
4253
- export declare type PluginPermission = 'rpc:intercept:mutation' | 'rpc:intercept:query' | 'rpc:intercept:action' | 'rpc:intercept:workflow' | 'schedule:fire' | 'schedule:read' | 'workflow:step' | 'http:intercept' | 'inspect:read' | 'inspect:write' | 'dashboard:mount' | 'store:write' | 'migration:run' | 'store:changes:read' | `secrets:read:${string}` | `network:outbound:${string}` | `plugin:hook:${string}`;
4359
+ export declare type PluginPermission = 'rpc:intercept:mutation' | 'rpc:intercept:query' | 'rpc:intercept:action' | 'rpc:intercept:workflow' | 'schedule:fire' | 'schedule:read' | 'workflow:step' | 'http:intercept' | 'inspect:read' | 'inspect:write' | 'dashboard:mount' | 'outbox:handle' | 'store:write' | 'migration:run' | 'store:changes:read' | `secrets:read:${string}` | `network:outbound:${string}` | `plugin:hook:${string}`;
4254
4360
 
4255
4361
  /** What a plugin collects and uses — folded by `voltro compliance generate`
4256
4362
  * into PrivacyInfo.xcprivacy and the Play Data-safety answers. A plugin that
@@ -4329,11 +4435,11 @@ export declare interface PluginRpcRoute {
4329
4435
  /** Optional human-readable description; surfaced in the dashboard. */
4330
4436
  readonly description?: string;
4331
4437
  /** Input schema — same `effect/Schema` shape user routes use. */
4332
- readonly input: Schema.Schema.Any;
4438
+ readonly input: Schema.Top;
4333
4439
  /** Output schema. */
4334
- readonly output: Schema.Schema.Any;
4440
+ readonly output: Schema.Top;
4335
4441
  /** Optional typed-error schema (TaggedError union). */
4336
- readonly error?: Schema.Schema.All;
4442
+ readonly error?: Schema.Top;
4337
4443
  /**
4338
4444
  * REACTIVE source table(s) — ONLY for `kind: 'query'`. When set, the
4339
4445
  * framework drives the query REACTIVELY: it re-runs the executor and pushes
@@ -4614,7 +4720,7 @@ export declare const problemDetails: (error: RestFormatError) => Record<string,
4614
4720
  /** A stable, non-resolving URI for an error type: the tag as a URN. */
4615
4721
  export declare const problemTypeOf: (tag: string) => string;
4616
4722
 
4617
- export declare type ProcedureDescriptor = QueryProcedureDescriptor<string, Schema.Schema.Any, Schema.Schema.Any, Schema.Schema.All> | MutationProcedureDescriptor<string, Schema.Schema.Any, Schema.Schema.Any, Schema.Schema.All> | ActionProcedureDescriptor<string, Schema.Schema.Any, Schema.Schema.Any, Schema.Schema.All> | StreamProcedureDescriptor<string, Schema.Schema.Any, Schema.Schema.Any, Schema.Schema.All>;
4723
+ export declare type ProcedureDescriptor = QueryProcedureDescriptor<string, Schema.Top, Schema.Top, Schema.Top> | MutationProcedureDescriptor<string, Schema.Top, Schema.Top, Schema.Top> | ActionProcedureDescriptor<string, Schema.Top, Schema.Top, Schema.Top> | StreamProcedureDescriptor<string, Schema.Top, Schema.Top, Schema.Top>;
4618
4724
 
4619
4725
  /** The shape of one procedure, as the pair of peers must agree on it. */
4620
4726
  export declare interface ProcedureLike {
@@ -4639,10 +4745,10 @@ export declare const procedureShapeDigest: (rpc: ProcedureLike) => string;
4639
4745
  */
4640
4746
  export declare type ProcedureWireError<D extends {
4641
4747
  readonly kind: WireProcedureKind;
4642
- readonly error: Schema.Schema.All;
4748
+ readonly error: Schema.Top;
4643
4749
  }> = Schema.Schema.Type<D['error']> | FrameworkWireError<D['kind']> | RegisteredPluginError;
4644
4750
 
4645
- export declare const PROTOCOL_VERSION: 1;
4751
+ export declare const PROTOCOL_VERSION: 2;
4646
4752
 
4647
4753
  export declare type ProtocolVersion = typeof PROTOCOL_VERSION;
4648
4754
 
@@ -4856,7 +4962,7 @@ export declare interface QueryCacheConfig {
4856
4962
  readonly scope: 'subject' | 'tenant' | 'global';
4857
4963
  }
4858
4964
 
4859
- export declare interface QueryProcedureDescriptor<Name extends string, Input extends Schema.Schema.Any, Output extends Schema.Schema.Any, Error extends Schema.Schema.All> {
4965
+ export declare interface QueryProcedureDescriptor<Name extends string, Input extends Schema.Top, Output extends Schema.Top, Error extends Schema.Top> {
4860
4966
  readonly kind: 'query';
4861
4967
  readonly name: Name;
4862
4968
  readonly input: Input;
@@ -4912,56 +5018,40 @@ export declare interface QueryProcedureDescriptor<Name extends string, Input ext
4912
5018
  readonly internal: boolean | undefined;
4913
5019
  }
4914
5020
 
4915
- export declare const queryToRpc: <Name extends string, Input extends Schema.Schema.Any, Output extends Schema.Schema.Any, Err extends Schema.Schema.All>(descriptor: QueryProcedureDescriptor<Name, Input, Output, Err>, extraErrors?: ExtraErrors) => Rpc.Rpc<Name, Input extends Schema.Struct.Fields ? Schema.Struct<Input> : Input, Stream<Schema.Union<[Schema.Struct<{
4916
- _tag: Schema.Literal<["snapshot"]>;
4917
- revision: typeof Schema.Number;
4918
- data: Output;
4919
- computed: Schema.optional<typeof Schema.Boolean>;
4920
- reconciles: Schema.optional<typeof Schema.String>;
5021
+ 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<{
5022
+ readonly _tag: Schema.Literal<"snapshot">;
5023
+ readonly revision: Schema.Number;
5024
+ readonly data: Output;
5025
+ readonly computed: Schema.optional<Schema.Boolean>;
5026
+ readonly reconciles: Schema.optional<Schema.String>;
4921
5027
  }>, Schema.Struct<{
4922
- _tag: Schema.Literal<["delta"]>;
4923
- revision: typeof Schema.Number;
4924
- emittedAt: typeof Schema.Number;
4925
- patch: Schema.Struct<{
4926
- ops: Schema.Array$<Schema.Union<[Schema.Struct<{
4927
- op: Schema.Literal<["add"]>;
4928
- path: typeof Schema.String;
4929
- value: Schema.refine<{
4930
- readonly [x: string]: unknown;
4931
- } & Readonly<Record<string, unknown>> & {
4932
- readonly id: RowId;
4933
- }, Schema.Schema<{
4934
- readonly [x: string]: unknown;
4935
- }, {
4936
- readonly [x: string]: unknown;
4937
- }, never>>;
5028
+ readonly _tag: Schema.Literal<"delta">;
5029
+ readonly revision: Schema.Number;
5030
+ readonly emittedAt: Schema.Number;
5031
+ readonly patch: Schema.Struct<{
5032
+ readonly ops: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
5033
+ readonly op: Schema.Literal<"add">;
5034
+ readonly path: Schema.String;
5035
+ readonly value: Schema.refine< PatchRow, Schema.$Record<Schema.String, Schema.decodeTo<Schema.Unknown, Schema.Unknown, never, never>>>;
4938
5036
  }>, Schema.Struct<{
4939
- op: Schema.Literal<["replace"]>;
4940
- path: typeof Schema.String;
4941
- value: Schema.refine<{
4942
- readonly [x: string]: unknown;
4943
- } & Readonly<Record<string, unknown>> & {
4944
- readonly id: RowId;
4945
- }, Schema.Schema<{
4946
- readonly [x: string]: unknown;
4947
- }, {
4948
- readonly [x: string]: unknown;
4949
- }, never>>;
5037
+ readonly op: Schema.Literal<"replace">;
5038
+ readonly path: Schema.String;
5039
+ readonly value: Schema.refine< PatchRow, Schema.$Record<Schema.String, Schema.decodeTo<Schema.Unknown, Schema.Unknown, never, never>>>;
4950
5040
  }>, Schema.Struct<{
4951
- op: Schema.Literal<["remove"]>;
4952
- path: typeof Schema.String;
5041
+ readonly op: Schema.Literal<"remove">;
5042
+ readonly path: Schema.String;
4953
5043
  }>, Schema.Struct<{
4954
- op: Schema.Literal<["mergeCells"]>;
4955
- path: typeof Schema.String;
4956
- value: Schema.Record$<typeof Schema.String, Schema.transform<typeof Schema.Unknown, typeof Schema.Unknown>>;
5044
+ readonly op: Schema.Literal<"mergeCells">;
5045
+ readonly path: Schema.String;
5046
+ readonly value: Schema.$Record<Schema.String, Schema.decodeTo<Schema.Unknown, Schema.Unknown, never, never>>;
4957
5047
  }>]>>;
4958
- order: Schema.Array$<Schema.Union<[typeof Schema.String, typeof Schema.Number]>>;
5048
+ readonly order: Schema.NullOr<Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Number]>>>;
4959
5049
  }>;
4960
5050
  }>, Schema.Struct<{
4961
- _tag: Schema.Literal<["error"]>;
4962
- error: typeof Schema.Unknown;
4963
- revision: Schema.optional<typeof Schema.Number>;
4964
- }>]>, Schema.Schema.All>, typeof Schema.Never, never>;
5051
+ readonly _tag: Schema.Literal<"error">;
5052
+ readonly error: Schema.decodeTo<Schema.Unknown, Schema.Codec<Schema.Json, Schema.Json, never, never>, never, never>;
5053
+ readonly revision: Schema.optional<Schema.Number>;
5054
+ }>]>, Schema.Top>, Schema.Never, never, never>;
4965
5055
 
4966
5056
  /**
4967
5057
  * The RAW mark, unvalidated, or `null`.
@@ -5040,6 +5130,20 @@ export declare type ReactivitySourceValue = string | ReactivityChannel;
5040
5130
 
5041
5131
  export declare const readPairing: (storage: PairingStorage) => Promise<Pairing | null>;
5042
5132
 
5133
+ /**
5134
+ * Reauthenticate a live grant through its original strategy chain. Tenant and
5135
+ * principal identity stay bound to the original subscription: changing either
5136
+ * requires a new subscription, never reuse of an already scoped descriptor.
5137
+ * Runtime-owned subjects without a request binding retain their explicit grant.
5138
+ */
5139
+ export declare const reauthorizeSubject: (subject: Subject, prepare?: (fresh: Subject) => Promise<void>) => Promise<Subject>;
5140
+
5141
+ /** Recheck a live grant through fresh authentication and derived authority. */
5142
+ export declare const recheckGuardsEffect: (subject: Subject, guards: ReadonlyArray<AnyCheckSpec> | undefined, input: unknown, options?: GuardCheckOptions) => Effect.Effect<ScopeError | Unauthenticated | RequestedTenantRefused | NoSuchResource | null>;
5143
+
5144
+ /** Refresh derived authority without replaying unrelated RPC plugin hooks. */
5145
+ export declare const refreshEffectiveScopes: (original: Subject, fresh: Subject) => Promise<void>;
5146
+
5043
5147
  /** Every error a plugin registers, as one union (`never` before codegen). */
5044
5148
  export declare type RegisteredPluginError = VoltroPluginErrors[keyof VoltroPluginErrors];
5045
5149
 
@@ -5072,6 +5176,25 @@ export declare const registerPluginAliases: (aliases: Readonly<Record<string, st
5072
5176
  */
5073
5177
  export declare const reportableError: (err: unknown) => Error;
5074
5178
 
5179
+ /** An authenticated request cannot use its requested workspace. This is
5180
+ * scoped access refusal, not evidence that the credential or session ended.
5181
+ * Consumers must keep unrelated workspace sessions intact. */
5182
+ export declare class RequestedTenantRefused extends RequestedTenantRefused_base {
5183
+ }
5184
+
5185
+ declare const RequestedTenantRefused_base: Schema.Class<RequestedTenantRefused, Schema.TaggedStruct<"RequestedTenantRefused", {
5186
+ readonly reason: Schema.Literals<readonly ["target-unavailable", "invalid-target", "memberships-unavailable", "not-a-member", "subject-has-no-tenant"]>;
5187
+ }>, YieldableError>;
5188
+
5189
+ /** A request's tenant hint, read only after a strategy authenticates the caller.
5190
+ * Return null for the credential / stored selection. A non-null target is
5191
+ * checked against fresh memberships on every resolution, including when it
5192
+ * equals the credential's tenant. It never writes a persistent selection.
5193
+ * Do not return a tenant default for an absent hint: that would silently change
5194
+ * the authority of requests which did not select a workspace.
5195
+ */
5196
+ export declare type RequestedTenantSource = (subject: Subject, input: AuthStrategyInput) => Promise<string | null> | string | null;
5197
+
5075
5198
  /** Gate a handler on a scope; fails with a typed `ScopeError` if missing.
5076
5199
  * Checks the EFFECTIVE set so role-derived scopes count. */
5077
5200
  export declare const requireScope: (subject: Subject, scope: string) => Effect.Effect<void, ScopeError>;
@@ -5159,7 +5282,18 @@ declare interface RestByteResponse {
5159
5282
  * headers CDNs purge by. A request that carries a credential (`Authorization`
5160
5283
  * or a cookie) gets `private, no-cache` and no tags, whatever is declared:
5161
5284
  * what a key or a session may see must never land in a shared cache. Every
5162
- * such answer says `Vary: Authorization, Cookie`. Errors are not affected.
5285
+ * such answer says `Vary: Authorization, Cookie`.
5286
+ *
5287
+ * With `audience`, the ANSWER decides instead of the request's cookies: an
5288
+ * answer that is the same for every reader (`'public'`) is shared even when
5289
+ * the request carries cookies (a consent choice, a signed-in reader on a
5290
+ * public page) — the cache serves it to everyone, so it says only
5291
+ * `Vary: Authorization`; an answer for this reader alone (`'private'`: a
5292
+ * members page, a running experiment) is `private, no-store`. A request with
5293
+ * `Authorization` is private either way.
5294
+ *
5295
+ * Any other answer than a 200 (a 404, a 410, a 401) of a route with `cache`
5296
+ * is `private, no-store`: one reader's "not found" can be another's page.
5163
5297
  */
5164
5298
  declare interface RestCache {
5165
5299
  /** Seconds a cache may serve the answer without asking again. */
@@ -5169,6 +5303,22 @@ declare interface RestCache {
5169
5303
  /** Purge tags from the answer as it goes on the wire, and the input.
5170
5304
  * A tag with whitespace or a comma is dropped (no header can carry it). */
5171
5305
  readonly tags?: (output: unknown, input: unknown) => ReadonlyArray<string>;
5306
+ /** Who may share the answer, decided by the answer and the reader it was
5307
+ * made for: `'public'` — every reader gets the same, cookies are ignored;
5308
+ * `'private'` — this reader's alone, never shared. Answer `'private'` for
5309
+ * a signed-in `subject` whenever anything in the answer depends on who
5310
+ * reads it. Without it, any cookie makes the answer private. */
5311
+ readonly audience?: (output: unknown, input: unknown, subject: Subject) => 'public' | 'private';
5312
+ }
5313
+
5314
+ /** Cross-origin browser access for one route. Origins are exact, including opaque `null`. */
5315
+ declare interface RestCors {
5316
+ readonly origins: ReadonlyArray<string>;
5317
+ readonly headers?: ReadonlyArray<string>;
5318
+ readonly methods?: ReadonlyArray<RestMethod>;
5319
+ /** Preflight cache lifetime in seconds. */
5320
+ readonly maxAge?: number;
5321
+ readonly exposeHeaders?: ReadonlyArray<string>;
5172
5322
  }
5173
5323
 
5174
5324
  export declare type RestDates = 'iso' | 'epoch-ms';
@@ -5271,6 +5421,13 @@ export declare type RestNaming = 'camelCase' | 'snake_case';
5271
5421
 
5272
5422
  export declare type RestPagination = 'link-header' | 'body-cursor';
5273
5423
 
5424
+ /** Uses the mounted rate-limit plugin's store, algorithms and dynamic policy. */
5425
+ declare interface RestRateLimit {
5426
+ readonly limit: number;
5427
+ readonly window: string;
5428
+ readonly by?: 'subject' | 'tenant' | 'apiKey' | 'ip' | 'global';
5429
+ }
5430
+
5274
5431
  /** A schema-encoded REST body with an application-selected HTTP status and
5275
5432
  * response headers. The marker keeps ordinary domain objects unambiguous.
5276
5433
  * `output` still validates/encodes `body`; use `Schema.Void` with a 204 when
@@ -5324,10 +5481,10 @@ declare interface RestRouteDescriptor<I, O> {
5324
5481
  * before decoding. Omit for routes that take no input. The schema's
5325
5482
  * decoded `Type` flows to the handler's `input`; its `Encoded` is left
5326
5483
  * open (`any`) so any `Schema.Struct(...)` is accepted. */
5327
- readonly input?: Schema.Schema<I, any, never>;
5484
+ readonly input?: Schema.Codec<I, any, never, never>;
5328
5485
  /** Output schema. The handler returns the decoded `Type`; the desugar
5329
5486
  * encodes it to JSON for the `200` response. */
5330
- readonly output: Schema.Schema<O, any, never>;
5487
+ readonly output: Schema.Codec<O, any, never, never>;
5331
5488
  readonly handler: (input: I, ctx: RestRouteContext) => Promise<RestHandlerResult<O>> | RestHandlerResult<O>;
5332
5489
  readonly summary?: string;
5333
5490
  readonly description?: string;
@@ -5369,6 +5526,10 @@ declare interface RestRouteDescriptor<I, O> {
5369
5526
  */
5370
5527
  readonly version?: `v${number}`;
5371
5528
  readonly guards?: ReadonlyArray<RestGuard>;
5529
+ readonly cors?: RestCors;
5530
+ /** Only an explicit bearer header may authenticate; cookies are removed before auth and context construction. */
5531
+ readonly credentials?: 'bearer';
5532
+ readonly rateLimit?: RestRateLimit;
5372
5533
  /**
5373
5534
  * This route STREAMS (Server-Sent Events) rather than resolving one value — its
5374
5535
  * handler returns `sse(...)`. Declared on the descriptor, not left implicit in
@@ -5411,10 +5572,10 @@ declare interface RestRouteProjection {
5411
5572
  /** `publicApi.idempotent` — the route honours `Idempotency-Key` (under the
5412
5573
  * app's idempotency binding); a client sends one per attempt. */
5413
5574
  readonly idempotent: boolean;
5414
- readonly input: Schema.Schema.All;
5575
+ readonly input: Schema.Top;
5415
5576
  /** The wire names of the input fields bound from the path. */
5416
5577
  readonly pathParams: ReadonlyArray<string>;
5417
- readonly output: Schema.Schema.All;
5578
+ readonly output: Schema.Top;
5418
5579
  /** The first `source` table, when the procedure declares one. */
5419
5580
  readonly source: string | undefined;
5420
5581
  /** Every failure the operation answers with a typed body, and its status:
@@ -5423,11 +5584,40 @@ declare interface RestRouteProjection {
5423
5584
  readonly errorResponses: ReadonlyArray<{
5424
5585
  readonly status: number;
5425
5586
  readonly tag: string;
5426
- readonly schema: Schema.Schema.All;
5587
+ readonly schema: Schema.Top;
5427
5588
  }>;
5428
5589
  readonly format: RestFormat;
5429
5590
  }
5430
5591
 
5592
+ /**
5593
+ * Default ctx resolver used when the serve pipeline doesn't inject one
5594
+ * (e.g. unit tests). Real mounts pass a resolver that reads the framework's
5595
+ * auth subject + the bound DataStore.
5596
+ */
5597
+ declare interface RestServeBindings {
5598
+ /** Bound once from the app's mounted rate-limit plugin. */
5599
+ readonly rateLimit?: (policy: RestRateLimit, ctx: RestRouteContext, route: RestRouteDescriptor<any, any>) => Effect.Effect<void, unknown>;
5600
+ /** Resolve the calling subject from the request headers. */
5601
+ readonly resolveSubject?: (headers: Readonly<Record<string, string>>) => Subject | Promise<Subject>;
5602
+ /** The bound framework DataStore. */
5603
+ readonly store?: unknown;
5604
+ /** Build the full per-request app context after authentication. */
5605
+ readonly buildContext?: (subject: Subject, headers: Readonly<Record<string, string>>) => unknown | Promise<unknown>;
5606
+ /**
5607
+ * HTTP idempotency — when set, a mutating request (POST/PUT/PATCH/DELETE)
5608
+ * carrying the `header` is deduplicated: the first call runs + caches its
5609
+ * response; a replay within `ttlMs` returns the cached response
5610
+ * (`Idempotency-Replayed: true`); an in-flight duplicate gets `409`. Scoped
5611
+ * per (tenant, method, path). The serve path injects the store + config from
5612
+ * `app.config.ts`'s `idempotency` field.
5613
+ */
5614
+ readonly idempotency?: {
5615
+ readonly store: IdempotencyStore;
5616
+ readonly header: string;
5617
+ readonly ttlMs: number;
5618
+ };
5619
+ }
5620
+
5431
5621
  /**
5432
5622
  * What a REST handler returns to stream its response instead of resolving one
5433
5623
  * value: `sse((emit) => unsubscribe)`. The route's schema `output` is not used
@@ -5442,25 +5632,25 @@ declare interface RestStreamResponse {
5442
5632
 
5443
5633
  /**
5444
5634
  * Rewrite a descriptor's schema into the shape the profile puts on the wire:
5445
- * `timestampMs` (`DateFromNumber`) becomes an RFC 3339 string under
5446
- * `dates: 'iso'`, and every struct's property names become `snake_case` under
5447
- * `naming: 'snake_case'` — as a transformation, so decoding a wire value yields
5448
- * the descriptor's own typed value and encoding the typed value yields the
5449
- * wire form. `JSONSchema.make` of the result documents the wire (a
5450
- * `format: date-time` string, the snake keys). Classes and other opaque
5451
- * transformations pass through unchanged; a struct inside one keeps its keys.
5635
+ * `timestampMs` becomes an RFC 3339 string under `dates: 'iso'`, and every
5636
+ * struct's property names become `snake_case` under `naming: 'snake_case'` —
5637
+ * as an encoding, so decoding a wire value yields the descriptor's own typed
5638
+ * value and encoding the typed value yields the wire form.
5639
+ * `Schema.toJsonSchemaDocument` of the result documents the wire (a
5640
+ * `format: date-time` string, the snake keys). Classes and other opaque codecs
5641
+ * pass through unchanged; a struct inside one keeps its keys.
5452
5642
  */
5453
- export declare const restViewSchema: (schema: Schema.Schema.All, format: RestFormat) => Schema.Schema.All;
5643
+ export declare const restViewSchema: (schema: Schema.Top, format: RestFormat) => Schema.Top;
5454
5644
 
5455
5645
  /** The id of a row, addressed in op paths as `/<id>`. */
5456
5646
  export declare type RowId = string | number;
5457
5647
 
5458
5648
  /** The full delta payload: the per-row ops plus the authoritative id
5459
- * ordering of the resulting set. */
5649
+ * ordering when it changes. */
5460
5650
  export declare interface RowPatch {
5461
5651
  readonly ops: ReadonlyArray<RowPatchOp>;
5462
- /** Id sequence of the resulting (next) row set, in order. */
5463
- readonly order: ReadonlyArray<RowId>;
5652
+ /** null preserves the previous id sequence; an array supplies the new one. */
5653
+ readonly order: ReadonlyArray<RowId> | null;
5464
5654
  }
5465
5655
 
5466
5656
  /**
@@ -5499,73 +5689,41 @@ export declare type RowPatchOp = {
5499
5689
  readonly value: Readonly<Record<string, unknown>>;
5500
5690
  };
5501
5691
 
5502
- export declare const rowPatchOpSchema: Schema.Union<[Schema.Struct<{
5503
- op: Schema.Literal<["add"]>;
5504
- path: typeof Schema.String;
5505
- value: Schema.refine<{
5506
- readonly [x: string]: unknown;
5507
- } & Readonly<Record<string, unknown>> & {
5508
- readonly id: RowId;
5509
- }, Schema.Schema<{
5510
- readonly [x: string]: unknown;
5511
- }, {
5512
- readonly [x: string]: unknown;
5513
- }, never>>;
5692
+ export declare const rowPatchOpSchema: Schema.Union<readonly [Schema.Struct<{
5693
+ readonly op: Schema.Literal<"add">;
5694
+ readonly path: Schema.String;
5695
+ readonly value: Schema.refine<PatchRow, Schema.$Record<Schema.String, Schema.decodeTo<Schema.Unknown, Schema.Unknown, never, never>>>;
5514
5696
  }>, Schema.Struct<{
5515
- op: Schema.Literal<["replace"]>;
5516
- path: typeof Schema.String;
5517
- value: Schema.refine<{
5518
- readonly [x: string]: unknown;
5519
- } & Readonly<Record<string, unknown>> & {
5520
- readonly id: RowId;
5521
- }, Schema.Schema<{
5522
- readonly [x: string]: unknown;
5523
- }, {
5524
- readonly [x: string]: unknown;
5525
- }, never>>;
5697
+ readonly op: Schema.Literal<"replace">;
5698
+ readonly path: Schema.String;
5699
+ readonly value: Schema.refine<PatchRow, Schema.$Record<Schema.String, Schema.decodeTo<Schema.Unknown, Schema.Unknown, never, never>>>;
5526
5700
  }>, Schema.Struct<{
5527
- op: Schema.Literal<["remove"]>;
5528
- path: typeof Schema.String;
5701
+ readonly op: Schema.Literal<"remove">;
5702
+ readonly path: Schema.String;
5529
5703
  }>, Schema.Struct<{
5530
- op: Schema.Literal<["mergeCells"]>;
5531
- path: typeof Schema.String;
5532
- value: Schema.Record$<typeof Schema.String, Schema.transform<typeof Schema.Unknown, typeof Schema.Unknown>>;
5704
+ readonly op: Schema.Literal<"mergeCells">;
5705
+ readonly path: Schema.String;
5706
+ readonly value: Schema.$Record<Schema.String, Schema.decodeTo<Schema.Unknown, Schema.Unknown, never, never>>;
5533
5707
  }>]>;
5534
5708
 
5535
5709
  export declare const rowPatchSchema: Schema.Struct<{
5536
- ops: Schema.Array$<Schema.Union<[Schema.Struct<{
5537
- op: Schema.Literal<["add"]>;
5538
- path: typeof Schema.String;
5539
- value: Schema.refine<{
5540
- readonly [x: string]: unknown;
5541
- } & Readonly<Record<string, unknown>> & {
5542
- readonly id: RowId;
5543
- }, Schema.Schema<{
5544
- readonly [x: string]: unknown;
5545
- }, {
5546
- readonly [x: string]: unknown;
5547
- }, never>>;
5710
+ readonly ops: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
5711
+ readonly op: Schema.Literal<"add">;
5712
+ readonly path: Schema.String;
5713
+ readonly value: Schema.refine<PatchRow, Schema.$Record<Schema.String, Schema.decodeTo<Schema.Unknown, Schema.Unknown, never, never>>>;
5548
5714
  }>, Schema.Struct<{
5549
- op: Schema.Literal<["replace"]>;
5550
- path: typeof Schema.String;
5551
- value: Schema.refine<{
5552
- readonly [x: string]: unknown;
5553
- } & Readonly<Record<string, unknown>> & {
5554
- readonly id: RowId;
5555
- }, Schema.Schema<{
5556
- readonly [x: string]: unknown;
5557
- }, {
5558
- readonly [x: string]: unknown;
5559
- }, never>>;
5715
+ readonly op: Schema.Literal<"replace">;
5716
+ readonly path: Schema.String;
5717
+ readonly value: Schema.refine<PatchRow, Schema.$Record<Schema.String, Schema.decodeTo<Schema.Unknown, Schema.Unknown, never, never>>>;
5560
5718
  }>, Schema.Struct<{
5561
- op: Schema.Literal<["remove"]>;
5562
- path: typeof Schema.String;
5719
+ readonly op: Schema.Literal<"remove">;
5720
+ readonly path: Schema.String;
5563
5721
  }>, Schema.Struct<{
5564
- op: Schema.Literal<["mergeCells"]>;
5565
- path: typeof Schema.String;
5566
- value: Schema.Record$<typeof Schema.String, Schema.transform<typeof Schema.Unknown, typeof Schema.Unknown>>;
5722
+ readonly op: Schema.Literal<"mergeCells">;
5723
+ readonly path: Schema.String;
5724
+ readonly value: Schema.$Record<Schema.String, Schema.decodeTo<Schema.Unknown, Schema.Unknown, never, never>>;
5567
5725
  }>]>>;
5568
- order: Schema.Array$<Schema.Union<[typeof Schema.String, typeof Schema.Number]>>;
5726
+ readonly order: Schema.NullOr<Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Number]>>>;
5569
5727
  }>;
5570
5728
 
5571
5729
  /**
@@ -5608,6 +5766,10 @@ export declare type RpcInterceptor = (next: Effect.Effect<unknown, unknown>, con
5608
5766
  * them automatically.
5609
5767
  */
5610
5768
  export declare interface RpcInterceptorContext {
5769
+ /** Enqueue a settled invocation outcome on the host's root store, outside
5770
+ * the business transaction. Required transactional success capture must use
5771
+ * MutationCommitContext.outbox instead. Older/custom hosts may omit this. */
5772
+ readonly enqueueOutcome?: OutboxEnqueueFacade['enqueue'];
5611
5773
  /** Procedure tag, e.g. `todos.create`. */
5612
5774
  readonly tag: string;
5613
5775
  /** Discriminator — `'mutation' | 'query' | 'action' | 'workflow'`. */
@@ -5788,12 +5950,10 @@ export declare type ScopeDecision =
5788
5950
  export declare class ScopeError extends ScopeError_base {
5789
5951
  }
5790
5952
 
5791
- declare const ScopeError_base: Schema.TaggedErrorClass<ScopeError, "ScopeError", {
5792
- readonly _tag: Schema.tag<"ScopeError">;
5793
- } & {
5794
- required: typeof Schema.String;
5795
- message: typeof Schema.String;
5796
- }>;
5953
+ declare const ScopeError_base: Schema.Class<ScopeError, Schema.TaggedStruct<"ScopeError", {
5954
+ readonly required: Schema.String;
5955
+ readonly message: Schema.String;
5956
+ }>, YieldableError>;
5797
5957
 
5798
5958
  /** What `resolveScopes` may return. A bare array is the shorthand for
5799
5959
  * `{ kind: 'grant', scopes }` — the common case, and the reading an existing
@@ -5863,14 +6023,12 @@ export declare type ServerErrorSource = 'rest' | 'aggregate' | 'subscriber' | 'r
5863
6023
  export declare class ServerOnlyColumnWrite extends ServerOnlyColumnWrite_base {
5864
6024
  }
5865
6025
 
5866
- declare const ServerOnlyColumnWrite_base: Schema.TaggedErrorClass<ServerOnlyColumnWrite, "ServerOnlyColumnWrite", {
5867
- readonly _tag: Schema.tag<"ServerOnlyColumnWrite">;
5868
- } & {
6026
+ declare const ServerOnlyColumnWrite_base: Schema.Class<ServerOnlyColumnWrite, Schema.TaggedStruct<"ServerOnlyColumnWrite", {
5869
6027
  /** The table the write targeted. */
5870
- table: typeof Schema.String;
6028
+ readonly table: Schema.String;
5871
6029
  /** The `.serverOnly()` columns the input tried to set. */
5872
- columns: Schema.Array$<typeof Schema.String>;
5873
- }>;
6030
+ readonly columns: Schema.$Array<Schema.String>;
6031
+ }>, YieldableError>;
5874
6032
 
5875
6033
  /** A service (app) name: what `serviceCallers`, `service.callers` and a service
5876
6034
  * credential all spell the same way. At most 56 characters: the caller writes
@@ -6005,6 +6163,9 @@ export declare const sessionValueFromHeaders: (headers: Readonly<Record<string,
6005
6163
  */
6006
6164
  export declare const setEffectiveScopes: (subject: Subject, scopes: ReadonlyArray<string>) => void;
6007
6165
 
6166
+ /** Register a request's dynamic role/permission resolver for live delivery. */
6167
+ export declare const setEffectiveScopesRefresher: (subject: Subject, refresh: (fresh: Subject) => Promise<void>) => void;
6168
+
6008
6169
  /** Register (or clear) the process-global policy-guard resolver. Last write
6009
6170
  * wins. The runtime installs one backed by the resource-policy registry and
6010
6171
  * the registered tuple source. */
@@ -6035,6 +6196,34 @@ export declare const shapeDigest: (text: string) => string;
6035
6196
  */
6036
6197
  export declare const sourceKeys: (source: ReactivitySourceValue | ReadonlyArray<ReactivitySourceValue> | undefined) => ReadonlyArray<string>;
6037
6198
 
6199
+ export declare type StorageAccessPolicy = typeof StorageAccessPolicySchema.Type;
6200
+
6201
+ export declare const StorageAccessPolicySchema: Schema.$Array<Schema.Struct<{
6202
+ readonly owner: Schema.optional<Schema.Boolean>;
6203
+ readonly roles: Schema.optional<Schema.$Array<Schema.String>>;
6204
+ readonly groups: Schema.optional<Schema.$Array<Schema.String>>;
6205
+ readonly scopes: Schema.optional<Schema.$Array<Schema.String>>;
6206
+ readonly tenant: Schema.optional<Schema.Boolean>;
6207
+ readonly apiKey: Schema.optional<Schema.Boolean>;
6208
+ readonly password: Schema.optional<Schema.Boolean>;
6209
+ readonly guard: Schema.optional<Schema.String>;
6210
+ }>>;
6211
+
6212
+ export declare type StorageAccessRule = typeof StorageAccessRuleSchema.Type;
6213
+
6214
+ /** Conditions within one rule are AND; rules within a policy are OR.
6215
+ * Private storage objects also allow their owner. */
6216
+ export declare const StorageAccessRuleSchema: Schema.Struct<{
6217
+ readonly owner: Schema.optional<Schema.Boolean>;
6218
+ readonly roles: Schema.optional<Schema.$Array<Schema.String>>;
6219
+ readonly groups: Schema.optional<Schema.$Array<Schema.String>>;
6220
+ readonly scopes: Schema.optional<Schema.$Array<Schema.String>>;
6221
+ readonly tenant: Schema.optional<Schema.Boolean>;
6222
+ readonly apiKey: Schema.optional<Schema.Boolean>;
6223
+ readonly password: Schema.optional<Schema.Boolean>;
6224
+ readonly guard: Schema.optional<Schema.String>;
6225
+ }>;
6226
+
6038
6227
  export declare const STORE_SCREENSHOT_PRESET_NAMES: [string, ...string[]];
6039
6228
 
6040
6229
  export declare const STORE_SCREENSHOT_PRESETS: ReadonlyArray<StoreScreenshotPreset>;
@@ -6067,13 +6256,11 @@ export declare class StoreOperationFailed extends StoreOperationFailed_base {
6067
6256
  get message(): string;
6068
6257
  }
6069
6258
 
6070
- declare const StoreOperationFailed_base: Schema.TaggedErrorClass<StoreOperationFailed, "StoreOperationFailed", {
6071
- readonly _tag: Schema.tag<"StoreOperationFailed">;
6072
- } & {
6259
+ declare const StoreOperationFailed_base: Schema.Class<StoreOperationFailed, Schema.TaggedStruct<"StoreOperationFailed", {
6073
6260
  /** Which DataStore op was attempted: 'query' | 'insert' | 'update' | 'delete' | 'hardDelete'. */
6074
- operation: typeof Schema.String;
6261
+ readonly operation: Schema.String;
6075
6262
  /** The table the op targeted. */
6076
- table: typeof Schema.String;
6263
+ readonly table: Schema.String;
6077
6264
  /**
6078
6265
  * A BOUNDED description of what went wrong.
6079
6266
  *
@@ -6091,8 +6278,8 @@ declare const StoreOperationFailed_base: Schema.TaggedErrorClass<StoreOperationF
6091
6278
  * socket address. `wireSafeCause` in `@voltro/database` builds it,
6092
6279
  * and the reasoning is there. The full detail is logged server-side.
6093
6280
  */
6094
- cause: typeof Schema.String;
6095
- }>;
6281
+ readonly cause: Schema.String;
6282
+ }>, YieldableError>;
6096
6283
 
6097
6284
  /** The PNG size the store receives: viewport × scale factor. */
6098
6285
  export declare const storeScreenshotPixels: (preset: StoreScreenshotPreset) => {
@@ -6157,7 +6344,7 @@ export declare type StrategyResolution = {
6157
6344
  * run's `AgentEvent`s), one-shot, no table, no snapshot. Backs A3's
6158
6345
  * agent runtime + any other server-push stream.
6159
6346
  */
6160
- export declare interface StreamProcedureDescriptor<Name extends string, Input extends Schema.Schema.Any, Element extends Schema.Schema.Any, Error extends Schema.Schema.All> {
6347
+ export declare interface StreamProcedureDescriptor<Name extends string, Input extends Schema.Top, Element extends Schema.Top, Error extends Schema.Top> {
6161
6348
  readonly kind: 'stream';
6162
6349
  readonly name: Name;
6163
6350
  readonly input: Input;
@@ -6176,50 +6363,40 @@ export declare interface StreamProcedureDescriptor<Name extends string, Input ex
6176
6363
  readonly openAccess: string | undefined;
6177
6364
  }
6178
6365
 
6179
- export declare const streamToRpc: <Name extends string, Input extends Schema.Schema.Any, Element extends Schema.Schema.Any, Err extends Schema.Schema.All>(descriptor: StreamProcedureDescriptor<Name, Input, Element, Err>, extraErrors?: ExtraErrors) => Rpc.Rpc<Name, Input extends Schema.Struct.Fields ? Schema.Struct<Input> : Input, Stream<Element, Schema.Schema.All>, typeof Schema.Never, never>;
6366
+ export declare const streamToRpc: <Name extends string, Input extends Schema.Top, Element extends Schema.Top, Err extends Schema.Top>(descriptor: StreamProcedureDescriptor<Name, Input, Element, Err>, extraErrors?: ExtraErrors) => Rpc.Rpc<Name, Input extends Schema.Struct.Fields ? Schema.Struct<Input> : Input, Stream<Element, Schema.Top>, Schema.Never, never, never>;
6180
6367
 
6181
6368
  /**
6182
- * Annotate a procedure's input schema so an undeclared field fails the decode
6183
- * instead of vanishing from it.
6184
- *
6185
- * Applies to the schema handed to `Rpc.make` — the PAYLOAD only. Not the
6186
- * success schema, and not `descriptor.input`, which the client still reads
6187
- * unannotated for schema-driven UI (`normalizeDescriptor`).
6188
- *
6189
- * Measured, because none of it follows from the annotation's name: it
6190
- * propagates into NESTED structs and through a UNION's members, and a
6191
- * non-struct payload (`Schema.Void`, a scalar) is unaffected — there is no
6192
- * excess property for it to have.
6369
+ * The payload schema every `Rpc.make` in this package is built with. Excess
6370
+ * keys are refused at every closed object the input reaches, and a decode
6371
+ * failure is reported under the procedure's label (see the header).
6193
6372
  */
6194
- export declare const strictInput: <S extends Schema.Schema.Any>(input: S, procedure?: string, guarded?: boolean) => S;
6373
+ export declare const strictInput: <S extends Schema.Top>(input: S, procedure?: string, guarded?: boolean) => S;
6195
6374
 
6196
- export declare const Subject: Schema.Union<[Schema.Struct<{
6197
- type: Schema.Literal<["user"]>;
6198
- id: typeof Schema.String;
6199
- tenantId: typeof Schema.String;
6200
- scopes: Schema.optional<Schema.Array$<typeof Schema.String>>;
6201
- metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
6375
+ export declare const Subject: Schema.Union<readonly [Schema.Struct<{
6376
+ readonly type: Schema.Literal<"user">;
6377
+ readonly id: Schema.String;
6378
+ readonly tenantId: Schema.String;
6379
+ readonly scopes: Schema.optional<Schema.$Array<Schema.String>>;
6380
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
6202
6381
  }>, Schema.Struct<{
6203
- type: Schema.Literal<["apiKey"]>;
6204
- id: typeof Schema.String;
6205
- tenantId: typeof Schema.String;
6206
- scopes: Schema.optional<Schema.Array$<typeof Schema.String>>;
6207
- metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
6382
+ readonly type: Schema.Literal<"apiKey">;
6383
+ readonly id: Schema.String;
6384
+ readonly tenantId: Schema.String;
6385
+ readonly scopes: Schema.optional<Schema.$Array<Schema.String>>;
6386
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
6208
6387
  }>, Schema.Struct<{
6209
- type: Schema.Literal<["serviceAccount"]>;
6210
- id: typeof Schema.String;
6211
- tenantId: typeof Schema.String;
6388
+ readonly type: Schema.Literal<"serviceAccount">;
6389
+ readonly id: Schema.String;
6390
+ readonly tenantId: Schema.String;
6212
6391
  /** Application actor used for audit columns; null means machine work with
6213
6392
  * no application actor. Identity only, never a permission grant. */
6214
- auditActorId: Schema.optionalWith<Schema.NullOr<typeof Schema.String>, {
6215
- exact: true;
6216
- }>;
6217
- scopes: Schema.optional<Schema.Array$<typeof Schema.String>>;
6218
- metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
6393
+ readonly auditActorId: Schema.optionalKey<Schema.NullOr<Schema.String>>;
6394
+ readonly scopes: Schema.optional<Schema.$Array<Schema.String>>;
6395
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
6219
6396
  }>, Schema.Struct<{
6220
- type: Schema.Literal<["anonymous"]>;
6221
- id: typeof Schema.Null;
6222
- tenantId: Schema.NullOr<typeof Schema.String>;
6397
+ readonly type: Schema.Literal<"anonymous">;
6398
+ readonly id: Schema.Null;
6399
+ readonly tenantId: Schema.NullOr<Schema.String>;
6223
6400
  /**
6224
6401
  * Set when this caller PRESENTED a credential and it was rejected — an
6225
6402
  * expired token above all. Absent when they presented none.
@@ -6236,21 +6413,21 @@ export declare const Subject: Schema.Union<[Schema.Struct<{
6236
6413
  * must not break an `openAccess` procedure that needs no session at all. The
6237
6414
  * fact travels, and only a guard that actually refuses spends it.
6238
6415
  */
6239
- credentialRejected: Schema.optional<typeof Schema.String>;
6416
+ readonly credentialRejected: Schema.optional<Schema.String>;
6240
6417
  }>, Schema.Struct<{
6241
- type: Schema.Literal<["system"]>;
6242
- id: typeof Schema.String;
6243
- tenantId: typeof Schema.Null;
6244
- scopes: Schema.optional<Schema.Array$<typeof Schema.String>>;
6245
- metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
6418
+ readonly type: Schema.Literal<"system">;
6419
+ readonly id: Schema.String;
6420
+ readonly tenantId: Schema.Null;
6421
+ readonly scopes: Schema.optional<Schema.$Array<Schema.String>>;
6422
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
6246
6423
  }>, Schema.Struct<{
6247
- type: Schema.Literal<["service"]>;
6248
- id: typeof Schema.String;
6424
+ readonly type: Schema.Literal<"service">;
6425
+ readonly id: Schema.String;
6249
6426
  /** The calling app's name, as the callee lists it in `serviceCallers`. */
6250
- service: typeof Schema.String;
6251
- tenantId: typeof Schema.Null;
6252
- scopes: Schema.optional<Schema.Array$<typeof Schema.String>>;
6253
- metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
6427
+ readonly service: Schema.String;
6428
+ readonly tenantId: Schema.Null;
6429
+ readonly scopes: Schema.optional<Schema.$Array<Schema.String>>;
6430
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
6254
6431
  }>]>;
6255
6432
 
6256
6433
  export declare type Subject = typeof Subject.Type;
@@ -6260,28 +6437,26 @@ export declare type Subject = typeof Subject.Type;
6260
6437
  * no authority and must not be inferred from user-provided metadata. */
6261
6438
  export declare const subjectAuditActorId: (subject: Subject) => string | null;
6262
6439
 
6263
- export declare const SubjectIdentity: Schema.Union<[Schema.Struct<{
6264
- type: Schema.Literal<["user"]>;
6265
- id: typeof Schema.String;
6266
- tenantId: typeof Schema.String;
6267
- metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
6440
+ export declare const SubjectIdentity: Schema.Union<readonly [Schema.Struct<{
6441
+ readonly type: Schema.Literal<"user">;
6442
+ readonly id: Schema.String;
6443
+ readonly tenantId: Schema.String;
6444
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
6268
6445
  }>, Schema.Struct<{
6269
- type: Schema.Literal<["apiKey"]>;
6270
- id: typeof Schema.String;
6271
- tenantId: typeof Schema.String;
6272
- metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
6446
+ readonly type: Schema.Literal<"apiKey">;
6447
+ readonly id: Schema.String;
6448
+ readonly tenantId: Schema.String;
6449
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
6273
6450
  }>, Schema.Struct<{
6274
- type: Schema.Literal<["serviceAccount"]>;
6275
- id: typeof Schema.String;
6276
- tenantId: typeof Schema.String;
6277
- metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
6278
- auditActorId: Schema.optionalWith<Schema.NullOr<typeof Schema.String>, {
6279
- exact: true;
6280
- }>;
6451
+ readonly type: Schema.Literal<"serviceAccount">;
6452
+ readonly id: Schema.String;
6453
+ readonly tenantId: Schema.String;
6454
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
6455
+ readonly auditActorId: Schema.optionalKey<Schema.NullOr<Schema.String>>;
6281
6456
  }>, Schema.Struct<{
6282
- type: Schema.Literal<["anonymous"]>;
6283
- id: typeof Schema.Null;
6284
- tenantId: Schema.NullOr<typeof Schema.String>;
6457
+ readonly type: Schema.Literal<"anonymous">;
6458
+ readonly id: Schema.Null;
6459
+ readonly tenantId: Schema.NullOr<Schema.String>;
6285
6460
  /**
6286
6461
  * Set when this caller PRESENTED a credential and it was rejected — an
6287
6462
  * expired token above all. Absent when they presented none.
@@ -6298,18 +6473,18 @@ export declare const SubjectIdentity: Schema.Union<[Schema.Struct<{
6298
6473
  * must not break an `openAccess` procedure that needs no session at all. The
6299
6474
  * fact travels, and only a guard that actually refuses spends it.
6300
6475
  */
6301
- credentialRejected: Schema.optional<typeof Schema.String>;
6476
+ readonly credentialRejected: Schema.optional<Schema.String>;
6302
6477
  }>, Schema.Struct<{
6303
- type: Schema.Literal<["system"]>;
6304
- id: typeof Schema.String;
6305
- tenantId: typeof Schema.Null;
6306
- metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
6478
+ readonly type: Schema.Literal<"system">;
6479
+ readonly id: Schema.String;
6480
+ readonly tenantId: Schema.Null;
6481
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
6307
6482
  }>, Schema.Struct<{
6308
- type: Schema.Literal<["service"]>;
6309
- id: typeof Schema.String;
6310
- tenantId: typeof Schema.Null;
6311
- metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
6312
- service: typeof Schema.String;
6483
+ readonly type: Schema.Literal<"service">;
6484
+ readonly id: Schema.String;
6485
+ readonly tenantId: Schema.Null;
6486
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
6487
+ readonly service: Schema.String;
6313
6488
  }>]>;
6314
6489
 
6315
6490
  export declare type SubjectIdentity = typeof SubjectIdentity.Type;
@@ -6344,7 +6519,7 @@ export declare const subjectScopes: (subject: Subject) => ReadonlyArray<string>;
6344
6519
  export declare class SubjectService extends SubjectService_base {
6345
6520
  }
6346
6521
 
6347
- declare const SubjectService_base: Context.TagClass<SubjectService, "@voltro/Subject", {
6522
+ declare const SubjectService_base: Context.ServiceClass<SubjectService, "@voltro/Subject", {
6348
6523
  readonly type: "user";
6349
6524
  readonly id: string;
6350
6525
  readonly tenantId: string;
@@ -6386,11 +6561,11 @@ declare const SubjectService_base: Context.TagClass<SubjectService, "@voltro/Sub
6386
6561
  readonly type: "service";
6387
6562
  readonly id: string;
6388
6563
  readonly tenantId: null;
6564
+ readonly service: string;
6389
6565
  readonly scopes?: readonly string[] | undefined;
6390
6566
  readonly metadata?: {
6391
6567
  readonly [x: string]: unknown;
6392
6568
  } | undefined;
6393
- readonly service: string;
6394
6569
  }>;
6395
6570
 
6396
6571
  /** Subscribe to server-primitive errors. Returns an unsubscribe fn. */
@@ -6413,55 +6588,39 @@ export declare type SubscriptionEvent<T> = {
6413
6588
  readonly revision?: number | undefined;
6414
6589
  };
6415
6590
 
6416
- export declare const subscriptionEvent: <D extends Schema.Schema.Any>(data: D) => Schema.Union<[Schema.Struct<{
6417
- _tag: Schema.Literal<["snapshot"]>;
6418
- revision: typeof Schema.Number;
6419
- data: D;
6420
- computed: Schema.optional<typeof Schema.Boolean>;
6421
- reconciles: Schema.optional<typeof Schema.String>;
6591
+ export declare const subscriptionEvent: <D extends Schema.Top>(data: D) => Schema.Union<readonly [Schema.Struct<{
6592
+ readonly _tag: Schema.Literal<"snapshot">;
6593
+ readonly revision: Schema.Number;
6594
+ readonly data: D;
6595
+ readonly computed: Schema.optional<Schema.Boolean>;
6596
+ readonly reconciles: Schema.optional<Schema.String>;
6422
6597
  }>, Schema.Struct<{
6423
- _tag: Schema.Literal<["delta"]>;
6424
- revision: typeof Schema.Number;
6425
- emittedAt: typeof Schema.Number;
6426
- patch: Schema.Struct<{
6427
- ops: Schema.Array$<Schema.Union<[Schema.Struct<{
6428
- op: Schema.Literal<["add"]>;
6429
- path: typeof Schema.String;
6430
- value: Schema.refine<{
6431
- readonly [x: string]: unknown;
6432
- } & Readonly<Record<string, unknown>> & {
6433
- readonly id: RowId;
6434
- }, Schema.Schema<{
6435
- readonly [x: string]: unknown;
6436
- }, {
6437
- readonly [x: string]: unknown;
6438
- }, never>>;
6598
+ readonly _tag: Schema.Literal<"delta">;
6599
+ readonly revision: Schema.Number;
6600
+ readonly emittedAt: Schema.Number;
6601
+ readonly patch: Schema.Struct<{
6602
+ readonly ops: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
6603
+ readonly op: Schema.Literal<"add">;
6604
+ readonly path: Schema.String;
6605
+ readonly value: Schema.refine< PatchRow, Schema.$Record<Schema.String, Schema.decodeTo<Schema.Unknown, Schema.Unknown, never, never>>>;
6439
6606
  }>, Schema.Struct<{
6440
- op: Schema.Literal<["replace"]>;
6441
- path: typeof Schema.String;
6442
- value: Schema.refine<{
6443
- readonly [x: string]: unknown;
6444
- } & Readonly<Record<string, unknown>> & {
6445
- readonly id: RowId;
6446
- }, Schema.Schema<{
6447
- readonly [x: string]: unknown;
6448
- }, {
6449
- readonly [x: string]: unknown;
6450
- }, never>>;
6607
+ readonly op: Schema.Literal<"replace">;
6608
+ readonly path: Schema.String;
6609
+ readonly value: Schema.refine< PatchRow, Schema.$Record<Schema.String, Schema.decodeTo<Schema.Unknown, Schema.Unknown, never, never>>>;
6451
6610
  }>, Schema.Struct<{
6452
- op: Schema.Literal<["remove"]>;
6453
- path: typeof Schema.String;
6611
+ readonly op: Schema.Literal<"remove">;
6612
+ readonly path: Schema.String;
6454
6613
  }>, Schema.Struct<{
6455
- op: Schema.Literal<["mergeCells"]>;
6456
- path: typeof Schema.String;
6457
- value: Schema.Record$<typeof Schema.String, Schema.transform<typeof Schema.Unknown, typeof Schema.Unknown>>;
6614
+ readonly op: Schema.Literal<"mergeCells">;
6615
+ readonly path: Schema.String;
6616
+ readonly value: Schema.$Record<Schema.String, Schema.decodeTo<Schema.Unknown, Schema.Unknown, never, never>>;
6458
6617
  }>]>>;
6459
- order: Schema.Array$<Schema.Union<[typeof Schema.String, typeof Schema.Number]>>;
6618
+ readonly order: Schema.NullOr<Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Number]>>>;
6460
6619
  }>;
6461
6620
  }>, Schema.Struct<{
6462
- _tag: Schema.Literal<["error"]>;
6463
- error: typeof Schema.Unknown;
6464
- revision: Schema.optional<typeof Schema.Number>;
6621
+ readonly _tag: Schema.Literal<"error">;
6622
+ readonly error: Schema.decodeTo<Schema.Unknown, Schema.Codec<Schema.Json, Schema.Json, never, never>, never, never>;
6623
+ readonly revision: Schema.optional<Schema.Number>;
6465
6624
  }>]>;
6466
6625
 
6467
6626
  export declare interface SurfaceMismatch {
@@ -6534,21 +6693,20 @@ export declare type TableName = keyof VoltroTableNames extends never ? string :
6534
6693
  * leak the original Schema instance).
6535
6694
  */
6536
6695
  export declare class TableValidationFailed extends TableValidationFailed_base {
6696
+ get message(): string;
6537
6697
  }
6538
6698
 
6539
- declare const TableValidationFailed_base: Schema.TaggedErrorClass<TableValidationFailed, "TableValidationFailed", {
6540
- readonly _tag: Schema.tag<"TableValidationFailed">;
6541
- } & {
6699
+ declare const TableValidationFailed_base: Schema.Class<TableValidationFailed, Schema.TaggedStruct<"TableValidationFailed", {
6542
6700
  /** The table the row targeted. */
6543
- table: typeof Schema.String;
6701
+ readonly table: Schema.String;
6544
6702
  /** Top-level explanation for logs + UI ("user.email failed pattern check"). */
6545
- summary: typeof Schema.String;
6703
+ readonly summary: Schema.String;
6546
6704
  /** Flat list of `{ path, message }` per failing leaf. Path uses dot-notation. */
6547
- issues: Schema.Array$<Schema.Struct<{
6548
- path: typeof Schema.String;
6549
- message: typeof Schema.String;
6705
+ readonly issues: Schema.$Array<Schema.Struct<{
6706
+ readonly path: Schema.String;
6707
+ readonly message: Schema.String;
6550
6708
  }>>;
6551
- }>;
6709
+ }>, YieldableError>;
6552
6710
 
6553
6711
  export declare type Target<Input = unknown, Row = unknown> = TargetSpec<Input, Row> | ReadonlyArray<TargetSpec<Input, Row>>;
6554
6712
 
@@ -6625,16 +6783,14 @@ export declare type TargetSpec<Input = unknown, Row = unknown> = InsertTarget<In
6625
6783
  export declare class TenantRowNotFound extends TenantRowNotFound_base {
6626
6784
  }
6627
6785
 
6628
- declare const TenantRowNotFound_base: Schema.TaggedErrorClass<TenantRowNotFound, "TenantRowNotFound", {
6629
- readonly _tag: Schema.tag<"TenantRowNotFound">;
6630
- } & {
6786
+ declare const TenantRowNotFound_base: Schema.Class<TenantRowNotFound, Schema.TaggedStruct<"TenantRowNotFound", {
6631
6787
  /** The table the keyed write targeted. */
6632
- table: typeof Schema.String;
6788
+ readonly table: Schema.String;
6633
6789
  /** The primary key the CALLER supplied. Echoing it leaks nothing. */
6634
- id: typeof Schema.String;
6790
+ readonly id: Schema.String;
6635
6791
  /** Human-readable explanation for diagnostics + UI. */
6636
- reason: typeof Schema.String;
6637
- }>;
6792
+ readonly reason: Schema.String;
6793
+ }>, YieldableError>;
6638
6794
 
6639
6795
  /**
6640
6796
  * The subject a `storeForTenant(id)` view runs as — the caller's identity,
@@ -6665,14 +6821,12 @@ export declare const tenantScopedSubject: (subject: Subject, tenantId: string) =
6665
6821
  export declare class TenantScopeViolation extends TenantScopeViolation_base {
6666
6822
  }
6667
6823
 
6668
- declare const TenantScopeViolation_base: Schema.TaggedErrorClass<TenantScopeViolation, "TenantScopeViolation", {
6669
- readonly _tag: Schema.tag<"TenantScopeViolation">;
6670
- } & {
6824
+ declare const TenantScopeViolation_base: Schema.Class<TenantScopeViolation, Schema.TaggedStruct<"TenantScopeViolation", {
6671
6825
  /** The table the violating write targeted. */
6672
- table: typeof Schema.String;
6826
+ readonly table: Schema.String;
6673
6827
  /** Human-readable explanation for diagnostics + UI. */
6674
- reason: typeof Schema.String;
6675
- }>;
6828
+ readonly reason: Schema.String;
6829
+ }>, YieldableError>;
6676
6830
 
6677
6831
  /** The subject types a selection can apply to: those with an id AND a tenant.
6678
6832
  * `anonymous` has no id to remember a selection under; `system` has no
@@ -6695,14 +6849,12 @@ export declare interface TenantSelectionIdentity {
6695
6849
  export declare class TenantSelectionRefused extends TenantSelectionRefused_base {
6696
6850
  }
6697
6851
 
6698
- declare const TenantSelectionRefused_base: Schema.TaggedErrorClass<TenantSelectionRefused, "TenantSelectionRefused", {
6699
- readonly _tag: Schema.tag<"TenantSelectionRefused">;
6700
- } & {
6701
- subjectType: typeof Schema.String;
6702
- subjectId: Schema.NullOr<typeof Schema.String>;
6703
- tenantId: typeof Schema.String;
6704
- reason: Schema.Literal<["not-a-member", "subject-has-no-tenant"]>;
6705
- }>;
6852
+ declare const TenantSelectionRefused_base: Schema.Class<TenantSelectionRefused, Schema.TaggedStruct<"TenantSelectionRefused", {
6853
+ readonly subjectType: Schema.String;
6854
+ readonly subjectId: Schema.NullOr<Schema.String>;
6855
+ readonly tenantId: Schema.String;
6856
+ readonly reason: Schema.Literals<readonly ["not-a-member", "subject-has-no-tenant"]>;
6857
+ }>, YieldableError>;
6706
6858
 
6707
6859
  /** Where `composeAuthStrategies` finds a stored selection. `@voltro/runtime`'s
6708
6860
  * `tenantSelectionStore(store)` is the framework's implementation over the
@@ -6716,56 +6868,40 @@ export declare interface TenantSelectionStore {
6716
6868
  readonly clear: (identity: TenantSelectionIdentity) => Promise<void>;
6717
6869
  }
6718
6870
 
6719
- export declare const toRpc: <Name extends string, Input extends Schema.Schema.Any, Output extends Schema.Schema.Any, Err extends Schema.Schema.All>(descriptor: QueryProcedureDescriptor<Name, Input, Output, Err> | MutationProcedureDescriptor<Name, Input, Output, Err> | ActionProcedureDescriptor<Name, Input, Output, Err> | StreamProcedureDescriptor<Name, Input, Output, Err>) => Rpc.Rpc<Name, Input extends Schema.Struct.Fields ? Schema.Struct<Input> : Input, Stream<Schema.Union<[Schema.Struct<{
6720
- _tag: Schema.Literal<["snapshot"]>;
6721
- revision: typeof Schema.Number;
6722
- data: Output;
6723
- computed: Schema.optional<typeof Schema.Boolean>;
6724
- reconciles: Schema.optional<typeof Schema.String>;
6871
+ 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<{
6872
+ readonly _tag: Schema.Literal<"snapshot">;
6873
+ readonly revision: Schema.Number;
6874
+ readonly data: Output;
6875
+ readonly computed: Schema.optional<Schema.Boolean>;
6876
+ readonly reconciles: Schema.optional<Schema.String>;
6725
6877
  }>, Schema.Struct<{
6726
- _tag: Schema.Literal<["delta"]>;
6727
- revision: typeof Schema.Number;
6728
- emittedAt: typeof Schema.Number;
6729
- patch: Schema.Struct<{
6730
- ops: Schema.Array$<Schema.Union<[Schema.Struct<{
6731
- op: Schema.Literal<["add"]>;
6732
- path: typeof Schema.String;
6733
- value: Schema.refine<{
6734
- readonly [x: string]: unknown;
6735
- } & Readonly<Record<string, unknown>> & {
6736
- readonly id: RowId;
6737
- }, Schema.Schema<{
6738
- readonly [x: string]: unknown;
6739
- }, {
6740
- readonly [x: string]: unknown;
6741
- }, never>>;
6878
+ readonly _tag: Schema.Literal<"delta">;
6879
+ readonly revision: Schema.Number;
6880
+ readonly emittedAt: Schema.Number;
6881
+ readonly patch: Schema.Struct<{
6882
+ readonly ops: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
6883
+ readonly op: Schema.Literal<"add">;
6884
+ readonly path: Schema.String;
6885
+ readonly value: Schema.refine< PatchRow, Schema.$Record<Schema.String, Schema.decodeTo<Schema.Unknown, Schema.Unknown, never, never>>>;
6742
6886
  }>, Schema.Struct<{
6743
- op: Schema.Literal<["replace"]>;
6744
- path: typeof Schema.String;
6745
- value: Schema.refine<{
6746
- readonly [x: string]: unknown;
6747
- } & Readonly<Record<string, unknown>> & {
6748
- readonly id: RowId;
6749
- }, Schema.Schema<{
6750
- readonly [x: string]: unknown;
6751
- }, {
6752
- readonly [x: string]: unknown;
6753
- }, never>>;
6887
+ readonly op: Schema.Literal<"replace">;
6888
+ readonly path: Schema.String;
6889
+ readonly value: Schema.refine< PatchRow, Schema.$Record<Schema.String, Schema.decodeTo<Schema.Unknown, Schema.Unknown, never, never>>>;
6754
6890
  }>, Schema.Struct<{
6755
- op: Schema.Literal<["remove"]>;
6756
- path: typeof Schema.String;
6891
+ readonly op: Schema.Literal<"remove">;
6892
+ readonly path: Schema.String;
6757
6893
  }>, Schema.Struct<{
6758
- op: Schema.Literal<["mergeCells"]>;
6759
- path: typeof Schema.String;
6760
- value: Schema.Record$<typeof Schema.String, Schema.transform<typeof Schema.Unknown, typeof Schema.Unknown>>;
6894
+ readonly op: Schema.Literal<"mergeCells">;
6895
+ readonly path: Schema.String;
6896
+ readonly value: Schema.$Record<Schema.String, Schema.decodeTo<Schema.Unknown, Schema.Unknown, never, never>>;
6761
6897
  }>]>>;
6762
- order: Schema.Array$<Schema.Union<[typeof Schema.String, typeof Schema.Number]>>;
6898
+ readonly order: Schema.NullOr<Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Number]>>>;
6763
6899
  }>;
6764
6900
  }>, Schema.Struct<{
6765
- _tag: Schema.Literal<["error"]>;
6766
- error: typeof Schema.Unknown;
6767
- revision: Schema.optional<typeof Schema.Number>;
6768
- }>]>, Schema.Schema.All>, typeof Schema.Never, never> | Rpc.Rpc<Name, Input extends Schema.Struct.Fields ? Schema.Struct<Input> : Input, Output, Schema.Schema.All, never> | Rpc.Rpc<Name, Input extends Schema.Struct.Fields ? Schema.Struct<Input> : Input, Stream<Output, Schema.Schema.All>, typeof Schema.Never, never>;
6901
+ readonly _tag: Schema.Literal<"error">;
6902
+ readonly error: Schema.decodeTo<Schema.Unknown, Schema.Codec<Schema.Json, Schema.Json, never, never>, never, never>;
6903
+ readonly revision: Schema.optional<Schema.Number>;
6904
+ }>]>, Schema.Top>, Schema.Never, never, never> | Rpc.Rpc<Name, Input extends Schema.Struct.Fields ? Schema.Struct<Input> : Input, Output, Schema.Top, never, never> | Rpc.Rpc<Name, Input extends Schema.Struct.Fields ? Schema.Struct<Input> : Input, Stream<Output, Schema.Top>, Schema.Never, never, never>;
6769
6905
 
6770
6906
  export declare const toSnakeCase: (key: string) => string;
6771
6907
 
@@ -6777,7 +6913,7 @@ export declare const tsMs: (v: unknown) => number;
6777
6913
 
6778
6914
  /**
6779
6915
  * Typed error every handler can throw to signal "you must be signed
6780
- * in to perform this action". The framework's @effect/rpc layer
6916
+ * in to perform this action". The framework's effect/rpc layer
6781
6917
  * preserves the `_tag` across the wire, and `@voltro/client`'s error
6782
6918
  * bus surfaces it to the consuming app so the dashboard can
6783
6919
  * auto-redirect to the sign-in page (cleared session + UI swap).
@@ -6787,14 +6923,13 @@ export declare const tsMs: (v: unknown) => number;
6787
6923
  * resolved at all" — anonymous, expired token, missing cookie, etc.
6788
6924
  */
6789
6925
  export declare class Unauthenticated extends Unauthenticated_base {
6926
+ get message(): string;
6790
6927
  }
6791
6928
 
6792
- declare const Unauthenticated_base: Schema.TaggedErrorClass<Unauthenticated, "Unauthenticated", {
6793
- readonly _tag: Schema.tag<"Unauthenticated">;
6794
- } & {
6929
+ declare const Unauthenticated_base: Schema.Class<Unauthenticated, Schema.TaggedStruct<"Unauthenticated", {
6795
6930
  /** Optional context — e.g. "auth.signin required", "session expired". */
6796
- reason: Schema.optional<typeof Schema.String>;
6797
- }>;
6931
+ readonly reason: Schema.optional<Schema.String>;
6932
+ }>, YieldableError>;
6798
6933
 
6799
6934
  /**
6800
6935
  * Channel keys named by a `source:` that no `reactivityChannel()` declared.
@@ -6823,10 +6958,10 @@ export declare const UNDO_REDO_TAG: "__voltro.undo.redo";
6823
6958
  * No `target` (it writes whatever tables the change-set touched — its effects
6824
6959
  * reach the client via those tables' own reactive deltas, not optimistic). */
6825
6960
  export declare const undoApplyDescriptor: MutationProcedureDescriptor<"__voltro.undo.apply", Schema.Struct<{
6826
- invocationId: typeof Schema.String;
6961
+ readonly invocationId: Schema.String;
6827
6962
  }>, Schema.Struct<{
6828
- ok: typeof Schema.Boolean;
6829
- }>, Schema.Union<[typeof UndoNotFound, typeof UndoForbidden, typeof UndoConflict]>>;
6963
+ readonly ok: Schema.Boolean;
6964
+ }>, Schema.Union<readonly [typeof UndoNotFound, typeof UndoForbidden, typeof UndoConflict]>>;
6830
6965
 
6831
6966
  /** The row changed since the action (a concurrent writer), OR the action
6832
6967
  * crossed an external side effect — a blind restore would clobber/lie, so
@@ -6835,38 +6970,34 @@ export declare const undoApplyDescriptor: MutationProcedureDescriptor<"__voltro.
6835
6970
  export declare class UndoConflict extends UndoConflict_base {
6836
6971
  }
6837
6972
 
6838
- declare const UndoConflict_base: Schema.TaggedErrorClass<UndoConflict, "UndoConflict", {
6839
- readonly _tag: Schema.tag<"UndoConflict">;
6840
- } & {
6841
- invocationId: typeof Schema.String;
6842
- reason: Schema.Literal<["conflict", "action"]>;
6843
- }>;
6973
+ declare const UndoConflict_base: Schema.Class<UndoConflict, Schema.TaggedStruct<"UndoConflict", {
6974
+ readonly invocationId: Schema.String;
6975
+ readonly reason: Schema.Literals<readonly ["conflict", "action"]>;
6976
+ }>, YieldableError>;
6844
6977
 
6845
6978
  /** The action belongs to a different subject — undo is per-actor. */
6846
6979
  export declare class UndoForbidden extends UndoForbidden_base {
6847
6980
  }
6848
6981
 
6849
- declare const UndoForbidden_base: Schema.TaggedErrorClass<UndoForbidden, "UndoForbidden", {
6850
- readonly _tag: Schema.tag<"UndoForbidden">;
6851
- } & {
6852
- invocationId: typeof Schema.String;
6853
- }>;
6982
+ declare const UndoForbidden_base: Schema.Class<UndoForbidden, Schema.TaggedStruct<"UndoForbidden", {
6983
+ readonly invocationId: Schema.String;
6984
+ }>, YieldableError>;
6854
6985
 
6855
6986
  /** One undoable action in the calling subject's recent history. The heavy
6856
6987
  * `changes` payload is server-only — the client list needs only this. */
6857
6988
  export declare const UndoLogEntry: Schema.Struct<{
6858
6989
  /** The invocation id (= the `_voltro_undo_log` row id) to pass to apply/redo. */
6859
- id: typeof Schema.String;
6990
+ readonly id: Schema.String;
6860
6991
  /** Rpc tag of the captured mutation (e.g. `todos.create`). */
6861
- tag: typeof Schema.String;
6992
+ readonly tag: Schema.String;
6862
6993
  /** Human label ("create todo") — falls back to the tag. */
6863
- label: Schema.NullOr<typeof Schema.String>;
6994
+ readonly label: Schema.NullOr<Schema.String>;
6864
6995
  /** True once undone (so the UI shows it as redo-able). */
6865
- undone: typeof Schema.Boolean;
6996
+ readonly undone: Schema.Boolean;
6866
6997
  /** True when the action crossed an external side effect → not undoable. */
6867
- crossesAction: typeof Schema.Boolean;
6998
+ readonly crossesAction: Schema.Boolean;
6868
6999
  /** Display-only creation time (stringified). */
6869
- createdAt: typeof Schema.String;
7000
+ readonly createdAt: Schema.String;
6870
7001
  }>;
6871
7002
 
6872
7003
  export declare type UndoLogEntry = Schema.Schema.Type<typeof UndoLogEntry>;
@@ -6875,38 +7006,36 @@ export declare type UndoLogEntry = Schema.Schema.Type<typeof UndoLogEntry>;
6875
7006
  * first. Reactive (source `_voltro_undo_log`) so the list updates live as the
6876
7007
  * subject makes + undoes changes. */
6877
7008
  export declare const undoLogQueryDescriptor: QueryProcedureDescriptor<"__voltro.undo.log", Schema.Struct<{
6878
- limit: Schema.optional<typeof Schema.Number>;
6879
- }>, Schema.Array$<Schema.Struct<{
7009
+ readonly limit: Schema.optional<Schema.Number>;
7010
+ }>, Schema.$Array<Schema.Struct<{
6880
7011
  /** The invocation id (= the `_voltro_undo_log` row id) to pass to apply/redo. */
6881
- id: typeof Schema.String;
7012
+ readonly id: Schema.String;
6882
7013
  /** Rpc tag of the captured mutation (e.g. `todos.create`). */
6883
- tag: typeof Schema.String;
7014
+ readonly tag: Schema.String;
6884
7015
  /** Human label ("create todo") — falls back to the tag. */
6885
- label: Schema.NullOr<typeof Schema.String>;
7016
+ readonly label: Schema.NullOr<Schema.String>;
6886
7017
  /** True once undone (so the UI shows it as redo-able). */
6887
- undone: typeof Schema.Boolean;
7018
+ readonly undone: Schema.Boolean;
6888
7019
  /** True when the action crossed an external side effect → not undoable. */
6889
- crossesAction: typeof Schema.Boolean;
7020
+ readonly crossesAction: Schema.Boolean;
6890
7021
  /** Display-only creation time (stringified). */
6891
- createdAt: typeof Schema.String;
6892
- }>>, typeof Schema.Never>;
7022
+ readonly createdAt: Schema.String;
7023
+ }>>, Schema.Never>;
6893
7024
 
6894
7025
  /** No undo-log row for that invocation (already pruned, or wrong id). */
6895
7026
  export declare class UndoNotFound extends UndoNotFound_base {
6896
7027
  }
6897
7028
 
6898
- declare const UndoNotFound_base: Schema.TaggedErrorClass<UndoNotFound, "UndoNotFound", {
6899
- readonly _tag: Schema.tag<"UndoNotFound">;
6900
- } & {
6901
- invocationId: typeof Schema.String;
6902
- }>;
7029
+ declare const UndoNotFound_base: Schema.Class<UndoNotFound, Schema.TaggedStruct<"UndoNotFound", {
7030
+ readonly invocationId: Schema.String;
7031
+ }>, YieldableError>;
6903
7032
 
6904
7033
  /** `__voltro.undo.redo` — re-apply a previously-undone invocation's forward changes. */
6905
7034
  export declare const undoRedoDescriptor: MutationProcedureDescriptor<"__voltro.undo.redo", Schema.Struct<{
6906
- invocationId: typeof Schema.String;
7035
+ readonly invocationId: Schema.String;
6907
7036
  }>, Schema.Struct<{
6908
- ok: typeof Schema.Boolean;
6909
- }>, Schema.Union<[typeof UndoNotFound, typeof UndoForbidden, typeof UndoConflict]>>;
7037
+ readonly ok: Schema.Boolean;
7038
+ }>, Schema.Union<readonly [typeof UndoNotFound, typeof UndoForbidden, typeof UndoConflict]>>;
6910
7039
 
6911
7040
  export declare interface UpdateTarget<Input = unknown, Row = unknown, Item = Record<string, unknown>> extends NestedTargetFields<Input> {
6912
7041
  readonly table: string;
@@ -6925,6 +7054,9 @@ export declare interface UpdateTarget<Input = unknown, Row = unknown, Item = Rec
6925
7054
  readonly shapeItem?: ((input: Input, current: Item) => Item) | undefined;
6926
7055
  }
6927
7056
 
7057
+ /** Refuse malformed runtime contributions before starting a worker. */
7058
+ export declare function validateOutboxHandlerDefinition(value: unknown, owner: string): asserts value is OutboxHandlerDefinition<unknown>;
7059
+
6928
7060
  /**
6929
7061
  * A server-side validation failure pinned to ONE field.
6930
7062
  *
@@ -6936,13 +7068,11 @@ export declare interface UpdateTarget<Input = unknown, Row = unknown, Item = Rec
6936
7068
  export declare class ValidationError extends ValidationError_base {
6937
7069
  }
6938
7070
 
6939
- declare const ValidationError_base: Schema.TaggedErrorClass<ValidationError, "ValidationError", {
6940
- readonly _tag: Schema.tag<"ValidationError">;
6941
- } & {
6942
- field: typeof Schema.String;
6943
- message: typeof Schema.String;
6944
- params: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
6945
- }>;
7071
+ declare const ValidationError_base: Schema.Class<ValidationError, Schema.TaggedStruct<"ValidationError", {
7072
+ readonly field: Schema.String;
7073
+ readonly message: Schema.String;
7074
+ readonly params: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
7075
+ }>, YieldableError>;
6946
7076
 
6947
7077
  /** Several field-addressed failures at once — one round trip, every field
6948
7078
  * marked. `issues` is non-empty by construction (`ctx.validation.failAll`
@@ -6950,23 +7080,21 @@ declare const ValidationError_base: Schema.TaggedErrorClass<ValidationError, "Va
6950
7080
  export declare class ValidationErrors extends ValidationErrors_base {
6951
7081
  }
6952
7082
 
6953
- declare const ValidationErrors_base: Schema.TaggedErrorClass<ValidationErrors, "ValidationErrors", {
6954
- readonly _tag: Schema.tag<"ValidationErrors">;
6955
- } & {
6956
- issues: Schema.filter<Schema.Array$<Schema.Struct<{
6957
- field: typeof Schema.String;
6958
- message: typeof Schema.String;
6959
- params: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
6960
- }>>>;
6961
- }>;
7083
+ declare const ValidationErrors_base: Schema.Class<ValidationErrors, Schema.TaggedStruct<"ValidationErrors", {
7084
+ readonly issues: Schema.$Array<Schema.Struct<{
7085
+ readonly field: Schema.String;
7086
+ readonly message: Schema.String;
7087
+ readonly params: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
7088
+ }>>;
7089
+ }>, YieldableError>;
6962
7090
 
6963
7091
  /** One field-addressed validation issue: `field` is the form path
6964
7092
  * (`'email'`, `'address.city'`, `'entries.0.startsAt'`), `message` is a
6965
7093
  * message id (or verbatim text), `params` feed the message template. */
6966
7094
  export declare const ValidationIssue: Schema.Struct<{
6967
- field: typeof Schema.String;
6968
- message: typeof Schema.String;
6969
- params: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
7095
+ readonly field: Schema.String;
7096
+ readonly message: Schema.String;
7097
+ readonly params: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
6970
7098
  }>;
6971
7099
 
6972
7100
  export declare type ValidationIssueShape = Schema.Schema.Type<typeof ValidationIssue>;
@@ -7104,7 +7232,7 @@ export declare interface VoltroPlugin {
7104
7232
  * the plugin will surface a config form in the dashboard, or when
7105
7233
  * the plugin reads dynamic config from env / a config file.
7106
7234
  */
7107
- readonly configSchema?: Schema.Schema.Any;
7235
+ readonly configSchema?: Schema.Top;
7108
7236
  /**
7109
7237
  * Wraps every MUTATION handler call. Composed in declaration order
7110
7238
  * across the plugin list: outermost = first listed in app.config.ts.
@@ -7112,6 +7240,16 @@ export declare interface VoltroPlugin {
7112
7240
  * (schema-only / lifecycle-only plugins are fine).
7113
7241
  */
7114
7242
  readonly interceptMutation?: RpcInterceptor;
7243
+ /** Runs after successful executor and business-rule evaluation, before the
7244
+ * transaction commits. Use only the supplied store for required records or
7245
+ * durable intents. External I/O is prohibited; transaction retries replay
7246
+ * this hook. Requires rpc:intercept:mutation and store:write permissions.
7247
+ * Ordinary RPC interceptors retain their existing outside-transaction scope. */
7248
+ readonly beforeMutationCommit?: MutationCommitHook;
7249
+ /** Post-commit delivery handlers, registered with the shared app worker in
7250
+ * Dev and serve. Requires outbox:handle; effects must not collide with app,
7251
+ * framework or other plugin contributions. Handlers must be idempotent. */
7252
+ readonly outboxHandlers?: ReadonlyArray<OutboxHandlerDefinition<unknown>>;
7115
7253
  /**
7116
7254
  * Wraps every QUERY (streaming subscription handler) call. Same
7117
7255
  * composition semantics as `interceptMutation`. Most observability
@@ -7396,6 +7534,8 @@ export declare interface VoltroPlugin {
7396
7534
  * SDK here). Returns of `undefined`/empty are no-ops.
7397
7535
  */
7398
7536
  readonly contributeObservability?: (ctx: PluginLifecycleContext) => Promise<ObservabilityContribution | undefined> | ObservabilityContribution | undefined;
7537
+ /** Enforce a hand-authored REST route's quota through this plugin. */
7538
+ readonly restRateLimit?: RestServeBindings['rateLimit'];
7399
7539
  /**
7400
7540
  * Told the app's mounted REST surface — hand-authored `restRoutes` AND the
7401
7541
  * routes projected from `publicApi` annotations — once the boot has built it,
@@ -7592,11 +7732,11 @@ export declare const wireAudienceOf: (descriptor: {
7592
7732
  * paths. Pass the same `extraErrors` the lifter receives.
7593
7733
  */
7594
7734
  export declare const wireErrorUnion: (descriptor: {
7595
- readonly error: Schema.Schema.All;
7735
+ readonly error: Schema.Top;
7596
7736
  readonly guards?: DeclaredAccess | undefined;
7597
7737
  readonly requiresApproval?: AnyApprovalPolicy | undefined;
7598
7738
  readonly idempotencyScope?: MutationIdempotencyScope | undefined;
7599
- }, kind: "query" | "mutation" | "action" | "stream", extraErrors?: ExtraErrors) => Schema.Schema.All;
7739
+ }, kind: "query" | "mutation" | "action" | "stream", extraErrors?: ExtraErrors) => Schema.Top;
7600
7740
 
7601
7741
  /** A procedure kind that has a wire error union. */
7602
7742
  export declare type WireProcedureKind = keyof typeof FRAMEWORK_WIRE_ERRORS;
@@ -7730,45 +7870,41 @@ export declare interface WorkflowAccessOptions<Payload = unknown> {
7730
7870
  export declare const WorkflowAccessProperty: unique symbol;
7731
7871
 
7732
7872
  export declare const workflowCancelDescriptor: ActionProcedureDescriptor<"__voltro.workflow.cancel", Schema.Struct<{
7733
- workflowName: typeof Schema.String;
7734
- executionId: typeof Schema.String;
7735
- control: Schema.optional<Schema.Struct<{
7736
- requestId: typeof Schema.NonEmptyString;
7737
- cause: Schema.optionalWith<Schema.Struct<{
7738
- reason: typeof Schema.NonEmptyString;
7739
- detail: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
7740
- }>, {
7741
- exact: true;
7742
- }>;
7873
+ readonly workflowName: Schema.String;
7874
+ readonly executionId: Schema.String;
7875
+ readonly control: Schema.optional<Schema.Struct<{
7876
+ readonly requestId: Schema.NonEmptyString;
7877
+ readonly cause: Schema.optionalKey<Schema.Struct<{
7878
+ readonly reason: Schema.NonEmptyString;
7879
+ readonly detail: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
7880
+ }>>;
7743
7881
  }>>;
7744
- }>, Schema.filter<Schema.Struct<{
7745
- operation: Schema.Literal<["cancel", "resume"]>;
7746
- kind: Schema.Literal<["accepted", "confirmed", "unknown", "already-terminal"]>;
7747
- requestId: Schema.NullOr<typeof Schema.NonEmptyString>;
7748
- snapshot: Schema.Struct<{
7749
- id: typeof Schema.String;
7750
- workflowName: typeof Schema.String;
7751
- executionId: typeof Schema.String;
7752
- status: Schema.Union<[Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>, Schema.Literal<["unknown"]>]>;
7753
- output: Schema.optional<typeof Schema.Unknown>;
7754
- error: Schema.optional<Schema.Struct<{
7755
- tag: Schema.NullOr<typeof Schema.String>;
7756
- message: typeof Schema.String;
7882
+ }>, Schema.Struct<{
7883
+ readonly operation: Schema.Literals<readonly ["cancel", "resume"]>;
7884
+ readonly kind: Schema.Literals<readonly ["accepted", "confirmed", "unknown", "already-terminal"]>;
7885
+ readonly requestId: Schema.NullOr<Schema.NonEmptyString>;
7886
+ readonly snapshot: Schema.Struct<{
7887
+ readonly id: Schema.String;
7888
+ readonly workflowName: Schema.String;
7889
+ readonly executionId: Schema.String;
7890
+ readonly status: Schema.Union<readonly [Schema.Literals<readonly ["running", "succeeded", "failed", "cancelled", "suspended"]>, Schema.Literal<"unknown">]>;
7891
+ readonly output: Schema.optional<Schema.Unknown>;
7892
+ readonly error: Schema.optional<Schema.Struct<{
7893
+ readonly tag: Schema.NullOr<Schema.String>;
7894
+ readonly message: Schema.String;
7757
7895
  }>>;
7758
7896
  }>;
7759
- }>>, typeof Schema.Never>;
7897
+ }>, Schema.Never>;
7760
7898
 
7761
7899
  export declare const WorkflowControlInputSchema: Schema.Struct<{
7762
- workflowName: typeof Schema.String;
7763
- executionId: typeof Schema.String;
7764
- control: Schema.optional<Schema.Struct<{
7765
- requestId: typeof Schema.NonEmptyString;
7766
- cause: Schema.optionalWith<Schema.Struct<{
7767
- reason: typeof Schema.NonEmptyString;
7768
- detail: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
7769
- }>, {
7770
- exact: true;
7771
- }>;
7900
+ readonly workflowName: Schema.String;
7901
+ readonly executionId: Schema.String;
7902
+ readonly control: Schema.optional<Schema.Struct<{
7903
+ readonly requestId: 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
+ }>>;
7772
7908
  }>>;
7773
7909
  }>;
7774
7910
 
@@ -7776,616 +7912,608 @@ export declare type WorkflowControlIntent = Schema.Schema.Type<typeof WorkflowCo
7776
7912
 
7777
7913
  /** Stable caller-owned intent for retry after an uncertain transport result. */
7778
7914
  export declare const WorkflowControlIntentSchema: Schema.Struct<{
7779
- requestId: typeof Schema.NonEmptyString;
7780
- cause: Schema.optionalWith<Schema.Struct<{
7781
- reason: typeof Schema.NonEmptyString;
7782
- detail: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
7783
- }>, {
7784
- exact: true;
7785
- }>;
7915
+ readonly requestId: Schema.NonEmptyString;
7916
+ readonly cause: Schema.optionalKey<Schema.Struct<{
7917
+ readonly reason: Schema.NonEmptyString;
7918
+ readonly detail: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
7919
+ }>>;
7786
7920
  }>;
7787
7921
 
7788
7922
  export declare const workflowControlQueryDescriptor: QueryProcedureDescriptor<"__voltro.workflow.control", Schema.Struct<{
7789
- workflowName: typeof Schema.NonEmptyString;
7790
- executionId: typeof Schema.NonEmptyString;
7791
- operation: Schema.Literal<["cancel", "resume"]>;
7792
- requestId: typeof Schema.NonEmptyString;
7793
- }>, Schema.filter<Schema.Struct<{
7794
- operation: Schema.Literal<["cancel", "resume"]>;
7795
- kind: Schema.Literal<["accepted", "confirmed", "unknown", "already-terminal"]>;
7796
- requestId: Schema.NullOr<typeof Schema.NonEmptyString>;
7797
- snapshot: Schema.Struct<{
7798
- id: typeof Schema.String;
7799
- workflowName: typeof Schema.String;
7800
- executionId: typeof Schema.String;
7801
- status: Schema.Union<[Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>, Schema.Literal<["unknown"]>]>;
7802
- output: Schema.optional<typeof Schema.Unknown>;
7803
- error: Schema.optional<Schema.Struct<{
7804
- tag: Schema.NullOr<typeof Schema.String>;
7805
- message: typeof Schema.String;
7923
+ readonly workflowName: Schema.NonEmptyString;
7924
+ readonly executionId: Schema.NonEmptyString;
7925
+ readonly operation: Schema.Literals<readonly ["cancel", "resume"]>;
7926
+ readonly requestId: Schema.NonEmptyString;
7927
+ }>, Schema.Struct<{
7928
+ readonly operation: Schema.Literals<readonly ["cancel", "resume"]>;
7929
+ readonly kind: Schema.Literals<readonly ["accepted", "confirmed", "unknown", "already-terminal"]>;
7930
+ readonly requestId: Schema.NullOr<Schema.NonEmptyString>;
7931
+ readonly snapshot: Schema.Struct<{
7932
+ readonly id: Schema.String;
7933
+ readonly workflowName: Schema.String;
7934
+ readonly executionId: Schema.String;
7935
+ readonly status: Schema.Union<readonly [Schema.Literals<readonly ["running", "succeeded", "failed", "cancelled", "suspended"]>, Schema.Literal<"unknown">]>;
7936
+ readonly output: Schema.optional<Schema.Unknown>;
7937
+ readonly error: Schema.optional<Schema.Struct<{
7938
+ readonly tag: Schema.NullOr<Schema.String>;
7939
+ readonly message: Schema.String;
7806
7940
  }>>;
7807
7941
  }>;
7808
- }>>, typeof Schema.Never>;
7942
+ }>, Schema.Never>;
7809
7943
 
7810
7944
  export declare type WorkflowControlReadInput = Schema.Schema.Type<typeof WorkflowControlReadInputSchema>;
7811
7945
 
7812
7946
  export declare const WorkflowControlReadInputSchema: Schema.Struct<{
7813
- workflowName: typeof Schema.NonEmptyString;
7814
- executionId: typeof Schema.NonEmptyString;
7815
- operation: Schema.Literal<["cancel", "resume"]>;
7816
- requestId: typeof Schema.NonEmptyString;
7947
+ readonly workflowName: Schema.NonEmptyString;
7948
+ readonly executionId: Schema.NonEmptyString;
7949
+ readonly operation: Schema.Literals<readonly ["cancel", "resume"]>;
7950
+ readonly requestId: Schema.NonEmptyString;
7817
7951
  }>;
7818
7952
 
7819
7953
  export declare type WorkflowControlResult = Schema.Schema.Type<typeof WorkflowControlResultSchema>;
7820
7954
 
7821
7955
  /** Acceptance is not execution completion; null means no resident receipt. */
7822
- export declare const WorkflowControlResultSchema: Schema.filter<Schema.Struct<{
7823
- operation: Schema.Literal<["cancel", "resume"]>;
7824
- kind: Schema.Literal<["accepted", "confirmed", "unknown", "already-terminal"]>;
7825
- requestId: Schema.NullOr<typeof Schema.NonEmptyString>;
7826
- snapshot: Schema.Struct<{
7827
- id: typeof Schema.String;
7828
- workflowName: typeof Schema.String;
7829
- executionId: typeof Schema.String;
7830
- status: Schema.Union<[Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>, Schema.Literal<["unknown"]>]>;
7831
- output: Schema.optional<typeof Schema.Unknown>;
7832
- error: Schema.optional<Schema.Struct<{
7833
- tag: Schema.NullOr<typeof Schema.String>;
7834
- message: typeof Schema.String;
7956
+ export declare const WorkflowControlResultSchema: Schema.Struct<{
7957
+ readonly operation: Schema.Literals<readonly ["cancel", "resume"]>;
7958
+ readonly kind: Schema.Literals<readonly ["accepted", "confirmed", "unknown", "already-terminal"]>;
7959
+ readonly requestId: Schema.NullOr<Schema.NonEmptyString>;
7960
+ readonly snapshot: Schema.Struct<{
7961
+ readonly id: Schema.String;
7962
+ readonly workflowName: Schema.String;
7963
+ readonly executionId: Schema.String;
7964
+ readonly status: Schema.Union<readonly [Schema.Literals<readonly ["running", "succeeded", "failed", "cancelled", "suspended"]>, Schema.Literal<"unknown">]>;
7965
+ readonly output: Schema.optional<Schema.Unknown>;
7966
+ readonly error: Schema.optional<Schema.Struct<{
7967
+ readonly tag: Schema.NullOr<Schema.String>;
7968
+ readonly message: Schema.String;
7835
7969
  }>>;
7836
7970
  }>;
7837
- }>>;
7971
+ }>;
7838
7972
 
7839
7973
  export declare type WorkflowDomainEventRow = Schema.Schema.Type<typeof WorkflowDomainEventRowSchema>;
7840
7974
 
7841
7975
  export declare const WorkflowDomainEventRowSchema: Schema.Struct<{
7842
- id: typeof Schema.String;
7843
- name: typeof Schema.String;
7844
- payload: typeof Schema.Unknown;
7845
- source: typeof Schema.String;
7846
- subject: Schema.NullOr<typeof Schema.Unknown>;
7847
- traceId: Schema.NullOr<typeof Schema.String>;
7848
- occurredAt: typeof Schema.Date;
7976
+ readonly id: Schema.String;
7977
+ readonly name: Schema.String;
7978
+ readonly payload: Schema.Unknown;
7979
+ readonly source: Schema.String;
7980
+ readonly subject: Schema.NullOr<Schema.Unknown>;
7981
+ readonly traceId: Schema.NullOr<Schema.String>;
7982
+ readonly occurredAt: Schema.DateFromString;
7849
7983
  }>;
7850
7984
 
7851
7985
  export declare const WorkflowDomainEventsInputSchema: Schema.Struct<{
7852
- name: Schema.optional<typeof Schema.String>;
7853
- limit: Schema.optional<typeof Schema.Number>;
7986
+ readonly name: Schema.optional<Schema.String>;
7987
+ readonly limit: Schema.optional<Schema.Number>;
7854
7988
  }>;
7855
7989
 
7856
7990
  export declare const workflowDomainEventsQueryDescriptor: QueryProcedureDescriptor<"__voltro.workflow.domainEvents", Schema.Struct<{
7857
- name: Schema.optional<typeof Schema.String>;
7858
- limit: Schema.optional<typeof Schema.Number>;
7859
- }>, Schema.Array$<Schema.Struct<{
7860
- id: typeof Schema.String;
7861
- name: typeof Schema.String;
7862
- payload: typeof Schema.Unknown;
7863
- source: typeof Schema.String;
7864
- subject: Schema.NullOr<typeof Schema.Unknown>;
7865
- traceId: Schema.NullOr<typeof Schema.String>;
7866
- occurredAt: typeof Schema.Date;
7867
- }>>, typeof Schema.Never>;
7991
+ readonly name: Schema.optional<Schema.String>;
7992
+ readonly limit: Schema.optional<Schema.Number>;
7993
+ }>, Schema.$Array<Schema.Struct<{
7994
+ readonly id: Schema.String;
7995
+ readonly name: Schema.String;
7996
+ readonly payload: Schema.Unknown;
7997
+ readonly source: Schema.String;
7998
+ readonly subject: Schema.NullOr<Schema.Unknown>;
7999
+ readonly traceId: Schema.NullOr<Schema.String>;
8000
+ readonly occurredAt: Schema.DateFromString;
8001
+ }>>, Schema.Never>;
7868
8002
 
7869
8003
  export declare const WorkflowEventDeliveriesInputSchema: Schema.Struct<{
7870
- eventId: typeof Schema.String;
8004
+ readonly eventId: Schema.String;
7871
8005
  }>;
7872
8006
 
7873
8007
  export declare const workflowEventDeliveriesQueryDescriptor: QueryProcedureDescriptor<"__voltro.workflow.event.deliveries", Schema.Struct<{
7874
- eventId: typeof Schema.String;
7875
- }>, Schema.Array$<Schema.Struct<{
7876
- id: typeof Schema.String;
7877
- eventId: typeof Schema.String;
7878
- eventName: typeof Schema.String;
7879
- triggerId: typeof Schema.String;
7880
- workflowName: typeof Schema.String;
7881
- executionId: Schema.NullOr<typeof Schema.String>;
7882
- status: Schema.Literal<["starting", "started", "skipped", "failed"]>;
7883
- idempotencyKey: typeof Schema.String;
7884
- skipped: typeof Schema.Boolean;
7885
- errorMessage: Schema.NullOr<typeof Schema.String>;
7886
- createdAt: typeof Schema.Date;
7887
- completedAt: Schema.NullOr<typeof Schema.Date>;
7888
- }>>, typeof Schema.Never>;
8008
+ readonly eventId: Schema.String;
8009
+ }>, Schema.$Array<Schema.Struct<{
8010
+ readonly id: Schema.String;
8011
+ readonly eventId: Schema.String;
8012
+ readonly eventName: Schema.String;
8013
+ readonly triggerId: Schema.String;
8014
+ readonly workflowName: Schema.String;
8015
+ readonly executionId: Schema.NullOr<Schema.String>;
8016
+ readonly status: Schema.Literals<readonly ["starting", "started", "skipped", "failed"]>;
8017
+ readonly idempotencyKey: Schema.String;
8018
+ readonly skipped: Schema.Boolean;
8019
+ readonly errorMessage: Schema.NullOr<Schema.String>;
8020
+ readonly createdAt: Schema.DateFromString;
8021
+ readonly completedAt: Schema.NullOr<Schema.DateFromString>;
8022
+ }>>, Schema.Never>;
7889
8023
 
7890
8024
  export declare type WorkflowEventDeliveryRow = Schema.Schema.Type<typeof WorkflowEventDeliveryRowSchema>;
7891
8025
 
7892
8026
  export declare const WorkflowEventDeliveryRowSchema: Schema.Struct<{
7893
- id: typeof Schema.String;
7894
- eventId: typeof Schema.String;
7895
- eventName: typeof Schema.String;
7896
- triggerId: typeof Schema.String;
7897
- workflowName: typeof Schema.String;
7898
- executionId: Schema.NullOr<typeof Schema.String>;
7899
- status: Schema.Literal<["starting", "started", "skipped", "failed"]>;
7900
- idempotencyKey: typeof Schema.String;
7901
- skipped: typeof Schema.Boolean;
7902
- errorMessage: Schema.NullOr<typeof Schema.String>;
7903
- createdAt: typeof Schema.Date;
7904
- completedAt: Schema.NullOr<typeof Schema.Date>;
8027
+ readonly id: Schema.String;
8028
+ readonly eventId: Schema.String;
8029
+ readonly eventName: Schema.String;
8030
+ readonly triggerId: Schema.String;
8031
+ readonly workflowName: Schema.String;
8032
+ readonly executionId: Schema.NullOr<Schema.String>;
8033
+ readonly status: Schema.Literals<readonly ["starting", "started", "skipped", "failed"]>;
8034
+ readonly idempotencyKey: Schema.String;
8035
+ readonly skipped: Schema.Boolean;
8036
+ readonly errorMessage: Schema.NullOr<Schema.String>;
8037
+ readonly createdAt: Schema.DateFromString;
8038
+ readonly completedAt: Schema.NullOr<Schema.DateFromString>;
7905
8039
  }>;
7906
8040
 
7907
8041
  export declare type WorkflowParentClosePolicy = Schema.Schema.Type<typeof WorkflowParentClosePolicySchema>;
7908
8042
 
7909
- export declare const WorkflowParentClosePolicySchema: Schema.Literal<["cancel", "terminate", "abandon"]>;
8043
+ export declare const WorkflowParentClosePolicySchema: Schema.Literals<readonly ["cancel", "terminate", "abandon"]>;
7910
8044
 
7911
8045
  export declare const workflowQueuedCancelDescriptor: ActionProcedureDescriptor<"__voltro.workflow.queued.cancel", Schema.Struct<{
7912
- cause: Schema.optionalWith<Schema.Struct<{
7913
- reason: typeof Schema.NonEmptyString;
7914
- detail: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
7915
- }>, {
7916
- exact: true;
7917
- }>;
7918
- workflowName: typeof Schema.NonEmptyString;
7919
- receiptId: typeof Schema.NonEmptyString;
7920
- requestId: typeof Schema.NonEmptyString;
7921
- }>, Schema.filter<Schema.Struct<{
7922
- operation: Schema.Literal<["cancel"]>;
7923
- workflowName: typeof Schema.NonEmptyString;
7924
- receiptId: typeof Schema.NonEmptyString;
7925
- requestId: Schema.NullOr<typeof Schema.NonEmptyString>;
7926
- kind: Schema.Literal<["accepted", "confirmed", "unknown", "already-terminal"]>;
7927
- observation: Schema.Union<[Schema.Struct<{
7928
- kind: Schema.Literal<["pending"]>;
8046
+ readonly cause: Schema.optionalKey<Schema.Struct<{
8047
+ readonly reason: Schema.NonEmptyString;
8048
+ readonly detail: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
8049
+ }>>;
8050
+ readonly workflowName: Schema.NonEmptyString;
8051
+ readonly receiptId: Schema.NonEmptyString;
8052
+ readonly requestId: Schema.NonEmptyString;
8053
+ }>, Schema.Struct<{
8054
+ readonly operation: Schema.Literal<"cancel">;
8055
+ readonly workflowName: Schema.NonEmptyString;
8056
+ readonly receiptId: Schema.NonEmptyString;
8057
+ readonly requestId: Schema.NullOr<Schema.NonEmptyString>;
8058
+ readonly kind: Schema.Literals<readonly ["accepted", "confirmed", "unknown", "already-terminal"]>;
8059
+ readonly observation: Schema.Union<readonly [Schema.Struct<{
8060
+ readonly kind: Schema.Literal<"pending">;
7929
8061
  }>, Schema.Struct<{
7930
- kind: Schema.Literal<["admission"]>;
7931
- outcome: Schema.Union<[Schema.Union<[Schema.Struct<{
7932
- kind: Schema.Literal<["dropped"]>;
7933
- at: typeof Schema.Number;
7934
- retryAfterMs: typeof Schema.Number;
8062
+ readonly kind: Schema.Literal<"admission">;
8063
+ readonly outcome: Schema.Union<readonly [Schema.Union<readonly [Schema.Struct<{
8064
+ readonly kind: Schema.Literal<"dropped">;
8065
+ readonly at: Schema.Number;
8066
+ readonly retryAfterMs: Schema.Number;
7935
8067
  }>, Schema.Struct<{
7936
- kind: Schema.Literal<["skipped"]>;
7937
- at: typeof Schema.Number;
7938
- executionId: typeof Schema.String;
7939
- runId: typeof Schema.String;
8068
+ readonly kind: Schema.Literal<"skipped">;
8069
+ readonly at: Schema.Number;
8070
+ readonly executionId: Schema.String;
8071
+ readonly runId: Schema.String;
7940
8072
  }>, Schema.Struct<{
7941
- kind: Schema.Literal<["superseded"]>;
7942
- at: typeof Schema.Number;
8073
+ readonly kind: Schema.Literal<"superseded">;
8074
+ readonly at: Schema.Number;
7943
8075
  }>, Schema.Struct<{
7944
- kind: Schema.Literal<["cancelled"]>;
7945
- at: typeof Schema.Number;
8076
+ readonly kind: Schema.Literal<"cancelled">;
8077
+ readonly at: Schema.Number;
7946
8078
  }>, Schema.Struct<{
7947
- kind: Schema.Literal<["abandoned"]>;
7948
- at: typeof Schema.Number;
7949
- failureId: typeof Schema.NonEmptyString;
8079
+ readonly kind: Schema.Literal<"abandoned">;
8080
+ readonly at: Schema.Number;
8081
+ readonly failureId: Schema.NonEmptyString;
7950
8082
  }>]>, Schema.Struct<{
7951
- kind: Schema.Literal<["rejected"]>;
7952
- failureId: typeof Schema.NonEmptyString;
8083
+ readonly kind: Schema.Literal<"rejected">;
8084
+ readonly failureId: Schema.NonEmptyString;
7953
8085
  }>]>;
7954
8086
  }>, Schema.Struct<{
7955
- kind: Schema.Literal<["execution"]>;
7956
- snapshot: Schema.Struct<{
7957
- id: typeof Schema.String;
7958
- workflowName: typeof Schema.String;
7959
- executionId: typeof Schema.String;
7960
- status: Schema.Union<[Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>, Schema.Literal<["unknown"]>]>;
7961
- output: Schema.optional<typeof Schema.Unknown>;
7962
- error: Schema.optional<Schema.Struct<{
7963
- tag: Schema.NullOr<typeof Schema.String>;
7964
- message: typeof Schema.String;
8087
+ readonly kind: Schema.Literal<"execution">;
8088
+ readonly snapshot: Schema.Struct<{
8089
+ readonly id: Schema.String;
8090
+ readonly workflowName: Schema.String;
8091
+ readonly executionId: Schema.String;
8092
+ readonly status: Schema.Union<readonly [Schema.Literals<readonly ["running", "succeeded", "failed", "cancelled", "suspended"]>, Schema.Literal<"unknown">]>;
8093
+ readonly output: Schema.optional<Schema.Unknown>;
8094
+ readonly error: Schema.optional<Schema.Struct<{
8095
+ readonly tag: Schema.NullOr<Schema.String>;
8096
+ readonly message: Schema.String;
7965
8097
  }>>;
7966
8098
  }>;
7967
8099
  }>, Schema.Struct<{
7968
- kind: Schema.Literal<["unavailable"]>;
7969
- reason: Schema.Literal<["missing-request", "missing-run", "unconfirmed-generation", "unbound-submission"]>;
8100
+ readonly kind: Schema.Literal<"unavailable">;
8101
+ readonly reason: Schema.Literals<readonly ["missing-request", "missing-run", "unconfirmed-generation", "unbound-submission"]>;
7970
8102
  }>]>;
7971
- }>>, typeof Schema.Never>;
8103
+ }>, Schema.Never>;
7972
8104
 
7973
8105
  export declare type WorkflowQueuedCancelInput = typeof WorkflowQueuedCancelInputSchema.Type;
7974
8106
 
7975
8107
  export declare const WorkflowQueuedCancelInputSchema: Schema.Struct<{
7976
- cause: Schema.optionalWith<Schema.Struct<{
7977
- reason: typeof Schema.NonEmptyString;
7978
- detail: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
7979
- }>, {
7980
- exact: true;
7981
- }>;
7982
- workflowName: typeof Schema.NonEmptyString;
7983
- receiptId: typeof Schema.NonEmptyString;
7984
- requestId: typeof Schema.NonEmptyString;
8108
+ readonly cause: Schema.optionalKey<Schema.Struct<{
8109
+ readonly reason: Schema.NonEmptyString;
8110
+ readonly detail: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
8111
+ }>>;
8112
+ readonly workflowName: Schema.NonEmptyString;
8113
+ readonly receiptId: Schema.NonEmptyString;
8114
+ readonly requestId: Schema.NonEmptyString;
7985
8115
  }>;
7986
8116
 
7987
8117
  export declare type WorkflowQueuedCancellationResult = typeof WorkflowQueuedCancellationResultSchema.Type;
7988
8118
 
7989
8119
  /** A queued caller has a receipt before any execution exists. Keep admission
7990
8120
  * evidence separate from an observed execution rather than fabricating IDs. */
7991
- export declare const WorkflowQueuedCancellationResultSchema: Schema.filter<Schema.Struct<{
7992
- operation: Schema.Literal<["cancel"]>;
7993
- workflowName: typeof Schema.NonEmptyString;
7994
- receiptId: typeof Schema.NonEmptyString;
7995
- requestId: Schema.NullOr<typeof Schema.NonEmptyString>;
7996
- kind: Schema.Literal<["accepted", "confirmed", "unknown", "already-terminal"]>;
7997
- observation: Schema.Union<[Schema.Struct<{
7998
- kind: Schema.Literal<["pending"]>;
8121
+ export declare const WorkflowQueuedCancellationResultSchema: Schema.Struct<{
8122
+ readonly operation: Schema.Literal<"cancel">;
8123
+ readonly workflowName: Schema.NonEmptyString;
8124
+ readonly receiptId: Schema.NonEmptyString;
8125
+ readonly requestId: Schema.NullOr<Schema.NonEmptyString>;
8126
+ readonly kind: Schema.Literals<readonly ["accepted", "confirmed", "unknown", "already-terminal"]>;
8127
+ readonly observation: Schema.Union<readonly [Schema.Struct<{
8128
+ readonly kind: Schema.Literal<"pending">;
7999
8129
  }>, Schema.Struct<{
8000
- kind: Schema.Literal<["admission"]>;
8001
- outcome: Schema.Union<[Schema.Union<[Schema.Struct<{
8002
- kind: Schema.Literal<["dropped"]>;
8003
- at: typeof Schema.Number;
8004
- retryAfterMs: typeof Schema.Number;
8130
+ readonly kind: Schema.Literal<"admission">;
8131
+ readonly outcome: Schema.Union<readonly [Schema.Union<readonly [Schema.Struct<{
8132
+ readonly kind: Schema.Literal<"dropped">;
8133
+ readonly at: Schema.Number;
8134
+ readonly retryAfterMs: Schema.Number;
8005
8135
  }>, Schema.Struct<{
8006
- kind: Schema.Literal<["skipped"]>;
8007
- at: typeof Schema.Number;
8008
- executionId: typeof Schema.String;
8009
- runId: typeof Schema.String;
8136
+ readonly kind: Schema.Literal<"skipped">;
8137
+ readonly at: Schema.Number;
8138
+ readonly executionId: Schema.String;
8139
+ readonly runId: Schema.String;
8010
8140
  }>, Schema.Struct<{
8011
- kind: Schema.Literal<["superseded"]>;
8012
- at: typeof Schema.Number;
8141
+ readonly kind: Schema.Literal<"superseded">;
8142
+ readonly at: Schema.Number;
8013
8143
  }>, Schema.Struct<{
8014
- kind: Schema.Literal<["cancelled"]>;
8015
- at: typeof Schema.Number;
8144
+ readonly kind: Schema.Literal<"cancelled">;
8145
+ readonly at: Schema.Number;
8016
8146
  }>, Schema.Struct<{
8017
- kind: Schema.Literal<["abandoned"]>;
8018
- at: typeof Schema.Number;
8019
- failureId: typeof Schema.NonEmptyString;
8147
+ readonly kind: Schema.Literal<"abandoned">;
8148
+ readonly at: Schema.Number;
8149
+ readonly failureId: Schema.NonEmptyString;
8020
8150
  }>]>, Schema.Struct<{
8021
- kind: Schema.Literal<["rejected"]>;
8022
- failureId: typeof Schema.NonEmptyString;
8151
+ readonly kind: Schema.Literal<"rejected">;
8152
+ readonly failureId: Schema.NonEmptyString;
8023
8153
  }>]>;
8024
8154
  }>, Schema.Struct<{
8025
- kind: Schema.Literal<["execution"]>;
8026
- snapshot: Schema.Struct<{
8027
- id: typeof Schema.String;
8028
- workflowName: typeof Schema.String;
8029
- executionId: typeof Schema.String;
8030
- status: Schema.Union<[Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>, Schema.Literal<["unknown"]>]>;
8031
- output: Schema.optional<typeof Schema.Unknown>;
8032
- error: Schema.optional<Schema.Struct<{
8033
- tag: Schema.NullOr<typeof Schema.String>;
8034
- message: typeof Schema.String;
8155
+ readonly kind: Schema.Literal<"execution">;
8156
+ readonly snapshot: Schema.Struct<{
8157
+ readonly id: Schema.String;
8158
+ readonly workflowName: Schema.String;
8159
+ readonly executionId: Schema.String;
8160
+ readonly status: Schema.Union<readonly [Schema.Literals<readonly ["running", "succeeded", "failed", "cancelled", "suspended"]>, Schema.Literal<"unknown">]>;
8161
+ readonly output: Schema.optional<Schema.Unknown>;
8162
+ readonly error: Schema.optional<Schema.Struct<{
8163
+ readonly tag: Schema.NullOr<Schema.String>;
8164
+ readonly message: Schema.String;
8035
8165
  }>>;
8036
8166
  }>;
8037
8167
  }>, Schema.Struct<{
8038
- kind: Schema.Literal<["unavailable"]>;
8039
- reason: Schema.Literal<["missing-request", "missing-run", "unconfirmed-generation", "unbound-submission"]>;
8168
+ readonly kind: Schema.Literal<"unavailable">;
8169
+ readonly reason: Schema.Literals<readonly ["missing-request", "missing-run", "unconfirmed-generation", "unbound-submission"]>;
8040
8170
  }>]>;
8041
- }>>;
8171
+ }>;
8042
8172
 
8043
8173
  export declare const workflowQueuedControlQueryDescriptor: QueryProcedureDescriptor<"__voltro.workflow.queued.control", Schema.Struct<{
8044
- workflowName: typeof Schema.NonEmptyString;
8045
- receiptId: typeof Schema.NonEmptyString;
8046
- requestId: typeof Schema.NonEmptyString;
8047
- }>, Schema.filter<Schema.Struct<{
8048
- operation: Schema.Literal<["cancel"]>;
8049
- workflowName: typeof Schema.NonEmptyString;
8050
- receiptId: typeof Schema.NonEmptyString;
8051
- requestId: Schema.NullOr<typeof Schema.NonEmptyString>;
8052
- kind: Schema.Literal<["accepted", "confirmed", "unknown", "already-terminal"]>;
8053
- observation: Schema.Union<[Schema.Struct<{
8054
- kind: Schema.Literal<["pending"]>;
8174
+ readonly workflowName: Schema.NonEmptyString;
8175
+ readonly receiptId: Schema.NonEmptyString;
8176
+ readonly requestId: Schema.NonEmptyString;
8177
+ }>, Schema.Struct<{
8178
+ readonly operation: Schema.Literal<"cancel">;
8179
+ readonly workflowName: Schema.NonEmptyString;
8180
+ readonly receiptId: Schema.NonEmptyString;
8181
+ readonly requestId: Schema.NullOr<Schema.NonEmptyString>;
8182
+ readonly kind: Schema.Literals<readonly ["accepted", "confirmed", "unknown", "already-terminal"]>;
8183
+ readonly observation: Schema.Union<readonly [Schema.Struct<{
8184
+ readonly kind: Schema.Literal<"pending">;
8055
8185
  }>, Schema.Struct<{
8056
- kind: Schema.Literal<["admission"]>;
8057
- outcome: Schema.Union<[Schema.Union<[Schema.Struct<{
8058
- kind: Schema.Literal<["dropped"]>;
8059
- at: typeof Schema.Number;
8060
- retryAfterMs: typeof Schema.Number;
8186
+ readonly kind: Schema.Literal<"admission">;
8187
+ readonly outcome: Schema.Union<readonly [Schema.Union<readonly [Schema.Struct<{
8188
+ readonly kind: Schema.Literal<"dropped">;
8189
+ readonly at: Schema.Number;
8190
+ readonly retryAfterMs: Schema.Number;
8061
8191
  }>, Schema.Struct<{
8062
- kind: Schema.Literal<["skipped"]>;
8063
- at: typeof Schema.Number;
8064
- executionId: typeof Schema.String;
8065
- runId: typeof Schema.String;
8192
+ readonly kind: Schema.Literal<"skipped">;
8193
+ readonly at: Schema.Number;
8194
+ readonly executionId: Schema.String;
8195
+ readonly runId: Schema.String;
8066
8196
  }>, Schema.Struct<{
8067
- kind: Schema.Literal<["superseded"]>;
8068
- at: typeof Schema.Number;
8197
+ readonly kind: Schema.Literal<"superseded">;
8198
+ readonly at: Schema.Number;
8069
8199
  }>, Schema.Struct<{
8070
- kind: Schema.Literal<["cancelled"]>;
8071
- at: typeof Schema.Number;
8200
+ readonly kind: Schema.Literal<"cancelled">;
8201
+ readonly at: Schema.Number;
8072
8202
  }>, Schema.Struct<{
8073
- kind: Schema.Literal<["abandoned"]>;
8074
- at: typeof Schema.Number;
8075
- failureId: typeof Schema.NonEmptyString;
8203
+ readonly kind: Schema.Literal<"abandoned">;
8204
+ readonly at: Schema.Number;
8205
+ readonly failureId: Schema.NonEmptyString;
8076
8206
  }>]>, Schema.Struct<{
8077
- kind: Schema.Literal<["rejected"]>;
8078
- failureId: typeof Schema.NonEmptyString;
8207
+ readonly kind: Schema.Literal<"rejected">;
8208
+ readonly failureId: Schema.NonEmptyString;
8079
8209
  }>]>;
8080
8210
  }>, Schema.Struct<{
8081
- kind: Schema.Literal<["execution"]>;
8082
- snapshot: Schema.Struct<{
8083
- id: typeof Schema.String;
8084
- workflowName: typeof Schema.String;
8085
- executionId: typeof Schema.String;
8086
- status: Schema.Union<[Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>, Schema.Literal<["unknown"]>]>;
8087
- output: Schema.optional<typeof Schema.Unknown>;
8088
- error: Schema.optional<Schema.Struct<{
8089
- tag: Schema.NullOr<typeof Schema.String>;
8090
- message: typeof Schema.String;
8211
+ readonly kind: Schema.Literal<"execution">;
8212
+ readonly snapshot: Schema.Struct<{
8213
+ readonly id: Schema.String;
8214
+ readonly workflowName: Schema.String;
8215
+ readonly executionId: Schema.String;
8216
+ readonly status: Schema.Union<readonly [Schema.Literals<readonly ["running", "succeeded", "failed", "cancelled", "suspended"]>, Schema.Literal<"unknown">]>;
8217
+ readonly output: Schema.optional<Schema.Unknown>;
8218
+ readonly error: Schema.optional<Schema.Struct<{
8219
+ readonly tag: Schema.NullOr<Schema.String>;
8220
+ readonly message: Schema.String;
8091
8221
  }>>;
8092
8222
  }>;
8093
8223
  }>, Schema.Struct<{
8094
- kind: Schema.Literal<["unavailable"]>;
8095
- reason: Schema.Literal<["missing-request", "missing-run", "unconfirmed-generation", "unbound-submission"]>;
8224
+ readonly kind: Schema.Literal<"unavailable">;
8225
+ readonly reason: Schema.Literals<readonly ["missing-request", "missing-run", "unconfirmed-generation", "unbound-submission"]>;
8096
8226
  }>]>;
8097
- }>>, typeof Schema.Never>;
8227
+ }>, Schema.Never>;
8098
8228
 
8099
8229
  export declare type WorkflowQueuedControlTarget = typeof WorkflowQueuedControlTargetSchema.Type;
8100
8230
 
8101
8231
  export declare const WorkflowQueuedControlTargetSchema: Schema.Struct<{
8102
- workflowName: typeof Schema.NonEmptyString;
8103
- receiptId: typeof Schema.NonEmptyString;
8104
- requestId: typeof Schema.NonEmptyString;
8232
+ readonly workflowName: Schema.NonEmptyString;
8233
+ readonly receiptId: Schema.NonEmptyString;
8234
+ readonly requestId: Schema.NonEmptyString;
8105
8235
  }>;
8106
8236
 
8107
8237
  export declare type WorkflowRestartCommand = typeof WorkflowRestartCommandSchema.Type;
8108
8238
 
8109
8239
  export declare const WorkflowRestartCommandSchema: Schema.Struct<{
8110
- selection: Schema.Union<[Schema.Struct<{
8111
- kind: Schema.Literal<["failed-steps"]>;
8240
+ readonly selection: Schema.Union<readonly [Schema.Struct<{
8241
+ readonly kind: Schema.Literal<"failed-steps">;
8112
8242
  }>, Schema.Struct<{
8113
- kind: Schema.Literal<["from-step"]>;
8114
- stepName: Schema.filter<typeof Schema.NonEmptyString>;
8243
+ readonly kind: Schema.Literal<"from-step">;
8244
+ readonly stepName: Schema.NonEmptyString;
8115
8245
  }>]>;
8116
- requestId: Schema.filter<Schema.filter<typeof Schema.NonEmptyString>>;
8117
- runId: Schema.filter<typeof Schema.NonEmptyString>;
8246
+ readonly requestId: Schema.NonEmptyString;
8247
+ readonly runId: Schema.NonEmptyString;
8118
8248
  }>;
8119
8249
 
8120
8250
  export declare type WorkflowRestartObservation = typeof WorkflowRestartObservationSchema.Type;
8121
8251
 
8122
8252
  /** Pending is a durable reservation, not proof of reset or engine entry.
8123
8253
  * Entered confirms this command's generation; it does not claim run success. */
8124
- export declare const WorkflowRestartObservationSchema: Schema.Union<[Schema.Struct<{
8125
- kind: Schema.Literal<["not-found"]>;
8126
- requestId: Schema.filter<Schema.filter<typeof Schema.NonEmptyString>>;
8127
- runId: Schema.filter<typeof Schema.NonEmptyString>;
8254
+ export declare const WorkflowRestartObservationSchema: Schema.Union<readonly [Schema.Struct<{
8255
+ readonly kind: Schema.Literal<"not-found">;
8256
+ readonly requestId: Schema.NonEmptyString;
8257
+ readonly runId: Schema.NonEmptyString;
8128
8258
  }>, Schema.Struct<{
8129
- kind: Schema.Literal<["withdrawn"]>;
8130
- workflowName: Schema.filter<typeof Schema.NonEmptyString>;
8131
- withdrawnAt: Schema.filter<typeof Schema.Number>;
8132
- selection: Schema.Union<[Schema.Struct<{
8133
- kind: Schema.Literal<["failed-steps"]>;
8259
+ readonly kind: Schema.Literal<"withdrawn">;
8260
+ readonly workflowName: Schema.NonEmptyString;
8261
+ readonly withdrawnAt: Schema.Number;
8262
+ readonly selection: Schema.Union<readonly [Schema.Struct<{
8263
+ readonly kind: Schema.Literal<"failed-steps">;
8134
8264
  }>, Schema.Struct<{
8135
- kind: Schema.Literal<["from-step"]>;
8136
- stepName: Schema.filter<typeof Schema.NonEmptyString>;
8265
+ readonly kind: Schema.Literal<"from-step">;
8266
+ readonly stepName: Schema.NonEmptyString;
8137
8267
  }>]>;
8138
- requestId: Schema.filter<Schema.filter<typeof Schema.NonEmptyString>>;
8139
- runId: Schema.filter<typeof Schema.NonEmptyString>;
8268
+ readonly requestId: Schema.NonEmptyString;
8269
+ readonly runId: Schema.NonEmptyString;
8140
8270
  }>, Schema.Struct<{
8141
- kind: Schema.Literal<["pending"]>;
8142
- workflowName: Schema.filter<typeof Schema.NonEmptyString>;
8143
- executionId: Schema.filter<typeof Schema.NonEmptyString>;
8144
- originalGeneration: Schema.filter<typeof Schema.NonEmptyString>;
8145
- requestedAt: Schema.filter<typeof Schema.Number>;
8146
- dispatchAttempts: Schema.refine<number, typeof Schema.NonNegative>;
8147
- selection: Schema.Union<[Schema.Struct<{
8148
- kind: Schema.Literal<["failed-steps"]>;
8271
+ readonly kind: Schema.Literal<"pending">;
8272
+ readonly workflowName: Schema.NonEmptyString;
8273
+ readonly executionId: Schema.NonEmptyString;
8274
+ readonly originalGeneration: Schema.NonEmptyString;
8275
+ readonly requestedAt: Schema.Number;
8276
+ readonly dispatchAttempts: Schema.Number;
8277
+ readonly selection: Schema.Union<readonly [Schema.Struct<{
8278
+ readonly kind: Schema.Literal<"failed-steps">;
8149
8279
  }>, Schema.Struct<{
8150
- kind: Schema.Literal<["from-step"]>;
8151
- stepName: Schema.filter<typeof Schema.NonEmptyString>;
8280
+ readonly kind: Schema.Literal<"from-step">;
8281
+ readonly stepName: Schema.NonEmptyString;
8152
8282
  }>]>;
8153
- requestId: Schema.filter<Schema.filter<typeof Schema.NonEmptyString>>;
8154
- runId: Schema.filter<typeof Schema.NonEmptyString>;
8155
- }>, Schema.filter<Schema.Struct<{
8156
- kind: Schema.Literal<["entered"]>;
8157
- enteredGeneration: Schema.filter<typeof Schema.NonEmptyString>;
8158
- workflowName: Schema.filter<typeof Schema.NonEmptyString>;
8159
- executionId: Schema.filter<typeof Schema.NonEmptyString>;
8160
- originalGeneration: Schema.filter<typeof Schema.NonEmptyString>;
8161
- requestedAt: Schema.filter<typeof Schema.Number>;
8162
- dispatchAttempts: Schema.refine<number, typeof Schema.NonNegative>;
8163
- selection: Schema.Union<[Schema.Struct<{
8164
- kind: Schema.Literal<["failed-steps"]>;
8283
+ readonly requestId: Schema.NonEmptyString;
8284
+ readonly runId: Schema.NonEmptyString;
8285
+ }>, Schema.Struct<{
8286
+ readonly kind: Schema.Literal<"entered">;
8287
+ readonly enteredGeneration: Schema.NonEmptyString;
8288
+ readonly workflowName: Schema.NonEmptyString;
8289
+ readonly executionId: Schema.NonEmptyString;
8290
+ readonly originalGeneration: Schema.NonEmptyString;
8291
+ readonly requestedAt: Schema.Number;
8292
+ readonly dispatchAttempts: Schema.Number;
8293
+ readonly selection: Schema.Union<readonly [Schema.Struct<{
8294
+ readonly kind: Schema.Literal<"failed-steps">;
8165
8295
  }>, Schema.Struct<{
8166
- kind: Schema.Literal<["from-step"]>;
8167
- stepName: Schema.filter<typeof Schema.NonEmptyString>;
8296
+ readonly kind: Schema.Literal<"from-step">;
8297
+ readonly stepName: Schema.NonEmptyString;
8168
8298
  }>]>;
8169
- requestId: Schema.filter<Schema.filter<typeof Schema.NonEmptyString>>;
8170
- runId: Schema.filter<typeof Schema.NonEmptyString>;
8171
- }>>]>;
8299
+ readonly requestId: Schema.NonEmptyString;
8300
+ readonly runId: Schema.NonEmptyString;
8301
+ }>]>;
8172
8302
 
8173
8303
  export declare type WorkflowRestartResult = typeof WorkflowRestartResultSchema.Type;
8174
8304
 
8175
8305
  /** A refused reservation never reset the journal. Transport failures instead
8176
8306
  * require reading the original target; they are not proof of refusal. */
8177
- export declare const WorkflowRestartResultSchema: Schema.Union<[Schema.Union<[Schema.Struct<{
8178
- kind: Schema.Literal<["not-found"]>;
8179
- requestId: Schema.filter<Schema.filter<typeof Schema.NonEmptyString>>;
8180
- runId: Schema.filter<typeof Schema.NonEmptyString>;
8307
+ export declare const WorkflowRestartResultSchema: Schema.Union<readonly [Schema.Union<readonly [Schema.Struct<{
8308
+ readonly kind: Schema.Literal<"not-found">;
8309
+ readonly requestId: Schema.NonEmptyString;
8310
+ readonly runId: Schema.NonEmptyString;
8181
8311
  }>, Schema.Struct<{
8182
- kind: Schema.Literal<["withdrawn"]>;
8183
- workflowName: Schema.filter<typeof Schema.NonEmptyString>;
8184
- withdrawnAt: Schema.filter<typeof Schema.Number>;
8185
- selection: Schema.Union<[Schema.Struct<{
8186
- kind: Schema.Literal<["failed-steps"]>;
8312
+ readonly kind: Schema.Literal<"withdrawn">;
8313
+ readonly workflowName: Schema.NonEmptyString;
8314
+ readonly withdrawnAt: Schema.Number;
8315
+ readonly selection: Schema.Union<readonly [Schema.Struct<{
8316
+ readonly kind: Schema.Literal<"failed-steps">;
8187
8317
  }>, Schema.Struct<{
8188
- kind: Schema.Literal<["from-step"]>;
8189
- stepName: Schema.filter<typeof Schema.NonEmptyString>;
8318
+ readonly kind: Schema.Literal<"from-step">;
8319
+ readonly stepName: Schema.NonEmptyString;
8190
8320
  }>]>;
8191
- requestId: Schema.filter<Schema.filter<typeof Schema.NonEmptyString>>;
8192
- runId: Schema.filter<typeof Schema.NonEmptyString>;
8321
+ readonly requestId: Schema.NonEmptyString;
8322
+ readonly runId: Schema.NonEmptyString;
8193
8323
  }>, Schema.Struct<{
8194
- kind: Schema.Literal<["pending"]>;
8195
- workflowName: Schema.filter<typeof Schema.NonEmptyString>;
8196
- executionId: Schema.filter<typeof Schema.NonEmptyString>;
8197
- originalGeneration: Schema.filter<typeof Schema.NonEmptyString>;
8198
- requestedAt: Schema.filter<typeof Schema.Number>;
8199
- dispatchAttempts: Schema.refine<number, typeof Schema.NonNegative>;
8200
- selection: Schema.Union<[Schema.Struct<{
8201
- kind: Schema.Literal<["failed-steps"]>;
8324
+ readonly kind: Schema.Literal<"pending">;
8325
+ readonly workflowName: Schema.NonEmptyString;
8326
+ readonly executionId: Schema.NonEmptyString;
8327
+ readonly originalGeneration: Schema.NonEmptyString;
8328
+ readonly requestedAt: Schema.Number;
8329
+ readonly dispatchAttempts: Schema.Number;
8330
+ readonly selection: Schema.Union<readonly [Schema.Struct<{
8331
+ readonly kind: Schema.Literal<"failed-steps">;
8202
8332
  }>, Schema.Struct<{
8203
- kind: Schema.Literal<["from-step"]>;
8204
- stepName: Schema.filter<typeof Schema.NonEmptyString>;
8333
+ readonly kind: Schema.Literal<"from-step">;
8334
+ readonly stepName: Schema.NonEmptyString;
8205
8335
  }>]>;
8206
- requestId: Schema.filter<Schema.filter<typeof Schema.NonEmptyString>>;
8207
- runId: Schema.filter<typeof Schema.NonEmptyString>;
8208
- }>, Schema.filter<Schema.Struct<{
8209
- kind: Schema.Literal<["entered"]>;
8210
- enteredGeneration: Schema.filter<typeof Schema.NonEmptyString>;
8211
- workflowName: Schema.filter<typeof Schema.NonEmptyString>;
8212
- executionId: Schema.filter<typeof Schema.NonEmptyString>;
8213
- originalGeneration: Schema.filter<typeof Schema.NonEmptyString>;
8214
- requestedAt: Schema.filter<typeof Schema.Number>;
8215
- dispatchAttempts: Schema.refine<number, typeof Schema.NonNegative>;
8216
- selection: Schema.Union<[Schema.Struct<{
8217
- kind: Schema.Literal<["failed-steps"]>;
8336
+ readonly requestId: Schema.NonEmptyString;
8337
+ readonly runId: Schema.NonEmptyString;
8338
+ }>, Schema.Struct<{
8339
+ readonly kind: Schema.Literal<"entered">;
8340
+ readonly enteredGeneration: Schema.NonEmptyString;
8341
+ readonly workflowName: Schema.NonEmptyString;
8342
+ readonly executionId: Schema.NonEmptyString;
8343
+ readonly originalGeneration: Schema.NonEmptyString;
8344
+ readonly requestedAt: Schema.Number;
8345
+ readonly dispatchAttempts: Schema.Number;
8346
+ readonly selection: Schema.Union<readonly [Schema.Struct<{
8347
+ readonly kind: Schema.Literal<"failed-steps">;
8218
8348
  }>, Schema.Struct<{
8219
- kind: Schema.Literal<["from-step"]>;
8220
- stepName: Schema.filter<typeof Schema.NonEmptyString>;
8349
+ readonly kind: Schema.Literal<"from-step">;
8350
+ readonly stepName: Schema.NonEmptyString;
8221
8351
  }>]>;
8222
- requestId: Schema.filter<Schema.filter<typeof Schema.NonEmptyString>>;
8223
- runId: Schema.filter<typeof Schema.NonEmptyString>;
8224
- }>>]>, Schema.Struct<{
8225
- kind: Schema.Literal<["not-reserved"]>;
8226
- reason: Schema.Literal<["admission", "journal"]>;
8227
- requestId: Schema.filter<Schema.filter<typeof Schema.NonEmptyString>>;
8228
- runId: Schema.filter<typeof Schema.NonEmptyString>;
8352
+ readonly requestId: Schema.NonEmptyString;
8353
+ readonly runId: Schema.NonEmptyString;
8354
+ }>]>, Schema.Struct<{
8355
+ readonly kind: Schema.Literal<"not-reserved">;
8356
+ readonly reason: Schema.Literals<readonly ["admission", "journal"]>;
8357
+ readonly requestId: Schema.NonEmptyString;
8358
+ readonly runId: Schema.NonEmptyString;
8229
8359
  }>]>;
8230
8360
 
8231
8361
  export declare type WorkflowRestartSelection = typeof WorkflowRestartSelectionSchema.Type;
8232
8362
 
8233
- export declare const WorkflowRestartSelectionSchema: Schema.Union<[Schema.Struct<{
8234
- kind: Schema.Literal<["failed-steps"]>;
8363
+ export declare const WorkflowRestartSelectionSchema: Schema.Union<readonly [Schema.Struct<{
8364
+ readonly kind: Schema.Literal<"failed-steps">;
8235
8365
  }>, Schema.Struct<{
8236
- kind: Schema.Literal<["from-step"]>;
8237
- stepName: Schema.filter<typeof Schema.NonEmptyString>;
8366
+ readonly kind: Schema.Literal<"from-step">;
8367
+ readonly stepName: Schema.NonEmptyString;
8238
8368
  }>]>;
8239
8369
 
8240
8370
  export declare type WorkflowRestartTarget = typeof WorkflowRestartTargetSchema.Type;
8241
8371
 
8242
8372
  /** Persist before submitting; read this same target after an uncertain reply. */
8243
8373
  export declare const WorkflowRestartTargetSchema: Schema.Struct<{
8244
- requestId: Schema.filter<Schema.filter<typeof Schema.NonEmptyString>>;
8245
- runId: Schema.filter<typeof Schema.NonEmptyString>;
8374
+ readonly requestId: Schema.NonEmptyString;
8375
+ readonly runId: Schema.NonEmptyString;
8246
8376
  }>;
8247
8377
 
8248
8378
  export declare const workflowResumeDescriptor: ActionProcedureDescriptor<"__voltro.workflow.resume", Schema.Struct<{
8249
- workflowName: typeof Schema.String;
8250
- executionId: typeof Schema.String;
8251
- control: Schema.optional<Schema.Struct<{
8252
- requestId: typeof Schema.NonEmptyString;
8253
- cause: Schema.optionalWith<Schema.Struct<{
8254
- reason: typeof Schema.NonEmptyString;
8255
- detail: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>;
8256
- }>, {
8257
- exact: true;
8258
- }>;
8379
+ readonly workflowName: Schema.String;
8380
+ readonly executionId: Schema.String;
8381
+ readonly control: Schema.optional<Schema.Struct<{
8382
+ readonly requestId: Schema.NonEmptyString;
8383
+ readonly cause: Schema.optionalKey<Schema.Struct<{
8384
+ readonly reason: Schema.NonEmptyString;
8385
+ readonly detail: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
8386
+ }>>;
8259
8387
  }>>;
8260
- }>, Schema.filter<Schema.Struct<{
8261
- operation: Schema.Literal<["cancel", "resume"]>;
8262
- kind: Schema.Literal<["accepted", "confirmed", "unknown", "already-terminal"]>;
8263
- requestId: Schema.NullOr<typeof Schema.NonEmptyString>;
8264
- snapshot: Schema.Struct<{
8265
- id: typeof Schema.String;
8266
- workflowName: typeof Schema.String;
8267
- executionId: typeof Schema.String;
8268
- status: Schema.Union<[Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>, Schema.Literal<["unknown"]>]>;
8269
- output: Schema.optional<typeof Schema.Unknown>;
8270
- error: Schema.optional<Schema.Struct<{
8271
- tag: Schema.NullOr<typeof Schema.String>;
8272
- message: typeof Schema.String;
8388
+ }>, Schema.Struct<{
8389
+ readonly operation: Schema.Literals<readonly ["cancel", "resume"]>;
8390
+ readonly kind: Schema.Literals<readonly ["accepted", "confirmed", "unknown", "already-terminal"]>;
8391
+ readonly requestId: Schema.NullOr<Schema.NonEmptyString>;
8392
+ readonly snapshot: Schema.Struct<{
8393
+ readonly id: Schema.String;
8394
+ readonly workflowName: Schema.String;
8395
+ readonly executionId: Schema.String;
8396
+ readonly status: Schema.Union<readonly [Schema.Literals<readonly ["running", "succeeded", "failed", "cancelled", "suspended"]>, Schema.Literal<"unknown">]>;
8397
+ readonly output: Schema.optional<Schema.Unknown>;
8398
+ readonly error: Schema.optional<Schema.Struct<{
8399
+ readonly tag: Schema.NullOr<Schema.String>;
8400
+ readonly message: Schema.String;
8273
8401
  }>>;
8274
8402
  }>;
8275
- }>>, typeof Schema.Never>;
8403
+ }>, Schema.Never>;
8276
8404
 
8277
8405
  export declare type WorkflowRetryCommand = typeof WorkflowRetryCommandSchema.Type;
8278
8406
 
8279
8407
  /** Transport input for one deliberate retry; ownership is resolved server-side.
8280
8408
  * The optional override is encoded with the complete workflow payload schema. */
8281
8409
  export declare const WorkflowRetryCommandSchema: Schema.Struct<{
8282
- payloadOverride: Schema.optional<typeof Schema.Unknown>;
8283
- runId: Schema.filter<typeof Schema.NonEmptyString>;
8284
- requestId: Schema.filter<typeof Schema.NonEmptyString>;
8410
+ readonly payloadOverride: Schema.optional<Schema.Unknown>;
8411
+ readonly runId: Schema.NonEmptyString;
8412
+ readonly requestId: Schema.NonEmptyString;
8285
8413
  }>;
8286
8414
 
8287
8415
  export declare type WorkflowRetryObservation = typeof WorkflowRetryObservationSchema.Type;
8288
8416
 
8289
8417
  /** Observation of one durable retry intent. Engine acceptance is not workflow
8290
8418
  * completion. A prepared identity alone never proves that execution started. */
8291
- export declare const WorkflowRetryObservationSchema: Schema.Union<[Schema.Struct<{
8292
- kind: Schema.Literal<["queued"]>;
8293
- nextAttemptAt: Schema.NullOr<typeof Schema.Number>;
8294
- requestId: typeof Schema.NonEmptyString;
8295
- originalRunId: typeof Schema.NonEmptyString;
8296
- originalExecutionId: typeof Schema.NonEmptyString;
8297
- workflowName: typeof Schema.NonEmptyString;
8298
- }>, Schema.filter<Schema.Struct<{
8299
- kind: Schema.Literal<["accepted"]>;
8300
- executionId: typeof Schema.NonEmptyString;
8301
- requestId: typeof Schema.NonEmptyString;
8302
- originalRunId: typeof Schema.NonEmptyString;
8303
- originalExecutionId: typeof Schema.NonEmptyString;
8304
- workflowName: typeof Schema.NonEmptyString;
8305
- }>>, Schema.filter<Schema.Struct<{
8306
- kind: Schema.Literal<["unconfirmed"]>;
8307
- automaticRetryStopped: typeof Schema.Boolean;
8308
- nextAttemptAt: Schema.NullOr<typeof Schema.Number>;
8309
- requestId: typeof Schema.NonEmptyString;
8310
- originalRunId: typeof Schema.NonEmptyString;
8311
- originalExecutionId: typeof Schema.NonEmptyString;
8312
- workflowName: typeof Schema.NonEmptyString;
8313
- }>>, Schema.Struct<{
8314
- kind: Schema.Literal<["not-started"]>;
8315
- outcome: Schema.Union<[Schema.Struct<{
8316
- kind: Schema.Literal<["dropped"]>;
8317
- at: typeof Schema.Number;
8318
- retryAfterMs: typeof Schema.Number;
8419
+ export declare const WorkflowRetryObservationSchema: Schema.Union<readonly [Schema.Struct<{
8420
+ readonly kind: Schema.Literal<"queued">;
8421
+ readonly nextAttemptAt: Schema.NullOr<Schema.Number>;
8422
+ readonly requestId: Schema.NonEmptyString;
8423
+ readonly originalRunId: Schema.NonEmptyString;
8424
+ readonly originalExecutionId: Schema.NonEmptyString;
8425
+ readonly workflowName: Schema.NonEmptyString;
8426
+ }>, Schema.Struct<{
8427
+ readonly kind: Schema.Literal<"accepted">;
8428
+ readonly executionId: Schema.NonEmptyString;
8429
+ readonly requestId: Schema.NonEmptyString;
8430
+ readonly originalRunId: Schema.NonEmptyString;
8431
+ readonly originalExecutionId: Schema.NonEmptyString;
8432
+ readonly workflowName: Schema.NonEmptyString;
8433
+ }>, Schema.Struct<{
8434
+ readonly kind: Schema.Literal<"unconfirmed">;
8435
+ readonly automaticRetryStopped: Schema.Boolean;
8436
+ readonly nextAttemptAt: Schema.NullOr<Schema.Number>;
8437
+ readonly requestId: Schema.NonEmptyString;
8438
+ readonly originalRunId: Schema.NonEmptyString;
8439
+ readonly originalExecutionId: Schema.NonEmptyString;
8440
+ readonly workflowName: Schema.NonEmptyString;
8441
+ }>, Schema.Struct<{
8442
+ readonly kind: Schema.Literal<"not-started">;
8443
+ readonly outcome: Schema.Union<readonly [Schema.Struct<{
8444
+ readonly kind: Schema.Literal<"dropped">;
8445
+ readonly at: Schema.Number;
8446
+ readonly retryAfterMs: Schema.Number;
8319
8447
  }>, Schema.Struct<{
8320
- kind: Schema.Literal<["skipped"]>;
8321
- at: typeof Schema.Number;
8322
- executionId: typeof Schema.String;
8323
- runId: typeof Schema.String;
8448
+ readonly kind: Schema.Literal<"skipped">;
8449
+ readonly at: Schema.Number;
8450
+ readonly executionId: Schema.String;
8451
+ readonly runId: Schema.String;
8324
8452
  }>, Schema.Struct<{
8325
- kind: Schema.Literal<["superseded"]>;
8326
- at: typeof Schema.Number;
8453
+ readonly kind: Schema.Literal<"superseded">;
8454
+ readonly at: Schema.Number;
8327
8455
  }>, Schema.Struct<{
8328
- kind: Schema.Literal<["cancelled"]>;
8329
- at: typeof Schema.Number;
8456
+ readonly kind: Schema.Literal<"cancelled">;
8457
+ readonly at: Schema.Number;
8330
8458
  }>, Schema.Struct<{
8331
- kind: Schema.Literal<["abandoned"]>;
8332
- at: typeof Schema.Number;
8333
- failureId: typeof Schema.NonEmptyString;
8459
+ readonly kind: Schema.Literal<"abandoned">;
8460
+ readonly at: Schema.Number;
8461
+ readonly failureId: Schema.NonEmptyString;
8334
8462
  }>]>;
8335
- requestId: typeof Schema.NonEmptyString;
8336
- originalRunId: typeof Schema.NonEmptyString;
8337
- originalExecutionId: typeof Schema.NonEmptyString;
8338
- workflowName: typeof Schema.NonEmptyString;
8463
+ readonly requestId: Schema.NonEmptyString;
8464
+ readonly originalRunId: Schema.NonEmptyString;
8465
+ readonly originalExecutionId: Schema.NonEmptyString;
8466
+ readonly workflowName: Schema.NonEmptyString;
8339
8467
  }>, Schema.Struct<{
8340
- kind: Schema.Literal<["rejected"]>;
8341
- failureId: typeof Schema.NonEmptyString;
8342
- requestId: typeof Schema.NonEmptyString;
8343
- originalRunId: typeof Schema.NonEmptyString;
8344
- originalExecutionId: typeof Schema.NonEmptyString;
8345
- workflowName: typeof Schema.NonEmptyString;
8468
+ readonly kind: Schema.Literal<"rejected">;
8469
+ readonly failureId: Schema.NonEmptyString;
8470
+ readonly requestId: Schema.NonEmptyString;
8471
+ readonly originalRunId: Schema.NonEmptyString;
8472
+ readonly originalExecutionId: Schema.NonEmptyString;
8473
+ readonly workflowName: Schema.NonEmptyString;
8346
8474
  }>]>;
8347
8475
 
8348
8476
  export declare type WorkflowRetryTarget = typeof WorkflowRetryTargetSchema.Type;
8349
8477
 
8350
8478
  /** Persist the request ID before sending. Reuse this target after a lost reply. */
8351
8479
  export declare const WorkflowRetryTargetSchema: Schema.Struct<{
8352
- runId: Schema.filter<typeof Schema.NonEmptyString>;
8353
- requestId: Schema.filter<typeof Schema.NonEmptyString>;
8480
+ readonly runId: Schema.NonEmptyString;
8481
+ readonly requestId: Schema.NonEmptyString;
8354
8482
  }>;
8355
8483
 
8356
8484
  export declare type WorkflowRunEventRow = Schema.Schema.Type<typeof WorkflowRunEventRowSchema>;
8357
8485
 
8358
8486
  export declare const WorkflowRunEventRowSchema: Schema.Struct<{
8359
- id: typeof Schema.String;
8360
- runId: typeof Schema.String;
8361
- eventType: typeof Schema.String;
8362
- payload: Schema.NullOr<typeof Schema.Unknown>;
8363
- occurredAt: typeof Schema.Date;
8364
- stepName: Schema.NullOr<typeof Schema.String>;
8365
- attempt: Schema.NullOr<typeof Schema.Number>;
8487
+ readonly id: Schema.String;
8488
+ readonly runId: Schema.String;
8489
+ readonly eventType: Schema.String;
8490
+ readonly payload: Schema.NullOr<Schema.Unknown>;
8491
+ readonly occurredAt: Schema.DateFromString;
8492
+ readonly stepName: Schema.NullOr<Schema.String>;
8493
+ readonly attempt: Schema.NullOr<Schema.Number>;
8366
8494
  }>;
8367
8495
 
8368
8496
  export declare const workflowRunEventsQueryDescriptor: QueryProcedureDescriptor<"__voltro.workflow.run.events", Schema.Struct<{
8369
8497
  /** `_voltro_workflow_runs.id`; step/event rows reference this id. */
8370
- runId: typeof Schema.String;
8371
- }>, Schema.Array$<Schema.Struct<{
8372
- id: typeof Schema.String;
8373
- runId: typeof Schema.String;
8374
- eventType: typeof Schema.String;
8375
- payload: Schema.NullOr<typeof Schema.Unknown>;
8376
- occurredAt: typeof Schema.Date;
8377
- stepName: Schema.NullOr<typeof Schema.String>;
8378
- attempt: Schema.NullOr<typeof Schema.Number>;
8379
- }>>, typeof Schema.Never>;
8498
+ readonly runId: Schema.String;
8499
+ }>, Schema.$Array<Schema.Struct<{
8500
+ readonly id: Schema.String;
8501
+ readonly runId: Schema.String;
8502
+ readonly eventType: Schema.String;
8503
+ readonly payload: Schema.NullOr<Schema.Unknown>;
8504
+ readonly occurredAt: Schema.DateFromString;
8505
+ readonly stepName: Schema.NullOr<Schema.String>;
8506
+ readonly attempt: Schema.NullOr<Schema.Number>;
8507
+ }>>, Schema.Never>;
8380
8508
 
8381
8509
  export declare type WorkflowRunHandle = Schema.Schema.Type<typeof WorkflowRunHandleSchema>;
8382
8510
 
8383
8511
  export declare const WorkflowRunHandleSchema: Schema.Struct<{
8384
8512
  /** Stable handle callers pass to `useWorkflowRun(...)`. The durable execution
8385
8513
  * id for a started run; the durable caller-receipt id for a queued one. */
8386
- id: typeof Schema.String;
8514
+ readonly id: Schema.String;
8387
8515
  /** Workflow tag, e.g. `notes.summarise`. */
8388
- workflowName: typeof Schema.String;
8516
+ readonly workflowName: Schema.String;
8389
8517
  /**
8390
8518
  * Deterministic durable id derived from workflow name + idempotency key.
8391
8519
  *
@@ -8399,7 +8527,7 @@ export declare const WorkflowRunHandleSchema: Schema.Struct<{
8399
8527
  * For a `skipped` singleton it is the INCUMBENT's execution id — a real,
8400
8528
  * pollable run, which is the entire point of `mode: 'skip'`.
8401
8529
  */
8402
- executionId: Schema.NullOr<typeof Schema.String>;
8530
+ readonly executionId: Schema.NullOr<Schema.String>;
8403
8531
  /**
8404
8532
  * `running` — the engine has it; starting is fire-and-return.
8405
8533
  * `succeeded` — a blocking start observed successful completion.
@@ -8415,8 +8543,8 @@ export declare const WorkflowRunHandleSchema: Schema.Struct<{
8415
8543
  * a fresh start; a schedule keyed per day ran once and reported forty-seven
8416
8544
  * "starts" that were replays. See `workflow()`'s `idempotencyKey` doc.
8417
8545
  */
8418
- status: Schema.Literal<["running", "succeeded", "queued", "dropped", "skipped", "replayed"]>;
8419
- deferral: Schema.optional<Schema.Struct<{
8546
+ readonly status: Schema.Literals<readonly ["running", "succeeded", "queued", "dropped", "skipped", "replayed"]>;
8547
+ readonly deferral: Schema.optional<Schema.Struct<{
8420
8548
  /** `debounce` | `batch` | `throttle` | `concurrency` | `paused` |
8421
8549
  * `rateLimit` | `singleton` | `delayed` | `transaction` | `unacknowledged`.
8422
8550
  *
@@ -8424,179 +8552,179 @@ export declare const WorkflowRunHandleSchema: Schema.Struct<{
8424
8552
  * back. The engine may have it; recovery retries the dispatch and binds the
8425
8553
  * receipt (`id`) to whatever run results. It is not a failure: do not
8426
8554
  * report one to a user, follow the receipt. */
8427
- mode: typeof Schema.String;
8555
+ readonly mode: Schema.String;
8428
8556
  /** Epoch ms this may first be admitted. Null for a drop or a skip. */
8429
- dueAt: Schema.NullOr<typeof Schema.Number>;
8557
+ readonly dueAt: Schema.NullOr<Schema.Number>;
8430
8558
  /** How long until the rate window reopens. Null unless dropped. */
8431
- retryAfterMs: Schema.NullOr<typeof Schema.Number>;
8559
+ readonly retryAfterMs: Schema.NullOr<Schema.Number>;
8432
8560
  /** The `_voltro_workflow_pending` row holding this start. Null unless queued. */
8433
- intentId: Schema.NullOr<typeof Schema.String>;
8561
+ readonly intentId: Schema.NullOr<Schema.String>;
8434
8562
  }>>;
8435
8563
  }>;
8436
8564
 
8437
8565
  export declare const workflowRunQueryDescriptor: QueryProcedureDescriptor<"__voltro.workflow.run", Schema.Struct<{
8438
8566
  /** `_voltro_workflow_runs.id` OR durable `executionId`. */
8439
- id: typeof Schema.String;
8440
- }>, Schema.Array$<Schema.Struct<{
8441
- id: typeof Schema.String;
8442
- tag: typeof Schema.String;
8443
- executionId: typeof Schema.String;
8444
- status: Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>;
8445
- payload: typeof Schema.Unknown;
8446
- workflowVersion: Schema.NullOr<typeof Schema.String>;
8447
- workflowPatches: Schema.NullOr<typeof Schema.Unknown>;
8448
- output: Schema.NullOr<typeof Schema.Unknown>;
8449
- subject: Schema.NullOr<typeof Schema.Unknown>;
8450
- source: Schema.NullOr<typeof Schema.String>;
8451
- errorTag: Schema.NullOr<typeof Schema.String>;
8452
- errorMessage: Schema.NullOr<typeof Schema.String>;
8453
- cancelled: typeof Schema.Boolean;
8454
- startedAt: typeof Schema.Date;
8455
- completedAt: Schema.NullOr<typeof Schema.Date>;
8456
- durationMs: Schema.NullOr<typeof Schema.Number>;
8457
- traceId: Schema.NullOr<typeof Schema.String>;
8458
- parentExecutionId: Schema.NullOr<typeof Schema.String>;
8459
- parentClosePolicy: Schema.NullOr<Schema.Literal<["cancel", "terminate", "abandon"]>>;
8460
- }>>, typeof Schema.Never>;
8567
+ readonly id: Schema.String;
8568
+ }>, Schema.$Array<Schema.Struct<{
8569
+ readonly id: Schema.String;
8570
+ readonly tag: Schema.String;
8571
+ readonly executionId: Schema.String;
8572
+ readonly status: Schema.Literals<readonly ["running", "succeeded", "failed", "cancelled", "suspended"]>;
8573
+ readonly payload: Schema.Unknown;
8574
+ readonly workflowVersion: Schema.NullOr<Schema.String>;
8575
+ readonly workflowPatches: Schema.NullOr<Schema.Unknown>;
8576
+ readonly output: Schema.NullOr<Schema.Unknown>;
8577
+ readonly subject: Schema.NullOr<Schema.Unknown>;
8578
+ readonly source: Schema.NullOr<Schema.String>;
8579
+ readonly errorTag: Schema.NullOr<Schema.String>;
8580
+ readonly errorMessage: Schema.NullOr<Schema.String>;
8581
+ readonly cancelled: Schema.Boolean;
8582
+ readonly startedAt: Schema.DateFromString;
8583
+ readonly completedAt: Schema.NullOr<Schema.DateFromString>;
8584
+ readonly durationMs: Schema.NullOr<Schema.Number>;
8585
+ readonly traceId: Schema.NullOr<Schema.String>;
8586
+ readonly parentExecutionId: Schema.NullOr<Schema.String>;
8587
+ readonly parentClosePolicy: Schema.NullOr<Schema.Literals<readonly ["cancel", "terminate", "abandon"]>>;
8588
+ }>>, Schema.Never>;
8461
8589
 
8462
8590
  export declare const WorkflowRunRefSchema: Schema.Struct<{
8463
8591
  /** `_voltro_workflow_runs.id` OR durable `executionId`. */
8464
- id: typeof Schema.String;
8592
+ readonly id: Schema.String;
8465
8593
  }>;
8466
8594
 
8467
8595
  export declare type WorkflowRunRow = Schema.Schema.Type<typeof WorkflowRunRowSchema>;
8468
8596
 
8469
8597
  export declare const WorkflowRunRowSchema: Schema.Struct<{
8470
- id: typeof Schema.String;
8471
- tag: typeof Schema.String;
8472
- executionId: typeof Schema.String;
8473
- status: Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>;
8474
- payload: typeof Schema.Unknown;
8475
- workflowVersion: Schema.NullOr<typeof Schema.String>;
8476
- workflowPatches: Schema.NullOr<typeof Schema.Unknown>;
8477
- output: Schema.NullOr<typeof Schema.Unknown>;
8478
- subject: Schema.NullOr<typeof Schema.Unknown>;
8479
- source: Schema.NullOr<typeof Schema.String>;
8480
- errorTag: Schema.NullOr<typeof Schema.String>;
8481
- errorMessage: Schema.NullOr<typeof Schema.String>;
8482
- cancelled: typeof Schema.Boolean;
8483
- startedAt: typeof Schema.Date;
8484
- completedAt: Schema.NullOr<typeof Schema.Date>;
8485
- durationMs: Schema.NullOr<typeof Schema.Number>;
8486
- traceId: Schema.NullOr<typeof Schema.String>;
8487
- parentExecutionId: Schema.NullOr<typeof Schema.String>;
8488
- parentClosePolicy: Schema.NullOr<Schema.Literal<["cancel", "terminate", "abandon"]>>;
8598
+ readonly id: Schema.String;
8599
+ readonly tag: Schema.String;
8600
+ readonly executionId: Schema.String;
8601
+ readonly status: Schema.Literals<readonly ["running", "succeeded", "failed", "cancelled", "suspended"]>;
8602
+ readonly payload: Schema.Unknown;
8603
+ readonly workflowVersion: Schema.NullOr<Schema.String>;
8604
+ readonly workflowPatches: Schema.NullOr<Schema.Unknown>;
8605
+ readonly output: Schema.NullOr<Schema.Unknown>;
8606
+ readonly subject: Schema.NullOr<Schema.Unknown>;
8607
+ readonly source: Schema.NullOr<Schema.String>;
8608
+ readonly errorTag: Schema.NullOr<Schema.String>;
8609
+ readonly errorMessage: Schema.NullOr<Schema.String>;
8610
+ readonly cancelled: Schema.Boolean;
8611
+ readonly startedAt: Schema.DateFromString;
8612
+ readonly completedAt: Schema.NullOr<Schema.DateFromString>;
8613
+ readonly durationMs: Schema.NullOr<Schema.Number>;
8614
+ readonly traceId: Schema.NullOr<Schema.String>;
8615
+ readonly parentExecutionId: Schema.NullOr<Schema.String>;
8616
+ readonly parentClosePolicy: Schema.NullOr<Schema.Literals<readonly ["cancel", "terminate", "abandon"]>>;
8489
8617
  }>;
8490
8618
 
8491
8619
  export declare type WorkflowRunsInput = Schema.Schema.Type<typeof WorkflowRunsInputSchema>;
8492
8620
 
8493
8621
  export declare const WorkflowRunsInputSchema: Schema.Struct<{
8494
- tag: Schema.optional<typeof Schema.String>;
8495
- status: Schema.optional<Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>>;
8496
- limit: Schema.optional<typeof Schema.Number>;
8622
+ readonly tag: Schema.optional<Schema.String>;
8623
+ readonly status: Schema.optional<Schema.Literals<readonly ["running", "succeeded", "failed", "cancelled", "suspended"]>>;
8624
+ readonly limit: Schema.optional<Schema.Number>;
8497
8625
  }>;
8498
8626
 
8499
8627
  export declare type WorkflowRunSnapshot = Schema.Schema.Type<typeof WorkflowRunSnapshotSchema>;
8500
8628
 
8501
8629
  /** Observed execution state, distinct from admission/start handles. */
8502
8630
  export declare const WorkflowRunSnapshotSchema: Schema.Struct<{
8503
- id: typeof Schema.String;
8504
- workflowName: typeof Schema.String;
8505
- executionId: typeof Schema.String;
8506
- status: Schema.Union<[Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>, Schema.Literal<["unknown"]>]>;
8507
- output: Schema.optional<typeof Schema.Unknown>;
8508
- error: Schema.optional<Schema.Struct<{
8509
- tag: Schema.NullOr<typeof Schema.String>;
8510
- message: typeof Schema.String;
8631
+ readonly id: Schema.String;
8632
+ readonly workflowName: Schema.String;
8633
+ readonly executionId: Schema.String;
8634
+ readonly status: Schema.Union<readonly [Schema.Literals<readonly ["running", "succeeded", "failed", "cancelled", "suspended"]>, Schema.Literal<"unknown">]>;
8635
+ readonly output: Schema.optional<Schema.Unknown>;
8636
+ readonly error: Schema.optional<Schema.Struct<{
8637
+ readonly tag: Schema.NullOr<Schema.String>;
8638
+ readonly message: Schema.String;
8511
8639
  }>>;
8512
8640
  }>;
8513
8641
 
8514
8642
  export declare const workflowRunsQueryDescriptor: QueryProcedureDescriptor<"__voltro.workflow.runs", Schema.Struct<{
8515
- tag: Schema.optional<typeof Schema.String>;
8516
- status: Schema.optional<Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>>;
8517
- limit: Schema.optional<typeof Schema.Number>;
8518
- }>, Schema.Array$<Schema.Struct<{
8519
- id: typeof Schema.String;
8520
- tag: typeof Schema.String;
8521
- executionId: typeof Schema.String;
8522
- status: Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>;
8523
- payload: typeof Schema.Unknown;
8524
- workflowVersion: Schema.NullOr<typeof Schema.String>;
8525
- workflowPatches: Schema.NullOr<typeof Schema.Unknown>;
8526
- output: Schema.NullOr<typeof Schema.Unknown>;
8527
- subject: Schema.NullOr<typeof Schema.Unknown>;
8528
- source: Schema.NullOr<typeof Schema.String>;
8529
- errorTag: Schema.NullOr<typeof Schema.String>;
8530
- errorMessage: Schema.NullOr<typeof Schema.String>;
8531
- cancelled: typeof Schema.Boolean;
8532
- startedAt: typeof Schema.Date;
8533
- completedAt: Schema.NullOr<typeof Schema.Date>;
8534
- durationMs: Schema.NullOr<typeof Schema.Number>;
8535
- traceId: Schema.NullOr<typeof Schema.String>;
8536
- parentExecutionId: Schema.NullOr<typeof Schema.String>;
8537
- parentClosePolicy: Schema.NullOr<Schema.Literal<["cancel", "terminate", "abandon"]>>;
8538
- }>>, typeof Schema.Never>;
8643
+ readonly tag: Schema.optional<Schema.String>;
8644
+ readonly status: Schema.optional<Schema.Literals<readonly ["running", "succeeded", "failed", "cancelled", "suspended"]>>;
8645
+ readonly limit: Schema.optional<Schema.Number>;
8646
+ }>, Schema.$Array<Schema.Struct<{
8647
+ readonly id: Schema.String;
8648
+ readonly tag: Schema.String;
8649
+ readonly executionId: Schema.String;
8650
+ readonly status: Schema.Literals<readonly ["running", "succeeded", "failed", "cancelled", "suspended"]>;
8651
+ readonly payload: Schema.Unknown;
8652
+ readonly workflowVersion: Schema.NullOr<Schema.String>;
8653
+ readonly workflowPatches: Schema.NullOr<Schema.Unknown>;
8654
+ readonly output: Schema.NullOr<Schema.Unknown>;
8655
+ readonly subject: Schema.NullOr<Schema.Unknown>;
8656
+ readonly source: Schema.NullOr<Schema.String>;
8657
+ readonly errorTag: Schema.NullOr<Schema.String>;
8658
+ readonly errorMessage: Schema.NullOr<Schema.String>;
8659
+ readonly cancelled: Schema.Boolean;
8660
+ readonly startedAt: Schema.DateFromString;
8661
+ readonly completedAt: Schema.NullOr<Schema.DateFromString>;
8662
+ readonly durationMs: Schema.NullOr<Schema.Number>;
8663
+ readonly traceId: Schema.NullOr<Schema.String>;
8664
+ readonly parentExecutionId: Schema.NullOr<Schema.String>;
8665
+ readonly parentClosePolicy: Schema.NullOr<Schema.Literals<readonly ["cancel", "terminate", "abandon"]>>;
8666
+ }>>, Schema.Never>;
8539
8667
 
8540
8668
  export declare type WorkflowRunStatus = Schema.Schema.Type<typeof WorkflowRunStatusSchema>;
8541
8669
 
8542
- export declare const WorkflowRunStatusSchema: Schema.Literal<["running", "succeeded", "failed", "cancelled", "suspended"]>;
8670
+ export declare const WorkflowRunStatusSchema: Schema.Literals<readonly ["running", "succeeded", "failed", "cancelled", "suspended"]>;
8543
8671
 
8544
8672
  export declare type WorkflowRunStepRow = Schema.Schema.Type<typeof WorkflowRunStepRowSchema>;
8545
8673
 
8546
8674
  export declare const WorkflowRunStepRowSchema: Schema.Struct<{
8547
- id: typeof Schema.String;
8548
- runId: typeof Schema.String;
8549
- stepName: typeof Schema.String;
8550
- attempt: typeof Schema.Number;
8551
- status: Schema.Literal<["running", "succeeded", "failed"]>;
8552
- input: Schema.NullOr<typeof Schema.Unknown>;
8553
- retryPolicy: Schema.NullOr<typeof Schema.Unknown>;
8554
- output: Schema.NullOr<typeof Schema.Unknown>;
8555
- errorTag: Schema.NullOr<typeof Schema.String>;
8556
- errorMessage: Schema.NullOr<typeof Schema.String>;
8557
- errorCause: Schema.NullOr<typeof Schema.Unknown>;
8558
- startedAt: typeof Schema.Date;
8559
- completedAt: Schema.NullOr<typeof Schema.Date>;
8560
- durationMs: Schema.NullOr<typeof Schema.Number>;
8675
+ readonly id: Schema.String;
8676
+ readonly runId: Schema.String;
8677
+ readonly stepName: Schema.String;
8678
+ readonly attempt: Schema.Number;
8679
+ readonly status: Schema.Literals<readonly ["running", "succeeded", "failed"]>;
8680
+ readonly input: Schema.NullOr<Schema.Unknown>;
8681
+ readonly retryPolicy: Schema.NullOr<Schema.Unknown>;
8682
+ readonly output: Schema.NullOr<Schema.Unknown>;
8683
+ readonly errorTag: Schema.NullOr<Schema.String>;
8684
+ readonly errorMessage: Schema.NullOr<Schema.String>;
8685
+ readonly errorCause: Schema.NullOr<Schema.Unknown>;
8686
+ readonly startedAt: Schema.DateFromString;
8687
+ readonly completedAt: Schema.NullOr<Schema.DateFromString>;
8688
+ readonly durationMs: Schema.NullOr<Schema.Number>;
8561
8689
  }>;
8562
8690
 
8563
8691
  export declare const workflowRunStepsQueryDescriptor: QueryProcedureDescriptor<"__voltro.workflow.run.steps", Schema.Struct<{
8564
8692
  /** `_voltro_workflow_runs.id`; step/event rows reference this id. */
8565
- runId: typeof Schema.String;
8566
- }>, Schema.Array$<Schema.Struct<{
8567
- id: typeof Schema.String;
8568
- runId: typeof Schema.String;
8569
- stepName: typeof Schema.String;
8570
- attempt: typeof Schema.Number;
8571
- status: Schema.Literal<["running", "succeeded", "failed"]>;
8572
- input: Schema.NullOr<typeof Schema.Unknown>;
8573
- retryPolicy: Schema.NullOr<typeof Schema.Unknown>;
8574
- output: Schema.NullOr<typeof Schema.Unknown>;
8575
- errorTag: Schema.NullOr<typeof Schema.String>;
8576
- errorMessage: Schema.NullOr<typeof Schema.String>;
8577
- errorCause: Schema.NullOr<typeof Schema.Unknown>;
8578
- startedAt: typeof Schema.Date;
8579
- completedAt: Schema.NullOr<typeof Schema.Date>;
8580
- durationMs: Schema.NullOr<typeof Schema.Number>;
8581
- }>>, typeof Schema.Never>;
8693
+ readonly runId: Schema.String;
8694
+ }>, Schema.$Array<Schema.Struct<{
8695
+ readonly id: Schema.String;
8696
+ readonly runId: Schema.String;
8697
+ readonly stepName: Schema.String;
8698
+ readonly attempt: Schema.Number;
8699
+ readonly status: Schema.Literals<readonly ["running", "succeeded", "failed"]>;
8700
+ readonly input: Schema.NullOr<Schema.Unknown>;
8701
+ readonly retryPolicy: Schema.NullOr<Schema.Unknown>;
8702
+ readonly output: Schema.NullOr<Schema.Unknown>;
8703
+ readonly errorTag: Schema.NullOr<Schema.String>;
8704
+ readonly errorMessage: Schema.NullOr<Schema.String>;
8705
+ readonly errorCause: Schema.NullOr<Schema.Unknown>;
8706
+ readonly startedAt: Schema.DateFromString;
8707
+ readonly completedAt: Schema.NullOr<Schema.DateFromString>;
8708
+ readonly durationMs: Schema.NullOr<Schema.Number>;
8709
+ }>>, Schema.Never>;
8582
8710
 
8583
8711
  export declare const WorkflowRunTableRefSchema: Schema.Struct<{
8584
8712
  /** `_voltro_workflow_runs.id`; step/event rows reference this id. */
8585
- runId: typeof Schema.String;
8713
+ readonly runId: Schema.String;
8586
8714
  }>;
8587
8715
 
8588
8716
  export declare const workflowSignalDescriptor: ActionProcedureDescriptor<"__voltro.workflow.signal", Schema.Struct<{
8589
- id: typeof Schema.String;
8590
- signalName: typeof Schema.String;
8591
- payload: Schema.optional<typeof Schema.Unknown>;
8717
+ readonly id: Schema.String;
8718
+ readonly signalName: Schema.String;
8719
+ readonly payload: Schema.optional<Schema.Unknown>;
8592
8720
  }>, Schema.Struct<{
8593
- eventId: typeof Schema.String;
8594
- }>, typeof Schema.Never>;
8721
+ readonly eventId: Schema.String;
8722
+ }>, Schema.Never>;
8595
8723
 
8596
8724
  export declare const WorkflowSignalInputSchema: Schema.Struct<{
8597
- id: typeof Schema.String;
8598
- signalName: typeof Schema.String;
8599
- payload: Schema.optional<typeof Schema.Unknown>;
8725
+ readonly id: Schema.String;
8726
+ readonly signalName: Schema.String;
8727
+ readonly payload: Schema.optional<Schema.Unknown>;
8600
8728
  }>;
8601
8729
 
8602
8730
  export declare type WorkflowStartDeferral = Schema.Schema.Type<typeof WorkflowStartDeferralSchema>;
@@ -8617,38 +8745,38 @@ export declare const WorkflowStartDeferralSchema: Schema.Struct<{
8617
8745
  * back. The engine may have it; recovery retries the dispatch and binds the
8618
8746
  * receipt (`id`) to whatever run results. It is not a failure: do not
8619
8747
  * report one to a user, follow the receipt. */
8620
- mode: typeof Schema.String;
8748
+ readonly mode: Schema.String;
8621
8749
  /** Epoch ms this may first be admitted. Null for a drop or a skip. */
8622
- dueAt: Schema.NullOr<typeof Schema.Number>;
8750
+ readonly dueAt: Schema.NullOr<Schema.Number>;
8623
8751
  /** How long until the rate window reopens. Null unless dropped. */
8624
- retryAfterMs: Schema.NullOr<typeof Schema.Number>;
8752
+ readonly retryAfterMs: Schema.NullOr<Schema.Number>;
8625
8753
  /** The `_voltro_workflow_pending` row holding this start. Null unless queued. */
8626
- intentId: Schema.NullOr<typeof Schema.String>;
8754
+ readonly intentId: Schema.NullOr<Schema.String>;
8627
8755
  }>;
8628
8756
 
8629
8757
  export declare type WorkflowStartTerminalOutcome = typeof WorkflowStartTerminalOutcomeSchema.Type;
8630
8758
 
8631
8759
  /** A settled admission outcome is not a terminal execution snapshot. In the
8632
8760
  * skipped case the identities belong to the incumbent, not to a new run. */
8633
- export declare const WorkflowStartTerminalOutcomeSchema: Schema.Union<[Schema.Struct<{
8634
- kind: Schema.Literal<["dropped"]>;
8635
- at: typeof Schema.Number;
8636
- retryAfterMs: typeof Schema.Number;
8761
+ export declare const WorkflowStartTerminalOutcomeSchema: Schema.Union<readonly [Schema.Struct<{
8762
+ readonly kind: Schema.Literal<"dropped">;
8763
+ readonly at: Schema.Number;
8764
+ readonly retryAfterMs: Schema.Number;
8637
8765
  }>, Schema.Struct<{
8638
- kind: Schema.Literal<["skipped"]>;
8639
- at: typeof Schema.Number;
8640
- executionId: typeof Schema.String;
8641
- runId: typeof Schema.String;
8766
+ readonly kind: Schema.Literal<"skipped">;
8767
+ readonly at: Schema.Number;
8768
+ readonly executionId: Schema.String;
8769
+ readonly runId: Schema.String;
8642
8770
  }>, Schema.Struct<{
8643
- kind: Schema.Literal<["superseded"]>;
8644
- at: typeof Schema.Number;
8771
+ readonly kind: Schema.Literal<"superseded">;
8772
+ readonly at: Schema.Number;
8645
8773
  }>, Schema.Struct<{
8646
- kind: Schema.Literal<["cancelled"]>;
8647
- at: typeof Schema.Number;
8774
+ readonly kind: Schema.Literal<"cancelled">;
8775
+ readonly at: Schema.Number;
8648
8776
  }>, Schema.Struct<{
8649
- kind: Schema.Literal<["abandoned"]>;
8650
- at: typeof Schema.Number;
8651
- failureId: typeof Schema.NonEmptyString;
8777
+ readonly kind: Schema.Literal<"abandoned">;
8778
+ readonly at: Schema.Number;
8779
+ readonly failureId: Schema.NonEmptyString;
8652
8780
  }>]>;
8653
8781
 
8654
8782
  /**
@@ -8662,7 +8790,7 @@ export declare const WorkflowStartTerminalOutcomeSchema: Schema.Union<[Schema.St
8662
8790
  * step-level retry-policy override, step-level resource scoping,
8663
8791
  * external observability injection.
8664
8792
  *
8665
- * The interceptor runs INSIDE `@effect/workflow`'s replay logic —
8793
+ * The interceptor runs INSIDE `effect/workflow`'s replay logic —
8666
8794
  * on a workflow resume, the framework replays cached Activity
8667
8795
  * outputs without re-running the user effect, and the interceptor
8668
8796
  * is bypassed on replay (only fires on the first execution).
@@ -8692,16 +8820,16 @@ export declare type WorkflowStepInterceptor = <Success, ErrorE, R>(next: Effect.
8692
8820
  * error union with `ScopeError` / `Unauthenticated`, exactly as it does for a
8693
8821
  * mutation, and labels the strict-input refusal as a guarded procedure's.
8694
8822
  */
8695
- export declare const workflowToRpc: <const Name extends string, Payload extends Schema.Schema.Any>(workflow: {
8823
+ export declare const workflowToRpc: <const Name extends string, Payload extends Schema.Top>(workflow: {
8696
8824
  readonly name: Name;
8697
8825
  readonly payloadSchema: Payload;
8698
- readonly errorSchema: Schema.Schema.All;
8826
+ readonly errorSchema: Schema.Top;
8699
8827
  }, extraErrors?: ExtraErrors) => Rpc.Rpc<Name, Payload extends Schema.Struct.Fields ? Schema.Struct<Payload> : Payload, Schema.Struct<{
8700
8828
  /** Stable handle callers pass to `useWorkflowRun(...)`. The durable execution
8701
8829
  * id for a started run; the durable caller-receipt id for a queued one. */
8702
- id: typeof Schema.String;
8830
+ readonly id: Schema.String;
8703
8831
  /** Workflow tag, e.g. `notes.summarise`. */
8704
- workflowName: typeof Schema.String;
8832
+ readonly workflowName: Schema.String;
8705
8833
  /**
8706
8834
  * Deterministic durable id derived from workflow name + idempotency key.
8707
8835
  *
@@ -8715,7 +8843,7 @@ export declare const workflowToRpc: <const Name extends string, Payload extends
8715
8843
  * For a `skipped` singleton it is the INCUMBENT's execution id — a real,
8716
8844
  * pollable run, which is the entire point of `mode: 'skip'`.
8717
8845
  */
8718
- executionId: Schema.NullOr<typeof Schema.String>;
8846
+ readonly executionId: Schema.NullOr<Schema.String>;
8719
8847
  /**
8720
8848
  * `running` — the engine has it; starting is fire-and-return.
8721
8849
  * `succeeded` — a blocking start observed successful completion.
@@ -8731,8 +8859,8 @@ export declare const workflowToRpc: <const Name extends string, Payload extends
8731
8859
  * a fresh start; a schedule keyed per day ran once and reported forty-seven
8732
8860
  * "starts" that were replays. See `workflow()`'s `idempotencyKey` doc.
8733
8861
  */
8734
- status: Schema.Literal<["running", "succeeded", "queued", "dropped", "skipped", "replayed"]>;
8735
- deferral: Schema.optional<Schema.Struct<{
8862
+ readonly status: Schema.Literals<readonly ["running", "succeeded", "queued", "dropped", "skipped", "replayed"]>;
8863
+ readonly deferral: Schema.optional<Schema.Struct<{
8736
8864
  /** `debounce` | `batch` | `throttle` | `concurrency` | `paused` |
8737
8865
  * `rateLimit` | `singleton` | `delayed` | `transaction` | `unacknowledged`.
8738
8866
  *
@@ -8740,42 +8868,42 @@ export declare const workflowToRpc: <const Name extends string, Payload extends
8740
8868
  * back. The engine may have it; recovery retries the dispatch and binds the
8741
8869
  * receipt (`id`) to whatever run results. It is not a failure: do not
8742
8870
  * report one to a user, follow the receipt. */
8743
- mode: typeof Schema.String;
8871
+ readonly mode: Schema.String;
8744
8872
  /** Epoch ms this may first be admitted. Null for a drop or a skip. */
8745
- dueAt: Schema.NullOr<typeof Schema.Number>;
8873
+ readonly dueAt: Schema.NullOr<Schema.Number>;
8746
8874
  /** How long until the rate window reopens. Null unless dropped. */
8747
- retryAfterMs: Schema.NullOr<typeof Schema.Number>;
8875
+ readonly retryAfterMs: Schema.NullOr<Schema.Number>;
8748
8876
  /** The `_voltro_workflow_pending` row holding this start. Null unless queued. */
8749
- intentId: Schema.NullOr<typeof Schema.String>;
8877
+ readonly intentId: Schema.NullOr<Schema.String>;
8750
8878
  }>>;
8751
- }>, Schema.Schema.All, never>;
8879
+ }>, Schema.Top, never, never>;
8752
8880
 
8753
8881
  export declare const workflowUpdateDescriptor: ActionProcedureDescriptor<"__voltro.workflow.update", Schema.Struct<{
8754
- id: typeof Schema.String;
8755
- updateName: typeof Schema.String;
8756
- payload: Schema.optional<typeof Schema.Unknown>;
8757
- timeoutMs: Schema.optional<typeof Schema.Number>;
8882
+ readonly id: Schema.String;
8883
+ readonly updateName: Schema.String;
8884
+ readonly payload: Schema.optional<Schema.Unknown>;
8885
+ readonly timeoutMs: Schema.optional<Schema.Number>;
8758
8886
  }>, Schema.Struct<{
8759
- eventId: typeof Schema.String;
8760
- updateId: typeof Schema.String;
8761
- completedEventId: typeof Schema.String;
8762
- result: typeof Schema.Unknown;
8763
- }>, typeof Schema.Never>;
8887
+ readonly eventId: Schema.String;
8888
+ readonly updateId: Schema.String;
8889
+ readonly completedEventId: Schema.String;
8890
+ readonly result: Schema.Unknown;
8891
+ }>, Schema.Never>;
8764
8892
 
8765
8893
  export declare const WorkflowUpdateInputSchema: Schema.Struct<{
8766
- id: typeof Schema.String;
8767
- updateName: typeof Schema.String;
8768
- payload: Schema.optional<typeof Schema.Unknown>;
8769
- timeoutMs: Schema.optional<typeof Schema.Number>;
8894
+ readonly id: Schema.String;
8895
+ readonly updateName: Schema.String;
8896
+ readonly payload: Schema.optional<Schema.Unknown>;
8897
+ readonly timeoutMs: Schema.optional<Schema.Number>;
8770
8898
  }>;
8771
8899
 
8772
8900
  export declare type WorkflowUpdateResult = Schema.Schema.Type<typeof WorkflowUpdateResultSchema>;
8773
8901
 
8774
8902
  export declare const WorkflowUpdateResultSchema: Schema.Struct<{
8775
- eventId: typeof Schema.String;
8776
- updateId: typeof Schema.String;
8777
- completedEventId: typeof Schema.String;
8778
- result: typeof Schema.Unknown;
8903
+ readonly eventId: Schema.String;
8904
+ readonly updateId: Schema.String;
8905
+ readonly completedEventId: Schema.String;
8906
+ readonly result: Schema.Unknown;
8779
8907
  }>;
8780
8908
 
8781
8909
  /**
@@ -8789,9 +8917,9 @@ export declare const WorkflowUpdateResultSchema: Schema.Struct<{
8789
8917
  * `ExitEncoded` defect tree a mutation used to ship for the same reason.
8790
8918
  */
8791
8919
  export declare const workflowWireErrorUnion: (workflow: {
8792
- readonly errorSchema: Schema.Schema.All;
8920
+ readonly errorSchema: Schema.Top;
8793
8921
  readonly guards?: DeclaredAccess | undefined;
8794
- }, extraErrors?: ExtraErrors) => Schema.Schema.All;
8922
+ }, extraErrors?: ExtraErrors) => Schema.Top;
8795
8923
 
8796
8924
  /**
8797
8925
  * Scope for a WS-rpc MUTATION. Unlike the REST scope (tenant + method + path),