circle-ir 3.4.0 → 3.8.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.
- package/configs/sinks/python.json +9 -0
- package/configs/sources/python.json +57 -17
- package/dist/analysis/taint-matcher.js +43 -0
- package/dist/analysis/taint-matcher.js.map +1 -1
- package/dist/analyzer.js +424 -2
- package/dist/analyzer.js.map +1 -1
- package/dist/browser/circle-ir.js +693 -1
- package/dist/core/circle-ir-core.cjs +122 -0
- package/dist/core/circle-ir-core.js +122 -0
- package/dist/core/extractors/calls.js +119 -0
- package/dist/core/extractors/calls.js.map +1 -1
- package/dist/core/parser.d.ts +1 -1
- package/dist/languages/plugins/bash.d.ts +51 -0
- package/dist/languages/plugins/bash.js +243 -0
- package/dist/languages/plugins/bash.js.map +1 -0
- package/dist/languages/plugins/index.d.ts +1 -0
- package/dist/languages/plugins/index.js +3 -0
- package/dist/languages/plugins/index.js.map +1 -1
- package/dist/languages/types.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/wasm/tree-sitter-bash.wasm +0 -0
- package/package.json +2 -1
- package/wasm/tree-sitter-bash.wasm +0 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bash/Shell Language Plugin
|
|
3
|
+
*
|
|
4
|
+
* Provides Bash-specific AST handling and taint patterns for Shell scripts.
|
|
5
|
+
*/
|
|
6
|
+
import type { Node as SyntaxNode } from 'web-tree-sitter';
|
|
7
|
+
import type { TypeInfo, CallInfo, ImportInfo } from '../../types/index.js';
|
|
8
|
+
import type { LanguageNodeTypes, ExtractionContext, FrameworkInfo, TaintSourcePattern, TaintSinkPattern } from '../types.js';
|
|
9
|
+
import { BaseLanguagePlugin } from './base.js';
|
|
10
|
+
/**
|
|
11
|
+
* Bash/Shell language plugin implementation.
|
|
12
|
+
*/
|
|
13
|
+
export declare class BashPlugin extends BaseLanguagePlugin {
|
|
14
|
+
readonly id: "bash";
|
|
15
|
+
readonly name = "Bash/Shell";
|
|
16
|
+
readonly extensions: string[];
|
|
17
|
+
readonly wasmPath = "tree-sitter-bash.wasm";
|
|
18
|
+
readonly nodeTypes: LanguageNodeTypes;
|
|
19
|
+
/**
|
|
20
|
+
* Shell scripts don't have a formal framework concept.
|
|
21
|
+
*/
|
|
22
|
+
detectFramework(_context: ExtractionContext): FrameworkInfo | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Bash taint source patterns.
|
|
25
|
+
* In shell, tainted data enters via `read` (stdin).
|
|
26
|
+
* curl/wget are excluded as sources (see comment in implementation).
|
|
27
|
+
*/
|
|
28
|
+
getBuiltinSources(): TaintSourcePattern[];
|
|
29
|
+
/**
|
|
30
|
+
* Bash taint sink patterns.
|
|
31
|
+
* Key sinks: eval (CWE-94), bash/sh -c (CWE-78), DB clients (CWE-89),
|
|
32
|
+
* file operations (CWE-22), SSRF via curl/wget (CWE-918).
|
|
33
|
+
*/
|
|
34
|
+
getBuiltinSinks(): TaintSinkPattern[];
|
|
35
|
+
/**
|
|
36
|
+
* Shell has no OOP receiver types.
|
|
37
|
+
*/
|
|
38
|
+
getReceiverType(_node: SyntaxNode, _context: ExtractionContext): string | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* Bash string literals: quoted strings and raw ($'...') strings.
|
|
41
|
+
*/
|
|
42
|
+
isStringLiteral(node: SyntaxNode): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Extract string value from bash string literal, stripping quotes.
|
|
45
|
+
*/
|
|
46
|
+
getStringValue(node: SyntaxNode): string | undefined;
|
|
47
|
+
extractTypes(_context: ExtractionContext): TypeInfo[];
|
|
48
|
+
extractCalls(_context: ExtractionContext): CallInfo[];
|
|
49
|
+
extractImports(_context: ExtractionContext): ImportInfo[];
|
|
50
|
+
extractPackage(_context: ExtractionContext): string | undefined;
|
|
51
|
+
}
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bash/Shell Language Plugin
|
|
3
|
+
*
|
|
4
|
+
* Provides Bash-specific AST handling and taint patterns for Shell scripts.
|
|
5
|
+
*/
|
|
6
|
+
import { BaseLanguagePlugin } from './base.js';
|
|
7
|
+
/**
|
|
8
|
+
* Bash/Shell language plugin implementation.
|
|
9
|
+
*/
|
|
10
|
+
export class BashPlugin extends BaseLanguagePlugin {
|
|
11
|
+
id = 'bash';
|
|
12
|
+
name = 'Bash/Shell';
|
|
13
|
+
extensions = ['.sh', '.bash', '.zsh', '.ksh'];
|
|
14
|
+
wasmPath = 'tree-sitter-bash.wasm';
|
|
15
|
+
nodeTypes = {
|
|
16
|
+
// Type declarations — shell has no OOP types
|
|
17
|
+
classDeclaration: [],
|
|
18
|
+
interfaceDeclaration: [],
|
|
19
|
+
enumDeclaration: [],
|
|
20
|
+
functionDeclaration: ['function_definition'],
|
|
21
|
+
methodDeclaration: ['function_definition'],
|
|
22
|
+
// Expressions — commands are treated as calls
|
|
23
|
+
methodCall: ['command'],
|
|
24
|
+
functionCall: ['command'],
|
|
25
|
+
assignment: ['variable_assignment'],
|
|
26
|
+
variableDeclaration: ['variable_assignment', 'declaration_command'],
|
|
27
|
+
// Parameters and arguments — positional args are child words
|
|
28
|
+
parameter: [],
|
|
29
|
+
argument: [],
|
|
30
|
+
// Annotations/decorators — none in shell
|
|
31
|
+
annotation: [],
|
|
32
|
+
decorator: [],
|
|
33
|
+
// Imports — shell uses `source` / `.` but no formal import system
|
|
34
|
+
importStatement: [],
|
|
35
|
+
// Control flow
|
|
36
|
+
ifStatement: ['if_statement'],
|
|
37
|
+
forStatement: ['for_statement', 'c_style_for_statement'],
|
|
38
|
+
whileStatement: ['while_statement'],
|
|
39
|
+
tryStatement: [],
|
|
40
|
+
returnStatement: [],
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Shell scripts don't have a formal framework concept.
|
|
44
|
+
*/
|
|
45
|
+
detectFramework(_context) {
|
|
46
|
+
return undefined;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Bash taint source patterns.
|
|
50
|
+
* In shell, tainted data enters via `read` (stdin).
|
|
51
|
+
* curl/wget are excluded as sources (see comment in implementation).
|
|
52
|
+
*/
|
|
53
|
+
getBuiltinSources() {
|
|
54
|
+
return [
|
|
55
|
+
// read built-in reads user input from stdin.
|
|
56
|
+
// curl/wget are intentionally excluded: they're also registered as sinks (SSRF),
|
|
57
|
+
// and without DFG tracking of $() command substitution, including them as sources
|
|
58
|
+
// would generate false positives for safe curl calls.
|
|
59
|
+
{
|
|
60
|
+
method: 'read',
|
|
61
|
+
type: 'io_input',
|
|
62
|
+
severity: 'high',
|
|
63
|
+
confidence: 0.9,
|
|
64
|
+
returnTainted: true,
|
|
65
|
+
},
|
|
66
|
+
];
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Bash taint sink patterns.
|
|
70
|
+
* Key sinks: eval (CWE-94), bash/sh -c (CWE-78), DB clients (CWE-89),
|
|
71
|
+
* file operations (CWE-22), SSRF via curl/wget (CWE-918).
|
|
72
|
+
*/
|
|
73
|
+
getBuiltinSinks() {
|
|
74
|
+
return [
|
|
75
|
+
// Code / command injection via eval
|
|
76
|
+
{
|
|
77
|
+
method: 'eval',
|
|
78
|
+
type: 'code_injection',
|
|
79
|
+
cwe: 'CWE-94',
|
|
80
|
+
severity: 'critical',
|
|
81
|
+
argPositions: [0],
|
|
82
|
+
},
|
|
83
|
+
// Command injection: spawning a sub-shell with -c flag
|
|
84
|
+
{
|
|
85
|
+
method: 'bash',
|
|
86
|
+
type: 'command_injection',
|
|
87
|
+
cwe: 'CWE-78',
|
|
88
|
+
severity: 'critical',
|
|
89
|
+
argPositions: [1],
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
method: 'sh',
|
|
93
|
+
type: 'command_injection',
|
|
94
|
+
cwe: 'CWE-78',
|
|
95
|
+
severity: 'critical',
|
|
96
|
+
argPositions: [1],
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
method: 'zsh',
|
|
100
|
+
type: 'command_injection',
|
|
101
|
+
cwe: 'CWE-78',
|
|
102
|
+
severity: 'critical',
|
|
103
|
+
argPositions: [1],
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
method: 'ksh',
|
|
107
|
+
type: 'command_injection',
|
|
108
|
+
cwe: 'CWE-78',
|
|
109
|
+
severity: 'critical',
|
|
110
|
+
argPositions: [1],
|
|
111
|
+
},
|
|
112
|
+
// SQL injection via DB CLI clients (first arg is query/expression)
|
|
113
|
+
{
|
|
114
|
+
method: 'mysql',
|
|
115
|
+
type: 'sql_injection',
|
|
116
|
+
cwe: 'CWE-89',
|
|
117
|
+
severity: 'critical',
|
|
118
|
+
argPositions: [1],
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
method: 'psql',
|
|
122
|
+
type: 'sql_injection',
|
|
123
|
+
cwe: 'CWE-89',
|
|
124
|
+
severity: 'critical',
|
|
125
|
+
argPositions: [1],
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
method: 'sqlite3',
|
|
129
|
+
type: 'sql_injection',
|
|
130
|
+
cwe: 'CWE-89',
|
|
131
|
+
severity: 'critical',
|
|
132
|
+
argPositions: [1],
|
|
133
|
+
},
|
|
134
|
+
// Path traversal via file operations (first arg is path)
|
|
135
|
+
{
|
|
136
|
+
method: 'cat',
|
|
137
|
+
type: 'path_traversal',
|
|
138
|
+
cwe: 'CWE-22',
|
|
139
|
+
severity: 'high',
|
|
140
|
+
argPositions: [0],
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
method: 'rm',
|
|
144
|
+
type: 'path_traversal',
|
|
145
|
+
cwe: 'CWE-22',
|
|
146
|
+
severity: 'high',
|
|
147
|
+
argPositions: [0],
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
method: 'cp',
|
|
151
|
+
type: 'path_traversal',
|
|
152
|
+
cwe: 'CWE-22',
|
|
153
|
+
severity: 'high',
|
|
154
|
+
argPositions: [0],
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
method: 'mv',
|
|
158
|
+
type: 'path_traversal',
|
|
159
|
+
cwe: 'CWE-22',
|
|
160
|
+
severity: 'high',
|
|
161
|
+
argPositions: [0],
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
method: 'chmod',
|
|
165
|
+
type: 'path_traversal',
|
|
166
|
+
cwe: 'CWE-22',
|
|
167
|
+
severity: 'medium',
|
|
168
|
+
argPositions: [1],
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
method: 'chown',
|
|
172
|
+
type: 'path_traversal',
|
|
173
|
+
cwe: 'CWE-22',
|
|
174
|
+
severity: 'medium',
|
|
175
|
+
argPositions: [1],
|
|
176
|
+
},
|
|
177
|
+
// SSRF — curl/wget with externally-controlled URL
|
|
178
|
+
{
|
|
179
|
+
method: 'curl',
|
|
180
|
+
type: 'ssrf',
|
|
181
|
+
cwe: 'CWE-918',
|
|
182
|
+
severity: 'high',
|
|
183
|
+
argPositions: [0],
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
method: 'wget',
|
|
187
|
+
type: 'ssrf',
|
|
188
|
+
cwe: 'CWE-918',
|
|
189
|
+
severity: 'high',
|
|
190
|
+
argPositions: [0],
|
|
191
|
+
},
|
|
192
|
+
];
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Shell has no OOP receiver types.
|
|
196
|
+
*/
|
|
197
|
+
getReceiverType(_node, _context) {
|
|
198
|
+
return undefined;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Bash string literals: quoted strings and raw ($'...') strings.
|
|
202
|
+
*/
|
|
203
|
+
isStringLiteral(node) {
|
|
204
|
+
return (node.type === 'string' ||
|
|
205
|
+
node.type === 'raw_string' ||
|
|
206
|
+
node.type === 'ansi_c_string');
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Extract string value from bash string literal, stripping quotes.
|
|
210
|
+
*/
|
|
211
|
+
getStringValue(node) {
|
|
212
|
+
if (!this.isStringLiteral(node))
|
|
213
|
+
return undefined;
|
|
214
|
+
const text = node.text;
|
|
215
|
+
// raw_string: 'content' → strip single quotes
|
|
216
|
+
if (node.type === 'raw_string') {
|
|
217
|
+
return text.slice(1, -1);
|
|
218
|
+
}
|
|
219
|
+
// ansi_c_string: $'content' → strip $' and '
|
|
220
|
+
if (node.type === 'ansi_c_string') {
|
|
221
|
+
return text.slice(2, -1);
|
|
222
|
+
}
|
|
223
|
+
// string: "content" → strip double quotes
|
|
224
|
+
const match = text.match(/^"(.*)"$/s);
|
|
225
|
+
if (match)
|
|
226
|
+
return match[1];
|
|
227
|
+
return text;
|
|
228
|
+
}
|
|
229
|
+
// Extraction methods — delegate to base extractors via generic walker
|
|
230
|
+
extractTypes(_context) {
|
|
231
|
+
return [];
|
|
232
|
+
}
|
|
233
|
+
extractCalls(_context) {
|
|
234
|
+
return [];
|
|
235
|
+
}
|
|
236
|
+
extractImports(_context) {
|
|
237
|
+
return [];
|
|
238
|
+
}
|
|
239
|
+
extractPackage(_context) {
|
|
240
|
+
return undefined;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
//# sourceMappingURL=bash.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bash.js","sourceRoot":"","sources":["../../../src/languages/plugins/bash.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAeH,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE/C;;GAEG;AACH,MAAM,OAAO,UAAW,SAAQ,kBAAkB;IACvC,EAAE,GAAG,MAAe,CAAC;IACrB,IAAI,GAAG,YAAY,CAAC;IACpB,UAAU,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9C,QAAQ,GAAG,uBAAuB,CAAC;IAEnC,SAAS,GAAsB;QACtC,6CAA6C;QAC7C,gBAAgB,EAAE,EAAE;QACpB,oBAAoB,EAAE,EAAE;QACxB,eAAe,EAAE,EAAE;QACn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AC1B,IAAI,CAAC,IAAI,KAAK,eAAe,CAC9B,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,cAAc,CAAC,IAAgB;QAC7B,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC;YAAE,OAAO,SAAS,CAAC;QAElD,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACvB,8CAA8C;QAC9C,IAAI,IAAI,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;YAC/B,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC3B,CAAC;QACD,6CAA6C;QAC7C,IAAI,IAAI,CAAC,IAAI,KAAK,eAAe,EAAE,CAAC;YAClC,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC3B,CAAC;QACD,0CAA0C;QAC1C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QACtC,IAAI,KAAK;YAAE,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;QAE3B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,sEAAsE;IAEtE,YAAY,CAAC,QAA2B;QACtC,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,YAAY,CAAC,QAA2B;QACtC,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,cAAc,CAAC,QAA2B;QACxC,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,cAAc,CAAC,QAA2B;QACxC,OAAO,SAAS,CAAC;IACnB,CAAC;CACF"}
|
|
@@ -7,6 +7,7 @@ export { JavaPlugin } from './java.js';
|
|
|
7
7
|
export { JavaScriptPlugin } from './javascript.js';
|
|
8
8
|
export { PythonPlugin } from './python.js';
|
|
9
9
|
export { RustPlugin } from './rust.js';
|
|
10
|
+
export { BashPlugin } from './bash.js';
|
|
10
11
|
/**
|
|
11
12
|
* Register all built-in language plugins with the global registry.
|
|
12
13
|
* Call this during analyzer initialization.
|
|
@@ -7,11 +7,13 @@ export { JavaPlugin } from './java.js';
|
|
|
7
7
|
export { JavaScriptPlugin } from './javascript.js';
|
|
8
8
|
export { PythonPlugin } from './python.js';
|
|
9
9
|
export { RustPlugin } from './rust.js';
|
|
10
|
+
export { BashPlugin } from './bash.js';
|
|
10
11
|
import { registerLanguage } from '../registry.js';
|
|
11
12
|
import { JavaPlugin } from './java.js';
|
|
12
13
|
import { JavaScriptPlugin } from './javascript.js';
|
|
13
14
|
import { PythonPlugin } from './python.js';
|
|
14
15
|
import { RustPlugin } from './rust.js';
|
|
16
|
+
import { BashPlugin } from './bash.js';
|
|
15
17
|
/**
|
|
16
18
|
* Register all built-in language plugins with the global registry.
|
|
17
19
|
* Call this during analyzer initialization.
|
|
@@ -21,5 +23,6 @@ export function registerBuiltinPlugins() {
|
|
|
21
23
|
registerLanguage(new JavaScriptPlugin());
|
|
22
24
|
registerLanguage(new PythonPlugin());
|
|
23
25
|
registerLanguage(new RustPlugin());
|
|
26
|
+
registerLanguage(new BashPlugin());
|
|
24
27
|
}
|
|
25
28
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/languages/plugins/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,UA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CAAC"}
|
|
@@ -9,7 +9,7 @@ import type { TypeInfo, CallInfo, ImportInfo } from '../types/index.js';
|
|
|
9
9
|
/**
|
|
10
10
|
* Supported languages for analysis
|
|
11
11
|
*/
|
|
12
|
-
export type SupportedLanguage = 'java' | 'javascript' | 'typescript' | 'python' | 'rust';
|
|
12
|
+
export type SupportedLanguage = 'java' | 'c' | 'cpp' | 'javascript' | 'typescript' | 'python' | 'rust' | 'bash';
|
|
13
13
|
/**
|
|
14
14
|
* AST node type mappings for a language
|
|
15
15
|
*/
|
package/dist/types/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* These types conform to docs/SPEC.md
|
|
5
5
|
*/
|
|
6
|
-
export type SupportedLanguage = "java" | "c" | "cpp" | "javascript" | "typescript" | "python" | "rust";
|
|
6
|
+
export type SupportedLanguage = "java" | "c" | "cpp" | "javascript" | "typescript" | "python" | "rust" | "bash";
|
|
7
7
|
export interface Meta {
|
|
8
8
|
circle_ir: "3.0";
|
|
9
9
|
file: string;
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "circle-ir",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.8.0",
|
|
4
4
|
"description": "High-performance Static Application Security Testing (SAST) library for detecting security vulnerabilities through taint analysis",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -95,6 +95,7 @@
|
|
|
95
95
|
"@types/unzipper": "^0.10.11",
|
|
96
96
|
"@vitest/coverage-v8": "^3.0.0",
|
|
97
97
|
"esbuild": "^0.27.2",
|
|
98
|
+
"tree-sitter-bash": "^0.25.1",
|
|
98
99
|
"tree-sitter-java": "^0.23.5",
|
|
99
100
|
"tree-sitter-python": "^0.25.0",
|
|
100
101
|
"tree-sitter-rust": "^0.24.0",
|
|
Binary file
|