custom_transport

command
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL