@voltro/runtime 0.63.0 → 0.64.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +90 -0
- package/dist/index.d.ts +222 -29
- package/dist/index.js +2531 -2307
- package/package.json +7 -7
package/dist/index.d.ts
CHANGED
|
@@ -33,10 +33,12 @@ import { EventResumePoint } from '@voltro/protocol';
|
|
|
33
33
|
import { EventStreamEvent } from '@voltro/protocol';
|
|
34
34
|
import { extractDbCause } from '@voltro/database';
|
|
35
35
|
import { Fiber } from 'effect';
|
|
36
|
+
import { FieldBinding } from '@voltro/database';
|
|
36
37
|
import { FieldCipher } from '@voltro/database';
|
|
37
38
|
import * as http from 'node:http';
|
|
38
39
|
import { HttpClient } from '@effect/platform';
|
|
39
40
|
import { HttpRequestInterceptor } from '@voltro/protocol';
|
|
41
|
+
import { HttpRouteObserver } from '@voltro/protocol';
|
|
40
42
|
import { IdempotencyStore } from '@voltro/protocol';
|
|
41
43
|
import { IdScheme } from '@voltro/database';
|
|
42
44
|
import { InMemoryMetricExporter } from '@opentelemetry/sdk-metrics';
|
|
@@ -102,6 +104,7 @@ import { Tracer } from 'effect';
|
|
|
102
104
|
import { Unauthenticated } from '@voltro/protocol';
|
|
103
105
|
import { ValidationError } from '@voltro/protocol';
|
|
104
106
|
import { ValidationErrors } from '@voltro/protocol';
|
|
107
|
+
import { VersionConflict } from '@voltro/database';
|
|
105
108
|
import { WebSocketGatewayRoute } from '@voltro/protocol';
|
|
106
109
|
import { WorkflowParentClosePolicy } from '@voltro/protocol';
|
|
107
110
|
import { WorkflowRunHandle } from '@voltro/protocol';
|
|
@@ -1568,6 +1571,15 @@ export declare interface BeginOAuthResult {
|
|
|
1568
1571
|
readonly state: string;
|
|
1569
1572
|
}
|
|
1570
1573
|
|
|
1574
|
+
/** Exported for the backpressure suite — the production caller is `bindSubscription`. */
|
|
1575
|
+
export declare const bindComputedUntyped: (computed: ComputedQuery, dispatcher: Dispatcher, context: RuntimeContext, label: string,
|
|
1576
|
+
/** Tunables override (tests); production reads the process-wide slot. */
|
|
1577
|
+
backpressure?: {
|
|
1578
|
+
readonly maxBufferedBytes: number;
|
|
1579
|
+
readonly overrunAfterMs: number;
|
|
1580
|
+
readonly oversizedEventBytes: number;
|
|
1581
|
+
}) => Stream.Stream<SubscriptionEvent<unknown>, never, never>;
|
|
1582
|
+
|
|
1571
1583
|
/**
|
|
1572
1584
|
* Present a new credential on an ALREADY-OPEN connection.
|
|
1573
1585
|
*
|
|
@@ -2070,6 +2082,27 @@ export declare const collectPluginRefRules: (tables: ReadonlyArray<{
|
|
|
2070
2082
|
}>;
|
|
2071
2083
|
}>, registered: ReadonlySet<string>) => ReadonlyArray<PluginRefRule>;
|
|
2072
2084
|
|
|
2085
|
+
/**
|
|
2086
|
+
* The soft-delete rules an app's OWN `reference(…, { onSoftDelete })` columns
|
|
2087
|
+
* declare — app→app, where the hard delete is a real foreign key and only the
|
|
2088
|
+
* soft delete needs the runtime.
|
|
2089
|
+
*
|
|
2090
|
+
* Refuses at boot, naming the column, when `'cascade'` points from a table
|
|
2091
|
+
* that cannot be soft-deleted: the engine would `store.delete` the child, the
|
|
2092
|
+
* middleware would HARD-delete it (no `softDelete()` to turn it into an
|
|
2093
|
+
* update), and a restore of the parent would bring back a parent whose
|
|
2094
|
+
* children are gone for good.
|
|
2095
|
+
*/
|
|
2096
|
+
export declare const collectReferenceSoftDeleteRules: (tables: ReadonlyArray<{
|
|
2097
|
+
readonly name: string;
|
|
2098
|
+
readonly softDeletable?: boolean;
|
|
2099
|
+
readonly fields?: Readonly<Record<string, {
|
|
2100
|
+
readonly type?: string;
|
|
2101
|
+
readonly references?: () => unknown;
|
|
2102
|
+
readonly refOnSoftDelete?: "cascade" | "setNull";
|
|
2103
|
+
}>>;
|
|
2104
|
+
}>) => ReadonlyArray<PluginRefRule>;
|
|
2105
|
+
|
|
2073
2106
|
/** Parse + return the compiled `Cron` for a definition. Throws the
|
|
2074
2107
|
* same way `defineSchedule` validated — callers that already hold a
|
|
2075
2108
|
* branded definition can trust this won't throw. */
|
|
@@ -2916,7 +2949,7 @@ export declare const decideApprovalInvocation: (input: {
|
|
|
2916
2949
|
* the old form is already on production disks, and a fix that needs the data
|
|
2917
2950
|
* rewritten before the app works is an outage with a migration attached.
|
|
2918
2951
|
*/
|
|
2919
|
-
export declare const decryptField: (value: string) => string;
|
|
2952
|
+
export declare const decryptField: (value: string, binding?: FieldBinding) => string;
|
|
2920
2953
|
|
|
2921
2954
|
export declare const DEFAULT_ANALYTICS_MIRROR_TUNABLES: AnalyticsMirrorTunables;
|
|
2922
2955
|
|
|
@@ -2977,6 +3010,9 @@ export declare const DEFAULT_MAX_RPC_BODY_BYTES: number;
|
|
|
2977
3010
|
* definition nothing keeps in step. */
|
|
2978
3011
|
export declare const DEFAULT_MAX_RUNTIME_MS: number;
|
|
2979
3012
|
|
|
3013
|
+
/** Default replay bound — `mutations.replayAttempts` in `app.config.ts` moves it. */
|
|
3014
|
+
export declare const DEFAULT_MUTATION_REPLAY_ATTEMPTS = 3;
|
|
3015
|
+
|
|
2980
3016
|
/** See {@link DrainDeps.claimLeaseMs}. */
|
|
2981
3017
|
export declare const DEFAULT_OUTBOX_CLAIM_LEASE_MS: number;
|
|
2982
3018
|
|
|
@@ -3035,6 +3071,8 @@ export declare const DEFAULT_SOCKET_OVERRUN_AFTER_MS = 10000;
|
|
|
3035
3071
|
|
|
3036
3072
|
export declare const DEFAULT_SOCKET_OVERSIZED_EVENT_BYTES = 262144;
|
|
3037
3073
|
|
|
3074
|
+
export declare const DEFAULT_SOCKET_STALL_WARN_AFTER_MS = 5000;
|
|
3075
|
+
|
|
3038
3076
|
/**
|
|
3039
3077
|
* How old a row may be before a reader should stop trusting it as current.
|
|
3040
3078
|
*
|
|
@@ -3650,7 +3688,7 @@ export declare const enableGraphObservation: () => void;
|
|
|
3650
3688
|
* not: their session rows written here were unreadable through the store, and
|
|
3651
3689
|
* the error blamed the key.
|
|
3652
3690
|
*/
|
|
3653
|
-
export declare const encryptField: (plaintext: string) => string;
|
|
3691
|
+
export declare const encryptField: (plaintext: string, binding?: FieldBinding) => string;
|
|
3654
3692
|
|
|
3655
3693
|
/**
|
|
3656
3694
|
* The dispatch-spine entry point. A no-op for a descriptor with no policy; a
|
|
@@ -3721,7 +3759,11 @@ export declare const evaluateTouchedRules: (params: {
|
|
|
3721
3759
|
readonly subject: unknown;
|
|
3722
3760
|
}) => Promise<void>;
|
|
3723
3761
|
|
|
3724
|
-
|
|
3762
|
+
/** The outbox is generic in the payload: a descriptor subscription carries an
|
|
3763
|
+
* id-keyed row set (and deltas against it), a computed one carries whatever
|
|
3764
|
+
* its handler returned (snapshots only). Coalescing differs only in whether a
|
|
3765
|
+
* patch can be diffed — everything else is the same policy. */
|
|
3766
|
+
declare type Event_2<T> = SubscriptionEvent<T>;
|
|
3725
3767
|
|
|
3726
3768
|
/**
|
|
3727
3769
|
* How many deliveries one client may fall behind before the oldest are dropped.
|
|
@@ -4744,8 +4786,14 @@ export declare interface FluentStore extends Omit<MutationStore, 'update' | 'del
|
|
|
4744
4786
|
* Scoping is identical to `query()` (tenant + soft-delete apply), because it
|
|
4745
4787
|
* IS `query()` underneath — the probe just asks for one row more than it
|
|
4746
4788
|
* needs so "the first of several" cannot masquerade as "the one you meant".
|
|
4789
|
+
*
|
|
4790
|
+
* `onMissing` turns the refusal into YOUR typed error: it receives the same
|
|
4791
|
+
* `{ table, found }` `NoRowFound` carries and whatever it returns is thrown
|
|
4792
|
+
* instead — `ctx.store.one(q, () => new NotFoundError({ resource: 'user', id }))`.
|
|
4793
|
+
* A contract that already declares its not-found error keeps it, without a
|
|
4794
|
+
* `maybeOne` + `if (row === null)` hop at every call site.
|
|
4747
4795
|
*/
|
|
4748
|
-
one<R = Row_7>(query: QueryLike<R
|
|
4796
|
+
one<R = Row_7>(query: QueryLike<R>, onMissing?: OnMissingRow): Promise<R>;
|
|
4749
4797
|
/** Terminal: the first matching row or `null`, TYPED. Use when "any match" is
|
|
4750
4798
|
* genuinely what you mean. */
|
|
4751
4799
|
first<R = Row_7>(query: QueryLike<R>): Promise<R | null>;
|
|
@@ -5375,6 +5423,8 @@ export declare interface IssueInput {
|
|
|
5375
5423
|
readonly metadata?: Readonly<Record<string, unknown>> | null;
|
|
5376
5424
|
}
|
|
5377
5425
|
|
|
5426
|
+
export declare const isTransactionReadConflict: (err: unknown) => err is TransactionReadConflict;
|
|
5427
|
+
|
|
5378
5428
|
/** Is `address` one of the peers we are willing to take a forwarded chain from? */
|
|
5379
5429
|
export declare const isTrustedProxy: (address: string | undefined, config: TrustedProxyConfig) => boolean;
|
|
5380
5430
|
|
|
@@ -5629,12 +5679,17 @@ export declare const makeAdvisoryLockCoordinator: (store: DataStore, replicaId:
|
|
|
5629
5679
|
log?: SchedulerLogger) => Coordinator;
|
|
5630
5680
|
|
|
5631
5681
|
/**
|
|
5632
|
-
* Build an AES-256-GCM cipher.
|
|
5633
|
-
*
|
|
5634
|
-
*
|
|
5635
|
-
*
|
|
5636
|
-
*
|
|
5637
|
-
*
|
|
5682
|
+
* Build an AES-256-GCM cipher. Two envelopes, one key:
|
|
5683
|
+
*
|
|
5684
|
+
* `enc:v1:<ivB64>:<tagB64>:<ctB64>` unbound — no binding given
|
|
5685
|
+
* `enc:v2:<r|c>:<ivB64>:<tagB64>:<ctB64>` bound — the GCM tag also covers
|
|
5686
|
+
* `binding.row` (`r`) or
|
|
5687
|
+
* `binding.column` (`c`)
|
|
5688
|
+
*
|
|
5689
|
+
* A random 12-byte IV per call (the same plaintext encrypts differently each
|
|
5690
|
+
* time), plus the GCM auth tag for tamper detection. `decrypt` throws on a
|
|
5691
|
+
* tampered / wrong-key value AND on a bound value read at another address —
|
|
5692
|
+
* both surface as a read error, never silent corruption.
|
|
5638
5693
|
*/
|
|
5639
5694
|
export declare const makeAesCipher: (key: Buffer) => FieldCipher;
|
|
5640
5695
|
|
|
@@ -5983,7 +6038,7 @@ export declare const makeSubmitTokenExecutor: (deps: ConnectionBuiltinDeps) => (
|
|
|
5983
6038
|
readonly ok: boolean;
|
|
5984
6039
|
}>;
|
|
5985
6040
|
|
|
5986
|
-
export declare const makeSubscriptionOutbox: (options: SubscriptionBackpressureOptions) => SubscriptionOutbox
|
|
6041
|
+
export declare const makeSubscriptionOutbox: <T = ReadonlyArray<Row>>(options: SubscriptionBackpressureOptions) => SubscriptionOutbox<T>;
|
|
5987
6042
|
|
|
5988
6043
|
/**
|
|
5989
6044
|
* The factory the serve entrypoints inject into `makeMutationRunner`'s
|
|
@@ -6024,6 +6079,34 @@ export declare const makeWorkflowLayers: <Context>(workflows: ReadonlyArray<Disc
|
|
|
6024
6079
|
|
|
6025
6080
|
export declare const makeWorkflowRunHandle: (workflowName: string, executionId: string) => WorkflowRunHandle;
|
|
6026
6081
|
|
|
6082
|
+
/**
|
|
6083
|
+
* Build the shared WORKFLOW START runner — the third member of the family,
|
|
6084
|
+
* beside `makeMutationRunner` and `makeActionRunner`, for the unary rpc a
|
|
6085
|
+
* `*.workflow.tsx` becomes on the wire.
|
|
6086
|
+
*
|
|
6087
|
+
* It existed on neither boot path. Both bound the start handler straight to
|
|
6088
|
+
* the workflow facade, outside every plugin interceptor and with no guard
|
|
6089
|
+
* check — measured with an anonymous socket: a query declaring
|
|
6090
|
+
* `guards: [{ scope }]` answered `ScopeError`, the workflow beside it answered
|
|
6091
|
+
* a run handle. So the three things this runner does are the three things a
|
|
6092
|
+
* start never had:
|
|
6093
|
+
*
|
|
6094
|
+
* 1. `enforceGuards` — the workflow's `guards:` / `openAccess:` decision,
|
|
6095
|
+
* BEFORE the run row is written or the engine is asked for anything.
|
|
6096
|
+
* Under `defaultDeny` an undecided workflow is refused per request, the
|
|
6097
|
+
* defense-in-depth behind the boot gate exactly as for a mutation.
|
|
6098
|
+
* 2. the plugin `interceptWorkflow` chain — audit records the start, rate
|
|
6099
|
+
* limiting counts it, rbac publishes the caller's role scopes so (1) can
|
|
6100
|
+
* see them. Without the chain, a role-derived scope guard could never pass.
|
|
6101
|
+
* 3. a metric sample under `workflow.<name>`, so the rpc panel shows starts
|
|
6102
|
+
* beside mutations instead of a surface that does not exist there.
|
|
6103
|
+
*
|
|
6104
|
+
* `start` is injected rather than the facade: the two boot paths build their
|
|
6105
|
+
* caller-context facade differently, and this runner owns the composition,
|
|
6106
|
+
* not the engine.
|
|
6107
|
+
*/
|
|
6108
|
+
export declare const makeWorkflowStartRunner: (deps: WorkflowStartRunnerDeps) => (workflow: WorkflowStartLike, input: unknown, requestContext: ServeRequestContext, start: () => Promise<unknown>) => Promise<unknown>;
|
|
6109
|
+
|
|
6027
6110
|
/**
|
|
6028
6111
|
* Mark a wakeup as handled. The row is kept (not deleted) so a crash
|
|
6029
6112
|
* between firing and the producer re-registering the next occurrence is
|
|
@@ -6286,6 +6369,9 @@ export declare type MetricsMode = 'off' | 'console' | 'otlp' | 'memory';
|
|
|
6286
6369
|
*/
|
|
6287
6370
|
export declare type MirrorVersion = number;
|
|
6288
6371
|
|
|
6372
|
+
/** The error `.one()` throws: the factory's, or the framework's `NoRowFound`. */
|
|
6373
|
+
export declare const missingRowError: (info: NoRowFoundInfo, onMissing: OnMissingRow | undefined) => unknown;
|
|
6374
|
+
|
|
6289
6375
|
export declare interface MutationLifecycle {
|
|
6290
6376
|
readonly afterCommit: (work: () => Promise<unknown>) => void;
|
|
6291
6377
|
}
|
|
@@ -6325,6 +6411,13 @@ export declare interface MutationOutputCodec<Output> {
|
|
|
6325
6411
|
|
|
6326
6412
|
export declare interface MutationRunnerDeps {
|
|
6327
6413
|
readonly store: TransactionalStore;
|
|
6414
|
+
/**
|
|
6415
|
+
* How many times a mutation's transaction runs before a replayable failure
|
|
6416
|
+
* (contention, a transaction-read conflict) surfaces. Resolved by the CLI
|
|
6417
|
+
* from `app.config.ts` `mutations.replayAttempts` (env
|
|
6418
|
+
* `VOLTRO_MUTATION_REPLAY_ATTEMPTS` wins); absent → the default.
|
|
6419
|
+
*/
|
|
6420
|
+
readonly replayAttempts?: number;
|
|
6328
6421
|
/**
|
|
6329
6422
|
* `security.defaultDeny`, threaded to the dispatch spine: `true` refuses a
|
|
6330
6423
|
* descriptor with NO access decision per-request (typed `ScopeError`, the
|
|
@@ -6509,6 +6602,13 @@ declare const NoRowFound_base: Schema.TaggedErrorClass<NoRowFound, "NoRowFound",
|
|
|
6509
6602
|
found: typeof Schema.Number;
|
|
6510
6603
|
}>;
|
|
6511
6604
|
|
|
6605
|
+
/** What `.one()` hands an `onMissing` factory — the two facts `NoRowFound` carries. */
|
|
6606
|
+
export declare interface NoRowFoundInfo {
|
|
6607
|
+
readonly table: string;
|
|
6608
|
+
/** `0` — no row; `2` — at least two, the filter is not unique. */
|
|
6609
|
+
readonly found: number;
|
|
6610
|
+
}
|
|
6611
|
+
|
|
6512
6612
|
/** Note one read against the in-flight procedure. No scope → nothing happens. */
|
|
6513
6613
|
export declare const noteRead: (descriptor: QueryDescriptor) => void;
|
|
6514
6614
|
|
|
@@ -6621,6 +6721,14 @@ export declare interface OneShotQueryRunnerDeps<D> extends QueryProducerDeps<D>
|
|
|
6621
6721
|
readonly queryRows: (descriptor: D, context: ServeRequestContext) => Promise<ReadonlyArray<unknown>>;
|
|
6622
6722
|
}
|
|
6623
6723
|
|
|
6724
|
+
/**
|
|
6725
|
+
* Turn `.one()`'s refusal into the caller's own typed error. Whatever it
|
|
6726
|
+
* returns is THROWN — so a contract that declares `NotFoundError({ resource,
|
|
6727
|
+
* id })` keeps declaring it, and the call site is `one(q, () => new
|
|
6728
|
+
* NotFoundError(...))` instead of `maybeOne` + a null branch at every read.
|
|
6729
|
+
*/
|
|
6730
|
+
export declare type OnMissingRow = (info: NoRowFoundInfo) => unknown;
|
|
6731
|
+
|
|
6624
6732
|
/**
|
|
6625
6733
|
* Register teardown to run on SIGINT/SIGTERM, before the launches are drained
|
|
6626
6734
|
* and the process exits. Returns a de-register function.
|
|
@@ -6814,6 +6922,12 @@ export declare interface OutboxHandlerDefinition {
|
|
|
6814
6922
|
readonly maxAttempts?: number;
|
|
6815
6923
|
}
|
|
6816
6924
|
|
|
6925
|
+
/** What the pump hands events to — the `emit` of a `Stream.asyncScoped`. */
|
|
6926
|
+
export declare interface OutboxSink<T> {
|
|
6927
|
+
readonly single: (event: Event_2<T>) => Promise<unknown>;
|
|
6928
|
+
readonly end: () => unknown;
|
|
6929
|
+
}
|
|
6930
|
+
|
|
6817
6931
|
export declare type OutboxStatus = 'pending' | 'delivering' | 'delivered' | 'dead';
|
|
6818
6932
|
|
|
6819
6933
|
export declare const outboxTable: TableLike;
|
|
@@ -6924,6 +7038,13 @@ export declare interface PluginRefRule {
|
|
|
6924
7038
|
readonly targetTable: string;
|
|
6925
7039
|
readonly policy: PluginRefOrphanPolicy;
|
|
6926
7040
|
readonly onSoftDelete: boolean;
|
|
7041
|
+
/**
|
|
7042
|
+
* Fire on a HARD delete of the target. Default `true` — a `pluginRef` has no
|
|
7043
|
+
* foreign key, so the runtime is the only thing that can clean up. `false`
|
|
7044
|
+
* for a `reference(…, { onSoftDelete })` rule: its hard delete IS a foreign
|
|
7045
|
+
* key, and the database already did whatever `onDelete` says.
|
|
7046
|
+
*/
|
|
7047
|
+
readonly onHardDelete?: boolean;
|
|
6927
7048
|
}
|
|
6928
7049
|
|
|
6929
7050
|
/** The store surface the enforcement needs. */
|
|
@@ -7074,6 +7195,36 @@ export declare const publishEvent: <Name extends string, Key extends Schema.Sche
|
|
|
7074
7195
|
*/
|
|
7075
7196
|
export declare const publishServerTracerLayer: Layer.Layer<never, never, never>;
|
|
7076
7197
|
|
|
7198
|
+
export declare interface PumpOptions {
|
|
7199
|
+
/** Override the process-wide tunable (tests). */
|
|
7200
|
+
readonly stallWarnAfterMs?: number;
|
|
7201
|
+
readonly warn?: (message: string, fields: Record<string, unknown>) => void;
|
|
7202
|
+
}
|
|
7203
|
+
|
|
7204
|
+
/**
|
|
7205
|
+
* The pump between an outbox and its stream: hand events over ONE at a time,
|
|
7206
|
+
* awaiting each acceptance — that await is the backpressure signal the outbox
|
|
7207
|
+
* coalesces behind. `take()` resolves null once the outbox closes (scope
|
|
7208
|
+
* teardown, or the terminal overrun error has drained).
|
|
7209
|
+
*
|
|
7210
|
+
* ONE definition for every subscription binder (descriptor, adopted-on-resume,
|
|
7211
|
+
* computed). The three used to carry the same loop inline; a diagnostic added
|
|
7212
|
+
* to one of them would have been absent from the other two.
|
|
7213
|
+
*
|
|
7214
|
+
* **The stall diagnostic.** `@effect/rpc` delivers a stream as `Chunk`
|
|
7215
|
+
* messages and waits for the client's `Ack` of each before writing the next.
|
|
7216
|
+
* The typed client acknowledges by itself; a hand-rolled socket client that
|
|
7217
|
+
* only listens receives exactly one Chunk per subscription — the snapshot — and
|
|
7218
|
+
* every later delivery parks behind the missing Ack. From the outside that is
|
|
7219
|
+
* indistinguishable from "the server never produced an update", and it was
|
|
7220
|
+
* reported as exactly that: the producer, the matcher and the registry all
|
|
7221
|
+
* looked healthy because they were. The stream's buffer is ONE event deep, so
|
|
7222
|
+
* the second delivery a stalled consumer does not accept blocks HERE — and a
|
|
7223
|
+
* delivery the transport has not accepted within `stallWarnAfterMs` is said out
|
|
7224
|
+
* loud, with the cause named, and counted in `voltro_subscription_stalled_total`.
|
|
7225
|
+
*/
|
|
7226
|
+
export declare const pumpOutbox: <T>(outbox: SubscriptionOutbox<T>, sink: OutboxSink<T>, label: string, options?: PumpOptions) => Promise<void>;
|
|
7227
|
+
|
|
7077
7228
|
/**
|
|
7078
7229
|
* The two scopes, composed once, for every path that finalises a descriptor.
|
|
7079
7230
|
*
|
|
@@ -7346,7 +7497,8 @@ export declare interface ReactiveConfigInput {
|
|
|
7346
7497
|
* threshold is closed with a typed `SubscriptionOverrun` (it re-subscribes
|
|
7347
7498
|
* for a fresh snapshot). Resolved by the CLI's `reactiveTunables.ts`; env
|
|
7348
7499
|
* overrides win: `VOLTRO_REACTIVE_MAX_BUFFERED_BYTES` /
|
|
7349
|
-
* `VOLTRO_REACTIVE_OVERRUN_AFTER_MS` / `VOLTRO_REACTIVE_OVERSIZED_EVENT_BYTES
|
|
7500
|
+
* `VOLTRO_REACTIVE_OVERRUN_AFTER_MS` / `VOLTRO_REACTIVE_OVERSIZED_EVENT_BYTES` /
|
|
7501
|
+
* `VOLTRO_REACTIVE_STALL_WARN_AFTER_MS`.
|
|
7350
7502
|
*/
|
|
7351
7503
|
readonly socket?: {
|
|
7352
7504
|
/** Estimated pending bytes per subscription above which a persistently
|
|
@@ -7357,6 +7509,11 @@ export declare interface ReactiveConfigInput {
|
|
|
7357
7509
|
readonly overrunAfterMs?: number;
|
|
7358
7510
|
/** Per-event WARN threshold (telemetry, NOT a cap). Default 256 KiB. */
|
|
7359
7511
|
readonly oversizedEventBytes?: number;
|
|
7512
|
+
/** How long a delivery may sit unaccepted by the transport before the
|
|
7513
|
+
* server says so — a WARN naming the subscription and the missing
|
|
7514
|
+
* `@effect/rpc` `Ack`, plus `voltro_subscription_stalled_total`.
|
|
7515
|
+
* Default 5_000 ms. */
|
|
7516
|
+
readonly stallWarnAfterMs?: number;
|
|
7360
7517
|
};
|
|
7361
7518
|
}
|
|
7362
7519
|
|
|
@@ -7377,6 +7534,9 @@ export declare interface ReactiveSocketTunables {
|
|
|
7377
7534
|
readonly maxBufferedBytes: number;
|
|
7378
7535
|
readonly overrunAfterMs: number;
|
|
7379
7536
|
readonly oversizedEventBytes: number;
|
|
7537
|
+
/** How long a delivery may sit unaccepted by the transport before the pump
|
|
7538
|
+
* says so (WARN + `voltro_subscription_stalled_total`). See `pumpOutbox`. */
|
|
7539
|
+
readonly stallWarnAfterMs: number;
|
|
7380
7540
|
}
|
|
7381
7541
|
|
|
7382
7542
|
/** The resolved tunables, or the defaults when no boot path has set any
|
|
@@ -7574,6 +7734,10 @@ export declare const recordSample: (s: RecordedSample) => void;
|
|
|
7574
7734
|
*/
|
|
7575
7735
|
export declare const recordScheduleRun: (r: ScheduleRunRecord) => void;
|
|
7576
7736
|
|
|
7737
|
+
/** A delivery the pump handed to the stream that the transport did not accept
|
|
7738
|
+
* within the stall threshold — the consumer is not acknowledging chunks. */
|
|
7739
|
+
export declare const recordStalled: (label: string) => void;
|
|
7740
|
+
|
|
7577
7741
|
/** Move the live-subscriptions gauge for `label`'s tag by `delta` (+1 open, -1 close). */
|
|
7578
7742
|
export declare const recordSubscriptionActive: (label: string, delta: number) => void;
|
|
7579
7743
|
|
|
@@ -8833,6 +8997,9 @@ export declare interface RpcServerOptions<Rpcs extends Rpc.Any> {
|
|
|
8833
8997
|
/** Public raw-HTTP routes contributed by plugins (e.g. storage
|
|
8834
8998
|
* byte-serving). Mounted on the same listener as rpc + inspect. */
|
|
8835
8999
|
readonly httpRoutes?: ReadonlyArray< PluginHttpRoute>;
|
|
9000
|
+
/** Called after every plugin HTTP route answers — the composed plugins'
|
|
9001
|
+
* `onHttpRoute` hooks. Fire-and-forget; a throw never reaches the client. */
|
|
9002
|
+
readonly onHttpRoute?: HttpRouteObserver;
|
|
8836
9003
|
/** The app's DataStore, for `PluginHttpRouteRequest.store`. A getter rather
|
|
8837
9004
|
* than a value: routes mount before the store is built, and the two boot
|
|
8838
9005
|
* paths build it on opposite sides of that point. */
|
|
@@ -9070,6 +9237,10 @@ export declare const runWakeLoop: (deps: WakeOrchestratorDeps, intervalMs?: numb
|
|
|
9070
9237
|
*/
|
|
9071
9238
|
export declare const runWithDeadlockRetry: <T>(work: () => Promise<T>, options?: {
|
|
9072
9239
|
readonly delay?: (attempt: number) => Promise<void>;
|
|
9240
|
+
/** How many times the transaction runs in total before the failure
|
|
9241
|
+
* surfaces. Default {@link DEFAULT_MUTATION_REPLAY_ATTEMPTS}; a hot row
|
|
9242
|
+
* with many simultaneous writers may need more — or a row lock. */
|
|
9243
|
+
readonly attempts?: number;
|
|
9073
9244
|
}) => Promise<T>;
|
|
9074
9245
|
|
|
9075
9246
|
/**
|
|
@@ -9671,6 +9842,8 @@ export declare class SelectBuilder {
|
|
|
9671
9842
|
where(...args: ReadonlyArray<unknown>): SelectBuilder;
|
|
9672
9843
|
orderBy(column: string, direction?: 'asc' | 'desc'): SelectBuilder;
|
|
9673
9844
|
limit(n: number): SelectBuilder;
|
|
9845
|
+
/** Lock the matched rows for the rest of the transaction — see `Query.forUpdate`. */
|
|
9846
|
+
forUpdate(): SelectBuilder;
|
|
9674
9847
|
offset(n: number): SelectBuilder;
|
|
9675
9848
|
select(...columns: ReadonlyArray<string>): SelectBuilder;
|
|
9676
9849
|
using(indexName: string): SelectBuilder;
|
|
@@ -9698,8 +9871,10 @@ export declare class SelectBuilder {
|
|
|
9698
9871
|
* the bug would surface far away from its cause. One extra row on the
|
|
9699
9872
|
* wire buys a loud failure at the point the assumption breaks. Use
|
|
9700
9873
|
* `.first()` / `.maybeOne()` when you genuinely want "any match".
|
|
9874
|
+
*
|
|
9875
|
+
* `onMissing` swaps the thrown error for yours — see `OnMissingRow`.
|
|
9701
9876
|
*/
|
|
9702
|
-
one(): Promise<Row>;
|
|
9877
|
+
one(onMissing?: OnMissingRow): Promise<Row>;
|
|
9703
9878
|
/** Terminal: COUNT(*) of matching rows (real aggregate, not a fetch). */
|
|
9704
9879
|
count(): Promise<number>;
|
|
9705
9880
|
/** Terminal: does any row match? Uses a `LIMIT 1` probe. */
|
|
@@ -9775,7 +9950,7 @@ export declare const serverOnlyLeaks: (query: AuditableQuery, serverOnlyByTable:
|
|
|
9775
9950
|
/** A plugin interceptor — wraps the base run Effect (Effect-native chain). */
|
|
9776
9951
|
export declare type ServeRpcInterceptor = (base: Effect.Effect<unknown, unknown, never>, meta: {
|
|
9777
9952
|
readonly tag: string;
|
|
9778
|
-
readonly kind: 'mutation' | 'action' | 'query';
|
|
9953
|
+
readonly kind: 'mutation' | 'action' | 'query' | 'workflow';
|
|
9779
9954
|
readonly input: unknown;
|
|
9780
9955
|
readonly subject: unknown;
|
|
9781
9956
|
readonly traceId: string;
|
|
@@ -10328,13 +10503,13 @@ export declare interface SubscriptionDeliveryRecord {
|
|
|
10328
10503
|
readonly rowCount: number;
|
|
10329
10504
|
}
|
|
10330
10505
|
|
|
10331
|
-
export declare interface SubscriptionOutbox {
|
|
10506
|
+
export declare interface SubscriptionOutbox<T = ReadonlyArray<Row>> {
|
|
10332
10507
|
/** SYNC push from the dispatcher's emit callback. */
|
|
10333
|
-
readonly push: (event: Event_2) => void;
|
|
10508
|
+
readonly push: (event: Event_2<T>) => void;
|
|
10334
10509
|
/** Pump side: resolves with the next event to hand into the stream —
|
|
10335
10510
|
* coalesced when more than one push landed since the last take — or null
|
|
10336
10511
|
* once the outbox is closed and drained. */
|
|
10337
|
-
readonly take: () => Promise<Event_2 | null>;
|
|
10512
|
+
readonly take: () => Promise<Event_2<T> | null>;
|
|
10338
10513
|
/** True once the overrun policy fired (the error event has been queued;
|
|
10339
10514
|
* the stream ends after it drains). */
|
|
10340
10515
|
readonly overrun: () => boolean;
|
|
@@ -10436,6 +10611,10 @@ export declare interface SubscriptionSocketMetricsSnapshot {
|
|
|
10436
10611
|
readonly total: number;
|
|
10437
10612
|
readonly byLabel: Readonly<Record<string, number>>;
|
|
10438
10613
|
};
|
|
10614
|
+
readonly stalledTotal: {
|
|
10615
|
+
readonly total: number;
|
|
10616
|
+
readonly byLabel: Readonly<Record<string, number>>;
|
|
10617
|
+
};
|
|
10439
10618
|
}
|
|
10440
10619
|
|
|
10441
10620
|
export declare const subscriptionSocketMetricsSnapshot: () => SubscriptionSocketMetricsSnapshot;
|
|
@@ -10722,11 +10901,19 @@ export declare interface TracingOptions {
|
|
|
10722
10901
|
readonly sampler?: Sampler;
|
|
10723
10902
|
}
|
|
10724
10903
|
|
|
10904
|
+
export declare const TRANSACTION_READ_CONFLICT_NAME = "VoltroTransactionReadConflict";
|
|
10905
|
+
|
|
10725
10906
|
/** The store surface the runner needs — just the transactional wrap. */
|
|
10726
10907
|
export declare interface TransactionalStore {
|
|
10727
10908
|
transactional<T>(work: (tx: unknown) => Promise<T>): Promise<T>;
|
|
10728
10909
|
}
|
|
10729
10910
|
|
|
10911
|
+
export declare class TransactionReadConflict extends Error {
|
|
10912
|
+
readonly conflict: VersionConflict;
|
|
10913
|
+
readonly name = "VoltroTransactionReadConflict";
|
|
10914
|
+
constructor(conflict: VersionConflict);
|
|
10915
|
+
}
|
|
10916
|
+
|
|
10730
10917
|
/**
|
|
10731
10918
|
* Transport-level security policy for the api listener.
|
|
10732
10919
|
*
|
|
@@ -10872,6 +11059,10 @@ export declare type TupleSource = (req: {
|
|
|
10872
11059
|
readonly load: DataLoader | undefined;
|
|
10873
11060
|
}) => Promise<ReadonlyArray<RelationTuple>> | ReadonlyArray<RelationTuple>;
|
|
10874
11061
|
|
|
11062
|
+
/** The mutation runner's key for opening the read-version map on a transaction
|
|
11063
|
+
* view it obtained from the dialect store directly. */
|
|
11064
|
+
export declare const TX_READ_VERSIONS_KEY: unique symbol;
|
|
11065
|
+
|
|
10875
11066
|
/**
|
|
10876
11067
|
* Drop everything this connection accumulated. Called by the WS-close finalizer
|
|
10877
11068
|
* and by explicit sign-out flows. Idempotent.
|
|
@@ -11786,6 +11977,13 @@ export declare class WorkflowSingletonHeldError extends Error {
|
|
|
11786
11977
|
constructor(workflowName: string, executionId: string);
|
|
11787
11978
|
}
|
|
11788
11979
|
|
|
11980
|
+
/** The slice of a `workflow()` definition the start runner reads — its name
|
|
11981
|
+
* and its resolved access decision (`workflowAccessDescriptor` produces it). */
|
|
11982
|
+
export declare interface WorkflowStartLike {
|
|
11983
|
+
readonly name: string;
|
|
11984
|
+
readonly guards?: ReadonlyArray<AnyCheckSpec> | undefined;
|
|
11985
|
+
}
|
|
11986
|
+
|
|
11789
11987
|
export declare interface WorkflowStartOptions {
|
|
11790
11988
|
readonly wait?: boolean;
|
|
11791
11989
|
/**
|
|
@@ -11816,18 +12014,13 @@ export declare interface WorkflowStartOptions {
|
|
|
11816
12014
|
/* Excluded from this release type: admitted */
|
|
11817
12015
|
}
|
|
11818
12016
|
|
|
11819
|
-
export declare
|
|
11820
|
-
|
|
11821
|
-
|
|
11822
|
-
|
|
11823
|
-
|
|
11824
|
-
|
|
11825
|
-
|
|
11826
|
-
dueAt: Schema.NullOr<typeof Schema.Number>;
|
|
11827
|
-
retryAfterMs: Schema.NullOr<typeof Schema.Number>;
|
|
11828
|
-
intentId: Schema.NullOr<typeof Schema.String>;
|
|
11829
|
-
}>>;
|
|
11830
|
-
}>, Schema.Schema.All, never>;
|
|
12017
|
+
export declare interface WorkflowStartRunnerDeps {
|
|
12018
|
+
/** Composed plugin workflow-interceptor (`interceptWorkflow`). */
|
|
12019
|
+
readonly interceptor?: ServeRpcInterceptor;
|
|
12020
|
+
readonly recordMetric?: MutationRunnerDeps['recordMetric'];
|
|
12021
|
+
/** See {@link MutationRunnerDeps.defaultDeny} — same flag, same refusal. */
|
|
12022
|
+
readonly defaultDeny?: boolean;
|
|
12023
|
+
}
|
|
11831
12024
|
|
|
11832
12025
|
export declare interface WorkflowUpdateOptions {
|
|
11833
12026
|
readonly timeoutMs?: number;
|