tribunal-kit 5.8.0 → 5.8.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/.agent/agents/project-planner.md +5 -0
- package/.agent/history/memory/.memory.idx +1232 -1
- package/.agent/history/memory/MEMORY.md +82 -1
- package/.agent/rules/GEMINI.md +30 -5
- package/.agent/scripts/signal_detector.js +173 -0
- package/.agent/scripts/skill_evolution.js +298 -53
- package/.agent/skills/fabel-protocol/SKILL.md +37 -1
- package/.agent/workflows/generate.md +1 -0
- package/.agent/workflows/tribunal-full.md +4 -3
- package/CONTRIBUTING.md +134 -0
- package/README.md +138 -12
- package/SECURITY.md +52 -0
- package/bin/mcp-server.js +38 -0
- package/bin/tribunal-kit.js +92 -46
- package/bin/wrapper.js +5 -1
- package/dist/cli.js +13 -0
- package/dist/commands/align.js +201 -0
- 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 +33 -9
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.2",
|
|
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",
|
|
@@ -33,7 +33,17 @@
|
|
|
33
33
|
"ai-coding",
|
|
34
34
|
"autonomous-agents",
|
|
35
35
|
"coding-assistant",
|
|
36
|
-
"automation"
|
|
36
|
+
"automation",
|
|
37
|
+
"model-context-protocol-server",
|
|
38
|
+
"mcp-server",
|
|
39
|
+
"claude-code",
|
|
40
|
+
"aider",
|
|
41
|
+
"cursor-rules-generator",
|
|
42
|
+
"agentic-ai",
|
|
43
|
+
"ai-code-reviewer",
|
|
44
|
+
"hallucination-mitigation",
|
|
45
|
+
"autonomous-workflows",
|
|
46
|
+
"code-correctness"
|
|
37
47
|
],
|
|
38
48
|
"homepage": "https://github.com/Harmitx7/tribunal-kit",
|
|
39
49
|
"repository": {
|
|
@@ -41,6 +51,16 @@
|
|
|
41
51
|
"url": "git+https://github.com/Harmitx7/tribunal-kit.git"
|
|
42
52
|
},
|
|
43
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
|
+
},
|
|
44
64
|
"bin": {
|
|
45
65
|
"tribunal-kit": "bin/wrapper.js",
|
|
46
66
|
"tk": "bin/wrapper.js"
|
|
@@ -52,6 +72,8 @@
|
|
|
52
72
|
".agent/",
|
|
53
73
|
"README.md",
|
|
54
74
|
"LICENSE",
|
|
75
|
+
"SECURITY.md",
|
|
76
|
+
"CONTRIBUTING.md",
|
|
55
77
|
"mcp_config.json"
|
|
56
78
|
],
|
|
57
79
|
"engines": {
|
|
@@ -67,6 +89,8 @@
|
|
|
67
89
|
"changelog:preview": "node scripts/changelog.js --preview",
|
|
68
90
|
"sync": "node scripts/sync-version.js",
|
|
69
91
|
"validate-payload": "node scripts/validate-payload.js",
|
|
92
|
+
"benchmark": "node scripts/benchmark.js",
|
|
93
|
+
"benchmark:rust": "cargo build --release && node scripts/benchmark.js",
|
|
70
94
|
"build": "echo 'No build step required for this project'"
|
|
71
95
|
},
|
|
72
96
|
"devDependencies": {
|
|
@@ -75,12 +99,12 @@
|
|
|
75
99
|
"typescript": "^5.4.5"
|
|
76
100
|
},
|
|
77
101
|
"optionalDependencies": {
|
|
78
|
-
"@tribunal-kit/core-darwin-arm64": "^
|
|
79
|
-
"@tribunal-kit/core-darwin-x64": "^
|
|
80
|
-
"@tribunal-kit/core-linux-arm64": "^
|
|
81
|
-
"@tribunal-kit/core-linux-x64": "^
|
|
82
|
-
"@tribunal-kit/core-win32-arm64": "^
|
|
83
|
-
"@tribunal-kit/core-win32-x64": "^
|
|
102
|
+
"@tribunal-kit/core-darwin-arm64": "^5.8.2",
|
|
103
|
+
"@tribunal-kit/core-darwin-x64": "^5.8.2",
|
|
104
|
+
"@tribunal-kit/core-linux-arm64": "^5.8.2",
|
|
105
|
+
"@tribunal-kit/core-linux-x64": "^5.8.2",
|
|
106
|
+
"@tribunal-kit/core-win32-arm64": "^5.8.2",
|
|
107
|
+
"@tribunal-kit/core-win32-x64": "^5.8.2"
|
|
84
108
|
},
|
|
85
109
|
"jest": {
|
|
86
110
|
"testMatch": [
|