mantisai-cli 2.0.2 → 3.0.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.
Files changed (72) hide show
  1. package/README.md +27 -99
  2. package/bin/mantis.js +406 -24
  3. package/lib/constants.js +13 -0
  4. package/lib/container.js +66 -0
  5. package/lib/impl/claude-skills-service.js +13 -0
  6. package/lib/impl/codex-skills-service.js +19 -0
  7. package/lib/impl/fast-glob-codebase-indexer.js +114 -0
  8. package/lib/impl/file-config-store.js +38 -0
  9. package/lib/impl/fs-csv-reader.js +12 -0
  10. package/lib/impl/http-mantis-client.js +108 -0
  11. package/lib/impl/inquirer-ui-service.js +73 -0
  12. package/lib/impl/mcp-client-service.js +64 -0
  13. package/lib/impl/opencode-skills-service.js +17 -0
  14. package/lib/impl/space-repository.js +72 -0
  15. package/lib/interfaces/codebase-indexer.js +5 -0
  16. package/lib/interfaces/config-store.js +11 -0
  17. package/lib/interfaces/csv-reader.js +5 -0
  18. package/lib/interfaces/index.js +7 -0
  19. package/lib/interfaces/mantis-client.js +13 -0
  20. package/lib/interfaces/mcp-client.js +6 -0
  21. package/lib/interfaces/space-repository.js +13 -0
  22. package/lib/interfaces/ui.js +13 -0
  23. package/lib/services/context-service.js +22 -0
  24. package/lib/services/map-service.js +114 -0
  25. package/lib/services/query-service.js +50 -0
  26. package/lib/services/selection-service.js +174 -0
  27. package/lib/services/setup-service.js +98 -0
  28. package/lib/services/tool-service.js +26 -0
  29. package/lib/types.js +30 -0
  30. package/lib/utils/cli-args.js +29 -0
  31. package/lib/utils/package-root.js +7 -0
  32. package/lib/utils/skills-sync.js +46 -0
  33. package/lib/{space-id.js → utils/space-id.js} +0 -1
  34. package/lib/utils/threads.js +12 -0
  35. package/lib/utils/tool-args.js +38 -0
  36. package/lib/utils/url.js +33 -0
  37. package/package.json +4 -7
  38. package/skills/codebase/SKILL.md +8 -6
  39. package/skills/connect/SKILL.md +10 -26
  40. package/skills/createmap/SKILL.md +5 -3
  41. package/skills/mantis/SKILL.md +49 -32
  42. package/skills/select/SKILL.md +12 -9
  43. package/skills/space/SKILL.md +10 -47
  44. package/skills/status/SKILL.md +4 -9
  45. package/skills/thread/SKILL.md +15 -27
  46. package/.claude-plugin/marketplace.json +0 -14
  47. package/.claude-plugin/plugin.json +0 -18
  48. package/.mcp.json +0 -11
  49. package/bin/mantis-list-spaces.js +0 -32
  50. package/bin/mantis-list-threads.js +0 -32
  51. package/bin/mantis-mcp-headers.js +0 -9
  52. package/bin/mantis-pick-space.js +0 -5
  53. package/bin/mantis-pick-thread.js +0 -5
  54. package/bin/mantis-resolve-space.js +0 -25
  55. package/bin/mantis-select.js +0 -7
  56. package/bin/mantis-set-space.js +0 -31
  57. package/bin/mantis-set-thread.js +0 -34
  58. package/bin/mantis-setup.js +0 -59
  59. package/bin/mantis-status.js +0 -15
  60. package/lib/api.js +0 -100
  61. package/lib/claude-plugin.js +0 -150
  62. package/lib/codebase-csv.js +0 -144
  63. package/lib/config.js +0 -65
  64. package/lib/csv.js +0 -10
  65. package/lib/fetch.js +0 -36
  66. package/lib/list-cli.js +0 -55
  67. package/lib/map-create.js +0 -148
  68. package/lib/mcp-config.js +0 -50
  69. package/lib/picker.js +0 -150
  70. package/lib/spaces.js +0 -48
  71. package/lib/ui.js +0 -73
  72. /package/lib/{fields.js → utils/fields.js} +0 -0
package/README.md CHANGED
@@ -1,120 +1,48 @@
1
1
  # mantisai-cli
2
2
 
3
- Mantis developer CLI — manage spaces, create maps from local data, and configure [Claude Code](https://code.claude.com) as a Mantis client. Distributed alongside the **mantis@mantis-plugins** Claude Code plugin.
3
+ Mantis developer CLI — spaces, maps, MCP tools for AI agents, and editor skill sync.
4
4
 
5
- > **Naming note:** the repo is `KellisLab/mantis-cli` but the npm package is published as **`mantisai-cli`** because `mantis-cli` was already taken on npm. The binary you run is just `mantis`.
5
+ > **Naming:** repo [`KellisLab/mantis-cli`](https://github.com/KellisLab/mantis-cli), npm package **`mantisai-cli`**, binary **`mantis`**.
6
+
7
+ Full docs (VitePress):
8
+
9
+ - [Overview](https://mantis.csail.mit.edu/docs/mantis-cli/)
10
+ - [Install](https://mantis.csail.mit.edu/docs/mantis-cli/install)
11
+ - [Claude Code](https://mantis.csail.mit.edu/docs/mantis-cli/claude-code)
12
+ - [OpenCode](https://mantis.csail.mit.edu/docs/mantis-cli/opencode)
13
+ - [Codex](https://mantis.csail.mit.edu/docs/mantis-cli/codex)
14
+
15
+ Source: `Mantis/docs/mantis-cli/`
6
16
 
7
17
  ## Requirements
8
18
 
9
- - [Node.js](https://nodejs.org/) 18+
10
- - A running Mantis API (default `https://kellis-h200-1.csail.mit.edu`; local dev: `http://localhost:8000`)
11
- - A Mantis **Developer API key** (`live_…`) from https://mantis.csail.mit.edu/developer/#keys
12
- - (Optional, for plugin features) [Claude Code](https://code.claude.com) (`claude` on your PATH)
19
+ - Node.js 18+
20
+ - Mantis API + Developer key from https://mantis.csail.mit.edu/developer/#keys
13
21
 
14
22
  ## Install
15
23
 
16
24
  ```bash
17
25
  npm install -g mantisai-cli
18
26
  mantis setup
27
+ mantis setup claude # optional: Claude Code skills
28
+ mantis use get_space_context
19
29
  ```
20
30
 
21
- `mantis setup` walks through API URL, API key, space, and thread selection. If Claude Code is installed, it also registers the **mantis@mantis-plugins** plugin and writes the MCP config.
31
+ Config: `~/.mantis/config.json`
22
32
 
23
33
  ## Commands
24
34
 
25
35
  | Command | Description |
26
- |---------|-------------|
27
- | `mantis setup` | Connect to Mantis, pick space & thread, configure Claude Code |
28
- | `mantis status` | Show current API, space, thread, and MCP URL |
29
- | `mantis select [space\|thread\|both]` | Switch active space and/or thread |
30
- | `mantis create map <file>` | Create a Mantis map from a local CSV/XLSX |
31
- | `mantis create codebase [root]` | Index a local codebase to CSV; optionally create a map |
32
-
33
- Run any command with `--help` for full options.
34
-
35
- ### Examples
36
-
37
- ```bash
38
- # Create a new private space and load a CSV as a map
39
- mantis create map ./data.csv \
40
- --space-mode new --space-name "Sales" --private \
41
- --map-name "Q4 Pipeline" \
42
- --title-column name --semantic-column description --numeric-column revenue
43
-
44
- # Add a map to an existing space
45
- mantis create map ./more-data.csv \
46
- --space-mode existing --space-id <uuid> \
47
- --map-name "Cohort 2"
48
-
49
- # Index your repo into Mantis
50
- mantis create codebase . --create-map --space-mode new --space-name "Repo Index" --private
51
- ```
52
-
53
- ## Claude Code integration
54
-
55
- After `mantis setup`:
56
-
57
- 1. Open Claude Code (restart if it was already running).
58
- 2. `/plugin` → enable **mantis @ mantis-plugins** (user scope) if needed.
59
- 3. `/reload-plugins`
60
- 4. Confirm with `/mantis:status`.
61
-
62
- ### Slash commands
63
-
64
- | Command | Description |
65
- |---------|-------------|
66
- | `/mantis:connect` | Run setup / reconnect |
67
- | `/mantis:space` | Change space (search or paste a `/space/{uuid}` link) |
68
- | `/mantis:thread` | Change thread (space state) |
69
- | `/mantis:status` | Show current space, thread, and MCP URL |
70
- | `/mantis:select` | Quick space/thread selection |
71
-
72
- After changing **thread**, run `/reload-plugins` so MCP picks up the new `X-Space-State-ID` header.
73
-
74
- ### Paste a space link
75
-
76
- In `mantis setup` or `/mantis:space`, paste a URL such as:
77
-
78
- `https://mantis.csail.mit.edu/space/1e1ed055-c869-4b78-b41f-4216a44049d4/`
79
-
80
- Use the same Mantis API base URL as the space you are targeting (local vs production).
81
-
82
- ## Update
83
-
84
- **CLI**:
85
-
86
- ```bash
87
- npm install -g mantisai-cli@latest
88
- ```
89
-
90
- **Plugin (slash commands, MCP, skills)** — in Claude Code:
91
-
92
- ```text
93
- /plugin marketplace update mantis-plugins
94
- ```
95
-
96
- Then update **mantis@mantis-plugins** and `/reload-plugins`.
97
-
98
- ## Manual plugin install
99
-
100
- ```bash
101
- claude plugin marketplace add KellisLab/mantis-cli
102
- claude plugin install mantis@mantis-plugins --scope user
103
- ```
104
-
105
- Enable in `/plugin`, then `/reload-plugins`.
106
-
107
- ## Migrating from `mantis-claude-code`
108
-
109
- If you previously installed the package as `mantis-claude-code`, migrate with:
110
-
111
- ```bash
112
- npm uninstall -g mantis-claude-code
113
- npm install -g mantisai-cli
114
- mantis setup
115
- ```
116
-
117
- Your local config at `~/.mantis/claude-code/config.json` is preserved.
36
+ | --- | --- |
37
+ | `mantis setup [claude\|opencode\|codex]` | API + space/thread, or sync editor skills |
38
+ | `mantis status` | Current config |
39
+ | `mantis select [space\|thread\|both]` | Switch space/thread |
40
+ | `mantis spaces list\|resolve\|set` | Scriptable space ops (JSON) |
41
+ | `mantis threads list\|new\|set` | Scriptable thread ops (JSON) |
42
+ | `mantis tools` | List MCP tools |
43
+ | `mantis use <tool>` | Call an MCP tool (JSON output) |
44
+ | `mantis create map <file>` | Map from CSV/XLSX |
45
+ | `mantis create codebase [root]` | Index repo; optional `--create-map` |
118
46
 
119
47
  ## npm
120
48
 
package/bin/mantis.js CHANGED
@@ -1,114 +1,496 @@
1
1
  #!/usr/bin/env node
2
+
2
3
  import path from 'node:path';
4
+
3
5
  import { Command } from 'commander';
4
6
 
5
- import { createCodebaseCsv } from '../lib/codebase-csv.js';
6
- import { createMapFlow } from '../lib/map-create.js';
7
- import { die, info, success } from '../lib/ui.js';
7
+
8
+
9
+ import { getContainer } from '../lib/container.js';
10
+
11
+ import { parseUseCommand } from '../lib/utils/tool-args.js';
12
+
13
+
14
+
15
+ const c = getContainer();
16
+
17
+ const { map, codebaseIndexer, tools, ui, setup, selection, context, query } = c;
8
18
 
9
19
  const program = new Command();
10
20
 
21
+
22
+
11
23
  function defaultCodebaseOut(root) {
24
+
12
25
  const base = path.basename(path.resolve(root || process.cwd())) || 'codebase';
26
+
13
27
  return path.resolve(process.cwd(), `${base}-codebase.csv`);
28
+
14
29
  }
15
30
 
31
+
32
+
16
33
  function addMapOptions(cmd) {
34
+
17
35
  return cmd
36
+
18
37
  .option('--space-mode <mode>', 'new or existing')
38
+
19
39
  .option('--space-id <uuid>', 'existing Mantis space id')
40
+
20
41
  .option('--space-name <name>', 'new space name or display name for existing space')
42
+
21
43
  .option('--space-search <query>', 'search text for choosing an existing space')
44
+
22
45
  .option('--public', 'make a new space public')
46
+
23
47
  .option('--private', 'make a new space private')
48
+
24
49
  .option('--map-name <name>', 'map name')
50
+
25
51
  .option('--title-column <columns>', 'comma-separated title column names')
52
+
26
53
  .option('--semantic-column <columns>', 'comma-separated semantic column names')
54
+
27
55
  .option('--numeric-column <columns>', 'comma-separated numeric column names')
56
+
28
57
  .option('--categoric-column <columns>', 'comma-separated categorical column names')
58
+
29
59
  .option('--date-column <columns>', 'comma-separated date column names')
60
+
30
61
  .option('--links-column <columns>', 'comma-separated link column names')
62
+
31
63
  .option('--delete-column <columns>', 'comma-separated ignored column names')
64
+
32
65
  .option('--data-types <json>', 'raw data_types JSON array')
33
- .option('--activate', 'set created space/thread as active in Claude Code')
34
- .option('--no-activate', 'do not set active Claude Code context')
66
+
67
+ .option('--activate', 'set created space/thread as active context')
68
+
69
+ .option('--no-activate', 'do not update active space/thread')
70
+
35
71
  .option('--thread-name <name>', 'thread name when activating');
72
+
36
73
  }
37
74
 
75
+
76
+
77
+ function addListOptions(cmd) {
78
+
79
+ return cmd
80
+
81
+ .option('--filter <query>', 'search filter')
82
+
83
+ .option('--offset <n>', 'pagination offset', (v) => parseInt(v, 10) || 0)
84
+
85
+ .option('--limit <n>', 'page size', (v) => parseInt(v, 10) || 4);
86
+
87
+ }
88
+
89
+
90
+
91
+ async function listTools() {
92
+
93
+ const data = await tools.listTools();
94
+
95
+ console.log(JSON.stringify(data, null, 2));
96
+
97
+ }
98
+
99
+
100
+
38
101
  program
102
+
39
103
  .name('mantis')
40
- .description('Mantis developer CLI — manage spaces, create maps, and configure Claude Code integration')
41
- .version('2.0.1');
104
+
105
+ .description('Mantis CLI — spaces, maps, and MCP tools for AI agents')
106
+
107
+ .version('3.0.1');
108
+
109
+
42
110
 
43
111
  program
44
- .command('setup')
45
- .description('Connect Claude Code to Mantis')
46
- .action(async () => import('./mantis-setup.js'));
112
+
113
+ .command('setup [provider]')
114
+
115
+ .description('Configure Mantis, or install skills for claude/opencode/codex')
116
+
117
+ .option('--project', 'Also sync repo-scoped skills (Codex: ./.agents/skills/)')
118
+
119
+ .action(async (provider, opts) => {
120
+
121
+ try {
122
+
123
+ if (!provider) return setup.run();
124
+
125
+ setup.runProvider(provider, { project: !!opts.project });
126
+
127
+ } catch (e) {
128
+
129
+ ui.die(e.message || String(e));
130
+
131
+ }
132
+
133
+ });
134
+
135
+
47
136
 
48
137
  program
138
+
49
139
  .command('status')
50
- .description('Show current Mantis Claude Code config')
51
- .action(async () => import('./mantis-status.js'));
140
+
141
+ .description('Show current Mantis config')
142
+
143
+ .action(() => {
144
+
145
+ const s = context.status();
146
+
147
+ console.log('Mantis — status\n');
148
+
149
+ console.log(`Config: ${s.configPath}`);
150
+
151
+ console.log(`API: ${s.apiBaseUrl}`);
152
+
153
+ console.log(`MCP: ${s.mcpUrl}`);
154
+
155
+ console.log(`API key: ${s.apiKeyHint}`);
156
+
157
+ console.log(`Space: ${s.spaceName} (${s.spaceId})`);
158
+
159
+ console.log(`Thread: ${s.threadName} (${s.threadId})`);
160
+
161
+ if (!s.hasThread) {
162
+
163
+ console.log('\nNo thread selected. Run: mantis select thread');
164
+
165
+ process.exit(1);
166
+
167
+ }
168
+
169
+ });
170
+
171
+
52
172
 
53
173
  program
174
+
54
175
  .command('select')
55
- .description('Select active Mantis space and thread')
176
+
177
+ .description('Select active space and thread')
178
+
56
179
  .argument('[target]', 'space, thread, or both', 'both')
180
+
57
181
  .action(async (target) => {
58
- if (target === 'space') return import('./mantis-pick-space.js');
59
- if (target === 'thread') return import('./mantis-pick-thread.js');
60
- return import('./mantis-select.js');
182
+
183
+ if (target === 'space') return selection.pickSpace();
184
+
185
+ if (target === 'thread') return selection.pickThread();
186
+
187
+ ui.banner('Mantis — switch space / thread');
188
+
189
+ await selection.pickSpace();
190
+
191
+ await selection.pickThread();
192
+
193
+ });
194
+
195
+
196
+
197
+ const spaces = program.command('spaces').description('List, resolve, or set spaces');
198
+
199
+
200
+
201
+ addListOptions(spaces.command('list').description('List spaces (JSON)')).action(async (opts) => {
202
+
203
+ try {
204
+
205
+ const data = await query.spacesForPrompt(opts.filter || '', { limit: opts.limit, offset: opts.offset });
206
+
207
+ console.log(JSON.stringify(data));
208
+
209
+ } catch (e) {
210
+
211
+ console.error(JSON.stringify({ error: e.message }));
212
+
213
+ process.exit(1);
214
+
215
+ }
216
+
217
+ });
218
+
219
+
220
+
221
+ spaces
222
+
223
+ .command('resolve')
224
+
225
+ .description('Resolve a space link or UUID (JSON)')
226
+
227
+ .argument('<query>', 'space link or UUID')
228
+
229
+ .action(async (queryText) => {
230
+
231
+ try {
232
+
233
+ const data = await selection.resolveSpace(queryText);
234
+
235
+ console.log(JSON.stringify(data));
236
+
237
+ } catch (e) {
238
+
239
+ console.error(JSON.stringify({ error: e.message }));
240
+
241
+ process.exit(1);
242
+
243
+ }
244
+
61
245
  });
62
246
 
247
+
248
+
249
+ spaces
250
+
251
+ .command('set')
252
+
253
+ .description('Set active space by UUID')
254
+
255
+ .argument('<uuid>', 'space UUID')
256
+
257
+ .argument('[name]', 'display name')
258
+
259
+ .action((uuid, name) => console.log(JSON.stringify(selection.setSpace(uuid, name || ''))));
260
+
261
+
262
+
263
+ const threads = program.command('threads').description('List or set threads in the active space');
264
+
265
+
266
+
267
+ addListOptions(threads.command('list').description('List threads (JSON)')).action(async (opts) => {
268
+
269
+ try {
270
+
271
+ const data = await query.threadsForPrompt(opts.filter || '', { limit: opts.limit, offset: opts.offset });
272
+
273
+ console.log(JSON.stringify(data));
274
+
275
+ } catch (e) {
276
+
277
+ console.error(JSON.stringify({ error: e.message }));
278
+
279
+ process.exit(1);
280
+
281
+ }
282
+
283
+ });
284
+
285
+
286
+
287
+ threads
288
+
289
+ .command('new')
290
+
291
+ .description('Create and activate a new thread')
292
+
293
+ .argument('[name]', 'thread name')
294
+
295
+ .action(async (name) => {
296
+
297
+ try {
298
+
299
+ const result = await selection.setThread('--new', name);
300
+
301
+ console.log(JSON.stringify(result));
302
+
303
+ } catch (e) {
304
+
305
+ console.error(e.message || String(e));
306
+
307
+ process.exit(1);
308
+
309
+ }
310
+
311
+ });
312
+
313
+
314
+
315
+ threads
316
+
317
+ .command('set')
318
+
319
+ .description('Set active thread by UUID')
320
+
321
+ .argument('<uuid>', 'thread UUID')
322
+
323
+ .argument('[name]', 'display name')
324
+
325
+ .action(async (uuid, name) => {
326
+
327
+ try {
328
+
329
+ const result = await selection.setThread(uuid, name);
330
+
331
+ console.log(JSON.stringify(result));
332
+
333
+ } catch (e) {
334
+
335
+ console.error(e.message || String(e));
336
+
337
+ process.exit(1);
338
+
339
+ }
340
+
341
+ });
342
+
343
+
344
+
345
+ const toolsCmd = program.command('tools').description('MCP tools available via mantis use');
346
+
347
+ toolsCmd.command('list', { isDefault: true }).description('List tools (JSON)').action(async () => {
348
+
349
+ try {
350
+
351
+ await listTools();
352
+
353
+ } catch (e) {
354
+
355
+ console.error(JSON.stringify({ error: e.message }));
356
+
357
+ process.exit(1);
358
+
359
+ }
360
+
361
+ });
362
+
363
+
364
+
365
+ program
366
+
367
+ .command('use <tool>')
368
+
369
+ .description('Call a Mantis MCP tool (prints JSON)')
370
+
371
+ .allowUnknownOption()
372
+
373
+ .action(async () => {
374
+
375
+ try {
376
+
377
+ const { tool, args } = parseUseCommand(process.argv);
378
+
379
+ const result = await tools.useTool(tool, args);
380
+
381
+ console.log(JSON.stringify(result, null, 2));
382
+
383
+ } catch (e) {
384
+
385
+ ui.die(e.message || String(e));
386
+
387
+ }
388
+
389
+ });
390
+
391
+
392
+
63
393
  const create = program.command('create').description('Create Mantis resources from local inputs');
64
394
 
395
+
396
+
65
397
  addMapOptions(create
398
+
66
399
  .command('map')
400
+
67
401
  .description('Create a Mantis map from a local CSV/XLSX file')
402
+
68
403
  .argument('<file>', 'CSV/XLSX file path'))
404
+
69
405
  .action(async (file, opts) => {
406
+
70
407
  try {
408
+
71
409
  if (opts.private) opts.public = false;
72
- const result = await createMapFlow(path.resolve(file), opts);
410
+
411
+ const result = await map.createMap(path.resolve(file), opts);
412
+
73
413
  console.log(JSON.stringify(result, null, 2));
414
+
74
415
  } catch (e) {
75
- die(e.message || String(e));
416
+
417
+ ui.die(e.message || String(e));
418
+
76
419
  }
420
+
77
421
  });
78
422
 
423
+
424
+
79
425
  addMapOptions(create
426
+
80
427
  .command('codebase')
428
+
81
429
  .description('Index a local codebase into CSV, optionally creating a Mantis map')
430
+
82
431
  .argument('[root]', 'codebase root', '.')
432
+
83
433
  .option('--out <file>', 'output CSV path')
434
+
84
435
  .option('--max-chars <n>', 'max characters stored per file', (v) => Number(v), 12000)
436
+
85
437
  .option('--create-map', 'create a Mantis map after writing the CSV'))
438
+
86
439
  .action(async (root, opts) => {
440
+
87
441
  try {
442
+
88
443
  if (opts.private) opts.public = false;
444
+
89
445
  const out = path.resolve(opts.out || defaultCodebaseOut(root));
90
- const result = await createCodebaseCsv(root, out, { maxChars: opts.maxChars });
91
- success(`Indexed ${result.count} files`);
92
- info(`CSV: ${result.outFile}`);
446
+
447
+ const result = await codebaseIndexer.index(root, out, { maxChars: opts.maxChars });
448
+
449
+ ui.success(`Indexed ${result.count} files`);
450
+
451
+ ui.info(`CSV: ${result.outFile}`);
452
+
93
453
  if (result.skipped?.length) {
94
- info(`Skipped ${result.skipped.length} binary file(s) (e.g. ${result.skipped.slice(0, 3).join(', ')})`);
454
+
455
+ ui.info(`Skipped ${result.skipped.length} binary file(s) (e.g. ${result.skipped.slice(0, 3).join(', ')})`);
456
+
95
457
  }
458
+
96
459
  if (opts.createMap) {
97
- const mapResult = await createMapFlow(result.outFile, {
460
+
461
+ const mapResult = await map.createMap(result.outFile, {
462
+
98
463
  ...opts,
464
+
99
465
  mapName: opts.mapName || `${path.basename(path.resolve(root))} Code Index`,
466
+
100
467
  titleColumn: opts.titleColumn || 'path',
468
+
101
469
  semanticColumn: opts.semanticColumn || 'summary,content,imports',
470
+
102
471
  categoricColumn: opts.categoricColumn || 'language,kind,extension',
472
+
103
473
  numericColumn: opts.numericColumn || 'loc,bytes',
474
+
104
475
  });
476
+
105
477
  console.log(JSON.stringify({ csv: result, map: mapResult }, null, 2));
478
+
106
479
  } else {
480
+
107
481
  console.log(JSON.stringify(result, null, 2));
482
+
108
483
  }
484
+
109
485
  } catch (e) {
110
- die(e.message || String(e));
486
+
487
+ ui.die(e.message || String(e));
488
+
111
489
  }
490
+
112
491
  });
113
492
 
493
+
494
+
114
495
  program.parseAsync(process.argv);
496
+
@@ -0,0 +1,13 @@
1
+ export const DEFAULT_API_BASE = 'https://kellis-h200-1.csail.mit.edu';
2
+ export const DEFAULT_THREAD_NAME = 'Main';
3
+ export const DEVELOPER_PORTAL_URL = 'https://mantis.csail.mit.edu/developer/#keys';
4
+ export const CONFIG_NAME = 'config.json';
5
+ export const BROWSE_PAGE = 20;
6
+ export const API_PAGE = 100;
7
+
8
+ /** MCP tools disabled in CLI — use `mantis create map` / setup instead */
9
+ export const DISABLED_MCP_TOOLS = new Set([
10
+ 'create_space',
11
+ 'create_map_from_url',
12
+ 'modify_map_from_url',
13
+ ]);