Documentation
¶
Index ¶
- func IsThreadNotFoundError(err error) bool
- type Adapter
- type AdapterOptions
- type ApprovalOption
- type ApprovalRequest
- type ApprovalRequestKind
- type Event
- type EventType
- type InitializeParams
- type OutputEvent
- type RPCError
- type ReasoningEvent
- type ReasoningKind
- type RequestID
- type Session
- func (s *Session) Diagnostic() SessionDiagnostic
- func (s *Session) Err() error
- func (s *Session) Events() <-chan Event
- func (s *Session) RespondApproval(_ context.Context, request ApprovalRequest, decision string) error
- func (s *Session) RespondToolCall(ctx context.Context, request ToolCallRequest, result ToolCallResult) error
- func (s *Session) RespondUserInput(_ context.Context, request UserInputRequest, answers map[string]any) error
- func (s *Session) SendPrompt(ctx context.Context, prompt string) (TurnStartResult, error)
- func (s *Session) StartTurn(ctx context.Context, config TurnConfig, prompt string) (TurnStartResult, error)
- func (s *Session) Stop(ctx context.Context) error
- func (s *Session) ThreadID() string
- func (s *Session) ThreadStatus() *ThreadStatusEvent
- type SessionDiagnostic
- type StartRequest
- type ThreadCompactionEvent
- type ThreadEvent
- type ThreadStartParams
- type ThreadStatusEvent
- type TokenUsageEvent
- type ToolCallContentItem
- type ToolCallContentType
- type ToolCallRequest
- type ToolCallResult
- type TurnConfig
- type TurnDiffEvent
- type TurnError
- type TurnEvent
- type TurnPlanEvent
- type TurnPlanStep
- type TurnStartResult
- type UserInputRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsThreadNotFoundError ¶
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
func NewAdapter ¶
func NewAdapter(options AdapterOptions) (*Adapter, error)
type AdapterOptions ¶
type AdapterOptions struct {
ProcessManager provider.AgentCLIProcessManager
}
type ApprovalOption ¶
type ApprovalRequest ¶
type ApprovalRequest struct {
RequestID RequestID
ThreadID string
TurnID string
Kind ApprovalRequestKind
Options []ApprovalOption
Payload map[string]any
}
type ApprovalRequestKind ¶
type ApprovalRequestKind string
const ( ApprovalRequestKindCommandExecution ApprovalRequestKind = "command_execution" ApprovalRequestKindFileChange ApprovalRequestKind = "file_change" )
type Event ¶
type Event struct {
Type EventType
ToolCall *ToolCallRequest
Approval *ApprovalRequest
UserInput *UserInputRequest
TokenUsage *TokenUsageEvent
RateLimit *provider.CLIRateLimit
Output *OutputEvent
Turn *TurnEvent
ThreadStatus *ThreadStatusEvent
Thread *ThreadEvent
Compaction *ThreadCompactionEvent
Plan *TurnPlanEvent
Diff *TurnDiffEvent
Reasoning *ReasoningEvent
}
type EventType ¶
type EventType string
const ( EventTypeToolCallRequested EventType = "tool_call_requested" EventTypeApprovalRequested EventType = "approval_requested" EventTypeUserInputRequested EventType = "user_input_requested" // #nosec G101 -- event type identifier, not a credential. EventTypeTokenUsageUpdated EventType = "token_usage_updated" EventTypeRateLimitUpdated EventType = "rate_limit_updated" EventTypeOutputProduced EventType = "output_produced" EventTypeThreadStarted EventType = "thread_started" EventTypeThreadCompacted EventType = "thread_compacted" EventTypeTurnPlanUpdated EventType = "turn_plan_updated" EventTypeTurnDiffUpdated EventType = "turn_diff_updated" EventTypeReasoningUpdated EventType = "reasoning_updated" EventTypeTurnStarted EventType = "turn_started" EventTypeTurnCompleted EventType = "turn_completed" EventTypeTurnInterrupted EventType = "turn_interrupted" EventTypeTurnFailed EventType = "turn_failed" EventTypeThreadStatus EventType = "thread_status" )
type InitializeParams ¶
type OutputEvent ¶
type ReasoningEvent ¶
type ReasoningKind ¶
type ReasoningKind string
const ( ReasoningKindSummaryPart ReasoningKind = "summary_part_added" ReasoningKindSummaryText ReasoningKind = "summary_text_delta" ReasoningKindText ReasoningKind = "text_delta" )
type RequestID ¶
type RequestID struct {
// contains filtered or unexported fields
}
func ParseRequestIDString ¶
func (RequestID) MarshalJSON ¶
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func (*Session) Diagnostic ¶
func (s *Session) Diagnostic() SessionDiagnostic
func (*Session) RespondApproval ¶
func (*Session) RespondToolCall ¶
func (s *Session) RespondToolCall(ctx context.Context, request ToolCallRequest, result ToolCallResult) error
func (*Session) RespondUserInput ¶
func (*Session) SendPrompt ¶
func (*Session) StartTurn ¶
func (s *Session) StartTurn(ctx context.Context, config TurnConfig, prompt string) (TurnStartResult, error)
func (*Session) ThreadStatus ¶
func (s *Session) ThreadStatus() *ThreadStatusEvent
type SessionDiagnostic ¶
type StartRequest ¶
type StartRequest struct {
Process provider.AgentCLIProcessSpec
Initialize InitializeParams
Thread ThreadStartParams
Turn TurnConfig
}
type ThreadCompactionEvent ¶
type ThreadEvent ¶
type ThreadStartParams ¶
type ThreadStatusEvent ¶
type TokenUsageEvent ¶
type TokenUsageEvent struct {
ThreadID string
TurnID string
TotalInputTokens int64
TotalOutputTokens int64
TotalCachedInputTokens int64
TotalReasoningTokens int64
LastInputTokens int64
LastOutputTokens int64
LastCachedInputTokens int64
LastReasoningTokens int64
TotalTokens int64
LastTokens int64
ModelContextWindow *int64
}
type ToolCallContentItem ¶
type ToolCallContentItem struct {
Type ToolCallContentType
Text string
ImageURL string
}
type ToolCallContentType ¶
type ToolCallContentType string
const ( ToolCallContentTypeText ToolCallContentType = toolCallTextOutputType ToolCallContentTypeImage ToolCallContentType = toolCallImageOutputType )
type ToolCallRequest ¶
type ToolCallResult ¶
type ToolCallResult struct {
Success bool
ContentItems []ToolCallContentItem
}
type TurnConfig ¶
type TurnDiffEvent ¶
type TurnPlanEvent ¶
type TurnPlanEvent struct {
ThreadID string
TurnID string
Explanation *string
Plan []TurnPlanStep
}
type TurnPlanStep ¶
type TurnStartResult ¶
type TurnStartResult struct {
TurnID string
}
Click to show internal directories.
Click to hide internal directories.