clast-ai 0.2.1 → 0.2.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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clast",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Code index for coding agents: symbol search, exact symbol source, type-aware call graph, references, type hierarchy, change impact, dead code and exact counts for any repository. TypeScript, JavaScript, Python, Java, C#, Go, Rust, C, C++, Ruby, PHP, Swift and Dart.",
5
5
  "author": {
6
6
  "name": "Thomas"
package/README.md CHANGED
@@ -52,22 +52,47 @@ and four slash commands:
52
52
  | `/clast:status` | State of the index |
53
53
 
54
54
  The plugin starts the server from a global `clast-ai` that is at least as new as the plugin, otherwise
55
- through `npx clast-ai@<plugin version>` (downloaded on first use). Update with
56
- `/plugin marketplace update clast` and `/plugin update clast@clast`.
55
+ through `npx clast-ai@<plugin version>` (downloaded on first use).
57
56
 
58
- **Coming from an older install?** Nothing to do. The first session after installing or updating the
59
- plugin removes what earlier installs left behind: clast registrations made with `claude mcp add` (for
60
- all projects or for single ones) and by the old VS Code extension, which would otherwise list every
61
- tool twice, and the v0.1 index file `.clast/clast.db`. It runs once per plugin version, in the
62
- background, and writes what it did to `migrate.log` in the plugin's data folder. A `.mcp.json` that
63
- is shared with a team is never changed. To see or do the same by hand:
57
+ ### Upgrading from an older install
58
+
59
+ If clast is already set up the old way (`npm install -g clast-ai` plus `claude mcp add`, or through
60
+ the old VS Code extension), install the plugin and restart. That is all, provided Node.js is 22.22 or
61
+ newer (0.1 ran on Node 18; check with `node --version`):
62
+
63
+ ```
64
+ /plugin marketplace add xls/clast
65
+ /plugin install clast@clast
66
+ ```
67
+
68
+ The first session after that cleans up in the background, once per plugin version:
69
+
70
+ - clast servers registered with `claude mcp add`, for all projects or for single ones, are removed
71
+ (the plugin provides the server; with both, every tool would be listed twice),
72
+ - entries the old VS Code extension wrote into `.claude/settings.local.json` are removed,
73
+ - the v0.1 index file `.clast/clast.db` is deleted (the new index is rebuilt by itself).
74
+
75
+ Restart Claude Code once more and `/mcp` shows a single `clast` server.
76
+
77
+ One case is left to you: a project whose `.mcp.json` lists clast. That file is shared with a team, so
78
+ it is never changed, and in that project the server stays listed twice until the entry is removed
79
+ from the file (`clast-ai migrate` names the file).
80
+
81
+ Optional: `npm uninstall -g clast-ai` removes the old global package. The plugin does not need it; it
82
+ only uses a global install that is at least as new as the plugin itself.
83
+
84
+ To see what would be removed, or to do it by hand (for example when you keep using the plain MCP
85
+ server and only want the old index gone):
64
86
 
65
87
  ```bash
66
88
  clast-ai migrate # report only
67
89
  clast-ai migrate --apply # remove the leftovers
68
90
  ```
69
91
 
70
- Set `CLAST_NO_MIGRATE=1` to switch the automatic run off.
92
+ What was removed is logged to `migrate.log` in the plugin's data folder. `CLAST_NO_MIGRATE=1` switches
93
+ the automatic clean-up off.
94
+
95
+ Later plugin updates: `/plugin marketplace update clast`, then `/plugin update clast@clast`.
71
96
 
72
97
  ### As a plain MCP server
73
98
 
@@ -414,6 +439,13 @@ Known limitations).
414
439
 
415
440
  ## Changelog
416
441
 
442
+ ### 0.2.2
443
+
444
+ - The clean-up of older installs also finds servers registered as `node .../dist/server/index.js` (how
445
+ the 0.1 README registered a build from source) and reads the configuration from `CLAUDE_CONFIG_DIR`
446
+ when that is set. Both were found by installing the plugin into an empty configuration next to an
447
+ old-style registration.
448
+
417
449
  ### 0.2.1
418
450
 
419
451
  - `clast-ai migrate`: finds and removes what older installs left behind (duplicate MCP registrations
@@ -474,7 +506,7 @@ Other:
474
506
 
475
507
  - Swift and Dart added (14 languages).
476
508
  - All dependencies updated (MCP SDK 1.32, web-tree-sitter 0.27).
477
- - 290 tests, plus `bench/bench.mjs`, `bench/resolution.mjs` and the A/B harness `bench/ab.mjs`.
509
+ - 291 tests, plus `bench/bench.mjs`, `bench/resolution.mjs` and the A/B harness `bench/ab.mjs`.
478
510
  - Installable as a Claude Code plugin from this repository (`/plugin marketplace add xls/clast`,
479
511
  `/plugin install clast@clast`): the MCP server, a usage skill, and the slash commands
480
512
  `/clast:deadcode`, `/clast:impact`, `/clast:audit` and `/clast:status`. The old VS Code extension
@@ -490,10 +522,12 @@ Other:
490
522
 
491
523
  ### Upgrading from 0.1
492
524
 
525
+ How to upgrade: see [Upgrading from an older install](#upgrading-from-an-older-install). What changed:
526
+
493
527
  - Node.js 22.22+ is required (was 18).
494
528
  - The index moved from `.clast/clast.db` (sql.js) to `.clast/index.db` (`node:sqlite`). Nothing is
495
- migrated: the index is a cache and is rebuilt on first start. The old file is ignored and can be
496
- deleted.
529
+ migrated: the index is a cache and is rebuilt on first start. The old file is ignored; the plugin
530
+ (or `clast-ai migrate --apply`) deletes it.
497
531
  - A later schema change deletes and rebuilds the index automatically (the schema is at version 26).
498
532
  - Tool output is compact text instead of JSON.
499
533
  - `clast_call_graph` defaults to depth 1 and gained `within` and `includeTests`.
package/dist/migrate.d.ts CHANGED
@@ -28,7 +28,6 @@ export type Action = {
28
28
  file: string;
29
29
  name: string;
30
30
  };
31
- /** Is the clast plugin installed for this user? */
32
31
  export declare function pluginInstalled(home: string): boolean;
33
32
  /** Everything an older install left behind, without changing anything. */
34
33
  export declare function planMigration(home: string, cwd: string): Action[];
package/dist/migrate.js CHANGED
@@ -11,7 +11,8 @@ function isClast(_name, entry) {
11
11
  const args = Array.isArray(entry.args) ? entry.args.map(String) : [];
12
12
  if (/(^|[\\/])clast-ai(\.cmd|\.exe)?$/i.test(command))
13
13
  return true;
14
- if (args.some(a => /clast[^\\/]*[\\/]dist[\\/]cli\.js$/i.test(a)))
14
+ // dist/cli.js, and dist/server/index.js as the 0.1 README registered a build from source.
15
+ if (args.some(a => /clast[^\\/]*[\\/]dist[\\/](cli|server[\\/]index)\.js$/i.test(a)))
15
16
  return true;
16
17
  // `npx clast-ai`, `npx -y clast-ai@0.1`
17
18
  if (/(^|[\\/])npx(\.cmd)?$/i.test(command) && args.some(a => /^clast-ai(@|$)/.test(a)))
@@ -30,15 +31,25 @@ function describe(entry) {
30
31
  return [entry.command ?? '', ...(Array.isArray(entry.args) ? entry.args.map(String) : [])].join(' ').trim();
31
32
  }
32
33
  /** Is the clast plugin installed for this user? */
34
+ /**
35
+ * Where Claude Code keeps its configuration: `~/.claude.json` and `~/.claude/`, or both inside
36
+ * CLAUDE_CONFIG_DIR when that is set.
37
+ */
38
+ function claudePaths(home) {
39
+ const dir = process.env.CLAUDE_CONFIG_DIR;
40
+ return dir
41
+ ? { config: join(dir, '.claude.json'), plugins: join(dir, 'plugins') }
42
+ : { config: join(home, '.claude.json'), plugins: join(home, '.claude', 'plugins') };
43
+ }
33
44
  export function pluginInstalled(home) {
34
- const installed = readJson(join(home, '.claude', 'plugins', 'installed_plugins.json'));
45
+ const installed = readJson(join(claudePaths(home).plugins, 'installed_plugins.json'));
35
46
  const plugins = (installed?.plugins ?? {});
36
47
  return Object.keys(plugins).some(id => /^clast@/.test(id));
37
48
  }
38
49
  /** Everything an older install left behind, without changing anything. */
39
50
  export function planMigration(home, cwd) {
40
51
  const actions = [];
41
- const config = readJson(join(home, '.claude.json'));
52
+ const config = readJson(claudePaths(home).config);
42
53
  const servers = (config?.mcpServers ?? {});
43
54
  for (const [name, entry] of Object.entries(servers)) {
44
55
  if (isClast(name, entry))
@@ -1 +1 @@
1
- {"version":3,"file":"migrate.js","sourceRoot":"","sources":["../src/migrate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACrG,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAkCvC,oGAAoG;AACpG,SAAS,OAAO,CAAC,KAAa,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CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;oBAChE,MAAM,CAAC,IAAI,CAAC,YAAY,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;gBACrC,CAAC;YACH,CAAC;iBAAM,IAAI,CAAC,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;gBAC9B,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK;oBAAE,MAAM,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;gBACpD,MAAM,CAAC,IAAI,CAAC,YAAY,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;YACrC,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,CAAC,CAAC,KAAK,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;QACjF,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  /** Package version (keep in sync with package.json; checked by a test). */
2
- export declare const VERSION = "0.2.1";
2
+ export declare const VERSION = "0.2.2";
package/dist/version.js CHANGED
@@ -1,3 +1,3 @@
1
1
  /** Package version (keep in sync with package.json; checked by a test). */
2
- export const VERSION = '0.2.1';
2
+ export const VERSION = '0.2.2';
3
3
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clast-ai",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Code index MCP server for LLM coding agents: ranked symbol search, exact symbol source, type-aware call graph, references, type hierarchy and git change impact",
5
5
  "main": "dist/engine.js",
6
6
  "bin": {
package/plugin/server.mjs CHANGED
@@ -12,6 +12,7 @@
12
12
  // all a user has to do.
13
13
  import { spawn, spawnSync } from 'node:child_process';
14
14
  import { existsSync, readFileSync } from 'node:fs';
15
+ import { tmpdir } from 'node:os';
15
16
  import { dirname, join } from 'node:path';
16
17
  import { fileURLToPath } from 'node:url';
17
18
 
@@ -19,6 +20,8 @@ const root = join(dirname(fileURLToPath(import.meta.url)), '..');
19
20
  const version = JSON.parse(readFileSync(join(root, 'package.json'), 'utf8')).version;
20
21
  const [major, minor, patch] = version.split('.').map(Number);
21
22
  const windows = process.platform === 'win32';
23
+ // The project the server indexes: the same order the server itself uses.
24
+ const projectDir = process.env.CLAST_PROJECT_DIR ?? process.env.CLAUDE_PROJECT_DIR ?? process.cwd();
22
25
  const log = msg => process.stderr.write(`[clast plugin] ${msg}\n`);
23
26
 
24
27
  function pick() {
@@ -35,12 +38,15 @@ function pick() {
35
38
  return { command: 'clast-ai', args: [], shell: windows, what: `global clast-ai ${found}` };
36
39
  }
37
40
  if (found) log(`global clast-ai is ${found}, the plugin is ${version}: using npx instead (npm install -g clast-ai updates it)`);
38
- return { command: 'npx', args: ['-y', `clast-ai@${version}`], shell: windows, what: `npx clast-ai@${version}` };
41
+ // npx runs from a neutral directory: inside a folder whose package.json is itself called clast-ai it
42
+ // would take that folder for the package and start whatever `clast-ai` is on PATH.
43
+ return { command: 'npx', args: ['-y', `clast-ai@${version}`], shell: windows, what: `npx clast-ai@${version}`, cwd: tmpdir() };
39
44
  }
40
45
 
41
46
  /** Run the chosen clast-ai with extra arguments. Through a shell (.cmd shims on Windows) the command is one string of fixed words. */
42
47
  function run(choice, extra, options) {
43
48
  const args = [...choice.args, ...extra];
49
+ if (choice.cwd) options = { ...options, cwd: choice.cwd, env: { ...process.env, CLAST_PROJECT_DIR: projectDir } };
44
50
  return choice.shell
45
51
  ? spawn([choice.command, ...args].join(' '), { ...options, shell: true, windowsHide: true })
46
52
  : spawn(choice.command, args, { ...options, windowsHide: true });
package/src/migrate.ts CHANGED
@@ -42,7 +42,8 @@ function isClast(_name: string, entry: ServerEntry | undefined): boolean {
42
42
  const command = String(entry.command ?? '');
43
43
  const args = Array.isArray(entry.args) ? entry.args.map(String) : [];
44
44
  if (/(^|[\\/])clast-ai(\.cmd|\.exe)?$/i.test(command)) return true;
45
- if (args.some(a => /clast[^\\/]*[\\/]dist[\\/]cli\.js$/i.test(a))) return true;
45
+ // dist/cli.js, and dist/server/index.js as the 0.1 README registered a build from source.
46
+ if (args.some(a => /clast[^\\/]*[\\/]dist[\\/](cli|server[\\/]index)\.js$/i.test(a))) return true;
46
47
  // `npx clast-ai`, `npx -y clast-ai@0.1`
47
48
  if (/(^|[\\/])npx(\.cmd)?$/i.test(command) && args.some(a => /^clast-ai(@|$)/.test(a))) return true;
48
49
  return false;
@@ -61,8 +62,19 @@ function describe(entry: ServerEntry): string {
61
62
  }
62
63
 
63
64
  /** Is the clast plugin installed for this user? */
65
+ /**
66
+ * Where Claude Code keeps its configuration: `~/.claude.json` and `~/.claude/`, or both inside
67
+ * CLAUDE_CONFIG_DIR when that is set.
68
+ */
69
+ function claudePaths(home: string): { config: string; plugins: string } {
70
+ const dir = process.env.CLAUDE_CONFIG_DIR;
71
+ return dir
72
+ ? { config: join(dir, '.claude.json'), plugins: join(dir, 'plugins') }
73
+ : { config: join(home, '.claude.json'), plugins: join(home, '.claude', 'plugins') };
74
+ }
75
+
64
76
  export function pluginInstalled(home: string): boolean {
65
- const installed = readJson(join(home, '.claude', 'plugins', 'installed_plugins.json'));
77
+ const installed = readJson(join(claudePaths(home).plugins, 'installed_plugins.json'));
66
78
  const plugins = (installed?.plugins ?? {}) as Record<string, unknown>;
67
79
  return Object.keys(plugins).some(id => /^clast@/.test(id));
68
80
  }
@@ -70,7 +82,7 @@ export function pluginInstalled(home: string): boolean {
70
82
  /** Everything an older install left behind, without changing anything. */
71
83
  export function planMigration(home: string, cwd: string): Action[] {
72
84
  const actions: Action[] = [];
73
- const config = readJson(join(home, '.claude.json'));
85
+ const config = readJson(claudePaths(home).config);
74
86
  const servers = (config?.mcpServers ?? {}) as Record<string, ServerEntry>;
75
87
  for (const [name, entry] of Object.entries(servers)) {
76
88
  if (isClast(name, entry)) actions.push({ kind: 'mcp', scope: 'user', name, dir: cwd, command: describe(entry) });
package/src/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  /** Package version (keep in sync with package.json; checked by a test). */
2
- export const VERSION = '0.2.1';
2
+ export const VERSION = '0.2.2';