feat(cli)!: merge the daemon into pi2 as the daemon subcommand

`pi2 daemon [start] [flags]` now starts the web-console daemon. The
`pi2d` executable, its bin entry and its entry module are removed: the
daemon keeps its lock -> token -> plugin socket -> listen -> daemon.json
lifecycle, its single stdout line (`pi2 daemon listening on ...`) and the
signal handling that leaves managed nvim instances running.

Service files are renamed to `pi2.service` / `com.pi2.daemon`, and the
smoke and e2e harnesses start the daemon through `pi2 daemon`.

BREAKING CHANGE: the `pi2d` command no longer exists; use `pi2 daemon`
(or `pi2 daemon start`). Existing systemd/launchd units installed under
the old names must be reinstalled with `pi2 install-service --write`.
This commit is contained in:
yuez committed 2026-10-22 15:47:48 +08:00
1 parent b02f4e9070
commit 7e780515ac
38 files changed
+295 -232

No files matched your search

+4 -4
View File
@@ -12,7 +12,7 @@
| node | v22.23.1 |
| nvim | 0.12.6 |
| pi | 1.3.0 |
| daemon | `pi2d` @ `31f3630` + working-tree fixes |
| daemon | `pi2 daemon` @ `31f3630` + working-tree fixes |
| plugin | `pi2.nvim` `feat/web-console` @ `ffec47c` + working-tree fixes |
| browser | Chrome (Playwright 1.63, headless) |
| model | `cliproxyapi` (real turns; `deepseek-v4-pro` in the browser run) |
@@ -73,7 +73,7 @@ C3 dark/light screenshots · C4 zero unexpected console errors/pageerrors.
is implemented; `subagent.dispatch` accepts the canonical `items[]` shape;
`attention.respond` accepts the structured response table.
### Daemon (`pi2d`)
### Daemon (`pi2 daemon`)
- Workspaces outside `PI2_WORKSPACE_ROOTS` returned `500 E_INTERNAL`; now
`403 E_FORBIDDEN`.
@@ -86,7 +86,7 @@ C3 dark/light screenshots · C4 zero unexpected console errors/pageerrors.
- `/api/v1/info` gained additive `hostname`, `os`, `version`, `uptimeMs`, `pid`,
`port`; `/health` reflects instance/workspace/auth state.
### Web (`pi2d/web`)
### Web (`web/`)
- Pairing posted `pair.redeem` to the bearer-gated `/api/v1/cmd` → every pairing
401. The manual/scan flows now redeem the public `POST /api/v1/pair`
@@ -124,7 +124,7 @@ C3 dark/light screenshots · C4 zero unexpected console errors/pageerrors.
## Reproduction
```bash
cd /home/yuez/Workspace/Neovim/pi2d
cd <repo> # the pi2 CLI/daemon checkout (this repository)
bash scripts/e2e/run-all.sh # builds daemon + web, runs API then browser
# individual suites