/**
 * M21 BriefService — thin wrapper over the second `PagesService` instance
 * mounted on `briefsDir`. Briefs are markdown files with mandatory YAML
 * frontmatter (`type: brief`, `from_release`, `to_release`, ...). The file
 * itself is the source of truth (consumed both by humans in UI and by coding
 * agents in terminal). DB participation is limited to:
 *   - `chat_thread.brief_path` (M05) for editorial threads
 *   - `page_version` (M17 Phase 4) — automatic via shared PageVersionService
 *
 * Design notes:
 *   - **Zero new tables**. Listing comes from PagesFrontmatterIndexer.
 *   - **Optimistic concurrency** by sha256 hash of full content (frontmatter+body).
 *   - **Immutable frontmatter** keys protected: type/from_release/to_release/
 *     generated_at/generator_version. Mutation attempt → DomainError.
 */
import type { Brief, BriefChangedBy, BriefListItem, BriefThreadSummary } from '../../shared/entities.js';
import type { PagesService } from './pages.js';
import type { PagesWatcher } from '../fs/watcher.js';
import type { WsGateway } from '../ws/gateway.js';
import type { PageVersionService } from './page-version.js';
import type { PageSerializer } from './page-serializer.js';
import type { ChatService } from './chat.js';
import type { ReleaseService } from './release.js';
import type { PagesFrontmatterIndexer } from './pages-frontmatter-indexer.js';
export interface BriefServiceDeps {
    briefsPages: PagesService;
    briefsWatcher: PagesWatcher;
    briefsSerializer: PageSerializer;
    pageVersions: PageVersionService;
    chatService: ChatService;
    releaseService: ReleaseService;
    frontmatterIndexer: PagesFrontmatterIndexer;
    ws: WsGateway;
}
export interface BriefCreateOpts {
    /** `null` = initial brief — pomijamy walidacje `fromRelease` i frontmatter trzyma `from_release: null`. */
    fromReleaseName: string | null;
    toReleaseName: string;
    /**
     * Ulotny prompt sterujący stylem/językiem/audytorium briefa. NIE jest
     * zapisywany ani do frontmatter, ani do SQLite — klient dokleja go do
     * pierwszej user-message w initial-thread po redirect.
     */
    additionalPrompt?: string;
    suffix?: string;
}
export interface BriefUpdateContentOpts {
    path: string;
    content: string;
    expectedHash?: string;
    changedBy: BriefChangedBy;
    changeSummary?: string;
}
export interface BriefUpdateFrontmatterOpts {
    path: string;
    patch: {
        implemented?: boolean;
    };
    changedBy: BriefChangedBy;
}
export interface BriefListOpts {
    implemented?: boolean;
}
export declare class BriefService {
    private deps;
    constructor(deps: BriefServiceDeps);
    getBrief(path: string): Promise<Brief>;
    listBriefs(opts?: BriefListOpts): BriefListItem[];
    listThreadsForBrief(path: string): BriefThreadSummary[];
    createBrief(opts: BriefCreateOpts): Promise<{
        briefPath: string;
        initialThreadId: string;
    }>;
    updateContent(opts: BriefUpdateContentOpts): Promise<{
        newHash: string;
    }>;
    updateFrontmatter(opts: BriefUpdateFrontmatterOpts): Promise<Brief>;
    createThreadForBrief(briefPath: string, name?: string | null): {
        threadId: string;
    };
    private absPath;
    private allocatePath;
}
export declare class ConflictError extends Error {
    readonly code: string;
    readonly currentHash: string;
    constructor(code: string, message: string, currentHash: string);
}
