client

package
v0.9.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func Dial

func Dial(socketPath string) (*Client, error)

func (*Client) AnswerPermission

func (c *Client) AnswerPermission(runtimeID, requestID, optionID string) error

AnswerPermission answers a pending permission request.

func (*Client) Call

func (c *Client) Call(method string, params any, result any) error

func (*Client) Cancel

func (c *Client) Cancel(runtimeID string) error

Cancel cancels the one-shot run or a specific runtime if runtimeID is set.

func (*Client) Close

func (c *Client) Close() error

func (*Client) Events

func (c *Client) Events() <-chan Event

Events returns a channel of server-sent events. Only one subscriber is supported. Call before any Call() to avoid missing events.

func (*Client) InterruptAndPrompt

func (c *Client) InterruptAndPrompt(runtimeID, text string, keepQueue bool) error

InterruptAndPrompt cancels the current turn and starts a new prompt.

func (*Client) List

func (c *Client) List() ([]map[string]any, error)

List returns all active runtimes from the stable supervisor.

func (*Client) Prompt

func (c *Client) Prompt(runtimeID, text string) error

Prompt sends a follow-up prompt to the one-shot session or a runtime.

func (*Client) Shutdown

func (c *Client) Shutdown(mode string) error

Shutdown shuts down the stable supervisor.

func (*Client) Spawn

func (c *Client) Spawn(params map[string]any) (map[string]any, error)

Spawn creates a new runtime in the stable supervisor.

func (*Client) Status

func (c *Client) Status(runtimeID string) (map[string]any, error)

Status returns the snapshot for the one-shot run or a runtime if runtimeID is set.

type Event

type Event struct {
	Event     string         `json:"event"`
	SessionID string         `json:"session_id,omitempty"`
	RuntimeID string         `json:"runtime_id,omitempty"`
	Raw       map[string]any `json:"-"`
}

func (*Event) UnmarshalJSON

func (e *Event) UnmarshalJSON(data []byte) error

type Notification

type Notification struct {
	JSONRPC string          `json:"jsonrpc"`
	Method  string          `json:"method"`
	Params  json.RawMessage `json:"params,omitempty"`
}

type Request

type Request struct {
	JSONRPC string          `json:"jsonrpc"`
	ID      any             `json:"id,omitempty"`
	Method  string          `json:"method"`
	Params  json.RawMessage `json:"params,omitempty"`
}

type RespError

type RespError struct {
	Code    int             `json:"code"`
	Message string          `json:"message"`
	Data    json.RawMessage `json:"data,omitempty"`
}

type Response

type Response struct {
	JSONRPC string          `json:"jsonrpc"`
	ID      any             `json:"id"`
	Result  json.RawMessage `json:"result,omitempty"`
	Error   *RespError      `json:"error,omitempty"`
}

Jump to

Keyboard shortcuts

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