Documentation
¶
Index ¶
- type ACPAgentIO
- type ACPConversation
- func (c *ACPConversation) Messages() []st.ConversationMessage
- func (c *ACPConversation) SaveState() error
- func (c *ACPConversation) Send(messageParts ...st.MessagePart) error
- func (c *ACPConversation) Start(ctx context.Context)
- func (c *ACPConversation) Status() st.ConversationStatus
- func (c *ACPConversation) Stop()
- func (c *ACPConversation) Text() string
- type ChunkableAgentIO
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.
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 ¶
func (c *ACPConversation) Status() st.ConversationStatus
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 ¶
ChunkableAgentIO extends AgentIO with chunk callback support for streaming responses. This interface is what ACPConversation needs from its AgentIO implementation.