mirror of
https://github.com/getpaseo/paseo.git
synced 2026-07-29 12:01:31 +00:00
What changed: - Added a private sendCorrelatedRequest helper in daemon-client to centralize requestId-correlated response selection. - Migrated a large contiguous set of RPC methods to the helper: checkout/worktree/branch operations, file explorer/token/icon, provider+speech+commands RPCs, wait_for_finish, and terminal list/create/subscribe/kill/attach/detach. - Preserved existing behavior including special-case filtering for checkout subscriptionId. Reasoning: - daemon-client had repeated type+requestId matching blocks across many methods, increasing maintenance cost and decision-point sprawl. - This refactor keeps transport behavior unchanged while reducing duplicated control flow and making future RPC additions less error-prone. Verification: - npm run -w packages/server test -- src/client/daemon-client.test.ts - npm run -w packages/server typecheck - npm run typecheck Notes for next agent: - There are still many non-migrated sendRequest callsites in daemon-client (notably agent lifecycle/interaction and some status-typed selectors) that can be moved to the same helper in follow-up refactors. - I hit TS generic narrowing limits while extracting the helper and solved it via a constrained correlated message type + explicit payload narrowing cast; behavior remains covered by existing daemon-client tests.