@cortexkit/opencode-magic-context 0.49.11 → 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-xwkfncav.js → conflict-warning-hook-f4x5wed7.js} +8 -8
- package/dist/{context-twz3s0cg.js → context-dam8p201.js} +106 -96
- 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/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/project-embedding-registry.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/{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 +2 -0
- 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/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-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/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 +4 -0
- 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-g40wgxxt.js → index-05n6ykca.js} +4 -4
- package/dist/{index-bzp9s8z2.js → index-1d289pq2.js} +2 -2
- package/dist/{index-w28y7d0z.js → index-1sarmj9z.js} +15 -15
- package/dist/{index-hqnggmxn.js → index-1wwh38fk.js} +128 -66
- package/dist/{index-0abg88h2.js → index-2pgxcncf.js} +4 -4
- package/dist/{index-84j7jq8a.js → index-6sytd5w3.js} +10 -10
- package/dist/{index-yhrrx7qa.js → index-6sz25c3s.js} +3 -3
- package/dist/{index-4jkhhpn1.js → index-7h8a1xpc.js} +3 -3
- package/dist/{index-se1w3v2m.js → index-7zd5asz9.js} +140 -17
- package/dist/{index-jw4gbfkv.js → index-8ketfacn.js} +2 -2
- package/dist/{index-q3qck7j2.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-qr1mkc2y.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-4ccdr7yw.js → index-fx90bvjd.js} +5 -5
- package/dist/{index-0sahzkwr.js → index-g2q4htwp.js} +46 -2
- package/dist/{index-9159kk15.js → index-gf0psee3.js} +5 -5
- 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-kkvxnbt8.js → index-qtbdx42g.js} +54 -25
- package/dist/{index-a865mj02.js → index-tdn0zkw4.js} +4 -4
- package/dist/{index-0j6crjgh.js → index-wqs4q74r.js} +8 -8
- package/dist/{index-xztdf9t7.js → index-x2xjyq8f.js} +11 -11
- package/dist/{index-a4b0gbyg.js → index-y9f76s3f.js} +1 -1
- package/dist/{index-z7avx6rw.js → index-yx5kgp2x.js} +197 -98
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +95 -67
- package/dist/{logger-wn328tfg.js → logger-jm3sqqzr.js} +2 -2
- package/dist/{message-index-bounded-0rbbg9rd.js → message-index-bounded-nq6rp8xa.js} +16 -16
- package/dist/{message-index-ct5x2kwa.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-ft9gh2e2.js → project-embedding-registry-q0ysjyzc.js} +11 -11
- package/dist/raw-ordinal-warmup-worker.js +12 -7
- package/dist/{read-session-chunk-y3hhsbzw.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-67k45s0b.js → recomp-orchestrator-a0mvby4e.js} +29 -29
- package/dist/{safe-notification-target-jdynm677.js → safe-notification-target-1szv1k5k.js} +3 -3
- package/dist/{search-jd8xh721.js → search-fm002702.js} +23 -23
- package/dist/{send-session-notification-vzhj8bsg.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/{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-pmqxfq4q.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-p1zfcw41.js → context-x60fa16g.js} +181 -83
- 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.map +1 -1
- package/dist/v2/hooks/dream-trigger.d.ts +1 -1
- package/dist/v2/hooks/dream-trigger.d.ts.map +1 -1
- package/dist/v2/hooks/transform-features.d.ts +1 -0
- package/dist/v2/hooks/transform-features.d.ts.map +1 -1
- package/dist/v2/{logger-te6e1j72.js → logger-7qt02bnb.js} +1 -1
- package/dist/v2/{message-index-cjhv92m2.js → message-index-5nayhm1r.js} +15 -15
- package/dist/v2/{message-index-bounded-7wcbp975.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-g34gcf74.js → project-embedding-registry-jbmjc0p4.js} +10 -10
- package/dist/v2/raw-ordinal-warmup-worker.js +12 -7
- package/dist/v2/{read-session-chunk-8d3v87vr.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-a1acjwf8.js → search-mhmxgq0e.js} +22 -22
- package/dist/v2/{send-session-notification-z5mcjdea.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-pbpp8r8h.js → server-25tg45b4.js} +9 -9
- package/dist/v2/{server-83d71zab.js → server-2x42esxd.js} +3 -3
- package/dist/v2/{server-5x7kmyz8.js → server-37ngj8qw.js} +10 -51
- package/dist/v2/{server-kn7skz9r.js → server-4c10404h.js} +3 -3
- package/dist/v2/{server-erfp0xb6.js → server-50mkkhy1.js} +10 -10
- package/dist/v2/{server-7fvmt15t.js → server-5gvkzzrf.js} +192 -49
- package/dist/v2/{server-7dv9wt9r.js → server-6pmqg9m4.js} +1 -1
- package/dist/v2/{server-h3wc20sv.js → server-83ygfha2.js} +4 -4
- package/dist/v2/{server-rxcq4t50.js → server-9ewkzqgd.js} +5 -5
- package/dist/v2/{server-kmapq3v0.js → server-bxpwy6fy.js} +18 -5
- package/dist/v2/{server-d6t16r89.js → server-d8tj10db.js} +1 -1
- 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-wkhfyzpg.js → server-m97brnat.js} +9 -9
- package/dist/v2/{server-d3f4g62c.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-sg68np13.js → server-sz8jj92q.js} +140 -17
- package/dist/v2/{server-jc8v585p.js → server-th4y11y7.js} +15 -15
- package/dist/v2/{server-ewqshbs8.js → server-vknbt0gq.js} +5 -5
- 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/{task-config-x0hq3qfd.js → task-config-nvz8mapa.js} +6 -2
- package/dist/v2/{wrapup-orchestrator-87q9d5e2.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/data-path.test.ts +35 -1
- package/src/shared/data-path.ts +57 -1
- package/dist/embedding-backfill-fjbfh1dt.js +0 -21
- package/dist/v2/embedding-backfill-xcw3t6hp.js +0 -20
- package/dist/v2/recomp-orchestrator-n0pq36f0.js +0 -59
- package/dist/wrapup-orchestrator-jqapepw0.js +0 -47
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getMagicContextBuiltinCommands,
|
|
3
3
|
readJsoncFile,
|
|
4
|
-
COMPACTION_ENABLED_PATH,
|
|
5
|
-
isDreamerRunnable,
|
|
6
|
-
isCompactionEnabled,
|
|
7
4
|
cortexKitUserConfigBasePath,
|
|
8
5
|
cortexKitProjectConfigBasePath,
|
|
9
6
|
resolveLegacyConfigSources,
|
|
10
7
|
getProtectedTokensTierOverrides,
|
|
11
8
|
loadPluginConfigDetailed
|
|
12
|
-
} from "./server-
|
|
9
|
+
} from "./server-37ngj8qw.js";
|
|
13
10
|
import {
|
|
14
11
|
getHarness2,
|
|
15
12
|
harnessOwnsOpenCodeStore2
|
|
@@ -24,7 +21,7 @@ import {
|
|
|
24
21
|
log2,
|
|
25
22
|
sessionLog2,
|
|
26
23
|
getLoggerDiagnostics2
|
|
27
|
-
} from "./server-
|
|
24
|
+
} from "./server-f2xf5gcb.js";
|
|
28
25
|
import {
|
|
29
26
|
hasTrustedAbsoluteWall,
|
|
30
27
|
applyProvenInputFloor,
|
|
@@ -36,7 +33,7 @@ import {
|
|
|
36
33
|
getSdkContextLimit,
|
|
37
34
|
getSdkOutputLimit,
|
|
38
35
|
getModelsDevCacheState
|
|
39
|
-
} from "./server-
|
|
36
|
+
} from "./server-kn9n2qgd.js";
|
|
40
37
|
import {
|
|
41
38
|
isValidLanguageCode,
|
|
42
39
|
withContentLanguageDirective,
|
|
@@ -49,7 +46,25 @@ import {
|
|
|
49
46
|
DEFAULT_HISTORIAN_TIMEOUT_MS,
|
|
50
47
|
DEFAULT_LOCAL_EMBEDDING_MODEL,
|
|
51
48
|
DREAM_TASK_PROMOTION_DEFAULTS
|
|
52
|
-
} from "./server-
|
|
49
|
+
} from "./server-th4y11y7.js";
|
|
50
|
+
import {
|
|
51
|
+
CANONICAL_DREAM_TASKS,
|
|
52
|
+
DREAM_TASK_CAPABILITIES,
|
|
53
|
+
toolLoopDreamTasks,
|
|
54
|
+
formatUnsupportedDreamTasks,
|
|
55
|
+
formatDreamTaskBacklogs,
|
|
56
|
+
processedDreamTaskItems,
|
|
57
|
+
PROJECT_MEMORY_DREAM_TASKS,
|
|
58
|
+
dreamTaskAllowedBySettings,
|
|
59
|
+
leaseKindFor,
|
|
60
|
+
leaseKeyFor,
|
|
61
|
+
isCanonicalDreamTask,
|
|
62
|
+
compareTaskOrder,
|
|
63
|
+
buildDreamTaskRuntimeConfigs2,
|
|
64
|
+
userMemoryCollectionEnabled2,
|
|
65
|
+
userObservationCollectionEnabled2,
|
|
66
|
+
userObservationsRequested2
|
|
67
|
+
} from "./server-qd11g795.js";
|
|
53
68
|
import {
|
|
54
69
|
historianRunConfig,
|
|
55
70
|
dreamerRunConfig,
|
|
@@ -91,6 +106,7 @@ import {
|
|
|
91
106
|
clearSession,
|
|
92
107
|
requestPendingMaterialization,
|
|
93
108
|
pendingMaterializationOrigin,
|
|
109
|
+
hasPendingMaterializationOrigin,
|
|
94
110
|
clearPendingMaterialization,
|
|
95
111
|
recordSystemPromptForRequest,
|
|
96
112
|
recordHeldHeadForRequest,
|
|
@@ -211,7 +227,6 @@ import {
|
|
|
211
227
|
MARKER_SUMMARY_TEXT,
|
|
212
228
|
markerUpdateDefinitelyDidNotCut,
|
|
213
229
|
applyDeferredCompactionMarker,
|
|
214
|
-
isProjectMemoryEnabled,
|
|
215
230
|
teardownChildSession,
|
|
216
231
|
runTokenLog,
|
|
217
232
|
formatRunTokenLog,
|
|
@@ -266,25 +281,12 @@ import {
|
|
|
266
281
|
getRawHistoryEligibility,
|
|
267
282
|
hasRunnableCompartmentWindow,
|
|
268
283
|
recordHighPressureNoEligibleHead,
|
|
284
|
+
noteTransformPassForExactOrdinalReads,
|
|
269
285
|
getActiveCompartmentRun,
|
|
270
286
|
startCompartmentAgent,
|
|
271
287
|
setRecompStarting2,
|
|
272
288
|
setRecompTerminal2
|
|
273
|
-
} from "./server-
|
|
274
|
-
import {
|
|
275
|
-
CANONICAL_DREAM_TASKS,
|
|
276
|
-
DREAM_TASK_CAPABILITIES,
|
|
277
|
-
toolLoopDreamTasks,
|
|
278
|
-
formatUnsupportedDreamTasks,
|
|
279
|
-
formatDreamTaskBacklogs,
|
|
280
|
-
processedDreamTaskItems,
|
|
281
|
-
leaseKindFor,
|
|
282
|
-
leaseKeyFor,
|
|
283
|
-
isCanonicalDreamTask,
|
|
284
|
-
compareTaskOrder,
|
|
285
|
-
buildDreamTaskRuntimeConfigs2,
|
|
286
|
-
userMemoryCollectionEnabled2
|
|
287
|
-
} from "./server-r5p3b1wy.js";
|
|
289
|
+
} from "./server-5gvkzzrf.js";
|
|
288
290
|
import {
|
|
289
291
|
resolveHistorianModel2
|
|
290
292
|
} from "./server-8cd2j99z.js";
|
|
@@ -309,7 +311,7 @@ import {
|
|
|
309
311
|
openDatabaseAsync,
|
|
310
312
|
isDatabasePersisted,
|
|
311
313
|
getDatabasePersistenceError
|
|
312
|
-
} from "./server-
|
|
314
|
+
} from "./server-50mkkhy1.js";
|
|
313
315
|
import {
|
|
314
316
|
setHomeProjectPermission,
|
|
315
317
|
shouldSkipHomeProjectMemory,
|
|
@@ -325,7 +327,7 @@ import {
|
|
|
325
327
|
storedPathBelongsToIdentity,
|
|
326
328
|
beginBootQuietPeriod,
|
|
327
329
|
scheduleAfterBootQuiet
|
|
328
|
-
} from "./server-
|
|
330
|
+
} from "./server-gvkm8xaj.js";
|
|
329
331
|
import {
|
|
330
332
|
detectLatestTurnThinkingMismatch,
|
|
331
333
|
isPrefixBoundThinkingModel,
|
|
@@ -512,7 +514,7 @@ import {
|
|
|
512
514
|
readRawSessionMessageById2,
|
|
513
515
|
readSessionChunk2,
|
|
514
516
|
readRawSessionSeedTail2
|
|
515
|
-
} from "./server-
|
|
517
|
+
} from "./server-m97brnat.js";
|
|
516
518
|
import {
|
|
517
519
|
textMentionsRecentCommit,
|
|
518
520
|
hasMeaningfulUserText2,
|
|
@@ -523,7 +525,7 @@ import {
|
|
|
523
525
|
estimateTokens,
|
|
524
526
|
estimateFixedPromptTokens,
|
|
525
527
|
normalizeText
|
|
526
|
-
} from "./server-
|
|
528
|
+
} from "./server-0ppsweh6.js";
|
|
527
529
|
import {
|
|
528
530
|
SubcClient,
|
|
529
531
|
connectionFileExists,
|
|
@@ -531,7 +533,7 @@ import {
|
|
|
531
533
|
toSynapseLaneDescriptor,
|
|
532
534
|
formatSynapseLaneDescriptor,
|
|
533
535
|
SynapseEmbeddingProvider
|
|
534
|
-
} from "./server-
|
|
536
|
+
} from "./server-rrqpvwqd.js";
|
|
535
537
|
import {
|
|
536
538
|
inRootAsyncContext2,
|
|
537
539
|
getTagIdentityWriteGeneration2,
|
|
@@ -546,17 +548,17 @@ import {
|
|
|
546
548
|
SqliteAcquisitionBusyError2,
|
|
547
549
|
withAsyncPrivilegedWriter2
|
|
548
550
|
} from "./server-wafzvyhg.js";
|
|
549
|
-
import"./server-
|
|
551
|
+
import"./server-yrvqaswb.js";
|
|
550
552
|
import {
|
|
551
553
|
deleteChunkEmbedBackoffForSession
|
|
552
|
-
} from "./server-
|
|
554
|
+
} from "./server-vknbt0gq.js";
|
|
553
555
|
import {
|
|
554
556
|
registerOwnRpcServerInstance,
|
|
555
557
|
rpcPortDir,
|
|
556
558
|
rpcPortFilePath,
|
|
557
559
|
parseRpcPortFile,
|
|
558
560
|
inspectProcessesAsync
|
|
559
|
-
} from "./server-
|
|
561
|
+
} from "./server-da07v4xp.js";
|
|
560
562
|
import {
|
|
561
563
|
BoundedSessionMap,
|
|
562
564
|
LkgRecoveryFenceError,
|
|
@@ -575,14 +577,14 @@ import {
|
|
|
575
577
|
isMessageIndexReconciledThrough2,
|
|
576
578
|
indexMessagesAfterOrdinal2,
|
|
577
579
|
sweepOrphanedOpenCodeMessageIndexes2
|
|
578
|
-
} from "./server-
|
|
580
|
+
} from "./server-nmrm2rjy.js";
|
|
579
581
|
import {
|
|
580
582
|
stableStringify,
|
|
581
583
|
getTemporalDecisions,
|
|
582
584
|
observeTemporalDecisions,
|
|
583
585
|
freezeTemporalDecisions,
|
|
584
586
|
tagIdentityRevisionKey
|
|
585
|
-
} from "./server-
|
|
587
|
+
} from "./server-pwv4ezb0.js";
|
|
586
588
|
import {
|
|
587
589
|
resolveModelCalibration,
|
|
588
590
|
calibrateBuckets,
|
|
@@ -649,6 +651,7 @@ import {
|
|
|
649
651
|
backfillTagTokenCounts2,
|
|
650
652
|
insertTag2,
|
|
651
653
|
updateTagStatus2,
|
|
654
|
+
markTagDropped2,
|
|
652
655
|
markWhitespaceAssistantTagInert2,
|
|
653
656
|
getInertWhitespaceAssistantTags2,
|
|
654
657
|
getInertWhitespaceAssistantTagsByNumbers2,
|
|
@@ -674,14 +677,15 @@ import {
|
|
|
674
677
|
adoptNullOwnerToolTag2,
|
|
675
678
|
getCandidateToolOwners2,
|
|
676
679
|
pickNearestPriorOwner2
|
|
677
|
-
} from "./server-
|
|
680
|
+
} from "./server-bxpwy6fy.js";
|
|
678
681
|
import"./server-51779zs2.js";
|
|
679
682
|
import {
|
|
680
683
|
isRawCompactionSummaryInfo2,
|
|
681
684
|
extractInMemoryMessageViews2,
|
|
682
685
|
buildInMemoryTailRawMessages2,
|
|
686
|
+
RawOrdinalsNotReady2,
|
|
683
687
|
runSessionWarmupWorker
|
|
684
|
-
} from "./server-
|
|
688
|
+
} from "./server-prg55b7k.js";
|
|
685
689
|
import {
|
|
686
690
|
resolveOpenCodeDbPath,
|
|
687
691
|
assertOpenCodeStoreGeneration,
|
|
@@ -697,12 +701,12 @@ import {
|
|
|
697
701
|
latestRealUserTurnIdFromOpenCodeDb,
|
|
698
702
|
getMessageTimesFromOpenCodeDb,
|
|
699
703
|
findLastAssistantModelFromOpenCodeDb
|
|
700
|
-
} from "./server-
|
|
704
|
+
} from "./server-d8tj10db.js";
|
|
701
705
|
import {
|
|
702
706
|
getCurrentToolSetHash,
|
|
703
707
|
recordToolDefinition,
|
|
704
708
|
getMeasuredToolDefinitionTokens
|
|
705
|
-
} from "./server-
|
|
709
|
+
} from "./server-zs8d0s3b.js";
|
|
706
710
|
import {
|
|
707
711
|
V2_MEMORY_CATEGORIES,
|
|
708
712
|
CATEGORY_PRIORITY
|
|
@@ -715,7 +719,7 @@ import {
|
|
|
715
719
|
resolveStoredPathWorkspaceIdentity,
|
|
716
720
|
storedPathBelongsToWorkspace,
|
|
717
721
|
computeWorkspaceEpochFingerprint
|
|
718
|
-
} from "./server-
|
|
722
|
+
} from "./server-fa75w6gp.js";
|
|
719
723
|
import {
|
|
720
724
|
GIT_SWEEP_LEASE_RENEWAL_MS,
|
|
721
725
|
acquireGitSweepLease,
|
|
@@ -743,7 +747,7 @@ import {
|
|
|
743
747
|
embedSessionCompartmentChunks2,
|
|
744
748
|
getEmbeddingCoverageStatus2,
|
|
745
749
|
getAutoEmbeddingSessionCoverage2
|
|
746
|
-
} from "./server-
|
|
750
|
+
} from "./server-sz8jj92q.js";
|
|
747
751
|
import {
|
|
748
752
|
configureContextDatabasePragmas2
|
|
749
753
|
} from "./server-fb3zxn06.js";
|
|
@@ -789,15 +793,15 @@ import {
|
|
|
789
793
|
readGitFileChangeTimesSince,
|
|
790
794
|
verificationFileExists,
|
|
791
795
|
normalizeVerificationFiles
|
|
792
|
-
} from "./server-
|
|
796
|
+
} from "./server-4c10404h.js";
|
|
793
797
|
import {
|
|
794
798
|
deriveTriggerBudget2,
|
|
795
799
|
deriveHistorianChunkTokens2,
|
|
796
800
|
resolveKnownHistorianContextLimit2,
|
|
797
801
|
resolveHistorianProducerLimits2,
|
|
798
802
|
resolveHistorianContextLimit2
|
|
799
|
-
} from "./server-
|
|
800
|
-
import"./server-
|
|
803
|
+
} from "./server-f7jfmrrz.js";
|
|
804
|
+
import"./server-05xjtq6c.js";
|
|
801
805
|
import {
|
|
802
806
|
isEmbeddingHostBusy2
|
|
803
807
|
} from "./server-qt1qqasc.js";
|
|
@@ -808,10 +812,10 @@ import {
|
|
|
808
812
|
} from "./server-4dhv7mqz.js";
|
|
809
813
|
import {
|
|
810
814
|
getLocalEmbeddingNativeMemoryStats
|
|
811
|
-
} from "./server-
|
|
815
|
+
} from "./server-2x42esxd.js";
|
|
812
816
|
import {
|
|
813
817
|
cosineSimilarity
|
|
814
|
-
} from "./server-
|
|
818
|
+
} from "./server-9ewkzqgd.js";
|
|
815
819
|
import {
|
|
816
820
|
computeCueContentHash,
|
|
817
821
|
hasMuralCueColumns,
|
|
@@ -844,11 +848,11 @@ import {
|
|
|
844
848
|
drainNotifications2,
|
|
845
849
|
isTuiConnected2
|
|
846
850
|
} from "./server-x8a7jmkh.js";
|
|
847
|
-
import"./server-
|
|
851
|
+
import"./server-h0410h0v.js";
|
|
848
852
|
import {
|
|
849
853
|
flushIgnoredMessages2,
|
|
850
854
|
sendStatusNotification2
|
|
851
|
-
} from "./server-
|
|
855
|
+
} from "./server-83ygfha2.js";
|
|
852
856
|
import {
|
|
853
857
|
renderSingleStoreMigrationRequiredRefusal,
|
|
854
858
|
SingleStoreMigrationRequiredError,
|
|
@@ -869,13 +873,19 @@ import {
|
|
|
869
873
|
resolveMemoriesByIdsForSearch2,
|
|
870
874
|
unifiedSearch2,
|
|
871
875
|
formatSearchResults2
|
|
872
|
-
} from "./server-
|
|
876
|
+
} from "./server-25tg45b4.js";
|
|
873
877
|
import {
|
|
874
878
|
resolvePromptContext2
|
|
875
879
|
} from "./server-fmsr7v69.js";
|
|
876
880
|
import {
|
|
877
881
|
compareSemverCore
|
|
878
882
|
} from "./server-84w6rvvf.js";
|
|
883
|
+
import {
|
|
884
|
+
COMPACTION_ENABLED_PATH,
|
|
885
|
+
isDreamerRunnable,
|
|
886
|
+
isSmartNoteSurfaceAvailable,
|
|
887
|
+
isCompactionEnabled
|
|
888
|
+
} from "./server-0s95v3en.js";
|
|
879
889
|
import {
|
|
880
890
|
__toESM,
|
|
881
891
|
__export
|
|
@@ -913,7 +923,7 @@ import {
|
|
|
913
923
|
} from "./server-8ajstryz.js";
|
|
914
924
|
import {
|
|
915
925
|
logSlowWriteTransaction
|
|
916
|
-
} from "./server-
|
|
926
|
+
} from "./server-6pmqg9m4.js";
|
|
917
927
|
|
|
918
928
|
// ../../node_modules/.bun/zod@4.1.8/node_modules/zod/v4/classic/external.js
|
|
919
929
|
var exports_external = {};
|
|
@@ -1613,6 +1623,39 @@ __export(exports_coerce, {
|
|
|
1613
1623
|
string: () => string3
|
|
1614
1624
|
});
|
|
1615
1625
|
|
|
1626
|
+
// src/config/dependency-notes.ts
|
|
1627
|
+
function scheduledTasks(config) {
|
|
1628
|
+
const tasks = config.dreamer?.tasks ?? {};
|
|
1629
|
+
return Object.entries(tasks).filter(([, task]) => typeof task?.schedule === "string" && task.schedule.trim() !== "").map(([name]) => name);
|
|
1630
|
+
}
|
|
1631
|
+
function configDependencyNotes(config) {
|
|
1632
|
+
const notes = [];
|
|
1633
|
+
const dreamerRunnable = isDreamerRunnable(config);
|
|
1634
|
+
const dreamerDisabled = config.dreamer?.disable === true;
|
|
1635
|
+
const memoryOff = config.memory?.enabled === false;
|
|
1636
|
+
const memoryTasks = scheduledTasks(config).filter((task) => PROJECT_MEMORY_DREAM_TASKS.includes(task));
|
|
1637
|
+
if (dreamerRunnable && memoryOff && memoryTasks.length > 0) {
|
|
1638
|
+
notes.push(`memory.enabled is false, so these scheduled dreamer tasks do not run for this project, on schedule or through /ctx-dream: ${memoryTasks.join(", ")}. maintain-docs, evaluate-smart-notes and review-user-memories still run.`);
|
|
1639
|
+
}
|
|
1640
|
+
if (dreamerDisabled && config.smart_notes?.enabled !== false) {
|
|
1641
|
+
notes.push("dreamer.disable is true, so smart_notes.enabled has no effect: ctx_note does not offer surface_condition and pending smart notes are not evaluated.");
|
|
1642
|
+
}
|
|
1643
|
+
const reviewSchedule = config.dreamer?.tasks?.["review-user-memories"]?.schedule;
|
|
1644
|
+
if (dreamerDisabled && typeof reviewSchedule === "string" && reviewSchedule.trim() !== "") {
|
|
1645
|
+
notes.push("dreamer.disable is true, so dreamer.tasks.review-user-memories.schedule has no effect: the historian does not collect user observations and the <user-profile> block gets no new entries.");
|
|
1646
|
+
}
|
|
1647
|
+
return notes;
|
|
1648
|
+
}
|
|
1649
|
+
var loggedNotes = new Set;
|
|
1650
|
+
function logConfigDependencyNotesOnce(config, log) {
|
|
1651
|
+
const fresh = configDependencyNotes(config).filter((note) => !loggedNotes.has(note));
|
|
1652
|
+
for (const note of fresh) {
|
|
1653
|
+
loggedNotes.add(note);
|
|
1654
|
+
log(`[magic-context] config note: ${note}`);
|
|
1655
|
+
}
|
|
1656
|
+
return fresh;
|
|
1657
|
+
}
|
|
1658
|
+
|
|
1616
1659
|
// src/features/magic-context/dreamer/manual-summary.ts
|
|
1617
1660
|
function summarizeManualDream(summary) {
|
|
1618
1661
|
const lines = ["## /ctx-dream", ""];
|
|
@@ -6874,13 +6917,20 @@ function foldBustsServedPrefix(reason, before, after) {
|
|
|
6874
6917
|
return CACHE_LOSING_FOLD_REASONS.has(reason ?? "") || foldChangesServedPrefix(before, after);
|
|
6875
6918
|
}
|
|
6876
6919
|
function prepareLegacyToolSkeletonConversions(db, sessionId, targets, options = {}) {
|
|
6877
|
-
const
|
|
6878
|
-
|
|
6879
|
-
|
|
6880
|
-
|
|
6881
|
-
|
|
6920
|
+
const candidates = [...targets.keys()].sort((a, b) => a - b);
|
|
6921
|
+
const readRows = (connection) => {
|
|
6922
|
+
if (candidates.length === 0)
|
|
6923
|
+
return [];
|
|
6924
|
+
const statement = connection.prepare(`SELECT tag_number AS tagNumber, drop_mode AS dropMode, message_id AS callId
|
|
6925
|
+
FROM tags WHERE session_id = ? AND tag_number = ?
|
|
6926
|
+
AND type = 'tool' AND status = 'dropped'
|
|
6927
|
+
AND drop_mode IN ('truncated', 'full')`);
|
|
6928
|
+
return candidates.flatMap((tagNumber) => {
|
|
6929
|
+
const row = statement.get(sessionId, tagNumber);
|
|
6930
|
+
return row ? [row] : [];
|
|
6931
|
+
});
|
|
6932
|
+
};
|
|
6882
6933
|
const rows = readRows(db);
|
|
6883
|
-
const identity = JSON.stringify(rows);
|
|
6884
6934
|
const converted = new Map;
|
|
6885
6935
|
for (const row of rows) {
|
|
6886
6936
|
const target = targets.get(row.tagNumber);
|
|
@@ -6901,7 +6951,10 @@ function prepareLegacyToolSkeletonConversions(db, sessionId, targets, options =
|
|
|
6901
6951
|
}
|
|
6902
6952
|
return {
|
|
6903
6953
|
converted,
|
|
6904
|
-
isCurrent: (connection) =>
|
|
6954
|
+
isCurrent: (connection) => {
|
|
6955
|
+
const current = readRows(connection);
|
|
6956
|
+
return current.length === rows.length && current.every((row, index) => row.tagNumber === rows[index].tagNumber && row.dropMode === rows[index].dropMode && row.callId === rows[index].callId);
|
|
6957
|
+
},
|
|
6905
6958
|
persist: (connection) => {
|
|
6906
6959
|
for (const [tagNumber, mode] of converted)
|
|
6907
6960
|
updateTagDropMode2(connection, sessionId, tagNumber, mode);
|
|
@@ -6988,9 +7041,7 @@ function applyPendingOperations(sessionId, db, targets, protectedTagIds, preload
|
|
|
6988
7041
|
try {
|
|
6989
7042
|
db.transaction(() => {
|
|
6990
7043
|
startedAt = performance.now();
|
|
6991
|
-
|
|
6992
|
-
updateTagDropMode2(db, sessionId, pendingOp.tagId, mode);
|
|
6993
|
-
updateTagStatus2(db, sessionId, pendingOp.tagId, "dropped");
|
|
7044
|
+
markTagDropped2(db, sessionId, pendingOp.tagId, mode);
|
|
6994
7045
|
if (!synthetic)
|
|
6995
7046
|
removePendingOp(db, sessionId, pendingOp.tagId);
|
|
6996
7047
|
}).immediate();
|
|
@@ -9529,6 +9580,25 @@ function finalizeMessageRepresentation(messages, resolvedProviderID, options) {
|
|
|
9529
9580
|
}
|
|
9530
9581
|
return { clearedParts, mergedReasoningParts };
|
|
9531
9582
|
}
|
|
9583
|
+
function legacyPublishedHeadChanged(args) {
|
|
9584
|
+
if (!args.pendingCompartmentInjection || !args.readLastServedMessages)
|
|
9585
|
+
return false;
|
|
9586
|
+
const served = args.readLastServedMessages();
|
|
9587
|
+
if (served === null)
|
|
9588
|
+
return true;
|
|
9589
|
+
const previous = served[0];
|
|
9590
|
+
if (!Array.isArray(previous?.parts) || !args.pendingCompartmentInjection)
|
|
9591
|
+
return false;
|
|
9592
|
+
const text = previous.parts.find((part) => typeof part === "object" && part !== null && ("type" in part) && part.type === "text" && ("text" in part))?.text;
|
|
9593
|
+
if (typeof text !== "string")
|
|
9594
|
+
return false;
|
|
9595
|
+
const block = `<session-history>
|
|
9596
|
+
${args.pendingCompartmentInjection.block}
|
|
9597
|
+
</session-history>`;
|
|
9598
|
+
return text !== block && !text.startsWith(`${block}
|
|
9599
|
+
|
|
9600
|
+
`);
|
|
9601
|
+
}
|
|
9532
9602
|
async function runPostTransformPhase(args) {
|
|
9533
9603
|
const tPostprocessSetup = performance.now();
|
|
9534
9604
|
const compactionOff = args.compactionOff === true;
|
|
@@ -9770,8 +9840,8 @@ async function runPostTransformPhase(args) {
|
|
|
9770
9840
|
subagentExecute: !args.fullFeatureMode && args.schedulerDecision === "execute",
|
|
9771
9841
|
hardFold: foldBustsServedPrefixThisPass || firstRenderBust || idleExpiryRebuild,
|
|
9772
9842
|
force: emergencyDropEligible && (args.contextUsage.percentage >= 95 || getEmergencyInputSample(args.db, args.sessionId) === 0),
|
|
9773
|
-
explicitFlush: isExplicitFlush
|
|
9774
|
-
publishedHistory: publishedM1RefreshedThisPass || !m0M1EnabledForFold && (args.pendingCompartmentInjection?.compartmentCount ?? 0) > 0 && (args
|
|
9843
|
+
explicitFlush: isExplicitFlush && hasPendingMaterializationOrigin(args.pendingMaterializationSessions, args.sessionId, "user_flush"),
|
|
9844
|
+
publishedHistory: !prefixPreflightFailed && (publishedM1RefreshedThisPass || !m0M1EnabledForFold && (args.pendingCompartmentInjection?.compartmentCount ?? 0) > 0 && legacyPublishedHeadChanged(args))
|
|
9775
9845
|
};
|
|
9776
9846
|
const publishedWorkDrainAllowed = !compactionOff && (!activeThinkingPrefixHold || firstRenderBust || idleExpiryRebuild || emergencyDropEligible) && hasReclaimRide(rideSignals);
|
|
9777
9847
|
const shouldApplyPendingOps = publishedWorkDrainAllowed;
|
|
@@ -11512,6 +11582,16 @@ function commitCompactionModeRecord(db, sessionId, record) {
|
|
|
11512
11582
|
setCompactionModeRecord(db, sessionId, record);
|
|
11513
11583
|
}
|
|
11514
11584
|
|
|
11585
|
+
// src/hooks/magic-context/compartment-trigger-error.ts
|
|
11586
|
+
function recordCompartmentTriggerError(passOutcome, sessionId, error, log = sessionLog2) {
|
|
11587
|
+
passOutcome.record("compartment-trigger-failure");
|
|
11588
|
+
if (error instanceof RawOrdinalsNotReady2) {
|
|
11589
|
+
log(sessionId, "compartment trigger deferred: raw ordinals not ready; the next pass evaluates it again");
|
|
11590
|
+
return;
|
|
11591
|
+
}
|
|
11592
|
+
log(sessionId, "compartment trigger failed (non-fatal):", error);
|
|
11593
|
+
}
|
|
11594
|
+
|
|
11515
11595
|
// src/hooks/magic-context/pass-outcome.ts
|
|
11516
11596
|
var PASS_DEGRADATION_EFFECTS = {
|
|
11517
11597
|
"store-generation-rebase-failure": "changes-request",
|
|
@@ -17738,6 +17818,7 @@ async function runCompartmentPhaseImpl(args) {
|
|
|
17738
17818
|
ensureProjectRegistered: args.ensureProjectRegistered,
|
|
17739
17819
|
getNotificationParams: args.getNotificationParams,
|
|
17740
17820
|
experimentalUserMemories: args.experimentalUserMemories,
|
|
17821
|
+
userObservationsRequested: args.userObservationsRequested,
|
|
17741
17822
|
historianTwoPass: args.historianTwoPass,
|
|
17742
17823
|
historianExpandTools: args.historianExpandTools,
|
|
17743
17824
|
memoryEnabled: args.memoryEnabled,
|
|
@@ -17779,6 +17860,7 @@ async function runCompartmentPhaseImpl(args) {
|
|
|
17779
17860
|
ensureProjectRegistered: args.ensureProjectRegistered,
|
|
17780
17861
|
getNotificationParams: args.getNotificationParams,
|
|
17781
17862
|
experimentalUserMemories: args.experimentalUserMemories,
|
|
17863
|
+
userObservationsRequested: args.userObservationsRequested,
|
|
17782
17864
|
historianTwoPass: args.historianTwoPass,
|
|
17783
17865
|
historianExpandTools: args.historianExpandTools,
|
|
17784
17866
|
memoryEnabled: args.memoryEnabled,
|
|
@@ -18474,6 +18556,7 @@ function createTransform(deps) {
|
|
|
18474
18556
|
fallbackModelId,
|
|
18475
18557
|
getNotificationParams: () => notificationParams,
|
|
18476
18558
|
experimentalUserMemories: historianRun?.userMemoriesEnabled ?? deps.experimentalUserMemories,
|
|
18559
|
+
userObservationsRequested: historianRun?.userObservationsRequested ?? deps.userObservationsRequested,
|
|
18477
18560
|
experimentalTemporalAwareness: deps.experimentalTemporalAwareness,
|
|
18478
18561
|
historianTwoPass: historianRun?.twoPass ?? deps.historianTwoPass,
|
|
18479
18562
|
historianExpandTools: historianRun?.expandTools ?? deps.historianExpandTools,
|
|
@@ -18529,6 +18612,7 @@ Historian previously failed ${historianFailureState.failureCount} time(s), so Ma
|
|
|
18529
18612
|
sessionLog2(sessionId, `tag floor: 0 (full-scan fallback) — no leading wire message resolved a tag across ${messages.length} msgs`);
|
|
18530
18613
|
}
|
|
18531
18614
|
const ownerRatio = sessionDecisionCalibration(db, sessionId).proseRatio;
|
|
18615
|
+
noteTransformPassForExactOrdinalReads(sessionId);
|
|
18532
18616
|
prewarmTagOwners(db, sessionId, ownerRatio);
|
|
18533
18617
|
const tagOwnersReady = isTagOwnerSummaryReady2(db, sessionId, ownerRatio);
|
|
18534
18618
|
let triggerBoundarySnapshot;
|
|
@@ -18552,8 +18636,7 @@ Historian previously failed ${historianFailureState.failureCount} time(s), so Ma
|
|
|
18552
18636
|
triggerBoundarySnapshot = triggerResult.boundarySnapshot;
|
|
18553
18637
|
}
|
|
18554
18638
|
} catch (error) {
|
|
18555
|
-
passOutcome
|
|
18556
|
-
sessionLog2(sessionId, "compartment trigger failed (non-fatal):", error);
|
|
18639
|
+
recordCompartmentTriggerError(passOutcome, sessionId, error);
|
|
18557
18640
|
}
|
|
18558
18641
|
logTransformTiming(sessionId, "compartmentTrigger", tTrigger);
|
|
18559
18642
|
}
|
|
@@ -18744,6 +18827,7 @@ Historian previously failed ${historianFailureState.failureCount} time(s), so Ma
|
|
|
18744
18827
|
safeForBackgroundCompression: historianRunnable && (isCacheBusting || schedulerDecision === "execute"),
|
|
18745
18828
|
deferredHistoryRefreshSessions,
|
|
18746
18829
|
experimentalUserMemories: historianRun?.userMemoriesEnabled ?? deps.experimentalUserMemories,
|
|
18830
|
+
userObservationsRequested: historianRun?.userObservationsRequested ?? deps.userObservationsRequested,
|
|
18747
18831
|
experimentalTemporalAwareness: deps.experimentalTemporalAwareness,
|
|
18748
18832
|
historianTwoPass: historianRun?.twoPass ?? deps.historianTwoPass,
|
|
18749
18833
|
historianExpandTools: historianRun?.expandTools ?? deps.historianExpandTools,
|
|
@@ -22475,9 +22559,9 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
22475
22559
|
return { count: buildCompartmentCount(db, sessionId, moduleStatus) };
|
|
22476
22560
|
});
|
|
22477
22561
|
const buildManagedCtx = async (db) => {
|
|
22478
|
-
const { deriveHistorianChunkTokens, resolveHistorianContextLimit } = await importPluginModule(() => import("./derive-budgets-
|
|
22562
|
+
const { deriveHistorianChunkTokens, resolveHistorianContextLimit } = await importPluginModule(() => import("./derive-budgets-z25jw3py.js"));
|
|
22479
22563
|
const { resolveHistorianModel } = await importPluginModule(() => import("./model-resolution-nx97z3x7.js"));
|
|
22480
|
-
const {
|
|
22564
|
+
const { userObservationCollectionEnabled, userObservationsRequested } = await importPluginModule(() => import("./task-config-nvz8mapa.js"));
|
|
22481
22565
|
const DEFAULT_HISTORIAN_TIMEOUT_MS = 10 * 60 * 1000;
|
|
22482
22566
|
const runConfig = historianRunConfig(config, currentPluginConfigReader(directory)?.poll().effective ?? config);
|
|
22483
22567
|
const historianModel = resolveHistorianModel(runConfig, "opencode");
|
|
@@ -22495,7 +22579,8 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
22495
22579
|
autoPromote: runConfig.memory?.auto_promote ?? true,
|
|
22496
22580
|
historianModel: historianModel.primary,
|
|
22497
22581
|
fallbackModels: historianModel.fallbacks,
|
|
22498
|
-
userMemoriesEnabled:
|
|
22582
|
+
userMemoriesEnabled: userObservationCollectionEnabled(runConfig.dreamer),
|
|
22583
|
+
userObservationsRequested: userObservationsRequested(runConfig.dreamer),
|
|
22499
22584
|
historianTwoPass: runConfig.historian?.two_pass === true,
|
|
22500
22585
|
historianExpandTools: runConfig.historian?.expand_tools,
|
|
22501
22586
|
getNotificationParams: (sessionId) => getLiveNotificationParams(sessionId, liveSessionState.liveModelBySession, liveSessionState.variantBySession, liveSessionState.agentBySession, runConfig.toast_duration_ms)
|
|
@@ -22507,7 +22592,7 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
22507
22592
|
return { ok: false, error: "no session" };
|
|
22508
22593
|
const readDirectory = args.readSessionDirectory;
|
|
22509
22594
|
if (readDirectory) {
|
|
22510
|
-
const { handoffHistoryWork } = await import("./history-owner-
|
|
22595
|
+
const { handoffHistoryWork } = await import("./history-owner-42e16w0n.js");
|
|
22511
22596
|
const handed = await handoffHistoryWork({
|
|
22512
22597
|
storageDir: args.storageDir ?? getMagicContextStorageDir(),
|
|
22513
22598
|
directory,
|
|
@@ -22526,8 +22611,8 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
22526
22611
|
const db = readDatabase();
|
|
22527
22612
|
if (!db)
|
|
22528
22613
|
return { ok: false, error: "db unavailable" };
|
|
22529
|
-
const { runManagedRecomp } = await importPluginModule(() => import("./recomp-orchestrator-
|
|
22530
|
-
const { sendIgnoredMessage } = await importPluginModule(() => import("./send-session-notification-
|
|
22614
|
+
const { runManagedRecomp } = await importPluginModule(() => import("./recomp-orchestrator-8w3449eb.js"));
|
|
22615
|
+
const { sendIgnoredMessage } = await importPluginModule(() => import("./send-session-notification-jevgj9fe.js"));
|
|
22531
22616
|
log2(`[rpc] recomp requested for session ${sessionId}`);
|
|
22532
22617
|
if (!args.client && !args.hiddenCompletionExecutor) {
|
|
22533
22618
|
return {
|
|
@@ -22585,7 +22670,7 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
22585
22670
|
rpcServer.handle("wrapup", async (params) => {
|
|
22586
22671
|
const readDirectory = args.readSessionDirectory;
|
|
22587
22672
|
if (readDirectory && params.sessionId) {
|
|
22588
|
-
const { handoffHistoryWork } = await import("./history-owner-
|
|
22673
|
+
const { handoffHistoryWork } = await import("./history-owner-42e16w0n.js");
|
|
22589
22674
|
const sessionId = String(params.sessionId);
|
|
22590
22675
|
const handed = await handoffHistoryWork({
|
|
22591
22676
|
storageDir: args.storageDir ?? getMagicContextStorageDir(),
|
|
@@ -22611,7 +22696,7 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
22611
22696
|
const db = readDatabase();
|
|
22612
22697
|
if (!db)
|
|
22613
22698
|
return { ok: false, error: "db unavailable" };
|
|
22614
|
-
const { runManagedWrapup } = await importPluginModule(() => import("./wrapup-orchestrator-
|
|
22699
|
+
const { runManagedWrapup } = await importPluginModule(() => import("./wrapup-orchestrator-r82y780v.js"));
|
|
22615
22700
|
const model = liveSessionState.liveModelBySession.get(sessionId);
|
|
22616
22701
|
const contextLimit = model ? resolveContextLimit(model.providerID, model.modelID, { db, sessionID: sessionId }) : 128000;
|
|
22617
22702
|
const ctx = {
|
|
@@ -34079,6 +34164,12 @@ function pruneIdleScheduleIdentities(db, now) {
|
|
|
34079
34164
|
|
|
34080
34165
|
// src/features/magic-context/dreamer/task-scheduler.ts
|
|
34081
34166
|
var MAX_TASK_RETRIES = 3;
|
|
34167
|
+
function tasksAllowedBySettings(deps) {
|
|
34168
|
+
return deps.tasks.filter((config) => dreamTaskAllowedBySettings(config.task, {
|
|
34169
|
+
projectMemoryEnabled: deps.projectMemoryEnabled,
|
|
34170
|
+
smartNotesEnabled: deps.smartNotesEnabled
|
|
34171
|
+
}));
|
|
34172
|
+
}
|
|
34082
34173
|
function ensureSeeded(db, projectIdentity, config, now) {
|
|
34083
34174
|
if (getTaskScheduleState(db, projectIdentity, config.task))
|
|
34084
34175
|
return;
|
|
@@ -34297,19 +34388,18 @@ async function runManualDream(deps) {
|
|
|
34297
34388
|
};
|
|
34298
34389
|
if (!isUsableProjectIdentity(deps.projectIdentity))
|
|
34299
34390
|
return result;
|
|
34391
|
+
const allowed = tasksAllowedBySettings(deps);
|
|
34300
34392
|
let selected;
|
|
34301
34393
|
let forceGate = false;
|
|
34302
34394
|
if (deps.task) {
|
|
34303
|
-
const cfg =
|
|
34395
|
+
const cfg = allowed.find((t) => t.task === deps.task);
|
|
34304
34396
|
if (!cfg)
|
|
34305
34397
|
return result;
|
|
34306
34398
|
selected = [cfg];
|
|
34307
34399
|
forceGate = true;
|
|
34308
34400
|
} else {
|
|
34309
|
-
selected =
|
|
34401
|
+
selected = allowed.filter((t) => t.schedule.trim() !== "");
|
|
34310
34402
|
}
|
|
34311
|
-
if (!isProjectMemoryEnabled(deps.projectMemoryEnabled))
|
|
34312
|
-
selected = selected.filter((config) => config.task === "evaluate-smart-notes");
|
|
34313
34403
|
if (selected.length === 0)
|
|
34314
34404
|
return result;
|
|
34315
34405
|
const selectedTaskNames = selected.map((config) => config.task);
|
|
@@ -34375,10 +34465,11 @@ async function runManualDream(deps) {
|
|
|
34375
34465
|
async function runDueTasksForProject(deps) {
|
|
34376
34466
|
if (!isUsableProjectIdentity(deps.projectIdentity))
|
|
34377
34467
|
return 0;
|
|
34378
|
-
|
|
34468
|
+
const tasks = tasksAllowedBySettings(deps);
|
|
34469
|
+
if (tasks.length === 0)
|
|
34379
34470
|
return 0;
|
|
34380
34471
|
const now = deps.now ?? Date.now();
|
|
34381
|
-
const due = planDueTasks(deps.db, deps.projectIdentity,
|
|
34472
|
+
const due = planDueTasks(deps.db, deps.projectIdentity, tasks, now);
|
|
34382
34473
|
if (due.length === 0)
|
|
34383
34474
|
return 0;
|
|
34384
34475
|
const gated = [];
|
|
@@ -34515,6 +34606,7 @@ async function runManualDreamNow(args) {
|
|
|
34515
34606
|
db: args.db,
|
|
34516
34607
|
projectIdentity: args.projectIdentity,
|
|
34517
34608
|
projectMemoryEnabled: args.memoryEnabled,
|
|
34609
|
+
smartNotesEnabled: args.smartNotesEnabled,
|
|
34518
34610
|
tasks: selection.runnable,
|
|
34519
34611
|
executor,
|
|
34520
34612
|
...args.task !== undefined ? { task: args.task } : {}
|
|
@@ -34992,7 +35084,8 @@ async function sweepProject(reg, origin, db, gitCommitEnabled) {
|
|
|
34992
35084
|
projectIdentity: reg.projectIdentity,
|
|
34993
35085
|
tasks: runtimeConfigs,
|
|
34994
35086
|
executor,
|
|
34995
|
-
projectMemoryEnabled: reg.memoryEnabled !== false
|
|
35087
|
+
projectMemoryEnabled: reg.memoryEnabled !== false,
|
|
35088
|
+
smartNotesEnabled: reg.smartNotesEnabled
|
|
34996
35089
|
});
|
|
34997
35090
|
if (ran > 0) {
|
|
34998
35091
|
log2(`[dreamer] timer tick (${origin}) ${reg.projectIdentity} — ran ${ran} task(s)`);
|
|
@@ -35230,6 +35323,7 @@ function startDreamTrigger(context, args) {
|
|
|
35230
35323
|
db,
|
|
35231
35324
|
projectIdentity: args.projectIdentity(),
|
|
35232
35325
|
projectMemoryEnabled: args.projectMemoryEnabled,
|
|
35326
|
+
smartNotesEnabled: args.smartNotesEnabled,
|
|
35233
35327
|
tasks: runnable,
|
|
35234
35328
|
executor: createDreamTaskExecutor({
|
|
35235
35329
|
hiddenCompletionExecutor: args.executor,
|
|
@@ -49777,12 +49871,13 @@ function parseNoteIds(action, value) {
|
|
|
49777
49871
|
}
|
|
49778
49872
|
function createCtxNoteTool(deps) {
|
|
49779
49873
|
const { surface_condition: _condition, ...plainArgs } = ctxNoteArgsShape;
|
|
49874
|
+
const smartNoteSurface = deps.smartNotesEnabled !== false && deps.dreamerEnabled !== false;
|
|
49780
49875
|
return tool({
|
|
49781
|
-
description:
|
|
49782
|
-
args:
|
|
49876
|
+
description: smartNoteSurface ? CTX_NOTE_DESCRIPTION : withoutSmartNoteText(CTX_NOTE_DESCRIPTION),
|
|
49877
|
+
args: smartNoteSurface ? ctxNoteArgsShape : {
|
|
49783
49878
|
...plainArgs,
|
|
49784
49879
|
filter: ctxNoteArgsShape.filter.describe(NOTES_FILTER_DESCRIPTION)
|
|
49785
|
-
}
|
|
49880
|
+
},
|
|
49786
49881
|
async execute(rawArgs, toolContext) {
|
|
49787
49882
|
const parsedArgs = ctxNoteArgsSchema.safeParse(rawArgs);
|
|
49788
49883
|
let args = parsedArgs.success ? parsedArgs.data : rawArgs;
|
|
@@ -50452,7 +50547,8 @@ function createV2TransformFeatureDeps(config, compactionOff, directory) {
|
|
|
50452
50547
|
},
|
|
50453
50548
|
ensureProjectRegistered: ensureProjectRegisteredFromOpenCodeDirectory,
|
|
50454
50549
|
historyBudgetPercentage: config.history_budget_percentage,
|
|
50455
|
-
experimentalUserMemories:
|
|
50550
|
+
experimentalUserMemories: userObservationCollectionEnabled2(config.dreamer),
|
|
50551
|
+
userObservationsRequested: userObservationsRequested2(config.dreamer),
|
|
50456
50552
|
experimentalTemporalAwareness: config.temporal_awareness === true,
|
|
50457
50553
|
muralEnabled: config.mural?.enabled === true,
|
|
50458
50554
|
autoSearch: {
|
|
@@ -50830,6 +50926,7 @@ async function registerContext(context) {
|
|
|
50830
50926
|
directory,
|
|
50831
50927
|
warn: (message) => log2(`[magic-context] config warning: ${message}`)
|
|
50832
50928
|
});
|
|
50929
|
+
logConfigDependencyNotesOnce(config, log2);
|
|
50833
50930
|
const storage = createV2StorageGate({
|
|
50834
50931
|
onUnavailable: (reason) => {
|
|
50835
50932
|
const message = formatFailClosedBlockingMessage(reason);
|
|
@@ -51019,7 +51116,8 @@ async function registerContext(context) {
|
|
|
51019
51116
|
twoPass: fresh.historian?.two_pass === true,
|
|
51020
51117
|
expandTools: fresh.historian?.expand_tools,
|
|
51021
51118
|
autoPromote: fresh.memory?.auto_promote ?? true,
|
|
51022
|
-
userMemoriesEnabled:
|
|
51119
|
+
userMemoriesEnabled: userObservationCollectionEnabled2(fresh.dreamer),
|
|
51120
|
+
userObservationsRequested: userObservationsRequested2(fresh.dreamer),
|
|
51023
51121
|
commitClusterTrigger: fresh.commit_cluster_trigger,
|
|
51024
51122
|
chunkTokens: deriveHistorianChunkTokens2(resolveHistorianContextLimit2(models.primary?.model))
|
|
51025
51123
|
};
|
|
@@ -51436,7 +51534,7 @@ async function registerContext(context) {
|
|
|
51436
51534
|
if (!modelLimitCacheWarm())
|
|
51437
51535
|
withoutSqliteTransformPass2(() => warmModelLimitCacheFromCatalog(context));
|
|
51438
51536
|
agents.set(draft.sessionID, draft.agent);
|
|
51439
|
-
applyV2PromptSurfaceTools(draft, promptSurfaceRuntime, config.prompt_surface, config
|
|
51537
|
+
applyV2PromptSurfaceTools(draft, promptSurfaceRuntime, config.prompt_surface, isSmartNoteSurfaceAvailable(config));
|
|
51440
51538
|
const admissionDb = db ?? storage.current();
|
|
51441
51539
|
const replayFits = (messages) => {
|
|
51442
51540
|
const system = structuredClone(draft.system);
|