docs(client): fix the Effect client example

The example named client.sessions and passed prompt: Prompt.make(...); the
Effect entrypoint exposes client.session and session.prompt takes text. Copying
it produced a call that neither typechecks nor decodes.
This commit is contained in:
Kit Langton
2026-11-06 17:22:15 -08:00
Unverified
parent b2b5da600e
commit ff0637a443
+4 -4
View File
@@ -16,12 +16,12 @@ The Promise root remains structural and has no Core or Effect runtime dependency
Effect consumers construct canonical decoded inputs:
```ts
import { AbsolutePath, Location, OpenCode, Prompt } from "@opencode/client/effect"
import { AbsolutePath, Location, OpenCode } from "@opencode/client/effect"
const client = yield * OpenCode.make({ baseUrl: "https://opencode.example" })
yield *
client.sessions.create({
const session = yield *
client.session.create({
location: Location.Ref.make({ directory: AbsolutePath.make("/workspace") }),
})
yield * client.sessions.prompt({ sessionID, prompt: Prompt.make({ text: "Hello" }) })
yield * client.session.prompt({ sessionID: session.id, text: "Hello" })
```