import type { Provider } from "@earendil-works/pi-ai"; import type { ExtensionAPI, ProviderConfig } from "@earendil-works/pi-coding-agent"; /** * The `provider/id` key a Pi child launched with `extensions: false` must * resolve. The worker sets it only when it also loads this bridge with `-e`. */ export declare const PROVIDER_BRIDGE_MODEL_ENV = "PI_FABRIC_EXTENSION_MODEL"; export interface ExtensionProviderRegistrations { configs: Array<{ name: string; config: ProviderConfig; extensionPath: string; }>; natives: Array<{ provider: Provider; extensionPath: string; }>; } export interface ResolveExtensionProvidersOptions { model: string; cwd: string; agentDir: string; /** Extension entry files never probed (Fabric's own entries by default). */ exclude?: readonly string[]; } type PiSdk = typeof import("@earendil-works/pi-coding-agent"); /** Split a canonical `provider/id` key at its first slash. */ export declare function parseModelKey(key: string): { provider: string; id: string; } | undefined; /** * Probe extensions whose own path names the provider first (the usual * `pi--provider` package), so the common case runs one registration * function instead of every installed extension. */ export declare function orderProviderCandidates(paths: readonly string[], provider: string): { named: string[]; rest: string[]; }; /** * Fabric's own manifest entries: they never register chat providers. Entries * of bundled Pi packages are not Fabric's own: they stay probe candidates, * so a bundled provider can resolve without loading * Fabric's main extension. */ export declare function fabricExtensionEntries(moduleUrl?: string): string[]; /** * Find the extension registrations that make `model` resolvable in a child * without its other extensions. Returns `undefined` when Pi can already serve * the model on its own (a known model whose API a built-in provider streams), * so those children keep their exact extension-free behaviour. Throws an * actionable error when the model is unknown and no installed extension * registers its provider. */ export declare function resolveExtensionProviders(options: ResolveExtensionProvidersOptions, sdk?: PiSdk): Promise; /** * Loaded with `-e` into Pi children launched with `extensions: false`. It * registers only the requested model's provider, as its extension registered * it, so credentials still resolve in the child through auth.json, the * environment, or the credential store. Nothing else from that extension loads. */ export default function fabricProviderBridge(pi: ExtensionAPI): Promise; export {}; //# sourceMappingURL=provider-bridge.d.ts.map