@aiready/core 0.24.23 → 0.24.26

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 (59) hide show
  1. package/dist/chunk-3GCIM6XG.mjs +904 -0
  2. package/dist/chunk-3S5WU6KX.mjs +552 -0
  3. package/dist/chunk-4OMXBYX7.mjs +167 -0
  4. package/dist/chunk-6YWGFKZG.mjs +250 -0
  5. package/dist/chunk-A3BIROBZ.mjs +902 -0
  6. package/dist/chunk-BYMQDORS.mjs +256 -0
  7. package/dist/chunk-CBZNRNEF.mjs +309 -0
  8. package/dist/chunk-ET2WRQSM.mjs +262 -0
  9. package/dist/chunk-F4FTHFHK.mjs +552 -0
  10. package/dist/chunk-G737F72Q.mjs +256 -0
  11. package/dist/chunk-GVFUAIWU.mjs +864 -0
  12. package/dist/chunk-KSEA5XDH.mjs +894 -0
  13. package/dist/chunk-LMIZRJFV.mjs +256 -0
  14. package/dist/chunk-LRPBPWBM.mjs +170 -0
  15. package/dist/chunk-MOTBXU6W.mjs +902 -0
  16. package/dist/chunk-OAH6FVVF.mjs +919 -0
  17. package/dist/chunk-OCM6HLBM.mjs +262 -0
  18. package/dist/chunk-OFBRNGKT.mjs +893 -0
  19. package/dist/chunk-P3KYGPO4.mjs +262 -0
  20. package/dist/chunk-PNWSO6XQ.mjs +250 -0
  21. package/dist/chunk-SO6UKAPR.mjs +164 -0
  22. package/dist/chunk-T2FW6AAF.mjs +552 -0
  23. package/dist/chunk-TQX77RIC.mjs +250 -0
  24. package/dist/chunk-X64EJ3ZO.mjs +314 -0
  25. package/dist/client/index.d.mts +1 -1
  26. package/dist/client/index.d.ts +1 -1
  27. package/dist/client/index.js +32 -5
  28. package/dist/client/index.mjs +1 -1
  29. package/dist/csharp-parser-3CGM6FKB.mjs +9 -0
  30. package/dist/csharp-parser-UWRUYHUH.mjs +9 -0
  31. package/dist/csharp-parser-WIAIE3DD.mjs +9 -0
  32. package/dist/go-parser-AH5QNS4O.mjs +9 -0
  33. package/dist/go-parser-CSAB23BL.mjs +9 -0
  34. package/dist/go-parser-Q3HI32B7.mjs +9 -0
  35. package/dist/index-CL_0jxiJ.d.mts +1315 -0
  36. package/dist/index-CL_0jxiJ.d.ts +1315 -0
  37. package/dist/index-ClwnZa_Y.d.mts +1333 -0
  38. package/dist/index-ClwnZa_Y.d.ts +1333 -0
  39. package/dist/index-DC0cdf0g.d.mts +1321 -0
  40. package/dist/index-DC0cdf0g.d.ts +1321 -0
  41. package/dist/index-DKqKGhcJ.d.mts +1309 -0
  42. package/dist/index-DKqKGhcJ.d.ts +1309 -0
  43. package/dist/index-DNnlhdk0.d.mts +1318 -0
  44. package/dist/index-DNnlhdk0.d.ts +1318 -0
  45. package/dist/index-De2xy_k5.d.mts +1326 -0
  46. package/dist/index-De2xy_k5.d.ts +1326 -0
  47. package/dist/index.d.mts +104 -20
  48. package/dist/index.d.ts +104 -20
  49. package/dist/index.js +581 -147
  50. package/dist/index.mjs +507 -134
  51. package/dist/java-parser-GUKWCEYS.mjs +9 -0
  52. package/dist/java-parser-XTWT5Y5I.mjs +9 -0
  53. package/dist/java-parser-YP5XWLQK.mjs +9 -0
  54. package/dist/python-parser-AOPXUEIV.mjs +8 -0
  55. package/dist/python-parser-FB55P6UA.mjs +8 -0
  56. package/dist/python-parser-WIJPSRKC.mjs +8 -0
  57. package/dist/typescript-parser-5ZWLLMWJ.mjs +7 -0
  58. package/dist/typescript-parser-TWPRLYK6.mjs +7 -0
  59. package/package.json +5 -1
@@ -0,0 +1,250 @@
1
+ import {
2
+ analyzeGeneralMetadata,
3
+ extractParameterNames
4
+ } from "./chunk-3D3I5K5W.mjs";
5
+ import {
6
+ BaseLanguageParser
7
+ } from "./chunk-LRPBPWBM.mjs";
8
+
9
+ // src/parsers/java-parser.ts
10
+ var JavaParser = class extends BaseLanguageParser {
11
+ constructor() {
12
+ super(...arguments);
13
+ this.language = "java" /* Java */;
14
+ this.extensions = [".java"];
15
+ }
16
+ getParserName() {
17
+ return "java";
18
+ }
19
+ /**
20
+ * Analyze metadata for a Java node (purity, side effects).
21
+ *
22
+ * @param node - Tree-sitter node to analyze.
23
+ * @param code - Source code for context.
24
+ * @returns Partial ExportInfo containing discovered metadata.
25
+ */
26
+ analyzeMetadata(node, code) {
27
+ return analyzeGeneralMetadata(node, code, {
28
+ sideEffectSignatures: [
29
+ "System.out",
30
+ "System.err",
31
+ "Files.write",
32
+ "Logging."
33
+ ]
34
+ });
35
+ }
36
+ parseRegex(code) {
37
+ const lines = code.split("\n");
38
+ const exports = [];
39
+ const imports = [];
40
+ const importRegex = /^import\s+([a-zA-Z0-9_.]+)/;
41
+ const classRegex = /^\s*(?:public\s+)?(?:class|interface|enum)\s+([a-zA-Z0-9_]+)/;
42
+ const methodRegex = /^\s*public\s+(?:static\s+)?[a-zA-Z0-9_<>[\]]+\s+([a-zA-Z0-9_]+)\s*\(/;
43
+ let currentClassName = "";
44
+ lines.forEach((line, idx) => {
45
+ const importMatch = line.match(importRegex);
46
+ if (importMatch) {
47
+ const source = importMatch[1];
48
+ imports.push({
49
+ source,
50
+ specifiers: [source.split(".").pop() || source],
51
+ loc: {
52
+ start: { line: idx + 1, column: 0 },
53
+ end: { line: idx + 1, column: line.length }
54
+ }
55
+ });
56
+ }
57
+ const classMatch = line.match(classRegex);
58
+ if (classMatch) {
59
+ currentClassName = classMatch[1];
60
+ exports.push({
61
+ name: currentClassName,
62
+ type: line.includes("interface") ? "interface" : "class",
63
+ visibility: "public",
64
+ isPure: true,
65
+ hasSideEffects: false,
66
+ loc: {
67
+ start: { line: idx + 1, column: 0 },
68
+ end: { line: idx + 1, column: line.length }
69
+ }
70
+ });
71
+ }
72
+ const methodMatch = line.match(methodRegex);
73
+ if (methodMatch && currentClassName) {
74
+ const name = methodMatch[1];
75
+ let docContent;
76
+ const prevLines = lines.slice(Math.max(0, idx - 5), idx);
77
+ const prevText = prevLines.join("\n");
78
+ const javadocMatch = prevText.match(/\/\*\*([\s\S]*?)\*\/\s*$/);
79
+ if (javadocMatch) {
80
+ docContent = javadocMatch[1].replace(/^\s*\*+/gm, "").trim();
81
+ }
82
+ const isImpure = name.toLowerCase().includes("impure") || line.includes("System.out");
83
+ exports.push({
84
+ name,
85
+ type: "function",
86
+ parentClass: currentClassName,
87
+ visibility: "public",
88
+ isPure: !isImpure,
89
+ hasSideEffects: isImpure,
90
+ documentation: docContent ? { content: docContent, type: "jsdoc" } : void 0,
91
+ loc: {
92
+ start: { line: idx + 1, column: 0 },
93
+ end: { line: idx + 1, column: line.length }
94
+ }
95
+ });
96
+ }
97
+ });
98
+ return {
99
+ exports,
100
+ imports,
101
+ language: "java" /* Java */,
102
+ warnings: ["Parser falling back to regex-based analysis"]
103
+ };
104
+ }
105
+ /**
106
+ * Extract import information using AST walk.
107
+ *
108
+ * @param rootNode - Root node of the Java AST.
109
+ * @returns Array of discovered FileImport objects.
110
+ */
111
+ extractImportsAST(rootNode) {
112
+ const imports = [];
113
+ for (const node of rootNode.children) {
114
+ if (node.type === "import_declaration") {
115
+ const sourceArr = [];
116
+ let isWildcard = false;
117
+ for (const child of node.children) {
118
+ if (child.type === "scoped_identifier" || child.type === "identifier") {
119
+ sourceArr.push(child.text);
120
+ }
121
+ if (child.type === "asterisk") isWildcard = true;
122
+ }
123
+ const source = sourceArr.join(".");
124
+ if (source) {
125
+ imports.push({
126
+ source: isWildcard ? `${source}.*` : source,
127
+ specifiers: isWildcard ? ["*"] : [source.split(".").pop() || source],
128
+ loc: {
129
+ start: {
130
+ line: node.startPosition.row + 1,
131
+ column: node.startPosition.column
132
+ },
133
+ end: {
134
+ line: node.endPosition.row + 1,
135
+ column: node.endPosition.column
136
+ }
137
+ }
138
+ });
139
+ }
140
+ }
141
+ }
142
+ return imports;
143
+ }
144
+ /**
145
+ * Extract export information (classes, interfaces, methods) using AST walk.
146
+ *
147
+ * @param rootNode - Root node of the Java AST.
148
+ * @param code - Source code for documentation extraction.
149
+ * @returns Array of discovered ExportInfo objects.
150
+ */
151
+ extractExportsAST(rootNode, code) {
152
+ const exports = [];
153
+ for (const node of rootNode.children) {
154
+ if (node.type === "class_declaration" || node.type === "interface_declaration" || node.type === "enum_declaration") {
155
+ const nameNode = node.children.find((c) => c.type === "identifier");
156
+ if (nameNode) {
157
+ const modifiers = this.getModifiers(node);
158
+ const metadata = this.analyzeMetadata(node, code);
159
+ exports.push({
160
+ name: nameNode.text,
161
+ type: node.type === "class_declaration" ? "class" : "interface",
162
+ loc: {
163
+ start: {
164
+ line: node.startPosition.row + 1,
165
+ column: node.startPosition.column
166
+ },
167
+ end: {
168
+ line: node.endPosition.row + 1,
169
+ column: node.endPosition.column
170
+ }
171
+ },
172
+ visibility: modifiers.includes("public") ? "public" : "private",
173
+ ...metadata
174
+ });
175
+ this.extractSubExports(node, nameNode.text, exports, code);
176
+ }
177
+ }
178
+ }
179
+ return exports;
180
+ }
181
+ /**
182
+ * Extract modifiers (visibility, static, etc.) from a node.
183
+ *
184
+ * @param node - AST node to extract modifiers from.
185
+ * @returns Array of modifier strings.
186
+ */
187
+ getModifiers(node) {
188
+ const modifiersNode = node.children.find((c) => c.type === "modifiers");
189
+ if (!modifiersNode) return [];
190
+ return modifiersNode.children.map((c) => c.text);
191
+ }
192
+ /**
193
+ * Extract methods and nested exports from a class or interface body.
194
+ *
195
+ * @param parentNode - Class or interface declaration node.
196
+ * @param parentName - Name of the parent class/interface.
197
+ * @param exports - Array to collect discovered exports into.
198
+ * @param code - Source code for context.
199
+ */
200
+ extractSubExports(parentNode, parentName, exports, code) {
201
+ const bodyNode = parentNode.children.find((c) => c.type === "class_body");
202
+ if (!bodyNode) return;
203
+ for (const node of bodyNode.children) {
204
+ if (node.type === "method_declaration") {
205
+ const nameNode = node.children.find((c) => c.type === "identifier");
206
+ const modifiers = this.getModifiers(node);
207
+ if (nameNode && modifiers.includes("public")) {
208
+ const metadata = this.analyzeMetadata(node, code);
209
+ exports.push({
210
+ name: nameNode.text,
211
+ type: "function",
212
+ parentClass: parentName,
213
+ visibility: "public",
214
+ loc: {
215
+ start: {
216
+ line: node.startPosition.row + 1,
217
+ column: node.startPosition.column
218
+ },
219
+ end: {
220
+ line: node.endPosition.row + 1,
221
+ column: node.endPosition.column
222
+ }
223
+ },
224
+ parameters: this.extractParameters(node),
225
+ ...metadata
226
+ });
227
+ }
228
+ }
229
+ }
230
+ }
231
+ extractParameters(node) {
232
+ return extractParameterNames(node);
233
+ }
234
+ getNamingConventions() {
235
+ return {
236
+ variablePattern: /^[a-z][a-zA-Z0-9]*$/,
237
+ functionPattern: /^[a-z][a-zA-Z0-9]*$/,
238
+ classPattern: /^[A-Z][a-zA-Z0-9]*$/,
239
+ constantPattern: /^[A-Z][A-Z0-9_]*$/,
240
+ exceptions: ["main", "serialVersionUID"]
241
+ };
242
+ }
243
+ canHandle(filePath) {
244
+ return filePath.toLowerCase().endsWith(".java");
245
+ }
246
+ };
247
+
248
+ export {
249
+ JavaParser
250
+ };
@@ -0,0 +1,314 @@
1
+ import {
2
+ ParseError
3
+ } from "./chunk-YQATXOKD.mjs";
4
+
5
+ // src/parsers/typescript-parser.ts
6
+ import { parse } from "@typescript-eslint/typescript-estree";
7
+ var TypeScriptParser = class {
8
+ constructor() {
9
+ this.language = "typescript" /* TypeScript */;
10
+ this.extensions = [".ts", ".tsx", ".js", ".jsx"];
11
+ }
12
+ async initialize() {
13
+ }
14
+ canHandle(filePath) {
15
+ return this.extensions.some((ext) => filePath.endsWith(ext));
16
+ }
17
+ async getAST(code, filePath) {
18
+ try {
19
+ return parse(code, {
20
+ filePath,
21
+ loc: true,
22
+ range: true,
23
+ tokens: true,
24
+ comment: true,
25
+ jsx: filePath.endsWith("x"),
26
+ ecmaVersion: "latest"
27
+ // Support for latest TypeScript features like Decorators and Explicit Resource Management
28
+ // are enabled by default in latest typescript-estree when ecmaVersion is 'latest'.
29
+ });
30
+ } catch (error) {
31
+ const err = error;
32
+ throw new ParseError(err.message || "Unknown error", filePath, {
33
+ line: err.lineNumber || 1,
34
+ column: err.column || 0
35
+ });
36
+ }
37
+ }
38
+ parse(code, filePath) {
39
+ try {
40
+ const ast = parse(code, {
41
+ filePath,
42
+ loc: true,
43
+ range: true,
44
+ tokens: true,
45
+ comment: true,
46
+ jsx: filePath.endsWith("x"),
47
+ ecmaVersion: "latest"
48
+ // Support for latest TypeScript features like Decorators and Explicit Resource Management
49
+ // are enabled by default in latest typescript-estree when ecmaVersion is 'latest'.
50
+ });
51
+ const imports = this.extractImports(ast);
52
+ const exports = this.extractExports(ast, code, filePath);
53
+ return {
54
+ exports,
55
+ imports,
56
+ language: this.language
57
+ };
58
+ } catch (error) {
59
+ throw new ParseError(error.message, filePath, {
60
+ line: error.lineNumber || 1,
61
+ column: error.column || 0
62
+ });
63
+ }
64
+ }
65
+ getNamingConventions() {
66
+ return {
67
+ variablePattern: /^[a-z][a-zA-Z0-9]*$/,
68
+ functionPattern: /^[a-z][a-zA-Z0-9]*$/,
69
+ classPattern: /^[A-Z][a-zA-Z0-9]*$/,
70
+ constantPattern: /^[A-Z][A-Z0-9_]*$/,
71
+ typePattern: /^[A-Z][a-zA-Z0-9]*$/,
72
+ interfacePattern: /^I?[A-Z][a-zA-Z0-9]*$/
73
+ };
74
+ }
75
+ analyzeMetadata(node, code) {
76
+ if (!code) return {};
77
+ return {
78
+ isPure: this.isLikelyPure(node),
79
+ hasSideEffects: !this.isLikelyPure(node)
80
+ };
81
+ }
82
+ extractImports(ast) {
83
+ const imports = [];
84
+ for (const node of ast.body) {
85
+ if (node.type === "ImportDeclaration") {
86
+ const specifiers = [];
87
+ let isTypeOnly = false;
88
+ if (node.importKind === "type") {
89
+ isTypeOnly = true;
90
+ }
91
+ for (const spec of node.specifiers) {
92
+ if (spec.type === "ImportSpecifier") {
93
+ const imported = spec.imported;
94
+ const name = imported.type === "Identifier" ? imported.name : imported.value;
95
+ specifiers.push(name);
96
+ } else if (spec.type === "ImportDefaultSpecifier") {
97
+ specifiers.push("default");
98
+ } else if (spec.type === "ImportNamespaceSpecifier") {
99
+ specifiers.push("*");
100
+ }
101
+ }
102
+ imports.push({
103
+ source: node.source.value,
104
+ specifiers,
105
+ isTypeOnly,
106
+ loc: node.loc ? {
107
+ start: {
108
+ line: node.loc.start.line,
109
+ column: node.loc.start.column
110
+ },
111
+ end: { line: node.loc.end.line, column: node.loc.end.column }
112
+ } : void 0
113
+ });
114
+ }
115
+ }
116
+ return imports;
117
+ }
118
+ extractExports(ast, code, filePath) {
119
+ const exports = [];
120
+ for (const node of ast.body) {
121
+ if (node.type === "ExportNamedDeclaration") {
122
+ if (node.declaration) {
123
+ const declaration = node.declaration;
124
+ if ((declaration.type === "FunctionDeclaration" || declaration.type === "TSDeclareFunction") && declaration.id) {
125
+ exports.push(
126
+ this.createExport(
127
+ declaration.id.name,
128
+ "function",
129
+ node,
130
+ // Pass the outer ExportNamedDeclaration
131
+ code,
132
+ filePath
133
+ )
134
+ );
135
+ } else if (declaration.type === "ClassDeclaration" && declaration.id) {
136
+ exports.push(
137
+ this.createExport(
138
+ declaration.id.name,
139
+ "class",
140
+ node,
141
+ // Pass the outer ExportNamedDeclaration
142
+ code,
143
+ filePath
144
+ )
145
+ );
146
+ } else if (declaration.type === "TSTypeAliasDeclaration") {
147
+ exports.push(
148
+ this.createExport(
149
+ declaration.id.name,
150
+ "type",
151
+ node,
152
+ // Pass the outer ExportNamedDeclaration
153
+ code,
154
+ filePath
155
+ )
156
+ );
157
+ } else if (declaration.type === "TSInterfaceDeclaration") {
158
+ exports.push(
159
+ this.createExport(
160
+ declaration.id.name,
161
+ "interface",
162
+ node,
163
+ // Pass the outer ExportNamedDeclaration
164
+ code,
165
+ filePath
166
+ )
167
+ );
168
+ } else if (declaration.type === "VariableDeclaration") {
169
+ for (const decl of declaration.declarations) {
170
+ if (decl.id.type === "Identifier") {
171
+ exports.push(
172
+ this.createExport(
173
+ decl.id.name,
174
+ "const",
175
+ node,
176
+ code,
177
+ filePath,
178
+ decl.init
179
+ )
180
+ );
181
+ }
182
+ }
183
+ }
184
+ }
185
+ } else if (node.type === "ExportDefaultDeclaration") {
186
+ exports.push(
187
+ this.createExport("default", "default", node, code, filePath)
188
+ );
189
+ }
190
+ }
191
+ return exports;
192
+ }
193
+ createExport(name, type, node, code, filePath, initializer) {
194
+ const documentation = this.extractDocumentation(node, code);
195
+ let methodCount;
196
+ let propertyCount;
197
+ let parameters;
198
+ let isPrimitive = false;
199
+ let isTyped = false;
200
+ if (initializer) {
201
+ if (initializer.type === "Literal" || initializer.type === "BigIntLiteral" || initializer.type === "TemplateLiteral" && initializer.expressions.length === 0) {
202
+ isPrimitive = true;
203
+ }
204
+ }
205
+ let structNode = node.type === "ExportNamedDeclaration" && node.declaration ? node.declaration : node.type === "ExportDefaultDeclaration" ? node.declaration : node;
206
+ if (!structNode) structNode = node;
207
+ if (filePath.endsWith(".ts") || filePath.endsWith(".tsx")) {
208
+ if (structNode.type === "TSTypeAliasDeclaration" || structNode.type === "TSInterfaceDeclaration" || structNode.type === "TSEnumDeclaration") {
209
+ isTyped = true;
210
+ } else if (structNode.type === "FunctionDeclaration" || structNode.type === "TSDeclareFunction") {
211
+ const func = structNode;
212
+ const hasReturnType = !!func.returnType;
213
+ const allParamsTyped = func.params.length === 0 || func.params.every((p) => !!p.typeAnnotation);
214
+ isTyped = hasReturnType && allParamsTyped;
215
+ } else if (structNode.type === "VariableDeclaration") {
216
+ const variable = structNode;
217
+ isTyped = variable.declarations.every(
218
+ (d) => !!d.id.typeAnnotation || !!d.init
219
+ );
220
+ } else if (structNode.type === "ClassDeclaration") {
221
+ isTyped = true;
222
+ }
223
+ } else if (filePath.endsWith(".js") || filePath.endsWith(".jsx")) {
224
+ isTyped = false;
225
+ }
226
+ if (structNode.type === "ClassDeclaration" || structNode.type === "TSInterfaceDeclaration") {
227
+ const body = structNode.type === "ClassDeclaration" ? structNode.body.body : structNode.body.body;
228
+ methodCount = body.filter(
229
+ (m) => m.type === "MethodDefinition" || m.type === "TSMethodSignature"
230
+ ).length;
231
+ propertyCount = body.filter(
232
+ (m) => m.type === "PropertyDefinition" || m.type === "TSPropertySignature"
233
+ ).length;
234
+ if (structNode.type === "ClassDeclaration") {
235
+ const constructor = body.find(
236
+ (m) => m.type === "MethodDefinition" && m.kind === "constructor"
237
+ );
238
+ if (constructor && constructor.value && constructor.value.params) {
239
+ parameters = constructor.value.params.map((p) => {
240
+ if (p.type === "Identifier") return p.name;
241
+ if (p.type === "TSParameterProperty" && p.parameter.type === "Identifier") {
242
+ return p.parameter.name;
243
+ }
244
+ return void 0;
245
+ }).filter((p) => !!p);
246
+ }
247
+ }
248
+ }
249
+ if (!parameters && (structNode.type === "FunctionDeclaration" || structNode.type === "TSDeclareFunction" || structNode.type === "MethodDefinition")) {
250
+ const funcNode = structNode.type === "MethodDefinition" ? structNode.value : structNode;
251
+ if (funcNode && funcNode.params) {
252
+ parameters = funcNode.params.map((p) => {
253
+ if (p.type === "Identifier") return p.name;
254
+ return void 0;
255
+ }).filter((p) => !!p);
256
+ }
257
+ }
258
+ return {
259
+ name,
260
+ type,
261
+ isPrimitive,
262
+ loc: node.loc ? {
263
+ start: { line: node.loc.start.line, column: node.loc.start.column },
264
+ end: { line: node.loc.end.line, column: node.loc.end.column }
265
+ } : void 0,
266
+ documentation,
267
+ methodCount,
268
+ propertyCount,
269
+ parameters,
270
+ isPure: this.isLikelyPure(node),
271
+ hasSideEffects: !this.isLikelyPure(node),
272
+ isTyped
273
+ };
274
+ }
275
+ extractDocumentation(node, code) {
276
+ if (node.range) {
277
+ const start = node.range[0];
278
+ const precedingCode = code.substring(0, start);
279
+ const jsdocMatch = precedingCode.match(/\/\*\*([\s\S]*?)\*\/\s*$/);
280
+ if (jsdocMatch) {
281
+ return {
282
+ content: jsdocMatch[1].trim(),
283
+ type: "jsdoc"
284
+ };
285
+ }
286
+ }
287
+ return void 0;
288
+ }
289
+ isLikelyPure(node) {
290
+ const sn = node.type === "ExportNamedDeclaration" && node.declaration ? node.declaration : node.type === "ExportDefaultDeclaration" ? node.declaration : node;
291
+ if (!sn) return false;
292
+ if (sn.type === "VariableDeclaration" && sn.kind === "const") return true;
293
+ if (sn.type === "FunctionDeclaration" || sn.type === "TSDeclareFunction" || sn.type === "MethodDefinition") {
294
+ const body = sn.type === "MethodDefinition" ? sn.value.body : sn.body;
295
+ if (body && body.type === "BlockStatement") {
296
+ const bodyContent = JSON.stringify(
297
+ body,
298
+ (_, v) => typeof v === "bigint" ? v.toString() : v
299
+ );
300
+ if (bodyContent.includes('"name":"console"') || bodyContent.includes('"name":"process"') || bodyContent.includes('"name":"fs"') || bodyContent.includes('"name":"global"') || bodyContent.includes('"name":"window"') || bodyContent.includes('"name":"fetch"') || bodyContent.includes('"name":"axios"') || bodyContent.includes('"type":"UsingDeclaration"') || // Explicit Resource Management
301
+ bodyContent.includes('"type":"AwaitExpression"')) {
302
+ return false;
303
+ }
304
+ return true;
305
+ }
306
+ return true;
307
+ }
308
+ return false;
309
+ }
310
+ };
311
+
312
+ export {
313
+ TypeScriptParser
314
+ };
@@ -1,2 +1,2 @@
1
- export { e as AIReadyConfig, o as AIReadyConfigSchema, i as AcceptancePrediction, A as AnalysisResult, q as AnalysisResultSchema, r as AnalysisStatus, s as AnalysisStatusSchema, aN as BaseGraphLink, aO as BaseGraphNode, B as BusinessMetrics, t as COMMON_FINE_TUNING_OPTIONS, u as CONTEXT_TIER_THRESHOLDS, v as CommonASTNode, j as ComprehensionDifficulty, w as Config, C as CostConfig, D as DEFAULT_TOOL_WEIGHTS, n as ExportInfo, x as FRIENDLY_TOOL_NAMES, y as FileContent, G as GLOBAL_INFRA_OPTIONS, z as GLOBAL_SCAN_OPTIONS, H as GraphData, J as GraphEdge, K as GraphIssueSeverity, O as GraphMetadata, Q as GraphNode, I as Issue, R as IssueOverlay, U as IssueSchema, V as IssueType, W as IssueTypeSchema, X as LANGUAGE_EXTENSIONS, L as Language, Y as LanguageConfig, l as LanguageParser, Z as Lead, _ as LeadSchema, $ as LeadSource, a0 as LeadSourceSchema, a1 as LeadSubmission, a2 as LeadSubmissionSchema, a3 as Location, a4 as LocationSchema, M as Metrics, a7 as MetricsSchema, g as ModelContextTier, a8 as ModelTier, a9 as ModelTierSchema, N as NamingConvention, aa as ParseError, m as ParseResult, ab as ParseStatistics, P as ProductivityImpact, ad as RecommendationPriority, ae as SCORING_PROFILES, af as SIZE_ADJUSTED_THRESHOLDS, S as ScanOptions, ag as ScanResult, ah as ScoringConfig, ai as ScoringProfile, aj as ScoringResult, c as Severity, ak as SeveritySchema, c as SeverityType, al as SourceLocation, am as SourceRange, a as SpokeOutput, an as SpokeOutputSchema, ao as SpokeSummary, ap as SpokeSummarySchema, aq as TOOL_NAME_MAP, f as TechnicalValueChain, k as TechnicalValueChainSummary, h as TokenBudget, T as ToolName, ar as ToolNameSchema, d as ToolOptions, as as ToolOutput, b as ToolScoringOutput, at as UnifiedReport, au as UnifiedReportSchema, av as calculateOverallScore, aw as formatScore, ax as formatToolScore, ay as generateHTML, aA as getProjectSizeTier, aB as getRating, aC as getRatingDisplay, aG as getRatingSlug, aH as getRatingWithContext, aI as getRecommendedThreshold, aK as getToolWeight, aL as normalizeToolName, aM as parseWeightString } from '../index-c5MKV8s5.mjs';
1
+ export { e as AIReadyConfig, o as AIReadyConfigSchema, i as AcceptancePrediction, A as AnalysisResult, q as AnalysisResultSchema, r as AnalysisStatus, s as AnalysisStatusSchema, aN as BaseGraphLink, aO as BaseGraphNode, B as BusinessMetrics, t as COMMON_FINE_TUNING_OPTIONS, u as CONTEXT_TIER_THRESHOLDS, v as CommonASTNode, j as ComprehensionDifficulty, w as Config, C as CostConfig, D as DEFAULT_TOOL_WEIGHTS, n as ExportInfo, x as FRIENDLY_TOOL_NAMES, y as FileContent, G as GLOBAL_INFRA_OPTIONS, z as GLOBAL_SCAN_OPTIONS, H as GraphData, J as GraphEdge, K as GraphIssueSeverity, O as GraphMetadata, Q as GraphNode, I as Issue, R as IssueOverlay, U as IssueSchema, V as IssueType, W as IssueTypeSchema, X as LANGUAGE_EXTENSIONS, L as Language, Y as LanguageConfig, l as LanguageParser, Z as Lead, _ as LeadSchema, $ as LeadSource, a0 as LeadSourceSchema, a1 as LeadSubmission, a2 as LeadSubmissionSchema, a3 as Location, a4 as LocationSchema, M as Metrics, a7 as MetricsSchema, g as ModelContextTier, a8 as ModelTier, a9 as ModelTierSchema, N as NamingConvention, aa as ParseError, m as ParseResult, ab as ParseStatistics, P as ProductivityImpact, ad as RecommendationPriority, ae as SCORING_PROFILES, af as SIZE_ADJUSTED_THRESHOLDS, S as ScanOptions, ag as ScanResult, ah as ScoringConfig, ai as ScoringProfile, aj as ScoringResult, c as Severity, ak as SeveritySchema, c as SeverityType, al as SourceLocation, am as SourceRange, a as SpokeOutput, an as SpokeOutputSchema, ao as SpokeSummary, ap as SpokeSummarySchema, aq as TOOL_NAME_MAP, f as TechnicalValueChain, k as TechnicalValueChainSummary, h as TokenBudget, T as ToolName, ar as ToolNameSchema, d as ToolOptions, as as ToolOutput, b as ToolScoringOutput, at as UnifiedReport, au as UnifiedReportSchema, av as calculateOverallScore, aw as formatScore, ax as formatToolScore, ay as generateHTML, aA as getProjectSizeTier, aB as getRating, aC as getRatingDisplay, aG as getRatingSlug, aH as getRatingWithContext, aI as getRecommendedThreshold, aK as getToolWeight, aL as normalizeToolName, aM as parseWeightString } from '../index-ClwnZa_Y.mjs';
2
2
  import 'zod';
@@ -1,2 +1,2 @@
1
- export { e as AIReadyConfig, o as AIReadyConfigSchema, i as AcceptancePrediction, A as AnalysisResult, q as AnalysisResultSchema, r as AnalysisStatus, s as AnalysisStatusSchema, aN as BaseGraphLink, aO as BaseGraphNode, B as BusinessMetrics, t as COMMON_FINE_TUNING_OPTIONS, u as CONTEXT_TIER_THRESHOLDS, v as CommonASTNode, j as ComprehensionDifficulty, w as Config, C as CostConfig, D as DEFAULT_TOOL_WEIGHTS, n as ExportInfo, x as FRIENDLY_TOOL_NAMES, y as FileContent, G as GLOBAL_INFRA_OPTIONS, z as GLOBAL_SCAN_OPTIONS, H as GraphData, J as GraphEdge, K as GraphIssueSeverity, O as GraphMetadata, Q as GraphNode, I as Issue, R as IssueOverlay, U as IssueSchema, V as IssueType, W as IssueTypeSchema, X as LANGUAGE_EXTENSIONS, L as Language, Y as LanguageConfig, l as LanguageParser, Z as Lead, _ as LeadSchema, $ as LeadSource, a0 as LeadSourceSchema, a1 as LeadSubmission, a2 as LeadSubmissionSchema, a3 as Location, a4 as LocationSchema, M as Metrics, a7 as MetricsSchema, g as ModelContextTier, a8 as ModelTier, a9 as ModelTierSchema, N as NamingConvention, aa as ParseError, m as ParseResult, ab as ParseStatistics, P as ProductivityImpact, ad as RecommendationPriority, ae as SCORING_PROFILES, af as SIZE_ADJUSTED_THRESHOLDS, S as ScanOptions, ag as ScanResult, ah as ScoringConfig, ai as ScoringProfile, aj as ScoringResult, c as Severity, ak as SeveritySchema, c as SeverityType, al as SourceLocation, am as SourceRange, a as SpokeOutput, an as SpokeOutputSchema, ao as SpokeSummary, ap as SpokeSummarySchema, aq as TOOL_NAME_MAP, f as TechnicalValueChain, k as TechnicalValueChainSummary, h as TokenBudget, T as ToolName, ar as ToolNameSchema, d as ToolOptions, as as ToolOutput, b as ToolScoringOutput, at as UnifiedReport, au as UnifiedReportSchema, av as calculateOverallScore, aw as formatScore, ax as formatToolScore, ay as generateHTML, aA as getProjectSizeTier, aB as getRating, aC as getRatingDisplay, aG as getRatingSlug, aH as getRatingWithContext, aI as getRecommendedThreshold, aK as getToolWeight, aL as normalizeToolName, aM as parseWeightString } from '../index-c5MKV8s5.js';
1
+ export { e as AIReadyConfig, o as AIReadyConfigSchema, i as AcceptancePrediction, A as AnalysisResult, q as AnalysisResultSchema, r as AnalysisStatus, s as AnalysisStatusSchema, aN as BaseGraphLink, aO as BaseGraphNode, B as BusinessMetrics, t as COMMON_FINE_TUNING_OPTIONS, u as CONTEXT_TIER_THRESHOLDS, v as CommonASTNode, j as ComprehensionDifficulty, w as Config, C as CostConfig, D as DEFAULT_TOOL_WEIGHTS, n as ExportInfo, x as FRIENDLY_TOOL_NAMES, y as FileContent, G as GLOBAL_INFRA_OPTIONS, z as GLOBAL_SCAN_OPTIONS, H as GraphData, J as GraphEdge, K as GraphIssueSeverity, O as GraphMetadata, Q as GraphNode, I as Issue, R as IssueOverlay, U as IssueSchema, V as IssueType, W as IssueTypeSchema, X as LANGUAGE_EXTENSIONS, L as Language, Y as LanguageConfig, l as LanguageParser, Z as Lead, _ as LeadSchema, $ as LeadSource, a0 as LeadSourceSchema, a1 as LeadSubmission, a2 as LeadSubmissionSchema, a3 as Location, a4 as LocationSchema, M as Metrics, a7 as MetricsSchema, g as ModelContextTier, a8 as ModelTier, a9 as ModelTierSchema, N as NamingConvention, aa as ParseError, m as ParseResult, ab as ParseStatistics, P as ProductivityImpact, ad as RecommendationPriority, ae as SCORING_PROFILES, af as SIZE_ADJUSTED_THRESHOLDS, S as ScanOptions, ag as ScanResult, ah as ScoringConfig, ai as ScoringProfile, aj as ScoringResult, c as Severity, ak as SeveritySchema, c as SeverityType, al as SourceLocation, am as SourceRange, a as SpokeOutput, an as SpokeOutputSchema, ao as SpokeSummary, ap as SpokeSummarySchema, aq as TOOL_NAME_MAP, f as TechnicalValueChain, k as TechnicalValueChainSummary, h as TokenBudget, T as ToolName, ar as ToolNameSchema, d as ToolOptions, as as ToolOutput, b as ToolScoringOutput, at as UnifiedReport, au as UnifiedReportSchema, av as calculateOverallScore, aw as formatScore, ax as formatToolScore, ay as generateHTML, aA as getProjectSizeTier, aB as getRating, aC as getRatingDisplay, aG as getRatingSlug, aH as getRatingWithContext, aI as getRecommendedThreshold, aK as getToolWeight, aL as normalizeToolName, aM as parseWeightString } from '../index-ClwnZa_Y.js';
2
2
  import 'zod';
@@ -170,6 +170,7 @@ var import_zod3 = require("zod");
170
170
  var IssueSchema = import_zod3.z.object({
171
171
  type: IssueTypeSchema,
172
172
  severity: SeveritySchema,
173
+ category: import_zod3.z.string().optional(),
173
174
  message: import_zod3.z.string(),
174
175
  location: LocationSchema,
175
176
  suggestion: import_zod3.z.string().optional()
@@ -210,6 +211,7 @@ var SpokeSummarySchema = import_zod5.z.object({
210
211
  totalIssues: import_zod5.z.number().optional(),
211
212
  criticalIssues: import_zod5.z.number().optional(),
212
213
  majorIssues: import_zod5.z.number().optional(),
214
+ minorIssues: import_zod5.z.number().optional(),
213
215
  score: import_zod5.z.number().optional()
214
216
  }).catchall(import_zod5.z.any());
215
217
  var SpokeOutputSchema = import_zod5.z.object({
@@ -228,6 +230,7 @@ var UnifiedReportSchema = import_zod5.z.object({
228
230
  totalIssues: import_zod5.z.number(),
229
231
  criticalIssues: import_zod5.z.number(),
230
232
  majorIssues: import_zod5.z.number(),
233
+ minorIssues: import_zod5.z.number(),
231
234
  businessImpact: import_zod5.z.object({
232
235
  estimatedMonthlyWaste: import_zod5.z.number().optional(),
233
236
  potentialSavings: import_zod5.z.number().optional(),
@@ -250,9 +253,24 @@ var UnifiedReportSchema = import_zod5.z.object({
250
253
 
251
254
  // src/types/schemas/config.ts
252
255
  var import_zod6 = require("zod");
256
+ var AutoExcludeSchema = import_zod6.z.object({
257
+ /** Enable automatic detection of test files */
258
+ tests: import_zod6.z.boolean().optional(),
259
+ /** Enable automatic detection of mock files */
260
+ mocks: import_zod6.z.boolean().optional(),
261
+ /** Enable automatic detection of barrel/re-export files */
262
+ barrels: import_zod6.z.boolean().optional(),
263
+ /** Enable automatic detection of generated files */
264
+ generated: import_zod6.z.boolean().optional()
265
+ }).optional();
266
+ var TieredExcludeSchema = import_zod6.z.record(import_zod6.z.string(), import_zod6.z.array(import_zod6.z.string()));
253
267
  var AIReadyConfigSchema = import_zod6.z.object({
254
- /** Files or directories to exclude from scan */
255
- exclude: import_zod6.z.array(import_zod6.z.string()).optional(),
268
+ /** Extend from another config file (relative path) */
269
+ extends: import_zod6.z.string().optional(),
270
+ /** Files or directories to exclude from scan (flat array or tiered) */
271
+ exclude: import_zod6.z.union([import_zod6.z.array(import_zod6.z.string()), TieredExcludeSchema]).optional(),
272
+ /** Auto-exclusion settings for common patterns */
273
+ autoExclude: AutoExcludeSchema,
256
274
  /** Fail CI/CD if score below threshold (0-100) */
257
275
  threshold: import_zod6.z.number().optional(),
258
276
  /** Fail on issues: critical, major, any */
@@ -279,7 +297,15 @@ var AIReadyConfigSchema = import_zod6.z.object({
279
297
  compareBaseline: import_zod6.z.string().optional()
280
298
  }).optional(),
281
299
  /** Tool-specific configuration overrides (Strictly ToolName -> Config) */
282
- tools: import_zod6.z.record(import_zod6.z.string(), import_zod6.z.any()).optional(),
300
+ tools: import_zod6.z.record(
301
+ import_zod6.z.string(),
302
+ import_zod6.z.object({
303
+ /** Whether to enable this tool */
304
+ enabled: import_zod6.z.boolean().optional(),
305
+ /** Severity overrides for specific categories */
306
+ severityOverrides: import_zod6.z.record(import_zod6.z.string(), SeveritySchema).optional()
307
+ }).catchall(import_zod6.z.any())
308
+ ).optional(),
283
309
  /** Scoring profile and weights */
284
310
  scoring: import_zod6.z.object({
285
311
  /** Name of the scoring profile (e.g. "strict", "balanced") */
@@ -361,7 +387,8 @@ var GLOBAL_INFRA_OPTIONS = [
361
387
  "include",
362
388
  "exclude",
363
389
  "tools",
364
- "scoring"
390
+ "scoring",
391
+ "changedFilesOnly"
365
392
  ];
366
393
  var GLOBAL_SCAN_OPTIONS = [
367
394
  "rootDir",
@@ -372,7 +399,7 @@ var GLOBAL_SCAN_OPTIONS = [
372
399
  "output",
373
400
  "format",
374
401
  "parallel",
375
- "showBreakdown"
402
+ "changedFilesOnly"
376
403
  ];
377
404
  var COMMON_FINE_TUNING_OPTIONS = [
378
405
  "maxDepth",
@@ -45,7 +45,7 @@ import {
45
45
  getToolWeight,
46
46
  normalizeToolName,
47
47
  parseWeightString
48
- } from "../chunk-BE52N7T2.mjs";
48
+ } from "../chunk-OAH6FVVF.mjs";
49
49
  import {
50
50
  LANGUAGE_EXTENSIONS,
51
51
  Language,