/** * Base harness adapter class. * * Provides default implementations for all HarnessAdapter methods. * Each harness adapter extends this class and overrides only the * methods that have truly harness-specific behavior. */ import type { PromptContext } from "../prompts/types"; import type { HarnessAdapter, HarnessCapability, HookHandlerArgs, SessionBindOptions, SessionBindResult } from "./types"; export interface AdapterConfig { /** Harness identifier (e.g. "claude-code"). */ name: string; /** Human-readable label (e.g. "Claude Code"). */ displayName: string; /** Env vars that indicate this harness is active. */ activationEnvVars: string[]; /** Capabilities advertised by this harness. */ capabilities: HarnessCapability[]; /** Term used for the mechanism that continues the orchestration loop. */ loopControlTerm: string; /** Whether this adapter auto-resolves session IDs from environment. */ autoResolvesSession: boolean; /** Env vars to check for plugin root. */ pluginRootEnvVars: string[]; /** If true, resolvePluginRoot always returns undefined (no plugin root concept). */ noPluginRoot?: boolean; /** Env vars to check for session ID (in priority order). These are "native" harness vars that beat AGENT_SESSION_ID. */ sessionIdEnvVars: string[]; /** Env vars checked AFTER AGENT_SESSION_ID and PID marker (lower priority fallbacks). */ fallbackSessionIdEnvVars?: string[]; /** * If set, only these hook types are supported. `supportsHookType()` returns * true only for types in this set. If undefined, all hook types are supported. */ supportedHookTypes?: string[]; /** * If true, the adapter does not support any hooks (supportsHookType always * returns false and handleStopHook/handleSessionStartHook are no-ops). */ noHookSupport?: boolean; /** * Whether bindSession should auto-release sessions from terminal runs. * Default: false. */ autoReleaseStale?: boolean; /** Custom hint for missing session ID. If undefined, uses generic hint. */ missingSessionIdHint?: string; /** Custom messages for specific unsupported hook types. */ unsupportedHookMessages?: Record; /** Capabilities list for prompt context. */ promptCapabilities: string[]; /** Plugin root variable expression for shell interpolation. */ pluginRootVar: string; /** Whether orchestration uses stop-hook (true) or in-turn (false). */ hookDriven: boolean; /** Name of the interactive question tool. */ interactiveToolName: string; /** Description of session env var resolution. */ sessionEnvVars: string; /** Whether this harness supports intent fidelity checks. */ hasIntentFidelityChecks: boolean; /** Whether this harness has non-negotiables section. */ hasNonNegotiables: boolean; } export declare abstract class BaseHarnessAdapter implements HarnessAdapter { protected readonly config: AdapterConfig; constructor(config: AdapterConfig); get name(): string; isActive(): boolean; autoResolvesSessionId(): boolean; resolveSessionId(parsed: { sessionId?: string; }): string | undefined; resolveStateDir(args: { stateDir?: string; pluginRoot?: string; }): string | undefined; resolvePluginRoot(args: { pluginRoot?: string; }): string | undefined; getCapabilities(): HarnessCapability[]; getPromptContext(opts?: { interactive?: boolean | undefined; }): PromptContext; bindSession(opts: SessionBindOptions): Promise; handleStopHook(args: HookHandlerArgs): Promise; handleSessionStartHook(args: HookHandlerArgs): Promise; findHookDispatcherPath(_startCwd: string): string | null; getMissingSessionIdHint(): string; supportsHookType(hookType: string): boolean; getUnsupportedHookMessage(hookType: string): string; } //# sourceMappingURL=BaseAdapter.d.ts.map