@vibescope/mcp-server 0.1.0 → 0.2.1

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.
Files changed (76) hide show
  1. package/README.md +1 -1
  2. package/dist/api-client.d.ts +120 -2
  3. package/dist/api-client.js +51 -5
  4. package/dist/handlers/bodies-of-work.js +84 -50
  5. package/dist/handlers/cost.js +62 -54
  6. package/dist/handlers/decisions.js +29 -16
  7. package/dist/handlers/deployment.js +114 -107
  8. package/dist/handlers/discovery.d.ts +3 -0
  9. package/dist/handlers/discovery.js +55 -657
  10. package/dist/handlers/fallback.js +42 -28
  11. package/dist/handlers/file-checkouts.d.ts +18 -0
  12. package/dist/handlers/file-checkouts.js +101 -0
  13. package/dist/handlers/findings.d.ts +14 -1
  14. package/dist/handlers/findings.js +104 -28
  15. package/dist/handlers/git-issues.js +36 -32
  16. package/dist/handlers/ideas.js +44 -26
  17. package/dist/handlers/index.d.ts +2 -0
  18. package/dist/handlers/index.js +6 -0
  19. package/dist/handlers/milestones.js +34 -27
  20. package/dist/handlers/organizations.js +86 -78
  21. package/dist/handlers/progress.js +22 -11
  22. package/dist/handlers/project.js +62 -22
  23. package/dist/handlers/requests.js +15 -11
  24. package/dist/handlers/roles.d.ts +18 -0
  25. package/dist/handlers/roles.js +130 -0
  26. package/dist/handlers/session.js +52 -15
  27. package/dist/handlers/sprints.js +78 -65
  28. package/dist/handlers/tasks.js +135 -74
  29. package/dist/handlers/tool-docs.d.ts +4 -3
  30. package/dist/handlers/tool-docs.js +252 -5
  31. package/dist/handlers/validation.js +30 -14
  32. package/dist/index.js +25 -7
  33. package/dist/tools.js +417 -4
  34. package/package.json +1 -1
  35. package/src/api-client.ts +161 -8
  36. package/src/handlers/__test-setup__.ts +12 -0
  37. package/src/handlers/bodies-of-work.ts +127 -111
  38. package/src/handlers/cost.test.ts +34 -44
  39. package/src/handlers/cost.ts +77 -92
  40. package/src/handlers/decisions.test.ts +3 -2
  41. package/src/handlers/decisions.ts +32 -27
  42. package/src/handlers/deployment.ts +144 -190
  43. package/src/handlers/discovery.test.ts +4 -5
  44. package/src/handlers/discovery.ts +60 -746
  45. package/src/handlers/fallback.test.ts +78 -0
  46. package/src/handlers/fallback.ts +51 -38
  47. package/src/handlers/file-checkouts.test.ts +477 -0
  48. package/src/handlers/file-checkouts.ts +127 -0
  49. package/src/handlers/findings.test.ts +274 -2
  50. package/src/handlers/findings.ts +123 -57
  51. package/src/handlers/git-issues.ts +40 -80
  52. package/src/handlers/ideas.ts +56 -54
  53. package/src/handlers/index.ts +6 -0
  54. package/src/handlers/milestones.test.ts +1 -1
  55. package/src/handlers/milestones.ts +47 -45
  56. package/src/handlers/organizations.ts +104 -129
  57. package/src/handlers/progress.ts +24 -22
  58. package/src/handlers/project.ts +89 -57
  59. package/src/handlers/requests.ts +18 -14
  60. package/src/handlers/roles.test.ts +303 -0
  61. package/src/handlers/roles.ts +208 -0
  62. package/src/handlers/session.test.ts +37 -2
  63. package/src/handlers/session.ts +64 -21
  64. package/src/handlers/sprints.ts +114 -134
  65. package/src/handlers/tasks.test.ts +61 -0
  66. package/src/handlers/tasks.ts +170 -139
  67. package/src/handlers/tool-docs.ts +1024 -0
  68. package/src/handlers/validation.test.ts +53 -1
  69. package/src/handlers/validation.ts +32 -21
  70. package/src/index.ts +25 -7
  71. package/src/tools.ts +417 -4
  72. package/dist/config/tool-categories.d.ts +0 -31
  73. package/dist/config/tool-categories.js +0 -253
  74. package/dist/knowledge.d.ts +0 -6
  75. package/dist/knowledge.js +0 -218
  76. package/src/knowledge.ts +0 -230
package/src/knowledge.ts DELETED
@@ -1,230 +0,0 @@
1
- /**
2
- * Knowledge Base
3
- *
4
- * Embedded help topics for on-demand agent guidance.
5
- */
6
-
7
- export const KNOWLEDGE_BASE: Record<string, string> = {
8
- getting_started: `# Getting Started
9
- 1. Call start_work_session(git_url) to initialize
10
- 2. Response includes next_task - start working on it immediately
11
- 3. Use update_task to mark in_progress and track progress
12
- 4. Call complete_task when done - it returns your next task
13
- 5. Use get_help(topic) when you need guidance on specific workflows`,
14
-
15
- tasks: `# Task Workflow
16
- - Mark task in_progress with update_task before starting
17
- - Update progress_percentage regularly (every 15-20% progress)
18
- - Include progress_note to auto-log milestones
19
- - One task at a time - complete current before starting another
20
- - complete_task returns next_task and context counts (validation, blockers, deployment)
21
- - Priority: 1=highest, 5=lowest`,
22
-
23
- validation: `# Task Validation
24
- Completed tasks need validation before PR merge. PRIORITIZE validation over new tasks.
25
-
26
- ## Validator Workflow
27
-
28
- ### 1. Claim Task
29
- claim_validation(task_id) → Returns worktree_setup with existing branch
30
-
31
- ### 2. Set Up Worktree (EXISTING branch)
32
- git fetch origin feature/task-branch
33
- git worktree add ../PROJECT-task-ID feature/task-branch
34
- cd ../PROJECT-task-ID
35
-
36
- ### 3. Run Tests Locally
37
- pnpm install && pnpm test && pnpm build
38
-
39
- ### 4. Approve or Reject
40
-
41
- **APPROVE** → Validator merges PR:
42
- validate_task(task_id, approved: true, validation_notes: "...")
43
- # Response includes merge instructions with PR URL
44
- gh pr merge <NUMBER> --squash
45
- git worktree remove ../PROJECT-task-ID
46
-
47
- **REJECT** → Create fix task:
48
- validate_task(task_id, approved: false, validation_notes: "Issues...", create_fix_task: true)
49
- # Creates fix task with SAME branch/PR
50
- # Fix agent picks up, pushes fixes to same PR
51
- git worktree remove ../PROJECT-task-ID
52
-
53
- ## Key Rules
54
- - Validators check out EXISTING branches
55
- - On approval: validator merges immediately
56
- - On rejection: use create_fix_task: true
57
- - Always clean up worktree after validation`,
58
-
59
- deployment: `# Deployment Workflow
60
- 1. Ensure all completed tasks are validated first
61
- 2. request_deployment(project_id, environment: "production")
62
- 3. claim_deployment_validation(project_id) - claim for validation
63
- 4. Run: pnpm build && pnpm test
64
- 5. report_validation(project_id, build_passed: true, tests_passed: true)
65
- 6. start_deployment(project_id) - returns project's deployment_instructions
66
- 7. Follow the instructions (e.g., push to main, run deploy command)
67
- 8. complete_deployment(project_id, success: true, summary: "...")`,
68
-
69
- git: `# Git Workflow
70
-
71
- Call get_git_workflow(project_id) for project-specific config.
72
-
73
- ## Workflow Types
74
- - **none**: No branching strategy
75
- - **trunk-based**: Commit directly to main, small frequent commits
76
- - **github-flow**: Feature branches, merge via PR after validation
77
- - **git-flow**: develop/release/feature branches
78
-
79
- ## Lifecycle Integration
80
-
81
- ### 1. Starting a Task
82
- When you call update_task(status: "in_progress"), the response includes:
83
- - **branch_name**: Suggested branch (e.g., feature/a1b2c3d4-task-title)
84
- - **base_branch**: Branch to branch from
85
- - **steps**: Git commands to create the branch
86
- - **reminder**: Call to update task with git_branch
87
-
88
- ### 2. Completing a Task
89
- When you call complete_task, the response includes:
90
- - **steps**: Push commands
91
- - **pr_suggestion**: { title, body_template } - ready-to-use PR content
92
- - **next_step**: Reminder that merge happens AFTER validation
93
-
94
- Add the PR link via add_task_reference(task_id, url, label: "Pull Request").
95
-
96
- ### 3. Validation Approved
97
- When validate_task(approved: true) is called, the response includes:
98
- - **target_branch**: Where to merge
99
- - **feature_branch**: Branch being merged
100
- - **steps**: Merge options (UI or command line)
101
- - **cleanup**: Branch deletion commands
102
- - **note**: Confirmation it's safe to merge
103
-
104
- ## Multi-Agent Worktrees (CRITICAL)
105
-
106
- When multiple agents share a repository, you MUST use git worktrees to prevent conflicts.
107
-
108
- ### Why Worktrees?
109
- - Branch switching in shared repos causes file conflicts between agents
110
- - Uncommitted changes from one agent block another's work
111
- - Worktrees provide isolated working directories with shared .git
112
-
113
- ### Setup (Once Per Task)
114
- \`\`\`bash
115
- # From main repo, create worktree for your task
116
- git worktree add ../worktree-<task-short-id> -b feature/<task-id>-<title>
117
-
118
- # Work in the worktree directory
119
- cd ../worktree-<task-short-id>
120
- \`\`\`
121
-
122
- ### Cleanup (After Task Merged)
123
- \`\`\`bash
124
- # Remove worktree after PR merged
125
- git worktree remove ../worktree-<task-short-id>
126
- git branch -d feature/<task-id>-<title>
127
- \`\`\`
128
-
129
- ### Worktree Rules
130
- - ALWAYS create a worktree before starting work on a task
131
- - Each agent works in their own worktree directory
132
- - Never switch branches in the main repo when other agents are active
133
- - Commit and push frequently to avoid losing work
134
-
135
- ## Handling Merge Conflicts
136
-
137
- When claim_validation detects conflicts (via GitHub API):
138
- 1. Response includes merge_conflict with rebase_instructions
139
- 2. Checkout the feature branch locally
140
- 3. Rebase onto target branch: \`git rebase origin/<target>\`
141
- 4. Resolve conflicts, then: \`git add . && git rebase --continue\`
142
- 5. Force push: \`git push origin <branch> --force-with-lease\`
143
- 6. Re-claim validation to verify PR is now mergeable
144
-
145
- ## Key Rules
146
- - Create worktree + branch when starting task (multi-agent environments)
147
- - Push and create PR when completing task
148
- - Wait for validation before merging
149
- - Resolve merge conflicts via rebase before approval
150
- - Clean up worktree and branch after successful merge`,
151
-
152
- blockers: `# Working with Blockers
153
- When stuck and need human input:
154
- 1. add_blocker(project_id, description: "What's blocking")
155
- 2. Ask your question to the user
156
- 3. resolve_blocker(blocker_id, resolution_note: "How resolved")
157
- Only use for genuine blockers requiring decisions - not routine questions.`,
158
-
159
- milestones: `# Task Milestones
160
- For complex tasks, break into milestones:
161
- 1. add_milestone(task_id, title: "Design schema")
162
- 2. add_milestone(task_id, title: "Implement API")
163
- 3. Update with complete_milestone(milestone_id) as you go
164
- Dashboard shows progress bar with completed/total.`,
165
-
166
- fallback: `# Fallback Activities
167
- When no tasks available, get_next_task suggests activities:
168
- - feature_ideation, code_review, performance_audit
169
- - security_review, test_coverage, documentation_review
170
- 1. start_fallback_activity(project_id, activity: "code_review")
171
- 2. Do the work, use add_finding for issues, add_idea for improvements
172
- 3. stop_fallback_activity(project_id, summary: "...")`,
173
-
174
- session: `# Session Management
175
- - start_work_session initializes and returns next_task (lite mode default)
176
- - Use mode:'full' for complete context when needed
177
- - heartbeat every 30-60 seconds maintains active status
178
- - end_work_session releases claimed tasks and returns summary
179
- - NEVER STOP: After completing a task, immediately start the next one
180
- - When context grows large: /clear then start_work_session to continue fresh
181
- - Your progress is saved to the dashboard - nothing is lost on /clear`,
182
-
183
- tokens: `# Token Efficiency
184
- Be mindful of token costs - every tool call has a cost.
185
- - Use mode:'lite' (default) - saves ~85% vs full mode
186
- - Call get_token_usage() to check consumption
187
- - /compact when context grows large
188
- - Batch related updates when possible
189
- - Trust lite mode; only use full mode for initial exploration`,
190
-
191
- sprints: `# Sprints
192
- Sprints are time-bounded bodies of work with velocity tracking.
193
-
194
- ## Lifecycle
195
- 1. **planning**: Create sprint, add tasks with story points
196
- 2. **active**: Sprint in progress, working on tasks
197
- 3. **in_review**: Sprint ended, reviewing completion
198
- 4. **retrospective**: Post-sprint reflection
199
- 5. **completed**: Final state, velocity recorded
200
-
201
- ## Workflow
202
- 1. create_sprint(project_id, title, start_date, end_date, goal)
203
- 2. get_sprint_backlog(project_id) - view available tasks
204
- 3. add_task_to_sprint(sprint_id, task_id, story_points) - add tasks
205
- 4. start_sprint(sprint_id) - locks committed_points
206
- 5. Work on tasks normally (they're assigned to the sprint)
207
- 6. complete_sprint(sprint_id) - calculates final velocity
208
-
209
- ## Velocity Tracking
210
- - committed_points: Total story points at sprint start
211
- - velocity_points: Story points completed by sprint end
212
- - get_sprint_velocity(project_id) - shows history and average velocity
213
-
214
- ## Auto-Deployment
215
- Set auto_deploy_on_completion: true when creating sprint.
216
- Triggers deployment when sprint completes.`,
217
-
218
- topics: `# Available Help Topics
219
- - getting_started: Basic workflow overview
220
- - tasks: Working on tasks, progress tracking
221
- - validation: Cross-agent task validation
222
- - deployment: Deployment coordination
223
- - git: Git workflow configuration
224
- - blockers: Handling blockers
225
- - milestones: Breaking down complex tasks
226
- - fallback: Background activities when idle
227
- - session: Session management
228
- - tokens: Token efficiency tips
229
- - sprints: Time-bounded task groupings with velocity tracking`,
230
- };