Documentation
¶
Index ¶
- Constants
- Variables
- func Advertise(transport Transport, serverRequests bool)
- func AnswersRequests(transport Transport) bool
- func AttachSessionTransport(session *Session, transport Transport) bool
- func BindHostedRoomServer(newService func(ctx context.Context, dbPath string) (HostedRoomService, error), ...)
- func BindIdentity(isAuthenticated func(identity any) bool, ownerSubject func() string)
- func BindSinks(write func(frame *pyjson.Object), ...)
- func BindTransport(ctx context.Context, transport Transport) context.Context
- func Branch(cwd string) string
- func BridgedToolLabels(ctx context.Context, name string, args map[string]any) []map[string]string
- func BroadcastGlobalEvent(event string, payload map[string]any, skip ...Transport)
- func BroadcastSkinIfChanged(ctx context.Context)
- func BuildImageRefMessage(userText string, imagePaths []string) string
- func BuildPersistMessageWithImageRefs(userText string, imagePaths []string) string
- func BuildPersistUserMessage(userText string, imagePaths []string, runMessage any) any
- func CachedReaderSessionFields(profilePath string, reader any, compute func() (map[string]any, error)) (map[string]any, error)
- func CachedSessionFields(profilePath string, compute func() (map[string]any, error)) (map[string]any, error)
- func CachedUIMetaFields(profileDir string, compute func() (map[string]any, error)) (map[string]any, error)
- func Cancel(sid *string, reason string, method *string) int
- func CheckRequestParams(method string, params *pyjson.Object) error
- func ClaimActiveSessionSlotRefusal(ctx context.Context, sessionKey, liveSessionID, surface, profileHome string) (*activesessions.Lease, *activesessions.Refusal)
- func ClaimParked(owns func(map[string]any) bool) []map[string]any
- func ClearParked()
- func ClearTurnMarker(home, sessionKey string)
- func ClientConfig(cfg map[string]any) tuigateway.ClientConfig
- func CoerceMessageText(content any, imageURLs bool) string
- func CommentaryItems(message map[string]any) []string
- func CommonRepoRoot(cwd string) string
- func ConnectorUIPayload(value any) any
- func ContentDisplayText(content any) string
- func DetachSessionTransport(session *Session, transport Transport) bool
- func DiagnoseStdinState() string
- func DisplayMouseTracking(display any) string
- func DropSessionViewer(session *Session, transport Transport)
- func Emit(ctx context.Context, event, sid string, payload map[string]any) bool
- func EmitRoomMemberActivity(ctx context.Context, hostedTask any, kind string, payload any, seq any) bool
- func EventFrame(event, sid string, payload map[string]any) *pyjson.Object
- func EventsSince(sid string, lastSeen int) []*pyjson.Object
- func ExpandSkillInvocationForReplay(ctx context.Context, text, taskID string) (out string)
- func FittedAnswer(method string, raw any) (*pyjson.Object, error)
- func Forget(transport Transport)
- func ForgetSession(sid string)
- func FormatFocusStatus(enabled bool, configuredMode any) string
- func FormatFocusToggleMessage(enabled bool, configuredMode any) string
- func HandleSpuriousEOF(recoveryTimes *[]float64, logFn func(string)) bool
- func HistoryToMessages(ctx context.Context, history []any, profileHome string, imageURLs bool) ([]any, error)
- func IsDisplayHiddenMarker(role, text string) bool
- func IsResponseFrame(obj any) bool
- func IsSensitiveFilename(name string) bool
- func IsSensitivePath(p string) bool
- func IsStdioTransport(t any) bool
- func IsTextOnlyBusyPayload(content any) bool
- func IsTruncated(sid string, lastSeen int) bool
- func IsUnmappedContainerPath(ctx context.Context, raw, profileHome string) (unmapped bool)
- func LatestSeq(sid string) int
- func LeaseMetadata(liveSessionID string) map[string]any
- func LoadCfg(ctx context.Context) map[string]any
- func LockAnswer(requestID, questionID string, answer any) (remaining []string, ok bool, err error)
- func MarkerWriterState(entry any) string
- func NormalizeTodoState(value any) *pyjson.Object
- func NormalizeToolProgressMode(mode any, def string) string
- func NoteSkinBroadcast(ctx context.Context)
- func OpenRequestForTests(sid, method string, params *pyjson.Object) string
- func OpenRequests(sid string) []*pyjson.Object
- func OutputRiskPayload(name string, kw map[string]any) map[string]any
- func ParkNotification(evt map[string]any) bool
- func PendingKind(sid string) string
- func ProjectHistoryCommentary(ctx context.Context, messages []any, profileHome string) ([]any, error)
- func ProjectRoomMemberActivity(ctx context.Context, frame *pyjson.Object, session func(sid string) *Session) bool
- func ReadTurnMarker(home, sessionKey string) map[string]any
- func RecordTurnStart(home, sessionKey, prompt string, attempts int, autoContinue bool, ...)
- func RedactVerboseText(text string) string
- func RegisterLiveTransport(transport Transport)
- func ReleaseKey(key string, blocking bool)
- func RenderDiff(text string, cols int) (string, bool)
- func ReplayEpoch() string
- func RepoRoot(cwd string) string
- func ResetForTests()
- func ResetReplayState()
- func ResolveFocusArg(arg string, current bool) (string, *bool)
- func ResolveResponse(frame *pyjson.Object, transport Transport) bool
- func ResolveResponseOf(frame *pyjson.Object, transport Transport) bool
- func RosterProfileYAMLSignature(profileDir string) []rosterFilePart
- func RosterStoreSignature(profilePath string) []rosterFilePart
- func Send(ctx context.Context, method, sid string, params *pyjson.Object, ...) (*pyjson.Object, error)
- func SendAsync(method, sid string, params *pyjson.Object, onResult func(*pyjson.Object)) (func(reason string), error)
- func SerializeFrame(obj *pyjson.Object, peer string, log *slog.Logger) string
- func SessionAuthUserID(session *Session) *string
- func SessionHasLiveTransport(session *Session) bool
- func SessionHasLiveTransportExcluding(session *Session, excluding Transport) bool
- func SessionTransportContains(session *Session, transport Transport) bool
- func SetEventPresentationMuted(muted func(ctx context.Context, event, sid string) bool)
- func SetSessionRecord(sid string, record *Session)
- func SetSessionViewer(session *Session, transport Transport, at float64)
- func SetStdioIsRPCChannel(on bool)
- func SettleBatch(locked *pyjson.Object, frameResult any, ended string) *pyjson.Object
- func SkillScaffoldProjection(contentText string) string
- func SkinHomeFor(profileID string) string
- func SkinPayload(ctx context.Context, cfg map[string]any) (payload map[string]any)
- func StampEvent(obj *pyjson.Object)
- func StampReplyFrame(segments *TurnSegments, event string, payload map[string]any) map[string]any
- func StampSessionFrame(session *Session, event string, payload map[string]any) map[string]any
- func StdioIsRPCChannel() bool
- func StopHostedRoomService(timeout float64) bool
- func SubagentEvent(eventType string, name, preview any, kw map[string]any, showReasoning bool) (tuigateway.SubagentEventPayload, error)
- func SubagentPayload(eventType string, name, preview any, kw map[string]any, showReasoning bool) (*pyjson.Object, error)
- func SwapRealStdoutForTests(w io.Writer) func()
- func TodoStateFromHistory(history []map[string]any) *pyjson.Object
- func ToolCtx(name string, args map[string]any) (out string)
- func ToolResultText(result any) string
- func TransportAuthUserID(transport Transport) *string
- func TransportIsDead(transport Transport) bool
- func UnholdParked(events []map[string]any)
- func UnregisterLiveTransport(transport Transport)
- func VisibleCommentary(ctx context.Context, text string) string
- func WriteJSON(ctx context.Context, obj *pyjson.Object) bool
- type ConnectorRefusalSpec
- type DisplayMetadataError
- type FanoutTransport
- func (f *FanoutTransport) Attach(transport Transport) bool
- func (f *FanoutTransport) Close()
- func (f *FanoutTransport) Contains(transport Transport) bool
- func (f *FanoutTransport) Detach(transport Transport) bool
- func (f *FanoutTransport) HasTransports(excluding Transport) bool
- func (f *FanoutTransport) Transports() []Transport
- func (f *FanoutTransport) Write(obj *pyjson.Object) bool
- func (f *FanoutTransport) WriteOverflow(obj *pyjson.Object, overflow func(Transport) *pyjson.Object) bool
- type HTTPError
- type HostedRoomService
- type LiveSession
- type RequestParamsError
- type ServerRequest
- type Session
- func (s *Session) Fields() map[string]any
- func (s *Session) Get(key string) any
- func (s *Session) Lookup(key string) (any, bool)
- func (s *Session) Pop(key string) (any, bool)
- func (s *Session) Set(key string, value any)
- func (s *Session) SetDefault(key string, def any) any
- func (s *Session) Update(fields map[string]any)
- type SessionEntry
- type SkinSignature
- type StdioTransport
- type Transport
- type TurnSegments
- type UnknownQuestionError
- type WSConn
- type WSTransport
- func (t *WSTransport) Abort()
- func (t *WSTransport) AuthIdentity() map[string]any
- func (t *WSTransport) Close()
- func (t *WSTransport) Closed() bool
- func (t *WSTransport) Conn() WSConn
- func (t *WSTransport) WS() WSConn
- func (t *WSTransport) Write(obj *pyjson.Object) bool
- func (t *WSTransport) WriteAsync(obj *pyjson.Object) bool
- func (t *WSTransport) WriteManyAsync(frames []*pyjson.Object) bool
- func (t *WSTransport) WriteManyIfCurrentAsync(frames []*pyjson.Object, isCurrent func() bool) bool
Constants ¶
const ( // Error code a client answers when none of its windows shows the session of the request NotShownCode = 4404 // Refusal the tool reports once every attached client declined NotShownMessage = "No attached client is showing this chat, so the request is out of reach. " + "Ask the user to open this chat, then retry." )
const AutoContinueNotePrefix = autoContinueNotePrefix
Opening of the system note an auto continued turn carries, shared with the gateway recovery notes
const CommentaryWithheld = "commentary_withheld"
Display metadata flag on a held turn's published reply whose commentary no projection shows
const FocusToolProgressMode = "off"
Tool progress mode focus view pins while it is on
const MaxRecoveriesPerMinute = 10
Spurious stdin EOF recoveries allowed per minute before the reader gives up
const RoomMemberActivityHook = "on_room_member_activity"
Plugin hook a hosted room member's live runtime events are projected to
const SandboxNotFound = "File not found on the gateway host: the path may live inside the agent sandbox"
Detail of a 404 for a path that likely names a file inside the agent sandbox
Refusal text shown when a claim errors before it proved the session unowned
const SessionSegmentsKey = "_turn_segments"
Session record key holding the segment cursor of the running prompt turn
const TUIGatewayEntry = "__icebath_tui_gateway_entry__"
Hidden argv entry that runs the stdio JSON RPC gateway in a child process
Variables ¶
var ( ConnectorInvalidParams = ConnectorRefusalSpec{4000, "invalid_params", "Connector parameters are invalid."} ConnectorInvalidAnswer = ConnectorRefusalSpec{4002, "invalid_answer", "Connection answer is invalid."} ConnectorUnknownOperation = ConnectorRefusalSpec{4004, "unknown_operation", "No open operation with that op_id."} ConnectorUnknownTargetRefusal = ConnectorRefusalSpec{4004, "unknown_target", "No such target on the open operation."} ConnectorRequestFailed = ConnectorRefusalSpec{5034, "connector_request_failed", "Connector request failed. Try again explicitly."} ConnectorReissueRefused = ConnectorRefusalSpec{4002, "reissue_refused", "The target cannot be run again."} ConnectorReissueRefusals = map[string]ConnectorRefusalSpec{ tools.ConnUnknownTarget: ConnectorUnknownTargetRefusal, tools.ConnMixedKinds: {4000, "invalid_params", "One target kind per request."}, tools.ConnLinkStillValid: {4002, "link_still_valid", "Reopen the stored link."}, tools.ConnSettled: {4002, "reissue_refused", "The operation has settled."}, tools.ConnNotAllowed: {4002, "reissue_refused", "This target cannot be run again."}, tools.ConnRefused: ConnectorReissueRefused, } )
Connector refusals of the legacy handlers and the session authority's connection verbs
var (
FanoutMaxPendingFrames = 16384
)
Bounds of one peer mailbox, the frame count and the serialized bytes it may hold unsent
var GatewayDocker struct { EnvActive func(ctx context.Context) (bool, error) VolumeMounts func(ctx context.Context) ([][2]string, error) }
Docker backend probes pkg/gateway owns, assigned by pkg/gateway at init
var MouseTrackingAliases = tuigateway.MouseTrackingAliases
Mouse tracking spellings mapped to off, wheel, buttons or all
Functions ¶
func AnswersRequests ¶
True when the client of the transport advertised that it answers server to client requests
func AttachSessionTransport ¶
Attaches a transport to the session's peer set, true when it was not attached yet
func BindHostedRoomServer ¶
func BindHostedRoomServer(newService func(ctx context.Context, dbPath string) (HostedRoomService, error), defaultDBPath func(ctx context.Context) string)
Binds the initialized server's service constructor and room database default without starting a worker
func BindIdentity ¶
Installs the gateway functions that tell a signed in identity and name the host owner
func BindSinks ¶
func BindSinks(write func(frame *pyjson.Object), emit func(event, sid string, payload map[string]any), answerable func(sid string) bool, clients func(sid string) []Transport)
Binds the frame writer, the event emitter, the answerable check and, when given, the answering client lookup
func BindTransport ¶
Context whose handlers write to the given transport
func BridgedToolLabels ¶
Labels of a call rendered as the payload maps gateway cards consume
func BroadcastGlobalEvent ¶
Fans a session less event to every connected client, stdio when it is the client channel, else drops it
func BroadcastSkinIfChanged ¶
Emits skin.changed when a skin moved, launch peers through the global broadcast and served homes to their own peers
func BuildImageRefMessage ¶
Model message pointing the agent at each attached image so it runs vision_analyze in loop
func BuildPersistMessageWithImageRefs ¶
Persisted user text with an image directive line per attached image after the caption
func BuildPersistUserMessage ¶
Persisted user turn shaped like the model payload with only its text part swapped for the image refs form
func CachedReaderSessionFields ¶
func CachedReaderSessionFields(profilePath string, reader any, compute func() (map[string]any, error)) (map[string]any, error)
Session fields that also depend on the comparable reader key, reused while the store has not moved
func CachedSessionFields ¶
func CachedSessionFields(profilePath string, compute func() (map[string]any, error)) (map[string]any, error)
Session fields of compute reused while the profile's session store has not moved
func CachedUIMetaFields ¶
func CachedUIMetaFields(profileDir string, compute func() (map[string]any, error)) (map[string]any, error)
ui_meta fields of compute deep copied and reused while the profile.yaml has not changed
func Cancel ¶
Withdraws the open requests of one session or of all when sid is nil, narrowed to one method when given
func CheckRequestParams ¶
Refusal of the params a server request is about to carry, naming the field that does not fit its typed contract
func ClaimActiveSessionSlotRefusal ¶
func ClaimActiveSessionSlotRefusal(ctx context.Context, sessionKey, liveSessionID, surface, profileHome string) (*activesessions.Lease, *activesessions.Refusal)
Claims the active lease for a surface, a reasonless ownership refusal when the claim itself errors
func ClaimParked ¶
Parked events the owner predicate accepts in arrival order, each handed out to exactly one poller
func ClearTurnMarker ¶
func ClearTurnMarker(home, sessionKey string)
Removes the marker once its turn concluded
func ClientConfig ¶
func ClientConfig(cfg map[string]any) tuigateway.ClientConfig
Settings the terminal UI follows from a profile config, the local display overlay applied and the arena redacted
func CoerceMessageText ¶
Plain string of message content keeping image URLs inline unless imageURLs is false
func CommentaryItems ¶
Commentary phase texts of an assistant row
func CommonRepoRoot ¶
Main repository root of cwd folding linked worktrees, in git forward slash spelling
func ConnectorUIPayload ¶
Connector value with secret keyed entries replaced and every string redacted for a renderer
func ContentDisplayText ¶
Display text of message content with image parts as stand in labels and list parts joined by lines
func DetachSessionTransport ¶
Removes a transport from a session's peers and viewers, true when another live client keeps the session from parking
func DiagnoseStdinState ¶
func DiagnoseStdinState() string
O_NONBLOCK and SO_RCVTIMEO state of fd 0 for crash log forensics
func DisplayMouseTracking ¶
Mouse tracking mode of the display config, legacy tui_mouse only when mouse_tracking is absent
func DropSessionViewer ¶
Drops one viewer registration of a session
func Emit ¶
Emits one event for a session unless its presentation is muted, stamped with the running turn identity
func EmitRoomMemberActivity ¶
func EmitRoomMemberActivity(ctx context.Context, hostedTask any, kind string, payload any, seq any) bool
Queues one activity event stamped with the room coordinates for every consumer, false when nobody listens
func EventFrame ¶
JSON RPC event notification of one event for a session, the payload key present only with a payload
func EventsSince ¶
Recorded event objects newer than lastSeen for a session, decoded outside the ring lock
func ExpandSkillInvocationForReplay ¶
Skill message a projected slash invocation expands back into, the text unchanged when not resolvable
func FittedAnswer ¶
Answer a client gave a server request, refused with the field named when it does not fit the typed answer
func ForgetSession ¶
func ForgetSession(sid string)
Releases a torn down session's replay ring so late frames are never retained again
func FormatFocusStatus ¶
Human readable focus status body without ANSI
func FormatFocusToggleMessage ¶
Confirmation line printed when focus view is switched without ANSI
func HandleSpuriousEOF ¶
Recovers a spurious empty read of stdin, true when the reader should continue and false on a genuine close or rate limit
func HistoryToMessages ¶
func HistoryToMessages(ctx context.Context, history []any, profileHome string, imageURLs bool) ([]any, error)
Display projection of stored history rows, image parts rendered as stand in labels when imageURLs is false
func IsDisplayHiddenMarker ¶
Whether a row is a gateway system notice persisted as a user row that must never render as a bubble
func IsResponseFrame ¶
True for a client response, an object with an id and a result or error member and no method
func IsSensitiveFilename ¶
Whether a basename is an env file or a credential store, case insensitive
func IsSensitivePath ¶
Whether the basename is sensitive or any component is a credential directory
func IsStdioTransport ¶
Whether a transport is the module stdio transport
func IsTextOnlyBusyPayload ¶
Whether a busy submit carries only plain text and no attachment or media
func IsTruncated ¶
True when frames between lastSeen and the oldest retained seq were evicted
func IsUnmappedContainerPath ¶
Whether a path is a docker backend container path rather than a host path or a typo on the host
func LeaseMetadata ¶
Writer identity of a lease for one live session id
func LoadCfg ¶
Effective user config of the active profile without the defaults merge, empty on any failure
func LockAnswer ¶
Locks one batch answer and returns the ids still open, not ok when no open batch has that request id
func MarkerWriterState ¶
Alive, dead or unknown for the process that wrote the marker entry
func NormalizeTodoState ¶
Client safe full task plan snapshot of a decoded value, nil when malformed or the unused empty store
func NormalizeToolProgressMode ¶
Known tool progress mode of a raw config value, log kept as a gateway mode, else the default
func NoteSkinBroadcast ¶
Syncs the watcher baseline after a skin broadcast so the watcher does not repaint it again
func OpenRequestForTests ¶
Publishes an open request with no frame and no contract check for tests that seed one, returning its id
func OpenRequests ¶
Unanswered requests of a session as snapshots, oldest first
func OutputRiskPayload ¶
Risk badge payload of a tool row from the risk metadata the executor attached, nil without metadata
func ParkNotification ¶
Retains an addressed event whose owner session is not live, false when the park cannot take it
func PendingKind ¶
Method of the oldest open request of a session, empty when it waits on nothing
func ProjectHistoryCommentary ¶
func ProjectHistoryCommentary(ctx context.Context, messages []any, profileHome string) ([]any, error)
History rows with Codex commentary projected inside the owning profile's config and redaction scope
func ProjectRoomMemberActivity ¶
func ProjectRoomMemberActivity(ctx context.Context, frame *pyjson.Object, session func(sid string) *Session) bool
Fires the hook for an outgoing event or server request frame of a session that is running a room turn
func ReadTurnMarker ¶
Marker left by a turn that never concluded, nil when none or unreadable
func RecordTurnStart ¶
func RecordTurnStart(home, sessionKey, prompt string, attempts int, autoContinue bool, notificationCategory string)
Persists the marker of a turn about to run with how many auto continues led to it
func RedactVerboseText ¶
Forced redaction of verbose trail text capped to the TUI budget
func RegisterLiveTransport ¶
func RegisterLiveTransport(transport Transport)
Tracks a connected client transport for global broadcasts, a nil or already tracked one changing nothing
func ReleaseKey ¶
Drops everything recorded under a private key, queued for the next lock holder when non blocking
func RenderDiff ¶
Diff rendered by the agent rich output module, which upstream does not ship, so the client renders its own
func ResetForTests ¶
func ResetForTests()
Clears the open requests and the client advertisements between tests
func ResolveFocusArg ¶
Focus argument mapped to set, status or usage and the requested enabled state for set
func ResolveResponseOf ¶
Routes one client response frame to its open request, false when nothing waits for that id Settles an open sessionless request only when it was written to this transport, false for any other frame
func RosterProfileYAMLSignature ¶
func RosterProfileYAMLSignature(profileDir string) []rosterFilePart
Name, mtime ns, size and inode of the profile's profile.yaml, nil when absent
func RosterStoreSignature ¶
func RosterStoreSignature(profilePath string) []rosterFilePart
Stat parts of each session store file, nil without a store or while an mtime is still racy
func Send ¶
func Send(ctx context.Context, method, sid string, params *pyjson.Object, timeout *float64, qids []string) (*pyjson.Object, error)
Sends one request and blocks for the result, nil when unanswered, a nil timeout waiting until settled
func SendAsync ¶
func SendAsync(method, sid string, params *pyjson.Object, onResult func(*pyjson.Object)) (func(reason string), error)
Sends one request whose wait is owned elsewhere and returns the settle call that withdraws it if still open
func SerializeFrame ¶
JSON text of a frame, an internal error frame carrying the original id when it cannot be serialized
func SessionAuthUserID ¶
Login a session was created under, its stamped slot or else the login of its transport
func SessionHasLiveTransport ¶
Whether a live peer transport is attached to the session
func SessionHasLiveTransportExcluding ¶
Whether a session still has a live client other than the excluded transport, under the transport lock
func SessionTransportContains ¶
Whether a live transport is the session transport or a peer of its fanout
func SetEventPresentationMuted ¶
Installs the predicate that mutes freeform events of the session whose turn is diagnostic only
func SetSessionRecord ¶
Stores the record of a live session at the end of the registry order, a nil record dropping it
func SetSessionViewer ¶
Records a transport as a viewer of a session at the given wall clock time
func SetStdioIsRPCChannel ¶
func SetStdioIsRPCChannel(on bool)
Marks real stdout as the JSON RPC client channel, true only in the stdio TUI process
func SettleBatch ¶
Answers and outcome of a batch clarify, the tools/clarify_batch.py settle_batch rule
func SkillScaffoldProjection ¶
Slash invocation a skill expanded turn came from, empty when the row is not one
func SkinHomeFor ¶
Profile home a peer's skin follows, empty for the launch home
func SkinPayload ¶
Skin event payload for the display.skin of a config, empty when the skin engine fails
func StampEvent ¶
Stamps an outgoing event frame with its per session seq and records a frozen snapshot
func StampReplyFrame ¶
Payload with the turn identity when the event is a reply frame of a running turn, unchanged otherwise
func StampSessionFrame ¶
Reply frame stamping with the cursor of the prompt turn the session record is running, if any
func StdioIsRPCChannel ¶
func StdioIsRPCChannel() bool
True when real stdout is the JSON RPC client channel
func StopHostedRoomService ¶
Stops the process owned hosted room worker, true when none runs or it stopped in time
func SubagentEvent ¶
func SubagentEvent(eventType string, name, preview any, kw map[string]any, showReasoning bool) (tuigateway.SubagentEventPayload, error)
Subagent event payload of an agent progress callback, the chain of thought dropped while reasoning is hidden
func SubagentPayload ¶
func SubagentPayload(eventType string, name, preview any, kw map[string]any, showReasoning bool) (*pyjson.Object, error)
Subagent event payload as the ordered object the session event stream publishes
func SwapRealStdoutForTests ¶
Points the stdio frame stream at w for a case of another package and hands back the restore
func TodoStateFromHistory ¶
Latest task plan snapshot of a loaded transcript, the newest result paired with an assistant plan tool call
func ToolCtx ¶
Argument preview of a tool row capped at 80 chars, empty when the preview cannot be built
func ToolResultText ¶
Redacted and capped plain text view of a tool result for the verbose trail
func TransportAuthUserID ¶
Owner subject of a signed in transport, nil for anonymous or stdio transports
func TransportIsDead ¶
Whether a transport is closed or its peer is gone
func UnholdParked ¶
Ends the held copy mark the park took for each event
func UnregisterLiveTransport ¶
func UnregisterLiveTransport(transport Transport)
Stops tracking a transport on disconnect and drops the server requests it still owed an answer
func VisibleCommentary ¶
Commentary with think blocks stripped and secrets redacted under the context profile policy like live delivery
Types ¶
type ConnectorRefusalSpec ¶
type ConnectorRefusalSpec struct {
Code int
Reason tuigateway.ConnectorErrorReason
Message string
}
One connector refusal as both connector handlers send it, a wire code, a ConnectorErrorReason and a message
type DisplayMetadataError ¶
type DisplayMetadataError struct{ TypeName string }
AttributeError a get on display metadata that is not a dict raises
func (*DisplayMetadataError) Error ¶
func (e *DisplayMetadataError) Error() string
func (*DisplayMetadataError) PyTypeName ¶
func (e *DisplayMetadataError) PyTypeName() string
Python exception class the error stands for
type FanoutTransport ¶
type FanoutTransport struct {
// contains filtered or unexported fields
}
Ordered bounded per peer session event mailboxes, a slow peer losing its subscription on overflow
func NewFanoutTransport ¶
func NewFanoutTransport(transports ...Transport) *FanoutTransport
Fanout over the given transports
func (*FanoutTransport) Attach ¶
func (f *FanoutTransport) Attach(transport Transport) bool
Adds a peer, reusing a detached peer's writer for the same transport, false when already attached
func (*FanoutTransport) Close ¶
func (f *FanoutTransport) Close()
Detaches every peer without closing their sockets
func (*FanoutTransport) Contains ¶
func (f *FanoutTransport) Contains(transport Transport) bool
True when the transport is an attached peer
func (*FanoutTransport) Detach ¶
func (f *FanoutTransport) Detach(transport Transport) bool
Detaches a transport, true when it was attached
func (*FanoutTransport) HasTransports ¶
func (f *FanoutTransport) HasTransports(excluding Transport) bool
True when any attached transport other than excluding remains
func (*FanoutTransport) Transports ¶
func (f *FanoutTransport) Transports() []Transport
Attached peer transports
func (*FanoutTransport) Write ¶
func (f *FanoutTransport) Write(obj *pyjson.Object) bool
Fans a frame out to every attached peer, true while any peer stays attached
func (*FanoutTransport) WriteOverflow ¶
func (f *FanoutTransport) WriteOverflow(obj *pyjson.Object, overflow func(Transport) *pyjson.Object) bool
Fans a frame out, an overflowed peer getting the notice overflow returns or its transport closed
type HTTPError ¶
Status and detail of the error a file path helper raises
func FsPath ¶
Resolved host path a raw path or file URL names, an HTTP 400 for an empty or invalid one
func FsRegularFile ¶
Resolved regular readable non sensitive file a path names with its stat, else the HTTP error
type HostedRoomService ¶
type HostedRoomService interface {
StorePath() string
Start() error
Stop(timeout float64) bool
RuntimeStatus() map[string]any
}
Process owned hosted room worker that stops without interrupting accepted turns
func GetHostedRoomService ¶
func GetHostedRoomService() HostedRoomService
Active service when its lifecycle owner started it and it is running and not stopping, else nil
func StartHostedRoomService ¶
func StartHostedRoomService() (HostedRoomService, error)
Starts one process owned hosted room service idempotently, nil without a bound server
type LiveSession ¶
One live session id with its record
func LiveSessions ¶
func LiveSessions() []LiveSession
Live sessions in registration order, snapshotted under the registry lock
type RequestParamsError ¶
type RequestParamsError struct{ Problem string }
Params of a server request that its contract rejects, the ValueError of the sender
func (*RequestParamsError) Error ¶
func (e *RequestParamsError) Error() string
type ServerRequest ¶
type ServerRequest struct {
ID string
SID string
Method string
Params *pyjson.Object
// contains filtered or unexported fields
}
One question the backend asked the renderer, open until a response, a cancel or its deadline settles it
func (*ServerRequest) Frame ¶
func (r *ServerRequest) Frame() *pyjson.Object
JSON RPC request frame as sent to the client
func (*ServerRequest) Snapshot ¶
func (r *ServerRequest) Snapshot() *pyjson.Object
Open request entry for a reconnecting client, with the batch answers locked so far
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Live session record, a dict of named slots that readers and writers on any goroutine share
func NewSession ¶
Record holding a copy of the given slots
func PopSessionRecord ¶
Removes and returns the live record of sid in one registry critical section, nil when absent
func SessionRecord ¶
Record of a live session by id, nil when the process holds none
func SessionRecordByIDOrKey ¶
Record under the id, else the first registered record whose session key equals it, under one registry lock
func SteerAuthoritySession ¶
Live record under sid the transport is attached to, nil when absent, replaced by another record or detached
func (*Session) SetDefault ¶
Value of a slot, storing the default first when the record lacks it
type SessionEntry ¶
One live session with its id, the registry entry a transport detach returns
func DetachTransportFromSessions ¶
func DetachTransportFromSessions(transport Transport) []SessionEntry
Detaches a transport from every session holding it, returning the sessions left with no live client
type SkinSignature ¶
Active skin name and its user file mtime, nil mtime for a built in skin
func SkinSig ¶
func SkinSig(ctx context.Context) SkinSignature
Active skin signature of the context profile
type StdioTransport ¶
type StdioTransport struct {
// contains filtered or unexported fields
}
Writes JSON frames as lines to a stream resolved on every write
func NewStdioTransport ¶
func NewStdioTransport(streamGetter func() io.Writer, lock *sync.Mutex) *StdioTransport
func (*StdioTransport) Close ¶
func (t *StdioTransport) Close()
type Transport ¶
Peer a JSON RPC frame is forwarded to, Write false once the peer is gone
func CurrentTransport ¶
Transport bound to the request context, nil when none is bound
func DetachedWSTransport ¶
func DetachedWSTransport() Transport
Parked sink a disconnected WebSocket session holds until it is resumed or reaped
func LiveTransports ¶
func LiveTransports() []Transport
Transports of every connected peer a session less broadcast reaches, in registration order
func ModuleStdioTransport ¶
func ModuleStdioTransport() Transport
Module stdio transport, the sink of a request no transport was bound for
func SessionViewersByAge ¶
Viewer transports of a session from the oldest registration to the most recent
type TurnSegments ¶
type TurnSegments struct {
TurnID string
Segment int
Offset int
// contains filtered or unexported fields
}
Segment cursor of one turn, created at message start and advanced by every delta and seal
func NewTurnSegments ¶
func NewTurnSegments() *TurnSegments
func (*TurnSegments) Delta ¶
func (s *TurnSegments) Delta(text any) map[string]any
Identity fields of one delta, the offset then advanced past a text
func (*TurnSegments) Seal ¶
func (s *TurnSegments) Seal() map[string]any
Identity fields of the interim that seals the current segment, the cursor then moved to the next one
func (*TurnSegments) Start ¶
func (s *TurnSegments) Start() map[string]any
Identity fields of the turn start frame
type UnknownQuestionError ¶
type UnknownQuestionError struct{ QuestionID string }
Question id a batch does not hold, the ValueError of a lock on it
func (*UnknownQuestionError) Error ¶
func (e *UnknownQuestionError) Error() string
type WSConn ¶
Socket of one WebSocket peer, SendText returning once the frame is handed to the connection
type WSTransport ¶
type WSTransport struct {
// Served profile home whose skin this peer follows, nil for the launch home
SkinHome *string
// contains filtered or unexported fields
}
Per connection WebSocket transport, safe to write from any goroutine with batches kept in wire order
func NewWSTransport ¶
func NewWSTransport(ws WSConn, peer string, authIdentity map[string]any) *WSTransport
Transport over a socket, peer naming it in logs and authIdentity carrying the verified login
func (*WSTransport) Abort ¶
func (t *WSTransport) Abort()
Closes from any goroutine and drops the socket with 1011 once so the client reconnects and replays
func (*WSTransport) AuthIdentity ¶
func (t *WSTransport) AuthIdentity() map[string]any
Server verified identity of the upgrade credential, the sole authority for who this peer acts as
func (*WSTransport) Close ¶
func (t *WSTransport) Close()
Latches closed and cancels the pending token flush
func (*WSTransport) Closed ¶
func (t *WSTransport) Closed() bool
Whether the transport latched closed
func (*WSTransport) Conn ¶
func (t *WSTransport) Conn() WSConn
Socket under the transport, what a viewer the peer opens records its admission against
func (*WSTransport) WS ¶
func (t *WSTransport) WS() WSConn
Socket this transport writes to, what sign out tracks a browser tab by
func (*WSTransport) Write ¶
func (t *WSTransport) Write(obj *pyjson.Object) bool
Buffers a streamed token or sends the frame behind every buffered token, waiting a bounded time for the wire
func (*WSTransport) WriteAsync ¶
func (t *WSTransport) WriteAsync(obj *pyjson.Object) bool
Sends buffered tokens and the frame as one batch and returns once it is on the wire
func (*WSTransport) WriteManyAsync ¶
func (t *WSTransport) WriteManyAsync(frames []*pyjson.Object) bool
Sends buffered tokens then the frames in order as one batch and returns once it is on the wire
func (*WSTransport) WriteManyIfCurrentAsync ¶
func (t *WSTransport) WriteManyIfCurrentAsync(frames []*pyjson.Object, isCurrent func() bool) bool
Sends a batch whose own frames stop once isCurrent turns false, tokens of other producers going out regardless
Source Files
¶
- auto_continue_export.go
- connector_payload.go
- connector_refusals.go
- display_preferences.go
- event_replay.go
- files_fs.go
- focus_view_format.go
- git_probe.go
- global_events.go
- global_events_export.go
- history_commentary.go
- live_sessions.go
- methods_groups_service.go
- notification_park.go
- notification_transport_export.go
- profile_roster_cache.go
- render_bridge.go
- room_member_activity.go
- server_cfg.go
- server_emit.go
- server_requests.go
- server_tool_ctx.go
- session_auth_export.go
- session_authority_export.go
- session_history.go
- session_history_display.go
- session_lifecycle_claim.go
- session_lifecycle_claim_refusal.go
- session_lookup_hosted.go
- session_membership_export.go
- session_reaper.go
- session_record.go
- session_transport_export.go
- session_transports.go
- settle_batch_export.go
- skin_broadcast.go
- skin_watch.go
- stdin_recovery.go
- stdin_recovery_unix.go
- stdio_entry.go
- stdio_sink.go
- stdio_transport.go
- stdio_transport_unix.go
- stdout_capture_export.go
- stream_segments.go
- tool_output_risk.go
- tool_progress_export.go
- tool_progress_subagent_payload.go
- tool_progress_todo_state.go
- tool_progress_verbose.go
- transport.go
- turn_marker.go
- ws_transport.go
- ws_transport_conn.go