Skip to content

feat: Phase 2 — daemon + CLI rewrite#40

Merged
vreshch merged 2 commits intomasterfrom
feature/phase-2-rewrite
Mar 20, 2026
Merged

feat: Phase 2 — daemon + CLI rewrite#40
vreshch merged 2 commits intomasterfrom
feature/phase-2-rewrite

Conversation

@vreshch
Copy link
Contributor

@vreshch vreshch commented Mar 20, 2026

Summary

  • Full rewrite of @agentage/cli from v0.1.19 → v0.2.0 — daemon + CLI in single binary
  • Daemon: Express + WebSocket server on port 4243, background process with PID file, agent discovery, run execution
  • CLI: 11 commands (run, agents, runs, machines, status, login, logout, logs, daemon stop/restart) via Commander.js
  • Discovery: markdown factory (.agent.md, SKILL.md) + code factory (agent.ts/agent.js via jiti)
  • WebSocket event buffering: per-run replay buffer (200 msg cap, 60s TTL) so late subscribers get past events
  • Refresh fix: POST /api/agents/refresh now actually rescans discovery directories
  • Modernized: Vitest, ES2024, NodeNext, Node 22+, Prettier, binary renamed agent/agentkitagentage
  • Hub sync stubbedlogin/logout/machines show placeholder, full sync comes in Phase 4

Tests

  • 122 tests total (102 unit/integration + 20 E2E)
  • E2E tests cover full daemon lifecycle: config creation, agent discovery from .agent.md files, run execution via REST API, WebSocket streaming with event replay, run lifecycle, refresh rescan, REST API contract validation
  • Coverage >= 70% (branches, functions, lines, statements)

Test plan

  • npm run verify passes (type-check + lint + format:check + test + build)
  • Coverage >= 70%
  • npm pack --dry-run — only dist/, package.json, LICENSE
  • Binary works: node dist/cli.js --version → 0.2.0
  • No old code: zero hits for registry/agentkit/inquirer/SdkConfig
  • No any types in source
  • E2E: daemon starts and returns healthy status
  • E2E: discovers agents from .agent.md files on disk
  • E2E: runs agent via REST, streams output via WebSocket
  • E2E: WebSocket replay works for late subscribers
  • E2E: refresh discovers newly added agents
  • E2E: REST API contract matches spec (health, agents, runs)
  • CI green

vreshch added 2 commits March 20, 2026 22:51
Full rewrite of @agentage/cli from v0.1.19 to v0.2.0.

- Daemon: Express + WebSocket server on port 4243, background process with PID file
- CLI: 11 commands (run, agents, runs, machines, status, login, logout, logs, daemon stop/restart)
- Discovery: markdown factory (.agent.md) + code factory (agent.ts/js) via jiti
- Modernized: Vitest, ES2024, NodeNext, Node 22, Prettier
- Binary renamed: agent/agentkit → agentage
- Hub sync stubbed for Phase 4
- 102 tests, coverage >= 70%
- Fix race condition: buffer events per run so late WS subscribers
  get replayed events (200 msg cap, 60s TTL auto-cleanup)
- Fix POST /api/agents/refresh to actually rescan discovery dirs
- Add server.setFactories() for refresh to use correct factories
- Add 20 E2E tests covering scenarios 1-9 from Phase 2 exit criteria:
  config creation, agent discovery from .agent.md, run execution,
  WebSocket streaming with replay, run lifecycle, refresh rescan,
  REST API contract validation, error cases
- Total: 122 tests (102 unit/integration + 20 E2E)
@vreshch vreshch force-pushed the feature/phase-2-rewrite branch from e83be53 to 691c0ec Compare March 20, 2026 21:52
@vreshch vreshch marked this pull request as ready for review March 20, 2026 21:56
@vreshch vreshch merged commit 2026d05 into master Mar 20, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant