import type { ProjectConfig } from '../core/config.js';
import type { TaskBackend } from '../interfaces/TaskBackend.js';
import type { Card, CardState } from '../shared/types.js';
/**
 * Markdown-based TaskBackend.
 *
 * Directory layout:
 *   cards/
 *   ├── planning/
 *   │   └── 3-build-dashboard.md
 *   ├── todo/
 *   │   └── 2-add-payment.md
 *   ├── inprogress/
 *   │   └── 1-implement-login.md
 *   ├── done/
 *   │   └── 0-setup.md
 *   └── seq.txt            ← current max sequence number
 *
 * Each card file uses YAML frontmatter for metadata + markdown body.
 */
export declare class MarkdownTaskBackend implements TaskBackend {
    private readonly cardsDir;
    private readonly seqFile;
    private readonly allStates;
    /** state name → directory name */
    private readonly stateDir;
    /** directory name → state name */
    private readonly dirState;
    constructor(config: ProjectConfig, customStates?: string[]);
    bootstrap(): Promise<void>;
    listByState(state: CardState): Promise<Card[]>;
    listAll(): Promise<Card[]>;
    getBySeq(seq: string): Promise<Card | null>;
    move(seq: string, targetState: CardState): Promise<void>;
    addLabel(seq: string, label: string): Promise<void>;
    removeLabel(seq: string, label: string): Promise<void>;
    setSkills(seq: string, skills: string[]): Promise<void>;
    /**
     * 更新 title：frontmatter + 文件名 slug 同步。文件名规则跟 create 一致。
     */
    setTitle(seq: string, title: string): Promise<void>;
    /**
     * 更新 description —— 替换 body 里 "## 描述" 段的内容。
     * 如果找不到描述段就整体替换 body（罕见情况，保护性处理）。
     * 保留其它 section（检查清单、日志）不动。
     */
    setDescription(seq: string, desc: string): Promise<void>;
    /**
     * 全量替换 labels。调用方负责构造最终数组（不要再叠加 AI-PIPELINE 等，
     * 这是用户自定义层；工作流标签由 stage engine 管理）。
     */
    setLabels(seq: string, labels: string[]): Promise<void>;
    delete(seq: string): Promise<void>;
    claim(seq: string, workerSlot: string): Promise<void>;
    releaseClaim(seq: string): Promise<void>;
    incrementRetryCount(seq: string): Promise<number>;
    resetRetryCount(seq: string): Promise<void>;
    comment(seq: string, text: string): Promise<void>;
    create(title: string, desc: string, state: CardState): Promise<Card>;
    checklistCreate(seq: string, items: string[]): Promise<void>;
    checklistList(seq: string): Promise<{
        id: string;
        text: string;
        checked: boolean;
    }[]>;
    checklistCheck(seq: string, itemId: string): Promise<void>;
    checklistUncheck(seq: string, itemId: string): Promise<void>;
    private toggleChecklistItem;
    metaRead(seq: string): Promise<Record<string, unknown>>;
    metaWrite(seq: string, data: Record<string, unknown>): Promise<void>;
    /**
     * Find the card file by seq across all state directories.
     */
    private findCardFile;
    /**
     * Read a card file and return Card object.
     */
    private readCard;
    /**
     * Parse a markdown file into frontmatter + body.
     */
    private parseFile;
    /**
     * Write frontmatter + body back to file.
     */
    private writeFile;
    /**
     * Simple YAML parser (handles: strings, numbers, null, arrays of strings).
     * Not a full YAML parser — covers our frontmatter needs.
     */
    private parseYamlSimple;
    /**
     * Simple YAML serializer.
     */
    private serializeYamlSimple;
    /**
     * Extract content from a ## section (until next ## or end).
     */
    private extractSection;
    /**
     * Replace content of a ## section.
     */
    private replaceSection;
    /**
     * Parse checklist items from markdown body.
     */
    private parseChecklist;
    /**
     * Get next sequence number (atomic increment).
     */
    private nextSeq;
}
//# sourceMappingURL=MarkdownTaskBackend.d.ts.map