Documentation
¶
Overview ¶
Package ws implements the WebSocket adapter for real-time client communication.
Index ¶
Constants ¶
const ( EventTaskStatus = "task.status" EventTaskOutput = "task.output" EventAgentStatus = "agent.status" // Run protocol events (Phase 4B) EventRunStatus = "run.status" EventToolCallStatus = "run.toolcall" // Phase 4C events EventQualityGate = "run.qualitygate" EventDelivery = "run.delivery" // Phase 5A: orchestration plan events EventPlanStatus = "plan.status" EventPlanStepStatus = "plan.step.status" // Phase 5E: team + shared context events EventTeamStatus = "team.status" )
Event type constants for WebSocket messages.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentStatusEvent ¶
type AgentStatusEvent struct {
AgentID string `json:"agent_id"`
ProjectID string `json:"project_id"`
Status string `json:"status"`
}
AgentStatusEvent is broadcast when an agent's status changes.
type DeliveryEvent ¶
type DeliveryEvent struct {
RunID string `json:"run_id"`
TaskID string `json:"task_id"`
ProjectID string `json:"project_id"`
Status string `json:"status"` // "started", "completed", "failed"
Mode string `json:"mode"`
PatchPath string `json:"patch_path,omitempty"`
CommitHash string `json:"commit_hash,omitempty"`
BranchName string `json:"branch_name,omitempty"`
PRURL string `json:"pr_url,omitempty"`
Error string `json:"error,omitempty"`
}
DeliveryEvent is broadcast when output delivery starts, completes, or fails.
type Hub ¶
type Hub struct {
// contains filtered or unexported fields
}
Hub manages all active WebSocket connections and broadcasts messages.
func (*Hub) BroadcastEvent ¶
BroadcastEvent is a convenience method that marshals a typed event and broadcasts it.
func (*Hub) ConnectionCount ¶
ConnectionCount returns the number of active connections.
type Message ¶
type Message struct {
Type string `json:"type"`
Payload json.RawMessage `json:"payload"`
}
Message is the envelope for all WebSocket messages.
type PlanStatusEvent ¶
type PlanStatusEvent struct {
PlanID string `json:"plan_id"`
ProjectID string `json:"project_id"`
Status string `json:"status"`
}
PlanStatusEvent is broadcast when an execution plan's status changes.
type PlanStepStatusEvent ¶
type PlanStepStatusEvent struct {
PlanID string `json:"plan_id"`
StepID string `json:"step_id"`
ProjectID string `json:"project_id"`
Status string `json:"status"`
RunID string `json:"run_id,omitempty"`
Error string `json:"error,omitempty"`
}
PlanStepStatusEvent is broadcast when a plan step's status changes.
type QualityGateEvent ¶
type QualityGateEvent struct {
RunID string `json:"run_id"`
TaskID string `json:"task_id"`
ProjectID string `json:"project_id"`
Status string `json:"status"` // "started", "passed", "failed"
TestsPassed *bool `json:"tests_passed,omitempty"`
LintPassed *bool `json:"lint_passed,omitempty"`
Error string `json:"error,omitempty"`
}
QualityGateEvent is broadcast when a quality gate starts, passes, or fails.
type RunStatusEvent ¶
type RunStatusEvent struct {
RunID string `json:"run_id"`
TaskID string `json:"task_id"`
ProjectID string `json:"project_id"`
Status string `json:"status"`
StepCount int `json:"step_count"`
CostUSD float64 `json:"cost_usd,omitempty"`
}
RunStatusEvent is broadcast when a run's status or metrics change.
type SharedContextUpdateEvent ¶
type SharedContextUpdateEvent struct {
}
SharedContextUpdateEvent is broadcast when a shared context item is added or updated.
type TaskOutputEvent ¶
type TaskOutputEvent struct {
TaskID string `json:"task_id"`
Line string `json:"line"`
Stream string `json:"stream"` // "stdout" or "stderr"
}
TaskOutputEvent is broadcast when a task produces streaming output.
type TaskStatusEvent ¶
type TaskStatusEvent struct {
TaskID string `json:"task_id"`
ProjectID string `json:"project_id"`
Status string `json:"status"`
AgentID string `json:"agent_id,omitempty"`
}
TaskStatusEvent is broadcast when a task's status changes.
type TeamStatusEvent ¶
type TeamStatusEvent struct {
TeamID string `json:"team_id"`
ProjectID string `json:"project_id"`
Status string `json:"status"`
Name string `json:"name"`
}
TeamStatusEvent is broadcast when a team's status changes.
type ToolCallStatusEvent ¶
type ToolCallStatusEvent struct {
RunID string `json:"run_id"`
CallID string `json:"call_id"`
Tool string `json:"tool"`
Decision string `json:"decision,omitempty"`
Phase string `json:"phase"` // "requested", "approved", "denied", "result"
}
ToolCallStatusEvent is broadcast for tool call lifecycle events.