Documentation
¶
Overview ¶
Demonstrates opencodesdk.WithTransport — injecting a custom Transport in place of the default `opencode acp` subprocess.
The primary use case is testing: wire an in-memory ACP pair via io.Pipe so your code can exercise the SDK end-to-end without requiring a real opencode binary. You can also use it to bridge to a remote ACP server over TCP / TLS / an existing session.
This example implements a minimal fake agent that advertises loadSession + image prompt capability and answers session/prompt with a canned response, then runs opencodesdk.QueryContent against it.
go run ./examples/custom_transport
Click to show internal directories.
Click to hide internal directories.