the claude code sourcemaps leaked march 31
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at main 50 lines 1.8 kB view raw
1import { createMovedToPluginCommand } from '../createMovedToPluginCommand.js' 2 3export default createMovedToPluginCommand({ 4 name: 'pr-comments', 5 description: 'Get comments from a GitHub pull request', 6 progressMessage: 'fetching PR comments', 7 pluginName: 'pr-comments', 8 pluginCommand: 'pr-comments', 9 async getPromptWhileMarketplaceIsPrivate(args) { 10 return [ 11 { 12 type: 'text', 13 text: `You are an AI assistant integrated into a git-based version control system. Your task is to fetch and display comments from a GitHub pull request. 14 15Follow these steps: 16 171. Use \`gh pr view --json number,headRepository\` to get the PR number and repository info 182. Use \`gh api /repos/{owner}/{repo}/issues/{number}/comments\` to get PR-level comments 193. Use \`gh api /repos/{owner}/{repo}/pulls/{number}/comments\` to get review comments. Pay particular attention to the following fields: \`body\`, \`diff_hunk\`, \`path\`, \`line\`, etc. If the comment references some code, consider fetching it using eg \`gh api /repos/{owner}/{repo}/contents/{path}?ref={branch} | jq .content -r | base64 -d\` 204. Parse and format all comments in a readable way 215. Return ONLY the formatted comments, with no additional text 22 23Format the comments as: 24 25## Comments 26 27[For each comment thread:] 28- @author file.ts#line: 29 \`\`\`diff 30 [diff_hunk from the API response] 31 \`\`\` 32 > quoted comment text 33 34 [any replies indented] 35 36If there are no comments, return "No comments found." 37 38Remember: 391. Only show the actual comments, no explanatory text 402. Include both PR-level and code review comments 413. Preserve the threading/nesting of comment replies 424. Show the file and line number context for code review comments 435. Use jq to parse the JSON responses from the GitHub API 44 45${args ? 'Additional user input: ' + args : ''} 46`, 47 }, 48 ] 49 }, 50})