tribunal-kit 5.8.1 → 5.8.3
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/.agent/ARCHITECTURE.md +13 -13
- package/.agent/agents/complexity-reviewer.md +53 -0
- package/.agent/agents/precedence-reviewer.md +12 -12
- package/.agent/agents/swarm-worker-registry.md +3 -3
- package/.agent/history/memory/.memory.idx +457 -1
- package/.agent/history/memory/MEMORY.md +31 -1
- package/.agent/rules/GEMINI.md +31 -28
- package/.agent/scripts/signal_detector.js +173 -0
- package/.agent/scripts/skill_evolution.js +298 -53
- package/.agent/skills/app-builder/SKILL.md +1 -1
- package/.agent/skills/lint-and-validate/SKILL.md +2 -2
- package/.agent/skills/project-idioms/SKILL.md +7 -7
- package/.agent/skills/test-result-analyzer/SKILL.md +1 -1
- package/.agent/workflows/fix.md +2 -2
- package/.agent/workflows/generate.md +1 -1
- package/.agent/workflows/preview.md +5 -5
- package/.agent/workflows/status.md +1 -1
- package/.agent/workflows/tribunal-full.md +3 -3
- package/.agent/workflows/tribunal-speed.md +1 -1
- package/CONTRIBUTING.md +134 -0
- package/SECURITY.md +52 -0
- package/bin/tribunal-kit.js +92 -46
- package/dist/commands/init.js +68 -30
- package/dist/esm/index.mjs +116 -0
- package/dist/index.d.ts +288 -0
- package/dist/utils/helpers.js +21 -9
- package/package.json +20 -8
package/dist/commands/init.js
CHANGED
|
@@ -64,7 +64,32 @@ async function cmdInit(flags, quiet = false) {
|
|
|
64
64
|
const newManifest = await (0, hasher_1.generateManifest)(agentSrc);
|
|
65
65
|
diff = (0, hasher_1.diffManifests)(oldManifest, newManifest);
|
|
66
66
|
incremental = true;
|
|
67
|
-
|
|
67
|
+
|
|
68
|
+
const addCount = diff.added.length;
|
|
69
|
+
const changeCount = diff.changed.length;
|
|
70
|
+
const removeCount = diff.removed.length;
|
|
71
|
+
|
|
72
|
+
(0, logger_1.log)(` ${(0, logger_1.c)('cyan', '↻')} ${(0, logger_1.bold)('Performing incremental update...')}`);
|
|
73
|
+
|
|
74
|
+
const addedPart = `${(0, logger_1.c)('green', `[+ ${addCount}]`)} added`;
|
|
75
|
+
const changedPart = `${(0, logger_1.c)('yellow', `[~ ${changeCount}]`)} changed`;
|
|
76
|
+
const removedPart = `${(0, logger_1.c)('red', `[- ${removeCount}]`)} removed`;
|
|
77
|
+
(0, logger_1.log)(` ${addedPart} ${changedPart} ${removedPart}`);
|
|
78
|
+
|
|
79
|
+
const totalChanges = addCount + changeCount + removeCount;
|
|
80
|
+
if (totalChanges > 0) {
|
|
81
|
+
const maxBarWidth = 30;
|
|
82
|
+
const addPct = Math.round((addCount / totalChanges) * maxBarWidth);
|
|
83
|
+
const changePct = Math.round((changeCount / totalChanges) * maxBarWidth);
|
|
84
|
+
const removePct = Math.max(0, maxBarWidth - addPct - changePct);
|
|
85
|
+
|
|
86
|
+
const bar =
|
|
87
|
+
(0, logger_1.c)('green', '█'.repeat(addPct)) +
|
|
88
|
+
(0, logger_1.c)('yellow', '█'.repeat(changePct)) +
|
|
89
|
+
(0, logger_1.c)('red', '█'.repeat(removePct));
|
|
90
|
+
|
|
91
|
+
(0, logger_1.log)(` Syncing: [${bar}] ${totalChanges} files`);
|
|
92
|
+
}
|
|
68
93
|
|
|
69
94
|
// Backup ONLY changed or removed files
|
|
70
95
|
const toBackup = [...diff.changed, ...diff.removed];
|
|
@@ -81,7 +106,7 @@ async function cmdInit(flags, quiet = false) {
|
|
|
81
106
|
backedUpCount++;
|
|
82
107
|
}
|
|
83
108
|
}
|
|
84
|
-
(0, logger_1.log)(` ${(0, logger_1.c)('gray',
|
|
109
|
+
(0, logger_1.log)(` ${(0, logger_1.c)('gray', '✦')} Backed up ${backedUpCount} modified/removed files ${(0, logger_1.c)('gray', '→')} ${(0, logger_1.c)('gray', '.agent/.backups/')}`);
|
|
85
110
|
}
|
|
86
111
|
|
|
87
112
|
// Remove removed files
|
|
@@ -103,7 +128,7 @@ async function cmdInit(flags, quiet = false) {
|
|
|
103
128
|
await fs_1.default.promises.rm(subPath, { recursive: true, force: true });
|
|
104
129
|
}
|
|
105
130
|
}
|
|
106
|
-
(0, logger_1.log)(` ${(0, logger_1.c)('gray', '✦ Backed up existing configurations
|
|
131
|
+
(0, logger_1.log)(` ${(0, logger_1.c)('gray', '✦')} Backed up existing configurations ${(0, logger_1.c)('gray', '→')} ${(0, logger_1.c)('gray', '.agent/.backups/')}`);
|
|
107
132
|
}
|
|
108
133
|
}
|
|
109
134
|
// ────────────────────────────────────────────────────────
|
|
@@ -193,45 +218,58 @@ async function cmdInit(flags, quiet = false) {
|
|
|
193
218
|
else {
|
|
194
219
|
// ── Success card — W=62, rows padded by plain-text length ──
|
|
195
220
|
const W = 62;
|
|
221
|
+
const borderCol = 'red';
|
|
196
222
|
const agentsCount = fs_1.default.readdirSync(path_1.default.join(agentDest, 'agents')).length;
|
|
197
223
|
const workflowsCount = fs_1.default.readdirSync(path_1.default.join(agentDest, 'workflows')).length;
|
|
198
224
|
const skillsCount = fs_1.default.readdirSync(path_1.default.join(agentDest, 'skills')).length;
|
|
199
225
|
const scriptsCount = fs_1.default.readdirSync(path_1.default.join(agentDest, 'scripts')).length;
|
|
200
|
-
|
|
201
|
-
const
|
|
202
|
-
const
|
|
203
|
-
|
|
204
|
-
return ` ${(0, logger_1.c)('cyan', '║')} ${icon} ${(0, logger_1.c)('white', label.padEnd(10))}${(0, logger_1.c)(col, String(val).padStart(3))} ${(0, logger_1.c)('gray', 'installed')}${trail}${(0, logger_1.c)('cyan', '║')}`;
|
|
226
|
+
|
|
227
|
+
const drawRow = (plainText, styledText) => {
|
|
228
|
+
const trail = ' '.repeat(Math.max(0, W - plainText.length));
|
|
229
|
+
return ` ${(0, logger_1.c)(borderCol, '│')}${styledText}${trail}${(0, logger_1.c)(borderCol, '│')}`;
|
|
205
230
|
};
|
|
206
|
-
|
|
207
|
-
const
|
|
208
|
-
const
|
|
209
|
-
|
|
231
|
+
|
|
232
|
+
const compRow = (icon, label, count, color) => {
|
|
233
|
+
const leftPlain = ` ${icon} ${label.padEnd(10)} `;
|
|
234
|
+
const rightPlain = ` [ ${String(count).padStart(3)} ]`;
|
|
235
|
+
const numDots = W - leftPlain.length - rightPlain.length - 4; // 4 spaces margin
|
|
236
|
+
const dots = '.'.repeat(Math.max(0, numDots));
|
|
237
|
+
|
|
238
|
+
const plain = `${leftPlain}${dots}${rightPlain}`;
|
|
239
|
+
const styled = ` ${icon} ${(0, logger_1.c)('white', label.padEnd(10))} ${(0, logger_1.c)('gray', dots)} ${(0, logger_1.c)('gray', '[')} ${(0, logger_1.c)(color, String(count).padStart(3))} ${(0, logger_1.c)('gray', ']')}`;
|
|
240
|
+
return drawRow(plain, styled);
|
|
210
241
|
};
|
|
211
|
-
|
|
242
|
+
|
|
212
243
|
const stepRow = (cmd, desc) => {
|
|
213
|
-
const
|
|
214
|
-
const
|
|
215
|
-
|
|
244
|
+
const leftPlain = ` ${cmd.padEnd(16)}`;
|
|
245
|
+
const rightPlain = `▸ ${desc}`;
|
|
246
|
+
const plain = `${leftPlain}${rightPlain}`;
|
|
247
|
+
const styled = ` ${(0, logger_1.c)('white', cmd.padEnd(16))}${(0, logger_1.c)('gray', '▸')} ${(0, logger_1.c)('gray', desc)}`;
|
|
248
|
+
return drawRow(plain, styled);
|
|
216
249
|
};
|
|
250
|
+
|
|
217
251
|
console.log(` ${(0, logger_1.c)('green', '✔')} ${(0, logger_1.bold)((0, logger_1.c)('green', 'Installation complete'))} ${(0, logger_1.c)('gray', '—')} ${(0, logger_1.c)('white', String(copied))} files`);
|
|
218
252
|
console.log(` ${(0, logger_1.c)('gray', ' ╰─')} ${(0, logger_1.c)('gray', agentDest)}`);
|
|
219
253
|
console.log();
|
|
220
|
-
console.log(` ${(0, logger_1.c)(
|
|
221
|
-
console.log(
|
|
222
|
-
console.log(` ${(0, logger_1.c)(
|
|
223
|
-
console.log(
|
|
224
|
-
console.log(
|
|
225
|
-
console.log(
|
|
226
|
-
console.log(
|
|
227
|
-
console.log(
|
|
228
|
-
console.log(
|
|
229
|
-
console.log(
|
|
230
|
-
console.log(
|
|
254
|
+
console.log(` ${(0, logger_1.c)(borderCol, '┌' + '─'.repeat(W) + '┐')}`);
|
|
255
|
+
console.log(drawRow(` TRIBUNAL ENVIRONMENT SYNCHRONIZED`, ` ${(0, logger_1.bold)((0, logger_1.c)('white', 'TRIBUNAL ENVIRONMENT SYNCHRONIZED'))}`));
|
|
256
|
+
console.log(` ${(0, logger_1.c)(borderCol, '├' + '─'.repeat(W) + '┤')}`);
|
|
257
|
+
console.log(drawRow(` Guarding: Active & Enforcing`, ` ${(0, logger_1.c)('gray', 'Guarding:')} ${(0, logger_1.c)('green', 'Active & Enforcing')}`));
|
|
258
|
+
console.log(drawRow(` Manifest: Verified`, ` ${(0, logger_1.c)('gray', 'Manifest:')} ${(0, logger_1.c)('cyan', 'Verified')}`));
|
|
259
|
+
console.log(drawRow('', ''));
|
|
260
|
+
console.log(drawRow(' Installed Components:', (0, logger_1.bold)((0, logger_1.c)('white', ' Installed Components:'))));
|
|
261
|
+
console.log(compRow('🤖', 'Agents', agentsCount, 'magenta'));
|
|
262
|
+
console.log(compRow('⚡', 'Workflows', workflowsCount, 'yellow'));
|
|
263
|
+
console.log(compRow('🧠', 'Skills', skillsCount, 'blue'));
|
|
264
|
+
console.log(compRow('🔧', 'Scripts', scriptsCount, 'green'));
|
|
265
|
+
console.log(` ${(0, logger_1.c)(borderCol, '├' + '─'.repeat(W) + '┤')}`);
|
|
266
|
+
console.log(drawRow('', ''));
|
|
267
|
+
console.log(drawRow(' Next Steps:', (0, logger_1.c)('gray', ' Next Steps:')));
|
|
268
|
+
console.log(stepRow('/generate', 'Generate code with reviews'));
|
|
231
269
|
console.log(stepRow('/review', 'Audit existing code for issues'));
|
|
232
|
-
console.log(stepRow('/tribunal-full', 'Run all
|
|
233
|
-
console.log(
|
|
234
|
-
console.log(` ${(0, logger_1.c)(
|
|
270
|
+
console.log(stepRow('/tribunal-full', 'Run all 20 reviewers in parallel'));
|
|
271
|
+
console.log(drawRow('', ''));
|
|
272
|
+
console.log(` ${(0, logger_1.c)(borderCol, '└' + '─'.repeat(W) + '┘')}`);
|
|
235
273
|
console.log();
|
|
236
274
|
(0, logger_1.log)(` ${(0, logger_1.c)('gray', '✦ Generating IDE bridge files...')}`);
|
|
237
275
|
await generateIDEBridges(targetDir, agentDest, dryRun);
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* tribunal-kit ESM entry point.
|
|
3
|
+
*
|
|
4
|
+
* This thin wrapper re-exports the CJS modules as ESM using createRequire.
|
|
5
|
+
* The actual implementation remains in CommonJS (dist/cli.js) to avoid
|
|
6
|
+
* a full migration while providing ESM compatibility for modern bundlers.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { createRequire } from 'node:module';
|
|
10
|
+
const require = createRequire(import.meta.url);
|
|
11
|
+
|
|
12
|
+
const cli = require('../cli.js');
|
|
13
|
+
const logger = require('../utils/logger.js');
|
|
14
|
+
const helpers = require('../utils/helpers.js');
|
|
15
|
+
|
|
16
|
+
// ── CLI Commands ─────────────────────────────────────────
|
|
17
|
+
export const main = cli.main;
|
|
18
|
+
|
|
19
|
+
// ── Logger Utilities ─────────────────────────────────────
|
|
20
|
+
export const C = logger.C;
|
|
21
|
+
export const colorize = logger.colorize;
|
|
22
|
+
export const c = logger.c;
|
|
23
|
+
export const bold = logger.bold;
|
|
24
|
+
export const setLogLevels = logger.setLogLevels;
|
|
25
|
+
export const log = logger.log;
|
|
26
|
+
export const ok = logger.ok;
|
|
27
|
+
export const warn = logger.warn;
|
|
28
|
+
export const err = logger.err;
|
|
29
|
+
export const dim = logger.dim;
|
|
30
|
+
export const dbg = logger.dbg;
|
|
31
|
+
|
|
32
|
+
// ── Helper Utilities ─────────────────────────────────────
|
|
33
|
+
export const runShellAsync = helpers.runShellAsync;
|
|
34
|
+
export const getKitAgent = helpers.getKitAgent;
|
|
35
|
+
export const banner = helpers.banner;
|
|
36
|
+
|
|
37
|
+
// ── Lazy command loaders (imported on demand) ────────────
|
|
38
|
+
export async function cmdInit(flags, quiet) {
|
|
39
|
+
const mod = require('../commands/init.js');
|
|
40
|
+
return mod.cmdInit(flags, quiet);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export async function cmdUpdate(flags) {
|
|
44
|
+
const mod = require('../commands/update.js');
|
|
45
|
+
return mod.cmdUpdate(flags);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function cmdStatus(flags, quiet) {
|
|
49
|
+
const mod = require('../commands/status.js');
|
|
50
|
+
return mod.cmdStatus(flags, quiet);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export async function cmdLearn(flags, quiet) {
|
|
54
|
+
const mod = require('../commands/learn.js');
|
|
55
|
+
return mod.cmdLearn(flags, quiet);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export async function cmdCase(flags, argv, quiet) {
|
|
59
|
+
const mod = require('../commands/case.js');
|
|
60
|
+
return mod.cmdCase(flags, argv, quiet);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function cmdHook(flags) {
|
|
64
|
+
const mod = require('../commands/hook.js');
|
|
65
|
+
return mod.cmdHook(flags);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export async function cmdGraph(flags, quiet) {
|
|
69
|
+
const mod = require('../commands/graph.js');
|
|
70
|
+
return mod.cmdGraph(flags, quiet);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export async function cmdMutate(flags, argv) {
|
|
74
|
+
const mod = require('../commands/mutate.js');
|
|
75
|
+
return mod.cmdMutate(flags, argv);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function cmdContext(flags, argv) {
|
|
79
|
+
const mod = require('../commands/context.js');
|
|
80
|
+
return mod.cmdContext(flags, argv);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export async function cmdSync() {
|
|
84
|
+
const mod = require('../commands/sync.js');
|
|
85
|
+
return mod.cmdSync();
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export async function cmdAlign(flags, argv, quiet) {
|
|
89
|
+
const mod = require('../commands/align.js');
|
|
90
|
+
return mod.cmdAlign(flags, argv, quiet);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export async function cmdMarathon(flags, argv, quiet) {
|
|
94
|
+
const mod = require('../commands/marathon.js');
|
|
95
|
+
return mod.cmdMarathon(flags, argv, quiet);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export async function cmdCompile(flags, quiet) {
|
|
99
|
+
const mod = require('../commands/compile.js');
|
|
100
|
+
return mod.cmdCompile(flags, quiet);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export async function cmdMemory(flags, argv, quiet) {
|
|
104
|
+
const mod = require('../commands/memory.js');
|
|
105
|
+
return mod.cmdMemory(flags, argv, quiet);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export function cmdUninstall(flags, quiet) {
|
|
109
|
+
const mod = require('../commands/uninstall.js');
|
|
110
|
+
return mod.cmdUninstall(flags, quiet);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export async function generateIDEBridges(cwd, agentDest, quiet) {
|
|
114
|
+
const mod = require('../commands/init.js');
|
|
115
|
+
return mod.generateIDEBridges(cwd, agentDest, quiet);
|
|
116
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* tribunal-kit — The operating system for AI software engineering.
|
|
3
|
+
*
|
|
4
|
+
* TypeScript declarations for the public programmatic API.
|
|
5
|
+
* For CLI usage, run: npx tribunal-kit --help
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
// ── CLI Flags ────────────────────────────────────────────────────────────────
|
|
11
|
+
|
|
12
|
+
/** Flags accepted by all CLI commands. */
|
|
13
|
+
export interface CliFlags {
|
|
14
|
+
/** Overwrite existing `.agent/` folder. */
|
|
15
|
+
force?: boolean;
|
|
16
|
+
/** Suppress all output. */
|
|
17
|
+
quiet?: boolean;
|
|
18
|
+
/** Show detailed debug logging. */
|
|
19
|
+
verbose?: boolean;
|
|
20
|
+
/** Preview actions without executing. */
|
|
21
|
+
dryRun?: boolean;
|
|
22
|
+
/** Install core agents/skills only (~13 agents). */
|
|
23
|
+
minimal?: boolean;
|
|
24
|
+
/** Install in a specific directory. */
|
|
25
|
+
path?: string;
|
|
26
|
+
/** Skip the automatic update version check. */
|
|
27
|
+
skipUpdateCheck?: boolean;
|
|
28
|
+
/** Diff against last commit instead of staged (learn command). */
|
|
29
|
+
head?: boolean;
|
|
30
|
+
/** Write aligned output in-place to the target file (align command). */
|
|
31
|
+
write?: boolean;
|
|
32
|
+
/** Target terminal agent for compile (e.g. 'aider'). */
|
|
33
|
+
target?: string;
|
|
34
|
+
/** Git branch for remote operations. */
|
|
35
|
+
branch?: string;
|
|
36
|
+
/** Log file path for marathon command. */
|
|
37
|
+
log?: string;
|
|
38
|
+
/** Memory mutation strategy: 'balanced' | 'harden' | 'repair-only'. */
|
|
39
|
+
strategy?: string;
|
|
40
|
+
/** Enable token-optimized output. */
|
|
41
|
+
tokenOptimized?: boolean;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** Parsed CLI arguments returned by the internal arg parser. */
|
|
45
|
+
export interface ParsedArgs {
|
|
46
|
+
command: string | null;
|
|
47
|
+
flags: CliFlags;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// ── CLI Commands ─────────────────────────────────────────────────────────────
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Install the `.agent/` intelligence payload into a target project.
|
|
54
|
+
* Equivalent to `npx tribunal-kit init`.
|
|
55
|
+
*/
|
|
56
|
+
export function cmdInit(flags: CliFlags, quiet?: boolean): Promise<void>;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Re-install `.agent/` to get the latest version.
|
|
60
|
+
* Equivalent to `npx tribunal-kit update`.
|
|
61
|
+
*/
|
|
62
|
+
export function cmdUpdate(flags: CliFlags): Promise<void>;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Check if `.agent/` is installed in the current project.
|
|
66
|
+
* Equivalent to `npx tribunal-kit status`.
|
|
67
|
+
*/
|
|
68
|
+
export function cmdStatus(flags: CliFlags, quiet?: boolean): void;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Evolve project idioms based on git diffs.
|
|
72
|
+
* Equivalent to `npx tribunal-kit learn`.
|
|
73
|
+
*/
|
|
74
|
+
export function cmdLearn(flags: CliFlags, quiet?: boolean): Promise<void>;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Manage Case Law precedents (add, search, list, show, stats, overrule).
|
|
78
|
+
* Equivalent to `npx tribunal-kit case`.
|
|
79
|
+
*/
|
|
80
|
+
export function cmdCase(flags: CliFlags, argv: string[], quiet?: boolean): Promise<void>;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Install pre-push git hook for auto-learning.
|
|
84
|
+
* Equivalent to `npx tribunal-kit hook`.
|
|
85
|
+
*/
|
|
86
|
+
export function cmdHook(flags: CliFlags): void;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Build and visualize the architecture graph.
|
|
90
|
+
* Equivalent to `npx tribunal-kit graph`.
|
|
91
|
+
*/
|
|
92
|
+
export function cmdGraph(flags: CliFlags, quiet?: boolean): Promise<void>;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Run the Mutation Engine to test test-suite reliability.
|
|
96
|
+
* Equivalent to `npx tribunal-kit mutate`.
|
|
97
|
+
*/
|
|
98
|
+
export function cmdMutate(flags: CliFlags, argv: string[]): Promise<void>;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Retrieve a highly-optimized Context Snapshot for a file.
|
|
102
|
+
* Equivalent to `npx tribunal-kit context`.
|
|
103
|
+
*/
|
|
104
|
+
export function cmdContext(flags: CliFlags, argv: string[]): void;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Synchronize IDE bridge files with current rules.
|
|
108
|
+
* Equivalent to `npx tribunal-kit sync`.
|
|
109
|
+
*/
|
|
110
|
+
export function cmdSync(): Promise<void>;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Clean AI outputs (strip slop, collapse lists, validate code traps).
|
|
114
|
+
* Equivalent to `npx tribunal-kit align`.
|
|
115
|
+
*/
|
|
116
|
+
export function cmdAlign(flags: CliFlags, argv: string[], quiet?: boolean): Promise<void>;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Long-running agent harness (init, status, next, mark).
|
|
120
|
+
* Equivalent to `npx tribunal-kit marathon`.
|
|
121
|
+
*/
|
|
122
|
+
export function cmdMarathon(flags: CliFlags, argv: string[], quiet?: boolean): Promise<void>;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Compile rules into a static instruction file for terminal agents.
|
|
126
|
+
* Equivalent to `npx tribunal-kit compile`.
|
|
127
|
+
*/
|
|
128
|
+
export function cmdCompile(flags: CliFlags, quiet?: boolean): Promise<void>;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* 4-Type Taxonomy Persistent Memory Engine.
|
|
132
|
+
* Equivalent to `npx tribunal-kit memory`.
|
|
133
|
+
*/
|
|
134
|
+
export function cmdMemory(flags: CliFlags, argv: string[], quiet?: boolean): Promise<void>;
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Remove `.agent/` folder from project.
|
|
138
|
+
* Equivalent to `npx tribunal-kit uninstall`.
|
|
139
|
+
*/
|
|
140
|
+
export function cmdUninstall(flags: CliFlags, quiet?: boolean): void;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Generate IDE bridge files (Cursor, Windsurf, Gemini, Copilot, Claude).
|
|
144
|
+
* Called internally by `cmdInit` but exported for programmatic use.
|
|
145
|
+
*/
|
|
146
|
+
export function generateIDEBridges(cwd: string, agentDest: string, quiet?: boolean): Promise<void>;
|
|
147
|
+
|
|
148
|
+
// ── Logger Utilities ─────────────────────────────────────────────────────────
|
|
149
|
+
|
|
150
|
+
/** ANSI color code map. */
|
|
151
|
+
export const C: Record<string, string>;
|
|
152
|
+
|
|
153
|
+
/** Colorize text with an ANSI escape code. */
|
|
154
|
+
export function colorize(color: string, text: string): string;
|
|
155
|
+
|
|
156
|
+
/** Short alias for `colorize`. */
|
|
157
|
+
export function c(color: string, text: string): string;
|
|
158
|
+
|
|
159
|
+
/** Wrap text in bold ANSI escape codes. */
|
|
160
|
+
export function bold(text: string): string;
|
|
161
|
+
|
|
162
|
+
/** Set global quiet and verbose log levels. */
|
|
163
|
+
export function setLogLevels(quiet: boolean, verbose: boolean): void;
|
|
164
|
+
|
|
165
|
+
/** Log a message (suppressed in quiet mode). */
|
|
166
|
+
export function log(msg: string): void;
|
|
167
|
+
|
|
168
|
+
/** Log a success message with ✔ prefix. */
|
|
169
|
+
export function ok(msg: string): void;
|
|
170
|
+
|
|
171
|
+
/** Log a warning message with ⚠ prefix. */
|
|
172
|
+
export function warn(msg: string): void;
|
|
173
|
+
|
|
174
|
+
/** Log an error message with ✖ prefix (always shown). */
|
|
175
|
+
export function err(msg: string): void;
|
|
176
|
+
|
|
177
|
+
/** Log a dimmed/gray message. */
|
|
178
|
+
export function dim(msg: string): void;
|
|
179
|
+
|
|
180
|
+
/** Log a debug message (only shown in verbose mode). */
|
|
181
|
+
export function dbg(msg: string): void;
|
|
182
|
+
|
|
183
|
+
// ── Helper Utilities ─────────────────────────────────────────────────────────
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Run a shell command asynchronously with inherited stdio.
|
|
187
|
+
*/
|
|
188
|
+
export function runShellAsync(command: string, options?: object): Promise<void>;
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Resolve the path to the kit's bundled `.agent/` directory.
|
|
192
|
+
* Exits the process if the directory is not found.
|
|
193
|
+
*/
|
|
194
|
+
export function getKitAgent(): string;
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Print the ASCII art banner to stdout.
|
|
198
|
+
*/
|
|
199
|
+
export function banner(quiet: boolean): void;
|
|
200
|
+
|
|
201
|
+
// ── MCP Server Types ─────────────────────────────────────────────────────────
|
|
202
|
+
|
|
203
|
+
/** Memory types supported by the 4-Type Taxonomy Memory Engine. */
|
|
204
|
+
export type MemoryType = 'semantic' | 'procedural' | 'episodic' | 'working';
|
|
205
|
+
|
|
206
|
+
/** A memory entry stored by the Memory Engine. */
|
|
207
|
+
export interface MemoryEntry {
|
|
208
|
+
id: string;
|
|
209
|
+
type: MemoryType;
|
|
210
|
+
content: string;
|
|
211
|
+
tags?: string[];
|
|
212
|
+
created: string;
|
|
213
|
+
ttl?: number;
|
|
214
|
+
priority?: number;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/** Input for the `store_memory` MCP tool. */
|
|
218
|
+
export interface StoreMemoryInput {
|
|
219
|
+
type: MemoryType;
|
|
220
|
+
content: string;
|
|
221
|
+
tags?: string[];
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/** Input for the `recall_memory` MCP tool. */
|
|
225
|
+
export interface RecallMemoryInput {
|
|
226
|
+
query: string;
|
|
227
|
+
budget?: number;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/** Input for the `search_case_law` MCP tool. */
|
|
231
|
+
export interface SearchCaseLawInput {
|
|
232
|
+
query: string;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/** Input for the `get_tribunal_agent` MCP tool. */
|
|
236
|
+
export interface GetAgentInput {
|
|
237
|
+
name: string;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/** Input for the `get_tribunal_skill` MCP tool. */
|
|
241
|
+
export interface GetSkillInput {
|
|
242
|
+
name: string;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/** Input for the `get_sparse_context` MCP tool. */
|
|
246
|
+
export interface GetSparseContextInput {
|
|
247
|
+
task: string;
|
|
248
|
+
files?: string[];
|
|
249
|
+
model?: 'large' | 'small';
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/** Input for the `align_output` MCP tool. */
|
|
253
|
+
export interface AlignOutputInput {
|
|
254
|
+
text: string;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/** MCP tool call result content. */
|
|
258
|
+
export interface McpTextContent {
|
|
259
|
+
type: 'text';
|
|
260
|
+
text: string;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/** MCP tool call result. */
|
|
264
|
+
export interface McpToolResult {
|
|
265
|
+
content: McpTextContent[];
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/** Names of all MCP tools exposed by tribunal-kit. */
|
|
269
|
+
export type McpToolName =
|
|
270
|
+
| 'run_tribunal_audit'
|
|
271
|
+
| 'sync_ide_bridges'
|
|
272
|
+
| 'search_case_law'
|
|
273
|
+
| 'list_tribunal_agents'
|
|
274
|
+
| 'get_tribunal_agent'
|
|
275
|
+
| 'list_tribunal_skills'
|
|
276
|
+
| 'get_tribunal_skill'
|
|
277
|
+
| 'recall_memory'
|
|
278
|
+
| 'store_memory'
|
|
279
|
+
| 'get_sparse_context'
|
|
280
|
+
| 'align_output';
|
|
281
|
+
|
|
282
|
+
// ── Main Entry Point ─────────────────────────────────────────────────────────
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* The main CLI entry point. Parses `process.argv` and routes to the
|
|
286
|
+
* appropriate command handler.
|
|
287
|
+
*/
|
|
288
|
+
export function main(): Promise<void>;
|
package/dist/utils/helpers.js
CHANGED
|
@@ -48,8 +48,19 @@ function banner(quiet) {
|
|
|
48
48
|
console.log();
|
|
49
49
|
for (const line of art) {
|
|
50
50
|
let gradientLine = ' \x1b[1m';
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
const len = line.length;
|
|
52
|
+
for (let i = 0; i < len; i++) {
|
|
53
|
+
const char = line[i];
|
|
54
|
+
if (char === ' ') {
|
|
55
|
+
gradientLine += ' ';
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
// Horizontal gradient: flame red (left) to coral/orange (right)
|
|
59
|
+
const ratio = i / len;
|
|
60
|
+
const r = 255;
|
|
61
|
+
const g = Math.floor(30 + ratio * 100);
|
|
62
|
+
const b = Math.floor(60 - ratio * 40);
|
|
63
|
+
gradientLine += `\x1b[38;2;${r};${g};${b}m${char}`;
|
|
53
64
|
}
|
|
54
65
|
gradientLine += '\x1b[0m';
|
|
55
66
|
(0, logger_1.log)(gradientLine);
|
|
@@ -57,12 +68,13 @@ function banner(quiet) {
|
|
|
57
68
|
console.log();
|
|
58
69
|
// Subtitle strip
|
|
59
70
|
const W = 84;
|
|
60
|
-
const
|
|
61
|
-
const
|
|
62
|
-
const
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
71
|
+
const plainSub = '🛡️ ANTI-HALLUCINATION AGENT SYSTEM';
|
|
72
|
+
const coloredSub = `${(0, logger_1.bold)((0, logger_1.c)('white', '🛡️ ANTI-HALLUCINATION AGENT SYSTEM'))}`;
|
|
73
|
+
const sp = Math.max(0, W - plainSub.length);
|
|
74
|
+
const centred = ' '.repeat(Math.floor(sp / 2)) + coloredSub + ' '.repeat(Math.ceil(sp / 2));
|
|
75
|
+
(0, logger_1.log)(` ${(0, logger_1.c)('gray', `✦ ${'━'.repeat(W - 6)} ✦`)}`);
|
|
76
|
+
(0, logger_1.log)(` ${centred}`);
|
|
77
|
+
(0, logger_1.log)(` ${(0, logger_1.c)('gray', `✦ ${'━'.repeat(W - 6)} ✦`)}`);
|
|
67
78
|
console.log();
|
|
68
79
|
}
|
|
80
|
+
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tribunal-kit",
|
|
3
|
-
"version": "5.8.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "5.8.3",
|
|
4
|
+
"description": "The operating system for AI software engineering — governance, memory, review pipelines, and reusable skills for every coding agent. 43 specialist agents, 34 workflows, 20 parallel Tribunal code reviewers, MCP server, Rust core engine, and long-running autonomous agent harness for Cursor, VSCode, Windsurf, Claude Code, and Aider.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
7
7
|
"ai-agent",
|
|
@@ -51,6 +51,16 @@
|
|
|
51
51
|
"url": "git+https://github.com/Harmitx7/tribunal-kit.git"
|
|
52
52
|
},
|
|
53
53
|
"license": "MIT",
|
|
54
|
+
"types": "dist/index.d.ts",
|
|
55
|
+
"main": "dist/cli.js",
|
|
56
|
+
"exports": {
|
|
57
|
+
".": {
|
|
58
|
+
"types": "./dist/index.d.ts",
|
|
59
|
+
"import": "./dist/esm/index.mjs",
|
|
60
|
+
"require": "./dist/cli.js"
|
|
61
|
+
},
|
|
62
|
+
"./package.json": "./package.json"
|
|
63
|
+
},
|
|
54
64
|
"bin": {
|
|
55
65
|
"tribunal-kit": "bin/wrapper.js",
|
|
56
66
|
"tk": "bin/wrapper.js"
|
|
@@ -62,6 +72,8 @@
|
|
|
62
72
|
".agent/",
|
|
63
73
|
"README.md",
|
|
64
74
|
"LICENSE",
|
|
75
|
+
"SECURITY.md",
|
|
76
|
+
"CONTRIBUTING.md",
|
|
65
77
|
"mcp_config.json"
|
|
66
78
|
],
|
|
67
79
|
"engines": {
|
|
@@ -87,12 +99,12 @@
|
|
|
87
99
|
"typescript": "^5.4.5"
|
|
88
100
|
},
|
|
89
101
|
"optionalDependencies": {
|
|
90
|
-
"@tribunal-kit/core-darwin-arm64": "^5.8.
|
|
91
|
-
"@tribunal-kit/core-darwin-x64": "^5.8.
|
|
92
|
-
"@tribunal-kit/core-linux-arm64": "^5.8.
|
|
93
|
-
"@tribunal-kit/core-linux-x64": "^5.8.
|
|
94
|
-
"@tribunal-kit/core-win32-arm64": "^5.8.
|
|
95
|
-
"@tribunal-kit/core-win32-x64": "^5.8.
|
|
102
|
+
"@tribunal-kit/core-darwin-arm64": "^5.8.3",
|
|
103
|
+
"@tribunal-kit/core-darwin-x64": "^5.8.3",
|
|
104
|
+
"@tribunal-kit/core-linux-arm64": "^5.8.3",
|
|
105
|
+
"@tribunal-kit/core-linux-x64": "^5.8.3",
|
|
106
|
+
"@tribunal-kit/core-win32-arm64": "^5.8.3",
|
|
107
|
+
"@tribunal-kit/core-win32-x64": "^5.8.3"
|
|
96
108
|
},
|
|
97
109
|
"jest": {
|
|
98
110
|
"testMatch": [
|