import type { ClaudeMcpServerEntry } from "../agy/mcp-installer.js";
/** Marker field tagged onto every Lisa-owned MCP server entry. */
export declare const LISA_MANAGED_MARKER: "_lisaManaged";
/** A stdio MCP server in OpenCode's shape (`command` is an argv array). */
export interface OpencodeLocalMcpEntry {
    readonly type: "local";
    readonly command: readonly string[];
    readonly environment?: Readonly<Record<string, string>>;
    readonly enabled: boolean;
    readonly [LISA_MANAGED_MARKER]?: boolean;
}
/** An HTTP MCP server in OpenCode's shape (`url`, not `command`). */
export interface OpencodeRemoteMcpEntry {
    readonly type: "remote";
    readonly url: string;
    readonly headers?: Readonly<Record<string, string>>;
    readonly enabled: boolean;
    readonly [LISA_MANAGED_MARKER]?: boolean;
}
/** Any MCP server entry in OpenCode's `mcp` map. */
export type OpencodeMcpServerEntry = OpencodeLocalMcpEntry | OpencodeRemoteMcpEntry;
/** Top-level `opencode.json` shape, narrowed to the keys this module touches. */
export interface OpencodeConfigShape {
    readonly mcp?: Readonly<Record<string, OpencodeMcpServerEntry>>;
}
/** Result of the OpenCode MCP install pass. */
export interface OpencodeMcpInstallResult {
    /** Absolute path written. */
    readonly path: string;
    /** Number of Lisa-managed entries written. */
    readonly lisaEntryCount: number;
    /** Number of host-authored entries preserved. */
    readonly hostEntryCount: number;
}
/**
 * Resolve the absolute path to a project's `opencode.json`.
 * @param destDir - Absolute path to the host project root.
 * @returns Absolute path to `<destDir>/opencode.json`.
 */
export declare function resolveOpencodeConfigPath(destDir: string): string;
/**
 * Translate a Claude/Codex-shape MCP entry to OpenCode's shape.
 *
 * Rules:
 *   - stdio (`command` present): `type: "local"`, fold `command` + `args` into
 *     a single argv array, rename `env` → `environment`, set `enabled: true`.
 *   - http/sse (`url` present): `type: "remote"`, keep `url` + `headers`, set
 *     `enabled: true`.
 *
 * The `_lisaManaged` marker is attached at write time, not in this pure transform.
 * Throws if the entry has neither `command` nor `url` (un-translatable).
 * @param input - Claude/Codex-format MCP server entry.
 * @returns OpenCode-format MCP server entry.
 */
export declare function translateMcpEntryToOpencode(input: ClaudeMcpServerEntry): OpencodeMcpServerEntry;
/**
 * Install Lisa's MCP servers into `<destDir>/opencode.json` using tagged-merge.
 *
 * Always call this — even with an empty `lisaMcpServers` — so previously written
 * `_lisaManaged` entries are stripped when a project stops shipping MCP servers.
 * @param lisaMcpServers - Lisa's MCP servers in Claude/Codex shape, keyed by name.
 * @param configPath - Absolute path to the target `opencode.json`.
 * @returns Result with the path written and entry counts.
 */
export declare function installOpencodeMcpConfig(lisaMcpServers: Readonly<Record<string, ClaudeMcpServerEntry>>, configPath: string): Promise<OpencodeMcpInstallResult>;
/** Merge outcome: the rewritten document plus Lisa/host entry counts. */
interface McpMergeResult {
    readonly text: string;
    readonly lisaEntryCount: number;
    readonly hostEntryCount: number;
}
/**
 * Merge Lisa's MCP servers into the `mcp` key of an `opencode.json` document.
 * Pure function for testability; `installOpencodeMcpConfig` is the I/O wrapper.
 *
 * Tagged-merge rules:
 *   1. Translate + tag Lisa's entries with `_lisaManaged: true`.
 *   2. Drop every existing entry already tagged `_lisaManaged` (Lisa's prior run).
 *   3. Preserve host-authored entries (untagged) verbatim.
 *   4. Rewrite only the `mcp` key; the rest of the document is untouched.
 *
 * Throws on invalid JSONC so a corrupt host file is surfaced, not overwritten.
 * @param existingJsonc - Current contents of `opencode.json` (or "").
 * @param lisaMcpServers - Lisa's MCP servers in Claude/Codex shape, keyed by name.
 * @returns The merged document text and entry counts.
 */
export declare function mergeMcpServers(existingJsonc: string, lisaMcpServers: Readonly<Record<string, ClaudeMcpServerEntry>>): McpMergeResult;
export {};
//# sourceMappingURL=mcp-installer.d.ts.map