Documentation
¶
Index ¶
- func DetectCycles(tasks []*Task)
- func FindFiles(c *config.Config, project string) ([]string, error)
- func GetAllKeywords(c *config.Config) map[string][]string
- func GetZettelTitle(zetDir, zetID string) (string, error)
- func IsValidZettelID(id string) bool
- func RenderMarkdownDescription(description string, taskColor lipgloss.Style) string
- func SortByPriority(tasks []*Task, c *config.Config)
- func SummarizeProjects(c *config.Config) (map[string]int, error)
- func UpdateTaskStatus(t *Task, newKeyword string) error
- type CountTasksArgs
- type CountTasksResult
- type FilterTasksArgs
- type FilterTasksResult
- type GetCycleTasksArgs
- type GetCycleTasksResult
- type GetDependenciesArgs
- type GetDependenciesResult
- type GetDependentsArgs
- type GetDependentsResult
- type GetKeywordsArgs
- type GetKeywordsResult
- type GetProjectsArgs
- type GetProjectsResult
- type GetTaskArgs
- type GetTaskByIDArgs
- type GetTaskByIDResult
- type GetTaskResult
- type KeywordEntry
- type ListTasksArgs
- type ListTasksResult
- type MCPServer
- type ProjectInfo
- type SearchResult
- type SearchResultInfo
- type SearchTasksArgs
- type SearchTasksResult
- type Task
- func FilterTasks(tasks []*Task, filterString string) []*Task
- func GetDependencies(tasks []*Task, t *Task) []*Task
- func GetDependents(tasks []*Task, t *Task) []*Task
- func GetTaskByID(tasks []*Task, id string) *Task
- func ListTasks(c *config.Config, project string, showCompleted bool) ([]*Task, error)
- func ParseLine(c *config.Config, line, project, zettel, filePath string) *Task
- func ProcessFile(c *config.Config, filePath string) ([]*Task, error)
- type TaskInfo
- type UpdateTaskStatusArgs
- type UpdateTaskStatusResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetectCycles ¶
func DetectCycles(tasks []*Task)
DetectCycles finds all tasks that participate in circular dependencies. It builds a directed graph from task references and uses DFS to detect cycles. Tasks participating in cycles will have their InCycle field set to true.
func FindFiles ¶
FindFiles finds README.md files in project directories (structured mode) or all .md files in the project tree (unstructured mode)
func GetAllKeywords ¶
GetAllKeywords returns all configured keywords grouped by category
func GetZettelTitle ¶
GetZettelTitle gets the title of a zettel from its README.md file
func IsValidZettelID ¶
IsValidZettelID checks if a string is a valid zettel ID
func RenderMarkdownDescription ¶
RenderMarkdownDescription renders a task description with markdown formatting It supports bold (**text**), italic (*text*), strikethrough (~~text~~), and inline code (`code`) The raw markdown syntax is hidden in the output
Color choices: - Bold text: Uses bright white color to make it stand out - Italic text: Preserves the original text color but adds italic styling - Strikethrough text: Preserves the original text color but adds strikethrough styling - Inline code: Uses black text on white background for clear distinction
func SortByPriority ¶
SortByPriority sorts tasks by their priority order Order: In Progress (1) -> Active (2) -> Someday (3) -> Completed (4) Uses stable sort to preserve relative order of equal-priority tasks
func SummarizeProjects ¶
SummarizeProjects summarizes task counts per project
func UpdateTaskStatus ¶
UpdateTaskStatus updates the keyword of a task in its source file. It finds the line matching the task and replaces the keyword with the new one. Returns the updated line number, or an error if the task was not found.
Types ¶
type CountTasksArgs ¶
type CountTasksResult ¶
type FilterTasksArgs ¶
type FilterTasksArgs struct {
Filter string `json:"filter" jsonschema:"filter expression (e.g., '>> alice' for assignee, '#urgent' for tag, '@2025-01-15' for date)"`
Project string `json:"project,omitempty" jsonschema:"optional project name to limit filter"`
ShowCompleted bool `json:"show_completed,omitempty" jsonschema:"whether to include completed tasks (default: false)"`
}
type FilterTasksResult ¶
type GetCycleTasksArgs ¶
type GetCycleTasksArgs struct {
Project string `json:"project,omitempty" jsonschema:"optional project name to limit search"`
}
type GetCycleTasksResult ¶
type GetDependenciesArgs ¶
type GetDependenciesResult ¶
type GetDependentsArgs ¶
type GetDependentsResult ¶
type GetKeywordsArgs ¶
type GetKeywordsArgs struct{}
type GetKeywordsResult ¶
type GetProjectsArgs ¶
type GetProjectsArgs struct{}
type GetProjectsResult ¶
type GetProjectsResult struct {
Projects []ProjectInfo `json:"projects" jsonschema:"list of projects with task counts"`
Count int `json:"count" jsonschema:"total number of projects"`
}
type GetTaskArgs ¶
type GetTaskByIDArgs ¶
type GetTaskByIDResult ¶
type GetTaskResult ¶
type KeywordEntry ¶
GetAllKeywordsFlat returns all configured keywords as a flat slice with category labels
func GetAllKeywordsFlat ¶
func GetAllKeywordsFlat(c *config.Config) []KeywordEntry
type ListTasksArgs ¶
type ListTasksResult ¶
type MCPServer ¶
type MCPServer struct {
// contains filtered or unexported fields
}
MCPServer wraps the MCP server with task operations
func NewMCPServer ¶
NewMCPServer creates a new MCP server for task operations
type ProjectInfo ¶
type SearchResult ¶
type SearchResult struct {
ZettelID string
Title string
LineNum int
Line string
Path string
Project string
}
SearchResult represents a search result from file content
func SearchInFile ¶
func SearchInFile(filePath, searchTerm string) []SearchResult
SearchInFile searches for a term within a file and returns matching lines
func SearchTasks ¶
SearchTasks searches for a term across all task files
type SearchResultInfo ¶
type SearchResultInfo struct {
Project string `json:"project" jsonschema:"project name"`
ZettelID string `json:"zettel_id,omitempty" jsonschema:"zettel ID (if structured mode)"`
Title string `json:"title" jsonschema:"file/zettel title"`
LineNum int `json:"line_num" jsonschema:"line number of the match"`
Line string `json:"line" jsonschema:"the matching line"`
Path string `json:"path" jsonschema:"file path"`
}
type SearchTasksArgs ¶
type SearchTasksResult ¶
type SearchTasksResult struct {
Results []SearchResultInfo `json:"results" jsonschema:"list of search results"`
Count int `json:"count" jsonschema:"total number of matches"`
}
type Task ¶
type Task struct {
Keyword string
ID string // Optional unique identifier [id]
Title string
Tag string
References []string // IDs of tasks this task depends on (^id syntax)
ScheduledAt string // @date or @s:date (scheduled date)
DueAt string // @d:date (due date)
Assignee string
Project string
Zettel string
FilePath string // Original file path where this task was found
InCycle bool // True if this task participates in a circular dependency
}
Task represents a parsed task from a line
func FilterTasks ¶
FilterTasks applies field-specific filtering to a slice of tasks
func GetDependencies ¶
GetDependencies returns the tasks that the given task depends on
func GetDependents ¶
GetDependents returns the tasks that depend on the given task
func GetTaskByID ¶
GetTaskByID returns a task by its ID from a slice of tasks. Returns nil if id is empty or not found.
func ProcessFile ¶
ProcessFile processes a README.md file and returns tasks
func (*Task) IsCompleted ¶
IsCompleted returns true if the task is completed
func (*Task) IsInProgress ¶
IsInProgress returns true if the task is in progress
type TaskInfo ¶
type TaskInfo struct {
Keyword string `json:"keyword" jsonschema:"task status keyword (e.g., TODO, DOING, DONE)"`
ID string `json:"id,omitempty" jsonschema:"task unique identifier"`
Title string `json:"title" jsonschema:"task title/description"`
Tag string `json:"tag,omitempty" jsonschema:"task tag (without #)"`
References []string `json:"references,omitempty" jsonschema:"IDs of tasks this task depends on (^id syntax)"`
ScheduledAt string `json:"scheduled_at,omitempty" jsonschema:"scheduled date"`
DueAt string `json:"due_at,omitempty" jsonschema:"due date"`
Assignee string `json:"assignee,omitempty" jsonschema:"task assignee"`
Project string `json:"project" jsonschema:"project name"`
Zettel string `json:"zettel,omitempty" jsonschema:"zettel ID (if structured mode)"`
FilePath string `json:"file_path" jsonschema:"file path where task is defined"`
Priority int `json:"priority" jsonschema:"priority level (1=in_progress, 2=active, 3=someday, 4=completed)"`
Status string `json:"status" jsonschema:"status category (active, in_progress, completed, someday)"`
InCycle bool `json:"in_cycle,omitempty" jsonschema:"true if task participates in a circular dependency"`
}
type UpdateTaskStatusArgs ¶
type UpdateTaskStatusArgs struct {
Project string `json:"project" jsonschema:"project name"`
Keyword string `json:"keyword" jsonschema:"current task keyword"`
Title string `json:"title" jsonschema:"task title to identify the task"`
NewKeyword string `json:"new_keyword" jsonschema:"new status keyword to set"`
}
type UpdateTaskStatusResult ¶
type UpdateTaskStatusResult struct {
Message string `json:"message" jsonschema:"status message"`
Success bool `json:"success" jsonschema:"whether the update succeeded"`
ValidKeywords map[string][]string `json:"valid_keywords" jsonschema:"valid keywords grouped by category (Active, InProgress, Completed, Someday)"`
}