@nicia-ai/typegraph 0.33.0 → 0.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -0
- package/dist/backend/postgres/index.cjs +26 -22
- package/dist/backend/postgres/index.d.cts +5 -5
- package/dist/backend/postgres/index.d.ts +5 -5
- package/dist/backend/postgres/index.js +13 -9
- package/dist/backend/postgres/pglite.cjs +17 -13
- package/dist/backend/postgres/pglite.cjs.map +1 -1
- package/dist/backend/postgres/pglite.d.cts +2 -2
- package/dist/backend/postgres/pglite.d.ts +2 -2
- package/dist/backend/postgres/pglite.js +13 -9
- package/dist/backend/postgres/pglite.js.map +1 -1
- package/dist/backend/sqlite/index.cjs +24 -20
- package/dist/backend/sqlite/index.d.cts +6 -6
- package/dist/backend/sqlite/index.d.ts +6 -6
- package/dist/backend/sqlite/index.js +12 -8
- package/dist/backend/sqlite/libsql.cjs +18 -14
- package/dist/backend/sqlite/libsql.cjs.map +1 -1
- package/dist/backend/sqlite/libsql.d.cts +11 -4
- package/dist/backend/sqlite/libsql.d.ts +11 -4
- package/dist/backend/sqlite/libsql.js +14 -10
- package/dist/backend/sqlite/libsql.js.map +1 -1
- package/dist/backend/sqlite/local.cjs +18 -14
- package/dist/backend/sqlite/local.cjs.map +1 -1
- package/dist/backend/sqlite/local.d.cts +2 -2
- package/dist/backend/sqlite/local.d.ts +2 -2
- package/dist/backend/sqlite/local.js +13 -9
- package/dist/backend/sqlite/local.js.map +1 -1
- package/dist/chunk-2EBMPJBO.js +16 -0
- package/dist/chunk-2EBMPJBO.js.map +1 -0
- package/dist/{chunk-CFNT3ITG.cjs → chunk-2JXB3NYJ.cjs} +15 -35
- package/dist/chunk-2JXB3NYJ.cjs.map +1 -0
- package/dist/{chunk-GYVBEZAO.js → chunk-2MRAX3UE.js} +3 -18
- package/dist/chunk-2MRAX3UE.js.map +1 -0
- package/dist/{chunk-D3EWZ67S.cjs → chunk-3BRVBQQD.cjs} +999 -2675
- package/dist/chunk-3BRVBQQD.cjs.map +1 -0
- package/dist/{chunk-FDN43KXV.cjs → chunk-3Z6TW3CT.cjs} +20 -19
- package/dist/chunk-3Z6TW3CT.cjs.map +1 -0
- package/dist/{chunk-6NRFUHMS.js → chunk-4DIBPQNJ.js} +5 -4
- package/dist/chunk-4DIBPQNJ.js.map +1 -0
- package/dist/chunk-4S2FXGBJ.js +9 -0
- package/dist/chunk-4S2FXGBJ.js.map +1 -0
- package/dist/chunk-5IQIX7LU.cjs +2070 -0
- package/dist/chunk-5IQIX7LU.cjs.map +1 -0
- package/dist/{chunk-CWFPJ3RC.js → chunk-6GNSY7AV.js} +3 -3
- package/dist/{chunk-CWFPJ3RC.js.map → chunk-6GNSY7AV.js.map} +1 -1
- package/dist/{chunk-NG5N7R45.cjs → chunk-6HVOHZHS.cjs} +184 -117
- package/dist/chunk-6HVOHZHS.cjs.map +1 -0
- package/dist/chunk-6SCVW4AS.js +20 -0
- package/dist/chunk-6SCVW4AS.js.map +1 -0
- package/dist/chunk-A7SZZFAG.js +2010 -0
- package/dist/chunk-A7SZZFAG.js.map +1 -0
- package/dist/chunk-ACSVZPK7.cjs +21 -0
- package/dist/chunk-ACSVZPK7.cjs.map +1 -0
- package/dist/{chunk-IZ4PCL47.js → chunk-BVTWD66D.js} +4 -66
- package/dist/chunk-BVTWD66D.js.map +1 -0
- package/dist/{chunk-QBYTJSAY.js → chunk-CHXTTSC6.js} +5 -39
- package/dist/chunk-CHXTTSC6.js.map +1 -0
- package/dist/{chunk-DJYRRDHA.js → chunk-CYX2JTDG.js} +3 -3
- package/dist/{chunk-DJYRRDHA.js.map → chunk-CYX2JTDG.js.map} +1 -1
- package/dist/{chunk-PRMKPFN5.js → chunk-DEQFL35G.js} +4 -3
- package/dist/chunk-DEQFL35G.js.map +1 -0
- package/dist/chunk-DI74SMXS.cjs +29 -0
- package/dist/chunk-DI74SMXS.cjs.map +1 -0
- package/dist/{chunk-WWVV44DY.cjs → chunk-G6SOJEDI.cjs} +11 -11
- package/dist/{chunk-WWVV44DY.cjs.map → chunk-G6SOJEDI.cjs.map} +1 -1
- package/dist/{chunk-LM2IC4ZJ.cjs → chunk-GQANNXXT.cjs} +15 -14
- package/dist/chunk-GQANNXXT.cjs.map +1 -0
- package/dist/chunk-GZCNZ7QW.js +24 -0
- package/dist/chunk-GZCNZ7QW.js.map +1 -0
- package/dist/{chunk-KTIEB7VH.cjs → chunk-HK5SATYM.cjs} +35 -58
- package/dist/chunk-HK5SATYM.cjs.map +1 -0
- package/dist/chunk-HMFK4BXR.cjs +12 -0
- package/dist/{chunk-6ZR4QC3O.cjs.map → chunk-HMFK4BXR.cjs.map} +1 -1
- package/dist/chunk-ITE4IXAK.js +25 -0
- package/dist/chunk-ITE4IXAK.js.map +1 -0
- package/dist/chunk-JJRCLAUN.cjs +155 -0
- package/dist/chunk-JJRCLAUN.cjs.map +1 -0
- package/dist/{chunk-ZFWNO3GE.cjs → chunk-JQGIPGVL.cjs} +66 -2
- package/dist/chunk-JQGIPGVL.cjs.map +1 -0
- package/dist/{chunk-XVUJY72M.js → chunk-K2TGS3EN.js} +105 -38
- package/dist/chunk-K2TGS3EN.js.map +1 -0
- package/dist/chunk-K34OPSJK.js +29 -0
- package/dist/chunk-K34OPSJK.js.map +1 -0
- package/dist/{chunk-YW7GHMF4.cjs → chunk-KGC4LY5T.cjs} +18 -17
- package/dist/chunk-KGC4LY5T.cjs.map +1 -0
- package/dist/{chunk-SST7XDY6.cjs → chunk-KNHYNQQ3.cjs} +111 -72
- package/dist/chunk-KNHYNQQ3.cjs.map +1 -0
- package/dist/{chunk-C4C4Q7A6.js → chunk-KUTNI6SI.js} +6 -21
- package/dist/chunk-KUTNI6SI.js.map +1 -0
- package/dist/{chunk-OS6KS3HV.js → chunk-LANHCOXB.js} +8 -7
- package/dist/chunk-LANHCOXB.js.map +1 -0
- package/dist/chunk-N6WTUSBV.cjs +23 -0
- package/dist/chunk-N6WTUSBV.cjs.map +1 -0
- package/dist/{chunk-73KASJGO.cjs → chunk-NAUA4PW5.cjs} +4 -28
- package/dist/chunk-NAUA4PW5.cjs.map +1 -0
- package/dist/chunk-QV245VMN.js +145 -0
- package/dist/chunk-QV245VMN.js.map +1 -0
- package/dist/{chunk-CEF2QOTO.js → chunk-RBV7YCQD.js} +4 -3
- package/dist/chunk-RBV7YCQD.js.map +1 -0
- package/dist/{chunk-OIE2UPVG.cjs → chunk-RHZWOJVA.cjs} +2 -19
- package/dist/chunk-RHZWOJVA.cjs.map +1 -0
- package/dist/{chunk-3IR2GEMJ.cjs → chunk-RRKQAKD6.cjs} +10 -9
- package/dist/chunk-RRKQAKD6.cjs.map +1 -0
- package/dist/{chunk-UPDMJEW6.js → chunk-RY2VIWAM.js} +11 -8
- package/dist/chunk-RY2VIWAM.js.map +1 -0
- package/dist/{chunk-PIHXFF73.js → chunk-SHLY4MCM.js} +3 -3
- package/dist/{chunk-PIHXFF73.js.map → chunk-SHLY4MCM.js.map} +1 -1
- package/dist/{chunk-SPT5JMME.js → chunk-T2DWPQNE.js} +103 -64
- package/dist/chunk-T2DWPQNE.js.map +1 -0
- package/dist/{chunk-WYTUF3QO.js → chunk-T46GR2VY.js} +3 -3
- package/dist/{chunk-WYTUF3QO.js.map → chunk-T46GR2VY.js.map} +1 -1
- package/dist/{chunk-MBLXCV2Y.cjs → chunk-T6SPUYLX.cjs} +5 -43
- package/dist/chunk-T6SPUYLX.cjs.map +1 -0
- package/dist/{chunk-3QRBXYT5.cjs → chunk-TGJE22RM.cjs} +6 -6
- package/dist/{chunk-3QRBXYT5.cjs.map → chunk-TGJE22RM.cjs.map} +1 -1
- package/dist/{chunk-BF3ZDEUE.cjs → chunk-TOTPVGOG.cjs} +70 -69
- package/dist/chunk-TOTPVGOG.cjs.map +1 -0
- package/dist/{chunk-KY5SDVA7.cjs → chunk-UJLOZYKT.cjs} +90 -87
- package/dist/chunk-UJLOZYKT.cjs.map +1 -0
- package/dist/{chunk-I4W7MKVG.cjs → chunk-UNNPKQUG.cjs} +19 -155
- package/dist/chunk-UNNPKQUG.cjs.map +1 -0
- package/dist/chunk-UR7W5YQK.js +18 -0
- package/dist/chunk-UR7W5YQK.js.map +1 -0
- package/dist/{chunk-PYD3UCDU.js → chunk-V3QNTB7Z.js} +19 -148
- package/dist/chunk-V3QNTB7Z.js.map +1 -0
- package/dist/{chunk-XKNAK27R.js → chunk-VCGO4V26.js} +4 -3
- package/dist/chunk-VCGO4V26.js.map +1 -0
- package/dist/{chunk-EF3Z645U.cjs → chunk-WL2SG7ZV.cjs} +6 -72
- package/dist/chunk-WL2SG7ZV.cjs.map +1 -0
- package/dist/{chunk-WLP6TKFB.js → chunk-WLRIWYHQ.js} +640 -2307
- package/dist/chunk-WLRIWYHQ.js.map +1 -0
- package/dist/{chunk-4RBAJVEC.cjs → chunk-WVC2Q2FD.cjs} +5 -5
- package/dist/{chunk-4RBAJVEC.cjs.map → chunk-WVC2Q2FD.cjs.map} +1 -1
- package/dist/chunk-XXVEULWX.js +39 -0
- package/dist/chunk-XXVEULWX.js.map +1 -0
- package/dist/chunk-YAZE7QZR.cjs +32 -0
- package/dist/chunk-YAZE7QZR.cjs.map +1 -0
- package/dist/chunk-YC6PWTHY.cjs +44 -0
- package/dist/chunk-YC6PWTHY.cjs.map +1 -0
- package/dist/chunk-Z5HBYM7U.cjs +11 -0
- package/dist/chunk-Z5HBYM7U.cjs.map +1 -0
- package/dist/{chunk-454I6GDF.js → chunk-Z5XBMDXU.js} +63 -3
- package/dist/chunk-Z5XBMDXU.js.map +1 -0
- package/dist/{chunk-3642VBVC.cjs → chunk-ZP5WHI4C.cjs} +106 -80
- package/dist/chunk-ZP5WHI4C.cjs.map +1 -0
- package/dist/{chunk-YCV72E6L.js → chunk-ZURTTSCM.js} +4 -25
- package/dist/chunk-ZURTTSCM.js.map +1 -0
- package/dist/{chunk-JHOBXD7O.js → chunk-ZV5N4DBG.js} +46 -20
- package/dist/chunk-ZV5N4DBG.js.map +1 -0
- package/dist/chunk-ZY4GXIVN.cjs +32 -0
- package/dist/chunk-ZY4GXIVN.cjs.map +1 -0
- package/dist/{ddl-CVnHJcar.d.ts → ddl-BrmPg61z.d.ts} +3 -3
- package/dist/{ddl-Dxt_fBHr.d.cts → ddl-j1-sH6lE.d.cts} +3 -3
- package/dist/graph-extension/index.cjs +18 -17
- package/dist/graph-extension/index.js +3 -2
- package/dist/graph-merge/index.cjs +294 -146
- package/dist/graph-merge/index.cjs.map +1 -1
- package/dist/graph-merge/index.d.cts +3 -3
- package/dist/graph-merge/index.d.ts +3 -3
- package/dist/graph-merge/index.js +172 -24
- package/dist/graph-merge/index.js.map +1 -1
- package/dist/index.cjs +181 -172
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +30 -22
- package/dist/index.js.map +1 -1
- package/dist/indexes/index.cjs +27 -25
- package/dist/indexes/index.d.cts +4 -4
- package/dist/indexes/index.d.ts +4 -4
- package/dist/indexes/index.js +9 -7
- package/dist/interchange/index.cjs +25 -16
- package/dist/interchange/index.d.cts +3 -3
- package/dist/interchange/index.d.ts +3 -3
- package/dist/interchange/index.js +12 -3
- package/dist/{manager-C0_r0ALf.d.ts → manager-BZUeN_BU.d.ts} +1 -1
- package/dist/{manager-BYl_zyZR.d.cts → manager-ms9cKdc6.d.cts} +1 -1
- package/dist/{postgres-MzBPkYzq.d.ts → postgres-BhpxGMC5.d.cts} +1 -1
- package/dist/{postgres-_9psmVGm.d.cts → postgres-CWHLwNl1.d.ts} +1 -1
- package/dist/profiler/index.cjs +3 -3
- package/dist/profiler/index.d.cts +5 -5
- package/dist/profiler/index.d.ts +5 -5
- package/dist/profiler/index.js +2 -2
- package/dist/provenance/index.cjs +591 -0
- package/dist/provenance/index.cjs.map +1 -0
- package/dist/provenance/index.d.cts +73 -0
- package/dist/provenance/index.d.ts +73 -0
- package/dist/provenance/index.js +589 -0
- package/dist/provenance/index.js.map +1 -0
- package/dist/schema/index.cjs +36 -32
- package/dist/schema/index.cjs.map +1 -1
- package/dist/schema/index.d.cts +4 -4
- package/dist/schema/index.d.ts +4 -4
- package/dist/schema/index.js +13 -9
- package/dist/schema/index.js.map +1 -1
- package/dist/{sqlite-gm44dShb.d.ts → sqlite-CGu5SLsw.d.ts} +1 -1
- package/dist/{sqlite-BfksSb45.d.cts → sqlite-XrDxNaa7.d.cts} +1 -1
- package/dist/{store-view-FfE5_7eo.d.ts → store-view-BlgnhEYf.d.ts} +33 -5
- package/dist/{store-view-9jQ2rPum.d.cts → store-view-D09po4H6.d.cts} +33 -5
- package/dist/{types-CdWxK-nD.d.ts → types-B1TbZJYS.d.ts} +1 -1
- package/dist/{types-DGylBhWo.d.ts → types-D1Sqeyxy.d.ts} +7 -3
- package/dist/{types-B6mhrcLv.d.cts → types-DiE1AO7p.d.cts} +1 -1
- package/dist/{types-C_UnQOQp.d.cts → types-DkNnF-7K.d.cts} +7 -3
- package/dist/{where-Bpp2ul_z.d.cts → where-DKjuofPr.d.cts} +1 -1
- package/dist/{where-BsEXraKW.d.ts → where-DrUIIWHb.d.ts} +1 -1
- package/package.json +8 -2
- package/dist/chunk-2YMGNYXY.js +0 -40
- package/dist/chunk-2YMGNYXY.js.map +0 -1
- package/dist/chunk-3642VBVC.cjs.map +0 -1
- package/dist/chunk-3IR2GEMJ.cjs.map +0 -1
- package/dist/chunk-454I6GDF.js.map +0 -1
- package/dist/chunk-6NRFUHMS.js.map +0 -1
- package/dist/chunk-6ZR4QC3O.cjs +0 -12
- package/dist/chunk-73KASJGO.cjs.map +0 -1
- package/dist/chunk-BF3ZDEUE.cjs.map +0 -1
- package/dist/chunk-C4C4Q7A6.js.map +0 -1
- package/dist/chunk-CEF2QOTO.js.map +0 -1
- package/dist/chunk-CFNT3ITG.cjs.map +0 -1
- package/dist/chunk-D3EWZ67S.cjs.map +0 -1
- package/dist/chunk-EF3Z645U.cjs.map +0 -1
- package/dist/chunk-FDN43KXV.cjs.map +0 -1
- package/dist/chunk-GYVBEZAO.js.map +0 -1
- package/dist/chunk-I4W7MKVG.cjs.map +0 -1
- package/dist/chunk-IZ4PCL47.js.map +0 -1
- package/dist/chunk-JHOBXD7O.js.map +0 -1
- package/dist/chunk-KTIEB7VH.cjs.map +0 -1
- package/dist/chunk-KY5SDVA7.cjs.map +0 -1
- package/dist/chunk-LM2IC4ZJ.cjs.map +0 -1
- package/dist/chunk-MBLXCV2Y.cjs.map +0 -1
- package/dist/chunk-NG5N7R45.cjs.map +0 -1
- package/dist/chunk-OIE2UPVG.cjs.map +0 -1
- package/dist/chunk-OS6KS3HV.js.map +0 -1
- package/dist/chunk-PRMKPFN5.js.map +0 -1
- package/dist/chunk-PYD3UCDU.js.map +0 -1
- package/dist/chunk-QBYTJSAY.js.map +0 -1
- package/dist/chunk-SPT5JMME.js.map +0 -1
- package/dist/chunk-SST7XDY6.cjs.map +0 -1
- package/dist/chunk-UPDMJEW6.js.map +0 -1
- package/dist/chunk-WLP6TKFB.js.map +0 -1
- package/dist/chunk-XKNAK27R.js.map +0 -1
- package/dist/chunk-XVUJY72M.js.map +0 -1
- package/dist/chunk-YCV72E6L.js.map +0 -1
- package/dist/chunk-YW7GHMF4.cjs.map +0 -1
- package/dist/chunk-ZFWNO3GE.cjs.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { G as GraphDef, t as NodeKinds, u as GetNodeType } from '../manager-
|
|
2
|
-
import { S as Store, N as Node, U as UniqueIntrospection } from '../store-view-
|
|
1
|
+
import { G as GraphDef, t as NodeKinds, u as GetNodeType } from '../manager-ms9cKdc6.cjs';
|
|
2
|
+
import { S as Store, N as Node, U as UniqueIntrospection } from '../store-view-D09po4H6.cjs';
|
|
3
3
|
import { d as NodeId, N as NodeType, e as EdgeId, J as JsonValue, f as KindAnnotations, g as EdgeType, D as DeleteBehavior, T as TemporalMode, h as GraphExtensionVersion, i as ExtensionNodeDef, j as ExtensionEdgeDef, k as ExtensionOntologyRelation, l as ExtensionIndex } from '../extension-types-YGFJPrzK.cjs';
|
|
4
4
|
import { T as TypeGraphError } from '../index-SEvUHDA6.cjs';
|
|
5
5
|
import { R as Result } from '../result-DWo6mUVz.cjs';
|
|
6
6
|
export { i as isErr, a as isOk, u as unwrap } from '../result-DWo6mUVz.cjs';
|
|
7
|
-
import { G as GraphBackend, M as MetaEdge, I as IndexDeclaration } from '../types-
|
|
7
|
+
import { G as GraphBackend, M as MetaEdge, I as IndexDeclaration } from '../types-DkNnF-7K.cjs';
|
|
8
8
|
import { z } from 'zod';
|
|
9
9
|
import '../materialize-indexes-D20xNluI.cjs';
|
|
10
10
|
import 'drizzle-orm';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { G as GraphDef, t as NodeKinds, u as GetNodeType } from '../manager-
|
|
2
|
-
import { S as Store, N as Node, U as UniqueIntrospection } from '../store-view-
|
|
1
|
+
import { G as GraphDef, t as NodeKinds, u as GetNodeType } from '../manager-BZUeN_BU.js';
|
|
2
|
+
import { S as Store, N as Node, U as UniqueIntrospection } from '../store-view-BlgnhEYf.js';
|
|
3
3
|
import { d as NodeId, N as NodeType, e as EdgeId, J as JsonValue, f as KindAnnotations, g as EdgeType, D as DeleteBehavior, T as TemporalMode, h as GraphExtensionVersion, i as ExtensionNodeDef, j as ExtensionEdgeDef, k as ExtensionOntologyRelation, l as ExtensionIndex } from '../extension-types-YGFJPrzK.js';
|
|
4
4
|
import { T as TypeGraphError } from '../index-DGX6D9j1.js';
|
|
5
5
|
import { R as Result } from '../result-DWo6mUVz.js';
|
|
6
6
|
export { i as isErr, a as isOk, u as unwrap } from '../result-DWo6mUVz.js';
|
|
7
|
-
import { G as GraphBackend, M as MetaEdge, I as IndexDeclaration } from '../types-
|
|
7
|
+
import { G as GraphBackend, M as MetaEdge, I as IndexDeclaration } from '../types-D1Sqeyxy.js';
|
|
8
8
|
import { z } from 'zod';
|
|
9
9
|
import '../materialize-indexes-CAkIYFV-.js';
|
|
10
10
|
import 'drizzle-orm';
|
|
@@ -1,19 +1,28 @@
|
|
|
1
|
-
import { createStoreWithSchema
|
|
1
|
+
import { createStoreWithSchema } from '../chunk-WLRIWYHQ.js';
|
|
2
2
|
import '../chunk-3EUKJEQ3.js';
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import '../chunk-
|
|
7
|
-
import '../chunk-
|
|
8
|
-
import '../chunk-
|
|
9
|
-
import '../chunk-
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
import '../chunk-
|
|
13
|
-
import
|
|
14
|
-
import '../chunk-
|
|
15
|
-
|
|
3
|
+
import '../chunk-QV245VMN.js';
|
|
4
|
+
import { exportGraph, importGraph } from '../chunk-T2DWPQNE.js';
|
|
5
|
+
import '../chunk-6SCVW4AS.js';
|
|
6
|
+
import { defineNode, computeSchemaHash, serializeSchema } from '../chunk-K2TGS3EN.js';
|
|
7
|
+
import { sortedReplacer } from '../chunk-UR7W5YQK.js';
|
|
8
|
+
import { getNodeKinds, getEdgeKinds, defineGraph } from '../chunk-CHXTTSC6.js';
|
|
9
|
+
import '../chunk-SHLY4MCM.js';
|
|
10
|
+
import '../chunk-KUTNI6SI.js';
|
|
11
|
+
import '../chunk-4DIBPQNJ.js';
|
|
12
|
+
import { sha256Hex } from '../chunk-K34OPSJK.js';
|
|
13
|
+
import '../chunk-BVTWD66D.js';
|
|
14
|
+
import { ok, err, isErr, computeTransitiveClosure, isReachable } from '../chunk-ZURTTSCM.js';
|
|
15
|
+
export { isErr, isOk, unwrap } from '../chunk-ZURTTSCM.js';
|
|
16
|
+
import { compareStrings } from '../chunk-4S2FXGBJ.js';
|
|
17
|
+
import { generateId, computeUniqueKey } from '../chunk-A7SZZFAG.js';
|
|
18
|
+
import '../chunk-V3QNTB7Z.js';
|
|
19
|
+
import '../chunk-XXVEULWX.js';
|
|
20
|
+
import '../chunk-2MRAX3UE.js';
|
|
21
|
+
import '../chunk-GZCNZ7QW.js';
|
|
22
|
+
import '../chunk-2EBMPJBO.js';
|
|
23
|
+
import '../chunk-Z5XBMDXU.js';
|
|
16
24
|
import '../chunk-XLUNB2TZ.js';
|
|
25
|
+
import '../chunk-ITE4IXAK.js';
|
|
17
26
|
import { TypeGraphError } from '../chunk-TQOYM4LN.js';
|
|
18
27
|
import '../chunk-K5P5OZXS.js';
|
|
19
28
|
import { z } from 'zod';
|
|
@@ -25,6 +34,16 @@ function canonicalizeProps(props) {
|
|
|
25
34
|
function canonicalValueKey(value) {
|
|
26
35
|
return JSON.stringify(value, sortedReplacer);
|
|
27
36
|
}
|
|
37
|
+
function edgeStateSignature(edge) {
|
|
38
|
+
return JSON.stringify([
|
|
39
|
+
edge.fromKind,
|
|
40
|
+
edge.fromId,
|
|
41
|
+
edge.toKind,
|
|
42
|
+
edge.toId,
|
|
43
|
+
edge.live,
|
|
44
|
+
canonicalizeProps(edge.props)
|
|
45
|
+
]);
|
|
46
|
+
}
|
|
28
47
|
function parseRowProps(props) {
|
|
29
48
|
let parsed;
|
|
30
49
|
try {
|
|
@@ -48,9 +67,6 @@ function mergeKey(kind, id) {
|
|
|
48
67
|
}
|
|
49
68
|
return `${kind}${SEPARATOR}${id}`;
|
|
50
69
|
}
|
|
51
|
-
function compareStrings(left, right) {
|
|
52
|
-
return left < right ? -1 : left > right ? 1 : 0;
|
|
53
|
-
}
|
|
54
70
|
function mergeKeyOf(node) {
|
|
55
71
|
return mergeKey(node.kind, node.id);
|
|
56
72
|
}
|
|
@@ -226,13 +242,14 @@ function diffEdgeKind(kind, baseRows, forkRows) {
|
|
|
226
242
|
function byId(left, right) {
|
|
227
243
|
return compareStrings(left.id, right.id);
|
|
228
244
|
}
|
|
229
|
-
async function diffAgainstBase(baseStore, forkStore) {
|
|
245
|
+
async function diffAgainstBase(baseStore, forkStore, captureForkState = true) {
|
|
230
246
|
const graph = baseStore.graph;
|
|
231
247
|
const nodeKinds = getNodeKinds(graph);
|
|
232
248
|
const edgeKinds = getEdgeKinds(graph);
|
|
233
249
|
const newNodes = [];
|
|
234
250
|
const modifiedNodes = [];
|
|
235
251
|
const deletedNodes = [];
|
|
252
|
+
const forkNodeVersions = /* @__PURE__ */ new Map();
|
|
236
253
|
for (const kind of nodeKinds) {
|
|
237
254
|
const baseRows = await enumerateAllNodes(
|
|
238
255
|
baseStore.backend,
|
|
@@ -244,6 +261,11 @@ async function diffAgainstBase(baseStore, forkStore) {
|
|
|
244
261
|
forkStore.graphId,
|
|
245
262
|
kind
|
|
246
263
|
);
|
|
264
|
+
if (captureForkState) {
|
|
265
|
+
for (const row of forkRows) {
|
|
266
|
+
forkNodeVersions.set(mergeKey(kind, row.id), row.version);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
247
269
|
const delta = diffNodeKind(kind, baseRows, forkRows);
|
|
248
270
|
for (const entry of delta.new) {
|
|
249
271
|
newNodes.push(entry);
|
|
@@ -258,6 +280,7 @@ async function diffAgainstBase(baseStore, forkStore) {
|
|
|
258
280
|
const newEdges = [];
|
|
259
281
|
const modifiedEdges = [];
|
|
260
282
|
const deletedEdges = [];
|
|
283
|
+
const forkEdgeSignatures = /* @__PURE__ */ new Map();
|
|
261
284
|
for (const kind of edgeKinds) {
|
|
262
285
|
const baseRows = await enumerateAllEdges(
|
|
263
286
|
baseStore.backend,
|
|
@@ -269,6 +292,21 @@ async function diffAgainstBase(baseStore, forkStore) {
|
|
|
269
292
|
forkStore.graphId,
|
|
270
293
|
kind
|
|
271
294
|
);
|
|
295
|
+
if (captureForkState) {
|
|
296
|
+
for (const row of forkRows) {
|
|
297
|
+
forkEdgeSignatures.set(
|
|
298
|
+
mergeKey(kind, row.id),
|
|
299
|
+
edgeStateSignature({
|
|
300
|
+
fromKind: row.from_kind,
|
|
301
|
+
fromId: row.from_id,
|
|
302
|
+
toKind: row.to_kind,
|
|
303
|
+
toId: row.to_id,
|
|
304
|
+
live: isLive(row),
|
|
305
|
+
props: parseRowProps(row.props)
|
|
306
|
+
})
|
|
307
|
+
);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
272
310
|
const delta = diffEdgeKind(kind, baseRows, forkRows);
|
|
273
311
|
for (const entry of delta.new) {
|
|
274
312
|
newEdges.push(entry);
|
|
@@ -290,7 +328,9 @@ async function diffAgainstBase(baseStore, forkStore) {
|
|
|
290
328
|
new: newEdges.sort((left, right) => byId(left, right)),
|
|
291
329
|
modified: modifiedEdges.sort((left, right) => byId(left, right)),
|
|
292
330
|
deleted: deletedEdges.sort((left, right) => byId(left, right))
|
|
293
|
-
}
|
|
331
|
+
},
|
|
332
|
+
forkNodeVersions,
|
|
333
|
+
forkEdgeSignatures
|
|
294
334
|
};
|
|
295
335
|
}
|
|
296
336
|
|
|
@@ -2461,16 +2501,26 @@ function groupByKind(items) {
|
|
|
2461
2501
|
}
|
|
2462
2502
|
return ordered;
|
|
2463
2503
|
}
|
|
2464
|
-
async function stageBranches(baseStore, branches) {
|
|
2504
|
+
async function stageBranches(baseStore, branches, captureTargetStateFor) {
|
|
2465
2505
|
const newNodes = [];
|
|
2466
2506
|
const modifiedNodes = [];
|
|
2467
2507
|
const deletedNodes = [];
|
|
2468
2508
|
const newEdges = [];
|
|
2469
2509
|
const modifiedEdges = [];
|
|
2470
2510
|
const deletedEdges = [];
|
|
2511
|
+
let targetNodeVersions = /* @__PURE__ */ new Map();
|
|
2512
|
+
let targetEdgeSignatures = /* @__PURE__ */ new Map();
|
|
2471
2513
|
for (const branch2 of branches) {
|
|
2472
|
-
const diff = await diffAgainstBase(baseStore, branch2.store);
|
|
2473
2514
|
const branchId = branch2.id;
|
|
2515
|
+
const diff = await diffAgainstBase(
|
|
2516
|
+
baseStore,
|
|
2517
|
+
branch2.store,
|
|
2518
|
+
branchId === captureTargetStateFor
|
|
2519
|
+
);
|
|
2520
|
+
if (branchId === captureTargetStateFor) {
|
|
2521
|
+
targetNodeVersions = diff.forkNodeVersions;
|
|
2522
|
+
targetEdgeSignatures = diff.forkEdgeSignatures;
|
|
2523
|
+
}
|
|
2474
2524
|
for (const node of diff.nodes.new) {
|
|
2475
2525
|
newNodes.push({ branchId, node, kind: node.kind, id: node.id });
|
|
2476
2526
|
}
|
|
@@ -2504,7 +2554,9 @@ async function stageBranches(baseStore, branches) {
|
|
|
2504
2554
|
),
|
|
2505
2555
|
deletedEdges: [...deletedEdges].sort(
|
|
2506
2556
|
(left, right) => compareByKindIdBranch(left, right)
|
|
2507
|
-
)
|
|
2557
|
+
),
|
|
2558
|
+
targetNodeVersions,
|
|
2559
|
+
targetEdgeSignatures
|
|
2508
2560
|
};
|
|
2509
2561
|
}
|
|
2510
2562
|
|
|
@@ -3381,8 +3433,8 @@ async function resolveMerge(store, target, branches, options, useBaseSources, in
|
|
|
3381
3433
|
}
|
|
3382
3434
|
}
|
|
3383
3435
|
try {
|
|
3384
|
-
const staging = await stageBranches(store, branches);
|
|
3385
3436
|
const preferredBranchId = incremental?.targetBranchId;
|
|
3437
|
+
const staging = await stageBranches(store, branches, preferredBranchId);
|
|
3386
3438
|
const branchIds = branches.map((branch2) => branch2.id);
|
|
3387
3439
|
const branchOrder = preferredBranchId === void 0 ? options.branchOrder ?? [] : [
|
|
3388
3440
|
preferredBranchId,
|
|
@@ -3436,7 +3488,9 @@ async function resolveMerge(store, target, branches, options, useBaseSources, in
|
|
|
3436
3488
|
// anything NEW the in-tx re-probe surfaces is a window write.
|
|
3437
3489
|
plannedBaseMatchKeys: new Set(
|
|
3438
3490
|
candidates.data.baseMembers.map((member) => mergeKeyOf(member))
|
|
3439
|
-
)
|
|
3491
|
+
),
|
|
3492
|
+
targetNodeVersions: staging.targetNodeVersions,
|
|
3493
|
+
targetEdgeSignatures: staging.targetEdgeSignatures
|
|
3440
3494
|
});
|
|
3441
3495
|
const provenance = options.provenance ? buildProvenanceIndex(plan.provenanceRecords) : { byBranch: () => ({ nodeIds: [], edgeIds: [] }) };
|
|
3442
3496
|
const warnings = [...plan.warnings];
|
|
@@ -3866,6 +3920,99 @@ async function assertBaseResolutionStable(lookupStore, guard) {
|
|
|
3866
3920
|
}
|
|
3867
3921
|
);
|
|
3868
3922
|
}
|
|
3923
|
+
function bucketInheritedRefsByKind(refs, identities) {
|
|
3924
|
+
const seen = /* @__PURE__ */ new Set();
|
|
3925
|
+
const idsByKind = /* @__PURE__ */ new Map();
|
|
3926
|
+
for (const ref of refs) {
|
|
3927
|
+
const identity = mergeKey(ref.kind, ref.id);
|
|
3928
|
+
if (!identities.has(identity) || seen.has(identity)) {
|
|
3929
|
+
continue;
|
|
3930
|
+
}
|
|
3931
|
+
seen.add(identity);
|
|
3932
|
+
const bucket = idsByKind.get(ref.kind) ?? [];
|
|
3933
|
+
bucket.push(ref.id);
|
|
3934
|
+
idsByKind.set(ref.kind, bucket);
|
|
3935
|
+
}
|
|
3936
|
+
return idsByKind;
|
|
3937
|
+
}
|
|
3938
|
+
async function assertInheritedUnchanged(args) {
|
|
3939
|
+
if (args.expected.size === 0) {
|
|
3940
|
+
return;
|
|
3941
|
+
}
|
|
3942
|
+
const idsByKind = bucketInheritedRefsByKind(args.refs, args.expected);
|
|
3943
|
+
for (const [kind, ids] of idsByKind) {
|
|
3944
|
+
const rows = await args.fetchRows(kind, ids);
|
|
3945
|
+
for (const [index, id] of ids.entries()) {
|
|
3946
|
+
const expected = args.expected.get(mergeKey(kind, id));
|
|
3947
|
+
const current = args.deriveValue(rows[index]);
|
|
3948
|
+
if (current === expected) {
|
|
3949
|
+
continue;
|
|
3950
|
+
}
|
|
3951
|
+
throw args.buildError(id, kind, expected, current);
|
|
3952
|
+
}
|
|
3953
|
+
}
|
|
3954
|
+
}
|
|
3955
|
+
async function assertInheritedTargetUnchanged(nodesApi, edgesApi, guard, plan) {
|
|
3956
|
+
await Promise.all([
|
|
3957
|
+
assertInheritedNodesUnchanged(nodesApi, guard, plan),
|
|
3958
|
+
assertInheritedEdgesUnchanged(edgesApi, guard, plan)
|
|
3959
|
+
]);
|
|
3960
|
+
}
|
|
3961
|
+
async function assertInheritedNodesUnchanged(nodesApi, guard, plan) {
|
|
3962
|
+
const nodeRefs = plannedNodeWrites(plan).map(
|
|
3963
|
+
(write) => ({ kind: write.kind, id: write.id })
|
|
3964
|
+
);
|
|
3965
|
+
for (const [identity, kind] of plan.nodeDeletions) {
|
|
3966
|
+
nodeRefs.push({ kind, id: idOf(identity) });
|
|
3967
|
+
}
|
|
3968
|
+
await assertInheritedUnchanged({
|
|
3969
|
+
refs: nodeRefs,
|
|
3970
|
+
expected: guard.targetNodeVersions,
|
|
3971
|
+
fetchRows: (kind, ids) => nodeCollection(nodesApi, kind).getByIds(ids, INCLUDE_TOMBSTONES),
|
|
3972
|
+
deriveValue: (row) => row?.meta.version,
|
|
3973
|
+
buildError: (id, kind, expected, current) => new BaseVersionMismatchError(
|
|
3974
|
+
`mergeIncremental() observed committed node "${id}" (kind "${kind}") at version ${expected} while planning, but it changed before the commit transaction; the resolved plan no longer describes the live target and was not applied.`,
|
|
3975
|
+
{
|
|
3976
|
+
details: {
|
|
3977
|
+
id,
|
|
3978
|
+
kind,
|
|
3979
|
+
expectedVersion: expected,
|
|
3980
|
+
currentVersion: current
|
|
3981
|
+
},
|
|
3982
|
+
suggestion: "Re-run mergeIncremental(); the re-planned merge resolves the inherited modifications against the now-committed rows."
|
|
3983
|
+
}
|
|
3984
|
+
)
|
|
3985
|
+
});
|
|
3986
|
+
}
|
|
3987
|
+
async function assertInheritedEdgesUnchanged(edgesApi, guard, plan) {
|
|
3988
|
+
const edgeRefs = plan.mergedEdges.map((edge) => ({
|
|
3989
|
+
kind: edge.kind,
|
|
3990
|
+
id: edge.id
|
|
3991
|
+
}));
|
|
3992
|
+
for (const [identity, kind] of plan.edgeDeletions) {
|
|
3993
|
+
edgeRefs.push({ kind, id: idOf(identity) });
|
|
3994
|
+
}
|
|
3995
|
+
await assertInheritedUnchanged({
|
|
3996
|
+
refs: edgeRefs,
|
|
3997
|
+
expected: guard.targetEdgeSignatures,
|
|
3998
|
+
fetchRows: (kind, ids) => edgeCollection(edgesApi, kind).getByIds(ids, INCLUDE_TOMBSTONES),
|
|
3999
|
+
deriveValue: (row) => row === void 0 ? void 0 : edgeStateSignature({
|
|
4000
|
+
fromKind: row.fromKind,
|
|
4001
|
+
fromId: row.fromId,
|
|
4002
|
+
toKind: row.toKind,
|
|
4003
|
+
toId: row.toId,
|
|
4004
|
+
live: row.meta.deletedAt === void 0,
|
|
4005
|
+
props: edgeProps(row)
|
|
4006
|
+
}),
|
|
4007
|
+
buildError: (id, kind) => new BaseVersionMismatchError(
|
|
4008
|
+
`mergeIncremental() observed committed edge "${id}" (kind "${kind}") while planning, but its endpoints, liveness, or props changed before the commit transaction; the resolved plan no longer describes the live target and was not applied.`,
|
|
4009
|
+
{
|
|
4010
|
+
details: { id, kind },
|
|
4011
|
+
suggestion: "Re-run mergeIncremental(); the re-planned merge resolves the inherited modifications against the now-committed rows."
|
|
4012
|
+
}
|
|
4013
|
+
)
|
|
4014
|
+
});
|
|
4015
|
+
}
|
|
3869
4016
|
async function commitIncrementalPlan(target, plan, guard) {
|
|
3870
4017
|
if (!target.backend.capabilities.transactions) {
|
|
3871
4018
|
throw new MergeError(
|
|
@@ -3878,6 +4025,7 @@ async function commitIncrementalPlan(target, plan, guard) {
|
|
|
3878
4025
|
const nodesApi = tx.nodes;
|
|
3879
4026
|
const edgesApi = tx.edges;
|
|
3880
4027
|
await assertBaseResolutionStable(tx, guard);
|
|
4028
|
+
await assertInheritedTargetUnchanged(nodesApi, edgesApi, guard, plan);
|
|
3881
4029
|
await validateIncrementalNodeWrites(target, nodesApi, plan);
|
|
3882
4030
|
await validateIncrementalEdgeWrites(target, edgesApi, plan);
|
|
3883
4031
|
return applyMergePlan(plan, nodesApi, edgesApi);
|