@cortexkit/opencode-magic-context 0.49.95 → 0.49.97
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-4ynkaf0d.js → announcement-8nj2jd87.js} +5 -5
- package/dist/auto-search-worker.js +5 -5
- package/dist/chunk-embedding-write-worker.js +16 -16
- package/dist/{compaction-marker-candidates-1ndjqh9k.js → compaction-marker-candidates-a4b0anvv.js} +3 -3
- package/dist/compaction-marker-candidates-worker.js +1 -1
- package/dist/{compartment-chunk-embedding-4nn3hsw2.js → compartment-chunk-embedding-re2cw7y3.js} +8 -8
- package/dist/config/removed-agent-config.d.ts +1 -1
- package/dist/config/removed-agent-config.d.ts.map +1 -1
- package/dist/config/schema/magic-context.d.ts +0 -75
- package/dist/config/schema/magic-context.d.ts.map +1 -1
- package/dist/{conflict-warning-hook-exf96bpt.js → conflict-warning-hook-wcq55y61.js} +8 -8
- package/dist/{context-h9x9m2p3.js → context-br04s0b6.js} +86 -104
- package/dist/{derive-budgets-hzzq71rm.js → derive-budgets-g1sy72e8.js} +5 -5
- package/dist/embedding-backfill-pdymqbnh.js +29 -0
- package/dist/embedding-worker-process.js +2 -2
- package/dist/embedding-worker.js +8 -8
- package/dist/features/magic-context/dreamer/token-budget.d.ts +2 -2
- package/dist/features/magic-context/dreamer/token-budget.d.ts.map +1 -1
- package/dist/features/magic-context/search-rerank.d.ts +2 -2
- package/dist/features/magic-context/search-rerank.d.ts.map +1 -1
- package/dist/features/magic-context/search.d.ts.map +1 -1
- package/dist/features/magic-context/storage-native-replay.d.ts +7 -0
- package/dist/features/magic-context/storage-native-replay.d.ts.map +1 -1
- package/dist/{history-owner-xqfsvf9k.js → history-owner-74826t4n.js} +3 -3
- package/dist/hooks/magic-context/apply-operations.d.ts.map +1 -1
- package/dist/hooks/magic-context/hook.d.ts.map +1 -1
- package/dist/hooks/magic-context/inject-compartments.d.ts +6 -1
- package/dist/hooks/magic-context/inject-compartments.d.ts.map +1 -1
- package/dist/hooks/magic-context/tag-messages.d.ts +11 -1
- package/dist/hooks/magic-context/tag-messages.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-compartment-phase.d.ts +2 -1
- package/dist/hooks/magic-context/transform-compartment-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +1 -0
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform.d.ts +2 -0
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/{index-3ywyr4zx.js → index-0bjj9yf3.js} +2 -2
- package/dist/{index-7skgrbsg.js → index-0sqhg9nf.js} +41 -21
- package/dist/{index-nxxzeq4y.js → index-0ve29s6f.js} +1 -1
- package/dist/{index-ywrz4wy2.js → index-3fhb0j32.js} +1 -1
- package/dist/{index-gqf8r04r.js → index-3n4j5rqc.js} +1 -1
- package/dist/{index-xsqw8kbd.js → index-45qgkg8j.js} +2 -2
- package/dist/{index-5df2fw5b.js → index-6mryx739.js} +1 -1
- package/dist/{index-tedck05r.js → index-7m2tnk8q.js} +10 -10
- package/dist/{index-r4y0dczp.js → index-7sdns2ww.js} +2 -2
- package/dist/{index-mjy2k9jr.js → index-880a24vd.js} +1 -1
- package/dist/{index-esacb9d0.js → index-89bkkgcn.js} +4 -4
- package/dist/{index-s32f8y67.js → index-89xg64wb.js} +2 -2
- package/dist/{index-pc49a7zt.js → index-8v1brm5n.js} +13 -11
- package/dist/{index-qmm8xpbc.js → index-910gahfb.js} +6 -6
- package/dist/{index-47hst5me.js → index-9jvxq5rt.js} +4 -4
- package/dist/{index-832w615x.js → index-azkfw78y.js} +1 -1
- package/dist/{index-wh9fxds5.js → index-c205x7xd.js} +1 -1
- package/dist/{index-mg9s2rc3.js → index-cpbr0xvk.js} +2 -2
- package/dist/{index-cr483vx6.js → index-dj64gzg5.js} +2 -2
- package/dist/{index-jba6ny4m.js → index-dnpcv1rg.js} +4 -4
- package/dist/{index-z4p0ry94.js → index-dt7cyqfe.js} +2 -1
- package/dist/{index-tm799pq7.js → index-e6ay1gez.js} +1 -1
- package/dist/{index-j7n64sg4.js → index-fgw241hh.js} +2 -2
- package/dist/{index-yzzxb5e1.js → index-h7kta6cn.js} +3 -3
- package/dist/{index-q7q6qp1f.js → index-hedgz8an.js} +1 -1
- package/dist/{index-5pgyqgmx.js → index-hj78hvhm.js} +2 -2
- package/dist/{index-7r11k4xr.js → index-hp46xe93.js} +7 -7
- package/dist/{index-ejgp0z9p.js → index-j4dcjb8t.js} +4 -4
- package/dist/{index-e6ncz7a6.js → index-jzrvdqb8.js} +1 -1
- package/dist/{index-sp5pvs95.js → index-k34hc455.js} +2 -2
- package/dist/{index-9ffntwyr.js → index-kj4bprep.js} +4 -4
- package/dist/{index-xe34pwb6.js → index-mgy7g740.js} +1 -1
- package/dist/{index-2v9qpmb3.js → index-mmf6e740.js} +7 -7
- package/dist/{index-3tmbvn0z.js → index-pkxkeezb.js} +27 -19
- package/dist/{index-jm62g83a.js → index-qdjxrbnr.js} +71 -44
- package/dist/{index-xjaf9g90.js → index-r1d45dsr.js} +4 -4
- package/dist/{index-y915t3ey.js → index-r3f85n7y.js} +5 -1
- package/dist/{index-wqwjawer.js → index-tbdy1hk0.js} +6 -6
- package/dist/{index-m0pwswv9.js → index-tqtpgnhr.js} +1 -1
- package/dist/{index-zk6gtf43.js → index-w7n7qkpf.js} +5 -5
- package/dist/{index-ewta5h87.js → index-w9hxgntq.js} +5 -5
- package/dist/{index-2gewejcz.js → index-x49x59ar.js} +145 -32
- package/dist/{index-7dzaamqg.js → index-xcej5kpt.js} +4 -4
- package/dist/{index-s7460efs.js → index-zfx7mtqa.js} +1 -1
- package/dist/{index-c81tggen.js → index-zkjx8gq3.js} +11 -11
- package/dist/{index-et39x9k3.js → index-zmgp0tr6.js} +3 -3
- package/dist/index.js +58 -55
- package/dist/{logger-d7c8akh9.js → logger-nmb2508f.js} +2 -2
- package/dist/{message-fts-rowid-map-0xx8ge09.js → message-fts-rowid-map-vcatdan0.js} +5 -5
- package/dist/{message-index-bounded-d3x8rhpz.js → message-index-bounded-abhwe610.js} +12 -12
- package/dist/{message-time-backfill-pz5981mf.js → message-time-backfill-zc5rsvhv.js} +3 -3
- package/dist/migration-worker.js +13 -13
- package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
- package/dist/{project-embedding-registry-az68q792.js → project-embedding-registry-e566q4bg.js} +15 -15
- package/dist/raw-ordinal-warmup-worker.js +8 -8
- package/dist/{read-session-chunk-70r1snq3.js → read-session-chunk-sde0wym3.js} +10 -10
- package/dist/{read-session-raw-3sc9231y.js → read-session-raw-trhdgc9z.js} +3 -3
- package/dist/{recomp-orchestrator-cn4r2gz6.js → recomp-orchestrator-dapm3e4v.js} +33 -33
- package/dist/render-6vmqzcem.js +43 -0
- package/dist/{safe-notification-target-d21swr3n.js → safe-notification-target-54ns7dv9.js} +3 -3
- package/dist/{search-b0cb342r.js → search-11aw8wpq.js} +27 -27
- package/dist/{search-archive-s9t3exc1.js → search-archive-4bbn3ztv.js} +13 -13
- package/dist/{send-session-notification-0779tyd9.js → send-session-notification-gxrj4w1r.js} +6 -6
- package/dist/shared/host-sqlite-runtime.d.ts +3 -0
- package/dist/shared/host-sqlite-runtime.d.ts.map +1 -0
- package/dist/shared/redaction.d.ts.map +1 -1
- package/dist/shared/transcript.d.ts +14 -0
- package/dist/shared/transcript.d.ts.map +1 -1
- package/dist/{storage-tags-xvbje7jm.js → storage-tags-jq0c0zsn.js} +7 -7
- package/dist/{store-91kawq9a.js → store-29ksp6vy.js} +3 -3
- package/dist/{transform-postprocess-phase-r1xhsjrh.js → transform-postprocess-phase-1xrjg6be.js} +34 -34
- package/dist/v2/auto-search-worker.js +5 -5
- package/dist/v2/chunk-embedding-write-worker.js +16 -16
- package/dist/v2/{compaction-marker-candidates-bp1bn579.js → compaction-marker-candidates-6nypmsr3.js} +3 -3
- package/dist/v2/compaction-marker-candidates-worker.js +1 -1
- package/dist/v2/{compartment-chunk-embedding-a7ddvz7v.js → compartment-chunk-embedding-jthtfhcd.js} +8 -8
- package/dist/v2/{context-2hssw26q.js → context-43r0mzkp.js} +127 -111
- package/dist/v2/{derive-budgets-hr4qqrnv.js → derive-budgets-wj0q7s7d.js} +6 -6
- package/dist/v2/embedding-backfill-16b16m38.js +29 -0
- package/dist/v2/embedding-worker-process.js +2 -2
- package/dist/v2/embedding-worker.js +8 -8
- package/dist/v2/fold/native-replay.d.ts +2 -1
- package/dist/v2/fold/native-replay.d.ts.map +1 -1
- package/dist/v2/hidden-child-native.d.ts.map +1 -1
- package/dist/v2/hidden-child-record.d.ts +8 -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/hidden-run-holder.d.ts +8 -2
- package/dist/v2/hidden-run-holder.d.ts.map +1 -1
- package/dist/v2/{history-owner-260djmv5.js → history-owner-8pd5ax3n.js} +3 -3
- package/dist/v2/hooks/context.d.ts.map +1 -1
- package/dist/v2/hooks/hidden-child.d.ts +3 -0
- package/dist/v2/hooks/hidden-child.d.ts.map +1 -1
- package/dist/v2/{logger-zyf43np1.js → logger-58jfese9.js} +2 -2
- package/dist/v2/{message-fts-rowid-map-n8mcvcpz.js → message-fts-rowid-map-ax4vk78j.js} +5 -5
- package/dist/v2/{message-index-bounded-tbwrff24.js → message-index-bounded-qh794qxx.js} +12 -12
- package/dist/v2/{message-time-backfill-ynb3vg6r.js → message-time-backfill-yj773saf.js} +3 -3
- package/dist/v2/migration-worker.js +13 -13
- package/dist/v2/{project-embedding-registry-2zeycxek.js → project-embedding-registry-z05xvckg.js} +15 -15
- package/dist/v2/raw-ordinal-warmup-worker.js +8 -8
- package/dist/v2/{read-session-chunk-cvgsfsgr.js → read-session-chunk-8tn2dbn1.js} +10 -10
- package/dist/v2/{read-session-raw-wg5zc29f.js → read-session-raw-ywebck9q.js} +3 -3
- package/dist/v2/recomp-orchestrator-vzygyqwn.js +69 -0
- package/dist/v2/render-9b5dxp9e.js +43 -0
- package/dist/v2/{safe-notification-target-y55z2zat.js → safe-notification-target-zrwbh6k7.js} +3 -3
- package/dist/v2/{search-x1cac8t6.js → search-35cz80x0.js} +26 -26
- package/dist/v2/{search-archive-k2yh0jj3.js → search-archive-8zqsf9e6.js} +13 -13
- package/dist/v2/{send-session-notification-v69y04f5.js → send-session-notification-8x146x5y.js} +6 -6
- package/dist/v2/{server-gj259dqy.js → server-11ra1pmx.js} +5 -5
- package/dist/v2/{server-6nh36020.js → server-1fnsfm3a.js} +132 -33
- package/dist/v2/{server-gs2251jr.js → server-2cq3e1c1.js} +4 -4
- package/dist/v2/{server-39bcszk4.js → server-2qvnr3t7.js} +1 -1
- package/dist/v2/{server-jkj1dq6j.js → server-2sare4qg.js} +4 -4
- package/dist/v2/{server-jdfe07mp.js → server-2wz6y46g.js} +1 -1
- package/dist/v2/{server-at0v0z4t.js → server-379fd3n7.js} +1 -1
- package/dist/v2/{server-ds8vpfkr.js → server-40vdz8sf.js} +2 -2
- package/dist/v2/{server-qntmqaca.js → server-4yrvbnnm.js} +2 -2
- package/dist/v2/{server-x69fqsvz.js → server-5t4nzfpt.js} +1 -1
- package/dist/v2/{server-npdey91q.js → server-63ree5ns.js} +1 -1
- package/dist/v2/{server-gqkdfdvw.js → server-6qax5pds.js} +2 -2
- package/dist/v2/{server-qb3s0mnc.js → server-73bqw5c0.js} +1 -1
- package/dist/v2/{server-qy58c11s.js → server-7h4gwphm.js} +4 -4
- package/dist/v2/{server-476anw1w.js → server-7tj8yzrv.js} +1 -1
- package/dist/v2/{server-e6xneh68.js → server-arfzfxe8.js} +5 -1
- package/dist/v2/{server-6ash6z8z.js → server-av3p9c8k.js} +1 -1
- package/dist/v2/{server-5hwf5c7r.js → server-bx5k66qc.js} +1 -1
- package/dist/v2/{server-s81b3nct.js → server-db91dxwc.js} +7 -7
- package/dist/v2/{server-z4p0ry94.js → server-dt7cyqfe.js} +2 -1
- package/dist/v2/{server-zc8s06gx.js → server-ganavh75.js} +2 -2
- package/dist/v2/{server-cvm1qrqc.js → server-gh2w75fn.js} +3 -3
- package/dist/v2/{server-y0pd600x.js → server-j1gxs1gj.js} +1 -1
- package/dist/v2/{server-xepfjgv5.js → server-k3ntgf6n.js} +2 -2
- package/dist/v2/{server-j8376q08.js → server-kzrrdjp5.js} +1 -1
- package/dist/v2/{server-1rrmxhd1.js → server-n33hyq9t.js} +2 -2
- package/dist/v2/{server-0tv6kytx.js → server-n34vzyfm.js} +1 -1
- package/dist/v2/{server-prrx17q3.js → server-nnh81jqy.js} +6 -6
- package/dist/v2/{server-cd93xyyx.js → server-qjjky07w.js} +13 -11
- package/dist/v2/{server-vbr1rdkg.js → server-r3h4fy4k.js} +4 -4
- package/dist/v2/{server-96nm9vk4.js → server-rr5c0xcg.js} +2 -2
- package/dist/v2/{server-j4jjtdc5.js → server-rt8t6s2a.js} +2 -2
- package/dist/v2/{server-srtq37nh.js → server-svccj9rd.js} +4 -4
- package/dist/v2/{server-5sbsnpkn.js → server-tq523gj6.js} +1 -1
- package/dist/v2/{server-00adcfjd.js → server-vj0xbbrc.js} +17 -3
- package/dist/v2/{server-88pjnecb.js → server-vsx9tsks.js} +11 -11
- package/dist/v2/{server-s8mk882p.js → server-xekyjy4w.js} +6 -6
- package/dist/v2/{server-bfct1yvb.js → server-z2nv8jdv.js} +41 -21
- package/dist/v2/{server-6aj72z52.js → server-z5cv5wm5.js} +10 -10
- package/dist/v2/{server-5016ccyn.js → server-zemnpv92.js} +4 -4
- package/dist/v2/server.js +9 -9
- package/dist/v2/{storage-tags-y20j3jdp.js → storage-tags-pcenytad.js} +7 -7
- package/dist/v2/{store-b95snz31.js → store-gx19qc3a.js} +3 -3
- package/dist/v2/{v2-archive-reader-q92kwkr5.js → v2-archive-reader-hvdyz30c.js} +1 -1
- package/dist/v2/{wrapup-orchestrator-ydqkxkhj.js → wrapup-orchestrator-0d4ceff3.js} +34 -34
- package/dist/{v2-archive-reader-x62hsr4c.js → v2-archive-reader-qs24chs6.js} +1 -1
- package/dist/wrapup-orchestrator-v1mhjw55.js +56 -0
- package/package.json +1 -1
- package/src/config/index.test.ts +23 -5
- package/src/config/live-run-config.test.ts +7 -7
- package/src/config/removed-agent-config.ts +14 -1
- package/src/config/schema/magic-context.ts +5 -1
- package/src/shared/host-sqlite-runtime.test.ts +21 -0
- package/src/shared/host-sqlite-runtime.ts +32 -0
- package/src/shared/redaction.test.ts +11 -8
- package/src/shared/redaction.ts +5 -1
- package/src/shared/tag-transcript.ts +61 -10
- package/src/shared/transcript.ts +16 -0
- package/dist/embedding-backfill-wdrqkw09.js +0 -29
- package/dist/render-g45k3gts.js +0 -43
- package/dist/v2/embedding-backfill-gveter8p.js +0 -29
- package/dist/v2/recomp-orchestrator-k4cj62f2.js +0 -69
- package/dist/v2/render-ys7a3zks.js +0 -43
- package/dist/wrapup-orchestrator-kt81d6et.js +0 -56
|
@@ -3,14 +3,14 @@ import {
|
|
|
3
3
|
} from "./server-qt1qqasc.js";
|
|
4
4
|
import {
|
|
5
5
|
log2
|
|
6
|
-
} from "./server-
|
|
6
|
+
} from "./server-kzrrdjp5.js";
|
|
7
7
|
import {
|
|
8
8
|
contentSha2562,
|
|
9
9
|
getProjectEmbeddingSnapshot2,
|
|
10
10
|
readSearchBackfillCursor2,
|
|
11
11
|
writeSearchBackfillCursor2,
|
|
12
12
|
embedItemsWindowBounded2
|
|
13
|
-
} from "./server-
|
|
13
|
+
} from "./server-z5cv5wm5.js";
|
|
14
14
|
import {
|
|
15
15
|
saveEmbeddingIfHashMatches
|
|
16
16
|
} from "./server-qjwpqvnf.js";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
estimateTokens
|
|
3
|
-
} from "./server-
|
|
3
|
+
} from "./server-73bqw5c0.js";
|
|
4
4
|
import {
|
|
5
5
|
getTagById2
|
|
6
|
-
} from "./server-
|
|
6
|
+
} from "./server-11ra1pmx.js";
|
|
7
7
|
import {
|
|
8
8
|
expandToolPart,
|
|
9
9
|
visitRawSessionMessages2,
|
|
10
10
|
readRawSessionMessageById2
|
|
11
|
-
} from "./server-
|
|
11
|
+
} from "./server-db91dxwc.js";
|
|
12
12
|
|
|
13
13
|
// src/tools/ctx-expand/render.ts
|
|
14
14
|
import { createHash } from "node:crypto";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
estimateTokens
|
|
3
|
-
} from "./server-
|
|
3
|
+
} from "./server-73bqw5c0.js";
|
|
4
4
|
import {
|
|
5
5
|
getHarness2
|
|
6
6
|
} from "./server-pavzsdc6.js";
|
|
7
7
|
import {
|
|
8
8
|
log2
|
|
9
|
-
} from "./server-
|
|
9
|
+
} from "./server-kzrrdjp5.js";
|
|
10
10
|
import {
|
|
11
11
|
inRootAsyncContext2
|
|
12
12
|
} from "./server-gzy5w8ya.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getMagicContextStorageDir,
|
|
3
3
|
log2
|
|
4
|
-
} from "./server-
|
|
4
|
+
} from "./server-kzrrdjp5.js";
|
|
5
5
|
import {
|
|
6
6
|
writeStorageFileAtomicSync
|
|
7
|
-
} from "./server-
|
|
7
|
+
} from "./server-n34vzyfm.js";
|
|
8
8
|
import {
|
|
9
9
|
inRootAsyncContext2
|
|
10
10
|
} from "./server-gzy5w8ya.js";
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import {
|
|
2
2
|
sanitizeDiagnosticText
|
|
3
|
-
} from "./server-
|
|
3
|
+
} from "./server-dt7cyqfe.js";
|
|
4
4
|
import {
|
|
5
5
|
PROMOTABLE_CATEGORIES,
|
|
6
6
|
CATEGORY_DEFAULT_TTL
|
|
7
7
|
} from "./server-fr0wbhdn.js";
|
|
8
8
|
import {
|
|
9
9
|
DEFAULT_LOCAL_EMBEDDING_MODEL
|
|
10
|
-
} from "./server-
|
|
10
|
+
} from "./server-arfzfxe8.js";
|
|
11
11
|
import {
|
|
12
12
|
sessionLog2
|
|
13
|
-
} from "./server-
|
|
13
|
+
} from "./server-kzrrdjp5.js";
|
|
14
14
|
import {
|
|
15
15
|
isSynapseEmbeddingTruncated,
|
|
16
16
|
SynapseEmbeddingProvider
|
|
17
|
-
} from "./server-
|
|
17
|
+
} from "./server-k3ntgf6n.js";
|
|
18
18
|
import {
|
|
19
19
|
LocalEmbeddingProvider
|
|
20
|
-
} from "./server-
|
|
20
|
+
} from "./server-7h4gwphm.js";
|
|
21
21
|
import {
|
|
22
22
|
OpenAICompatibleEmbeddingProvider,
|
|
23
23
|
embedTextForProject2
|
|
24
|
-
} from "./server-
|
|
24
|
+
} from "./server-z5cv5wm5.js";
|
|
25
25
|
import {
|
|
26
26
|
saveEmbeddingIfHashMatches
|
|
27
27
|
} from "./server-qjwpqvnf.js";
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
getMagicContextStorageDir,
|
|
11
11
|
log2,
|
|
12
12
|
sessionLog2
|
|
13
|
-
} from "./server-
|
|
13
|
+
} from "./server-kzrrdjp5.js";
|
|
14
14
|
import {
|
|
15
15
|
prepareCachedStatement2,
|
|
16
16
|
withSqliteBackgroundWriter2,
|
|
@@ -18,14 +18,14 @@ import {
|
|
|
18
18
|
} from "./server-gzy5w8ya.js";
|
|
19
19
|
import {
|
|
20
20
|
deleteUnmappedMessageFtsRows2
|
|
21
|
-
} from "./server-
|
|
21
|
+
} from "./server-40vdz8sf.js";
|
|
22
22
|
import {
|
|
23
23
|
deleteChunkEmbedBackoffForSession2
|
|
24
|
-
} from "./server-
|
|
24
|
+
} from "./server-zemnpv92.js";
|
|
25
25
|
import {
|
|
26
26
|
isPidAlive,
|
|
27
27
|
readProcessStartTime
|
|
28
|
-
} from "./server-
|
|
28
|
+
} from "./server-2wz6y46g.js";
|
|
29
29
|
import {
|
|
30
30
|
CACHED_TRIM_PARTIAL_SQL,
|
|
31
31
|
SESSION_META_SELECT_COLUMNS,
|
|
@@ -58,7 +58,7 @@ import {
|
|
|
58
58
|
getPendingPiCompactionMarkerState,
|
|
59
59
|
logPiCompactionMarkerClear,
|
|
60
60
|
isPrefixBoundThinkingModel
|
|
61
|
-
} from "./server-
|
|
61
|
+
} from "./server-11ra1pmx.js";
|
|
62
62
|
import {
|
|
63
63
|
BoundedSessionMap,
|
|
64
64
|
getTableColumnNames,
|
|
@@ -68,21 +68,21 @@ import {
|
|
|
68
68
|
tagRevisionKey,
|
|
69
69
|
tagIdentityRevisionKey,
|
|
70
70
|
deleteTagIdentityRevisions
|
|
71
|
-
} from "./server-
|
|
71
|
+
} from "./server-4yrvbnnm.js";
|
|
72
72
|
import {
|
|
73
73
|
withReadOnlySessionDb
|
|
74
|
-
} from "./server-
|
|
74
|
+
} from "./server-bx5k66qc.js";
|
|
75
75
|
import {
|
|
76
76
|
layoutLkgPrefix,
|
|
77
77
|
assembleLkgPrefix
|
|
78
|
-
} from "./server-
|
|
78
|
+
} from "./server-2sare4qg.js";
|
|
79
79
|
import {
|
|
80
80
|
ensurePrivateStorageDirectorySync,
|
|
81
81
|
writeStorageFileSync,
|
|
82
82
|
writeStorageFileAtomicSync,
|
|
83
83
|
syncStorageDirectorySync,
|
|
84
84
|
writeStorageFileDurableAtomicSync
|
|
85
|
-
} from "./server-
|
|
85
|
+
} from "./server-n34vzyfm.js";
|
|
86
86
|
import {
|
|
87
87
|
gaDatabasePath2,
|
|
88
88
|
V2StoreReader2
|
|
@@ -99,7 +99,7 @@ import {
|
|
|
99
99
|
} from "./server-avwt563y.js";
|
|
100
100
|
import {
|
|
101
101
|
logSlowWriteTransaction
|
|
102
|
-
} from "./server-
|
|
102
|
+
} from "./server-tq523gj6.js";
|
|
103
103
|
|
|
104
104
|
// src/features/magic-context/compartment-lease.ts
|
|
105
105
|
var COMPARTMENT_LEASE_TTL_MS = 5 * 60 * 1000;
|
|
@@ -4459,8 +4459,10 @@ function decodePiContentDecision(value) {
|
|
|
4459
4459
|
var NATIVE_TOOL_INPUTS = "native tool inputs";
|
|
4460
4460
|
var NATIVE_REASONING_IDS = "native reasoning ids";
|
|
4461
4461
|
var nativeWriteBarriers = new WeakMap;
|
|
4462
|
+
class PersistedReplayStateError extends Error {
|
|
4463
|
+
}
|
|
4462
4464
|
function invalidPersistedReplayState(lane, sessionId) {
|
|
4463
|
-
return new
|
|
4465
|
+
return new PersistedReplayStateError(`invalid persisted ${lane} state for session ${sessionId}`);
|
|
4464
4466
|
}
|
|
4465
4467
|
function assertNonEmptyId(value, lane, sessionId) {
|
|
4466
4468
|
if (typeof value !== "string" || value.length === 0) {
|
|
@@ -138,10 +138,10 @@ async function serveV2ArchiveReads2(port, openConnections) {
|
|
|
138
138
|
] = await Promise.all([
|
|
139
139
|
import("./sqlite-zdgm52sv.js"),
|
|
140
140
|
import("./store-reader-qt2msa8z.js"),
|
|
141
|
-
import("./store-
|
|
142
|
-
import("./read-session-chunk-
|
|
143
|
-
import("./render-
|
|
144
|
-
import("./search-archive-
|
|
141
|
+
import("./store-gx19qc3a.js"),
|
|
142
|
+
import("./read-session-chunk-8tn2dbn1.js"),
|
|
143
|
+
import("./render-9b5dxp9e.js"),
|
|
144
|
+
import("./search-archive-8zqsf9e6.js"),
|
|
145
145
|
import("./expand-attachments-h33jbgyz.js")
|
|
146
146
|
]);
|
|
147
147
|
const pool = new V2StoreReaderPool;
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
getMagicContextStorageDir,
|
|
6
6
|
sessionLog2
|
|
7
|
-
} from "./server-
|
|
7
|
+
} from "./server-kzrrdjp5.js";
|
|
8
8
|
import {
|
|
9
9
|
writeStorageFileAtomicSync
|
|
10
|
-
} from "./server-
|
|
10
|
+
} from "./server-n34vzyfm.js";
|
|
11
11
|
import {
|
|
12
12
|
modelRefLookupOrder
|
|
13
13
|
} from "./server-avwt563y.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log2
|
|
3
|
-
} from "./server-
|
|
3
|
+
} from "./server-kzrrdjp5.js";
|
|
4
4
|
import {
|
|
5
5
|
getSdkWindowGeometry,
|
|
6
6
|
getSdkContextLimit,
|
|
7
7
|
getSdkInputLimit
|
|
8
|
-
} from "./server-
|
|
8
|
+
} from "./server-rr5c0xcg.js";
|
|
9
9
|
import {
|
|
10
10
|
localBudget,
|
|
11
11
|
calibrationForModelKey
|
|
@@ -6,19 +6,19 @@ import {
|
|
|
6
6
|
removeNestedBlocks,
|
|
7
7
|
hasMeaningfulUserText2,
|
|
8
8
|
extractTexts2
|
|
9
|
-
} from "./server-
|
|
9
|
+
} from "./server-73bqw5c0.js";
|
|
10
10
|
import {
|
|
11
11
|
cleanUserText2
|
|
12
|
-
} from "./server-
|
|
12
|
+
} from "./server-db91dxwc.js";
|
|
13
13
|
import {
|
|
14
14
|
recordMessageFtsRowid2,
|
|
15
15
|
recordIndexedMessageTime2,
|
|
16
16
|
messageFtsOrdinalRangeIsMapped2,
|
|
17
17
|
deleteUnmappedMessageFtsRows2
|
|
18
|
-
} from "./server-
|
|
18
|
+
} from "./server-40vdz8sf.js";
|
|
19
19
|
import {
|
|
20
20
|
logSlowWriteTransaction
|
|
21
|
-
} from "./server-
|
|
21
|
+
} from "./server-tq523gj6.js";
|
|
22
22
|
|
|
23
23
|
// src/features/magic-context/compression-depth-storage.ts
|
|
24
24
|
var incrementDepthStatements = new WeakMap;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log2
|
|
3
|
-
} from "./server-
|
|
3
|
+
} from "./server-kzrrdjp5.js";
|
|
4
4
|
import {
|
|
5
5
|
setOutputReserveConfig
|
|
6
|
-
} from "./server-
|
|
6
|
+
} from "./server-rr5c0xcg.js";
|
|
7
7
|
import {
|
|
8
8
|
isCompactionEnabled,
|
|
9
9
|
migrateLegacyAgentEnabledInMemory,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
PER_HARNESS_MODEL_KEYS,
|
|
18
18
|
ConfigProfilesSchema,
|
|
19
19
|
MagicContextConfigSchema
|
|
20
|
-
} from "./server-
|
|
20
|
+
} from "./server-arfzfxe8.js";
|
|
21
21
|
|
|
22
22
|
// src/config/index.ts
|
|
23
23
|
import { existsSync as existsSync4 } from "node:fs";
|
|
@@ -3255,6 +3255,7 @@ function loadRawConfigFile(options) {
|
|
|
3255
3255
|
|
|
3256
3256
|
// src/config/removed-agent-config.ts
|
|
3257
3257
|
var REMOVED_AGENT_CONFIG_KEY = "sidekick";
|
|
3258
|
+
var REMOVED_DREAMER_KEYS = ["prompt", "tools", "permission"];
|
|
3258
3259
|
var REMOVED_AGENT_CONFIG_WARNING = `The "${REMOVED_AGENT_CONFIG_KEY}" configuration was removed and is ignored.`;
|
|
3259
3260
|
function isPlainObject3(value) {
|
|
3260
3261
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -3284,6 +3285,19 @@ function stripRemovedAgentConfig(rawConfig, warnings) {
|
|
|
3284
3285
|
if (removed && !warnings.includes(REMOVED_AGENT_CONFIG_WARNING)) {
|
|
3285
3286
|
warnings.push(REMOVED_AGENT_CONFIG_WARNING);
|
|
3286
3287
|
}
|
|
3288
|
+
if (isPlainObject3(patched.dreamer)) {
|
|
3289
|
+
const dreamer = { ...patched.dreamer };
|
|
3290
|
+
for (const key of REMOVED_DREAMER_KEYS) {
|
|
3291
|
+
if (!Object.hasOwn(dreamer, key))
|
|
3292
|
+
continue;
|
|
3293
|
+
delete dreamer[key];
|
|
3294
|
+
removed = true;
|
|
3295
|
+
const warning = `dreamer.${key} has no effect; remove it from your settings.`;
|
|
3296
|
+
if (!warnings.includes(warning))
|
|
3297
|
+
warnings.push(warning);
|
|
3298
|
+
}
|
|
3299
|
+
patched.dreamer = dreamer;
|
|
3300
|
+
}
|
|
3287
3301
|
return removed ? patched : rawConfig;
|
|
3288
3302
|
}
|
|
3289
3303
|
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
} from "./server-gzy5w8ya.js";
|
|
14
14
|
import {
|
|
15
15
|
scheduleAfterBootQuiet
|
|
16
|
-
} from "./server-
|
|
16
|
+
} from "./server-n33hyq9t.js";
|
|
17
17
|
import {
|
|
18
18
|
getHarness2,
|
|
19
19
|
harnessOwnsOpenCodeStore2
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
importPluginModule,
|
|
25
25
|
writeForwardedLogLine2,
|
|
26
26
|
log2
|
|
27
|
-
} from "./server-
|
|
27
|
+
} from "./server-kzrrdjp5.js";
|
|
28
28
|
import {
|
|
29
29
|
isOwnRpcServerRecord,
|
|
30
30
|
isPidAlive,
|
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
parseRpcPortFile,
|
|
36
36
|
inspectProcessesAsync,
|
|
37
37
|
inspectWindowsProcessesSync
|
|
38
|
-
} from "./server-
|
|
38
|
+
} from "./server-2wz6y46g.js";
|
|
39
39
|
import {
|
|
40
40
|
configureContextDatabasePragmas2
|
|
41
41
|
} from "./server-fb3zxn06.js";
|
|
@@ -46,16 +46,16 @@ import {
|
|
|
46
46
|
copyStorageFileSync,
|
|
47
47
|
copyStorageTreeSync,
|
|
48
48
|
tightenStorageTreeSync
|
|
49
|
-
} from "./server-
|
|
49
|
+
} from "./server-n34vzyfm.js";
|
|
50
50
|
import {
|
|
51
51
|
attachFailClosedBlockingProcessEvidence
|
|
52
|
-
} from "./server-
|
|
52
|
+
} from "./server-2qvnr3t7.js";
|
|
53
53
|
import {
|
|
54
54
|
reuseWorker
|
|
55
55
|
} from "./server-96ztjvkn.js";
|
|
56
56
|
import {
|
|
57
57
|
startMessageFtsRowidMapBackfill2
|
|
58
|
-
} from "./server-
|
|
58
|
+
} from "./server-40vdz8sf.js";
|
|
59
59
|
import {
|
|
60
60
|
LKG_SLOT_CHUNKS_DDL,
|
|
61
61
|
SESSION_REPLAY_DECISIONS_DDL,
|
|
@@ -65,14 +65,14 @@ import {
|
|
|
65
65
|
hasPendingMigrations,
|
|
66
66
|
getMainThreadMigrationBodyCount,
|
|
67
67
|
runMigrations
|
|
68
|
-
} from "./server-
|
|
68
|
+
} from "./server-2sare4qg.js";
|
|
69
69
|
import {
|
|
70
70
|
ensureColumn,
|
|
71
71
|
setDatabase,
|
|
72
72
|
loadToolDefinitionMeasurements,
|
|
73
73
|
installV95PerfSchema,
|
|
74
74
|
installTagIdentityRevisionTrigger
|
|
75
|
-
} from "./server-
|
|
75
|
+
} from "./server-4yrvbnnm.js";
|
|
76
76
|
import {
|
|
77
77
|
resolveOpenCodeDbPath,
|
|
78
78
|
hasV1MessageTables
|
|
@@ -85,7 +85,7 @@ import {
|
|
|
85
85
|
} from "./server-8ajstryz.js";
|
|
86
86
|
import {
|
|
87
87
|
logSlowWriteTransaction
|
|
88
|
-
} from "./server-
|
|
88
|
+
} from "./server-tq523gj6.js";
|
|
89
89
|
|
|
90
90
|
// src/features/magic-context/storage-db.ts
|
|
91
91
|
import {
|
|
@@ -1084,8 +1084,8 @@ function finishDatabaseOpen(db, dbPath, explicitDbPath, latestSupportedVersion)
|
|
|
1084
1084
|
state.running = startMessageFtsRowidMapBackfill2(db, signal).then(async () => {
|
|
1085
1085
|
if (signal.aborted || !readsOpenCodeStore)
|
|
1086
1086
|
return;
|
|
1087
|
-
const { readRawSessionMessagePage, readRawSessionMessages } = await importPluginModule(() => import("./read-session-chunk-
|
|
1088
|
-
const { startMessageTimeBackfill } = await importPluginModule(() => import("./message-time-backfill-
|
|
1087
|
+
const { readRawSessionMessagePage, readRawSessionMessages } = await importPluginModule(() => import("./read-session-chunk-8tn2dbn1.js"));
|
|
1088
|
+
const { startMessageTimeBackfill } = await importPluginModule(() => import("./message-time-backfill-yj773saf.js"));
|
|
1089
1089
|
if (signal.aborted)
|
|
1090
1090
|
return;
|
|
1091
1091
|
await startMessageTimeBackfill(db, Object.assign(readRawSessionMessages, {
|
|
@@ -2,29 +2,29 @@ import {
|
|
|
2
2
|
withMessageFtsSessionFilter,
|
|
3
3
|
liveTailRangeTouchesUnresolvedCoverage,
|
|
4
4
|
rangeHasHiddenMessages
|
|
5
|
-
} from "./server-
|
|
5
|
+
} from "./server-j1gxs1gj.js";
|
|
6
6
|
import {
|
|
7
7
|
getSqliteDatabasePath2
|
|
8
8
|
} from "./server-gzy5w8ya.js";
|
|
9
9
|
import {
|
|
10
10
|
runSessionWarmupWorker
|
|
11
|
-
} from "./server-
|
|
11
|
+
} from "./server-av3p9c8k.js";
|
|
12
12
|
import {
|
|
13
13
|
estimateTokens
|
|
14
|
-
} from "./server-
|
|
14
|
+
} from "./server-73bqw5c0.js";
|
|
15
15
|
import {
|
|
16
16
|
openCodeDbExists,
|
|
17
17
|
withReadOnlySessionDb
|
|
18
|
-
} from "./server-
|
|
18
|
+
} from "./server-bx5k66qc.js";
|
|
19
19
|
import {
|
|
20
20
|
hasRawMessageProvider2,
|
|
21
21
|
rawMessageWorkerSource2,
|
|
22
22
|
rawMessageOffThreadRangeReader2,
|
|
23
23
|
readRawSessionMessageIdOrdinalsForRange2
|
|
24
|
-
} from "./server-
|
|
24
|
+
} from "./server-db91dxwc.js";
|
|
25
25
|
import {
|
|
26
26
|
readV2ArchiveOffThread2
|
|
27
|
-
} from "./server-
|
|
27
|
+
} from "./server-r3h4fy4k.js";
|
|
28
28
|
|
|
29
29
|
// src/tools/ctx-expand/search-archive.ts
|
|
30
30
|
var archiveReadsOnThisThread = 0;
|
|
@@ -5,17 +5,17 @@ import {
|
|
|
5
5
|
getDataDir,
|
|
6
6
|
log2,
|
|
7
7
|
sessionLog2
|
|
8
|
-
} from "./server-
|
|
8
|
+
} from "./server-kzrrdjp5.js";
|
|
9
9
|
import {
|
|
10
10
|
inRootAsyncContext2,
|
|
11
11
|
withSqliteBackgroundWriter2
|
|
12
12
|
} from "./server-gzy5w8ya.js";
|
|
13
13
|
import {
|
|
14
14
|
scheduleAfterBootQuiet
|
|
15
|
-
} from "./server-
|
|
15
|
+
} from "./server-n33hyq9t.js";
|
|
16
16
|
import {
|
|
17
17
|
isRecord
|
|
18
|
-
} from "./server-
|
|
18
|
+
} from "./server-11ra1pmx.js";
|
|
19
19
|
import {
|
|
20
20
|
cleanSearchText,
|
|
21
21
|
hintKeywordRelevance,
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
isMessageIndexReconciledThrough,
|
|
26
26
|
clearIndexedMessages,
|
|
27
27
|
indexMessagesAfterOrdinal
|
|
28
|
-
} from "./server-
|
|
28
|
+
} from "./server-svccj9rd.js";
|
|
29
29
|
import {
|
|
30
30
|
Priority,
|
|
31
31
|
AdmissionClass,
|
|
@@ -34,14 +34,14 @@ import {
|
|
|
34
34
|
StaleRouteHandleError,
|
|
35
35
|
SubcClient,
|
|
36
36
|
isConsumerReconnectTransient
|
|
37
|
-
} from "./server-
|
|
37
|
+
} from "./server-k3ntgf6n.js";
|
|
38
38
|
import {
|
|
39
39
|
buildCanonicalChunkTextFromFts2,
|
|
40
40
|
loadCompartmentChunkEmbeddingsForSearch2,
|
|
41
41
|
trackCompartmentChunkSearchPool2,
|
|
42
42
|
peekCompartmentChunkSearchPool2,
|
|
43
43
|
warmCompartmentChunkSearchPool2
|
|
44
|
-
} from "./server-
|
|
44
|
+
} from "./server-zemnpv92.js";
|
|
45
45
|
import {
|
|
46
46
|
saveCommitEmbedding,
|
|
47
47
|
loadProjectCommitEmbeddings,
|
|
@@ -57,7 +57,7 @@ import {
|
|
|
57
57
|
enqueueShadowEmbeddingItems2,
|
|
58
58
|
getProjectEmbeddingSnapshot2,
|
|
59
59
|
embedItemsForProject2
|
|
60
|
-
} from "./server-
|
|
60
|
+
} from "./server-z5cv5wm5.js";
|
|
61
61
|
import {
|
|
62
62
|
recordEmbeddingMeasurement
|
|
63
63
|
} from "./server-2amn2s73.js";
|
|
@@ -73,7 +73,7 @@ import {
|
|
|
73
73
|
sanitizeFtsQuery,
|
|
74
74
|
searchMemoriesFTS,
|
|
75
75
|
searchMemoriesFTSUnion
|
|
76
|
-
} from "./server-
|
|
76
|
+
} from "./server-nnh81jqy.js";
|
|
77
77
|
import {
|
|
78
78
|
ModuleMemoryAuthorityError2,
|
|
79
79
|
getMemoriesByProject2,
|
|
@@ -82,23 +82,23 @@ import {
|
|
|
82
82
|
} from "./server-9emdjcb5.js";
|
|
83
83
|
import {
|
|
84
84
|
ensureMemoryEmbeddings2
|
|
85
|
-
} from "./server-
|
|
85
|
+
} from "./server-ganavh75.js";
|
|
86
86
|
import {
|
|
87
87
|
MESSAGE_FTS_SESSION_FILTER_SQL,
|
|
88
88
|
withMessageFtsSessionFilter,
|
|
89
89
|
messageTextVisibleInRequestSql
|
|
90
|
-
} from "./server-
|
|
90
|
+
} from "./server-j1gxs1gj.js";
|
|
91
91
|
import {
|
|
92
92
|
resolveWorkspaceShareCategories,
|
|
93
93
|
resolveWorkspaceIdentitySet,
|
|
94
94
|
expandWorkspaceIdentitySetWithAliases,
|
|
95
95
|
resolveStoredPathWorkspaceIdentity,
|
|
96
96
|
sourceNameForMemory
|
|
97
|
-
} from "./server-
|
|
97
|
+
} from "./server-2sare4qg.js";
|
|
98
98
|
import {
|
|
99
99
|
getNotes,
|
|
100
100
|
getActivePrimers
|
|
101
|
-
} from "./server-
|
|
101
|
+
} from "./server-5t4nzfpt.js";
|
|
102
102
|
import {
|
|
103
103
|
isKnownAutocommit
|
|
104
104
|
} from "./server-8ajstryz.js";
|
|
@@ -1850,13 +1850,15 @@ function truncateUtf8(text, bytes) {
|
|
|
1850
1850
|
end--;
|
|
1851
1851
|
return buffer.subarray(0, end).toString("utf8");
|
|
1852
1852
|
}
|
|
1853
|
-
function candidateText(location, title, body) {
|
|
1853
|
+
function candidateText(location, title, body, historyQuery) {
|
|
1854
1854
|
const header = `${truncateUtf8(location.replaceAll(`
|
|
1855
1855
|
`, " "), 200)}
|
|
1856
1856
|
${truncateUtf8(title.replaceAll(`
|
|
1857
1857
|
`, " "), 120)}
|
|
1858
1858
|
`;
|
|
1859
|
-
|
|
1859
|
+
const bodyBytes = DOCUMENT_BYTES - Buffer.byteLength(header);
|
|
1860
|
+
const passage = historyQuery && Buffer.byteLength(body) > bodyBytes ? matchedSearchSnippet(body, historyQuery, bodyBytes) || body : body;
|
|
1861
|
+
return header + truncateUtf8(passage, bodyBytes);
|
|
1860
1862
|
}
|
|
1861
1863
|
|
|
1862
1864
|
class RerankFailure extends Error {
|
|
@@ -2067,7 +2069,7 @@ async function rerankSearchResults(session, query, baseline, pool, texts, limit,
|
|
|
2067
2069
|
return baseline;
|
|
2068
2070
|
}
|
|
2069
2071
|
}
|
|
2070
|
-
function candidateTexts(db, sessionId, projectPath, pool) {
|
|
2072
|
+
function candidateTexts(db, sessionId, projectPath, pool, query) {
|
|
2071
2073
|
return pool.map((hit) => {
|
|
2072
2074
|
const id = searchResultKey(hit).split(":").slice(1).join(":");
|
|
2073
2075
|
let location = `${hit.source} ${id} ${projectPath}`;
|
|
@@ -2122,7 +2124,8 @@ Reason: ${row.reason}` : ""}`;
|
|
|
2122
2124
|
break;
|
|
2123
2125
|
}
|
|
2124
2126
|
}
|
|
2125
|
-
|
|
2127
|
+
const historyQuery = hit.source === "message" || hit.source === "compartment" ? query : undefined;
|
|
2128
|
+
return candidateText(location, title, body, historyQuery);
|
|
2126
2129
|
});
|
|
2127
2130
|
}
|
|
2128
2131
|
|
|
@@ -2510,6 +2513,21 @@ function getMessageOrdinal(value) {
|
|
|
2510
2513
|
}
|
|
2511
2514
|
return null;
|
|
2512
2515
|
}
|
|
2516
|
+
var EXPLICIT_MEMORY_BACKFILL_WAIT_MS = 5000;
|
|
2517
|
+
async function waitForMemoryBackfill(args, explicitSearch) {
|
|
2518
|
+
const backfill = ensureMemoryEmbeddings2(args);
|
|
2519
|
+
if (!explicitSearch)
|
|
2520
|
+
return backfill;
|
|
2521
|
+
let timer;
|
|
2522
|
+
try {
|
|
2523
|
+
const deadline = new Promise((resolve) => {
|
|
2524
|
+
timer = setTimeout(() => resolve(args.existingEmbeddings), EXPLICIT_MEMORY_BACKFILL_WAIT_MS);
|
|
2525
|
+
});
|
|
2526
|
+
return await Promise.race([backfill, deadline]);
|
|
2527
|
+
} finally {
|
|
2528
|
+
clearTimeout(timer);
|
|
2529
|
+
}
|
|
2530
|
+
}
|
|
2513
2531
|
async function getSemanticScores(args) {
|
|
2514
2532
|
const semanticScores = new Map;
|
|
2515
2533
|
if (!args.queryEmbedding || args.memories.length === 0 || !args.queryModelId || args.queryModelId === "off") {
|
|
@@ -2518,13 +2536,13 @@ async function getSemanticScores(args) {
|
|
|
2518
2536
|
const expectedEmbedding = { modelId: args.queryModelId, generation: args.queryGeneration };
|
|
2519
2537
|
if (!args.workspace?.isWorkspaced) {
|
|
2520
2538
|
const cachedEmbeddings = getProjectEmbeddings2(args.db, args.projectPath, args.queryModelId);
|
|
2521
|
-
const embeddings = args.backfillMemoryEmbeddings === false ? cachedEmbeddings : await
|
|
2539
|
+
const embeddings = args.backfillMemoryEmbeddings === false ? cachedEmbeddings : await waitForMemoryBackfill({
|
|
2522
2540
|
db: args.db,
|
|
2523
2541
|
projectIdentity: args.projectPath,
|
|
2524
2542
|
memories: args.memories,
|
|
2525
2543
|
existingEmbeddings: cachedEmbeddings,
|
|
2526
2544
|
expectedEmbedding
|
|
2527
|
-
});
|
|
2545
|
+
}, args.explicitSearch);
|
|
2528
2546
|
for (const memory of args.memories) {
|
|
2529
2547
|
const memoryEmbedding = embeddings.get(memory.id);
|
|
2530
2548
|
if (!memoryEmbedding || memoryEmbedding.modelId !== args.queryModelId) {
|
|
@@ -2547,13 +2565,13 @@ async function getSemanticScores(args) {
|
|
|
2547
2565
|
const ownMemories = memoriesByIdentity.get(args.projectPath) ?? [];
|
|
2548
2566
|
if (ownMemories.length > 0 && args.backfillMemoryEmbeddings !== false) {
|
|
2549
2567
|
const ownEmbeddings = getProjectEmbeddings2(args.db, args.projectPath, args.queryModelId);
|
|
2550
|
-
await
|
|
2568
|
+
await waitForMemoryBackfill({
|
|
2551
2569
|
db: args.db,
|
|
2552
2570
|
projectIdentity: args.projectPath,
|
|
2553
2571
|
memories: ownMemories,
|
|
2554
2572
|
existingEmbeddings: ownEmbeddings,
|
|
2555
2573
|
expectedEmbedding
|
|
2556
|
-
});
|
|
2574
|
+
}, args.explicitSearch);
|
|
2557
2575
|
}
|
|
2558
2576
|
for (const identity of workspace.identities) {
|
|
2559
2577
|
const memberMemories = memoriesByIdentity.get(identity) ?? [];
|
|
@@ -2673,6 +2691,7 @@ async function searchMemories(args) {
|
|
|
2673
2691
|
projectPath: args.projectPath,
|
|
2674
2692
|
memories: semanticCandidates,
|
|
2675
2693
|
backfillMemoryEmbeddings: args.backfillMemoryEmbeddings,
|
|
2694
|
+
explicitSearch: args.explicitSearch,
|
|
2676
2695
|
queryEmbedding: args.queryEmbedding,
|
|
2677
2696
|
queryModelId: args.queryModelId,
|
|
2678
2697
|
queryGeneration: args.queryGeneration,
|
|
@@ -3598,6 +3617,7 @@ async function unifiedSearch2(db, sessionId, projectPath, query, options = {}) {
|
|
|
3598
3617
|
visibleMemoryIds: options.visibleMemoryIds,
|
|
3599
3618
|
suppressionLimit: options.diagnostics && options.visibleMemoryIds?.size ? limit : undefined,
|
|
3600
3619
|
backfillMemoryEmbeddings: options.backfillMemoryEmbeddings,
|
|
3620
|
+
explicitSearch: options.explicitSearch,
|
|
3601
3621
|
lanes,
|
|
3602
3622
|
dateRange
|
|
3603
3623
|
}) : Promise.resolve({
|
|
@@ -3660,7 +3680,7 @@ async function unifiedSearch2(db, sessionId, projectPath, query, options = {}) {
|
|
|
3660
3680
|
if (reranker && lanes) {
|
|
3661
3681
|
const pool = fuseSearchLanes(lanes).slice(0, "remote" in reranker ? reranker.remote.top_n : 20);
|
|
3662
3682
|
try {
|
|
3663
|
-
results = await rerankSearchResults(reranker, trimmedQuery, results, pool, candidateTexts(db, sessionId, projectPath, pool), limit, options.signal, options.onRerankSkipped);
|
|
3683
|
+
results = await rerankSearchResults(reranker, trimmedQuery, results, pool, candidateTexts(db, sessionId, projectPath, pool, trimmedQuery), limit, options.signal, options.onRerankSkipped);
|
|
3664
3684
|
} catch {
|
|
3665
3685
|
if ("remote" in reranker)
|
|
3666
3686
|
remoteRerankSkipped("candidate_validation", options.onRerankSkipped);
|