import { removePath } from "../files.js"; import type { AssetCatalogEntry, AssetKind, ManagedTextFileSnapshot, WirePlanManifest } from "../types.js"; interface OpenCodeLinkedAsset { assetId: string; assetKind: AssetKind; compatibilityMode: AssetCatalogEntry["compatibilityMode"]; sourcePath: string; linkPath: string; linkMode: "directory" | "file"; } /** * Provides wire open code for the lifecycle pipeline. */ export declare function wireOpenCode(options: { projectRoot: string; workspaceRoot: string; mode: "preview" | "apply" | "reset"; }): Promise; /** * Idempotently writes `.opencode/.gitignore` so OpenCode's overlay scanner * skips npm-install artefacts (node_modules, package-lock.json, etc.). * If the file already exists and already contains all required entries, * it is left untouched. Otherwise it is created / updated in place. * * Returns the entries THIS call added (empty when nothing was missing) so * the wire plan can record exact harness ownership for later strips. * * This must be called during `wire --apply` so the gitignore is present * before OpenCode starts and begins enumerating its overlay directory. */ declare function ensureOpenCodeOverlayGitignore(workspaceRoot: string): Promise; /** * Reads the optional `.opencode/package.json` and `package-lock.json` to * build a summary of the npm install footprint that OpenCode manages. * Returns `null` when no `.opencode/package.json` exists. */ declare function readOpenCodeNpmInstallSummary(workspaceRoot: string): Promise; /** * Computes what `wire opencode --apply` would do without writing anything. * * Reads the activation manifest and shared MCP asset IDs, resolves the linked * assets and native-config payloads, then returns a WirePlanManifest that * describes the prospective operation. Nothing is written to disk. */ declare function buildOpenCodeProspectivePlan(options: { projectRoot: string; workspaceRoot: string; activationRoot: string; localOverlayRoot: string; localContextRoot: string; localAgentsPath: string; }): Promise; /** * Formats a WirePlanManifest as a human-readable summary string for stdout. * * Outputs: * - header with host and timestamp * - linked paths section (count + list) * - MCP servers section * - native config operations section * - text file snapshots section * - notes section */ export declare function formatWirePlanSummary(plan: WirePlanManifest): string; declare function materializeOpenCodeLinkedAsset(linkedAsset: OpenCodeLinkedAsset): Promise; declare function isOpenCodeFileLinkedAsset(assetKind: AssetKind, compatibilityMode: AssetCatalogEntry["compatibilityMode"]): boolean; declare function getManagedLinkedPaths(wirePlan: WirePlanManifest | null | undefined): string[]; declare function removeManagedLinksBestEffort(linkedPaths: string[], removeManagedLink?: typeof removePath): Promise; declare function validateManagedTextFileSnapshots(snapshots: ManagedTextFileSnapshot[] | undefined, allowedPaths: string[], wirePlanPath: string): ManagedTextFileSnapshot[] | undefined; declare function restoreManagedTextFileSnapshot(filePath: string, snapshots: ManagedTextFileSnapshot[] | undefined): Promise; declare function toLoggableErrorMessage(error: unknown): string; /** * Exposes focused OpenCode wire helpers for behavioral coverage. */ export declare const openCodeWireInternals: { getManagedLinkedPaths: typeof getManagedLinkedPaths; materializeOpenCodeLinkedAsset: typeof materializeOpenCodeLinkedAsset; isOpenCodeFileLinkedAsset: typeof isOpenCodeFileLinkedAsset; validateManagedTextFileSnapshots: typeof validateManagedTextFileSnapshots; restoreManagedTextFileSnapshot: typeof restoreManagedTextFileSnapshot; removeManagedLinksBestEffort: typeof removeManagedLinksBestEffort; toLoggableErrorMessage: typeof toLoggableErrorMessage; ensureOpenCodeOverlayGitignore: typeof ensureOpenCodeOverlayGitignore; readOpenCodeNpmInstallSummary: typeof readOpenCodeNpmInstallSummary; buildOpenCodeProspectivePlan: typeof buildOpenCodeProspectivePlan; }; export {};