@noy-db/hub 0.4.0-pre.2 → 0.4.0-pre.4

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 (72) hide show
  1. package/dist/aggregate/index.js +1 -1
  2. package/dist/blobs/index.js.map +1 -1
  3. package/dist/broker/index.js +3 -3
  4. package/dist/broker/index.js.map +1 -1
  5. package/dist/cargo/index.js +5 -5
  6. package/dist/{chunk-OGY4ELVE.js → chunk-3XVOLB75.js} +2 -2
  7. package/dist/{chunk-OTU5ZI3U.js → chunk-4X6DJZHY.js} +3 -3
  8. package/dist/{chunk-IU22SQGU.js → chunk-5KI3REO3.js} +2 -2
  9. package/dist/{chunk-IU22SQGU.js.map → chunk-5KI3REO3.js.map} +1 -1
  10. package/dist/{chunk-PWZKD4HW.js → chunk-BLB7P7LS.js} +3 -3
  11. package/dist/{chunk-Y5E6CH6S.js → chunk-EW4HFWGJ.js} +2 -2
  12. package/dist/{chunk-S3OYXPSE.js → chunk-HKR25MGX.js} +2 -2
  13. package/dist/{chunk-RI3OKC3Y.js → chunk-JIMEB4C6.js} +1 -1
  14. package/dist/chunk-JIMEB4C6.js.map +1 -0
  15. package/dist/{chunk-J6U4BOKP.js → chunk-JW3XCZA2.js} +9 -9
  16. package/dist/{chunk-4JYYIFHW.js → chunk-QUIG6BZT.js} +16 -16
  17. package/dist/{chunk-4JYYIFHW.js.map → chunk-QUIG6BZT.js.map} +1 -1
  18. package/dist/{chunk-TYBXP6WE.js → chunk-QYJIOWKN.js} +2 -2
  19. package/dist/{chunk-A64XXIIB.js → chunk-U73LHVPF.js} +17 -17
  20. package/dist/{chunk-A64XXIIB.js.map → chunk-U73LHVPF.js.map} +1 -1
  21. package/dist/{chunk-VZELV7ZJ.js → chunk-W7TCXZWU.js} +455 -554
  22. package/dist/chunk-W7TCXZWU.js.map +1 -0
  23. package/dist/{chunk-RGL53NXZ.js → chunk-WEC3JGBA.js} +2 -2
  24. package/dist/{chunk-HVZT5T22.js → chunk-WJDYZP3U.js} +1 -1
  25. package/dist/chunk-WJDYZP3U.js.map +1 -0
  26. package/dist/{collection-facade-ENLTJZBT.js → collection-facade-CMZGQ6IS.js} +2 -2
  27. package/dist/{executor-UF7LTX6O.js → executor-YORMIBWV.js} +3 -3
  28. package/dist/index.d.ts +5 -0
  29. package/dist/index.js +14 -14
  30. package/dist/kernel/collection-config.d.ts +11 -69
  31. package/dist/kernel/collection.d.ts +10 -21
  32. package/dist/kernel/enclave/index.d.ts +1 -1
  33. package/dist/kernel/noydb.d.ts +24 -13
  34. package/dist/kernel/vault.d.ts +21 -68
  35. package/dist/{liberate-W5MDWYOV.js → liberate-FK7JI2QX.js} +3 -3
  36. package/dist/materialized-views/index.js +3 -3
  37. package/dist/{noydb-U63S3Z7F.js → noydb-N5IW6OFZ.js} +10 -10
  38. package/dist/port/with/archive-strategy.d.ts +31 -0
  39. package/dist/port/with/strategies.d.ts +134 -0
  40. package/dist/query/index.js +2 -2
  41. package/dist/{seed-6GTDHL4E.js → seed-EKF4DIBB.js} +2 -2
  42. package/dist/{stale-NB5BGRVU.js → stale-4UNPHWOU.js} +2 -2
  43. package/dist/team/index.js +3 -3
  44. package/dist/tiers/index.js +1 -1
  45. package/dist/via/blob/active.d.ts +2 -1
  46. package/dist/with/index.js +2 -2
  47. package/dist/with-audit/forget/index.d.ts +2 -1
  48. package/dist/with-audit/tiers/index.d.ts +1 -0
  49. package/dist/with-cargo/index.d.ts +2 -0
  50. package/dist/with-formula/derivations/index.d.ts +2 -0
  51. package/dist/with-formula/materialized-views/index.d.ts +1 -0
  52. package/dist/with-lookup/aggregate/reducers.d.ts +1 -2
  53. package/dist/with-party/broker/index.d.ts +1 -0
  54. package/dist/with-party/team/keyring.d.ts +2 -2
  55. package/package.json +5 -4
  56. package/dist/chunk-HVZT5T22.js.map +0 -1
  57. package/dist/chunk-RI3OKC3Y.js.map +0 -1
  58. package/dist/chunk-VZELV7ZJ.js.map +0 -1
  59. /package/dist/{chunk-OGY4ELVE.js.map → chunk-3XVOLB75.js.map} +0 -0
  60. /package/dist/{chunk-OTU5ZI3U.js.map → chunk-4X6DJZHY.js.map} +0 -0
  61. /package/dist/{chunk-PWZKD4HW.js.map → chunk-BLB7P7LS.js.map} +0 -0
  62. /package/dist/{chunk-Y5E6CH6S.js.map → chunk-EW4HFWGJ.js.map} +0 -0
  63. /package/dist/{chunk-S3OYXPSE.js.map → chunk-HKR25MGX.js.map} +0 -0
  64. /package/dist/{chunk-J6U4BOKP.js.map → chunk-JW3XCZA2.js.map} +0 -0
  65. /package/dist/{chunk-TYBXP6WE.js.map → chunk-QYJIOWKN.js.map} +0 -0
  66. /package/dist/{chunk-RGL53NXZ.js.map → chunk-WEC3JGBA.js.map} +0 -0
  67. /package/dist/{collection-facade-ENLTJZBT.js.map → collection-facade-CMZGQ6IS.js.map} +0 -0
  68. /package/dist/{executor-UF7LTX6O.js.map → executor-YORMIBWV.js.map} +0 -0
  69. /package/dist/{liberate-W5MDWYOV.js.map → liberate-FK7JI2QX.js.map} +0 -0
  70. /package/dist/{noydb-U63S3Z7F.js.map → noydb-N5IW6OFZ.js.map} +0 -0
  71. /package/dist/{seed-6GTDHL4E.js.map → seed-EKF4DIBB.js.map} +0 -0
  72. /package/dist/{stale-NB5BGRVU.js.map → stale-4UNPHWOU.js.map} +0 -0
@@ -54,7 +54,7 @@
54
54
  * every consumer regardless of which enclave is wired in. noy-db's own
55
55
  * enclave supports every group, so it never throws this error.
56
56
  */
57
- export type { EnclaveKey } from './crypto.js';
57
+ export type { EnclaveKey, EncryptResult } from './crypto.js';
58
58
  export { encrypt, decrypt, encryptBytes, decryptBytes, encryptBytesWithAAD, decryptBytesWithAAD, encryptDeterministic, decryptDeterministic, sha256Hex, hmacSha256Hex, } from './crypto.js';
59
59
  export { deriveKey, derivePassphraseKey, generateDEK, generateSalt, generateIV, wrapKey, unwrapKey, bufferToBase64, base64ToBuffer, derivePresenceKey, deriveDeterministicKey, deriveSealedFieldKey, deriveSealedFieldKeyFromCek, wrapCek, unwrapCek, importCek, } from './crypto.js';
60
60
  export type { PassphraseKeyUsage } from './crypto.js';
@@ -84,21 +84,20 @@ export declare class Noydb {
84
84
  private writeRelay;
85
85
  /** Per-vault policy enforcers. */
86
86
  private readonly policyEnforcers;
87
- private readonly txStrategy;
88
- private readonly forgetStrategy;
89
87
  /**
90
- * Opt-in sovereign-custody (FR-6) strategy `NO_CUSTODY` (throwing) unless
91
- * `withCustody()` was passed. Public so `Vault` routes `vault.custody.liberate`
92
- * through it; grant/revoke route through it from this class. @internal
88
+ * Every opt-in service, resolved once (#838). Shared by reference with each
89
+ * `Vault` this instance opens and, through them, every `Collection` so
90
+ * there is exactly one resolution and no construction path can disagree
91
+ * about which services are enabled (the #834 bug class).
93
92
  */
94
- readonly custodyStrategy: CustodyStrategy;
93
+ private readonly strategies;
95
94
  /**
96
- * Opt-in multi-user team strategy (#267 keyring-grant → team split)
97
- * `NO_TEAM` (throwing) unless `withTeam()` was passed; the keyring
98
- * engines are linked only by the active strategy, not by this file. */
99
- private readonly teamStrategy;
100
- private readonly sessionStrategy;
101
- private readonly syncStrategy;
95
+ * Opt-in sovereign-custody (FR-6) strategy `NO_CUSTODY` (throwing) unless
96
+ * `withCustody()` was passed. Kept as a public accessor because `Vault`
97
+ * routes `vault.custody.liberate` through `this.noydb.custodyStrategy`.
98
+ * @internal
99
+ */
100
+ get custodyStrategy(): CustodyStrategy;
102
101
  private readonly snapshots;
103
102
  private readonly policyManager;
104
103
  /** Pre-resolved policy-gate engine function (mirrors `coordinationProvider`/`userApiFactory` above). */
@@ -151,7 +150,19 @@ export declare class Noydb {
151
150
  create?: boolean;
152
151
  meta?: VaultMeta;
153
152
  }): Promise<Vault>;
154
- /** Synchronous vault access (must call openVault first, or auto-opens). */
153
+ /**
154
+ * Synchronous access to an ALREADY-OPEN vault.
155
+ *
156
+ * Returns the instance `openVault()` produced, or throws — it never
157
+ * constructs. It used to fall back to building a Vault itself (once for
158
+ * plaintext, once for encrypted-with-cached-keyring), and those copies
159
+ * drifted from the real open path: the encrypted one silently omitted six
160
+ * strategies, so a vault reached this way threw `*NotEnabledError` for
161
+ * services the caller had configured (#834). Both fallbacks also skipped
162
+ * the async registry init and schema-fence snapshot that `openVault`
163
+ * performs, which a synchronous method cannot await. One construction
164
+ * path is the only way that divergence stays fixed.
165
+ */
155
166
  vault(name: string): Vault;
156
167
  /**
157
168
  * Grant access to a user for a vault.
@@ -1,3 +1,4 @@
1
+ import type { StrategyBag } from '../port/with/strategies.js';
1
2
  import type { NoydbStore, EncryptedEnvelope, HistoryConfig, ExportStreamOptions, ExportChunk, CollectionConflictResolver, CrossTierAccessEvent, TierMode, Role, VaultUserApi } from './types.js';
2
3
  import type { Noydb } from './noydb.js';
3
4
  import type { IssueDelegationOptions, DelegationToken } from '../with-party/team/delegation.js';
@@ -6,7 +7,6 @@ import type { CacheOptions } from './collection.js';
6
7
  import type { JoinableSource } from './query/index.js';
7
8
  import type { OnDirtyCallback } from './collection.js';
8
9
  import type { UnlockedKeyring, BundleRecipient } from '../with-party/team/keyring.js';
9
- import { type PortabilityStrategy } from '../with-audit/portability/strategy.js';
10
10
  import type { MaterializedViewRegistry } from '../with-formula/materialized-views/registry.js';
11
11
  import type { MaterializedViewStrategyHandle } from '../with-formula/materialized-views/types.js';
12
12
  import type { OverlayedViewRegistry } from '../with-formula/overlay-views/registry.js';
@@ -16,32 +16,20 @@ import type { ExportFormat, KeyringFile, SensitiveOpt, IndexFieldName, IndexDefF
16
16
  import { ElevatedHandle } from '../with-commit/tx/elevated-handle.js';
17
17
  import type { NoydbEventEmitter } from './events.js';
18
18
  import type { StandardSchemaV1 } from './schema.js';
19
- import type { BlobStrategy } from '../port/with/blob-strategy.js';
20
19
  import type { ObjectProjection } from '../with-shape/blobs/object-projection.js';
21
- import type { ArchiveStrategy } from '../with-fork/archive/index.js';
22
20
  import type { ArchivePolicy, ArchiveResult, ArchiveRunOptions } from '../with-fork/archive/index.js';
23
21
  import { type SequenceHandle, type FormattedSequenceHandle, type SequenceOptions } from '../with-commit/sequence/index.js';
24
- import { type SequenceStrategy } from '../with-commit/sequence/strategy.js';
25
22
  import { type Assignment } from '../with-commit/numbering/index.js';
26
23
  import type { DeferredNumberingConfig } from '../with-commit/numbering/descriptor.js';
27
- import type { IndexStrategy } from '../with-lookup/indexing/strategy.js';
28
- import type { LazyStrategy } from '../port/with/lazy-strategy.js';
29
- import type { AggregateStrategy } from '../with-lookup/aggregate/strategy.js';
30
- import type { CrdtStrategy } from './types.js';
31
- import type { TiersStrategy, TierMoveResult } from '../with-audit/tiers/strategy.js';
32
- import type { SearchStrategy } from '../with-lookup/search/strategy.js';
24
+ import type { TierMoveResult } from '../with-audit/tiers/strategy.js';
33
25
  import { type CargoStrategy } from '../with-cargo/strategy.js';
34
- import { type BrokerStrategy, type CredentialBrokerHandle } from '../port/with/broker-strategy.js';
26
+ import { type CredentialBrokerHandle } from '../port/with/broker-strategy.js';
35
27
  import type { LedgerStore } from '../with-commit/history/ledger/store.js';
36
28
  import type { VaultInstant } from '../with-commit/history/time-machine.js';
37
- import { type HistoryStrategy } from '../with-commit/history/strategy.js';
38
- import { type ForgetStrategy, type ForgetResult } from '../with-audit/forget/strategy.js';
29
+ import { type ForgetResult } from '../with-audit/forget/strategy.js';
39
30
  import { type SubjectRef } from '../with-audit/forget/subject-index.js';
40
31
  import type { VaultFrame } from '../with-fork/shadow/vault-frame.js';
41
- import { type ShadowStrategy } from '../with-fork/shadow/strategy.js';
42
32
  import type { ConsentContext, ConsentAuditEntry, ConsentAuditFilter, ConsentOp } from '../with-audit/consent/consent.js';
43
- import { type ConsentStrategy } from '../with-audit/consent/strategy.js';
44
- import { type PeriodsStrategy } from '../with-audit/periods/strategy.js';
45
33
  import { type RefDescriptor, type RefViolation } from './refs.js';
46
34
  import type { DictionaryHandle, DictionaryOptions, DictKeyDescriptor, StaticDictDescriptor } from '../port/with/i18n-strategy.js';
47
35
  import { // #653
@@ -49,11 +37,10 @@ type LookupDescriptor } from '../port/with/lookup-strategy.js';
49
37
  import { type LinkSpec, type LinkSetHandle } from '../with-shape/links/names.js';
50
38
  import type { EmbeddingDescriptor } from '../with-lookup/embeddings/index.js';
51
39
  import type { ComputedFields } from '../with-formula/computed/index.js';
52
- import { type I18nStrategy, type I18nTextDescriptor } from '../port/with/i18n-strategy.js';
40
+ import { type I18nTextDescriptor } from '../port/with/i18n-strategy.js';
53
41
  import { type ViaFieldSpec } from './via/compose.js';
54
42
  import { ViaGraph } from './via/graph.js';
55
43
  import { type RollupDeleteIntent } from './via/dispatch.js';
56
- import { type SyncStrategy } from '../with-party/team/sync-strategy.js';
57
44
  import type { GuardRegistry } from '../with-audit/guards/registry.js';
58
45
  import type { GuardStrategyHandleAny } from '../with-audit/guards/types.js';
59
46
  import type { ReadOnlyVaultFacade } from '../with-audit/guards/read-only-facade.js';
@@ -73,13 +60,11 @@ import { SchemaFenceController } from '../with-shape/schema-update/fence-control
73
60
  import { type FenceDoc } from '../with-shape/schema-update/fence.js';
74
61
  import type { SchemaUpdateStrategy } from '../with-shape/schema-update/types.js';
75
62
  import type { AttestationFieldSchema, RevocationList } from '@noy-db/attestation';
76
- import { type AttestationStrategy } from '../with-audit/attestation/vault-facade.js';
77
- import { type SealedRecordStrategy } from '../with-audit/sealed-record/strategy.js';
78
63
  import type { DumpSchemaOptions, VaultSchemaSnapshot, SchemaIntrospection } from '../with-shape/introspection/types.js';
79
64
  import type { VaultIntrospectState } from '../with-shape/introspection/walk.js';
80
65
  import type { FieldMeta } from '../with-shape/introspection/field-meta.js';
81
66
  import type { CollectionMeta, VaultMeta } from '../with-shape/introspection/meta.js';
82
- import { type ClassifiedEntry, type ClassifiedStrategy } from '../port/with/classified-strategy.js';
67
+ import { type ClassifiedEntry } from '../port/with/classified-strategy.js';
83
68
  /** A vault (tenant namespace) containing collections. */
84
69
  export declare class Vault {
85
70
  #private;
@@ -99,36 +84,20 @@ export declare class Vault {
99
84
  private readonly syncAdapter;
100
85
  private readonly getPurgeableTargets;
101
86
  private readonly historyConfig;
102
- /** tree-shake seam for the optional blob service; `undefined` means "blobs are off for this
103
- * vault" every `collection.blob(id)` call throws with a pointer at `@noy-db/hub/blobs`. */
104
- private readonly blobStrategy;
87
+ /**
88
+ * Every opt-in service, resolved once by `createNoydb` (#838). Shared by
89
+ * reference with the owning `Noydb` and with every `Collection` this vault
90
+ * opens, so all three always agree about which services are enabled.
91
+ */
92
+ private readonly strategies;
105
93
  private readonly objectStore;
106
- /** Cold-storage archival strategy (the archive target store). */
107
- private readonly archiveStrategy;
108
94
  /** Per-collection record archival policies. Indexed by collection name. */
109
95
  private readonly archiveRegistry;
110
- private readonly indexStrategy;
111
- private readonly lazyStrategy;
112
- private readonly aggregateStrategy;
113
- private readonly crdtStrategy;
114
- private readonly tiersStrategy;
115
- private readonly searchStrategy;
116
- /** Cargo (partition extraction) strategy — `NO_CARGO` (throwing) unless `withCargo()` was passed.
117
- * Public so the `extractPartition` free function (which takes a `Vault`) routes through it. */
118
- readonly cargoStrategy: CargoStrategy;
119
- private readonly brokerStrategy;
120
- private readonly sealedRecordStrategy;
121
- private readonly portabilityStrategy;
122
- private readonly sequenceStrategy;
123
- private readonly consentStrategy;
124
96
  private readonly periods;
125
97
  private readonly linksEnforcer;
126
- private readonly shadowStrategy;
127
- private readonly historyStrategy;
128
- private readonly forgetStrategy;
129
- private readonly i18nStrategy;
130
- private readonly syncStrategy;
131
- private readonly classifiedStrategy;
98
+ /** Cargo (partition extraction) strategy — `NO_CARGO` (throwing) unless `withCargo()` was passed.
99
+ * Public so the `extractPartition` free function (which takes a `Vault`) routes through it. */
100
+ get cargoStrategy(): CargoStrategy;
132
101
  /** Per-vault guard registry; `null` until `_initGuards()` runs (or for vaults that never register
133
102
  * one) — the runtime class is dynamic-imported on demand to keep it out of the floor bundle. */
134
103
  private guardRegistry;
@@ -317,31 +286,15 @@ export declare class Vault {
317
286
  * `undefined` => every `collection.blob(id)` throws with a pointer
318
287
  * at `@noy-db/hub/blobs`.
319
288
  */
320
- blobStrategy?: BlobStrategy | undefined;
289
+ /**
290
+ * Every opt-in service, already resolved by `createNoydb` (#838). Not
291
+ * optional: a Vault cannot be built without it, which is what makes the
292
+ * partially-populated construction path of #834 unrepresentable.
293
+ */
294
+ strategies: StrategyBag;
321
295
  objectStore?: ObjectProjection | undefined;
322
- archiveStrategy?: ArchiveStrategy | undefined;
323
- indexStrategy?: IndexStrategy | undefined;
324
- lazyStrategy?: LazyStrategy | undefined;
325
- aggregateStrategy?: AggregateStrategy | undefined;
326
- crdtStrategy?: CrdtStrategy | undefined;
327
- tiersStrategy?: TiersStrategy | undefined;
328
- searchStrategy?: SearchStrategy | undefined;
329
- cargoStrategy?: CargoStrategy | undefined;
330
- brokerStrategy?: BrokerStrategy | undefined;
331
- consentStrategy?: ConsentStrategy | undefined;
332
- periodsStrategy?: PeriodsStrategy | undefined;
333
- shadowStrategy?: ShadowStrategy | undefined;
334
- historyStrategy?: HistoryStrategy | undefined;
335
- i18nStrategy?: I18nStrategy | undefined;
336
- syncStrategy?: SyncStrategy | undefined;
337
296
  guardStrategies?: ReadonlyArray<GuardStrategyHandleAny> | undefined;
338
297
  numberingConfigs?: ReadonlyArray<DeferredNumberingConfig> | undefined;
339
- forgetStrategy?: ForgetStrategy | undefined;
340
- attestationStrategy?: AttestationStrategy | undefined;
341
- classifiedStrategy?: ClassifiedStrategy | undefined;
342
- sealedRecordStrategy?: SealedRecordStrategy | undefined;
343
- portabilityStrategy?: PortabilityStrategy | undefined;
344
- sequenceStrategy?: SequenceStrategy | undefined;
345
298
  /** Vault-level descriptive metadata — set once at construction (first-wins). */
346
299
  meta?: VaultMeta | undefined;
347
300
  });
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  liberateVault
3
- } from "./chunk-S3OYXPSE.js";
3
+ } from "./chunk-HKR25MGX.js";
4
4
  import "./chunk-BCOKZC4B.js";
5
5
  import "./chunk-XULHFSHO.js";
6
6
  import "./chunk-25ZDB25Z.js";
7
7
  import "./chunk-MEKAMERX.js";
8
8
  import "./chunk-BVZGNMVM.js";
9
- import "./chunk-HVZT5T22.js";
9
+ import "./chunk-WJDYZP3U.js";
10
10
  import "./chunk-7B4GPCX7.js";
11
11
  import "./chunk-PEY6ZTCF.js";
12
12
  import "./chunk-QXPOEAKR.js";
@@ -21,4 +21,4 @@ import "./chunk-PZ5AY32C.js";
21
21
  export {
22
22
  liberateVault
23
23
  };
24
- //# sourceMappingURL=liberate-W5MDWYOV.js.map
24
+ //# sourceMappingURL=liberate-FK7JI2QX.js.map
@@ -3,7 +3,7 @@ import {
3
3
  } from "../chunk-OOTTXUNV.js";
4
4
  import {
5
5
  MaterializedViewExecutor
6
- } from "../chunk-TYBXP6WE.js";
6
+ } from "../chunk-QYJIOWKN.js";
7
7
  import "../chunk-HGVFJL63.js";
8
8
  import {
9
9
  MaterializedViewRegistry,
@@ -17,9 +17,9 @@ import {
17
17
  isMVStale,
18
18
  markMVStale,
19
19
  resolveStaleMVOnRead
20
- } from "../chunk-OGY4ELVE.js";
20
+ } from "../chunk-3XVOLB75.js";
21
21
  import "../chunk-OGFPMCSP.js";
22
- import "../chunk-RI3OKC3Y.js";
22
+ import "../chunk-JIMEB4C6.js";
23
23
  import "../chunk-IGJCYUT5.js";
24
24
  import "../chunk-BZEPJJOK.js";
25
25
  import "../chunk-XGVDLQJE.js";
@@ -1,24 +1,24 @@
1
1
  import {
2
2
  Noydb,
3
3
  createNoydb
4
- } from "./chunk-VZELV7ZJ.js";
4
+ } from "./chunk-W7TCXZWU.js";
5
5
  import "./chunk-VYYM3MEN.js";
6
6
  import "./chunk-NOT7XA7Q.js";
7
7
  import "./chunk-QDNVHA2F.js";
8
8
  import "./chunk-IUIVDVXM.js";
9
9
  import "./chunk-L4OA7G5T.js";
10
10
  import "./chunk-JA5B3SLH.js";
11
- import "./chunk-J6U4BOKP.js";
11
+ import "./chunk-JW3XCZA2.js";
12
12
  import "./chunk-EDC6MLXV.js";
13
13
  import "./chunk-GYGLAVCX.js";
14
- import "./chunk-A64XXIIB.js";
14
+ import "./chunk-U73LHVPF.js";
15
15
  import "./chunk-BCOKZC4B.js";
16
16
  import "./chunk-AURFOK3D.js";
17
- import "./chunk-RGL53NXZ.js";
17
+ import "./chunk-WEC3JGBA.js";
18
18
  import "./chunk-KMONEHDJ.js";
19
19
  import "./chunk-XW7NWO4A.js";
20
20
  import "./chunk-IZX3WZBF.js";
21
- import "./chunk-IU22SQGU.js";
21
+ import "./chunk-5KI3REO3.js";
22
22
  import "./chunk-GYB2QK5H.js";
23
23
  import "./chunk-KR5EGWI4.js";
24
24
  import "./chunk-GHVIKOHT.js";
@@ -26,20 +26,20 @@ import "./chunk-FLHOTGOO.js";
26
26
  import "./chunk-E2R5NRZD.js";
27
27
  import "./chunk-HGVFJL63.js";
28
28
  import "./chunk-2ITLQZV5.js";
29
- import "./chunk-OTU5ZI3U.js";
29
+ import "./chunk-4X6DJZHY.js";
30
30
  import "./chunk-OGFPMCSP.js";
31
31
  import "./chunk-2KL6NDD4.js";
32
32
  import "./chunk-CGPO3ZYB.js";
33
33
  import "./chunk-KPZS5QAQ.js";
34
34
  import "./chunk-NO272T7Q.js";
35
- import "./chunk-RI3OKC3Y.js";
35
+ import "./chunk-JIMEB4C6.js";
36
36
  import "./chunk-IGJCYUT5.js";
37
37
  import "./chunk-25G7U6RD.js";
38
38
  import "./chunk-BZEPJJOK.js";
39
39
  import "./chunk-XGVDLQJE.js";
40
40
  import "./chunk-STR7WBOB.js";
41
- import "./chunk-4JYYIFHW.js";
42
- import "./chunk-HVZT5T22.js";
41
+ import "./chunk-QUIG6BZT.js";
42
+ import "./chunk-WJDYZP3U.js";
43
43
  import "./chunk-7B4GPCX7.js";
44
44
  import "./chunk-3O62PVDW.js";
45
45
  import "./chunk-VQNJ7UZL.js";
@@ -67,4 +67,4 @@ export {
67
67
  Noydb,
68
68
  createNoydb
69
69
  };
70
- //# sourceMappingURL=noydb-U63S3Z7F.js.map
70
+ //# sourceMappingURL=noydb-N5IW6OFZ.js.map
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Strategy seam between the kernel spine and the optional archive service
3
+ * (#838 — precedent: `port/with/blob-strategy.ts`). Lives on the `/with`
4
+ * port so `Vault` can hold the `NO_ARCHIVE` default without a
5
+ * spine→service static import.
6
+ *
7
+ * `archiveStrategy` was the one service with no NO-op stub: the spine held
8
+ * it as `ArchiveStrategy | undefined` and hand-rolled a null gate before
9
+ * every use. That made it the sole exception to the strategy-bag's "every
10
+ * key always resolves" rule (#838), so the stub exists to remove the
11
+ * exception rather than to add a capability.
12
+ *
13
+ * `ArchiveStrategy`'s only member is a live cold `NoydbStore`, and there is
14
+ * no meaningful no-op store — so the stub throws on access instead of
15
+ * standing in. That reproduces the previous gate exactly: `_archiveContext()`
16
+ * read `strategy.store` immediately after its null check, so the throw lands
17
+ * in the same call with the same message.
18
+ *
19
+ * The `ArchiveStrategy` import is TYPE-ONLY and therefore erased — importing
20
+ * it does not pull `with-fork/archive/index.js`'s runtime re-exports of the
21
+ * relocation engine.
22
+ *
23
+ * @internal
24
+ */
25
+ import type { ArchiveStrategy } from '../../with-fork/archive/index.js';
26
+ /**
27
+ * The un-opted-in archive strategy. Reading `.store` throws with a pointer
28
+ * at the `withArchive()` factory — the archive service has no degraded mode
29
+ * to fall back to.
30
+ */
31
+ export declare const NO_ARCHIVE: ArchiveStrategy;
@@ -0,0 +1,134 @@
1
+ /**
2
+ * The strategy bag (#838) — one resolved, immutable record of every opt-in
3
+ * service, built once in `createNoydb` and carried by reference down the
4
+ * spine: `Noydb` → `Vault` → `Collection`.
5
+ *
6
+ * ## Why this exists
7
+ *
8
+ * Threading one service through the spine used to cost ~10 mechanical edits
9
+ * with no logic in any of them: a field on `NoydbOptions`, a conditional
10
+ * spread at the `new Vault(` site, a field declaration + constructor
11
+ * parameter + constructor assignment on `Vault`, a forwarding spread into
12
+ * the collection options, a field + `?? NO_*` default in
13
+ * `collection-config.ts`, and a field + assignment on `Collection`. Nothing
14
+ * checked that a new service reached every layer, which is exactly how #834
15
+ * happened — one of three copies of the Vault option block had silently
16
+ * dropped six strategies, and a vault reached that way threw
17
+ * `*NotEnabledError` for services the caller had actually configured.
18
+ *
19
+ * Here the layers hold ONE field. Adding a service is a row in
20
+ * {@link StrategyBag} plus a row in {@link STRATEGY_DEFAULTS} — both in this
21
+ * file, and omitting either is a compile error rather than a bug that only
22
+ * shows up through one construction path.
23
+ *
24
+ * ## Every key always resolves
25
+ *
26
+ * There is no `undefined` in the bag. An un-opted-in service resolves to its
27
+ * `NO_*` stub, which is the tree-shake seam: the stubs are deliberately tiny
28
+ * modules on the `/with` port that the spine may import statically, while the
29
+ * real implementation arrives only when the consumer imports the service's
30
+ * subpath. Holding a stub costs a few hundred bytes; it does not pull the
31
+ * machinery in.
32
+ *
33
+ * Two services needed adjusting to fit that rule, both recorded here because
34
+ * the reasons are not obvious:
35
+ *
36
+ * - `archive` had no stub at all and was held as `ArchiveStrategy |
37
+ * undefined` behind a hand-rolled null gate. {@link NO_ARCHIVE} now stands
38
+ * in and throws on `.store` access — see `port/with/archive-strategy.ts`.
39
+ * - `lazy`'s floor is {@link IMPLICIT_LAZY}, not a no-op: an un-opted-in
40
+ * collection still gets a working LRU, it just warns. So its default row
41
+ * is a real strategy, which is why this table maps keys to defaults rather
42
+ * than assuming a `NO_*` naming convention.
43
+ *
44
+ * `coordinationStrategy` is deliberately NOT in the bag. It is a
45
+ * `CoordinationProvider`, not a service strategy — it has no `with*()`
46
+ * factory, no `NO_*` stub, and is resolved asynchronously from the store
47
+ * (`createDefaultCoordinationProvider`) rather than passed through. The
48
+ * completeness assertion at the bottom of this file excludes it by name so
49
+ * that the exclusion is explicit and survives future edits.
50
+ *
51
+ * @internal
52
+ */
53
+ import type { NoydbOptions } from '../../kernel/types.js';
54
+ import { type AggregateStrategy } from '../../with-lookup/aggregate/strategy.js';
55
+ import { type AttestationStrategy } from '../../with-audit/attestation/strategy.js';
56
+ import { type BlobStrategy } from './blob-strategy.js';
57
+ import { type BrokerStrategy } from './broker-strategy.js';
58
+ import { type CargoStrategy } from '../../with-cargo/strategy.js';
59
+ import { type ClassifiedStrategy } from './classified-strategy.js';
60
+ import { type ConsentStrategy } from '../../with-audit/consent/strategy.js';
61
+ import { type CrdtStrategy } from '../../with-commit/crdt/strategy.js';
62
+ import { type CustodyStrategy } from '../../with-party/custody/strategy.js';
63
+ import { type ForgetStrategy } from '../../with-audit/forget/strategy.js';
64
+ import { type HistoryStrategy } from '../../with-commit/history/strategy.js';
65
+ import { type I18nStrategy } from './i18n-strategy.js';
66
+ import { type IndexStrategy } from '../../with-lookup/indexing/strategy.js';
67
+ import { type PeriodsStrategy } from '../../with-audit/periods/strategy.js';
68
+ import { type PortabilityStrategy } from '../../with-audit/portability/strategy.js';
69
+ import { type SealedRecordStrategy } from '../../with-audit/sealed-record/strategy.js';
70
+ import { type SearchStrategy } from '../../with-lookup/search/strategy.js';
71
+ import { type SequenceStrategy } from '../../with-commit/sequence/strategy.js';
72
+ import { type SessionStrategy } from '../../with-party/session/strategy.js';
73
+ import { type ShadowStrategy } from '../../with-fork/shadow/strategy.js';
74
+ import { type SnapshotStrategy } from '../../with-fork/snapshots/strategy.js';
75
+ import { type SyncStrategy } from '../../with-party/team/sync-strategy.js';
76
+ import { type TeamStrategy } from './team-strategy.js';
77
+ import { type TiersStrategy } from '../../with-audit/tiers/strategy.js';
78
+ import { type TxStrategy } from '../../with-commit/tx/strategy.js';
79
+ import { type LazyStrategy } from './lazy-strategy.js';
80
+ import type { ArchiveStrategy } from '../../with-fork/archive/index.js';
81
+ /**
82
+ * Every opt-in service, resolved. One field per service, never `undefined`.
83
+ *
84
+ * Keys drop the `Strategy` suffix the `createNoydb` option carries, so
85
+ * `searchStrategy: withSearch()` reads back as `strategies.search`. The
86
+ * completeness assertion below pins that correspondence.
87
+ */
88
+ export interface StrategyBag {
89
+ readonly aggregate: AggregateStrategy;
90
+ readonly archive: ArchiveStrategy;
91
+ readonly attestation: AttestationStrategy;
92
+ readonly blob: BlobStrategy;
93
+ readonly broker: BrokerStrategy;
94
+ readonly cargo: CargoStrategy;
95
+ readonly classified: ClassifiedStrategy;
96
+ readonly consent: ConsentStrategy;
97
+ readonly crdt: CrdtStrategy;
98
+ readonly custody: CustodyStrategy;
99
+ readonly forget: ForgetStrategy;
100
+ readonly history: HistoryStrategy;
101
+ readonly i18n: I18nStrategy;
102
+ readonly index: IndexStrategy;
103
+ readonly lazy: LazyStrategy;
104
+ readonly periods: PeriodsStrategy;
105
+ readonly portability: PortabilityStrategy;
106
+ readonly sealedRecord: SealedRecordStrategy;
107
+ readonly search: SearchStrategy;
108
+ readonly sequence: SequenceStrategy;
109
+ readonly session: SessionStrategy;
110
+ readonly shadow: ShadowStrategy;
111
+ readonly snapshot: SnapshotStrategy;
112
+ readonly sync: SyncStrategy;
113
+ readonly team: TeamStrategy;
114
+ readonly tiers: TiersStrategy;
115
+ readonly tx: TxStrategy;
116
+ }
117
+ /** The name of every service in the bag. */
118
+ export type StrategyKey = keyof StrategyBag;
119
+ /**
120
+ * The un-opted-in floor: what each service resolves to when the caller passed
121
+ * no `with*()` factory. Annotating this `StrategyBag` is what makes a missing
122
+ * row a compile error.
123
+ */
124
+ export declare const STRATEGY_DEFAULTS: StrategyBag;
125
+ /**
126
+ * Build the bag from user options. Called ONCE, in `createNoydb` — every
127
+ * layer below shares the resulting reference.
128
+ *
129
+ * The two casts are the price of mapping `blob` ↔ `blobStrategy` in a loop
130
+ * instead of writing 27 hand-copied lines; the correspondence they assume is
131
+ * proven at compile time by the assertion below, so a typo cannot survive a
132
+ * build.
133
+ */
134
+ export declare function resolveStrategies(options: NoydbOptions): StrategyBag;
@@ -4,7 +4,7 @@ import {
4
4
  ScanBuilder,
5
5
  buildLiveQuery,
6
6
  executePlan
7
- } from "../chunk-OTU5ZI3U.js";
7
+ } from "../chunk-4X6DJZHY.js";
8
8
  import {
9
9
  DEFAULT_JOIN_MAX_ROWS,
10
10
  applyJoins,
@@ -33,7 +33,7 @@ import {
33
33
  reducerBuilder,
34
34
  resetGroupByWarnings,
35
35
  sum
36
- } from "../chunk-RI3OKC3Y.js";
36
+ } from "../chunk-JIMEB4C6.js";
37
37
  import {
38
38
  evaluateClause,
39
39
  evaluateFieldClause,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  BROKER_COLLECTION,
3
3
  ensureCollectionDEK
4
- } from "./chunk-HVZT5T22.js";
4
+ } from "./chunk-WJDYZP3U.js";
5
5
  import "./chunk-7B4GPCX7.js";
6
6
  import {
7
7
  computeBrokerProof,
@@ -228,4 +228,4 @@ export {
228
228
  mintStoreCredentials,
229
229
  rotateSeed
230
230
  };
231
- //# sourceMappingURL=seed-6GTDHL4E.js.map
231
+ //# sourceMappingURL=seed-EKF4DIBB.js.map
@@ -6,7 +6,7 @@ import {
6
6
  isMVStale,
7
7
  markMVStale,
8
8
  resolveStaleMVOnRead
9
- } from "./chunk-OGY4ELVE.js";
9
+ } from "./chunk-3XVOLB75.js";
10
10
  import "./chunk-PEY6ZTCF.js";
11
11
  import "./chunk-QXPOEAKR.js";
12
12
  import "./chunk-LLVW4V7R.js";
@@ -26,4 +26,4 @@ export {
26
26
  markMVStale,
27
27
  resolveStaleMVOnRead
28
28
  };
29
- //# sourceMappingURL=stale-NB5BGRVU.js.map
29
+ //# sourceMappingURL=stale-4UNPHWOU.js.map
@@ -5,7 +5,7 @@ import {
5
5
  listCredentials,
6
6
  putCredential,
7
7
  withTeam
8
- } from "../chunk-Y5E6CH6S.js";
8
+ } from "../chunk-EW4HFWGJ.js";
9
9
  import {
10
10
  NO_TEAM,
11
11
  deriveMagicLinkContentKey,
@@ -23,7 +23,7 @@ import {
23
23
  unwrapMagicLinkGrant,
24
24
  updateAuthenticator,
25
25
  writeMagicLinkGrant
26
- } from "../chunk-4JYYIFHW.js";
26
+ } from "../chunk-QUIG6BZT.js";
27
27
  import {
28
28
  SYNC_CREDENTIALS_COLLECTION,
29
29
  buildRecipientKeyringFile,
@@ -41,7 +41,7 @@ import {
41
41
  persistKeyring,
42
42
  revoke,
43
43
  updateKeyringIdentity
44
- } from "../chunk-HVZT5T22.js";
44
+ } from "../chunk-WJDYZP3U.js";
45
45
  import "../chunk-7B4GPCX7.js";
46
46
  import {
47
47
  burnPaperRecoveryEntry,
@@ -11,7 +11,7 @@ import {
11
11
  putAtTier,
12
12
  syncDerivedOutputs,
13
13
  withTiers
14
- } from "../chunk-IU22SQGU.js";
14
+ } from "../chunk-5KI3REO3.js";
15
15
  import "../chunk-MSO2C3KG.js";
16
16
  import "../chunk-PEY6ZTCF.js";
17
17
  import "../chunk-QXPOEAKR.js";
@@ -54,7 +54,8 @@ export interface BlobsService extends BlobStrategy {
54
54
  * })
55
55
  *
56
56
  * // Now live — delegates to BlobSet.
57
- * await db.vault('acme').collection('invoices').blob('inv-1').put('receipt.pdf', bytes)
57
+ * const vault = await db.openVault('acme')
58
+ * await vault.collection('invoices').blob('inv-1').put('receipt.pdf', bytes)
58
59
  * ```
59
60
  */
60
61
  export declare function withBlobs(options?: WithBlobsOptions): BlobsService;
@@ -6,8 +6,8 @@ import {
6
6
  assertCanImport,
7
7
  canExport,
8
8
  canImport
9
- } from "../chunk-RGL53NXZ.js";
10
- import "../chunk-HVZT5T22.js";
9
+ } from "../chunk-WEC3JGBA.js";
10
+ import "../chunk-WJDYZP3U.js";
11
11
  import "../chunk-7B4GPCX7.js";
12
12
  import "../chunk-PEY6ZTCF.js";
13
13
  import "../chunk-QXPOEAKR.js";
@@ -11,7 +11,8 @@
11
11
  * historyStrategy: withHistory(), // ledger for the erasure proof
12
12
  * forgetStrategy: withForgetCascade({ subjects: { invoices: 'buyerId' } }),
13
13
  * })
14
- * const result = await db.vault('main').forget('buyer-123')
14
+ * const vault = await db.openVault('main')
15
+ * const result = await vault.forget('buyer-123')
15
16
  * ```
16
17
  *
17
18
  * The erasure flow (`vault.forget`), the subject-index maintenance hooks, and
@@ -392,3 +392,4 @@ export declare function demote<T>(ctx: TiersContext<T>, id: string, toTier: numb
392
392
  export declare function classifySealedShred<T>(ctx: TiersContext<T>, live: EncryptedEnvelope): Promise<{
393
393
  readonly slots: readonly SealedShredSlot[];
394
394
  }>;
395
+ export type { SealedShredSlot } from '../../kernel/enclave/index.js';
@@ -42,3 +42,5 @@ export type { WriteQueue } from '../kernel/write-queue.js';
42
42
  export type { WriteConflict } from '../kernel/types.js';
43
43
  export type { AccessibleVault } from '../kernel/types.js';
44
44
  export type { Unsubscribe } from '../kernel/types.js';
45
+ export type { ExtractPartitionOptions } from './extract-partition.js';
46
+ export type { TransferSealPayload } from '../with-pod/bundle.js';
@@ -4,3 +4,5 @@ export { DerivationRegistry } from './registry.js';
4
4
  export { DerivationExecutor } from './executor.js';
5
5
  export type { DerivationStrategy, DerivationStrategyHandle, DerivedFromMeta, OutputSpec, RecordOutputSpec, ArrayOutputSpec, } from './types.js';
6
6
  export { DerivationCycleError, DerivationDepthError, DerivationOutputUnknownError, DerivationOutputShapeError, DerivationCapExceededError, } from '../../kernel/errors.js';
7
+ export type { DerivationContext } from './types.js';
8
+ export type { RunResult } from './executor.js';
@@ -9,3 +9,4 @@ export type { MaterializedViewStrategy, MaterializedViewStrategyHandle, Material
9
9
  export type { RegisteredMV } from './registry.js';
10
10
  export type { MVExecutorAccessor, RefreshResult } from './executor.js';
11
11
  export { MaterializedViewCycleError, MaterializedViewConfigError, MaterializedViewSourceUnknownError, MaterializedViewTooLargeError, } from '../../kernel/errors.js';
12
+ export type { PutDerivedOutputCtx } from '../../kernel/via/dispatch.js';