@angular-modernizer/adapter-mcp 0.1.4 → 0.3.0

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 (152) hide show
  1. package/README.md +125 -35
  2. package/dist/cli.js +65 -13
  3. package/dist/cli.js.map +1 -1
  4. package/dist/index.d.ts +8 -0
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +8 -0
  7. package/dist/index.js.map +1 -1
  8. package/dist/mcp-watcher.d.ts.map +1 -1
  9. package/dist/mcp-watcher.js +3 -0
  10. package/dist/mcp-watcher.js.map +1 -1
  11. package/dist/server/json-rpc-handler.d.ts +41 -0
  12. package/dist/server/json-rpc-handler.d.ts.map +1 -1
  13. package/dist/server/json-rpc-handler.js +85 -6
  14. package/dist/server/json-rpc-handler.js.map +1 -1
  15. package/dist/server/mcp-server.d.ts +31 -0
  16. package/dist/server/mcp-server.d.ts.map +1 -1
  17. package/dist/server/mcp-server.js +76 -23
  18. package/dist/server/mcp-server.js.map +1 -1
  19. package/dist/server/stdio-guard.d.ts +20 -0
  20. package/dist/server/stdio-guard.d.ts.map +1 -0
  21. package/dist/server/stdio-guard.js +48 -0
  22. package/dist/server/stdio-guard.js.map +1 -0
  23. package/dist/tools/analyze-build-impact.d.ts +169 -12
  24. package/dist/tools/analyze-build-impact.d.ts.map +1 -1
  25. package/dist/tools/analyze-build-impact.js +221 -36
  26. package/dist/tools/analyze-build-impact.js.map +1 -1
  27. package/dist/tools/analyze-parser-performance.d.ts.map +1 -1
  28. package/dist/tools/analyze-parser-performance.js +6 -4
  29. package/dist/tools/analyze-parser-performance.js.map +1 -1
  30. package/dist/tools/collect-feedback.d.ts +112 -1
  31. package/dist/tools/collect-feedback.d.ts.map +1 -1
  32. package/dist/tools/collect-feedback.js +240 -11
  33. package/dist/tools/collect-feedback.js.map +1 -1
  34. package/dist/tools/extract-libraries.d.ts +4 -0
  35. package/dist/tools/extract-libraries.d.ts.map +1 -1
  36. package/dist/tools/extract-libraries.js +40 -8
  37. package/dist/tools/extract-libraries.js.map +1 -1
  38. package/dist/tools/find-angular-symbol.d.ts +29 -6
  39. package/dist/tools/find-angular-symbol.d.ts.map +1 -1
  40. package/dist/tools/find-angular-symbol.js +51 -6
  41. package/dist/tools/find-angular-symbol.js.map +1 -1
  42. package/dist/tools/find-component-hosts.d.ts +114 -0
  43. package/dist/tools/find-component-hosts.d.ts.map +1 -0
  44. package/dist/tools/find-component-hosts.js +240 -0
  45. package/dist/tools/find-component-hosts.js.map +1 -0
  46. package/dist/tools/find-usages.d.ts +33 -4
  47. package/dist/tools/find-usages.d.ts.map +1 -1
  48. package/dist/tools/find-usages.js +102 -11
  49. package/dist/tools/find-usages.js.map +1 -1
  50. package/dist/tools/get-bootstrap-execution.d.ts +108 -0
  51. package/dist/tools/get-bootstrap-execution.d.ts.map +1 -0
  52. package/dist/tools/get-bootstrap-execution.js +243 -0
  53. package/dist/tools/get-bootstrap-execution.js.map +1 -0
  54. package/dist/tools/get-call-graph.d.ts +33 -4
  55. package/dist/tools/get-call-graph.d.ts.map +1 -1
  56. package/dist/tools/get-call-graph.js +76 -13
  57. package/dist/tools/get-call-graph.js.map +1 -1
  58. package/dist/tools/helpers/compact-output.d.ts +61 -0
  59. package/dist/tools/helpers/compact-output.d.ts.map +1 -0
  60. package/dist/tools/helpers/compact-output.js +83 -0
  61. package/dist/tools/helpers/compact-output.js.map +1 -0
  62. package/dist/tools/helpers/find-ts-config.d.ts +24 -1
  63. package/dist/tools/helpers/find-ts-config.d.ts.map +1 -1
  64. package/dist/tools/helpers/find-ts-config.js +213 -7
  65. package/dist/tools/helpers/find-ts-config.js.map +1 -1
  66. package/dist/tools/helpers/project-cache.d.ts +177 -0
  67. package/dist/tools/helpers/project-cache.d.ts.map +1 -0
  68. package/dist/tools/helpers/project-cache.js +313 -0
  69. package/dist/tools/helpers/project-cache.js.map +1 -0
  70. package/dist/tools/helpers/rule-runner.d.ts +67 -0
  71. package/dist/tools/helpers/rule-runner.d.ts.map +1 -0
  72. package/dist/tools/helpers/rule-runner.js +117 -0
  73. package/dist/tools/helpers/rule-runner.js.map +1 -0
  74. package/dist/tools/helpers/scan-plan.d.ts +45 -0
  75. package/dist/tools/helpers/scan-plan.d.ts.map +1 -0
  76. package/dist/tools/helpers/scan-plan.js +151 -0
  77. package/dist/tools/helpers/scan-plan.js.map +1 -0
  78. package/dist/tools/helpers/stack-frame-file-index.d.ts +10 -0
  79. package/dist/tools/helpers/stack-frame-file-index.d.ts.map +1 -0
  80. package/dist/tools/helpers/stack-frame-file-index.js +71 -0
  81. package/dist/tools/helpers/stack-frame-file-index.js.map +1 -0
  82. package/dist/tools/helpers/suggestion-generator.d.ts +1 -1
  83. package/dist/tools/helpers/suggestion-generator.d.ts.map +1 -1
  84. package/dist/tools/helpers/suggestion-generator.js.map +1 -1
  85. package/dist/tools/inspect-form-group.d.ts +93 -0
  86. package/dist/tools/inspect-form-group.d.ts.map +1 -0
  87. package/dist/tools/inspect-form-group.js +161 -0
  88. package/dist/tools/inspect-form-group.js.map +1 -0
  89. package/dist/tools/inspect-i18n.d.ts +85 -0
  90. package/dist/tools/inspect-i18n.d.ts.map +1 -0
  91. package/dist/tools/inspect-i18n.js +203 -0
  92. package/dist/tools/inspect-i18n.js.map +1 -0
  93. package/dist/tools/inspect-template.d.ts +89 -0
  94. package/dist/tools/inspect-template.d.ts.map +1 -0
  95. package/dist/tools/inspect-template.js +166 -0
  96. package/dist/tools/inspect-template.js.map +1 -0
  97. package/dist/tools/list-imports.d.ts +119 -0
  98. package/dist/tools/list-imports.d.ts.map +1 -0
  99. package/dist/tools/list-imports.js +171 -0
  100. package/dist/tools/list-imports.js.map +1 -0
  101. package/dist/tools/orchestrate-migration.d.ts +1 -0
  102. package/dist/tools/orchestrate-migration.d.ts.map +1 -1
  103. package/dist/tools/orchestrate-migration.js +33 -1
  104. package/dist/tools/orchestrate-migration.js.map +1 -1
  105. package/dist/tools/parse-stack-trace.d.ts +3 -1
  106. package/dist/tools/parse-stack-trace.d.ts.map +1 -1
  107. package/dist/tools/parse-stack-trace.js +18 -4
  108. package/dist/tools/parse-stack-trace.js.map +1 -1
  109. package/dist/tools/plan-migration.d.ts +89 -1
  110. package/dist/tools/plan-migration.d.ts.map +1 -1
  111. package/dist/tools/plan-migration.js +203 -7
  112. package/dist/tools/plan-migration.js.map +1 -1
  113. package/dist/tools/resolve-type.d.ts +3 -0
  114. package/dist/tools/resolve-type.d.ts.map +1 -1
  115. package/dist/tools/resolve-type.js +6 -2
  116. package/dist/tools/resolve-type.js.map +1 -1
  117. package/dist/tools/review-feedback.d.ts +7 -0
  118. package/dist/tools/review-feedback.d.ts.map +1 -1
  119. package/dist/tools/review-feedback.js +68 -16
  120. package/dist/tools/review-feedback.js.map +1 -1
  121. package/dist/tools/scan-all.d.ts +6 -6
  122. package/dist/tools/scan-all.d.ts.map +1 -1
  123. package/dist/tools/scan-all.js +7 -7
  124. package/dist/tools/scan-all.js.map +1 -1
  125. package/dist/tools/scan-angular.d.ts +1 -1
  126. package/dist/tools/scan-angular.js +1 -1
  127. package/dist/tools/scan-architecture.d.ts +25 -4
  128. package/dist/tools/scan-architecture.d.ts.map +1 -1
  129. package/dist/tools/scan-architecture.js +115 -134
  130. package/dist/tools/scan-architecture.js.map +1 -1
  131. package/dist/tools/scan-solid.d.ts +1 -1
  132. package/dist/tools/scan-solid.js +1 -1
  133. package/dist/tools/search-codebase.d.ts +32 -6
  134. package/dist/tools/search-codebase.d.ts.map +1 -1
  135. package/dist/tools/search-codebase.js +60 -14
  136. package/dist/tools/search-codebase.js.map +1 -1
  137. package/dist/tools/server-status.d.ts +96 -0
  138. package/dist/tools/server-status.d.ts.map +1 -0
  139. package/dist/tools/server-status.js +195 -0
  140. package/dist/tools/server-status.js.map +1 -0
  141. package/dist/tools/suggest-improvements.d.ts +3 -1
  142. package/dist/tools/suggest-improvements.d.ts.map +1 -1
  143. package/dist/tools/suggest-improvements.js +47 -10
  144. package/dist/tools/suggest-improvements.js.map +1 -1
  145. package/dist/tools/trace-output-flow.d.ts +111 -0
  146. package/dist/tools/trace-output-flow.d.ts.map +1 -0
  147. package/dist/tools/trace-output-flow.js +308 -0
  148. package/dist/tools/trace-output-flow.js.map +1 -0
  149. package/dist/types.d.ts +7 -0
  150. package/dist/types.d.ts.map +1 -1
  151. package/dist/types.js.map +1 -1
  152. package/package.json +13 -12
@@ -1 +1 @@
1
- {"version":3,"file":"analyze-parser-performance.d.ts","sourceRoot":"","sources":["../../src/tools/analyze-parser-performance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AA2F3C;;GAEG;AACH,qBAAa,4BAA6B,YAAW,OAAO;IAC1D,IAAI,SAAgC;IACpC,WAAW,SAI6B;IAGxC,OAAO,CAAC,YAAY,CAAuB;IAE3C,WAAW;;;;;;;;;;;;;;;;;;;;;MAqBA;IAEX;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2CG;IACG,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAuI9D;;;OAGG;IACH,OAAO,CAAC,+BAA+B;IA8GvC;;;OAGG;IACH,OAAO,CAAC,yBAAyB;CAelC"}
1
+ {"version":3,"file":"analyze-parser-performance.d.ts","sourceRoot":"","sources":["../../src/tools/analyze-parser-performance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AA6F3C;;GAEG;AACH,qBAAa,4BAA6B,YAAW,OAAO;IAC1D,IAAI,SAAgC;IACpC,WAAW,SAI6B;IAGxC,OAAO,CAAC,YAAY,CAAuB;IAE3C,WAAW;;;;;;;;;;;;;;;;;;;;;MAqBA;IAEX;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2CG;IACG,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAuI9D;;;OAGG;IACH,OAAO,CAAC,+BAA+B;IA8GvC;;;OAGG;IACH,OAAO,CAAC,yBAAyB;CAelC"}
@@ -20,9 +20,11 @@ import { FeedbackStorage, ParserFeedbackAnalyzer, loadConfig, } from '@angular-m
20
20
  import * as path from 'node:path';
21
21
  import { fileURLToPath } from 'node:url';
22
22
  import { resolvePlatformRoot } from './helpers/platform-root-resolver.js';
23
- // ESM-compatible __dirname alternative
24
- const __filename = fileURLToPath(import.meta.url);
25
- const __dirname = path.dirname(__filename);
23
+ // ESM-compatible __dirname alternative. Named _module* (not __filename/
24
+ // __dirname) so the CJS jest runtime, which already injects those wrapper
25
+ // identifiers, does not collide with these module-scope declarations.
26
+ const _moduleFilename = fileURLToPath(import.meta.url);
27
+ const _moduleDirname = path.dirname(_moduleFilename);
26
28
  /**
27
29
  * Analyze parser performance from transformation feedback sessions
28
30
  */
@@ -114,7 +116,7 @@ export class AnalyzeParserPerformanceTool {
114
116
  // Apply defaults
115
117
  const source = input.source ?? 'both';
116
118
  // Resolve platform root intelligently (searches for monorepo root)
117
- this.platformRoot ??= resolvePlatformRoot(__dirname, '../../../..');
119
+ this.platformRoot ??= resolvePlatformRoot(_moduleDirname, '../../../..');
118
120
  const platformRoot = this.platformRoot;
119
121
  // Initialize FeedbackStorage with source location
120
122
  const feedbackStorage = new FeedbackStorage({
@@ -1 +1 @@
1
- {"version":3,"file":"analyze-parser-performance.js","sourceRoot":"","sources":["../../src/tools/analyze-parser-performance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,UAAU,GAIX,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,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qB,EAAE,EAAE;YACzB,mBAAmB,EAAE,EAAE;SACxB,CAAC;IACJ,CAAC;CACF;AAED;;GAEG;AACH,SAAS,mBAAmB,CAC1B,eAAgC;IAEhC,QAAQ,eAAe,EAAE,CAAC;QACxB,KAAK,SAAS;YACZ,OAAO,CAAC,SAAS,CAAC,CAAC;QACrB,KAAK,UAAU;YACb,OAAO,CAAC,UAAU,CAAC,CAAC;QACtB,KAAK,MAAM;YACT,OAAO,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;QACjC;YACE,OAAO,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IACnC,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"analyze-parser-performance.js","sourceRoot":"","sources":["../../src/tools/analyze-parser-performance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,UAAU,GAIX,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAE1E,wEAAwE;AACxE,0EAA0E;AAC1E,sEAAsE;AACtE,MAAM,eAAe,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACvD,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;AA4ErD;;GAEG;AACH,MAAM,OAAO,4BAA4B;IACvC,IAAI,GAAG,4BAA4B,CAAC;IACpC,WAAW,GACT,4EAA4E;QAC5E,6EAA6E;QAC7E,4DAA4D;QAC5D,qCAAqC,CAAC;IAExC,8DAA8D;IACtD,YAAY,GAAkB,IAAI,CAAC;IAE3C,WAAW,GAAG;QACZ,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,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AAC,IAAI,CAAC,mBAAmB,CAAC,EAAE,CAAC;YACxD,mBAAmB,CAAC,QAAQ,CAAC;gBAC3B,mBAAmB,CAAC,QAAQ,CAAE,GAAG,CAAC,iBAAiB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;QACxE,CAAC;QAED,OAAO;YACL,oBAAoB;YACpB,YAAY;YACZ,YAAY;YACZ,YAAY;YACZ,2BAA2B;YAC3B,kCAAkC;YAClC,wBAAwB;YACxB,+BAA+B;YAC/B,qBAAqB,EAAE,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC;YACtD,qBAAqB;YACrB,mBAAmB;SACpB,CAAC;IACJ,CAAC;IAED;;;OAGG;IACK,yBAAyB;QAC/B,OAAO;YACL,oBAAoB,EAAE,EAAE;YACxB,YAAY,EAAE,CAAC;YACf,YAAY,EAAE,CAAC;YACf,YAAY,EAAE,CAAC;YACf,2BAA2B,EAAE,CAAC;YAC9B,kCAAkC,EAAE,CAAC;YACrC,wBAAwB,EAAE,CAAC;YAC3B,+BAA+B,EAAE,CAAC;YAClC,qBAAqB,EAAE,EAAE;YACzB,qBAAqB,EAAE,EAAE;YACzB,mBAAmB,EAAE,EAAE;SACxB,CAAC;IACJ,CAAC;CACF;AAED;;GAEG;AACH,SAAS,mBAAmB,CAC1B,eAAgC;IAEhC,QAAQ,eAAe,EAAE,CAAC;QACxB,KAAK,SAAS;YACZ,OAAO,CAAC,SAAS,CAAC,CAAC;QACrB,KAAK,UAAU;YACb,OAAO,CAAC,UAAU,CAAC,CAAC;QACtB,KAAK,MAAM;YACT,OAAO,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;QACjC;YACE,OAAO,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IACnC,CAAC;AACH,CAAC"}
@@ -4,6 +4,11 @@
4
4
  * MCP tool for manually collecting transformation feedback for AI learning.
5
5
  * Stores feedback in both user's project and platform root by default.
6
6
  *
7
+ * Record kinds:
8
+ * - 'transformation' (default): outcome of a transform-code run
9
+ * - 'analysis': a read-only tool result (find-usages, search-codebase, ...)
10
+ * that had to be corrected via grep, build output, a script or manual reading
11
+ *
7
12
  * Privacy-First:
8
13
  * - All file paths anonymized with SHA-256 hashing
9
14
  * - No code snippets stored, only metadata
@@ -15,6 +20,7 @@
15
20
  * - Graceful partial failure handling
16
21
  */
17
22
  import { type MCPTool } from '../types.js';
23
+ import type { AnalysisFeedbackCategory, ErrorType } from '@angular-modernizer/core';
18
24
  /**
19
25
  * Collect transformation feedback for AI learning
20
26
  */
@@ -33,6 +39,99 @@ export declare class CollectFeedbackTool implements MCPTool {
33
39
  readonly type: "string";
34
40
  readonly description: "Optional session ID (existing session or create new)";
35
41
  };
42
+ readonly kind: {
43
+ readonly type: "string";
44
+ readonly enum: readonly ["transformation", "analysis"];
45
+ readonly description: "Record kind (default: 'transformation'). 'transformation' requires transformation + execution; 'analysis' requires analysis.";
46
+ };
47
+ readonly analysis: {
48
+ readonly description: "Analysis record or array of records (kind 'analysis'). Each: tool, claimed, actual, fallbackUsed, optional query/evidence/impact/category.";
49
+ readonly oneOf: readonly [{
50
+ readonly type: "object";
51
+ readonly required: readonly ["tool", "claimed", "actual"];
52
+ readonly properties: {
53
+ readonly tool: {
54
+ readonly type: "string";
55
+ readonly description: "Tool that produced the result (e.g. 'find-usages')";
56
+ };
57
+ readonly query: {
58
+ readonly type: readonly ["object", "string"];
59
+ readonly description: "Query passed to the tool (args object or text)";
60
+ };
61
+ readonly claimed: {
62
+ readonly type: "string";
63
+ readonly description: "What the tool reported";
64
+ };
65
+ readonly actual: {
66
+ readonly type: "string";
67
+ readonly description: "Verified truth";
68
+ };
69
+ readonly fallbackUsed: {
70
+ readonly type: "string";
71
+ readonly description: "How the truth was established: 'grep' | 'build' | 'script' | 'manual' | 'none' or another short label";
72
+ };
73
+ readonly evidence: {
74
+ readonly type: "array";
75
+ readonly items: {
76
+ readonly type: "string";
77
+ };
78
+ readonly description: "Supporting evidence (commands, error codes, counts)";
79
+ };
80
+ readonly impact: {
81
+ readonly type: "string";
82
+ readonly enum: readonly ["low", "medium", "high"];
83
+ };
84
+ readonly category: {
85
+ readonly type: "string";
86
+ readonly enum: readonly AnalysisFeedbackCategory[];
87
+ };
88
+ };
89
+ }, {
90
+ readonly type: "array";
91
+ readonly minItems: 1;
92
+ readonly items: {
93
+ readonly type: "object";
94
+ readonly required: readonly ["tool", "claimed", "actual"];
95
+ readonly properties: {
96
+ readonly tool: {
97
+ readonly type: "string";
98
+ readonly description: "Tool that produced the result (e.g. 'find-usages')";
99
+ };
100
+ readonly query: {
101
+ readonly type: readonly ["object", "string"];
102
+ readonly description: "Query passed to the tool (args object or text)";
103
+ };
104
+ readonly claimed: {
105
+ readonly type: "string";
106
+ readonly description: "What the tool reported";
107
+ };
108
+ readonly actual: {
109
+ readonly type: "string";
110
+ readonly description: "Verified truth";
111
+ };
112
+ readonly fallbackUsed: {
113
+ readonly type: "string";
114
+ readonly description: "How the truth was established: 'grep' | 'build' | 'script' | 'manual' | 'none' or another short label";
115
+ };
116
+ readonly evidence: {
117
+ readonly type: "array";
118
+ readonly items: {
119
+ readonly type: "string";
120
+ };
121
+ readonly description: "Supporting evidence (commands, error codes, counts)";
122
+ };
123
+ readonly impact: {
124
+ readonly type: "string";
125
+ readonly enum: readonly ["low", "medium", "high"];
126
+ };
127
+ readonly category: {
128
+ readonly type: "string";
129
+ readonly enum: readonly AnalysisFeedbackCategory[];
130
+ };
131
+ };
132
+ };
133
+ }];
134
+ };
36
135
  readonly transformation: {
37
136
  readonly type: "object";
38
137
  readonly required: readonly ["ruleId", "targetFile", "approach", "reasoning", "confidence"];
@@ -85,6 +184,11 @@ export declare class CollectFeedbackTool implements MCPTool {
85
184
  readonly type: "string";
86
185
  readonly description: "Optional error message if execution failed";
87
186
  };
187
+ readonly errorType: {
188
+ readonly type: "string";
189
+ readonly enum: readonly ErrorType[];
190
+ readonly description: "Optional error classification (build, type, lint, test, runtime, ...). Inferred from error text when omitted.";
191
+ };
88
192
  };
89
193
  };
90
194
  readonly validation: {
@@ -102,6 +206,13 @@ export declare class CollectFeedbackTool implements MCPTool {
102
206
  readonly type: "boolean";
103
207
  readonly description: "Whether lint succeeded";
104
208
  };
209
+ readonly buildErrors: {
210
+ readonly type: "array";
211
+ readonly items: {
212
+ readonly type: "string";
213
+ };
214
+ readonly description: "Optional build error messages (e.g. 'NG8001: app-x is not a known element'); used as learning evidence";
215
+ };
105
216
  };
106
217
  };
107
218
  readonly storageLocation: {
@@ -110,7 +221,7 @@ export declare class CollectFeedbackTool implements MCPTool {
110
221
  readonly description: "Storage location strategy (default: 'both')";
111
222
  };
112
223
  };
113
- readonly required: readonly ["transformation", "execution"];
224
+ readonly required: readonly [];
114
225
  };
115
226
  execute(args: Record<string, unknown>): Promise<unknown>;
116
227
  }
@@ -1 +1 @@
1
- {"version":3,"file":"collect-feedback.d.ts","sourceRoot":"","sources":["../../src/tools/collect-feedback.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AA4T3C;;GAEG;AACH,qBAAa,mBAAoB,YAAW,OAAO;IACjD,IAAI,SAAsB;IAC1B,WAAW,SAG0E;IAGrF,OAAO,CAAC,YAAY,CAAuB;IAE3C,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAiGA;IAEL,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;CAgN/D"}
1
+ {"version":3,"file":"collect-feedback.d.ts","sourceRoot":"","sources":["../../src/tools/collect-feedback.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAkB3C,OAAO,KAAK,EAEV,wBAAwB,EAExB,SAAS,EAYV,MAAM,0BAA0B,CAAC;AAwYlC;;GAEG;AACH,qBAAa,mBAAoB,YAAW,OAAO;IACjD,IAAI,SAAsB;IAC1B,WAAW,SAM+E;IAG1F,OAAO,CAAC,YAAY,CAAuB;IAE3C,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAiIA;IAEL,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;CAkO/D"}
@@ -4,6 +4,11 @@
4
4
  * MCP tool for manually collecting transformation feedback for AI learning.
5
5
  * Stores feedback in both user's project and platform root by default.
6
6
  *
7
+ * Record kinds:
8
+ * - 'transformation' (default): outcome of a transform-code run
9
+ * - 'analysis': a read-only tool result (find-usages, search-codebase, ...)
10
+ * that had to be corrected via grep, build output, a script or manual reading
11
+ *
7
12
  * Privacy-First:
8
13
  * - All file paths anonymized with SHA-256 hashing
9
14
  * - No code snippets stored, only metadata
@@ -14,15 +19,17 @@
14
19
  * - Configurable: 'project', 'platform', or 'both'
15
20
  * - Graceful partial failure handling
16
21
  */
17
- import { FeedbackCollector, PrivacyFilter, FeedbackValidator, FeedbackStorage, loadConfig, FEEDBACK_VERSION, FEEDBACK_FORMAT, ValidationType, ValidationSeverity, } from '@angular-modernizer/core';
22
+ import { FeedbackCollector, PrivacyFilter, FeedbackValidator, FeedbackStorage, loadConfig, FEEDBACK_VERSION, FEEDBACK_FORMAT, ValidationType, ValidationSeverity, ANALYSIS_FEEDBACK_CATEGORIES, ERROR_TYPES, inferErrorType, isErrorType, scoreAnalysisCompleteness, validateAnalysisFeedback, } from '@angular-modernizer/core';
18
23
  import { randomUUID } from 'node:crypto';
19
24
  import * as path from 'node:path';
20
25
  import { promises as fs } from 'node:fs';
21
26
  import { fileURLToPath } from 'node:url';
22
27
  import { resolvePlatformRoot } from './helpers/platform-root-resolver.js';
23
- // ESM-compatible __dirname alternative
24
- const __filename = fileURLToPath(import.meta.url);
25
- const __dirname = path.dirname(__filename);
28
+ // ESM-compatible __dirname alternative. Named _module* (not __filename/
29
+ // __dirname) so the CJS jest runtime, which already injects those wrapper
30
+ // identifiers, does not collide with these module-scope declarations.
31
+ const _moduleFilename = fileURLToPath(import.meta.url);
32
+ const _moduleDirname = path.dirname(_moduleFilename);
26
33
  // Custom error types for better error handling
27
34
  class SessionPersistenceError extends Error {
28
35
  sessionId;
@@ -179,6 +186,48 @@ async function ensureSessionExists(sessionId, feedbackStorage, projectRoot, plat
179
186
  function getStringValue(value) {
180
187
  return typeof value === 'string' && value ? value : undefined;
181
188
  }
189
+ /**
190
+ * JSON schema for a single analysis record
191
+ */
192
+ const ANALYSIS_RECORD_SCHEMA = {
193
+ type: 'object',
194
+ required: ['tool', 'claimed', 'actual'],
195
+ properties: {
196
+ tool: {
197
+ type: 'string',
198
+ description: "Tool that produced the result (e.g. 'find-usages')",
199
+ },
200
+ query: {
201
+ type: ['object', 'string'],
202
+ description: 'Query passed to the tool (args object or text)',
203
+ },
204
+ claimed: {
205
+ type: 'string',
206
+ description: 'What the tool reported',
207
+ },
208
+ actual: {
209
+ type: 'string',
210
+ description: 'Verified truth',
211
+ },
212
+ fallbackUsed: {
213
+ type: 'string',
214
+ description: "How the truth was established: 'grep' | 'build' | 'script' | 'manual' | 'none' or another short label",
215
+ },
216
+ evidence: {
217
+ type: 'array',
218
+ items: { type: 'string' },
219
+ description: 'Supporting evidence (commands, error codes, counts)',
220
+ },
221
+ impact: {
222
+ type: 'string',
223
+ enum: ['low', 'medium', 'high'],
224
+ },
225
+ category: {
226
+ type: 'string',
227
+ enum: ANALYSIS_FEEDBACK_CATEGORIES,
228
+ },
229
+ },
230
+ };
182
231
  /**
183
232
  * Collect transformation feedback for AI learning
184
233
  */
@@ -186,7 +235,10 @@ export class CollectFeedbackTool {
186
235
  name = 'collect-feedback';
187
236
  description = 'Manually collect transformation feedback for AI learning. ' +
188
237
  'Stores feedback in both user project and platform root (default). ' +
189
- 'Validates feedback, anonymizes file paths, and extracts learnings automatically.';
238
+ 'Validates feedback, anonymizes file paths, and extracts learnings automatically. ' +
239
+ "Use kind 'analysis' to report a read-only tool result (find-usages, search-codebase, scans) " +
240
+ 'that had to be corrected by grep, build output, a script or manual reading; ' +
241
+ "'analysis' accepts one record or an array and needs no execution/duration/build data.";
190
242
  // Cache platformRoot to avoid repeated path.join calculations
191
243
  platformRoot = null;
192
244
  inputSchema = {
@@ -200,6 +252,22 @@ export class CollectFeedbackTool {
200
252
  type: 'string',
201
253
  description: 'Optional session ID (existing session or create new)',
202
254
  },
255
+ kind: {
256
+ type: 'string',
257
+ enum: ['transformation', 'analysis'],
258
+ description: "Record kind (default: 'transformation'). 'transformation' requires transformation + execution; 'analysis' requires analysis.",
259
+ },
260
+ analysis: {
261
+ description: "Analysis record or array of records (kind 'analysis'). Each: tool, claimed, actual, fallbackUsed, optional query/evidence/impact/category.",
262
+ oneOf: [
263
+ ANALYSIS_RECORD_SCHEMA,
264
+ {
265
+ type: 'array',
266
+ minItems: 1,
267
+ items: ANALYSIS_RECORD_SCHEMA,
268
+ },
269
+ ],
270
+ },
203
271
  transformation: {
204
272
  type: 'object',
205
273
  required: [
@@ -258,6 +326,11 @@ export class CollectFeedbackTool {
258
326
  type: 'string',
259
327
  description: 'Optional error message if execution failed',
260
328
  },
329
+ errorType: {
330
+ type: 'string',
331
+ enum: ERROR_TYPES,
332
+ description: 'Optional error classification (build, type, lint, test, runtime, ...). Inferred from error text when omitted.',
333
+ },
261
334
  },
262
335
  },
263
336
  validation: {
@@ -275,6 +348,11 @@ export class CollectFeedbackTool {
275
348
  type: 'boolean',
276
349
  description: 'Whether lint succeeded',
277
350
  },
351
+ buildErrors: {
352
+ type: 'array',
353
+ items: { type: 'string' },
354
+ description: "Optional build error messages (e.g. 'NG8001: app-x is not a known element'); used as learning evidence",
355
+ },
278
356
  },
279
357
  },
280
358
  storageLocation: {
@@ -283,7 +361,9 @@ export class CollectFeedbackTool {
283
361
  description: "Storage location strategy (default: 'both')",
284
362
  },
285
363
  },
286
- required: ['transformation', 'execution'],
364
+ // transformation + execution are required for kind 'transformation'
365
+ // (checked at runtime); kind 'analysis' needs only `analysis`.
366
+ required: [],
287
367
  };
288
368
  async execute(args) {
289
369
  // Determine initial project root for config loading (args > process.cwd)
@@ -298,7 +378,7 @@ export class CollectFeedbackTool {
298
378
  getStringValue(fullConfig.projectRoot) ??
299
379
  initialProjectRoot;
300
380
  // Resolve platform root intelligently (searches for monorepo root)
301
- this.platformRoot ??= resolvePlatformRoot(__dirname, '../../../..');
381
+ this.platformRoot ??= resolvePlatformRoot(_moduleDirname, '../../../..');
302
382
  const platformRoot = this.platformRoot;
303
383
  const storageLocation = input.storageLocation ?? 'both';
304
384
  // Initialize FeedbackCollector
@@ -307,12 +387,23 @@ export class CollectFeedbackTool {
307
387
  platformRoot,
308
388
  storageLocation,
309
389
  };
310
- const feedbackCollector = new FeedbackCollector(collectorConfig);
311
390
  const salt = PrivacyFilter.generateSalt();
312
391
  const privacyFilter = new PrivacyFilter({ salt, strictMode: true });
313
- const feedbackValidator = new FeedbackValidator();
314
392
  // Generate or use existing session ID
315
393
  const sessionId = input.sessionId ?? randomUUID();
394
+ if (input.kind === 'analysis') {
395
+ return collectAnalysisFeedback(input, {
396
+ sessionId,
397
+ projectRoot,
398
+ platformRoot,
399
+ storageLocation,
400
+ privacyFilter,
401
+ salt,
402
+ });
403
+ }
404
+ assertTransformationInput(input);
405
+ const feedbackCollector = new FeedbackCollector(collectorConfig);
406
+ const feedbackValidator = new FeedbackValidator();
316
407
  const feedbackId = randomUUID();
317
408
  // Parse rule ID to extract category and type
318
409
  const { category, type } = parseRuleId(input.transformation.ruleId);
@@ -339,6 +430,7 @@ export class CollectFeedbackTool {
339
430
  }
340
431
  // Build TransformationFeedback record
341
432
  const feedback = {
433
+ kind: 'transformation',
342
434
  transformationId: feedbackId,
343
435
  timestamp: new Date().toISOString(),
344
436
  rule: {
@@ -367,7 +459,7 @@ export class CollectFeedbackTool {
367
459
  diff: structuredDiff,
368
460
  error: input.execution.error
369
461
  ? {
370
- type: 'runtime',
462
+ type: resolveErrorType(input.execution.errorType, input.execution.error),
371
463
  message: input.execution.error,
372
464
  }
373
465
  : undefined,
@@ -668,7 +760,13 @@ function buildValidationResult(validation) {
668
760
  result.build = {
669
761
  success: validation.buildSuccess,
670
762
  duration: 0,
671
- errors: [],
763
+ errors: (validation.buildErrors ?? [])
764
+ .filter((message) => message.trim() !== '')
765
+ .map((message) => ({
766
+ code: /\b(?:TS|NG)\d{4}\b/.exec(message)?.[0] ?? '',
767
+ message,
768
+ filePathHash: '',
769
+ })),
672
770
  warnings: [],
673
771
  };
674
772
  }
@@ -770,4 +868,135 @@ function getStorageLocations(storageLocation) {
770
868
  return ['project', 'platform'];
771
869
  }
772
870
  }
871
+ /**
872
+ * Ensure the transformation payload is present for kind 'transformation'.
873
+ *
874
+ * The JSON schema no longer lists transformation/execution as required
875
+ * (kind 'analysis' does not need them), so the check happens here.
876
+ *
877
+ * @throws {ValidationError} If transformation or execution is missing
878
+ */
879
+ function assertTransformationInput(input) {
880
+ const fields = {
881
+ transformation: input.transformation,
882
+ execution: input.execution,
883
+ };
884
+ const missing = Object.entries(fields)
885
+ .filter(([, value]) => typeof value !== 'object' || value === null)
886
+ .map(([name]) => name);
887
+ if (missing.length > 0) {
888
+ throw new ValidationError(`Missing required field(s) for kind 'transformation': ${missing.join(', ')}. ` +
889
+ "Use kind 'analysis' with an 'analysis' record to report a tool result instead.");
890
+ }
891
+ }
892
+ /**
893
+ * Resolve the execution error type: explicit input wins, otherwise infer
894
+ * from the error message ('unknown' when nothing matches).
895
+ */
896
+ function resolveErrorType(errorType, message) {
897
+ if (isErrorType(errorType)) {
898
+ return errorType;
899
+ }
900
+ return inferErrorType(message);
901
+ }
902
+ /**
903
+ * Read a string field from untrusted input
904
+ */
905
+ function textField(value) {
906
+ return typeof value === 'string' ? value : '';
907
+ }
908
+ /**
909
+ * Normalize one analysis input into a stored record
910
+ */
911
+ function toAnalysisRecord(entry) {
912
+ const rawEvidence = entry.evidence;
913
+ const evidence = Array.isArray(rawEvidence)
914
+ ? rawEvidence.filter((item) => typeof item === 'string')
915
+ : [];
916
+ const fallbackUsed = textField(entry.fallbackUsed);
917
+ const record = {
918
+ kind: 'analysis',
919
+ feedbackId: randomUUID(),
920
+ timestamp: new Date().toISOString(),
921
+ tool: textField(entry.tool).trim(),
922
+ query: entry.query ?? '',
923
+ claimed: textField(entry.claimed),
924
+ actual: textField(entry.actual),
925
+ fallbackUsed: fallbackUsed === '' ? 'none' : fallbackUsed,
926
+ evidence,
927
+ impact: entry.impact,
928
+ category: entry.category,
929
+ metadata: {
930
+ source: 'manual',
931
+ collectorVersion: FEEDBACK_VERSION,
932
+ completenessScore: 0,
933
+ },
934
+ };
935
+ record.metadata.completenessScore = scoreAnalysisCompleteness(record);
936
+ return record;
937
+ }
938
+ /**
939
+ * Accept a single analysis object or an array of them
940
+ */
941
+ function normalizeAnalysisEntries(analysis) {
942
+ const isEntry = (entry) => typeof entry === 'object' && entry !== null && !Array.isArray(entry);
943
+ if (Array.isArray(analysis)) {
944
+ return analysis.filter(isEntry);
945
+ }
946
+ return isEntry(analysis) ? [analysis] : [];
947
+ }
948
+ /**
949
+ * Collect one or more analysis feedback records (kind 'analysis').
950
+ *
951
+ * No execution, duration or build data is needed. Records with validation
952
+ * errors (missing tool, claimed or actual) are reported but not stored.
953
+ */
954
+ async function collectAnalysisFeedback(input, context) {
955
+ const entries = normalizeAnalysisEntries(input.analysis);
956
+ if (entries.length === 0) {
957
+ throw new ValidationError("kind 'analysis' requires an 'analysis' record (object) or a non-empty array of records");
958
+ }
959
+ const results = entries.map((entry) => {
960
+ const record = toAnalysisRecord(entry);
961
+ const issues = validateAnalysisFeedback(record);
962
+ const valid = !issues.some((issue) => issue.severity === 'error');
963
+ return { record, issues, valid };
964
+ });
965
+ const toStore = results.filter((r) => r.valid).map((r) => r.record);
966
+ const storageLocations = [];
967
+ let stored = false;
968
+ if (toStore.length > 0) {
969
+ try {
970
+ const feedbackStorage = new FeedbackStorage({
971
+ projectRoot: context.projectRoot,
972
+ platformRoot: context.platformRoot,
973
+ storageLocation: context.storageLocation,
974
+ });
975
+ await ensureSessionExists(context.sessionId, feedbackStorage, context.projectRoot, context.platformRoot, context.privacyFilter, context.salt);
976
+ await feedbackStorage.appendAnalysis(context.sessionId, toStore);
977
+ for (const location of getStorageLocations(context.storageLocation)) {
978
+ const root = location === 'project' ? context.projectRoot : context.platformRoot;
979
+ storageLocations.push(path.join(root, '.claude-feedback/sessions', `${context.sessionId}.jsonl`));
980
+ }
981
+ stored = true;
982
+ }
983
+ catch (error) {
984
+ console.error('Failed to store analysis feedback:', error);
985
+ stored = false;
986
+ }
987
+ }
988
+ return {
989
+ kind: 'analysis',
990
+ sessionId: context.sessionId,
991
+ stored,
992
+ storageLocations,
993
+ records: results.map(({ record, issues, valid }) => ({
994
+ feedbackId: record.feedbackId,
995
+ tool: record.tool,
996
+ stored: stored && valid,
997
+ completenessScore: record.metadata.completenessScore,
998
+ issues,
999
+ })),
1000
+ };
1001
+ }
773
1002
  //# sourceMappingURL=collect-feedback.js.map