observe

package
v0.1.32 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 2 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package observe defines stable run-event contracts for Prism integrations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metadata

type Metadata struct {
	ActorID       string `json:"actor_id,omitempty"`
	WorkspaceID   string `json:"workspace_id,omitempty"`
	Source        string `json:"source,omitempty"`
	CorrelationID string `json:"correlation_id,omitempty"`
}

Metadata carries caller-supplied context for one Prism run.

type NoopSink

type NoopSink struct{}

NoopSink drops all events.

func (NoopSink) ObserveRun

func (NoopSink) ObserveRun(context.Context, RunEvent) error

ObserveRun implements Sink.

type RunEvent

type RunEvent struct {
	Timestamp   time.Time `json:"timestamp"`
	RunID       string    `json:"run_id"`
	GraphID     string    `json:"graph_id,omitempty"`
	GraphNodeID string    `json:"graph_node_id,omitempty"`
	EventKind   string    `json:"event_kind,omitempty"`
	Metadata

	AgentID string   `json:"agent_id"`
	Model   string   `json:"model"`
	Status  string   `json:"status"`
	Skills  []string `json:"skills"`
	Plugins []string `json:"plugins,omitempty"`

	DurationMS               int64  `json:"duration_ms"`
	PromptTokensEstimate     int    `json:"prompt_tokens_estimate"`
	CompletionTokensEstimate int    `json:"completion_tokens_estimate"`
	ContextBudget            int    `json:"context_budget,omitempty"`
	PromptSizeEstimate       int    `json:"prompt_size_estimate,omitempty"`
	ContextBudgetExceeded    bool   `json:"context_budget_exceeded,omitempty"`
	PolicyDecision           string `json:"policy_decision,omitempty"`
	PolicyReason             string `json:"policy_reason,omitempty"`
	BundleID                 string `json:"bundle_id,omitempty"`
	BundleVersion            string `json:"bundle_version,omitempty"`
	BundleDigest             string `json:"bundle_digest,omitempty"`
	BundleMode               string `json:"bundle_mode,omitempty"`

	Error           string `json:"error,omitempty"`
	ValidationError string `json:"validation_error,omitempty"`
}

RunEvent is the stable event emitted after each Prism agent invocation.

type Sink

type Sink interface {
	ObserveRun(context.Context, RunEvent) error
}

Sink receives run events. Implementations should be fast and non-blocking.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL