Documentation
¶
Index ¶
- Constants
- func AgentMessageToConversationEntries(msg AgentMessage) []driver.ConversationEntry
- type AbortRequest
- type AbortResponse
- type AgentEvent
- type AgentEventType
- type AgentMessage
- type AgentMessageRecord
- type AgentService
- type AgentSessionSummary
- type AgentState
- type AgentToolResult
- type ContinueRequest
- type CreateAgentSessionRequest
- type CreateAgentSessionResponse
- type DestroyAgentSessionRequest
- type DestroyAgentSessionResponse
- type EventReceiver
- type FollowUpRequest
- type FollowUpResponse
- type GetAgentSessionRequest
- type GetAgentSessionResponse
- type ListAgentSessionsRequest
- type ListAgentSessionsResponse
- type ResumeSessionRequest
- type ResumeSessionResponse
- type SendMessageRequest
- type SessionConfig
- type SessionMetrics
- type SteerRequest
- type SteerResponse
- type SubscribeEventsRequest
- type ToolEnvironmentConfig
- type ToolEnvironmentType
Constants ¶
View Source
const ( AgentMessageRoleUser = "user" AgentMessageRoleAssistant = "assistant" AgentMessageRoleToolResult = "tool_result" )
View Source
const CurrentConversationSchemaVersion = 1
CurrentConversationSchemaVersion is the supported schema version for ResumeSessionRequest.ConversationLog.
Variables ¶
This section is empty.
Functions ¶
func AgentMessageToConversationEntries ¶
func AgentMessageToConversationEntries(msg AgentMessage) []driver.ConversationEntry
AgentMessageToConversationEntries converts an AgentMessage into canonical termmux conversation entries used for cross-agent resume/session-log bridges.
Types ¶
type AbortRequest ¶
type AbortResponse ¶
type AbortResponse struct{}
type AgentEvent ¶
type AgentEvent struct {
Type AgentEventType
SessionID string
DriverSessionID string
State AgentState
Turn int
Message *AgentMessage
Assistant *ai.AssistantMessage
ToolName string
ToolCallID string
ToolResult *AgentToolResult
Delta string
ControlMessage string
ErrorMessage string
At time.Time
Metadata map[string]any
}
type AgentEventType ¶
type AgentEventType string
const ( EventSessionStarted AgentEventType = "session_started" EventSessionEnded AgentEventType = "session_ended" EventTurnStarted AgentEventType = "turn_started" EventTurnCompleted AgentEventType = "turn_completed" EventAgentMessageDelta AgentEventType = "agent_message_delta" EventAgentMessageCompleted AgentEventType = "agent_message_completed" EventThinkingDelta AgentEventType = "thinking_delta" EventToolStarted AgentEventType = "tool_started" EventToolUpdate AgentEventType = "tool_update" EventToolCompleted AgentEventType = "tool_completed" EventStateChange AgentEventType = "state_change" EventSteeringApplied AgentEventType = "steering_applied" EventFollowUpEnqueued AgentEventType = "followup_enqueued" EventAborted AgentEventType = "aborted" EventDriverError AgentEventType = "driver_error" EventProviderError AgentEventType = "provider_error" EventToolError AgentEventType = "tool_error" EventTerminalToolCompleted AgentEventType = "terminal_tool_completed" )
type AgentMessage ¶
func RecordToAgentMessage ¶
func RecordToAgentMessage(rec AgentMessageRecord) (AgentMessage, error)
RecordToAgentMessage converts a serialized record back to an in-memory AgentMessage.
type AgentMessageRecord ¶
func AgentMessageToRecord ¶
func AgentMessageToRecord(msg AgentMessage) (AgentMessageRecord, error)
AgentMessageToRecord converts an in-memory AgentMessage to the serializable record format used for persistence and resume.
type AgentService ¶
type AgentService interface {
CreateSession(ctx context.Context, req *CreateAgentSessionRequest) (*CreateAgentSessionResponse, error)
GetSession(ctx context.Context, req *GetAgentSessionRequest) (*GetAgentSessionResponse, error)
ListSessions(ctx context.Context, req *ListAgentSessionsRequest) (*ListAgentSessionsResponse, error)
SendMessage(ctx context.Context, req *SendMessageRequest) (EventReceiver, error)
Continue(ctx context.Context, req *ContinueRequest) (EventReceiver, error)
Steer(ctx context.Context, req *SteerRequest) (*SteerResponse, error)
FollowUp(ctx context.Context, req *FollowUpRequest) (*FollowUpResponse, error)
Abort(ctx context.Context, req *AbortRequest) (*AbortResponse, error)
SubscribeEvents(ctx context.Context, req *SubscribeEventsRequest) (EventReceiver, error)
ResumeSession(ctx context.Context, req *ResumeSessionRequest) (*ResumeSessionResponse, error)
DestroySession(ctx context.Context, req *DestroyAgentSessionRequest) (*DestroyAgentSessionResponse, error)
Close() error
}
AgentService manages agent loop sessions. Implemented by an in-process service and an RPC-backed client.
type AgentSessionSummary ¶
type AgentState ¶
type AgentState string
type AgentToolResult ¶
type ContinueRequest ¶
type ContinueRequest struct {
SessionID string
}
type CreateAgentSessionRequest ¶
type CreateAgentSessionRequest struct {
SessionConfig
}
type DestroyAgentSessionRequest ¶
type DestroyAgentSessionRequest struct {
SessionID string
}
type DestroyAgentSessionResponse ¶
type DestroyAgentSessionResponse struct{}
type EventReceiver ¶
type EventReceiver interface {
Recv() (*AgentEvent, error)
Close() error
}
EventReceiver is the transport-neutral stream interface for agent events.
type FollowUpRequest ¶
type FollowUpResponse ¶
type FollowUpResponse struct{}
type GetAgentSessionRequest ¶
type GetAgentSessionRequest struct {
SessionID string
}
type GetAgentSessionResponse ¶
type GetAgentSessionResponse struct {
SessionID string
State string
Metrics SessionMetrics
ConversationLen int
}
type ListAgentSessionsResponse ¶
type ListAgentSessionsResponse struct {
Sessions []AgentSessionSummary
}
type ResumeSessionRequest ¶
type ResumeSessionRequest struct {
SessionConfig
SchemaVersion int
ConversationLog []AgentMessageRecord
}
type ResumeSessionResponse ¶
type SendMessageRequest ¶
type SessionConfig ¶
type SessionMetrics ¶
type SteerRequest ¶
type SteerResponse ¶
type SteerResponse struct{}
type SubscribeEventsRequest ¶
type SubscribeEventsRequest struct {
SessionID string
}
type ToolEnvironmentConfig ¶
type ToolEnvironmentConfig struct {
Type ToolEnvironmentType
SandboxHostAddr string
SandboxSessionID string
LocalRootDir string
}
type ToolEnvironmentType ¶
type ToolEnvironmentType string
const ( ToolEnvLocal ToolEnvironmentType = "local" ToolEnvSandbox ToolEnvironmentType = "sandbox" )
Click to show internal directories.
Click to hide internal directories.