@jigyasudham/veto 1.4.4 → 2.0.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 (91) hide show
  1. package/AGENTS.md +134 -0
  2. package/README.md +26 -144
  3. package/dist/adapters/index.d.ts +3 -2
  4. package/dist/adapters/index.d.ts.map +1 -1
  5. package/dist/adapters/index.js +105 -1
  6. package/dist/adapters/index.js.map +1 -1
  7. package/dist/agents/executor.d.ts +2 -0
  8. package/dist/agents/executor.d.ts.map +1 -1
  9. package/dist/agents/executor.js +50 -3
  10. package/dist/agents/executor.js.map +1 -1
  11. package/dist/agents/llm-runner.d.ts +11 -0
  12. package/dist/agents/llm-runner.d.ts.map +1 -0
  13. package/dist/agents/llm-runner.js +252 -0
  14. package/dist/agents/llm-runner.js.map +1 -0
  15. package/dist/agents/local-llm.d.ts +14 -0
  16. package/dist/agents/local-llm.d.ts.map +1 -0
  17. package/dist/agents/local-llm.js +51 -0
  18. package/dist/agents/local-llm.js.map +1 -0
  19. package/dist/agents/manifest.d.ts +13 -0
  20. package/dist/agents/manifest.d.ts.map +1 -0
  21. package/dist/agents/manifest.js +55 -0
  22. package/dist/agents/manifest.js.map +1 -0
  23. package/dist/agents/quality/clone-detector.d.ts +16 -0
  24. package/dist/agents/quality/clone-detector.d.ts.map +1 -0
  25. package/dist/agents/quality/clone-detector.js +72 -0
  26. package/dist/agents/quality/clone-detector.js.map +1 -0
  27. package/dist/agents/types.d.ts +15 -0
  28. package/dist/agents/types.d.ts.map +1 -1
  29. package/dist/agents/validate.d.ts +11 -0
  30. package/dist/agents/validate.d.ts.map +1 -0
  31. package/dist/agents/validate.js +54 -0
  32. package/dist/agents/validate.js.map +1 -0
  33. package/dist/cli.js +331 -21
  34. package/dist/cli.js.map +1 -1
  35. package/dist/council/llm-council.d.ts.map +1 -1
  36. package/dist/council/llm-council.js +10 -9
  37. package/dist/council/llm-council.js.map +1 -1
  38. package/dist/council/types.d.ts +2 -0
  39. package/dist/council/types.d.ts.map +1 -1
  40. package/dist/memory/local.d.ts +12 -1
  41. package/dist/memory/local.d.ts.map +1 -1
  42. package/dist/memory/local.js +56 -2
  43. package/dist/memory/local.js.map +1 -1
  44. package/dist/memory/schema.d.ts +28 -43
  45. package/dist/memory/schema.d.ts.map +1 -1
  46. package/dist/memory/schema.js +31 -0
  47. package/dist/memory/schema.js.map +1 -1
  48. package/dist/memory/sync.d.ts +13 -0
  49. package/dist/memory/sync.d.ts.map +1 -1
  50. package/dist/memory/sync.js +113 -0
  51. package/dist/memory/sync.js.map +1 -1
  52. package/dist/repo-map/ignore.d.ts +8 -0
  53. package/dist/repo-map/ignore.d.ts.map +1 -0
  54. package/dist/repo-map/ignore.js +65 -0
  55. package/dist/repo-map/ignore.js.map +1 -0
  56. package/dist/repo-map/index.d.ts +29 -0
  57. package/dist/repo-map/index.d.ts.map +1 -0
  58. package/dist/repo-map/index.js +240 -0
  59. package/dist/repo-map/index.js.map +1 -0
  60. package/dist/router/context-compressor.d.ts +1 -1
  61. package/dist/router/context-compressor.d.ts.map +1 -1
  62. package/dist/router/context-compressor.js +9 -3
  63. package/dist/router/context-compressor.js.map +1 -1
  64. package/dist/router/index.d.ts +8 -3
  65. package/dist/router/index.d.ts.map +1 -1
  66. package/dist/router/index.js +20 -4
  67. package/dist/router/index.js.map +1 -1
  68. package/dist/router/learning-updater.d.ts +41 -0
  69. package/dist/router/learning-updater.d.ts.map +1 -1
  70. package/dist/router/learning-updater.js +62 -0
  71. package/dist/router/learning-updater.js.map +1 -1
  72. package/dist/router/model-selector.d.ts +4 -1
  73. package/dist/router/model-selector.d.ts.map +1 -1
  74. package/dist/router/model-selector.js +24 -28
  75. package/dist/router/model-selector.js.map +1 -1
  76. package/dist/server.js +3121 -1655
  77. package/dist/server.js.map +1 -1
  78. package/dist/tools/definitions.d.ts +1205 -171
  79. package/dist/tools/definitions.d.ts.map +1 -1
  80. package/dist/tools/definitions.js +678 -4
  81. package/dist/tools/definitions.js.map +1 -1
  82. package/dist/watcher/index.d.ts +1 -0
  83. package/dist/watcher/index.d.ts.map +1 -1
  84. package/dist/watcher/index.js +7 -6
  85. package/dist/watcher/index.js.map +1 -1
  86. package/dist/workflow/pipeline.d.ts +12 -2
  87. package/dist/workflow/pipeline.d.ts.map +1 -1
  88. package/dist/workflow/pipeline.js +395 -16
  89. package/dist/workflow/pipeline.js.map +1 -1
  90. package/p7.ts +6 -0
  91. package/package.json +8 -4
@@ -222,6 +222,14 @@ export const TOOL_DEFINITIONS = [
222
222
  enum: ['fast', 'standard', 'strict'],
223
223
  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.',
224
224
  },
225
+ architect_model: {
226
+ type: 'string',
227
+ description: 'Optional: override model used for the architecture/planning phase (e.g. claude-3-7-sonnet).',
228
+ },
229
+ editor_model: {
230
+ type: 'string',
231
+ description: 'Optional: override model used for the editing/execution phase (e.g. claude-3-5-haiku).',
232
+ },
225
233
  },
226
234
  required: ['task'],
227
235
  },
@@ -290,6 +298,10 @@ export const TOOL_DEFINITIONS = [
290
298
  inputSchema: {
291
299
  type: 'object',
292
300
  properties: {
301
+ agent_response: {
302
+ type: 'object',
303
+ description: 'Phase 2 response from the host AI (JSON). Pass this back when prompted by the server to complete the agentic loop.',
304
+ },
293
305
  agent: {
294
306
  type: 'string',
295
307
  description: 'The worker agent to consult.',
@@ -297,7 +309,14 @@ export const TOOL_DEFINITIONS = [
297
309
  },
298
310
  task: { type: 'string', description: 'The task for the agent to plan.' },
299
311
  context: { type: 'string', description: 'Optional additional context.' },
300
- 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.' },
312
+ project_dir: {
313
+ type: 'string',
314
+ description: 'Optional: absolute path to the project directory. Auto-injects package.json, git diff, and stack info into the agent context.',
315
+ },
316
+ llm_backed: {
317
+ type: 'boolean',
318
+ description: 'If true, routes the task through the LLM runner for deep reasoning instead of using the deterministic pattern engine.',
319
+ },
301
320
  },
302
321
  required: ['agent', 'task'],
303
322
  },
@@ -329,6 +348,22 @@ export const TOOL_DEFINITIONS = [
329
348
  type: 'number',
330
349
  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.',
331
350
  },
351
+ architect_model: {
352
+ type: 'string',
353
+ description: 'Optional: override model used for the architecture/planning phase (e.g. claude-3-7-sonnet).',
354
+ },
355
+ editor_model: {
356
+ type: 'string',
357
+ description: 'Optional: override model used for the editing/execution phase (e.g. claude-3-5-haiku).',
358
+ },
359
+ llm_backed: {
360
+ type: 'boolean',
361
+ description: 'If true, uses the agentic loop to run these agents via the host AI. Required for Phase 2 LLM-backed reasoning.',
362
+ },
363
+ agent_outputs: {
364
+ type: 'object',
365
+ description: 'Phase 2 responses from the host AI (JSON). Pass this back when prompted by the server to complete the agentic loop.',
366
+ },
332
367
  },
333
368
  required: ['tasks'],
334
369
  },
@@ -339,6 +374,7 @@ export const TOOL_DEFINITIONS = [
339
374
  inputSchema: {
340
375
  type: 'object',
341
376
  properties: {
377
+ agent_responses: { type: 'object', description: 'Phase 2 responses for council and agents.' },
342
378
  description: { type: 'string', description: 'Project description, PRD, or feature brief to parse into tasks.' },
343
379
  project_dir: { type: 'string', description: 'Optional project directory for codebase context injection.' },
344
380
  max_tasks: { type: 'number', description: 'Maximum number of tasks to generate (default 20).' },
@@ -353,6 +389,10 @@ export const TOOL_DEFINITIONS = [
353
389
  inputSchema: {
354
390
  type: 'object',
355
391
  properties: {
392
+ agent_response: {
393
+ type: 'object',
394
+ description: 'Phase 2 response from the host AI (JSON). Pass this back when prompted by the server to complete the agentic loop.',
395
+ },
356
396
  code: { type: 'string', description: 'The code to review.' },
357
397
  context: { type: 'string', description: 'Optional: file name, module description, or review focus.' },
358
398
  file_path: { type: 'string', description: 'Optional: absolute path to the file being reviewed. When provided, findings are stored as VS Code inline diagnostics.' },
@@ -366,6 +406,14 @@ export const TOOL_DEFINITIONS = [
366
406
  inputSchema: {
367
407
  type: 'object',
368
408
  properties: {
409
+ agent_outputs: {
410
+ type: 'object',
411
+ description: 'Phase 2 responses from the host AI (JSON). Pass this back when prompted by the server to complete the agentic loop.',
412
+ },
413
+ agent_response: {
414
+ type: 'object',
415
+ description: 'Phase 2 response from the host AI (JSON). Pass this back when prompted by the server to complete the agentic loop.',
416
+ },
369
417
  diff: { type: 'string', description: 'The git diff to review. If omitted, Veto runs git diff HEAD in project_dir.' },
370
418
  project_dir: { type: 'string', description: 'Absolute project path. Used to auto-read git diff if diff is not provided, and to inject codebase context.' },
371
419
  context: { type: 'string', description: 'Optional: PR description, ticket number, or focus area.' },
@@ -379,6 +427,10 @@ export const TOOL_DEFINITIONS = [
379
427
  inputSchema: {
380
428
  type: 'object',
381
429
  properties: {
430
+ agent_response: {
431
+ type: 'object',
432
+ description: 'Phase 2 response from the host AI (JSON). Pass this back when prompted by the server to complete the agentic loop.',
433
+ },
382
434
  code: { type: 'string', description: 'The code to scan.' },
383
435
  context: { type: 'string', description: 'Optional: language, framework, or specific concerns.' },
384
436
  file_path: { type: 'string', description: 'Optional: absolute path to the file being scanned. When provided, findings are stored as VS Code inline diagnostics.' },
@@ -392,6 +444,10 @@ export const TOOL_DEFINITIONS = [
392
444
  inputSchema: {
393
445
  type: 'object',
394
446
  properties: {
447
+ agent_response: {
448
+ type: 'object',
449
+ description: 'Phase 2 response from the host AI (JSON). Pass this back when prompted by the server to complete the agentic loop.',
450
+ },
395
451
  text: { type: 'string', description: 'The text or code to scan for secrets.' },
396
452
  file_path: { type: 'string', description: 'Optional: absolute path to the file being scanned. When provided, findings are stored as VS Code inline diagnostics.' },
397
453
  },
@@ -404,6 +460,10 @@ export const TOOL_DEFINITIONS = [
404
460
  inputSchema: {
405
461
  type: 'object',
406
462
  properties: {
463
+ agent_outputs: {
464
+ type: 'object',
465
+ description: 'Phase 2 responses from the host AI (JSON). Pass this back when prompted by the server to complete the agentic loop.',
466
+ },
407
467
  pr_url: { type: 'string', description: 'Full GitHub PR URL. e.g. https://github.com/owner/repo/pull/123' },
408
468
  context: { type: 'string', description: 'Optional: PR description or ticket number for extra context.' },
409
469
  fail_on: { type: 'string', enum: ['warn', 'fail'], description: 'Whether WARN counts as a failure. Default: "fail".' },
@@ -464,13 +524,18 @@ export const TOOL_DEFINITIONS = [
464
524
  },
465
525
  {
466
526
  name: 'veto_memory_export',
467
- 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.',
527
+ description: 'Exports all local memory (sessions, knowledge, patterns, decisions, project maps) to a portable JSON or Markdown file. Use markdown for a human-readable VETO_MEMORY.md file.',
468
528
  inputSchema: {
469
529
  type: 'object',
470
530
  properties: {
471
531
  output_path: {
472
532
  type: 'string',
473
- 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.',
533
+ description: 'Where to write the export file. Defaults to ~/.veto/veto-export.json or VETO_MEMORY.md in the project root.',
534
+ },
535
+ format: {
536
+ type: 'string',
537
+ enum: ['json', 'markdown'],
538
+ description: 'Export format: "json" for backup/transfer, "markdown" for human-readable documentation.',
474
539
  },
475
540
  },
476
541
  required: [],
@@ -614,6 +679,417 @@ export const TOOL_DEFINITIONS = [
614
679
  required: ['session_id'],
615
680
  },
616
681
  },
682
+ // ── Named Pipelines — curated multi-tool compositions (Phase 4.2) ─────────────
683
+ {
684
+ name: 'veto_full_review',
685
+ description: 'Full pre-ship review: runs code review + security scan + secrets scan + quality analysis in parallel, then returns a combined verdict (pass/warn/fail). Use before any merge or deploy when you want richer output than veto_diff_review alone.',
686
+ inputSchema: {
687
+ type: 'object',
688
+ properties: {
689
+ agent_outputs: {
690
+ type: 'object',
691
+ description: 'Phase 2 responses from the host AI (JSON). Pass this back when prompted by the server to complete the agentic loop.',
692
+ },
693
+ project_dir: { type: 'string', description: 'Absolute path to project. Reads git diff HEAD automatically.' },
694
+ diff: { type: 'string', description: 'Optional: pass a diff string directly instead of reading from project_dir.' },
695
+ context: { type: 'string', description: 'Optional: PR description or review context.' },
696
+ },
697
+ required: [],
698
+ },
699
+ },
700
+ {
701
+ name: 'veto_pre_commit',
702
+ description: 'Pre-commit gate: runs secrets scan (hard block on any finding) + code review in parallel on staged changes. Faster than veto_full_review — tuned for commit-time validation. Returns a blocked/warn/pass verdict.',
703
+ inputSchema: {
704
+ type: 'object',
705
+ properties: {
706
+ agent_outputs: {
707
+ type: 'object',
708
+ description: 'Phase 2 responses from the host AI (JSON). Pass this back when prompted by the server to complete the agentic loop.',
709
+ },
710
+ project_dir: { type: 'string', description: 'Absolute path to project. Reads staged changes (git diff --cached) automatically.' },
711
+ context: { type: 'string', description: 'Optional: branch name or additional context.' },
712
+ },
713
+ required: ['project_dir'],
714
+ },
715
+ },
716
+ {
717
+ name: 'veto_new_feature',
718
+ description: 'New feature planning pipeline: council governance → execution plan → task DAG, in sequence. Collapses 3 manual tool calls into 1. RED council verdict stops the pipeline early — do not plan what is blocked. Returns council verdict + agent plan + structured task list.',
719
+ inputSchema: {
720
+ type: 'object',
721
+ properties: {
722
+ agent_responses: { type: 'object', description: 'Phase 2 responses for council and agents.' },
723
+ description: { type: 'string', description: 'Feature description or user story.' },
724
+ project_dir: { type: 'string', description: 'Optional: absolute path to project for context injection.' },
725
+ context: { type: 'string', description: 'Optional: constraints, team size, timeline, or architecture notes.' },
726
+ },
727
+ required: ['description'],
728
+ },
729
+ },
730
+ {
731
+ name: 'veto_delegate',
732
+ description: 'Delegates a subtask to a specialist agent and returns only a compact summary — not the full output. Use when orchestrating multi-step work and you need an agent\'s conclusion without polluting your context with verbose output. Mirrors the "boomerang" delegation pattern.',
733
+ inputSchema: {
734
+ type: 'object',
735
+ properties: {
736
+ agent_id: {
737
+ type: 'string',
738
+ description: 'The specialist agent to delegate to.',
739
+ enum: ['coder', 'tester', 'reviewer', 'debugger', 'refactor', 'database', 'api', 'frontend', 'backend', 'devops', 'performance', 'auth', 'security-scanner', 'documentation', 'task-planner', 'researcher', 'estimator', 'risk-assessor'],
740
+ },
741
+ task: { type: 'string', description: 'The subtask to delegate.' },
742
+ context: { type: 'string', description: 'Optional context for the agent.' },
743
+ project_dir: { type: 'string', description: 'Optional: project directory for context injection.' },
744
+ max_summary_tokens: { type: 'number', description: 'Max characters in the returned summary (default 500, max 2000).' },
745
+ },
746
+ required: ['agent_id', 'task'],
747
+ },
748
+ },
749
+ {
750
+ name: 'veto_prompt_optimizer',
751
+ description: 'Scores a prompt for failure modes (vague role, missing output format, injection-prone, no examples) and returns a rewritten version with improvements. Zero API keys needed — uses the local agent loop.',
752
+ inputSchema: {
753
+ type: 'object',
754
+ properties: {
755
+ prompt: { type: 'string', description: 'The prompt to optimize (system or user prompt).' },
756
+ role: { type: 'string', description: "Optional — 'system' | 'user' (helps tailor analysis)." },
757
+ goal: { type: 'string', description: 'Optional — what the prompt is trying to accomplish.' },
758
+ },
759
+ required: ['prompt'],
760
+ },
761
+ },
762
+ {
763
+ name: 'veto_sre_advisor',
764
+ description: 'Calculates SLO error budget status (remaining %, projected exhaustion) and returns ranked reliability improvements. Error budget math is deterministic; prioritization uses the local agent loop.',
765
+ inputSchema: {
766
+ type: 'object',
767
+ properties: {
768
+ slo_target: { type: 'number', description: 'SLO target % (e.g. 99.9).' },
769
+ window_days: { type: 'number', description: 'Measurement window in days (e.g. 30).' },
770
+ downtime_minutes: { type: 'number', description: 'Total downtime minutes in the window.' },
771
+ incidents: {
772
+ type: 'array',
773
+ description: 'Optional — recent incidents.',
774
+ items: {
775
+ type: 'object',
776
+ properties: {
777
+ date: { type: 'string', description: 'ISO date of the incident.' },
778
+ duration_minutes: { type: 'number', description: 'Duration of the incident in minutes.' },
779
+ description: { type: 'string', description: 'Short description of the incident.' },
780
+ },
781
+ },
782
+ },
783
+ service_name: { type: 'string', description: 'Optional — name of the service.' },
784
+ },
785
+ required: ['slo_target', 'window_days', 'downtime_minutes'],
786
+ },
787
+ },
788
+ {
789
+ name: 'veto_diagram',
790
+ description: "Generates a Mermaid architecture diagram of the project. Returns diagram text ready to paste into GitHub, Notion, or any Mermaid renderer.",
791
+ inputSchema: {
792
+ type: 'object',
793
+ properties: {
794
+ project_dir: { type: 'string', description: 'Absolute path to project.' },
795
+ diagram_type: { type: 'string', description: "Diagram type: 'flowchart' | 'classDiagram' | 'sequenceDiagram' | 'C4Context' (default: 'flowchart')." },
796
+ focus: { type: 'string', description: "Optional — what to focus on (e.g. 'data flow', 'auth', 'API')." },
797
+ },
798
+ required: ['project_dir'],
799
+ },
800
+ },
801
+ {
802
+ name: 'veto_adr',
803
+ description: 'Converts a veto_council_debate result into a MADR-format Architecture Decision Record (ADR). Writes to docs/decisions/NNNN-<slug>.md if project_dir is provided. Returns the ADR markdown content.',
804
+ inputSchema: {
805
+ type: 'object',
806
+ properties: {
807
+ task: { type: 'string', description: 'The decision/task that was debated.' },
808
+ verdict: { type: 'string', description: 'Council verdict: GREEN/YELLOW/RED/DEADLOCK.' },
809
+ recommended: { type: 'string', description: 'The recommended approach from the council.' },
810
+ rationale: { type: 'string', description: 'Optional additional rationale or context.' },
811
+ consequences: { type: 'string', description: 'Optional known consequences of this decision.' },
812
+ project_dir: { type: 'string', description: 'Optional path to write the ADR file.' },
813
+ outcome_id: { type: 'string', description: 'Optional council outcome_id for reference.' },
814
+ },
815
+ required: ['task', 'verdict', 'recommended'],
816
+ },
817
+ },
818
+ {
819
+ name: 'veto_env_setup',
820
+ description: 'Analyzes project config files (package.json, requirements.txt, .env, etc.) and generates a .env.example with all required environment variables, plus a step-by-step setup guide.',
821
+ inputSchema: {
822
+ type: 'object',
823
+ properties: {
824
+ project_dir: { type: 'string', description: 'Absolute path to project.' },
825
+ write_files: { type: 'boolean', description: 'If true, write .env.example to disk (default false).' },
826
+ },
827
+ required: ['project_dir'],
828
+ },
829
+ },
830
+ {
831
+ name: 'veto_commit_message',
832
+ description: 'Generates a conventional-commit message from staged changes (git diff --cached). Returns type, scope, subject, and body following the Conventional Commits specification.',
833
+ inputSchema: {
834
+ type: 'object',
835
+ properties: {
836
+ project_dir: { type: 'string', description: 'Absolute path to the git repository.' },
837
+ hint: { type: 'string', description: 'Optional extra context for the commit (ticket number, motivation, etc.).' },
838
+ },
839
+ required: ['project_dir'],
840
+ },
841
+ },
842
+ {
843
+ name: 'veto_pr_description',
844
+ description: "Generates a complete GitHub PR description (title, summary, change list, test plan, breaking changes) from git diff main...HEAD. Ready to paste into GitHub or post via veto_pr_post.",
845
+ inputSchema: {
846
+ type: 'object',
847
+ properties: {
848
+ project_dir: { type: 'string', description: 'Absolute path to the git repository.' },
849
+ base_branch: { type: 'string', description: "Branch to diff against (default: 'main')." },
850
+ title: { type: 'string', description: 'Optional PR title hint.' },
851
+ context: { type: 'string', description: 'Optional: ticket number, description, or motivation.' },
852
+ },
853
+ required: ['project_dir'],
854
+ },
855
+ },
856
+ {
857
+ name: 'veto_pr_post',
858
+ description: 'Posts veto_pr_review or veto_diff_review findings directly to a GitHub PR as review comments. Requires GITHUB_TOKEN environment variable. Returns the review URL.',
859
+ inputSchema: {
860
+ type: 'object',
861
+ properties: {
862
+ pr_url: {
863
+ type: 'string',
864
+ description: 'GitHub PR URL: https://github.com/owner/repo/pull/123',
865
+ },
866
+ findings: {
867
+ type: 'array',
868
+ description: 'Findings from veto_pr_review or veto_diff_review.',
869
+ items: {
870
+ type: 'object',
871
+ properties: {
872
+ severity: { type: 'string', description: "Severity: 'critical' | 'high' | 'medium' | 'low'" },
873
+ message: { type: 'string', description: 'Finding message.' },
874
+ location: { type: 'string', description: 'Optional file:line hint.' },
875
+ },
876
+ required: ['severity', 'message'],
877
+ },
878
+ },
879
+ body: { type: 'string', description: 'Optional overall review summary posted as top-level comment.' },
880
+ event: { type: 'string', description: "Review event: 'COMMENT' | 'APPROVE' | 'REQUEST_CHANGES' (default: 'COMMENT')." },
881
+ },
882
+ required: ['pr_url', 'findings'],
883
+ },
884
+ },
885
+ {
886
+ name: 'veto_debt_register',
887
+ description: 'Analyzes code quality + git commit frequency to produce a ranked technical debt register. High-churn + low-quality files are highest priority. Returns a prioritized list with debt type, location, and suggested agent.',
888
+ inputSchema: {
889
+ type: 'object',
890
+ properties: {
891
+ project_dir: { type: 'string', description: 'Absolute path to project.' },
892
+ max_files: { type: 'number', description: 'Max files to analyze (default 10, max 30).' },
893
+ extensions: {
894
+ type: 'array',
895
+ description: "File extensions to scan (default: ['.ts','.js','.py','.go']).",
896
+ items: { type: 'string' },
897
+ },
898
+ },
899
+ required: ['project_dir'],
900
+ },
901
+ },
902
+ // ── Documentation & Quality ──────────────────────────────────────────────────
903
+ {
904
+ name: 'veto_doc_gen',
905
+ description: 'Reads a source file and generates JSDoc/TSDoc/docstring comments for all public APIs. Returns the annotated file content.',
906
+ inputSchema: {
907
+ type: 'object',
908
+ properties: {
909
+ file_path: { type: 'string', description: 'Absolute path to source file.' },
910
+ style: { type: 'string', description: "Documentation style: 'jsdoc', 'tsdoc', 'docstring', or 'auto' (default).", enum: ['jsdoc', 'tsdoc', 'docstring', 'auto'] },
911
+ },
912
+ required: ['file_path'],
913
+ },
914
+ },
915
+ {
916
+ name: 'veto_type_coverage',
917
+ description: "Scans a TypeScript project for `any`, implicit `any`, and `as any` casts. Suggests specific replacement types using surrounding code context. Flags `any` in auth/security paths as high severity.",
918
+ inputSchema: {
919
+ type: 'object',
920
+ properties: {
921
+ agent_response: {
922
+ type: 'object',
923
+ description: 'Phase 2 response from the host AI (JSON). Pass this back when prompted by the server to complete the agentic loop.',
924
+ },
925
+ project_dir: { type: 'string', description: 'Absolute path to TypeScript project root.' },
926
+ max_files: { type: 'number', description: 'Max files to analyze (default 20, max 30).' },
927
+ },
928
+ required: ['project_dir'],
929
+ },
930
+ },
931
+ {
932
+ name: 'veto_test_gaps',
933
+ description: 'Reads a coverage report (lcov/JSON) or scans source files to identify untested paths and suggests concrete test cases.',
934
+ inputSchema: {
935
+ type: 'object',
936
+ properties: {
937
+ agent_response: {
938
+ type: 'object',
939
+ description: 'Phase 2 response from the host AI (JSON). Pass this back when prompted by the server to complete the agentic loop.',
940
+ },
941
+ project_dir: { type: 'string', description: 'Absolute path to project root.' },
942
+ coverage_report: { type: 'string', description: 'Optional path to coverage JSON/lcov file.' },
943
+ source_glob: { type: 'string', description: 'Optional glob pattern for source files (e.g. "src/**/*.ts").' },
944
+ },
945
+ required: ['project_dir'],
946
+ },
947
+ },
948
+ {
949
+ name: 'veto_onboard',
950
+ description: "Generates a complete new-developer onboarding guide: setup, architecture, key files, how to run tests, first PR checklist.",
951
+ inputSchema: {
952
+ type: 'object',
953
+ properties: {
954
+ project_dir: { type: 'string', description: 'Absolute path to project root.' },
955
+ role: { type: 'string', description: "Developer role focus, e.g. 'frontend', 'backend', 'fullstack'." },
956
+ },
957
+ required: ['project_dir'],
958
+ },
959
+ },
960
+ // ── Diagnosis & Release ───────────────────────────────────────────────────────
961
+ {
962
+ name: 'veto_rca',
963
+ description: 'Stack trace or error description → structured root-cause hypothesis with likely introducing commit. Combines git blame/log with debugger analysis.',
964
+ inputSchema: {
965
+ type: 'object',
966
+ properties: {
967
+ error: { type: 'string', description: 'Error message or stack trace to analyze.' },
968
+ project_dir: { type: 'string', description: 'Git repo root for blame context (optional).' },
969
+ file_hint: { type: 'string', description: 'Suspected file path for focused git blame (optional).' },
970
+ },
971
+ required: ['error'],
972
+ },
973
+ },
974
+ {
975
+ name: 'veto_release_notes',
976
+ description: "Generates user-facing release notes from merged commits since the last git tag. Rewrites dev-speak into plain English (fix: race condition → Login is now more reliable).",
977
+ inputSchema: {
978
+ type: 'object',
979
+ properties: {
980
+ project_dir: { type: 'string', description: 'Absolute path to the git repository.' },
981
+ from_ref: { type: 'string', description: 'Tag or commit to diff from (default: last tag).' },
982
+ audience: { type: 'string', description: "Target audience: 'user' (default) or 'developer'.", enum: ['user', 'developer'] },
983
+ },
984
+ required: ['project_dir'],
985
+ },
986
+ },
987
+ {
988
+ name: 'veto_postmortem',
989
+ description: 'Incident description + timeline → blameless postmortem with five-whys RCA, action items, and correlation with past council RED verdicts if available.',
990
+ inputSchema: {
991
+ type: 'object',
992
+ properties: {
993
+ incident: { type: 'string', description: 'Incident description.' },
994
+ timeline: { type: 'string', description: 'Timeline of events (freeform, optional).' },
995
+ project_dir: { type: 'string', description: 'Git repo root for audit log correlation (optional).' },
996
+ service: { type: 'string', description: 'Service or system name (optional).' },
997
+ },
998
+ required: ['incident'],
999
+ },
1000
+ },
1001
+ // ── Code Intelligence (Dep / Query / Bundle / Dead-code) ─────────────────────
1002
+ {
1003
+ name: 'veto_dep_advisor',
1004
+ description: 'Parses package.json/requirements.txt/Cargo.toml lockfile, queries OSV.dev (free, no key) for known vulnerabilities, and returns a risk-ranked upgrade plan with breaking-change flags.',
1005
+ inputSchema: {
1006
+ type: 'object',
1007
+ properties: {
1008
+ project_dir: { type: 'string', description: 'Absolute path to the project directory.' },
1009
+ ecosystem: { type: 'string', description: "Package ecosystem: 'npm', 'pypi', 'cargo', or 'auto' (default).", enum: ['npm', 'pypi', 'cargo', 'auto'] },
1010
+ },
1011
+ required: ['project_dir'],
1012
+ },
1013
+ },
1014
+ {
1015
+ name: 'veto_query_advisor',
1016
+ description: 'Accepts a SQL query or EXPLAIN ANALYZE output + optional schema → returns rewrite suggestions, CREATE INDEX statements, N+1 detection, and index risk assessment.',
1017
+ inputSchema: {
1018
+ type: 'object',
1019
+ properties: {
1020
+ query: { type: 'string', description: 'SQL query or EXPLAIN ANALYZE output to analyze.' },
1021
+ schema: { type: 'string', description: 'Optional CREATE TABLE statements or schema description.' },
1022
+ explain_output: { type: 'string', description: 'Optional EXPLAIN ANALYZE output if available.' },
1023
+ },
1024
+ required: ['query'],
1025
+ },
1026
+ },
1027
+ {
1028
+ name: 'veto_bundle_advisor',
1029
+ description: 'Accepts a webpack/Rollup/Vite stats JSON file → top 10 heaviest modules, duplicate packages, code-split candidates, and CDN externalization suggestions.',
1030
+ inputSchema: {
1031
+ type: 'object',
1032
+ properties: {
1033
+ stats_file: { type: 'string', description: 'Absolute path to the bundle stats JSON file (webpack stats format).' },
1034
+ project_dir: { type: 'string', description: 'Optional absolute path to the project root.' },
1035
+ },
1036
+ required: ['stats_file'],
1037
+ },
1038
+ },
1039
+ {
1040
+ name: 'veto_dead_code',
1041
+ description: 'Project-scope dead code detector: unused exports, unreachable branches, stale feature flags (always-true/false constants). Returns council-governed deletion recommendations.',
1042
+ inputSchema: {
1043
+ type: 'object',
1044
+ properties: {
1045
+ project_dir: { type: 'string', description: 'Absolute path to the project root.' },
1046
+ extensions: { type: 'array', description: "File extensions to scan (default: ['.ts','.js']).", items: { type: 'string' } },
1047
+ },
1048
+ required: ['project_dir'],
1049
+ },
1050
+ },
1051
+ // ── HITL / OpenAPI / Flag Auditor ────────────────────────────────────────────
1052
+ {
1053
+ name: 'veto_hitl_checkpoint',
1054
+ description: 'Pauses an agentic workflow and returns a structured approval-request the host AI surfaces to the user. The user\'s reply in the AI conversation provides the approval signal. Use before destructive operations, RED council verdicts, or bulk deletes.',
1055
+ inputSchema: {
1056
+ type: 'object',
1057
+ properties: {
1058
+ stage: { type: 'string', description: 'Workflow stage name, e.g. "database-migration".' },
1059
+ context: { type: 'string', description: 'What is about to happen and why.' },
1060
+ options: { type: 'array', items: { type: 'string' }, description: 'Choices to present (default: [\'Approve\',\'Reject\',\'Modify\']).' },
1061
+ risk_level: { type: 'string', description: 'Risk level of the operation.', enum: ['low', 'medium', 'high', 'critical'] },
1062
+ workflow_id: { type: 'string', description: 'ID of the parent workflow for tracking (optional).' },
1063
+ },
1064
+ required: ['stage', 'context'],
1065
+ },
1066
+ },
1067
+ {
1068
+ name: 'veto_openapi_gen',
1069
+ description: 'Reads Express/FastAPI/Hono/Fastify route files and generates an OpenAPI 3.1 spec YAML. Returns the spec as a string and optionally writes it to openapi.yaml.',
1070
+ inputSchema: {
1071
+ type: 'object',
1072
+ properties: {
1073
+ file_path: { type: 'string', description: 'Single route file to parse (optional).' },
1074
+ project_dir: { type: 'string', description: 'Scan all route files in project (optional).' },
1075
+ framework: { type: 'string', description: "Framework hint: 'express','fastapi','hono','fastify', or 'auto' (default).", enum: ['express', 'fastapi', 'hono', 'fastify', 'auto'] },
1076
+ write_file: { type: 'boolean', description: 'Write openapi.yaml to project root (optional).' },
1077
+ },
1078
+ required: [],
1079
+ },
1080
+ },
1081
+ {
1082
+ name: 'veto_flag_auditor',
1083
+ description: 'SDK-agnostic feature flag auditor — detects LaunchDarkly/Unleash SDK calls AND custom if(flags.X) patterns. Classifies flags as: actively toggled / candidate for removal / orphaned.',
1084
+ inputSchema: {
1085
+ type: 'object',
1086
+ properties: {
1087
+ project_dir: { type: 'string', description: 'Absolute path to the project root.' },
1088
+ sdk: { type: 'string', description: "SDK hint: 'launchdarkly','unleash','custom', or 'auto' (default)." },
1089
+ },
1090
+ required: ['project_dir'],
1091
+ },
1092
+ },
617
1093
  // ── Workflow & CI ─────────────────────────────────────────────────────────────
618
1094
  {
619
1095
  name: 'veto_workflow',
@@ -633,11 +1109,16 @@ export const TOOL_DEFINITIONS = [
633
1109
  code: { type: 'string', description: 'Optional code to analyze.' },
634
1110
  context: { type: 'string', description: 'Optional context.' },
635
1111
  gate: { type: 'number', description: 'Optional minimum confidence % (0–100) required to proceed to the next step.' },
1112
+ retry_on_fail: { type: 'boolean', description: 'If true and this step fails its gate, re-run up to max_retries times with prior failure output injected as context.' },
1113
+ max_retries: { type: 'number', description: 'Max retry attempts when retry_on_fail is true. Default 3, max 5.' },
1114
+ condition: { type: 'string', description: "Optional expression evaluated against prior step outputs. If false, this step is skipped. Example: \"security_scan.severity == 'critical'\" or \"code_review.confidence >= 70\". Supported operators: ==, !=, >=, <=, >, <, &&, ||, !" },
1115
+ dependencies: { type: 'array', description: 'Step IDs that must complete before this step runs (dag mode only).', items: { type: 'string' } },
636
1116
  },
637
1117
  required: ['id', 'agent', 'task'],
638
1118
  },
639
1119
  },
640
1120
  project_dir: { type: 'string', description: 'Optional project directory — auto-injects codebase context into all steps.' },
1121
+ mode: { type: 'string', enum: ['linear', 'dag'], description: 'Execution mode. "linear" (default) runs steps sequentially. "dag" reads dependencies, runs independent steps in parallel, gates dependent steps.' },
641
1122
  },
642
1123
  required: ['steps'],
643
1124
  },
@@ -681,6 +1162,10 @@ export const TOOL_DEFINITIONS = [
681
1162
  inputSchema: {
682
1163
  type: 'object',
683
1164
  properties: {
1165
+ agent_outputs: {
1166
+ type: 'object',
1167
+ description: 'Phase 2 responses from the host AI (JSON). Pass this back when prompted by the server to complete the agentic loop.',
1168
+ },
684
1169
  project_dir: { type: 'string', description: 'Absolute project path. Veto reads git diff HEAD automatically.' },
685
1170
  diff: { type: 'string', description: 'Optional: pass a diff string directly instead of reading from project_dir.' },
686
1171
  context: { type: 'string', description: 'Optional: PR description or ticket number for context.' },
@@ -720,7 +1205,7 @@ export const TOOL_DEFINITIONS = [
720
1205
  inputSchema: {
721
1206
  type: 'object',
722
1207
  properties: {
723
- platform: { type: 'string', enum: ['claude', 'gemini', 'codex'], description: 'The platform to get setup instructions for.' },
1208
+ platform: { type: 'string', enum: ['claude', 'gemini', 'codex', 'copilot', 'jetbrains', 'windsurf', 'zed', 'amazonq'], description: 'The platform to get setup instructions for.' },
724
1209
  veto_server_path: { type: 'string', description: 'Absolute path to the built veto server (dist/server.js).' },
725
1210
  },
726
1211
  required: ['platform', 'veto_server_path'],
@@ -755,6 +1240,10 @@ export const TOOL_DEFINITIONS = [
755
1240
  inputSchema: {
756
1241
  type: 'object',
757
1242
  properties: {
1243
+ agent_response: {
1244
+ type: 'object',
1245
+ description: 'Phase 2 response from the host AI (JSON). Pass this back when prompted by the server to complete the agentic loop.',
1246
+ },
758
1247
  file_path: { type: 'string', description: 'Absolute path to the file to explain.' },
759
1248
  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.' },
760
1249
  depth: { type: 'string', enum: ['overview', 'detailed', 'line-by-line'], description: 'Explanation depth. Default: overview.' },
@@ -769,6 +1258,10 @@ export const TOOL_DEFINITIONS = [
769
1258
  inputSchema: {
770
1259
  type: 'object',
771
1260
  properties: {
1261
+ agent_response: {
1262
+ type: 'object',
1263
+ description: 'Phase 2 response from the host AI (JSON). Pass this back when prompted by the server to complete the agentic loop.',
1264
+ },
772
1265
  project_dir: { type: 'string', description: 'Absolute path to a project directory to summarize.' },
773
1266
  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.' },
774
1267
  focus: { type: 'string', description: 'Optional focus area: e.g. "security", "APIs", "data flow", "architecture". Narrows the summary.' },
@@ -811,5 +1304,186 @@ export const TOOL_DEFINITIONS = [
811
1304
  required: [],
812
1305
  },
813
1306
  },
1307
+ // ── Phase 7: Intelligence & Advanced ──────────────────────────────────────────
1308
+ {
1309
+ name: 'veto_local_llm',
1310
+ description: 'Routes a task to a local LLM (via Ollama or LM Studio) instead of a cloud provider. Useful for privacy-sensitive data or simple, repetitive tasks.',
1311
+ inputSchema: {
1312
+ type: 'object',
1313
+ properties: {
1314
+ agent_response: {
1315
+ type: 'object',
1316
+ description: 'Phase 2 response from the host AI (JSON). Pass this back when prompted by the server to complete the agentic loop.',
1317
+ },
1318
+ task: { type: 'string', description: 'The task or prompt.' },
1319
+ model: { type: 'string', description: 'Local model name (e.g. llama3, mistral).' },
1320
+ provider: { type: 'string', enum: ['ollama', 'lmstudio'], description: 'Local provider.' }
1321
+ },
1322
+ required: ['task'],
1323
+ },
1324
+ },
1325
+ {
1326
+ name: 'veto_clone_detector',
1327
+ description: 'Scans the project for duplicated code blocks or structural clones. Returns grouped findings and refactoring suggestions.',
1328
+ inputSchema: {
1329
+ type: 'object',
1330
+ properties: {
1331
+ project_dir: { type: 'string', description: 'Absolute path to project root.' },
1332
+ extensions: { type: 'array', items: { type: 'string' }, description: 'File extensions to scan.' },
1333
+ min_lines: { type: 'number', description: 'Minimum number of identical lines to flag (default 5).' }
1334
+ },
1335
+ required: ['project_dir'],
1336
+ },
1337
+ },
1338
+ {
1339
+ name: 'veto_lint_rules',
1340
+ description: 'Analyzes project coding style and auto-generates or updates ESLint/Prettier/Ruff configurations to match current conventions.',
1341
+ inputSchema: {
1342
+ type: 'object',
1343
+ properties: {
1344
+ project_dir: { type: 'string', description: 'Absolute path to project root.' },
1345
+ tool: { type: 'string', enum: ['eslint', 'prettier', 'ruff'], description: 'The linting tool to configure.' }
1346
+ },
1347
+ required: ['project_dir', 'tool'],
1348
+ },
1349
+ },
1350
+ {
1351
+ name: 'veto_api_contract',
1352
+ description: 'Analyzes API endpoints and generates/verifies API contracts (e.g. OpenAPI or TypeScript types) to ensure front/back compatibility.',
1353
+ inputSchema: {
1354
+ type: 'object',
1355
+ properties: {
1356
+ project_dir: { type: 'string', description: 'Absolute path to project root.' },
1357
+ target: { type: 'string', enum: ['generate', 'verify'], description: 'Action to perform.' }
1358
+ },
1359
+ required: ['project_dir', 'target'],
1360
+ },
1361
+ },
1362
+ {
1363
+ name: 'veto_merge_conflict',
1364
+ description: 'Analyzes a file with git conflict markers and returns a semantically correct resolution by understanding the intent of both branches.',
1365
+ inputSchema: {
1366
+ type: 'object',
1367
+ properties: {
1368
+ file_path: { type: 'string', description: 'Path to the file containing conflict markers.' },
1369
+ project_dir: { type: 'string', description: 'Optional project directory for context.' }
1370
+ },
1371
+ required: ['file_path'],
1372
+ },
1373
+ },
1374
+ {
1375
+ name: 'veto_translate',
1376
+ description: 'Translates text or structured i18n files (JSON/YAML) to target languages while preserving variables and formatting.',
1377
+ inputSchema: {
1378
+ type: 'object',
1379
+ properties: {
1380
+ text: { type: 'string', description: 'Text to translate (optional if file_path provided).' },
1381
+ file_path: { type: 'string', description: 'Path to i18n file (optional if text provided).' },
1382
+ target_langs: { type: 'array', items: { type: 'string' }, description: 'Target language codes.' }
1383
+ },
1384
+ required: ['target_langs'],
1385
+ },
1386
+ },
1387
+ {
1388
+ name: 'veto_a11y_advisor',
1389
+ description: 'Analyzes UI components (React, Vue, HTML) for accessibility (a11y) compliance (WCAG) and provides actionable fix recommendations.',
1390
+ inputSchema: {
1391
+ type: 'object',
1392
+ properties: {
1393
+ file_path: { type: 'string', description: 'Path to the UI component file.' },
1394
+ project_dir: { type: 'string', description: 'Optional project directory context.' }
1395
+ },
1396
+ required: ['file_path'],
1397
+ },
1398
+ },
1399
+ {
1400
+ name: 'veto_session_replay',
1401
+ description: 'Replays an event stream session to restore full conversational context from a past interaction.',
1402
+ inputSchema: {
1403
+ type: 'object',
1404
+ properties: {
1405
+ session_id: { type: 'string', description: 'The session ID to replay.' },
1406
+ },
1407
+ required: ['session_id'],
1408
+ },
1409
+ },
1410
+ {
1411
+ name: 'veto_compose_agents',
1412
+ description: 'Creates a custom meta-agent by composing existing agents into a specialized pipeline.',
1413
+ inputSchema: {
1414
+ type: 'object',
1415
+ properties: {
1416
+ name: { type: 'string', description: 'Name of the new composed agent.' },
1417
+ agents: { type: 'array', items: { type: 'string' }, description: 'List of base agents to compose.' },
1418
+ workflow: { type: 'string', description: 'Workflow logic or sequence for the composed agent.' }
1419
+ },
1420
+ required: ['name', 'agents', 'workflow'],
1421
+ },
1422
+ },
1423
+ // ── Phase 8: Long-Horizon ─────────────────────────────────────────────────
1424
+ {
1425
+ name: 'veto_semantic_search',
1426
+ description: 'Local vector index codebase search. Answers natural-language queries over code (e.g. "where is user authentication handled?").',
1427
+ inputSchema: {
1428
+ type: 'object',
1429
+ properties: {
1430
+ agent_response: {
1431
+ type: 'object',
1432
+ description: 'Phase 2 response from the host AI (JSON). Pass this back when prompted by the server to complete the agentic loop.',
1433
+ },
1434
+ query: { type: 'string', description: 'Natural-language search query.' },
1435
+ project_dir: { type: 'string', description: 'Absolute path to project root.' }
1436
+ },
1437
+ required: ['query', 'project_dir'],
1438
+ },
1439
+ },
1440
+ {
1441
+ name: 'veto_sdd_agent',
1442
+ description: 'Spec-Driven Development agent. Provides full SDD loop: spec validation, acceptance criteria generation, and BDD scenario authoring.',
1443
+ inputSchema: {
1444
+ type: 'object',
1445
+ properties: {
1446
+ agent_response: {
1447
+ type: 'object',
1448
+ description: 'Phase 2 response from the host AI (JSON). Pass this back when prompted by the server to complete the agentic loop.',
1449
+ },
1450
+ spec_file: { type: 'string', description: 'Path to the specification file.' },
1451
+ project_dir: { type: 'string', description: 'Absolute path to project root.' },
1452
+ action: { type: 'string', enum: ['validate', 'generate_ac', 'author_bdd'], description: 'SDD action to perform.' }
1453
+ },
1454
+ required: ['spec_file', 'project_dir', 'action'],
1455
+ },
1456
+ },
1457
+ {
1458
+ name: 'veto_playwright',
1459
+ description: 'Playwright MCP integration. Coordinates browser sessions for testing, a11y review, and security scanning of UI vulnerabilities.',
1460
+ inputSchema: {
1461
+ type: 'object',
1462
+ properties: {
1463
+ agent_response: {
1464
+ type: 'object',
1465
+ description: 'Phase 2 response from the host AI (JSON). Pass this back when prompted by the server to complete the agentic loop.',
1466
+ },
1467
+ task: { type: 'string', description: 'Description of the browser task or test scenario.' },
1468
+ project_dir: { type: 'string', description: 'Absolute path to project root.' },
1469
+ url: { type: 'string', description: 'Optional starting URL for the browser session.' }
1470
+ },
1471
+ required: ['task', 'project_dir'],
1472
+ },
1473
+ },
1474
+ {
1475
+ name: 'veto_notify_ide',
1476
+ description: 'Sends a notification or instruction back to the IDE/client. Useful for opening files, showing alerts, or requesting UI actions in bidirectional MCP setups (JetBrains, Zed).',
1477
+ inputSchema: {
1478
+ type: 'object',
1479
+ properties: {
1480
+ action: { type: 'string', enum: ['open_file', 'show_message', 'set_status'], description: 'Action to request from the IDE.' },
1481
+ path: { type: 'string', description: 'File path (for open_file).' },
1482
+ message: { type: 'string', description: 'Message text (for show_message/set_status).' },
1483
+ level: { type: 'string', enum: ['info', 'warning', 'error'], description: 'Message severity level.' }
1484
+ },
1485
+ required: ['action'],
1486
+ },
1487
+ },
814
1488
  ];
815
1489
  //# sourceMappingURL=definitions.js.map