@sireai/optimus 0.1.22 → 0.1.24
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/cli/optimus.js +25 -14
- package/dist/cli/optimus.js.map +1 -1
- package/dist/integrations/jira/jira-cli.js +1 -1
- package/dist/integrations/jira/jira-cli.js.map +1 -1
- package/dist/integrations/jira/jira-submit.js +54 -3
- package/dist/integrations/jira/jira-submit.js.map +1 -1
- package/dist/task-environment/orchestration/execution-context-assembler.d.ts +2 -0
- package/dist/task-environment/orchestration/execution-context-assembler.js +61 -0
- package/dist/task-environment/orchestration/execution-context-assembler.js.map +1 -1
- package/package.json +1 -1
package/dist/cli/optimus.js
CHANGED
|
@@ -151,6 +151,29 @@ function renderDoctorTextReport(doctor) {
|
|
|
151
151
|
}
|
|
152
152
|
return lines.join("\n");
|
|
153
153
|
}
|
|
154
|
+
async function runWithTerminalLoading(message, action) {
|
|
155
|
+
if (!process.stderr.isTTY) {
|
|
156
|
+
return await action();
|
|
157
|
+
}
|
|
158
|
+
const frames = ["[ ]", "[. ]", "[.. ]", "[...]"];
|
|
159
|
+
let frameIndex = 0;
|
|
160
|
+
process.stderr.write(`\r${frames[frameIndex]} ${message}`);
|
|
161
|
+
const timer = setInterval(() => {
|
|
162
|
+
frameIndex = (frameIndex + 1) % frames.length;
|
|
163
|
+
process.stderr.write(`\r${frames[frameIndex]} ${message}`);
|
|
164
|
+
}, 160);
|
|
165
|
+
try {
|
|
166
|
+
const result = await action();
|
|
167
|
+
clearInterval(timer);
|
|
168
|
+
process.stderr.write(`\r[ok ] ${message}\n`);
|
|
169
|
+
return result;
|
|
170
|
+
}
|
|
171
|
+
catch (error) {
|
|
172
|
+
clearInterval(timer);
|
|
173
|
+
process.stderr.write(`\r[err] ${message}\n`);
|
|
174
|
+
throw error;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
154
177
|
function renderDoctorSection(title, section, extraLines = []) {
|
|
155
178
|
const lines = [formatDoctorStatusHeading(title, section.status)];
|
|
156
179
|
if (section.reason) {
|
|
@@ -686,13 +709,6 @@ function resolveJiraQuickDoctorIssues(config, options) {
|
|
|
686
709
|
fix: "Rerun `optimus setup` and provide a Jira personal token."
|
|
687
710
|
});
|
|
688
711
|
}
|
|
689
|
-
if (!config.casCookieName?.trim()) {
|
|
690
|
-
issues.push({
|
|
691
|
-
code: "jira_cas_cookie_name_missing",
|
|
692
|
-
message: "Jira integration is enabled, but Jira CAS cookie name is missing.",
|
|
693
|
-
fix: "Rerun `optimus setup` and provide the Jira CAS cookie name."
|
|
694
|
-
});
|
|
695
|
-
}
|
|
696
712
|
return issues;
|
|
697
713
|
}
|
|
698
714
|
function resolveSentryQuickDoctorIssues(config) {
|
|
@@ -1196,9 +1212,6 @@ async function promptSetupAnswers(defaults) {
|
|
|
1196
1212
|
const jiraPersonalToken = enableJira
|
|
1197
1213
|
? (printSetupHint("Jira personal token: required for Jira reads, comments, and issue submission commands."), (await ask(renderSetupPrompt("Required", "Jira personal token", defaults.jiraPersonalToken ? "configured" : ""))).trim() || defaults.jiraPersonalToken)
|
|
1198
1214
|
: undefined;
|
|
1199
|
-
const jiraCasCookieName = enableJira
|
|
1200
|
-
? (printSetupHint("Jira CAS cookie name: optional helper for environments that need refreshed CAS login cookies."), (await ask(renderSetupPrompt("Optional", "Jira CAS cookie name", defaults.jiraCasCookieName ?? "_aegis_cas_p"))).trim() || defaults.jiraCasCookieName || "_aegis_cas_p")
|
|
1201
|
-
: undefined;
|
|
1202
1215
|
printSetupSection("Sentry", "Optional. Turn this on only if you want this machine to read Sentry events and create tasks from them.");
|
|
1203
1216
|
printSetupHint("If disabled, Optimus still works; Sentry commands just stay unavailable on this machine.");
|
|
1204
1217
|
const enableSentryInput = (await ask(renderSetupPrompt("Optional integration", "Enable Sentry integration", defaults.enableSentry ? "Y/n" : "y/N"))).trim().toLowerCase();
|
|
@@ -1227,7 +1240,6 @@ async function promptSetupAnswers(defaults) {
|
|
|
1227
1240
|
enableJira,
|
|
1228
1241
|
...(jiraBaseUrl ? { jiraBaseUrl } : {}),
|
|
1229
1242
|
...(jiraPersonalToken ? { jiraPersonalToken } : {}),
|
|
1230
|
-
...(jiraCasCookieName ? { jiraCasCookieName } : {}),
|
|
1231
1243
|
...(defaults.jiraCustomHeaders ? { jiraCustomHeaders: defaults.jiraCustomHeaders } : {}),
|
|
1232
1244
|
enableSentry,
|
|
1233
1245
|
...(sentryBaseUrl ? { sentryBaseUrl } : {}),
|
|
@@ -1277,7 +1289,6 @@ async function resolveDefaultSetupAnswers() {
|
|
|
1277
1289
|
enableJira: config.jira.enabled,
|
|
1278
1290
|
...(config.jira.baseUrl ? { jiraBaseUrl: config.jira.baseUrl } : {}),
|
|
1279
1291
|
...(config.jira.personalToken ? { jiraPersonalToken: config.jira.personalToken } : {}),
|
|
1280
|
-
...(config.jira.casCookieName ? { jiraCasCookieName: config.jira.casCookieName } : {}),
|
|
1281
1292
|
...(config.jira.customHeaders ? { jiraCustomHeaders: config.jira.customHeaders } : {}),
|
|
1282
1293
|
enableSentry: config.sentry.enabled,
|
|
1283
1294
|
...(config.sentry.baseUrl ? { sentryBaseUrl: config.sentry.baseUrl } : {}),
|
|
@@ -1475,7 +1486,7 @@ function buildSetupConfig(answers, rawConfig) {
|
|
|
1475
1486
|
if (answers.jiraPersonalToken) {
|
|
1476
1487
|
config.jira.personalToken = answers.jiraPersonalToken;
|
|
1477
1488
|
}
|
|
1478
|
-
config.jira.casCookieName =
|
|
1489
|
+
config.jira.casCookieName = "_aegis_cas_p";
|
|
1479
1490
|
if (answers.jiraCustomHeaders?.trim()) {
|
|
1480
1491
|
config.jira.customHeaders = answers.jiraCustomHeaders.trim();
|
|
1481
1492
|
}
|
|
@@ -2381,7 +2392,7 @@ async function main() {
|
|
|
2381
2392
|
}
|
|
2382
2393
|
const parsedCommandArgs = parseArgs(commandArgs);
|
|
2383
2394
|
if (command === "doctor") {
|
|
2384
|
-
const result = await runDoctor();
|
|
2395
|
+
const result = await runWithTerminalLoading("Running doctor checks", async () => await runDoctor());
|
|
2385
2396
|
if (parsedCommandArgs.json === "true") {
|
|
2386
2397
|
console.log(JSON.stringify(result, null, 2));
|
|
2387
2398
|
}
|