mcp-adr-analysis-server 2.6.20 → 2.7.18

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 (35) hide show
  1. package/README.md +12 -0
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/src/index.d.ts.map +1 -1
  4. package/dist/src/index.js +54 -9
  5. package/dist/src/index.js.map +1 -1
  6. package/dist/src/resources/deployment-status-resource.d.ts.map +1 -1
  7. package/dist/src/resources/deployment-status-resource.js +31 -24
  8. package/dist/src/resources/deployment-status-resource.js.map +1 -1
  9. package/dist/src/tools/adr-suggestion-tool.js +2 -1
  10. package/dist/src/tools/adr-suggestion-tool.js.map +1 -1
  11. package/dist/src/tools/ce-mcp-tools.d.ts +14 -1
  12. package/dist/src/tools/ce-mcp-tools.d.ts.map +1 -1
  13. package/dist/src/tools/ce-mcp-tools.js +27 -1
  14. package/dist/src/tools/ce-mcp-tools.js.map +1 -1
  15. package/dist/src/tools/tool-catalog.d.ts +1 -1
  16. package/dist/src/tools/tool-catalog.js +59 -59
  17. package/dist/src/tools/tool-catalog.js.map +1 -1
  18. package/dist/src/tools/tool-dispatcher.d.ts +1 -1
  19. package/dist/src/tools/tool-dispatcher.js +1 -1
  20. package/dist/src/tools/tree-sitter-code-tools.d.ts +6 -1
  21. package/dist/src/tools/tree-sitter-code-tools.d.ts.map +1 -1
  22. package/dist/src/tools/tree-sitter-code-tools.js +6 -1
  23. package/dist/src/tools/tree-sitter-code-tools.js.map +1 -1
  24. package/dist/src/utils/adr-discovery.d.ts.map +1 -1
  25. package/dist/src/utils/adr-discovery.js +33 -5
  26. package/dist/src/utils/adr-discovery.js.map +1 -1
  27. package/dist/src/utils/knowledge-graph-manager.d.ts +11 -0
  28. package/dist/src/utils/knowledge-graph-manager.d.ts.map +1 -1
  29. package/dist/src/utils/knowledge-graph-manager.js +52 -6
  30. package/dist/src/utils/knowledge-graph-manager.js.map +1 -1
  31. package/package.json +2 -1
  32. package/dist/src/utils/monitoring.d.ts +0 -249
  33. package/dist/src/utils/monitoring.d.ts.map +0 -1
  34. package/dist/src/utils/monitoring.js +0 -513
  35. package/dist/src/utils/monitoring.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;GAMG;AAgIH;;GAEG;AACH,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,MAAM,CAAkC;IAChD,OAAO,CAAC,SAAS,CAAwB;IACzC,OAAO,CAAC,yBAAyB,CAA4B;IAC7D,OAAO,CAAC,yBAAyB,CAA4B;IAC7D,OAAO,CAAC,mBAAmB,CAAsB;IACjD,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,gBAAgB,CAAyB;;IAkCjD;;OAEG;YACW,qBAAqB;IAWnC;;OAEG;IACG,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAKlC;;;;;;;;;OASG;IACH,OAAO,CAAC,aAAa;IAsyIrB;;OAEG;YACW,sBAAsB;YA8GtB,mBAAmB;YAqMnB,sBAAsB;YA+QtB,uBAAuB;YA+bvB,uBAAuB;YAuQvB,mBAAmB;YA2VnB,kBAAkB;IAmIhC;;OAEG;YACW,4BAA4B;IA+F1C;;OAEG;YACW,+BAA+B;IAuO7C;;OAEG;IACH,OAAO,CAAC,cAAc;IAmCtB;;OAEG;IACH,OAAO,CAAC,cAAc;IAqHtB;;OAEG;IACH,OAAO,CAAC,0BAA0B;IAiDlC;;OAEG;IACH,OAAO,CAAC,+BAA+B;IA+FvC;;OAEG;IACH,OAAO,CAAC,yBAAyB;IAuCjC;;OAEG;IACH,OAAO,CAAC,oCAAoC;IAqE5C;;OAEG;IACH,OAAO,CAAC,yBAAyB;IAoCjC;;OAEG;YACW,sBAAsB;YAKtB,sBAAsB;YAKtB,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0B;YAa1B,UAAU;YAwBV,WAAW;YAYX,aAAa;YAab,qBAAqB;YAYrB,sBAAsB;IAYpC;;OAEG;YACW,qBAAqB;IAYnC;;;OAGG;YACW,YAAY;IAY1B;;;OAGG;YACW,wBAAwB;IAYtC;;;OAGG;YACW,uBAAuB;IAYrC;;;OAGG;YACW,cAAc;IAY5B;;;OAGG;YACW,eAAe;IAY7B;;;OAGG;YACW,gBAAgB;IAiB9B;;;OAGG;YACW,kBAAkB;IAyHhC;;;;;;;;;;;OAWG;YACW,cAAc;IA2D5B;;;;;;;;;;;OAWG;YACW,UAAU;CAwHzB"}
package/dist/src/index.js CHANGED
@@ -3700,7 +3700,25 @@ export class McpAdrAnalysisServer {
3700
3700
  const directive = getCEMCPDirective(name, safeArgs);
3701
3701
  if (directive) {
3702
3702
  this.logger.info(`[CE-MCP] Returning directive for tool: ${name}`);
3703
- return formatDirectiveResponse(directive);
3703
+ const directiveResponse = formatDirectiveResponse(directive);
3704
+ // Record BEFORE returning. This early return skips the dispatch
3705
+ // switch below and, with it, the trackToolExecution call on the
3706
+ // success path -- so every tool in CE_MCP_DIRECTIVE_TOOLS was
3707
+ // invisible to usage tracking whenever CE-MCP mode was on. All
3708
+ // twelve of them, including `perform_research`, whose disposition
3709
+ // ADR-023 defers *pending usage data*. See #1489.
3710
+ //
3711
+ // Deliberately not fatal: a directive is the tool's real answer, and
3712
+ // failing to record it must never withhold it. trackToolExecution
3713
+ // already swallows and warns internally; the catch here covers a
3714
+ // throw before that boundary.
3715
+ try {
3716
+ await this.trackToolExecution(name, args, directiveResponse, true);
3717
+ }
3718
+ catch (trackingError) {
3719
+ this.logger.warn(`[CE-MCP] Usage tracking failed for ${name}: ${trackingError instanceof Error ? trackingError.message : String(trackingError)}`);
3720
+ }
3721
+ return directiveResponse;
3704
3722
  }
3705
3723
  // Fall through to legacy execution if no directive available
3706
3724
  this.logger.info(`[CE-MCP] No directive available for ${name}, using legacy path`);
@@ -4356,13 +4374,30 @@ export class McpAdrAnalysisServer {
4356
4374
  - **Execution Mode**: ${status.executionMode}
4357
4375
  - **AI Model**: ${status.model}
4358
4376
 
4359
- ${status.reason
4360
- ? `## ⚠️ Issue Detected
4377
+ ${
4378
+ // CE-MCP is the DEFAULT mode and needs no API key. Reporting the absence of
4379
+ // one as an "Issue Detected" -- immediately after saying no external API call
4380
+ // is needed -- told every new user to go and buy a key they do not need.
4381
+ // Legacy configuration is only a problem for someone who asked for it. (#1414)
4382
+ status.executionMode === 'ce-mcp'
4383
+ ? `## ✅ Running in CE-MCP mode
4384
+
4385
+ No API key is required. Tools return orchestration directives that your host LLM
4386
+ executes directly, which is why **AI Execution Enabled: NO** above is expected and
4387
+ correct rather than a fault.
4388
+
4389
+ Note that only some tools currently return a directive; the rest return their
4390
+ result directly. See ADR-014 and ADR-021.
4391
+
4392
+ Legacy OpenRouter execution is off by design. You only need the configuration
4393
+ below if you deliberately want that older path.`
4394
+ : status.reason
4395
+ ? `## ⚠️ Issue Detected
4361
4396
  **Problem**: ${status.reason}
4362
4397
 
4363
4398
  ## Solution
4364
4399
  ${!status.hasApiKey
4365
- ? `
4400
+ ? `
4366
4401
  1. Get an OpenRouter API key from https://openrouter.ai/keys
4367
4402
  2. Add it to your MCP configuration:
4368
4403
  \`\`\`json
@@ -4381,8 +4416,8 @@ ${!status.hasApiKey
4381
4416
  \`\`\`
4382
4417
  3. Restart your MCP client (Claude Desktop, etc.)
4383
4418
  `
4384
- : status.executionMode !== 'full'
4385
- ? `
4419
+ : status.executionMode !== 'full'
4420
+ ? `
4386
4421
  1. Update your MCP configuration to set EXECUTION_MODE to "full":
4387
4422
  \`\`\`json
4388
4423
  {
@@ -4397,8 +4432,8 @@ ${!status.hasApiKey
4397
4432
  \`\`\`
4398
4433
  2. Restart your MCP client
4399
4434
  `
4400
- : ''}`
4401
- : `## ✅ Configuration Looks Good!
4435
+ : ''}`
4436
+ : `## ✅ Configuration Looks Good!
4402
4437
 
4403
4438
  AI execution is properly configured. Tools should return actual results instead of prompts.
4404
4439
 
@@ -7505,7 +7540,17 @@ Please provide:
7505
7540
  // Fall back to static resource handling
7506
7541
  // Parse URI to determine resource type and parameters
7507
7542
  const url = new globalThis.URL(uri);
7508
- const resourceType = url.pathname.replace('/', '');
7543
+ // For a non-special scheme like `adr://adr_list`, WHATWG URL puts the name in
7544
+ // `host`, not `pathname` -- pathname is ''. Reading pathname alone made every one
7545
+ // of the 16 cases below unreachable: resourceType was always '', so the switch fell
7546
+ // straight to `default` and threw "Unknown resource type: " with nothing after the
7547
+ // colon. 16 of the 17 concrete resources advertised in resources/list were dead.
7548
+ //
7549
+ // adr://adr_list -> host 'adr_list', pathname ''
7550
+ // adr://adr/{id} -> host 'adr', pathname '/%7Bid%7D'
7551
+ //
7552
+ // Prefer the host; fall back to pathname so path-style URIs still resolve.
7553
+ const resourceType = url.host || url.pathname.replace('/', '');
7509
7554
  const params = Object.fromEntries(url.searchParams.entries());
7510
7555
  switch (resourceType) {
7511
7556
  case 'architectural_knowledge_graph': {