stravinsky 0.2.67__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 (190) 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 +112 -11
  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/MANIFEST_SCHEMA.md +305 -0
  11. mcp_bridge/config/README.md +276 -0
  12. mcp_bridge/config/__init__.py +2 -2
  13. mcp_bridge/config/hook_config.py +247 -0
  14. mcp_bridge/config/hooks_manifest.json +138 -0
  15. mcp_bridge/config/rate_limits.py +317 -0
  16. mcp_bridge/config/skills_manifest.json +128 -0
  17. mcp_bridge/hooks/HOOKS_SETTINGS.json +17 -4
  18. mcp_bridge/hooks/__init__.py +19 -4
  19. mcp_bridge/hooks/agent_reminder.py +4 -4
  20. mcp_bridge/hooks/auto_slash_command.py +5 -5
  21. mcp_bridge/hooks/budget_optimizer.py +2 -2
  22. mcp_bridge/hooks/claude_limits_hook.py +114 -0
  23. mcp_bridge/hooks/comment_checker.py +3 -4
  24. mcp_bridge/hooks/compaction.py +2 -2
  25. mcp_bridge/hooks/context.py +2 -1
  26. mcp_bridge/hooks/context_monitor.py +2 -2
  27. mcp_bridge/hooks/delegation_policy.py +85 -0
  28. mcp_bridge/hooks/directory_context.py +3 -3
  29. mcp_bridge/hooks/edit_recovery.py +3 -2
  30. mcp_bridge/hooks/edit_recovery_policy.py +49 -0
  31. mcp_bridge/hooks/empty_message_sanitizer.py +2 -2
  32. mcp_bridge/hooks/events.py +160 -0
  33. mcp_bridge/hooks/git_noninteractive.py +4 -4
  34. mcp_bridge/hooks/keyword_detector.py +8 -10
  35. mcp_bridge/hooks/manager.py +43 -22
  36. mcp_bridge/hooks/notification_hook.py +13 -6
  37. mcp_bridge/hooks/parallel_enforcement_policy.py +67 -0
  38. mcp_bridge/hooks/parallel_enforcer.py +5 -5
  39. mcp_bridge/hooks/parallel_execution.py +22 -10
  40. mcp_bridge/hooks/post_tool/parallel_validation.py +103 -0
  41. mcp_bridge/hooks/pre_compact.py +8 -9
  42. mcp_bridge/hooks/pre_tool/agent_spawn_validator.py +115 -0
  43. mcp_bridge/hooks/preemptive_compaction.py +2 -3
  44. mcp_bridge/hooks/routing_notifications.py +80 -0
  45. mcp_bridge/hooks/rules_injector.py +11 -19
  46. mcp_bridge/hooks/session_idle.py +4 -4
  47. mcp_bridge/hooks/session_notifier.py +4 -4
  48. mcp_bridge/hooks/session_recovery.py +4 -5
  49. mcp_bridge/hooks/stravinsky_mode.py +1 -1
  50. mcp_bridge/hooks/subagent_stop.py +1 -3
  51. mcp_bridge/hooks/task_validator.py +2 -2
  52. mcp_bridge/hooks/tmux_manager.py +7 -8
  53. mcp_bridge/hooks/todo_delegation.py +4 -1
  54. mcp_bridge/hooks/todo_enforcer.py +180 -10
  55. mcp_bridge/hooks/tool_messaging.py +113 -10
  56. mcp_bridge/hooks/truncation_policy.py +37 -0
  57. mcp_bridge/hooks/truncator.py +1 -2
  58. mcp_bridge/metrics/cost_tracker.py +115 -0
  59. mcp_bridge/native_search.py +93 -0
  60. mcp_bridge/native_watcher.py +118 -0
  61. mcp_bridge/notifications.py +150 -0
  62. mcp_bridge/orchestrator/enums.py +11 -0
  63. mcp_bridge/orchestrator/router.py +165 -0
  64. mcp_bridge/orchestrator/state.py +32 -0
  65. mcp_bridge/orchestrator/visualization.py +14 -0
  66. mcp_bridge/orchestrator/wisdom.py +34 -0
  67. mcp_bridge/prompts/__init__.py +1 -8
  68. mcp_bridge/prompts/dewey.py +1 -1
  69. mcp_bridge/prompts/planner.py +2 -4
  70. mcp_bridge/prompts/stravinsky.py +53 -31
  71. mcp_bridge/proxy/__init__.py +0 -0
  72. mcp_bridge/proxy/client.py +70 -0
  73. mcp_bridge/proxy/model_server.py +157 -0
  74. mcp_bridge/routing/__init__.py +43 -0
  75. mcp_bridge/routing/config.py +250 -0
  76. mcp_bridge/routing/model_tiers.py +135 -0
  77. mcp_bridge/routing/provider_state.py +261 -0
  78. mcp_bridge/routing/task_classifier.py +190 -0
  79. mcp_bridge/server.py +542 -59
  80. mcp_bridge/server_tools.py +738 -6
  81. mcp_bridge/tools/__init__.py +40 -25
  82. mcp_bridge/tools/agent_manager.py +616 -697
  83. mcp_bridge/tools/background_tasks.py +13 -17
  84. mcp_bridge/tools/code_search.py +70 -53
  85. mcp_bridge/tools/continuous_loop.py +0 -1
  86. mcp_bridge/tools/dashboard.py +19 -0
  87. mcp_bridge/tools/find_code.py +296 -0
  88. mcp_bridge/tools/init.py +1 -0
  89. mcp_bridge/tools/list_directory.py +42 -0
  90. mcp_bridge/tools/lsp/__init__.py +12 -5
  91. mcp_bridge/tools/lsp/manager.py +471 -0
  92. mcp_bridge/tools/lsp/tools.py +723 -207
  93. mcp_bridge/tools/model_invoke.py +1195 -273
  94. mcp_bridge/tools/mux_client.py +75 -0
  95. mcp_bridge/tools/project_context.py +1 -2
  96. mcp_bridge/tools/query_classifier.py +406 -0
  97. mcp_bridge/tools/read_file.py +84 -0
  98. mcp_bridge/tools/replace.py +45 -0
  99. mcp_bridge/tools/run_shell_command.py +38 -0
  100. mcp_bridge/tools/search_enhancements.py +347 -0
  101. mcp_bridge/tools/semantic_search.py +3627 -0
  102. mcp_bridge/tools/session_manager.py +0 -2
  103. mcp_bridge/tools/skill_loader.py +0 -1
  104. mcp_bridge/tools/task_runner.py +5 -7
  105. mcp_bridge/tools/templates.py +3 -3
  106. mcp_bridge/tools/tool_search.py +331 -0
  107. mcp_bridge/tools/write_file.py +29 -0
  108. mcp_bridge/update_manager.py +585 -0
  109. mcp_bridge/update_manager_pypi.py +297 -0
  110. mcp_bridge/utils/cache.py +82 -0
  111. mcp_bridge/utils/process.py +71 -0
  112. mcp_bridge/utils/session_state.py +51 -0
  113. mcp_bridge/utils/truncation.py +76 -0
  114. stravinsky-0.4.66.dist-info/METADATA +517 -0
  115. stravinsky-0.4.66.dist-info/RECORD +198 -0
  116. {stravinsky-0.2.67.dist-info → stravinsky-0.4.66.dist-info}/entry_points.txt +1 -0
  117. stravinsky_claude_assets/HOOKS_INTEGRATION.md +316 -0
  118. stravinsky_claude_assets/agents/HOOKS.md +437 -0
  119. stravinsky_claude_assets/agents/code-reviewer.md +210 -0
  120. stravinsky_claude_assets/agents/comment_checker.md +580 -0
  121. stravinsky_claude_assets/agents/debugger.md +254 -0
  122. stravinsky_claude_assets/agents/delphi.md +495 -0
  123. stravinsky_claude_assets/agents/dewey.md +248 -0
  124. stravinsky_claude_assets/agents/explore.md +1198 -0
  125. stravinsky_claude_assets/agents/frontend.md +472 -0
  126. stravinsky_claude_assets/agents/implementation-lead.md +164 -0
  127. stravinsky_claude_assets/agents/momus.md +464 -0
  128. stravinsky_claude_assets/agents/research-lead.md +141 -0
  129. stravinsky_claude_assets/agents/stravinsky.md +730 -0
  130. stravinsky_claude_assets/commands/delphi.md +9 -0
  131. stravinsky_claude_assets/commands/dewey.md +54 -0
  132. stravinsky_claude_assets/commands/git-master.md +112 -0
  133. stravinsky_claude_assets/commands/index.md +49 -0
  134. stravinsky_claude_assets/commands/publish.md +86 -0
  135. stravinsky_claude_assets/commands/review.md +73 -0
  136. stravinsky_claude_assets/commands/str/agent_cancel.md +70 -0
  137. stravinsky_claude_assets/commands/str/agent_list.md +56 -0
  138. stravinsky_claude_assets/commands/str/agent_output.md +92 -0
  139. stravinsky_claude_assets/commands/str/agent_progress.md +74 -0
  140. stravinsky_claude_assets/commands/str/agent_retry.md +94 -0
  141. stravinsky_claude_assets/commands/str/cancel.md +51 -0
  142. stravinsky_claude_assets/commands/str/clean.md +97 -0
  143. stravinsky_claude_assets/commands/str/continue.md +38 -0
  144. stravinsky_claude_assets/commands/str/index.md +199 -0
  145. stravinsky_claude_assets/commands/str/list_watchers.md +96 -0
  146. stravinsky_claude_assets/commands/str/search.md +205 -0
  147. stravinsky_claude_assets/commands/str/start_filewatch.md +136 -0
  148. stravinsky_claude_assets/commands/str/stats.md +71 -0
  149. stravinsky_claude_assets/commands/str/stop_filewatch.md +89 -0
  150. stravinsky_claude_assets/commands/str/unwatch.md +42 -0
  151. stravinsky_claude_assets/commands/str/watch.md +45 -0
  152. stravinsky_claude_assets/commands/strav.md +53 -0
  153. stravinsky_claude_assets/commands/stravinsky.md +292 -0
  154. stravinsky_claude_assets/commands/verify.md +60 -0
  155. stravinsky_claude_assets/commands/version.md +5 -0
  156. stravinsky_claude_assets/hooks/README.md +248 -0
  157. stravinsky_claude_assets/hooks/comment_checker.py +193 -0
  158. stravinsky_claude_assets/hooks/context.py +38 -0
  159. stravinsky_claude_assets/hooks/context_monitor.py +153 -0
  160. stravinsky_claude_assets/hooks/dependency_tracker.py +73 -0
  161. stravinsky_claude_assets/hooks/edit_recovery.py +46 -0
  162. stravinsky_claude_assets/hooks/execution_state_tracker.py +68 -0
  163. stravinsky_claude_assets/hooks/notification_hook.py +103 -0
  164. stravinsky_claude_assets/hooks/notification_hook_v2.py +96 -0
  165. stravinsky_claude_assets/hooks/parallel_execution.py +241 -0
  166. stravinsky_claude_assets/hooks/parallel_reinforcement.py +106 -0
  167. stravinsky_claude_assets/hooks/parallel_reinforcement_v2.py +112 -0
  168. stravinsky_claude_assets/hooks/pre_compact.py +123 -0
  169. stravinsky_claude_assets/hooks/ralph_loop.py +173 -0
  170. stravinsky_claude_assets/hooks/session_recovery.py +263 -0
  171. stravinsky_claude_assets/hooks/stop_hook.py +89 -0
  172. stravinsky_claude_assets/hooks/stravinsky_metrics.py +164 -0
  173. stravinsky_claude_assets/hooks/stravinsky_mode.py +146 -0
  174. stravinsky_claude_assets/hooks/subagent_stop.py +98 -0
  175. stravinsky_claude_assets/hooks/todo_continuation.py +111 -0
  176. stravinsky_claude_assets/hooks/todo_delegation.py +96 -0
  177. stravinsky_claude_assets/hooks/tool_messaging.py +281 -0
  178. stravinsky_claude_assets/hooks/truncator.py +23 -0
  179. stravinsky_claude_assets/rules/deployment_safety.md +51 -0
  180. stravinsky_claude_assets/rules/integration_wiring.md +89 -0
  181. stravinsky_claude_assets/rules/pypi_deployment.md +220 -0
  182. stravinsky_claude_assets/rules/stravinsky_orchestrator.md +32 -0
  183. stravinsky_claude_assets/settings.json +152 -0
  184. stravinsky_claude_assets/skills/chrome-devtools/SKILL.md +81 -0
  185. stravinsky_claude_assets/skills/sqlite/SKILL.md +77 -0
  186. stravinsky_claude_assets/skills/supabase/SKILL.md +74 -0
  187. stravinsky_claude_assets/task_dependencies.json +34 -0
  188. stravinsky-0.2.67.dist-info/METADATA +0 -284
  189. stravinsky-0.2.67.dist-info/RECORD +0 -76
  190. {stravinsky-0.2.67.dist-info → stravinsky-0.4.66.dist-info}/WHEEL +0 -0
@@ -0,0 +1,517 @@
1
+ Metadata-Version: 2.4
2
+ Name: stravinsky
3
+ Version: 0.4.66
4
+ Summary: A sophisticated MCP bridge for Claude Code orchestration
5
+ Project-URL: Repository, https://github.com/GratefulDave/stravinsky
6
+ Project-URL: Issues, https://github.com/GratefulDave/stravinsky/issues
7
+ Author: Stravinsky Team
8
+ License: MIT
9
+ Keywords: claude,gemini,mcp,oauth,openai
10
+ Requires-Python: <3.14,>=3.11
11
+ Requires-Dist: aiofiles>=23.1.0
12
+ Requires-Dist: chromadb>=0.6.0
13
+ Requires-Dist: cryptography>=41.0.0
14
+ Requires-Dist: fastapi>=0.128.0
15
+ Requires-Dist: google-auth-oauthlib>=1.0.0
16
+ Requires-Dist: google-auth>=2.20.0
17
+ Requires-Dist: google-genai>=0.2.0
18
+ Requires-Dist: httpx>=0.24.0
19
+ Requires-Dist: jedi-language-server>=0.41.0
20
+ Requires-Dist: jedi>=0.19.2
21
+ Requires-Dist: keyring>=25.7.0
22
+ Requires-Dist: lsprotocol>=2023.0.0
23
+ Requires-Dist: mcp>=1.2.1
24
+ Requires-Dist: ollama>=0.6.1
25
+ Requires-Dist: openai>=1.0.0
26
+ Requires-Dist: pathspec>=0.12.0
27
+ Requires-Dist: plyer>=2.1.0
28
+ Requires-Dist: psutil>=5.9.0
29
+ Requires-Dist: pydantic>=2.0.0
30
+ Requires-Dist: pygls>=1.3.0
31
+ Requires-Dist: python-dotenv>=1.0.0
32
+ Requires-Dist: rank-bm25==0.2.2
33
+ Requires-Dist: rich>=13.0.0
34
+ Requires-Dist: ruff>=0.14.10
35
+ Requires-Dist: tenacity>=8.5.0
36
+ Requires-Dist: uvicorn>=0.40.0
37
+ Requires-Dist: watchdog~=5.0.0
38
+ Provides-Extra: dev
39
+ Requires-Dist: mypy>=1.10.0; extra == 'dev'
40
+ Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
41
+ Requires-Dist: pytest>=8.0.0; extra == 'dev'
42
+ Requires-Dist: ruff>=0.4.0; extra == 'dev'
43
+ Provides-Extra: semantic
44
+ Requires-Dist: chromadb>=0.5.0; extra == 'semantic'
45
+ Description-Content-Type: text/markdown
46
+
47
+ # Stravinsky
48
+
49
+ **The Avant-Garde MCP Bridge for Claude Code**
50
+
51
+ *Movement • Rhythm • Precision*
52
+
53
+ ---
54
+
55
+ ## What is Stravinsky?
56
+
57
+ **Multi-model AI orchestration** with OAuth authentication for Claude Code.
58
+
59
+ ## Features
60
+
61
+ - 🔐 **OAuth Authentication** - Secure browser-based auth for Google (Gemini) and OpenAI (ChatGPT)
62
+ - 🤖 **Multi-Model Support** - Seamlessly invoke Gemini and GPT models from Claude
63
+ - 🎯 **Native Subagent Orchestration** - Auto-delegating orchestrator with parallel execution (zero CLI overhead)
64
+ - 🛠️ **40 MCP Tools** - Model invocation, code search, semantic search, LSP refactoring, session management, and more
65
+ - 🧠 **9 Specialized Native Agents** - Stravinsky (orchestrator), Research Lead, Implementation Lead, Delphi (GPT-5.2 advisor), Dewey (documentation), Explore (code search), Frontend (Gemini 3 Pro High UI/UX), Code Reviewer, Debugger
66
+ - 🔄 **Hook-Based Delegation** - PreToolUse hooks enforce delegation patterns with hard boundaries (exit code 2)
67
+ - 📝 **LSP Integration** - Full Language Server Protocol support with persistent servers (35x speedup), code refactoring, and advanced navigation
68
+ - 🔍 **AST-Aware Search** - Structural code search and refactoring with ast-grep
69
+ - 🧠 **Tier-Aware Routing** - Multi-provider fallback system (Claude 4.5, GPT 5.2, Gemini 3) with OAuth-first priority
70
+ - 🧠 **Tier-Aware Routing** - Multi-provider fallback system (Claude 4.5, GPT 5.2, Gemini 3) with OAuth-first priority
71
+ - 🧠 **Semantic Code Search** - Natural language queries with local embeddings (ChromaDB + Ollama)
72
+ - ⚡ **Cost-Optimized Routing** - Free/cheap agents (explore, dewey) always async, expensive (delphi) only when needed
73
+
74
+ ## Quick Start
75
+
76
+ ### Installation
77
+
78
+ **CRITICAL: Always use --scope user with @latest for auto-updates and Python 3.13**
79
+
80
+ ```bash
81
+ # CORRECT: User-level installation with Python 3.13 and automatic updates
82
+ claude mcp add --scope user stravinsky -- uvx --python python3.13 stravinsky@latest
83
+
84
+ # Why this matters:
85
+ # - --scope user: Works across all projects (stored in ~/.claude.json)
86
+ # - @latest: Auto-checks PyPI on every Claude restart (no stale cache)
87
+ # - --python python3.13: Required due to chromadb → onnxruntime dependency (no Python 3.14+ support)
88
+ ```
89
+
90
+ **⚠️ Python 3.13 Required**: Stravinsky requires Python 3.13 or earlier. Python 3.14+ is not supported because chromadb depends on onnxruntime, which lacks wheels for Python 3.14+.
91
+
92
+ **WRONG - Do NOT use these:**
93
+
94
+ ```bash
95
+ # ❌ Missing --python python3.13 (will fail on system Python 3.14+)
96
+ claude mcp add --global stravinsky -- uvx stravinsky@latest
97
+
98
+ # ❌ Local scope (only works in one project)
99
+ claude mcp add stravinsky -- uvx --python python3.13 stravinsky@latest
100
+
101
+ # ❌ No @latest (cache never updates, stays on old version)
102
+ claude mcp add --global stravinsky -- uvx --python python3.13 stravinsky
103
+
104
+ # ❌ uv tool install (requires manual upgrades)
105
+ uv tool install stravinsky
106
+ ```
107
+
108
+ **Development (local editable install):**
109
+
110
+ ```bash
111
+ # ONLY for active development on stravinsky source code
112
+ cd /path/to/stravinsky
113
+ uv tool install --editable . --force
114
+ claude mcp add --scope user stravinsky -- stravinsky
115
+ ```
116
+
117
+ ### Authentication
118
+
119
+ Stravinsky supports **two authentication methods** for Gemini (OAuth-first with automatic API fallback):
120
+
121
+ #### Option 1: OAuth (Recommended - Primary Method)
122
+
123
+ **Full OAuth flow** with automatic token refresh:
124
+
125
+ ```bash
126
+ # Login to Google (Gemini)
127
+ stravinsky-auth login gemini
128
+
129
+ # Login to OpenAI (ChatGPT Plus/Pro required)
130
+ stravinsky-auth login openai
131
+
132
+ # Check status
133
+ stravinsky-auth status
134
+
135
+ # Logout
136
+ stravinsky-auth logout gemini
137
+ ```
138
+
139
+ **When to use:** Primary method for all use cases. Provides automatic fallback to API key on rate limits.
140
+
141
+ **Rate Limit Architecture:**
142
+ - **OAuth**: Lower rate limits, but convenient (no API key management)
143
+ - **API Key**: **Tier 3 high quotas** - automatic fallback for heavy usage
144
+
145
+ **Auth Priority:**
146
+ 1. OAuth is tried FUWT (if configured)
147
+ 2. On OAuth 429 rate limit → **Automatically switch to API key** (Tier 3 quotas) for 5 minutes
148
+ 3. After 5-minute cooldown → Retry OAuth
149
+
150
+ #### Option 2: API Key (**Tier 3 High Quotas** - Automatic Fallback)
151
+
152
+ **CRITICAL**: Use a **Tier 3 API key** for high-volume usage. OAuth has lower limits and automatically falls back to your API key.
153
+
154
+ **Setup** - add your Gemini API key to `.env`:
155
+
156
+ ```bash
157
+ # Add to your .env file (or export in shell)
158
+ GEMINI_API_KEY=your_tier_3_api_key_here
159
+
160
+ # Or use GOOGLE_API_KEY (same effect)
161
+ GOOGLE_API_KEY=your_tier_3_api_key_here
162
+ ```
163
+
164
+ **Get your API key:**
165
+ 1. Visit [Google AI Studio](https://aistudio.google.com/app/apikey)
166
+ 2. Create an API key (ensure it's Tier 3 for high quotas)
167
+ 3. Add to `.env` file in your project root
168
+
169
+ **When to use:**
170
+ - **Primary**: Automatic fallback when OAuth rate limits are exhausted (recommended for all users)
171
+ - Development/testing without OAuth setup
172
+
173
+ **Secure Token Storage:**
174
+
175
+ OAuth tokens are stored securely with automatic fallback:
176
+ - **Primary**: System keyring (macOS Keychain, Linux Secret Service, Windows Credential Locker)
177
+ - **Fallback**: Encrypted files at `~/.stravinsky/tokens/` using Fernet symmetric encryption
178
+ - **Encryption**: AES-128-CBC with keys stored at `~/.stravinsky/tokens/.key` (0o600 permissions)
179
+ - **No password prompts**: Seamless authentication across all terminal sessions after initial login
180
+ - **Global access**: Works everywhere after one-time authentication per provider
181
+
182
+ #### Troubleshooting: Password Prompts (macOS)
183
+
184
+ If you experience persistent password prompts when authenticating, configure keyring to bypass macOS Keychain:
185
+
186
+ ```bash
187
+ # 1. Create keyring config directory
188
+ mkdir -p ~/.config/python_keyring
189
+
190
+ # 2. Configure keyring to use fail backend (bypasses Keychain entirely)
191
+ cat <<EOT > ~/.config/python_keyring/keyringrc.cfg
192
+ [backend]
193
+ default-keyring = keyring.backends.fail.Keyring
194
+ EOT
195
+
196
+ # 3. Verify configuration
197
+ cat ~/.config/python_keyring/keyringrc.cfg
198
+
199
+ # 4. Re-authenticate (tokens will be stored in encrypted files only)
200
+ stravinsky-auth login gemini
201
+ ```
202
+
203
+ This configuration stores tokens in encrypted files at `~/.stravinsky/tokens/` instead of macOS Keychain, eliminating password prompts across terminal sessions. See [docs/reports/KEYRING_AUTH_FIX.md](docs/reports/KEYRING_AUTH_FIX.md) for detailed information.
204
+
205
+ ### Slash Commands
206
+
207
+ Slash commands are discovered from:
208
+ - Project-local: `.claude/commands/**/*.md` (recursive)
209
+ - User-global: `~/.claude/commands/**/*.md` (recursive)
210
+
211
+ Commands can be organized in subdirectories (e.g., `.claude/commands/strav/stravinsky.md`).
212
+
213
+ ## Native Subagent Architecture (PRIMARY)
214
+
215
+ Stravinsky is architected around the **Native Subagent Pattern**. This design delegates specialized tasks to standalone Claude Code agents, enabling massive parallelism and reducing orchestrator cognitive load.
216
+
217
+ ### Why Native Subagents?
218
+ - **True Parallelism**: Spawn multiple agents (Explore, Dewey, Reviewer) simultaneously using the `Task` tool.
219
+ - **Zero Bridge Latency**: Agents interact directly with the project codebase using native tools.
220
+ - **Specialized Context**: Each agent type has a bespoke system prompt and focused toolset.
221
+
222
+ ---
223
+
224
+ ## Model Proxy (NEW in v0.4.58)
225
+
226
+ To solve the "Head-of-Line Blocking" problem in MCP stdio, Stravinsky now includes a dedicated **Model Proxy**.
227
+
228
+ ### The Problem:
229
+ When Claude calls `invoke_gemini` directly through MCP, the entire stdio communication channel is blocked until the model finishes generating. This prevents parallel execution and makes the UI feel sluggish.
230
+
231
+ ### The Solution:
232
+ The **Stravinsky Model Proxy** runs as a separate FastAPI process. Model requests are offloaded to this process, allowing the MCP bridge to handle other tool calls immediately.
233
+
234
+ ### Performance Benefits:
235
+ - **Async Concurrency**: Handle 20+ simultaneous model calls with <10ms overhead.
236
+ - **Zero CLI Blocking**: Keep the main Claude CLI responsive during long generations.
237
+ - **Observability**: Real-time request tracking, Process-Time headers, and trace IDs.
238
+
239
+ ### Usage:
240
+ 1. **Start the Proxy** in a separate terminal:
241
+ ```bash
242
+ stravinsky-proxy
243
+ ```
244
+ 2. **Enable in Claude**: Set the environment variable:
245
+ ```bash
246
+ export STRAVINSKY_USE_PROXY=true
247
+ ```
248
+
249
+ ---
250
+
251
+ ## Features
252
+
253
+ | Category | Tools |
254
+ | ---------------- | ---------------------------------------------------------------------------------- |
255
+ | **Model Invoke** | `invoke_gemini`, `invoke_gemini_agentic`, `invoke_openai` (3 tools) |
256
+ | **Environment** | `get_project_context`, `get_system_health`, `stravinsky_version`, `system_restart`, `semantic_health`, `lsp_health` (6 tools) |
257
+ | **Background Tasks** | `task_spawn`, `task_status`, `task_list` (3 tools) |
258
+ | **Agents** | `agent_spawn`, `agent_output`, `agent_cancel`, `agent_list`, `agent_progress`, `agent_retry` (6 tools) |
259
+ | **Code Search** | `ast_grep_search`, `ast_grep_replace`, `grep_search`, `glob_files` (4 tools) |
260
+ | **Semantic** | `semantic_search`, `hybrid_search`, `semantic_index`, `semantic_stats`, `start_file_watcher`, `stop_file_watcher`, `cancel_indexing`, `delete_index`, `list_file_watchers`, `multi_query_search`, `decomposed_search`, `enhanced_search` (12 tools) |
261
+ | **LSP** | `lsp_diagnostics`, `lsp_hover`, `lsp_goto_definition`, `lsp_find_references`, `lsp_document_symbols`, `lsp_workspace_symbols`, `lsp_prepare_rename`, `lsp_rename`, `lsp_code_actions`, `lsp_code_action_resolve`, `lsp_extract_refactor`, `lsp_servers` (12 tools) |
262
+ | **Sessions** | `session_list`, `session_read`, `session_search` (3 tools) |
263
+ | **Skills** | `skill_list`, `skill_get` (2 tools) |
264
+
265
+ ### LSP Performance & Refactoring
266
+
267
+ The Phase 2 update introduced the `LSPManager`, which maintains persistent language server instances:
268
+
269
+ - **35x Speedup**: Subsequent LSP calls are near-instant because the server no longer needs to re-initialize and re-index the codebase for every request
270
+ - **Code Refactoring**: New support for `lsp_extract_refactor` allows automated code extraction (e.g., extracting a method or variable) with full symbol resolution
271
+ - **Code Actions**: `lsp_code_action_resolve` enables complex, multi-step refactoring workflows with automatic fixes for diagnostics
272
+
273
+ ### Semantic Code Search
274
+
275
+ Natural language code search powered by embeddings. Find code by meaning, not just keywords.
276
+
277
+ **Prerequisites:**
278
+
279
+ ```bash
280
+ # Install Ollama (default provider - free, local)
281
+ brew install ollama
282
+
283
+ # Pull the recommended lightweight embedding model (274MB)
284
+ ollama pull nomic-embed-text
285
+
286
+ # Or for better accuracy (670MB, slower):
287
+ ollama pull mxbai-embed-large
288
+ ```
289
+
290
+ **Recommended model:** `nomic-embed-text` is lightweight (274MB), fast, and works great for code search. It's the best choice for most users, especially on space-constrained systems like MacBooks.
291
+
292
+ **Workflow:**
293
+
294
+ ```bash
295
+ # STEP 1: Initial indexing (REQUIRED - run once per project)
296
+ semantic_index(project_path=".", provider="ollama")
297
+
298
+ # STEP 2: Enable auto-updates (OPTIONAL - recommended for active projects)
299
+ start_file_watcher(".", provider="ollama", debounce_seconds=2.0)
300
+
301
+ # STEP 3: Search your codebase with natural language
302
+ semantic_search(query="OAuth authentication logic", n_results=5)
303
+ semantic_stats() # View index statistics
304
+
305
+ # STEP 4: Stop watching when done (optional - watcher cleans up on exit)
306
+ stop_file_watcher(".")
307
+
308
+ # OPTIONAL: Cancel ongoing indexing (for large codebases)
309
+ cancel_indexing(project_path=".", provider="ollama")
310
+
311
+ # OPTIONAL: Delete indexes
312
+ delete_index(project_path=".", provider="ollama") # Delete ollama index for this project
313
+ delete_index(project_path=".") # Delete all provider indexes for this project
314
+ delete_index(delete_all=True) # Delete ALL indexes for ALL projects
315
+ ```
316
+
317
+ **⚠️ Important:** You MUST run `semantic_index()` first before using semantic search or starting the FileWatcher. If you skip this step:
318
+ - `semantic_search()` will return no results
319
+ - `start_file_watcher()` will show a warning but still work (indexes on first file change)
320
+
321
+ **Example queries:**
322
+ - "find authentication logic"
323
+ - "error handling in API endpoints"
324
+ - "database connection pooling"
325
+
326
+ **Providers:**
327
+
328
+ | Provider | Model | Size | Cost | Setup |
329
+ |----------|-------|------|------|-------|
330
+ | `ollama` (default) | nomic-embed-text (recommended) | 274MB | Free/local | `ollama pull nomic-embed-text` |
331
+ | `ollama` | mxbai-embed-large (advanced) | 670MB | Free/local | `ollama pull mxbai-embed-large` |
332
+ | `gemini` | gemini-embedding-001 | N/A | OAuth/cloud | `stravinsky-auth login gemini` |
333
+ | `openai` | text-embedding-3-small | N/A | OAuth/cloud | `stravinsky-auth login openai` |
334
+
335
+ **Technical details:**
336
+ - **AST-aware chunking**: Python files split by functions/classes for better semantic boundaries
337
+ - **Persistent storage**: ChromaDB at `~/.stravinsky/vectordb/<project>_<provider>/`
338
+ - **Async parallel embeddings**: 10 concurrent for fast indexing
339
+ - **Automatic file watching**: Background reindexing on code changes with configurable debouncing (2s default)
340
+
341
+ ## Native Subagents (9)
342
+
343
+ Configured in `.claude/agents/*.md`:
344
+
345
+ | Agent | Purpose | Location |
346
+ | ---------------- | --------------------------------------------------------------------- | -------- |
347
+ | `stravinsky` | Task orchestration with 32k extended thinking (Sonnet 4.5) | .claude/agents/stravinsky.md |
348
+ | `research-lead` | Research coordinator - spawns explore/dewey, synthesizes findings (Gemini Flash) | .claude/agents/research-lead.md |
349
+ | `implementation-lead` | Implementation coordinator - spawns frontend/debugger/reviewer (Haiku) | .claude/agents/implementation-lead.md |
350
+ | `explore` | Codebase search and structural analysis (Gemini 3 Flash) | .claude/agents/explore.md |
351
+ | `dewey` | Documentation research and web search (Gemini 3 Flash) | .claude/agents/dewey.md |
352
+ | `code-reviewer` | Security, quality, and best practice analysis (Claude Sonnet) | .claude/agents/code-reviewer.md |
353
+ | `debugger` | Root cause analysis and fix strategies (Claude Sonnet) | .claude/agents/debugger.md |
354
+ | `frontend` | UI/UX implementation with creative generation (Gemini 3 Pro High) | .claude/agents/frontend.md |
355
+ | `delphi` | Strategic architecture advisor with 32k thinking (GPT-5.2 Medium) | .claude/agents/delphi.md |
356
+
357
+ ## Development
358
+
359
+ ```bash
360
+ # Install in development mode
361
+ uv pip install -e .
362
+
363
+ # Run server
364
+ stravinsky
365
+ ```
366
+
367
+ ## Project Structure
368
+
369
+ ```
370
+ stravinsky/
371
+ ├── .claude/ # Claude Code configuration
372
+ │ ├── agents/ # Native subagent configurations (7 agents)
373
+ │ │ ├── stravinsky.md # Orchestrator (auto-delegated)
374
+ │ │ ├── explore.md # Code search specialist
375
+ │ │ ├── dewey.md # Documentation research
376
+ │ │ ├── code-reviewer.md # Quality analysis
377
+ │ │ ├── debugger.md # Root cause analysis
378
+ │ │ ├── frontend.md # UI/UX specialist
379
+ │ │ ├── delphi.md # Strategic advisor (GPT-5.2)
380
+ │ │ └── HOOKS.md # Hook architecture guide
381
+ │ ├── commands/ # Slash commands (skills)
382
+ │ │ ├── stravinsky.md # /strav orchestrator
383
+ │ │ ├── delphi.md # /delphi strategic advisor
384
+ │ │ ├── dewey.md # /dewey documentation research
385
+ │ │ ├── publish.md # /publish PyPI release
386
+ │ │ ├── review.md # /review code review
387
+ │ │ ├── verify.md # /verify post-implementation
388
+ │ │ └── version.md # /version diagnostic info
389
+ │ ├── hooks/ # Native Claude Code hooks (11 hooks)
390
+ │ │ ├── stravinsky_mode.py # PreToolUse delegation enforcer
391
+ │ │ ├── context.py # UserPromptSubmit context injection
392
+ │ │ ├── todo_continuation.py # UserPromptSubmit todo continuation
393
+ │ │ ├── truncator.py # PostToolUse output truncation
394
+ │ │ ├── tool_messaging.py # PostToolUse user messaging
395
+ │ │ ├── edit_recovery.py # PostToolUse edit backup
396
+ │ │ ├── todo_delegation.py # PostToolUse parallel reminder
397
+ │ │ ├── parallel_execution.py # PostToolUse parallel enforcement
398
+ │ │ ├── notification_hook.py # PreToolUse agent spawn notifications
399
+ │ │ ├── subagent_stop.py # PostToolUse agent completion handling
400
+ │ │ └── pre_compact.py # PreCompact context preservation
401
+ │ ├── skills/ # Skill library (empty, skills in commands/)
402
+ │ ├── settings.json # Hook configuration
403
+ │ └── HOOKS_INTEGRATION.md # Hook integration guide
404
+ ├── mcp_bridge/ # Python MCP server
405
+ │ ├── server.py # MCP server entry point
406
+ │ ├── server_tools.py # Tool definitions
407
+ │ ├── auth/ # OAuth authentication
408
+ │ │ ├── oauth.py # Google OAuth (Gemini)
409
+ │ │ ├── openai_oauth.py # OpenAI OAuth (ChatGPT)
410
+ │ │ ├── token_store.py # Keyring storage
411
+ │ │ ├── token_refresh.py # Auto-refresh tokens
412
+ │ │ └── cli.py # stravinsky-auth CLI
413
+ │ ├── tools/ # MCP tool implementations
414
+ │ │ ├── model_invoke.py # invoke_gemini, invoke_openai
415
+ │ │ ├── agent_manager.py # agent_spawn, agent_output, etc.
416
+ │ │ ├── code_search.py # ast_grep, grep, glob
417
+ │ │ ├── semantic_search.py # semantic_search, semantic_index, semantic_stats
418
+ │ │ ├── session_manager.py # session_list, session_read, etc.
419
+ │ │ ├── skill_loader.py # skill_list, skill_get
420
+ │ │ ├── project_context.py # get_project_context
421
+ │ │ ├── lsp/ # LSP tool implementations
422
+ │ │ └── templates.py # Project templates
423
+ │ ├── prompts/ # Agent system prompts (legacy CLI)
424
+ │ │ ├── stravinsky.py # Legacy orchestrator prompt
425
+ │ │ ├── delphi.py # Legacy advisor prompt
426
+ │ │ ├── dewey.py # Legacy research prompt
427
+ │ │ ├── explore.py # Legacy search prompt
428
+ │ │ ├── frontend.py # Legacy UI/UX prompt
429
+ │ │ └── multimodal.py # Multimodal analysis prompt
430
+ │ ├── hooks/ # MCP internal hooks (17+ hooks)
431
+ │ │ ├── manager.py # Hook orchestration
432
+ │ │ ├── truncator.py # Output truncation
433
+ │ │ ├── parallel_enforcer.py # Parallel execution
434
+ │ │ ├── todo_enforcer.py # Todo continuation
435
+ │ │ └── ... # 13+ more optimization hooks
436
+ │ ├── native_hooks/ # Native Claude Code hooks
437
+ │ │ ├── stravinsky_mode.py # PreToolUse delegation enforcer
438
+ │ │ ├── tool_messaging.py # PostToolUse user messaging
439
+ │ │ ├── todo_delegation.py # TodoWrite parallel reminder
440
+ │ │ ├── todo_continuation.py # UserPromptSubmit todo injection
441
+ │ │ ├── context.py # UserPromptSubmit context
442
+ │ │ ├── truncator.py # PostToolUse truncation
443
+ │ │ └── edit_recovery.py # PostToolUse backup
444
+ │ ├── cli/ # CLI utilities
445
+ │ │ └── session_report.py # Session analysis
446
+ │ ├── config/ # Configuration
447
+ │ │ └── hooks.py # Hook configuration
448
+ │ └── utils/ # Utility functions
449
+ ├── .stravinsky/ # Agent execution logs (gitignored)
450
+ ├── assets/ # Logo, images
451
+ ├── docs/ # Additional documentation
452
+ ├── logs/ # Application logs
453
+ ├── tests/ # Test suite
454
+ ├── pyproject.toml # Build configuration
455
+ ├── uv.lock # Dependency lock
456
+ ├── ARCHITECTURE.md # Architecture guide (oh-my-opencode comparison)
457
+ ├── CLAUDE.md # Project instructions
458
+ ├── INSTALL.md # Installation guide
459
+ └── README.md # This file
460
+ ```
461
+
462
+ ## Troubleshooting
463
+
464
+ ### OpenAI "Port 1455 in use"
465
+
466
+ The Codex CLI uses the same port. Stop it with: `killall codex`
467
+
468
+ ### OpenAI Authentication Failed
469
+
470
+ - Ensure you have a ChatGPT Plus/Pro subscription
471
+ - Tokens expire occasionally; run `stravinsky-auth login openai` to refresh
472
+
473
+ ### Claude Code Not Loading Latest Version After Update
474
+
475
+ **Problem:** After deploying a new version to PyPI, Claude Code still uses the old cached version even after restart.
476
+
477
+ **Root Cause:** `uvx` caches packages and doesn't automatically check for updates. This is a known uvx behavior that affects all packages, not just Stravinsky.
478
+
479
+ **Solution - Force Reinstall:**
480
+
481
+ ```bash
482
+ # Option 1: Run latest version with uvx (if using uvx in .mcp.json)
483
+ uvx stravinsky@latest
484
+
485
+ # Option 2: Upgrade with uv tool (if installed globally)
486
+ uv tool install --upgrade --force stravinsky
487
+ # or reinstall all tools:
488
+ uv tool upgrade --all --reinstall
489
+
490
+ # Option 3: Clear uvx cache entirely (nuclear option)
491
+ uv cache prune
492
+
493
+ # Option 4: Remove and re-add MCP server
494
+ claude mcp remove stravinsky
495
+ claude mcp add stravinsky -- uvx stravinsky@latest
496
+
497
+ # After any option, restart Claude Code
498
+ claude restart
499
+ ```
500
+
501
+ **Verify Version:**
502
+
503
+ ```bash
504
+ # Check installed version
505
+ stravinsky --version
506
+ # or
507
+ python -c "import mcp_bridge; print(mcp_bridge.__version__)"
508
+
509
+ # Check PyPI latest version
510
+ curl -s https://pypi.org/pypi/stravinsky/json | python -c "import sys, json; print(json.load(sys.stdin)['info']['version'])"
511
+ ```
512
+
513
+ ## License
514
+
515
+ MIT
516
+
517
+ ---