Skip to content

refactor: extract daemon orchestration into dedicated modules#198

Merged
thymikee merged 1 commit intomainfrom
refactor/daemon-thin-router
Mar 10, 2026
Merged

refactor: extract daemon orchestration into dedicated modules#198
thymikee merged 1 commit intomainfrom
refactor/daemon-thin-router

Conversation

@thymikee
Copy link
Contributor

@thymikee thymikee commented Mar 9, 2026

Summary

Closes #160.

  • Extracted src/daemon/server-lifecycle.ts (139 LOC): lock/info file management, code signature resolution, env parsing.
  • Extracted src/daemon/request-router.ts (261 LOC): request dispatch orchestration across all handlers via createRequestHandler.
  • Extracted src/daemon/transport.ts (129 LOC): socket server creation, listen helpers, disconnect/abort logic.
  • Reduced src/daemon.ts from ~605 LOC to 141 LOC — now a thin entrypoint wiring dependencies.
  • All modules under 300 LOC. No behavior changes.
  • 4 files touched.

Validation

  • pnpm typecheck — clean
  • pnpm test:unit — 591/591 pass
  • pnpm test:smoke — 7/7 pass

🤖 Generated with Claude Code

@github-actions
Copy link

github-actions bot commented Mar 9, 2026

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://callstackincubator.github.io/agent-device/pr-preview/pr-198/

Built to branch gh-pages at 2026-03-10 09:26 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Restore src/daemon.ts to thin-router entrypoint by extracting:
- server-lifecycle.ts: lock/info file management, code signature, env parsing
- request-router.ts: request dispatch orchestration across handlers
- transport.ts: socket server, listen helpers, disconnect/abort logic

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@thymikee thymikee force-pushed the refactor/daemon-thin-router branch from ff75476 to 305f724 Compare March 10, 2026 09:25
@thymikee thymikee merged commit 63d9f00 into main Mar 10, 2026
7 checks passed
@thymikee thymikee deleted the refactor/daemon-thin-router branch March 10, 2026 09:27
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.

Refactor daemon entrypoint back to thin-router responsibilities

1 participant