Documentation
¶
Index ¶
- type Client
- func (c *Client) AnswerPermission(runtimeID, requestID, optionID string) error
- func (c *Client) AnswerPermissionWithMessage(runtimeID, requestID, optionID, message 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) Identity() (string, error)
- 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) Result(runtimeID string) (map[string]any, 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
- func (c *Client) WorkflowCommand(workflowID string, command json.RawMessage) (map[string]any, error)
- func (c *Client) WorkflowComplete(workflowID string, fields map[string]any) (map[string]any, error)
- func (c *Client) WorkflowCreate(template json.RawMessage) (map[string]any, error)
- func (c *Client) WorkflowEvents(workflowID string, afterSeq int64, limit int) (map[string]any, error)
- func (c *Client) WorkflowGate(workflowID string, fields map[string]any) (map[string]any, error)
- func (c *Client) WorkflowInspect(workflowID string) (map[string]any, error)
- func (c *Client) WorkflowInstantiate(templateID, templateVersion string, metadata map[string]any) (map[string]any, error)
- func (c *Client) WorkflowSkip(workflowID string, fields map[string]any) (map[string]any, error)
- func (c *Client) WorkflowStatus(workflowID string) (map[string]any, error)
- func (c *Client) WorkflowUnblock(workflowID string, fields map[string]any) (map[string]any, error)
- func (c *Client) WorkflowWait(workflowID string, timeout time.Duration) (map[string]any, error)
- 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) AnswerPermissionWithMessage ¶ added in v0.23.0
AnswerPermissionWithMessage answers a pending permission request with an optional write-in message. Only non-empty messages are included in the JSON payload, preserving backward compatibility.
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) Identity ¶ added in v0.21.5
Identity returns the per-process control-server token, when configured. It is used internally to distinguish a newly spawned supervisor from a replacement that reused its socket path.
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) Result ¶ added in v0.21.1
Result returns the complete terminal reply. Unlike Status, this explicit retrieval path is not bounded for lifecycle presentation.
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.
func (*Client) WorkflowCommand ¶ added in v0.28.0
func (c *Client) WorkflowCommand(workflowID string, command json.RawMessage) (map[string]any, error)
WorkflowCommand sends a raw command payload to a workflow instance.
func (*Client) WorkflowComplete ¶ added in v0.28.0
WorkflowComplete atomically completes a machine/external handoff activation (op "complete").
func (*Client) WorkflowCreate ¶ added in v0.28.0
WorkflowCreate stores a workflow template given as raw template JSON.
func (*Client) WorkflowEvents ¶ added in v0.28.0
func (c *Client) WorkflowEvents(workflowID string, afterSeq int64, limit int) (map[string]any, error)
WorkflowEvents returns log events with Sequence > afterSeq, capped at limit.
func (*Client) WorkflowGate ¶ added in v0.28.0
WorkflowGate records a gate decision on a parked awaiting_gate activation (op "gate"); fields carry node_id, activation_id, gate_id, operation, and the operation's required fields (actor/reason/evidence for human ops, the external result envelope for external_result).
func (*Client) WorkflowInspect ¶ added in v0.28.0
WorkflowInspect returns the full instance detail for a workflow.
func (*Client) WorkflowInstantiate ¶ added in v0.28.0
func (c *Client) WorkflowInstantiate(templateID, templateVersion string, metadata map[string]any) (map[string]any, error)
WorkflowInstantiate creates a workflow instance from a stored template.
func (*Client) WorkflowSkip ¶ added in v0.28.0
WorkflowSkip waives every unsatisfied required gate on a parked awaiting_gate activation (op "skip"); fields carry node_id, actor, reason, evidence_ids, and optionally activation_id.
func (*Client) WorkflowStatus ¶ added in v0.28.0
WorkflowStatus returns the lightweight status for a workflow instance.
func (*Client) WorkflowUnblock ¶ added in v0.28.0
WorkflowUnblock returns a blocked activation to ready (op "unblock"); fields carry node_id, actor, reason, and optionally activation_id.
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"`
}