SIGN IN SIGN UP

refactor(http-recorder): hide cassette format behind Cassette seam

The Cassette interface used to expose its JSON wrapper type (Cassette =
{ version, metadata, interactions }) through read/write/scan, plus a
path() method. Consumers had to know the file format to use the service.

New surface — domain types only:

  interface Interface {
    read:   (name) => Effect<readonly Interaction[], CassetteNotFoundError>
    append: (name, interaction, metadata?) => Effect<{ findings }>
    exists: (name) => Effect<boolean>
    list:   () => Effect<readonly string[]>
  }

What's gone from the public surface: path(), write(), scan(), the
Cassette wrapper type, Entry.path, the format helpers (cassetteFor,
formatCassette, parseCassette, cassettePath). All file-private to the
new fileSystem adapter.

Two adapters:
- Cassette.fileSystem({ directory? }) — file-backed (today's behavior,
  was Cassette.layer)
- Cassette.memory(initial?) — in-memory, used by the package's own
  tests to exercise replay without disk IO. Proves the seam works;
  not user-facing.

Drive-bys from the simplify pass:
- Errors converted to Data.TaggedError (CassetteNotFoundError,
  UnsafeCassetteError) for Effect-native equality + integration.
- storage.ts (5 LOC stub) merged into cassette.ts. hasCassetteSync
  is now exported from cassette.ts directly.
- Entry { name } collapsed to plain string.
- recorder.ts re-export indirection cleaned up; index.ts pulls
  CassetteNotFoundError from cassette.ts directly.
- httpInteractions / webSocketInteractions now take ReadonlyArray<Interaction>
  rather than Cassette (matches the new read shape).

External consumer in packages/llm/test/recorded-test.ts updated
(Cassette.layer → Cassette.fileSystem).
K
Kit Langton committed
e101318f921eba761e22ae9c1268fa0e0f48df65
Parent: 1c9a2eb