export async function extractGithubIssue(issueId, projectPath) {
    try {
        // Reuse gh CLI if available — most users have it configured
        const { execFile } = await import('node:child_process');
        const { promisify } = await import('node:util');
        const exec = promisify(execFile);
        const { stdout } = await exec('gh', ['issue', 'view', issueId, '--json', 'number,title,body,labels,assignees,state,url,comments'], { cwd: projectPath });
        const data = JSON.parse(stdout);
        return {
            source: 'github',
            externalId: String(data.number),
            url: data.url,
            title: data.title,
            body: data.body || '',
            labels: data.labels.map((l) => l.name),
            assignee: data.assignees[0]?.login,
            status: data.state,
            comments: data.comments.map((c) => c.body),
        };
    }
    catch {
        return null;
    }
}
//# sourceMappingURL=github.js.map