feat: session-first workspace activity and installable daemon

Workspaces page:
- list the newest sessions across workspaces in the activity column; the
  daemon exposes GET /api/v1/sessions/recent as a disk projection and the
  browser enriches live rows from the per-workspace session relay
- put recent activity first below 1100px and fix the mobile page-header
  flex-basis gap

Smoke:
- pin PI2_HOST=127.0.0.1 in both smoke scripts and make the startup-line
  assertion follow the configured host; the daemon default stays 0.0.0.0

Install:
- standalone binary build/install scripts, packaging templates, CI/release
  hooks, CLI-first install docs and the supporting config/doctor changes
This commit is contained in:
yuez committed 2026-10-28 10:53:48 +08:00
1 parent fc51c3be37
commit d2e20d428a
50 files changed
+5104 -188

No files matched your search

+30
View File
@@ -227,6 +227,36 @@ describe("workspace disk discovery", () => {
}
});
it("defaults the root to PI2_CODING_AGENT_DIR/sessions, taking precedence over PI_CODING_AGENT_DIR", () => {
const pi2Agent = join(sandbox, "pi2-agent");
const pi2Sessions = join(pi2Agent, "sessions");
mkdirSync(pi2Sessions, { recursive: true });
writeSessionDir(pi2Sessions, encodedDirName(sandbox), [
{ name: "2026-10-10T06-40-33-032Z_pi2.jsonl", cwd: sandbox, id: "pi2" },
]);
const piAgent = join(sandbox, "pi-agent");
const piSessions = join(piAgent, "sessions");
mkdirSync(piSessions, { recursive: true });
writeSessionDir(piSessions, encodedDirName(sandbox), [
{ name: "2026-10-10T06-40-33-032Z_pi.jsonl", cwd: sandbox, id: "pi" },
]);
const prevPi2 = process.env.PI2_CODING_AGENT_DIR;
const prevPi = process.env.PI_CODING_AGENT_DIR;
process.env.PI2_CODING_AGENT_DIR = pi2Agent;
process.env.PI_CODING_AGENT_DIR = piAgent;
try {
const discovered = createDiscovery().discover();
expect(discovered).toHaveLength(1);
expect(discovered[0]?.dir).toBe(join(pi2Sessions, encodedDirName(sandbox)));
} finally {
if (prevPi2 === undefined) delete process.env.PI2_CODING_AGENT_DIR;
else process.env.PI2_CODING_AGENT_DIR = prevPi2;
if (prevPi === undefined) delete process.env.PI_CODING_AGENT_DIR;
else process.env.PI_CODING_AGENT_DIR = prevPi;
}
});
it("ignores a vanished directory gracefully", () => {
const dir = writeSessionDir(root, encodedDirName(sandbox), [
{ name: "2026-10-10T06-40-33-032Z_a.jsonl", cwd: sandbox, id: "a" },