Documentation
¶
Index ¶
- Variables
- func DefaultConfigPath() (string, error)
- func RunServe(arguments []string, _ io.Writer, diagnostics io.Writer) error
- func Serve(ctx context.Context, opts Options) error
- func StaticFileSystem() http.FileSystem
- type AgentCatalogEntry
- type AgentProfile
- type AgentProfileInput
- type AgentProfilesView
- type AgentState
- type AppState
- type AuditEntryView
- type AuditFilterInput
- type AuditState
- type AuditSummaryView
- type AuditVerificationIssueView
- type AuditVerificationView
- type AuthIdentity
- type Controller
- func (c *Controller) Close(ctx context.Context) error
- func (c *Controller) ExportAuditReport(format string) (string, error)
- func (c *Controller) GetAgentProfiles() (AgentProfilesView, error)
- func (c *Controller) GetAuditEntries(filter AuditFilterInput) ([]AuditEntryView, error)
- func (c *Controller) GetAuditSummary() (AuditSummaryView, error)
- func (c *Controller) GetFullSettings() (FullSettingsView, error)
- func (c *Controller) GetState() AppState
- func (c *Controller) GetTelemetrySnapshot() TelemetrySnapshotView
- func (c *Controller) ResizeSession(runID, sessionID string, columns, rows int) error
- func (c *Controller) RestartSession(runID, sessionID string) error
- func (c *Controller) RunPreflight(ctx context.Context) (PreflightReport, error)
- func (c *Controller) SaveAgentProfiles(runID string, req SaveAgentProfilesRequest) (AgentProfilesView, error)
- func (c *Controller) SaveAgentProfilesAndRestart(req SaveAgentProfilesAndRestartRequest) (LifecycleResult, error)
- func (c *Controller) SaveFullSettings(runID string, req SaveFullSettingsRequest) (FullSettingsView, error)
- func (c *Controller) SendTerminalInput(runID, sessionID string, data []byte, operator string) error
- func (c *Controller) SetInteractiveSession(runID, sessionID string, active bool, operator string) error
- func (c *Controller) Start(ctx context.Context) error
- func (c *Controller) StartSession(runID, sessionID string) error
- func (c *Controller) StopRun(runID string) (AppState, error)
- func (c *Controller) StopSession(runID, sessionID string) error
- func (c *Controller) SubmitAutomaticDecision(runID, sessionID, eventID, decision string) error
- func (c *Controller) SubmitDecision(runID, sessionID, eventID, value string) error
- func (c *Controller) SubmitDecisionWithOperator(runID, sessionID, eventID, value, operator string) error
- func (c *Controller) SubmitLine(runID, sessionID, line string) error
- func (c *Controller) SubmitLineWithOperator(runID, sessionID, line, operator string) error
- func (c *Controller) Subscribe(listener func(event string, payload any)) func()
- func (c *Controller) TestNotification() error
- func (c *Controller) VerifyAuditJournal() (AuditVerificationView, error)
- type DecisionBreakdown
- type FullSettingsView
- type LatencyBucketView
- type LifecycleResult
- type NotificationEvent
- type NotificationSettings
- type NotificationWebhookSetting
- type Options
- type PolicyEvaluation
- type PolicyState
- type PreflightAgent
- type PreflightAudit
- type PreflightCheck
- type PreflightConfiguration
- type PreflightPlatform
- type PreflightReport
- type PreflightTool
- type SafeErrorEvent
- type SaveAgentProfilesAndRestartRequest
- type SaveAgentProfilesRequest
- type SaveFullSettingsRequest
- type SecuritySettings
- type SnapshotEvent
- type StatusEvent
- type SupervisionEvent
- type TelemetrySnapshotView
- type UserInfo
- type UserRole
Constants ¶
This section is empty.
Variables ¶
var DistAssets embed.FS
DistAssets embeds the production single-page application bundle. If empty (e.g. in test environments), the server provides a helpful fallback.
Functions ¶
func DefaultConfigPath ¶
DefaultConfigPath resolves the default config file location.
func StaticFileSystem ¶
func StaticFileSystem() http.FileSystem
StaticFileSystem returns an http.FileSystem rooted at the embedded dist directory, stripping the "dist" prefix so that index.html is served at the root.
Types ¶
type AgentCatalogEntry ¶
type AgentCatalogEntry struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
InstallStatus string `json:"installStatus"`
Installed bool `json:"installed"`
Adapter string `json:"adapter"`
AdapterStatus string `json:"adapterStatus"`
DefaultArgv []string `json:"defaultArgv"`
RequiresCustomArgv bool `json:"requiresCustomArgv"`
MinimumArguments int `json:"minimumArguments"`
ArgumentPrefix []string `json:"argumentPrefix"`
}
type AgentProfile ¶
type AgentProfile struct {
ID string `json:"id"`
Name string `json:"name"`
PresetID string `json:"presetID"`
Cwd string `json:"cwd"`
Backend string `json:"backend"`
Adapter string `json:"adapter"`
Argv []string `json:"argv,omitempty"`
ExecutableLabel string `json:"executableLabel"`
ArgumentCount int `json:"argumentCount"`
Locked bool `json:"locked"`
ReadOnlyReason string `json:"readOnlyReason,omitempty"`
PreserveOnSave bool `json:"preserveOnSave"`
}
type AgentProfileInput ¶
type AgentProfileInput struct {
ID string `json:"id"`
Name string `json:"name"`
PresetID string `json:"presetID,omitempty"`
Cwd string `json:"cwd,omitempty"`
Backend string `json:"backend,omitempty"`
Adapter string `json:"adapter,omitempty"`
Argv []string `json:"argv,omitempty"`
PreserveOnSave bool `json:"preserveOnSave,omitempty"`
}
type AgentProfilesView ¶
type AgentProfilesView struct {
ConfigPath string `json:"configPath"`
Revision string `json:"revision"`
Catalog []AgentCatalogEntry `json:"catalog"`
Profiles []AgentProfile `json:"profiles"`
MinProfiles int `json:"minProfiles"`
MaxProfiles int `json:"maxProfiles"`
RestartRequired bool `json:"restartRequired"`
Editable bool `json:"editable"`
ReadOnlyReason string `json:"readOnlyReason,omitempty"`
}
type AgentState ¶
type AgentState struct {
SessionID string `json:"sessionID"`
AgentID string `json:"agentID"`
Name string `json:"name"`
DisplayCommand string `json:"displayCommand"`
Backend string `json:"backend"`
Adapter string `json:"adapter"`
Status string `json:"status"`
Output string `json:"output"`
Revision uint64 `json:"revision"`
Running bool `json:"running"`
Attached bool `json:"attached"`
InputFrozen bool `json:"inputFrozen"`
Simulated bool `json:"simulated"`
ExitCode *int `json:"exitCode,omitempty"`
}
type AppState ¶
type AppState struct {
RunID string `json:"runID"`
RunStatus string `json:"runStatus"`
StartedAt string `json:"startedAt,omitempty"`
Policy PolicyState `json:"policy"`
Audit AuditState `json:"audit"`
Agents []AgentState `json:"agents"`
PendingEvents []SupervisionEvent `json:"pendingEvents"`
Notices []string `json:"notices"`
}
type AuditEntryView ¶
type AuditEntryView struct {
Sequence uint64 `json:"sequence"`
Timestamp string `json:"timestamp"`
EntryID string `json:"entryID"`
RunID string `json:"runID"`
Kind string `json:"kind"`
SessionID string `json:"sessionID,omitempty"`
AgentID string `json:"agentID,omitempty"`
Backend string `json:"backend,omitempty"`
Adapter string `json:"adapter,omitempty"`
EventType string `json:"eventType,omitempty"`
Risk string `json:"risk,omitempty"`
Rule string `json:"rule,omitempty"`
Decision string `json:"decision,omitempty"`
DecisionBy string `json:"decisionBy,omitempty"`
Operator string `json:"operator,omitempty"`
Outcome string `json:"outcome,omitempty"`
Reason string `json:"reason,omitempty"`
Summary string `json:"summary,omitempty"`
Sensitive bool `json:"sensitive"`
Metadata map[string]string `json:"metadata,omitempty"`
}
type AuditFilterInput ¶
type AuditState ¶
type AuditSummaryView ¶
type AuditSummaryView struct {
Path string `json:"path"`
TotalEntries int `json:"totalEntries"`
RunsCount int `json:"runsCount"`
SessionsCount int `json:"sessionsCount"`
AgentCounts map[string]int `json:"agentCounts"`
KindCounts map[string]int `json:"kindCounts"`
DecisionsCount map[string]int `json:"decisionsCount"`
ActorsCount map[string]int `json:"actorsCount"`
OutcomesCount map[string]int `json:"outcomesCount"`
SensitiveCount int `json:"sensitiveCount"`
FirstTimestamp string `json:"firstTimestamp,omitempty"`
LastTimestamp string `json:"lastTimestamp,omitempty"`
}
type AuditVerificationView ¶
type AuthIdentity ¶ added in v0.6.0
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller owns the headless supervisor runtime and provides thread-safe query and mutation methods mirroring the RelayerBridge interface.
func NewController ¶
func NewController(configPath string, diagnostics io.Writer) (*Controller, error)
NewController creates an unstarted supervisor controller.
func (*Controller) Close ¶
func (c *Controller) Close(ctx context.Context) error
Close gracefully stops the running supervisor and all agent processes.
func (*Controller) ExportAuditReport ¶
func (c *Controller) ExportAuditReport(format string) (string, error)
func (*Controller) GetAgentProfiles ¶
func (c *Controller) GetAgentProfiles() (AgentProfilesView, error)
func (*Controller) GetAuditEntries ¶
func (c *Controller) GetAuditEntries(filter AuditFilterInput) ([]AuditEntryView, error)
func (*Controller) GetAuditSummary ¶
func (c *Controller) GetAuditSummary() (AuditSummaryView, error)
func (*Controller) GetFullSettings ¶
func (c *Controller) GetFullSettings() (FullSettingsView, error)
func (*Controller) GetState ¶
func (c *Controller) GetState() AppState
func (*Controller) GetTelemetrySnapshot ¶
func (c *Controller) GetTelemetrySnapshot() TelemetrySnapshotView
func (*Controller) ResizeSession ¶
func (c *Controller) ResizeSession(runID, sessionID string, columns, rows int) error
func (*Controller) RestartSession ¶
func (c *Controller) RestartSession(runID, sessionID string) error
func (*Controller) RunPreflight ¶
func (c *Controller) RunPreflight(ctx context.Context) (PreflightReport, error)
func (*Controller) SaveAgentProfiles ¶
func (c *Controller) SaveAgentProfiles(runID string, req SaveAgentProfilesRequest) (AgentProfilesView, error)
func (*Controller) SaveAgentProfilesAndRestart ¶
func (c *Controller) SaveAgentProfilesAndRestart(req SaveAgentProfilesAndRestartRequest) (LifecycleResult, error)
func (*Controller) SaveFullSettings ¶
func (c *Controller) SaveFullSettings(runID string, req SaveFullSettingsRequest) (FullSettingsView, error)
func (*Controller) SendTerminalInput ¶ added in v0.6.0
func (c *Controller) SendTerminalInput(runID, sessionID string, data []byte, operator string) error
SendTerminalInput delivers raw terminal input bytes directly to the session backend. Used by the web interactive terminal (full PTY mode) to stream keystrokes and signals.
func (*Controller) SetInteractiveSession ¶ added in v0.6.0
func (c *Controller) SetInteractiveSession(runID, sessionID string, active bool, operator string) error
SetInteractiveSession toggles an agent's interactive attachment state and logs audit tracking.
func (*Controller) Start ¶
func (c *Controller) Start(ctx context.Context) error
Start boots the supervisor runtime and begins event processing.
func (*Controller) StartSession ¶
func (c *Controller) StartSession(runID, sessionID string) error
func (*Controller) StopSession ¶
func (c *Controller) StopSession(runID, sessionID string) error
func (*Controller) SubmitAutomaticDecision ¶
func (c *Controller) SubmitAutomaticDecision(runID, sessionID, eventID, decision string) error
func (*Controller) SubmitDecision ¶
func (c *Controller) SubmitDecision(runID, sessionID, eventID, value string) error
func (*Controller) SubmitDecisionWithOperator ¶ added in v0.6.0
func (c *Controller) SubmitDecisionWithOperator(runID, sessionID, eventID, value, operator string) error
func (*Controller) SubmitLine ¶
func (c *Controller) SubmitLine(runID, sessionID, line string) error
func (*Controller) SubmitLineWithOperator ¶ added in v0.6.0
func (c *Controller) SubmitLineWithOperator(runID, sessionID, line, operator string) error
func (*Controller) Subscribe ¶
func (c *Controller) Subscribe(listener func(event string, payload any)) func()
Subscribe registers an event listener called on each broadcast. Returns an unsubscribe function.
func (*Controller) TestNotification ¶
func (c *Controller) TestNotification() error
func (*Controller) VerifyAuditJournal ¶
func (c *Controller) VerifyAuditJournal() (AuditVerificationView, error)
type DecisionBreakdown ¶
type FullSettingsView ¶
type FullSettingsView struct {
AgentProfilesView
Security SecuritySettings `json:"security"`
Notifications NotificationSettings `json:"notifications"`
}
type LatencyBucketView ¶
type LifecycleResult ¶
type LifecycleResult struct {
Outcome string `json:"outcome"`
State AppState `json:"state"`
Profiles AgentProfilesView `json:"profiles"`
}
type NotificationEvent ¶
type NotificationEvent struct {
Title string `json:"title"`
Body string `json:"body"`
AgentName string `json:"agentName,omitempty"`
SessionID string `json:"sessionID,omitempty"`
EventID string `json:"eventID,omitempty"`
Kind string `json:"kind"`
Severity string `json:"severity"`
Reason string `json:"reason,omitempty"`
Timestamp string `json:"timestamp"`
}
NotificationEvent is broadcast to WebSocket clients when an operator alert fires.
type NotificationSettings ¶
type NotificationSettings struct {
Enabled bool `json:"enabled"`
Bell bool `json:"bell"`
Desktop bool `json:"desktop"`
MinSeverity string `json:"minSeverity"`
Webhooks []NotificationWebhookSetting `json:"webhooks"`
}
type Options ¶
type Options struct {
Bind string
Port int
Token string
ViewerToken string
ConfigPath string
StaticDir string
Diagnostics io.Writer
OnReady func(serverURL string, token string)
}
Options configures the headless Relayer web server.
type PolicyEvaluation ¶
type PolicyState ¶
type PreflightAgent ¶
type PreflightAgent struct {
Ordinal int `json:"ordinal"`
Source string `json:"source"`
Command string `json:"command"`
Installation string `json:"installation"`
Adapter string `json:"adapter,omitempty"`
AdapterMaturity string `json:"adapterMaturity,omitempty"`
Backend string `json:"backend,omitempty"`
}
type PreflightAudit ¶
type PreflightCheck ¶
type PreflightConfiguration ¶
type PreflightPlatform ¶
type PreflightReport ¶
type PreflightReport struct {
SchemaVersion int `json:"schemaVersion"`
Status string `json:"status"`
Platform PreflightPlatform `json:"platform"`
Configuration PreflightConfiguration `json:"configuration"`
Audit PreflightAudit `json:"audit"`
Tools []PreflightTool `json:"tools"`
Agents []PreflightAgent `json:"agents"`
Checks []PreflightCheck `json:"checks"`
}
type PreflightTool ¶
type SafeErrorEvent ¶
type SaveAgentProfilesAndRestartRequest ¶
type SaveAgentProfilesAndRestartRequest struct {
ExpectedRunID string `json:"expectedRunID,omitempty"`
ExpectedRevision string `json:"expectedRevision"`
Profiles []AgentProfileInput `json:"profiles"`
}
type SaveAgentProfilesRequest ¶
type SaveAgentProfilesRequest struct {
ExpectedRevision string `json:"expectedRevision"`
Profiles []AgentProfileInput `json:"profiles"`
}
type SaveFullSettingsRequest ¶
type SaveFullSettingsRequest struct {
ExpectedRevision string `json:"expectedRevision"`
Profiles []AgentProfileInput `json:"profiles,omitempty"`
Security *SecuritySettings `json:"security,omitempty"`
Notifications *NotificationSettings `json:"notifications,omitempty"`
}
type SecuritySettings ¶
type SecuritySettings struct {
Profile string `json:"profile"`
DefaultAction string `json:"defaultAction"`
DryRun bool `json:"dryRun"`
BlockDestructive bool `json:"blockDestructive"`
BlockExfiltration bool `json:"blockExfiltration"`
BlockSensitivePaths bool `json:"blockSensitivePaths"`
BlockOutsideWorkspace bool `json:"blockOutsideWorkspace"`
WorkspaceRoot string `json:"workspaceRoot"`
RateLimitPerMinute int `json:"rateLimitPerMinute"`
MaxConsecutiveAutoDecisions int `json:"maxConsecutiveAutoDecisions"`
}
type SnapshotEvent ¶
type SnapshotEvent struct {
RunID string `json:"runID"`
SessionID string `json:"sessionID"`
Revision uint64 `json:"revision"`
Output string `json:"output"`
Status string `json:"status"`
Running bool `json:"running"`
Attached bool `json:"attached"`
InputFrozen bool `json:"inputFrozen"`
ExitCode *int `json:"exitCode,omitempty"`
}
type StatusEvent ¶
type SupervisionEvent ¶
type SupervisionEvent struct {
RunID string `json:"runID"`
ID string `json:"id"`
SessionID string `json:"sessionID"`
AgentID string `json:"agentID"`
Adapter string `json:"adapter"`
Type string `json:"type"`
Summary string `json:"summary"`
Sensitive bool `json:"sensitive"`
Risk string `json:"risk"`
Timestamp string `json:"timestamp"`
Evaluation PolicyEvaluation `json:"evaluation"`
DeliveryStatus string `json:"deliveryStatus"`
Decisions []string `json:"decisions"`
}
type TelemetrySnapshotView ¶
type TelemetrySnapshotView struct {
Timestamp string `json:"timestamp"`
Enabled bool `json:"enabled"`
PrometheusEnabled bool `json:"prometheusEnabled"`
PrometheusAddress string `json:"prometheusAddress,omitempty"`
OTLPEnabled bool `json:"otlpEnabled"`
OTLPEndpoint string `json:"otlpEndpoint,omitempty"`
SessionsActive int64 `json:"sessionsActive"`
EventsPending int64 `json:"eventsPending"`
SessionsTotal int64 `json:"sessionsTotal"`
EventsDetectedTotal int64 `json:"eventsDetectedTotal"`
EventsWithdrawnTotal int64 `json:"eventsWithdrawnTotal"`
DecisionsTotal int64 `json:"decisionsTotal"`
DecisionsBreakdown DecisionBreakdown `json:"decisionsBreakdown"`
OperatorInputsTotal int64 `json:"operatorInputsTotal"`
GuardrailsTotal int64 `json:"guardrailsTotal"`
GuardrailsBreakdown map[string]int64 `json:"guardrailsBreakdown"`
AverageReactionTime float64 `json:"averageReactionTime"`
DecisionDurations []LatencyBucketView `json:"decisionDurations"`
}