@cortexkit/magic-context 0.27.1 → 0.27.2

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.
Files changed (2) hide show
  1. package/dist/index.js +17 -6
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -7924,7 +7924,18 @@ function legacySourcesForBase(basePath, label) {
7924
7924
  { path: `${basePath}.json`, label: `${label} magic-context.json` }
7925
7925
  ];
7926
7926
  }
7927
+ function userScopeConfigPaths() {
7928
+ return new Set([
7929
+ `${cortexKitUserConfigBasePath()}.jsonc`,
7930
+ `${cortexKitUserConfigBasePath()}.json`,
7931
+ join3(configHome(), "opencode", `${CONFIG_FILE_BASENAME}.jsonc`),
7932
+ join3(configHome(), "opencode", `${CONFIG_FILE_BASENAME}.json`),
7933
+ join3(homeDir(), ".pi", "agent", `${CONFIG_FILE_BASENAME}.jsonc`),
7934
+ join3(homeDir(), ".pi", "agent", `${CONFIG_FILE_BASENAME}.json`)
7935
+ ]);
7936
+ }
7927
7937
  function resolveLegacyConfigSources(directory) {
7938
+ const userPaths = userScopeConfigPaths();
7928
7939
  return {
7929
7940
  user: [
7930
7941
  ...legacySourcesForBase(join3(configHome(), "opencode", CONFIG_FILE_BASENAME), "OpenCode user"),
@@ -7934,7 +7945,7 @@ function resolveLegacyConfigSources(directory) {
7934
7945
  ...legacySourcesForBase(join3(directory, CONFIG_FILE_BASENAME), "project root"),
7935
7946
  ...legacySourcesForBase(join3(directory, ".opencode", CONFIG_FILE_BASENAME), "OpenCode project"),
7936
7947
  ...legacySourcesForBase(join3(directory, ".pi", CONFIG_FILE_BASENAME), "Pi project")
7937
- ]
7948
+ ].filter((source) => !userPaths.has(source.path))
7938
7949
  };
7939
7950
  }
7940
7951
  function resolveLegacyConfigSourcesForHarness(directory, harness) {
@@ -8343,7 +8354,7 @@ function detectConfigPaths() {
8343
8354
  tuiConfig = tuiJsonPath;
8344
8355
  tuiConfigFormat = "json";
8345
8356
  } else {
8346
- tuiConfig = tuiJsonPath;
8357
+ tuiConfig = tuiJsoncPath;
8347
8358
  tuiConfigFormat = "none";
8348
8359
  }
8349
8360
  return {
@@ -11487,7 +11498,7 @@ var init_opencode_helpers = __esm(() => {
11487
11498
 
11488
11499
  // src/commands/setup-opencode.ts
11489
11500
  import { existsSync as existsSync10, mkdirSync as mkdirSync3, readFileSync as readFileSync6 } from "node:fs";
11490
- import { dirname as dirname5 } from "node:path";
11501
+ import { basename as basename2, dirname as dirname5 } from "node:path";
11491
11502
  function ensureDir3(dir) {
11492
11503
  if (!existsSync10(dir)) {
11493
11504
  mkdirSync3(dir, { recursive: true });
@@ -11736,7 +11747,7 @@ async function runSetup(dryRun = false) {
11736
11747
  }
11737
11748
  if (dryRun) {
11738
11749
  log.message(`[dry-run] would write Magic Context config to ${paths.magicContextConfig}`);
11739
- log.message("[dry-run] would add the TUI sidebar plugin to tui.json");
11750
+ log.message(`[dry-run] would add the TUI sidebar plugin to ${paths.tuiConfig}`);
11740
11751
  } else {
11741
11752
  writeMagicContextConfig(paths.magicContextConfig, {
11742
11753
  historianModel,
@@ -11749,7 +11760,7 @@ async function runSetup(dryRun = false) {
11749
11760
  });
11750
11761
  log.success(`Config written to ${paths.magicContextConfig}`);
11751
11762
  addPluginToTuiConfig(paths.tuiConfig, paths.tuiConfigFormat);
11752
- log.success("TUI sidebar plugin added to tui.json");
11763
+ log.success(`TUI sidebar plugin added to ${basename2(paths.tuiConfig)}`);
11753
11764
  }
11754
11765
  if (paths.omoConfig && !hadExistingSetup) {
11755
11766
  log.warn(`Found oh-my-opencode config: ${paths.omoConfig}`);
@@ -165497,7 +165508,7 @@ function resolveTuiConfigPath() {
165497
165508
  return jsoncPath;
165498
165509
  if (existsSync18(jsonPath))
165499
165510
  return jsonPath;
165500
- return jsonPath;
165511
+ return jsoncPath;
165501
165512
  }
165502
165513
  function ensureTuiPluginEntry() {
165503
165514
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cortexkit/magic-context",
3
- "version": "0.27.1",
3
+ "version": "0.27.2",
4
4
  "description": "Unified CLI for Magic Context — setup, doctor, and migration across OpenCode and Pi",
5
5
  "keywords": [
6
6
  "opencode",