/** * Task schema — types, validation, ID generation, and parsing for * vault-driven agent task orchestration. * * Tasks are markdown notes in the Tasks/ folder with structured YAML * frontmatter. Agents read, claim, update, and complete tasks through * the MCP tools. The vault is the single source of truth. */ export type TaskStatus = "pending" | "claimed" | "in_progress" | "completed" | "failed" | "blocked" | "cancelled" | "needs_review" | "revision_requested"; export type TaskPriority = "critical" | "high" | "medium" | "low"; export type TaskType = "code" | "research" | "writing" | "maintenance" | "project" | "other"; export type RiskLevel = "low" | "medium" | "high" | "critical"; export interface RoutingRule { condition: "output_contains" | "output_matches" | "status_is"; value: string; activate: string[]; deactivate?: string[]; } export interface TaskFrontmatter { id: string; title: string; status: TaskStatus; priority: TaskPriority; type: TaskType; assignee: string; created: string; updated: string; due?: string; completed_at?: string; claimed_at?: string; retry_count: number; source: string; project?: string; parent_task?: string; depends_on: string[]; scope: string[]; context_notes: string[]; timeout_minutes: number; tags: string[]; review_required?: boolean; reviewer?: string; feedback?: string; review_count: number; risk_level?: RiskLevel; max_retries: number; retry_delay_minutes: number; escalate_to?: string; escalation_status: "none" | "escalated"; routing_rules?: RoutingRule[]; worktree_branch?: string; worktree_path?: string; } export declare const VALID_STATUSES: TaskStatus[]; export declare const VALID_PRIORITIES: TaskPriority[]; export declare const VALID_TYPES: TaskType[]; /** * Priority sort order — lower number = higher priority. */ export declare const PRIORITY_ORDER: Record; /** * Generate a unique task ID based on date and a random suffix. */ export declare function generateTaskId(): string; /** * Generate a unique project ID based on date and a random suffix. */ export declare function generateProjectId(): string; /** * Build the file path for a project note. * Projects are stored in their own subfolder: Tasks/{slug}/proj-xxx-{slug}.md */ export declare function buildProjectPath(tasksFolder: string, id: string, title: string): string; /** * Build the subfolder path for a project. * Returns the folder path (without trailing slash): Tasks/{slug} */ export declare function buildProjectFolder(tasksFolder: string, title: string): string; /** * Get today's date in YYYY-MM-DD format. */ export declare function todayDate(): string; /** * Build default frontmatter for a new task. */ export declare function buildTaskFrontmatter(overrides: Partial & { title: string; }): TaskFrontmatter; /** * Parse raw frontmatter into a TaskFrontmatter, with lenient defaults * for missing fields. Returns null if the frontmatter doesn't look like * a task (no `id` or `status` field). */ export declare function parseTaskFrontmatter(fm: Record): TaskFrontmatter | null; /** * Build the markdown body template for a new task. */ export declare function buildTaskBody(description: string, acceptanceCriteria?: string[]): string; /** * Build a filename-safe slug from a task title. */ export declare function slugify(title: string): string; /** * Build the file path for a task note. * If projectFolder is provided, the task goes in that subfolder. * Otherwise it goes at the tasks root (standalone task). */ export declare function buildTaskPath(tasksFolder: string, id: string, title: string, projectFolder?: string): string; /** * Get current ISO datetime string (e.g. "2026-03-09T14:30:00Z"). * Used for precise timestamps in mutations (updated, completed_at, claimed_at). */ export declare function nowISO(): string; /** * Append a timestamped entry to the Agent Log section of a task note. * If no Agent Log section exists, one is created at the end. * The timestamp is added automatically — pass only the log text. */ export declare function appendToAgentLog(content: string, logText: string): string; /** * Append a pre-formatted entry (with its own timestamp/prefix) to the Agent Log. * Used by complete_task which formats its own [COMPLETED]/[FAILED] entries. */ export declare function appendRawToAgentLog(content: string, rawEntry: string): string; /** * Add deliverables to the Deliverables section. * Appends to existing deliverables rather than replacing them. * Creates the section before Agent Log if it doesn't exist. */ export declare function addDeliverables(content: string, deliverables: string[]): string; //# sourceMappingURL=task-schema.d.ts.map