import { Context, TaskRegistry } from '@things-factory/integration-base' import simpleGit from 'simple-git' import path from 'path' async function gitDetectChanges(step, { data }: Context) { const { repoPath } = step.params if (!repoPath) { throw new Error(`repoPath는 필수 파라미터입니다.`) } const git = simpleGit(path.resolve(repoPath)) try { // ✅ Git 상태 확인 const status = await git.status() // ✅ 변경된 파일 목록 분류 const changedFiles = { modified: status.modified || [], created: status.created || [], deleted: status.deleted || [] } return { data: changedFiles } } catch (error) { throw new Error(`Git 변경 감지 오류: ${error.message}`) } } // ✅ 태스크 등록 TaskRegistry.registerTaskHandler('git-detect-changes', gitDetectChanges)