@jigyasudham/veto 1.2.19 → 1.4.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.
@@ -0,0 +1,797 @@
1
+ // Tool definitions for all 46 Veto MCP tools — pure data, no side effects.
2
+ // Grouped by category. server.ts imports TOOL_DEFINITIONS and maps annotations onto it.
3
+ export const TOOL_DEFINITIONS = [
4
+ // ── Status & Health ──────────────────────────────────────────────────────────
5
+ {
6
+ name: 'veto_status',
7
+ description: 'Returns Veto server status, version, and database info. Pass token_count to trigger auto-save if context usage crosses 70%.',
8
+ inputSchema: {
9
+ type: 'object',
10
+ properties: {
11
+ token_count: {
12
+ type: 'number',
13
+ description: 'Current session token count. If provided and context usage ≥ 70%, Veto auto-saves the last known session context in the background.',
14
+ },
15
+ platform: {
16
+ type: 'string',
17
+ description: 'AI platform (claude, gemini, codex). Used to select the correct context window for threshold calculation. Defaults to "claude".',
18
+ enum: ['claude', 'gemini', 'codex'],
19
+ },
20
+ model: {
21
+ type: 'string',
22
+ description: 'Optional: specific model ID (e.g. "claude-sonnet-4-6", "gemini-2-5-pro", "gpt-4o"). When provided, Veto resolves the exact context window for that model instead of using the platform default.',
23
+ },
24
+ },
25
+ required: [],
26
+ },
27
+ },
28
+ {
29
+ name: 'veto_autosave_status',
30
+ description: 'Returns the current auto-save state: whether a context is cached, the threshold, the last auto-save time, and the session ID.',
31
+ inputSchema: {
32
+ type: 'object',
33
+ properties: {},
34
+ required: [],
35
+ },
36
+ },
37
+ {
38
+ name: 'veto_health',
39
+ description: 'Returns a live health snapshot of the Veto server — DB size, session/memory/pattern counts, uptime, error count, and average council latency.',
40
+ inputSchema: {
41
+ type: 'object',
42
+ properties: {},
43
+ required: [],
44
+ },
45
+ },
46
+ {
47
+ name: 'veto_rate_status',
48
+ description: 'Returns current request counts and rate limit status for all AI platforms tracked by Veto.',
49
+ inputSchema: {
50
+ type: 'object',
51
+ properties: {},
52
+ required: [],
53
+ },
54
+ },
55
+ // ── Session ──────────────────────────────────────────────────────────────────
56
+ {
57
+ name: 'veto_session_save',
58
+ description: 'Saves the current session context to SQLite. Pass session_id to update an existing session instead of creating a new one — use this when refreshing context mid-conversation rather than starting a new snapshot.',
59
+ inputSchema: {
60
+ type: 'object',
61
+ properties: {
62
+ summary: {
63
+ type: 'string',
64
+ description: 'A brief summary of what was accomplished this session.',
65
+ },
66
+ context: {
67
+ type: 'string',
68
+ description: 'Key context to restore (decisions, current task, file list, etc.).',
69
+ },
70
+ task_state: {
71
+ type: 'string',
72
+ description: 'Current task state — what is done and what is next.',
73
+ },
74
+ platform: {
75
+ type: 'string',
76
+ description: 'AI platform used (claude, gemini, codex). Defaults to "claude".',
77
+ enum: ['claude', 'gemini', 'codex'],
78
+ },
79
+ project_dir: {
80
+ type: 'string',
81
+ description: 'Absolute path to the current project directory.',
82
+ },
83
+ connection_type: {
84
+ type: 'string',
85
+ description: 'How you are connected to this AI — "subscription" (Claude Pro, Gemini Advanced) or "api" (API key). Used for usage tracking.',
86
+ enum: ['subscription', 'api'],
87
+ },
88
+ token_count: {
89
+ type: 'number',
90
+ description: 'Approximate tokens used this session. Veto uses this for context window monitoring.',
91
+ },
92
+ session_id: {
93
+ type: 'string',
94
+ description: 'Optional. UUID of an existing session to update in-place. When provided, Veto updates that row instead of inserting a new one — prevents session inflation when refreshing mid-conversation.',
95
+ },
96
+ model: {
97
+ type: 'string',
98
+ description: 'Optional: specific model ID (e.g. "claude-sonnet-4-6", "gemini-2-5-pro", "gpt-4o"). Veto resolves the exact context window for this model and uses it for auto-save threshold calculations.',
99
+ },
100
+ tags: {
101
+ type: 'array',
102
+ items: { type: 'string' },
103
+ description: 'Optional labels for this session (e.g. ["auth", "migration", "v1.3"]). Makes sessions searchable via veto_sessions_list query.',
104
+ },
105
+ },
106
+ required: ['summary', 'context'],
107
+ },
108
+ },
109
+ {
110
+ name: 'veto_session_restore',
111
+ description: 'Restores a previously saved session by ID. Use veto_sessions_list to find IDs.',
112
+ inputSchema: {
113
+ type: 'object',
114
+ properties: {
115
+ session_id: {
116
+ type: 'string',
117
+ description: 'UUID of the session to restore.',
118
+ },
119
+ resuming_as: {
120
+ type: 'string',
121
+ description: 'The AI client resuming this session (e.g. "claude", "gemini", "codex"). Recorded as active_client.',
122
+ enum: ['claude', 'gemini', 'codex'],
123
+ },
124
+ },
125
+ required: ['session_id'],
126
+ },
127
+ },
128
+ {
129
+ name: 'veto_sessions_list',
130
+ description: 'Lists the most recent saved sessions. Use query to search by summary, context, tags, or project path.',
131
+ inputSchema: {
132
+ type: 'object',
133
+ properties: {
134
+ limit: {
135
+ type: 'number',
136
+ description: 'Number of sessions to return (default 10, max 50).',
137
+ },
138
+ query: {
139
+ type: 'string',
140
+ description: 'Optional text search — matches against summary, context, task_state, tags, and project_dir.',
141
+ },
142
+ },
143
+ required: [],
144
+ },
145
+ },
146
+ {
147
+ name: 'veto_handoff',
148
+ description: 'Saves the current session and returns step-by-step instructions to continue on another AI platform (Gemini or Codex). Call this when Claude is approaching its rate limit. The receiving platform calls veto_continue to restore full context instantly.',
149
+ inputSchema: {
150
+ type: 'object',
151
+ properties: {
152
+ summary: { type: 'string', description: 'What was accomplished this session — one or two sentences.' },
153
+ context: { type: 'string', description: 'Key context the next platform needs: active decisions, file paths, constraints.' },
154
+ task_state: { type: 'string', description: 'Current task state — what is done, what is in progress, what is next.' },
155
+ from_platform: { type: 'string', enum: ['claude', 'gemini', 'codex'], description: 'Platform handing off (default: claude).' },
156
+ to_platform: { type: 'string', enum: ['gemini', 'codex', 'claude'], description: 'Target platform. If omitted, Veto picks the platform with the most headroom.' },
157
+ project_dir: { type: 'string', description: 'Absolute path to the current project directory.' },
158
+ token_count: { type: 'number', description: 'Approximate tokens used this session.' },
159
+ },
160
+ required: ['summary', 'context'],
161
+ },
162
+ },
163
+ {
164
+ name: 'veto_continue',
165
+ description: 'Restores the most recent session on any platform. Call this immediately after switching platforms — Veto returns the full context, summary, and next action. Nothing needs to be re-explained.',
166
+ inputSchema: {
167
+ type: 'object',
168
+ properties: {
169
+ session_id: { type: 'string', description: 'Optional. Session ID from veto_handoff. If omitted, the most recent saved session is restored.' },
170
+ resuming_as: { type: 'string', description: 'The AI client resuming this session (e.g. "gemini"). Recorded as active_client so you can track which tool is currently working on it.', enum: ['claude', 'gemini', 'codex'] },
171
+ },
172
+ required: [],
173
+ },
174
+ },
175
+ // ── Council ──────────────────────────────────────────────────────────────────
176
+ {
177
+ name: 'veto_council_debate',
178
+ description: 'Runs the Veto Council — 7 specialist agents (Lead Dev, PM, Architect, UX, Devil\'s Advocate, Legal, Security) debate your task and return a GREEN / YELLOW / RED / DEADLOCK verdict before any code is written. Use strictness to control depth: fast (3 agents), standard (7, default), strict (7 + rebuttal round).',
179
+ inputSchema: {
180
+ type: 'object',
181
+ properties: {
182
+ task: {
183
+ type: 'string',
184
+ description: 'The task or decision to debate. Be specific — include approach, tech stack, and constraints.',
185
+ },
186
+ context: {
187
+ type: 'string',
188
+ description: 'Optional: additional context such as codebase state, prior decisions, or constraints.',
189
+ },
190
+ project_dir: {
191
+ type: 'string',
192
+ description: 'Optional: absolute path to the project directory. Veto will auto-read package.json, git diff, and stack info to give the council real project context.',
193
+ },
194
+ session_id: {
195
+ type: 'string',
196
+ description: 'Optional: session ID to associate this council outcome with an active session.',
197
+ },
198
+ max_tokens: {
199
+ type: 'number',
200
+ description: 'Optional: token budget for this operation. Veto estimates output tokens and warns in the response if the estimate exceeds this limit. Logged to usage_log for tracking.',
201
+ },
202
+ strictness: {
203
+ type: 'string',
204
+ enum: ['fast', 'standard', 'strict'],
205
+ description: 'Council depth. fast: 3 core agents (dev + architect + security), instant. standard: all 7 agents (default). strict: all 7 + Devil\'s Advocate rebuttal round on the most critical blocker.',
206
+ },
207
+ },
208
+ required: ['task'],
209
+ },
210
+ },
211
+ {
212
+ name: 'veto_benchmark',
213
+ description: 'Compares two competing approaches by running a full council debate on each in parallel, then returns a structured winner analysis with verdict, confidence delta, warning counts, and council reasoning. Use when you have two valid options and want an unbiased council judgment before committing.',
214
+ inputSchema: {
215
+ type: 'object',
216
+ properties: {
217
+ task: { type: 'string', description: 'The decision context — what problem are both approaches solving?' },
218
+ approach_a: { type: 'string', description: 'First approach to evaluate. Be specific about tech choices, trade-offs, and constraints.' },
219
+ approach_b: { type: 'string', description: 'Second approach to evaluate. Same level of detail as approach_a.' },
220
+ context: { type: 'string', description: 'Optional: shared context for both debates (architecture notes, constraints, team size, etc.).' },
221
+ project_dir: { type: 'string', description: 'Optional: auto-inject package.json and git diff context.' },
222
+ },
223
+ required: ['task', 'approach_a', 'approach_b'],
224
+ },
225
+ },
226
+ // ── Routing & Execution ──────────────────────────────────────────────────────
227
+ {
228
+ name: 'veto_route_task',
229
+ description: 'Scores a task for complexity (0-100) and returns the optimal tier, model recommendation, and rate status. Use before any substantial task to let the router decide which model to use.',
230
+ inputSchema: {
231
+ type: 'object',
232
+ properties: {
233
+ task: {
234
+ type: 'string',
235
+ description: 'The task description to score and route.',
236
+ },
237
+ agent_type: {
238
+ type: 'string',
239
+ description: 'Optional agent type — some agents are tier-locked regardless of score.',
240
+ enum: [
241
+ 'lead-developer', 'system-architect', 'security-scanner',
242
+ 'devil-advocate', 'decision-engine', 'risk-assessor',
243
+ 'coder', 'tester', 'reviewer', 'database', 'documentation',
244
+ 'file-manager', 'git-agent', 'search-agent', 'secrets', 'reporter',
245
+ 'dynamic',
246
+ ],
247
+ },
248
+ files_affected: {
249
+ type: 'number',
250
+ description: 'Number of files the task will touch (influences complexity score).',
251
+ },
252
+ force_council: {
253
+ type: 'boolean',
254
+ description: 'Set true to force a Tier 3 / council-required routing.',
255
+ },
256
+ context: {
257
+ type: 'string',
258
+ description: 'Current context text — router will return a compression plan.',
259
+ },
260
+ preferred_platform: {
261
+ type: 'string',
262
+ description: 'Preferred AI platform. Router may override if rate-limited.',
263
+ enum: ['claude', 'gemini', 'codex'],
264
+ },
265
+ },
266
+ required: ['task'],
267
+ },
268
+ },
269
+ {
270
+ name: 'veto_agent_plan',
271
+ description: 'Gets a domain-expert execution plan from a specific worker agent. Returns approach, ordered steps, checklist, patterns, and pitfalls for the task.',
272
+ inputSchema: {
273
+ type: 'object',
274
+ properties: {
275
+ agent: {
276
+ type: 'string',
277
+ description: 'The worker agent to consult.',
278
+ enum: ['coder', 'reviewer', 'tester', 'debugger', 'refactor', 'database', 'api', 'frontend', 'backend', 'devops', 'performance', 'migration', 'security-scanner', 'auth', 'privacy', 'secrets', 'dependency-audit', 'penetration', 'context-manager', 'decision-logger', 'project-mapper', 'pattern-learner', 'knowledge-base', 'researcher', 'tech-advisor', 'cost-analyzer', 'competitor-analyzer', 'risk-assessor', 'estimator', 'ethics-bias', 'code-quality', 'documentation', 'accessibility', 'compatibility', 'error-handling', 'task-planner', 'task-coordinator', 'file-manager', 'git-agent', 'search-agent', 'reporter', 'automation'],
279
+ },
280
+ task: { type: 'string', description: 'The task for the agent to plan.' },
281
+ context: { type: 'string', description: 'Optional additional context.' },
282
+ project_dir: { type: 'string', description: 'Optional: absolute path to the project directory. Auto-injects package.json, git diff, and stack info into the agent context.' },
283
+ },
284
+ required: ['agent', 'task'],
285
+ },
286
+ },
287
+ {
288
+ name: 'veto_execute_parallel',
289
+ description: 'Runs multiple worker agents simultaneously via Promise.all. Use to get domain expert input from several agents in one round-trip — e.g. coder + tester + security-scanner all planning the same feature together.',
290
+ inputSchema: {
291
+ type: 'object',
292
+ properties: {
293
+ tasks: {
294
+ type: 'array',
295
+ description: 'List of agent tasks to run in parallel.',
296
+ items: {
297
+ type: 'object',
298
+ properties: {
299
+ id: { type: 'string', description: 'Unique ID for this task (use any string).' },
300
+ agent: { type: 'string', description: 'Worker agent type.' },
301
+ task: { type: 'string', description: 'Task description for this agent.' },
302
+ code: { type: 'string', description: 'Optional code to analyze (triggers analyze() instead of plan()).' },
303
+ context: { type: 'string', description: 'Optional additional context.' },
304
+ project_dir: { type: 'string', description: 'Optional: per-task project dir override.' },
305
+ },
306
+ required: ['id', 'agent', 'task'],
307
+ },
308
+ },
309
+ project_dir: { type: 'string', description: 'Optional: project directory applied to all tasks (per-task project_dir overrides this). Auto-injects codebase context.' },
310
+ max_tokens: {
311
+ type: 'number',
312
+ description: 'Optional: token budget for this parallel execution. Veto estimates combined output tokens and warns if the estimate exceeds this limit. Logged to usage_log.',
313
+ },
314
+ },
315
+ required: ['tasks'],
316
+ },
317
+ },
318
+ {
319
+ name: 'veto_task_parse',
320
+ description: 'Parses a plain-English project description or PRD into a structured task DAG with dependencies, complexity scores, priorities, and suggested agent assignments. Feeds directly into veto_workflow.',
321
+ inputSchema: {
322
+ type: 'object',
323
+ properties: {
324
+ description: { type: 'string', description: 'Project description, PRD, or feature brief to parse into tasks.' },
325
+ project_dir: { type: 'string', description: 'Optional project directory for codebase context injection.' },
326
+ max_tasks: { type: 'number', description: 'Maximum number of tasks to generate (default 20).' },
327
+ },
328
+ required: ['description'],
329
+ },
330
+ },
331
+ // ── Review & Security ────────────────────────────────────────────────────────
332
+ {
333
+ name: 'veto_code_review',
334
+ description: 'Runs the Code Reviewer agent on provided code. Returns scored findings (complexity, error handling, magic numbers, nesting, dead code) with severity and fixes. Pass file_path to surface findings as VS Code inline diagnostics (squiggles).',
335
+ inputSchema: {
336
+ type: 'object',
337
+ properties: {
338
+ code: { type: 'string', description: 'The code to review.' },
339
+ context: { type: 'string', description: 'Optional: file name, module description, or review focus.' },
340
+ file_path: { type: 'string', description: 'Optional: absolute path to the file being reviewed. When provided, findings are stored as VS Code inline diagnostics.' },
341
+ },
342
+ required: ['code'],
343
+ },
344
+ },
345
+ {
346
+ name: 'veto_diff_review',
347
+ description: 'Reviews a git diff — runs code review, security scan, and secrets scan in parallel across all changed files. Returns a structured verdict (pass/warn/fail), per-file findings, and a CI-ready summary. Pass diff directly or let Veto read it from project_dir automatically.',
348
+ inputSchema: {
349
+ type: 'object',
350
+ properties: {
351
+ diff: { type: 'string', description: 'The git diff to review. If omitted, Veto runs git diff HEAD in project_dir.' },
352
+ project_dir: { type: 'string', description: 'Absolute project path. Used to auto-read git diff if diff is not provided, and to inject codebase context.' },
353
+ context: { type: 'string', description: 'Optional: PR description, ticket number, or focus area.' },
354
+ },
355
+ required: [],
356
+ },
357
+ },
358
+ {
359
+ name: 'veto_security_scan',
360
+ description: 'Runs the Security Scanner (OWASP Top 10) on provided code. Returns vulnerabilities with severity, CWE/OWASP category, and remediation steps. Pass file_path to surface findings as VS Code inline diagnostics.',
361
+ inputSchema: {
362
+ type: 'object',
363
+ properties: {
364
+ code: { type: 'string', description: 'The code to scan.' },
365
+ context: { type: 'string', description: 'Optional: language, framework, or specific concerns.' },
366
+ file_path: { type: 'string', description: 'Optional: absolute path to the file being scanned. When provided, findings are stored as VS Code inline diagnostics.' },
367
+ },
368
+ required: ['code'],
369
+ },
370
+ },
371
+ {
372
+ name: 'veto_secrets_scan',
373
+ description: 'Scans text or code for exposed credentials — API keys, tokens, passwords, connection strings, private keys. Returns findings with masked values and line numbers. Pass file_path to surface findings as VS Code inline diagnostics.',
374
+ inputSchema: {
375
+ type: 'object',
376
+ properties: {
377
+ text: { type: 'string', description: 'The text or code to scan for secrets.' },
378
+ file_path: { type: 'string', description: 'Optional: absolute path to the file being scanned. When provided, findings are stored as VS Code inline diagnostics.' },
379
+ },
380
+ required: ['text'],
381
+ },
382
+ },
383
+ {
384
+ name: 'veto_pr_review',
385
+ description: 'Fetches a GitHub PR diff and runs the full Veto triple-scan (code review + security + secrets). Returns a structured verdict and ready-to-post GitHub review comments. Set GITHUB_TOKEN env var for private repos.',
386
+ inputSchema: {
387
+ type: 'object',
388
+ properties: {
389
+ pr_url: { type: 'string', description: 'Full GitHub PR URL. e.g. https://github.com/owner/repo/pull/123' },
390
+ context: { type: 'string', description: 'Optional: PR description or ticket number for extra context.' },
391
+ fail_on: { type: 'string', enum: ['warn', 'fail'], description: 'Whether WARN counts as a failure. Default: "fail".' },
392
+ },
393
+ required: ['pr_url'],
394
+ },
395
+ },
396
+ // ── Memory & Knowledge ───────────────────────────────────────────────────────
397
+ {
398
+ name: 'veto_memory_store',
399
+ description: 'Stores a knowledge entry (solution, pattern, error, reference, or decision) in the local knowledge base for retrieval across sessions. Search before storing to avoid duplicates.',
400
+ inputSchema: {
401
+ type: 'object',
402
+ properties: {
403
+ title: { type: 'string', description: 'Precise, searchable title. Bad: "Fixed bug". Good: "Fix: Node sqlite fails on Windows without --experimental-sqlite".' },
404
+ content: { type: 'string', description: 'Self-contained content: problem → root cause → solution. Future agents must understand it without original context.' },
405
+ type: {
406
+ type: 'string',
407
+ description: 'Entry type.',
408
+ enum: ['solution', 'pattern', 'context', 'error', 'reference', 'decision'],
409
+ },
410
+ tags: { type: 'array', items: { type: 'string' }, description: 'Search tags (3–5 recommended). Examples: ["typescript", "auth", "jwt"].' },
411
+ project_dir: { type: 'string', description: 'Absolute project path. Include for project-specific knowledge; omit for general programming knowledge.' },
412
+ session_id: { type: 'string', description: 'Optional: associate this knowledge entry with an active session.' },
413
+ relevance: { type: 'number', description: 'Initial relevance score 0.0–1.0 (default 1.0).' },
414
+ },
415
+ required: ['title', 'content'],
416
+ },
417
+ },
418
+ {
419
+ name: 'veto_memory_search',
420
+ description: 'Searches the local knowledge base for entries matching a query. Call at the start of every task to find prior solutions before solving from scratch.',
421
+ inputSchema: {
422
+ type: 'object',
423
+ properties: {
424
+ query: { type: 'string', description: 'Search terms (full-text search on title and content).' },
425
+ type: {
426
+ type: 'string',
427
+ description: 'Filter by entry type.',
428
+ enum: ['solution', 'pattern', 'context', 'error', 'reference', 'decision'],
429
+ },
430
+ project_dir: { type: 'string', description: 'Filter to a specific project directory.' },
431
+ limit: { type: 'number', description: 'Max results to return (default 10, max 50).' },
432
+ },
433
+ required: [],
434
+ },
435
+ },
436
+ {
437
+ name: 'veto_memory_delete',
438
+ description: 'Deletes a knowledge entry by ID. Use to remove stale or duplicate entries found via veto_memory_search.',
439
+ inputSchema: {
440
+ type: 'object',
441
+ properties: {
442
+ id: { type: 'string', description: 'The knowledge entry ID (from veto_memory_search results).' },
443
+ },
444
+ required: ['id'],
445
+ },
446
+ },
447
+ {
448
+ name: 'veto_memory_export',
449
+ description: 'Exports all local memory (sessions, knowledge, patterns, decisions, project maps) to a portable JSON file. Copy the file to another machine and run veto_memory_import there to resume work. No external services required.',
450
+ inputSchema: {
451
+ type: 'object',
452
+ properties: {
453
+ output_path: {
454
+ type: 'string',
455
+ description: 'Where to write the export file. Defaults to ~/.veto/veto-export.json. Use a path on shared storage (Dropbox, OneDrive, USB) to make transfer easy.',
456
+ },
457
+ },
458
+ required: [],
459
+ },
460
+ },
461
+ {
462
+ name: 'veto_memory_import',
463
+ description: 'Imports memory from a JSON file exported by veto_memory_export on another machine. Merges into local SQLite using INSERT OR IGNORE — existing local rows are never overwritten. Call veto_sessions_list after import to confirm sessions arrived.',
464
+ inputSchema: {
465
+ type: 'object',
466
+ properties: {
467
+ input_path: {
468
+ type: 'string',
469
+ description: 'Path to the export JSON file. Defaults to ~/.veto/veto-export.json.',
470
+ },
471
+ },
472
+ required: [],
473
+ },
474
+ },
475
+ // ── Patterns ─────────────────────────────────────────────────────────────────
476
+ {
477
+ name: 'veto_pattern_store',
478
+ description: 'Stores or updates a coding pattern observed in the codebase. Patterns are keyed by category.pattern-name and confidence increases with repeated observation.',
479
+ inputSchema: {
480
+ type: 'object',
481
+ properties: {
482
+ pattern_key: { type: 'string', description: 'Pattern identifier in category.pattern-name format. Example: "code.async-pattern" or "naming.variable-case".' },
483
+ pattern_val: { type: 'string', description: 'The observed pattern value. Example: "async/await with try/catch, no raw Promise chains".' },
484
+ confidence: { type: 'number', description: 'Confidence score 0.0–1.0 (default 1.0). Increases automatically on repeated observation.' },
485
+ },
486
+ required: ['pattern_key', 'pattern_val'],
487
+ },
488
+ },
489
+ {
490
+ name: 'veto_patterns_list',
491
+ description: 'Returns stored coding patterns. Filter by prefix to get patterns in a specific category (e.g. prefix="naming." for all naming conventions).',
492
+ inputSchema: {
493
+ type: 'object',
494
+ properties: {
495
+ prefix: { type: 'string', description: 'Optional prefix filter. Example: "code." or "naming." or "testing.".' },
496
+ limit: { type: 'number', description: 'Max patterns to return (default 20).' },
497
+ },
498
+ required: [],
499
+ },
500
+ },
501
+ // ── Learning ──────────────────────────────────────────────────────────────────
502
+ {
503
+ name: 'veto_record_outcome',
504
+ description: 'Records a task outcome (quality score) to feed the self-learning router. Call after completing any task. After 20+ outcomes, call veto_learning_apply to update tier thresholds.',
505
+ inputSchema: {
506
+ type: 'object',
507
+ properties: {
508
+ task_type: { type: 'string', description: 'Short consistent label for the task category (e.g. "write-unit-tests", "fix-auth-bug"). Use the same label for similar tasks to enable pattern detection.' },
509
+ complexity: { type: 'number', description: 'The complexity score from veto_route_task (0–100).' },
510
+ model_tier: { type: 'number', description: 'The tier that was actually used (1, 2, or 3).', enum: [1, 2, 3] },
511
+ output_quality: { type: 'number', description: 'Output quality score 0–100. 90–100=excellent, 70–89=good, 50–69=acceptable, 30–49=poor, 0–29=failed.' },
512
+ agent: { type: 'string', description: 'The worker agent type used (optional but useful for agent performance tracking).' },
513
+ tokens_used: { type: 'number', description: 'Approximate tokens used (optional).' },
514
+ file_ext: { type: 'string', description: 'File extension of the primary file worked on (e.g. ".ts", ".sql", ".tsx"). Enables predictive agent routing — next time you work on the same extension, veto_route_task will recommend the best agent.' },
515
+ },
516
+ required: ['task_type', 'complexity', 'model_tier', 'output_quality'],
517
+ },
518
+ },
519
+ {
520
+ name: 'veto_learning_stats',
521
+ description: 'Returns the self-learning router dashboard: tier distribution, per-agent quality stats, suggested threshold adjustments, and council insights. Use to understand how the router is performing and where to improve.',
522
+ inputSchema: {
523
+ type: 'object',
524
+ properties: {
525
+ include_agent_stats: { type: 'boolean', description: 'Include per-agent quality breakdown (default true).' },
526
+ include_task_types: { type: 'boolean', description: 'Include per-task-type breakdown (default false, verbose).' },
527
+ include_council_insights: { type: 'boolean', description: 'Include council decision → debugging correlation (default false).' },
528
+ },
529
+ required: [],
530
+ },
531
+ },
532
+ {
533
+ name: 'veto_learning_apply',
534
+ description: 'Applies learned tier thresholds to the router based on recorded task outcomes. Requires at least 20 recorded outcomes. The router immediately uses the new thresholds on the next veto_route_task call.',
535
+ inputSchema: {
536
+ type: 'object',
537
+ properties: {},
538
+ required: [],
539
+ },
540
+ },
541
+ // ── Project & Discovery ───────────────────────────────────────────────────────
542
+ {
543
+ name: 'veto_project_map_update',
544
+ description: 'Updates the project structure map for a directory. Call after creating, deleting, or moving files. The map enables fast codebase navigation without filesystem scans.',
545
+ inputSchema: {
546
+ type: 'object',
547
+ properties: {
548
+ project_dir: { type: 'string', description: 'Absolute path to the project root.' },
549
+ structure: { type: 'string', description: 'JSON string representing the directory tree. Example: {"src/":{"agents/":["coder.ts","reviewer.ts"],"router/":["index.ts"]}}' },
550
+ key_modules: {
551
+ type: 'array',
552
+ items: { type: 'string' },
553
+ description: 'The 10–20 most important files with their roles. Example: ["src/server.ts (MCP entry point)", "src/router/index.ts (task router)"].',
554
+ },
555
+ tech_stack: {
556
+ type: 'array',
557
+ items: { type: 'string' },
558
+ description: 'Frameworks and key libraries. Example: ["TypeScript", "Node.js 22", "Express", "SQLite"].',
559
+ },
560
+ },
561
+ required: ['project_dir', 'structure'],
562
+ },
563
+ },
564
+ {
565
+ name: 'veto_project_map_get',
566
+ description: 'Returns the stored project structure map for a directory. Use to navigate the codebase without scanning the filesystem.',
567
+ inputSchema: {
568
+ type: 'object',
569
+ properties: {
570
+ project_dir: { type: 'string', description: 'Absolute path to the project root.' },
571
+ },
572
+ required: ['project_dir'],
573
+ },
574
+ },
575
+ {
576
+ name: 'veto_discover',
577
+ description: 'Scans a project directory and builds a rich context map: git state, tech stack, file structure, dependencies, and key config files. Stores the result in Veto memory so agents always have accurate project context. Call this once per project or after major structural changes.',
578
+ inputSchema: {
579
+ type: 'object',
580
+ properties: {
581
+ project_dir: { type: 'string', description: 'Absolute path to the project directory to scan.' },
582
+ depth: { type: 'string', enum: ['quick', 'standard', 'full'], description: 'Scan depth. quick: git + package metadata only. standard: + file tree up to 3 levels (default). full: + contents of key config files.' },
583
+ store: { type: 'boolean', description: 'Whether to store the discovery in Veto memory as a project map. Default: true.' },
584
+ },
585
+ required: ['project_dir'],
586
+ },
587
+ },
588
+ {
589
+ name: 'veto_context_status',
590
+ description: 'Returns the context window usage for a saved session — tokens used, % of platform limit consumed, and whether to compress or hand off before the window fills.',
591
+ inputSchema: {
592
+ type: 'object',
593
+ properties: {
594
+ session_id: { type: 'string', description: 'Session ID to check.' },
595
+ },
596
+ required: ['session_id'],
597
+ },
598
+ },
599
+ // ── Workflow & CI ─────────────────────────────────────────────────────────────
600
+ {
601
+ name: 'veto_workflow',
602
+ description: 'Runs a sequential agent pipeline with optional pass/fail gates between steps. Each step runs a worker agent; if a gate score is set and the step confidence falls below it, the pipeline stops. Returns per-step results plus an overall verdict (passed/partial/failed).',
603
+ inputSchema: {
604
+ type: 'object',
605
+ properties: {
606
+ steps: {
607
+ type: 'array',
608
+ description: 'Ordered pipeline steps.',
609
+ items: {
610
+ type: 'object',
611
+ properties: {
612
+ id: { type: 'string', description: 'Step identifier.' },
613
+ agent: { type: 'string', description: 'Worker agent type.' },
614
+ task: { type: 'string', description: 'Task description for this step.' },
615
+ code: { type: 'string', description: 'Optional code to analyze.' },
616
+ context: { type: 'string', description: 'Optional context.' },
617
+ gate: { type: 'number', description: 'Optional minimum confidence % (0–100) required to proceed to the next step.' },
618
+ },
619
+ required: ['id', 'agent', 'task'],
620
+ },
621
+ },
622
+ project_dir: { type: 'string', description: 'Optional project directory — auto-injects codebase context into all steps.' },
623
+ },
624
+ required: ['steps'],
625
+ },
626
+ },
627
+ {
628
+ name: 'veto_watch',
629
+ description: 'Starts a file watcher on a project directory. Returns a watch_id. Call veto_watch_poll to collect file-change events with recommended agents. Call veto_watch_stop when done.',
630
+ inputSchema: {
631
+ type: 'object',
632
+ properties: {
633
+ project_dir: { type: 'string', description: 'Absolute path to the project directory to watch.' },
634
+ },
635
+ required: ['project_dir'],
636
+ },
637
+ },
638
+ {
639
+ name: 'veto_watch_poll',
640
+ description: 'Polls for file-change events from an active watcher. Returns accumulated events since last poll (events are cleared on read). Each event includes the file, recommended agent, and suggested veto tool to call.',
641
+ inputSchema: {
642
+ type: 'object',
643
+ properties: {
644
+ watch_id: { type: 'string', description: 'The watch_id returned by veto_watch.' },
645
+ },
646
+ required: ['watch_id'],
647
+ },
648
+ },
649
+ {
650
+ name: 'veto_watch_stop',
651
+ description: 'Stops an active file watcher.',
652
+ inputSchema: {
653
+ type: 'object',
654
+ properties: {
655
+ watch_id: { type: 'string', description: 'The watch_id returned by veto_watch.' },
656
+ },
657
+ required: ['watch_id'],
658
+ },
659
+ },
660
+ {
661
+ name: 'veto_ci_gate',
662
+ description: 'CI/CD pipeline gate. Runs code review + security scan + secrets scan on a git diff and returns a structured pass/warn/fail verdict with exit code. Ready for GitHub Actions and GitLab CI.',
663
+ inputSchema: {
664
+ type: 'object',
665
+ properties: {
666
+ project_dir: { type: 'string', description: 'Absolute project path. Veto reads git diff HEAD automatically.' },
667
+ diff: { type: 'string', description: 'Optional: pass a diff string directly instead of reading from project_dir.' },
668
+ context: { type: 'string', description: 'Optional: PR description or ticket number for context.' },
669
+ fail_on: { type: 'string', enum: ['warn', 'fail'], description: 'Whether WARN counts as a failure (exit code 1). Default: "fail" — only FAIL exits non-zero.' },
670
+ },
671
+ required: ['project_dir'],
672
+ },
673
+ },
674
+ // ── Observability ─────────────────────────────────────────────────────────────
675
+ {
676
+ name: 'veto_usage_status',
677
+ description: 'Live AI usage dashboard. Shows tokens consumed today, requests per platform, subscription vs API usage split, 7-day history, and warnings when approaching limits.',
678
+ inputSchema: {
679
+ type: 'object',
680
+ properties: {},
681
+ required: [],
682
+ },
683
+ },
684
+ {
685
+ name: 'veto_audit_log',
686
+ description: 'Queryable log of every council verdict, decision, and session event. Filter by session, agent, verdict, or date. Essential for tracing what happened and why.',
687
+ inputSchema: {
688
+ type: 'object',
689
+ properties: {
690
+ session_id: { type: 'string', description: 'Filter to a specific session.' },
691
+ verdict: { type: 'string', description: 'Filter by council verdict (GREEN, YELLOW, RED).' },
692
+ since: { type: 'string', description: 'ISO date — only return events after this time.' },
693
+ limit: { type: 'number', description: 'Max events to return (default 20, max 100).' },
694
+ },
695
+ required: [],
696
+ },
697
+ },
698
+ // ── Developer Tools ───────────────────────────────────────────────────────────
699
+ {
700
+ name: 'veto_platform_setup',
701
+ description: 'Returns the exact MCP config and setup steps to connect a specific AI platform to this Veto server.',
702
+ inputSchema: {
703
+ type: 'object',
704
+ properties: {
705
+ platform: { type: 'string', enum: ['claude', 'gemini', 'codex'], description: 'The platform to get setup instructions for.' },
706
+ veto_server_path: { type: 'string', description: 'Absolute path to the built veto server (dist/server.js).' },
707
+ },
708
+ required: ['platform', 'veto_server_path'],
709
+ },
710
+ },
711
+ {
712
+ name: 'veto_plugins',
713
+ description: 'Lists all custom agents loaded from ~/.veto/agents/. Drop a .js file there that exports plan(task, context?) to register a new agent available in veto_agent_plan and veto_execute_parallel.',
714
+ inputSchema: {
715
+ type: 'object',
716
+ properties: {},
717
+ required: [],
718
+ },
719
+ },
720
+ {
721
+ name: 'veto_docs_fetch',
722
+ description: 'Fetches current, version-accurate documentation for any npm, PyPI, or crates.io package and returns it for injection into agent context. Eliminates hallucinated APIs. Results are cached for 24 hours.',
723
+ inputSchema: {
724
+ type: 'object',
725
+ properties: {
726
+ package_name: { type: 'string', description: 'Package name (e.g. "react", "requests", "serde").' },
727
+ ecosystem: { type: 'string', enum: ['npm', 'pypi', 'crates'], description: 'Package ecosystem.' },
728
+ version: { type: 'string', description: 'Specific version. Defaults to latest.' },
729
+ max_chars: { type: 'number', description: 'Max characters to return (default 8000). Higher = more complete docs, more tokens.' },
730
+ },
731
+ required: ['package_name', 'ecosystem'],
732
+ },
733
+ },
734
+ {
735
+ name: 'veto_explain',
736
+ description: 'Explains a file or raw text using the most appropriate expert agent. Pass file_path to explain a source file, or text to explain an error message, stack trace, or compiler output. Agent is auto-detected from file extension or content.',
737
+ inputSchema: {
738
+ type: 'object',
739
+ properties: {
740
+ file_path: { type: 'string', description: 'Absolute path to the file to explain.' },
741
+ text: { type: 'string', description: 'Raw text to explain — error messages, stack traces, compiler output, or any code snippet. Automatically routes to debugger agent for error-like content.' },
742
+ depth: { type: 'string', enum: ['overview', 'detailed', 'line-by-line'], description: 'Explanation depth. Default: overview.' },
743
+ context: { type: 'string', description: 'Optional focus area or context.' },
744
+ },
745
+ required: [],
746
+ },
747
+ },
748
+ {
749
+ name: 'veto_summarize',
750
+ description: 'Generates a concise expert briefing of a project, directory, or file. Use at the start of a session to orient yourself on unfamiliar code. Returns bullet-point summary, key components, tech stack, and entry points. Faster and higher-level than veto_explain.',
751
+ inputSchema: {
752
+ type: 'object',
753
+ properties: {
754
+ project_dir: { type: 'string', description: 'Absolute path to a project directory to summarize.' },
755
+ file_path: { type: 'string', description: 'Absolute path to a single file to summarize. If both project_dir and file_path are given, file_path takes precedence.' },
756
+ focus: { type: 'string', description: 'Optional focus area: e.g. "security", "APIs", "data flow", "architecture". Narrows the summary.' },
757
+ format: { type: 'string', enum: ['brief', 'detailed'], description: 'brief: 4–6 bullet points (default). detailed: paragraph-level prose.' },
758
+ },
759
+ required: [],
760
+ },
761
+ },
762
+ // ── Part 4: New Tools ────────────────────────────────────────────────────────
763
+ {
764
+ name: 'veto_metrics',
765
+ description: 'Returns a usage dashboard for the current Veto installation — sessions saved, council debates, quality trend, most-used agents, and knowledge base stats. Zero cost: pure SQLite reads. Great for a weekly health check.',
766
+ inputSchema: {
767
+ type: 'object',
768
+ properties: {},
769
+ required: [],
770
+ },
771
+ },
772
+ {
773
+ name: 'veto_git_blame',
774
+ description: 'Returns ownership and contribution history for a file or directory — total commits, contributor list with commit counts, and last-modified metadata. Uses local git history: instant, zero network.',
775
+ inputSchema: {
776
+ type: 'object',
777
+ properties: {
778
+ project_dir: { type: 'string', description: 'Absolute path to a project directory to analyse.' },
779
+ file_path: { type: 'string', description: 'Absolute path to a single file. If both are provided, file_path takes precedence.' },
780
+ },
781
+ required: [],
782
+ },
783
+ },
784
+ {
785
+ name: 'veto_changelog',
786
+ description: 'Generates a structured changelog from git commits since the last tag, grouped by conventional commit type (feat, fix, refactor, etc.). Pure local git — no external calls.',
787
+ inputSchema: {
788
+ type: 'object',
789
+ properties: {
790
+ project_dir: { type: 'string', description: 'Absolute path to the project directory. Defaults to the active project.' },
791
+ max_entries: { type: 'number', description: 'Maximum commits to include (default 50, max 200).' },
792
+ },
793
+ required: [],
794
+ },
795
+ },
796
+ ];
797
+ //# sourceMappingURL=definitions.js.map