Documentation
¶
Overview ¶
Package controlsocket transports the wing control contract over owner-only local IPC.
Index ¶
- Constants
- func DialAttachment(ctx context.Context, dir string, hello Hello) (*SessionStream, Welcome, error)
- func DialAttachmentPath(ctx context.Context, path string, hello Hello) (*SessionStream, Welcome, error)
- func Path(dir string) (string, error)
- type AdmissionError
- type AttachBind
- type AttachHandler
- type Attachment
- type Bind
- type Client
- type Handler
- type Hello
- type Server
- type SessionStream
- type TransportError
- type Welcome
Constants ¶
const NativeTerminalCapability = "native-terminal-v1"
const SocketName = "control.sock"
Variables ¶
This section is empty.
Functions ¶
func DialAttachment ¶
func DialAttachmentPath ¶
Types ¶
type AdmissionError ¶ added in v0.149.4
type AdmissionError struct {
Err error
Diagnostic *control.LaunchDiagnostic
}
AdmissionError distinguishes an authoritative hello refusal from a failed connection while preserving the legacy text for non-launch callers.
func (*AdmissionError) Error ¶ added in v0.149.4
func (e *AdmissionError) Error() string
func (*AdmissionError) LaunchDiagnostic ¶ added in v0.149.4
func (e *AdmissionError) LaunchDiagnostic() control.LaunchDiagnostic
func (*AdmissionError) Unwrap ¶ added in v0.149.4
func (e *AdmissionError) Unwrap() error
type AttachBind ¶
type AttachHandler ¶
type AttachHandler func(context.Context, *SessionStream) error
type Attachment ¶
type Attachment struct {
NativeTerminal bool `json:"native_terminal,omitempty"`
Session string `json:"session"`
ReadOnly bool `json:"read_only,omitempty"`
Takeover bool `json:"takeover,omitempty"`
Rows uint32 `json:"rows,omitempty"`
Cols uint32 `json:"cols,omitempty"`
}
Attachment upgrades an authenticated wing connection to an ordered terminal stream. No egg socket, attachment token or host authority crosses this API.
type Client ¶
type Client struct {
Welcome Welcome
// contains filtered or unexported fields
}
func DialPath ¶
DialPath connects to a verified SSH stream-local forward as well as local IPC. The forwarding process must belong to this UID; Hello pins the remote wing.
type Handler ¶
type Handler func(context.Context, control.DirectRequest) control.DirectResponse
type Hello ¶
type Hello struct {
Version string `json:"version"`
WingID string `json:"wing_id,omitempty"`
Client string `json:"client,omitempty"`
Unsandboxed bool `json:"unsandboxed,omitempty"`
Conversation string `json:"conversation,omitempty"`
Execution string `json:"execution,omitempty"`
Aggregate bool `json:"aggregate,omitempty"`
Attach *Attachment `json:"attach,omitempty"`
// Scope requests a narrower ceiling from an authenticated receiving wing.
// It never supplies identity or grants greater authority than the peer UID.
Scope string `json:"scope,omitempty"`
}
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func Listen ¶
func Listen(ctx context.Context, dir, wingID string, bind Bind, attachments ...AttachBind) (*Server, error)
Listen never starts a wing. Only the wing calls it, before connecting to its relay.
type SessionStream ¶
type SessionStream struct {
// contains filtered or unexported fields
}
func (*SessionStream) Close ¶
func (s *SessionStream) Close() error
func (*SessionStream) Recv ¶
func (s *SessionStream) Recv() (*pb.SessionMsg, error)
func (*SessionStream) Send ¶
func (s *SessionStream) Send(msg *pb.SessionMsg) error
type TransportError ¶
type TransportError struct{ Err error }
TransportError distinguishes unknown delivery from authoritative tool errors.
func (*TransportError) Error ¶
func (e *TransportError) Error() string
func (*TransportError) Unwrap ¶
func (e *TransportError) Unwrap() error
type Welcome ¶
type Welcome struct {
LaunchDiagnostic *control.LaunchDiagnostic `json:"launch_diagnostic,omitempty"`
Capabilities []string `json:"capabilities,omitempty"`
Isolation string `json:"isolation,omitempty"`
RemoteAllowed bool `json:"remote_allowed,omitempty"`
Version string `json:"version"`
WingID string `json:"wing_id"`
Principal string `json:"principal,omitempty"`
Actor string `json:"actor,omitempty"`
Grants map[string]bool `json:"grants"`
Tools map[string]bool `json:"tools,omitempty"`
Error string `json:"error,omitempty"`
}