@cortexkit/opencode-magic-context 0.49.48 → 0.49.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{announcement-g789dmt6.js → announcement-9pr71hd5.js} +3 -2
- package/dist/auto-search-worker.js +5 -5
- package/dist/chunk-embedding-write-worker.js +14 -15
- package/dist/{compaction-marker-candidates-dkfp1q9j.js → compaction-marker-candidates-8hazqfvj.js} +2 -3
- package/dist/compaction-marker-candidates-worker.js +1 -1
- package/dist/{compartment-chunk-embedding-snj51nmg.js → compartment-chunk-embedding-gfd093f8.js} +7 -8
- package/dist/config/project-security.d.ts.map +1 -1
- package/dist/config/schema/magic-context.d.ts +10 -0
- package/dist/config/schema/magic-context.d.ts.map +1 -1
- package/dist/{conflict-warning-hook-w1aw6w5t.js → conflict-warning-hook-56qpq7ws.js} +7 -8
- package/dist/{context-8r125qv3.js → context-4js5qnnm.js} +61 -49
- package/dist/{derive-budgets-nkw09vq7.js → derive-budgets-z53424qx.js} +2 -3
- package/dist/embedding-backfill-3wdjzrvs.js +27 -0
- package/dist/embedding-worker-process.js +2 -3
- package/dist/embedding-worker.js +6 -7
- package/dist/features/magic-context/dreamer/docs-proposals.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/provider-output-failure.d.ts +5 -7
- package/dist/features/magic-context/dreamer/provider-output-failure.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-scheduler.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/verify.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-identity.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-openai.d.ts +4 -0
- package/dist/features/magic-context/memory/embedding-openai.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-probe.d.ts +10 -0
- package/dist/features/magic-context/memory/embedding-probe.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding.d.ts.map +1 -1
- package/dist/features/magic-context/project-embedding-registry.d.ts.map +1 -1
- package/dist/features/magic-context/storage-db.d.ts +14 -0
- package/dist/features/magic-context/storage-db.d.ts.map +1 -1
- package/dist/features/magic-context/transform-decision-log.d.ts +2 -0
- package/dist/features/magic-context/transform-decision-log.d.ts.map +1 -1
- package/dist/{history-owner-0z620wgz.js → history-owner-n50e0e8y.js} +2 -3
- package/dist/hooks/magic-context/compartment-runner-historian.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-incremental.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-trigger.d.ts.map +1 -1
- package/dist/hooks/magic-context/protected-tail-boundary.d.ts +5 -3
- package/dist/hooks/magic-context/protected-tail-boundary.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-compartment-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/{index-rvmhyk89.js → index-07rp6xcn.js} +9 -9
- package/dist/{index-txs8tce6.js → index-0k283v27.js} +2 -4
- package/dist/{index-ak11t3gm.js → index-0tz2fzpq.js} +1 -1
- package/dist/{index-2qbtqg1w.js → index-25tm250q.js} +1 -1
- package/dist/{index-h9m41624.js → index-2ny9xwdn.js} +2 -2
- package/dist/{index-xa9mmq6c.js → index-36wseasx.js} +1 -1
- package/dist/{index-cgzpbz78.js → index-5dptmnvd.js} +5 -5
- package/dist/{index-q41sm60t.js → index-5g6npyw5.js} +89 -63
- package/dist/{index-qsyx931k.js → index-5t1mr0bt.js} +13 -15
- package/dist/{index-jrfre9ah.js → index-82dfe8en.js} +146 -5
- package/dist/{index-d4qw2h43.js → index-8d7gkgjs.js} +6 -5
- package/dist/{index-gn6gfz4y.js → index-90z05d0p.js} +1 -1
- package/dist/{index-trkxkgmd.js → index-97bjd14c.js} +5 -5
- package/dist/{index-9wnbnx8f.js → index-a6aqpfp6.js} +1 -1
- package/dist/{index-s79g172v.js → index-bamnjp2t.js} +29 -13
- package/dist/{index-4wpfbzks.js → index-bkg4hdyh.js} +3 -3
- package/dist/{index-gp3kcpc4.js → index-cd3vp8xa.js} +1 -1
- package/dist/{index-vk6srk5r.js → index-ct3ettqt.js} +3 -3
- package/dist/{index-sd2s4t4p.js → index-cwj6qhmf.js} +2 -2
- package/dist/{index-brj6was5.js → index-em92bp7f.js} +2 -2
- package/dist/{index-2p37txes.js → index-ga5q492k.js} +1 -1
- package/dist/{index-8cfnaagj.js → index-gapnh6tk.js} +2 -4
- package/dist/{index-fw42ms3m.js → index-gz001bx7.js} +1 -1
- package/dist/{index-zetm0ayn.js → index-h8g08nxs.js} +164 -106
- package/dist/{index-qcz1fy7h.js → index-hexdee98.js} +4 -4
- package/dist/{index-fgft4qjn.js → index-hkveze74.js} +4 -4
- package/dist/{index-smtbdmc3.js → index-hsv31e69.js} +2 -2
- package/dist/{index-dj2p8653.js → index-hsyczpn7.js} +2 -2
- package/dist/{index-4dpvnp8k.js → index-jjy5a5w0.js} +3 -0
- package/dist/{index-1hwn96x1.js → index-kn1bx21r.js} +3 -3
- package/dist/{index-t6s0tsp7.js → index-mjh63zvw.js} +3 -3
- package/dist/{index-ta87fpfs.js → index-n0twfvah.js} +64 -15
- package/dist/{index-nj360hcs.js → index-pb8ysnq2.js} +4 -4
- package/dist/{index-jz5bk7xd.js → index-qperbvjn.js} +2 -2
- package/dist/{index-25ka1jza.js → index-r9agn061.js} +4 -4
- package/dist/{index-hkh8x221.js → index-rbs27k1d.js} +7 -7
- package/dist/{index-hacf2tyx.js → index-reyws9fy.js} +1 -1
- package/dist/{index-cgsmttyj.js → index-s131svmx.js} +4 -4
- package/dist/{index-fxbk7gk3.js → index-tad3can2.js} +1 -1
- package/dist/{index-8ka0ne8t.js → index-v4a1pnny.js} +6 -6
- package/dist/{index-xh3jyejb.js → index-wr2t8zb0.js} +17 -19
- package/dist/{index-q6pjqm49.js → index-z4832qfe.js} +14 -14
- package/dist/index.js +54 -56
- package/dist/{logger-qwnbcfj9.js → logger-sw7z6sjz.js} +1 -2
- package/dist/{message-fts-rowid-map-msffhkve.js → message-fts-rowid-map-kx1bsdyg.js} +4 -5
- package/dist/{message-index-bounded-0q7sy04w.js → message-index-bounded-k0ebpy3y.js} +12 -13
- package/dist/{message-time-backfill-39bm498k.js → message-time-backfill-hp2jgn49.js} +2 -3
- package/dist/migration-worker.js +12 -13
- package/dist/plugin/embedding-bootstrap-helpers.d.ts.map +1 -1
- package/dist/plugin/embedding-routing.d.ts.map +1 -1
- package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
- package/dist/plugin/rpc-handlers.d.ts.map +1 -1
- package/dist/{project-embedding-registry-r6xfsrbe.js → project-embedding-registry-5dwh5zfn.js} +12 -13
- package/dist/raw-ordinal-warmup-worker.js +8 -8
- package/dist/{read-session-chunk-7fmg9p5m.js → read-session-chunk-6712p893.js} +10 -11
- package/dist/{read-session-raw-x7a9b3jm.js → read-session-raw-04ger9zt.js} +2 -3
- package/dist/{recomp-orchestrator-jqa5z4ar.js → recomp-orchestrator-8ebydg5j.js} +31 -32
- package/dist/render-dtc4qkq4.js +43 -0
- package/dist/{safe-notification-target-wztd7bgk.js → safe-notification-target-mx5khyxf.js} +2 -3
- package/dist/{search-archive-df09r8qn.js → search-archive-f6hjbnsa.js} +12 -13
- package/dist/{search-kt764afk.js → search-edv0gy1d.js} +24 -25
- package/dist/{send-session-notification-j93pn2hn.js → send-session-notification-gamjee2f.js} +5 -6
- package/dist/shared/data-path.d.ts +7 -13
- package/dist/shared/data-path.d.ts.map +1 -1
- package/dist/shared/hidden-model-cooldown.d.ts +23 -0
- package/dist/shared/hidden-model-cooldown.d.ts.map +1 -0
- package/dist/shared/model-suggestion-retry.d.ts +0 -2
- package/dist/shared/model-suggestion-retry.d.ts.map +1 -1
- package/dist/shared/provider-response-completion.d.ts +10 -0
- package/dist/shared/provider-response-completion.d.ts.map +1 -1
- package/dist/shared/rpc-types.d.ts +1 -0
- package/dist/shared/rpc-types.d.ts.map +1 -1
- package/dist/shared/status-summary.d.ts +1 -0
- package/dist/shared/status-summary.d.ts.map +1 -1
- package/dist/shared/status-view-check.d.ts.map +1 -1
- package/dist/shared/status-view.d.ts +1 -0
- package/dist/shared/status-view.d.ts.map +1 -1
- package/dist/shared/test-db.d.ts +13 -0
- package/dist/shared/test-db.d.ts.map +1 -0
- package/dist/{storage-tags-96vyd6ra.js → storage-tags-kdb4qsyq.js} +4 -5
- package/dist/test-preload.d.ts +2 -0
- package/dist/test-preload.d.ts.map +1 -0
- package/dist/{transform-postprocess-phase-a7ety10n.js → transform-postprocess-phase-1bg25094.js} +32 -33
- package/dist/v2/auto-search-worker.js +5 -5
- package/dist/v2/chunk-embedding-write-worker.js +14 -14
- package/dist/v2/{compaction-marker-candidates-y737qb1v.js → compaction-marker-candidates-re14353a.js} +2 -2
- package/dist/v2/compaction-marker-candidates-worker.js +1 -1
- package/dist/v2/{compartment-chunk-embedding-nj5nrnbj.js → compartment-chunk-embedding-0pxsrzrt.js} +7 -7
- package/dist/v2/{context-9x7mnb7x.js → context-qkr7z6d0.js} +99 -63
- package/dist/v2/{derive-budgets-b5cgrtp8.js → derive-budgets-w0815q82.js} +3 -3
- package/dist/v2/embedding-backfill-x1zpc04f.js +27 -0
- package/dist/v2/embedding-worker-process.js +1 -1
- package/dist/v2/embedding-worker.js +5 -5
- package/dist/v2/hidden-completion.d.ts.map +1 -1
- package/dist/v2/{history-owner-fpka43cn.js → history-owner-ep91wgqj.js} +2 -2
- package/dist/v2/hooks/context.d.ts.map +1 -1
- package/dist/v2/hooks/usage-persist.d.ts +1 -1
- package/dist/v2/hooks/usage-persist.d.ts.map +1 -1
- package/dist/v2/hooks/usage-reading.d.ts +3 -0
- package/dist/v2/hooks/usage-reading.d.ts.map +1 -1
- package/dist/v2/{logger-4cj6d03m.js → logger-xnscpj6w.js} +1 -1
- package/dist/v2/{message-fts-rowid-map-qe7cpksd.js → message-fts-rowid-map-57jh6xpb.js} +4 -4
- package/dist/v2/{message-index-bounded-hctgp22r.js → message-index-bounded-a36rw93p.js} +12 -12
- package/dist/v2/{message-time-backfill-0c4h7sg6.js → message-time-backfill-baxebka0.js} +2 -2
- package/dist/v2/migration-worker.js +11 -11
- package/dist/v2/{project-embedding-registry-ek0cy0d5.js → project-embedding-registry-v2fxrs8b.js} +12 -12
- package/dist/v2/raw-ordinal-warmup-worker.js +8 -8
- package/dist/v2/{read-session-chunk-zknadvjr.js → read-session-chunk-hzhxvhyv.js} +10 -10
- package/dist/v2/{read-session-raw-yss2ev98.js → read-session-raw-3e482h3c.js} +2 -2
- package/dist/v2/{recomp-orchestrator-m5w0eqke.js → recomp-orchestrator-yzr49pd0.js} +32 -32
- package/dist/v2/{render-89asy54r.js → render-rhaevxv1.js} +21 -21
- package/dist/v2/{safe-notification-target-gphhast7.js → safe-notification-target-9r79xnbt.js} +2 -2
- package/dist/v2/{search-archive-axz2gbdb.js → search-archive-9924fyk8.js} +12 -12
- package/dist/v2/{search-kdtja5rx.js → search-ggvexvv7.js} +23 -23
- package/dist/v2/{send-session-notification-na3q825m.js → send-session-notification-95p89k7q.js} +5 -5
- package/dist/v2/{server-yyqmvbvv.js → server-016a1whm.js} +161 -102
- package/dist/v2/{server-z3tyd1mx.js → server-0k586y7d.js} +3 -3
- package/dist/v2/{server-p9s40wfa.js → server-0ms13pc8.js} +3 -0
- package/dist/v2/{server-e3m10ds0.js → server-16kfxcxj.js} +4 -4
- package/dist/v2/{server-nn4hbymt.js → server-3bfc26r7.js} +9 -9
- package/dist/v2/{server-7vb38e51.js → server-3jc6qmdz.js} +1 -1
- package/dist/v2/{server-jra7awr5.js → server-3qf9n5ck.js} +11 -11
- package/dist/v2/{server-69m30b21.js → server-3yk44ddz.js} +1 -1
- package/dist/v2/{server-2gjqhmn9.js → server-4h4acntc.js} +27 -11
- package/dist/v2/{server-3schkz95.js → server-58h6rrnx.js} +4 -4
- package/dist/v2/{server-af1rmkyn.js → server-5kgesxck.js} +2 -2
- package/dist/v2/{server-mfn1yf9d.js → server-7vrtk78d.js} +1 -1
- package/dist/v2/{server-27kccwe7.js → server-88yvx6r9.js} +63 -12
- package/dist/v2/{server-f0j864ma.js → server-91gb0vh8.js} +1 -1
- package/dist/v2/{server-131h608x.js → server-966dq3pd.js} +2 -2
- package/dist/v2/{server-jb6tjyeb.js → server-bb6kf05j.js} +23 -20
- package/dist/v2/{server-sg2qjkrb.js → server-brsx45r6.js} +6 -4
- package/dist/v2/{server-gwxys0d0.js → server-c8z2grq0.js} +1 -1
- package/dist/v2/{server-y8n33d9j.js → server-g61hgy1y.js} +4 -4
- package/dist/v2/{server-zahgxer8.js → server-jxrqsn84.js} +3 -3
- package/dist/v2/{server-2j87594q.js → server-kgq2e2hh.js} +2 -2
- package/dist/v2/{server-ddw42d76.js → server-mxsy9h1d.js} +2 -2
- package/dist/v2/{server-qmmkhz2z.js → server-np27dgyt.js} +1 -1
- package/dist/v2/{server-jqn7q7tm.js → server-q93jdtz8.js} +5 -5
- package/dist/v2/{server-dcws5831.js → server-qp5sj6n5.js} +2 -2
- package/dist/v2/{server-7be0ersd.js → server-rcchadw0.js} +3 -3
- package/dist/v2/{server-b3r080cm.js → server-rz5jnhnv.js} +1 -1
- package/dist/v2/{server-zt1m5rwj.js → server-sa1fdt41.js} +1 -1
- package/dist/v2/{server-wa4qhryh.js → server-sb55ddgn.js} +5 -4
- package/dist/v2/{server-4x7n5qz7.js → server-scp3y4dh.js} +13 -11
- package/dist/v2/{server-pej5rnye.js → server-sgn61hht.js} +2 -2
- package/dist/v2/{server-ypf1ap0v.js → server-t8n27rbt.js} +1 -1
- package/dist/v2/{server-sefxj8k1.js → server-tmf0ayqp.js} +1 -1
- package/dist/v2/{server-sr8tf5dt.js → server-vjadwb3j.js} +6 -5
- package/dist/v2/{server-bez34e60.js → server-vqq3g1t7.js} +4 -4
- package/dist/v2/{server-tpt7bwq8.js → server-ww7xbxxf.js} +1 -1
- package/dist/v2/server.js +6 -6
- package/dist/v2/{storage-tags-xq8hjqkf.js → storage-tags-rzv7y0n3.js} +4 -4
- package/dist/v2/{v2-archive-reader-ky1wqcws.js → v2-archive-reader-5ggewg8q.js} +1 -1
- package/dist/v2/{wrapup-orchestrator-6wt67saz.js → wrapup-orchestrator-36c5wyvq.js} +32 -32
- package/dist/{v2-archive-reader-665x2x4d.js → v2-archive-reader-gx5ke1d7.js} +1 -1
- package/dist/wrapup-orchestrator-ya31knav.js +55 -0
- package/package.json +1 -1
- package/src/config/index.test.ts +20 -0
- package/src/config/project-security.test.ts +5 -1
- package/src/config/project-security.ts +4 -0
- package/src/config/schema/magic-context.test.ts +43 -0
- package/src/config/schema/magic-context.ts +19 -0
- package/src/shared/data-path.test.ts +104 -56
- package/src/shared/data-path.ts +30 -30
- package/src/shared/hidden-model-cooldown.test.ts +117 -0
- package/src/shared/hidden-model-cooldown.ts +123 -0
- package/src/shared/model-suggestion-retry.test.ts +53 -76
- package/src/shared/model-suggestion-retry.ts +38 -53
- package/src/shared/provider-response-completion.test.ts +49 -0
- package/src/shared/provider-response-completion.ts +64 -0
- package/src/shared/rpc-types.ts +1 -0
- package/src/shared/startup-maintenance-policy.test.ts +115 -0
- package/src/shared/status-detail-text.test.ts +7 -0
- package/src/shared/status-summary.ts +3 -0
- package/src/shared/status-view-check.ts +1 -0
- package/src/shared/status-view.test.ts +15 -0
- package/src/shared/status-view.ts +11 -1
- package/src/shared/test-db.test.ts +84 -0
- package/src/shared/test-db.ts +36 -0
- package/dist/embedding-backfill-kpy5shsa.js +0 -28
- package/dist/index-g2q4htwp.js +0 -146
- package/dist/render-mnqc74ar.js +0 -44
- package/dist/v2/embedding-backfill-360efh1t.js +0 -27
- package/dist/wrapup-orchestrator-7kmb3jf9.js +0 -56
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { afterEach, expect, spyOn, test } from "bun:test";
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
import { join, resolve } from "node:path";
|
|
4
|
+
import ts from "typescript";
|
|
5
|
+
import * as messageTime from "../features/magic-context/message-time-backfill";
|
|
6
|
+
import {
|
|
7
|
+
__getDatabaseStartupStateForTests,
|
|
8
|
+
__setScheduleStartupMaintenanceOnOpenForTests,
|
|
9
|
+
__waitForDatabaseStartupForTests,
|
|
10
|
+
closeDatabase,
|
|
11
|
+
getPersistedSchemaVersion,
|
|
12
|
+
LATEST_SUPPORTED_VERSION,
|
|
13
|
+
openDatabase,
|
|
14
|
+
openDatabaseAsync,
|
|
15
|
+
} from "../features/magic-context/storage-db";
|
|
16
|
+
import * as warmup from "../hooks/magic-context/raw-ordinal-warmup";
|
|
17
|
+
import { createTestTempDir } from "./test-temp-dir";
|
|
18
|
+
|
|
19
|
+
const root = resolve(import.meta.dir, "../../../..");
|
|
20
|
+
const originalDataHome = process.env.XDG_DATA_HOME;
|
|
21
|
+
|
|
22
|
+
afterEach(async () => {
|
|
23
|
+
await closeDatabase();
|
|
24
|
+
if (originalDataHome === undefined) delete process.env.XDG_DATA_HOME;
|
|
25
|
+
else process.env.XDG_DATA_HOME = originalDataHome;
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
function preloads(packageName: string): string[] {
|
|
29
|
+
return Bun.TOML.parse(readFileSync(join(root, "packages", packageName, "bunfig.toml"), "utf8"))
|
|
30
|
+
.test.preload as string[];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
test.each([
|
|
34
|
+
"plugin",
|
|
35
|
+
"pi-plugin",
|
|
36
|
+
])("%s unit preload preserves isolation and disables startup maintenance", (packageName) => {
|
|
37
|
+
expect(preloads(packageName)).toEqual(["./src/test-preload.ts"]);
|
|
38
|
+
const path = join(root, "packages", packageName, "src/test-preload.ts");
|
|
39
|
+
const source = ts.createSourceFile(
|
|
40
|
+
path,
|
|
41
|
+
readFileSync(path, "utf8"),
|
|
42
|
+
ts.ScriptTarget.Latest,
|
|
43
|
+
true,
|
|
44
|
+
);
|
|
45
|
+
const statements = source.statements.map((statement) => statement.getText(source));
|
|
46
|
+
// Inspect statements, not comments: a commented-out policy must fail this guard.
|
|
47
|
+
expect(statements[0]).toBe(
|
|
48
|
+
'await import(new URL("../test-preload.ts", import.meta.url).href);',
|
|
49
|
+
);
|
|
50
|
+
expect(statements.at(-1)).toBe("__setScheduleStartupMaintenanceOnOpenForTests(false);");
|
|
51
|
+
const storageModule =
|
|
52
|
+
packageName === "plugin"
|
|
53
|
+
? "./features/magic-context/storage-db"
|
|
54
|
+
: "@magic-context/core/features/magic-context/storage-db";
|
|
55
|
+
expect(statements[1]).toMatch(
|
|
56
|
+
new RegExp(
|
|
57
|
+
`const \\{ __setScheduleStartupMaintenanceOnOpenForTests \\} = await import\\(\\s*"${storageModule}"\\s*\\);`,
|
|
58
|
+
),
|
|
59
|
+
);
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
test("CLI uses the unit policy while end-to-end tests retain the shared isolation-only preload", () => {
|
|
63
|
+
expect(preloads("cli")).toEqual(["../plugin/src/test-preload.ts"]);
|
|
64
|
+
expect(preloads("e2e-tests")).toEqual(["../plugin/test-preload.ts"]);
|
|
65
|
+
const isolation = readFileSync(join(root, "packages/plugin/test-preload.ts"), "utf8");
|
|
66
|
+
expect(isolation).not.toContain("__setScheduleStartupMaintenanceOnOpenForTests");
|
|
67
|
+
expect(isolation).not.toContain("src/test-preload");
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
test.each([
|
|
71
|
+
"sync",
|
|
72
|
+
"async",
|
|
73
|
+
] as const)("default unit %s open schedules no startup job, but an opted-in open does", async (mode) => {
|
|
74
|
+
process.env.XDG_DATA_HOME = createTestTempDir("mc-startup-policy-").dir;
|
|
75
|
+
const worker = spyOn(warmup, "runSessionWarmupWorker").mockResolvedValue({
|
|
76
|
+
ftsRowidBackfill: true,
|
|
77
|
+
});
|
|
78
|
+
const time = spyOn(messageTime, "startMessageTimeBackfill").mockResolvedValue();
|
|
79
|
+
const open = () => (mode === "sync" ? openDatabase() : openDatabaseAsync());
|
|
80
|
+
try {
|
|
81
|
+
const db = (await open())!;
|
|
82
|
+
expect(db).not.toBeNull();
|
|
83
|
+
expect(getPersistedSchemaVersion(db)).toBe(LATEST_SUPPORTED_VERSION);
|
|
84
|
+
expect(__getDatabaseStartupStateForTests(db)).toEqual({
|
|
85
|
+
timerScheduled: false,
|
|
86
|
+
running: null,
|
|
87
|
+
});
|
|
88
|
+
await new Promise<void>((resolve) => setTimeout(resolve, 0));
|
|
89
|
+
expect(worker).not.toHaveBeenCalled();
|
|
90
|
+
expect(time).not.toHaveBeenCalled();
|
|
91
|
+
await closeDatabase();
|
|
92
|
+
|
|
93
|
+
const previous = __setScheduleStartupMaintenanceOnOpenForTests(true);
|
|
94
|
+
try {
|
|
95
|
+
const optedIn = (await open())!;
|
|
96
|
+
expect(__getDatabaseStartupStateForTests(optedIn)).toEqual({
|
|
97
|
+
timerScheduled: true,
|
|
98
|
+
running: null,
|
|
99
|
+
});
|
|
100
|
+
await __waitForDatabaseStartupForTests(optedIn);
|
|
101
|
+
expect(__getDatabaseStartupStateForTests(optedIn)).toEqual({
|
|
102
|
+
timerScheduled: false,
|
|
103
|
+
running: expect.any(Promise),
|
|
104
|
+
});
|
|
105
|
+
expect(worker).toHaveBeenCalledTimes(1);
|
|
106
|
+
expect(time).toHaveBeenCalledTimes(1);
|
|
107
|
+
} finally {
|
|
108
|
+
__setScheduleStartupMaintenanceOnOpenForTests(previous);
|
|
109
|
+
}
|
|
110
|
+
} finally {
|
|
111
|
+
await closeDatabase();
|
|
112
|
+
worker.mockRestore();
|
|
113
|
+
time.mockRestore();
|
|
114
|
+
}
|
|
115
|
+
});
|
|
@@ -165,6 +165,13 @@ describe("status detail text", () => {
|
|
|
165
165
|
expect(summary).not.toContain("manifest missing");
|
|
166
166
|
});
|
|
167
167
|
|
|
168
|
+
test("shows live hidden-model quota skips in chat-only status", () => {
|
|
169
|
+
const value = "google/primary until 2026-10-10T04:46:40.000Z: provider said to retry later";
|
|
170
|
+
expect(
|
|
171
|
+
formatStatusDetailMarkdown({ ...STATUS_FIXTURE, hiddenModelSkips: [value] }),
|
|
172
|
+
).toContain(value);
|
|
173
|
+
});
|
|
174
|
+
|
|
168
175
|
test("keeps internal vocabulary and identifiers out of the summary", () => {
|
|
169
176
|
const summary = formatStatusDetailMarkdown({
|
|
170
177
|
...STATUS_FIXTURE,
|
|
@@ -39,6 +39,7 @@ export interface UserStatusSummary {
|
|
|
39
39
|
hiddenVariantWarnings?: string[];
|
|
40
40
|
dreamerSkipped?: readonly string[];
|
|
41
41
|
dreamerQuotas?: readonly string[];
|
|
42
|
+
hiddenModelSkips?: readonly string[];
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
/**
|
|
@@ -131,6 +132,7 @@ export function statusSummaryFromDetail(detail: StatusDetail): UserStatusSummary
|
|
|
131
132
|
warnings: statusWarningsFromDetail(detail),
|
|
132
133
|
hiddenVariantWarnings: detail.hiddenVariantWarnings ?? [],
|
|
133
134
|
dreamerSkipped: detail.dreamerSkipped,
|
|
135
|
+
hiddenModelSkips: detail.hiddenModelSkips,
|
|
134
136
|
dreamerQuotas: [
|
|
135
137
|
...new Set(
|
|
136
138
|
(detail.dreamerFailures ?? []).flatMap((failure) => {
|
|
@@ -232,6 +234,7 @@ export function renderUserStatusSummary(
|
|
|
232
234
|
}
|
|
233
235
|
for (const skipped of summary.dreamerSkipped ?? []) values.push(["Dreamer skipped", skipped]);
|
|
234
236
|
for (const quota of summary.dreamerQuotas ?? []) values.push(["Dreamer quota", quota]);
|
|
237
|
+
for (const quota of summary.hiddenModelSkips ?? []) values.push(["Hidden model quota", quota]);
|
|
235
238
|
if (summary.historianRefusal) {
|
|
236
239
|
values.push([
|
|
237
240
|
"Historian refusal",
|
|
@@ -312,6 +312,7 @@ export function checkStatusViewSource(candidate: unknown):
|
|
|
312
312
|
lastDreamerRunAt: optional.read("lastDreamerRunAt", isNullableNumber),
|
|
313
313
|
dreamerUnsupportedTasks: optional.readArray("dreamerUnsupportedTasks", isString),
|
|
314
314
|
dreamerSkipped: optional.readArray("dreamerSkipped", isString),
|
|
315
|
+
hiddenModelSkips: optional.readArray("hiddenModelSkips", isString),
|
|
315
316
|
dreamerFailures: optional.readArray(
|
|
316
317
|
"dreamerFailures",
|
|
317
318
|
(value): value is { task: string; error: string } =>
|
|
@@ -403,6 +403,21 @@ describe("status view model", () => {
|
|
|
403
403
|
* (issue 496).
|
|
404
404
|
*/
|
|
405
405
|
describe("blocked background maintenance", () => {
|
|
406
|
+
test("shows live hidden-model quota skips beside background failures", () => {
|
|
407
|
+
const value =
|
|
408
|
+
"google/primary until 2026-10-10T04:46:40.000Z: provider said to retry later";
|
|
409
|
+
for (const compactionEnabled of [true, false]) {
|
|
410
|
+
const rows = view({
|
|
411
|
+
hiddenModelSkips: [value],
|
|
412
|
+
compactionEnabled,
|
|
413
|
+
}).sections.flatMap((section) => section.rows);
|
|
414
|
+
expect(rows.find((row) => row.label === "Hidden model quota")).toMatchObject({
|
|
415
|
+
value,
|
|
416
|
+
tone: "warning",
|
|
417
|
+
});
|
|
418
|
+
}
|
|
419
|
+
});
|
|
420
|
+
|
|
406
421
|
test("shows a scheduled task's primary quota deadline in the status dialog", () => {
|
|
407
422
|
const error =
|
|
408
423
|
"primary quota exhausted until 2026-10-08T03:40:04.275Z; account=private@example.com";
|
|
@@ -159,6 +159,7 @@ export interface StatusViewSource {
|
|
|
159
159
|
*/
|
|
160
160
|
readonly dreamerTickFailure?: DreamerTickFailure | null;
|
|
161
161
|
readonly dreamerFailures?: readonly { task: string; error: string }[];
|
|
162
|
+
readonly hiddenModelSkips?: readonly string[];
|
|
162
163
|
readonly memoryCount: number;
|
|
163
164
|
readonly sessionNoteCount?: number;
|
|
164
165
|
readonly readySmartNoteCount?: number;
|
|
@@ -529,7 +530,7 @@ function dreamerUnsupportedRows(source: StatusViewSource): StatusRow[] {
|
|
|
529
530
|
|
|
530
531
|
/** One row naming the stage that stopped the last maintenance pass, if one did. */
|
|
531
532
|
function dreamerTickFailureRows(source: StatusViewSource, now: number): StatusRow[] {
|
|
532
|
-
const quotas = [
|
|
533
|
+
const quotas: StatusRow[] = [
|
|
533
534
|
...new Set(
|
|
534
535
|
(source.dreamerFailures ?? []).flatMap((failure) => {
|
|
535
536
|
const quota = primaryQuotaDiagnostic(failure.error);
|
|
@@ -537,6 +538,15 @@ function dreamerTickFailureRows(source: StatusViewSource, now: number): StatusRo
|
|
|
537
538
|
}),
|
|
538
539
|
),
|
|
539
540
|
].map((value): StatusRow => ({ label: "Dreamer quota", value, tone: "warning" }));
|
|
541
|
+
quotas.push(
|
|
542
|
+
...(source.hiddenModelSkips ?? []).map(
|
|
543
|
+
(value): StatusRow => ({
|
|
544
|
+
label: "Hidden model quota",
|
|
545
|
+
value,
|
|
546
|
+
tone: "warning",
|
|
547
|
+
}),
|
|
548
|
+
),
|
|
549
|
+
);
|
|
540
550
|
const failure = source.dreamerTickFailure;
|
|
541
551
|
if (!failure) return quotas;
|
|
542
552
|
return [
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { afterEach, expect, spyOn, test } from "bun:test";
|
|
2
|
+
import { tmpdir } from "node:os";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import * as messageTime from "../features/magic-context/message-time-backfill";
|
|
5
|
+
import {
|
|
6
|
+
__getDatabaseStartupStateForTests,
|
|
7
|
+
closeDatabase,
|
|
8
|
+
getDatabasePath,
|
|
9
|
+
openDatabase,
|
|
10
|
+
} from "../features/magic-context/storage-db";
|
|
11
|
+
import * as warmup from "../hooks/magic-context/raw-ordinal-warmup";
|
|
12
|
+
import { setHarness } from "./harness";
|
|
13
|
+
import { openTestDatabase, openTestDb } from "./test-db";
|
|
14
|
+
import { createTestTempDirFromPath } from "./test-temp-dir";
|
|
15
|
+
|
|
16
|
+
const originalHome = process.env.XDG_DATA_HOME;
|
|
17
|
+
afterEach(async () => {
|
|
18
|
+
await closeDatabase();
|
|
19
|
+
if (originalHome === undefined) delete process.env.XDG_DATA_HOME;
|
|
20
|
+
else process.env.XDG_DATA_HOME = originalHome;
|
|
21
|
+
setHarness("opencode");
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
test("transform fixture opener opts into and joins both startup writers before returning the serving handle", async () => {
|
|
25
|
+
process.env.XDG_DATA_HOME = createTestTempDirFromPath(join(tmpdir(), "mc-startup-barrier-"));
|
|
26
|
+
setHarness("opencode");
|
|
27
|
+
const ftsStarted = Promise.withResolvers<void>();
|
|
28
|
+
const releaseFts = Promise.withResolvers<void>();
|
|
29
|
+
const timeStarted = Promise.withResolvers<void>();
|
|
30
|
+
const releaseTime = Promise.withResolvers<void>();
|
|
31
|
+
let blocker: ReturnType<typeof openTestDb> | undefined;
|
|
32
|
+
const fts = spyOn(warmup, "runSessionWarmupWorker").mockImplementation(async (input) => {
|
|
33
|
+
if (!input.ftsRowidBackfill) throw new Error("Unexpected startup job");
|
|
34
|
+
blocker = openTestDb(input.path);
|
|
35
|
+
blocker.exec("BEGIN IMMEDIATE");
|
|
36
|
+
ftsStarted.resolve();
|
|
37
|
+
await releaseFts.promise;
|
|
38
|
+
blocker.exec("ROLLBACK");
|
|
39
|
+
blocker.close();
|
|
40
|
+
blocker = undefined;
|
|
41
|
+
return { ftsRowidBackfill: true };
|
|
42
|
+
});
|
|
43
|
+
const time = spyOn(messageTime, "startMessageTimeBackfill").mockImplementation(async () => {
|
|
44
|
+
timeStarted.resolve();
|
|
45
|
+
await releaseTime.promise;
|
|
46
|
+
});
|
|
47
|
+
let returned = false;
|
|
48
|
+
const opening = openTestDatabase().then((db) => {
|
|
49
|
+
returned = true;
|
|
50
|
+
return db;
|
|
51
|
+
});
|
|
52
|
+
try {
|
|
53
|
+
await ftsStarted.promise;
|
|
54
|
+
expect(returned).toBe(false);
|
|
55
|
+
const dbPath = blocker!.prepare("PRAGMA database_list").all() as Array<{ file: string }>;
|
|
56
|
+
const serving = openTestDb(dbPath[0]!.file);
|
|
57
|
+
try {
|
|
58
|
+
serving.exec("PRAGMA busy_timeout=0");
|
|
59
|
+
expect(() => serving.exec("BEGIN IMMEDIATE")).toThrow("database is locked");
|
|
60
|
+
} finally {
|
|
61
|
+
serving.close();
|
|
62
|
+
}
|
|
63
|
+
releaseFts.resolve();
|
|
64
|
+
await timeStarted.promise;
|
|
65
|
+
expect(returned).toBe(false);
|
|
66
|
+
releaseTime.resolve();
|
|
67
|
+
const db = await opening;
|
|
68
|
+
expect(__getDatabaseStartupStateForTests(db).running).toBeInstanceOf(Promise);
|
|
69
|
+
expect(getDatabasePath(db)).toBe(dbPath[0]!.file);
|
|
70
|
+
db.exec("BEGIN IMMEDIATE; ROLLBACK");
|
|
71
|
+
await closeDatabase();
|
|
72
|
+
const next = openDatabase()!;
|
|
73
|
+
expect(__getDatabaseStartupStateForTests(next)).toEqual({
|
|
74
|
+
timerScheduled: false,
|
|
75
|
+
running: null,
|
|
76
|
+
});
|
|
77
|
+
} finally {
|
|
78
|
+
releaseFts.resolve();
|
|
79
|
+
releaseTime.resolve();
|
|
80
|
+
await opening;
|
|
81
|
+
fts.mockRestore();
|
|
82
|
+
time.mockRestore();
|
|
83
|
+
}
|
|
84
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__setScheduleStartupMaintenanceOnOpenForTests,
|
|
3
|
+
__waitForDatabaseStartupForTests,
|
|
4
|
+
openDatabase,
|
|
5
|
+
} from "../features/magic-context/storage-db";
|
|
6
|
+
import { Database } from "./sqlite";
|
|
7
|
+
|
|
8
|
+
/** A raw fixture connection, without changing the caller's SQLite lock policy. */
|
|
9
|
+
export function openTestDb(
|
|
10
|
+
path: string,
|
|
11
|
+
options?: ConstructorParameters<typeof Database>[1],
|
|
12
|
+
): Database {
|
|
13
|
+
return new Database(path, options);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Real transform fixtures need an idle serving database. Startup backfills open
|
|
18
|
+
* separate connections to the same SQLite file. Their write locks can make a
|
|
19
|
+
* healthy pass replay the previous saved request instead of running the work
|
|
20
|
+
* the test is asserting. This helper opts into real startup even when the unit
|
|
21
|
+
* preload disables it, then joins the writers before returning.
|
|
22
|
+
*/
|
|
23
|
+
export async function openTestDatabase(
|
|
24
|
+
...args: Parameters<typeof openDatabase>
|
|
25
|
+
): Promise<Database> {
|
|
26
|
+
const previous = __setScheduleStartupMaintenanceOnOpenForTests(true);
|
|
27
|
+
let db: Database | null;
|
|
28
|
+
try {
|
|
29
|
+
db = openDatabase(...args);
|
|
30
|
+
} finally {
|
|
31
|
+
__setScheduleStartupMaintenanceOnOpenForTests(previous);
|
|
32
|
+
}
|
|
33
|
+
if (!db) throw new Error("Test database unavailable");
|
|
34
|
+
await __waitForDatabaseStartupForTests(db);
|
|
35
|
+
return db;
|
|
36
|
+
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ensureMemoryEmbeddings2
|
|
3
|
-
} from "./index-d4qw2h43.js";
|
|
4
|
-
import"./index-s79g172v.js";
|
|
5
|
-
import"./index-4dhv7mqz.js";
|
|
6
|
-
import"./index-2amn2s73.js";
|
|
7
|
-
import"./index-qt1qqasc.js";
|
|
8
|
-
import"./index-hkh8x221.js";
|
|
9
|
-
import"./index-4dpvnp8k.js";
|
|
10
|
-
import"./index-jz5bk7xd.js";
|
|
11
|
-
import"./index-qcz1fy7h.js";
|
|
12
|
-
import"./index-dj2p8653.js";
|
|
13
|
-
import"./index-txs8tce6.js";
|
|
14
|
-
import"./index-h9m41624.js";
|
|
15
|
-
import"./index-xa9mmq6c.js";
|
|
16
|
-
import"./index-96ztjvkn.js";
|
|
17
|
-
import"./index-v0p37hm2.js";
|
|
18
|
-
import"./index-fxbk7gk3.js";
|
|
19
|
-
import"./index-ak11t3gm.js";
|
|
20
|
-
import"./index-gzy5w8ya.js";
|
|
21
|
-
import"./index-jrfre9ah.js";
|
|
22
|
-
import"./index-g2q4htwp.js";
|
|
23
|
-
import"./index-pavzsdc6.js";
|
|
24
|
-
import"./index-z4p0ry94.js";
|
|
25
|
-
import"./index-1d042x6w.js";
|
|
26
|
-
export {
|
|
27
|
-
ensureMemoryEmbeddings2 as ensureMemoryEmbeddings
|
|
28
|
-
};
|
package/dist/index-g2q4htwp.js
DELETED
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getHarness2
|
|
3
|
-
} from "./index-pavzsdc6.js";
|
|
4
|
-
|
|
5
|
-
// src/shared/data-path.ts
|
|
6
|
-
import {
|
|
7
|
-
existsSync,
|
|
8
|
-
lstatSync,
|
|
9
|
-
mkdirSync,
|
|
10
|
-
readFileSync,
|
|
11
|
-
readlinkSync,
|
|
12
|
-
realpathSync,
|
|
13
|
-
writeFileSync
|
|
14
|
-
} from "node:fs";
|
|
15
|
-
import * as os from "node:os";
|
|
16
|
-
import * as path from "node:path";
|
|
17
|
-
|
|
18
|
-
// src/shared/test-temp-dir.ts
|
|
19
|
-
var STALE_TEMP_DIR_AGE_MS = 60 * 60 * 1000;
|
|
20
|
-
var registeredTempDirs = new Set;
|
|
21
|
-
|
|
22
|
-
// src/shared/data-path.ts
|
|
23
|
-
function getDataDir() {
|
|
24
|
-
return process.env.XDG_DATA_HOME ?? path.join(os.homedir(), ".local", "share");
|
|
25
|
-
}
|
|
26
|
-
function getMagicContextTempDir(harness = getHarness2()) {
|
|
27
|
-
return path.join(os.tmpdir(), harness, "magic-context");
|
|
28
|
-
}
|
|
29
|
-
function getMagicContextLogPath(harness = getHarness2()) {
|
|
30
|
-
const envPath = process.env.MAGIC_CONTEXT_LOG_PATH?.trim();
|
|
31
|
-
if (envPath)
|
|
32
|
-
return envPath;
|
|
33
|
-
return path.join(getMagicContextTempDir(harness), "magic-context.log");
|
|
34
|
-
}
|
|
35
|
-
function getProjectMagicContextDir(directory) {
|
|
36
|
-
return path.join(directory, ".cortexkit", "magic-context");
|
|
37
|
-
}
|
|
38
|
-
var GITIGNORE_GUARD_OPEN = "# >>> cortexkit:magic-context";
|
|
39
|
-
var GITIGNORE_GUARD_CLOSE = "# <<< cortexkit:magic-context";
|
|
40
|
-
function ensureCortexKitArtifactGitignore(directory) {
|
|
41
|
-
try {
|
|
42
|
-
const cortexKitDir = path.join(directory, ".cortexkit");
|
|
43
|
-
const gitignorePath = path.join(cortexKitDir, ".gitignore");
|
|
44
|
-
let existing = "";
|
|
45
|
-
if (existsSync(gitignorePath)) {
|
|
46
|
-
existing = readFileSync(gitignorePath, "utf8");
|
|
47
|
-
if (existing.includes(GITIGNORE_GUARD_OPEN))
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
const block = `${GITIGNORE_GUARD_OPEN}
|
|
51
|
-
magic-context/
|
|
52
|
-
${GITIGNORE_GUARD_CLOSE}
|
|
53
|
-
`;
|
|
54
|
-
const needsLeadingNewline = existing.length > 0 && !existing.endsWith(`
|
|
55
|
-
`);
|
|
56
|
-
const next = existing + (needsLeadingNewline ? `
|
|
57
|
-
` : "") + block;
|
|
58
|
-
mkdirSync(cortexKitDir, { recursive: true });
|
|
59
|
-
writeFileSync(gitignorePath, next, "utf8");
|
|
60
|
-
} catch {}
|
|
61
|
-
}
|
|
62
|
-
function getProjectMagicContextHistorianDir(directory) {
|
|
63
|
-
return path.join(getProjectMagicContextDir(directory), "historian");
|
|
64
|
-
}
|
|
65
|
-
function getOpenCodeStorageDir() {
|
|
66
|
-
return path.join(getDataDir(), "opencode", "storage");
|
|
67
|
-
}
|
|
68
|
-
function getMagicContextStorageResolution() {
|
|
69
|
-
const testDataDir = process.env.MAGIC_CONTEXT_TEST_DATA_DIR?.trim();
|
|
70
|
-
if (testDataDir) {
|
|
71
|
-
const perTestDataHome = process.env.XDG_DATA_HOME?.trim();
|
|
72
|
-
if (perTestDataHome && path.resolve(perTestDataHome) !== path.resolve(testDataDir)) {
|
|
73
|
-
return {
|
|
74
|
-
path: path.join(perTestDataHome, "cortexkit", "magic-context"),
|
|
75
|
-
source: "test isolation"
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
return {
|
|
79
|
-
path: path.join(testDataDir, "cortexkit", "magic-context"),
|
|
80
|
-
source: "test isolation"
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
if (false) {}
|
|
84
|
-
const explicitStorageDir = process.env.MAGIC_CONTEXT_STORAGE_DIR?.trim();
|
|
85
|
-
if (explicitStorageDir) {
|
|
86
|
-
if (!path.isAbsolute(explicitStorageDir)) {
|
|
87
|
-
throw new Error("MAGIC_CONTEXT_STORAGE_DIR must be an absolute path");
|
|
88
|
-
}
|
|
89
|
-
return { path: explicitStorageDir, source: "environment override" };
|
|
90
|
-
}
|
|
91
|
-
const xdgDataHome = process.env.XDG_DATA_HOME?.trim();
|
|
92
|
-
if (xdgDataHome) {
|
|
93
|
-
return {
|
|
94
|
-
path: path.join(xdgDataHome, "cortexkit", "magic-context"),
|
|
95
|
-
source: "XDG_DATA_HOME"
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
return {
|
|
99
|
-
path: path.join(os.homedir(), ".local", "share", "cortexkit", "magic-context"),
|
|
100
|
-
source: "platform default"
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
function getMagicContextStorageDir() {
|
|
104
|
-
return getMagicContextStorageResolution().path;
|
|
105
|
-
}
|
|
106
|
-
function canonicalizeStoragePath(value, seen = new Set) {
|
|
107
|
-
const absolute = path.resolve(value);
|
|
108
|
-
if (seen.has(absolute))
|
|
109
|
-
return absolute;
|
|
110
|
-
seen.add(absolute);
|
|
111
|
-
try {
|
|
112
|
-
return realpathSync.native(absolute);
|
|
113
|
-
} catch {
|
|
114
|
-
try {
|
|
115
|
-
if (lstatSync(absolute).isSymbolicLink()) {
|
|
116
|
-
const target = readlinkSync(absolute);
|
|
117
|
-
const resolvedTarget = path.isAbsolute(target) ? target : path.resolve(path.dirname(absolute), target);
|
|
118
|
-
return canonicalizeStoragePath(resolvedTarget, seen);
|
|
119
|
-
}
|
|
120
|
-
} catch {}
|
|
121
|
-
const parent = path.dirname(absolute);
|
|
122
|
-
if (parent === absolute)
|
|
123
|
-
return absolute;
|
|
124
|
-
const resolvedParent = canonicalizeStoragePath(parent, seen);
|
|
125
|
-
return path.resolve(resolvedParent, path.basename(absolute));
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
function isMagicContextStorageOutsideEngram(storageDir = getMagicContextStorageDir(), backupDir = path.join(os.homedir(), ".local", "share", "cortexkit", "magic-context")) {
|
|
129
|
-
const resolvedStorageDir = canonicalizeStoragePath(storageDir);
|
|
130
|
-
const resolvedBackupDir = canonicalizeStoragePath(backupDir);
|
|
131
|
-
const relative2 = path.relative(resolvedBackupDir, resolvedStorageDir);
|
|
132
|
-
return path.isAbsolute(relative2) || relative2 === ".." || relative2.startsWith(`..${path.sep}`);
|
|
133
|
-
}
|
|
134
|
-
var STORAGE_BACKUP_WARNING_CHECKED = Symbol.for("magic-context.storage-backup-warning-checked");
|
|
135
|
-
function claimStorageBackupWarningCheck() {
|
|
136
|
-
const processState = globalThis;
|
|
137
|
-
if (processState[STORAGE_BACKUP_WARNING_CHECKED])
|
|
138
|
-
return false;
|
|
139
|
-
processState[STORAGE_BACKUP_WARNING_CHECKED] = true;
|
|
140
|
-
return true;
|
|
141
|
-
}
|
|
142
|
-
function getLegacyOpenCodeMagicContextStorageDir() {
|
|
143
|
-
return path.join(getOpenCodeStorageDir(), "plugin", "magic-context");
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
export { getDataDir, getMagicContextLogPath, ensureCortexKitArtifactGitignore, getProjectMagicContextHistorianDir, getOpenCodeStorageDir, getMagicContextStorageResolution, getMagicContextStorageDir, isMagicContextStorageOutsideEngram, claimStorageBackupWarningCheck, getLegacyOpenCodeMagicContextStorageDir };
|
package/dist/render-mnqc74ar.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
renderMessageByOrdinal2,
|
|
3
|
-
renderVerboseRangeForTool2,
|
|
4
|
-
renderItemByTag2
|
|
5
|
-
} from "./index-t6s0tsp7.js";
|
|
6
|
-
import"./index-ta87fpfs.js";
|
|
7
|
-
import"./index-2qbtqg1w.js";
|
|
8
|
-
import"./index-fgft4qjn.js";
|
|
9
|
-
import"./index-2amn2s73.js";
|
|
10
|
-
import"./index-6athgjba.js";
|
|
11
|
-
import"./index-rvmhyk89.js";
|
|
12
|
-
import"./index-4wpfbzks.js";
|
|
13
|
-
import"./index-1zx87sdm.js";
|
|
14
|
-
import"./index-brj6was5.js";
|
|
15
|
-
import"./index-4dpvnp8k.js";
|
|
16
|
-
import"./index-qcz1fy7h.js";
|
|
17
|
-
import"./index-dj2p8653.js";
|
|
18
|
-
import"./index-q6pjqm49.js";
|
|
19
|
-
import"./index-fb3zxn06.js";
|
|
20
|
-
import"./index-nj360hcs.js";
|
|
21
|
-
import"./index-fr0wbhdn.js";
|
|
22
|
-
import"./index-txs8tce6.js";
|
|
23
|
-
import"./index-h9m41624.js";
|
|
24
|
-
import"./index-wh9fxds5.js";
|
|
25
|
-
import"./index-2p37txes.js";
|
|
26
|
-
import"./index-smtbdmc3.js";
|
|
27
|
-
import"./index-9wnbnx8f.js";
|
|
28
|
-
import"./index-xa9mmq6c.js";
|
|
29
|
-
import"./index-96ztjvkn.js";
|
|
30
|
-
import"./index-v0p37hm2.js";
|
|
31
|
-
import"./index-58e3y90n.js";
|
|
32
|
-
import"./index-fxbk7gk3.js";
|
|
33
|
-
import"./index-ak11t3gm.js";
|
|
34
|
-
import"./index-gzy5w8ya.js";
|
|
35
|
-
import"./index-jrfre9ah.js";
|
|
36
|
-
import"./index-g2q4htwp.js";
|
|
37
|
-
import"./index-pavzsdc6.js";
|
|
38
|
-
import"./index-z4p0ry94.js";
|
|
39
|
-
import"./index-1d042x6w.js";
|
|
40
|
-
export {
|
|
41
|
-
renderItemByTag2 as renderItemByTag,
|
|
42
|
-
renderMessageByOrdinal2 as renderMessageByOrdinal,
|
|
43
|
-
renderVerboseRangeForTool2 as renderVerboseRangeForTool
|
|
44
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ensureMemoryEmbeddings2
|
|
3
|
-
} from "./server-sr8tf5dt.js";
|
|
4
|
-
import"./server-2gjqhmn9.js";
|
|
5
|
-
import"./server-4dhv7mqz.js";
|
|
6
|
-
import"./server-2amn2s73.js";
|
|
7
|
-
import"./server-qt1qqasc.js";
|
|
8
|
-
import"./server-sg2qjkrb.js";
|
|
9
|
-
import"./server-p9s40wfa.js";
|
|
10
|
-
import"./server-dcws5831.js";
|
|
11
|
-
import"./server-y8n33d9j.js";
|
|
12
|
-
import"./server-ddw42d76.js";
|
|
13
|
-
import"./server-69m30b21.js";
|
|
14
|
-
import"./server-131h608x.js";
|
|
15
|
-
import"./server-b3r080cm.js";
|
|
16
|
-
import"./server-96ztjvkn.js";
|
|
17
|
-
import"./server-v0p37hm2.js";
|
|
18
|
-
import"./server-qmmkhz2z.js";
|
|
19
|
-
import"./server-7vb38e51.js";
|
|
20
|
-
import"./server-gzy5w8ya.js";
|
|
21
|
-
import"./server-jb6tjyeb.js";
|
|
22
|
-
import"./server-pavzsdc6.js";
|
|
23
|
-
import"./server-z4p0ry94.js";
|
|
24
|
-
import"./server-1d042x6w.js";
|
|
25
|
-
export {
|
|
26
|
-
ensureMemoryEmbeddings2 as ensureMemoryEmbeddings
|
|
27
|
-
};
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
runManagedWrapup2
|
|
3
|
-
} from "./index-8ka0ne8t.js";
|
|
4
|
-
import"./index-trkxkgmd.js";
|
|
5
|
-
import"./index-zetm0ayn.js";
|
|
6
|
-
import"./index-gn6gfz4y.js";
|
|
7
|
-
import"./index-sd3egckz.js";
|
|
8
|
-
import"./index-sd2s4t4p.js";
|
|
9
|
-
import"./index-d4qw2h43.js";
|
|
10
|
-
import"./index-jjvbk92s.js";
|
|
11
|
-
import"./index-s79g172v.js";
|
|
12
|
-
import"./index-4dhv7mqz.js";
|
|
13
|
-
import"./index-ta87fpfs.js";
|
|
14
|
-
import"./index-2qbtqg1w.js";
|
|
15
|
-
import"./index-fgft4qjn.js";
|
|
16
|
-
import"./index-2amn2s73.js";
|
|
17
|
-
import"./index-6athgjba.js";
|
|
18
|
-
import"./index-8cfnaagj.js";
|
|
19
|
-
import"./index-25ka1jza.js";
|
|
20
|
-
import"./index-qt1qqasc.js";
|
|
21
|
-
import"./index-rvmhyk89.js";
|
|
22
|
-
import"./index-4wpfbzks.js";
|
|
23
|
-
import"./index-1zx87sdm.js";
|
|
24
|
-
import"./index-brj6was5.js";
|
|
25
|
-
import"./index-x8a7jmkh.js";
|
|
26
|
-
import"./index-fw42ms3m.js";
|
|
27
|
-
import"./index-hkh8x221.js";
|
|
28
|
-
import"./index-4dpvnp8k.js";
|
|
29
|
-
import"./index-jz5bk7xd.js";
|
|
30
|
-
import"./index-qcz1fy7h.js";
|
|
31
|
-
import"./index-dj2p8653.js";
|
|
32
|
-
import"./index-q6pjqm49.js";
|
|
33
|
-
import"./index-fb3zxn06.js";
|
|
34
|
-
import"./index-nj360hcs.js";
|
|
35
|
-
import"./index-fr0wbhdn.js";
|
|
36
|
-
import"./index-txs8tce6.js";
|
|
37
|
-
import"./index-h9m41624.js";
|
|
38
|
-
import"./index-wh9fxds5.js";
|
|
39
|
-
import"./index-2p37txes.js";
|
|
40
|
-
import"./index-smtbdmc3.js";
|
|
41
|
-
import"./index-9wnbnx8f.js";
|
|
42
|
-
import"./index-xa9mmq6c.js";
|
|
43
|
-
import"./index-96ztjvkn.js";
|
|
44
|
-
import"./index-v0p37hm2.js";
|
|
45
|
-
import"./index-58e3y90n.js";
|
|
46
|
-
import"./index-fxbk7gk3.js";
|
|
47
|
-
import"./index-ak11t3gm.js";
|
|
48
|
-
import"./index-gzy5w8ya.js";
|
|
49
|
-
import"./index-jrfre9ah.js";
|
|
50
|
-
import"./index-g2q4htwp.js";
|
|
51
|
-
import"./index-pavzsdc6.js";
|
|
52
|
-
import"./index-z4p0ry94.js";
|
|
53
|
-
import"./index-1d042x6w.js";
|
|
54
|
-
export {
|
|
55
|
-
runManagedWrapup2 as runManagedWrapup
|
|
56
|
-
};
|