diff --git a/README.md b/README.md index 07f16ac..6657ad2 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ Can you create a plan for this?" ``` Claude will use the `create_plan` tool, which: -- Creates a plan in SQLite (`~/.boost/boost.db`) +- Creates a plan in SQLite (see Database location below) - Starts a web server on `localhost:3456` - Opens your browser to the plan UI - Returns the plan URL @@ -135,7 +135,11 @@ Another instance is running. Kill it or change the port in `src/mcp-server.ts` ( **Database location** -Plans are stored in `~/.boost/boost.db`. Delete this file to reset. +Plans are stored in: +- **macOS**: `~/Library/boost/boost.db` +- **Linux**: `$XDG_DATA_HOME/boost/boost.db` (or `~/.local/state/boost/boost.db` if `XDG_DATA_HOME` is not set) + +Delete this file to reset. **WebSocket connection failed** @@ -155,7 +159,7 @@ npm run seed # populate test data - **MCP server** (stdio) — exposes tools to Claude - **Express + WebSocket** (localhost:3456) — serves UI and pushes real-time updates -- **SQLite** (`~/.boost/boost.db`) — stores plans, sections, comments, provocations +- **SQLite** (platform-specific location) — stores plans, sections, comments, provocations - **Svelte 5 frontend** — reactive UI with markdown editing and diff view ## License diff --git a/package-lock.json b/package-lock.json index 469c224..585ff00 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,13 @@ { - "name": "boost", + "name": "plan-boost", "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "boost", + "name": "plan-boost", "version": "1.0.0", + "license": "MIT", "dependencies": { "@modelcontextprotocol/sdk": "^1.12.1", "better-sqlite3": "^11.8.2", @@ -16,6 +17,9 @@ "uuid": "^11.1.0", "ws": "^8.18.1" }, + "bin": { + "plan-boost": "dist/src/mcp-server.js" + }, "devDependencies": { "@sveltejs/vite-plugin-svelte": "^5.0.3", "@types/better-sqlite3": "^7.6.13", @@ -1201,6 +1205,7 @@ "integrity": "sha512-Y1Cs7hhTc+a5E9Va/xwKlAJoariQyHY+5zBgCZg4PFWNYQ1nMN9sjK1zhw1gK69DuqVP++sht/1GZg1aRwmAXQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@sveltejs/vite-plugin-svelte-inspector": "^4.0.1", "debug": "^4.4.1", @@ -1393,6 +1398,7 @@ "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "dev": true, "license": "MIT", + "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -1978,6 +1984,7 @@ "resolved": "https://registry.npmjs.org/express/-/express-4.22.1.tgz", "integrity": "sha512-F2X8g9P1X7uCPZMA3MVf9wcTqlyNp7IhH5qPCI0izhaOIYXaW9L535tGA3qmjRzpH+bZczqq7hVKxTR4NWnu+g==", "license": "MIT", + "peer": true, "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", @@ -2263,6 +2270,7 @@ "resolved": "https://registry.npmjs.org/hono/-/hono-4.11.8.tgz", "integrity": "sha512-eVkB/CYCCei7K2WElZW9yYQFWssG0DhaDhVvr7wy5jJ22K+ck8fWW0EsLpB0sITUTvPnc97+rrbQqIr5iqiy9Q==", "license": "MIT", + "peer": true, "engines": { "node": ">=16.9.0" } @@ -2658,6 +2666,7 @@ "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=12" }, @@ -3195,6 +3204,7 @@ "integrity": "sha512-FR9kTLmX5i0oyeQ5j/+w8DuagIkQ7MWMuPpPVioW2zx9Dw77q+1ufLzF1IqNtcTXPRnIIio4PlasliVn43OnbQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@jridgewell/remapping": "^2.3.4", "@jridgewell/sourcemap-codec": "^1.5.0", @@ -3368,6 +3378,7 @@ "integrity": "sha512-+Oxm7q9hDoLMyJOYfUYBuHQo+dkAloi33apOPP56pzj+vsdJDzr+j1NISE5pyaAuKL4A3UD34qd0lx5+kfKp2g==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.4.4", @@ -3511,6 +3522,7 @@ "resolved": "https://registry.npmjs.org/zod/-/zod-4.3.6.tgz", "integrity": "sha512-rftlrkhHZOcjDwkGlnUtZZkvaPHCsDATp4pGpuOOMDaTdDDXF91wuVDJoWoPsKX/3YPQ5fHuF3STjcYyKr+Qhg==", "license": "MIT", + "peer": true, "funding": { "url": "https://github.com/sponsors/colinhacks" } diff --git a/src/server/db.ts b/src/server/db.ts index 8dc5cba..e014650 100644 --- a/src/server/db.ts +++ b/src/server/db.ts @@ -1,7 +1,7 @@ import Database from 'better-sqlite3'; import { mkdirSync } from 'fs'; -import { join } from 'path'; -import { homedir } from 'os'; +import { join, dirname } from 'path'; +import { homedir, platform } from 'os'; import { v4 as uuid } from 'uuid'; import type { Plan, @@ -14,9 +14,28 @@ import type { FeedbackResult, } from './types.js'; -const dbDir = join(homedir(), '.boost'); +function getDbPath(): string { + const home = homedir(); + const plat = platform(); + + if (plat === 'darwin') { + // macOS: ~/Library/boost/boost.db + return join(home, 'Library', 'boost', 'boost.db'); + } else { + // Linux and others: $XDG_DATA_HOME/boost/boost.db or $HOME/.local/state/boost/boost.db + // Note: Using .local/state instead of .local/share (XDG_DATA_HOME default) for state data + const xdgDataHome = process.env.XDG_DATA_HOME; + if (xdgDataHome) { + return join(xdgDataHome, 'boost', 'boost.db'); + } else { + return join(home, '.local', 'state', 'boost', 'boost.db'); + } + } +} + +const dbPath = getDbPath(); +const dbDir = dirname(dbPath); mkdirSync(dbDir, { recursive: true }); -const dbPath = join(dbDir, 'boost.db'); const db = new Database(dbPath); db.pragma('journal_mode = WAL');