@voltro/runtime 0.66.1 → 0.68.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1751,6 +1751,7 @@ export declare const bindSubscriptionUntyped: (descriptor: QueryDescriptor, disp
1751
1751
  }, resume?: {
1752
1752
  readonly input: unknown;
1753
1753
  readonly fromRevision?: number;
1754
+ readonly reconcile?: string;
1754
1755
  }) => Stream.Stream<SubscriptionEvent<ReadonlyArray<Row>>, never, never>;
1755
1756
 
1756
1757
  export declare interface BrandedScheduleDefinition extends ScheduleDefinition {
@@ -3431,7 +3432,7 @@ export declare class Dispatcher {
3431
3432
  * nothing to resolve; it is not the caller's choice. Omitting it while a
3432
3433
  * filter IS registered throws below, because the read would then ignore the
3433
3434
  * filter entirely. Build it with `makeDefaultRefilter(subject)`. */
3434
- refilter?: () => Promise<RowFilterScope>): Promise<() => void>;
3435
+ refilter?: () => Promise<RowFilterScope>, readFromPrimary?: boolean): Promise<() => void>;
3435
3436
  /**
3436
3437
  * Tear a subscription down because it can no longer be served CORRECTLY
3437
3438
  * mid-stream — authorization was withdrawn, or row visibility became
@@ -4757,6 +4758,12 @@ export declare interface FleetMergeResult<T> {
4757
4758
  *
4758
4759
  * Empty when no membership is wired: with no roster there is no evidence of
4759
4760
  * departure, and assuming it would empty a single-process answer.
4761
+ *
4762
+ * A row is departed only when it is BOTH unrostered AND older than the
4763
+ * freshness window. Roster-absence alone is not evidence — a membership view
4764
+ * is per-process, so replicas sharing a database but no bus each hold a roster
4765
+ * of one, and the earlier rule had two live replicas calling each other gone
4766
+ * while reporting an age of under two seconds.
4760
4767
  */
4761
4768
  readonly departed: ReadonlyArray<{
4762
4769
  readonly replicaId: string;
@@ -6813,6 +6820,43 @@ export declare interface OrchestratorTickDeps {
6813
6820
  readonly log?: WakeOrchestratorLogger;
6814
6821
  }
6815
6822
 
6823
+ /**
6824
+ * Referrer policies that make a browser send `Origin: null` on a SAME-ORIGIN
6825
+ * state-changing request — which `classifyRequestOrigin` refuses as opaque.
6826
+ *
6827
+ * This is not a lint about tidiness. `no-referrer` was the default here, and
6828
+ * under it every no-JS `<form method="post">` in every Voltro app answered 403,
6829
+ * on both boot paths, for every user. Two security defaults, each defensible
6830
+ * alone, cancelling each other: we asked the browser to withhold provenance and
6831
+ * then refused the request for lacking it.
6832
+ *
6833
+ * Measured in a real headless chromium against a bare `node:http` server —
6834
+ * ONE header changed between the rows, nothing else:
6835
+ *
6836
+ * Referrer-Policy: (none) → Origin: http://127.0.0.1:45412
6837
+ * Referrer-Policy: no-referrer → Origin: null ← and no Referer
6838
+ * Referrer-Policy: strict-origin-when-cross-origin → Origin: http://127.0.0.1:45412
6839
+ * Referrer-Policy: same-origin → Origin: http://127.0.0.1:45412
6840
+ *
6841
+ * It is the Fetch spec's behaviour, not a chromium quirk: when appending the
6842
+ * `Origin` header, a request whose referrer policy is `no-referrer` serialises
6843
+ * its origin as `null`. `origin-when-cross-origin`'s sibling `unsafe-url` does
6844
+ * not, so the set below is exactly the two that null it unconditionally.
6845
+ *
6846
+ * `same-origin` is NOT in the set — it preserves the Origin for same-origin
6847
+ * requests — but it is also not the default, because it nulls the Origin for a
6848
+ * legitimate CROSS-origin post to an allowlisted api, which is precisely the
6849
+ * split-deployment `VOLTRO_ALLOWED_ORIGINS` exists to permit.
6850
+ * `strict-origin-when-cross-origin` nulls it only on an https→http downgrade,
6851
+ * which is the one case where withholding it is the point. It is also what every
6852
+ * current browser does with no header at all, so it surprises nobody.
6853
+ *
6854
+ * The second casualty of `no-referrer` is in the same request: the Referer is
6855
+ * gone too, and `/form/*` reads it to decide where the PRG redirect and the 422
6856
+ * re-render go back to.
6857
+ */
6858
+ export declare const ORIGIN_NULLING_REFERRER_POLICIES: ReadonlySet<string>;
6859
+
6816
6860
  export declare type OriginDecision = {
6817
6861
  readonly allowed: true;
6818
6862
  readonly reason: 'guard-off' | 'same-origin' | 'loopback' | 'allowlisted' | 'no-browser-origin';
@@ -6944,7 +6988,7 @@ export declare interface OutboxFacade {
6944
6988
  export declare interface OutboxFacadeDeps {
6945
6989
  /** The REQUEST's store. Inside a mutation this is the transactional view —
6946
6990
  * which is what makes the enqueue atomic with the domain write. */
6947
- readonly store: Pick<DataStore, 'insert' | 'query' | 'update'>;
6991
+ readonly store: Pick<DataStore, 'insert' | 'query' | 'updateMany'>;
6948
6992
  readonly subject: Subject;
6949
6993
  readonly traceId: string | null;
6950
6994
  /** Nudge the drain worker once the transaction commits. Optional: without
@@ -7107,6 +7151,15 @@ export declare type PluginScheduleCoordinated = (name: string, intervalMs: numbe
7107
7151
 
7108
7152
  export declare const powerOfTwoSelector: (options?: P2COptions) => ReplicaSelector;
7109
7153
 
7154
+ /**
7155
+ * Whether a `Referrer-Policy` value leaves the `Origin` header intact on a
7156
+ * same-origin state-changing request.
7157
+ *
7158
+ * Reads the LAST supported token, which is what a browser honours: the header
7159
+ * is a fallback list, and every token after a supported one still overrides it.
7160
+ */
7161
+ export declare const preservesSameOriginHeader: (value: string | false) => boolean;
7162
+
7110
7163
  export declare interface PreviewDiff {
7111
7164
  readonly rows: ReadonlyArray<RowDiff>;
7112
7165
  readonly summary: {
@@ -7566,8 +7619,9 @@ export declare interface ReactiveConfigInput {
7566
7619
  }
7567
7620
 
7568
7621
  export declare interface ReactiveEnv {
7569
- readonly VOLTRO_REACTIVE_DELIVERY_CONCURRENCY?: string;
7570
- readonly VOLTRO_RAW_READ_TRACKING_LIMIT?: string;
7622
+ readonly [key: string]: string | undefined;
7623
+ readonly VOLTRO_REACTIVE_DELIVERY_CONCURRENCY?: string | undefined;
7624
+ readonly VOLTRO_RAW_READ_TRACKING_LIMIT?: string | undefined;
7571
7625
  }
7572
7626
 
7573
7627
  /** A reactive query returns a builder descriptor instead of a value; the store
@@ -7618,7 +7672,7 @@ export declare interface ReadClassification {
7618
7672
  * pathology the backoff exists to remove.
7619
7673
  */
7620
7674
  export declare const readPollCeilingMs: (env?: {
7621
- readonly VOLTRO_POLL_CEILING_MS?: string;
7675
+ readonly [key: string]: string | undefined;
7622
7676
  }) => number;
7623
7677
 
7624
7678
  /** Is anything listening? Call sites skip their work when nothing is. */
@@ -9040,6 +9094,20 @@ export declare interface RpcServerOptions<Rpcs extends Rpc.Any> {
9040
9094
  * runtime capability so clients replay only when the deployed server proves
9041
9095
  * the same key will be deduplicated. */
9042
9096
  readonly mutationReplay?: boolean;
9097
+ /**
9098
+ * Publish per-rpc-tag SCHEMA SHAPE digests alongside the capabilities, so a
9099
+ * connecting client can tell whether the copy of the api client it loaded is
9100
+ * the one this server binds.
9101
+ *
9102
+ * Dev only, and set by `voltro dev` alone. The staleness it detects is a
9103
+ * pre-bundled browser chunk that Vite did not re-optimize; `voltro serve`
9104
+ * ships a built bundle where that cannot arise, and there a rolling deploy
9105
+ * would make a transient mismatch NORMAL — reporting it would be noise on
9106
+ * exactly the path where noise is expensive. So this is a deliberate
9107
+ * dev/serve asymmetry rather than an oversight, which is the distinction the
9108
+ * boot-path parity rule asks for.
9109
+ */
9110
+ readonly publishSurfaceDigest?: boolean;
9043
9111
  /** Non-sensitive fleet identity written on the rpc WebSocket open/close
9044
9112
  * records. Defaults to the process identity resolver (POD_NAME/HOSTNAME).
9045
9113
  * Embedders may state it explicitly when they own process identity. */
@@ -9356,6 +9424,11 @@ export declare const runWithRequestLoader: <T>(loader: DataLoader, fn: () => T)
9356
9424
  */
9357
9425
  export declare const runWithRoutingContext: <T>(ctx: RoutingContext, work: () => T) => T;
9358
9426
 
9427
+ /** Start EXECUTION inside the routing scope, not merely Effect construction.
9428
+ * Capture the caller's runtime so services, tracing and logging survive; the
9429
+ * async canceller interrupts the child when the requesting fiber is stopped. */
9430
+ export declare const runWithRoutingContextEffect: <A, E, R>(ctx: RoutingContext, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
9431
+
9359
9432
  /** Run `fn` with the given trace context active for the duration of its
9360
9433
  * (sync + awaited-async) execution. */
9361
9434
  export declare const runWithTraceContext: <T>(ctx: LogTraceContext, fn: () => T) => T;