@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,12 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
estimateTokens
|
|
3
|
-
} from "./server-
|
|
3
|
+
} from "./server-s6jqh8bj.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-9e5r8y60.js";
|
|
10
|
+
import {
|
|
11
|
+
inRootAsyncContext2
|
|
12
|
+
} from "./server-wafzvyhg.js";
|
|
10
13
|
|
|
11
14
|
// src/features/magic-context/memory/embedding-synapse.ts
|
|
12
15
|
import { createHash } from "node:crypto";
|
|
@@ -1921,7 +1924,7 @@ async function getSharedClient(options) {
|
|
|
1921
1924
|
if (sharedClientPromise && sharedClientFile === options.connectionFile)
|
|
1922
1925
|
return sharedClientPromise;
|
|
1923
1926
|
sharedClientFile = options.connectionFile;
|
|
1924
|
-
sharedClientPromise = SubcClient.connect({ connectionFile: options.connectionFile }).then((client) => {
|
|
1927
|
+
sharedClientPromise = inRootAsyncContext2(() => SubcClient.connect({ connectionFile: options.connectionFile })).then((client) => {
|
|
1925
1928
|
sharedClient = client;
|
|
1926
1929
|
return client;
|
|
1927
1930
|
});
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getTokenEstimatorFingerprint,
|
|
3
3
|
estimateTokens
|
|
4
|
-
} from "./server-
|
|
4
|
+
} from "./server-s6jqh8bj.js";
|
|
5
5
|
import {
|
|
6
6
|
getHarness2
|
|
7
7
|
} from "./server-pavzsdc6.js";
|
|
8
8
|
import {
|
|
9
9
|
log2
|
|
10
|
-
} from "./server-
|
|
10
|
+
} from "./server-9e5r8y60.js";
|
|
11
11
|
import {
|
|
12
12
|
isSynapseEmbeddingTruncated
|
|
13
|
-
} from "./server-
|
|
13
|
+
} from "./server-988cqjme.js";
|
|
14
14
|
import {
|
|
15
15
|
messageFtsOrdinalRangeIsMapped
|
|
16
|
-
} from "./server-
|
|
16
|
+
} from "./server-63ha7f0f.js";
|
|
17
17
|
|
|
18
18
|
// src/features/magic-context/compartment-chunk-embedding.ts
|
|
19
19
|
import { createHash } from "node:crypto";
|
|
@@ -219,7 +219,7 @@ var SECRET_TEXT_PATTERNS = [
|
|
|
219
219
|
replacement: "<GITHUB_PAT_REDACTED>"
|
|
220
220
|
},
|
|
221
221
|
{
|
|
222
|
-
pattern: /\b(?:gh[opsu]|ghr)_[A-Za-z0-
|
|
222
|
+
pattern: /\b(?:gh[opsu]|ghr)_[A-Za-z0-9_-]{30,}/g,
|
|
223
223
|
replacement: "<GITHUB_TOKEN_REDACTED>"
|
|
224
224
|
},
|
|
225
225
|
{
|
|
@@ -250,6 +250,10 @@ var SECRET_TEXT_PATTERNS = [
|
|
|
250
250
|
pattern: /\b((?:x-)?(?:api-?key|api-?token|auth-?token|access-?token)\s*:\s*)([^\s'"`,;<>]{6,})/gi,
|
|
251
251
|
replacement: (full, prefix, value) => isNonSecretScalarValue(value) ? full : `${prefix}<REDACTED:api_key>`
|
|
252
252
|
},
|
|
253
|
+
{
|
|
254
|
+
pattern: /\b((?:api[_-]?key|client[_-]?secret|access[_-]?token|token|secret|password|passwd|pwd)\s*:\s*)([^\s'"`,;<>]{6,})/gi,
|
|
255
|
+
replacement: (full, prefix, value) => isNonSecretScalarValue(value) ? full : `${prefix}<REDACTED:credential>`
|
|
256
|
+
},
|
|
253
257
|
{
|
|
254
258
|
pattern: /\b([a-z][a-z0-9+.-]*:\/\/[^\s/:@]+:)([^\s/@]+)(@)/gi,
|
|
255
259
|
replacement: (_full, prefix, _password, at) => `${prefix}<REDACTED:password>${at}`
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
estimateTokens
|
|
3
|
-
} from "./server-
|
|
3
|
+
} from "./server-s6jqh8bj.js";
|
|
4
4
|
import {
|
|
5
5
|
stableStringify
|
|
6
|
-
} from "./server-
|
|
6
|
+
} from "./server-shme41gj.js";
|
|
7
7
|
|
|
8
8
|
// src/features/magic-context/tool-definition-tokens.ts
|
|
9
9
|
import { createHash } from "node:crypto";
|
|
@@ -4,13 +4,13 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
importPluginModule,
|
|
6
6
|
sessionLog2
|
|
7
|
-
} from "./server-
|
|
7
|
+
} from "./server-9e5r8y60.js";
|
|
8
8
|
import {
|
|
9
9
|
isDefaultSessionTitle2
|
|
10
|
-
} from "./server-
|
|
10
|
+
} from "./server-ckrb5rm8.js";
|
|
11
11
|
import {
|
|
12
12
|
shouldHoldIgnoredNotification
|
|
13
|
-
} from "./server-
|
|
13
|
+
} from "./server-zrwaj29a.js";
|
|
14
14
|
import {
|
|
15
15
|
getErrorMessage
|
|
16
16
|
} from "./server-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-936374xx.js"));
|
|
146
146
|
if (await waitForSafeNotificationTarget(client, sessionId) === "skip") {
|
|
147
147
|
sessionLog2(sessionId, "notification skipped (session not titled yet)");
|
|
148
148
|
return "skipped";
|
|
@@ -3,11 +3,12 @@ import {
|
|
|
3
3
|
} from "./server-51779zs2.js";
|
|
4
4
|
import {
|
|
5
5
|
log2
|
|
6
|
-
} from "./server-
|
|
6
|
+
} from "./server-9e5r8y60.js";
|
|
7
7
|
import {
|
|
8
|
+
inRootAsyncContext2,
|
|
8
9
|
getSqliteDatabasePath2,
|
|
9
10
|
releaseIndexOwner2
|
|
10
|
-
} from "./server-
|
|
11
|
+
} from "./server-wafzvyhg.js";
|
|
11
12
|
|
|
12
13
|
// src/hooks/magic-context/raw-ordinal-warmup.ts
|
|
13
14
|
import { Worker } from "node:worker_threads";
|
|
@@ -1171,7 +1172,7 @@ function runSessionWarmupWorker(input, options) {
|
|
|
1171
1172
|
deadline.unref?.();
|
|
1172
1173
|
};
|
|
1173
1174
|
try {
|
|
1174
|
-
worker = new Worker(options.entry ?? defaultEntry(), { workerData: input });
|
|
1175
|
+
worker = inRootAsyncContext2(() => new Worker(options.entry ?? defaultEntry(), { workerData: input }));
|
|
1175
1176
|
} catch (error) {
|
|
1176
1177
|
finish({ failure: "start-failed", detail: String(error) });
|
|
1177
1178
|
return;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./server-9e5r8y60.js";
|
|
4
4
|
import {
|
|
5
5
|
canonicalProjectDirectory
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./server-knvkbfvh.js";
|
|
7
7
|
|
|
8
8
|
// src/shared/rpc-utils.ts
|
|
9
9
|
import { execFile, execFileSync } from "node:child_process";
|
|
@@ -34,13 +34,25 @@ function isOwnRpcServerRecord(record) {
|
|
|
34
34
|
function projectHash(directory) {
|
|
35
35
|
return createHash("sha256").update(canonicalProjectDirectory(directory)).digest("hex").slice(0, 16);
|
|
36
36
|
}
|
|
37
|
+
function legacyProjectHash(directory) {
|
|
38
|
+
const normalized = directory.replace(/\/+$/, "");
|
|
39
|
+
return createHash("sha256").update(normalized).digest("hex").slice(0, 16);
|
|
40
|
+
}
|
|
37
41
|
function rpcPortDir(storageDir, directory) {
|
|
38
42
|
return join(storageDir, "rpc", projectHash(directory));
|
|
39
43
|
}
|
|
44
|
+
function rpcPortDirsForLookup(storageDir, directory) {
|
|
45
|
+
const canonical = rpcPortDir(storageDir, directory);
|
|
46
|
+
const legacy = join(storageDir, "rpc", legacyProjectHash(directory));
|
|
47
|
+
return legacy === canonical ? [canonical] : [canonical, legacy];
|
|
48
|
+
}
|
|
40
49
|
function rpcPortFilePath(storageDir, directory, pid = process.pid, instanceId) {
|
|
41
50
|
const suffix = instanceId ? `-${instanceId}` : "";
|
|
42
51
|
return join(rpcPortDir(storageDir, directory), `port-${pid}${suffix}.json`);
|
|
43
52
|
}
|
|
53
|
+
function legacyRpcPortFilePath(storageDir, directory) {
|
|
54
|
+
return join(storageDir, "rpc", legacyProjectHash(directory), "port");
|
|
55
|
+
}
|
|
44
56
|
function isPidAlive(pid) {
|
|
45
57
|
if (!Number.isInteger(pid) || pid <= 0)
|
|
46
58
|
return "dead";
|
|
@@ -730,4 +742,4 @@ function inspectWindowsProcessesSync() {
|
|
|
730
742
|
};
|
|
731
743
|
}
|
|
732
744
|
|
|
733
|
-
export { registerOwnRpcServerInstance, isOwnRpcServerRecord, rpcPortDir, rpcPortFilePath, isPidAlive, readProcessStartTime, readProcessProbeEvidence, classifyProcessKind, isPidIdentityPlausible, inspectLivePiProcesses, parseRpcPortFile, inspectProcessesAsync, inspectWindowsProcessesSync };
|
|
745
|
+
export { registerOwnRpcServerInstance, isOwnRpcServerRecord, rpcPortDir, rpcPortDirsForLookup, rpcPortFilePath, legacyRpcPortFilePath, isPidAlive, readProcessStartTime, readProcessProbeEvidence, classifyProcessKind, isPidIdentityPlausible, inspectLivePiProcesses, parseRpcPortFile, inspectProcessesAsync, inspectWindowsProcessesSync };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log2
|
|
3
|
-
} from "./server-
|
|
3
|
+
} from "./server-9e5r8y60.js";
|
|
4
4
|
import {
|
|
5
5
|
getSdkWindowGeometry,
|
|
6
6
|
getSdkContextLimit,
|
|
7
7
|
getSdkInputLimit
|
|
8
|
-
} from "./server-
|
|
8
|
+
} from "./server-nveratm5.js";
|
|
9
9
|
import {
|
|
10
10
|
localBudget,
|
|
11
11
|
calibrationForModelKey
|
|
@@ -5,14 +5,14 @@ import {
|
|
|
5
5
|
removeSystemReminders,
|
|
6
6
|
hasMeaningfulUserText2,
|
|
7
7
|
extractTexts2
|
|
8
|
-
} from "./server-
|
|
8
|
+
} from "./server-s6jqh8bj.js";
|
|
9
9
|
import {
|
|
10
10
|
getMagicContextStorageDir
|
|
11
|
-
} from "./server-
|
|
11
|
+
} from "./server-9e5r8y60.js";
|
|
12
12
|
import {
|
|
13
13
|
withSqliteBackgroundWriter2,
|
|
14
14
|
withoutSqliteTransformPass2
|
|
15
|
-
} from "./server-
|
|
15
|
+
} from "./server-wafzvyhg.js";
|
|
16
16
|
import {
|
|
17
17
|
TAG_TOMBSTONE_OWNER_PREFIX,
|
|
18
18
|
tagTombstoneOwnerRange,
|
|
@@ -20,23 +20,23 @@ import {
|
|
|
20
20
|
tagRevisionKey,
|
|
21
21
|
tagIdentityRevisionKey,
|
|
22
22
|
deleteTagIdentityRevisions
|
|
23
|
-
} from "./server-
|
|
23
|
+
} from "./server-shme41gj.js";
|
|
24
24
|
import {
|
|
25
25
|
cleanUserText2
|
|
26
|
-
} from "./server-
|
|
26
|
+
} from "./server-xj4mewze.js";
|
|
27
27
|
import {
|
|
28
28
|
recordMessageFtsRowid,
|
|
29
29
|
recordIndexedMessageTime,
|
|
30
30
|
messageFtsOrdinalRangeIsMapped,
|
|
31
31
|
deleteUnmappedMessageFtsRows
|
|
32
|
-
} from "./server-
|
|
32
|
+
} from "./server-63ha7f0f.js";
|
|
33
33
|
import {
|
|
34
34
|
isPidAlive,
|
|
35
35
|
readProcessStartTime
|
|
36
|
-
} from "./server-
|
|
36
|
+
} from "./server-cxsr0ng6.js";
|
|
37
37
|
import {
|
|
38
38
|
deleteChunkEmbedBackoffForSession
|
|
39
|
-
} from "./server-
|
|
39
|
+
} from "./server-9a6bwc12.js";
|
|
40
40
|
import {
|
|
41
41
|
ensurePrivateStorageDirectorySync,
|
|
42
42
|
writeStorageFileSync,
|
|
@@ -49,7 +49,7 @@ import {
|
|
|
49
49
|
} from "./server-8ajstryz.js";
|
|
50
50
|
import {
|
|
51
51
|
logSlowWriteTransaction
|
|
52
|
-
} from "./server-
|
|
52
|
+
} from "./server-7dv9wt9r.js";
|
|
53
53
|
|
|
54
54
|
// src/shared/bounded-session-map.ts
|
|
55
55
|
class BoundedSessionMap {
|
|
@@ -4,22 +4,22 @@ import {
|
|
|
4
4
|
} from "./server-1zx87sdm.js";
|
|
5
5
|
import {
|
|
6
6
|
estimateTokens
|
|
7
|
-
} from "./server-
|
|
7
|
+
} from "./server-s6jqh8bj.js";
|
|
8
8
|
import {
|
|
9
9
|
getHarness2
|
|
10
10
|
} from "./server-pavzsdc6.js";
|
|
11
11
|
import {
|
|
12
12
|
sessionLog2
|
|
13
|
-
} from "./server-
|
|
13
|
+
} from "./server-9e5r8y60.js";
|
|
14
14
|
import {
|
|
15
15
|
getTagIdentityWriteGeneration2,
|
|
16
16
|
getSqliteDatabasePath2
|
|
17
|
-
} from "./server-
|
|
17
|
+
} from "./server-wafzvyhg.js";
|
|
18
18
|
import {
|
|
19
19
|
stableStringify,
|
|
20
20
|
tagOrderConstraintIndex,
|
|
21
21
|
tagIdentityRevisionKey
|
|
22
|
-
} from "./server-
|
|
22
|
+
} from "./server-shme41gj.js";
|
|
23
23
|
import {
|
|
24
24
|
DEFAULT_PROTECTED_TOOLS,
|
|
25
25
|
normalizeProtectedToolName,
|
|
@@ -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,10 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getMagicContextStorageDir,
|
|
3
3
|
log2
|
|
4
|
-
} from "./server-
|
|
4
|
+
} from "./server-9e5r8y60.js";
|
|
5
|
+
import {
|
|
6
|
+
inRootAsyncContext2
|
|
7
|
+
} from "./server-wafzvyhg.js";
|
|
5
8
|
import {
|
|
6
9
|
projectDirectoryKey
|
|
7
|
-
} from "./server-
|
|
10
|
+
} from "./server-knvkbfvh.js";
|
|
8
11
|
import {
|
|
9
12
|
writeStorageFileAtomicSync
|
|
10
13
|
} from "./server-fvnzcnww.js";
|
|
@@ -537,7 +540,7 @@ function bootQuietRemainingMs(now = Date.now()) {
|
|
|
537
540
|
return Math.max(0, bootQuietUntilMs - now);
|
|
538
541
|
}
|
|
539
542
|
function scheduleAfterBootQuiet(task, additionalDelayMs = 0) {
|
|
540
|
-
const timer = setTimeout(task, bootQuietRemainingMs() + Math.max(0, additionalDelayMs));
|
|
543
|
+
const timer = inRootAsyncContext2(() => setTimeout(task, bootQuietRemainingMs() + Math.max(0, additionalDelayMs)));
|
|
541
544
|
timer.unref?.();
|
|
542
545
|
return timer;
|
|
543
546
|
}
|
|
@@ -3,10 +3,11 @@ import {
|
|
|
3
3
|
} from "./server-51779zs2.js";
|
|
4
4
|
import {
|
|
5
5
|
log2
|
|
6
|
-
} from "./server-
|
|
6
|
+
} from "./server-9e5r8y60.js";
|
|
7
7
|
import {
|
|
8
|
+
inRootAsyncContext2,
|
|
8
9
|
getSqliteDatabasePath2
|
|
9
|
-
} from "./server-
|
|
10
|
+
} from "./server-wafzvyhg.js";
|
|
10
11
|
|
|
11
12
|
// src/features/magic-context/compaction-marker-candidates.ts
|
|
12
13
|
import { existsSync, realpathSync } from "node:fs";
|
|
@@ -152,7 +153,7 @@ function runCandidateWorker(path, sessionId, options) {
|
|
|
152
153
|
timer.unref?.();
|
|
153
154
|
};
|
|
154
155
|
try {
|
|
155
|
-
worker = new Worker(entry, { workerData: { path, sessionId } });
|
|
156
|
+
worker = inRootAsyncContext2(() => new Worker(entry, { workerData: { path, sessionId } }));
|
|
156
157
|
workers.add(worker);
|
|
157
158
|
worker.unref();
|
|
158
159
|
deadline(options.acceptMs ?? 2000);
|