import type { AssetCatalogEntry, AssetKind, HostTarget } from "../types.js"; import type { WireMode } from "./types.js"; import { type ExtensionInstallAction } from "./extension-installer.js"; import { type CompatibleHost } from "./compatibility-matrix.js"; export type { WireMode } from "./types.js"; /** * Defines the supported lifecycle host values. */ export type LifecycleHost = "copilot-vscode" | "opencode"; /** * Defines the supported host behavior values. */ export type HostBehavior = "stage" | "wire" | "native-install" | "auth-assist" | "runtime-validation"; /** * Describes host capability data exchanged by the lifecycle pipeline. */ export interface HostCapability { assetKind: AssetKind; behaviors: HostBehavior[]; } /** * Describes host runtime spec data exchanged by the lifecycle pipeline. */ export interface HostRuntimeSpec { executable: string; versionArgs?: string[]; readinessArgs?: string[]; guidance?: string; requiredFor?: HostBehavior[]; } /** * Describes host native install provider data exchanged by the lifecycle pipeline. */ export interface HostNativeInstallProvider { assetKind: AssetKind; collectActions(assets: AssetCatalogEntry[]): ExtensionInstallAction[]; } /** * Describes host adapter data exchanged by the lifecycle pipeline. */ export interface HostAdapter { id: string; aliases: string[]; displayName: string; lifecycleHost: LifecycleHost; recommendationHost: HostTarget; defaultBundleIds: string[]; mutatesHostPaths: boolean; requiresLifecycleHostPaths?: boolean; runtime?: HostRuntimeSpec; nativeInstall?: HostNativeInstallProvider; capabilities: HostCapability[]; wire(options: { projectRoot: string; workspaceRoot: string; mode: WireMode; }): Promise; } /** * Provides register host adapter for the lifecycle pipeline. */ export declare function registerHostAdapter(adapter: HostAdapter): void; /** * Test-only: replaces the adapter registry wholesale. `registerHostAdapter` * mutates by id, which permanently changes the shared registry; suites that * register fixture adapters must snapshot `listHostAdapters()` first and * restore it here so a shared-process gate sees a stable registry. */ export declare function setHostAdaptersForTests(adapters: readonly HostAdapter[]): void; /** * Resolves a user-facing host target or alias to its registered adapter. */ export declare function resolveHostAdapter(target: string): HostAdapter | null; /** * Returns a snapshot of all registered host adapters. */ export declare function listHostAdapters(): HostAdapter[]; /** * Checks whether a catalog entry can be recommended for a host by combining * direct host tags, lifecycle-host reuse, and the adapter capability matrix. */ export declare function isHostCompatibleWithRecommendationHost(entryHosts: HostTarget[], recommendationHost: HostTarget, assetKind: AssetKind, compatibleHosts?: CompatibleHost[]): boolean;