@vibescope/mcp-server 0.0.1 → 0.2.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.
- package/README.md +113 -98
- package/dist/api-client.d.ts +1169 -0
- package/dist/api-client.js +713 -0
- package/dist/cli.d.ts +1 -6
- package/dist/cli.js +39 -240
- package/dist/config/tool-categories.d.ts +31 -0
- package/dist/config/tool-categories.js +253 -0
- package/dist/handlers/blockers.js +57 -58
- package/dist/handlers/bodies-of-work.d.ts +2 -0
- package/dist/handlers/bodies-of-work.js +108 -477
- package/dist/handlers/cost.d.ts +1 -0
- package/dist/handlers/cost.js +35 -113
- package/dist/handlers/decisions.d.ts +2 -0
- package/dist/handlers/decisions.js +28 -27
- package/dist/handlers/deployment.js +113 -828
- package/dist/handlers/discovery.d.ts +3 -0
- package/dist/handlers/discovery.js +26 -627
- package/dist/handlers/fallback.d.ts +2 -0
- package/dist/handlers/fallback.js +56 -142
- package/dist/handlers/findings.d.ts +8 -1
- package/dist/handlers/findings.js +65 -68
- package/dist/handlers/git-issues.d.ts +9 -13
- package/dist/handlers/git-issues.js +80 -225
- package/dist/handlers/ideas.d.ts +3 -0
- package/dist/handlers/ideas.js +53 -134
- package/dist/handlers/index.d.ts +2 -0
- package/dist/handlers/index.js +6 -0
- package/dist/handlers/milestones.d.ts +2 -0
- package/dist/handlers/milestones.js +51 -98
- package/dist/handlers/organizations.js +79 -275
- package/dist/handlers/progress.d.ts +2 -0
- package/dist/handlers/progress.js +25 -123
- package/dist/handlers/project.js +42 -221
- package/dist/handlers/requests.d.ts +2 -0
- package/dist/handlers/requests.js +23 -83
- package/dist/handlers/session.js +119 -590
- package/dist/handlers/sprints.d.ts +32 -0
- package/dist/handlers/sprints.js +275 -0
- package/dist/handlers/tasks.d.ts +7 -10
- package/dist/handlers/tasks.js +245 -894
- package/dist/handlers/tool-docs.d.ts +9 -0
- package/dist/handlers/tool-docs.js +904 -0
- package/dist/handlers/types.d.ts +11 -3
- package/dist/handlers/validation.d.ts +1 -1
- package/dist/handlers/validation.js +38 -153
- package/dist/index.js +493 -162
- package/dist/knowledge.js +106 -9
- package/dist/tools.js +34 -4
- package/dist/validators.d.ts +21 -0
- package/dist/validators.js +91 -0
- package/package.json +2 -3
- package/src/api-client.ts +1822 -0
- package/src/cli.test.ts +128 -302
- package/src/cli.ts +41 -285
- package/src/handlers/__test-setup__.ts +215 -0
- package/src/handlers/__test-utils__.ts +4 -134
- package/src/handlers/blockers.test.ts +114 -124
- package/src/handlers/blockers.ts +68 -70
- package/src/handlers/bodies-of-work.test.ts +236 -831
- package/src/handlers/bodies-of-work.ts +210 -525
- package/src/handlers/cost.test.ts +149 -113
- package/src/handlers/cost.ts +44 -132
- package/src/handlers/decisions.test.ts +111 -209
- package/src/handlers/decisions.ts +35 -27
- package/src/handlers/deployment.test.ts +193 -239
- package/src/handlers/deployment.ts +143 -896
- package/src/handlers/discovery.test.ts +20 -67
- package/src/handlers/discovery.ts +29 -714
- package/src/handlers/fallback.test.ts +206 -361
- package/src/handlers/fallback.ts +81 -156
- package/src/handlers/findings.test.ts +229 -320
- package/src/handlers/findings.ts +76 -64
- package/src/handlers/git-issues.test.ts +623 -0
- package/src/handlers/git-issues.ts +174 -0
- package/src/handlers/ideas.test.ts +229 -343
- package/src/handlers/ideas.ts +69 -143
- package/src/handlers/index.ts +6 -0
- package/src/handlers/milestones.test.ts +167 -281
- package/src/handlers/milestones.ts +54 -93
- package/src/handlers/organizations.test.ts +275 -467
- package/src/handlers/organizations.ts +84 -294
- package/src/handlers/progress.test.ts +112 -218
- package/src/handlers/progress.ts +29 -142
- package/src/handlers/project.test.ts +203 -226
- package/src/handlers/project.ts +48 -238
- package/src/handlers/requests.test.ts +74 -342
- package/src/handlers/requests.ts +25 -83
- package/src/handlers/session.test.ts +276 -206
- package/src/handlers/session.ts +136 -662
- package/src/handlers/sprints.test.ts +711 -0
- package/src/handlers/sprints.ts +510 -0
- package/src/handlers/tasks.test.ts +669 -353
- package/src/handlers/tasks.ts +263 -1015
- package/src/handlers/tool-docs.ts +1024 -0
- package/src/handlers/types.ts +12 -4
- package/src/handlers/validation.test.ts +237 -568
- package/src/handlers/validation.ts +43 -167
- package/src/index.ts +493 -186
- package/src/tools.ts +2532 -0
- package/src/validators.test.ts +223 -223
- package/src/validators.ts +127 -0
- package/tsconfig.json +1 -1
- package/vitest.config.ts +14 -13
- package/dist/cli.test.d.ts +0 -1
- package/dist/cli.test.js +0 -367
- package/dist/handlers/__test-utils__.d.ts +0 -72
- package/dist/handlers/__test-utils__.js +0 -176
- package/dist/handlers/checkouts.d.ts +0 -37
- package/dist/handlers/checkouts.js +0 -377
- package/dist/handlers/knowledge-query.d.ts +0 -22
- package/dist/handlers/knowledge-query.js +0 -253
- package/dist/handlers/knowledge.d.ts +0 -12
- package/dist/handlers/knowledge.js +0 -108
- package/dist/handlers/roles.d.ts +0 -30
- package/dist/handlers/roles.js +0 -281
- package/dist/handlers/tasks.test.d.ts +0 -1
- package/dist/handlers/tasks.test.js +0 -431
- package/dist/utils.test.d.ts +0 -1
- package/dist/utils.test.js +0 -532
- package/dist/validators.test.d.ts +0 -1
- package/dist/validators.test.js +0 -176
- package/src/knowledge.ts +0 -132
- package/src/tmpclaude-0078-cwd +0 -1
- package/src/tmpclaude-0ee1-cwd +0 -1
- package/src/tmpclaude-2dd5-cwd +0 -1
- package/src/tmpclaude-344c-cwd +0 -1
- package/src/tmpclaude-3860-cwd +0 -1
- package/src/tmpclaude-4b63-cwd +0 -1
- package/src/tmpclaude-5c73-cwd +0 -1
- package/src/tmpclaude-5ee3-cwd +0 -1
- package/src/tmpclaude-6795-cwd +0 -1
- package/src/tmpclaude-709e-cwd +0 -1
- package/src/tmpclaude-9839-cwd +0 -1
- package/src/tmpclaude-d829-cwd +0 -1
- package/src/tmpclaude-e072-cwd +0 -1
- package/src/tmpclaude-f6ee-cwd +0 -1
- package/tmpclaude-0439-cwd +0 -1
- package/tmpclaude-132f-cwd +0 -1
- package/tmpclaude-15bb-cwd +0 -1
- package/tmpclaude-165a-cwd +0 -1
- package/tmpclaude-1ba9-cwd +0 -1
- package/tmpclaude-21a3-cwd +0 -1
- package/tmpclaude-2a38-cwd +0 -1
- package/tmpclaude-2adf-cwd +0 -1
- package/tmpclaude-2f56-cwd +0 -1
- package/tmpclaude-3626-cwd +0 -1
- package/tmpclaude-3727-cwd +0 -1
- package/tmpclaude-40bc-cwd +0 -1
- package/tmpclaude-436f-cwd +0 -1
- package/tmpclaude-4783-cwd +0 -1
- package/tmpclaude-4b6d-cwd +0 -1
- package/tmpclaude-4ba4-cwd +0 -1
- package/tmpclaude-51e6-cwd +0 -1
- package/tmpclaude-5ecf-cwd +0 -1
- package/tmpclaude-6f97-cwd +0 -1
- package/tmpclaude-7fb2-cwd +0 -1
- package/tmpclaude-825c-cwd +0 -1
- package/tmpclaude-8baf-cwd +0 -1
- package/tmpclaude-8d9f-cwd +0 -1
- package/tmpclaude-975c-cwd +0 -1
- package/tmpclaude-9983-cwd +0 -1
- package/tmpclaude-a045-cwd +0 -1
- package/tmpclaude-ac4a-cwd +0 -1
- package/tmpclaude-b593-cwd +0 -1
- package/tmpclaude-b891-cwd +0 -1
- package/tmpclaude-c032-cwd +0 -1
- package/tmpclaude-cf43-cwd +0 -1
- package/tmpclaude-d040-cwd +0 -1
- package/tmpclaude-dcdd-cwd +0 -1
- package/tmpclaude-dcee-cwd +0 -1
- package/tmpclaude-e16b-cwd +0 -1
- package/tmpclaude-ecd2-cwd +0 -1
- package/tmpclaude-f48d-cwd +0 -1
package/dist/knowledge.js
CHANGED
|
@@ -18,12 +18,40 @@ export const KNOWLEDGE_BASE = {
|
|
|
18
18
|
- complete_task returns next_task and context counts (validation, blockers, deployment)
|
|
19
19
|
- Priority: 1=highest, 5=lowest`,
|
|
20
20
|
validation: `# Task Validation
|
|
21
|
-
Completed tasks need validation before
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
Completed tasks need validation before PR merge. PRIORITIZE validation over new tasks.
|
|
22
|
+
|
|
23
|
+
## Validator Workflow
|
|
24
|
+
|
|
25
|
+
### 1. Claim Task
|
|
26
|
+
claim_validation(task_id) → Returns worktree_setup with existing branch
|
|
27
|
+
|
|
28
|
+
### 2. Set Up Worktree (EXISTING branch)
|
|
29
|
+
git fetch origin feature/task-branch
|
|
30
|
+
git worktree add ../PROJECT-task-ID feature/task-branch
|
|
31
|
+
cd ../PROJECT-task-ID
|
|
32
|
+
|
|
33
|
+
### 3. Run Tests Locally
|
|
34
|
+
pnpm install && pnpm test && pnpm build
|
|
35
|
+
|
|
36
|
+
### 4. Approve or Reject
|
|
37
|
+
|
|
38
|
+
**APPROVE** → Validator merges PR:
|
|
39
|
+
validate_task(task_id, approved: true, validation_notes: "...")
|
|
40
|
+
# Response includes merge instructions with PR URL
|
|
41
|
+
gh pr merge <NUMBER> --squash
|
|
42
|
+
git worktree remove ../PROJECT-task-ID
|
|
43
|
+
|
|
44
|
+
**REJECT** → Create fix task:
|
|
45
|
+
validate_task(task_id, approved: false, validation_notes: "Issues...", create_fix_task: true)
|
|
46
|
+
# Creates fix task with SAME branch/PR
|
|
47
|
+
# Fix agent picks up, pushes fixes to same PR
|
|
48
|
+
git worktree remove ../PROJECT-task-ID
|
|
49
|
+
|
|
50
|
+
## Key Rules
|
|
51
|
+
- Validators check out EXISTING branches
|
|
52
|
+
- On approval: validator merges immediately
|
|
53
|
+
- On rejection: use create_fix_task: true
|
|
54
|
+
- Always clean up worktree after validation`,
|
|
27
55
|
deployment: `# Deployment Workflow
|
|
28
56
|
1. Ensure all completed tasks are validated first
|
|
29
57
|
2. request_deployment(project_id, environment: "production")
|
|
@@ -68,11 +96,53 @@ When validate_task(approved: true) is called, the response includes:
|
|
|
68
96
|
- **cleanup**: Branch deletion commands
|
|
69
97
|
- **note**: Confirmation it's safe to merge
|
|
70
98
|
|
|
99
|
+
## Multi-Agent Worktrees (CRITICAL)
|
|
100
|
+
|
|
101
|
+
When multiple agents share a repository, you MUST use git worktrees to prevent conflicts.
|
|
102
|
+
|
|
103
|
+
### Why Worktrees?
|
|
104
|
+
- Branch switching in shared repos causes file conflicts between agents
|
|
105
|
+
- Uncommitted changes from one agent block another's work
|
|
106
|
+
- Worktrees provide isolated working directories with shared .git
|
|
107
|
+
|
|
108
|
+
### Setup (Once Per Task)
|
|
109
|
+
\`\`\`bash
|
|
110
|
+
# From main repo, create worktree for your task
|
|
111
|
+
git worktree add ../worktree-<task-short-id> -b feature/<task-id>-<title>
|
|
112
|
+
|
|
113
|
+
# Work in the worktree directory
|
|
114
|
+
cd ../worktree-<task-short-id>
|
|
115
|
+
\`\`\`
|
|
116
|
+
|
|
117
|
+
### Cleanup (After Task Merged)
|
|
118
|
+
\`\`\`bash
|
|
119
|
+
# Remove worktree after PR merged
|
|
120
|
+
git worktree remove ../worktree-<task-short-id>
|
|
121
|
+
git branch -d feature/<task-id>-<title>
|
|
122
|
+
\`\`\`
|
|
123
|
+
|
|
124
|
+
### Worktree Rules
|
|
125
|
+
- ALWAYS create a worktree before starting work on a task
|
|
126
|
+
- Each agent works in their own worktree directory
|
|
127
|
+
- Never switch branches in the main repo when other agents are active
|
|
128
|
+
- Commit and push frequently to avoid losing work
|
|
129
|
+
|
|
130
|
+
## Handling Merge Conflicts
|
|
131
|
+
|
|
132
|
+
When claim_validation detects conflicts (via GitHub API):
|
|
133
|
+
1. Response includes merge_conflict with rebase_instructions
|
|
134
|
+
2. Checkout the feature branch locally
|
|
135
|
+
3. Rebase onto target branch: \`git rebase origin/<target>\`
|
|
136
|
+
4. Resolve conflicts, then: \`git add . && git rebase --continue\`
|
|
137
|
+
5. Force push: \`git push origin <branch> --force-with-lease\`
|
|
138
|
+
6. Re-claim validation to verify PR is now mergeable
|
|
139
|
+
|
|
71
140
|
## Key Rules
|
|
72
|
-
- Create branch when starting task (
|
|
141
|
+
- Create worktree + branch when starting task (multi-agent environments)
|
|
73
142
|
- Push and create PR when completing task
|
|
74
143
|
- Wait for validation before merging
|
|
75
|
-
-
|
|
144
|
+
- Resolve merge conflicts via rebase before approval
|
|
145
|
+
- Clean up worktree and branch after successful merge`,
|
|
76
146
|
blockers: `# Working with Blockers
|
|
77
147
|
When stuck and need human input:
|
|
78
148
|
1. add_blocker(project_id, description: "What's blocking")
|
|
@@ -107,6 +177,32 @@ Be mindful of token costs - every tool call has a cost.
|
|
|
107
177
|
- /compact when context grows large
|
|
108
178
|
- Batch related updates when possible
|
|
109
179
|
- Trust lite mode; only use full mode for initial exploration`,
|
|
180
|
+
sprints: `# Sprints
|
|
181
|
+
Sprints are time-bounded bodies of work with velocity tracking.
|
|
182
|
+
|
|
183
|
+
## Lifecycle
|
|
184
|
+
1. **planning**: Create sprint, add tasks with story points
|
|
185
|
+
2. **active**: Sprint in progress, working on tasks
|
|
186
|
+
3. **in_review**: Sprint ended, reviewing completion
|
|
187
|
+
4. **retrospective**: Post-sprint reflection
|
|
188
|
+
5. **completed**: Final state, velocity recorded
|
|
189
|
+
|
|
190
|
+
## Workflow
|
|
191
|
+
1. create_sprint(project_id, title, start_date, end_date, goal)
|
|
192
|
+
2. get_sprint_backlog(project_id) - view available tasks
|
|
193
|
+
3. add_task_to_sprint(sprint_id, task_id, story_points) - add tasks
|
|
194
|
+
4. start_sprint(sprint_id) - locks committed_points
|
|
195
|
+
5. Work on tasks normally (they're assigned to the sprint)
|
|
196
|
+
6. complete_sprint(sprint_id) - calculates final velocity
|
|
197
|
+
|
|
198
|
+
## Velocity Tracking
|
|
199
|
+
- committed_points: Total story points at sprint start
|
|
200
|
+
- velocity_points: Story points completed by sprint end
|
|
201
|
+
- get_sprint_velocity(project_id) - shows history and average velocity
|
|
202
|
+
|
|
203
|
+
## Auto-Deployment
|
|
204
|
+
Set auto_deploy_on_completion: true when creating sprint.
|
|
205
|
+
Triggers deployment when sprint completes.`,
|
|
110
206
|
topics: `# Available Help Topics
|
|
111
207
|
- getting_started: Basic workflow overview
|
|
112
208
|
- tasks: Working on tasks, progress tracking
|
|
@@ -117,5 +213,6 @@ Be mindful of token costs - every tool call has a cost.
|
|
|
117
213
|
- milestones: Breaking down complex tasks
|
|
118
214
|
- fallback: Background activities when idle
|
|
119
215
|
- session: Session management
|
|
120
|
-
- tokens: Token efficiency tips
|
|
216
|
+
- tokens: Token efficiency tips
|
|
217
|
+
- sprints: Time-bounded task groupings with velocity tracking`,
|
|
121
218
|
};
|
package/dist/tools.js
CHANGED
|
@@ -417,6 +417,10 @@ Returns session info, persona, role, and next task. Use mode:'full' for complete
|
|
|
417
417
|
type: 'boolean',
|
|
418
418
|
description: 'Include subtasks in results (default false). Use get_subtasks for subtasks of a specific task.',
|
|
419
419
|
},
|
|
420
|
+
include_metadata: {
|
|
421
|
+
type: 'boolean',
|
|
422
|
+
description: 'When true, returns all task fields (description, progress, timestamps, etc.). When false (default), returns only id/title/priority/status to save tokens.',
|
|
423
|
+
},
|
|
420
424
|
},
|
|
421
425
|
required: ['project_id'],
|
|
422
426
|
},
|
|
@@ -877,15 +881,29 @@ Returns session info, persona, role, and next task. Use mode:'full' for complete
|
|
|
877
881
|
},
|
|
878
882
|
{
|
|
879
883
|
name: 'get_findings',
|
|
880
|
-
description: `Get findings for a project, optionally filtered by category, severity, or status.`,
|
|
884
|
+
description: `Get findings for a project, optionally filtered by category, severity, or status. Use summary_only=true to reduce token usage by returning only essential fields (id, title, category, severity, status). For just counts, use get_findings_stats instead.`,
|
|
881
885
|
inputSchema: {
|
|
882
886
|
type: 'object',
|
|
883
887
|
properties: {
|
|
884
888
|
project_id: { type: 'string', description: 'Project UUID' },
|
|
885
889
|
category: { type: 'string', enum: ['performance', 'security', 'code_quality', 'accessibility', 'documentation', 'architecture', 'testing', 'other'], description: 'Filter by category (optional)' },
|
|
886
890
|
severity: { type: 'string', enum: ['info', 'low', 'medium', 'high', 'critical'], description: 'Filter by severity (optional)' },
|
|
887
|
-
status: { type: 'string', enum: ['open', 'addressed', 'dismissed', 'wontfix'], description: 'Filter by status (default:
|
|
888
|
-
limit: { type: 'number', description: 'Max number of findings to return (default 50)' },
|
|
891
|
+
status: { type: 'string', enum: ['open', 'addressed', 'dismissed', 'wontfix'], description: 'Filter by status (default: open)' },
|
|
892
|
+
limit: { type: 'number', description: 'Max number of findings to return (default 50, max 200)' },
|
|
893
|
+
offset: { type: 'number', description: 'Number of findings to skip for pagination (default 0)' },
|
|
894
|
+
search_query: { type: 'string', description: 'Search findings by title' },
|
|
895
|
+
summary_only: { type: 'boolean', description: 'When true, returns only id, title, category, severity, status (reduces tokens by ~80%). Default: false' },
|
|
896
|
+
},
|
|
897
|
+
required: ['project_id'],
|
|
898
|
+
},
|
|
899
|
+
},
|
|
900
|
+
{
|
|
901
|
+
name: 'get_findings_stats',
|
|
902
|
+
description: `Get aggregate statistics about findings for a project. Returns total count and breakdowns by status, severity, and category. Much more token-efficient than get_findings when you just need to understand the overall state.`,
|
|
903
|
+
inputSchema: {
|
|
904
|
+
type: 'object',
|
|
905
|
+
properties: {
|
|
906
|
+
project_id: { type: 'string', description: 'Project UUID' },
|
|
889
907
|
},
|
|
890
908
|
required: ['project_id'],
|
|
891
909
|
},
|
|
@@ -1096,6 +1114,10 @@ Returns subtasks with aggregate completion stats.`,
|
|
|
1096
1114
|
type: 'string',
|
|
1097
1115
|
description: 'Session ID from start_work_session (optional, uses current session if not provided)',
|
|
1098
1116
|
},
|
|
1117
|
+
current_worktree_path: {
|
|
1118
|
+
type: ['string', 'null'],
|
|
1119
|
+
description: 'Report your current git worktree path (e.g., "../project-task-abc123"). Set to null to clear.',
|
|
1120
|
+
},
|
|
1099
1121
|
},
|
|
1100
1122
|
},
|
|
1101
1123
|
},
|
|
@@ -1145,7 +1167,7 @@ Returns subtasks with aggregate completion stats.`,
|
|
|
1145
1167
|
},
|
|
1146
1168
|
{
|
|
1147
1169
|
name: 'validate_task',
|
|
1148
|
-
description: 'Validate a completed task. Include test results in validation_notes.',
|
|
1170
|
+
description: 'Validate a completed task. Include test results in validation_notes. For github-flow/git-flow projects, a PR must exist before approval (add via add_task_reference).',
|
|
1149
1171
|
inputSchema: {
|
|
1150
1172
|
type: 'object',
|
|
1151
1173
|
properties: {
|
|
@@ -1161,6 +1183,10 @@ Returns subtasks with aggregate completion stats.`,
|
|
|
1161
1183
|
type: 'boolean',
|
|
1162
1184
|
description: 'Whether the task passes validation (true = approved, false = needs more work)',
|
|
1163
1185
|
},
|
|
1186
|
+
skip_pr_check: {
|
|
1187
|
+
type: 'boolean',
|
|
1188
|
+
description: 'Skip PR existence check (use only for tasks that legitimately do not need a PR)',
|
|
1189
|
+
},
|
|
1164
1190
|
},
|
|
1165
1191
|
required: ['task_id', 'approved'],
|
|
1166
1192
|
},
|
|
@@ -1344,6 +1370,10 @@ Returns subtasks with aggregate completion stats.`,
|
|
|
1344
1370
|
type: 'boolean',
|
|
1345
1371
|
description: 'When true, converted task blocks all other work until complete',
|
|
1346
1372
|
},
|
|
1373
|
+
recurring: {
|
|
1374
|
+
type: 'boolean',
|
|
1375
|
+
description: 'When true, requirement resets to pending when a new deployment is requested',
|
|
1376
|
+
},
|
|
1347
1377
|
},
|
|
1348
1378
|
required: ['project_id', 'type', 'title'],
|
|
1349
1379
|
},
|
package/dist/validators.d.ts
CHANGED
|
@@ -33,3 +33,24 @@ export declare function validatePriority(priority: number | undefined): void;
|
|
|
33
33
|
export declare function validateProgressPercentage(percentage: number | undefined): void;
|
|
34
34
|
export declare function validateEstimatedMinutes(minutes: number | undefined): void;
|
|
35
35
|
export declare function validateEnvironment(environment: string | undefined): void;
|
|
36
|
+
export declare function validateEnum<T extends readonly string[]>(value: string | undefined, validValues: T, fieldName: string): void;
|
|
37
|
+
export type FieldType = 'string' | 'number' | 'boolean' | 'array' | 'object';
|
|
38
|
+
export interface FieldSchema {
|
|
39
|
+
type: FieldType;
|
|
40
|
+
required?: boolean;
|
|
41
|
+
validate?: (value: unknown, fieldName: string) => void;
|
|
42
|
+
default?: unknown;
|
|
43
|
+
}
|
|
44
|
+
export type ArgSchema = Record<string, FieldSchema>;
|
|
45
|
+
export type InferArgs<T extends ArgSchema> = {
|
|
46
|
+
[K in keyof T]: T[K]['required'] extends true ? T[K]['type'] extends 'string' ? string : T[K]['type'] extends 'number' ? number : T[K]['type'] extends 'boolean' ? boolean : T[K]['type'] extends 'array' ? unknown[] : T[K]['type'] extends 'object' ? Record<string, unknown> : unknown : T[K]['type'] extends 'string' ? string | undefined : T[K]['type'] extends 'number' ? number | undefined : T[K]['type'] extends 'boolean' ? boolean | undefined : T[K]['type'] extends 'array' ? unknown[] | undefined : T[K]['type'] extends 'object' ? Record<string, unknown> | undefined : unknown | undefined;
|
|
47
|
+
};
|
|
48
|
+
export declare function parseArgs<T extends ArgSchema>(args: Record<string, unknown>, schema: T): InferArgs<T>;
|
|
49
|
+
export declare function uuidValidator(value: unknown, fieldName: string): void;
|
|
50
|
+
export declare function taskStatusValidator(value: unknown, _fieldName: string): void;
|
|
51
|
+
export declare function projectStatusValidator(value: unknown, _fieldName: string): void;
|
|
52
|
+
export declare function priorityValidator(value: unknown, _fieldName: string): void;
|
|
53
|
+
export declare function progressValidator(value: unknown, _fieldName: string): void;
|
|
54
|
+
export declare function minutesValidator(value: unknown, _fieldName: string): void;
|
|
55
|
+
export declare function environmentValidator(value: unknown, _fieldName: string): void;
|
|
56
|
+
export declare function createEnumValidator<T extends readonly string[]>(validValues: T): (value: unknown, fieldName: string) => void;
|
package/dist/validators.js
CHANGED
|
@@ -109,3 +109,94 @@ export function validateEnvironment(environment) {
|
|
|
109
109
|
});
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
|
+
export function validateEnum(value, validValues, fieldName) {
|
|
113
|
+
if (!value)
|
|
114
|
+
return;
|
|
115
|
+
if (!validValues.includes(value)) {
|
|
116
|
+
throw new ValidationError(`Invalid ${fieldName}: "${value}"`, {
|
|
117
|
+
field: fieldName,
|
|
118
|
+
validValues: validValues,
|
|
119
|
+
hint: `${fieldName} must be one of: ${validValues.join(', ')}`,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
function checkType(value, type) {
|
|
124
|
+
if (value === undefined || value === null)
|
|
125
|
+
return true;
|
|
126
|
+
switch (type) {
|
|
127
|
+
case 'string': return typeof value === 'string';
|
|
128
|
+
case 'number': return typeof value === 'number';
|
|
129
|
+
case 'boolean': return typeof value === 'boolean';
|
|
130
|
+
case 'array': return Array.isArray(value);
|
|
131
|
+
case 'object': return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
132
|
+
default: return true;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
export function parseArgs(args, schema) {
|
|
136
|
+
const result = {};
|
|
137
|
+
for (const [fieldName, fieldSchema] of Object.entries(schema)) {
|
|
138
|
+
let value = args[fieldName];
|
|
139
|
+
if (value === undefined && fieldSchema.default !== undefined) {
|
|
140
|
+
value = fieldSchema.default;
|
|
141
|
+
}
|
|
142
|
+
if (fieldSchema.required && (value === undefined || value === null || value === '')) {
|
|
143
|
+
throw new ValidationError(`Missing required field: ${fieldName}`, {
|
|
144
|
+
field: fieldName,
|
|
145
|
+
hint: `Please provide a value for "${fieldName}"`,
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
if (value !== undefined && value !== null && !checkType(value, fieldSchema.type)) {
|
|
149
|
+
throw new ValidationError(`Invalid type for ${fieldName}: expected ${fieldSchema.type}, got ${typeof value}`, {
|
|
150
|
+
field: fieldName,
|
|
151
|
+
hint: `The "${fieldName}" field must be a ${fieldSchema.type}`,
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
if (fieldSchema.validate && value !== undefined && value !== null) {
|
|
155
|
+
fieldSchema.validate(value, fieldName);
|
|
156
|
+
}
|
|
157
|
+
result[fieldName] = value;
|
|
158
|
+
}
|
|
159
|
+
return result;
|
|
160
|
+
}
|
|
161
|
+
export function uuidValidator(value, fieldName) {
|
|
162
|
+
if (typeof value !== 'string')
|
|
163
|
+
return;
|
|
164
|
+
validateUUID(value, fieldName);
|
|
165
|
+
}
|
|
166
|
+
export function taskStatusValidator(value, _fieldName) {
|
|
167
|
+
if (typeof value !== 'string')
|
|
168
|
+
return;
|
|
169
|
+
validateTaskStatus(value);
|
|
170
|
+
}
|
|
171
|
+
export function projectStatusValidator(value, _fieldName) {
|
|
172
|
+
if (typeof value !== 'string')
|
|
173
|
+
return;
|
|
174
|
+
validateProjectStatus(value);
|
|
175
|
+
}
|
|
176
|
+
export function priorityValidator(value, _fieldName) {
|
|
177
|
+
if (typeof value !== 'number')
|
|
178
|
+
return;
|
|
179
|
+
validatePriority(value);
|
|
180
|
+
}
|
|
181
|
+
export function progressValidator(value, _fieldName) {
|
|
182
|
+
if (typeof value !== 'number')
|
|
183
|
+
return;
|
|
184
|
+
validateProgressPercentage(value);
|
|
185
|
+
}
|
|
186
|
+
export function minutesValidator(value, _fieldName) {
|
|
187
|
+
if (typeof value !== 'number')
|
|
188
|
+
return;
|
|
189
|
+
validateEstimatedMinutes(value);
|
|
190
|
+
}
|
|
191
|
+
export function environmentValidator(value, _fieldName) {
|
|
192
|
+
if (typeof value !== 'string')
|
|
193
|
+
return;
|
|
194
|
+
validateEnvironment(value);
|
|
195
|
+
}
|
|
196
|
+
export function createEnumValidator(validValues) {
|
|
197
|
+
return (value, fieldName) => {
|
|
198
|
+
if (typeof value !== 'string')
|
|
199
|
+
return;
|
|
200
|
+
validateEnum(value, validValues, fieldName);
|
|
201
|
+
};
|
|
202
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibescope/mcp-server",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "MCP server for Vibescope - AI project tracking tools",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -38,7 +38,6 @@
|
|
|
38
38
|
"vitest": "^4.0.17"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@modelcontextprotocol/sdk": "^1.25.2"
|
|
42
|
-
"@supabase/supabase-js": "^2.90.1"
|
|
41
|
+
"@modelcontextprotocol/sdk": "^1.25.2"
|
|
43
42
|
}
|
|
44
43
|
}
|