Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultConfigPath ¶
func DefaultConfigPath() string
DefaultConfigPath returns the default path for the agent config file.
func SaveConfig ¶
SaveConfig writes the agent config to disk.
Types ¶
type Client ¶
type Client struct {
ServerURL string
SandboxID string
TunnelToken string
OpencodeURL string
OpencodePassword string
// contains filtered or unexported fields
}
Client is the cli-agent tunnel client that connects to the server and forwards HTTP requests to a local opencode instance.
type Config ¶
type Config struct {
Server string `json:"server"`
SandboxID string `json:"sandboxId"`
TunnelToken string `json:"tunnelToken"`
WorkspaceID string `json:"workspaceId"`
Name string `json:"name"`
}
Config holds the local agent's persistent configuration.
func LoadConfig ¶
LoadConfig reads the agent config from disk.
type OpencodeProcess ¶
type OpencodeProcess struct {
Port int
// contains filtered or unexported fields
}
OpencodeProcess manages a local opencode serve subprocess.
func StartOpencode ¶
func StartOpencode(bin string, port int) (*OpencodeProcess, error)
StartOpencode starts "opencode serve --hostname 127.0.0.1 --port {port}" as a child process. It returns immediately after starting the process.
func (*OpencodeProcess) Stop ¶
func (p *OpencodeProcess) Stop()
Stop sends SIGTERM to the child process, waits briefly, then sends SIGKILL if needed.
func (*OpencodeProcess) WaitReady ¶
WaitReady polls http://localhost:{port}/ every 500ms until a response is received or the timeout expires.