@sireai/optimus 0.1.25 → 0.1.27

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.
@@ -32,7 +32,7 @@ import { FeishuUserService } from "../integrations/feishu/feishu-user-service.js
32
32
  import { createFeedbackReport } from "./feedback.js";
33
33
  import { DEFAULT_FEEDBACK_RECIPIENT_EMAIL, FeishuFeedbackDeliveryService, persistFeedbackDeliveryResult, resolveDefaultFeedbackRecipientFallbackOpenId } from "./feedback-delivery.js";
34
34
  import { resolveDefaultConfigPath, resolveDefaultEnvPath } from "../config/optimus-paths.js";
35
- import { checkForSelfUpdate, installSelfUpdate, recordSkippedSelfUpdate, shouldPromptForCachedStartupUpdate } from "./self-update.js";
35
+ import { checkForSelfUpdate, installSelfUpdate, recordSkippedSelfUpdate } from "./self-update.js";
36
36
  const CLI_ROOT_DIR = resolve(dirname(fileURLToPath(import.meta.url)), "..", "..");
37
37
  const PACKAGE_JSON_PATH = join(CLI_ROOT_DIR, "package.json");
38
38
  const execFileAsync = promisify(execFile);
@@ -837,12 +837,6 @@ async function maybeHandleStartupSelfUpdate(input) {
837
837
  packageRoot: CLI_ROOT_DIR
838
838
  });
839
839
  const selfUpdateConfig = input.config.selfUpdate ?? buildDefaultConfig().selfUpdate;
840
- const shouldPromptCachedUpdate = shouldPromptForCachedStartupUpdate({
841
- command: input.command,
842
- config: input.config,
843
- check,
844
- interactivePromptAllowed: isInteractiveSelfUpdatePromptAllowed()
845
- });
846
840
  if (!check.checked) {
847
841
  if (check.reason === "cached") {
848
842
  const intervalHours = Math.max(1, selfUpdateConfig.checkIntervalHours);
@@ -860,16 +854,10 @@ async function maybeHandleStartupSelfUpdate(input) {
860
854
  intervalHours,
861
855
  lastCheckedAt,
862
856
  nextCheckAt,
863
- updateAvailable: check.updateAvailable,
864
- promptPlanned: shouldPromptCachedUpdate
857
+ realtimeCheckSkipped: true
865
858
  });
866
859
  }
867
- if (!shouldPromptCachedUpdate && check.reason === "cached" && check.updateAvailable && check.latestVersion) {
868
- console.log(`[optimus] update available ${check.currentVersion} -> ${check.latestVersion}. Run \`optimus upgrade\`.`);
869
- }
870
- if (!shouldPromptCachedUpdate) {
871
- return { handled: false };
872
- }
860
+ return { handled: false };
873
861
  }
874
862
  if (check.reason === "check_failed") {
875
863
  await input.logger.warn("self_update.check_failed", {
@@ -943,19 +931,18 @@ async function maybeHandleStartupSelfUpdate(input) {
943
931
  console.log(`[optimus] update available ${check.currentVersion} -> ${check.latestVersion}. Run \`optimus upgrade\`.`);
944
932
  return { handled: false };
945
933
  }
946
- console.log(`[optimus] upgrading ${check.currentVersion} -> ${check.latestVersion} before start...`);
947
934
  await input.logger.info("self_update.install_started", {
948
935
  command: input.command,
949
936
  currentVersion: check.currentVersion,
950
937
  latestVersion: check.latestVersion
951
938
  });
952
- const install = await installSelfUpdate({
939
+ const install = await runWithTerminalLoading(`Updating Optimus ${check.currentVersion} -> ${check.latestVersion}`, async () => await installSelfUpdate({
953
940
  currentVersion: check.currentVersion,
954
941
  packageName: PACKAGE_NAME,
955
942
  packageRoot: CLI_ROOT_DIR,
956
943
  channel: check.channel,
957
- targetVersion: check.latestVersion
958
- });
944
+ ...(check.latestVersion ? { targetVersion: check.latestVersion } : {})
945
+ }));
959
946
  if (!install.success) {
960
947
  await input.logger.error("self_update.install_failed", {
961
948
  command: input.command,
@@ -974,7 +961,7 @@ async function maybeHandleStartupSelfUpdate(input) {
974
961
  currentVersion: check.currentVersion,
975
962
  latestVersion: check.latestVersion
976
963
  });
977
- console.log(`[optimus] upgrade succeeded. Restart with \`optimus ${input.command}\`.`);
964
+ console.log(`[optimus] update succeeded: ${check.currentVersion} -> ${check.latestVersion}. Please restart Optimus.`);
978
965
  return {
979
966
  handled: true,
980
967
  exitCode: 0
@@ -2346,13 +2333,13 @@ async function main() {
2346
2333
  process.exitCode = result.reason === "check_failed" ? 1 : 0;
2347
2334
  return;
2348
2335
  }
2349
- const result = await installSelfUpdate({
2336
+ const result = await runWithTerminalLoading("Updating Optimus", async () => await installSelfUpdate({
2350
2337
  currentVersion,
2351
2338
  packageName: PACKAGE_NAME,
2352
2339
  packageRoot: CLI_ROOT_DIR,
2353
2340
  channel,
2354
2341
  force: args.force === "true"
2355
- });
2342
+ }));
2356
2343
  if (result.reason === "already_latest") {
2357
2344
  console.log(`Optimus is already up to date (${currentVersion}).`);
2358
2345
  return;
@@ -2362,7 +2349,8 @@ async function main() {
2362
2349
  process.exitCode = 1;
2363
2350
  return;
2364
2351
  }
2365
- console.log(`Optimus upgraded successfully: ${currentVersion} -> ${result.latestVersion ?? currentVersion}`);
2352
+ console.log(`Optimus updated successfully: ${currentVersion} -> ${result.latestVersion ?? currentVersion}`);
2353
+ console.log("Please restart Optimus.");
2366
2354
  return;
2367
2355
  }
2368
2356
  if (command === "setup") {
@@ -2764,7 +2752,7 @@ async function main() {
2764
2752
  const deliveryService = new TaskDeliveryService({
2765
2753
  jiraBaseUrl: config.jira.baseUrl
2766
2754
  });
2767
- const analysisDocService = new FeishuAnalysisDocService({ config, refStore: store });
2755
+ const analysisDocService = new FeishuAnalysisDocService({ config });
2768
2756
  const publicationService = new TaskPublicationService(logger);
2769
2757
  const deliveryDispatcher = new TaskDeliveryDispatcher(config);
2770
2758
  let deliveryBundle = mergeReplayBundle(await deliveryService.buildBundle({