Documentation
¶
Index ¶
Constants ¶
const ActionContinueSession = "continue_session"
ActionContinueSession is the only action kind in the core plan; the field exists because the spec defines action.kind as extensible.
Variables ¶
This section is empty.
Functions ¶
func ValidatePromptTemplate ¶
ValidatePromptTemplate checks template syntax WITHOUT executing it. Execution-time errors (missing payload keys) are legitimate at validation time — they surface later as failed continuations.
Types ¶
type Continuation ¶
type Continuation struct {
ID string `json:"id"`
RuleID string `json:"ruleId"`
EventID string `json:"eventId"`
SessionID string `json:"sessionId"`
Prompt string `json:"prompt"`
// Label is denormalized from the originating rule so that
// continuation.* result events can carry it as their source even if
// the rule has since been removed (spec §4.5).
Label string `json:"label,omitempty"`
State ContinuationState `json:"state"`
Command string `json:"command,omitempty"`
ExitCode *int `json:"exitCode,omitempty"`
OutputSummary string `json:"outputSummary,omitempty"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
Continuation is a resumed execution with injected context — never a push. Command/ExitCode/OutputSummary are filled by the dispatcher (next plan).
type ContinuationState ¶
type ContinuationState string
const ( ContinuationPending ContinuationState = "pending" ContinuationRunning ContinuationState = "running" ContinuationCompleted ContinuationState = "completed" ContinuationFailed ContinuationState = "failed" )
type Event ¶
type Event struct {
ID string `json:"id"`
Type string `json:"type"`
Source string `json:"source"`
Payload map[string]string `json:"payload,omitempty"`
Timestamp time.Time `json:"timestamp"`
}
Event is an immutable fact about the environment. Payload values are short machine-generated fields only (see security posture in docs/PROJECT.md §9) — never free-form external text.
type EventSelector ¶
type EventSelector struct {
Type string `json:"type"`
Source string `json:"source,omitempty"` // empty matches any source
}
EventSelector matches events by type and (optionally) source.
func (EventSelector) Matches ¶
func (s EventSelector) Matches(ev Event) bool
type Rule ¶
type Rule struct {
ID string `json:"id"`
Selector EventSelector `json:"eventSelector"`
ActionKind string `json:"actionKind"`
SessionID string `json:"sessionId"`
PromptTemplate string `json:"promptTemplate"`
Label string `json:"label,omitempty"`
OneShot bool `json:"oneShot"`
Consumed bool `json:"consumed"`
ExpiresAt *time.Time `json:"expiresAt,omitempty"`
CreatedAt time.Time `json:"createdAt"`
}
Rule binds an event selector to a continuation action.
type Session ¶
type Session struct {
SessionID string `json:"sessionId"`
Agent string `json:"agent"` // claude | cursor | codex | opencode
RepoPath string `json:"repoPath"`
State SessionState `json:"state"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
Session is an agent execution context known to the registry.
type SessionState ¶
type SessionState string
const ( SessionWaiting SessionState = "waiting" SessionQueued SessionState = "queued" SessionResuming SessionState = "resuming" SessionRunning SessionState = "running" SessionDone SessionState = "done" )