@forge/cli-shared
8.24.08.24.0-experimental-04cc2b9
out/shared/assistant-cli.js~
out/shared/assistant-cli.jsModified+8−8
Index: package/out/shared/assistant-cli.js
===================================================================
--- package/out/shared/assistant-cli.js
+++ package/out/shared/assistant-cli.js
@@ -1,27 +1,30 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-exports.runAssistant = exports.checkGeminiSetup = exports.checkRovoAuthStatus = exports.createForgeCommandErrorPrompt = exports.createUnknownForgeCommandPrompt = exports.createForgeTunnelErrorPrompt = exports.AssistantName = exports.ASSISTANT_CHECK_TIMEOUT = exports.ASSISTANT_ANALYZE_TIMEOUT = void 0;
+exports.AssistantName = exports.ASSISTANT_CHECK_TIMEOUT = exports.ASSISTANT_ANALYZE_TIMEOUT = void 0;
+exports.createForgeTunnelErrorPrompt = createForgeTunnelErrorPrompt;
+exports.createUnknownForgeCommandPrompt = createUnknownForgeCommandPrompt;
+exports.createForgeCommandErrorPrompt = createForgeCommandErrorPrompt;
+exports.checkRovoAuthStatus = checkRovoAuthStatus;
+exports.checkGeminiSetup = checkGeminiSetup;
+exports.runAssistant = runAssistant;
const child_process_1 = require("child_process");
exports.ASSISTANT_ANALYZE_TIMEOUT = 300000;
exports.ASSISTANT_CHECK_TIMEOUT = 30000;
var AssistantName;
(function (AssistantName) {
AssistantName["ROVO"] = "rovo";
AssistantName["GEMINI"] = "gemini";
-})(AssistantName = exports.AssistantName || (exports.AssistantName = {}));
+})(AssistantName || (exports.AssistantName = AssistantName = {}));
function createForgeTunnelErrorPrompt(error) {
return `Do not try to change the code, just analyze the issue and make a suggestion to fix the error. Analyze why when the Forge function resolver code is executed, there is error ${error}. This is likely because of some bug in the app code`;
}
-exports.createForgeTunnelErrorPrompt = createForgeTunnelErrorPrompt;
function createUnknownForgeCommandPrompt(command, errorText) {
return `Do not try to change the code, just analyze the issue and make a suggestion to fix the error. Analyze why when I run the Forge command${command} and has the unknown command error ${errorText}. This is likely because of syntax error in the command. You can refer to https://developer.atlassian.com/platform/forge/cli-reference/ for the CLI reference. Try to suggest a valid command based on the intention.`;
}
-exports.createUnknownForgeCommandPrompt = createUnknownForgeCommandPrompt;
function createForgeCommandErrorPrompt(command, error) {
return `Do not try to change the code, just analyze the issue and make a suggestion to fix the error. Analyze why when I run the command ${command} and I have the error ${error}`;
}
-exports.createForgeCommandErrorPrompt = createForgeCommandErrorPrompt;
function checkCommandAvailability(command, args) {
return new Promise((resolve) => {
const childProcess = (0, child_process_1.spawn)(command, args, {
stdio: 'pipe',
@@ -37,13 +40,11 @@
}
function checkRovoAuthStatus() {
return checkCommandAvailability('acli', ['rovodev', 'auth', 'status']);
}
-exports.checkRovoAuthStatus = checkRovoAuthStatus;
function checkGeminiSetup() {
return checkCommandAvailability('gemini', ['--help']);
}
-exports.checkGeminiSetup = checkGeminiSetup;
function runAssistantCommand(assistantName, command, args, logger) {
return new Promise((resolve) => {
logger.info(`Sending error to ${assistantName} for analysis...`);
const childProcess = (0, child_process_1.spawn)(command, args, {
@@ -69,5 +70,4 @@
logger.error(new Error(`Unknown assistant: ${assistantName}`));
return Promise.resolve();
}
}
-exports.runAssistant = runAssistant;