Skip to content

refactor: split daemon client facade#773

Open
thymikee wants to merge 1 commit into
mainfrom
refactor/daemon-client-facade
Open

refactor: split daemon client facade#773
thymikee wants to merge 1 commit into
mainfrom
refactor/daemon-client-facade

Conversation

@thymikee

Copy link
Copy Markdown
Member

Summary

Refactors src/daemon-client.ts into a 181 LOC facade while preserving its public export surface and request orchestration behavior.

Architecture boundaries:

  • lifecycle/settings and daemon reuse/startup live in src/daemon-client-lifecycle.ts
  • daemon metadata lock/info parsing, stale cleanup, startup cleanup, and startup hints live in src/daemon-client-metadata.ts
  • socket/HTTP transport selection, probing, fallback, and request mechanics live in src/daemon-client-transport.ts
  • HTTP JSON-RPC/lease payload projection lives in src/daemon-client-rpc.ts
  • request timeout aftermath, Apple runner cleanup, and daemon reset policy live in src/daemon-client-timeout.ts

Touched files: 7. The fallow health baseline only moves/reduces the existing daemon-client path allowance from the old file to the new focused modules.

Closes #727

Validation

Focused daemon-client unit coverage passed: pnpm exec vitest run --project unit src/utils/__tests__/daemon-client.test.ts src/utils/__tests__/daemon-client-lifecycle.test.ts src/__tests__/daemon-client-progress.test.ts.

Remote provider scenario command loaded successfully but both loopback-backed cases skipped in this environment: pnpm exec vitest run --project provider-integration test/integration/provider-scenarios/remote-daemon-client.test.ts.

Static/build gates passed: pnpm format, pnpm check:quick, pnpm check:fallow --base origin/main, and pnpm build.

@github-actions

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
JS raw 1.2 MB 1.2 MB -13.3 kB
JS gzip 400.1 kB 396.6 kB -3.5 kB
npm tarball 519.3 kB 515.3 kB -4.0 kB
npm unpacked 1.7 MB 1.7 MB -13.6 kB

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 26.4 ms 25.2 ms -1.2 ms
CLI --help 42.0 ms 40.6 ms -1.3 ms

Top changed chunks:

Chunk Raw diff Gzip diff
dist/src/2415.js -27.9 kB -7.5 kB
dist/src/session.js +17.0 kB +4.5 kB
dist/src/8173.js -588 B -211 B
dist/src/8699.js -780 B -196 B
dist/src/args.js -779 B -187 B

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: split daemon-client.ts into lifecycle / transport / progress / artifacts modules (M2-1)

1 participant