import { type LlamaCppModule } from "smoltalk"; /** Discover global `node_modules` roots reported by `npm` and `pnpm`, in that * order. Each entry is the directory printed by ` root -g` (which is * itself a `node_modules` dir, e.g. `/opt/homebrew/lib/node_modules` for * Homebrew npm, `~/Library/pnpm/global/5/node_modules` for pnpm). Failures * (tool not installed, exit non-zero, dir missing) are silently skipped. */ export declare function globalNodeModulesRoots(): string[]; /** Try to resolve `smoltalk-llama-cpp` from the given global `node_modules` * roots. Each `root` is itself a `node_modules` directory (the convention * `npm root -g` / `pnpm root -g` uses). Node's resolver looks for * `/node_modules/` for each parent dir it walks up, so the * createRequire base must live in the root's PARENT directory — from * `/../_resolver.js` it correctly finds `/smoltalk-llama-cpp/...`. * Exported for unit-testing with a controllable list of roots. */ export declare function resolveSmoltalkLlamaCppFromRoots(roots: string[]): string | null; /** Local require paths first, then the global npm/pnpm roots. Used by the * install gate (`hasLocalModelSupport`), which only cares whether the * package is reachable at all. */ export declare function resolveSmoltalkLlamaCppEntry(): string | null; /** The chooseEntryPath decision: what to hand smoltalk, and how the package * was found (for the `localModelLoaded` statelog event). `entryPath` is * undefined for a bare import — sources "local" and "none". */ export type LlamaCppEntryChoice = { entryPath: string | undefined; source: "override" | "local" | "global" | "none"; }; /** What to hand smoltalk's loadLlamaCpp: an explicit entry path, or * undefined for a bare import. Pure — the probes come in as values/thunks so * tests pin each branch. Precedence: * 1. AGENCY_LLAMA_PROVIDER_MODULE (the test/advanced escape hatch; an ENTRY * PATH to a plugin-shaped module — a LlamaCPP class + resolveModel), * absolutized against cwd. * 2. Locally resolvable → undefined: smoltalk imports the bare specifier * itself (under pnpm its peer instancing picks the right copy). * 3. A global-roots hit → that path (smoltalk cannot see global installs). * 4. Nothing → undefined: smoltalk's import fails with its install hint. */ export declare function chooseEntryPath(args: { override: string | undefined; cwd: string; localEntry: string | null; globalEntry: () => string | null; }): LlamaCppEntryChoice; import type { LocalModelEventSink } from "./platform.js"; /** Bootstrap hook: when the baked/overridden config routes calls to the * llama-cpp provider, load it eagerly with the probe-assisted entry path. * smoltalk auto-loads on text() for resolvable installs; this covers the * global-CLI + global-plugin layout its bare import cannot see. Emits a * `localModelLoaded` statelog event naming the pinned model and where the * provider package came from. */ export declare function ensureConfiguredLocalProvider(execCtx: { smoltalkDefaults?: { provider?: string; model?: string; }; statelogClient?: LocalModelEventSink; }): Promise; /** Like loadLocalProvider, also returning HOW the package was found, for * callers that emit the `localModelLoaded` event. */ export declare function loadLocalProviderDetailed(): Promise<{ module: LlamaCppModule; choice: LlamaCppEntryChoice; }>; /** Load smoltalk's optional llama-cpp provider, resolving the package for * layouts smoltalk cannot see on its own (see chooseEntryPath). Caching, * idempotency, and registration live in smoltalk's loader, not here. */ export declare function loadLocalProvider(): Promise;