@cortexkit/opencode-magic-context 0.49.80 → 0.49.82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auto-search-worker.js +3 -3
- package/dist/chunk-embedding-write-worker.js +4 -4
- package/dist/{conflict-warning-hook-m8yezwdj.js → conflict-warning-hook-a0wrnzch.js} +3 -3
- package/dist/{context-7rkrv5q8.js → context-00f1hdz2.js} +278 -43
- package/dist/{embedding-backfill-0tvprmrn.js → embedding-backfill-k994xdas.js} +4 -4
- package/dist/features/magic-context/memory/identity-merge-command.d.ts +4 -0
- package/dist/features/magic-context/memory/identity-merge-command.d.ts.map +1 -0
- package/dist/features/magic-context/memory/project-binding-notice.d.ts +5 -0
- package/dist/features/magic-context/memory/project-binding-notice.d.ts.map +1 -0
- package/dist/features/magic-context/memory/project-identity.d.ts +1 -0
- package/dist/features/magic-context/memory/project-identity.d.ts.map +1 -1
- package/dist/features/magic-context/storage-clone.d.ts +17 -0
- package/dist/features/magic-context/storage-clone.d.ts.map +1 -1
- package/dist/features/magic-context/store-generation-rebase.d.ts +13 -0
- package/dist/features/magic-context/store-generation-rebase.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-incremental.d.ts +1 -7
- package/dist/hooks/magic-context/compartment-runner-incremental.d.ts.map +1 -1
- package/dist/hooks/magic-context/execute-status.d.ts.map +1 -1
- package/dist/hooks/magic-context/inject-compartments.d.ts +16 -0
- package/dist/hooks/magic-context/inject-compartments.d.ts.map +1 -1
- package/dist/hooks/magic-context/rust-mode-transform.d.ts.map +1 -1
- package/dist/hooks/magic-context/stored-compartment-gaps.d.ts +16 -0
- package/dist/hooks/magic-context/stored-compartment-gaps.d.ts.map +1 -0
- package/dist/hooks/magic-context/transform.d.ts +1 -0
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/{index-m4q6ptgz.js → index-2xhzmwf6.js} +4 -4
- package/dist/{index-jhhkb4jv.js → index-2ygw6q5s.js} +1 -1
- package/dist/{index-v0epndb8.js → index-93rezfvc.js} +22 -2
- package/dist/{index-exvsw656.js → index-b2787fk6.js} +116 -42
- package/dist/{index-tebcx987.js → index-bd34njzg.js} +1 -1
- package/dist/{index-zpd4pxnp.js → index-dg5jvh9r.js} +6 -6
- package/dist/{index-6athgjba.js → index-e21n48yd.js} +34 -2
- package/dist/{index-ezgeq2z7.js → index-eptthgkw.js} +5 -5
- package/dist/{index-9554nr2q.js → index-fgy6hnr3.js} +6 -1
- package/dist/{index-tzy5h4x6.js → index-fpqdbb67.js} +1 -1
- package/dist/{v2/server-x8a7jmkh.js → index-fzgyvsb1.js} +15 -4
- package/dist/{index-1sq1krqw.js → index-g6hfh4h4.js} +4 -4
- package/dist/{index-hpmx99e9.js → index-hz1xdb15.js} +3 -3
- package/dist/{index-xjpemea9.js → index-jvr9ba9y.js} +151 -37
- package/dist/{index-esqcwes7.js → index-nxxzeq4y.js} +4 -2
- package/dist/{index-m6rkq3t4.js → index-rnyaa7cj.js} +1 -1
- package/dist/{index-yfn52pb6.js → index-shpyv8gq.js} +2 -2
- package/dist/{index-pzvdf7sr.js → index-stx8zd81.js} +3 -3
- package/dist/{index-jg7sbt3v.js → index-vpw46557.js} +1 -1
- package/dist/{index-xx05vta0.js → index-w2wpx7t5.js} +1 -1
- package/dist/{index-177yv84k.js → index-w8dcjt7f.js} +1 -1
- package/dist/{index-mgvj4vkb.js → index-wxxcfpxh.js} +5 -5
- package/dist/{index-xsdaz3mq.js → index-x8qgqnym.js} +30 -11
- package/dist/{index-aawwdt26.js → index-zvane1rq.js} +2 -2
- package/dist/index.js +32 -32
- package/dist/migration-worker.js +3 -3
- package/dist/plugin/rpc-handlers.d.ts +2 -0
- package/dist/plugin/rpc-handlers.d.ts.map +1 -1
- package/dist/{project-embedding-registry-sw4z2ptg.js → project-embedding-registry-y3z36mjy.js} +3 -3
- package/dist/raw-ordinal-warmup-worker.js +2 -2
- package/dist/{recomp-orchestrator-n7h0a0tn.js → recomp-orchestrator-fjdp3t1d.js} +14 -14
- package/dist/{render-bjxgkrk6.js → render-c9fjwrad.js} +6 -6
- package/dist/{rpc-notifications-3hed126v.js → rpc-notifications-t9q0ynq7.js} +3 -1
- package/dist/{search-z56487n8.js → search-1jejx5cx.js} +9 -9
- package/dist/{search-archive-p3jhx9wc.js → search-archive-s2jas2jb.js} +2 -2
- package/dist/{send-session-notification-ykvt5k2s.js → send-session-notification-7x518gew.js} +1 -1
- package/dist/shared/conflict-detector.d.ts +6 -0
- package/dist/shared/conflict-detector.d.ts.map +1 -1
- package/dist/shared/conflict-fixer.d.ts +1 -0
- package/dist/shared/conflict-fixer.d.ts.map +1 -1
- package/dist/shared/prompt-surface-runtime.d.ts +1 -1
- package/dist/shared/rpc-notifications.d.ts +8 -3
- package/dist/shared/rpc-notifications.d.ts.map +1 -1
- package/dist/shared/rpc-types.d.ts +4 -0
- package/dist/shared/rpc-types.d.ts.map +1 -1
- package/dist/shared/status-summary.d.ts +2 -0
- package/dist/shared/status-summary.d.ts.map +1 -1
- package/dist/shared/status-view-check.d.ts.map +1 -1
- package/dist/shared/status-view.d.ts +1 -0
- package/dist/shared/status-view.d.ts.map +1 -1
- package/dist/shared/user-facing-codes.d.ts +5 -0
- package/dist/shared/user-facing-codes.d.ts.map +1 -1
- package/dist/{store-8trkpmtx.js → store-ggrq9e14.js} +6 -2
- package/dist/{store-reader-3eh1s1m8.js → store-reader-tr64nxyy.js} +1 -1
- package/dist/tools/ctx-memory/constants.d.ts +1 -1
- package/dist/tools/ctx-memory/constants.d.ts.map +1 -1
- package/dist/tools/light-descriptions.d.ts +1 -1
- package/dist/tools/light-descriptions.d.ts.map +1 -1
- package/dist/tools/parameter-descriptions.d.ts +6 -6
- package/dist/tools/parameter-descriptions.d.ts.map +1 -1
- package/dist/{transform-postprocess-phase-f0wssyce.js → transform-postprocess-phase-p2egg02g.js} +15 -15
- package/dist/v2/auto-search-worker.js +3 -3
- package/dist/v2/chunk-embedding-write-worker.js +4 -4
- package/dist/v2/{context-r1swhysg.js → context-gwkgh0wd.js} +398 -58
- package/dist/v2/{embedding-backfill-qnaswpmb.js → embedding-backfill-hjvjxp7d.js} +4 -4
- package/dist/v2/fold/owner.d.ts +8 -0
- package/dist/v2/fold/owner.d.ts.map +1 -1
- package/dist/v2/fork-inheritance.d.ts +25 -17
- package/dist/v2/fork-inheritance.d.ts.map +1 -1
- package/dist/v2/hidden-child-native.d.ts +6 -6
- package/dist/v2/hidden-child-native.d.ts.map +1 -1
- package/dist/v2/hidden-child-record.d.ts +21 -3
- package/dist/v2/hidden-child-record.d.ts.map +1 -1
- package/dist/v2/hidden-child-sweep.d.ts +1 -1
- package/dist/v2/hidden-child-sweep.d.ts.map +1 -1
- package/dist/v2/hidden-completion.d.ts +1 -0
- package/dist/v2/hidden-completion.d.ts.map +1 -1
- package/dist/v2/hidden-run-holder.d.ts +16 -0
- package/dist/v2/hidden-run-holder.d.ts.map +1 -0
- package/dist/v2/hooks/context.d.ts.map +1 -1
- package/dist/v2/hooks/dream-timer.d.ts +5 -7
- package/dist/v2/hooks/dream-timer.d.ts.map +1 -1
- package/dist/v2/hooks/fork-history-status.d.ts +10 -0
- package/dist/v2/hooks/fork-history-status.d.ts.map +1 -0
- package/dist/v2/hooks/hidden-child.d.ts.map +1 -1
- package/dist/v2/hooks/store.d.ts +4 -0
- package/dist/v2/hooks/store.d.ts.map +1 -1
- package/dist/v2/hooks/types.d.ts +5 -26
- package/dist/v2/hooks/types.d.ts.map +1 -1
- package/dist/v2/migration-worker.js +3 -3
- package/dist/v2/{project-embedding-registry-52f2jept.js → project-embedding-registry-mzsvyads.js} +3 -3
- package/dist/v2/raw-ordinal-warmup-worker.js +2 -2
- package/dist/v2/{recomp-orchestrator-4w2w4kd4.js → recomp-orchestrator-jn39mxh0.js} +13 -13
- package/dist/v2/{render-hwqk0d8t.js → render-q2aj9bgy.js} +6 -6
- package/dist/v2/{rpc-notifications-3hed126v.js → rpc-notifications-t9q0ynq7.js} +3 -1
- package/dist/v2/{search-eftsvbg7.js → search-9xn6ds9x.js} +8 -8
- package/dist/v2/{search-archive-mdxzvgpm.js → search-archive-fj59gjv1.js} +2 -2
- package/dist/v2/{send-session-notification-8g4r97bp.js → send-session-notification-p52rhjzy.js} +1 -1
- package/dist/v2/{server-ma9jwnas.js → server-1cn3kryt.js} +4 -4
- package/dist/v2/{server-34pvhvxt.js → server-1efjj215.js} +22 -2
- package/dist/v2/{server-jn4pktdk.js → server-2ktxmtbd.js} +1 -1
- package/dist/v2/{server-zw1e3wq5.js → server-2w1rdttn.js} +1 -1
- package/dist/v2/{server-jtq03rkb.js → server-4z964n1c.js} +1 -1
- package/dist/v2/{server-pxdpwycq.js → server-53n8hv5q.js} +6 -6
- package/dist/v2/{server-rbtx6q5v.js → server-569he5mh.js} +1 -1
- package/dist/v2/{server-rthnpmbp.js → server-5yfq912a.js} +34 -2
- package/dist/v2/{server-mhrgymcs.js → server-68q80y27.js} +2 -2
- package/dist/v2/{server-afsz3cmx.js → server-bt546axy.js} +1 -1
- package/dist/v2/{server-dhdn8mwq.js → server-c8mqs0v5.js} +30 -11
- package/dist/{index-x8a7jmkh.js → v2/server-fzgyvsb1.js} +15 -4
- package/dist/v2/{server-76v5y7zm.js → server-g1a0nhtk.js} +2 -2
- package/dist/v2/{server-25qtxt4d.js → server-gx1s06dx.js} +6 -1
- package/dist/v2/{server-x8ksqcw7.js → server-pejjj0nv.js} +1 -1
- package/dist/v2/{server-fqnty3nk.js → server-vt6nj2hn.js} +111 -37
- package/dist/v2/{server-qjff96a6.js → server-wdq85mxj.js} +4 -4
- package/dist/v2/server.js +3 -3
- package/dist/v2/{store-m3zny7q2.js → store-qdgzd38f.js} +6 -2
- package/dist/v2/{store-reader-yaxtdy6f.js → store-reader-83tka051.js} +1 -1
- package/dist/v2/store-reader.d.ts +15 -8
- package/dist/v2/store-reader.d.ts.map +1 -1
- package/dist/v2/tui/index.d.ts +1 -1
- package/dist/v2/tui/index.d.ts.map +1 -1
- package/dist/v2/{v2-archive-reader-p89x05hj.js → v2-archive-reader-9z8z97db.js} +1 -1
- package/dist/v2/{wrapup-orchestrator-0f4nwpbv.js → wrapup-orchestrator-vd5zfp3v.js} +13 -13
- package/dist/{v2-archive-reader-vzmzb245.js → v2-archive-reader-r0xpxsb1.js} +1 -1
- package/dist/{wrapup-orchestrator-5k9hgb3t.js → wrapup-orchestrator-k29zqfp9.js} +15 -15
- package/package.json +1 -1
- package/src/agents/smart-notes-dreamer-gate.golden.json +169 -169
- package/src/shared/conflict-detector.ts +35 -2
- package/src/shared/conflict-fixer.ts +10 -6
- package/src/shared/fold-render-lock-fence.test.ts +2 -0
- package/src/shared/prompt-surface-a1-golden.md +8 -7
- package/src/shared/rpc-notifications.test.ts +29 -0
- package/src/shared/rpc-notifications.ts +24 -5
- package/src/shared/rpc-types.ts +4 -0
- package/src/shared/status-summary.ts +9 -1
- package/src/shared/status-view-check.ts +2 -0
- package/src/shared/status-view.test.ts +9 -0
- package/src/shared/status-view.ts +4 -0
- package/src/shared/user-facing-codes.ts +5 -0
- package/src/tui/slots/sidebar-content.tsx +11 -5
- package/src/tui-compiled/slots/sidebar-content.tsx +191 -176
- package/src/v2/tui/index.ts +7 -2
|
@@ -114,6 +114,9 @@ import {
|
|
|
114
114
|
DREAMER_CLASSIFIER_AGENT,
|
|
115
115
|
DREAMER_DOCS_AGENT,
|
|
116
116
|
DREAMER_REVIEWER_AGENT,
|
|
117
|
+
supportsQuietHiddenChildren,
|
|
118
|
+
matchesHiddenRunLocation,
|
|
119
|
+
hiddenRunPlacement,
|
|
117
120
|
HIDDEN_HISTORIAN_AGENT,
|
|
118
121
|
HIDDEN_DREAMER_AGENT,
|
|
119
122
|
HIDDEN_CURATE_AGENT,
|
|
@@ -158,6 +161,7 @@ import {
|
|
|
158
161
|
runTokenLog,
|
|
159
162
|
formatRunTokenLog,
|
|
160
163
|
createChildSessionWithFence,
|
|
164
|
+
validateStoredCompartments,
|
|
161
165
|
buildMagicContextSection,
|
|
162
166
|
getMuralIdentity,
|
|
163
167
|
getMural,
|
|
@@ -217,11 +221,12 @@ import {
|
|
|
217
221
|
hasRunnableCompartmentWindow,
|
|
218
222
|
recordHighPressureNoEligibleHead,
|
|
219
223
|
noteTransformPassForExactOrdinalReads,
|
|
224
|
+
nonNarrativeStoredGapRanges,
|
|
220
225
|
getActiveCompartmentRun,
|
|
221
226
|
startCompartmentAgent,
|
|
222
227
|
setRecompStarting2,
|
|
223
228
|
setRecompTerminal2
|
|
224
|
-
} from "./server-
|
|
229
|
+
} from "./server-vt6nj2hn.js";
|
|
225
230
|
import {
|
|
226
231
|
resolveHistorianModel2
|
|
227
232
|
} from "./server-5kym00ag.js";
|
|
@@ -239,6 +244,7 @@ import {
|
|
|
239
244
|
setHomeProjectPermission,
|
|
240
245
|
shouldSkipHomeProjectMemory,
|
|
241
246
|
ProjectIdentityError,
|
|
247
|
+
directoryFallback,
|
|
242
248
|
takeDubiousOwnershipProjectIdentityWarning,
|
|
243
249
|
isUserHomeDirectory,
|
|
244
250
|
resolveProjectIdentity,
|
|
@@ -250,7 +256,7 @@ import {
|
|
|
250
256
|
storedPathBelongsToIdentity,
|
|
251
257
|
beginBootQuietPeriod,
|
|
252
258
|
scheduleAfterBootQuiet
|
|
253
|
-
} from "./server-
|
|
259
|
+
} from "./server-bt546axy.js";
|
|
254
260
|
import"./server-v0p37hm2.js";
|
|
255
261
|
import {
|
|
256
262
|
inRootAsyncContext2,
|
|
@@ -650,7 +656,7 @@ import {
|
|
|
650
656
|
resolveMemoriesByIdsForSearch2,
|
|
651
657
|
unifiedSearch2,
|
|
652
658
|
formatSearchResults2
|
|
653
|
-
} from "./server-
|
|
659
|
+
} from "./server-53n8hv5q.js";
|
|
654
660
|
import {
|
|
655
661
|
embedPauseBySession,
|
|
656
662
|
embedRunStateBySession,
|
|
@@ -798,7 +804,7 @@ import {
|
|
|
798
804
|
saveSourceContent,
|
|
799
805
|
replaceSourceContent,
|
|
800
806
|
getSourceContents
|
|
801
|
-
} from "./server-
|
|
807
|
+
} from "./server-c8mqs0v5.js";
|
|
802
808
|
import {
|
|
803
809
|
startBootDeadline,
|
|
804
810
|
getUnconfirmedMigrationHolders,
|
|
@@ -814,7 +820,7 @@ import {
|
|
|
814
820
|
openDatabaseAsync,
|
|
815
821
|
isDatabasePersisted,
|
|
816
822
|
getDatabasePersistenceError
|
|
817
|
-
} from "./server-
|
|
823
|
+
} from "./server-g1a0nhtk.js";
|
|
818
824
|
import {
|
|
819
825
|
V2_MEMORY_CATEGORIES,
|
|
820
826
|
CATEGORY_PRIORITY
|
|
@@ -827,13 +833,13 @@ import {
|
|
|
827
833
|
resolveStoredPathWorkspaceIdentity,
|
|
828
834
|
storedPathBelongsToWorkspace,
|
|
829
835
|
computeWorkspaceEpochFingerprint
|
|
830
|
-
} from "./server-
|
|
836
|
+
} from "./server-2ktxmtbd.js";
|
|
831
837
|
import {
|
|
832
838
|
gaDatabasePath2,
|
|
833
839
|
RAW_MESSAGE_TYPES2,
|
|
834
840
|
V2StoreReaderPool2,
|
|
835
841
|
V2StoreReader2
|
|
836
|
-
} from "./server-
|
|
842
|
+
} from "./server-5yfq912a.js";
|
|
837
843
|
import {
|
|
838
844
|
configureContextDatabasePragmas2
|
|
839
845
|
} from "./server-fb3zxn06.js";
|
|
@@ -862,7 +868,7 @@ import {
|
|
|
862
868
|
createPrimer,
|
|
863
869
|
updatePrimerSupport,
|
|
864
870
|
updatePrimerAnswer
|
|
865
|
-
} from "./server-
|
|
871
|
+
} from "./server-569he5mh.js";
|
|
866
872
|
import {
|
|
867
873
|
deriveTriggerBudget2,
|
|
868
874
|
deriveHistorianChunkTokens2,
|
|
@@ -895,7 +901,7 @@ import {
|
|
|
895
901
|
embedSessionCompartmentChunks2,
|
|
896
902
|
getEmbeddingCoverageStatus2,
|
|
897
903
|
getAutoEmbeddingSessionCoverage2
|
|
898
|
-
} from "./server-
|
|
904
|
+
} from "./server-68q80y27.js";
|
|
899
905
|
import {
|
|
900
906
|
GIT_SWEEP_LEASE_RENEWAL_MS,
|
|
901
907
|
acquireGitSweepLease,
|
|
@@ -905,7 +911,7 @@ import {
|
|
|
905
911
|
releaseGitSweepLease,
|
|
906
912
|
recordSessionProjectIdentity,
|
|
907
913
|
hasRecordedSessionProjectIdentity
|
|
908
|
-
} from "./server-
|
|
914
|
+
} from "./server-4z964n1c.js";
|
|
909
915
|
import {
|
|
910
916
|
saveEmbeddingIfHashMatches,
|
|
911
917
|
invalidateProject2,
|
|
@@ -935,8 +941,8 @@ import {
|
|
|
935
941
|
readGitFileChangeTimesSince,
|
|
936
942
|
verificationFileExists,
|
|
937
943
|
normalizeVerificationFiles
|
|
938
|
-
} from "./server-
|
|
939
|
-
import"./server-
|
|
944
|
+
} from "./server-gx1s06dx.js";
|
|
945
|
+
import"./server-pejjj0nv.js";
|
|
940
946
|
import {
|
|
941
947
|
computeCueContentHash,
|
|
942
948
|
hasMuralCueColumns,
|
|
@@ -961,20 +967,22 @@ import {
|
|
|
961
967
|
supersededMemory2,
|
|
962
968
|
mergeMemoryStats2,
|
|
963
969
|
archiveMemory2,
|
|
970
|
+
getMemoryCount2,
|
|
964
971
|
getMemoryCountsByStatus2
|
|
965
972
|
} from "./server-jjvbk92s.js";
|
|
966
973
|
import {
|
|
967
974
|
registerNotificationSink2,
|
|
975
|
+
pushLiveNotification2,
|
|
968
976
|
pushNotification2,
|
|
969
977
|
acknowledgeNotifications2,
|
|
970
978
|
drainNotifications2,
|
|
971
979
|
isTuiConnected2
|
|
972
|
-
} from "./server-
|
|
980
|
+
} from "./server-fzgyvsb1.js";
|
|
973
981
|
import"./server-npdey91q.js";
|
|
974
982
|
import {
|
|
975
983
|
flushIgnoredMessages2,
|
|
976
984
|
sendStatusNotification2
|
|
977
|
-
} from "./server-
|
|
985
|
+
} from "./server-wdq85mxj.js";
|
|
978
986
|
import {
|
|
979
987
|
rememberHostMedia,
|
|
980
988
|
hostMediaAsset,
|
|
@@ -990,13 +998,15 @@ import {
|
|
|
990
998
|
HOST_RESTORE_MEDIA,
|
|
991
999
|
restoreRow,
|
|
992
1000
|
rawMessagePage2,
|
|
1001
|
+
readV2MessageRange2,
|
|
1002
|
+
iterateV2MessageRange2,
|
|
993
1003
|
servedBoundaryRow2,
|
|
994
1004
|
resolveV2BoundaryUserMessage2,
|
|
995
1005
|
readAllV2RawMessagesForConversion2,
|
|
996
1006
|
readV2RawMessagePagesForConversion2,
|
|
997
1007
|
createV2RawMessageReader2,
|
|
998
1008
|
createV2RawMessageProvider2
|
|
999
|
-
} from "./server-
|
|
1009
|
+
} from "./server-1efjj215.js";
|
|
1000
1010
|
import {
|
|
1001
1011
|
resolvePromptContext2
|
|
1002
1012
|
} from "./server-fmsr7v69.js";
|
|
@@ -1008,10 +1018,10 @@ import {
|
|
|
1008
1018
|
import"./server-52x68mj4.js";
|
|
1009
1019
|
import {
|
|
1010
1020
|
readV2ArchiveOffThread2
|
|
1011
|
-
} from "./server-
|
|
1021
|
+
} from "./server-1cn3kryt.js";
|
|
1012
1022
|
import {
|
|
1013
1023
|
renderSearchArchiveOffThread2
|
|
1014
|
-
} from "./server-
|
|
1024
|
+
} from "./server-2w1rdttn.js";
|
|
1015
1025
|
import {
|
|
1016
1026
|
markHostInstructionRow,
|
|
1017
1027
|
hostInstructionRow,
|
|
@@ -13471,6 +13481,79 @@ function createSystemPromptHashHandler(deps) {
|
|
|
13471
13481
|
};
|
|
13472
13482
|
}
|
|
13473
13483
|
|
|
13484
|
+
// src/features/magic-context/memory/identity-merge-command.ts
|
|
13485
|
+
var IDENTITY_MERGE_COMMAND = "npx @cortexkit/magic-context@latest doctor merge-identities";
|
|
13486
|
+
var IDENTITY_MERGE_PREVIEW_HINT = "It shows what would move. Add --apply to move them.";
|
|
13487
|
+
function shellArg(value, platform) {
|
|
13488
|
+
if (/^[\w.:/-]+$/.test(value))
|
|
13489
|
+
return value;
|
|
13490
|
+
return platform === "win32" ? `"${value}"` : `'${value.replaceAll("'", "'\\''")}'`;
|
|
13491
|
+
}
|
|
13492
|
+
function identityMergeCommand(from, to, platform = process.platform) {
|
|
13493
|
+
return `${IDENTITY_MERGE_COMMAND} --from ${shellArg(from, platform)} --to ${to ? shellArg(to, platform) : '"DESTINATION_IDENTITY"'}`;
|
|
13494
|
+
}
|
|
13495
|
+
|
|
13496
|
+
// src/features/magic-context/memory/project-binding-notice.ts
|
|
13497
|
+
var observedBindings = new WeakMap;
|
|
13498
|
+
function bindingLog(harness, directory, old, identity, memories) {
|
|
13499
|
+
return `project binding changed harness=${harness} cwd=${directory || "unknown"} old=${old ?? "none"} new=${identity} memories=${memories}`;
|
|
13500
|
+
}
|
|
13501
|
+
function observeSessionProjectBinding(db, sessionId, identity, directory, notify) {
|
|
13502
|
+
const change = recordSessionProjectIdentity(db, sessionId, identity);
|
|
13503
|
+
const harness = getHarness2();
|
|
13504
|
+
let observations = observedBindings.get(db);
|
|
13505
|
+
if (!observations) {
|
|
13506
|
+
observations = new BoundedSessionMap(1000);
|
|
13507
|
+
observedBindings.set(db, observations);
|
|
13508
|
+
}
|
|
13509
|
+
const key = `${harness}\x00${sessionId}`;
|
|
13510
|
+
const last = observations.get(key);
|
|
13511
|
+
const noticed = last?.noticed ?? new Set;
|
|
13512
|
+
const observation = {
|
|
13513
|
+
directory,
|
|
13514
|
+
noticed,
|
|
13515
|
+
warning: change ? undefined : last?.warning
|
|
13516
|
+
};
|
|
13517
|
+
observations.set(key, observation);
|
|
13518
|
+
const old = change?.previousProjectPath;
|
|
13519
|
+
if (!change || !old && harness !== "pi" && harness !== "omp")
|
|
13520
|
+
return;
|
|
13521
|
+
const memories = old ? getMemoryCount2(db, old) : 0;
|
|
13522
|
+
const binding = bindingLog(harness, directory, old, identity, memories);
|
|
13523
|
+
if (!old || !memories) {
|
|
13524
|
+
sessionLog2(sessionId, binding);
|
|
13525
|
+
return;
|
|
13526
|
+
}
|
|
13527
|
+
const oldDirectory = [last?.directory, directory].find((path) => path && directoryFallback(path) === old);
|
|
13528
|
+
const location = oldDirectory ? `the old folder (${oldDirectory})` : `the old project (${old})`;
|
|
13529
|
+
let guidance;
|
|
13530
|
+
if (old.startsWith("dir:") && /^(dir|git):/.test(identity)) {
|
|
13531
|
+
guidance = `Review the merge first:
|
|
13532
|
+
${identityMergeCommand(oldDirectory ?? old, identity)}
|
|
13533
|
+
${IDENTITY_MERGE_PREVIEW_HINT}`;
|
|
13534
|
+
} else if (old.startsWith("git:") && identity.startsWith("dir:")) {
|
|
13535
|
+
guidance = "A repository's memories cannot be merged into a folder project.";
|
|
13536
|
+
} else {
|
|
13537
|
+
guidance = "Run `npx @cortexkit/magic-context@latest doctor` to see how these memories can be merged.";
|
|
13538
|
+
}
|
|
13539
|
+
const count = `${memories} ${memories === 1 ? "memory" : "memories"}`;
|
|
13540
|
+
observation.warning = `${count} stayed under this session's previous project. Nothing was moved.
|
|
13541
|
+
${guidance}`;
|
|
13542
|
+
if (noticed.has(old)) {
|
|
13543
|
+
sessionLog2(sessionId, binding);
|
|
13544
|
+
return;
|
|
13545
|
+
}
|
|
13546
|
+
noticed.add(old);
|
|
13547
|
+
const notice = `This session changed projects. ${count} stayed with ${location}; nothing moved. ${guidance}`;
|
|
13548
|
+
sessionLog2(sessionId, `${binding} notice=${JSON.stringify(notice)}`);
|
|
13549
|
+
try {
|
|
13550
|
+
notify?.(notice);
|
|
13551
|
+
} catch {}
|
|
13552
|
+
}
|
|
13553
|
+
function getProjectBindingWarning(db, sessionId) {
|
|
13554
|
+
return observedBindings.get(db)?.peek(`${getHarness2()}\x00${sessionId}`)?.warning;
|
|
13555
|
+
}
|
|
13556
|
+
|
|
13474
13557
|
// src/hooks/magic-context/compaction-off-transition.ts
|
|
13475
13558
|
import { existsSync } from "node:fs";
|
|
13476
13559
|
var loggedUnverifiedMarkerCleanupRetry = false;
|
|
@@ -18779,7 +18862,11 @@ function createRustModeTransform(deps, options) {
|
|
|
18779
18862
|
const sessionProjectIdentity = (options.sessionProjectIdentityResolverForTests ?? resolveProjectIdentityForSession)(directory, deps.allowHomeProject);
|
|
18780
18863
|
if (sessionProjectIdentity) {
|
|
18781
18864
|
if (state.recordedSessionProjectIdentity !== sessionProjectIdentity) {
|
|
18782
|
-
|
|
18865
|
+
observeSessionProjectBinding(deps.db, sessionId, sessionProjectIdentity, directory, (notice) => {
|
|
18866
|
+
withoutSqliteTransformPass2(() => sendStatusNotification2(deps.client, sessionId, `## Project memory warning
|
|
18867
|
+
|
|
18868
|
+
${notice}`, {}));
|
|
18869
|
+
});
|
|
18783
18870
|
}
|
|
18784
18871
|
state.recordedSessionProjectIdentity = sessionProjectIdentity;
|
|
18785
18872
|
state.recordedSessionDirectory = directory;
|
|
@@ -21578,7 +21665,15 @@ Historian previously failed ${historianFailureState.failureCount} time(s), so Ma
|
|
|
21578
21665
|
const authorityProjectPath = (deps.memoryConfig?.enabled ? projectIdentity : undefined) ?? deps.projectPath ?? sessionProjectIdentity;
|
|
21579
21666
|
if (authorityProjectPath) {}
|
|
21580
21667
|
if (sessionIdentityForBinding && sessionDirectoryResolvedFromHost && recordedSessionProjectIdentity.get(sessionId) !== sessionIdentityForBinding) {
|
|
21581
|
-
|
|
21668
|
+
observeSessionProjectBinding(db, sessionId, sessionIdentityForBinding, sessionDirectory, (notice) => {
|
|
21669
|
+
if (deps.hostProjectBindingNotice)
|
|
21670
|
+
deps.hostProjectBindingNotice(sessionId, notice);
|
|
21671
|
+
else {
|
|
21672
|
+
withoutSqliteTransformPass2(() => sendStatusNotification2(deps.client, sessionId, `## Project memory warning
|
|
21673
|
+
|
|
21674
|
+
${notice}`, notificationParams));
|
|
21675
|
+
}
|
|
21676
|
+
});
|
|
21582
21677
|
recordedSessionProjectIdentity.set(sessionId, sessionIdentityForBinding);
|
|
21583
21678
|
}
|
|
21584
21679
|
const taggerFloor = compactionOff ? 0 : deriveTaggerLoadFloor(messages, sessionId, db);
|
|
@@ -25544,6 +25639,7 @@ function buildSidebarSnapshot(db, sessionId, directory, liveSessionState, inject
|
|
|
25544
25639
|
readySmartNoteCount,
|
|
25545
25640
|
cacheTtl,
|
|
25546
25641
|
lastTransformError: meta?.last_transform_error ? String(meta.last_transform_error) : null,
|
|
25642
|
+
projectBindingWarning: getProjectBindingWarning(db, sessionId),
|
|
25547
25643
|
lastDreamerRunAt,
|
|
25548
25644
|
projectIdentity,
|
|
25549
25645
|
dreamerBacklog,
|
|
@@ -26048,6 +26144,15 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
26048
26144
|
const rawConfig = config;
|
|
26049
26145
|
const getNotificationParams = (sessionId) => getLiveNotificationParams(sessionId, liveSessionState.liveModelBySession, liveSessionState.variantBySession, liveSessionState.agentBySession, currentPluginConfigReader(directory)?.poll().effective.toast_duration_ms ?? config.toast_duration_ms);
|
|
26050
26146
|
const injectionBudgetTokens = config.memory?.injection_budget_tokens;
|
|
26147
|
+
const showForkHistoryGap = (db, sessionId) => {
|
|
26148
|
+
if (!compactionEnabled || config.transform_mode === "rust")
|
|
26149
|
+
return false;
|
|
26150
|
+
try {
|
|
26151
|
+
return args.readForkHistoryGap?.(db, sessionId) === true;
|
|
26152
|
+
} catch {
|
|
26153
|
+
return false;
|
|
26154
|
+
}
|
|
26155
|
+
};
|
|
26051
26156
|
if (isDebugRpcEnabled(config)) {
|
|
26052
26157
|
const readMemory = () => buildDebugMemoryUsage(args.getDebugMemoryHolders?.());
|
|
26053
26158
|
rpcServer.handle("debug.memoryUsage", async () => ({ ...readMemory() }));
|
|
@@ -26068,7 +26173,10 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
26068
26173
|
error: "Rust module status unavailable; canonical session state was not read"
|
|
26069
26174
|
};
|
|
26070
26175
|
}
|
|
26071
|
-
|
|
26176
|
+
const snapshot = buildSidebarSnapshotRpcResponse(db, sessionId, dir, liveSessionState, injectionBudgetTokens, rawConfig, moduleStatus, compactionEnabled);
|
|
26177
|
+
if (!snapshot.error && snapshot.disabled !== true && showForkHistoryGap(db, sessionId))
|
|
26178
|
+
snapshot.forkHistoryGap = true;
|
|
26179
|
+
return snapshot;
|
|
26072
26180
|
});
|
|
26073
26181
|
rpcServer.handle("session-owner", async (params) => {
|
|
26074
26182
|
const sessionId = String(params.sessionId ?? "");
|
|
@@ -26102,6 +26210,8 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
26102
26210
|
};
|
|
26103
26211
|
}
|
|
26104
26212
|
const detail = buildStatusDetail(db, sessionId, dir, modelKey, rawConfig, liveSessionState, injectionBudgetTokens, moduleStatus, compactionEnabled);
|
|
26213
|
+
if (showForkHistoryGap(db, sessionId))
|
|
26214
|
+
detail.forkHistoryGap = true;
|
|
26105
26215
|
if (args.hiddenCompletionExecutor?.capabilities.tools === false) {
|
|
26106
26216
|
detail.dreamerUnsupportedTasks = toolLoopDreamTasks();
|
|
26107
26217
|
}
|
|
@@ -26197,8 +26307,8 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
26197
26307
|
const db = readDatabase();
|
|
26198
26308
|
if (!db)
|
|
26199
26309
|
return { ok: false, error: "db unavailable" };
|
|
26200
|
-
const { runManagedRecomp } = await importPluginModule(() => import("./recomp-orchestrator-
|
|
26201
|
-
const { sendIgnoredMessage } = await importPluginModule(() => import("./send-session-notification-
|
|
26310
|
+
const { runManagedRecomp } = await importPluginModule(() => import("./recomp-orchestrator-jn39mxh0.js"));
|
|
26311
|
+
const { sendIgnoredMessage } = await importPluginModule(() => import("./send-session-notification-p52rhjzy.js"));
|
|
26202
26312
|
log2(`[rpc] recomp requested for session ${sessionId}`);
|
|
26203
26313
|
if (!args.client && !args.hiddenCompletionExecutor) {
|
|
26204
26314
|
return {
|
|
@@ -26282,7 +26392,7 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
26282
26392
|
const db = readDatabase();
|
|
26283
26393
|
if (!db)
|
|
26284
26394
|
return { ok: false, error: "db unavailable" };
|
|
26285
|
-
const { runManagedWrapup } = await importPluginModule(() => import("./wrapup-orchestrator-
|
|
26395
|
+
const { runManagedWrapup } = await importPluginModule(() => import("./wrapup-orchestrator-vd5zfp3v.js"));
|
|
26286
26396
|
const model = await args.readSelectedSessionModel?.(sessionId) ?? liveSessionState.liveModelBySession.get(sessionId);
|
|
26287
26397
|
const window = resolveOpenCodeWrapupWindow(db, sessionId, model);
|
|
26288
26398
|
if (!window)
|
|
@@ -26507,17 +26617,19 @@ function openCodeConfigFileChain(directory, hostGeneration) {
|
|
|
26507
26617
|
];
|
|
26508
26618
|
return [...new Set(files)];
|
|
26509
26619
|
}
|
|
26510
|
-
function readCompactionFromConfigFiles(directory, hostGeneration) {
|
|
26620
|
+
function readCompactionFromConfigFiles(directory, hostGeneration, readConfig = readJsoncFile) {
|
|
26511
26621
|
const merged = {};
|
|
26512
26622
|
for (const filePath of openCodeConfigFileChain(directory, hostGeneration)) {
|
|
26513
26623
|
let block;
|
|
26514
26624
|
try {
|
|
26515
|
-
block =
|
|
26625
|
+
block = readConfig(filePath)?.compaction;
|
|
26516
26626
|
} catch {}
|
|
26517
26627
|
if (!block || typeof block !== "object")
|
|
26518
26628
|
continue;
|
|
26519
26629
|
if (block.auto !== undefined)
|
|
26520
26630
|
merged.auto = block.auto;
|
|
26631
|
+
if (block.background !== undefined)
|
|
26632
|
+
merged.background = block.background;
|
|
26521
26633
|
if (block.prune !== undefined)
|
|
26522
26634
|
merged.prune = block.prune;
|
|
26523
26635
|
if (block.buffer !== undefined)
|
|
@@ -27039,9 +27151,9 @@ var FULL_PARAMETER_DESCRIPTIONS = {
|
|
|
27039
27151
|
},
|
|
27040
27152
|
ctx_memory: {
|
|
27041
27153
|
action: "write | update | archive | merge | get",
|
|
27042
|
-
content: "
|
|
27043
|
-
category: "
|
|
27044
|
-
ids: "
|
|
27154
|
+
content: "Send on every call — the memory text for write, update and merge; pass an empty string for archive and get.",
|
|
27155
|
+
category: "Send on every call — the fact's kind for write; on update/merge, the memory's current category to keep it; archive and get ignore it, so pass any valid category.",
|
|
27156
|
+
ids: "Send on every call — one id for update, one or more for archive, two or more distinct ids of memories in the same category for merge, 1–20 for get; write takes an empty list.",
|
|
27045
27157
|
reason: "Why it is being archived (optional)."
|
|
27046
27158
|
},
|
|
27047
27159
|
ctx_search: {
|
|
@@ -27074,9 +27186,9 @@ var LIGHT_PARAMETER_DESCRIPTIONS = {
|
|
|
27074
27186
|
},
|
|
27075
27187
|
ctx_memory: {
|
|
27076
27188
|
action: "write | update | archive | merge | get",
|
|
27077
|
-
content: "
|
|
27078
|
-
category: "
|
|
27079
|
-
ids: "
|
|
27189
|
+
content: "Send on every call: the fact (write, update, merge); empty string for archive/get.",
|
|
27190
|
+
category: "Send on every call: kind for write; current category for update/merge; any category for archive/get (ignored).",
|
|
27191
|
+
ids: "Send on every call: one id for update, 1+ for archive, 2+ distinct same-category ids for merge, 1–20 for get; write: empty list.",
|
|
27080
27192
|
reason: "Why it is archived (optional)."
|
|
27081
27193
|
},
|
|
27082
27194
|
ctx_search: {
|
|
@@ -27640,6 +27752,7 @@ ${head}
|
|
|
27640
27752
|
|
|
27641
27753
|
// src/v2/fold/owner.ts
|
|
27642
27754
|
var foldDigest = (value) => createHash8("sha256").update(value).digest("hex");
|
|
27755
|
+
var boundToCheckpoint = (record) => record.cutSeq !== undefined || record.rendered !== undefined || record.answered !== undefined;
|
|
27643
27756
|
|
|
27644
27757
|
class FoldOwner {
|
|
27645
27758
|
storage;
|
|
@@ -27680,6 +27793,8 @@ class FoldOwner {
|
|
|
27680
27793
|
submittedSha: foldDigest(args.checkpointText)
|
|
27681
27794
|
};
|
|
27682
27795
|
}
|
|
27796
|
+
if (args.keepBound && previous && boundToCheckpoint(previous))
|
|
27797
|
+
return previous;
|
|
27683
27798
|
const head = args.materialize();
|
|
27684
27799
|
const submitted = args.checkpointText ?? head;
|
|
27685
27800
|
const next = {
|
|
@@ -30043,7 +30158,123 @@ function splitMessageScopedId(id) {
|
|
|
30043
30158
|
return { messageId: id, suffix: "" };
|
|
30044
30159
|
return { messageId: id.slice(0, -match[1].length), suffix: match[1] };
|
|
30045
30160
|
}
|
|
30046
|
-
function
|
|
30161
|
+
function selectForkCompartments(source, map, proof) {
|
|
30162
|
+
const rows = new Map;
|
|
30163
|
+
const forkId = (id) => map.parentToFork.get(id) ?? "";
|
|
30164
|
+
const ordinal = (id) => map.forkOrdinals.get(forkId(id));
|
|
30165
|
+
let matchingPrefix;
|
|
30166
|
+
const provePrefix = () => {
|
|
30167
|
+
const matching = proof.matchingBodies();
|
|
30168
|
+
let length = 0;
|
|
30169
|
+
for (const [position, id] of map.parentOrdinals) {
|
|
30170
|
+
if (ordinal(id) !== position || matching.get(id) !== forkId(id))
|
|
30171
|
+
break;
|
|
30172
|
+
length = position;
|
|
30173
|
+
}
|
|
30174
|
+
return length;
|
|
30175
|
+
};
|
|
30176
|
+
let stopped = false;
|
|
30177
|
+
let lastEnd = 0;
|
|
30178
|
+
let acceptedGaps;
|
|
30179
|
+
const conversionGaps = [];
|
|
30180
|
+
const inheritedGaps = [];
|
|
30181
|
+
for (const [i, row] of source.entries()) {
|
|
30182
|
+
const { sequence, startMessage, endMessage, startMessageId, endMessageId } = row;
|
|
30183
|
+
const start = ordinal(startMessageId);
|
|
30184
|
+
const end = ordinal(endMessageId);
|
|
30185
|
+
let reason;
|
|
30186
|
+
if (stopped) {
|
|
30187
|
+
reason = "after first skipped compartment";
|
|
30188
|
+
} else {
|
|
30189
|
+
const startSeq = start === undefined ? proof.sequenceForId(startMessageId) : undefined;
|
|
30190
|
+
const endSeq = end === undefined ? proof.sequenceForId(endMessageId) : undefined;
|
|
30191
|
+
const previous = source[i - 1];
|
|
30192
|
+
const next = source[i + 1];
|
|
30193
|
+
if ((startSeq ?? -1) > map.throughSeq || (endSeq ?? -1) > map.throughSeq) {
|
|
30194
|
+
reason = "outside the fork boundary";
|
|
30195
|
+
} else if (startSeq !== undefined || endSeq !== undefined) {
|
|
30196
|
+
reason = "a live endpoint was not copied";
|
|
30197
|
+
} else if (row.rebaseStatus === "unresolved") {
|
|
30198
|
+
reason = "parent coordinates are unresolved";
|
|
30199
|
+
} else if (!Number.isSafeInteger(startMessage) || !Number.isSafeInteger(endMessage) || startMessage < 1 || endMessage < startMessage) {
|
|
30200
|
+
reason = "invalid message range";
|
|
30201
|
+
} else if (startMessage <= lastEnd) {
|
|
30202
|
+
reason = "range overlaps the inherited prefix";
|
|
30203
|
+
} else if (startMessage > lastEnd + 1 && validateStoredCompartments(lastEnd > 0 ? [{ startMessage: 1, endMessage: lastEnd }, row] : [row], acceptedGaps ??= proof.acceptedGaps(source, (gap) => conversionGaps.push(gap))) !== null) {
|
|
30204
|
+
reason = "gap before range";
|
|
30205
|
+
} else if (start !== undefined && start !== startMessage || end !== undefined && end !== endMessage) {
|
|
30206
|
+
reason = "live endpoint conflicts with the stored position";
|
|
30207
|
+
} else if (start === undefined && previous && ordinal(previous.endMessageId) !== lastEnd || end === undefined && (!next || next.startMessage !== endMessage + 1 || ordinal(next.startMessageId) !== endMessage + 1)) {
|
|
30208
|
+
reason = "live neighboring anchors do not prove the stored range";
|
|
30209
|
+
} else if ((end === undefined ? endMessage + 1 : endMessage) > (matchingPrefix ??= provePrefix())) {
|
|
30210
|
+
reason = "parent and fork raw prefixes do not match in order and body";
|
|
30211
|
+
} else {
|
|
30212
|
+
rows.set(sequence, {
|
|
30213
|
+
sequence,
|
|
30214
|
+
startMessage,
|
|
30215
|
+
endMessage,
|
|
30216
|
+
startMessageId: forkId(map.parentOrdinals.get(startMessage) ?? ""),
|
|
30217
|
+
endMessageId: forkId(map.parentOrdinals.get(endMessage) ?? "")
|
|
30218
|
+
});
|
|
30219
|
+
const conversionGap = conversionGaps.find(({ start, end }) => start === lastEnd + 1 && end === startMessage - 1);
|
|
30220
|
+
if (conversionGap)
|
|
30221
|
+
inheritedGaps.push(conversionGap);
|
|
30222
|
+
lastEnd = endMessage;
|
|
30223
|
+
continue;
|
|
30224
|
+
}
|
|
30225
|
+
stopped = true;
|
|
30226
|
+
}
|
|
30227
|
+
sessionLog2(proof.sessionId, `v2 fork skipped compartment ${sequence} (${startMessage}-${endMessage}): ${reason}`);
|
|
30228
|
+
}
|
|
30229
|
+
const keepRaw = new Set;
|
|
30230
|
+
if (stopped) {
|
|
30231
|
+
const count = map.parentOrdinals.size;
|
|
30232
|
+
const changes = new Int32Array(count + 2);
|
|
30233
|
+
const markCovered = (from, to) => {
|
|
30234
|
+
const start = Math.max(1, from);
|
|
30235
|
+
const end = Math.min(count, to);
|
|
30236
|
+
if (!Number.isSafeInteger(start) || !Number.isSafeInteger(end) || start > end)
|
|
30237
|
+
return;
|
|
30238
|
+
changes[start] = (changes[start] ?? 0) + 1;
|
|
30239
|
+
changes[end + 1] = (changes[end + 1] ?? 0) - 1;
|
|
30240
|
+
};
|
|
30241
|
+
const parentPositions = new Map([...map.parentOrdinals].map(([position, id]) => [id, position]));
|
|
30242
|
+
const liveOrdinal = (id) => {
|
|
30243
|
+
const position = parentPositions.get(id);
|
|
30244
|
+
if (position !== undefined)
|
|
30245
|
+
return position;
|
|
30246
|
+
return (proof.sequenceForId(id) ?? -1) > map.throughSeq ? count + 1 : undefined;
|
|
30247
|
+
};
|
|
30248
|
+
const live = source.map((row) => ({
|
|
30249
|
+
start: liveOrdinal(row.startMessageId),
|
|
30250
|
+
end: liveOrdinal(row.endMessageId)
|
|
30251
|
+
}));
|
|
30252
|
+
for (const [index, row] of source.entries()) {
|
|
30253
|
+
if (rows.has(row.sequence))
|
|
30254
|
+
continue;
|
|
30255
|
+
markCovered(row.startMessage, row.endMessage);
|
|
30256
|
+
const { start, end } = live[index] ?? {};
|
|
30257
|
+
if (start === undefined && end === undefined)
|
|
30258
|
+
continue;
|
|
30259
|
+
const previousEnd = live[index - 1]?.end;
|
|
30260
|
+
const nextStart = live[index + 1]?.start;
|
|
30261
|
+
const from = start ?? (previousEnd !== undefined ? previousEnd + 1 : index === 0 ? 1 : undefined);
|
|
30262
|
+
const to = end ?? (nextStart !== undefined ? nextStart - 1 : undefined);
|
|
30263
|
+
if (from !== undefined && to !== undefined)
|
|
30264
|
+
markCovered(from, to);
|
|
30265
|
+
else
|
|
30266
|
+
markCovered(Math.min(row.startMessage, from ?? row.startMessage), Math.max(row.endMessage, to ?? row.endMessage));
|
|
30267
|
+
}
|
|
30268
|
+
let covering = 0;
|
|
30269
|
+
for (const [position, id] of map.parentOrdinals) {
|
|
30270
|
+
covering += changes[position] ?? 0;
|
|
30271
|
+
if (covering > 0)
|
|
30272
|
+
keepRaw.add(id);
|
|
30273
|
+
}
|
|
30274
|
+
}
|
|
30275
|
+
return { rows, keepRaw, inheritedGaps };
|
|
30276
|
+
}
|
|
30277
|
+
function forkCloneFilter(idMap, copiedToolCallIds, proof, toolOwners) {
|
|
30047
30278
|
const mapMessageScoped = (id) => {
|
|
30048
30279
|
const direct = idMap.parentToFork.get(id);
|
|
30049
30280
|
if (direct)
|
|
@@ -30054,14 +30285,28 @@ function forkCloneFilter(idMap, copiedToolCallIds) {
|
|
|
30054
30285
|
const mapped = idMap.parentToFork.get(messageId);
|
|
30055
30286
|
return mapped ? `${mapped}${suffix}` : undefined;
|
|
30056
30287
|
};
|
|
30288
|
+
let keepRaw;
|
|
30289
|
+
let inheritedGaps = [];
|
|
30290
|
+
const includeMessageId = (messageId) => mapMessageScoped(messageId) !== undefined || copiedToolCallIds.has(messageId);
|
|
30057
30291
|
return {
|
|
30292
|
+
selectCompartments: proof && ((source) => {
|
|
30293
|
+
const plan = selectForkCompartments(source, idMap, proof);
|
|
30294
|
+
keepRaw = plan.keepRaw;
|
|
30295
|
+
inheritedGaps = plan.inheritedGaps;
|
|
30296
|
+
return plan.rows;
|
|
30297
|
+
}),
|
|
30298
|
+
inheritedCoordinateGaps: proof && (() => inheritedGaps),
|
|
30058
30299
|
resolveBoundaryOrdinal: (messageId) => {
|
|
30059
30300
|
const forkId = idMap.parentToFork.get(messageId);
|
|
30060
30301
|
return forkId ? idMap.forkOrdinals.get(forkId) : undefined;
|
|
30061
30302
|
},
|
|
30062
|
-
includeMessageId
|
|
30303
|
+
includeMessageId,
|
|
30304
|
+
includeReplayMessageId: (messageId) => includeMessageId(messageId) && !keepRaw?.has(splitMessageScopedId(messageId).messageId) && !toolOwners?.get(messageId)?.some((owner) => keepRaw?.has(owner)),
|
|
30063
30305
|
mapMessageId: (messageId) => mapMessageScoped(messageId) ?? messageId,
|
|
30064
30306
|
includeTag: (tag) => {
|
|
30307
|
+
const owner = tag.type === "tool" ? tag.toolOwnerMessageId : splitMessageScopedId(tag.messageId).messageId;
|
|
30308
|
+
if (owner && keepRaw?.has(owner))
|
|
30309
|
+
return false;
|
|
30065
30310
|
if (tag.type === "tool") {
|
|
30066
30311
|
return tag.toolOwnerMessageId !== null && idMap.parentToFork.has(tag.toolOwnerMessageId);
|
|
30067
30312
|
}
|
|
@@ -30105,7 +30350,20 @@ function seedV2ForkFromParent(args) {
|
|
|
30105
30350
|
return { kind: "parent-missing", parentSessionID, reason: "no copied rows pair up" };
|
|
30106
30351
|
const toolTags = db.prepare("SELECT message_id, tool_owner_message_id FROM tags WHERE session_id = ? AND type = 'tool'").all(parentSessionID);
|
|
30107
30352
|
const copiedToolCallIds = new Set(toolTags.filter((row) => row.tool_owner_message_id !== null && idMap.parentToFork.has(row.tool_owner_message_id)).map((row) => row.message_id));
|
|
30108
|
-
const
|
|
30353
|
+
const toolOwners = new Map;
|
|
30354
|
+
for (const row of toolTags) {
|
|
30355
|
+
if (!row.tool_owner_message_id)
|
|
30356
|
+
continue;
|
|
30357
|
+
const owners = toolOwners.get(row.message_id) ?? [];
|
|
30358
|
+
owners.push(row.tool_owner_message_id);
|
|
30359
|
+
toolOwners.set(row.message_id, owners);
|
|
30360
|
+
}
|
|
30361
|
+
const result = copySessionStateForClone(db, parentSessionID, sessionId, forkCloneFilter(idMap, copiedToolCallIds, {
|
|
30362
|
+
sessionId,
|
|
30363
|
+
sequenceForId: (id) => store.sequenceForId(parentSessionID, id),
|
|
30364
|
+
matchingBodies: () => store.matchingForkBodies(parentSessionID, sessionId, throughSeq),
|
|
30365
|
+
acceptedGaps: (source, onConversionGap) => nonNarrativeStoredGapRanges(db, parentSessionID, source, (start, end) => readV2MessageRange2(store, parentSessionID, start, Math.min(end, idMap.parentOrdinals.size)), onConversionGap)
|
|
30366
|
+
}, toolOwners));
|
|
30109
30367
|
if (result.kind === "destination-not-empty")
|
|
30110
30368
|
return { kind: "destination-not-empty", parentSessionID };
|
|
30111
30369
|
return { kind: "seeded", parentSessionID, pairedRows: idMap.parentToFork.size, result };
|
|
@@ -30276,6 +30534,7 @@ function isSessionNotFound(error) {
|
|
|
30276
30534
|
return /not\s*found/i.test(label);
|
|
30277
30535
|
}
|
|
30278
30536
|
function createNativeHiddenChildren(host, removeSession, options) {
|
|
30537
|
+
const quiet = supportsQuietHiddenChildren(options.hostVersion);
|
|
30279
30538
|
const removing = new Map;
|
|
30280
30539
|
const remove = (child) => {
|
|
30281
30540
|
const inFlight = removing.get(child.id);
|
|
@@ -30318,6 +30577,15 @@ function createNativeHiddenChildren(host, removeSession, options) {
|
|
|
30318
30577
|
};
|
|
30319
30578
|
const create = async (identity, role, model) => {
|
|
30320
30579
|
const input = childCreateInput(identity, role, model);
|
|
30580
|
+
const directory = identity.directory;
|
|
30581
|
+
if (quiet) {
|
|
30582
|
+
if (!host.createHolder)
|
|
30583
|
+
throw new Error("OpenCode 2 background holder API is not wired");
|
|
30584
|
+
const placement = await hiddenRunPlacement(host.createHolder, directory);
|
|
30585
|
+
input.id = placement.id;
|
|
30586
|
+
input.parentID = placement.parentID;
|
|
30587
|
+
delete input.location;
|
|
30588
|
+
}
|
|
30321
30589
|
const created = await host.create(input);
|
|
30322
30590
|
if (!created.id)
|
|
30323
30591
|
throw new Error("OpenCode 2 did not return a child session id");
|
|
@@ -30327,7 +30595,7 @@ function createNativeHiddenChildren(host, removeSession, options) {
|
|
|
30327
30595
|
try {
|
|
30328
30596
|
recordHiddenChild(options.db, {
|
|
30329
30597
|
id: created.id,
|
|
30330
|
-
directory
|
|
30598
|
+
directory,
|
|
30331
30599
|
created_at: createdAt,
|
|
30332
30600
|
deadline_at: createdAt + identity.timeoutMs
|
|
30333
30601
|
});
|
|
@@ -30353,17 +30621,22 @@ function createNativeHiddenChildren(host, removeSession, options) {
|
|
|
30353
30621
|
throw storeError;
|
|
30354
30622
|
}
|
|
30355
30623
|
}
|
|
30356
|
-
|
|
30357
|
-
options.log(`[magic-context] hidden child ${created.id} created role=${role} keep_subagents=${options.keepSubagents}`);
|
|
30358
|
-
return {
|
|
30624
|
+
const child = {
|
|
30359
30625
|
id: created.id,
|
|
30360
30626
|
role,
|
|
30361
30627
|
generation: options.generation,
|
|
30362
30628
|
title: roleTitle(role),
|
|
30363
30629
|
model,
|
|
30364
30630
|
created_at: createdAt,
|
|
30365
|
-
directory
|
|
30631
|
+
directory
|
|
30366
30632
|
};
|
|
30633
|
+
if (input.parentID && (created.id !== input.id || created.parentID !== input.parentID || !matchesHiddenRunLocation(directory, created.location?.directory))) {
|
|
30634
|
+
await remove(child);
|
|
30635
|
+
throw new Error(`OpenCode created a background run outside its holder at ${directory}`);
|
|
30636
|
+
}
|
|
30637
|
+
options.hook.registerChild(created.id, input.agent);
|
|
30638
|
+
options.log(`[magic-context] hidden child ${created.id} created role=${role} keep_subagents=${options.keepSubagents}`);
|
|
30639
|
+
return child;
|
|
30367
30640
|
};
|
|
30368
30641
|
const kept = (child) => keptUnderRetention(options.keepSubagents, child);
|
|
30369
30642
|
return {
|
|
@@ -30862,6 +31135,7 @@ async function createV2HiddenCompletionExecutor(host, options) {
|
|
|
30862
31135
|
db: options.db,
|
|
30863
31136
|
hook: options.hook,
|
|
30864
31137
|
generation,
|
|
31138
|
+
hostVersion: options.hostVersion,
|
|
30865
31139
|
keepSubagents: options.keepSubagents === true,
|
|
30866
31140
|
log: note,
|
|
30867
31141
|
removalTimeoutMs: options.removalTimeoutMs
|
|
@@ -41455,6 +41729,55 @@ function createV2EmbeddingScope(initialProject) {
|
|
|
41455
41729
|
};
|
|
41456
41730
|
}
|
|
41457
41731
|
|
|
41732
|
+
// src/v2/hooks/fork-history-status.ts
|
|
41733
|
+
var logged = new Set;
|
|
41734
|
+
var toasted = new Set;
|
|
41735
|
+
var isGap = (error) => error?.startsWith("gap before message ") === true;
|
|
41736
|
+
var diagnoses = new WeakMap;
|
|
41737
|
+
function readForkHistoryGap(db, openReader, sessionID) {
|
|
41738
|
+
const rows = db.prepare(`SELECT sequence, start_message AS startMessage, end_message AS endMessage,
|
|
41739
|
+
rebase_status AS rebaseStatus FROM compartments WHERE session_id = ? ORDER BY sequence`).all(sessionID);
|
|
41740
|
+
if (!isGap(validateStoredCompartments(rows)) || rows.some(({ rebaseStatus }) => rebaseStatus === "unresolved")) {
|
|
41741
|
+
diagnoses.get(db)?.delete(sessionID);
|
|
41742
|
+
return false;
|
|
41743
|
+
}
|
|
41744
|
+
let cache = diagnoses.get(db);
|
|
41745
|
+
if (!cache) {
|
|
41746
|
+
cache = new BoundedSessionMap(1000);
|
|
41747
|
+
diagnoses.set(db, cache);
|
|
41748
|
+
}
|
|
41749
|
+
const notice = db.prepare("SELECT coordinate_rebase_notice AS text FROM session_meta WHERE session_id = ?").get(sessionID);
|
|
41750
|
+
const reader = openReader();
|
|
41751
|
+
let gap;
|
|
41752
|
+
try {
|
|
41753
|
+
const key = JSON.stringify([
|
|
41754
|
+
rows,
|
|
41755
|
+
notice?.text ?? null,
|
|
41756
|
+
reader.messageCountAndNewestId(sessionID)
|
|
41757
|
+
]);
|
|
41758
|
+
const cached = cache.get(sessionID);
|
|
41759
|
+
if (cached?.key === key) {
|
|
41760
|
+
gap = cached.gap;
|
|
41761
|
+
} else {
|
|
41762
|
+
gap = Boolean(reader.forkOrigin(sessionID)) && isGap(validateStoredCompartments(rows, nonNarrativeStoredGapRanges(db, sessionID, rows, (from, to) => iterateV2MessageRange2(reader, sessionID, from, to))));
|
|
41763
|
+
cache.set(sessionID, { key, gap });
|
|
41764
|
+
}
|
|
41765
|
+
} finally {
|
|
41766
|
+
reader.close();
|
|
41767
|
+
}
|
|
41768
|
+
if (!gap)
|
|
41769
|
+
return false;
|
|
41770
|
+
if (!logged.has(sessionID)) {
|
|
41771
|
+
logged.add(sessionID);
|
|
41772
|
+
sessionLog2(sessionID, "v2 fork saved history has a gap; /ctx-recomp repairs this fork");
|
|
41773
|
+
}
|
|
41774
|
+
if (!toasted.has(sessionID) && isTuiConnected2(sessionID)) {
|
|
41775
|
+
toasted.add(sessionID);
|
|
41776
|
+
pushNotification2("toast", { message: renderUserFacingFailure("fork_history_gap", "plain"), variant: "warning" }, sessionID, { liveOnly: true });
|
|
41777
|
+
}
|
|
41778
|
+
return true;
|
|
41779
|
+
}
|
|
41780
|
+
|
|
41458
41781
|
// src/v2/hooks/generate.ts
|
|
41459
41782
|
import { createHash as createHash17 } from "node:crypto";
|
|
41460
41783
|
var typedArrayName = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Uint8Array.prototype), Symbol.toStringTag)?.get;
|
|
@@ -54515,10 +54838,11 @@ Your active memories are already in <project-memory> as \`#id: fact\` lines. Wri
|
|
|
54515
54838
|
|
|
54516
54839
|
Actions:
|
|
54517
54840
|
- write: new memory (content + category).
|
|
54518
|
-
- update: rewrite one memory whose fact changed (ids: [one], content; category
|
|
54841
|
+
- update: rewrite one memory whose fact changed (ids: [one], content; category: the current one to keep, a new one to recategorize).
|
|
54519
54842
|
- archive: retire wrong or obsolete memories (ids: [one or more], optional reason).
|
|
54520
|
-
- merge: collapse duplicates into one (ids: [two or more], content).
|
|
54843
|
+
- merge: collapse duplicates into one (ids: [two or more distinct ids of memories in the same category], content).
|
|
54521
54844
|
- get: fetch by id (ids: 1–20), readable in every status.
|
|
54845
|
+
The call form that works on every host sends action, content, category and ids every time: argument-dropping providers only emit required fields. For get and archive pass content="" and any valid category; for write pass ids=[].
|
|
54522
54846
|
Examples: category="CONFIG_VALUES", content="OpenCode source is at ~/Work/OSS/opencode" · category="CONSTRAINTS", content="Dashboard Tauri build needs RGBA PNGs, not grayscale"`;
|
|
54523
54847
|
var DEFAULT_SEARCH_LIMIT = 10;
|
|
54524
54848
|
// src/features/magic-context/memory/memory-visibility.ts
|
|
@@ -54775,13 +55099,13 @@ function updateMemoryContentInCurrentTransaction(db, memory, content, normalized
|
|
|
54775
55099
|
}
|
|
54776
55100
|
var ctxMemoryArgsShape = {
|
|
54777
55101
|
action: tool.schema.enum([...CTX_MEMORY_ACTIONS]).describe("write | update | archive | merge | get"),
|
|
54778
|
-
content: tool.schema.string().describe("
|
|
54779
|
-
category: tool.schema.enum([...V2_MEMORY_CATEGORIES]).describe("
|
|
54780
|
-
ids: tool.schema.array(tool.schema.number()).describe("
|
|
55102
|
+
content: tool.schema.string().describe("Send on every call — the memory text for write, update and merge; pass an empty string for archive and get."),
|
|
55103
|
+
category: tool.schema.enum([...V2_MEMORY_CATEGORIES]).describe("Send on every call — the fact's kind for write; on update/merge, the memory's current category to keep it; archive and get ignore it, so pass any valid category."),
|
|
55104
|
+
ids: tool.schema.array(tool.schema.number()).describe("Send on every call — one id for update, one or more for archive, two or more distinct ids of memories in the same category for merge, 1–20 for get; write takes an empty list."),
|
|
54781
55105
|
reason: tool.schema.string().optional().describe("Why it is being archived (optional).")
|
|
54782
55106
|
};
|
|
54783
55107
|
var ctxMemoryListArgsShape = {
|
|
54784
|
-
category: tool.schema.enum([...V2_MEMORY_CATEGORIES]).optional().describe("
|
|
55108
|
+
category: tool.schema.enum([...V2_MEMORY_CATEGORIES]).optional().describe("Filter listed memories to this category (optional)."),
|
|
54785
55109
|
limit: tool.schema.number().optional().describe("Max results for list (default 10).")
|
|
54786
55110
|
};
|
|
54787
55111
|
var ctxMemoryArgsSchema = tool.schema.object({
|
|
@@ -57263,6 +57587,7 @@ async function registerContext(context) {
|
|
|
57263
57587
|
await cleanupLegacyOnce(database);
|
|
57264
57588
|
return createV2HiddenCompletionExecutor({
|
|
57265
57589
|
...context.session,
|
|
57590
|
+
createHolder: (input) => context.session.create(input),
|
|
57266
57591
|
watchModelActivity: (sessionID, onOutput) => hiddenModelActivity.watch(sessionID, onOutput),
|
|
57267
57592
|
get: async (input) => {
|
|
57268
57593
|
const session = await context.session.get(input);
|
|
@@ -57289,6 +57614,7 @@ async function registerContext(context) {
|
|
|
57289
57614
|
projectIdentity: resolveProjectIdentityForSession(directory, config.allow_home_project) ?? "",
|
|
57290
57615
|
directory,
|
|
57291
57616
|
hook: hiddenChildHook,
|
|
57617
|
+
hostVersion: context.app?.version,
|
|
57292
57618
|
keepSubagents: config.keep_subagents === true,
|
|
57293
57619
|
ensureAgent: () => hiddenAgentsReady ??= context.agent.reload(),
|
|
57294
57620
|
modelCatalog: () => Promise.resolve(context.model.list()),
|
|
@@ -57805,20 +58131,18 @@ async function registerContext(context) {
|
|
|
57805
58131
|
}
|
|
57806
58132
|
}
|
|
57807
58133
|
})();
|
|
57808
|
-
const
|
|
57809
|
-
db = storage.require();
|
|
57810
|
-
const state = getOrCreateSessionMeta(db, draft.sessionID);
|
|
58134
|
+
const m0RenderOptions = (draft, store, state) => {
|
|
57811
58135
|
const modelKey = `${draft.model.providerID}/${draft.model.id}`;
|
|
57812
58136
|
const contextLimit = resolveContextLimit(draft.model.providerID, draft.model.id, {
|
|
57813
|
-
db,
|
|
58137
|
+
db: store,
|
|
57814
58138
|
sessionID: draft.sessionID
|
|
57815
58139
|
}) || draft.model.limit?.context || (state.lastObservedModelKey === modelKey ? state.lastUsageContextLimit : undefined);
|
|
57816
|
-
return
|
|
58140
|
+
return {
|
|
57817
58141
|
...createM0RenderOptions({
|
|
57818
58142
|
...createV2TransformFeatureDeps(config, compactionOff, directory, embeddings.ensureRegistered),
|
|
57819
58143
|
...createV2ThresholdDeps(config)
|
|
57820
58144
|
}, usage.get(draft.sessionID)?.usage ?? { percentage: 0, inputTokens: 0 }, modelKey, contextLimit, resolveProjectIdentityForSession(directory, config.allow_home_project)),
|
|
57821
|
-
db,
|
|
58145
|
+
db: store,
|
|
57822
58146
|
sessionId: draft.sessionID,
|
|
57823
58147
|
state,
|
|
57824
58148
|
projectDirectory: directory,
|
|
@@ -57826,11 +58150,21 @@ async function registerContext(context) {
|
|
|
57826
58150
|
systemHash: state.systemPromptHash ?? "",
|
|
57827
58151
|
toolSetHash: getCurrentToolSetHash(draft.model.providerID, draft.model.id, draft.agent, draft.sessionID),
|
|
57828
58152
|
toolDefinitionsHash: toolDefinitionsHashes.get(draft.sessionID),
|
|
57829
|
-
modelKey
|
|
58153
|
+
modelKey,
|
|
57830
58154
|
cacheExpired: false,
|
|
57831
58155
|
lastResponseTime: state.lastResponseTime
|
|
57832
58156
|
}
|
|
57833
|
-
}
|
|
58157
|
+
};
|
|
58158
|
+
};
|
|
58159
|
+
const materialize = (draft) => {
|
|
58160
|
+
db = storage.require();
|
|
58161
|
+
const state = getOrCreateSessionMeta(db, draft.sessionID);
|
|
58162
|
+
return materializeM0(m0RenderOptions(draft, db, state)).m0Text;
|
|
58163
|
+
};
|
|
58164
|
+
const renderUnkeptBaseline = (draft) => {
|
|
58165
|
+
const store = storage.require();
|
|
58166
|
+
const state = readSessionMeta(store, draft.sessionID);
|
|
58167
|
+
return materializeM0(m0RenderOptions(draft, store, state), { persist: false }).m0Text;
|
|
57834
58168
|
};
|
|
57835
58169
|
await context.session.hook("compaction", async (draft) => {
|
|
57836
58170
|
const hiddenSummary = hiddenChildHook.compactionSummary(draft.sessionID, draft.agent);
|
|
@@ -57853,7 +58187,7 @@ async function registerContext(context) {
|
|
|
57853
58187
|
const source = !rustModeModuleClient ? "typescript" : moduleBaseline === null ? "typescript_fallback" : "module";
|
|
57854
58188
|
if (nativeFoldReplay) {
|
|
57855
58189
|
try {
|
|
57856
|
-
const state = getOrCreateSessionMeta(storage.require(), draft.sessionID);
|
|
58190
|
+
const state = running ? getOrCreateSessionMeta(storage.require(), draft.sessionID) : readSessionMeta(storage.require(), draft.sessionID);
|
|
57857
58191
|
const staged = manual && moduleBaseline == null ? stageManualBaseline(storage.require(), draft.sessionID, () => materialize(draft)) : undefined;
|
|
57858
58192
|
const publishedHistory = Boolean(storage.require().prepare("SELECT 1 FROM compartments WHERE session_id = ? LIMIT 1").get(draft.sessionID));
|
|
57859
58193
|
const owned = await folds.read(draft.sessionID);
|
|
@@ -57902,14 +58236,16 @@ async function registerContext(context) {
|
|
|
57902
58236
|
watermark,
|
|
57903
58237
|
runningCut: running?.seq,
|
|
57904
58238
|
materialize: () => {
|
|
57905
|
-
const summary = moduleBaseline ?? materialize(draft);
|
|
58239
|
+
const summary = moduleBaseline ?? (running ? materialize(draft) : renderUnkeptBaseline(draft));
|
|
57906
58240
|
return hasFoldSummary(summary) ? summary : RAW_HISTORY_ACCOUNT;
|
|
57907
58241
|
},
|
|
57908
58242
|
checkpointText: CHECKPOINT_NOTE,
|
|
57909
|
-
checkpointID: running?.id
|
|
58243
|
+
checkpointID: running?.id,
|
|
58244
|
+
keepBound: running === undefined
|
|
57910
58245
|
});
|
|
57911
|
-
|
|
57912
|
-
draft.
|
|
58246
|
+
const answer = running === undefined && boundToCheckpoint(fold) ? CHECKPOINT_NOTE : fold.submitted;
|
|
58247
|
+
sessionLog2(draft.sessionID, `v2 compaction hook: fired answered=true source=${source} row=${running ? "running" : "none"}`);
|
|
58248
|
+
draft.result = { summary: answer, metadata: { keepID: undefined } };
|
|
57913
58249
|
} catch (cause) {
|
|
57914
58250
|
await refuseBeforeProvider(context.session, draft.sessionID, "compaction-fold", cause);
|
|
57915
58251
|
throw new V2ContextRefusal("Magic Context could not preserve the host checkpoint.", {
|
|
@@ -57992,6 +58328,9 @@ async function registerContext(context) {
|
|
|
57992
58328
|
tagger,
|
|
57993
58329
|
...createV2ThresholdDeps(config),
|
|
57994
58330
|
contextUsageMap: usage,
|
|
58331
|
+
hostProjectBindingNotice: (sessionID, message) => {
|
|
58332
|
+
pushLiveNotification2("toast", { message, variant: "warning" }, sessionID);
|
|
58333
|
+
},
|
|
57995
58334
|
hostInputEstimate: (sessionID) => checkpointInputEstimates.get(sessionID),
|
|
57996
58335
|
onPassPermission: (sessionID, permission) => {
|
|
57997
58336
|
checkpointPassPermissions.set(sessionID, permission);
|
|
@@ -58757,6 +59096,7 @@ async function registerContext(context) {
|
|
|
58757
59096
|
hiddenCompletionExecutor: storageOpenedAtBoot ? hiddenCompletionExecutor : lateHiddenExecutor,
|
|
58758
59097
|
compactionMarkerStrategy: v2CompactionMarkerStrategy,
|
|
58759
59098
|
prepareHistorySession,
|
|
59099
|
+
readForkHistoryGap: (database, sessionID) => readForkHistoryGap(database, openStoreReader, sessionID),
|
|
58760
59100
|
readSessionDirectory: async (sessionID) => {
|
|
58761
59101
|
try {
|
|
58762
59102
|
return (await context.session.get({ sessionID })).location?.directory ?? null;
|