Documentation
¶
Overview ¶
Package events defines Productize's public event envelope and in-process bus.
Index ¶
Constants ¶
View Source
const SchemaVersion = "1.0"
SchemaVersion identifies the current event schema emitted by Productize.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bus ¶
type Bus[T any] struct { // contains filtered or unexported fields }
Bus fans out typed events to bounded per-subscriber channels.
func (*Bus[T]) DroppedFor ¶
DroppedFor returns the number of dropped events recorded for a subscriber.
func (*Bus[T]) Publish ¶
Publish fans out one event to the current subscriber snapshot without blocking.
func (*Bus[T]) Subscribe ¶
Subscribe registers a subscriber and returns its ID, channel, and unsubscribe function.
func (*Bus[T]) SubscriberCount ¶
SubscriberCount returns the number of active subscribers.
type Event ¶
type Event struct {
SchemaVersion string `json:"schema_version"`
RunID string `json:"run_id"`
Seq uint64 `json:"seq"`
Timestamp time.Time `json:"ts"`
Kind EventKind `json:"kind"`
Payload json.RawMessage `json:"payload"`
}
Event carries one versioned event envelope.
type EventKind ¶
type EventKind string
EventKind identifies one emitted event kind.
const ( // Run lifecycle events. EventKindRunQueued EventKind = "run.queued" EventKindRunStarted EventKind = "run.started" EventKindRunCrashed EventKind = "run.crashed" EventKindRunCompleted EventKind = "run.completed" EventKindRunFailed EventKind = "run.failed" EventKindRunCancelled EventKind = "run.cancelled" // Job lifecycle events. EventKindJobQueued EventKind = "job.queued" EventKindJobStarted EventKind = "job.started" EventKindJobAttemptStarted EventKind = "job.attempt_started" EventKindJobAttemptFinished EventKind = "job.attempt_finished" EventKindJobRetryScheduled EventKind = "job.retry_scheduled" EventKindJobCompleted EventKind = "job.completed" EventKindJobFailed EventKind = "job.failed" EventKindJobCancelled EventKind = "job.cancelled" // Session events. EventKindSessionStarted EventKind = "session.started" EventKindSessionUpdate EventKind = "session.update" EventKindSessionCompleted EventKind = "session.completed" EventKindSessionFailed EventKind = "session.failed" // Reusable-agent lifecycle events. EventKindReusableAgentLifecycle EventKind = "reusable_agent.lifecycle" // Tool call events. EventKindToolCallStarted EventKind = "tool_call.started" EventKindToolCallUpdated EventKind = "tool_call.updated" EventKindToolCallFailed EventKind = "tool_call.failed" // Usage events. EventKindUsageUpdated EventKind = "usage.updated" EventKindUsageAggregated EventKind = "usage.aggregated" // Task mutation events. EventKindTaskFileUpdated EventKind = "task.file_updated" EventKindTaskFileSkipped EventKind = "task.file_skipped" EventKindTaskMetadataRefreshed EventKind = "task.metadata_refreshed" EventKindTaskMemoryUpdated EventKind = "task.memory_updated" // Artifact and extension events. EventKindArtifactUpdated EventKind = "artifact.updated" EventKindExtensionLoaded EventKind = "extension.loaded" EventKindExtensionReady EventKind = "extension.ready" EventKindExtensionFailed EventKind = "extension.failed" EventKindExtensionEvent EventKind = "extension.event" // Review mutation events. EventKindReviewStatusFinalized EventKind = "review.status_finalized" EventKindReviewRoundRefreshed EventKind = "review.round_refreshed" EventKindReviewIssueResolved EventKind = "review.issue_resolved" EventKindReviewWatchStarted EventKind = "review.watch_started" EventKindReviewWatchWaiting EventKind = "review.watch_waiting" EventKindReviewWatchRoundFetched EventKind = "review.watch_round_fetched" EventKindReviewWatchFixStarted EventKind = "review.watch_fix_started" EventKindReviewWatchFixCompleted EventKind = "review.watch_fix_completed" EventKindReviewWatchPushStarted EventKind = "review.watch_push_started" EventKindReviewWatchPushCompleted EventKind = "review.watch_push_completed" EventKindReviewWatchPushFailed EventKind = "review.watch_push_failed" EventKindReviewWatchClean EventKind = "review.watch_clean" EventKindReviewWatchMaxRounds EventKind = "review.watch_max_rounds" // Provider I/O events. EventKindProviderCallStarted EventKind = "provider.call_started" EventKindProviderCallCompleted EventKind = "provider.call_completed" EventKindProviderCallFailed EventKind = "provider.call_failed" // Shutdown events. EventKindShutdownRequested EventKind = "shutdown.requested" EventKindShutdownDraining EventKind = "shutdown.draining" EventKindShutdownTerminated EventKind = "shutdown.terminated" )
Click to show internal directories.
Click to hide internal directories.