@vibescope/mcp-server 0.0.1 → 0.1.0

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 (170) hide show
  1. package/README.md +113 -98
  2. package/dist/api-client.d.ts +1114 -0
  3. package/dist/api-client.js +698 -0
  4. package/dist/cli.d.ts +1 -6
  5. package/dist/cli.js +39 -240
  6. package/dist/config/tool-categories.d.ts +31 -0
  7. package/dist/config/tool-categories.js +253 -0
  8. package/dist/handlers/blockers.js +57 -58
  9. package/dist/handlers/bodies-of-work.d.ts +2 -0
  10. package/dist/handlers/bodies-of-work.js +106 -476
  11. package/dist/handlers/cost.d.ts +1 -0
  12. package/dist/handlers/cost.js +35 -113
  13. package/dist/handlers/decisions.d.ts +2 -0
  14. package/dist/handlers/decisions.js +28 -27
  15. package/dist/handlers/deployment.js +112 -828
  16. package/dist/handlers/discovery.js +31 -0
  17. package/dist/handlers/fallback.d.ts +2 -0
  18. package/dist/handlers/fallback.js +39 -134
  19. package/dist/handlers/findings.js +43 -67
  20. package/dist/handlers/git-issues.d.ts +9 -13
  21. package/dist/handlers/git-issues.js +80 -225
  22. package/dist/handlers/ideas.d.ts +3 -0
  23. package/dist/handlers/ideas.js +53 -134
  24. package/dist/handlers/index.d.ts +2 -0
  25. package/dist/handlers/index.js +6 -0
  26. package/dist/handlers/milestones.d.ts +2 -0
  27. package/dist/handlers/milestones.js +51 -98
  28. package/dist/handlers/organizations.js +79 -275
  29. package/dist/handlers/progress.d.ts +2 -0
  30. package/dist/handlers/progress.js +25 -123
  31. package/dist/handlers/project.js +42 -221
  32. package/dist/handlers/requests.d.ts +2 -0
  33. package/dist/handlers/requests.js +23 -83
  34. package/dist/handlers/session.js +99 -585
  35. package/dist/handlers/sprints.d.ts +32 -0
  36. package/dist/handlers/sprints.js +274 -0
  37. package/dist/handlers/tasks.d.ts +7 -10
  38. package/dist/handlers/tasks.js +230 -900
  39. package/dist/handlers/tool-docs.d.ts +8 -0
  40. package/dist/handlers/tool-docs.js +657 -0
  41. package/dist/handlers/types.d.ts +11 -3
  42. package/dist/handlers/validation.d.ts +1 -1
  43. package/dist/handlers/validation.js +26 -153
  44. package/dist/index.js +473 -160
  45. package/dist/knowledge.js +106 -9
  46. package/dist/tools.js +4 -0
  47. package/dist/validators.d.ts +21 -0
  48. package/dist/validators.js +91 -0
  49. package/package.json +2 -3
  50. package/src/api-client.ts +1752 -0
  51. package/src/cli.test.ts +128 -302
  52. package/src/cli.ts +41 -285
  53. package/src/handlers/__test-setup__.ts +210 -0
  54. package/src/handlers/__test-utils__.ts +4 -134
  55. package/src/handlers/blockers.test.ts +114 -124
  56. package/src/handlers/blockers.ts +68 -70
  57. package/src/handlers/bodies-of-work.test.ts +236 -831
  58. package/src/handlers/bodies-of-work.ts +194 -525
  59. package/src/handlers/cost.test.ts +149 -113
  60. package/src/handlers/cost.ts +44 -132
  61. package/src/handlers/decisions.test.ts +111 -209
  62. package/src/handlers/decisions.ts +35 -27
  63. package/src/handlers/deployment.test.ts +193 -239
  64. package/src/handlers/deployment.ts +140 -895
  65. package/src/handlers/discovery.test.ts +20 -67
  66. package/src/handlers/discovery.ts +32 -0
  67. package/src/handlers/fallback.test.ts +128 -361
  68. package/src/handlers/fallback.ts +62 -148
  69. package/src/handlers/findings.test.ts +127 -345
  70. package/src/handlers/findings.ts +49 -66
  71. package/src/handlers/git-issues.test.ts +623 -0
  72. package/src/handlers/git-issues.ts +174 -0
  73. package/src/handlers/ideas.test.ts +229 -343
  74. package/src/handlers/ideas.ts +69 -143
  75. package/src/handlers/index.ts +6 -0
  76. package/src/handlers/milestones.test.ts +167 -281
  77. package/src/handlers/milestones.ts +54 -93
  78. package/src/handlers/organizations.test.ts +275 -467
  79. package/src/handlers/organizations.ts +84 -294
  80. package/src/handlers/progress.test.ts +112 -218
  81. package/src/handlers/progress.ts +29 -142
  82. package/src/handlers/project.test.ts +203 -226
  83. package/src/handlers/project.ts +48 -238
  84. package/src/handlers/requests.test.ts +74 -342
  85. package/src/handlers/requests.ts +25 -83
  86. package/src/handlers/session.test.ts +241 -206
  87. package/src/handlers/session.ts +110 -657
  88. package/src/handlers/sprints.test.ts +711 -0
  89. package/src/handlers/sprints.ts +497 -0
  90. package/src/handlers/tasks.test.ts +608 -353
  91. package/src/handlers/tasks.ts +248 -1025
  92. package/src/handlers/types.ts +12 -4
  93. package/src/handlers/validation.test.ts +189 -572
  94. package/src/handlers/validation.ts +29 -166
  95. package/src/index.ts +473 -184
  96. package/src/knowledge.ts +107 -9
  97. package/src/tools.ts +2506 -0
  98. package/src/validators.test.ts +223 -223
  99. package/src/validators.ts +127 -0
  100. package/tsconfig.json +1 -1
  101. package/vitest.config.ts +14 -13
  102. package/dist/cli.test.d.ts +0 -1
  103. package/dist/cli.test.js +0 -367
  104. package/dist/handlers/__test-utils__.d.ts +0 -72
  105. package/dist/handlers/__test-utils__.js +0 -176
  106. package/dist/handlers/checkouts.d.ts +0 -37
  107. package/dist/handlers/checkouts.js +0 -377
  108. package/dist/handlers/knowledge-query.d.ts +0 -22
  109. package/dist/handlers/knowledge-query.js +0 -253
  110. package/dist/handlers/knowledge.d.ts +0 -12
  111. package/dist/handlers/knowledge.js +0 -108
  112. package/dist/handlers/roles.d.ts +0 -30
  113. package/dist/handlers/roles.js +0 -281
  114. package/dist/handlers/tasks.test.d.ts +0 -1
  115. package/dist/handlers/tasks.test.js +0 -431
  116. package/dist/utils.test.d.ts +0 -1
  117. package/dist/utils.test.js +0 -532
  118. package/dist/validators.test.d.ts +0 -1
  119. package/dist/validators.test.js +0 -176
  120. package/src/tmpclaude-0078-cwd +0 -1
  121. package/src/tmpclaude-0ee1-cwd +0 -1
  122. package/src/tmpclaude-2dd5-cwd +0 -1
  123. package/src/tmpclaude-344c-cwd +0 -1
  124. package/src/tmpclaude-3860-cwd +0 -1
  125. package/src/tmpclaude-4b63-cwd +0 -1
  126. package/src/tmpclaude-5c73-cwd +0 -1
  127. package/src/tmpclaude-5ee3-cwd +0 -1
  128. package/src/tmpclaude-6795-cwd +0 -1
  129. package/src/tmpclaude-709e-cwd +0 -1
  130. package/src/tmpclaude-9839-cwd +0 -1
  131. package/src/tmpclaude-d829-cwd +0 -1
  132. package/src/tmpclaude-e072-cwd +0 -1
  133. package/src/tmpclaude-f6ee-cwd +0 -1
  134. package/tmpclaude-0439-cwd +0 -1
  135. package/tmpclaude-132f-cwd +0 -1
  136. package/tmpclaude-15bb-cwd +0 -1
  137. package/tmpclaude-165a-cwd +0 -1
  138. package/tmpclaude-1ba9-cwd +0 -1
  139. package/tmpclaude-21a3-cwd +0 -1
  140. package/tmpclaude-2a38-cwd +0 -1
  141. package/tmpclaude-2adf-cwd +0 -1
  142. package/tmpclaude-2f56-cwd +0 -1
  143. package/tmpclaude-3626-cwd +0 -1
  144. package/tmpclaude-3727-cwd +0 -1
  145. package/tmpclaude-40bc-cwd +0 -1
  146. package/tmpclaude-436f-cwd +0 -1
  147. package/tmpclaude-4783-cwd +0 -1
  148. package/tmpclaude-4b6d-cwd +0 -1
  149. package/tmpclaude-4ba4-cwd +0 -1
  150. package/tmpclaude-51e6-cwd +0 -1
  151. package/tmpclaude-5ecf-cwd +0 -1
  152. package/tmpclaude-6f97-cwd +0 -1
  153. package/tmpclaude-7fb2-cwd +0 -1
  154. package/tmpclaude-825c-cwd +0 -1
  155. package/tmpclaude-8baf-cwd +0 -1
  156. package/tmpclaude-8d9f-cwd +0 -1
  157. package/tmpclaude-975c-cwd +0 -1
  158. package/tmpclaude-9983-cwd +0 -1
  159. package/tmpclaude-a045-cwd +0 -1
  160. package/tmpclaude-ac4a-cwd +0 -1
  161. package/tmpclaude-b593-cwd +0 -1
  162. package/tmpclaude-b891-cwd +0 -1
  163. package/tmpclaude-c032-cwd +0 -1
  164. package/tmpclaude-cf43-cwd +0 -1
  165. package/tmpclaude-d040-cwd +0 -1
  166. package/tmpclaude-dcdd-cwd +0 -1
  167. package/tmpclaude-dcee-cwd +0 -1
  168. package/tmpclaude-e16b-cwd +0 -1
  169. package/tmpclaude-ecd2-cwd +0 -1
  170. package/tmpclaude-f48d-cwd +0 -1
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Tool Documentation
3
+ *
4
+ * This file contains detailed documentation for all MCP tools.
5
+ * It is loaded dynamically by get_tool_info to reduce memory footprint
6
+ * when tool documentation is not needed.
7
+ */
8
+ export declare const TOOL_INFO: Record<string, string>;
@@ -0,0 +1,657 @@
1
+ /**
2
+ * Tool Documentation
3
+ *
4
+ * This file contains detailed documentation for all MCP tools.
5
+ * It is loaded dynamically by get_tool_info to reduce memory footprint
6
+ * when tool documentation is not needed.
7
+ */
8
+ export const TOOL_INFO = {
9
+ start_work_session: `# start_work_session
10
+ Initialize agent session and get assigned work.
11
+
12
+ **Parameters:**
13
+ - project_id (optional): Project UUID
14
+ - git_url (optional): Git URL to find project
15
+ - mode: 'lite' (default) or 'full' for complete context
16
+
17
+ **Returns:** session_id, persona, project info, next_task
18
+
19
+ **Example:** start_work_session(git_url: "https://github.com/org/repo")`,
20
+ get_help: `# get_help
21
+ Get workflow guidance on specific topics.
22
+
23
+ **Parameters:**
24
+ - topic (required): One of: getting_started, tasks, validation, deployment, git, blockers, milestones, fallback, session, tokens, topics
25
+
26
+ **Example:** get_help(topic: "deployment")`,
27
+ get_token_usage: `# get_token_usage
28
+ Get token usage statistics for current session.
29
+
30
+ **Returns:** total calls, total tokens, breakdown by tool, averages`,
31
+ heartbeat: `# heartbeat
32
+ Send heartbeat to maintain active status. Call every 30-60 seconds.
33
+
34
+ **Parameters:**
35
+ - session_id (optional): Uses current session if not provided`,
36
+ end_work_session: `# end_work_session
37
+ End session and release claimed tasks.
38
+
39
+ **Parameters:**
40
+ - session_id (optional): Uses current session if not provided
41
+
42
+ **Returns:** Session summary with tasks completed, time spent`,
43
+ get_project_context: `# get_project_context
44
+ Get full project context including goals, instructions, tasks, blockers, decisions.
45
+
46
+ **Parameters:**
47
+ - project_id (optional): Project UUID
48
+ - git_url (optional): Git URL to find project
49
+
50
+ Without params, lists all projects.`,
51
+ get_git_workflow: `# get_git_workflow
52
+ Get git workflow config and branching instructions.
53
+
54
+ **Parameters:**
55
+ - project_id (required): Project UUID
56
+ - task_id (optional): Include branch naming suggestion
57
+
58
+ **Returns:** workflow type, branch names, auto-settings`,
59
+ create_project: `# create_project
60
+ Create a new project to track.
61
+
62
+ **Parameters:**
63
+ - name (required): Project display name
64
+ - description: Brief description
65
+ - goal: What "done" looks like
66
+ - git_url: Repository URL
67
+ - tech_stack: Array of technologies`,
68
+ update_project: `# update_project
69
+ Update project settings.
70
+
71
+ **Parameters:**
72
+ - project_id (required): Project UUID
73
+ - name, description, goal, git_url, tech_stack, status
74
+ - git_workflow: none, trunk-based, github-flow, git-flow
75
+ - git_main_branch, git_develop_branch, git_auto_branch, git_auto_tag`,
76
+ update_project_readme: `# update_project_readme
77
+ Sync README content to the dashboard.
78
+
79
+ **Parameters:**
80
+ - project_id (required): Project UUID
81
+ - readme_content (required): Markdown content`,
82
+ get_tasks: `# get_tasks
83
+ Get tasks for a project.
84
+
85
+ **Parameters:**
86
+ - project_id (required): Project UUID
87
+ - status (optional): pending, in_progress, completed, cancelled
88
+ - limit (optional): Max tasks (default 50)`,
89
+ get_next_task: `# get_next_task
90
+ Get highest priority pending task not claimed by another agent.
91
+
92
+ **Parameters:**
93
+ - project_id (required): Project UUID
94
+
95
+ **Returns:** task or null, may suggest fallback activity`,
96
+ add_task: `# add_task
97
+ Create a new task.
98
+
99
+ **Parameters:**
100
+ - project_id (required): Project UUID
101
+ - title (required): Task title
102
+ - description: Detailed description
103
+ - priority: 1-5 (1=highest, default 3)
104
+ - estimated_minutes: Time estimate`,
105
+ update_task: `# update_task
106
+ Update task status, progress, or details.
107
+
108
+ **Parameters:**
109
+ - task_id (required): Task UUID
110
+ - status: pending, in_progress, completed, cancelled
111
+ - progress_percentage: 0-100
112
+ - progress_note: Brief note (auto-logged)
113
+ - title, description, priority, estimated_minutes, git_branch
114
+
115
+ **Best practice:** Include progress_note with progress_percentage`,
116
+ complete_task: `# complete_task
117
+ Mark task as done.
118
+
119
+ **Parameters:**
120
+ - task_id (required): Task UUID
121
+ - summary: What was done
122
+
123
+ **Returns:** next_task, validation_count, blockers_count, deployment_priority`,
124
+ delete_task: `# delete_task
125
+ Delete a task.
126
+
127
+ **Parameters:**
128
+ - task_id (required): Task UUID`,
129
+ batch_update_tasks: `# batch_update_tasks
130
+ Update multiple tasks at once.
131
+
132
+ **Parameters:**
133
+ - updates (required): Array of {task_id, status?, progress_percentage?, progress_note?, priority?}`,
134
+ batch_complete_tasks: `# batch_complete_tasks
135
+ Complete multiple tasks at once.
136
+
137
+ **Parameters:**
138
+ - completions (required): Array of {task_id, summary?}`,
139
+ add_task_reference: `# add_task_reference
140
+ Add a reference URL to a task.
141
+
142
+ **Parameters:**
143
+ - task_id (required): Task UUID
144
+ - url (required): Reference URL
145
+ - label (optional): Display label`,
146
+ remove_task_reference: `# remove_task_reference
147
+ Remove a reference URL from a task.
148
+
149
+ **Parameters:**
150
+ - task_id (required): Task UUID
151
+ - url (required): URL to remove`,
152
+ add_milestone: `# add_milestone
153
+ Add a milestone/step to a task.
154
+
155
+ **Parameters:**
156
+ - task_id (required): Task UUID
157
+ - title (required): Milestone title
158
+ - description (optional): Details
159
+ - order_index (optional): Position (0-based)`,
160
+ update_milestone: `# update_milestone
161
+ Update a milestone.
162
+
163
+ **Parameters:**
164
+ - milestone_id (required): Milestone UUID
165
+ - title, description, status (pending/in_progress/completed), order_index`,
166
+ complete_milestone: `# complete_milestone
167
+ Mark milestone as completed.
168
+
169
+ **Parameters:**
170
+ - milestone_id (required): Milestone UUID`,
171
+ delete_milestone: `# delete_milestone
172
+ Delete a milestone.
173
+
174
+ **Parameters:**
175
+ - milestone_id (required): Milestone UUID`,
176
+ get_milestones: `# get_milestones
177
+ Get all milestones for a task.
178
+
179
+ **Parameters:**
180
+ - task_id (required): Task UUID`,
181
+ log_progress: `# log_progress
182
+ Record a progress update.
183
+
184
+ **Parameters:**
185
+ - project_id (required): Project UUID
186
+ - summary (required): Brief summary
187
+ - task_id (optional): Link to task
188
+ - details (optional): Extended notes`,
189
+ get_activity_feed: `# get_activity_feed
190
+ Get combined activity feed.
191
+
192
+ **Parameters:**
193
+ - project_id (required): Project UUID
194
+ - types (optional): Array of task, progress, blocker, decision
195
+ - created_by (optional): agent or user
196
+ - since (optional): ISO date string
197
+ - limit (optional): Max items (default 50)`,
198
+ add_blocker: `# add_blocker
199
+ Record a blocker preventing progress.
200
+
201
+ **Parameters:**
202
+ - project_id (required): Project UUID
203
+ - description (required): What is blocking`,
204
+ resolve_blocker: `# resolve_blocker
205
+ Mark a blocker as resolved.
206
+
207
+ **Parameters:**
208
+ - blocker_id (required): Blocker UUID
209
+ - resolution_note (optional): How it was resolved`,
210
+ get_blockers: `# get_blockers
211
+ Get blockers for a project.
212
+
213
+ **Parameters:**
214
+ - project_id (required): Project UUID
215
+ - status (optional): open or resolved (default: open)`,
216
+ delete_blocker: `# delete_blocker
217
+ Delete a blocker.
218
+
219
+ **Parameters:**
220
+ - blocker_id (required): Blocker UUID`,
221
+ log_decision: `# log_decision
222
+ Record an architectural decision.
223
+
224
+ **Parameters:**
225
+ - project_id (required): Project UUID
226
+ - title (required): Decision title
227
+ - description (required): What was decided
228
+ - rationale (optional): Why
229
+ - alternatives_considered (optional): Array of alternatives`,
230
+ get_decisions: `# get_decisions
231
+ Get recorded decisions.
232
+
233
+ **Parameters:**
234
+ - project_id (required): Project UUID`,
235
+ delete_decision: `# delete_decision
236
+ Delete a decision.
237
+
238
+ **Parameters:**
239
+ - decision_id (required): Decision UUID`,
240
+ add_idea: `# add_idea
241
+ Record an improvement idea.
242
+
243
+ **Parameters:**
244
+ - project_id (required): Project UUID
245
+ - title (required): Idea title
246
+ - description (optional): Details
247
+ - status (optional): raw, exploring, planned, in_development, shipped`,
248
+ update_idea: `# update_idea
249
+ Update an idea.
250
+
251
+ **Parameters:**
252
+ - idea_id (required): Idea UUID
253
+ - title, description, status, doc_url`,
254
+ get_ideas: `# get_ideas
255
+ Get recorded ideas.
256
+
257
+ **Parameters:**
258
+ - project_id (required): Project UUID
259
+ - status (optional): Filter by status`,
260
+ delete_idea: `# delete_idea
261
+ Delete an idea.
262
+
263
+ **Parameters:**
264
+ - idea_id (required): Idea UUID`,
265
+ convert_idea_to_task: `# convert_idea_to_task
266
+ Convert an idea to a task. Creates a new task from the idea's title and description.
267
+
268
+ **Parameters:**
269
+ - idea_id (required): Idea UUID to convert
270
+ - priority (optional): Task priority 1-5 (default: 3)
271
+ - estimated_minutes (optional): Estimated time
272
+ - update_status (optional): Update idea to 'in_development' (default: true)
273
+
274
+ **Returns:**
275
+ - task_id: Created task UUID
276
+ - Links idea and task together`,
277
+ add_finding: `# add_finding
278
+ Record an audit/review finding.
279
+
280
+ **Parameters:**
281
+ - project_id (required): Project UUID
282
+ - title (required): Finding title
283
+ - category: performance, security, code_quality, accessibility, documentation, architecture, testing, other
284
+ - description: Details with impact and suggested fix
285
+ - severity: info, low, medium, high, critical
286
+ - file_path, line_number, related_task_id (optional)`,
287
+ get_findings: `# get_findings
288
+ Get audit findings.
289
+
290
+ **Parameters:**
291
+ - project_id (required): Project UUID
292
+ - category, severity, status (optional filters)
293
+ - limit (optional): Max items`,
294
+ update_finding: `# update_finding
295
+ Update a finding.
296
+
297
+ **Parameters:**
298
+ - finding_id (required): Finding UUID
299
+ - status: open, addressed, dismissed, wontfix
300
+ - resolution_note, title, description, severity`,
301
+ delete_finding: `# delete_finding
302
+ Delete a finding.
303
+
304
+ **Parameters:**
305
+ - finding_id (required): Finding UUID`,
306
+ get_tasks_awaiting_validation: `# get_tasks_awaiting_validation
307
+ Get completed tasks needing validation.
308
+
309
+ **Parameters:**
310
+ - project_id (required): Project UUID
311
+
312
+ **Returns:** Tasks with reviewing status (who's reviewing, when started)`,
313
+ claim_validation: `# claim_validation
314
+ Claim a completed task for review. Shows "being reviewed" on dashboard.
315
+
316
+ **Parameters:**
317
+ - task_id (required): Task UUID to claim
318
+
319
+ **Note:** Claim before reviewing to prevent duplicate work.`,
320
+ validate_task: `# validate_task
321
+ Validate a completed task.
322
+
323
+ **Parameters:**
324
+ - task_id (required): Task UUID
325
+ - approved (required): true/false
326
+ - validation_notes: What was checked, issues found`,
327
+ request_deployment: `# request_deployment
328
+ Request a deployment.
329
+
330
+ **Parameters:**
331
+ - project_id (required): Project UUID
332
+ - environment: development, staging, production
333
+ - version_bump: patch, minor, major
334
+ - notes, git_ref (optional)`,
335
+ claim_deployment_validation: `# claim_deployment_validation
336
+ Claim pending deployment for validation.
337
+
338
+ **Parameters:**
339
+ - project_id (required): Project UUID
340
+
341
+ Next: Run build+tests, then call report_validation`,
342
+ report_validation: `# report_validation
343
+ Report build/test results.
344
+
345
+ **Parameters:**
346
+ - project_id (required): Project UUID
347
+ - build_passed (required): boolean
348
+ - tests_passed (required): boolean
349
+ - error_message (if failed)`,
350
+ check_deployment_status: `# check_deployment_status
351
+ Get active deployment status.
352
+
353
+ **Parameters:**
354
+ - project_id (required): Project UUID`,
355
+ start_deployment: `# start_deployment
356
+ Start deployment (requires 'ready' status).
357
+
358
+ **Parameters:**
359
+ - project_id (required): Project UUID`,
360
+ complete_deployment: `# complete_deployment
361
+ Mark deployment complete.
362
+
363
+ **Parameters:**
364
+ - project_id (required): Project UUID
365
+ - success (required): boolean
366
+ - summary: What was deployed or why failed`,
367
+ cancel_deployment: `# cancel_deployment
368
+ Cancel active deployment.
369
+
370
+ **Parameters:**
371
+ - project_id (required): Project UUID
372
+ - reason (optional): Why cancelled`,
373
+ schedule_deployment: `# schedule_deployment
374
+ Schedule a deployment for a specific time.
375
+
376
+ **Parameters:**
377
+ - project_id (required): Project UUID
378
+ - scheduled_at (required): ISO 8601 datetime
379
+ - schedule_type (optional): once, daily, weekly, monthly (default: once)
380
+ - auto_trigger (optional): Whether agents auto-trigger (default: true)
381
+ - environment (optional): development, staging, production (default: production)
382
+ - version_bump (optional): patch, minor, major (default: patch)
383
+ - notes (optional): Notes about the deployment
384
+ - git_ref (optional): Git branch or commit
385
+
386
+ **Example:** schedule_deployment(project_id, scheduled_at: "2025-01-15T10:00:00Z", schedule_type: "weekly")`,
387
+ get_scheduled_deployments: `# get_scheduled_deployments
388
+ List scheduled deployments for a project.
389
+
390
+ **Parameters:**
391
+ - project_id (required): Project UUID
392
+ - include_disabled (optional): Include disabled schedules (default: false)`,
393
+ update_scheduled_deployment: `# update_scheduled_deployment
394
+ Update a scheduled deployment's configuration.
395
+
396
+ **Parameters:**
397
+ - schedule_id (required): Schedule UUID
398
+ - scheduled_at (optional): New scheduled time
399
+ - schedule_type (optional): once, daily, weekly, monthly
400
+ - auto_trigger (optional): Whether to auto-trigger
401
+ - enabled (optional): Enable or disable
402
+ - environment, version_bump, notes, git_ref (optional)`,
403
+ delete_scheduled_deployment: `# delete_scheduled_deployment
404
+ Delete a scheduled deployment.
405
+
406
+ **Parameters:**
407
+ - schedule_id (required): Schedule UUID`,
408
+ trigger_scheduled_deployment: `# trigger_scheduled_deployment
409
+ Manually trigger a scheduled deployment.
410
+
411
+ Creates a new deployment using the schedule's configuration.
412
+ Updates schedule: last_triggered_at, trigger_count, next scheduled_at (for recurring).
413
+
414
+ **Parameters:**
415
+ - schedule_id (required): Schedule UUID`,
416
+ check_due_deployments: `# check_due_deployments
417
+ Check for scheduled deployments that are due.
418
+
419
+ Returns schedules where: enabled AND auto_trigger AND scheduled_at <= NOW()
420
+
421
+ Use this to find deployments to trigger when working on a project.
422
+
423
+ **Parameters:**
424
+ - project_id (required): Project UUID`,
425
+ start_fallback_activity: `# start_fallback_activity
426
+ Start background activity when no tasks.
427
+
428
+ **Parameters:**
429
+ - project_id (required): Project UUID
430
+ - activity (required): feature_ideation, code_review, performance_audit, ux_review, cost_analysis, security_review, test_coverage, documentation_review, dependency_audit, validate_completed_tasks`,
431
+ stop_fallback_activity: `# stop_fallback_activity
432
+ Stop current fallback activity.
433
+
434
+ **Parameters:**
435
+ - project_id (required): Project UUID
436
+ - summary (optional): What was accomplished`,
437
+ get_activity_history: `# get_activity_history
438
+ Get background activity history.
439
+
440
+ **Parameters:**
441
+ - project_id (required): Project UUID
442
+ - activity_type (optional): Filter by type
443
+ - limit (optional): Max items`,
444
+ get_activity_schedules: `# get_activity_schedules
445
+ Get activity schedules.
446
+
447
+ **Parameters:**
448
+ - project_id (required): Project UUID`,
449
+ get_pending_requests: `# get_pending_requests
450
+ Get unacknowledged user requests.
451
+
452
+ **Parameters:**
453
+ - project_id (required): Project UUID`,
454
+ acknowledge_request: `# acknowledge_request
455
+ Mark a request as handled.
456
+
457
+ **Parameters:**
458
+ - request_id (required): Request UUID`,
459
+ answer_question: `# answer_question
460
+ Answer a user question from dashboard.
461
+
462
+ **Parameters:**
463
+ - request_id (required): Request UUID
464
+ - answer (required): Your answer`,
465
+ discover_tools: `# discover_tools
466
+ List available tools by category.
467
+
468
+ **Parameters:**
469
+ - category (optional): Filter to specific category
470
+
471
+ Without category, returns all categories with tool counts.
472
+ With category, returns tools in that category with brief descriptions.`,
473
+ get_tool_info: `# get_tool_info
474
+ Get detailed info for a specific tool.
475
+
476
+ **Parameters:**
477
+ - tool_name (required): Name of the tool
478
+
479
+ Returns: full documentation, parameters, examples, best practices.`,
480
+ // Organization tools
481
+ list_organizations: `# list_organizations
482
+ List organizations the current user belongs to.
483
+
484
+ **Parameters:** None
485
+
486
+ **Returns:** Array of organizations with role and joined_at`,
487
+ create_organization: `# create_organization
488
+ Create a new organization. You become the owner.
489
+
490
+ **Parameters:**
491
+ - name (required): Organization display name
492
+ - description (optional): Brief description
493
+ - slug (optional): URL-friendly identifier (auto-generated if not provided)
494
+
495
+ **Example:** create_organization(name: "Acme Corp", description: "Our development team")`,
496
+ update_organization: `# update_organization
497
+ Update organization details. Requires admin role.
498
+
499
+ **Parameters:**
500
+ - organization_id (required): Organization UUID
501
+ - name, description, logo_url (optional updates)`,
502
+ delete_organization: `# delete_organization
503
+ Delete an organization. Requires owner role. Removes all shares.
504
+
505
+ **Parameters:**
506
+ - organization_id (required): Organization UUID
507
+
508
+ **Warning:** This will remove all project shares with this organization.`,
509
+ list_org_members: `# list_org_members
510
+ List members of an organization.
511
+
512
+ **Parameters:**
513
+ - organization_id (required): Organization UUID
514
+
515
+ **Returns:** Array of members with role and joined_at`,
516
+ invite_member: `# invite_member
517
+ Invite a user to an organization by email. Requires admin role.
518
+
519
+ **Parameters:**
520
+ - organization_id (required): Organization UUID
521
+ - email (required): Email address to invite
522
+ - role (optional): admin, member, or viewer (default: member)
523
+
524
+ **Returns:** Invite details with token`,
525
+ update_member_role: `# update_member_role
526
+ Change a member's role. Requires admin role.
527
+
528
+ **Parameters:**
529
+ - organization_id (required): Organization UUID
530
+ - user_id (required): User UUID to update
531
+ - role (required): admin, member, or viewer
532
+
533
+ **Note:** Cannot change your own role or the owner's role.`,
534
+ remove_member: `# remove_member
535
+ Remove a member from an organization. Requires admin role.
536
+
537
+ **Parameters:**
538
+ - organization_id (required): Organization UUID
539
+ - user_id (required): User UUID to remove
540
+
541
+ **Note:** Cannot remove the owner. Their org-scoped API keys are invalidated.`,
542
+ leave_organization: `# leave_organization
543
+ Leave an organization.
544
+
545
+ **Parameters:**
546
+ - organization_id (required): Organization UUID
547
+
548
+ **Note:** Owner cannot leave. Must transfer ownership or delete organization.`,
549
+ share_project_with_org: `# share_project_with_org
550
+ Share a project with an organization. You must own the project.
551
+
552
+ **Parameters:**
553
+ - project_id (required): Project UUID
554
+ - organization_id (required): Organization UUID to share with
555
+ - permission (optional): read, write, or admin (default: read)
556
+
557
+ **Permission levels:**
558
+ - read: View project and tasks
559
+ - write: Add/update tasks, log progress
560
+ - admin: All write permissions plus deployments`,
561
+ update_project_share: `# update_project_share
562
+ Update the permission level for a project share.
563
+
564
+ **Parameters:**
565
+ - project_id (required): Project UUID
566
+ - organization_id (required): Organization UUID
567
+ - permission (required): read, write, or admin`,
568
+ unshare_project: `# unshare_project
569
+ Remove a project share from an organization.
570
+
571
+ **Parameters:**
572
+ - project_id (required): Project UUID
573
+ - organization_id (required): Organization UUID
574
+
575
+ **Note:** Org members will lose access immediately.`,
576
+ list_project_shares: `# list_project_shares
577
+ List all organizations a project is shared with.
578
+
579
+ **Parameters:**
580
+ - project_id (required): Project UUID
581
+
582
+ **Returns:** Array of shares with organization info and permission level`,
583
+ // Cost monitoring tools
584
+ get_cost_summary: `# get_cost_summary
585
+ Get cost summary (daily/weekly/monthly) for a project.
586
+
587
+ **Parameters:**
588
+ - project_id (required): Project UUID
589
+ - period: 'daily' | 'weekly' | 'monthly' (default: daily)
590
+ - limit: Max records to return (default: 30)
591
+
592
+ **Returns:** Cost summary with totals and breakdown by model`,
593
+ get_cost_alerts: `# get_cost_alerts
594
+ Get cost alerts for the current user.
595
+
596
+ **Parameters:**
597
+ - project_id (optional): Filter by project
598
+
599
+ **Returns:** Array of configured cost alerts`,
600
+ add_cost_alert: `# add_cost_alert
601
+ Add a cost threshold alert.
602
+
603
+ **Parameters:**
604
+ - project_id (optional): Specific project or null for all
605
+ - threshold_amount (required): Amount in USD
606
+ - threshold_period (required): 'daily' | 'weekly' | 'monthly'
607
+ - alert_type: 'warning' | 'critical' (default: warning)
608
+
609
+ **Example:** add_cost_alert(threshold_amount: 50, threshold_period: "daily", alert_type: "warning")`,
610
+ update_cost_alert: `# update_cost_alert
611
+ Update an existing cost alert.
612
+
613
+ **Parameters:**
614
+ - alert_id (required): Alert UUID
615
+ - threshold_amount: New amount in USD
616
+ - threshold_period: New period
617
+ - alert_type: New alert type
618
+ - enabled: Enable/disable the alert`,
619
+ delete_cost_alert: `# delete_cost_alert
620
+ Delete a cost alert.
621
+
622
+ **Parameters:**
623
+ - alert_id (required): Alert UUID to delete`,
624
+ get_task_costs: `# get_task_costs
625
+ Get cost breakdown by task for a project.
626
+
627
+ **Parameters:**
628
+ - project_id (required): Project UUID
629
+ - limit: Max tasks to return (default: 20)
630
+
631
+ **Returns:** Tasks sorted by estimated cost with model breakdown`,
632
+ // Knowledge base tools
633
+ query_knowledge_base: `# query_knowledge_base
634
+ Query aggregated project knowledge in a single call. Reduces token usage by combining multiple data sources.
635
+
636
+ **Parameters:**
637
+ - project_id (required): Project UUID
638
+ - scope: 'summary' (default) or 'detailed' (includes rationales, descriptions)
639
+ - categories: Array of categories to include (default: all)
640
+ - findings: Audit findings (security, performance, code quality)
641
+ - qa: Questions and answers
642
+ - decisions: Architectural decisions
643
+ - completed_tasks: Tasks with completion summaries
644
+ - blockers: Resolved blockers with resolution notes
645
+ - progress: Recent progress logs
646
+ - limit: Max items per category (default: 5, max: 20)
647
+ - search_query: Optional text search across all knowledge
648
+
649
+ **Returns:**
650
+ - project: name, goal, tech_stack
651
+ - stats: counts for each category, findings by severity
652
+ - Category data based on selection
653
+
654
+ **Token savings:** Replaces up to 6 separate tool calls (get_findings, get_decisions, get_tasks, get_blockers, etc.) with one call.
655
+
656
+ **Example:** query_knowledge_base(project_id, categories: ["findings", "decisions"], limit: 10)`,
657
+ };
@@ -1,4 +1,3 @@
1
- import type { SupabaseClient } from '@supabase/supabase-js';
2
1
  /**
3
2
  * Authentication context from API key validation
4
3
  */
@@ -28,6 +27,15 @@ export interface TokenUsage {
28
27
  byModel: Record<string, ModelTokens>;
29
28
  currentModel: string | null;
30
29
  }
30
+ /**
31
+ * Agent role for specialized work routing
32
+ * - developer: General development work, picks up any available task (default)
33
+ * - validator: Focuses on validating completed tasks
34
+ * - deployer: Handles deployment coordination and monitoring
35
+ * - reviewer: Code review and quality checks
36
+ * - maintainer: Task management, git orchestration, housekeeping
37
+ */
38
+ export type AgentRole = 'developer' | 'validator' | 'deployer' | 'reviewer' | 'maintainer';
31
39
  /**
32
40
  * Session state that persists across tool calls
33
41
  */
@@ -35,6 +43,7 @@ export interface SessionState {
35
43
  instanceId: string;
36
44
  currentSessionId: string | null;
37
45
  currentPersona: string | null;
46
+ currentRole: AgentRole | null;
38
47
  tokenUsage: TokenUsage;
39
48
  }
40
49
  /**
@@ -61,11 +70,10 @@ export interface UserUpdates {
61
70
  * Context passed to all handlers
62
71
  */
63
72
  export interface HandlerContext {
64
- supabase: SupabaseClient;
65
73
  auth: AuthContext;
66
74
  session: SessionState;
67
75
  /** Update session state (for handlers that modify session) */
68
- updateSession: (updates: Partial<Pick<SessionState, 'currentSessionId' | 'currentPersona' | 'tokenUsage'>>) => void;
76
+ updateSession: (updates: Partial<Pick<SessionState, 'currentSessionId' | 'currentPersona' | 'currentRole' | 'tokenUsage'>>) => void;
69
77
  /** Get user updates since last sync (for session handlers) */
70
78
  getUserUpdates?: (projectId: string) => Promise<UserUpdates | undefined>;
71
79
  /** Select an available persona for the agent */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Validation Handlers
2
+ * Validation Handlers (Migrated to API Client)
3
3
  *
4
4
  * Handles cross-agent task validation:
5
5
  * - get_tasks_awaiting_validation