sessiongraph-app-darwin-arm64 1.0.25 → 1.0.27
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/package.json +2 -2
- package/payload/SessionGraph.app/Contents/Info.plist +2 -2
- package/payload/SessionGraph.app/Contents/MacOS/sessiongraph +0 -0
- package/payload/SessionGraph.app/Contents/Resources/resources/cli-package.json +1 -1
- package/payload/SessionGraph.app/Contents/Resources/resources/cli.mjs +236 -83
- package/payload/SessionGraph.app/Contents/Resources/resources/server.mjs +261 -117
- package/payload/SessionGraph.app/Contents/Resources/resources/web/assets/{index-D4p45n7i.js → index-BDlenc5U.js} +1 -1
- package/payload/SessionGraph.app/Contents/Resources/resources/web/assets/{index-YT1ntRdY.js → index-BVcGr0Qy.js} +7 -7
- package/payload/SessionGraph.app/Contents/Resources/resources/web/assets/{index-B05th82t.js → index-CI08Hryc.js} +1 -1
- package/payload/SessionGraph.app/Contents/Resources/resources/web/assets/{index-DFcP_XK3.js → index-Ds6_5DlV.js} +1 -1
- package/payload/SessionGraph.app/Contents/Resources/resources/web/assets/{public-viewer-DZqNLaJW.js → public-viewer-BR7Jvjf3.js} +1 -1
- package/payload/SessionGraph.app/Contents/Resources/resources/web/assets/{scene-BkT0QJrf.js → scene-CaX0r4Hf.js} +1 -1
- package/payload/SessionGraph.app/Contents/Resources/resources/web/assets/{share-jfnlc0aB.js → share-C0Ryjhbj.js} +3 -3
- package/payload/SessionGraph.app/Contents/Resources/resources/web/index.html +1 -1
- package/payload/SessionGraph.app/Contents/_CodeSignature/CodeResources +40 -40
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sessiongraph-app-darwin-arm64",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.27",
|
|
4
4
|
"description": "Explore & visualize all your LLM sessions — darwin/arm64",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"access": "public",
|
|
11
11
|
"registry": "https://registry.npmjs.org/"
|
|
12
12
|
},
|
|
13
|
-
"sessionGraphCommit": "
|
|
13
|
+
"sessionGraphCommit": "80473c2689fd8ff47b36ab15150f4270290d57ab",
|
|
14
14
|
"os": [
|
|
15
15
|
"darwin"
|
|
16
16
|
],
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
<key>CFBundlePackageType</key>
|
|
18
18
|
<string>APPL</string>
|
|
19
19
|
<key>CFBundleShortVersionString</key>
|
|
20
|
-
<string>1.0.
|
|
20
|
+
<string>1.0.27</string>
|
|
21
21
|
<key>CFBundleVersion</key>
|
|
22
|
-
<string>1.0.
|
|
22
|
+
<string>1.0.27</string>
|
|
23
23
|
<key>CSResourcesFileMapped</key>
|
|
24
24
|
<true/>
|
|
25
25
|
<key>LSApplicationCategoryType</key>
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"1.0.
|
|
1
|
+
{"version":"1.0.27","buildID":"46bb17d3df5f3b48e624072d9d0991b666d3aadfa1552d23a4f4d7f1b7c496a5"}
|
|
@@ -17373,8 +17373,8 @@ function rewriteKeyNames(ctx) {
|
|
|
17373
17373
|
bySchema.set(entry.schema, entry);
|
|
17374
17374
|
}
|
|
17375
17375
|
const rewrites = /* @__PURE__ */ new Map();
|
|
17376
|
-
for (const
|
|
17377
|
-
const seen = ctx.seen.get(
|
|
17376
|
+
for (const record3 of pendingRecords.get(ctx) ?? []) {
|
|
17377
|
+
const seen = ctx.seen.get(record3);
|
|
17378
17378
|
const names = (seen?.def ?? seen?.schema)?.propertyNames;
|
|
17379
17379
|
if (!names || names === true || rewrites.has(names))
|
|
17380
17380
|
continue;
|
|
@@ -24014,16 +24014,16 @@ async function publish(file2, info, handoff2) {
|
|
|
24014
24014
|
await rename(temporary, file2 + ".pty-handoff").finally(() => rm(temporary, { force: true }));
|
|
24015
24015
|
}
|
|
24016
24016
|
async function environment2(file2, env2) {
|
|
24017
|
-
const
|
|
24017
|
+
const record3 = await read(file2);
|
|
24018
24018
|
const current = await readFile(file2, "utf8").then((text4) => JSON.parse(text4)).catch(() => {
|
|
24019
24019
|
return;
|
|
24020
24020
|
});
|
|
24021
|
-
const handoff2 =
|
|
24021
|
+
const handoff2 = record3 !== void 0 && record3.expiresAt > Date.now() && (current === void 0 || same(record3.source, current)) ? record3.handoff : void 0;
|
|
24022
24022
|
return { ...env2, OPENCODE_PTY_HANDOFF: handoff2 == null ? void 0 : JSON.stringify(handoff2) };
|
|
24023
24023
|
}
|
|
24024
24024
|
async function complete2(file2, info) {
|
|
24025
|
-
const
|
|
24026
|
-
if (
|
|
24025
|
+
const record3 = await read(file2);
|
|
24026
|
+
if (record3 !== void 0 && !same(record3.source, info))
|
|
24027
24027
|
await clear2(file2);
|
|
24028
24028
|
}
|
|
24029
24029
|
async function clear2(file2) {
|
|
@@ -52111,7 +52111,7 @@ function piHistory(value) {
|
|
|
52111
52111
|
nativeID: header.id,
|
|
52112
52112
|
messages,
|
|
52113
52113
|
partial: partial2,
|
|
52114
|
-
session: { directory: text3(header.cwd), created: time3(header.timestamp), title: text3([...rows2].reverse().find((r) => r.type === "session_info")?.name), model: text3(lastModel?.modelId || lastModel?.message?.model) || "Unknown model", provider: text3(lastModel?.provider || lastModel?.message?.provider) },
|
|
52114
|
+
session: { directory: text3(header.cwd), created: time3(header.timestamp), title: text3([...rows2].reverse().find((r) => r.type === "session_info" && text3(r.name).trim())?.name).trim(), model: text3(lastModel?.modelId || lastModel?.message?.model) || "Unknown model", provider: text3(lastModel?.provider || lastModel?.message?.provider) },
|
|
52115
52115
|
note: "Includes all saved branches in this transcript."
|
|
52116
52116
|
};
|
|
52117
52117
|
}
|
|
@@ -52209,7 +52209,7 @@ function jcodeHistory(path, files) {
|
|
|
52209
52209
|
function codebuffHistory(path, files, free) {
|
|
52210
52210
|
const records = json4(files.get(path));
|
|
52211
52211
|
if (!Array.isArray(records)) throw new Error("Unsupported Codebuff chat.");
|
|
52212
|
-
const isFree = records.some((m) => text3(m.metadata?.runState?.sessionState?.mainAgentState?.agentType).
|
|
52212
|
+
const isFree = records.some((m) => text3(m.metadata?.runState?.sessionState?.mainAgentState?.agentType).split("-").includes("free"));
|
|
52213
52213
|
if (isFree !== free) return;
|
|
52214
52214
|
const messages = records.flatMap((r, i) => {
|
|
52215
52215
|
const content = r.content ?? (Array.isArray(r.blocks) ? r.blocks.filter((b) => typeof b.content === "string").map((b) => ({ type: "text", text: b.content })) : void 0);
|
|
@@ -52805,6 +52805,7 @@ function codexRecord(raw, offset, candidate) {
|
|
|
52805
52805
|
if (!p || typeof p !== "object") return;
|
|
52806
52806
|
if (raw.type === "session_meta" || raw.type === "turn_context") candidate.locator.executionCwd = typeof p.cwd === "string" ? p.cwd : "";
|
|
52807
52807
|
if (raw.type === "turn_context" && typeof p.model === "string") candidate.session.model = p.model;
|
|
52808
|
+
if (raw.type === "world_state" && typeof p.state?.model === "string" && p.state.model && candidate.session.model === "Unknown model") candidate.session.model = p.state.model;
|
|
52808
52809
|
if (raw.type === "event_msg" && p.type === "item_completed" && ["FileChange", "fileChange"].includes(p.item?.type)) {
|
|
52809
52810
|
const msg2 = blankMessage(`event:${p.item.id || raw.ordinal || offset}`, p.completed_at_ms || Date.parse(raw.timestamp) || 0, "tool");
|
|
52810
52811
|
msg2.events = [eventFor(msg2, "change", "event", "File-change result", eventText(p.item), { nativeType: p.type, status: ["completed", "Completed"].includes(p.item.status) ? "completed" : "unknown" })];
|
|
@@ -54617,13 +54618,155 @@ var init_harness_extra_formats = __esm({
|
|
|
54617
54618
|
}
|
|
54618
54619
|
});
|
|
54619
54620
|
|
|
54620
|
-
// server/adapters/
|
|
54621
|
+
// server/adapters/minimax.ts
|
|
54622
|
+
import { readdirSync as readdirSync2, realpathSync as realpathSync2, statSync as statSync2 } from "node:fs";
|
|
54621
54623
|
import { basename as basename13, dirname as dirname11, join as join23 } from "node:path";
|
|
54624
|
+
function minimaxRoots() {
|
|
54625
|
+
const override = process.env.MINIMAX_DATA_DIR?.trim() || process.env.MAVIS_DATA_DIR?.trim();
|
|
54626
|
+
let dirs = override ? [override] : bases.map((b) => homePath(b));
|
|
54627
|
+
if (!override) {
|
|
54628
|
+
try {
|
|
54629
|
+
dirs.push(...readdirSync2(homePath()).filter((n) => bases.some((b) => n.startsWith(`${b}-`) && n.length > b.length + 1)).sort().map((n) => homePath(n)));
|
|
54630
|
+
} catch {
|
|
54631
|
+
}
|
|
54632
|
+
}
|
|
54633
|
+
const seen = /* @__PURE__ */ new Set();
|
|
54634
|
+
return dirs.map((d) => join23(d, "v2", "sessions")).filter((root2) => {
|
|
54635
|
+
let key = root2;
|
|
54636
|
+
try {
|
|
54637
|
+
key = realpathSync2(root2);
|
|
54638
|
+
} catch {
|
|
54639
|
+
}
|
|
54640
|
+
return !seen.has(key) && Boolean(seen.add(key));
|
|
54641
|
+
});
|
|
54642
|
+
}
|
|
54643
|
+
function snapshotFiles2(path) {
|
|
54644
|
+
const dir = join23(dirname11(path), "snapshots");
|
|
54645
|
+
try {
|
|
54646
|
+
return readdirSync2(dir).filter((n) => n.endsWith(".jsonl")).sort((a, b) => generation(a) - generation(b) || a.localeCompare(b)).map((n) => join23(dir, n));
|
|
54647
|
+
} catch {
|
|
54648
|
+
return [];
|
|
54649
|
+
}
|
|
54650
|
+
}
|
|
54651
|
+
function minimaxExtras(path) {
|
|
54652
|
+
const dir = dirname11(path);
|
|
54653
|
+
let budget2 = SNAPSHOT_BUDGET;
|
|
54654
|
+
try {
|
|
54655
|
+
budget2 -= statSync2(path).size;
|
|
54656
|
+
} catch {
|
|
54657
|
+
}
|
|
54658
|
+
const kept = [];
|
|
54659
|
+
for (const file2 of snapshotFiles2(path).reverse()) {
|
|
54660
|
+
let size = 0;
|
|
54661
|
+
try {
|
|
54662
|
+
size = statSync2(file2).size;
|
|
54663
|
+
} catch {
|
|
54664
|
+
continue;
|
|
54665
|
+
}
|
|
54666
|
+
if (size > budget2) break;
|
|
54667
|
+
budget2 -= size;
|
|
54668
|
+
kept.unshift(file2);
|
|
54669
|
+
}
|
|
54670
|
+
return [join23(dir, "manifest.json"), ...kept];
|
|
54671
|
+
}
|
|
54672
|
+
function minimaxFolderID(path) {
|
|
54673
|
+
const encoded = /session_([A-Za-z0-9_-]+)$/.exec(basename13(dirname11(path)))?.[1];
|
|
54674
|
+
if (!encoded) return "";
|
|
54675
|
+
const decoded = Buffer.from(encoded, "base64url").toString("utf8");
|
|
54676
|
+
return /^[\x21-\x7e]{1,256}$/.test(decoded) ? decoded : encoded;
|
|
54677
|
+
}
|
|
54678
|
+
function runtimeSession(path, nativeID) {
|
|
54679
|
+
const sessions = dirname11(dirname11(dirname11(dirname11(dirname11(path))))), v22 = dirname11(sessions);
|
|
54680
|
+
if (basename13(sessions) !== "sessions" || basename13(v22) !== "v2") return;
|
|
54681
|
+
const db2 = join23(v22, "sqlite", "runtime-state.sqlite");
|
|
54682
|
+
try {
|
|
54683
|
+
const revision2 = sqliteRevision(db2);
|
|
54684
|
+
if (runtime?.path !== db2 || runtime.revision !== revision2) {
|
|
54685
|
+
runtime = { path: db2, revision: revision2, sessions: withSqliteSnapshot(db2, (d) => {
|
|
54686
|
+
const rows2 = /* @__PURE__ */ new Map();
|
|
54687
|
+
if (!hasTable(d, "local_runtime_sessions")) return rows2;
|
|
54688
|
+
const columns2 = new Set(d.prepare("PRAGMA table_info(local_runtime_sessions)").all().map((c) => String(c.name)));
|
|
54689
|
+
const pick2 = (name) => columns2.has(name) ? name : "NULL";
|
|
54690
|
+
if (!columns2.has("session_id")) return rows2;
|
|
54691
|
+
const workspace = `CASE WHEN ${pick2("is_default_workspace")} = 1 THEN NULL ELSE COALESCE(NULLIF(${pick2("project_workspace_dir")}, ''), ${pick2("workspace_dir")}) END`;
|
|
54692
|
+
for (const r of d.prepare(`SELECT session_id, ${pick2("title")} AS title, ${workspace} AS directory, ${pick2("parent_session_id")} AS parent FROM local_runtime_sessions LIMIT 100000`).all())
|
|
54693
|
+
if (text3(r.session_id)) rows2.set(text3(r.session_id), { title: text3(r.title).trim(), directory: text3(r.directory), parent: text3(r.parent) });
|
|
54694
|
+
return rows2;
|
|
54695
|
+
}, revision2) };
|
|
54696
|
+
}
|
|
54697
|
+
return runtime.sessions.get(nativeID);
|
|
54698
|
+
} catch {
|
|
54699
|
+
return;
|
|
54700
|
+
}
|
|
54701
|
+
}
|
|
54702
|
+
function record2(r, i) {
|
|
54703
|
+
const body = object4(r.message), id3 = text3(r.message_id) || text3(body.id) || `record:${i}`, at2 = minimaxTime(body.timestamp ?? r.timestamp);
|
|
54704
|
+
if (body.role === "compactionSummary" || body.archonCompaction) return recordEvent(r, id3, "Compaction summary", at2, body.summary ?? body.content);
|
|
54705
|
+
const content = body.role === "user" && typeof body.genuineUserQueryText === "string" ? body.genuineUserQueryText : body.content;
|
|
54706
|
+
return message({ ...body, id: id3, content }, id3, at2);
|
|
54707
|
+
}
|
|
54708
|
+
function minimaxHistory(path, files) {
|
|
54709
|
+
const manifestPath = join23(dirname11(path), "manifest.json");
|
|
54710
|
+
const manifest2 = object4(files.has(manifestPath) ? json4(files.get(manifestPath)) : void 0);
|
|
54711
|
+
const nativeID = text3(manifest2.sessionId) || minimaxFolderID(path);
|
|
54712
|
+
if (!nativeID) throw new Error("MiniMax session has no native identity.");
|
|
54713
|
+
const snapshots = [...files.keys()].filter((f) => dirname11(f) === join23(dirname11(path), "snapshots"));
|
|
54714
|
+
const omitted = snapshotFiles2(path).length > snapshots.length;
|
|
54715
|
+
const byID = /* @__PURE__ */ new Map(), rows2 = [];
|
|
54716
|
+
let partial2 = false;
|
|
54717
|
+
for (const file2 of [...snapshots, path]) {
|
|
54718
|
+
const parsed = jsonLines(files.get(file2));
|
|
54719
|
+
partial2 ||= parsed.partial;
|
|
54720
|
+
rows2.push(...parsed.rows);
|
|
54721
|
+
parsed.rows.forEach((r, i) => {
|
|
54722
|
+
const m = record2(r, i);
|
|
54723
|
+
if (m && !byID.has(m.id)) byID.set(m.id, m);
|
|
54724
|
+
});
|
|
54725
|
+
}
|
|
54726
|
+
const meta3 = runtimeSession(path, nativeID);
|
|
54727
|
+
const last2 = [...rows2].reverse().map((r) => object4(r.message)).find((m) => m.role === "assistant" && text3(m.model));
|
|
54728
|
+
return {
|
|
54729
|
+
nativeID,
|
|
54730
|
+
messages: [...byID.values()],
|
|
54731
|
+
partial: partial2 || omitted,
|
|
54732
|
+
parent: meta3?.parent || void 0,
|
|
54733
|
+
session: { created: minimaxTime(manifest2.createdAtMs), title: meta3?.title, directory: meta3?.directory, model: text3(last2?.model) || "Unknown model", provider: text3(last2?.provider) },
|
|
54734
|
+
note: omitted ? "The oldest compacted history exceeds the snapshot size limit and is summarized, not imported." : partial2 ? "Some transcript records could not be imported." : void 0
|
|
54735
|
+
};
|
|
54736
|
+
}
|
|
54737
|
+
var bases, SNAPSHOT_BUDGET, minimaxNative, generation, runtime, minimaxTime;
|
|
54738
|
+
var init_minimax = __esm({
|
|
54739
|
+
"server/adapters/minimax.ts"() {
|
|
54740
|
+
"use strict";
|
|
54741
|
+
init_local_files();
|
|
54742
|
+
init_harness_formats();
|
|
54743
|
+
init_harness_paths();
|
|
54744
|
+
init_sqlite_snapshot();
|
|
54745
|
+
bases = [".minimax", ".mavis"];
|
|
54746
|
+
SNAPSHOT_BUDGET = 24e6;
|
|
54747
|
+
minimaxNative = (path) => /(?:^|\/)[^/]*session_[^/]+\/messages\.jsonl$/.test(path);
|
|
54748
|
+
generation = (name) => Number(/^g(\d+)--/.exec(name)?.[1] ?? Infinity);
|
|
54749
|
+
minimaxTime = (v3) => typeof v3 === "number" && v3 > 0 && v3 < 1e11 ? seconds(v3) : time3(v3);
|
|
54750
|
+
}
|
|
54751
|
+
});
|
|
54752
|
+
|
|
54753
|
+
// server/adapters/harness-files.ts
|
|
54754
|
+
import { readdirSync as readdirSync3 } from "node:fs";
|
|
54755
|
+
import { basename as basename14, dirname as dirname12, join as join24 } from "node:path";
|
|
54756
|
+
function claudeStyleHistory(path, files) {
|
|
54757
|
+
const history = envelopeHistory(path, files.get(path));
|
|
54758
|
+
const agent = /^agent-(.+)\.jsonl$/.exec(basename14(path))?.[1];
|
|
54759
|
+
if (!agent || basename14(dirname12(path)) !== "subagents") return history;
|
|
54760
|
+
const recorded = jsonLines(files.get(path)).rows.map((r) => text3(r.agentId)).find(Boolean) || agent;
|
|
54761
|
+
history.parent = history.nativeID;
|
|
54762
|
+
history.nativeID = `${history.nativeID}/agent/${recorded}`;
|
|
54763
|
+
return history;
|
|
54764
|
+
}
|
|
54622
54765
|
function kimiHistory(path, files) {
|
|
54623
54766
|
const { rows: rows2 } = jsonLines(files.get(path));
|
|
54624
|
-
const folder =
|
|
54625
|
-
const nativeID = agent ? `${
|
|
54626
|
-
const wire =
|
|
54767
|
+
const folder = dirname12(path), id3 = basename14(folder), agent = basename14(dirname12(folder)) === "agents";
|
|
54768
|
+
const nativeID = agent ? `${basename14(dirname12(dirname12(folder)))}/agent/${id3}` : id3;
|
|
54769
|
+
const wire = join24(folder, "wire.jsonl"), wireRows = files.has(wire) ? jsonLines(files.get(wire)).rows : [];
|
|
54627
54770
|
const messages = rows2.flatMap((r, i) => {
|
|
54628
54771
|
const m = message(r, nativeText(r.id) || `context:${i}`);
|
|
54629
54772
|
return m ? [m] : [];
|
|
@@ -54642,7 +54785,7 @@ function museHistory(path, files) {
|
|
|
54642
54785
|
const meta3 = rows2.find((r) => r.payload_type === "runtime.session.metadata");
|
|
54643
54786
|
const ids = new Set(rows2.map((r) => text3(r.stream?.id)).filter(Boolean));
|
|
54644
54787
|
if (!meta3 || ids.size > 1) throw new Error("Unsupported Muse stream.");
|
|
54645
|
-
const nativeID = [...ids][0] ||
|
|
54788
|
+
const nativeID = [...ids][0] || basename14(dirname12(path));
|
|
54646
54789
|
const messages = rows2.flatMap((r, i) => {
|
|
54647
54790
|
const event = object4(r.payload?.event), body = object4(event.message);
|
|
54648
54791
|
const at2 = typeof r.recorded_at === "number" && r.recorded_at >= 1e15 ? r.recorded_at / 1e3 : typeof r.recorded_at === "number" && r.recorded_at < 1e12 ? seconds(r.recorded_at) : time3(r.recorded_at);
|
|
@@ -54660,7 +54803,7 @@ function junieHistory(path, files) {
|
|
|
54660
54803
|
return [recordEvent(r, text3(r.id) || `event:${i}`, kind, r.timestampMs, e10.text ?? e10.prompt ?? e10.message)];
|
|
54661
54804
|
});
|
|
54662
54805
|
if (!messages.length) throw new Error("No supported Junie events.");
|
|
54663
|
-
return { nativeID:
|
|
54806
|
+
return { nativeID: basename14(dirname12(path)), messages, partial: true, note: "Recorded events only." };
|
|
54664
54807
|
}
|
|
54665
54808
|
function augmentHistory(path, files) {
|
|
54666
54809
|
const r = object4(json4(files.get(path)));
|
|
@@ -54672,7 +54815,7 @@ function augmentHistory(path, files) {
|
|
|
54672
54815
|
return { nativeID: r.sessionId, messages, partial: true, session: { title: text3(r.title), created: time3(r.created), model: text3(r.agentState?.modelId) || "Unknown model" }, note: "Recorded exchanges only." };
|
|
54673
54816
|
}
|
|
54674
54817
|
function fxHistory(path, files) {
|
|
54675
|
-
const usage = object4(json4(files.get(path))), meta3 = sidecar2(files,
|
|
54818
|
+
const usage = object4(json4(files.get(path))), meta3 = sidecar2(files, join24(dirname12(path), "session.json"));
|
|
54676
54819
|
const id3 = text3(usage.session_id) || text3(meta3.id);
|
|
54677
54820
|
if (!id3 || !usage.snapshot || meta3.id && meta3.id !== id3) throw new Error("Unsupported Fx session metadata.");
|
|
54678
54821
|
const snapshot2 = object4(usage.snapshot);
|
|
@@ -54699,7 +54842,7 @@ function fxHistory(path, files) {
|
|
|
54699
54842
|
note: "Session metadata only."
|
|
54700
54843
|
};
|
|
54701
54844
|
}
|
|
54702
|
-
var piParse, jsonl, piSources, openclawRoots, promaRoots, definitions, fileHarnessAdapters;
|
|
54845
|
+
var piParse, jsonl, claudeStyle, piSources, omoChildRoots, openclawRoots, promaRoots, definitions, fileHarnessAdapters;
|
|
54703
54846
|
var init_harness_files = __esm({
|
|
54704
54847
|
"server/adapters/harness-files.ts"() {
|
|
54705
54848
|
"use strict";
|
|
@@ -54708,32 +54851,42 @@ var init_harness_files = __esm({
|
|
|
54708
54851
|
init_harness_formats();
|
|
54709
54852
|
init_harness_paths();
|
|
54710
54853
|
init_harness_extra_formats();
|
|
54854
|
+
init_minimax();
|
|
54711
54855
|
init_usage();
|
|
54712
54856
|
piParse = (path, files) => piHistory(files.get(path));
|
|
54713
54857
|
jsonl = (path) => path.endsWith(".jsonl");
|
|
54858
|
+
claudeStyle = (path) => jsonl(path) && !path.endsWith(".checkpoints.jsonl") && !(path.includes("subagents/") && basename14(path) === "journal.jsonl");
|
|
54714
54859
|
piSources = [
|
|
54715
54860
|
{ id: "prime-agent", name: "Prime Agent", roots: () => [process.env.PRIME_AGENT_SESSION_DIR || process.env.PRIME_AGENT_CODING_AGENT_SESSION_DIR || envHome("PRIME_AGENT_CODING_AGENT_DIR", ".prime/agent", "sessions"), envHome("PRIME_AGENT_CODING_AGENT_DIR", ".prime/agent", "session-artifacts")] },
|
|
54716
54861
|
{ id: "omp", name: "Oh My Pi", roots: () => [envHome("PI_CODING_AGENT_DIR_OMP", ".omp/agent", "sessions")] },
|
|
54717
|
-
{ id: "senpi", name: "Senpi / OmO Native", roots: () => [envHome("SENPI_CODING_AGENT_DIR", ".senpi/agent", "sessions"), homePath(".omo/agent/sessions")] },
|
|
54718
|
-
{ id: "kimchi", name: "Kimchi", roots: () => [
|
|
54719
|
-
{ id: "gajae", name: "Gajae-Code", roots: () => [
|
|
54862
|
+
{ id: "senpi", name: "Senpi / OmO Native", roots: () => [envHome("SENPI_CODING_AGENT_DIR", ".senpi/agent", "sessions"), homePath(".omo/agent/sessions"), ...omoChildRoots()] },
|
|
54863
|
+
{ id: "kimchi", name: "Kimchi", roots: () => [join24(process.env.KIMCHI_CODING_AGENT_DIR || configPath("kimchi/harness"), "sessions")] },
|
|
54864
|
+
{ id: "gajae", name: "Gajae-Code", roots: () => [join24(process.env.GJC_CODING_AGENT_DIR || (process.env.GJC_CONFIG_DIR || process.env.PI_CONFIG_DIR ? join24(process.env.GJC_CONFIG_DIR || process.env.PI_CONFIG_DIR, "agent") : homePath(".gjc/agent")), "sessions"), dataPath("gjc/sessions")] }
|
|
54720
54865
|
].map((s) => ({ ...s, parse: piParse }));
|
|
54866
|
+
omoChildRoots = () => [[".omo/agent/projects", "senpi-task/children"], [".omo/memory/agents", "runtime/transcripts"]].flatMap(([parent, child]) => {
|
|
54867
|
+
try {
|
|
54868
|
+
return readdirSync3(homePath(parent), { withFileTypes: true }).filter((e10) => e10.isDirectory()).map((e10) => homePath(parent, e10.name, child));
|
|
54869
|
+
} catch {
|
|
54870
|
+
return [];
|
|
54871
|
+
}
|
|
54872
|
+
});
|
|
54721
54873
|
openclawRoots = () => [envHome("OPENCLAW_STATE_DIR", ".openclaw", "agents"), ...[".clawdbot", ".moltbot", ".moldbot"].map((p) => homePath(p, "agents"))];
|
|
54722
54874
|
promaRoots = () => [".proma", ".proma-dev"].flatMap((p) => ["agent-sessions", "sdk-config/sessions", "sdk-config/projects"].map((s) => homePath(p, s)));
|
|
54723
54875
|
definitions = [
|
|
54724
54876
|
...piSources,
|
|
54725
|
-
{ id: "kiro", name: "Kiro", roots: () => [homePath(".kiro/sessions"), appPath("Kiro/User/globalStorage/kiro.kiroagent")], match: (p) => p.endsWith("/session.json") || /^cli\/[^/]+\.json$/.test(p), extras: (p) => [
|
|
54726
|
-
{ id: "mux", name: "Mux", roots: () => [envHome("MUX_ROOT", ".mux", "sessions")], match: (p) => p.endsWith("/chat.jsonl"), extras: (p) => [
|
|
54877
|
+
{ id: "kiro", name: "Kiro", roots: () => [homePath(".kiro/sessions"), appPath("Kiro/User/globalStorage/kiro.kiroagent")], match: (p) => p.endsWith("/session.json") || /^cli\/[^/]+\.json$/.test(p), extras: (p) => [basename14(p) === "session.json" ? join24(dirname12(p), "messages.jsonl") : p.replace(/\.json$/, ".jsonl")], parse: kiroHistory },
|
|
54878
|
+
{ id: "mux", name: "Mux", roots: () => [envHome("MUX_ROOT", ".mux", "sessions")], match: (p) => p.endsWith("/chat.jsonl"), extras: (p) => [join24(dirname12(p), "chat-archive.jsonl"), join24(dirname12(p), "session-usage.json")], parse: muxHistory },
|
|
54727
54879
|
{ id: "devin-desktop", name: "Devin Desktop", roots: () => [appPath("Devin/User/acp-events")], match: (p) => /\.(ndjson|jsonl)$/.test(p), parse: devinDesktopHistory },
|
|
54728
54880
|
{ id: "openclaw", name: "OpenClaw", roots: openclawRoots, match: (p) => /(?:^|\/)sessions\/.*\.jsonl(?:\.[\w.-]+)?$/.test(p) || /session-sqlite-import-archive\/.*\.jsonl\./.test(p), parse: piParse },
|
|
54729
54881
|
{ id: "amp", name: "Amp", roots: () => [dataPath("amp/threads"), tokscalePath("amp-cache/threads")], match: (p) => p.endsWith(".json"), parse: ampHistory },
|
|
54730
54882
|
{ id: "droid", name: "Factory Droid", roots: () => [envHome("FACTORY_HOME", ".factory", "sessions")] },
|
|
54731
54883
|
{ id: "codebuff", name: "Codebuff", roots: () => process.env.CODEBUFF_DATA_DIR ? [process.env.CODEBUFF_DATA_DIR] : ["manicode", "manicode-dev", "manicode-staging"].map((p) => configPath(p)), match: (p) => p.endsWith("/chat-messages.json"), parse: (p, f) => codebuffHistory(p, f, false) },
|
|
54732
54884
|
{ id: "freebuff", name: "Freebuff", roots: () => process.env.FREEBUFF_DATA_DIR ? [process.env.FREEBUFF_DATA_DIR] : process.env.CODEBUFF_DATA_DIR ? [process.env.CODEBUFF_DATA_DIR] : ["manicode", "manicode-dev", "manicode-staging"].map((p) => configPath(p)), match: (p) => p.endsWith("/chat-messages.json"), parse: (p, f) => codebuffHistory(p, f, true) },
|
|
54733
|
-
{ id: "kimi", name: "Kimi CLI / Code", roots: () => [envHome("KIMI_HOME", ".kimi", "sessions"), envHome("KIMI_CODE_HOME", ".kimi-code", "sessions")], match: (p) => p.endsWith("/context.jsonl"), extras: (p) => [
|
|
54885
|
+
{ id: "kimi", name: "Kimi CLI / Code", roots: () => [envHome("KIMI_HOME", ".kimi", "sessions"), envHome("KIMI_CODE_HOME", ".kimi-code", "sessions")], match: (p) => p.endsWith("/context.jsonl"), extras: (p) => [join24(dirname12(p), "wire.jsonl")], parse: kimiHistory },
|
|
54734
54886
|
{ id: "grok", name: "Grok Build", roots: () => [envHome("GROK_HOME", ".grok", "sessions")], match: (p) => p.endsWith("/updates.jsonl"), parse: (p, f) => acpHistory(p, f.get(p)) },
|
|
54735
54887
|
{ id: "jcode", name: "Jcode", roots: () => [envHome("JCODE_HOME", ".jcode", "sessions")], match: (p) => /(?:^|\/)session_[^/]+\.json$/.test(p), extras: (p) => [p.replace(/\.json$/, ".journal.jsonl")], parse: jcodeHistory },
|
|
54736
54888
|
{ id: "cherry-studio", name: "Cherry Studio", roots: () => [appPath("CherryStudio/Data/Agents/.claude/projects"), appPath("CherryStudio/.claude/projects")] },
|
|
54889
|
+
{ id: "qoder", name: "Qoder", roots: () => [envHome("QODER_CONFIG_DIR", ".qoder", "projects"), envHome("QODERCN_CONFIG_DIR", ".qoder-cn", "projects")] },
|
|
54737
54890
|
{ id: "command-code", name: "Command Code", roots: () => [homePath(".commandcode/projects")] },
|
|
54738
54891
|
{ id: "zcode", name: "ZCode", roots: () => [homePath(".zcode/projects")] },
|
|
54739
54892
|
{ id: "codebuddy", name: "CodeBuddy", roots: () => [homePath(".codebuddy/projects")] },
|
|
@@ -54742,23 +54895,25 @@ var init_harness_files = __esm({
|
|
|
54742
54895
|
{ id: "deepseek-harness", name: "DeepSeek Harness", roots: () => [envHome("DSH_HOME", ".dsh", "sessions")], match: (p) => /(?:^|\/)session(?:\.v\d+)?\.jsonl(?:\.zstd)?$/.test(p), parse: (p, f) => dshHistory(f.get(p)) },
|
|
54743
54896
|
{ id: "aside", name: "Aside", roots: () => [homePath(".aside/u")], match: (p) => /^[^/]+\/sessions\/[^/]+\/messages\.jsonl$/.test(p), parse(p, f) {
|
|
54744
54897
|
const h3 = envelopeHistory(p, f.get(p));
|
|
54745
|
-
h3.nativeID = `${
|
|
54898
|
+
h3.nativeID = `${basename14(dirname12(dirname12(dirname12(p))))}/${basename14(dirname12(p))}`;
|
|
54746
54899
|
return h3;
|
|
54747
54900
|
} },
|
|
54748
|
-
{ id: "vibe", name: "Mistral Vibe", roots: () => [envHome("VIBE_HOME", ".vibe", "logs/session")], match: (p) => p.endsWith("/meta.json") || /^[^/]+\.json$/.test(p), extras: (p) =>
|
|
54901
|
+
{ id: "vibe", name: "Mistral Vibe", roots: () => [envHome("VIBE_HOME", ".vibe", "logs/session")], match: (p) => p.endsWith("/meta.json") || /^[^/]+\.json$/.test(p), extras: (p) => basename14(p) === "meta.json" ? [join24(dirname12(p), "messages.jsonl")] : [], parse: vibeHistory },
|
|
54749
54902
|
{ id: "muse", name: "Muse Code", roots: () => [dataPath("muse/sessions")], match: (p) => p.endsWith("/session.jsonl"), parse: museHistory },
|
|
54750
54903
|
{ id: "junie", name: "Junie", roots: () => [homePath(".junie/sessions")], match: (p) => p.endsWith("/events.jsonl"), parse: junieHistory, description: "Local agent event history \xB7 partial conversation coverage" },
|
|
54751
54904
|
{ id: "augment", name: "Augment Code", roots: () => [homePath(".augment/sessions")], match: (p) => p.endsWith(".json"), parse: augmentHistory, description: "Local exchange records \xB7 partial conversation coverage" },
|
|
54752
|
-
{ id: "fx", name: "Fx", roots: () => [homePath(".fx/sessions")], match: (p) => p.endsWith("/usage-v2.json"), extras: (p) => [
|
|
54753
|
-
{
|
|
54754
|
-
|
|
54755
|
-
|
|
54756
|
-
|
|
54757
|
-
|
|
54758
|
-
|
|
54759
|
-
|
|
54760
|
-
|
|
54761
|
-
|
|
54905
|
+
{ id: "fx", name: "Fx", roots: () => [homePath(".fx/sessions")], match: (p) => p.endsWith("/usage-v2.json"), extras: (p) => [join24(dirname12(p), "session.json")], parse: fxHistory, history: false, description: "Session metadata only" },
|
|
54906
|
+
{
|
|
54907
|
+
id: "minimax-code",
|
|
54908
|
+
name: "MiniMax Code",
|
|
54909
|
+
description: "Local runtime transcripts (CLI and desktop)",
|
|
54910
|
+
roots: minimaxRoots,
|
|
54911
|
+
children: true,
|
|
54912
|
+
// Session folders hold other JSONL logs (ledger, display, snapshots); only messages.jsonl is the transcript.
|
|
54913
|
+
match: minimaxNative,
|
|
54914
|
+
extras: minimaxExtras,
|
|
54915
|
+
parse: minimaxHistory
|
|
54916
|
+
},
|
|
54762
54917
|
{ id: "opencodereview", name: "OpenCodeReview", roots: () => [homePath(".opencodereview/sessions")], parse(p, f) {
|
|
54763
54918
|
const { rows: rows2 } = jsonLines(f.get(p)), header = rows2.find((r) => r.type === "session_start");
|
|
54764
54919
|
if (!header) throw new Error("Unsupported review session.");
|
|
@@ -54768,17 +54923,17 @@ var init_harness_files = __esm({
|
|
|
54768
54923
|
fileHarnessAdapters = definitions.map((source) => localFileAdapter({
|
|
54769
54924
|
...source,
|
|
54770
54925
|
roots: harnessRoots(source.id, source.roots),
|
|
54771
|
-
match: source.match ||
|
|
54926
|
+
match: source.match || claudeStyle,
|
|
54772
54927
|
description: source.description || "Local session transcripts",
|
|
54773
|
-
capabilities: { history: source.history !== false, forks: false, children:
|
|
54774
|
-
parse: source.parse ||
|
|
54928
|
+
capabilities: { history: source.history !== false, forks: false, children: source.children === true || !source.parse, files: false },
|
|
54929
|
+
parse: source.parse || claudeStyleHistory
|
|
54775
54930
|
}));
|
|
54776
54931
|
}
|
|
54777
54932
|
});
|
|
54778
54933
|
|
|
54779
54934
|
// server/adapters/harness-databases.ts
|
|
54780
54935
|
import { lstat as lstat9, readFile as readFile3 } from "node:fs/promises";
|
|
54781
|
-
import { isAbsolute as isAbsolute8, join as
|
|
54936
|
+
import { isAbsolute as isAbsolute8, join as join25 } from "node:path";
|
|
54782
54937
|
function hermesContent(value) {
|
|
54783
54938
|
if (typeof value !== "string" || !value.startsWith("\0json:")) return value;
|
|
54784
54939
|
try {
|
|
@@ -54898,7 +55053,7 @@ var init_harness_databases = __esm({
|
|
|
54898
55053
|
goose = {
|
|
54899
55054
|
id: "goose",
|
|
54900
55055
|
name: "Goose",
|
|
54901
|
-
paths: dbPaths("goose", () => process.env.GOOSE_PATH_ROOT && isAbsolute8(process.env.GOOSE_PATH_ROOT) ? [
|
|
55056
|
+
paths: dbPaths("goose", () => process.env.GOOSE_PATH_ROOT && isAbsolute8(process.env.GOOSE_PATH_ROOT) ? [join25(process.env.GOOSE_PATH_ROOT, "data/sessions/sessions.db")] : [dataPath("goose/sessions/sessions.db"), dataPath("Block/goose/sessions/sessions.db"), appPath("goose/sessions/sessions.db"), appPath("Block/goose/sessions/sessions.db"), appPath("Block/goose/data/sessions/sessions.db")], (p) => p.endsWith("sessions.db")),
|
|
54902
55057
|
table: "sessions",
|
|
54903
55058
|
key: "id",
|
|
54904
55059
|
fields: [
|
|
@@ -54965,7 +55120,7 @@ var init_harness_databases = __esm({
|
|
|
54965
55120
|
zed = {
|
|
54966
55121
|
id: "zed",
|
|
54967
55122
|
name: "Zed Agent",
|
|
54968
|
-
paths: dbPaths("zed", () => [process.platform === "darwin" ? appPath("Zed/threads/threads.db") : process.platform === "win32" ?
|
|
55123
|
+
paths: dbPaths("zed", () => [process.platform === "darwin" ? appPath("Zed/threads/threads.db") : process.platform === "win32" ? join25(process.env.LOCALAPPDATA || homePath("AppData/Local"), "Zed/threads/threads.db") : dataPath("zed/threads/threads.db")], (p) => p.endsWith("threads.db")),
|
|
54969
55124
|
table: "threads",
|
|
54970
55125
|
key: "id",
|
|
54971
55126
|
fields: ["id", "summary", "created_at", "updated_at", "data_type", "data", "folder_paths"],
|
|
@@ -55014,7 +55169,7 @@ var init_harness_databases = __esm({
|
|
|
55014
55169
|
paths: async () => {
|
|
55015
55170
|
const override = sourcePath("crush") || process.env.SESSIONGRAPH_CRUSH_HISTORY_DIR;
|
|
55016
55171
|
if (override) return (await historyFiles([override], (p) => p.endsWith("crush.db"))).files;
|
|
55017
|
-
const registry2 =
|
|
55172
|
+
const registry2 = join25(process.env.CRUSH_GLOBAL_DATA || dataPath("crush"), "projects.json");
|
|
55018
55173
|
try {
|
|
55019
55174
|
const stat3 = await lstat9(registry2);
|
|
55020
55175
|
if (!stat3.isFile() || stat3.size > 2e6) throw new Error("Unsupported Crush registry.");
|
|
@@ -55022,7 +55177,7 @@ var init_harness_databases = __esm({
|
|
|
55022
55177
|
const paths2 = [];
|
|
55023
55178
|
for (const p of Array.isArray(raw.projects) ? raw.projects.slice(0, 2e4) : []) {
|
|
55024
55179
|
if (!isAbsolute8(text3(p.path)) || !text3(p.data_dir)) continue;
|
|
55025
|
-
const path =
|
|
55180
|
+
const path = join25(isAbsolute8(p.data_dir) ? p.data_dir : join25(p.path, p.data_dir), "crush.db");
|
|
55026
55181
|
paths2.push(path);
|
|
55027
55182
|
crushDirectories.set(path, p.path);
|
|
55028
55183
|
}
|
|
@@ -55142,7 +55297,7 @@ var init_harness_databases = __esm({
|
|
|
55142
55297
|
});
|
|
55143
55298
|
|
|
55144
55299
|
// server/adapters/harness-metadata.ts
|
|
55145
|
-
import { basename as
|
|
55300
|
+
import { basename as basename15 } from "node:path";
|
|
55146
55301
|
import { fileURLToPath as fileURLToPath4 } from "node:url";
|
|
55147
55302
|
function protoFields(value) {
|
|
55148
55303
|
if (value.length > 2e6) throw new Error("Trajectory metadata exceeds 2 MB.");
|
|
@@ -55174,7 +55329,7 @@ function protoFields(value) {
|
|
|
55174
55329
|
}
|
|
55175
55330
|
return fields3;
|
|
55176
55331
|
}
|
|
55177
|
-
var nested, antigravityDatabaseAdapters
|
|
55332
|
+
var nested, antigravityDatabaseAdapters;
|
|
55178
55333
|
var init_harness_metadata = __esm({
|
|
55179
55334
|
"server/adapters/harness-metadata.ts"() {
|
|
55180
55335
|
"use strict";
|
|
@@ -55205,25 +55360,9 @@ var init_harness_metadata = __esm({
|
|
|
55205
55360
|
}
|
|
55206
55361
|
}
|
|
55207
55362
|
if (!created) throw new Error("Trajectory creation time is unavailable.");
|
|
55208
|
-
return { nativeID:
|
|
55363
|
+
return { nativeID: basename15(path, ".db"), messages: [], partial: true, session: { created, directory: directory3 }, note: "Session metadata only." };
|
|
55209
55364
|
}
|
|
55210
55365
|
}));
|
|
55211
|
-
antigravityCacheAdapter = localFileAdapter({
|
|
55212
|
-
id: "antigravity",
|
|
55213
|
-
name: "Antigravity",
|
|
55214
|
-
description: "Cached session metadata only",
|
|
55215
|
-
capabilities: { history: false, forks: false, children: false, files: false },
|
|
55216
|
-
roots: harnessRoots("antigravity", () => [tokscalePath("antigravity-cache/sessions")]),
|
|
55217
|
-
match: (p) => p.endsWith(".jsonl"),
|
|
55218
|
-
parse(path, files) {
|
|
55219
|
-
const { rows: rows2 } = jsonLines(files.get(path));
|
|
55220
|
-
const ids = new Set(rows2.map((r) => text3(r.sessionId)).filter(Boolean));
|
|
55221
|
-
if (ids.size !== 1) throw new Error("Unsupported Antigravity cache identity.");
|
|
55222
|
-
const created = rows2.map((r) => time3(r.timestamp)).filter(Boolean).sort((a, b) => a - b)[0];
|
|
55223
|
-
if (!created) throw new Error("Antigravity cache has no recorded date.");
|
|
55224
|
-
return { nativeID: [...ids][0], messages: [], partial: true, session: { created, model: text3(rows2.find((r) => r.modelId)?.modelId) || "Unknown model" }, note: "Session metadata only. Date based on first recorded usage." };
|
|
55225
|
-
}
|
|
55226
|
-
});
|
|
55227
55366
|
}
|
|
55228
55367
|
});
|
|
55229
55368
|
|
|
@@ -55251,7 +55390,7 @@ var init_adapters = __esm({
|
|
|
55251
55390
|
init_harness_databases();
|
|
55252
55391
|
init_harness_metadata();
|
|
55253
55392
|
init_sqlite_histories();
|
|
55254
|
-
extra = [...databaseHarnessAdapters, ...fileHarnessAdapters,
|
|
55393
|
+
extra = [...databaseHarnessAdapters, ...fileHarnessAdapters, ...antigravityDatabaseAdapters];
|
|
55255
55394
|
grouped = /* @__PURE__ */ new Map();
|
|
55256
55395
|
for (const adapter of extra) grouped.set(adapter.id, [...grouped.get(adapter.id) || [], adapter]);
|
|
55257
55396
|
adapters = [opencodeAdapter, claudeAdapter, codexAdapter, t3CodeAdapter, cursorAdapter, geminiAdapter, qwenAdapter, piAdapter, copilotAdapter, copilotChatAdapter, clineAdapter, rooAdapter, kiloAdapter, continueAdapter, ...[...grouped.values()].map((parts) => parts.length === 1 ? parts[0] : combineAdapters(parts))];
|
|
@@ -66549,7 +66688,7 @@ var SessionGraphStore = class {
|
|
|
66549
66688
|
this.db = db2 = new DatabaseSync(path);
|
|
66550
66689
|
this.db.exec("PRAGMA busy_timeout=5000;");
|
|
66551
66690
|
const version2 = Number(this.db.prepare("PRAGMA user_version").get().user_version);
|
|
66552
|
-
if (version2 >
|
|
66691
|
+
if (version2 > 9) throw new LibraryError("LIBRARY_VERSION", "This library requires a newer version of SessionGraph.");
|
|
66553
66692
|
if (path !== ":memory:") chmodSync(path, 384);
|
|
66554
66693
|
this.db.exec("PRAGMA journal_mode=WAL; PRAGMA foreign_keys=ON;");
|
|
66555
66694
|
this.initialize(version2);
|
|
@@ -66626,15 +66765,7 @@ var SessionGraphStore = class {
|
|
|
66626
66765
|
if (version2 < 6) {
|
|
66627
66766
|
this.db.exec("BEGIN IMMEDIATE");
|
|
66628
66767
|
try {
|
|
66629
|
-
|
|
66630
|
-
const selected = this.setting("selected");
|
|
66631
|
-
if (selected) this.setting("selected", selected.filter((id3) => !retired.has(id3)));
|
|
66632
|
-
const paths2 = this.setting("sourcePaths");
|
|
66633
|
-
if (paths2) this.setting("sourcePaths", Object.fromEntries(Object.entries(paths2).filter(([id3]) => !retired.has(id3))));
|
|
66634
|
-
const view = this.setting("viewState");
|
|
66635
|
-
if (view && typeof view.sourceID === "string" && retired.has(view.sourceID)) this.setting("viewState", { ...view, sourceID: "" });
|
|
66636
|
-
const remove2 = this.db.prepare("DELETE FROM sources WHERE id=?");
|
|
66637
|
-
for (const id3 of retired) remove2.run(id3);
|
|
66768
|
+
this.retireSources(["reasonix", "trae", "warp", "lm-studio", "hindsight"]);
|
|
66638
66769
|
this.db.exec("PRAGMA user_version=6; COMMIT");
|
|
66639
66770
|
} catch (error62) {
|
|
66640
66771
|
this.db.exec("ROLLBACK");
|
|
@@ -66664,8 +66795,30 @@ var SessionGraphStore = class {
|
|
|
66664
66795
|
throw error62;
|
|
66665
66796
|
}
|
|
66666
66797
|
}
|
|
66798
|
+
if (version2 < 9) {
|
|
66799
|
+
this.db.exec("BEGIN IMMEDIATE");
|
|
66800
|
+
try {
|
|
66801
|
+
this.retireSources(["antigravity", "minimax-code"]);
|
|
66802
|
+
this.db.exec("PRAGMA user_version=9; COMMIT");
|
|
66803
|
+
} catch (error62) {
|
|
66804
|
+
this.db.exec("ROLLBACK");
|
|
66805
|
+
throw error62;
|
|
66806
|
+
}
|
|
66807
|
+
}
|
|
66667
66808
|
if (!this.setting("libraryID")) this.setting("libraryID", randomUUID2());
|
|
66668
66809
|
}
|
|
66810
|
+
/** Drops selections, custom paths, status records and active filters for removed sources. */
|
|
66811
|
+
retireSources(ids) {
|
|
66812
|
+
const retired = new Set(ids);
|
|
66813
|
+
const selected = this.setting("selected");
|
|
66814
|
+
if (selected) this.setting("selected", selected.filter((id3) => !retired.has(id3)));
|
|
66815
|
+
const paths2 = this.setting("sourcePaths");
|
|
66816
|
+
if (paths2) this.setting("sourcePaths", Object.fromEntries(Object.entries(paths2).filter(([id3]) => !retired.has(id3))));
|
|
66817
|
+
const view = this.setting("viewState");
|
|
66818
|
+
if (view && typeof view.sourceID === "string" && retired.has(view.sourceID)) this.setting("viewState", { ...view, sourceID: "" });
|
|
66819
|
+
const remove2 = this.db.prepare("DELETE FROM sources WHERE id=?");
|
|
66820
|
+
for (const id3 of retired) remove2.run(id3);
|
|
66821
|
+
}
|
|
66669
66822
|
setting(key, value) {
|
|
66670
66823
|
if (value !== void 0) this.db.prepare("INSERT INTO settings VALUES (?, ?) ON CONFLICT(key) DO UPDATE SET value=excluded.value").run(key, JSON.stringify(value));
|
|
66671
66824
|
const row = this.db.prepare("SELECT value FROM settings WHERE key=?").get(key);
|
|
@@ -66996,33 +67149,33 @@ var SessionGraphStore = class {
|
|
|
66996
67149
|
const rows2 = this.db.prepare("SELECT id,data FROM search_cache WHERE id>? ORDER BY id LIMIT 51").all(after);
|
|
66997
67150
|
const records = [];
|
|
66998
67151
|
for (const row of rows2.slice(0, 50)) {
|
|
66999
|
-
const
|
|
67000
|
-
if (validRecord(
|
|
67152
|
+
const record3 = JSON.parse(String(row.data));
|
|
67153
|
+
if (validRecord(record3, this.getSession(String(row.id)))) records.push(record3);
|
|
67001
67154
|
else this.db.prepare("DELETE FROM search_cache WHERE id=?").run(row.id);
|
|
67002
67155
|
}
|
|
67003
67156
|
return { records, cursor: rows2.length > 50 ? String(rows2[49].id) : void 0, epoch: this.setting("indexEpoch") || 0 };
|
|
67004
67157
|
}
|
|
67005
|
-
saveCheckpoint(
|
|
67158
|
+
saveCheckpoint(record3, epoch) {
|
|
67006
67159
|
this.db.exec("BEGIN IMMEDIATE");
|
|
67007
67160
|
try {
|
|
67008
|
-
if (epoch !== (this.setting("indexEpoch") || 0) || !validRecord(
|
|
67161
|
+
if (epoch !== (this.setting("indexEpoch") || 0) || !validRecord(record3, this.getSession(record3.id))) {
|
|
67009
67162
|
this.db.exec("ROLLBACK");
|
|
67010
67163
|
return false;
|
|
67011
67164
|
}
|
|
67012
|
-
const total = Number(this.db.prepare("SELECT COALESCE(SUM(characters),0) AS n FROM search_cache WHERE id<>?").get(
|
|
67013
|
-
if (total +
|
|
67165
|
+
const total = Number(this.db.prepare("SELECT COALESCE(SUM(characters),0) AS n FROM search_cache WHERE id<>?").get(record3.id).n);
|
|
67166
|
+
if (total + record3.characters > MAX_CHARACTERS) {
|
|
67014
67167
|
this.db.exec("ROLLBACK");
|
|
67015
67168
|
return false;
|
|
67016
67169
|
}
|
|
67017
|
-
const previous = this.db.prepare("SELECT data FROM search_cache WHERE id=?").get(
|
|
67170
|
+
const previous = this.db.prepare("SELECT data FROM search_cache WHERE id=?").get(record3.id);
|
|
67018
67171
|
if (previous) {
|
|
67019
67172
|
const old = JSON.parse(String(previous.data));
|
|
67020
|
-
if (old.version ===
|
|
67173
|
+
if (old.version === record3.version && old.pages > record3.pages) {
|
|
67021
67174
|
this.db.exec("ROLLBACK");
|
|
67022
67175
|
return false;
|
|
67023
67176
|
}
|
|
67024
67177
|
}
|
|
67025
|
-
this.db.prepare("INSERT INTO search_cache (id,data,characters) VALUES (?,?,?) ON CONFLICT(id) DO UPDATE SET data=excluded.data,characters=excluded.characters").run(
|
|
67178
|
+
this.db.prepare("INSERT INTO search_cache (id,data,characters) VALUES (?,?,?) ON CONFLICT(id) DO UPDATE SET data=excluded.data,characters=excluded.characters").run(record3.id, JSON.stringify(record3), record3.characters);
|
|
67026
67179
|
this.db.exec("COMMIT");
|
|
67027
67180
|
return true;
|
|
67028
67181
|
} catch (error62) {
|
|
@@ -69558,8 +69711,8 @@ var LibraryService = class {
|
|
|
69558
69711
|
if (plan2.error) invalid(plan2.error);
|
|
69559
69712
|
return this.snapshot(() => {
|
|
69560
69713
|
const { sessions, projects } = this.sessions(filters4);
|
|
69561
|
-
const
|
|
69562
|
-
const indexKey = fingerprint([filters4,
|
|
69714
|
+
const generation2 = [this.store.db.prepare("PRAGMA data_version").get(), this.store.db.prepare("SELECT total_changes() AS n").get()];
|
|
69715
|
+
const indexKey = fingerprint([filters4, generation2]);
|
|
69563
69716
|
if (this.searchCache?.key !== indexKey) {
|
|
69564
69717
|
this.searchCache = void 0;
|
|
69565
69718
|
const index2 = new SessionSearchIndex();
|