import { type AgentRegistryRecord } from "../utils/json-schemas.js"; export type InstallState = "absent" | "arcs-managed" | "foreign-existing"; export interface ConfigMerge { path: string[]; value: unknown; /** * "overwrite" (default): always set the value at `path`, clobbering any prior user value. * "if-absent": only set the value if `path` doesn't already exist in the config. * "merge": deep-merge object values — bundle adds/updates keys but never * deletes user-owned keys. Scalars within the merged object that * already exist in user config are preserved (treated as if-absent * at the leaf level). Use for agent definitions where the bundle * owns `prompt`, `description`, `permission` shape but the user * owns `model`. * * Use "if-absent" for user-preference keys that the bundle wants to seed on first install * but must never re-stamp on subsequent re-deploys. Concretely: provider/model routing * (top-level `model`, `small_model`, `agent..model`) is user-territory once chosen. * Re-stamping it broke OpenCode session naming for users whose actual provider differs * from the bundle defaults — see fix(bundle): preserve user provider/model choices. */ mode?: "overwrite" | "if-absent" | "merge"; } export interface SourceArcsBundleManifest { bundleId: string; installMode: string; bundleVersionSource: string; sourceRoot: string; skills: { source: string; destination: string; }; agents: AgentRegistryRecord[]; ownedPaths: string[]; plugin: { required: boolean; source: string; destination: string; }; config: { requiredMerges: ConfigMerge[]; }; } export interface InstalledArcsBundleManifest { bundleId: string; installMode: string; sourceBundleVersion: string; sourceBundleHash: string; installedAt: string; ownedPaths: string[]; agents?: InstalledAgentOwnership[]; } export interface InstalledAgentOwnership { id: string; promptDestination: string; sourceHash: string; configKey?: string; configHash?: string; } export interface InstallDetectionResult { state: InstallState; installedManifest: InstalledArcsBundleManifest | null; } export interface SourceBundleInfo { bundleId: string; sourceBundleVersion: string; sourceBundleHash: string; } export interface InstallPlan { pathsToWrite: string[]; pathsToRemove: string[]; sourceBundleVersion: string; sourceBundleHash: string; requiredConfigMerges: ConfigMerge[]; } export interface InstallOptions { autoConfirmReplacement?: boolean; } interface InstallHooks { afterConfigPreparedBeforeManifestWrite?: () => void; } export interface InstallResult { status: "installed"; summary: string; } export declare function opencodeRootDir(): string; export declare function arcsInstalledManifestPath(): string; export declare function opencodeConfigPath(): string; export declare function readSourceArcsBundleManifest(): SourceArcsBundleManifest; export declare function readInstalledArcsBundleManifest(): InstalledArcsBundleManifest | null; export declare function writeInstalledArcsBundleManifest(manifest: InstalledArcsBundleManifest): void; export declare function detectArcsBundleInstall(sourceManifest?: SourceArcsBundleManifest): InstallDetectionResult; export declare function getSourceArcsBundleInfo(): SourceBundleInfo; export declare function buildArcsBundleInstallPlan(): InstallPlan; export declare function installArcsBundle(options?: InstallOptions): InstallResult; export declare function installArcsBundleWithHooks(options?: InstallOptions & { hooks?: InstallHooks; }): InstallResult; export {}; //# sourceMappingURL=bundle-installer.d.ts.map