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

+1 -1
View File
@@ -10,7 +10,7 @@ describe("workspace disk discovery", () => {
let root: string;
beforeEach(() => {
sandbox = makeSandbox("pi2d-discovery-");
sandbox = makeSandbox("pi2-daemon-discovery-");
root = join(sandbox, "agent", "sessions");
mkdirSync(root, { recursive: true });
});
+1 -1
View File
@@ -15,7 +15,7 @@ export interface SessionSpec {
mtime?: Date | number;
}
export function makeSandbox(prefix = "pi2d-ws-"): string {
export function makeSandbox(prefix = "pi2-daemon-ws-"): string {
return mkdtempSync(join(tmpdir(), prefix));
}
+1 -1
View File
@@ -11,7 +11,7 @@ describe("workspace registry", () => {
let project: string;
beforeEach(() => {
sandbox = makeSandbox("pi2d-registry-");
sandbox = makeSandbox("pi2-daemon-registry-");
file = join(sandbox, "data", "workspaces.json");
project = join(sandbox, "project");
mkdirSync(project, { recursive: true });
+1 -1
View File
@@ -43,7 +43,7 @@ describe("workspace store", () => {
let projectGhost: string;
beforeEach(() => {
sandbox = makeSandbox("pi2d-store-");
sandbox = makeSandbox("pi2-daemon-store-");
sessions = join(sandbox, "agent", "sessions");
dataFile = join(sandbox, "data", "workspaces.json");
allowRoot = join(sandbox, "code");