import type { AgentAdapter } from "../agents/types.js";
import type { HintContext } from "./types.js";
export interface BuildHintContextOptions {
    config?: any;
    results?: any;
    /** Defaults to `process.cwd()`. Injectable for tests. */
    cwd?: string;
    /** Defaults to `!!process.stdout.isTTY`. Injectable for tests. */
    isTTY?: boolean;
    /** Defaults to `os.platform()`. Injectable for tests. */
    platform?: NodeJS.Platform;
    /** Defaults to `listAdapters()`. Injectable for tests. */
    adapters?: AgentAdapter[];
    /**
     * Override the agent-probe timeout. Tests with stub adapters that
     * resolve synchronously can pass `0` to disable.
     */
    agentProbeTimeoutMs?: number;
}
export declare function buildHintContext(options?: BuildHintContextOptions): Promise<HintContext>;
/**
 * Walk from `start` upward looking for a `.git/config` file. When found,
 * parse out the URL of `[remote "origin"]`. Returns `null` if no repo or
 * no origin remote was found, or on any I/O / parse error.
 *
 * Stops at the filesystem root. Bounded to 30 iterations to be doubly
 * sure we never loop forever on pathological filesystems.
 */
export declare function readGitOriginUrl(start: string): string | null;
export declare function parseOriginUrl(text: string): string | null;
export declare function detectDocDetectiveWorkflow(cwd: string): boolean;
/**
 * True when at least one command in a workflow `run:` block is
 * `doc-detective` (or a thin runner like `npx`/`yarn`/`pnpm`/`bunx`
 * invoking it). Splits on common shell chaining/grouping operators
 * (`&&`, `||`, `;`, `|`, newline) and inspects each command piece
 * at its START — so arbitrary mentions like `echo doc-detective`,
 * `grep doc-detective package.json`, or `# doc-detective todo`
 * don't false-positive. Doesn't try to parse shell quoting; the
 * common workflow invocations are simple enough that this catches
 * the realistic cases without a full grammar.
 */
export declare function runInvokesDocDetective(run: string): boolean;
interface WalkData {
    usedStepTypes: Set<string>;
    usedBrowserContexts: Set<string>;
    producedScreenshots: boolean;
    producedAutoScreenshots: boolean;
    producedRecordings: boolean;
    usedSelectorOnlyFinds: boolean;
    hasRelativeUrls: boolean;
    hasCurlInRunShell: boolean;
    hasNodeOrPythonInRunShell: boolean;
}
export declare function walkResults(results: any): WalkData;
/**
 * Find the nearest `package.json` walking up from `cwd`. Returns the
 * full path or `null`. Walking up matches `readGitOriginUrl` /
 * `readGitignore` so probes stay consistent when doc-detective is run
 * from a subdirectory.
 */
export declare function findPackageJsonUpward(cwd: string): string | null;
/**
 * True when ANY `scripts[*]` value in the given `package.json`
 * contains the literal substring `doc-detective`. Pure file read +
 * JSON parse; `null`/absent paths return false.
 */
export declare function hasDocDetectiveScriptInPackageJson(packageJsonPath: string | null): boolean;
/**
 * Backwards-compatible wrapper kept for tests that exercise the
 * scripts probe in isolation. Walks up from `cwd` and forwards to
 * `hasDocDetectiveScriptInPackageJson`.
 */
export declare function readNpmScripts(cwd: string): boolean;
export declare function detectOutputDirGitignored(cwd: string, outputDir: any): boolean;
/**
 * Loose match: split into trimmed non-comment lines, normalize away
 * leading slash and trailing slash, and check if any pattern matches the
 * normalized output dir.
 *
 * Doesn't try to be a full gitignore implementation — patterns like `**`
 * and negation are rare for build-output entries, and a coarse match is
 * good enough to gate the hint.
 */
export declare function gitignoreCovers(text: string, outputDir: string): boolean;
export declare function parseNodeMajor(versionString: string): number;
/** Single source of truth for the RST extension(s) we scan and refer to. */
export declare const RST_EXTENSIONS: string[];
/**
 * Returns true if any file under the repo root (or `cwd` if no
 * `.git` directory is found in any parent) ends with a `.rst`
 * suffix. Walks up from `cwd` to locate `.git`, then scans
 * downward from that directory. This keeps the probe consistent
 * with `detectDocDetectiveWorkflow` and `findPackageJsonUpward` —
 * doc-detective run from a monorepo subdirectory still sees `.rst`
 * files in sibling packages. Caps at 100 file inspections to bound
 * the worst case on huge monorepos. Skips dotted entries and
 * `node_modules`. Failures are caught and treated as "not found"
 * so a permission error never breaks the post-run summary.
 */
export declare function detectRstFiles(cwd: string): boolean;
export {};
//# sourceMappingURL=context.d.ts.map