tribunal-kit 5.7.0 → 5.8.1

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 (59) hide show
  1. package/.agent/ARCHITECTURE.md +6 -7
  2. package/.agent/agents/frontend-reviewer.md +13 -0
  3. package/.agent/agents/frontend-specialist.md +14 -0
  4. package/.agent/agents/logic-reviewer.md +11 -0
  5. package/.agent/agents/orchestrator.md +15 -0
  6. package/.agent/agents/project-planner.md +5 -0
  7. package/.agent/agents/security-auditor.md +13 -0
  8. package/.agent/agents/ui-ux-auditor.md +7 -31
  9. package/.agent/history/memory/.memory.idx +1693 -0
  10. package/.agent/history/memory/MEMORY.md +123 -0
  11. package/.agent/routing_index.json +694 -714
  12. package/.agent/rules/GEMINI.md +88 -13
  13. package/.agent/scripts/_colors.js +131 -89
  14. package/.agent/scripts/_utils.js +163 -128
  15. package/.agent/scripts/auto_preview.js +207 -197
  16. package/.agent/scripts/bundle_analyzer.js +227 -192
  17. package/.agent/scripts/case_law_manager.js +991 -689
  18. package/.agent/scripts/checklist.js +233 -190
  19. package/.agent/scripts/context_broker.js +930 -605
  20. package/.agent/scripts/dependency_analyzer.js +275 -184
  21. package/.agent/scripts/graph_builder.js +412 -341
  22. package/.agent/scripts/graph_visualizer.js +392 -390
  23. package/.agent/scripts/graph_zoom.js +198 -156
  24. package/.agent/scripts/inner_loop_validator.js +523 -445
  25. package/.agent/scripts/lint_runner.js +199 -157
  26. package/.agent/scripts/marathon_harness.js +819 -661
  27. package/.agent/scripts/minify_context.js +115 -100
  28. package/.agent/scripts/mutation_runner.js +321 -280
  29. package/.agent/scripts/prompt_compiler.js +62 -42
  30. package/.agent/scripts/schema_validator.js +373 -280
  31. package/.agent/scripts/security_scan.js +333 -190
  32. package/.agent/scripts/session_manager.js +306 -270
  33. package/.agent/scripts/skill_evolution.js +810 -637
  34. package/.agent/scripts/skill_integrator.js +327 -307
  35. package/.agent/scripts/strengthen_skills.js +203 -193
  36. package/.agent/scripts/swarm_dispatcher.js +558 -457
  37. package/.agent/scripts/test_runner.js +178 -152
  38. package/.agent/scripts/verify_all.js +200 -168
  39. package/.agent/skills/fabel-protocol/SKILL.md +271 -0
  40. package/.agent/skills/thinking-protocol/SKILL.md +27 -0
  41. package/.agent/workflows/generate.md +2 -1
  42. package/.agent/workflows/tribunal-full.md +4 -3
  43. package/.agent/workflows/tribunal-speed.md +1 -1
  44. package/README.md +184 -58
  45. package/bin/mcp-server.js +496 -173
  46. package/bin/tribunal-kit.js +1245 -987
  47. package/bin/wrapper.js +108 -74
  48. package/dist/cli.js +44 -0
  49. package/dist/commands/align.js +201 -0
  50. package/dist/commands/case.js +23 -0
  51. package/dist/commands/compile.js +84 -0
  52. package/dist/commands/init.js +42 -0
  53. package/dist/commands/learn.js +57 -0
  54. package/dist/commands/memory.js +456 -0
  55. package/package.json +22 -10
  56. package/scripts/benchmark.js +162 -125
  57. package/scripts/changelog.js +196 -168
  58. package/scripts/sync-version.js +94 -81
  59. package/scripts/validate-payload.js +85 -78
@@ -1,78 +1,85 @@
1
- const fs = require('fs');
2
- const path = require('path');
3
-
4
- // Simple Markdown frontmatter and Tribunal header validator
5
- function validateMarkdownFile(filePath) {
6
- let content;
7
- try {
8
- content = fs.readFileSync(filePath, 'utf8');
9
- } catch (e) {
10
- return [`Failed to read file: ${e.message}`];
11
- }
12
- let errors = [];
13
-
14
- // Check for frontmatter
15
- if (content.startsWith('---')) {
16
- const parts = content.split('---');
17
- if (parts.length < 3) {
18
- errors.push('Malformed YAML frontmatter (missing closing ---)');
19
- }
20
- }
21
-
22
- // If it's a skill, check for mandatory headers
23
- if (filePath.includes('/skills/') || filePath.includes('\\skills\\')) {
24
- // Exclude templates and documentation that aren't strict skills
25
- if (!filePath.includes('SKILL.md')) return errors;
26
-
27
- if (!content.includes('Pre-Flight Checklist') && !content.includes('Pre-Flight')) {
28
- errors.push('Missing mandatory header/section: Pre-Flight Checklist');
29
- }
30
- if (!content.includes('VBC Protocol') && !content.includes('VBC')) {
31
- errors.push('Missing mandatory header/section: VBC Protocol');
32
- }
33
- }
34
-
35
- return errors;
36
- }
37
-
38
- function walkDir(dir, callback) {
39
- fs.readdirSync(dir).forEach(f => {
40
- let dirPath = path.join(dir, f);
41
- let isDirectory = fs.statSync(dirPath).isDirectory();
42
- isDirectory ? walkDir(dirPath, callback) : callback(path.join(dir, f));
43
- });
44
- }
45
-
46
- function run() {
47
- const agentDir = path.join(__dirname, '..', '.agent');
48
- if (!fs.existsSync(agentDir)) {
49
- console.error('No .agent directory found.');
50
- process.exit(1);
51
- }
52
-
53
- let hasErrors = false;
54
- let checkedCount = 0;
55
-
56
- console.log('Validating .agent payload...');
57
-
58
- walkDir(agentDir, function(filePath) {
59
- if (filePath.endsWith('.md')) {
60
- checkedCount++;
61
- const errors = validateMarkdownFile(filePath);
62
- if (errors.length > 0) {
63
- console.error(`\x1b[31m[FAIL]\x1b[0m ${filePath}`);
64
- errors.forEach(e => console.error(` - ${e}`));
65
- hasErrors = true;
66
- }
67
- }
68
- });
69
-
70
- if (hasErrors) {
71
- console.error(`\nPayload validation failed. Checked ${checkedCount} files.`);
72
- process.exit(1);
73
- } else {
74
- console.log(`\x1b[32mPayload validation passed.\x1b[0m Checked ${checkedCount} files.`);
75
- }
76
- }
77
-
78
- run();
1
+ const fs = require("fs");
2
+ const path = require("path");
3
+
4
+ // Simple Markdown frontmatter and Tribunal header validator
5
+ function validateMarkdownFile(filePath) {
6
+ let content;
7
+ try {
8
+ content = fs.readFileSync(filePath, "utf8");
9
+ } catch (e) {
10
+ return [`Failed to read file: ${e.message}`];
11
+ }
12
+ let errors = [];
13
+
14
+ // Check for frontmatter
15
+ if (content.startsWith("---")) {
16
+ const parts = content.split("---");
17
+ if (parts.length < 3) {
18
+ errors.push("Malformed YAML frontmatter (missing closing ---)");
19
+ }
20
+ }
21
+
22
+ // If it's a skill, check for mandatory headers
23
+ if (filePath.includes("/skills/") || filePath.includes("\\skills\\")) {
24
+ // Exclude templates and documentation that aren't strict skills
25
+ if (!filePath.includes("SKILL.md")) return errors;
26
+
27
+ if (
28
+ !content.includes("Pre-Flight Checklist") &&
29
+ !content.includes("Pre-Flight")
30
+ ) {
31
+ errors.push("Missing mandatory header/section: Pre-Flight Checklist");
32
+ }
33
+ if (!content.includes("VBC Protocol") && !content.includes("VBC")) {
34
+ errors.push("Missing mandatory header/section: VBC Protocol");
35
+ }
36
+ }
37
+
38
+ return errors;
39
+ }
40
+
41
+ function walkDir(dir, callback) {
42
+ fs.readdirSync(dir).forEach((f) => {
43
+ let dirPath = path.join(dir, f);
44
+ let isDirectory = fs.statSync(dirPath).isDirectory();
45
+ isDirectory ? walkDir(dirPath, callback) : callback(path.join(dir, f));
46
+ });
47
+ }
48
+
49
+ function run() {
50
+ const agentDir = path.join(__dirname, "..", ".agent");
51
+ if (!fs.existsSync(agentDir)) {
52
+ console.error("No .agent directory found.");
53
+ process.exit(1);
54
+ }
55
+
56
+ let hasErrors = false;
57
+ let checkedCount = 0;
58
+
59
+ console.log("Validating .agent payload...");
60
+
61
+ walkDir(agentDir, function (filePath) {
62
+ if (filePath.endsWith(".md")) {
63
+ checkedCount++;
64
+ const errors = validateMarkdownFile(filePath);
65
+ if (errors.length > 0) {
66
+ console.error(`\x1b[31m[FAIL]\x1b[0m ${filePath}`);
67
+ errors.forEach((e) => console.error(` - ${e}`));
68
+ hasErrors = true;
69
+ }
70
+ }
71
+ });
72
+
73
+ if (hasErrors) {
74
+ console.error(
75
+ `\nPayload validation failed. Checked ${checkedCount} files.`,
76
+ );
77
+ process.exit(1);
78
+ } else {
79
+ console.log(
80
+ `\x1b[32mPayload validation passed.\x1b[0m Checked ${checkedCount} files.`,
81
+ );
82
+ }
83
+ }
84
+
85
+ run();