Documentation
¶
Index ¶
- Constants
- Variables
- func AtExit()
- func BindHostedRoomServer()
- func ClearTUIMessageInjector(ctx context.Context, manager *plugins.Manager)
- func CommandCatalog(ctx context.Context, scope func(context.Context) (context.Context, error)) (tuigateway.CommandsCatalogResult, error)
- func ConsumeTypedStopPhrase(ctx context.Context, text, sessionID string) (bool, error)
- func DecodeAttachBase64(raw, mimePrefix string, maxBytes int) ([]byte, error)
- func Dispatch(ctx context.Context, req any, transport tuihost.Transport) map[string]any
- func DispatchTUIGatewayEntry(ctx context.Context, exit func(int))
- func GatewayToolsets(ctx context.Context, platform string) (enabled, disabled []string)
- func HandleWS(ctx context.Context, ws ServedSocket, authIdentity map[string]any, ...) error
- func InstallTUIMessageInjector(ctx context.Context, manager *plugins.Manager)
- func OpenLaunchStore(ctx context.Context) error
- func PathCompletionItems(ctx context.Context, word, root, sessionKey string, local bool) ([]tuigateway.CompletionItem, error)
- func ProfileRuntimeScope(ctx context.Context, profileHome string) context.Context
- func ProjectInfoForCwd(ctx context.Context, cwd string) any
- func RefreshLiveSessions(ctx context.Context, h *string, preservePrefix bool, pluginNote *[2]string) error
- func RunToolsSetupFlow(ctx context.Context, h string, ask setupflow.Asker) error
- func SessionSteerAuthority(ctx context.Context, sessionID string) (any, any)
- func SettleWorktree(ctx context.Context, tree map[string]string, choice string, echo func(string))
- func SlashCompletions(ctx context.Context, text string, ...) (tuigateway.CompleteSlashResult, error)
- func SniffImageExt(data []byte, filename string) string
- func StageImageBytes(directory string, data []byte, ext, prefix string) (string, error)
- type CatalogCommand
- type CompressionBusy
- type CompressionLockHeld
- type Handler
- type HelpCategory
- type HostedRoomServer
- type HostedRoomServerRPC
- func (r *HostedRoomServerRPC) AcceptsAttachments() bool
- func (r *HostedRoomServerRPC) Approve(ctx context.Context, sessionID, requestID, choice string) (map[string]any, error)
- func (r *HostedRoomServerRPC) Create(ctx context.Context, profile, title, source string) (map[string]any, error)
- func (r *HostedRoomServerRPC) History(ctx context.Context, profile, sessionID, source string) ([]map[string]any, error)
- func (r *HostedRoomServerRPC) Info(ctx context.Context, profile, sessionID, source string) (map[string]any, error)
- func (r *HostedRoomServerRPC) Interrupt(ctx context.Context, profile, sessionID, source, expectedTaskID string) (map[string]any, error)
- func (r *HostedRoomServerRPC) ResolveExact(ctx context.Context, profile, title, source string) (map[string]any, error)
- func (r *HostedRoomServerRPC) Resume(ctx context.Context, profile, sessionID, source string) (map[string]any, error)
- func (r *HostedRoomServerRPC) Submit(ctx context.Context, req gateway.HostedSubmit) (map[string]any, error)
- type HostedRoomSessionError
- type OwnerUnavailableError
- type ProfileUnavailableError
- type ResolvedCommand
- type ServedSocket
- type SlashCompletion
- type SnapshotLines
- type SocketDisconnect
- type SocketPeer
- type StoreUnavailableError
- type SyntheticHeavyAgent
- func (a *SyntheticHeavyAgent) ClearInterrupt()
- func (a *SyntheticHeavyAgent) Close()
- func (a *SyntheticHeavyAgent) HasStreamConsumers() bool
- func (a *SyntheticHeavyAgent) Interrupt()
- func (a *SyntheticHeavyAgent) RunConversation(message any, conversationHistory []map[string]any, streamCallback func(string)) (map[string]any, error)
Constants ¶
const AttachBytesMaxBytes = attachBytesMaxBytes
Byte cap of an attached payload the owner's image staging enforces
Variables ¶
var ( SlashCompleter func(ctx context.Context, skillCommands, skillBundles skills.SkillCommands) func(text string) []SlashCompletion GatewayKnownCommands func() map[string]bool )
Hooks into pkg/commands assigned in cmd/icebath/wiring.go, the slash completer and the gateway command names
var ( SaveClipboardImage func(dest string) bool HasClipboardImage func() bool ClipboardImageBlocker func() (missing string, noDesktop bool) )
Clipboard image helpers set by the binary
var ActivePersonalityName func(cfg map[string]any) string
Active personality name of a config, the personality owner assigned at startup
var AvailablePersonalities func(cfg map[string]any) map[string]any
Personalities a config offers, the built ins merged with its own, assigned by the command wiring
var Banner struct { ReleaseDate string AvailableSkills func(ctx context.Context) *pyjson.Object UpdateResult func(timeout time.Duration) *int64 }
CLI banner facts the session info reports, assigned by the command wiring from the app package
var CatalogRegistry func(ctx context.Context) ([]CatalogCommand, map[string][]string)
Builtin registry rows in registry order and the subcommand table of pkg/commands, assigned in cmd/icebath/wiring.go
var CommandsByCategory func() []HelpCategory
CommandsByCategory lists the CLI command registry by category, assigned in cmd/icebath/wiring.go
Setup sections and first run modes a hosted job runs besides the model section, assigned in cmd/icebath/wiring.go
var NormalizePersonalityName func(value any) string
NormalizePersonalityName is the personality name normalizer of the CLI, assigned in cmd/icebath/wiring.go
var PersistPersonality func(ctx context.Context, value any) bool
PersistPersonality saves the chosen personality to config, assigned in cmd/icebath/wiring.go
var Personality struct { EphemeralSystemPrompt func(cfg map[string]any) string }
Session overlay prompt of the personality commands package, assigned by the command wiring
var Prefill struct { ResolveFile func(ctx context.Context, cfg map[string]any) string Load func(ctx context.Context, filePath, baseDir string) []any }
Prefill message loaders of the CLI config package, assigned by the command wiring from the app package
var QuickSnapshots func(home string, t func(key string, kwargs map[string]any) string) SnapshotLines
Shared /snapshot command over a profile home and a catalog lookup, set by the wiring
var RegistryPluginCommands func(ctx context.Context) ([]CatalogCommand, map[string][]string)
Plugin owned registry commands sorted by name with their subcommand table, assigned in cmd/icebath/wiring.go
var RenderPersonalityPrompt func(value any) string
RenderPersonalityPrompt renders a personality definition as its prompt, assigned in cmd/icebath/wiring.go
var ResolveCommand func(name string) (ResolvedCommand, bool)
Registry resolver of pkg/commands assigned at startup, false for a name no command or alias carries
Persists one dot separated key into the active home config, the cli save_config_value assigned in cmd/icebath/wiring.go
var StatusReport struct { Fields func(ctx context.Context, sessionID string, a *agent.AIAgent, meta map[string]any, model, provider string, tokens any, agentRunning bool, profileHome string) map[string]any Lines func(fields map[string]any, keys ...string) []string }
Status report facts and their display lines, assigned from the CLI status report at startup
Functions ¶
func AtExit ¶
func AtExit()
Runs and clears the queued exit functions newest first, a panicking one not stopping the rest
func BindHostedRoomServer ¶
func BindHostedRoomServer()
Binds the hosted room service over these installed handlers into the process slot without starting it
func ClearTUIMessageInjector ¶
Drops this process's TUI host, leaving a different owner in place
func CommandCatalog ¶
func CommandCatalog(ctx context.Context, scope func(context.Context) (context.Context, error)) (tuigateway.CommandsCatalogResult, error)
Registry backed slash metadata by category, each discovery source degrading into the warning on failure
func ConsumeTypedStopPhrase ¶
Typed stop check of the canonical prompt submit, the submitter answered in the reply instead of an event
func DecodeAttachBase64 ¶
Decoded data URL or bare base64 payload under the cap, nil when invalid
func Dispatch ¶
Routes one inbound RPC, a long handler to the pool returning nil and every other inline with its response
func DispatchTUIGatewayEntry ¶
Runs the stdio gateway when the binary was re-executed as it, ending the process through exit
func GatewayToolsets ¶
Enabled and configured disabled toolsets a TUI session of the platform is built with
func HandleWS ¶
func HandleWS(ctx context.Context, ws ServedSocket, authIdentity map[string]any, subprotocol *string, operator bool) error
Runs one WebSocket session wire compatible with the stdio entry, the identity the upgrade verified owning its sessions
func InstallTUIMessageInjector ¶
Publishes the TUI host on manager, or process wide and on the active profile's manager when manager is nil
func OpenLaunchStore ¶
Opens the launch session store before a gateway serves, the described failure stopping the start
func PathCompletionItems ¶
func PathCompletionItems(ctx context.Context, word, root, sessionKey string, local bool) ([]tuigateway.CompletionItem, error)
Path and context ref rows for a word rooted in a folder, an empty root meaning the terminal workspace
func ProfileRuntimeScope ¶
Context bound to the home, hydrated secrets and terminal policy of a profile home, empty meaning the launch profile
func ProjectInfoForCwd ¶
Project of a working directory with its id, slug, name and primary path, nil when none
func RefreshLiveSessions ¶
func RefreshLiveSessions(ctx context.Context, h *string, preservePrefix bool, pluginNote *[2]string) error
Rebuilds live session tool snapshots of a home for the gateway plugin activation hook
func RunToolsSetupFlow ¶
Tools section of /setup asked through a flow asker, the Blank Slate tool selector included
func SessionSteerAuthority ¶
Steer authority of the bound request as untyped values, both nil when the transport holds none
func SettleWorktree ¶
Carries out an exit choice, else removes a clean tree and its branch or echoes why the tree is kept
func SlashCompletions ¶
func SlashCompletions(ctx context.Context, text string, scope func(context.Context) (context.Context, error)) (tuigateway.CompleteSlashResult, error)
Slash popup rows for the text, skills and bundles read inside the scope of the calling session, for both routes
func SniffImageExt ¶
Image extension from the filename hint, else magic bytes, else png
Types ¶
type CatalogCommand ¶
One builtin registry command as the palette catalog reads it
type CompressionBusy ¶
type CompressionBusy struct{ Msg string }
Manual compression refused because a turn already holds the session
func (*CompressionBusy) Error ¶
func (e *CompressionBusy) Error() string
type CompressionLockHeld ¶
type CompressionLockHeld struct{ Holder string }
Compression skipped because a concurrent compression lock row is held
func (*CompressionLockHeld) Error ¶
func (e *CompressionLockHeld) Error() string
type HelpCategory ¶
HelpCategory is one help category of the command registry with its command and description rows
type HostedRoomServer ¶
type HostedRoomServer struct {
Method func(name string) Handler
SessionRecord func(sessionID string) *tuihost.Session
PendingApproval func(ctx context.Context, sessionKey string) map[string]any
ProfileHome func(profile string) (string, error)
}
Server surface the adapter drives, its installed handlers, live session records, pending approvals and profile homes
func InstalledHostedRoomServer ¶
func InstalledHostedRoomServer() HostedRoomServer
The fully initialized server of this process
type HostedRoomServerRPC ¶
type HostedRoomServerRPC struct {
DBPath *string
// contains filtered or unexported fields
}
Installed server handlers normalized for the hosted room runtime
func NewHostedRoomServerRPC ¶
func NewHostedRoomServerRPC(server HostedRoomServer, dbPath *string) *HostedRoomServerRPC
Server RPC whose event bound files resolve from the room store at the path, none without a store
func (*HostedRoomServerRPC) AcceptsAttachments ¶
func (r *HostedRoomServerRPC) AcceptsAttachments() bool
Whether event bound files can be resolved for a turn on this route
func (*HostedRoomServerRPC) Approve ¶
func (r *HostedRoomServerRPC) Approve(ctx context.Context, sessionID, requestID, choice string) (map[string]any, error)
Resolves one exact local room approval without broad policy changes
func (*HostedRoomServerRPC) Create ¶
func (r *HostedRoomServerRPC) Create(ctx context.Context, profile, title, source string) (map[string]any, error)
Hidden room plumbing session that follows the profile config and survives disconnects
func (*HostedRoomServerRPC) History ¶
func (r *HostedRoomServerRPC) History(ctx context.Context, profile, sessionID, source string) ([]map[string]any, error)
Message rows of the session, non dict rows dropped
func (*HostedRoomServerRPC) Info ¶
func (r *HostedRoomServerRPC) Info(ctx context.Context, profile, sessionID, source string) (map[string]any, error)
Whether the live record runs, its hosted task and any approval it waits on
func (*HostedRoomServerRPC) Interrupt ¶
func (r *HostedRoomServerRPC) Interrupt(ctx context.Context, profile, sessionID, source, expectedTaskID string) (map[string]any, error)
Interrupts the session only while the expected hosted task is the running one
func (*HostedRoomServerRPC) ResolveExact ¶
func (r *HostedRoomServerRPC) ResolveExact(ctx context.Context, profile, title, source string) (map[string]any, error)
Newest hidden session with exactly the title, nil when the profile holds none
func (*HostedRoomServerRPC) Resume ¶
func (r *HostedRoomServerRPC) Resume(ctx context.Context, profile, sessionID, source string) (map[string]any, error)
Resumed session without its message list
func (*HostedRoomServerRPC) Submit ¶
func (r *HostedRoomServerRPC) Submit(ctx context.Context, req gateway.HostedSubmit) (map[string]any, error)
Submits one fenced member turn, its bound files staged in the member's own home under a capture lease
type HostedRoomSessionError ¶
An in process session operation the installed handler rejected
func (*HostedRoomSessionError) Error ¶
func (e *HostedRoomSessionError) Error() string
type OwnerUnavailableError ¶
type OwnerUnavailableError struct {
}
Owner could not take the prompt, NotRunning when no gateway serves the home and Unconfirmed when it may be queued
func (*OwnerUnavailableError) Error ¶
func (e *OwnerUnavailableError) Error() string
func (*OwnerUnavailableError) Unwrap ¶
func (e *OwnerUnavailableError) Unwrap() error
type ProfileUnavailableError ¶
Explicit profile param naming no live profile on this host, answered as JSON RPC 4064
func (*ProfileUnavailableError) Error ¶
func (e *ProfileUnavailableError) Error() string
func (*ProfileUnavailableError) PyTypeName ¶
func (e *ProfileUnavailableError) PyTypeName() string
Python exception class name the error stands for
type ResolvedCommand ¶
Registry command a typed name resolves to with its localized description and category
type ServedSocket ¶
type ServedSocket interface {
tuihost.WSConn
Accept(ctx context.Context, subprotocol *string) error
// Next text frame, a SocketDisconnect once the peer leaves
ReceiveText(ctx context.Context) (string, error)
// Peer address, nil when the server reports none
Client() *SocketPeer
// Raw stream socket under the connection, nil when the server exposes none
RawConn() net.Conn
// Session authority of the route scope, else of the app state, nil when the backend has none
SessionAuthority() *gateway.SessionAuthority
}
Accepted WebSocket one session connection runs over, as the gateway session route hands it in
type SlashCompletion ¶
type SlashCompletion struct {
Text, Display, Meta string
}
One completion of the prompt slash completer, display and meta already plain text
type SnapshotLines ¶
type SnapshotLines interface {
List() ([]string, error)
Create(parts []string) ([]string, error)
Prune(parts []string) ([]string, error)
RestoreTarget(parts []string) (string, []string, error)
}
Lines of the shared /snapshot subcommands
type SocketDisconnect ¶
Peer close a socket read reports, the starlette WebSocketDisconnect with its code and reason
func (*SocketDisconnect) Error ¶
func (e *SocketDisconnect) Error() string
type SocketPeer ¶
Host and port of a socket peer, the port nil when unknown
type StoreUnavailableError ¶
type StoreUnavailableError = state.StoreUnavailableError
Session store that would not open, shared with the messaging gateway so both name the cause alike
type SyntheticHeavyAgent ¶
type SyntheticHeavyAgent struct {
SessionID, Model, Provider, APIMode string
BaseURL, APIKey, Platform, CachedSystemPrompt string
ConfigContextLength int
SessionInputTokens, SessionOutputTokens int64
SessionPromptTokens, SessionCompletionTokens int64
SessionReasoningTokens, SessionTotalTokens int64
SessionAPICalls int64
History []map[string]any
// contains filtered or unexported fields
}
Agent shaped CPU burn whose turn holds a core with pure computation and streams synthetic deltas
func NewSyntheticHeavyAgent ¶
func NewSyntheticHeavyAgent(sessionID, model string) *SyntheticHeavyAgent
Synthetic agent for a session reporting the given model label
func (*SyntheticHeavyAgent) ClearInterrupt ¶
func (a *SyntheticHeavyAgent) ClearInterrupt()
Clears a pending interrupt before the next turn
func (*SyntheticHeavyAgent) Close ¶
func (a *SyntheticHeavyAgent) Close()
Teardown that also stops the burn
func (*SyntheticHeavyAgent) HasStreamConsumers ¶
func (a *SyntheticHeavyAgent) HasStreamConsumers() bool
Whether the turn has stream consumers, always true for the synthetic loop
func (*SyntheticHeavyAgent) Interrupt ¶
func (a *SyntheticHeavyAgent) Interrupt()
Stops the running burn
func (*SyntheticHeavyAgent) RunConversation ¶
func (a *SyntheticHeavyAgent) RunConversation(message any, conversationHistory []map[string]any, streamCallback func(string)) (map[string]any, error)
Runs one synthetic turn, burning CPU and streaming deltas until the duration elapses or an interrupt lands
Source Files
¶
- agent_callbacks.go
- agent_callbacks_cbs.go
- agent_callbacks_mirror.go
- agent_callbacks_reset.go
- agent_callbacks_side.go
- agent_callbacks_wire.go
- agent_factory.go
- atexit.go
- browser_hooks.go
- change_watcher.go
- change_watcher_pet.go
- change_watcher_skin.go
- checkpoints.go
- client_capabilities.go
- command_catalog.go
- command_discovery.go
- entry.go
- entry_mcp.go
- entry_platform_unix.go
- env.go
- float_value.go
- hosted_room_server_rpc.go
- inline_image.go
- log.go
- method_ctx.go
- methods_browser.go
- methods_complete.go
- methods_complete_helpers.go
- methods_config.go
- methods_config_set.go
- methods_config_set_emit.go
- methods_config_setup.go
- methods_connectors.go
- methods_connectors_owner.go
- methods_display.go
- methods_display_desktop.go
- methods_display_observe.go
- methods_display_watch.go
- methods_export.go
- methods_groups.go
- methods_groups_forward.go
- methods_i18n.go
- methods_images.go
- methods_learning_graph.go
- methods_plugins_manage.go
- methods_profiles.go
- methods_profiles_create.go
- methods_prompt.go
- methods_prompt_attach.go
- methods_prompt_history.go
- methods_prompt_respond.go
- methods_prompt_side.go
- methods_prompt_submit.go
- methods_prompt_truncate.go
- methods_prompt_typed_stop.go
- methods_session.go
- methods_session_branch.go
- methods_session_control.go
- methods_session_delegation.go
- methods_session_interrupt.go
- methods_session_list.go
- methods_session_meta.go
- methods_session_model_guard.go
- methods_session_pets.go
- methods_session_resume.go
- methods_session_runtime.go
- methods_session_usage.go
- methods_session_workspace.go
- methods_setup_action.go
- methods_setup_hosted.go
- methods_setup_section.go
- methods_skills_manage.go
- methods_slash_live.go
- methods_slash_mirror.go
- methods_subagents.go
- methods_tools.go
- methods_tools_builtins.go
- methods_tools_config.go
- methods_tools_dispatch.go
- methods_tools_home_scope.go
- methods_tools_learning.go
- methods_tools_mcp.go
- methods_tools_mcp_enable.go
- methods_tools_plugin_servers.go
- methods_tools_rollback.go
- methods_tools_rpc.go
- methods_tools_slash_exec.go
- methods_ui_host.go
- methods_voice.go
- methods_voice_liveness.go
- methods_voice_rpc.go
- methods_voice_turn.go
- methods_voice_turn_base.go
- model_switch.go
- model_switch_apply.go
- model_switch_bot_caps.go
- model_switch_rebuild.go
- model_switch_runtime.go
- owner_forward.go
- path_completion_export.go
- pet_hooks.go
- pet_sheet.go
- plugin_inject.go
- prompt_attachments.go
- prompt_attachments_export.go
- prompt_turn.go
- prompt_turn_helpers.go
- prompt_turn_run.go
- render.go
- rpc_dispatch.go
- server.go
- server_clear_pending.go
- server_config_write.go
- server_crash.go
- server_idempotency.go
- server_long_handlers.go
- server_mcp_reload.go
- server_mcp_rev.go
- server_model_switch_marker.go
- server_pet.go
- server_pet_gen.go
- server_profile_db.go
- server_project_export.go
- server_requests.go
- server_session_locks.go
- server_session_processes.go
- server_session_support.go
- server_shutdown.go
- server_spawn_trees.go
- server_steer.go
- session_auto_continue.go
- session_auto_continue_snapshots.go
- session_auto_continue_turns.go
- session_compression.go
- session_compression_sync.go
- session_history.go
- session_lifecycle.go
- session_lifecycle_finalize.go
- session_lifecycle_slots.go
- session_lifecycle_teardown.go
- session_notifications.go
- session_notifications_owns.go
- session_notifications_poller.go
- session_notifications_poller_kanban.go
- session_notifications_turns.go
- session_reaper.go
- session_reaper_cap.go
- session_reaper_flush.go
- session_reaper_idle.go
- session_reaper_quiescent.go
- session_registry.go
- session_registry_build.go
- session_registry_checkpoints.go
- session_registry_hydration.go
- session_registry_lookup.go
- session_registry_reconcile.go
- session_registry_resume.go
- session_registry_schedule.go
- session_workdir.go
- session_workdir_rewind.go
- session_workdir_rows.go
- session_workdir_set.go
- setup_flow.go
- setup_section_sources.go
- setup_section_terminal.go
- setup_section_tools.go
- setup_section_tts.go
- slash_fuzzy.go
- synthetic_turn.go
- tool_progress.go
- tool_progress_complete.go
- user_messages.go
- voice_methods.go
- voice_mode_hooks.go
- voice_session.go
- ws.go
- ws_legacy_dispatch.go
- ws_legacy_fallback.go