gnosys 5.9.1 → 5.9.3

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 (173) hide show
  1. package/dist/cli.js +311 -143
  2. package/dist/cli.js.map +1 -1
  3. package/dist/index.js.map +1 -1
  4. package/dist/lib/archive.d.ts.map +1 -1
  5. package/dist/lib/archive.js.map +1 -1
  6. package/dist/lib/bootstrap.d.ts.map +1 -1
  7. package/dist/lib/chat/index.d.ts.map +1 -1
  8. package/dist/lib/chat/index.js +5 -0
  9. package/dist/lib/chat/index.js.map +1 -1
  10. package/dist/lib/cleanup.d.ts +52 -0
  11. package/dist/lib/cleanup.d.ts.map +1 -0
  12. package/dist/lib/cleanup.js +168 -0
  13. package/dist/lib/cleanup.js.map +1 -0
  14. package/dist/lib/config.d.ts +7 -0
  15. package/dist/lib/config.d.ts.map +1 -1
  16. package/dist/lib/config.js +7 -1
  17. package/dist/lib/config.js.map +1 -1
  18. package/dist/lib/dashboard.d.ts.map +1 -1
  19. package/dist/lib/dashboard.js.map +1 -1
  20. package/dist/lib/db.d.ts +0 -13
  21. package/dist/lib/db.d.ts.map +1 -1
  22. package/dist/lib/db.js +0 -31
  23. package/dist/lib/db.js.map +1 -1
  24. package/dist/lib/dbSearch.d.ts.map +1 -1
  25. package/dist/lib/dbSearch.js +0 -1
  26. package/dist/lib/dbSearch.js.map +1 -1
  27. package/dist/lib/dream.d.ts.map +1 -1
  28. package/dist/lib/dream.js +1 -1
  29. package/dist/lib/dream.js.map +1 -1
  30. package/dist/lib/export.d.ts.map +1 -1
  31. package/dist/lib/federated.d.ts.map +1 -1
  32. package/dist/lib/federated.js +23 -65
  33. package/dist/lib/federated.js.map +1 -1
  34. package/dist/lib/hybridSearch.d.ts.map +1 -1
  35. package/dist/lib/hybridSearch.js.map +1 -1
  36. package/dist/lib/import.d.ts.map +1 -1
  37. package/dist/lib/import.js +2 -1
  38. package/dist/lib/import.js.map +1 -1
  39. package/dist/lib/lensing.d.ts +0 -9
  40. package/dist/lib/lensing.d.ts.map +1 -1
  41. package/dist/lib/lensing.js +0 -15
  42. package/dist/lib/lensing.js.map +1 -1
  43. package/dist/lib/maintenance.d.ts.map +1 -1
  44. package/dist/lib/maintenance.js +0 -39
  45. package/dist/lib/maintenance.js.map +1 -1
  46. package/dist/lib/migrate.js.map +1 -1
  47. package/dist/lib/paths.d.ts +8 -2
  48. package/dist/lib/paths.d.ts.map +1 -1
  49. package/dist/lib/paths.js +15 -4
  50. package/dist/lib/paths.js.map +1 -1
  51. package/dist/lib/portfolio.d.ts.map +1 -1
  52. package/dist/lib/portfolio.js +0 -23
  53. package/dist/lib/portfolio.js.map +1 -1
  54. package/dist/lib/projectIdentity.d.ts +9 -5
  55. package/dist/lib/projectIdentity.d.ts.map +1 -1
  56. package/dist/lib/projectIdentity.js +19 -22
  57. package/dist/lib/projectIdentity.js.map +1 -1
  58. package/dist/lib/remoteWizard.d.ts.map +1 -1
  59. package/dist/lib/remoteWizard.js +112 -52
  60. package/dist/lib/remoteWizard.js.map +1 -1
  61. package/dist/lib/rulesGen.d.ts +1 -4
  62. package/dist/lib/rulesGen.d.ts.map +1 -1
  63. package/dist/lib/rulesGen.js +2 -10
  64. package/dist/lib/rulesGen.js.map +1 -1
  65. package/dist/lib/search.d.ts.map +1 -1
  66. package/dist/lib/setup/coldStart.d.ts +71 -0
  67. package/dist/lib/setup/coldStart.d.ts.map +1 -0
  68. package/dist/lib/setup/coldStart.js +122 -0
  69. package/dist/lib/setup/coldStart.js.map +1 -0
  70. package/dist/lib/setup/configSetRender.d.ts +26 -0
  71. package/dist/lib/setup/configSetRender.d.ts.map +1 -0
  72. package/dist/lib/setup/configSetRender.js +103 -0
  73. package/dist/lib/setup/configSetRender.js.map +1 -0
  74. package/dist/lib/setup/dreamRender.d.ts +44 -0
  75. package/dist/lib/setup/dreamRender.d.ts.map +1 -0
  76. package/dist/lib/setup/dreamRender.js +55 -0
  77. package/dist/lib/setup/dreamRender.js.map +1 -0
  78. package/dist/lib/setup/modelsRender.d.ts +25 -0
  79. package/dist/lib/setup/modelsRender.d.ts.map +1 -0
  80. package/dist/lib/setup/modelsRender.js +33 -0
  81. package/dist/lib/setup/modelsRender.js.map +1 -0
  82. package/dist/lib/setup/remoteRender.d.ts +43 -0
  83. package/dist/lib/setup/remoteRender.d.ts.map +1 -0
  84. package/dist/lib/setup/remoteRender.js +65 -0
  85. package/dist/lib/setup/remoteRender.js.map +1 -0
  86. package/dist/lib/setup/routingRender.d.ts +44 -0
  87. package/dist/lib/setup/routingRender.d.ts.map +1 -0
  88. package/dist/lib/setup/routingRender.js +97 -0
  89. package/dist/lib/setup/routingRender.js.map +1 -0
  90. package/dist/lib/setup/sections/ides.d.ts +8 -0
  91. package/dist/lib/setup/sections/ides.d.ts.map +1 -1
  92. package/dist/lib/setup/sections/ides.js +49 -27
  93. package/dist/lib/setup/sections/ides.js.map +1 -1
  94. package/dist/lib/setup/sections/preferences.d.ts +8 -0
  95. package/dist/lib/setup/sections/preferences.d.ts.map +1 -1
  96. package/dist/lib/setup/sections/preferences.js +40 -19
  97. package/dist/lib/setup/sections/preferences.js.map +1 -1
  98. package/dist/lib/setup/sections/routing.d.ts +0 -1
  99. package/dist/lib/setup/sections/routing.d.ts.map +1 -1
  100. package/dist/lib/setup/sections/routing.js +49 -29
  101. package/dist/lib/setup/sections/routing.js.map +1 -1
  102. package/dist/lib/setup/summary.d.ts +33 -19
  103. package/dist/lib/setup/summary.d.ts.map +1 -1
  104. package/dist/lib/setup/summary.js +135 -105
  105. package/dist/lib/setup/summary.js.map +1 -1
  106. package/dist/lib/setup/syncProjectsRender.d.ts +56 -0
  107. package/dist/lib/setup/syncProjectsRender.d.ts.map +1 -0
  108. package/dist/lib/setup/syncProjectsRender.js +168 -0
  109. package/dist/lib/setup/syncProjectsRender.js.map +1 -0
  110. package/dist/lib/setup/ui/diff.d.ts +19 -0
  111. package/dist/lib/setup/ui/diff.d.ts.map +1 -0
  112. package/dist/lib/setup/ui/diff.js +34 -0
  113. package/dist/lib/setup/ui/diff.js.map +1 -0
  114. package/dist/lib/setup/ui/footer.d.ts +11 -0
  115. package/dist/lib/setup/ui/footer.d.ts.map +1 -0
  116. package/dist/lib/setup/ui/footer.js +21 -0
  117. package/dist/lib/setup/ui/footer.js.map +1 -0
  118. package/dist/lib/setup/ui/header.d.ts +24 -0
  119. package/dist/lib/setup/ui/header.d.ts.map +1 -0
  120. package/dist/lib/setup/ui/header.js +49 -0
  121. package/dist/lib/setup/ui/header.js.map +1 -0
  122. package/dist/lib/setup/ui/index.d.ts +26 -0
  123. package/dist/lib/setup/ui/index.d.ts.map +1 -0
  124. package/dist/lib/setup/ui/index.js +18 -0
  125. package/dist/lib/setup/ui/index.js.map +1 -0
  126. package/dist/lib/setup/ui/menu.d.ts +27 -0
  127. package/dist/lib/setup/ui/menu.d.ts.map +1 -0
  128. package/dist/lib/setup/ui/menu.js +75 -0
  129. package/dist/lib/setup/ui/menu.js.map +1 -0
  130. package/dist/lib/setup/ui/panel.d.ts +23 -0
  131. package/dist/lib/setup/ui/panel.d.ts.map +1 -0
  132. package/dist/lib/setup/ui/panel.js +53 -0
  133. package/dist/lib/setup/ui/panel.js.map +1 -0
  134. package/dist/lib/setup/ui/prompt.d.ts +27 -0
  135. package/dist/lib/setup/ui/prompt.d.ts.map +1 -0
  136. package/dist/lib/setup/ui/prompt.js +38 -0
  137. package/dist/lib/setup/ui/prompt.js.map +1 -0
  138. package/dist/lib/setup/ui/safePrompt.d.ts +24 -0
  139. package/dist/lib/setup/ui/safePrompt.d.ts.map +1 -0
  140. package/dist/lib/setup/ui/safePrompt.js +71 -0
  141. package/dist/lib/setup/ui/safePrompt.js.map +1 -0
  142. package/dist/lib/setup/ui/spinner.d.ts +28 -0
  143. package/dist/lib/setup/ui/spinner.d.ts.map +1 -0
  144. package/dist/lib/setup/ui/spinner.js +87 -0
  145. package/dist/lib/setup/ui/spinner.js.map +1 -0
  146. package/dist/lib/setup/ui/status.d.ts +21 -0
  147. package/dist/lib/setup/ui/status.d.ts.map +1 -0
  148. package/dist/lib/setup/ui/status.js +49 -0
  149. package/dist/lib/setup/ui/status.js.map +1 -0
  150. package/dist/lib/setup/ui/title.d.ts +14 -0
  151. package/dist/lib/setup/ui/title.d.ts.map +1 -0
  152. package/dist/lib/setup/ui/title.js +24 -0
  153. package/dist/lib/setup/ui/title.js.map +1 -0
  154. package/dist/lib/setup/ui/tokens.d.ts +66 -0
  155. package/dist/lib/setup/ui/tokens.d.ts.map +1 -0
  156. package/dist/lib/setup/ui/tokens.js +87 -0
  157. package/dist/lib/setup/ui/tokens.js.map +1 -0
  158. package/dist/lib/setup.d.ts +7 -0
  159. package/dist/lib/setup.d.ts.map +1 -1
  160. package/dist/lib/setup.js +204 -230
  161. package/dist/lib/setup.js.map +1 -1
  162. package/dist/lib/store.d.ts +0 -4
  163. package/dist/lib/store.d.ts.map +1 -1
  164. package/dist/lib/store.js +0 -6
  165. package/dist/lib/store.js.map +1 -1
  166. package/dist/lib/tags.d.ts +0 -2
  167. package/dist/lib/tags.d.ts.map +1 -1
  168. package/dist/lib/tags.js +0 -10
  169. package/dist/lib/tags.js.map +1 -1
  170. package/dist/lib/trace.d.ts.map +1 -1
  171. package/dist/lib/webIngest.d.ts.map +1 -1
  172. package/dist/lib/webIngest.js.map +1 -1
  173. package/package.json +1 -1
@@ -7,23 +7,17 @@
7
7
  * directly via `gnosys setup routing` or from the summary-first menu.
8
8
  */
9
9
  import { loadConfig, updateConfig, resolveTaskModel, getProviderModel, } from "../../config.js";
10
- const BOLD = "\x1b[1m";
10
+ import { safeQuestion } from "../ui/safePrompt.js";
11
+ import { Header } from "../ui/header.js";
12
+ import { Title } from "../ui/title.js";
13
+ import { Footer } from "../ui/footer.js";
14
+ import { printStatus } from "../ui/status.js";
15
+ import { classifyCost, renderRoutingTable, renderRoutingDiff, } from "../routingRender.js";
11
16
  const DIM = "\x1b[2m";
12
- const GREEN = "\x1b[32m";
13
17
  const RESET = "\x1b[0m";
14
- const CHECK = `${GREEN}✓${RESET}`;
15
- export const TASK_DESCRIPTIONS = {
16
- structuring: "adding memories, tagging",
17
- synthesis: "Q&A answers, ask",
18
- // v5.8.0 (#2): chat is its own task — was lumped under synthesis before.
19
- chat: "interactive chat TUI",
20
- vision: "images, PDFs",
21
- transcription: "audio files",
22
- dream: "idle consolidation",
23
- };
24
18
  const TASKS = ["structuring", "synthesis", "chat", "vision", "transcription"];
25
19
  async function ask(rl, prompt) {
26
- return (await rl.question(prompt)).trim();
20
+ return (await safeQuestion(rl, prompt)).trim();
27
21
  }
28
22
  async function askYesNo(rl, prompt, defaultYes) {
29
23
  const hint = defaultYes ? " [Y/n] " : " [y/N] ";
@@ -63,18 +57,22 @@ function buildEffectiveRouting(cfg) {
63
57
  };
64
58
  return out;
65
59
  }
66
- function printTable(routing, dreamEnabled) {
67
- const taskNameWidth = 16;
68
- const routingWidth = 38;
69
- console.log(` ${BOLD}${"Task".padEnd(taskNameWidth)}${"Current Routing".padEnd(routingWidth)}${RESET}`);
70
- console.log(` ${"─".repeat(taskNameWidth + routingWidth)}`);
60
+ /**
61
+ * Build the table-row payload from current routing data. Marks any
62
+ * task whose effective provider/model differs from the snapshot as
63
+ * `changed` so the renderer can highlight it (▶ in accent-hi).
64
+ */
65
+ function buildTaskRows(routing, baseline, dreamEnabled) {
66
+ const rows = [];
71
67
  for (const t of [...TASKS, "dream"]) {
72
68
  const r = routing[t];
73
- const desc = TASK_DESCRIPTIONS[t] ?? "";
74
- const status = t === "dream" && !dreamEnabled ? `${DIM}(disabled)${RESET}` : `${DIM}(${desc})${RESET}`;
75
- console.log(` ${t.padEnd(taskNameWidth)}${`${r.provider} / ${r.model}`.padEnd(routingWidth)}${status}`);
69
+ const uses = `${r.provider} / ${r.model}`;
70
+ const cost = t === "dream" && !dreamEnabled ? "free" : classifyCost(r.provider, r.model);
71
+ const base = baseline[t];
72
+ const changed = !base || base.provider !== r.provider || base.model !== r.model;
73
+ rows.push({ task: t, uses, cost, changed });
76
74
  }
77
- console.log("");
75
+ return rows;
78
76
  }
79
77
  /**
80
78
  * Run the task-routing wizard. Reads current config, walks the 3-way choice
@@ -86,14 +84,16 @@ export async function runRoutingSetup(opts) {
86
84
  const provider = cfg.llm.defaultProvider;
87
85
  const model = getProviderModel(cfg, provider);
88
86
  console.log("");
89
- console.log(`${BOLD}Task Routing${RESET}`);
87
+ console.log(Header(["gnosys", "setup", "routing"]));
90
88
  console.log("");
91
- console.log(`Each task can use a different LLM. Defaults flow from your provider`);
92
- console.log(`(${BOLD}${provider} / ${model}${RESET}). Override per-task or keep defaults.`);
89
+ console.log(Title("Task routing", "each task can use a different model overrides the default"));
93
90
  console.log("");
94
91
  const dreamEnabled = !!cfg.dream?.enabled;
95
- const routing = buildEffectiveRouting(cfg);
96
- printTable(routing, dreamEnabled);
92
+ const baseline = buildEffectiveRouting(cfg);
93
+ // Initial table: nothing has changed yet, so every row is `changed: false`.
94
+ const initialRows = buildTaskRows(baseline, baseline, dreamEnabled);
95
+ console.log(renderRoutingTable(initialRows));
96
+ console.log("");
97
97
  const choice = await askChoice(opts.rl, "What would you like to do?", [
98
98
  `Keep defaults (all tasks use ${provider})`,
99
99
  "Customize individual tasks",
@@ -112,7 +112,7 @@ export async function runRoutingSetup(opts) {
112
112
  if (choice === 1) {
113
113
  // Customize each task
114
114
  for (const t of TASKS) {
115
- const current = routing[t];
115
+ const current = baseline[t];
116
116
  const keep = await askYesNo(opts.rl, `Keep ${t} → ${current.provider} / ${current.model}?`, true);
117
117
  if (!keep) {
118
118
  const p = await ask(opts.rl, ` Provider for ${t} (e.g. anthropic, openai, xai, ollama): `);
@@ -155,8 +155,28 @@ export async function runRoutingSetup(opts) {
155
155
  model: dreamModel,
156
156
  },
157
157
  });
158
+ // v5.9.3 Screen 4 — re-render the table with `▶` markers on changed rows
159
+ // followed by a Diff() block summarizing what shipped. Then a final
160
+ // status line that names the saved file.
161
+ const updatedCfg = await loadConfig(opts.directory);
162
+ const updatedRouting = buildEffectiveRouting(updatedCfg);
163
+ const finalRows = buildTaskRows(updatedRouting, baseline, dreamEnabledNew);
164
+ console.log("");
165
+ console.log(renderRoutingTable(finalRows));
166
+ console.log("");
167
+ const diffEntries = [];
168
+ for (const t of [...TASKS, "dream"]) {
169
+ const before = baseline[t];
170
+ const after = updatedRouting[t];
171
+ const fromStr = `${before.provider} / ${before.model}`;
172
+ const toStr = `${after.provider} / ${after.model}`;
173
+ diffEntries.push({ task: t, from: fromStr, to: toStr === fromStr ? null : toStr });
174
+ }
175
+ console.log(renderRoutingDiff(diffEntries));
158
176
  console.log("");
159
- console.log(`${CHECK} Task routing updated.`);
177
+ printStatus("ok", "routing saved", `${opts.directory}/.gnosys/gnosys.json`);
178
+ // Footer hint (right-aligned) for any follow-up navigation in the menu flow.
179
+ console.log(Footer("press enter to return"));
160
180
  return true;
161
181
  }
162
182
  //# sourceMappingURL=routing.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"routing.js","sourceRoot":"","sources":["../../../../src/lib/setup/sections/routing.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EACL,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,GAGjB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,IAAI,GAAG,SAAS,CAAC;AACvB,MAAM,GAAG,GAAG,SAAS,CAAC;AACtB,MAAM,KAAK,GAAG,UAAU,CAAC;AACzB,MAAM,KAAK,GAAG,SAAS,CAAC;AACxB,MAAM,KAAK,GAAG,GAAG,KAAK,IAAI,KAAK,EAAE,CAAC;AAElC,MAAM,CAAC,MAAM,iBAAiB,GAA2B;IACvD,WAAW,EAAE,0BAA0B;IACvC,SAAS,EAAE,kBAAkB;IAC7B,yEAAyE;IACzE,IAAI,EAAE,sBAAsB;IAC5B,MAAM,EAAE,cAAc;IACtB,aAAa,EAAE,aAAa;IAC5B,KAAK,EAAE,oBAAoB;CAC5B,CAAC;AAGF,MAAM,KAAK,GAAe,CAAC,aAAa,EAAE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MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;QACvD,MAAM,KAAK,GAAG,GAAG,KAAK,CAAC,QAAQ,MAAM,KAAK,CAAC,KAAK,EAAE,CAAC;QACnD,WAAW,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,KAAK,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC;IACrF,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC,CAAC;IAC5C,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,WAAW,CAAC,IAAI,EAAE,eAAe,EAAE,GAAG,IAAI,CAAC,SAAS,sBAAsB,CAAC,CAAC;IAC5E,6EAA6E;IAC7E,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC,CAAC;IAC7C,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -1,42 +1,56 @@
1
1
  /**
2
- * Setup summary-first wizard (v5.7.0).
2
+ * Setup summary-first wizard (v5.9.3 redesign).
3
3
  *
4
- * When the user runs `gnosys setup` and a config already exists, the first
5
- * screen is the current settings summary. The user picks a numbered option
6
- * to edit just that piece, returns to the summary with `✓ updated` next to
7
- * the changed line, and exits with `[D]one` (apply) or `[E]xit` (revert).
4
+ * When the user runs `gnosys setup` and a config already exists, the
5
+ * first screen is the current settings summary. The user picks a
6
+ * numbered option to edit just that piece, returns to the panel with
7
+ * `✓` next to the changed line for the rest of this sitting, and exits
8
+ * with `done` (Enter or `done`).
8
9
  *
9
- * Each section is a thin wrapper around the existing per-section function
10
- * in `setup.ts` (or a new section module). This file is the orchestrator
11
- * + summary screen it does not duplicate section logic.
10
+ * v5.9.3 changes:
11
+ * - Uses Phase A atoms: Header, Panel, Status, Footer, Prompt
12
+ * - Re-reads config from the ACTIVE store path (.gnosys/ if project
13
+ * scope, else ~/.gnosys/) before re-render — fixes the stale-display
14
+ * bug where switching provider via section 3 left the panel showing
15
+ * the old value because loadConfig was reading from project root
16
+ * rather than .gnosys/.
17
+ * - `[D]one` / `[E]xit` collapsed to single "done" action.
18
+ * - `maybeOfferProviderRepair` reworked to column-aligned detection
19
+ * block with no "pre-v5.8.4" history leak.
12
20
  */
13
21
  import { Interface as ReadlineInterface } from "readline/promises";
14
22
  import { type GnosysConfig } from "../config.js";
23
+ declare function resolveActiveStorePath(projectDir: string): string;
15
24
  /** Each summary line is a section the user can navigate into. */
16
25
  export interface SummarySection {
17
- /** Number key shown in the menu. */
18
26
  key: string;
19
- /** Label shown on the summary line (left side). */
20
27
  label: string;
21
- /** Current value — printed on the right side, dim. */
22
28
  describe: (cfg: GnosysConfig) => string | Promise<string>;
23
- /** Run when user picks this line. Returns true if a change was committed. */
24
29
  edit: (rl: ReadlineInterface, cfg: GnosysConfig, projectDir: string) => Promise<boolean>;
25
30
  }
31
+ export declare function buildSections(): SummarySection[];
26
32
  /**
27
- * Build the section list. Each `edit` calls into existing wizards via
28
- * dynamic import keeps this file decoupled from the legacy setup.ts.
33
+ * Render the panel body one menu-shaped row per section. Returns the
34
+ * row strings (already colored) ready to hand to Panel().
29
35
  */
30
- export declare function buildSections(): SummarySection[];
36
+ declare function renderPanelRows(cfg: GnosysConfig, sections: SummarySection[]): Promise<string[]>;
37
+ /**
38
+ * Build the `trailing` map of `✓` marks for sections edited this sitting.
39
+ */
40
+ declare function buildTrailingMap(updated: Set<string>, sections: SummarySection[]): Record<number, string>;
31
41
  export interface SummaryOptions {
32
- /** Project directory the wizard operates on (default: cwd). */
33
42
  directory?: string;
34
- /** Optional pre-existing readline; useful when caller is already prompting. */
35
43
  rl?: ReadlineInterface;
36
44
  }
37
45
  /**
38
- * Run the summary-first wizard. Loops until the user picks Done or Exit.
39
- * Returns `true` if any section was edited and committed.
46
+ * Run the summary-first wizard. Loops until the user picks "done"
47
+ * (Enter or `done`). Returns true if any section was edited.
40
48
  */
41
49
  export declare function runSummaryWizard(opts?: SummaryOptions): Promise<boolean>;
50
+ export declare const __test: {
51
+ resolveActiveStorePath: typeof resolveActiveStorePath;
52
+ renderPanelRows: typeof renderPanelRows;
53
+ buildTrailingMap: typeof buildTrailingMap;
54
+ };
55
+ export {};
42
56
  //# sourceMappingURL=summary.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"summary.d.ts","sourceRoot":"","sources":["../../../src/lib/setup/summary.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAmB,SAAS,IAAI,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEpF,OAAO,EAIL,KAAK,YAAY,EAElB,MAAM,cAAc,CAAC;AAgFtB,iEAAiE;AACjE,MAAM,WAAW,cAAc;IAC7B,oCAAoC;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,mDAAmD;IACnD,KAAK,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,QAAQ,EAAE,CAAC,GAAG,EAAE,YAAY,KAAK,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC1D,6EAA6E;IAC7E,IAAI,EAAE,CAAC,EAAE,EAAE,iBAAiB,EAAE,GAAG,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CAC1F;AAED;;;GAGG;AACH,wBAAgB,aAAa,IAAI,cAAc,EAAE,CAqGhD;AAqBD,MAAM,WAAW,cAAc;IAC7B,+DAA+D;IAC/D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+EAA+E;IAC/E,EAAE,CAAC,EAAE,iBAAiB,CAAC;CACxB;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,GAAE,cAAmB,GAAG,OAAO,CAAC,OAAO,CAAC,CAuElF"}
1
+ {"version":3,"file":"summary.d.ts","sourceRoot":"","sources":["../../../src/lib/setup/summary.ts"],"names":[],"mappings":"AAAA;;;;;;;;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up` and a config already exists, the first
5
- * screen is the current settings summary. The user picks a numbered option
6
- * to edit just that piece, returns to the summary with `✓ updated` next to
7
- * the changed line, and exits with `[D]one` (apply) or `[E]xit` (revert).
4
+ * When the user runs `gnosys setup` and a config already exists, the
5
+ * first screen is the current settings summary. The user picks a
6
+ * numbered option to edit just that piece, returns to the panel with
7
+ * `✓` next to the changed line for the rest of this sitting, and exits
8
+ * with `done` (Enter or `done`).
8
9
  *
9
- * Each section is a thin wrapper around the existing per-section function
10
- * in `setup.ts` (or a new section module). This file is the orchestrator
11
- * + summary screen it does not duplicate section logic.
10
+ * v5.9.3 changes:
11
+ * - Uses Phase A atoms: Header, Panel, Status, Footer, Prompt
12
+ * - Re-reads config from the ACTIVE store path (.gnosys/ if project
13
+ * scope, else ~/.gnosys/) before re-render — fixes the stale-display
14
+ * bug where switching provider via section 3 left the panel showing
15
+ * the old value because loadConfig was reading from project root
16
+ * rather than .gnosys/.
17
+ * - `[D]one` / `[E]xit` collapsed to single "done" action.
18
+ * - `maybeOfferProviderRepair` reworked to column-aligned detection
19
+ * block with no "pre-v5.8.4" history leak.
12
20
  */
13
21
  import { createInterface } from "readline/promises";
14
22
  import { stdin, stdout } from "process";
23
+ import fsSync from "fs";
24
+ import path from "path";
15
25
  import { loadConfig, resolveTaskModel, updateConfig, } from "../config.js";
16
26
  import { GnosysDB } from "../db.js";
17
- // ─── ANSI ───────────────────────────────────────────────────────────────────
18
- const BOLD = "\x1b[1m";
19
- const DIM = "\x1b[2m";
20
- const GREEN = "\x1b[32m";
21
- const YELLOW = "\x1b[33m";
22
- const RESET = "\x1b[0m";
23
- const CHECK = `${GREEN}✓${RESET}`;
24
- // ─── Provider-revert repair (v5.8.5) ────────────────────────────────────────
27
+ import { getGnosysHome } from "../paths.js";
28
+ import { safeQuestion } from "./ui/safePrompt.js";
29
+ import { Header } from "./ui/header.js";
30
+ import { Panel } from "./ui/panel.js";
31
+ import { Status } from "./ui/status.js";
32
+ import { Footer } from "./ui/footer.js";
33
+ import { c, color, glyph } from "./ui/tokens.js";
34
+ // Read once at module init — used by Header().
35
+ const PKG_VERSION = (() => {
36
+ try {
37
+ const url = new URL("../../../package.json", import.meta.url);
38
+ const raw = fsSync.readFileSync(url, "utf-8");
39
+ return `v${JSON.parse(raw).version ?? "0.0.0"}`;
40
+ }
41
+ catch {
42
+ return undefined;
43
+ }
44
+ })();
45
+ // ─── Active store path ─────────────────────────────────────────────────────
46
+ //
47
+ // loadConfig() reads `<storePath>/gnosys.json`. The active store is either
48
+ // `<projectDir>/.gnosys/` (if that gnosys.json exists) or `~/.gnosys/`
49
+ // (global). Always prefer the project-level one when present so writes by
50
+ // the section editors are visible to the summary re-render.
51
+ function resolveActiveStorePath(projectDir) {
52
+ const projectStore = path.join(projectDir, ".gnosys");
53
+ if (fsSync.existsSync(path.join(projectStore, "gnosys.json")))
54
+ return projectStore;
55
+ return getGnosysHome();
56
+ }
57
+ // ─── Provider-revert repair ────────────────────────────────────────────────
25
58
  //
26
59
  // Detect the "gnosys.json says anthropic but no Anthropic key exists AND
27
- // another provider has a key" pattern. This is the fingerprint of the
28
- // pre-v5.8.4 updateConfig bug that silently seeded `defaultProvider:
29
- // anthropic` into ~/.gnosys/gnosys.json whenever any setup section was
30
- // written to a fresh store. Offer one-keystroke repair.
60
+ // another provider has a key" pattern. Offer one-keystroke repair.
31
61
  const PROVIDERS_WITH_KEYS = ["anthropic", "openai", "xai", "groq", "mistral"];
32
62
  async function maybeOfferProviderRepair(cfg, projectDir, rl) {
33
63
  if (cfg.llm.defaultProvider !== "anthropic")
@@ -35,7 +65,7 @@ async function maybeOfferProviderRepair(cfg, projectDir, rl) {
35
65
  const { getApiKeyForProvider } = await import("../setup.js");
36
66
  const anthropicKey = await getApiKeyForProvider("anthropic");
37
67
  if (anthropicKey)
38
- return; // user might really want Anthropic and just hasn't fully set up yet
68
+ return;
39
69
  const candidates = [];
40
70
  for (const p of PROVIDERS_WITH_KEYS) {
41
71
  if (p === "anthropic")
@@ -45,67 +75,54 @@ async function maybeOfferProviderRepair(cfg, projectDir, rl) {
45
75
  candidates.push(p);
46
76
  }
47
77
  if (candidates.length === 0)
48
- return; // no other provider has a key either
49
- // Pick the strongest candidate. Order in PROVIDERS_WITH_KEYS is the priority.
78
+ return;
50
79
  const suggestion = candidates[0];
51
- console.log("");
52
- console.log(`${YELLOW}⚠${RESET} Your gnosys.json says ${BOLD}defaultProvider: anthropic${RESET},`);
53
- console.log(` but no Anthropic API key is configured (env or keychain).`);
54
- console.log(` Found a key for ${BOLD}${suggestion}${RESET}${candidates.length > 1 ? ` (also: ${candidates.slice(1).join(", ")})` : ""}.`);
55
- console.log("");
56
- console.log(` This usually means a pre-v5.8.4 setup wizard seeded anthropic by mistake.`);
57
- console.log("");
58
- const answer = (await rl.question(`Switch the default to ${BOLD}${suggestion}${RESET}? [Y/n] `)).trim().toLowerCase();
80
+ const others = candidates.slice(1);
81
+ // Header for the provider-check sub-screen.
82
+ process.stdout.write(`${Header(["gnosys", "setup", "provider-check"], { version: PKG_VERSION })}\n\n`);
83
+ process.stdout.write(`${Status("warn", "default provider mismatch")}\n\n`);
84
+ // Column-aligned detection block.
85
+ const indent = " ";
86
+ const label = (s) => color(c.textDim, s.padEnd(20));
87
+ process.stdout.write(`${indent}${label("gnosys.json says")}${color(c.text, "anthropic")}\n`);
88
+ process.stdout.write(`${indent}${label("anthropic key")}${color(c.textMid, "not found in env or keychain")}\n`);
89
+ process.stdout.write(`${indent}${label("key found for")}${color(c.accentHi, suggestion)}\n`);
90
+ if (others.length > 0) {
91
+ process.stdout.write(`${indent}${label("")}${color(c.textDim, `(also available: ${others.join(", ")})`)}\n`);
92
+ }
93
+ process.stdout.write("\n");
94
+ const answer = (await safeQuestion(rl, ` ${color(c.accent, glyph.prompt)} switch the default to ${color(c.accentHi, suggestion)}? [Y/n] `))
95
+ .trim()
96
+ .toLowerCase();
59
97
  if (answer === "n" || answer === "no") {
60
- console.log(`${DIM}Left as anthropic. Run option 1 below to change explicitly.${RESET}`);
98
+ process.stdout.write(`${Status("warn", "keeping anthropic as the default", "edit via section 1 to change")}\n`);
61
99
  return;
62
100
  }
63
101
  try {
64
- // Write to the store that actually holds the current config so the
65
- // override lands at the right scope.
66
- const { getGnosysHome } = await import("../paths.js");
67
- const fs = await import("fs/promises");
68
- const path = await import("path");
69
- // Prefer project-level if it has a gnosys.json, else global.
70
- const projectStore = path.join(projectDir, ".gnosys");
71
- let storePath = getGnosysHome();
72
- try {
73
- const stat = await fs.stat(path.join(projectStore, "gnosys.json"));
74
- if (stat.isFile())
75
- storePath = projectStore;
76
- }
77
- catch {
78
- // fall back to global
79
- }
102
+ const storePath = resolveActiveStorePath(projectDir);
80
103
  await updateConfig(storePath, { llm: { defaultProvider: suggestion } });
81
- console.log(`${CHECK} Switched default to ${BOLD}${suggestion}${RESET}.`);
104
+ process.stdout.write(`${Status("ok", `default switched · ${suggestion} is now the active provider`)}\n`);
82
105
  }
83
106
  catch (err) {
84
- console.log(`${YELLOW}⚠${RESET} Failed to repair: ${err instanceof Error ? err.message : String(err)}`);
85
- console.log(`${DIM}Run 'gnosys setup models' to change manually.${RESET}`);
107
+ process.stdout.write(`${Status("warn", `failed to repair: ${err instanceof Error ? err.message : String(err)}`)}\n`);
108
+ process.stdout.write(`${Status("warn", "run 'gnosys setup models' to change manually", "fallback")}\n`);
86
109
  }
87
110
  }
88
- /**
89
- * Build the section list. Each `edit` calls into existing wizards via
90
- * dynamic import — keeps this file decoupled from the legacy setup.ts.
91
- */
92
111
  export function buildSections() {
93
112
  return [
94
113
  {
95
114
  key: "1",
96
- label: "Provider",
115
+ label: "provider",
97
116
  describe: (cfg) => cfg.llm.defaultProvider,
98
117
  edit: async (rl, _cfg, projectDir) => {
99
118
  const { runModelsSetup } = await import("../setup.js");
100
- // v5.8.4: pass the summary's readline through so we don't open a
101
- // second one and double every keystroke.
102
119
  await runModelsSetup({ directory: projectDir, rl });
103
120
  return true;
104
121
  },
105
122
  },
106
123
  {
107
124
  key: "2",
108
- label: "Models",
125
+ label: "models",
109
126
  describe: async (cfg) => {
110
127
  const synth = resolveTaskModel(cfg, "synthesis");
111
128
  return `${synth.provider} / ${synth.model}`;
@@ -118,7 +135,7 @@ export function buildSections() {
118
135
  },
119
136
  {
120
137
  key: "3",
121
- label: "Task Routing",
138
+ label: "task routing",
122
139
  describe: async (cfg) => {
123
140
  const provs = new Set([
124
141
  resolveTaskModel(cfg, "structuring").provider,
@@ -130,8 +147,8 @@ export function buildSections() {
130
147
  },
131
148
  {
132
149
  key: "4",
133
- label: "IDE Integrations",
134
- describe: async (_cfg) => {
150
+ label: "ide integrations",
151
+ describe: async () => {
135
152
  const { detectIDEs } = await import("../setup.js");
136
153
  const ides = await detectIDEs(process.cwd());
137
154
  return ides.length === 0 ? "none" : `${ides.length} configured`;
@@ -140,7 +157,7 @@ export function buildSections() {
140
157
  },
141
158
  {
142
159
  key: "5",
143
- label: "Multi-machine Sync",
160
+ label: "multi-machine sync",
144
161
  describe: () => {
145
162
  try {
146
163
  const db = GnosysDB.openLocal();
@@ -165,7 +182,7 @@ export function buildSections() {
165
182
  },
166
183
  {
167
184
  key: "6",
168
- label: "Dream Mode",
185
+ label: "dream mode",
169
186
  describe: (cfg) => {
170
187
  if (!cfg.dream?.enabled)
171
188
  return "disabled";
@@ -181,7 +198,7 @@ export function buildSections() {
181
198
  },
182
199
  {
183
200
  key: "7",
184
- label: "User Preferences",
201
+ label: "user preferences",
185
202
  describe: async () => {
186
203
  const { listUserPreferences } = await import("./sections/preferences.js");
187
204
  const prefs = await listUserPreferences();
@@ -194,23 +211,46 @@ export function buildSections() {
194
211
  },
195
212
  ];
196
213
  }
197
- // ─── Section editors that don't yet have standalone wizards ────────────────
198
- /**
199
- * Per-task routing editor. The legacy `runSetup` walks all 5 tasks in step 4
200
- * — this lets the user revisit the choice without redoing provider/models.
201
- */
202
214
  async function editRouting(rl, projectDir) {
203
215
  const { runRoutingSetup } = await import("./sections/routing.js");
204
216
  return runRoutingSetup({ rl, directory: projectDir });
205
217
  }
206
- /** IDE selection editor — same prompt as step 5 in the linear wizard. */
207
218
  async function editIDEs(rl, projectDir) {
208
219
  const { runIdesSetup } = await import("./sections/ides.js");
209
220
  return runIdesSetup({ rl, directory: projectDir });
210
221
  }
222
+ // ─── Rendering ─────────────────────────────────────────────────────────────
211
223
  /**
212
- * Run the summary-first wizard. Loops until the user picks Done or Exit.
213
- * Returns `true` if any section was edited and committed.
224
+ * Render the panel body one menu-shaped row per section. Returns the
225
+ * row strings (already colored) ready to hand to Panel().
226
+ */
227
+ async function renderPanelRows(cfg, sections) {
228
+ const labelW = Math.max(...sections.map((s) => s.label.length));
229
+ const rows = [];
230
+ for (const s of sections) {
231
+ const value = await s.describe(cfg);
232
+ const numTxt = color(c.textDim, s.key);
233
+ const labelTxt = color(c.text, s.label.padEnd(labelW));
234
+ const valueTxt = color(c.textMid, value);
235
+ rows.push(` ${numTxt} ${labelTxt} ${valueTxt}`);
236
+ }
237
+ return rows;
238
+ }
239
+ /**
240
+ * Build the `trailing` map of `✓` marks for sections edited this sitting.
241
+ */
242
+ function buildTrailingMap(updated, sections) {
243
+ const trailing = {};
244
+ sections.forEach((s, idx) => {
245
+ if (updated.has(s.key)) {
246
+ trailing[idx] = color(c.ok, glyph.ok);
247
+ }
248
+ });
249
+ return trailing;
250
+ }
251
+ /**
252
+ * Run the summary-first wizard. Loops until the user picks "done"
253
+ * (Enter or `done`). Returns true if any section was edited.
214
254
  */
215
255
  export async function runSummaryWizard(opts = {}) {
216
256
  const projectDir = opts.directory ?? process.cwd();
@@ -222,47 +262,35 @@ export async function runSummaryWizard(opts = {}) {
222
262
  let revertCheckDone = false;
223
263
  try {
224
264
  while (true) {
225
- // Reload config each iteration so the displayed values reflect any
226
- // section edit that just happened.
227
- const cfg = await loadConfig(projectDir);
228
- // v5.8.5: detect the "config says anthropic but no Anthropic key is
229
- // configured anywhere AND another provider has a key" pattern. This
230
- // is the fingerprint of the pre-v5.8.4 updateConfig bug that silently
231
- // seeded `defaultProvider: anthropic` into ~/.gnosys/gnosys.json when
232
- // any section was written to a fresh store. Offer one-keystroke repair.
265
+ // Always re-read from the ACTIVE store path so any section edit is
266
+ // reflected immediately. The previous bug used the projectDir root,
267
+ // which didn't contain gnosys.json — only the .gnosys/ subdir did.
268
+ const storePath = resolveActiveStorePath(projectDir);
269
+ const cfg = await loadConfig(storePath);
233
270
  if (!revertCheckDone) {
234
271
  revertCheckDone = true;
235
272
  await maybeOfferProviderRepair(cfg, projectDir, rl);
236
273
  }
237
- console.log("");
238
- console.log(`${BOLD}┌─────────────────────────────────────────────┐${RESET}`);
239
- console.log(`${BOLD}│ Gnosys Settings │${RESET}`);
240
- console.log(`${BOLD}├─────────────────────────────────────────────┤${RESET}`);
241
- for (const s of sections) {
242
- const value = await s.describe(cfg);
243
- const marker = updated.has(s.key) ? ` ${CHECK}` : " ";
244
- const line = ` ${s.key}. ${s.label.padEnd(18)} ${DIM}${value}${RESET}${marker}`;
245
- console.log(line);
246
- }
247
- console.log(`${BOLD}└─────────────────────────────────────────────┘${RESET}`);
248
- console.log("");
249
- console.log(` Pick a number to edit · ${BOLD}D${RESET}one · ${BOLD}E${RESET}xit`);
250
- const answer = (await rl.question("> ")).trim().toLowerCase();
251
- if (!answer || answer === "d" || answer === "done") {
252
- return anyChange;
253
- }
254
- if (answer === "e" || answer === "exit") {
255
- if (anyChange) {
256
- console.log(`${DIM}(any changes already committed during section edits stay applied)${RESET}`);
257
- }
274
+ // Render header + panel.
275
+ process.stdout.write("\n");
276
+ process.stdout.write(`${Header(["gnosys", "setup"], { version: PKG_VERSION })}\n\n`);
277
+ const rows = await renderPanelRows(cfg, sections);
278
+ const trailing = buildTrailingMap(updated, sections);
279
+ process.stdout.write(`${Panel("gnosys settings", rows, { trailing })}\n\n`);
280
+ process.stdout.write(`${Footer(`1–${sections.length} · edit enter · done`)}\n`);
281
+ const answer = (await safeQuestion(rl, ` ${color(c.accent, glyph.prompt)} `))
282
+ .trim()
283
+ .toLowerCase();
284
+ if (!answer || answer === "done") {
258
285
  return anyChange;
259
286
  }
260
287
  const section = sections.find((s) => s.key === answer);
261
288
  if (!section) {
262
- console.log(`${DIM}Unknown choice: ${answer}${RESET}`);
289
+ process.stdout.write(`${Status("warn", `unknown choice: ${answer}`)}\n`);
263
290
  continue;
264
291
  }
265
- const cfgForEdit = await loadConfig(projectDir);
292
+ // Pass a fresh config snapshot to the editor.
293
+ const cfgForEdit = await loadConfig(storePath);
266
294
  try {
267
295
  const changed = await section.edit(rl, cfgForEdit, projectDir);
268
296
  if (changed) {
@@ -271,7 +299,7 @@ export async function runSummaryWizard(opts = {}) {
271
299
  }
272
300
  }
273
301
  catch (err) {
274
- console.log(`${DIM}Section editor failed: ${err instanceof Error ? err.message : String(err)}${RESET}`);
302
+ process.stdout.write(`${Status("fail", `section editor failed: ${err instanceof Error ? err.message : String(err)}`)}\n`);
275
303
  }
276
304
  }
277
305
  }
@@ -280,4 +308,6 @@ export async function runSummaryWizard(opts = {}) {
280
308
  rl.close();
281
309
  }
282
310
  }
311
+ // Internal helpers exported for tests.
312
+ export const __test = { resolveActiveStorePath, renderPanelRows, buildTrailingMap };
283
313
  //# sourceMappingURL=summary.js.map