Epic 2: Server Foundation — Issue 1/5
Source: Composite — 2-agent's lifecycle + serve-auth's security
Description
Create the ppg serve command and Fastify server scaffold with plugin architecture, CORS, health endpoint, graceful shutdown, and state file management.
Acceptance Criteria
Files to Create/Modify
src/commands/serve.ts (new)
src/server/index.ts (new)
src/lib/paths.ts (add serve paths)
Epic 2: Server Foundation — Issue 1/5
Source: Composite — 2-agent's lifecycle + serve-auth's security
Description
Create the
ppg servecommand and Fastify server scaffold with plugin architecture, CORS, health endpoint, graceful shutdown, and state file management.Acceptance Criteria
src/commands/serve.ts— Commander.js registration with--port,--host,--token,--daemon,--jsonsrc/server/index.ts— Fastify instance with CORS, plugin registration hooksGET /healthreturns{ status: "ok", uptime, version }serve.json) with0o600permissionsserveConfigPath(),servePidPath()inlib/paths.tsFiles to Create/Modify
src/commands/serve.ts(new)src/server/index.ts(new)src/lib/paths.ts(add serve paths)