Documentation
¶
Index ¶
- Constants
- Variables
- func ACPCommandRefusal(name string) string
- func ACPConfirmationTitle(refusal map[string]any) string
- func ACPModelRefusalText(refusal map[string]any, confirmed bool) string
- func ACPReplayGapOwedReply(shown, final string) string
- func ACPReplayGapPendingStatus(pending []any, admission any) any
- func ACPReplayGapSettled(receipt map[string]any) *bool
- func ACPRewindTo(turnsBack int64, retry bool) func(snapshot map[string]any) (map[string]any, error)
- func ACPSlashMutation(command, arg string) (string, *jsonutil.Object, error)
- func AvailableSkills(ctx context.Context) *jsonutil.Object
- func BannerVersionLabel(ctx context.Context) (string, error)
- func BuildInitPromptForCwd(env *tools.Env, cwd, extra string, sessionKey *string) string
- func BypassLaunch(args map[string]any) bool
- func ChatMain(ctx context.Context, o MainOptions) int
- func ClipboardImageBlocker() (missing string, noDesktop bool)
- func CmdSessions(ctx context.Context, h string, ns map[string]any, w io.Writer, ...) (int, error)
- func CmdUninstall(ctx context.Context, ns map[string]any, w io.Writer, ...) (int, error)
- func ConfigureWindowsStdio(ctx context.Context) bool
- func DefaultsConfig(ctx context.Context) map[string]any
- func ExitOnResumeRefusal(err error) error
- func FormatBannerVersionLabel(ctx context.Context) string
- func GetTerminalID() string
- func HasClipboardImage() bool
- func ImportForeignSession(ctx context.Context, source, path string) (string, error)
- func IsInteractiveStdin() bool
- func IsWindows() bool
- func LaunchFromArgs(ctx context.Context, args map[string]any, ensure func() (bool, error)) int
- func LaunchTUI(ctx context.Context, l TUILaunch) int
- func LegacyAgentArgv(args []string) ([]string, bool)
- func LegacyAgentMain(ctx context.Context, argv []string, stdout, stderr io.Writer, ...) int
- func ListLogs(ctx context.Context, w io.Writer) error
- func LoadPrefillMessages(ctx context.Context, filePath, baseDir string) []any
- func Main(ctx context.Context, o MainOptions) (code int, err error)
- func ParseKanbanSlash(tokens []string) kanban.SlashParse
- func ParseServiceTierConfig(raw string) string
- func PetsCommand(ctx context.Context, h string, ns map[string]any, w io.Writer) (int, error)
- func PlatformsLines(ctx context.Context) []string
- func PrefetchUpdateCheck()
- func QueryFromStdin(query *string, image string) int
- func RandomTip(ctx context.Context) string
- func ReadBreadcrumb(ctx context.Context) map[string]any
- func ResolveBreadcrumbSession(ctx context.Context) string
- func ResolvePrefillMessagesFile(ctx context.Context) string
- func RunConsoleREPL(ctx context.Context, o ConsoleREPLOptions) (int, error)
- func RunCuratorSlash(ctx context.Context, env *tools.Env, argv []string, out io.Writer)
- func RunDataUninstall(ctx context.Context, ns map[string]any, w io.Writer) (int, error)
- func RunUninstall(ctx context.Context, ns map[string]any, w io.Writer) (int, error)
- func SaveClipboardImage(dest string) bool
- func SaveConfigValue(ctx context.Context, keyPath string, value any) bool
- func SetPrintVersionInfo(fn func(checkUpdates bool))
- func SetStreams(c *cliui.Console, stderr io.Writer) func()
- func StreamJSONRequested(a StreamJSONArgs) (bool, int)
- func TUIContextRead(ctx context.Context, a *gateway.SessionAuthority, ref gateway.SessionRef, ...) (string, error)
- func TUIStatusFields(ctx context.Context, sessionID string, a *agent.AIAgent, meta map[string]any, ...) map[string]any
- func TUIStatusLines(fields map[string]any, keys ...string) []string
- func TUIStatusRead(ctx context.Context, a *gateway.SessionAuthority, ref gateway.SessionRef, ...) (string, error)
- func TailLog(ctx context.Context, w io.Writer, o TailLogOptions) (int, error)
- func ToolsetAvailability(ctx context.Context, enabled []string) map[string]any
- func ToolsetsLines(ctx context.Context, enabled []string) []string
- func UpdateResult(timeout time.Duration) *int64
- func WriteBreadcrumb(ctx context.Context, sessionID, cwd string)
- type ACPMutations
- type ActiveSessionLease
- type BannerGitState
- type CLI
- type CLIOptions
- type ChatConsole
- type ConsoleCommand
- type ConsoleCommandError
- type ConsoleEngine
- type ConsoleREPLOptions
- type ConsoleResult
- type ConsoleStatus
- type ForeignSession
- type GatewayAgent
- func (a *GatewayAgent) APIMode() string
- func (a *GatewayAgent) BaseURL() string
- func (a *GatewayAgent) ClearInterrupt()
- func (a *GatewayAgent) ErrorKind() string
- func (a *GatewayAgent) Interrupt()
- func (a *GatewayAgent) InterruptRequested() bool
- func (a *GatewayAgent) MaxIterations() int
- func (a *GatewayAgent) Model() string
- func (a *GatewayAgent) MuteNotificationReply() bool
- func (a *GatewayAgent) NotificationTurn(ctx context.Context, muted bool, sessionID string) (context.Context, func())
- func (a *GatewayAgent) Provider() string
- func (a *GatewayAgent) RateLimitState() *provider.RateLimitState
- func (a *GatewayAgent) ReasoningCallback() func(text string)
- func (a *GatewayAgent) ReasoningConfig() map[string]any
- func (a *GatewayAgent) ResetSessionState()
- func (a *GatewayAgent) RunConversation(ctx context.Context, userMessage any, o agent.RunConversationOptions) (result map[string]any, err error)
- func (a *GatewayAgent) ServiceTier() string
- func (a *GatewayAgent) SessionID() string
- func (a *GatewayAgent) SessionMessages() []map[string]any
- func (a *GatewayAgent) SetPendingCLIUserMessage(row map[string]any)
- func (a *GatewayAgent) SetPrintFn(fn func(string))
- func (a *GatewayAgent) SetReasoningCallback(callback func(text string))
- func (a *GatewayAgent) SetServiceTier(tier string)
- func (a *GatewayAgent) SetStreamDeltaCallback(cb any)
- func (a *GatewayAgent) SetSuppressStatusOutput(suppress bool)
- func (a *GatewayAgent) SetToolProgressCallback(cb any)
- func (a *GatewayAgent) SetToolProgressMode(mode string)
- func (a *GatewayAgent) StagePendingCLIUserMessage(staged map[string]any, appendToTranscript func())
- func (a *GatewayAgent) SummarizeAPIError(err error) string
- func (a *GatewayAgent) SwitchModel(newModel, newProvider string) (bool, error)
- func (a *GatewayAgent) TodoStore() *tools.TodoStore
- func (a *GatewayAgent) ToolProgressMode() string
- type GatewayChatView
- type MainOptions
- type PreparedMutations
- func (m *PreparedMutations) Acknowledge(sessionID, operation string, payload any)
- func (m *PreparedMutations) Apply(ctx context.Context, rpc gatewayRPC, sessionID, operation string, payload any, ...) (map[string]any, error)
- func (m *PreparedMutations) Len() int
- func (m *PreparedMutations) Retire(sessionID string, keep *mutationKey)
- type ReportedTurn
- type StreamJSONAgent
- type StreamJSONArgs
- type StreamJSONEmitter
- func (e *StreamJSONEmitter) Attach(agent StreamJSONAgent) *StreamJSONEmitter
- func (e *StreamJSONEmitter) BindSession(sessionID string)
- func (e *StreamJSONEmitter) EmitResult(result any, sessionID string, exitCode int) int
- func (e *StreamJSONEmitter) OnTextDelta(text any)
- func (e *StreamJSONEmitter) OnToolProgress(eventType, toolName, preview string, args map[string]any, extra map[string]any)
- type TUILaunch
- type TailLogOptions
Constants ¶
const KanbanWorkerExitTrailer = "[kanban-worker-exit] rc="
KanbanWorkerExitTrailer prefixes the exit code line a Kanban worker writes to its log
const QuerylessChatUsage = "no query given, pass one with icebath chat -q/--query or pipe it on stdin"
Usage error text of a chat launch that carries no query, printed with exit 2
const ReleaseDate = "2026.9.24"
ReleaseDate is the release date shown beside the version in banners
const ReportedTurnExitGraceSeconds = 2.0
ReportedTurnExitGraceSeconds is how long a reported child may keep lingering before its spawner books it
const (
TipKeyPrefix = "tips.t"
)
const TurnReportFileEnv = "ICEBATH_QUIET_TURN_REPORT_FILE"
TurnReportFileEnv names the spawner's turn report path a quiet child pops at startup
Variables ¶
var ConsoleCommandTree func() *commands.CLI
Fresh cobra command tree with every host handler bound, assigned by the binary at startup
var ErrSetupCancelled = errors.New("provider setup cancelled")
ErrSetupCancelled reports a provider picker the user left with Ctrl+C, EOF or an exit
var StdinQuery = sync.OnceValues(func() (string, error) { raw, err := io.ReadAll(os.Stdin) return strings.TrimRight(string(raw), "\r\n"), err })
Text on stdin with its trailing newlines trimmed, read to EOF once per process
var (
TryAcquireActiveSession = AcquireActiveSessionLease
)
Functions ¶
func ACPCommandRefusal ¶
Refusal naming the parity table for a command the shared gateway does not serve yet
func ACPConfirmationTitle ¶
One prompt title for the owner guard warnings
func ACPModelRefusalText ¶
Why a guarded model target was not applied, the owner guard text first
func ACPReplayGapOwedReply ¶
Rest of the final reply after the painted exact prefix, else the resumed marker and the whole reply
func ACPReplayGapPendingStatus ¶
Status of the admission in the snapshot pending rows, nil when it ended in the hole
func ACPReplayGapSettled ¶
True when terminal with its reply, false while running, nil when the receipt is unreadable
func ACPRewindTo ¶
Rewind payload naming the Nth newest user turn of the snapshot, a retry refusing a turn it cannot resend
func ACPSlashMutation ¶
Operation and payload of a /model or /compress line, no operation for a /model that only asks for the current model
func AvailableSkills ¶
Skill names grouped by category for the TUI server session info
func BannerVersionLabel ¶
Version label of the install, its channel or its revisions, or the version or channel lookup error
func BuildInitPromptForCwd ¶
The init prompt for an explicit existing cwd or the session's active directory, read by the gateway
func BypassLaunch ¶
Whether the launch freezes code defaults and reads no profile, by flag or by its environment opt in
func ChatMain ¶
func ChatMain(ctx context.Context, o MainOptions) int
Runs main as the chat command does, a rejected value printed to stdout as Error then its message with exit 1
func ClipboardImageBlocker ¶
What keeps this host from reading a clipboard image, the missing program to install or no desktop reachable at all
func CmdSessions ¶
func CmdSessions(ctx context.Context, h string, ns map[string]any, w io.Writer, printHelp func() error) (int, error)
Runs icebath sessions, routing the action to its handler and returning the exit code
func CmdUninstall ¶
func CmdUninstall(ctx context.Context, ns map[string]any, w io.Writer, requireTTY func(commandName string)) (int, error)
Dispatches icebath uninstall to the data or agent path, gating on a terminal only when it prompts
func ConfigureWindowsStdio ¶
Forces UTF-8 stdio on Windows once, true only when something changed, the Windows UTF-8 setting of ctx opting out
func DefaultsConfig ¶
Registry defaults under the administrator's pins, the config document a run that ignores the user's config.yaml reads
func ExitOnResumeRefusal ¶
Prints a refused resume as the usage error every classic path exits 2 with, nil for any other failure
func FormatBannerVersionLabel ¶
Version label of the install, panicking with the lookup error like the exception Python leaves uncaught
func GetTerminalID ¶
func GetTerminalID() string
Stable identity for this terminal, the tty device path or the first present multiplexer env var, empty when neither exists
func HasClipboardImage ¶
func HasClipboardImage() bool
Reports whether the clipboard currently holds an image
func ImportForeignSession ¶
Imports one foreign session through the gateway session store and returns the new session id
func IsInteractiveStdin ¶
func IsInteractiveStdin() bool
Reports whether stdin is a usable interactive terminal
func LaunchFromArgs ¶
Launches a classic or one shot chat through the canonical gateway, ensure being the frontend provider check
func LegacyAgentArgv ¶
Runner argv when args invoke the legacy single query runner, by entry token or by the icebath-agent command name
func LegacyAgentMain ¶
func LegacyAgentMain(ctx context.Context, argv []string, stdout, stderr io.Writer, run func(context.Context, io.Writer, agent.MainOptions)) int
Parses argv and runs one query through the direct runner, metadata flags and a bare invocation never reach it
func ListLogs ¶
Prints the log files with sizes and ages, plus the root home update logs under a profile
func LoadPrefillMessages ¶
Prefill messages of a JSON array file, relative paths under baseDir or the home, missing or invalid giving none
func Main ¶
func Main(ctx context.Context, o MainOptions) (code int, err error)
Runs one query or image turn in process and returns the exit code with the error it raises
func ParseKanbanSlash ¶
func ParseKanbanSlash(tokens []string) kanban.SlashParse
Parses /kanban tokens on the icebath CLI tree, the namespace when an action parsed, else the parser text renamed to /kanban
func ParseServiceTierConfig ¶
Persisted fast mode preference parsed like the CLI, empty when unset or unknown
func PetsCommand ¶
Runs one icebath pets subcommand, help when none was given
func PrefetchUpdateCheck ¶
func PrefetchUpdateCheck()
Starts the passive update check in the background, finishing at once when prefetch is off or no updater is linked
func QueryFromStdin ¶
Sets an empty query to the stdin text, exit 2 with the usage error when stdin is blank and no image rides along
func ReadBreadcrumb ¶
This terminal's breadcrumb payload, nil when missing, corrupt or stale
func ResolveBreadcrumbSession ¶
Resolves a bare -c for this terminal to its live session id, empty to fall back to the latest session
func ResolvePrefillMessagesFile ¶
Prefill file path for ctx: the session's client env, then the prefill messages setting
func RunConsoleREPL ¶
func RunConsoleREPL(ctx context.Context, o ConsoleREPLOptions) (int, error)
Runs the local icebath console REPL until exit or end of input
func RunCuratorSlash ¶
Runs the curator CLI on argv in the profile scope of env, its report, help and usage errors written to out, a failure as its error line
func RunDataUninstall ¶
Erases this home's data while the installed runtimes and sibling profiles stay, exit 1 when it cannot
func RunUninstall ¶
Interactive or yes mode removal of the agent code, keeping or wiping the data, offering named profiles too
func SaveClipboardImage ¶
Saves the clipboard image to dest as PNG, true when an image was found and written
func SaveConfigValue ¶
SaveConfigValue saves a setting of the home in ctx through the settings writer, true on success
func SetPrintVersionInfo ¶
func SetPrintVersionInfo(fn func(checkUpdates bool))
Sets the version printer the console's version command runs
func SetStreams ¶
Installs the console and stderr writer prints reach and returns the function restoring the previous pair
func StreamJSONRequested ¶
func StreamJSONRequested(a StreamJSONArgs) (bool, int)
Reports --format stream-json, exit code 2 without a query, and forces quiet mode on
func TUIContextRead ¶
func TUIContextRead(ctx context.Context, a *gateway.SessionAuthority, ref gateway.SessionRef, live *gateway.LiveSession, policy *gateway.LocalSessionPolicy, held any, arg string) (string, error)
Main's live context output, role counts and model then the category table or the stored usage
func TUIStatusFields ¶
func TUIStatusFields(ctx context.Context, sessionID string, a *agent.AIAgent, meta map[string]any, model, provider string, tokens any, agentRunning bool, profileHome string) map[string]any
Status facts of a TUI session, the live agent winning route and tokens, the profile home naming the path
func TUIStatusLines ¶
Label value lines of the status facts for the keys in order
func TUIStatusRead ¶
func TUIStatusRead(ctx context.Context, a *gateway.SessionAuthority, ref gateway.SessionRef, live *gateway.LiveSession, policy *gateway.LocalSessionPolicy, held any, arg string) (string, error)
Main's TUI session status text for the owner's session
func TailLog ¶
Reads and shows log lines with the level, session, since and component filters, following on request
func ToolsetAvailability ¶
Unavailable enabled toolsets with their tools split into lazy and disabled names for the banner colours
func ToolsetsLines ¶
Toolsets report lines of the enabled toolsets
func UpdateResult ¶
Commits behind of the background update check, nil while unknown, waiting at most the timeout
func WriteBreadcrumb ¶
Records that this terminal's live session is sessionID, never raising
Types ¶
type ACPMutations ¶
type ACPMutations struct {
// contains filtered or unexported fields
}
Prepared owner mutations for the ACP adapter, a derived payload given as a plain function of the snapshot
func NewACPMutations ¶
func NewACPMutations() *ACPMutations
Empty retained mutation table for one ACP agent
func (*ACPMutations) Acknowledge ¶
func (m *ACPMutations) Acknowledge(sessionID, operation string, payload any)
Drops the retained identity of this exact mutation
func (*ACPMutations) Apply ¶
func (m *ACPMutations) Apply(ctx context.Context, rpc func(ctx context.Context, method string, params map[string]any, timeout time.Duration) (map[string]any, error), sessionID, operation string, payload any, confirm func(ctx context.Context, refusal map[string]any) (bool, error)) (map[string]any, error)
Owner answer for the prepared mutation, re-sent with the confirmation token once a guarded target is confirmed
func (*ACPMutations) Retire ¶
func (m *ACPMutations) Retire(sessionID string)
Retires every retained identity of the session
type ActiveSessionLease ¶
type ActiveSessionLease interface{ Release() error }
ActiveSessionLease is the global active session slot a CLI process holds until release
func AcquireActiveSessionLease ¶
func AcquireActiveSessionLease(ctx context.Context, sessionID, surface string, metadata map[string]any) (ActiveSessionLease, *activesessions.Refusal, error)
Claims a slot in the shared active session registry under the session limit setting of ctx, a refusal carrying its machine readable reason
type BannerGitState ¶
Upstream and local short hashes of the checkout with the commits carried on top
type CLI ¶
type CLI struct {
// contains filtered or unexported fields
}
The one shot chat client, its turn, stream and session state on one struct
type CLIOptions ¶
type CLIOptions struct {
Model string
Toolsets []string
Provider string
Reasoning string
APIKey string
BaseURL string
MaxTurns *int
RunBudget *float64
Verbose bool
Compact *bool
Resume string
Checkpoints bool
PassSessionID bool
IgnoreRules bool
}
Constructor arguments of the CLI, command line args winning over config
type ChatConsole ¶
type ChatConsole struct {
// contains filtered or unexported fields
}
ChatConsole is a console routing rendered ANSI through cprint so colors survive the prompt
func (*ChatConsole) Print ¶
func (c *ChatConsole) Print(markup ...string)
Prints markup lines through cprint
func (*ChatConsole) PrintPanel ¶
func (c *ChatConsole) PrintPanel(p consoleutil.Panel)
Prints a panel through cprint
func (*ChatConsole) PrintRenderableWith ¶
func (c *ChatConsole) PrintRenderableWith(r consoleutil.Renderable, o consoleutil.PrintOptions)
Prints a renderable through cprint with a base style under it and soft wrapping when asked
type ConsoleCommand ¶
type ConsoleCommand struct {
Path []string
Usage string
Summary string
Handler consoleHandler
Mutating bool
Confirmation string
}
ConsoleCommand is one registered console command path
type ConsoleCommandError ¶
type ConsoleCommandError struct{ Msg string }
A user facing console command failure, its message shown as the command's error result
func (*ConsoleCommandError) Error ¶
func (e *ConsoleCommandError) Error() string
type ConsoleEngine ¶
type ConsoleEngine struct {
OutputLimit int
History []string
// contains filtered or unexported fields
}
ConsoleEngine is the curated line command executor of the icebath console
func NewConsoleEngine ¶
func NewConsoleEngine(ctx context.Context, outputLimit int) *ConsoleEngine
Engine with the built in commands, the CLI families and send registered
func (*ConsoleEngine) Execute ¶
func (e *ConsoleEngine) Execute(line string, confirmed bool) (ConsoleResult, error)
Runs one console line, a mutating command asking for confirmation unless confirmed
type ConsoleREPLOptions ¶
type ConsoleREPLOptions struct {
Stdin io.Reader
Stdout io.Writer
Stderr io.Writer
Interactive *bool
}
ConsoleREPLOptions are the streams of a console REPL and whether it prompts, unset ones read from the process
type ConsoleResult ¶
type ConsoleResult struct {
Status ConsoleStatus
Output string
Command string
ConfirmationMessage string
}
ConsoleResult is what one console line produced
type ConsoleStatus ¶
type ConsoleStatus string
ConsoleStatus is the outcome kind of one console line
const ( ConsoleOK ConsoleStatus = "ok" ConsoleError ConsoleStatus = "error" ConsoleConfirmRequired ConsoleStatus = "confirm_required" ConsoleExit ConsoleStatus = "exit" ConsoleClear ConsoleStatus = "clear" )
Outcome kinds of a console line
type ForeignSession ¶
type ForeignSession struct {
Source string
Path string
Mtime float64
Cwd *string
TitleGuess *string
TurnCount int
SessionID *string
}
A discoverable session in the on disk store of another coding agent
func PickForeignSession ¶
Numbered picker over the newest foreign sessions, nil when nothing was chosen
func (*ForeignSession) Label ¶
func (s *ForeignSession) Label() string
Source tag and title, the file stem when no title was guessed, cut to sixty code points
type GatewayAgent ¶
type GatewayAgent struct {
// contains filtered or unexported fields
}
Gateway backed stand in for the in process agent, the turn runs in the gateway and this replays its events
func (*GatewayAgent) APIMode ¶
func (a *GatewayAgent) APIMode() string
API mode the CLI resolved for this agent
func (*GatewayAgent) BaseURL ¶
func (a *GatewayAgent) BaseURL() string
Base URL the CLI resolved for this agent
func (*GatewayAgent) ClearInterrupt ¶
func (a *GatewayAgent) ClearInterrupt()
Clears the interrupt flag this agent holds
func (*GatewayAgent) ErrorKind ¶
func (a *GatewayAgent) ErrorKind() string
Python class name, the name an attribute error about the agent carries
func (*GatewayAgent) Interrupt ¶
func (a *GatewayAgent) Interrupt()
Sends session.interrupt for the running generation, the message staying with the CLI
func (*GatewayAgent) InterruptRequested ¶
func (a *GatewayAgent) InterruptRequested() bool
Whether an interrupt was requested for the running turn
func (*GatewayAgent) MaxIterations ¶
func (a *GatewayAgent) MaxIterations() int
Turn limit this agent was built with
func (*GatewayAgent) Model ¶
func (a *GatewayAgent) Model() string
Model the session runs, or the one turn pick this agent staged
func (*GatewayAgent) MuteNotificationReply ¶
func (a *GatewayAgent) MuteNotificationReply() bool
Whether the running notification turn mutes its reply on every surface
func (*GatewayAgent) NotificationTurn ¶
func (a *GatewayAgent) NotificationTurn(ctx context.Context, muted bool, sessionID string) (context.Context, func())
Freezes a muted turn's presentation callbacks and status output, restored by the returned func
func (*GatewayAgent) RateLimitState ¶
func (a *GatewayAgent) RateLimitState() *provider.RateLimitState
Rate limit state the gateway last reported for this session
func (*GatewayAgent) ReasoningCallback ¶
func (a *GatewayAgent) ReasoningCallback() func(text string)
Reasoning sink the CLI installed, nil when reasoning is not shown
func (*GatewayAgent) ReasoningConfig ¶
func (a *GatewayAgent) ReasoningConfig() map[string]any
Reasoning config this agent holds
func (*GatewayAgent) ResetSessionState ¶
func (a *GatewayAgent) ResetSessionState()
Drops the previous session's figures and shows the gateway's for the current one
func (*GatewayAgent) RunConversation ¶
func (a *GatewayAgent) RunConversation(ctx context.Context, userMessage any, o agent.RunConversationOptions) (result map[string]any, err error)
Submits the prompt and replays the gateway's events into the CLI callbacks, returning the turn result
func (*GatewayAgent) ServiceTier ¶
func (a *GatewayAgent) ServiceTier() string
Service tier this agent was built with
func (*GatewayAgent) SessionID ¶
func (a *GatewayAgent) SessionID() string
Gateway session this agent replays
func (*GatewayAgent) SessionMessages ¶
func (a *GatewayAgent) SessionMessages() []map[string]any
Transcript rows of the last settled turn
func (*GatewayAgent) SetPendingCLIUserMessage ¶
func (a *GatewayAgent) SetPendingCLIUserMessage(row map[string]any)
Stages the CLI's user row for the next turn, nil to clear it
func (*GatewayAgent) SetPrintFn ¶
func (a *GatewayAgent) SetPrintFn(fn func(string))
Installs the function status lines print through
func (*GatewayAgent) SetReasoningCallback ¶
func (a *GatewayAgent) SetReasoningCallback(callback func(text string))
Installs the reasoning sink and sends the session's show_reasoning flag to match
func (*GatewayAgent) SetServiceTier ¶
func (a *GatewayAgent) SetServiceTier(tier string)
Sets the service tier and sends it as the session override when it differs from the last one sent
func (*GatewayAgent) SetStreamDeltaCallback ¶
func (a *GatewayAgent) SetStreamDeltaCallback(cb any)
Routes reply deltas into cb, the stream json emitter's text sink
func (*GatewayAgent) SetSuppressStatusOutput ¶
func (a *GatewayAgent) SetSuppressStatusOutput(suppress bool)
Silences or restores status output
func (*GatewayAgent) SetToolProgressCallback ¶
func (a *GatewayAgent) SetToolProgressCallback(cb any)
Routes tool progress into cb, the stream json emitter's tool sink
func (*GatewayAgent) SetToolProgressMode ¶
func (a *GatewayAgent) SetToolProgressMode(mode string)
Sets the tool progress mode and sends it to the session as its verbose setting when it changed
func (*GatewayAgent) StagePendingCLIUserMessage ¶
func (a *GatewayAgent) StagePendingCLIUserMessage(staged map[string]any, appendToTranscript func())
Stages the next turn's CLI user row and appends it to the transcript, the gateway agent holding no persist lock
func (*GatewayAgent) SummarizeAPIError ¶
func (a *GatewayAgent) SummarizeAPIError(err error) string
First 300 characters of an error, the one line a failed side call shows
func (*GatewayAgent) SwitchModel ¶
func (a *GatewayAgent) SwitchModel(newModel, newProvider string) (bool, error)
Commits a session scoped model switch
func (*GatewayAgent) TodoStore ¶
func (a *GatewayAgent) TodoStore() *tools.TodoStore
Todo store mirroring the gateway's plan for this session
func (*GatewayAgent) ToolProgressMode ¶
func (a *GatewayAgent) ToolProgressMode() string
Current tool progress display mode
type GatewayChatView ¶
type GatewayChatView struct {
// contains filtered or unexported fields
}
Terminal view of one gateway session, its event rendering and its fenced controls
type MainOptions ¶
type MainOptions struct {
Model, Reasoning, Toolsets, Query, OutputFormat, Provider, Image, Resume, APIKey, BaseURL string
IgnoreRules, Verbose, Quiet, Worktree, Checkpoints, PassSessionID bool
RunBudget float64
Skills []string
MaxTurns *int
}
MainOptions carries the options of a one shot chat run
type PreparedMutations ¶
type PreparedMutations struct {
// contains filtered or unexported fields
}
Prepared native controls retaining their identity across ambiguous replies
func NewPreparedMutations ¶
func NewPreparedMutations() *PreparedMutations
Empty retained mutation table
func (*PreparedMutations) Acknowledge ¶
func (m *PreparedMutations) Acknowledge(sessionID, operation string, payload any)
Drops the retained identity of this exact mutation
func (*PreparedMutations) Apply ¶
func (m *PreparedMutations) Apply(ctx context.Context, rpc gatewayRPC, sessionID, operation string, payload any, confirm func(ctx context.Context, refusal map[string]any) (bool, error)) (map[string]any, error)
Owner answer for this prepared mutation, re-sent with the confirmation token once a guarded target is confirmed
func (*PreparedMutations) Retire ¶
func (m *PreparedMutations) Retire(sessionID string, keep *mutationKey)
Retires every retained identity of the session except the kept one, so only the very next control replays
type ReportedTurn ¶
ReportedTurn is the booked outcome of one quiet delivery child
type StreamJSONAgent ¶
StreamJSONAgent is the agent surface Attach routes, its stream delta and tool progress callback slots
type StreamJSONArgs ¶
StreamJSONArgs is the chat argument namespace stream_json_requested inspects and forces quiet on
type StreamJSONEmitter ¶
type StreamJSONEmitter struct {
// contains filtered or unexported fields
}
StreamJSONEmitter is the agent callback sink writing one flushed JSONL event per stdout line
func NewStreamJSONEmitter ¶
func NewStreamJSONEmitter(model, sessionID string) *StreamJSONEmitter
Writes the system init event and returns the emitter holding the session id and start time
func (*StreamJSONEmitter) Attach ¶
func (e *StreamJSONEmitter) Attach(agent StreamJSONAgent) *StreamJSONEmitter
Routes the agent streaming and tool callbacks into this emitter and returns it
func (*StreamJSONEmitter) BindSession ¶
func (e *StreamJSONEmitter) BindSession(sessionID string)
Records the gateway assigned session id so an interrupted or failed run still names it
func (*StreamJSONEmitter) EmitResult ¶
func (e *StreamJSONEmitter) EmitResult(result any, sessionID string, exitCode int) int
Writes the terminal result record once and returns the process exit code it reports
func (*StreamJSONEmitter) OnTextDelta ¶
func (e *StreamJSONEmitter) OnTextDelta(text any)
Emits a text event for every truthy delta, dropping only the None and empty turn end sentinels
func (*StreamJSONEmitter) OnToolProgress ¶
func (e *StreamJSONEmitter) OnToolProgress(eventType, toolName, preview string, args map[string]any, extra map[string]any)
Maps tool.started to tool_use and tool.completed to tool_result, every other progress event ignored
type TUILaunch ¶
type TUILaunch struct {
Resume, Model, Provider, BaseURL, APIKey, Reasoning, Toolsets string
Native, AcceptHooks, Verbose, Quiet, Worktree, Checkpoints, PassSessionID bool
Skills []string
MaxTurns *int
}
Launch arguments of the TUI the chat entry points pass through
type TailLogOptions ¶
Arguments of icebath logs for one log file
Source Files
¶
- acp_adapter_export.go
- active_session_lease.go
- banner.go
- banner_export.go
- cli.go
- cli_agent_setup.go
- cli_agent_surface.go
- cli_browser_commands.go
- cli_chat_error_copy.go
- cli_chat_turn.go
- cli_command_helpers.go
- cli_commands.go
- cli_commands_checkpoints.go
- cli_commands_kanban.go
- cli_commands_session_tools.go
- cli_info.go
- cli_info_lines.go
- cli_init.go
- cli_init_gateway.go
- cli_loops_commands.go
- cli_main.go
- cli_modal.go
- cli_model_switch.go
- cli_modern_layout.go
- cli_render.go
- cli_render_unix.go
- cli_resume.go
- cli_session.go
- cli_shutdown.go
- cli_single_query.go
- cli_single_query_kanban.go
- cli_status_bar.go
- cli_stream.go
- cli_terminal_input.go
- cli_tool_callbacks.go
- cli_tui_keys.go
- clipboard.go
- config_load.go
- config_load_export.go
- console_argparse.go
- console_builtins.go
- console_builtins_cron.go
- console_capture.go
- console_engine.go
- curator_slash.go
- data_cleanup.go
- data_cleanup_holders.go
- foreign_sessions.go
- foreign_sessions_import.go
- gateway_agent.go
- gateway_agent_events.go
- gateway_agent_result.go
- gateway_agent_turn.go
- gateway_chat.go
- gateway_chat_commands.go
- gateway_chat_listing.go
- gateway_chat_view.go
- gateway_mutations.go
- gateway_plugin_commands.go
- gateway_recorded_worktree.go
- gateway_replay_gap.go
- gateway_side.go
- gateway_tools_notify.go
- hf_hub.go
- init_command.go
- init_command_export.go
- kanban_worker_hooks.go
- legacy_cli.go
- log.go
- logs.go
- main_session_lookup.go
- oneshot_usage.go
- pets.go
- prefill_exports.go
- quiet_single_query.go
- relaunch.go
- relaunch_unix.go
- session_filters.go
- session_lost_and_found.go
- session_recovery.go
- session_tui_reads_render.go
- sessions_adopt.go
- sessions_cmd.go
- sessions_cmd_browse.go
- sessions_cmd_export.go
- sessions_cmd_prune.go
- sessions_cmd_repair_profiles.go
- sessions_cmd_storage.go
- sessions_discard.go
- sessions_owner.go
- sessions_repair_profiles.go
- setup_gates.go
- shared_session_attach.go
- status_report.go
- status_report_tui.go
- stdio.go
- stdio_other.go
- stdio_streams.go
- stream_json.go
- streams.go
- terminal_breadcrumbs.go
- terminal_notify.go
- termios_linux.go
- tips.go
- tips_export.go
- trace_upload.go
- ttyname_linux.go
- ttyname_unix.go
- tui_host.go
- tui_launch.go
- tui_launch_argv.go
- uninstall.go
- uninstall_registry_other.go
- uninstall_support.go