Documentation
¶
Index ¶
- Constants
- func DecodePayload(m Envelope, target any) error
- func EncodeControl(msgType string, payload any) ([]byte, error)
- func EncodeControlWithToken(msgType string, payload any, token string) ([]byte, error)
- func VersionCompatible(v string) bool
- type ApprovalDecisionMsg
- type ApprovalInfo
- type ApprovalNotificationMsg
- type ApprovalRequestMsg
- type ApprovalRespondMsg
- type AttachMsg
- type CIInfo
- type ConversationMessage
- type CreateMsg
- type DeleteMsg
- type DetachedMsg
- type DiagnosticsMsg
- type Envelope
- type ErrorMsg
- type FleetSummary
- type ForkMsg
- type Frame
- type FrameReader
- type FrameWriter
- type HandshakeErrMsg
- type HandshakeMsg
- type HandshakeOkMsg
- type IncludedRepoInfo
- type LogsMsg
- type MCPConnectMsg
- type MCPConnectOkMsg
- type MessagesDiagnostic
- type MigrateMsg
- type MsgAckMsg
- type MsgConversationListMsg
- type MsgConversationMsg
- type MsgInboxMsg
- type MsgPubMsg
- type MsgSubMsg
- type MsgTopicsMsg
- type PRInfo
- type RenameMsg
- type ResizeMsg
- type RestartMsg
- type ResumeMsg
- type ScenarioAddMsg
- type ScenarioDeleteMsg
- type ScenarioListMsg
- type ScenarioListResponse
- type ScenarioRecord
- type ScenarioResumeMsg
- type ScenarioSessionInfo
- type ScenarioSessionInput
- type ScenarioStartMsg
- type ScenarioStatusMsg
- type ScenarioStatusResponse
- type ScenarioStopMsg
- type ScenarioTaskDoneMsg
- type ScreenPreviewMsg
- type ScreenPreviewResponseMsg
- type ScreenSnapshotMsg
- type ScreenSnapshotResponseMsg
- type ScrollbackDiagnostic
- type SessionDiagnostic
- type SessionInfo
- type SessionListMsg
- type SetStatusMsg
- type StarMsg
- type StatusReportMsg
- type StatusRequestMsg
- type StatusResponseMsg
- type StatusSetMsg
- type StopMsg
- type TypeMsg
- type UnstarMsg
- type UpdateMsg
- type UpgradeMsg
Constants ¶
const ( ChannelControl = byte(0x00) ChannelData = byte(0x01) ChannelMCP = byte(0x02) MaxPayload = 4 * 1024 * 1024 )
const Version = "1.0"
Variables ¶
This section is empty.
Functions ¶
func DecodePayload ¶
func EncodeControlWithToken ¶ added in v0.52.0
func VersionCompatible ¶ added in v0.47.0
Types ¶
type ApprovalDecisionMsg ¶ added in v0.13.0
type ApprovalInfo ¶ added in v0.13.0
type ApprovalInfo struct {
RequestID string `json:"request_id"`
SessionID string `json:"session_id"`
SessionName string `json:"session_name"`
ToolName string `json:"tool_name"`
ToolInput string `json:"tool_input,omitempty"`
Agent string `json:"agent"`
RepoName string `json:"repo_name"`
RequestedAt string `json:"requested_at"`
}
type ApprovalNotificationMsg ¶ added in v0.13.0
type ApprovalNotificationMsg struct {
Pending []ApprovalInfo `json:"pending"`
}
type ApprovalRequestMsg ¶ added in v0.13.0
type ApprovalRequestMsg struct {
RequestID string `json:"request_id"`
SessionID string `json:"session_id"`
ToolName string `json:"tool_name"`
ToolInput string `json:"tool_input,omitempty"`
}
ApprovalRequestMsg is sent by the hook CLI (gr approve-request) to the daemon. The handler blocks until a decision is made.
type ApprovalRespondMsg ¶ added in v0.13.0
type CIInfo ¶ added in v0.59.0
type CIInfo struct {
State string `json:"state"` // passing | failing | pending
FailingChecks []string `json:"failing_checks,omitempty"`
}
CIInfo is the aggregate CI status for a session's linked PR.
type ConversationMessage ¶ added in v0.59.0
type ConversationMessage struct {
ID string `json:"id"`
Seq int64 `json:"seq"`
Stream string `json:"stream"`
SenderID string `json:"sender_id"`
SenderName string `json:"sender_name,omitempty"`
Body string `json:"body"`
ThreadID string `json:"thread_id,omitempty"`
ReplyTo string `json:"reply_to,omitempty"`
CreatedAt string `json:"created_at"`
}
ConversationMessage is a single message in a conversation, mirroring the daemon's stored message shape on the wire.
type CreateMsg ¶
type CreateMsg struct {
Name string `json:"name"`
ParentID string `json:"parent_id,omitempty"`
Agent string `json:"agent"`
RepoPath string `json:"repo_path"`
Base string `json:"base,omitempty"`
Prompt string `json:"prompt,omitempty"`
Model string `json:"model,omitempty"`
NoRepo bool `json:"no_repo,omitempty"`
AgentHooks bool `json:"agent_hooks,omitempty"`
InPlace bool `json:"in_place,omitempty"`
AllowConcurrent bool `json:"allow_concurrent,omitempty"`
SkipModelValidation bool `json:"skip_model_validation,omitempty"`
}
type DetachedMsg ¶
type DetachedMsg struct {
Reason string `json:"reason"`
}
type DiagnosticsMsg ¶ added in v0.28.0
type DiagnosticsMsg struct {
DaemonPID int `json:"daemon_pid"`
DaemonUptime string `json:"daemon_uptime"`
Fleet FleetSummary `json:"fleet"`
Sessions []SessionDiagnostic `json:"sessions"`
Scrollback ScrollbackDiagnostic `json:"scrollback"`
Messages MessagesDiagnostic `json:"messages"`
}
type Envelope ¶
type Envelope struct {
Type string `json:"type"`
Payload json.RawMessage `json:"payload,omitempty"`
Token string `json:"token,omitempty"`
}
func DecodeControl ¶
type FleetSummary ¶ added in v0.7.0
type FrameReader ¶
type FrameReader struct {
// contains filtered or unexported fields
}
func NewFrameReader ¶
func NewFrameReader(r io.Reader) *FrameReader
func (*FrameReader) ReadFrame ¶
func (fr *FrameReader) ReadFrame() (Frame, error)
type FrameWriter ¶
type FrameWriter struct {
// contains filtered or unexported fields
}
func NewFrameWriter ¶
func NewFrameWriter(w io.Writer) *FrameWriter
func (*FrameWriter) WriteFrame ¶
func (fw *FrameWriter) WriteFrame(channel byte, payload []byte) error
type HandshakeErrMsg ¶
type HandshakeErrMsg struct {
Reason string `json:"reason"`
}
type HandshakeMsg ¶
type HandshakeMsg struct {
Version string `json:"version"`
ClientID string `json:"client_id"`
TerminalSize [2]uint16 `json:"terminal_size"`
Cwd string `json:"cwd"`
Profile string `json:"profile,omitempty"`
}
Client -> Daemon
type HandshakeOkMsg ¶
type HandshakeOkMsg struct {
Version string `json:"version"`
DaemonVersion string `json:"daemon_version"`
}
Daemon -> Client
type IncludedRepoInfo ¶ added in v0.19.0
type MCPConnectMsg ¶ added in v0.23.0
type MCPConnectOkMsg ¶ added in v0.23.0
type MessagesDiagnostic ¶ added in v0.28.0
type MigrateMsg ¶ added in v0.58.0
type MsgConversationListMsg ¶ added in v0.59.0
type MsgConversationListMsg struct {
Messages []ConversationMessage `json:"messages"`
}
MsgConversationListMsg is the daemon's response to msg_conversation.
type MsgConversationMsg ¶ added in v0.59.0
type MsgConversationMsg struct {
SessionID string `json:"session_id"`
Limit int `json:"limit,omitempty"`
}
MsgConversationMsg requests the full direct-message conversation (both directions) for SessionID. Authorisation uses the self-or-descendant rule, so a human CLI, the session itself, an ancestor, or the orchestrator may read it.
type MsgInboxMsg ¶ added in v0.54.0
type MsgTopicsMsg ¶
type PRInfo ¶ added in v0.59.0
type PRInfo struct {
Number int `json:"number"`
State string `json:"state"` // open | draft | merged | closed
URL string `json:"url,omitempty"`
ReviewDecision string `json:"review_decision,omitempty"` // approved | changes_requested | review_required
}
PRInfo is the linked GitHub pull request for a session's branch.
type RestartMsg ¶ added in v0.26.0
type ScenarioAddMsg ¶ added in v0.52.0
type ScenarioAddMsg struct {
Name string `json:"name"`
Session ScenarioSessionInput `json:"session"`
}
type ScenarioDeleteMsg ¶ added in v0.52.0
type ScenarioDeleteMsg struct {
Name string `json:"name"`
}
type ScenarioListMsg ¶ added in v0.52.0
type ScenarioListMsg struct{}
type ScenarioListResponse ¶ added in v0.52.0
type ScenarioListResponse struct {
Scenarios []ScenarioRecord `json:"scenarios"`
}
type ScenarioRecord ¶ added in v0.52.0
type ScenarioRecord struct {
ID string `json:"id"`
Name string `json:"name"`
OrchestratorID string `json:"orchestrator_id"`
Goal string `json:"goal"`
Status string `json:"status"`
SessionIDs []string `json:"session_ids"`
Sessions []ScenarioSessionInfo `json:"sessions"`
CreatedAt string `json:"created_at"`
}
type ScenarioResumeMsg ¶ added in v0.52.0
type ScenarioResumeMsg struct {
Name string `json:"name"`
}
type ScenarioSessionInfo ¶ added in v0.52.0
type ScenarioSessionInfo struct {
Name string `json:"name"`
SessionID string `json:"session_id"`
Role string `json:"role,omitempty"`
Task string `json:"task,omitempty"`
TaskDone bool `json:"task_done,omitempty"`
Repo string `json:"repo,omitempty"`
Agent string `json:"agent,omitempty"`
Model string `json:"model,omitempty"`
Status string `json:"status,omitempty"`
}
type ScenarioSessionInput ¶ added in v0.52.0
type ScenarioSessionInput struct {
Name string `json:"name"`
Repo string `json:"repo"`
Agent string `json:"agent,omitempty"`
Model string `json:"model,omitempty"`
Base string `json:"base,omitempty"`
Role string `json:"role,omitempty"`
Task string `json:"task,omitempty"`
AgentHooks bool `json:"agent_hooks,omitempty"`
}
type ScenarioStartMsg ¶ added in v0.52.0
type ScenarioStartMsg struct {
CallerSessionID string `json:"caller_session_id"`
Name string `json:"name"`
Goal string `json:"goal"`
Sessions []ScenarioSessionInput `json:"sessions"`
}
type ScenarioStatusMsg ¶ added in v0.52.0
type ScenarioStatusMsg struct {
Name string `json:"name"`
}
type ScenarioStatusResponse ¶ added in v0.52.0
type ScenarioStatusResponse struct {
Scenario ScenarioRecord `json:"scenario"`
}
type ScenarioStopMsg ¶ added in v0.52.0
type ScenarioStopMsg struct {
Name string `json:"name"`
}
type ScenarioTaskDoneMsg ¶ added in v0.52.0
type ScenarioTaskDoneMsg struct {
Name string `json:"name"`
}
type ScreenPreviewMsg ¶ added in v0.2.0
type ScreenPreviewMsg struct {
SessionID string `json:"session_id"`
}
type ScreenPreviewResponseMsg ¶ added in v0.2.0
type ScreenSnapshotMsg ¶ added in v0.2.0
type ScreenSnapshotMsg struct {
SessionID string `json:"session_id"`
}
type ScreenSnapshotResponseMsg ¶ added in v0.2.0
type ScrollbackDiagnostic ¶ added in v0.28.0
type SessionDiagnostic ¶ added in v0.28.0
type SessionDiagnostic struct {
ID string `json:"id"`
Name string `json:"name"`
Status string `json:"status"`
AgentStatus string `json:"agent_status,omitempty"`
PID int `json:"pid,omitempty"`
PIDAlive bool `json:"pid_alive"`
HasPTY *bool `json:"has_pty,omitempty"`
WorktreePath string `json:"worktree_path,omitempty"`
WorktreeExists bool `json:"worktree_exists"`
ConfigStale bool `json:"config_stale"`
HookStale bool `json:"hook_stale"`
ScrollbackBytes int64 `json:"scrollback_bytes"`
ScrollbackMax int64 `json:"scrollback_max"`
Saturated bool `json:"saturated"`
HasToken bool `json:"has_token"`
}
type SessionInfo ¶
type SessionInfo struct {
ID string `json:"id"`
ParentID string `json:"parent_id,omitempty"`
Name string `json:"name"`
RepoPath string `json:"repo_path"`
RepoName string `json:"repo_name"`
WorktreePath string `json:"worktree_path"`
Branch string `json:"branch"`
BaseBranch string `json:"base_branch"`
Agent string `json:"agent"`
AgentSessionID string `json:"agent_session_id,omitempty"`
Status string `json:"status"`
AgentStatus string `json:"agent_status,omitempty"`
ExitCode *int `json:"exit_code,omitempty"`
ExitSignal string `json:"exit_signal,omitempty"`
CreatedAt string `json:"created_at"`
LastAttachedAt string `json:"last_attached_at,omitempty"`
StatusChangedAt string `json:"status_changed_at,omitempty"`
Dirty bool `json:"dirty,omitempty"`
UnpushedCount int `json:"unpushed_count,omitempty"`
Sandboxed bool `json:"sandboxed,omitempty"`
InPlace bool `json:"in_place,omitempty"`
Model string `json:"model,omitempty"`
ToolName string `json:"tool_name,omitempty"`
Includes []IncludedRepoInfo `json:"includes,omitempty"`
ConfigStale bool `json:"config_stale,omitempty"`
Starred bool `json:"starred,omitempty"`
SystemKind string `json:"system_kind,omitempty"`
ScenarioID string `json:"scenario_id,omitempty"`
ScenarioName string `json:"scenario_name,omitempty"`
SummaryText string `json:"summary_text,omitempty"`
SummaryFaded bool `json:"summary_faded,omitempty"`
LastOutputAt string `json:"last_output_at,omitempty"`
MigratedFrom string `json:"migrated_from,omitempty"`
PullRequest *PRInfo `json:"pull_request,omitempty"`
CI *CIInfo `json:"ci,omitempty"`
}
type SessionListMsg ¶
type SessionListMsg struct {
Sessions []SessionInfo `json:"sessions"`
}
type SetStatusMsg ¶ added in v0.32.0
type StatusReportMsg ¶ added in v0.11.0
type StatusReportMsg struct {
SessionID string `json:"session_id"`
Event string `json:"event"`
Status string `json:"status,omitempty"`
ToolName string `json:"tool_name,omitempty"`
}
Client -> Daemon (hook reporting)
type StatusRequestMsg ¶ added in v0.3.0
type StatusRequestMsg struct {
SessionID string `json:"session_id"`
}
type StatusResponseMsg ¶ added in v0.3.0
type StatusResponseMsg struct {
Session SessionInfo `json:"session"`
UnreadCount int `json:"unread_count"`
Fleet FleetSummary `json:"fleet"`
}
type StatusSetMsg ¶ added in v0.32.0
type StatusSetMsg struct {
SessionID string `json:"session_id"`
}