automata-cli 0.1.0-feature-028-normalize-execute-prompt.153 → 0.1.0-feature-028-normalize-execute-prompt.155
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +5 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2108,8 +2108,7 @@ function resolveExecutor(withOption) {
|
|
|
2108
2108
|
}
|
|
2109
2109
|
return executor;
|
|
2110
2110
|
}
|
|
2111
|
-
function invokeSelectedExecutor(prompt, options) {
|
|
2112
|
-
const executor = resolveExecutor(options.with);
|
|
2111
|
+
function invokeSelectedExecutor(prompt, executor, options) {
|
|
2113
2112
|
if (executor === "codex") {
|
|
2114
2113
|
invokeCodexCode(prompt, { yolo: true, model: options.model });
|
|
2115
2114
|
return;
|
|
@@ -2121,6 +2120,7 @@ var executeSonarCmd = addAiOptions(
|
|
|
2121
2120
|
"Check the current branch for a SonarCloud analysis and invoke the AI with the Sonar prompt and analysis URL"
|
|
2122
2121
|
)
|
|
2123
2122
|
).action(async (options) => {
|
|
2123
|
+
const executor = resolveExecutor(options.with);
|
|
2124
2124
|
let branch;
|
|
2125
2125
|
try {
|
|
2126
2126
|
branch = getCurrentBranch();
|
|
@@ -2160,7 +2160,7 @@ Current PR context from automata git get-pr-info --json:
|
|
|
2160
2160
|
${formatPrInfoContext(pr)}`,
|
|
2161
2161
|
options.push
|
|
2162
2162
|
);
|
|
2163
|
-
await invokeSelectedExecutor(fullPrompt, options);
|
|
2163
|
+
await invokeSelectedExecutor(fullPrompt, executor, options);
|
|
2164
2164
|
});
|
|
2165
2165
|
function formatComments(comments) {
|
|
2166
2166
|
return comments.map((c) => {
|
|
@@ -2174,6 +2174,7 @@ var executeFixCommentsCmd = addAiOptions(
|
|
|
2174
2174
|
"Fetch open review comments on the current PR and invoke the AI with the Fix-Comments prompt"
|
|
2175
2175
|
)
|
|
2176
2176
|
).action(async (options) => {
|
|
2177
|
+
const executor = resolveExecutor(options.with);
|
|
2177
2178
|
const result = resolveCurrentBranchComments();
|
|
2178
2179
|
if (!result.ok) {
|
|
2179
2180
|
if (result.kind === "error") {
|
|
@@ -2210,7 +2211,7 @@ Open review comments:
|
|
|
2210
2211
|
${formatComments(comments)}`,
|
|
2211
2212
|
options.push
|
|
2212
2213
|
);
|
|
2213
|
-
await invokeSelectedExecutor(fullPrompt, options);
|
|
2214
|
+
await invokeSelectedExecutor(fullPrompt, executor, options);
|
|
2214
2215
|
});
|
|
2215
2216
|
var executePromptCommand = new Command5("execute-prompt").description("Execute a configured custom prompt using an AI assistant").addCommand(executeSonarCmd).addCommand(executeFixCommentsCmd);
|
|
2216
2217
|
|