From 807ecac7b9660563372d6ac22dde097334624419 Mon Sep 17 00:00:00 2001 From: Meleki Date: Sat, 21 Feb 2026 14:10:25 +0100 Subject: [PATCH] configurable sessions dir, exclude jsonl-sync from build, simplify db path --- Program.cs | 2 +- jsonl-sync/export.mjs | 3 ++- token-analytics.csproj | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Program.cs b/Program.cs index 576e59e..6549ba4 100644 --- a/Program.cs +++ b/Program.cs @@ -8,7 +8,7 @@ builder.Configuration.AddJsonFile("appsettings.user.json", optional: true, reloa var dbPath = builder.Configuration["DbPath"]!; builder.Services.AddSingleton>(() => - new SqliteConnection($"Data Source={Path.GetFullPath(dbPath)}")); + new SqliteConnection($"Data Source={dbPath}")); var app = builder.Build(); diff --git a/jsonl-sync/export.mjs b/jsonl-sync/export.mjs index 1c51724..452dbe5 100644 --- a/jsonl-sync/export.mjs +++ b/jsonl-sync/export.mjs @@ -4,7 +4,8 @@ import { fileURLToPath } from 'node:url'; import Database from 'better-sqlite3'; const __dirname = path.dirname(fileURLToPath(import.meta.url)); -const SESSIONS_DIR = '/home/node/.openclaw/agents/main/sessions'; +import os from 'node:os'; +const SESSIONS_DIR = process.env.SESSIONS_DIR || path.join(os.homedir(), '.openclaw/agents/main/sessions'); const DB_FILE = path.join(__dirname, 'sessions.db'); const db = new Database(DB_FILE); diff --git a/token-analytics.csproj b/token-analytics.csproj index 3c65cad..2b7fbb8 100644 --- a/token-analytics.csproj +++ b/token-analytics.csproj @@ -10,6 +10,8 @@ + +