import { type Exec } from '../exec.js'; import type { ResolvedRole } from '../config.js'; import type { HarnessAdapter, UnattendedCapability } from './types.js'; import { type LockDeps } from '../atomic-file.js'; import type { AcpSessionTransport } from './acp-session-transport.js'; /** * Neutral approval → native Claude mode. The ONE definition, shared by launch * and by translation so the two can never disagree about what a role will run * with. * * `allow` maps to `bypassPermissions`, not `dontAsk`. `dontAsk` suppresses the * PROMPT, not the denial: an unattended role configured with the operator's * explicit `approval: allow` was silently refused the actions it was told to * take, with no prompt and no error to show for it. Only an explicit `allow` * gets this; `ask` and `deny` are never elevated. */ export declare function nativePermissionMode(approval: ResolvedRole['permissions']['approval']): string | undefined; /** * What an unattended role can actually do under a native mode. Derived from the * NATIVE mode, so an operator's explicit `harness_options.permission_mode` * override is judged on what it really grants. */ export declare function claudeCapabilities(mode: string | undefined, filesystem: ResolvedRole['permissions']['filesystem']): UnattendedCapability[]; export declare function autocompactPct(role: ResolvedRole): number; /** * Pre-trust a dir in ~/.claude.json so the first launch never blocks on the * trust dialog. * * `~/.claude.json` is SHARED by every role and by the operator's own Claude * Code. The previous read-modify-write held nothing while it worked, so two * roles starting together interleaved and one silently lost its trust entry — * and that role then blocked on the dialog it was supposed to be spared, * unattended, with nobody to answer it. A crash mid-write truncated the file * for everyone. * * Now: take a cross-process lock, re-read inside it, merge ONLY this project's * entry so unrelated operator state survives untouched, and replace the file * atomically. Never fatal — a role that cannot be pre-trusted still launches. */ export declare function pretrust(dir: string, deps?: { log?(line: string): void; lock?: LockDeps; }): Promise; export declare function makeClaudeCodeAdapter(exec?: Exec, transport?: AcpSessionTransport): HarnessAdapter; export declare const claudeCodeAdapter: HarnessAdapter;