Documentation
¶
Overview ¶
Package plan owns the shared update_plan snapshot model, validation, history extraction, and bounded rendering helpers.
Index ¶
- Constants
- type Snapshot
- func (s Snapshot) CanonicalJSON() ([]byte, error)
- func (s Snapshot) ChecklistText(running bool) string
- func (s Snapshot) ContextMessage() string
- func (s Snapshot) Equal(other Snapshot) bool
- func (s Snapshot) IsActive() bool
- func (s *Snapshot) NormalizeAndValidate() error
- func (s Snapshot) Summary() SnapshotSummary
- type SnapshotSummary
- type Step
- type StepStatus
Constants ¶
const ( // ToolName is the model-facing name of the execution plan snapshot tool. ToolName = "update_plan" MaxSteps = 20 MaxStepRunes = 240 MaxExplanationRunes = 500 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Snapshot ¶
type Snapshot struct {
Explanation string `json:"explanation,omitempty"`
Plan []Step `json:"plan"`
}
Snapshot is the complete model-controlled update_plan state. Every tool call replaces the previous snapshot atomically.
func LatestSuccessfulSnapshot ¶
LatestSuccessfulSnapshot extracts the newest valid update_plan call with a matching successful tool result from active message history.
func Parse ¶
func Parse(raw json.RawMessage) (Snapshot, error)
Parse decodes, normalizes, and validates a complete update_plan snapshot.
func (Snapshot) CanonicalJSON ¶
CanonicalJSON returns a stable JSON representation of a valid snapshot.
func (Snapshot) ChecklistText ¶
ChecklistText formats a valid snapshot for transcript and terminal rendering.
func (Snapshot) ContextMessage ¶
ContextMessage formats an active snapshot as bounded developer context. The validation limits bound the output to roughly 5.5K Unicode code points.
func (Snapshot) Equal ¶
Equal reports whether two normalized snapshots have the same canonical data.
func (*Snapshot) NormalizeAndValidate ¶
NormalizeAndValidate trims model text and enforces all update_plan invariants.
func (Snapshot) Summary ¶
func (s Snapshot) Summary() SnapshotSummary
Summary derives completed/total/current-step status without mutating the plan.
type SnapshotSummary ¶
SnapshotSummary is compact rendering/status data derived from a snapshot.
type Step ¶
type Step struct {
Step string `json:"step"`
Status StepStatus `json:"status"`
}
Step is one ordered item in an execution plan.
type StepStatus ¶
type StepStatus string
StepStatus is the lifecycle state of one execution-plan step.
const ( StatusPending StepStatus = "pending" StatusInProgress StepStatus = "in_progress" StatusCompleted StepStatus = "completed" )