/** * Cross-environment executor adapter that wraps the Claude Code CLI as a `DispatchExecutorFn` * destination. * * @module @nhtio/adk/batteries/llm/claude_code_cli/adapter * * @remarks * The first battery in the "CLI harness" family: rather than a direct wire-format provider, this * adapter drives an external coding-agent CLI binary that is itself a complete agent loop. Since a * subprocess must be spawned anyway, ALL Claude-Code-specific complexity — spawning the real * `claude` binary, hosting an MCP bridge server, translating its stream-json — lives in a * dedicated wrapper process (`wrapper.ts`, shipped as a sibling dist asset); this adapter only * ever spawns and drives that wrapper over the small, harness-agnostic protocol in `./wire`. * * Every dispatch iteration is stateless and self-contained: the full accumulated history renders * into one `-p` prompt string (`buildClaudeCodeCliPrompt`), a fresh wrapper is spawned, and real * ADK tools are bridged into the CLI's own tool loop via MCP — but actual execution always happens * on the ADK side, through `tool.executor(ctx)(args)`, exactly like every other LLM battery. */ import type { DispatchExecutorFn } from "../../../dispatch_runner"; import type { ClaudeCodeCliAdapterOptions } from "./types"; /** * Resolve the built wrapper asset's on-disk path relative to this module's own compiled location. * `adapter.ts` carries its own `@module` tag (per the per-file tagging convention every other * multi-file battery uses), so it compiles to `dist/batteries/llm/claude_code_cli/adapter.mjs` — * three directories below the package root, where the wrapper (an explicit, un-tagged * `vite.config.mts` entry key) compiles to `dist/claude-code-cli-wrapper.mjs`. */ export declare const resolveDefaultWrapperPath: () => string; /** * Opinionated CLI-harness LLM adapter that drives the Claude Code CLI as a `DispatchExecutorFn` * destination. * * @remarks * Construction validates options eagerly via {@link validateOptions} and throws * {@link @nhtio/adk/batteries/llm/claude_code_cli!E_INVALID_CLAUDE_CODE_CLI_OPTIONS} on failure * (including the POSIX-only platform guard and the `apiKey`/`authToken` XOR check). The returned * instance is reusable: call {@link ClaudeCodeCliAdapter.executor} once per `DispatchRunner` * configuration. */ export declare class ClaudeCodeCliAdapter { #private; /** Customary key for per-iteration overrides on `ctx.stash`. */ static readonly STASH_KEY: "claudeCodeCli"; /** * @param options - Constructor-baseline options. Re-validated on every iteration after * per-dispatch and per-iteration overrides are layered in. * @throws {@link @nhtio/adk/batteries/llm/claude_code_cli!E_INVALID_CLAUDE_CODE_CLI_OPTIONS} when * `options` does not satisfy `claudeCodeCliOptionsSchema`. */ constructor(options: unknown); /** * Returns a {@link @nhtio/adk!DispatchExecutorFn} bound to this adapter's baseline plus optional * executor-scope overrides. */ executor(overrides?: Partial): DispatchExecutorFn; /** * Returns `true` when `value` is a {@link ClaudeCodeCliAdapter} instance. */ static isClaudeCodeCliAdapter(value: unknown): value is ClaudeCodeCliAdapter; }