domain

package
v0.220.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const IdleTimeout = 10 * time.Minute

IdleTimeout is how long a thread nobody follows may sit idle before the registry stops its worker, and how long a channel chat keeps following its thread after its last frame before it detaches so the reap can fire. ponytail: a const, a config key when someone needs to tune it.

Variables

This section is empty.

Functions

This section is empty.

Types

type BrowserRelay

type BrowserRelay func(ctx context.Context, frame []byte) []byte

BrowserRelay forwards one browser_command frame from a session worker to the connected browser extension and always answers with the browser_result carrying the frame's id, a failure included. The host wires the relay, which serializes commands for the one browser.

type Client

type Client interface {
	Deliver(frame []byte)
}

Client is one connected client of a thread, such as a WebSocket connection. Deliver hands it one frame.

type LaunchWorker

type LaunchWorker func(key ThreadKey, opts ThreadOptions) (Worker, error)

LaunchWorker starts the worker for a thread.

type ThreadKey

type ThreadKey struct {
	ProjectDir     string
	ConversationID string
}

ThreadKey identifies a thread: the project dir its worker runs in and the conversation the worker carries.

type ThreadOptions

type ThreadOptions struct {
	Model              string   `json:"model,omitempty"`
	Mode               string   `json:"mode,omitempty"`
	SystemPrompt       string   `json:"system_prompt,omitempty"`
	CustomInstructions string   `json:"custom_instructions,omitempty"`
	SandboxDirectories []string `json:"sandbox_directories,omitempty"`
	MaxTurns           int      `json:"max_turns,omitempty"`
}

ThreadOptions override the project's config for one thread's worker. They apply when the worker launches, and zero values keep the project's config.

type ThreadRouter

type ThreadRouter interface {
	// Handle routes one client frame to its thread's worker.
	Handle(c Client, frame []byte)
	// Detach drops a client that stopped following its thread.
	Detach(c Client)
}

ThreadRouter is the surface a driving adapter calls per client frame and on disconnect. The daemon's thread registry implements it.

type Worker

type Worker interface {
	Send(frame []byte) error
	Lines() <-chan []byte
	Stop()
}

Worker is one running session worker. Send writes one frame line to its stdin, and Lines yields its stdout lines until the worker exits.

Jump to

Keyboard shortcuts

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