@cortexkit/opencode-magic-context 0.49.35 → 0.49.36
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/README.md +1 -1
- package/dist/auto-search-worker.js +163 -160
- package/dist/chunk-embedding-write-worker.js +58 -56
- package/dist/{compaction-marker-candidates-g0p67ced.js → compaction-marker-candidates-5p1qkve9.js} +3 -1
- package/dist/compaction-marker-candidates-worker.js +24 -23
- package/dist/{compartment-chunk-embedding-y4136are.js → compartment-chunk-embedding-ypktm0tk.js} +5 -4
- package/dist/{conflict-warning-hook-hhw8z5ak.js → conflict-warning-hook-b75jn458.js} +6 -5
- package/dist/{context-fk8e3h9p.js → context-969z683s.js} +485 -91
- package/dist/{embedding-backfill-q6n72sy0.js → embedding-backfill-rma0v2ct.js} +9 -8
- package/dist/embedding-worker.js +2 -2
- package/dist/features/magic-context/compaction-marker-candidates.d.ts.map +1 -1
- package/dist/features/magic-context/compaction-marker.d.ts +5 -3
- package/dist/features/magic-context/compaction-marker.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-gates.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/verify-gate.d.ts +2 -0
- package/dist/features/magic-context/dreamer/verify-gate.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/verify-state.d.ts +9 -0
- package/dist/features/magic-context/dreamer/verify-state.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/verify.d.ts +2 -1
- package/dist/features/magic-context/dreamer/verify.d.ts.map +1 -1
- package/dist/features/magic-context/migration-worker-client.d.ts +3 -0
- package/dist/features/magic-context/migration-worker-client.d.ts.map +1 -1
- package/dist/features/magic-context/migration-worker.d.ts +15 -0
- package/dist/features/magic-context/migration-worker.d.ts.map +1 -1
- package/dist/features/magic-context/overflow-detection.d.ts +2 -2
- package/dist/features/magic-context/overflow-detection.d.ts.map +1 -1
- package/dist/features/magic-context/search-rerank.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-persisted.d.ts +1 -0
- package/dist/features/magic-context/storage-meta-persisted.d.ts.map +1 -1
- package/dist/features/magic-context/storage-tags.d.ts +4 -0
- package/dist/features/magic-context/storage-tags.d.ts.map +1 -1
- package/dist/features/magic-context/work-metrics-carry-storage.d.ts +10 -0
- package/dist/features/magic-context/work-metrics-carry-storage.d.ts.map +1 -0
- package/dist/hooks/magic-context/auto-search-worker-client.d.ts +5 -1
- package/dist/hooks/magic-context/auto-search-worker-client.d.ts.map +1 -1
- package/dist/hooks/magic-context/compaction-marker-publication.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-historian.d.ts.map +1 -1
- package/dist/hooks/magic-context/issue-423-fixture.d.ts +1 -1
- package/dist/hooks/magic-context/issue-423-fixture.d.ts.map +1 -1
- package/dist/hooks/magic-context/issue-424-fixture.d.ts +1 -1
- package/dist/hooks/magic-context/issue-424-fixture.d.ts.map +1 -1
- package/dist/hooks/magic-context/project-structural-sentinels.d.ts +25 -0
- package/dist/hooks/magic-context/project-structural-sentinels.d.ts.map +1 -0
- package/dist/hooks/magic-context/protected-tail-boundary.d.ts +8 -1
- package/dist/hooks/magic-context/protected-tail-boundary.d.ts.map +1 -1
- package/dist/hooks/magic-context/raw-ordinal-warmup.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-true-raw-tokens.d.ts +2 -0
- package/dist/hooks/magic-context/read-session-true-raw-tokens.d.ts.map +1 -1
- package/dist/hooks/magic-context/release-recovery-prefix.d.ts +9 -0
- package/dist/hooks/magic-context/release-recovery-prefix.d.ts.map +1 -0
- package/dist/hooks/magic-context/strip-structural-noise.d.ts +6 -3
- package/dist/hooks/magic-context/strip-structural-noise.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-context-state.d.ts +3 -0
- package/dist/hooks/magic-context/transform-context-state.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +3 -0
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/{index-cpjk5jd2.js → index-1d042x6w.js} +16 -14
- package/dist/{index-jn0ddrhp.js → index-21fgrfrf.js} +8 -6
- package/dist/{index-pq0dpwrc.js → index-2rs7912w.js} +2 -2
- package/dist/{index-ezv6dz3y.js → index-4ks89h5a.js} +4 -4
- package/dist/{index-vzhhr1ht.js → index-4y35msh5.js} +1 -2
- package/dist/{index-f297z1n8.js → index-72czy45z.js} +5 -5
- package/dist/index-7v05d9b7.js +58 -0
- package/dist/{index-f9b3vtt1.js → index-850vthn3.js} +8 -2
- package/dist/{index-ksv0a31x.js → index-8jjjmhab.js} +12 -1
- package/dist/index-96ztjvkn.js +204 -0
- package/dist/{index-gyaa159j.js → index-9fgmkfaf.js} +6 -3
- package/dist/{index-4bgk5ztz.js → index-9tdvbdv1.js} +187 -90
- package/dist/{index-2v6nvy3k.js → index-ae1ar4v1.js} +1 -1
- package/dist/{index-faxb7mck.js → index-b1ydbp95.js} +1 -1
- package/dist/{index-nxrsns5x.js → index-c5dzns43.js} +75 -75
- package/dist/{index-zhqwda72.js → index-dcjkw41m.js} +1 -1
- package/dist/{index-x2mrq5xv.js → index-dfdg2cgg.js} +179 -49
- package/dist/{index-87ctnzz9.js → index-dz48h1wx.js} +2 -2
- package/dist/{index-b6xz3qbe.js → index-gnmhbyyc.js} +366 -83
- package/dist/{index-qx8j6kds.js → index-j105mf16.js} +2 -2
- package/dist/{index-p56dszfp.js → index-jggt5gf2.js} +1 -1
- package/dist/{index-xwwsbsd3.js → index-pp8vdn01.js} +5 -5
- package/dist/{index-dy7w6wm4.js → index-prw8apnc.js} +5 -5
- package/dist/{index-qncw9hey.js → index-r2epb000.js} +33 -3
- package/dist/{index-brg2w6qc.js → index-tn9drm1a.js} +16 -14
- package/dist/{index-pswsyf1w.js → index-ty4vhe4n.js} +3 -3
- package/dist/{index-pztqab6k.js → index-vd2ywmfe.js} +1 -1
- package/dist/{index-3j9t1v4n.js → index-wcwhhtdh.js} +10 -9
- package/dist/{index-1rhgxqs8.js → index-xd2p95m7.js} +1 -1
- package/dist/{index-0c7p8mq5.js → index-xnm0wq1r.js} +1 -1
- package/dist/{index-3d3872c6.js → index-ys7j6679.js} +4 -4
- package/dist/index.js +38 -37
- package/dist/{message-fts-rowid-map-xg7hr0mk.js → message-fts-rowid-map-t6qsyg9s.js} +4 -3
- package/dist/{message-index-bounded-narw7bnz.js → message-index-bounded-wfk6aqxk.js} +9 -8
- package/dist/migration-worker.js +45 -40
- package/dist/plugin/rpc-handlers.d.ts.map +1 -1
- package/dist/{project-embedding-registry-tdz7985n.js → project-embedding-registry-3yyegjma.js} +8 -7
- package/dist/raw-ordinal-warmup-worker.js +114 -118
- package/dist/{read-session-chunk-vmg1zjg0.js → read-session-chunk-26yrrhyz.js} +7 -6
- package/dist/{read-session-raw-mncmzbm9.js → read-session-raw-j7c9w57v.js} +3 -2
- package/dist/{recomp-orchestrator-qyyhnc9b.js → recomp-orchestrator-wk509qkp.js} +20 -19
- package/dist/{render-c5p0k846.js → render-h1qarr8a.js} +13 -12
- package/dist/{search-f6hwvcxk.js → search-5h9fydyq.js} +16 -15
- package/dist/{search-archive-0ny7p3bw.js → search-archive-q79hyqxs.js} +9 -8
- package/dist/{send-session-notification-0gwcz3fw.js → send-session-notification-14p3yje4.js} +5 -4
- package/dist/shared/model-suggestion-retry.d.ts +7 -0
- package/dist/shared/model-suggestion-retry.d.ts.map +1 -1
- package/dist/shared/prompt-async-transport.d.ts.map +1 -1
- package/dist/shared/reusable-worker-entry.d.ts +4 -0
- package/dist/shared/reusable-worker-entry.d.ts.map +1 -0
- package/dist/shared/reusable-worker.d.ts +6 -0
- package/dist/shared/reusable-worker.d.ts.map +1 -0
- package/dist/shared/reusable-worker.fixture.d.ts +2 -0
- package/dist/shared/reusable-worker.fixture.d.ts.map +1 -0
- package/dist/shared/worker-shutdown.d.ts +1 -1
- package/dist/shared/worker-shutdown.d.ts.map +1 -1
- package/dist/{storage-tags-zx1023km.js → storage-tags-vj0yj7ed.js} +1 -1
- package/dist/{store-620rjzt9.js → store-s3eykdjt.js} +1 -1
- package/dist/{transform-postprocess-phase-807ff6t2.js → transform-postprocess-phase-4gj0mtcg.js} +21 -20
- package/dist/v2/auto-search-worker.js +163 -160
- package/dist/v2/chunk-embedding-write-worker.js +59 -57
- package/dist/v2/compaction-marker-candidates-worker.js +24 -23
- package/dist/v2/{compaction-marker-candidates-t1aq6gsj.js → compaction-marker-candidates-yeb2ky46.js} +4 -2
- package/dist/v2/{compartment-chunk-embedding-ncsk0r9e.js → compartment-chunk-embedding-qfk791bd.js} +6 -5
- package/dist/v2/{context-znqfkap4.js → context-bxr039be.js} +1011 -209
- package/dist/v2/{embedding-backfill-11j425e0.js → embedding-backfill-00tw59rx.js} +10 -9
- package/dist/v2/embedding-worker.js +2 -2
- package/dist/v2/fold/code-mode-catalog.d.ts +3 -0
- package/dist/v2/fold/code-mode-catalog.d.ts.map +1 -0
- package/dist/v2/fold/idle.d.ts +1 -0
- package/dist/v2/fold/idle.d.ts.map +1 -1
- package/dist/v2/fold/manual-baseline.d.ts +8 -0
- package/dist/v2/fold/manual-baseline.d.ts.map +1 -0
- package/dist/v2/fold/native-replay-v3.d.ts +7 -0
- package/dist/v2/fold/native-replay-v3.d.ts.map +1 -1
- package/dist/v2/fold/native-replay.d.ts +24 -7
- package/dist/v2/fold/native-replay.d.ts.map +1 -1
- package/dist/v2/fold/restore.d.ts.map +1 -1
- package/dist/v2/fold/summary.d.ts +4 -0
- package/dist/v2/fold/summary.d.ts.map +1 -0
- package/dist/v2/hidden-completion.d.ts.map +1 -1
- package/dist/v2/hooks/channel2.d.ts +6 -0
- package/dist/v2/hooks/channel2.d.ts.map +1 -1
- package/dist/v2/hooks/context.d.ts.map +1 -1
- package/dist/v2/hooks/restore-rows.d.ts +12 -2
- package/dist/v2/hooks/restore-rows.d.ts.map +1 -1
- package/dist/v2/hooks/synthetic-admission.d.ts +7 -0
- package/dist/v2/hooks/synthetic-admission.d.ts.map +1 -0
- package/dist/v2/hooks/usage-persist.d.ts.map +1 -1
- package/dist/v2/{message-fts-rowid-map-rmk571mb.js → message-fts-rowid-map-z86avy0n.js} +5 -4
- package/dist/v2/{message-index-bounded-620bppw7.js → message-index-bounded-w14496s9.js} +9 -8
- package/dist/v2/migration-worker.js +46 -41
- package/dist/v2/{project-embedding-registry-bm5fe1a8.js → project-embedding-registry-jqq2qeqb.js} +9 -8
- package/dist/v2/raw-ordinal-warmup-worker.js +114 -118
- package/dist/v2/{read-session-chunk-qfwv1k71.js → read-session-chunk-tqnh1ret.js} +7 -6
- package/dist/v2/{read-session-raw-q294t8xs.js → read-session-raw-qpp6x9kg.js} +4 -3
- package/dist/v2/{recomp-orchestrator-fcnjref7.js → recomp-orchestrator-9cjk6aej.js} +19 -18
- package/dist/v2/{render-98a1qv0b.js → render-5dz1knf2.js} +13 -12
- package/dist/v2/{search-z1zqzsmh.js → search-8yfet25y.js} +15 -14
- package/dist/v2/{search-archive-r0y1bafr.js → search-archive-z6z9jqwf.js} +9 -8
- package/dist/v2/{send-session-notification-fst6hkg7.js → send-session-notification-kxp47tsw.js} +4 -3
- package/dist/v2/{server-cpjk5jd2.js → server-1d042x6w.js} +16 -14
- package/dist/v2/{server-fqj6ddpr.js → server-5by3vdzs.js} +186 -89
- package/dist/v2/{server-5jp38p98.js → server-6emy0v9a.js} +1 -2
- package/dist/v2/{server-rktnzs89.js → server-6vzh6wej.js} +1 -1
- package/dist/v2/{server-qa74bj91.js → server-7094pk3w.js} +9 -8
- package/dist/v2/{server-bxpz2dcn.js → server-7acq7815.js} +8 -6
- package/dist/v2/server-7v05d9b7.js +58 -0
- package/dist/v2/{server-24g8r2d0.js → server-7zacmty5.js} +75 -75
- package/dist/v2/server-96ztjvkn.js +204 -0
- package/dist/v2/{server-hnknwaz8.js → server-a9w5f0yw.js} +3 -3
- package/dist/v2/{server-9k0mjef7.js → server-avdveykk.js} +1 -1
- package/dist/v2/{server-hsf0qsn5.js → server-cp1a03vc.js} +1 -1
- package/dist/v2/{server-r3chnxs5.js → server-dfq5vb8j.js} +2 -2
- package/dist/v2/{server-x4m6xcn4.js → server-e51xmr4d.js} +6 -6
- package/dist/v2/{server-7ccxt4nq.js → server-g3gqq4ac.js} +6 -3
- package/dist/v2/{server-kkxzwa6w.js → server-gkse1wyz.js} +3 -3
- package/dist/v2/{server-1xesqm5h.js → server-jd7vzwn4.js} +15 -13
- package/dist/v2/{server-ws5exe6q.js → server-nmyganc8.js} +1 -1
- package/dist/v2/{server-q0z2q2dx.js → server-nq3cb7be.js} +1 -1
- package/dist/v2/{server-55v5hpth.js → server-qjyp27vf.js} +2 -2
- package/dist/v2/{server-xbtw0p9t.js → server-r4430x9m.js} +9 -3
- package/dist/v2/{server-qf2kzsh2.js → server-t8y64xj7.js} +4 -4
- package/dist/v2/{server-s9xgyyj9.js → server-tnzbk64q.js} +34 -4
- package/dist/v2/{server-51779zs2.js → server-v0p37hm2.js} +4 -1
- package/dist/v2/{server-bpvsvtph.js → server-xfjjbrkt.js} +12 -1
- package/dist/v2/server.js +4 -4
- package/dist/v2/{storage-tags-19s0ebf0.js → storage-tags-cw07ky67.js} +1 -1
- package/dist/v2/{store-vdm8v3jd.js → store-z3qe67cg.js} +1 -1
- package/dist/v2/{v2-archive-reader-t2c0eypn.js → v2-archive-reader-z7wr42ry.js} +3 -3
- package/dist/v2/{wrapup-orchestrator-aqpqsveg.js → wrapup-orchestrator-j1v62bkj.js} +19 -18
- package/dist/{v2-archive-reader-tm2eayp2.js → v2-archive-reader-028z6kck.js} +2 -2
- package/dist/{wrapup-orchestrator-k5yp19a6.js → wrapup-orchestrator-xg9avt2p.js} +21 -20
- package/package.json +1 -1
- package/src/shared/model-suggestion-retry.ts +1 -1
- package/src/shared/prompt-async-transport.test.ts +64 -3
- package/src/shared/prompt-async-transport.ts +61 -16
- package/src/shared/reusable-worker-entry.ts +58 -0
- package/src/shared/reusable-worker-reset.test.ts +108 -0
- package/src/shared/reusable-worker.fixture.ts +35 -0
- package/src/shared/reusable-worker.test.ts +253 -0
- package/src/shared/reusable-worker.ts +240 -0
- package/src/shared/worker-shutdown.ts +21 -17
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
expandToolPart,
|
|
6
6
|
visitRawSessionMessages2,
|
|
7
7
|
readRawSessionMessageById2
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-tn9drm1a.js";
|
|
9
9
|
import {
|
|
10
10
|
getTagById2
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-8jjjmhab.js";
|
|
12
12
|
|
|
13
13
|
// src/tools/ctx-expand/render.ts
|
|
14
14
|
import { createHash } from "node:crypto";
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
releaseCompartmentLeaseBestEffort,
|
|
9
9
|
getCompartments,
|
|
10
10
|
getLastCompartmentEndMessage
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-72czy45z.js";
|
|
12
12
|
import {
|
|
13
13
|
inRootAsyncContext2
|
|
14
14
|
} from "./index-gzy5w8ya.js";
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
getHistorianFailureState,
|
|
21
21
|
clearEmergencyRecovery,
|
|
22
22
|
prepareRawSessionOrdinals2
|
|
23
|
-
} from "./index-
|
|
23
|
+
} from "./index-tn9drm1a.js";
|
|
24
24
|
import {
|
|
25
25
|
pushNotification2
|
|
26
26
|
} from "./index-x8a7jmkh.js";
|
|
@@ -32,14 +32,14 @@ import {
|
|
|
32
32
|
getActiveCompartmentRun,
|
|
33
33
|
markActiveCompartmentRunPublished,
|
|
34
34
|
registerActiveCompartmentRun
|
|
35
|
-
} from "./index-
|
|
35
|
+
} from "./index-9tdvbdv1.js";
|
|
36
36
|
import {
|
|
37
37
|
sendStatusNotification2
|
|
38
|
-
} from "./index-
|
|
38
|
+
} from "./index-ae1ar4v1.js";
|
|
39
39
|
import {
|
|
40
40
|
setRecompStarting2,
|
|
41
41
|
setRecompTerminal2
|
|
42
|
-
} from "./index-
|
|
42
|
+
} from "./index-ys7j6679.js";
|
|
43
43
|
|
|
44
44
|
// src/hooks/magic-context/wrapup-orchestrator.ts
|
|
45
45
|
import * as crypto from "node:crypto";
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./index-gzy5w8ya.js";
|
|
7
7
|
import {
|
|
8
8
|
createWorkerShutdown
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-1d042x6w.js";
|
|
10
10
|
|
|
11
11
|
// src/tools/ctx-expand/v2-archive-reader.ts
|
|
12
12
|
import { Worker } from "node:worker_threads";
|
|
@@ -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-yh19h38c.js"),
|
|
141
|
-
import("./store-
|
|
142
|
-
import("./read-session-chunk-
|
|
143
|
-
import("./render-
|
|
144
|
-
import("./search-archive-
|
|
141
|
+
import("./store-s3eykdjt.js"),
|
|
142
|
+
import("./read-session-chunk-26yrrhyz.js"),
|
|
143
|
+
import("./render-h1qarr8a.js"),
|
|
144
|
+
import("./search-archive-q79hyqxs.js"),
|
|
145
145
|
import("./expand-attachments-h33jbgyz.js")
|
|
146
146
|
]);
|
|
147
147
|
const pool = new V2StoreReaderPool;
|
|
@@ -9,9 +9,12 @@ import {
|
|
|
9
9
|
getSqliteDatabasePath2,
|
|
10
10
|
releaseIndexOwner2
|
|
11
11
|
} from "./index-gzy5w8ya.js";
|
|
12
|
+
import {
|
|
13
|
+
reuseWorker
|
|
14
|
+
} from "./index-96ztjvkn.js";
|
|
12
15
|
import {
|
|
13
16
|
createWorkerShutdown
|
|
14
|
-
} from "./index-
|
|
17
|
+
} from "./index-1d042x6w.js";
|
|
15
18
|
|
|
16
19
|
// src/hooks/magic-context/raw-ordinal-warmup.ts
|
|
17
20
|
import { Worker } from "node:worker_threads";
|
|
@@ -1207,6 +1210,7 @@ function runSessionWarmupWorker(input, options) {
|
|
|
1207
1210
|
clearTimeout(deadline);
|
|
1208
1211
|
options.signal?.removeEventListener("abort", abort);
|
|
1209
1212
|
if (worker) {
|
|
1213
|
+
worker.off("online", startDeadline);
|
|
1210
1214
|
activeWorkers.delete(worker);
|
|
1211
1215
|
const stopped = shutdown?.close() ?? worker.terminate();
|
|
1212
1216
|
worker.unref();
|
|
@@ -1224,6 +1228,10 @@ function runSessionWarmupWorker(input, options) {
|
|
|
1224
1228
|
deadline = setTimeout(() => finish({ failure, detail: `no reply within ${ms} ms` }), ms);
|
|
1225
1229
|
deadline.unref?.();
|
|
1226
1230
|
};
|
|
1231
|
+
const startDeadline = () => {
|
|
1232
|
+
if (!settled)
|
|
1233
|
+
arm("not-accepted", options.acceptMs ?? ACCEPT_TIMEOUT_MS);
|
|
1234
|
+
};
|
|
1227
1235
|
const abort = () => finish({ failure: "stopped", detail: "stopped" });
|
|
1228
1236
|
if (options.signal?.aborted) {
|
|
1229
1237
|
abort();
|
|
@@ -1231,8 +1239,14 @@ function runSessionWarmupWorker(input, options) {
|
|
|
1231
1239
|
}
|
|
1232
1240
|
options.signal?.addEventListener("abort", abort, { once: true });
|
|
1233
1241
|
try {
|
|
1234
|
-
worker = inRootAsyncContext2(() => new Worker(options.entry
|
|
1242
|
+
worker = inRootAsyncContext2(() => options.entry ? new Worker(options.entry, {
|
|
1235
1243
|
workerData: { ...input, openCancellation: openCancellation.buffer }
|
|
1244
|
+
}) : reuseWorker(defaultEntry(), {
|
|
1245
|
+
workerData: {
|
|
1246
|
+
...input,
|
|
1247
|
+
job: rawWorkerJobKind(input),
|
|
1248
|
+
openCancellation: openCancellation.buffer
|
|
1249
|
+
}
|
|
1236
1250
|
}));
|
|
1237
1251
|
shutdown = createWorkerShutdown(worker, "raw-ordinal-warmup", WARMUP_CLOSE_DEADLINE_MS);
|
|
1238
1252
|
} catch (error) {
|
|
@@ -1241,7 +1255,10 @@ function runSessionWarmupWorker(input, options) {
|
|
|
1241
1255
|
}
|
|
1242
1256
|
worker.unref();
|
|
1243
1257
|
activeWorkers.set(worker, (failure) => finish({ failure, detail: "stopped" }));
|
|
1244
|
-
|
|
1258
|
+
if (options.entry)
|
|
1259
|
+
startDeadline();
|
|
1260
|
+
else
|
|
1261
|
+
worker.once("online", startDeadline);
|
|
1245
1262
|
worker.on("message", (reply) => {
|
|
1246
1263
|
if (reply.kind === "accepted")
|
|
1247
1264
|
arm("no-result", options.resultMs ?? RESULT_TIMEOUT_MS);
|
|
@@ -1271,6 +1288,19 @@ function runSessionWarmupWorker(input, options) {
|
|
|
1271
1288
|
worker.on("exit", (code) => finish({ failure: "exited", detail: `exit code ${code}` }));
|
|
1272
1289
|
});
|
|
1273
1290
|
}
|
|
1291
|
+
function rawWorkerJobKind(input) {
|
|
1292
|
+
if (input.indexMessage)
|
|
1293
|
+
return "index-message";
|
|
1294
|
+
if (input.ftsRowidBackfill)
|
|
1295
|
+
return "fts-rowid-backfill";
|
|
1296
|
+
if (input.searchArchive)
|
|
1297
|
+
return "search-archive";
|
|
1298
|
+
if (input.exactOrdinalIds)
|
|
1299
|
+
return "exact-ordinal-ids";
|
|
1300
|
+
if (input.tagRatio !== undefined)
|
|
1301
|
+
return input.tagState ? "tag-delta" : "tag-summary";
|
|
1302
|
+
return "ordinal-scan";
|
|
1303
|
+
}
|
|
1274
1304
|
function prewarmRawSessionOrdinalsForDb(db, sessionId, options = {}) {
|
|
1275
1305
|
if (isRawSessionSummaryWarm2(db, sessionId))
|
|
1276
1306
|
return Promise.resolve("warm");
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
TAG_SELECT_COLUMNS2,
|
|
25
25
|
getCandidateToolOwners2,
|
|
26
26
|
pickNearestPriorOwner2
|
|
27
|
-
} from "./index-
|
|
27
|
+
} from "./index-8jjjmhab.js";
|
|
28
28
|
import {
|
|
29
29
|
OMO_INTERNAL_INITIATOR_MARKER,
|
|
30
30
|
isSystemDirective,
|
|
@@ -53,7 +53,7 @@ import {
|
|
|
53
53
|
renderToolTemplate,
|
|
54
54
|
resolveModelConfigValue,
|
|
55
55
|
deriveDefaultProtectedTokens
|
|
56
|
-
} from "./index-
|
|
56
|
+
} from "./index-c5dzns43.js";
|
|
57
57
|
import {
|
|
58
58
|
readRawSessionMessagesFromDb2,
|
|
59
59
|
readRawSessionMessagePageFromDb2,
|
|
@@ -70,13 +70,13 @@ import {
|
|
|
70
70
|
readRawSeedTailFromDb2,
|
|
71
71
|
readRawSessionBoundaryEndpointsFromDb2,
|
|
72
72
|
prewarmRawSessionOrdinalsForDb
|
|
73
|
-
} from "./index-
|
|
73
|
+
} from "./index-r2epb000.js";
|
|
74
74
|
import {
|
|
75
75
|
openCodeDbExists,
|
|
76
76
|
withReadOnlySessionDb,
|
|
77
77
|
getRawSessionMessageCountFromDb,
|
|
78
78
|
getMessageTimesFromOpenCodeDb
|
|
79
|
-
} from "./index-
|
|
79
|
+
} from "./index-vd2ywmfe.js";
|
|
80
80
|
import {
|
|
81
81
|
getToolDefinitionMeasurementSignature,
|
|
82
82
|
getMeasuredToolDefinitionTokens,
|
|
@@ -651,7 +651,7 @@ function looksImageLike(part) {
|
|
|
651
651
|
const type = typeof part.type === "string" ? part.type.toLowerCase() : "";
|
|
652
652
|
const mime = typeof part.mime === "string" ? part.mime.toLowerCase() : "";
|
|
653
653
|
const mediaType = typeof part.mediaType === "string" ? part.mediaType.toLowerCase() : "";
|
|
654
|
-
return type.includes("image") || mime.startsWith("image/") || mediaType.startsWith("image/") || part.image_url !== undefined || part.imageUrl !== undefined || part.image !== undefined;
|
|
654
|
+
return type.includes("image") || mime.startsWith("image/") || mediaType.startsWith("image/") || part.image_url !== undefined || part.imageUrl !== undefined || part.image !== undefined || type.includes("file") && (typeof part.url === "string" && part.url.startsWith("data:image/") || typeof part.data === "string" && /^(?:data:image\/|\/9j\/|iVBORw0KGgo|R0lGOD)/.test(part.data));
|
|
655
655
|
}
|
|
656
656
|
function defaultImageTokenHeuristic(part) {
|
|
657
657
|
if (isRecord(part)) {
|
|
@@ -1015,7 +1015,7 @@ function buildTrueRawTokenIndex(sessionId, messages, options) {
|
|
|
1015
1015
|
} else {
|
|
1016
1016
|
const raw = tokenForMessage(message, options);
|
|
1017
1017
|
const seed = options.calibration;
|
|
1018
|
-
total = seed ? (raw.toolInput + raw.toolOutput) * seed.toolsRatio + (raw.text + raw.reasoning + raw.other) * seed.proseRatio + raw.image : raw.total;
|
|
1018
|
+
total = options.measure === "summary-removed" ? raw.text * (seed?.proseRatio ?? 1) + raw.toolInput * (seed?.toolsRatio ?? 1) : seed ? (raw.toolInput + raw.toolOutput) * seed.toolsRatio + (raw.text + raw.reasoning + raw.other) * seed.proseRatio + raw.image : raw.total;
|
|
1019
1019
|
}
|
|
1020
1020
|
tokensByOrdinal.set(message.ordinal, total);
|
|
1021
1021
|
idsByOrdinal.set(message.ordinal, message.id);
|
|
@@ -4144,12 +4144,6 @@ function getSessionsWithPendingMarker(db) {
|
|
|
4144
4144
|
AND pending_compaction_marker_state != ''`).all();
|
|
4145
4145
|
return rows.map((r) => r.session_id);
|
|
4146
4146
|
}
|
|
4147
|
-
function setSessionWorkMetrics(db, sessionId, newWorkTokens, totalInputTokens) {
|
|
4148
|
-
ensureSessionMetaRow(db, sessionId);
|
|
4149
|
-
db.prepare(`UPDATE session_meta
|
|
4150
|
-
SET new_work_tokens = ?, total_input_tokens = ?
|
|
4151
|
-
WHERE session_id = ?`).run(Math.max(0, Math.floor(newWorkTokens)), Math.max(0, Math.floor(totalInputTokens)), sessionId);
|
|
4152
|
-
}
|
|
4153
4147
|
var preSnapshotSessions = new Map;
|
|
4154
4148
|
var warnedProtectedTokenTierOverrides = new WeakSet;
|
|
4155
4149
|
function isPreSnapshotMemo(value) {
|
|
@@ -4361,6 +4355,8 @@ var OVERFLOW_PATTERNS = [
|
|
|
4361
4355
|
/request entity too large/i,
|
|
4362
4356
|
/context length is only \d+ tokens/i,
|
|
4363
4357
|
/input length.*exceeds.*context length/i,
|
|
4358
|
+
/\bContextWindowExceededError\b/i,
|
|
4359
|
+
/\bthe input \(\d+ tokens?\) is longer than the model's context length \(\d+ tokens?\)/i,
|
|
4364
4360
|
/prompt too long; exceeded (?:max )?context length/i,
|
|
4365
4361
|
/too large for model with \d+ maximum context length/i,
|
|
4366
4362
|
/model_context_window_exceeded/i,
|
|
@@ -4383,6 +4379,10 @@ var LIMIT_EXTRACTION_PATTERNS = [
|
|
|
4383
4379
|
},
|
|
4384
4380
|
{ pattern: /context size[^0-9]{0,40}(\d{4,})\s*tokens?/i, provenance: "combined" },
|
|
4385
4381
|
{ pattern: /exceeds? the context length of (\d+)/i, provenance: "combined" },
|
|
4382
|
+
{
|
|
4383
|
+
pattern: /\bthe input \(\d+ tokens?\) is longer than the model's context length \((\d+) tokens?\)/i,
|
|
4384
|
+
provenance: "combined"
|
|
4385
|
+
},
|
|
4386
4386
|
{
|
|
4387
4387
|
pattern: />\s*(\d+)\s*(?:tokens?\s*)?(?:maximum|max|limit)\b/i,
|
|
4388
4388
|
provenance: "prompt_only"
|
|
@@ -4521,7 +4521,9 @@ function parseReportedInputTokens(message) {
|
|
|
4521
4521
|
/input token count\s*\(?\s*(\d+)/i,
|
|
4522
4522
|
/input length\s*(\d+)/i,
|
|
4523
4523
|
/prompt was\s*(\d+)/i,
|
|
4524
|
-
/messages resulted in\s*(\d+)\s*tokens?/i
|
|
4524
|
+
/messages resulted in\s*(\d+)\s*tokens?/i,
|
|
4525
|
+
/\bthe input \((\d+) tokens?\) is longer than the model's context length \(\d+ tokens?\)/i,
|
|
4526
|
+
/\(\s*(\d+)\s+in the messages,\s*\d+\s+in the completion\s*\)/i
|
|
4525
4527
|
];
|
|
4526
4528
|
for (const pattern of patterns) {
|
|
4527
4529
|
const raw = message.match(pattern)?.[1];
|
|
@@ -7600,4 +7602,4 @@ function readRawSessionSeedTail2(sessionId, boundaryId, onQuery) {
|
|
|
7600
7602
|
});
|
|
7601
7603
|
}
|
|
7602
7604
|
|
|
7603
|
-
export { isToolFreeHiddenAgent, TOOL_USE_DISABLED, ZEN_READ_AGENT_SUFFIX, needsBlockedRead, withBlockedReadInstruction, rememberV1HiddenRun, shapeV1HiddenMessage, expandToolPart, askAnswerLines, removeUnsupportedCommitHashes, completedToolArcCrossesBoundary, estimateTrueRawMessageTokens, buildToolArcs, fenceBoundaryForCompletedToolArcs, fenceBoundaryForToolArcs, buildTrueRawTokenIndex, computeRawRangeFingerprint, invalidateTrueRawTokenCache, stripSystemInjection, isTextPart, isToolPartWithOutput, isFilePart, toolPartHasUserAnswer, DreamTokenBudgetExceeded, TOKEN_BUDGET_FINALIZE_MESSAGE, registerBudgetFinalizeChild, releaseBudgetFinalizeChild, createDreamTokenBudget, recordToolParameters, createDroppedInputGuard, assertExecutableToolInput, createDroppedInputToolExecuteBeforeHook, isEditTool, createFinalWireIncompleteLogger, MERGED_REASONING_PARTS_PREFIX, decodeMergedReasoningParts, MAX_EXECUTE_THRESHOLD, escalationBands, HYGIENE_PROVIDER_UNITS_VERSION, sessionDecisionCalibration, transitionSessionHygieneUnits, readEpochFloorSnapshot, getProtectionWindowForSession, SESSION_META_SELECT_COLUMNS, META_COLUMNS, BOOLEAN_META_KEYS, NULL_BIND_META_KEYS, isSessionMetaRow, getDefaultSessionMeta, ensureSessionMetaRow, toSessionMeta, persistCachedM0, clearCachedM0M1, clearCachedM0, withReplayEnvelopeSnapshot, invalidateReplayEnvelopeSnapshot, isRustMarkerAdmissionFenced, setRustMarkerAdmissionFence, ReplayDocumentError, readReplayEnvelope, readReplayDocument, updateReplayDocument, writeReplayDocument, isEmergencyRecoveryArmed, isProviderOverflowReconfirmed, isProviderOverflowFailClosedProven, getEmergencyRecoveryArmedAt, describeProtectedTailDrainBudgetSkip, loadPersistedUsage, loadProtectedTailMeta, markProtectedTailPolicyV3Seeded, recordProtectedTailPublicationFloor, recordProtectedTailNoEligibleHead, resetProtectedTailNoEligibleHead, getWrapupInProgressState, isWrapupInProgress, acquireWrapupInProgress, updateWrapupInProgress, releaseWrapupInProgress, resolveCompactionModeRecord, getCompactionModeRecord, setCompactionModeRecord, getProtectedTailDrainBudgetSkip, reserveProtectedTailDrainTokens, clearEmergencyDrainLatch, recordHistorianDrainFailure, clearHistorianDrainFailure, rollbackProtectedTailDrainReservation, getPersistedReasoningWatermark, setPersistedReasoningWatermark, clearPersistedReasoningWatermark, getEmergencyInputSample, setEmergencyDropSample, clearEmergencyDropSample, getLastNudgeUndropped, setLastNudgeUndropped, getChannel1NudgeState, setChannel1NudgeState, markChannel1PostReduceGracePending, captureChannel1PostReduceGraceBaseline, getChannel2NudgeState, getChannel2NudgeClaim, setChannel2NudgeState, casChannel2NudgeState, claimChannel2NudgeState, casChannel2NudgeClaim, getPersistedNoteNudge, setPersistedNoteNudgeTrigger, setPersistedNoteNudgeTriggerMessageId, getNoteNudgeAnchors, getAutoSearchHintDecisions, deliverNoteNudgeAtomic, appendAutoSearchHintDecision, pruneNoteNudgeAnchors, removeNoteNudgeAnchorByMessageId, queueAutoSearchHintDecisionRetirement, flushAutoSearchHintDecisionRetirement, removeAutoSearchHintDecisionByMessageId, getPersistedTodoPermissionDenied, setPersistedTodoPermissionDenied, getPersistedTodoSyntheticAnchor, setPersistedTodoSyntheticAnchor, clearPersistedTodoSyntheticAnchor, getNoteLastReadAt, setNoteLastReadAt, getHistorianFailureState, incrementHistorianFailure, clearHistorianFailureState, getOverflowState, loadTransformPassStateSnapshot, recordOverflowDetected, recordDetectedContextLimit, clearEmergencyRecovery, clearDetectedContextLimit, getPersistedCompactionMarkerState, getCompactionMarkerPublicationState, compareAndSetCompactionMarkerPublicationState, setPersistedCompactionMarkerState, getDeferredClearedCompactionMarkerState, retireDeferredClearedCompactionMarkerState, parseStrippedPlaceholderState, serializeStrippedPlaceholderState, getStrippedPlaceholderIds, applyStrippedPlaceholderDelta, removeStrippedPlaceholderId, THINKING_BINDING_RECOVERY_FROZEN_PREFIX, THINKING_BINDING_STRIP_ORDER_END_MARKER, thinkingBindingRecoveryFrozenId, COMPACTION_OFF_THINKING_FROZEN_PREFIX, compactionOffThinkingFrozenId, compactionOffFrozenThinkingIds, getThinkingBindingRecoveryTarget, armThinkingBindingRecovery, clearThinkingBindingRecoveryIf, getMergedReasoningStrippedIds, addMergedReasoningStrippedIds, getTrailingBlankDecisions, addTrailingBlankDecisions, demoteTrailingBlankKeepDecisions, getStaleReduceStrippedIds, addStaleReduceStrippedIds, getProcessedImageStrippedIds, parseProcessedImageMarkers, serializeProcessedImageMarkers, getProcessedImageMarkers, addProcessedImageStrippedIds, getPendingCompactionMarkerState, getCompactionMarkerHealth, loadPostprocessReplaySnapshot, setPendingCompactionMarkerState, replacePendingCompactionMarkerStateIf, clearPendingCompactionMarkerStateIf, getPendingPiCompactionMarkerState, clearPendingPiCompactionMarkerStateIf, logPiCompactionMarkerClear, getSessionsWithPendingMarker,
|
|
7605
|
+
export { isToolFreeHiddenAgent, TOOL_USE_DISABLED, ZEN_READ_AGENT_SUFFIX, needsBlockedRead, withBlockedReadInstruction, rememberV1HiddenRun, shapeV1HiddenMessage, expandToolPart, askAnswerLines, removeUnsupportedCommitHashes, completedToolArcCrossesBoundary, estimateTrueRawMessageTokens, buildToolArcs, fenceBoundaryForCompletedToolArcs, fenceBoundaryForToolArcs, buildTrueRawTokenIndex, computeRawRangeFingerprint, invalidateTrueRawTokenCache, stripSystemInjection, isTextPart, isToolPartWithOutput, isFilePart, toolPartHasUserAnswer, DreamTokenBudgetExceeded, TOKEN_BUDGET_FINALIZE_MESSAGE, registerBudgetFinalizeChild, releaseBudgetFinalizeChild, createDreamTokenBudget, recordToolParameters, createDroppedInputGuard, assertExecutableToolInput, createDroppedInputToolExecuteBeforeHook, isEditTool, createFinalWireIncompleteLogger, MERGED_REASONING_PARTS_PREFIX, decodeMergedReasoningParts, MAX_EXECUTE_THRESHOLD, escalationBands, HYGIENE_PROVIDER_UNITS_VERSION, sessionDecisionCalibration, transitionSessionHygieneUnits, readEpochFloorSnapshot, getProtectionWindowForSession, SESSION_META_SELECT_COLUMNS, META_COLUMNS, BOOLEAN_META_KEYS, NULL_BIND_META_KEYS, isSessionMetaRow, getDefaultSessionMeta, ensureSessionMetaRow, toSessionMeta, persistCachedM0, clearCachedM0M1, clearCachedM0, withReplayEnvelopeSnapshot, invalidateReplayEnvelopeSnapshot, isRustMarkerAdmissionFenced, setRustMarkerAdmissionFence, ReplayDocumentError, readReplayEnvelope, readReplayDocument, updateReplayDocument, writeReplayDocument, isEmergencyRecoveryArmed, isProviderOverflowReconfirmed, isProviderOverflowFailClosedProven, getEmergencyRecoveryArmedAt, describeProtectedTailDrainBudgetSkip, loadPersistedUsage, loadProtectedTailMeta, markProtectedTailPolicyV3Seeded, recordProtectedTailPublicationFloor, recordProtectedTailNoEligibleHead, resetProtectedTailNoEligibleHead, getWrapupInProgressState, isWrapupInProgress, acquireWrapupInProgress, updateWrapupInProgress, releaseWrapupInProgress, resolveCompactionModeRecord, getCompactionModeRecord, setCompactionModeRecord, getProtectedTailDrainBudgetSkip, reserveProtectedTailDrainTokens, clearEmergencyDrainLatch, recordHistorianDrainFailure, clearHistorianDrainFailure, rollbackProtectedTailDrainReservation, getPersistedReasoningWatermark, setPersistedReasoningWatermark, clearPersistedReasoningWatermark, getEmergencyInputSample, setEmergencyDropSample, clearEmergencyDropSample, getLastNudgeUndropped, setLastNudgeUndropped, getChannel1NudgeState, setChannel1NudgeState, markChannel1PostReduceGracePending, captureChannel1PostReduceGraceBaseline, getChannel2NudgeState, getChannel2NudgeClaim, setChannel2NudgeState, casChannel2NudgeState, claimChannel2NudgeState, casChannel2NudgeClaim, getPersistedNoteNudge, setPersistedNoteNudgeTrigger, setPersistedNoteNudgeTriggerMessageId, getNoteNudgeAnchors, getAutoSearchHintDecisions, deliverNoteNudgeAtomic, appendAutoSearchHintDecision, pruneNoteNudgeAnchors, removeNoteNudgeAnchorByMessageId, queueAutoSearchHintDecisionRetirement, flushAutoSearchHintDecisionRetirement, removeAutoSearchHintDecisionByMessageId, getPersistedTodoPermissionDenied, setPersistedTodoPermissionDenied, getPersistedTodoSyntheticAnchor, setPersistedTodoSyntheticAnchor, clearPersistedTodoSyntheticAnchor, getNoteLastReadAt, setNoteLastReadAt, getHistorianFailureState, incrementHistorianFailure, clearHistorianFailureState, getOverflowState, loadTransformPassStateSnapshot, recordOverflowDetected, recordDetectedContextLimit, clearEmergencyRecovery, clearDetectedContextLimit, getPersistedCompactionMarkerState, getCompactionMarkerPublicationState, compareAndSetCompactionMarkerPublicationState, setPersistedCompactionMarkerState, getDeferredClearedCompactionMarkerState, retireDeferredClearedCompactionMarkerState, parseStrippedPlaceholderState, serializeStrippedPlaceholderState, getStrippedPlaceholderIds, applyStrippedPlaceholderDelta, removeStrippedPlaceholderId, THINKING_BINDING_RECOVERY_FROZEN_PREFIX, THINKING_BINDING_STRIP_ORDER_END_MARKER, thinkingBindingRecoveryFrozenId, COMPACTION_OFF_THINKING_FROZEN_PREFIX, compactionOffThinkingFrozenId, compactionOffFrozenThinkingIds, getThinkingBindingRecoveryTarget, armThinkingBindingRecovery, clearThinkingBindingRecoveryIf, getMergedReasoningStrippedIds, addMergedReasoningStrippedIds, getTrailingBlankDecisions, addTrailingBlankDecisions, demoteTrailingBlankKeepDecisions, getStaleReduceStrippedIds, addStaleReduceStrippedIds, getProcessedImageStrippedIds, parseProcessedImageMarkers, serializeProcessedImageMarkers, getProcessedImageMarkers, addProcessedImageStrippedIds, getPendingCompactionMarkerState, getCompactionMarkerHealth, loadPostprocessReplaySnapshot, setPendingCompactionMarkerState, replacePendingCompactionMarkerStateIf, clearPendingCompactionMarkerStateIf, getPendingPiCompactionMarkerState, clearPendingPiCompactionMarkerStateIf, logPiCompactionMarkerClear, getSessionsWithPendingMarker, getObservedEpochFloor, resolveEpochFloorForPass, getReasoningRemovalState, addRemovedReasoningIds, markDropLeavesReasoning, detectThinkingBindingMismatch, detectLatestTurnThinkingMismatch, isPrefixBoundThinkingModel, detectOverflow, modelAcceptsEmptyContent, isAnthropicFamilyRoute, neutralizeDroppedReasoningPart, restoreNeutralizedReasoningPart, isNeutralizedReasoningPart, variantChangeBustsProviderCache, makeSentinel, makeWholeMessageSentinel, isSentinel, replaySentinelByMessageIds, isInActiveAnthropicTurn, activeAnthropicTurnStart, hasAnthropicReasoning, markServedShapeRepair, prepareServedShapeRepair, stripSystemInjectedMessages, stripDroppedPlaceholderMessages, replayClearedReasoning, replayStrippedInlineThinking, clearOldReasoning, stripClearedReasoning, captureInlineThinkingRepairs, stripInlineThinking, findReasoningBearingAssistantIds, findLatestAssistantReasoningMutationExemptMessage, snapshotTrailingBlankSourceDecisions, findTrailingBlankDecisionCandidates, applyFrozenTrailingBlankDecisions, stripReasoningFromAssistantIds, findMergedReasoningStripDecisions, stripReasoningFromMergedAssistants, getEmptyImageParts, stripProcessedImages, projectOpencodeReasoningBudgetCutoff, DEFAULT_KEEP_REASONING_TOKENS, resolveKeepReasoningTokens, reasoningStepCost, reasoningBudgetCutoff, reasoningTextAndOpaque, opencodeReasoningBudgetCutoff, describeFinalWireTail, estimatePartImageTokens, estimateMessageTokens, wireContentBytes, createFinalWireUsageTracker, estimateFinalWireInputTokens, estimateAppendedWireTokens, SKELETON_REAL_INPUT_MAX_BYTES, partHasCompletedResult, extractToolCallObservation, ToolMutationBatch, createToolDropTarget, resolveHostServedBoundaryId2, hasRawMessageProvider2, rawMessageWorkerSource2, rawMessageOffThreadRangeReader2, setRawMessageProvider2, setBoundedRawMessageProvider2, withRawMessageProvider2, cleanUserText2, withRawSessionMessageCache2, readRawSessionMessages2, readRawSessionMessagePage2, getRawSessionMessageOrdinalCount2, RAW_MESSAGE_VISIT_PAGE_SIZE2, visitRawSessionMessages2, visitRawSessionMessagesAsync2, readRawSessionMessageRange2, prepareRawSessionOrdinals2, primeTailRawMessageCache2, getCachedAbsoluteMessageCount2, primeInMemoryTailRawMessageCache2, readRawSessionMessageOrdinalPage2, getRawSessionStoredMessageCount2, readRawSessionMessageIdOrdinalsForRange2, readRawSessionMessageIdOrdinals2, readRawSessionMessagePartsById2, readRawSessionBoundaryEndpoints2, hasRawSessionMessageById2, readRawSessionMessageOrdinalById2, resolveHistorianChunkStart2, compareRawSessionMessageOrder2, readRawSessionMessageById2, getRawSessionMessageCount2, RAW_SESSION_TAG_KEY_PAGE_SIZE2, getRawSessionTagKeysThrough2, getLegacyProtectedTailStartOrdinal2, getProtectedTailStartOrdinal2, readSessionChunk2, getRawSessionMessageIdsThrough2, readRawSessionSeedTail2 };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DEFAULT_LOCAL_EMBEDDING_MODEL
|
|
3
|
-
} from "./index-
|
|
3
|
+
} from "./index-c5dzns43.js";
|
|
4
4
|
import {
|
|
5
5
|
log2
|
|
6
6
|
} from "./index-jrfre9ah.js";
|
|
@@ -10,12 +10,12 @@ import {
|
|
|
10
10
|
} from "./index-g4t7850m.js";
|
|
11
11
|
import {
|
|
12
12
|
LocalEmbeddingProvider
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-xd2p95m7.js";
|
|
14
14
|
import {
|
|
15
15
|
OpenAICompatibleEmbeddingProvider,
|
|
16
16
|
getProjectEmbeddingSnapshot2,
|
|
17
17
|
embedBatchForProject2
|
|
18
|
-
} from "./index-
|
|
18
|
+
} from "./index-21fgrfrf.js";
|
|
19
19
|
import {
|
|
20
20
|
isEmbeddingHostBusy2
|
|
21
21
|
} from "./index-qt1qqasc.js";
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
loadCompartmentChunkEmbeddingsForSearch2,
|
|
25
25
|
peekCompartmentChunkSearchPool2,
|
|
26
26
|
warmCompartmentChunkSearchPool2
|
|
27
|
-
} from "./index-
|
|
27
|
+
} from "./index-dcjkw41m.js";
|
|
28
28
|
import {
|
|
29
29
|
saveCommitEmbedding,
|
|
30
30
|
loadProjectCommitEmbeddings,
|
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
enqueueShadowEmbeddingItems2,
|
|
41
41
|
getProjectEmbeddingSnapshot2,
|
|
42
42
|
embedItemsForProject2
|
|
43
|
-
} from "./index-
|
|
43
|
+
} from "./index-21fgrfrf.js";
|
|
44
44
|
import {
|
|
45
45
|
recordEmbeddingMeasurement
|
|
46
46
|
} from "./index-2amn2s73.js";
|
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
isEmbeddingEnabled,
|
|
53
53
|
embedText,
|
|
54
54
|
ensureMemoryEmbeddings2
|
|
55
|
-
} from "./index-
|
|
55
|
+
} from "./index-ty4vhe4n.js";
|
|
56
56
|
import {
|
|
57
57
|
ModuleMemoryAuthorityError2,
|
|
58
58
|
getMemoriesByProject2,
|
|
@@ -65,24 +65,24 @@ import {
|
|
|
65
65
|
sanitizeFtsQuery,
|
|
66
66
|
searchMemoriesFTS,
|
|
67
67
|
searchMemoriesFTSUnion
|
|
68
|
-
} from "./index-
|
|
68
|
+
} from "./index-xnm0wq1r.js";
|
|
69
69
|
import {
|
|
70
70
|
matchedSearchSnippet,
|
|
71
71
|
getIndexedMessageCorpusSize
|
|
72
|
-
} from "./index-
|
|
72
|
+
} from "./index-2rs7912w.js";
|
|
73
73
|
import {
|
|
74
74
|
MESSAGE_FTS_SESSION_FILTER_SQL,
|
|
75
75
|
withMessageFtsSessionFilter
|
|
76
76
|
} from "./index-kaqs6h31.js";
|
|
77
77
|
import {
|
|
78
78
|
isRecord
|
|
79
|
-
} from "./index-
|
|
79
|
+
} from "./index-8jjjmhab.js";
|
|
80
80
|
import {
|
|
81
81
|
getMessageIndexEpoch,
|
|
82
82
|
isMessageIndexSearchable,
|
|
83
83
|
autoSearchRelevance,
|
|
84
84
|
recordAutoSearchLane
|
|
85
|
-
} from "./index-
|
|
85
|
+
} from "./index-dz48h1wx.js";
|
|
86
86
|
import {
|
|
87
87
|
resolveWorkspaceShareCategories,
|
|
88
88
|
resolveWorkspaceIdentitySet,
|
|
@@ -1442,6 +1442,7 @@ var RERANK_MODEL = "gte-reranker-modernbert-base-f32";
|
|
|
1442
1442
|
var RERANK_LANE_LIMIT = 25;
|
|
1443
1443
|
var DEADLINE_MS = 1500;
|
|
1444
1444
|
var DOCUMENT_BYTES = 1024;
|
|
1445
|
+
var proseWordSegmenter = new Intl.Segmenter(undefined, { granularity: "word" });
|
|
1445
1446
|
function isProseQuery(query) {
|
|
1446
1447
|
const text = query.trim();
|
|
1447
1448
|
if (!text || /[\n;]|^["'`]|["'`]$/.test(text))
|
|
@@ -1450,10 +1451,10 @@ function isProseQuery(query) {
|
|
|
1450
1451
|
return false;
|
|
1451
1452
|
if (/\b(?:[A-Z][A-Z_]+:|\w*(?:Error|Exception):)|\bat\s+\S+\s*\(/.test(text))
|
|
1452
1453
|
return false;
|
|
1453
|
-
const words = text.replace(/[?!.]$/, "").split(/\s+/);
|
|
1454
|
+
const words = /(?![a-zA-Z])\p{L}/u.test(text) ? [...proseWordSegmenter.segment(text)].filter((word) => word.isWordLike).map((word) => word.segment) : text.replace(/[?!.]$/, "").split(/\s+/);
|
|
1454
1455
|
if (words.length < 3)
|
|
1455
1456
|
return false;
|
|
1456
|
-
const plain = words.filter((word) => /^[
|
|
1457
|
+
const plain = words.filter((word) => /^[\p{L}\p{M}]+(?:['’-][\p{L}\p{M}]+)*$/u.test(word));
|
|
1457
1458
|
if (/^(?:how|why|what|where|when|which|who)\b/i.test(text))
|
|
1458
1459
|
return plain.length >= 3;
|
|
1459
1460
|
return words.length >= 4 && plain.length >= 3 && !/[\\/]|::|=/.test(text);
|
|
@@ -3,18 +3,18 @@ import {
|
|
|
3
3
|
} from "./index-jrfre9ah.js";
|
|
4
4
|
import {
|
|
5
5
|
clearEmergencyRecovery
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-tn9drm1a.js";
|
|
7
7
|
import {
|
|
8
8
|
requestPendingMaterialization,
|
|
9
9
|
dropSlot
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-72czy45z.js";
|
|
11
11
|
import {
|
|
12
12
|
executeContextRecomp
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-9tdvbdv1.js";
|
|
14
14
|
import {
|
|
15
15
|
renderUserFacingFailure,
|
|
16
16
|
userFacingFailureCode
|
|
17
|
-
} from "./index-
|
|
17
|
+
} from "./index-xnm0wq1r.js";
|
|
18
18
|
|
|
19
19
|
// src/hooks/magic-context/recomp-orchestrator.ts
|
|
20
20
|
function resolveLiveModelKey(liveSessionState, sessionId) {
|