Documentation
¶
Index ¶
- Constants
- Variables
- func AnsiLinesToHTML(lines []string) string
- func ApplyHTTPProxySettings(httpProxy string) error
- func AreExperimentalFeaturesEnabled() bool
- func AttachJSONLLineReader(reader io.Reader, onLine func(string)) error
- func BuildSDKStreamHeaders(model llm.Model, installTelemetryEnabled bool, ...) map[string]string
- func BuildSystemPrompt(options BuildSystemPromptOptions) string
- func CanonicalizePath(path string) string
- func CheckForNewGiVersion(currentVersion string, options VersionCheckOptions) (string, bool)
- func CheckForNewPiVersion(currentVersion string, options VersionCheckOptions) (string, bool)
- func CheckTmuxKeyboardSetup(ctx context.Context, reader TmuxOptionReader) string
- func CleanPlanStepText(text string) string
- func ClearAPIKeyCache()
- func ClearConfigValueCache()
- func CloseWatcher(watcher FSWatcher)
- func ComparePackageVersions(leftVersion, rightVersion string) (int, bool)
- func ConfigValueEnvVarName(config string) (string, bool)
- func ConfigValueEnvVarNames(config string) []string
- func ConvertImageBytesToPNG(data []byte) ([]byte, bool)
- func CopyToClipboard(text string, options ClipboardCopyOptions) error
- func CreateAgentSessionRuntime(factory CreateAgentSessionRuntimeFactory, options AgentSessionRuntimeOptions) (any, error)
- func DefaultAgentSessionBranchSummarizer(entries []FileEntry, customInstructions string, abort <-chan struct{}) (string, error)
- func DefaultAgentSessionCompactionSummarizer(preparation agentharness.CompactionPreparation, customInstructions string) (agentharness.CompactionResult, error)
- func DefaultAgentSessionResponder(prompt string, context []llm.Message, model llm.Model) (llm.Message, error)
- func DefaultClipboardPasteImageKey() string
- func DefaultSessionExportHTMLName(inputPath string) string
- func DefaultTmuxOptionReader(ctx context.Context, option string) (string, bool)
- func ExpandPath(path string) string
- func ExpandPromptTemplate(text string, templates []PromptTemplate) string
- func ExpandTildePath(path string) string
- func ExportHTMLTemplateCSSWithOptions(options ExportHTMLOptions) string
- func ExportSessionFileToHTML(inputPath, outputPath string) (string, error)
- func ExportSessionFileToHTMLWithOptions(inputPath, outputPath string, options ExportHTMLOptions) (string, error)
- func ExtensionForImageMIMEType(mimeType string) string
- func ExtractDoneSteps(message string) []int
- func FindExactModelReferenceMatch(modelReference string, availableModels []llm.Model) *llm.Model
- func FindMostRecentSession(sessionDir string, cwd ...string) string
- func FormatCWDForFooter(cwd, home string) string
- func FormatDimensionNote(result ResizedImage) string
- func GetAgentDir(cwd ...string) string
- func GetAgentDirSessionDir(cwd, agentDir string) string
- func GetAttributionHeaders(model llm.Model, installTelemetryEnabled bool) map[string]string
- func GetAuthPath(agentDir ...string) string
- func GetBinDir(agentDir ...string) string
- func GetBundledInteractiveAssetPath(name string, envs ...InstallEnvironment) string
- func GetChangelogPath(envs ...InstallEnvironment) string
- func GetCustomThemesDir(agentDir ...string) string
- func GetCwdRelativePath(path, cwd string) (string, bool)
- func GetDebugLogPath(agentDir ...string) string
- func GetDefaultSessionDir(cwd string) (string, error)
- func GetDefaultSessionDirPath(cwd string) (string, error)
- func GetDocsPath(envs ...InstallEnvironment) string
- func GetExamplesPath(envs ...InstallEnvironment) string
- func GetExportTemplateDir(envs ...InstallEnvironment) string
- func GetExtensionTempFolder(agentDir string) (string, error)
- func GetGiUserAgent(version string) string
- func GetInteractiveAssetsDir(envs ...InstallEnvironment) string
- func GetLatestGiVersion(currentVersion string, options VersionCheckOptions) (string, bool)
- func GetLatestPiVersion(currentVersion string, options VersionCheckOptions) (string, bool)
- func GetModelsPath(agentDir ...string) string
- func GetPackageDir(envs ...InstallEnvironment) string
- func GetPackageJSONPath(envs ...InstallEnvironment) string
- func GetPackageJsonPath(envs ...InstallEnvironment) string
- func GetPathCommandArgument(text, command string) (string, bool)
- func GetPiUserAgent(version string) string
- func GetProjectTrustParentPath(cwd string) string
- func GetPromptsDir(agentDir ...string) string
- func GetReadmePath(envs ...InstallEnvironment) string
- func GetResolvedThemeCSSColors(themeName, agentDir string) (map[string]string, error)
- func GetSelfUpdateUnavailableInstruction(packageName string, env InstallEnvironment, _ []string, ...) string
- func GetSelfUpdateUnavailableInstructionForTarget(packageName string, env InstallEnvironment, target SelfUpdatePackageTarget) string
- func GetSessionsDir(agentDir ...string) string
- func GetSettingsPath(agentDir ...string) string
- func GetShareViewerURL(gistID string) string
- func GetThemesDir(envs ...InstallEnvironment) string
- func GetToolsDir(agentDir ...string) string
- func GetUpdateInstruction(packageName string, env InstallEnvironment) string
- func HasSessionName(session SessionInfo) bool
- func HasTrustRequiringProjectResources(cwd string) bool
- func Highlight(code string, options HighlightOptions) string
- func IsAPIKeyLoginProvider(providerID string, oauthProviderIDs, builtInProviderIDs map[string]bool) bool
- func IsAliasModelID(id string) bool
- func IsAnthropicSubscriptionAuthKey(apiKey string) bool
- func IsCommandConfigValue(config string) bool
- func IsConfigValueConfigured(config string, env llm.ProviderEnv) bool
- func IsInstallTelemetryEnabled(settingsManager *SettingsManager) bool
- func IsLocalPath(value string) bool
- func IsNewerPackageVersion(candidateVersion, currentVersion string) bool
- func IsOfficialDistribution(metadata DistributionMetadata) bool
- func IsSafePlanCommand(command string) bool
- func IsValidThinkingLevel(level string) bool
- func IsWaylandSession(env map[string]string) bool
- func LoadProtocolExtensionDescriptors(sources []ProtocolExtensionSource, runtime *ProtocolExtensionRuntime) protocolExtensionDescriptorLoadResult
- func MarkCompletedPlanSteps(message string, items []PlanTodoItem) int
- func MarkPathIgnoredByCloudSync(path string)
- func MergeProviderAttributionHeaders(model llm.Model, context ProviderAttributionContext, ...) map[string]string
- func MigrateKeybindingsConfig(rawConfig map[string]any) (map[string]any, bool)
- func MigrateSessionEntries(entries []FileEntry) bool
- func MissingConfigValueEnvVarNames(config string, env llm.ProviderEnv) []string
- func OfficialPackageNames() []string
- func PackageSourceIdentity(source PackageSource) string
- func ParseCommandArgs(argsString string) []string
- func PreRenderExportHTMLCustomTools(entries []FileEntry, renderer ExportHTMLToolRenderer) map[string]ExportHTMLRenderedTool
- func PrepareEditToolArguments(args any) any
- func PrepareReadToolArguments(args any) any
- func PrepareWriteToolArguments(args any) any
- func ReadClipboardText(ctx context.Context, options ClipboardTextReadOptions) (string, bool)
- func RegisterOAuthProvider(provider OAuthProvider)
- func RenderCustomToolResultHTML(lines []string) string
- func RenderDiff(diffText string) string
- func RenderExportHTMLHeaderModels(models []string) string
- func RenderExportHTMLInlineImage(mimeType, data string) string
- func RenderExportHTMLMarkdownImage(src, alt string) string
- func RenderExportHTMLMarkdownLink(href, text string) string
- func RenderExportHTMLSessionEntryAttrs(entryID string) string
- func RenderExportHTMLTreeMetadata(values map[string]string) string
- func RenderExportHTMLUserMessage(text string) string
- func RenderHighlightedHTML(input string, theme HighlightTheme) string
- func RenderSessionManagerHTML(sessionManager *SessionManager) string
- func RenderSessionManagerHTMLWithOptions(sessionManager *SessionManager, options ExportHTMLOptions) string
- func RenderViewTree(view ViewTreeNode, width int) []string
- func ResetOAuthProviders()
- func ResolveConfigHeaders(headers map[string]string, env llm.ProviderEnv) map[string]string
- func ResolveConfigHeadersOrError(headers map[string]string, description string, env llm.ProviderEnv) (map[string]string, error)
- func ResolveConfigValue(config string) (string, bool)
- func ResolveConfigValueOrError(config, description string, env llm.ProviderEnv) (string, error)
- func ResolveConfigValueUncached(config string) (string, bool)
- func ResolveConfigValueUncachedWithEnv(config string, env llm.ProviderEnv) (string, bool)
- func ResolveConfigValueWithEnv(config string, env llm.ProviderEnv) (string, bool)
- func ResolveProjectTrusted(options ResolveProjectTrustOptions) (bool, error)
- func ResolveReadPath(path, cwd string) (string, error)
- func ResolveThemeSetting(themeSetting string, terminalTheme TerminalTheme) (string, bool)
- func ResolveToCwd(path, cwd string) string
- func RestoreProcessSandboxEnv(isBun bool) bool
- func RestoreSandboxEnv(isBun bool, env map[string]string, readEnviron SandboxEnvReader) bool
- func RunCLI(options CLIOptions) int
- func RunMigrations(agentDir string, cwd ...string) error
- func RunPrintMode(host PrintModeRuntimeHost, options PrintModeOptions) (exitCode int)
- func SerializeJSONLine(record any) (string, error)
- func SessionEntryToContextMessages(entry FileEntry) []llm.Message
- func ShouldRunFirstTimeSetup(settingsPaths ...string) bool
- func ShowFirstTimeSetup(ctx context.Context, settings *SettingsManager, ...) error
- func StripAnsi(value string) string
- func StripFrontmatter(content string) string
- func SubstituteArgs(content string, args []string) string
- func SupportsLanguage(language string) bool
- func TUIThemeSchemaJSON() []byte
- func UnregisterOAuthProvider(providerID string)
- func ValidateSessionID(id string) error
- func ValidateViewTreeNode(node ViewTreeNode) error
- func WithFileMutationQueue(filePath string, fn func() error) error
- func WriteCLIUsage(writer io.Writer, extensionFlags ...ProtocolFlagRegistration)
- func WriteListModels(stdout, stderr io.Writer, registry listModelsRegistry, searchPattern string) error
- type AgentContextUsage
- type AgentSession
- func (s *AgentSession) Abort() error
- func (s *AgentSession) AbortBash()
- func (s *AgentSession) AbortBranchSummary()
- func (s *AgentSession) AbortCompaction()
- func (s *AgentSession) AbortRetry()
- func (s *AgentSession) AppendCustomEntry(customType string, data any) (string, error)
- func (s *AgentSession) CheckCompaction(assistantMessage llm.Message, skipAbortedCheck ...bool) error
- func (s *AgentSession) ClearQueue() (steering, followUp []string)
- func (s *AgentSession) Compact(customInstructions ...string) (agentharness.CompactionResult, error)
- func (s *AgentSession) Dispose()
- func (s *AgentSession) ExecuteBash(command string, options ...AgentSessionBashOptions) (BashResult, error)
- func (s *AgentSession) FollowUp(text string) error
- func (s *AgentSession) FollowUpWithImages(text string, images []llm.ContentPart) error
- func (s *AgentSession) Fork(entryID string) (AgentSessionForkResult, error)
- func (s *AgentSession) ForkAt(entryID string) (AgentSessionForkResult, error)
- func (s *AgentSession) GetActiveLLMTools() []llm.Tool
- func (s *AgentSession) GetActiveToolNames() []string
- func (s *AgentSession) GetActiveTools() []SDKTool
- func (s *AgentSession) GetAllTools() []SDKTool
- func (s *AgentSession) GetContextUsage() *AgentContextUsage
- func (s *AgentSession) GetFollowUpMessages() []string
- func (s *AgentSession) GetFollowUpQueue() []QueuedUserMessage
- func (s *AgentSession) GetSessionStats() AgentSessionStats
- func (s *AgentSession) GetSteeringMessages() []string
- func (s *AgentSession) GetSteeringQueue() []QueuedUserMessage
- func (s *AgentSession) GetUserMessagesForForking() []AgentSessionForkMessage
- func (s *AgentSession) HasAgentQueuedMessages() bool
- func (s *AgentSession) HasPendingBashMessages() bool
- func (s *AgentSession) IsBashRunning() bool
- func (s *AgentSession) IsBranchSummaryRunning() bool
- func (s *AgentSession) IsCompacting() bool
- func (s *AgentSession) IsIdle() bool
- func (s *AgentSession) IsRetrying() bool
- func (s *AgentSession) IsStreaming() bool
- func (s *AgentSession) Messages() []llm.Message
- func (s *AgentSession) NavigateTree(targetID string, options AgentSessionNavigateTreeOptions) (AgentSessionNavigateTreeResult, error)
- func (s *AgentSession) PendingMessageCount() int
- func (s *AgentSession) Prompt(text string) error
- func (s *AgentSession) PromptWithImages(text string, images []llm.ContentPart) error
- func (s *AgentSession) QueueAgentMessage(message llm.Message)
- func (s *AgentSession) QueueExtensionUserMessage(text, deliverAs string) error
- func (s *AgentSession) RecordBashResult(command string, result BashResult, options ...AgentSessionBashRecordOptions)
- func (s *AgentSession) RefreshSystemPrompt()
- func (s *AgentSession) RunAutoCompaction(reason string, willRetry bool) error
- func (s *AgentSession) SendCustomMessage(message QueuedCustomMessage, options ProtocolSendCustomMessageOptions) (returnErr error)
- func (s *AgentSession) SetScopedModels(scopedModels []ScopedModel)
- func (s *AgentSession) SetSessionName(name string) error
- func (s *AgentSession) Steer(text string) error
- func (s *AgentSession) SteerWithImages(text string, images []llm.ContentPart) error
- func (s *AgentSession) Subscribe(listener AgentSessionEventListener) func()
- func (s *AgentSession) SyncRuntimeSettings()
- func (s *AgentSession) WaitForIdle(ctx context.Context) error
- type AgentSessionAutoCompactionRunner
- type AgentSessionBashOptions
- type AgentSessionBashRecordOptions
- type AgentSessionBranchSummarizer
- type AgentSessionCompactionSummarizer
- type AgentSessionContextResourceLoader
- type AgentSessionEvent
- type AgentSessionEventListener
- type AgentSessionForkMessage
- type AgentSessionForkResult
- type AgentSessionNavigateTreeOptions
- type AgentSessionNavigateTreeResult
- type AgentSessionOptions
- type AgentSessionPreflight
- type AgentSessionPromptResourceLoader
- type AgentSessionResourceLoader
- type AgentSessionResponder
- type AgentSessionRetrySettings
- type AgentSessionRuntimeEventListener
- type AgentSessionRuntimeForkOptions
- type AgentSessionRuntimeHost
- func (h *AgentSessionRuntimeHost) Fork(entryID string, options ...AgentSessionRuntimeForkOptions) (AgentSessionForkResult, error)
- func (h *AgentSessionRuntimeHost) NewSession(options ...ProtocolNewSessionOptions) (AgentSessionRuntimeSwitchResult, error)
- func (h *AgentSessionRuntimeHost) OnSessionEvent(listener AgentSessionRuntimeEventListener) func()
- func (h *AgentSessionRuntimeHost) Reload() error
- func (h *AgentSessionRuntimeHost) SetBeforeSessionInvalidate(callback func())
- func (h *AgentSessionRuntimeHost) SetExtensionRuntime(extensionRuntime *ProtocolExtensionRuntime)
- func (h *AgentSessionRuntimeHost) SetRebindSession(callback func(*AgentSession) error)
- func (h *AgentSessionRuntimeHost) SwitchSession(sessionFile string, options ...ProtocolSwitchSessionOptions) (AgentSessionRuntimeSwitchResult, error)
- type AgentSessionRuntimeOptions
- type AgentSessionRuntimeSwitchResult
- type AgentSessionSkillsResult
- type AgentSessionStats
- type AgentSessionStreamResponder
- type AgentSessionSystemPromptResourceLoader
- type AllModelRegistry
- type AnthropicSubscriptionWarningChecker
- type AnthropicWarningSettings
- type Args
- type AssistantContentBlock
- type AssistantMessageComponent
- type AuthCredential
- type AuthSelectorProvider
- type AuthStatus
- type AuthStatusResolver
- type AuthStorage
- func (s *AuthStorage) DeleteCredential(ctx context.Context, providerID string) error
- func (s *AuthStorage) DrainErrors() []error
- func (s *AuthStorage) Get(provider string) (AuthCredential, bool)
- func (s *AuthStorage) GetAPIKey(provider string) (string, bool)
- func (s *AuthStorage) GetAPIKeyWithOptions(provider string, options AuthStorageOptions) (string, bool)
- func (s *AuthStorage) GetAll() AuthStorageData
- func (s *AuthStorage) GetAuthStatus(provider string) AuthStatus
- func (s *AuthStorage) Has(provider string) bool
- func (s *AuthStorage) HasAuth(provider string) bool
- func (s *AuthStorage) HasRuntimeAPIKey(provider string) bool
- func (s *AuthStorage) List() []string
- func (s *AuthStorage) ListCredentials(ctx context.Context) ([]llm.CredentialInfo, error)
- func (s *AuthStorage) ModifyCredential(ctx context.Context, providerID string, modify llm.CredentialModifier) (llm.Credential, bool, error)
- func (s *AuthStorage) ReadCredential(ctx context.Context, providerID string) (llm.Credential, bool, error)
- func (s *AuthStorage) Reload()
- func (s *AuthStorage) Remove(provider string)
- func (s *AuthStorage) RemoveRuntimeAPIKey(provider string)
- func (s *AuthStorage) Set(provider string, credential AuthCredential)
- func (s *AuthStorage) SetFallbackResolver(resolver func(provider string) string)
- func (s *AuthStorage) SetRuntimeAPIKey(provider, apiKey string)
- type AuthStorageBackend
- type AuthStorageData
- type AuthStorageLockFunc
- type AuthStorageOptions
- type AutoThemeSetting
- type AutocompleteEditor
- type AutocompleteProvider
- type AutocompleteProviderFactory
- type BashExecOptions
- type BashExecutionCompleteOptions
- type BashExecutionComponent
- func (b *BashExecutionComponent) AppendOutput(chunk string)
- func (b *BashExecutionComponent) GetCommand() string
- func (b *BashExecutionComponent) GetOutput() string
- func (b *BashExecutionComponent) Invalidate()
- func (b *BashExecutionComponent) Output() string
- func (b *BashExecutionComponent) Render(width int) []string
- func (b *BashExecutionComponent) SetComplete(exitCode int, cancelled bool, options ...BashExecutionCompleteOptions)
- func (b *BashExecutionComponent) SetExpanded(expanded bool)
- type BashExecutionOptions
- type BashExecutorOptions
- type BashLocalOperationsOptions
- type BashOperationResult
- type BashOperations
- type BashResult
- type BashTool
- type BashToolInput
- type BashToolOptions
- type BorderedLoaderComponent
- func (c *BorderedLoaderComponent) Aborted() bool
- func (c *BorderedLoaderComponent) Cancelled() bool
- func (c *BorderedLoaderComponent) Context() context.Context
- func (c *BorderedLoaderComponent) Dispose()
- func (c *BorderedLoaderComponent) HandleInput(data string)
- func (c *BorderedLoaderComponent) Invalidate()
- func (c *BorderedLoaderComponent) Render(width int) []string
- func (c *BorderedLoaderComponent) SetOnAbort(fn func())
- func (c *BorderedLoaderComponent) Signal() context.Context
- type BorderedLoaderOptions
- type BranchSummaryStatusIndicator
- type BuildSystemPromptOptions
- type CLIConfigRuntimeHost
- type CLIInteractiveRuntimeHost
- type CLIInteractiveTUIHost
- func (h *CLIInteractiveTUIHost) AvailableTUIThemes() []TUIThemeInfo
- func (h *CLIInteractiveTUIHost) CurrentTUITheme() string
- func (h *CLIInteractiveTUIHost) EditorCursor() (line, col int, ok bool)
- func (h *CLIInteractiveTUIHost) EditorCustomActive() bool
- func (h *CLIInteractiveTUIHost) EditorFocused() bool
- func (h *CLIInteractiveTUIHost) FocusEditor() error
- func (h *CLIInteractiveTUIHost) InsertEditorText(text string)
- func (h *CLIInteractiveTUIHost) PasteEditorText(text string)
- func (h *CLIInteractiveTUIHost) ReadEditorText() string
- func (h *CLIInteractiveTUIHost) Run() error
- func (h *CLIInteractiveTUIHost) RunContext(ctx context.Context) (runErr error)
- func (h *CLIInteractiveTUIHost) RunTUIDialog(request TUIDialogRequest) (TUIDialogResult, error)
- func (h *CLIInteractiveTUIHost) SetEditorText(text string)
- func (h *CLIInteractiveTUIHost) SetHiddenThinkingLabel(label string) error
- func (h *CLIInteractiveTUIHost) SetTUIStatus(key, text string) error
- func (h *CLIInteractiveTUIHost) SetTUITheme(name string) error
- func (h *CLIInteractiveTUIHost) SetTUITitle(title string) error
- func (h *CLIInteractiveTUIHost) SetTUIToolsExpanded(expanded bool) error
- func (h *CLIInteractiveTUIHost) SetTUIWorking(update TUIWorkingUpdate) error
- func (h *CLIInteractiveTUIHost) Stop()
- func (h *CLIInteractiveTUIHost) SubmitEditorText() error
- func (h *CLIInteractiveTUIHost) TUIToolsExpanded() bool
- type CLIInteractiveTUIHostOptions
- type CLIOptions
- type CLIStartupMigrationResult
- type CacheMiss
- type CacheWasteTotals
- type ClipboardCopyOperations
- type ClipboardCopyOptions
- type ClipboardImage
- type ClipboardImageCommandOptions
- type ClipboardImageCommandResult
- type ClipboardImageOperations
- type ClipboardImageOptions
- type ClipboardTextCommandOptions
- type ClipboardTextReadOperations
- type ClipboardTextReadOptions
- type CodingAgentFauxState
- type CodingAgentTestHarness
- type CodingAgentTestHarnessModelOverride
- type CodingAgentTestHarnessOptions
- type CodingAgentTestHarnessResponse
- type CodingAgentTestHarnessToolCall
- type CodingModelRegistry
- type CompactionStatusIndicator
- type CompactionStatusReason
- type ConfiguredPackage
- type ConvertedImage
- type CountdownTimer
- type CreateAgentSessionRuntimeFactory
- type CustomEntryComponent
- type DefaultAgentSessionResourceLoader
- func (l *DefaultAgentSessionResourceLoader) GetAgentsFiles() ResourceAgentsFilesResult
- func (l *DefaultAgentSessionResourceLoader) GetAppendSystemPrompt() string
- func (l *DefaultAgentSessionResourceLoader) GetPrompts() ResourcePromptsResult
- func (l *DefaultAgentSessionResourceLoader) GetSkills() AgentSessionSkillsResult
- func (l *DefaultAgentSessionResourceLoader) GetSystemPrompt() string
- type DefaultPackageManager
- func (m *DefaultPackageManager) CheckForAvailableUpdates() ([]PackageUpdate, error)
- func (m *DefaultPackageManager) GetInstalledPath(source, scope string) string
- func (m *DefaultPackageManager) GetPackageIdentity(source string) string
- func (m *DefaultPackageManager) Install(source string, project bool) error
- func (m *DefaultPackageManager) ListConfiguredPackages() []ConfiguredPackage
- func (m *DefaultPackageManager) ListPackageResourceToggles() ([]PackageResourceToggleItem, error)
- func (m *DefaultPackageManager) ListResourceToggles() ([]PackageResourceToggleItem, error)
- func (m *DefaultPackageManager) ListTopLevelResourceToggles() []PackageResourceToggleItem
- func (m *DefaultPackageManager) LoadResourceConfigSnapshot() (ResourceConfigSnapshot, error)
- func (m *DefaultPackageManager) ParseSource(source string) PackageSource
- func (m *DefaultPackageManager) ProjectResourceOverrideState(item PackageResourceToggleItem) ProjectResourceOverrideState
- func (m *DefaultPackageManager) Remove(source string, project bool) error
- func (m *DefaultPackageManager) RemoveAndPersist(source string, project bool) (bool, error)
- func (m *DefaultPackageManager) ResolveConfiguredProtocolPackageResources() (ProtocolPackageResources, error)
- func (m *DefaultPackageManager) ResolveExtensionSources(sources []string, options ResolveExtensionSourcesOptions) ([]string, error)
- func (m *DefaultPackageManager) ResolveProtocolPackageResources(sources []string) (ProtocolPackageResources, error)
- func (m *DefaultPackageManager) ResolveProtocolPackageSourceSpecs(specs []ProtocolPackageSourceSpec) (ProtocolPackageResources, error)
- func (m *DefaultPackageManager) RunSelfUpdate(options SelfUpdateOptions) (SelfUpdateResult, error)
- func (m *DefaultPackageManager) SetPackageResourceEnabled(toggle PackageResourceToggle) (bool, error)
- func (m *DefaultPackageManager) SetProgressCallback(callback func(PackageProgressEvent))
- func (m *DefaultPackageManager) SetProjectResourceOverride(target ResourceConfigTarget, state ProjectResourceOverrideState) (bool, error)
- func (m *DefaultPackageManager) SetTopLevelResourceEnabled(toggle TopLevelResourceToggle) (bool, error)
- func (m *DefaultPackageManager) Update(sources ...string) error
- type DefaultProjectTrust
- type DefaultResourceLoader
- func (l *DefaultResourceLoader) ApplyExtensionFlagValues(values map[string]any, allowDeferred bool) []ProtocolExtensionDiscoveryError
- func (l *DefaultResourceLoader) ExtendResources(resources ResourceExtension)
- func (l *DefaultResourceLoader) GetAgentsFiles() ResourceAgentsFilesResult
- func (l *DefaultResourceLoader) GetAppendSystemPrompt() string
- func (l *DefaultResourceLoader) GetExtensions() ResourceExtensionsResult
- func (l *DefaultResourceLoader) GetPrompts() ResourcePromptsResult
- func (l *DefaultResourceLoader) GetSkills() ResourceSkillsResult
- func (l *DefaultResourceLoader) GetSystemPrompt() string
- func (l *DefaultResourceLoader) GetThemes() ResourceThemesResult
- func (l *DefaultResourceLoader) LoadProjectTrustExtensions() ResourceExtensionsResult
- func (l *DefaultResourceLoader) Reload()
- func (l *DefaultResourceLoader) ReloadWithOptions(options ResourceLoaderReloadOptions) error
- type DefaultResourceLoaderOptions
- type Diagnostic
- type DistributionMetadata
- type Edit
- type EditDiffResult
- type EditTool
- type EditToolInput
- type ExportHTMLOptions
- type ExportHTMLRenderedTool
- type ExportHTMLSessionData
- type ExportHTMLSidebarEntry
- type ExportHTMLSkillBlock
- type ExportHTMLToolDefinition
- type ExportHTMLToolRenderResult
- type ExportHTMLToolRenderer
- type ExportHTMLToolRendererDeps
- type ExtensionSelectorComponent
- func (c *ExtensionSelectorComponent) Focused() bool
- func (c *ExtensionSelectorComponent) HandleInput(input string)
- func (c *ExtensionSelectorComponent) Invalidate()
- func (c *ExtensionSelectorComponent) Render(width int) []string
- func (c *ExtensionSelectorComponent) SetFocused(focused bool)
- func (c *ExtensionSelectorComponent) SetTitle(title string)
- func (c *ExtensionSelectorComponent) Title() string
- type ExternalEditorOptions
- type ExternalEditorResult
- type ExternalEditorStatus
- type FSWatchListener
- type FSWatchOptions
- type FSWatcher
- type FileAuthStorageBackend
- type FileEntry
- type FileModelsStore
- func (s *FileModelsStore) DeleteModels(ctx context.Context, providerID string) error
- func (s *FileModelsStore) ReadModels(ctx context.Context, providerID string) (llm.ModelsStoreEntry, bool, error)
- func (s *FileModelsStore) WriteModels(ctx context.Context, providerID string, entry llm.ModelsStoreEntry) error
- type FileToolDetails
- type FileToolOperations
- type FileToolResult
- type FindInitialModelOptions
- type FindTool
- type FindToolInput
- type FirstTimeSetupComponent
- func (c *FirstTimeSetupComponent) Focused() bool
- func (c *FirstTimeSetupComponent) HandleInput(data string)
- func (c *FirstTimeSetupComponent) Invalidate()
- func (c *FirstTimeSetupComponent) Render(width int) []string
- func (c *FirstTimeSetupComponent) SetFocused(focused bool)
- func (c *FirstTimeSetupComponent) State() FirstTimeSetupState
- type FirstTimeSetupEligibility
- type FirstTimeSetupOptions
- type FirstTimeSetupResult
- type FirstTimeSetupRunnerOptions
- type FirstTimeSetupState
- type FirstTimeSetupStep
- type FooterComponent
- type FooterDataProvider
- func (p *FooterDataProvider) ClearExtensionStatuses()
- func (p *FooterDataProvider) Dispose()
- func (p *FooterDataProvider) GetAvailableProviderCount() int
- func (p *FooterDataProvider) GetExtensionStatuses() map[string]string
- func (p *FooterDataProvider) GetGitBranch() string
- func (p *FooterDataProvider) OnBranchChange(callback func()) func()
- func (p *FooterDataProvider) SetAvailableProviderCount(count int)
- func (p *FooterDataProvider) SetCwd(cwd string)
- func (p *FooterDataProvider) SetExtensionStatus(key string, text *string)
- type FooterDataProviderOptions
- type FooterGitBranchResolver
- type FooterState
- type FrontmatterResult
- type GitSource
- type GrepTool
- type GrepToolInput
- type HighlightOptions
- type HighlightTheme
- type HostActionError
- type HostActionRequest
- type HostActionResponse
- type HostPolicyDecision
- type HostPolicyRequest
- type HostPolicyRequester
- type HostPolicyRequesterFunc
- type HostProcessExecutor
- type HostProcessExecutorWithOptions
- type HostProcessOptions
- type HostProcessResult
- type IdleStatus
- type ImageResizeOptions
- type InMemoryAuthStorageBackend
- type InProcessComponentContext
- type InProcessComponentFactory
- type InProcessCustomComponentFactory
- type InProcessCustomDone
- type InProcessCustomHandle
- type InProcessCustomOptions
- type InProcessCustomResult
- type InProcessSlotRegistration
- type InProcessUIRegistry
- func (r *InProcessUIRegistry) OnChange(listener func()) func()
- func (r *InProcessUIRegistry) Remove(key string) bool
- func (r *InProcessUIRegistry) SetEditor(key string, factory InProcessComponentFactory)
- func (r *InProcessUIRegistry) SetFooter(key string, factory InProcessComponentFactory)
- func (r *InProcessUIRegistry) SetHeader(key string, factory InProcessComponentFactory)
- func (r *InProcessUIRegistry) SetOverlay(key string, factory InProcessComponentFactory, options ...gitui.OverlayOptions)
- func (r *InProcessUIRegistry) SetSlot(key, slot string, factory InProcessComponentFactory)
- func (r *InProcessUIRegistry) SetWidget(key, slot string, factory InProcessComponentFactory)
- func (r *InProcessUIRegistry) ShowCustom(key string, factory InProcessCustomComponentFactory, ...) (*InProcessCustomHandle, error)
- func (r *InProcessUIRegistry) Slots() []InProcessSlotRegistration
- type InitialMessageInput
- type InitialMessageResult
- type InitialModelResult
- type InstallEnvironment
- type InstallMethod
- type InteractiveContainer
- type InteractiveContextFile
- type InteractiveDefaultEditor
- type InteractiveEditor
- type InteractiveExpandable
- type InteractiveExtensionResource
- type InteractiveExtensionUIContext
- func (c InteractiveExtensionUIContext) AddAutocompleteProvider(wrapper AutocompleteProviderFactory)
- func (c InteractiveExtensionUIContext) GetToolsExpanded() bool
- func (c InteractiveExtensionUIContext) SetTheme(theme string) InteractiveThemeResult
- func (c InteractiveExtensionUIContext) SetToolsExpanded(expanded bool)
- type InteractiveFlushCompactionOptions
- type InteractiveFooter
- type InteractiveForkOptions
- type InteractiveForkResult
- type InteractiveImportResult
- type InteractiveIndexedTextContainer
- type InteractiveLoadedResources
- type InteractiveMessage
- type InteractiveMode
- func (m *InteractiveMode) CreateExtensionUIContext() InteractiveExtensionUIContext
- func (m *InteractiveMode) FormatLoadedResources(options InteractiveShowLoadedResourcesOptions) string
- func (m *InteractiveMode) GetPathCommandArgument(text, command string) (string, bool)
- func (m *InteractiveMode) HandleCloneCommand() error
- func (m *InteractiveMode) HandleCtrlZ() error
- func (m *InteractiveMode) HandleEvent(event AgentSessionEvent) error
- func (m *InteractiveMode) HandleImportCommand(text string) error
- func (m *InteractiveMode) RenderSessionContext(context SessionContext)
- func (m *InteractiveMode) SetToolsExpanded(expanded bool)
- func (m *InteractiveMode) SetupAutocompleteProvider()
- func (m *InteractiveMode) ShowLoadedResources(options InteractiveShowLoadedResourcesOptions)
- func (m *InteractiveMode) ShowStatusMessage(message string)
- type InteractivePromptResource
- type InteractiveResourceDiagnostic
- type InteractiveRuntimeHost
- type InteractiveSessionLeafProvider
- type InteractiveSettings
- type InteractiveShowLoadedResourcesOptions
- type InteractiveSkillResource
- type InteractiveSourceInfo
- type InteractiveStatusChat
- type InteractiveStopper
- type InteractiveSuspendOperations
- type InteractiveTerminal
- type InteractiveThemeResource
- type InteractiveThemeResult
- type InteractiveThemeSettings
- type InteractiveUI
- type KeybindingsConfig
- type KeybindingsManager
- type LatestGiRelease
- type LatestPiRelease
- type LoadPromptTemplatesOptions
- type LocalHostProcessExecutor
- type LoginDialogComponent
- func (c *LoginDialogComponent) Focused() bool
- func (c *LoginDialogComponent) HandleInput(input string)
- func (c *LoginDialogComponent) Invalidate()
- func (c *LoginDialogComponent) Render(width int) []string
- func (c *LoginDialogComponent) SetFocused(focused bool)
- func (c *LoginDialogComponent) ShowAuth(url string, instructions string, manualPrompt string)
- func (c *LoginDialogComponent) ShowDetails(lines []string)
- func (c *LoginDialogComponent) ShowDeviceCode(verificationURI string, userCode string)
- func (c *LoginDialogComponent) ShowInfo(lines []string, showClose ...bool)
- func (c *LoginDialogComponent) ShowManualInput(message string)
- func (c *LoginDialogComponent) ShowProgress(message string)
- func (c *LoginDialogComponent) ShowPrompt(message string, placeholder string)
- func (c *LoginDialogComponent) ShowWaiting(message string)
- type LsTool
- type LsToolInput
- type MigrationResult
- type MissingSessionCwdError
- type MissingSessionCwdIssue
- type Mode
- type ModelCatalogRefreshFunc
- type ModelCostOverride
- type ModelOverride
- type ModelPatternOptions
- type ModelPriceSource
- type ModelRegistry
- func (r *ModelRegistry) Find(provider, modelID string) (llm.Model, bool)
- func (r *ModelRegistry) GetAPIKeyAndHeaders(model llm.Model) ResolvedRequestAuth
- func (r *ModelRegistry) GetAPIKeyAndHeadersWithOverrides(ctx context.Context, model llm.Model, overrides llm.AuthResolutionOverrides) ResolvedRequestAuth
- func (r *ModelRegistry) GetAPIKeyForProvider(provider string) (string, bool)
- func (r *ModelRegistry) GetAll() []llm.Model
- func (r *ModelRegistry) GetAvailable() []llm.Model
- func (r *ModelRegistry) GetError() string
- func (r *ModelRegistry) GetProviderAuthStatus(provider string) AuthStatus
- func (r *ModelRegistry) GetProviderDisplayName(provider string) string
- func (r *ModelRegistry) GetRegisteredNativeProvider(provider string) (*llm.Provider, bool)
- func (r *ModelRegistry) GetRegisteredProviderConfig(provider string) (ProviderConfigInput, bool)
- func (r *ModelRegistry) GetRegisteredProviderIDs() []string
- func (r *ModelRegistry) HasConfiguredAuth(model llm.Model) bool
- func (r *ModelRegistry) IsUsingOAuth(model llm.Model) bool
- func (r *ModelRegistry) Refresh()
- func (r *ModelRegistry) RefreshModels(ctx context.Context, options ModelRegistryRefreshOptions) llm.ModelsRefreshResult
- func (r *ModelRegistry) RegisterProvider(providerName string, config ProviderConfigInput) error
- func (r *ModelRegistry) UnregisterProvider(providerName string)
- type ModelRegistryOptions
- type ModelRegistryRefreshOptions
- type ModelRuntime
- func (r *ModelRuntime) CheckAuth(ctx context.Context, providerID string) (llm.AuthCheck, bool, error)
- func (r *ModelRuntime) Complete(ctx context.Context, model llm.Model, llmContext llm.Context, ...) (llm.Message, error)
- func (r *ModelRuntime) CompleteSimple(ctx context.Context, model llm.Model, llmContext llm.Context, ...) (llm.Message, error)
- func (r *ModelRuntime) Find(providerID string, modelID string) (llm.Model, bool)
- func (r *ModelRuntime) ForceRefreshAvailability(ctx context.Context) error
- func (r *ModelRuntime) GetAll() []llm.Model
- func (r *ModelRuntime) GetAuth(ctx context.Context, model llm.Model, overrides llm.AuthResolutionOverrides) (*ResolvedRequestAuth, error)
- func (r *ModelRuntime) GetAvailable() []llm.Model
- func (r *ModelRuntime) GetAvailableSnapshot() []llm.Model
- func (r *ModelRuntime) GetCompatibilityRequestConfig(model llm.Model) ProviderRequestConfig
- func (r *ModelRuntime) GetError() string
- func (r *ModelRuntime) GetModel(providerID string, modelID string) (llm.Model, bool)
- func (r *ModelRuntime) GetModels(providerID ...string) []llm.Model
- func (r *ModelRuntime) GetProvider(providerID string) (*llm.Provider, bool)
- func (r *ModelRuntime) GetProviderAuth(ctx context.Context, providerID string) (*llm.AuthResult, error)
- func (r *ModelRuntime) GetProviderAuthStatus(providerID string) AuthStatus
- func (r *ModelRuntime) GetProviders() []*llm.Provider
- func (r *ModelRuntime) GetRegisteredNativeProvider(providerID string) (*llm.Provider, bool)
- func (r *ModelRuntime) GetRegisteredProviderConfig(providerID string) (ProviderConfigInput, bool)
- func (r *ModelRuntime) GetRegisteredProviderIDs() []string
- func (r *ModelRuntime) HasConfiguredAuth(providerID string) bool
- func (r *ModelRuntime) IsUsingOAuth(providerID string) bool
- func (r *ModelRuntime) ListCredentials(ctx context.Context) ([]llm.CredentialInfo, error)
- func (r *ModelRuntime) Login(ctx context.Context, providerID string, credentialType llm.CredentialType, ...) (llm.Credential, error)
- func (r *ModelRuntime) Logout(ctx context.Context, providerID string) error
- func (r *ModelRuntime) ModelRegistry() *ModelRegistry
- func (r *ModelRuntime) Refresh(ctx context.Context, options ModelRegistryRefreshOptions) (llm.ModelsRefreshResult, error)
- func (r *ModelRuntime) RefreshAvailability(ctx context.Context) error
- func (r *ModelRuntime) RegisterNativeProvider(provider *llm.Provider) error
- func (r *ModelRuntime) RegisterProvider(providerID string, config ProviderConfigInput) error
- func (r *ModelRuntime) RemoveRuntimeAPIKey(ctx context.Context, providerID string) error
- func (r *ModelRuntime) SetRuntimeAPIKey(ctx context.Context, providerID string, apiKey string) error
- func (r *ModelRuntime) Stream(ctx context.Context, model llm.Model, llmContext llm.Context, ...) (*llm.AssistantMessageEventStream, error)
- func (r *ModelRuntime) StreamSimple(ctx context.Context, model llm.Model, llmContext llm.Context, ...) (*llm.AssistantMessageEventStream, error)
- func (r *ModelRuntime) UnregisterProvider(providerID string)
- type ModelRuntimeOptions
- type ModelScopeDiagnostic
- type ModelScopeDiagnosticCode
- type ModelScopeDiagnosticType
- type ModelSelectorCallbacks
- type ModelSelectorComponent
- func (c *ModelSelectorComponent) Close()
- func (c *ModelSelectorComponent) Focused() bool
- func (c *ModelSelectorComponent) HandleInput(data string)
- func (c *ModelSelectorComponent) Invalidate()
- func (c *ModelSelectorComponent) Render(width int) []string
- func (c *ModelSelectorComponent) SetFocused(focused bool)
- type ModelSelectorConfig
- type ModelSelectorRuntime
- type NewSessionOptions
- type OAuthProvider
- type OAuthSelector
- type OAuthSelectorComponent
- type PackageCommandOptions
- type PackageManagerOperations
- type PackageManagerOptions
- type PackageProgressEvent
- type PackageResourceConfigOptions
- type PackageResourceToggle
- type PackageResourceToggleItem
- type PackageSource
- type PackageUpdate
- type PackageUpdateChecker
- type PackageUpdateSuggestionError
- type ParsedModelResult
- type PlanTodoItem
- type PrintModeOptions
- type PrintModePromptOptions
- type PrintModeRuntimeHost
- type PrintModeSession
- type ProcessFileArgumentsOptions
- type ProcessImageOptions
- type ProcessImageResult
- type ProcessedFileArguments
- type ProjectResourceOverrideState
- type ProjectTrustOption
- type ProjectTrustPrompt
- type ProjectTrustStore
- func (s *ProjectTrustStore) Clear(cwd string) error
- func (s *ProjectTrustStore) Get(cwd string) (decision bool, found bool, err error)
- func (s *ProjectTrustStore) GetEntry(cwd string) (*ProjectTrustStoreEntry, error)
- func (s *ProjectTrustStore) Path() string
- func (s *ProjectTrustStore) Set(cwd string, decision bool) error
- func (s *ProjectTrustStore) SetMany(updates []ProjectTrustUpdate) error
- type ProjectTrustStoreEntry
- type ProjectTrustUpdate
- type PromptTemplate
- type ProtocolAbortSignal
- type ProtocolAutocompleteItem
- type ProtocolAutocompleteProviderDefinition
- type ProtocolAutocompleteProviderRegistration
- type ProtocolAutocompleteRange
- type ProtocolAutocompleteRequest
- type ProtocolAutocompleteResult
- type ProtocolCommandContext
- func (c ProtocolCommandContext) Fork(entryID string, options ...ProtocolForkOptions) (ProtocolCommandForkResult, error)
- func (c ProtocolCommandContext) NewSession(options ...ProtocolNewSessionOptions) (ProtocolCommandSwitchResult, error)
- func (c ProtocolCommandContext) Reload() error
- func (c ProtocolCommandContext) SendUserMessage(text string, options ...ProtocolSendUserMessageOptions) error
- func (c ProtocolCommandContext) SwitchSession(sessionFile string, options ...ProtocolSwitchSessionOptions) (ProtocolCommandSwitchResult, error)
- func (c ProtocolCommandContext) WaitForIdle() error
- type ProtocolCommandContextActions
- type ProtocolCommandDefinition
- type ProtocolCommandForkResult
- type ProtocolCommandRegistration
- type ProtocolCommandSwitchResult
- type ProtocolCustomMessage
- type ProtocolEntryRenderOptions
- type ProtocolEntryRenderer
- type ProtocolEntryRendererRegistration
- type ProtocolErrorListener
- type ProtocolEventHandler
- type ProtocolEventResult
- type ProtocolExtensionContext
- func (c *ProtocolExtensionContext) GetFlag(name string) any
- func (c *ProtocolExtensionContext) GetSystemPrompt() string
- func (c *ProtocolExtensionContext) IsIdle() bool
- func (c *ProtocolExtensionContext) MountViewTree(mountID, slot string, view ViewTreeNode, options ...ViewTreeMountOptions) error
- func (c *ProtocolExtensionContext) On(eventType string, handler ProtocolEventHandler) error
- func (c *ProtocolExtensionContext) OnInput(handler ProtocolInputHandler) error
- func (c *ProtocolExtensionContext) RegisterAutocompleteProvider(id string, definition ProtocolAutocompleteProviderDefinition) error
- func (c *ProtocolExtensionContext) RegisterCommand(name string, definition ProtocolCommandDefinition) error
- func (c *ProtocolExtensionContext) RegisterEntryRenderer(customType string, renderer ProtocolEntryRenderer) error
- func (c *ProtocolExtensionContext) RegisterFlag(name string, definition ProtocolFlagDefinition) error
- func (c *ProtocolExtensionContext) RegisterMessageRenderer(customType string, renderer ProtocolMessageRenderer) error
- func (c *ProtocolExtensionContext) RegisterProvider(provider string, override ProtocolProviderOverride) error
- func (c *ProtocolExtensionContext) RegisterShortcut(key string, definition ProtocolShortcutDefinition) error
- func (c *ProtocolExtensionContext) RegisterTool(definition ProtocolToolDefinition) error
- func (c *ProtocolExtensionContext) RegisterToolRenderer(toolName string, definition ProtocolToolRendererDefinition) error
- func (c *ProtocolExtensionContext) SendCustomMessage(message ProtocolCustomMessage, options ProtocolSendCustomMessageOptions) error
- func (c *ProtocolExtensionContext) SendUserMessage(text string, options ProtocolSendUserMessageOptions) error
- func (c *ProtocolExtensionContext) SetSessionName(name string) error
- func (c *ProtocolExtensionContext) Signal() *ProtocolAbortSignal
- func (c *ProtocolExtensionContext) UnregisterProvider(provider string) error
- type ProtocolExtensionDiscoveryError
- type ProtocolExtensionDiscoveryResult
- type ProtocolExtensionError
- type ProtocolExtensionFactory
- type ProtocolExtensionFlagDiagnostic
- type ProtocolExtensionProcess
- func (p *ProtocolExtensionProcess) EmitEvent(method string, params map[string]any) error
- func (p *ProtocolExtensionProcess) RequestEvent(ctx context.Context, method string, params any) (json.RawMessage, error)
- func (p *ProtocolExtensionProcess) Start(ctx context.Context, host *RPCSessionHost, timeout time.Duration) error
- func (p *ProtocolExtensionProcess) Stop(ctx context.Context, timeout time.Duration) error
- type ProtocolExtensionProcessSupervisor
- func (s *ProtocolExtensionProcessSupervisor) BindSession(session *AgentSession)
- func (s *ProtocolExtensionProcessSupervisor) DiscoverResources(ctx context.Context, reason, cwd string) (ResourceExtension, error)
- func (s *ProtocolExtensionProcessSupervisor) EmitEvent(method string, params map[string]any) error
- func (s *ProtocolExtensionProcessSupervisor) EmitSessionEvent(event ProtocolSessionEvent) error
- func (s *ProtocolExtensionProcessSupervisor) EmitTerminalInput(data string) error
- func (s *ProtocolExtensionProcessSupervisor) EmitUserBash(ctx context.Context, params map[string]any) (*BashResult, bool, error)
- func (s *ProtocolExtensionProcessSupervisor) Processes() []*ProtocolExtensionProcess
- func (s *ProtocolExtensionProcessSupervisor) Start(ctx context.Context) error
- func (s *ProtocolExtensionProcessSupervisor) Stop(ctx context.Context) error
- type ProtocolExtensionRuntime
- func (r *ProtocolExtensionRuntime) ActiveToolNames() []string
- func (r *ProtocolExtensionRuntime) AppendCustomEntry(customType string, data any) (string, error)
- func (r *ProtocolExtensionRuntime) ApplyToSession(session *AgentSession)
- func (r *ProtocolExtensionRuntime) AutocompleteProviders() []ProtocolAutocompleteProviderRegistration
- func (r *ProtocolExtensionRuntime) BindCommandContext(actions ProtocolCommandContextActions)
- func (r *ProtocolExtensionRuntime) BindHostActionHost(host *RPCSessionHost)
- func (r *ProtocolExtensionRuntime) BindModelRegistry(registry *ModelRegistry)
- func (r *ProtocolExtensionRuntime) BindModelRuntime(runtime *ModelRuntime)
- func (r *ProtocolExtensionRuntime) BindSession(session *AgentSession)
- func (r *ProtocolExtensionRuntime) BindViewTreeHost(host *ViewTreeHost)
- func (r *ProtocolExtensionRuntime) CommandInvocationNames() []string
- func (r *ProtocolExtensionRuntime) CreateCommandContext() ProtocolCommandContext
- func (r *ProtocolExtensionRuntime) EmitBeforeProviderHeaders(ctx context.Context, headers map[string]string, model *llm.Model) map[string]string
- func (r *ProtocolExtensionRuntime) EmitInput(text string, images []llm.ContentPart, source string) ProtocolInputResult
- func (r *ProtocolExtensionRuntime) EmitProjectTrustEvent(context ProtocolProjectTrustContext) (*ProtocolProjectTrustResult, []ProtocolExtensionError)
- func (r *ProtocolExtensionRuntime) EmitSessionEvent(event ProtocolSessionEvent) (ProtocolEventResult, error)
- func (r *ProtocolExtensionRuntime) FlagDiagnostics() []ProtocolExtensionFlagDiagnostic
- func (r *ProtocolExtensionRuntime) FlagValue(name string) any
- func (r *ProtocolExtensionRuntime) Flags() []ProtocolFlagRegistration
- func (r *ProtocolExtensionRuntime) GetActiveTools() []string
- func (r *ProtocolExtensionRuntime) GetCommand(invocationName string) *ProtocolCommandRegistration
- func (r *ProtocolExtensionRuntime) GetEntryRenderer(customType string) ProtocolEntryRenderer
- func (r *ProtocolExtensionRuntime) GetMessageRenderer(customType string) ProtocolMessageRenderer
- func (r *ProtocolExtensionRuntime) GetModelRegistry() *ModelRegistry
- func (r *ProtocolExtensionRuntime) GetRegisteredToolDefinition(toolName string) ToolDefinition
- func (r *ProtocolExtensionRuntime) GetSystemPrompt() string
- func (r *ProtocolExtensionRuntime) GetToolRenderer(toolName string) *ProtocolToolRendererRegistration
- func (r *ProtocolExtensionRuntime) HasHandlers(eventType string) bool
- func (r *ProtocolExtensionRuntime) InvalidateCommandContexts()
- func (r *ProtocolExtensionRuntime) LoadFactories(factories []ProtocolExtensionFactory) error
- func (r *ProtocolExtensionRuntime) OnAutocompleteProvidersChanged(callback func()) func()
- func (r *ProtocolExtensionRuntime) OnCommandsChanged(callback func()) func()
- func (r *ProtocolExtensionRuntime) OnError(listener ProtocolErrorListener) func()
- func (r *ProtocolExtensionRuntime) OnMessageRenderersChanged(callback func()) func()
- func (r *ProtocolExtensionRuntime) OrderSources(sources []ProtocolSourceInfo)
- func (r *ProtocolExtensionRuntime) PendingProviderRegistrations() []ProtocolProviderRegistration
- func (r *ProtocolExtensionRuntime) RegisteredCommands() []ProtocolCommandRegistration
- func (r *ProtocolExtensionRuntime) RegisteredTools() []SDKTool
- func (r *ProtocolExtensionRuntime) RemoveSource(source ProtocolSourceInfo)
- func (r *ProtocolExtensionRuntime) SendCustomMessage(message ProtocolCustomMessage, options ProtocolSendCustomMessageOptions) error
- func (r *ProtocolExtensionRuntime) SendUserMessage(text string, options ProtocolSendUserMessageOptions) error
- func (r *ProtocolExtensionRuntime) SessionEntries() []FileEntry
- func (r *ProtocolExtensionRuntime) SetAbortSignal(done <-chan struct{})
- func (r *ProtocolExtensionRuntime) SetCLIFlagValues(values map[string]any) []ProtocolExtensionFlagDiagnostic
- func (r *ProtocolExtensionRuntime) SetFlagValue(name string, value any)
- func (r *ProtocolExtensionRuntime) SetSessionName(name string) error
- func (r *ProtocolExtensionRuntime) Shortcuts(keybindings KeybindingsConfig) ProtocolShortcutsResult
- func (r *ProtocolExtensionRuntime) SuggestAutocomplete(ctx context.Context, request ProtocolAutocompleteRequest) (ProtocolAutocompleteResult, error)
- func (r *ProtocolExtensionRuntime) UnknownCLIFlagDiagnostics() []ProtocolExtensionFlagDiagnostic
- func (r *ProtocolExtensionRuntime) ViewTreeMounts() []ProtocolViewTreeMountRegistration
- type ProtocolExtensionSource
- type ProtocolFlagDefinition
- type ProtocolFlagRegistration
- type ProtocolForkOptions
- type ProtocolInputEvent
- type ProtocolInputHandler
- type ProtocolInputResult
- type ProtocolMessageRenderer
- type ProtocolMessageRendererRegistration
- type ProtocolNewSessionOptions
- type ProtocolPackageProcessExtension
- type ProtocolPackageResource
- type ProtocolPackageResourceFilters
- type ProtocolPackageResources
- type ProtocolPackageSourceSpec
- type ProtocolProjectTrustContext
- type ProtocolProjectTrustDecision
- type ProtocolProjectTrustResult
- type ProtocolProviderOverride
- type ProtocolProviderRegistration
- type ProtocolRuntimeError
- type ProtocolSendCustomMessageOptions
- type ProtocolSendUserMessageOptions
- type ProtocolSessionEvent
- type ProtocolShortcutDefinition
- type ProtocolShortcutRegistration
- type ProtocolShortcutWarning
- type ProtocolShortcutsResult
- type ProtocolSourceInfo
- type ProtocolSwitchSessionOptions
- type ProtocolToolDefinition
- type ProtocolToolRendererDefinition
- type ProtocolToolRendererRegistration
- type ProtocolViewTreeMountRegistration
- type ProviderAttributionContext
- type ProviderConfigInput
- type ProviderModelDefinition
- type ProviderRequestConfig
- type ProviderRequestSettings
- type ProviderRetrySettings
- type QueuedCustomMessage
- type QueuedUserMessage
- type RPCAvailableModelsResult
- type RPCClient
- func (c *RPCClient) Abort(ctx context.Context) error
- func (c *RPCClient) AbortBash(ctx context.Context) error
- func (c *RPCClient) AbortRetry(ctx context.Context) error
- func (c *RPCClient) Bash(ctx context.Context, command string) (BashResult, error)
- func (c *RPCClient) Clone(ctx context.Context) (RPCCloneResult, error)
- func (c *RPCClient) Compact(ctx context.Context, customInstructions string) (agentharness.CompactionResult, error)
- func (c *RPCClient) CycleModel(ctx context.Context) (*RPCCycleModelResult, error)
- func (c *RPCClient) CycleThinkingLevel(ctx context.Context) (*RPCThinkingLevelResult, error)
- func (c *RPCClient) ExportHTML(ctx context.Context, outputPath string) (RPCExportHTMLResult, error)
- func (c *RPCClient) FollowUp(ctx context.Context, message string) error
- func (c *RPCClient) FollowUpWithImages(ctx context.Context, message string, images []llm.ContentPart) error
- func (c *RPCClient) Fork(ctx context.Context, entryID string) (RPCForkResult, error)
- func (c *RPCClient) GetAvailableModels(ctx context.Context) ([]llm.Model, error)
- func (c *RPCClient) GetAvailableThinkingLevels(ctx context.Context) ([]string, error)
- func (c *RPCClient) GetCommands(ctx context.Context) ([]RPCSlashCommand, error)
- func (c *RPCClient) GetEntries(ctx context.Context, since ...string) (RPCEntriesResult, error)
- func (c *RPCClient) GetForkMessages(ctx context.Context) ([]AgentSessionForkMessage, error)
- func (c *RPCClient) GetLastAssistantText(ctx context.Context) (*string, error)
- func (c *RPCClient) GetMessages(ctx context.Context) ([]llm.Message, error)
- func (c *RPCClient) GetSessionStats(ctx context.Context) (RPCSessionStats, error)
- func (c *RPCClient) GetState(ctx context.Context) (RPCSessionState, error)
- func (c *RPCClient) GetStderr() string
- func (c *RPCClient) GetTree(ctx context.Context) (RPCTreeResult, error)
- func (c *RPCClient) NewSession(ctx context.Context, parentSession string) (RPCCloneResult, error)
- func (c *RPCClient) OnEvent(listener func(AgentSessionEvent)) func()
- func (c *RPCClient) Prompt(ctx context.Context, message string) error
- func (c *RPCClient) PromptWithImages(ctx context.Context, message string, images []llm.ContentPart) error
- func (c *RPCClient) SetAutoCompaction(ctx context.Context, enabled bool) error
- func (c *RPCClient) SetAutoRetry(ctx context.Context, enabled bool) error
- func (c *RPCClient) SetFollowUpMode(ctx context.Context, mode string) error
- func (c *RPCClient) SetModel(ctx context.Context, provider, modelID string) (llm.Model, error)
- func (c *RPCClient) SetSessionName(ctx context.Context, name string) error
- func (c *RPCClient) SetSteeringMode(ctx context.Context, mode string) error
- func (c *RPCClient) SetThinkingLevel(ctx context.Context, level string) error
- func (c *RPCClient) Start(ctx context.Context) error
- func (c *RPCClient) Steer(ctx context.Context, message string) error
- func (c *RPCClient) SteerWithImages(ctx context.Context, message string, images []llm.ContentPart) error
- func (c *RPCClient) Stop(ctx context.Context) error
- func (c *RPCClient) SwitchSession(ctx context.Context, sessionPath string) (RPCCloneResult, error)
- type RPCCloneResult
- type RPCCommand
- type RPCCommandSender
- type RPCCommandSenderFunc
- type RPCCommandsResult
- type RPCCycleModelResult
- type RPCEntriesResult
- type RPCExportHTMLResult
- type RPCForkMessagesResult
- type RPCForkResult
- type RPCLastAssistantTextResult
- type RPCLineProcessor
- type RPCMessagesResult
- type RPCProcessExitError
- type RPCProcessOptions
- type RPCProcessTransport
- func (t *RPCProcessTransport) GetStderr() string
- func (t *RPCProcessTransport) OnEvent(listener func(AgentSessionEvent)) func()
- func (t *RPCProcessTransport) SendRPCCommand(ctx context.Context, command RPCCommand) (RPCResponse, error)
- func (t *RPCProcessTransport) Start(ctx context.Context) error
- func (t *RPCProcessTransport) Stop(ctx context.Context) error
- type RPCResponse
- type RPCScopedModel
- type RPCSessionHost
- func (h *RPCSessionHost) AcceptPrompt(command RPCCommand) error
- func (h *RPCSessionHost) Bash(ctx context.Context, command string) (BashResult, error)
- func (h *RPCSessionHost) Clone() (RPCCloneResult, error)
- func (h *RPCSessionHost) CycleModel() (*RPCCycleModelResult, error)
- func (h *RPCSessionHost) CycleModelDirection(direction string) (*RPCCycleModelResult, error)
- func (h *RPCSessionHost) CycleThinkingLevel() (string, error)
- func (h *RPCSessionHost) ExportHTML(outputPath string) (string, error)
- func (h *RPCSessionHost) ExportJSONL(outputPath string) (string, error)
- func (h *RPCSessionHost) Fork(entryID string) (RPCForkResult, error)
- func (h *RPCSessionHost) GetAvailableThinkingLevels() []string
- func (h *RPCSessionHost) GetCommands() RPCCommandsResult
- func (h *RPCSessionHost) GetEntries(since *string) (RPCEntriesResult, error)
- func (h *RPCSessionHost) GetLastAssistantText() *string
- func (h *RPCSessionHost) GetSessionStats() RPCSessionStats
- func (h *RPCSessionHost) GetState() RPCSessionState
- func (h *RPCSessionHost) GetTree() (RPCTreeResult, error)
- func (h *RPCSessionHost) HandleCommand(ctx context.Context, command RPCCommand) RPCResponse
- func (h *RPCSessionHost) HandleHostAction(request HostActionRequest) HostActionResponse
- func (h *RPCSessionHost) HandleHostActionContext(ctx context.Context, request HostActionRequest) HostActionResponse
- func (h *RPCSessionHost) OnSessionReplaced(listener func(*AgentSession)) func()
- func (h *RPCSessionHost) SetAutoCompaction(enabled *bool) error
- func (h *RPCSessionHost) SetAutoRetry(enabled *bool) error
- func (h *RPCSessionHost) SetFollowUpMode(mode string) error
- func (h *RPCSessionHost) SetModel(provider, modelID string) (llm.Model, error)
- func (h *RPCSessionHost) SetSteeringMode(mode string) error
- func (h *RPCSessionHost) SetThinkingLevel(level string) error
- func (h *RPCSessionHost) SubscribeEvents(listener func(AgentSessionEvent)) func()
- func (h *RPCSessionHost) SwitchSession(sessionPath string) (RPCCloneResult, error)
- type RPCSessionState
- type RPCSessionStats
- type RPCSessionTokens
- type RPCSlashCommand
- type RPCThinkingLevelResult
- type RPCThinkingLevelsResult
- type RPCTreeResult
- type ReadTool
- type ReadToolInput
- type ReadToolOptions
- type ReadToolTruncation
- type ResizedImage
- type ResolveCLIModelOptions
- type ResolveCLIModelResult
- type ResolveExtensionSourcesOptions
- type ResolveModelScopeResult
- type ResolveProjectTrustOptions
- type ResolvedRequestAuth
- type ResourceAgentsFilesResult
- type ResourceConfigSnapshot
- func (s ResourceConfigSnapshot) InheritedEnabled(item PackageResourceToggleItem) (bool, bool)
- func (s ResourceConfigSnapshot) IsInherited(item PackageResourceToggleItem) bool
- func (s ResourceConfigSnapshot) Items(scope ResourceConfigWriteScope) []PackageResourceToggleItem
- func (s ResourceConfigSnapshot) Target(item PackageResourceToggleItem) ResourceConfigTarget
- type ResourceConfigTarget
- type ResourceConfigWriteScope
- type ResourceContextFile
- type ResourceExtension
- type ResourceExtensionPath
- type ResourceExtensionsResult
- type ResourceLoaderProjectTrustInput
- type ResourceLoaderReloadOptions
- type ResourcePromptPath
- type ResourcePromptsResult
- type ResourceSkillPath
- type ResourceSkillsResult
- type ResourceTheme
- type ResourceThemePath
- type ResourceThemesResult
- type RetryStatusIndicator
- type SDKAgent
- type SDKAgentState
- type SDKContentPart
- type SDKTool
- type SDKToolResult
- type SandboxEnvReader
- type ScopedModel
- type ScopedModelsSelectorCallbacks
- type ScopedModelsSelectorComponent
- func (c *ScopedModelsSelectorComponent) EnabledModelIDs() []string
- func (c *ScopedModelsSelectorComponent) Focused() bool
- func (c *ScopedModelsSelectorComponent) HandleInput(data string)
- func (c *ScopedModelsSelectorComponent) Invalidate()
- func (c *ScopedModelsSelectorComponent) Render(width int) []string
- func (c *ScopedModelsSelectorComponent) SetFocused(focused bool)
- type ScopedModelsSelectorConfig
- type SelfUpdateCommand
- type SelfUpdateCommandStep
- type SelfUpdateOptions
- type SelfUpdatePackageTarget
- type SelfUpdateResult
- type SessionContext
- type SessionContextOptions
- type SessionEntriesSnapshot
- type SessionHeader
- type SessionHeaderScanLimitError
- type SessionImportFileNotFoundError
- type SessionInfo
- type SessionListProgress
- type SessionManager
- func ContinueRecentSession(cwd string, sessionDir ...string) (*SessionManager, error)
- func CreateSessionManager(cwd string, sessionDir ...string) (*SessionManager, error)
- func CreateSessionManagerWithOptions(cwd, sessionDir string, options NewSessionOptions) (*SessionManager, error)
- func ForkSessionFrom(sourcePath, targetCwd string, sessionDir ...string) (*SessionManager, error)
- func ForkSessionFromWithOptions(sourcePath, targetCwd string, options NewSessionOptions, sessionDir ...string) (*SessionManager, error)
- func InMemorySessionManager(cwd ...string) (*SessionManager, error)
- func InMemorySessionManagerWithOptions(cwd string, options NewSessionOptions) (*SessionManager, error)
- func OpenSessionManager(path string, args ...string) (*SessionManager, error)
- func (s *SessionManager) AppendCompaction(summary, firstKeptEntryID string, tokensBefore int) string
- func (s *SessionManager) AppendCompactionWithOptions(summary, firstKeptEntryID string, tokensBefore int, ...) string
- func (s *SessionManager) AppendCustomEntry(customType string, data any) string
- func (s *SessionManager) AppendCustomMessageEntry(customType string, content any, display bool, details any) string
- func (s *SessionManager) AppendCustomMessageEntryWithContext(customType string, content any, display bool, details any, ...) string
- func (s *SessionManager) AppendLabelChange(targetID, label string) (string, error)
- func (s *SessionManager) AppendMessage(message any) string
- func (s *SessionManager) AppendModelChange(provider, modelID string) string
- func (s *SessionManager) AppendSessionInfo(name string) string
- func (s *SessionManager) AppendThinkingLevelChange(thinkingLevel string) string
- func (s *SessionManager) Branch(branchFromID string) error
- func (s *SessionManager) BranchWithSummary(branchFromID *string, summary string) (string, error)
- func (s *SessionManager) BranchWithSummaryOptions(branchFromID *string, summary string, options SessionSummaryOptions) (string, error)
- func (s *SessionManager) BuildContextEntries() []FileEntry
- func (s *SessionManager) BuildSessionContext() SessionContext
- func (s *SessionManager) BuildSessionContextWithOptions(options SessionContextOptions) SessionContext
- func (s *SessionManager) CreateBranchedSession(leafID string) (string, error)
- func (s *SessionManager) ForkAtEntry(entryID string) (*SessionManager, error)
- func (s *SessionManager) ForkBeforeEntry(entryID string) (*SessionManager, error)
- func (s *SessionManager) GetBranch(fromID ...string) []FileEntry
- func (s *SessionManager) GetCWD() string
- func (s *SessionManager) GetChildren(parentID string) []FileEntry
- func (s *SessionManager) GetCwd() string
- func (s *SessionManager) GetEntries() []FileEntry
- func (s *SessionManager) GetEntriesSnapshot() SessionEntriesSnapshot
- func (s *SessionManager) GetEntry(id string) *FileEntry
- func (s *SessionManager) GetHeader() *SessionHeader
- func (s *SessionManager) GetLabel(id string) (string, bool)
- func (s *SessionManager) GetLeafEntry() *FileEntry
- func (s *SessionManager) GetLeafID() *string
- func (s *SessionManager) GetLeafId() *string
- func (s *SessionManager) GetSessionDir() string
- func (s *SessionManager) GetSessionFile() string
- func (s *SessionManager) GetSessionID() string
- func (s *SessionManager) GetSessionId() string
- func (s *SessionManager) GetSessionName() string
- func (s *SessionManager) GetTree() []*SessionTreeNode
- func (s *SessionManager) GetTreeSnapshot() SessionTreeSnapshot
- func (s *SessionManager) IsPersisted() bool
- func (s *SessionManager) NewSession(options ...NewSessionOptions) (string, error)
- func (s *SessionManager) ResetLeaf()
- func (s *SessionManager) SetSessionFile(sessionFile string) error
- func (s *SessionManager) UsesDefaultSessionDir() bool
- type SessionModel
- type SessionSelectorComponent
- func (s *SessionSelectorComponent) GetSessionList() *SessionSelectorComponent
- func (s *SessionSelectorComponent) HandleInput(input string)
- func (s *SessionSelectorComponent) Invalidate()
- func (s *SessionSelectorComponent) IsAllLoading() bool
- func (s *SessionSelectorComponent) Render(width int) []string
- func (s *SessionSelectorComponent) Scope() string
- func (s *SessionSelectorComponent) SetNameFilter(filter SessionSelectorNameFilter)
- func (s *SessionSelectorComponent) SetSortMode(mode SessionSelectorSortMode)
- type SessionSelectorLoader
- type SessionSelectorNameFilter
- type SessionSelectorOptions
- type SessionSelectorSortMode
- type SessionSummaryOptions
- type SessionTreeNode
- type SessionTreeSnapshot
- type SettingsError
- type SettingsManager
- func (s *SettingsManager) ApplyFirstTimeSetup(result FirstTimeSetupResult) error
- func (s *SettingsManager) DrainErrors() []SettingsError
- func (s *SettingsManager) Flush() error
- func (s *SettingsManager) GetAutocompleteMaxVisible() int
- func (s *SettingsManager) GetBlockImages() bool
- func (s *SettingsManager) GetBranchSummarySkipPrompt() bool
- func (s *SettingsManager) GetClearOnShrink() bool
- func (s *SettingsManager) GetCollapseChangelog() bool
- func (s *SettingsManager) GetCompactionEnabled() bool
- func (s *SettingsManager) GetCompactionKeepRecentTokens() int
- func (s *SettingsManager) GetCompactionReserveTokens() int
- func (s *SettingsManager) GetCompactionSettings() agentharness.CompactionSettings
- func (s *SettingsManager) GetDefaultModel() string
- func (s *SettingsManager) GetDefaultProjectTrust() DefaultProjectTrust
- func (s *SettingsManager) GetDefaultProvider() string
- func (s *SettingsManager) GetDefaultThinkingLevel() string
- func (s *SettingsManager) GetDoubleEscapeAction() string
- func (s *SettingsManager) GetEditorPaddingX() int
- func (s *SettingsManager) GetEnableAnalytics() bool
- func (s *SettingsManager) GetEnableInstallTelemetry() bool
- func (s *SettingsManager) GetEnableSkillCommands() bool
- func (s *SettingsManager) GetEnabledModels() []string
- func (s *SettingsManager) GetExtensionPaths() []string
- func (s *SettingsManager) GetExternalEditorCommand() string
- func (s *SettingsManager) GetFollowUpMode() string
- func (s *SettingsManager) GetGlobalSettings() map[string]any
- func (s *SettingsManager) GetHTTPIdleTimeoutMS() int
- func (s *SettingsManager) GetHTTPProxy() string
- func (s *SettingsManager) GetHideThinkingBlock() bool
- func (s *SettingsManager) GetImageAutoResize() bool
- func (s *SettingsManager) GetImageWidthCells() int
- func (s *SettingsManager) GetLastChangelogVersion() string
- func (s *SettingsManager) GetOutputPad() int
- func (s *SettingsManager) GetPackages() []any
- func (s *SettingsManager) GetProjectSettings() map[string]any
- func (s *SettingsManager) GetProviderRetrySettings() ProviderRetrySettings
- func (s *SettingsManager) GetQuietStartup() bool
- func (s *SettingsManager) GetRetryEnabled() bool
- func (s *SettingsManager) GetRetrySettings() AgentSessionRetrySettings
- func (s *SettingsManager) GetSessionDir() string
- func (s *SettingsManager) GetShellCommandPrefix() string
- func (s *SettingsManager) GetShowCacheMissNotices() bool
- func (s *SettingsManager) GetShowHardwareCursor() bool
- func (s *SettingsManager) GetShowImages() bool
- func (s *SettingsManager) GetShowTerminalProgress() bool
- func (s *SettingsManager) GetSteeringMode() string
- func (s *SettingsManager) GetTheme() string
- func (s *SettingsManager) GetThemeSetting() (string, bool)
- func (s *SettingsManager) GetTrackingID() string
- func (s *SettingsManager) GetTransport() string
- func (s *SettingsManager) GetTreeFilterMode() string
- func (s *SettingsManager) GetWarnings() WarningSettings
- func (s *SettingsManager) HTTPIdleTimeout() (time.Duration, error)
- func (s *SettingsManager) IsProjectTrusted() bool
- func (s *SettingsManager) Reload()
- func (s *SettingsManager) SetAutocompleteMaxVisible(visible int)
- func (s *SettingsManager) SetBlockImages(blocked bool)
- func (s *SettingsManager) SetBranchSummarySkipPrompt(skip bool)
- func (s *SettingsManager) SetClearOnShrink(enabled bool)
- func (s *SettingsManager) SetCollapseChangelog(collapsed bool)
- func (s *SettingsManager) SetCompactionEnabled(enabled bool)
- func (s *SettingsManager) SetDefaultModel(model string)
- func (s *SettingsManager) SetDefaultProjectTrust(defaultProjectTrust DefaultProjectTrust)
- func (s *SettingsManager) SetDefaultProvider(provider string)
- func (s *SettingsManager) SetDefaultThinkingLevel(level string)
- func (s *SettingsManager) SetDoubleEscapeAction(action string)
- func (s *SettingsManager) SetEditorPaddingX(padding int)
- func (s *SettingsManager) SetEnableAnalytics(enabled bool)
- func (s *SettingsManager) SetEnableInstallTelemetry(enabled bool)
- func (s *SettingsManager) SetEnableSkillCommands(enabled bool)
- func (s *SettingsManager) SetEnabledModels(models []string)
- func (s *SettingsManager) SetFollowUpMode(mode string)
- func (s *SettingsManager) SetHTTPIdleTimeoutMS(timeoutMS int) error
- func (s *SettingsManager) SetHideThinkingBlock(hidden bool)
- func (s *SettingsManager) SetImageAutoResize(enabled bool)
- func (s *SettingsManager) SetImageWidthCells(width int)
- func (s *SettingsManager) SetLastChangelogVersion(version string)
- func (s *SettingsManager) SetOutputPad(padding int)
- func (s *SettingsManager) SetPackages(packages []any)
- func (s *SettingsManager) SetProjectExtensionPaths(paths []string) error
- func (s *SettingsManager) SetProjectPackages(packages []any) error
- func (s *SettingsManager) SetProjectPromptTemplatePaths(paths []string) error
- func (s *SettingsManager) SetProjectSkillPaths(paths []string) error
- func (s *SettingsManager) SetProjectThemePaths(paths []string) error
- func (s *SettingsManager) SetProjectTrusted(trusted bool)
- func (s *SettingsManager) SetQuietStartup(enabled bool)
- func (s *SettingsManager) SetRetryEnabled(enabled bool)
- func (s *SettingsManager) SetShowCacheMissNotices(show bool)
- func (s *SettingsManager) SetShowHardwareCursor(enabled bool)
- func (s *SettingsManager) SetShowImages(enabled bool)
- func (s *SettingsManager) SetShowTerminalProgress(enabled bool)
- func (s *SettingsManager) SetSteeringMode(mode string)
- func (s *SettingsManager) SetTheme(theme string)
- func (s *SettingsManager) SetTransport(transport string)
- func (s *SettingsManager) SetTreeFilterMode(mode string)
- func (s *SettingsManager) SetWarningAnthropicExtraUsage(enabled bool)
- func (s *SettingsManager) SetWarnings(warnings WarningSettings)
- func (s *SettingsManager) WebSocketConnectTimeout() (*time.Duration, error)
- type SettingsManagerOptions
- type SourceInfo
- type StatusIndicator
- type StatusIndicatorKind
- type SystemPromptContextFile
- type SystemPromptDocumentationPath
- type SystemPromptSkill
- type TUIDialogHost
- type TUIDialogOption
- type TUIDialogRequest
- type TUIDialogResult
- type TUIEditorCursorHost
- type TUIEditorCustomStateHost
- type TUIEditorFocusHost
- type TUIEditorHost
- type TUIEditorPasteHost
- type TUIRenderRequester
- type TUIStatusHost
- type TUIThemeHost
- type TUIThemeInfo
- type TUIThinkingLabelHost
- type TUITitleHost
- type TUIToolExpansionHost
- type TUIWorkingHost
- type TUIWorkingIndicatorOptions
- type TUIWorkingUpdate
- type TerminalAutoThemeDetector
- type TerminalBackgroundThemeDetector
- type TerminalTheme
- type TerminalThemeDetection
- type ThemeExportColors
- type ThinkingLevel
- type TmuxOptionReader
- type ToolCallRenderer
- type ToolDefinition
- func CreateBashToolDefinition(cwd string, options ...BashToolOptions) ToolDefinition
- func CreateEditToolDefinition(cwd string, operations ...FileToolOperations) ToolDefinition
- func CreateReadToolDefinition(cwd string, operations ...FileToolOperations) ToolDefinition
- func CreateWriteToolDefinition(cwd string, operations ...FileToolOperations) ToolDefinition
- type ToolExecutionComponent
- func (c *ToolExecutionComponent) Invalidate()
- func (c *ToolExecutionComponent) MarkExecutionStarted()
- func (c *ToolExecutionComponent) Render(width int) []string
- func (c *ToolExecutionComponent) SetArgsComplete()
- func (c *ToolExecutionComponent) SetExpanded(expanded bool)
- func (c *ToolExecutionComponent) SetImageWidthCells(width int)
- func (c *ToolExecutionComponent) SetShowImages(show bool)
- func (c *ToolExecutionComponent) UpdateArgs(args any)
- func (c *ToolExecutionComponent) UpdatePartialResult(result FileToolResult, isError bool) bool
- func (c *ToolExecutionComponent) UpdateResult(result FileToolResult, isError bool) bool
- func (c *ToolExecutionComponent) UpdateResultWithOptions(result FileToolResult, isError, isPartial bool) bool
- type ToolExecutionOptions
- type ToolRenderContext
- type ToolRenderResultOptions
- type ToolResultRenderer
- type TopLevelResourceToggle
- type TreeSelectorComponent
- func (s *TreeSelectorComponent) Focused() bool
- func (s *TreeSelectorComponent) GetTreeList() *TreeSelectorList
- func (s *TreeSelectorComponent) HandleInput(input string)
- func (s *TreeSelectorComponent) Invalidate()
- func (s *TreeSelectorComponent) Render(width int) []string
- func (s *TreeSelectorComponent) SetFilter(filter TreeSelectorFilter)
- func (s *TreeSelectorComponent) SetFocused(focused bool)
- func (s *TreeSelectorComponent) SetSelectedID(entryID string)
- type TreeSelectorFilter
- type TreeSelectorHelp
- type TreeSelectorList
- func (l *TreeSelectorList) CopySelected()
- func (l *TreeSelectorList) GetSearchQuery() string
- func (l *TreeSelectorList) GetSelectedNode() *SessionTreeNode
- func (l *TreeSelectorList) Invalidate()
- func (l *TreeSelectorList) Render(width int) []string
- func (l *TreeSelectorList) UpdateNodeLabel(entryID, label string)
- type TreeSelectorOptions
- type TriggerCompactExtension
- type UsageCostBreakdownEntry
- type UserMessageComponent
- type UserMessageSelectorComponent
- type VersionCheckOptions
- type VersionReleaseChecker
- type ViewTreeChange
- type ViewTreeComponent
- type ViewTreeEvent
- type ViewTreeFocus
- type ViewTreeHost
- func (h *ViewTreeHost) Blur(mountID, nodeID string) error
- func (h *ViewTreeHost) DispatchEvent(mountID, nodeID, event string, data map[string]any) error
- func (h *ViewTreeHost) DispatchResize(width, height int) error
- func (h *ViewTreeHost) DispatchThemeChange(name string) error
- func (h *ViewTreeHost) DispatchTick(frame int64) error
- func (h *ViewTreeHost) DispatchVisibilityChange(mountID string, visible bool, reason string) error
- func (h *ViewTreeHost) Events() []ViewTreeEvent
- func (h *ViewTreeHost) Focus(mountID, nodeID string) error
- func (h *ViewTreeHost) Focused() ViewTreeFocus
- func (h *ViewTreeHost) HasEventSubscription(event string) bool
- func (h *ViewTreeHost) Mount(mountID, slot string, view ViewTreeNode) error
- func (h *ViewTreeHost) MountWithOptions(mountID, slot string, view ViewTreeNode, options ...ViewTreeMountOptions) error
- func (h *ViewTreeHost) Mounted(mountID string) (ViewTreeMount, bool)
- func (h *ViewTreeHost) MountsBySlot(slot string) []ViewTreeMount
- func (h *ViewTreeHost) OnChange(listener func(ViewTreeChange)) func()
- func (h *ViewTreeHost) OnEvent(listener func(ViewTreeEvent)) func()
- func (h *ViewTreeHost) Patch(mountID string, ops []ViewTreePatchOperation) error
- func (h *ViewTreeHost) RenderMount(mountID string, width int) ([]string, error)
- func (h *ViewTreeHost) SetStatus(key, text string, priority int) error
- func (h *ViewTreeHost) Unmount(mountID string) bool
- type ViewTreeItem
- type ViewTreeListItem
- type ViewTreeMount
- type ViewTreeMountOptions
- type ViewTreeNode
- type ViewTreeOverlayMargin
- type ViewTreeOverlayOptions
- type ViewTreePatchOperation
- type ViewTreeSizeValue
- type ViewTreeStyle
- type ViewTreeTableColumn
- type VisualTruncateResult
- type WarningSettings
- type WorkingStatusIndicator
- type WriteTool
- type WriteToolInput
Constants ¶
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" ProtocolEventAgentSettled = "agent_settled" ProtocolEventContext = "context" ProtocolEventToolCall = "tool_call" ProtocolEventToolResult = "tool_result" ProtocolEventToolExecutionUpdate = "tool_execution_update" ProtocolEventMessageStart = "message_start" ProtocolEventMessageUpdate = "message_update" ProtocolEventMessageEnd = "message_end" ProtocolEventUserBash = "user_bash" ProtocolEventProjectTrust = "project_trust" ProtocolEventResourcesDiscover = "resources_discover" ProtocolEventBeforeProviderRequest = "before_provider_request" ProtocolEventBeforeProviderHeaders = "before_provider_headers" ProtocolEventAfterProviderResponse = "after_provider_response" )
const ( DefaultCodingAgentPackageName = "gi" DefaultCodingAgentVersion = "0.82.2" 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" )
const ( EnvExperimental = "GI_EXPERIMENTAL" LegacyEnvExperimental = "PI_EXPERIMENTAL" )
const ( OSC133ZoneStart = "\x1b]133;A\x07" OSC133ZoneEnd = "\x1b]133;B\x07" OSC133ZoneFinal = "\x1b]133;C\x07" TerminalBGReset = "\x1b[49m" )
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" RPCCommandGetAvailableThinkingLevels = "get_available_thinking_levels" 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" RPCCommandGetEntries = "get_entries" RPCCommandGetTree = "get_tree" RPCCommandGetLastAssistantText = "get_last_assistant_text" RPCCommandSetSessionName = "set_session_name" RPCCommandGetMessages = "get_messages" RPCCommandGetCommands = "get_commands" )
const ( FauxProvider = "faux" FauxModelID = "faux-1" FauxAPI = "anthropic-messages" )
const AnthropicSubscriptionAuthWarning = authwarning.AnthropicSubscriptionAuthWarning
const ( // CacheTTL is Anthropic's default prompt-cache TTL. It is presentation // context for callers; cache accounting itself remains provider-neutral. CacheTTL = 5 * time.Minute )
const CapabilityBashIntercept = "bash.intercept"
const CapabilityCommandsRegister = "commands.register"
const CapabilityInputEvents = "input.events"
const CapabilityLifecycleEvents = "lifecycle.events"
const CapabilityProvidersRegister = "providers.register"
const CapabilityResourcesDiscover = "resources.discover"
const CapabilityShortcutsRegister = "shortcuts.register"
const CapabilitySystemPromptModify = "system_prompt.modify"
const CapabilityTUIAutocomplete = "tui.autocomplete"
const CapabilityTUIEditor = "tui.editor"
const CapabilityTUIHeader = "tui.header"
const CapabilityTUIMessageRenderer = "tui.message_renderer"
const CapabilityTUIOverlay = "tui.overlay"
const CapabilityTUITerminalInput = "tui.terminal_input"
const CapabilityTUITheme = "tui.theme"
const CapabilityTUIToolRenderer = "tui.tool_renderer"
const CapabilityTUIToolsExpanded = "tui.tools_expanded"
const CapabilityTUIWidget = "tui.widget"
const CapabilityToolsRegister = "tools.register"
const ConfigDirName = ".gi"
const (
CurrentSessionVersion = 3
)
const ExportHTMLTemplateCSS = `` /* 10094-byte string literal not displayed */
const ExportHTMLTemplateJS = `` /* 47459-byte string literal not displayed */
const FSWatchRetryDelay = fswatch.FSWatchRetryDelay
const LatestGiVersionURL = versioncheck.LatestGiVersionURL
const LatestPiVersionURL = versioncheck.LatestPiVersionURL
const RPCCommandClone = "clone"
const RadiusProviderID = "radius"
RadiusProviderID is the built-in Radius provider identifier used by models.json OAuth composition.
Variables ¶
var ( // ErrRPCProcessNotStarted reports a command sent without an active process. ErrRPCProcessNotStarted = errors.New("RPC process not started") // ErrRPCProcessStopped reports a command interrupted by explicit shutdown. ErrRPCProcessStopped = errors.New("RPC process stopped") )
var DefaultModelPerProvider = modelresolver.DefaultModelPerProvider
var ErrAuthStorageLockCompromised = errors.New("auth storage lock was compromised")
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 ApplyHTTPProxySettings ¶ added in v0.82.0
ApplyHTTPProxySettings projects the global httpProxy setting into the conventional process environment without replacing caller-owned values.
func AreExperimentalFeaturesEnabled ¶ added in v0.82.0
func AreExperimentalFeaturesEnabled() bool
AreExperimentalFeaturesEnabled keeps experimental behavior opt-in. Gi's environment name takes precedence while the Pi name remains available for compatibility during migration.
func AttachJSONLLineReader ¶
func BuildSDKStreamHeaders ¶
func BuildSystemPrompt ¶
func BuildSystemPrompt(options BuildSystemPromptOptions) string
func CanonicalizePath ¶
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 ClearAPIKeyCache ¶
func ClearAPIKeyCache()
func ClearConfigValueCache ¶
func ClearConfigValueCache()
ClearConfigValueCache clears cached command successes and failures.
func CloseWatcher ¶
func CloseWatcher(watcher FSWatcher)
func ComparePackageVersions ¶
func ConfigValueEnvVarName ¶ added in v0.82.0
ConfigValueEnvVarName returns the environment variable name when config is exactly one $NAME or ${NAME} reference.
func ConfigValueEnvVarNames ¶ added in v0.82.0
ConfigValueEnvVarNames returns referenced environment variables in first-use order with duplicates removed.
func ConvertImageBytesToPNG ¶ added in v0.82.0
func CopyToClipboard ¶
func CopyToClipboard(text string, options ClipboardCopyOptions) error
func CreateAgentSessionRuntime ¶
func CreateAgentSessionRuntime(factory CreateAgentSessionRuntimeFactory, options AgentSessionRuntimeOptions) (any, error)
func DefaultAgentSessionCompactionSummarizer ¶
func DefaultAgentSessionCompactionSummarizer(preparation agentharness.CompactionPreparation, customInstructions string) (agentharness.CompactionResult, error)
func DefaultClipboardPasteImageKey ¶
func DefaultClipboardPasteImageKey() string
func DefaultTmuxOptionReader ¶
func ExpandPath ¶
func ExpandPromptTemplate ¶
func ExpandPromptTemplate(text string, templates []PromptTemplate) string
func ExpandTildePath ¶
func ExportHTMLTemplateCSSWithOptions ¶
func ExportHTMLTemplateCSSWithOptions(options ExportHTMLOptions) string
func ExportSessionFileToHTML ¶
func ExportSessionFileToHTMLWithOptions ¶
func ExportSessionFileToHTMLWithOptions(inputPath, outputPath string, options ExportHTMLOptions) (string, error)
func ExtractDoneSteps ¶
func FindMostRecentSession ¶
func FormatCWDForFooter ¶ added in v0.82.0
FormatCWDForFooter replaces home with ~ only when cwd is home itself or a descendant. Both inputs are resolved before comparison so sibling prefixes such as "/home/me-other" are never shortened.
func FormatDimensionNote ¶
func FormatDimensionNote(result ResizedImage) string
func GetAgentDir ¶
func GetAgentDirSessionDir ¶
func GetAttributionHeaders ¶
func GetAuthPath ¶
func GetBundledInteractiveAssetPath ¶
func GetBundledInteractiveAssetPath(name string, envs ...InstallEnvironment) string
func GetChangelogPath ¶
func GetChangelogPath(envs ...InstallEnvironment) string
func GetCustomThemesDir ¶
func GetCwdRelativePath ¶
func GetDebugLogPath ¶
func GetDefaultSessionDir ¶
func GetDefaultSessionDirPath ¶ added in v0.82.0
GetDefaultSessionDirPath computes the session directory without creating it.
func GetDocsPath ¶
func GetDocsPath(envs ...InstallEnvironment) string
func GetExamplesPath ¶
func GetExamplesPath(envs ...InstallEnvironment) string
func GetExportTemplateDir ¶
func GetExportTemplateDir(envs ...InstallEnvironment) string
func GetExtensionTempFolder ¶ added in v0.82.0
GetExtensionTempFolder returns the private cache root used for temporary extension checkouts. Existing directories are tightened on every access.
func GetGiUserAgent ¶
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 GetPackageDir ¶
func GetPackageDir(envs ...InstallEnvironment) string
func GetPackageJSONPath ¶
func GetPackageJSONPath(envs ...InstallEnvironment) string
func GetPackageJsonPath ¶
func GetPackageJsonPath(envs ...InstallEnvironment) string
func GetPathCommandArgument ¶
func GetPiUserAgent ¶
func GetProjectTrustParentPath ¶ added in v0.82.0
func GetPromptsDir ¶
func GetReadmePath ¶
func GetReadmePath(envs ...InstallEnvironment) string
func GetSelfUpdateUnavailableInstruction ¶
func GetSelfUpdateUnavailableInstruction(packageName string, env InstallEnvironment, _ []string, updatePackageName string) string
func GetSelfUpdateUnavailableInstructionForTarget ¶ added in v0.82.0
func GetSelfUpdateUnavailableInstructionForTarget(packageName string, env InstallEnvironment, target SelfUpdatePackageTarget) string
GetSelfUpdateUnavailableInstructionForTarget describes the safe manual update path without collapsing an exact install spec into its package name.
func GetSessionsDir ¶
func GetSettingsPath ¶
func GetShareViewerURL ¶
func GetThemesDir ¶
func GetThemesDir(envs ...InstallEnvironment) string
func GetToolsDir ¶
func GetUpdateInstruction ¶
func GetUpdateInstruction(packageName string, env InstallEnvironment) string
func HasSessionName ¶
func HasSessionName(session SessionInfo) bool
func HasTrustRequiringProjectResources ¶ added in v0.82.0
func Highlight ¶
func Highlight(code string, options HighlightOptions) string
func IsAPIKeyLoginProvider ¶
func IsAliasModelID ¶
func IsCommandConfigValue ¶ added in v0.82.0
IsCommandConfigValue reports whether config requests shell command execution.
func IsConfigValueConfigured ¶ added in v0.82.0
func IsConfigValueConfigured(config string, env llm.ProviderEnv) bool
IsConfigValueConfigured reports whether all environment references required by config are available. Commands and literals are considered configured without executing them.
func IsInstallTelemetryEnabled ¶
func IsInstallTelemetryEnabled(settingsManager *SettingsManager) bool
func IsLocalPath ¶
func IsNewerPackageVersion ¶
func IsOfficialDistribution ¶ added in v0.82.0
func IsOfficialDistribution(metadata DistributionMetadata) bool
func IsSafePlanCommand ¶
func IsValidThinkingLevel ¶
func IsWaylandSession ¶
func LoadProtocolExtensionDescriptors ¶
func LoadProtocolExtensionDescriptors(sources []ProtocolExtensionSource, runtime *ProtocolExtensionRuntime) protocolExtensionDescriptorLoadResult
func MarkCompletedPlanSteps ¶
func MarkCompletedPlanSteps(message string, items []PlanTodoItem) int
func MarkPathIgnoredByCloudSync ¶ added in v0.82.0
func MarkPathIgnoredByCloudSync(path string)
func MergeProviderAttributionHeaders ¶ added in v0.82.0
func MigrateSessionEntries ¶
func MissingConfigValueEnvVarNames ¶ added in v0.82.0
func MissingConfigValueEnvVarNames(config string, env llm.ProviderEnv) []string
MissingConfigValueEnvVarNames reports template variables that cannot be resolved. Provider-scoped values take precedence over process environment.
func OfficialPackageNames ¶
func OfficialPackageNames() []string
func PackageSourceIdentity ¶
func PackageSourceIdentity(source PackageSource) string
func ParseCommandArgs ¶
func PreRenderExportHTMLCustomTools ¶
func PreRenderExportHTMLCustomTools(entries []FileEntry, renderer ExportHTMLToolRenderer) map[string]ExportHTMLRenderedTool
func ReadClipboardText ¶ added in v0.82.0
func ReadClipboardText( ctx context.Context, options ClipboardTextReadOptions, ) (string, bool)
func RegisterOAuthProvider ¶
func RegisterOAuthProvider(provider OAuthProvider)
func RenderDiff ¶
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 ResolveConfigHeaders ¶ added in v0.82.0
ResolveConfigHeaders resolves header values and omits unresolved or empty entries.
func ResolveConfigHeadersOrError ¶ added in v0.82.0
func ResolveConfigHeadersOrError( headers map[string]string, description string, env llm.ProviderEnv, ) (map[string]string, error)
ResolveConfigHeadersOrError resolves every header or returns a contextual error for the first unresolved value.
func ResolveConfigValue ¶
ResolveConfigValue resolves config with process environment and caches shell command results for the process lifetime.
func ResolveConfigValueOrError ¶ added in v0.82.0
func ResolveConfigValueOrError(config, description string, env llm.ProviderEnv) (string, error)
ResolveConfigValueOrError resolves a config value and describes the missing command or environment dependency when resolution fails.
func ResolveConfigValueUncached ¶
ResolveConfigValueUncached resolves config without caching shell command results.
func ResolveConfigValueUncachedWithEnv ¶ added in v0.82.0
func ResolveConfigValueUncachedWithEnv(config string, env llm.ProviderEnv) (string, bool)
ResolveConfigValueUncachedWithEnv is ResolveConfigValueWithEnv without the process-lifetime command cache.
func ResolveConfigValueWithEnv ¶ added in v0.82.0
func ResolveConfigValueWithEnv(config string, env llm.ProviderEnv) (string, bool)
ResolveConfigValueWithEnv resolves commands, explicit environment templates, escapes, and literals. Credential-scoped env values take precedence over process environment. Bare names are literals; environment references require $NAME or ${NAME} syntax.
func ResolveProjectTrusted ¶ added in v0.82.0
func ResolveProjectTrusted(options ResolveProjectTrustOptions) (bool, error)
func ResolveReadPath ¶
func ResolveThemeSetting ¶ added in v0.82.0
func ResolveThemeSetting(themeSetting string, terminalTheme TerminalTheme) (string, bool)
ResolveThemeSetting projects a fixed or automatic setting to the concrete theme name for the current terminal appearance. Malformed automatic values are rejected instead of being treated as file names.
func ResolveToCwd ¶
func RestoreSandboxEnv ¶
func RestoreSandboxEnv(isBun bool, env map[string]string, readEnviron SandboxEnvReader) bool
func RunCLI ¶
func RunCLI(options CLIOptions) int
func RunMigrations ¶
func RunPrintMode ¶
func RunPrintMode(host PrintModeRuntimeHost, options PrintModeOptions) (exitCode int)
func SerializeJSONLine ¶
func SessionEntryToContextMessages ¶ added in v0.82.0
SessionEntryToContextMessages converts one selected session entry into the canonical message representation consumed by the agent and TUI.
func ShouldRunFirstTimeSetup ¶ added in v0.82.0
ShouldRunFirstTimeSetup discovers only the four facts needed by the setup policy, then evaluates the immutable result. An optional path makes the function deterministic in callers and tests while retaining the default settings path used by the CLI.
func ShowFirstTimeSetup ¶ added in v0.82.0
func ShowFirstTimeSetup( ctx context.Context, settings *SettingsManager, options FirstTimeSetupRunnerOptions, ) error
ShowFirstTimeSetup owns the complete startup interaction lifecycle. The component emits one result, and only this coordinator mutates settings.
func StripFrontmatter ¶
func SubstituteArgs ¶
func SupportsLanguage ¶
func TUIThemeSchemaJSON ¶
func TUIThemeSchemaJSON() []byte
TUIThemeSchemaJSON returns Gi's Pi-compatible TUI theme JSON schema.
func UnregisterOAuthProvider ¶
func UnregisterOAuthProvider(providerID string)
func ValidateSessionID ¶ added in v0.82.0
ValidateSessionID applies the portable filename contract used by Pi.
func ValidateViewTreeNode ¶
func ValidateViewTreeNode(node ViewTreeNode) error
func WithFileMutationQueue ¶
func WriteCLIUsage ¶
func WriteCLIUsage(writer io.Writer, extensionFlags ...ProtocolFlagRegistration)
Types ¶
type AgentContextUsage ¶
type AgentSession ¶
type AgentSession struct {
SessionManager *SessionManager
SettingsManager *SettingsManager
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
ModelRuntime *ModelRuntime
SummaryRuntime agentharness.SimpleCompletionRuntime
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) AppendCustomEntry ¶ added in v0.82.0
func (s *AgentSession) AppendCustomEntry( customType string, data any, ) (string, error)
AppendCustomEntry persists the entry before publishing its presentation event. Consumers therefore never observe an entry that is absent from the append-only session tree.
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) IsIdle ¶ added in v0.82.0
func (s *AgentSession) IsIdle() 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 (s *AgentSession) NavigateTree(targetID string, options AgentSessionNavigateTreeOptions) (AgentSessionNavigateTreeResult, error)
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) (returnErr 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()
func (*AgentSession) SyncRuntimeSettings ¶ added in v0.82.0
func (s *AgentSession) SyncRuntimeSettings()
SyncRuntimeSettings refreshes the settings that affect AgentSession control flow. The SettingsManager remains the durable/live owner; AgentSession keeps only the per-run snapshot needed to make deterministic decisions.
func (*AgentSession) WaitForIdle ¶ added in v0.82.0
func (s *AgentSession) WaitForIdle(ctx context.Context) error
type AgentSessionBashOptions ¶
type AgentSessionBashOptions struct {
OnChunk func(string)
ExcludeFromContext bool
Operations BashOperations
Context context.Context
}
type AgentSessionBashRecordOptions ¶
type AgentSessionBashRecordOptions struct {
ExcludeFromContext bool
}
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"`
Source string `json:"source,omitempty"`
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"`
Messages []llm.Message `json:"messages,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"`
Entry *FileEntry `json:"entry,omitempty"`
}
type AgentSessionEventListener ¶
type AgentSessionEventListener func(AgentSessionEvent)
type AgentSessionForkMessage ¶
type AgentSessionForkResult ¶
type AgentSessionForkResult struct {
Cancelled bool
SelectedText string
Session *AgentSession
}
type AgentSessionNavigateTreeOptions ¶
type AgentSessionNavigateTreeOptions struct {
}
type AgentSessionNavigateTreeResult ¶
type AgentSessionNavigateTreeResult struct {
}
type AgentSessionOptions ¶
type AgentSessionOptions struct {
CWD string
AgentDir string
Model llm.Model
ThinkingLevel string
Preflight AgentSessionPreflight
SettingsManager *SettingsManager
SessionManager *SessionManager
ResourceLoader AgentSessionResourceLoader
CompactionSettings *agentharness.CompactionSettings
CompactionSummarizer AgentSessionCompactionSummarizer
BranchSummarizer AgentSessionBranchSummarizer
RetrySettings *AgentSessionRetrySettings
AutoCompactionRunner AgentSessionAutoCompactionRunner
AgentContinue func() error
Responder AgentSessionResponder
StreamResponder AgentSessionStreamResponder
ModelRuntime *ModelRuntime
SummaryRuntime agentharness.SimpleCompletionRuntime
CustomTools []SDKTool
ScopedModels []ScopedModel
Tools []string
ToolsSet bool
NoTools string
}
type AgentSessionPreflight ¶
type AgentSessionPromptResourceLoader ¶
type AgentSessionPromptResourceLoader interface {
GetPrompts() ResourcePromptsResult
}
type AgentSessionResourceLoader ¶
type AgentSessionResourceLoader interface {
GetSkills() AgentSessionSkillsResult
}
type AgentSessionResponder ¶
type AgentSessionRetrySettings ¶
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 (h *AgentSessionRuntimeHost) Fork(entryID string, options ...AgentSessionRuntimeForkOptions) (AgentSessionForkResult, error)
func (*AgentSessionRuntimeHost) NewSession ¶
func (h *AgentSessionRuntimeHost) NewSession(options ...ProtocolNewSessionOptions) (AgentSessionRuntimeSwitchResult, error)
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 ¶
func (h *AgentSessionRuntimeHost) SwitchSession(sessionFile string, options ...ProtocolSwitchSessionOptions) (AgentSessionRuntimeSwitchResult, error)
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 {
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 llm.Usage `json:"tokens"`
ContextUsage *AgentContextUsage `json:"contextUsage,omitempty"`
UsageBreakdown []UsageCostBreakdownEntry `json:"usageBreakdown,omitempty"`
CacheWaste CacheWasteTotals `json:"cacheWaste"`
LatestCacheHitRate *float64 `json:"latestCacheHitRate,omitempty"`
}
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 AssistantContentBlock ¶
type AssistantMessageComponent ¶
type AssistantMessageComponent struct {
Content []AssistantContentBlock
HideThinkingBlock bool
HiddenThinkingLabel string
// contains filtered or unexported fields
}
func NewAssistantMessageComponent ¶
func NewAssistantMessageComponent(content []AssistantContentBlock) AssistantMessageComponent
func (AssistantMessageComponent) Render ¶
func (c AssistantMessageComponent) Render(width int) []string
func (*AssistantMessageComponent) SetOutputPad ¶ added in v0.82.0
func (c *AssistantMessageComponent) SetOutputPad(padding int)
type AuthCredential ¶
type AuthCredential = llm.Credential
func ReadStoredCredential ¶ added in v0.82.0
func ReadStoredCredential(providerID string, authPath ...string) (AuthCredential, bool)
ReadStoredCredential performs a one-off raw credential read without constructing a store or resolving API-key commands and templates.
type AuthSelectorProvider ¶
type AuthStatus ¶
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) DeleteCredential ¶ added in v0.82.0
func (s *AuthStorage) DeleteCredential(ctx context.Context, providerID string) error
func (*AuthStorage) DrainErrors ¶
func (s *AuthStorage) DrainErrors() []error
func (*AuthStorage) Get ¶
func (s *AuthStorage) Get(provider string) (AuthCredential, 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) HasRuntimeAPIKey ¶ added in v0.82.0
func (s *AuthStorage) HasRuntimeAPIKey(provider string) bool
func (*AuthStorage) List ¶
func (s *AuthStorage) List() []string
func (*AuthStorage) ListCredentials ¶ added in v0.82.0
func (s *AuthStorage) ListCredentials(ctx context.Context) ([]llm.CredentialInfo, error)
func (*AuthStorage) ModifyCredential ¶ added in v0.82.0
func (s *AuthStorage) ModifyCredential( ctx context.Context, providerID string, modify llm.CredentialModifier, ) (llm.Credential, bool, error)
func (*AuthStorage) ReadCredential ¶ added in v0.82.0
func (s *AuthStorage) ReadCredential( ctx context.Context, providerID string, ) (llm.Credential, bool, error)
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 AuthStorageOptions ¶
type AutoThemeSetting ¶ added in v0.82.0
AutoThemeSetting is the parsed light/dark pair from an automatic theme setting. The value is immutable after parsing and can be resolved against a terminal appearance without consulting mutable settings again.
func ParseAutoThemeSetting ¶ added in v0.82.0
func ParseAutoThemeSetting(themeSetting string) (AutoThemeSetting, bool)
ParseAutoThemeSetting parses the exact "light-theme/dark-theme" grammar used by Pi. A setting is automatic only when it contains one slash and both names are non-empty after trimming.
type AutocompleteEditor ¶
type AutocompleteEditor interface {
SetAutocompleteProvider(AutocompleteProvider)
}
type AutocompleteProvider ¶
type AutocompleteProviderFactory ¶
type AutocompleteProviderFactory func(AutocompleteProvider) AutocompleteProvider
type BashExecOptions ¶
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 BashLocalOperationsOptions ¶
type BashLocalOperationsOptions struct {
ShellPath string
// contains filtered or unexported fields
}
type BashOperationResult ¶
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(toolCallID string, input BashToolInput) (FileToolResult, error)
func (BashTool) ExecuteWithUpdates ¶
func (t BashTool) ExecuteWithUpdates(toolCallID string, input BashToolInput, onUpdate func(FileToolResult)) (FileToolResult, error)
type BashToolInput ¶
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 (c *BorderedLoaderComponent) Context() context.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 ¶
func (c *BorderedLoaderComponent) Signal() context.Context
type BorderedLoaderOptions ¶
type BorderedLoaderOptions struct {
Cancellable *bool
}
type BranchSummaryStatusIndicator ¶ added in v0.82.0
type BranchSummaryStatusIndicator struct {
*StatusIndicator
}
BranchSummaryStatusIndicator renders branch summarization activity.
func NewBranchSummaryStatusIndicator ¶ added in v0.82.0
func NewBranchSummaryStatusIndicator(ui *gitui.TUI) *BranchSummaryStatusIndicator
NewBranchSummaryStatusIndicator constructs a branch summarization indicator.
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
Stdout io.Writer
StdoutIsTTY *bool
ViewTreeHost *ViewTreeHost
InProcessUI *InProcessUIRegistry
ClipboardCopy func(string) error
ClipboardImageRead func() *ClipboardImage
ClipboardTextRead func(context.Context) (string, bool)
ClipboardImageDir string
Suspend InteractiveSuspendOperations
TmuxOptionReader TmuxOptionReader
VerboseStartup bool
ExitAfterInitial bool
ClearScreenOnStart 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
ModelCatalogRefresh ModelCatalogRefreshFunc
PackageManager *DefaultPackageManager
PackageName string
Version string
InstallEnvironment InstallEnvironment
VersionCheck VersionReleaseChecker
VersionCheckOptions VersionCheckOptions
StartupWarnings []string
Responder AgentSessionResponder
ProjectTrustPrompt ProjectTrustPrompt
ProjectTrustOverride *bool
ExtensionFactories []ProtocolExtensionFactory
FirstTimeSetupTerminal gitui.Terminal
}
type CLIStartupMigrationResult ¶
type CLIStartupMigrationResult struct {
StartupWarnings []string
}
type CacheMiss ¶ added in v0.82.0
type CacheMiss struct {
MissedTokens int `json:"missedTokens"`
MissedCost float64 `json:"missedCost"`
Idle time.Duration `json:"idle"`
ModelChanged bool `json:"modelChanged"`
}
CacheMiss describes prompt tokens that were present in the preceding request but were billed again instead of being served from cache.
type CacheWasteTotals ¶ added in v0.82.0
type CacheWasteTotals struct {
MissedTokens int `json:"missedTokens"`
MissedCost float64 `json:"missedCost"`
MissCount int `json:"missCount"`
}
CacheWasteTotals is the immutable cumulative cache-miss projection for one session entry snapshot.
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 ClipboardTextReadOperations ¶ added in v0.82.0
type ClipboardTextReadOperations = clip.ClipboardTextReadOperations
type ClipboardTextReadOptions ¶ added in v0.82.0
type ClipboardTextReadOptions = clip.ClipboardTextReadOptions
type CodingAgentFauxState ¶
type CodingAgentTestHarness ¶
type CodingAgentTestHarness struct {
Session *AgentSession
SessionManager *SessionManager
Faux *CodingAgentFauxState
Events []AgentSessionEvent
TempDir string
ExtensionRuntime *ProtocolExtensionRuntime
}
func NewCodingAgentTestHarness ¶
func NewCodingAgentTestHarness(options CodingAgentTestHarnessOptions) (*CodingAgentTestHarness, error)
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 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 CodingModelRegistry ¶
type CodingModelRegistry = modelresolver.CodingModelRegistry
type CompactionStatusIndicator ¶ added in v0.82.0
type CompactionStatusIndicator struct {
*StatusIndicator
}
CompactionStatusIndicator renders manual or automatic compaction activity.
func NewCompactionStatusIndicator ¶ added in v0.82.0
func NewCompactionStatusIndicator( ui *gitui.TUI, reason CompactionStatusReason, ) *CompactionStatusIndicator
NewCompactionStatusIndicator constructs a compaction indicator.
type CompactionStatusReason ¶ added in v0.82.0
type CompactionStatusReason string
CompactionStatusReason determines the label used for compaction activity.
const ( // CompactionStatusReasonManual identifies user-requested compaction. CompactionStatusReasonManual CompactionStatusReason = "manual" // CompactionStatusReasonThreshold identifies automatic threshold compaction. CompactionStatusReasonThreshold CompactionStatusReason = "threshold" // CompactionStatusReasonOverflow identifies overflow recovery compaction. CompactionStatusReasonOverflow CompactionStatusReason = "overflow" )
type ConfiguredPackage ¶
type ConvertedImage ¶
type ConvertedImage = imageresize.ConvertedImage
func ConvertToPNG ¶
func ConvertToPNG(base64Data, mimeType string) *ConvertedImage
type CountdownTimer ¶ added in v0.82.0
type CountdownTimer struct {
// contains filtered or unexported fields
}
CountdownTimer owns one countdown goroutine. Dispose waits for it to stop, so no callback can run after disposal returns.
func NewCountdownTimer ¶ added in v0.82.0
func NewCountdownTimer( timeout time.Duration, requester TUIRenderRequester, onTick func(int), onExpire func(), ) *CountdownTimer
NewCountdownTimer starts a second-granularity countdown and synchronously publishes its initial value.
func (*CountdownTimer) Dispose ¶ added in v0.82.0
func (t *CountdownTimer) Dispose()
Dispose stops the countdown and waits until its goroutine exits.
type CreateAgentSessionRuntimeFactory ¶
type CreateAgentSessionRuntimeFactory func(AgentSessionRuntimeOptions) (any, error)
type CustomEntryComponent ¶ added in v0.82.0
type CustomEntryComponent struct {
// contains filtered or unexported fields
}
CustomEntryComponent owns only presentation state for one persisted custom entry. The session manager remains the source of truth for entry data, while the extension runtime owns renderer registration and precedence.
func NewCustomEntryComponent ¶ added in v0.82.0
func NewCustomEntryComponent( entry FileEntry, renderer ProtocolEntryRenderer, ) *CustomEntryComponent
func (*CustomEntryComponent) HasContent ¶ added in v0.82.0
func (c *CustomEntryComponent) HasContent() bool
func (*CustomEntryComponent) Invalidate ¶ added in v0.82.0
func (c *CustomEntryComponent) Invalidate()
func (*CustomEntryComponent) Render ¶ added in v0.82.0
func (c *CustomEntryComponent) Render(width int) []string
func (*CustomEntryComponent) SetExpanded ¶ added in v0.82.0
func (c *CustomEntryComponent) SetExpanded(expanded bool)
type DefaultAgentSessionResourceLoader ¶
type DefaultAgentSessionResourceLoader struct {
// contains filtered or unexported fields
}
func NewDefaultAgentSessionResourceLoader ¶
func NewDefaultAgentSessionResourceLoader(cwd, agentDir string) *DefaultAgentSessionResourceLoader
func (*DefaultAgentSessionResourceLoader) GetAgentsFiles ¶
func (l *DefaultAgentSessionResourceLoader) GetAgentsFiles() ResourceAgentsFilesResult
func (*DefaultAgentSessionResourceLoader) GetAppendSystemPrompt ¶
func (l *DefaultAgentSessionResourceLoader) GetAppendSystemPrompt() string
func (*DefaultAgentSessionResourceLoader) GetPrompts ¶
func (l *DefaultAgentSessionResourceLoader) GetPrompts() ResourcePromptsResult
func (*DefaultAgentSessionResourceLoader) GetSkills ¶
func (l *DefaultAgentSessionResourceLoader) GetSkills() AgentSessionSkillsResult
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) LoadResourceConfigSnapshot ¶ added in v0.82.0
func (m *DefaultPackageManager) LoadResourceConfigSnapshot() (ResourceConfigSnapshot, error)
LoadResourceConfigSnapshot resolves an isolated user-only projection and the effective trusted-project projection from the same settings snapshot.
func (*DefaultPackageManager) ParseSource ¶
func (m *DefaultPackageManager) ParseSource(source string) PackageSource
func (*DefaultPackageManager) ProjectResourceOverrideState ¶ added in v0.82.0
func (m *DefaultPackageManager) ProjectResourceOverrideState(item PackageResourceToggleItem) ProjectResourceOverrideState
ProjectResourceOverrideState returns the explicit project-layer state for item without folding in inherited enabled state.
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) SetProjectResourceOverride ¶ added in v0.82.0
func (m *DefaultPackageManager) SetProjectResourceOverride(target ResourceConfigTarget, state ProjectResourceOverrideState) (bool, error)
SetProjectResourceOverride persists one project-layer transition. target carries inherited state from the ResourceConfigSnapshot that displayed it.
func (*DefaultPackageManager) SetTopLevelResourceEnabled ¶
func (m *DefaultPackageManager) SetTopLevelResourceEnabled(toggle TopLevelResourceToggle) (bool, error)
func (*DefaultPackageManager) Update ¶
func (m *DefaultPackageManager) Update(sources ...string) error
type DefaultProjectTrust ¶ added in v0.82.0
type DefaultProjectTrust string
const ( DefaultProjectTrustAsk DefaultProjectTrust = "ask" DefaultProjectTrustAlways DefaultProjectTrust = "always" DefaultProjectTrustNever DefaultProjectTrust = "never" )
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 (l *DefaultResourceLoader) GetAgentsFiles() ResourceAgentsFilesResult
func (*DefaultResourceLoader) GetAppendSystemPrompt ¶
func (l *DefaultResourceLoader) GetAppendSystemPrompt() string
func (*DefaultResourceLoader) GetExtensions ¶
func (l *DefaultResourceLoader) GetExtensions() ResourceExtensionsResult
func (*DefaultResourceLoader) GetPrompts ¶
func (l *DefaultResourceLoader) GetPrompts() ResourcePromptsResult
func (*DefaultResourceLoader) GetSkills ¶
func (l *DefaultResourceLoader) GetSkills() ResourceSkillsResult
func (*DefaultResourceLoader) GetSystemPrompt ¶
func (l *DefaultResourceLoader) GetSystemPrompt() string
func (*DefaultResourceLoader) GetThemes ¶
func (l *DefaultResourceLoader) GetThemes() ResourceThemesResult
func (*DefaultResourceLoader) LoadProjectTrustExtensions ¶ added in v0.82.0
func (l *DefaultResourceLoader) LoadProjectTrustExtensions() ResourceExtensionsResult
LoadProjectTrustExtensions loads only global/user and explicitly requested extensions. It intentionally leaves SettingsManager untrusted so the caller can resolve trust before any project-local code or settings are observed.
func (*DefaultResourceLoader) Reload ¶
func (l *DefaultResourceLoader) Reload()
func (*DefaultResourceLoader) ReloadWithOptions ¶ added in v0.82.0
func (l *DefaultResourceLoader) ReloadWithOptions( options ResourceLoaderReloadOptions, ) error
ReloadWithOptions reloads settings and resources as one transaction. When a resolver is provided, global/user and explicit extensions load first; the returned decision then selects the final resource set on the same runtime.
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 DistributionMetadata ¶ added in v0.82.0
type Edit ¶
type Edit = harnesstools.Edit
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(toolCallID string, input EditToolInput) (FileToolResult, error)
type EditToolInput ¶
type ExportHTMLOptions ¶
type ExportHTMLOptions struct {
ThemeName string
AgentDir string
ToolRenderer ExportHTMLToolRenderer
}
type ExportHTMLRenderedTool ¶
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 ¶
func ExportHTMLSidebarEntriesForUserMessage ¶
func ExportHTMLSidebarEntriesForUserMessage(text string) []ExportHTMLSidebarEntry
type ExportHTMLSkillBlock ¶
func ParseExportHTMLSkillBlock ¶
func ParseExportHTMLSkillBlock(text string) (ExportHTMLSkillBlock, bool)
type ExportHTMLToolRenderer ¶
type ExportHTMLToolRenderer interface {
RenderCall(toolCallID, toolName string, args any) string
RenderResult(toolCallID, toolName string, result FileToolResult, isError bool) ExportHTMLToolRenderResult
}
func CreateToolHTMLRenderer ¶
func CreateToolHTMLRenderer(deps ExportHTMLToolRendererDeps) ExportHTMLToolRenderer
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 ¶
func (c *ExtensionSelectorComponent) Title() string
type ExternalEditorOptions ¶ added in v0.82.0
type ExternalEditorOptions struct {
Command string
Content string
Stdin io.Reader
Stdout io.Writer
Stderr io.Writer
}
ExternalEditorOptions is the immutable request passed from a UI surface to the external-editor process boundary.
type ExternalEditorResult ¶ added in v0.82.0
type ExternalEditorResult struct {
Status ExternalEditorStatus
Content string
}
ExternalEditorResult is detached from the temporary file and safe for the UI owner to apply after the process boundary has closed.
func EditInExternalEditor ¶ added in v0.82.0
func EditInExternalEditor(ctx context.Context, options ExternalEditorOptions) (ExternalEditorResult, error)
EditInExternalEditor writes content to a private temporary workspace, waits for the configured editor, and returns a detached result. A failed editor process is a normal failed result; filesystem failures are returned as errors. The temporary workspace is always removed on a best-effort basis.
type ExternalEditorStatus ¶ added in v0.82.0
type ExternalEditorStatus string
ExternalEditorStatus describes whether the editor produced replacement text.
const ( ExternalEditorStatusComplete ExternalEditorStatus = "complete" ExternalEditorStatusFailed ExternalEditorStatus = "failed" )
type FSWatchListener ¶
type FSWatchListener = fswatch.FSWatchListener
type FSWatchOptions ¶
type FSWatchOptions = fswatch.FSWatchOptions
type 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 ¶
func (b *FileAuthStorageBackend) WithLock(fn AuthStorageLockFunc) error
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
Usage *llm.Usage
TargetID string
Label string
Name string
FromID string
// contains filtered or unexported fields
}
func BuildContextEntries ¶ added in v0.82.0
func BuildContextEntries( entries []FileEntry, leafID *string, byID map[string]FileEntry, ) []FileEntry
BuildContextEntries follows the selected leaf to the root and applies the latest compaction. It retains FileEntry identity so presentation layers can attach derived state, such as cache-miss notices, without persisting it.
func LoadEntriesFromFile ¶
LoadEntriesFromFile loads valid JSONL records and returns no entries when the first parsed record is not a session header.
func (FileEntry) IsCustom ¶ added in v0.82.0
IsCustom reports whether the entry carries extension-owned session data. Go keeps persisted entries and rendered LLM messages as distinct types, so callers use this method instead of a runtime union type assertion.
func (FileEntry) MarshalJSON ¶
func (*FileEntry) UnmarshalJSON ¶
type FileModelsStore ¶ added in v0.82.0
type FileModelsStore struct {
// contains filtered or unexported fields
}
FileModelsStore persists dynamic provider catalogs in one locked JSON file. Each mutation reads and rewrites the complete map while holding the path-scoped lock so unrelated provider entries cannot be lost.
func NewFileModelsStore ¶ added in v0.82.0
func NewFileModelsStore(path string) *FileModelsStore
NewFileModelsStore creates a JSON-backed dynamic catalog store.
func (*FileModelsStore) DeleteModels ¶ added in v0.82.0
func (s *FileModelsStore) DeleteModels( ctx context.Context, providerID string, ) error
func (*FileModelsStore) ReadModels ¶ added in v0.82.0
func (s *FileModelsStore) ReadModels( ctx context.Context, providerID string, ) (llm.ModelsStoreEntry, bool, error)
func (*FileModelsStore) WriteModels ¶ added in v0.82.0
func (s *FileModelsStore) WriteModels( ctx context.Context, providerID string, entry llm.ModelsStoreEntry, ) error
type FileToolDetails ¶
type FileToolDetails struct {
Truncation *ReadToolTruncation `json:"truncation,omitempty"`
Diff string `json:"diff,omitempty"`
Patch string `json:"patch,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 (FindTool) Execute ¶
func (t FindTool) Execute(_ string, input FindToolInput) (FileToolResult, error)
type FindToolInput ¶
type FirstTimeSetupComponent ¶ added in v0.82.0
type FirstTimeSetupComponent struct {
// contains filtered or unexported fields
}
func NewFirstTimeSetupComponent ¶ added in v0.82.0
func NewFirstTimeSetupComponent(options FirstTimeSetupOptions) *FirstTimeSetupComponent
func (*FirstTimeSetupComponent) Focused ¶ added in v0.82.0
func (c *FirstTimeSetupComponent) Focused() bool
func (*FirstTimeSetupComponent) HandleInput ¶ added in v0.82.0
func (c *FirstTimeSetupComponent) HandleInput(data string)
func (*FirstTimeSetupComponent) Invalidate ¶ added in v0.82.0
func (c *FirstTimeSetupComponent) Invalidate()
func (*FirstTimeSetupComponent) Render ¶ added in v0.82.0
func (c *FirstTimeSetupComponent) Render(width int) []string
func (*FirstTimeSetupComponent) SetFocused ¶ added in v0.82.0
func (c *FirstTimeSetupComponent) SetFocused(focused bool)
func (*FirstTimeSetupComponent) State ¶ added in v0.82.0
func (c *FirstTimeSetupComponent) State() FirstTimeSetupState
type FirstTimeSetupEligibility ¶ added in v0.82.0
type FirstTimeSetupEligibility struct {
OfficialDistribution bool
ExperimentalFeatures bool
DefaultAgentDirectory bool
SettingsMissing bool
}
func (FirstTimeSetupEligibility) ShouldRun ¶ added in v0.82.0
func (e FirstTimeSetupEligibility) ShouldRun() bool
type FirstTimeSetupOptions ¶ added in v0.82.0
type FirstTimeSetupOptions struct {
DetectedTheme TerminalTheme
OnThemePreview func(TerminalTheme)
OnSubmit func(FirstTimeSetupResult)
OnCancel func()
}
type FirstTimeSetupResult ¶ added in v0.82.0
type FirstTimeSetupResult struct {
Theme TerminalTheme
}
type FirstTimeSetupRunnerOptions ¶ added in v0.82.0
type FirstTimeSetupState ¶ added in v0.82.0
type FirstTimeSetupState struct {
Step FirstTimeSetupStep
Theme TerminalTheme
}
FirstTimeSetupState is the single mutable state owned by the setup component. Rendering and submission are projections of this value.
type FirstTimeSetupStep ¶ added in v0.82.0
type FirstTimeSetupStep string
const ( FirstTimeSetupThemeStep FirstTimeSetupStep = "theme" FirstTimeSetupAnalyticsStep FirstTimeSetupStep = "analytics" )
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 {
}
type FooterGitBranchResolver ¶
type FooterState ¶
type FooterState struct {
}
type FrontmatterResult ¶
type FrontmatterResult = frontmatter.Result
func ParseFrontmatter ¶
func ParseFrontmatter(content string) (FrontmatterResult, error)
type GitSource ¶
func ParseGitURL ¶
type GrepTool ¶
type GrepTool struct {
// contains filtered or unexported fields
}
func NewGrepTool ¶
func (GrepTool) Execute ¶
func (t GrepTool) Execute(_ string, input GrepToolInput) (FileToolResult, error)
type GrepToolInput ¶
type HighlightOptions ¶
type HighlightOptions = syntaxhighlight.HighlightOptions
type HighlightTheme ¶
type HighlightTheme = syntaxhighlight.HighlightTheme
type HostActionError ¶
type HostActionRequest ¶
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 HostPolicyRequest ¶
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 HostProcessResult ¶
type IdleStatus ¶ added in v0.82.0
type IdleStatus struct{}
IdleStatus preserves the two-line status region after a shrinking render.
func (IdleStatus) Invalidate ¶ added in v0.82.0
func (IdleStatus) Invalidate()
Invalidate satisfies gitui.Component; IdleStatus has no cached state.
func (IdleStatus) Render ¶ added in v0.82.0
func (IdleStatus) Render(width int) []string
Render returns two blank lines matching the height of a status indicator.
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 ¶
func (b *InMemoryAuthStorageBackend) WithLock(fn AuthStorageLockFunc) error
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 ¶
func (h *InProcessCustomHandle) Done() <-chan InProcessCustomResult
type InProcessCustomOptions ¶
type InProcessCustomOptions struct {
Slot string
Overlay *gitui.OverlayOptions
}
type InProcessCustomResult ¶
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 (r *InProcessUIRegistry) ShowCustom(key string, factory InProcessCustomComponentFactory, options ...InProcessCustomOptions) (*InProcessCustomHandle, error)
func (*InProcessUIRegistry) Slots ¶
func (r *InProcessUIRegistry) Slots() []InProcessSlotRegistration
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 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 (c InteractiveExtensionUIContext) SetTheme(theme string) InteractiveThemeResult
func (InteractiveExtensionUIContext) SetToolsExpanded ¶
func (c InteractiveExtensionUIContext) SetToolsExpanded(expanded bool)
type InteractiveFlushCompactionOptions ¶
type InteractiveFlushCompactionOptions struct {
WillRetry bool
}
type InteractiveFooter ¶
type InteractiveFooter interface {
}
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 InteractiveMode ¶
type InteractiveMode struct {
SessionManager InteractiveSessionLeafProvider
RuntimeHost InteractiveRuntimeHost
UI InteractiveUI
Editor InteractiveEditor
Status InteractiveContainer
Chat InteractiveContainer
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 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 InteractiveSkillResource ¶
type InteractiveSkillResource struct {
FilePath string
Name string
SourceInfo *InteractiveSourceInfo
}
type InteractiveSourceInfo ¶
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 InteractiveUI ¶
type InteractiveUI interface {
Start()
Stop()
RequestRender(force ...bool)
Terminal() InteractiveTerminal
}
type KeybindingsConfig ¶
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 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
}
LoginDialogComponent is an ordered presentation state machine for one provider-owned authentication flow. Protocol state stays in the provider; this component retains only the blocks already shown and the current input.
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 string, instructions string, manualPrompt string, )
ShowAuth starts a new authorization-page presentation. The optional manual prompt is retained for callers that want to present both steps atomically.
func (*LoginDialogComponent) ShowDetails ¶ added in v0.82.0
func (c *LoginDialogComponent) ShowDetails(lines []string)
ShowDetails replaces the current content with application-owned setup details that should remain visible through the next provider prompt.
func (*LoginDialogComponent) ShowDeviceCode ¶ added in v0.82.0
func (c *LoginDialogComponent) ShowDeviceCode( verificationURI string, userCode string, )
ShowDeviceCode starts a provider device-code presentation.
func (*LoginDialogComponent) ShowInfo ¶
func (c *LoginDialogComponent) ShowInfo( lines []string, showClose ...bool, )
ShowInfo appends provider-owned information and links. showClose is used only for terminal informational dialogs that do not continue into a prompt.
func (*LoginDialogComponent) ShowManualInput ¶ added in v0.82.0
func (c *LoginDialogComponent) ShowManualInput(message string)
ShowManualInput appends the manual callback input to the authorization URL and instructions already displayed.
func (*LoginDialogComponent) ShowProgress ¶ added in v0.82.0
func (c *LoginDialogComponent) ShowProgress(message string)
ShowProgress appends one non-terminal provider status.
func (*LoginDialogComponent) ShowPrompt ¶ added in v0.82.0
func (c *LoginDialogComponent) ShowPrompt( message string, placeholder string, )
ShowPrompt appends one provider-owned text or secret prompt.
func (*LoginDialogComponent) ShowWaiting ¶ added in v0.82.0
func (c *LoginDialogComponent) ShowWaiting(message string)
ShowWaiting appends a cancellable polling state.
type LsTool ¶
type LsTool struct {
// contains filtered or unexported fields
}
func (LsTool) Execute ¶
func (t LsTool) Execute(_ string, input LsToolInput) (FileToolResult, error)
type LsToolInput ¶
type MigrationResult ¶
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 ModelCatalogRefreshFunc ¶ added in v0.82.0
type ModelCatalogRefreshFunc func( ctx context.Context, agentDir string, options ModelRegistryRefreshOptions, ) (llm.ModelsRefreshResult, error)
ModelCatalogRefreshFunc is the command boundary for an explicit catalog refresh. The agent directory and refresh policy are values so callers can test the command without installing process-global network hooks.
type ModelCostOverride ¶
type ModelOverride ¶
type ModelPatternOptions ¶
type ModelPatternOptions = modelresolver.ModelPatternOptions
type ModelPriceSource ¶ added in v0.82.0
ModelPriceSource is the narrow pricing boundary needed for full-miss estimates. ModelRuntime satisfies it directly.
type ModelRegistry ¶
type ModelRegistry struct {
// contains filtered or unexported fields
}
ModelRegistry is the synchronous coding-agent compatibility facade. Mutations are serialized under mu and readers consume detached snapshots; the shared llm.Models, credential storage, and ModelsStore boundaries it composes are independently safe for concurrent use.
func NewInMemoryModelRegistry ¶
func NewInMemoryModelRegistry(authStorage *AuthStorage) *ModelRegistry
func NewModelRegistry ¶
func NewModelRegistry(authStorage *AuthStorage, modelsJSONPath string) *ModelRegistry
func NewModelRegistryWithOptions ¶ added in v0.82.0
func NewModelRegistryWithOptions( ctx context.Context, options ModelRegistryOptions, ) *ModelRegistry
NewModelRegistryWithOptions builds a registry and restores dynamic catalogs. A network refresh occurs only when AllowModelNetwork is explicitly true.
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) GetAPIKeyAndHeadersWithOverrides ¶ added in v0.82.0
func (r *ModelRegistry) GetAPIKeyAndHeadersWithOverrides( ctx context.Context, model llm.Model, overrides llm.AuthResolutionOverrides, ) ResolvedRequestAuth
GetAPIKeyAndHeadersWithOverrides resolves one immutable request-auth snapshot. Request-scoped key and environment overrides are applied without mutating credential storage or the model registry.
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) GetRegisteredNativeProvider ¶ added in v0.82.0
func (r *ModelRegistry) GetRegisteredNativeProvider( provider string, ) (*llm.Provider, bool)
GetRegisteredNativeProvider projects the native provider owned by the bound ModelRuntime.
func (*ModelRegistry) GetRegisteredProviderConfig ¶ added in v0.82.0
func (r *ModelRegistry) GetRegisteredProviderConfig( provider string, ) (ProviderConfigInput, bool)
GetRegisteredProviderConfig returns a detached compatibility provider registration.
func (*ModelRegistry) GetRegisteredProviderIDs ¶ added in v0.82.0
func (r *ModelRegistry) GetRegisteredProviderIDs() []string
GetRegisteredProviderIDs returns configured and native registrations. Native providers are owned by ModelRuntime.
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) RefreshModels ¶ added in v0.82.0
func (r *ModelRegistry) RefreshModels( ctx context.Context, options ModelRegistryRefreshOptions, ) llm.ModelsRefreshResult
RefreshModels refreshes dynamic provider catalogs without reparsing models.json. The zero options value only restores persisted state.
func (*ModelRegistry) RegisterProvider ¶
func (r *ModelRegistry) RegisterProvider(providerName string, config ProviderConfigInput) error
func (*ModelRegistry) UnregisterProvider ¶
func (r *ModelRegistry) UnregisterProvider(providerName string)
type ModelRegistryOptions ¶ added in v0.82.0
type ModelRegistryOptions struct {
AuthStorage *AuthStorage
ModelsJSONPath string
ModelsStore llm.ModelsStore
RadiusClient llm.HTTPDoer
CatalogBaseURL string
CatalogClient llm.HTTPDoer
CatalogUserAgent string
ModelNetworkEnabled *bool
AllowModelNetwork bool
ModelRefreshTimeout time.Duration
}
ModelRegistryOptions supplies app-owned state and explicit startup network policy. Network catalog refresh is disabled by the zero value.
type ModelRegistryRefreshOptions ¶ added in v0.82.0
ModelRegistryRefreshOptions controls an explicit dynamic catalog refresh. Network access is disabled by the zero value.
type ModelRuntime ¶ added in v0.82.0
type ModelRuntime struct {
// contains filtered or unexported fields
}
ModelRuntime is the coding-agent ownership boundary for model discovery, provider composition, credentials, and request dispatch.
Mutations are serialized under mu and publish immutable snapshots. A prepared request captures one provider, model, auth result, and option set before invoking extension transforms or transport code, so an in-flight request never observes a half-applied provider reload.
func NewModelRuntime ¶ added in v0.82.0
func NewModelRuntime( ctx context.Context, options ModelRuntimeOptions, ) (*ModelRuntime, error)
NewModelRuntime constructs a runtime from either an existing compatibility registry or the supplied registry options.
func NewModelRuntimeFromRegistry ¶ added in v0.82.0
func NewModelRuntimeFromRegistry( registry *ModelRegistry, ) (*ModelRuntime, error)
NewModelRuntimeFromRegistry promotes a loaded compatibility registry into the canonical instance request runtime.
func (*ModelRuntime) CheckAuth ¶ added in v0.82.0
func (r *ModelRuntime) CheckAuth( ctx context.Context, providerID string, ) (llm.AuthCheck, bool, error)
CheckAuth reports provider auth without exposing request secrets.
func (*ModelRuntime) Complete ¶ added in v0.82.0
func (r *ModelRuntime) Complete( ctx context.Context, model llm.Model, llmContext llm.Context, options llm.ModelsStreamOptions, ) (llm.Message, error)
Complete collects Stream's terminal assistant message.
func (*ModelRuntime) CompleteSimple ¶ added in v0.82.0
func (r *ModelRuntime) CompleteSimple( ctx context.Context, model llm.Model, llmContext llm.Context, options llm.ModelsStreamOptions, ) (llm.Message, error)
CompleteSimple collects StreamSimple's terminal assistant message.
func (*ModelRuntime) ForceRefreshAvailability ¶ added in v0.82.0
func (r *ModelRuntime) ForceRefreshAvailability( ctx context.Context, ) error
ForceRefreshAvailability waits for an older refresh before publishing a post-mutation snapshot.
func (*ModelRuntime) GetAll ¶ added in v0.82.0
func (r *ModelRuntime) GetAll() []llm.Model
GetAll implements CodingModelRegistry.
func (*ModelRuntime) GetAuth ¶ added in v0.82.0
func (r *ModelRuntime) GetAuth( ctx context.Context, model llm.Model, overrides llm.AuthResolutionOverrides, ) (*ResolvedRequestAuth, error)
GetAuth resolves one request-scoped auth snapshot.
func (*ModelRuntime) GetAvailable ¶ added in v0.82.0
func (r *ModelRuntime) GetAvailable() []llm.Model
GetAvailable returns the last fully published availability snapshot and implements CodingModelRegistry without hidden network access.
func (*ModelRuntime) GetAvailableSnapshot ¶ added in v0.82.0
func (r *ModelRuntime) GetAvailableSnapshot() []llm.Model
GetAvailableSnapshot returns a detached immutable availability view.
func (*ModelRuntime) GetCompatibilityRequestConfig ¶ added in v0.82.0
func (r *ModelRuntime) GetCompatibilityRequestConfig( model llm.Model, ) ProviderRequestConfig
GetCompatibilityRequestConfig returns a detached legacy request projection assembled from the same declarative provider layers as canonical auth.
func (*ModelRuntime) GetError ¶ added in v0.82.0
func (r *ModelRuntime) GetError() string
GetError combines configuration, provider-composition, and availability diagnostics without discarding a usable catalog.
func (*ModelRuntime) GetModel ¶ added in v0.82.0
GetModel finds one model in the current provider snapshot.
func (*ModelRuntime) GetModels ¶ added in v0.82.0
func (r *ModelRuntime) GetModels( providerID ...string, ) []llm.Model
GetModels returns a detached current catalog snapshot.
func (*ModelRuntime) GetProvider ¶ added in v0.82.0
func (r *ModelRuntime) GetProvider( providerID string, ) (*llm.Provider, bool)
GetProvider resolves one provider from this runtime only.
func (*ModelRuntime) GetProviderAuth ¶ added in v0.82.0
func (r *ModelRuntime) GetProviderAuth( ctx context.Context, providerID string, ) (*llm.AuthResult, error)
GetProviderAuth resolves one provider-scoped auth snapshot without requiring a catalog model. Management-plane clients use this to share the same stored credential and environment precedence as inference requests.
func (*ModelRuntime) GetProviderAuthStatus ¶ added in v0.82.0
func (r *ModelRuntime) GetProviderAuthStatus( providerID string, ) AuthStatus
GetProviderAuthStatus returns a synchronous status projection suitable for UI and RPC responses.
func (*ModelRuntime) GetProviders ¶ added in v0.82.0
func (r *ModelRuntime) GetProviders() []*llm.Provider
GetProviders returns the current instance provider order.
func (*ModelRuntime) GetRegisteredNativeProvider ¶ added in v0.82.0
func (r *ModelRuntime) GetRegisteredNativeProvider( providerID string, ) (*llm.Provider, bool)
GetRegisteredNativeProvider returns the exact registered provider object.
func (*ModelRuntime) GetRegisteredProviderConfig ¶ added in v0.82.0
func (r *ModelRuntime) GetRegisteredProviderConfig( providerID string, ) (ProviderConfigInput, bool)
GetRegisteredProviderConfig returns a detached extension-style provider overlay.
func (*ModelRuntime) GetRegisteredProviderIDs ¶ added in v0.82.0
func (r *ModelRuntime) GetRegisteredProviderIDs() []string
GetRegisteredProviderIDs returns config and native registrations in stable insertion order.
func (*ModelRuntime) HasConfiguredAuth ¶ added in v0.82.0
func (r *ModelRuntime) HasConfiguredAuth(providerID string) bool
HasConfiguredAuth reads the published auth snapshot.
func (*ModelRuntime) IsUsingOAuth ¶ added in v0.82.0
func (r *ModelRuntime) IsUsingOAuth(providerID string) bool
IsUsingOAuth reads the published auth snapshot.
func (*ModelRuntime) ListCredentials ¶ added in v0.82.0
func (r *ModelRuntime) ListCredentials( ctx context.Context, ) ([]llm.CredentialInfo, error)
ListCredentials returns metadata only; request secrets remain inside the credential boundary.
func (*ModelRuntime) Login ¶ added in v0.82.0
func (r *ModelRuntime) Login( ctx context.Context, providerID string, credentialType llm.CredentialType, interaction llm.AuthInteraction, ) (llm.Credential, error)
Login runs a provider-owned login flow and refreshes dependent model state.
func (*ModelRuntime) Logout ¶ added in v0.82.0
func (r *ModelRuntime) Logout( ctx context.Context, providerID string, ) error
Logout removes one provider credential and rebuilds credential-dependent model projections.
func (*ModelRuntime) ModelRegistry ¶ added in v0.82.0
func (r *ModelRuntime) ModelRegistry() *ModelRegistry
ModelRegistry returns the legacy synchronous facade backed by this runtime. New request paths should use ModelRuntime directly.
func (*ModelRuntime) Refresh ¶ added in v0.82.0
func (r *ModelRuntime) Refresh( ctx context.Context, options ModelRegistryRefreshOptions, ) (llm.ModelsRefreshResult, error)
Refresh reparses configuration, refreshes dynamic catalogs according to the explicit network policy, and coalesces concurrent callers.
func (*ModelRuntime) RefreshAvailability ¶ added in v0.82.0
func (r *ModelRuntime) RefreshAvailability(ctx context.Context) error
RefreshAvailability coalesces concurrent availability readers.
func (*ModelRuntime) RegisterNativeProvider ¶ added in v0.82.0
func (r *ModelRuntime) RegisterNativeProvider( provider *llm.Provider, ) error
RegisterNativeProvider installs a provider with its native auth and transport implementation.
func (*ModelRuntime) RegisterProvider ¶ added in v0.82.0
func (r *ModelRuntime) RegisterProvider( providerID string, config ProviderConfigInput, ) error
RegisterProvider composes an extension-style provider overlay.
func (*ModelRuntime) RemoveRuntimeAPIKey ¶ added in v0.82.0
func (r *ModelRuntime) RemoveRuntimeAPIKey( ctx context.Context, providerID string, ) error
RemoveRuntimeAPIKey removes only the process-local key.
func (*ModelRuntime) SetRuntimeAPIKey ¶ added in v0.82.0
func (r *ModelRuntime) SetRuntimeAPIKey( ctx context.Context, providerID string, apiKey string, ) error
SetRuntimeAPIKey installs a process-local key and publishes the resulting model availability.
func (*ModelRuntime) Stream ¶ added in v0.82.0
func (r *ModelRuntime) Stream( ctx context.Context, model llm.Model, llmContext llm.Context, options llm.ModelsStreamOptions, ) (*llm.AssistantMessageEventStream, error)
Stream prepares and dispatches one provider-native stream.
func (*ModelRuntime) StreamSimple ¶ added in v0.82.0
func (r *ModelRuntime) StreamSimple( ctx context.Context, model llm.Model, llmContext llm.Context, options llm.ModelsStreamOptions, ) (*llm.AssistantMessageEventStream, error)
StreamSimple prepares and dispatches one simple provider stream.
func (*ModelRuntime) UnregisterProvider ¶ added in v0.82.0
func (r *ModelRuntime) UnregisterProvider(providerID string)
UnregisterProvider removes config and native registrations, then restores the built-in provider with the same ID when present.
type ModelRuntimeOptions ¶ added in v0.82.0
type ModelRuntimeOptions struct {
Registry *ModelRegistry
Credentials llm.CredentialStore
ModelRegistryOptions
}
ModelRuntimeOptions supplies the compatibility configuration facade and credential boundary used to compose an instance-scoped provider runtime. Supplying Registry ignores ModelRegistryOptions; an explicit Credentials store still replaces the registry's default AuthStorage for canonical runtime operations.
type ModelScopeDiagnostic ¶ added in v0.82.0
type ModelScopeDiagnostic = modelresolver.ModelScopeDiagnostic
type ModelScopeDiagnosticCode ¶ added in v0.82.1
type ModelScopeDiagnosticCode = modelresolver.ModelScopeDiagnosticCode
const ( ModelScopeDiagnosticNoMatch ModelScopeDiagnosticCode = modelresolver.ModelScopeDiagnosticNoMatch ModelScopeDiagnosticInvalidThinkingLevel ModelScopeDiagnosticCode = modelresolver.ModelScopeDiagnosticInvalidThinkingLevel )
type ModelScopeDiagnosticType ¶ added in v0.82.0
type ModelScopeDiagnosticType = modelresolver.ModelScopeDiagnosticType
const ModelScopeDiagnosticWarning ModelScopeDiagnosticType = modelresolver.ModelScopeDiagnosticWarning
type ModelSelectorCallbacks ¶
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) Close ¶ added in v0.82.0
func (c *ModelSelectorComponent) Close()
Close cancels an in-flight catalog refresh. It is safe to call repeatedly.
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
Runtime ModelSelectorRuntime
RefreshOptions ModelRegistryRefreshOptions
RequestRender func()
}
type ModelSelectorRuntime ¶ added in v0.82.0
type ModelSelectorRuntime interface {
GetAvailableSnapshot() []llm.Model
GetModel(providerID, modelID string) (llm.Model, bool)
GetError() string
Refresh(
context.Context,
ModelRegistryRefreshOptions,
) (llm.ModelsRefreshResult, error)
}
ModelSelectorRuntime is the narrow catalog boundary consumed by the interactive selector. ModelRuntime implements it, while callers can provide deterministic implementations without constructing provider transports.
type NewSessionOptions ¶
type OAuthProvider ¶
type OAuthProvider struct {
ID string
Name string
Login func(context.Context, llm.AuthInteraction) (AuthCredential, error)
RefreshToken func(AuthCredential) (AuthCredential, error)
GetAPIKey func(AuthCredential) string
ModifyModels func([]llm.Model, AuthCredential) []llm.Model
}
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)
MarkPathIgnoredByCloudSync func(path string)
}
type PackageManagerOptions ¶
type PackageManagerOptions struct {
CWD string
AgentDir string
SettingsManager *SettingsManager
Operations PackageManagerOperations
Progress func(PackageProgressEvent)
}
type PackageProgressEvent ¶
type PackageResourceConfigOptions ¶
type PackageResourceConfigOptions struct {
CWD string
AgentDir string
Terminal gitui.Terminal
SettingsManager *SettingsManager
WriteScope ResourceConfigWriteScope
}
type PackageResourceToggle ¶
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 PackageUpdateChecker ¶
type PackageUpdateSuggestionError ¶
func (PackageUpdateSuggestionError) Error ¶
func (e PackageUpdateSuggestionError) Error() string
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 PrintModePromptOptions ¶
type PrintModePromptOptions struct {
Images []llm.ContentPart
}
type PrintModeRuntimeHost ¶
type PrintModeRuntimeHost interface {
PrintModeSession() PrintModeSession
Dispose() error
}
type PrintModeSession ¶
type ProcessFileArgumentsOptions ¶
type ProcessFileArgumentsOptions struct {
CWD string
AutoResizeImages *bool
ResizeImage func(part llm.ContentPart, options ImageResizeOptions) *ResizedImage
}
type ProcessImageOptions ¶ added in v0.82.0
type ProcessImageOptions = imageresize.ProcessImageOptions
type ProcessImageResult ¶ added in v0.82.0
type ProcessImageResult = imageresize.ProcessImageResult
func ProcessImage ¶ added in v0.82.0
func ProcessImage(data []byte, mimeType string, options ...ProcessImageOptions) ProcessImageResult
type ProcessedFileArguments ¶
type ProcessedFileArguments struct {
Text string
Images []llm.ContentPart
}
func ProcessFileArguments ¶
func ProcessFileArguments(paths []string, options ...ProcessFileArgumentsOptions) (ProcessedFileArguments, error)
type ProjectResourceOverrideState ¶ added in v0.82.0
type ProjectResourceOverrideState string
ProjectResourceOverrideState is the persisted project-layer decision for one resource. Inherit delegates to the user layer; load and unload are explicit project overrides.
const ( ProjectResourceInherit ProjectResourceOverrideState = "inherit" ProjectResourceLoad ProjectResourceOverrideState = "load" ProjectResourceUnload ProjectResourceOverrideState = "unload" )
func NextProjectResourceOverrideState ¶ added in v0.82.0
func NextProjectResourceOverrideState(current ProjectResourceOverrideState, inheritedEnabled bool) ProjectResourceOverrideState
NextProjectResourceOverrideState implements Pi's asymmetric three-state cycle. The order always makes the first key press change effective behavior.
type ProjectTrustOption ¶ added in v0.82.0
type ProjectTrustOption struct {
Label string
Trusted bool
Updates []ProjectTrustUpdate
SavedPath string
}
func GetProjectTrustOptions ¶ added in v0.82.0
func GetProjectTrustOptions(cwd string, includeSessionOnly bool) []ProjectTrustOption
type ProjectTrustPrompt ¶ added in v0.82.0
type ProjectTrustPrompt func(cwd string, options []ProjectTrustOption) (*ProjectTrustOption, error)
type ProjectTrustStore ¶ added in v0.82.0
type ProjectTrustStore struct {
// contains filtered or unexported fields
}
func NewProjectTrustStore ¶ added in v0.82.0
func NewProjectTrustStore(agentDir string) *ProjectTrustStore
func (*ProjectTrustStore) Clear ¶ added in v0.82.0
func (s *ProjectTrustStore) Clear(cwd string) error
func (*ProjectTrustStore) Get ¶ added in v0.82.0
func (s *ProjectTrustStore) Get(cwd string) (decision bool, found bool, err error)
func (*ProjectTrustStore) GetEntry ¶ added in v0.82.0
func (s *ProjectTrustStore) GetEntry(cwd string) (*ProjectTrustStoreEntry, error)
func (*ProjectTrustStore) Path ¶ added in v0.82.0
func (s *ProjectTrustStore) Path() string
func (*ProjectTrustStore) Set ¶ added in v0.82.0
func (s *ProjectTrustStore) Set(cwd string, decision bool) error
func (*ProjectTrustStore) SetMany ¶ added in v0.82.0
func (s *ProjectTrustStore) SetMany(updates []ProjectTrustUpdate) error
type ProjectTrustStoreEntry ¶ added in v0.82.0
type ProjectTrustUpdate ¶ added in v0.82.0
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 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 (c ProtocolCommandContext) Fork(entryID string, options ...ProtocolForkOptions) (ProtocolCommandForkResult, error)
func (ProtocolCommandContext) NewSession ¶
func (c ProtocolCommandContext) NewSession(options ...ProtocolNewSessionOptions) (ProtocolCommandSwitchResult, error)
func (ProtocolCommandContext) Reload ¶
func (c ProtocolCommandContext) Reload() error
func (ProtocolCommandContext) SendUserMessage ¶
func (c ProtocolCommandContext) SendUserMessage(text string, options ...ProtocolSendUserMessageOptions) error
func (ProtocolCommandContext) SwitchSession ¶
func (c ProtocolCommandContext) SwitchSession(sessionFile string, options ...ProtocolSwitchSessionOptions) (ProtocolCommandSwitchResult, error)
func (ProtocolCommandContext) WaitForIdle ¶ added in v0.82.0
func (c ProtocolCommandContext) WaitForIdle() error
type ProtocolCommandContextActions ¶
type ProtocolCommandContextActions struct {
WaitForIdle func() error
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 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 ProtocolEntryRenderOptions ¶ added in v0.82.0
type ProtocolEntryRenderOptions struct {
Expanded bool
}
type ProtocolEntryRenderer ¶ added in v0.82.0
type ProtocolEntryRenderer func( entry FileEntry, options ProtocolEntryRenderOptions, ) gitui.Component
ProtocolEntryRenderer is a trusted in-process rendering boundary. Portable process extensions use ViewTree nodes instead of passing component handles across RPC.
type ProtocolEntryRendererRegistration ¶ added in v0.82.0
type ProtocolEntryRendererRegistration struct {
CustomType string
SourceInfo ProtocolSourceInfo
Renderer ProtocolEntryRenderer
}
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
ProjectTrust *ProtocolProjectTrustResult
}
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) IsIdle ¶ added in v0.82.0
func (c *ProtocolExtensionContext) IsIdle() bool
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 (c *ProtocolExtensionContext) OnInput(handler ProtocolInputHandler) error
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) RegisterEntryRenderer ¶ added in v0.82.0
func (c *ProtocolExtensionContext) RegisterEntryRenderer(customType string, renderer ProtocolEntryRenderer) 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 (c *ProtocolExtensionContext) SendCustomMessage(message ProtocolCustomMessage, options ProtocolSendCustomMessageOptions) error
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 (c *ProtocolExtensionContext) Signal() *ProtocolAbortSignal
func (*ProtocolExtensionContext) UnregisterProvider ¶
func (c *ProtocolExtensionContext) UnregisterProvider(provider string) error
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 ProtocolExtensionFactory ¶
type ProtocolExtensionFactory struct {
Path string
Name string
Hidden bool
Factory func(*ProtocolExtensionContext) error
}
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 (p *ProtocolExtensionProcess) Start(ctx context.Context, host *RPCSessionHost, timeout time.Duration) error
type ProtocolExtensionProcessSupervisor ¶
type ProtocolExtensionProcessSupervisor struct {
Host *RPCSessionHost
StartTimeout time.Duration
ShutdownTimeout time.Duration
// contains filtered or unexported fields
}
func NewProtocolExtensionProcessSupervisor ¶
func NewProtocolExtensionProcessSupervisor(host *RPCSessionHost, specs []ProtocolPackageProcessExtension) *ProtocolExtensionProcessSupervisor
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 (s *ProtocolExtensionProcessSupervisor) EmitSessionEvent(event ProtocolSessionEvent) error
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 (s *ProtocolExtensionProcessSupervisor) Processes() []*ProtocolExtensionProcess
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 (r *ProtocolExtensionRuntime) AutocompleteProviders() []ProtocolAutocompleteProviderRegistration
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) BindModelRuntime ¶ added in v0.82.0
func (r *ProtocolExtensionRuntime) BindModelRuntime( runtime *ModelRuntime, )
BindModelRuntime routes provider mutations through the instance runtime while retaining the compatibility registry for legacy extension surfaces.
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) EmitBeforeProviderHeaders ¶ added in v0.82.0
func (r *ProtocolExtensionRuntime) EmitBeforeProviderHeaders( ctx context.Context, headers map[string]string, model *llm.Model, ) map[string]string
EmitBeforeProviderHeaders runs after provider, model, and request headers have been assembled. Every handler receives the same mutable map, so changes flow to the next handler and then to the HTTP transport. A failing extension is diagnosed and isolated instead of preventing later handlers from running.
func (*ProtocolExtensionRuntime) EmitInput ¶
func (r *ProtocolExtensionRuntime) EmitInput(text string, images []llm.ContentPart, source string) ProtocolInputResult
func (*ProtocolExtensionRuntime) EmitProjectTrustEvent ¶ added in v0.82.0
func (r *ProtocolExtensionRuntime) EmitProjectTrustEvent( context ProtocolProjectTrustContext, ) (*ProtocolProjectTrustResult, []ProtocolExtensionError)
EmitProjectTrustEvent isolates handler failures and returns the first decisive answer. An undecided result deliberately falls through so later handlers and extensions can participate in the decision.
func (*ProtocolExtensionRuntime) EmitSessionEvent ¶
func (r *ProtocolExtensionRuntime) EmitSessionEvent(event ProtocolSessionEvent) (ProtocolEventResult, error)
func (*ProtocolExtensionRuntime) FlagDiagnostics ¶
func (r *ProtocolExtensionRuntime) FlagDiagnostics() []ProtocolExtensionFlagDiagnostic
func (*ProtocolExtensionRuntime) FlagValue ¶
func (r *ProtocolExtensionRuntime) FlagValue(name string) any
func (*ProtocolExtensionRuntime) Flags ¶
func (r *ProtocolExtensionRuntime) Flags() []ProtocolFlagRegistration
func (*ProtocolExtensionRuntime) GetActiveTools ¶ added in v0.82.0
func (r *ProtocolExtensionRuntime) GetActiveTools() []string
func (*ProtocolExtensionRuntime) GetCommand ¶
func (r *ProtocolExtensionRuntime) GetCommand(invocationName string) *ProtocolCommandRegistration
func (*ProtocolExtensionRuntime) GetEntryRenderer ¶ added in v0.82.0
func (r *ProtocolExtensionRuntime) GetEntryRenderer(customType string) ProtocolEntryRenderer
func (*ProtocolExtensionRuntime) GetMessageRenderer ¶
func (r *ProtocolExtensionRuntime) GetMessageRenderer(customType string) ProtocolMessageRenderer
func (*ProtocolExtensionRuntime) GetModelRegistry ¶ added in v0.82.0
func (r *ProtocolExtensionRuntime) GetModelRegistry() *ModelRegistry
func (*ProtocolExtensionRuntime) GetRegisteredToolDefinition ¶
func (r *ProtocolExtensionRuntime) GetRegisteredToolDefinition(toolName string) ToolDefinition
func (*ProtocolExtensionRuntime) GetSystemPrompt ¶
func (r *ProtocolExtensionRuntime) GetSystemPrompt() string
func (*ProtocolExtensionRuntime) GetToolRenderer ¶
func (r *ProtocolExtensionRuntime) GetToolRenderer(toolName string) *ProtocolToolRendererRegistration
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) OrderSources ¶ added in v0.82.0
func (r *ProtocolExtensionRuntime) OrderSources( sources []ProtocolSourceInfo, )
OrderSources projects the final resource-loader order onto registries that were populated across multiple load phases. Stable sorting preserves the registration order within each extension and leaves runtime-only sources at the end.
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 (r *ProtocolExtensionRuntime) SendCustomMessage(message ProtocolCustomMessage, options ProtocolSendCustomMessageOptions) error
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 (r *ProtocolExtensionRuntime) Shortcuts(keybindings KeybindingsConfig) ProtocolShortcutsResult
func (*ProtocolExtensionRuntime) SuggestAutocomplete ¶
func (r *ProtocolExtensionRuntime) SuggestAutocomplete(ctx context.Context, request ProtocolAutocompleteRequest) (ProtocolAutocompleteResult, error)
func (*ProtocolExtensionRuntime) UnknownCLIFlagDiagnostics ¶
func (r *ProtocolExtensionRuntime) UnknownCLIFlagDiagnostics() []ProtocolExtensionFlagDiagnostic
func (*ProtocolExtensionRuntime) ViewTreeMounts ¶
func (r *ProtocolExtensionRuntime) ViewTreeMounts() []ProtocolViewTreeMountRegistration
type ProtocolExtensionSource ¶
type ProtocolExtensionSource struct {
Path string
BaseDir string
Metadata ProtocolSourceInfo
Hidden bool
}
type ProtocolFlagDefinition ¶
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 ProtocolMessageRendererRegistration ¶
type ProtocolMessageRendererRegistration struct {
CustomType string
SourceInfo ProtocolSourceInfo
Renderer ProtocolMessageRenderer
}
type ProtocolNewSessionOptions ¶
type ProtocolNewSessionOptions struct {
ParentSession string
WithSession func(ProtocolCommandContext) error
}
type ProtocolPackageResource ¶
type ProtocolPackageResource struct {
Path string
Enabled bool
Metadata ProtocolSourceInfo
}
type ProtocolPackageResources ¶
type ProtocolPackageResources struct {
Extensions []ProtocolPackageResource
ProcessExtensions []ProtocolPackageProcessExtension
Skills []ProtocolPackageResource
Prompts []ProtocolPackageResource
Themes []ProtocolPackageResource
}
type ProtocolPackageSourceSpec ¶
type ProtocolPackageSourceSpec struct {
Source string
Scope string
Autoload *bool
Filters ProtocolPackageResourceFilters
}
type ProtocolProjectTrustContext ¶ added in v0.82.0
type ProtocolProjectTrustContext struct {
CWD string
Mode string
HasUI bool
Select func(prompt string, options []string) (string, error)
Confirm func(prompt string) (bool, error)
Input func(prompt string) (string, error)
// InputWithPlaceholder preserves Pi's two-field startup input contract
// while Input remains the backward-compatible single-prompt form.
InputWithPlaceholder func(title, placeholder string) (string, error)
Notify func(message string) error
}
ProtocolProjectTrustContext describes the startup surface available to a trusted in-process extension. UI functions are optional so print and RPC modes do not need a synthetic terminal implementation.
type ProtocolProjectTrustDecision ¶ added in v0.82.0
type ProtocolProjectTrustDecision string
ProtocolProjectTrustDecision is an extension's trust answer.
const ( // ProtocolProjectTrustYes trusts the project for the current runtime. ProtocolProjectTrustYes ProtocolProjectTrustDecision = "yes" // ProtocolProjectTrustNo rejects project-local settings and resources. ProtocolProjectTrustNo ProtocolProjectTrustDecision = "no" // ProtocolProjectTrustUndecided delegates to the next handler or fallback. ProtocolProjectTrustUndecided ProtocolProjectTrustDecision = "undecided" )
type ProtocolProjectTrustResult ¶ added in v0.82.0
type ProtocolProjectTrustResult struct {
Trusted ProtocolProjectTrustDecision
Remember bool
}
ProtocolProjectTrustResult is a decisive or fall-through extension result.
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 ¶
func (ProtocolRuntimeError) Error ¶
func (e ProtocolRuntimeError) Error() string
type ProtocolSendUserMessageOptions ¶
type ProtocolSendUserMessageOptions struct {
DeliverAs string
}
type ProtocolSessionEvent ¶
type ProtocolSessionEvent struct {
Context context.Context
Type string
Reason string
WillRetry bool
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
CustomInstructions string
CompactionEntry *FileEntry
FromExtension bool
Name string
Payload any
Status int
Headers map[string]string
ProjectTrustContext *ProtocolProjectTrustContext
}
type ProtocolShortcutRegistration ¶
type ProtocolShortcutRegistration struct {
Key string
Description string
SourceInfo ProtocolSourceInfo
Handler func() error
}
type ProtocolShortcutWarning ¶
type ProtocolShortcutsResult ¶
type ProtocolShortcutsResult struct {
Shortcuts map[string]ProtocolShortcutRegistration
Warnings []ProtocolShortcutWarning
}
type ProtocolSourceInfo ¶
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 ProviderAttributionContext ¶ added in v0.82.0
type ProviderAttributionContext = attribution.Context
ProviderAttributionContext is the immutable session and telemetry state used to derive headers for one provider request.
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:"-"`
RefreshModels func(context.Context, llm.RefreshModelsContext) ([]ProviderModelDefinition, error) `json:"-"`
Compat llm.ModelCompat
Models []ProviderModelDefinition
ModelOverrides map[string]ModelOverride
}
type ProviderModelDefinition ¶
type ProviderRequestConfig ¶
type ProviderRequestSettings ¶ added in v0.82.0
type ProviderRequestSettings struct {
Transport string
HTTPProxy string
HTTP llm.HTTPRuntimeConfig
RequestTimeout time.Duration
WebSocketConnectTimeout *time.Duration
MaxRetries int
MaxRetryDelayMS int
}
ProviderRequestSettings is one immutable projection of mutable application settings into provider-facing transport and retry policy.
type ProviderRetrySettings ¶
type QueuedCustomMessage ¶
type QueuedUserMessage ¶
type QueuedUserMessage struct {
Text string `json:"text"`
Images []llm.ContentPart `json:"images,omitempty"`
Custom *QueuedCustomMessage `json:"custom,omitempty"`
}
type RPCClient ¶
type RPCClient struct {
// contains filtered or unexported fields
}
func NewRPCClient ¶
func NewRPCClient(sender RPCCommandSender) *RPCClient
func NewRPCProcessClient ¶ added in v0.82.0
func NewRPCProcessClient(options RPCProcessOptions) *RPCClient
NewRPCProcessClient creates an RPC client backed by a stopped subprocess.
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 (*RPCClient) FollowUpWithImages ¶
func (*RPCClient) GetAvailableModels ¶
func (*RPCClient) GetAvailableThinkingLevels ¶ added in v0.82.0
func (*RPCClient) GetCommands ¶
func (c *RPCClient) GetCommands(ctx context.Context) ([]RPCSlashCommand, error)
func (*RPCClient) GetEntries ¶ added in v0.82.0
func (*RPCClient) GetForkMessages ¶
func (c *RPCClient) GetForkMessages(ctx context.Context) ([]AgentSessionForkMessage, error)
func (*RPCClient) GetLastAssistantText ¶
func (*RPCClient) GetMessages ¶
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) GetTree ¶ added in v0.82.0
func (c *RPCClient) GetTree(ctx context.Context) (RPCTreeResult, error)
func (*RPCClient) NewSession ¶
func (*RPCClient) OnEvent ¶ added in v0.82.0
func (c *RPCClient) OnEvent(listener func(AgentSessionEvent)) func()
func (*RPCClient) PromptWithImages ¶
func (*RPCClient) SetAutoCompaction ¶
func (*RPCClient) SetAutoRetry ¶
func (*RPCClient) SetFollowUpMode ¶
func (*RPCClient) SetSessionName ¶
func (*RPCClient) SetSteeringMode ¶
func (*RPCClient) SetThinkingLevel ¶
func (*RPCClient) SteerWithImages ¶
func (*RPCClient) SwitchSession ¶
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"`
Since *string `json:"since,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 RPCEntriesResult ¶ added in v0.82.0
type RPCEntriesResult = SessionEntriesSnapshot
type RPCExportHTMLResult ¶
type RPCExportHTMLResult struct {
Path string `json:"path"`
}
type RPCForkMessagesResult ¶
type RPCForkMessagesResult struct {
Messages []AgentSessionForkMessage `json:"messages"`
}
type RPCForkResult ¶
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 RPCProcessExitError ¶ added in v0.82.0
RPCProcessExitError records the stable process state and stderr tail observed when an RPC subprocess exits unexpectedly.
func (*RPCProcessExitError) Error ¶ added in v0.82.0
func (e *RPCProcessExitError) Error() string
func (*RPCProcessExitError) Unwrap ¶ added in v0.82.0
func (e *RPCProcessExitError) Unwrap() error
type RPCProcessOptions ¶ added in v0.82.0
type RPCProcessOptions struct {
Command string
Args []string
CWD string
Env map[string]string
RequestTimeout time.Duration
ShutdownTimeout time.Duration
Stderr io.Writer
}
RPCProcessOptions configures the subprocess transport used by RPCClient. A nil Args slice starts the current executable with "--mode rpc".
type RPCProcessTransport ¶ added in v0.82.0
type RPCProcessTransport struct {
// contains filtered or unexported fields
}
RPCProcessTransport owns subprocess lifecycle and JSONL response routing. RPCClient remains a typed protocol facade and delegates transport state here.
func NewRPCProcessTransport ¶ added in v0.82.0
func NewRPCProcessTransport(options RPCProcessOptions) *RPCProcessTransport
NewRPCProcessTransport creates a stopped subprocess transport.
func (*RPCProcessTransport) GetStderr ¶ added in v0.82.0
func (t *RPCProcessTransport) GetStderr() string
func (*RPCProcessTransport) OnEvent ¶ added in v0.82.0
func (t *RPCProcessTransport) OnEvent(listener func(AgentSessionEvent)) func()
func (*RPCProcessTransport) SendRPCCommand ¶ added in v0.82.0
func (t *RPCProcessTransport) SendRPCCommand(ctx context.Context, command RPCCommand) (RPCResponse, error)
type RPCResponse ¶
type RPCScopedModel ¶
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) GetAvailableThinkingLevels ¶ added in v0.82.0
func (h *RPCSessionHost) GetAvailableThinkingLevels() []string
func (*RPCSessionHost) GetCommands ¶
func (h *RPCSessionHost) GetCommands() RPCCommandsResult
func (*RPCSessionHost) GetEntries ¶ added in v0.82.0
func (h *RPCSessionHost) GetEntries(since *string) (RPCEntriesResult, error)
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) GetTree ¶ added in v0.82.0
func (h *RPCSessionHost) GetTree() (RPCTreeResult, error)
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 RPCSlashCommand ¶
type RPCThinkingLevelResult ¶
type RPCThinkingLevelResult struct {
Level string `json:"level"`
}
type RPCThinkingLevelsResult ¶ added in v0.82.0
type RPCThinkingLevelsResult struct {
Levels []string `json:"levels"`
}
type RPCTreeResult ¶ added in v0.82.0
type RPCTreeResult = SessionTreeSnapshot
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(toolCallID string, input ReadToolInput) (FileToolResult, error)
type ReadToolInput ¶
type ReadToolOptions ¶
type ReadToolOptions struct {
AutoResizeImages *bool
}
type ReadToolTruncation ¶
type ReadToolTruncation = agentharness.TruncationResult
type ResizedImage ¶
type ResizedImage = imageresize.ResizedImage
func ResizeImage ¶
func ResizeImage(part llm.ContentPart, options ...ImageResizeOptions) *ResizedImage
func ResizeImageBytes ¶ added in v0.82.0
func ResizeImageBytes(data []byte, mimeType string, 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 ResolveModelScopeResult ¶ added in v0.82.0
type ResolveModelScopeResult = modelresolver.ResolveModelScopeResult
func ResolveModelScopeWithDiagnostics ¶ added in v0.82.0
func ResolveModelScopeWithDiagnostics(patterns []string, registry CodingModelRegistry) ResolveModelScopeResult
type ResolveProjectTrustOptions ¶ added in v0.82.0
type ResolveProjectTrustOptions struct {
CWD string
TrustStore *ProjectTrustStore
TrustOverride *bool
DefaultProjectTrust DefaultProjectTrust
Prompt ProjectTrustPrompt
ExtensionRuntime *ProtocolExtensionRuntime
ExtensionContext ProtocolProjectTrustContext
OnExtensionError func(ProtocolExtensionError)
}
type ResolvedRequestAuth ¶
type ResourceAgentsFilesResult ¶
type ResourceAgentsFilesResult struct {
AgentsFiles []ResourceContextFile
}
type ResourceConfigSnapshot ¶ added in v0.82.0
type ResourceConfigSnapshot struct {
// contains filtered or unexported fields
}
ResourceConfigSnapshot is an immutable pair of resource projections. The selector owns presentation state; SettingsManager remains the only owner of persisted configuration.
func (ResourceConfigSnapshot) InheritedEnabled ¶ added in v0.82.0
func (s ResourceConfigSnapshot) InheritedEnabled(item PackageResourceToggleItem) (bool, bool)
InheritedEnabled returns the effective user-layer state for item. The boolean result distinguishes a matched global resource from the fallback used for project-only resources.
func (ResourceConfigSnapshot) IsInherited ¶ added in v0.82.0
func (s ResourceConfigSnapshot) IsInherited(item PackageResourceToggleItem) bool
IsInherited reports whether item participates in the user-layer projection.
func (ResourceConfigSnapshot) Items ¶ added in v0.82.0
func (s ResourceConfigSnapshot) Items(scope ResourceConfigWriteScope) []PackageResourceToggleItem
Items returns a copy of the selected projection so UI updates cannot mutate the canonical snapshot.
func (ResourceConfigSnapshot) Target ¶ added in v0.82.0
func (s ResourceConfigSnapshot) Target(item PackageResourceToggleItem) ResourceConfigTarget
Target returns the canonical mutation input for an item in this snapshot.
type ResourceConfigTarget ¶ added in v0.82.0
type ResourceConfigTarget struct {
// contains filtered or unexported fields
}
ResourceConfigTarget binds a resolved resource to the inherited state from the snapshot that displayed it. Project mutations accept this value so a UI cannot accidentally calculate path/source encoding from unrelated state.
func (ResourceConfigTarget) InheritedEnabled ¶ added in v0.82.0
func (t ResourceConfigTarget) InheritedEnabled() bool
InheritedEnabled returns target's effective user-layer enabled state.
func (ResourceConfigTarget) IsInherited ¶ added in v0.82.0
func (t ResourceConfigTarget) IsInherited() bool
IsInherited reports whether target has a matching user-layer resource.
func (ResourceConfigTarget) Resource ¶ added in v0.82.0
func (t ResourceConfigTarget) Resource() PackageResourceToggleItem
Resource returns a copy of the resolved resource represented by target.
type ResourceConfigWriteScope ¶ added in v0.82.0
type ResourceConfigWriteScope string
ResourceConfigWriteScope identifies which settings layer the resource selector mutates. The project view is an effective projection: it includes inherited user resources plus project-local resources and overrides.
const ( ResourceConfigWriteGlobal ResourceConfigWriteScope = "global" ResourceConfigWriteProject ResourceConfigWriteScope = "project" )
type ResourceContextFile ¶
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 ResourceLoaderProjectTrustInput ¶ added in v0.82.0
type ResourceLoaderProjectTrustInput struct {
ExtensionsResult ResourceExtensionsResult
}
ResourceLoaderProjectTrustInput exposes the safe pre-trust extension snapshot to the decision callback.
type ResourceLoaderReloadOptions ¶ added in v0.82.0
type ResourceLoaderReloadOptions struct {
ResolveProjectTrust func(ResourceLoaderProjectTrustInput) (bool, error)
}
ResourceLoaderReloadOptions configures one serialized reload transaction.
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 ResourceThemePath ¶
type ResourceThemePath struct {
Path string
Metadata ProtocolSourceInfo
}
type ResourceThemesResult ¶
type ResourceThemesResult struct {
Themes []ResourceTheme
Diagnostics []agentharness.SkillDiagnostic
}
type RetryStatusIndicator ¶ added in v0.82.0
type RetryStatusIndicator struct {
*StatusIndicator
// contains filtered or unexported fields
}
RetryStatusIndicator renders retry activity and owns its countdown.
func NewRetryStatusIndicator ¶ added in v0.82.0
func NewRetryStatusIndicator( ui *gitui.TUI, attempt int, maxAttempts int, delay time.Duration, ) *RetryStatusIndicator
NewRetryStatusIndicator constructs a retry indicator with a live countdown.
func (*RetryStatusIndicator) Dispose ¶ added in v0.82.0
func (s *RetryStatusIndicator) Dispose()
Dispose stops both the countdown and loader animation.
type SDKAgent ¶
type SDKAgent struct {
State SDKAgentState
}
type SDKAgentState ¶
type SDKContentPart ¶
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 ScopedModelsSelectorComponent ¶
type ScopedModelsSelectorComponent struct {
// contains filtered or unexported fields
}
func NewScopedModelsSelectorComponent ¶
func NewScopedModelsSelectorComponent(config ScopedModelsSelectorConfig, callbacks ScopedModelsSelectorCallbacks) *ScopedModelsSelectorComponent
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
func GetSelfUpdateCommandForTarget ¶ added in v0.82.0
func GetSelfUpdateCommandForTarget(packageName string, _ InstallEnvironment, target SelfUpdatePackageTarget) *SelfUpdateCommand
GetSelfUpdateCommandForTarget preserves the typed update target at the command-generation boundary. Gi intentionally does not execute Node package manager self-updates, so no environment currently produces a command.
type SelfUpdateCommandStep ¶
type SelfUpdateOptions ¶
type SelfUpdateOptions struct {
PackageName string
CurrentVersion string
Force bool
Environment InstallEnvironment
VersionCheck VersionReleaseChecker
VersionCheckOptions VersionCheckOptions
}
type SelfUpdatePackageTarget ¶ added in v0.82.0
SelfUpdatePackageTarget separates the package identity used to replace an installation from the exact spec a package manager would install.
type SelfUpdateResult ¶
type SessionContext ¶
type SessionContext struct {
Messages []any
ThinkingLevel string
Model *SessionModel
}
func BuildSessionContext ¶
func BuildSessionContext(entries []FileEntry, leafID *string, byID map[string]FileEntry) SessionContext
func BuildSessionContextWithOptions ¶ added in v0.82.0
func BuildSessionContextWithOptions( entries []FileEntry, leafID *string, byID map[string]FileEntry, options SessionContextOptions, ) SessionContext
type SessionContextOptions ¶ added in v0.82.0
type SessionContextOptions struct {
ExcludeEntryIDs map[string]struct{}
}
SessionContextOptions controls the projection from the append-only session tree into the live provider context. Exclusions do not mutate persisted history; they only hide selected entries from the model-facing view.
type SessionEntriesSnapshot ¶ added in v0.82.0
type SessionEntriesSnapshot struct {
Entries []FileEntry `json:"entries"`
LeafID *string `json:"leafId"`
}
SessionEntriesSnapshot is a detached append-order view of a session and the leaf selected in the same locked manager revision.
type SessionHeader ¶
type SessionHeaderScanLimitError ¶ added in v0.82.0
SessionHeaderScanLimitError identifies a file whose first parsed entry could not be discovered within the bounded header scan. Callers opening an explicit file may fall back to a full streaming load; directory discovery should skip the file.
func (*SessionHeaderScanLimitError) Error ¶ added in v0.82.0
func (e *SessionHeaderScanLimitError) Error() string
type SessionImportFileNotFoundError ¶
type SessionImportFileNotFoundError struct {
Path string
}
func (SessionImportFileNotFoundError) Error ¶
func (e SessionImportFileNotFoundError) Error() string
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 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 CreateSessionManagerWithOptions ¶ added in v0.82.0
func CreateSessionManagerWithOptions( cwd, sessionDir string, options NewSessionOptions, ) (*SessionManager, error)
CreateSessionManagerWithOptions creates a persisted session with explicit identity or parent metadata.
func ForkSessionFrom ¶
func ForkSessionFrom(sourcePath, targetCwd string, sessionDir ...string) (*SessionManager, error)
func ForkSessionFromWithOptions ¶ added in v0.82.0
func ForkSessionFromWithOptions( sourcePath, targetCwd string, options NewSessionOptions, sessionDir ...string, ) (*SessionManager, error)
ForkSessionFromWithOptions copies a session into a new exclusively-created file and optionally assigns a portable custom ID.
func InMemorySessionManager ¶
func InMemorySessionManager(cwd ...string) (*SessionManager, error)
func InMemorySessionManagerWithOptions ¶ added in v0.82.0
func InMemorySessionManagerWithOptions( cwd string, options NewSessionOptions, ) (*SessionManager, error)
InMemorySessionManagerWithOptions creates a non-persisted session with explicit identity or parent metadata.
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) AppendCompactionWithOptions ¶ added in v0.82.0
func (s *SessionManager) AppendCompactionWithOptions( summary, firstKeptEntryID string, tokensBefore int, options SessionSummaryOptions, ) string
func (*SessionManager) AppendCustomEntry ¶
func (s *SessionManager) AppendCustomEntry(customType string, data any) string
func (*SessionManager) AppendCustomMessageEntry ¶
func (*SessionManager) AppendCustomMessageEntryWithContext ¶
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) BranchWithSummaryOptions ¶ added in v0.82.0
func (s *SessionManager) BranchWithSummaryOptions( branchFromID *string, summary string, options SessionSummaryOptions, ) (string, error)
func (*SessionManager) BuildContextEntries ¶ added in v0.82.0
func (s *SessionManager) BuildContextEntries() []FileEntry
BuildContextEntries returns the active, compaction-aware entry projection. The snapshot is captured under one read lock so branch navigation cannot produce a path assembled from different session states.
func (*SessionManager) BuildSessionContext ¶
func (s *SessionManager) BuildSessionContext() SessionContext
func (*SessionManager) BuildSessionContextWithOptions ¶ added in v0.82.0
func (s *SessionManager) BuildSessionContextWithOptions( options SessionContextOptions, ) 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) GetEntriesSnapshot ¶ added in v0.82.0
func (s *SessionManager) GetEntriesSnapshot() SessionEntriesSnapshot
func (*SessionManager) GetEntry ¶
func (s *SessionManager) GetEntry(id string) *FileEntry
func (*SessionManager) GetHeader ¶
func (s *SessionManager) GetHeader() *SessionHeader
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) GetTreeSnapshot ¶ added in v0.82.0
func (s *SessionManager) GetTreeSnapshot() SessionTreeSnapshot
func (*SessionManager) IsPersisted ¶
func (s *SessionManager) IsPersisted() bool
func (*SessionManager) NewSession ¶
func (s *SessionManager) NewSession(options ...NewSessionOptions) (string, error)
NewSession replaces the active in-memory state after validating all supplied identity metadata. Persisted content is created lazily on the first response.
func (*SessionManager) ResetLeaf ¶
func (s *SessionManager) ResetLeaf()
func (*SessionManager) SetSessionFile ¶
func (s *SessionManager) SetSessionFile(sessionFile string) error
func (*SessionManager) UsesDefaultSessionDir ¶ added in v0.82.0
func (s *SessionManager) UsesDefaultSessionDir() bool
UsesDefaultSessionDir reports whether this manager owns the canonical per-working-directory store. It is pure and does not create directories.
type SessionModel ¶
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 (s *SessionSelectorComponent) GetSessionList() *SessionSelectorComponent
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 ¶
func (s *SessionSelectorComponent) SetSortMode(mode SessionSelectorSortMode)
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 SessionSummaryOptions ¶ added in v0.82.0
type SessionTreeNode ¶
type SessionTreeNode struct {
Entry FileEntry `json:"entry"`
Children []*SessionTreeNode `json:"children"`
Label string `json:"label,omitempty"`
LabelTimestamp string `json:"labelTimestamp,omitempty"`
}
type SessionTreeSnapshot ¶ added in v0.82.0
type SessionTreeSnapshot struct {
Tree []*SessionTreeNode `json:"tree"`
LeafID *string `json:"leafId"`
}
SessionTreeSnapshot is a detached tree projection and the leaf selected in the same locked manager revision.
type SettingsError ¶
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 NewSettingsManagerWithOptions ¶ added in v0.82.0
func NewSettingsManagerWithOptions(cwd, agentDir string, options SettingsManagerOptions) *SettingsManager
func (*SettingsManager) ApplyFirstTimeSetup ¶ added in v0.82.0
func (s *SettingsManager) ApplyFirstTimeSetup(result FirstTimeSetupResult) error
ApplyFirstTimeSetup persists the complete onboarding result with one global settings write, so theme and analytics cannot observe different setup runs.
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) GetCompactionEnabled ¶ added in v0.82.0
func (s *SettingsManager) GetCompactionEnabled() bool
func (*SettingsManager) GetCompactionKeepRecentTokens ¶ added in v0.82.0
func (s *SettingsManager) GetCompactionKeepRecentTokens() int
func (*SettingsManager) GetCompactionReserveTokens ¶ added in v0.82.0
func (s *SettingsManager) GetCompactionReserveTokens() int
func (*SettingsManager) GetCompactionSettings ¶ added in v0.82.0
func (s *SettingsManager) GetCompactionSettings() agentharness.CompactionSettings
func (*SettingsManager) GetDefaultModel ¶
func (s *SettingsManager) GetDefaultModel() string
func (*SettingsManager) GetDefaultProjectTrust ¶ added in v0.82.0
func (s *SettingsManager) GetDefaultProjectTrust() DefaultProjectTrust
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) GetEnableAnalytics ¶ added in v0.82.0
func (s *SettingsManager) GetEnableAnalytics() bool
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) GetExternalEditorCommand ¶ added in v0.82.0
func (s *SettingsManager) GetExternalEditorCommand() string
func (*SettingsManager) GetFollowUpMode ¶ added in v0.82.0
func (s *SettingsManager) GetFollowUpMode() string
func (*SettingsManager) GetGlobalSettings ¶ added in v0.82.0
func (s *SettingsManager) GetGlobalSettings() map[string]any
func (*SettingsManager) GetHTTPIdleTimeoutMS ¶
func (s *SettingsManager) GetHTTPIdleTimeoutMS() int
GetHTTPIdleTimeoutMS is the legacy millisecond accessor. New request paths use HTTPIdleTimeout or providerRequestSettings so malformed configuration is returned to the caller.
func (*SettingsManager) GetHTTPProxy ¶ added in v0.82.0
func (s *SettingsManager) GetHTTPProxy() string
GetHTTPProxy returns only the global proxy setting. Project settings cannot redirect process-wide traffic, matching Pi's trust boundary.
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) GetOutputPad ¶ added in v0.82.0
func (s *SettingsManager) GetOutputPad() int
func (*SettingsManager) GetPackages ¶
func (s *SettingsManager) GetPackages() []any
func (*SettingsManager) GetProjectSettings ¶ added in v0.82.0
func (s *SettingsManager) GetProjectSettings() map[string]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) GetShowCacheMissNotices ¶ added in v0.82.0
func (s *SettingsManager) GetShowCacheMissNotices() bool
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) GetSteeringMode ¶ added in v0.82.0
func (s *SettingsManager) GetSteeringMode() string
func (*SettingsManager) GetTheme ¶
func (s *SettingsManager) GetTheme() string
GetTheme returns only a fixed theme name. Automatic light/dark pairs are resolved by the interactive theme controller against terminal state.
func (*SettingsManager) GetThemeSetting ¶ added in v0.82.0
func (s *SettingsManager) GetThemeSetting() (string, bool)
GetThemeSetting returns the raw theme setting. The boolean distinguishes an absent setting from an explicitly stored empty value.
func (*SettingsManager) GetTrackingID ¶ added in v0.82.0
func (s *SettingsManager) GetTrackingID() 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) HTTPIdleTimeout ¶ added in v0.82.0
func (s *SettingsManager) HTTPIdleTimeout() (time.Duration, error)
HTTPIdleTimeout returns the validated Go-native timeout value. Zero means disabled. Invalid persisted settings are surfaced instead of silently changing request behavior.
func (*SettingsManager) IsProjectTrusted ¶ added in v0.82.0
func (s *SettingsManager) IsProjectTrusted() bool
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) SetCompactionEnabled ¶ added in v0.82.0
func (s *SettingsManager) SetCompactionEnabled(enabled bool)
func (*SettingsManager) SetDefaultModel ¶
func (s *SettingsManager) SetDefaultModel(model string)
func (*SettingsManager) SetDefaultProjectTrust ¶ added in v0.82.0
func (s *SettingsManager) SetDefaultProjectTrust(defaultProjectTrust DefaultProjectTrust)
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) SetEnableAnalytics ¶ added in v0.82.0
func (s *SettingsManager) SetEnableAnalytics(enabled bool)
SetEnableAnalytics updates the preference and its stable identifier as one locked state transition. Disabling analytics intentionally retains the identifier so a later opt-in resumes the same anonymous identity.
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) SetFollowUpMode ¶ added in v0.82.0
func (s *SettingsManager) SetFollowUpMode(mode string)
func (*SettingsManager) SetHTTPIdleTimeoutMS ¶
func (s *SettingsManager) SetHTTPIdleTimeoutMS(timeoutMS int) error
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) SetOutputPad ¶ added in v0.82.0
func (s *SettingsManager) SetOutputPad(padding int)
func (*SettingsManager) SetPackages ¶
func (s *SettingsManager) SetPackages(packages []any)
func (*SettingsManager) SetProjectExtensionPaths ¶
func (s *SettingsManager) SetProjectExtensionPaths(paths []string) error
func (*SettingsManager) SetProjectPackages ¶
func (s *SettingsManager) SetProjectPackages(packages []any) error
func (*SettingsManager) SetProjectPromptTemplatePaths ¶ added in v0.82.0
func (s *SettingsManager) SetProjectPromptTemplatePaths(paths []string) error
func (*SettingsManager) SetProjectSkillPaths ¶ added in v0.82.0
func (s *SettingsManager) SetProjectSkillPaths(paths []string) error
func (*SettingsManager) SetProjectThemePaths ¶ added in v0.82.0
func (s *SettingsManager) SetProjectThemePaths(paths []string) error
func (*SettingsManager) SetProjectTrusted ¶ added in v0.82.0
func (s *SettingsManager) SetProjectTrusted(trusted bool)
func (*SettingsManager) SetQuietStartup ¶
func (s *SettingsManager) SetQuietStartup(enabled bool)
func (*SettingsManager) SetRetryEnabled ¶
func (s *SettingsManager) SetRetryEnabled(enabled bool)
func (*SettingsManager) SetShowCacheMissNotices ¶ added in v0.82.0
func (s *SettingsManager) SetShowCacheMissNotices(show 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) SetSteeringMode ¶ added in v0.82.0
func (s *SettingsManager) SetSteeringMode(mode string)
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)
func (*SettingsManager) WebSocketConnectTimeout ¶ added in v0.82.0
func (s *SettingsManager) WebSocketConnectTimeout() (*time.Duration, error)
WebSocketConnectTimeout returns nil when the setting is absent and a non-nil zero duration when connection timeouts are explicitly disabled.
type SettingsManagerOptions ¶ added in v0.82.0
type SettingsManagerOptions struct {
ProjectTrusted bool
}
type StatusIndicator ¶ added in v0.82.0
StatusIndicator is the common state and loader lifecycle shared by every transient status shown in the interactive status slot.
func NewStatusIndicator ¶ added in v0.82.0
func NewStatusIndicator( kind StatusIndicatorKind, message string, options gitui.LoaderIndicatorOptions, ) *StatusIndicator
NewStatusIndicator constructs the common loader owned by a transient status.
func (*StatusIndicator) Dispose ¶ added in v0.82.0
func (s *StatusIndicator) Dispose()
Dispose stops the loader animation.
func (*StatusIndicator) StatusKind ¶ added in v0.82.0
func (s *StatusIndicator) StatusKind() StatusIndicatorKind
StatusKind returns the semantic owner of the shared status slot.
type StatusIndicatorKind ¶ added in v0.82.0
type StatusIndicatorKind string
StatusIndicatorKind identifies the semantic owner of the shared status slot.
const ( // StatusIndicatorKindWorking identifies the normal agent activity indicator. StatusIndicatorKindWorking StatusIndicatorKind = "working" // StatusIndicatorKindRetry identifies an auto-retry countdown. StatusIndicatorKindRetry StatusIndicatorKind = "retry" // StatusIndicatorKindCompaction identifies context compaction activity. StatusIndicatorKindCompaction StatusIndicatorKind = "compaction" // StatusIndicatorKindBranchSummary identifies branch summarization activity. StatusIndicatorKindBranchSummary StatusIndicatorKind = "branchSummary" )
type SystemPromptContextFile ¶
type SystemPromptSkill ¶
type TUIDialogHost ¶
type TUIDialogHost interface {
RunTUIDialog(request TUIDialogRequest) (TUIDialogResult, error)
}
type TUIDialogOption ¶
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 TUIEditorCursorHost ¶
type TUIEditorCustomStateHost ¶
type TUIEditorCustomStateHost interface {
EditorCustomActive() bool
}
type TUIEditorFocusHost ¶
type TUIEditorHost ¶
type TUIEditorPasteHost ¶
type TUIEditorPasteHost interface {
PasteEditorText(text string)
}
type TUIRenderRequester ¶ added in v0.82.0
type TUIRenderRequester interface {
RequestRender(force ...bool)
}
TUIRenderRequester is the narrow rendering dependency needed by countdowns.
type TUIStatusHost ¶
type TUIThemeHost ¶
type TUIThemeHost interface {
CurrentTUITheme() string
AvailableTUIThemes() []TUIThemeInfo
SetTUITheme(name string) error
}
type TUIThemeInfo ¶
type TUIThinkingLabelHost ¶
type TUITitleHost ¶
type TUIToolExpansionHost ¶
type TUIWorkingHost ¶
type TUIWorkingHost interface {
SetTUIWorking(update TUIWorkingUpdate) error
}
type TUIWorkingUpdate ¶
type TerminalAutoThemeDetector ¶ added in v0.82.0
type TerminalAutoThemeDetector interface {
TerminalBackgroundThemeDetector
QueryTerminalColorScheme(context.Context) (gitui.TerminalColorScheme, bool, error)
}
type TerminalBackgroundThemeDetector ¶ added in v0.82.0
type TerminalTheme ¶ added in v0.82.0
type TerminalTheme string
const ( TerminalThemeDark TerminalTheme = "dark" TerminalThemeLight TerminalTheme = "light" )
func DetectTerminalThemeForAuto ¶ added in v0.82.0
func DetectTerminalThemeForAuto( ctx context.Context, detector TerminalAutoThemeDetector, timeout time.Duration, environment map[string]string, ) TerminalTheme
DetectTerminalThemeForAuto first asks terminals that expose a color-scheme capability, then uses OSC 11 and finally COLORFGBG.
func GetThemeForRGBColor ¶ added in v0.82.0
func GetThemeForRGBColor(color gitui.RGBColor) TerminalTheme
type TerminalThemeDetection ¶ added in v0.82.0
type TerminalThemeDetection struct {
Theme TerminalTheme
Source string
Detail string
Confidence string
}
func DetectTerminalBackgroundFromEnv ¶ added in v0.82.0
func DetectTerminalBackgroundFromEnv(environment map[string]string) TerminalThemeDetection
DetectTerminalBackgroundFromEnv derives the theme from the last valid COLORFGBG field. A nil environment reads the process environment; an empty map intentionally represents an environment without hints.
func DetectTerminalBackgroundTheme ¶ added in v0.82.0
func DetectTerminalBackgroundTheme( ctx context.Context, detector TerminalBackgroundThemeDetector, timeout time.Duration, environment map[string]string, ) TerminalThemeDetection
DetectTerminalBackgroundTheme prefers a terminal OSC 11 response and falls back to the immutable environment snapshot supplied by the caller.
type ThemeExportColors ¶
func GetThemeExportColors ¶
func GetThemeExportColors(themeName, agentDir string) (ThemeExportColors, error)
type ThinkingLevel ¶
type ThinkingLevel = internalcli.ThinkingLevel
const ( ThinkingOff ThinkingLevel = internalcli.ThinkingOff ThinkingMinimal ThinkingLevel = internalcli.ThinkingMinimal ThinkingLow ThinkingLevel = internalcli.ThinkingLow ThinkingMedium ThinkingLevel = internalcli.ThinkingMedium ThinkingHigh ThinkingLevel = internalcli.ThinkingHigh ThinkingXHigh ThinkingLevel = internalcli.ThinkingXHigh ThinkingMax ThinkingLevel = internalcli.ThinkingMax )
const DefaultThinkingLevel ThinkingLevel = modelresolver.DefaultThinkingLevel
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 ToolRenderContext ¶
type ToolRenderResultOptions ¶
type ToolResultRenderer ¶
type ToolResultRenderer func(result FileToolResult, options ToolRenderResultOptions, context ToolRenderContext) []string
type TopLevelResourceToggle ¶
type TreeSelectorComponent ¶
type TreeSelectorComponent struct {
OnSelect func(entryID string)
OnCancel func()
OnCopy func(text *string)
OnLabelChange func(entryID, label string) error
OnError func(error)
// contains filtered or unexported fields
}
TreeSelectorComponent owns the mutable presentation state for session-tree navigation. Session persistence and clipboard I/O stay behind host callbacks.
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)
func (*TreeSelectorComponent) SetSelectedID ¶ added in v0.82.0
func (s *TreeSelectorComponent) SetSelectedID(entryID string)
SetSelectedID moves selection to an entry or its nearest visible ancestor.
type TreeSelectorFilter ¶
type TreeSelectorFilter string
const ( TreeSelectorDefaultFilter TreeSelectorFilter = "default" TreeSelectorNoToolsFilter TreeSelectorFilter = "no-tools" TreeSelectorUserFilter TreeSelectorFilter = "user-only" TreeSelectorLabelFilter TreeSelectorFilter = "labeled-only" TreeSelectorAllFilter TreeSelectorFilter = "all" )
type TreeSelectorHelp ¶ added in v0.82.0
type TreeSelectorHelp struct {
// contains filtered or unexported fields
}
TreeSelectorHelp renders keybinding-aware semantic help rows.
func (*TreeSelectorHelp) Invalidate ¶ added in v0.82.0
func (h *TreeSelectorHelp) Invalidate()
func (*TreeSelectorHelp) Render ¶ added in v0.82.0
func (h *TreeSelectorHelp) Render(width int) []string
type TreeSelectorList ¶
type TreeSelectorList struct {
// contains filtered or unexported fields
}
TreeSelectorList exposes the current derived tree projection to callers that need selection, search, copy, or label operations.
func (*TreeSelectorList) CopySelected ¶ added in v0.82.0
func (l *TreeSelectorList) CopySelected()
func (*TreeSelectorList) GetSearchQuery ¶ added in v0.82.0
func (l *TreeSelectorList) GetSearchQuery() string
func (*TreeSelectorList) GetSelectedNode ¶
func (l *TreeSelectorList) GetSelectedNode() *SessionTreeNode
func (*TreeSelectorList) Invalidate ¶ added in v0.82.0
func (l *TreeSelectorList) Invalidate()
func (*TreeSelectorList) Render ¶
func (l *TreeSelectorList) Render(width int) []string
func (*TreeSelectorList) UpdateNodeLabel ¶ added in v0.82.0
func (l *TreeSelectorList) UpdateNodeLabel(entryID, label string)
type TreeSelectorOptions ¶
type TreeSelectorOptions struct {
Keybindings KeybindingsConfig
MaxVisibleLines int
}
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 UsageCostBreakdownEntry ¶ added in v0.82.0
type UsageCostBreakdownEntry struct {
Key string `json:"key"`
Cost float64 `json:"cost"`
Tokens int `json:"tokens"`
}
UsageCostBreakdownEntry attributes billed usage to a concrete model or to application-owned work such as tools and summaries.
type UserMessageComponent ¶
type UserMessageComponent struct {
Text string
// contains filtered or unexported fields
}
func NewUserMessageComponent ¶
func NewUserMessageComponent(text string) UserMessageComponent
func (UserMessageComponent) Render ¶
func (c UserMessageComponent) Render(width int) []string
func (*UserMessageComponent) SetOutputPad ¶ added in v0.82.0
func (c *UserMessageComponent) SetOutputPad(padding int)
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 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 ViewTreeFocus ¶
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 ¶
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 ViewTreeSizeValue ¶
func (*ViewTreeSizeValue) UnmarshalJSON ¶
func (v *ViewTreeSizeValue) UnmarshalJSON(data []byte) error
type ViewTreeStyle ¶
type ViewTreeTableColumn ¶
type VisualTruncateResult ¶
func TruncateToVisualLines ¶
func TruncateToVisualLines(text string, maxVisualLines, width, paddingX int) VisualTruncateResult
type WarningSettings ¶
type WarningSettings struct {
AnthropicExtraUsage bool
}
type WorkingStatusIndicator ¶ added in v0.82.0
type WorkingStatusIndicator struct {
*StatusIndicator
}
WorkingStatusIndicator renders normal agent activity.
func NewWorkingStatusIndicator ¶ added in v0.82.0
func NewWorkingStatusIndicator( ui *gitui.TUI, message string, indicator *TUIWorkingIndicatorOptions, ) *WorkingStatusIndicator
NewWorkingStatusIndicator constructs an agent activity indicator.
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(toolCallID string, input WriteToolInput) (FileToolResult, error)
type WriteToolInput ¶
Source Files
¶
- agent_session_auto_compaction.go
- agent_session_bash.go
- agent_session_branching.go
- agent_session_context.go
- agent_session_lifecycle.go
- agent_session_post_run.go
- agent_session_queues.go
- agent_session_runtime.go
- agent_session_runtime_events.go
- agent_session_settings.go
- agent_session_summarization.go
- agent_session_tree_navigation.go
- anthropic_warning.go
- auth_guidance.go
- auth_storage.go
- bash_execution.go
- bash_executor.go
- bash_output_accumulator.go
- bash_process_unix.go
- bash_tool.go
- bash_tool_definition.go
- cache_stats.go
- changelog.go
- changelog_embed.go
- cli.go
- cli_api.go
- cli_config.go
- cli_interactive_auth.go
- cli_interactive_autocomplete.go
- cli_interactive_dialog_host.go
- cli_interactive_editor_host.go
- cli_interactive_help.go
- cli_interactive_keybindings.go
- cli_interactive_llama.go
- cli_interactive_logout.go
- cli_interactive_mode.go
- cli_interactive_model.go
- cli_interactive_reload.go
- cli_interactive_resources.go
- cli_interactive_session.go
- cli_interactive_settings.go
- cli_interactive_signals_unix.go
- cli_interactive_status.go
- cli_interactive_terminal_errors.go
- cli_interactive_terminal_errors_unix.go
- cli_interactive_theme_settings.go
- cli_interactive_trust.go
- cli_interactive_tui.go
- cli_message_components.go
- cli_missing_cwd.go
- cli_model_catalog.go
- cli_model_registry.go
- cli_print_mode.go
- cli_project_trust.go
- cli_provider_auth_interaction.go
- cli_resume_selector.go
- cli_session_manager.go
- cli_tui_dialog.go
- clipboard.go
- clipboard_image.go
- config.go
- config_value.go
- custom_entry_component.go
- custom_message_component.go
- diff_render.go
- edit_tool_definition.go
- experimental.go
- export_html.go
- extension_discovery.go
- extension_selector.go
- external_editor.go
- file_arguments.go
- file_mutation_queue.go
- file_tool_definitions.go
- file_tools.go
- first_time_setup.go
- footer.go
- footer_data_provider.go
- fs_watch.go
- git.go
- host_actions.go
- host_process_unix.go
- http_runtime.go
- image_resize.go
- inprocess_components.go
- interactive_mode.go
- interactive_resume_command.go
- interactive_status.go
- interactive_suspend_unix.go
- interactive_theme_controller.go
- keybindings.go
- list_models.go
- llama_extension.go
- llama_ui.go
- login_dialog.go
- mcp_stdio.go
- message_components.go
- model_registry.go
- model_registry_dynamic.go
- model_resolver.go
- model_runtime.go
- model_search.go
- model_selector_component.go
- models_store.go
- oauth_selector.go
- official_packages.go
- package_manager.go
- plan_mode_api.go
- print_mode.go
- project_trust.go
- prompt_templates.go
- protocol_extension_descriptor.go
- protocol_extension_loader.go
- protocol_extension_order.go
- protocol_extension_process.go
- protocol_extension_runtime.go
- protocol_extension_trust.go
- protocol_package_resolver.go
- provider_composer.go
- resource_config.go
- resource_loader.go
- restore_sandbox_env.go
- rpc_client.go
- rpc_jsonl.go
- rpc_mode.go
- rpc_process_state_unix.go
- rpc_process_transport.go
- rpc_session_host.go
- runtime_credentials.go
- sdk_attribution.go
- sdk_session.go
- sdk_stream_default.go
- search_tools.go
- session_cwd.go
- session_file_store.go
- session_manager.go
- session_selector.go
- session_selector_search.go
- settings_manager.go
- share.go
- startup_timings.go
- startup_ui.go
- status_indicator.go
- syntax_highlight.go
- system_prompt.go
- system_prompt_docs.go
- telemetry.go
- terminal_theme.go
- test_harness.go
- theme_export.go
- tmux_keyboard.go
- tool_execution_component.go
- tool_render_utils.go
- tree_selector.go
- tree_selector_render.go
- trigger_compact_extension.go
- tui_theme.go
- tui_theme_schema.go
- usage_totals.go
- user_message_selector.go
- utils.go
- version_check.go
- viewtree.go
Directories
¶
| Path | Synopsis |
|---|---|
|
internal
|
|
|
jsonutil
Package jsonutil contains the coding-agent JSON-with-comments compatibility boundary.
|
Package jsonutil contains the coding-agent JSON-with-comments compatibility boundary. |
|
outputguard
Package outputguard serializes protocol and print output through one stateful writer boundary.
|
Package outputguard serializes protocol and print output through one stateful writer boundary. |
|
shellconfig
Package shellconfig resolves one immutable shell invocation policy for all coding-agent command execution paths.
|
Package shellconfig resolves one immutable shell invocation policy for all coding-agent command execution paths. |