ipc

package
v0.199.1 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const UserMessageRequestID = "stdin"

UserMessageRequestID tags queue entries that came from a UserMessage so the renderer can tell them apart from background-job result notes.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentErrorMessage

type AgentErrorMessage struct {
	Type    string `json:"type"` // "agent_error"
	Message string `json:"message"`
}

AgentErrorMessage is emitted by the agent on stdout when a fatal error occurs before exiting. The channel manager forwards this to the user-facing channel so users aren't left waiting in silence when the agent process fails.

type ApprovalRequest

type ApprovalRequest struct {
	Type       string `json:"type"` // "approval_request"
	ToolName   string `json:"tool_name"`
	ToolArgs   string `json:"tool_args"`
	ToolCallID string `json:"tool_call_id"`
}

ApprovalRequest is emitted by the agent on stdout when a tool needs user approval. The channel manager detects this JSON line, prompts the user, and writes an ApprovalResponse to stdin.

type ApprovalResponse

type ApprovalResponse struct {
	Type       string `json:"type"` // "approval_response"
	ToolCallID string `json:"tool_call_id"`
	Approved   bool   `json:"approved"`
	Scope      string `json:"scope,omitempty"`
}

ApprovalResponse is written to the agent's stdin by the channel manager after user decision.

type ComputerUseControlMessage

type ComputerUseControlMessage struct {
	Type   string `json:"type"`   // "computer_use_control"
	Action string `json:"action"` // "pause" or "resume"
}

ComputerUseControlMessage is written to the agent's stdin by a host UI to pause or resume computer-use execution. Follows the same IPC pattern as ApprovalResponse.

type UserMessage added in v0.199.0

type UserMessage struct {
	Type    string `json:"type"` // "user_message"
	Content string `json:"content"`
}

UserMessage is a follow-up prompt a host UI writes to the agent's stdin while a headless run is still alive (typically while it waits on background tasks). It lands on the shared message queue and is drained as the next turn.

type UserQuestionRequest added in v0.191.0

type UserQuestionRequest struct {
	Type       string          `json:"type"` // "user_question_request"
	ToolCallID string          `json:"tool_call_id"`
	Questions  json.RawMessage `json:"questions"`
}

UserQuestionRequest is emitted on stdout when the AskUserQuestion tool asks the user to pick from a small form. Questions carries the tool's own []agentdomain.UserQuestion, kept as raw JSON so ipc stays dependency-free.

type UserQuestionResponse added in v0.191.0

type UserQuestionResponse struct {
	Type       string          `json:"type"` // "user_question_response"
	ToolCallID string          `json:"tool_call_id"`
	Answers    json.RawMessage `json:"answers,omitempty"`
	Cancelled  bool            `json:"cancelled,omitempty"`
}

UserQuestionResponse is written to the agent's stdin by the host UI after the user submits or dismisses the form. Answers is the host's []agentdomain.UserQuestionAnswer; Cancelled reports a dismissal.

Jump to

Keyboard shortcuts

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