Documentation
¶
Index ¶
- type Client
- func (c *Client) AnswerPermission(runtimeID, requestID, optionID string) error
- func (c *Client) Call(method string, params any, result any) error
- func (c *Client) Cancel(runtimeID string) error
- func (c *Client) Close() error
- func (c *Client) Events() <-chan Event
- func (c *Client) InterruptAndPrompt(runtimeID, text string, keepQueue bool) error
- func (c *Client) List() ([]map[string]any, error)
- func (c *Client) Prompt(runtimeID, text string) error
- func (c *Client) PromptWithRequestID(runtimeID, text, requestID string) error
- func (c *Client) SendToParent(runtimeID, message string) error
- func (c *Client) Shutdown(mode string) error
- func (c *Client) Spawn(params map[string]any) (map[string]any, error)
- func (c *Client) Status(runtimeID string) (map[string]any, error)
- func (c *Client) SubscribeRuntime(ctx context.Context, runtimeID string) <-chan Event
- type Event
- type Notification
- type Request
- type RespError
- type Response
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 (*Client) AnswerPermission ¶
AnswerPermission answers a pending permission request.
func (*Client) Events ¶
Events returns a channel of server-sent events. Only one subscriber is supported. Call before any Call() to avoid missing events.
func (*Client) InterruptAndPrompt ¶
InterruptAndPrompt cancels the current turn and starts a new prompt.
func (*Client) PromptWithRequestID ¶ added in v0.14.0
PromptWithRequestID sends a follow-up prompt with an optional child-question request ID.
func (*Client) SendToParent ¶ added in v0.14.0
SendToParent sends a message from a child runtime to its parent.
func (*Client) Status ¶
Status returns the snapshot for the one-shot run or a runtime if runtimeID is set.
func (*Client) SubscribeRuntime ¶ added in v0.14.0
SubscribeRuntime returns a channel of events filtered to a specific runtime. The caller must drain the channel. The channel closes when ctx is done or the underlying event channel is closed. Calling SubscribeRuntime ensures the readLoop is started.
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 ¶
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"`
}