gicodingagent

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 31, 2026 License: MIT Imports: 66 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProtocolEventSessionBeforeSwitch   = "session_before_switch"
	ProtocolEventSessionBeforeFork     = "session_before_fork"
	ProtocolEventSessionShutdown       = "session_shutdown"
	ProtocolEventSessionStart          = "session_start"
	ProtocolEventSessionSwitch         = "session_switch"
	ProtocolEventSessionInfoChanged    = "session_info_changed"
	ProtocolEventSessionBeforeTree     = "session_before_tree"
	ProtocolEventModelSelect           = "model_select"
	ProtocolEventThinkingLevelSelect   = "thinking_level_select"
	ProtocolEventBeforeAgentStart      = "before_agent_start"
	ProtocolEventContext               = "context"
	ProtocolEventToolCall              = "tool_call"
	ProtocolEventToolResult            = "tool_result"
	ProtocolEventToolExecutionUpdate   = "tool_execution_update"
	ProtocolEventMessageStart          = "message_start"
	ProtocolEventMessageUpdate         = "message_update"
	ProtocolEventMessageEnd            = "message_end"
	ProtocolEventUserBash              = "user_bash"
	ProtocolEventResourcesDiscover     = "resources_discover"
	ProtocolEventBeforeProviderRequest = "before_provider_request"
	ProtocolEventAfterProviderResponse = "after_provider_response"
)
View Source
const (
	DefaultCodingAgentPackageName = "gi"
	DefaultCodingAgentVersion     = "0.0.3"
	DefaultCodingAgentAppName     = "gi"
	DefaultCodingAgentAppTitle    = "Gi"

	EnvCodingAgentDir              = "GI_CODING_AGENT_DIR"
	LegacyEnvCodingAgentDir        = "PI_CODING_AGENT_DIR"
	EnvCodingAgentSessionDir       = "GI_CODING_AGENT_SESSION_DIR"
	LegacyEnvCodingAgentSessionDir = "PI_CODING_AGENT_SESSION_DIR"

	InstallMethodBunBinary InstallMethod = "bun-binary"
	InstallMethodNPM       InstallMethod = "npm"
	InstallMethodPNPM      InstallMethod = "pnpm"
	InstallMethodYarn      InstallMethod = "yarn"
	InstallMethodBun       InstallMethod = "bun"
	InstallMethodUnknown   InstallMethod = "unknown"
)
View Source
const (
	OSC133ZoneStart = "\x1b]133;A\x07"
	OSC133ZoneEnd   = "\x1b]133;B\x07"
	OSC133ZoneFinal = "\x1b]133;C\x07"
	TerminalBGReset = "\x1b[49m"
)
View Source
const (
	RPCCommandPrompt               = "prompt"
	RPCCommandSteer                = "steer"
	RPCCommandFollowUp             = "follow_up"
	RPCCommandAbort                = "abort"
	RPCCommandNewSession           = "new_session"
	RPCCommandGetState             = "get_state"
	RPCCommandSetModel             = "set_model"
	RPCCommandCycleModel           = "cycle_model"
	RPCCommandSetThinkingLevel     = "set_thinking_level"
	RPCCommandCycleThinkingLevel   = "cycle_thinking_level"
	RPCCommandGetAvailableModels   = "get_available_models"
	RPCCommandSetSteeringMode      = "set_steering_mode"
	RPCCommandSetFollowUpMode      = "set_follow_up_mode"
	RPCCommandCompact              = "compact"
	RPCCommandSetAutoCompaction    = "set_auto_compaction"
	RPCCommandSetAutoRetry         = "set_auto_retry"
	RPCCommandAbortRetry           = "abort_retry"
	RPCCommandBash                 = "bash"
	RPCCommandAbortBash            = "abort_bash"
	RPCCommandGetSessionStats      = "get_session_stats"
	RPCCommandExportHTML           = "export_html"
	RPCCommandSwitchSession        = "switch_session"
	RPCCommandFork                 = "fork"
	RPCCommandGetForkMessages      = "get_fork_messages"
	RPCCommandGetLastAssistantText = "get_last_assistant_text"
	RPCCommandSetSessionName       = "set_session_name"
	RPCCommandGetMessages          = "get_messages"
	RPCCommandGetCommands          = "get_commands"
)
View Source
const (
	FauxProvider = "faux"
	FauxModelID  = "faux-1"
	FauxAPI      = "anthropic-messages"
)
View Source
const AnthropicSubscriptionAuthWarning = authwarning.AnthropicSubscriptionAuthWarning
View Source
const CapabilityBashIntercept = "bash.intercept"
View Source
const CapabilityCommandsRegister = "commands.register"
View Source
const CapabilityInputEvents = "input.events"
View Source
const CapabilityLifecycleEvents = "lifecycle.events"
View Source
const CapabilityProvidersRegister = "providers.register"
View Source
const CapabilityResourcesDiscover = "resources.discover"
View Source
const CapabilityShortcutsRegister = "shortcuts.register"
View Source
const CapabilitySystemPromptModify = "system_prompt.modify"
View Source
const CapabilityTUIAutocomplete = "tui.autocomplete"
View Source
const CapabilityTUIEditor = "tui.editor"
View Source
const CapabilityTUIFooter = "tui.footer"
View Source
const CapabilityTUIHeader = "tui.header"
View Source
const CapabilityTUIMessageRenderer = "tui.message_renderer"
View Source
const CapabilityTUIOverlay = "tui.overlay"
View Source
const CapabilityTUITerminalInput = "tui.terminal_input"
View Source
const CapabilityTUITheme = "tui.theme"
View Source
const CapabilityTUIToolRenderer = "tui.tool_renderer"
View Source
const CapabilityTUIToolsExpanded = "tui.tools_expanded"
View Source
const CapabilityTUIWidget = "tui.widget"
View Source
const CapabilityToolsRegister = "tools.register"
View Source
const ConfigDirName = ".gi"
View Source
const CurrentSessionVersion = 3
View Source
const ExportHTMLTemplateCSS = `` /* 10094-byte string literal not displayed */
View Source
const ExportHTMLTemplateJS = `` /* 47459-byte string literal not displayed */
View Source
const FSWatchRetryDelay = fswatch.FSWatchRetryDelay
View Source
const LatestGiVersionURL = versioncheck.LatestGiVersionURL
View Source
const LatestPiVersionURL = versioncheck.LatestPiVersionURL
View Source
const RPCCommandClone = "clone"

Variables

View Source
var DefaultModelPerProvider = modelresolver.DefaultModelPerProvider
View Source
var ErrAuthStorageLockCompromised = errors.New("auth storage lock was compromised")
View Source
var FauxModel = llm.Model{
	ID:            FauxModelID,
	Name:          "Faux Model",
	API:           FauxAPI,
	Provider:      FauxProvider,
	BaseURL:       "http://localhost:0",
	Reasoning:     false,
	Input:         []string{"text", "image"},
	ContextWindow: 128000,
	MaxTokens:     16384,
}

Functions

func AnsiLinesToHTML

func AnsiLinesToHTML(lines []string) string

func AttachJSONLLineReader

func AttachJSONLLineReader(reader io.Reader, onLine func(string)) error

func BuildSDKStreamHeaders

func BuildSDKStreamHeaders(model llm.Model, installTelemetryEnabled bool, providerHeaders, requestHeaders map[string]string) map[string]string

func BuildSystemPrompt

func BuildSystemPrompt(options BuildSystemPromptOptions) string

func CanonicalizePath

func CanonicalizePath(path string) string

func CheckForNewGiVersion

func CheckForNewGiVersion(currentVersion string, options VersionCheckOptions) (string, bool)

func CheckForNewPiVersion

func CheckForNewPiVersion(currentVersion string, options VersionCheckOptions) (string, bool)

func CheckTmuxKeyboardSetup

func CheckTmuxKeyboardSetup(ctx context.Context, reader TmuxOptionReader) string

func CleanPlanStepText

func CleanPlanStepText(text string) string

func ClearAPIKeyCache

func ClearAPIKeyCache()

func ClearConfigValueCache

func ClearConfigValueCache()

func CloseWatcher

func CloseWatcher(watcher FSWatcher)

func ComparePackageVersions

func ComparePackageVersions(leftVersion, rightVersion string) (int, bool)

func CopyToClipboard

func CopyToClipboard(text string, options ClipboardCopyOptions) error

func CreateAgentSessionRuntime

func CreateAgentSessionRuntime(factory CreateAgentSessionRuntimeFactory, options AgentSessionRuntimeOptions) (any, error)

func DefaultAgentSessionBranchSummarizer

func DefaultAgentSessionBranchSummarizer(entries []FileEntry, customInstructions string, abort <-chan struct{}) (string, error)

func DefaultAgentSessionCompactionSummarizer

func DefaultAgentSessionCompactionSummarizer(preparation agentharness.CompactionPreparation, customInstructions string) (agentharness.CompactionResult, error)

func DefaultAgentSessionResponder

func DefaultAgentSessionResponder(prompt string, context []llm.Message, model llm.Model) (llm.Message, error)

func DefaultClipboardPasteImageKey

func DefaultClipboardPasteImageKey() string

func DefaultSessionExportHTMLName

func DefaultSessionExportHTMLName(inputPath string) string

func DefaultTmuxOptionReader

func DefaultTmuxOptionReader(ctx context.Context, option string) (string, bool)

func ExpandPath

func ExpandPath(path string) string

func ExpandPromptTemplate

func ExpandPromptTemplate(text string, templates []PromptTemplate) string

func ExpandTildePath

func ExpandTildePath(path string) string

func ExportHTMLTemplateCSSWithOptions

func ExportHTMLTemplateCSSWithOptions(options ExportHTMLOptions) string

func ExportSessionFileToHTML

func ExportSessionFileToHTML(inputPath, outputPath string) (string, error)

func ExportSessionFileToHTMLWithOptions

func ExportSessionFileToHTMLWithOptions(inputPath, outputPath string, options ExportHTMLOptions) (string, error)

func ExtensionForImageMIMEType

func ExtensionForImageMIMEType(mimeType string) string

func ExtractDoneSteps

func ExtractDoneSteps(message string) []int

func FindExactModelReferenceMatch

func FindExactModelReferenceMatch(modelReference string, availableModels []llm.Model) *llm.Model

func FindMostRecentSession

func FindMostRecentSession(sessionDir string) string

func FormatDimensionNote

func FormatDimensionNote(result ResizedImage) string

func GetAgentDir

func GetAgentDir(cwd ...string) string

func GetAgentDirSessionDir

func GetAgentDirSessionDir(cwd, agentDir string) string

func GetAttributionHeaders

func GetAttributionHeaders(model llm.Model, installTelemetryEnabled bool) map[string]string

func GetAuthPath

func GetAuthPath(agentDir ...string) string

func GetBinDir

func GetBinDir(agentDir ...string) string

func GetBundledInteractiveAssetPath

func GetBundledInteractiveAssetPath(name string, envs ...InstallEnvironment) string

func GetChangelogPath

func GetChangelogPath(envs ...InstallEnvironment) string

func GetCustomThemesDir

func GetCustomThemesDir(agentDir ...string) string

func GetCwdRelativePath

func GetCwdRelativePath(path, cwd string) (string, bool)

func GetDebugLogPath

func GetDebugLogPath(agentDir ...string) string

func GetDefaultSessionDir

func GetDefaultSessionDir(cwd string) (string, error)

func GetDocsPath

func GetDocsPath(envs ...InstallEnvironment) string

func GetExamplesPath

func GetExamplesPath(envs ...InstallEnvironment) string

func GetExportTemplateDir

func GetExportTemplateDir(envs ...InstallEnvironment) string

func GetGiUserAgent

func GetGiUserAgent(version string) string

func GetInteractiveAssetsDir

func GetInteractiveAssetsDir(envs ...InstallEnvironment) string

func GetLatestGiVersion

func GetLatestGiVersion(currentVersion string, options VersionCheckOptions) (string, bool)

func GetLatestPiVersion

func GetLatestPiVersion(currentVersion string, options VersionCheckOptions) (string, bool)

func GetModelsPath

func GetModelsPath(agentDir ...string) string

func GetPackageDir

func GetPackageDir(envs ...InstallEnvironment) string

func GetPackageJSONPath

func GetPackageJSONPath(envs ...InstallEnvironment) string

func GetPackageJsonPath

func GetPackageJsonPath(envs ...InstallEnvironment) string

func GetPathCommandArgument

func GetPathCommandArgument(text, command string) (string, bool)

func GetPiUserAgent

func GetPiUserAgent(version string) string

func GetPromptsDir

func GetPromptsDir(agentDir ...string) string

func GetReadmePath

func GetReadmePath(envs ...InstallEnvironment) string

func GetResolvedThemeCSSColors

func GetResolvedThemeCSSColors(themeName, agentDir string) (map[string]string, error)

func GetSelfUpdateUnavailableInstruction

func GetSelfUpdateUnavailableInstruction(packageName string, env InstallEnvironment, _ []string, updatePackageName string) string

func GetSessionsDir

func GetSessionsDir(agentDir ...string) string

func GetSettingsPath

func GetSettingsPath(agentDir ...string) string

func GetShareViewerURL

func GetShareViewerURL(gistID string) string

func GetThemesDir

func GetThemesDir(envs ...InstallEnvironment) string

func GetToolsDir

func GetToolsDir(agentDir ...string) string

func GetUpdateInstruction

func GetUpdateInstruction(packageName string, env InstallEnvironment) string

func HasSessionName

func HasSessionName(session SessionInfo) bool

func Highlight

func Highlight(code string, options HighlightOptions) string

func IsAPIKeyLoginProvider

func IsAPIKeyLoginProvider(providerID string, oauthProviderIDs, builtInProviderIDs map[string]bool) bool

func IsAliasModelID

func IsAliasModelID(id string) bool

func IsAnthropicSubscriptionAuthKey

func IsAnthropicSubscriptionAuthKey(apiKey string) bool

func IsInstallTelemetryEnabled

func IsInstallTelemetryEnabled(settingsManager *SettingsManager) bool

func IsLocalPath

func IsLocalPath(value string) bool

func IsNewerPackageVersion

func IsNewerPackageVersion(candidateVersion, currentVersion string) bool

func IsSafePlanCommand

func IsSafePlanCommand(command string) bool

func IsValidThinkingLevel

func IsValidThinkingLevel(level string) bool

func IsWaylandSession

func IsWaylandSession(env map[string]string) bool

func LoadProtocolExtensionDescriptors

func LoadProtocolExtensionDescriptors(sources []ProtocolExtensionSource, runtime *ProtocolExtensionRuntime) protocolExtensionDescriptorLoadResult

func MarkCompletedPlanSteps

func MarkCompletedPlanSteps(message string, items []PlanTodoItem) int

func MigrateKeybindingsConfig

func MigrateKeybindingsConfig(rawConfig map[string]any) (map[string]any, bool)

func MigrateSessionEntries

func MigrateSessionEntries(entries []FileEntry) bool

func OfficialPackageNames

func OfficialPackageNames() []string

func PackageSourceIdentity

func PackageSourceIdentity(source PackageSource) string

func ParseCommandArgs

func ParseCommandArgs(argsString string) []string

func PreRenderExportHTMLCustomTools

func PreRenderExportHTMLCustomTools(entries []FileEntry, renderer ExportHTMLToolRenderer) map[string]ExportHTMLRenderedTool

func PrepareEditToolArguments

func PrepareEditToolArguments(args any) any

func PrepareReadToolArguments

func PrepareReadToolArguments(args any) any

func PrepareWriteToolArguments

func PrepareWriteToolArguments(args any) any

func RegisterOAuthProvider

func RegisterOAuthProvider(provider OAuthProvider)

func RenderCustomToolResultHTML

func RenderCustomToolResultHTML(lines []string) string

func RenderDiff

func RenderDiff(diffText string) string

func RenderExportHTMLHeaderModels

func RenderExportHTMLHeaderModels(models []string) string

func RenderExportHTMLInlineImage

func RenderExportHTMLInlineImage(mimeType, data string) string

func RenderExportHTMLMarkdownImage

func RenderExportHTMLMarkdownImage(src, alt string) string
func RenderExportHTMLMarkdownLink(href, text string) string

func RenderExportHTMLSessionEntryAttrs

func RenderExportHTMLSessionEntryAttrs(entryID string) string

func RenderExportHTMLTreeMetadata

func RenderExportHTMLTreeMetadata(values map[string]string) string

func RenderExportHTMLUserMessage

func RenderExportHTMLUserMessage(text string) string

func RenderHighlightedHTML

func RenderHighlightedHTML(input string, theme HighlightTheme) string

func RenderSessionManagerHTML

func RenderSessionManagerHTML(sessionManager *SessionManager) string

func RenderSessionManagerHTMLWithOptions

func RenderSessionManagerHTMLWithOptions(sessionManager *SessionManager, options ExportHTMLOptions) string

func RenderViewTree

func RenderViewTree(view ViewTreeNode, width int) []string

func ResetOAuthProviders

func ResetOAuthProviders()

func ResolveConfigValue

func ResolveConfigValue(config string) (string, bool)

func ResolveConfigValueUncached

func ResolveConfigValueUncached(config string) (string, bool)

func ResolveReadPath

func ResolveReadPath(path, cwd string) (string, error)

func ResolveToCwd

func ResolveToCwd(path, cwd string) string

func RestoreProcessSandboxEnv

func RestoreProcessSandboxEnv(isBun bool) bool

func RestoreSandboxEnv

func RestoreSandboxEnv(isBun bool, env map[string]string, readEnviron SandboxEnvReader) bool

func RunCLI

func RunCLI(options CLIOptions) int

func RunMigrations

func RunMigrations(agentDir string, cwd ...string) error

func RunPrintMode

func RunPrintMode(host PrintModeRuntimeHost, options PrintModeOptions) (exitCode int)

func SerializeJSONLine

func SerializeJSONLine(record any) (string, error)

func StripAnsi

func StripAnsi(value string) string

func StripFrontmatter

func StripFrontmatter(content string) string

func SubstituteArgs

func SubstituteArgs(content string, args []string) string

func SupportsLanguage

func SupportsLanguage(language string) bool

func TUIThemeSchemaJSON

func TUIThemeSchemaJSON() []byte

TUIThemeSchemaJSON returns Gi's Pi-compatible TUI theme JSON schema.

func UnregisterOAuthProvider

func UnregisterOAuthProvider(providerID string)

func ValidateViewTreeNode

func ValidateViewTreeNode(node ViewTreeNode) error

func WithFileMutationQueue

func WithFileMutationQueue(filePath string, fn func() error) error

func WriteCLIUsage

func WriteCLIUsage(writer io.Writer, extensionFlags ...ProtocolFlagRegistration)

func WriteListModels

func WriteListModels(stdout, stderr io.Writer, registry *ModelRegistry, searchPattern string) error

Types

type AgentContextUsage

type AgentContextUsage struct {
	Tokens        *int     `json:"tokens"`
	ContextWindow int      `json:"contextWindow"`
	Percent       *float64 `json:"percent"`
}

type AgentSession

type AgentSession struct {
	SessionManager       *SessionManager
	ResourceLoader       AgentSessionResourceLoader
	BaseSystemPrompt     string
	SystemPrompt         string
	Agent                *SDKAgent
	CompactionSettings   agentharness.CompactionSettings
	CompactionSummarizer AgentSessionCompactionSummarizer
	BranchSummarizer     AgentSessionBranchSummarizer
	RetrySettings        AgentSessionRetrySettings
	AutoCompactionRunner AgentSessionAutoCompactionRunner
	AgentContinue        func() error
	Responder            AgentSessionResponder
	StreamResponder      AgentSessionStreamResponder
	Preflight            AgentSessionPreflight
	ExtensionRuntime     *ProtocolExtensionRuntime
	DynamicTools         []SDKTool
	ScopedModels         []ScopedModel
	Tools                []string
	ToolsSet             bool
	NoTools              string
	SteeringMode         string
	FollowUpMode         string
	// contains filtered or unexported fields
}

func CreateAgentSession

func CreateAgentSession(options AgentSessionOptions) (*AgentSession, error)

func (*AgentSession) Abort

func (s *AgentSession) Abort() error

func (*AgentSession) AbortBash

func (s *AgentSession) AbortBash()

func (*AgentSession) AbortBranchSummary

func (s *AgentSession) AbortBranchSummary()

func (*AgentSession) AbortCompaction

func (s *AgentSession) AbortCompaction()

func (*AgentSession) AbortRetry

func (s *AgentSession) AbortRetry()

func (*AgentSession) CheckCompaction

func (s *AgentSession) CheckCompaction(assistantMessage llm.Message, skipAbortedCheck ...bool) error

func (*AgentSession) ClearQueue

func (s *AgentSession) ClearQueue() (steering, followUp []string)

func (*AgentSession) Compact

func (s *AgentSession) Compact(customInstructions ...string) (agentharness.CompactionResult, error)

func (*AgentSession) Dispose

func (s *AgentSession) Dispose()

func (*AgentSession) ExecuteBash

func (s *AgentSession) ExecuteBash(command string, options ...AgentSessionBashOptions) (BashResult, error)

func (*AgentSession) FollowUp

func (s *AgentSession) FollowUp(text string) error

func (*AgentSession) FollowUpWithImages

func (s *AgentSession) FollowUpWithImages(text string, images []llm.ContentPart) error

func (*AgentSession) Fork

func (s *AgentSession) Fork(entryID string) (AgentSessionForkResult, error)

func (*AgentSession) ForkAt

func (s *AgentSession) ForkAt(entryID string) (AgentSessionForkResult, error)

func (*AgentSession) GetActiveLLMTools

func (s *AgentSession) GetActiveLLMTools() []llm.Tool

func (*AgentSession) GetActiveToolNames

func (s *AgentSession) GetActiveToolNames() []string

func (*AgentSession) GetActiveTools

func (s *AgentSession) GetActiveTools() []SDKTool

func (*AgentSession) GetAllTools

func (s *AgentSession) GetAllTools() []SDKTool

func (*AgentSession) GetContextUsage

func (s *AgentSession) GetContextUsage() *AgentContextUsage

func (*AgentSession) GetFollowUpMessages

func (s *AgentSession) GetFollowUpMessages() []string

func (*AgentSession) GetFollowUpQueue

func (s *AgentSession) GetFollowUpQueue() []QueuedUserMessage

func (*AgentSession) GetSessionStats

func (s *AgentSession) GetSessionStats() AgentSessionStats

func (*AgentSession) GetSteeringMessages

func (s *AgentSession) GetSteeringMessages() []string

func (*AgentSession) GetSteeringQueue

func (s *AgentSession) GetSteeringQueue() []QueuedUserMessage

func (*AgentSession) GetUserMessagesForForking

func (s *AgentSession) GetUserMessagesForForking() []AgentSessionForkMessage

func (*AgentSession) HasAgentQueuedMessages

func (s *AgentSession) HasAgentQueuedMessages() bool

func (*AgentSession) HasPendingBashMessages

func (s *AgentSession) HasPendingBashMessages() bool

func (*AgentSession) IsBashRunning

func (s *AgentSession) IsBashRunning() bool

func (*AgentSession) IsBranchSummaryRunning

func (s *AgentSession) IsBranchSummaryRunning() bool

func (*AgentSession) IsCompacting

func (s *AgentSession) IsCompacting() bool

func (*AgentSession) IsRetrying

func (s *AgentSession) IsRetrying() bool

func (*AgentSession) IsStreaming

func (s *AgentSession) IsStreaming() bool

func (*AgentSession) Messages

func (s *AgentSession) Messages() []llm.Message

func (*AgentSession) NavigateTree

func (*AgentSession) PendingMessageCount

func (s *AgentSession) PendingMessageCount() int

func (*AgentSession) Prompt

func (s *AgentSession) Prompt(text string) error

func (*AgentSession) PromptWithImages

func (s *AgentSession) PromptWithImages(text string, images []llm.ContentPart) error

func (*AgentSession) QueueAgentMessage

func (s *AgentSession) QueueAgentMessage(message llm.Message)

func (*AgentSession) QueueExtensionUserMessage

func (s *AgentSession) QueueExtensionUserMessage(text, deliverAs string) error

func (*AgentSession) RecordBashResult

func (s *AgentSession) RecordBashResult(command string, result BashResult, options ...AgentSessionBashRecordOptions)

func (*AgentSession) RefreshSystemPrompt

func (s *AgentSession) RefreshSystemPrompt()

func (*AgentSession) RunAutoCompaction

func (s *AgentSession) RunAutoCompaction(reason string, willRetry bool) error

func (*AgentSession) SendCustomMessage

func (s *AgentSession) SendCustomMessage(message QueuedCustomMessage, options ProtocolSendCustomMessageOptions) error

func (*AgentSession) SetScopedModels

func (s *AgentSession) SetScopedModels(scopedModels []ScopedModel)

func (*AgentSession) SetSessionName

func (s *AgentSession) SetSessionName(name string) error

func (*AgentSession) Steer

func (s *AgentSession) Steer(text string) error

func (*AgentSession) SteerWithImages

func (s *AgentSession) SteerWithImages(text string, images []llm.ContentPart) error

func (*AgentSession) Subscribe

func (s *AgentSession) Subscribe(listener AgentSessionEventListener) func()

type AgentSessionAutoCompactionRunner

type AgentSessionAutoCompactionRunner func(reason string, willRetry bool) error

type AgentSessionBashOptions

type AgentSessionBashOptions struct {
	OnChunk            func(string)
	ExcludeFromContext bool
	Operations         BashOperations
	Context            context.Context
}

type AgentSessionBashRecordOptions

type AgentSessionBashRecordOptions struct {
	ExcludeFromContext bool
}

type AgentSessionBranchSummarizer

type AgentSessionBranchSummarizer func(entries []FileEntry, customInstructions string, abort <-chan struct{}) (string, error)

type AgentSessionCompactionSummarizer

type AgentSessionCompactionSummarizer func(preparation agentharness.CompactionPreparation, customInstructions string) (agentharness.CompactionResult, error)

type AgentSessionContextResourceLoader

type AgentSessionContextResourceLoader interface {
	GetAgentsFiles() ResourceAgentsFilesResult
}

type AgentSessionEvent

type AgentSessionEvent struct {
	Type                  string                         `json:"type"`
	Reason                string                         `json:"reason,omitempty"`
	Result                *agentharness.CompactionResult `json:"result,omitempty"`
	Aborted               bool                           `json:"aborted,omitempty"`
	WillRetry             bool                           `json:"willRetry,omitempty"`
	ErrorMessage          string                         `json:"errorMessage,omitempty"`
	Message               *llm.Message                   `json:"message,omitempty"`
	Attempt               int                            `json:"attempt,omitempty"`
	MaxAttempts           int                            `json:"maxAttempts,omitempty"`
	DelayMs               int                            `json:"delayMs,omitempty"`
	Success               bool                           `json:"success,omitempty"`
	FinalError            string                         `json:"finalError,omitempty"`
	Steering              []string                       `json:"steering,omitempty"`
	FollowUp              []string                       `json:"followUp,omitempty"`
	AssistantMessageEvent *llm.AssistantMessageEvent     `json:"assistantMessageEvent,omitempty"`
	ToolCallID            string                         `json:"toolCallId,omitempty"`
	ToolName              string                         `json:"toolName,omitempty"`
	Args                  map[string]any                 `json:"args,omitempty"`
	ToolResult            *llm.Message                   `json:"toolResult,omitempty"`
	PartialToolResult     *llm.Message                   `json:"partialToolResult,omitempty"`
	Name                  string                         `json:"name,omitempty"`
}

type AgentSessionEventListener

type AgentSessionEventListener func(AgentSessionEvent)

type AgentSessionForkMessage

type AgentSessionForkMessage struct {
	EntryID string `json:"entryId"`
	Text    string `json:"text"`
}

type AgentSessionForkResult

type AgentSessionForkResult struct {
	Cancelled    bool
	SelectedText string
	Session      *AgentSession
}

type AgentSessionNavigateTreeOptions

type AgentSessionNavigateTreeOptions struct {
	Summarize          bool
	CustomInstructions string
}

type AgentSessionNavigateTreeResult

type AgentSessionNavigateTreeResult struct {
	Cancelled    bool
	Aborted      bool
	EditorText   string
	SummaryEntry *FileEntry
}

type AgentSessionOptions

type AgentSessionOptions struct {
	CWD                  string
	AgentDir             string
	Model                llm.Model
	ThinkingLevel        string
	Preflight            AgentSessionPreflight
	SessionManager       *SessionManager
	ResourceLoader       AgentSessionResourceLoader
	CompactionSettings   *agentharness.CompactionSettings
	CompactionSummarizer AgentSessionCompactionSummarizer
	BranchSummarizer     AgentSessionBranchSummarizer
	RetrySettings        *AgentSessionRetrySettings
	AutoCompactionRunner AgentSessionAutoCompactionRunner
	AgentContinue        func() error
	Responder            AgentSessionResponder
	StreamResponder      AgentSessionStreamResponder
	CustomTools          []SDKTool
	ScopedModels         []ScopedModel
	Tools                []string
	ToolsSet             bool
	NoTools              string
}

type AgentSessionPreflight

type AgentSessionPreflight func(model llm.Model) error

type AgentSessionPromptResourceLoader

type AgentSessionPromptResourceLoader interface {
	GetPrompts() ResourcePromptsResult
}

type AgentSessionResourceLoader

type AgentSessionResourceLoader interface {
	GetSkills() AgentSessionSkillsResult
}

type AgentSessionResponder

type AgentSessionResponder func(prompt string, context []llm.Message, model llm.Model) (llm.Message, error)

type AgentSessionRetrySettings

type AgentSessionRetrySettings struct {
	Enabled     bool
	MaxRetries  int
	BaseDelayMs int
}

func DefaultAgentSessionRetrySettings

func DefaultAgentSessionRetrySettings() AgentSessionRetrySettings

type AgentSessionRuntimeEventListener

type AgentSessionRuntimeEventListener func(ProtocolSessionEvent) error

type AgentSessionRuntimeForkOptions

type AgentSessionRuntimeForkOptions struct {
	Position    string
	WithSession func(ProtocolCommandContext) error
}

type AgentSessionRuntimeHost

type AgentSessionRuntimeHost struct {
	Session                 *AgentSession
	ExtensionRuntime        *ProtocolExtensionRuntime
	BeforeSessionInvalidate func()
	RebindSession           func(*AgentSession) error
	// contains filtered or unexported fields
}

func NewAgentSessionRuntimeHost

func NewAgentSessionRuntimeHost(session *AgentSession, extensionRuntime *ProtocolExtensionRuntime) (*AgentSessionRuntimeHost, error)

func (*AgentSessionRuntimeHost) Fork

func (*AgentSessionRuntimeHost) NewSession

func (*AgentSessionRuntimeHost) OnSessionEvent

func (h *AgentSessionRuntimeHost) OnSessionEvent(listener AgentSessionRuntimeEventListener) func()

func (*AgentSessionRuntimeHost) Reload

func (h *AgentSessionRuntimeHost) Reload() error

func (*AgentSessionRuntimeHost) SetBeforeSessionInvalidate

func (h *AgentSessionRuntimeHost) SetBeforeSessionInvalidate(callback func())

func (*AgentSessionRuntimeHost) SetExtensionRuntime

func (h *AgentSessionRuntimeHost) SetExtensionRuntime(extensionRuntime *ProtocolExtensionRuntime)

func (*AgentSessionRuntimeHost) SetRebindSession

func (h *AgentSessionRuntimeHost) SetRebindSession(callback func(*AgentSession) error)

func (*AgentSessionRuntimeHost) SwitchSession

type AgentSessionRuntimeOptions

type AgentSessionRuntimeOptions struct {
	CWD            string
	AgentDir       string
	SessionManager *SessionManager
}

type AgentSessionRuntimeSwitchResult

type AgentSessionRuntimeSwitchResult struct {
	Cancelled bool `json:"cancelled"`
}

type AgentSessionSkillsResult

type AgentSessionSkillsResult struct {
	Skills      []agentharness.Skill
	Diagnostics []agentharness.SkillDiagnostic
}

type AgentSessionStats

type AgentSessionStats struct {
	Tokens       llm.Usage          `json:"tokens"`
	ContextUsage *AgentContextUsage `json:"contextUsage,omitempty"`
}

type AgentSessionStreamResponder

type AgentSessionStreamResponder func(prompt string, context []llm.Message, model llm.Model) (*llm.AssistantMessageEventStream, error)

type AgentSessionSystemPromptResourceLoader

type AgentSessionSystemPromptResourceLoader interface {
	GetSystemPrompt() string
	GetAppendSystemPrompt() string
}

type AllModelRegistry

type AllModelRegistry = modelresolver.AllModelRegistry

type AnthropicSubscriptionWarningChecker

type AnthropicSubscriptionWarningChecker struct {
	Shown                bool
	Settings             AnthropicWarningSettings
	AuthStorage          *AuthStorage
	GetAPIKeyForProvider func(provider string) (string, bool)
}

func (*AnthropicSubscriptionWarningChecker) MaybeWarn

func (c *AnthropicSubscriptionWarningChecker) MaybeWarn(modelProvider string) bool

type AnthropicWarningSettings

type AnthropicWarningSettings struct {
	AnthropicExtraUsage *bool
}

type Args

type Args = internalcli.Args

func ParseArgs

func ParseArgs(argv []string) Args

type AssistantContentBlock

type AssistantContentBlock struct {
	Type      string
	Text      string
	Thinking  string
	ID        string
	Name      string
	Arguments map[string]any
}

type AssistantMessageComponent

type AssistantMessageComponent struct {
	Content             []AssistantContentBlock
	HideThinkingBlock   bool
	HiddenThinkingLabel string
}

func NewAssistantMessageComponent

func NewAssistantMessageComponent(content []AssistantContentBlock) AssistantMessageComponent

func (AssistantMessageComponent) Render

func (c AssistantMessageComponent) Render(width int) []string

type AuthCredential

type AuthCredential struct {
	Type          string `json:"type"`
	Key           string `json:"key,omitempty"`
	Access        string `json:"access,omitempty"`
	Refresh       string `json:"refresh,omitempty"`
	Expires       int64  `json:"expires,omitempty"`
	EnterpriseURL string `json:"enterpriseUrl,omitempty"`
}

type AuthSelectorProvider

type AuthSelectorProvider struct {
	ID       string
	Name     string
	AuthType string
}

type AuthStatus

type AuthStatus struct {
	Configured bool   `json:"configured"`
	Source     string `json:"source,omitempty"`
	Label      string `json:"label,omitempty"`
}

type AuthStatusResolver

type AuthStatusResolver func(providerID string) AuthStatus

type AuthStorage

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

func NewAuthStorage

func NewAuthStorage(authPath string) *AuthStorage

func NewAuthStorageFromBackend

func NewAuthStorageFromBackend(storage AuthStorageBackend) *AuthStorage

func NewInMemoryAuthStorage

func NewInMemoryAuthStorage(data AuthStorageData) *AuthStorage

func (*AuthStorage) DrainErrors

func (s *AuthStorage) DrainErrors() []error

func (*AuthStorage) Get

func (s *AuthStorage) Get(provider string) (AuthCredential, bool)

func (*AuthStorage) GetAPIKey

func (s *AuthStorage) GetAPIKey(provider string) (string, bool)

func (*AuthStorage) GetAPIKeyWithOptions

func (s *AuthStorage) GetAPIKeyWithOptions(provider string, options AuthStorageOptions) (string, bool)

func (*AuthStorage) GetAll

func (s *AuthStorage) GetAll() AuthStorageData

func (*AuthStorage) GetAuthStatus

func (s *AuthStorage) GetAuthStatus(provider string) AuthStatus

func (*AuthStorage) Has

func (s *AuthStorage) Has(provider string) bool

func (*AuthStorage) HasAuth

func (s *AuthStorage) HasAuth(provider string) bool

func (*AuthStorage) List

func (s *AuthStorage) List() []string

func (*AuthStorage) Reload

func (s *AuthStorage) Reload()

func (*AuthStorage) Remove

func (s *AuthStorage) Remove(provider string)

func (*AuthStorage) RemoveRuntimeAPIKey

func (s *AuthStorage) RemoveRuntimeAPIKey(provider string)

func (*AuthStorage) Set

func (s *AuthStorage) Set(provider string, credential AuthCredential)

func (*AuthStorage) SetFallbackResolver

func (s *AuthStorage) SetFallbackResolver(resolver func(provider string) string)

func (*AuthStorage) SetRuntimeAPIKey

func (s *AuthStorage) SetRuntimeAPIKey(provider, apiKey string)

type AuthStorageBackend

type AuthStorageBackend interface {
	WithLock(fn AuthStorageLockFunc) error
}

type AuthStorageData

type AuthStorageData map[string]AuthCredential

type AuthStorageLockFunc

type AuthStorageLockFunc func(current string) (next string, write bool, err error)

type AuthStorageOptions

type AuthStorageOptions struct {
	IncludeFallback bool
}

type AutocompleteEditor

type AutocompleteEditor interface {
	SetAutocompleteProvider(AutocompleteProvider)
}

type AutocompleteProvider

type AutocompleteProvider interface {
	ShouldTriggerFileCompletion(lines []string, cursorLine, cursorCol int) bool
}

type AutocompleteProviderFactory

type AutocompleteProviderFactory func(AutocompleteProvider) AutocompleteProvider

type BashExecOptions

type BashExecOptions struct {
	Context        context.Context
	OnData         func([]byte)
	Env            map[string]string
	ExitStdioGrace time.Duration
}

type BashExecutionCompleteOptions

type BashExecutionCompleteOptions struct {
	Truncated      bool
	FullOutputPath string
}

type BashExecutionComponent

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

func NewBashExecutionComponent

func NewBashExecutionComponent(command string, options ...BashExecutionOptions) *BashExecutionComponent

func (*BashExecutionComponent) AppendOutput

func (b *BashExecutionComponent) AppendOutput(chunk string)

func (*BashExecutionComponent) GetCommand

func (b *BashExecutionComponent) GetCommand() string

func (*BashExecutionComponent) GetOutput

func (b *BashExecutionComponent) GetOutput() string

func (*BashExecutionComponent) Invalidate

func (b *BashExecutionComponent) Invalidate()

func (*BashExecutionComponent) Output

func (b *BashExecutionComponent) Output() string

func (*BashExecutionComponent) Render

func (b *BashExecutionComponent) Render(width int) []string

func (*BashExecutionComponent) SetComplete

func (b *BashExecutionComponent) SetComplete(exitCode int, cancelled bool, options ...BashExecutionCompleteOptions)

func (*BashExecutionComponent) SetExpanded

func (b *BashExecutionComponent) SetExpanded(expanded bool)

type BashExecutionOptions

type BashExecutionOptions struct {
	ExcludeFromContext bool
}

type BashExecutorOptions

type BashExecutorOptions struct {
	Context        context.Context
	OnChunk        func(string)
	ExitStdioGrace time.Duration
}

type BashLocalOperationsOptions

type BashLocalOperationsOptions struct {
	ShellPath string
}

type BashOperationResult

type BashOperationResult struct {
	ExitCode  int  `json:"exitCode"`
	Cancelled bool `json:"cancelled"`
}

type BashOperations

type BashOperations struct {
	Exec func(command, cwd string, options BashExecOptions) (BashOperationResult, error)
}

func CreateLocalBashOperations

func CreateLocalBashOperations(options ...BashLocalOperationsOptions) BashOperations

type BashResult

type BashResult struct {
	Output          string `json:"output"`
	ExitCode        int    `json:"exitCode"`
	Cancelled       bool   `json:"cancelled"`
	Truncated       bool   `json:"truncated"`
	TruncatedBy     string `json:"truncatedBy,omitempty"`
	FullOutputPath  string `json:"fullOutputPath,omitempty"`
	TotalLines      int    `json:"totalLines,omitempty"`
	TotalBytes      int    `json:"totalBytes,omitempty"`
	OutputLines     int    `json:"outputLines,omitempty"`
	OutputBytes     int    `json:"outputBytes,omitempty"`
	LastLinePartial bool   `json:"lastLinePartial,omitempty"`
}

func ExecuteBash

func ExecuteBash(command, cwd string, options ...BashExecutorOptions) (BashResult, error)

func ExecuteBashWithOperations

func ExecuteBashWithOperations(command, cwd string, operations BashOperations, options ...BashExecutorOptions) (BashResult, error)

type BashTool

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

func NewBashTool

func NewBashTool(cwd string, options ...BashToolOptions) BashTool

func (BashTool) Execute

func (t BashTool) Execute(_ string, input BashToolInput) (FileToolResult, error)

func (BashTool) ExecuteWithUpdates

func (t BashTool) ExecuteWithUpdates(_ string, input BashToolInput, onUpdate func(FileToolResult)) (FileToolResult, error)

type BashToolInput

type BashToolInput struct {
	Command string
	Timeout int
}

type BashToolOptions

type BashToolOptions struct {
	CommandPrefix string
	Operations    BashOperations
	ShellPath     string
}

type BorderedLoaderComponent

type BorderedLoaderComponent struct {
	gitui.FocusState

	OnAbort func()
	// contains filtered or unexported fields
}

func NewBorderedLoaderComponent

func NewBorderedLoaderComponent(ui *gitui.TUI, message string, options ...BorderedLoaderOptions) *BorderedLoaderComponent

func NewNonCancellableBorderedLoaderComponent

func NewNonCancellableBorderedLoaderComponent(ui *gitui.TUI, message string) *BorderedLoaderComponent

func (*BorderedLoaderComponent) Aborted

func (c *BorderedLoaderComponent) Aborted() bool

func (*BorderedLoaderComponent) Cancelled

func (c *BorderedLoaderComponent) Cancelled() bool

func (*BorderedLoaderComponent) Context

func (*BorderedLoaderComponent) Dispose

func (c *BorderedLoaderComponent) Dispose()

func (*BorderedLoaderComponent) HandleInput

func (c *BorderedLoaderComponent) HandleInput(data string)

func (*BorderedLoaderComponent) Invalidate

func (c *BorderedLoaderComponent) Invalidate()

func (*BorderedLoaderComponent) Render

func (c *BorderedLoaderComponent) Render(width int) []string

func (*BorderedLoaderComponent) SetOnAbort

func (c *BorderedLoaderComponent) SetOnAbort(fn func())

func (*BorderedLoaderComponent) Signal

type BorderedLoaderOptions

type BorderedLoaderOptions struct {
	Cancellable *bool
}

type BuildSystemPromptOptions

type BuildSystemPromptOptions struct {
	CustomPrompt       string
	SelectedTools      []string
	ToolSnippets       map[string]string
	PromptGuidelines   []string
	AppendSystemPrompt string
	CWD                string
	ContextFiles       []SystemPromptContextFile
	Skills             []SystemPromptSkill
	DocumentationPaths []SystemPromptDocumentationPath
	Now                time.Time
}

type CLIConfigRuntimeHost

type CLIConfigRuntimeHost interface {
	Run() error
}

type CLIInteractiveRuntimeHost

type CLIInteractiveRuntimeHost interface {
	Run() error
}

type CLIInteractiveTUIHost

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

func NewCLIInteractiveTUIHost

func NewCLIInteractiveTUIHost(options CLIInteractiveTUIHostOptions) (*CLIInteractiveTUIHost, error)

func (*CLIInteractiveTUIHost) AvailableTUIThemes

func (h *CLIInteractiveTUIHost) AvailableTUIThemes() []TUIThemeInfo

func (*CLIInteractiveTUIHost) CurrentTUITheme

func (h *CLIInteractiveTUIHost) CurrentTUITheme() string

func (*CLIInteractiveTUIHost) EditorCursor

func (h *CLIInteractiveTUIHost) EditorCursor() (line, col int, ok bool)

func (*CLIInteractiveTUIHost) EditorCustomActive

func (h *CLIInteractiveTUIHost) EditorCustomActive() bool

func (*CLIInteractiveTUIHost) EditorFocused

func (h *CLIInteractiveTUIHost) EditorFocused() bool

func (*CLIInteractiveTUIHost) FocusEditor

func (h *CLIInteractiveTUIHost) FocusEditor() error

func (*CLIInteractiveTUIHost) InsertEditorText

func (h *CLIInteractiveTUIHost) InsertEditorText(text string)

func (*CLIInteractiveTUIHost) PasteEditorText

func (h *CLIInteractiveTUIHost) PasteEditorText(text string)

func (*CLIInteractiveTUIHost) ReadEditorText

func (h *CLIInteractiveTUIHost) ReadEditorText() string

func (*CLIInteractiveTUIHost) Run

func (h *CLIInteractiveTUIHost) Run() error

func (*CLIInteractiveTUIHost) RunContext

func (h *CLIInteractiveTUIHost) RunContext(ctx context.Context) (runErr error)

func (*CLIInteractiveTUIHost) RunTUIDialog

func (h *CLIInteractiveTUIHost) RunTUIDialog(request TUIDialogRequest) (TUIDialogResult, error)

func (*CLIInteractiveTUIHost) SetEditorText

func (h *CLIInteractiveTUIHost) SetEditorText(text string)

func (*CLIInteractiveTUIHost) SetHiddenThinkingLabel

func (h *CLIInteractiveTUIHost) SetHiddenThinkingLabel(label string) error

func (*CLIInteractiveTUIHost) SetTUIStatus

func (h *CLIInteractiveTUIHost) SetTUIStatus(key, text string) error

func (*CLIInteractiveTUIHost) SetTUITheme

func (h *CLIInteractiveTUIHost) SetTUITheme(name string) error

func (*CLIInteractiveTUIHost) SetTUITitle

func (h *CLIInteractiveTUIHost) SetTUITitle(title string) error

func (*CLIInteractiveTUIHost) SetTUIToolsExpanded

func (h *CLIInteractiveTUIHost) SetTUIToolsExpanded(expanded bool) error

func (*CLIInteractiveTUIHost) SetTUIWorking

func (h *CLIInteractiveTUIHost) SetTUIWorking(update TUIWorkingUpdate) error

func (*CLIInteractiveTUIHost) Stop

func (h *CLIInteractiveTUIHost) Stop()

func (*CLIInteractiveTUIHost) SubmitEditorText

func (h *CLIInteractiveTUIHost) SubmitEditorText() error

func (*CLIInteractiveTUIHost) TUIToolsExpanded

func (h *CLIInteractiveTUIHost) TUIToolsExpanded() bool

type CLIInteractiveTUIHostOptions

type CLIInteractiveTUIHostOptions struct {
	RuntimeHost         PrintModeRuntimeHost
	InitialMessage      string
	InitialImages       []llm.ContentPart
	Messages            []string
	Terminal            gitui.Terminal
	ViewTreeHost        *ViewTreeHost
	InProcessUI         *InProcessUIRegistry
	ClipboardCopy       func(string) error
	ClipboardImageRead  func() *ClipboardImage
	ClipboardImageDir   string
	ShareCreateGist     func(context.Context, string) (string, error)
	Suspend             InteractiveSuspendOperations
	TmuxOptionReader    TmuxOptionReader
	VerboseStartup      bool
	ExitAfterInitial    bool
	ClearScreenOnStart  bool
	ShowFooter          bool
	Version             string
	PackageName         string
	InstallEnvironment  InstallEnvironment
	VersionCheck        VersionReleaseChecker
	VersionCheckOptions VersionCheckOptions
	PackageUpdateCheck  PackageUpdateChecker
	BashOperations      BashOperations
	ShutdownSignals     <-chan os.Signal
	StartupWarnings     []string
}

type CLIOptions

type CLIOptions struct {
	Args                   []string
	Stdout                 io.Writer
	Stderr                 io.Writer
	Stdin                  io.Reader
	CWD                    string
	AgentDir               string
	Startup                func(stderr io.Writer) error
	PrintModeHostFactory   func(Args) (PrintModeRuntimeHost, error)
	InteractiveHostFactory func(Args) (CLIInteractiveRuntimeHost, error)
	ConfigHostFactory      func(PackageResourceConfigOptions) (CLIConfigRuntimeHost, error)
	ModelRegistry          *ModelRegistry
	PackageManager         *DefaultPackageManager
	PackageName            string
	Version                string
	InstallEnvironment     InstallEnvironment
	VersionCheck           VersionReleaseChecker
	VersionCheckOptions    VersionCheckOptions
	StartupWarnings        []string
	Responder              AgentSessionResponder
}

type CLIStartupMigrationResult

type CLIStartupMigrationResult struct {
	StartupWarnings []string
}

type ClipboardCopyOperations

type ClipboardCopyOperations = clip.ClipboardCopyOperations

type ClipboardCopyOptions

type ClipboardCopyOptions = clip.ClipboardCopyOptions

type ClipboardImage

type ClipboardImage = clip.ClipboardImage

func ReadClipboardImage

func ReadClipboardImage(options ClipboardImageOptions) *ClipboardImage

type ClipboardImageCommandOptions

type ClipboardImageCommandOptions = clip.ClipboardImageCommandOptions

type ClipboardImageCommandResult

type ClipboardImageCommandResult = clip.ClipboardImageCommandResult

type ClipboardImageOperations

type ClipboardImageOperations = clip.ClipboardImageOperations

type ClipboardImageOptions

type ClipboardImageOptions = clip.ClipboardImageOptions

type ClipboardTextCommandOptions

type ClipboardTextCommandOptions = clip.ClipboardTextCommandOptions

type CodingAgentFauxState

type CodingAgentFauxState struct {
	CallCount int
	Contexts  [][]llm.Message
}

type CodingAgentTestHarness

type CodingAgentTestHarness struct {
	Session          *AgentSession
	SessionManager   *SessionManager
	Faux             *CodingAgentFauxState
	Events           []AgentSessionEvent
	TempDir          string
	ExtensionRuntime *ProtocolExtensionRuntime
}

func NewCodingAgentTestHarnessWithProtocolExtensions

func NewCodingAgentTestHarnessWithProtocolExtensions(options CodingAgentTestHarnessOptions, factories []ProtocolExtensionFactory) (*CodingAgentTestHarness, error)

func (*CodingAgentTestHarness) Cleanup

func (h *CodingAgentTestHarness) Cleanup()

func (*CodingAgentTestHarness) EventsOfType

func (h *CodingAgentTestHarness) EventsOfType(eventType string) []AgentSessionEvent

func (*CodingAgentTestHarness) Messages

func (h *CodingAgentTestHarness) Messages() []llm.Message

type CodingAgentTestHarnessModelOverride

type CodingAgentTestHarnessModelOverride struct {
	Provider string
	ID       string
}

type CodingAgentTestHarnessOptions

type CodingAgentTestHarnessOptions struct {
	Responses     []CodingAgentTestHarnessResponse
	Model         llm.Model
	RetrySettings *AgentSessionRetrySettings
	Tools         []SDKTool
}

type CodingAgentTestHarnessResponse

type CodingAgentTestHarnessResponse struct {
	Text       *string
	Thinking   string
	ToolCalls  []CodingAgentTestHarnessToolCall
	StopReason string
	Error      string
	Usage      *llm.Usage
	Model      *CodingAgentTestHarnessModelOverride
}

func TextHarnessResponse

func TextHarnessResponse(text string) CodingAgentTestHarnessResponse

type CodingAgentTestHarnessToolCall

type CodingAgentTestHarnessToolCall struct {
	ID        string
	Name      string
	Arguments map[string]any
}

type CodingModelRegistry

type CodingModelRegistry = modelresolver.CodingModelRegistry

type ConfiguredPackage

type ConfiguredPackage struct {
	Source        string
	Scope         string
	Filtered      bool
	InstalledPath string
}

type ConvertedImage

type ConvertedImage = imageresize.ConvertedImage

func ConvertToPNG

func ConvertToPNG(base64Data, mimeType string) *ConvertedImage

type CreateAgentSessionRuntimeFactory

type CreateAgentSessionRuntimeFactory func(AgentSessionRuntimeOptions) (any, error)

type DefaultAgentSessionResourceLoader

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

func NewDefaultAgentSessionResourceLoader

func NewDefaultAgentSessionResourceLoader(cwd, agentDir string) *DefaultAgentSessionResourceLoader

func (*DefaultAgentSessionResourceLoader) GetAgentsFiles

func (*DefaultAgentSessionResourceLoader) GetAppendSystemPrompt

func (l *DefaultAgentSessionResourceLoader) GetAppendSystemPrompt() string

func (*DefaultAgentSessionResourceLoader) GetPrompts

func (*DefaultAgentSessionResourceLoader) GetSkills

func (*DefaultAgentSessionResourceLoader) GetSystemPrompt

func (l *DefaultAgentSessionResourceLoader) GetSystemPrompt() string

type DefaultPackageManager

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

func NewDefaultPackageManager

func NewDefaultPackageManager(options PackageManagerOptions) *DefaultPackageManager

func (*DefaultPackageManager) CheckForAvailableUpdates

func (m *DefaultPackageManager) CheckForAvailableUpdates() ([]PackageUpdate, error)

func (*DefaultPackageManager) GetInstalledPath

func (m *DefaultPackageManager) GetInstalledPath(source, scope string) string

func (*DefaultPackageManager) GetPackageIdentity

func (m *DefaultPackageManager) GetPackageIdentity(source string) string

func (*DefaultPackageManager) Install

func (m *DefaultPackageManager) Install(source string, project bool) error

func (*DefaultPackageManager) ListConfiguredPackages

func (m *DefaultPackageManager) ListConfiguredPackages() []ConfiguredPackage

func (*DefaultPackageManager) ListPackageResourceToggles

func (m *DefaultPackageManager) ListPackageResourceToggles() ([]PackageResourceToggleItem, error)

func (*DefaultPackageManager) ListResourceToggles

func (m *DefaultPackageManager) ListResourceToggles() ([]PackageResourceToggleItem, error)

func (*DefaultPackageManager) ListTopLevelResourceToggles

func (m *DefaultPackageManager) ListTopLevelResourceToggles() []PackageResourceToggleItem

func (*DefaultPackageManager) ParseSource

func (m *DefaultPackageManager) ParseSource(source string) PackageSource

func (*DefaultPackageManager) Remove

func (m *DefaultPackageManager) Remove(source string, project bool) error

func (*DefaultPackageManager) RemoveAndPersist

func (m *DefaultPackageManager) RemoveAndPersist(source string, project bool) (bool, error)

func (*DefaultPackageManager) ResolveConfiguredProtocolPackageResources

func (m *DefaultPackageManager) ResolveConfiguredProtocolPackageResources() (ProtocolPackageResources, error)

func (*DefaultPackageManager) ResolveExtensionSources

func (m *DefaultPackageManager) ResolveExtensionSources(sources []string, options ResolveExtensionSourcesOptions) ([]string, error)

func (*DefaultPackageManager) ResolveProtocolPackageResources

func (m *DefaultPackageManager) ResolveProtocolPackageResources(sources []string) (ProtocolPackageResources, error)

func (*DefaultPackageManager) ResolveProtocolPackageSourceSpecs

func (m *DefaultPackageManager) ResolveProtocolPackageSourceSpecs(specs []ProtocolPackageSourceSpec) (ProtocolPackageResources, error)

func (*DefaultPackageManager) RunSelfUpdate

func (m *DefaultPackageManager) RunSelfUpdate(options SelfUpdateOptions) (SelfUpdateResult, error)

func (*DefaultPackageManager) SetPackageResourceEnabled

func (m *DefaultPackageManager) SetPackageResourceEnabled(toggle PackageResourceToggle) (bool, error)

func (*DefaultPackageManager) SetProgressCallback

func (m *DefaultPackageManager) SetProgressCallback(callback func(PackageProgressEvent))

func (*DefaultPackageManager) SetTopLevelResourceEnabled

func (m *DefaultPackageManager) SetTopLevelResourceEnabled(toggle TopLevelResourceToggle) (bool, error)

func (*DefaultPackageManager) Update

func (m *DefaultPackageManager) Update(sources ...string) error

type DefaultResourceLoader

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

func NewDefaultResourceLoader

func NewDefaultResourceLoader(options DefaultResourceLoaderOptions) *DefaultResourceLoader

func (*DefaultResourceLoader) ApplyExtensionFlagValues

func (l *DefaultResourceLoader) ApplyExtensionFlagValues(values map[string]any, allowDeferred bool) []ProtocolExtensionDiscoveryError

func (*DefaultResourceLoader) ExtendResources

func (l *DefaultResourceLoader) ExtendResources(resources ResourceExtension)

func (*DefaultResourceLoader) GetAgentsFiles

func (*DefaultResourceLoader) GetAppendSystemPrompt

func (l *DefaultResourceLoader) GetAppendSystemPrompt() string

func (*DefaultResourceLoader) GetExtensions

func (*DefaultResourceLoader) GetPrompts

func (*DefaultResourceLoader) GetSkills

func (*DefaultResourceLoader) GetSystemPrompt

func (l *DefaultResourceLoader) GetSystemPrompt() string

func (*DefaultResourceLoader) GetThemes

func (*DefaultResourceLoader) Reload

func (l *DefaultResourceLoader) Reload()

type DefaultResourceLoaderOptions

type DefaultResourceLoaderOptions struct {
	CWD                      string
	AgentDir                 string
	SettingsManager          *SettingsManager
	NoExtensions             bool
	NoContextFiles           bool
	NoSkills                 bool
	NoPromptTemplates        bool
	NoThemes                 bool
	AdditionalExtensionPaths []string
	AdditionalSkillPaths     []string
	AdditionalPromptPaths    []string
	AdditionalThemePaths     []string
	SystemPrompt             string
	AppendSystemPrompt       []string
	SkillsOverride           func() ResourceSkillsResult
	SystemPromptOverride     func() string
	ExtensionFactories       []ProtocolExtensionFactory
}

type Diagnostic

type Diagnostic = internalcli.Diagnostic

type Edit

type Edit struct {
	OldText string
	NewText string
}

type EditDiffResult

type EditDiffResult struct {
	Diff  string `json:"diff,omitempty"`
	Error string `json:"error,omitempty"`
}

func ComputeEditsDiff

func ComputeEditsDiff(path string, edits []Edit, cwd string, operations ...FileToolOperations) EditDiffResult

type EditTool

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

func NewEditTool

func NewEditTool(cwd string, operations ...FileToolOperations) EditTool

func (EditTool) Execute

func (t EditTool) Execute(_ string, input EditToolInput) (FileToolResult, error)

type EditToolInput

type EditToolInput struct {
	Path  string
	Edits []Edit
}

type ExportHTMLOptions

type ExportHTMLOptions struct {
	ThemeName    string
	AgentDir     string
	ToolRenderer ExportHTMLToolRenderer
}

type ExportHTMLRenderedTool

type ExportHTMLRenderedTool struct {
	CallHTML            string `json:"callHtml,omitempty"`
	ResultHTMLCollapsed string `json:"resultHtmlCollapsed,omitempty"`
	ResultHTMLExpanded  string `json:"resultHtmlExpanded,omitempty"`
}

type ExportHTMLSessionData

type ExportHTMLSessionData struct {
	Header        *SessionHeader                    `json:"header,omitempty"`
	Entries       []FileEntry                       `json:"entries"`
	LeafID        *string                           `json:"leafId"`
	SystemPrompt  string                            `json:"systemPrompt,omitempty"`
	Tools         []ExportHTMLToolDefinition        `json:"tools,omitempty"`
	RenderedTools map[string]ExportHTMLRenderedTool `json:"renderedTools,omitempty"`
}

func BuildExportHTMLSessionData

func BuildExportHTMLSessionData(sessionManager *SessionManager) ExportHTMLSessionData

func BuildExportHTMLSessionDataWithOptions

func BuildExportHTMLSessionDataWithOptions(sessionManager *SessionManager, options ExportHTMLOptions) ExportHTMLSessionData

type ExportHTMLSidebarEntry

type ExportHTMLSidebarEntry struct {
	Role  string
	Label string
}

func ExportHTMLSidebarEntriesForUserMessage

func ExportHTMLSidebarEntriesForUserMessage(text string) []ExportHTMLSidebarEntry

type ExportHTMLSkillBlock

type ExportHTMLSkillBlock struct {
	Name        string
	Location    string
	Content     string
	UserMessage string
}

func ParseExportHTMLSkillBlock

func ParseExportHTMLSkillBlock(text string) (ExportHTMLSkillBlock, bool)

type ExportHTMLToolDefinition

type ExportHTMLToolDefinition struct {
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
	Parameters  any    `json:"parameters,omitempty"`
}

type ExportHTMLToolRenderResult

type ExportHTMLToolRenderResult struct {
	Collapsed string
	Expanded  string
}

type ExportHTMLToolRenderer

type ExportHTMLToolRenderer interface {
	RenderCall(toolCallID, toolName string, args any) string
	RenderResult(toolCallID, toolName string, result FileToolResult, isError bool) ExportHTMLToolRenderResult
}

type ExportHTMLToolRendererDeps

type ExportHTMLToolRendererDeps struct {
	GetToolDefinition func(name string) (ToolDefinition, bool)
	CWD               string
	Width             int
	ShowImages        bool
}

type ExtensionSelectorComponent

type ExtensionSelectorComponent struct {
	OnSelect func(option string)
	OnCancel func()
	// contains filtered or unexported fields
}

func NewExtensionSelectorComponent

func NewExtensionSelectorComponent(title string, options []string) *ExtensionSelectorComponent

func (*ExtensionSelectorComponent) Focused

func (c *ExtensionSelectorComponent) Focused() bool

func (*ExtensionSelectorComponent) HandleInput

func (c *ExtensionSelectorComponent) HandleInput(input string)

func (*ExtensionSelectorComponent) Invalidate

func (c *ExtensionSelectorComponent) Invalidate()

func (*ExtensionSelectorComponent) Render

func (c *ExtensionSelectorComponent) Render(width int) []string

func (*ExtensionSelectorComponent) SetFocused

func (c *ExtensionSelectorComponent) SetFocused(focused bool)

func (*ExtensionSelectorComponent) SetTitle

func (c *ExtensionSelectorComponent) SetTitle(title string)

func (*ExtensionSelectorComponent) Title

type FSWatchListener

type FSWatchListener = fswatch.FSWatchListener

type FSWatchOptions

type FSWatchOptions = fswatch.FSWatchOptions

type FSWatcher

type FSWatcher = fswatch.FSWatcher

func WatchPathsWithErrorHandler

func WatchPathsWithErrorHandler(paths []string, listener FSWatchListener, onError func(), options ...FSWatchOptions) FSWatcher

func WatchWithErrorHandler

func WatchWithErrorHandler(path string, listener FSWatchListener, onError func(), options ...FSWatchOptions) FSWatcher

type FileAuthStorageBackend

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

func NewFileAuthStorageBackend

func NewFileAuthStorageBackend(authPath string) *FileAuthStorageBackend

func (*FileAuthStorageBackend) WithLock

type FileEntry

type FileEntry struct {
	Type          string
	ID            string
	Version       int
	Timestamp     string
	CWD           string
	ParentSession string
	ParentID      *string
	Message       any
	ThinkingLevel string
	Provider      string
	ModelID       string
	Summary       string
	FirstKeptID   string
	TokensBefore  int
	CustomType    string
	Data          any
	Content       any
	Display       bool
	Details       any
	FromHook      bool
	TargetID      string
	Label         string
	Name          string
	FromID        string
	// contains filtered or unexported fields
}

func LoadEntriesFromFile

func LoadEntriesFromFile(filePath string) []FileEntry

func (FileEntry) MarshalJSON

func (e FileEntry) MarshalJSON() ([]byte, error)

func (*FileEntry) UnmarshalJSON

func (e *FileEntry) UnmarshalJSON(data []byte) error

type FileToolDetails

type FileToolDetails struct {
	Truncation           *ReadToolTruncation `json:"truncation,omitempty"`
	Diff                 string              `json:"diff,omitempty"`
	FirstChangedLine     int                 `json:"firstChangedLine,omitempty"`
	FullOutputPath       string              `json:"fullOutputPath,omitempty"`
	MatchLimitReached    int                 `json:"matchLimitReached,omitempty"`
	ResultLimitReached   int                 `json:"resultLimitReached,omitempty"`
	EntryLimitReached    int                 `json:"entryLimitReached,omitempty"`
	SearchLinesTruncated bool                `json:"searchLinesTruncated,omitempty"`
}

type FileToolOperations

type FileToolOperations struct {
	Access      func(path string) error
	ReadFile    func(path string) ([]byte, error)
	WriteFile   func(path string, content []byte) error
	MkdirAll    func(path string) error
	ResizeImage func(part llm.ContentPart, options ImageResizeOptions) *ResizedImage
}

type FileToolResult

type FileToolResult struct {
	Text    string
	Content []llm.ContentPart
	Details *FileToolDetails
}

type FindInitialModelOptions

type FindInitialModelOptions = modelresolver.FindInitialModelOptions

type FindTool

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

func NewFindTool

func NewFindTool(cwd string) FindTool

func (FindTool) Execute

func (t FindTool) Execute(_ string, input FindToolInput) (FileToolResult, error)

type FindToolInput

type FindToolInput struct {
	Pattern string
	Path    string
	Limit   int
}

type FooterComponent

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

func NewFooterComponent

func NewFooterComponent(state FooterState) *FooterComponent

func (*FooterComponent) Invalidate

func (f *FooterComponent) Invalidate()

func (*FooterComponent) Render

func (f *FooterComponent) Render(width int) []string

func (*FooterComponent) SetAutoCompactEnabled

func (f *FooterComponent) SetAutoCompactEnabled(enabled bool)

func (*FooterComponent) SetState

func (f *FooterComponent) SetState(state FooterState)

type FooterDataProvider

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

func NewFooterDataProvider

func NewFooterDataProvider(cwd string, options ...FooterDataProviderOptions) *FooterDataProvider

func (*FooterDataProvider) ClearExtensionStatuses

func (p *FooterDataProvider) ClearExtensionStatuses()

func (*FooterDataProvider) Dispose

func (p *FooterDataProvider) Dispose()

func (*FooterDataProvider) GetAvailableProviderCount

func (p *FooterDataProvider) GetAvailableProviderCount() int

func (*FooterDataProvider) GetExtensionStatuses

func (p *FooterDataProvider) GetExtensionStatuses() map[string]string

func (*FooterDataProvider) GetGitBranch

func (p *FooterDataProvider) GetGitBranch() string

func (*FooterDataProvider) OnBranchChange

func (p *FooterDataProvider) OnBranchChange(callback func()) func()

func (*FooterDataProvider) SetAvailableProviderCount

func (p *FooterDataProvider) SetAvailableProviderCount(count int)

func (*FooterDataProvider) SetCwd

func (p *FooterDataProvider) SetCwd(cwd string)

func (*FooterDataProvider) SetExtensionStatus

func (p *FooterDataProvider) SetExtensionStatus(key string, text *string)

type FooterDataProviderOptions

type FooterDataProviderOptions struct {
	GitBranchResolver FooterGitBranchResolver
	WatchDebounce     time.Duration
	WatchPollInterval time.Duration
	WatchRetryDelay   time.Duration
	DisableWatchers   bool
}

type FooterGitBranchResolver

type FooterGitBranchResolver func(repoDir string) (branch string, ok bool)

type FooterState

type FooterState struct {
	CWD                    string
	GitBranch              string
	SessionName            string
	ModelID                string
	Provider               string
	Reasoning              bool
	ThinkingLevel          string
	ContextWindow          int
	ContextPercent         *float64
	AvailableProviderCount int
	UsingOAuth             bool
	Usage                  []FooterUsage
	ExtensionStatuses      map[string]string
}

type FooterUsage

type FooterUsage struct {
	Input      int
	Output     int
	CacheRead  int
	CacheWrite int
	CostTotal  float64
}

type FrontmatterResult

type FrontmatterResult = frontmatter.Result

func ParseFrontmatter

func ParseFrontmatter(content string) (FrontmatterResult, error)

type GitSource

type GitSource = gitsource.GitSource

func ParseGitURL

func ParseGitURL(source string) (GitSource, bool)

type GrepTool

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

func NewGrepTool

func NewGrepTool(cwd string) GrepTool

func (GrepTool) Execute

func (t GrepTool) Execute(_ string, input GrepToolInput) (FileToolResult, error)

type GrepToolInput

type GrepToolInput struct {
	Pattern    string
	Path       string
	Glob       string
	IgnoreCase bool
	Literal    bool
	Limit      int
	Context    int
}

type HighlightOptions

type HighlightOptions = syntaxhighlight.HighlightOptions

type HighlightTheme

type HighlightTheme = syntaxhighlight.HighlightTheme

type HostActionError

type HostActionError struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

type HostActionRequest

type HostActionRequest struct {
	Type     string          `json:"type"`
	Protocol string          `json:"protocol,omitempty"`
	ID       string          `json:"id"`
	Method   string          `json:"method"`
	Params   json.RawMessage `json:"params"`
}

type HostActionResponse

type HostActionResponse struct {
	Type     string           `json:"type"`
	Protocol string           `json:"protocol,omitempty"`
	ID       string           `json:"id"`
	Result   any              `json:"result,omitempty"`
	Error    *HostActionError `json:"error,omitempty"`
}

type HostPolicyDecision

type HostPolicyDecision struct {
	Granted             bool     `json:"granted"`
	GrantedCapabilities []string `json:"grantedCapabilities,omitempty"`
	DeniedCapabilities  []string `json:"deniedCapabilities,omitempty"`
	Reason              string   `json:"reason,omitempty"`
	Persistent          bool     `json:"persistent,omitempty"`
}

type HostPolicyRequest

type HostPolicyRequest struct {
	Capability   string   `json:"capability,omitempty"`
	Capabilities []string `json:"capabilities,omitempty"`
	Reason       string   `json:"reason,omitempty"`
	Persistent   bool     `json:"persistent,omitempty"`
}

type HostPolicyRequester

type HostPolicyRequester interface {
	RequestHostPolicyGrant(request HostPolicyRequest) (HostPolicyDecision, error)
}

type HostPolicyRequesterFunc

type HostPolicyRequesterFunc func(HostPolicyRequest) (HostPolicyDecision, error)

func (HostPolicyRequesterFunc) RequestHostPolicyGrant

func (f HostPolicyRequesterFunc) RequestHostPolicyGrant(request HostPolicyRequest) (HostPolicyDecision, error)

type HostProcessExecutor

type HostProcessExecutor interface {
	ExecuteHostProcess(command []string, cwd string) (HostProcessResult, error)
}

type HostProcessExecutorWithOptions

type HostProcessExecutorWithOptions interface {
	ExecuteHostProcessWithOptions(command []string, cwd string, options HostProcessOptions) (HostProcessResult, error)
}

type HostProcessOptions

type HostProcessOptions struct {
	Timeout time.Duration
	Context context.Context
}

type HostProcessResult

type HostProcessResult struct {
	ExitCode int    `json:"exitCode"`
	Stdout   string `json:"stdout,omitempty"`
	Stderr   string `json:"stderr,omitempty"`
	Killed   bool   `json:"killed,omitempty"`
}

type ImageResizeOptions

type ImageResizeOptions = imageresize.ImageResizeOptions

type InMemoryAuthStorageBackend

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

func NewInMemoryAuthStorageBackend

func NewInMemoryAuthStorageBackend(data AuthStorageData) *InMemoryAuthStorageBackend

func (*InMemoryAuthStorageBackend) WithLock

type InProcessComponentContext

type InProcessComponentContext struct {
	Session     *AgentSession
	RuntimeHost PrintModeRuntimeHost
	ViewTree    *ViewTreeHost
}

type InProcessComponentFactory

type InProcessComponentFactory func(InProcessComponentContext) (gitui.Component, func(), error)

type InProcessCustomComponentFactory

type InProcessCustomComponentFactory func(InProcessComponentContext, InProcessCustomDone) (gitui.Component, func(), error)

type InProcessCustomDone

type InProcessCustomDone func(result any)

type InProcessCustomHandle

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

func (*InProcessCustomHandle) Close

func (h *InProcessCustomHandle) Close() bool

func (*InProcessCustomHandle) Done

type InProcessCustomOptions

type InProcessCustomOptions struct {
	Slot    string
	Overlay *gitui.OverlayOptions
}

type InProcessCustomResult

type InProcessCustomResult struct {
	Value     any
	Err       error
	Cancelled bool
}

type InProcessSlotRegistration

type InProcessSlotRegistration struct {
	Key     string
	Slot    string
	Factory InProcessComponentFactory
	Version int
	Overlay *gitui.OverlayOptions
}

type InProcessUIRegistry

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

func NewInProcessUIRegistry

func NewInProcessUIRegistry() *InProcessUIRegistry

func (*InProcessUIRegistry) OnChange

func (r *InProcessUIRegistry) OnChange(listener func()) func()

func (*InProcessUIRegistry) Remove

func (r *InProcessUIRegistry) Remove(key string) bool

func (*InProcessUIRegistry) SetEditor

func (r *InProcessUIRegistry) SetEditor(key string, factory InProcessComponentFactory)

func (*InProcessUIRegistry) SetFooter

func (r *InProcessUIRegistry) SetFooter(key string, factory InProcessComponentFactory)

func (*InProcessUIRegistry) SetHeader

func (r *InProcessUIRegistry) SetHeader(key string, factory InProcessComponentFactory)

func (*InProcessUIRegistry) SetOverlay

func (r *InProcessUIRegistry) SetOverlay(key string, factory InProcessComponentFactory, options ...gitui.OverlayOptions)

func (*InProcessUIRegistry) SetSlot

func (r *InProcessUIRegistry) SetSlot(key, slot string, factory InProcessComponentFactory)

func (*InProcessUIRegistry) SetWidget

func (r *InProcessUIRegistry) SetWidget(key, slot string, factory InProcessComponentFactory)

func (*InProcessUIRegistry) ShowCustom

func (*InProcessUIRegistry) Slots

type InitialMessageInput

type InitialMessageInput = internalcli.InitialMessageInput

type InitialMessageResult

type InitialMessageResult = internalcli.InitialMessageResult

func BuildInitialMessage

func BuildInitialMessage(input InitialMessageInput) InitialMessageResult

type InitialModelResult

type InitialModelResult = modelresolver.InitialModelResult

func FindInitialModel

func FindInitialModel(options FindInitialModelOptions) InitialModelResult

type InstallEnvironment

type InstallEnvironment struct {
	ExecPath      string
	PackageDir    string
	Platform      string
	HomeDir       string
	BunBinary     bool
	BunRuntime    bool
	CommandOutput func(command string, args []string, requireSuccess bool) (string, bool, error)
}

func DefaultInstallEnvironment

func DefaultInstallEnvironment() InstallEnvironment

type InstallMethod

type InstallMethod string

func DetectInstallMethod

func DetectInstallMethod(env InstallEnvironment) InstallMethod

type InteractiveContainer

type InteractiveContainer interface {
	Clear()
	AddText(text string)
}

type InteractiveContextFile

type InteractiveContextFile struct {
	Path    string
	Content string
}

type InteractiveDefaultEditor

type InteractiveDefaultEditor struct {
	OnEscape func()
}

type InteractiveEditor

type InteractiveEditor interface {
	SetText(text string)
}

type InteractiveExpandable

type InteractiveExpandable interface {
	SetExpanded(expanded bool)
}

type InteractiveExtensionResource

type InteractiveExtensionResource struct {
	Path       string
	SourceInfo *InteractiveSourceInfo
}

type InteractiveExtensionUIContext

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

func (InteractiveExtensionUIContext) AddAutocompleteProvider

func (c InteractiveExtensionUIContext) AddAutocompleteProvider(wrapper AutocompleteProviderFactory)

func (InteractiveExtensionUIContext) GetToolsExpanded

func (c InteractiveExtensionUIContext) GetToolsExpanded() bool

func (InteractiveExtensionUIContext) SetTheme

func (InteractiveExtensionUIContext) SetToolsExpanded

func (c InteractiveExtensionUIContext) SetToolsExpanded(expanded bool)

type InteractiveFlushCompactionOptions

type InteractiveFlushCompactionOptions struct {
	WillRetry bool
}

type InteractiveFooter

type InteractiveFooter interface {
	Invalidate()
}

type InteractiveForkOptions

type InteractiveForkOptions struct {
	Position string
}

type InteractiveForkResult

type InteractiveForkResult struct {
	Cancelled bool
}

type InteractiveImportResult

type InteractiveImportResult struct {
	Cancelled bool
}

type InteractiveIndexedTextContainer

type InteractiveIndexedTextContainer interface {
	InteractiveContainer
	Len() int
	SetTextAt(index int, text string)
}

type InteractiveLoadedResources

type InteractiveLoadedResources struct {
	QuietStartup         bool
	Verbose              bool
	ToolOutputExpanded   bool
	CWD                  string
	ContextFiles         []InteractiveContextFile
	Extensions           []InteractiveExtensionResource
	Skills               []InteractiveSkillResource
	Prompts              []InteractivePromptResource
	Themes               []InteractiveThemeResource
	SkillDiagnostics     []InteractiveResourceDiagnostic
	PromptDiagnostics    []InteractiveResourceDiagnostic
	ExtensionDiagnostics []InteractiveResourceDiagnostic
	ThemeDiagnostics     []InteractiveResourceDiagnostic
}

type InteractiveMessage

type InteractiveMessage struct {
	Role         string
	Summary      string
	TokensBefore int
	Timestamp    string
}

type InteractiveMode

type InteractiveMode struct {
	SessionManager InteractiveSessionLeafProvider
	RuntimeHost    InteractiveRuntimeHost
	UI             InteractiveUI
	Editor         InteractiveEditor
	Status         InteractiveContainer
	Chat           InteractiveContainer
	Footer         InteractiveFooter
	Settings       InteractiveSettings

	LoadingAnimation            InteractiveStopper
	AutoCompactionLoader        InteractiveStopper
	DefaultEditor               *InteractiveDefaultEditor
	AutoCompactionEscapeHandler func()
	Suspend                     InteractiveSuspendOperations

	ToolOutputExpanded             bool
	CustomHeader                   InteractiveExpandable
	BuiltInHeader                  InteractiveExpandable
	ChatExpandables                []InteractiveExpandable
	ThemeSettings                  InteractiveThemeSettings
	AutocompleteProviderWrappers   []AutocompleteProviderFactory
	CreateBaseAutocompleteProvider func() AutocompleteProvider
	DefaultAutocompleteEditor      AutocompleteEditor
	AutocompleteEditor             AutocompleteEditor
	LoadedResources                InteractiveLoadedResources
	PendingTools                   map[string]*ToolExecutionComponent
	PendingToolChatIndexes         map[string]int

	RenderCurrentSessionState   func()
	RebuildChatFromMessages     func()
	AddMessageToChat            func(InteractiveMessage)
	GetRegisteredToolDefinition func(toolName string) ToolDefinition
	FlushCompactionQueue        func(InteractiveFlushCompactionOptions) error
	ShowStatus                  func(string)
	ShowError                   func(string)
	ShowExtensionConfirm        func(title, message string) (bool, error)
	PromptForMissingSessionCwd  func(error) (string, error)
	HandleFatalRuntimeError     func(prefix string, err error) error
	// contains filtered or unexported fields
}

func (*InteractiveMode) CreateExtensionUIContext

func (m *InteractiveMode) CreateExtensionUIContext() InteractiveExtensionUIContext

func (*InteractiveMode) FormatLoadedResources

func (m *InteractiveMode) FormatLoadedResources(options InteractiveShowLoadedResourcesOptions) string

func (*InteractiveMode) GetPathCommandArgument

func (m *InteractiveMode) GetPathCommandArgument(text, command string) (string, bool)

func (*InteractiveMode) HandleCloneCommand

func (m *InteractiveMode) HandleCloneCommand() error

func (*InteractiveMode) HandleCtrlZ

func (m *InteractiveMode) HandleCtrlZ() error

func (*InteractiveMode) HandleEvent

func (m *InteractiveMode) HandleEvent(event AgentSessionEvent) error

func (*InteractiveMode) HandleImportCommand

func (m *InteractiveMode) HandleImportCommand(text string) error

func (*InteractiveMode) RenderSessionContext

func (m *InteractiveMode) RenderSessionContext(context SessionContext)

func (*InteractiveMode) SetToolsExpanded

func (m *InteractiveMode) SetToolsExpanded(expanded bool)

func (*InteractiveMode) SetupAutocompleteProvider

func (m *InteractiveMode) SetupAutocompleteProvider()

func (*InteractiveMode) ShowLoadedResources

func (m *InteractiveMode) ShowLoadedResources(options InteractiveShowLoadedResourcesOptions)

func (*InteractiveMode) ShowStatusMessage

func (m *InteractiveMode) ShowStatusMessage(message string)

type InteractivePromptResource

type InteractivePromptResource struct {
	FilePath   string
	Name       string
	SourceInfo *InteractiveSourceInfo
}

type InteractiveResourceDiagnostic

type InteractiveResourceDiagnostic struct {
	Type    string
	Message string
	Path    string
}

type InteractiveRuntimeHost

type InteractiveRuntimeHost interface {
	Fork(entryID string, options InteractiveForkOptions) (InteractiveForkResult, error)
	ImportFromJsonl(inputPath string, cwdOverride ...string) (InteractiveImportResult, error)
}

type InteractiveSessionLeafProvider

type InteractiveSessionLeafProvider interface {
	GetLeafID() *string
}

type InteractiveSettings

type InteractiveSettings interface {
	GetShowTerminalProgress() bool
}

type InteractiveShowLoadedResourcesOptions

type InteractiveShowLoadedResourcesOptions struct {
	Force                    bool
	ShowDiagnosticsWhenQuiet bool
}

type InteractiveSkillResource

type InteractiveSkillResource struct {
	FilePath   string
	Name       string
	SourceInfo *InteractiveSourceInfo
}

type InteractiveSourceInfo

type InteractiveSourceInfo struct {
	Path    string
	Source  string
	Scope   string
	Origin  string
	BaseDir string
}

type InteractiveStatusChat

type InteractiveStatusChat struct {
	Children []string
}

func (*InteractiveStatusChat) AddText

func (c *InteractiveStatusChat) AddText(text string)

func (*InteractiveStatusChat) Clear

func (c *InteractiveStatusChat) Clear()

func (*InteractiveStatusChat) Len

func (c *InteractiveStatusChat) Len() int

func (*InteractiveStatusChat) Render

func (c *InteractiveStatusChat) Render() string

func (*InteractiveStatusChat) SetTextAt

func (c *InteractiveStatusChat) SetTextAt(index int, text string)

type InteractiveStopper

type InteractiveStopper interface {
	Stop()
}

type InteractiveSuspendOperations

type InteractiveSuspendOperations struct {
	Platform             string
	SetInterval          func(func(), time.Duration) any
	ClearInterval        func(any)
	OnSignal             func(signal string, handler func()) any
	OnceSignal           func(signal string, handler func()) any
	RemoveSignalListener func(signal string, subscription any)
	KillProcessGroup     func(signal string) error
}

type InteractiveTerminal

type InteractiveTerminal interface {
	SetProgress(active bool)
}

type InteractiveThemeResource

type InteractiveThemeResource struct {
	SourcePath string
	Name       string
	SourceInfo *InteractiveSourceInfo
}

type InteractiveThemeResult

type InteractiveThemeResult struct {
	Success bool
}

type InteractiveThemeSettings

type InteractiveThemeSettings interface {
	GetTheme() string
	SetTheme(theme string)
}

type InteractiveUI

type InteractiveUI interface {
	Start()
	Stop()
	RequestRender(force ...bool)
	Terminal() InteractiveTerminal
}

type KeybindingsConfig

type KeybindingsConfig map[string]any

func DefaultProtocolKeybindings

func DefaultProtocolKeybindings() KeybindingsConfig

type KeybindingsManager

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

func NewKeybindingsManager

func NewKeybindingsManager(agentDir string) *KeybindingsManager

func (*KeybindingsManager) GetEffectiveConfig

func (m *KeybindingsManager) GetEffectiveConfig() KeybindingsConfig

func (*KeybindingsManager) GetUserBindings

func (m *KeybindingsManager) GetUserBindings() KeybindingsConfig

func (*KeybindingsManager) Reload

func (m *KeybindingsManager) Reload()

type LatestGiRelease

type LatestGiRelease = versioncheck.LatestGiRelease

func GetLatestGiRelease

func GetLatestGiRelease(currentVersion string, options VersionCheckOptions) (LatestGiRelease, bool)

type LatestPiRelease

type LatestPiRelease = versioncheck.LatestPiRelease

func GetLatestPiRelease

func GetLatestPiRelease(currentVersion string, options VersionCheckOptions) (LatestPiRelease, bool)

type LoadPromptTemplatesOptions

type LoadPromptTemplatesOptions struct {
	Cwd             string
	AgentDir        string
	PromptPaths     []string
	IncludeDefaults bool
}

type LocalHostProcessExecutor

type LocalHostProcessExecutor struct{}

func (LocalHostProcessExecutor) ExecuteHostProcess

func (LocalHostProcessExecutor) ExecuteHostProcess(command []string, cwd string) (HostProcessResult, error)

func (LocalHostProcessExecutor) ExecuteHostProcessWithOptions

func (LocalHostProcessExecutor) ExecuteHostProcessWithOptions(command []string, cwd string, options HostProcessOptions) (HostProcessResult, error)

type LoginDialogComponent

type LoginDialogComponent struct {
	OnSubmit func(value string)
	OnCancel func()
	// contains filtered or unexported fields
}

func NewLoginDialogComponent

func NewLoginDialogComponent(title, message string) *LoginDialogComponent

func (*LoginDialogComponent) Focused

func (c *LoginDialogComponent) Focused() bool

func (*LoginDialogComponent) HandleInput

func (c *LoginDialogComponent) HandleInput(input string)

func (*LoginDialogComponent) Invalidate

func (c *LoginDialogComponent) Invalidate()

func (*LoginDialogComponent) Render

func (c *LoginDialogComponent) Render(width int) []string

func (*LoginDialogComponent) SetFocused

func (c *LoginDialogComponent) SetFocused(focused bool)

func (*LoginDialogComponent) ShowAuth

func (c *LoginDialogComponent) ShowAuth(url, instructions, manualPrompt string)

func (*LoginDialogComponent) ShowInfo

func (c *LoginDialogComponent) ShowInfo(lines []string)

type LsTool

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

func NewLsTool

func NewLsTool(cwd string) LsTool

func (LsTool) Execute

func (t LsTool) Execute(_ string, input LsToolInput) (FileToolResult, error)

type LsToolInput

type LsToolInput struct {
	Path  string
	Limit int
}

type MigrationResult

type MigrationResult struct {
	MigratedAuthProviders []string
	DeprecationWarnings   []string
}

func RunMigrationsWithResult

func RunMigrationsWithResult(agentDir string, cwd ...string) (MigrationResult, error)

type MissingSessionCwdError

type MissingSessionCwdError = sessioncwd.MissingError

type MissingSessionCwdIssue

type MissingSessionCwdIssue = sessioncwd.MissingIssue

func GetMissingSessionCwdIssue

func GetMissingSessionCwdIssue(sessionManager *SessionManager, fallbackCwd string) *MissingSessionCwdIssue

type Mode

type Mode = internalcli.Mode
const (
	ModeText Mode = internalcli.ModeText
	ModeJSON Mode = internalcli.ModeJSON
	ModeRPC  Mode = internalcli.ModeRPC
)

type ModelCostOverride

type ModelCostOverride struct {
	Input      *float64
	Output     *float64
	CacheRead  *float64
	CacheWrite *float64
}

type ModelOverride

type ModelOverride struct {
	Name             string
	Reasoning        *bool
	ThinkingLevelMap map[string]*string
	Input            []string
	Cost             *ModelCostOverride
	ContextWindow    *int
	MaxTokens        *int
	Headers          map[string]string
	Compat           llm.ModelCompat
}

type ModelPatternOptions

type ModelPatternOptions = modelresolver.ModelPatternOptions

type ModelRegistry

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

func NewInMemoryModelRegistry

func NewInMemoryModelRegistry(authStorage *AuthStorage) *ModelRegistry

func NewModelRegistry

func NewModelRegistry(authStorage *AuthStorage, modelsJSONPath string) *ModelRegistry

func (*ModelRegistry) Find

func (r *ModelRegistry) Find(provider, modelID string) (llm.Model, bool)

func (*ModelRegistry) GetAPIKeyAndHeaders

func (r *ModelRegistry) GetAPIKeyAndHeaders(model llm.Model) ResolvedRequestAuth

func (*ModelRegistry) GetAPIKeyForProvider

func (r *ModelRegistry) GetAPIKeyForProvider(provider string) (string, bool)

func (*ModelRegistry) GetAll

func (r *ModelRegistry) GetAll() []llm.Model

func (*ModelRegistry) GetAvailable

func (r *ModelRegistry) GetAvailable() []llm.Model

func (*ModelRegistry) GetError

func (r *ModelRegistry) GetError() string

func (*ModelRegistry) GetProviderAuthStatus

func (r *ModelRegistry) GetProviderAuthStatus(provider string) AuthStatus

func (*ModelRegistry) GetProviderDisplayName

func (r *ModelRegistry) GetProviderDisplayName(provider string) string

func (*ModelRegistry) HasConfiguredAuth

func (r *ModelRegistry) HasConfiguredAuth(model llm.Model) bool

func (*ModelRegistry) IsUsingOAuth

func (r *ModelRegistry) IsUsingOAuth(model llm.Model) bool

func (*ModelRegistry) Refresh

func (r *ModelRegistry) Refresh()

func (*ModelRegistry) RegisterProvider

func (r *ModelRegistry) RegisterProvider(providerName string, config ProviderConfigInput) error

func (*ModelRegistry) UnregisterProvider

func (r *ModelRegistry) UnregisterProvider(providerName string)

type ModelSelectorCallbacks

type ModelSelectorCallbacks struct {
	OnSelect func(llm.Model)
	OnCancel func()
}

type ModelSelectorComponent

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

func NewInteractiveModelSelectorComponent

func NewInteractiveModelSelectorComponent(config ModelSelectorConfig, callbacks ModelSelectorCallbacks) *ModelSelectorComponent

func NewModelSelectorComponent

func NewModelSelectorComponent(currentModel llm.Model, scopedModels []ScopedModel) *ModelSelectorComponent

func (*ModelSelectorComponent) Focused

func (c *ModelSelectorComponent) Focused() bool

func (*ModelSelectorComponent) HandleInput

func (c *ModelSelectorComponent) HandleInput(data string)

func (*ModelSelectorComponent) Invalidate

func (c *ModelSelectorComponent) Invalidate()

func (*ModelSelectorComponent) Render

func (c *ModelSelectorComponent) Render(width int) []string

func (*ModelSelectorComponent) SetFocused

func (c *ModelSelectorComponent) SetFocused(focused bool)

type ModelSelectorConfig

type ModelSelectorConfig struct {
	CurrentModel  llm.Model
	AllModels     []llm.Model
	ScopedModels  []ScopedModel
	InitialSearch string
	Keybindings   KeybindingsConfig
}

type NewSessionOptions

type NewSessionOptions struct {
	ID            string
	ParentSession string
}

type OAuthProvider

type OAuthProvider struct {
	ID           string
	Name         string
	RefreshToken func(AuthCredential) (AuthCredential, error)
	GetAPIKey    func(AuthCredential) string
}

func GetOAuthProvider

func GetOAuthProvider(providerID string) (OAuthProvider, bool)

func GetOAuthProviders

func GetOAuthProviders() []OAuthProvider

func (OAuthProvider) APIKey

func (p OAuthProvider) APIKey(credential AuthCredential) string

type OAuthSelector

type OAuthSelector struct {
	Mode           string
	AuthStorage    *AuthStorage
	Providers      []AuthSelectorProvider
	StatusResolver AuthStatusResolver
}

func (OAuthSelector) Render

func (s OAuthSelector) Render(width int) []string

type OAuthSelectorComponent

type OAuthSelectorComponent struct {
	OnSelect func(providerID string)
	OnCancel func()
	// contains filtered or unexported fields
}

func NewOAuthSelectorComponent

func NewOAuthSelectorComponent(selector OAuthSelector) *OAuthSelectorComponent

func (*OAuthSelectorComponent) Focused

func (c *OAuthSelectorComponent) Focused() bool

func (*OAuthSelectorComponent) HandleInput

func (c *OAuthSelectorComponent) HandleInput(input string)

func (*OAuthSelectorComponent) Invalidate

func (c *OAuthSelectorComponent) Invalidate()

func (*OAuthSelectorComponent) Render

func (c *OAuthSelectorComponent) Render(width int) []string

func (*OAuthSelectorComponent) SetFocused

func (c *OAuthSelectorComponent) SetFocused(focused bool)

type PackageCommandOptions

type PackageCommandOptions struct {
	CWD string
}

type PackageManagerOperations

type PackageManagerOperations struct {
	RunCommand        func(command string, args []string, options PackageCommandOptions) error
	RunCommandCapture func(command string, args []string, options PackageCommandOptions) (string, error)
}

type PackageManagerOptions

type PackageManagerOptions struct {
	CWD             string
	AgentDir        string
	SettingsManager *SettingsManager
	Operations      PackageManagerOperations
	Progress        func(PackageProgressEvent)
}

type PackageProgressEvent

type PackageProgressEvent struct {
	Type   string
	Action string
	Source string
	Error  string
}

type PackageResourceConfigOptions

type PackageResourceConfigOptions struct {
	CWD      string
	AgentDir string
	Terminal gitui.Terminal
}

type PackageResourceToggle

type PackageResourceToggle struct {
	Source       string
	Scope        string
	ResourceType string
	Pattern      string
	Enabled      bool
}

type PackageResourceToggleItem

type PackageResourceToggleItem struct {
	Source       string
	Scope        string
	ResourceType string
	Pattern      string
	Path         string
	DisplayName  string
	Enabled      bool
	Metadata     ProtocolSourceInfo
}

type PackageSource

type PackageSource struct {
	Type   string
	Source string
	Repo   string
	Host   string
	Path   string
	Ref    string
	Pinned bool
}

func ParsePackageSource

func ParsePackageSource(source string) PackageSource

type PackageUpdate

type PackageUpdate struct {
	Source      string
	DisplayName string
	Type        string
	Scope       string
}

type PackageUpdateChecker

type PackageUpdateChecker func() ([]string, error)

type PackageUpdateSuggestionError

type PackageUpdateSuggestionError struct {
	Input      string
	Suggestion string
}

func (PackageUpdateSuggestionError) Error

type ParsedModelResult

type ParsedModelResult = modelresolver.ParsedModelResult

func ParseModelPattern

func ParseModelPattern(pattern string, availableModels []llm.Model, options ...ModelPatternOptions) ParsedModelResult

type PlanTodoItem

type PlanTodoItem = planmode.PlanTodoItem

func ExtractPlanTodoItems

func ExtractPlanTodoItems(message string) []PlanTodoItem

type PrintModeOptions

type PrintModeOptions struct {
	Mode           string
	InitialMessage string
	InitialImages  []llm.ContentPart
	Messages       []string
	Stdout         io.Writer
	Stderr         io.Writer
}

type PrintModePromptOptions

type PrintModePromptOptions struct {
	Images []llm.ContentPart
}

type PrintModeRuntimeHost

type PrintModeRuntimeHost interface {
	PrintModeSession() PrintModeSession
	Dispose() error
}

type PrintModeSession

type PrintModeSession interface {
	Prompt(message string, options PrintModePromptOptions) error
	WaitForIdle() error
	Messages() []llm.Message
}

type ProcessFileArgumentsOptions

type ProcessFileArgumentsOptions struct {
	CWD              string
	AutoResizeImages *bool
	ResizeImage      func(part llm.ContentPart, options ImageResizeOptions) *ResizedImage
}

type ProcessedFileArguments

type ProcessedFileArguments struct {
	Text   string
	Images []llm.ContentPart
}

func ProcessFileArguments

func ProcessFileArguments(paths []string, options ...ProcessFileArgumentsOptions) (ProcessedFileArguments, error)

type PromptTemplate

type PromptTemplate struct {
	Name         string
	Description  string
	ArgumentHint string
	Content      string
	SourceInfo   SourceInfo
	FilePath     string
}

func LoadPromptTemplates

func LoadPromptTemplates(options LoadPromptTemplatesOptions) []PromptTemplate

type ProtocolAbortSignal

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

func NewProtocolAbortSignal

func NewProtocolAbortSignal(done <-chan struct{}) *ProtocolAbortSignal

func (*ProtocolAbortSignal) Aborted

func (s *ProtocolAbortSignal) Aborted() bool

func (*ProtocolAbortSignal) Done

func (s *ProtocolAbortSignal) Done() <-chan struct{}

type ProtocolAutocompleteItem

type ProtocolAutocompleteItem struct {
	ID          string
	Value       string
	Label       string
	Description string
	Kind        string
	Range       *ProtocolAutocompleteRange
	Detail      *ViewTreeNode
}

type ProtocolAutocompleteProviderDefinition

type ProtocolAutocompleteProviderDefinition struct {
	Description string
	Priority    int
	Handler     func(context.Context, ProtocolAutocompleteRequest) (ProtocolAutocompleteResult, error)
}

type ProtocolAutocompleteProviderRegistration

type ProtocolAutocompleteProviderRegistration struct {
	ID          string
	Description string
	Priority    int
	SourceInfo  ProtocolSourceInfo
	Handler     func(context.Context, ProtocolAutocompleteRequest) (ProtocolAutocompleteResult, error)
}

type ProtocolAutocompleteRange

type ProtocolAutocompleteRange struct {
	StartLine int
	StartCol  int
	EndLine   int
	EndCol    int
}

type ProtocolAutocompleteRequest

type ProtocolAutocompleteRequest struct {
	Text          string
	Lines         []string
	CursorLine    int
	CursorCol     int
	Force         bool
	Trigger       string
	SlashCommand  string
	ArgumentIndex int
}

type ProtocolAutocompleteResult

type ProtocolAutocompleteResult struct {
	Items  []ProtocolAutocompleteItem
	Prefix string
	Start  int
	End    int
}

type ProtocolCommandContext

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

func (ProtocolCommandContext) Fork

func (ProtocolCommandContext) NewSession

func (ProtocolCommandContext) Reload

func (c ProtocolCommandContext) Reload() error

func (ProtocolCommandContext) SendUserMessage

func (c ProtocolCommandContext) SendUserMessage(text string, options ...ProtocolSendUserMessageOptions) error

func (ProtocolCommandContext) SwitchSession

type ProtocolCommandContextActions

type ProtocolCommandContextActions struct {
	Fork          func(entryID string, options ProtocolForkOptions) (ProtocolCommandForkResult, error)
	NewSession    func(options ProtocolNewSessionOptions) (ProtocolCommandSwitchResult, error)
	SwitchSession func(sessionFile string, options ProtocolSwitchSessionOptions) (ProtocolCommandSwitchResult, error)
	Reload        func() error
}

type ProtocolCommandDefinition

type ProtocolCommandDefinition struct {
	Description        string
	ArgumentHint       string
	Handler            func(args string) error
	HandlerWithContext func(args string, ctx ProtocolCommandContext) error
}

type ProtocolCommandForkResult

type ProtocolCommandForkResult struct {
	Cancelled bool
}

type ProtocolCommandRegistration

type ProtocolCommandRegistration struct {
	Name               string
	InvocationName     string
	Description        string
	ArgumentHint       string
	SourceInfo         ProtocolSourceInfo
	Handler            func(args string) error
	HandlerWithContext func(args string, ctx ProtocolCommandContext) error
}

type ProtocolCommandSwitchResult

type ProtocolCommandSwitchResult struct {
	Cancelled bool
}

type ProtocolCustomMessage

type ProtocolCustomMessage struct {
	CustomType string
	Content    any
	Display    bool
	Details    any
}

type ProtocolErrorListener

type ProtocolErrorListener func(ProtocolExtensionError)

type ProtocolEventHandler

type ProtocolEventHandler func(ProtocolSessionEvent) (ProtocolEventResult, error)

type ProtocolEventResult

type ProtocolEventResult struct {
	Cancel            bool
	Block             bool
	Reason            string
	Compaction        *agentharness.CompactionResult
	Messages          []llm.Message
	MessagesSet       bool
	Message           *llm.Message
	MessageSet        bool
	CustomMessages    []ProtocolCustomMessage
	CustomMessagesSet bool
	SystemPrompt      string
	SystemPromptSet   bool
	Content           []SDKContentPart
	ContentSet        bool
	Details           any
	DetailsSet        bool
	IsError           bool
	IsErrorSet        bool
	BashResult        *BashResult
	BashResultSet     bool
	Payload           any
	PayloadSet        bool
	Resources         ResourceExtension
	ResourcesSet      bool
}

type ProtocolExtensionContext

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

func (*ProtocolExtensionContext) GetFlag

func (c *ProtocolExtensionContext) GetFlag(name string) any

func (*ProtocolExtensionContext) GetSystemPrompt

func (c *ProtocolExtensionContext) GetSystemPrompt() string

func (*ProtocolExtensionContext) MountViewTree

func (c *ProtocolExtensionContext) MountViewTree(mountID, slot string, view ViewTreeNode, options ...ViewTreeMountOptions) error

func (*ProtocolExtensionContext) On

func (c *ProtocolExtensionContext) On(eventType string, handler ProtocolEventHandler) error

func (*ProtocolExtensionContext) OnInput

func (*ProtocolExtensionContext) RegisterAutocompleteProvider

func (c *ProtocolExtensionContext) RegisterAutocompleteProvider(id string, definition ProtocolAutocompleteProviderDefinition) error

func (*ProtocolExtensionContext) RegisterCommand

func (c *ProtocolExtensionContext) RegisterCommand(name string, definition ProtocolCommandDefinition) error

func (*ProtocolExtensionContext) RegisterFlag

func (c *ProtocolExtensionContext) RegisterFlag(name string, definition ProtocolFlagDefinition) error

func (*ProtocolExtensionContext) RegisterMessageRenderer

func (c *ProtocolExtensionContext) RegisterMessageRenderer(customType string, renderer ProtocolMessageRenderer) error

func (*ProtocolExtensionContext) RegisterProvider

func (c *ProtocolExtensionContext) RegisterProvider(provider string, override ProtocolProviderOverride) error

func (*ProtocolExtensionContext) RegisterShortcut

func (c *ProtocolExtensionContext) RegisterShortcut(key string, definition ProtocolShortcutDefinition) error

func (*ProtocolExtensionContext) RegisterTool

func (c *ProtocolExtensionContext) RegisterTool(definition ProtocolToolDefinition) error

func (*ProtocolExtensionContext) RegisterToolRenderer

func (c *ProtocolExtensionContext) RegisterToolRenderer(toolName string, definition ProtocolToolRendererDefinition) error

func (*ProtocolExtensionContext) SendCustomMessage

func (*ProtocolExtensionContext) SendUserMessage

func (c *ProtocolExtensionContext) SendUserMessage(text string, options ProtocolSendUserMessageOptions) error

func (*ProtocolExtensionContext) SetSessionName

func (c *ProtocolExtensionContext) SetSessionName(name string) error

func (*ProtocolExtensionContext) Signal

func (*ProtocolExtensionContext) UnregisterProvider

func (c *ProtocolExtensionContext) UnregisterProvider(provider string) error

type ProtocolExtensionDiscoveryError

type ProtocolExtensionDiscoveryError struct {
	Path  string
	Error string
}

type ProtocolExtensionDiscoveryResult

type ProtocolExtensionDiscoveryResult struct {
	Extensions []ProtocolExtensionSource
	Errors     []ProtocolExtensionDiscoveryError
}

func DiscoverProtocolExtensions

func DiscoverProtocolExtensions(explicitPaths []string, cwd, agentDir string) ProtocolExtensionDiscoveryResult

func LoadProtocolExtensionSources

func LoadProtocolExtensionSources(paths []string, cwd string) ProtocolExtensionDiscoveryResult

type ProtocolExtensionError

type ProtocolExtensionError struct {
	ExtensionPath string
	Event         string
	Error         string
	Stack         string
}

type ProtocolExtensionFactory

type ProtocolExtensionFactory struct {
	Path    string
	Factory func(*ProtocolExtensionContext) error
}

type ProtocolExtensionFlagDiagnostic

type ProtocolExtensionFlagDiagnostic struct {
	Name    string
	Message string
}

type ProtocolExtensionProcess

type ProtocolExtensionProcess struct {
	Spec ProtocolPackageProcessExtension
	// contains filtered or unexported fields
}

func (*ProtocolExtensionProcess) EmitEvent

func (p *ProtocolExtensionProcess) EmitEvent(method string, params map[string]any) error

func (*ProtocolExtensionProcess) RequestEvent

func (p *ProtocolExtensionProcess) RequestEvent(ctx context.Context, method string, params any) (json.RawMessage, error)

func (*ProtocolExtensionProcess) Start

func (*ProtocolExtensionProcess) Stop

type ProtocolExtensionProcessSupervisor

type ProtocolExtensionProcessSupervisor struct {
	Host            *RPCSessionHost
	StartTimeout    time.Duration
	ShutdownTimeout time.Duration
	// contains filtered or unexported fields
}

func (*ProtocolExtensionProcessSupervisor) BindSession

func (s *ProtocolExtensionProcessSupervisor) BindSession(session *AgentSession)

func (*ProtocolExtensionProcessSupervisor) DiscoverResources

func (s *ProtocolExtensionProcessSupervisor) DiscoverResources(ctx context.Context, reason, cwd string) (ResourceExtension, error)

func (*ProtocolExtensionProcessSupervisor) EmitEvent

func (s *ProtocolExtensionProcessSupervisor) EmitEvent(method string, params map[string]any) error

func (*ProtocolExtensionProcessSupervisor) EmitSessionEvent

func (*ProtocolExtensionProcessSupervisor) EmitTerminalInput

func (s *ProtocolExtensionProcessSupervisor) EmitTerminalInput(data string) error

func (*ProtocolExtensionProcessSupervisor) EmitUserBash

func (s *ProtocolExtensionProcessSupervisor) EmitUserBash(ctx context.Context, params map[string]any) (*BashResult, bool, error)

func (*ProtocolExtensionProcessSupervisor) Processes

func (*ProtocolExtensionProcessSupervisor) Start

func (*ProtocolExtensionProcessSupervisor) Stop

type ProtocolExtensionRuntime

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

func NewDefaultProtocolExtensionRuntime

func NewDefaultProtocolExtensionRuntime() *ProtocolExtensionRuntime

func NewProtocolExtensionRuntime

func NewProtocolExtensionRuntime(capabilities ...string) *ProtocolExtensionRuntime

func (*ProtocolExtensionRuntime) ActiveToolNames

func (r *ProtocolExtensionRuntime) ActiveToolNames() []string

func (*ProtocolExtensionRuntime) AppendCustomEntry

func (r *ProtocolExtensionRuntime) AppendCustomEntry(customType string, data any) (string, error)

func (*ProtocolExtensionRuntime) ApplyToSession

func (r *ProtocolExtensionRuntime) ApplyToSession(session *AgentSession)

func (*ProtocolExtensionRuntime) AutocompleteProviders

func (*ProtocolExtensionRuntime) BindCommandContext

func (r *ProtocolExtensionRuntime) BindCommandContext(actions ProtocolCommandContextActions)

func (*ProtocolExtensionRuntime) BindHostActionHost

func (r *ProtocolExtensionRuntime) BindHostActionHost(host *RPCSessionHost)

func (*ProtocolExtensionRuntime) BindModelRegistry

func (r *ProtocolExtensionRuntime) BindModelRegistry(registry *ModelRegistry)

func (*ProtocolExtensionRuntime) BindSession

func (r *ProtocolExtensionRuntime) BindSession(session *AgentSession)

func (*ProtocolExtensionRuntime) BindViewTreeHost

func (r *ProtocolExtensionRuntime) BindViewTreeHost(host *ViewTreeHost)

func (*ProtocolExtensionRuntime) CommandInvocationNames

func (r *ProtocolExtensionRuntime) CommandInvocationNames() []string

func (*ProtocolExtensionRuntime) CreateCommandContext

func (r *ProtocolExtensionRuntime) CreateCommandContext() ProtocolCommandContext

func (*ProtocolExtensionRuntime) EmitInput

func (r *ProtocolExtensionRuntime) EmitInput(text string, images []llm.ContentPart, source string) ProtocolInputResult

func (*ProtocolExtensionRuntime) EmitSessionEvent

func (*ProtocolExtensionRuntime) FlagDiagnostics

func (*ProtocolExtensionRuntime) FlagValue

func (r *ProtocolExtensionRuntime) FlagValue(name string) any

func (*ProtocolExtensionRuntime) Flags

func (*ProtocolExtensionRuntime) GetCommand

func (r *ProtocolExtensionRuntime) GetCommand(invocationName string) *ProtocolCommandRegistration

func (*ProtocolExtensionRuntime) GetMessageRenderer

func (r *ProtocolExtensionRuntime) GetMessageRenderer(customType string) ProtocolMessageRenderer

func (*ProtocolExtensionRuntime) GetRegisteredToolDefinition

func (r *ProtocolExtensionRuntime) GetRegisteredToolDefinition(toolName string) ToolDefinition

func (*ProtocolExtensionRuntime) GetSystemPrompt

func (r *ProtocolExtensionRuntime) GetSystemPrompt() string

func (*ProtocolExtensionRuntime) GetToolRenderer

func (*ProtocolExtensionRuntime) HasHandlers

func (r *ProtocolExtensionRuntime) HasHandlers(eventType string) bool

func (*ProtocolExtensionRuntime) InvalidateCommandContexts

func (r *ProtocolExtensionRuntime) InvalidateCommandContexts()

func (*ProtocolExtensionRuntime) LoadFactories

func (r *ProtocolExtensionRuntime) LoadFactories(factories []ProtocolExtensionFactory) error

func (*ProtocolExtensionRuntime) OnAutocompleteProvidersChanged

func (r *ProtocolExtensionRuntime) OnAutocompleteProvidersChanged(callback func()) func()

func (*ProtocolExtensionRuntime) OnCommandsChanged

func (r *ProtocolExtensionRuntime) OnCommandsChanged(callback func()) func()

func (*ProtocolExtensionRuntime) OnError

func (r *ProtocolExtensionRuntime) OnError(listener ProtocolErrorListener) func()

func (*ProtocolExtensionRuntime) OnMessageRenderersChanged

func (r *ProtocolExtensionRuntime) OnMessageRenderersChanged(callback func()) func()

func (*ProtocolExtensionRuntime) PendingProviderRegistrations

func (r *ProtocolExtensionRuntime) PendingProviderRegistrations() []ProtocolProviderRegistration

func (*ProtocolExtensionRuntime) RegisteredCommands

func (r *ProtocolExtensionRuntime) RegisteredCommands() []ProtocolCommandRegistration

func (*ProtocolExtensionRuntime) RegisteredTools

func (r *ProtocolExtensionRuntime) RegisteredTools() []SDKTool

func (*ProtocolExtensionRuntime) RemoveSource

func (r *ProtocolExtensionRuntime) RemoveSource(source ProtocolSourceInfo)

func (*ProtocolExtensionRuntime) SendCustomMessage

func (*ProtocolExtensionRuntime) SendUserMessage

func (r *ProtocolExtensionRuntime) SendUserMessage(text string, options ProtocolSendUserMessageOptions) error

func (*ProtocolExtensionRuntime) SessionEntries

func (r *ProtocolExtensionRuntime) SessionEntries() []FileEntry

func (*ProtocolExtensionRuntime) SetAbortSignal

func (r *ProtocolExtensionRuntime) SetAbortSignal(done <-chan struct{})

func (*ProtocolExtensionRuntime) SetCLIFlagValues

func (r *ProtocolExtensionRuntime) SetCLIFlagValues(values map[string]any) []ProtocolExtensionFlagDiagnostic

func (*ProtocolExtensionRuntime) SetFlagValue

func (r *ProtocolExtensionRuntime) SetFlagValue(name string, value any)

func (*ProtocolExtensionRuntime) SetSessionName

func (r *ProtocolExtensionRuntime) SetSessionName(name string) error

func (*ProtocolExtensionRuntime) Shortcuts

func (*ProtocolExtensionRuntime) SuggestAutocomplete

func (*ProtocolExtensionRuntime) UnknownCLIFlagDiagnostics

func (r *ProtocolExtensionRuntime) UnknownCLIFlagDiagnostics() []ProtocolExtensionFlagDiagnostic

func (*ProtocolExtensionRuntime) ViewTreeMounts

type ProtocolExtensionSource

type ProtocolExtensionSource struct {
	Path     string
	BaseDir  string
	Metadata ProtocolSourceInfo
}

type ProtocolFlagDefinition

type ProtocolFlagDefinition struct {
	Description string
	Type        string
	Default     any
}

type ProtocolFlagRegistration

type ProtocolFlagRegistration struct {
	Name        string
	Description string
	Type        string
	Default     any
	SourceInfo  ProtocolSourceInfo
}

type ProtocolForkOptions

type ProtocolForkOptions struct {
	Position    string
	WithSession func(ProtocolCommandContext) error
}

type ProtocolInputEvent

type ProtocolInputEvent struct {
	Type   string
	Text   string
	Images []llm.ContentPart
	Source string
}

type ProtocolInputHandler

type ProtocolInputHandler func(ProtocolInputEvent) (ProtocolInputResult, error)

type ProtocolInputResult

type ProtocolInputResult struct {
	Action    string
	Text      string
	Images    []llm.ContentPart
	ImagesSet bool
}

func ProtocolInputContinue

func ProtocolInputContinue() ProtocolInputResult

func ProtocolInputHandled

func ProtocolInputHandled() ProtocolInputResult

func ProtocolInputTransform

func ProtocolInputTransform(text string) ProtocolInputResult

func ProtocolInputTransformWithImages

func ProtocolInputTransformWithImages(text string, images []llm.ContentPart) ProtocolInputResult

type ProtocolMessageRenderer

type ProtocolMessageRenderer func(message any, options any) []string

type ProtocolMessageRendererRegistration

type ProtocolMessageRendererRegistration struct {
	CustomType string
	SourceInfo ProtocolSourceInfo
	Renderer   ProtocolMessageRenderer
}

type ProtocolNewSessionOptions

type ProtocolNewSessionOptions struct {
	ParentSession string
	WithSession   func(ProtocolCommandContext) error
}

type ProtocolPackageProcessExtension

type ProtocolPackageProcessExtension struct {
	ID           string
	Path         string
	PackageDir   string
	Command      []string
	Transport    string
	Protocol     string
	Capabilities []string
	Env          map[string]string
	Metadata     ProtocolSourceInfo
}

type ProtocolPackageResource

type ProtocolPackageResource struct {
	Path     string
	Enabled  bool
	Metadata ProtocolSourceInfo
}

type ProtocolPackageResourceFilters

type ProtocolPackageResourceFilters struct {
	Extensions []string
	Skills     []string
	Prompts    []string
	Themes     []string
}

type ProtocolPackageResources

type ProtocolPackageResources struct {
	Extensions        []ProtocolPackageResource
	ProcessExtensions []ProtocolPackageProcessExtension
	Skills            []ProtocolPackageResource
	Prompts           []ProtocolPackageResource
	Themes            []ProtocolPackageResource
}

type ProtocolPackageSourceSpec

type ProtocolPackageSourceSpec struct {
	Source  string
	Scope   string
	Filters ProtocolPackageResourceFilters
}

type ProtocolProviderOverride

type ProtocolProviderOverride struct {
	BaseURL        string
	APIKey         string
	API            string
	Headers        map[string]string
	AuthHeader     bool
	Compat         llm.ModelCompat
	Models         []ProviderModelDefinition
	ModelOverrides map[string]ModelOverride
	StreamSimple   func(llm.Model, llm.Context, llm.SimpleStreamOptions) (*llm.AssistantMessageEventStream, error)
}

type ProtocolProviderRegistration

type ProtocolProviderRegistration struct {
	Name       string
	Config     ProtocolProviderOverride
	SourceInfo ProtocolSourceInfo
}

type ProtocolRuntimeError

type ProtocolRuntimeError struct {
	Code    string
	Message string
}

func (ProtocolRuntimeError) Error

func (e ProtocolRuntimeError) Error() string

type ProtocolSendCustomMessageOptions

type ProtocolSendCustomMessageOptions struct {
	TriggerTurn bool
	DeliverAs   string
}

type ProtocolSendUserMessageOptions

type ProtocolSendUserMessageOptions struct {
	DeliverAs string
}

type ProtocolSessionEvent

type ProtocolSessionEvent struct {
	Context               context.Context
	Type                  string
	Reason                string
	TargetSessionFile     string
	PreviousSessionFile   string
	Prompt                string
	Images                []llm.ContentPart
	SystemPrompt          string
	Messages              []llm.Message
	Message               *llm.Message
	AssistantMessageEvent *llm.AssistantMessageEvent
	EntryID               string
	Position              string
	Role                  string
	Model                 *llm.Model
	PreviousModel         *llm.Model
	SelectSource          string
	ThinkingLevel         string
	PreviousLevel         string
	ToolName              string
	ToolCallID            string
	Input                 map[string]any
	Content               []SDKContentPart
	Details               any
	IsError               bool
	Source                string
	Text                  string
	Command               string
	CWD                   string
	ExcludeFromContext    bool
	Steering              []string
	FollowUp              []string
	Preparation           *agentharness.CompactionPreparation
	BranchEntries         []FileEntry
	CompactionEntry       *FileEntry
	FromExtension         bool
	Name                  string
	Payload               any
	Status                int
	Headers               map[string]string
}

type ProtocolShortcutDefinition

type ProtocolShortcutDefinition struct {
	Description string
	Handler     func() error
}

type ProtocolShortcutRegistration

type ProtocolShortcutRegistration struct {
	Key         string
	Description string
	SourceInfo  ProtocolSourceInfo
	Handler     func() error
}

type ProtocolShortcutWarning

type ProtocolShortcutWarning struct {
	Key     string
	Message string
}

type ProtocolShortcutsResult

type ProtocolShortcutsResult struct {
	Shortcuts map[string]ProtocolShortcutRegistration
	Warnings  []ProtocolShortcutWarning
}

type ProtocolSourceInfo

type ProtocolSourceInfo struct {
	Path   string `json:"path,omitempty"`
	Source string `json:"source,omitempty"`
	Scope  string `json:"scope,omitempty"`
	Origin string `json:"origin,omitempty"`
}

type ProtocolSwitchSessionOptions

type ProtocolSwitchSessionOptions struct {
	WithSession func(ProtocolCommandContext) error
}

type ProtocolToolDefinition

type ProtocolToolDefinition struct {
	Name               string
	Label              string
	Description        string
	Parameters         llm.Schema
	PromptSnippet      string
	PromptGuidelines   []string
	ExecutionMode      string
	PrepareArguments   func(input map[string]any) map[string]any
	Execute            func(toolCallID string, input map[string]any) (SDKToolResult, error)
	ExecuteWithUpdates func(toolCallID string, input map[string]any, onUpdate func(SDKToolResult)) (SDKToolResult, error)
}

type ProtocolToolRendererDefinition

type ProtocolToolRendererDefinition struct {
	RenderCall   ToolCallRenderer
	RenderResult ToolResultRenderer
}

type ProtocolToolRendererRegistration

type ProtocolToolRendererRegistration struct {
	Name         string
	SourceInfo   ProtocolSourceInfo
	RenderCall   ToolCallRenderer
	RenderResult ToolResultRenderer
}

type ProtocolViewTreeMountRegistration

type ProtocolViewTreeMountRegistration struct {
	MountID    string
	Slot       string
	View       ViewTreeNode
	Priority   int
	Overlay    *ViewTreeOverlayOptions
	SourceInfo ProtocolSourceInfo
}

type ProviderConfigInput

type ProviderConfigInput struct {
	Name           string
	BaseURL        string
	APIKey         string
	API            string
	Headers        map[string]string
	AuthHeader     bool
	OAuth          *OAuthProvider                                                                                  `json:"-"`
	StreamSimple   func(llm.Model, llm.Context, llm.SimpleStreamOptions) (*llm.AssistantMessageEventStream, error) `json:"-"`
	Compat         llm.ModelCompat
	Models         []ProviderModelDefinition
	ModelOverrides map[string]ModelOverride
}

type ProviderModelDefinition

type ProviderModelDefinition struct {
	ID               string
	Name             string
	API              string
	BaseURL          string
	Reasoning        bool
	ThinkingLevelMap map[string]*string
	Input            []string
	Cost             llm.ModelCost
	ContextWindow    int
	MaxTokens        int
	Headers          map[string]string
	Compat           llm.ModelCompat
}

type ProviderRequestConfig

type ProviderRequestConfig struct {
	APIKey     string
	Headers    map[string]string
	AuthHeader bool
}

type ProviderRetrySettings

type ProviderRetrySettings struct {
	TimeoutMS       int
	MaxRetries      int
	MaxRetryDelayMS int
}

type QueuedCustomMessage

type QueuedCustomMessage struct {
	CustomType string `json:"customType"`
	Content    any    `json:"content,omitempty"`
	Display    bool   `json:"display,omitempty"`
	Details    any    `json:"details,omitempty"`
}

type QueuedUserMessage

type QueuedUserMessage struct {
	Text   string               `json:"text"`
	Images []llm.ContentPart    `json:"images,omitempty"`
	Custom *QueuedCustomMessage `json:"custom,omitempty"`
}

type RPCAvailableModelsResult

type RPCAvailableModelsResult struct {
	Models []llm.Model `json:"models"`
}

type RPCClient

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

func NewRPCClient

func NewRPCClient(sender RPCCommandSender) *RPCClient

func (*RPCClient) Abort

func (c *RPCClient) Abort(ctx context.Context) error

func (*RPCClient) AbortBash

func (c *RPCClient) AbortBash(ctx context.Context) error

func (*RPCClient) AbortRetry

func (c *RPCClient) AbortRetry(ctx context.Context) error

func (*RPCClient) Bash

func (c *RPCClient) Bash(ctx context.Context, command string) (BashResult, error)

func (*RPCClient) Clone

func (c *RPCClient) Clone(ctx context.Context) (RPCCloneResult, error)

func (*RPCClient) Compact

func (c *RPCClient) Compact(ctx context.Context, customInstructions string) (agentharness.CompactionResult, error)

func (*RPCClient) CycleModel

func (c *RPCClient) CycleModel(ctx context.Context) (*RPCCycleModelResult, error)

func (*RPCClient) CycleThinkingLevel

func (c *RPCClient) CycleThinkingLevel(ctx context.Context) (*RPCThinkingLevelResult, error)

func (*RPCClient) ExportHTML

func (c *RPCClient) ExportHTML(ctx context.Context, outputPath string) (RPCExportHTMLResult, error)

func (*RPCClient) FollowUp

func (c *RPCClient) FollowUp(ctx context.Context, message string) error

func (*RPCClient) FollowUpWithImages

func (c *RPCClient) FollowUpWithImages(ctx context.Context, message string, images []llm.ContentPart) error

func (*RPCClient) Fork

func (c *RPCClient) Fork(ctx context.Context, entryID string) (RPCForkResult, error)

func (*RPCClient) GetAvailableModels

func (c *RPCClient) GetAvailableModels(ctx context.Context) ([]llm.Model, error)

func (*RPCClient) GetCommands

func (c *RPCClient) GetCommands(ctx context.Context) ([]RPCSlashCommand, error)

func (*RPCClient) GetForkMessages

func (c *RPCClient) GetForkMessages(ctx context.Context) ([]AgentSessionForkMessage, error)

func (*RPCClient) GetLastAssistantText

func (c *RPCClient) GetLastAssistantText(ctx context.Context) (*string, error)

func (*RPCClient) GetMessages

func (c *RPCClient) GetMessages(ctx context.Context) ([]llm.Message, error)

func (*RPCClient) GetSessionStats

func (c *RPCClient) GetSessionStats(ctx context.Context) (RPCSessionStats, error)

func (*RPCClient) GetState

func (c *RPCClient) GetState(ctx context.Context) (RPCSessionState, error)

func (*RPCClient) NewSession

func (c *RPCClient) NewSession(ctx context.Context, parentSession string) (RPCCloneResult, error)

func (*RPCClient) Prompt

func (c *RPCClient) Prompt(ctx context.Context, message string) error

func (*RPCClient) PromptWithImages

func (c *RPCClient) PromptWithImages(ctx context.Context, message string, images []llm.ContentPart) error

func (*RPCClient) SetAutoCompaction

func (c *RPCClient) SetAutoCompaction(ctx context.Context, enabled bool) error

func (*RPCClient) SetAutoRetry

func (c *RPCClient) SetAutoRetry(ctx context.Context, enabled bool) error

func (*RPCClient) SetFollowUpMode

func (c *RPCClient) SetFollowUpMode(ctx context.Context, mode string) error

func (*RPCClient) SetModel

func (c *RPCClient) SetModel(ctx context.Context, provider, modelID string) (llm.Model, error)

func (*RPCClient) SetSessionName

func (c *RPCClient) SetSessionName(ctx context.Context, name string) error

func (*RPCClient) SetSteeringMode

func (c *RPCClient) SetSteeringMode(ctx context.Context, mode string) error

func (*RPCClient) SetThinkingLevel

func (c *RPCClient) SetThinkingLevel(ctx context.Context, level string) error

func (*RPCClient) Steer

func (c *RPCClient) Steer(ctx context.Context, message string) error

func (*RPCClient) SteerWithImages

func (c *RPCClient) SteerWithImages(ctx context.Context, message string, images []llm.ContentPart) error

func (*RPCClient) SwitchSession

func (c *RPCClient) SwitchSession(ctx context.Context, sessionPath string) (RPCCloneResult, error)

type RPCCloneResult

type RPCCloneResult struct {
	Cancelled bool `json:"cancelled"`
}

type RPCCommand

type RPCCommand struct {
	ID                 string            `json:"id,omitempty"`
	Type               string            `json:"type"`
	Message            string            `json:"message,omitempty"`
	StreamingBehavior  string            `json:"streamingBehavior,omitempty"`
	Provider           string            `json:"provider,omitempty"`
	ModelID            string            `json:"modelId,omitempty"`
	Level              string            `json:"level,omitempty"`
	Mode               string            `json:"mode,omitempty"`
	CustomInstructions string            `json:"customInstructions,omitempty"`
	Enabled            *bool             `json:"enabled,omitempty"`
	Command            string            `json:"command,omitempty"`
	Images             []llm.ContentPart `json:"images,omitempty"`
	OutputPath         string            `json:"outputPath,omitempty"`
	SessionPath        string            `json:"sessionPath,omitempty"`
	EntryID            string            `json:"entryId,omitempty"`
	Name               string            `json:"name,omitempty"`
	ParentSession      string            `json:"parentSession,omitempty"`
}

type RPCCommandSender

type RPCCommandSender interface {
	SendRPCCommand(context.Context, RPCCommand) (RPCResponse, error)
}

type RPCCommandSenderFunc

type RPCCommandSenderFunc func(context.Context, RPCCommand) (RPCResponse, error)

func (RPCCommandSenderFunc) SendRPCCommand

func (f RPCCommandSenderFunc) SendRPCCommand(ctx context.Context, command RPCCommand) (RPCResponse, error)

type RPCCommandsResult

type RPCCommandsResult struct {
	Commands []RPCSlashCommand `json:"commands"`
}

type RPCCycleModelResult

type RPCCycleModelResult struct {
	Model         llm.Model `json:"model"`
	ThinkingLevel string    `json:"thinkingLevel"`
	IsScoped      bool      `json:"isScoped"`
}

type RPCExportHTMLResult

type RPCExportHTMLResult struct {
	Path string `json:"path"`
}

type RPCForkMessagesResult

type RPCForkMessagesResult struct {
	Messages []AgentSessionForkMessage `json:"messages"`
}

type RPCForkResult

type RPCForkResult struct {
	Text      string `json:"text"`
	Cancelled bool   `json:"cancelled"`
}

type RPCLastAssistantTextResult

type RPCLastAssistantTextResult struct {
	Text *string `json:"text"`
}

type RPCLineProcessor

type RPCLineProcessor struct {
	Host                *RPCSessionHost
	Runtime             *ProtocolExtensionRuntime
	SourceInfo          ProtocolSourceInfo
	WriteLine           func(string)
	OnBeforeHostAction  func(HostActionRequest)
	OnHostAction        func(HostActionRequest, HostActionResponse)
	AllowedCapabilities []string
	EnforceCapabilities bool
	RequestTimeout      time.Duration
	// contains filtered or unexported fields
}

func (*RPCLineProcessor) HandleLine

func (p *RPCLineProcessor) HandleLine(ctx context.Context, line string)

func (*RPCLineProcessor) WriteEvent

func (p *RPCLineProcessor) WriteEvent(event AgentSessionEvent)

type RPCMessagesResult

type RPCMessagesResult struct {
	Messages []llm.Message `json:"messages"`
}

type RPCResponse

type RPCResponse struct {
	ID      string          `json:"id,omitempty"`
	Type    string          `json:"type"`
	Command string          `json:"command"`
	Success bool            `json:"success"`
	Error   string          `json:"error,omitempty"`
	Data    json.RawMessage `json:"data,omitempty"`
}

type RPCScopedModel

type RPCScopedModel struct {
	Model         llm.Model
	ThinkingLevel string
}

type RPCSessionHost

type RPCSessionHost struct {
	Session               *AgentSession
	Settings              *SettingsManager
	SteeringMode          string
	FollowUpMode          string
	AutoCompactionEnabled bool
	AvailableModels       []llm.Model
	ScopedModels          []RPCScopedModel
	ProviderAuthStatus    AuthStatusResolver
	PromptPreflight       func(RPCCommand) error
	ViewTreeHost          *ViewTreeHost
	TUIEditor             TUIEditorHost
	TUIDialog             TUIDialogHost
	TUITitle              TUITitleHost
	TUIWorking            TUIWorkingHost
	TUIThinkingLabel      TUIThinkingLabelHost
	TUIStatus             TUIStatusHost
	TUITheme              TUIThemeHost
	TUIToolExpansion      TUIToolExpansionHost
	ProcessExecutor       HostProcessExecutor
	PolicyRequester       HostPolicyRequester
	ReloadSession         func() error
	// contains filtered or unexported fields
}

func NewRPCSessionHost

func NewRPCSessionHost(session *AgentSession) *RPCSessionHost

func (*RPCSessionHost) AcceptPrompt

func (h *RPCSessionHost) AcceptPrompt(command RPCCommand) error

func (*RPCSessionHost) Bash

func (h *RPCSessionHost) Bash(ctx context.Context, command string) (BashResult, error)

func (*RPCSessionHost) Clone

func (h *RPCSessionHost) Clone() (RPCCloneResult, error)

func (*RPCSessionHost) CycleModel

func (h *RPCSessionHost) CycleModel() (*RPCCycleModelResult, error)

func (*RPCSessionHost) CycleModelDirection

func (h *RPCSessionHost) CycleModelDirection(direction string) (*RPCCycleModelResult, error)

func (*RPCSessionHost) CycleThinkingLevel

func (h *RPCSessionHost) CycleThinkingLevel() (string, error)

func (*RPCSessionHost) ExportHTML

func (h *RPCSessionHost) ExportHTML(outputPath string) (string, error)

func (*RPCSessionHost) ExportJSONL

func (h *RPCSessionHost) ExportJSONL(outputPath string) (string, error)

func (*RPCSessionHost) Fork

func (h *RPCSessionHost) Fork(entryID string) (RPCForkResult, error)

func (*RPCSessionHost) GetCommands

func (h *RPCSessionHost) GetCommands() RPCCommandsResult

func (*RPCSessionHost) GetLastAssistantText

func (h *RPCSessionHost) GetLastAssistantText() *string

func (*RPCSessionHost) GetSessionStats

func (h *RPCSessionHost) GetSessionStats() RPCSessionStats

func (*RPCSessionHost) GetState

func (h *RPCSessionHost) GetState() RPCSessionState

func (*RPCSessionHost) HandleCommand

func (h *RPCSessionHost) HandleCommand(ctx context.Context, command RPCCommand) RPCResponse

func (*RPCSessionHost) HandleHostAction

func (h *RPCSessionHost) HandleHostAction(request HostActionRequest) HostActionResponse

func (*RPCSessionHost) HandleHostActionContext

func (h *RPCSessionHost) HandleHostActionContext(ctx context.Context, request HostActionRequest) HostActionResponse

func (*RPCSessionHost) OnSessionReplaced

func (h *RPCSessionHost) OnSessionReplaced(listener func(*AgentSession)) func()

func (*RPCSessionHost) SetAutoCompaction

func (h *RPCSessionHost) SetAutoCompaction(enabled *bool) error

func (*RPCSessionHost) SetAutoRetry

func (h *RPCSessionHost) SetAutoRetry(enabled *bool) error

func (*RPCSessionHost) SetFollowUpMode

func (h *RPCSessionHost) SetFollowUpMode(mode string) error

func (*RPCSessionHost) SetModel

func (h *RPCSessionHost) SetModel(provider, modelID string) (llm.Model, error)

func (*RPCSessionHost) SetSteeringMode

func (h *RPCSessionHost) SetSteeringMode(mode string) error

func (*RPCSessionHost) SetThinkingLevel

func (h *RPCSessionHost) SetThinkingLevel(level string) error

func (*RPCSessionHost) SubscribeEvents

func (h *RPCSessionHost) SubscribeEvents(listener func(AgentSessionEvent)) func()

func (*RPCSessionHost) SwitchSession

func (h *RPCSessionHost) SwitchSession(sessionPath string) (RPCCloneResult, error)

type RPCSessionState

type RPCSessionState struct {
	Model                 *llm.Model `json:"model,omitempty"`
	ThinkingLevel         string     `json:"thinkingLevel"`
	IsStreaming           bool       `json:"isStreaming"`
	IsCompacting          bool       `json:"isCompacting"`
	SteeringMode          string     `json:"steeringMode"`
	FollowUpMode          string     `json:"followUpMode"`
	SessionFile           string     `json:"sessionFile,omitempty"`
	SessionID             string     `json:"sessionId"`
	SessionName           string     `json:"sessionName,omitempty"`
	AutoCompactionEnabled bool       `json:"autoCompactionEnabled"`
	MessageCount          int        `json:"messageCount"`
	PendingMessageCount   int        `json:"pendingMessageCount"`
}

type RPCSessionStats

type RPCSessionStats struct {
	SessionFile       string             `json:"sessionFile,omitempty"`
	SessionID         string             `json:"sessionId"`
	UserMessages      int                `json:"userMessages"`
	AssistantMessages int                `json:"assistantMessages"`
	ToolCalls         int                `json:"toolCalls"`
	ToolResults       int                `json:"toolResults"`
	TotalMessages     int                `json:"totalMessages"`
	Tokens            RPCSessionTokens   `json:"tokens"`
	Cost              float64            `json:"cost"`
	ContextUsage      *AgentContextUsage `json:"contextUsage,omitempty"`
}

type RPCSessionTokens

type RPCSessionTokens struct {
	Input      int `json:"input"`
	Output     int `json:"output"`
	CacheRead  int `json:"cacheRead"`
	CacheWrite int `json:"cacheWrite"`
	Total      int `json:"total"`
}

type RPCSlashCommand

type RPCSlashCommand struct {
	Name         string `json:"name"`
	Description  string `json:"description,omitempty"`
	ArgumentHint string `json:"argumentHint,omitempty"`
	Source       string `json:"source"`
	SourceInfo   any    `json:"sourceInfo"`
}

type RPCThinkingLevelResult

type RPCThinkingLevelResult struct {
	Level string `json:"level"`
}

type ReadTool

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

func NewReadTool

func NewReadTool(cwd string, operations ...FileToolOperations) ReadTool

func NewReadToolWithOptions

func NewReadToolWithOptions(cwd string, options ReadToolOptions, operations ...FileToolOperations) ReadTool

func (ReadTool) Execute

func (t ReadTool) Execute(_ string, input ReadToolInput) (FileToolResult, error)

type ReadToolInput

type ReadToolInput struct {
	Path   string
	Offset int
	Limit  int
}

type ReadToolOptions

type ReadToolOptions struct {
	AutoResizeImages *bool
}

type ReadToolTruncation

type ReadToolTruncation struct {
	Truncated             bool   `json:"truncated"`
	TruncatedBy           string `json:"truncatedBy"`
	TotalLines            int    `json:"totalLines"`
	TotalBytes            int    `json:"totalBytes"`
	OutputLines           int    `json:"outputLines"`
	OutputBytes           int    `json:"outputBytes"`
	LastLinePartial       bool   `json:"lastLinePartial"`
	FirstLineExceedsLimit bool   `json:"firstLineExceedsLimit"`
	MaxLines              int    `json:"maxLines"`
	MaxBytes              int    `json:"maxBytes"`
}

type ResizedImage

type ResizedImage = imageresize.ResizedImage

func ResizeImage

func ResizeImage(part llm.ContentPart, options ...ImageResizeOptions) *ResizedImage

type ResolveCLIModelOptions

type ResolveCLIModelOptions = modelresolver.ResolveCLIModelOptions

type ResolveCLIModelResult

type ResolveCLIModelResult = modelresolver.ResolveCLIModelResult

func ResolveCLIModel

func ResolveCLIModel(options ResolveCLIModelOptions) ResolveCLIModelResult

type ResolveExtensionSourcesOptions

type ResolveExtensionSourcesOptions struct {
	Temporary bool
}

type ResolvedRequestAuth

type ResolvedRequestAuth struct {
	OK      bool
	APIKey  string
	Headers map[string]string
	Error   string
}

type ResourceAgentsFilesResult

type ResourceAgentsFilesResult struct {
	AgentsFiles []ResourceContextFile
}

type ResourceContextFile

type ResourceContextFile struct {
	Path    string
	Content string
}

type ResourceExtension

type ResourceExtension struct {
	ExtensionPaths []ResourceExtensionPath
	SkillPaths     []ResourceSkillPath
	PromptPaths    []ResourcePromptPath
	ThemePaths     []ResourceThemePath
}

type ResourceExtensionPath

type ResourceExtensionPath struct {
	Path     string
	Metadata ProtocolSourceInfo
}

type ResourceExtensionsResult

type ResourceExtensionsResult struct {
	Extensions        []ProtocolExtensionSource
	ProcessExtensions []ProtocolPackageProcessExtension
	Errors            []ProtocolExtensionDiscoveryError
	Runtime           *ProtocolExtensionRuntime
}

type ResourcePromptPath

type ResourcePromptPath struct {
	Path     string
	Metadata ProtocolSourceInfo
}

type ResourcePromptsResult

type ResourcePromptsResult struct {
	Prompts []PromptTemplate
}

type ResourceSkillPath

type ResourceSkillPath struct {
	Path     string
	Metadata ProtocolSourceInfo
}

type ResourceSkillsResult

type ResourceSkillsResult = AgentSessionSkillsResult

type ResourceTheme

type ResourceTheme struct {
	Name       string
	SourcePath string
}

type ResourceThemePath

type ResourceThemePath struct {
	Path     string
	Metadata ProtocolSourceInfo
}

type ResourceThemesResult

type ResourceThemesResult struct {
	Themes      []ResourceTheme
	Diagnostics []agentharness.SkillDiagnostic
}

type SDKAgent

type SDKAgent struct {
	State SDKAgentState
}

type SDKAgentState

type SDKAgentState struct {
	SystemPrompt  string
	Model         llm.Model
	ThinkingLevel string
	Tools         []SDKTool
}

type SDKContentPart

type SDKContentPart struct {
	Type string
	Text string
}

type SDKTool

type SDKTool struct {
	Name               string
	Label              string
	Description        string
	Parameters         llm.Schema
	PromptSnippet      string
	PromptGuidelines   []string
	ExecutionMode      string
	SourceInfo         ProtocolSourceInfo
	PrepareArguments   func(input map[string]any) map[string]any
	Execute            func(toolCallID string, input map[string]any) (SDKToolResult, error)
	ExecuteWithUpdates func(toolCallID string, input map[string]any, onUpdate func(SDKToolResult)) (SDKToolResult, error)
}

type SDKToolResult

type SDKToolResult struct {
	Content []SDKContentPart
	Details any
}

type SandboxEnvReader

type SandboxEnvReader = sandboxenv.Reader

type ScopedModel

type ScopedModel = modelresolver.ScopedModel

func ResolveModelScope

func ResolveModelScope(patterns []string, registry CodingModelRegistry) []ScopedModel

type ScopedModelsSelectorCallbacks

type ScopedModelsSelectorCallbacks struct {
	OnChange  func([]string)
	OnPersist func([]string)
	OnCancel  func()
}

type ScopedModelsSelectorComponent

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

func (*ScopedModelsSelectorComponent) EnabledModelIDs

func (c *ScopedModelsSelectorComponent) EnabledModelIDs() []string

func (*ScopedModelsSelectorComponent) Focused

func (c *ScopedModelsSelectorComponent) Focused() bool

func (*ScopedModelsSelectorComponent) HandleInput

func (c *ScopedModelsSelectorComponent) HandleInput(data string)

func (*ScopedModelsSelectorComponent) Invalidate

func (c *ScopedModelsSelectorComponent) Invalidate()

func (*ScopedModelsSelectorComponent) Render

func (c *ScopedModelsSelectorComponent) Render(width int) []string

func (*ScopedModelsSelectorComponent) SetFocused

func (c *ScopedModelsSelectorComponent) SetFocused(focused bool)

type ScopedModelsSelectorConfig

type ScopedModelsSelectorConfig struct {
	AllModels       []llm.Model
	EnabledModelIDs []string
	Keybindings     KeybindingsConfig
}

type SelfUpdateCommand

type SelfUpdateCommand struct {
	Command string
	Args    []string
	Display string
	Steps   []SelfUpdateCommandStep
}

func GetSelfUpdateCommand

func GetSelfUpdateCommand(packageName string, env InstallEnvironment, _ []string, updatePackageName string) *SelfUpdateCommand

type SelfUpdateCommandStep

type SelfUpdateCommandStep struct {
	Command string
	Args    []string
	Display string
}

type SelfUpdateOptions

type SelfUpdateOptions struct {
	PackageName         string
	CurrentVersion      string
	Force               bool
	Environment         InstallEnvironment
	VersionCheck        VersionReleaseChecker
	VersionCheckOptions VersionCheckOptions
}

type SelfUpdateResult

type SelfUpdateResult struct {
	Updated     bool
	PackageName string
}

type SessionContext

type SessionContext struct {
	Messages      []any
	ThinkingLevel string
	Model         *SessionModel
}

func BuildSessionContext

func BuildSessionContext(entries []FileEntry, leafID *string, byID map[string]FileEntry) SessionContext

type SessionHeader

type SessionHeader struct {
	Type          string `json:"type"`
	Version       int    `json:"version,omitempty"`
	ID            string `json:"id"`
	Timestamp     string `json:"timestamp"`
	CWD           string `json:"cwd"`
	ParentSession string `json:"parentSession,omitempty"`
}

type SessionImportFileNotFoundError

type SessionImportFileNotFoundError struct {
	Path string
}

func (SessionImportFileNotFoundError) Error

type SessionInfo

type SessionInfo struct {
	Path              string
	ID                string
	CWD               string
	Name              string
	ParentSessionPath string
	Created           time.Time
	Modified          time.Time
	MessageCount      int
	FirstMessage      string
	AllMessagesText   string
}

func BuildSessionInfo

func BuildSessionInfo(filePath string) (*SessionInfo, error)

func FilterAndSortSessions

func FilterAndSortSessions(sessions []SessionInfo, query string, sortMode SessionSelectorSortMode, filters ...SessionSelectorNameFilter) []SessionInfo

func ListAllSessions

func ListAllSessions(args ...any) []SessionInfo

func ListSessions

func ListSessions(cwd string, args ...any) []SessionInfo

type SessionListProgress

type SessionListProgress func(loaded int, total int)

type SessionManager

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

func ContinueRecentSession

func ContinueRecentSession(cwd string, sessionDir ...string) (*SessionManager, error)

func CreateSessionManager

func CreateSessionManager(cwd string, sessionDir ...string) (*SessionManager, error)

func ForkSessionFrom

func ForkSessionFrom(sourcePath, targetCwd string, sessionDir ...string) (*SessionManager, error)

func InMemorySessionManager

func InMemorySessionManager(cwd ...string) (*SessionManager, error)

func OpenSessionManager

func OpenSessionManager(path string, args ...string) (*SessionManager, error)

func (*SessionManager) AppendCompaction

func (s *SessionManager) AppendCompaction(summary, firstKeptEntryID string, tokensBefore int) string

func (*SessionManager) AppendCustomEntry

func (s *SessionManager) AppendCustomEntry(customType string, data any) string

func (*SessionManager) AppendCustomMessageEntry

func (s *SessionManager) AppendCustomMessageEntry(customType string, content any, display bool, details any) string

func (*SessionManager) AppendCustomMessageEntryWithContext

func (s *SessionManager) AppendCustomMessageEntryWithContext(customType string, content any, display bool, details any, includeInContext bool) string

func (*SessionManager) AppendLabelChange

func (s *SessionManager) AppendLabelChange(targetID, label string) (string, error)

func (*SessionManager) AppendMessage

func (s *SessionManager) AppendMessage(message any) string

func (*SessionManager) AppendModelChange

func (s *SessionManager) AppendModelChange(provider, modelID string) string

func (*SessionManager) AppendSessionInfo

func (s *SessionManager) AppendSessionInfo(name string) string

func (*SessionManager) AppendThinkingLevelChange

func (s *SessionManager) AppendThinkingLevelChange(thinkingLevel string) string

func (*SessionManager) Branch

func (s *SessionManager) Branch(branchFromID string) error

func (*SessionManager) BranchWithSummary

func (s *SessionManager) BranchWithSummary(branchFromID *string, summary string) (string, error)

func (*SessionManager) BuildSessionContext

func (s *SessionManager) BuildSessionContext() SessionContext

func (*SessionManager) CreateBranchedSession

func (s *SessionManager) CreateBranchedSession(leafID string) (string, error)

func (*SessionManager) ForkAtEntry

func (s *SessionManager) ForkAtEntry(entryID string) (*SessionManager, error)

func (*SessionManager) ForkBeforeEntry

func (s *SessionManager) ForkBeforeEntry(entryID string) (*SessionManager, error)

func (*SessionManager) GetBranch

func (s *SessionManager) GetBranch(fromID ...string) []FileEntry

func (*SessionManager) GetCWD

func (s *SessionManager) GetCWD() string

func (*SessionManager) GetChildren

func (s *SessionManager) GetChildren(parentID string) []FileEntry

func (*SessionManager) GetCwd

func (s *SessionManager) GetCwd() string

func (*SessionManager) GetEntries

func (s *SessionManager) GetEntries() []FileEntry

func (*SessionManager) GetEntry

func (s *SessionManager) GetEntry(id string) *FileEntry

func (*SessionManager) GetHeader

func (s *SessionManager) GetHeader() *SessionHeader

func (*SessionManager) GetLabel

func (s *SessionManager) GetLabel(id string) (string, bool)

func (*SessionManager) GetLeafEntry

func (s *SessionManager) GetLeafEntry() *FileEntry

func (*SessionManager) GetLeafID

func (s *SessionManager) GetLeafID() *string

func (*SessionManager) GetLeafId

func (s *SessionManager) GetLeafId() *string

func (*SessionManager) GetSessionDir

func (s *SessionManager) GetSessionDir() string

func (*SessionManager) GetSessionFile

func (s *SessionManager) GetSessionFile() string

func (*SessionManager) GetSessionID

func (s *SessionManager) GetSessionID() string

func (*SessionManager) GetSessionId

func (s *SessionManager) GetSessionId() string

func (*SessionManager) GetSessionName

func (s *SessionManager) GetSessionName() string

func (*SessionManager) GetTree

func (s *SessionManager) GetTree() []*SessionTreeNode

func (*SessionManager) IsPersisted

func (s *SessionManager) IsPersisted() bool

func (*SessionManager) NewSession

func (s *SessionManager) NewSession(options ...NewSessionOptions) string

func (*SessionManager) ResetLeaf

func (s *SessionManager) ResetLeaf()

func (*SessionManager) SetSessionFile

func (s *SessionManager) SetSessionFile(sessionFile string) error

type SessionModel

type SessionModel struct {
	Provider string
	ModelID  string
}

type SessionSelectorComponent

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

func NewLoadingSessionSelectorComponent

func NewLoadingSessionSelectorComponent(currentLoader, allLoader SessionSelectorLoader, options SessionSelectorOptions) *SessionSelectorComponent

func NewSessionSelectorComponent

func NewSessionSelectorComponent(sessions []SessionInfo, options SessionSelectorOptions) *SessionSelectorComponent

func (*SessionSelectorComponent) GetSessionList

func (*SessionSelectorComponent) HandleInput

func (s *SessionSelectorComponent) HandleInput(input string)

func (*SessionSelectorComponent) Invalidate

func (s *SessionSelectorComponent) Invalidate()

func (*SessionSelectorComponent) IsAllLoading

func (s *SessionSelectorComponent) IsAllLoading() bool

func (*SessionSelectorComponent) Render

func (s *SessionSelectorComponent) Render(width int) []string

func (*SessionSelectorComponent) Scope

func (s *SessionSelectorComponent) Scope() string

func (*SessionSelectorComponent) SetNameFilter

func (s *SessionSelectorComponent) SetNameFilter(filter SessionSelectorNameFilter)

func (*SessionSelectorComponent) SetSortMode

type SessionSelectorLoader

type SessionSelectorLoader func(SessionListProgress) ([]SessionInfo, error)

type SessionSelectorNameFilter

type SessionSelectorNameFilter string
const (
	SessionSelectorNameAll   SessionSelectorNameFilter = "all"
	SessionSelectorNameNamed SessionSelectorNameFilter = "named"
)

type SessionSelectorOptions

type SessionSelectorOptions struct {
	ShowRenameHint             bool
	RenameSession              func(path, name string) error
	DeleteSession              func(path string) error
	Keybindings                KeybindingsConfig
	OnDeleteConfirmationChange func(path *string)
	OnError                    func(message string)
	OnSelect                   func(path string)
	OnCancel                   func()
	RequestRender              func()
	CurrentSessionPath         string
}

type SessionSelectorSortMode

type SessionSelectorSortMode string
const (
	SessionSelectorSortThreaded  SessionSelectorSortMode = "threaded"
	SessionSelectorSortRecent    SessionSelectorSortMode = "recent"
	SessionSelectorSortRelevance SessionSelectorSortMode = "relevance"
)

type SessionTreeNode

type SessionTreeNode struct {
	Entry          FileEntry
	Children       []*SessionTreeNode
	Label          string
	LabelTimestamp string
}

type SettingsError

type SettingsError struct {
	Scope string
	Err   error
}

type SettingsManager

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

func NewInMemorySettingsManager

func NewInMemorySettingsManager(settings map[string]any) *SettingsManager

func NewSettingsManager

func NewSettingsManager(cwd, agentDir string) *SettingsManager

func (*SettingsManager) DrainErrors

func (s *SettingsManager) DrainErrors() []SettingsError

func (*SettingsManager) Flush

func (s *SettingsManager) Flush() error

func (*SettingsManager) GetAutocompleteMaxVisible

func (s *SettingsManager) GetAutocompleteMaxVisible() int

func (*SettingsManager) GetBlockImages

func (s *SettingsManager) GetBlockImages() bool

func (*SettingsManager) GetBranchSummarySkipPrompt

func (s *SettingsManager) GetBranchSummarySkipPrompt() bool

func (*SettingsManager) GetClearOnShrink

func (s *SettingsManager) GetClearOnShrink() bool

func (*SettingsManager) GetCollapseChangelog

func (s *SettingsManager) GetCollapseChangelog() bool

func (*SettingsManager) GetDefaultModel

func (s *SettingsManager) GetDefaultModel() string

func (*SettingsManager) GetDefaultProvider

func (s *SettingsManager) GetDefaultProvider() string

func (*SettingsManager) GetDefaultThinkingLevel

func (s *SettingsManager) GetDefaultThinkingLevel() string

func (*SettingsManager) GetDoubleEscapeAction

func (s *SettingsManager) GetDoubleEscapeAction() string

func (*SettingsManager) GetEditorPaddingX

func (s *SettingsManager) GetEditorPaddingX() int

func (*SettingsManager) GetEnableInstallTelemetry

func (s *SettingsManager) GetEnableInstallTelemetry() bool

func (*SettingsManager) GetEnableSkillCommands

func (s *SettingsManager) GetEnableSkillCommands() bool

func (*SettingsManager) GetEnabledModels

func (s *SettingsManager) GetEnabledModels() []string

func (*SettingsManager) GetExtensionPaths

func (s *SettingsManager) GetExtensionPaths() []string

func (*SettingsManager) GetHTTPIdleTimeoutMS

func (s *SettingsManager) GetHTTPIdleTimeoutMS() int

func (*SettingsManager) GetHideThinkingBlock

func (s *SettingsManager) GetHideThinkingBlock() bool

func (*SettingsManager) GetImageAutoResize

func (s *SettingsManager) GetImageAutoResize() bool

func (*SettingsManager) GetImageWidthCells

func (s *SettingsManager) GetImageWidthCells() int

func (*SettingsManager) GetLastChangelogVersion

func (s *SettingsManager) GetLastChangelogVersion() string

func (*SettingsManager) GetPackages

func (s *SettingsManager) GetPackages() []any

func (*SettingsManager) GetProviderRetrySettings

func (s *SettingsManager) GetProviderRetrySettings() ProviderRetrySettings

func (*SettingsManager) GetQuietStartup

func (s *SettingsManager) GetQuietStartup() bool

func (*SettingsManager) GetRetryEnabled

func (s *SettingsManager) GetRetryEnabled() bool

func (*SettingsManager) GetRetrySettings

func (s *SettingsManager) GetRetrySettings() AgentSessionRetrySettings

func (*SettingsManager) GetSessionDir

func (s *SettingsManager) GetSessionDir() string

func (*SettingsManager) GetShellCommandPrefix

func (s *SettingsManager) GetShellCommandPrefix() string

func (*SettingsManager) GetShowHardwareCursor

func (s *SettingsManager) GetShowHardwareCursor() bool

func (*SettingsManager) GetShowImages

func (s *SettingsManager) GetShowImages() bool

func (*SettingsManager) GetShowTerminalProgress

func (s *SettingsManager) GetShowTerminalProgress() bool

func (*SettingsManager) GetTheme

func (s *SettingsManager) GetTheme() string

func (*SettingsManager) GetTransport

func (s *SettingsManager) GetTransport() string

func (*SettingsManager) GetTreeFilterMode

func (s *SettingsManager) GetTreeFilterMode() string

func (*SettingsManager) GetWarnings

func (s *SettingsManager) GetWarnings() WarningSettings

func (*SettingsManager) Reload

func (s *SettingsManager) Reload()

func (*SettingsManager) SetAutocompleteMaxVisible

func (s *SettingsManager) SetAutocompleteMaxVisible(visible int)

func (*SettingsManager) SetBlockImages

func (s *SettingsManager) SetBlockImages(blocked bool)

func (*SettingsManager) SetBranchSummarySkipPrompt

func (s *SettingsManager) SetBranchSummarySkipPrompt(skip bool)

func (*SettingsManager) SetClearOnShrink

func (s *SettingsManager) SetClearOnShrink(enabled bool)

func (*SettingsManager) SetCollapseChangelog

func (s *SettingsManager) SetCollapseChangelog(collapsed bool)

func (*SettingsManager) SetDefaultModel

func (s *SettingsManager) SetDefaultModel(model string)

func (*SettingsManager) SetDefaultProvider

func (s *SettingsManager) SetDefaultProvider(provider string)

func (*SettingsManager) SetDefaultThinkingLevel

func (s *SettingsManager) SetDefaultThinkingLevel(level string)

func (*SettingsManager) SetDoubleEscapeAction

func (s *SettingsManager) SetDoubleEscapeAction(action string)

func (*SettingsManager) SetEditorPaddingX

func (s *SettingsManager) SetEditorPaddingX(padding int)

func (*SettingsManager) SetEnableInstallTelemetry

func (s *SettingsManager) SetEnableInstallTelemetry(enabled bool)

func (*SettingsManager) SetEnableSkillCommands

func (s *SettingsManager) SetEnableSkillCommands(enabled bool)

func (*SettingsManager) SetEnabledModels

func (s *SettingsManager) SetEnabledModels(models []string)

func (*SettingsManager) SetHTTPIdleTimeoutMS

func (s *SettingsManager) SetHTTPIdleTimeoutMS(timeoutMS int)

func (*SettingsManager) SetHideThinkingBlock

func (s *SettingsManager) SetHideThinkingBlock(hidden bool)

func (*SettingsManager) SetImageAutoResize

func (s *SettingsManager) SetImageAutoResize(enabled bool)

func (*SettingsManager) SetImageWidthCells

func (s *SettingsManager) SetImageWidthCells(width int)

func (*SettingsManager) SetLastChangelogVersion

func (s *SettingsManager) SetLastChangelogVersion(version string)

func (*SettingsManager) SetPackages

func (s *SettingsManager) SetPackages(packages []any)

func (*SettingsManager) SetProjectExtensionPaths

func (s *SettingsManager) SetProjectExtensionPaths(paths []string)

func (*SettingsManager) SetProjectPackages

func (s *SettingsManager) SetProjectPackages(packages []any)

func (*SettingsManager) SetQuietStartup

func (s *SettingsManager) SetQuietStartup(enabled bool)

func (*SettingsManager) SetRetryEnabled

func (s *SettingsManager) SetRetryEnabled(enabled bool)

func (*SettingsManager) SetShowHardwareCursor

func (s *SettingsManager) SetShowHardwareCursor(enabled bool)

func (*SettingsManager) SetShowImages

func (s *SettingsManager) SetShowImages(enabled bool)

func (*SettingsManager) SetShowTerminalProgress

func (s *SettingsManager) SetShowTerminalProgress(enabled bool)

func (*SettingsManager) SetTheme

func (s *SettingsManager) SetTheme(theme string)

func (*SettingsManager) SetTransport

func (s *SettingsManager) SetTransport(transport string)

func (*SettingsManager) SetTreeFilterMode

func (s *SettingsManager) SetTreeFilterMode(mode string)

func (*SettingsManager) SetWarningAnthropicExtraUsage

func (s *SettingsManager) SetWarningAnthropicExtraUsage(enabled bool)

func (*SettingsManager) SetWarnings

func (s *SettingsManager) SetWarnings(warnings WarningSettings)

type SourceInfo

type SourceInfo struct {
	Path   string
	Source string
	Scope  string
	Origin string
}

type SystemPromptContextFile

type SystemPromptContextFile struct {
	Path    string
	Content string
}

type SystemPromptDocumentationPath

type SystemPromptDocumentationPath struct {
	Label  string
	Path   string
	Detail string
}

type SystemPromptSkill

type SystemPromptSkill struct {
	Name        string
	Description string
	Content     string
}

type TUIDialogHost

type TUIDialogHost interface {
	RunTUIDialog(request TUIDialogRequest) (TUIDialogResult, error)
}

type TUIDialogOption

type TUIDialogOption struct {
	ID          string `json:"id"`
	Label       string `json:"label"`
	Description string `json:"description,omitempty"`
	Value       any    `json:"value,omitempty"`
}

type TUIDialogRequest

type TUIDialogRequest struct {
	Kind         string            `json:"kind"`
	Type         string            `json:"type,omitempty"`
	Title        string            `json:"title,omitempty"`
	Message      string            `json:"message,omitempty"`
	Placeholder  string            `json:"placeholder,omitempty"`
	Options      []TUIDialogOption `json:"options,omitempty"`
	DefaultValue any               `json:"defaultValue,omitempty"`
	Timeout      int               `json:"timeout,omitempty"`
}

type TUIDialogResult

type TUIDialogResult struct {
	Action   string `json:"action"`
	OptionID string `json:"optionId,omitempty"`
	Value    any    `json:"value,omitempty"`
}

type TUIEditorCursorHost

type TUIEditorCursorHost interface {
	EditorCursor() (line, col int, ok bool)
}

type TUIEditorCustomStateHost

type TUIEditorCustomStateHost interface {
	EditorCustomActive() bool
}

type TUIEditorFocusHost

type TUIEditorFocusHost interface {
	FocusEditor() error
	EditorFocused() bool
}

type TUIEditorHost

type TUIEditorHost interface {
	ReadEditorText() string
	SetEditorText(text string)
	InsertEditorText(text string)
	SubmitEditorText() error
}

type TUIEditorPasteHost

type TUIEditorPasteHost interface {
	PasteEditorText(text string)
}

type TUIStatusHost

type TUIStatusHost interface {
	SetTUIStatus(key, text string) error
}

type TUIThemeHost

type TUIThemeHost interface {
	CurrentTUITheme() string
	AvailableTUIThemes() []TUIThemeInfo
	SetTUITheme(name string) error
}

type TUIThemeInfo

type TUIThemeInfo struct {
	Name    string `json:"name"`
	Path    string `json:"path,omitempty"`
	Builtin bool   `json:"builtin,omitempty"`
}

type TUIThinkingLabelHost

type TUIThinkingLabelHost interface {
	SetHiddenThinkingLabel(label string) error
}

type TUITitleHost

type TUITitleHost interface {
	SetTUITitle(title string) error
}

type TUIToolExpansionHost

type TUIToolExpansionHost interface {
	TUIToolsExpanded() bool
	SetTUIToolsExpanded(expanded bool) error
}

type TUIWorkingHost

type TUIWorkingHost interface {
	SetTUIWorking(update TUIWorkingUpdate) error
}

type TUIWorkingIndicatorOptions

type TUIWorkingIndicatorOptions struct {
	Frames     []string `json:"frames,omitempty"`
	IntervalMs int      `json:"intervalMs,omitempty"`
}

type TUIWorkingUpdate

type TUIWorkingUpdate struct {
	Message        string
	MessageSet     bool
	ResetMessage   bool
	Visible        bool
	VisibleSet     bool
	Indicator      TUIWorkingIndicatorOptions
	IndicatorSet   bool
	ResetIndicator bool
}

type ThemeExportColors

type ThemeExportColors struct {
	PageBg *string
	CardBg *string
	InfoBg *string
}

func GetThemeExportColors

func GetThemeExportColors(themeName, agentDir string) (ThemeExportColors, error)

type TmuxOptionReader

type TmuxOptionReader = tmux.OptionReader

type ToolCallRenderer

type ToolCallRenderer func(args any, context ToolRenderContext) []string

type ToolDefinition

type ToolDefinition struct {
	Name             string
	Description      string
	Parameters       llm.Schema
	PrepareArguments func(args any) any
	Execute          func(callID string, args any) (FileToolResult, error)
	RenderCall       ToolCallRenderer
	RenderResult     ToolResultRenderer
}

func CreateBashToolDefinition

func CreateBashToolDefinition(cwd string, options ...BashToolOptions) ToolDefinition

func CreateEditToolDefinition

func CreateEditToolDefinition(cwd string, operations ...FileToolOperations) ToolDefinition

func CreateReadToolDefinition

func CreateReadToolDefinition(cwd string, operations ...FileToolOperations) ToolDefinition

func CreateWriteToolDefinition

func CreateWriteToolDefinition(cwd string, operations ...FileToolOperations) ToolDefinition

type ToolExecutionComponent

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

func NewToolExecutionComponent

func NewToolExecutionComponent(name, callID string, args any, definition ToolDefinition, cwd string, options ...ToolExecutionOptions) *ToolExecutionComponent

func (*ToolExecutionComponent) Invalidate

func (c *ToolExecutionComponent) Invalidate()

func (*ToolExecutionComponent) MarkExecutionStarted

func (c *ToolExecutionComponent) MarkExecutionStarted()

func (*ToolExecutionComponent) Render

func (c *ToolExecutionComponent) Render(width int) []string

func (*ToolExecutionComponent) SetArgsComplete

func (c *ToolExecutionComponent) SetArgsComplete()

func (*ToolExecutionComponent) SetExpanded

func (c *ToolExecutionComponent) SetExpanded(expanded bool)

func (*ToolExecutionComponent) SetImageWidthCells

func (c *ToolExecutionComponent) SetImageWidthCells(width int)

func (*ToolExecutionComponent) SetShowImages

func (c *ToolExecutionComponent) SetShowImages(show bool)

func (*ToolExecutionComponent) UpdateArgs

func (c *ToolExecutionComponent) UpdateArgs(args any)

func (*ToolExecutionComponent) UpdatePartialResult

func (c *ToolExecutionComponent) UpdatePartialResult(result FileToolResult, isError bool) bool

func (*ToolExecutionComponent) UpdateResult

func (c *ToolExecutionComponent) UpdateResult(result FileToolResult, isError bool) bool

func (*ToolExecutionComponent) UpdateResultWithOptions

func (c *ToolExecutionComponent) UpdateResultWithOptions(result FileToolResult, isError, isPartial bool) bool

type ToolExecutionOptions

type ToolExecutionOptions struct {
	ShowImages      *bool
	ImageWidthCells int
}

type ToolRenderContext

type ToolRenderContext struct {
	Args             any
	ToolCallID       string
	State            map[string]any
	CWD              string
	ArgsComplete     bool
	IsPartial        bool
	Expanded         bool
	ShowImages       bool
	IsError          bool
	PreflightDiff    *EditDiffResult
	ExecutionStarted bool
}

type ToolRenderResultOptions

type ToolRenderResultOptions struct {
	Expanded  bool
	IsPartial bool
}

type ToolResultRenderer

type ToolResultRenderer func(result FileToolResult, options ToolRenderResultOptions, context ToolRenderContext) []string

type TopLevelResourceToggle

type TopLevelResourceToggle struct {
	Scope        string
	ResourceType string
	Pattern      string
	Enabled      bool
}

type TreeSelectorComponent

type TreeSelectorComponent struct {
	OnSelect func(entryID string)
	OnCancel func()
	// contains filtered or unexported fields
}

func NewTreeSelectorComponent

func NewTreeSelectorComponent(roots []*SessionTreeNode, currentLeafID string, options ...TreeSelectorOptions) *TreeSelectorComponent

func (*TreeSelectorComponent) Focused

func (s *TreeSelectorComponent) Focused() bool

func (*TreeSelectorComponent) GetTreeList

func (s *TreeSelectorComponent) GetTreeList() *TreeSelectorList

func (*TreeSelectorComponent) HandleInput

func (s *TreeSelectorComponent) HandleInput(input string)

func (*TreeSelectorComponent) Invalidate

func (s *TreeSelectorComponent) Invalidate()

func (*TreeSelectorComponent) Render

func (s *TreeSelectorComponent) Render(width int) []string

func (*TreeSelectorComponent) SetFilter

func (s *TreeSelectorComponent) SetFilter(filter TreeSelectorFilter)

func (*TreeSelectorComponent) SetFocused

func (s *TreeSelectorComponent) SetFocused(focused bool)

type TreeSelectorFilter

type TreeSelectorFilter string
const (
	TreeSelectorDefaultFilter TreeSelectorFilter = "default"
	TreeSelectorNoToolsFilter TreeSelectorFilter = "no-tools"
	TreeSelectorUserFilter    TreeSelectorFilter = "user"
	TreeSelectorLabelFilter   TreeSelectorFilter = "label"
	TreeSelectorAllFilter     TreeSelectorFilter = "all"
)

type TreeSelectorList

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

func (*TreeSelectorList) GetSelectedNode

func (l *TreeSelectorList) GetSelectedNode() *SessionTreeNode

func (*TreeSelectorList) Render

func (l *TreeSelectorList) Render(width int) []string

type TreeSelectorOptions

type TreeSelectorOptions struct {
	Keybindings KeybindingsConfig
}

type TriggerCompactExtension

type TriggerCompactExtension struct {
	ThresholdTokens int
	// contains filtered or unexported fields
}

func NewTriggerCompactExtension

func NewTriggerCompactExtension(thresholdTokens int) *TriggerCompactExtension

func (*TriggerCompactExtension) OnTurnEnd

func (e *TriggerCompactExtension) OnTurnEnd(tokens *int, compact func())

type UserMessageComponent

type UserMessageComponent struct {
	Text string
}

func NewUserMessageComponent

func NewUserMessageComponent(text string) UserMessageComponent

func (UserMessageComponent) Render

func (c UserMessageComponent) Render(width int) []string

type UserMessageSelectorComponent

type UserMessageSelectorComponent struct {
	OnSelect func(entryID string)
	OnCancel func()
	// contains filtered or unexported fields
}

func NewUserMessageSelectorComponent

func NewUserMessageSelectorComponent(messages []AgentSessionForkMessage, initialSelectedID string) *UserMessageSelectorComponent

func (*UserMessageSelectorComponent) Focused

func (c *UserMessageSelectorComponent) Focused() bool

func (*UserMessageSelectorComponent) HandleInput

func (c *UserMessageSelectorComponent) HandleInput(data string)

func (*UserMessageSelectorComponent) Invalidate

func (c *UserMessageSelectorComponent) Invalidate()

func (*UserMessageSelectorComponent) Render

func (c *UserMessageSelectorComponent) Render(width int) []string

func (*UserMessageSelectorComponent) SetFocused

func (c *UserMessageSelectorComponent) SetFocused(focused bool)

type VersionCheckOptions

type VersionCheckOptions = versioncheck.Options

type VersionReleaseChecker

type VersionReleaseChecker func(currentVersion string, options VersionCheckOptions) (LatestGiRelease, bool)

type ViewTreeChange

type ViewTreeChange struct {
	Type    string
	MountID string
	Slot    string
}

type ViewTreeComponent

type ViewTreeComponent struct {
	View    ViewTreeNode
	Host    *ViewTreeHost
	MountID string
	// contains filtered or unexported fields
}

func NewMountedViewTreeComponent

func NewMountedViewTreeComponent(host *ViewTreeHost, mountID string) *ViewTreeComponent

func NewViewTreeComponent

func NewViewTreeComponent(view ViewTreeNode) *ViewTreeComponent

func (*ViewTreeComponent) Focused

func (c *ViewTreeComponent) Focused() bool

func (*ViewTreeComponent) HandleInput

func (c *ViewTreeComponent) HandleInput(data string)

func (*ViewTreeComponent) Invalidate

func (c *ViewTreeComponent) Invalidate()

func (*ViewTreeComponent) Render

func (c *ViewTreeComponent) Render(width int) []string

func (*ViewTreeComponent) SetFocused

func (c *ViewTreeComponent) SetFocused(focused bool)

type ViewTreeEvent

type ViewTreeEvent struct {
	MountID string         `json:"mountId"`
	NodeID  string         `json:"nodeId,omitempty"`
	Event   string         `json:"event"`
	Data    map[string]any `json:"data,omitempty"`
}

type ViewTreeFocus

type ViewTreeFocus struct {
	MountID string `json:"mountId"`
	NodeID  string `json:"nodeId,omitempty"`
}

type ViewTreeHost

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

func NewViewTreeHost

func NewViewTreeHost() *ViewTreeHost

func (*ViewTreeHost) Blur

func (h *ViewTreeHost) Blur(mountID, nodeID string) error

func (*ViewTreeHost) DispatchEvent

func (h *ViewTreeHost) DispatchEvent(mountID, nodeID, event string, data map[string]any) error

func (*ViewTreeHost) DispatchResize

func (h *ViewTreeHost) DispatchResize(width, height int) error

func (*ViewTreeHost) DispatchThemeChange

func (h *ViewTreeHost) DispatchThemeChange(name string) error

func (*ViewTreeHost) DispatchTick

func (h *ViewTreeHost) DispatchTick(frame int64) error

func (*ViewTreeHost) DispatchVisibilityChange

func (h *ViewTreeHost) DispatchVisibilityChange(mountID string, visible bool, reason string) error

func (*ViewTreeHost) Events

func (h *ViewTreeHost) Events() []ViewTreeEvent

func (*ViewTreeHost) Focus

func (h *ViewTreeHost) Focus(mountID, nodeID string) error

func (*ViewTreeHost) Focused

func (h *ViewTreeHost) Focused() ViewTreeFocus

func (*ViewTreeHost) HasEventSubscription

func (h *ViewTreeHost) HasEventSubscription(event string) bool

func (*ViewTreeHost) Mount

func (h *ViewTreeHost) Mount(mountID, slot string, view ViewTreeNode) error

func (*ViewTreeHost) MountWithOptions

func (h *ViewTreeHost) MountWithOptions(mountID, slot string, view ViewTreeNode, options ...ViewTreeMountOptions) error

func (*ViewTreeHost) Mounted

func (h *ViewTreeHost) Mounted(mountID string) (ViewTreeMount, bool)

func (*ViewTreeHost) MountsBySlot

func (h *ViewTreeHost) MountsBySlot(slot string) []ViewTreeMount

func (*ViewTreeHost) OnChange

func (h *ViewTreeHost) OnChange(listener func(ViewTreeChange)) func()

func (*ViewTreeHost) OnEvent

func (h *ViewTreeHost) OnEvent(listener func(ViewTreeEvent)) func()

func (*ViewTreeHost) Patch

func (h *ViewTreeHost) Patch(mountID string, ops []ViewTreePatchOperation) error

func (*ViewTreeHost) RenderMount

func (h *ViewTreeHost) RenderMount(mountID string, width int) ([]string, error)

func (*ViewTreeHost) SetStatus

func (h *ViewTreeHost) SetStatus(key, text string, priority int) error

func (*ViewTreeHost) Unmount

func (h *ViewTreeHost) Unmount(mountID string) bool

type ViewTreeItem

type ViewTreeItem struct {
	Node *ViewTreeNode
	Item *ViewTreeListItem
}

func (ViewTreeItem) MarshalJSON

func (i ViewTreeItem) MarshalJSON() ([]byte, error)

func (*ViewTreeItem) UnmarshalJSON

func (i *ViewTreeItem) UnmarshalJSON(data []byte) error

type ViewTreeListItem

type ViewTreeListItem struct {
	ID       string             `json:"id"`
	Text     string             `json:"text,omitempty"`
	Checked  *bool              `json:"checked,omitempty"`
	Disabled bool               `json:"disabled,omitempty"`
	Children []ViewTreeListItem `json:"children,omitempty"`
}

type ViewTreeMount

type ViewTreeMount struct {
	MountID  string
	Slot     string
	View     ViewTreeNode
	Priority int
	Overlay  *ViewTreeOverlayOptions
}

type ViewTreeMountOptions

type ViewTreeMountOptions struct {
	Priority int
	Overlay  *ViewTreeOverlayOptions
}

type ViewTreeNode

type ViewTreeNode struct {
	Type     string                `json:"type"`
	ID       string                `json:"id,omitempty"`
	Text     string                `json:"text,omitempty"`
	Label    string                `json:"label,omitempty"`
	Value    *float64              `json:"value,omitempty"`
	Children []ViewTreeNode        `json:"children,omitempty"`
	Items    []ViewTreeItem        `json:"items,omitempty"`
	Columns  []ViewTreeTableColumn `json:"columns,omitempty"`
	Rows     []map[string]any      `json:"rows,omitempty"`
	Style    *ViewTreeStyle        `json:"style,omitempty"`
	Fallback *ViewTreeNode         `json:"fallback,omitempty"`
	Events   []string              `json:"events,omitempty"`
}

type ViewTreeOverlayMargin

type ViewTreeOverlayMargin struct {
	Set    bool
	Top    int
	Right  int
	Bottom int
	Left   int
}

func (*ViewTreeOverlayMargin) UnmarshalJSON

func (m *ViewTreeOverlayMargin) UnmarshalJSON(data []byte) error

type ViewTreeOverlayOptions

type ViewTreeOverlayOptions struct {
	Width        ViewTreeSizeValue     `json:"width,omitempty"`
	MinWidth     int                   `json:"minWidth,omitempty"`
	MaxHeight    ViewTreeSizeValue     `json:"maxHeight,omitempty"`
	Anchor       string                `json:"anchor,omitempty"`
	OffsetX      int                   `json:"offsetX,omitempty"`
	OffsetY      int                   `json:"offsetY,omitempty"`
	Row          ViewTreeSizeValue     `json:"row,omitempty"`
	Col          ViewTreeSizeValue     `json:"col,omitempty"`
	Margin       ViewTreeOverlayMargin `json:"margin,omitempty"`
	NonCapturing bool                  `json:"nonCapturing,omitempty"`
}

type ViewTreePatchOperation

type ViewTreePatchOperation struct {
	Op    string `json:"op"`
	Path  string `json:"path"`
	Value any    `json:"value,omitempty"`
}

type ViewTreeSizeValue

type ViewTreeSizeValue struct {
	Set          bool
	Value        int
	Percent      bool
	PercentValue float64
}

func (*ViewTreeSizeValue) UnmarshalJSON

func (v *ViewTreeSizeValue) UnmarshalJSON(data []byte) error

type ViewTreeStyle

type ViewTreeStyle struct {
	FG        string `json:"fg,omitempty"`
	BG        string `json:"bg,omitempty"`
	Bold      bool   `json:"bold,omitempty"`
	Italic    bool   `json:"italic,omitempty"`
	Underline bool   `json:"underline,omitempty"`
	Dim       bool   `json:"dim,omitempty"`
}

type ViewTreeTableColumn

type ViewTreeTableColumn struct {
	ID    string `json:"id"`
	Title string `json:"title"`
	Align string `json:"align,omitempty"`
}

type VisualTruncateResult

type VisualTruncateResult struct {
	VisualLines  []string
	SkippedCount int
}

func TruncateToVisualLines

func TruncateToVisualLines(text string, maxVisualLines, width, paddingX int) VisualTruncateResult

type WarningSettings

type WarningSettings struct {
	AnthropicExtraUsage bool
}

type WriteTool

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

func NewWriteTool

func NewWriteTool(cwd string, operations ...FileToolOperations) WriteTool

func (WriteTool) Execute

func (t WriteTool) Execute(_ string, input WriteToolInput) (FileToolResult, error)

type WriteToolInput

type WriteToolInput struct {
	Path    string
	Content string
}

Source Files

Jump to

Keyboard shortcuts

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