Documentation
¶
Overview ¶
Package lifecycle defines the dependency-free lifecycle domain shared by chat and terminal-host integrations.
Index ¶
Constants ¶
const (
// SchemaVersion is the current JSON lifecycle event schema.
SchemaVersion = 1
)
Variables ¶
This section is empty.
Functions ¶
func ValidState ¶
ValidState reports whether state belongs to the public lifecycle vocabulary.
Types ¶
type Event ¶
type Event struct {
SchemaVersion int `json:"schema_version"`
Producer string `json:"producer"`
Kind Kind `json:"kind"`
Sequence int64 `json:"sequence"`
Timestamp string `json:"timestamp"`
State State `json:"state"`
Message string `json:"message"`
SessionID string `json:"session_id"`
Title string `json:"-"`
PID int `json:"pid"`
CWD string `json:"cwd"`
ResumeArgv []string `json:"resume_argv,omitempty"`
}
Event is the stable version 1 JSON contract consumed by generic command sinks. Field order is intentional so encoded events remain byte-compatible.
type Kind ¶
type Kind string
Kind identifies whether an event publishes state or relinquishes authority.
type Metadata ¶
Metadata identifies the term-llm process producing lifecycle events.
func NormalizeMetadata ¶
NormalizeMetadata sanitizes and bounds process metadata and resume arguments.
type Snapshot ¶
Snapshot is a side-effect-free view of the currently visible chat. Title is optional presentation metadata for first-party terminal hosts. It is intentionally not part of the versioned JSON event schema sent to command sinks. Message is an optional, stable detail suitable for display by a terminal host. CWD is the visible session's effective working directory when available; the manager uses the producer process working directory as its event fallback.
func NormalizeSnapshot ¶
NormalizeSnapshot removes controls, normalizes whitespace, and bounds values before they can reach a terminal host or external command.