Documentation
¶
Index ¶
- Variables
- func IsValidTaskPhase(phase TaskPhase) bool
- func IsValidTaskStatus(status TaskStatus) bool
- type CheckboxItem
- type Content
- type Decision
- type DecisionID
- type FileMetadata
- type FrontmatterMap
- func (f *FrontmatterMap) Delete(key string)
- func (f FrontmatterMap) Get(key string) any
- func (f FrontmatterMap) GetBool(key string) bool
- func (f FrontmatterMap) GetString(key string) string
- func (f FrontmatterMap) GetStringSlice(key string) []string
- func (f FrontmatterMap) GetTime(key string) *time.Time
- func (f FrontmatterMap) Keys() []string
- func (f FrontmatterMap) RawMap() map[string]any
- func (f *FrontmatterMap) Set(key string, value any)
- type Goal
- type GoalFrontmatter
- func (f GoalFrontmatter) Assignee() string
- func (f GoalFrontmatter) ClaudeSessionID() string
- func (f *GoalFrontmatter) ClearClaudeSessionID()
- func (f *GoalFrontmatter) ClearField(key string)
- func (f GoalFrontmatter) Completed() *libtime.Date
- func (f GoalFrontmatter) DeferDate() *libtime.DateOrDateTime
- func (f GoalFrontmatter) GetField(key string) string
- func (f GoalFrontmatter) PageType() string
- func (f GoalFrontmatter) Phase() *GoalPhase
- func (f GoalFrontmatter) Priority() Priority
- func (f *GoalFrontmatter) SetAssignee(v string)
- func (f *GoalFrontmatter) SetClaudeSessionID(v string)
- func (f *GoalFrontmatter) SetCompleted(d *libtime.Date)
- func (f *GoalFrontmatter) SetDeferDate(d *libtime.DateOrDateTime)
- func (f *GoalFrontmatter) SetField(ctx context.Context, key, value string) error
- func (f *GoalFrontmatter) SetPageType(v string)
- func (f *GoalFrontmatter) SetPhase(p *GoalPhase)
- func (f *GoalFrontmatter) SetPriority(ctx context.Context, p Priority) error
- func (f *GoalFrontmatter) SetStartDate(d *libtime.DateOrDateTime)
- func (f *GoalFrontmatter) SetStatus(s GoalStatus) error
- func (f *GoalFrontmatter) SetTags(v []string)
- func (f *GoalFrontmatter) SetTargetDate(d *libtime.DateOrDateTime)
- func (f *GoalFrontmatter) SetTheme(v string)
- func (f GoalFrontmatter) StartDate() *libtime.DateOrDateTime
- func (f GoalFrontmatter) Status() GoalStatus
- func (f GoalFrontmatter) Tags() []string
- func (f GoalFrontmatter) TargetDate() *libtime.DateOrDateTime
- func (f GoalFrontmatter) Theme() string
- type GoalID
- type GoalPhase
- type GoalPhases
- type GoalStatus
- type GoalStatuses
- type MetricsCycle
- type MetricsSession
- type Objective
- type ObjectiveFrontmatter
- func (f ObjectiveFrontmatter) Assignee() string
- func (f *ObjectiveFrontmatter) ClearField(key string)
- func (f ObjectiveFrontmatter) Completed() *libtime.Date
- func (f ObjectiveFrontmatter) GetField(key string) string
- func (f ObjectiveFrontmatter) PageType() string
- func (f ObjectiveFrontmatter) Priority() Priority
- func (f *ObjectiveFrontmatter) SetAssignee(v string)
- func (f *ObjectiveFrontmatter) SetCompleted(d *libtime.Date)
- func (f *ObjectiveFrontmatter) SetField(ctx context.Context, key, value string) error
- func (f *ObjectiveFrontmatter) SetPageType(v string)
- func (f *ObjectiveFrontmatter) SetPriority(ctx context.Context, p Priority) error
- func (f *ObjectiveFrontmatter) SetStartDate(d *libtime.DateOrDateTime)
- func (f *ObjectiveFrontmatter) SetStatus(s ObjectiveStatus) error
- func (f *ObjectiveFrontmatter) SetTags(v []string)
- func (f *ObjectiveFrontmatter) SetTargetDate(d *libtime.DateOrDateTime)
- func (f ObjectiveFrontmatter) StartDate() *libtime.DateOrDateTime
- func (f ObjectiveFrontmatter) Status() ObjectiveStatus
- func (f ObjectiveFrontmatter) Tags() []string
- func (f ObjectiveFrontmatter) TargetDate() *libtime.DateOrDateTime
- type ObjectiveID
- type ObjectiveStatus
- type ObjectiveStatuses
- type Page
- func (p Page) Assignee() string
- func (p Page) ClaudeSessionID() string
- func (p Page) CompletedDate() *libtime.DateOrDateTime
- func (p Page) DeferDate() *libtime.DateOrDateTime
- func (p Page) DueDate() *libtime.DateOrDateTime
- func (p Page) Goals() []string
- func (p Page) ModifiedDateFromPage() *time.Time
- func (p Page) PageType() string
- func (p Page) Phase() *TaskPhase
- func (p Page) PlannedDate() *libtime.DateOrDateTime
- func (p Page) Priority() Priority
- func (p Page) Recurring() string
- func (p *Page) SetDeferDate(d *libtime.DateOrDateTime)
- func (p *Page) SetDueDate(d *libtime.DateOrDateTime)
- func (p *Page) SetGoals(v []string)
- func (p *Page) SetPlannedDate(d *libtime.DateOrDateTime)
- func (p *Page) SetPriority(ctx context.Context, pr Priority) error
- func (p Page) Status() TaskStatus
- type Priority
- type RecurringInterval
- type ResolveResult
- type Task
- type TaskFrontmatter
- func (f *TaskFrontmatter) AppendMetricsCycle(cycle MetricsCycle)
- func (f *TaskFrontmatter) AppendMetricsSession(entry MetricsSession)
- func (f TaskFrontmatter) Assignee() string
- func (f TaskFrontmatter) ClaudeSessionID() string
- func (f *TaskFrontmatter) ClearClaudeSessionID()
- func (f *TaskFrontmatter) ClearField(key string)
- func (f *TaskFrontmatter) ClearMetricsCompletedAt()
- func (f *TaskFrontmatter) ClearMetricsInteractionCount()
- func (f *TaskFrontmatter) ClearMetricsSessions()
- func (f TaskFrontmatter) CompletedDate() *libtime.DateOrDateTime
- func (f TaskFrontmatter) CreatedDate() *libtime.DateOrDateTime
- func (f TaskFrontmatter) DeferDate() *libtime.DateOrDateTime
- func (f TaskFrontmatter) DueDate() *libtime.DateOrDateTime
- func (f TaskFrontmatter) GetField(key string) string
- func (f TaskFrontmatter) Goals() []string
- func (f TaskFrontmatter) LastCompleted() string
- func (f TaskFrontmatter) LastCompletedDate() *libtime.DateOrDateTime
- func (f TaskFrontmatter) MetricsCompletedAt() *libtime.DateOrDateTime
- func (f TaskFrontmatter) MetricsCycles() []MetricsCycle
- func (f TaskFrontmatter) MetricsInteractionCount() *int
- func (f TaskFrontmatter) MetricsSessions() []MetricsSession
- func (f TaskFrontmatter) PageType() string
- func (f TaskFrontmatter) Phase() *TaskPhase
- func (f TaskFrontmatter) PlannedDate() *libtime.DateOrDateTime
- func (f TaskFrontmatter) Priority() Priority
- func (f TaskFrontmatter) Recurring() string
- func (f *TaskFrontmatter) SetAssignee(v string)
- func (f *TaskFrontmatter) SetClaudeSessionID(v string)
- func (f *TaskFrontmatter) SetCompletedDate(d *libtime.DateOrDateTime)
- func (f *TaskFrontmatter) SetCreatedDate(d *libtime.DateOrDateTime)
- func (f *TaskFrontmatter) SetDeferDate(d *libtime.DateOrDateTime)
- func (f *TaskFrontmatter) SetDueDate(d *libtime.DateOrDateTime)
- func (f *TaskFrontmatter) SetField(ctx context.Context, key, value string) error
- func (f *TaskFrontmatter) SetGoals(v []string)
- func (f *TaskFrontmatter) SetLastCompleted(v string)
- func (f *TaskFrontmatter) SetLastCompletedDate(d *libtime.DateOrDateTime)
- func (f *TaskFrontmatter) SetMetricsCompletedAt(d *libtime.DateOrDateTime)
- func (f *TaskFrontmatter) SetMetricsInteractionCount(count int)
- func (f *TaskFrontmatter) SetPageType(v string)
- func (f *TaskFrontmatter) SetPhase(p *TaskPhase)
- func (f *TaskFrontmatter) SetPlannedDate(d *libtime.DateOrDateTime)
- func (f *TaskFrontmatter) SetPriority(ctx context.Context, p Priority) error
- func (f *TaskFrontmatter) SetRecurring(v string)
- func (f *TaskFrontmatter) SetStatus(s TaskStatus) error
- func (f *TaskFrontmatter) SetTags(v []string)
- func (f *TaskFrontmatter) SetTaskIdentifier(v string)
- func (f TaskFrontmatter) Status() TaskStatus
- func (f TaskFrontmatter) Tags() []string
- func (f TaskFrontmatter) TaskIdentifier() string
- type TaskID
- type TaskPhase
- type TaskPhases
- type TaskStatus
- type TaskStatuses
- type Theme
- type ThemeFrontmatter
- func (f ThemeFrontmatter) Assignee() string
- func (f *ThemeFrontmatter) ClearField(key string)
- func (f ThemeFrontmatter) GetField(key string) string
- func (f ThemeFrontmatter) PageType() string
- func (f ThemeFrontmatter) Priority() Priority
- func (f *ThemeFrontmatter) SetAssignee(v string)
- func (f *ThemeFrontmatter) SetField(ctx context.Context, key, value string) error
- func (f *ThemeFrontmatter) SetPageType(v string)
- func (f *ThemeFrontmatter) SetPriority(ctx context.Context, p Priority) error
- func (f *ThemeFrontmatter) SetStartDate(d *libtime.DateOrDateTime)
- func (f *ThemeFrontmatter) SetStatus(s ThemeStatus) error
- func (f *ThemeFrontmatter) SetTags(v []string)
- func (f *ThemeFrontmatter) SetTargetDate(d *libtime.DateOrDateTime)
- func (f ThemeFrontmatter) StartDate() *libtime.DateOrDateTime
- func (f ThemeFrontmatter) Status() ThemeStatus
- func (f ThemeFrontmatter) Tags() []string
- func (f ThemeFrontmatter) TargetDate() *libtime.DateOrDateTime
- type ThemeID
- type ThemeStatus
- type ThemeStatuses
- type Vision
- type VisionFrontmatter
- func (f VisionFrontmatter) Assignee() string
- func (f *VisionFrontmatter) ClearField(key string)
- func (f VisionFrontmatter) GetField(key string) string
- func (f VisionFrontmatter) PageType() string
- func (f VisionFrontmatter) Priority() Priority
- func (f *VisionFrontmatter) SetAssignee(v string)
- func (f *VisionFrontmatter) SetField(ctx context.Context, key, value string) error
- func (f *VisionFrontmatter) SetPageType(v string)
- func (f *VisionFrontmatter) SetPriority(ctx context.Context, p Priority) error
- func (f *VisionFrontmatter) SetStatus(s VisionStatus) error
- func (f *VisionFrontmatter) SetTags(v []string)
- func (f VisionFrontmatter) Status() VisionStatus
- func (f VisionFrontmatter) Tags() []string
- type VisionID
- type VisionStatus
- type VisionStatuses
Constants ¶
This section is empty.
Variables ¶
var AvailableGoalPhases = GoalPhases{ GoalPhaseTodo, GoalPhasePlanning, GoalPhaseExecution, GoalPhaseDone, }
AvailableGoalPhases lists all valid canonical goal phase values.
var AvailableGoalStatuses = GoalStatuses{ GoalStatusNext, GoalStatusInProgress, GoalStatusBacklog, GoalStatusCompleted, GoalStatusHold, GoalStatusAborted, GoalStatusActive, GoalStatusOnHold, }
AvailableGoalStatuses lists all valid canonical goal status values. Includes both the new task-aligned set and the legacy 3-value set so existing vault files (which may use either) continue to validate.
var AvailableObjectiveStatuses = ObjectiveStatuses{ ObjectiveStatusActive, ObjectiveStatusCompleted, ObjectiveStatusOnHold, }
AvailableObjectiveStatuses lists all valid canonical objective status values.
var AvailableTaskPhases = TaskPhases{ TaskPhaseTodo, TaskPhasePlanning, TaskPhaseExecution, TaskPhaseAIReview, TaskPhaseHumanReview, TaskPhaseDone, }
AvailableTaskPhases lists all valid canonical task phase values.
var AvailableTaskStatuses = TaskStatuses{ TaskStatusNext, TaskStatusInProgress, TaskStatusBacklog, TaskStatusCompleted, TaskStatusHold, TaskStatusAborted, }
AvailableTaskStatuses lists all valid canonical task status values.
var AvailableThemeStatuses = ThemeStatuses{ ThemeStatusActive, ThemeStatusCompleted, ThemeStatusArchived, }
AvailableThemeStatuses lists all valid canonical theme status values.
var AvailableVisionStatuses = VisionStatuses{ VisionStatusActive, VisionStatusCompleted, VisionStatusArchived, }
AvailableVisionStatuses lists all valid canonical vision status values.
Functions ¶
func IsValidTaskPhase ¶ added in v0.64.3
IsValidTaskPhase returns true if the phase is a valid canonical phase value.
func IsValidTaskStatus ¶ added in v0.10.8
func IsValidTaskStatus(status TaskStatus) bool
IsValidTaskStatus returns true if the status is a valid canonical status value.
Types ¶
type CheckboxItem ¶
CheckboxItem represents a checkbox item in markdown content.
type Content ¶ added in v0.53.0
type Content string
Content is the full markdown file content including the frontmatter block. It is embedded in entity structs (Task, Goal, Theme, Objective, Vision) alongside FileMetadata and an entity-specific XxxFrontmatter type. The storage layer extracts the markdown body from Content on write.
type Decision ¶ added in v0.21.0
type Decision struct {
// FrontmatterMap holds every frontmatter key parsed from the file.
// The yaml:"-" tag keeps it out of yaml.Marshal(Decision); gopkg.in/yaml.v3
// does not inline anonymous struct fields, so without the tag it would emit
// a stray "frontmattermap: {}" key.
FrontmatterMap `yaml:"-"`
// Managed frontmatter fields — the only six keys WriteDecision overlays.
NeedsReview bool `yaml:"needs_review"`
Reviewed bool `yaml:"reviewed,omitempty"`
ReviewedDate *libtime.DateOrDateTime `yaml:"-"` // managed by storage layer
Status string `yaml:"status,omitempty"`
Type string `yaml:"type,omitempty"`
PageType string `yaml:"page_type,omitempty"`
// Metadata — excluded from YAML serialization
Name string `yaml:"-"` // Relative path from vault root without .md extension
Content string `yaml:"-"` // Full markdown content including frontmatter
FilePath string `yaml:"-"` // Absolute path to file
}
Decision represents a markdown file in the vault that has needs_review frontmatter.
The embedded FrontmatterMap holds the complete frontmatter parsed from the file, including keys this type has no field for. WriteDecision serializes that map and overlays only the six managed keys, so a Trading Decision Record's selected_option, review_date, and related survive a read-write cycle untouched.
Unlike Task/Goal/Theme/Objective/Vision, Decision keeps typed struct fields for its six managed keys instead of an XxxFrontmatter wrapper: those fields are the mutation surface pkg/ops/decision_ack.go writes and pkg/ops/decision_list.go reads directly.
func NewDecision ¶ added in v0.104.0
NewDecision creates a Decision from a parsed frontmatter map and file metadata.
The complete map is retained so unknown keys survive a read-write cycle; the six managed keys are additionally projected onto typed struct fields. Values are read through the coercing FrontmatterMap accessors, so a hand-quoted reviewed: "true" reads as true rather than silently as false.
type DecisionID ¶ added in v0.21.0
type DecisionID string
DecisionID represents a decision identifier (relative vault path without .md extension).
func (DecisionID) String ¶ added in v0.21.0
func (d DecisionID) String() string
type FileMetadata ¶ added in v0.53.0
type FileMetadata struct {
// Name is the filename without the .md extension.
Name string
// FilePath is the absolute path to the markdown file.
FilePath string
// ModifiedDate is the file's last-modified time (UTC), populated by the storage layer.
ModifiedDate *time.Time
}
FileMetadata holds the filesystem metadata for an entity file. It is embedded in all entity structs (Task, Goal, Theme, Objective, Vision) and is never stored in YAML frontmatter.
type FrontmatterMap ¶ added in v0.53.0
type FrontmatterMap struct {
// contains filtered or unexported fields
}
FrontmatterMap is a typed wrapper around map[string]any that stores YAML frontmatter fields. It preserves all fields, including unknown ones, through read-write cycles. Entity-specific types embed FrontmatterMap and layer typed accessors on top.
func NewFrontmatterMap ¶ added in v0.53.0
func NewFrontmatterMap(data map[string]any) FrontmatterMap
NewFrontmatterMap constructs a FrontmatterMap from a raw map. If data is nil, an empty map is used.
func (*FrontmatterMap) Delete ¶ added in v0.53.0
func (f *FrontmatterMap) Delete(key string)
Delete removes key from the map. No-op if key is absent.
func (FrontmatterMap) Get ¶ added in v0.53.0
func (f FrontmatterMap) Get(key string) any
Get returns the raw value stored for key, or nil if absent.
func (FrontmatterMap) GetBool ¶ added in v0.104.0
func (f FrontmatterMap) GetBool(key string) bool
GetBool returns the bool value stored for key.
A bool value passes through unchanged. A string value is matched case-insensitively after trimming surrounding whitespace: "true" and "yes" yield true, everything else yields false. A missing key, a nil value, or any other type also yields false.
Coercion rather than a bare type assertion is deliberate: YAML 1.2 leaves a hand-quoted reviewed: "true" as a string, and a .(bool) assertion would read that as false — "not reviewed" — silently resurfacing an already-acknowledged page.
func (FrontmatterMap) GetString ¶ added in v0.53.0
func (f FrontmatterMap) GetString(key string) string
GetString returns the string representation of the value stored for key. Returns "" if the key is absent or the value cannot be stringified.
func (FrontmatterMap) GetStringSlice ¶ added in v0.53.0
func (f FrontmatterMap) GetStringSlice(key string) []string
GetStringSlice returns a []string for the value stored under key. Handles: nil (returns nil), []any (coerces each element to string), []string (returned directly), and string (splits on comma).
func (FrontmatterMap) GetTime ¶ added in v0.55.2
func (f FrontmatterMap) GetTime(key string) *time.Time
GetTime returns the time.Time value stored for key. Handles three shapes:
- time.Time (YAML parses date/datetime literals into this automatically)
- libtime.DateOrDateTime (in-memory typed value set by domain setters)
- string (falls back to libtime.ParseTime for manually-authored values)
- anything else → nil
Returns nil on missing key, empty string, parse failure, or unsupported type.
func (FrontmatterMap) Keys ¶ added in v0.53.0
func (f FrontmatterMap) Keys() []string
Keys returns all keys present in the map, in no guaranteed order.
func (FrontmatterMap) RawMap ¶ added in v0.53.0
func (f FrontmatterMap) RawMap() map[string]any
RawMap returns the underlying map. Callers must not mutate the returned map. This method is intended for serialization (yaml.Marshal).
func (*FrontmatterMap) Set ¶ added in v0.53.0
func (f *FrontmatterMap) Set(key string, value any)
Set stores value under key. A nil value is equivalent to Delete.
type Goal ¶
type Goal struct {
GoalFrontmatter
FileMetadata
// Content is the full markdown content including the frontmatter block.
Content Content
// Tasks holds checkbox items parsed from content.
// It is populated by the storage layer and is NOT stored in frontmatter.
Tasks []CheckboxItem
}
Goal represents a goal in the Obsidian vault. Frontmatter is stored in GoalFrontmatter (a typed map wrapper that preserves unknown fields). Filesystem metadata is in the embedded FileMetadata.
type GoalFrontmatter ¶ added in v0.55.0
type GoalFrontmatter struct {
FrontmatterMap
}
GoalFrontmatter holds the YAML frontmatter for a Goal. It uses FrontmatterMap as its backing store so unknown fields survive round-trips.
func NewGoalFrontmatter ¶ added in v0.55.0
func NewGoalFrontmatter(data map[string]any) GoalFrontmatter
NewGoalFrontmatter constructs a GoalFrontmatter from a raw map.
func (GoalFrontmatter) Assignee ¶ added in v0.55.0
func (f GoalFrontmatter) Assignee() string
Assignee reads "assignee" key.
func (GoalFrontmatter) ClaudeSessionID ¶ added in v0.99.0
func (f GoalFrontmatter) ClaudeSessionID() string
ClaudeSessionID reads "claude_session_id" key as string.
func (*GoalFrontmatter) ClearClaudeSessionID ¶ added in v0.99.0
func (f *GoalFrontmatter) ClearClaudeSessionID()
ClearClaudeSessionID removes the claude_session_id key from the map.
func (*GoalFrontmatter) ClearField ¶ added in v0.55.0
func (f *GoalFrontmatter) ClearField(key string)
ClearField removes a frontmatter field by key.
func (GoalFrontmatter) Completed ¶ added in v0.55.0
func (f GoalFrontmatter) Completed() *libtime.Date
Completed reads "completed" key as *libtime.Date.
func (GoalFrontmatter) DeferDate ¶ added in v0.55.0
func (f GoalFrontmatter) DeferDate() *libtime.DateOrDateTime
DeferDate reads "defer_date" key as *libtime.DateOrDateTime.
func (GoalFrontmatter) GetField ¶ added in v0.55.0
func (f GoalFrontmatter) GetField(key string) string
GetField returns the string representation of any frontmatter field by key.
func (GoalFrontmatter) PageType ¶ added in v0.55.0
func (f GoalFrontmatter) PageType() string
PageType reads "page_type" key.
func (GoalFrontmatter) Phase ¶ added in v0.100.0
func (f GoalFrontmatter) Phase() *GoalPhase
Phase reads "phase" key as string, returns *GoalPhase. Returns nil when the key is absent. The raw value is returned as-is (no validation, no default substitution) so legacy/hand-typed values survive display.
func (GoalFrontmatter) Priority ¶ added in v0.55.0
func (f GoalFrontmatter) Priority() Priority
Priority reads "priority" key as int.
func (*GoalFrontmatter) SetAssignee ¶ added in v0.55.0
func (f *GoalFrontmatter) SetAssignee(v string)
SetAssignee stores the assignee in the map.
func (*GoalFrontmatter) SetClaudeSessionID ¶ added in v0.99.0
func (f *GoalFrontmatter) SetClaudeSessionID(v string)
SetClaudeSessionID stores the claude_session_id in the map.
func (*GoalFrontmatter) SetCompleted ¶ added in v0.55.0
func (f *GoalFrontmatter) SetCompleted(d *libtime.Date)
SetCompleted stores the completed date in the map. Deletes key if d is nil.
func (*GoalFrontmatter) SetDeferDate ¶ added in v0.55.0
func (f *GoalFrontmatter) SetDeferDate(d *libtime.DateOrDateTime)
SetDeferDate stores the defer_date in the map. Deletes key if d is nil.
func (*GoalFrontmatter) SetField ¶ added in v0.55.0
func (f *GoalFrontmatter) SetField(ctx context.Context, key, value string) error
SetField sets a frontmatter field by key from a string value.
func (*GoalFrontmatter) SetPageType ¶ added in v0.55.0
func (f *GoalFrontmatter) SetPageType(v string)
SetPageType stores the page_type in the map.
func (*GoalFrontmatter) SetPhase ¶ added in v0.100.0
func (f *GoalFrontmatter) SetPhase(p *GoalPhase)
SetPhase stores the phase pointer in the map. Deletes the key if p is nil.
func (*GoalFrontmatter) SetPriority ¶ added in v0.55.0
func (f *GoalFrontmatter) SetPriority(ctx context.Context, p Priority) error
SetPriority validates the priority and stores it in the map.
func (*GoalFrontmatter) SetStartDate ¶ added in v0.55.0
func (f *GoalFrontmatter) SetStartDate(d *libtime.DateOrDateTime)
SetStartDate stores the start_date in the map. Deletes key if d is nil.
func (*GoalFrontmatter) SetStatus ¶ added in v0.55.0
func (f *GoalFrontmatter) SetStatus(s GoalStatus) error
SetStatus validates and stores the status in the map. The aborted transition is a close-out and is rejected unless the frontmatter already holds a non-empty aborted_reason AND a non-empty gate_successor; completed never consults the close-out fields (spec 039). The rejection is raised before any write, so the frontmatter is left unchanged.
func (*GoalFrontmatter) SetTags ¶ added in v0.55.0
func (f *GoalFrontmatter) SetTags(v []string)
SetTags stores tags in the map. Deletes key if v is nil or empty.
func (*GoalFrontmatter) SetTargetDate ¶ added in v0.55.0
func (f *GoalFrontmatter) SetTargetDate(d *libtime.DateOrDateTime)
SetTargetDate stores the target_date in the map. Deletes key if d is nil.
func (*GoalFrontmatter) SetTheme ¶ added in v0.55.0
func (f *GoalFrontmatter) SetTheme(v string)
SetTheme stores the theme in the map.
func (GoalFrontmatter) StartDate ¶ added in v0.55.0
func (f GoalFrontmatter) StartDate() *libtime.DateOrDateTime
StartDate reads "start_date" as *libtime.DateOrDateTime. Handles both time.Time (YAML-parsed) and string (hand-authored) forms. Returns nil on missing or unparseable value.
func (GoalFrontmatter) Status ¶ added in v0.55.0
func (f GoalFrontmatter) Status() GoalStatus
Status reads "status" key.
func (GoalFrontmatter) Tags ¶ added in v0.55.0
func (f GoalFrontmatter) Tags() []string
Tags reads "tags" key via GetStringSlice.
func (GoalFrontmatter) TargetDate ¶ added in v0.55.0
func (f GoalFrontmatter) TargetDate() *libtime.DateOrDateTime
TargetDate reads "target_date" as *libtime.DateOrDateTime. Handles both time.Time (YAML-parsed) and string (hand-authored) forms. Returns nil on missing or unparseable value.
func (GoalFrontmatter) Theme ¶ added in v0.55.0
func (f GoalFrontmatter) Theme() string
Theme reads "theme" key.
type GoalID ¶
type GoalID string
GoalID represents a goal identifier (filename without .md extension).
type GoalPhase ¶ added in v0.100.0
type GoalPhase string
GoalPhase represents a phase in a goal's lifecycle.
const ( // GoalPhaseTodo means the goal is ready to start but needs planning. GoalPhaseTodo GoalPhase = "todo" // GoalPhasePlanning means the approach is being designed. GoalPhasePlanning GoalPhase = "planning" // GoalPhaseExecution means active work is underway. GoalPhaseExecution GoalPhase = "execution" // GoalPhaseDone means the goal is ready to close. GoalPhaseDone GoalPhase = "done" )
type GoalPhases ¶ added in v0.100.0
type GoalPhases []GoalPhase
GoalPhases is a collection of GoalPhase values.
func (GoalPhases) Contains ¶ added in v0.100.0
func (g GoalPhases) Contains(phase GoalPhase) bool
Contains returns true if the collection contains the given phase.
type GoalStatus ¶
type GoalStatus string
GoalStatus represents the status of a goal.
The enum is aligned with the task status taxonomy so a single mental model and a single UI control set (e.g. task-orchestrator's Kanban columns) can act on both tasks and goals. The original 3 values (active, completed, on_hold) are retained as accepted aliases for backward compatibility with existing goal files: active ↔ in_progress semantically, on_hold ↔ hold semantically. New writes from agents are expected to use the new canonical values; reads tolerate both.
const ( GoalStatusNext GoalStatus = "next" GoalStatusInProgress GoalStatus = "in_progress" GoalStatusBacklog GoalStatus = "backlog" GoalStatusCompleted GoalStatus = "completed" GoalStatusHold GoalStatus = "hold" GoalStatusAborted GoalStatus = "aborted" // Legacy values — accepted on read + write for backward compatibility. // New code should prefer GoalStatusInProgress / GoalStatusHold. GoalStatusActive GoalStatus = "active" GoalStatusOnHold GoalStatus = "on_hold" )
type GoalStatuses ¶ added in v0.55.0
type GoalStatuses []GoalStatus
GoalStatuses is a collection of GoalStatus values.
func (GoalStatuses) Contains ¶ added in v0.55.0
func (g GoalStatuses) Contains(status GoalStatus) bool
Contains returns true if the collection contains the given status.
type MetricsCycle ¶ added in v0.116.0
type MetricsCycle struct {
StartedAt libtime.DateOrDateTime `yaml:"started_at" json:"started_at"`
CompletedAt libtime.DateOrDateTime `yaml:"completed_at" json:"completed_at"`
InteractionCount int `yaml:"interaction_count" json:"interaction_count"`
}
MetricsCycle archives one finished cycle of a recurring task: when it ran, when it ended, and how many user interactions it had.
type MetricsSession ¶ added in v0.116.0
type MetricsSession struct {
SessionID string `yaml:"session_id" json:"session_id"`
StartedAt libtime.DateOrDateTime `yaml:"started_at" json:"started_at"`
}
MetricsSession records one work-on run: the Claude session it started and when.
type Objective ¶ added in v0.29.0
type Objective struct {
ObjectiveFrontmatter
FileMetadata
// Content is the full markdown content including the frontmatter block.
Content Content
}
Objective represents an objective in the Obsidian vault. Frontmatter is stored in ObjectiveFrontmatter (a typed map wrapper that preserves unknown fields). Filesystem metadata is in the embedded FileMetadata.
func NewObjective ¶ added in v0.55.0
func NewObjective(data map[string]any, meta FileMetadata, content Content) *Objective
NewObjective creates an Objective from a parsed frontmatter map and metadata.
type ObjectiveFrontmatter ¶ added in v0.55.0
type ObjectiveFrontmatter struct {
FrontmatterMap
}
ObjectiveFrontmatter holds the YAML frontmatter for an Objective. It uses FrontmatterMap as its backing store so unknown fields survive round-trips.
func NewObjectiveFrontmatter ¶ added in v0.55.0
func NewObjectiveFrontmatter(data map[string]any) ObjectiveFrontmatter
NewObjectiveFrontmatter constructs an ObjectiveFrontmatter from a raw map.
func (ObjectiveFrontmatter) Assignee ¶ added in v0.55.0
func (f ObjectiveFrontmatter) Assignee() string
Assignee reads "assignee" key.
func (*ObjectiveFrontmatter) ClearField ¶ added in v0.55.0
func (f *ObjectiveFrontmatter) ClearField(key string)
ClearField removes a frontmatter field by key.
func (ObjectiveFrontmatter) Completed ¶ added in v0.55.0
func (f ObjectiveFrontmatter) Completed() *libtime.Date
Completed reads "completed" key as *libtime.Date.
func (ObjectiveFrontmatter) GetField ¶ added in v0.55.0
func (f ObjectiveFrontmatter) GetField(key string) string
GetField returns the string representation of any frontmatter field by key.
func (ObjectiveFrontmatter) PageType ¶ added in v0.55.0
func (f ObjectiveFrontmatter) PageType() string
PageType reads "page_type" key.
func (ObjectiveFrontmatter) Priority ¶ added in v0.55.0
func (f ObjectiveFrontmatter) Priority() Priority
Priority reads "priority" key as int.
func (*ObjectiveFrontmatter) SetAssignee ¶ added in v0.55.0
func (f *ObjectiveFrontmatter) SetAssignee(v string)
SetAssignee stores the assignee in the map.
func (*ObjectiveFrontmatter) SetCompleted ¶ added in v0.55.0
func (f *ObjectiveFrontmatter) SetCompleted(d *libtime.Date)
SetCompleted stores the completed date in the map. Deletes key if d is nil.
func (*ObjectiveFrontmatter) SetField ¶ added in v0.55.0
func (f *ObjectiveFrontmatter) SetField(ctx context.Context, key, value string) error
SetField sets a frontmatter field by key from a string value.
func (*ObjectiveFrontmatter) SetPageType ¶ added in v0.55.0
func (f *ObjectiveFrontmatter) SetPageType(v string)
SetPageType stores the page_type in the map.
func (*ObjectiveFrontmatter) SetPriority ¶ added in v0.55.0
func (f *ObjectiveFrontmatter) SetPriority(ctx context.Context, p Priority) error
SetPriority validates the priority and stores it in the map.
func (*ObjectiveFrontmatter) SetStartDate ¶ added in v0.55.0
func (f *ObjectiveFrontmatter) SetStartDate(d *libtime.DateOrDateTime)
SetStartDate stores the start_date in the map. Deletes key if d is nil.
func (*ObjectiveFrontmatter) SetStatus ¶ added in v0.55.0
func (f *ObjectiveFrontmatter) SetStatus(s ObjectiveStatus) error
SetStatus validates and stores the status in the map.
func (*ObjectiveFrontmatter) SetTags ¶ added in v0.55.0
func (f *ObjectiveFrontmatter) SetTags(v []string)
SetTags stores tags in the map. Deletes key if v is nil or empty.
func (*ObjectiveFrontmatter) SetTargetDate ¶ added in v0.55.0
func (f *ObjectiveFrontmatter) SetTargetDate(d *libtime.DateOrDateTime)
SetTargetDate stores the target_date in the map. Deletes key if d is nil.
func (ObjectiveFrontmatter) StartDate ¶ added in v0.55.0
func (f ObjectiveFrontmatter) StartDate() *libtime.DateOrDateTime
StartDate reads "start_date" as *libtime.DateOrDateTime. Handles both time.Time (YAML-parsed) and string (hand-authored) forms. Returns nil on missing or unparseable value.
func (ObjectiveFrontmatter) Status ¶ added in v0.55.0
func (f ObjectiveFrontmatter) Status() ObjectiveStatus
Status reads "status" key.
func (ObjectiveFrontmatter) Tags ¶ added in v0.55.0
func (f ObjectiveFrontmatter) Tags() []string
Tags reads "tags" key via GetStringSlice.
func (ObjectiveFrontmatter) TargetDate ¶ added in v0.55.0
func (f ObjectiveFrontmatter) TargetDate() *libtime.DateOrDateTime
TargetDate reads "target_date" as *libtime.DateOrDateTime. Handles both time.Time (YAML-parsed) and string (hand-authored) forms. Returns nil on missing or unparseable value.
type ObjectiveID ¶ added in v0.29.0
type ObjectiveID string
ObjectiveID represents an objective identifier (filename without .md extension).
func (ObjectiveID) String ¶ added in v0.29.0
func (o ObjectiveID) String() string
type ObjectiveStatus ¶ added in v0.29.0
type ObjectiveStatus string
ObjectiveStatus represents the status of an objective.
const ( ObjectiveStatusActive ObjectiveStatus = "active" ObjectiveStatusCompleted ObjectiveStatus = "completed" ObjectiveStatusOnHold ObjectiveStatus = "on_hold" )
type ObjectiveStatuses ¶ added in v0.55.0
type ObjectiveStatuses []ObjectiveStatus
ObjectiveStatuses is a collection of ObjectiveStatus values.
func (ObjectiveStatuses) Contains ¶ added in v0.55.0
func (o ObjectiveStatuses) Contains(status ObjectiveStatus) bool
Contains returns true if the collection contains the given status.
type Page ¶ added in v0.92.1
type Page struct {
FrontmatterMap
FileMetadata
Content
}
Page represents a page in the Obsidian vault with shared frontmatter fields. It is used by the storage layer to list pages from any directory (tasks, goals, themes, objectives, visions) without a type contract violation. Entity-specific types (Task, Goal, Theme, etc.) embed their own XxxFrontmatter; Page uses the generic FrontmatterMap so any entity can be read through it without field loss.
func NewPage ¶ added in v0.92.1
func NewPage(data map[string]any, meta FileMetadata, content Content) *Page
NewPage creates a Page from a parsed frontmatter map and metadata.
func (Page) ClaudeSessionID ¶ added in v0.92.1
ClaudeSessionID reads "claude_session_id" key as string.
func (Page) CompletedDate ¶ added in v0.92.1
func (p Page) CompletedDate() *libtime.DateOrDateTime
CompletedDate reads "completed_date" as *libtime.DateOrDateTime. Handles both time.Time (YAML-parsed) and string (hand-authored) forms. Returns nil on missing or unparseable value.
func (Page) DeferDate ¶ added in v0.92.1
func (p Page) DeferDate() *libtime.DateOrDateTime
DeferDate reads "defer_date" key as *libtime.DateOrDateTime. Handles both time.Time (YAML-parsed) and string (hand-authored) forms. Returns nil on missing or unparseable value.
func (Page) DueDate ¶ added in v0.92.1
func (p Page) DueDate() *libtime.DateOrDateTime
DueDate reads "due_date" key as *libtime.DateOrDateTime. Handles both time.Time (YAML-parsed) and string (hand-authored) forms. Returns nil on missing or unparseable value.
func (Page) ModifiedDateFromPage ¶ added in v0.92.1
ModifiedDateFromPage is a convenience accessor for the embedded FileMetadata.ModifiedDate. Deprecated: use page.ModifiedDate directly (accessible via struct embedding).
func (Page) PlannedDate ¶ added in v0.92.1
func (p Page) PlannedDate() *libtime.DateOrDateTime
PlannedDate reads "planned_date" key as *libtime.DateOrDateTime. Handles both time.Time (YAML-parsed) and string (hand-authored) forms. Returns nil on missing or unparseable value.
func (Page) Priority ¶ added in v0.92.1
Priority reads "priority" key as int. Returns 0 on missing or parse failure.
func (*Page) SetDeferDate ¶ added in v0.92.1
func (p *Page) SetDeferDate(d *libtime.DateOrDateTime)
SetDeferDate stores the defer_date in the map. Deletes the key if d is nil.
func (*Page) SetDueDate ¶ added in v0.92.1
func (p *Page) SetDueDate(d *libtime.DateOrDateTime)
SetDueDate stores the due_date in the map. Deletes the key if d is nil.
func (*Page) SetGoals ¶ added in v0.92.1
SetGoals stores goals in the map. Deletes the key if v is nil or empty.
func (*Page) SetPlannedDate ¶ added in v0.92.1
func (p *Page) SetPlannedDate(d *libtime.DateOrDateTime)
SetPlannedDate stores the planned_date in the map. Deletes the key if d is nil.
func (*Page) SetPriority ¶ added in v0.92.1
SetPriority validates the priority and stores it in the map.
func (Page) Status ¶ added in v0.92.1
func (p Page) Status() TaskStatus
Status reads "status" key and applies NormalizeTaskStatus. Returns "" (empty) if value is absent or unrecognized.
type Priority ¶ added in v0.4.0
type Priority int
Priority represents a task priority value. Valid values are integers >= 0, or -1 for invalid/unparseable values.
func (*Priority) UnmarshalYAML ¶ added in v0.4.0
UnmarshalYAML implements custom YAML unmarshaling for Priority. If the value is a valid int, use it. Otherwise, set to -1 (invalid). This makes priority parsing non-fatal - files with string priority values won't cause YAML unmarshal to fail.
func (Priority) Validate ¶ added in v0.54.0
Validate returns an error if the priority value is invalid. Valid priorities are non-negative integers (0 and up). The sentinel value -1 (used by UnmarshalYAML for unparseable YAML values) is treated as invalid here because any explicit SetPriority call with a negative value is a user error.
type RecurringInterval ¶ added in v0.12.0
RecurringInterval represents a time interval for recurring tasks.
func ParseRecurringInterval ¶ added in v0.12.0
func ParseRecurringInterval(ctx context.Context, s string) (RecurringInterval, error)
ParseRecurringInterval parses a recurring interval string into a RecurringInterval. Named aliases: daily, weekly, monthly, quarterly, yearly. Numeric shorthand: <N><unit> where unit is d, w, m, q, or y. Note: "weekdays" is NOT handled here — check for it before calling this function.
func ParseRecurringIntervalDefault ¶ added in v0.106.2
func ParseRecurringIntervalDefault( ctx context.Context, s string, def RecurringInterval, ) (RecurringInterval, bool)
ParseRecurringIntervalDefault parses s and returns def when s cannot be parsed. The second return value reports whether s parsed successfully, so callers can report the fallback without parsing a second time.
type ResolveResult ¶ added in v0.95.0
type ResolveResult struct {
// Type is "task", "goal", or "" (empty string when not found).
Type string `json:"type"`
// Name echoes the input name that was resolved.
Name string `json:"name"`
// Found reports whether the name matched a task or a goal.
Found bool `json:"found"`
}
ResolveResult is the outcome of resolving a name to a task, a goal, or neither. It is the JSON contract consumed by slash commands to auto-detect entity type.
type Task ¶
type Task struct {
TaskFrontmatter
FileMetadata
// Content is the full markdown content including the frontmatter block.
// It is used by the storage layer to extract the markdown body on write.
Content Content
}
Task represents a task in the Obsidian vault. Frontmatter is stored in TaskFrontmatter (a typed map wrapper that preserves unknown fields). Filesystem metadata is in the embedded FileMetadata.
type TaskFrontmatter ¶ added in v0.54.0
type TaskFrontmatter struct {
FrontmatterMap
}
TaskFrontmatter holds the YAML frontmatter for a Task. It uses FrontmatterMap as its backing store so unknown fields survive round-trips.
func NewTaskFrontmatter ¶ added in v0.54.0
func NewTaskFrontmatter(data map[string]any) TaskFrontmatter
NewTaskFrontmatter constructs a TaskFrontmatter from a raw map.
func (*TaskFrontmatter) AppendMetricsCycle ¶ added in v0.116.0
func (f *TaskFrontmatter) AppendMetricsCycle(cycle MetricsCycle)
AppendMetricsCycle appends one archived cycle to "metrics_cycles", preserving every prior entry.
func (*TaskFrontmatter) AppendMetricsSession ¶ added in v0.116.0
func (f *TaskFrontmatter) AppendMetricsSession(entry MetricsSession)
AppendMetricsSession appends one entry to "metrics_sessions", preserving every prior entry. A nil or empty SessionID is ignored (not appended).
func (TaskFrontmatter) Assignee ¶ added in v0.54.0
func (f TaskFrontmatter) Assignee() string
Assignee reads "assignee" key as string.
func (TaskFrontmatter) ClaudeSessionID ¶ added in v0.54.0
func (f TaskFrontmatter) ClaudeSessionID() string
ClaudeSessionID reads "claude_session_id" key as string.
func (*TaskFrontmatter) ClearClaudeSessionID ¶ added in v0.67.6
func (f *TaskFrontmatter) ClearClaudeSessionID()
ClearClaudeSessionID removes the claude_session_id key from the map. Distinct from SetClaudeSessionID("") on purpose: the string setter keeps store-empty-string semantics so existing callers are unaffected; this method deletes the key entirely, which is required when resetting a recurring task so the next occurrence gets a fresh session ID.
func (*TaskFrontmatter) ClearField ¶ added in v0.54.0
func (f *TaskFrontmatter) ClearField(key string)
ClearField removes a frontmatter field by key. Works for both known and unknown fields.
func (*TaskFrontmatter) ClearMetricsCompletedAt ¶ added in v0.116.0
func (f *TaskFrontmatter) ClearMetricsCompletedAt()
ClearMetricsCompletedAt removes the "metrics_completed_at" key entirely.
func (*TaskFrontmatter) ClearMetricsInteractionCount ¶ added in v0.116.0
func (f *TaskFrontmatter) ClearMetricsInteractionCount()
ClearMetricsInteractionCount removes the "metrics_interaction_count" key entirely.
func (*TaskFrontmatter) ClearMetricsSessions ¶ added in v0.116.0
func (f *TaskFrontmatter) ClearMetricsSessions()
ClearMetricsSessions removes the "metrics_sessions" key entirely.
func (TaskFrontmatter) CompletedDate ¶ added in v0.54.0
func (f TaskFrontmatter) CompletedDate() *libtime.DateOrDateTime
CompletedDate reads "completed_date" as *libtime.DateOrDateTime. Handles both time.Time (YAML-parsed) and string (hand-authored) forms. Returns nil on missing or unparseable value.
func (TaskFrontmatter) CreatedDate ¶ added in v0.59.0
func (f TaskFrontmatter) CreatedDate() *libtime.DateOrDateTime
CreatedDate reads "created_date" as *libtime.DateOrDateTime. Returns nil on missing or unparseable value.
func (TaskFrontmatter) DeferDate ¶ added in v0.54.0
func (f TaskFrontmatter) DeferDate() *libtime.DateOrDateTime
DeferDate reads "defer_date" key as *libtime.DateOrDateTime. Handles both time.Time (YAML-parsed) and string (hand-authored) forms. Returns nil on missing or unparseable value.
func (TaskFrontmatter) DueDate ¶ added in v0.54.0
func (f TaskFrontmatter) DueDate() *libtime.DateOrDateTime
DueDate reads "due_date" key as *libtime.DateOrDateTime. Handles both time.Time (YAML-parsed) and string (hand-authored) forms. Returns nil on missing or unparseable value.
func (TaskFrontmatter) GetField ¶ added in v0.54.0
func (f TaskFrontmatter) GetField(key string) string
GetField returns the string representation of any frontmatter field by key. Known fields return formatted values. Unknown fields return the raw string. Returns "" if the key is absent.
func (TaskFrontmatter) Goals ¶ added in v0.54.0
func (f TaskFrontmatter) Goals() []string
Goals reads "goals" key via GetStringSlice.
func (TaskFrontmatter) LastCompleted ¶ added in v0.54.0
func (f TaskFrontmatter) LastCompleted() string
LastCompleted reads "last_completed" (legacy) or "last_completed_date" (canonical) as a formatted date string. Kept for backward compatibility.
func (TaskFrontmatter) LastCompletedDate ¶ added in v0.59.0
func (f TaskFrontmatter) LastCompletedDate() *libtime.DateOrDateTime
LastCompletedDate reads "last_completed_date" as *libtime.DateOrDateTime. Falls back to the legacy "last_completed" key for backward compatibility. Returns nil on missing or unparseable value.
func (TaskFrontmatter) MetricsCompletedAt ¶ added in v0.116.0
func (f TaskFrontmatter) MetricsCompletedAt() *libtime.DateOrDateTime
MetricsCompletedAt reads "metrics_completed_at" as *libtime.DateOrDateTime. Returns nil when the key is absent or the value is unparseable.
func (TaskFrontmatter) MetricsCycles ¶ added in v0.116.0
func (f TaskFrontmatter) MetricsCycles() []MetricsCycle
MetricsCycles reads "metrics_cycles" as a slice of MetricsCycle. Returns nil when the key is absent, the value is not a list, or every element is malformed.
func (TaskFrontmatter) MetricsInteractionCount ¶ added in v0.116.0
func (f TaskFrontmatter) MetricsInteractionCount() *int
MetricsInteractionCount reads "metrics_interaction_count" as *int. Returns nil when the key is absent or the value is not a number — "unknown" must never be forged as 0.
func (TaskFrontmatter) MetricsSessions ¶ added in v0.116.0
func (f TaskFrontmatter) MetricsSessions() []MetricsSession
MetricsSessions reads the "metrics_sessions" field as a slice of MetricsSession. Returns nil when the key is absent, the value is not a list, or every element is malformed.
func (TaskFrontmatter) PageType ¶ added in v0.54.0
func (f TaskFrontmatter) PageType() string
PageType reads "page_type" key, returns string.
func (TaskFrontmatter) Phase ¶ added in v0.54.0
func (f TaskFrontmatter) Phase() *TaskPhase
Phase reads "phase" key as string, returns *TaskPhase.
func (TaskFrontmatter) PlannedDate ¶ added in v0.54.0
func (f TaskFrontmatter) PlannedDate() *libtime.DateOrDateTime
PlannedDate reads "planned_date" key as *libtime.DateOrDateTime. Handles both time.Time (YAML-parsed) and string (hand-authored) forms. Returns nil on missing or unparseable value.
func (TaskFrontmatter) Priority ¶ added in v0.54.0
func (f TaskFrontmatter) Priority() Priority
Priority reads "priority" key as int. Returns 0 on missing or parse failure.
func (TaskFrontmatter) Recurring ¶ added in v0.54.0
func (f TaskFrontmatter) Recurring() string
Recurring reads "recurring" key as string.
func (*TaskFrontmatter) SetAssignee ¶ added in v0.54.0
func (f *TaskFrontmatter) SetAssignee(v string)
SetAssignee stores the assignee in the map.
func (*TaskFrontmatter) SetClaudeSessionID ¶ added in v0.54.0
func (f *TaskFrontmatter) SetClaudeSessionID(v string)
SetClaudeSessionID stores the claude_session_id in the map.
func (*TaskFrontmatter) SetCompletedDate ¶ added in v0.54.0
func (f *TaskFrontmatter) SetCompletedDate(d *libtime.DateOrDateTime)
SetCompletedDate stores the completed_date in the map. Deletes the key if d is nil.
func (*TaskFrontmatter) SetCreatedDate ¶ added in v0.59.0
func (f *TaskFrontmatter) SetCreatedDate(d *libtime.DateOrDateTime)
SetCreatedDate stores the created_date in the map. Deletes the key if d is nil.
func (*TaskFrontmatter) SetDeferDate ¶ added in v0.54.0
func (f *TaskFrontmatter) SetDeferDate(d *libtime.DateOrDateTime)
SetDeferDate stores the defer_date in the map. Deletes the key if d is nil.
func (*TaskFrontmatter) SetDueDate ¶ added in v0.54.0
func (f *TaskFrontmatter) SetDueDate(d *libtime.DateOrDateTime)
SetDueDate stores the due_date in the map. Deletes the key if d is nil.
func (*TaskFrontmatter) SetField ¶ added in v0.54.0
func (f *TaskFrontmatter) SetField(ctx context.Context, key, value string) error
SetField sets a frontmatter field by key from a string value. Known fields apply type coercion and validation; unknown fields are stored as-is.
func (*TaskFrontmatter) SetGoals ¶ added in v0.54.0
func (f *TaskFrontmatter) SetGoals(v []string)
SetGoals stores goals in the map. Deletes the key if v is nil or empty.
func (*TaskFrontmatter) SetLastCompleted ¶ added in v0.54.0
func (f *TaskFrontmatter) SetLastCompleted(v string)
SetLastCompleted stores the last_completed value. Kept for backward compatibility. Delegates to SetLastCompletedDate for dual-write behavior.
func (*TaskFrontmatter) SetLastCompletedDate ¶ added in v0.59.0
func (f *TaskFrontmatter) SetLastCompletedDate(d *libtime.DateOrDateTime)
SetLastCompletedDate stores the last_completed_date in the map. Dual-writes to both "last_completed_date" (canonical) and "last_completed" (legacy) for one release cycle to allow external consumers to migrate. Deletes both keys if d is nil.
func (*TaskFrontmatter) SetMetricsCompletedAt ¶ added in v0.116.0
func (f *TaskFrontmatter) SetMetricsCompletedAt(d *libtime.DateOrDateTime)
SetMetricsCompletedAt stores "metrics_completed_at". A nil argument deletes the key.
func (*TaskFrontmatter) SetMetricsInteractionCount ¶ added in v0.116.0
func (f *TaskFrontmatter) SetMetricsInteractionCount(count int)
SetMetricsInteractionCount stores "metrics_interaction_count".
func (*TaskFrontmatter) SetPageType ¶ added in v0.54.0
func (f *TaskFrontmatter) SetPageType(v string)
SetPageType stores the page_type in the map.
func (*TaskFrontmatter) SetPhase ¶ added in v0.54.0
func (f *TaskFrontmatter) SetPhase(p *TaskPhase)
SetPhase stores the phase pointer in the map. Deletes the key if p is nil.
func (*TaskFrontmatter) SetPlannedDate ¶ added in v0.54.0
func (f *TaskFrontmatter) SetPlannedDate(d *libtime.DateOrDateTime)
SetPlannedDate stores the planned_date in the map. Deletes the key if d is nil.
func (*TaskFrontmatter) SetPriority ¶ added in v0.54.0
func (f *TaskFrontmatter) SetPriority(ctx context.Context, p Priority) error
SetPriority validates the priority and stores it in the map. Returns an error when the value is negative, per spec AC #6.
func (*TaskFrontmatter) SetRecurring ¶ added in v0.54.0
func (f *TaskFrontmatter) SetRecurring(v string)
SetRecurring stores the recurring value in the map.
func (*TaskFrontmatter) SetStatus ¶ added in v0.54.0
func (f *TaskFrontmatter) SetStatus(s TaskStatus) error
SetStatus validates and stores the status in the map. The aborted transition is a close-out and is rejected unless the frontmatter already holds a non-empty aborted_reason AND a non-empty gate_successor; completed never consults the close-out fields (spec 039). The rejection is raised before any write, so the frontmatter is left unchanged.
func (*TaskFrontmatter) SetTags ¶ added in v0.54.0
func (f *TaskFrontmatter) SetTags(v []string)
SetTags stores tags in the map. Deletes the key if v is nil or empty.
func (*TaskFrontmatter) SetTaskIdentifier ¶ added in v0.54.0
func (f *TaskFrontmatter) SetTaskIdentifier(v string)
SetTaskIdentifier stores the task_identifier value in the map.
func (TaskFrontmatter) Status ¶ added in v0.54.0
func (f TaskFrontmatter) Status() TaskStatus
Status reads "status" key and applies NormalizeTaskStatus. Returns "" (empty) if value is absent or unrecognized.
func (TaskFrontmatter) Tags ¶ added in v0.54.0
func (f TaskFrontmatter) Tags() []string
Tags reads "tags" key via GetStringSlice.
func (TaskFrontmatter) TaskIdentifier ¶ added in v0.54.0
func (f TaskFrontmatter) TaskIdentifier() string
TaskIdentifier reads "task_identifier" key as string.
type TaskID ¶
type TaskID string
TaskID represents a task identifier (filename without .md extension).
type TaskPhase ¶ added in v0.46.0
type TaskPhase string
TaskPhase represents a phase in a task's lifecycle.
const ( // TaskPhaseTodo means the task is ready to start but needs planning. TaskPhaseTodo TaskPhase = "todo" // TaskPhasePlanning means the approach is being designed. TaskPhasePlanning TaskPhase = "planning" // TaskPhaseExecution means active implementation is underway. // This is the canonical value; "in_progress" is accepted as an alias via NormalizeTaskPhase. TaskPhaseExecution TaskPhase = "execution" // TaskPhaseInProgress is an alias for TaskPhaseExecution kept for backward compatibility. // Existing vault files with phase: "in_progress" continue to read and validate via NormalizeTaskPhase. // Do not use TaskPhaseInProgress for new writes — use TaskPhaseExecution. TaskPhaseInProgress TaskPhase = "in_progress" // TaskPhaseAIReview means automated checks are running. TaskPhaseAIReview TaskPhase = "ai_review" // TaskPhaseHumanReview means manual review is required. TaskPhaseHumanReview TaskPhase = "human_review" // TaskPhaseDone means the task is ready to close. TaskPhaseDone TaskPhase = "done" )
func NormalizeTaskPhase ¶ added in v0.64.3
NormalizeTaskPhase converts alias phase values to their canonical form. Returns the canonical phase and true if valid, or empty and false if unknown.
type TaskPhases ¶ added in v0.46.0
type TaskPhases []TaskPhase
TaskPhases is a collection of TaskPhase values.
func (TaskPhases) Contains ¶ added in v0.46.0
func (t TaskPhases) Contains(phase TaskPhase) bool
Contains returns true if the collection contains the given phase.
type TaskStatus ¶
type TaskStatus string
TaskStatus represents the status of a task.
const ( // TaskStatusNext means the task is queued for action but not yet started. // This is the canonical value; "todo" is accepted as an alias via NormalizeTaskStatus. TaskStatusNext TaskStatus = "next" // TaskStatusTodo is an alias for TaskStatusNext kept for backward compatibility. // Existing vault files with status: "todo" continue to read and validate via NormalizeTaskStatus. // Do not use TaskStatusTodo for new writes — use TaskStatusNext. TaskStatusTodo TaskStatus = "todo" // TaskStatusInProgress means someone is actively working on the task. TaskStatusInProgress TaskStatus = "in_progress" // TaskStatusBacklog means the task is potential future work, not yet scheduled. TaskStatusBacklog TaskStatus = "backlog" // TaskStatusCompleted means the task is finished. TaskStatusCompleted TaskStatus = "completed" // TaskStatusHold means the task is blocked or paused. TaskStatusHold TaskStatus = "hold" // TaskStatusAborted means the task was cancelled and will not be completed. TaskStatusAborted TaskStatus = "aborted" )
func NormalizeTaskStatus ¶ added in v0.10.8
func NormalizeTaskStatus(raw string) (TaskStatus, bool)
NormalizeTaskStatus converts alias status values to their canonical form. Returns the canonical status and true if valid, or empty and false if unknown.
func (TaskStatus) Ptr ¶ added in v0.45.1
func (s TaskStatus) Ptr() *TaskStatus
Ptr returns a pointer to a copy of the status.
func (TaskStatus) String ¶ added in v0.45.1
func (s TaskStatus) String() string
String returns the string representation of the status.
type TaskStatuses ¶ added in v0.45.1
type TaskStatuses []TaskStatus
TaskStatuses is a collection of TaskStatus values.
func (TaskStatuses) Contains ¶ added in v0.45.1
func (t TaskStatuses) Contains(status TaskStatus) bool
Contains returns true if the collection contains the given status.
type Theme ¶
type Theme struct {
ThemeFrontmatter
FileMetadata
// Content is the full markdown content including the frontmatter block.
Content Content
}
Theme represents a theme in the Obsidian vault. Frontmatter is stored in ThemeFrontmatter (a typed map wrapper that preserves unknown fields). Filesystem metadata is in the embedded FileMetadata.
type ThemeFrontmatter ¶ added in v0.55.0
type ThemeFrontmatter struct {
FrontmatterMap
}
ThemeFrontmatter holds the YAML frontmatter for a Theme. It uses FrontmatterMap as its backing store so unknown fields survive round-trips.
func NewThemeFrontmatter ¶ added in v0.55.0
func NewThemeFrontmatter(data map[string]any) ThemeFrontmatter
NewThemeFrontmatter constructs a ThemeFrontmatter from a raw map.
func (ThemeFrontmatter) Assignee ¶ added in v0.55.0
func (f ThemeFrontmatter) Assignee() string
Assignee reads "assignee" key.
func (*ThemeFrontmatter) ClearField ¶ added in v0.55.0
func (f *ThemeFrontmatter) ClearField(key string)
ClearField removes a frontmatter field by key.
func (ThemeFrontmatter) GetField ¶ added in v0.55.0
func (f ThemeFrontmatter) GetField(key string) string
GetField returns the string representation of any frontmatter field by key.
func (ThemeFrontmatter) PageType ¶ added in v0.55.0
func (f ThemeFrontmatter) PageType() string
PageType reads "page_type" key.
func (ThemeFrontmatter) Priority ¶ added in v0.55.0
func (f ThemeFrontmatter) Priority() Priority
Priority reads "priority" key as int.
func (*ThemeFrontmatter) SetAssignee ¶ added in v0.55.0
func (f *ThemeFrontmatter) SetAssignee(v string)
SetAssignee stores the assignee in the map.
func (*ThemeFrontmatter) SetField ¶ added in v0.55.0
func (f *ThemeFrontmatter) SetField(ctx context.Context, key, value string) error
SetField sets a frontmatter field by key from a string value.
func (*ThemeFrontmatter) SetPageType ¶ added in v0.55.0
func (f *ThemeFrontmatter) SetPageType(v string)
SetPageType stores the page_type in the map.
func (*ThemeFrontmatter) SetPriority ¶ added in v0.55.0
func (f *ThemeFrontmatter) SetPriority(ctx context.Context, p Priority) error
SetPriority validates the priority and stores it in the map.
func (*ThemeFrontmatter) SetStartDate ¶ added in v0.55.0
func (f *ThemeFrontmatter) SetStartDate(d *libtime.DateOrDateTime)
SetStartDate stores the start_date in the map. Deletes key if d is nil.
func (*ThemeFrontmatter) SetStatus ¶ added in v0.55.0
func (f *ThemeFrontmatter) SetStatus(s ThemeStatus) error
SetStatus validates and stores the status in the map.
func (*ThemeFrontmatter) SetTags ¶ added in v0.55.0
func (f *ThemeFrontmatter) SetTags(v []string)
SetTags stores tags in the map. Deletes key if v is nil or empty.
func (*ThemeFrontmatter) SetTargetDate ¶ added in v0.55.0
func (f *ThemeFrontmatter) SetTargetDate(d *libtime.DateOrDateTime)
SetTargetDate stores the target_date in the map. Deletes key if d is nil.
func (ThemeFrontmatter) StartDate ¶ added in v0.55.0
func (f ThemeFrontmatter) StartDate() *libtime.DateOrDateTime
StartDate reads "start_date" as *libtime.DateOrDateTime. Handles both time.Time (YAML-parsed) and string (hand-authored) forms. Returns nil on missing or unparseable value.
func (ThemeFrontmatter) Status ¶ added in v0.55.0
func (f ThemeFrontmatter) Status() ThemeStatus
Status reads "status" key.
func (ThemeFrontmatter) Tags ¶ added in v0.55.0
func (f ThemeFrontmatter) Tags() []string
Tags reads "tags" key via GetStringSlice.
func (ThemeFrontmatter) TargetDate ¶ added in v0.55.0
func (f ThemeFrontmatter) TargetDate() *libtime.DateOrDateTime
TargetDate reads "target_date" as *libtime.DateOrDateTime. Handles both time.Time (YAML-parsed) and string (hand-authored) forms. Returns nil on missing or unparseable value.
type ThemeID ¶
type ThemeID string
ThemeID represents a theme identifier (filename without .md extension).
type ThemeStatus ¶
type ThemeStatus string
ThemeStatus represents the status of a theme.
const ( ThemeStatusActive ThemeStatus = "active" ThemeStatusCompleted ThemeStatus = "completed" ThemeStatusArchived ThemeStatus = "archived" )
type ThemeStatuses ¶ added in v0.55.0
type ThemeStatuses []ThemeStatus
ThemeStatuses is a collection of ThemeStatus values.
func (ThemeStatuses) Contains ¶ added in v0.55.0
func (t ThemeStatuses) Contains(status ThemeStatus) bool
Contains returns true if the collection contains the given status.
type Vision ¶ added in v0.29.0
type Vision struct {
VisionFrontmatter
FileMetadata
// Content is the full markdown content including the frontmatter block.
Content Content
}
Vision represents a vision in the Obsidian vault. Frontmatter is stored in VisionFrontmatter (a typed map wrapper that preserves unknown fields). Filesystem metadata is in the embedded FileMetadata.
type VisionFrontmatter ¶ added in v0.55.0
type VisionFrontmatter struct {
FrontmatterMap
}
VisionFrontmatter holds the YAML frontmatter for a Vision. It uses FrontmatterMap as its backing store so unknown fields survive round-trips.
func NewVisionFrontmatter ¶ added in v0.55.0
func NewVisionFrontmatter(data map[string]any) VisionFrontmatter
NewVisionFrontmatter constructs a VisionFrontmatter from a raw map.
func (VisionFrontmatter) Assignee ¶ added in v0.55.0
func (f VisionFrontmatter) Assignee() string
Assignee reads "assignee" key.
func (*VisionFrontmatter) ClearField ¶ added in v0.55.0
func (f *VisionFrontmatter) ClearField(key string)
ClearField removes a frontmatter field by key.
func (VisionFrontmatter) GetField ¶ added in v0.55.0
func (f VisionFrontmatter) GetField(key string) string
GetField returns the string representation of any frontmatter field by key.
func (VisionFrontmatter) PageType ¶ added in v0.55.0
func (f VisionFrontmatter) PageType() string
PageType reads "page_type" key.
func (VisionFrontmatter) Priority ¶ added in v0.55.0
func (f VisionFrontmatter) Priority() Priority
Priority reads "priority" key as int.
func (*VisionFrontmatter) SetAssignee ¶ added in v0.55.0
func (f *VisionFrontmatter) SetAssignee(v string)
SetAssignee stores the assignee in the map.
func (*VisionFrontmatter) SetField ¶ added in v0.55.0
func (f *VisionFrontmatter) SetField(ctx context.Context, key, value string) error
SetField sets a frontmatter field by key from a string value.
func (*VisionFrontmatter) SetPageType ¶ added in v0.55.0
func (f *VisionFrontmatter) SetPageType(v string)
SetPageType stores the page_type in the map.
func (*VisionFrontmatter) SetPriority ¶ added in v0.55.0
func (f *VisionFrontmatter) SetPriority(ctx context.Context, p Priority) error
SetPriority validates the priority and stores it in the map.
func (*VisionFrontmatter) SetStatus ¶ added in v0.55.0
func (f *VisionFrontmatter) SetStatus(s VisionStatus) error
SetStatus validates and stores the status in the map.
func (*VisionFrontmatter) SetTags ¶ added in v0.55.0
func (f *VisionFrontmatter) SetTags(v []string)
SetTags stores tags in the map. Deletes key if v is nil or empty.
func (VisionFrontmatter) Status ¶ added in v0.55.0
func (f VisionFrontmatter) Status() VisionStatus
Status reads "status" key.
func (VisionFrontmatter) Tags ¶ added in v0.55.0
func (f VisionFrontmatter) Tags() []string
Tags reads "tags" key via GetStringSlice.
type VisionID ¶ added in v0.29.0
type VisionID string
VisionID represents a vision identifier (filename without .md extension).
type VisionStatus ¶ added in v0.29.0
type VisionStatus string
VisionStatus represents the status of a vision.
const ( VisionStatusActive VisionStatus = "active" VisionStatusCompleted VisionStatus = "completed" VisionStatusArchived VisionStatus = "archived" )
type VisionStatuses ¶ added in v0.55.0
type VisionStatuses []VisionStatus
VisionStatuses is a collection of VisionStatus values.
func (VisionStatuses) Contains ¶ added in v0.55.0
func (v VisionStatuses) Contains(status VisionStatus) bool
Contains returns true if the collection contains the given status.
Source Files
¶
- closeout.go
- content.go
- decision.go
- file_metadata.go
- frontmatter_map.go
- goal.go
- goal_frontmatter.go
- goal_phase.go
- metrics.go
- objective.go
- objective_frontmatter.go
- page.go
- priority.go
- recurring_interval.go
- resolve_result.go
- task.go
- task_frontmatter.go
- task_frontmatter_metrics.go
- task_phase.go
- task_status.go
- theme.go
- theme_frontmatter.go
- vision.go
- vision_frontmatter.go