/** * Claude Code harness instantiation of the local-agent family. Registers the * `claude-code` harness into the core registry: scoped home under the shared * homes root (`CLAUDE_CONFIG_DIR`), endpoint-key authentication (the scope's * `endpoint-auth.json` over the plugin config's `baseUrl`/`apiKey`/ * `authToken` triple — no OAuth, no browser flow, nothing to authorize inside * a container), and project-file session records. Delegation mounts through * the `claude-local` provider (one-shot `claude -p` under the scoped home); * the bundle patch's `tool-subagent-claude-code-local` row puts the tool on * the profile root, so every agent preset can delegate. * * @module @khorsheed/dsh-local-agent-claude-code */ import type { Context } from '@deepseek-ai/cordis'; import z from '@deepseek-ai/schemastery'; import type { LocalAgentUnrecordedDeclaration } from '@khorsheed/dsh-local-agent'; /** * What claude's stream-json never reports (batch 5 S1), copied onto every * execution's `local-agent/execution` end record: * - `internal-calls`: the CLI's own side calls never reach the stream as * assistant events. In the recorded sample * (tests/fixtures/stream-json.sample.jsonl) the result's `modelUsage` * counts 735 input / 148 output tokens, `result.usage` 4 / 129, and no * streamed call accounts for the rest. An auto-compaction's summary call * is such a call too (the stream parser has no `compact_boundary` case). * - `compaction` (compact): a `/compact` round runs as a plain prompt — the * provider ignores the intent's `operation` — and no * `local-agent/compaction` is written. */ export declare const CLAUDE_CODE_UNRECORDED: LocalAgentUnrecordedDeclaration; /** Stable Cordis plugin name; the bundle patch row id. */ export declare const name = "local-agent-claude-code"; /** Services required before the harness can register. */ export declare const inject: string[]; /** Plugin config: the permission mode fresh delegations default to, the endpoint credential, plus the live driver. */ export interface Config { /** * `claude -p` permission handling; `skip` passes * `--dangerously-skip-permissions` so the child can write files without an * interactive approval prompt. Defaults to `skip` because a one-shot CLI * subagent has no approval surface. */ permissionMode?: 'skip' | 'normal'; /** * The model every delegation round starts the CLI with (`claude -p --model * `, the same flag in resident mode). Absent — the default — passes * NO model flag at all: the scoped `settings.json`'s own `model`, or the * CLI's built-in default with none, decides exactly as it did before this * key existed. The settings card writes the same key, so a change applies * to the next round without a reload. */ model?: string; /** * The deployment-level endpoint: `ANTHROPIC_BASE_URL` for every delegation * (e.g. a relay like `https://openproxy.to/claude`, or absent for the * official API). A scope's own `endpoint-auth.json` overrides it field by * field — the settings card's credential form edits THAT file (never the * profile). See endpoint-auth.ts for the whole auth model — there is no * OAuth path in this package. */ baseUrl?: string; /** * The deployment-level credential, sent as `ANTHROPIC_API_KEY` (the * `x-api-key` header). Keep it in the LOCAL profile row only — never commit * it (the repo hygiene gate blocks credential-shaped strings, but the * profile is not the repo's business). */ apiKey?: string; /** * The deployment-level credential, sent as `ANTHROPIC_AUTH_TOKEN` (the * `Authorization: Bearer` header) — some relays expect Bearer instead of * `x-api-key`. When both keys are set the CLI's own precedence applies. */ authToken?: string; /** * HTTP proxy for the child CLI's own traffic, provisioned into the scoped * `settings.json` env block. Needed when the host process environment * carries no proxy (a supervisor-spawned instance does not inherit the * user's shell exports). Distinct from {@link baseUrl}: this is a local * traffic forwarder, not the model endpoint. */ proxyUrl?: string; /** * Live driver: keep one resident stream-json process per member and drive * turns over stdin messages (runtime-level graceful interrupt, same-shape * push stream) instead of one `claude -p` process per round. Default off; * the exec one-shot stays the fallback whenever the channel cannot come up. */ live?: boolean; /** Idle lifetime of an unused resident runtime before reclaim. */ liveIdleMs?: number; /** @deprecated Accepted for old profiles; live output is always incremental. */ liveMirrorGranularity?: 'event' | 'token'; /** Model identifiers the settings card saved before (settings field). */ recentModels?: readonly string[]; } export declare const Config: z; /** The permission mode a fresh delegation defaults to. */ export declare const DEFAULT_PERMISSION_MODE: NonNullable; /** * Register the Claude Code harness into the local-agent registry. * @param ctx - plugin context carrying the registry. * @param config - plugin config; `permissionMode` selects the `claude -p` policy. */ export declare function apply(ctx: Context, config: Config): void; //# sourceMappingURL=index.d.ts.map