(args, context)
| 153 | progressMessage: 'creating commit and PR', |
| 154 | source: 'builtin', |
| 155 | async getPromptForCommand(args, context) { |
| 156 | // Get default branch and enhanced PR attribution |
| 157 | const [defaultBranch, prAttribution] = await Promise.all([ |
| 158 | getDefaultBranch(), |
| 159 | getEnhancedPRAttribution(context.getAppState), |
| 160 | ]) |
| 161 | const isGit = await getIsGit() |
| 162 | const isSl = !isGit && await getIsSl() |
| 163 | const repoType = isGit ? 'git' : isSl ? 'sl' : 'git' |
| 164 | let promptContent = getPromptContent(repoType, defaultBranch, prAttribution) |
| 165 | |
| 166 | // Append user instructions if args provided |
| 167 | const trimmedArgs = args?.trim() |
| 168 | if (trimmedArgs) { |
| 169 | promptContent += `\n\n## Additional instructions from user\n\n${trimmedArgs}` |
| 170 | } |
| 171 | |
| 172 | const finalContent = await executeShellCommandsInPrompt( |
| 173 | promptContent, |
| 174 | { |
| 175 | ...context, |
| 176 | getAppState() { |
| 177 | const appState = context.getAppState() |
| 178 | return { |
| 179 | ...appState, |
| 180 | toolPermissionContext: { |
| 181 | ...appState.toolPermissionContext, |
| 182 | alwaysAllowRules: { |
| 183 | ...appState.toolPermissionContext.alwaysAllowRules, |
| 184 | command: ALLOWED_TOOLS, |
| 185 | }, |
| 186 | }, |
| 187 | } |
| 188 | }, |
| 189 | }, |
| 190 | '/commit-push-pr', |
| 191 | ) |
| 192 | |
| 193 | return [{ type: 'text', text: finalContent }] |
| 194 | }, |
| 195 | } satisfies Command |
| 196 | |
| 197 | export default command |
nothing calls this directly
no test coverage detected