@cortexkit/opencode-magic-context 0.49.57 → 0.49.60
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/{announcement-9pr71hd5.js → announcement-p41dde4h.js} +2 -2
- package/dist/auto-search-worker.js +5 -5
- package/dist/chunk-embedding-write-worker.js +13 -13
- package/dist/{compaction-marker-candidates-8hazqfvj.js → compaction-marker-candidates-1ndjqh9k.js} +2 -2
- package/dist/compaction-marker-candidates-worker.js +1 -1
- package/dist/{compartment-chunk-embedding-gfd093f8.js → compartment-chunk-embedding-ymc9mtwv.js} +7 -7
- package/dist/{conflict-warning-hook-56qpq7ws.js → conflict-warning-hook-m8yezwdj.js} +7 -7
- package/dist/{context-a617pcqe.js → context-45fde2p4.js} +41 -40
- package/dist/{derive-budgets-z53424qx.js → derive-budgets-def8genf.js} +2 -2
- package/dist/{embedding-backfill-2dvf3rcn.js → embedding-backfill-sk7agn5v.js} +12 -12
- package/dist/embedding-worker-process.js +1 -1
- package/dist/embedding-worker.js +4 -4
- package/dist/{history-owner-n50e0e8y.js → history-owner-xqfsvf9k.js} +2 -2
- package/dist/hooks/magic-context/command-handler.d.ts +2 -0
- package/dist/hooks/magic-context/command-handler.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-historian.d.ts.map +1 -1
- package/dist/hooks/magic-context/hook.d.ts.map +1 -1
- package/dist/{index-5ptp2de1.js → index-0cz8bsyx.js} +9 -9
- package/dist/{index-r9agn061.js → index-1sq1krqw.js} +4 -4
- package/dist/{index-b6rdv8re.js → index-3hk445am.js} +4 -4
- package/dist/{index-x8e50d8f.js → index-3wq9btxt.js} +5 -5
- package/dist/{index-by14cr73.js → index-3yyfftqq.js} +11 -11
- package/dist/{index-3600gm9z.js → index-4yjn3er4.js} +113 -73
- package/dist/{index-0tz2fzpq.js → index-5vsk2cpp.js} +1 -1
- package/dist/{index-90z05d0p.js → index-832w615x.js} +1 -1
- package/dist/{index-sk6p6esd.js → index-8sc7vqt7.js} +4 -4
- package/dist/{index-cd3vp8xa.js → index-98qy103c.js} +1 -1
- package/dist/{index-29ff546v.js → index-d0feqcs5.js} +6 -6
- package/dist/{index-gz001bx7.js → index-e6ncz7a6.js} +1 -1
- package/dist/{index-reyws9fy.js → index-esqcwes7.js} +1 -1
- package/dist/{index-h62j8z2r.js → index-ev2rrjfc.js} +4 -4
- package/dist/{index-sx1sppd6.js → index-gq1g9a3a.js} +8 -8
- package/dist/{index-ga5q492k.js → index-gqf8r04r.js} +1 -1
- package/dist/{index-qperbvjn.js → index-jg7sbt3v.js} +2 -2
- package/dist/{index-9mggb1nv.js → index-jrj95cce.js} +2 -2
- package/dist/{index-1wsb0e8h.js → index-kv4ntrr6.js} +5 -5
- package/dist/{index-tad3can2.js → index-m0pwswv9.js} +1 -1
- package/dist/{index-pdh4tdcq.js → index-n6aye6ny.js} +2 -2
- package/dist/{index-gapnh6tk.js → index-ngwmx6nt.js} +8 -3
- package/dist/{index-hsyczpn7.js → index-pxnzyvjc.js} +2 -2
- package/dist/{index-kn1bx21r.js → index-pzvdf7sr.js} +3 -3
- package/dist/{index-36wseasx.js → index-q7q6qp1f.js} +1 -1
- package/dist/{index-0r2jk2na.js → index-qdver0af.js} +14 -14
- package/dist/{index-zyanqxtc.js → index-s2jdky2x.js} +3 -3
- package/dist/{index-pdnan1e3.js → index-s2qsd3w9.js} +7 -7
- package/dist/{index-2ny9xwdn.js → index-s32f8y67.js} +2 -2
- package/dist/{index-hexdee98.js → index-snbpdpa3.js} +4 -4
- package/dist/{index-dhdv88e5.js → index-tebcx987.js} +1 -1
- package/dist/{index-5gqszjq9.js → index-tq20edcs.js} +3 -3
- package/dist/{index-0k283v27.js → index-tzy5h4x6.js} +1 -1
- package/dist/{index-em92bp7f.js → index-x40zr813.js} +2 -2
- package/dist/{index-sv5tn72j.js → index-xx05vta0.js} +4 -4
- package/dist/{index-82dfe8en.js → index-ywrz4wy2.js} +9 -4
- package/dist/{index-bev3zks1.js → index-ywxvdwmj.js} +9 -9
- package/dist/{index-xstbytjn.js → index-zb4h9nrk.js} +2 -2
- package/dist/{index-2vsd5064.js → index-zxj39ba2.js} +4 -4
- package/dist/{index-wpcjxzrm.js → index-zz4k3f65.js} +39 -39
- package/dist/index.js +51 -50
- package/dist/{logger-sw7z6sjz.js → logger-d7c8akh9.js} +1 -1
- package/dist/{message-fts-rowid-map-kx1bsdyg.js → message-fts-rowid-map-0xx8ge09.js} +4 -4
- package/dist/{message-index-bounded-xav3h8qe.js → message-index-bounded-f6yz4xq8.js} +10 -10
- package/dist/{message-time-backfill-hp2jgn49.js → message-time-backfill-pz5981mf.js} +2 -2
- package/dist/migration-worker.js +10 -10
- package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
- package/dist/{project-embedding-registry-f2azrq24.js → project-embedding-registry-c2sfnamh.js} +11 -11
- package/dist/raw-ordinal-warmup-worker.js +8 -8
- package/dist/{read-session-chunk-70aam2c1.js → read-session-chunk-8b1g06nz.js} +8 -8
- package/dist/{read-session-raw-04ger9zt.js → read-session-raw-3sc9231y.js} +2 -2
- package/dist/{recomp-orchestrator-xwsjrqcs.js → recomp-orchestrator-7s8nyzhy.js} +29 -29
- package/dist/{render-22ebrmep.js → render-nrfbtkkw.js} +19 -19
- package/dist/{safe-notification-target-mx5khyxf.js → safe-notification-target-d21swr3n.js} +2 -2
- package/dist/{search-archive-bqqf5p7f.js → search-archive-1ppdjfm9.js} +10 -10
- package/dist/{search-jfwb4ms3.js → search-xha0r30f.js} +22 -22
- package/dist/{send-session-notification-gamjee2f.js → send-session-notification-ykvt5k2s.js} +5 -5
- package/dist/shared/data-path.d.ts +31 -36
- package/dist/shared/data-path.d.ts.map +1 -1
- package/dist/shared/models-dev-cache.d.ts.map +1 -1
- package/dist/shared/test-temp-dir.d.ts +28 -0
- package/dist/shared/test-temp-dir.d.ts.map +1 -1
- package/dist/shared/window-geometry.d.ts.map +1 -1
- package/dist/{storage-tags-arnkn5t1.js → storage-tags-spet01yb.js} +5 -5
- package/dist/{transform-postprocess-phase-nejydt3q.js → transform-postprocess-phase-fxp1atm1.js} +30 -30
- package/dist/v2/auto-search-worker.js +5 -5
- package/dist/v2/chunk-embedding-write-worker.js +13 -13
- package/dist/v2/{compaction-marker-candidates-re14353a.js → compaction-marker-candidates-bp1bn579.js} +2 -2
- package/dist/v2/compaction-marker-candidates-worker.js +1 -1
- package/dist/v2/{compartment-chunk-embedding-0pxsrzrt.js → compartment-chunk-embedding-x6qw6mjk.js} +7 -7
- package/dist/v2/{context-4gxr2xd4.js → context-77g3jhf2.js} +43 -42
- package/dist/v2/{derive-budgets-w0815q82.js → derive-budgets-z93fdnp7.js} +3 -3
- package/dist/v2/{embedding-backfill-48qbnh7p.js → embedding-backfill-j2xj86zn.js} +12 -12
- package/dist/v2/embedding-worker-process.js +1 -1
- package/dist/v2/embedding-worker.js +4 -4
- package/dist/v2/{history-owner-ep91wgqj.js → history-owner-260djmv5.js} +2 -2
- package/dist/v2/hooks/claude-agent-instructions.d.ts +27 -0
- package/dist/v2/hooks/claude-agent-instructions.d.ts.map +1 -0
- package/dist/v2/hooks/context.d.ts.map +1 -1
- package/dist/v2/hooks/hidden-child.d.ts +15 -2
- package/dist/v2/hooks/hidden-child.d.ts.map +1 -1
- package/dist/v2/{logger-xnscpj6w.js → logger-zyf43np1.js} +1 -1
- package/dist/v2/{message-fts-rowid-map-57jh6xpb.js → message-fts-rowid-map-n8mcvcpz.js} +4 -4
- package/dist/v2/{message-index-bounded-sw8hyqw1.js → message-index-bounded-0w8eh8fc.js} +10 -10
- package/dist/v2/{message-time-backfill-baxebka0.js → message-time-backfill-ynb3vg6r.js} +2 -2
- package/dist/v2/migration-worker.js +10 -10
- package/dist/v2/{project-embedding-registry-kwahtjgg.js → project-embedding-registry-k0hjqt11.js} +11 -11
- package/dist/v2/raw-ordinal-warmup-worker.js +8 -8
- package/dist/v2/{read-session-chunk-nqkn0yb4.js → read-session-chunk-dxs1tgt9.js} +8 -8
- package/dist/v2/{read-session-raw-3e482h3c.js → read-session-raw-wg5zc29f.js} +2 -2
- package/dist/v2/{recomp-orchestrator-1de5c0zr.js → recomp-orchestrator-zc1wdv9q.js} +30 -30
- package/dist/v2/{render-g44ksejs.js → render-9knrdrjs.js} +19 -19
- package/dist/v2/{safe-notification-target-9r79xnbt.js → safe-notification-target-y55z2zat.js} +2 -2
- package/dist/v2/{search-8dc9ex0a.js → search-a2a0qs3t.js} +21 -21
- package/dist/v2/{search-archive-5ycchnyp.js → search-archive-2jmyvj69.js} +10 -10
- package/dist/v2/{send-session-notification-95p89k7q.js → send-session-notification-8g4r97bp.js} +5 -5
- package/dist/v2/{server-sa1fdt41.js → server-2adwe0be.js} +8 -3
- package/dist/v2/{server-7vrtk78d.js → server-3ap5dmhc.js} +1 -1
- package/dist/v2/{server-avfc9ezb.js → server-4r86tcs2.js} +3 -3
- package/dist/v2/{server-np27dgyt.js → server-5sbsnpkn.js} +1 -1
- package/dist/v2/{server-rz5jnhnv.js → server-6ash6z8z.js} +1 -1
- package/dist/v2/{server-beydmd68.js → server-88n85n60.js} +4 -4
- package/dist/v2/{server-dqwx9pdh.js → server-8hcxmt1w.js} +115 -75
- package/dist/v2/{server-g61hgy1y.js → server-8pdfmc27.js} +4 -4
- package/dist/v2/{server-gge95a03.js → server-8ycacd59.js} +6 -6
- package/dist/v2/{server-t5c8awdm.js → server-9ab9jnpq.js} +3 -3
- package/dist/v2/{server-r7nj8ga0.js → server-9m5r04ws.js} +5 -5
- package/dist/v2/{server-5p0bjk3y.js → server-9sf3qp02.js} +2 -2
- package/dist/v2/{server-5kgesxck.js → server-aewxmvnf.js} +2 -2
- package/dist/v2/{server-3yk44ddz.js → server-afsz3cmx.js} +1 -1
- package/dist/v2/{server-c8z2grq0.js → server-at0v0z4t.js} +1 -1
- package/dist/v2/{server-v817sf79.js → server-d07yxksx.js} +2 -2
- package/dist/v2/{server-kwtnrhv3.js → server-d706s5xn.js} +2 -2
- package/dist/v2/{server-ycvqg2s3.js → server-d9aayyxk.js} +4 -4
- package/dist/v2/{server-966dq3pd.js → server-ds8vpfkr.js} +2 -2
- package/dist/v2/{server-bb6kf05j.js → server-j8376q08.js} +9 -4
- package/dist/v2/{server-7waad75d.js → server-ja6swvmb.js} +11 -11
- package/dist/v2/{server-tmf0ayqp.js → server-jdfe07mp.js} +1 -1
- package/dist/v2/{server-6k0rnwbd.js → server-jn4pktdk.js} +4 -4
- package/dist/v2/{server-qp5sj6n5.js → server-jtq03rkb.js} +2 -2
- package/dist/v2/{server-91gb0vh8.js → server-npdey91q.js} +1 -1
- package/dist/v2/{server-vqq3g1t7.js → server-qjff96a6.js} +4 -4
- package/dist/v2/{server-4x0xq8a1.js → server-rbtx6q5v.js} +1 -1
- package/dist/v2/{server-jwydbwcx.js → server-svx20ra2.js} +4 -4
- package/dist/v2/{server-v57wr0r9.js → server-t8tmrtcg.js} +9 -9
- package/dist/v2/{server-0ayyh3mx.js → server-tzh55x6d.js} +9 -9
- package/dist/v2/{server-mxsy9h1d.js → server-x6fn9x8q.js} +2 -2
- package/dist/v2/{server-b0357as4.js → server-xepx8t43.js} +2 -2
- package/dist/v2/{server-3jc6qmdz.js → server-y8xjr8rx.js} +1 -1
- package/dist/v2/{server-rpmkz5ta.js → server-z5255w05.js} +8 -8
- package/dist/v2/server.js +5 -5
- package/dist/v2/{storage-tags-19da4c0m.js → storage-tags-50wsqg3t.js} +5 -5
- package/dist/v2/{v2-archive-reader-tgydjgfy.js → v2-archive-reader-ycjh6a2d.js} +1 -1
- package/dist/v2/{wrapup-orchestrator-3871zj7c.js → wrapup-orchestrator-fyyb28jf.js} +30 -30
- package/dist/{v2-archive-reader-2czwvyc9.js → v2-archive-reader-wec0a8fx.js} +1 -1
- package/dist/wrapup-orchestrator-560v99mk.js +54 -0
- package/package.json +1 -1
- package/src/shared/data-path.test.ts +27 -10
- package/src/shared/data-path.ts +39 -39
- package/src/shared/models-dev-cache.test.ts +11 -0
- package/src/shared/models-dev-cache.ts +7 -1
- package/src/shared/test-temp-dir.ts +59 -0
- package/src/shared/window-geometry.test.ts +20 -0
- package/src/shared/window-geometry.ts +3 -0
- package/dist/wrapup-orchestrator-m1yzmgq4.js +0 -54
|
@@ -5,39 +5,39 @@ import {
|
|
|
5
5
|
resolveMemoriesByIdsForSearch2,
|
|
6
6
|
unifiedSearch2,
|
|
7
7
|
formatSearchResults2
|
|
8
|
-
} from "./server-
|
|
8
|
+
} from "./server-ja6swvmb.js";
|
|
9
9
|
import"./server-52x68mj4.js";
|
|
10
|
-
import"./server-
|
|
11
|
-
import"./server-
|
|
10
|
+
import"./server-d07yxksx.js";
|
|
11
|
+
import"./server-d9aayyxk.js";
|
|
12
12
|
import"./server-jjvbk92s.js";
|
|
13
|
-
import"./server-
|
|
13
|
+
import"./server-z5255w05.js";
|
|
14
14
|
import"./server-4dhv7mqz.js";
|
|
15
|
-
import"./server-
|
|
16
|
-
import"./server-
|
|
15
|
+
import"./server-rbtx6q5v.js";
|
|
16
|
+
import"./server-svx20ra2.js";
|
|
17
17
|
import"./server-2amn2s73.js";
|
|
18
18
|
import"./server-qt1qqasc.js";
|
|
19
|
-
import"./server-
|
|
20
|
-
import"./server-
|
|
19
|
+
import"./server-8ycacd59.js";
|
|
20
|
+
import"./server-88n85n60.js";
|
|
21
21
|
import"./server-1zx87sdm.js";
|
|
22
|
-
import"./server-
|
|
23
|
-
import"./server-
|
|
22
|
+
import"./server-3ap5dmhc.js";
|
|
23
|
+
import"./server-d706s5xn.js";
|
|
24
24
|
import"./server-rz6g5xne.js";
|
|
25
|
-
import"./server-
|
|
26
|
-
import"./server-
|
|
27
|
-
import"./server-
|
|
28
|
-
import"./server-
|
|
25
|
+
import"./server-jtq03rkb.js";
|
|
26
|
+
import"./server-8pdfmc27.js";
|
|
27
|
+
import"./server-x6fn9x8q.js";
|
|
28
|
+
import"./server-jn4pktdk.js";
|
|
29
29
|
import"./server-fr0wbhdn.js";
|
|
30
|
-
import"./server-
|
|
31
|
-
import"./server-
|
|
32
|
-
import"./server-
|
|
33
|
-
import"./server-
|
|
30
|
+
import"./server-afsz3cmx.js";
|
|
31
|
+
import"./server-ds8vpfkr.js";
|
|
32
|
+
import"./server-xepx8t43.js";
|
|
33
|
+
import"./server-6ash6z8z.js";
|
|
34
34
|
import"./server-96ztjvkn.js";
|
|
35
35
|
import"./server-v0p37hm2.js";
|
|
36
36
|
import"./server-2ra6pwf3.js";
|
|
37
|
-
import"./server-
|
|
38
|
-
import"./server-
|
|
37
|
+
import"./server-5sbsnpkn.js";
|
|
38
|
+
import"./server-y8xjr8rx.js";
|
|
39
39
|
import"./server-gzy5w8ya.js";
|
|
40
|
-
import"./server-
|
|
40
|
+
import"./server-j8376q08.js";
|
|
41
41
|
import"./server-pavzsdc6.js";
|
|
42
42
|
import"./server-z4p0ry94.js";
|
|
43
43
|
import"./server-1d042x6w.js";
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
2
|
renderSearchArchive2,
|
|
3
3
|
renderSearchArchiveOffThread2
|
|
4
|
-
} from "./server-
|
|
5
|
-
import"./server-
|
|
4
|
+
} from "./server-9m5r04ws.js";
|
|
5
|
+
import"./server-9ab9jnpq.js";
|
|
6
6
|
import"./server-52x68mj4.js";
|
|
7
|
-
import"./server-
|
|
8
|
-
import"./server-
|
|
7
|
+
import"./server-8ycacd59.js";
|
|
8
|
+
import"./server-88n85n60.js";
|
|
9
9
|
import"./server-1zx87sdm.js";
|
|
10
|
-
import"./server-
|
|
10
|
+
import"./server-3ap5dmhc.js";
|
|
11
11
|
import"./server-rz6g5xne.js";
|
|
12
|
-
import"./server-
|
|
13
|
-
import"./server-
|
|
12
|
+
import"./server-xepx8t43.js";
|
|
13
|
+
import"./server-6ash6z8z.js";
|
|
14
14
|
import"./server-96ztjvkn.js";
|
|
15
15
|
import"./server-v0p37hm2.js";
|
|
16
16
|
import"./server-2ra6pwf3.js";
|
|
17
|
-
import"./server-
|
|
18
|
-
import"./server-
|
|
17
|
+
import"./server-5sbsnpkn.js";
|
|
18
|
+
import"./server-y8xjr8rx.js";
|
|
19
19
|
import"./server-gzy5w8ya.js";
|
|
20
|
-
import"./server-
|
|
20
|
+
import"./server-j8376q08.js";
|
|
21
21
|
import"./server-pavzsdc6.js";
|
|
22
22
|
import"./server-z4p0ry94.js";
|
|
23
23
|
import"./server-1d042x6w.js";
|
package/dist/v2/{send-session-notification-95p89k7q.js → send-session-notification-8g4r97bp.js}
RENAMED
|
@@ -8,16 +8,16 @@ import {
|
|
|
8
8
|
clearIgnoredMessages2,
|
|
9
9
|
observeIgnoredNotificationEvent2,
|
|
10
10
|
sendStatusNotification2
|
|
11
|
-
} from "./server-
|
|
11
|
+
} from "./server-qjff96a6.js";
|
|
12
12
|
import"./server-qt1qqasc.js";
|
|
13
|
-
import"./server-
|
|
14
|
-
import"./server-
|
|
15
|
-
import"./server-
|
|
13
|
+
import"./server-3ap5dmhc.js";
|
|
14
|
+
import"./server-npdey91q.js";
|
|
15
|
+
import"./server-6ash6z8z.js";
|
|
16
16
|
import"./server-96ztjvkn.js";
|
|
17
17
|
import"./server-v0p37hm2.js";
|
|
18
18
|
import"./server-2ra6pwf3.js";
|
|
19
19
|
import"./server-gzy5w8ya.js";
|
|
20
|
-
import"./server-
|
|
20
|
+
import"./server-j8376q08.js";
|
|
21
21
|
import"./server-pavzsdc6.js";
|
|
22
22
|
import"./server-z4p0ry94.js";
|
|
23
23
|
import"./server-1d042x6w.js";
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
getMagicContextStorageDir,
|
|
6
6
|
sessionLog2
|
|
7
|
-
} from "./server-
|
|
7
|
+
} from "./server-j8376q08.js";
|
|
8
8
|
import {
|
|
9
9
|
modelRefLookupOrder
|
|
10
10
|
} from "./server-avwt563y.js";
|
|
@@ -29,7 +29,8 @@ var PROVIDER_GEOMETRY = {
|
|
|
29
29
|
anthropic: "shared_truncating",
|
|
30
30
|
xai: "shared_truncating",
|
|
31
31
|
google: "separate",
|
|
32
|
-
"google-antigravity": "separate"
|
|
32
|
+
"google-antigravity": "separate",
|
|
33
|
+
"antigravity-cli": "separate"
|
|
33
34
|
};
|
|
34
35
|
var geometryClampLogSeen = new Set;
|
|
35
36
|
function isFinitePositive(value) {
|
|
@@ -203,7 +204,11 @@ var MAX_SANE_LIMIT = 3000000;
|
|
|
203
204
|
function isSaneLimit(limit) {
|
|
204
205
|
return typeof limit === "number" && limit >= MIN_SANE_LIMIT && limit <= MAX_SANE_LIMIT;
|
|
205
206
|
}
|
|
206
|
-
var SEPARATE_OUTPUT_QUOTA_PROVIDERS = new Set([
|
|
207
|
+
var SEPARATE_OUTPUT_QUOTA_PROVIDERS = new Set([
|
|
208
|
+
"google",
|
|
209
|
+
"google-antigravity",
|
|
210
|
+
"antigravity-cli"
|
|
211
|
+
]);
|
|
207
212
|
var MIN_PLAUSIBLE_CONTEXT_LIMIT2 = 1024;
|
|
208
213
|
var OUTPUT_RESERVE_CAP_RATIO2 = 0.25;
|
|
209
214
|
var outputReserveConfig;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
estimateTokens
|
|
3
|
-
} from "./server-
|
|
3
|
+
} from "./server-y8xjr8rx.js";
|
|
4
4
|
import {
|
|
5
5
|
getTagById2
|
|
6
|
-
} from "./server-
|
|
6
|
+
} from "./server-88n85n60.js";
|
|
7
7
|
import {
|
|
8
8
|
expandToolPart,
|
|
9
9
|
visitRawSessionMessages2,
|
|
10
10
|
readRawSessionMessageById2
|
|
11
|
-
} from "./server-
|
|
11
|
+
} from "./server-8ycacd59.js";
|
|
12
12
|
|
|
13
13
|
// src/tools/ctx-expand/render.ts
|
|
14
14
|
import { createHash } from "node:crypto";
|
|
@@ -10,13 +10,13 @@ import {
|
|
|
10
10
|
tokenCountUsesByteBound,
|
|
11
11
|
estimateTokens,
|
|
12
12
|
createTokenCountMemo
|
|
13
|
-
} from "./server-
|
|
13
|
+
} from "./server-y8xjr8rx.js";
|
|
14
14
|
import {
|
|
15
15
|
getHarness2
|
|
16
16
|
} from "./server-pavzsdc6.js";
|
|
17
17
|
import {
|
|
18
18
|
sessionLog2
|
|
19
|
-
} from "./server-
|
|
19
|
+
} from "./server-j8376q08.js";
|
|
20
20
|
import {
|
|
21
21
|
stableStringify,
|
|
22
22
|
stableStringifyHash,
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
getSessionToolDefinitionTokens,
|
|
26
26
|
tagOrderConstraintIndex,
|
|
27
27
|
tagIdentityRevisionKey
|
|
28
|
-
} from "./server-
|
|
28
|
+
} from "./server-xepx8t43.js";
|
|
29
29
|
import {
|
|
30
30
|
resolveModelConfigValue,
|
|
31
31
|
DEFAULT_PROTECTED_TOOLS,
|
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
} from "./server-avwt563y.js";
|
|
45
45
|
import {
|
|
46
46
|
logSlowWriteTransaction
|
|
47
|
-
} from "./server-
|
|
47
|
+
} from "./server-5sbsnpkn.js";
|
|
48
48
|
|
|
49
49
|
// src/features/magic-context/storage-tags.ts
|
|
50
50
|
import { isMainThread } from "node:worker_threads";
|
|
@@ -3,11 +3,10 @@ import {
|
|
|
3
3
|
harnessOwnsOpenCodeStore2
|
|
4
4
|
} from "./server-pavzsdc6.js";
|
|
5
5
|
import {
|
|
6
|
-
|
|
7
|
-
getProjectMagicContextHistorianDir,
|
|
6
|
+
getMagicContextHistorianSessionDir,
|
|
8
7
|
log2,
|
|
9
8
|
sessionLog2
|
|
10
|
-
} from "./server-
|
|
9
|
+
} from "./server-j8376q08.js";
|
|
11
10
|
import {
|
|
12
11
|
sanitizeDiagnosticText
|
|
13
12
|
} from "./server-z4p0ry94.js";
|
|
@@ -20,13 +19,13 @@ import {
|
|
|
20
19
|
cortexKitProjectConfigBasePath,
|
|
21
20
|
resolveLegacyConfigSourcesForHarness,
|
|
22
21
|
loadPluginConfigDetailed
|
|
23
|
-
} from "./server-
|
|
22
|
+
} from "./server-9sf3qp02.js";
|
|
24
23
|
import {
|
|
25
24
|
catalogOutputReserve,
|
|
26
25
|
getSdkContextLimit,
|
|
27
26
|
modelSupportsVision,
|
|
28
27
|
getSdkOutputLimit
|
|
29
|
-
} from "./server-
|
|
28
|
+
} from "./server-2adwe0be.js";
|
|
30
29
|
import {
|
|
31
30
|
withContentLanguageDirective,
|
|
32
31
|
buildPrimaryLanguageDirective,
|
|
@@ -48,7 +47,7 @@ import {
|
|
|
48
47
|
RawOrdinalsNotReady2,
|
|
49
48
|
dropRawSessionOrdinalCheckpoints2,
|
|
50
49
|
runSessionWarmupWorker
|
|
51
|
-
} from "./server-
|
|
50
|
+
} from "./server-6ash6z8z.js";
|
|
52
51
|
import {
|
|
53
52
|
providerMass,
|
|
54
53
|
calibrationForModelKey,
|
|
@@ -101,15 +100,15 @@ import {
|
|
|
101
100
|
foldShrunkPartTags2,
|
|
102
101
|
getTagNumberByMessageId2,
|
|
103
102
|
getActiveTagsBySession2
|
|
104
|
-
} from "./server-
|
|
103
|
+
} from "./server-88n85n60.js";
|
|
105
104
|
import {
|
|
106
105
|
hasMeaningfulUserText2,
|
|
107
106
|
estimateTokens,
|
|
108
107
|
estimateFixedPromptTokens
|
|
109
|
-
} from "./server-
|
|
108
|
+
} from "./server-y8xjr8rx.js";
|
|
110
109
|
import {
|
|
111
110
|
BoundedSessionMap
|
|
112
|
-
} from "./server-
|
|
111
|
+
} from "./server-xepx8t43.js";
|
|
113
112
|
import {
|
|
114
113
|
resolveOpenCodeDbPath,
|
|
115
114
|
assertOpenCodeStoreGeneration,
|
|
@@ -120,7 +119,7 @@ import {
|
|
|
120
119
|
openCodeDbExists,
|
|
121
120
|
withReadOnlySessionDb,
|
|
122
121
|
getMessageTimesFromOpenCodeDb
|
|
123
|
-
} from "./server-
|
|
122
|
+
} from "./server-3ap5dmhc.js";
|
|
124
123
|
import {
|
|
125
124
|
removeUnsupportedCommitHashes,
|
|
126
125
|
completedToolArcCrossesBoundary,
|
|
@@ -156,14 +155,14 @@ import {
|
|
|
156
155
|
getRawSessionTagKeysThrough2,
|
|
157
156
|
getLegacyProtectedTailStartOrdinal2,
|
|
158
157
|
readSessionChunk2
|
|
159
|
-
} from "./server-
|
|
158
|
+
} from "./server-8ycacd59.js";
|
|
160
159
|
import {
|
|
161
160
|
clearCompressionDepth,
|
|
162
161
|
clearCompressionDepthRange,
|
|
163
162
|
toMessageIndexSource,
|
|
164
163
|
clearIndexedMessagesInTransaction,
|
|
165
164
|
indexSourcesAfterOrdinal
|
|
166
|
-
} from "./server-
|
|
165
|
+
} from "./server-svx20ra2.js";
|
|
167
166
|
import {
|
|
168
167
|
COMPARTMENT_LEASE_RENEWAL_MS,
|
|
169
168
|
getCompartmentLeaseBlocker,
|
|
@@ -208,7 +207,7 @@ import {
|
|
|
208
207
|
getProjectState,
|
|
209
208
|
recordSubagentInvocation,
|
|
210
209
|
getLatestHistorianInvocationId
|
|
211
|
-
} from "./server-
|
|
210
|
+
} from "./server-t8tmrtcg.js";
|
|
212
211
|
import {
|
|
213
212
|
invalidateAutoEmbedSession
|
|
214
213
|
} from "./server-2amn2s73.js";
|
|
@@ -221,7 +220,7 @@ import {
|
|
|
221
220
|
replaceCompartmentChunkEmbeddings2,
|
|
222
221
|
deleteChunkEmbedBackoffForSession2,
|
|
223
222
|
chunkWindowSourceKey2
|
|
224
|
-
} from "./server-
|
|
223
|
+
} from "./server-8pdfmc27.js";
|
|
225
224
|
import {
|
|
226
225
|
isMarkerCandidateBasisCurrent2,
|
|
227
226
|
invalidateMarkerCandidateBasis2,
|
|
@@ -232,18 +231,18 @@ import {
|
|
|
232
231
|
certifiedMarkerReferenceFloor2,
|
|
233
232
|
readMarkerReferenceRows2,
|
|
234
233
|
readKnownMarkerReferenceRows2
|
|
235
|
-
} from "./server-
|
|
234
|
+
} from "./server-at0v0z4t.js";
|
|
236
235
|
import {
|
|
237
236
|
shouldSkipHomeProjectMemory,
|
|
238
237
|
resolveProjectIdentity
|
|
239
|
-
} from "./server-
|
|
238
|
+
} from "./server-afsz3cmx.js";
|
|
240
239
|
import {
|
|
241
240
|
contentSha2562,
|
|
242
241
|
enqueueShadowEmbeddingItems2,
|
|
243
242
|
getProjectChunkEmbeddingModelId2,
|
|
244
243
|
getProjectEmbeddingMaxInputTokens2,
|
|
245
244
|
embedItemsWindowBounded2
|
|
246
|
-
} from "./server-
|
|
245
|
+
} from "./server-z5255w05.js";
|
|
247
246
|
import {
|
|
248
247
|
V2_MEMORY_CATEGORIES,
|
|
249
248
|
CATEGORY_PRIORITY,
|
|
@@ -262,13 +261,13 @@ import {
|
|
|
262
261
|
userFacingFailureCode,
|
|
263
262
|
promoteSessionFactsDurable,
|
|
264
263
|
embedPromotedFacts
|
|
265
|
-
} from "./server-
|
|
264
|
+
} from "./server-d07yxksx.js";
|
|
266
265
|
import {
|
|
267
266
|
getSchemaFenceRejection,
|
|
268
267
|
LATEST_SUPPORTED_VERSION,
|
|
269
268
|
getPersistedSchemaVersion,
|
|
270
269
|
openDatabase
|
|
271
|
-
} from "./server-
|
|
270
|
+
} from "./server-tzh55x6d.js";
|
|
272
271
|
import {
|
|
273
272
|
parseCompartmentOutput,
|
|
274
273
|
resolveWorkspaceShareCategories,
|
|
@@ -277,7 +276,7 @@ import {
|
|
|
277
276
|
resolveStoredPathWorkspaceIdentity,
|
|
278
277
|
sourceNameForMemory,
|
|
279
278
|
computeWorkspaceEpochFingerprint
|
|
280
|
-
} from "./server-
|
|
279
|
+
} from "./server-jn4pktdk.js";
|
|
281
280
|
import {
|
|
282
281
|
FAIL_CLOSED_DOCTOR_COMMAND
|
|
283
282
|
} from "./server-468mya5v.js";
|
|
@@ -285,7 +284,7 @@ import {
|
|
|
285
284
|
getSessionNotes,
|
|
286
285
|
getReadySmartNotes,
|
|
287
286
|
insertPrimerCandidates
|
|
288
|
-
} from "./server-
|
|
287
|
+
} from "./server-rbtx6q5v.js";
|
|
289
288
|
import {
|
|
290
289
|
pushNotification2
|
|
291
290
|
} from "./server-x8a7jmkh.js";
|
|
@@ -293,10 +292,10 @@ import {
|
|
|
293
292
|
deriveTriggerBudget2,
|
|
294
293
|
resolveHistorianProducerLimits2,
|
|
295
294
|
producerSourceLocalBudget2
|
|
296
|
-
} from "./server-
|
|
295
|
+
} from "./server-aewxmvnf.js";
|
|
297
296
|
import {
|
|
298
297
|
sendStatusNotification2
|
|
299
|
-
} from "./server-
|
|
298
|
+
} from "./server-qjff96a6.js";
|
|
300
299
|
import {
|
|
301
300
|
retreatPastHostUnservedRows,
|
|
302
301
|
snapTerminalCompartmentToServedRow,
|
|
@@ -316,7 +315,7 @@ import {
|
|
|
316
315
|
import {
|
|
317
316
|
logSlowWriteTransaction,
|
|
318
317
|
WriteTransactionSteps
|
|
319
|
-
} from "./server-
|
|
318
|
+
} from "./server-5sbsnpkn.js";
|
|
320
319
|
|
|
321
320
|
// src/config/live-snapshot.ts
|
|
322
321
|
import { createHash } from "node:crypto";
|
|
@@ -2728,6 +2727,19 @@ function withoutHistorianTailCache(body) {
|
|
|
2728
2727
|
return body;
|
|
2729
2728
|
}
|
|
2730
2729
|
|
|
2730
|
+
// src/v2/hooks/claude-agent-instructions.ts
|
|
2731
|
+
var CLAUDE_AGENT_PROVIDER_ID = "claude-agent";
|
|
2732
|
+
function deliversInstructionsInUserMessage(providerID) {
|
|
2733
|
+
return providerID === CLAUDE_AGENT_PROVIDER_ID;
|
|
2734
|
+
}
|
|
2735
|
+
function claudeAgentInstructionsText(system) {
|
|
2736
|
+
return `Instructions for this task:
|
|
2737
|
+
|
|
2738
|
+
<instructions>
|
|
2739
|
+
${system}
|
|
2740
|
+
</instructions>`;
|
|
2741
|
+
}
|
|
2742
|
+
|
|
2731
2743
|
// src/v2/hooks/hidden-child.ts
|
|
2732
2744
|
var HIDDEN_HISTORIAN_AGENT = "historian";
|
|
2733
2745
|
var HIDDEN_DREAMER_AGENT = "dreamer-classifier";
|
|
@@ -2835,14 +2847,14 @@ class HiddenAgentStepLimit extends Error {
|
|
|
2835
2847
|
this.cap = cap;
|
|
2836
2848
|
}
|
|
2837
2849
|
}
|
|
2838
|
-
function
|
|
2839
|
-
const message = draft.messages.at(-1);
|
|
2850
|
+
function userTexts(message) {
|
|
2840
2851
|
if (!message || message.role !== undefined && message.role !== "user")
|
|
2841
|
-
return;
|
|
2852
|
+
return [];
|
|
2842
2853
|
const content = message.content;
|
|
2843
2854
|
if (typeof content === "string" && content.length > 0)
|
|
2844
|
-
return content;
|
|
2855
|
+
return [content];
|
|
2845
2856
|
const parts = Array.isArray(content) ? content : Array.isArray(message.parts) ? message.parts : [];
|
|
2857
|
+
const texts = [];
|
|
2846
2858
|
for (const part of parts) {
|
|
2847
2859
|
if (!part || typeof part !== "object")
|
|
2848
2860
|
continue;
|
|
@@ -2850,10 +2862,10 @@ function newestUserText(draft) {
|
|
|
2850
2862
|
if (typeof record.text !== "string" || record.text.length === 0)
|
|
2851
2863
|
continue;
|
|
2852
2864
|
if (record.type === undefined || record.type === "text" || record.type === "input_text") {
|
|
2853
|
-
|
|
2865
|
+
texts.push(record.text);
|
|
2854
2866
|
}
|
|
2855
2867
|
}
|
|
2856
|
-
return;
|
|
2868
|
+
return texts;
|
|
2857
2869
|
}
|
|
2858
2870
|
function authoredOptions(attempt) {
|
|
2859
2871
|
const cap = attempt.identity.maxOutputTokens;
|
|
@@ -2889,6 +2901,33 @@ function markerCandidates(text) {
|
|
|
2889
2901
|
const summary = hostCheckpointSummary(text);
|
|
2890
2902
|
return [text, stripped, ...summary === undefined ? [] : [summary]];
|
|
2891
2903
|
}
|
|
2904
|
+
function carriesMarker(texts, marker) {
|
|
2905
|
+
return texts.some((text) => markerCandidates(text).includes(marker));
|
|
2906
|
+
}
|
|
2907
|
+
function sharedPrefixBytes(a, b) {
|
|
2908
|
+
let offset = 0;
|
|
2909
|
+
while (offset < a.length && offset < b.length && a[offset] === b[offset])
|
|
2910
|
+
offset++;
|
|
2911
|
+
return offset;
|
|
2912
|
+
}
|
|
2913
|
+
function closestText(texts, markers) {
|
|
2914
|
+
let closest = texts[0];
|
|
2915
|
+
let best = 0;
|
|
2916
|
+
for (const text of texts) {
|
|
2917
|
+
for (const candidate of markerCandidates(text)) {
|
|
2918
|
+
const bytes = Buffer.from(candidate, "utf8");
|
|
2919
|
+
for (const marker of markers) {
|
|
2920
|
+
const shared = sharedPrefixBytes(bytes, Buffer.from(marker, "utf8"));
|
|
2921
|
+
if (shared > best) {
|
|
2922
|
+
best = shared;
|
|
2923
|
+
closest = text;
|
|
2924
|
+
}
|
|
2925
|
+
}
|
|
2926
|
+
}
|
|
2927
|
+
}
|
|
2928
|
+
return closest;
|
|
2929
|
+
}
|
|
2930
|
+
var REFUSAL_PART_DIGESTS = 8;
|
|
2892
2931
|
function textDigest(text) {
|
|
2893
2932
|
return {
|
|
2894
2933
|
length: text.length,
|
|
@@ -2898,9 +2937,7 @@ function textDigest(text) {
|
|
|
2898
2937
|
function firstDifference(a, b) {
|
|
2899
2938
|
const left = Buffer.from(a, "utf8");
|
|
2900
2939
|
const right = Buffer.from(b, "utf8");
|
|
2901
|
-
|
|
2902
|
-
while (offset < left.length && offset < right.length && left[offset] === right[offset])
|
|
2903
|
-
offset++;
|
|
2940
|
+
const offset = sharedPrefixBytes(left, right);
|
|
2904
2941
|
if (offset === left.length && offset === right.length)
|
|
2905
2942
|
return;
|
|
2906
2943
|
return {
|
|
@@ -2984,15 +3021,14 @@ class HiddenChildHook {
|
|
|
2984
3021
|
}
|
|
2985
3022
|
return marker;
|
|
2986
3023
|
}
|
|
2987
|
-
refuse(reason, draft,
|
|
2988
|
-
const
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
});
|
|
3024
|
+
refuse(reason, draft, texts, inFlight, code = "hidden_prompt_unrecognized") {
|
|
3025
|
+
const markers = [...this.attempts.values()].filter((attempt) => attempt.childSessionId === draft.sessionID && attempt.marker).map((attempt) => ({ attempt, marker: attempt.marker }));
|
|
3026
|
+
const raw = texts === undefined ? undefined : closestText(texts, markers.map(({ marker }) => marker));
|
|
3027
|
+
const registered = markers.map(({ attempt, marker }) => ({
|
|
3028
|
+
...textDigest(marker),
|
|
3029
|
+
shaped: attempt.shaped,
|
|
3030
|
+
...raw === undefined ? {} : { first_difference: firstDifference(raw, marker) }
|
|
3031
|
+
}));
|
|
2996
3032
|
const newest = draft.messages.at(-1);
|
|
2997
3033
|
const summary = raw === undefined ? undefined : hostCheckpointSummary(raw);
|
|
2998
3034
|
this.note(`[magic-context] hidden child refused: ${reason} ${JSON.stringify({
|
|
@@ -3000,6 +3036,7 @@ class HiddenChildHook {
|
|
|
3000
3036
|
messages: draft.messages.length,
|
|
3001
3037
|
newest_role: newest?.role ?? null,
|
|
3002
3038
|
received: raw === undefined ? null : textDigest(raw),
|
|
3039
|
+
...texts !== undefined && texts.length > 1 ? { received_parts: texts.slice(0, REFUSAL_PART_DIGESTS).map(textDigest) } : {},
|
|
3003
3040
|
checkpoint_summary: summary === undefined ? null : textDigest(summary),
|
|
3004
3041
|
registered,
|
|
3005
3042
|
active: this.active.has(draft.sessionID),
|
|
@@ -3012,40 +3049,50 @@ class HiddenChildHook {
|
|
|
3012
3049
|
}
|
|
3013
3050
|
throw refusal;
|
|
3014
3051
|
}
|
|
3015
|
-
|
|
3052
|
+
firstMessageParts(attempt, draft, texts, system) {
|
|
3016
3053
|
const parts = calibratedParts(attempt);
|
|
3017
3054
|
if (!parts)
|
|
3018
|
-
this.refuse("Hidden completion accepts text-only calibrated prompts", draft,
|
|
3019
|
-
|
|
3055
|
+
this.refuse("Hidden completion accepts text-only calibrated prompts", draft, texts);
|
|
3056
|
+
if (!deliversInstructionsInUserMessage(draft.model.providerID))
|
|
3057
|
+
return parts;
|
|
3058
|
+
return [{ type: "text", text: claudeAgentInstructionsText(system) }, ...parts];
|
|
3020
3059
|
}
|
|
3021
3060
|
apply(draft) {
|
|
3022
3061
|
if (!this.owns(draft.sessionID)) {
|
|
3023
3062
|
if (isChildOfDisposedInstance(draft.sessionID)) {
|
|
3024
|
-
this.refuse(`Refusing a turn of a Magic Context hidden child of a disposed plugin instance: ${HIDDEN_RUN_DISPOSED_REASON}`, draft,
|
|
3063
|
+
this.refuse(`Refusing a turn of a Magic Context hidden child of a disposed plugin instance: ${HIDDEN_RUN_DISPOSED_REASON}`, draft, userTexts(draft.messages.at(-1)), undefined, "hidden_instance_disposed");
|
|
3025
3064
|
}
|
|
3026
3065
|
if (hiddenAgentAllowedTools(draft.agent) !== undefined) {
|
|
3027
|
-
this.refuse("Refusing a Magic Context hidden-agent turn this instance did not register", draft,
|
|
3066
|
+
this.refuse("Refusing a Magic Context hidden-agent turn this instance did not register", draft, userTexts(draft.messages.at(-1)));
|
|
3028
3067
|
}
|
|
3029
3068
|
return false;
|
|
3030
3069
|
}
|
|
3031
|
-
const
|
|
3032
|
-
|
|
3033
|
-
for (const
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3070
|
+
const texts = userTexts(draft.messages.at(-1));
|
|
3071
|
+
const named = new Set;
|
|
3072
|
+
for (const text of texts) {
|
|
3073
|
+
for (const candidate of markerCandidates(text)) {
|
|
3074
|
+
const registered = this.attempts.get(candidate);
|
|
3075
|
+
if (registered) {
|
|
3076
|
+
named.add(registered);
|
|
3077
|
+
break;
|
|
3078
|
+
}
|
|
3079
|
+
}
|
|
3080
|
+
}
|
|
3081
|
+
if (named.size > 1) {
|
|
3082
|
+
this.refuse("Refusing a prompt that names more than one Magic Context hidden run", draft, texts);
|
|
3037
3083
|
}
|
|
3084
|
+
const attempt = [...named][0];
|
|
3038
3085
|
const current = this.active.get(draft.sessionID);
|
|
3039
3086
|
const selected = attempt ?? current;
|
|
3040
3087
|
if (!selected || selected.childSessionId !== draft.sessionID || attempt && current && current !== attempt) {
|
|
3041
|
-
this.refuse("Refusing an unregistered prompt on a Magic Context hidden-run session", draft,
|
|
3088
|
+
this.refuse("Refusing an unregistered prompt on a Magic Context hidden-run session", draft, texts);
|
|
3042
3089
|
}
|
|
3043
3090
|
if (selected.request.signal?.aborted) {
|
|
3044
3091
|
throw new Error("Hidden completion prompt aborted");
|
|
3045
3092
|
}
|
|
3046
3093
|
if (!selected.shaped) {
|
|
3047
3094
|
if (!attempt)
|
|
3048
|
-
this.refuse("Hidden child first step requires a registered marker", draft,
|
|
3095
|
+
this.refuse("Hidden child first step requires a registered marker", draft, texts);
|
|
3049
3096
|
this.active.set(draft.sessionID, selected);
|
|
3050
3097
|
}
|
|
3051
3098
|
const steps = (selected.steps ?? 0) + 1;
|
|
@@ -3057,29 +3104,27 @@ class HiddenChildHook {
|
|
|
3057
3104
|
selected.steps = steps;
|
|
3058
3105
|
const system = typeof selected.request.body.system === "string" ? selected.request.body.system : selected.identity.system;
|
|
3059
3106
|
const blockedRead = needsBlockedRead(selected.identity.agent, draft.model.providerID) && draft.tools.read !== undefined;
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
type: "text",
|
|
3063
|
-
text: blockedRead ? withBlockedReadInstruction(system, selected.identity) : system
|
|
3064
|
-
}
|
|
3065
|
-
];
|
|
3107
|
+
const systemText = blockedRead ? withBlockedReadInstruction(system, selected.identity) : system;
|
|
3108
|
+
draft.system = [{ type: "text", text: systemText }];
|
|
3066
3109
|
if (!selected.shaped) {
|
|
3067
3110
|
draft.messages = [
|
|
3068
|
-
{
|
|
3111
|
+
{
|
|
3112
|
+
role: "user",
|
|
3113
|
+
content: this.firstMessageParts(selected, draft, texts, systemText)
|
|
3114
|
+
}
|
|
3069
3115
|
];
|
|
3070
3116
|
} else {
|
|
3071
3117
|
let start = -1;
|
|
3072
3118
|
draft.messages.forEach((message, index) => {
|
|
3073
|
-
|
|
3074
|
-
if (text !== undefined && selected.marker !== undefined && markerCandidates(text).includes(selected.marker))
|
|
3119
|
+
if (selected.marker !== undefined && carriesMarker(userTexts(message), selected.marker))
|
|
3075
3120
|
start = index;
|
|
3076
3121
|
});
|
|
3077
3122
|
const first = draft.messages[start];
|
|
3078
3123
|
if (!first) {
|
|
3079
|
-
this.refuse("Hidden child history does not contain this run's registered marker", draft,
|
|
3124
|
+
this.refuse("Hidden child history does not contain this run's registered marker", draft, texts);
|
|
3080
3125
|
}
|
|
3081
3126
|
draft.messages = [
|
|
3082
|
-
{ ...first, content: this.
|
|
3127
|
+
{ ...first, content: this.firstMessageParts(selected, draft, texts, systemText) },
|
|
3083
3128
|
...draft.messages.slice(start + 1)
|
|
3084
3129
|
];
|
|
3085
3130
|
}
|
|
@@ -12505,9 +12550,6 @@ function fitHistorianPrompt(args) {
|
|
|
12505
12550
|
}
|
|
12506
12551
|
|
|
12507
12552
|
// src/hooks/magic-context/compartment-runner-historian.ts
|
|
12508
|
-
function historianResponseDumpDir(directory) {
|
|
12509
|
-
return getProjectMagicContextHistorianDir(directory);
|
|
12510
|
-
}
|
|
12511
12553
|
var MAX_HISTORIAN_RETRIES = 2;
|
|
12512
12554
|
var unknownProducerWindows = new Set;
|
|
12513
12555
|
var HISTORIAN_REASONING_PART_TYPES = new Set(["reasoning", "thinking", "redacted_thinking"]);
|
|
@@ -12981,7 +13023,7 @@ async function runHistorianPrompt(args) {
|
|
|
12981
13023
|
invocationId: invocationId ?? undefined
|
|
12982
13024
|
};
|
|
12983
13025
|
}
|
|
12984
|
-
const dumpPath = dumpHistorianResponse(parentSessionId,
|
|
13026
|
+
const dumpPath = dumpHistorianResponse(parentSessionId, dumpLabel ?? "historian-response", result);
|
|
12985
13027
|
return { ok: true, result, dumpPath, invocationId: invocationId ?? undefined };
|
|
12986
13028
|
} catch (modelError) {
|
|
12987
13029
|
hiddenModelCooldowns.record(handle?.attemptedModel ?? toModelEntry(modelOverride)?.model, modelError);
|
|
@@ -13135,14 +13177,12 @@ function cleanupHistorianDump(sessionId, dumpPath) {
|
|
|
13135
13177
|
});
|
|
13136
13178
|
}
|
|
13137
13179
|
}
|
|
13138
|
-
function dumpHistorianResponse(sessionId,
|
|
13180
|
+
function dumpHistorianResponse(sessionId, label, text) {
|
|
13139
13181
|
try {
|
|
13140
|
-
const dumpDir =
|
|
13182
|
+
const dumpDir = getMagicContextHistorianSessionDir(sessionId);
|
|
13141
13183
|
mkdirSync(dumpDir, { recursive: true });
|
|
13142
|
-
ensureCortexKitArtifactGitignore(directory);
|
|
13143
|
-
const safeSessionId = sanitizeDumpName(sessionId);
|
|
13144
13184
|
const safeLabel = sanitizeDumpName(label);
|
|
13145
|
-
const dumpPath = join(dumpDir, `${
|
|
13185
|
+
const dumpPath = join(dumpDir, `${safeLabel}-${Date.now()}.xml`);
|
|
13146
13186
|
writeFileSync(dumpPath, text, "utf8");
|
|
13147
13187
|
sessionLog2(sessionId, "compartment agent: historian response dumped", {
|
|
13148
13188
|
label,
|