/** * install-opencode — forgen 을 OpenCode host 에 설치 (W3-3 P1). * * OpenCode 는 in-process TS plugin + opencode.json(c) MCP + AGENTS.md 를 쓴다: * 1. plugin: `~/.config/opencode/plugins/forgen.ts` (assets/opencode/forgen.ts 배포). * GUARD_CMD 는 절대 forgen CLI 경로로 치환(런타임 PATH 비의존 — 리뷰 MED4). * 2. MCP: 기존 config 파일(opencode.jsonc 우선, 없으면 opencode.json)에 mcp.forgen-compound * surgical 병합. **JSONC 파서(jsonc-parser)로 주석/trailing-comma 보존**, 쓰기 전 백업 * (리뷰 HIGH: JSON.parse 가 공식 JSONC 를 clobber 하던 데이터 손실 수정). * 3. AGENTS.md: cwd 의 forgen rules block (Codex 헬퍼 재사용). */ export interface OpencodeInstallOptions { pkgRoot: string; dryRun?: boolean; registerMcp?: boolean; /** ~/.config/opencode override (격리 테스트용). */ opencodeConfigDir?: string; /** AGENTS.md 위치 override (격리 테스트용). */ agentsMdPath?: string; } export interface OpencodeInstallResult { configDir: string; pluginPath: string; pluginInstalled: boolean; /** 사용자 소유(비-managed) plugin 을 백업했으면 그 경로. */ pluginBackupPath?: string; mcpRegistered: boolean; mcpAlreadyPresent: boolean; /** MCP 대상 config 파일(.jsonc 우선). */ mcpConfigPath: string; /** 파싱 불가 config 라 MCP 를 건드리지 않고 abort 했으면 true(데이터 손실 방지). */ mcpSkippedUnparseable: boolean; /** config 백업 경로(수정 전 .bak). */ mcpBackupPath?: string; agentsMdInjected: boolean; } export declare function resolveOpencodeConfigDir(opts: OpencodeInstallOptions): string; export declare function planOpencodeInstall(opts: OpencodeInstallOptions): OpencodeInstallResult;