gnosys 5.2.2 → 5.2.4

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.js CHANGED
@@ -2735,7 +2735,28 @@ program
2735
2735
  .action(async (opts) => {
2736
2736
  const projectDir = opts.directory ? path.resolve(opts.directory) : process.cwd();
2737
2737
  const storePath = path.join(projectDir, ".gnosys");
2738
- const cfg = await loadConfig(storePath);
2738
+ const globalStorePath = path.join(os.homedir(), ".gnosys");
2739
+ // Load config: try project-level first, fall back to global ~/.gnosys/
2740
+ let cfg;
2741
+ let configSource;
2742
+ try {
2743
+ const projectCfg = await loadConfig(storePath);
2744
+ // Check if it's just defaults (no actual config file) by seeing if dream has been configured
2745
+ const hasProjectConfig = projectCfg.dream?.provider !== DEFAULT_CONFIG.dream?.provider ||
2746
+ projectCfg.llm?.defaultProvider !== DEFAULT_CONFIG.llm?.defaultProvider;
2747
+ if (hasProjectConfig) {
2748
+ cfg = projectCfg;
2749
+ configSource = storePath;
2750
+ }
2751
+ else {
2752
+ cfg = await loadConfig(globalStorePath);
2753
+ configSource = globalStorePath;
2754
+ }
2755
+ }
2756
+ catch {
2757
+ cfg = await loadConfig(globalStorePath);
2758
+ configSource = globalStorePath;
2759
+ }
2739
2760
  const GREEN = "\x1b[32m";
2740
2761
  const RED = "\x1b[31m";
2741
2762
  const YELLOW = "\x1b[33m";
@@ -2745,7 +2766,7 @@ program
2745
2766
  const CHECK = `${GREEN}✓${RESET}`;
2746
2767
  const CROSS = `${RED}✗${RESET}`;
2747
2768
  const WARN = `${YELLOW}⚠${RESET}`;
2748
- console.log(`\n${BOLD}Gnosys LLM Check${RESET}\n`);
2769
+ console.log(`\n${BOLD}Gnosys LLM Check${RESET} ${DIM}(config: ${configSource})${RESET}\n`);
2749
2770
  const tasks = [
2750
2771
  {
2751
2772
  name: "structuring",