stravinsky 0.1.2__py3-none-any.whl → 0.2.7__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.

@@ -0,0 +1,529 @@
1
+ from mcp.types import Tool, Prompt
2
+ from typing import List
3
+
4
+ def get_tool_definitions() -> List[Tool]:
5
+ """Return all Tool definitions for the Stravinsky MCP server."""
6
+ return [
7
+ Tool(
8
+ name="invoke_gemini",
9
+ description=(
10
+ "Invoke a Gemini model with the given prompt. "
11
+ "Requires OAuth authentication with Google. "
12
+ "Use this for tasks requiring Gemini's capabilities like "
13
+ "frontend UI generation, documentation writing, or multimodal analysis."
14
+ ),
15
+ inputSchema={
16
+ "type": "object",
17
+ "properties": {
18
+ "prompt": {
19
+ "type": "string",
20
+ "description": "The prompt to send to Gemini",
21
+ },
22
+ "model": {
23
+ "type": "string",
24
+ "description": "Gemini model to use (default: gemini-2.0-flash-exp)",
25
+ "default": "gemini-2.0-flash-exp",
26
+ },
27
+ "temperature": {
28
+ "type": "number",
29
+ "description": "Sampling temperature (0.0-2.0)",
30
+ "default": 0.7,
31
+ },
32
+ "max_tokens": {
33
+ "type": "integer",
34
+ "description": "Maximum tokens in response",
35
+ "default": 8192,
36
+ },
37
+ "thinking_budget": {
38
+ "type": "integer",
39
+ "description": "Tokens reserved for internal reasoning (if model supports it)",
40
+ "default": 0,
41
+ },
42
+ },
43
+ "required": ["prompt"],
44
+ },
45
+ ),
46
+ Tool(
47
+ name="invoke_openai",
48
+ description=(
49
+ "Invoke an OpenAI model with the given prompt. "
50
+ "Requires OAuth authentication with OpenAI. "
51
+ "Use this for tasks requiring GPT capabilities like "
52
+ "strategic advice, code review, or complex reasoning."
53
+ ),
54
+ inputSchema={
55
+ "type": "object",
56
+ "properties": {
57
+ "prompt": {
58
+ "type": "string",
59
+ "description": "The prompt to send to OpenAI",
60
+ },
61
+ "model": {
62
+ "type": "string",
63
+ "description": "OpenAI model to use (default: gpt-4o)",
64
+ "default": "gpt-4o",
65
+ },
66
+ "temperature": {
67
+ "type": "number",
68
+ "description": "Sampling temperature (0.0-2.0)",
69
+ "default": 0.7,
70
+ },
71
+ "max_tokens": {
72
+ "type": "integer",
73
+ "description": "Maximum tokens in response",
74
+ "default": 4096,
75
+ },
76
+ "thinking_budget": {
77
+ "type": "integer",
78
+ "description": "Tokens reserved for internal reasoning (e.g. o1 / o3)",
79
+ "default": 0,
80
+ },
81
+ },
82
+ "required": ["prompt"],
83
+ },
84
+ ),
85
+ Tool(
86
+ name="get_project_context",
87
+ description="Summarize project environment including Git status, local rules (.claude/rules/), and pending todos.",
88
+ inputSchema={
89
+ "type": "object",
90
+ "properties": {
91
+ "project_path": {"type": "string", "description": "Path to the project root"},
92
+ },
93
+ },
94
+ ),
95
+ Tool(
96
+ name="get_system_health",
97
+ description="Comprehensive check of system dependencies (rg, fd, sg, etc.) and authentication status.",
98
+ inputSchema={
99
+ "type": "object",
100
+ "properties": {},
101
+ },
102
+ ),
103
+ Tool(
104
+ name="lsp_diagnostics",
105
+ description="Get diagnostics (errors, warnings) for a file using language tools (tsc, ruff).",
106
+ inputSchema={
107
+ "type": "object",
108
+ "properties": {
109
+ "file_path": {"type": "string", "description": "Path to file to analyze"},
110
+ "severity": {"type": "string", "description": "Filter: error, warning, all", "default": "all"},
111
+ },
112
+ "required": ["file_path"],
113
+ },
114
+ ),
115
+ Tool(
116
+ name="ast_grep_search",
117
+ description="Search codebase using ast-grep for structural AST patterns.",
118
+ inputSchema={
119
+ "type": "object",
120
+ "properties": {
121
+ "pattern": {"type": "string", "description": "ast-grep pattern"},
122
+ "directory": {"type": "string", "description": "Directory to search", "default": "."},
123
+ "language": {"type": "string", "description": "Filter by language"},
124
+ },
125
+ "required": ["pattern"],
126
+ },
127
+ ),
128
+ Tool(
129
+ name="grep_search",
130
+ description="Fast text search using ripgrep.",
131
+ inputSchema={
132
+ "type": "object",
133
+ "properties": {
134
+ "pattern": {"type": "string", "description": "Search pattern (regex)"},
135
+ "directory": {"type": "string", "description": "Directory to search", "default": "."},
136
+ "file_pattern": {"type": "string", "description": "Glob filter (e.g. *.py)"},
137
+ },
138
+ "required": ["pattern"],
139
+ },
140
+ ),
141
+ Tool(
142
+ name="glob_files",
143
+ description="Find files matching a glob pattern.",
144
+ inputSchema={
145
+ "type": "object",
146
+ "properties": {
147
+ "pattern": {"type": "string", "description": "Glob pattern (e.g. **/*.py)"},
148
+ "directory": {"type": "string", "description": "Base directory", "default": "."},
149
+ },
150
+ "required": ["pattern"],
151
+ },
152
+ ),
153
+ Tool(
154
+ name="session_list",
155
+ description="List Claude Code sessions with optional filtering.",
156
+ inputSchema={
157
+ "type": "object",
158
+ "properties": {
159
+ "project_path": {"type": "string", "description": "Filter by project path"},
160
+ "limit": {"type": "integer", "description": "Max sessions", "default": 20},
161
+ },
162
+ },
163
+ ),
164
+ Tool(
165
+ name="session_read",
166
+ description="Read messages from a Claude Code session.",
167
+ inputSchema={
168
+ "type": "object",
169
+ "properties": {
170
+ "session_id": {"type": "string", "description": "Session ID"},
171
+ "limit": {"type": "integer", "description": "Max messages"},
172
+ },
173
+ "required": ["session_id"],
174
+ },
175
+ ),
176
+ Tool(
177
+ name="session_search",
178
+ description="Search across Claude Code session messages.",
179
+ inputSchema={
180
+ "type": "object",
181
+ "properties": {
182
+ "query": {"type": "string", "description": "Search query"},
183
+ "session_id": {"type": "string", "description": "Search in specific session"},
184
+ "limit": {"type": "integer", "description": "Max results", "default": 20},
185
+ },
186
+ "required": ["query"],
187
+ },
188
+ ),
189
+ Tool(
190
+ name="skill_list",
191
+ description="List available Claude Code skills/commands from .claude/commands/.",
192
+ inputSchema={
193
+ "type": "object",
194
+ "properties": {
195
+ "project_path": {"type": "string", "description": "Project directory"},
196
+ },
197
+ },
198
+ ),
199
+ Tool(
200
+ name="skill_get",
201
+ description="Get the content of a specific skill/command.",
202
+ inputSchema={
203
+ "type": "object",
204
+ "properties": {
205
+ "name": {"type": "string", "description": "Skill name"},
206
+ "project_path": {"type": "string", "description": "Project directory"},
207
+ },
208
+ "required": ["name"],
209
+ },
210
+ ),
211
+ Tool(
212
+ name="task_spawn",
213
+ description=(
214
+ "Spawn a background task to execute a prompt asynchronously. "
215
+ "Returns a Task ID. Best for deep research or parallel processing."
216
+ ),
217
+ inputSchema={
218
+ "type": "object",
219
+ "properties": {
220
+ "prompt": {"type": "string", "description": "The prompt for the background agent"},
221
+ "model": {
222
+ "type": "string",
223
+ "description": "Model to use (gemini-3-flash or gpt-4o)",
224
+ "default": "gemini-3-flash"
225
+ },
226
+ },
227
+ "required": ["prompt"],
228
+ },
229
+ ),
230
+ Tool(
231
+ name="task_status",
232
+ description="Check the status and retrieve results of a background task.",
233
+ inputSchema={
234
+ "type": "object",
235
+ "properties": {
236
+ "task_id": {"type": "string", "description": "The ID of the task to check"},
237
+ },
238
+ "required": ["task_id"],
239
+ },
240
+ ),
241
+ Tool(
242
+ name="task_list",
243
+ description="List all active and recent background tasks.",
244
+ inputSchema={
245
+ "type": "object",
246
+ "properties": {},
247
+ },
248
+ ),
249
+ Tool(
250
+ name="agent_spawn",
251
+ description=(
252
+ "Spawn a background agent. Uses Gemini by default for fast execution. "
253
+ "Set model='claude' to use Claude Code CLI with full tool access."
254
+ ),
255
+ inputSchema={
256
+ "type": "object",
257
+ "properties": {
258
+ "prompt": {"type": "string", "description": "The task for the agent to perform"},
259
+ "agent_type": {
260
+ "type": "string",
261
+ "description": "Agent type: explore, dewey, frontend, delphi",
262
+ "default": "explore",
263
+ },
264
+ "description": {"type": "string", "description": "Short description for status display"},
265
+ "model": {
266
+ "type": "string",
267
+ "description": "Model: gemini-3-flash (default) or claude",
268
+ "default": "gemini-3-flash",
269
+ },
270
+ "thinking_budget": {
271
+ "type": "integer",
272
+ "description": "Tokens reserved for internal reasoning (if model supports it)",
273
+ "default": 0,
274
+ },
275
+ "timeout": {
276
+ "type": "integer",
277
+ "description": "Maximum execution time in seconds",
278
+ "default": 300,
279
+ },
280
+ },
281
+ "required": ["prompt"],
282
+ },
283
+ ),
284
+ Tool(
285
+ name="agent_retry",
286
+ description="Retry a failed or timed-out background agent. Can optionally refine the prompt.",
287
+ inputSchema={
288
+ "type": "object",
289
+ "properties": {
290
+ "task_id": {"type": "string", "description": "The ID of the task to retry"},
291
+ "new_prompt": {"type": "string", "description": "Optional refined prompt for the retry"},
292
+ "new_timeout": {"type": "integer", "description": "Optional new timeout in seconds"},
293
+ },
294
+ "required": ["task_id"],
295
+ },
296
+ ),
297
+ Tool(
298
+ name="agent_output",
299
+ description="Get output from a background agent. Use block=true to wait for completion.",
300
+ inputSchema={
301
+ "type": "object",
302
+ "properties": {
303
+ "task_id": {"type": "string", "description": "The agent task ID"},
304
+ "block": {"type": "boolean", "description": "Wait for completion", "default": False},
305
+ },
306
+ "required": ["task_id"],
307
+ },
308
+ ),
309
+ Tool(
310
+ name="agent_cancel",
311
+ description="Cancel a running background agent.",
312
+ inputSchema={
313
+ "type": "object",
314
+ "properties": {
315
+ "task_id": {"type": "string", "description": "The agent task ID to cancel"},
316
+ },
317
+ "required": ["task_id"],
318
+ },
319
+ ),
320
+ Tool(
321
+ name="agent_list",
322
+ description="List all background agent tasks with their status.",
323
+ inputSchema={
324
+ "type": "object",
325
+ "properties": {},
326
+ },
327
+ ),
328
+ Tool(
329
+ name="agent_progress",
330
+ description="Get real-time progress from a running background agent. Shows recent output lines to monitor what the agent is doing.",
331
+ inputSchema={
332
+ "type": "object",
333
+ "properties": {
334
+ "task_id": {"type": "string", "description": "The agent task ID"},
335
+ "lines": {"type": "integer", "description": "Number of recent lines to show", "default": 20},
336
+ },
337
+ "required": ["task_id"],
338
+ },
339
+ ),
340
+ Tool(
341
+ name="lsp_hover",
342
+ description="Get type info, documentation, and signature at a position in a file.",
343
+ inputSchema={
344
+ "type": "object",
345
+ "properties": {
346
+ "file_path": {"type": "string", "description": "Absolute path to the file"},
347
+ "line": {"type": "integer", "description": "Line number (1-indexed)"},
348
+ "character": {"type": "integer", "description": "Character position (0-indexed)"},
349
+ },
350
+ "required": ["file_path", "line", "character"],
351
+ },
352
+ ),
353
+ Tool(
354
+ name="lsp_goto_definition",
355
+ description="Find where a symbol is defined. Jump to symbol definition.",
356
+ inputSchema={
357
+ "type": "object",
358
+ "properties": {
359
+ "file_path": {"type": "string", "description": "Absolute path to the file"},
360
+ "line": {"type": "integer", "description": "Line number (1-indexed)"},
361
+ "character": {"type": "integer", "description": "Character position (0-indexed)"},
362
+ },
363
+ "required": ["file_path", "line", "character"],
364
+ },
365
+ ),
366
+ Tool(
367
+ name="lsp_find_references",
368
+ description="Find all references to a symbol across the workspace.",
369
+ inputSchema={
370
+ "type": "object",
371
+ "properties": {
372
+ "file_path": {"type": "string", "description": "Absolute path to the file"},
373
+ "line": {"type": "integer", "description": "Line number (1-indexed)"},
374
+ "character": {"type": "integer", "description": "Character position (0-indexed)"},
375
+ "include_declaration": {"type": "boolean", "description": "Include the declaration itself", "default": True},
376
+ },
377
+ "required": ["file_path", "line", "character"],
378
+ },
379
+ ),
380
+ Tool(
381
+ name="lsp_document_symbols",
382
+ description="Get hierarchical outline of all symbols (functions, classes, methods) in a file.",
383
+ inputSchema={
384
+ "type": "object",
385
+ "properties": {
386
+ "file_path": {"type": "string", "description": "Absolute path to the file"},
387
+ },
388
+ "required": ["file_path"],
389
+ },
390
+ ),
391
+ Tool(
392
+ name="lsp_workspace_symbols",
393
+ description="Search for symbols by name across the entire workspace.",
394
+ inputSchema={
395
+ "type": "object",
396
+ "properties": {
397
+ "query": {"type": "string", "description": "Symbol name to search for (fuzzy match)"},
398
+ "directory": {"type": "string", "description": "Workspace directory", "default": "."},
399
+ },
400
+ "required": ["query"],
401
+ },
402
+ ),
403
+ Tool(
404
+ name="lsp_prepare_rename",
405
+ description="Check if a symbol at position can be renamed. Use before lsp_rename.",
406
+ inputSchema={
407
+ "type": "object",
408
+ "properties": {
409
+ "file_path": {"type": "string", "description": "Absolute path to the file"},
410
+ "line": {"type": "integer", "description": "Line number (1-indexed)"},
411
+ "character": {"type": "integer", "description": "Character position (0-indexed)"},
412
+ },
413
+ "required": ["file_path", "line", "character"],
414
+ },
415
+ ),
416
+ Tool(
417
+ name="lsp_rename",
418
+ description="Rename a symbol across the workspace. Use lsp_prepare_rename first to validate.",
419
+ inputSchema={
420
+ "type": "object",
421
+ "properties": {
422
+ "file_path": {"type": "string", "description": "Absolute path to the file"},
423
+ "line": {"type": "integer", "description": "Line number (1-indexed)"},
424
+ "character": {"type": "integer", "description": "Character position (0-indexed)"},
425
+ "new_name": {"type": "string", "description": "New name for the symbol"},
426
+ "dry_run": {"type": "boolean", "description": "Preview changes without applying", "default": True},
427
+ },
428
+ "required": ["file_path", "line", "character", "new_name"],
429
+ },
430
+ ),
431
+ Tool(
432
+ name="lsp_code_actions",
433
+ description="Get available quick fixes and refactorings at a position.",
434
+ inputSchema={
435
+ "type": "object",
436
+ "properties": {
437
+ "file_path": {"type": "string", "description": "Absolute path to the file"},
438
+ "line": {"type": "integer", "description": "Line number (1-indexed)"},
439
+ "character": {"type": "integer", "description": "Character position (0-indexed)"},
440
+ },
441
+ "required": ["file_path", "line", "character"],
442
+ },
443
+ ),
444
+ Tool(
445
+ name="lsp_servers",
446
+ description="List available LSP servers and their installation status.",
447
+ inputSchema={
448
+ "type": "object",
449
+ "properties": {},
450
+ },
451
+ ),
452
+ Tool(
453
+ name="ast_grep_replace",
454
+ description="Replace code patterns using ast-grep's AST-aware replacement. More reliable than text-based replace for refactoring.",
455
+ inputSchema={
456
+ "type": "object",
457
+ "properties": {
458
+ "pattern": {"type": "string", "description": "ast-grep pattern to search (e.g., 'console.log($A)')"},
459
+ "replacement": {"type": "string", "description": "Replacement pattern (e.g., 'logger.debug($A)')"},
460
+ "directory": {"type": "string", "description": "Directory to search in", "default": "."},
461
+ "language": {"type": "string", "description": "Filter by language (typescript, python, etc.)"},
462
+ "dry_run": {"type": "boolean", "description": "Preview changes without applying", "default": True},
463
+ },
464
+ "required": ["pattern", "replacement"],
465
+ },
466
+ ),
467
+ ]
468
+
469
+ def get_prompt_definitions() -> List[Prompt]:
470
+ """Return all Prompt definitions for the Stravinsky MCP server."""
471
+ return [
472
+ Prompt(
473
+ name="stravinsky",
474
+ description=(
475
+ "Stravinsky - Powerful AI orchestrator. "
476
+ "Plans obsessively with todos, assesses search complexity before "
477
+ "exploration, delegates strategically to specialized agents."
478
+ ),
479
+ arguments=[],
480
+ ),
481
+ Prompt(
482
+ name="delphi",
483
+ description=(
484
+ "Delphi - Strategic advisor using GPT for debugging, "
485
+ "architecture review, and complex problem solving."
486
+ ),
487
+ arguments=[],
488
+ ),
489
+ Prompt(
490
+ name="dewey",
491
+ description=(
492
+ "Dewey - Documentation and GitHub research specialist. "
493
+ "Finds implementation examples, official docs, and code patterns."
494
+ ),
495
+ arguments=[],
496
+ ),
497
+ Prompt(
498
+ name="explore",
499
+ description=(
500
+ "Explore - Fast codebase search specialist. "
501
+ "Answers 'Where is X?', finds files and code patterns."
502
+ ),
503
+ arguments=[],
504
+ ),
505
+ Prompt(
506
+ name="frontend",
507
+ description=(
508
+ "Frontend UI/UX Engineer - Designer-turned-developer for stunning visuals. "
509
+ "Excels at styling, layout, animation, typography."
510
+ ),
511
+ arguments=[],
512
+ ),
513
+ Prompt(
514
+ name="document_writer",
515
+ description=(
516
+ "Document Writer - Technical documentation specialist. "
517
+ "README files, API docs, architecture docs, user guides."
518
+ ),
519
+ arguments=[],
520
+ ),
521
+ Prompt(
522
+ name="multimodal",
523
+ description=(
524
+ "Multimodal Looker - Visual content analysis. "
525
+ "PDFs, images, diagrams - extracts and interprets visual data."
526
+ ),
527
+ arguments=[],
528
+ ),
529
+ ]
@@ -1,15 +1,18 @@
1
1
  # Tools module
2
2
  from .model_invoke import invoke_gemini, invoke_openai
3
- from .code_search import lsp_diagnostics, ast_grep_search, grep_search, glob_files
3
+ from .code_search import lsp_diagnostics, ast_grep_search, ast_grep_replace, grep_search, glob_files
4
4
  from .session_manager import list_sessions, read_session, search_sessions, get_session_info
5
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
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
7
9
 
8
10
  __all__ = [
9
11
  "invoke_gemini",
10
12
  "invoke_openai",
11
13
  "lsp_diagnostics",
12
14
  "ast_grep_search",
15
+ "ast_grep_replace",
13
16
  "grep_search",
14
17
  "glob_files",
15
18
  "list_sessions",
@@ -21,8 +24,14 @@ __all__ = [
21
24
  "create_skill",
22
25
  "agent_spawn",
23
26
  "agent_output",
27
+ "agent_retry",
24
28
  "agent_cancel",
25
29
  "agent_list",
26
30
  "agent_progress",
31
+ "task_spawn",
32
+ "task_status",
33
+ "task_list",
34
+ "enable_ralph_loop",
35
+ "disable_ralph_loop",
27
36
  ]
28
37