acpio

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ACPAgentIO

type ACPAgentIO struct {
	// contains filtered or unexported fields
}

ACPAgentIO implements screentracker.AgentIO using the ACP protocol

func NewWithPipes

func NewWithPipes(ctx context.Context, toAgent io.Writer, fromAgent io.Reader, logger *slog.Logger, getwd func() (string, error)) (*ACPAgentIO, error)

NewWithPipes creates an ACPAgentIO connected via the provided pipes

func (*ACPAgentIO) ReadScreen

func (a *ACPAgentIO) ReadScreen() string

ReadScreen returns the accumulated agent response

func (*ACPAgentIO) SetOnChunk

func (a *ACPAgentIO) SetOnChunk(fn func(chunk string))

SetOnChunk sets a callback that will be called for each streaming chunk.

func (*ACPAgentIO) Write

func (a *ACPAgentIO) Write(data []byte) (int, error)

Write sends a message to the agent via ACP prompt

type ACPConversation

type ACPConversation struct {
	// contains filtered or unexported fields
}

ACPConversation tracks conversations with ACP-based agents. Unlike PTY-based Conversation, ACP has blocking writes where the response is complete when Write() returns.

func NewACPConversation

func NewACPConversation(ctx context.Context, agentIO ChunkableAgentIO, logger *slog.Logger, initialPrompt []st.MessagePart, emitter st.Emitter, clock quartz.Clock) *ACPConversation

NewACPConversation creates a new ACPConversation. If emitter is provided, it will receive events when messages/status/screen change. If clock is nil, a real clock will be used.

func (*ACPConversation) Messages

func (c *ACPConversation) Messages() []st.ConversationMessage

Messages returns the conversation history.

func (*ACPConversation) SaveState

func (c *ACPConversation) SaveState() error

func (*ACPConversation) Send

func (c *ACPConversation) Send(messageParts ...st.MessagePart) error

Send sends a message to the agent synchronously. It blocks until the agent has finished processing and returns any error from the underlying write. Returns a validation error immediately if the message is invalid or another message is already being processed.

func (*ACPConversation) Start

func (c *ACPConversation) Start(ctx context.Context)

Start sets up chunk handling and sends the initial prompt if provided.

func (*ACPConversation) Status

Status returns the current conversation status.

func (*ACPConversation) Stop

func (c *ACPConversation) Stop()

Stop cancels any in-progress operations.

func (*ACPConversation) Text

func (c *ACPConversation) Text() string

Text returns the current streaming response text.

type ChunkableAgentIO

type ChunkableAgentIO interface {
	st.AgentIO
	SetOnChunk(fn func(chunk string))
}

ChunkableAgentIO extends AgentIO with chunk callback support for streaming responses. This interface is what ACPConversation needs from its AgentIO implementation.

Jump to

Keyboard shortcuts

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