ops

package
v0.20.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2026 License: BSD-2-Clause Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClaudeResumer added in v0.16.0

type ClaudeResumer interface {
	// ResumeSession replaces the current process with an interactive claude --resume session.
	ResumeSession(sessionID string, cwd string) error
}

ClaudeResumer resumes an existing Claude session.

func NewClaudeResumer added in v0.16.0

func NewClaudeResumer(claudeScript string) ClaudeResumer

NewClaudeResumer creates a ClaudeResumer using the given claude script. Returns nil if the binary is not found.

func NewClaudeResumerForTesting added in v0.16.0

func NewClaudeResumerForTesting(
	claudePath string,
	chdir func(string) error,
	execFn func(string, []string, []string) error,
) ClaudeResumer

NewClaudeResumerForTesting creates a ClaudeResumer with injectable dependencies. Intended for testing.

type ClaudeSessionStarter added in v0.16.0

type ClaudeSessionStarter interface {
	// StartSession runs claude in headless mode to create a session, returns session_id.
	StartSession(ctx context.Context, prompt string, cwd string) (string, error)
}

ClaudeSessionStarter starts a new headless Claude session.

func NewClaudeSessionStarter added in v0.16.0

func NewClaudeSessionStarter(claudeScript string) ClaudeSessionStarter

NewClaudeSessionStarter creates a ClaudeSessionStarter using the given claude script. Returns nil if the binary is not found.

func NewClaudeSessionStarterWithRunner added in v0.16.0

func NewClaudeSessionStarterWithRunner(
	claudePath string,
	runCmd func(ctx context.Context, args []string, dir string) ([]byte, error),
) ClaudeSessionStarter

NewClaudeSessionStarterWithRunner creates a ClaudeSessionStarter with an injectable command runner. Intended for testing.

type CompleteOperation

type CompleteOperation interface {
	Execute(
		ctx context.Context,
		vaultPath string,
		taskName string,
		vaultName string,
		outputFormat string,
	) error
}

func NewCompleteOperation

func NewCompleteOperation(
	storage storage.Storage,
	currentDateTime libtime.CurrentDateTime,
) CompleteOperation

NewCompleteOperation creates a new complete operation.

type DeferOperation

type DeferOperation interface {
	Execute(
		ctx context.Context,
		vaultPath string,
		taskName string,
		dateStr string,
		vaultName string,
		outputFormat string,
	) error
}

func NewDeferOperation

func NewDeferOperation(
	storage storage.Storage,
	currentDateTime libtime.CurrentDateTime,
) DeferOperation

NewDeferOperation creates a new defer operation.

type FrontmatterClearOperation added in v0.9.0

type FrontmatterClearOperation interface {
	Execute(ctx context.Context, vaultPath, taskName, key string) error
}

func NewFrontmatterClearOperation added in v0.9.0

func NewFrontmatterClearOperation(storage storage.Storage) FrontmatterClearOperation

NewFrontmatterClearOperation creates a new frontmatter clear operation.

type FrontmatterGetOperation added in v0.9.0

type FrontmatterGetOperation interface {
	Execute(ctx context.Context, vaultPath, taskName, key string) (string, error)
}

func NewFrontmatterGetOperation added in v0.9.0

func NewFrontmatterGetOperation(storage storage.Storage) FrontmatterGetOperation

NewFrontmatterGetOperation creates a new frontmatter get operation.

type FrontmatterSetOperation added in v0.9.0

type FrontmatterSetOperation interface {
	Execute(ctx context.Context, vaultPath, taskName, key, value string) error
}

func NewFrontmatterSetOperation added in v0.9.0

func NewFrontmatterSetOperation(storage storage.Storage) FrontmatterSetOperation

NewFrontmatterSetOperation creates a new frontmatter set operation.

type IncompleteResult added in v0.10.8

type IncompleteResult struct {
	Success    bool   `json:"success"`
	Reason     string `json:"reason"`
	Pending    int    `json:"pending"`
	InProgress int    `json:"inprogress"`
	Completed  int    `json:"completed"`
	Total      int    `json:"total"`
}

IncompleteResult represents the result when a task has incomplete subtasks.

type IssueType

type IssueType string

IssueType represents the type of lint issue found.

const (
	IssueTypeMissingFrontmatter     IssueType = "MISSING_FRONTMATTER"
	IssueTypeInvalidPriority        IssueType = "INVALID_PRIORITY"
	IssueTypeDuplicateKey           IssueType = "DUPLICATE_KEY"
	IssueTypeInvalidStatus          IssueType = "INVALID_STATUS"
	IssueTypeOrphanGoal             IssueType = "ORPHAN_GOAL"
	IssueTypeStatusCheckboxMismatch IssueType = "STATUS_CHECKBOX_MISMATCH"
)

type LintIssue

type LintIssue struct {
	FilePath    string
	IssueType   IssueType
	Description string
	Fixable     bool
	Fixed       bool
}

LintIssue represents a single lint issue found in a file.

type LintIssueJSON added in v0.8.0

type LintIssueJSON struct {
	File        string `json:"file"`
	Type        string `json:"type"`
	Description string `json:"description"`
	Fixed       bool   `json:"fixed,omitempty"`
}

LintIssueJSON represents a lint issue in JSON format.

type LintOperation

type LintOperation interface {
	Execute(
		ctx context.Context,
		vaultPath string,
		tasksDir string,
		fix bool,
		outputFormat string,
	) error
	ExecuteFile(
		ctx context.Context,
		filePath string,
		taskName string,
		vaultName string,
		outputFormat string,
	) error
}

func NewLintOperation

func NewLintOperation() LintOperation

NewLintOperation creates a new lint operation.

type ListOperation

type ListOperation interface {
	Execute(
		ctx context.Context,
		vaultPath string,
		vaultName string,
		pagesDir string,
		statusFilter string,
		showAll bool,
		assigneeFilter string,
		outputFormat string,
	) error
}

func NewListOperation

func NewListOperation(
	storage storage.Storage,
) ListOperation

NewListOperation creates a new list operation.

type MutationResult added in v0.8.0

type MutationResult struct {
	Success   bool     `json:"success"`
	Name      string   `json:"name,omitempty"`
	Vault     string   `json:"vault,omitempty"`
	Error     string   `json:"error,omitempty"`
	Warnings  []string `json:"warnings,omitempty"`
	SessionID string   `json:"session_id,omitempty"`
}

MutationResult represents the result of a mutation operation.

type RecurringMutationResult added in v0.10.7

type RecurringMutationResult struct {
	Success   bool     `json:"success"`
	Name      string   `json:"name,omitempty"`
	Vault     string   `json:"vault,omitempty"`
	Recurring bool     `json:"recurring"`
	NextDate  string   `json:"next_date,omitempty"`
	Error     string   `json:"error,omitempty"`
	Warnings  []string `json:"warnings,omitempty"`
}

RecurringMutationResult represents the result of a recurring task mutation.

type SearchOperation

type SearchOperation interface {
	Execute(
		ctx context.Context,
		vaultPath string,
		scopeDir string,
		query string,
		topK int,
		outputFormat string,
	) error
}

func NewSearchOperation

func NewSearchOperation() SearchOperation

NewSearchOperation creates a new search operation.

type ShowOperation added in v0.20.0

type ShowOperation interface {
	Execute(
		ctx context.Context,
		vaultPath string,
		vaultName string,
		taskName string,
		outputFormat string,
	) error
}

ShowOperation returns full detail for a single task.

func NewShowOperation added in v0.20.0

func NewShowOperation(storage storage.Storage) ShowOperation

NewShowOperation creates a new show operation.

type TaskDetail added in v0.20.0

type TaskDetail struct {
	Name            string   `json:"name"`
	Status          string   `json:"status"`
	Phase           string   `json:"phase,omitempty"`
	Assignee        string   `json:"assignee,omitempty"`
	Priority        int      `json:"priority,omitempty"`
	Category        string   `json:"category,omitempty"`
	Recurring       string   `json:"recurring,omitempty"`
	DeferDate       string   `json:"defer_date,omitempty"`
	PlannedDate     string   `json:"planned_date,omitempty"`
	ClaudeSessionID string   `json:"claude_session_id,omitempty"`
	Goals           []string `json:"goals,omitempty"`
	Description     string   `json:"description,omitempty"`
	Content         string   `json:"content"`
	ModifiedDate    string   `json:"modified_date,omitempty"`
	FilePath        string   `json:"file_path"`
	Vault           string   `json:"vault"`
}

TaskDetail contains full task information for JSON output.

type TaskListItem added in v0.8.0

type TaskListItem struct {
	Name            string `json:"name"`
	Status          string `json:"status"`
	Assignee        string `json:"assignee,omitempty"`
	Priority        int    `json:"priority,omitempty"`
	Vault           string `json:"vault"`
	Category        string `json:"category,omitempty"`
	Recurring       string `json:"recurring,omitempty"`
	DeferDate       string `json:"defer_date,omitempty"`
	PlannedDate     string `json:"planned_date,omitempty"`
	ClaudeSessionID string `json:"claude_session_id,omitempty"`
	Phase           string `json:"phase,omitempty"`
}

TaskListItem represents a task in list output.

type UpdateOperation

type UpdateOperation interface {
	Execute(
		ctx context.Context,
		vaultPath string,
		taskName string,
		vaultName string,
		outputFormat string,
	) error
}

func NewUpdateOperation

func NewUpdateOperation(
	storage storage.Storage,
) UpdateOperation

NewUpdateOperation creates a new update operation.

type WatchEvent added in v0.20.0

type WatchEvent struct {
	Event string `json:"event"`
	Name  string `json:"name"`
	Vault string `json:"vault"`
	Path  string `json:"path"`
}

WatchEvent is the JSON-encoded event emitted on stdout.

type WatchOperation added in v0.20.0

type WatchOperation interface {
	Execute(ctx context.Context, vaults []WatchTarget) error
}

WatchOperation watches vault directories and streams change events.

func NewWatchOperation added in v0.20.0

func NewWatchOperation() WatchOperation

NewWatchOperation creates a new WatchOperation.

type WatchTarget added in v0.20.0

type WatchTarget struct {
	VaultPath string
	VaultName string
	WatchDirs []string
}

WatchTarget describes a vault and the directories to watch within it.

type WorkOnOperation added in v0.6.0

type WorkOnOperation interface {
	Execute(
		ctx context.Context,
		vaultPath string,
		taskName string,
		assignee string,
		vaultName string,
		outputFormat string,
		isInteractive bool,
	) error
}

func NewWorkOnOperation added in v0.6.0

func NewWorkOnOperation(
	storage storage.Storage,
	currentDateTime libtime.CurrentDateTime,
	starter ClaudeSessionStarter,
	resumer ClaudeResumer,
) WorkOnOperation

NewWorkOnOperation creates a new work-on operation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL