@cortexkit/opencode-magic-context 0.49.7 → 0.49.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auto-search-worker.js +6 -6
- package/dist/compaction-marker-candidates-worker.js +2 -2
- package/dist/{compaction-marker-candidates-a0edbqrr.js → compaction-marker-candidates-xxz35vwp.js} +3 -3
- package/dist/{conflict-warning-hook-myk5hbt9.js → conflict-warning-hook-w3crzrar.js} +8 -8
- package/dist/{context-ffr7e0g7.js → context-x0ccfv0f.js} +65 -42
- package/dist/{derive-budgets-j4ry8j8n.js → derive-budgets-3nbxsyss.js} +2 -2
- package/dist/embedding-backfill-3h2m5n0q.js +21 -0
- package/dist/embedding-worker-process.js +6 -2
- package/dist/embedding-worker.js +6 -5
- package/dist/features/magic-context/compaction-marker-candidates.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/cron.d.ts +2 -0
- package/dist/features/magic-context/dreamer/cron.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/provider-output-failure.d.ts +1 -0
- package/dist/features/magic-context/dreamer/provider-output-failure.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-local.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-worker-client.d.ts.map +1 -1
- package/dist/features/magic-context/message-index-async.d.ts.map +1 -1
- package/dist/features/magic-context/migration-worker-client.d.ts.map +1 -1
- package/dist/features/magic-context/project-embedding-registry.d.ts.map +1 -1
- package/dist/features/magic-context/smart-notes/wake-plane.d.ts.map +1 -1
- package/dist/features/magic-context/transform-decision-log.d.ts.map +1 -1
- package/dist/history-owner-ty29fz0f.js +244 -0
- package/dist/hooks/auto-update-checker/checker.d.ts.map +1 -1
- package/dist/hooks/magic-context/auto-search-worker-client.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-recomp.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner.d.ts.map +1 -1
- package/dist/hooks/magic-context/edit-marker.d.ts +2 -0
- package/dist/hooks/magic-context/edit-marker.d.ts.map +1 -1
- package/dist/hooks/magic-context/inject-compartments.d.ts.map +1 -1
- package/dist/hooks/magic-context/module-transport.d.ts +1 -0
- package/dist/hooks/magic-context/module-transport.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-chunk.d.ts +8 -4
- package/dist/hooks/magic-context/read-session-chunk.d.ts.map +1 -1
- package/dist/hooks/magic-context/rust-mode-transform.d.ts +1 -0
- package/dist/hooks/magic-context/rust-mode-transform.d.ts.map +1 -1
- package/dist/hooks/magic-context/rust-refusal-recovery.d.ts.map +1 -1
- package/dist/hooks/magic-context/tool-drop-target.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/hooks/magic-context/unresolved-history-boundary.d.ts +5 -1
- package/dist/hooks/magic-context/unresolved-history-boundary.d.ts.map +1 -1
- package/dist/hooks/magic-context/wrapup-orchestrator.d.ts.map +1 -1
- package/dist/{index-g8qbdb03.js → index-0jz47061.js} +6 -3
- package/dist/{index-4mjhqadz.js → index-150zz6fh.js} +1 -1
- package/dist/{index-j58gqrn2.js → index-2rw244rh.js} +31 -24
- package/dist/{index-0gyq3djm.js → index-4hb8nt93.js} +3 -3
- package/dist/{index-ax2jhztn.js → index-7bjgyaj1.js} +4 -4
- package/dist/{index-h2wc01qk.js → index-8kk7yh6m.js} +2 -2
- package/dist/{index-n5a170gs.js → index-9g1c4bt9.js} +81 -58
- package/dist/{index-w6bd03dc.js → index-a43xq1pg.js} +5 -5
- package/dist/{index-tqf7yg27.js → index-a4b0gbyg.js} +1 -1
- package/dist/{index-37q80veb.js → index-angx1s0k.js} +4 -3
- package/dist/{index-wq16ahsn.js → index-b4gcb3rk.js} +8 -8
- package/dist/{index-z1tjp257.js → index-b64n4d0h.js} +1 -1
- package/dist/{index-1bt88epp.js → index-bd9cjab3.js} +1 -1
- package/dist/{index-gbmqa9x9.js → index-bmwfzz28.js} +9 -6
- package/dist/{index-qx53vezw.js → index-gjvjh960.js} +1 -1
- package/dist/{index-ebnngykq.js → index-gzg9ekc1.js} +19 -18
- package/dist/{index-5tbvdff4.js → index-hxrvx6cy.js} +79 -40
- package/dist/{index-w23dh319.js → index-jw4gbfkv.js} +1 -1
- package/dist/index-knvkbfvh.js +25 -0
- package/dist/{index-vkbqdnkj.js → index-kvw6xew3.js} +6 -3
- package/dist/{index-rzmjkdd6.js → index-mp2kghkv.js} +3 -27
- package/dist/{index-nsjyysj0.js → index-mvvephtj.js} +5 -1
- package/dist/{index-9yyqq3mm.js → index-n78avt2p.js} +1 -1
- package/dist/{index-vt4sf4ep.js → index-pgy3h49n.js} +4 -4
- package/dist/{index-w6vr754t.js → index-pjgzdezw.js} +13 -9
- package/dist/{v2/server-1rfgbjfn.js → index-q28hsbpg.js} +15 -3
- package/dist/{index-a8acx4gc.js → index-q76br5zn.js} +3 -3
- package/dist/{index-j5hce1ab.js → index-qgp5vnt4.js} +5 -5
- package/dist/{index-sf94at64.js → index-rg1cezmj.js} +22 -22
- package/dist/{index-sh91t19a.js → index-s178h9z8.js} +4 -3
- package/dist/{index-tagss15p.js → index-w1ejb9qr.js} +105 -58
- package/dist/{index-k6xvbj2e.js → index-w28y7d0z.js} +2 -0
- package/dist/{index-j8epsc0g.js → index-wafzvyhg.js} +33 -10
- package/dist/{index-rwmpkss5.js → index-xf6k8szp.js} +4 -4
- package/dist/{index-tmtty2x5.js → index-xpn05jxq.js} +4 -4
- package/dist/{index-n7kwfw2r.js → index-ydjgz36f.js} +7 -7
- package/dist/{index-4btknbqh.js → index-zf9nydbd.js} +48 -38
- package/dist/index.js +51 -50
- package/dist/{logger-ewak5q1s.js → logger-wn328tfg.js} +1 -1
- package/dist/{message-index-bounded-04rycpx4.js → message-index-bounded-hxjp56qk.js} +16 -16
- package/dist/{message-index-rqtse28y.js → message-index-zs882h8e.js} +16 -16
- package/dist/{message-time-backfill-a5ytnp53.js → message-time-backfill-nb5hhnrt.js} +3 -3
- package/dist/migration-worker.js +11 -11
- package/dist/plugin/boot-quiet.d.ts.map +1 -1
- package/dist/plugin/dream-timer.d.ts.map +1 -1
- package/dist/plugin/rpc-handlers.d.ts +2 -0
- package/dist/plugin/rpc-handlers.d.ts.map +1 -1
- package/dist/{project-embedding-registry-k0sd9k7v.js → project-embedding-registry-vy7sv9jt.js} +11 -11
- package/dist/raw-ordinal-warmup-worker.js +6 -6
- package/dist/{read-session-chunk-h1btx938.js → read-session-chunk-t9r7r0sg.js} +11 -11
- package/dist/{read-session-raw-vdf4wh78.js → read-session-raw-gm6xj30v.js} +3 -3
- package/dist/recomp-orchestrator-gr36zvd2.js +60 -0
- package/dist/{safe-notification-target-q0cyrx3x.js → safe-notification-target-jdynm677.js} +2 -2
- package/dist/{search-3rbdx6hw.js → search-qjen1pmz.js} +24 -24
- package/dist/{send-session-notification-2tp44tfa.js → send-session-notification-q8ngbap3.js} +6 -6
- package/dist/shared/history-owner.d.ts +12 -0
- package/dist/shared/history-owner.d.ts.map +1 -0
- package/dist/shared/off-thread-migration-clock.d.ts +8 -1
- package/dist/shared/off-thread-migration-clock.d.ts.map +1 -1
- package/dist/shared/redaction.d.ts.map +1 -1
- package/dist/shared/rpc-server.d.ts.map +1 -1
- package/dist/shared/sqlite.d.ts +2 -0
- package/dist/shared/sqlite.d.ts.map +1 -1
- package/dist/shared/user-facing-codes.d.ts +2 -2
- package/dist/{sqlite-j3tvg8r0.js → sqlite-4pqyynrs.js} +3 -1
- package/dist/{storage-memory-8168bgef.js → storage-memory-j3v3hc83.js} +2 -2
- package/dist/{storage-tags-61z5j2f9.js → storage-tags-a513rkj3.js} +5 -5
- package/dist/{transform-postprocess-phase-7qts7h54.js → transform-postprocess-phase-yv463b7y.js} +30 -30
- package/dist/v2/auto-search-worker.js +6 -6
- package/dist/v2/{compaction-marker-candidates-6nypjkpf.js → compaction-marker-candidates-a15w3mqh.js} +3 -3
- package/dist/v2/compaction-marker-candidates-worker.js +2 -2
- package/dist/v2/{context-xq4rtywr.js → context-wd82v9z6.js} +137 -68
- package/dist/v2/{derive-budgets-enckmg7y.js → derive-budgets-0rmpmxjw.js} +3 -3
- package/dist/v2/embedding-backfill-vr7wdtrf.js +20 -0
- package/dist/v2/embedding-worker-process.js +6 -2
- package/dist/v2/embedding-worker.js +6 -5
- package/dist/v2/hidden-completion.d.ts.map +1 -1
- package/dist/v2/history-owner-2cr9py37.js +243 -0
- package/dist/v2/hooks/context.d.ts.map +1 -1
- package/dist/v2/hooks/store.d.ts +1 -0
- package/dist/v2/hooks/store.d.ts.map +1 -1
- package/dist/v2/{logger-pj02s7sr.js → logger-te6e1j72.js} +1 -1
- package/dist/v2/{message-index-bounded-5vh1h2g7.js → message-index-bounded-madg2kfr.js} +16 -16
- package/dist/v2/{message-index-8e5z2xx8.js → message-index-yd94vt9n.js} +16 -16
- package/dist/v2/{message-time-backfill-2z365239.js → message-time-backfill-rz1pnpaj.js} +3 -3
- package/dist/v2/migration-worker.js +11 -11
- package/dist/v2/{project-embedding-registry-b77awytr.js → project-embedding-registry-ja23aygk.js} +11 -11
- package/dist/v2/raw-ordinal-warmup-worker.js +6 -6
- package/dist/v2/{read-session-chunk-4sat83cx.js → read-session-chunk-7qs791f3.js} +11 -11
- package/dist/v2/{read-session-raw-a3hw9jsp.js → read-session-raw-h4azh85b.js} +3 -3
- package/dist/v2/recomp-orchestrator-ee91r9s6.js +59 -0
- package/dist/v2/{safe-notification-target-y3p1hce9.js → safe-notification-target-936374xx.js} +2 -2
- package/dist/v2/search-pn15rr52.js +46 -0
- package/dist/v2/{send-session-notification-ppgc8qdz.js → send-session-notification-6n7chhyp.js} +6 -6
- package/dist/v2/{server-v4fwha43.js → server-08k4zkfk.js} +48 -38
- package/dist/v2/{server-ras2sxnc.js → server-44ryn9rb.js} +9 -6
- package/dist/v2/{server-fw31krgq.js → server-4easnf78.js} +19 -19
- package/dist/v2/{server-hcvcxzx7.js → server-4gz0xkrc.js} +5 -5
- package/dist/v2/{server-d6g4whc2.js → server-4qr18rfg.js} +3 -3
- package/dist/v2/{server-sy4b1sra.js → server-4rs8sm06.js} +5 -5
- package/dist/v2/{server-brhj8qtd.js → server-63ha7f0f.js} +3 -27
- package/dist/v2/{server-3t0q2cqx.js → server-7dv9wt9r.js} +1 -1
- package/dist/v2/{server-cw6521wn.js → server-7e087rvk.js} +2 -0
- package/dist/v2/{server-hb6xhh9q.js → server-988cqjme.js} +6 -3
- package/dist/v2/{server-fpqe39as.js → server-9a6bwc12.js} +4 -4
- package/dist/v2/{server-t4k4qexw.js → server-9e5r8y60.js} +5 -1
- package/dist/v2/{server-7ekna9zs.js → server-adfte03x.js} +2 -2
- package/dist/v2/{server-qcw43339.js → server-ak7w74j9.js} +4 -4
- package/dist/v2/{server-dd0nja67.js → server-bx59ezg6.js} +4 -3
- package/dist/v2/{server-676xw7at.js → server-ckrb5rm8.js} +1 -1
- package/dist/{index-w4mw92w3.js → v2/server-cxsr0ng6.js} +15 -3
- package/dist/v2/{server-t528t8qm.js → server-hn9fb3v0.js} +2 -2
- package/dist/v2/{server-7srtwsa4.js → server-j3dm74ey.js} +9 -9
- package/dist/v2/{server-w3zeywp1.js → server-jjsf29aq.js} +4 -4
- package/dist/v2/server-knvkbfvh.js +25 -0
- package/dist/v2/{server-9yyqq3mm.js → server-n78avt2p.js} +1 -1
- package/dist/v2/{server-kdrezdy0.js → server-njnx39q2.js} +6 -3
- package/dist/v2/{server-x08d1xf3.js → server-npm52h2q.js} +4 -3
- package/dist/v2/{server-vb7pbd9p.js → server-nveratm5.js} +1 -1
- package/dist/v2/{server-mv1w7t6z.js → server-q360kdb8.js} +77 -38
- package/dist/v2/{server-kzns2hbz.js → server-s6jqh8bj.js} +1 -1
- package/dist/v2/{server-6byqfbqf.js → server-shme41gj.js} +1 -1
- package/dist/v2/{server-j8epsc0g.js → server-wafzvyhg.js} +33 -10
- package/dist/v2/{server-gtv9wbhq.js → server-xj4mewze.js} +81 -58
- package/dist/v2/{server-nfan6zb6.js → server-y5g32dhq.js} +31 -24
- package/dist/v2/{server-jdwd03ep.js → server-yak3sxya.js} +7 -7
- package/dist/v2/{server-wkdgjjch.js → server-zrwaj29a.js} +2 -2
- package/dist/v2/server.js +7 -6
- package/dist/v2/{sqlite-j3tvg8r0.js → sqlite-4pqyynrs.js} +3 -1
- package/dist/v2/{storage-memory-8168bgef.js → storage-memory-j3v3hc83.js} +2 -2
- package/dist/v2/{storage-tags-j2fzq3sw.js → storage-tags-spa92sgj.js} +5 -5
- package/dist/v2/store-reader.d.ts.map +1 -1
- package/dist/v2/{wrapup-orchestrator-s92ebfzv.js → wrapup-orchestrator-5wxy1ggv.js} +38 -35
- package/dist/wrapup-orchestrator-gv08c6f9.js +47 -0
- package/package.json +1 -1
- package/src/config/compaction-accessor-guard.test.ts +3 -0
- package/src/features/magic-context/dreamer/cron.ts +8 -0
- package/src/shared/history-owner.test.ts +60 -0
- package/src/shared/history-owner.ts +43 -0
- package/src/shared/host-stall-profiler-node.ts +3 -1
- package/src/shared/host-stall-profiler.ts +3 -1
- package/src/shared/off-thread-migration-clock.test.ts +80 -10
- package/src/shared/off-thread-migration-clock.ts +37 -13
- package/src/shared/redaction.test.ts +16 -0
- package/src/shared/redaction.ts +8 -1
- package/src/shared/root-async-context.probe.mjs +36 -0
- package/src/shared/root-async-context.test.ts +49 -0
- package/src/shared/rpc-server.ts +27 -23
- package/src/shared/sqlite-busy-budget-review.test.ts +291 -0
- package/src/shared/sqlite-foreground-wait.test.ts +253 -1
- package/src/shared/sqlite.ts +55 -14
- package/src/shared/user-facing-codes.ts +2 -2
- package/dist/embedding-backfill-re16xncd.js +0 -21
- package/dist/recomp-orchestrator-trcgmm23.js +0 -60
- package/dist/v2/embedding-backfill-xd9ygzgd.js +0 -20
- package/dist/v2/recomp-orchestrator-n11zv1f1.js +0 -59
- package/dist/v2/search-mvgqtkkz.js +0 -46
- package/dist/wrapup-orchestrator-df61jmz9.js +0 -47
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DEFAULT_LOCAL_EMBEDDING_MODEL
|
|
3
|
-
} from "./index-
|
|
3
|
+
} from "./index-w28y7d0z.js";
|
|
4
4
|
import {
|
|
5
5
|
getSynapseLaneIdentity
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-kvw6xew3.js";
|
|
7
7
|
import {
|
|
8
8
|
getHarness2
|
|
9
9
|
} from "./index-pavzsdc6.js";
|
|
@@ -13,7 +13,10 @@ import {
|
|
|
13
13
|
import {
|
|
14
14
|
importPluginModule,
|
|
15
15
|
log2
|
|
16
|
-
} from "./index-
|
|
16
|
+
} from "./index-mvvephtj.js";
|
|
17
|
+
import {
|
|
18
|
+
inRootAsyncContext2
|
|
19
|
+
} from "./index-wafzvyhg.js";
|
|
17
20
|
import {
|
|
18
21
|
computeNormalizedHash
|
|
19
22
|
} from "./index-2bvekkfy.js";
|
|
@@ -309,7 +312,7 @@ class EmbeddingWorkerClient {
|
|
|
309
312
|
start() {
|
|
310
313
|
if (this.startPromise)
|
|
311
314
|
return this.startPromise;
|
|
312
|
-
this.startPromise = this.startOwner().finally(() => {
|
|
315
|
+
this.startPromise = inRootAsyncContext2(() => this.startOwner()).finally(() => {
|
|
313
316
|
this.startPromise = null;
|
|
314
317
|
});
|
|
315
318
|
return this.startPromise;
|
|
@@ -558,10 +561,10 @@ async function acquireModelLoadLock(lockPath) {
|
|
|
558
561
|
}
|
|
559
562
|
function startLockHeartbeat(lockPath) {
|
|
560
563
|
const HEARTBEAT_MS = Math.floor(STALE_LOCK_MS / 3);
|
|
561
|
-
const timer = setInterval(() => {
|
|
564
|
+
const timer = inRootAsyncContext2(() => setInterval(() => {
|
|
562
565
|
writeStorageFileAsync(lockPath, `pid=${process.pid} alive=${Date.now()}
|
|
563
566
|
`).catch(() => {});
|
|
564
|
-
}, HEARTBEAT_MS);
|
|
567
|
+
}, HEARTBEAT_MS));
|
|
565
568
|
timer.unref?.();
|
|
566
569
|
return () => clearInterval(timer);
|
|
567
570
|
}
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
getTemporalDecisions,
|
|
7
7
|
freezeTemporalDecisions,
|
|
8
8
|
stableStringify
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-bd9cjab3.js";
|
|
10
10
|
import {
|
|
11
11
|
protectedToolTagNumbers,
|
|
12
12
|
byteSize,
|
|
@@ -69,30 +69,31 @@ import {
|
|
|
69
69
|
adoptNullOwnerToolTag2,
|
|
70
70
|
getCandidateToolOwners2,
|
|
71
71
|
pickNearestPriorOwner2
|
|
72
|
-
} from "./index-
|
|
72
|
+
} from "./index-xpn05jxq.js";
|
|
73
73
|
import {
|
|
74
74
|
textMentionsRecentCommit,
|
|
75
75
|
hasMeaningfulUserText2,
|
|
76
76
|
estimateTokens
|
|
77
|
-
} from "./index-
|
|
77
|
+
} from "./index-gjvjh960.js";
|
|
78
78
|
import {
|
|
79
79
|
log2,
|
|
80
80
|
sessionLog2
|
|
81
|
-
} from "./index-
|
|
81
|
+
} from "./index-mvvephtj.js";
|
|
82
82
|
import {
|
|
83
|
+
inRootAsyncContext2,
|
|
83
84
|
getTagIdentityWriteGeneration2,
|
|
84
85
|
getSqliteDatabasePath2,
|
|
85
86
|
assertTransformWrite2,
|
|
86
87
|
isTransientSqliteError2
|
|
87
|
-
} from "./index-
|
|
88
|
+
} from "./index-wafzvyhg.js";
|
|
88
89
|
import {
|
|
89
90
|
isValidLanguageCode
|
|
90
|
-
} from "./index-
|
|
91
|
+
} from "./index-w28y7d0z.js";
|
|
91
92
|
import {
|
|
92
93
|
getProjectEmbeddingSnapshot2,
|
|
93
94
|
embedTextForProject2,
|
|
94
95
|
embedBatchForProject2
|
|
95
|
-
} from "./index-
|
|
96
|
+
} from "./index-rg1cezmj.js";
|
|
96
97
|
import {
|
|
97
98
|
isEmbeddingHostBusy2
|
|
98
99
|
} from "./index-qt1qqasc.js";
|
|
@@ -187,7 +188,7 @@ import {
|
|
|
187
188
|
extractToolCallObservation,
|
|
188
189
|
ToolMutationBatch,
|
|
189
190
|
createToolDropTarget
|
|
190
|
-
} from "./index-
|
|
191
|
+
} from "./index-9g1c4bt9.js";
|
|
191
192
|
import {
|
|
192
193
|
getMaxM0MutationId,
|
|
193
194
|
rememberUnpublishedAutoSearchNoHint,
|
|
@@ -221,21 +222,21 @@ import {
|
|
|
221
222
|
peekNoteNudgeText,
|
|
222
223
|
markNoteNudgeDelivered,
|
|
223
224
|
getActiveCompartmentRun
|
|
224
|
-
} from "./index-
|
|
225
|
+
} from "./index-hxrvx6cy.js";
|
|
225
226
|
import {
|
|
226
227
|
runSessionWarmupWorker
|
|
227
|
-
} from "./index-
|
|
228
|
+
} from "./index-angx1s0k.js";
|
|
228
229
|
import {
|
|
229
230
|
openCodeDbExists,
|
|
230
231
|
withReadOnlySessionDb,
|
|
231
232
|
getMessageTimesFromOpenCodeDb
|
|
232
|
-
} from "./index-
|
|
233
|
+
} from "./index-q76br5zn.js";
|
|
233
234
|
import {
|
|
234
235
|
BoundedSessionMap
|
|
235
|
-
} from "./index-
|
|
236
|
+
} from "./index-b4gcb3rk.js";
|
|
236
237
|
import {
|
|
237
238
|
renderUserFacingFailure
|
|
238
|
-
} from "./index-
|
|
239
|
+
} from "./index-ydjgz36f.js";
|
|
239
240
|
import {
|
|
240
241
|
getErrorMessage
|
|
241
242
|
} from "./index-y8v6yerm.js";
|
|
@@ -245,7 +246,7 @@ import {
|
|
|
245
246
|
} from "./index-d9vfe7xq.js";
|
|
246
247
|
import {
|
|
247
248
|
logSlowWriteTransaction
|
|
248
|
-
} from "./index-
|
|
249
|
+
} from "./index-150zz6fh.js";
|
|
249
250
|
|
|
250
251
|
// src/features/magic-context/tagger.ts
|
|
251
252
|
var TOOL_COMPOSITE_KEY_SEP = "\x00";
|
|
@@ -1339,7 +1340,7 @@ function queueAutoSearchBackfill(db, sessionId, projectPath, query) {
|
|
|
1339
1340
|
pending.delete(key);
|
|
1340
1341
|
resolve();
|
|
1341
1342
|
};
|
|
1342
|
-
const queued = setTimeout(() => {
|
|
1343
|
+
const queued = inRootAsyncContext2(() => setTimeout(() => {
|
|
1343
1344
|
lifecycle.signal.removeEventListener("abort", cancel);
|
|
1344
1345
|
if (lifecycle.signal.aborted)
|
|
1345
1346
|
return done();
|
|
@@ -1350,7 +1351,7 @@ function queueAutoSearchBackfill(db, sessionId, projectPath, query) {
|
|
|
1350
1351
|
clearTimeout(timeout);
|
|
1351
1352
|
done();
|
|
1352
1353
|
});
|
|
1353
|
-
}, 0);
|
|
1354
|
+
}, 0));
|
|
1354
1355
|
const cancel = () => {
|
|
1355
1356
|
clearTimeout(queued);
|
|
1356
1357
|
done();
|
|
@@ -1397,7 +1398,7 @@ async function executeAutoSearchWorker(db, sessionId, projectPath, query, option
|
|
|
1397
1398
|
deadlineUnixMs: autoSearchDeadlineUnixMs(deadlineSignal)
|
|
1398
1399
|
};
|
|
1399
1400
|
return new Promise((resolve, reject) => {
|
|
1400
|
-
const worker = new Worker(entry, { workerData: input });
|
|
1401
|
+
const worker = inRootAsyncContext2(() => new Worker(entry, { workerData: input }));
|
|
1401
1402
|
let settled = false;
|
|
1402
1403
|
const finish = (results, error) => {
|
|
1403
1404
|
if (settled)
|
|
@@ -1509,7 +1510,7 @@ function searchMessageHistoryOffThread(db, request, entry = defaultAutoSearchWor
|
|
|
1509
1510
|
deadline.unref?.();
|
|
1510
1511
|
};
|
|
1511
1512
|
try {
|
|
1512
|
-
worker = new Worker(entry, { workerData: input });
|
|
1513
|
+
worker = inRootAsyncContext2(() => new Worker(entry, { workerData: input }));
|
|
1513
1514
|
} catch (error) {
|
|
1514
1515
|
finish(null, "start-failed", error);
|
|
1515
1516
|
return;
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
sanitizeDiagnosticText,
|
|
12
12
|
log2,
|
|
13
13
|
sessionLog2
|
|
14
|
-
} from "./index-
|
|
14
|
+
} from "./index-mvvephtj.js";
|
|
15
15
|
import {
|
|
16
16
|
createScanner,
|
|
17
17
|
parseTree,
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
deriveTriggerBudget2,
|
|
35
35
|
resolveHistorianProducerLimits2,
|
|
36
36
|
producerSourceLocalBudget2
|
|
37
|
-
} from "./index-
|
|
37
|
+
} from "./index-jw4gbfkv.js";
|
|
38
38
|
import {
|
|
39
39
|
withContentLanguageDirective,
|
|
40
40
|
buildPrimaryLanguageDirective,
|
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
ConfigProfilesSchema,
|
|
48
48
|
MagicContextConfigSchema,
|
|
49
49
|
LIVE_RELOAD_CONFIG_PATHS
|
|
50
|
-
} from "./index-
|
|
50
|
+
} from "./index-w28y7d0z.js";
|
|
51
51
|
import {
|
|
52
52
|
providerMass,
|
|
53
53
|
calibrationForModelKey,
|
|
@@ -57,26 +57,28 @@ import {
|
|
|
57
57
|
hasMeaningfulUserText2,
|
|
58
58
|
estimateTokens,
|
|
59
59
|
estimateFixedPromptTokens
|
|
60
|
-
} from "./index-
|
|
60
|
+
} from "./index-gjvjh960.js";
|
|
61
61
|
import {
|
|
62
62
|
FAIL_CLOSED_DOCTOR_COMMAND,
|
|
63
63
|
getSchemaFenceRejection,
|
|
64
64
|
LATEST_SUPPORTED_VERSION,
|
|
65
65
|
getPersistedSchemaVersion,
|
|
66
66
|
openDatabase
|
|
67
|
-
} from "./index-
|
|
68
|
-
import {
|
|
69
|
-
isPidAlive
|
|
70
|
-
} from "./index-w4mw92w3.js";
|
|
67
|
+
} from "./index-zf9nydbd.js";
|
|
71
68
|
import {
|
|
69
|
+
inRootAsyncContext2,
|
|
72
70
|
Database2,
|
|
73
71
|
withSqliteBackgroundWriter2,
|
|
74
72
|
withoutSqliteTransformPass2,
|
|
75
73
|
beginSqliteWriterAsync2
|
|
76
|
-
} from "./index-
|
|
74
|
+
} from "./index-wafzvyhg.js";
|
|
77
75
|
import {
|
|
78
|
-
|
|
79
|
-
|
|
76
|
+
shouldSkipHomeProjectMemory,
|
|
77
|
+
resolveProjectIdentity
|
|
78
|
+
} from "./index-0jz47061.js";
|
|
79
|
+
import {
|
|
80
|
+
isPidAlive
|
|
81
|
+
} from "./index-q28hsbpg.js";
|
|
80
82
|
import {
|
|
81
83
|
layoutLkgPrefix,
|
|
82
84
|
assembleLkgPrefix,
|
|
@@ -87,10 +89,10 @@ import {
|
|
|
87
89
|
resolveStoredPathWorkspaceIdentity,
|
|
88
90
|
sourceNameForMemory,
|
|
89
91
|
computeWorkspaceEpochFingerprint
|
|
90
|
-
} from "./index-
|
|
92
|
+
} from "./index-qgp5vnt4.js";
|
|
91
93
|
import {
|
|
92
94
|
getTableColumnNames
|
|
93
|
-
} from "./index-
|
|
95
|
+
} from "./index-bd9cjab3.js";
|
|
94
96
|
import {
|
|
95
97
|
V2_MEMORY_CATEGORIES,
|
|
96
98
|
CATEGORY_PRIORITY,
|
|
@@ -102,13 +104,9 @@ import {
|
|
|
102
104
|
openCodeDbPathExists,
|
|
103
105
|
claimOpenCodeDbDiagnosticOnce
|
|
104
106
|
} from "./index-58e3y90n.js";
|
|
105
|
-
import {
|
|
106
|
-
shouldSkipHomeProjectMemory,
|
|
107
|
-
resolveProjectIdentity
|
|
108
|
-
} from "./index-g8qbdb03.js";
|
|
109
107
|
import {
|
|
110
108
|
getMeasuredToolDefinitionTokens
|
|
111
|
-
} from "./index-
|
|
109
|
+
} from "./index-8kk7yh6m.js";
|
|
112
110
|
import {
|
|
113
111
|
buildCanonicalChunkTextFromFts,
|
|
114
112
|
buildCompartmentSummaryFallbackText,
|
|
@@ -118,7 +116,7 @@ import {
|
|
|
118
116
|
replaceCompartmentChunkEmbeddings,
|
|
119
117
|
deleteChunkEmbedBackoffForSession,
|
|
120
118
|
chunkWindowSourceKey
|
|
121
|
-
} from "./index-
|
|
119
|
+
} from "./index-7bjgyaj1.js";
|
|
122
120
|
import {
|
|
123
121
|
BoundedSessionMap,
|
|
124
122
|
clearCompressionDepth,
|
|
@@ -133,7 +131,7 @@ import {
|
|
|
133
131
|
toMessageIndexSource2,
|
|
134
132
|
clearIndexedMessagesInTransaction2,
|
|
135
133
|
indexSourcesAfterOrdinal2
|
|
136
|
-
} from "./index-
|
|
134
|
+
} from "./index-b4gcb3rk.js";
|
|
137
135
|
import {
|
|
138
136
|
retreatPastHostUnservedRows,
|
|
139
137
|
snapTerminalCompartmentToServedRow,
|
|
@@ -222,7 +220,7 @@ import {
|
|
|
222
220
|
getRawSessionTagKeysThrough2,
|
|
223
221
|
getLegacyProtectedTailStartOrdinal2,
|
|
224
222
|
readSessionChunk2
|
|
225
|
-
} from "./index-
|
|
223
|
+
} from "./index-9g1c4bt9.js";
|
|
226
224
|
import {
|
|
227
225
|
stripWellFormedLeadingTagPrefix,
|
|
228
226
|
stripTagPrefix,
|
|
@@ -235,15 +233,15 @@ import {
|
|
|
235
233
|
foldShrunkPartTags2,
|
|
236
234
|
getTagNumberByMessageId2,
|
|
237
235
|
getActiveTagsBySession2
|
|
238
|
-
} from "./index-
|
|
236
|
+
} from "./index-xpn05jxq.js";
|
|
239
237
|
import {
|
|
240
238
|
isStrictGapHealingMessage2,
|
|
241
239
|
noteRawSessionSummaryRowWritten2
|
|
242
|
-
} from "./index-
|
|
240
|
+
} from "./index-angx1s0k.js";
|
|
243
241
|
import {
|
|
244
242
|
withReadOnlySessionDb,
|
|
245
243
|
getMessageTimesFromOpenCodeDb
|
|
246
|
-
} from "./index-
|
|
244
|
+
} from "./index-q76br5zn.js";
|
|
247
245
|
import {
|
|
248
246
|
drainBackgroundBatches,
|
|
249
247
|
contentSha2562,
|
|
@@ -251,7 +249,7 @@ import {
|
|
|
251
249
|
getProjectChunkEmbeddingModelId2,
|
|
252
250
|
getProjectEmbeddingMaxInputTokens2,
|
|
253
251
|
embedItemsForProject2
|
|
254
|
-
} from "./index-
|
|
252
|
+
} from "./index-rg1cezmj.js";
|
|
255
253
|
import {
|
|
256
254
|
renderUserFacingFailure,
|
|
257
255
|
userFacingFailureCode,
|
|
@@ -260,7 +258,7 @@ import {
|
|
|
260
258
|
insertPrimerCandidates,
|
|
261
259
|
promoteSessionFactsDurable,
|
|
262
260
|
embedPromotedFacts
|
|
263
|
-
} from "./index-
|
|
261
|
+
} from "./index-ydjgz36f.js";
|
|
264
262
|
import {
|
|
265
263
|
pushNotification2
|
|
266
264
|
} from "./index-x8a7jmkh.js";
|
|
@@ -271,16 +269,19 @@ import {
|
|
|
271
269
|
getMemoriesByProject2,
|
|
272
270
|
getMemoriesByProjects2,
|
|
273
271
|
getMaxMemoryIdForProjects2
|
|
274
|
-
} from "./index-
|
|
272
|
+
} from "./index-n78avt2p.js";
|
|
275
273
|
import {
|
|
276
274
|
isMarkerCandidateBasisCurrent2,
|
|
277
275
|
invalidateMarkerCandidateBasis2,
|
|
278
276
|
readMarkerCandidateBasis2,
|
|
279
277
|
prepareMarkerCandidateBasis2
|
|
280
|
-
} from "./index-
|
|
278
|
+
} from "./index-s178h9z8.js";
|
|
281
279
|
import {
|
|
282
280
|
sendStatusNotification2
|
|
283
|
-
} from "./index-
|
|
281
|
+
} from "./index-pgy3h49n.js";
|
|
282
|
+
import {
|
|
283
|
+
sameProjectDirectory
|
|
284
|
+
} from "./index-knvkbfvh.js";
|
|
284
285
|
import {
|
|
285
286
|
getErrorMessage,
|
|
286
287
|
describeError
|
|
@@ -298,7 +299,7 @@ import {
|
|
|
298
299
|
import {
|
|
299
300
|
logSlowWriteTransaction,
|
|
300
301
|
WriteTransactionSteps
|
|
301
|
-
} from "./index-
|
|
302
|
+
} from "./index-150zz6fh.js";
|
|
302
303
|
|
|
303
304
|
// src/agents/permissions.ts
|
|
304
305
|
function buildAllowOnlyPermission(allowedTools, agentLabel) {
|
|
@@ -5035,7 +5036,7 @@ var V2_MESSAGE_PAGE_SQL = `WITH bounds AS (
|
|
|
5035
5036
|
SELECT seq FROM session_message
|
|
5036
5037
|
WHERE session_id = ? AND type IN (${RAW_MESSAGE_TYPE_PARAMETERS})
|
|
5037
5038
|
ORDER BY seq ASC LIMIT 1 OFFSET ?
|
|
5038
|
-
), -1) END AS after_seq,
|
|
5039
|
+
), (SELECT MAX(seq) FROM session_message WHERE session_id = ?), -1) END AS after_seq,
|
|
5039
5040
|
COALESCE((
|
|
5040
5041
|
SELECT seq FROM session_message
|
|
5041
5042
|
WHERE session_id = ? AND type IN (${RAW_MESSAGE_TYPE_PARAMETERS})
|
|
@@ -5296,7 +5297,7 @@ class V2StoreReader {
|
|
|
5296
5297
|
}
|
|
5297
5298
|
}
|
|
5298
5299
|
const maximumSeq = Number.MAX_SAFE_INTEGER;
|
|
5299
|
-
const rows = this.prepare(V2_MESSAGE_PAGE_SQL).all(afterOrdinal, sessionID, ...RAW_MESSAGE_TYPES, Math.max(0, afterOrdinal - 1), sessionID, ...RAW_MESSAGE_TYPES, finalWatermark - 1, maximumSeq, sessionID, ...RAW_MESSAGE_TYPES, pageSize);
|
|
5300
|
+
const rows = this.prepare(V2_MESSAGE_PAGE_SQL).all(afterOrdinal, sessionID, ...RAW_MESSAGE_TYPES, Math.max(0, afterOrdinal - 1), sessionID, sessionID, ...RAW_MESSAGE_TYPES, finalWatermark - 1, maximumSeq, sessionID, ...RAW_MESSAGE_TYPES, pageSize);
|
|
5300
5301
|
return rows.map(decode);
|
|
5301
5302
|
});
|
|
5302
5303
|
}
|
|
@@ -15180,6 +15181,37 @@ function capturePrefixTrimSourceOrder(messages) {
|
|
|
15180
15181
|
invalidReason
|
|
15181
15182
|
});
|
|
15182
15183
|
}
|
|
15184
|
+
function reanchorStoredBoundary(options, boundary) {
|
|
15185
|
+
if (!options.messages)
|
|
15186
|
+
return;
|
|
15187
|
+
const source = options.prefixTrimSourceOrder ?? capturePrefixTrimSourceOrder(options.messages);
|
|
15188
|
+
if (source.invalidReason)
|
|
15189
|
+
return;
|
|
15190
|
+
try {
|
|
15191
|
+
if (compareRawSessionMessageOrder2(options.sessionId, boundary, boundary) !== 0)
|
|
15192
|
+
return;
|
|
15193
|
+
const messageIds = [...source.messageIds];
|
|
15194
|
+
let previous;
|
|
15195
|
+
let insertion = messageIds.length;
|
|
15196
|
+
for (const [index, id] of messageIds.entries()) {
|
|
15197
|
+
if (previous) {
|
|
15198
|
+
const increasing = compareRawSessionMessageOrder2(options.sessionId, previous, id);
|
|
15199
|
+
if (increasing === null || !Number.isFinite(increasing) || increasing >= 0)
|
|
15200
|
+
return;
|
|
15201
|
+
}
|
|
15202
|
+
const order = compareRawSessionMessageOrder2(options.sessionId, boundary, id);
|
|
15203
|
+
if (order === null || !Number.isFinite(order) || order === 0)
|
|
15204
|
+
return;
|
|
15205
|
+
if (order < 0 && insertion === messageIds.length)
|
|
15206
|
+
insertion = index;
|
|
15207
|
+
previous = id;
|
|
15208
|
+
}
|
|
15209
|
+
messageIds.splice(insertion, 0, boundary);
|
|
15210
|
+
return { ...source, messageIds };
|
|
15211
|
+
} catch {
|
|
15212
|
+
return;
|
|
15213
|
+
}
|
|
15214
|
+
}
|
|
15183
15215
|
function trimToPreparedPrefix(options, prepared) {
|
|
15184
15216
|
if (options.compactionOff || !options.messages)
|
|
15185
15217
|
return "not-attempted";
|
|
@@ -15204,7 +15236,8 @@ function trimToPreparedPrefix(options, prepared) {
|
|
|
15204
15236
|
});
|
|
15205
15237
|
const boundaryPosition = sourcePosition.get(boundary) ?? sourcePosition.get(resolveHostServedBoundaryId2(options.sessionId, boundary));
|
|
15206
15238
|
if (boundaryPosition === undefined) {
|
|
15207
|
-
|
|
15239
|
+
const reanchored = reanchorStoredBoundary(options, boundary);
|
|
15240
|
+
status = reanchored ? trimToPreparedPrefix({ ...options, prefixTrimSourceOrder: reanchored }, prepared) : refuse("boundary absent from immutable source order");
|
|
15208
15241
|
} else {
|
|
15209
15242
|
let lastSourcePosition = -1;
|
|
15210
15243
|
let sawPersistedRow = false;
|
|
@@ -15215,8 +15248,7 @@ function trimToPreparedPrefix(options, prepared) {
|
|
|
15215
15248
|
for (const [index, message] of options.messages.entries()) {
|
|
15216
15249
|
const id = message.info.id;
|
|
15217
15250
|
if (isHostRenderedSystemMessage(message)) {
|
|
15218
|
-
|
|
15219
|
-
retained.push(message);
|
|
15251
|
+
retained.push(message);
|
|
15220
15252
|
continue;
|
|
15221
15253
|
}
|
|
15222
15254
|
if (typeof id !== "string" || id.length === 0) {
|
|
@@ -15259,12 +15291,19 @@ function trimToPreparedPrefix(options, prepared) {
|
|
|
15259
15291
|
} else {
|
|
15260
15292
|
const index = findBoundaryIndex(options.sessionId, options.messages, boundary);
|
|
15261
15293
|
if (index >= 0) {
|
|
15262
|
-
const
|
|
15294
|
+
const cut = index + (isPartialCompartmentEnd(options.db, options.sessionId, boundary) ? 0 : 1);
|
|
15295
|
+
const unplaced = options.messages.slice(0, cut).filter(isHostRenderedSystemMessage);
|
|
15296
|
+
const removed = options.messages.splice(0, cut, ...unplaced);
|
|
15263
15297
|
retireDecisions(removed.map((message) => message.info.id).filter((id) => typeof id === "string"));
|
|
15264
15298
|
resetPrefixTrimFallbackState(options.sessionId);
|
|
15265
15299
|
status = "applied";
|
|
15266
15300
|
} else {
|
|
15267
|
-
|
|
15301
|
+
const reanchored = reanchorStoredBoundary(options, boundary);
|
|
15302
|
+
if (reanchored && reanchored.messageIds[0] !== boundary) {
|
|
15303
|
+
status = trimToPreparedPrefix({ ...options, prefixTrimSourceOrder: reanchored }, prepared);
|
|
15304
|
+
} else {
|
|
15305
|
+
status = classifyAbsentBoundary(options, options.messages, boundary);
|
|
15306
|
+
}
|
|
15268
15307
|
}
|
|
15269
15308
|
}
|
|
15270
15309
|
}
|
|
@@ -20900,6 +20939,7 @@ Historian pass ${passCount + 1}, attempt ${passAttempt} started for messages ${c
|
|
|
20900
20939
|
sequenceOffset: candidateCompartments.length,
|
|
20901
20940
|
dumpLabelBase: `recomp-${sessionId}-${chunk.startIndex}-${chunk.endIndex}-pass-${passCount + 1}`,
|
|
20902
20941
|
timeoutMs: historianTimeoutMs,
|
|
20942
|
+
maxOutputTokens: deps.historianMaxOutputTokens,
|
|
20903
20943
|
model: deps.model,
|
|
20904
20944
|
fallbackModelId: deps.fallbackModelId,
|
|
20905
20945
|
fallbackModels: deps.fallbackModels,
|
|
@@ -21414,7 +21454,6 @@ ${renderUserFacingFailure("recomp_unavailable")}`;
|
|
|
21414
21454
|
}
|
|
21415
21455
|
}
|
|
21416
21456
|
}
|
|
21417
|
-
|
|
21418
21457
|
// src/hooks/magic-context/compartment-runner.ts
|
|
21419
21458
|
var activeRuns = new Map;
|
|
21420
21459
|
function getActiveCompartmentRun(sessionId) {
|
|
@@ -21450,7 +21489,7 @@ function withPublishedCallback(deps) {
|
|
|
21450
21489
|
};
|
|
21451
21490
|
}
|
|
21452
21491
|
function startLeaseRenewal(deps, holderId) {
|
|
21453
|
-
return setInterval(() => {
|
|
21492
|
+
return inRootAsyncContext2(() => setInterval(() => {
|
|
21454
21493
|
try {
|
|
21455
21494
|
if (!renewCompartmentLease(deps.db, deps.sessionId, holderId)) {
|
|
21456
21495
|
sessionLog2(deps.sessionId, "compartment lease renewal failed; publish will be skipped if holder is stale");
|
|
@@ -21458,7 +21497,7 @@ function startLeaseRenewal(deps, holderId) {
|
|
|
21458
21497
|
} catch (err) {
|
|
21459
21498
|
sessionLog2(deps.sessionId, `compartment lease renewal threw; publish will be skipped if holder is stale (${err instanceof Error ? err.message : String(err)})`);
|
|
21460
21499
|
}
|
|
21461
|
-
}, COMPARTMENT_LEASE_RENEWAL_MS);
|
|
21500
|
+
}, COMPARTMENT_LEASE_RENEWAL_MS));
|
|
21462
21501
|
}
|
|
21463
21502
|
function startCompartmentAgent(deps, runAgent = runCompartmentAgent, prepareBoundary) {
|
|
21464
21503
|
withoutSqliteTransformPass2(() => startBackgroundCompartmentAgent(deps, runAgent, prepareBoundary));
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// src/shared/project-directory-key.ts
|
|
2
|
+
import { realpathSync } from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
function projectDirectoryKey(directory) {
|
|
5
|
+
const slashed = directory.replaceAll("\\", "/").replace(/^\/\/\?\/UNC\//i, "//").replace(/^\/\/\?\//, "");
|
|
6
|
+
if (/^[a-z]:\//i.test(slashed) || slashed.startsWith("//")) {
|
|
7
|
+
return path.win32.normalize(slashed).replaceAll("\\", "/").replace(/\/$/, "").toLowerCase();
|
|
8
|
+
}
|
|
9
|
+
return path.resolve(directory);
|
|
10
|
+
}
|
|
11
|
+
function sameProjectDirectory(a, b) {
|
|
12
|
+
if (a.length === 0 || b.length === 0)
|
|
13
|
+
return false;
|
|
14
|
+
return projectDirectoryKey(a) === projectDirectoryKey(b);
|
|
15
|
+
}
|
|
16
|
+
var realpathForCanonicalDirectory = (directory) => realpathSync.native(directory);
|
|
17
|
+
function canonicalProjectDirectory(directory) {
|
|
18
|
+
let resolved = directory;
|
|
19
|
+
try {
|
|
20
|
+
resolved = realpathForCanonicalDirectory(directory);
|
|
21
|
+
} catch {}
|
|
22
|
+
return projectDirectoryKey(resolved);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { projectDirectoryKey, sameProjectDirectory, canonicalProjectDirectory };
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
estimateTokens
|
|
3
|
-
} from "./index-
|
|
3
|
+
} from "./index-gjvjh960.js";
|
|
4
4
|
import {
|
|
5
5
|
getHarness2
|
|
6
6
|
} from "./index-pavzsdc6.js";
|
|
7
7
|
import {
|
|
8
8
|
log2
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-mvvephtj.js";
|
|
10
|
+
import {
|
|
11
|
+
inRootAsyncContext2
|
|
12
|
+
} from "./index-wafzvyhg.js";
|
|
10
13
|
|
|
11
14
|
// ../../node_modules/.bun/@cortexkit+subc-client@0.11.1/node_modules/@cortexkit/subc-client/dist/client.js
|
|
12
15
|
import { promises as fs2 } from "node:fs";
|
|
@@ -1919,7 +1922,7 @@ async function getSharedClient(options) {
|
|
|
1919
1922
|
if (sharedClientPromise && sharedClientFile === options.connectionFile)
|
|
1920
1923
|
return sharedClientPromise;
|
|
1921
1924
|
sharedClientFile = options.connectionFile;
|
|
1922
|
-
sharedClientPromise = SubcClient.connect({ connectionFile: options.connectionFile }).then((client) => {
|
|
1925
|
+
sharedClientPromise = inRootAsyncContext2(() => SubcClient.connect({ connectionFile: options.connectionFile })).then((client) => {
|
|
1923
1926
|
sharedClient = client;
|
|
1924
1927
|
return client;
|
|
1925
1928
|
});
|
|
@@ -1,34 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
withSqliteBackgroundWriter2,
|
|
3
3
|
withoutSqliteTransformPass2
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-wafzvyhg.js";
|
|
5
5
|
import {
|
|
6
6
|
logSlowWriteTransaction
|
|
7
|
-
} from "./index-
|
|
8
|
-
|
|
9
|
-
// src/shared/project-directory-key.ts
|
|
10
|
-
import { realpathSync } from "node:fs";
|
|
11
|
-
import path from "node:path";
|
|
12
|
-
function projectDirectoryKey(directory) {
|
|
13
|
-
const slashed = directory.replaceAll("\\", "/").replace(/^\/\/\?\/UNC\//i, "//").replace(/^\/\/\?\//, "");
|
|
14
|
-
if (/^[a-z]:\//i.test(slashed) || slashed.startsWith("//")) {
|
|
15
|
-
return path.win32.normalize(slashed).replaceAll("\\", "/").replace(/\/$/, "").toLowerCase();
|
|
16
|
-
}
|
|
17
|
-
return path.resolve(directory);
|
|
18
|
-
}
|
|
19
|
-
function sameProjectDirectory(a, b) {
|
|
20
|
-
if (a.length === 0 || b.length === 0)
|
|
21
|
-
return false;
|
|
22
|
-
return projectDirectoryKey(a) === projectDirectoryKey(b);
|
|
23
|
-
}
|
|
24
|
-
var realpathForCanonicalDirectory = (directory) => realpathSync.native(directory);
|
|
25
|
-
function canonicalProjectDirectory(directory) {
|
|
26
|
-
let resolved = directory;
|
|
27
|
-
try {
|
|
28
|
-
resolved = realpathForCanonicalDirectory(directory);
|
|
29
|
-
} catch {}
|
|
30
|
-
return projectDirectoryKey(resolved);
|
|
31
|
-
}
|
|
7
|
+
} from "./index-150zz6fh.js";
|
|
32
8
|
|
|
33
9
|
// src/features/magic-context/message-fts-rowid-map.ts
|
|
34
10
|
import { createHash } from "node:crypto";
|
|
@@ -192,4 +168,4 @@ function deleteUnmappedMessageFtsRows(db, sessionIds) {
|
|
|
192
168
|
WHERE rowid > ? AND session_id IN (${placeholders})`).run(state.watermarkRowid, ...sessionIds);
|
|
193
169
|
}
|
|
194
170
|
|
|
195
|
-
export {
|
|
171
|
+
export { recordMessageFtsRowid, recordIndexedMessageTime, startMessageFtsRowidMapBackfill, messageFtsOrdinalRangeIsMapped, deleteUnmappedMessageFtsRows };
|
|
@@ -125,7 +125,7 @@ var SECRET_TEXT_PATTERNS = [
|
|
|
125
125
|
replacement: "<GITHUB_PAT_REDACTED>"
|
|
126
126
|
},
|
|
127
127
|
{
|
|
128
|
-
pattern: /\b(?:gh[opsu]|ghr)_[A-Za-z0-
|
|
128
|
+
pattern: /\b(?:gh[opsu]|ghr)_[A-Za-z0-9_-]{30,}/g,
|
|
129
129
|
replacement: "<GITHUB_TOKEN_REDACTED>"
|
|
130
130
|
},
|
|
131
131
|
{
|
|
@@ -156,6 +156,10 @@ var SECRET_TEXT_PATTERNS = [
|
|
|
156
156
|
pattern: /\b((?:x-)?(?:api-?key|api-?token|auth-?token|access-?token)\s*:\s*)([^\s'"`,;<>]{6,})/gi,
|
|
157
157
|
replacement: (full, prefix, value) => isNonSecretScalarValue(value) ? full : `${prefix}<REDACTED:api_key>`
|
|
158
158
|
},
|
|
159
|
+
{
|
|
160
|
+
pattern: /\b((?:api[_-]?key|client[_-]?secret|access[_-]?token|token|secret|password|passwd|pwd)\s*:\s*)([^\s'"`,;<>]{6,})/gi,
|
|
161
|
+
replacement: (full, prefix, value) => isNonSecretScalarValue(value) ? full : `${prefix}<REDACTED:credential>`
|
|
162
|
+
},
|
|
159
163
|
{
|
|
160
164
|
pattern: /\b([a-z][a-z0-9+.-]*:\/\/[^\s/:@]+:)([^\s/@]+)(@)/gi,
|
|
161
165
|
replacement: (_full, prefix, _password, at) => `${prefix}<REDACTED:password>${at}`
|
|
@@ -4,13 +4,13 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
importPluginModule,
|
|
6
6
|
sessionLog2
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-mvvephtj.js";
|
|
8
8
|
import {
|
|
9
9
|
isDefaultSessionTitle2
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-a4b0gbyg.js";
|
|
11
11
|
import {
|
|
12
12
|
shouldHoldIgnoredNotification
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-q76br5zn.js";
|
|
14
14
|
import {
|
|
15
15
|
getErrorMessage
|
|
16
16
|
} from "./index-y8v6yerm.js";
|
|
@@ -142,7 +142,7 @@ async function sendIgnoredMessageNow(client, sessionId, text, params, forcePersi
|
|
|
142
142
|
holdIgnoredNotification({ client, sessionId, text, params, forcePersist }, "during target checks");
|
|
143
143
|
return "queued";
|
|
144
144
|
}
|
|
145
|
-
const { waitForSafeNotificationTarget } = await importPluginModule(() => import("./safe-notification-target-
|
|
145
|
+
const { waitForSafeNotificationTarget } = await importPluginModule(() => import("./safe-notification-target-jdynm677.js"));
|
|
146
146
|
if (await waitForSafeNotificationTarget(client, sessionId) === "skip") {
|
|
147
147
|
sessionLog2(sessionId, "notification skipped (session not titled yet)");
|
|
148
148
|
return "skipped";
|