@jigyasudham/veto 1.2.1 → 1.2.2
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/dist/cli.js +65 -4
- package/dist/memory/local.js +15 -5
- package/package.json +7 -3
- package/vitest.config.ts +11 -0
package/dist/cli.js
CHANGED
|
@@ -5,7 +5,7 @@ process.removeAllListeners('warning');
|
|
|
5
5
|
import { mkdirSync, existsSync, readFileSync, writeFileSync, readdirSync, statSync } from 'node:fs';
|
|
6
6
|
import { join, dirname, extname, resolve } from 'node:path';
|
|
7
7
|
import { homedir } from 'node:os';
|
|
8
|
-
const VERSION = '1.2.
|
|
8
|
+
const VERSION = '1.2.2';
|
|
9
9
|
const VETO_DIR = join(homedir(), '.veto');
|
|
10
10
|
const HOME = homedir();
|
|
11
11
|
const c = {
|
|
@@ -49,12 +49,12 @@ function writeVetoConfig(configPath, format) {
|
|
|
49
49
|
const wasEmpty = Object.keys(existing).length === 0;
|
|
50
50
|
if (format === 'mcpServers') {
|
|
51
51
|
const servers = existing.mcpServers ?? {};
|
|
52
|
-
servers['veto'] = { command: 'veto-server' };
|
|
52
|
+
servers['veto'] = { command: 'npx', args: ['-y', '--package', '@jigyasudham/veto', 'veto-server'] };
|
|
53
53
|
existing.mcpServers = servers;
|
|
54
54
|
}
|
|
55
55
|
else {
|
|
56
56
|
const servers = existing.servers ?? {};
|
|
57
|
-
servers['veto'] = { type: 'stdio', command: 'veto-server' };
|
|
57
|
+
servers['veto'] = { type: 'stdio', command: 'npx', args: ['-y', '--package', '@jigyasudham/veto', 'veto-server'] };
|
|
58
58
|
existing.servers = servers;
|
|
59
59
|
}
|
|
60
60
|
writeFileSync(configPath, JSON.stringify(existing, null, 2) + '\n', 'utf8');
|
|
@@ -375,9 +375,70 @@ function helpCommand() {
|
|
|
375
375
|
console.log(c.dim(' ─────────────────────────────────────────────────────'));
|
|
376
376
|
console.log(` ${c.cyan('code-review')} · ${c.cyan('security-audit')} · ${c.cyan('deploy-checklist')} · ${c.cyan('explain-file')}`);
|
|
377
377
|
console.log('');
|
|
378
|
-
console.log(c.bold('
|
|
378
|
+
console.log(c.bold(' Troubleshooting'));
|
|
379
|
+
console.log(c.dim(' ─────────────────────────────────────────────────────'));
|
|
380
|
+
console.log(` ${c.yellow('MCP disconnected / tools not loading')}`);
|
|
381
|
+
console.log(` ${c.dim('→')} Run ${c.cyan('veto init')} again, then fully restart your AI client (Claude / Gemini / Cursor)`);
|
|
382
|
+
console.log(` ${c.dim('→')} Verify the MCP entry in your AI client config file`);
|
|
383
|
+
console.log(` ${c.dim('→')} Check Node.js version: ${c.cyan('node --version')} (need >= 22)`);
|
|
384
|
+
console.log('');
|
|
385
|
+
console.log(` ${c.yellow('veto command not found after install')}`);
|
|
386
|
+
console.log(` ${c.dim('→')} Global install: ${c.cyan('npm install -g @jigyasudham/veto')}`);
|
|
387
|
+
console.log(` ${c.dim('→')} From source: ${c.cyan('npm run build && npm link')}`);
|
|
388
|
+
console.log(` ${c.dim('→')} Windows: restart terminal after install so PATH refreshes`);
|
|
389
|
+
console.log('');
|
|
390
|
+
console.log(` ${c.yellow('Tools missing in Claude / Gemini after install')}`);
|
|
391
|
+
console.log(` ${c.dim('→')} Run ${c.cyan('veto init')} to write / regenerate the MCP config`);
|
|
392
|
+
console.log(` ${c.dim('→')} Fully quit and reopen the AI client (not just reload)`);
|
|
393
|
+
console.log(` ${c.dim('→')} Claude Desktop config: ${c.dim('~/.config/claude/claude_desktop_config.json')}`);
|
|
394
|
+
console.log(` ${c.dim('→')} Gemini / other: check the platform docs for MCP config location`);
|
|
395
|
+
console.log('');
|
|
396
|
+
console.log(` ${c.yellow('Old version still showing after update')}`);
|
|
397
|
+
console.log(` ${c.dim('→')} ${c.cyan('npm install -g @jigyasudham/veto@latest')}`);
|
|
398
|
+
console.log(` ${c.dim('→')} From source: ${c.cyan('npm run build && npm link')}`);
|
|
399
|
+
console.log(` ${c.dim('→')} Confirm active binary: ${c.cyan('which veto')} / ${c.cyan('where veto')}`);
|
|
400
|
+
console.log('');
|
|
401
|
+
console.log(` ${c.yellow('Database / SQLite errors on startup')}`);
|
|
402
|
+
console.log(` ${c.dim('→')} Requires Node.js >= 22 (uses built-in node:sqlite)`);
|
|
403
|
+
console.log(` ${c.dim('→')} Check ${c.dim('~/.veto')} directory exists and is writable`);
|
|
404
|
+
console.log(` ${c.dim('→')} Run ${c.cyan('veto status')} to see the active DB path`);
|
|
405
|
+
console.log('');
|
|
406
|
+
console.log(` ${c.yellow('Memory or sessions not persisting between chats')}`);
|
|
407
|
+
console.log(` ${c.dim('→')} Run ${c.cyan('veto status')} — verify DB path and memory count`);
|
|
408
|
+
console.log(` ${c.dim('→')} Ensure ${c.dim('~/.veto')} is not on a read-only or temp volume`);
|
|
409
|
+
console.log('');
|
|
410
|
+
console.log(` ${c.yellow('Permission denied on Windows (PowerShell)')}`);
|
|
411
|
+
console.log(` ${c.dim('→')} ${c.cyan('Set-ExecutionPolicy -Scope CurrentUser RemoteSigned')}`);
|
|
412
|
+
console.log(` ${c.dim('→')} Or run terminal as Administrator and retry`);
|
|
413
|
+
console.log('');
|
|
414
|
+
console.log(` ${c.yellow('Rate limit / too many requests errors')}`);
|
|
415
|
+
console.log(` ${c.dim('→')} Use ${c.cyan('veto_rate_status')} tool to check current usage`);
|
|
416
|
+
console.log(` ${c.dim('→')} Wait a moment, then retry — limits reset per minute`);
|
|
417
|
+
console.log('');
|
|
418
|
+
console.log(` ${c.yellow('veto init fails / API key not found')}`);
|
|
419
|
+
console.log(` ${c.dim('→')} Set key in your shell: ${c.cyan('export ANTHROPIC_API_KEY=sk-...')}`);
|
|
420
|
+
console.log(` ${c.dim('→')} Windows: ${c.cyan('$env:ANTHROPIC_API_KEY="sk-..."')}`);
|
|
421
|
+
console.log(` ${c.dim('→')} Re-run ${c.cyan('veto init')} after setting the key`);
|
|
422
|
+
console.log('');
|
|
423
|
+
console.log(` ${c.yellow('veto_health shows degraded / components failing')}`);
|
|
424
|
+
console.log(` ${c.dim('→')} Run ${c.cyan('veto status')} for a summary of all components`);
|
|
425
|
+
console.log(` ${c.dim('→')} Check ${c.cyan('veto_audit_log')} for recent error events`);
|
|
426
|
+
console.log(` ${c.dim('→')} Re-run ${c.cyan('veto init')} to repair config and rescan project`);
|
|
427
|
+
console.log('');
|
|
428
|
+
console.log(` ${c.yellow('Installed via npx but MCP disconnects after restart')}`);
|
|
429
|
+
console.log(` ${c.dim('→')} npx runs temporarily — it does NOT add veto-server to PATH permanently`);
|
|
430
|
+
console.log(` ${c.dim('→')} Fix: run ${c.cyan('npx veto init')} again so the config is rewritten with the correct npx command`);
|
|
431
|
+
console.log(` ${c.dim('→')} Or install globally for a stable binary: ${c.cyan('npm install -g @jigyasudham/veto')}`);
|
|
432
|
+
console.log('');
|
|
433
|
+
console.log(` ${c.yellow('Installed on a new machine but MCP not working')}`);
|
|
434
|
+
console.log(` ${c.dim('→')} Run ${c.cyan('npx @jigyasudham/veto init')} on the new machine — config is not transferred`);
|
|
435
|
+
console.log(` ${c.dim('→')} Each machine needs its own init run to register the MCP server`);
|
|
436
|
+
console.log(` ${c.dim('→')} Then restart the AI client on that machine`);
|
|
437
|
+
console.log('');
|
|
438
|
+
console.log(c.bold(' Docs & Support'));
|
|
379
439
|
console.log(c.dim(' ─────────────────────────────────────────────────────'));
|
|
380
440
|
console.log(` ${c.dim('GitHub:')} https://github.com/jigyasudham/veto`);
|
|
441
|
+
console.log(` ${c.dim('Issues:')} https://github.com/jigyasudham/veto/issues`);
|
|
381
442
|
console.log(` ${c.dim('npm:')} https://www.npmjs.com/package/@jigyasudham/veto`);
|
|
382
443
|
console.log('');
|
|
383
444
|
}
|
package/dist/memory/local.js
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
// Local SQLite memory — all operations for session save/restore
|
|
2
2
|
// Uses Node.js built-in node:sqlite (Node 22.5+, no native compilation needed)
|
|
3
|
-
import {
|
|
3
|
+
import { createRequire } from 'node:module';
|
|
4
4
|
import { randomUUID } from 'node:crypto';
|
|
5
|
-
import { join } from 'node:path';
|
|
5
|
+
import { join, dirname } from 'node:path';
|
|
6
6
|
import { homedir } from 'node:os';
|
|
7
7
|
import { mkdirSync } from 'node:fs';
|
|
8
|
+
// node:sqlite is a Node 22.5+ built-in — use createRequire so bundlers (Vite/esbuild) skip it
|
|
9
|
+
const _require = createRequire(import.meta.url);
|
|
10
|
+
const DbSync = _require('node:sqlite').DatabaseSync;
|
|
8
11
|
import { CREATE_TABLES } from './schema.js';
|
|
9
12
|
// Context window sizes per platform (tokens)
|
|
10
13
|
export const CONTEXT_WINDOWS = {
|
|
@@ -13,13 +16,20 @@ export const CONTEXT_WINDOWS = {
|
|
|
13
16
|
codex: 128_000,
|
|
14
17
|
};
|
|
15
18
|
const VETO_DIR = join(homedir(), '.veto');
|
|
16
|
-
const DB_PATH = join(VETO_DIR, 'veto.db');
|
|
19
|
+
const DB_PATH = process.env.VETO_TEST_DB ?? join(VETO_DIR, 'veto.db');
|
|
17
20
|
let _db = null;
|
|
21
|
+
export function resetDb() {
|
|
22
|
+
if (_db) {
|
|
23
|
+
_db.close();
|
|
24
|
+
_db = null;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
18
27
|
export function getDb() {
|
|
19
28
|
if (_db)
|
|
20
29
|
return _db;
|
|
21
|
-
|
|
22
|
-
|
|
30
|
+
if (DB_PATH !== ':memory:')
|
|
31
|
+
mkdirSync(dirname(DB_PATH), { recursive: true });
|
|
32
|
+
_db = new DbSync(DB_PATH);
|
|
23
33
|
_db.exec('PRAGMA journal_mode = WAL');
|
|
24
34
|
_db.exec('PRAGMA foreign_keys = ON');
|
|
25
35
|
_db.exec(CREATE_TABLES);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jigyasudham/veto",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"description": "50 agents. 41 tools. 3 AIs. Self-learning. Zero extra cost.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|
|
@@ -34,7 +34,10 @@
|
|
|
34
34
|
"build": "tsc",
|
|
35
35
|
"dev": "tsx src/cli.ts",
|
|
36
36
|
"start": "node dist/server.js",
|
|
37
|
-
"init": "tsx src/cli.ts init"
|
|
37
|
+
"init": "tsx src/cli.ts init",
|
|
38
|
+
"test": "vitest run",
|
|
39
|
+
"test:watch": "vitest",
|
|
40
|
+
"test:coverage": "vitest run --coverage"
|
|
38
41
|
},
|
|
39
42
|
"dependencies": {
|
|
40
43
|
"@modelcontextprotocol/sdk": "^1.0.0"
|
|
@@ -42,6 +45,7 @@
|
|
|
42
45
|
"devDependencies": {
|
|
43
46
|
"@types/node": "^22.0.0",
|
|
44
47
|
"tsx": "^4.7.0",
|
|
45
|
-
"typescript": "^5.3.0"
|
|
48
|
+
"typescript": "^5.3.0",
|
|
49
|
+
"vitest": "^2.1.9"
|
|
46
50
|
}
|
|
47
51
|
}
|