#!/usr/bin/env node
import { type ApiInstance } from "./config.js";
/** Session command history for Up/Down cycling. indexRef.current is the current history index (history.length = new line). */
export type SessionHistoryRef = {
    history: string[];
    indexRef: {
        current: number;
    };
};
export declare function getPromptPlaceholder(buffer: string, placeholderText?: string): string;
/**
 * Cursor math for live "/" suggestions.
 * We print a leading newline before the suggestions block, so we must move up
 * one extra line after rendering. Missing this +1 causes prompt line stacking.
 */
export declare function getSlashSuggestionCursorUpLines(renderedSuggestionLines: number): number;
/**
 * Parse "view details" row selections from session input.
 * Accepts plain numbers plus slash variants users can reach via autocomplete.
 */
export declare function parseWatchRowSelection(input: string): number;
export declare function getWatchEventCount<T>(events: T[]): number | undefined;
export declare function findRepoRoot(startDir: string): Promise<string | null>;
/**
 * Return true when `baseUrl` points at the same machine as the CLI, so the
 * server can read a local `file_path` directly from disk. Non-localhost URLs
 * cannot (e.g. remote API deployments) and must receive file_content upload.
 */
export declare function isLocalhostBaseUrl(baseUrl: string): boolean;
export declare function getSqliteRecoveryHint(err: unknown, envHint?: "dev" | "prod"): string | null;
export declare function writeCliError(err: unknown): void;
export declare function buildOAuthAuthorizeUrl(params: {
    baseUrl: string;
    redirectUri: string;
    state: string;
    codeChallenge: string;
    clientId: string;
    devStub?: boolean;
}): string;
/**
 * Resolve the effective `user_id` for a CLI read verb.
 *
 * Precedence (matches the NEOTOMA_API_ONLY / NEOTOMA_OFFLINE precedent):
 *   1. Per-call `--user-id <id>` flag (explicit wins).
 *   2. `NEOTOMA_USER_ID` env var (session-wide pin).
 *   3. `undefined` (server falls back to the authenticated user).
 *
 * Returns `undefined` (never an empty string) when nothing is set so that the
 * downstream `user_id` body/query param is simply omitted rather than sent as
 * an empty string.
 */
export declare function resolveEffectiveUserId(optsUserId?: string): string | undefined;
import { InitAbortError } from "./init_abort.js";
export { InitAbortError };
export declare function getPathCompletionCandidates(line: string, cwd?: string): string[];
/**
 * Parse `--capability <op:types>` flags into the `AgentCapabilityEntry[]`
 * shape the server expects. Inputs look like `store:issue,observation` or
 * `retrieve:*`. Whitespace around the op and each type is tolerated; an
 * empty types list is rejected. Used by `neotoma auth keygen --register`.
 *
 * @throws Error when a flag is malformed (no colon, empty op, empty types).
 */
export declare function parseCapabilityFlags(flags: string[]): Array<{
    op: string;
    entity_types: string[];
}>;
export declare function resolveInitDataDirDefaults(params: {
    repoRoot: string | null;
    envPath: string | null;
    homeDir?: string;
    cwd?: string;
    processEnvDataDir?: string;
}): Promise<{
    defaultDataDir: string;
    defaultDataDirCandidate: string;
    detectedInitializedDataDir: string | null;
    configuredEnvDataDir: string | null;
}>;
type IntroStats = {
    total_entities: number;
    total_relationships: number;
    total_sources: number;
    total_events: number;
    total_observations: number;
    total_interpretations: number;
};
/** Prod and dev intro stats for dual-column intro box. */
export type DualEnvIntroStats = {
    prod: IntroStats | null;
    dev: IntroStats | null;
    dataDir?: string;
};
export declare function buildGetStartedBoxLines(): string[];
export declare function buildApiBoxLines(instances: ApiInstance[], mcpStdioCount?: number): string[];
type CliInstructionScanSummary = {
    appliedProject: {
        cursor: boolean;
        claude: boolean;
        codex: boolean;
    };
    appliedUser: {
        cursor: boolean;
        claude: boolean;
        codex: boolean;
    };
};
export type InitContextStatus = {
    dataDirExists: boolean;
    envFileExists: boolean;
    dataDir: string;
    envFilePath: string;
    envTarget: "project" | "user";
};
/** Resolve data dir and .env status for init box for project/user env targets. */
export declare function getInitContextStatus(repoRoot: string | null): Promise<InitContextStatus | null>;
/**
 * Treat init as satisfied if either project-scoped or user-scoped context is ready.
 * This avoids false negatives when one scope is configured and the other is not.
 */
export declare function hasAnyInitializedContext(repoRoot: string | null): Promise<boolean>;
export declare function buildInstallationBoxLines(mcpConfigs: McpConfigStatus[], cliScan: CliInstructionScanSummary | null, initContext?: InitContextStatus | null, repoRoot?: string | null): string[];
type IntroBoxContent = {
    lines: string[];
    title: string;
};
export declare function buildIntroBoxContent(version: string, summaryLinesOrStats: string[] | DualEnvIntroStats, _env?: "dev" | "prod"): IntroBoxContent;
type McpConfigStatus = {
    path: string;
    hasDev: boolean;
    hasProd: boolean;
};
/**
 * Build the status block string (intro + optional watch + optional MCP) for redraw on SIGWINCH.
 * Returns output and line count so we know how many lines to clear before redraw.
 */
export declare function buildStatusBlockOutput(opts: {
    introContent: IntroBoxContent;
    dataPath?: string;
    apiLines?: string[];
    watchLines?: string[];
    watchEventCount?: number;
    installationLines?: string[];
    getStartedLines?: string[];
    showConfiguration?: boolean;
}, sessionBoxWidth: number): {
    output: string;
    lineCount: number;
};
/** Exported for tests: top-level command names (same as session command list). */
export declare function getSessionCommandNames(): string[];
/**
 * User argv tokens after the runtime + script prefix (same convention as Commander `from: 'node'`).
 * When argv is already user-only (e.g. `["storage", "info"]`), returns argv unchanged — `argv.slice(2)`
 * would wrongly yield [] and force interactive session mode on a TTY.
 */
export declare function extractUserCliArgs(argv: string[]): string[];
export declare function runCli(argv?: string[]): Promise<void>;
//# sourceMappingURL=index.d.ts.map