import type { BmadConfig } from './services/config-manager.js'; import { setupGitHubRepo, createGitHubRepo } from './services/installer.js'; import type { ProgressCallback, MergeStrategy, CreateRepoOptions, CreateRepoResult, GitHubSetupResult } from './services/installer.js'; export interface InstallApiOptions { /** 프로젝트 경로 (기본값: process.cwd()) */ path?: string; /** Git 저장소가 아닐 때 git init 실행 여부 */ gitInit?: boolean; /** GitHub 템플릿 설치 여부 (기본값: true) */ githubTemplates?: boolean; /** Git hooks 설치 여부 (기본값: true) */ gitHooks?: boolean; /** Claude Code hooks 설치 여부 (기본값: true) */ claudeHooks?: boolean; /** 기존 설치가 있을 때 덮어쓰기 여부 */ force?: boolean; /** 머지 전략 (GitHub 저장소 설정 + config.yaml + CLAUDE.md 반영) */ mergeStrategy?: MergeStrategy; /** GitHub 저장소 설정 적용 여부 (기본값: false) */ setupRepo?: boolean; /** 설치 진행 상태 콜백 */ onProgress?: ProgressCallback; } export interface InstallApiResult { /** 설치 성공 여부 */ success: boolean; /** 설치된 버전 */ version: string; /** 설치된 항목 목록 */ installedItems: string[]; /** 건너뛴 항목 목록 */ skippedItems: string[]; /** 에러 목록 */ errors: string[]; /** 백업 경로 (기존 설치 덮어쓰기 시) */ backupPath?: string; } export interface DetectResult { /** b6g 설치 감지 여부 */ detected: boolean; /** 설치된 버전 (예: 'v1.5.14') */ version: string | null; /** config.yaml 내용 */ config: BmadConfig | null; /** Git 저장소 여부 */ isGitRepo: boolean; } export type { BmadConfig, ProgressCallback, MergeStrategy, CreateRepoOptions, CreateRepoResult, GitHubSetupResult }; export { setupGitHubRepo, createGitHubRepo }; export interface CheckApiResult { /** b6g 설치 여부 */ installed: boolean; /** 설치된 버전 (예: 'v1.5.14') */ installedVersion: string | null; /** 현재 패키지(@sleighmaster/bmad)의 버전 */ packageVersion: string; /** npm registry의 최신 버전 (네트워크 오류 시 null) */ latestNpmVersion: string | null; /** 패키지 버전과 npm 최신 버전 비교 — 새 버전 있음 여부 */ updateAvailable: boolean; } export interface CheckApiOptions { /** 프로젝트 경로 (기본값: process.cwd()) */ path?: string; /** npm registry 조회 건너뛰기 (오프라인 환경용) */ skipNpmCheck?: boolean; } export interface UpdateApiOptions { /** 프로젝트 경로 (기본값: process.cwd()) */ path?: string; /** GitHub 템플릿 업데이트 여부 (기본값: true) */ githubTemplates?: boolean; /** Git hooks 업데이트 여부 (기본값: true) */ gitHooks?: boolean; /** Claude Code hooks 업데이트 여부 (기본값: true) */ claudeHooks?: boolean; /** 머지 전략 (지정 시 config.yaml + CLAUDE.md 반영) */ mergeStrategy?: MergeStrategy; /** GitHub 저장소 설정 적용 여부 */ setupRepo?: boolean; /** 실제 업데이트하지 않고 대상 버전만 확인 */ dryRun?: boolean; /** 진행 상태 콜백 */ onProgress?: ProgressCallback; } export interface UpdateApiResult { /** 업데이트 성공 여부 */ success: boolean; /** 이전 버전 (설치되어 있지 않으면 null) */ fromVersion: string | null; /** 새 버전 */ toVersion: string; /** 이미 최신 버전이었는지 */ alreadyLatest: boolean; /** dry run 모드였는지 */ dryRun: boolean; /** 설치된 항목 목록 */ installedItems: string[]; /** 건너뛴 항목 목록 */ skippedItems: string[]; /** 에러 목록 */ errors: string[]; /** 백업 경로 */ backupPath?: string; } /** * 프로젝트 경로에서 b6g 설치 여부를 감지하고 정보를 반환한다. * * @example * ```typescript * import { detect } from '@sleighmaster/bmad/api'; * * const result = await detect('/path/to/project'); * if (result.detected) { * console.log(result.version); // 'v1.5.14' * console.log(result.config); // BmadConfig 객체 * } * ``` */ export declare function detect(projectPath?: string): Promise; /** * b6g를 프로그래밍 방식으로 설치한다. * CLI 프롬프트 없이 옵션 객체로 모든 설정을 제어한다. * * @example * ```typescript * import { install } from '@sleighmaster/bmad/api'; * * const result = await install({ * path: '/path/to/project', * gitInit: true, * githubTemplates: true, * gitHooks: true, * claudeHooks: true, * onProgress: (step, total, message) => { * console.log(`[${step}/${total}] ${message}`); * }, * }); * * if (result.success) { * console.log('Installed:', result.installedItems); * } else { * console.error('Errors:', result.errors); * } * ``` */ export declare function install(options?: InstallApiOptions): Promise; /** * b6g 설치 상태와 버전 정보를 조회한다. * 콘솔 출력 없이 구조화된 결과를 반환한다. * * @example * ```typescript * import { check } from '@sleighmaster/bmad/api'; * * const result = await check({ path: '/path/to/project' }); * if (result.installed && result.installedVersion !== `v${result.packageVersion}`) { * console.log('업데이트 가능'); * } * ``` */ export declare function check(options?: CheckApiOptions): Promise; /** * 기존 b6g 설치를 업데이트한다. * 패키지에 포함된 최신 버전으로 덮어쓰며, 기존 _bmad/는 백업된다. * * @example * ```typescript * import { update } from '@sleighmaster/bmad/api'; * * const result = await update({ * path: '/path/to/project', * onProgress: (step, total, msg) => console.log(`[${step}/${total}] ${msg}`), * }); * * if (result.alreadyLatest) { * console.log('이미 최신 버전'); * } else if (result.success) { * console.log(`${result.fromVersion} → ${result.toVersion}`); * } * ``` */ export declare function update(options?: UpdateApiOptions): Promise; //# sourceMappingURL=api.d.ts.map