/**
 * bootRegistration — production registration of the Anthropic adapters.
 *
 * This is the "separate cycle" deferred when the Phase-5 routing policy was
 * installed at server boot: the policy was wired but NO adapters were ever
 * registered against the providers registry, so `registry.resolve()` had
 * nothing to choose between and the cost-aware routing was a no-op. This
 * module closes that gap (Rule 1 of
 * specs/provider-portability/04-anthropic-path-constraints.md — the
 * subscription-backed interactive pool must be an operational floor, not a
 * designed-only one).
 *
 * Properties (all load-bearing for the server boot path):
 *   - GATED: never registers Claude adapters on a codex-only agent
 *     (process-level claudeForbidden flag + enabledFrameworks check).
 *   - IDEMPOTENT: re-entering startServer in the same process (tests,
 *     in-proc respawn) does not double-register or clobber.
 *   - LAZY: registration spawns NOTHING. Both adapter factories are pure
 *     in-memory construction; the interactive pool only spawns tmux REPL
 *     sessions on first use (or an explicit `start()`).
 *   - HONEST CREDIT READS: `readSdkCredit` is plumbed from the headless
 *     adapter's UsageMeterProvider (GET /api/oauth/usage). Unknown state
 *     (no OAuth credential, API error, no agentSdkCredit field yet) returns
 *     null, which the CostAwareRoutingPolicy treats as "fall to the
 *     subscription floor" — conservative by design.
 */
import { Registry, type ProviderAdapter } from './registry.js';
import type { ProviderId } from './types.js';
import type { AgentSdkCreditSnapshot } from './primitives/observability/usageMeterProvider.js';
import { type AnthropicHeadlessConfig } from './adapters/anthropic-headless/index.js';
import { type InteractivePoolAdapter } from './adapters/anthropic-interactive-pool/index.js';
import type { InteractivePoolConfig } from './adapters/anthropic-interactive-pool/config.js';
export interface RegisterAnthropicAdaptersOptions {
    /**
     * The agent's enabled frameworks (InstarConfig.enabledFrameworks). When
     * unset or empty, defaults to ['claude-code'] — the historical behavior,
     * matching the migrator's reading of the same field.
     */
    enabledFrameworks?: ReadonlyArray<string>;
    /** Detected `claude` binary path. Unset → adapter env defaults. */
    claudePath?: string;
    /** Detected `tmux` binary path. Unset → adapter env defaults. */
    tmuxPath?: string;
    /** Overrides for the headless adapter config (credential, model, ...). */
    headless?: Partial<AnthropicHeadlessConfig>;
    /** Overrides for the interactive-pool config (poolSize, model, workingDirectory, ...). */
    pool?: Partial<InteractivePoolConfig>;
    /** Registry to register against. Defaults to the module singleton. */
    registryInstance?: Registry;
    /** TTL for the cached SDK-credit read (ms). Default 60s. */
    creditCacheTtlMs?: number;
}
export interface RegisterAnthropicAdaptersResult {
    /** Adapter ids newly registered by THIS call. */
    registered: ProviderId[];
    /** Adapter ids that were already present (idempotent re-entry). */
    alreadyRegistered: ProviderId[];
    /** Set when the gate skipped registration entirely. */
    skippedReason?: 'claude-forbidden' | 'claude-code-not-enabled';
    /** The headless adapter (undefined when skipped). */
    headless?: ProviderAdapter;
    /** The interactive-pool adapter (undefined when skipped). */
    pool?: InteractivePoolAdapter;
    /**
     * Real SDK-credit reader for CostAwareRoutingPolicy. Returns null when
     * the state is unknown (skipped registration, no credential, API error,
     * or Anthropic not yet exposing the credit pot) — never throws.
     */
    readSdkCredit: () => Promise<AgentSdkCreditSnapshot | null>;
}
/**
 * Build a TTL-cached SDK-credit reader from the headless adapter's
 * UsageMeterProvider. Bounded cost: at most one GET /api/oauth/usage per
 * TTL window regardless of routing-decision volume.
 */
export declare function buildReadSdkCredit(headless: ProviderAdapter, ttlMs?: number): () => Promise<AgentSdkCreditSnapshot | null>;
/**
 * Register both Anthropic adapters with the providers registry, gated and
 * idempotent (including under concurrent calls). See module docstring for
 * the contract.
 */
export declare function registerAnthropicAdapters(options?: RegisterAnthropicAdaptersOptions): Promise<RegisterAnthropicAdaptersResult>;
export interface RegisterPiAdaptersOptions {
    /**
     * The agent's enabled frameworks (InstarConfig.enabledFrameworks). pi is
     * ADDITIVE and ships dark: registration happens ONLY when 'pi-cli' is
     * explicitly present — unset/empty means NOT enabled (the inverse of the
     * Anthropic default, deliberately: existing agents see zero change).
     */
    enabledFrameworks?: ReadonlyArray<string>;
    /** Detected `pi` binary path. Unset → adapter env detection. */
    piPath?: string | null;
    /** The pi `--model` pattern (frameworkDefaultModels['pi-cli']). */
    model?: string;
    /** Subscription-guard override (config `piCli.allowAnthropicProviders`). */
    allowAnthropicProviders?: boolean;
    /** Session-dir for RPC sessions (durable transcripts). */
    sessionDir?: string;
    /** Target registry override for tests. */
    registryInstance?: Registry;
}
export interface RegisterPiAdaptersResult {
    registered: ProviderId[];
    alreadyRegistered: ProviderId[];
    skippedReason?: 'pi-not-enabled' | 'pi-binary-missing';
    adapter?: ProviderAdapter;
}
/**
 * Register the pi-cli adapter, gated and idempotent (mirrors
 * registerAnthropicAdapters' contract):
 *
 *   - GATED on explicit opt-in: `enabledFrameworks` must contain 'pi-cli'.
 *   - GATED on the binary: a configured-but-missing pi degrades to a
 *     skip + doctor-visible reason, never a boot failure.
 *   - IDEMPOTENT including under concurrent calls (single-flight).
 *   - LAZY: pure in-memory construction; nothing spawns at registration.
 *   - GUARDED: the adapter's transports enforce the Anthropic-deny
 *     subscription guard at every call construction (spec §4.3).
 */
export declare function registerPiAdapters(options?: RegisterPiAdaptersOptions): Promise<RegisterPiAdaptersResult>;
//# sourceMappingURL=bootRegistration.d.ts.map