app

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: MIT Imports: 126 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const KanbanWorkerExitTrailer = "[kanban-worker-exit] rc="

KanbanWorkerExitTrailer prefixes the exit code line a Kanban worker writes to its log

View Source
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

View Source
const ReleaseDate = "2026.9.24"

ReleaseDate is the release date shown beside the version in banners

View Source
const ReportedTurnExitGraceSeconds = 2.0

ReportedTurnExitGraceSeconds is how long a reported child may keep lingering before its spawner books it

View Source
const (
	TipKeyPrefix = "tips.t"
)
View Source
const TurnReportFileEnv = "ICEBATH_QUIET_TURN_REPORT_FILE"

TurnReportFileEnv names the spawner's turn report path a quiet child pops at startup

Variables

View Source
var ConsoleCommandTree func() *commands.CLI

Fresh cobra command tree with every host handler bound, assigned by the binary at startup

View Source
var ErrSetupCancelled = errors.New("provider setup cancelled")

ErrSetupCancelled reports a provider picker the user left with Ctrl+C, EOF or an exit

View Source
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

View Source
var (
	TryAcquireActiveSession = AcquireActiveSessionLease
)

Functions

func ACPCommandRefusal

func ACPCommandRefusal(name string) string

Refusal naming the parity table for a command the shared gateway does not serve yet

func ACPConfirmationTitle

func ACPConfirmationTitle(refusal map[string]any) string

One prompt title for the owner guard warnings

func ACPModelRefusalText

func ACPModelRefusalText(refusal map[string]any, confirmed bool) string

Why a guarded model target was not applied, the owner guard text first

func ACPReplayGapOwedReply

func ACPReplayGapOwedReply(shown, final string) string

Rest of the final reply after the painted exact prefix, else the resumed marker and the whole reply

func ACPReplayGapPendingStatus

func ACPReplayGapPendingStatus(pending []any, admission any) any

Status of the admission in the snapshot pending rows, nil when it ended in the hole

func ACPReplayGapSettled

func ACPReplayGapSettled(receipt map[string]any) *bool

True when terminal with its reply, false while running, nil when the receipt is unreadable

func ACPRewindTo

func ACPRewindTo(turnsBack int64, retry bool) func(snapshot map[string]any) (map[string]any, error)

Rewind payload naming the Nth newest user turn of the snapshot, a retry refusing a turn it cannot resend

func ACPSlashMutation

func ACPSlashMutation(command, arg string) (string, *jsonutil.Object, error)

Operation and payload of a /model or /compress line, no operation for a /model that only asks for the current model

func AvailableSkills

func AvailableSkills(ctx context.Context) *jsonutil.Object

Skill names grouped by category for the TUI server session info

func BannerVersionLabel

func BannerVersionLabel(ctx context.Context) (string, error)

Version label of the install, its channel or its revisions, or the version or channel lookup error

func BuildInitPromptForCwd

func BuildInitPromptForCwd(env *tools.Env, cwd, extra string, sessionKey *string) string

The init prompt for an explicit existing cwd or the session's active directory, read by the gateway

func BypassLaunch

func BypassLaunch(args map[string]any) bool

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

func ClipboardImageBlocker() (missing string, noDesktop bool)

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

func ConfigureWindowsStdio(ctx context.Context) bool

Forces UTF-8 stdio on Windows once, true only when something changed, the Windows UTF-8 setting of ctx opting out

func DefaultsConfig

func DefaultsConfig(ctx context.Context) map[string]any

Registry defaults under the administrator's pins, the config document a run that ignores the user's config.yaml reads

func ExitOnResumeRefusal

func ExitOnResumeRefusal(err error) error

Prints a refused resume as the usage error every classic path exits 2 with, nil for any other failure

func FormatBannerVersionLabel

func FormatBannerVersionLabel(ctx context.Context) string

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

func ImportForeignSession(ctx context.Context, source, path string) (string, error)

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 IsWindows

func IsWindows() bool

Reports native Windows, never WSL

func LaunchFromArgs

func LaunchFromArgs(ctx context.Context, args map[string]any, ensure func() (bool, error)) int

Launches a classic or one shot chat through the canonical gateway, ensure being the frontend provider check

func LaunchTUI

func LaunchTUI(ctx context.Context, l TUILaunch) int

Runs the terminal UI over the real worktree setup, exit summary and relaunch

func LegacyAgentArgv

func LegacyAgentArgv(args []string) ([]string, bool)

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

func ListLogs(ctx context.Context, w io.Writer) error

Prints the log files with sizes and ages, plus the root home update logs under a profile

func LoadPrefillMessages

func LoadPrefillMessages(ctx context.Context, filePath, baseDir string) []any

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

func ParseServiceTierConfig(raw string) string

Persisted fast mode preference parsed like the CLI, empty when unset or unknown

func PetsCommand

func PetsCommand(ctx context.Context, h string, ns map[string]any, w io.Writer) (int, error)

Runs one icebath pets subcommand, help when none was given

func PlatformsLines

func PlatformsLines(ctx context.Context) []string

Platforms report lines

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

func QueryFromStdin(query *string, image string) int

Sets an empty query to the stdin text, exit 2 with the usage error when stdin is blank and no image rides along

func RandomTip

func RandomTip(ctx context.Context) string

Random tip in the active language, empty when the catalog has none

func ReadBreadcrumb

func ReadBreadcrumb(ctx context.Context) map[string]any

This terminal's breadcrumb payload, nil when missing, corrupt or stale

func ResolveBreadcrumbSession

func ResolveBreadcrumbSession(ctx context.Context) string

Resolves a bare -c for this terminal to its live session id, empty to fall back to the latest session

func ResolvePrefillMessagesFile

func ResolvePrefillMessagesFile(ctx context.Context) string

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

func RunCuratorSlash(ctx context.Context, env *tools.Env, argv []string, out io.Writer)

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

func RunDataUninstall(ctx context.Context, ns map[string]any, w io.Writer) (int, error)

Erases this home's data while the installed runtimes and sibling profiles stay, exit 1 when it cannot

func RunUninstall

func RunUninstall(ctx context.Context, ns map[string]any, w io.Writer) (int, error)

Interactive or yes mode removal of the agent code, keeping or wiping the data, offering named profiles too

func SaveClipboardImage

func SaveClipboardImage(dest string) bool

Saves the clipboard image to dest as PNG, true when an image was found and written

func SaveConfigValue

func SaveConfigValue(ctx context.Context, keyPath string, value any) bool

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

func SetStreams(c *cliui.Console, stderr io.Writer) func()

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

func TUIStatusLines(fields map[string]any, keys ...string) []string

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

func TailLog(ctx context.Context, w io.Writer, o TailLogOptions) (int, error)

Reads and shows log lines with the level, session, since and component filters, following on request

func ToolsetAvailability

func ToolsetAvailability(ctx context.Context, enabled []string) map[string]any

Unavailable enabled toolsets with their tools split into lazy and disabled names for the banner colours

func ToolsetsLines

func ToolsetsLines(ctx context.Context, enabled []string) []string

Toolsets report lines of the enabled toolsets

func UpdateResult

func UpdateResult(timeout time.Duration) *int64

Commits behind of the background update check, nil while unknown, waiting at most the timeout

func WriteBreadcrumb

func WriteBreadcrumb(ctx context.Context, sessionID, cwd string)

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) Len

func (m *ACPMutations) Len() int

Number of retained identities

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

type BannerGitState struct {
	Upstream, Local string
	Ahead           int
}

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

func NewCLI

func NewCLI(ctx context.Context, o CLIOptions) (*CLI, error)

NewCLI builds the one shot chat client with CLI args winning over config and resume restoring history from SQLite

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

func (*ConsoleEngine) HelpText

func (e *ConsoleEngine) HelpText(subject string) (string, error)

Usage and summary of one command, or the table of every supported command

func (*ConsoleEngine) Register

func (e *ConsoleEngine) Register(path []string, usage, summary string, handler consoleHandler, mutating bool, confirmation string)

Adds or replaces the command at path

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

func PickForeignSession(ctx context.Context, source string, w io.Writer) (*ForeignSession, error)

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) Provider

func (a *GatewayAgent) Provider() string

Provider the session runs

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

func (*GatewayChatView) Run

func (v *GatewayChatView) Run(ctx context.Context, query string) (int, error)

Shows pending state, submits the query and waits for its settlement

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) Len

func (m *PreparedMutations) Len() int

Number of retained identities

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

type ReportedTurn struct {
	Args       []string
	ReturnCode int
	Stdout     string
	Stderr     string
}

ReportedTurn is the booked outcome of one quiet delivery child

type StreamJSONAgent

type StreamJSONAgent interface {
	SetStreamDeltaCallback(cb any)
	SetToolProgressCallback(cb any)
}

StreamJSONAgent is the agent surface Attach routes, its stream delta and tool progress callback slots

type StreamJSONArgs

type StreamJSONArgs struct {
	OutputFormat, Query, QueryFile string
	Quiet                          *bool
}

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

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

type TailLogOptions struct {
	Name, Level, Session, Since, Component string
	Lines                                  int
	Follow                                 bool
}

Arguments of icebath logs for one log file

Source Files

Jump to

Keyboard shortcuts

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