stravinsky 0.4.18__py3-none-any.whl → 0.4.66__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 stravinsky might be problematic. Click here for more details.

Files changed (184) hide show
  1. mcp_bridge/__init__.py +1 -1
  2. mcp_bridge/auth/__init__.py +16 -6
  3. mcp_bridge/auth/cli.py +202 -11
  4. mcp_bridge/auth/oauth.py +1 -2
  5. mcp_bridge/auth/openai_oauth.py +4 -7
  6. mcp_bridge/auth/token_store.py +0 -1
  7. mcp_bridge/cli/__init__.py +1 -1
  8. mcp_bridge/cli/install_hooks.py +503 -107
  9. mcp_bridge/cli/session_report.py +0 -3
  10. mcp_bridge/config/__init__.py +2 -2
  11. mcp_bridge/config/hook_config.py +3 -5
  12. mcp_bridge/config/rate_limits.py +108 -13
  13. mcp_bridge/hooks/HOOKS_SETTINGS.json +17 -4
  14. mcp_bridge/hooks/__init__.py +14 -4
  15. mcp_bridge/hooks/agent_reminder.py +4 -4
  16. mcp_bridge/hooks/auto_slash_command.py +5 -5
  17. mcp_bridge/hooks/budget_optimizer.py +2 -2
  18. mcp_bridge/hooks/claude_limits_hook.py +114 -0
  19. mcp_bridge/hooks/comment_checker.py +3 -4
  20. mcp_bridge/hooks/compaction.py +2 -2
  21. mcp_bridge/hooks/context.py +2 -1
  22. mcp_bridge/hooks/context_monitor.py +2 -2
  23. mcp_bridge/hooks/delegation_policy.py +85 -0
  24. mcp_bridge/hooks/directory_context.py +3 -3
  25. mcp_bridge/hooks/edit_recovery.py +3 -2
  26. mcp_bridge/hooks/edit_recovery_policy.py +49 -0
  27. mcp_bridge/hooks/empty_message_sanitizer.py +2 -2
  28. mcp_bridge/hooks/events.py +160 -0
  29. mcp_bridge/hooks/git_noninteractive.py +4 -4
  30. mcp_bridge/hooks/keyword_detector.py +8 -10
  31. mcp_bridge/hooks/manager.py +35 -22
  32. mcp_bridge/hooks/notification_hook.py +13 -6
  33. mcp_bridge/hooks/parallel_enforcement_policy.py +67 -0
  34. mcp_bridge/hooks/parallel_enforcer.py +5 -5
  35. mcp_bridge/hooks/parallel_execution.py +22 -10
  36. mcp_bridge/hooks/post_tool/parallel_validation.py +103 -0
  37. mcp_bridge/hooks/pre_compact.py +8 -9
  38. mcp_bridge/hooks/pre_tool/agent_spawn_validator.py +115 -0
  39. mcp_bridge/hooks/preemptive_compaction.py +2 -3
  40. mcp_bridge/hooks/routing_notifications.py +80 -0
  41. mcp_bridge/hooks/rules_injector.py +11 -19
  42. mcp_bridge/hooks/session_idle.py +4 -4
  43. mcp_bridge/hooks/session_notifier.py +4 -4
  44. mcp_bridge/hooks/session_recovery.py +4 -5
  45. mcp_bridge/hooks/stravinsky_mode.py +1 -1
  46. mcp_bridge/hooks/subagent_stop.py +1 -3
  47. mcp_bridge/hooks/task_validator.py +2 -2
  48. mcp_bridge/hooks/tmux_manager.py +7 -8
  49. mcp_bridge/hooks/todo_delegation.py +4 -1
  50. mcp_bridge/hooks/todo_enforcer.py +180 -10
  51. mcp_bridge/hooks/truncation_policy.py +37 -0
  52. mcp_bridge/hooks/truncator.py +1 -2
  53. mcp_bridge/metrics/cost_tracker.py +115 -0
  54. mcp_bridge/native_search.py +93 -0
  55. mcp_bridge/native_watcher.py +118 -0
  56. mcp_bridge/notifications.py +3 -4
  57. mcp_bridge/orchestrator/enums.py +11 -0
  58. mcp_bridge/orchestrator/router.py +165 -0
  59. mcp_bridge/orchestrator/state.py +32 -0
  60. mcp_bridge/orchestrator/visualization.py +14 -0
  61. mcp_bridge/orchestrator/wisdom.py +34 -0
  62. mcp_bridge/prompts/__init__.py +1 -8
  63. mcp_bridge/prompts/dewey.py +1 -1
  64. mcp_bridge/prompts/planner.py +2 -4
  65. mcp_bridge/prompts/stravinsky.py +53 -31
  66. mcp_bridge/proxy/__init__.py +0 -0
  67. mcp_bridge/proxy/client.py +70 -0
  68. mcp_bridge/proxy/model_server.py +157 -0
  69. mcp_bridge/routing/__init__.py +43 -0
  70. mcp_bridge/routing/config.py +250 -0
  71. mcp_bridge/routing/model_tiers.py +135 -0
  72. mcp_bridge/routing/provider_state.py +261 -0
  73. mcp_bridge/routing/task_classifier.py +190 -0
  74. mcp_bridge/server.py +363 -34
  75. mcp_bridge/server_tools.py +298 -6
  76. mcp_bridge/tools/__init__.py +19 -8
  77. mcp_bridge/tools/agent_manager.py +549 -799
  78. mcp_bridge/tools/background_tasks.py +13 -17
  79. mcp_bridge/tools/code_search.py +54 -51
  80. mcp_bridge/tools/continuous_loop.py +0 -1
  81. mcp_bridge/tools/dashboard.py +19 -0
  82. mcp_bridge/tools/find_code.py +296 -0
  83. mcp_bridge/tools/init.py +1 -0
  84. mcp_bridge/tools/list_directory.py +42 -0
  85. mcp_bridge/tools/lsp/__init__.py +8 -8
  86. mcp_bridge/tools/lsp/manager.py +51 -28
  87. mcp_bridge/tools/lsp/tools.py +98 -65
  88. mcp_bridge/tools/model_invoke.py +1047 -152
  89. mcp_bridge/tools/mux_client.py +75 -0
  90. mcp_bridge/tools/project_context.py +1 -2
  91. mcp_bridge/tools/query_classifier.py +132 -49
  92. mcp_bridge/tools/read_file.py +84 -0
  93. mcp_bridge/tools/replace.py +45 -0
  94. mcp_bridge/tools/run_shell_command.py +38 -0
  95. mcp_bridge/tools/search_enhancements.py +347 -0
  96. mcp_bridge/tools/semantic_search.py +677 -92
  97. mcp_bridge/tools/session_manager.py +0 -2
  98. mcp_bridge/tools/skill_loader.py +0 -1
  99. mcp_bridge/tools/task_runner.py +5 -7
  100. mcp_bridge/tools/templates.py +3 -3
  101. mcp_bridge/tools/tool_search.py +331 -0
  102. mcp_bridge/tools/write_file.py +29 -0
  103. mcp_bridge/update_manager.py +33 -37
  104. mcp_bridge/update_manager_pypi.py +6 -8
  105. mcp_bridge/utils/cache.py +82 -0
  106. mcp_bridge/utils/process.py +71 -0
  107. mcp_bridge/utils/session_state.py +51 -0
  108. mcp_bridge/utils/truncation.py +76 -0
  109. {stravinsky-0.4.18.dist-info → stravinsky-0.4.66.dist-info}/METADATA +84 -35
  110. stravinsky-0.4.66.dist-info/RECORD +198 -0
  111. {stravinsky-0.4.18.dist-info → stravinsky-0.4.66.dist-info}/entry_points.txt +1 -0
  112. stravinsky_claude_assets/HOOKS_INTEGRATION.md +316 -0
  113. stravinsky_claude_assets/agents/HOOKS.md +437 -0
  114. stravinsky_claude_assets/agents/code-reviewer.md +210 -0
  115. stravinsky_claude_assets/agents/comment_checker.md +580 -0
  116. stravinsky_claude_assets/agents/debugger.md +254 -0
  117. stravinsky_claude_assets/agents/delphi.md +495 -0
  118. stravinsky_claude_assets/agents/dewey.md +248 -0
  119. stravinsky_claude_assets/agents/explore.md +1198 -0
  120. stravinsky_claude_assets/agents/frontend.md +472 -0
  121. stravinsky_claude_assets/agents/implementation-lead.md +164 -0
  122. stravinsky_claude_assets/agents/momus.md +464 -0
  123. stravinsky_claude_assets/agents/research-lead.md +141 -0
  124. stravinsky_claude_assets/agents/stravinsky.md +730 -0
  125. stravinsky_claude_assets/commands/delphi.md +9 -0
  126. stravinsky_claude_assets/commands/dewey.md +54 -0
  127. stravinsky_claude_assets/commands/git-master.md +112 -0
  128. stravinsky_claude_assets/commands/index.md +49 -0
  129. stravinsky_claude_assets/commands/publish.md +86 -0
  130. stravinsky_claude_assets/commands/review.md +73 -0
  131. stravinsky_claude_assets/commands/str/agent_cancel.md +70 -0
  132. stravinsky_claude_assets/commands/str/agent_list.md +56 -0
  133. stravinsky_claude_assets/commands/str/agent_output.md +92 -0
  134. stravinsky_claude_assets/commands/str/agent_progress.md +74 -0
  135. stravinsky_claude_assets/commands/str/agent_retry.md +94 -0
  136. stravinsky_claude_assets/commands/str/cancel.md +51 -0
  137. stravinsky_claude_assets/commands/str/clean.md +97 -0
  138. stravinsky_claude_assets/commands/str/continue.md +38 -0
  139. stravinsky_claude_assets/commands/str/index.md +199 -0
  140. stravinsky_claude_assets/commands/str/list_watchers.md +96 -0
  141. stravinsky_claude_assets/commands/str/search.md +205 -0
  142. stravinsky_claude_assets/commands/str/start_filewatch.md +136 -0
  143. stravinsky_claude_assets/commands/str/stats.md +71 -0
  144. stravinsky_claude_assets/commands/str/stop_filewatch.md +89 -0
  145. stravinsky_claude_assets/commands/str/unwatch.md +42 -0
  146. stravinsky_claude_assets/commands/str/watch.md +45 -0
  147. stravinsky_claude_assets/commands/strav.md +53 -0
  148. stravinsky_claude_assets/commands/stravinsky.md +292 -0
  149. stravinsky_claude_assets/commands/verify.md +60 -0
  150. stravinsky_claude_assets/commands/version.md +5 -0
  151. stravinsky_claude_assets/hooks/README.md +248 -0
  152. stravinsky_claude_assets/hooks/comment_checker.py +193 -0
  153. stravinsky_claude_assets/hooks/context.py +38 -0
  154. stravinsky_claude_assets/hooks/context_monitor.py +153 -0
  155. stravinsky_claude_assets/hooks/dependency_tracker.py +73 -0
  156. stravinsky_claude_assets/hooks/edit_recovery.py +46 -0
  157. stravinsky_claude_assets/hooks/execution_state_tracker.py +68 -0
  158. stravinsky_claude_assets/hooks/notification_hook.py +103 -0
  159. stravinsky_claude_assets/hooks/notification_hook_v2.py +96 -0
  160. stravinsky_claude_assets/hooks/parallel_execution.py +241 -0
  161. stravinsky_claude_assets/hooks/parallel_reinforcement.py +106 -0
  162. stravinsky_claude_assets/hooks/parallel_reinforcement_v2.py +112 -0
  163. stravinsky_claude_assets/hooks/pre_compact.py +123 -0
  164. stravinsky_claude_assets/hooks/ralph_loop.py +173 -0
  165. stravinsky_claude_assets/hooks/session_recovery.py +263 -0
  166. stravinsky_claude_assets/hooks/stop_hook.py +89 -0
  167. stravinsky_claude_assets/hooks/stravinsky_metrics.py +164 -0
  168. stravinsky_claude_assets/hooks/stravinsky_mode.py +146 -0
  169. stravinsky_claude_assets/hooks/subagent_stop.py +98 -0
  170. stravinsky_claude_assets/hooks/todo_continuation.py +111 -0
  171. stravinsky_claude_assets/hooks/todo_delegation.py +96 -0
  172. stravinsky_claude_assets/hooks/tool_messaging.py +281 -0
  173. stravinsky_claude_assets/hooks/truncator.py +23 -0
  174. stravinsky_claude_assets/rules/deployment_safety.md +51 -0
  175. stravinsky_claude_assets/rules/integration_wiring.md +89 -0
  176. stravinsky_claude_assets/rules/pypi_deployment.md +220 -0
  177. stravinsky_claude_assets/rules/stravinsky_orchestrator.md +32 -0
  178. stravinsky_claude_assets/settings.json +152 -0
  179. stravinsky_claude_assets/skills/chrome-devtools/SKILL.md +81 -0
  180. stravinsky_claude_assets/skills/sqlite/SKILL.md +77 -0
  181. stravinsky_claude_assets/skills/supabase/SKILL.md +74 -0
  182. stravinsky_claude_assets/task_dependencies.json +34 -0
  183. stravinsky-0.4.18.dist-info/RECORD +0 -88
  184. {stravinsky-0.4.18.dist-info → stravinsky-0.4.66.dist-info}/WHEEL +0 -0
@@ -1,8 +1,7 @@
1
- from mcp.types import Tool, Prompt
2
- from typing import List
1
+ from mcp.types import Prompt, Tool
3
2
 
4
3
 
5
- def get_tool_definitions() -> List[Tool]:
4
+ def get_tool_definitions() -> list[Tool]:
6
5
  """Return all Tool definitions for the Stravinsky MCP server."""
7
6
  return [
8
7
  Tool(
@@ -12,6 +11,7 @@ def get_tool_definitions() -> List[Tool]:
12
11
  "type": "object",
13
12
  "properties": {},
14
13
  },
14
+ meta={"defer_loading": True},
15
15
  ),
16
16
  Tool(
17
17
  name="system_restart",
@@ -20,6 +20,113 @@ def get_tool_definitions() -> List[Tool]:
20
20
  "type": "object",
21
21
  "properties": {},
22
22
  },
23
+ meta={"defer_loading": True},
24
+ ),
25
+ Tool(
26
+ name="tool_search",
27
+ description="Search for tools by name, description, or category. Returns matching tools with their descriptions and parameters. Use this to discover available tools before using them.",
28
+ inputSchema={
29
+ "type": "object",
30
+ "properties": {
31
+ "query": {
32
+ "type": "string",
33
+ "description": "Search query to match against tool names, descriptions, and categories",
34
+ },
35
+ "category": {
36
+ "type": "string",
37
+ "description": "Optional category filter (e.g., 'semantic', 'lsp', 'agent', 'git')",
38
+ },
39
+ "top_k": {
40
+ "type": "integer",
41
+ "description": "Maximum number of results to return",
42
+ "default": 5,
43
+ },
44
+ },
45
+ "required": ["query"],
46
+ },
47
+ ),
48
+ Tool(
49
+ name="list_directory",
50
+ description="List files and directories in a path. Uses caching for faster repeated access.",
51
+ inputSchema={
52
+ "type": "object",
53
+ "properties": {
54
+ "path": {"type": "string", "description": "Directory path to list"}
55
+ },
56
+ "required": ["path"],
57
+ },
58
+ meta={"defer_loading": True},
59
+ ),
60
+ Tool(
61
+ name="read_file",
62
+ description=(
63
+ "Read the contents of a file. Supports smart truncation and log-awareness. "
64
+ "For log files (.log, .out, .err), defaults to reading the last 100 lines."
65
+ ),
66
+ inputSchema={
67
+ "type": "object",
68
+ "properties": {
69
+ "path": {"type": "string", "description": "Absolute or relative path to the file"},
70
+ "offset": {
71
+ "type": "integer",
72
+ "description": "Line number to start reading from (0-indexed)",
73
+ "default": 0
74
+ },
75
+ "limit": {
76
+ "type": "integer",
77
+ "description": "Maximum number of lines to read",
78
+ },
79
+ },
80
+ "required": ["path"],
81
+ },
82
+ meta={"defer_loading": True},
83
+ ),
84
+ Tool(
85
+ name="write_file",
86
+ description="Write content to a file. Invalidates related cache entries.",
87
+ inputSchema={
88
+ "type": "object",
89
+ "properties": {
90
+ "path": {"type": "string", "description": "Path to the file to write"},
91
+ "content": {"type": "string", "description": "Content to write to the file"},
92
+ },
93
+ "required": ["path", "content"],
94
+ },
95
+ meta={"defer_loading": True},
96
+ ),
97
+ Tool(
98
+ name="replace",
99
+ description="Replace text in a file. Invalidates related cache entries.",
100
+ inputSchema={
101
+ "type": "object",
102
+ "properties": {
103
+ "path": {"type": "string", "description": "Path to the file to modify"},
104
+ "old_string": {"type": "string", "description": "The exact literal text to replace"},
105
+ "new_string": {"type": "string", "description": "The exact literal text to replace with"},
106
+ "instruction": {"type": "string", "description": "Detailed description of the change"},
107
+ "expected_replacements": {
108
+ "type": "integer",
109
+ "description": "Number of replacements expected",
110
+ "default": 1
111
+ },
112
+ },
113
+ "required": ["path", "old_string", "new_string", "instruction"],
114
+ },
115
+ meta={"defer_loading": True},
116
+ ),
117
+ Tool(
118
+ name="run_shell_command",
119
+ description="Execute a shell command. Invalidates cache if it looks like a write operation.",
120
+ inputSchema={
121
+ "type": "object",
122
+ "properties": {
123
+ "command": {"type": "string", "description": "Exact bash command to execute"},
124
+ "description": {"type": "string", "description": "Brief description of the command's purpose"},
125
+ "dir_path": {"type": "string", "description": "Optional directory to run the command in"},
126
+ },
127
+ "required": ["command", "description"],
128
+ },
129
+ meta={"defer_loading": True},
23
130
  ),
24
131
  Tool(
25
132
  name="invoke_gemini",
@@ -76,6 +183,59 @@ def get_tool_definitions() -> List[Tool]:
76
183
  },
77
184
  },
78
185
  "required": ["prompt"],
186
+ },
187
+ meta={"defer_loading": True},
188
+ ),
189
+ Tool(
190
+ name="invoke_gemini_agentic",
191
+ description=(
192
+ "Invoke Gemini with function calling for agentic tasks. "
193
+ "Implements a multi-turn agentic loop: sends prompt with tool definitions, "
194
+ "executes tool calls, and iterates until final response or max_turns reached. "
195
+ "Supports both API key (GEMINI_API_KEY) and OAuth authentication."
196
+ ),
197
+ inputSchema={
198
+ "type": "object",
199
+ "properties": {
200
+ "prompt": {
201
+ "type": "string",
202
+ "description": "The task prompt for the agentic loop",
203
+ },
204
+ "model": {
205
+ "type": "string",
206
+ "description": "Gemini model to use (default: gemini-3-flash)",
207
+ "default": "gemini-3-flash",
208
+ },
209
+ "max_turns": {
210
+ "type": "integer",
211
+ "description": "Maximum number of tool-use turns (default: 10)",
212
+ "default": 10,
213
+ },
214
+ "timeout": {
215
+ "type": "integer",
216
+ "description": "Request timeout in seconds (default: 120)",
217
+ "default": 120,
218
+ },
219
+ "agent_context": {
220
+ "type": "object",
221
+ "description": "Optional agent metadata for logging (agent_type, task_id, description)",
222
+ "properties": {
223
+ "agent_type": {
224
+ "type": "string",
225
+ "description": "Type of agent (explore, delphi, frontend, etc.)",
226
+ },
227
+ "task_id": {
228
+ "type": "string",
229
+ "description": "Background task ID if running as agent",
230
+ },
231
+ "description": {
232
+ "type": "string",
233
+ "description": "Short description of what the agent is doing",
234
+ },
235
+ },
236
+ },
237
+ },
238
+ "required": ["prompt"],
79
239
  },
80
240
  ),
81
241
  Tool(
@@ -113,6 +273,12 @@ def get_tool_definitions() -> List[Tool]:
113
273
  "description": "Tokens reserved for internal reasoning (e.g. o1 / o3)",
114
274
  "default": 0,
115
275
  },
276
+ "reasoning_effort": {
277
+ "type": "string",
278
+ "description": "Reasoning effort for reasoning models (o1, o3): low, medium, high",
279
+ "enum": ["low", "medium", "high"],
280
+ "default": "medium",
281
+ },
116
282
  "agent_context": {
117
283
  "type": "object",
118
284
  "description": "Optional agent metadata for logging (agent_type, task_id, description)",
@@ -134,6 +300,7 @@ def get_tool_definitions() -> List[Tool]:
134
300
  },
135
301
  "required": ["prompt"],
136
302
  },
303
+ meta={"defer_loading": True},
137
304
  ),
138
305
  Tool(
139
306
  name="get_project_context",
@@ -144,6 +311,7 @@ def get_tool_definitions() -> List[Tool]:
144
311
  "project_path": {"type": "string", "description": "Path to the project root"},
145
312
  },
146
313
  },
314
+ meta={"defer_loading": True},
147
315
  ),
148
316
  Tool(
149
317
  name="get_system_health",
@@ -152,6 +320,7 @@ def get_tool_definitions() -> List[Tool]:
152
320
  "type": "object",
153
321
  "properties": {},
154
322
  },
323
+ meta={"defer_loading": True},
155
324
  ),
156
325
  Tool(
157
326
  name="lsp_diagnostics",
@@ -168,6 +337,7 @@ def get_tool_definitions() -> List[Tool]:
168
337
  },
169
338
  "required": ["file_path"],
170
339
  },
340
+ meta={"defer_loading": True},
171
341
  ),
172
342
  Tool(
173
343
  name="ast_grep_search",
@@ -229,6 +399,7 @@ def get_tool_definitions() -> List[Tool]:
229
399
  "limit": {"type": "integer", "description": "Max sessions", "default": 20},
230
400
  },
231
401
  },
402
+ meta={"defer_loading": True},
232
403
  ),
233
404
  Tool(
234
405
  name="session_read",
@@ -241,6 +412,7 @@ def get_tool_definitions() -> List[Tool]:
241
412
  },
242
413
  "required": ["session_id"],
243
414
  },
415
+ meta={"defer_loading": True},
244
416
  ),
245
417
  Tool(
246
418
  name="session_search",
@@ -254,6 +426,7 @@ def get_tool_definitions() -> List[Tool]:
254
426
  },
255
427
  "required": ["query"],
256
428
  },
429
+ meta={"defer_loading": True},
257
430
  ),
258
431
  Tool(
259
432
  name="skill_list",
@@ -264,6 +437,7 @@ def get_tool_definitions() -> List[Tool]:
264
437
  "project_path": {"type": "string", "description": "Project directory"},
265
438
  },
266
439
  },
440
+ meta={"defer_loading": True},
267
441
  ),
268
442
  Tool(
269
443
  name="skill_get",
@@ -276,6 +450,7 @@ def get_tool_definitions() -> List[Tool]:
276
450
  },
277
451
  "required": ["name"],
278
452
  },
453
+ meta={"defer_loading": True},
279
454
  ),
280
455
  Tool(
281
456
  name="task_spawn",
@@ -298,6 +473,7 @@ def get_tool_definitions() -> List[Tool]:
298
473
  },
299
474
  "required": ["prompt"],
300
475
  },
476
+ meta={"defer_loading": True},
301
477
  ),
302
478
  Tool(
303
479
  name="task_status",
@@ -309,6 +485,7 @@ def get_tool_definitions() -> List[Tool]:
309
485
  },
310
486
  "required": ["task_id"],
311
487
  },
488
+ meta={"defer_loading": True},
312
489
  ),
313
490
  Tool(
314
491
  name="task_list",
@@ -317,6 +494,7 @@ def get_tool_definitions() -> List[Tool]:
317
494
  "type": "object",
318
495
  "properties": {},
319
496
  },
497
+ meta={"defer_loading": True},
320
498
  ),
321
499
  Tool(
322
500
  name="agent_spawn",
@@ -384,6 +562,7 @@ def get_tool_definitions() -> List[Tool]:
384
562
  },
385
563
  "required": ["task_id"],
386
564
  },
565
+ meta={"defer_loading": True},
387
566
  ),
388
567
  Tool(
389
568
  name="agent_output",
@@ -411,14 +590,42 @@ def get_tool_definitions() -> List[Tool]:
411
590
  },
412
591
  "required": ["task_id"],
413
592
  },
593
+ meta={"defer_loading": True},
414
594
  ),
415
595
  Tool(
416
596
  name="agent_list",
417
- description="List all background agent tasks with their status.",
597
+ description="List all background agent tasks with their status. By default shows all agents; use show_all=false to see only running/pending.",
418
598
  inputSchema={
419
599
  "type": "object",
420
- "properties": {},
600
+ "properties": {
601
+ "show_all": {
602
+ "type": "boolean",
603
+ "description": "If false, only show running/pending agents. If true (default), show all.",
604
+ "default": True,
605
+ },
606
+ },
607
+ },
608
+ meta={"defer_loading": True},
609
+ ),
610
+ Tool(
611
+ name="agent_cleanup",
612
+ description="Clean up old completed/failed/cancelled agents to reduce clutter in agent_list. Removes agents older than max_age_minutes.",
613
+ inputSchema={
614
+ "type": "object",
615
+ "properties": {
616
+ "max_age_minutes": {
617
+ "type": "integer",
618
+ "description": "Remove agents older than this many minutes (default: 30)",
619
+ "default": 30,
620
+ },
621
+ "statuses": {
622
+ "type": "array",
623
+ "items": {"type": "string"},
624
+ "description": "List of statuses to remove (default: ['completed', 'failed', 'cancelled'])",
625
+ },
626
+ },
421
627
  },
628
+ meta={"defer_loading": True},
422
629
  ),
423
630
  Tool(
424
631
  name="agent_progress",
@@ -435,6 +642,7 @@ def get_tool_definitions() -> List[Tool]:
435
642
  },
436
643
  "required": ["task_id"],
437
644
  },
645
+ meta={"defer_loading": True},
438
646
  ),
439
647
  Tool(
440
648
  name="lsp_hover",
@@ -451,6 +659,7 @@ def get_tool_definitions() -> List[Tool]:
451
659
  },
452
660
  "required": ["file_path", "line", "character"],
453
661
  },
662
+ meta={"defer_loading": True},
454
663
  ),
455
664
  Tool(
456
665
  name="lsp_goto_definition",
@@ -467,6 +676,7 @@ def get_tool_definitions() -> List[Tool]:
467
676
  },
468
677
  "required": ["file_path", "line", "character"],
469
678
  },
679
+ meta={"defer_loading": True},
470
680
  ),
471
681
  Tool(
472
682
  name="lsp_find_references",
@@ -488,6 +698,7 @@ def get_tool_definitions() -> List[Tool]:
488
698
  },
489
699
  "required": ["file_path", "line", "character"],
490
700
  },
701
+ meta={"defer_loading": True},
491
702
  ),
492
703
  Tool(
493
704
  name="lsp_document_symbols",
@@ -499,6 +710,7 @@ def get_tool_definitions() -> List[Tool]:
499
710
  },
500
711
  "required": ["file_path"],
501
712
  },
713
+ meta={"defer_loading": True},
502
714
  ),
503
715
  Tool(
504
716
  name="lsp_workspace_symbols",
@@ -518,6 +730,7 @@ def get_tool_definitions() -> List[Tool]:
518
730
  },
519
731
  "required": ["query"],
520
732
  },
733
+ meta={"defer_loading": True},
521
734
  ),
522
735
  Tool(
523
736
  name="lsp_prepare_rename",
@@ -534,6 +747,7 @@ def get_tool_definitions() -> List[Tool]:
534
747
  },
535
748
  "required": ["file_path", "line", "character"],
536
749
  },
750
+ meta={"defer_loading": True},
537
751
  ),
538
752
  Tool(
539
753
  name="lsp_rename",
@@ -556,6 +770,7 @@ def get_tool_definitions() -> List[Tool]:
556
770
  },
557
771
  "required": ["file_path", "line", "character", "new_name"],
558
772
  },
773
+ meta={"defer_loading": True},
559
774
  ),
560
775
  Tool(
561
776
  name="lsp_code_actions",
@@ -572,6 +787,7 @@ def get_tool_definitions() -> List[Tool]:
572
787
  },
573
788
  "required": ["file_path", "line", "character"],
574
789
  },
790
+ meta={"defer_loading": True},
575
791
  ),
576
792
  Tool(
577
793
  name="lsp_code_action_resolve",
@@ -591,6 +807,7 @@ def get_tool_definitions() -> List[Tool]:
591
807
  },
592
808
  "required": ["file_path", "action_code"],
593
809
  },
810
+ meta={"defer_loading": True},
594
811
  ),
595
812
  Tool(
596
813
  name="lsp_extract_refactor",
@@ -621,6 +838,7 @@ def get_tool_definitions() -> List[Tool]:
621
838
  "new_name",
622
839
  ],
623
840
  },
841
+ meta={"defer_loading": True},
624
842
  ),
625
843
  Tool(
626
844
  name="lsp_servers",
@@ -629,6 +847,7 @@ def get_tool_definitions() -> List[Tool]:
629
847
  "type": "object",
630
848
  "properties": {},
631
849
  },
850
+ meta={"defer_loading": True},
632
851
  ),
633
852
  Tool(
634
853
  name="ast_grep_replace",
@@ -661,6 +880,7 @@ def get_tool_definitions() -> List[Tool]:
661
880
  },
662
881
  "required": ["pattern", "replacement"],
663
882
  },
883
+ meta={"defer_loading": True},
664
884
  ),
665
885
  # --- SEMANTIC SEARCH ---
666
886
  Tool(
@@ -705,6 +925,7 @@ def get_tool_definitions() -> List[Tool]:
705
925
  },
706
926
  "required": ["query"],
707
927
  },
928
+ meta={"defer_loading": True},
708
929
  ),
709
930
  Tool(
710
931
  name="hybrid_search",
@@ -763,6 +984,53 @@ def get_tool_definitions() -> List[Tool]:
763
984
  },
764
985
  "required": ["query"],
765
986
  },
987
+ meta={"defer_loading": True},
988
+ ),
989
+ Tool(
990
+ name="find_code",
991
+ description=(
992
+ "Smart code search with automatic routing to optimal search strategy. "
993
+ "Automatically detects whether query is AST pattern (e.g., 'class $X'), "
994
+ "natural language (e.g., 'auth logic'), or complex query (e.g., 'JWT AND middleware'). "
995
+ "Routes to ast_grep, semantic_search, hybrid_search, or grep based on pattern detection. "
996
+ "**PREFERRED TOOL**: Use this instead of calling individual search tools directly."
997
+ ),
998
+ inputSchema={
999
+ "type": "object",
1000
+ "properties": {
1001
+ "query": {
1002
+ "type": "string",
1003
+ "description": "Search query (AST pattern, natural language, or text)",
1004
+ },
1005
+ "search_type": {
1006
+ "type": "string",
1007
+ "description": "Search strategy: 'auto' (default), 'ast', 'semantic', 'hybrid', 'grep', 'exact'",
1008
+ "enum": ["auto", "ast", "semantic", "hybrid", "grep", "exact"],
1009
+ "default": "auto",
1010
+ },
1011
+ "project_path": {
1012
+ "type": "string",
1013
+ "description": "Path to the project root",
1014
+ "default": ".",
1015
+ },
1016
+ "language": {
1017
+ "type": "string",
1018
+ "description": "Filter by language (e.g., 'py', 'ts', 'js')",
1019
+ },
1020
+ "n_results": {
1021
+ "type": "integer",
1022
+ "description": "Maximum number of results to return",
1023
+ "default": 10,
1024
+ },
1025
+ "provider": {
1026
+ "type": "string",
1027
+ "description": "Embedding provider for semantic search: ollama (default), gemini, openai",
1028
+ "default": "ollama",
1029
+ },
1030
+ },
1031
+ "required": ["query"],
1032
+ },
1033
+ meta={"defer_loading": True},
766
1034
  ),
767
1035
  Tool(
768
1036
  name="semantic_index",
@@ -791,6 +1059,7 @@ def get_tool_definitions() -> List[Tool]:
791
1059
  },
792
1060
  },
793
1061
  },
1062
+ meta={"defer_loading": True},
794
1063
  ),
795
1064
  Tool(
796
1065
  name="semantic_stats",
@@ -811,6 +1080,7 @@ def get_tool_definitions() -> List[Tool]:
811
1080
  },
812
1081
  },
813
1082
  },
1083
+ meta={"defer_loading": True},
814
1084
  ),
815
1085
  Tool(
816
1086
  name="start_file_watcher",
@@ -840,6 +1110,7 @@ def get_tool_definitions() -> List[Tool]:
840
1110
  },
841
1111
  },
842
1112
  },
1113
+ meta={"defer_loading": True},
843
1114
  ),
844
1115
  Tool(
845
1116
  name="stop_file_watcher",
@@ -854,6 +1125,7 @@ def get_tool_definitions() -> List[Tool]:
854
1125
  },
855
1126
  },
856
1127
  },
1128
+ meta={"defer_loading": True},
857
1129
  ),
858
1130
  Tool(
859
1131
  name="cancel_indexing",
@@ -877,6 +1149,7 @@ def get_tool_definitions() -> List[Tool]:
877
1149
  },
878
1150
  },
879
1151
  },
1152
+ meta={"defer_loading": True},
880
1153
  ),
881
1154
  Tool(
882
1155
  name="delete_index",
@@ -904,6 +1177,7 @@ def get_tool_definitions() -> List[Tool]:
904
1177
  },
905
1178
  },
906
1179
  },
1180
+ meta={"defer_loading": True},
907
1181
  ),
908
1182
  Tool(
909
1183
  name="list_file_watchers",
@@ -912,6 +1186,7 @@ def get_tool_definitions() -> List[Tool]:
912
1186
  "type": "object",
913
1187
  "properties": {},
914
1188
  },
1189
+ meta={"defer_loading": True},
915
1190
  ),
916
1191
  Tool(
917
1192
  name="multi_query_search",
@@ -960,6 +1235,7 @@ def get_tool_definitions() -> List[Tool]:
960
1235
  },
961
1236
  "required": ["query"],
962
1237
  },
1238
+ meta={"defer_loading": True},
963
1239
  ),
964
1240
  Tool(
965
1241
  name="decomposed_search",
@@ -1003,6 +1279,7 @@ def get_tool_definitions() -> List[Tool]:
1003
1279
  },
1004
1280
  "required": ["query"],
1005
1281
  },
1282
+ meta={"defer_loading": True},
1006
1283
  ),
1007
1284
  Tool(
1008
1285
  name="enhanced_search",
@@ -1052,11 +1329,26 @@ def get_tool_definitions() -> List[Tool]:
1052
1329
  },
1053
1330
  "required": ["query"],
1054
1331
  },
1332
+ meta={"defer_loading": True},
1333
+ ),
1334
+ Tool(
1335
+ name="get_cost_report",
1336
+ description="Get a cost report for the current or specified session, breaking down token usage and cost by agent.",
1337
+ inputSchema={
1338
+ "type": "object",
1339
+ "properties": {
1340
+ "session_id": {
1341
+ "type": "string",
1342
+ "description": "Optional session ID to filter by",
1343
+ },
1344
+ },
1345
+ },
1346
+ meta={"defer_loading": True},
1055
1347
  ),
1056
1348
  ]
1057
1349
 
1058
1350
 
1059
- def get_prompt_definitions() -> List[Prompt]:
1351
+ def get_prompt_definitions() -> list[Prompt]:
1060
1352
  """Return all Prompt definitions for the Stravinsky MCP server."""
1061
1353
  return [
1062
1354
  Prompt(
@@ -1,12 +1,20 @@
1
1
  # Tools module
2
- from .model_invoke import invoke_gemini, invoke_openai, invoke_gemini_agentic
3
- from .code_search import lsp_diagnostics, ast_grep_search, ast_grep_replace, grep_search, glob_files
4
- from .session_manager import list_sessions, read_session, search_sessions, get_session_info
5
- from .skill_loader import list_skills, get_skill, create_skill
6
- from .agent_manager import agent_spawn, agent_output, agent_cancel, agent_list, agent_progress, agent_retry
7
- from .background_tasks import task_spawn, task_status, task_list
8
- from .continuous_loop import enable_ralph_loop, disable_ralph_loop
9
- from .query_classifier import classify_query, QueryCategory, QueryClassification
2
+ from .agent_manager import (
3
+ agent_cancel,
4
+ agent_list,
5
+ agent_output,
6
+ agent_progress,
7
+ agent_retry,
8
+ agent_spawn,
9
+ )
10
+ from .background_tasks import task_list, task_spawn, task_status
11
+ from .code_search import ast_grep_replace, ast_grep_search, glob_files, grep_search, lsp_diagnostics
12
+ from .continuous_loop import disable_ralph_loop, enable_ralph_loop
13
+ from .model_invoke import invoke_gemini, invoke_gemini_agentic, invoke_openai
14
+ from .query_classifier import QueryCategory, QueryClassification, classify_query
15
+ from .session_manager import get_session_info, list_sessions, read_session, search_sessions
16
+ from .skill_loader import create_skill, get_skill, list_skills
17
+ from .tool_search import format_search_results, search_tool_names, search_tools
10
18
 
11
19
  __all__ = [
12
20
  "QueryCategory",
@@ -23,6 +31,7 @@ __all__ = [
23
31
  "create_skill",
24
32
  "disable_ralph_loop",
25
33
  "enable_ralph_loop",
34
+ "format_search_results",
26
35
  "get_session_info",
27
36
  "get_skill",
28
37
  "glob_files",
@@ -35,6 +44,8 @@ __all__ = [
35
44
  "lsp_diagnostics",
36
45
  "read_session",
37
46
  "search_sessions",
47
+ "search_tool_names",
48
+ "search_tools",
38
49
  "task_list",
39
50
  "task_spawn",
40
51
  "task_status",