claude-teammate 0.1.237 → 0.1.239
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
package/src/dashboard/README.md
CHANGED
|
@@ -1,66 +1,45 @@
|
|
|
1
1
|
# TM8 Dashboard
|
|
2
2
|
|
|
3
|
-
Web
|
|
3
|
+
Web UI for monitoring the TM8 worker. Runs on port 7881 (this machine) via the globally installed `claude-teammate` npm package.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
> **This source repo is for development only.** Production uses the published npm package — do not point the service at this repo.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
---
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
cd src/dashboard/app
|
|
11
|
-
npm install
|
|
12
|
-
npm run generate
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
Run this once after install and again after any frontend changes. The server falls back to a plain HTML page when the build is missing.
|
|
9
|
+
## Production setup (global npm install)
|
|
16
10
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
Install pm2 globally if not already installed:
|
|
11
|
+
### 1. Install the package
|
|
20
12
|
|
|
21
13
|
```bash
|
|
22
|
-
npm install -g
|
|
14
|
+
npm install -g claude-teammate
|
|
23
15
|
```
|
|
24
16
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
# From the repo root
|
|
29
|
-
pm2 start bin/claude-teammate.js --name tm8 -- start
|
|
30
|
-
pm2 save
|
|
31
|
-
pm2 startup # follow the printed command to enable autostart
|
|
32
|
-
```
|
|
17
|
+
### 2. Build the frontend
|
|
33
18
|
|
|
34
|
-
|
|
19
|
+
The npm package ships Nuxt source but not a pre-built dist. Build once after install (and again after each `npm update -g`):
|
|
35
20
|
|
|
36
21
|
```bash
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
pm2 logs tm8 --lines 200
|
|
22
|
+
DASH=$(npm root -g)/claude-teammate/src/dashboard/app
|
|
23
|
+
cd "$DASH" && npm install && npm run generate
|
|
40
24
|
```
|
|
41
25
|
|
|
42
|
-
|
|
26
|
+
Output lands in `~/.cache/tm8-dashboard/.output/public` — the server reads from there automatically.
|
|
43
27
|
|
|
44
|
-
|
|
45
|
-
pm2 restart tm8
|
|
46
|
-
```
|
|
28
|
+
### 3. systemd service
|
|
47
29
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
Create `/etc/systemd/system/tm8.service` (adjust `User`, `WorkingDirectory`, and paths as needed):
|
|
30
|
+
The service on this machine is `/etc/systemd/system/tm8-card4-dashboard.service`:
|
|
51
31
|
|
|
52
32
|
```ini
|
|
53
33
|
[Unit]
|
|
54
|
-
Description=TM8
|
|
34
|
+
Description=TM8 Dashboard (card4)
|
|
55
35
|
After=network.target
|
|
56
36
|
|
|
57
37
|
[Service]
|
|
58
38
|
Type=simple
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
ExecStart=/usr/bin/node bin/claude-teammate.js start
|
|
39
|
+
ExecStart=/usr/bin/tm8 dashboard --port=7881
|
|
40
|
+
User=tm8-card4
|
|
62
41
|
Restart=on-failure
|
|
63
|
-
RestartSec=
|
|
42
|
+
RestartSec=5
|
|
64
43
|
StandardOutput=journal
|
|
65
44
|
StandardError=journal
|
|
66
45
|
|
|
@@ -68,38 +47,82 @@ StandardError=journal
|
|
|
68
47
|
WantedBy=multi-user.target
|
|
69
48
|
```
|
|
70
49
|
|
|
71
|
-
|
|
50
|
+
Create/update it, then enable:
|
|
72
51
|
|
|
73
52
|
```bash
|
|
74
53
|
sudo systemctl daemon-reload
|
|
75
|
-
sudo systemctl enable tm8
|
|
76
|
-
sudo systemctl start tm8
|
|
77
|
-
sudo systemctl status tm8
|
|
54
|
+
sudo systemctl enable tm8-card4-dashboard
|
|
55
|
+
sudo systemctl start tm8-card4-dashboard
|
|
56
|
+
sudo systemctl status tm8-card4-dashboard
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Logs:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
journalctl -u tm8-card4-dashboard -f
|
|
78
63
|
```
|
|
79
64
|
|
|
80
|
-
|
|
65
|
+
### 4. pm2 alternative
|
|
81
66
|
|
|
82
67
|
```bash
|
|
83
|
-
|
|
68
|
+
pm2 start /usr/bin/tm8 --name tm8-dashboard -- dashboard --port=7881
|
|
69
|
+
pm2 save
|
|
70
|
+
pm2 startup # follow the printed command to enable autostart
|
|
84
71
|
```
|
|
85
72
|
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## Updating to latest version
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
npm update -g claude-teammate
|
|
79
|
+
|
|
80
|
+
DASH=$(npm root -g)/claude-teammate/src/dashboard/app
|
|
81
|
+
cd "$DASH" && npm install && npm run generate
|
|
82
|
+
|
|
83
|
+
sudo systemctl restart tm8-card4-dashboard
|
|
84
|
+
# or: pm2 restart tm8-dashboard
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
86
89
|
## Dashboard URL
|
|
87
90
|
|
|
88
|
-
http://localhost:
|
|
91
|
+
http://localhost:7881
|
|
89
92
|
|
|
90
|
-
|
|
93
|
+
nginx reverse proxy example:
|
|
91
94
|
|
|
92
95
|
```nginx
|
|
93
96
|
location / {
|
|
94
|
-
proxy_pass http://127.0.0.1:
|
|
97
|
+
proxy_pass http://127.0.0.1:7881;
|
|
95
98
|
proxy_http_version 1.1;
|
|
96
99
|
proxy_set_header Upgrade $http_upgrade;
|
|
97
100
|
proxy_set_header Connection keep-alive;
|
|
98
101
|
}
|
|
99
102
|
```
|
|
100
103
|
|
|
104
|
+
---
|
|
105
|
+
|
|
101
106
|
## API notes
|
|
102
107
|
|
|
103
|
-
- `/api/status` — worker state,
|
|
104
|
-
- `/api/usage` — token usage
|
|
108
|
+
- `/api/status` — worker state, polled every 10 s by the UI
|
|
109
|
+
- `/api/usage` — token usage from logs; cached 10 min server-side
|
|
105
110
|
- `/api/logs/stream` — SSE stream of worker log lines
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Development (source repo only)
|
|
115
|
+
|
|
116
|
+
To iterate on dashboard code locally:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
# Run backend (serves API + frontend)
|
|
120
|
+
node src/dashboard/server.js
|
|
121
|
+
|
|
122
|
+
# Or run Nuxt dev server with HMR
|
|
123
|
+
cd src/dashboard/app
|
|
124
|
+
npm install
|
|
125
|
+
npm run dev
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Do not run the systemd service against this source directory.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
+
<Teleport to="body">
|
|
2
3
|
<div class="drawer-overlay" :class="{ open: props.open }" @click="$emit('close')"></div>
|
|
3
4
|
<div class="drawer" :class="{ open: props.open }">
|
|
4
5
|
<div class="drawer-head">
|
|
@@ -166,6 +167,7 @@
|
|
|
166
167
|
</div>
|
|
167
168
|
</div>
|
|
168
169
|
</div>
|
|
170
|
+
</Teleport>
|
|
169
171
|
</template>
|
|
170
172
|
|
|
171
173
|
<script setup lang="ts">
|
|
@@ -57,7 +57,17 @@ const TAG_RE = /^\[[^\]]+\] (?:INFO|ERROR) \[([a-z:-]+)\]/;
|
|
|
57
57
|
|
|
58
58
|
function getTag(line: string): string | null {
|
|
59
59
|
const m = line.match(TAG_RE);
|
|
60
|
-
|
|
60
|
+
if (m) return m[1];
|
|
61
|
+
|
|
62
|
+
// Content-based fallback for log lines written before tagged-logger support
|
|
63
|
+
const body = line.replace(/^\[[^\]]+\]\s+(?:INFO|ERROR)\s+/, "");
|
|
64
|
+
if (/^(?:Jira\s|jira\s)/i.test(body)) return "jira";
|
|
65
|
+
if (/^(?:GitHub\s+issue|GitHub\s+poll|github\s)/i.test(body)) return "github";
|
|
66
|
+
if (/^(?:Draft PR\s|Draft pull request\s|Pull request\s)/i.test(body)) return "draft-pr";
|
|
67
|
+
if (/^PR\s+review\s/i.test(body)) return "review-pr";
|
|
68
|
+
if (/^PR\s+discussion\s/i.test(body)) return "review-discussion";
|
|
69
|
+
|
|
70
|
+
return null;
|
|
61
71
|
}
|
|
62
72
|
|
|
63
73
|
const filteredLines = computed(() => {
|
package/src/dashboard/server.js
CHANGED
|
@@ -34,7 +34,7 @@ const MIME_TYPES = {
|
|
|
34
34
|
".txt": "text/plain; charset=utf-8"
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
-
const USAGE_CACHE_TTL_MS =
|
|
37
|
+
const USAGE_CACHE_TTL_MS = 60 * 60 * 1000;
|
|
38
38
|
let _usageCache = null; // { data, expiresAt }
|
|
39
39
|
|
|
40
40
|
export async function startDashboardServer({ projectRoot, port = 7880 }) {
|