Documentation
¶
Overview ¶
Package goals contains persisted thread-goal state and prompt rendering.
Index ¶
- Constants
- func ContextFromMetadata(metadata map[string]any) (string, bool)
- func DisplayText(objective string) string
- func IsContextText(text string) bool
- func IsTerminalStatus(status Status) bool
- func IsUpdateStatus(status Status) bool
- func IsValidStatus(status Status) bool
- func ModelPrompt(objective string) string
- func RenderContext(goal Goal) string
- func RenderContinuationPrompt(goal Goal) string
- type CommandUpdate
- type Goal
- type Status
Constants ¶
const ( // MetadataKey stores the active thread goal in conversation metadata. MetadataKey = "thread_goal" // SlashCommandName is the built-in slash command used to set a thread goal. SlashCommandName = "goal" // ContextStartMarker starts a hidden goal-context block. ContextStartMarker = "<goal_context>" // ContextEndMarker ends a hidden goal-context block. ContextEndMarker = "</goal_context>" )
Variables ¶
This section is empty.
Functions ¶
func ContextFromMetadata ¶
ContextFromMetadata renders hidden goal context for an active goal.
func DisplayText ¶
DisplayText is the user-facing display text for a goal command.
func IsContextText ¶
IsContextText reports whether text is a goal-context block.
func IsTerminalStatus ¶
IsTerminalStatus reports whether status ends automatic goal continuation.
func IsUpdateStatus ¶
IsUpdateStatus reports whether status can be set by update_goal.
func IsValidStatus ¶
IsValidStatus reports whether status is a known goal status.
func ModelPrompt ¶
ModelPrompt is the model-facing user message for a goal command.
func RenderContext ¶
RenderContext wraps the goal prompt in hidden goal-context markers.
func RenderContinuationPrompt ¶
RenderContinuationPrompt renders the model-facing steering prompt for an active goal.
Types ¶
type CommandUpdate ¶
CommandUpdate is the normalized result of handling `/goal <objective>`.
func ParseSlashCommand ¶
ParseSlashCommand normalizes a built-in goal slash command.
type Goal ¶
type Goal struct {
Version int `json:"version"`
Objective string `json:"objective"`
Status Status `json:"status"`
Reason string `json:"reason,omitempty"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
Goal is persisted in conversation metadata.
func AutoContinuationGoal ¶
AutoContinuationGoal returns the active goal when another automatic continuation exchange may start.
func FromMetadata ¶
FromMetadata reads and validates a goal from conversation metadata.