cwtools-mcp 0.2.2 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -95,9 +95,8 @@ intentionally does not silently fall back to a separate language server.
95
95
 
96
96
  ### Optional Standalone Mode
97
97
 
98
- Use standalone mode only when you explicitly want the legacy behavior: the MCP
99
- process starts its own CWTools language server and builds its own diagnostic
100
- state.
98
+ Use standalone mode only when you explicitly want the MCP process to start its
99
+ own CWTools language server and build an independent diagnostic state.
101
100
 
102
101
  ```sh
103
102
  cwtools-mcp --standalone --workspace /path/to/mod --game stellaris --stdio
package/dist/config.js CHANGED
@@ -189,7 +189,7 @@ function helpText() {
189
189
  ' or --workspace when supplied) must match the bridge workspace exactly. If the',
190
190
  ' compatible host is closed or the workspace does not match, tool calls return an',
191
191
  ' actionable unavailable error.',
192
- ' Use --standalone only when you intentionally want the legacy self-hosted LSP mode.',
192
+ ' Use --standalone only when you intentionally want the standalone self-hosted LSP mode.',
193
193
  '',
194
194
  'Vanilla data (needed for vanilla IDs and correct mod-vs-vanilla diagnostics):',
195
195
  ' (auto) If neither flag is given, the VS Code cwtools extension cache',
@@ -212,7 +212,7 @@ class LspProcessHost {
212
212
  return;
213
213
  const watcher = (0, chokidar_1.watch)(this.options.workspaceRoot, {
214
214
  ignoreInitial: true,
215
- ignored: [/(^|[\\/])(?:node_modules|\.git|\.cwtools|\.cwtools-ai)(?:[\\/]|$)/],
215
+ ignored: [/(^|[\\/])(?:node_modules|\.(?!\.)[^\\/]+)(?:[\\/]|$)/],
216
216
  awaitWriteFinish: { stabilityThreshold: 120, pollInterval: 30 },
217
217
  });
218
218
  watcher.on('add', filePath => this.queueWatchedFileChange(filePath, 1));
@@ -401,9 +401,7 @@ function isLspWatchedFile(workspaceRoot, filePath, game) {
401
401
  return false;
402
402
  const segments = relative.split(/[\\/]+/).map(segment => segment.toLowerCase());
403
403
  if (segments.some(segment => segment === 'node_modules'
404
- || segment === '.git'
405
- || segment === '.cwtools'
406
- || segment === '.cwtools-ai'))
404
+ || (segment.startsWith('.') && !segment.startsWith('..'))))
407
405
  return false;
408
406
  const extension = path.extname(filePath).toLowerCase();
409
407
  if (extension === '.csv' && game && game.toLowerCase() !== 'ck2')
@@ -439,7 +439,7 @@ async function walk(root, visit) {
439
439
  return;
440
440
  const entries = await fs.readdir(root, { withFileTypes: true }).catch(() => []);
441
441
  for (const entry of entries) {
442
- if (entry.name.startsWith('.') && entry.name !== '.cwtools' && entry.name !== '.cwtools-ai')
442
+ if (entry.name.startsWith('.') && entry.name !== '.cwtools')
443
443
  continue;
444
444
  if (entry.name === 'node_modules' || entry.name === 'dist' || entry.name === 'coverage')
445
445
  continue;
@@ -39,7 +39,7 @@ const path = __importStar(require("path"));
39
39
  // Strong, unambiguous "this directory is a mod root" signals.
40
40
  const ROOT_FILE_MARKERS = ['descriptor.mod'];
41
41
  const ROOT_NESTED_FILE_MARKERS = [path.join('.metadata', 'metadata.json')];
42
- const ROOT_DIR_MARKERS = ['.cwtools', '.cwtools-ai'];
42
+ const ROOT_DIR_MARKERS = ['.cwtools'];
43
43
  // PDX content dirs — specific enough at a mod root, but too generic to trust in a
44
44
  // far-off ancestor. Generic graphics dirs (gfx/, interface/) are excluded.
45
45
  const CONTENT_DIR_MARKERS = ['common', 'events', 'localisation', 'localization'];
@@ -106,7 +106,6 @@ function parseJsonc(text) {
106
106
  }
107
107
  const cache = new Map();
108
108
  const SETTINGS_NAMESPACE = 'stellarisLanguageServices';
109
- const LEGACY_SETTINGS_NAMESPACE = 'cwtools';
110
109
  function readSettingsObject(workspaceRoot) {
111
110
  const file = path.join(workspaceRoot, '.vscode', 'settings.json');
112
111
  let mtimeMs;
@@ -152,10 +151,7 @@ function getExtensionSetting(workspaceRoot, subKey) {
152
151
  const settings = readSettingsObject(workspaceRoot);
153
152
  if (!settings)
154
153
  return undefined;
155
- const current = resolveDotted(settings, `${SETTINGS_NAMESPACE}.${subKey}`);
156
- return current !== undefined
157
- ? current
158
- : resolveDotted(settings, `${LEGACY_SETTINGS_NAMESPACE}.${subKey}`);
154
+ return resolveDotted(settings, `${SETTINGS_NAMESPACE}.${subKey}`);
159
155
  }
160
156
  function asNonEmptyStringArray(value) {
161
157
  return Array.isArray(value)
@@ -39,7 +39,7 @@ const path = __importStar(require("path"));
39
39
  const lspProcessHost_1 = require("./lspProcessHost");
40
40
  // File extensions the language server validates — only these are worth revalidating.
41
41
  const REVALIDATE_EXTS = new Set(['.txt', '.yml', '.gui', '.gfx', '.asset', '.shader', '.fxh']);
42
- const SKIP_DIRS = new Set(['node_modules', 'dist', 'coverage', '.git', '.cwtools', '.cwtools-ai', '.vscode']);
42
+ const SKIP_DIRS = new Set(['node_modules', 'dist', 'coverage']);
43
43
  const MAX_WALK_FILES = 20000;
44
44
  const MAX_BATCH = 200;
45
45
  function numberOr(value, fallback) {
@@ -59,7 +59,7 @@ function createBridgeProxyMcpServer(config) {
59
59
  'CWTools MCP is served by the active VS Code-compatible extension host.',
60
60
  'This proxy does not start its own CWTools language server. If calls report',
61
61
  'bridge_unavailable, open the project in the compatible host where the extension',
62
- 'is installed and active, or rerun with --standalone to use the legacy isolated mode.',
62
+ 'is installed and active, or rerun with --standalone to use the standalone LSP host.',
63
63
  ].join('\n'),
64
64
  });
65
65
  server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => {
@@ -158,7 +158,7 @@ async function readBridgeManifest(config, server) {
158
158
  }
159
159
  if (parsed.kind !== 'cwtools-mcp-extension-bridge' || parsed.protocolVersion !== BRIDGE_PROTOCOL_VERSION) {
160
160
  throw new Error(`CWTools MCP bridge manifest at ${manifestPath} is not compatible with this proxy. ` +
161
- `Open the project in the updated extension host, or pass --standalone for legacy isolated mode.`);
161
+ `Open the project in the updated extension host, or pass --standalone to use the standalone LSP host.`);
162
162
  }
163
163
  if (!parsed.rpcUrl || !parsed.token) {
164
164
  throw new Error(`CWTools MCP bridge manifest at ${manifestPath} is missing rpcUrl/token.`);
package/dist/server.js CHANGED
@@ -26,7 +26,7 @@ const SERVER_INSTRUCTIONS = [
26
26
  '- Before declaring code correct, review get_diagnostics (whole project). Honor the',
27
27
  ' readiness/freshness fields: if readiness.ready is false the project is still loading —',
28
28
  ' retry; an empty result then is not authoritative.',
29
- '- Navigate with query_definition / query_definition_by_name / query_references /',
29
+ '- Navigate with go_to_definition / find_references /',
30
30
  ' document_symbols / workspace_symbols; read structured blocks with get_pdx_block',
31
31
  ' instead of reading whole files. get_entity_info gives a file\'s referenced types/vars.',
32
32
  '- Results carry vanillaCache metadata: if available is false, vanilla IDs are missing',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cwtools-mcp",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "Read-only MCP server exposing CWTools Paradox/Stellaris semantic tools to external agents",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -37,7 +37,7 @@
37
37
  "dependencies": {
38
38
  "@modelcontextprotocol/sdk": "^1.29.0",
39
39
  "chokidar": "^4.0.3",
40
- "cwtools-shared": "0.2.2",
40
+ "cwtools-shared": "0.2.4",
41
41
  "vscode-jsonrpc": "^8.2.0"
42
42
  },
43
43
  "devDependencies": {