opencode-athena 0.6.0 → 0.6.1

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/index.js CHANGED
@@ -435,14 +435,14 @@ function getPackageVersion() {
435
435
  for (const pkgPath of possiblePaths) {
436
436
  if (!existsSync(pkgPath)) continue;
437
437
  const content = readFileSync(pkgPath, "utf-8");
438
- try {
439
- const pkg = JSON.parse(content);
440
- if (pkg.version) return pkg.version;
441
- } catch {
442
- }
438
+ const pkg = JSON.parse(content);
439
+ if (pkg.version) return pkg.version;
443
440
  }
444
441
  return "0.0.0";
445
- } catch {
442
+ } catch (error) {
443
+ if (error instanceof SyntaxError) {
444
+ console.error("[opencode-athena] Warning: package.json contains invalid JSON");
445
+ }
446
446
  return "0.0.0";
447
447
  }
448
448
  }
@@ -2213,7 +2213,7 @@ function mergeConfigs(options) {
2213
2213
  };
2214
2214
  }
2215
2215
  function createBackups() {
2216
- const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
2216
+ const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.TZ]/g, "-").replace(/--+/g, "-").replace(/-$/, "");
2217
2217
  const result = {
2218
2218
  athenaBackup: null,
2219
2219
  omoBackup: null,
@@ -2268,6 +2268,12 @@ var MIGRATIONS = [
2268
2268
  }
2269
2269
  return { ...config, features };
2270
2270
  }
2271
+ },
2272
+ {
2273
+ fromVersion: "0.5.0",
2274
+ toVersion: "0.6.0",
2275
+ description: "Migration system infrastructure (no config changes)",
2276
+ migrateAthena: (config) => config
2271
2277
  }
2272
2278
  ];
2273
2279
 
@@ -2288,9 +2294,7 @@ function migrateConfigs(athenaConfig, omoConfig, fromVersion) {
2288
2294
  return semver.compare(aVersion, bVersion);
2289
2295
  });
2290
2296
  for (const migration of sortedMigrations) {
2291
- const migrationFrom = semver.valid(semver.coerce(migration.fromVersion)) || "0.0.0";
2292
2297
  const migrationTo = semver.valid(semver.coerce(migration.toVersion)) || "0.0.0";
2293
- if (semver.gt(migrationFrom, normalizedFrom)) continue;
2294
2298
  if (semver.lte(migrationTo, normalizedFrom)) continue;
2295
2299
  if (semver.gt(migrationTo, normalizedTarget)) continue;
2296
2300
  if (migration.migrateAthena) {
@@ -2585,10 +2589,9 @@ Current version: ${existingVersion}`));
2585
2589
  message: "Enable automatic git operations? (commits, pushes by agents)",
2586
2590
  default: false
2587
2591
  });
2588
- if (updatedFeatures) {
2589
- if (enable) {
2590
- updatedFeatures.enabledFeatures.push("auto-git");
2591
- }
2592
+ if (enable) {
2593
+ const migratedFeatures = migrationResult.athenaConfig.features;
2594
+ migratedFeatures.autoGitOperations = true;
2592
2595
  }
2593
2596
  }
2594
2597
  }
@@ -3102,7 +3105,7 @@ program.command("install").description("Install and configure OpenCode Athena").
3102
3105
  await install(options);
3103
3106
  });
3104
3107
  program.command("upgrade").description("Upgrade OpenCode Athena configuration to latest version").option("-y, --yes", "Skip confirmation prompts", false).action(async (options) => {
3105
- await install({ ...options, preset: "none", advanced: false, global: true, local: false });
3108
+ await install({ ...options, preset: void 0, advanced: false, global: true, local: false });
3106
3109
  });
3107
3110
  program.command("update").description("Update OpenCode Athena to latest version").option("--check", "Check for updates without installing", false).action(update);
3108
3111
  program.command("doctor").description("Diagnose and fix common issues").option("--fix", "Automatically fix issues", false).action(doctor);