These suites had no turbo test task, so they rotted unnoticed. - client: update tests for intended API changes (session.view idle is a DateTime, interrupt's continue became resume, new API groups, the Effect service no longer imports protocol), and assert the service shutdown per platform since Windows cannot catch SIGTERM. - http-recorder: run the record-mode WebSocket test with CI unset; CI=true forces replay mode and the test waited forever for "open". - util: reset the retry test's socket after the request arrives instead of racing the client's write; set TEMP for the child on Windows and compare with the native realpath; exclude colocated tests from the build, which compiled them into dist where bun test ran them twice. - sdk: update two tests for intended behaviour changes, keeping the unknown-session error on the HTTP transport. - merman: hold the established layout families to their original ceilings and give decision-loops its own, drop the wall-clock assertion, and run the cheap label distance check before the clearance check (same output, half the audit CPU). |
||
|---|---|---|
| .. | ||
| script | ||
| src | ||
| test | ||
| package.json | ||
| README.md | ||
| sst-env.d.ts | ||
| tsconfig.build.json | ||
| tsconfig.json | ||
@opencode/client
Private generation target for clients derived directly from OpenCode's authoritative Effect HttpApi.
Entrypoints
@opencode/client: zero-Effect Promise client usingfetch.@opencode/client/effect: rich Effect network client using an environment-providedHttpClient.
The generated surface includes every standard HTTP group from Server's concrete API. The build compiler reads @opencode/server/api; the generated Effect runtime imports a client-local projection built from Protocol, with a generation-equivalence test preventing transport drift. Custom transports such as the PTY WebSocket connection remain outside the generic HTTP client. Run bun run generate after changing the contract and bun run check:generated to detect committed-output drift.
The Effect entrypoint uses canonical decoded values such as Session.ID, Location.Ref, and Prompt. These datatypes come from the lightweight @opencode/schema package and are re-exported so callers depend only on the client surface. Protocol owns endpoint construction and middleware placement; Server supplies the concrete middleware keys used by the build-time API.
The Promise root remains structural and has no Core or Effect runtime dependency. /effect depends only on Effect, Schema, and Protocol and is browser-bundle safe. Bundle-boundary tests enforce both import graphs.
Effect consumers construct canonical decoded inputs:
import { AbsolutePath, Location, OpenCode, Prompt } from "@opencode/client/effect"
const client = yield * OpenCode.make({ baseUrl: "https://opencode.example" })
yield *
client.sessions.create({
location: Location.Ref.make({ directory: AbsolutePath.make("/workspace") }),
})
yield * client.sessions.prompt({ sessionID, prompt: Prompt.make({ text: "Hello" }) })