@citadel-labs/beads-ui 2.3.0 → 2.5.0

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.
Files changed (65) hide show
  1. package/README.md +6 -3
  2. package/bin/beads-board.js +173 -183
  3. package/package.json +2 -2
  4. package/server/__tests__/api.test.js +378 -0
  5. package/server/__tests__/pidfile.test.js +99 -0
  6. package/server/__tests__/terminal.test.js +339 -0
  7. package/server/dist/assets/angular-html-DA-rfuFy.js +1 -0
  8. package/server/dist/assets/angular-ts-BrjP3tb8.js +1 -0
  9. package/server/dist/assets/c-BIGW1oBm.js +1 -0
  10. package/server/dist/assets/cpp-BRuaLJcg.js +1 -0
  11. package/server/dist/assets/csharp-COcwbKMJ.js +1 -0
  12. package/server/dist/assets/css-CLj8gQPS.js +1 -0
  13. package/server/dist/assets/dockerfile-BcOcwvcX.js +1 -0
  14. package/server/dist/assets/dotenv-Da5cRb03.js +1 -0
  15. package/server/dist/assets/github-dark-DHJKELXO.js +1 -0
  16. package/server/dist/assets/go-C27-OAKa.js +1 -0
  17. package/server/dist/assets/graphql-ChdNCCLP.js +1 -0
  18. package/server/dist/assets/html-derivative-C6UeqQa8.js +1 -0
  19. package/server/dist/assets/html-pp8916En.js +1 -0
  20. package/server/dist/assets/http-l_GQhCeT.js +1 -0
  21. package/server/dist/assets/index-Dm1YZe0A.css +1 -0
  22. package/server/dist/assets/index-G6bcoKqz.js +232 -0
  23. package/server/dist/assets/ini-BEwlwnbL.js +1 -0
  24. package/server/dist/assets/java-CylS5w8V.js +1 -0
  25. package/server/dist/assets/javascript-wDzz0qaB.js +1 -0
  26. package/server/dist/assets/json-Cp-IABpG.js +1 -0
  27. package/server/dist/assets/jsonc-Des-eS-w.js +1 -0
  28. package/server/dist/assets/jsonl-DcaNXYhu.js +1 -0
  29. package/server/dist/assets/jsx-g9-lgVsj.js +1 -0
  30. package/server/dist/assets/kotlin-BdnUsdx6.js +1 -0
  31. package/server/dist/assets/kusto-wEQ09or8.js +1 -0
  32. package/server/dist/assets/latex-DdMFrP5M.js +1 -0
  33. package/server/dist/assets/markdown-Cvjx9yec.js +1 -0
  34. package/server/dist/assets/mdc-Dz5ISc6g.js +1 -0
  35. package/server/dist/assets/mdx-Cmh6b_Ma.js +1 -0
  36. package/server/dist/assets/mermaid-mWjccvbQ.js +1 -0
  37. package/server/dist/assets/php-R6g_5hLQ.js +1 -0
  38. package/server/dist/assets/powershell-Dpen1YoG.js +1 -0
  39. package/server/dist/assets/python-B6aJPvgy.js +1 -0
  40. package/server/dist/assets/ruby-AcS3PBV-.js +1 -0
  41. package/server/dist/assets/rust-B1yitclQ.js +1 -0
  42. package/server/dist/assets/sass-Cj5Yp3dK.js +1 -0
  43. package/server/dist/assets/scss-D5BDwBP9.js +1 -0
  44. package/server/dist/assets/shellscript-DfDnw5Jg.js +1 -0
  45. package/server/dist/assets/sql-BLtJtn59.js +1 -0
  46. package/server/dist/assets/svelte-DR4MIrkg.js +1 -0
  47. package/server/dist/assets/swift-D82vCrfD.js +1 -0
  48. package/server/dist/assets/toml-vGWfd6FD.js +1 -0
  49. package/server/dist/assets/tsx-COt5Ahok.js +1 -0
  50. package/server/dist/assets/typescript-BPQ3VLAy.js +1 -0
  51. package/server/dist/assets/vue-CJgBXYWu.js +1 -0
  52. package/server/dist/assets/xml-sdJ4AIDG.js +1 -0
  53. package/server/dist/assets/yaml-Buea-lGh.js +1 -0
  54. package/server/dist/assets/zig-VOosw3JB.js +1 -0
  55. package/server/dist/index.html +2 -2
  56. package/server/handlers.js +220 -23
  57. package/server/index.js +5 -26
  58. package/server/pidfile.js +71 -0
  59. package/server/terminal-sessions.js +149 -0
  60. package/server/terminal.js +132 -33
  61. package/terminal-session-01-initial.png +0 -0
  62. package/terminal-session-02-before-refresh.png +0 -0
  63. package/terminal-session-03-after-refresh.png +0 -0
  64. package/server/dist/assets/index-B2S7vHJ3.js +0 -79
  65. package/server/dist/assets/index-K-eN8vD6.css +0 -1
package/README.md CHANGED
@@ -5,12 +5,15 @@ A minimal kanban dashboard and git log viewer for [Beads](https://github.com/ste
5
5
  ## Features
6
6
 
7
7
  - **Kanban board** — Issues organized by status: Ready, In Progress, Blocked, Done
8
- - **Git log** — Scrollable commit history with branch selector
9
- - **Bead ID linking** — Bead IDs in commit messages are highlighted as badges
8
+ - **Git log** — Scrollable commit history with branch selector and diff viewer
9
+ - **File explorer** — Browse project files with syntax-highlighted file viewer (40+ languages via Shiki)
10
+ - **Dependency graph** — Interactive DAG visualization with hover highlighting, zoom, and pan
11
+ - **Bead ID linking** — Bead IDs in commit messages are highlighted as clickable badges
12
+ - **Search and filtering** — Filter issues by priority, type, assignee, or free-text search
10
13
  - **Dark/light theme** — Toggle between themes, dark by default
11
14
  - **Auto-refresh** — Polls for updates every 5 seconds
12
15
  - **Integrated terminal** — Built-in terminal panel powered by node-pty and xterm.js
13
- - **Minimal runtime dependencies** — Server uses Node.js stdlib plus `node-pty` and `ws` for the terminal
16
+ - **Settings** — Configurable terminal font-family via settings modal
14
17
 
15
18
  ## Quick Start
16
19
 
@@ -1,183 +1,173 @@
1
- #!/usr/bin/env node
2
-
3
- const path = require('node:path');
4
- const fs = require('node:fs');
5
- const { spawn } = require('node:child_process');
6
-
7
- const SERVER_SCRIPT = path.join(__dirname, '..', 'server', 'index.js');
8
-
9
- // ---------------------------------------------------------------------------
10
- // Argument parsing
11
- // ---------------------------------------------------------------------------
12
-
13
- const rawArgs = process.argv.slice(2);
14
-
15
- // Extract subcommand (start, stop, status) — default to "start"
16
- const SUBCOMMANDS = ['start', 'stop', 'status'];
17
- let subcommand = 'start';
18
- const args = [];
19
- for (const arg of rawArgs) {
20
- if (SUBCOMMANDS.includes(arg) && args.length === 0 && subcommand === 'start') {
21
- subcommand = arg;
22
- } else {
23
- args.push(arg);
24
- }
25
- }
26
-
27
- // --help
28
- if (args.includes('--help') || args.includes('-h')) {
29
- console.log(`bdui — Kanban dashboard and git log viewer for Beads
30
-
31
- Usage:
32
- bdui [project-dir] [options] Start the dashboard (default)
33
- bdui start [project-dir] [options] Start the dashboard
34
- bdui stop [project-dir] Stop a running dashboard
35
- bdui status [project-dir] Show running dashboard info
36
-
37
- Options:
38
- --port <port> Port to listen on (default: 8377)
39
- --foreground Run in foreground (don't daemonize)
40
- --help, -h Show this help message
41
- --version, -v Show version number
42
-
43
- Examples:
44
- bdui # Start dashboard for current directory
45
- bdui /path/to/project # Specify project directory
46
- bdui --port 9000 # Custom port
47
- bdui stop # Stop the running dashboard
48
- bdui status # Check if dashboard is running`);
49
- process.exit(0);
50
- }
51
-
52
- // --version
53
- if (args.includes('--version') || args.includes('-v')) {
54
- const pkg = JSON.parse(fs.readFileSync(path.join(__dirname, '..', 'package.json'), 'utf8'));
55
- console.log(pkg.version);
56
- process.exit(0);
57
- }
58
-
59
- // --foreground
60
- const foreground = args.includes('--foreground');
61
- const filteredArgs = args.filter(a => a !== '--foreground');
62
-
63
- // --port
64
- let customPort = null;
65
- const portIdx = filteredArgs.indexOf('--port');
66
- if (portIdx !== -1) {
67
- customPort = filteredArgs[portIdx + 1];
68
- if (!customPort || isNaN(parseInt(customPort, 10))) {
69
- console.error('Error: --port requires a numeric value');
70
- process.exit(1);
71
- }
72
- filteredArgs.splice(portIdx, 2);
73
- }
74
-
75
- // Remaining arg is the project directory
76
- const projectDir = filteredArgs[0] ? path.resolve(filteredArgs[0]) : process.cwd();
77
-
78
- // ---------------------------------------------------------------------------
79
- // Validation
80
- // ---------------------------------------------------------------------------
81
-
82
- if (!fs.existsSync(projectDir)) {
83
- console.error(`Error: directory not found: ${projectDir}`);
84
- process.exit(1);
85
- }
86
-
87
- if (!fs.existsSync(path.join(projectDir, '.beads'))) {
88
- console.error(`Error: no .beads/ directory found in ${projectDir}`);
89
- console.error('This project does not appear to use Beads issue tracking.');
90
- console.error('See https://github.com/steveyegge/beads to get started.');
91
- process.exit(1);
92
- }
93
-
94
- // ---------------------------------------------------------------------------
95
- // Pidfile helpers
96
- // ---------------------------------------------------------------------------
97
-
98
- const PIDFILE = path.join(projectDir, '.beads-board.pid');
99
-
100
- function getRunningInstance() {
101
- try {
102
- const data = JSON.parse(fs.readFileSync(PIDFILE, 'utf8'));
103
- process.kill(data.pid, 0); // throws if not running
104
- return data;
105
- } catch {
106
- // Clean up stale pidfile
107
- try { fs.unlinkSync(PIDFILE); } catch {}
108
- return null;
109
- }
110
- }
111
-
112
- // ---------------------------------------------------------------------------
113
- // Subcommands
114
- // ---------------------------------------------------------------------------
115
-
116
- if (subcommand === 'status') {
117
- const instance = getRunningInstance();
118
- if (instance) {
119
- console.log(`beads-board running at http://localhost:${instance.port} (pid ${instance.pid})`);
120
- } else {
121
- console.log('beads-board is not running');
122
- process.exit(1);
123
- }
124
- process.exit(0);
125
- }
126
-
127
- if (subcommand === 'stop') {
128
- const instance = getRunningInstance();
129
- if (!instance) {
130
- console.log('beads-board is not running');
131
- process.exit(0);
132
- }
133
- try {
134
- process.kill(instance.pid, 'SIGTERM');
135
- console.log(`beads-board stopped (was http://localhost:${instance.port}, pid ${instance.pid})`);
136
- } catch (err) {
137
- console.error(`Failed to stop beads-board (pid ${instance.pid}): ${err.message}`);
138
- process.exit(1);
139
- }
140
- process.exit(0);
141
- }
142
-
143
- // subcommand === 'start'
144
- const existing = getRunningInstance();
145
- if (existing) {
146
- console.log(`beads-board already running at http://localhost:${existing.port} (pid ${existing.pid})`);
147
- process.exit(0);
148
- }
149
-
150
- if (foreground) {
151
- // Run server in foreground (debugging)
152
- if (customPort) process.env.PORT = customPort;
153
- process.argv = [process.argv[0], __filename, projectDir];
154
- require(SERVER_SCRIPT);
155
- } else {
156
- // Spawn detached server process
157
- const env = { ...process.env };
158
- if (customPort) env.PORT = customPort;
159
-
160
- const child = spawn(process.execPath, [SERVER_SCRIPT, projectDir], {
161
- detached: true,
162
- stdio: 'ignore',
163
- env,
164
- windowsHide: true,
165
- });
166
- child.unref();
167
-
168
- // Wait for pidfile to confirm startup (poll up to 3s)
169
- const start = Date.now();
170
- const poll = setInterval(() => {
171
- const instance = getRunningInstance();
172
- if (instance) {
173
- clearInterval(poll);
174
- console.log(`beads-board running at http://localhost:${instance.port}`);
175
- process.exit(0);
176
- }
177
- if (Date.now() - start > 3000) {
178
- clearInterval(poll);
179
- console.error('Error: server failed to start within 3 seconds');
180
- process.exit(1);
181
- }
182
- }, 100);
183
- }
1
+ #!/usr/bin/env node
2
+
3
+ const path = require('node:path');
4
+ const fs = require('node:fs');
5
+ const { spawn } = require('node:child_process');
6
+
7
+ const SERVER_SCRIPT = path.join(__dirname, '..', 'server', 'index.js');
8
+
9
+ // ---------------------------------------------------------------------------
10
+ // Argument parsing
11
+ // ---------------------------------------------------------------------------
12
+
13
+ const rawArgs = process.argv.slice(2);
14
+
15
+ // Extract subcommand (start, stop, status) — default to "start"
16
+ const SUBCOMMANDS = ['start', 'stop', 'status'];
17
+ let subcommand = 'start';
18
+ const args = [];
19
+ for (const arg of rawArgs) {
20
+ if (SUBCOMMANDS.includes(arg) && args.length === 0 && subcommand === 'start') {
21
+ subcommand = arg;
22
+ } else {
23
+ args.push(arg);
24
+ }
25
+ }
26
+
27
+ // --help
28
+ if (args.includes('--help') || args.includes('-h')) {
29
+ console.log(`bdui — Kanban dashboard and git log viewer for Beads
30
+
31
+ Usage:
32
+ bdui [project-dir] [options] Start the dashboard (default)
33
+ bdui start [project-dir] [options] Start the dashboard
34
+ bdui stop [project-dir] Stop a running dashboard
35
+ bdui status [project-dir] Show running dashboard info
36
+
37
+ Options:
38
+ --port <port> Port to listen on (default: 8377)
39
+ --foreground Run in foreground (don't daemonize)
40
+ --help, -h Show this help message
41
+ --version, -v Show version number
42
+
43
+ Examples:
44
+ bdui # Start dashboard for current directory
45
+ bdui /path/to/project # Specify project directory
46
+ bdui --port 9000 # Custom port
47
+ bdui stop # Stop the running dashboard
48
+ bdui status # Check if dashboard is running`);
49
+ process.exit(0);
50
+ }
51
+
52
+ // --version
53
+ if (args.includes('--version') || args.includes('-v')) {
54
+ const pkg = JSON.parse(fs.readFileSync(path.join(__dirname, '..', 'package.json'), 'utf8'));
55
+ console.log(pkg.version);
56
+ process.exit(0);
57
+ }
58
+
59
+ // --foreground
60
+ const foreground = args.includes('--foreground');
61
+ const filteredArgs = args.filter(a => a !== '--foreground');
62
+
63
+ // --port
64
+ let customPort = null;
65
+ const portIdx = filteredArgs.indexOf('--port');
66
+ if (portIdx !== -1) {
67
+ customPort = filteredArgs[portIdx + 1];
68
+ if (!customPort || isNaN(parseInt(customPort, 10))) {
69
+ console.error('Error: --port requires a numeric value');
70
+ process.exit(1);
71
+ }
72
+ filteredArgs.splice(portIdx, 2);
73
+ }
74
+
75
+ // Remaining arg is the project directory
76
+ const projectDir = filteredArgs[0] ? path.resolve(filteredArgs[0]) : process.cwd();
77
+
78
+ // ---------------------------------------------------------------------------
79
+ // Validation
80
+ // ---------------------------------------------------------------------------
81
+
82
+ if (!fs.existsSync(projectDir)) {
83
+ console.error(`Error: directory not found: ${projectDir}`);
84
+ process.exit(1);
85
+ }
86
+
87
+ if (!fs.existsSync(path.join(projectDir, '.beads'))) {
88
+ console.error(`Error: no .beads/ directory found in ${projectDir}`);
89
+ console.error('This project does not appear to use Beads issue tracking.');
90
+ console.error('See https://github.com/steveyegge/beads to get started.');
91
+ process.exit(1);
92
+ }
93
+
94
+ // ---------------------------------------------------------------------------
95
+ // Pidfile helpers (shared module)
96
+ // ---------------------------------------------------------------------------
97
+
98
+ const { createPidfileManager } = require('../server/pidfile.js');
99
+ const pidfile = createPidfileManager(projectDir);
100
+ function getRunningInstance() { return pidfile.getRunningInstance(); }
101
+
102
+ // ---------------------------------------------------------------------------
103
+ // Subcommands
104
+ // ---------------------------------------------------------------------------
105
+
106
+ if (subcommand === 'status') {
107
+ const instance = getRunningInstance();
108
+ if (instance) {
109
+ console.log(`beads-board running at http://localhost:${instance.port} (pid ${instance.pid})`);
110
+ } else {
111
+ console.log('beads-board is not running');
112
+ process.exit(1);
113
+ }
114
+ process.exit(0);
115
+ }
116
+
117
+ if (subcommand === 'stop') {
118
+ const instance = getRunningInstance();
119
+ if (!instance) {
120
+ console.log('beads-board is not running');
121
+ process.exit(0);
122
+ }
123
+ try {
124
+ process.kill(instance.pid, 'SIGTERM');
125
+ console.log(`beads-board stopped (was http://localhost:${instance.port}, pid ${instance.pid})`);
126
+ } catch (err) {
127
+ console.error(`Failed to stop beads-board (pid ${instance.pid}): ${err.message}`);
128
+ process.exit(1);
129
+ }
130
+ process.exit(0);
131
+ }
132
+
133
+ // subcommand === 'start'
134
+ const existing = getRunningInstance();
135
+ if (existing) {
136
+ console.log(`beads-board already running at http://localhost:${existing.port} (pid ${existing.pid})`);
137
+ process.exit(0);
138
+ }
139
+
140
+ if (foreground) {
141
+ // Run server in foreground (debugging)
142
+ if (customPort) process.env.PORT = customPort;
143
+ process.argv = [process.argv[0], __filename, projectDir];
144
+ require(SERVER_SCRIPT);
145
+ } else {
146
+ // Spawn detached server process
147
+ const env = { ...process.env };
148
+ if (customPort) env.PORT = customPort;
149
+
150
+ const child = spawn(process.execPath, [SERVER_SCRIPT, projectDir], {
151
+ detached: true,
152
+ stdio: 'ignore',
153
+ env,
154
+ windowsHide: true,
155
+ });
156
+ child.unref();
157
+
158
+ // Wait for pidfile to confirm startup (poll up to 3s)
159
+ const start = Date.now();
160
+ const poll = setInterval(() => {
161
+ const instance = getRunningInstance();
162
+ if (instance) {
163
+ clearInterval(poll);
164
+ console.log(`beads-board running at http://localhost:${instance.port}`);
165
+ process.exit(0);
166
+ }
167
+ if (Date.now() - start > 3000) {
168
+ clearInterval(poll);
169
+ console.error('Error: server failed to start within 3 seconds');
170
+ process.exit(1);
171
+ }
172
+ }, 100);
173
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@citadel-labs/beads-ui",
3
- "version": "2.3.0",
3
+ "version": "2.5.0",
4
4
  "description": "Kanban dashboard and git log viewer for Beads",
5
5
  "bin": {
6
6
  "bdui": "bin/beads-board.js"
@@ -33,7 +33,7 @@
33
33
  "author": "Stuart Rimel <stuart.rimel@gmail.com>",
34
34
  "license": "MIT",
35
35
  "dependencies": {
36
- "node-pty": "^1.1.0",
36
+ "node-pty": "1.2.0-beta.12",
37
37
  "ws": "^8.19.0"
38
38
  },
39
39
  "devDependencies": {