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.
- 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 +112 -11
- 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/MANIFEST_SCHEMA.md +305 -0
- mcp_bridge/config/README.md +276 -0
- mcp_bridge/config/__init__.py +2 -2
- mcp_bridge/config/hook_config.py +247 -0
- mcp_bridge/config/hooks_manifest.json +138 -0
- mcp_bridge/config/rate_limits.py +317 -0
- mcp_bridge/config/skills_manifest.json +128 -0
- mcp_bridge/hooks/HOOKS_SETTINGS.json +17 -4
- mcp_bridge/hooks/__init__.py +19 -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 +43 -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/tool_messaging.py +113 -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 +150 -0
- 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 +542 -59
- mcp_bridge/server_tools.py +738 -6
- mcp_bridge/tools/__init__.py +40 -25
- mcp_bridge/tools/agent_manager.py +616 -697
- mcp_bridge/tools/background_tasks.py +13 -17
- mcp_bridge/tools/code_search.py +70 -53
- 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 +12 -5
- mcp_bridge/tools/lsp/manager.py +471 -0
- mcp_bridge/tools/lsp/tools.py +723 -207
- mcp_bridge/tools/model_invoke.py +1195 -273
- mcp_bridge/tools/mux_client.py +75 -0
- mcp_bridge/tools/project_context.py +1 -2
- mcp_bridge/tools/query_classifier.py +406 -0
- 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 +3627 -0
- 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 +585 -0
- mcp_bridge/update_manager_pypi.py +297 -0
- 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.66.dist-info/METADATA +517 -0
- stravinsky-0.4.66.dist-info/RECORD +198 -0
- {stravinsky-0.2.67.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.2.67.dist-info/METADATA +0 -284
- stravinsky-0.2.67.dist-info/RECORD +0 -76
- {stravinsky-0.2.67.dist-info → stravinsky-0.4.66.dist-info}/WHEEL +0 -0
mcp_bridge/cli/session_report.py
CHANGED
|
@@ -8,8 +8,6 @@ Optionally uses Gemini for session summarization.
|
|
|
8
8
|
|
|
9
9
|
import argparse
|
|
10
10
|
import json
|
|
11
|
-
import os
|
|
12
|
-
import re
|
|
13
11
|
import sys
|
|
14
12
|
from collections import Counter
|
|
15
13
|
from datetime import datetime
|
|
@@ -23,7 +21,6 @@ from rich.table import Table
|
|
|
23
21
|
from rich.text import Text
|
|
24
22
|
from rich.tree import Tree
|
|
25
23
|
|
|
26
|
-
|
|
27
24
|
console = Console()
|
|
28
25
|
|
|
29
26
|
|
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
# Stravinsky Manifest Schema Documentation
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
The manifest files (`hooks_manifest.json` and `skills_manifest.json`) track version information, integrity, and metadata for all Stravinsky-provided hooks and skills. These manifests enable:
|
|
6
|
+
|
|
7
|
+
- **Integrity Verification**: Detect unauthorized or accidental modifications
|
|
8
|
+
- **Update Management**: Determine which files need updating during package upgrades
|
|
9
|
+
- **User Customization**: Distinguish between official Stravinsky files and user modifications
|
|
10
|
+
- **Dependency Tracking**: Understand hook dependencies and required relationships
|
|
11
|
+
|
|
12
|
+
## File Locations
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
mcp_bridge/config/
|
|
16
|
+
├── hooks_manifest.json # Official hook metadata
|
|
17
|
+
├── skills_manifest.json # Slash command metadata
|
|
18
|
+
└── MANIFEST_SCHEMA.md # This documentation
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Manifest Structure
|
|
22
|
+
|
|
23
|
+
### Common Fields
|
|
24
|
+
|
|
25
|
+
Both manifests share these top-level fields:
|
|
26
|
+
|
|
27
|
+
| Field | Type | Purpose |
|
|
28
|
+
|-------|------|---------|
|
|
29
|
+
| `schema_version` | string | Manifest format version (e.g., "1.0.0") |
|
|
30
|
+
| `manifest_version` | string | Stravinsky package version this manifest was generated for |
|
|
31
|
+
| `description` | string | Brief description of manifest purpose |
|
|
32
|
+
| `generated_date` | ISO 8601 | Timestamp when manifest was created/updated |
|
|
33
|
+
| `schema` | object | Field definitions and their meanings |
|
|
34
|
+
| `[items]` | object | Collection of hooks or skills with metadata |
|
|
35
|
+
| `usage` | object | Integration notes for `update_manager.py` |
|
|
36
|
+
|
|
37
|
+
### hooks_manifest.json Schema
|
|
38
|
+
|
|
39
|
+
Each hook entry has these fields:
|
|
40
|
+
|
|
41
|
+
```json
|
|
42
|
+
{
|
|
43
|
+
"hook_name": {
|
|
44
|
+
"version": "0.2.63",
|
|
45
|
+
"source": "mcp_bridge/hooks/hook_name.py",
|
|
46
|
+
"description": "Brief description of hook purpose",
|
|
47
|
+
"hook_type": "PreToolUse|PostToolUse|UserPromptSubmit|Notification|SubagentStop|PreCompact|package|manager|session_idle|session_manager",
|
|
48
|
+
"checksum": "sha256_first_12_chars",
|
|
49
|
+
"lines_of_code": 150,
|
|
50
|
+
"updatable": true,
|
|
51
|
+
"priority": "critical|high|medium|low",
|
|
52
|
+
"required": true,
|
|
53
|
+
"dependencies": ["manager.py", "other_hook.py"]
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### skills_manifest.json Schema
|
|
59
|
+
|
|
60
|
+
Each skill entry has these fields:
|
|
61
|
+
|
|
62
|
+
```json
|
|
63
|
+
{
|
|
64
|
+
"skill_name": {
|
|
65
|
+
"file_path": "strav.md or str/search.md",
|
|
66
|
+
"description": "Description from skill frontmatter",
|
|
67
|
+
"category": "core|research|implementation|architecture",
|
|
68
|
+
"checksum": "sha256_first_12_chars",
|
|
69
|
+
"lines_of_code": 200,
|
|
70
|
+
"updatable": true,
|
|
71
|
+
"priority": "critical|high|medium|low",
|
|
72
|
+
"agent_type": "explore|dewey|frontend|delphi|stravinsky|implementation_lead|code_reviewer",
|
|
73
|
+
"blocking": true,
|
|
74
|
+
"requires_auth": true,
|
|
75
|
+
"version_first_added": "0.1.0",
|
|
76
|
+
"notes": "Additional context or special considerations"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Field Definitions
|
|
82
|
+
|
|
83
|
+
### `version`
|
|
84
|
+
Semantic version of the hook/skill implementation. Format: `X.Y.Z` (e.g., `0.2.63`).
|
|
85
|
+
|
|
86
|
+
### `source` / `file_path`
|
|
87
|
+
Absolute path (hooks) or relative path from `.claude/commands/` (skills).
|
|
88
|
+
|
|
89
|
+
### `description`
|
|
90
|
+
One-line functional description of what the hook/skill does.
|
|
91
|
+
|
|
92
|
+
### `hook_type` (hooks only)
|
|
93
|
+
Claude Code hook type that this hook implements:
|
|
94
|
+
- **PreToolUse**: Runs before tool execution (can block with exit code 2)
|
|
95
|
+
- **PostToolUse**: Runs after tool completes
|
|
96
|
+
- **UserPromptSubmit**: Runs when user submits prompt
|
|
97
|
+
- **Notification**: Runs on notification events
|
|
98
|
+
- **SubagentStop**: Runs when agent completes
|
|
99
|
+
- **PreCompact**: Runs before context compaction
|
|
100
|
+
- **package**: Module/package initialization
|
|
101
|
+
- **manager**: Hook management infrastructure
|
|
102
|
+
- **session_idle**: Session idle detection
|
|
103
|
+
|
|
104
|
+
### `category` (skills only)
|
|
105
|
+
Skill category for organization:
|
|
106
|
+
- **core**: Essential orchestration features
|
|
107
|
+
- **research**: Documentation and code search
|
|
108
|
+
- **implementation**: Development workflows (test, review, deploy)
|
|
109
|
+
- **architecture**: Strategic advice and complex debugging
|
|
110
|
+
|
|
111
|
+
### `checksum`
|
|
112
|
+
SHA-256 hash (first 12 characters) for integrity verification.
|
|
113
|
+
|
|
114
|
+
**How to verify/generate:**
|
|
115
|
+
```bash
|
|
116
|
+
# Generate checksum
|
|
117
|
+
sha256sum mcp_bridge/hooks/hook_name.py | awk '{print substr($1,1,12)}'
|
|
118
|
+
|
|
119
|
+
# Verify file hasn't been modified
|
|
120
|
+
sha256sum -c <<< "checksum_value mcp_bridge/hooks/hook_name.py"
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### `updatable`
|
|
124
|
+
- **true**: Official Stravinsky file - can be auto-updated by `update_manager.py`
|
|
125
|
+
- **false**: User customization or user-provided hook - skip during updates
|
|
126
|
+
|
|
127
|
+
**CRITICAL**: User hooks from `.claude/hooks/` should ALWAYS have `updatable: false` in the internal manifest comparison.
|
|
128
|
+
|
|
129
|
+
### `priority`
|
|
130
|
+
Update urgency level:
|
|
131
|
+
- **critical**: Security fixes, core functionality - update immediately
|
|
132
|
+
- **high**: New features, important improvements - include in next release
|
|
133
|
+
- **medium**: Enhancements, can batch with other updates
|
|
134
|
+
- **low**: Optional improvements, can defer
|
|
135
|
+
|
|
136
|
+
### `required`
|
|
137
|
+
- **true**: Hook is essential for core functionality and cannot be disabled
|
|
138
|
+
- **false**: Optional hook that provides enhanced behavior but isn't critical
|
|
139
|
+
|
|
140
|
+
### `blocking` (skills only)
|
|
141
|
+
- **true**: Skill blocks execution until completion
|
|
142
|
+
- **false**: Skill runs asynchronously in background
|
|
143
|
+
|
|
144
|
+
### `agent_type` (skills only)
|
|
145
|
+
Primary agent spawned by this skill:
|
|
146
|
+
- **stravinsky**: Task orchestration
|
|
147
|
+
- **explore**: Codebase search
|
|
148
|
+
- **dewey**: Documentation research
|
|
149
|
+
- **delphi**: Strategic architecture advisor
|
|
150
|
+
- **frontend**: UI/UX design
|
|
151
|
+
- **implementation_lead**: Coordinates implementation
|
|
152
|
+
- **code_reviewer**: Quality analysis
|
|
153
|
+
|
|
154
|
+
### `requires_auth` (skills only)
|
|
155
|
+
- **true**: Skill requires OAuth setup (Gemini or OpenAI)
|
|
156
|
+
- **false**: Skill works without authentication
|
|
157
|
+
|
|
158
|
+
### `dependencies`
|
|
159
|
+
List of other files this hook/skill depends on:
|
|
160
|
+
- Hooks typically depend on `manager.py`
|
|
161
|
+
- Some hooks depend on other hooks they coordinate with
|
|
162
|
+
- Skills may list dependent tools or agents
|
|
163
|
+
|
|
164
|
+
## Integration with update_manager.py
|
|
165
|
+
|
|
166
|
+
The `update_manager.py` module should use these manifests to:
|
|
167
|
+
|
|
168
|
+
### 1. Version Checking
|
|
169
|
+
```python
|
|
170
|
+
# Load installed manifest
|
|
171
|
+
installed_manifest = load_manifest("hooks_manifest.json")
|
|
172
|
+
|
|
173
|
+
# Compare with remote version
|
|
174
|
+
if installed_manifest.version < remote_manifest.version:
|
|
175
|
+
# Updates available
|
|
176
|
+
pass
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### 2. Integrity Verification
|
|
180
|
+
```python
|
|
181
|
+
# Before updating, verify file hasn't been locally modified
|
|
182
|
+
current_checksum = compute_sha256(file_path)
|
|
183
|
+
expected_checksum = manifest[hook_name].checksum
|
|
184
|
+
|
|
185
|
+
if current_checksum != expected_checksum and manifest[hook_name].updatable:
|
|
186
|
+
# Local modifications detected - warn user or skip
|
|
187
|
+
skip_update(hook_name)
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### 3. Selective Updates
|
|
191
|
+
```python
|
|
192
|
+
# Only update files marked updatable=true
|
|
193
|
+
for hook_name, hook_info in manifest.items():
|
|
194
|
+
if hook_info.updatable and should_update(hook_info.priority):
|
|
195
|
+
update_hook(hook_name, new_version)
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### 4. Dependency Resolution
|
|
199
|
+
```python
|
|
200
|
+
# Ensure dependencies are met before updating
|
|
201
|
+
for dependency in hook_info.dependencies:
|
|
202
|
+
if not is_dependency_installed(dependency):
|
|
203
|
+
error("Missing dependency: " + dependency)
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
## Usage Examples
|
|
207
|
+
|
|
208
|
+
### Checking Hook Status
|
|
209
|
+
```bash
|
|
210
|
+
# Find all critical hooks needing updates
|
|
211
|
+
jq '.hooks | to_entries[] | select(.value.priority == "critical")' \
|
|
212
|
+
mcp_bridge/config/hooks_manifest.json
|
|
213
|
+
|
|
214
|
+
# Check if a hook is required
|
|
215
|
+
jq '.hooks.parallel_enforcer.required' \
|
|
216
|
+
mcp_bridge/config/hooks_manifest.json
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### Verifying File Integrity
|
|
220
|
+
```bash
|
|
221
|
+
# Verify all hooks match expected checksums
|
|
222
|
+
python -c "
|
|
223
|
+
import json
|
|
224
|
+
from pathlib import Path
|
|
225
|
+
|
|
226
|
+
with open('mcp_bridge/config/hooks_manifest.json') as f:
|
|
227
|
+
manifest = json.load(f)
|
|
228
|
+
|
|
229
|
+
for hook_name, info in manifest['hooks'].items():
|
|
230
|
+
file_path = info['source']
|
|
231
|
+
if Path(file_path).exists():
|
|
232
|
+
# Compute checksum and compare
|
|
233
|
+
pass
|
|
234
|
+
"
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
### Listing Available Skills
|
|
238
|
+
```bash
|
|
239
|
+
# Extract all skills with their agents
|
|
240
|
+
jq '.skills | to_entries[] | {name: .key, agent: .value.agent_type, blocking: .value.blocking}' \
|
|
241
|
+
mcp_bridge/config/skills_manifest.json
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
## Best Practices
|
|
245
|
+
|
|
246
|
+
### For Stravinsky Maintainers
|
|
247
|
+
|
|
248
|
+
1. **Update on Release**: Regenerate manifests when releasing a new version
|
|
249
|
+
2. **Verify Checksums**: Ensure all checksums are current and accurate
|
|
250
|
+
3. **Document Changes**: Add notes to skills when updating functionality
|
|
251
|
+
4. **Priority Assignment**: Use priority levels consistently across releases
|
|
252
|
+
5. **Dependency Tracking**: Keep dependency lists current and accurate
|
|
253
|
+
|
|
254
|
+
### For Package Users
|
|
255
|
+
|
|
256
|
+
1. **Don't Modify Manifests**: Let `update_manager.py` handle manifest updates
|
|
257
|
+
2. **Preserve Customizations**: Don't modify hooks marked as required=true without good reason
|
|
258
|
+
3. **Check Auth Requirements**: Ensure OAuth is configured for skills requiring authentication
|
|
259
|
+
4. **Monitor Critical Updates**: Subscribe to updates for hooks marked priority=critical
|
|
260
|
+
|
|
261
|
+
### For Developers
|
|
262
|
+
|
|
263
|
+
1. **Custom Hooks**: Create custom hooks in `.claude/hooks/` (not in package)
|
|
264
|
+
2. **Hook Testing**: Always test hooks with sample input before deploying
|
|
265
|
+
3. **Checksum Calculation**: Update checksums when modifying hook files
|
|
266
|
+
4. **Dependency Management**: Clearly document all hook dependencies
|
|
267
|
+
|
|
268
|
+
## Schema Evolution
|
|
269
|
+
|
|
270
|
+
### Version 1.0.0 (Current)
|
|
271
|
+
- Initial manifest format
|
|
272
|
+
- Hook and skill metadata tracking
|
|
273
|
+
- Integrity verification via checksums
|
|
274
|
+
- Priority-based update strategy
|
|
275
|
+
|
|
276
|
+
### Future Versions
|
|
277
|
+
- Will be tracked in `schema_version`
|
|
278
|
+
- Backward compatibility maintained where possible
|
|
279
|
+
- Migration guides provided for breaking changes
|
|
280
|
+
|
|
281
|
+
## Troubleshooting
|
|
282
|
+
|
|
283
|
+
### Checksum Mismatch
|
|
284
|
+
**Problem**: Hook has been modified locally
|
|
285
|
+
**Solution**:
|
|
286
|
+
- If intentional: Update manifest checksum or move to custom hooks
|
|
287
|
+
- If accidental: Restore original file from package
|
|
288
|
+
|
|
289
|
+
### Missing Dependencies
|
|
290
|
+
**Problem**: Hook dependency is not installed
|
|
291
|
+
**Solution**: Ensure all required hooks in `dependencies` list are installed
|
|
292
|
+
|
|
293
|
+
### Update Failures
|
|
294
|
+
**Problem**: `update_manager.py` fails to update a hook
|
|
295
|
+
**Solution**:
|
|
296
|
+
- Check file permissions
|
|
297
|
+
- Verify checksum hasn't changed unexpectedly
|
|
298
|
+
- Check for read-only files
|
|
299
|
+
|
|
300
|
+
## Related Files
|
|
301
|
+
|
|
302
|
+
- `mcp_bridge/cli/install_hooks.py` - Hook installation script
|
|
303
|
+
- `mcp_bridge/config/hooks.py` - Hook configuration utilities
|
|
304
|
+
- `mcp_bridge/hooks/manager.py` - Hook execution manager
|
|
305
|
+
- `.claude/settings.json` - Claude Code hook configuration
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
# Stravinsky Configuration & Manifest System
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
The `mcp_bridge/config/` directory contains:
|
|
6
|
+
|
|
7
|
+
1. **hooks_manifest.json** - Version tracking for 32 official hooks
|
|
8
|
+
2. **skills_manifest.json** - Metadata for 16 slash commands/skills
|
|
9
|
+
3. **MANIFEST_SCHEMA.md** - Detailed schema documentation
|
|
10
|
+
4. **hooks.py** - Hook configuration utilities
|
|
11
|
+
5. **README.md** - This file
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
### For Users
|
|
16
|
+
No action needed. Manifests are automatically managed by the Stravinsky package.
|
|
17
|
+
|
|
18
|
+
### For Maintainers
|
|
19
|
+
When releasing a new version:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
# 1. Update version in pyproject.toml and mcp_bridge/__init__.py
|
|
23
|
+
# 2. Regenerate manifests (if hooks/skills changed)
|
|
24
|
+
python scripts/generate_manifests.py
|
|
25
|
+
|
|
26
|
+
# 3. Commit changes
|
|
27
|
+
git add mcp_bridge/config/*.json
|
|
28
|
+
git commit -m "chore: update manifests for v0.3.X"
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## File Descriptions
|
|
32
|
+
|
|
33
|
+
### hooks_manifest.json
|
|
34
|
+
Tracks all 32 official hooks provided by Stravinsky:
|
|
35
|
+
|
|
36
|
+
- **Core execution hooks** (3): `parallel_execution`, `stravinsky_mode`, `todo_delegation`
|
|
37
|
+
- **Context hooks** (6): `context`, `todo_continuation`, `todo_enforcer`, `directory_context`, `rules_injector`, `pre_compact`
|
|
38
|
+
- **Tool enhancement hooks** (6): `tool_messaging`, `edit_recovery`, `truncator`, `empty_message_sanitizer`, `comment_checker`, `compaction`
|
|
39
|
+
- **Agent lifecycle hooks** (4): `notification_hook`, `subagent_stop`, `session_recovery`, `task_validator`
|
|
40
|
+
- **Advanced optimization** (5): `preemptive_compaction`, `parallel_enforcer`, `auto_slash_command`, `agent_reminder`, `budget_optimizer`
|
|
41
|
+
- **Execution context** (3): `keyword_detector`, `git_noninteractive`, `session_idle`, `session_notifier`, `tmux_manager`
|
|
42
|
+
|
|
43
|
+
**Key Metrics:**
|
|
44
|
+
- 9 required hooks (critical path)
|
|
45
|
+
- 23 optional hooks (enhanced behavior)
|
|
46
|
+
- 2 critical priority, 11 high, 12 medium, 7 low
|
|
47
|
+
|
|
48
|
+
### skills_manifest.json
|
|
49
|
+
Tracks all 16 slash commands (skills):
|
|
50
|
+
|
|
51
|
+
**Core Skills (4):**
|
|
52
|
+
- `/strav` - Task orchestration
|
|
53
|
+
- `/strav:loop` - Continuation loop management
|
|
54
|
+
- `/strav:cancel-loop` - Loop cancellation
|
|
55
|
+
- `/version` - Diagnostic info
|
|
56
|
+
|
|
57
|
+
**Implementation Skills (4):**
|
|
58
|
+
- `/commit` - Git commit orchestration
|
|
59
|
+
- `/review` - Code review
|
|
60
|
+
- `/verify` - Testing and deployment verification
|
|
61
|
+
- `/publish` - PyPI deployment
|
|
62
|
+
|
|
63
|
+
**Research Skills (7):**
|
|
64
|
+
- `/dewey` - Documentation research
|
|
65
|
+
- `/index` - Semantic search indexing
|
|
66
|
+
- `/str:index` - Detailed semantic indexing
|
|
67
|
+
- `/str:search` - Semantic code search
|
|
68
|
+
- `/str:start_filewatch` - File watching
|
|
69
|
+
- `/str:stop_filewatch` - Stop file watching
|
|
70
|
+
- `/str:stats` - Index statistics
|
|
71
|
+
|
|
72
|
+
**Architecture Skills (1):**
|
|
73
|
+
- `/delphi` - Strategic advisor
|
|
74
|
+
|
|
75
|
+
**Key Metrics:**
|
|
76
|
+
- 6 blocking skills (immediate execution)
|
|
77
|
+
- 10 async skills (background execution)
|
|
78
|
+
- All skills marked updatable=true (user customizable)
|
|
79
|
+
|
|
80
|
+
## Integration with update_manager.py
|
|
81
|
+
|
|
82
|
+
The manifests enable smart update workflows:
|
|
83
|
+
|
|
84
|
+
### Version Checking
|
|
85
|
+
```python
|
|
86
|
+
# Load manifest from installed package
|
|
87
|
+
manifest = load_manifest_from_package()
|
|
88
|
+
|
|
89
|
+
# Compare with remote version
|
|
90
|
+
if manifest.manifest_version < remote_version:
|
|
91
|
+
# Updates available
|
|
92
|
+
show_update_notification()
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Integrity Verification
|
|
96
|
+
```python
|
|
97
|
+
# Before updating a hook, verify it hasn't been modified
|
|
98
|
+
current_hash = compute_sha256(hook_file)
|
|
99
|
+
expected_hash = manifest[hook_name].checksum
|
|
100
|
+
|
|
101
|
+
if current_hash != expected_hash:
|
|
102
|
+
# User has customized this hook
|
|
103
|
+
if manifest[hook_name].updatable:
|
|
104
|
+
warn_about_modifications()
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Selective Updates
|
|
108
|
+
```python
|
|
109
|
+
# Only update files marked updatable=true
|
|
110
|
+
# Respect user customizations in .claude/hooks/
|
|
111
|
+
for hook_name, hook_info in manifest.hooks.items():
|
|
112
|
+
if hook_info.updatable and hook_info.priority in ["critical", "high"]:
|
|
113
|
+
update_hook(hook_name)
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Dependency Resolution
|
|
117
|
+
```python
|
|
118
|
+
# Ensure all dependencies are installed
|
|
119
|
+
for dependency in hook_info.dependencies:
|
|
120
|
+
if not is_installed(dependency):
|
|
121
|
+
error(f"Missing dependency: {dependency}")
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Manifest Fields Reference
|
|
125
|
+
|
|
126
|
+
### Hook Entry
|
|
127
|
+
```json
|
|
128
|
+
{
|
|
129
|
+
"hook_name": {
|
|
130
|
+
"version": "0.2.63",
|
|
131
|
+
"source": "mcp_bridge/hooks/hook_name.py",
|
|
132
|
+
"description": "What this hook does",
|
|
133
|
+
"hook_type": "PreToolUse|PostToolUse|UserPromptSubmit|...",
|
|
134
|
+
"checksum": "sha256_first_12_chars",
|
|
135
|
+
"lines_of_code": 150,
|
|
136
|
+
"updatable": true,
|
|
137
|
+
"priority": "critical|high|medium|low",
|
|
138
|
+
"required": true,
|
|
139
|
+
"dependencies": ["manager.py"]
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Skill Entry
|
|
145
|
+
```json
|
|
146
|
+
{
|
|
147
|
+
"skill_name": {
|
|
148
|
+
"file_path": "strav.md or str/search.md",
|
|
149
|
+
"description": "What this skill does",
|
|
150
|
+
"category": "core|research|implementation|architecture",
|
|
151
|
+
"checksum": "sha256_first_12_chars",
|
|
152
|
+
"lines_of_code": 200,
|
|
153
|
+
"updatable": true,
|
|
154
|
+
"priority": "critical|high|medium|low",
|
|
155
|
+
"agent_type": "explore|dewey|frontend|...",
|
|
156
|
+
"blocking": true,
|
|
157
|
+
"requires_auth": true,
|
|
158
|
+
"version_first_added": "0.1.0"
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
See **MANIFEST_SCHEMA.md** for complete field documentation.
|
|
164
|
+
|
|
165
|
+
## Checksum Verification
|
|
166
|
+
|
|
167
|
+
### Generate Checksums
|
|
168
|
+
```bash
|
|
169
|
+
# For a single file
|
|
170
|
+
sha256sum mcp_bridge/hooks/parallel_execution.py | awk '{print substr($1,1,12)}'
|
|
171
|
+
|
|
172
|
+
# For all hooks
|
|
173
|
+
for f in mcp_bridge/hooks/*.py; do
|
|
174
|
+
echo "$(basename $f): $(sha256sum $f | awk '{print substr($1,1,12)}')"
|
|
175
|
+
done
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### Verify File Integrity
|
|
179
|
+
```bash
|
|
180
|
+
# Check if a file has been modified
|
|
181
|
+
current=$(sha256sum mcp_bridge/hooks/parallel_execution.py | awk '{print substr($1,1,12)}')
|
|
182
|
+
expected=$(jq -r '.hooks.parallel_execution.checksum' mcp_bridge/config/hooks_manifest.json)
|
|
183
|
+
|
|
184
|
+
if [ "$current" != "$expected" ]; then
|
|
185
|
+
echo "File has been modified locally"
|
|
186
|
+
fi
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
## Update Strategy
|
|
190
|
+
|
|
191
|
+
### Priority Levels
|
|
192
|
+
- **critical**: Security, core functionality - update immediately
|
|
193
|
+
- **high**: New features, important improvements - include in next release
|
|
194
|
+
- **medium**: Enhancements - can batch together
|
|
195
|
+
- **low**: Optional improvements - can defer
|
|
196
|
+
|
|
197
|
+
### Update Workflow
|
|
198
|
+
1. Check `manifest_version` against installed version
|
|
199
|
+
2. If newer version available, proceed to verify step
|
|
200
|
+
3. For each hook/skill:
|
|
201
|
+
- Compute current checksum
|
|
202
|
+
- Compare with manifest checksum
|
|
203
|
+
- If modified: warn user or skip (respect customizations)
|
|
204
|
+
- If unmodified and priority is high/critical: update
|
|
205
|
+
4. After updates, recompute checksums
|
|
206
|
+
5. Update manifest with new version
|
|
207
|
+
|
|
208
|
+
## Best Practices
|
|
209
|
+
|
|
210
|
+
### For Stravinsky Maintainers
|
|
211
|
+
1. **Always update manifests on release** - Use `scripts/generate_manifests.py`
|
|
212
|
+
2. **Document hook changes** - Update descriptions if functionality changes
|
|
213
|
+
3. **Keep checksums current** - Run verification script before commits
|
|
214
|
+
4. **Track dependencies** - Add any new hook dependencies to manifest
|
|
215
|
+
5. **Test manifest generation** - Validate JSON before commit
|
|
216
|
+
|
|
217
|
+
### For Package Users
|
|
218
|
+
1. **Don't edit manifests manually** - Let automated tools manage them
|
|
219
|
+
2. **Preserve customizations** - Store custom hooks in `.claude/hooks/` instead
|
|
220
|
+
3. **Check authentication** - Skills requiring auth need OAuth setup
|
|
221
|
+
4. **Review update notes** - Read manifest notes for important context
|
|
222
|
+
|
|
223
|
+
### For Hook Developers
|
|
224
|
+
1. **Add to manifest immediately** - New hooks must be in manifest
|
|
225
|
+
2. **Include checksum** - Use `sha256sum | awk '{print substr($1,1,12)}'`
|
|
226
|
+
3. **Document dependencies** - List all other hooks/modules needed
|
|
227
|
+
4. **Test locally** - Verify hook works before adding to manifest
|
|
228
|
+
5. **Update version field** - Bump manifest version on release
|
|
229
|
+
|
|
230
|
+
## Troubleshooting
|
|
231
|
+
|
|
232
|
+
### Manifest JSON is invalid
|
|
233
|
+
```bash
|
|
234
|
+
# Validate JSON syntax
|
|
235
|
+
python -m json.tool mcp_bridge/config/hooks_manifest.json > /dev/null
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
### Checksums don't match
|
|
239
|
+
```bash
|
|
240
|
+
# Regenerate checksums
|
|
241
|
+
python scripts/generate_manifests.py --recalc-checksums
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
### Missing hooks in manifest
|
|
245
|
+
```bash
|
|
246
|
+
# List all hooks not in manifest
|
|
247
|
+
diff <(ls mcp_bridge/hooks/*.py | sed 's/.*\///' | sort) \
|
|
248
|
+
<(jq -r '.hooks | keys[]' mcp_bridge/config/hooks_manifest.json | sort)
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
### Update fails for a hook
|
|
252
|
+
1. Check file permissions: `ls -l mcp_bridge/hooks/hook_name.py`
|
|
253
|
+
2. Verify checksum: Compare current vs manifest
|
|
254
|
+
3. Check dependencies: Ensure all are installed
|
|
255
|
+
4. Review logs: Look for error messages in update output
|
|
256
|
+
|
|
257
|
+
## Related Files
|
|
258
|
+
|
|
259
|
+
- `mcp_bridge/__init__.py` - Package version
|
|
260
|
+
- `mcp_bridge/hooks/manager.py` - Hook execution system
|
|
261
|
+
- `mcp_bridge/cli/install_hooks.py` - Hook installation
|
|
262
|
+
- `.claude/settings.json` - Hook configuration
|
|
263
|
+
- `pyproject.toml` - Package metadata
|
|
264
|
+
|
|
265
|
+
## Version History
|
|
266
|
+
|
|
267
|
+
### v1.0.0 (Current)
|
|
268
|
+
- Initial manifest schema
|
|
269
|
+
- 32 hooks tracked
|
|
270
|
+
- 16 skills tracked
|
|
271
|
+
- SHA-256 checksum verification
|
|
272
|
+
- Priority-based update strategy
|
|
273
|
+
|
|
274
|
+
## Questions?
|
|
275
|
+
|
|
276
|
+
See **MANIFEST_SCHEMA.md** for detailed documentation.
|