mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-26 08:12:13 +00:00
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).
|
||
|---|---|---|
| .. | ||
| app | ||
| console | ||
| containers | ||
| core | ||
| desktop | ||
| docs | ||
| enterprise | ||
| extensions/zed | ||
| function | ||
| http-recorder | ||
| identity | ||
| llm | ||
| opencode | ||
| plugin | ||
| script | ||
| sdk | ||
| slack | ||
| storybook | ||
| ui | ||
| web | ||