import type { Task, CommitMetadata } from "../../types.js"; /** * Encode a potentially multi-line value for storage in HTML comments. * Uses base64 encoding if the value contains newlines or the delimiter characters. */ export declare function encodeMetadataValue(value: string): string; /** * Decode a metadata value that may be base64 encoded. */ export declare function decodeMetadataValue(value: string): string; /** * Parsed root task metadata from a GitHub issue body. */ export interface ParsedRootTaskMetadata { id?: string; priority?: number; completed?: boolean; created_at?: string; updated_at?: string; started_at?: string | null; completed_at?: string | null; blockedBy?: string[]; blocks?: string[]; result?: string | null; commit?: CommitMetadata; github?: import("../../types.js").GithubMetadata; } /** * Parse root task metadata from HTML comments in an issue body. * Extracts metadata encoded with format. * @param body - The GitHub issue body * @returns Parsed metadata or null if no dex task metadata found */ export declare function parseRootTaskMetadata(body: string): ParsedRootTaskMetadata | null; /** * Represents a subtask parsed from or to be embedded in a GitHub issue body. */ export type EmbeddedSubtask = Omit; /** * A task with hierarchy information for rendering. */ export interface HierarchicalTask { task: Task; depth: number; parentId: string | null; } /** * Result of parsing an issue body. */ export interface ParsedIssueBody { description: string; subtasks: EmbeddedSubtask[]; } /** * Result of parsing a compound subtask ID. */ export interface ParsedSubtaskId { parentId: string; localIndex: number; } export declare const SUBTASKS_HEADER = "## Subtasks"; export declare const TASKS_HEADER = "## Tasks"; /** * Parse a compound subtask ID into its components. * @param id - The compound ID (e.g., "9-1") * @returns Parsed components or null if not a valid compound ID */ export declare function parseSubtaskId(id: string): ParsedSubtaskId | null; /** * Result of parsing an issue body with hierarchy info. */ export interface ParsedHierarchicalIssueBody { description: string; subtasks: Array; } /** * Parse an issue body to extract context and embedded subtasks. * Handles multiple formats: * - New merged format (## Tasks) with list items containing details * - Old hierarchical format (## Task Tree/Details) * - Legacy flat format (## Subtasks) * @param body - The GitHub issue body * @returns Parsed context and subtasks */ export declare function parseIssueBody(body: string): ParsedIssueBody; /** * Parse an issue body preserving hierarchy information. * Returns subtasks with their parentId for reconstructing the tree. * @param body - The GitHub issue body * @returns Parsed description and subtasks with parent info */ export declare function parseHierarchicalIssueBody(body: string): ParsedHierarchicalIssueBody; /** * Convert an EmbeddedSubtask to a full Task with parent_id set. */ export declare function embeddedSubtaskToTask(subtask: EmbeddedSubtask, parentId: string): Task; /** * Convert a Task to an EmbeddedSubtask for embedding. */ export declare function taskToEmbeddedSubtask(task: Task): EmbeddedSubtask; /** * Calculate the next available subtask index for a parent. * @param existingSubtasks - Currently existing subtasks * @param parentId - The parent task ID * @returns The next available index (1-based) */ export declare function getNextSubtaskIndex(existingSubtasks: EmbeddedSubtask[], parentId: string): number; /** * Collect all descendants of a task in depth-first order with hierarchy info. * @param allTasks - All tasks in the store * @param rootId - The root task ID to collect descendants from * @returns Array of tasks with depth information */ export declare function collectDescendants(allTasks: Task[], rootId: string): HierarchicalTask[]; //# sourceMappingURL=issue-parsing.d.ts.map