@defai.digital/ax-cli 3.14.14 → 3.14.16
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/.ax-cli/CUSTOM.md +97 -0
- package/.ax-cli/auto-accept-audit.json +1302 -0
- package/.ax-cli/index.json +43 -0
- package/.ax-cli/memory.json +62 -0
- package/.ax-cli/settings.json +39 -0
- package/README.md +47 -2
- package/ax.config.json +304 -0
- package/dist/analyzers/ast/tree-sitter-parser.d.ts +134 -0
- package/dist/analyzers/ast/tree-sitter-parser.js +730 -0
- package/dist/analyzers/ast/tree-sitter-parser.js.map +1 -0
- package/dist/commands/setup.js +108 -0
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/update.js +55 -2
- package/dist/commands/update.js.map +1 -1
- package/dist/mcp/config-detector-v2.d.ts +83 -0
- package/dist/mcp/config-detector-v2.js +328 -0
- package/dist/mcp/config-detector-v2.js.map +1 -0
- package/dist/mcp/config-migrator-v2.d.ts +89 -0
- package/dist/mcp/config-migrator-v2.js +288 -0
- package/dist/mcp/config-migrator-v2.js.map +1 -0
- package/dist/mcp/config-v2.d.ts +111 -0
- package/dist/mcp/config-v2.js +443 -0
- package/dist/mcp/config-v2.js.map +1 -0
- package/dist/mcp/transports-v2.d.ts +152 -0
- package/dist/mcp/transports-v2.js +481 -0
- package/dist/mcp/transports-v2.js.map +1 -0
- package/dist/utils/error-sanitizer.d.ts +119 -0
- package/dist/utils/error-sanitizer.js +253 -0
- package/dist/utils/error-sanitizer.js.map +1 -0
- package/dist/utils/errors.d.ts +74 -0
- package/dist/utils/errors.js +139 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/incremental-analyzer.d.ts +134 -0
- package/dist/utils/incremental-analyzer.js +377 -0
- package/dist/utils/incremental-analyzer.js.map +1 -0
- package/dist/utils/math.d.ts +1 -0
- package/dist/utils/math.js +4 -0
- package/dist/utils/math.js.map +1 -0
- package/dist/utils/settings.d.ts +1 -0
- package/dist/utils/settings.js +4 -0
- package/dist/utils/settings.js.map +1 -0
- package/dist/utils/streaming-analyzer.d.ts +160 -0
- package/dist/utils/streaming-analyzer.js +214 -0
- package/dist/utils/streaming-analyzer.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tree-sitter Parser
|
|
3
|
+
*
|
|
4
|
+
* Base class for tree-sitter based language parsers.
|
|
5
|
+
* Uses WebAssembly (WASM) for cross-platform compatibility.
|
|
6
|
+
*
|
|
7
|
+
* Supports: Python, Rust, Go, TypeScript, JavaScript, HTML, CSS, and 30+ more languages
|
|
8
|
+
*/
|
|
9
|
+
import { Tree } from 'web-tree-sitter';
|
|
10
|
+
import { BaseLanguageParser, type SupportedLanguage } from './language-parser.js';
|
|
11
|
+
import type { FileASTInfo } from './types.js';
|
|
12
|
+
/**
|
|
13
|
+
* Tree-sitter based language parser
|
|
14
|
+
*/
|
|
15
|
+
export declare class TreeSitterParser extends BaseLanguageParser {
|
|
16
|
+
readonly language: SupportedLanguage;
|
|
17
|
+
private treeSitterLanguage;
|
|
18
|
+
private parser;
|
|
19
|
+
private loadedLanguage;
|
|
20
|
+
constructor(language: SupportedLanguage, treeSitterLanguage?: string);
|
|
21
|
+
private mapLanguageToTreeSitter;
|
|
22
|
+
/**
|
|
23
|
+
* Ensure parser is initialized
|
|
24
|
+
*/
|
|
25
|
+
private ensureInitialized;
|
|
26
|
+
parseFile(filePath: string): Promise<FileASTInfo>;
|
|
27
|
+
parseContent(content: string, filePath?: string): Promise<FileASTInfo>;
|
|
28
|
+
/**
|
|
29
|
+
* Extract functions from AST
|
|
30
|
+
*/
|
|
31
|
+
private extractFunctions;
|
|
32
|
+
/**
|
|
33
|
+
* Get node types that represent functions for this language
|
|
34
|
+
*/
|
|
35
|
+
private getFunctionNodeTypes;
|
|
36
|
+
/**
|
|
37
|
+
* Extract function info from a function node
|
|
38
|
+
*/
|
|
39
|
+
private extractFunctionInfo;
|
|
40
|
+
/**
|
|
41
|
+
* Extract function name
|
|
42
|
+
*/
|
|
43
|
+
private extractFunctionName;
|
|
44
|
+
/**
|
|
45
|
+
* Extract parameters from function
|
|
46
|
+
*/
|
|
47
|
+
private extractParameters;
|
|
48
|
+
/**
|
|
49
|
+
* Check if node is a parameter
|
|
50
|
+
*/
|
|
51
|
+
private isParameterNode;
|
|
52
|
+
/**
|
|
53
|
+
* Extract parameter info
|
|
54
|
+
*/
|
|
55
|
+
private extractParameterInfo;
|
|
56
|
+
/**
|
|
57
|
+
* Extract return type
|
|
58
|
+
*/
|
|
59
|
+
private extractReturnType;
|
|
60
|
+
/**
|
|
61
|
+
* Check if function is async
|
|
62
|
+
*/
|
|
63
|
+
private isAsyncFunction;
|
|
64
|
+
/**
|
|
65
|
+
* Check if function is exported
|
|
66
|
+
*/
|
|
67
|
+
private isExportedFunction;
|
|
68
|
+
/**
|
|
69
|
+
* Calculate cyclomatic complexity
|
|
70
|
+
*/
|
|
71
|
+
private calculateComplexity;
|
|
72
|
+
/**
|
|
73
|
+
* Extract classes from AST
|
|
74
|
+
*/
|
|
75
|
+
private extractClasses;
|
|
76
|
+
/**
|
|
77
|
+
* Get node types that represent classes
|
|
78
|
+
*/
|
|
79
|
+
private getClassNodeTypes;
|
|
80
|
+
/**
|
|
81
|
+
* Extract class info
|
|
82
|
+
*/
|
|
83
|
+
private extractClassInfo;
|
|
84
|
+
/**
|
|
85
|
+
* Check if class is exported
|
|
86
|
+
*/
|
|
87
|
+
private isExportedClass;
|
|
88
|
+
/**
|
|
89
|
+
* Extract methods from class
|
|
90
|
+
*/
|
|
91
|
+
private extractMethods;
|
|
92
|
+
/**
|
|
93
|
+
* Get method visibility
|
|
94
|
+
*/
|
|
95
|
+
private getVisibility;
|
|
96
|
+
/**
|
|
97
|
+
* Check if method is static
|
|
98
|
+
*/
|
|
99
|
+
private isStatic;
|
|
100
|
+
/**
|
|
101
|
+
* Extract properties from class
|
|
102
|
+
*/
|
|
103
|
+
private extractProperties;
|
|
104
|
+
/**
|
|
105
|
+
* Extract imports from AST
|
|
106
|
+
*/
|
|
107
|
+
private extractImports;
|
|
108
|
+
/**
|
|
109
|
+
* Get import node types for this language
|
|
110
|
+
*/
|
|
111
|
+
private getImportNodeTypes;
|
|
112
|
+
/**
|
|
113
|
+
* Extract import info
|
|
114
|
+
*/
|
|
115
|
+
private extractImportInfo;
|
|
116
|
+
/**
|
|
117
|
+
* Extract exports from AST
|
|
118
|
+
*/
|
|
119
|
+
private extractExports;
|
|
120
|
+
/**
|
|
121
|
+
* Get the raw syntax tree (for advanced usage)
|
|
122
|
+
*/
|
|
123
|
+
getTree(content: string): Promise<Tree | null>;
|
|
124
|
+
dispose(): void;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Create a parser for a specific language
|
|
128
|
+
*/
|
|
129
|
+
export declare function createTreeSitterParser(language: SupportedLanguage): TreeSitterParser;
|
|
130
|
+
/**
|
|
131
|
+
* Supported tree-sitter languages (beyond our core 5)
|
|
132
|
+
*/
|
|
133
|
+
export declare const TREE_SITTER_LANGUAGES: readonly ["bash", "c", "cpp", "c_sharp", "css", "dart", "elixir", "elm", "go", "html", "java", "javascript", "json", "kotlin", "lua", "objc", "ocaml", "php", "python", "ruby", "rust", "scala", "solidity", "swift", "toml", "tsx", "typescript", "vue", "yaml", "zig"];
|
|
134
|
+
export type TreeSitterLanguage = typeof TREE_SITTER_LANGUAGES[number];
|