Documentation
¶
Overview ¶
Package events provides the completion-event pipeline (§8.7.2). A CompletionEvent is emitted once per agent session when the ReAct loop exits. Sinks receive events concurrently; the Emitter returns nil if at least one sink succeeds.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Artefact ¶
type Artefact struct {
Kind string `json:"kind"` // "file" | "pr" | "commit" | "message"
Ref string `json:"ref"` // path, URL, SHA, etc.
}
Artefact records one tangible output produced during the session.
type CompletionEvent ¶
type CompletionEvent struct {
SessionID string `json:"session_id"`
Intent string `json:"intent"` // first user message of the session
Outcome string `json:"outcome"` // "success" | "failure" | "cancelled"
Artefacts []Artefact `json:"artefacts"` // files written, PRs opened, etc.
DurationMs int64 `json:"duration_ms"`
CostUSD float64 `json:"cost_usd"`
Errors []string `json:"errors,omitempty"`
EmittedAt time.Time `json:"emitted_at"`
Meta map[string]string `json:"meta,omitempty"` // channel, profile, etc.
}
CompletionEvent is the structured record emitted when a session ends.
type Emitter ¶
type Emitter struct {
// contains filtered or unexported fields
}
Emitter fans CompletionEvents out to a set of Sinks concurrently.
func NewEmitter ¶
NewEmitter returns an Emitter backed by the given sinks. At least one sink is required; the caller must ensure the slice is non-nil.
type Sink ¶
type Sink interface {
Name() string
Send(ctx context.Context, evt CompletionEvent) error
}
Sink is anything that can receive a CompletionEvent.
type SinkPanicError ¶
SinkPanicError identifies a failed sink dispatch without treating recovery as successful delivery. An error-valued panic remains available to errors.Is.
func (*SinkPanicError) Error ¶
func (err *SinkPanicError) Error() string
func (*SinkPanicError) Unwrap ¶
func (err *SinkPanicError) Unwrap() error