Files
openwork/apps/app/scripts
ben 75532f9f77 refactor(app): branded TransportDirectory type prevents Windows path mismatch (#1257)
The server compares session.directory with strict equality, but call sites
could silently pick the wrong path formatter (normalizeDirectoryQueryPath
vs toSessionTransportDirectory) — producing forward-slash paths on Windows
where the server stores native backslashes.

Changes:
- Add TransportDirectory branded type so the compiler rejects raw strings
  where a transport-formatted directory is expected.
- Fix connections/store.ts: switch path discovery from normalizeDirectoryQueryPath
  to toSessionTransportDirectory — this value feeds mcp.status/disconnect calls
  that use the same exact-match semantics (latent Windows bug).
- Fix workspace.ts: remote directory discovery now goes through
  toSessionTransportDirectory (caught by the branded type at compile time).
- Mark normalizeDirectoryQueryPath with JSDoc deprecation for server-query use.
- Add round-trip invariant and idempotency tests that assert create-path
  equals list-path for both Unix and Windows directory formats.
2026-03-31 11:14:00 -07:00
..