Repository navigation
refactor(shared): move the session history types into their own file - #1753
Conversation
The last type-only slice (plan: .omo/plans/feature-slices-plan.md, section 7): SessionHistoryAgent, SessionResumeSource, SessionHistoryRow, SessionResumeRequest, SessionResumeResponse, SessionHistoryResponse move verbatim from shared/protocol.ts into shared/session-history.ts (types only). It waited for the session resume PR (#1598), which added the resume types beside them. Their routes were already split out (server/session-history-routes.ts); protocol.ts re-exports the names, so every importer compiles unchanged.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Summary
Merge Risk: ⚪ Minimal · up to
|
|
Merge pass: move-only PR, merged on its checks without waiting for a CodeRabbit review, as AGENTS.md allows.
|
The last type-only slice of phase 2 (plan
.omo/plans/feature-slices-plan.md, section 7, item 7). It follows the other type-only slices (#1699 to #1713) and waited for the session resume PR (#1598), which addedSessionResumeSource,SessionResumeRequestandSessionResumeResponsebeside the history types. The session history types move out ofshared/protocol.tsintoshared/session-history.ts. Their routes were already split out (server/session-history-routes.ts), so only the contract types were left inprotocol.ts.What changes
SessionHistoryAgent,SessionResumeSource,SessionHistoryRow,SessionResumeRequest,SessionResumeResponse,SessionHistoryResponse, verbatim with their doc comments, into the newshared/session-history.ts. The file holds types only, with no imports and no values.protocol.ts:export type { SessionHistoryAgent, SessionResumeSource, SessionHistoryRow, SessionResumeRequest, SessionResumeResponse, SessionHistoryResponse } from "./session-history.ts";at the old place, so every importer compiles unchanged.protocol.tsdeclaration uses these names, so nothing else had to stay behind.There is no behaviour to pin: types are erased at runtime, and the routes and their tests are untouched.
Checks
--color-moved:git diff --color-moved=plain origin/main...HEAD -- sharedshows the declarations and their comments as moved (96 lines). The only other line is the re-export inprotocol.ts.bun run typecheckpasses on both tsconfigs, so every importer still compiles through the re-export. No file insrc/orsite/importsshared/session-history.ts.HERDR_TEST_MODE=unit bun test server/session-history.test.ts server/machine-proxy.test.ts src/lib/sessionHistory.test.ts server/claude-store.test.ts: 190 pass, 0 fail. The routes' contract tests (server/api.contract.test.ts,server/device-access.contract.test.ts) run in CI's integration lane.bun run check fast: passes (unit 6244 pass, 0 fail, 13 skip in 442 files, 8 at a time, 57.6s)Outside PRs that touch the same files
No other maintainer PR touches these files. Outside contributors' PRs that touch
shared/protocol.ts: #1714, #1706, #1652, #1442 and #1427.git merge-tree:shared/.shared/protocol.ts. This move adds no new conflict there.protocol.tskeep resolving through the re-export.Move-only: moved declarations plus one re-export line. No changelog fragment: users see no change.