import { Context, TaskRegistry } from '@things-factory/integration-base' import fetch from 'node-fetch' async function gitWebhookHandler(step, { data }: Context) { const { commits } = step.params if (!commits || commits.length === 0) { throw new Error('No commits found in Webhook payload') } const modifiedFiles = commits.flatMap(commit => commit.modified) // ✅ 변경된 파일 분석 및 Qdrant 업데이트 실행 await fetch('http://localhost:3000/api/git-process-changes', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ files: modifiedFiles }) }) return { data: true } } TaskRegistry.registerTaskHandler('git-webhook-handler', gitWebhookHandler)