sessiongraph-app-darwin-arm64 1.0.26 → 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 +210 -46
- package/payload/SessionGraph.app/Contents/Resources/resources/server.mjs +236 -81
- 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
|
@@ -2413,16 +2413,16 @@ async function publish(file, info, handoff) {
|
|
|
2413
2413
|
await rename(temporary, file + ".pty-handoff").finally(() => rm(temporary, { force: true }));
|
|
2414
2414
|
}
|
|
2415
2415
|
async function environment2(file, env2) {
|
|
2416
|
-
const
|
|
2416
|
+
const record2 = await read(file);
|
|
2417
2417
|
const current = await readFile(file, "utf8").then((text2) => JSON.parse(text2)).catch(() => {
|
|
2418
2418
|
return;
|
|
2419
2419
|
});
|
|
2420
|
-
const handoff =
|
|
2420
|
+
const handoff = record2 !== void 0 && record2.expiresAt > Date.now() && (current === void 0 || same(record2.source, current)) ? record2.handoff : void 0;
|
|
2421
2421
|
return { ...env2, OPENCODE_PTY_HANDOFF: handoff == null ? void 0 : JSON.stringify(handoff) };
|
|
2422
2422
|
}
|
|
2423
2423
|
async function complete2(file, info) {
|
|
2424
|
-
const
|
|
2425
|
-
if (
|
|
2424
|
+
const record2 = await read(file);
|
|
2425
|
+
if (record2 !== void 0 && !same(record2.source, info))
|
|
2426
2426
|
await clear2(file);
|
|
2427
2427
|
}
|
|
2428
2428
|
async function clear2(file) {
|
|
@@ -31187,7 +31187,7 @@ function piHistory(value) {
|
|
|
31187
31187
|
nativeID: header.id,
|
|
31188
31188
|
messages,
|
|
31189
31189
|
partial,
|
|
31190
|
-
session: { directory: text(header.cwd), created: time(header.timestamp), title: text([...rows2].reverse().find((r) => r.type === "session_info")?.name), model: text(lastModel?.modelId || lastModel?.message?.model) || "Unknown model", provider: text(lastModel?.provider || lastModel?.message?.provider) },
|
|
31190
|
+
session: { directory: text(header.cwd), created: time(header.timestamp), title: text([...rows2].reverse().find((r) => r.type === "session_info" && text(r.name).trim())?.name).trim(), model: text(lastModel?.modelId || lastModel?.message?.model) || "Unknown model", provider: text(lastModel?.provider || lastModel?.message?.provider) },
|
|
31191
31191
|
note: "Includes all saved branches in this transcript."
|
|
31192
31192
|
};
|
|
31193
31193
|
}
|
|
@@ -31278,7 +31278,7 @@ function jcodeHistory(path, files) {
|
|
|
31278
31278
|
function codebuffHistory(path, files, free) {
|
|
31279
31279
|
const records = json3(files.get(path));
|
|
31280
31280
|
if (!Array.isArray(records)) throw new Error("Unsupported Codebuff chat.");
|
|
31281
|
-
const isFree = records.some((m) => text(m.metadata?.runState?.sessionState?.mainAgentState?.agentType).
|
|
31281
|
+
const isFree = records.some((m) => text(m.metadata?.runState?.sessionState?.mainAgentState?.agentType).split("-").includes("free"));
|
|
31282
31282
|
if (isFree !== free) return;
|
|
31283
31283
|
const messages = records.flatMap((r, i) => {
|
|
31284
31284
|
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);
|
|
@@ -31830,6 +31830,7 @@ function codexRecord(raw, offset, candidate) {
|
|
|
31830
31830
|
if (!p || typeof p !== "object") return;
|
|
31831
31831
|
if (raw.type === "session_meta" || raw.type === "turn_context") candidate.locator.executionCwd = typeof p.cwd === "string" ? p.cwd : "";
|
|
31832
31832
|
if (raw.type === "turn_context" && typeof p.model === "string") candidate.session.model = p.model;
|
|
31833
|
+
if (raw.type === "world_state" && typeof p.state?.model === "string" && p.state.model && candidate.session.model === "Unknown model") candidate.session.model = p.state.model;
|
|
31833
31834
|
if (raw.type === "event_msg" && p.type === "item_completed" && ["FileChange", "fileChange"].includes(p.item?.type)) {
|
|
31834
31835
|
const msg2 = blankMessage(`event:${p.item.id || raw.ordinal || offset}`, p.completed_at_ms || Date.parse(raw.timestamp) || 0, "tool");
|
|
31835
31836
|
msg2.events = [eventFor(msg2, "change", "event", "File-change result", eventText(p.item), { nativeType: p.type, status: ["completed", "Completed"].includes(p.item.status) ? "completed" : "unknown" })];
|
|
@@ -33428,7 +33429,8 @@ var continueAdapter = localFileAdapter({
|
|
|
33428
33429
|
});
|
|
33429
33430
|
|
|
33430
33431
|
// server/adapters/harness-files.ts
|
|
33431
|
-
import {
|
|
33432
|
+
import { readdirSync as readdirSync3 } from "node:fs";
|
|
33433
|
+
import { basename as basename11, dirname as dirname10, join as join24 } from "node:path";
|
|
33432
33434
|
|
|
33433
33435
|
// server/adapters/harness-extra-formats.ts
|
|
33434
33436
|
import { basename as basename9, dirname as dirname8, join as join22 } from "node:path";
|
|
@@ -33508,23 +33510,163 @@ function devinDesktopHistory(path, files) {
|
|
|
33508
33510
|
return acpHistory(path, normalized.map((r) => JSON.stringify(r)).join("\n"));
|
|
33509
33511
|
}
|
|
33510
33512
|
|
|
33513
|
+
// server/adapters/minimax.ts
|
|
33514
|
+
import { readdirSync as readdirSync2, realpathSync as realpathSync2, statSync as statSync2 } from "node:fs";
|
|
33515
|
+
import { basename as basename10, dirname as dirname9, join as join23 } from "node:path";
|
|
33516
|
+
var bases = [".minimax", ".mavis"];
|
|
33517
|
+
var SNAPSHOT_BUDGET = 24e6;
|
|
33518
|
+
function minimaxRoots() {
|
|
33519
|
+
const override = process.env.MINIMAX_DATA_DIR?.trim() || process.env.MAVIS_DATA_DIR?.trim();
|
|
33520
|
+
let dirs = override ? [override] : bases.map((b) => homePath(b));
|
|
33521
|
+
if (!override) {
|
|
33522
|
+
try {
|
|
33523
|
+
dirs.push(...readdirSync2(homePath()).filter((n) => bases.some((b) => n.startsWith(`${b}-`) && n.length > b.length + 1)).sort().map((n) => homePath(n)));
|
|
33524
|
+
} catch {
|
|
33525
|
+
}
|
|
33526
|
+
}
|
|
33527
|
+
const seen = /* @__PURE__ */ new Set();
|
|
33528
|
+
return dirs.map((d) => join23(d, "v2", "sessions")).filter((root2) => {
|
|
33529
|
+
let key = root2;
|
|
33530
|
+
try {
|
|
33531
|
+
key = realpathSync2(root2);
|
|
33532
|
+
} catch {
|
|
33533
|
+
}
|
|
33534
|
+
return !seen.has(key) && Boolean(seen.add(key));
|
|
33535
|
+
});
|
|
33536
|
+
}
|
|
33537
|
+
var minimaxNative = (path) => /(?:^|\/)[^/]*session_[^/]+\/messages\.jsonl$/.test(path);
|
|
33538
|
+
var generation = (name) => Number(/^g(\d+)--/.exec(name)?.[1] ?? Infinity);
|
|
33539
|
+
function snapshotFiles2(path) {
|
|
33540
|
+
const dir = join23(dirname9(path), "snapshots");
|
|
33541
|
+
try {
|
|
33542
|
+
return readdirSync2(dir).filter((n) => n.endsWith(".jsonl")).sort((a, b) => generation(a) - generation(b) || a.localeCompare(b)).map((n) => join23(dir, n));
|
|
33543
|
+
} catch {
|
|
33544
|
+
return [];
|
|
33545
|
+
}
|
|
33546
|
+
}
|
|
33547
|
+
function minimaxExtras(path) {
|
|
33548
|
+
const dir = dirname9(path);
|
|
33549
|
+
let budget2 = SNAPSHOT_BUDGET;
|
|
33550
|
+
try {
|
|
33551
|
+
budget2 -= statSync2(path).size;
|
|
33552
|
+
} catch {
|
|
33553
|
+
}
|
|
33554
|
+
const kept = [];
|
|
33555
|
+
for (const file of snapshotFiles2(path).reverse()) {
|
|
33556
|
+
let size = 0;
|
|
33557
|
+
try {
|
|
33558
|
+
size = statSync2(file).size;
|
|
33559
|
+
} catch {
|
|
33560
|
+
continue;
|
|
33561
|
+
}
|
|
33562
|
+
if (size > budget2) break;
|
|
33563
|
+
budget2 -= size;
|
|
33564
|
+
kept.unshift(file);
|
|
33565
|
+
}
|
|
33566
|
+
return [join23(dir, "manifest.json"), ...kept];
|
|
33567
|
+
}
|
|
33568
|
+
function minimaxFolderID(path) {
|
|
33569
|
+
const encoded = /session_([A-Za-z0-9_-]+)$/.exec(basename10(dirname9(path)))?.[1];
|
|
33570
|
+
if (!encoded) return "";
|
|
33571
|
+
const decoded = Buffer.from(encoded, "base64url").toString("utf8");
|
|
33572
|
+
return /^[\x21-\x7e]{1,256}$/.test(decoded) ? decoded : encoded;
|
|
33573
|
+
}
|
|
33574
|
+
var runtime;
|
|
33575
|
+
function runtimeSession(path, nativeID) {
|
|
33576
|
+
const sessions = dirname9(dirname9(dirname9(dirname9(dirname9(path))))), v22 = dirname9(sessions);
|
|
33577
|
+
if (basename10(sessions) !== "sessions" || basename10(v22) !== "v2") return;
|
|
33578
|
+
const db2 = join23(v22, "sqlite", "runtime-state.sqlite");
|
|
33579
|
+
try {
|
|
33580
|
+
const revision2 = sqliteRevision(db2);
|
|
33581
|
+
if (runtime?.path !== db2 || runtime.revision !== revision2) {
|
|
33582
|
+
runtime = { path: db2, revision: revision2, sessions: withSqliteSnapshot(db2, (d) => {
|
|
33583
|
+
const rows2 = /* @__PURE__ */ new Map();
|
|
33584
|
+
if (!hasTable(d, "local_runtime_sessions")) return rows2;
|
|
33585
|
+
const columns2 = new Set(d.prepare("PRAGMA table_info(local_runtime_sessions)").all().map((c) => String(c.name)));
|
|
33586
|
+
const pick = (name) => columns2.has(name) ? name : "NULL";
|
|
33587
|
+
if (!columns2.has("session_id")) return rows2;
|
|
33588
|
+
const workspace = `CASE WHEN ${pick("is_default_workspace")} = 1 THEN NULL ELSE COALESCE(NULLIF(${pick("project_workspace_dir")}, ''), ${pick("workspace_dir")}) END`;
|
|
33589
|
+
for (const r of d.prepare(`SELECT session_id, ${pick("title")} AS title, ${workspace} AS directory, ${pick("parent_session_id")} AS parent FROM local_runtime_sessions LIMIT 100000`).all())
|
|
33590
|
+
if (text(r.session_id)) rows2.set(text(r.session_id), { title: text(r.title).trim(), directory: text(r.directory), parent: text(r.parent) });
|
|
33591
|
+
return rows2;
|
|
33592
|
+
}, revision2) };
|
|
33593
|
+
}
|
|
33594
|
+
return runtime.sessions.get(nativeID);
|
|
33595
|
+
} catch {
|
|
33596
|
+
return;
|
|
33597
|
+
}
|
|
33598
|
+
}
|
|
33599
|
+
var minimaxTime = (v3) => typeof v3 === "number" && v3 > 0 && v3 < 1e11 ? seconds(v3) : time(v3);
|
|
33600
|
+
function record(r, i) {
|
|
33601
|
+
const body2 = object3(r.message), id2 = text(r.message_id) || text(body2.id) || `record:${i}`, at2 = minimaxTime(body2.timestamp ?? r.timestamp);
|
|
33602
|
+
if (body2.role === "compactionSummary" || body2.archonCompaction) return recordEvent(r, id2, "Compaction summary", at2, body2.summary ?? body2.content);
|
|
33603
|
+
const content = body2.role === "user" && typeof body2.genuineUserQueryText === "string" ? body2.genuineUserQueryText : body2.content;
|
|
33604
|
+
return message({ ...body2, id: id2, content }, id2, at2);
|
|
33605
|
+
}
|
|
33606
|
+
function minimaxHistory(path, files) {
|
|
33607
|
+
const manifestPath = join23(dirname9(path), "manifest.json");
|
|
33608
|
+
const manifest = object3(files.has(manifestPath) ? json3(files.get(manifestPath)) : void 0);
|
|
33609
|
+
const nativeID = text(manifest.sessionId) || minimaxFolderID(path);
|
|
33610
|
+
if (!nativeID) throw new Error("MiniMax session has no native identity.");
|
|
33611
|
+
const snapshots = [...files.keys()].filter((f) => dirname9(f) === join23(dirname9(path), "snapshots"));
|
|
33612
|
+
const omitted = snapshotFiles2(path).length > snapshots.length;
|
|
33613
|
+
const byID = /* @__PURE__ */ new Map(), rows2 = [];
|
|
33614
|
+
let partial = false;
|
|
33615
|
+
for (const file of [...snapshots, path]) {
|
|
33616
|
+
const parsed = jsonLines(files.get(file));
|
|
33617
|
+
partial ||= parsed.partial;
|
|
33618
|
+
rows2.push(...parsed.rows);
|
|
33619
|
+
parsed.rows.forEach((r, i) => {
|
|
33620
|
+
const m = record(r, i);
|
|
33621
|
+
if (m && !byID.has(m.id)) byID.set(m.id, m);
|
|
33622
|
+
});
|
|
33623
|
+
}
|
|
33624
|
+
const meta = runtimeSession(path, nativeID);
|
|
33625
|
+
const last2 = [...rows2].reverse().map((r) => object3(r.message)).find((m) => m.role === "assistant" && text(m.model));
|
|
33626
|
+
return {
|
|
33627
|
+
nativeID,
|
|
33628
|
+
messages: [...byID.values()],
|
|
33629
|
+
partial: partial || omitted,
|
|
33630
|
+
parent: meta?.parent || void 0,
|
|
33631
|
+
session: { created: minimaxTime(manifest.createdAtMs), title: meta?.title, directory: meta?.directory, model: text(last2?.model) || "Unknown model", provider: text(last2?.provider) },
|
|
33632
|
+
note: omitted ? "The oldest compacted history exceeds the snapshot size limit and is summarized, not imported." : partial ? "Some transcript records could not be imported." : void 0
|
|
33633
|
+
};
|
|
33634
|
+
}
|
|
33635
|
+
|
|
33511
33636
|
// server/adapters/harness-files.ts
|
|
33512
33637
|
var piParse = (path, files) => piHistory(files.get(path));
|
|
33513
33638
|
var jsonl = (path) => path.endsWith(".jsonl");
|
|
33639
|
+
var claudeStyle = (path) => jsonl(path) && !path.endsWith(".checkpoints.jsonl") && !(path.includes("subagents/") && basename11(path) === "journal.jsonl");
|
|
33640
|
+
function claudeStyleHistory(path, files) {
|
|
33641
|
+
const history = envelopeHistory(path, files.get(path));
|
|
33642
|
+
const agent = /^agent-(.+)\.jsonl$/.exec(basename11(path))?.[1];
|
|
33643
|
+
if (!agent || basename11(dirname10(path)) !== "subagents") return history;
|
|
33644
|
+
const recorded = jsonLines(files.get(path)).rows.map((r) => text(r.agentId)).find(Boolean) || agent;
|
|
33645
|
+
history.parent = history.nativeID;
|
|
33646
|
+
history.nativeID = `${history.nativeID}/agent/${recorded}`;
|
|
33647
|
+
return history;
|
|
33648
|
+
}
|
|
33514
33649
|
var piSources = [
|
|
33515
33650
|
{ 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")] },
|
|
33516
33651
|
{ id: "omp", name: "Oh My Pi", roots: () => [envHome("PI_CODING_AGENT_DIR_OMP", ".omp/agent", "sessions")] },
|
|
33517
|
-
{ id: "senpi", name: "Senpi / OmO Native", roots: () => [envHome("SENPI_CODING_AGENT_DIR", ".senpi/agent", "sessions"), homePath(".omo/agent/sessions")] },
|
|
33518
|
-
{ id: "kimchi", name: "Kimchi", roots: () => [
|
|
33519
|
-
{ id: "gajae", name: "Gajae-Code", roots: () => [
|
|
33652
|
+
{ id: "senpi", name: "Senpi / OmO Native", roots: () => [envHome("SENPI_CODING_AGENT_DIR", ".senpi/agent", "sessions"), homePath(".omo/agent/sessions"), ...omoChildRoots()] },
|
|
33653
|
+
{ id: "kimchi", name: "Kimchi", roots: () => [join24(process.env.KIMCHI_CODING_AGENT_DIR || configPath("kimchi/harness"), "sessions")] },
|
|
33654
|
+
{ 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")] }
|
|
33520
33655
|
].map((s) => ({ ...s, parse: piParse }));
|
|
33656
|
+
var omoChildRoots = () => [[".omo/agent/projects", "senpi-task/children"], [".omo/memory/agents", "runtime/transcripts"]].flatMap(([parent2, child]) => {
|
|
33657
|
+
try {
|
|
33658
|
+
return readdirSync3(homePath(parent2), { withFileTypes: true }).filter((e10) => e10.isDirectory()).map((e10) => homePath(parent2, e10.name, child));
|
|
33659
|
+
} catch {
|
|
33660
|
+
return [];
|
|
33661
|
+
}
|
|
33662
|
+
});
|
|
33521
33663
|
var openclawRoots = () => [envHome("OPENCLAW_STATE_DIR", ".openclaw", "agents"), ...[".clawdbot", ".moltbot", ".moldbot"].map((p) => homePath(p, "agents"))];
|
|
33522
33664
|
var promaRoots = () => [".proma", ".proma-dev"].flatMap((p) => ["agent-sessions", "sdk-config/sessions", "sdk-config/projects"].map((s) => homePath(p, s)));
|
|
33523
33665
|
function kimiHistory(path, files) {
|
|
33524
33666
|
const { rows: rows2 } = jsonLines(files.get(path));
|
|
33525
|
-
const folder =
|
|
33526
|
-
const nativeID = agent ? `${
|
|
33527
|
-
const wire =
|
|
33667
|
+
const folder = dirname10(path), id2 = basename11(folder), agent = basename11(dirname10(folder)) === "agents";
|
|
33668
|
+
const nativeID = agent ? `${basename11(dirname10(dirname10(folder)))}/agent/${id2}` : id2;
|
|
33669
|
+
const wire = join24(folder, "wire.jsonl"), wireRows = files.has(wire) ? jsonLines(files.get(wire)).rows : [];
|
|
33528
33670
|
const messages = rows2.flatMap((r, i) => {
|
|
33529
33671
|
const m = message(r, nativeText(r.id) || `context:${i}`);
|
|
33530
33672
|
return m ? [m] : [];
|
|
@@ -33543,7 +33685,7 @@ function museHistory(path, files) {
|
|
|
33543
33685
|
const meta = rows2.find((r) => r.payload_type === "runtime.session.metadata");
|
|
33544
33686
|
const ids = new Set(rows2.map((r) => text(r.stream?.id)).filter(Boolean));
|
|
33545
33687
|
if (!meta || ids.size > 1) throw new Error("Unsupported Muse stream.");
|
|
33546
|
-
const nativeID = [...ids][0] ||
|
|
33688
|
+
const nativeID = [...ids][0] || basename11(dirname10(path));
|
|
33547
33689
|
const messages = rows2.flatMap((r, i) => {
|
|
33548
33690
|
const event = object3(r.payload?.event), body2 = object3(event.message);
|
|
33549
33691
|
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) : time(r.recorded_at);
|
|
@@ -33561,7 +33703,7 @@ function junieHistory(path, files) {
|
|
|
33561
33703
|
return [recordEvent(r, text(r.id) || `event:${i}`, kind, r.timestampMs, e10.text ?? e10.prompt ?? e10.message)];
|
|
33562
33704
|
});
|
|
33563
33705
|
if (!messages.length) throw new Error("No supported Junie events.");
|
|
33564
|
-
return { nativeID:
|
|
33706
|
+
return { nativeID: basename11(dirname10(path)), messages, partial: true, note: "Recorded events only." };
|
|
33565
33707
|
}
|
|
33566
33708
|
function augmentHistory(path, files) {
|
|
33567
33709
|
const r = object3(json3(files.get(path)));
|
|
@@ -33573,7 +33715,7 @@ function augmentHistory(path, files) {
|
|
|
33573
33715
|
return { nativeID: r.sessionId, messages, partial: true, session: { title: text(r.title), created: time(r.created), model: text(r.agentState?.modelId) || "Unknown model" }, note: "Recorded exchanges only." };
|
|
33574
33716
|
}
|
|
33575
33717
|
function fxHistory(path, files) {
|
|
33576
|
-
const usage = object3(json3(files.get(path))), meta = sidecar2(files,
|
|
33718
|
+
const usage = object3(json3(files.get(path))), meta = sidecar2(files, join24(dirname10(path), "session.json"));
|
|
33577
33719
|
const id2 = text(usage.session_id) || text(meta.id);
|
|
33578
33720
|
if (!id2 || !usage.snapshot || meta.id && meta.id !== id2) throw new Error("Unsupported Fx session metadata.");
|
|
33579
33721
|
const snapshot2 = object3(usage.snapshot);
|
|
@@ -33602,18 +33744,19 @@ function fxHistory(path, files) {
|
|
|
33602
33744
|
}
|
|
33603
33745
|
var definitions = [
|
|
33604
33746
|
...piSources,
|
|
33605
|
-
{ 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) => [
|
|
33606
|
-
{ id: "mux", name: "Mux", roots: () => [envHome("MUX_ROOT", ".mux", "sessions")], match: (p) => p.endsWith("/chat.jsonl"), extras: (p) => [
|
|
33747
|
+
{ 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) => [basename11(p) === "session.json" ? join24(dirname10(p), "messages.jsonl") : p.replace(/\.json$/, ".jsonl")], parse: kiroHistory },
|
|
33748
|
+
{ id: "mux", name: "Mux", roots: () => [envHome("MUX_ROOT", ".mux", "sessions")], match: (p) => p.endsWith("/chat.jsonl"), extras: (p) => [join24(dirname10(p), "chat-archive.jsonl"), join24(dirname10(p), "session-usage.json")], parse: muxHistory },
|
|
33607
33749
|
{ id: "devin-desktop", name: "Devin Desktop", roots: () => [appPath("Devin/User/acp-events")], match: (p) => /\.(ndjson|jsonl)$/.test(p), parse: devinDesktopHistory },
|
|
33608
33750
|
{ id: "openclaw", name: "OpenClaw", roots: openclawRoots, match: (p) => /(?:^|\/)sessions\/.*\.jsonl(?:\.[\w.-]+)?$/.test(p) || /session-sqlite-import-archive\/.*\.jsonl\./.test(p), parse: piParse },
|
|
33609
33751
|
{ id: "amp", name: "Amp", roots: () => [dataPath("amp/threads"), tokscalePath("amp-cache/threads")], match: (p) => p.endsWith(".json"), parse: ampHistory },
|
|
33610
33752
|
{ id: "droid", name: "Factory Droid", roots: () => [envHome("FACTORY_HOME", ".factory", "sessions")] },
|
|
33611
33753
|
{ 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) },
|
|
33612
33754
|
{ 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) },
|
|
33613
|
-
{ 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) => [
|
|
33755
|
+
{ 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(dirname10(p), "wire.jsonl")], parse: kimiHistory },
|
|
33614
33756
|
{ 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)) },
|
|
33615
33757
|
{ 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 },
|
|
33616
33758
|
{ id: "cherry-studio", name: "Cherry Studio", roots: () => [appPath("CherryStudio/Data/Agents/.claude/projects"), appPath("CherryStudio/.claude/projects")] },
|
|
33759
|
+
{ id: "qoder", name: "Qoder", roots: () => [envHome("QODER_CONFIG_DIR", ".qoder", "projects"), envHome("QODERCN_CONFIG_DIR", ".qoder-cn", "projects")] },
|
|
33617
33760
|
{ id: "command-code", name: "Command Code", roots: () => [homePath(".commandcode/projects")] },
|
|
33618
33761
|
{ id: "zcode", name: "ZCode", roots: () => [homePath(".zcode/projects")] },
|
|
33619
33762
|
{ id: "codebuddy", name: "CodeBuddy", roots: () => [homePath(".codebuddy/projects")] },
|
|
@@ -33622,14 +33765,25 @@ var definitions = [
|
|
|
33622
33765
|
{ 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)) },
|
|
33623
33766
|
{ id: "aside", name: "Aside", roots: () => [homePath(".aside/u")], match: (p) => /^[^/]+\/sessions\/[^/]+\/messages\.jsonl$/.test(p), parse(p, f) {
|
|
33624
33767
|
const h3 = envelopeHistory(p, f.get(p));
|
|
33625
|
-
h3.nativeID = `${
|
|
33768
|
+
h3.nativeID = `${basename11(dirname10(dirname10(dirname10(p))))}/${basename11(dirname10(p))}`;
|
|
33626
33769
|
return h3;
|
|
33627
33770
|
} },
|
|
33628
|
-
{ id: "vibe", name: "Mistral Vibe", roots: () => [envHome("VIBE_HOME", ".vibe", "logs/session")], match: (p) => p.endsWith("/meta.json") || /^[^/]+\.json$/.test(p), extras: (p) =>
|
|
33771
|
+
{ id: "vibe", name: "Mistral Vibe", roots: () => [envHome("VIBE_HOME", ".vibe", "logs/session")], match: (p) => p.endsWith("/meta.json") || /^[^/]+\.json$/.test(p), extras: (p) => basename11(p) === "meta.json" ? [join24(dirname10(p), "messages.jsonl")] : [], parse: vibeHistory },
|
|
33629
33772
|
{ id: "muse", name: "Muse Code", roots: () => [dataPath("muse/sessions")], match: (p) => p.endsWith("/session.jsonl"), parse: museHistory },
|
|
33630
33773
|
{ 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" },
|
|
33631
33774
|
{ id: "augment", name: "Augment Code", roots: () => [homePath(".augment/sessions")], match: (p) => p.endsWith(".json"), parse: augmentHistory, description: "Local exchange records \xB7 partial conversation coverage" },
|
|
33632
|
-
{ id: "fx", name: "Fx", roots: () => [homePath(".fx/sessions")], match: (p) => p.endsWith("/usage-v2.json"), extras: (p) => [
|
|
33775
|
+
{ id: "fx", name: "Fx", roots: () => [homePath(".fx/sessions")], match: (p) => p.endsWith("/usage-v2.json"), extras: (p) => [join24(dirname10(p), "session.json")], parse: fxHistory, history: false, description: "Session metadata only" },
|
|
33776
|
+
{
|
|
33777
|
+
id: "minimax-code",
|
|
33778
|
+
name: "MiniMax Code",
|
|
33779
|
+
description: "Local runtime transcripts (CLI and desktop)",
|
|
33780
|
+
roots: minimaxRoots,
|
|
33781
|
+
children: true,
|
|
33782
|
+
// Session folders hold other JSONL logs (ledger, display, snapshots); only messages.jsonl is the transcript.
|
|
33783
|
+
match: minimaxNative,
|
|
33784
|
+
extras: minimaxExtras,
|
|
33785
|
+
parse: minimaxHistory
|
|
33786
|
+
},
|
|
33633
33787
|
{ id: "opencodereview", name: "OpenCodeReview", roots: () => [homePath(".opencodereview/sessions")], parse(p, f) {
|
|
33634
33788
|
const { rows: rows2 } = jsonLines(f.get(p)), header = rows2.find((r) => r.type === "session_start");
|
|
33635
33789
|
if (!header) throw new Error("Unsupported review session.");
|
|
@@ -33639,15 +33793,15 @@ var definitions = [
|
|
|
33639
33793
|
var fileHarnessAdapters = definitions.map((source) => localFileAdapter({
|
|
33640
33794
|
...source,
|
|
33641
33795
|
roots: harnessRoots(source.id, source.roots),
|
|
33642
|
-
match: source.match ||
|
|
33796
|
+
match: source.match || claudeStyle,
|
|
33643
33797
|
description: source.description || "Local session transcripts",
|
|
33644
|
-
capabilities: { history: source.history !== false, forks: false, children:
|
|
33645
|
-
parse: source.parse ||
|
|
33798
|
+
capabilities: { history: source.history !== false, forks: false, children: source.children === true || !source.parse, files: false },
|
|
33799
|
+
parse: source.parse || claudeStyleHistory
|
|
33646
33800
|
}));
|
|
33647
33801
|
|
|
33648
33802
|
// server/adapters/harness-databases.ts
|
|
33649
33803
|
import { lstat as lstat9, readFile as readFile4 } from "node:fs/promises";
|
|
33650
|
-
import { isAbsolute as isAbsolute5, join as
|
|
33804
|
+
import { isAbsolute as isAbsolute5, join as join25 } from "node:path";
|
|
33651
33805
|
function hermesContent(value) {
|
|
33652
33806
|
if (typeof value !== "string" || !value.startsWith("\0json:")) return value;
|
|
33653
33807
|
try {
|
|
@@ -33727,7 +33881,7 @@ var hermes = {
|
|
|
33727
33881
|
var goose = {
|
|
33728
33882
|
id: "goose",
|
|
33729
33883
|
name: "Goose",
|
|
33730
|
-
paths: dbPaths("goose", () => process.env.GOOSE_PATH_ROOT && isAbsolute5(process.env.GOOSE_PATH_ROOT) ? [
|
|
33884
|
+
paths: dbPaths("goose", () => process.env.GOOSE_PATH_ROOT && isAbsolute5(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")),
|
|
33731
33885
|
table: "sessions",
|
|
33732
33886
|
key: "id",
|
|
33733
33887
|
fields: [
|
|
@@ -33821,7 +33975,7 @@ function forkStore(id2, name, defaultPath, desktop) {
|
|
|
33821
33975
|
var zed = {
|
|
33822
33976
|
id: "zed",
|
|
33823
33977
|
name: "Zed Agent",
|
|
33824
|
-
paths: dbPaths("zed", () => [process.platform === "darwin" ? appPath("Zed/threads/threads.db") : process.platform === "win32" ?
|
|
33978
|
+
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")),
|
|
33825
33979
|
table: "threads",
|
|
33826
33980
|
key: "id",
|
|
33827
33981
|
fields: ["id", "summary", "created_at", "updated_at", "data_type", "data", "folder_paths"],
|
|
@@ -33870,7 +34024,7 @@ var crush = {
|
|
|
33870
34024
|
paths: async () => {
|
|
33871
34025
|
const override = sourcePath("crush") || process.env.SESSIONGRAPH_CRUSH_HISTORY_DIR;
|
|
33872
34026
|
if (override) return (await historyFiles([override], (p) => p.endsWith("crush.db"))).files;
|
|
33873
|
-
const registry =
|
|
34027
|
+
const registry = join25(process.env.CRUSH_GLOBAL_DATA || dataPath("crush"), "projects.json");
|
|
33874
34028
|
try {
|
|
33875
34029
|
const stat6 = await lstat9(registry);
|
|
33876
34030
|
if (!stat6.isFile() || stat6.size > 2e6) throw new Error("Unsupported Crush registry.");
|
|
@@ -33878,7 +34032,7 @@ var crush = {
|
|
|
33878
34032
|
const paths2 = [];
|
|
33879
34033
|
for (const p of Array.isArray(raw.projects) ? raw.projects.slice(0, 2e4) : []) {
|
|
33880
34034
|
if (!isAbsolute5(text(p.path)) || !text(p.data_dir)) continue;
|
|
33881
|
-
const path =
|
|
34035
|
+
const path = join25(isAbsolute5(p.data_dir) ? p.data_dir : join25(p.path, p.data_dir), "crush.db");
|
|
33882
34036
|
paths2.push(path);
|
|
33883
34037
|
crushDirectories.set(path, p.path);
|
|
33884
34038
|
}
|
|
@@ -33996,7 +34150,7 @@ var databaseHarnessAdapters = [
|
|
|
33996
34150
|
].map(sqliteHistoryAdapter);
|
|
33997
34151
|
|
|
33998
34152
|
// server/adapters/harness-metadata.ts
|
|
33999
|
-
import { basename as
|
|
34153
|
+
import { basename as basename12 } from "node:path";
|
|
34000
34154
|
import { fileURLToPath as fileURLToPath4 } from "node:url";
|
|
34001
34155
|
function protoFields(value) {
|
|
34002
34156
|
if (value.length > 2e6) throw new Error("Trajectory metadata exceeds 2 MB.");
|
|
@@ -34052,7 +34206,7 @@ var antigravityDatabaseAdapters = ["antigravity-cli", "antigravity-extension"].m
|
|
|
34052
34206
|
}
|
|
34053
34207
|
}
|
|
34054
34208
|
if (!created) throw new Error("Trajectory creation time is unavailable.");
|
|
34055
|
-
return { nativeID:
|
|
34209
|
+
return { nativeID: basename12(path, ".db"), messages: [], partial: true, session: { created, directory: directory3 }, note: "Session metadata only." };
|
|
34056
34210
|
}
|
|
34057
34211
|
}));
|
|
34058
34212
|
|
|
@@ -34065,7 +34219,7 @@ var adapters = [opencodeAdapter, claudeAdapter, codexAdapter, t3CodeAdapter, cur
|
|
|
34065
34219
|
// server/store.ts
|
|
34066
34220
|
import { DatabaseSync as DatabaseSync3 } from "node:sqlite";
|
|
34067
34221
|
import { mkdirSync as mkdirSync2, chmodSync as chmodSync3 } from "node:fs";
|
|
34068
|
-
import { dirname as
|
|
34222
|
+
import { dirname as dirname11 } from "node:path";
|
|
34069
34223
|
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
34070
34224
|
|
|
34071
34225
|
// src/search/persistence.ts
|
|
@@ -34626,7 +34780,7 @@ var SessionGraphStore = class {
|
|
|
34626
34780
|
this.path = path;
|
|
34627
34781
|
let db2;
|
|
34628
34782
|
try {
|
|
34629
|
-
if (path !== ":memory:") mkdirSync2(
|
|
34783
|
+
if (path !== ":memory:") mkdirSync2(dirname11(path), { recursive: true, mode: 448 });
|
|
34630
34784
|
this.db = db2 = new DatabaseSync3(path);
|
|
34631
34785
|
this.db.exec("PRAGMA busy_timeout=5000;");
|
|
34632
34786
|
const version = Number(this.db.prepare("PRAGMA user_version").get().user_version);
|
|
@@ -35091,33 +35245,33 @@ var SessionGraphStore = class {
|
|
|
35091
35245
|
const rows2 = this.db.prepare("SELECT id,data FROM search_cache WHERE id>? ORDER BY id LIMIT 51").all(after);
|
|
35092
35246
|
const records = [];
|
|
35093
35247
|
for (const row of rows2.slice(0, 50)) {
|
|
35094
|
-
const
|
|
35095
|
-
if (validRecord(
|
|
35248
|
+
const record2 = JSON.parse(String(row.data));
|
|
35249
|
+
if (validRecord(record2, this.getSession(String(row.id)))) records.push(record2);
|
|
35096
35250
|
else this.db.prepare("DELETE FROM search_cache WHERE id=?").run(row.id);
|
|
35097
35251
|
}
|
|
35098
35252
|
return { records, cursor: rows2.length > 50 ? String(rows2[49].id) : void 0, epoch: this.setting("indexEpoch") || 0 };
|
|
35099
35253
|
}
|
|
35100
|
-
saveCheckpoint(
|
|
35254
|
+
saveCheckpoint(record2, epoch) {
|
|
35101
35255
|
this.db.exec("BEGIN IMMEDIATE");
|
|
35102
35256
|
try {
|
|
35103
|
-
if (epoch !== (this.setting("indexEpoch") || 0) || !validRecord(
|
|
35257
|
+
if (epoch !== (this.setting("indexEpoch") || 0) || !validRecord(record2, this.getSession(record2.id))) {
|
|
35104
35258
|
this.db.exec("ROLLBACK");
|
|
35105
35259
|
return false;
|
|
35106
35260
|
}
|
|
35107
|
-
const total = Number(this.db.prepare("SELECT COALESCE(SUM(characters),0) AS n FROM search_cache WHERE id<>?").get(
|
|
35108
|
-
if (total +
|
|
35261
|
+
const total = Number(this.db.prepare("SELECT COALESCE(SUM(characters),0) AS n FROM search_cache WHERE id<>?").get(record2.id).n);
|
|
35262
|
+
if (total + record2.characters > MAX_CHARACTERS) {
|
|
35109
35263
|
this.db.exec("ROLLBACK");
|
|
35110
35264
|
return false;
|
|
35111
35265
|
}
|
|
35112
|
-
const previous = this.db.prepare("SELECT data FROM search_cache WHERE id=?").get(
|
|
35266
|
+
const previous = this.db.prepare("SELECT data FROM search_cache WHERE id=?").get(record2.id);
|
|
35113
35267
|
if (previous) {
|
|
35114
35268
|
const old = JSON.parse(String(previous.data));
|
|
35115
|
-
if (old.version ===
|
|
35269
|
+
if (old.version === record2.version && old.pages > record2.pages) {
|
|
35116
35270
|
this.db.exec("ROLLBACK");
|
|
35117
35271
|
return false;
|
|
35118
35272
|
}
|
|
35119
35273
|
}
|
|
35120
|
-
this.db.prepare("INSERT INTO search_cache (id,data,characters) VALUES (?,?,?) ON CONFLICT(id) DO UPDATE SET data=excluded.data,characters=excluded.characters").run(
|
|
35274
|
+
this.db.prepare("INSERT INTO search_cache (id,data,characters) VALUES (?,?,?) ON CONFLICT(id) DO UPDATE SET data=excluded.data,characters=excluded.characters").run(record2.id, JSON.stringify(record2), record2.characters);
|
|
35121
35275
|
this.db.exec("COMMIT");
|
|
35122
35276
|
return true;
|
|
35123
35277
|
} catch (error) {
|
|
@@ -35300,7 +35454,7 @@ var Importer = class {
|
|
|
35300
35454
|
import { execFile, spawn as spawn2 } from "node:child_process";
|
|
35301
35455
|
import { promisify } from "node:util";
|
|
35302
35456
|
import { stat as stat4 } from "node:fs/promises";
|
|
35303
|
-
import { basename as
|
|
35457
|
+
import { basename as basename13, dirname as dirname12, isAbsolute as isAbsolute8 } from "node:path";
|
|
35304
35458
|
|
|
35305
35459
|
// src/launch-links.ts
|
|
35306
35460
|
var HARNESSES = [
|
|
@@ -35336,13 +35490,13 @@ function resumeArgs(value) {
|
|
|
35336
35490
|
import { access, stat as stat3 } from "node:fs/promises";
|
|
35337
35491
|
import { constants as constants6 } from "node:fs";
|
|
35338
35492
|
import { homedir as homedir15 } from "node:os";
|
|
35339
|
-
import { delimiter, isAbsolute as isAbsolute7, join as
|
|
35493
|
+
import { delimiter, isAbsolute as isAbsolute7, join as join26 } from "node:path";
|
|
35340
35494
|
async function executable(name) {
|
|
35341
35495
|
const home = homedir15();
|
|
35342
|
-
const directories = [...(process.env.PATH || "").split(delimiter),
|
|
35343
|
-
if (process.platform === "win32" && process.env.APPDATA) directories.push(
|
|
35344
|
-
if (process.platform === "win32" && process.env.SystemRoot) directories.push(
|
|
35345
|
-
const candidates = isAbsolute7(name) ? [name] : directories.filter((dir) => isAbsolute7(dir)).flatMap((dir) => (process.platform === "win32" ? [".exe", ".cmd", ".bat", ""] : [""]).map((extension) =>
|
|
35496
|
+
const directories = [...(process.env.PATH || "").split(delimiter), join26(home, ".local", "bin"), join26(home, ".opencode", "bin"), join26(home, ".bun", "bin"), join26(home, "Library", "pnpm"), "/opt/homebrew/bin", "/usr/local/bin"];
|
|
35497
|
+
if (process.platform === "win32" && process.env.APPDATA) directories.push(join26(process.env.APPDATA, "npm"));
|
|
35498
|
+
if (process.platform === "win32" && process.env.SystemRoot) directories.push(join26(process.env.SystemRoot, "System32", "WindowsPowerShell", "v1.0"));
|
|
35499
|
+
const candidates = isAbsolute7(name) ? [name] : directories.filter((dir) => isAbsolute7(dir)).flatMap((dir) => (process.platform === "win32" ? [".exe", ".cmd", ".bat", ""] : [""]).map((extension) => join26(dir, name + extension)));
|
|
35346
35500
|
for (const path of candidates) {
|
|
35347
35501
|
try {
|
|
35348
35502
|
if ((await stat3(path)).isFile()) {
|
|
@@ -35358,7 +35512,7 @@ async function harnessExecutable(target) {
|
|
|
35358
35512
|
const path = await executable(name);
|
|
35359
35513
|
if (path) return path;
|
|
35360
35514
|
if (target === "codex" && process.platform === "darwin") {
|
|
35361
|
-
return await executable("/Applications/Codex.app/Contents/Resources/codex") || await executable(
|
|
35515
|
+
return await executable("/Applications/Codex.app/Contents/Resources/codex") || await executable(join26(homedir15(), "Applications/Codex.app/Contents/Resources/codex"));
|
|
35362
35516
|
}
|
|
35363
35517
|
}
|
|
35364
35518
|
async function terminalExecutable() {
|
|
@@ -35384,7 +35538,7 @@ function launchCommand(binary, args, directory3, platform = process.platform) {
|
|
|
35384
35538
|
import { createHash as createHash4, randomUUID as randomUUID3 } from "node:crypto";
|
|
35385
35539
|
import { mkdir, writeFile as writeFile2, rename as rename2, rm as rm4 } from "node:fs/promises";
|
|
35386
35540
|
import { renameSync as renameSync2 } from "node:fs";
|
|
35387
|
-
import { join as
|
|
35541
|
+
import { join as join27 } from "node:path";
|
|
35388
35542
|
function handoffDocument(snapshot2) {
|
|
35389
35543
|
const { session, messages, firstUser, totalMessages } = snapshot2;
|
|
35390
35544
|
if (!messages.length) invalid("Import the conversation before continuing.");
|
|
@@ -35451,9 +35605,9 @@ async function saveHandoff(snapshot2, directory3, store) {
|
|
|
35451
35605
|
const epoch = store?.setting("indexEpoch") || 0;
|
|
35452
35606
|
const { text: text2, ...coverage2 } = handoffDocument(snapshot2);
|
|
35453
35607
|
const digest2 = createHash4("sha256").update(text2).digest("hex");
|
|
35454
|
-
const root2 =
|
|
35608
|
+
const root2 = join27(directory3, "handoffs");
|
|
35455
35609
|
await mkdir(root2, { recursive: true, mode: 448 });
|
|
35456
|
-
const path =
|
|
35610
|
+
const path = join27(root2, `${digest2}.md`), temporary = join27(root2, `.${randomUUID3()}.tmp`);
|
|
35457
35611
|
try {
|
|
35458
35612
|
await writeFile2(temporary, text2, { mode: 384, flag: "wx" });
|
|
35459
35613
|
if (store) {
|
|
@@ -35510,7 +35664,7 @@ async function prepareLaunch(store, session, target, directory3 = session.direct
|
|
|
35510
35664
|
}
|
|
35511
35665
|
const mode = args ? "resume" : "handoff";
|
|
35512
35666
|
if (mode === "handoff" && store.path === ":memory:") invalid("Save this library before creating a context handoff.");
|
|
35513
|
-
const context2 = mode === "handoff" ? await saveHandoff(store.handoff(session.id),
|
|
35667
|
+
const context2 = mode === "handoff" ? await saveHandoff(store.handoff(session.id), dirname12(store.path), store).catch((error) => {
|
|
35514
35668
|
throw storageFailure(error, true) ?? new LibraryError("HANDOFF_FAILED", "Could not save the session handoff.");
|
|
35515
35669
|
}) : void 0;
|
|
35516
35670
|
if (context2) {
|
|
@@ -35529,7 +35683,7 @@ function commandInvocation(command, terminal, platform = process.platform) {
|
|
|
35529
35683
|
const encoded = Buffer.from(command, "utf16le").toString("base64");
|
|
35530
35684
|
return { file: terminal, args: ["-NoProfile", "-NonInteractive", "-Command", `Start-Process powershell.exe -ArgumentList '-NoExit','-NoProfile','-EncodedCommand','${encoded}'`] };
|
|
35531
35685
|
}
|
|
35532
|
-
return { file: terminal, args: [
|
|
35686
|
+
return { file: terminal, args: [basename13(terminal) === "gnome-terminal" ? "--" : "-e", "sh", "-lc", command] };
|
|
35533
35687
|
}
|
|
35534
35688
|
async function launchTerminal(session, prepared) {
|
|
35535
35689
|
if (!prepared.terminalAvailable) invalid("Copy the command and run it in your terminal.");
|
|
@@ -35560,7 +35714,7 @@ async function launchTerminal(session, prepared) {
|
|
|
35560
35714
|
// server/publishing.ts
|
|
35561
35715
|
import { createHash as createHash5, randomBytes } from "node:crypto";
|
|
35562
35716
|
import { chmod, mkdir as mkdir2, readFile as readFile5, rename as rename3, rm as rm5, writeFile as writeFile3 } from "node:fs/promises";
|
|
35563
|
-
import { dirname as
|
|
35717
|
+
import { dirname as dirname13, join as join28 } from "node:path";
|
|
35564
35718
|
|
|
35565
35719
|
// packages/core/src/sources.ts
|
|
35566
35720
|
var sources = {
|
|
@@ -35606,6 +35760,7 @@ var sources = {
|
|
|
35606
35760
|
augment: { name: "Augment Code", icon: "augment" },
|
|
35607
35761
|
fx: { name: "Fx", icon: "fx" },
|
|
35608
35762
|
"minimax-code": { name: "MiniMax Code", icon: "minimax" },
|
|
35763
|
+
qoder: { name: "Qoder", icon: "generic" },
|
|
35609
35764
|
opencodereview: { name: "OpenCodeReview", icon: "opencode" },
|
|
35610
35765
|
goose: { name: "Goose", icon: "goose" },
|
|
35611
35766
|
zed: { name: "Zed Agent", icon: "zed" },
|
|
@@ -35837,7 +35992,7 @@ function preparePublicGraph(store, ids, inputSettings) {
|
|
|
35837
35992
|
}
|
|
35838
35993
|
}
|
|
35839
35994
|
var PublishingClient = class {
|
|
35840
|
-
constructor(credentialPath =
|
|
35995
|
+
constructor(credentialPath = join28(dirname13(databasePath()), "account.json"), fetcher = fetch) {
|
|
35841
35996
|
this.credentialPath = credentialPath;
|
|
35842
35997
|
this.fetcher = fetcher;
|
|
35843
35998
|
}
|
|
@@ -35866,7 +36021,7 @@ var PublishingClient = class {
|
|
|
35866
36021
|
}
|
|
35867
36022
|
}
|
|
35868
36023
|
async save(value) {
|
|
35869
|
-
await mkdir2(
|
|
36024
|
+
await mkdir2(dirname13(this.credentialPath), { recursive: true, mode: 448 });
|
|
35870
36025
|
const temporary = `${this.credentialPath}.${randomBytes(8).toString("hex")}`;
|
|
35871
36026
|
try {
|
|
35872
36027
|
await writeFile3(temporary, JSON.stringify(value), { mode: 384, flag: "wx" });
|
|
@@ -35961,7 +36116,7 @@ var PublishingClient = class {
|
|
|
35961
36116
|
// server/git-checkouts.ts
|
|
35962
36117
|
import { execFile as execFile2 } from "node:child_process";
|
|
35963
36118
|
import { createHash as createHash6 } from "node:crypto";
|
|
35964
|
-
import { basename as
|
|
36119
|
+
import { basename as basename14, isAbsolute as isAbsolute9 } from "node:path";
|
|
35965
36120
|
import { promisify as promisify2 } from "node:util";
|
|
35966
36121
|
var exec2 = promisify2(execFile2);
|
|
35967
36122
|
var cache = /* @__PURE__ */ new Map();
|
|
@@ -36002,7 +36157,7 @@ async function inspect(directory3) {
|
|
|
36002
36157
|
return {
|
|
36003
36158
|
worktree,
|
|
36004
36159
|
repository: createHash6("sha256").update(key).digest("hex"),
|
|
36005
|
-
repositoryLabel: remote?.label || (
|
|
36160
|
+
repositoryLabel: remote?.label || (basename14(common) === ".git" ? basename14(common.slice(0, -5)) : basename14(common))
|
|
36006
36161
|
};
|
|
36007
36162
|
} catch {
|
|
36008
36163
|
return;
|
|
@@ -36030,7 +36185,7 @@ async function annotateGitCheckouts(sessions) {
|
|
|
36030
36185
|
}
|
|
36031
36186
|
|
|
36032
36187
|
// server/library-service.ts
|
|
36033
|
-
import { basename as
|
|
36188
|
+
import { basename as basename16, dirname as dirname14, isAbsolute as isAbsolute10 } from "node:path";
|
|
36034
36189
|
|
|
36035
36190
|
// node_modules/.pnpm/minisearch@7.2.0/node_modules/minisearch/dist/es/index.js
|
|
36036
36191
|
var ENTRIES = "ENTRIES";
|
|
@@ -38019,13 +38174,13 @@ function sampleContent(page2, budget2) {
|
|
|
38019
38174
|
|
|
38020
38175
|
// server/purge-handoffs.ts
|
|
38021
38176
|
import { closeSync as closeSync2, constants as constants7, fstatSync, lstatSync as lstatSync4, openSync as openSync2, opendirSync, readSync as readSync2, unlinkSync as unlinkSync2 } from "node:fs";
|
|
38022
|
-
import { basename as
|
|
38177
|
+
import { basename as basename15, join as join29 } from "node:path";
|
|
38023
38178
|
var MAX_ENTRIES = 2e4;
|
|
38024
38179
|
var HEADER_BYTES = 64 * 1024;
|
|
38025
38180
|
var generatedName = /^(?:[a-f0-9]{64}\.md|\.[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}\.tmp)$/;
|
|
38026
38181
|
var missing = (error) => error.code === "ENOENT";
|
|
38027
38182
|
function findPurgeHandoffs(directory3, sources2, all = false) {
|
|
38028
|
-
const root2 =
|
|
38183
|
+
const root2 = join29(directory3, "handoffs"), paths2 = [], warnings = [], foundSources = /* @__PURE__ */ new Set();
|
|
38029
38184
|
try {
|
|
38030
38185
|
if (!lstatSync4(root2).isDirectory()) return { paths: paths2, sources: [], warnings: ["Handoff cleanup skipped: handoffs is not a regular directory."] };
|
|
38031
38186
|
const entries2 = opendirSync(root2);
|
|
@@ -38041,7 +38196,7 @@ function findPurgeHandoffs(directory3, sources2, all = false) {
|
|
|
38041
38196
|
warnings.push(`Handoff cleanup skipped non-regular file ${entry.name}.`);
|
|
38042
38197
|
continue;
|
|
38043
38198
|
}
|
|
38044
|
-
const path =
|
|
38199
|
+
const path = join29(root2, entry.name);
|
|
38045
38200
|
let fd2;
|
|
38046
38201
|
try {
|
|
38047
38202
|
fd2 = openSync2(path, constants7.O_RDONLY | (constants7.O_NOFOLLOW || 0) | (constants7.O_NONBLOCK || 0));
|
|
@@ -38078,7 +38233,7 @@ function removePurgeHandoffs(paths2) {
|
|
|
38078
38233
|
unlinkSync2(path);
|
|
38079
38234
|
removed++;
|
|
38080
38235
|
} catch (error) {
|
|
38081
|
-
if (!missing(error)) warnings.push(`Could not delete handoff ${
|
|
38236
|
+
if (!missing(error)) warnings.push(`Could not delete handoff ${basename15(path)}. Check permissions and retry purge.`);
|
|
38082
38237
|
}
|
|
38083
38238
|
}
|
|
38084
38239
|
return { removed, warnings };
|
|
@@ -38196,7 +38351,7 @@ var LibraryService = class {
|
|
|
38196
38351
|
this.store.db.exec("BEGIN IMMEDIATE");
|
|
38197
38352
|
let result;
|
|
38198
38353
|
try {
|
|
38199
|
-
const handoffs = this.store.path === ":memory:" ? { paths: [], sources: [], warnings: [] } : findPurgeHandoffs(
|
|
38354
|
+
const handoffs = this.store.path === ":memory:" ? { paths: [], sources: [], warnings: [] } : findPurgeHandoffs(dirname14(this.store.path), ids, options.all);
|
|
38200
38355
|
const known = [.../* @__PURE__ */ new Set([...this.importer.adapters.map((adapter) => adapter.id), ...this.store.savedSources(), ...handoffs.sources])];
|
|
38201
38356
|
for (const id2 of ids) if (!known.includes(id2)) invalid(`Unknown source "${id2}". Run sessiongraph sources list.`);
|
|
38202
38357
|
const sources2 = [...new Set(options.all ? known : ids)];
|
|
@@ -38243,7 +38398,7 @@ var LibraryService = class {
|
|
|
38243
38398
|
title: s.title,
|
|
38244
38399
|
source: s.source,
|
|
38245
38400
|
projectID: s.projectID,
|
|
38246
|
-
projectLabel: names.get(s.projectID) ||
|
|
38401
|
+
projectLabel: names.get(s.projectID) || basename16(s.directory) || "Unknown project",
|
|
38247
38402
|
created: utc(s.created),
|
|
38248
38403
|
lastActivity: utc(sessionEnd(s)),
|
|
38249
38404
|
relationship: relationshipOf(s),
|
|
@@ -38300,8 +38455,8 @@ var LibraryService = class {
|
|
|
38300
38455
|
if (plan2.error) invalid(plan2.error);
|
|
38301
38456
|
return this.snapshot(() => {
|
|
38302
38457
|
const { sessions, projects } = this.sessions(filters2);
|
|
38303
|
-
const
|
|
38304
|
-
const indexKey = fingerprint2([filters2,
|
|
38458
|
+
const generation3 = [this.store.db.prepare("PRAGMA data_version").get(), this.store.db.prepare("SELECT total_changes() AS n").get()];
|
|
38459
|
+
const indexKey = fingerprint2([filters2, generation3]);
|
|
38305
38460
|
if (this.searchCache?.key !== indexKey) {
|
|
38306
38461
|
this.searchCache = void 0;
|
|
38307
38462
|
const index2 = new SessionSearchIndex();
|
|
@@ -38370,7 +38525,7 @@ var LibraryService = class {
|
|
|
38370
38525
|
}
|
|
38371
38526
|
const groups = [...grouped2].sort(([a], [b]) => a.localeCompare(b)).map(([key, values]) => ({
|
|
38372
38527
|
key,
|
|
38373
|
-
label: groupBy === "project" ? names.get(key) ||
|
|
38528
|
+
label: groupBy === "project" ? names.get(key) || basename16(values[0].directory) || "Unknown project" : groupBy === "repository" ? values[0].checkout?.repositoryLabel || "Unverified repository" : key,
|
|
38374
38529
|
...groupBy === "repository" ? { worktrees: [...new Set(values.flatMap((s) => s.checkout?.worktree || []))].sort() } : {},
|
|
38375
38530
|
...groupBy === "relationship" ? { origins: values.reduce((counts, s) => {
|
|
38376
38531
|
counts[s.origin ?? "unknown"]++;
|
|
@@ -38418,24 +38573,24 @@ var LibraryService = class {
|
|
|
38418
38573
|
|
|
38419
38574
|
// server/middleware.ts
|
|
38420
38575
|
var publishingClient;
|
|
38421
|
-
var
|
|
38422
|
-
var
|
|
38576
|
+
var generation2 = /* @__PURE__ */ Symbol("sessiongraph-backend");
|
|
38577
|
+
var runtime2 = globalThis;
|
|
38423
38578
|
function library() {
|
|
38424
|
-
if (
|
|
38425
|
-
for (const live of
|
|
38579
|
+
if (runtime2.sessionGraphRuntime?.importer.status.running && runtime2.sessionGraphRuntime.generation !== generation2) {
|
|
38580
|
+
for (const live of runtime2.sessionGraphRuntime.importer.adapters) {
|
|
38426
38581
|
const updated = adapters.find((adapter) => adapter.id === live.id);
|
|
38427
|
-
if (updated) Object.assign(live, withSourcePaths(updated, () =>
|
|
38582
|
+
if (updated) Object.assign(live, withSourcePaths(updated, () => runtime2.sessionGraphRuntime.store.setting("sourcePaths") || {}));
|
|
38428
38583
|
}
|
|
38429
38584
|
}
|
|
38430
|
-
if (
|
|
38431
|
-
|
|
38432
|
-
|
|
38585
|
+
if (runtime2.sessionGraphRuntime && runtime2.sessionGraphRuntime.generation !== generation2 && !runtime2.sessionGraphRuntime.importer.status.running) {
|
|
38586
|
+
runtime2.sessionGraphRuntime.store.close();
|
|
38587
|
+
runtime2.sessionGraphRuntime = void 0;
|
|
38433
38588
|
}
|
|
38434
|
-
if (!
|
|
38589
|
+
if (!runtime2.sessionGraphRuntime) {
|
|
38435
38590
|
const store = new SessionGraphStore();
|
|
38436
|
-
|
|
38591
|
+
runtime2.sessionGraphRuntime = { store, importer: new Importer(store, adapters), generation: generation2 };
|
|
38437
38592
|
}
|
|
38438
|
-
return
|
|
38593
|
+
return runtime2.sessionGraphRuntime;
|
|
38439
38594
|
}
|
|
38440
38595
|
async function body(req) {
|
|
38441
38596
|
let size = 0;
|