/**
 * Capture a harness-authored markdown plan file into Neotoma.
 *
 * Most modern AI coding harnesses write plans as `.plan.md` files with YAML
 * frontmatter (Cursor under `.cursor/plans/`, Claude Code under
 * `.claude/plans/`, Codex under `.codex/plans/`, OpenClaw under
 * `.openclaw/plans/`). This module:
 *
 *   1. Reads the file.
 *   2. Parses the YAML frontmatter and splits the markdown body.
 *   3. Detects the harness from the path heuristic.
 *   4. Derives `slug` and `harness_plan_id` from the filename stem.
 *   5. Builds a single combined `store` payload containing:
 *        - the raw markdown source (file_path/file_content + mime_type),
 *        - a structured `plan` row populated from frontmatter + body,
 *        - relationships linking the plan to the source file (EMBEDS) and,
 *          when supplied, to the prompting `conversation_message` (REFERS_TO).
 *
 * Returning the payload (rather than executing the store) keeps the helper
 * usable by both the CLI and the in-process server seeding paths and lets
 * tests assert on shape without an Operations stub.
 */
export type Harness = "cursor" | "claude_code" | "codex" | "openclaw" | "cli" | "agent" | "human" | "other";
export interface HarnessPlanFrontmatter {
    /** Plan title (often "name" in harness frontmatter). */
    name?: string;
    title?: string;
    overview?: string;
    /** Harness todo array; expected shape `[{ id, content, status }]`. */
    todos?: Array<{
        id?: string;
        content?: string;
        status?: string;
    }>;
    /** Cursor's `isProject` flag (boolean). */
    isProject?: boolean;
    /** Free-form additional fields are preserved on the entity payload. */
    [key: string]: unknown;
}
export interface ParsedPlan {
    frontmatter: HarnessPlanFrontmatter;
    body: string;
    raw: string;
}
export interface DerivedPlanIdentity {
    slug: string;
    harness: Harness;
    /** Filename hex suffix (e.g. Cursor `2d3bdfdc`); null when the filename has no suffix. */
    harness_plan_id: string | null;
    filename: string;
}
export interface CaptureHarnessPlanInput {
    /** Absolute or workspace-relative path to the `.plan.md` file. */
    file_path: string;
    /** Optional override of detected harness; defaults to path-based detection. */
    harness?: Harness;
    /** When this plan was created or referenced inside an active chat, supply the conversation entity_id. */
    conversation_entity_id?: string;
    /** When a specific message prompted the capture, supply its entity_id; emits REFERS_TO from message → plan. */
    source_message_entity_id?: string;
    /** Optional source-entity linkage (e.g. an `issue` entity_id this plan resolves). */
    source_entity_id?: string;
    source_entity_type?: string;
    /** Optional repository context. */
    repository_name?: string;
    repository_root?: string;
    /** Optional agent identifier (AAuth thumbprint, clientInfo.name). */
    agent_id?: string;
    /** ISO timestamp; defaults to file mtime, then `new Date().toISOString()`. */
    created_at?: string;
    /** Override the data_source provenance string. */
    data_source?: string;
}
export interface CapturedPlanPayload {
    /** A single combined `store` request body suitable for the canonical `store` operation. */
    storePayload: {
        entities: Array<Record<string, unknown>>;
        relationships?: Array<{
            relationship_type: string;
            source_index: number;
            target_index: number;
        } | {
            relationship_type: string;
            source_entity_id: string;
            target_entity_id: string;
        } | {
            relationship_type: string;
            source_entity_id: string;
            target_index: number;
        } | {
            relationship_type: string;
            source_index: number;
            target_entity_id: string;
        }>;
        file_path: string;
        file_idempotency_key: string;
        idempotency_key: string;
    };
    identity: DerivedPlanIdentity;
    parsed: ParsedPlan;
}
/**
 * Detect the authoring harness from the file path. Falls back to "other".
 */
export declare function detectHarnessFromPath(filePath: string): Harness;
/**
 * Derive `slug` and `harness_plan_id` from a `.plan.md` filename.
 *
 * Examples:
 *   process-issues_skill_2d3bdfdc.plan.md → slug="process-issues_skill_2d3bdfdc", harness_plan_id="2d3bdfdc"
 *   site-react-tailwind-parity.plan.md   → slug="site-react-tailwind-parity",   harness_plan_id=null
 */
export declare function deriveIdentityFromFilename(filePath: string, harness: Harness): DerivedPlanIdentity;
/**
 * Parse a markdown file with optional YAML frontmatter delimited by `---` on
 * the first and a subsequent line. Frontmatter is optional; when absent,
 * `frontmatter` is `{}` and `body` is the full file.
 */
export declare function parsePlanMarkdown(raw: string): ParsedPlan;
/**
 * Build a combined-store payload from a harness `.plan.md` file.
 *
 * The caller is expected to invoke `ops.store(result.storePayload)` (or the
 * HTTP `POST /store` equivalent). Keeping construction separate from
 * execution keeps the helper transport-agnostic.
 */
export declare function captureHarnessPlan(input: CaptureHarnessPlanInput): Promise<CapturedPlanPayload>;
//# sourceMappingURL=capture_harness_plan.d.ts.map