sidecar

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadMessage

func ReadMessage(conn net.Conn, v any) error

func WriteMessage

func WriteMessage(conn net.Conn, v any) error

Types

type EvaluateRequest

type EvaluateRequest struct {
	Type           string          `json:"type"`
	Agent          string          `json:"agent"`
	HookEvent      string          `json:"hook_event"`
	ToolName       string          `json:"tool_name"`
	ToolInput      json.RawMessage `json:"tool_input,omitempty"`
	ToolResponse   json.RawMessage `json:"tool_response,omitempty"`
	ToolUseID      string          `json:"tool_use_id"`
	CWD            string          `json:"cwd"`
	PermissionMode string          `json:"permission_mode,omitempty"`
	DurationMs     *int64          `json:"duration_ms,omitempty"`
	Error          string          `json:"error,omitempty"`
	IsInterrupt    *bool           `json:"is_interrupt,omitempty"`
}

type EvaluateResult

type EvaluateResult struct {
	Type         string               `json:"type"`
	Decision     hookruntime.Decision `json:"decision,omitempty"`
	Allowed      bool                 `json:"allowed"`
	Reason       string               `json:"reason"`
	ReasonCode   string               `json:"reason_code,omitempty"`
	RequestID    string               `json:"request_id,omitempty"`
	Mode         string               `json:"mode,omitempty"`
	Epoch        string               `json:"epoch,omitempty"`
	UpdatedInput map[string]any       `json:"updated_input,omitempty"`
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

func New

func New(sessionDir string, client sidecarClient, sessionID, agentName string, accessMode backend.HostedAccessMode, diagnostics diagnostic.Logger) (*Server, error)

New creates a new sidecar server.

func (*Server) AccessModePath added in v0.6.0

func (s *Server) AccessModePath() string

func (*Server) SocketPath

func (s *Server) SocketPath() string

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

func (*Server) Stop

func (s *Server) Stop()

Jump to

Keyboard shortcuts

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