@nicia-ai/typegraph 0.30.0 → 0.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (187) hide show
  1. package/README.md +39 -0
  2. package/dist/backend/postgres/index.cjs +19 -18
  3. package/dist/backend/postgres/index.d.cts +6 -6
  4. package/dist/backend/postgres/index.d.ts +6 -6
  5. package/dist/backend/postgres/index.js +9 -8
  6. package/dist/backend/postgres/pglite.cjs +13 -12
  7. package/dist/backend/postgres/pglite.cjs.map +1 -1
  8. package/dist/backend/postgres/pglite.d.cts +3 -3
  9. package/dist/backend/postgres/pglite.d.ts +3 -3
  10. package/dist/backend/postgres/pglite.js +9 -8
  11. package/dist/backend/postgres/pglite.js.map +1 -1
  12. package/dist/backend/sqlite/index.cjs +16 -16
  13. package/dist/backend/sqlite/index.d.cts +7 -7
  14. package/dist/backend/sqlite/index.d.ts +7 -7
  15. package/dist/backend/sqlite/index.js +7 -7
  16. package/dist/backend/sqlite/libsql.cjs +12 -12
  17. package/dist/backend/sqlite/libsql.d.cts +3 -3
  18. package/dist/backend/sqlite/libsql.d.ts +3 -3
  19. package/dist/backend/sqlite/libsql.js +8 -8
  20. package/dist/backend/sqlite/local.cjs +13 -13
  21. package/dist/backend/sqlite/local.d.cts +3 -3
  22. package/dist/backend/sqlite/local.d.ts +3 -3
  23. package/dist/backend/sqlite/local.js +8 -8
  24. package/dist/{chunk-3JLRHQ67.js → chunk-2BVHPOIG.js} +7 -6
  25. package/dist/chunk-2BVHPOIG.js.map +1 -0
  26. package/dist/chunk-2LAT5BIK.cjs +16277 -0
  27. package/dist/chunk-2LAT5BIK.cjs.map +1 -0
  28. package/dist/chunk-2YMGNYXY.js +40 -0
  29. package/dist/chunk-2YMGNYXY.js.map +1 -0
  30. package/dist/chunk-3EUKJEQ3.js +77 -0
  31. package/dist/chunk-3EUKJEQ3.js.map +1 -0
  32. package/dist/{chunk-WFCECD6Q.cjs → chunk-3HQDMOBK.cjs} +73 -68
  33. package/dist/chunk-3HQDMOBK.cjs.map +1 -0
  34. package/dist/chunk-3QRBXYT5.cjs +94 -0
  35. package/dist/chunk-3QRBXYT5.cjs.map +1 -0
  36. package/dist/chunk-6G35I3VW.cjs +40 -0
  37. package/dist/chunk-6G35I3VW.cjs.map +1 -0
  38. package/dist/{chunk-4BXHVEFB.cjs → chunk-6RMLO5O4.cjs} +6 -51
  39. package/dist/chunk-6RMLO5O4.cjs.map +1 -0
  40. package/dist/chunk-6ZR4QC3O.cjs +12 -0
  41. package/dist/{chunk-LUHU4T2F.cjs.map → chunk-6ZR4QC3O.cjs.map} +1 -1
  42. package/dist/chunk-73KASJGO.cjs +52 -0
  43. package/dist/chunk-73KASJGO.cjs.map +1 -0
  44. package/dist/{chunk-IUIJJYPI.js → chunk-7WW3WL6E.js} +6 -5
  45. package/dist/chunk-7WW3WL6E.js.map +1 -0
  46. package/dist/chunk-A3W7QG7K.js +45 -0
  47. package/dist/chunk-A3W7QG7K.js.map +1 -0
  48. package/dist/chunk-AW4A3P5A.cjs +51 -0
  49. package/dist/chunk-AW4A3P5A.cjs.map +1 -0
  50. package/dist/{chunk-AI3RNREM.js → chunk-C4C4Q7A6.js} +94 -496
  51. package/dist/chunk-C4C4Q7A6.js.map +1 -0
  52. package/dist/{chunk-4LBO6KIF.cjs → chunk-CAMMC3E4.cjs} +60 -59
  53. package/dist/chunk-CAMMC3E4.cjs.map +1 -0
  54. package/dist/{chunk-3IRMLJEK.js → chunk-CEF2QOTO.js} +3 -3
  55. package/dist/{chunk-3IRMLJEK.js.map → chunk-CEF2QOTO.js.map} +1 -1
  56. package/dist/{chunk-UESTHN47.cjs → chunk-CFNT3ITG.cjs} +95 -507
  57. package/dist/chunk-CFNT3ITG.cjs.map +1 -0
  58. package/dist/chunk-CWFPJ3RC.js +282 -0
  59. package/dist/chunk-CWFPJ3RC.js.map +1 -0
  60. package/dist/{chunk-7JGLPAFV.cjs → chunk-EEYV6UOE.cjs} +16 -16
  61. package/dist/chunk-EEYV6UOE.cjs.map +1 -0
  62. package/dist/{chunk-FWBVPATK.cjs → chunk-FDN43KXV.cjs} +19 -19
  63. package/dist/{chunk-FWBVPATK.cjs.map → chunk-FDN43KXV.cjs.map} +1 -1
  64. package/dist/chunk-HFBRAOF7.js +610 -0
  65. package/dist/chunk-HFBRAOF7.js.map +1 -0
  66. package/dist/chunk-HTGDWIDE.cjs +89 -0
  67. package/dist/chunk-HTGDWIDE.cjs.map +1 -0
  68. package/dist/{chunk-R4JOBEJU.js → chunk-IJORSAC3.js} +4 -40
  69. package/dist/chunk-IJORSAC3.js.map +1 -0
  70. package/dist/{chunk-WEMZM7J7.cjs → chunk-JKRKIEVA.cjs} +5 -41
  71. package/dist/chunk-JKRKIEVA.cjs.map +1 -0
  72. package/dist/{chunk-SGPXKJ4A.cjs → chunk-KTIEB7VH.cjs} +26 -16
  73. package/dist/chunk-KTIEB7VH.cjs.map +1 -0
  74. package/dist/{chunk-K4N35E7B.cjs → chunk-LAZGHOZW.cjs} +72 -71
  75. package/dist/chunk-LAZGHOZW.cjs.map +1 -0
  76. package/dist/{chunk-VFX3LC76.cjs → chunk-LM2IC4ZJ.cjs} +14 -14
  77. package/dist/{chunk-VFX3LC76.cjs.map → chunk-LM2IC4ZJ.cjs.map} +1 -1
  78. package/dist/{chunk-K5VREXMZ.js → chunk-NDM5PXEH.js} +7 -6
  79. package/dist/chunk-NDM5PXEH.js.map +1 -0
  80. package/dist/chunk-PIHXFF73.js +90 -0
  81. package/dist/chunk-PIHXFF73.js.map +1 -0
  82. package/dist/{chunk-FVIGJTS7.js → chunk-PRMKPFN5.js} +4 -74
  83. package/dist/chunk-PRMKPFN5.js.map +1 -0
  84. package/dist/chunk-SAJSMR2B.js +35 -0
  85. package/dist/chunk-SAJSMR2B.js.map +1 -0
  86. package/dist/chunk-SB65GJNY.cjs +624 -0
  87. package/dist/chunk-SB65GJNY.cjs.map +1 -0
  88. package/dist/{chunk-N2OEOGBB.js → chunk-TUA3MEJJ.js} +13 -8
  89. package/dist/chunk-TUA3MEJJ.js.map +1 -0
  90. package/dist/{chunk-MAQJYNJR.js → chunk-W4ZX2GCP.js} +14 -16
  91. package/dist/chunk-W4ZX2GCP.js.map +1 -0
  92. package/dist/chunk-WNORITK6.js +16231 -0
  93. package/dist/chunk-WNORITK6.js.map +1 -0
  94. package/dist/chunk-WWVV44DY.cjs +287 -0
  95. package/dist/chunk-WWVV44DY.cjs.map +1 -0
  96. package/dist/{chunk-IX7RE7CG.js → chunk-WYTUF3QO.js} +3 -3
  97. package/dist/{chunk-IX7RE7CG.js.map → chunk-WYTUF3QO.js.map} +1 -1
  98. package/dist/{chunk-2QA5EHEN.js → chunk-XKNAK27R.js} +3 -3
  99. package/dist/{chunk-2QA5EHEN.js.map → chunk-XKNAK27R.js.map} +1 -1
  100. package/dist/{chunk-633N7DSE.js → chunk-XQFAJVYW.js} +4 -36
  101. package/dist/chunk-XQFAJVYW.js.map +1 -0
  102. package/dist/{chunk-ENDUY2CD.js → chunk-YCV72E6L.js} +23 -17
  103. package/dist/chunk-YCV72E6L.js.map +1 -0
  104. package/dist/{chunk-26HWIIVS.cjs → chunk-YL4F3CMD.cjs} +63 -62
  105. package/dist/chunk-YL4F3CMD.cjs.map +1 -0
  106. package/dist/{chunk-IE6GN7L3.cjs → chunk-YW7GHMF4.cjs} +17 -98
  107. package/dist/chunk-YW7GHMF4.cjs.map +1 -0
  108. package/dist/{ddl-EdkIiFVU.d.ts → ddl-C8e8zDAE.d.ts} +3 -3
  109. package/dist/{ddl-BSFlbGQF.d.cts → ddl-CwyG4HoQ.d.cts} +3 -3
  110. package/dist/{extension-types-CwHV-Uk4.d.cts → extension-types-D1k0inWU.d.cts} +1 -1
  111. package/dist/{extension-types-CwHV-Uk4.d.ts → extension-types-D1k0inWU.d.ts} +1 -1
  112. package/dist/graph-extension/index.cjs +17 -17
  113. package/dist/graph-extension/index.d.cts +5 -16
  114. package/dist/graph-extension/index.d.ts +5 -16
  115. package/dist/graph-extension/index.js +2 -2
  116. package/dist/graph-merge/index.cjs +3966 -0
  117. package/dist/graph-merge/index.cjs.map +1 -0
  118. package/dist/graph-merge/index.d.cts +1191 -0
  119. package/dist/graph-merge/index.d.ts +1191 -0
  120. package/dist/graph-merge/index.js +3935 -0
  121. package/dist/graph-merge/index.js.map +1 -0
  122. package/dist/{index-DzeIiMO3.d.ts → index-BEK0VtNB.d.ts} +2 -2
  123. package/dist/{index-Ln_KHTGA.d.cts → index-C8sSTErx.d.cts} +2 -2
  124. package/dist/index.cjs +291 -15919
  125. package/dist/index.cjs.map +1 -1
  126. package/dist/index.d.cts +12 -11
  127. package/dist/index.d.ts +12 -11
  128. package/dist/index.js +24 -15791
  129. package/dist/index.js.map +1 -1
  130. package/dist/indexes/index.cjs +30 -26
  131. package/dist/indexes/index.d.cts +5 -5
  132. package/dist/indexes/index.d.ts +5 -5
  133. package/dist/indexes/index.js +6 -2
  134. package/dist/interchange/index.cjs +49 -592
  135. package/dist/interchange/index.cjs.map +1 -1
  136. package/dist/interchange/index.d.cts +9 -9
  137. package/dist/interchange/index.d.ts +9 -9
  138. package/dist/interchange/index.js +2 -588
  139. package/dist/interchange/index.js.map +1 -1
  140. package/dist/{manager-BbdyNhkv.d.ts → manager-8htmuGr-.d.ts} +3 -3
  141. package/dist/{manager-wTDgjoXG.d.cts → manager-aVgxbGt-.d.cts} +3 -3
  142. package/dist/{materialize-indexes-lkawaDor.d.ts → materialize-indexes-CAGhqPHQ.d.ts} +1 -1
  143. package/dist/{materialize-indexes-oanE3RU0.d.cts → materialize-indexes-DEYkU-wr.d.cts} +1 -1
  144. package/dist/{postgres-CK2ByP1q.d.cts → postgres-Dhom7iiX.d.ts} +1 -1
  145. package/dist/{postgres-ymXYC6Rr.d.ts → postgres-jgXmD45C.d.cts} +1 -1
  146. package/dist/profiler/index.d.cts +7 -7
  147. package/dist/profiler/index.d.ts +7 -7
  148. package/dist/result-DWo6mUVz.d.cts +37 -0
  149. package/dist/result-DWo6mUVz.d.ts +37 -0
  150. package/dist/schema/index.cjs +30 -29
  151. package/dist/schema/index.cjs.map +1 -1
  152. package/dist/schema/index.d.cts +7 -7
  153. package/dist/schema/index.d.ts +7 -7
  154. package/dist/schema/index.js +7 -6
  155. package/dist/schema/index.js.map +1 -1
  156. package/dist/{sqlite-R8YGOqVQ.d.ts → sqlite-BfLsCEqO.d.ts} +1 -1
  157. package/dist/{sqlite-DxH1lrwD.d.cts → sqlite-DcQ_BCUW.d.cts} +1 -1
  158. package/dist/{store-CNKM334w.d.ts → store-view-lTcb_cnp.d.cts} +694 -366
  159. package/dist/{store--z1Tmk7U.d.cts → store-view-pBOUrQte.d.ts} +694 -366
  160. package/dist/{types-D5B6Be5c.d.cts → types-5RQwzWXx.d.cts} +2 -2
  161. package/dist/{types-CMvxx2kd.d.ts → types-DGDiXAYc.d.ts} +2 -2
  162. package/dist/{types-BBiDqJCU.d.ts → types-Dk8r09KY.d.ts} +16 -2
  163. package/dist/{types-dL-clxO3.d.cts → types-Dvmn-eal.d.cts} +16 -2
  164. package/dist/{where-CAo6wsBZ.d.ts → where-CHZFELX0.d.ts} +2 -2
  165. package/dist/{where-bJjuOCeV.d.cts → where-Cx_glEEB.d.cts} +2 -2
  166. package/package.json +7 -2
  167. package/dist/chunk-26HWIIVS.cjs.map +0 -1
  168. package/dist/chunk-3JLRHQ67.js.map +0 -1
  169. package/dist/chunk-4BXHVEFB.cjs.map +0 -1
  170. package/dist/chunk-4LBO6KIF.cjs.map +0 -1
  171. package/dist/chunk-633N7DSE.js.map +0 -1
  172. package/dist/chunk-7JGLPAFV.cjs.map +0 -1
  173. package/dist/chunk-AI3RNREM.js.map +0 -1
  174. package/dist/chunk-ENDUY2CD.js.map +0 -1
  175. package/dist/chunk-FVIGJTS7.js.map +0 -1
  176. package/dist/chunk-IE6GN7L3.cjs.map +0 -1
  177. package/dist/chunk-IUIJJYPI.js.map +0 -1
  178. package/dist/chunk-K4N35E7B.cjs.map +0 -1
  179. package/dist/chunk-K5VREXMZ.js.map +0 -1
  180. package/dist/chunk-LUHU4T2F.cjs +0 -12
  181. package/dist/chunk-MAQJYNJR.js.map +0 -1
  182. package/dist/chunk-N2OEOGBB.js.map +0 -1
  183. package/dist/chunk-R4JOBEJU.js.map +0 -1
  184. package/dist/chunk-SGPXKJ4A.cjs.map +0 -1
  185. package/dist/chunk-UESTHN47.cjs.map +0 -1
  186. package/dist/chunk-WEMZM7J7.cjs.map +0 -1
  187. package/dist/chunk-WFCECD6Q.cjs.map +0 -1
@@ -1,9 +1,9 @@
1
+ import { K as KindRegistry, G as GraphDef, w as EdgeKinds, t as NodeKinds, v as AllNodeTypes, c as SchemaManagerOptions, d as SchemaValidationResult } from './manager-8htmuGr-.js';
2
+ import { T as TemporalMode, A as AnyEdgeType, N as NodeType, g as EdgeType, E as EdgeRegistration, e as EdgeId, d as NodeId, b as NodeRegistration, K as KindEntity, m as Cardinality, n as EndpointExistence, f as KindAnnotations, U as UniquenessScope, C as Collation, G as GraphExtension } from './extension-types-D1k0inWU.js';
1
3
  import { z } from 'zod';
2
- import { p as SqlDialect, ai as SqlSchema, F as FulltextStrategy, V as VectorStrategy, aA as VectorSlotMap, aB as ValueType, aC as PredicateExpression, aD as VectorMetricType, a1 as FulltextQueryMode, Q as QueryAst, J as JsonPointer, P as FieldRef, ad as ParameterRef, G as GraphBackend, am as TransactionBackend, a6 as JsonPointerInput, an as TraversalExpansion, aE as Traversal, aF as NodePredicate, aG as ProjectedField, ac as OrderSpec, aH as GroupBySpec, a4 as HybridFusionOptions, aI as RecursiveCyclePolicy, aJ as TraversalDirection$1, aK as EdgeRow, aL as NodeRow, W as AdoptedTransaction, L as AggregateExpr, aM as SelectiveField, aN as ComposableQuery, aO as SetOperationType, aP as SetOperation, ah as SortDirection, m as JsonSchema, aQ as VectorMetric } from './types-dL-clxO3.cjs';
3
- import { K as KindRegistry, G as GraphDef, u as EdgeKinds, x as NodeKinds, t as AllNodeTypes, c as SchemaManagerOptions, d as SchemaValidationResult } from './manager-wTDgjoXG.cjs';
4
- import { A as AnyEdgeType, N as NodeType, T as TemporalMode, d as EdgeType, E as EdgeRegistration, i as EdgeId, m as NodeId, b as NodeRegistration, K as KindEntity, f as Cardinality, g as EndpointExistence, e as KindAnnotations, U as UniquenessScope, C as Collation, G as GraphExtension } from './extension-types-CwHV-Uk4.cjs';
4
+ import { aA as ValueType, aB as PredicateExpression, aC as VectorMetricType, a1 as FulltextQueryMode, Q as QueryAst, J as JsonPointer, P as FieldRef, ad as ParameterRef, G as GraphBackend, am as TransactionBackend, a6 as JsonPointerInput, an as TraversalExpansion, p as SqlDialect, ai as SqlSchema, aD as Traversal, aE as NodePredicate, aF as ProjectedField, ac as OrderSpec, aG as GroupBySpec, a4 as HybridFusionOptions, aH as RecursiveCyclePolicy, aI as TraversalDirection$1, aJ as EdgeRow, aK as NodeRow, W as AdoptedTransaction, L as AggregateExpr, F as FulltextStrategy, V as VectorStrategy, aL as VectorSlotMap, aM as SelectiveField, aN as ComposableQuery, aO as SetOperationType, aP as SetOperation, ah as SortDirection, aQ as VectorMetric, m as JsonSchema, aR as TransactionOptions } from './types-Dk8r09KY.js';
5
5
  import { SQL } from 'drizzle-orm';
6
- import { b as MaterializeIndexesOptions, M as MaterializeIndexesResult } from './materialize-indexes-oanE3RU0.cjs';
6
+ import { b as MaterializeIndexesOptions, M as MaterializeIndexesResult } from './materialize-indexes-CAGhqPHQ.js';
7
7
 
8
8
  /**
9
9
  * Embedding type for vector search.
@@ -217,47 +217,22 @@ declare function isSearchableSchema(value: unknown): value is SearchableSchema;
217
217
  declare function getSearchableMetadata(schema: z.ZodType): SearchableMetadata | undefined;
218
218
 
219
219
  /**
220
- * Query Compiler Module
221
- *
222
- * Main entry point for compiling query ASTs to SQL.
223
- * Re-exports individual compiler modules and provides the main compile functions.
224
- */
225
-
226
- /**
227
- * Options for query compilation.
220
+ * The single opaque temporal coordinate every pinned read is resolved
221
+ * against. Today it carries only the valid-time axis; Unit 2 adds a sibling
222
+ * `recorded` axis here, and because every surface injects the coordinate
223
+ * through one helper ({@link withCoordinate}), a new axis lands on all
224
+ * surfaces at once instead of splitting by surface.
228
225
  */
229
- type CompileQueryOptions = Readonly<{
230
- /** SQL dialect ("sqlite" or "postgres"). Defaults to "sqlite". */
231
- dialect?: SqlDialect | undefined;
232
- /** SQL schema configuration for table names. Defaults to standard names. */
233
- schema?: SqlSchema | undefined;
234
- /**
235
- * Fulltext strategy override. When set, overrides the dialect's
236
- * default fulltext strategy for `$fulltext.matches()` compilation.
237
- * Callers typically read this from `backend.fulltextStrategy` so a
238
- * backend-declared strategy (e.g. ParadeDB) wins over the dialect
239
- * default (tsvector).
240
- */
241
- fulltextStrategy?: FulltextStrategy | undefined;
242
- /**
243
- * Vector strategy override. When set, `field.similarTo(...)`
244
- * predicates compile against the strategy's per-`(kind, field)`
245
- * tables and distance expression. Callers read it from
246
- * `backend.vectorStrategy` so a backend-declared strategy (pgvector,
247
- * libsql-native, sqlite-vec) drives the per-field relevance scan.
248
- */
249
- vectorStrategy?: VectorStrategy | undefined;
250
- /**
251
- * Whether the active backend supports SQL window functions such as
252
- * `ROW_NUMBER()`. Defaults to true for direct compiler callers.
253
- */
254
- windowFunctions?: boolean | undefined;
226
+ type ReadCoordinate = Readonly<{
255
227
  /**
256
- * Declared embedding slots `(kind, fieldPath) -> descriptor` used by
257
- * the `field.similarTo(...)` CTE to know which kinds in an alias
258
- * declare the field. Callers build it from the graph's node schemas.
228
+ * The valid-time axis: a resolved temporal mode and (only for `"asOf"`) the
229
+ * instant it is pinned to.
259
230
  */
260
- vectorSlots?: VectorSlotMap | undefined;
231
+ valid: Readonly<{
232
+ mode: TemporalMode;
233
+ /** Defined only when `mode` is `"asOf"`. */
234
+ asOf?: string;
235
+ }>;
261
236
  }>;
262
237
 
263
238
  type FieldTypeInfo = Readonly<{
@@ -887,6 +862,12 @@ type QueryBuilderConfig = Readonly<{
887
862
  dialect?: SqlDialect;
888
863
  /** SQL schema configuration for custom table names. */
889
864
  schema?: SqlSchema;
865
+ /**
866
+ * When set, the builder is pinned to a {@link StoreView}'s coordinate and
867
+ * its temporal axis is sealed: `.temporal(...)` throws. Threaded verbatim
868
+ * through every builder clone, so the seal survives the whole fluent chain.
869
+ */
870
+ sealedCoordinate?: ReadCoordinate;
890
871
  }>;
891
872
  /**
892
873
  * Internal state of the query builder.
@@ -929,6 +910,12 @@ type CreateQueryBuilderOptions = Readonly<{
929
910
  schema?: SqlSchema;
930
911
  /** Default traversal ontology expansion mode (default: "inverse"). */
931
912
  defaultTraversalExpansion?: TraversalExpansion;
913
+ /**
914
+ * Pin the builder to a {@link StoreView} coordinate and seal its temporal
915
+ * axis. Seeds the initial `temporalMode` / `asOf` and makes `.temporal(...)`
916
+ * throw. Used by `store.view(...).query()`.
917
+ */
918
+ sealedCoordinate?: ReadCoordinate;
932
919
  }>;
933
920
 
934
921
  /**
@@ -1218,7 +1205,7 @@ type EdgeGetOrCreateByEndpointsResult<E extends AnyEdgeType, From extends NodeTy
1218
1205
  type EdgeFindByEndpointsOptions<E extends AnyEdgeType> = Readonly<{
1219
1206
  /**
1220
1207
  * Edge property fields to include in the match alongside the (from, to) endpoints.
1221
- * When omitted, matches on endpoints only (returns first live edge).
1208
+ * When omitted, matches on endpoints only (returns the first edge at the read coordinate).
1222
1209
  */
1223
1210
  matchOn?: readonly (keyof z.input<E["schema"]>)[];
1224
1211
  /** Property values to match against when matchOn is specified. */
@@ -1276,15 +1263,13 @@ type NodeCollection<N extends NodeType, CN extends string = string> = Readonly<{
1276
1263
  * Supports predicate filtering via the `where` option for SQL-level filtering.
1277
1264
  * For simple queries. Use store.query() for complex traversals.
1278
1265
  */
1279
- find: (options?: Readonly<{
1266
+ find: (filter?: Readonly<{
1280
1267
  where?: (accessor: NodeAccessor<N>) => Predicate;
1281
1268
  limit?: number;
1282
1269
  offset?: number;
1283
- temporalMode?: TemporalMode;
1284
- asOf?: string;
1285
- }>) => Promise<Node<N>[]>;
1270
+ }>, temporal?: QueryOptions) => Promise<Node<N>[]>;
1286
1271
  /** Count nodes matching criteria */
1287
- count: (options?: QueryOptions) => Promise<number>;
1272
+ count: (temporal?: QueryOptions) => Promise<number>;
1288
1273
  /**
1289
1274
  * Create a node from untyped data, relying on runtime Zod validation.
1290
1275
  *
@@ -1495,29 +1480,43 @@ type EdgeCollection<E extends AnyEdgeType, From extends NodeType = NodeType, To
1495
1480
  update: (id: EdgeId<E>, props: Partial<z.input<E["schema"]>>, options?: Readonly<{
1496
1481
  validTo?: string;
1497
1482
  }>) => Promise<Edge<E, From, To>>;
1498
- /** Find edges from a specific node */
1499
- findFrom: (from: NodeRef<From>) => Promise<Edge<E, From, To>[]>;
1500
- /** Find edges to a specific node */
1501
- findTo: (to: NodeRef<To>) => Promise<Edge<E, From, To>[]>;
1483
+ /**
1484
+ * Find edges from a specific node.
1485
+ *
1486
+ * Honors the same temporal model as `getById` / `find`: with no
1487
+ * `options`, the graph's default `temporalMode` applies (excluding
1488
+ * soft-deleted edges and, in `current` / `asOf` modes, edges outside
1489
+ * their validity window). Pass `temporalMode` / `asOf` to read the
1490
+ * endpoint's edges at another temporal coordinate.
1491
+ */
1492
+ findFrom: (from: NodeRef<From>, options?: QueryOptions) => Promise<Edge<E, From, To>[]>;
1493
+ /**
1494
+ * Find edges to a specific node.
1495
+ *
1496
+ * Temporal semantics mirror {@link EdgeCollection.findFrom}.
1497
+ */
1498
+ findTo: (to: NodeRef<To>, options?: QueryOptions) => Promise<Edge<E, From, To>[]>;
1502
1499
  /**
1503
1500
  * Deferred variant of `findFrom` for use with `store.batch()`.
1504
1501
  *
1505
- * Returns a `BatchableQuery` instead of executing immediately.
1502
+ * Returns a `BatchableQuery` instead of executing immediately. Accepts
1503
+ * the same temporal `options` as {@link EdgeCollection.findFrom}.
1506
1504
  */
1507
- batchFindFrom: (from: NodeRef<From>) => BatchableQuery<Edge<E, From, To>>;
1505
+ batchFindFrom: (from: NodeRef<From>, options?: QueryOptions) => BatchableQuery<Edge<E, From, To>>;
1508
1506
  /**
1509
1507
  * Deferred variant of `findTo` for use with `store.batch()`.
1510
1508
  *
1511
- * Returns a `BatchableQuery` instead of executing immediately.
1509
+ * Returns a `BatchableQuery` instead of executing immediately. Accepts
1510
+ * the same temporal `options` as {@link EdgeCollection.findTo}.
1512
1511
  */
1513
- batchFindTo: (to: NodeRef<To>) => BatchableQuery<Edge<E, From, To>>;
1512
+ batchFindTo: (to: NodeRef<To>, options?: QueryOptions) => BatchableQuery<Edge<E, From, To>>;
1514
1513
  /**
1515
1514
  * Deferred variant of `findByEndpoints` for use with `store.batch()`.
1516
1515
  *
1517
1516
  * Returns a `BatchableQuery` that yields a 0-or-1 element array
1518
1517
  * (matching `findByEndpoints`' at-most-one semantics).
1519
1518
  */
1520
- batchFindByEndpoints: (from: NodeRef<From>, to: NodeRef<To>, options?: EdgeFindByEndpointsOptions<E>) => BatchableQuery<Edge<E, From, To>>;
1519
+ batchFindByEndpoints: (from: NodeRef<From>, to: NodeRef<To>, options?: EdgeFindByEndpointsOptions<E>, temporal?: QueryOptions) => BatchableQuery<Edge<E, From, To>>;
1521
1520
  /** Delete an edge (soft delete - sets deletedAt timestamp) */
1522
1521
  delete: (id: EdgeId<E>) => Promise<void>;
1523
1522
  /**
@@ -1531,21 +1530,17 @@ type EdgeCollection<E extends AnyEdgeType, From extends NodeType = NodeType, To
1531
1530
  */
1532
1531
  hardDelete: (id: EdgeId<E>) => Promise<void>;
1533
1532
  /** Find edges matching endpoint and pagination criteria */
1534
- find: (options?: Readonly<{
1533
+ find: (filter?: Readonly<{
1535
1534
  from?: NodeRef<From>;
1536
1535
  to?: NodeRef<To>;
1537
1536
  limit?: number;
1538
1537
  offset?: number;
1539
- temporalMode?: TemporalMode;
1540
- asOf?: string;
1541
- }>) => Promise<Edge<E, From, To>[]>;
1538
+ }>, temporal?: QueryOptions) => Promise<Edge<E, From, To>[]>;
1542
1539
  /** Count edges matching criteria */
1543
- count: (options?: Readonly<{
1540
+ count: (filter?: Readonly<{
1544
1541
  from?: NodeRef<From>;
1545
1542
  to?: NodeRef<To>;
1546
- temporalMode?: TemporalMode;
1547
- asOf?: string;
1548
- }>) => Promise<number>;
1543
+ }>, temporal?: QueryOptions) => Promise<number>;
1549
1544
  /**
1550
1545
  * Create multiple edges in a batch.
1551
1546
  *
@@ -1597,16 +1592,22 @@ type EdgeCollection<E extends AnyEdgeType, From extends NodeType = NodeType, To
1597
1592
  */
1598
1593
  bulkDelete: (ids: readonly EdgeId<E>[]) => Promise<void>;
1599
1594
  /**
1600
- * Find a live edge by endpoints and optional property fields.
1595
+ * Find an edge by endpoints and optional property fields.
1601
1596
  *
1602
- * Returns the first matching live edge, or undefined.
1603
- * Soft-deleted edges are excluded.
1597
+ * Returns the first matching edge at the read coordinate, or undefined.
1598
+ * Honors the temporal model like `findFrom` / `findTo`: by default
1599
+ * (`current` mode) soft-deleted and out-of-window edges are excluded; under
1600
+ * `includeTombstones` a soft-deleted edge can be returned.
1604
1601
  *
1605
1602
  * @param from - Source node
1606
1603
  * @param to - Target node
1607
1604
  * @param options - Match criteria (matchOn fields and property values)
1605
+ * @param temporal - Temporal coordinate. With no `temporal`, the graph's
1606
+ * default `temporalMode` applies (so under the default `"current"` mode,
1607
+ * edges outside their validity window are excluded). Pass
1608
+ * `temporalMode` / `asOf` to read the edge as of another coordinate.
1608
1609
  */
1609
- findByEndpoints: (from: NodeRef<From>, to: NodeRef<To>, options?: EdgeFindByEndpointsOptions<E>) => Promise<Edge<E, From, To> | undefined>;
1610
+ findByEndpoints: (from: NodeRef<From>, to: NodeRef<To>, options?: EdgeFindByEndpointsOptions<E>, temporal?: QueryOptions) => Promise<Edge<E, From, To> | undefined>;
1610
1611
  /**
1611
1612
  * Get an existing edge by endpoints and optional property fields, or create a new one.
1612
1613
  *
@@ -1663,6 +1664,104 @@ type GraphNodeCollections<G extends GraphDef> = {
1663
1664
  type GraphEdgeCollections<G extends GraphDef> = {
1664
1665
  [K in keyof G["edges"] & string]-?: TypedEdgeCollection<G["edges"][K]>;
1665
1666
  };
1667
+ /** Temporal-aware node reads — a {@link StoreView} pins these. */
1668
+ type NodeTemporalReads<N extends NodeType, CN extends string = string> = Pick<NodeCollection<N, CN>, "getById" | "getByIds" | "find" | "count">;
1669
+ /**
1670
+ * The method names of the current-state-only node reads (constraint / index
1671
+ * lookups). Single source of truth: {@link NodeCurrentReads} (the type) and the
1672
+ * `StoreView`'s runtime routing Set are both derived from this array, so adding
1673
+ * a current-only read here updates both at once — a new read cannot pass the
1674
+ * type partition yet be misrouted at runtime (refused as a write).
1675
+ */
1676
+ declare const CURRENT_ONLY_READ_NAMES: readonly ["findByConstraint", "bulkFindByConstraint", "bulkFindByIndex"];
1677
+ /**
1678
+ * Current-state-only node reads (constraint / index lookups). No temporal
1679
+ * axis, so a {@link StoreView} delegates them on a `current` pin and refuses
1680
+ * them on a temporal pin.
1681
+ */
1682
+ type NodeCurrentReads<N extends NodeType, CN extends string = string> = Pick<NodeCollection<N, CN>, (typeof CURRENT_ONLY_READ_NAMES)[number]>;
1683
+ /** Node writes — never available on a read-only {@link StoreView}. */
1684
+ type NodeWrites<N extends NodeType, CN extends string = string> = Pick<NodeCollection<N, CN>, "create" | "createFromRecord" | "update" | "delete" | "hardDelete" | "upsertById" | "upsertByIdFromRecord" | "bulkCreate" | "bulkUpsertById" | "bulkInsert" | "bulkDelete" | "getOrCreateByConstraint" | "bulkGetOrCreateByConstraint">;
1685
+ /**
1686
+ * Temporal-aware edge reads — a {@link StoreView} pins these. Unlike the node
1687
+ * collection, edges have no current-state-only reads: `findByEndpoints` honors
1688
+ * the temporal coordinate like `findFrom` / `findTo`, so every edge read is
1689
+ * pinnable.
1690
+ */
1691
+ type EdgeTemporalReads<E extends AnyEdgeType, From extends NodeType = NodeType, To extends NodeType = NodeType> = Pick<EdgeCollection<E, From, To>, "getById" | "getByIds" | "find" | "count" | "findFrom" | "findTo" | "findByEndpoints">;
1692
+ /**
1693
+ * Deferred edge reads for `store.batch()` — absent from a {@link StoreView},
1694
+ * which has no batch context.
1695
+ */
1696
+ type EdgeBatchReads<E extends AnyEdgeType, From extends NodeType = NodeType, To extends NodeType = NodeType> = Pick<EdgeCollection<E, From, To>, "batchFindFrom" | "batchFindTo" | "batchFindByEndpoints">;
1697
+ /** Edge writes — never available on a read-only {@link StoreView}. */
1698
+ type EdgeWrites<E extends AnyEdgeType, From extends NodeType = NodeType, To extends NodeType = NodeType> = Pick<EdgeCollection<E, From, To>, "create" | "update" | "delete" | "hardDelete" | "bulkCreate" | "bulkUpsertById" | "bulkInsert" | "bulkDelete" | "getOrCreateByEndpoints" | "bulkGetOrCreateByEndpoints">;
1699
+ /**
1700
+ * The read-only node surface a {@link StoreView} exposes for one node kind.
1701
+ * The temporal reads drop the per-call temporal argument — the pin owns the
1702
+ * axis; the current reads ({@link NodeCurrentReads}) are exposed as-is
1703
+ * (delegated on a `current` view, refused on a temporal pin). Writes live on
1704
+ * the live `Store`. The conformance test asserts the temporal part equals the
1705
+ * pinned form of {@link NodeTemporalReads}.
1706
+ */
1707
+ type StoreViewNodeCollection<N extends NodeType, CN extends string = string> = Readonly<{
1708
+ /** Get a node by ID at the view's pinned coordinate. */
1709
+ getById: (id: NodeId<N>) => Promise<Node<N> | undefined>;
1710
+ /** Get multiple nodes by ID, preserving input order (undefined for missing). */
1711
+ getByIds: (ids: readonly NodeId<N>[]) => Promise<readonly (Node<N> | undefined)[]>;
1712
+ /** Find nodes matching criteria at the view's pinned coordinate. */
1713
+ find: (filter?: Readonly<{
1714
+ where?: (accessor: NodeAccessor<N>) => Predicate;
1715
+ limit?: number;
1716
+ offset?: number;
1717
+ }>) => Promise<Node<N>[]>;
1718
+ /** Count nodes at the view's pinned coordinate. */
1719
+ count: () => Promise<number>;
1720
+ }> & NodeCurrentReads<N, CN>;
1721
+ /**
1722
+ * The read-only edge surface a {@link StoreView} exposes for one edge
1723
+ * kind, mirroring {@link StoreViewNodeCollection}. Every edge read —
1724
+ * including `findByEndpoints` — honors the pin via the same temporal model,
1725
+ * so (unlike nodes) there are no current-state-only edge reads.
1726
+ */
1727
+ type StoreViewEdgeCollection<E extends AnyEdgeType, From extends NodeType = NodeType, To extends NodeType = NodeType> = Readonly<{
1728
+ /** Get an edge by ID at the view's pinned coordinate. */
1729
+ getById: (id: EdgeId<E>) => Promise<Edge<E, From, To> | undefined>;
1730
+ /** Get multiple edges by ID, preserving input order (undefined for missing). */
1731
+ getByIds: (ids: readonly EdgeId<E>[]) => Promise<readonly (Edge<E, From, To> | undefined)[]>;
1732
+ /** Find edges matching endpoint and pagination criteria. */
1733
+ find: (filter?: Readonly<{
1734
+ from?: NodeRef<From>;
1735
+ to?: NodeRef<To>;
1736
+ limit?: number;
1737
+ offset?: number;
1738
+ }>) => Promise<Edge<E, From, To>[]>;
1739
+ /** Count edges matching criteria at the view's pinned coordinate. */
1740
+ count: (filter?: Readonly<{
1741
+ from?: NodeRef<From>;
1742
+ to?: NodeRef<To>;
1743
+ }>) => Promise<number>;
1744
+ /** Find edges from a specific node at the view's pinned coordinate. */
1745
+ findFrom: (from: NodeRef<From>) => Promise<Edge<E, From, To>[]>;
1746
+ /** Find edges to a specific node at the view's pinned coordinate. */
1747
+ findTo: (to: NodeRef<To>) => Promise<Edge<E, From, To>[]>;
1748
+ /** Find the edge between two endpoints at the view's pinned coordinate. */
1749
+ findByEndpoints: (from: NodeRef<From>, to: NodeRef<To>, options?: EdgeFindByEndpointsOptions<E>) => Promise<Edge<E, From, To> | undefined>;
1750
+ }>;
1751
+ /**
1752
+ * Read-only view edge collection derived from an `EdgeRegistration`,
1753
+ * extracting the edge type and from/to node types — the read-only
1754
+ * counterpart of {@link TypedEdgeCollection}.
1755
+ */
1756
+ type TypedStoreViewEdgeCollection<R extends EdgeRegistration> = StoreViewEdgeCollection<R["type"], EdgeFromTypes<R> extends NodeType ? EdgeFromTypes<R> : NodeType, EdgeToTypes<R> extends NodeType ? EdgeToTypes<R> : NodeType>;
1757
+ /** Mapped type of all read-only view node collections for a graph. */
1758
+ type StoreViewNodeCollections<G extends GraphDef> = {
1759
+ [K in keyof G["nodes"] & string]-?: StoreViewNodeCollection<G["nodes"][K]["type"]>;
1760
+ };
1761
+ /** Mapped type of all read-only view edge collections for a graph. */
1762
+ type StoreViewEdgeCollections<G extends GraphDef> = {
1763
+ [K in keyof G["edges"] & string]-?: TypedStoreViewEdgeCollection<G["edges"][K]>;
1764
+ };
1666
1765
  /**
1667
1766
  * A typed transaction context with collection API.
1668
1767
  *
@@ -1717,6 +1816,13 @@ type TransactionContext<G extends GraphDef> = Readonly<{
1717
1816
  nodes: GraphNodeCollections<G>;
1718
1817
  edges: GraphEdgeCollections<G>;
1719
1818
  sql?: AdoptedTransaction;
1819
+ /**
1820
+ * The transaction-scoped backend the collections are bound to, for advanced
1821
+ * raw reads that must observe the transaction's snapshot (e.g. graph-merge's
1822
+ * in-transaction base@V re-validation). On the non-transactional fallback it
1823
+ * is the store's plain backend — reads work, but there is no snapshot.
1824
+ */
1825
+ backend: TransactionBackend;
1720
1826
  }>;
1721
1827
  /**
1722
1828
  * Replace branded `NodeId` / `EdgeId` with plain `string` in each
@@ -1802,253 +1908,99 @@ type StoreProjection<G extends GraphDef, N extends keyof G["nodes"] & string = n
1802
1908
  }>;
1803
1909
 
1804
1910
  /**
1805
- * Discriminated union of all Node runtime types in a graph.
1806
- *
1807
- * Unlike `AllNodeTypes<G>` which gives the union of *type definitions*,
1808
- * `AnyNode<G>` gives the union of *runtime node instances*.
1809
- */
1810
- type AnyNode<G extends GraphDef> = {
1811
- [K in NodeKinds<G>]: Node<G["nodes"][K]["type"]>;
1812
- }[NodeKinds<G>];
1813
- /**
1814
- * Discriminated union of all Edge runtime types in a graph.
1911
+ * ExecutableAggregateQuery - A query with aggregate functions that can be executed.
1815
1912
  */
1816
- type AnyEdge<G extends GraphDef> = {
1817
- [K in EdgeKinds<G>]: Edge<G["edges"][K]["type"]>;
1818
- }[EdgeKinds<G>];
1913
+
1819
1914
  /**
1820
- * Discriminated union of Node runtime types narrowed to a subset of kinds.
1915
+ * Result type for aggregate queries.
1916
+ * Maps field refs to their value types and aggregates to numbers.
1821
1917
  */
1822
- type SubsetNode<G extends GraphDef, K extends NodeKinds<G>> = {
1823
- [Kind in K]: Node<G["nodes"][Kind]["type"]>;
1824
- }[K];
1918
+ type AggregateResult<R extends Record<string, FieldRef | AggregateExpr>> = {
1919
+ [K in keyof R]: R[K] extends AggregateExpr ? number : R[K] extends FieldRef ? unknown : never;
1920
+ };
1825
1921
  /**
1826
- * Discriminated union of Edge runtime types narrowed to a subset of kinds.
1922
+ * An aggregate query that can be executed.
1827
1923
  */
1828
- type SubsetEdge<G extends GraphDef, K extends EdgeKinds<G>> = {
1829
- [Kind in K]: Edge<G["edges"][Kind]["type"]>;
1830
- }[K];
1831
- type EmptyShape = Readonly<Record<never, never>>;
1832
- type NodeProjectionPropertyKey<N extends NodeType> = Exclude<keyof Node<N>, "id" | "kind" | "meta"> & string;
1833
- type EdgeProjectionPropertyKey<E extends AnyEdgeType> = Exclude<keyof Edge<E>, "id" | "kind" | "fromKind" | "fromId" | "toKind" | "toId" | "meta"> & string;
1834
- type SubgraphNodeProjectionField<N extends NodeType = NodeType> = NodeProjectionPropertyKey<N> | "meta";
1835
- type SubgraphEdgeProjectionField<E extends AnyEdgeType = AnyEdgeType> = EdgeProjectionPropertyKey<E> | "meta";
1836
- type SubgraphNodeProjectionMap<G extends GraphDef, NK extends NodeKinds<G> = NodeKinds<G>> = Readonly<{
1837
- [K in NodeKinds<G>]?: K extends NK ? readonly SubgraphNodeProjectionField<G["nodes"][K]["type"]>[] : never;
1838
- }>;
1839
- type SubgraphEdgeProjectionMap<G extends GraphDef, EK extends EdgeKinds<G> = EdgeKinds<G>> = Readonly<{
1840
- [K in EdgeKinds<G>]?: K extends EK ? readonly SubgraphEdgeProjectionField<G["edges"][K]["type"]>[] : never;
1841
- }>;
1842
- type SubgraphProject<G extends GraphDef, NK extends NodeKinds<G> = NodeKinds<G>, EK extends EdgeKinds<G> = EdgeKinds<G>> = Readonly<{
1924
+ declare class ExecutableAggregateQuery<G extends GraphDef, Aliases extends AliasMap, R extends Record<string, FieldRef | AggregateExpr>> {
1925
+ #private;
1926
+ constructor(config: QueryBuilderConfig, state: QueryBuilderState, fields: R);
1843
1927
  /**
1844
- * Node fields to keep per kind.
1845
- *
1846
- * Projected nodes always retain `kind` and `id`.
1847
- * Use `"meta"` to include the full metadata object; omit it to exclude metadata entirely.
1848
- * Only kinds present in `includeKinds` (or all node kinds when omitted) are valid keys.
1928
+ * Builds the query AST.
1849
1929
  */
1850
- nodes?: SubgraphNodeProjectionMap<G, NK>;
1930
+ toAst(): QueryAst;
1851
1931
  /**
1852
- * Edge fields to keep per kind.
1853
- *
1854
- * Projected edges always retain `id`, `kind`, `fromKind`, `fromId`,
1855
- * `toKind`, and `toId`.
1856
- * Use `"meta"` to include the full metadata object; omit it to exclude metadata entirely.
1857
- * Only edge kinds listed in `edges` are valid keys.
1932
+ * Limits the number of results.
1858
1933
  */
1859
- edges?: SubgraphEdgeProjectionMap<G, EK>;
1860
- }>;
1861
- /**
1862
- * Identity function that preserves literal types for reusable projection configs.
1863
- *
1864
- * Without this helper, storing a projection in a typed variable widens the
1865
- * field arrays to `string[]`, defeating compile-time narrowing on results.
1866
- *
1867
- * @example
1868
- * ```ts
1869
- * const project = defineSubgraphProject(graph)({
1870
- * nodes: { Task: ["title", "meta"] },
1871
- * edges: { uses_skill: [] },
1872
- * });
1873
- * const result = await store.subgraph(rootId, { edges: ["uses_skill"], project });
1874
- * // result.nodes narrowed correctly — task.status is a type error
1875
- * ```
1876
- */
1877
- declare function defineSubgraphProject<G extends GraphDef>(_graph: G): <const P extends SubgraphProject<G>>(project: P) => P;
1878
- type HasMeta<Selection extends readonly string[] | undefined> = Selection extends readonly string[] ? "meta" extends Selection[number] ? true : false : false;
1879
- type SelectedNodeProps<N extends NodeType, Selection extends readonly string[] | undefined> = Selection extends readonly string[] ? Pick<Node<N>, Extract<Selection[number], NodeProjectionPropertyKey<N>>> : EmptyShape;
1880
- type SelectedEdgeProps<E extends AnyEdgeType, Selection extends readonly string[] | undefined> = Selection extends readonly string[] ? Pick<Edge<E>, Extract<Selection[number], EdgeProjectionPropertyKey<E>>> : EmptyShape;
1881
- type ProjectedNodeResult<N extends NodeType, Selection extends readonly string[] | undefined> = Readonly<Pick<Node<N>, "id" | "kind">> & Readonly<SelectedNodeProps<N, Selection>> & (HasMeta<Selection> extends true ? Readonly<{
1882
- meta: NodeMeta;
1883
- }> : EmptyShape);
1884
- type ProjectedEdgeResult<E extends AnyEdgeType, Selection extends readonly string[] | undefined> = Readonly<Pick<Edge<E>, "id" | "kind" | "fromKind" | "fromId" | "toKind" | "toId">> & Readonly<SelectedEdgeProps<E, Selection>> & (HasMeta<Selection> extends true ? Readonly<{
1885
- meta: EdgeMeta;
1886
- }> : EmptyShape);
1887
- type ProjectionSelection<P, Key extends "nodes" | "edges", Kind extends string> = P extends Readonly<{
1888
- [K in Key]?: infer Map;
1889
- }> ? Map extends Readonly<Record<string, readonly string[] | undefined>> ? Kind extends keyof Map ? Map[Kind] : undefined : undefined : undefined;
1890
- type SubgraphNodeResultForKind<G extends GraphDef, Kind extends NodeKinds<G>, P> = ProjectionSelection<P, "nodes", Kind> extends readonly string[] ? ProjectedNodeResult<G["nodes"][Kind]["type"], ProjectionSelection<P, "nodes", Kind>> : Node<G["nodes"][Kind]["type"]>;
1891
- type SubgraphEdgeResultForKind<G extends GraphDef, Kind extends EdgeKinds<G>, P> = ProjectionSelection<P, "edges", Kind> extends readonly string[] ? ProjectedEdgeResult<G["edges"][Kind]["type"], ProjectionSelection<P, "edges", Kind>> : Edge<G["edges"][Kind]["type"]>;
1892
- type SubgraphOptions<G extends GraphDef, EK extends EdgeKinds<G>, NK extends NodeKinds<G>, P extends SubgraphProject<G, NK, EK> | undefined = undefined> = Readonly<{
1893
- /** Edge kinds to follow during traversal. Edges not listed are not traversed. */
1894
- edges: readonly EK[];
1895
- /** Maximum traversal depth from root (default: 10). */
1896
- maxDepth?: number;
1934
+ limit(n: number): ExecutableAggregateQuery<G, Aliases, R>;
1897
1935
  /**
1898
- * Node kinds to include in the result. Nodes of other kinds are still
1899
- * traversed through but omitted from the output. When omitted, all
1900
- * reachable node kinds are included.
1936
+ * Offsets the results.
1901
1937
  */
1902
- includeKinds?: readonly NK[];
1903
- /** Exclude the root node from the result (default: false). */
1904
- excludeRoot?: boolean;
1938
+ offset(n: number): ExecutableAggregateQuery<G, Aliases, R>;
1905
1939
  /**
1906
- * Edge direction policy (default: "out").
1907
- * - "out": follow edges in their defined direction only
1908
- * - "both": follow edges in both directions (undirected traversal)
1940
+ * Compiles the query and returns the SQL text and parameters.
1941
+ *
1942
+ * Requires a backend to be configured (the backend determines the SQL dialect).
1943
+ * Use this for debugging, logging, or running the query with a custom executor.
1909
1944
  */
1910
- direction?: "out" | "both";
1911
- /** Cycle policy — reuse RecursiveCyclePolicy (default: "prevent"). */
1912
- cyclePolicy?: RecursiveCyclePolicy;
1945
+ toSQL(): Readonly<{
1946
+ sql: string;
1947
+ params: readonly unknown[];
1948
+ }>;
1913
1949
  /**
1914
- * Temporal mode applied to both nodes and edges along the traversal and in
1915
- * the hydrated result. Defaults to `graph.defaults.temporalMode`.
1950
+ * Compiles the query to a Drizzle SQL object.
1916
1951
  */
1917
- temporalMode?: TemporalMode;
1918
- /** ISO-8601 timestamp used when `temporalMode === "asOf"`. */
1919
- asOf?: string;
1952
+ compile(): SQL;
1920
1953
  /**
1921
- * Optional field-level projection per node/edge kind.
1922
- *
1923
- * Projected nodes keep `kind` and `id`; projected edges keep their structural
1924
- * endpoint fields. Kinds omitted from `project` remain fully hydrated.
1925
- * Projection applies to every returned entity, including the root node.
1954
+ * Executes the query and returns typed results.
1926
1955
  *
1927
- * Only kinds present in `includeKinds` (nodes) or `edges` (edges) are valid
1928
- * projection keys. Specifying a kind outside those sets is a compile-time error.
1956
+ * @throws Error if no backend is configured
1929
1957
  */
1930
- project?: P;
1931
- }>;
1932
- /**
1933
- * Union of all node result types in a subgraph, respecting projection.
1934
- */
1935
- type SubgraphNodeResult<G extends GraphDef, NK extends NodeKinds<G> = NodeKinds<G>, P = undefined> = {
1936
- [Kind in NK]: SubgraphNodeResultForKind<G, Kind, P>;
1937
- }[NK];
1938
- /**
1939
- * Union of all edge result types in a subgraph, respecting projection.
1940
- */
1941
- type SubgraphEdgeResult<G extends GraphDef, EK extends EdgeKinds<G> = EdgeKinds<G>, P = undefined> = {
1942
- [Kind in EK]: SubgraphEdgeResultForKind<G, Kind, P>;
1943
- }[EK];
1944
- type SubgraphResult<G extends GraphDef, NK extends NodeKinds<G> = NodeKinds<G>, EK extends EdgeKinds<G> = EdgeKinds<G>, P extends SubgraphProject<G, NK, EK> | undefined = undefined> = Readonly<{
1945
- /** The root node, or undefined if the root was not found or excluded. */
1946
- root: SubgraphNodeResult<G, NK, P> | undefined;
1947
- nodes: ReadonlyMap<string, SubgraphNodeResult<G, NK, P>>;
1948
- /** Forward adjacency: fromId → edgeKind → edges to targets. */
1949
- adjacency: ReadonlyMap<string, ReadonlyMap<EK, readonly SubgraphEdgeResult<G, EK, P>[]>>;
1950
- /** Reverse adjacency: toId → edgeKind → edges from sources. */
1951
- reverseAdjacency: ReadonlyMap<string, ReadonlyMap<EK, readonly SubgraphEdgeResult<G, EK, P>[]>>;
1952
- }>;
1958
+ execute(): Promise<readonly AggregateResult<R>[]>;
1959
+ }
1953
1960
 
1954
1961
  /**
1955
- * Data-cleanup phase for `store.removeKinds()`.
1962
+ * Query Compiler Module
1956
1963
  *
1957
- * The removeKinds verb commits the new schema atomically (millisecond
1958
- * budget); the data deletion happens here, scoped per-deployment via
1959
- * the `typegraph_kind_removals` status table. Splitting the verbs
1960
- * mirrors how `materializeIndexes` complements `evolve`: schema
1961
- * commits are atomic and fast, data work is bounded by row count and
1962
- * deferrable / parallelizable.
1964
+ * Main entry point for compiling query ASTs to SQL.
1965
+ * Re-exports individual compiler modules and provides the main compile functions.
1963
1966
  */
1964
1967
 
1965
- type MaterializeRemovalsOptions = Readonly<{
1966
- /** Restrict to specific kind names. */
1967
- kinds?: readonly string[];
1968
- /** Halt on first failure. Default: false (best-effort). */
1969
- stopOnError?: boolean;
1970
- }>;
1971
- type MaterializeRemovalsEntry = Readonly<{
1972
- kind: string;
1973
- entity: KindEntity;
1974
- status: "removed" | "failed";
1975
- error?: Error;
1976
- }>;
1977
- /**
1978
- * Outcome of reclaiming one per-`(graphId, kind, field)` vector table that
1979
- * was orphaned when its embedding field was dropped from a *surviving*
1980
- * kind's schema. Distinct from {@link MaterializeRemovalsEntry} (whole
1981
- * kinds) because the unit is a single embedding field, not a kind.
1982
- */
1983
- type ReclaimedVectorFieldEntry = Readonly<{
1984
- kind: string;
1985
- fieldPath: string;
1986
- status: "reclaimed" | "failed";
1987
- error?: Error;
1988
- }>;
1989
- type MaterializeRemovalsResult = Readonly<{
1990
- results: readonly MaterializeRemovalsEntry[];
1991
- /**
1992
- * Embedding fields removed from a *surviving* kind whose per-field vector
1993
- * table this pass dropped (or confirmed already absent). Empty when the
1994
- * backend has no vector strategy or no embedding field has ever been
1995
- * dropped. Re-derived from immutable schema history each call, so it lists
1996
- * the same removed fields on repeat passes — the underlying drop is
1997
- * idempotent (`DROP ... IF EXISTS`). See {@link reclaimRemovedVectorFieldTables}.
1998
- */
1999
- reclaimedVectorFields: readonly ReclaimedVectorFieldEntry[];
2000
- }>;
2001
-
2002
- /**
2003
- * ExecutableAggregateQuery - A query with aggregate functions that can be executed.
2004
- */
2005
-
2006
- /**
2007
- * Result type for aggregate queries.
2008
- * Maps field refs to their value types and aggregates to numbers.
2009
- */
2010
- type AggregateResult<R extends Record<string, FieldRef | AggregateExpr>> = {
2011
- [K in keyof R]: R[K] extends AggregateExpr ? number : R[K] extends FieldRef ? unknown : never;
2012
- };
2013
1968
  /**
2014
- * An aggregate query that can be executed.
1969
+ * Options for query compilation.
2015
1970
  */
2016
- declare class ExecutableAggregateQuery<G extends GraphDef, Aliases extends AliasMap, R extends Record<string, FieldRef | AggregateExpr>> {
2017
- #private;
2018
- constructor(config: QueryBuilderConfig, state: QueryBuilderState, fields: R);
2019
- /**
2020
- * Builds the query AST.
2021
- */
2022
- toAst(): QueryAst;
2023
- /**
2024
- * Limits the number of results.
2025
- */
2026
- limit(n: number): ExecutableAggregateQuery<G, Aliases, R>;
1971
+ type CompileQueryOptions = Readonly<{
1972
+ /** SQL dialect ("sqlite" or "postgres"). Defaults to "sqlite". */
1973
+ dialect?: SqlDialect | undefined;
1974
+ /** SQL schema configuration for table names. Defaults to standard names. */
1975
+ schema?: SqlSchema | undefined;
2027
1976
  /**
2028
- * Offsets the results.
1977
+ * Fulltext strategy override. When set, overrides the dialect's
1978
+ * default fulltext strategy for `$fulltext.matches()` compilation.
1979
+ * Callers typically read this from `backend.fulltextStrategy` so a
1980
+ * backend-declared strategy (e.g. ParadeDB) wins over the dialect
1981
+ * default (tsvector).
2029
1982
  */
2030
- offset(n: number): ExecutableAggregateQuery<G, Aliases, R>;
1983
+ fulltextStrategy?: FulltextStrategy | undefined;
2031
1984
  /**
2032
- * Compiles the query and returns the SQL text and parameters.
2033
- *
2034
- * Requires a backend to be configured (the backend determines the SQL dialect).
2035
- * Use this for debugging, logging, or running the query with a custom executor.
1985
+ * Vector strategy override. When set, `field.similarTo(...)`
1986
+ * predicates compile against the strategy's per-`(kind, field)`
1987
+ * tables and distance expression. Callers read it from
1988
+ * `backend.vectorStrategy` so a backend-declared strategy (pgvector,
1989
+ * libsql-native, sqlite-vec) drives the per-field relevance scan.
2036
1990
  */
2037
- toSQL(): Readonly<{
2038
- sql: string;
2039
- params: readonly unknown[];
2040
- }>;
1991
+ vectorStrategy?: VectorStrategy | undefined;
2041
1992
  /**
2042
- * Compiles the query to a Drizzle SQL object.
1993
+ * Whether the active backend supports SQL window functions such as
1994
+ * `ROW_NUMBER()`. Defaults to true for direct compiler callers.
2043
1995
  */
2044
- compile(): SQL;
1996
+ windowFunctions?: boolean | undefined;
2045
1997
  /**
2046
- * Executes the query and returns typed results.
2047
- *
2048
- * @throws Error if no backend is configured
1998
+ * Declared embedding slots `(kind, fieldPath) -> descriptor` used by
1999
+ * the `field.similarTo(...)` CTE to know which kinds in an alias
2000
+ * declare the field. Callers build it from the graph's node schemas.
2049
2001
  */
2050
- execute(): Promise<readonly AggregateResult<R>[]>;
2051
- }
2002
+ vectorSlots?: VectorSlotMap | undefined;
2003
+ }>;
2052
2004
 
2053
2005
  type PreparedQueryConfig<R> = Readonly<{
2054
2006
  ast: QueryAst;
@@ -2543,8 +2495,12 @@ declare class QueryBuilder<G extends GraphDef, Aliases extends AliasMap = {}, Ed
2543
2495
  * Sets temporal mode.
2544
2496
  *
2545
2497
  * @param mode - The temporal mode to use
2546
- * @param asOf - Required timestamp for "asOf" mode (ISO 8601 string)
2547
- * @throws ValidationError if mode is "asOf" but no timestamp is provided
2498
+ * @param asOf - Required timestamp for "asOf" mode (ISO 8601 string).
2499
+ * Rejected for every other mode — pinning an instant is only meaningful
2500
+ * in "asOf" mode, so `temporal("current", t)` is a caller error, not a
2501
+ * silently-dropped argument.
2502
+ * @throws ValidationError if mode is "asOf" but no timestamp is provided, or
2503
+ * if an asOf is supplied with a non-"asOf" mode.
2548
2504
  */
2549
2505
  temporal(mode: TemporalMode, asOf?: string): QueryBuilder<G, Aliases, EdgeAliases, RecursiveAliases>;
2550
2506
  /**
@@ -2652,15 +2608,16 @@ type AlgorithmCyclePolicy = RecursiveCyclePolicy;
2652
2608
  *
2653
2609
  * Algorithms honor the same temporal model as the rest of the store: both
2654
2610
  * nodes and edges are filtered according to the resolved mode. `asOf` is
2655
- * only consulted when the resolved mode is `"asOf"`. If neither option is
2656
- * supplied, the algorithm falls back to `graph.defaults.temporalMode`.
2611
+ * required when the resolved mode is `"asOf"` and rejected for every other
2612
+ * mode. If neither option is supplied, the algorithm falls back to
2613
+ * `graph.defaults.temporalMode`.
2657
2614
  */
2658
2615
  type TemporalAlgorithmOptions = Readonly<{
2659
2616
  /** Temporal mode. Defaults to the graph's configured default. */
2660
2617
  temporalMode?: TemporalMode;
2661
2618
  /**
2662
- * ISO-8601 timestamp used when `temporalMode` is `"asOf"`. Required in that
2663
- * mode; ignored in all others.
2619
+ * ISO-8601 timestamp pinning the read. Required when `temporalMode` is
2620
+ * `"asOf"`; rejected (throws `ValidationError`) for every other mode.
2664
2621
  */
2665
2622
  asOf?: string;
2666
2623
  }>;
@@ -2813,81 +2770,6 @@ type GraphAlgorithms<G extends GraphDef> = Readonly<{
2813
2770
  degree: (node: NodeIdentifier, options?: DegreeOptions<G>) => Promise<number>;
2814
2771
  }>;
2815
2772
 
2816
- /**
2817
- * `store.introspect()` — unified read of the merged schema.
2818
- *
2819
- * Returns a coherent snapshot of "what does my schema look like right
2820
- * now" suitable for schema-management UIs, codegen, and IDE plugins.
2821
- * The previous surface was fragmented across `registry.hasNodeType`,
2822
- * `store.deprecatedKinds`, and direct graph poking; `introspect()`
2823
- * unifies them with explicit `origin` markers distinguishing
2824
- * compile-time from runtime declarations.
2825
- *
2826
- * Pure read — no I/O. Built from the in-memory `GraphDef` and the
2827
- * persisted-but-already-merged `extension`. `schemaVersion` /
2828
- * `schemaHash` are populated when the loader cached them at
2829
- * construction time and `undefined` otherwise; consumers needing a
2830
- * fresh read should call `backend.getActiveSchema(graphId)` directly.
2831
- */
2832
-
2833
- type SchemaIntrospection = Readonly<{
2834
- graphId: string;
2835
- /** Active schema version on the backend, when known to the caller. */
2836
- schemaVersion: number | undefined;
2837
- /** Hash of the active schema document, when known to the caller. */
2838
- schemaHash: string | undefined;
2839
- kinds: readonly KindIntrospection[];
2840
- edges: readonly EdgeIntrospection[];
2841
- ontology: readonly OntologyIntrospection[];
2842
- deprecatedKinds: ReadonlySet<string>;
2843
- /**
2844
- * The persisted graph extension, or `undefined` when the store has
2845
- * no extensions. Round-trips: passing this value to
2846
- * `defineGraphExtension` and `evolve` against an empty graph yields
2847
- * a graph with the same extension kinds.
2848
- */
2849
- extension: GraphExtension | undefined;
2850
- }>;
2851
- type KindIntrospection = Readonly<{
2852
- name: string;
2853
- origin: "compile-time" | "runtime";
2854
- description: string | undefined;
2855
- annotations: KindAnnotations | undefined;
2856
- deprecated: boolean;
2857
- /**
2858
- * JSON-Schema view of the kind's properties. For extension kinds the
2859
- * lower-level `ExtensionPropertyType` shape (with first-class
2860
- * `searchable` / `embedding` modifiers) is reachable via
2861
- * `introspection.extension.nodes[name].properties`.
2862
- */
2863
- properties: JsonSchema;
2864
- unique: readonly UniqueIntrospection[];
2865
- }>;
2866
- type EdgeIntrospection = Readonly<{
2867
- name: string;
2868
- origin: "compile-time" | "runtime";
2869
- description: string | undefined;
2870
- from: readonly string[];
2871
- to: readonly string[];
2872
- cardinality: Cardinality;
2873
- endpointExistence: EndpointExistence;
2874
- properties: JsonSchema;
2875
- annotations: KindAnnotations | undefined;
2876
- deprecated: boolean;
2877
- }>;
2878
- type OntologyIntrospection = Readonly<{
2879
- metaEdge: string;
2880
- from: string;
2881
- to: string;
2882
- origin: "compile-time" | "runtime";
2883
- }>;
2884
- type UniqueIntrospection = Readonly<{
2885
- name: string;
2886
- fields: readonly string[];
2887
- scope: UniquenessScope;
2888
- collation: Collation;
2889
- }>;
2890
-
2891
2773
  type RebuildFulltextOptions = Readonly<{
2892
2774
  /** Page size. Must be a positive integer. Default: 500. */
2893
2775
  pageSize?: number;
@@ -3174,6 +3056,279 @@ declare class StoreSearch<G extends GraphDef> {
3174
3056
  rebuildFulltext<K extends string>(nodeKind?: K, options?: RebuildFulltextOptions): Promise<RebuildFulltextResult>;
3175
3057
  }
3176
3058
 
3059
+ /**
3060
+ * `store.introspect()` — unified read of the merged schema.
3061
+ *
3062
+ * Returns a coherent snapshot of "what does my schema look like right
3063
+ * now" suitable for schema-management UIs, codegen, and IDE plugins.
3064
+ * The previous surface was fragmented across `registry.hasNodeType`,
3065
+ * `store.deprecatedKinds`, and direct graph poking; `introspect()`
3066
+ * unifies them with explicit `origin` markers distinguishing
3067
+ * compile-time from runtime declarations.
3068
+ *
3069
+ * Pure read — no I/O. Built from the in-memory `GraphDef` and the
3070
+ * persisted-but-already-merged `extension`. `schemaVersion` /
3071
+ * `schemaHash` are populated when the loader cached them at
3072
+ * construction time and `undefined` otherwise; consumers needing a
3073
+ * fresh read should call `backend.getActiveSchema(graphId)` directly.
3074
+ */
3075
+
3076
+ type SchemaIntrospection = Readonly<{
3077
+ graphId: string;
3078
+ /** Active schema version on the backend, when known to the caller. */
3079
+ schemaVersion: number | undefined;
3080
+ /** Hash of the active schema document, when known to the caller. */
3081
+ schemaHash: string | undefined;
3082
+ kinds: readonly KindIntrospection[];
3083
+ edges: readonly EdgeIntrospection[];
3084
+ ontology: readonly OntologyIntrospection[];
3085
+ deprecatedKinds: ReadonlySet<string>;
3086
+ /**
3087
+ * The persisted graph extension, or `undefined` when the store has
3088
+ * no extensions. Round-trips: passing this value to
3089
+ * `defineGraphExtension` and `evolve` against an empty graph yields
3090
+ * a graph with the same extension kinds.
3091
+ */
3092
+ extension: GraphExtension | undefined;
3093
+ }>;
3094
+ type KindIntrospection = Readonly<{
3095
+ name: string;
3096
+ origin: "compile-time" | "runtime";
3097
+ description: string | undefined;
3098
+ annotations: KindAnnotations | undefined;
3099
+ deprecated: boolean;
3100
+ /**
3101
+ * JSON-Schema view of the kind's properties. For extension kinds the
3102
+ * lower-level `ExtensionPropertyType` shape (with first-class
3103
+ * `searchable` / `embedding` modifiers) is reachable via
3104
+ * `introspection.extension.nodes[name].properties`.
3105
+ */
3106
+ properties: JsonSchema;
3107
+ unique: readonly UniqueIntrospection[];
3108
+ }>;
3109
+ type EdgeIntrospection = Readonly<{
3110
+ name: string;
3111
+ origin: "compile-time" | "runtime";
3112
+ description: string | undefined;
3113
+ from: readonly string[];
3114
+ to: readonly string[];
3115
+ cardinality: Cardinality;
3116
+ endpointExistence: EndpointExistence;
3117
+ properties: JsonSchema;
3118
+ annotations: KindAnnotations | undefined;
3119
+ deprecated: boolean;
3120
+ }>;
3121
+ type OntologyIntrospection = Readonly<{
3122
+ metaEdge: string;
3123
+ from: string;
3124
+ to: string;
3125
+ origin: "compile-time" | "runtime";
3126
+ }>;
3127
+ type UniqueIntrospection = Readonly<{
3128
+ name: string;
3129
+ fields: readonly string[];
3130
+ scope: UniquenessScope;
3131
+ collation: Collation;
3132
+ }>;
3133
+
3134
+ /**
3135
+ * Data-cleanup phase for `store.removeKinds()`.
3136
+ *
3137
+ * The removeKinds verb commits the new schema atomically (millisecond
3138
+ * budget); the data deletion happens here, scoped per-deployment via
3139
+ * the `typegraph_kind_removals` status table. Splitting the verbs
3140
+ * mirrors how `materializeIndexes` complements `evolve`: schema
3141
+ * commits are atomic and fast, data work is bounded by row count and
3142
+ * deferrable / parallelizable.
3143
+ */
3144
+
3145
+ type MaterializeRemovalsOptions = Readonly<{
3146
+ /** Restrict to specific kind names. */
3147
+ kinds?: readonly string[];
3148
+ /** Halt on first failure. Default: false (best-effort). */
3149
+ stopOnError?: boolean;
3150
+ }>;
3151
+ type MaterializeRemovalsEntry = Readonly<{
3152
+ kind: string;
3153
+ entity: KindEntity;
3154
+ status: "removed" | "failed";
3155
+ error?: Error;
3156
+ }>;
3157
+ /**
3158
+ * Outcome of reclaiming one per-`(graphId, kind, field)` vector table that
3159
+ * was orphaned when its embedding field was dropped from a *surviving*
3160
+ * kind's schema. Distinct from {@link MaterializeRemovalsEntry} (whole
3161
+ * kinds) because the unit is a single embedding field, not a kind.
3162
+ */
3163
+ type ReclaimedVectorFieldEntry = Readonly<{
3164
+ kind: string;
3165
+ fieldPath: string;
3166
+ status: "reclaimed" | "failed";
3167
+ error?: Error;
3168
+ }>;
3169
+ type MaterializeRemovalsResult = Readonly<{
3170
+ results: readonly MaterializeRemovalsEntry[];
3171
+ /**
3172
+ * Embedding fields removed from a *surviving* kind whose per-field vector
3173
+ * table this pass dropped (or confirmed already absent). Empty when the
3174
+ * backend has no vector strategy or no embedding field has ever been
3175
+ * dropped. Re-derived from immutable schema history each call, so it lists
3176
+ * the same removed fields on repeat passes — the underlying drop is
3177
+ * idempotent (`DROP ... IF EXISTS`). See {@link reclaimRemovedVectorFieldTables}.
3178
+ */
3179
+ reclaimedVectorFields: readonly ReclaimedVectorFieldEntry[];
3180
+ }>;
3181
+
3182
+ /**
3183
+ * Discriminated union of all Node runtime types in a graph.
3184
+ *
3185
+ * Unlike `AllNodeTypes<G>` which gives the union of *type definitions*,
3186
+ * `AnyNode<G>` gives the union of *runtime node instances*.
3187
+ */
3188
+ type AnyNode<G extends GraphDef> = {
3189
+ [K in NodeKinds<G>]: Node<G["nodes"][K]["type"]>;
3190
+ }[NodeKinds<G>];
3191
+ /**
3192
+ * Discriminated union of all Edge runtime types in a graph.
3193
+ */
3194
+ type AnyEdge<G extends GraphDef> = {
3195
+ [K in EdgeKinds<G>]: Edge<G["edges"][K]["type"]>;
3196
+ }[EdgeKinds<G>];
3197
+ /**
3198
+ * Discriminated union of Node runtime types narrowed to a subset of kinds.
3199
+ */
3200
+ type SubsetNode<G extends GraphDef, K extends NodeKinds<G>> = {
3201
+ [Kind in K]: Node<G["nodes"][Kind]["type"]>;
3202
+ }[K];
3203
+ /**
3204
+ * Discriminated union of Edge runtime types narrowed to a subset of kinds.
3205
+ */
3206
+ type SubsetEdge<G extends GraphDef, K extends EdgeKinds<G>> = {
3207
+ [Kind in K]: Edge<G["edges"][Kind]["type"]>;
3208
+ }[K];
3209
+ type EmptyShape = Readonly<Record<never, never>>;
3210
+ type NodeProjectionPropertyKey<N extends NodeType> = Exclude<keyof Node<N>, "id" | "kind" | "meta"> & string;
3211
+ type EdgeProjectionPropertyKey<E extends AnyEdgeType> = Exclude<keyof Edge<E>, "id" | "kind" | "fromKind" | "fromId" | "toKind" | "toId" | "meta"> & string;
3212
+ type SubgraphNodeProjectionField<N extends NodeType = NodeType> = NodeProjectionPropertyKey<N> | "meta";
3213
+ type SubgraphEdgeProjectionField<E extends AnyEdgeType = AnyEdgeType> = EdgeProjectionPropertyKey<E> | "meta";
3214
+ type SubgraphNodeProjectionMap<G extends GraphDef, NK extends NodeKinds<G> = NodeKinds<G>> = Readonly<{
3215
+ [K in NodeKinds<G>]?: K extends NK ? readonly SubgraphNodeProjectionField<G["nodes"][K]["type"]>[] : never;
3216
+ }>;
3217
+ type SubgraphEdgeProjectionMap<G extends GraphDef, EK extends EdgeKinds<G> = EdgeKinds<G>> = Readonly<{
3218
+ [K in EdgeKinds<G>]?: K extends EK ? readonly SubgraphEdgeProjectionField<G["edges"][K]["type"]>[] : never;
3219
+ }>;
3220
+ type SubgraphProject<G extends GraphDef, NK extends NodeKinds<G> = NodeKinds<G>, EK extends EdgeKinds<G> = EdgeKinds<G>> = Readonly<{
3221
+ /**
3222
+ * Node fields to keep per kind.
3223
+ *
3224
+ * Projected nodes always retain `kind` and `id`.
3225
+ * Use `"meta"` to include the full metadata object; omit it to exclude metadata entirely.
3226
+ * Only kinds present in `includeKinds` (or all node kinds when omitted) are valid keys.
3227
+ */
3228
+ nodes?: SubgraphNodeProjectionMap<G, NK>;
3229
+ /**
3230
+ * Edge fields to keep per kind.
3231
+ *
3232
+ * Projected edges always retain `id`, `kind`, `fromKind`, `fromId`,
3233
+ * `toKind`, and `toId`.
3234
+ * Use `"meta"` to include the full metadata object; omit it to exclude metadata entirely.
3235
+ * Only edge kinds listed in `edges` are valid keys.
3236
+ */
3237
+ edges?: SubgraphEdgeProjectionMap<G, EK>;
3238
+ }>;
3239
+ /**
3240
+ * Identity function that preserves literal types for reusable projection configs.
3241
+ *
3242
+ * Without this helper, storing a projection in a typed variable widens the
3243
+ * field arrays to `string[]`, defeating compile-time narrowing on results.
3244
+ *
3245
+ * @example
3246
+ * ```ts
3247
+ * const project = defineSubgraphProject(graph)({
3248
+ * nodes: { Task: ["title", "meta"] },
3249
+ * edges: { uses_skill: [] },
3250
+ * });
3251
+ * const result = await store.subgraph(rootId, { edges: ["uses_skill"], project });
3252
+ * // result.nodes narrowed correctly — task.status is a type error
3253
+ * ```
3254
+ */
3255
+ declare function defineSubgraphProject<G extends GraphDef>(_graph: G): <const P extends SubgraphProject<G>>(project: P) => P;
3256
+ type HasMeta<Selection extends readonly string[] | undefined> = Selection extends readonly string[] ? "meta" extends Selection[number] ? true : false : false;
3257
+ type SelectedNodeProps<N extends NodeType, Selection extends readonly string[] | undefined> = Selection extends readonly string[] ? Pick<Node<N>, Extract<Selection[number], NodeProjectionPropertyKey<N>>> : EmptyShape;
3258
+ type SelectedEdgeProps<E extends AnyEdgeType, Selection extends readonly string[] | undefined> = Selection extends readonly string[] ? Pick<Edge<E>, Extract<Selection[number], EdgeProjectionPropertyKey<E>>> : EmptyShape;
3259
+ type ProjectedNodeResult<N extends NodeType, Selection extends readonly string[] | undefined> = Readonly<Pick<Node<N>, "id" | "kind">> & Readonly<SelectedNodeProps<N, Selection>> & (HasMeta<Selection> extends true ? Readonly<{
3260
+ meta: NodeMeta;
3261
+ }> : EmptyShape);
3262
+ type ProjectedEdgeResult<E extends AnyEdgeType, Selection extends readonly string[] | undefined> = Readonly<Pick<Edge<E>, "id" | "kind" | "fromKind" | "fromId" | "toKind" | "toId">> & Readonly<SelectedEdgeProps<E, Selection>> & (HasMeta<Selection> extends true ? Readonly<{
3263
+ meta: EdgeMeta;
3264
+ }> : EmptyShape);
3265
+ type ProjectionSelection<P, Key extends "nodes" | "edges", Kind extends string> = P extends Readonly<{
3266
+ [K in Key]?: infer Map;
3267
+ }> ? Map extends Readonly<Record<string, readonly string[] | undefined>> ? Kind extends keyof Map ? Map[Kind] : undefined : undefined : undefined;
3268
+ type SubgraphNodeResultForKind<G extends GraphDef, Kind extends NodeKinds<G>, P> = ProjectionSelection<P, "nodes", Kind> extends readonly string[] ? ProjectedNodeResult<G["nodes"][Kind]["type"], ProjectionSelection<P, "nodes", Kind>> : Node<G["nodes"][Kind]["type"]>;
3269
+ type SubgraphEdgeResultForKind<G extends GraphDef, Kind extends EdgeKinds<G>, P> = ProjectionSelection<P, "edges", Kind> extends readonly string[] ? ProjectedEdgeResult<G["edges"][Kind]["type"], ProjectionSelection<P, "edges", Kind>> : Edge<G["edges"][Kind]["type"]>;
3270
+ type SubgraphOptions<G extends GraphDef, EK extends EdgeKinds<G>, NK extends NodeKinds<G>, P extends SubgraphProject<G, NK, EK> | undefined = undefined> = Readonly<{
3271
+ /** Edge kinds to follow during traversal. Edges not listed are not traversed. */
3272
+ edges: readonly EK[];
3273
+ /** Maximum traversal depth from root (default: 10). */
3274
+ maxDepth?: number;
3275
+ /**
3276
+ * Node kinds to include in the result. Nodes of other kinds are still
3277
+ * traversed through but omitted from the output. When omitted, all
3278
+ * reachable node kinds are included.
3279
+ */
3280
+ includeKinds?: readonly NK[];
3281
+ /** Exclude the root node from the result (default: false). */
3282
+ excludeRoot?: boolean;
3283
+ /**
3284
+ * Edge direction policy (default: "out").
3285
+ * - "out": follow edges in their defined direction only
3286
+ * - "both": follow edges in both directions (undirected traversal)
3287
+ */
3288
+ direction?: "out" | "both";
3289
+ /** Cycle policy — reuse RecursiveCyclePolicy (default: "prevent"). */
3290
+ cyclePolicy?: RecursiveCyclePolicy;
3291
+ /**
3292
+ * Temporal mode applied to both nodes and edges along the traversal and in
3293
+ * the hydrated result. Defaults to `graph.defaults.temporalMode`.
3294
+ */
3295
+ temporalMode?: TemporalMode;
3296
+ /** ISO-8601 timestamp used when `temporalMode === "asOf"`. */
3297
+ asOf?: string;
3298
+ /**
3299
+ * Optional field-level projection per node/edge kind.
3300
+ *
3301
+ * Projected nodes keep `kind` and `id`; projected edges keep their structural
3302
+ * endpoint fields. Kinds omitted from `project` remain fully hydrated.
3303
+ * Projection applies to every returned entity, including the root node.
3304
+ *
3305
+ * Only kinds present in `includeKinds` (nodes) or `edges` (edges) are valid
3306
+ * projection keys. Specifying a kind outside those sets is a compile-time error.
3307
+ */
3308
+ project?: P;
3309
+ }>;
3310
+ /**
3311
+ * Union of all node result types in a subgraph, respecting projection.
3312
+ */
3313
+ type SubgraphNodeResult<G extends GraphDef, NK extends NodeKinds<G> = NodeKinds<G>, P = undefined> = {
3314
+ [Kind in NK]: SubgraphNodeResultForKind<G, Kind, P>;
3315
+ }[NK];
3316
+ /**
3317
+ * Union of all edge result types in a subgraph, respecting projection.
3318
+ */
3319
+ type SubgraphEdgeResult<G extends GraphDef, EK extends EdgeKinds<G> = EdgeKinds<G>, P = undefined> = {
3320
+ [Kind in EK]: SubgraphEdgeResultForKind<G, Kind, P>;
3321
+ }[EK];
3322
+ type SubgraphResult<G extends GraphDef, NK extends NodeKinds<G> = NodeKinds<G>, EK extends EdgeKinds<G> = EdgeKinds<G>, P extends SubgraphProject<G, NK, EK> | undefined = undefined> = Readonly<{
3323
+ /** The root node, or undefined if the root was not found or excluded. */
3324
+ root: SubgraphNodeResult<G, NK, P> | undefined;
3325
+ nodes: ReadonlyMap<string, SubgraphNodeResult<G, NK, P>>;
3326
+ /** Forward adjacency: fromId → edgeKind → edges to targets. */
3327
+ adjacency: ReadonlyMap<string, ReadonlyMap<EK, readonly SubgraphEdgeResult<G, EK, P>[]>>;
3328
+ /** Reverse adjacency: toId → edgeKind → edges from sources. */
3329
+ reverseAdjacency: ReadonlyMap<string, ReadonlyMap<EK, readonly SubgraphEdgeResult<G, EK, P>[]>>;
3330
+ }>;
3331
+
3177
3332
  /**
3178
3333
  * Main Store implementation for TypeGraph.
3179
3334
  *
@@ -3400,6 +3555,69 @@ declare class Store<G extends GraphDef> {
3400
3555
  * ```
3401
3556
  */
3402
3557
  query(): QueryBuilder<G>;
3558
+ /**
3559
+ * Internal seam for {@link StoreView.query}: a query builder pinned to a
3560
+ * view's {@link ReadCoordinate} with its temporal axis sealed
3561
+ * (`.temporal()` throws). Not part of the stable public API — construct a
3562
+ * view via {@link Store.view} / {@link Store.asOf} and call `.query()`.
3563
+ */
3564
+ sealedQuery(coordinate: ReadCoordinate): QueryBuilder<G>;
3565
+ /**
3566
+ * Returns a read-only {@link StoreView} pinned to a valid-time instant.
3567
+ *
3568
+ * The view routes every supported read — `nodes` / `edges` collections,
3569
+ * `query()`, `subgraph()`, and the graph algorithms — through the
3570
+ * `asOf` coordinate, so they observe the graph as it was valid at `T`.
3571
+ * Writes stay on the live `Store`. Mirrors Datomic's `(d/as-of db t)`.
3572
+ *
3573
+ * @example
3574
+ * ```typescript
3575
+ * const past = store.asOf("2026-01-01T00:00:00.000Z");
3576
+ * const alice = await past.nodes.Person.getById(aliceId);
3577
+ * const names = await past
3578
+ * .query()
3579
+ * .from("Person", "p")
3580
+ * .whereNode("p", (p) => p.name.eq("Alice"))
3581
+ * .select((ctx) => ctx.p.name)
3582
+ * .execute();
3583
+ * ```
3584
+ *
3585
+ * @param asOf - ISO-8601 timestamp to pin the valid-time coordinate to.
3586
+ */
3587
+ asOf(asOf: string): StoreView<G>;
3588
+ /**
3589
+ * Returns a read-only {@link StoreView} pinned to an arbitrary public
3590
+ * temporal mode. Use {@link Store.asOf} for the common valid-time case;
3591
+ * reach for `view` to pin `"current"`, `"includeEnded"`, or
3592
+ * `"includeTombstones"`.
3593
+ *
3594
+ * @example
3595
+ * ```typescript
3596
+ * const withTombstones = store.view({ mode: "includeTombstones" });
3597
+ * const everyEverVersion = await withTombstones.nodes.Person.find();
3598
+ * ```
3599
+ *
3600
+ * @param coordinate - The `(mode, asOf)` coordinate to pin. `asOf` is
3601
+ * required when `mode` is `"asOf"` and rejected for every other mode.
3602
+ */
3603
+ view(coordinate: StoreViewCoordinate): StoreView<G>;
3604
+ /**
3605
+ * Returns a read-only {@link StoreView} pinned to the current instant,
3606
+ * captured once at construction — a stable point-in-time snapshot. Unlike
3607
+ * `store.view({ mode: "current" })` (which tracks "now" live and can read
3608
+ * different surfaces against slightly different clocks), a snapshot pins one
3609
+ * `asOf` timestamp, so every surface observes the same instant. Sugar for
3610
+ * `store.asOf(new Date().toISOString())`; mirrors Datomic's `(d/db conn)`.
3611
+ *
3612
+ * @example
3613
+ * ```typescript
3614
+ * const snap = store.snapshot();
3615
+ * // Every read on `snap` sees the graph as of one fixed instant.
3616
+ * const a = await snap.nodes.Person.find();
3617
+ * const r = await snap.reachable(rootId, { edges: ["knows"] });
3618
+ * ```
3619
+ */
3620
+ snapshot(): StoreView<G>;
3403
3621
  /**
3404
3622
  * Search-related operations (fulltext, hybrid, and rebuild).
3405
3623
  *
@@ -3546,8 +3764,14 @@ declare class Store<G extends GraphDef> {
3546
3764
  * // sequential, non-atomic — handle partial-failure recovery yourself
3547
3765
  * }
3548
3766
  * ```
3767
+ *
3768
+ * @param fn The callback run inside the transaction boundary.
3769
+ * @param options Optional {@link TransactionOptions} forwarded to the
3770
+ * backend (e.g. `isolationLevel: "serializable"` on Postgres). Backends
3771
+ * without isolation-level support ignore it; the non-transactional
3772
+ * fallback ignores it entirely.
3549
3773
  */
3550
- transaction<T>(fn: (tx: TransactionContext<G>) => Promise<T>): Promise<T>;
3774
+ transaction<T>(fn: (tx: TransactionContext<G>) => Promise<T>, options?: TransactionOptions): Promise<T>;
3551
3775
  /**
3552
3776
  * Adopts a caller-owned, already-open Drizzle transaction so the graph
3553
3777
  * store and the caller's relational writes commit or roll back as one
@@ -3952,4 +4176,108 @@ declare function createStoreWithSchema<G extends GraphDef>(graph: G, backend: Gr
3952
4176
  */
3953
4177
  declare function createVerifiedStore<G extends GraphDef>(graph: G, backend: GraphBackend, options?: StoreOptions): Promise<[Store<G>, SchemaValidationResult]>;
3954
4178
 
3955
- export { type KindIntrospection as $, type AliasMap as A, type BaseTraversalOptions as B, type CreateQueryBuilderOptions as C, DEFAULT_SEARCHABLE_LANGUAGE as D, type EmbeddingMetric as E, type EdgeGetOrCreateByEndpointsResult as F, type EdgeIntrospection as G, type EmbeddingSchema as H, type EmbeddingValue as I, ExecutableAggregateQuery as J, ExecutableQuery as K, type FieldAccessor as L, type FulltextSearchHit as M, type FulltextSearchOptions as N, type GetOrCreateAction as O, type GraphAlgorithms as P, QueryBuilder as Q, type GraphEdgeCollections as R, Store as S, TraversalBuilder as T, type GraphNodeCollections as U, type HookContext as V, type HybridFulltextOptions as W, type HybridSearchHit as X, type HybridSearchOptions as Y, type HybridVectorOptions as Z, type IfExistsMode as _, type EmbeddingIndexType as a, createStore as a$, type MaterializeRemovalsEntry as a0, type MaterializeRemovalsOptions as a1, type MaterializeRemovalsResult as a2, type NeighborsOptions as a3, type Node as a4, type NodeAccessor as a5, type NodeAlias as a6, type NodeBulkFindByIndexOptions as a7, type NodeCollection as a8, type NodeGetOrCreateByConstraintOptions as a9, type SelectContext as aA, type SelectableEdge as aB, type SelectableNode as aC, type ShortestPathOptions as aD, type ShortestPathResult as aE, type StoreHooks as aF, type StoreOptions as aG, type StoreProjection as aH, type StoreRef as aI, StoreSearch as aJ, type StreamOptions as aK, type SubgraphEdgeResult as aL, type SubgraphNodeResult as aM, type SubgraphOptions as aN, type SubgraphResult as aO, type SubsetEdge as aP, type SubsetNode as aQ, type TemporalAlgorithmOptions as aR, type TransactionContext as aS, type TraversalDirection as aT, type TypedEdgeCollection as aU, UnionableQuery as aV, type UniqueIntrospection as aW, type UpdateEdgeInput as aX, type UpdateNodeInput as aY, type VectorSearchHit as aZ, type VectorSearchOptions as a_, type NodeGetOrCreateByConstraintResult as aa, type NodeIdentifier as ab, type NodeRef as ac, type OntologyIntrospection as ad, type OperationHookContext as ae, type PaginateOptions as af, type PaginatedResult as ag, type PathNode as ah, type Predicate as ai, PreparedQuery as aj, type PropsAccessor as ak, type QueryHookContext as al, type QueryOptions as am, type ReachableNode as an, type ReachableOptions as ao, type RebuildFulltextOptions as ap, type RebuildFulltextResult as aq, type ReclaimedVectorFieldEntry as ar, type RecursiveTraversalOptions as as, type ReembedFunction as at, type ReembedVectorFieldOptions as au, type ReembedVectorFieldResult as av, type SchemaIntrospection as aw, type SearchableMetadata as ax, type SearchableOptions as ay, type SearchableSchema as az, type EdgeAliasMap as b, createStoreWithSchema as b0, createVerifiedStore as b1, defineSubgraphProject as b2, embedding as b3, exists as b4, fieldRef as b5, getEmbeddingDimensions as b6, getSearchableMetadata as b7, inSubquery as b8, isEmbeddingSchema as b9, isParameterRef as ba, isSearchableSchema as bb, notExists as bc, notInSubquery as bd, param as be, searchable as bf, type AggregateResult as c, type AlgorithmCyclePolicy as d, type AnyEdge as e, type AnyNode as f, type BatchResults as g, type BatchableQuery as h, type ConstraintNames as i, type CreateEdgeInput as j, type CreateNodeInput as k, type DegreeOptions as l, type DynamicEdgeAccessor as m, type DynamicEdgeCollection as n, type DynamicEdgeType as o, type DynamicFieldBuilder as p, type DynamicNodeAccessor as q, type DynamicNodeCollection as r, type DynamicNodeType as s, type DynamicSelectableEdge as t, type DynamicSelectableNode as u, type Edge as v, type EdgeAccessor as w, type EdgeCollection as x, type EdgeFindByEndpointsOptions as y, type EdgeGetOrCreateByEndpointsOptions as z };
4179
+ /**
4180
+ * StoreView — a read-only `(mode, asOf)` lens over a {@link Store}.
4181
+ *
4182
+ * A `StoreView` pins a temporal coordinate and routes every supported
4183
+ * read through it, mirroring Datomic's `(d/as-of db t)` database value
4184
+ * and SQL:2011 `FOR SYSTEM_TIME AS OF`. It is *read-only by
4185
+ * construction*: mutating "the graph as of last Tuesday" is incoherent,
4186
+ * so writes stay on the live `Store`.
4187
+ *
4188
+ * The view is an explicit read context, not a single default flip — the
4189
+ * temporal seam is not uniform across surfaces (the query builder
4190
+ * hardcodes `"current"`, `subgraph` reads `graph.defaults` directly,
4191
+ * collections apply a per-call default). The view therefore injects its
4192
+ * pinned {@link ReadCoordinate} into each surface it hands out through one
4193
+ * helper ({@link withCoordinate}), so a future temporal axis (recorded
4194
+ * time) lands on every surface at once instead of splitting by surface.
4195
+ *
4196
+ * Built on the public `Store` surface (plus one internal sealed-query
4197
+ * seam), so it composes the same reads `branch()` / `merge()` consume.
4198
+ */
4199
+
4200
+ /**
4201
+ * The temporal coordinate a {@link StoreView} pins. A discriminated union on
4202
+ * `mode`: `asOf` is *required* for `"asOf"` and *rejected* (`never`) for every
4203
+ * other mode, so the type mirrors the runtime contract. `view({ mode: "asOf" })`
4204
+ * (missing timestamp) and `view({ mode: "current", asOf })` (pinning an instant
4205
+ * outside `"asOf"`) are both compile errors, not merely runtime
4206
+ * `ValidationError`s.
4207
+ */
4208
+ type StoreViewCoordinate = Readonly<{
4209
+ mode: "asOf";
4210
+ asOf: string;
4211
+ }> | Readonly<{
4212
+ mode: Exclude<TemporalMode, "asOf">;
4213
+ asOf?: never;
4214
+ }>;
4215
+ /**
4216
+ * {@link Store.subgraph} options with the temporal axis removed — the
4217
+ * view's pinned coordinate supplies it.
4218
+ */
4219
+ type StoreViewSubgraphOptions<G extends GraphDef, EK extends EdgeKinds<G>, NK extends NodeKinds<G>, P extends SubgraphProject<G, NK, EK> | undefined = undefined> = Omit<SubgraphOptions<G, EK, NK, P>, "temporalMode" | "asOf">;
4220
+ /** `reachable` options with the temporal axis removed (the pin supplies it). */
4221
+ type StoreViewReachableOptions<G extends GraphDef> = Omit<ReachableOptions<G>, keyof TemporalAlgorithmOptions>;
4222
+ /** `shortestPath` options with the temporal axis removed (the pin supplies it). */
4223
+ type StoreViewShortestPathOptions<G extends GraphDef> = Omit<ShortestPathOptions<G>, keyof TemporalAlgorithmOptions>;
4224
+ /** `canReach` options with the temporal axis removed (the pin supplies it). */
4225
+ type StoreViewCanReachOptions<G extends GraphDef> = Omit<BaseTraversalOptions<G>, keyof TemporalAlgorithmOptions>;
4226
+ /** `neighbors` options with the temporal axis removed (the pin supplies it). */
4227
+ type StoreViewNeighborsOptions<G extends GraphDef> = Omit<NeighborsOptions<G>, keyof TemporalAlgorithmOptions>;
4228
+ /** `degree` options with the temporal axis removed (the pin supplies it). */
4229
+ type StoreViewDegreeOptions<G extends GraphDef> = Omit<DegreeOptions<G>, keyof TemporalAlgorithmOptions>;
4230
+ /**
4231
+ * A read-only `(mode, asOf)` lens over a {@link Store}. Construct one via
4232
+ * {@link Store.asOf} (valid-time) or {@link Store.view} (any public
4233
+ * mode), never directly.
4234
+ *
4235
+ * @example
4236
+ * ```typescript
4237
+ * const past = store.asOf("2026-01-01T00:00:00.000Z");
4238
+ * const alice = await past.nodes.Person.getById(aliceId);
4239
+ * const jobs = await past.edges.worksAt.findFrom(alice!);
4240
+ * const reach = await past.reachable(alice!, { edges: ["knows"] });
4241
+ * ```
4242
+ */
4243
+ declare class StoreView<G extends GraphDef> {
4244
+ #private;
4245
+ constructor(store: Store<G>, coordinate: StoreViewCoordinate);
4246
+ /** The temporal mode this view reads in. */
4247
+ get mode(): TemporalMode;
4248
+ /** The pinned `asOf` timestamp, or `undefined` for non-`asOf` modes. */
4249
+ get asOf(): string | undefined;
4250
+ /** Read-only node collections pinned to this view's coordinate. */
4251
+ get nodes(): StoreViewNodeCollections<G>;
4252
+ /** Read-only edge collections pinned to this view's coordinate. */
4253
+ get edges(): StoreViewEdgeCollections<G>;
4254
+ /**
4255
+ * A query builder pinned to this view's coordinate. The temporal axis is
4256
+ * sealed: calling `.temporal(...)` on the returned builder throws, so the
4257
+ * view's coordinate cannot be overridden on a per-query basis.
4258
+ */
4259
+ query(): QueryBuilder<G>;
4260
+ /** Extracts a subgraph at this view's pinned coordinate. */
4261
+ subgraph<const EK extends EdgeKinds<G>, const NK extends NodeKinds<G> = NodeKinds<G>, const P extends SubgraphProject<G, NK, EK> | undefined = undefined>(rootId: NodeId<AllNodeTypes<G>>, options: StoreViewSubgraphOptions<G, EK, NK, P>): Promise<SubgraphResult<G, NK, EK, P>>;
4262
+ /** Shortest path between two nodes at this view's pinned coordinate. */
4263
+ shortestPath(from: NodeIdentifier, to: NodeIdentifier, options: StoreViewShortestPathOptions<G>): Promise<ShortestPathResult | undefined>;
4264
+ /** Nodes reachable from `from` at this view's pinned coordinate. */
4265
+ reachable(from: NodeIdentifier, options: StoreViewReachableOptions<G>): Promise<readonly ReachableNode[]>;
4266
+ /** Whether `to` is reachable from `from` at this view's pinned coordinate. */
4267
+ canReach(from: NodeIdentifier, to: NodeIdentifier, options: StoreViewCanReachOptions<G>): Promise<boolean>;
4268
+ /** The k-hop neighborhood of `node` at this view's pinned coordinate. */
4269
+ neighbors(node: NodeIdentifier, options: StoreViewNeighborsOptions<G>): Promise<readonly ReachableNode[]>;
4270
+ /** Counts active edges incident to `node` at this view's pinned coordinate. */
4271
+ degree(node: NodeIdentifier, options?: StoreViewDegreeOptions<G>): Promise<number>;
4272
+ /**
4273
+ * Read-only search facade. On a `current` view the read methods
4274
+ * (`fulltext` / `vector` / `hybrid`) delegate to the live `store.search`,
4275
+ * while the mutating `rebuildFulltext` is refused — the view is read-only.
4276
+ * On any non-`current` pin every search method refuses: the fulltext /
4277
+ * vector index reflects current state only, so historical relevance is
4278
+ * out of scope.
4279
+ */
4280
+ get search(): StoreSearch<G>;
4281
+ }
4282
+
4283
+ export { type HybridFulltextOptions as $, type AliasMap as A, type BaseTraversalOptions as B, type CreateQueryBuilderOptions as C, DEFAULT_SEARCHABLE_LANGUAGE as D, type EmbeddingMetric as E, type EdgeGetOrCreateByEndpointsOptions as F, type EdgeGetOrCreateByEndpointsResult as G, type EdgeIntrospection as H, type EdgeTemporalReads as I, type EdgeWrites as J, type EmbeddingSchema as K, type EmbeddingValue as L, ExecutableAggregateQuery as M, type Node as N, ExecutableQuery as O, type FieldAccessor as P, QueryBuilder as Q, type FulltextSearchHit as R, Store as S, TraversalBuilder as T, type UniqueIntrospection as U, type FulltextSearchOptions as V, type GetOrCreateAction as W, type GraphAlgorithms as X, type GraphEdgeCollections as Y, type GraphNodeCollections as Z, type HookContext as _, type EmbeddingIndexType as a, type StoreViewShortestPathOptions as a$, type HybridSearchHit as a0, type HybridSearchOptions as a1, type HybridVectorOptions as a2, type IfExistsMode as a3, type KindIntrospection as a4, type MaterializeRemovalsEntry as a5, type MaterializeRemovalsOptions as a6, type MaterializeRemovalsResult as a7, type NeighborsOptions as a8, type NodeAccessor as a9, type ReembedFunction as aA, type ReembedVectorFieldOptions as aB, type ReembedVectorFieldResult as aC, type SchemaIntrospection as aD, type SearchableMetadata as aE, type SearchableOptions as aF, type SearchableSchema as aG, type SelectContext as aH, type SelectableEdge as aI, type SelectableNode as aJ, type ShortestPathOptions as aK, type ShortestPathResult as aL, type StoreHooks as aM, type StoreOptions as aN, type StoreProjection as aO, type StoreRef as aP, StoreSearch as aQ, StoreView as aR, type StoreViewCanReachOptions as aS, type StoreViewCoordinate as aT, type StoreViewDegreeOptions as aU, type StoreViewEdgeCollection as aV, type StoreViewEdgeCollections as aW, type StoreViewNeighborsOptions as aX, type StoreViewNodeCollection as aY, type StoreViewNodeCollections as aZ, type StoreViewReachableOptions as a_, type NodeAlias as aa, type NodeBulkFindByIndexOptions as ab, type NodeCollection as ac, type NodeCurrentReads as ad, type NodeGetOrCreateByConstraintOptions as ae, type NodeGetOrCreateByConstraintResult as af, type NodeIdentifier as ag, type NodeRef as ah, type NodeTemporalReads as ai, type NodeWrites as aj, type OntologyIntrospection as ak, type OperationHookContext as al, type PaginateOptions as am, type PaginatedResult as an, type PathNode as ao, type Predicate as ap, PreparedQuery as aq, type PropsAccessor as ar, type QueryHookContext as as, type QueryOptions as at, type ReachableNode as au, type ReachableOptions as av, type RebuildFulltextOptions as aw, type RebuildFulltextResult as ax, type ReclaimedVectorFieldEntry as ay, type RecursiveTraversalOptions as az, type EdgeAliasMap as b, type StoreViewSubgraphOptions as b0, type StreamOptions as b1, type SubgraphEdgeResult as b2, type SubgraphNodeResult as b3, type SubgraphOptions as b4, type SubgraphResult as b5, type SubsetEdge as b6, type SubsetNode as b7, type TemporalAlgorithmOptions as b8, type TransactionContext as b9, type TraversalDirection as ba, type TypedEdgeCollection as bb, type TypedStoreViewEdgeCollection as bc, UnionableQuery as bd, type UpdateEdgeInput as be, type UpdateNodeInput as bf, type VectorSearchHit as bg, type VectorSearchOptions as bh, createStore as bi, createStoreWithSchema as bj, createVerifiedStore as bk, defineSubgraphProject as bl, embedding as bm, exists as bn, fieldRef as bo, getEmbeddingDimensions as bp, getSearchableMetadata as bq, inSubquery as br, isEmbeddingSchema as bs, isParameterRef as bt, isSearchableSchema as bu, notExists as bv, notInSubquery as bw, param as bx, searchable as by, type AggregateResult as c, type AlgorithmCyclePolicy as d, type AnyEdge as e, type AnyNode as f, type BatchResults as g, type BatchableQuery as h, type ConstraintNames as i, type CreateEdgeInput as j, type CreateNodeInput as k, type DegreeOptions as l, type DynamicEdgeAccessor as m, type DynamicEdgeCollection as n, type DynamicEdgeType as o, type DynamicFieldBuilder as p, type DynamicNodeAccessor as q, type DynamicNodeCollection as r, type DynamicNodeType as s, type DynamicSelectableEdge as t, type DynamicSelectableNode as u, type Edge as v, type EdgeAccessor as w, type EdgeBatchReads as x, type EdgeCollection as y, type EdgeFindByEndpointsOptions as z };