@cortexkit/opencode-magic-context 0.49.10 → 0.49.12
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/agents/smart-notes-dreamer-gate.fixture.d.ts +28 -0
- package/dist/agents/smart-notes-dreamer-gate.fixture.d.ts.map +1 -0
- package/dist/{announcement-hdbkt8v5.js → announcement-g789dmt6.js} +2 -2
- package/dist/auto-search-worker.js +4 -4
- package/dist/{compaction-marker-candidates-xxz35vwp.js → compaction-marker-candidates-v5c6997n.js} +3 -3
- package/dist/compaction-marker-candidates-worker.js +1 -1
- package/dist/config/agent-disable.d.ts +14 -0
- package/dist/config/agent-disable.d.ts.map +1 -1
- package/dist/config/dependency-notes.d.ts +34 -0
- package/dist/config/dependency-notes.d.ts.map +1 -0
- package/dist/config/schema/magic-context.d.ts.map +1 -1
- package/dist/{conflict-warning-hook-w3crzrar.js → conflict-warning-hook-f4x5wed7.js} +8 -8
- package/dist/{context-ey3ap3cc.js → context-dam8p201.js} +306 -119
- package/dist/{derive-budgets-3nbxsyss.js → derive-budgets-5306b1jt.js} +3 -3
- package/dist/embedding-backfill-qbfcbp87.js +21 -0
- package/dist/embedding-worker-process.js +2 -2
- package/dist/embedding-worker.js +6 -6
- package/dist/features/magic-context/compartment-chunk-embedding.d.ts +12 -1
- package/dist/features/magic-context/compartment-chunk-embedding.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-config.d.ts +22 -4
- package/dist/features/magic-context/dreamer/task-config.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-registry.d.ts +22 -0
- package/dist/features/magic-context/dreamer/task-registry.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-scheduler.d.ts +4 -1
- package/dist/features/magic-context/dreamer/task-scheduler.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-openai.d.ts +32 -0
- package/dist/features/magic-context/memory/embedding-openai.d.ts.map +1 -1
- package/dist/features/magic-context/memory/project-identity.d.ts +1 -0
- package/dist/features/magic-context/memory/project-identity.d.ts.map +1 -1
- package/dist/features/magic-context/memory/unborn-head.d.ts +34 -0
- package/dist/features/magic-context/memory/unborn-head.d.ts.map +1 -0
- package/dist/features/magic-context/memory-enabled.d.ts +5 -0
- package/dist/features/magic-context/memory-enabled.d.ts.map +1 -0
- package/dist/features/magic-context/project-embedding-registry.d.ts.map +1 -1
- package/dist/features/magic-context/search-pool-fixture.d.ts +39 -0
- package/dist/features/magic-context/search-pool-fixture.d.ts.map +1 -0
- package/dist/features/magic-context/search.d.ts.map +1 -1
- package/dist/features/magic-context/storage-tags.d.ts +2 -0
- package/dist/features/magic-context/storage-tags.d.ts.map +1 -1
- package/dist/features/magic-context/transform-decision-log.d.ts +57 -2
- package/dist/features/magic-context/transform-decision-log.d.ts.map +1 -1
- package/dist/{history-owner-ty29fz0f.js → history-owner-xp3pngv7.js} +3 -3
- package/dist/hooks/magic-context/apply-operations.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-prompt.d.ts +6 -0
- package/dist/hooks/magic-context/compartment-prompt.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-incremental.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-types.d.ts +3 -0
- package/dist/hooks/magic-context/compartment-runner-types.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-trigger-error.d.ts +12 -0
- package/dist/hooks/magic-context/compartment-trigger-error.d.ts.map +1 -0
- package/dist/hooks/magic-context/historian-prompt-fit.d.ts +14 -2
- package/dist/hooks/magic-context/historian-prompt-fit.d.ts.map +1 -1
- package/dist/hooks/magic-context/hook.d.ts.map +1 -1
- package/dist/hooks/magic-context/pending-materialization.d.ts +2 -0
- package/dist/hooks/magic-context/pending-materialization.d.ts.map +1 -1
- package/dist/hooks/magic-context/producer-window-guard.d.ts.map +1 -1
- package/dist/hooks/magic-context/protected-tail-boundary.d.ts +12 -0
- package/dist/hooks/magic-context/protected-tail-boundary.d.ts.map +1 -1
- package/dist/hooks/magic-context/raw-exact-ordinal-read.d.ts +58 -0
- package/dist/hooks/magic-context/raw-exact-ordinal-read.d.ts.map +1 -0
- package/dist/hooks/magic-context/raw-ordinal-warmup.d.ts +7 -0
- package/dist/hooks/magic-context/raw-ordinal-warmup.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-db.d.ts +5 -0
- package/dist/hooks/magic-context/read-session-db.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-raw.d.ts +19 -0
- package/dist/hooks/magic-context/read-session-raw.d.ts.map +1 -1
- package/dist/hooks/magic-context/recomp-orchestrator.d.ts +2 -0
- package/dist/hooks/magic-context/recomp-orchestrator.d.ts.map +1 -1
- package/dist/hooks/magic-context/render-options.d.ts +21 -0
- package/dist/hooks/magic-context/render-options.d.ts.map +1 -0
- package/dist/hooks/magic-context/system-prompt-hash.d.ts.map +1 -1
- package/dist/hooks/magic-context/tag-messages.d.ts +4 -0
- package/dist/hooks/magic-context/tag-messages.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-compartment-phase.d.ts +2 -0
- package/dist/hooks/magic-context/transform-compartment-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform.d.ts +5 -7
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/hooks/magic-context/wrapup-orchestrator.d.ts.map +1 -1
- package/dist/{index-21919gcq.js → index-05n6ykca.js} +4 -4
- package/dist/{index-q76br5zn.js → index-1d289pq2.js} +26 -21
- package/dist/{index-w28y7d0z.js → index-1sarmj9z.js} +15 -15
- package/dist/{index-x57ep4fp.js → index-1wwh38fk.js} +323 -121
- package/dist/{index-pgy3h49n.js → index-2pgxcncf.js} +4 -4
- package/dist/{index-ffa8x2as.js → index-6sytd5w3.js} +18 -13
- package/dist/{index-16vwdyy5.js → index-6sz25c3s.js} +3 -3
- package/dist/{index-4hb8nt93.js → index-7h8a1xpc.js} +3 -3
- package/dist/{index-rg1cezmj.js → index-7zd5asz9.js} +140 -17
- package/dist/{index-jw4gbfkv.js → index-8ketfacn.js} +2 -2
- package/dist/{index-nenz4gpb.js → index-95s8xaj1.js} +6 -5
- package/dist/{index-bmwfzz28.js → index-9vqb5p1s.js} +4 -4
- package/dist/{index-0jz47061.js → index-a8bvhwqs.js} +190 -30
- package/dist/{index-wpwpn7nj.js → index-b16gpywn.js} +9 -9
- package/dist/{index-g7jkrz0x.js → index-bp5083x2.js} +1 -1
- package/dist/{index-mp2kghkv.js → index-dyvbsvga.js} +1 -1
- package/dist/{index-s178h9z8.js → index-f71thw8j.js} +1 -1
- package/dist/{index-kvw6xew3.js → index-fkx2qnvw.js} +2 -2
- package/dist/{index-f8cn4xqa.js → index-fwefky9w.js} +18 -5
- package/dist/{index-a43xq1pg.js → index-fx90bvjd.js} +5 -5
- package/dist/{index-0sahzkwr.js → index-g2q4htwp.js} +46 -2
- package/dist/{index-7bjgyaj1.js → index-gf0psee3.js} +243 -135
- package/dist/{index-mw7c950g.js → index-gp3kcpc4.js} +1 -1
- package/dist/{index-gjvjh960.js → index-hqkczed7.js} +1 -1
- package/dist/{index-mvvephtj.js → index-j75v2476.js} +1 -1
- package/dist/{index-150zz6fh.js → index-k29z4aqh.js} +1 -1
- package/dist/{index-b64n4d0h.js → index-kee4kn5j.js} +1 -1
- package/dist/index-ksdyrrav.js +52 -0
- package/dist/{index-angx1s0k.js → index-mmfa86mt.js} +16 -6
- package/dist/{index-9jvab89d.js → index-n6m03s3n.js} +2 -2
- package/dist/{index-q28hsbpg.js → index-nj7yykkx.js} +1 -1
- package/dist/{index-ghc9f0n7.js → index-p5y3k4g7.js} +29 -1
- package/dist/{index-6k86es2p.js → index-qtbdx42g.js} +54 -25
- package/dist/{index-a865mj02.js → index-tdn0zkw4.js} +4 -4
- package/dist/{index-0x9cn9w1.js → index-wqs4q74r.js} +8 -8
- package/dist/{index-swgpe402.js → index-x2xjyq8f.js} +11 -11
- package/dist/{index-a4b0gbyg.js → index-y9f76s3f.js} +1 -1
- package/dist/{index-3403gbzj.js → index-yx5kgp2x.js} +288 -127
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +97 -76
- package/dist/{logger-wn328tfg.js → logger-jm3sqqzr.js} +2 -2
- package/dist/{message-index-bounded-fskdyc81.js → message-index-bounded-nq6rp8xa.js} +16 -16
- package/dist/{message-index-6r1x9cqh.js → message-index-df7swgy1.js} +16 -16
- package/dist/{message-time-backfill-nb5hhnrt.js → message-time-backfill-qjge9044.js} +3 -3
- package/dist/migration-worker.js +11 -11
- package/dist/plugin/dream-timer.d.ts.map +1 -1
- package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
- package/dist/plugin/tool-registry.d.ts.map +1 -1
- package/dist/{project-embedding-registry-vy7sv9jt.js → project-embedding-registry-q0ysjyzc.js} +11 -11
- package/dist/raw-ordinal-warmup-worker.js +12 -7
- package/dist/{read-session-chunk-zgpvs423.js → read-session-chunk-ax05f7gr.js} +11 -11
- package/dist/{read-session-raw-gm6xj30v.js → read-session-raw-m56hc7v2.js} +7 -3
- package/dist/{recomp-orchestrator-77xc8wpe.js → recomp-orchestrator-a0mvby4e.js} +29 -29
- package/dist/{safe-notification-target-jdynm677.js → safe-notification-target-1szv1k5k.js} +3 -3
- package/dist/{search-72fkjwk2.js → search-fm002702.js} +23 -23
- package/dist/{send-session-notification-q8ngbap3.js → send-session-notification-y2wg3fkh.js} +6 -6
- package/dist/shared/data-path.d.ts +4 -0
- package/dist/shared/data-path.d.ts.map +1 -1
- package/dist/shared/prompt-surface-runtime.d.ts +5 -0
- package/dist/shared/prompt-surface-runtime.d.ts.map +1 -1
- package/dist/{storage-tags-35m4gms2.js → storage-tags-yygfb9c8.js} +7 -5
- package/dist/{task-config-cgpg0nvh.js → task-config-x3qmayd2.js} +6 -2
- package/dist/tools/ctx-note/tools.d.ts.map +1 -1
- package/dist/{transform-postprocess-phase-r8d406j0.js → transform-postprocess-phase-s84rdf32.js} +29 -29
- package/dist/v2/auto-search-worker.js +4 -4
- package/dist/v2/{compaction-marker-candidates-a15w3mqh.js → compaction-marker-candidates-1vqwr3s5.js} +2 -2
- package/dist/v2/compaction-marker-candidates-worker.js +1 -1
- package/dist/v2/{context-z2yagwy4.js → context-x60fa16g.js} +758 -286
- package/dist/v2/{derive-budgets-0rmpmxjw.js → derive-budgets-z25jw3py.js} +3 -3
- package/dist/v2/embedding-backfill-mbjyza2a.js +20 -0
- package/dist/v2/embedding-worker-process.js +1 -1
- package/dist/v2/embedding-worker.js +5 -5
- package/dist/v2/{history-owner-2cr9py37.js → history-owner-42e16w0n.js} +2 -2
- package/dist/v2/hooks/context.d.ts.map +1 -1
- package/dist/v2/hooks/dream-manual.d.ts +1 -0
- package/dist/v2/hooks/dream-manual.d.ts.map +1 -1
- package/dist/v2/hooks/dream-timer.d.ts +3 -1
- package/dist/v2/hooks/dream-timer.d.ts.map +1 -1
- package/dist/v2/hooks/dream-trigger.d.ts +6 -1
- package/dist/v2/hooks/dream-trigger.d.ts.map +1 -1
- package/dist/v2/hooks/payload.d.ts +1 -1
- package/dist/v2/hooks/payload.d.ts.map +1 -1
- package/dist/v2/hooks/transform-decision-binding.d.ts +15 -0
- package/dist/v2/hooks/transform-decision-binding.d.ts.map +1 -0
- package/dist/v2/hooks/transform-features.d.ts +40 -0
- package/dist/v2/hooks/transform-features.d.ts.map +1 -0
- package/dist/v2/{logger-te6e1j72.js → logger-7qt02bnb.js} +1 -1
- package/dist/v2/{message-index-9ezq6wze.js → message-index-5nayhm1r.js} +15 -15
- package/dist/v2/{message-index-bounded-rqc603f2.js → message-index-bounded-pgv1ndpb.js} +15 -15
- package/dist/v2/{message-time-backfill-rz1pnpaj.js → message-time-backfill-bsteyc4d.js} +2 -2
- package/dist/v2/migration-worker.js +10 -10
- package/dist/v2/{project-embedding-registry-ja23aygk.js → project-embedding-registry-jbmjc0p4.js} +12 -10
- package/dist/v2/raw-ordinal-warmup-worker.js +12 -7
- package/dist/v2/{read-session-chunk-7f87tg2q.js → read-session-chunk-hr3w5bjk.js} +10 -10
- package/dist/v2/{read-session-raw-h4azh85b.js → read-session-raw-b3tf6ra1.js} +6 -2
- package/dist/v2/recomp-orchestrator-8w3449eb.js +59 -0
- package/dist/v2/{safe-notification-target-936374xx.js → safe-notification-target-qg7n2s77.js} +2 -2
- package/dist/v2/{search-2td1b1wy.js → search-mhmxgq0e.js} +22 -22
- package/dist/v2/{send-session-notification-6n7chhyp.js → send-session-notification-jevgj9fe.js} +5 -5
- package/dist/v2/{server-npm52h2q.js → server-05xjtq6c.js} +1 -1
- package/dist/v2/{server-s6jqh8bj.js → server-0ppsweh6.js} +1 -1
- package/dist/v2/server-0s95v3en.js +49 -0
- package/dist/v2/{server-2hxypdx5.js → server-25tg45b4.js} +17 -12
- package/dist/v2/{server-44ryn9rb.js → server-2x42esxd.js} +3 -3
- package/dist/v2/{server-4qr18rfg.js → server-37ngj8qw.js} +10 -51
- package/dist/v2/{server-4zwx20yg.js → server-4c10404h.js} +3 -3
- package/dist/v2/{server-23znwjqk.js → server-50mkkhy1.js} +14 -11
- package/dist/v2/{server-c9w52qss.js → server-5gvkzzrf.js} +290 -76
- package/dist/v2/{server-7dv9wt9r.js → server-6pmqg9m4.js} +1 -1
- package/dist/v2/{server-ak7w74j9.js → server-83ygfha2.js} +4 -4
- package/dist/v2/{server-4rs8sm06.js → server-9ewkzqgd.js} +5 -5
- package/dist/v2/{server-kmapq3v0.js → server-bxpwy6fy.js} +18 -5
- package/dist/v2/{server-zrwaj29a.js → server-d8tj10db.js} +25 -20
- package/dist/v2/{server-cxsr0ng6.js → server-da07v4xp.js} +1 -1
- package/dist/v2/{server-9e5r8y60.js → server-f2xf5gcb.js} +46 -2
- package/dist/v2/{server-hn9fb3v0.js → server-f7jfmrrz.js} +2 -2
- package/dist/v2/{server-f27he3j1.js → server-fa75w6gp.js} +4 -4
- package/dist/v2/{server-njnx39q2.js → server-gvkm8xaj.js} +189 -29
- package/dist/v2/{server-ckrb5rm8.js → server-h0410h0v.js} +1 -1
- package/dist/v2/{server-nveratm5.js → server-kn9n2qgd.js} +1 -1
- package/dist/v2/{server-gc8x2xdb.js → server-m97brnat.js} +9 -9
- package/dist/v2/{server-z0rjemg1.js → server-nmrm2rjy.js} +8 -8
- package/dist/v2/{server-bx59ezg6.js → server-prg55b7k.js} +16 -6
- package/dist/v2/{server-89fcbe37.js → server-pwv4ezb0.js} +1 -1
- package/dist/v2/{server-r5p3b1wy.js → server-qd11g795.js} +29 -1
- package/dist/v2/{server-988cqjme.js → server-rrqpvwqd.js} +2 -2
- package/dist/v2/{server-4easnf78.js → server-sz8jj92q.js} +150 -18
- package/dist/v2/{server-7e087rvk.js → server-th4y11y7.js} +16 -16
- package/dist/v2/{server-9a6bwc12.js → server-vknbt0gq.js} +255 -135
- package/dist/v2/{server-63ha7f0f.js → server-yrvqaswb.js} +1 -1
- package/dist/v2/{server-xqf2d2mg.js → server-zs8d0s3b.js} +2 -2
- package/dist/v2/server.d.ts.map +1 -1
- package/dist/v2/server.js +13 -6
- package/dist/v2/{storage-tags-c4zfcxv4.js → storage-tags-a2gq6dw7.js} +6 -4
- package/dist/v2/store-reader.d.ts +4 -0
- package/dist/v2/store-reader.d.ts.map +1 -1
- package/dist/v2/{task-config-x0hq3qfd.js → task-config-nvz8mapa.js} +6 -2
- package/dist/v2/{wrapup-orchestrator-wg8dmmm9.js → wrapup-orchestrator-r82y780v.js} +30 -29
- package/dist/wrapup-orchestrator-vmt6z3q5.js +47 -0
- package/package.json +1 -1
- package/src/agents/smart-notes-dreamer-gate.fixture.ts +171 -0
- package/src/agents/smart-notes-dreamer-gate.golden.json +245 -0
- package/src/agents/smart-notes-dreamer-gate.test.ts +161 -0
- package/src/config/agent-disable.ts +13 -0
- package/src/config/dependency-notes.test.ts +114 -0
- package/src/config/dependency-notes.ts +80 -0
- package/src/config/schema/magic-context.ts +23 -14
- package/src/features/magic-context/dreamer/task-registry.ts +40 -0
- package/src/shared/chunk-vector-writer-guard.test.ts +72 -0
- package/src/shared/data-path.test.ts +35 -1
- package/src/shared/data-path.ts +57 -1
- package/src/shared/prompt-surface-runtime.test.ts +15 -0
- package/src/shared/prompt-surface-runtime.ts +12 -0
- package/dist/embedding-backfill-3h2m5n0q.js +0 -21
- package/dist/v2/embedding-backfill-vr7wdtrf.js +0 -20
- package/dist/v2/recomp-orchestrator-s5tdpsbs.js +0 -59
- package/dist/wrapup-orchestrator-b1z99yg5.js +0 -47
|
@@ -4,13 +4,13 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
importPluginModule,
|
|
6
6
|
sessionLog2
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-j75v2476.js";
|
|
8
8
|
import {
|
|
9
9
|
isDefaultSessionTitle2
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-y9f76s3f.js";
|
|
11
11
|
import {
|
|
12
12
|
shouldHoldIgnoredNotification
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-1d289pq2.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-1szv1k5k.js"));
|
|
146
146
|
if (await waitForSafeNotificationTarget(client, sessionId) === "skip") {
|
|
147
147
|
sessionLog2(sessionId, "notification skipped (session not titled yet)");
|
|
148
148
|
return "skipped";
|
|
@@ -6,23 +6,23 @@ import {
|
|
|
6
6
|
StaleRouteHandleError,
|
|
7
7
|
SubcClient,
|
|
8
8
|
isConsumerReconnectTransient
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-fkx2qnvw.js";
|
|
10
10
|
import {
|
|
11
11
|
getHarness2
|
|
12
12
|
} from "./index-pavzsdc6.js";
|
|
13
13
|
import {
|
|
14
14
|
getDataDir
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-g2q4htwp.js";
|
|
16
16
|
import {
|
|
17
17
|
log2
|
|
18
|
-
} from "./index-
|
|
18
|
+
} from "./index-j75v2476.js";
|
|
19
19
|
import {
|
|
20
20
|
inRootAsyncContext2
|
|
21
21
|
} from "./index-wafzvyhg.js";
|
|
22
22
|
import {
|
|
23
23
|
buildCanonicalChunkTextFromFts,
|
|
24
24
|
loadCompartmentChunkEmbeddingsForSearch
|
|
25
|
-
} from "./index-
|
|
25
|
+
} from "./index-gf0psee3.js";
|
|
26
26
|
import {
|
|
27
27
|
recordEmbeddingMeasurement,
|
|
28
28
|
saveCommitEmbedding,
|
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
enqueueShadowEmbeddingItems2,
|
|
40
40
|
getProjectEmbeddingSnapshot2,
|
|
41
41
|
embedItemsForProject2
|
|
42
|
-
} from "./index-
|
|
42
|
+
} from "./index-7zd5asz9.js";
|
|
43
43
|
import {
|
|
44
44
|
getProjectEmbeddings2
|
|
45
45
|
} from "./index-4dhv7mqz.js";
|
|
@@ -48,7 +48,7 @@ import {
|
|
|
48
48
|
isEmbeddingEnabled,
|
|
49
49
|
embedText,
|
|
50
50
|
ensureMemoryEmbeddings2
|
|
51
|
-
} from "./index-
|
|
51
|
+
} from "./index-fx90bvjd.js";
|
|
52
52
|
import {
|
|
53
53
|
ModuleMemoryAuthorityError2,
|
|
54
54
|
getMemoriesByProject2,
|
|
@@ -63,20 +63,20 @@ import {
|
|
|
63
63
|
sanitizeFtsQuery,
|
|
64
64
|
searchMemoriesFTS,
|
|
65
65
|
searchMemoriesFTSUnion
|
|
66
|
-
} from "./index-
|
|
66
|
+
} from "./index-6sz25c3s.js";
|
|
67
67
|
import {
|
|
68
68
|
isRecord
|
|
69
|
-
} from "./index-
|
|
69
|
+
} from "./index-fwefky9w.js";
|
|
70
70
|
import {
|
|
71
71
|
getIndexedMessageCorpusSize2
|
|
72
|
-
} from "./index-
|
|
72
|
+
} from "./index-wqs4q74r.js";
|
|
73
73
|
import {
|
|
74
74
|
resolveWorkspaceShareCategories,
|
|
75
75
|
resolveWorkspaceIdentitySet,
|
|
76
76
|
expandWorkspaceIdentitySetWithAliases,
|
|
77
77
|
resolveStoredPathWorkspaceIdentity,
|
|
78
78
|
sourceNameForMemory
|
|
79
|
-
} from "./index-
|
|
79
|
+
} from "./index-tdn0zkw4.js";
|
|
80
80
|
import {
|
|
81
81
|
isKnownAutocommit
|
|
82
82
|
} from "./index-8ajstryz.js";
|
|
@@ -2658,15 +2658,20 @@ function searchNotes(args) {
|
|
|
2658
2658
|
sourceSessionId: entry.entry.note.sessionId
|
|
2659
2659
|
}));
|
|
2660
2660
|
}
|
|
2661
|
-
function searchCompartmentChunks(args) {
|
|
2661
|
+
async function searchCompartmentChunks(args) {
|
|
2662
2662
|
if (!args.queryEmbedding || args.limit <= 0 || !args.modelId || args.modelId === "off")
|
|
2663
2663
|
return [];
|
|
2664
2664
|
const cutoff = args.maxOrdinal != null && args.maxOrdinal >= 0 ? args.maxOrdinal : null;
|
|
2665
|
-
const rows = loadCompartmentChunkEmbeddingsForSearch(args.db, args.sessionId, args.projectPath, args.modelId, args.dateRange);
|
|
2665
|
+
const rows = await loadCompartmentChunkEmbeddingsForSearch(args.db, args.sessionId, args.projectPath, args.modelId, args.dateRange);
|
|
2666
2666
|
if (rows.length === 0)
|
|
2667
2667
|
return [];
|
|
2668
2668
|
const byCompartment = new Map;
|
|
2669
|
+
let sliceStarted = performance.now();
|
|
2669
2670
|
for (const row of rows) {
|
|
2671
|
+
if (performance.now() - sliceStarted >= 4) {
|
|
2672
|
+
await new Promise((resolve) => setImmediate(resolve));
|
|
2673
|
+
sliceStarted = performance.now();
|
|
2674
|
+
}
|
|
2670
2675
|
if (cutoff !== null && row.endOrdinal > cutoff) {
|
|
2671
2676
|
continue;
|
|
2672
2677
|
}
|
|
@@ -3022,7 +3027,7 @@ async function unifiedSearch2(db, sessionId, projectPath, query, options = {}) {
|
|
|
3022
3027
|
const workspace = resolveSearchWorkspaceContext(db, projectPath);
|
|
3023
3028
|
const embeddingModelId = queryContract?.modelId ?? options.embeddingModelIdOverride ?? embeddingSnapshot?.modelId;
|
|
3024
3029
|
const chunkModelId = queryContract?.chunkModelId ?? options.chunkModelIdOverride ?? embeddingSnapshot?.chunkModelId;
|
|
3025
|
-
const compartmentResults = runCompartmentChunks ? searchCompartmentChunks({
|
|
3030
|
+
const compartmentResults = runCompartmentChunks ? await searchCompartmentChunks({
|
|
3026
3031
|
db,
|
|
3027
3032
|
sessionId,
|
|
3028
3033
|
projectPath,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
sanitizeDiagnosticText,
|
|
3
3
|
sessionLog2
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-j75v2476.js";
|
|
5
5
|
import {
|
|
6
6
|
getHarness2
|
|
7
7
|
} from "./index-pavzsdc6.js";
|
|
@@ -14,10 +14,10 @@ import {
|
|
|
14
14
|
} from "./index-fr0wbhdn.js";
|
|
15
15
|
import {
|
|
16
16
|
managedAuthorityNoteRow
|
|
17
|
-
} from "./index-
|
|
17
|
+
} from "./index-tdn0zkw4.js";
|
|
18
18
|
import {
|
|
19
19
|
embedTextForProject2
|
|
20
|
-
} from "./index-
|
|
20
|
+
} from "./index-7zd5asz9.js";
|
|
21
21
|
import {
|
|
22
22
|
saveEmbeddingIfHashMatches
|
|
23
23
|
} from "./index-4dhv7mqz.js";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
importPluginModule,
|
|
3
3
|
log2
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-j75v2476.js";
|
|
5
5
|
import {
|
|
6
6
|
sendStatusNotification2
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-2pgxcncf.js";
|
|
8
8
|
import {
|
|
9
9
|
formatConflictShort
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-kee4kn5j.js";
|
|
11
11
|
|
|
12
12
|
// src/plugin/conflict-warning-hook.ts
|
|
13
13
|
import { existsSync, readFileSync } from "node:fs";
|
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
sanitizeDiagnosticText,
|
|
6
6
|
log2
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-j75v2476.js";
|
|
8
8
|
import {
|
|
9
9
|
isUserHomeDirectory,
|
|
10
10
|
setBootQuietPeriodForTests
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-a8bvhwqs.js";
|
|
12
12
|
import {
|
|
13
13
|
inRootAsyncContext2,
|
|
14
14
|
withSqliteBackgroundWriter2,
|
|
@@ -17,14 +17,15 @@ import {
|
|
|
17
17
|
} from "./index-wafzvyhg.js";
|
|
18
18
|
import {
|
|
19
19
|
estimateTokens
|
|
20
|
-
} from "./index-
|
|
20
|
+
} from "./index-hqkczed7.js";
|
|
21
21
|
import {
|
|
22
22
|
SYNAPSE_DEFAULT_MODEL,
|
|
23
23
|
isSynapseEmbeddingTruncated,
|
|
24
24
|
getSynapseBatchRequestKey,
|
|
25
25
|
SynapseEmbeddingProvider
|
|
26
|
-
} from "./index-
|
|
26
|
+
} from "./index-fkx2qnvw.js";
|
|
27
27
|
import {
|
|
28
|
+
DEFAULT_COMPARTMENT_CHUNK_MAX_INPUT_TOKENS,
|
|
28
29
|
CHUNK_WINDOW_SAFETY_RATIO,
|
|
29
30
|
normalizeCompartmentChunkMaxInputTokens,
|
|
30
31
|
buildCanonicalChunkTextFromFts,
|
|
@@ -40,17 +41,17 @@ import {
|
|
|
40
41
|
countSessionCompartmentEmbedCoverage,
|
|
41
42
|
countSessionCompartmentEmbedCoveragePolite,
|
|
42
43
|
countUnembeddedSessionCompartmentsPolite
|
|
43
|
-
} from "./index-
|
|
44
|
+
} from "./index-gf0psee3.js";
|
|
44
45
|
import {
|
|
45
46
|
DEFAULT_LOCAL_EMBEDDING_MODEL
|
|
46
|
-
} from "./index-
|
|
47
|
+
} from "./index-1sarmj9z.js";
|
|
47
48
|
import {
|
|
48
49
|
embeddingModelsMatch,
|
|
49
50
|
resolveEmbeddingTextPrefixes,
|
|
50
51
|
getEmbeddingProviderIdentity,
|
|
51
52
|
dominantEmbeddingFailure,
|
|
52
53
|
LocalEmbeddingProvider
|
|
53
|
-
} from "./index-
|
|
54
|
+
} from "./index-9vqb5p1s.js";
|
|
54
55
|
import {
|
|
55
56
|
isEmbeddingHostBusy2
|
|
56
57
|
} from "./index-qt1qqasc.js";
|
|
@@ -61,7 +62,7 @@ import {
|
|
|
61
62
|
} from "./index-4dhv7mqz.js";
|
|
62
63
|
import {
|
|
63
64
|
logSlowWriteTransaction
|
|
64
|
-
} from "./index-
|
|
65
|
+
} from "./index-k29z4aqh.js";
|
|
65
66
|
|
|
66
67
|
// src/features/magic-context/session-project-storage.ts
|
|
67
68
|
var SESSION_CHUNK_REPAIR_BATCH_SIZE = 100;
|
|
@@ -223,6 +224,9 @@ function pruneSynapseBatchLedgerForProject(db, projectIdentity, ttlMs = SYNAPSE_
|
|
|
223
224
|
return db.prepare(`DELETE FROM synapse_batch_ledger WHERE ${predicate}`).run(projectIdentity, shadow, cutoff).changes;
|
|
224
225
|
}
|
|
225
226
|
|
|
227
|
+
// src/features/magic-context/memory/embedding-openai.ts
|
|
228
|
+
import { createHash as createHash2 } from "node:crypto";
|
|
229
|
+
|
|
226
230
|
// src/features/magic-context/memory/embedding-ssrf.ts
|
|
227
231
|
var METADATA_HOSTNAMES = new Set(["metadata.google.internal", "metadata.goog"]);
|
|
228
232
|
var IPV6_METADATA_HOSTS = new Set(["fd00:ec2::254"]);
|
|
@@ -322,6 +326,55 @@ var FAILURE_THRESHOLD = 3;
|
|
|
322
326
|
var FAILURE_WINDOW_MS = 60000;
|
|
323
327
|
var OPEN_DURATION_MS = 5 * 60000;
|
|
324
328
|
var FETCH_TIMEOUT_MS = 30000;
|
|
329
|
+
var RETRY_AFTER_CAP_MS = 60000;
|
|
330
|
+
var RATE_LIMIT_BACKOFF_BASE_MS = 1000;
|
|
331
|
+
var RATE_LIMIT_BACKOFF_CAP_MS = 30000;
|
|
332
|
+
var RATE_LIMIT_BACKOFF_JITTER = 0.25;
|
|
333
|
+
var rateLimitStates = new Map;
|
|
334
|
+
function rateLimitStateKey(endpoint, apiKey) {
|
|
335
|
+
const keyHash = apiKey ? createHash2("sha256").update(apiKey).digest("hex").slice(0, 16) : "";
|
|
336
|
+
return `${endpoint}\x00${keyHash}`;
|
|
337
|
+
}
|
|
338
|
+
function parseRetryAfterMs(value, nowMs) {
|
|
339
|
+
const trimmed = value?.trim() ?? "";
|
|
340
|
+
if (!trimmed)
|
|
341
|
+
return null;
|
|
342
|
+
let delayMs;
|
|
343
|
+
if (/^\d+(?:\.\d+)?$/.test(trimmed)) {
|
|
344
|
+
delayMs = Number(trimmed) * 1000;
|
|
345
|
+
} else {
|
|
346
|
+
const at = Date.parse(trimmed);
|
|
347
|
+
if (!Number.isFinite(at))
|
|
348
|
+
return null;
|
|
349
|
+
delayMs = at - nowMs;
|
|
350
|
+
}
|
|
351
|
+
if (!(delayMs > 0))
|
|
352
|
+
return null;
|
|
353
|
+
return Math.min(Math.ceil(delayMs), RETRY_AFTER_CAP_MS);
|
|
354
|
+
}
|
|
355
|
+
function rateLimitBackoffMs(consecutive, random = Math.random) {
|
|
356
|
+
const exponent = Math.min(Math.max(0, Math.floor(consecutive)), 30);
|
|
357
|
+
const nominal = Math.min(RATE_LIMIT_BACKOFF_CAP_MS, RATE_LIMIT_BACKOFF_BASE_MS * 2 ** exponent);
|
|
358
|
+
const jitter = Math.min(1, Math.max(0, random())) * RATE_LIMIT_BACKOFF_JITTER;
|
|
359
|
+
return Math.min(RATE_LIMIT_BACKOFF_CAP_MS, Math.round(nominal * (1 + jitter)));
|
|
360
|
+
}
|
|
361
|
+
function sleepUnlessAborted(ms, signal) {
|
|
362
|
+
if (signal?.aborted)
|
|
363
|
+
return Promise.resolve(false);
|
|
364
|
+
return new Promise((resolve) => {
|
|
365
|
+
const onAbort = () => {
|
|
366
|
+
clearTimeout(timer);
|
|
367
|
+
resolve(false);
|
|
368
|
+
};
|
|
369
|
+
const timer = setTimeout(() => {
|
|
370
|
+
signal?.removeEventListener("abort", onAbort);
|
|
371
|
+
resolve(true);
|
|
372
|
+
}, ms);
|
|
373
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
var RATE_LIMITED = Symbol("rate-limited");
|
|
377
|
+
var maxInputTokensWarnings = new Set;
|
|
325
378
|
|
|
326
379
|
class OpenAICompatibleEmbeddingProvider {
|
|
327
380
|
modelId;
|
|
@@ -342,6 +395,7 @@ class OpenAICompatibleEmbeddingProvider {
|
|
|
342
395
|
lastFailureReason = null;
|
|
343
396
|
halfOpenProbeInFlight = false;
|
|
344
397
|
queryTruncationLogged = false;
|
|
398
|
+
rateLimitKey;
|
|
345
399
|
constructor(options) {
|
|
346
400
|
this.endpoint = normalizeEndpoint(options.endpoint);
|
|
347
401
|
this.model = options.model?.trim() ?? "";
|
|
@@ -352,7 +406,16 @@ class OpenAICompatibleEmbeddingProvider {
|
|
|
352
406
|
this.queryPrefix = prefixes.queryPrefix;
|
|
353
407
|
this.documentPrefix = prefixes.documentPrefix;
|
|
354
408
|
this.truncate = options.truncate?.trim() ?? "";
|
|
355
|
-
this.
|
|
409
|
+
this.rateLimitKey = rateLimitStateKey(this.endpoint, this.apiKey);
|
|
410
|
+
const maxInputTokensSet = typeof options.maxInputTokens === "number" && Number.isFinite(options.maxInputTokens);
|
|
411
|
+
this.maxInputTokens = maxInputTokensSet ? Math.max(1, Math.floor(options.maxInputTokens)) : DEFAULT_COMPARTMENT_CHUNK_MAX_INPUT_TOKENS;
|
|
412
|
+
if (!maxInputTokensSet && this.endpoint && this.model) {
|
|
413
|
+
const warningKey = `${this.endpoint}\x00${this.model}`;
|
|
414
|
+
if (!maxInputTokensWarnings.has(warningKey)) {
|
|
415
|
+
maxInputTokensWarnings.add(warningKey);
|
|
416
|
+
log2(`[magic-context] embedding.max_input_tokens is not set for openai-compatible model "${sanitizeDiagnosticText(this.model)}"; chunk embeddings use the ${DEFAULT_COMPARTMENT_CHUNK_MAX_INPUT_TOKENS}-token default, which is sized for the bundled local model and splits history into small pieces. Set embedding.max_input_tokens to the model's input limit (changing it re-embeds stored chunks once).`);
|
|
417
|
+
}
|
|
418
|
+
}
|
|
356
419
|
this.modelId = getEmbeddingProviderIdentity({
|
|
357
420
|
provider: "openai-compatible",
|
|
358
421
|
endpoint: this.endpoint,
|
|
@@ -410,6 +473,23 @@ class OpenAICompatibleEmbeddingProvider {
|
|
|
410
473
|
if (signal?.aborted) {
|
|
411
474
|
return Array.from({ length: texts.length }, () => null);
|
|
412
475
|
}
|
|
476
|
+
const isQuery = purpose === "query";
|
|
477
|
+
for (;; ) {
|
|
478
|
+
if (Date.now() < this.rateLimit.until) {
|
|
479
|
+
if (isQuery)
|
|
480
|
+
return Array.from({ length: texts.length }, () => null);
|
|
481
|
+
if (!await this.waitForRateLimitCooldown(signal)) {
|
|
482
|
+
return Array.from({ length: texts.length }, () => null);
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
const outcome = await this.requestOnce(texts, requestTexts, signal, purpose);
|
|
486
|
+
if (outcome !== RATE_LIMITED)
|
|
487
|
+
return outcome;
|
|
488
|
+
if (isQuery)
|
|
489
|
+
return Array.from({ length: texts.length }, () => null);
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
async requestOnce(texts, requestTexts, signal, purpose) {
|
|
413
493
|
let isProbe = false;
|
|
414
494
|
let internalController;
|
|
415
495
|
let timeoutHandle;
|
|
@@ -442,9 +522,14 @@ class OpenAICompatibleEmbeddingProvider {
|
|
|
442
522
|
redirect: "error",
|
|
443
523
|
signal: internalController.signal
|
|
444
524
|
});
|
|
525
|
+
if (response.status === 429) {
|
|
526
|
+
await response.text().catch(() => "");
|
|
527
|
+
this.noteRateLimit(response.headers.get("retry-after"));
|
|
528
|
+
return RATE_LIMITED;
|
|
529
|
+
}
|
|
445
530
|
if (!response.ok) {
|
|
446
531
|
const excerpt = await response.text().catch(() => "");
|
|
447
|
-
const failure = this.failure("http_error", `HTTP ${response.status} from endpoint${this.bodyExcerpt(excerpt)}`, response.status >= 500 || response.status === 408
|
|
532
|
+
const failure = this.failure("http_error", `HTTP ${response.status} from endpoint${this.bodyExcerpt(excerpt)}`, response.status >= 500 || response.status === 408);
|
|
448
533
|
log2(`[magic-context] openai-compatible embedding request failed: ${failure.reason}`);
|
|
449
534
|
this.recordFailure(isProbe, failure);
|
|
450
535
|
return Array.from({ length: texts.length }, () => null);
|
|
@@ -543,6 +628,36 @@ class OpenAICompatibleEmbeddingProvider {
|
|
|
543
628
|
isLoaded() {
|
|
544
629
|
return this.initialized;
|
|
545
630
|
}
|
|
631
|
+
get rateLimit() {
|
|
632
|
+
let state = rateLimitStates.get(this.rateLimitKey);
|
|
633
|
+
if (!state) {
|
|
634
|
+
state = { until: 0, consecutive: 0 };
|
|
635
|
+
rateLimitStates.set(this.rateLimitKey, state);
|
|
636
|
+
}
|
|
637
|
+
return state;
|
|
638
|
+
}
|
|
639
|
+
async waitForRateLimitCooldown(signal) {
|
|
640
|
+
for (;; ) {
|
|
641
|
+
const remaining = this.rateLimit.until - Date.now();
|
|
642
|
+
if (remaining <= 0)
|
|
643
|
+
return true;
|
|
644
|
+
if (!await sleepUnlessAborted(remaining, signal))
|
|
645
|
+
return false;
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
noteRateLimit(retryAfter) {
|
|
649
|
+
const state = this.rateLimit;
|
|
650
|
+
const now = Date.now();
|
|
651
|
+
const headerDelayMs = parseRetryAfterMs(retryAfter, now);
|
|
652
|
+
const delayMs = headerDelayMs ?? rateLimitBackoffMs(state.consecutive);
|
|
653
|
+
state.consecutive += 1;
|
|
654
|
+
const alreadyCoolingDown = now < state.until;
|
|
655
|
+
state.until = Math.max(state.until, now + delayMs);
|
|
656
|
+
const seconds = Math.ceil(delayMs / 1000);
|
|
657
|
+
if (!alreadyCoolingDown) {
|
|
658
|
+
log2(`[magic-context] openai-compatible embedding rate limited (HTTP 429): pausing requests for ${seconds}s (${headerDelayMs !== null ? "Retry-After" : "backoff"}); background embedding resumes after the pause and searches run lexical-only until then`);
|
|
659
|
+
}
|
|
660
|
+
}
|
|
546
661
|
claimProbeOrShortCircuit() {
|
|
547
662
|
if (this.circuitOpenUntil === 0) {
|
|
548
663
|
return "allow";
|
|
@@ -597,6 +712,7 @@ class OpenAICompatibleEmbeddingProvider {
|
|
|
597
712
|
this.circuitOpenUntil = 0;
|
|
598
713
|
this.openLogged = false;
|
|
599
714
|
this.lastFailureReason = null;
|
|
715
|
+
this.rateLimit.consecutive = 0;
|
|
600
716
|
}
|
|
601
717
|
getLastFailureReason() {
|
|
602
718
|
return this.lastFailureReason;
|
|
@@ -612,6 +728,9 @@ class OpenAICompatibleEmbeddingProvider {
|
|
|
612
728
|
_getFailureCount() {
|
|
613
729
|
return this.failureTimes.length;
|
|
614
730
|
}
|
|
731
|
+
_getRateLimitedUntil() {
|
|
732
|
+
return this.rateLimit.until;
|
|
733
|
+
}
|
|
615
734
|
_resetCircuit() {
|
|
616
735
|
this.failureTimes = [];
|
|
617
736
|
this.circuitOpenUntil = 0;
|
|
@@ -622,7 +741,7 @@ class OpenAICompatibleEmbeddingProvider {
|
|
|
622
741
|
}
|
|
623
742
|
|
|
624
743
|
// src/features/magic-context/project-embedding-registry.ts
|
|
625
|
-
import { createHash as
|
|
744
|
+
import { createHash as createHash3, randomUUID } from "node:crypto";
|
|
626
745
|
|
|
627
746
|
// src/features/magic-context/git-commits/storage-git-commit-embeddings.ts
|
|
628
747
|
var saveStatements = new WeakMap;
|
|
@@ -1305,10 +1424,10 @@ function stableStringify(value) {
|
|
|
1305
1424
|
return JSON.stringify(value);
|
|
1306
1425
|
}
|
|
1307
1426
|
function sha256Prefix(value, length = 16) {
|
|
1308
|
-
return
|
|
1427
|
+
return createHash3("sha256").update(value).digest("hex").slice(0, length);
|
|
1309
1428
|
}
|
|
1310
1429
|
function contentSha2562(value) {
|
|
1311
|
-
return
|
|
1430
|
+
return createHash3("sha256").update(value).digest("hex");
|
|
1312
1431
|
}
|
|
1313
1432
|
function getRuntimeFingerprint(config) {
|
|
1314
1433
|
if (config.provider === "off") {
|
|
@@ -2632,7 +2751,7 @@ async function drainCommitBacklogForProject2(db, projectIdentity, deadline) {
|
|
|
2632
2751
|
}
|
|
2633
2752
|
return total;
|
|
2634
2753
|
}
|
|
2635
|
-
async function embedCompartmentChunkBatch(db, projectIdentity, batchSize) {
|
|
2754
|
+
async function embedCompartmentChunkBatch(db, projectIdentity, batchSize, signal) {
|
|
2636
2755
|
const snapshot = getProjectEmbeddingSnapshot2(projectIdentity);
|
|
2637
2756
|
if (!snapshot?.historyEnabled || snapshot.chunkModelId === "off")
|
|
2638
2757
|
return 0;
|
|
@@ -2640,7 +2759,7 @@ async function embedCompartmentChunkBatch(db, projectIdentity, batchSize) {
|
|
|
2640
2759
|
const candidates = await loadUnembeddedCompartmentChunkCandidatesPolite(db, projectIdentity, snapshot.chunkModelId, batchSize, getProjectEmbeddingMaxInputTokens2(projectIdentity), true);
|
|
2641
2760
|
if (candidates.length === 0)
|
|
2642
2761
|
return 0;
|
|
2643
|
-
const { embedded } = await embedCandidateChunkBatch(db, projectIdentity, snapshot.chunkModelId, candidates);
|
|
2762
|
+
const { embedded } = await embedCandidateChunkBatch(db, projectIdentity, snapshot.chunkModelId, candidates, signal);
|
|
2644
2763
|
return embedded;
|
|
2645
2764
|
}
|
|
2646
2765
|
function getLastEmbeddingFailureForProject(projectIdentity) {
|
|
@@ -2777,6 +2896,9 @@ async function drainCompartmentChunkBacklogForProject(db, projectIdentity, deadl
|
|
|
2777
2896
|
}
|
|
2778
2897
|
let total = 0;
|
|
2779
2898
|
let leaseLost = false;
|
|
2899
|
+
const drainAbort = new AbortController;
|
|
2900
|
+
const deadlineTimer = setTimeout(() => drainAbort.abort(), Math.max(0, deadline - Date.now()));
|
|
2901
|
+
deadlineTimer.unref?.();
|
|
2780
2902
|
const renewal = inRootAsyncContext2(() => setInterval(() => {
|
|
2781
2903
|
try {
|
|
2782
2904
|
if (!renewGitSweepLease(db, projectIdentity, holderId))
|
|
@@ -2785,8 +2907,8 @@ async function drainCompartmentChunkBacklogForProject(db, projectIdentity, deadl
|
|
|
2785
2907
|
}, SESSION_EMBED_LEASE_RENEWAL_MS));
|
|
2786
2908
|
renewal.unref?.();
|
|
2787
2909
|
try {
|
|
2788
|
-
while (!leaseLost && !isEmbeddingHostBusy2() && Date.now() < deadline && total < CHUNK_DRAIN_MAX_PER_SWEEP) {
|
|
2789
|
-
const embedded = await embedCompartmentChunkBatch(db, projectIdentity, CHUNK_DRAIN_BATCH_SIZE);
|
|
2910
|
+
while (!leaseLost && !drainAbort.signal.aborted && !isEmbeddingHostBusy2() && Date.now() < deadline && total < CHUNK_DRAIN_MAX_PER_SWEEP) {
|
|
2911
|
+
const embedded = await embedCompartmentChunkBatch(db, projectIdentity, CHUNK_DRAIN_BATCH_SIZE, drainAbort.signal);
|
|
2790
2912
|
if (!renewGitSweepLease(db, projectIdentity, holderId))
|
|
2791
2913
|
leaseLost = true;
|
|
2792
2914
|
if (leaseLost || embedded === 0)
|
|
@@ -2796,6 +2918,7 @@ async function drainCompartmentChunkBacklogForProject(db, projectIdentity, deadl
|
|
|
2796
2918
|
break;
|
|
2797
2919
|
}
|
|
2798
2920
|
} finally {
|
|
2921
|
+
clearTimeout(deadlineTimer);
|
|
2799
2922
|
clearInterval(renewal);
|
|
2800
2923
|
releaseGitSweepLease(db, projectIdentity, holderId);
|
|
2801
2924
|
}
|
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
} from "./index-pavzsdc6.js";
|
|
4
4
|
import {
|
|
5
5
|
getMagicContextStorageDir
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-g2q4htwp.js";
|
|
7
7
|
import {
|
|
8
8
|
log2,
|
|
9
9
|
sessionLog2
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-j75v2476.js";
|
|
11
11
|
import {
|
|
12
12
|
localBudget,
|
|
13
13
|
calibrationForModelKey
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
sessionLog2
|
|
3
|
-
} from "./index-
|
|
3
|
+
} from "./index-j75v2476.js";
|
|
4
4
|
import {
|
|
5
5
|
COMPARTMENT_LEASE_RENEWAL_MS,
|
|
6
6
|
acquireCompartmentLease,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
getActiveCompartmentRun,
|
|
16
16
|
markActiveCompartmentRunPublished,
|
|
17
17
|
registerActiveCompartmentRun
|
|
18
|
-
} from "./index-
|
|
18
|
+
} from "./index-yx5kgp2x.js";
|
|
19
19
|
import {
|
|
20
20
|
inRootAsyncContext2
|
|
21
21
|
} from "./index-wafzvyhg.js";
|
|
@@ -27,17 +27,17 @@ import {
|
|
|
27
27
|
getHistorianFailureState,
|
|
28
28
|
clearEmergencyRecovery,
|
|
29
29
|
prepareRawSessionOrdinals2
|
|
30
|
-
} from "./index-
|
|
30
|
+
} from "./index-b16gpywn.js";
|
|
31
31
|
import {
|
|
32
32
|
pushNotification2
|
|
33
33
|
} from "./index-x8a7jmkh.js";
|
|
34
34
|
import {
|
|
35
35
|
sendStatusNotification2
|
|
36
|
-
} from "./index-
|
|
36
|
+
} from "./index-2pgxcncf.js";
|
|
37
37
|
import {
|
|
38
38
|
setRecompStarting2,
|
|
39
39
|
setRecompTerminal2
|
|
40
|
-
} from "./index-
|
|
40
|
+
} from "./index-05n6ykca.js";
|
|
41
41
|
|
|
42
42
|
// src/hooks/magic-context/wrapup-orchestrator.ts
|
|
43
43
|
import * as crypto from "node:crypto";
|
|
@@ -191,6 +191,7 @@ async function runOneWrapupIteration(args) {
|
|
|
191
191
|
memoryEnabled: ctx.memoryEnabled,
|
|
192
192
|
autoPromote: ctx.autoPromote,
|
|
193
193
|
experimentalUserMemories: ctx.userMemoriesEnabled,
|
|
194
|
+
userObservationsRequested: ctx.userObservationsRequested,
|
|
194
195
|
ensureProjectRegistered: ctx.ensureProjectRegistered,
|
|
195
196
|
getNotificationParams: () => ctx.getNotificationParams(sessionId),
|
|
196
197
|
preserveInjectionCacheUntilConsumed: true,
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DEFAULT_LOCAL_EMBEDDING_MODEL
|
|
3
|
-
} from "./index-
|
|
3
|
+
} from "./index-1sarmj9z.js";
|
|
4
4
|
import {
|
|
5
5
|
getSynapseLaneIdentity
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-fkx2qnvw.js";
|
|
7
7
|
import {
|
|
8
8
|
getHarness2
|
|
9
9
|
} from "./index-pavzsdc6.js";
|
|
10
10
|
import {
|
|
11
11
|
getMagicContextStorageDir
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-g2q4htwp.js";
|
|
13
13
|
import {
|
|
14
14
|
importPluginModule,
|
|
15
15
|
log2
|
|
16
|
-
} from "./index-
|
|
16
|
+
} from "./index-j75v2476.js";
|
|
17
17
|
import {
|
|
18
18
|
inRootAsyncContext2
|
|
19
19
|
} from "./index-wafzvyhg.js";
|