tribunal-kit 5.7.0 → 5.8.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.
- package/.agent/ARCHITECTURE.md +6 -7
- package/.agent/agents/frontend-reviewer.md +13 -0
- package/.agent/agents/frontend-specialist.md +14 -0
- package/.agent/agents/logic-reviewer.md +11 -0
- package/.agent/agents/orchestrator.md +15 -0
- package/.agent/agents/security-auditor.md +13 -0
- package/.agent/agents/ui-ux-auditor.md +7 -31
- package/.agent/history/memory/.memory.idx +766 -0
- package/.agent/history/memory/MEMORY.md +62 -0
- package/.agent/routing_index.json +694 -714
- package/.agent/rules/GEMINI.md +58 -8
- package/.agent/scripts/_colors.js +131 -89
- package/.agent/scripts/_utils.js +163 -128
- package/.agent/scripts/auto_preview.js +207 -197
- package/.agent/scripts/bundle_analyzer.js +227 -192
- package/.agent/scripts/case_law_manager.js +991 -689
- package/.agent/scripts/checklist.js +233 -190
- package/.agent/scripts/context_broker.js +930 -605
- package/.agent/scripts/dependency_analyzer.js +275 -184
- package/.agent/scripts/graph_builder.js +412 -341
- package/.agent/scripts/graph_visualizer.js +392 -390
- package/.agent/scripts/graph_zoom.js +198 -156
- package/.agent/scripts/inner_loop_validator.js +523 -445
- package/.agent/scripts/lint_runner.js +199 -157
- package/.agent/scripts/marathon_harness.js +819 -661
- package/.agent/scripts/minify_context.js +115 -100
- package/.agent/scripts/mutation_runner.js +321 -280
- package/.agent/scripts/prompt_compiler.js +62 -42
- package/.agent/scripts/schema_validator.js +373 -280
- package/.agent/scripts/security_scan.js +333 -190
- package/.agent/scripts/session_manager.js +306 -270
- package/.agent/scripts/skill_evolution.js +810 -637
- package/.agent/scripts/skill_integrator.js +327 -307
- package/.agent/scripts/strengthen_skills.js +203 -193
- package/.agent/scripts/swarm_dispatcher.js +558 -457
- package/.agent/scripts/test_runner.js +178 -152
- package/.agent/scripts/verify_all.js +200 -168
- package/.agent/skills/fabel-protocol/SKILL.md +235 -0
- package/.agent/skills/thinking-protocol/SKILL.md +27 -0
- package/.agent/workflows/generate.md +1 -1
- package/.agent/workflows/tribunal-speed.md +1 -1
- package/README.md +53 -53
- package/bin/mcp-server.js +460 -175
- package/bin/tribunal-kit.js +1245 -987
- package/bin/wrapper.js +104 -74
- package/dist/cli.js +31 -0
- package/dist/commands/case.js +23 -0
- package/dist/commands/compile.js +84 -0
- package/dist/commands/init.js +42 -0
- package/dist/commands/learn.js +57 -0
- package/dist/commands/memory.js +456 -0
- package/package.json +2 -2
- package/scripts/benchmark.js +162 -125
- package/scripts/changelog.js +196 -168
- package/scripts/sync-version.js +94 -81
- package/scripts/validate-payload.js +85 -78
|
@@ -1,100 +1,115 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* minify_context.js
|
|
4
|
-
* Minifies markdown documentation in the .agent directory to save tokens.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const fs = require(
|
|
10
|
-
const path = require(
|
|
11
|
-
|
|
12
|
-
function minifyMarkdown(filePath) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* minify_context.js
|
|
4
|
+
* Minifies markdown documentation in the .agent directory to save tokens.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
"use strict";
|
|
8
|
+
|
|
9
|
+
const fs = require("fs");
|
|
10
|
+
const path = require("path");
|
|
11
|
+
|
|
12
|
+
function minifyMarkdown(filePath) {
|
|
13
|
+
let content = fs.readFileSync(filePath, "utf8");
|
|
14
|
+
const originalLen = content.length;
|
|
15
|
+
|
|
16
|
+
// 1. Strip repetitive Output Format templates
|
|
17
|
+
content = content.replace(/## Output Format\n\n```[\s\S]*?```\n/g, "");
|
|
18
|
+
|
|
19
|
+
// 2. Convert bloated Cross-Workflow Navigation tables to dense YAML lists
|
|
20
|
+
content = content.replace(
|
|
21
|
+
/## Cross-Workflow Navigation\n\n\|.*?\|[\s\S]*?(?=\n## |\Z)/g,
|
|
22
|
+
(match) => {
|
|
23
|
+
const lines = match.trim().split("\n");
|
|
24
|
+
const out = [];
|
|
25
|
+
for (const line of lines) {
|
|
26
|
+
if (
|
|
27
|
+
line.startsWith("|") &&
|
|
28
|
+
!line.startsWith("|:") &&
|
|
29
|
+
!line.startsWith("| After")
|
|
30
|
+
) {
|
|
31
|
+
const parts = line
|
|
32
|
+
.split("|")
|
|
33
|
+
.map((p) => p.trim())
|
|
34
|
+
.filter(Boolean);
|
|
35
|
+
if (parts.length >= 2) {
|
|
36
|
+
out.push(`- ${parts[0]} -> ${parts[1]}`);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return "## Cross-Workflow Navigation\n" + out.join("\n") + "\n";
|
|
41
|
+
},
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
// 3. Collapse multiple empty lines into a single one
|
|
45
|
+
content = content.replace(/\n{3,}/g, "\n\n");
|
|
46
|
+
|
|
47
|
+
// 4. Remove padding from remaining tables to save space tokens
|
|
48
|
+
content = content.replace(/^\|.+|$/gm, (match) => {
|
|
49
|
+
let line = match;
|
|
50
|
+
// remove spaces around |
|
|
51
|
+
line = line.replace(/\s+\|\s+/g, "|");
|
|
52
|
+
line = line.replace(/\|\s+/g, "|");
|
|
53
|
+
line = line.replace(/\s+\|/g, "|");
|
|
54
|
+
return line;
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
// 5. Remove conversational blockquotes > if they don't contain WARNING/NOTE/IMPORTANT
|
|
58
|
+
content = content.replace(/^>.*$/gm, (match) => {
|
|
59
|
+
if (
|
|
60
|
+
match.includes("⚠️") ||
|
|
61
|
+
match.includes("WARNING") ||
|
|
62
|
+
match.includes("CRITICAL") ||
|
|
63
|
+
match.includes("!")
|
|
64
|
+
) {
|
|
65
|
+
return match;
|
|
66
|
+
}
|
|
67
|
+
return match.replace(/> /g, "").replace(/>/g, "");
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
// 6. Dense Examples (convert ❌ Bad: and ✅ Good: blocks to single lines)
|
|
71
|
+
content = content.replace(/\n❌ Bad:/g, " ❌");
|
|
72
|
+
content = content.replace(/\n✅ Good:/g, " ✅");
|
|
73
|
+
|
|
74
|
+
fs.writeFileSync(filePath, content, "utf8");
|
|
75
|
+
return [originalLen, content.length];
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function walkDir(dir, callback) {
|
|
79
|
+
if (!fs.existsSync(dir)) return;
|
|
80
|
+
const items = fs.readdirSync(dir, { withFileTypes: true });
|
|
81
|
+
for (const item of items) {
|
|
82
|
+
const fullPath = path.join(dir, item.name);
|
|
83
|
+
if (item.isDirectory()) {
|
|
84
|
+
walkDir(fullPath, callback);
|
|
85
|
+
} else {
|
|
86
|
+
callback(fullPath);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function main() {
|
|
92
|
+
const agentDir = path.join(".agent");
|
|
93
|
+
let totalOriginal = 0;
|
|
94
|
+
let totalNew = 0;
|
|
95
|
+
|
|
96
|
+
walkDir(agentDir, (file) => {
|
|
97
|
+
if (file.endsWith(".md")) {
|
|
98
|
+
const [orig, newLen] = minifyMarkdown(file);
|
|
99
|
+
totalOriginal += orig;
|
|
100
|
+
totalNew += newLen;
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
const saved = totalOriginal - totalNew;
|
|
105
|
+
const percent = totalOriginal > 0 ? (saved / totalOriginal) * 100 : 0;
|
|
106
|
+
|
|
107
|
+
console.log("Minification Complete.");
|
|
108
|
+
console.log(`Original size: ${totalOriginal} bytes`);
|
|
109
|
+
console.log(`New size: ${totalNew} bytes`);
|
|
110
|
+
console.log(`Saved: ${saved} bytes (${percent.toFixed(1)}%)`);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
if (require.main === module) {
|
|
114
|
+
main();
|
|
115
|
+
}
|