Documentation
¶
Index ¶
- Constants
- func CanStartExecution(state State) bool
- func CanTransition(from, to Phase) bool
- func CountByStatus(state State, status StepStatus) int
- func DefaultNextAction(state State) string
- func FinalizeAssistantAnswer(mode AgentMode, state State, answer string) string
- func HasActiveChoice(state State) bool
- func HasDecisionGaps(state State) bool
- func HasExecutionReadiness(state State) bool
- func HasStructuredPlan(state State) bool
- func RenderPromptStateBlock(state State) string
- func RenderStructuredPlanBlock(state State) string
- func SeedForRun(state *State, runMode AgentMode, userInput, fallbackUserText string)
- func ShouldRenderStructuredPlanBlock(state State) bool
- type ActiveChoice
- type AgentMode
- type ChoiceOption
- type Decision
- type Phase
- type RiskLevel
- type State
- type Step
- type StepStatus
- type ValidationResult
Constants ¶
View Source
const StructuredPlanReminder = "Plan mode requires a structured plan before finishing. Please restate the plan using update_plan."
Variables ¶
This section is empty.
Functions ¶
func CanStartExecution ¶
func CanTransition ¶
func CountByStatus ¶
func CountByStatus(state State, status StepStatus) int
func DefaultNextAction ¶
func FinalizeAssistantAnswer ¶
FinalizeAssistantAnswer enforces plan-mode completion policy on final text.
func HasActiveChoice ¶
func HasDecisionGaps ¶
func HasExecutionReadiness ¶
func HasStructuredPlan ¶
func RenderPromptStateBlock ¶
func SeedForRun ¶
SeedForRun initializes plan state when entering plan mode.
Types ¶
type ActiveChoice ¶
type ActiveChoice struct {
ID string `json:"id,omitempty"`
Kind string `json:"kind,omitempty"`
Question string `json:"question"`
GapKey string `json:"gap_key,omitempty"`
Options []ChoiceOption `json:"options,omitempty"`
}
func CloneActiveChoice ¶
func CloneActiveChoice(choice *ActiveChoice) *ActiveChoice
type AgentMode ¶
type AgentMode = corepkg.SessionMode
const ( ModeBuild AgentMode = corepkg.SessionModeBuild ModePlan AgentMode = corepkg.SessionModePlan )
func NormalizeMode ¶
type ChoiceOption ¶
type Decision ¶
func CloneDecisionLog ¶
type Phase ¶
type Phase string
const ( PhaseNone Phase = "none" PhaseExplore Phase = "explore" PhaseClarify Phase = "clarify" PhaseDraft Phase = "draft" PhaseConvergeReady Phase = "converge_ready" PhaseApprovedToBuild Phase = "approved_to_build" PhaseExecuting Phase = "executing" PhaseBlocked Phase = "blocked" PhaseCompleted Phase = "completed" // Legacy aliases kept for persisted sessions and older callers. PhaseDrafting = PhaseDraft PhaseReady = PhaseConvergeReady PhaseApproved = PhaseApprovedToBuild )
func DerivePhase ¶
func NormalizePhase ¶
type State ¶
type State struct {
Goal string `json:"goal,omitempty"`
Summary string `json:"summary,omitempty"`
ImplementationBrief string `json:"implementation_brief,omitempty"`
Phase Phase `json:"phase,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
Steps []Step `json:"steps,omitempty"`
Risks []string `json:"risks,omitempty"`
Verification []string `json:"verification,omitempty"`
DecisionLog []Decision `json:"decision_log,omitempty"`
DecisionGaps []string `json:"decision_gaps,omitempty"`
ActiveChoice *ActiveChoice `json:"active_choice,omitempty"`
ScopeDefined bool `json:"scope_defined,omitempty"`
RiskRollbackDefined bool `json:"risk_and_rollback_defined,omitempty"`
VerificationDefined bool `json:"verification_defined,omitempty"`
NextAction string `json:"next_action,omitempty"`
BlockReason string `json:"block_reason,omitempty"`
}
func CloneState ¶
func NormalizeState ¶
type Step ¶
type Step struct {
ID string `json:"id,omitempty"`
Title string `json:"title"`
Description string `json:"description,omitempty"`
Status StepStatus `json:"status"`
Files []string `json:"files,omitempty"`
Verify []string `json:"verify,omitempty"`
Risk RiskLevel `json:"risk,omitempty"`
}
func CloneSteps ¶
func CurrentStep ¶
type StepStatus ¶
type StepStatus string
const ( StepPending StepStatus = "pending" StepInProgress StepStatus = "in_progress" StepCompleted StepStatus = "completed" StepBlocked StepStatus = "blocked" )
func NormalizeStepStatus ¶
func NormalizeStepStatus(raw string) StepStatus
type ValidationResult ¶
func ValidateState ¶
func ValidateState(state State) ValidationResult
Click to show internal directories.
Click to hide internal directories.