perf: lighter, louder local install — vendored ReDoc, bootstrap failures shown in the session
- Plugin bootstrap: a failed npm install, a Node older than 22.5 or a failed UI build is recorded in runtime/last-failure.json; the next SessionStart prints it once as a systemMessage naming the log and /agenthub-doctor (a different failure is reported again; a successful bootstrap clears it). The foreground pass checks the Node version itself and spawns no worker on an old Node. - ReDoc: the standalone bundle (redoc 2.5.4, MIT, licence files kept) is vendored under server/vendor/redoc/ and the `redoc` dependency dropped — a runtime install (npm ci --omit=dev --ignore-scripts) goes 126 MB -> 45 MB. vendor/ is excluded from the header audit and prettier. - git missing from PATH: lane git actions answer 503 EGITMISSING with the install command instead of a bare ENOENT. - package.json engines: node >=22.5.0 (node:sqlite), matching MIN_NODE. - Docs: INSTALL.md is the one install/setup guide (SETUP.md merged in and now a pointer); no VS Code extension claim, one client-install hint, no windows-build-tools, better-sqlite3 notes scoped to checkouts, new "Plugin bootstrap never comes up" troubleshooting entry.
This commit is contained in:
@@ -1006,6 +1006,9 @@ cannot collide on `index.lock`.
|
||||
the file resolves by removing it. `merge-commit` is `409 ECONFLICTS` while
|
||||
anything is unmerged, and it and `merge-abort` are `409 ENOMERGE` with no
|
||||
merge in progress. `merge-abort` needs `confirm: true` (`400 ECONFIRM`).
|
||||
- Any action on a host with no `git` binary (or none on the dashboard's PATH)
|
||||
is `503 EGITMISSING`: a missing dependency, not a bad request; the message
|
||||
carries the install command (like `ETMUXMISSING` for tmux).
|
||||
- `push` pushes `HEAD`, never a branch name from the request, so a workspace can
|
||||
only push the branch it is on.
|
||||
- A **path** in the body is never trusted as a path: `stage`, `unstage` and
|
||||
|
||||
+1
-1
@@ -115,7 +115,7 @@ Internal build — all rights reserved.
|
||||
|
||||
| Need | Version | Required for |
|
||||
|---|---|---|
|
||||
| **Node.js** | >= 20 (>= 22.5 for a plugin install) | Everything. Both suites are verified green on **24** and **26** |
|
||||
| **Node.js** | >= 22.5 (`node:sqlite`; Node 20 is end-of-life) | Everything. Both suites are verified green on **24** and **26** |
|
||||
| **npm** | 9+ | Ships with Node |
|
||||
| **git** | any | Cloning, and every workspace operation (worktrees, branch/status reads) |
|
||||
| **tmux** | 3.x | The browser run console, `agenthub workspace shell`, typing `/reload-plugins` into a live pane |
|
||||
|
||||
+1
-1
@@ -81,7 +81,7 @@ Internal build — all rights reserved.
|
||||
|
||||
| Cần | Phiên bản | Dùng cho |
|
||||
|---|---|---|
|
||||
| **Node.js** | >= 20 (>= 22.5 nếu cài qua plugin) | Tất cả. Cả hai test suite verify xanh trên Node **24** và **26** |
|
||||
| **Node.js** | >= 22.5 (`node:sqlite`; Node 20 đã hết hạn hỗ trợ) | Tất cả. Cả hai test suite verify xanh trên Node **24** và **26** |
|
||||
| **npm** | 9+ | Đi kèm Node |
|
||||
| **git** | bất kỳ | Clone repo, và mọi thao tác workspace (worktree, đọc branch/status) |
|
||||
| **tmux** | 3.x | Run console trên trình duyệt, `agenthub workspace shell`, gõ `/reload-plugins` vào pane đang sống |
|
||||
|
||||
+17
-6
@@ -61,13 +61,13 @@ claude --plugin-dir plugins/agenthub-analytics
|
||||
## Prerequisites
|
||||
|
||||
- [Claude Code](https://docs.anthropic.com/en/docs/claude-code) installed and authenticated
|
||||
- Node **>= 22.5** when installing via the `agenthub` plugin. A plugin install has no
|
||||
native `better-sqlite3`, so the server stores data through `node:sqlite`, which
|
||||
landed in 22.5. The bootstrap refuses with one line on anything older instead
|
||||
of letting the server crash. (A checkout install still works on Node >= 20.)
|
||||
- Node **>= 22.5**. A plugin install has no native `better-sqlite3`, so the
|
||||
server stores data through `node:sqlite`, which landed in 22.5. The bootstrap
|
||||
refuses on anything older instead of letting the server crash, and says so in
|
||||
the session (below). A checkout needs the same (`engines` in `package.json`).
|
||||
- The Agent Monitor dashboard reachable at `http://localhost:4820` — the `agenthub`
|
||||
plugin starts it for you; a checkout starts it with `npm start` (see
|
||||
[SETUP.md](../SETUP.md))
|
||||
[INSTALL.md](../INSTALL.md))
|
||||
|
||||
Skills and commands are invoked as `/agenthub-<plugin>:<name>`. Agents are dispatched automatically by Claude Code (or named explicitly).
|
||||
|
||||
@@ -124,7 +124,7 @@ waits on an install:
|
||||
|
||||
1. **Fast path** — recorded state matches this plugin build and a server is live → exit. "Live" means a discovery entry whose pid answers AND whose `startedAt` is after this boot (60 s margin): an entry left over from before a reboot names a pid the OS may have handed to an unrelated process, and without systemd (macOS) nothing else clears it.
|
||||
2. **Superseded check** — if Claude Code records a DIFFERENT build of this plugin as installed, this one logs a line and does nothing else (see [A retired build never acts](#a-retired-build-never-acts)).
|
||||
3. **Node gate** — refuse below 22.5 with one line (see Prerequisites).
|
||||
3. **Node gate** — refuse below 22.5 with one line (see Prerequisites). Also checked by the foreground pass itself (it costs nothing), which then spawns no worker and tells the session at once.
|
||||
4. **Lock** — atomic `mkdir` lock holding the PID; reclaimed when the owner is dead or the lock is older than 10 minutes, so two sessions cannot race the install or spawn two servers.
|
||||
5. **Install** — only when the dependencies changed (`depsHash` covers what npm installs — the dependency lists and the lockfile's package tree — never the release's own `version`, so a plain version bump reinstalls nothing): `npm install --omit=dev --ignore-scripts` into the runtime dir, output in `runtime/npm-install.log`, run as the npm bundled with the node running the bootstrap (`npmCommand`: its `npm-cli.js` beside `process.execPath`, no shell, that node's directory first on PATH; `npm` on PATH only when that node ships none) — the update chain runs with the dashboard server's environment, whose PATH need not reach `npm.cmd` on Windows. The UI build below and the doctor's npm row use the same npm (never into the plugin cache, which is garbage-collected and replaced on every update). `--ignore-scripts` keeps the root `postinstall` from pulling the whole Vite client toolchain.
|
||||
6. **Legacy hook cleanup** — see above.
|
||||
@@ -153,6 +153,17 @@ goes to `~/.claude/agenthub/runtime/bootstrap.log`; npm's own output goes to
|
||||
`npm-install.log` and the UI build's to `client-build.log` next to it; the server's own output goes to
|
||||
`server.log`.
|
||||
|
||||
**A failure is reported once, in the session.** The worker's output is
|
||||
discarded, so a Node that is too old, a failed npm install or a failed UI build
|
||||
is recorded in `runtime/last-failure.json` (kind, message, log file). The NEXT
|
||||
foreground pass — its stdout is what Claude Code reads — prints it as a
|
||||
SessionStart `{"systemMessage": "AgentHub: … — details in <log>. Run
|
||||
/agenthub-doctor …"}` and marks it reported, so the same failure is not repeated
|
||||
every session; a different failure is reported again, and a bootstrap that
|
||||
succeeds removes the file. The steady state prints nothing, and the report is a
|
||||
single small read (plus one write, only when there is something to show) — the
|
||||
fast path still spawns nothing.
|
||||
|
||||
### A retired build never acts
|
||||
|
||||
`claude plugin update` unpacks the new version into a **new** cache directory
|
||||
|
||||
+6
-7
@@ -9,8 +9,7 @@ Comprehensive documentation for the Agent Dashboard project.
|
||||
- [Architecture Overview](../ARCHITECTURE.md) - System design and technical reference
|
||||
- [I18N Architecture](./I18N.md) - Internationalization architecture and usage guide
|
||||
- [CLI Reference](./CLI.md) - The `agenthub` terminal CLI: every command, discovery, safety model
|
||||
- [Setup Guide](../SETUP.md) - Installation and configuration
|
||||
- [Installation](../INSTALL.md) - Detailed installation instructions
|
||||
- [Installation & setup](../INSTALL.md) - Installation, configuration and troubleshooting
|
||||
|
||||
---
|
||||
|
||||
@@ -20,7 +19,7 @@ Comprehensive documentation for the Agent Dashboard project.
|
||||
|
||||
```mermaid
|
||||
graph TB
|
||||
Start[Start Here] --> Setup[SETUP.md<br/>Installation & Config]
|
||||
Start[Start Here] --> Setup[INSTALL.md<br/>Installation & Config]
|
||||
Start --> Architecture[ARCHITECTURE.md<br/>System Design]
|
||||
|
||||
Setup --> Client[Client README<br/>React UI docs]
|
||||
@@ -62,7 +61,7 @@ graph TB
|
||||
|
||||
```mermaid
|
||||
graph LR
|
||||
A[New to Project] --> B[Read SETUP.md]
|
||||
A[New to Project] --> B[Read INSTALL.md]
|
||||
B --> C[Install Dependencies]
|
||||
C --> D[Run npm run dev]
|
||||
D --> E[Open localhost:5173]
|
||||
@@ -75,7 +74,7 @@ graph LR
|
||||
|
||||
1. Install the system packages — `node` (20+), `git`, and `tmux` (the run
|
||||
console has no fallback without it): [INSTALL.md → Step 0](../INSTALL.md#step-0--system-packages)
|
||||
2. Read [SETUP.md](../SETUP.md)
|
||||
2. Read the rest of [INSTALL.md](../INSTALL.md)
|
||||
3. Run `npm run setup`
|
||||
4. Run `npm run dev`
|
||||
5. Open browser to `http://localhost:5173`
|
||||
@@ -287,7 +286,7 @@ graph LR
|
||||
**Documentation:**
|
||||
- [Hook System Guide](./HOOKS.md)
|
||||
- [Hook Processing](../server/README.md#hook-processing)
|
||||
- [Installation](../SETUP.md#install-hooks)
|
||||
- [Installation](../INSTALL.md#hook-auto-installation)
|
||||
|
||||
---
|
||||
|
||||
@@ -441,4 +440,4 @@ This documentation covers:
|
||||
- ✅ **Internationalization** - Language resources, switching flow, locale formatting, rollout checklist
|
||||
- ✅ **Development guides** - Setup, testing, contributing
|
||||
|
||||
**Start with:** [SETUP.md](../SETUP.md) for installation, then explore specific areas based on your role.
|
||||
**Start with:** [INSTALL.md](../INSTALL.md) for installation, then explore specific areas based on your role.
|
||||
|
||||
Reference in New Issue
Block a user