import type { BoardIssueCoherenceFlag } from './orient-coherence.js';
/** The `{ error }` envelope for an underivable section. The `error` key is the
 *  external JSON-API field name (same convention as `json-output.ts`). */
interface ErrorEnvelope {
    error: string;
}
/** A section is EITHER its derived value OR an `{ error }` envelope — never silently omitted. */
type Section<T> = T | ErrorEnvelope;
export interface OrientParkedEntry {
    subsystem: string;
    since?: string;
    reason?: string;
    tracking?: string;
    /** Where the entry came from: this repo's freeze.json or the distributed
     *  doctrine snapshot (strategy#584 read half). Additive — absent in
     *  pre-cohort reports. */
    provenance?: 'local' | 'cohort';
    /** Snapshot package version (cohort provenance only). */
    sourceVersion?: string;
}
/**
 * Distributed-channel status for the PARKED section (codex W1 on the
 * mmnto-ai/totem#2167 round: per-source status must SURVIVE to every surface — absent-package /
 * absent-file / corrupt / genuinely-none must never flatten into "none").
 * `underivable` = the effective read threw before the cohort read completed
 * (e.g. corrupt LOCAL freeze.json — see the parked section's error envelope).
 * `underivable` is a CLI-ONLY extension of core's `CohortFreezeStatus` —
 * don't assign `EffectiveFreezeResult.cohortStatus` here except through the
 * deriveParked path, which owns the extension (CR mmnto-ai/totem#2168 F1: the wider union
 * accepts the core type, never the reverse).
 */
export interface OrientFreezeChannel {
    cohortStatus: 'ok' | 'absent-package' | 'absent-file' | 'corrupt' | 'underivable';
    cohortPackageVersion?: string;
    warnings: string[];
}
export interface OrientPr {
    number: number;
    title: string;
    headRefName: string;
    isDraft: boolean;
}
export interface OrientBoardItem {
    status: string;
    title: string;
    contentNumber?: number;
}
export interface OrientEpic {
    number: number;
    title: string;
    labels: string[];
    subIssues: {
        number: number;
        title: string;
    }[];
}
export interface OrientOtherIssue {
    number: number;
    title: string;
    labels: string[];
}
/** Index-freshness pointer — either a derived staleness fact or an honest "not synced" absence. */
export interface OrientIndexFreshness {
    synced: boolean;
    /** Relative age of the registry `lastSync` (e.g. '2h ago'), when synced. */
    lastSync?: string;
    stale?: boolean;
}
export interface OrientReport {
    repo: Section<string>;
    derivedAt: string;
    indexFreshness: OrientIndexFreshness;
    parked: Section<OrientParkedEntry[]>;
    /** Always present beside `parked` — channel state never flattens into "none". */
    freezeChannel: OrientFreezeChannel;
    openPRs: Section<OrientPr[]>;
    board: Section<OrientBoardItem[]>;
    coherence: Section<BoardIssueCoherenceFlag[]>;
    epics: Section<OrientEpic[]>;
    otherOpenIssues: Section<OrientOtherIssue[]>;
    /** Whether a board project number is configured. Distinguishes the JSON's
     *  "no board configured" (false) from "board configured but empty" (true,
     *  `board: []`) — without it the two collapse to the same shape (Tenet 14). */
    boardConfigured: boolean;
}
/**
 * Programmatic entry: derive the full `OrientReport` for `cwd` WITHOUT writing
 * stdout. Identical report to `orient --json` (one derivation, two callers —
 * cannot diverge). Reused by `orientCommand` (the CLI surface) and the
 * SessionStart hook (`.claude/hooks/session-context.mjs`, mmnto-ai/totem#2044
 * PR-2), which dynamic-imports this from `packages/cli/dist/commands/orient.js`
 * — the workspace-dist pattern, deliberately NOT the global `totem` binary
 * (sidesteps the stale-resolve trap mmnto-ai/totem#2053).
 *
 * Latency note: orient's gh adapters are synchronous (`safeExec`/execFileSync),
 * so this runs ~4 sequential blocking gh calls (repo view + PRs + issues + board),
 * each bounded by the adapter's per-call timeout. Callers on a latency-sensitive
 * path (the hook) wrap it best-effort and degrade on failure.
 */
export declare function deriveOrientReport(cwd: string): Promise<OrientReport>;
export declare function renderReport(report: OrientReport): string;
/**
 * Compact projection of an `OrientReport` for auto-injection at session start.
 *
 * Emits ONLY high-signal state — parked/frozen subsystems, open PRs, and board↔
 * issue coherence drift — plus a one-line COUNTS pointer for epics/other-issues
 * (NOT the full enumeration: "pointers not bodies", mmnto-ai/totem-strategy#467
 * Tier-A discipline). An underivable section stays a `⚠ could not derive` line
 * (Tenet 4 — never a silent omit), so the projection inherits orient's fail-loud
 * contract. Hard-bounded by `SESSION_BLOCK_MAX_CHARS` (the guardrail above).
 *
 * Returns '' when there is nothing high-signal to surface (no parked, no PRs, no
 * drift, no derivable counts) so the hook can omit the block entirely rather than
 * inject an empty header.
 */
export declare function renderOrientForSession(report: OrientReport): string;
export declare function orientCommand(opts: {
    json?: boolean;
    session?: boolean;
}): Promise<void>;
export {};
//# sourceMappingURL=orient.d.ts.map