@klum-db/lobby 0.2.0-pre.31 → 0.2.0-pre.33
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/bin/klum.d.cts +1 -1
- package/dist/bin/klum.d.ts +1 -1
- package/dist/index.cjs +206 -50
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +178 -22
- package/dist/index.js.map +1 -1
- package/dist/{vault-group-DqEyXbN1.d.cts → vault-group-SfkQJ3CM.d.cts} +87 -7
- package/dist/{vault-group-DqEyXbN1.d.ts → vault-group-SfkQJ3CM.d.ts} +87 -7
- package/package.json +11 -11
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Vault as Vault$1, IndexDef, Operator, LiveQuery, LiveAggregation, AggregateSpec, AggregateResult, Collection, Noydb, Query, JoinStrategy, ChangeEvent } from '@noy-db/hub/kernel';
|
|
1
|
+
import { Vault as Vault$1, VaultMeta, IndexDef, Operator, LiveQuery, LiveAggregation, AggregateSpec, AggregateResult, RetrieveHit, Collection, Noydb, Query, JoinStrategy, ChangeEvent } from '@noy-db/hub/kernel';
|
|
2
2
|
import { Vault } from '@noy-db/hub';
|
|
3
3
|
import { DecryptedRecord } from '@noy-db/hub/bundle';
|
|
4
4
|
|
|
@@ -154,6 +154,17 @@ declare function mergeCompartment(receiver: Vault, compartmentBytes: Uint8Array,
|
|
|
154
154
|
* docs/superpowers/specs/2026-06-07-mvf-vaultgroup-routing-mvp-design.md.
|
|
155
155
|
*/
|
|
156
156
|
|
|
157
|
+
/** A federation group's own descriptive metadata (reuses the noy-db VaultMeta shape). */
|
|
158
|
+
type GroupMeta = VaultMeta;
|
|
159
|
+
/** Federation-level metadata: the group's own meta + each member vault's vaultMeta. */
|
|
160
|
+
interface FederationMeta {
|
|
161
|
+
readonly meta: GroupMeta | undefined;
|
|
162
|
+
readonly vaults: ReadonlyArray<{
|
|
163
|
+
readonly vaultId: string;
|
|
164
|
+
readonly partitionKey: string;
|
|
165
|
+
readonly meta: VaultMeta | undefined;
|
|
166
|
+
}>;
|
|
167
|
+
}
|
|
157
168
|
/**
|
|
158
169
|
* A schema blueprint for a class of shard vaults. `configure` is
|
|
159
170
|
* re-applied to every shard handle so all shards are configured
|
|
@@ -210,6 +221,8 @@ interface VaultGroupOptions<T> {
|
|
|
210
221
|
* Zero cost for shards never opened. Default `false` (use `rolloutSchema`).
|
|
211
222
|
*/
|
|
212
223
|
readonly cutoverOnOpen?: boolean;
|
|
224
|
+
/** Descriptive group-level metadata (label/description/icon) for UIs. Descriptive-only. */
|
|
225
|
+
readonly meta?: GroupMeta;
|
|
213
226
|
}
|
|
214
227
|
/** Result of `VaultGroup.rolloutSchema` (#271 active batch runner). */
|
|
215
228
|
interface SchemaRolloutResult {
|
|
@@ -241,6 +254,32 @@ interface FanoutResult<R> {
|
|
|
241
254
|
readonly results: R[];
|
|
242
255
|
readonly skippedVaults: SkippedVault[];
|
|
243
256
|
}
|
|
257
|
+
/** Options for cross-vault federated retrieval (#26). Extends the fan-out base. */
|
|
258
|
+
interface FederatedRetrieveOptions extends FanoutQueryOptions {
|
|
259
|
+
readonly mode?: 'lexical' | 'semantic' | 'hybrid';
|
|
260
|
+
readonly limit?: number;
|
|
261
|
+
readonly minScore?: number;
|
|
262
|
+
readonly fields?: readonly string[];
|
|
263
|
+
readonly match?: 'any' | 'all';
|
|
264
|
+
readonly prefix?: boolean;
|
|
265
|
+
readonly snippetWindow?: number;
|
|
266
|
+
readonly includeRecord?: boolean;
|
|
267
|
+
/** Payload filter applied per-vault (retrieve ∩ where), rebuilt into each shard's `within`. */
|
|
268
|
+
readonly where?: ReadonlyArray<readonly [field: string, op: Operator, value: unknown]>;
|
|
269
|
+
/** RRF constant; default 60. */
|
|
270
|
+
readonly rrfK?: number;
|
|
271
|
+
/** Re-throw a per-shard retrieve() failure instead of skipping it. */
|
|
272
|
+
readonly failFast?: boolean;
|
|
273
|
+
}
|
|
274
|
+
/** A fused hit carrying the originating shard (provenance). */
|
|
275
|
+
interface FederatedRetrieveHit<R> extends RetrieveHit<R> {
|
|
276
|
+
readonly vault: string;
|
|
277
|
+
}
|
|
278
|
+
/** Result of `ShardedCollection.retrieve()`. */
|
|
279
|
+
interface FederatedRetrieveResult<R> {
|
|
280
|
+
readonly hits: FederatedRetrieveHit<R>[];
|
|
281
|
+
readonly skippedVaults: SkippedVault[];
|
|
282
|
+
}
|
|
244
283
|
/** A single captured where-clause, replayed inside each shard. */
|
|
245
284
|
interface WhereClause {
|
|
246
285
|
readonly field: string;
|
|
@@ -278,6 +317,13 @@ interface CrossVaultDerivationContext {
|
|
|
278
317
|
/** The shard's schema/template version, from its registry row. */
|
|
279
318
|
readonly schemaVersion: number;
|
|
280
319
|
}
|
|
320
|
+
/** Tuning for auto-push-on-write (#13). */
|
|
321
|
+
interface InsightAutoPushConfig {
|
|
322
|
+
/** Reset-debounce window (ms): batch a multi-tick write burst into one re-derive. Omit = microtask coalescing. */
|
|
323
|
+
readonly debounceMs?: number;
|
|
324
|
+
/** Skip auto-pushing a shard whose registry `schemaVersion` is below this. */
|
|
325
|
+
readonly minVersion?: number;
|
|
326
|
+
}
|
|
281
327
|
/**
|
|
282
328
|
* A push-model cross-vault derivation (#271, Insight Vault — Layer 4).
|
|
283
329
|
*
|
|
@@ -305,8 +351,9 @@ interface CrossVaultDerivationSpec<R = Record<string, unknown>, S = Record<strin
|
|
|
305
351
|
* `source` collection, recompute and push that shard's summary
|
|
306
352
|
* automatically (coalesced per microtask). Default off — without this the
|
|
307
353
|
* derivation is explicit-refresh-only (drive it with `refreshInsights()`).
|
|
354
|
+
* Pass an object to enable debounce / minVersion tuning (#13).
|
|
308
355
|
*/
|
|
309
|
-
readonly autoPush?: boolean;
|
|
356
|
+
readonly autoPush?: boolean | InsightAutoPushConfig;
|
|
310
357
|
}
|
|
311
358
|
/** The result of `refreshInsights()`. */
|
|
312
359
|
interface RefreshInsightsResult {
|
|
@@ -590,13 +637,15 @@ declare class VaultGroup<T> {
|
|
|
590
637
|
/** @internal */ readonly sharding: ShardingConfig<T>;
|
|
591
638
|
/** @internal */ readonly template: VaultTemplate;
|
|
592
639
|
/** @internal — lazy cutover-on-open (#271). */ readonly cutoverOnOpen: boolean;
|
|
640
|
+
/** @internal — group-level descriptive metadata (#27). */ readonly meta?: GroupMeta | undefined;
|
|
593
641
|
constructor(
|
|
594
642
|
/** @internal */ db: Noydb,
|
|
595
643
|
/** @internal */ name: string,
|
|
596
644
|
/** @internal */ registry: Collection<VaultRegistryRow>,
|
|
597
645
|
/** @internal */ sharding: ShardingConfig<T>,
|
|
598
646
|
/** @internal */ template: VaultTemplate,
|
|
599
|
-
/** @internal — lazy cutover-on-open (#271). */ cutoverOnOpen?: boolean
|
|
647
|
+
/** @internal — lazy cutover-on-open (#271). */ cutoverOnOpen?: boolean,
|
|
648
|
+
/** @internal — group-level descriptive metadata (#27). */ meta?: GroupMeta | undefined);
|
|
600
649
|
/** @internal — set when the group is managed (no explicit registry). */
|
|
601
650
|
private stateVault;
|
|
602
651
|
/** @internal */
|
|
@@ -619,6 +668,14 @@ declare class VaultGroup<T> {
|
|
|
619
668
|
* `liveBinding().isRelevant` already applies to the reactive path.
|
|
620
669
|
*/
|
|
621
670
|
allRows(): Promise<VaultRegistryRow[]>;
|
|
671
|
+
/**
|
|
672
|
+
* Federation-level descriptive metadata (#27): this group's `meta` plus each
|
|
673
|
+
* member vault's `vaultMeta` (read via `getMeta()`). Best-effort per shard — a
|
|
674
|
+
* shard that fails to open yields `meta: undefined` for that entry, never
|
|
675
|
+
* throwing. Member meta is transient per-open (noy-db sets it at `openVault`,
|
|
676
|
+
* does not persist it); this surfaces whatever each vault was opened with.
|
|
677
|
+
*/
|
|
678
|
+
federationMeta(): Promise<FederationMeta>;
|
|
622
679
|
/**
|
|
623
680
|
* Open an existing shard and apply the template. When `cutoverOnOpen` is set
|
|
624
681
|
* (#271) and the shard's registry version is behind the template, its cutover
|
|
@@ -757,6 +814,15 @@ declare class ShardedCollection<T, R = T> {
|
|
|
757
814
|
put(id: string, record: T): Promise<void>;
|
|
758
815
|
/** Begin a cross-shard fan-out query. */
|
|
759
816
|
query(): ShardedQuery<T, R>;
|
|
817
|
+
/**
|
|
818
|
+
* Cross-vault federated retrieval (#26): scatter-gather across all eligible
|
|
819
|
+
* shards — each shard runs its own trusted-tier `retrieve()`, then results are
|
|
820
|
+
* RRF-fused by rank only (no cross-vault statistics cross the DEK boundary).
|
|
821
|
+
* Every hit carries its originating `vault`. An unreachable, schema-drifted, or
|
|
822
|
+
* un-indexed shard is skipped (`skippedVaults`); pass `failFast` to re-throw
|
|
823
|
+
* the first per-shard error instead.
|
|
824
|
+
*/
|
|
825
|
+
retrieve(query: string, opts?: FederatedRetrieveOptions): Promise<FederatedRetrieveResult<R>>;
|
|
760
826
|
}
|
|
761
827
|
declare class ShardedQuery<T, R = T> {
|
|
762
828
|
private readonly group;
|
|
@@ -789,10 +855,24 @@ declare class ShardedQuery<T, R = T> {
|
|
|
789
855
|
toArray(options?: FanoutQueryOptions): Promise<FanoutResult<R>>;
|
|
790
856
|
/** @internal — build the change-subscription + relevance binding for this query's group+collection. */
|
|
791
857
|
liveBinding(): LiveBinding;
|
|
792
|
-
/**
|
|
793
|
-
|
|
794
|
-
|
|
858
|
+
/**
|
|
859
|
+
* Returns a reactive cross-shard live query — a facade over CrossVaultLive.
|
|
860
|
+
*
|
|
861
|
+
* Joined queries (crossShardJoin / broadcastJoin) are supported (#14): the live
|
|
862
|
+
* value reflects the fully-joined rows. **v1 limitation:** recomputes only on
|
|
863
|
+
* writes to the primary (left) collection; writes to a co-partitioned right
|
|
864
|
+
* collection or a broadcast-dimension collection do NOT trigger a recompute —
|
|
865
|
+
* re-run the query to pick those up.
|
|
866
|
+
*/
|
|
795
867
|
live(options?: LiveQueryOptions): CrossVaultLiveQuery<R>;
|
|
868
|
+
/**
|
|
869
|
+
* @internal — the FanoutRecordSource for aggregate surfaces. With no join legs,
|
|
870
|
+
* returns `this` (partial-reduce-eligible, #8). With join legs, returns a
|
|
871
|
+
* toArray-backed source (fully-joined rows) and NO fanoutReduce, forcing
|
|
872
|
+
* central-reduce over the joined rows (partial-reduce can't span the central
|
|
873
|
+
* broadcast join). Used by scalar `aggregate()` and `ShardedGroupedQuery`.
|
|
874
|
+
*/
|
|
875
|
+
aggregateSource(): FanoutRecordSource<R>;
|
|
796
876
|
/** One-shot distributed aggregate — central reduce over all shard records. */
|
|
797
877
|
aggregate<Spec extends AggregateSpec>(spec: Spec): CrossVaultAggregation<R, Spec>;
|
|
798
878
|
/** Begin a grouped cross-shard aggregate. */
|
|
@@ -806,4 +886,4 @@ declare class ShardedGroupedQuery<T, R, F extends string> {
|
|
|
806
886
|
aggregate<Spec extends AggregateSpec>(spec: Spec): CrossVaultGroupedAggregation<R, F, Spec>;
|
|
807
887
|
}
|
|
808
888
|
|
|
809
|
-
export {
|
|
889
|
+
export { type MergeStrategy as A, type MigrationStatusRow as B, type CapturedBlueprint as C, type DecryptedMergeOptions as D, type SchemaManifestRow as E, type FanoutQueryOptions as F, type GroupedRow as G, type SchemaRolloutResult as H, type InsightAutoPushConfig as I, ShardedCollection as J, ShardedGroupedQuery as K, type LiveQueryOptions as L, type MergeCompartmentOptions as M, ShardedQuery as N, type ShardingConfig as O, type SurfaceStatus as P, type VaultRegistryRow as Q, type RefreshInsightsResult as R, StateManagementVault as S, mergeCompartment as T, mergeDecryptedRecords as U, VaultGroup as V, resolveFieldAuthority as W, resolveRecordByFieldAuthority as X, type VaultTemplate as a, type SkippedVault as b, type MergeReport as c, type SurfaceDirection as d, type SurfaceConflictPolicy as e, type SurfaceRow as f, type VaultGroupOptions as g, CrossVaultAggregation as h, type CrossVaultDerivationContext as i, type CrossVaultDerivationSpec as j, CrossVaultGroupedAggregation as k, type CrossVaultLiveAggregation as l, type CrossVaultLiveQuery as m, type DeploymentEvent as n, type FanoutResult as o, type FederatedRetrieveHit as p, type FederatedRetrieveOptions as q, type FederatedRetrieveResult as r, type FederationMeta as s, type FieldAuthorityInputs as t, type FieldAuthorityPolicy as u, FieldAuthorityPolicyMissingError as v, type FieldAuthorityRule as w, FieldLevelDeferredError as x, type GroupMeta as y, type MergeConflict as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Vault as Vault$1, IndexDef, Operator, LiveQuery, LiveAggregation, AggregateSpec, AggregateResult, Collection, Noydb, Query, JoinStrategy, ChangeEvent } from '@noy-db/hub/kernel';
|
|
1
|
+
import { Vault as Vault$1, VaultMeta, IndexDef, Operator, LiveQuery, LiveAggregation, AggregateSpec, AggregateResult, RetrieveHit, Collection, Noydb, Query, JoinStrategy, ChangeEvent } from '@noy-db/hub/kernel';
|
|
2
2
|
import { Vault } from '@noy-db/hub';
|
|
3
3
|
import { DecryptedRecord } from '@noy-db/hub/bundle';
|
|
4
4
|
|
|
@@ -154,6 +154,17 @@ declare function mergeCompartment(receiver: Vault, compartmentBytes: Uint8Array,
|
|
|
154
154
|
* docs/superpowers/specs/2026-06-07-mvf-vaultgroup-routing-mvp-design.md.
|
|
155
155
|
*/
|
|
156
156
|
|
|
157
|
+
/** A federation group's own descriptive metadata (reuses the noy-db VaultMeta shape). */
|
|
158
|
+
type GroupMeta = VaultMeta;
|
|
159
|
+
/** Federation-level metadata: the group's own meta + each member vault's vaultMeta. */
|
|
160
|
+
interface FederationMeta {
|
|
161
|
+
readonly meta: GroupMeta | undefined;
|
|
162
|
+
readonly vaults: ReadonlyArray<{
|
|
163
|
+
readonly vaultId: string;
|
|
164
|
+
readonly partitionKey: string;
|
|
165
|
+
readonly meta: VaultMeta | undefined;
|
|
166
|
+
}>;
|
|
167
|
+
}
|
|
157
168
|
/**
|
|
158
169
|
* A schema blueprint for a class of shard vaults. `configure` is
|
|
159
170
|
* re-applied to every shard handle so all shards are configured
|
|
@@ -210,6 +221,8 @@ interface VaultGroupOptions<T> {
|
|
|
210
221
|
* Zero cost for shards never opened. Default `false` (use `rolloutSchema`).
|
|
211
222
|
*/
|
|
212
223
|
readonly cutoverOnOpen?: boolean;
|
|
224
|
+
/** Descriptive group-level metadata (label/description/icon) for UIs. Descriptive-only. */
|
|
225
|
+
readonly meta?: GroupMeta;
|
|
213
226
|
}
|
|
214
227
|
/** Result of `VaultGroup.rolloutSchema` (#271 active batch runner). */
|
|
215
228
|
interface SchemaRolloutResult {
|
|
@@ -241,6 +254,32 @@ interface FanoutResult<R> {
|
|
|
241
254
|
readonly results: R[];
|
|
242
255
|
readonly skippedVaults: SkippedVault[];
|
|
243
256
|
}
|
|
257
|
+
/** Options for cross-vault federated retrieval (#26). Extends the fan-out base. */
|
|
258
|
+
interface FederatedRetrieveOptions extends FanoutQueryOptions {
|
|
259
|
+
readonly mode?: 'lexical' | 'semantic' | 'hybrid';
|
|
260
|
+
readonly limit?: number;
|
|
261
|
+
readonly minScore?: number;
|
|
262
|
+
readonly fields?: readonly string[];
|
|
263
|
+
readonly match?: 'any' | 'all';
|
|
264
|
+
readonly prefix?: boolean;
|
|
265
|
+
readonly snippetWindow?: number;
|
|
266
|
+
readonly includeRecord?: boolean;
|
|
267
|
+
/** Payload filter applied per-vault (retrieve ∩ where), rebuilt into each shard's `within`. */
|
|
268
|
+
readonly where?: ReadonlyArray<readonly [field: string, op: Operator, value: unknown]>;
|
|
269
|
+
/** RRF constant; default 60. */
|
|
270
|
+
readonly rrfK?: number;
|
|
271
|
+
/** Re-throw a per-shard retrieve() failure instead of skipping it. */
|
|
272
|
+
readonly failFast?: boolean;
|
|
273
|
+
}
|
|
274
|
+
/** A fused hit carrying the originating shard (provenance). */
|
|
275
|
+
interface FederatedRetrieveHit<R> extends RetrieveHit<R> {
|
|
276
|
+
readonly vault: string;
|
|
277
|
+
}
|
|
278
|
+
/** Result of `ShardedCollection.retrieve()`. */
|
|
279
|
+
interface FederatedRetrieveResult<R> {
|
|
280
|
+
readonly hits: FederatedRetrieveHit<R>[];
|
|
281
|
+
readonly skippedVaults: SkippedVault[];
|
|
282
|
+
}
|
|
244
283
|
/** A single captured where-clause, replayed inside each shard. */
|
|
245
284
|
interface WhereClause {
|
|
246
285
|
readonly field: string;
|
|
@@ -278,6 +317,13 @@ interface CrossVaultDerivationContext {
|
|
|
278
317
|
/** The shard's schema/template version, from its registry row. */
|
|
279
318
|
readonly schemaVersion: number;
|
|
280
319
|
}
|
|
320
|
+
/** Tuning for auto-push-on-write (#13). */
|
|
321
|
+
interface InsightAutoPushConfig {
|
|
322
|
+
/** Reset-debounce window (ms): batch a multi-tick write burst into one re-derive. Omit = microtask coalescing. */
|
|
323
|
+
readonly debounceMs?: number;
|
|
324
|
+
/** Skip auto-pushing a shard whose registry `schemaVersion` is below this. */
|
|
325
|
+
readonly minVersion?: number;
|
|
326
|
+
}
|
|
281
327
|
/**
|
|
282
328
|
* A push-model cross-vault derivation (#271, Insight Vault — Layer 4).
|
|
283
329
|
*
|
|
@@ -305,8 +351,9 @@ interface CrossVaultDerivationSpec<R = Record<string, unknown>, S = Record<strin
|
|
|
305
351
|
* `source` collection, recompute and push that shard's summary
|
|
306
352
|
* automatically (coalesced per microtask). Default off — without this the
|
|
307
353
|
* derivation is explicit-refresh-only (drive it with `refreshInsights()`).
|
|
354
|
+
* Pass an object to enable debounce / minVersion tuning (#13).
|
|
308
355
|
*/
|
|
309
|
-
readonly autoPush?: boolean;
|
|
356
|
+
readonly autoPush?: boolean | InsightAutoPushConfig;
|
|
310
357
|
}
|
|
311
358
|
/** The result of `refreshInsights()`. */
|
|
312
359
|
interface RefreshInsightsResult {
|
|
@@ -590,13 +637,15 @@ declare class VaultGroup<T> {
|
|
|
590
637
|
/** @internal */ readonly sharding: ShardingConfig<T>;
|
|
591
638
|
/** @internal */ readonly template: VaultTemplate;
|
|
592
639
|
/** @internal — lazy cutover-on-open (#271). */ readonly cutoverOnOpen: boolean;
|
|
640
|
+
/** @internal — group-level descriptive metadata (#27). */ readonly meta?: GroupMeta | undefined;
|
|
593
641
|
constructor(
|
|
594
642
|
/** @internal */ db: Noydb,
|
|
595
643
|
/** @internal */ name: string,
|
|
596
644
|
/** @internal */ registry: Collection<VaultRegistryRow>,
|
|
597
645
|
/** @internal */ sharding: ShardingConfig<T>,
|
|
598
646
|
/** @internal */ template: VaultTemplate,
|
|
599
|
-
/** @internal — lazy cutover-on-open (#271). */ cutoverOnOpen?: boolean
|
|
647
|
+
/** @internal — lazy cutover-on-open (#271). */ cutoverOnOpen?: boolean,
|
|
648
|
+
/** @internal — group-level descriptive metadata (#27). */ meta?: GroupMeta | undefined);
|
|
600
649
|
/** @internal — set when the group is managed (no explicit registry). */
|
|
601
650
|
private stateVault;
|
|
602
651
|
/** @internal */
|
|
@@ -619,6 +668,14 @@ declare class VaultGroup<T> {
|
|
|
619
668
|
* `liveBinding().isRelevant` already applies to the reactive path.
|
|
620
669
|
*/
|
|
621
670
|
allRows(): Promise<VaultRegistryRow[]>;
|
|
671
|
+
/**
|
|
672
|
+
* Federation-level descriptive metadata (#27): this group's `meta` plus each
|
|
673
|
+
* member vault's `vaultMeta` (read via `getMeta()`). Best-effort per shard — a
|
|
674
|
+
* shard that fails to open yields `meta: undefined` for that entry, never
|
|
675
|
+
* throwing. Member meta is transient per-open (noy-db sets it at `openVault`,
|
|
676
|
+
* does not persist it); this surfaces whatever each vault was opened with.
|
|
677
|
+
*/
|
|
678
|
+
federationMeta(): Promise<FederationMeta>;
|
|
622
679
|
/**
|
|
623
680
|
* Open an existing shard and apply the template. When `cutoverOnOpen` is set
|
|
624
681
|
* (#271) and the shard's registry version is behind the template, its cutover
|
|
@@ -757,6 +814,15 @@ declare class ShardedCollection<T, R = T> {
|
|
|
757
814
|
put(id: string, record: T): Promise<void>;
|
|
758
815
|
/** Begin a cross-shard fan-out query. */
|
|
759
816
|
query(): ShardedQuery<T, R>;
|
|
817
|
+
/**
|
|
818
|
+
* Cross-vault federated retrieval (#26): scatter-gather across all eligible
|
|
819
|
+
* shards — each shard runs its own trusted-tier `retrieve()`, then results are
|
|
820
|
+
* RRF-fused by rank only (no cross-vault statistics cross the DEK boundary).
|
|
821
|
+
* Every hit carries its originating `vault`. An unreachable, schema-drifted, or
|
|
822
|
+
* un-indexed shard is skipped (`skippedVaults`); pass `failFast` to re-throw
|
|
823
|
+
* the first per-shard error instead.
|
|
824
|
+
*/
|
|
825
|
+
retrieve(query: string, opts?: FederatedRetrieveOptions): Promise<FederatedRetrieveResult<R>>;
|
|
760
826
|
}
|
|
761
827
|
declare class ShardedQuery<T, R = T> {
|
|
762
828
|
private readonly group;
|
|
@@ -789,10 +855,24 @@ declare class ShardedQuery<T, R = T> {
|
|
|
789
855
|
toArray(options?: FanoutQueryOptions): Promise<FanoutResult<R>>;
|
|
790
856
|
/** @internal — build the change-subscription + relevance binding for this query's group+collection. */
|
|
791
857
|
liveBinding(): LiveBinding;
|
|
792
|
-
/**
|
|
793
|
-
|
|
794
|
-
|
|
858
|
+
/**
|
|
859
|
+
* Returns a reactive cross-shard live query — a facade over CrossVaultLive.
|
|
860
|
+
*
|
|
861
|
+
* Joined queries (crossShardJoin / broadcastJoin) are supported (#14): the live
|
|
862
|
+
* value reflects the fully-joined rows. **v1 limitation:** recomputes only on
|
|
863
|
+
* writes to the primary (left) collection; writes to a co-partitioned right
|
|
864
|
+
* collection or a broadcast-dimension collection do NOT trigger a recompute —
|
|
865
|
+
* re-run the query to pick those up.
|
|
866
|
+
*/
|
|
795
867
|
live(options?: LiveQueryOptions): CrossVaultLiveQuery<R>;
|
|
868
|
+
/**
|
|
869
|
+
* @internal — the FanoutRecordSource for aggregate surfaces. With no join legs,
|
|
870
|
+
* returns `this` (partial-reduce-eligible, #8). With join legs, returns a
|
|
871
|
+
* toArray-backed source (fully-joined rows) and NO fanoutReduce, forcing
|
|
872
|
+
* central-reduce over the joined rows (partial-reduce can't span the central
|
|
873
|
+
* broadcast join). Used by scalar `aggregate()` and `ShardedGroupedQuery`.
|
|
874
|
+
*/
|
|
875
|
+
aggregateSource(): FanoutRecordSource<R>;
|
|
796
876
|
/** One-shot distributed aggregate — central reduce over all shard records. */
|
|
797
877
|
aggregate<Spec extends AggregateSpec>(spec: Spec): CrossVaultAggregation<R, Spec>;
|
|
798
878
|
/** Begin a grouped cross-shard aggregate. */
|
|
@@ -806,4 +886,4 @@ declare class ShardedGroupedQuery<T, R, F extends string> {
|
|
|
806
886
|
aggregate<Spec extends AggregateSpec>(spec: Spec): CrossVaultGroupedAggregation<R, F, Spec>;
|
|
807
887
|
}
|
|
808
888
|
|
|
809
|
-
export {
|
|
889
|
+
export { type MergeStrategy as A, type MigrationStatusRow as B, type CapturedBlueprint as C, type DecryptedMergeOptions as D, type SchemaManifestRow as E, type FanoutQueryOptions as F, type GroupedRow as G, type SchemaRolloutResult as H, type InsightAutoPushConfig as I, ShardedCollection as J, ShardedGroupedQuery as K, type LiveQueryOptions as L, type MergeCompartmentOptions as M, ShardedQuery as N, type ShardingConfig as O, type SurfaceStatus as P, type VaultRegistryRow as Q, type RefreshInsightsResult as R, StateManagementVault as S, mergeCompartment as T, mergeDecryptedRecords as U, VaultGroup as V, resolveFieldAuthority as W, resolveRecordByFieldAuthority as X, type VaultTemplate as a, type SkippedVault as b, type MergeReport as c, type SurfaceDirection as d, type SurfaceConflictPolicy as e, type SurfaceRow as f, type VaultGroupOptions as g, CrossVaultAggregation as h, type CrossVaultDerivationContext as i, type CrossVaultDerivationSpec as j, CrossVaultGroupedAggregation as k, type CrossVaultLiveAggregation as l, type CrossVaultLiveQuery as m, type DeploymentEvent as n, type FanoutResult as o, type FederatedRetrieveHit as p, type FederatedRetrieveOptions as q, type FederatedRetrieveResult as r, type FederationMeta as s, type FieldAuthorityInputs as t, type FieldAuthorityPolicy as u, FieldAuthorityPolicyMissingError as v, type FieldAuthorityRule as w, FieldLevelDeferredError as x, type GroupMeta as y, type MergeConflict as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@klum-db/lobby",
|
|
3
|
-
"version": "0.2.0-pre.
|
|
3
|
+
"version": "0.2.0-pre.33",
|
|
4
4
|
"description": "klum-db Lobby — orchestrates a group of sovereign noy-db vaults (federation, interchange, custody). The outward framework to noy-db's inward vault.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "vLannaAi <vicio@lanna.ai>",
|
|
@@ -41,10 +41,10 @@
|
|
|
41
41
|
"node": ">=18.0.0"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"@noy-db/as-xlsx": "^0.2.0-pre.
|
|
45
|
-
"@noy-db/hub": "^0.2.0-pre.
|
|
46
|
-
"@noy-db/in-devtools": "^0.2.0-pre.
|
|
47
|
-
"@noy-db/to-meter": "^0.2.0-pre.
|
|
44
|
+
"@noy-db/as-xlsx": "^0.2.0-pre.29",
|
|
45
|
+
"@noy-db/hub": "^0.2.0-pre.29",
|
|
46
|
+
"@noy-db/in-devtools": "^0.2.0-pre.29",
|
|
47
|
+
"@noy-db/to-meter": "^0.2.0-pre.29"
|
|
48
48
|
},
|
|
49
49
|
"peerDependenciesMeta": {
|
|
50
50
|
"@noy-db/in-devtools": {
|
|
@@ -56,12 +56,12 @@
|
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@eslint/js": "^9.18.0",
|
|
59
|
-
"@noy-db/as-xlsx": "0.2.0-pre.
|
|
60
|
-
"@noy-db/as-zip": "0.2.0-pre.
|
|
61
|
-
"@noy-db/hub": "0.2.0-pre.
|
|
62
|
-
"@noy-db/in-devtools": "0.2.0-pre.
|
|
63
|
-
"@noy-db/to-memory": "0.2.0-pre.
|
|
64
|
-
"@noy-db/to-meter": "0.2.0-pre.
|
|
59
|
+
"@noy-db/as-xlsx": "0.2.0-pre.30",
|
|
60
|
+
"@noy-db/as-zip": "0.2.0-pre.30",
|
|
61
|
+
"@noy-db/hub": "0.2.0-pre.30",
|
|
62
|
+
"@noy-db/in-devtools": "0.2.0-pre.30",
|
|
63
|
+
"@noy-db/to-memory": "0.2.0-pre.30",
|
|
64
|
+
"@noy-db/to-meter": "0.2.0-pre.30",
|
|
65
65
|
"@types/node": "^22.0.0",
|
|
66
66
|
"eslint": "^9.18.0",
|
|
67
67
|
"tsup": "^8.4.0",
|