@gmickel/gno 0.7.0 → 0.8.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 (209) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +90 -50
  3. package/THIRD_PARTY_NOTICES.md +22 -0
  4. package/assets/screenshots/webui-ask-answer.png +0 -0
  5. package/assets/screenshots/webui-collections.png +0 -0
  6. package/assets/screenshots/webui-editor.png +0 -0
  7. package/assets/screenshots/webui-home.png +0 -0
  8. package/assets/skill/SKILL.md +12 -12
  9. package/assets/skill/cli-reference.md +59 -57
  10. package/assets/skill/examples.md +8 -7
  11. package/assets/skill/mcp-reference.md +8 -4
  12. package/package.json +32 -25
  13. package/src/app/constants.ts +43 -42
  14. package/src/cli/colors.ts +1 -1
  15. package/src/cli/commands/ask.ts +44 -43
  16. package/src/cli/commands/cleanup.ts +9 -8
  17. package/src/cli/commands/collection/add.ts +12 -12
  18. package/src/cli/commands/collection/index.ts +4 -4
  19. package/src/cli/commands/collection/list.ts +26 -25
  20. package/src/cli/commands/collection/remove.ts +10 -10
  21. package/src/cli/commands/collection/rename.ts +10 -10
  22. package/src/cli/commands/context/add.ts +1 -1
  23. package/src/cli/commands/context/check.ts +17 -17
  24. package/src/cli/commands/context/index.ts +4 -4
  25. package/src/cli/commands/context/list.ts +11 -11
  26. package/src/cli/commands/context/rm.ts +1 -1
  27. package/src/cli/commands/doctor.ts +86 -84
  28. package/src/cli/commands/embed.ts +30 -28
  29. package/src/cli/commands/get.ts +27 -26
  30. package/src/cli/commands/index-cmd.ts +9 -9
  31. package/src/cli/commands/index.ts +16 -16
  32. package/src/cli/commands/init.ts +13 -12
  33. package/src/cli/commands/ls.ts +20 -19
  34. package/src/cli/commands/mcp/config.ts +30 -28
  35. package/src/cli/commands/mcp/index.ts +4 -4
  36. package/src/cli/commands/mcp/install.ts +17 -17
  37. package/src/cli/commands/mcp/paths.ts +133 -133
  38. package/src/cli/commands/mcp/status.ts +21 -21
  39. package/src/cli/commands/mcp/uninstall.ts +13 -13
  40. package/src/cli/commands/mcp.ts +2 -2
  41. package/src/cli/commands/models/clear.ts +12 -11
  42. package/src/cli/commands/models/index.ts +5 -5
  43. package/src/cli/commands/models/list.ts +31 -30
  44. package/src/cli/commands/models/path.ts +1 -1
  45. package/src/cli/commands/models/pull.ts +19 -18
  46. package/src/cli/commands/models/use.ts +4 -4
  47. package/src/cli/commands/multi-get.ts +38 -36
  48. package/src/cli/commands/query.ts +21 -20
  49. package/src/cli/commands/ref-parser.ts +10 -10
  50. package/src/cli/commands/reset.ts +40 -39
  51. package/src/cli/commands/search.ts +14 -13
  52. package/src/cli/commands/serve.ts +4 -4
  53. package/src/cli/commands/shared.ts +11 -10
  54. package/src/cli/commands/skill/index.ts +5 -5
  55. package/src/cli/commands/skill/install.ts +18 -17
  56. package/src/cli/commands/skill/paths-cmd.ts +11 -10
  57. package/src/cli/commands/skill/paths.ts +23 -23
  58. package/src/cli/commands/skill/show.ts +13 -12
  59. package/src/cli/commands/skill/uninstall.ts +16 -15
  60. package/src/cli/commands/status.ts +25 -24
  61. package/src/cli/commands/update.ts +3 -3
  62. package/src/cli/commands/vsearch.ts +17 -16
  63. package/src/cli/context.ts +5 -5
  64. package/src/cli/errors.ts +3 -3
  65. package/src/cli/format/search-results.ts +37 -37
  66. package/src/cli/options.ts +43 -43
  67. package/src/cli/program.ts +455 -459
  68. package/src/cli/progress.ts +1 -1
  69. package/src/cli/run.ts +24 -23
  70. package/src/collection/add.ts +9 -8
  71. package/src/collection/index.ts +3 -3
  72. package/src/collection/remove.ts +7 -6
  73. package/src/collection/types.ts +6 -6
  74. package/src/config/defaults.ts +1 -1
  75. package/src/config/index.ts +5 -5
  76. package/src/config/loader.ts +19 -18
  77. package/src/config/paths.ts +9 -8
  78. package/src/config/saver.ts +14 -13
  79. package/src/config/types.ts +53 -52
  80. package/src/converters/adapters/markitdownTs/adapter.ts +21 -19
  81. package/src/converters/adapters/officeparser/adapter.ts +18 -16
  82. package/src/converters/canonicalize.ts +12 -12
  83. package/src/converters/errors.ts +26 -22
  84. package/src/converters/index.ts +8 -8
  85. package/src/converters/mime.ts +25 -25
  86. package/src/converters/native/markdown.ts +10 -9
  87. package/src/converters/native/plaintext.ts +8 -7
  88. package/src/converters/path.ts +2 -2
  89. package/src/converters/pipeline.ts +11 -10
  90. package/src/converters/registry.ts +8 -8
  91. package/src/converters/types.ts +14 -14
  92. package/src/converters/versions.ts +4 -4
  93. package/src/index.ts +4 -4
  94. package/src/ingestion/chunker.ts +10 -9
  95. package/src/ingestion/index.ts +6 -6
  96. package/src/ingestion/language.ts +62 -62
  97. package/src/ingestion/sync.ts +50 -49
  98. package/src/ingestion/types.ts +10 -10
  99. package/src/ingestion/walker.ts +14 -13
  100. package/src/llm/cache.ts +51 -49
  101. package/src/llm/errors.ts +40 -36
  102. package/src/llm/index.ts +9 -9
  103. package/src/llm/lockfile.ts +6 -6
  104. package/src/llm/nodeLlamaCpp/adapter.ts +13 -12
  105. package/src/llm/nodeLlamaCpp/embedding.ts +9 -8
  106. package/src/llm/nodeLlamaCpp/generation.ts +7 -6
  107. package/src/llm/nodeLlamaCpp/lifecycle.ts +11 -10
  108. package/src/llm/nodeLlamaCpp/rerank.ts +6 -5
  109. package/src/llm/policy.ts +5 -5
  110. package/src/llm/registry.ts +6 -5
  111. package/src/llm/types.ts +2 -2
  112. package/src/mcp/resources/index.ts +15 -13
  113. package/src/mcp/server.ts +25 -23
  114. package/src/mcp/tools/get.ts +25 -23
  115. package/src/mcp/tools/index.ts +32 -29
  116. package/src/mcp/tools/multi-get.ts +34 -32
  117. package/src/mcp/tools/query.ts +29 -27
  118. package/src/mcp/tools/search.ts +14 -12
  119. package/src/mcp/tools/status.ts +12 -11
  120. package/src/mcp/tools/vsearch.ts +26 -24
  121. package/src/pipeline/answer.ts +9 -9
  122. package/src/pipeline/chunk-lookup.ts +1 -1
  123. package/src/pipeline/contextual.ts +4 -4
  124. package/src/pipeline/expansion.ts +23 -21
  125. package/src/pipeline/explain.ts +21 -21
  126. package/src/pipeline/fusion.ts +9 -9
  127. package/src/pipeline/hybrid.ts +41 -42
  128. package/src/pipeline/index.ts +10 -10
  129. package/src/pipeline/query-language.ts +39 -39
  130. package/src/pipeline/rerank.ts +8 -7
  131. package/src/pipeline/search.ts +22 -22
  132. package/src/pipeline/types.ts +8 -8
  133. package/src/pipeline/vsearch.ts +21 -24
  134. package/src/serve/CLAUDE.md +21 -15
  135. package/src/serve/config-sync.ts +9 -8
  136. package/src/serve/context.ts +19 -18
  137. package/src/serve/index.ts +1 -1
  138. package/src/serve/jobs.ts +7 -7
  139. package/src/serve/public/app.tsx +79 -25
  140. package/src/serve/public/components/AddCollectionDialog.tsx +382 -0
  141. package/src/serve/public/components/CaptureButton.tsx +60 -0
  142. package/src/serve/public/components/CaptureModal.tsx +365 -0
  143. package/src/serve/public/components/IndexingProgress.tsx +333 -0
  144. package/src/serve/public/components/ShortcutHelpModal.tsx +106 -0
  145. package/src/serve/public/components/ai-elements/code-block.tsx +42 -32
  146. package/src/serve/public/components/ai-elements/conversation.tsx +16 -14
  147. package/src/serve/public/components/ai-elements/inline-citation.tsx +33 -32
  148. package/src/serve/public/components/ai-elements/loader.tsx +5 -4
  149. package/src/serve/public/components/ai-elements/message.tsx +39 -37
  150. package/src/serve/public/components/ai-elements/prompt-input.tsx +97 -95
  151. package/src/serve/public/components/ai-elements/sources.tsx +12 -10
  152. package/src/serve/public/components/ai-elements/suggestion.tsx +10 -9
  153. package/src/serve/public/components/editor/CodeMirrorEditor.tsx +142 -0
  154. package/src/serve/public/components/editor/MarkdownPreview.tsx +311 -0
  155. package/src/serve/public/components/editor/index.ts +6 -0
  156. package/src/serve/public/components/preset-selector.tsx +29 -28
  157. package/src/serve/public/components/ui/badge.tsx +13 -12
  158. package/src/serve/public/components/ui/button-group.tsx +13 -12
  159. package/src/serve/public/components/ui/button.tsx +23 -22
  160. package/src/serve/public/components/ui/card.tsx +16 -16
  161. package/src/serve/public/components/ui/carousel.tsx +36 -35
  162. package/src/serve/public/components/ui/collapsible.tsx +1 -1
  163. package/src/serve/public/components/ui/command.tsx +17 -15
  164. package/src/serve/public/components/ui/dialog.tsx +13 -12
  165. package/src/serve/public/components/ui/dropdown-menu.tsx +13 -12
  166. package/src/serve/public/components/ui/hover-card.tsx +6 -5
  167. package/src/serve/public/components/ui/input-group.tsx +45 -43
  168. package/src/serve/public/components/ui/input.tsx +6 -6
  169. package/src/serve/public/components/ui/progress.tsx +5 -4
  170. package/src/serve/public/components/ui/scroll-area.tsx +11 -10
  171. package/src/serve/public/components/ui/select.tsx +19 -18
  172. package/src/serve/public/components/ui/separator.tsx +6 -5
  173. package/src/serve/public/components/ui/table.tsx +18 -18
  174. package/src/serve/public/components/ui/textarea.tsx +4 -4
  175. package/src/serve/public/components/ui/tooltip.tsx +5 -4
  176. package/src/serve/public/globals.css +27 -4
  177. package/src/serve/public/hooks/use-api.ts +8 -8
  178. package/src/serve/public/hooks/useCaptureModal.tsx +83 -0
  179. package/src/serve/public/hooks/useKeyboardShortcuts.ts +85 -0
  180. package/src/serve/public/index.html +4 -4
  181. package/src/serve/public/lib/utils.ts +6 -0
  182. package/src/serve/public/pages/Ask.tsx +27 -26
  183. package/src/serve/public/pages/Browse.tsx +28 -27
  184. package/src/serve/public/pages/Collections.tsx +439 -0
  185. package/src/serve/public/pages/Dashboard.tsx +166 -40
  186. package/src/serve/public/pages/DocView.tsx +258 -73
  187. package/src/serve/public/pages/DocumentEditor.tsx +510 -0
  188. package/src/serve/public/pages/Search.tsx +80 -58
  189. package/src/serve/routes/api.ts +272 -155
  190. package/src/serve/security.ts +4 -4
  191. package/src/serve/server.ts +66 -48
  192. package/src/store/index.ts +5 -5
  193. package/src/store/migrations/001-initial.ts +24 -23
  194. package/src/store/migrations/002-documents-fts.ts +7 -6
  195. package/src/store/migrations/index.ts +4 -4
  196. package/src/store/migrations/runner.ts +17 -15
  197. package/src/store/sqlite/adapter.ts +123 -121
  198. package/src/store/sqlite/fts5-snowball.ts +24 -23
  199. package/src/store/sqlite/index.ts +1 -1
  200. package/src/store/sqlite/setup.ts +12 -12
  201. package/src/store/sqlite/types.ts +4 -4
  202. package/src/store/types.ts +19 -19
  203. package/src/store/vector/index.ts +3 -3
  204. package/src/store/vector/sqlite-vec.ts +23 -20
  205. package/src/store/vector/stats.ts +10 -8
  206. package/src/store/vector/types.ts +2 -2
  207. package/vendor/fts5-snowball/README.md +6 -6
  208. package/assets/screenshots/webui-ask-answer.jpg +0 -0
  209. package/assets/screenshots/webui-home.jpg +0 -0
@@ -4,8 +4,8 @@
4
4
  * @module src/cli/commands/mcp/install
5
5
  */
6
6
 
7
- import { CliError } from '../../errors.js';
8
- import { getGlobals } from '../../program.js';
7
+ import { CliError } from "../../errors.js";
8
+ import { getGlobals } from "../../program.js";
9
9
  import {
10
10
  type AnyMcpConfig,
11
11
  buildEntry,
@@ -15,7 +15,7 @@ import {
15
15
  type StandardMcpEntry,
16
16
  setServerEntry,
17
17
  writeMcpConfig,
18
- } from './config.js';
18
+ } from "./config.js";
19
19
  import {
20
20
  buildMcpServerEntry,
21
21
  getTargetDisplayName,
@@ -24,7 +24,7 @@ import {
24
24
  type McpTarget,
25
25
  resolveMcpConfigPath,
26
26
  TARGETS_WITH_PROJECT_SCOPE,
27
- } from './paths.js';
27
+ } from "./paths.js";
28
28
 
29
29
  // ─────────────────────────────────────────────────────────────────────────────
30
30
  // Types
@@ -49,7 +49,7 @@ interface InstallResult {
49
49
  target: McpTarget;
50
50
  scope: McpScope;
51
51
  configPath: string;
52
- action: 'created' | 'updated' | 'dry_run_create' | 'dry_run_update';
52
+ action: "created" | "updated" | "dry_run_create" | "dry_run_update";
53
53
  serverEntry: { command: string; args: string[] };
54
54
  }
55
55
 
@@ -91,10 +91,10 @@ async function installToTarget(
91
91
  const alreadyExists = hasServerEntry(config, MCP_SERVER_NAME, configFormat);
92
92
  if (alreadyExists && !force) {
93
93
  throw new CliError(
94
- 'VALIDATION',
94
+ "VALIDATION",
95
95
  `${getTargetDisplayName(target)} already has gno configured.\n` +
96
96
  ` Config: ${configPath}\n` +
97
- ' Use --force to overwrite.'
97
+ " Use --force to overwrite."
98
98
  );
99
99
  }
100
100
 
@@ -105,12 +105,12 @@ async function installToTarget(
105
105
  target,
106
106
  scope,
107
107
  configPath,
108
- action: wouldCreate ? 'dry_run_create' : 'dry_run_update',
108
+ action: wouldCreate ? "dry_run_create" : "dry_run_update",
109
109
  serverEntry,
110
110
  };
111
111
  }
112
112
 
113
- const action = wouldCreate ? 'created' : 'updated';
113
+ const action = wouldCreate ? "created" : "updated";
114
114
 
115
115
  // Build format-specific entry and add to config
116
116
  const entry = buildEntry(serverEntry.command, serverEntry.args, configFormat);
@@ -143,8 +143,8 @@ function safeGetGlobals(): { json: boolean; quiet: boolean } {
143
143
  * Install gno MCP server.
144
144
  */
145
145
  export async function installMcp(opts: InstallOptions = {}): Promise<void> {
146
- const target = opts.target ?? 'claude-desktop';
147
- const scope = opts.scope ?? 'user';
146
+ const target = opts.target ?? "claude-desktop";
147
+ const scope = opts.scope ?? "user";
148
148
  const force = opts.force ?? false;
149
149
  const dryRun = opts.dryRun ?? false;
150
150
  const globals = safeGetGlobals();
@@ -152,9 +152,9 @@ export async function installMcp(opts: InstallOptions = {}): Promise<void> {
152
152
  const quiet = opts.quiet ?? globals.quiet;
153
153
 
154
154
  // Validate scope - only some targets support project scope
155
- if (scope === 'project' && !TARGETS_WITH_PROJECT_SCOPE.includes(target)) {
155
+ if (scope === "project" && !TARGETS_WITH_PROJECT_SCOPE.includes(target)) {
156
156
  throw new CliError(
157
- 'VALIDATION',
157
+ "VALIDATION",
158
158
  `${getTargetDisplayName(target)} does not support project scope. Use --scope user.`
159
159
  );
160
160
  }
@@ -181,18 +181,18 @@ export async function installMcp(opts: InstallOptions = {}): Promise<void> {
181
181
  }
182
182
 
183
183
  if (dryRun) {
184
- const dryRunVerb = result.action === 'dry_run_create' ? 'create' : 'update';
185
- process.stdout.write('Dry run - no changes made.\n\n');
184
+ const dryRunVerb = result.action === "dry_run_create" ? "create" : "update";
185
+ process.stdout.write("Dry run - no changes made.\n\n");
186
186
  process.stdout.write(
187
187
  `Would ${dryRunVerb} gno in ${getTargetDisplayName(target)}:\n`
188
188
  );
189
189
  process.stdout.write(` Config: ${result.configPath}\n`);
190
190
  process.stdout.write(` Command: ${serverEntry.command}\n`);
191
- process.stdout.write(` Args: ${serverEntry.args.join(' ')}\n`);
191
+ process.stdout.write(` Args: ${serverEntry.args.join(" ")}\n`);
192
192
  return;
193
193
  }
194
194
 
195
- const verb = result.action === 'created' ? 'Installed' : 'Updated';
195
+ const verb = result.action === "created" ? "Installed" : "Updated";
196
196
  process.stdout.write(
197
197
  `${verb} gno MCP server in ${getTargetDisplayName(target)}.\n`
198
198
  );
@@ -5,27 +5,27 @@
5
5
  * @module src/cli/commands/mcp/paths
6
6
  */
7
7
 
8
- import { existsSync } from 'node:fs';
9
- import { homedir, platform } from 'node:os';
10
- import { join } from 'node:path';
8
+ import { existsSync } from "node:fs";
9
+ import { homedir, platform } from "node:os";
10
+ import { join } from "node:path";
11
11
 
12
12
  // ─────────────────────────────────────────────────────────────────────────────
13
13
  // Types
14
14
  // ─────────────────────────────────────────────────────────────────────────────
15
15
 
16
16
  export type McpTarget =
17
- | 'claude-desktop'
18
- | 'claude-code'
19
- | 'codex'
20
- | 'cursor'
21
- | 'zed'
22
- | 'windsurf'
23
- | 'opencode'
24
- | 'amp'
25
- | 'lmstudio'
26
- | 'librechat';
27
-
28
- export type McpScope = 'user' | 'project';
17
+ | "claude-desktop"
18
+ | "claude-code"
19
+ | "codex"
20
+ | "cursor"
21
+ | "zed"
22
+ | "windsurf"
23
+ | "opencode"
24
+ | "amp"
25
+ | "lmstudio"
26
+ | "librechat";
27
+
28
+ export type McpScope = "user" | "project";
29
29
 
30
30
  /**
31
31
  * Config format varies by target.
@@ -36,11 +36,11 @@ export type McpScope = 'user' | 'project';
36
36
  * - yaml_standard: YAML file with mcpServers key (LibreChat)
37
37
  */
38
38
  export type McpConfigFormat =
39
- | 'standard'
40
- | 'context_servers'
41
- | 'mcp'
42
- | 'amp_mcp'
43
- | 'yaml_standard';
39
+ | "standard"
40
+ | "context_servers"
41
+ | "mcp"
42
+ | "amp_mcp"
43
+ | "yaml_standard";
44
44
 
45
45
  export interface McpConfigPaths {
46
46
  /** Config file path */
@@ -69,44 +69,44 @@ export interface McpPathOptions {
69
69
  // Constants
70
70
  // ─────────────────────────────────────────────────────────────────────────────
71
71
 
72
- export const MCP_SERVER_NAME = 'gno';
72
+ export const MCP_SERVER_NAME = "gno";
73
73
 
74
74
  /** All supported MCP targets */
75
75
  export const MCP_TARGETS: McpTarget[] = [
76
- 'claude-desktop',
77
- 'claude-code',
78
- 'codex',
79
- 'cursor',
80
- 'zed',
81
- 'windsurf',
82
- 'opencode',
83
- 'amp',
84
- 'lmstudio',
85
- 'librechat',
76
+ "claude-desktop",
77
+ "claude-code",
78
+ "codex",
79
+ "cursor",
80
+ "zed",
81
+ "windsurf",
82
+ "opencode",
83
+ "amp",
84
+ "lmstudio",
85
+ "librechat",
86
86
  ];
87
87
 
88
88
  /** Targets that support project scope */
89
89
  export const TARGETS_WITH_PROJECT_SCOPE: McpTarget[] = [
90
- 'claude-code',
91
- 'codex',
92
- 'cursor',
93
- 'opencode',
94
- 'librechat',
90
+ "claude-code",
91
+ "codex",
92
+ "cursor",
93
+ "opencode",
94
+ "librechat",
95
95
  ];
96
96
 
97
97
  /** Get config format for a target */
98
98
  export function getTargetConfigFormat(target: McpTarget): McpConfigFormat {
99
99
  switch (target) {
100
- case 'zed':
101
- return 'context_servers';
102
- case 'opencode':
103
- return 'mcp';
104
- case 'amp':
105
- return 'amp_mcp';
106
- case 'librechat':
107
- return 'yaml_standard';
100
+ case "zed":
101
+ return "context_servers";
102
+ case "opencode":
103
+ return "mcp";
104
+ case "amp":
105
+ return "amp_mcp";
106
+ case "librechat":
107
+ return "yaml_standard";
108
108
  default:
109
- return 'standard';
109
+ return "standard";
110
110
  }
111
111
  }
112
112
 
@@ -123,18 +123,18 @@ const COMMANDS_PATH_PATTERN = /\/commands\/.*$/;
123
123
  function resolveClaudeDesktopPath(home: string): string {
124
124
  const plat = platform();
125
125
 
126
- if (plat === 'darwin') {
126
+ if (plat === "darwin") {
127
127
  return join(
128
128
  home,
129
- 'Library/Application Support/Claude/claude_desktop_config.json'
129
+ "Library/Application Support/Claude/claude_desktop_config.json"
130
130
  );
131
131
  }
132
- if (plat === 'win32') {
133
- const appData = process.env.APPDATA || join(home, 'AppData/Roaming');
134
- return join(appData, 'Claude/claude_desktop_config.json');
132
+ if (plat === "win32") {
133
+ const appData = process.env.APPDATA || join(home, "AppData/Roaming");
134
+ return join(appData, "Claude/claude_desktop_config.json");
135
135
  }
136
136
  // Linux and other Unix
137
- return join(home, '.config/Claude/claude_desktop_config.json');
137
+ return join(home, ".config/Claude/claude_desktop_config.json");
138
138
  }
139
139
 
140
140
  /**
@@ -145,34 +145,34 @@ function resolveClaudeCodePath(
145
145
  home: string,
146
146
  cwd: string
147
147
  ): string {
148
- if (scope === 'user') {
149
- return join(home, '.claude.json');
148
+ if (scope === "user") {
149
+ return join(home, ".claude.json");
150
150
  }
151
- return join(cwd, '.mcp.json');
151
+ return join(cwd, ".mcp.json");
152
152
  }
153
153
 
154
154
  /**
155
155
  * Resolve Codex config path.
156
156
  */
157
157
  function resolveCodexPath(scope: McpScope, home: string, cwd: string): string {
158
- if (scope === 'user') {
159
- return join(home, '.codex.json');
158
+ if (scope === "user") {
159
+ return join(home, ".codex.json");
160
160
  }
161
- return join(cwd, '.codex/.mcp.json');
161
+ return join(cwd, ".codex/.mcp.json");
162
162
  }
163
163
 
164
164
  /**
165
165
  * Resolve Cursor config path.
166
166
  */
167
167
  function resolveCursorPath(scope: McpScope, home: string, cwd: string): string {
168
- if (scope === 'user') {
168
+ if (scope === "user") {
169
169
  const plat = platform();
170
- if (plat === 'win32') {
171
- return join(home, '.cursor', 'mcp.json');
170
+ if (plat === "win32") {
171
+ return join(home, ".cursor", "mcp.json");
172
172
  }
173
- return join(home, '.cursor/mcp.json');
173
+ return join(home, ".cursor/mcp.json");
174
174
  }
175
- return join(cwd, '.cursor/mcp.json');
175
+ return join(cwd, ".cursor/mcp.json");
176
176
  }
177
177
 
178
178
  /**
@@ -180,16 +180,16 @@ function resolveCursorPath(scope: McpScope, home: string, cwd: string): string {
180
180
  */
181
181
  function resolveZedPath(home: string): string {
182
182
  const plat = platform();
183
- if (plat === 'win32') {
183
+ if (plat === "win32") {
184
184
  // Zed not available on Windows, but provide path anyway
185
- return join(home, '.config/zed/settings.json');
185
+ return join(home, ".config/zed/settings.json");
186
186
  }
187
187
  // macOS and Linux use XDG or fallback
188
188
  const xdgConfig = process.env.XDG_CONFIG_HOME;
189
189
  if (xdgConfig) {
190
- return join(xdgConfig, 'zed/settings.json');
190
+ return join(xdgConfig, "zed/settings.json");
191
191
  }
192
- return join(home, '.config/zed/settings.json');
192
+ return join(home, ".config/zed/settings.json");
193
193
  }
194
194
 
195
195
  /**
@@ -197,10 +197,10 @@ function resolveZedPath(home: string): string {
197
197
  */
198
198
  function resolveWindsurfPath(home: string): string {
199
199
  const plat = platform();
200
- if (plat === 'win32') {
201
- return join(home, '.codeium', 'windsurf', 'mcp_config.json');
200
+ if (plat === "win32") {
201
+ return join(home, ".codeium", "windsurf", "mcp_config.json");
202
202
  }
203
- return join(home, '.codeium/windsurf/mcp_config.json');
203
+ return join(home, ".codeium/windsurf/mcp_config.json");
204
204
  }
205
205
 
206
206
  /**
@@ -211,15 +211,15 @@ function resolveOpenCodePath(
211
211
  home: string,
212
212
  cwd: string
213
213
  ): string {
214
- if (scope === 'user') {
214
+ if (scope === "user") {
215
215
  const plat = platform();
216
- if (plat === 'win32') {
217
- return join(home, '.config', 'opencode', 'config.json');
216
+ if (plat === "win32") {
217
+ return join(home, ".config", "opencode", "config.json");
218
218
  }
219
- return join(home, '.config/opencode/config.json');
219
+ return join(home, ".config/opencode/config.json");
220
220
  }
221
221
  // Project scope: opencode.json in project root
222
- return join(cwd, 'opencode.json');
222
+ return join(cwd, "opencode.json");
223
223
  }
224
224
 
225
225
  /**
@@ -227,10 +227,10 @@ function resolveOpenCodePath(
227
227
  */
228
228
  function resolveAmpPath(home: string): string {
229
229
  const plat = platform();
230
- if (plat === 'win32') {
231
- return join(home, '.config', 'amp', 'settings.json');
230
+ if (plat === "win32") {
231
+ return join(home, ".config", "amp", "settings.json");
232
232
  }
233
- return join(home, '.config/amp/settings.json');
233
+ return join(home, ".config/amp/settings.json");
234
234
  }
235
235
 
236
236
  /**
@@ -238,10 +238,10 @@ function resolveAmpPath(home: string): string {
238
238
  */
239
239
  function resolveLmStudioPath(home: string): string {
240
240
  const plat = platform();
241
- if (plat === 'win32') {
242
- return join(home, '.lmstudio', 'mcp.json');
241
+ if (plat === "win32") {
242
+ return join(home, ".lmstudio", "mcp.json");
243
243
  }
244
- return join(home, '.lmstudio/mcp.json');
244
+ return join(home, ".lmstudio/mcp.json");
245
245
  }
246
246
 
247
247
  /**
@@ -249,7 +249,7 @@ function resolveLmStudioPath(home: string): string {
249
249
  * LibreChat uses librechat.yaml in project root (project scope only).
250
250
  */
251
251
  function resolveLibreChatPath(cwd: string): string {
252
- return join(cwd, 'librechat.yaml');
252
+ return join(cwd, "librechat.yaml");
253
253
  }
254
254
 
255
255
  /**
@@ -258,7 +258,7 @@ function resolveLibreChatPath(cwd: string): string {
258
258
  export function resolveMcpConfigPath(opts: McpPathOptions): McpConfigPaths {
259
259
  const {
260
260
  target,
261
- scope = 'user',
261
+ scope = "user",
262
262
  cwd = process.cwd(),
263
263
  homeDir = homedir(),
264
264
  } = opts;
@@ -267,61 +267,61 @@ export function resolveMcpConfigPath(opts: McpPathOptions): McpConfigPaths {
267
267
  const supportsProjectScope = TARGETS_WITH_PROJECT_SCOPE.includes(target);
268
268
 
269
269
  switch (target) {
270
- case 'claude-desktop':
270
+ case "claude-desktop":
271
271
  return {
272
272
  configPath: resolveClaudeDesktopPath(homeDir),
273
273
  supportsProjectScope,
274
274
  configFormat,
275
275
  };
276
- case 'claude-code':
276
+ case "claude-code":
277
277
  return {
278
278
  configPath: resolveClaudeCodePath(scope, homeDir, cwd),
279
279
  supportsProjectScope,
280
280
  configFormat,
281
281
  };
282
- case 'codex':
282
+ case "codex":
283
283
  return {
284
284
  configPath: resolveCodexPath(scope, homeDir, cwd),
285
285
  supportsProjectScope,
286
286
  configFormat,
287
287
  };
288
- case 'cursor':
288
+ case "cursor":
289
289
  return {
290
290
  configPath: resolveCursorPath(scope, homeDir, cwd),
291
291
  supportsProjectScope,
292
292
  configFormat,
293
293
  };
294
- case 'zed':
294
+ case "zed":
295
295
  return {
296
296
  configPath: resolveZedPath(homeDir),
297
297
  supportsProjectScope,
298
298
  configFormat,
299
299
  };
300
- case 'windsurf':
300
+ case "windsurf":
301
301
  return {
302
302
  configPath: resolveWindsurfPath(homeDir),
303
303
  supportsProjectScope,
304
304
  configFormat,
305
305
  };
306
- case 'opencode':
306
+ case "opencode":
307
307
  return {
308
308
  configPath: resolveOpenCodePath(scope, homeDir, cwd),
309
309
  supportsProjectScope,
310
310
  configFormat,
311
311
  };
312
- case 'amp':
312
+ case "amp":
313
313
  return {
314
314
  configPath: resolveAmpPath(homeDir),
315
315
  supportsProjectScope,
316
316
  configFormat,
317
317
  };
318
- case 'lmstudio':
318
+ case "lmstudio":
319
319
  return {
320
320
  configPath: resolveLmStudioPath(homeDir),
321
321
  supportsProjectScope,
322
322
  configFormat,
323
323
  };
324
- case 'librechat':
324
+ case "librechat":
325
325
  return {
326
326
  configPath: resolveLibreChatPath(cwd),
327
327
  supportsProjectScope,
@@ -329,7 +329,7 @@ export function resolveMcpConfigPath(opts: McpPathOptions): McpConfigPaths {
329
329
  };
330
330
  default: {
331
331
  const _exhaustive: never = target;
332
- throw new Error(`Unknown target: ${_exhaustive}`);
332
+ throw new Error(`Unknown target: ${String(_exhaustive)}`);
333
333
  }
334
334
  }
335
335
  }
@@ -338,11 +338,11 @@ export function resolveMcpConfigPath(opts: McpPathOptions): McpConfigPaths {
338
338
  * Resolve paths for all targets.
339
339
  */
340
340
  export function resolveAllMcpPaths(
341
- scope: McpScope | 'all' = 'all',
342
- target: McpTarget | 'all' = 'all',
341
+ scope: McpScope | "all" = "all",
342
+ target: McpTarget | "all" = "all",
343
343
  overrides?: { cwd?: string; homeDir?: string }
344
344
  ): Array<{ target: McpTarget; scope: McpScope; paths: McpConfigPaths }> {
345
- const targets: McpTarget[] = target === 'all' ? MCP_TARGETS : [target];
345
+ const targets: McpTarget[] = target === "all" ? MCP_TARGETS : [target];
346
346
  const results: Array<{
347
347
  target: McpTarget;
348
348
  scope: McpScope;
@@ -355,7 +355,7 @@ export function resolveAllMcpPaths(
355
355
  if (supportsProject) {
356
356
  // Targets that support both scopes
357
357
  const scopes: McpScope[] =
358
- scope === 'all' ? ['user', 'project'] : [scope];
358
+ scope === "all" ? ["user", "project"] : [scope];
359
359
  for (const s of scopes) {
360
360
  results.push({
361
361
  target: t,
@@ -365,13 +365,13 @@ export function resolveAllMcpPaths(
365
365
  }
366
366
  } else {
367
367
  // User scope only - skip if filtering by project
368
- if (scope === 'project') {
368
+ if (scope === "project") {
369
369
  continue;
370
370
  }
371
371
  results.push({
372
372
  target: t,
373
- scope: 'user',
374
- paths: resolveMcpConfigPath({ target: t, scope: 'user', ...overrides }),
373
+ scope: "user",
374
+ paths: resolveMcpConfigPath({ target: t, scope: "user", ...overrides }),
375
375
  });
376
376
  }
377
377
  }
@@ -401,40 +401,40 @@ export function findBunPath(): string {
401
401
  export function buildMcpServerEntry(): McpServerEntry {
402
402
  const bunPath = findBunPath();
403
403
  const home = homedir();
404
- const isWindows = platform() === 'win32';
404
+ const isWindows = platform() === "win32";
405
405
 
406
406
  // 1. Check if running from source (dev mode)
407
407
  const scriptPath = process.argv[1];
408
408
  if (
409
- scriptPath?.includes('/gno/src/cli/') ||
410
- scriptPath?.includes('\\gno\\src\\cli\\')
409
+ scriptPath?.includes("/gno/src/cli/") ||
410
+ scriptPath?.includes("\\gno\\src\\cli\\")
411
411
  ) {
412
412
  // Dev mode: run the entry script directly with bun
413
- const entryScript = scriptPath.replace(COMMANDS_PATH_PATTERN, '/index.ts');
414
- return { command: bunPath, args: ['run', entryScript, 'mcp'] };
413
+ const entryScript = scriptPath.replace(COMMANDS_PATH_PATTERN, "/index.ts");
414
+ return { command: bunPath, args: ["run", entryScript, "mcp"] };
415
415
  }
416
416
 
417
417
  // 2. Check common gno install locations (cross-platform)
418
418
  const gnoCandidates = isWindows
419
419
  ? [
420
- join(home, '.bun\\bin\\gno.exe'),
421
- join(home, 'AppData\\Roaming\\npm\\gno.cmd'),
420
+ join(home, ".bun\\bin\\gno.exe"),
421
+ join(home, "AppData\\Roaming\\npm\\gno.cmd"),
422
422
  ]
423
423
  : [
424
- join(home, '.bun/bin/gno'),
425
- '/usr/local/bin/gno',
426
- '/opt/homebrew/bin/gno',
424
+ join(home, ".bun/bin/gno"),
425
+ "/usr/local/bin/gno",
426
+ "/opt/homebrew/bin/gno",
427
427
  ];
428
428
 
429
429
  for (const gnoPath of gnoCandidates) {
430
430
  if (existsSync(gnoPath)) {
431
- return { command: bunPath, args: [gnoPath, 'mcp'] };
431
+ return { command: bunPath, args: [gnoPath, "mcp"] };
432
432
  }
433
433
  }
434
434
 
435
435
  // 3. Fallback to bunx (works if gno is published to npm)
436
436
  // Note: This may trigger network access on first run
437
- return { command: bunPath, args: ['x', '@gmickel/gno', 'mcp'] };
437
+ return { command: bunPath, args: ["x", "@gmickel/gno", "mcp"] };
438
438
  }
439
439
 
440
440
  /**
@@ -442,29 +442,29 @@ export function buildMcpServerEntry(): McpServerEntry {
442
442
  */
443
443
  export function getTargetDisplayName(target: McpTarget): string {
444
444
  switch (target) {
445
- case 'claude-desktop':
446
- return 'Claude Desktop';
447
- case 'claude-code':
448
- return 'Claude Code';
449
- case 'codex':
450
- return 'Codex';
451
- case 'cursor':
452
- return 'Cursor';
453
- case 'zed':
454
- return 'Zed';
455
- case 'windsurf':
456
- return 'Windsurf';
457
- case 'opencode':
458
- return 'OpenCode';
459
- case 'amp':
460
- return 'Amp';
461
- case 'lmstudio':
462
- return 'LM Studio';
463
- case 'librechat':
464
- return 'LibreChat';
445
+ case "claude-desktop":
446
+ return "Claude Desktop";
447
+ case "claude-code":
448
+ return "Claude Code";
449
+ case "codex":
450
+ return "Codex";
451
+ case "cursor":
452
+ return "Cursor";
453
+ case "zed":
454
+ return "Zed";
455
+ case "windsurf":
456
+ return "Windsurf";
457
+ case "opencode":
458
+ return "OpenCode";
459
+ case "amp":
460
+ return "Amp";
461
+ case "lmstudio":
462
+ return "LM Studio";
463
+ case "librechat":
464
+ return "LibreChat";
465
465
  default: {
466
466
  const _exhaustive: never = target;
467
- throw new Error(`Unknown target: ${_exhaustive}`);
467
+ throw new Error(`Unknown target: ${String(_exhaustive)}`);
468
468
  }
469
469
  }
470
470
  }