/**
 * agent_bridge — pack binding (WAB.6 + WAB-SUB.2 mode dispatcher, 0.5.106).
 *
 * Specs: `docs/tasks/T-warm-agent-chat-bridge.md` WAB.6 §"pack_binding.ts"
 * + WAB-SUB.2 §"mode dispatcher". Architecture: `WAB.1-architecture.md`
 * decisions (e) + (g).
 *
 * Responsibility:
 *   `buildChatToolDispatcher` reads the pack's `chat_agent.yaml` (or a
 *   built-in fallback), resolves the model alias to a discriminated
 *   `runner` descriptor (api vs subscription), loads the system prompt,
 *   filters built-in tools per `disable_builtins`, opts in skills
 *   (warn-and-skip on unknown), and returns a `SimpleToolDispatcher` +
 *   the runtime tunables.
 *
 * Mode dispatch (WAB-SUB.2): both `api` and `subscription` are first-class.
 * The dispatcher switches on `runner.mode` once per turn — `api` calls
 * `runAgentTurn`, `subscription` calls `runAgentTurnSubscription`. Future
 * modes (local, mcp) throw "mode not yet implemented" with a setup-chat hint.
 *
 * Hard-fails: alias missing from modelsConfig; api mode missing `model`;
 * subscription mode missing `cli`; mode = local | mcp (unimplemented).
 *
 * Non-responsibility: does NOT construct the Anthropic SDK client (lazy in
 * daemon.ts), does NOT instantiate RagBackend (daemon-owned), does NOT call
 * setup (misconfiguration surfaces as a thrown error).
 *
 * Imports from: ../../models/dispatcher.js, ../../packs/schemas/chat_agent.js,
 *   ./tool_dispatcher.js, ./tools/index.js, ./types.js, node:fs/promises,
 *   node:path.
 * Imported by: daemon.ts, test sibling.
 */
import type { ModelAliasConfig } from '../../models/types.js';
import type { Pack } from '../../runtime/types.js';
import type { RagBackend } from '../../rag/types.js';
import type { SecretResolver } from '../../secrets/types.js';
import { type DaemonSendFn, type MakeStoreLessonHandlerOptions } from './tools/index.js';
import type { ToolDispatcher } from './types.js';
export interface BuildChatToolDispatcherOptions {
    /** The loaded pack (output of `loadPack`). */
    pack: Pack;
    /** Absolute path to the pack folder (for resolving `system_prompt` files). */
    packRoot: string;
    /** User's `models.yaml` content (alias → ModelAliasConfig). */
    modelsConfig: Record<string, ModelAliasConfig>;
    /** RAG backend shared across all sessions for the `recall` tool. */
    ragBackend: RagBackend;
    /** Required by `api` mode strategies — throws if absent and alias is api. */
    secrets?: SecretResolver;
    /** Override daemon-send for `chat_send` (tests). */
    daemonSend?: DaemonSendFn;
    /** Override store_lesson clock + path resolution (tests). */
    storeLessonOpts?: MakeStoreLessonHandlerOptions;
    /** Structured warn sink — unknown skill names + future degraded signals. */
    onWarn?: (message: string) => void;
}
/**
 * Resolved agent-turn runner — discriminated union the dispatcher branches
 * on. `api` carries the concrete model id; `subscription` carries the CLI
 * binary + base args from `models.yaml`. Both modes are first-class.
 */
export type ResolvedAgentTurn = {
    mode: 'api';
    model: string;
} | {
    mode: 'subscription';
    cli: string;
    args: string[];
};
export interface BuildChatToolDispatcherResult {
    dispatcher: ToolDispatcher;
    systemPrompt: string;
    /** Daemon + dispatcher switch on `.mode` to pick runAgentTurn vs runAgentTurnSubscription. */
    runner: ResolvedAgentTurn;
    /** Human-readable model label: concrete model id (api) or cli name (subscription).
     *  Convenience for telemetry/session-manager so they don't switch on the union. */
    resolvedModel: string;
    tunables: {
        maxToolIterations: number;
        maxTokens: number;
    };
}
export declare function buildChatToolDispatcher(opts: BuildChatToolDispatcherOptions): Promise<BuildChatToolDispatcherResult>;
//# sourceMappingURL=pack_binding.d.ts.map