/**
 * File Import Service
 *
 * Converts external files into Studiograph entities.
 * - .md → note entity (parses frontmatter if present)
 * - .txt → note entity (plain text as body)
 * - .csv → dataset entity (infers column schema)
 * - .pdf → note entity (extracts text via pdf-parse)
 *
 * A .csv dropped here becomes a structured `dataset` entity (in-graph,
 * queryable, editable in the grid). Uploading a .csv through the asset
 * upload UI instead lands it as an opaque `asset` with
 * `asset_kind: spreadsheet` — the two paths coexist.
 */
import { BaseGraphManager, type CreateEntityOptions } from '../core/graph.js';
import type { GitUser } from './git.js';
/** Create an entity, auto-suffixing the entity_id on `(type, id)` collisions
 *  (`foo` → `foo-2` → `foo-3` …) up to `maxAttempts` tries. The base id
 *  comes through unchanged when there's no collision. Returns the id that
 *  was actually used.
 *
 *  Exported so the asset upload service and the convert endpoint (P2) share
 *  this one collision algorithm instead of each maintaining an inline suffix
 *  loop (CQ2). */
export declare function createWithCollisionRetry(graph: BaseGraphManager, options: CreateEntityOptions, maxAttempts?: number): Promise<{
    entityId: string;
    path: string;
}>;
export interface ImportResult {
    entityId: string;
    entityType: string;
    status: 'created' | 'skipped' | 'error';
    error?: string;
    /** Absolute path of the written file. Set when status === 'created' so
     *  batch callers can collect paths to commit in one transaction.
     *  Undefined for 'skipped' / 'error'. */
    path?: string;
    /** Absolute paths of any per-folder display-name sidecars written for this
     *  import (one per source-segment that carried casing the slug fallback
     *  can't recover). Empty when the source path was already kebab. Batch
     *  callers should pass these to commitPending() under `extraPaths` so the
     *  sidecars land in the same commit as the entity files. */
    sidecarPaths?: string[];
}
export interface ImportOptions {
    entityType?: string;
    entityId?: string;
    /** Override commit author. When omitted, the import is committed under
     *  whatever default identity the underlying git service uses. */
    user?: GitUser;
    /** Repo-relative folder to create the entry in. Empty/undefined = repo
     *  root. Mirrors graph.create's folderPath option. */
    folderPath?: string;
    /** Commit message override. Defaults to a sensible auto-generated one. */
    commitMessage?: string;
    /** Defer the git commit. Defaults to true (preserves existing behavior
     *  where the agent tool batches commits). HTTP callers should pass false
     *  so each import lands as its own commit. */
    skipCommit?: boolean;
}
export declare function isSupportedFile(filename: string): boolean;
/**
 * Extract text content from a file for agent processing.
 * Handles text-based formats directly and binary formats (PDF) via extraction libraries.
 */
export declare function extractText(filename: string, content: string): Promise<string>;
/**
 * Import a single file as a Studiograph entity.
 *
 * The `filename` may include a relative directory portion (e.g.
 * `decks/2025-q1/talk.md`); the directory is slugified and combined with
 * `options.folderPath` (the caller's chosen destination subfolder) to
 * produce the final on-disk location. This preserves user-organized
 * folder structure when a folder is dropped onto the import zone.
 *
 * Collisions on `(entity_type, entity_id)` are auto-suffixed (`talk` →
 * `talk-2` → `talk-3` …) rather than skipped, so dropping a folder twice
 * never silently swallows files.
 */
export declare function importFile(graph: BaseGraphManager, filename: string, content: Buffer | string, options?: ImportOptions): Promise<ImportResult>;
