sessiongraph-app-darwin-arm64 1.0.20 → 1.0.22
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-launcher.mjs +2 -1
- package/payload/SessionGraph.app/Contents/Resources/resources/cli-package.json +1 -1
- package/payload/SessionGraph.app/Contents/Resources/resources/cli.mjs +58 -27
- package/payload/SessionGraph.app/Contents/Resources/resources/server.mjs +2575 -85
- package/payload/SessionGraph.app/Contents/Resources/resources/web/assets/{index-CxnS4waR.css → index-BROemBuT.css} +1 -1
- package/payload/SessionGraph.app/Contents/Resources/resources/web/assets/{index-BwNazXTF.js → index-ClDHxy66.js} +1 -1
- package/payload/SessionGraph.app/Contents/Resources/resources/web/assets/index-DK0pBf-7.js +192 -0
- package/payload/SessionGraph.app/Contents/Resources/resources/web/assets/{index-nDYf67iK.js → index-DWWZZL6C.js} +1 -1
- package/payload/SessionGraph.app/Contents/Resources/resources/web/assets/{index-CUSJvhgf.js → index-tIWYckIn.js} +1 -1
- package/payload/SessionGraph.app/Contents/Resources/resources/web/assets/{public-viewer-BMIcmydl.js → public-viewer-B1aKDYpa.js} +1 -1
- package/payload/SessionGraph.app/Contents/Resources/resources/web/assets/{scene-oSl4S0W6.js → scene-BCuZ73oU.js} +1 -1
- package/payload/SessionGraph.app/Contents/Resources/resources/web/assets/{share-D7wrWEkV.js → share-mJrTMarx.js} +3 -3
- package/payload/SessionGraph.app/Contents/Resources/resources/web/index.html +2 -2
- package/payload/SessionGraph.app/Contents/_CodeSignature/CodeResources +42 -42
- package/payload/SessionGraph.app/Contents/Resources/resources/web/assets/index-TSi2Km_w.js +0 -186
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.22",
|
|
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": "a9f37de30760da2bd866565fe68a1c0037f3cf0c",
|
|
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.22</string>
|
|
21
21
|
<key>CFBundleVersion</key>
|
|
22
|
-
<string>1.0.
|
|
22
|
+
<string>1.0.22</string>
|
|
23
23
|
<key>CSResourcesFileMapped</key>
|
|
24
24
|
<true/>
|
|
25
25
|
<key>LSApplicationCategoryType</key>
|
|
Binary file
|
|
@@ -11,7 +11,8 @@ const root = dirname(dirname(fileURLToPath(import.meta.url)));
|
|
|
11
11
|
const pkg = JSON.parse(readFileSync(join(root, 'package.json'), 'utf8'));
|
|
12
12
|
const argv = process.argv.slice(2);
|
|
13
13
|
if (argv.length === 1 && ['--version', '-v'].includes(argv[0])) { console.log(`SessionGraph ${pkg.version}`); process.exit(0); }
|
|
14
|
-
|
|
14
|
+
const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(Number);
|
|
15
|
+
if (nodeMajor < 22 || (nodeMajor === 22 && nodeMinor < 15)) { console.error('SessionGraph requires Node.js 22.15.0 or later for its launcher (built-in SQLite and Zstandard support).'); process.exit(1); }
|
|
15
16
|
process.stdout.on('error', error => { if (error.code === 'EPIPE') process.exit(0); else throw error; });
|
|
16
17
|
if (argv.length && !(argv.length === 1 && argv[0] === '--browser')) {
|
|
17
18
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"1.0.
|
|
1
|
+
{"version":"1.0.22","buildID":"51e0db7240240e9d7d2879fbf1a61d3f7690817a104cef17abcc4a8f06d299d4"}
|
|
@@ -679,6 +679,17 @@ var init_library_query = __esm({
|
|
|
679
679
|
}
|
|
680
680
|
});
|
|
681
681
|
|
|
682
|
+
// server/sqlite.ts
|
|
683
|
+
function iterate(db2, sql, ...values) {
|
|
684
|
+
const statement = db2.prepare(sql);
|
|
685
|
+
return Object.assign(statement.iterate(...values), { retainedStatement: statement });
|
|
686
|
+
}
|
|
687
|
+
var init_sqlite = __esm({
|
|
688
|
+
"server/sqlite.ts"() {
|
|
689
|
+
"use strict";
|
|
690
|
+
}
|
|
691
|
+
});
|
|
692
|
+
|
|
682
693
|
// server/commit-store.ts
|
|
683
694
|
function writeCommits(db2, session) {
|
|
684
695
|
db2.prepare("DELETE FROM session_commits WHERE session_id=?").run(session.id);
|
|
@@ -686,7 +697,7 @@ function writeCommits(db2, session) {
|
|
|
686
697
|
if (!supported.has(session.source || "")) return { ...base, state: "unavailable", count: null, note: "Commit history unavailable for this source." };
|
|
687
698
|
const calls = /* @__PURE__ */ new Map();
|
|
688
699
|
const results = /* @__PURE__ */ new Map();
|
|
689
|
-
const rows2 = () => db2
|
|
700
|
+
const rows2 = () => iterate(db2, "SELECT data FROM timeline_items WHERE session_id=? AND kind IN ('tool_call','tool_result') ORDER BY ordinal", session.id);
|
|
690
701
|
let tools = 0, partial2 = session.coverage?.history !== "complete" || Boolean(db2.prepare("SELECT partial FROM timeline_coverage WHERE session_id=?").get(session.id)?.partial);
|
|
691
702
|
for (const row of rows2()) {
|
|
692
703
|
const item = JSON.parse(String(row.data));
|
|
@@ -767,6 +778,7 @@ var init_commit_store = __esm({
|
|
|
767
778
|
init_commits();
|
|
768
779
|
init_commit_extraction();
|
|
769
780
|
init_library_query();
|
|
781
|
+
init_sqlite();
|
|
770
782
|
COMMIT_SCHEMA = `CREATE TABLE IF NOT EXISTS session_commits (
|
|
771
783
|
session_id TEXT NOT NULL REFERENCES sessions(id) ON DELETE CASCADE,
|
|
772
784
|
sha TEXT NOT NULL, repository_path TEXT NOT NULL, operation TEXT NOT NULL,
|
|
@@ -24704,14 +24716,18 @@ function rows(db2, table2, fields3, filter, order, limit = 5e4) {
|
|
|
24704
24716
|
for (const name of [...fields3, ...filter ? [filter[0]] : [], ...order ? [order] : []]) if (!/^[a-zA-Z_][\w]*$/.test(name)) throw new Error("Invalid history column.");
|
|
24705
24717
|
if (filter && !available.has(filter[0])) throw new Error("Unsupported history relation.");
|
|
24706
24718
|
const size = (f) => `length(CAST("${f}" AS BLOB))`;
|
|
24707
|
-
const select = fields3.map((f) => available.has(f) ? `CASE WHEN ${size(f)}<=32000000 THEN "${f}" END AS "${f}"` : `NULL AS "${f}"`).join(",");
|
|
24719
|
+
const select = fields3.map((f) => available.has(f) ? `CASE WHEN ${size(f)}<=32000000 THEN CASE WHEN typeof("${f}")='text' THEN CAST("${f}" AS BLOB) ELSE "${f}" END END AS "${f}", typeof("${f}")='text' AS "__sessiongraph_text_${f}"` : `NULL AS "${f}"`).join(",");
|
|
24708
24720
|
const oversized = fields3.filter((f) => available.has(f)).map((f) => `COALESCE(${size(f)},0)>32000000`).join(" OR ") || "0";
|
|
24709
24721
|
const query2 = `SELECT ${select}, (${oversized}) AS __sessiongraph_oversized FROM "${table2}"${filter ? ` WHERE "${filter[0]}"=?` : ""}${order && available.has(order) ? ` ORDER BY "${order}"` : ""} LIMIT ${limit + 1}`;
|
|
24710
24722
|
const result = [];
|
|
24711
24723
|
let bytes2 = 0;
|
|
24712
|
-
for (const row of db2
|
|
24724
|
+
for (const row of iterate(db2, query2, ...filter ? [filter[1]] : [])) {
|
|
24713
24725
|
if (row.__sessiongraph_oversized) throw new Error("History field exceeds the 32 MB snapshot limit.");
|
|
24714
24726
|
delete row.__sessiongraph_oversized;
|
|
24727
|
+
for (const field of fields3) {
|
|
24728
|
+
if (row[`__sessiongraph_text_${field}`] && row[field] instanceof Uint8Array) row[field] = Buffer.from(row[field]).toString("utf8");
|
|
24729
|
+
delete row[`__sessiongraph_text_${field}`];
|
|
24730
|
+
}
|
|
24715
24731
|
const size2 = rowBytes(row);
|
|
24716
24732
|
bytes2 += size2;
|
|
24717
24733
|
consume(size2, 1);
|
|
@@ -24876,6 +24892,7 @@ var init_sqlite_histories = __esm({
|
|
|
24876
24892
|
init_local_files();
|
|
24877
24893
|
init_sqlite_snapshot();
|
|
24878
24894
|
init_compressed();
|
|
24895
|
+
init_sqlite();
|
|
24879
24896
|
rowBytes = (row) => Object.values(row).reduce((n, v3) => n + (typeof v3 === "string" ? Buffer.byteLength(v3) : v3 instanceof Uint8Array ? v3.byteLength : 8), 0);
|
|
24880
24897
|
}
|
|
24881
24898
|
});
|
|
@@ -24995,7 +25012,7 @@ function historyRevisions(db2, schema) {
|
|
|
24995
25012
|
const names = columns(db2, table2);
|
|
24996
25013
|
if (!names.has("session_id")) continue;
|
|
24997
25014
|
const updated = names.has("time_updated") ? "MAX(time_updated)" : "NULL";
|
|
24998
|
-
for (const row of db2
|
|
25015
|
+
for (const row of iterate(db2, `SELECT session_id, COUNT(*) AS count, ${updated} AS updated FROM "${table2}" GROUP BY session_id`)) {
|
|
24999
25016
|
const id3 = text3(row.session_id);
|
|
25000
25017
|
result.set(id3, [...result.get(id3) || [], row.count, row.updated]);
|
|
25001
25018
|
}
|
|
@@ -25084,7 +25101,7 @@ function discoverDatabase(db2, path, snapshot2) {
|
|
|
25084
25101
|
}
|
|
25085
25102
|
function payloadRows(db2, query2, values, budget2) {
|
|
25086
25103
|
const result = [];
|
|
25087
|
-
for (const row of db2
|
|
25104
|
+
for (const row of iterate(db2, query2, ...values)) {
|
|
25088
25105
|
if (typeof row.data !== "string") throw new Error("OpenCode history contains a missing or oversized JSON field (4 MB limit).");
|
|
25089
25106
|
budget2.bytes += Buffer.byteLength(row.data);
|
|
25090
25107
|
budget2.records++;
|
|
@@ -25108,6 +25125,7 @@ var init_opencode2 = __esm({
|
|
|
25108
25125
|
init_sqlite_snapshot();
|
|
25109
25126
|
init_local_files();
|
|
25110
25127
|
init_opencode_v1();
|
|
25128
|
+
init_sqlite();
|
|
25111
25129
|
PAGE = 60;
|
|
25112
25130
|
MAX_JSON = 4e6;
|
|
25113
25131
|
sessionFields = [
|
|
@@ -25133,7 +25151,7 @@ var init_opencode2 = __esm({
|
|
|
25133
25151
|
opencodeAdapter = {
|
|
25134
25152
|
id: "opencode",
|
|
25135
25153
|
name: "OpenCode",
|
|
25136
|
-
description: "Local SQLite history \xB7 V1 and V2
|
|
25154
|
+
description: "Local SQLite history \xB7 V1 and V2",
|
|
25137
25155
|
capabilities: { history: true, forks: true, children: true, files: true },
|
|
25138
25156
|
async detect() {
|
|
25139
25157
|
return (await openCodeDatabases()).length > 0;
|
|
@@ -52935,7 +52953,7 @@ var init_codex = __esm({
|
|
|
52935
52953
|
// server/adapters/t3-code.ts
|
|
52936
52954
|
import { lstat as lstat7 } from "node:fs/promises";
|
|
52937
52955
|
import { homedir as homedir7 } from "node:os";
|
|
52938
|
-
import { isAbsolute as
|
|
52956
|
+
import { isAbsolute as isAbsolute5, join as join13 } from "node:path";
|
|
52939
52957
|
function parsedObject(value) {
|
|
52940
52958
|
if (typeof value !== "string") return;
|
|
52941
52959
|
try {
|
|
@@ -53154,7 +53172,7 @@ function v2Message(row, directory3) {
|
|
|
53154
53172
|
message2.events = [eventFor(message2, id3, kind2, file2, "", { ...fields3, callID: string6(native.nativeId) || void 0 })];
|
|
53155
53173
|
return message2;
|
|
53156
53174
|
}
|
|
53157
|
-
if (file2 && completed) message2.files.push({ path:
|
|
53175
|
+
if (file2 && completed) message2.files.push({ path: isAbsolute5(file2) ? file2 : join13(directory3, file2), source: "file change", steps: 1 });
|
|
53158
53176
|
message2.events = [eventFor(message2, id3, "file_change", file2 || name, "", fields3)];
|
|
53159
53177
|
return message2;
|
|
53160
53178
|
}
|
|
@@ -53530,7 +53548,7 @@ var init_cursor_store = __esm({
|
|
|
53530
53548
|
});
|
|
53531
53549
|
|
|
53532
53550
|
// server/adapters/cursor-composer.ts
|
|
53533
|
-
import { isAbsolute as
|
|
53551
|
+
import { isAbsolute as isAbsolute6 } from "node:path";
|
|
53534
53552
|
import { fileURLToPath } from "node:url";
|
|
53535
53553
|
function decode3(value) {
|
|
53536
53554
|
return object4(JSON.parse(typeof value === "string" ? value : value instanceof Uint8Array ? Buffer.from(value).toString("utf8") : "{}"));
|
|
@@ -53538,7 +53556,7 @@ function decode3(value) {
|
|
|
53538
53556
|
function directory2(raw) {
|
|
53539
53557
|
const value = text3(raw.workspaceIdentifier?.uri?.path) || text3(raw.workspaceIdentifier?.uri) || text3(raw.cwd);
|
|
53540
53558
|
try {
|
|
53541
|
-
return value.startsWith("file:") ? fileURLToPath(value) :
|
|
53559
|
+
return value.startsWith("file:") ? fileURLToPath(value) : isAbsolute6(value) ? value : "";
|
|
53542
53560
|
} catch {
|
|
53543
53561
|
return "";
|
|
53544
53562
|
}
|
|
@@ -53550,7 +53568,7 @@ function discoverComposers(path, workspace = "") {
|
|
|
53550
53568
|
for (const table2 of ["cursorDiskKV", "ItemTable"]) {
|
|
53551
53569
|
if (!hasTable(db2, table2)) continue;
|
|
53552
53570
|
let failed = 0, count = 0;
|
|
53553
|
-
const rows2 = db2
|
|
53571
|
+
const rows2 = iterate(db2, `SELECT key, CASE WHEN length(value)<=? THEN value END AS value FROM ${table2} WHERE key LIKE 'composerData:%' AND value IS NOT NULL ORDER BY key LIMIT 20001`, MAX_VALUE2);
|
|
53554
53572
|
for (const row of rows2) {
|
|
53555
53573
|
if (++count > 2e4) {
|
|
53556
53574
|
warnings.push("Cursor Composer listing reached its 20,000-session limit.");
|
|
@@ -53645,6 +53663,7 @@ var init_cursor_composer = __esm({
|
|
|
53645
53663
|
init_cursor_message();
|
|
53646
53664
|
init_local_files();
|
|
53647
53665
|
init_sqlite_snapshot();
|
|
53666
|
+
init_sqlite();
|
|
53648
53667
|
MAX_VALUE2 = 32e6;
|
|
53649
53668
|
MAX_BUBBLE = 8e6;
|
|
53650
53669
|
MAX_MESSAGES = 5e4;
|
|
@@ -53656,7 +53675,7 @@ var init_cursor_composer = __esm({
|
|
|
53656
53675
|
import { createHash as createHash5 } from "node:crypto";
|
|
53657
53676
|
import { lstat as lstat8, opendir as opendir2, readFile as readFile2 } from "node:fs/promises";
|
|
53658
53677
|
import { homedir as homedir8 } from "node:os";
|
|
53659
|
-
import { isAbsolute as
|
|
53678
|
+
import { isAbsolute as isAbsolute7, join as join15 } from "node:path";
|
|
53660
53679
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
53661
53680
|
async function fileStats(path) {
|
|
53662
53681
|
try {
|
|
@@ -53926,7 +53945,7 @@ var init_cursor = __esm({
|
|
|
53926
53945
|
init_jsonl();
|
|
53927
53946
|
LIMIT = 2e4;
|
|
53928
53947
|
validID = (id3) => /^[a-z\d][\w-]{0,159}$/i.test(id3);
|
|
53929
|
-
cwd = (value) => typeof value === "string" &&
|
|
53948
|
+
cwd = (value) => typeof value === "string" && isAbsolute7(value) && !/[\x00-\x1f\x7f]/.test(value) ? value : "";
|
|
53930
53949
|
slug = (path) => path.replace(/\\/g, "/").replace(/^([A-Z]):/i, (_, drive) => drive.toLowerCase()).replace(/^\/+|\/+$/g, "").replace(/[/:]+/g, "-");
|
|
53931
53950
|
hashCwd = (path) => createHash5("md5").update(path).digest("hex");
|
|
53932
53951
|
userData = () => process.platform === "darwin" ? join15(homedir8(), "Library/Application Support/Cursor") : process.platform === "win32" ? join15(process.env.APPDATA || join15(homedir8(), "AppData/Roaming"), "Cursor") : join15(process.env.XDG_CONFIG_HOME || join15(homedir8(), ".config"), "Cursor");
|
|
@@ -54759,7 +54778,7 @@ var init_harness_files = __esm({
|
|
|
54759
54778
|
|
|
54760
54779
|
// server/adapters/harness-databases.ts
|
|
54761
54780
|
import { lstat as lstat9, readFile as readFile3 } from "node:fs/promises";
|
|
54762
|
-
import { isAbsolute as
|
|
54781
|
+
import { isAbsolute as isAbsolute8, join as join23 } from "node:path";
|
|
54763
54782
|
function hermesContent(value) {
|
|
54764
54783
|
if (typeof value !== "string" || !value.startsWith("\0json:")) return value;
|
|
54765
54784
|
try {
|
|
@@ -54879,7 +54898,7 @@ var init_harness_databases = __esm({
|
|
|
54879
54898
|
goose = {
|
|
54880
54899
|
id: "goose",
|
|
54881
54900
|
name: "Goose",
|
|
54882
|
-
paths: dbPaths("goose", () => process.env.GOOSE_PATH_ROOT &&
|
|
54901
|
+
paths: dbPaths("goose", () => process.env.GOOSE_PATH_ROOT && isAbsolute8(process.env.GOOSE_PATH_ROOT) ? [join23(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")),
|
|
54883
54902
|
table: "sessions",
|
|
54884
54903
|
key: "id",
|
|
54885
54904
|
fields: [
|
|
@@ -55002,8 +55021,8 @@ var init_harness_databases = __esm({
|
|
|
55002
55021
|
const raw = JSON.parse(await readFile3(registry2, "utf8"));
|
|
55003
55022
|
const paths2 = [];
|
|
55004
55023
|
for (const p of Array.isArray(raw.projects) ? raw.projects.slice(0, 2e4) : []) {
|
|
55005
|
-
if (!
|
|
55006
|
-
const path = join23(
|
|
55024
|
+
if (!isAbsolute8(text3(p.path)) || !text3(p.data_dir)) continue;
|
|
55025
|
+
const path = join23(isAbsolute8(p.data_dir) ? p.data_dir : join23(p.path, p.data_dir), "crush.db");
|
|
55007
55026
|
paths2.push(path);
|
|
55008
55027
|
crushDirectories.set(path, p.path);
|
|
55009
55028
|
}
|
|
@@ -66520,6 +66539,7 @@ function storageFailure(error62, opening = false) {
|
|
|
66520
66539
|
init_commit_store();
|
|
66521
66540
|
init_commit_extraction();
|
|
66522
66541
|
init_usage();
|
|
66542
|
+
init_sqlite();
|
|
66523
66543
|
var SessionGraphStore = class {
|
|
66524
66544
|
constructor(path = databasePath()) {
|
|
66525
66545
|
this.path = path;
|
|
@@ -66584,7 +66604,7 @@ var SessionGraphStore = class {
|
|
|
66584
66604
|
try {
|
|
66585
66605
|
this.db.exec(EVENT_SCHEMA);
|
|
66586
66606
|
for (const { id: id3 } of this.db.prepare("SELECT id FROM sessions").all()) {
|
|
66587
|
-
writeEvents(this.db, String(id3), this.db
|
|
66607
|
+
writeEvents(this.db, String(id3), iterate(this.db, "SELECT data FROM messages WHERE session_id=? ORDER BY ordinal", id3));
|
|
66588
66608
|
}
|
|
66589
66609
|
this.db.exec("PRAGMA user_version=4; COMMIT;");
|
|
66590
66610
|
} catch (error62) {
|
|
@@ -66736,7 +66756,7 @@ var SessionGraphStore = class {
|
|
|
66736
66756
|
this.db.prepare("DELETE FROM messages WHERE session_id=?").run(s.id);
|
|
66737
66757
|
const insert = this.db.prepare("INSERT INTO messages (session_id,id,ordinal,data,time,is_user) VALUES (?,?,?,?,?,?) ON CONFLICT(session_id,id) DO UPDATE SET ordinal=excluded.ordinal,data=excluded.data,time=excluded.time,is_user=excluded.is_user");
|
|
66738
66758
|
messages.forEach((message2, i) => insert.run(s.id, message2.id, i, JSON.stringify(message2), message2.eventOnly ? null : messageTime(message2.time), Number(isUserMessage(message2))));
|
|
66739
|
-
writeEvents(this.db, s.id, this.db
|
|
66759
|
+
writeEvents(this.db, s.id, iterate(this.db, "SELECT data FROM messages WHERE session_id=? ORDER BY ordinal", s.id));
|
|
66740
66760
|
const commits = writeCommits(this.db, s);
|
|
66741
66761
|
if (candidate.pullRequests !== void 0) {
|
|
66742
66762
|
this.db.prepare("DELETE FROM session_pull_requests WHERE session_id=?").run(s.id);
|
|
@@ -66993,7 +67013,7 @@ var SessionGraphStore = class {
|
|
|
66993
67013
|
};
|
|
66994
67014
|
|
|
66995
67015
|
// server/library-service.ts
|
|
66996
|
-
import { basename as basename3 } from "node:path";
|
|
67016
|
+
import { basename as basename3, isAbsolute as isAbsolute3 } from "node:path";
|
|
66997
67017
|
|
|
66998
67018
|
// server/git-checkouts.ts
|
|
66999
67019
|
import { execFile } from "node:child_process";
|
|
@@ -67085,8 +67105,8 @@ var Importer = class {
|
|
|
67085
67105
|
status = { running: false, discovered: 0, imported: 0, unchanged: 0, failed: 0, errors: [], warnings: [] };
|
|
67086
67106
|
job;
|
|
67087
67107
|
adapters;
|
|
67088
|
-
async sources() {
|
|
67089
|
-
return Promise.all(this.adapters.map(async (adapter) => ({ id: adapter.id, name: adapter.name, description: adapter.description, capabilities: adapter.capabilities, available: await adapter.detect().catch(() => false), selected: this.store.selected().includes(adapter.id), ...this.store.sourceInfo(adapter.id) })));
|
|
67108
|
+
async sources(ids) {
|
|
67109
|
+
return Promise.all(this.adapters.filter((adapter) => !ids || ids.includes(adapter.id)).map(async (adapter) => ({ id: adapter.id, name: adapter.name, description: adapter.description, capabilities: adapter.capabilities, available: await adapter.detect().catch(() => false), selected: this.store.selected().includes(adapter.id), ...this.store.sourceInfo(adapter.id) })));
|
|
67090
67110
|
}
|
|
67091
67111
|
start(ids, automatic = false) {
|
|
67092
67112
|
return this.begin(ids, automatic, true);
|
|
@@ -69224,7 +69244,7 @@ var utc = (ms) => ms > 0 && ms <= 864e13 ? new Date(ms).toISOString() : null;
|
|
|
69224
69244
|
var LibraryService = class {
|
|
69225
69245
|
constructor(store, adapters2) {
|
|
69226
69246
|
this.store = store;
|
|
69227
|
-
this.importer = new Importer(store, adapters2);
|
|
69247
|
+
this.importer = adapters2 instanceof Importer ? adapters2 : new Importer(store, adapters2);
|
|
69228
69248
|
}
|
|
69229
69249
|
store;
|
|
69230
69250
|
searchCache;
|
|
@@ -69257,14 +69277,25 @@ var LibraryService = class {
|
|
|
69257
69277
|
key(kind, sessions, filters4) {
|
|
69258
69278
|
return fingerprint([this.store.setting("libraryID"), kind, filters4, sessions]);
|
|
69259
69279
|
}
|
|
69260
|
-
async discoverSources() {
|
|
69280
|
+
async discoverSources(ids) {
|
|
69261
69281
|
const paths2 = this.store.setting("sourcePaths") || {};
|
|
69262
69282
|
return {
|
|
69263
|
-
sources: (await this.importer.sources()).map((source) => ({ ...source, path: paths2[source.id] || null, pathSupported: true, pathHint: sourcePathHint(source.id) })),
|
|
69283
|
+
sources: (await this.importer.sources(ids)).map((source) => ({ ...source, path: paths2[source.id] || null, pathSupported: true, pathHint: sourcePathHint(source.id) })),
|
|
69264
69284
|
configured: this.store.setting("selected") !== void 0,
|
|
69265
69285
|
autoImport: this.store.autoImportEnabled()
|
|
69266
69286
|
};
|
|
69267
69287
|
}
|
|
69288
|
+
/** Editing a location neither selects a source nor imports its conversations. */
|
|
69289
|
+
setSourcePath(id3, path) {
|
|
69290
|
+
this.validateSources([id3]);
|
|
69291
|
+
if (path !== null && (typeof path !== "string" || !path.trim() || path.includes("\0") || !isAbsolute3(path) && path !== "~" && !path.startsWith("~/"))) invalid("Enter an absolute history path, or choose Automatic.");
|
|
69292
|
+
return this.configure(() => {
|
|
69293
|
+
const paths2 = this.store.setting("sourcePaths") || {};
|
|
69294
|
+
if (path === null) delete paths2[id3];
|
|
69295
|
+
else paths2[id3] = localPath(path);
|
|
69296
|
+
this.store.setting("sourcePaths", paths2);
|
|
69297
|
+
});
|
|
69298
|
+
}
|
|
69268
69299
|
configure(change) {
|
|
69269
69300
|
if (this.importer.status.running || !this.store.acquireImport()) throw new LibraryError("IMPORT_BUSY", "Another import is running. Try again when it finishes.");
|
|
69270
69301
|
try {
|
|
@@ -69561,7 +69592,7 @@ function manifest(command) {
|
|
|
69561
69592
|
schemaVersion: 1,
|
|
69562
69593
|
executable: "sessiongraph",
|
|
69563
69594
|
executableAliases: ["ssg"],
|
|
69564
|
-
node: ">=
|
|
69595
|
+
node: ">=22.15.0",
|
|
69565
69596
|
globalOptions,
|
|
69566
69597
|
commands: command ? [command] : commands2,
|
|
69567
69598
|
launch: { desktop: "sessiongraph", browser: "sessiongraph --browser" },
|
|
@@ -69608,7 +69639,7 @@ ${command.examples.map((e10) => ` sessiongraph ${e10}`).join("\n")}
|
|
|
69608
69639
|
}
|
|
69609
69640
|
var markdownDocs = (command) => `# SessionGraph CLI${command ? `: ${command.name}` : ""}
|
|
69610
69641
|
|
|
69611
|
-
Use \`sessiongraph\` or \`ssg\`. npm installs require Node.js
|
|
69642
|
+
Use \`sessiongraph\` or \`ssg\`. npm installs require Node.js 22.15.0+; desktop installs bundle it. Use \`--json\` for structured output and \`commands --json\` for command and result schemas.
|
|
69612
69643
|
|
|
69613
69644
|
${manifest().rules.map((rule) => `- ${rule}`).join("\n")}
|
|
69614
69645
|
|