import { type Stats } from 'node:fs'; import { type EnsureOptions } from '../utils/optional-deps.js'; export declare const CLAUDE_PATH_ENV = "MONOMIND_CLAUDE_PATH"; /** The Claude Code version bundled with the pinned SDK (its manifest.json); * claude-sdk.test.ts checks it against the installed SDK. */ export declare const SDK_BUNDLED_CLAUDE_VERSION = "2.1.303"; export interface ClaudeProbe { env: NodeJS.ProcessEnv; home: string; platform: NodeJS.Platform; /** This process's uid; undefined where there is none (Windows). */ uid: number | undefined; /** Real paths roles can write whatever the ownership: $HOME, temp dirs, * the cwd. */ roleWritableRoots: string[]; realpath: (p: string) => string; stat: (p: string) => Stats; isExecutable: (p: string) => boolean; /** The file's first two bytes. */ head: (p: string) => string; /** Stdout of ` --version`. */ version: (file: string) => Promise; log: (line: string) => void; } export interface ClaudeCodeInfo { used: string; version: string; skipped: Array<{ path: string; version?: string; reason: string; }>; } export interface InstalledClaude { claude_code: ClaudeCodeInfo; /** Real path of the binary to use; undefined means the SDK's own. */ path?: string; /** Binaries found but not used, with the reason. */ skipped: string[]; } interface Candidate { path: string; explicit: boolean; source?: string; } /** Where to look, in order; empty when detection is off. */ export declare function claudeCandidates(env: NodeJS.ProcessEnv, home: string, platform: NodeJS.Platform): Candidate[]; /** Whether `claude --version` output names a Claude Code the pinned SDK can * drive: same major as the bundled one, and that version or newer. */ export declare function compatibleClaudeVersion(output: string): { ok: boolean; version?: string; }; /** A Claude Code file name: `claude`, `claude.exe`, or the native * installer's `versions/`. */ export declare function looksLikeClaude(real: string): boolean; /** Why the binary at `real` is not a system install, or undefined. */ export declare function notSystemInstalled(real: string, probe: ClaudeProbe): string | undefined; /** Finds the Claude Code to use (see the file header). */ export declare function findInstalledClaude(probe: ClaudeProbe): Promise; /** * The operator-chosen binary (its real path) and the directories above it * that must become mount points, outermost first, so that a role can * neither write it nor rename a directory on the way to it aside and plant * another (a rename of a directory that merely contains a mount point * succeeds). The list stops below $HOME, which a role cannot rename, or at * `/`. Undefined when no explicit path is set or it does not resolve. */ export declare function protectedClaudeBinary(env: NodeJS.ProcessEnv, home: string): { file: string; dirs: string[]; } | undefined; export declare const defaultClaudeProbe: (env?: NodeJS.ProcessEnv) => ClaudeProbe; /** How to load the SDK given what `findInstalledClaude` found. */ export declare function sdkLoadOptions(found: Pick): EnsureOptions; export type ClaudeSdk = Pick & { /** Set when an installed Claude Code is used; `query` then always passes * it as `pathToClaudeCodeExecutable`. */ executable?: string; claude_code?: ClaudeCodeInfo; }; /** `query` with `pathToClaudeCodeExecutable` always set to `executable`. * The SDK was installed without its own binary, so there is nothing to * fall back to when the file is gone (an update pruned that version): the * call fails with a message saying so, and the next load looks again. */ export declare function queryWithExecutable(query: ClaudeSdk['query'], executable: string): ClaudeSdk['query']; /** The Claude Agent SDK, installed into ~/.monomind/deps on first use * (#428; not a dependency of the published package), running the installed * Claude Code if there is a usable one (#522). Loaded once per process; a * failure is not cached, so a later session retries. `probe` is for tests; * `requested` marks the operator's own `monomind deps install` (#559); `intoCache` makes that install * write the deps cache even when a copy of the pin resolves from the checkout. */ export declare const loadClaudeSdk: (probe?: ClaudeProbe, { requested, intoCache }?: { requested?: boolean; intoCache?: boolean; }) => Promise; /** Runtime selection only; does not install or load the SDK. */ export declare function claudeCodeInfo(env?: NodeJS.ProcessEnv): Promise; /** Human diagnostic once per process, including when the SDK is already installed. */ export declare function reportClaudeSkip(info: ClaudeCodeInfo): void; export {}; //# sourceMappingURL=claude-sdk.d.ts.map