tree-sitter-analyzer 0.1.3__py3-none-any.whl → 0.3.0__py3-none-any.whl

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.

Potentially problematic release.


This version of tree-sitter-analyzer might be problematic. Click here for more details.

Files changed (79) hide show
  1. tree_sitter_analyzer/__init__.py +133 -121
  2. tree_sitter_analyzer/__main__.py +11 -12
  3. tree_sitter_analyzer/api.py +531 -539
  4. tree_sitter_analyzer/cli/__init__.py +39 -39
  5. tree_sitter_analyzer/cli/__main__.py +12 -13
  6. tree_sitter_analyzer/cli/commands/__init__.py +26 -27
  7. tree_sitter_analyzer/cli/commands/advanced_command.py +88 -88
  8. tree_sitter_analyzer/cli/commands/base_command.py +160 -155
  9. tree_sitter_analyzer/cli/commands/default_command.py +18 -19
  10. tree_sitter_analyzer/cli/commands/partial_read_command.py +141 -133
  11. tree_sitter_analyzer/cli/commands/query_command.py +81 -82
  12. tree_sitter_analyzer/cli/commands/structure_command.py +138 -121
  13. tree_sitter_analyzer/cli/commands/summary_command.py +101 -93
  14. tree_sitter_analyzer/cli/commands/table_command.py +232 -233
  15. tree_sitter_analyzer/cli/info_commands.py +120 -121
  16. tree_sitter_analyzer/cli_main.py +277 -276
  17. tree_sitter_analyzer/core/__init__.py +15 -20
  18. tree_sitter_analyzer/core/analysis_engine.py +591 -574
  19. tree_sitter_analyzer/core/cache_service.py +320 -330
  20. tree_sitter_analyzer/core/engine.py +557 -560
  21. tree_sitter_analyzer/core/parser.py +293 -288
  22. tree_sitter_analyzer/core/query.py +494 -502
  23. tree_sitter_analyzer/encoding_utils.py +458 -460
  24. tree_sitter_analyzer/exceptions.py +337 -340
  25. tree_sitter_analyzer/file_handler.py +217 -222
  26. tree_sitter_analyzer/formatters/__init__.py +1 -1
  27. tree_sitter_analyzer/formatters/base_formatter.py +167 -168
  28. tree_sitter_analyzer/formatters/formatter_factory.py +78 -74
  29. tree_sitter_analyzer/formatters/java_formatter.py +287 -270
  30. tree_sitter_analyzer/formatters/python_formatter.py +255 -235
  31. tree_sitter_analyzer/interfaces/__init__.py +9 -10
  32. tree_sitter_analyzer/interfaces/cli.py +528 -557
  33. tree_sitter_analyzer/interfaces/cli_adapter.py +322 -319
  34. tree_sitter_analyzer/interfaces/mcp_adapter.py +180 -170
  35. tree_sitter_analyzer/interfaces/mcp_server.py +405 -416
  36. tree_sitter_analyzer/java_analyzer.py +218 -219
  37. tree_sitter_analyzer/language_detector.py +398 -400
  38. tree_sitter_analyzer/language_loader.py +224 -228
  39. tree_sitter_analyzer/languages/__init__.py +10 -11
  40. tree_sitter_analyzer/languages/java_plugin.py +1129 -1113
  41. tree_sitter_analyzer/languages/python_plugin.py +737 -712
  42. tree_sitter_analyzer/mcp/__init__.py +31 -32
  43. tree_sitter_analyzer/mcp/resources/__init__.py +44 -47
  44. tree_sitter_analyzer/mcp/resources/code_file_resource.py +212 -213
  45. tree_sitter_analyzer/mcp/resources/project_stats_resource.py +560 -550
  46. tree_sitter_analyzer/mcp/server.py +333 -345
  47. tree_sitter_analyzer/mcp/tools/__init__.py +30 -31
  48. tree_sitter_analyzer/mcp/tools/analyze_scale_tool.py +621 -557
  49. tree_sitter_analyzer/mcp/tools/analyze_scale_tool_cli_compatible.py +242 -245
  50. tree_sitter_analyzer/mcp/tools/base_tool.py +54 -55
  51. tree_sitter_analyzer/mcp/tools/read_partial_tool.py +300 -302
  52. tree_sitter_analyzer/mcp/tools/table_format_tool.py +362 -359
  53. tree_sitter_analyzer/mcp/tools/universal_analyze_tool.py +543 -476
  54. tree_sitter_analyzer/mcp/utils/__init__.py +105 -106
  55. tree_sitter_analyzer/mcp/utils/error_handler.py +549 -549
  56. tree_sitter_analyzer/models.py +470 -481
  57. tree_sitter_analyzer/output_manager.py +261 -264
  58. tree_sitter_analyzer/plugins/__init__.py +333 -334
  59. tree_sitter_analyzer/plugins/base.py +477 -446
  60. tree_sitter_analyzer/plugins/java_plugin.py +608 -625
  61. tree_sitter_analyzer/plugins/javascript_plugin.py +446 -439
  62. tree_sitter_analyzer/plugins/manager.py +362 -355
  63. tree_sitter_analyzer/plugins/plugin_loader.py +85 -83
  64. tree_sitter_analyzer/plugins/python_plugin.py +606 -598
  65. tree_sitter_analyzer/plugins/registry.py +374 -366
  66. tree_sitter_analyzer/queries/__init__.py +26 -27
  67. tree_sitter_analyzer/queries/java.py +391 -394
  68. tree_sitter_analyzer/queries/javascript.py +148 -149
  69. tree_sitter_analyzer/queries/python.py +285 -286
  70. tree_sitter_analyzer/queries/typescript.py +229 -230
  71. tree_sitter_analyzer/query_loader.py +254 -260
  72. tree_sitter_analyzer/table_formatter.py +468 -448
  73. tree_sitter_analyzer/utils.py +277 -277
  74. tree_sitter_analyzer-0.3.0.dist-info/METADATA +346 -0
  75. tree_sitter_analyzer-0.3.0.dist-info/RECORD +77 -0
  76. tree_sitter_analyzer-0.1.3.dist-info/METADATA +0 -444
  77. tree_sitter_analyzer-0.1.3.dist-info/RECORD +0 -77
  78. {tree_sitter_analyzer-0.1.3.dist-info → tree_sitter_analyzer-0.3.0.dist-info}/WHEEL +0 -0
  79. {tree_sitter_analyzer-0.1.3.dist-info → tree_sitter_analyzer-0.3.0.dist-info}/entry_points.txt +0 -0
@@ -1,286 +1,285 @@
1
- #!/usr/bin/env python3
2
- # -*- coding: utf-8 -*-
3
- """
4
- Python Tree-sitter queries for code analysis.
5
- """
6
-
7
- # Function definitions
8
- FUNCTIONS = """
9
- (function_definition
10
- name: (identifier) @function.name
11
- parameters: (parameters) @function.params
12
- body: (block) @function.body) @function.definition
13
-
14
- (function_definition
15
- name: (identifier) @function.name
16
- parameters: (parameters) @function.params
17
- body: (block) @function.body) @function.async
18
- """
19
-
20
- # Class definitions
21
- CLASSES = """
22
- (class_definition
23
- name: (identifier) @class.name
24
- superclasses: (argument_list)? @class.superclasses
25
- body: (block) @class.body) @class.definition
26
- """
27
-
28
- # Import statements
29
- IMPORTS = """
30
- (import_statement
31
- name: (dotted_name) @import.name) @import.statement
32
-
33
- (import_from_statement
34
- module_name: (dotted_name)? @import.module
35
- name: (dotted_name) @import.name) @import.from
36
-
37
- (import_from_statement
38
- module_name: (dotted_name)? @import.module
39
- name: (import_list) @import.list) @import.from_list
40
-
41
- (aliased_import
42
- name: (dotted_name) @import.name
43
- alias: (identifier) @import.alias) @import.aliased
44
- """
45
-
46
- # Variable assignments
47
- VARIABLES = """
48
- (assignment
49
- left: (identifier) @variable.name
50
- right: (_) @variable.value) @variable.assignment
51
-
52
- (assignment
53
- left: (pattern_list) @variable.pattern
54
- right: (_) @variable.value) @variable.multiple
55
-
56
- (augmented_assignment
57
- left: (identifier) @variable.name
58
- right: (_) @variable.value) @variable.augmented
59
- """
60
-
61
- # Decorators
62
- DECORATORS = """
63
- (decorator
64
- (identifier) @decorator.name) @decorator.simple
65
-
66
- (decorator
67
- (call
68
- function: (identifier) @decorator.name
69
- arguments: (argument_list) @decorator.args)) @decorator.call
70
-
71
- (decorator
72
- (attribute
73
- object: (identifier) @decorator.object
74
- attribute: (identifier) @decorator.name)) @decorator.attribute
75
- """
76
-
77
- # Method definitions
78
- METHODS = """
79
- (function_definition
80
- name: (identifier) @method.name
81
- parameters: (parameters
82
- (identifier) @method.self
83
- . (_)*) @method.params
84
- body: (block) @method.body) @method.definition
85
- """
86
-
87
- # Exception handling
88
- EXCEPTIONS = """
89
- (try_statement
90
- body: (block) @try.body
91
- (except_clause
92
- type: (_)? @except.type
93
- name: (identifier)? @except.name
94
- body: (block) @except.body)*
95
- (else_clause
96
- body: (block) @else.body)?
97
- (finally_clause
98
- body: (block) @finally.body)?) @try.statement
99
-
100
- (raise_statement
101
- (call
102
- function: (identifier) @exception.name
103
- arguments: (argument_list)? @exception.args)) @raise.statement
104
- """
105
-
106
- # Comprehensions
107
- COMPREHENSIONS = """
108
- (list_comprehension
109
- body: (_) @comprehension.body
110
- (for_in_clause
111
- left: (_) @comprehension.var
112
- right: (_) @comprehension.iter)) @list.comprehension
113
-
114
- (dictionary_comprehension
115
- body: (pair
116
- key: (_) @comprehension.key
117
- value: (_) @comprehension.value)
118
- (for_in_clause
119
- left: (_) @comprehension.var
120
- right: (_) @comprehension.iter)) @dict.comprehension
121
-
122
- (set_comprehension
123
- body: (_) @comprehension.body
124
- (for_in_clause
125
- left: (_) @comprehension.var
126
- right: (_) @comprehension.iter)) @set.comprehension
127
- """
128
-
129
- # Comments and docstrings
130
- COMMENTS = """
131
- (comment) @comment
132
-
133
- (expression_statement
134
- (string) @docstring)
135
- """
136
-
137
- # Type hints and annotations
138
- TYPE_HINTS = """
139
- (function_definition
140
- parameters: (parameters
141
- (typed_parameter
142
- type: (_) @type.param)) @type.function_param)
143
-
144
- (function_definition
145
- return_type: (_) @type.return) @type.function_return
146
-
147
- (assignment
148
- type: (_) @type.variable) @type.variable_annotation
149
- """
150
-
151
- # Async/await patterns
152
- ASYNC_PATTERNS = """
153
- (function_definition) @async.function
154
-
155
- (await
156
- (call) @async.await_call) @async.await
157
-
158
- (async_for_statement) @async.for
159
-
160
- (async_with_statement) @async.with
161
- """
162
-
163
- # F-strings and string formatting
164
- STRING_FORMATTING = """
165
- (formatted_string
166
- (interpolation) @string.interpolation) @string.fstring
167
-
168
- (call
169
- function: (attribute
170
- object: (_)
171
- attribute: (identifier) @string.format_method))
172
- """
173
-
174
- # Context managers
175
- CONTEXT_MANAGERS = """
176
- (with_statement
177
- (with_clause
178
- (with_item
179
- value: (_) @context.manager)) @context.clause) @context.with
180
-
181
- (async_with_statement
182
- (with_clause
183
- (with_item
184
- value: (_) @context.manager)) @context.clause) @context.async_with
185
- """
186
-
187
- # Lambda expressions
188
- LAMBDAS = """
189
- (lambda
190
- parameters: (lambda_parameters)? @lambda.params
191
- body: (_) @lambda.body) @lambda.expression
192
- """
193
-
194
- # Modern Python patterns
195
- MODERN_PATTERNS = """
196
- (match_statement
197
- subject: (_) @match.subject
198
- body: (case_clause)+ @match.cases) @pattern.match
199
-
200
- (case_clause
201
- pattern: (_) @case.pattern
202
- guard: (_)? @case.guard
203
- consequence: (block) @case.body) @pattern.case
204
-
205
- (walrus_operator
206
- left: (_) @walrus.target
207
- right: (_) @walrus.value) @assignment.walrus
208
- """
209
-
210
- # All queries combined
211
- ALL_QUERIES = {
212
- "functions": {
213
- "query": FUNCTIONS,
214
- "description": "すべての関数定義(async含む)を検索",
215
- },
216
- "classes": {"query": CLASSES, "description": "すべてのクラス定義を検索"},
217
- "imports": {"query": IMPORTS, "description": "すべてのインポート文を検索"},
218
- "variables": {"query": VARIABLES, "description": "すべての変数代入を検索"},
219
- "decorators": {"query": DECORATORS, "description": "すべてのデコレータを検索"},
220
- "methods": {
221
- "query": METHODS,
222
- "description": "クラス内のすべてのメソッド定義を検索",
223
- },
224
- "exceptions": {
225
- "query": EXCEPTIONS,
226
- "description": "例外処理とraise文を検索",
227
- },
228
- "comprehensions": {
229
- "query": COMPREHENSIONS,
230
- "description": "リスト、辞書、セット内包表記を検索",
231
- },
232
- "comments": {"query": COMMENTS, "description": "コメントとdocstringを検索"},
233
- "type_hints": {
234
- "query": TYPE_HINTS,
235
- "description": "型ヒントとアノテーションを検索",
236
- },
237
- "async_patterns": {
238
- "query": ASYNC_PATTERNS,
239
- "description": "async/awaitパターンを検索",
240
- },
241
- "string_formatting": {
242
- "query": STRING_FORMATTING,
243
- "description": "f文字列と文字列フォーマットを検索",
244
- },
245
- "context_managers": {
246
- "query": CONTEXT_MANAGERS,
247
- "description": "コンテキストマネージャー(with文)を検索",
248
- },
249
- "lambdas": {"query": LAMBDAS, "description": "ラムダ式を検索"},
250
- "modern_patterns": {
251
- "query": MODERN_PATTERNS,
252
- "description": "モダンなPythonパターン(match/case、セイウチ演算子)を検索",
253
- },
254
- # Convenience aliases
255
- "function_names": {
256
- "query": FUNCTIONS,
257
- "description": "関数のエイリアス - すべての関数定義を検索",
258
- },
259
- "class_names": {
260
- "query": CLASSES,
261
- "description": "クラスのエイリアス - すべてのクラス定義を検索",
262
- },
263
- "all_declarations": {
264
- "query": FUNCTIONS + "\n\n" + CLASSES + "\n\n" + VARIABLES,
265
- "description": "すべての関数、クラス、変数宣言を検索",
266
- },
267
- }
268
-
269
-
270
- def get_query(name: str) -> str:
271
- """Get a specific query by name."""
272
- if name in ALL_QUERIES:
273
- return ALL_QUERIES[name]["query"]
274
- raise ValueError(
275
- f"Query '{name}' not found. Available queries: {list(ALL_QUERIES.keys())}"
276
- )
277
-
278
-
279
- def get_all_queries() -> dict:
280
- """Get all available queries."""
281
- return ALL_QUERIES
282
-
283
-
284
- def list_queries() -> list:
285
- """List all available query names."""
286
- return list(ALL_QUERIES.keys())
1
+ #!/usr/bin/env python3
2
+ """
3
+ Python Tree-sitter queries for code analysis.
4
+ """
5
+
6
+ # Function definitions
7
+ FUNCTIONS = """
8
+ (function_definition
9
+ name: (identifier) @function.name
10
+ parameters: (parameters) @function.params
11
+ body: (block) @function.body) @function.definition
12
+
13
+ (function_definition
14
+ name: (identifier) @function.name
15
+ parameters: (parameters) @function.params
16
+ body: (block) @function.body) @function.async
17
+ """
18
+
19
+ # Class definitions
20
+ CLASSES = """
21
+ (class_definition
22
+ name: (identifier) @class.name
23
+ superclasses: (argument_list)? @class.superclasses
24
+ body: (block) @class.body) @class.definition
25
+ """
26
+
27
+ # Import statements
28
+ IMPORTS = """
29
+ (import_statement
30
+ name: (dotted_name) @import.name) @import.statement
31
+
32
+ (import_from_statement
33
+ module_name: (dotted_name)? @import.module
34
+ name: (dotted_name) @import.name) @import.from
35
+
36
+ (import_from_statement
37
+ module_name: (dotted_name)? @import.module
38
+ name: (import_list) @import.list) @import.from_list
39
+
40
+ (aliased_import
41
+ name: (dotted_name) @import.name
42
+ alias: (identifier) @import.alias) @import.aliased
43
+ """
44
+
45
+ # Variable assignments
46
+ VARIABLES = """
47
+ (assignment
48
+ left: (identifier) @variable.name
49
+ right: (_) @variable.value) @variable.assignment
50
+
51
+ (assignment
52
+ left: (pattern_list) @variable.pattern
53
+ right: (_) @variable.value) @variable.multiple
54
+
55
+ (augmented_assignment
56
+ left: (identifier) @variable.name
57
+ right: (_) @variable.value) @variable.augmented
58
+ """
59
+
60
+ # Decorators
61
+ DECORATORS = """
62
+ (decorator
63
+ (identifier) @decorator.name) @decorator.simple
64
+
65
+ (decorator
66
+ (call
67
+ function: (identifier) @decorator.name
68
+ arguments: (argument_list) @decorator.args)) @decorator.call
69
+
70
+ (decorator
71
+ (attribute
72
+ object: (identifier) @decorator.object
73
+ attribute: (identifier) @decorator.name)) @decorator.attribute
74
+ """
75
+
76
+ # Method definitions
77
+ METHODS = """
78
+ (function_definition
79
+ name: (identifier) @method.name
80
+ parameters: (parameters
81
+ (identifier) @method.self
82
+ . (_)*) @method.params
83
+ body: (block) @method.body) @method.definition
84
+ """
85
+
86
+ # Exception handling
87
+ EXCEPTIONS = """
88
+ (try_statement
89
+ body: (block) @try.body
90
+ (except_clause
91
+ type: (_)? @except.type
92
+ name: (identifier)? @except.name
93
+ body: (block) @except.body)*
94
+ (else_clause
95
+ body: (block) @else.body)?
96
+ (finally_clause
97
+ body: (block) @finally.body)?) @try.statement
98
+
99
+ (raise_statement
100
+ (call
101
+ function: (identifier) @exception.name
102
+ arguments: (argument_list)? @exception.args)) @raise.statement
103
+ """
104
+
105
+ # Comprehensions
106
+ COMPREHENSIONS = """
107
+ (list_comprehension
108
+ body: (_) @comprehension.body
109
+ (for_in_clause
110
+ left: (_) @comprehension.var
111
+ right: (_) @comprehension.iter)) @list.comprehension
112
+
113
+ (dictionary_comprehension
114
+ body: (pair
115
+ key: (_) @comprehension.key
116
+ value: (_) @comprehension.value)
117
+ (for_in_clause
118
+ left: (_) @comprehension.var
119
+ right: (_) @comprehension.iter)) @dict.comprehension
120
+
121
+ (set_comprehension
122
+ body: (_) @comprehension.body
123
+ (for_in_clause
124
+ left: (_) @comprehension.var
125
+ right: (_) @comprehension.iter)) @set.comprehension
126
+ """
127
+
128
+ # Comments and docstrings
129
+ COMMENTS = """
130
+ (comment) @comment
131
+
132
+ (expression_statement
133
+ (string) @docstring)
134
+ """
135
+
136
+ # Type hints and annotations
137
+ TYPE_HINTS = """
138
+ (function_definition
139
+ parameters: (parameters
140
+ (typed_parameter
141
+ type: (_) @type.param)) @type.function_param)
142
+
143
+ (function_definition
144
+ return_type: (_) @type.return) @type.function_return
145
+
146
+ (assignment
147
+ type: (_) @type.variable) @type.variable_annotation
148
+ """
149
+
150
+ # Async/await patterns
151
+ ASYNC_PATTERNS = """
152
+ (function_definition) @async.function
153
+
154
+ (await
155
+ (call) @async.await_call) @async.await
156
+
157
+ (async_for_statement) @async.for
158
+
159
+ (async_with_statement) @async.with
160
+ """
161
+
162
+ # F-strings and string formatting
163
+ STRING_FORMATTING = """
164
+ (formatted_string
165
+ (interpolation) @string.interpolation) @string.fstring
166
+
167
+ (call
168
+ function: (attribute
169
+ object: (_)
170
+ attribute: (identifier) @string.format_method))
171
+ """
172
+
173
+ # Context managers
174
+ CONTEXT_MANAGERS = """
175
+ (with_statement
176
+ (with_clause
177
+ (with_item
178
+ value: (_) @context.manager)) @context.clause) @context.with
179
+
180
+ (async_with_statement
181
+ (with_clause
182
+ (with_item
183
+ value: (_) @context.manager)) @context.clause) @context.async_with
184
+ """
185
+
186
+ # Lambda expressions
187
+ LAMBDAS = """
188
+ (lambda
189
+ parameters: (lambda_parameters)? @lambda.params
190
+ body: (_) @lambda.body) @lambda.expression
191
+ """
192
+
193
+ # Modern Python patterns
194
+ MODERN_PATTERNS = """
195
+ (match_statement
196
+ subject: (_) @match.subject
197
+ body: (case_clause)+ @match.cases) @pattern.match
198
+
199
+ (case_clause
200
+ pattern: (_) @case.pattern
201
+ guard: (_)? @case.guard
202
+ consequence: (block) @case.body) @pattern.case
203
+
204
+ (walrus_operator
205
+ left: (_) @walrus.target
206
+ right: (_) @walrus.value) @assignment.walrus
207
+ """
208
+
209
+ # All queries combined
210
+ ALL_QUERIES = {
211
+ "functions": {
212
+ "query": FUNCTIONS,
213
+ "description": "すべての関数定義(async含む)を検索",
214
+ },
215
+ "classes": {"query": CLASSES, "description": "すべてのクラス定義を検索"},
216
+ "imports": {"query": IMPORTS, "description": "すべてのインポート文を検索"},
217
+ "variables": {"query": VARIABLES, "description": "すべての変数代入を検索"},
218
+ "decorators": {"query": DECORATORS, "description": "すべてのデコレータを検索"},
219
+ "methods": {
220
+ "query": METHODS,
221
+ "description": "クラス内のすべてのメソッド定義を検索",
222
+ },
223
+ "exceptions": {
224
+ "query": EXCEPTIONS,
225
+ "description": "例外処理とraise文を検索",
226
+ },
227
+ "comprehensions": {
228
+ "query": COMPREHENSIONS,
229
+ "description": "リスト、辞書、セット内包表記を検索",
230
+ },
231
+ "comments": {"query": COMMENTS, "description": "コメントとdocstringを検索"},
232
+ "type_hints": {
233
+ "query": TYPE_HINTS,
234
+ "description": "型ヒントとアノテーションを検索",
235
+ },
236
+ "async_patterns": {
237
+ "query": ASYNC_PATTERNS,
238
+ "description": "async/awaitパターンを検索",
239
+ },
240
+ "string_formatting": {
241
+ "query": STRING_FORMATTING,
242
+ "description": "f文字列と文字列フォーマットを検索",
243
+ },
244
+ "context_managers": {
245
+ "query": CONTEXT_MANAGERS,
246
+ "description": "コンテキストマネージャー(with文)を検索",
247
+ },
248
+ "lambdas": {"query": LAMBDAS, "description": "ラムダ式を検索"},
249
+ "modern_patterns": {
250
+ "query": MODERN_PATTERNS,
251
+ "description": "モダンなPythonパターン(match/case、セイウチ演算子)を検索",
252
+ },
253
+ # Convenience aliases
254
+ "function_names": {
255
+ "query": FUNCTIONS,
256
+ "description": "関数のエイリアス - すべての関数定義を検索",
257
+ },
258
+ "class_names": {
259
+ "query": CLASSES,
260
+ "description": "クラスのエイリアス - すべてのクラス定義を検索",
261
+ },
262
+ "all_declarations": {
263
+ "query": FUNCTIONS + "\n\n" + CLASSES + "\n\n" + VARIABLES,
264
+ "description": "すべての関数、クラス、変数宣言を検索",
265
+ },
266
+ }
267
+
268
+
269
+ def get_query(name: str) -> str:
270
+ """Get a specific query by name."""
271
+ if name in ALL_QUERIES:
272
+ return ALL_QUERIES[name]["query"]
273
+ raise ValueError(
274
+ f"Query '{name}' not found. Available queries: {list(ALL_QUERIES.keys())}"
275
+ )
276
+
277
+
278
+ def get_all_queries() -> dict:
279
+ """Get all available queries."""
280
+ return ALL_QUERIES
281
+
282
+
283
+ def list_queries() -> list:
284
+ """List all available query names."""
285
+ return list(ALL_QUERIES.keys())