@cortexkit/opencode-magic-context 0.49.85 → 0.49.87
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 +13 -7
- package/dist/chunk-embedding-write-worker.js +4 -4
- package/dist/{compartment-chunk-embedding-ymc9mtwv.js → compartment-chunk-embedding-fey2bsyf.js} +3 -1
- package/dist/{conflict-warning-hook-a0wrnzch.js → conflict-warning-hook-kbq6ppjf.js} +2 -2
- package/dist/{context-bjfwzbts.js → context-gnk68pyy.js} +126 -46
- package/dist/{embedding-backfill-v6sw58m8.js → embedding-backfill-9khxv6a9.js} +4 -4
- package/dist/{embedding-cache-mgyr73ef.js → embedding-cache-zn4r1c31.js} +5 -1
- package/dist/features/magic-context/compartment-chunk-embedding.d.ts +1 -0
- package/dist/features/magic-context/compartment-chunk-embedding.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-executor.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/token-budget.d.ts +8 -3
- package/dist/features/magic-context/dreamer/token-budget.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-cache.d.ts +7 -0
- package/dist/features/magic-context/memory/embedding-cache.d.ts.map +1 -1
- package/dist/features/magic-context/memory/verification-paths.d.ts.map +1 -1
- package/dist/features/magic-context/search.d.ts +6 -0
- package/dist/features/magic-context/search.d.ts.map +1 -1
- package/dist/features/magic-context/tool-definition-tokens.d.ts +2 -0
- package/dist/features/magic-context/tool-definition-tokens.d.ts.map +1 -1
- package/dist/hooks/magic-context/auto-search-worker-client.d.ts.map +1 -1
- package/dist/hooks/magic-context/auto-search-worker-probe.fixture.d.ts +2 -0
- package/dist/hooks/magic-context/auto-search-worker-probe.fixture.d.ts.map +1 -0
- package/dist/hooks/magic-context/dropped-input-guard.d.ts.map +1 -1
- package/dist/hooks/magic-context/emergency-fail-closed.d.ts +2 -0
- package/dist/hooks/magic-context/emergency-fail-closed.d.ts.map +1 -1
- package/dist/hooks/magic-context/send-session-notification.d.ts +11 -1
- package/dist/hooks/magic-context/send-session-notification.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform.d.ts +1 -0
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/{index-7j2zv9nm.js → index-2qsca7h7.js} +47 -11
- package/dist/{index-9fsxmjs6.js → index-3jgzd7nz.js} +7 -7
- package/dist/{index-snbpdpa3.js → index-3pdknr07.js} +4 -4
- package/dist/{index-k0tb2z28.js → index-3x4qvp29.js} +2 -2
- package/dist/{index-0rge5rkh.js → index-5nmqgvz2.js} +21 -14
- package/dist/{index-xrnhxkz7.js → index-60wnwcwz.js} +1 -1
- package/dist/{index-g6hfh4h4.js → index-6zewd2n5.js} +14 -8
- package/dist/{index-nny4gm06.js → index-74sh122g.js} +2 -2
- package/dist/{index-70cv85b0.js → index-78t37mcq.js} +2 -2
- package/dist/{index-stx8zd81.js → index-83qd3n7s.js} +2 -2
- package/dist/{index-jjvbk92s.js → index-9emdjcb5.js} +1 -1
- package/dist/{index-sbr58jaf.js → index-awyqqnd8.js} +585 -82
- package/dist/{index-qvn3q9f1.js → index-b364vr04.js} +109 -505
- package/dist/{index-4w5rx7de.js → index-bxrfq3mv.js} +1 -1
- package/dist/{index-pw279hmt.js → index-c1s40xmj.js} +6 -5
- package/dist/{index-05bm2ndp.js → index-chpzb6xy.js} +1 -1
- package/dist/{index-tzbcb8yt.js → index-csztadkj.js} +46 -17
- package/dist/{index-798s7c8s.js → index-hdyfvdag.js} +1 -1
- package/dist/{index-4ntnt8ee.js → index-jka4y6mv.js} +1 -1
- package/dist/{index-w6v4dw5f.js → index-kmrv1fw3.js} +4 -4
- package/dist/{index-jrj95cce.js → index-m6dnydf8.js} +9 -2
- package/dist/{index-kqnef2tg.js → index-pmcvg3k1.js} +4 -4
- package/dist/{v2/server-4dhv7mqz.js → index-qjwpqvnf.js} +48 -1
- package/dist/{index-xccywqdj.js → index-rvf1726x.js} +3 -3
- package/dist/{index-1pf5qrx4.js → index-vyfrgwhk.js} +3 -3
- package/dist/{index-s8ks5nz4.js → index-watde7a1.js} +2 -2
- package/dist/{v2/server-fzgyvsb1.js → index-y14pawe1.js} +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +61 -52
- package/dist/{message-index-bounded-6fr624zf.js → message-index-bounded-r1qys471.js} +4 -4
- package/dist/migration-worker.js +3 -3
- package/dist/plugin/messages-transform.d.ts +3 -4
- package/dist/plugin/messages-transform.d.ts.map +1 -1
- package/dist/plugin/refusal-notice.d.ts +3 -0
- package/dist/plugin/refusal-notice.d.ts.map +1 -0
- package/dist/{project-embedding-registry-q80scexh.js → project-embedding-registry-8t0gwf59.js} +3 -3
- package/dist/raw-ordinal-warmup-worker.js +4 -4
- package/dist/{read-session-chunk-6wedfths.js → read-session-chunk-xv9f0wgb.js} +3 -3
- package/dist/{recomp-orchestrator-xzs0a455.js → recomp-orchestrator-2ztmtxt2.js} +18 -18
- package/dist/{render-yqp7q79f.js → render-d6q6h9hy.js} +10 -10
- package/dist/{rpc-notifications-t9q0ynq7.js → rpc-notifications-ta2zsxpq.js} +1 -1
- package/dist/{search-archive-r4h96j2z.js → search-archive-g96jn6p0.js} +5 -5
- package/dist/{search-ztgy3ya6.js → search-d5aajhs3.js} +14 -14
- package/dist/{send-session-notification-7x518gew.js → send-session-notification-gzxz88vq.js} +1 -1
- package/dist/shared/assistant-message-extractor.d.ts +2 -0
- package/dist/shared/assistant-message-extractor.d.ts.map +1 -1
- package/dist/shared/prompt-async-transport.d.ts.map +1 -1
- package/dist/shared/rpc-notifications.d.ts +1 -1
- package/dist/shared/rpc-notifications.d.ts.map +1 -1
- package/dist/{storage-memory-e6a7mb0k.js → storage-memory-hhrvfw0x.js} +2 -2
- package/dist/{storage-tags-y2mrb8e6.js → storage-tags-f1ftvjpw.js} +2 -2
- package/dist/{transform-postprocess-phase-39a5hm2a.js → transform-postprocess-phase-b2yjw8by.js} +19 -19
- package/dist/v2/auto-search-worker.js +13 -7
- package/dist/v2/chunk-embedding-write-worker.js +4 -4
- package/dist/v2/{compartment-chunk-embedding-x6qw6mjk.js → compartment-chunk-embedding-knt2468v.js} +3 -1
- package/dist/v2/{context-k2rrqzf4.js → context-s86114yy.js} +219 -62
- package/dist/v2/{embedding-backfill-k8kqnwfq.js → embedding-backfill-tazkbpyg.js} +4 -4
- package/dist/v2/{embedding-cache-mgyr73ef.js → embedding-cache-zn4r1c31.js} +5 -1
- package/dist/v2/fold/native-replay.d.ts +3 -1
- package/dist/v2/fold/native-replay.d.ts.map +1 -1
- package/dist/v2/hidden-child-record.d.ts +1 -0
- package/dist/v2/hidden-child-record.d.ts.map +1 -1
- package/dist/v2/hidden-completion.d.ts.map +1 -1
- package/dist/v2/hooks/context.d.ts.map +1 -1
- package/dist/v2/{message-index-bounded-jqy7283g.js → message-index-bounded-b07r9cjv.js} +4 -4
- package/dist/v2/migration-worker.js +3 -3
- package/dist/v2/{project-embedding-registry-2jp1antr.js → project-embedding-registry-ah3gsg48.js} +3 -3
- package/dist/v2/raw-ordinal-warmup-worker.js +4 -4
- package/dist/v2/{read-session-chunk-n3nhfvd7.js → read-session-chunk-38wdy8nd.js} +3 -3
- package/dist/v2/{recomp-orchestrator-jnbxbsc8.js → recomp-orchestrator-kc62xgb9.js} +17 -17
- package/dist/v2/{render-fezgh7pa.js → render-j05per51.js} +10 -10
- package/dist/v2/{rpc-notifications-t9q0ynq7.js → rpc-notifications-ta2zsxpq.js} +1 -1
- package/dist/v2/{search-archive-zz1kza50.js → search-archive-b4ptw02k.js} +5 -5
- package/dist/v2/{search-h5w7510x.js → search-kg31ad2s.js} +13 -13
- package/dist/v2/{send-session-notification-p52rhjzy.js → send-session-notification-zazaxxpf.js} +1 -1
- package/dist/v2/{server-ps6rz88g.js → server-2p0qayr1.js} +1 -1
- package/dist/v2/{server-s76ty4ws.js → server-2r9btf0g.js} +46 -17
- package/dist/v2/{server-wdq85mxj.js → server-6250cxzs.js} +14 -8
- package/dist/v2/{server-brgandk4.js → server-6vnbz81n.js} +2 -2
- package/dist/v2/{server-jjvbk92s.js → server-9emdjcb5.js} +1 -1
- package/dist/v2/{server-ap81bk3c.js → server-9n2qgk29.js} +1 -1
- package/dist/v2/{server-mbkwcwgw.js → server-axdmkvd5.js} +2 -2
- package/dist/v2/{server-2k8tkbhz.js → server-c7awk5s2.js} +10 -4
- package/dist/v2/{server-4wwwm2ya.js → server-ct0gs8fc.js} +4 -4
- package/dist/v2/{server-97w51d8n.js → server-ff5wcfy4.js} +3 -3
- package/dist/v2/{server-x77hd658.js → server-gqrw0br5.js} +20 -13
- package/dist/v2/{server-98hsp35q.js → server-gwhj0362.js} +6 -5
- package/dist/v2/{server-w7mpvkpj.js → server-pbp58w5x.js} +1 -1
- package/dist/v2/{server-s15knz0w.js → server-pmws7we9.js} +1 -1
- package/dist/{index-4dhv7mqz.js → v2/server-qjwpqvnf.js} +48 -1
- package/dist/v2/{server-a2f1bhyj.js → server-stjy5dxv.js} +9 -2
- package/dist/v2/{server-hn8b7sfe.js → server-xn7zqs4j.js} +2 -2
- package/dist/{index-fzgyvsb1.js → v2/server-y14pawe1.js} +3 -0
- package/dist/v2/{server-8pdfmc27.js → server-y17r5ryz.js} +4 -4
- package/dist/v2/{server-n5zr7190.js → server-yh2z4gg2.js} +3 -3
- package/dist/v2/{server-sxfbjdye.js → server-yx0nyj1q.js} +2 -2
- package/dist/v2/server.js +3 -3
- package/dist/v2/{storage-memory-e6a7mb0k.js → storage-memory-hhrvfw0x.js} +2 -2
- package/dist/v2/{storage-tags-xq81zgt2.js → storage-tags-pmw33chf.js} +2 -2
- package/dist/v2/{v2-archive-reader-e2w39c3p.js → v2-archive-reader-2ayz16s4.js} +1 -1
- package/dist/v2/{wrapup-orchestrator-mmje3etf.js → wrapup-orchestrator-e20sjbdz.js} +17 -17
- package/dist/{v2-archive-reader-8dsngf2j.js → v2-archive-reader-x39mzvwn.js} +1 -1
- package/dist/{wrapup-orchestrator-sm6pwf3p.js → wrapup-orchestrator-h3s905vs.js} +19 -19
- package/package.json +1 -1
- package/src/shared/assistant-message-extractor.test.ts +22 -0
- package/src/shared/assistant-message-extractor.ts +13 -0
- package/src/shared/model-suggestion-retry.test.ts +43 -12
- package/src/shared/prompt-async-transport.test.ts +275 -8
- package/src/shared/prompt-async-transport.ts +41 -2
- package/src/shared/reusable-worker.fixture.ts +15 -3
- package/src/shared/reusable-worker.test.ts +20 -10
- package/src/shared/rpc-notifications.ts +4 -1
- package/src/shared/sqlite-foreground-wait.test.ts +2 -2
- package/src/shared/startup-maintenance-policy.test.ts +4 -2
- package/src/tui/compaction-off.ts +2 -2
- package/src/tui/slots/sidebar-content-render.test.ts +309 -0
- package/src/tui/slots/sidebar-content.tsx +134 -99
- package/src/tui-compiled/compaction-off.ts +2 -2
- package/src/tui-compiled/slots/sidebar-content.tsx +321 -247
|
@@ -125,6 +125,7 @@ import {
|
|
|
125
125
|
providerOutputFailureFromInvalidManifest,
|
|
126
126
|
extractLatestAssistantText,
|
|
127
127
|
hasLengthCappedOutput,
|
|
128
|
+
isLatestAssistantLengthCapped,
|
|
128
129
|
parseProviderModel,
|
|
129
130
|
modelBodyField,
|
|
130
131
|
toModelEntry,
|
|
@@ -212,12 +213,9 @@ import {
|
|
|
212
213
|
snapRangeToCompartments,
|
|
213
214
|
getActiveCompartmentRun,
|
|
214
215
|
startCompartmentAgent
|
|
215
|
-
} from "./index-
|
|
216
|
+
} from "./index-csztadkj.js";
|
|
216
217
|
import {
|
|
217
|
-
hasTrustedAbsoluteWall,
|
|
218
|
-
applyProvenInputFloor,
|
|
219
218
|
formatWindowDerivationLine,
|
|
220
|
-
isSaneLimit,
|
|
221
219
|
getSdkWindowGeometry,
|
|
222
220
|
getSdkContextLimit,
|
|
223
221
|
getSdkOutputLimit,
|
|
@@ -371,13 +369,14 @@ import {
|
|
|
371
369
|
getTagsByNumbers2,
|
|
372
370
|
getDroppedTagsByNumbers2,
|
|
373
371
|
getMaxDroppedTagNumber2
|
|
374
|
-
} from "./index-
|
|
372
|
+
} from "./index-60wnwcwz.js";
|
|
375
373
|
import {
|
|
376
374
|
BoundedSessionMap,
|
|
377
375
|
observeTemporalDecisions,
|
|
378
376
|
stableStringify,
|
|
379
|
-
getMeasuredToolDefinitionTokens
|
|
380
|
-
|
|
377
|
+
getMeasuredToolDefinitionTokens,
|
|
378
|
+
getExactSessionToolDefinitionTokens
|
|
379
|
+
} from "./index-m6dnydf8.js";
|
|
381
380
|
import {
|
|
382
381
|
withContentLanguageDirective,
|
|
383
382
|
string,
|
|
@@ -443,8 +442,9 @@ import {
|
|
|
443
442
|
readRawSessionMessageById2,
|
|
444
443
|
readSessionChunk2,
|
|
445
444
|
readRawSessionSeedTail2
|
|
446
|
-
} from "./index-
|
|
445
|
+
} from "./index-2qsca7h7.js";
|
|
447
446
|
import {
|
|
447
|
+
formatFailClosedBlockingSummary,
|
|
448
448
|
isFailClosedBlockingError,
|
|
449
449
|
shouldBypassFailClosedBlock,
|
|
450
450
|
resolveAgentNameFromMessages
|
|
@@ -462,7 +462,7 @@ import {
|
|
|
462
462
|
runSqliteOptimize,
|
|
463
463
|
openDatabase,
|
|
464
464
|
openCurrentDatabase
|
|
465
|
-
} from "./index-
|
|
465
|
+
} from "./index-rvf1726x.js";
|
|
466
466
|
import {
|
|
467
467
|
unescapeXml,
|
|
468
468
|
resolveWorkspaceShareCategories,
|
|
@@ -471,7 +471,7 @@ import {
|
|
|
471
471
|
resolveStoredPathWorkspaceIdentity,
|
|
472
472
|
storedPathBelongsToWorkspace,
|
|
473
473
|
computeWorkspaceEpochFingerprint
|
|
474
|
-
} from "./index-
|
|
474
|
+
} from "./index-bxrfq3mv.js";
|
|
475
475
|
import {
|
|
476
476
|
V2_MEMORY_CATEGORIES,
|
|
477
477
|
CATEGORY_PRIORITY
|
|
@@ -498,7 +498,6 @@ import {
|
|
|
498
498
|
getCompartments,
|
|
499
499
|
getLastCompartmentEndMessage,
|
|
500
500
|
getLastCompartmentEndMessageId,
|
|
501
|
-
providerResponseFailed,
|
|
502
501
|
LkgRecoveryFenceError,
|
|
503
502
|
lkgServedArrayDigest,
|
|
504
503
|
hasCleanLkgRecoveryFence,
|
|
@@ -578,10 +577,10 @@ import {
|
|
|
578
577
|
GLOBAL_USER_PROFILE_PROJECT_PATH,
|
|
579
578
|
getProjectState,
|
|
580
579
|
bumpProjectUserProfileVersion
|
|
581
|
-
} from "./index-
|
|
580
|
+
} from "./index-kmrv1fw3.js";
|
|
582
581
|
import {
|
|
583
582
|
getLastIndexedOrdinal
|
|
584
|
-
} from "./index-
|
|
583
|
+
} from "./index-chpzb6xy.js";
|
|
585
584
|
import {
|
|
586
585
|
SESSION_NOTE_CONDITION_ERROR,
|
|
587
586
|
getNoteByIdInScope,
|
|
@@ -607,14 +606,14 @@ import {
|
|
|
607
606
|
createPrimer,
|
|
608
607
|
updatePrimerSupport,
|
|
609
608
|
updatePrimerAnswer
|
|
610
|
-
} from "./index-
|
|
609
|
+
} from "./index-jka4y6mv.js";
|
|
611
610
|
import {
|
|
612
611
|
registerNotificationSink2,
|
|
613
612
|
pushNotification2,
|
|
614
613
|
acknowledgeNotifications2,
|
|
615
614
|
drainNotifications2,
|
|
616
615
|
isTuiConnected2
|
|
617
|
-
} from "./index-
|
|
616
|
+
} from "./index-y14pawe1.js";
|
|
618
617
|
import {
|
|
619
618
|
getCachedLocalEmbeddingPooling,
|
|
620
619
|
preflightLocalEmbeddingPooling,
|
|
@@ -640,12 +639,12 @@ import {
|
|
|
640
639
|
embedSessionCompartmentChunks2,
|
|
641
640
|
getEmbeddingCoverageStatus2,
|
|
642
641
|
getAutoEmbeddingSessionCoverage2
|
|
643
|
-
} from "./index-
|
|
642
|
+
} from "./index-watde7a1.js";
|
|
644
643
|
import {
|
|
645
644
|
saveEmbeddingIfHashMatches,
|
|
646
645
|
invalidateProject2,
|
|
647
646
|
invalidateMemory2
|
|
648
|
-
} from "./index-
|
|
647
|
+
} from "./index-qjwpqvnf.js";
|
|
649
648
|
import {
|
|
650
649
|
renderUserFacingFailure,
|
|
651
650
|
userFacingFailureCode,
|
|
@@ -666,7 +665,7 @@ import {
|
|
|
666
665
|
readGitFileChangeTimesSince,
|
|
667
666
|
verificationFileExists,
|
|
668
667
|
normalizeVerificationFiles
|
|
669
|
-
} from "./index-
|
|
668
|
+
} from "./index-c1s40xmj.js";
|
|
670
669
|
import {
|
|
671
670
|
computeCueContentHash,
|
|
672
671
|
hasMuralCueColumns,
|
|
@@ -693,7 +692,7 @@ import {
|
|
|
693
692
|
archiveMemory2,
|
|
694
693
|
getMemoryCount2,
|
|
695
694
|
getMemoryCountsByStatus2
|
|
696
|
-
} from "./index-
|
|
695
|
+
} from "./index-9emdjcb5.js";
|
|
697
696
|
import {
|
|
698
697
|
renderSingleStoreMigrationRequiredRefusal,
|
|
699
698
|
SingleStoreMigrationRequiredError,
|
|
@@ -714,24 +713,27 @@ import {
|
|
|
714
713
|
resolveMemoriesByIdsForSearch2,
|
|
715
714
|
unifiedSearch2,
|
|
716
715
|
formatSearchResults2
|
|
717
|
-
} from "./index-
|
|
716
|
+
} from "./index-5nmqgvz2.js";
|
|
718
717
|
import {
|
|
719
718
|
scheduleReconciliation,
|
|
720
719
|
scheduleIncrementalIndex,
|
|
721
720
|
getMessageIndexQueueHeapStats,
|
|
722
721
|
clearSessionTracking
|
|
723
|
-
} from "./index-
|
|
724
|
-
import {
|
|
725
|
-
flushIgnoredMessages2,
|
|
726
|
-
clearIgnoredMessages2,
|
|
727
|
-
observeIgnoredNotificationEvent2,
|
|
728
|
-
sendStatusNotification2
|
|
729
|
-
} from "./index-g6hfh4h4.js";
|
|
730
|
-
import {
|
|
731
|
-
setRecompStarting2,
|
|
732
|
-
setRecompTerminal2
|
|
733
|
-
} from "./index-kqnef2tg.js";
|
|
722
|
+
} from "./index-hdyfvdag.js";
|
|
734
723
|
import {
|
|
724
|
+
resolveModelCacheTtl,
|
|
725
|
+
resolveContextWindowGeometry,
|
|
726
|
+
resolveContextLimit,
|
|
727
|
+
resolveTrustedContextLimit,
|
|
728
|
+
WRAPUP_WINDOW_UNAVAILABLE,
|
|
729
|
+
resolveOpenCodeWrapupWindow,
|
|
730
|
+
resolveExecuteThresholdDetail,
|
|
731
|
+
resolveExecuteThreshold,
|
|
732
|
+
resolveModelKey,
|
|
733
|
+
resolveSessionId,
|
|
734
|
+
historyBudgetPolicyIdentity,
|
|
735
|
+
parseCacheTtl,
|
|
736
|
+
computeHardCacheExpired,
|
|
735
737
|
makeToolCompositeKey,
|
|
736
738
|
searchMessageHistoryOffThread,
|
|
737
739
|
findSessionId,
|
|
@@ -782,6 +784,7 @@ import {
|
|
|
782
784
|
isHostInstructionRetentionOn,
|
|
783
785
|
recordHostInstructionDecisions,
|
|
784
786
|
replayCavemanCompression,
|
|
787
|
+
describeDegradedPassFailure,
|
|
785
788
|
DegradedPassRefusalError,
|
|
786
789
|
degradedPassError,
|
|
787
790
|
revertHostCheckpointPass,
|
|
@@ -815,7 +818,17 @@ import {
|
|
|
815
818
|
abortSessionFailClosed2,
|
|
816
819
|
evaluateEmergencyFailClosed2,
|
|
817
820
|
runPostTransformPhase2
|
|
818
|
-
} from "./index-
|
|
821
|
+
} from "./index-awyqqnd8.js";
|
|
822
|
+
import {
|
|
823
|
+
flushIgnoredMessages2,
|
|
824
|
+
clearIgnoredMessages2,
|
|
825
|
+
observeIgnoredNotificationEvent2,
|
|
826
|
+
sendStatusNotification2
|
|
827
|
+
} from "./index-6zewd2n5.js";
|
|
828
|
+
import {
|
|
829
|
+
setRecompStarting2,
|
|
830
|
+
setRecompTerminal2
|
|
831
|
+
} from "./index-pmcvg3k1.js";
|
|
819
832
|
import {
|
|
820
833
|
ANNOUNCEMENT_VERSION2,
|
|
821
834
|
ANNOUNCEMENT_FEATURES2,
|
|
@@ -830,13 +843,13 @@ import {
|
|
|
830
843
|
renderMessageByOrdinal2,
|
|
831
844
|
renderVerboseRangeForTool2,
|
|
832
845
|
renderItemByTag2
|
|
833
|
-
} from "./index-
|
|
846
|
+
} from "./index-78t37mcq.js";
|
|
834
847
|
import {
|
|
835
848
|
readV2ArchiveOffThread2
|
|
836
|
-
} from "./index-
|
|
849
|
+
} from "./index-vyfrgwhk.js";
|
|
837
850
|
import {
|
|
838
851
|
renderSearchArchiveOffThread2
|
|
839
|
-
} from "./index-
|
|
852
|
+
} from "./index-74sh122g.js";
|
|
840
853
|
import {
|
|
841
854
|
COMPACTION_ENABLED_PATH,
|
|
842
855
|
isDreamerRunnable,
|
|
@@ -854,8 +867,7 @@ import {
|
|
|
854
867
|
} from "./index-2bvekkfy.js";
|
|
855
868
|
import {
|
|
856
869
|
canonicalModelIdentity,
|
|
857
|
-
piModelRefToCanonical
|
|
858
|
-
modelRefLookupOrder
|
|
870
|
+
piModelRefToCanonical
|
|
859
871
|
} from "./index-avwt563y.js";
|
|
860
872
|
import {
|
|
861
873
|
getErrorMessage,
|
|
@@ -11047,7 +11059,11 @@ async function runRetrospectiveTask(config, ctx, helpers) {
|
|
|
11047
11059
|
});
|
|
11048
11060
|
},
|
|
11049
11061
|
validateOutput: (outputMessages) => {
|
|
11050
|
-
const
|
|
11062
|
+
const completion = hiddenHandle ? outputMessages : null;
|
|
11063
|
+
if (completion ? completion.lengthCapped : isLatestAssistantLengthCapped(outputMessages)) {
|
|
11064
|
+
throw new Error("Retrospective child returned length-capped output");
|
|
11065
|
+
}
|
|
11066
|
+
const text = completion ? completion.text : extractLatestAssistantText(outputMessages);
|
|
11051
11067
|
if (!text)
|
|
11052
11068
|
throw new Error("Retrospective child returned no output.");
|
|
11053
11069
|
return text;
|
|
@@ -12690,450 +12706,6 @@ async function ensureProjectRegisteredFromOpenCodeDirectory(directory, db, optio
|
|
|
12690
12706
|
options.onRegistered?.(projectIdentity);
|
|
12691
12707
|
}
|
|
12692
12708
|
|
|
12693
|
-
// src/shared/model-cache-ttl.ts
|
|
12694
|
-
var MODEL_CACHE_LIFETIMES = [
|
|
12695
|
-
{
|
|
12696
|
-
source: "OpenAI GPT-5.6+ default",
|
|
12697
|
-
value: "30m",
|
|
12698
|
-
matches(model) {
|
|
12699
|
-
const version = /^gpt-(\d+)(?:\.(\d+))?(?:$|[^\d.])/.exec(model);
|
|
12700
|
-
if (!version)
|
|
12701
|
-
return false;
|
|
12702
|
-
const major = Number(version[1]);
|
|
12703
|
-
const minor = Number(version[2] ?? 0);
|
|
12704
|
-
return major > 5 || major === 5 && minor >= 6;
|
|
12705
|
-
}
|
|
12706
|
-
}
|
|
12707
|
-
];
|
|
12708
|
-
function resolveModelCacheTtl(config, modelKey, configuredExplicitly = typeof config === "object" || typeof config === "string" && config !== "5m") {
|
|
12709
|
-
if (config && typeof config !== "string") {
|
|
12710
|
-
const match = modelKey && !modelKey.includes("/") && Object.hasOwn(config, modelKey) && modelKey !== "default" ? config[modelKey] : resolveModelConfigValue(config, modelKey)?.value;
|
|
12711
|
-
const value = match ?? config.default;
|
|
12712
|
-
if (value !== undefined && configuredExplicitly)
|
|
12713
|
-
return { value, source: "config", modelKey };
|
|
12714
|
-
}
|
|
12715
|
-
if (typeof config === "string" && configuredExplicitly)
|
|
12716
|
-
return { value: config, source: "config", modelKey };
|
|
12717
|
-
const model = canonicalModelIdentity(modelKey ?? "").toLowerCase().split("/").at(-1) ?? "";
|
|
12718
|
-
const known = MODEL_CACHE_LIFETIMES.find((entry) => entry.matches(model));
|
|
12719
|
-
if (known)
|
|
12720
|
-
return { value: known.value, source: known.source, modelKey };
|
|
12721
|
-
return {
|
|
12722
|
-
value: (typeof config === "object" ? config.default : config) ?? "5m",
|
|
12723
|
-
source: "default",
|
|
12724
|
-
modelKey
|
|
12725
|
-
};
|
|
12726
|
-
}
|
|
12727
|
-
|
|
12728
|
-
// src/hooks/magic-context/opencode-proven-floor.ts
|
|
12729
|
-
var KEY = "opencodeProvenInputFloor";
|
|
12730
|
-
function recordOpenCodeProvenInputFloor(db, sessionId, modelKey, tokens) {
|
|
12731
|
-
db.prepare(`UPDATE session_meta SET deferred_execute_state = json_set(
|
|
12732
|
-
CASE WHEN json_valid(deferred_execute_state) AND json_type(deferred_execute_state) = 'object'
|
|
12733
|
-
THEN deferred_execute_state ELSE '{}' END, '$.${KEY}', json(?)) WHERE session_id = ?`).run(JSON.stringify({ modelKey, tokens, basis: "provider_usage_v1" }), sessionId);
|
|
12734
|
-
}
|
|
12735
|
-
function largestAcceptedInput(sessionId, modelKey) {
|
|
12736
|
-
return withReadOnlySessionDb((db) => {
|
|
12737
|
-
const rows = db.prepare(`SELECT
|
|
12738
|
-
COALESCE(json_extract(data, '$.providerID'), json_extract(data, '$.model.providerID')) AS provider,
|
|
12739
|
-
COALESCE(json_extract(data, '$.modelID'), json_extract(data, '$.model.id')) AS model,
|
|
12740
|
-
json_extract(data, '$.finish') AS finish, json_extract(data, '$.error') AS error,
|
|
12741
|
-
json_extract(data, '$.tokens.input') AS input,
|
|
12742
|
-
json_extract(data, '$.tokens.cache.read') AS cacheRead,
|
|
12743
|
-
json_extract(data, '$.tokens.cache.write') AS cacheWrite
|
|
12744
|
-
FROM message WHERE session_id = ? AND json_valid(data)
|
|
12745
|
-
AND json_extract(data, '$.role') = 'assistant'`).all(sessionId);
|
|
12746
|
-
let largest = 0;
|
|
12747
|
-
for (const row of rows) {
|
|
12748
|
-
if (!row.provider || !row.model || piModelRefToCanonical(`${row.provider}/${row.model}`) !== piModelRefToCanonical(modelKey) || providerResponseFailed(row))
|
|
12749
|
-
continue;
|
|
12750
|
-
const components = [row.input ?? 0, row.cacheRead ?? 0, row.cacheWrite ?? 0];
|
|
12751
|
-
if (components.every((n) => typeof n === "number" && Number.isFinite(n) && n >= 0)) {
|
|
12752
|
-
largest = Math.max(largest, components.reduce((sum, n) => sum + n, 0));
|
|
12753
|
-
}
|
|
12754
|
-
}
|
|
12755
|
-
return largest;
|
|
12756
|
-
});
|
|
12757
|
-
}
|
|
12758
|
-
function resolveOpenCodeProvenInputFloor(db, sessionId, modelKey) {
|
|
12759
|
-
const row = db.prepare("SELECT observed_safe_input_tokens, last_observed_model_key, deferred_execute_state FROM session_meta WHERE session_id = ?").get(sessionId);
|
|
12760
|
-
const stored = row?.observed_safe_input_tokens ?? 0;
|
|
12761
|
-
if (!modelKey || piModelRefToCanonical(row?.last_observed_model_key ?? "") !== piModelRefToCanonical(modelKey) || !Number.isFinite(stored) || stored <= 0)
|
|
12762
|
-
return 0;
|
|
12763
|
-
try {
|
|
12764
|
-
const record = JSON.parse(row?.deferred_execute_state ?? "{}")[KEY];
|
|
12765
|
-
if (record?.basis === "provider_usage_v1" && record.modelKey === modelKey && record.tokens === stored)
|
|
12766
|
-
return stored;
|
|
12767
|
-
} catch {}
|
|
12768
|
-
let measured = 0;
|
|
12769
|
-
try {
|
|
12770
|
-
measured = largestAcceptedInput(sessionId, modelKey);
|
|
12771
|
-
} catch {}
|
|
12772
|
-
const repaired = Math.min(stored, measured);
|
|
12773
|
-
updateSessionMeta(db, sessionId, {
|
|
12774
|
-
observedSafeInputTokens: repaired,
|
|
12775
|
-
cacheAlertSent: false,
|
|
12776
|
-
lastUsageContextLimit: 0
|
|
12777
|
-
});
|
|
12778
|
-
recordOpenCodeProvenInputFloor(db, sessionId, modelKey, repaired);
|
|
12779
|
-
sessionLog2(sessionId, `legacy proven input floor ${stored} clamped to accepted provider usage: ${repaired}`);
|
|
12780
|
-
return repaired;
|
|
12781
|
-
}
|
|
12782
|
-
|
|
12783
|
-
// src/hooks/magic-context/event-resolvers.ts
|
|
12784
|
-
var DEFAULT_CONTEXT_LIMIT = 200000;
|
|
12785
|
-
function modelMatchedPersistedUsage(db, sessionID, modelKey) {
|
|
12786
|
-
if (!db || !sessionID || !modelKey)
|
|
12787
|
-
return;
|
|
12788
|
-
try {
|
|
12789
|
-
resolveOpenCodeProvenInputFloor(db, sessionID, modelKey);
|
|
12790
|
-
const persisted = loadPersistedUsage(db, sessionID);
|
|
12791
|
-
if (persisted !== null && piModelRefToCanonical(persisted.lastObservedModelKey ?? "") === piModelRefToCanonical(modelKey)) {
|
|
12792
|
-
return persisted;
|
|
12793
|
-
}
|
|
12794
|
-
} catch {}
|
|
12795
|
-
return;
|
|
12796
|
-
}
|
|
12797
|
-
function modelMatchedProvenContextLimit(db, sessionID, modelKey) {
|
|
12798
|
-
if (!db || !sessionID || !modelKey)
|
|
12799
|
-
return;
|
|
12800
|
-
try {
|
|
12801
|
-
const provenLimit = resolveOpenCodeProvenInputFloor(db, sessionID, modelKey);
|
|
12802
|
-
return isSaneLimit(provenLimit) ? provenLimit : undefined;
|
|
12803
|
-
} catch {
|
|
12804
|
-
return;
|
|
12805
|
-
}
|
|
12806
|
-
}
|
|
12807
|
-
function applySessionProvenFloor(geometry, provenLimit, ctx) {
|
|
12808
|
-
const result = applyProvenInputFloor(geometry, provenLimit);
|
|
12809
|
-
if (result.refused && ctx?.db && ctx.sessionID) {
|
|
12810
|
-
const persisted = loadPersistedUsage(ctx.db, ctx.sessionID);
|
|
12811
|
-
const impossiblePressure = persisted?.usage.inputTokens ? persisted.usage.inputTokens > result.refused.absoluteWall : false;
|
|
12812
|
-
updateSessionMeta(ctx.db, ctx.sessionID, {
|
|
12813
|
-
observedSafeInputTokens: 0,
|
|
12814
|
-
cacheAlertSent: false,
|
|
12815
|
-
lastUsageContextLimit: geometry.usableSoft,
|
|
12816
|
-
lastInputTokens: impossiblePressure ? 0 : persisted?.usage.inputTokens,
|
|
12817
|
-
lastContextPercentage: impossiblePressure ? 0 : persisted?.usage.percentage
|
|
12818
|
-
});
|
|
12819
|
-
sessionLog2(ctx.sessionID, `persisted proven floor ${result.refused.reading} exceeds trusted absolute wall ${result.refused.absoluteWall}; cleared and re-resolved to ${geometry.usableSoft}`);
|
|
12820
|
-
}
|
|
12821
|
-
return result.geometry;
|
|
12822
|
-
}
|
|
12823
|
-
function resolveContextWindowGeometry(providerID, modelID, ctx) {
|
|
12824
|
-
if (!providerID || !modelID)
|
|
12825
|
-
return;
|
|
12826
|
-
const modelKey = resolveModelKey(providerID, modelID);
|
|
12827
|
-
let detected;
|
|
12828
|
-
let detectedLimitProvenance = "unknown";
|
|
12829
|
-
if (ctx?.db && ctx.sessionID) {
|
|
12830
|
-
try {
|
|
12831
|
-
const overflow = getOverflowState(ctx.db, ctx.sessionID, modelKey);
|
|
12832
|
-
if (overflow.detectedContextLimit > 0) {
|
|
12833
|
-
detected = overflow.detectedContextLimit;
|
|
12834
|
-
detectedLimitProvenance = overflow.detectedContextLimitProvenance;
|
|
12835
|
-
}
|
|
12836
|
-
} catch {}
|
|
12837
|
-
}
|
|
12838
|
-
const geometry = getSdkWindowGeometry(providerID, modelID, detected, {
|
|
12839
|
-
detectedLimitProvenance,
|
|
12840
|
-
harness: "opencode"
|
|
12841
|
-
});
|
|
12842
|
-
if (!geometry || detected !== undefined)
|
|
12843
|
-
return geometry;
|
|
12844
|
-
return applySessionProvenFloor(geometry, modelMatchedProvenContextLimit(ctx?.db, ctx?.sessionID, modelKey), ctx);
|
|
12845
|
-
}
|
|
12846
|
-
function resolveContextLimit(providerID, modelID, ctx) {
|
|
12847
|
-
const modelKey = resolveModelKey(providerID, modelID);
|
|
12848
|
-
let detected;
|
|
12849
|
-
let detectedLimitProvenance = "unknown";
|
|
12850
|
-
if (ctx?.db && ctx.sessionID) {
|
|
12851
|
-
try {
|
|
12852
|
-
const overflow = getOverflowState(ctx.db, ctx.sessionID, modelKey);
|
|
12853
|
-
if (overflow.detectedContextLimit > 0) {
|
|
12854
|
-
detected = overflow.detectedContextLimit;
|
|
12855
|
-
detectedLimitProvenance = overflow.detectedContextLimitProvenance;
|
|
12856
|
-
}
|
|
12857
|
-
} catch {}
|
|
12858
|
-
}
|
|
12859
|
-
const fromModelsDev = providerID && modelID ? getSdkContextLimit(providerID, modelID, detected, {
|
|
12860
|
-
reservation: ctx?.reservation,
|
|
12861
|
-
detectedLimitProvenance
|
|
12862
|
-
}) : undefined;
|
|
12863
|
-
const resolved = fromModelsDev ?? detected ?? DEFAULT_CONTEXT_LIMIT;
|
|
12864
|
-
if (detected !== undefined)
|
|
12865
|
-
return resolved;
|
|
12866
|
-
const provenLimit = modelMatchedProvenContextLimit(ctx?.db, ctx?.sessionID, modelKey);
|
|
12867
|
-
if (!isSaneLimit(provenLimit))
|
|
12868
|
-
return resolved;
|
|
12869
|
-
const geometry = resolveContextWindowGeometry(providerID, modelID, ctx);
|
|
12870
|
-
if (ctx?.reservation !== "none" && geometry)
|
|
12871
|
-
return geometry.usableSoft;
|
|
12872
|
-
if (geometry && hasTrustedAbsoluteWall(geometry) && provenLimit > geometry.derivation.absoluteWall) {
|
|
12873
|
-
return resolved;
|
|
12874
|
-
}
|
|
12875
|
-
return Math.max(resolved, provenLimit);
|
|
12876
|
-
}
|
|
12877
|
-
function resolveTrustedContextLimit(providerID, modelID, ctx) {
|
|
12878
|
-
const modelKey = resolveModelKey(providerID, modelID);
|
|
12879
|
-
let detected;
|
|
12880
|
-
let detectedLimitProvenance = "unknown";
|
|
12881
|
-
if (ctx?.db && ctx.sessionID) {
|
|
12882
|
-
try {
|
|
12883
|
-
const overflow = getOverflowState(ctx.db, ctx.sessionID, modelKey);
|
|
12884
|
-
if (overflow.detectedContextLimit > 0) {
|
|
12885
|
-
detected = overflow.detectedContextLimit;
|
|
12886
|
-
detectedLimitProvenance = overflow.detectedContextLimitProvenance;
|
|
12887
|
-
}
|
|
12888
|
-
} catch {}
|
|
12889
|
-
}
|
|
12890
|
-
const fromModelsDev = providerID && modelID ? getSdkContextLimit(providerID, modelID, detected, {
|
|
12891
|
-
detectedLimitProvenance
|
|
12892
|
-
}) : undefined;
|
|
12893
|
-
if (detected !== undefined) {
|
|
12894
|
-
return typeof fromModelsDev === "number" && fromModelsDev > 0 ? fromModelsDev : detected;
|
|
12895
|
-
}
|
|
12896
|
-
const provenLimit = modelMatchedProvenContextLimit(ctx?.db, ctx?.sessionID, modelKey);
|
|
12897
|
-
if (typeof fromModelsDev === "number" && fromModelsDev > 0) {
|
|
12898
|
-
return isSaneLimit(provenLimit) ? Math.max(fromModelsDev, provenLimit) : fromModelsDev;
|
|
12899
|
-
}
|
|
12900
|
-
if (isSaneLimit(provenLimit))
|
|
12901
|
-
return provenLimit;
|
|
12902
|
-
const persisted = modelMatchedPersistedUsage(ctx?.db, ctx?.sessionID, modelKey);
|
|
12903
|
-
return isSaneLimit(persisted?.lastUsageContextLimit) ? persisted.lastUsageContextLimit : undefined;
|
|
12904
|
-
}
|
|
12905
|
-
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.";
|
|
12906
|
-
function readPersistedWrapupWindow(db, sessionId, modelKey) {
|
|
12907
|
-
const { lastUsageContextLimit, lastObservedModelKey } = getOrCreateSessionMeta(db, sessionId);
|
|
12908
|
-
if (!isSaneLimit(lastUsageContextLimit) || !lastObservedModelKey)
|
|
12909
|
-
return;
|
|
12910
|
-
if (modelKey && piModelRefToCanonical(modelKey) !== piModelRefToCanonical(lastObservedModelKey))
|
|
12911
|
-
return;
|
|
12912
|
-
return { contextLimit: lastUsageContextLimit, modelKey: lastObservedModelKey };
|
|
12913
|
-
}
|
|
12914
|
-
function resolveOpenCodeWrapupWindow(db, sessionId, model) {
|
|
12915
|
-
const route = model ?? findLastAssistantModelFromOpenCodeDb(sessionId);
|
|
12916
|
-
const modelKey = resolveModelKey(route?.providerID, route?.modelID);
|
|
12917
|
-
if (modelKey) {
|
|
12918
|
-
const contextLimit = resolveTrustedContextLimit(route?.providerID, route?.modelID, {
|
|
12919
|
-
db,
|
|
12920
|
-
sessionID: sessionId
|
|
12921
|
-
});
|
|
12922
|
-
if (contextLimit !== undefined)
|
|
12923
|
-
return { contextLimit, modelKey };
|
|
12924
|
-
}
|
|
12925
|
-
return readPersistedWrapupWindow(db, sessionId, modelKey);
|
|
12926
|
-
}
|
|
12927
|
-
var clampWarnSeen = new Set;
|
|
12928
|
-
function isFinitePositive(v) {
|
|
12929
|
-
return typeof v === "number" && Number.isFinite(v) && v > 0;
|
|
12930
|
-
}
|
|
12931
|
-
function* modelKeyLookupOrder(modelKey) {
|
|
12932
|
-
const slash = modelKey.indexOf("/");
|
|
12933
|
-
const providerRefs = slash >= 0 ? modelRefLookupOrder(modelKey) : [];
|
|
12934
|
-
let modelId = slash >= 0 ? modelKey.slice(slash + 1) : modelKey;
|
|
12935
|
-
while (modelId.length > 0) {
|
|
12936
|
-
for (const providerRef of providerRefs) {
|
|
12937
|
-
const providerSlash = providerRef.indexOf("/");
|
|
12938
|
-
yield `${providerRef.slice(0, providerSlash)}/${modelId}`;
|
|
12939
|
-
}
|
|
12940
|
-
yield modelId;
|
|
12941
|
-
const lastDash = modelId.lastIndexOf("-");
|
|
12942
|
-
if (lastDash <= 0)
|
|
12943
|
-
break;
|
|
12944
|
-
modelId = modelId.slice(0, lastDash);
|
|
12945
|
-
}
|
|
12946
|
-
}
|
|
12947
|
-
function resolveExecuteThresholdDetail(config, modelKey, fallback, options) {
|
|
12948
|
-
if (options?.tokensConfig && isFinitePositive(options.contextLimit)) {
|
|
12949
|
-
const contextLimit = options.contextLimit;
|
|
12950
|
-
const tokenMatch = resolveTokensMatchWithKey(options.tokensConfig, modelKey);
|
|
12951
|
-
if (tokenMatch && isFinitePositive(tokenMatch.value)) {
|
|
12952
|
-
const cap = contextLimit * (MAX_EXECUTE_THRESHOLD / 100);
|
|
12953
|
-
const effectiveTokens = Math.min(tokenMatch.value, cap);
|
|
12954
|
-
if (effectiveTokens < tokenMatch.value) {
|
|
12955
|
-
const dedupeKey = `${options.sessionId ?? "__global__"}|${modelKey ?? "__default__"}|${tokenMatch.value}|${cap}`;
|
|
12956
|
-
if (!clampWarnSeen.has(dedupeKey)) {
|
|
12957
|
-
clampWarnSeen.add(dedupeKey);
|
|
12958
|
-
const msg = `execute_threshold_tokens clamped: ${tokenMatch.value} → ${effectiveTokens} (${MAX_EXECUTE_THRESHOLD}% of ${contextLimit}) for ${modelKey ?? "default"}`;
|
|
12959
|
-
if (options.sessionId) {
|
|
12960
|
-
sessionLog2(options.sessionId, `WARN: ${msg}`);
|
|
12961
|
-
} else {
|
|
12962
|
-
log2(`[magic-context] WARN: ${msg}`);
|
|
12963
|
-
}
|
|
12964
|
-
}
|
|
12965
|
-
}
|
|
12966
|
-
const percentage = effectiveTokens / contextLimit * 100;
|
|
12967
|
-
const detail = {
|
|
12968
|
-
percentage: Math.min(percentage, MAX_EXECUTE_THRESHOLD),
|
|
12969
|
-
mode: "tokens",
|
|
12970
|
-
absoluteTokens: Math.floor(effectiveTokens),
|
|
12971
|
-
matchedKey: tokenMatch.matchedKey
|
|
12972
|
-
};
|
|
12973
|
-
if (effectiveTokens < tokenMatch.value) {
|
|
12974
|
-
detail.clamped = true;
|
|
12975
|
-
detail.configuredValue = tokenMatch.value;
|
|
12976
|
-
}
|
|
12977
|
-
return detail;
|
|
12978
|
-
}
|
|
12979
|
-
}
|
|
12980
|
-
let resolved;
|
|
12981
|
-
let matchedKey;
|
|
12982
|
-
if (typeof config === "number") {
|
|
12983
|
-
resolved = config;
|
|
12984
|
-
} else if (modelKey) {
|
|
12985
|
-
let matched;
|
|
12986
|
-
for (const candidate of modelKeyLookupOrder(modelKey)) {
|
|
12987
|
-
if (typeof config[candidate] === "number") {
|
|
12988
|
-
matched = config[candidate];
|
|
12989
|
-
matchedKey = candidate;
|
|
12990
|
-
break;
|
|
12991
|
-
}
|
|
12992
|
-
}
|
|
12993
|
-
if (matched === undefined && typeof config.default === "number") {
|
|
12994
|
-
resolved = config.default;
|
|
12995
|
-
matchedKey = "default";
|
|
12996
|
-
} else {
|
|
12997
|
-
resolved = matched ?? fallback;
|
|
12998
|
-
}
|
|
12999
|
-
} else if (typeof config.default === "number") {
|
|
13000
|
-
resolved = config.default;
|
|
13001
|
-
matchedKey = "default";
|
|
13002
|
-
} else {
|
|
13003
|
-
resolved = fallback;
|
|
13004
|
-
}
|
|
13005
|
-
if (!Number.isFinite(resolved) || resolved < 0) {
|
|
13006
|
-
resolved = fallback;
|
|
13007
|
-
}
|
|
13008
|
-
const cappedPercentage = Math.min(resolved, MAX_EXECUTE_THRESHOLD);
|
|
13009
|
-
const percentageClamped = cappedPercentage < resolved;
|
|
13010
|
-
if (percentageClamped) {
|
|
13011
|
-
const dedupeKey = `pct|${options?.sessionId ?? "__global__"}|${modelKey ?? "__default__"}|${resolved}`;
|
|
13012
|
-
if (!clampWarnSeen.has(dedupeKey)) {
|
|
13013
|
-
clampWarnSeen.add(dedupeKey);
|
|
13014
|
-
const msg = `execute_threshold clamped ${resolved}% → ${MAX_EXECUTE_THRESHOLD}% for ${modelKey ?? "default"} (capped against the output-reserved safe window; 10% remains for mid-turn growth before the absolute 95% wall)`;
|
|
13015
|
-
if (options?.sessionId) {
|
|
13016
|
-
sessionLog2(options.sessionId, `WARN: ${msg}`);
|
|
13017
|
-
} else {
|
|
13018
|
-
log2(`[magic-context] WARN: ${msg}`);
|
|
13019
|
-
}
|
|
13020
|
-
}
|
|
13021
|
-
}
|
|
13022
|
-
const detail = {
|
|
13023
|
-
percentage: cappedPercentage,
|
|
13024
|
-
mode: "percentage",
|
|
13025
|
-
matchedKey
|
|
13026
|
-
};
|
|
13027
|
-
if (percentageClamped) {
|
|
13028
|
-
detail.clamped = true;
|
|
13029
|
-
detail.configuredValue = resolved;
|
|
13030
|
-
}
|
|
13031
|
-
return detail;
|
|
13032
|
-
}
|
|
13033
|
-
function resolveExecuteThreshold(config, modelKey, fallback, options) {
|
|
13034
|
-
return resolveExecuteThresholdDetail(config, modelKey, fallback, options).percentage;
|
|
13035
|
-
}
|
|
13036
|
-
function resolveTokensMatchWithKey(tokensConfig, modelKey) {
|
|
13037
|
-
if (!tokensConfig) {
|
|
13038
|
-
return;
|
|
13039
|
-
}
|
|
13040
|
-
if (modelKey) {
|
|
13041
|
-
for (const candidate of modelKeyLookupOrder(modelKey)) {
|
|
13042
|
-
const value = tokensConfig[candidate];
|
|
13043
|
-
if (typeof value === "number") {
|
|
13044
|
-
return { value, matchedKey: candidate };
|
|
13045
|
-
}
|
|
13046
|
-
}
|
|
13047
|
-
}
|
|
13048
|
-
if (typeof tokensConfig.default === "number") {
|
|
13049
|
-
return { value: tokensConfig.default, matchedKey: "default" };
|
|
13050
|
-
}
|
|
13051
|
-
return;
|
|
13052
|
-
}
|
|
13053
|
-
function resolveModelKey(providerID, modelID) {
|
|
13054
|
-
if (!providerID || !modelID) {
|
|
13055
|
-
return;
|
|
13056
|
-
}
|
|
13057
|
-
return piModelRefToCanonical(`${providerID}/${modelID}`);
|
|
13058
|
-
}
|
|
13059
|
-
function resolveSessionId(properties) {
|
|
13060
|
-
if (typeof properties?.sessionID === "string") {
|
|
13061
|
-
return properties.sessionID;
|
|
13062
|
-
}
|
|
13063
|
-
const info = properties?.info;
|
|
13064
|
-
if (info === null || typeof info !== "object") {
|
|
13065
|
-
return;
|
|
13066
|
-
}
|
|
13067
|
-
const record = info;
|
|
13068
|
-
if (typeof record.sessionID === "string") {
|
|
13069
|
-
return record.sessionID;
|
|
13070
|
-
}
|
|
13071
|
-
if (typeof record.id === "string") {
|
|
13072
|
-
return record.id;
|
|
13073
|
-
}
|
|
13074
|
-
return;
|
|
13075
|
-
}
|
|
13076
|
-
function historyBudgetPolicyIdentity(historyBudgetPercentage, executeThresholdPercentage, modelKey, executeThresholdTokens) {
|
|
13077
|
-
if (!historyBudgetPercentage)
|
|
13078
|
-
return "pdefault";
|
|
13079
|
-
const threshold = resolveExecuteThresholdDetail(executeThresholdPercentage ?? 65, modelKey, 65, { tokensConfig: executeThresholdTokens, contextLimit: Number.MAX_SAFE_INTEGER });
|
|
13080
|
-
return `p${historyBudgetPercentage}:${threshold.mode}:${threshold.absoluteTokens ?? threshold.percentage}`;
|
|
13081
|
-
}
|
|
13082
|
-
|
|
13083
|
-
// src/features/magic-context/scheduler.ts
|
|
13084
|
-
var TTL_PATTERN = /^(\d+)([smh])$/;
|
|
13085
|
-
var NUMERIC_PATTERN = /^\d+$/;
|
|
13086
|
-
var UNIT_TO_MS = {
|
|
13087
|
-
s: 1000,
|
|
13088
|
-
m: 60 * 1000,
|
|
13089
|
-
h: 60 * 60 * 1000
|
|
13090
|
-
};
|
|
13091
|
-
function parseCacheTtl(ttl) {
|
|
13092
|
-
const normalizedTtl = ttl.trim();
|
|
13093
|
-
if (normalizedTtl.toLowerCase() === "never") {
|
|
13094
|
-
return Number.POSITIVE_INFINITY;
|
|
13095
|
-
}
|
|
13096
|
-
if (NUMERIC_PATTERN.test(normalizedTtl)) {
|
|
13097
|
-
return Number(normalizedTtl);
|
|
13098
|
-
}
|
|
13099
|
-
const match = normalizedTtl.match(TTL_PATTERN);
|
|
13100
|
-
if (!match) {
|
|
13101
|
-
throw new Error(`Invalid cache TTL format: ${ttl}`);
|
|
13102
|
-
}
|
|
13103
|
-
const value = Number(match[1]);
|
|
13104
|
-
const unit = match[2];
|
|
13105
|
-
return value * UNIT_TO_MS[unit];
|
|
13106
|
-
}
|
|
13107
|
-
function createScheduler(config) {
|
|
13108
|
-
return {
|
|
13109
|
-
shouldExecute(sessionMeta, contextUsage, _currentTime, sessionId, modelKey, contextLimit) {
|
|
13110
|
-
if (contextUsage.percentage === 0 && sessionMeta.lastResponseTime === 0) {
|
|
13111
|
-
return "defer";
|
|
13112
|
-
}
|
|
13113
|
-
const effectiveContextLimit = contextLimit ?? (contextUsage.percentage > 0 && contextUsage.inputTokens > 0 ? contextUsage.inputTokens / (contextUsage.percentage / 100) : undefined);
|
|
13114
|
-
const threshold = resolveExecuteThreshold(config.executeThresholdPercentage, modelKey, 65, {
|
|
13115
|
-
tokensConfig: config.executeThresholdTokens,
|
|
13116
|
-
contextLimit: effectiveContextLimit,
|
|
13117
|
-
sessionId
|
|
13118
|
-
});
|
|
13119
|
-
if (contextUsage.percentage >= threshold) {
|
|
13120
|
-
return "execute";
|
|
13121
|
-
}
|
|
13122
|
-
return "defer";
|
|
13123
|
-
}
|
|
13124
|
-
};
|
|
13125
|
-
}
|
|
13126
|
-
function computeHardCacheExpired(cacheTtl, lastResponseTime, now, onInvalid) {
|
|
13127
|
-
let ttlMs;
|
|
13128
|
-
try {
|
|
13129
|
-
ttlMs = parseCacheTtl(cacheTtl);
|
|
13130
|
-
} catch (error) {
|
|
13131
|
-
onInvalid?.(error);
|
|
13132
|
-
ttlMs = 5 * 60 * 1000;
|
|
13133
|
-
}
|
|
13134
|
-
return lastResponseTime > 0 && now - lastResponseTime > ttlMs;
|
|
13135
|
-
}
|
|
13136
|
-
|
|
13137
12709
|
// src/features/magic-context/storage-unavailable-reason.ts
|
|
13138
12710
|
function describeStorageUnavailability(fallbackCause) {
|
|
13139
12711
|
const migration = getMigrationOnOpenRefusal();
|
|
@@ -16787,8 +16359,8 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
16787
16359
|
const db = readDatabase();
|
|
16788
16360
|
if (!db)
|
|
16789
16361
|
return { ok: false, error: "db unavailable" };
|
|
16790
|
-
const { runManagedRecomp } = await importPluginModule(() => import("./recomp-orchestrator-
|
|
16791
|
-
const { sendIgnoredMessage } = await importPluginModule(() => import("./send-session-notification-
|
|
16362
|
+
const { runManagedRecomp } = await importPluginModule(() => import("./recomp-orchestrator-2ztmtxt2.js"));
|
|
16363
|
+
const { sendIgnoredMessage } = await importPluginModule(() => import("./send-session-notification-gzxz88vq.js"));
|
|
16792
16364
|
log2(`[rpc] recomp requested for session ${sessionId}`);
|
|
16793
16365
|
if (!args.client && !args.hiddenCompletionExecutor) {
|
|
16794
16366
|
return {
|
|
@@ -16872,7 +16444,7 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
16872
16444
|
const db = readDatabase();
|
|
16873
16445
|
if (!db)
|
|
16874
16446
|
return { ok: false, error: "db unavailable" };
|
|
16875
|
-
const { runManagedWrapup } = await importPluginModule(() => import("./wrapup-orchestrator-
|
|
16447
|
+
const { runManagedWrapup } = await importPluginModule(() => import("./wrapup-orchestrator-h3s905vs.js"));
|
|
16876
16448
|
const model = await args.readSelectedSessionModel?.(sessionId) ?? liveSessionState.liveModelBySession.get(sessionId);
|
|
16877
16449
|
const window = resolveOpenCodeWrapupWindow(db, sessionId, model);
|
|
16878
16450
|
if (!window)
|
|
@@ -25176,7 +24748,18 @@ function resolveTransformHostSeams(deps) {
|
|
|
25176
24748
|
hostRefuse: deps.hostRefuse ?? abortSessionFailClosed2
|
|
25177
24749
|
};
|
|
25178
24750
|
}
|
|
24751
|
+
function fitRequestCounts(served, systemPromptTokens, exactToolDefinitionTokens) {
|
|
24752
|
+
const routeToolDefinitionTokens = (served.rawComponents?.tools ?? served.messageTokens.toolCall) - served.messageTokens.toolCall;
|
|
24753
|
+
const rawTokens = served.rawTokens ?? served.tokens;
|
|
24754
|
+
const localTokens = exactToolDefinitionTokens !== undefined ? rawTokens - routeToolDefinitionTokens + exactToolDefinitionTokens : served.toolDefinitionsMeasured ? rawTokens : Math.max(0, systemPromptTokens) + served.messageTokens.conversation + served.messageTokens.toolCall;
|
|
24755
|
+
const toolDefinitionTokens = exactToolDefinitionTokens ?? (served.toolDefinitionsMeasured ? routeToolDefinitionTokens : 0);
|
|
24756
|
+
const provenTokens = served.refusalGrade && (exactToolDefinitionTokens === undefined || served.refusalBasis === "provider-prefix") ? served.refusalTokens : undefined;
|
|
24757
|
+
return { localTokens, toolDefinitionTokens, provenTokens };
|
|
24758
|
+
}
|
|
25179
24759
|
var SIGNED_FIT_REFUSED_MARKER = "signed_fit:refused:v1";
|
|
24760
|
+
function rendersCompartmentHistory(isSubagent, compactionOff) {
|
|
24761
|
+
return !isSubagent && !compactionOff;
|
|
24762
|
+
}
|
|
25180
24763
|
function createTransform(deps) {
|
|
25181
24764
|
registerSystemDateRefresh(deps.historyRefreshSessions);
|
|
25182
24765
|
const finalWireUsage = createFinalWireUsageTracker();
|
|
@@ -25986,7 +25569,7 @@ ${notice}`, notificationParams));
|
|
|
25986
25569
|
let hiddenMessagesAtCompactionSeam = [];
|
|
25987
25570
|
let trimmedMessagesAtCompactionBoundary = [];
|
|
25988
25571
|
const messagesBeforeInitialPrepare = isCacheBusting && deferredHistoryWasPendingAtPassStart ? [...messages] : null;
|
|
25989
|
-
if (
|
|
25572
|
+
if (rendersCompartmentHistory(reducedMode, compactionOff)) {
|
|
25990
25573
|
const tInj = performance.now();
|
|
25991
25574
|
pendingCompartmentInjection = prepareCompartmentInjection(db, sessionId, messages, isCacheBusting, coveredHostInstructions, projectIdentity, deps.memoryConfig?.injectionBudgetTokens, deps.experimentalTemporalAwareness, sessionMeta.cachedM0TrimBoundaryId === undefined ? undefined : {
|
|
25992
25575
|
hasCachedM0: sessionMeta.cachedM0Bytes !== null,
|
|
@@ -26795,8 +26378,7 @@ ${notice}`, notificationParams));
|
|
|
26795
26378
|
agentName: notificationParams.agent,
|
|
26796
26379
|
sessionId
|
|
26797
26380
|
});
|
|
26798
|
-
const localTokens
|
|
26799
|
-
const provenTokens = served.refusalGrade ? served.refusalTokens : undefined;
|
|
26381
|
+
const { localTokens, provenTokens } = fitRequestCounts(served, sessionMeta.systemPromptTokens, getExactSessionToolDefinitionTokens(modelForBudget?.providerID, modelForBudget?.modelID, sessionId));
|
|
26800
26382
|
if (provenTokens !== undefined ? provenTokens > warmAppendFit.limit : isClearlyOverWindow(localTokens, warmAppendFit.limit)) {
|
|
26801
26383
|
messages.splice(0, messages.length, ...warmAppendFit.input);
|
|
26802
26384
|
await transform({}, output, {
|
|
@@ -26815,14 +26397,20 @@ ${notice}`, notificationParams));
|
|
|
26815
26397
|
agentName: notificationParams.agent,
|
|
26816
26398
|
sessionId
|
|
26817
26399
|
});
|
|
26818
|
-
const
|
|
26819
|
-
|
|
26400
|
+
const {
|
|
26401
|
+
localTokens,
|
|
26402
|
+
toolDefinitionTokens: localToolDefinitionTokens,
|
|
26403
|
+
provenTokens: fitProvenTokens
|
|
26404
|
+
} = fitRequestCounts(served, sessionMeta.systemPromptTokens, getExactSessionToolDefinitionTokens(modelForBudget?.providerID, modelForBudget?.modelID, sessionId));
|
|
26405
|
+
const provenTokens = warmFitRetry ? fitProvenTokens : undefined;
|
|
26406
|
+
const servedTokens = provenTokens ?? localTokens;
|
|
26407
|
+
const toolDefinitionTokens = provenTokens === undefined ? localToolDefinitionTokens : served.toolDefinitionTokens ?? 0;
|
|
26820
26408
|
if (!Number.isFinite(servedTokens) || servedTokens > unmanagedOverWindowPass.limit) {
|
|
26821
|
-
sessionLog2(sessionId, `over-window first pass not sent: the request is still about ${servedTokens} tokens after this pass, over the ${unmanagedOverWindowPass.limit}-token window (history started at ${unmanagedOverWindowPass.tokens}) (MC-H06)`);
|
|
26409
|
+
sessionLog2(sessionId, `over-window first pass not sent: the request is still about ${servedTokens} tokens after this pass (tool definitions: ${toolDefinitionTokens}), over the ${unmanagedOverWindowPass.limit}-token window (history started at ${unmanagedOverWindowPass.tokens}) (MC-H06)`);
|
|
26822
26410
|
throw new UnmanagedOverWindowError(servedTokens, unmanagedOverWindowPass.limit);
|
|
26823
26411
|
}
|
|
26824
26412
|
unmanagedOverWindowSessions.delete(sessionId);
|
|
26825
|
-
sessionLog2(sessionId, `over-window first pass reduced: the request is about ${servedTokens} tokens (history started at ${unmanagedOverWindowPass.tokens}), under the ${unmanagedOverWindowPass.limit}-token window`);
|
|
26413
|
+
sessionLog2(sessionId, `over-window first pass reduced: the request is about ${servedTokens} tokens (tool definitions: ${toolDefinitionTokens}; history started at ${unmanagedOverWindowPass.tokens}), under the ${unmanagedOverWindowPass.limit}-token window`);
|
|
26826
26414
|
}
|
|
26827
26415
|
const timedOutHistorianFailure = compartmentPhase.historianJoinTimedOut ? historianJoinFailClosedMessage({
|
|
26828
26416
|
timedOut: true,
|
|
@@ -26883,7 +26471,8 @@ ${notice}`, notificationParams));
|
|
|
26883
26471
|
await host.hostRefusalNotice(deps.client, sessionId, recoveryOverLimit ? recoveryRefusalNotice(recoveryServedRequest.historyRemains) : EMERGENCY_REFUSAL_NOTICE, notificationParams);
|
|
26884
26472
|
} catch (error) {
|
|
26885
26473
|
throw new EmergencyFailClosedError("Emergency recovery notification failed", {
|
|
26886
|
-
cause: error
|
|
26474
|
+
cause: error,
|
|
26475
|
+
noticeHandled: true
|
|
26887
26476
|
});
|
|
26888
26477
|
}
|
|
26889
26478
|
try {
|
|
@@ -26892,14 +26481,16 @@ ${notice}`, notificationParams));
|
|
|
26892
26481
|
} catch (error) {
|
|
26893
26482
|
sessionLog2(sessionId, "transform: emergency fail-closed abort failed; refusing to return a sendable prompt:", getErrorMessage(error));
|
|
26894
26483
|
throw new EmergencyFailClosedError("Emergency recovery abort failed", {
|
|
26895
|
-
cause: error
|
|
26484
|
+
cause: error,
|
|
26485
|
+
noticeHandled: true
|
|
26896
26486
|
});
|
|
26897
26487
|
}
|
|
26898
26488
|
try {
|
|
26899
26489
|
clearEmergencyDropSample(db, sessionId);
|
|
26900
26490
|
} catch (error) {
|
|
26901
26491
|
throw new EmergencyFailClosedError("Emergency recovery cleanup failed", {
|
|
26902
|
-
cause: error
|
|
26492
|
+
cause: error,
|
|
26493
|
+
noticeHandled: true
|
|
26903
26494
|
});
|
|
26904
26495
|
}
|
|
26905
26496
|
sessionLog2(sessionId, `EMERGENCY: fail-closed (reason=${emergencyFailClosed.reason}, recoveryOrigin=${emergencyRecoveryOrigin ?? "unknown"}, finalEstimate=${finalWireEstimate?.tokens ?? "unavailable"}, estimateTrusted=${finalWireEstimate?.trusted ?? false}, syntheticUsage=${usagePercentageSynthetic})`);
|
|
@@ -27826,6 +27417,9 @@ class IncompleteUserMessageError extends Error {
|
|
|
27826
27417
|
this.name = "IncompleteUserMessageError";
|
|
27827
27418
|
}
|
|
27828
27419
|
}
|
|
27420
|
+
function isTransformRefusal(error) {
|
|
27421
|
+
return isFailClosedBlockingError(error) || error instanceof EmergencyFailClosedError || error instanceof RawFallbackContextLimitError || error instanceof AssistantTerminalRetryError || error instanceof IncompleteUserMessageError || error instanceof UnresolvedHistoryBoundaryError || error instanceof UnmanagedOverWindowError || error instanceof DegradedPassRefusalError || error instanceof StorageBusyRefusalError;
|
|
27422
|
+
}
|
|
27829
27423
|
function replaceMessagesInPlace2(output, next) {
|
|
27830
27424
|
if (output.messages !== next)
|
|
27831
27425
|
output.messages.splice(0, output.messages.length, ...next);
|
|
@@ -28182,15 +27776,7 @@ function createMessagesTransformHandler(args) {
|
|
|
28182
27776
|
const isTransient = isTransientSqliteError2(error) || error instanceof StorageBusyRefusalError;
|
|
28183
27777
|
if (isTransient) {
|
|
28184
27778
|
if (!args.compactionOff) {
|
|
28185
|
-
|
|
28186
|
-
if (sessionId && args.onStorageBusyRefusal) {
|
|
28187
|
-
try {
|
|
28188
|
-
await args.onStorageBusyRefusal(sessionId, refusal.message);
|
|
28189
|
-
} catch (noticeError) {
|
|
28190
|
-
log2("[magic-context] storage-busy host refusal failed:", noticeError);
|
|
28191
|
-
}
|
|
28192
|
-
}
|
|
28193
|
-
throw refusal;
|
|
27779
|
+
throw error instanceof StorageBusyRefusalError ? error : new StorageBusyRefusalError(error, "messages-transform");
|
|
28194
27780
|
}
|
|
28195
27781
|
log2(`[magic-context] transform skipped this pass — ${code} (transient; retrying next pass): ${message}`);
|
|
28196
27782
|
restoreCompactionOffInput();
|
|
@@ -28251,6 +27837,24 @@ function createMessagesTransformHandler(args) {
|
|
|
28251
27837
|
const served = await servePass(input, output);
|
|
28252
27838
|
returned = true;
|
|
28253
27839
|
return served;
|
|
27840
|
+
} catch (error) {
|
|
27841
|
+
if (args.onRefusal && isTransformRefusal(error) && !(error instanceof EmergencyFailClosedError && error.noticeHandled)) {
|
|
27842
|
+
const sessionId = servedSessionId ?? resolveSessionId2(output);
|
|
27843
|
+
if (sessionId) {
|
|
27844
|
+
try {
|
|
27845
|
+
let message = error.message;
|
|
27846
|
+
if (isFailClosedBlockingError(error) && error.reason.kind === "migration_guard") {
|
|
27847
|
+
message = formatFailClosedBlockingSummary(error.reason);
|
|
27848
|
+
} else if (error instanceof DegradedPassRefusalError) {
|
|
27849
|
+
message = describeDegradedPassFailure(error.site, undefined);
|
|
27850
|
+
}
|
|
27851
|
+
await args.onRefusal(sessionId, message, error);
|
|
27852
|
+
} catch (noticeError) {
|
|
27853
|
+
sessionLog2(sessionId, "host refusal notice failed:", noticeError);
|
|
27854
|
+
}
|
|
27855
|
+
}
|
|
27856
|
+
}
|
|
27857
|
+
throw error;
|
|
28254
27858
|
} finally {
|
|
28255
27859
|
if (servedSessionId)
|
|
28256
27860
|
finishServedRequest(servedSessionId, output, returned);
|
|
@@ -30972,4 +30576,4 @@ function applyHiddenSubagentTemperature(input, output, log) {
|
|
|
30972
30576
|
output.temperature = temperature;
|
|
30973
30577
|
}
|
|
30974
30578
|
|
|
30975
|
-
export { logConfigDependencyNotesOnce, openOpenCodeDb, DREAMER_SYSTEM_PROMPT, runSessionProjectBackfill, SMART_NOTE_COMPILER_SYSTEM_PROMPT, createLiveSessionState, RETROSPECTIVE_MAX_USER_MESSAGE_CHARS, RETROSPECTIVE_MESSAGE_TRUNCATION_MARKER, OpenCodeRetrospectiveRawProvider, createDreamTaskExecutor, runManualDream, runDueTasksForProject, startDreamScheduleTimer, createDreamTimerModuleClient, ensureProjectRegisteredFromOpenCodeDirectory,
|
|
30579
|
+
export { logConfigDependencyNotesOnce, openOpenCodeDb, DREAMER_SYSTEM_PROMPT, runSessionProjectBackfill, SMART_NOTE_COMPILER_SYSTEM_PROMPT, createLiveSessionState, RETROSPECTIVE_MAX_USER_MESSAGE_CHARS, RETROSPECTIVE_MESSAGE_TRUNCATION_MARKER, OpenCodeRetrospectiveRawProvider, createDreamTaskExecutor, runManualDream, runDueTasksForProject, startDreamScheduleTimer, createDreamTimerModuleClient, ensureProjectRegisteredFromOpenCodeDirectory, describeStorageUnavailability, resolveSessionCacheTtl, runEmbedHistoryDrain, pauseEmbedHistoryDrain, formatEmbedStatusText, getSessionProperties, getSessionCreatedInfo, getMessageUpdatedAssistantInfo, getMessageUpdatedInfo, getSessionErrorInfo, getMessageRemovedInfo, summarizeManualDream, createMagicContextCommandHandler, getLiveNotificationParams, createChatMessageHook, createEventHook, createCommandExecuteBeforeHook, createToolExecuteAfterHook, recordHiddenVariantWarning, buildStatusDetail, isDebugRpcEnabled, registerRpcHandlers, maybeAutoEmbedSessionBackfill, clearTransformDecisionSession, scheduleOpenCodeTransformDecisionWrite, stageOpenCodeV2TransformDecision, bindOpenCodeV2TransformDecision, maybeDeliverChannel2, createM0RenderOptions, lkgReplayLimit, measureLkgReplay, moduleRawBlockMappings, STORAGE_BUSY_MESSAGE, StorageBusyRefusalError, bindSystemDateRequestIdentity, bindSystemDateOutput, registerSystemDateRefresh, rustWrapupHistorianFields, isClearlyOverWindow, UnmanagedOverWindowError, UnresolvedHistoryBoundaryError, clearMessageTokensCache, rendersCompartmentHistory, createTransform, createSubcModuleClient, createModuleToolBackends, createRustRefusalRecovery, createSystemPromptHashHandler, tryMessagesTransformLkgReplay, createMessagesTransformHandler, primaryOnlyToolIds, subagentToolRefusal, guardSubagentTools, hideSubagentTools, removePrimaryOnlyTools, storedSubagentMode, createCtxExpandTools, CTX_MEMORY_LIST_TOOL_NAME, CTX_MEMORY_ACTIONS, createCtxMemoryTools, createCtxMemoryListTools, CTX_NOTE_DESCRIPTION, withoutSmartNoteText, createCtxNoteTools, createCtxReduceTools, createCtxSearchTools, parameterDescriptionsFor, applyJsonSchemaParameterDescriptions, MagicContextRpcServer, subagentTemperature, applyHiddenSubagentTemperature };
|