@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
|
@@ -7,7 +7,15 @@ import * as fs from "node:fs";
|
|
|
7
7
|
import * as path2 from "node:path";
|
|
8
8
|
|
|
9
9
|
// src/shared/data-path.ts
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
existsSync,
|
|
12
|
+
lstatSync,
|
|
13
|
+
mkdirSync,
|
|
14
|
+
readFileSync,
|
|
15
|
+
readlinkSync,
|
|
16
|
+
realpathSync,
|
|
17
|
+
writeFileSync
|
|
18
|
+
} from "node:fs";
|
|
11
19
|
import * as os from "node:os";
|
|
12
20
|
import * as path from "node:path";
|
|
13
21
|
|
|
@@ -99,6 +107,42 @@ function getMagicContextStorageResolution() {
|
|
|
99
107
|
function getMagicContextStorageDir() {
|
|
100
108
|
return getMagicContextStorageResolution().path;
|
|
101
109
|
}
|
|
110
|
+
function canonicalizeStoragePath(value, seen = new Set) {
|
|
111
|
+
const absolute = path.resolve(value);
|
|
112
|
+
if (seen.has(absolute))
|
|
113
|
+
return absolute;
|
|
114
|
+
seen.add(absolute);
|
|
115
|
+
try {
|
|
116
|
+
return realpathSync.native(absolute);
|
|
117
|
+
} catch {
|
|
118
|
+
try {
|
|
119
|
+
if (lstatSync(absolute).isSymbolicLink()) {
|
|
120
|
+
const target = readlinkSync(absolute);
|
|
121
|
+
const resolvedTarget = path.isAbsolute(target) ? target : path.resolve(path.dirname(absolute), target);
|
|
122
|
+
return canonicalizeStoragePath(resolvedTarget, seen);
|
|
123
|
+
}
|
|
124
|
+
} catch {}
|
|
125
|
+
const parent = path.dirname(absolute);
|
|
126
|
+
if (parent === absolute)
|
|
127
|
+
return absolute;
|
|
128
|
+
const resolvedParent = canonicalizeStoragePath(parent, seen);
|
|
129
|
+
return path.resolve(resolvedParent, path.basename(absolute));
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
function isMagicContextStorageOutsideEngram(storageDir = getMagicContextStorageDir(), backupDir = path.join(os.homedir(), ".local", "share", "cortexkit", "magic-context")) {
|
|
133
|
+
const resolvedStorageDir = canonicalizeStoragePath(storageDir);
|
|
134
|
+
const resolvedBackupDir = canonicalizeStoragePath(backupDir);
|
|
135
|
+
const relative2 = path.relative(resolvedBackupDir, resolvedStorageDir);
|
|
136
|
+
return path.isAbsolute(relative2) || relative2 === ".." || relative2.startsWith(`..${path.sep}`);
|
|
137
|
+
}
|
|
138
|
+
var STORAGE_BACKUP_WARNING_CHECKED = Symbol.for("magic-context.storage-backup-warning-checked");
|
|
139
|
+
function claimStorageBackupWarningCheck() {
|
|
140
|
+
const processState = globalThis;
|
|
141
|
+
if (processState[STORAGE_BACKUP_WARNING_CHECKED])
|
|
142
|
+
return false;
|
|
143
|
+
processState[STORAGE_BACKUP_WARNING_CHECKED] = true;
|
|
144
|
+
return true;
|
|
145
|
+
}
|
|
102
146
|
function getLegacyOpenCodeMagicContextStorageDir() {
|
|
103
147
|
return path.join(getOpenCodeStorageDir(), "plugin", "magic-context");
|
|
104
148
|
}
|
|
@@ -655,4 +699,4 @@ if (!isTestEnv) {
|
|
|
655
699
|
process.on("exit", flush);
|
|
656
700
|
}
|
|
657
701
|
|
|
658
|
-
export { getDataDir, ensureCortexKitArtifactGitignore, getProjectMagicContextHistorianDir, getMagicContextStorageDir, getLegacyOpenCodeMagicContextStorageDir, sanitizeDiagnosticText, hasShareabilitySensitiveText, registerStalePluginBuildHost, classifyStalePluginBuild, importPluginModule, setLogLineForwarder2, writeForwardedLogLine2, log2, sessionLog2, getLoggerDiagnostics2, flushLogger2, getLogFilePath2 };
|
|
702
|
+
export { getDataDir, ensureCortexKitArtifactGitignore, getProjectMagicContextHistorianDir, getMagicContextStorageDir, isMagicContextStorageOutsideEngram, claimStorageBackupWarningCheck, getLegacyOpenCodeMagicContextStorageDir, sanitizeDiagnosticText, hasShareabilitySensitiveText, registerStalePluginBuildHost, classifyStalePluginBuild, importPluginModule, setLogLineForwarder2, writeForwardedLogLine2, log2, sessionLog2, getLoggerDiagnostics2, flushLogger2, getLogFilePath2 };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log2
|
|
3
|
-
} from "./server-
|
|
3
|
+
} from "./server-f2xf5gcb.js";
|
|
4
4
|
import {
|
|
5
5
|
getSdkWindowGeometry,
|
|
6
6
|
getSdkContextLimit,
|
|
7
7
|
getSdkInputLimit
|
|
8
|
-
} from "./server-
|
|
8
|
+
} from "./server-kn9n2qgd.js";
|
|
9
9
|
import {
|
|
10
10
|
localBudget,
|
|
11
11
|
calibrationForModelKey
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
} from "./server-fr0wbhdn.js";
|
|
4
4
|
import {
|
|
5
5
|
log2
|
|
6
|
-
} from "./server-
|
|
6
|
+
} from "./server-f2xf5gcb.js";
|
|
7
7
|
import {
|
|
8
8
|
ensureColumn,
|
|
9
9
|
healAllNullColumns,
|
|
10
10
|
installV95PerfSchema
|
|
11
|
-
} from "./server-
|
|
11
|
+
} from "./server-pwv4ezb0.js";
|
|
12
12
|
import {
|
|
13
13
|
resolveOpenCodeDbPath,
|
|
14
14
|
openCodeDbPathExists,
|
|
@@ -20,10 +20,10 @@ import {
|
|
|
20
20
|
import {
|
|
21
21
|
normalizeStoredProjectPath,
|
|
22
22
|
storedPathBelongsToIdentity
|
|
23
|
-
} from "./server-
|
|
23
|
+
} from "./server-gvkm8xaj.js";
|
|
24
24
|
import {
|
|
25
25
|
logSlowWriteTransaction
|
|
26
|
-
} from "./server-
|
|
26
|
+
} from "./server-6pmqg9m4.js";
|
|
27
27
|
|
|
28
28
|
// src/features/magic-context/migrations.ts
|
|
29
29
|
import { isMainThread } from "node:worker_threads";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getMagicContextStorageDir,
|
|
3
3
|
log2
|
|
4
|
-
} from "./server-
|
|
4
|
+
} from "./server-f2xf5gcb.js";
|
|
5
5
|
import {
|
|
6
6
|
inRootAsyncContext2
|
|
7
7
|
} from "./server-wafzvyhg.js";
|
|
@@ -15,9 +15,9 @@ import {
|
|
|
15
15
|
// src/features/magic-context/memory/project-identity.ts
|
|
16
16
|
import { execFileSync } from "node:child_process";
|
|
17
17
|
import { createHash as createHash2 } from "node:crypto";
|
|
18
|
-
import { existsSync, realpathSync, statSync } from "node:fs";
|
|
18
|
+
import { existsSync, realpathSync as realpathSync2, statSync as statSync2 } from "node:fs";
|
|
19
19
|
import { homedir } from "node:os";
|
|
20
|
-
import
|
|
20
|
+
import path3 from "node:path";
|
|
21
21
|
|
|
22
22
|
// src/features/magic-context/memory/project-identity-cache.ts
|
|
23
23
|
import { createHash } from "node:crypto";
|
|
@@ -42,6 +42,162 @@ function readRememberedGitIdentity(directory, storageDir) {
|
|
|
42
42
|
return;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
// src/features/magic-context/memory/unborn-head.ts
|
|
46
|
+
import { readFileSync as readFileSync2, realpathSync, statSync } from "node:fs";
|
|
47
|
+
import path2 from "node:path";
|
|
48
|
+
var GIT_LOCATION_ENV_VARS = [
|
|
49
|
+
"GIT_DIR",
|
|
50
|
+
"GIT_COMMON_DIR",
|
|
51
|
+
"GIT_WORK_TREE",
|
|
52
|
+
"GIT_CEILING_DIRECTORIES"
|
|
53
|
+
];
|
|
54
|
+
function errorCode(error) {
|
|
55
|
+
if (error === null || typeof error !== "object" || !("code" in error))
|
|
56
|
+
return;
|
|
57
|
+
const code = error.code;
|
|
58
|
+
return typeof code === "string" ? code : undefined;
|
|
59
|
+
}
|
|
60
|
+
function readText(file) {
|
|
61
|
+
try {
|
|
62
|
+
return { ok: true, text: readFileSync2(file, "utf8") };
|
|
63
|
+
} catch (error) {
|
|
64
|
+
return { ok: false, missing: errorCode(error) === "ENOENT" };
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function entryKind(entry) {
|
|
68
|
+
try {
|
|
69
|
+
const stat = statSync(entry);
|
|
70
|
+
if (stat.isFile())
|
|
71
|
+
return "file";
|
|
72
|
+
if (stat.isDirectory())
|
|
73
|
+
return "directory";
|
|
74
|
+
return "other";
|
|
75
|
+
} catch (error) {
|
|
76
|
+
return errorCode(error) === "ENOENT" ? "missing" : "error";
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
function stripLineEnding(text) {
|
|
80
|
+
return text.replace(/\r?\n$/u, "");
|
|
81
|
+
}
|
|
82
|
+
function resolveMetadataPath(baseDirectory, value) {
|
|
83
|
+
return path2.resolve(baseDirectory, value);
|
|
84
|
+
}
|
|
85
|
+
function isPlainBranchName(name) {
|
|
86
|
+
if (name.length === 0 || name.endsWith("/") || name.endsWith("."))
|
|
87
|
+
return false;
|
|
88
|
+
if (name.includes("..") || name.includes("//") || name.includes("@{"))
|
|
89
|
+
return false;
|
|
90
|
+
for (const character of name) {
|
|
91
|
+
const code = character.charCodeAt(0);
|
|
92
|
+
if (code <= 32 || code === 127 || "~^:?*[\\".includes(character))
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
return name.split("/").every((component) => !component.startsWith(".") && !component.endsWith(".lock"));
|
|
96
|
+
}
|
|
97
|
+
function findGitDirectory(start) {
|
|
98
|
+
let current = start;
|
|
99
|
+
while (true) {
|
|
100
|
+
const dotGit = path2.join(current, ".git");
|
|
101
|
+
const kind = entryKind(dotGit);
|
|
102
|
+
if (kind === "directory")
|
|
103
|
+
return dotGit;
|
|
104
|
+
if (kind === "file") {
|
|
105
|
+
const read = readText(dotGit);
|
|
106
|
+
if (!read.ok)
|
|
107
|
+
return;
|
|
108
|
+
const match = /^gitdir: (.+)$/u.exec(stripLineEnding(read.text));
|
|
109
|
+
if (!match?.[1] || match[1].includes(`
|
|
110
|
+
`))
|
|
111
|
+
return;
|
|
112
|
+
return resolveMetadataPath(current, match[1]);
|
|
113
|
+
}
|
|
114
|
+
if (kind !== "missing")
|
|
115
|
+
return;
|
|
116
|
+
const parent = path2.dirname(current);
|
|
117
|
+
if (parent === current)
|
|
118
|
+
return;
|
|
119
|
+
current = parent;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
function packedRefsList(text, ref) {
|
|
123
|
+
for (const rawLine of text.split(`
|
|
124
|
+
`)) {
|
|
125
|
+
const line = rawLine.replace(/\r$/u, "");
|
|
126
|
+
if (line === "" || line.startsWith("#") || line.startsWith("^"))
|
|
127
|
+
continue;
|
|
128
|
+
const match = /^[0-9a-f]{40,64} (\S+)$/u.exec(line);
|
|
129
|
+
if (!match)
|
|
130
|
+
return;
|
|
131
|
+
if (match[1] === ref)
|
|
132
|
+
return true;
|
|
133
|
+
}
|
|
134
|
+
return false;
|
|
135
|
+
}
|
|
136
|
+
function isUnbornHeadInLayout(directory) {
|
|
137
|
+
const gitDirectory = findGitDirectory(directory);
|
|
138
|
+
if (gitDirectory === undefined)
|
|
139
|
+
return false;
|
|
140
|
+
let commonDirectory = gitDirectory;
|
|
141
|
+
const commondir = readText(path2.join(gitDirectory, "commondir"));
|
|
142
|
+
if (commondir.ok) {
|
|
143
|
+
const value = stripLineEnding(commondir.text);
|
|
144
|
+
if (value === "" || value.includes(`
|
|
145
|
+
`))
|
|
146
|
+
return false;
|
|
147
|
+
commonDirectory = resolveMetadataPath(gitDirectory, value);
|
|
148
|
+
} else if (!commondir.missing) {
|
|
149
|
+
return false;
|
|
150
|
+
}
|
|
151
|
+
if (entryKind(path2.join(gitDirectory, "HEAD")) !== "file")
|
|
152
|
+
return false;
|
|
153
|
+
if (entryKind(path2.join(commonDirectory, "objects")) !== "directory")
|
|
154
|
+
return false;
|
|
155
|
+
if (entryKind(path2.join(commonDirectory, "refs")) !== "directory")
|
|
156
|
+
return false;
|
|
157
|
+
if (entryKind(path2.join(commonDirectory, "reftable")) !== "missing")
|
|
158
|
+
return false;
|
|
159
|
+
const config = readText(path2.join(commonDirectory, "config"));
|
|
160
|
+
if (config.ok) {
|
|
161
|
+
if (/refstorage/iu.test(config.text))
|
|
162
|
+
return false;
|
|
163
|
+
} else if (!config.missing) {
|
|
164
|
+
return false;
|
|
165
|
+
}
|
|
166
|
+
const head = readText(path2.join(gitDirectory, "HEAD"));
|
|
167
|
+
if (!head.ok)
|
|
168
|
+
return false;
|
|
169
|
+
const headMatch = /^ref: (refs\/heads\/(.+))$/u.exec(head.text.replace(/\s+$/u, ""));
|
|
170
|
+
const ref = headMatch?.[1];
|
|
171
|
+
const branch = headMatch?.[2];
|
|
172
|
+
if (!ref || branch === undefined || !isPlainBranchName(branch))
|
|
173
|
+
return false;
|
|
174
|
+
const refSegments = ref.split("/");
|
|
175
|
+
for (const base of new Set([commonDirectory, gitDirectory])) {
|
|
176
|
+
if (entryKind(path2.join(base, ...refSegments)) !== "missing")
|
|
177
|
+
return false;
|
|
178
|
+
}
|
|
179
|
+
const packed = readText(path2.join(commonDirectory, "packed-refs"));
|
|
180
|
+
if (packed.ok) {
|
|
181
|
+
if (packedRefsList(packed.text, ref) !== false)
|
|
182
|
+
return false;
|
|
183
|
+
} else if (!packed.missing) {
|
|
184
|
+
return false;
|
|
185
|
+
}
|
|
186
|
+
return true;
|
|
187
|
+
}
|
|
188
|
+
function isUnbornHeadOnDisk(directory, env = process.env) {
|
|
189
|
+
if (GIT_LOCATION_ENV_VARS.some((name) => env[name] !== undefined && env[name] !== "")) {
|
|
190
|
+
return false;
|
|
191
|
+
}
|
|
192
|
+
let realDirectory;
|
|
193
|
+
try {
|
|
194
|
+
realDirectory = realpathSync.native(path2.resolve(directory));
|
|
195
|
+
} catch {
|
|
196
|
+
return false;
|
|
197
|
+
}
|
|
198
|
+
return isUnbornHeadInLayout(realDirectory);
|
|
199
|
+
}
|
|
200
|
+
|
|
45
201
|
// src/features/magic-context/memory/project-identity.ts
|
|
46
202
|
var GIT_TIMEOUT_MS = 5000;
|
|
47
203
|
var TRANSIENT_FAILURE_COOLDOWN_MS = 5 * 60 * 1000;
|
|
@@ -77,6 +233,7 @@ function shouldSkipHomeProjectMemory(directory) {
|
|
|
77
233
|
}
|
|
78
234
|
}
|
|
79
235
|
var execFileSyncForIdentity = execFileSync;
|
|
236
|
+
var gitTimeoutMs = GIT_TIMEOUT_MS;
|
|
80
237
|
var userHomeDirectoryForIdentity = () => homedir();
|
|
81
238
|
var nowMs = () => Date.now();
|
|
82
239
|
var filesystemProbeObserverForTests;
|
|
@@ -131,7 +288,7 @@ function getErrorStderr(error) {
|
|
|
131
288
|
return "";
|
|
132
289
|
}
|
|
133
290
|
function directoryFallback(directory) {
|
|
134
|
-
const canonical =
|
|
291
|
+
const canonical = path3.resolve(directory);
|
|
135
292
|
const hash = createHash2("md5").update(canonical, "utf8").digest("hex").slice(0, 12);
|
|
136
293
|
return `dir:${hash}`;
|
|
137
294
|
}
|
|
@@ -140,7 +297,7 @@ function rememberedIdentityOrDirectoryFallback(canonical) {
|
|
|
140
297
|
}
|
|
141
298
|
function assertDirectoryUsable(canonicalDirectory, rawDirectory) {
|
|
142
299
|
try {
|
|
143
|
-
const stat =
|
|
300
|
+
const stat = statSync2(canonicalDirectory);
|
|
144
301
|
if (!stat.isDirectory()) {
|
|
145
302
|
throw new ProjectIdentityError("unknown", rawDirectory, `Project path is not a directory: ${canonicalDirectory}`);
|
|
146
303
|
}
|
|
@@ -166,7 +323,7 @@ function hasUnbornHead(directory) {
|
|
|
166
323
|
encoding: "utf8",
|
|
167
324
|
env: { ...process.env, LC_ALL: "C", LANG: "C" },
|
|
168
325
|
stdio: ["ignore", "pipe", "pipe"],
|
|
169
|
-
timeout:
|
|
326
|
+
timeout: gitTimeoutMs,
|
|
170
327
|
windowsHide: true
|
|
171
328
|
};
|
|
172
329
|
try {
|
|
@@ -183,7 +340,7 @@ function hasUnbornHead(directory) {
|
|
|
183
340
|
}
|
|
184
341
|
function classifyGitError(error, rawDirectory) {
|
|
185
342
|
if (isGitTimeoutError(error)) {
|
|
186
|
-
return new ProjectIdentityError("git_timeout", rawDirectory, `git rev-list timed out after ${
|
|
343
|
+
return new ProjectIdentityError("git_timeout", rawDirectory, `git rev-list timed out after ${gitTimeoutMs}ms`, asError(error));
|
|
187
344
|
}
|
|
188
345
|
const code = getErrorCode(error);
|
|
189
346
|
if (code === "ENOENT") {
|
|
@@ -203,7 +360,7 @@ function classifyGitError(error, rawDirectory) {
|
|
|
203
360
|
}
|
|
204
361
|
function resolveProjectIdentityStrict(directory, allowHomeProject = homeProjectPermission, options = {}) {
|
|
205
362
|
assertProjectAllowed(directory, allowHomeProject);
|
|
206
|
-
const canonical =
|
|
363
|
+
const canonical = path3.resolve(directory);
|
|
207
364
|
const cached = options.cache === false ? undefined : identityCache.get(canonical);
|
|
208
365
|
if (cached !== undefined) {
|
|
209
366
|
return cached;
|
|
@@ -212,6 +369,9 @@ function resolveProjectIdentityStrict(directory, allowHomeProject = homeProjectP
|
|
|
212
369
|
if (!hasGitDir(canonical)) {
|
|
213
370
|
throw new ProjectIdentityError("not_git_repo", directory, "Directory has no git metadata; caller may use directory fallback");
|
|
214
371
|
}
|
|
372
|
+
if (isUnbornHeadOnDisk(canonical)) {
|
|
373
|
+
throw new ProjectIdentityError("no_commits", directory, "Git repository has no commits yet");
|
|
374
|
+
}
|
|
215
375
|
let output;
|
|
216
376
|
try {
|
|
217
377
|
output = execFileSyncForIdentity("git", ["rev-list", "--max-parents=0", "HEAD"], {
|
|
@@ -219,7 +379,7 @@ function resolveProjectIdentityStrict(directory, allowHomeProject = homeProjectP
|
|
|
219
379
|
encoding: "utf8",
|
|
220
380
|
env: { ...process.env, LC_ALL: "C", LANG: "C" },
|
|
221
381
|
stdio: ["ignore", "pipe", "pipe"],
|
|
222
|
-
timeout:
|
|
382
|
+
timeout: gitTimeoutMs,
|
|
223
383
|
windowsHide: true
|
|
224
384
|
});
|
|
225
385
|
} catch (error) {
|
|
@@ -272,9 +432,9 @@ function nearestLastKnownGitIdentity(canonical) {
|
|
|
272
432
|
const cached = lastKnownGitIdentity(current);
|
|
273
433
|
if (cached !== undefined)
|
|
274
434
|
return { identity: cached, source: current };
|
|
275
|
-
if (existsSync(
|
|
435
|
+
if (existsSync(path3.join(current, ".git")))
|
|
276
436
|
break;
|
|
277
|
-
const parent =
|
|
437
|
+
const parent = path3.dirname(current);
|
|
278
438
|
if (parent === current)
|
|
279
439
|
break;
|
|
280
440
|
current = parent;
|
|
@@ -285,7 +445,7 @@ function nearestLastKnownGitIdentity(canonical) {
|
|
|
285
445
|
if (exactOrAncestor)
|
|
286
446
|
return exactOrAncestor;
|
|
287
447
|
try {
|
|
288
|
-
const realCanonical =
|
|
448
|
+
const realCanonical = realpathSync2.native(canonical);
|
|
289
449
|
if (realCanonical !== canonical)
|
|
290
450
|
return walk(realCanonical);
|
|
291
451
|
} catch {}
|
|
@@ -313,7 +473,7 @@ function recordDubiousOwnershipFallback(canonical) {
|
|
|
313
473
|
log2(`[magic-context] ${formatDubiousOwnershipWarning(canonical)}`);
|
|
314
474
|
}
|
|
315
475
|
function takeDubiousOwnershipProjectIdentityWarning(directory) {
|
|
316
|
-
const canonical =
|
|
476
|
+
const canonical = path3.resolve(directory);
|
|
317
477
|
if (!dubiousOwnershipFallbackDirectories.has(canonical))
|
|
318
478
|
return null;
|
|
319
479
|
if (dubiousOwnershipWarnedDirectories.has(canonical))
|
|
@@ -324,7 +484,7 @@ function takeDubiousOwnershipProjectIdentityWarning(directory) {
|
|
|
324
484
|
function canonicalUserHomeDirectory() {
|
|
325
485
|
const homeDirectory = userHomeDirectoryForIdentity();
|
|
326
486
|
try {
|
|
327
|
-
return
|
|
487
|
+
return realpathSync2.native(homeDirectory);
|
|
328
488
|
} catch {
|
|
329
489
|
return homeDirectory;
|
|
330
490
|
}
|
|
@@ -333,20 +493,20 @@ function isUserHomeDirectory(directory) {
|
|
|
333
493
|
if (projectDirectoryKey(directory) === projectDirectoryKey(userHomeDirectoryForIdentity()))
|
|
334
494
|
return true;
|
|
335
495
|
try {
|
|
336
|
-
return projectDirectoryKey(
|
|
496
|
+
return projectDirectoryKey(realpathSync2.native(path3.resolve(directory))) === projectDirectoryKey(canonicalUserHomeDirectory());
|
|
337
497
|
} catch {
|
|
338
498
|
return false;
|
|
339
499
|
}
|
|
340
500
|
}
|
|
341
501
|
function assertProjectAllowed(directory, allowHomeProject) {
|
|
342
|
-
const canonical =
|
|
502
|
+
const canonical = path3.resolve(directory);
|
|
343
503
|
if (!allowHomeProject && (isUserHomeDirectory(directory) || isUserHomeDirectory(gitRootDirectory(canonical) ?? canonical))) {
|
|
344
504
|
throw new ProjectIdentityError("home_project_disabled", directory, "Home project memory is disabled; set allow_home_project to opt in");
|
|
345
505
|
}
|
|
346
506
|
}
|
|
347
507
|
function resolveProjectIdentity(directory, allowHomeProject = homeProjectPermission) {
|
|
348
508
|
assertProjectAllowed(directory, allowHomeProject);
|
|
349
|
-
const canonical =
|
|
509
|
+
const canonical = path3.resolve(directory);
|
|
350
510
|
const cachedFallback = directoryFallbackCache.get(canonical);
|
|
351
511
|
if (cachedFallback !== undefined) {
|
|
352
512
|
if (!hasGitDir(canonical)) {
|
|
@@ -394,7 +554,7 @@ function resolveProjectIdentityOrFallback(directory, allowHomeProject = homeProj
|
|
|
394
554
|
try {
|
|
395
555
|
return resolveProjectIdentity(directory, allowHomeProject);
|
|
396
556
|
} catch (error) {
|
|
397
|
-
const canonical =
|
|
557
|
+
const canonical = path3.resolve(directory);
|
|
398
558
|
if (hasGitDir(canonical) || error instanceof ProjectIdentityError && error.errorClass === "home_project_disabled")
|
|
399
559
|
throw error;
|
|
400
560
|
const fallback = rememberedIdentityOrDirectoryFallback(canonical);
|
|
@@ -408,7 +568,7 @@ function hasGitDir(canonical) {
|
|
|
408
568
|
return true;
|
|
409
569
|
}
|
|
410
570
|
try {
|
|
411
|
-
const realCanonical =
|
|
571
|
+
const realCanonical = realpathSync2.native(canonical);
|
|
412
572
|
return realCanonical !== canonical && hasGitDirInAncestorChain(realCanonical);
|
|
413
573
|
} catch {
|
|
414
574
|
return false;
|
|
@@ -417,14 +577,14 @@ function hasGitDir(canonical) {
|
|
|
417
577
|
function gitRootInAncestorChain(startDirectory) {
|
|
418
578
|
let current = startDirectory;
|
|
419
579
|
while (true) {
|
|
420
|
-
if (existsSync(
|
|
580
|
+
if (existsSync(path3.join(current, ".git"))) {
|
|
421
581
|
try {
|
|
422
|
-
return
|
|
582
|
+
return realpathSync2.native(current);
|
|
423
583
|
} catch {
|
|
424
|
-
return
|
|
584
|
+
return path3.resolve(current);
|
|
425
585
|
}
|
|
426
586
|
}
|
|
427
|
-
const parent =
|
|
587
|
+
const parent = path3.dirname(current);
|
|
428
588
|
if (parent === current) {
|
|
429
589
|
return null;
|
|
430
590
|
}
|
|
@@ -439,21 +599,21 @@ function gitRootDirectory(canonical) {
|
|
|
439
599
|
if (direct)
|
|
440
600
|
return direct;
|
|
441
601
|
try {
|
|
442
|
-
const realCanonical =
|
|
602
|
+
const realCanonical = realpathSync2.native(canonical);
|
|
443
603
|
return realCanonical === canonical ? null : gitRootInAncestorChain(realCanonical);
|
|
444
604
|
} catch {
|
|
445
605
|
return null;
|
|
446
606
|
}
|
|
447
607
|
}
|
|
448
608
|
function directoryHasGitMetadata(directory) {
|
|
449
|
-
return gitRootDirectory(
|
|
609
|
+
return gitRootDirectory(path3.resolve(directory)) !== null;
|
|
450
610
|
}
|
|
451
611
|
function describeUnresolvedProjectIdentity(directory) {
|
|
452
|
-
const resolvedDirectory =
|
|
612
|
+
const resolvedDirectory = path3.resolve(directory);
|
|
453
613
|
const canonicalHome = canonicalUserHomeDirectory();
|
|
454
614
|
const canonicalDirectory = (() => {
|
|
455
615
|
try {
|
|
456
|
-
return
|
|
616
|
+
return realpathSync2.native(resolvedDirectory);
|
|
457
617
|
} catch {
|
|
458
618
|
return resolvedDirectory;
|
|
459
619
|
}
|
|
@@ -469,7 +629,7 @@ function isUsableProjectIdentity(identity) {
|
|
|
469
629
|
return typeof identity === "string" && identity.trim().length > 0;
|
|
470
630
|
}
|
|
471
631
|
function resolveProjectIdentityForSession(directory, allowHomeProject = homeProjectPermission) {
|
|
472
|
-
const resolvedDirectory =
|
|
632
|
+
const resolvedDirectory = path3.resolve(directory);
|
|
473
633
|
const cacheKey = `${allowHomeProject ? "1" : "0"}\x00${resolvedDirectory}`;
|
|
474
634
|
const cached = sessionIdentityCache.get(cacheKey);
|
|
475
635
|
if (cached && (cached.revalidateAt === null || nowMs() < cached.revalidateAt) && !(cached.identity?.startsWith("dir:") && hasGitDir(resolvedDirectory))) {
|
|
@@ -480,7 +640,7 @@ function resolveProjectIdentityForSession(directory, allowHomeProject = homeProj
|
|
|
480
640
|
const canonicalDirectory = (() => {
|
|
481
641
|
try {
|
|
482
642
|
filesystemProbeObserverForTests?.();
|
|
483
|
-
return
|
|
643
|
+
return realpathSync2.native(resolvedDirectory);
|
|
484
644
|
} catch {
|
|
485
645
|
return resolvedDirectory;
|
|
486
646
|
}
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
TAG_SELECT_COLUMNS2,
|
|
24
24
|
getCandidateToolOwners2,
|
|
25
25
|
pickNearestPriorOwner2
|
|
26
|
-
} from "./server-
|
|
26
|
+
} from "./server-bxpwy6fy.js";
|
|
27
27
|
import {
|
|
28
28
|
OMO_INTERNAL_INITIATOR_MARKER,
|
|
29
29
|
isSystemDirective,
|
|
@@ -40,18 +40,18 @@ import {
|
|
|
40
40
|
formatBlock,
|
|
41
41
|
compactTextForSummary,
|
|
42
42
|
mergeCommitHashes
|
|
43
|
-
} from "./server-
|
|
43
|
+
} from "./server-0ppsweh6.js";
|
|
44
44
|
import {
|
|
45
45
|
sessionLog2
|
|
46
|
-
} from "./server-
|
|
46
|
+
} from "./server-f2xf5gcb.js";
|
|
47
47
|
import {
|
|
48
48
|
stableStringify
|
|
49
|
-
} from "./server-
|
|
49
|
+
} from "./server-pwv4ezb0.js";
|
|
50
50
|
import {
|
|
51
51
|
renderToolTemplate,
|
|
52
52
|
resolveModelConfigValue,
|
|
53
53
|
deriveDefaultProtectedTokens
|
|
54
|
-
} from "./server-
|
|
54
|
+
} from "./server-th4y11y7.js";
|
|
55
55
|
import {
|
|
56
56
|
readRawSessionMessagesFromDb2,
|
|
57
57
|
readRawSessionMessagePageFromDb2,
|
|
@@ -68,25 +68,25 @@ import {
|
|
|
68
68
|
readRawSeedTailFromDb2,
|
|
69
69
|
readRawSessionBoundaryEndpointsFromDb2,
|
|
70
70
|
prewarmRawSessionOrdinalsForDb
|
|
71
|
-
} from "./server-
|
|
71
|
+
} from "./server-prg55b7k.js";
|
|
72
72
|
import {
|
|
73
73
|
openCodeDbExists,
|
|
74
74
|
withReadOnlySessionDb,
|
|
75
75
|
getRawSessionMessageCountFromDb,
|
|
76
76
|
getMessageTimesFromOpenCodeDb
|
|
77
|
-
} from "./server-
|
|
77
|
+
} from "./server-d8tj10db.js";
|
|
78
78
|
import {
|
|
79
79
|
getToolDefinitionMeasurementSignature,
|
|
80
80
|
getLargestMeasuredToolDefinitionTokens,
|
|
81
81
|
getMeasuredToolDefinitionTokens
|
|
82
|
-
} from "./server-
|
|
82
|
+
} from "./server-zs8d0s3b.js";
|
|
83
83
|
import {
|
|
84
84
|
canonicalModelIdentity,
|
|
85
85
|
piModelRefToCanonical
|
|
86
86
|
} from "./server-avwt563y.js";
|
|
87
87
|
import {
|
|
88
88
|
logSlowWriteTransaction
|
|
89
|
-
} from "./server-
|
|
89
|
+
} from "./server-6pmqg9m4.js";
|
|
90
90
|
|
|
91
91
|
// src/features/magic-context/overflow-detection.ts
|
|
92
92
|
var OVERFLOW_PATTERNS = [
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
removeSystemReminders,
|
|
6
6
|
hasMeaningfulUserText2,
|
|
7
7
|
extractTexts2
|
|
8
|
-
} from "./server-
|
|
8
|
+
} from "./server-0ppsweh6.js";
|
|
9
9
|
import {
|
|
10
10
|
getMagicContextStorageDir
|
|
11
|
-
} from "./server-
|
|
11
|
+
} from "./server-f2xf5gcb.js";
|
|
12
12
|
import {
|
|
13
13
|
withSqliteBackgroundWriter2,
|
|
14
14
|
withoutSqliteTransformPass2
|
|
@@ -20,23 +20,23 @@ import {
|
|
|
20
20
|
tagRevisionKey,
|
|
21
21
|
tagIdentityRevisionKey,
|
|
22
22
|
deleteTagIdentityRevisions
|
|
23
|
-
} from "./server-
|
|
23
|
+
} from "./server-pwv4ezb0.js";
|
|
24
24
|
import {
|
|
25
25
|
cleanUserText2
|
|
26
|
-
} from "./server-
|
|
26
|
+
} from "./server-m97brnat.js";
|
|
27
27
|
import {
|
|
28
28
|
recordMessageFtsRowid,
|
|
29
29
|
recordIndexedMessageTime,
|
|
30
30
|
messageFtsOrdinalRangeIsMapped,
|
|
31
31
|
deleteUnmappedMessageFtsRows
|
|
32
|
-
} from "./server-
|
|
32
|
+
} from "./server-yrvqaswb.js";
|
|
33
33
|
import {
|
|
34
34
|
isPidAlive,
|
|
35
35
|
readProcessStartTime
|
|
36
|
-
} from "./server-
|
|
36
|
+
} from "./server-da07v4xp.js";
|
|
37
37
|
import {
|
|
38
38
|
deleteChunkEmbedBackoffForSession
|
|
39
|
-
} from "./server-
|
|
39
|
+
} from "./server-vknbt0gq.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-6pmqg9m4.js";
|
|
53
53
|
|
|
54
54
|
// src/shared/bounded-session-map.ts
|
|
55
55
|
class BoundedSessionMap {
|