Documentation
¶
Overview ¶
Package kiro provides an adapter for Kiro CLI (kiro-cli from AWS) that queries its SQLite database for conversation history filtered by working directory.
Index ¶
- func NewWatcher(dbPath string) (<-chan adapter.Event, io.Closer, error)
- type Adapter
- func (a *Adapter) Capabilities() adapter.CapabilitySet
- func (a *Adapter) Close() error
- func (a *Adapter) Detect(projectRoot string) (bool, error)
- func (a *Adapter) ID() string
- func (a *Adapter) Icon() string
- func (a *Adapter) Messages(sessionID string) ([]adapter.Message, error)
- func (a *Adapter) Name() string
- func (a *Adapter) SearchMessages(sessionID, query string, opts adapter.SearchOptions) ([]adapter.MessageMatch, error)
- func (a *Adapter) Sessions(projectRoot string) ([]adapter.Session, error)
- func (a *Adapter) Usage(sessionID string) (*adapter.UsageStats, error)
- func (a *Adapter) Watch(projectRoot string) (<-chan adapter.Event, io.Closer, error)
- func (a *Adapter) WatchScope() adapter.WatchScope
- type AssistantResponse
- type AssistantToolUse
- type ContextManager
- type ConversationRow
- type ConversationValue
- type EnvContext
- type EnvState
- type HistoryEntry
- type ModelInfo
- type PromptContent
- type PromptData
- type RequestMetadata
- type ResponseData
- type ToolResultContent
- type ToolResultJSON
- type ToolUseData
- type ToolUseEntry
- type ToolUseResult
- type ToolUseResultsContent
- type ToolUseResultsData
- type UserMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter implements the adapter.Adapter interface for Kiro CLI sessions.
func (*Adapter) Capabilities ¶
func (a *Adapter) Capabilities() adapter.CapabilitySet
Capabilities returns the supported features.
func (*Adapter) SearchMessages ¶
func (a *Adapter) SearchMessages(sessionID, query string, opts adapter.SearchOptions) ([]adapter.MessageMatch, error)
SearchMessages searches message content within a session. Implements adapter.MessageSearcher interface.
func (*Adapter) Sessions ¶
Sessions returns all sessions for the given project, sorted by update time.
func (*Adapter) Usage ¶
func (a *Adapter) Usage(sessionID string) (*adapter.UsageStats, error)
Usage returns aggregate usage stats for the given session.
func (*Adapter) WatchScope ¶
func (a *Adapter) WatchScope() adapter.WatchScope
WatchScope returns Global because kiro watches a global database file.
type AssistantResponse ¶
type AssistantResponse struct {
Response *ResponseData `json:"Response"`
}
AssistantResponse is the assistant content when it's a Response.
type AssistantToolUse ¶
type AssistantToolUse struct {
ToolUse *ToolUseData `json:"ToolUse"`
}
AssistantToolUse is the assistant content when it's a ToolUse.
type ContextManager ¶
type ContextManager struct {
Paths []string `json:"paths"`
}
ContextManager holds context paths.
type ConversationRow ¶
type ConversationRow struct {
Key string // project path (e.g., /Users/foo/code/project)
ConversationID string
Value string // JSON blob
CreatedAt int64 // Unix timestamp in milliseconds
UpdatedAt int64 // Unix timestamp in milliseconds
}
ConversationRow represents a row from the conversations_v2 table.
type ConversationValue ¶
type ConversationValue struct {
ConversationID string `json:"conversation_id"`
History []HistoryEntry `json:"history"`
ModelInfo *ModelInfo `json:"model_info"`
Tools json.RawMessage `json:"tools"`
ContextManager *ContextManager `json:"context_manager"`
}
ConversationValue is the parsed JSON value from conversations_v2.
type EnvContext ¶
type EnvContext struct {
EnvState *EnvState `json:"env_state"`
}
EnvContext holds environment info from the user message.
type EnvState ¶
type EnvState struct {
OperatingSystem string `json:"operating_system"`
CurrentWorkingDirectory string `json:"current_working_directory"`
}
EnvState holds OS and directory info.
type HistoryEntry ¶
type HistoryEntry struct {
User *UserMessage `json:"user"`
Assistant json.RawMessage `json:"assistant"` // Response or ToolUse, discriminated
RequestMetadata *RequestMetadata `json:"request_metadata"`
}
HistoryEntry is a single turn in the conversation history.
type PromptContent ¶
type PromptContent struct {
Prompt *PromptData `json:"Prompt"`
}
PromptContent is the user content when it's a Prompt.
type PromptData ¶
type PromptData struct {
Prompt string `json:"prompt"`
}
PromptData contains the actual prompt text.
type RequestMetadata ¶
type RequestMetadata struct {
ContextUsagePercentage float64 `json:"context_usage_percentage"`
RequestStartTimestampMs int64 `json:"request_start_timestamp_ms"`
StreamEndTimestampMs int64 `json:"stream_end_timestamp_ms"`
}
RequestMetadata holds timing and context info for a request.
type ResponseData ¶
ResponseData contains the response text.
type ToolResultContent ¶
type ToolResultContent struct {
Json *ToolResultJSON `json:"Json"`
}
ToolResultContent is a content block in a tool result.
type ToolResultJSON ¶
type ToolResultJSON struct {
ExitStatus string `json:"exit_status"`
Stdout string `json:"stdout"`
Stderr string `json:"stderr"`
}
ToolResultJSON contains structured tool output.
type ToolUseData ¶
type ToolUseData struct {
MessageID string `json:"message_id"`
Content string `json:"content"`
ToolUses []ToolUseEntry `json:"tool_uses"`
}
ToolUseData contains the tool use info.
type ToolUseEntry ¶
type ToolUseEntry struct {
ID string `json:"id"`
Name string `json:"name"`
Args json.RawMessage `json:"args"`
}
ToolUseEntry is a single tool invocation.
type ToolUseResult ¶
type ToolUseResult struct {
ToolUseID string `json:"tool_use_id"`
Content []ToolResultContent `json:"content"`
Status string `json:"status"`
}
ToolUseResult is a single tool result.
type ToolUseResultsContent ¶
type ToolUseResultsContent struct {
ToolUseResults *ToolUseResultsData `json:"ToolUseResults"`
}
ToolUseResultsContent is the user content when it's ToolUseResults.
type ToolUseResultsData ¶
type ToolUseResultsData struct {
ToolUseResults []ToolUseResult `json:"tool_use_results"`
}
ToolUseResultsData contains the tool use results.
type UserMessage ¶
type UserMessage struct {
Content json.RawMessage `json:"content"` // Prompt or ToolUseResults, discriminated
Timestamp string `json:"timestamp"` // RFC3339 format
EnvContext *EnvContext `json:"env_context"`
}
UserMessage is the user side of a history entry.