@cortexkit/opencode-magic-context 0.49.91 → 0.49.92
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 +1 -1
- package/dist/chunk-embedding-write-worker.js +2 -2
- package/dist/{conflict-warning-hook-kbq6ppjf.js → conflict-warning-hook-exf96bpt.js} +3 -3
- package/dist/{context-6qq5e1ry.js → context-e8qd2v00.js} +78 -66
- package/dist/features/magic-context/overflow-detection.d.ts +7 -1
- package/dist/features/magic-context/overflow-detection.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-persisted.d.ts +13 -3
- package/dist/features/magic-context/storage-meta-persisted.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-parser.d.ts +2 -0
- package/dist/hooks/magic-context/compartment-parser.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-incremental.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-types.d.ts +5 -5
- package/dist/hooks/magic-context/compartment-runner-types.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-validation.d.ts +3 -0
- package/dist/hooks/magic-context/compartment-runner-validation.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-trigger.d.ts +2 -1
- package/dist/hooks/magic-context/compartment-trigger.d.ts.map +1 -1
- package/dist/hooks/magic-context/event-handler.d.ts +4 -0
- package/dist/hooks/magic-context/event-handler.d.ts.map +1 -1
- package/dist/hooks/magic-context/event-resolvers.d.ts +5 -0
- package/dist/hooks/magic-context/event-resolvers.d.ts.map +1 -1
- package/dist/hooks/magic-context/historian-drain-gate.d.ts +15 -0
- package/dist/hooks/magic-context/historian-drain-gate.d.ts.map +1 -1
- package/dist/hooks/magic-context/historian-prompt.generated.d.ts +1 -1
- package/dist/hooks/magic-context/historian-prompt.generated.d.ts.map +1 -1
- package/dist/hooks/magic-context/historian-publish-stage-logger.d.ts +5 -0
- package/dist/hooks/magic-context/historian-publish-stage-logger.d.ts.map +1 -1
- package/dist/hooks/magic-context/hook.d.ts.map +1 -1
- package/dist/hooks/magic-context/provider-overflow-notice.d.ts +8 -0
- package/dist/hooks/magic-context/provider-overflow-notice.d.ts.map +1 -0
- package/dist/hooks/magic-context/read-session-db.d.ts +2 -0
- package/dist/hooks/magic-context/read-session-db.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-compartment-phase.d.ts +5 -0
- package/dist/hooks/magic-context/transform-compartment-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/{index-czz0w2c4.js → index-01h7tqe3.js} +11 -0
- package/dist/{index-febyth5n.js → index-3f3d548g.js} +1372 -1307
- package/dist/{index-nmkv8yvs.js → index-41bma6qs.js} +2 -2
- package/dist/{index-r6r2eh90.js → index-5a9kwapd.js} +3 -3
- package/dist/{index-e8my7q6m.js → index-5pmf4jpj.js} +5 -5
- package/dist/{index-mq97qmb8.js → index-5y9w2ax7.js} +2 -2
- package/dist/{index-5wgdbj2h.js → index-6rk44cer.js} +2 -2
- package/dist/{index-gqhebzxx.js → index-901exj0f.js} +89 -24
- package/dist/{index-6zewd2n5.js → index-9ffntwyr.js} +1 -1
- package/dist/{index-wfahebsc.js → index-anwy2mfb.js} +4 -4
- package/dist/{index-83qd3n7s.js → index-et39x9k3.js} +1 -1
- package/dist/{index-dva352qe.js → index-hbn5g7rt.js} +1 -1
- package/dist/{index-capcna4r.js → index-hre29c1a.js} +1 -1
- package/dist/{index-sr8dmp7p.js → index-j2w79s9r.js} +76 -6
- package/dist/{index-qna2ra0s.js → index-jba6ny4m.js} +27 -3
- package/dist/{index-ywgv1xcb.js → index-mjy2k9jr.js} +1 -1
- package/dist/{index-3yw525kb.js → index-n71006wq.js} +6 -6
- package/dist/{index-m6vhxsce.js → index-r3tdqqtq.js} +86 -62
- package/dist/{index-x40zr813.js → index-sp5pvs95.js} +9 -1
- package/dist/{index-6t7jvp76.js → index-wvbg9m0h.js} +3 -3
- package/dist/{index-7rgnh11t.js → index-xg1zjht5.js} +5 -5
- package/dist/{index-ran2b3fn.js → index-zzhcshdk.js} +72 -64
- package/dist/index.js +78 -41
- package/dist/{message-index-bounded-wvnp6fcp.js → message-index-bounded-f6fc00ze.js} +4 -4
- package/dist/migration-worker.js +2 -2
- package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
- package/dist/raw-ordinal-warmup-worker.js +4 -4
- package/dist/{read-session-chunk-j4hjc1pk.js → read-session-chunk-y2ew3630.js} +3 -3
- package/dist/{recomp-orchestrator-ps1c8c5h.js → recomp-orchestrator-ggtcvb9g.js} +12 -12
- package/dist/{render-nfj7280n.js → render-q8c6wrq9.js} +10 -10
- package/dist/{search-archive-1etwnve4.js → search-archive-pz1jf655.js} +5 -5
- package/dist/{search-3r8b0jfa.js → search-gjyrwapc.js} +8 -8
- package/dist/{send-session-notification-gzxz88vq.js → send-session-notification-0779tyd9.js} +2 -2
- package/dist/{storage-tags-nh2ftqhx.js → storage-tags-7raphcw6.js} +1 -1
- package/dist/{store-reader-a2v34xnh.js → store-reader-qbq6q4v0.js} +1 -1
- package/dist/{store-019k3ek7.js → store-yr443ye8.js} +2 -2
- package/dist/{transform-postprocess-phase-tqp968w4.js → transform-postprocess-phase-pmzdd3s2.js} +13 -13
- package/dist/v2/auto-search-worker.js +1 -1
- package/dist/v2/chunk-embedding-write-worker.js +2 -2
- package/dist/v2/{context-d57v8c10.js → context-qqbpzk1q.js} +145 -105
- package/dist/v2/fold/host-media.d.ts.map +1 -1
- package/dist/v2/fold/native-replay.d.ts +1 -0
- package/dist/v2/fold/native-replay.d.ts.map +1 -1
- package/dist/v2/fold/restore.d.ts +15 -0
- package/dist/v2/fold/restore.d.ts.map +1 -1
- package/dist/v2/hidden-child-native.d.ts.map +1 -1
- package/dist/v2/hidden-run-holder.d.ts +4 -4
- package/dist/v2/hooks/overflow-recovery.d.ts +6 -0
- package/dist/v2/hooks/overflow-recovery.d.ts.map +1 -1
- package/dist/v2/{message-index-bounded-2nhbwry6.js → message-index-bounded-70g28hyg.js} +4 -4
- package/dist/v2/migration-worker.js +2 -2
- package/dist/v2/raw-ordinal-warmup-worker.js +4 -4
- package/dist/v2/{read-session-chunk-jrrhwxgx.js → read-session-chunk-9rf0n9e6.js} +3 -3
- package/dist/v2/{recomp-orchestrator-n79hdd7n.js → recomp-orchestrator-cwghhjc9.js} +11 -11
- package/dist/v2/{render-7emcjdt1.js → render-e852zmxz.js} +10 -10
- package/dist/v2/{search-archive-fpjbmxcx.js → search-archive-tmn6b5w8.js} +5 -5
- package/dist/v2/{search-vz2cpgr0.js → search-jd3vczhn.js} +7 -7
- package/dist/v2/{send-session-notification-zazaxxpf.js → send-session-notification-v69y04f5.js} +2 -2
- package/dist/v2/{server-r4816kwv.js → server-6t3asmx8.js} +4 -4
- package/dist/v2/{server-4axv6kq6.js → server-7x5a46hf.js} +1371 -1306
- package/dist/v2/{server-4bfk1sky.js → server-9011eteb.js} +2 -2
- package/dist/v2/{server-vfa7byfa.js → server-bvr9xs8h.js} +5 -5
- package/dist/v2/{server-q104czn6.js → server-d4trxrj3.js} +89 -24
- package/dist/v2/{server-n431vzn5.js → server-fj3pekz2.js} +2 -2
- package/dist/v2/{server-6250cxzs.js → server-gs2251jr.js} +1 -1
- package/dist/v2/{server-8r32etq0.js → server-jkj1dq6j.js} +27 -3
- package/dist/v2/{server-3z8rhacq.js → server-js2v309w.js} +4 -4
- package/dist/v2/{server-kwsqytwj.js → server-mgxqfprb.js} +1 -1
- package/dist/v2/{server-q2ap5cty.js → server-p4g021y5.js} +3 -3
- package/dist/v2/{server-0h875f56.js → server-rkj44mez.js} +76 -6
- package/dist/v2/{server-j9cm1czj.js → server-vtgeyhq6.js} +11 -0
- package/dist/v2/{server-xmgvy3cq.js → server-x69fqsvz.js} +1 -1
- package/dist/v2/{server-hgfd6c3e.js → server-ysjjcatk.js} +2 -2
- package/dist/v2/server.js +2 -2
- package/dist/v2/{storage-tags-t0f9njdp.js → storage-tags-wgsemtw1.js} +1 -1
- package/dist/v2/{store-q3ef5rvz.js → store-enef5jcn.js} +2 -2
- package/dist/v2/{store-reader-wc01y2rc.js → store-reader-jbaqv1yp.js} +1 -1
- package/dist/v2/store-reader.d.ts +16 -0
- package/dist/v2/store-reader.d.ts.map +1 -1
- package/dist/v2/{v2-archive-reader-9p84yzk5.js → v2-archive-reader-dm1aeqk2.js} +1 -1
- package/dist/v2/{wrapup-orchestrator-acebazx8.js → wrapup-orchestrator-cke368np.js} +11 -11
- package/dist/{v2-archive-reader-w1bbaqe8.js → v2-archive-reader-39ye0d3b.js} +1 -1
- package/dist/{wrapup-orchestrator-fwbe0mvm.js → wrapup-orchestrator-ggnk0r4r.js} +13 -13
- package/package.json +1 -1
- package/src/shared/models-dev-cache.test.ts +15 -0
- /package/dist/v2/{server-3ap5dmhc.js → server-5hwf5c7r.js} +0 -0
|
@@ -1,61 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getHarness2
|
|
3
|
-
} from "./index-pavzsdc6.js";
|
|
4
|
-
import {
|
|
5
|
-
getMagicContextStorageDir,
|
|
6
|
-
log2,
|
|
7
|
-
sessionLog2
|
|
8
|
-
} from "./index-ywrz4wy2.js";
|
|
9
|
-
import {
|
|
10
|
-
textMentionsRecentCommit,
|
|
11
|
-
hasMeaningfulUserText2,
|
|
12
|
-
estimateTokens
|
|
13
|
-
} from "./index-s7460efs.js";
|
|
14
|
-
import {
|
|
15
|
-
inRootAsyncContext2,
|
|
16
|
-
getTagIdentityWriteGeneration2,
|
|
17
|
-
getSqliteDatabasePath2,
|
|
18
|
-
assertTransformWrite2,
|
|
19
|
-
isTransientSqliteError2
|
|
20
|
-
} from "./index-gzy5w8ya.js";
|
|
21
|
-
import {
|
|
22
|
-
reuseWorker
|
|
23
|
-
} from "./index-96ztjvkn.js";
|
|
24
|
-
import {
|
|
25
|
-
createWorkerShutdown
|
|
26
|
-
} from "./index-1d042x6w.js";
|
|
27
|
-
import {
|
|
28
|
-
runSessionWarmupWorker
|
|
29
|
-
} from "./index-q7q6qp1f.js";
|
|
30
|
-
import {
|
|
31
|
-
getMaxM0MutationId,
|
|
32
|
-
getLastCompartmentEndMessage,
|
|
33
|
-
providerResponseFailed,
|
|
34
|
-
rememberUnpublishedAutoSearchNoHint,
|
|
35
|
-
getUnpublishedAutoSearchNoHint,
|
|
36
|
-
forgetUnpublishedAutoSearchNoHint,
|
|
37
|
-
registerAutoSearchWork,
|
|
38
|
-
cancelAutoSearchWork,
|
|
39
|
-
getOrCreateSessionMeta,
|
|
40
|
-
updateSessionMeta,
|
|
41
|
-
advanceToolReclaimWatermark,
|
|
42
|
-
requestPendingMaterialization,
|
|
43
|
-
pendingMaterializationOrigin,
|
|
44
|
-
hasPendingMaterializationOrigin,
|
|
45
|
-
hasExplicitRefreshRequest,
|
|
46
|
-
clearReclaimedMaterialization,
|
|
47
|
-
clearPendingMaterializationOrigin,
|
|
48
|
-
noteServedPassPermission,
|
|
49
|
-
dropSlot,
|
|
50
|
-
TOOL_SWEEP_SCOPED_MARKER,
|
|
51
|
-
saveSourceContent,
|
|
52
|
-
replaceSourceContent,
|
|
53
|
-
getSourceContents
|
|
54
|
-
} from "./index-wfahebsc.js";
|
|
55
|
-
import {
|
|
56
|
-
cleanSearchText,
|
|
57
|
-
matchedSearchSnippet
|
|
58
|
-
} from "./index-capcna4r.js";
|
|
59
1
|
import {
|
|
60
2
|
protectedToolTagNumbers,
|
|
61
3
|
stripPersistedAssistantText,
|
|
@@ -138,6 +80,7 @@ import {
|
|
|
138
80
|
detectThinkingBindingMismatch,
|
|
139
81
|
detectLatestTurnThinkingMismatch,
|
|
140
82
|
isPrefixBoundThinkingModel,
|
|
83
|
+
overflowLimitToStore,
|
|
141
84
|
modelAcceptsEmptyContent,
|
|
142
85
|
isAnthropicFamilyRoute,
|
|
143
86
|
neutralizeDroppedReasoningPart,
|
|
@@ -221,7 +164,65 @@ import {
|
|
|
221
164
|
adoptNullOwnerToolTag2,
|
|
222
165
|
getCandidateToolOwners2,
|
|
223
166
|
pickNearestPriorOwner2
|
|
224
|
-
} from "./index-
|
|
167
|
+
} from "./index-901exj0f.js";
|
|
168
|
+
import {
|
|
169
|
+
getHarness2
|
|
170
|
+
} from "./index-pavzsdc6.js";
|
|
171
|
+
import {
|
|
172
|
+
getMagicContextStorageDir,
|
|
173
|
+
log2,
|
|
174
|
+
sessionLog2
|
|
175
|
+
} from "./index-ywrz4wy2.js";
|
|
176
|
+
import {
|
|
177
|
+
textMentionsRecentCommit,
|
|
178
|
+
hasMeaningfulUserText2,
|
|
179
|
+
estimateTokens
|
|
180
|
+
} from "./index-s7460efs.js";
|
|
181
|
+
import {
|
|
182
|
+
inRootAsyncContext2,
|
|
183
|
+
getTagIdentityWriteGeneration2,
|
|
184
|
+
getSqliteDatabasePath2,
|
|
185
|
+
assertTransformWrite2,
|
|
186
|
+
isTransientSqliteError2
|
|
187
|
+
} from "./index-gzy5w8ya.js";
|
|
188
|
+
import {
|
|
189
|
+
reuseWorker
|
|
190
|
+
} from "./index-96ztjvkn.js";
|
|
191
|
+
import {
|
|
192
|
+
createWorkerShutdown
|
|
193
|
+
} from "./index-1d042x6w.js";
|
|
194
|
+
import {
|
|
195
|
+
runSessionWarmupWorker
|
|
196
|
+
} from "./index-q7q6qp1f.js";
|
|
197
|
+
import {
|
|
198
|
+
getMaxM0MutationId,
|
|
199
|
+
getLastCompartmentEndMessage,
|
|
200
|
+
providerResponseFailed,
|
|
201
|
+
rememberUnpublishedAutoSearchNoHint,
|
|
202
|
+
getUnpublishedAutoSearchNoHint,
|
|
203
|
+
forgetUnpublishedAutoSearchNoHint,
|
|
204
|
+
registerAutoSearchWork,
|
|
205
|
+
cancelAutoSearchWork,
|
|
206
|
+
getOrCreateSessionMeta,
|
|
207
|
+
updateSessionMeta,
|
|
208
|
+
advanceToolReclaimWatermark,
|
|
209
|
+
requestPendingMaterialization,
|
|
210
|
+
pendingMaterializationOrigin,
|
|
211
|
+
hasPendingMaterializationOrigin,
|
|
212
|
+
hasExplicitRefreshRequest,
|
|
213
|
+
clearReclaimedMaterialization,
|
|
214
|
+
clearPendingMaterializationOrigin,
|
|
215
|
+
noteServedPassPermission,
|
|
216
|
+
dropSlot,
|
|
217
|
+
TOOL_SWEEP_SCOPED_MARKER,
|
|
218
|
+
saveSourceContent,
|
|
219
|
+
replaceSourceContent,
|
|
220
|
+
getSourceContents
|
|
221
|
+
} from "./index-anwy2mfb.js";
|
|
222
|
+
import {
|
|
223
|
+
cleanSearchText,
|
|
224
|
+
matchedSearchSnippet
|
|
225
|
+
} from "./index-hre29c1a.js";
|
|
225
226
|
import {
|
|
226
227
|
BoundedSessionMap,
|
|
227
228
|
tagRevisionKey,
|
|
@@ -241,7 +242,7 @@ import {
|
|
|
241
242
|
withReadOnlySessionDb,
|
|
242
243
|
getMessageTimesFromOpenCodeDb,
|
|
243
244
|
findLastAssistantModelFromOpenCodeDb
|
|
244
|
-
} from "./index-
|
|
245
|
+
} from "./index-sp5pvs95.js";
|
|
245
246
|
import {
|
|
246
247
|
stripSystemInjection,
|
|
247
248
|
isTextPart,
|
|
@@ -254,7 +255,7 @@ import {
|
|
|
254
255
|
extractToolCallObservation,
|
|
255
256
|
ToolMutationBatch,
|
|
256
257
|
createToolDropTarget
|
|
257
|
-
} from "./index-
|
|
258
|
+
} from "./index-5y9w2ax7.js";
|
|
258
259
|
import {
|
|
259
260
|
hasTrustedAbsoluteWall,
|
|
260
261
|
applyProvenInputFloor,
|
|
@@ -277,7 +278,7 @@ import {
|
|
|
277
278
|
getMessageIndexEpoch,
|
|
278
279
|
isMessageIndexSearchable,
|
|
279
280
|
createAutoSearchDiagnostics
|
|
280
|
-
} from "./index-
|
|
281
|
+
} from "./index-hbn5g7rt.js";
|
|
281
282
|
import {
|
|
282
283
|
compareOpenCodeMessagesByCanonicalOrder,
|
|
283
284
|
startCompactionMarkerCandidatePreparation,
|
|
@@ -299,7 +300,7 @@ import {
|
|
|
299
300
|
peekNoteNudgeText,
|
|
300
301
|
markNoteNudgeDelivered,
|
|
301
302
|
getActiveCompartmentRun
|
|
302
|
-
} from "./index-
|
|
303
|
+
} from "./index-3f3d548g.js";
|
|
303
304
|
import {
|
|
304
305
|
canonicalModelIdentity,
|
|
305
306
|
piModelRefToCanonical,
|
|
@@ -524,6 +525,13 @@ function resolveTrustedContextLimit(providerID, modelID, ctx) {
|
|
|
524
525
|
const persisted = modelMatchedPersistedUsage(ctx?.db, ctx?.sessionID, modelKey);
|
|
525
526
|
return isSaneLimit(persisted?.lastUsageContextLimit) ? persisted.lastUsageContextLimit : undefined;
|
|
526
527
|
}
|
|
528
|
+
function resolveOpenCodeOverflowLimit(detection, providerID, modelID, ctx) {
|
|
529
|
+
return overflowLimitToStore(detection, () => {
|
|
530
|
+
if (!providerID || !modelID)
|
|
531
|
+
return;
|
|
532
|
+
return resolveContextWindowGeometry(providerID, modelID, ctx)?.usableSoft ?? resolveTrustedContextLimit(providerID, modelID, ctx);
|
|
533
|
+
});
|
|
534
|
+
}
|
|
527
535
|
var WRAPUP_WINDOW_UNAVAILABLE = "Cannot run /ctx-wrapup: the model's context window is unknown. Select a model with a configured context window or send a message with that model, then retry.";
|
|
528
536
|
function readPersistedWrapupWindow(db, sessionId, modelKey) {
|
|
529
537
|
const { lastUsageContextLimit, lastObservedModelKey } = getOrCreateSessionMeta(db, sessionId);
|
|
@@ -9232,4 +9240,4 @@ function checkM0MutationDriftAndSignal2(args) {
|
|
|
9232
9240
|
return false;
|
|
9233
9241
|
}
|
|
9234
9242
|
|
|
9235
|
-
export { resolveModelCacheTtl, recordOpenCodeProvenInputFloor, resolveOpenCodeProvenInputFloor, resolveContextWindowGeometry, resolveContextLimit, resolveTrustedContextLimit, WRAPUP_WINDOW_UNAVAILABLE, resolveOpenCodeWrapupWindow, resolveExecuteThresholdDetail, resolveExecuteThreshold, resolveModelKey, resolveSessionId, historyBudgetPolicyIdentity, parseCacheTtl, createScheduler, computeHardCacheExpired, makeToolCompositeKey, createTagger, cavemanWordRulesForLanguage, searchMessageHistoryOffThread, findSessionId, findLastUserMessageId, clearAutoSearchForSession, setCtxReduceRegisteredGlobally, resolveCtxReduceAvailabilityFromMessages, resolveCtxReduceAvailability, primeCtxReduceSpawnPermission, ctxReduceSpawnPermissionReadNeeded, spawnAgentFromMessages, spawnAgentFromOpenCodeDb, todowritePermissionDenied, cachedToolPermissionDenied, clearToolPermissionDenied, resolveTodowriteAvailabilityFromMessages, resolveTodowriteAvailability, diagnosticStateChanged, clearDiagnosticLogState, canConsumeDeferredOnThisPass, hasReclaimRide, reclaimRidePermitted, reclaimRideLabel, pendingDropEligibilityKey, createPendingDropEligibilityCache, readExecuteReclaimState, writeExecuteReclaimState, maintainExecuteFloorMark, captureOpencodeReasoningBudgetStatus, reasoningBudgetStatusLine, ENGINE_RECONNECTING_USER_MESSAGE, ENGINE_BUSY_USER_MESSAGE, SIGNED_THINKING_RESET_FENCE_FAILED, contextRefusalError, protectedToolRefusal, outgoingContextRefusal, signedTurnContextRefusal, EmergencyFailClosedError, removeReasoningParts, latestAssistantTurnStart, latestAssistantTurnMessages, hasActiveAnthropicThinkingTurn, retainedActiveThinkingParts, armLatestThinkingRecovery, LATEST_TURN_THINKING_REMOVED_REASON, prepareLatestThinkingRecovery, endLatestThinkingRecoveryAfterReset, restoredTurnMessages, captureLatestTurnOriginals, armBindingRecoverySafely, armLatestThinkingRecoveryFromError, armThinkingBindingRecoveryFromError, hostInstructionRetentionEnabled, isHostInstructionRetentionOn, recordHostInstructionDecisions, replayCavemanCompression, describeDegradedPassFailure, DegradedPassRefusalError, degradedPassError, servedHeadChanged, noteHostCheckpointCommit, revertHostCheckpointPass, forgetHostCheckpointPass, forceBandConfirmed, pressureBands, forceRide, heuristicsRunOnPass, routineCleanupRunsOnPass, heuristicsAlreadyRanThisTurn, routinePressureAlreadyApplied, safeReasoningCutoff, isStructuralNoiseSentinel, stripStructuralNoise, prepareStructuralSentinelChoices, renderDroppedText, applyFlushedStatuses, prewarmTagOwners, waitForTagOwners, collectForeignTextParts, isLegacyForeignTextTag, withTransformTimingSummary, logTransformTiming, hasRecentAssistantCommit, tagMessages, resetDegradedCacheCount2, isSyntheticHeadMessage2, applyTodoSynthesis2, freezeReasoningOnBustingPass2, servesThinkingBlock2, firstServedDivergenceIndex2, rustModeServedKeyAfterPersistedStrips2, replayRustModeBindingMismatchStrips2, RUST_MARKER_LOCK_SKIP_LOG2, applyRustModeDeferredCompactionMarker2, clearRustModeBoundaryRecord2, runRustModePostprocess2, reconcileMarkerRepresentation2, clearPendingCompactionMarkerAfterSuccessfulDrain2, defaultCompactionMarkerStrategy2, abortSessionFailClosed2, evaluateEmergencyFailClosed2, finalizeMessageRepresentation2, runPostTransformPhase2, checkM0MutationDriftAndSignal2 };
|
|
9243
|
+
export { resolveModelCacheTtl, recordOpenCodeProvenInputFloor, resolveOpenCodeProvenInputFloor, resolveContextWindowGeometry, resolveContextLimit, resolveTrustedContextLimit, resolveOpenCodeOverflowLimit, WRAPUP_WINDOW_UNAVAILABLE, resolveOpenCodeWrapupWindow, resolveExecuteThresholdDetail, resolveExecuteThreshold, resolveModelKey, resolveSessionId, historyBudgetPolicyIdentity, parseCacheTtl, createScheduler, computeHardCacheExpired, makeToolCompositeKey, createTagger, cavemanWordRulesForLanguage, searchMessageHistoryOffThread, findSessionId, findLastUserMessageId, clearAutoSearchForSession, setCtxReduceRegisteredGlobally, resolveCtxReduceAvailabilityFromMessages, resolveCtxReduceAvailability, primeCtxReduceSpawnPermission, ctxReduceSpawnPermissionReadNeeded, spawnAgentFromMessages, spawnAgentFromOpenCodeDb, todowritePermissionDenied, cachedToolPermissionDenied, clearToolPermissionDenied, resolveTodowriteAvailabilityFromMessages, resolveTodowriteAvailability, diagnosticStateChanged, clearDiagnosticLogState, canConsumeDeferredOnThisPass, hasReclaimRide, reclaimRidePermitted, reclaimRideLabel, pendingDropEligibilityKey, createPendingDropEligibilityCache, readExecuteReclaimState, writeExecuteReclaimState, maintainExecuteFloorMark, captureOpencodeReasoningBudgetStatus, reasoningBudgetStatusLine, ENGINE_RECONNECTING_USER_MESSAGE, ENGINE_BUSY_USER_MESSAGE, SIGNED_THINKING_RESET_FENCE_FAILED, contextRefusalError, protectedToolRefusal, outgoingContextRefusal, signedTurnContextRefusal, EmergencyFailClosedError, removeReasoningParts, latestAssistantTurnStart, latestAssistantTurnMessages, hasActiveAnthropicThinkingTurn, retainedActiveThinkingParts, armLatestThinkingRecovery, LATEST_TURN_THINKING_REMOVED_REASON, prepareLatestThinkingRecovery, endLatestThinkingRecoveryAfterReset, restoredTurnMessages, captureLatestTurnOriginals, armBindingRecoverySafely, armLatestThinkingRecoveryFromError, armThinkingBindingRecoveryFromError, hostInstructionRetentionEnabled, isHostInstructionRetentionOn, recordHostInstructionDecisions, replayCavemanCompression, describeDegradedPassFailure, DegradedPassRefusalError, degradedPassError, servedHeadChanged, noteHostCheckpointCommit, revertHostCheckpointPass, forgetHostCheckpointPass, forceBandConfirmed, pressureBands, forceRide, heuristicsRunOnPass, routineCleanupRunsOnPass, heuristicsAlreadyRanThisTurn, routinePressureAlreadyApplied, safeReasoningCutoff, isStructuralNoiseSentinel, stripStructuralNoise, prepareStructuralSentinelChoices, renderDroppedText, applyFlushedStatuses, prewarmTagOwners, waitForTagOwners, collectForeignTextParts, isLegacyForeignTextTag, withTransformTimingSummary, logTransformTiming, hasRecentAssistantCommit, tagMessages, resetDegradedCacheCount2, isSyntheticHeadMessage2, applyTodoSynthesis2, freezeReasoningOnBustingPass2, servesThinkingBlock2, firstServedDivergenceIndex2, rustModeServedKeyAfterPersistedStrips2, replayRustModeBindingMismatchStrips2, RUST_MARKER_LOCK_SKIP_LOG2, applyRustModeDeferredCompactionMarker2, clearRustModeBoundaryRecord2, runRustModePostprocess2, reconcileMarkerRepresentation2, clearPendingCompactionMarkerAfterSuccessfulDrain2, defaultCompactionMarkerStrategy2, abortSessionFailClosed2, evaluateEmergencyFailClosed2, finalizeMessageRepresentation2, runPostTransformPhase2, checkM0MutationDriftAndSignal2 };
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
recordToolParameters,
|
|
5
5
|
createDroppedInputToolExecuteBeforeHook,
|
|
6
6
|
readRawSessionMessages2
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-5y9w2ax7.js";
|
|
8
8
|
import {
|
|
9
9
|
setHarness2
|
|
10
10
|
} from "./index-pavzsdc6.js";
|
|
@@ -58,7 +58,7 @@ import {
|
|
|
58
58
|
checkCompactionMarkerConsistency,
|
|
59
59
|
clearInjectionCache,
|
|
60
60
|
clearNoteNudgeTriggerOnly
|
|
61
|
-
} from "./index-
|
|
61
|
+
} from "./index-3f3d548g.js";
|
|
62
62
|
import"./index-sd3egckz.js";
|
|
63
63
|
import"./index-gqf8r04r.js";
|
|
64
64
|
import {
|
|
@@ -120,6 +120,9 @@ import {
|
|
|
120
120
|
clearTransformDecisionSession,
|
|
121
121
|
scheduleOpenCodeTransformDecisionWrite,
|
|
122
122
|
maybeDeliverChannel2,
|
|
123
|
+
PROVIDER_OVERFLOW_NOTICE,
|
|
124
|
+
noteServedRecoveryForOverflowHint,
|
|
125
|
+
holdOverflowResendHint,
|
|
123
126
|
StorageBusyRefusalError,
|
|
124
127
|
rustWrapupHistorianFields,
|
|
125
128
|
clearMessageTokensCache,
|
|
@@ -143,7 +146,7 @@ import {
|
|
|
143
146
|
parameterDescriptionsFor,
|
|
144
147
|
MagicContextRpcServer,
|
|
145
148
|
applyHiddenSubagentTemperature
|
|
146
|
-
} from "./index-
|
|
149
|
+
} from "./index-r3tdqqtq.js";
|
|
147
150
|
import {
|
|
148
151
|
resolveOpenCodeDbPath,
|
|
149
152
|
openCodeDbPathExists,
|
|
@@ -195,7 +198,7 @@ import {
|
|
|
195
198
|
dropServedRecord,
|
|
196
199
|
registerLkgPersistence,
|
|
197
200
|
dropSlot
|
|
198
|
-
} from "./index-
|
|
201
|
+
} from "./index-anwy2mfb.js";
|
|
199
202
|
import {
|
|
200
203
|
recordSessionProjectIdentity
|
|
201
204
|
} from "./index-r4y0dczp.js";
|
|
@@ -209,7 +212,7 @@ import {
|
|
|
209
212
|
openDatabaseAsync,
|
|
210
213
|
isDatabasePersisted,
|
|
211
214
|
getDatabasePersistenceError
|
|
212
|
-
} from "./index-
|
|
215
|
+
} from "./index-6rk44cer.js";
|
|
213
216
|
import {
|
|
214
217
|
registerExitAbort,
|
|
215
218
|
unregisterExitAbort
|
|
@@ -220,7 +223,7 @@ import {
|
|
|
220
223
|
forgetRawSessionOrdinalWatermark2
|
|
221
224
|
} from "./index-q7q6qp1f.js";
|
|
222
225
|
import"./index-s32f8y67.js";
|
|
223
|
-
import"./index-
|
|
226
|
+
import"./index-jba6ny4m.js";
|
|
224
227
|
import"./index-fr0wbhdn.js";
|
|
225
228
|
import {
|
|
226
229
|
preloadTokenizer
|
|
@@ -229,18 +232,19 @@ import"./index-6r99v53h.js";
|
|
|
229
232
|
import {
|
|
230
233
|
getDefaultSubcConnectionFile,
|
|
231
234
|
SubcModuleTransport
|
|
232
|
-
} from "./index-
|
|
235
|
+
} from "./index-5pmf4jpj.js";
|
|
233
236
|
import"./index-qt1qqasc.js";
|
|
234
237
|
import"./index-e6ncz7a6.js";
|
|
235
238
|
import {
|
|
239
|
+
latestTrackedOpenCodeAssistantId,
|
|
236
240
|
observeOpenCodeTurnEvent,
|
|
237
241
|
clearTrackedOpenCodeSession,
|
|
238
242
|
findLastAssistantModelFromOpenCodeDb
|
|
239
|
-
} from "./index-
|
|
243
|
+
} from "./index-sp5pvs95.js";
|
|
240
244
|
import {
|
|
241
245
|
sendCommandResult2,
|
|
242
246
|
sendStatusNotification2
|
|
243
|
-
} from "./index-
|
|
247
|
+
} from "./index-9ffntwyr.js";
|
|
244
248
|
import {
|
|
245
249
|
detectConflicts,
|
|
246
250
|
resolveCompactionForBoot
|
|
@@ -248,7 +252,7 @@ import {
|
|
|
248
252
|
import {
|
|
249
253
|
sendConflictWarning2,
|
|
250
254
|
cleanupConflictWarnings2
|
|
251
|
-
} from "./index-
|
|
255
|
+
} from "./index-et39x9k3.js";
|
|
252
256
|
import"./index-1zx87sdm.js";
|
|
253
257
|
import {
|
|
254
258
|
stripPersistedAssistantText,
|
|
@@ -276,10 +280,11 @@ import {
|
|
|
276
280
|
detectLatestTurnThinkingMismatch,
|
|
277
281
|
isPrefixBoundThinkingModel,
|
|
278
282
|
detectOverflow,
|
|
283
|
+
isProviderRateLimit,
|
|
279
284
|
isAnthropicFamilyRoute,
|
|
280
285
|
deleteTagsByMessageId2,
|
|
281
286
|
getMaxTagNumberBySession2
|
|
282
|
-
} from "./index-
|
|
287
|
+
} from "./index-901exj0f.js";
|
|
283
288
|
import {
|
|
284
289
|
resolveHistorianModel2,
|
|
285
290
|
resolveOpenCodeAgentOverrides2,
|
|
@@ -298,9 +303,9 @@ import {
|
|
|
298
303
|
import"./index-0twg41mh.js";
|
|
299
304
|
import {
|
|
300
305
|
deleteIndexedMessage
|
|
301
|
-
} from "./index-
|
|
302
|
-
import"./index-
|
|
303
|
-
import"./index-
|
|
306
|
+
} from "./index-hre29c1a.js";
|
|
307
|
+
import"./index-01h7tqe3.js";
|
|
308
|
+
import"./index-mjy2k9jr.js";
|
|
304
309
|
import {
|
|
305
310
|
pushNotification2
|
|
306
311
|
} from "./index-y14pawe1.js";
|
|
@@ -318,6 +323,7 @@ import {
|
|
|
318
323
|
resolveOpenCodeProvenInputFloor,
|
|
319
324
|
resolveContextWindowGeometry,
|
|
320
325
|
resolveContextLimit,
|
|
326
|
+
resolveOpenCodeOverflowLimit,
|
|
321
327
|
WRAPUP_WINDOW_UNAVAILABLE,
|
|
322
328
|
resolveOpenCodeWrapupWindow,
|
|
323
329
|
resolveExecuteThresholdDetail,
|
|
@@ -332,13 +338,13 @@ import {
|
|
|
332
338
|
armBindingRecoverySafely,
|
|
333
339
|
collectForeignTextParts,
|
|
334
340
|
resetDegradedCacheCount2
|
|
335
|
-
} from "./index-
|
|
341
|
+
} from "./index-zzhcshdk.js";
|
|
336
342
|
import {
|
|
337
343
|
scheduleClearAndReindex
|
|
338
|
-
} from "./index-
|
|
344
|
+
} from "./index-hbn5g7rt.js";
|
|
339
345
|
import {
|
|
340
346
|
runManagedRecomp2
|
|
341
|
-
} from "./index-
|
|
347
|
+
} from "./index-5a9kwapd.js";
|
|
342
348
|
import {
|
|
343
349
|
isValidSemver,
|
|
344
350
|
compareSemverCore
|
|
@@ -346,11 +352,11 @@ import {
|
|
|
346
352
|
import"./index-fmsr7v69.js";
|
|
347
353
|
import {
|
|
348
354
|
runManagedWrapup2
|
|
349
|
-
} from "./index-
|
|
350
|
-
import"./index-
|
|
355
|
+
} from "./index-n71006wq.js";
|
|
356
|
+
import"./index-41bma6qs.js";
|
|
351
357
|
import"./index-52x68mj4.js";
|
|
352
|
-
import"./index-
|
|
353
|
-
import"./index-
|
|
358
|
+
import"./index-xg1zjht5.js";
|
|
359
|
+
import"./index-wvbg9m0h.js";
|
|
354
360
|
import {
|
|
355
361
|
__toESM,
|
|
356
362
|
__commonJS
|
|
@@ -8206,7 +8212,7 @@ var require_src2 = __commonJS(function(exports, module) {
|
|
|
8206
8212
|
// package.json
|
|
8207
8213
|
var package_default = {
|
|
8208
8214
|
name: "@cortexkit/opencode-magic-context",
|
|
8209
|
-
version: "0.49.
|
|
8215
|
+
version: "0.49.92",
|
|
8210
8216
|
type: "module",
|
|
8211
8217
|
description: "OpenCode plugin for Magic Context — cross-session memory and context management",
|
|
8212
8218
|
main: "dist/index.js",
|
|
@@ -9694,6 +9700,23 @@ function cleanupRemovedMessageState(deps, sessionId, messageId) {
|
|
|
9694
9700
|
}
|
|
9695
9701
|
function createEventHandler2(deps) {
|
|
9696
9702
|
const newestUsageMessageIdBySession = new Map;
|
|
9703
|
+
const notifiedStepBySession = new BoundedSessionMap(1000);
|
|
9704
|
+
async function notifyProviderOverflow(sessionId, stepId, error) {
|
|
9705
|
+
if (!stepId || deps.internalChildSessions?.has(sessionId) || isProviderRateLimit(error))
|
|
9706
|
+
return;
|
|
9707
|
+
const previous = notifiedStepBySession.get(sessionId);
|
|
9708
|
+
if (previous !== undefined && stepId <= previous)
|
|
9709
|
+
return;
|
|
9710
|
+
notifiedStepBySession.set(sessionId, stepId);
|
|
9711
|
+
if (holdOverflowResendHint(sessionId))
|
|
9712
|
+
return;
|
|
9713
|
+
await sendStatusNotification2(deps.client, sessionId, PROVIDER_OVERFLOW_NOTICE, {
|
|
9714
|
+
toastDurationMs: 15000,
|
|
9715
|
+
toastTitle: "Magic Context",
|
|
9716
|
+
toastVariant: "error",
|
|
9717
|
+
liveOnly: true
|
|
9718
|
+
});
|
|
9719
|
+
}
|
|
9697
9720
|
return async (input) => {
|
|
9698
9721
|
evictExpiredUsageEntries(deps.contextUsageMap);
|
|
9699
9722
|
observeOpenCodeTurnEvent(input.event.type, input.event.properties);
|
|
@@ -9764,24 +9787,32 @@ function createEventHandler2(deps) {
|
|
|
9764
9787
|
error: errInfo.error
|
|
9765
9788
|
});
|
|
9766
9789
|
const sessionMeta = getOrCreateSessionMeta(deps.db, errInfo.sessionID);
|
|
9767
|
-
const
|
|
9790
|
+
const liveModel = detection.coldRequestCap && (!errInfo.providerID || !errInfo.modelID) ? deps.getLiveModel?.(errInfo.sessionID) : undefined;
|
|
9791
|
+
const liveModelMatches = liveModel && (!errInfo.providerID || liveModel.providerID === errInfo.providerID) && (!errInfo.modelID || liveModel.modelID === errInfo.modelID);
|
|
9792
|
+
const providerID = errInfo.providerID ?? (liveModelMatches ? liveModel.providerID : undefined);
|
|
9793
|
+
const modelID = errInfo.modelID ?? (liveModelMatches ? liveModel.modelID : undefined);
|
|
9794
|
+
const overflowModelKey = resolveModelKey(providerID, modelID) ?? sessionMeta.lastObservedModelKey ?? undefined;
|
|
9795
|
+
const reportedLimit = resolveOpenCodeOverflowLimit(detection, providerID, modelID, {
|
|
9796
|
+
db: deps.db,
|
|
9797
|
+
sessionID: errInfo.sessionID
|
|
9798
|
+
});
|
|
9768
9799
|
if (sessionMeta.isSubagent) {
|
|
9769
|
-
if (
|
|
9770
|
-
recordDetectedContextLimit(deps.db, errInfo.sessionID,
|
|
9800
|
+
if (reportedLimit) {
|
|
9801
|
+
recordDetectedContextLimit(deps.db, errInfo.sessionID, reportedLimit, overflowModelKey, detection.reportedLimitProvenance);
|
|
9771
9802
|
}
|
|
9772
9803
|
sessionLog2(errInfo.sessionID, `overflow detected on subagent: reportedLimit=${detection.reportedLimit ?? "unknown"} provenance=${detection.reportedLimitProvenance ?? "n/a"} pattern=${detection.matchedPattern ?? "n/a"} — recorded limit only (subagents cannot run historian)`);
|
|
9773
9804
|
return;
|
|
9774
9805
|
}
|
|
9775
9806
|
const existing = getOverflowState(deps.db, errInfo.sessionID);
|
|
9776
9807
|
if (deps.compactionOff) {
|
|
9777
|
-
if (
|
|
9778
|
-
recordDetectedContextLimit(deps.db, errInfo.sessionID,
|
|
9808
|
+
if (reportedLimit) {
|
|
9809
|
+
recordDetectedContextLimit(deps.db, errInfo.sessionID, reportedLimit, overflowModelKey, detection.reportedLimitProvenance);
|
|
9779
9810
|
}
|
|
9780
9811
|
sessionLog2(errInfo.sessionID, `overflow detected in compaction-off mode: reportedLimit=${detection.reportedLimit ?? "unknown"} provenance=${detection.reportedLimitProvenance ?? "n/a"} pattern=${detection.matchedPattern ?? "n/a"} — recorded limit only (recovery disarmed; native compaction owns the window)`);
|
|
9781
9812
|
return;
|
|
9782
9813
|
}
|
|
9783
9814
|
dropSlot(errInfo.sessionID, "overflow-recovery-arm");
|
|
9784
|
-
recordOverflowDetected(deps.db, errInfo.sessionID,
|
|
9815
|
+
recordOverflowDetected(deps.db, errInfo.sessionID, reportedLimit, overflowModelKey, "provider_overflow", detection.reportedLimitProvenance, detection.reportedInputTokens);
|
|
9785
9816
|
if (detection.reportedInputTokens) {
|
|
9786
9817
|
const provenLimit = getOverflowState(deps.db, errInfo.sessionID, overflowModelKey).detectedContextLimit;
|
|
9787
9818
|
deps.contextUsageMap.set(errInfo.sessionID, {
|
|
@@ -9795,6 +9826,7 @@ function createEventHandler2(deps) {
|
|
|
9795
9826
|
}
|
|
9796
9827
|
sessionLog2(errInfo.sessionID, `overflow detected via session.error: reportedLimit=${detection.reportedLimit ?? "unknown"} provenance=${detection.reportedLimitProvenance ?? "n/a"} pattern=${detection.matchedPattern ?? "n/a"} (previousRecovery=${existing.needsEmergencyRecovery})`);
|
|
9797
9828
|
deps.onSessionCacheInvalidated?.(errInfo.sessionID);
|
|
9829
|
+
await notifyProviderOverflow(errInfo.sessionID, latestTrackedOpenCodeAssistantId(errInfo.sessionID), errInfo.error);
|
|
9798
9830
|
} catch (error) {
|
|
9799
9831
|
sessionLog2(errInfo.sessionID, "event session.error handling failed:", error);
|
|
9800
9832
|
}
|
|
@@ -9884,20 +9916,21 @@ function createEventHandler2(deps) {
|
|
|
9884
9916
|
error: info.error
|
|
9885
9917
|
});
|
|
9886
9918
|
const overflowModelKey = resolveModelKey(info.providerID, info.modelID);
|
|
9919
|
+
const reportedLimit = resolveOpenCodeOverflowLimit(detection, info.providerID, info.modelID, { db: deps.db, sessionID: info.sessionID });
|
|
9887
9920
|
const metaForOverflow = getOrCreateSessionMeta(deps.db, info.sessionID);
|
|
9888
9921
|
if (metaForOverflow.isSubagent) {
|
|
9889
|
-
if (
|
|
9890
|
-
recordDetectedContextLimit(deps.db, info.sessionID,
|
|
9922
|
+
if (reportedLimit) {
|
|
9923
|
+
recordDetectedContextLimit(deps.db, info.sessionID, reportedLimit, overflowModelKey, detection.reportedLimitProvenance);
|
|
9891
9924
|
}
|
|
9892
9925
|
sessionLog2(info.sessionID, `overflow detected on subagent via message.updated: reportedLimit=${detection.reportedLimit ?? "unknown"} provenance=${detection.reportedLimitProvenance ?? "n/a"} pattern=${detection.matchedPattern ?? "n/a"} — recorded limit only`);
|
|
9893
9926
|
} else if (deps.compactionOff) {
|
|
9894
|
-
if (
|
|
9895
|
-
recordDetectedContextLimit(deps.db, info.sessionID,
|
|
9927
|
+
if (reportedLimit) {
|
|
9928
|
+
recordDetectedContextLimit(deps.db, info.sessionID, reportedLimit, overflowModelKey, detection.reportedLimitProvenance);
|
|
9896
9929
|
}
|
|
9897
9930
|
sessionLog2(info.sessionID, `overflow detected in compaction-off mode via message.updated: reportedLimit=${detection.reportedLimit ?? "unknown"} provenance=${detection.reportedLimitProvenance ?? "n/a"} pattern=${detection.matchedPattern ?? "n/a"} — recorded limit only`);
|
|
9898
9931
|
} else {
|
|
9899
9932
|
dropSlot(info.sessionID, "overflow-recovery-arm");
|
|
9900
|
-
recordOverflowDetected(deps.db, info.sessionID,
|
|
9933
|
+
recordOverflowDetected(deps.db, info.sessionID, reportedLimit, overflowModelKey, "provider_overflow", detection.reportedLimitProvenance, detection.reportedInputTokens);
|
|
9901
9934
|
if (detection.reportedInputTokens) {
|
|
9902
9935
|
const provenLimit = getOverflowState(deps.db, info.sessionID, overflowModelKey).detectedContextLimit;
|
|
9903
9936
|
deps.contextUsageMap.set(info.sessionID, {
|
|
@@ -9911,6 +9944,7 @@ function createEventHandler2(deps) {
|
|
|
9911
9944
|
}
|
|
9912
9945
|
sessionLog2(info.sessionID, `overflow detected via message.updated: reportedLimit=${detection.reportedLimit ?? "unknown"} provenance=${detection.reportedLimitProvenance ?? "n/a"} pattern=${detection.matchedPattern ?? "n/a"}`);
|
|
9913
9946
|
deps.onSessionCacheInvalidated?.(info.sessionID);
|
|
9947
|
+
await notifyProviderOverflow(info.sessionID, info.messageID, info.error);
|
|
9914
9948
|
}
|
|
9915
9949
|
} catch (error) {
|
|
9916
9950
|
sessionLog2(info.sessionID, "event message.updated overflow persistence failed:", error);
|
|
@@ -10186,6 +10220,8 @@ function createEventHandler2(deps) {
|
|
|
10186
10220
|
dropSlot(sessionId, "session.deleted");
|
|
10187
10221
|
dropServedRecord(sessionId, "session_deleted");
|
|
10188
10222
|
clearLkgMeasuredRequest(sessionId);
|
|
10223
|
+
notifiedStepBySession.delete(sessionId);
|
|
10224
|
+
noteServedRecoveryForOverflowHint(sessionId);
|
|
10189
10225
|
clearTrackedOpenCodeSession(sessionId);
|
|
10190
10226
|
try {
|
|
10191
10227
|
const rustCleanupPending = markSessionCleanupPending(deps.db, sessionId, deps.rustSessionCleanup === true);
|
|
@@ -10621,6 +10657,7 @@ function createMagicContextHook(deps) {
|
|
|
10621
10657
|
onRustEngineReconnectRefusal: (args) => rustRefusalRecovery?.arm(args)
|
|
10622
10658
|
});
|
|
10623
10659
|
const eventHandler = createEventHandler2({
|
|
10660
|
+
getLiveModel: (sessionId) => liveModelBySession.get(sessionId),
|
|
10624
10661
|
sampleCacheTtlConfig: () => deps.sampleHistorianConfig?.() ?? deps.config,
|
|
10625
10662
|
contextUsageMap,
|
|
10626
10663
|
compactionHandler: deps.compactionHandler,
|
|
@@ -11823,7 +11860,7 @@ function disableNativeAutoCompaction(config) {
|
|
|
11823
11860
|
|
|
11824
11861
|
// src/plugin/refusal-notice.ts
|
|
11825
11862
|
async function sendOpenCodeRefusal(client, sessionId, message, refusal) {
|
|
11826
|
-
const { sendStatusNotification } = await importPluginModule(() => import("./send-session-notification-
|
|
11863
|
+
const { sendStatusNotification } = await importPluginModule(() => import("./send-session-notification-0779tyd9.js"));
|
|
11827
11864
|
const storageBusy = refusal instanceof StorageBusyRefusalError;
|
|
11828
11865
|
const toast = { toastDurationMs: 15000 };
|
|
11829
11866
|
const delivery = await sendStatusNotification(client, sessionId, message, storageBusy ? toast : { ...toast, toastTitle: "Magic Context", toastVariant: "error", liveOnly: true });
|
|
@@ -11831,7 +11868,7 @@ async function sendOpenCodeRefusal(client, sessionId, message, refusal) {
|
|
|
11831
11868
|
sessionLog2(sessionId, "refusal notice skipped: no terminal viewing the session", refusal.name);
|
|
11832
11869
|
}
|
|
11833
11870
|
if (storageBusy) {
|
|
11834
|
-
const { abortSessionFailClosed } = await importPluginModule(() => import("./transform-postprocess-phase-
|
|
11871
|
+
const { abortSessionFailClosed } = await importPluginModule(() => import("./transform-postprocess-phase-pmzdd3s2.js"));
|
|
11835
11872
|
await abortSessionFailClosed(client, sessionId);
|
|
11836
11873
|
}
|
|
11837
11874
|
}
|
|
@@ -12101,7 +12138,7 @@ async function setup(context) {
|
|
|
12101
12138
|
if (claimStorageBackupWarningCheck() && isMagicContextStorageOutsideEngram(storageDir)) {
|
|
12102
12139
|
log2(`[magic-context] Magic Context storage is at ${storageDir}, outside the folder Engram backs up (~/.local/share/cortexkit/magic-context). It is not included in CortexKit backups.`);
|
|
12103
12140
|
}
|
|
12104
|
-
const { registerContext } = await import("./context-
|
|
12141
|
+
const { registerContext } = await import("./context-e8qd2v00.js");
|
|
12105
12142
|
setHarness2("opencode2");
|
|
12106
12143
|
bindStaleBuildNotice({}, import.meta.url, "opencode2");
|
|
12107
12144
|
const duties = await registerContext(context);
|
|
@@ -12180,7 +12217,7 @@ var server = async (ctx) => {
|
|
|
12180
12217
|
if (hasBannerEntries)
|
|
12181
12218
|
setTimeout(async () => {
|
|
12182
12219
|
try {
|
|
12183
|
-
const { sendStatusNotification } = await importPluginModule(() => import("./send-session-notification-
|
|
12220
|
+
const { sendStatusNotification } = await importPluginModule(() => import("./send-session-notification-0779tyd9.js"));
|
|
12184
12221
|
const clientWithSessions = ctx.client;
|
|
12185
12222
|
const sessions = await Promise.resolve(clientWithSessions.session?.list?.()).catch(() => null);
|
|
12186
12223
|
const sessionList = Array.isArray(sessions) ? sessions : sessions?.data;
|
|
@@ -12198,7 +12235,7 @@ var server = async (ctx) => {
|
|
|
12198
12235
|
log2(`[magic-context] opencode_db_missing path=${openCodeDbResolution.path} source=${openCodeDbResolution.source}`);
|
|
12199
12236
|
setTimeout(async () => {
|
|
12200
12237
|
try {
|
|
12201
|
-
const { sendStatusNotification } = await importPluginModule(() => import("./send-session-notification-
|
|
12238
|
+
const { sendStatusNotification } = await importPluginModule(() => import("./send-session-notification-0779tyd9.js"));
|
|
12202
12239
|
const clientWithSessions = ctx.client;
|
|
12203
12240
|
const sessions = await Promise.resolve(clientWithSessions.session?.list?.()).catch(() => null);
|
|
12204
12241
|
const sessionList = Array.isArray(sessions) ? sessions : sessions?.data;
|
|
@@ -12471,12 +12508,12 @@ var server = async (ctx) => {
|
|
|
12471
12508
|
{
|
|
12472
12509
|
const fence = getSchemaFenceRejection();
|
|
12473
12510
|
if (fence) {
|
|
12474
|
-
importPluginModule(() => import("./conflict-warning-hook-
|
|
12511
|
+
importPluginModule(() => import("./conflict-warning-hook-exf96bpt.js")).then(({ sendSchemaFenceWarning }) => sendSchemaFenceWarning(ctx.client, ctx.directory, fence)).catch((error) => log2("[magic-context] schema-fence warning unavailable:", error));
|
|
12475
12512
|
}
|
|
12476
12513
|
}
|
|
12477
12514
|
const serverUrl = ctx.serverUrl;
|
|
12478
12515
|
const serverUrlStr = serverUrl instanceof URL ? serverUrl.toString().replace(/\/$/, "") : typeof serverUrl === "string" ? serverUrl.replace(/\/$/, "") : undefined;
|
|
12479
|
-
importPluginModule(() => import("./send-session-notification-
|
|
12516
|
+
importPluginModule(() => import("./send-session-notification-0779tyd9.js")).then(({ setNotificationServerUrl }) => {
|
|
12480
12517
|
setNotificationServerUrl(serverUrlStr);
|
|
12481
12518
|
}).catch((error) => log2("[magic-context] notification transport unavailable:", error));
|
|
12482
12519
|
if (conflictResult?.hasConflict) {
|
|
@@ -12499,7 +12536,7 @@ var server = async (ctx) => {
|
|
|
12499
12536
|
}) => {
|
|
12500
12537
|
if (!shouldShowAnnouncement())
|
|
12501
12538
|
return;
|
|
12502
|
-
return importPluginModule(() => import("./conflict-warning-hook-
|
|
12539
|
+
return importPluginModule(() => import("./conflict-warning-hook-exf96bpt.js")).then(({ sendStartupAnnouncement }) => sendStartupAnnouncement(ctx.client, ctx.directory, ANNOUNCEMENT_VERSION, ANNOUNCEMENT_FEATURES, ANNOUNCEMENT_FOOTER, markAnnouncementSeen));
|
|
12503
12540
|
}).catch(() => {});
|
|
12504
12541
|
}, 8000);
|
|
12505
12542
|
}
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
yieldIndexChunk2
|
|
5
5
|
} from "./index-gzy5w8ya.js";
|
|
6
6
|
import"./index-1zx87sdm.js";
|
|
7
|
-
import"./index-
|
|
7
|
+
import"./index-901exj0f.js";
|
|
8
8
|
import"./index-s7460efs.js";
|
|
9
9
|
import"./index-pavzsdc6.js";
|
|
10
10
|
import"./index-ywrz4wy2.js";
|
|
@@ -16,8 +16,8 @@ import"./index-96ztjvkn.js";
|
|
|
16
16
|
import"./index-1d042x6w.js";
|
|
17
17
|
import"./index-q7q6qp1f.js";
|
|
18
18
|
import"./index-58e3y90n.js";
|
|
19
|
-
import"./index-
|
|
20
|
-
import"./index-
|
|
19
|
+
import"./index-sp5pvs95.js";
|
|
20
|
+
import"./index-5y9w2ax7.js";
|
|
21
21
|
import {
|
|
22
22
|
MESSAGE_INDEX_MAX_FTS_BYTES,
|
|
23
23
|
messageIndexSkipKey,
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
markMessageIndexDirty,
|
|
26
26
|
getIndexableContent,
|
|
27
27
|
indexSingleMessage
|
|
28
|
-
} from "./index-
|
|
28
|
+
} from "./index-hre29c1a.js";
|
|
29
29
|
import"./index-s32f8y67.js";
|
|
30
30
|
import"./index-m0pwswv9.js";
|
|
31
31
|
|
package/dist/migration-worker.js
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
import"./index-fr0wbhdn.js";
|
|
11
11
|
import {
|
|
12
12
|
runMigrationsWithRetry
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-jba6ny4m.js";
|
|
14
14
|
import"./index-mg9s2rc3.js";
|
|
15
15
|
import"./index-58e3y90n.js";
|
|
16
16
|
import"./index-gqf8r04r.js";
|
|
@@ -20,7 +20,7 @@ import"./index-fb3zxn06.js";
|
|
|
20
20
|
import {
|
|
21
21
|
setSqlitePragmaConfig,
|
|
22
22
|
initializeDatabase
|
|
23
|
-
} from "./index-
|
|
23
|
+
} from "./index-6rk44cer.js";
|
|
24
24
|
import"./index-wh9fxds5.js";
|
|
25
25
|
import"./index-v0p37hm2.js";
|
|
26
26
|
import"./index-96ztjvkn.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-session-hooks.d.ts","sourceRoot":"","sources":["../../../src/plugin/hooks/create-session-hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAKnE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAGnF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AACrF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+CAA+C,CAAC;AAC1F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAChF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,YAAY,EAAE,wBAAwB;;;;;;;;;;;;;mBAcK,CAAC;aAE3E,CAAC;aAA2B,CAAC;eAA6B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;2BA+Gi7zC,CAAC;;;;eAA8iB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA3Gxi1C;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE;IACrC,GAAG,EAAE,aAAa,CAAC;IACnB,YAAY,EAAE,wBAAwB,CAAC;IACvC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC,wBAAwB,CAAC,CAAC;IAC9D,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;CAC/C;;;;;;;;;;;;;;;;qBAkG8uJ,CAAC;8BAAwC,CAAC;iBAA8C,CAAC;0BAAc,CAAC;uBAAiB,CAAC;;;;;;;;;;;;;qBAAhkG,CAAC;mBAA6B,CAAC;iBAA2B,CAAC;iBAA2B,CAAC;0BAAc,CAAC;uBAAiB,CAAC;;;iBAA2D,CAAC;;oBAA4D,CAAC;uBAAiC,CAAC;yBAAoC,CAAC;;;;;;
|
|
1
|
+
{"version":3,"file":"create-session-hooks.d.ts","sourceRoot":"","sources":["../../../src/plugin/hooks/create-session-hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAKnE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAGnF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AACrF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+CAA+C,CAAC;AAC1F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAChF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,YAAY,EAAE,wBAAwB;;;;;;;;;;;;;mBAcK,CAAC;aAE3E,CAAC;aAA2B,CAAC;eAA6B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;2BA+Gi7zC,CAAC;;;;eAA8iB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA3Gxi1C;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE;IACrC,GAAG,EAAE,aAAa,CAAC;IACnB,YAAY,EAAE,wBAAwB,CAAC;IACvC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC,wBAAwB,CAAC,CAAC;IAC9D,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;CAC/C;;;;;;;;;;;;;;;;qBAkG8uJ,CAAC;8BAAwC,CAAC;iBAA8C,CAAC;0BAAc,CAAC;uBAAiB,CAAC;;;;;;;;;;;;;qBAAhkG,CAAC;mBAA6B,CAAC;iBAA2B,CAAC;iBAA2B,CAAC;0BAAc,CAAC;uBAAiB,CAAC;;;iBAA2D,CAAC;;oBAA4D,CAAC;uBAAiC,CAAC;yBAAoC,CAAC;;;;;;0BAA+h8C,CAAC;;;;;;;;;;;;;;;;EAvDhogD;AAED,wBAAsB,uBAAuB,CAAC,IAAI,EAAE;IAChD,GAAG,EAAE,aAAa,CAAC;IACnB,YAAY,EAAE,wBAAwB,CAAC;IACvC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC,wBAAwB,CAAC,CAAC;IAC9D,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,oBAAoB,CAAC,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,IAAI,CAAC;CACjE;;;;;;;;;;;;;;;;qBA6C8uJ,CAAC;8BAAwC,CAAC;iBAA8C,CAAC;0BAAc,CAAC;uBAAiB,CAAC;;;;;;;;;;;;;qBAAhkG,CAAC;mBAA6B,CAAC;iBAA2B,CAAC;iBAA2B,CAAC;0BAAc,CAAC;uBAAiB,CAAC;;;iBAA2D,CAAC;;oBAA4D,CAAC;uBAAiC,CAAC;yBAAoC,CAAC;;;;;;0BAA+h8C,CAAC;;;;;;;;;;;;;;;;GADhogD"}
|
|
@@ -19,7 +19,7 @@ serveWorkerJobs(async (input, port) => {
|
|
|
19
19
|
await main();
|
|
20
20
|
async function main() {
|
|
21
21
|
if (input.v2ArchiveReader) {
|
|
22
|
-
const { serveV2ArchiveReads } = await import("./v2-archive-reader-
|
|
22
|
+
const { serveV2ArchiveReads } = await import("./v2-archive-reader-39ye0d3b.js");
|
|
23
23
|
await serveV2ArchiveReads(port, openConnections);
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
@@ -51,7 +51,7 @@ serveWorkerJobs(async (input, port) => {
|
|
|
51
51
|
await runMessageFtsRowidMapBackfill(db);
|
|
52
52
|
reply = { kind: "fts-rowid-backfill" };
|
|
53
53
|
} else if (input.searchArchive) {
|
|
54
|
-
const { renderSearchArchive } = await import("./search-archive-
|
|
54
|
+
const { renderSearchArchive } = await import("./search-archive-pz1jf655.js");
|
|
55
55
|
const { readRawSessionMessageIdOrdinalsForRangeFromDb } = await import("./read-session-raw-3sc9231y.js");
|
|
56
56
|
const archive = input.searchArchive;
|
|
57
57
|
let raw;
|
|
@@ -81,7 +81,7 @@ serveWorkerJobs(async (input, port) => {
|
|
|
81
81
|
const { setHarness } = await import("./harness-e4avh192.js");
|
|
82
82
|
setHarness(input.harness ?? "opencode");
|
|
83
83
|
const [{ indexMessageInShortChunks }, { configureContextDatabasePragmas }] = await Promise.all([
|
|
84
|
-
import("./message-index-bounded-
|
|
84
|
+
import("./message-index-bounded-f6fc00ze.js"),
|
|
85
85
|
import("./sqlite-context-pragmas-mv9jqwjh.js")
|
|
86
86
|
]);
|
|
87
87
|
configureContextDatabasePragmas(db);
|
|
@@ -95,7 +95,7 @@ serveWorkerJobs(async (input, port) => {
|
|
|
95
95
|
measurements: result.measurements
|
|
96
96
|
};
|
|
97
97
|
} else if (input.tagRatio !== undefined) {
|
|
98
|
-
const { scanTagOwnerSummary, scanTagOwnerDelta } = await import("./storage-tags-
|
|
98
|
+
const { scanTagOwnerSummary, scanTagOwnerDelta } = await import("./storage-tags-7raphcw6.js");
|
|
99
99
|
const delta = input.tagState ? scanTagOwnerDelta(db, input.sessionId, input.tagState) : null;
|
|
100
100
|
if (delta)
|
|
101
101
|
reply = { kind: "tag-delta", delta };
|
|
@@ -38,10 +38,10 @@ import {
|
|
|
38
38
|
readSessionChunk2,
|
|
39
39
|
getRawSessionMessageIdsThrough2,
|
|
40
40
|
readRawSessionSeedTail2
|
|
41
|
-
} from "./index-
|
|
42
|
-
import"./index-
|
|
41
|
+
} from "./index-5y9w2ax7.js";
|
|
42
|
+
import"./index-901exj0f.js";
|
|
43
43
|
import"./index-1zx87sdm.js";
|
|
44
|
-
import"./index-
|
|
44
|
+
import"./index-sp5pvs95.js";
|
|
45
45
|
import"./index-6nqz8hsz.js";
|
|
46
46
|
import"./index-mg9s2rc3.js";
|
|
47
47
|
import"./index-q7q6qp1f.js";
|