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.
- mcp_bridge/__init__.py +1 -1
- mcp_bridge/auth/__init__.py +16 -6
- mcp_bridge/auth/cli.py +202 -11
- mcp_bridge/auth/oauth.py +1 -2
- mcp_bridge/auth/openai_oauth.py +4 -7
- mcp_bridge/auth/token_store.py +0 -1
- mcp_bridge/cli/__init__.py +1 -1
- mcp_bridge/cli/install_hooks.py +503 -107
- mcp_bridge/cli/session_report.py +0 -3
- mcp_bridge/config/__init__.py +2 -2
- mcp_bridge/config/hook_config.py +3 -5
- mcp_bridge/config/rate_limits.py +108 -13
- mcp_bridge/hooks/HOOKS_SETTINGS.json +17 -4
- mcp_bridge/hooks/__init__.py +14 -4
- mcp_bridge/hooks/agent_reminder.py +4 -4
- mcp_bridge/hooks/auto_slash_command.py +5 -5
- mcp_bridge/hooks/budget_optimizer.py +2 -2
- mcp_bridge/hooks/claude_limits_hook.py +114 -0
- mcp_bridge/hooks/comment_checker.py +3 -4
- mcp_bridge/hooks/compaction.py +2 -2
- mcp_bridge/hooks/context.py +2 -1
- mcp_bridge/hooks/context_monitor.py +2 -2
- mcp_bridge/hooks/delegation_policy.py +85 -0
- mcp_bridge/hooks/directory_context.py +3 -3
- mcp_bridge/hooks/edit_recovery.py +3 -2
- mcp_bridge/hooks/edit_recovery_policy.py +49 -0
- mcp_bridge/hooks/empty_message_sanitizer.py +2 -2
- mcp_bridge/hooks/events.py +160 -0
- mcp_bridge/hooks/git_noninteractive.py +4 -4
- mcp_bridge/hooks/keyword_detector.py +8 -10
- mcp_bridge/hooks/manager.py +35 -22
- mcp_bridge/hooks/notification_hook.py +13 -6
- mcp_bridge/hooks/parallel_enforcement_policy.py +67 -0
- mcp_bridge/hooks/parallel_enforcer.py +5 -5
- mcp_bridge/hooks/parallel_execution.py +22 -10
- mcp_bridge/hooks/post_tool/parallel_validation.py +103 -0
- mcp_bridge/hooks/pre_compact.py +8 -9
- mcp_bridge/hooks/pre_tool/agent_spawn_validator.py +115 -0
- mcp_bridge/hooks/preemptive_compaction.py +2 -3
- mcp_bridge/hooks/routing_notifications.py +80 -0
- mcp_bridge/hooks/rules_injector.py +11 -19
- mcp_bridge/hooks/session_idle.py +4 -4
- mcp_bridge/hooks/session_notifier.py +4 -4
- mcp_bridge/hooks/session_recovery.py +4 -5
- mcp_bridge/hooks/stravinsky_mode.py +1 -1
- mcp_bridge/hooks/subagent_stop.py +1 -3
- mcp_bridge/hooks/task_validator.py +2 -2
- mcp_bridge/hooks/tmux_manager.py +7 -8
- mcp_bridge/hooks/todo_delegation.py +4 -1
- mcp_bridge/hooks/todo_enforcer.py +180 -10
- mcp_bridge/hooks/truncation_policy.py +37 -0
- mcp_bridge/hooks/truncator.py +1 -2
- mcp_bridge/metrics/cost_tracker.py +115 -0
- mcp_bridge/native_search.py +93 -0
- mcp_bridge/native_watcher.py +118 -0
- mcp_bridge/notifications.py +3 -4
- mcp_bridge/orchestrator/enums.py +11 -0
- mcp_bridge/orchestrator/router.py +165 -0
- mcp_bridge/orchestrator/state.py +32 -0
- mcp_bridge/orchestrator/visualization.py +14 -0
- mcp_bridge/orchestrator/wisdom.py +34 -0
- mcp_bridge/prompts/__init__.py +1 -8
- mcp_bridge/prompts/dewey.py +1 -1
- mcp_bridge/prompts/planner.py +2 -4
- mcp_bridge/prompts/stravinsky.py +53 -31
- mcp_bridge/proxy/__init__.py +0 -0
- mcp_bridge/proxy/client.py +70 -0
- mcp_bridge/proxy/model_server.py +157 -0
- mcp_bridge/routing/__init__.py +43 -0
- mcp_bridge/routing/config.py +250 -0
- mcp_bridge/routing/model_tiers.py +135 -0
- mcp_bridge/routing/provider_state.py +261 -0
- mcp_bridge/routing/task_classifier.py +190 -0
- mcp_bridge/server.py +363 -34
- mcp_bridge/server_tools.py +298 -6
- mcp_bridge/tools/__init__.py +19 -8
- mcp_bridge/tools/agent_manager.py +549 -799
- mcp_bridge/tools/background_tasks.py +13 -17
- mcp_bridge/tools/code_search.py +54 -51
- mcp_bridge/tools/continuous_loop.py +0 -1
- mcp_bridge/tools/dashboard.py +19 -0
- mcp_bridge/tools/find_code.py +296 -0
- mcp_bridge/tools/init.py +1 -0
- mcp_bridge/tools/list_directory.py +42 -0
- mcp_bridge/tools/lsp/__init__.py +8 -8
- mcp_bridge/tools/lsp/manager.py +51 -28
- mcp_bridge/tools/lsp/tools.py +98 -65
- mcp_bridge/tools/model_invoke.py +1047 -152
- mcp_bridge/tools/mux_client.py +75 -0
- mcp_bridge/tools/project_context.py +1 -2
- mcp_bridge/tools/query_classifier.py +132 -49
- mcp_bridge/tools/read_file.py +84 -0
- mcp_bridge/tools/replace.py +45 -0
- mcp_bridge/tools/run_shell_command.py +38 -0
- mcp_bridge/tools/search_enhancements.py +347 -0
- mcp_bridge/tools/semantic_search.py +677 -92
- mcp_bridge/tools/session_manager.py +0 -2
- mcp_bridge/tools/skill_loader.py +0 -1
- mcp_bridge/tools/task_runner.py +5 -7
- mcp_bridge/tools/templates.py +3 -3
- mcp_bridge/tools/tool_search.py +331 -0
- mcp_bridge/tools/write_file.py +29 -0
- mcp_bridge/update_manager.py +33 -37
- mcp_bridge/update_manager_pypi.py +6 -8
- mcp_bridge/utils/cache.py +82 -0
- mcp_bridge/utils/process.py +71 -0
- mcp_bridge/utils/session_state.py +51 -0
- mcp_bridge/utils/truncation.py +76 -0
- {stravinsky-0.4.18.dist-info → stravinsky-0.4.66.dist-info}/METADATA +84 -35
- stravinsky-0.4.66.dist-info/RECORD +198 -0
- {stravinsky-0.4.18.dist-info → stravinsky-0.4.66.dist-info}/entry_points.txt +1 -0
- stravinsky_claude_assets/HOOKS_INTEGRATION.md +316 -0
- stravinsky_claude_assets/agents/HOOKS.md +437 -0
- stravinsky_claude_assets/agents/code-reviewer.md +210 -0
- stravinsky_claude_assets/agents/comment_checker.md +580 -0
- stravinsky_claude_assets/agents/debugger.md +254 -0
- stravinsky_claude_assets/agents/delphi.md +495 -0
- stravinsky_claude_assets/agents/dewey.md +248 -0
- stravinsky_claude_assets/agents/explore.md +1198 -0
- stravinsky_claude_assets/agents/frontend.md +472 -0
- stravinsky_claude_assets/agents/implementation-lead.md +164 -0
- stravinsky_claude_assets/agents/momus.md +464 -0
- stravinsky_claude_assets/agents/research-lead.md +141 -0
- stravinsky_claude_assets/agents/stravinsky.md +730 -0
- stravinsky_claude_assets/commands/delphi.md +9 -0
- stravinsky_claude_assets/commands/dewey.md +54 -0
- stravinsky_claude_assets/commands/git-master.md +112 -0
- stravinsky_claude_assets/commands/index.md +49 -0
- stravinsky_claude_assets/commands/publish.md +86 -0
- stravinsky_claude_assets/commands/review.md +73 -0
- stravinsky_claude_assets/commands/str/agent_cancel.md +70 -0
- stravinsky_claude_assets/commands/str/agent_list.md +56 -0
- stravinsky_claude_assets/commands/str/agent_output.md +92 -0
- stravinsky_claude_assets/commands/str/agent_progress.md +74 -0
- stravinsky_claude_assets/commands/str/agent_retry.md +94 -0
- stravinsky_claude_assets/commands/str/cancel.md +51 -0
- stravinsky_claude_assets/commands/str/clean.md +97 -0
- stravinsky_claude_assets/commands/str/continue.md +38 -0
- stravinsky_claude_assets/commands/str/index.md +199 -0
- stravinsky_claude_assets/commands/str/list_watchers.md +96 -0
- stravinsky_claude_assets/commands/str/search.md +205 -0
- stravinsky_claude_assets/commands/str/start_filewatch.md +136 -0
- stravinsky_claude_assets/commands/str/stats.md +71 -0
- stravinsky_claude_assets/commands/str/stop_filewatch.md +89 -0
- stravinsky_claude_assets/commands/str/unwatch.md +42 -0
- stravinsky_claude_assets/commands/str/watch.md +45 -0
- stravinsky_claude_assets/commands/strav.md +53 -0
- stravinsky_claude_assets/commands/stravinsky.md +292 -0
- stravinsky_claude_assets/commands/verify.md +60 -0
- stravinsky_claude_assets/commands/version.md +5 -0
- stravinsky_claude_assets/hooks/README.md +248 -0
- stravinsky_claude_assets/hooks/comment_checker.py +193 -0
- stravinsky_claude_assets/hooks/context.py +38 -0
- stravinsky_claude_assets/hooks/context_monitor.py +153 -0
- stravinsky_claude_assets/hooks/dependency_tracker.py +73 -0
- stravinsky_claude_assets/hooks/edit_recovery.py +46 -0
- stravinsky_claude_assets/hooks/execution_state_tracker.py +68 -0
- stravinsky_claude_assets/hooks/notification_hook.py +103 -0
- stravinsky_claude_assets/hooks/notification_hook_v2.py +96 -0
- stravinsky_claude_assets/hooks/parallel_execution.py +241 -0
- stravinsky_claude_assets/hooks/parallel_reinforcement.py +106 -0
- stravinsky_claude_assets/hooks/parallel_reinforcement_v2.py +112 -0
- stravinsky_claude_assets/hooks/pre_compact.py +123 -0
- stravinsky_claude_assets/hooks/ralph_loop.py +173 -0
- stravinsky_claude_assets/hooks/session_recovery.py +263 -0
- stravinsky_claude_assets/hooks/stop_hook.py +89 -0
- stravinsky_claude_assets/hooks/stravinsky_metrics.py +164 -0
- stravinsky_claude_assets/hooks/stravinsky_mode.py +146 -0
- stravinsky_claude_assets/hooks/subagent_stop.py +98 -0
- stravinsky_claude_assets/hooks/todo_continuation.py +111 -0
- stravinsky_claude_assets/hooks/todo_delegation.py +96 -0
- stravinsky_claude_assets/hooks/tool_messaging.py +281 -0
- stravinsky_claude_assets/hooks/truncator.py +23 -0
- stravinsky_claude_assets/rules/deployment_safety.md +51 -0
- stravinsky_claude_assets/rules/integration_wiring.md +89 -0
- stravinsky_claude_assets/rules/pypi_deployment.md +220 -0
- stravinsky_claude_assets/rules/stravinsky_orchestrator.md +32 -0
- stravinsky_claude_assets/settings.json +152 -0
- stravinsky_claude_assets/skills/chrome-devtools/SKILL.md +81 -0
- stravinsky_claude_assets/skills/sqlite/SKILL.md +77 -0
- stravinsky_claude_assets/skills/supabase/SKILL.md +74 -0
- stravinsky_claude_assets/task_dependencies.json +34 -0
- stravinsky-0.4.18.dist-info/RECORD +0 -88
- {stravinsky-0.4.18.dist-info → stravinsky-0.4.66.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
# /str:search - Semantic Code Search
|
|
2
|
+
|
|
3
|
+
Search your indexed project using natural language queries with the `semantic_search()` MCP tool.
|
|
4
|
+
|
|
5
|
+
## What This Does
|
|
6
|
+
|
|
7
|
+
Performs semantic code search using pre-computed vector embeddings to find code matching your natural language description:
|
|
8
|
+
|
|
9
|
+
Examples:
|
|
10
|
+
- "find authentication logic"
|
|
11
|
+
- "error handling in API endpoints"
|
|
12
|
+
- "database connection pooling"
|
|
13
|
+
- "logging and monitoring"
|
|
14
|
+
- "configuration management"
|
|
15
|
+
- "HTTP request processing"
|
|
16
|
+
|
|
17
|
+
## Prerequisites
|
|
18
|
+
|
|
19
|
+
This command requires the project to be indexed first. **Run `/str:index` before using `/str:search`.**
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
Invoke the `semantic_search()` MCP tool directly with your natural language query:
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
semantic_search(
|
|
27
|
+
query="your search description here",
|
|
28
|
+
project_path=".",
|
|
29
|
+
n_results=10,
|
|
30
|
+
provider="ollama",
|
|
31
|
+
language=None,
|
|
32
|
+
node_type=None
|
|
33
|
+
)
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Parameters
|
|
37
|
+
|
|
38
|
+
| Parameter | Type | Default | Description |
|
|
39
|
+
|-----------|------|---------|-------------|
|
|
40
|
+
| `query` | string | required | Natural language search description |
|
|
41
|
+
| `project_path` | string | "." | Project root directory |
|
|
42
|
+
| `n_results` | int | 10 | Number of results to return |
|
|
43
|
+
| `provider` | string | "ollama" | Embedding provider: ollama, gemini, openai, huggingface |
|
|
44
|
+
| `language` | string | None | Optional language filter (py, ts, js, java, go, etc.) |
|
|
45
|
+
| `node_type` | string | None | Optional node type filter (function, class, method, import, etc.) |
|
|
46
|
+
|
|
47
|
+
## Example Queries
|
|
48
|
+
|
|
49
|
+
### Architectural/Design Questions
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
semantic_search(query="authentication and authorization implementation")
|
|
53
|
+
semantic_search(query="error handling and exception recovery patterns", n_results=15)
|
|
54
|
+
semantic_search(query="caching and performance optimization strategies")
|
|
55
|
+
semantic_search(query="database connection pooling and persistence")
|
|
56
|
+
semantic_search(query="configuration loading and environment settings")
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Feature Discovery
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
semantic_search(query="logging instrumentation and monitoring")
|
|
63
|
+
semantic_search(query="HTTP request processing and routing")
|
|
64
|
+
semantic_search(query="input validation and data sanitization")
|
|
65
|
+
semantic_search(query="background job processing and scheduling")
|
|
66
|
+
semantic_search(query="rate limiting and throttling mechanisms")
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Code Organization
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
semantic_search(query="testing framework and test utilities")
|
|
73
|
+
semantic_search(query="deployment pipeline and release management")
|
|
74
|
+
semantic_search(query="security encryption and cryptographic operations")
|
|
75
|
+
semantic_search(query="transaction handling and atomicity guarantees")
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Filtered Search
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
semantic_search(query="error handling patterns", language="py")
|
|
82
|
+
semantic_search(query="authentication logic", node_type="class")
|
|
83
|
+
semantic_search(query="API handlers", language="py", node_type="function")
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Provider Options
|
|
87
|
+
|
|
88
|
+
### Ollama (Default - Recommended for Development)
|
|
89
|
+
|
|
90
|
+
Free, local, private embeddings:
|
|
91
|
+
- No setup required if ollama is running
|
|
92
|
+
- Model: nomic-embed-text (embeddings) or similar
|
|
93
|
+
- Speed: Fast
|
|
94
|
+
- Cost: Free
|
|
95
|
+
|
|
96
|
+
**Setup:**
|
|
97
|
+
```bash
|
|
98
|
+
# Install ollama (if not already installed)
|
|
99
|
+
brew install ollama # macOS
|
|
100
|
+
|
|
101
|
+
# Start ollama server
|
|
102
|
+
ollama serve
|
|
103
|
+
|
|
104
|
+
# In another terminal, pull the embedding model
|
|
105
|
+
ollama pull nomic-embed-text
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Gemini (Cloud - Recommended for Production)
|
|
109
|
+
|
|
110
|
+
Google's embeddings service:
|
|
111
|
+
- **Setup:** `stravinsky-auth login gemini`
|
|
112
|
+
- **Speed:** Fast
|
|
113
|
+
- **Cost:** Low (~$0.075/1M tokens)
|
|
114
|
+
- **Quality:** Excellent
|
|
115
|
+
|
|
116
|
+
### OpenAI
|
|
117
|
+
|
|
118
|
+
OpenAI's embeddings API:
|
|
119
|
+
- **Setup:** `stravinsky-auth login openai`
|
|
120
|
+
- **Speed:** Medium
|
|
121
|
+
- **Cost:** Medium (~$0.10/1M tokens)
|
|
122
|
+
- **Quality:** Excellent
|
|
123
|
+
|
|
124
|
+
### HuggingFace
|
|
125
|
+
|
|
126
|
+
Free cloud embeddings (no auth required):
|
|
127
|
+
- **Speed:** Slower (can be slow for large codebases)
|
|
128
|
+
- **Cost:** Free
|
|
129
|
+
- **Quality:** Good
|
|
130
|
+
|
|
131
|
+
## Tips
|
|
132
|
+
|
|
133
|
+
1. **Be specific and conversational** in your queries
|
|
134
|
+
- Good: "How is authentication and authorization implemented?"
|
|
135
|
+
- Less effective: "auth"
|
|
136
|
+
|
|
137
|
+
2. **Use filters to narrow results**
|
|
138
|
+
- Language filter: `language="py"` for Python-only results
|
|
139
|
+
- Node type filter: `node_type="function"` for function definitions only
|
|
140
|
+
|
|
141
|
+
3. **Adjust result count based on codebase size**
|
|
142
|
+
- Small projects: `n_results=5`
|
|
143
|
+
- Medium projects: `n_results=10` (default)
|
|
144
|
+
- Large projects: `n_results=15-20`
|
|
145
|
+
|
|
146
|
+
4. **Rebuild index if results are stale**
|
|
147
|
+
- Run `/str:index force=true` to reindex the entire project
|
|
148
|
+
|
|
149
|
+
5. **Check index status**
|
|
150
|
+
- Run `semantic_stats()` to view index statistics and provider information
|
|
151
|
+
|
|
152
|
+
## Switching Providers
|
|
153
|
+
|
|
154
|
+
```
|
|
155
|
+
# Default (local ollama - free)
|
|
156
|
+
semantic_search(query="your query")
|
|
157
|
+
|
|
158
|
+
# Cloud providers
|
|
159
|
+
semantic_search(query="your query", provider="gemini")
|
|
160
|
+
semantic_search(query="your query", provider="openai")
|
|
161
|
+
semantic_search(query="your query", provider="huggingface")
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
First-time setup for cloud providers:
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
# Gemini OAuth
|
|
168
|
+
stravinsky-auth login gemini
|
|
169
|
+
|
|
170
|
+
# OpenAI OAuth
|
|
171
|
+
stravinsky-auth login openai
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
## Common Search Patterns
|
|
175
|
+
|
|
176
|
+
### Finding Implementation Details
|
|
177
|
+
|
|
178
|
+
```
|
|
179
|
+
semantic_search(query="where is X implemented")
|
|
180
|
+
semantic_search(query="how does Y work")
|
|
181
|
+
semantic_search(query="what components make up Z")
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### Quality/Best Practices
|
|
185
|
+
|
|
186
|
+
```
|
|
187
|
+
semantic_search(query="error handling patterns in the codebase")
|
|
188
|
+
semantic_search(query="security checks and validation logic")
|
|
189
|
+
semantic_search(query="performance optimization strategies")
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### Integration Points
|
|
193
|
+
|
|
194
|
+
```
|
|
195
|
+
semantic_search(query="external API integration and client libraries")
|
|
196
|
+
semantic_search(query="database queries and ORM usage")
|
|
197
|
+
semantic_search(query="message queue and event processing")
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
## Related Commands
|
|
201
|
+
|
|
202
|
+
- `/str:index` - Index the project for semantic search
|
|
203
|
+
- `/explore` - Run explore agent for code discovery
|
|
204
|
+
- `/delphi` - Ask architecture and design questions
|
|
205
|
+
- `/dewey` - Research implementation patterns
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# Start File Watcher for Automatic Reindexing
|
|
2
|
+
|
|
3
|
+
Enable automatic reindexing of your codebase when Python files change.
|
|
4
|
+
|
|
5
|
+
## What This Does
|
|
6
|
+
|
|
7
|
+
Starts a background file watcher that monitors your project for file changes and automatically triggers reindexing:
|
|
8
|
+
|
|
9
|
+
- Watches for create, modify, delete, and move events
|
|
10
|
+
- Debounces rapid changes to batch reindexing efficiently
|
|
11
|
+
- Automatically reindexes modified files for semantic search
|
|
12
|
+
- Runs as a daemon thread (non-blocking)
|
|
13
|
+
- Thread-safe with clean shutdown
|
|
14
|
+
|
|
15
|
+
## Prerequisites
|
|
16
|
+
|
|
17
|
+
**Recommended**: Run `/index` first to create an initial index before starting the file watcher.
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
Use the `start_file_watcher` MCP tool to enable automatic reindexing:
|
|
22
|
+
|
|
23
|
+
**Parameters:**
|
|
24
|
+
- `project_path`: Root directory to watch (default: "." - current directory)
|
|
25
|
+
- `provider`: Embedding provider to use for reindexing (default: "ollama")
|
|
26
|
+
- "ollama" - Free, local (recommended)
|
|
27
|
+
- "gemini" - Cloud-based, requires OAuth
|
|
28
|
+
- "openai" - Cloud-based, requires ChatGPT Plus/Pro
|
|
29
|
+
- "huggingface" - Cloud-based, requires API token
|
|
30
|
+
- `debounce_seconds`: Wait time before reindexing after changes (default: 2.0)
|
|
31
|
+
|
|
32
|
+
## Example Usage
|
|
33
|
+
|
|
34
|
+
**Start watcher on current project with default settings:**
|
|
35
|
+
```
|
|
36
|
+
start_file_watcher()
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**Start watcher with custom debounce:**
|
|
40
|
+
```
|
|
41
|
+
start_file_watcher(project_path=".", provider="ollama", debounce_seconds=3.0)
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**Start watcher on specific directory:**
|
|
45
|
+
```
|
|
46
|
+
start_file_watcher(project_path="/path/to/project", provider="gemini")
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## File System Monitoring
|
|
50
|
+
|
|
51
|
+
The file watcher automatically monitors:
|
|
52
|
+
- All `.py` files in your project
|
|
53
|
+
- File creation, modification, deletion, and moves
|
|
54
|
+
- Batches changes within the debounce window
|
|
55
|
+
|
|
56
|
+
The watcher **skips**:
|
|
57
|
+
- Virtual environments (`venv/`)
|
|
58
|
+
- Python cache (`__pycache__/`, `.pyc` files)
|
|
59
|
+
- Git metadata (`.git/`)
|
|
60
|
+
- Node modules (`node_modules/`)
|
|
61
|
+
- Build artifacts (`dist/`, `build/`)
|
|
62
|
+
|
|
63
|
+
## Managing Watchers
|
|
64
|
+
|
|
65
|
+
**Check active watchers:**
|
|
66
|
+
```
|
|
67
|
+
list_file_watchers()
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
**Get specific watcher status:**
|
|
71
|
+
```
|
|
72
|
+
get_file_watcher(project_path=".")
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
**Stop a watcher:**
|
|
76
|
+
```
|
|
77
|
+
stop_file_watcher(project_path=".")
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Workflow
|
|
81
|
+
|
|
82
|
+
1. Create initial index with `/index` (optional but recommended)
|
|
83
|
+
2. Start file watcher with `/str:start_filewatch`
|
|
84
|
+
3. Continue coding - changes are automatically indexed
|
|
85
|
+
4. Use `/search` for semantic queries
|
|
86
|
+
5. Stop when done with `/str:stop_filewatch`
|
|
87
|
+
|
|
88
|
+
## Provider Selection
|
|
89
|
+
|
|
90
|
+
Choose based on your needs:
|
|
91
|
+
|
|
92
|
+
- **ollama** (default): Free, local, no setup required
|
|
93
|
+
- Best for development
|
|
94
|
+
- Requires `ollama` installed and running
|
|
95
|
+
- Run: `ollama pull nomic-embed-text`
|
|
96
|
+
|
|
97
|
+
- **gemini**: Cloud-based, excellent quality
|
|
98
|
+
- Best for production
|
|
99
|
+
- Requires: `stravinsky-auth login gemini`
|
|
100
|
+
|
|
101
|
+
- **openai**: Cloud-based, excellent quality
|
|
102
|
+
- Requires: ChatGPT Plus/Pro subscription
|
|
103
|
+
- Run: `stravinsky-auth login openai`
|
|
104
|
+
|
|
105
|
+
## Performance Tips
|
|
106
|
+
|
|
107
|
+
- **Debounce value**:
|
|
108
|
+
- 2.0s (default): Good balance for most projects
|
|
109
|
+
- 1.0s: For fast, continuous indexing (higher CPU)
|
|
110
|
+
- 3.0-5.0s: For large projects or slower systems
|
|
111
|
+
|
|
112
|
+
- **Provider choice**:
|
|
113
|
+
- Local (ollama) if indexing many files frequently
|
|
114
|
+
- Cloud (gemini/openai) if network latency is acceptable
|
|
115
|
+
|
|
116
|
+
## Troubleshooting
|
|
117
|
+
|
|
118
|
+
**Watcher not working:**
|
|
119
|
+
- Ensure provider is accessible (run `ollama` if using ollama)
|
|
120
|
+
- Check logs: Look for errors in tool output
|
|
121
|
+
- Try higher debounce value if system is slow
|
|
122
|
+
|
|
123
|
+
**Too much reindexing:**
|
|
124
|
+
- Increase `debounce_seconds` (e.g., 3.0 or 5.0)
|
|
125
|
+
- This batches more changes before reindexing
|
|
126
|
+
|
|
127
|
+
**Memory usage:**
|
|
128
|
+
- File watchers run as daemon threads
|
|
129
|
+
- Memory is low (typically <50MB per watcher)
|
|
130
|
+
- Stop unused watchers to free resources
|
|
131
|
+
|
|
132
|
+
## Related Commands
|
|
133
|
+
|
|
134
|
+
- `/index` - Create/rebuild semantic search index
|
|
135
|
+
- `/search` - Query indexed code with natural language
|
|
136
|
+
- `/str:stop_filewatch` - Stop automatic reindexing
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: /str:stats - View semantic search index statistics (indexed files, chunks, embeddings)
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Semantic Search Index Statistics
|
|
6
|
+
|
|
7
|
+
View detailed statistics about the semantic search index for your project.
|
|
8
|
+
|
|
9
|
+
## What This Does
|
|
10
|
+
|
|
11
|
+
Displays comprehensive information about the semantic search index including:
|
|
12
|
+
- Number of indexed files
|
|
13
|
+
- Total chunks/embeddings created
|
|
14
|
+
- Index size on disk
|
|
15
|
+
- Provider information
|
|
16
|
+
- Last update timestamp
|
|
17
|
+
- Indexed programming languages
|
|
18
|
+
|
|
19
|
+
## Prerequisites
|
|
20
|
+
|
|
21
|
+
An index must exist. Run `/index` first to create the semantic search index.
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
Use the `semantic_stats` MCP tool to view index statistics:
|
|
26
|
+
|
|
27
|
+
**Parameters:**
|
|
28
|
+
- `project_path`: Path to project root (default: ".")
|
|
29
|
+
|
|
30
|
+
## Example
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
semantic_stats(project_path=".")
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Output
|
|
37
|
+
|
|
38
|
+
Displays information like:
|
|
39
|
+
```
|
|
40
|
+
Index Statistics
|
|
41
|
+
================
|
|
42
|
+
Project: /path/to/project
|
|
43
|
+
Provider: ollama
|
|
44
|
+
Status: Ready
|
|
45
|
+
|
|
46
|
+
Files Indexed: 142
|
|
47
|
+
Chunks: 3,847
|
|
48
|
+
Total Embeddings: 3,847
|
|
49
|
+
Index Size: 45.2 MB
|
|
50
|
+
|
|
51
|
+
Languages:
|
|
52
|
+
- Python: 98 files
|
|
53
|
+
- Markdown: 28 files
|
|
54
|
+
- JSON: 16 files
|
|
55
|
+
|
|
56
|
+
Last Updated: 2025-01-07 18:32:15
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Troubleshooting
|
|
60
|
+
|
|
61
|
+
**"Index not found"**: Run `/index` to create the index first.
|
|
62
|
+
|
|
63
|
+
**"Index is stale"**: Run `/index` again to update it with new/modified files.
|
|
64
|
+
|
|
65
|
+
**"Rebuild index"**: Run `/index force=true` to completely rebuild from scratch.
|
|
66
|
+
|
|
67
|
+
## Tips
|
|
68
|
+
|
|
69
|
+
- Check stats regularly to ensure your index is up-to-date
|
|
70
|
+
- Use stats to verify index coverage before running `/search` queries
|
|
71
|
+
- Stats help identify if re-indexing is needed (large file count changes)
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Stop File Watcher
|
|
2
|
+
|
|
3
|
+
Disable automatic reindexing for a project.
|
|
4
|
+
|
|
5
|
+
## What This Does
|
|
6
|
+
|
|
7
|
+
Stops and removes a file watcher that was previously started with `/str:start_filewatch`:
|
|
8
|
+
|
|
9
|
+
- Gracefully shuts down the background watcher thread
|
|
10
|
+
- Releases file system resources
|
|
11
|
+
- Stops automatic reindexing for the specified project
|
|
12
|
+
- Returns status (true if watcher was active, false if none was running)
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
Use the `stop_file_watcher` MCP tool to disable automatic reindexing:
|
|
17
|
+
|
|
18
|
+
**Parameters:**
|
|
19
|
+
- `project_path`: Root directory that was being watched (default: "." - current directory)
|
|
20
|
+
|
|
21
|
+
## Example Usage
|
|
22
|
+
|
|
23
|
+
**Stop watcher on current project:**
|
|
24
|
+
```
|
|
25
|
+
stop_file_watcher()
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
**Stop watcher on specific directory:**
|
|
29
|
+
```
|
|
30
|
+
stop_file_watcher(project_path="/path/to/project")
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Status
|
|
34
|
+
|
|
35
|
+
The tool returns:
|
|
36
|
+
- `True` if a watcher was active and has been stopped
|
|
37
|
+
- `False` if no watcher was active for that project path
|
|
38
|
+
|
|
39
|
+
## Checking Watchers
|
|
40
|
+
|
|
41
|
+
**List all active watchers before stopping:**
|
|
42
|
+
```
|
|
43
|
+
list_file_watchers()
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
This shows:
|
|
47
|
+
- Project paths being watched
|
|
48
|
+
- Provider for each watcher
|
|
49
|
+
- Number of changes detected
|
|
50
|
+
- Watch status (running/stopped)
|
|
51
|
+
|
|
52
|
+
**Get status of specific watcher:**
|
|
53
|
+
```
|
|
54
|
+
get_file_watcher(project_path=".")
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Returns the CodebaseFileWatcher object if active, None otherwise.
|
|
58
|
+
|
|
59
|
+
## When to Stop
|
|
60
|
+
|
|
61
|
+
- Stop when you're done with a project
|
|
62
|
+
- Stop if you need to change provider settings
|
|
63
|
+
- Stop to reduce resource usage
|
|
64
|
+
- Stop before shutting down to clean shutdown the watcher thread
|
|
65
|
+
|
|
66
|
+
## Restarting
|
|
67
|
+
|
|
68
|
+
You can restart the watcher at any time:
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
# Stop current watcher
|
|
72
|
+
stop_file_watcher()
|
|
73
|
+
|
|
74
|
+
# Start new watcher with different settings
|
|
75
|
+
start_file_watcher(project_path=".", provider="gemini", debounce_seconds=3.0)
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Workflow
|
|
79
|
+
|
|
80
|
+
1. Start watcher with `/str:start_filewatch`
|
|
81
|
+
2. Code and make changes (automatically indexed)
|
|
82
|
+
3. Use `/search` for semantic queries
|
|
83
|
+
4. When done: **Stop watcher with `/str:stop_filewatch`**
|
|
84
|
+
|
|
85
|
+
## Related Commands
|
|
86
|
+
|
|
87
|
+
- `/str:start_filewatch` - Enable automatic reindexing
|
|
88
|
+
- `/search` - Query indexed code with natural language
|
|
89
|
+
- `/index` - Create/rebuild semantic search index
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Stop file watching for semantic search index updates
|
|
3
|
+
allowed-tools: mcp__stravinsky__stop_file_watcher, mcp__stravinsky__list_file_watchers
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Stop File Watcher
|
|
7
|
+
|
|
8
|
+
Stop automatic reindexing for a project's semantic search index.
|
|
9
|
+
|
|
10
|
+
## What This Does
|
|
11
|
+
|
|
12
|
+
Stops the background file watcher that monitors code changes and triggers reindexing.
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
Call `stop_file_watcher` with parameter:
|
|
17
|
+
- `project_path`: "." (current directory)
|
|
18
|
+
|
|
19
|
+
## Example
|
|
20
|
+
|
|
21
|
+
```python
|
|
22
|
+
# Stop watching current project
|
|
23
|
+
stop_file_watcher(project_path=".")
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Returns: Boolean indicating if watcher was stopped (true) or wasn't running (false)
|
|
27
|
+
|
|
28
|
+
## List Active Watchers
|
|
29
|
+
|
|
30
|
+
Use `list_file_watchers()` to see all active watchers across projects:
|
|
31
|
+
|
|
32
|
+
```python
|
|
33
|
+
list_file_watchers()
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Returns JSON with active watcher details (project path, provider, status).
|
|
37
|
+
|
|
38
|
+
## Notes
|
|
39
|
+
|
|
40
|
+
- Watcher automatically cleans up on process exit
|
|
41
|
+
- Stopping a non-existent watcher returns false
|
|
42
|
+
- Any pending debounced reindex is cancelled when stopping
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Start automatic file watching for semantic search index updates
|
|
3
|
+
allowed-tools: mcp__stravinsky__start_file_watcher, mcp__stravinsky__semantic_index, mcp__stravinsky__semantic_stats
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Start File Watcher for Semantic Search
|
|
7
|
+
|
|
8
|
+
Automatically reindex code changes in the background. The watcher monitors `.py` files and triggers incremental reindexing when changes are detected.
|
|
9
|
+
|
|
10
|
+
## What This Does
|
|
11
|
+
|
|
12
|
+
1. **Auto-catches up**: Runs incremental reindex to catch changes since last index
|
|
13
|
+
2. **Starts monitoring**: Watches for file create/modify/delete/move events
|
|
14
|
+
3. **Debounces changes**: Waits 2 seconds after last change before reindexing
|
|
15
|
+
4. **Background operation**: Runs as daemon thread, cleans up on exit
|
|
16
|
+
|
|
17
|
+
## Prerequisites
|
|
18
|
+
|
|
19
|
+
- Index must exist first (run `/index` or `semantic_index()` before starting watcher)
|
|
20
|
+
- Ollama must be running with embedding model available
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
Call `start_file_watcher` with parameters:
|
|
25
|
+
- `project_path`: "." (current directory)
|
|
26
|
+
- `provider`: "ollama" (or "mxbai", "gemini", "openai", "huggingface")
|
|
27
|
+
- `debounce_seconds`: 2.0 (optional, default is 2.0)
|
|
28
|
+
|
|
29
|
+
## Example
|
|
30
|
+
|
|
31
|
+
```python
|
|
32
|
+
# Start watching current project
|
|
33
|
+
start_file_watcher(project_path=".", provider="ollama")
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Stop Watching
|
|
37
|
+
|
|
38
|
+
Use `/str:unwatch` or call `stop_file_watcher(project_path=".")` to stop the watcher.
|
|
39
|
+
|
|
40
|
+
## Notes
|
|
41
|
+
|
|
42
|
+
- Watcher automatically performs incremental reindex on start to catch missed changes
|
|
43
|
+
- Only monitors Python files (`.py` extension)
|
|
44
|
+
- Skips: venv, __pycache__, .git, node_modules, dist, build
|
|
45
|
+
- Thread-safe with automatic cleanup on process exit
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: strav
|
|
3
|
+
description: |
|
|
4
|
+
Stravinsky task orchestrator and parallel execution specialist.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# /strav (Stravinsky Orchestrator)
|
|
8
|
+
|
|
9
|
+
**Identity**: You are Stravinsky, the Parallel Orchestrator.
|
|
10
|
+
**Goal**: Maximize throughput by spawning multiple specialized agents in parallel.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## 🚀 ULTRAWORK PROTOCOL (Trigger: /strav ulw, /strav uw)
|
|
15
|
+
|
|
16
|
+
When ULTRAWORK mode is detected (keywords: `ultrawork`, `uw`, `ulw`):
|
|
17
|
+
|
|
18
|
+
1. **IMMEDIATE PARALLELISM**: You must NEVER work sequentially.
|
|
19
|
+
2. **SPAWN AGENTS**: Use `agent_spawn` for ALL tasks.
|
|
20
|
+
3. **NO LOCAL TOOLS**: Do NOT use `Read`, `Grep`, or `Bash` yourself. Delegate EVERYTHING.
|
|
21
|
+
|
|
22
|
+
**Correct Response Pattern (FIRE EVERYTHING AT ONCE):**
|
|
23
|
+
```python
|
|
24
|
+
# 1. Spawn Context Gatherer
|
|
25
|
+
agent_spawn(agent_type="explore", prompt="Find auth flow...", task_id="auth_search")
|
|
26
|
+
# 2. Spawn Documentation Researcher
|
|
27
|
+
agent_spawn(agent_type="dewey", prompt="Research JWT best practices...", task_id="doc_search")
|
|
28
|
+
# 3. Spawn Implementation Planner
|
|
29
|
+
agent_spawn(agent_type="delphi", prompt="Plan refactoring based on...", task_id="planner")
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Agent Roster
|
|
35
|
+
|
|
36
|
+
| Agent Type | Best For | Model |
|
|
37
|
+
|------------|----------|-------|
|
|
38
|
+
| `explore` | Codebase search, finding files | gemini-3-flash |
|
|
39
|
+
| `dewey` | Documentation, external research | gemini-3-flash |
|
|
40
|
+
| `frontend` | UI/CSS, React components | gemini-3-pro |
|
|
41
|
+
| `delphi` | Architecture, complex bugs | gpt-5.2 |
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Execution Rules
|
|
46
|
+
|
|
47
|
+
1. **Analyze Request**: Identify independent sub-tasks.
|
|
48
|
+
2. **Delegate**: Call `agent_spawn` for each sub-task in the SAME turn.
|
|
49
|
+
3. **Wait**: Do not mark as done until agents return success.
|
|
50
|
+
4. **Verify**: Use `lsp_diagnostics` on modified files.
|
|
51
|
+
|
|
52
|
+
**IF YOU SEE "ULTRAWORK" or "UW":**
|
|
53
|
+
Your FIRST action MUST be `agent_spawn`. Do not talk. Do not plan text. SPAWN.
|