import type { CanonicalPromptEvent, CanonicalTerminalEvent, CanonicalToolCallEvent, CanonicalToolNameResolution, CanonicalToolResultEvent, HostToolProjection, HostTranscriptSource } from './host-runtime-events.js'; export type CapabilityStatus = 'supported' | 'degraded' | 'unavailable'; export type HostCapabilityMechanism = 'native' | 'adapter_backed' | 'instruction_backed' | 'reference_only' | 'unsupported'; export type HostCapability = 'hooks.session_start' | 'hooks.prompt_submit' | 'hooks.pre_tool_use' | 'hooks.post_tool_use' | 'hooks.stop' | 'hooks.session_end' | 'mcp.stdio' | 'mcp.http' | 'skills.native' | 'instructions.project' | 'session.history'; export interface CapabilityResolution { capability: HostCapability; status: CapabilityStatus; mechanism?: string; enforcement?: HostCapabilityMechanism; reason?: string; fallback?: string; } export interface HostDetectionContext { projectRoot: string; homeDir?: string; env?: NodeJS.ProcessEnv; explicitHost?: string; } export interface HostRuntimeContext extends HostDetectionContext { } export interface McpServerProjection { command?: string; args?: string[]; url?: string; env?: Record; } export type ProjectionArtifact = 'mcp' | 'plugin' | 'skills' | 'instructions'; export type ProjectionStatus = 'written' | 'unchanged' | 'degraded' | 'skipped' | 'failed'; export interface ProjectionResult { artifact: ProjectionArtifact; status: ProjectionStatus; changed: boolean; path?: string; message: string; } export interface McpConfigAdapter { readonly hostId: string; readonly format: 'json' | 'toml'; configPaths(context: HostRuntimeContext): string[]; readonly ownedServerName: string; project(context: HostRuntimeContext, server: McpServerProjection): ProjectionResult; } export interface SkillProjectionSource { pluginRoot?: string; skillsDirectory?: string; instructionContent?: string; } export interface SkillProjectionAdapter { readonly native: boolean; targetDirectories(context: HostRuntimeContext): string[]; readonly fallback?: string; project(context: HostRuntimeContext, source: SkillProjectionSource): ProjectionResult[]; } export interface SessionAdapter { historyPaths(context: HostRuntimeContext): string[]; status: CapabilityStatus; } export interface HookAdapter { nativeEvents: HostCapability[]; profileSupport: Array<'minimal' | 'standard' | 'strict'>; } export interface HostWorkerLaunchRequest { workerId: string; worktreePath: string; taskFile: string; handoffFile: string; statusFile: string; sessionId: string; executionId: string; contextReceipt: string; timeoutMs: number; } export interface HostWorkerLaunchProjection { status: CapabilityStatus; command?: string; args: string[]; env: Record; detached: boolean; completionFormat: 'json-lines' | 'json' | 'handoff-file'; reason?: string; } export interface HostWorkerAdapter { project(request: HostWorkerLaunchRequest): HostWorkerLaunchProjection; } export interface HostRuntimeAdapter { normalizePrompt(event: unknown, context: HostRuntimeContext): CanonicalPromptEvent; normalizeToolCall(event: unknown, context: HostRuntimeContext): CanonicalToolCallEvent; normalizeToolResult(event: unknown, context: HostRuntimeContext): CanonicalToolResultEvent; normalizeTerminal(event: unknown, context: HostRuntimeContext): CanonicalTerminalEvent; resolveCanonicalTool(hostToolName: string, input?: Record): CanonicalToolNameResolution; projectCanonicalTool(canonicalToolName: string): HostToolProjection; transcriptSources(context: HostRuntimeContext): HostTranscriptSource[]; } export interface HostAdapter { readonly id: string; readonly aliases: readonly string[]; detect(context: HostDetectionContext): Promise; capabilities(context: HostRuntimeContext): Promise; mcp: McpConfigAdapter; skills: SkillProjectionAdapter; sessions: SessionAdapter; hooks?: HookAdapter; runtime?: HostRuntimeAdapter; workers?: HostWorkerAdapter; } export interface SelectedHostAdapter { status: 'selected'; adapter: HostAdapter; candidates: Array<{ id: string; score: number; }>; explicit: boolean; } export type HostSelectionFailureCode = 'unknown_explicit_host' | 'ambiguous_detection' | 'no_host_detected'; export interface HostAdapterSelectionFailure { status: 'failed'; code: HostSelectionFailureCode; candidates: Array<{ id: string; score: number; }>; availableHosts: string[]; reason: string; action: string; } export type HostAdapterSelection = SelectedHostAdapter | HostAdapterSelectionFailure; export declare class HostAdapterRegistry { private readonly adapters; register(adapter: HostAdapter): void; list(): HostAdapter[]; select(context: HostDetectionContext): Promise; } export declare function resolvedHome(context: HostDetectionContext): string; export declare function pathScore(path: string, score: number): number; export declare function capability(capabilityName: HostCapability, status: CapabilityStatus, mechanism?: string, reason?: string, fallback?: string, enforcement?: HostCapabilityMechanism): CapabilityResolution; //# sourceMappingURL=host-adapter.d.ts.map