claudit 0.1.0 → 0.1.1

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claudit",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "type": "module",
5
5
  "description": "A web dashboard for managing Claude Code sessions, cron tasks, and todos",
6
6
  "license": "MIT",
@@ -20,7 +20,7 @@
20
20
  "client/dist/"
21
21
  ],
22
22
  "scripts": {
23
- "dev": "concurrently -n server,client -c blue,green \"npm run dev --prefix server\" \"npm run dev --prefix client\"",
23
+ "dev": "concurrently -n server,client -c blue,green \"PORT=3002 NODE_ENV=development npm run dev --prefix server\" \"npm run dev --prefix client\"",
24
24
  "build": "npm run build --prefix client && npm run build --prefix server",
25
25
  "prepublishOnly": "npm run build"
26
26
  },
@@ -30,10 +30,12 @@
30
30
  "cors": "^2.8.5",
31
31
  "express": "^4.21.0",
32
32
  "node-cron": "^4.2.1",
33
- "node-pty": "^1.1.0",
34
33
  "ws": "^8.18.0",
35
34
  "zod": "^4.3.6"
36
35
  },
36
+ "optionalDependencies": {
37
+ "node-pty": "^1.1.0"
38
+ },
37
39
  "devDependencies": {
38
40
  "concurrently": "^9.1.0"
39
41
  }
@@ -13,7 +13,14 @@ import { ClaudeProcess } from './services/claudeProcess.js';
13
13
  import { initScheduler, stopAllJobs } from './services/cronScheduler.js';
14
14
  import { initProviderSync, stopProviderSync } from './services/todoSyncEngine.js';
15
15
  import { closeMcpConnections } from './services/providers/mcpClient.js';
16
- import { handleTerminalConnection } from './services/ptyManager.js';
16
+ let handleTerminalConnection = null;
17
+ try {
18
+ const ptyMod = await import('./services/ptyManager.js');
19
+ handleTerminalConnection = ptyMod.handleTerminalConnection;
20
+ }
21
+ catch {
22
+ console.warn('[server] ptyManager not available — terminal feature disabled.');
23
+ }
17
24
  import { eventBus } from './services/eventBus.js';
18
25
  import { closeDb } from './services/database.js';
19
26
  const app = express();
@@ -68,7 +75,13 @@ server.on('upgrade', (request, socket, head) => {
68
75
  }
69
76
  });
70
77
  wssTerminal.on('connection', (ws) => {
71
- handleTerminalConnection(ws);
78
+ if (handleTerminalConnection) {
79
+ handleTerminalConnection(ws);
80
+ }
81
+ else {
82
+ ws.send('\x00' + JSON.stringify({ type: 'error', message: 'Terminal not available: node-pty is not installed. Run: npm install node-pty' }));
83
+ ws.close();
84
+ }
72
85
  });
73
86
  wssEvents.on('connection', (ws) => {
74
87
  const unsubscribe = eventBus.onSessionEvent((event) => {
@@ -3,7 +3,8 @@ import os from 'os';
3
3
  import fs from 'fs';
4
4
  import Database from 'better-sqlite3';
5
5
  const DATA_DIR = path.join(os.homedir(), '.claudit');
6
- const DB_PATH = path.join(DATA_DIR, 'claudit.db');
6
+ const DB_NAME = process.env.NODE_ENV === 'development' ? 'claudit-dev.db' : 'claudit.db';
7
+ const DB_PATH = path.join(DATA_DIR, DB_NAME);
7
8
  if (!fs.existsSync(DATA_DIR)) {
8
9
  fs.mkdirSync(DATA_DIR, { recursive: true });
9
10
  }
@@ -1,6 +1,12 @@
1
1
  import { getManagedSessionMap, getArchivedSessionIds, getPinnedSessionIds } from './managedSessions.js';
2
- import { getActivePtySessions } from './ptyManager.js';
3
2
  import { scanProjectSessions } from './sessionScanner.js';
3
+ // Optional: node-pty may not be available
4
+ let getActivePtySessions = () => new Set();
5
+ try {
6
+ const ptyMod = await import('./ptyManager.js');
7
+ getActivePtySessions = ptyMod.getActivePtySessions;
8
+ }
9
+ catch { }
4
10
  let cache = null;
5
11
  const CACHE_TTL = 30_000; // 30 seconds
6
12
  /** Invalidate the session cache (e.g. after creating a new session) */
@@ -2,7 +2,14 @@ import { execSync } from 'child_process';
2
2
  import fs from 'fs';
3
3
  import os from 'os';
4
4
  import { WebSocket } from 'ws';
5
- import * as pty from 'node-pty';
5
+ // node-pty is optional dynamically loaded
6
+ let pty = null;
7
+ try {
8
+ pty = await import('node-pty');
9
+ }
10
+ catch {
11
+ console.warn('[pty] node-pty not available — terminal feature disabled. Install node-pty to enable it.');
12
+ }
6
13
  // Track active PTY sessions for status reporting
7
14
  const activePtySessions = new Set();
8
15
  export function getActivePtySessions() {
@@ -80,6 +87,8 @@ function appendScrollback(entry, data) {
80
87
  }
81
88
  }
82
89
  function spawnPty(key, sessionId, isNew, cwd, cols, rows) {
90
+ if (!pty)
91
+ throw new Error('node-pty is not installed. Run: npm install node-pty');
83
92
  // Kill existing PTY for this key if any
84
93
  if (ptyCache.has(key)) {
85
94
  destroyPty(key);