tribunal-kit 5.8.1 → 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/history/memory/.memory.idx +305 -1
- package/.agent/history/memory/MEMORY.md +21 -1
- package/.agent/scripts/signal_detector.js +173 -0
- package/.agent/scripts/skill_evolution.js +298 -53
- 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/bin/tribunal-kit.js
CHANGED
|
@@ -158,6 +158,34 @@ function parseArgs(argv) {
|
|
|
158
158
|
if (arg.startsWith("--branch=")) {
|
|
159
159
|
args.flags.branch = arg.split("=").slice(1).join("=");
|
|
160
160
|
}
|
|
161
|
+
if (arg.startsWith("--log=")) {
|
|
162
|
+
args.flags.log = arg.split("=").slice(1).join("=");
|
|
163
|
+
}
|
|
164
|
+
if (arg === "--log") {
|
|
165
|
+
const idx = raw.indexOf("--log");
|
|
166
|
+
const nextVal = raw[idx + 1];
|
|
167
|
+
if (!nextVal || nextVal.startsWith("--")) {
|
|
168
|
+
console.error(
|
|
169
|
+
` \x1b[91m✖ --log requires a file path argument\x1b[0m`,
|
|
170
|
+
);
|
|
171
|
+
process.exit(1);
|
|
172
|
+
}
|
|
173
|
+
args.flags.log = nextVal;
|
|
174
|
+
}
|
|
175
|
+
if (arg.startsWith("--strategy=")) {
|
|
176
|
+
args.flags.strategy = arg.split("=").slice(1).join("=");
|
|
177
|
+
}
|
|
178
|
+
if (arg === "--strategy") {
|
|
179
|
+
const idx = raw.indexOf("--strategy");
|
|
180
|
+
const nextVal = raw[idx + 1];
|
|
181
|
+
if (!nextVal || nextVal.startsWith("--")) {
|
|
182
|
+
console.error(
|
|
183
|
+
` \x1b[91m✖ --strategy requires a strategy value (balanced/harden/repair-only)\x1b[0m`,
|
|
184
|
+
);
|
|
185
|
+
process.exit(1);
|
|
186
|
+
}
|
|
187
|
+
args.flags.strategy = nextVal;
|
|
188
|
+
}
|
|
161
189
|
}
|
|
162
190
|
|
|
163
191
|
return args;
|
|
@@ -412,8 +440,19 @@ function banner() {
|
|
|
412
440
|
const _maxLen = Math.max(...art.map((line) => line.length));
|
|
413
441
|
for (const line of art) {
|
|
414
442
|
let gradientLine = " " + C.bold;
|
|
415
|
-
|
|
416
|
-
|
|
443
|
+
const len = line.length;
|
|
444
|
+
for (let i = 0; i < len; i++) {
|
|
445
|
+
const char = line[i];
|
|
446
|
+
if (char === ' ') {
|
|
447
|
+
gradientLine += ' ';
|
|
448
|
+
continue;
|
|
449
|
+
}
|
|
450
|
+
// Horizontal gradient: flame red (left) to coral/orange (right)
|
|
451
|
+
const ratio = i / len;
|
|
452
|
+
const r = 255;
|
|
453
|
+
const g = Math.floor(30 + ratio * 100);
|
|
454
|
+
const b = Math.floor(60 - ratio * 40);
|
|
455
|
+
gradientLine += `\x1b[38;2;${r};${g};${b}m${char}`;
|
|
417
456
|
}
|
|
418
457
|
gradientLine += C.reset;
|
|
419
458
|
log(gradientLine);
|
|
@@ -421,16 +460,13 @@ function banner() {
|
|
|
421
460
|
console.log();
|
|
422
461
|
// Subtitle strip
|
|
423
462
|
const W = 84;
|
|
424
|
-
const
|
|
425
|
-
const
|
|
426
|
-
const
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
` ${RED_ANSI}║${C.reset}${c("gray", centred)}${RED_ANSI}║${C.reset}`,
|
|
432
|
-
);
|
|
433
|
-
console.log(` ${RED_ANSI}╚${"═".repeat(W)}╝${C.reset}`);
|
|
463
|
+
const plainSub = '🛡️ ANTI-HALLUCINATION AGENT SYSTEM';
|
|
464
|
+
const coloredSub = `${bold(c('white', '🛡️ ANTI-HALLUCINATION AGENT SYSTEM'))}`;
|
|
465
|
+
const sp = Math.max(0, W - plainSub.length);
|
|
466
|
+
const centred = ' '.repeat(Math.floor(sp / 2)) + coloredSub + ' '.repeat(Math.ceil(sp / 2));
|
|
467
|
+
log(` ${c('gray', `✦ ${'━'.repeat(W - 6)} ✦`)}`);
|
|
468
|
+
log(` ${centred}`);
|
|
469
|
+
log(` ${c('gray', `✦ ${'━'.repeat(W - 6)} ✦`)}`);
|
|
434
470
|
console.log();
|
|
435
471
|
}
|
|
436
472
|
|
|
@@ -560,6 +596,7 @@ async function cmdInit(flags) {
|
|
|
560
596
|
} else {
|
|
561
597
|
// ── Success card — W=62, rows padded by plain-text length ──
|
|
562
598
|
const W = 62;
|
|
599
|
+
const borderCol = "red";
|
|
563
600
|
const agentsCount = fs.readdirSync(path.join(agentDest, "agents")).length;
|
|
564
601
|
const workflowsCount = fs.readdirSync(
|
|
565
602
|
path.join(agentDest, "workflows"),
|
|
@@ -569,23 +606,28 @@ async function cmdInit(flags) {
|
|
|
569
606
|
path.join(agentDest, "scripts"),
|
|
570
607
|
).length;
|
|
571
608
|
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
const plain = ` ${icon} ${label.padEnd(10)}${String(val).padStart(3)} installed`;
|
|
576
|
-
const trail = " ".repeat(Math.max(0, W - plain.length));
|
|
577
|
-
return ` ${c("cyan", "║")} ${icon} ${c("white", label.padEnd(10))}${c(col, String(val).padStart(3))} ${c("gray", "installed")}${trail}${c("cyan", "║")}`;
|
|
609
|
+
const drawRow = (plainText, styledText) => {
|
|
610
|
+
const trail = " ".repeat(Math.max(0, W - plainText.length));
|
|
611
|
+
return ` ${c(borderCol, "│")}${styledText}${trail}${c(borderCol, "│")}`;
|
|
578
612
|
};
|
|
579
|
-
|
|
580
|
-
const
|
|
581
|
-
const
|
|
582
|
-
|
|
613
|
+
|
|
614
|
+
const compRow = (icon, label, count, color) => {
|
|
615
|
+
const leftPlain = ` ${icon} ${label.padEnd(10)} `;
|
|
616
|
+
const rightPlain = ` [ ${String(count).padStart(3)} ]`;
|
|
617
|
+
const numDots = W - leftPlain.length - rightPlain.length - 4; // 4 spaces margin
|
|
618
|
+
const dots = ".".repeat(Math.max(0, numDots));
|
|
619
|
+
|
|
620
|
+
const plain = `${leftPlain}${dots}${rightPlain}`;
|
|
621
|
+
const styled = ` ${icon} ${c("white", label.padEnd(10))} ${c("gray", dots)} ${c("gray", "[")} ${c(color, String(count).padStart(3))} ${c("gray", "]")}`;
|
|
622
|
+
return drawRow(plain, styled);
|
|
583
623
|
};
|
|
584
|
-
|
|
624
|
+
|
|
585
625
|
const stepRow = (cmd, desc) => {
|
|
586
|
-
const
|
|
587
|
-
const
|
|
588
|
-
|
|
626
|
+
const leftPlain = ` ${cmd.padEnd(16)}`;
|
|
627
|
+
const rightPlain = `▸ ${desc}`;
|
|
628
|
+
const plain = `${leftPlain}${rightPlain}`;
|
|
629
|
+
const styled = ` ${c("white", cmd.padEnd(16))}${c("gray", "▸")} ${c("gray", desc)}`;
|
|
630
|
+
return drawRow(plain, styled);
|
|
589
631
|
};
|
|
590
632
|
|
|
591
633
|
console.log(
|
|
@@ -593,27 +635,25 @@ async function cmdInit(flags) {
|
|
|
593
635
|
);
|
|
594
636
|
console.log(` ${c("gray", " ╰─")} ${c("gray", agentDest)}`);
|
|
595
637
|
console.log();
|
|
596
|
-
console.log(` ${c(
|
|
597
|
-
console.log(
|
|
598
|
-
|
|
599
|
-
);
|
|
600
|
-
console.log(
|
|
601
|
-
console.log(
|
|
602
|
-
console.log(
|
|
603
|
-
console.log(
|
|
604
|
-
console.log(
|
|
605
|
-
console.log(
|
|
606
|
-
console.log(
|
|
607
|
-
console.log(
|
|
608
|
-
console.log(
|
|
609
|
-
|
|
610
|
-
);
|
|
638
|
+
console.log(` ${c(borderCol, "┌" + "─".repeat(W) + "┐")}`);
|
|
639
|
+
console.log(drawRow(" TRIBUNAL ENVIRONMENT SYNCHRONIZED", `${bold(c("white", " TRIBUNAL ENVIRONMENT SYNCHRONIZED"))}`));
|
|
640
|
+
console.log(` ${c(borderCol, "├" + "─".repeat(W) + "┤")}`);
|
|
641
|
+
console.log(drawRow(" Guarding: Active & Enforcing", `${c("gray", " Guarding:")} ${c("green", "Active & Enforcing")}`));
|
|
642
|
+
console.log(drawRow(" Manifest: Verified", `${c("gray", " Manifest:")} ${c("cyan", "Verified")}`));
|
|
643
|
+
console.log(drawRow("", ""));
|
|
644
|
+
console.log(drawRow(" Installed Components:", bold(c("white", " Installed Components:"))));
|
|
645
|
+
console.log(compRow("🤖", "Agents", agentsCount, "magenta"));
|
|
646
|
+
console.log(compRow("⚡", "Workflows", workflowsCount, "yellow"));
|
|
647
|
+
console.log(compRow("🧠", "Skills", skillsCount, "blue"));
|
|
648
|
+
console.log(compRow("🔧", "Scripts", scriptsCount, "green"));
|
|
649
|
+
console.log(` ${c(borderCol, "├" + "─".repeat(W) + "┤")}`);
|
|
650
|
+
console.log(drawRow("", ""));
|
|
651
|
+
console.log(drawRow(" Next Steps:", c("gray", " Next Steps:")));
|
|
652
|
+
console.log(stepRow("/generate", "Generate code with reviews"));
|
|
611
653
|
console.log(stepRow("/review", "Audit existing code for issues"));
|
|
612
|
-
console.log(
|
|
613
|
-
|
|
614
|
-
);
|
|
615
|
-
console.log(plainRow("", () => ""));
|
|
616
|
-
console.log(` ${c("cyan", "╚" + "═".repeat(W) + "╝")}`);
|
|
654
|
+
console.log(stepRow("/tribunal-full", "Run all 20 reviewers in parallel"));
|
|
655
|
+
console.log(drawRow("", ""));
|
|
656
|
+
console.log(` ${c(borderCol, "└" + "─".repeat(W) + "┘")}`);
|
|
617
657
|
console.log();
|
|
618
658
|
log(` ${c("gray", "✦ Updating .gitignore...")}`);
|
|
619
659
|
await updateGitignore(targetDir, dryRun);
|
|
@@ -912,6 +952,8 @@ async function cmdLearn(flags) {
|
|
|
912
952
|
const evoArgs = ["digest"];
|
|
913
953
|
if (flags.dryRun) evoArgs.push("--dry-run");
|
|
914
954
|
if (flags.head) evoArgs.push("--head");
|
|
955
|
+
if (flags.log) evoArgs.push(`--log=${flags.log}`);
|
|
956
|
+
if (flags.strategy) evoArgs.push(`--strategy=${flags.strategy}`);
|
|
915
957
|
|
|
916
958
|
// Phase 1: Skill Evolution
|
|
917
959
|
log(
|
|
@@ -1287,6 +1329,8 @@ function cmdHelp() {
|
|
|
1287
1329
|
log(opt("--minimal", "Install core agents/skills only (~13 agents)"));
|
|
1288
1330
|
log(opt("--skip-update-check", "Skip auto-update version check"));
|
|
1289
1331
|
log(opt("--head", "(learn) Diff against last commit instead of staged"));
|
|
1332
|
+
log(opt("--log <file>", "(learn) Extract signals and evolve from a log/transcript file"));
|
|
1333
|
+
log(opt("--strategy <val>", "(learn) Evolution strategy: balanced, harden, repair-only"));
|
|
1290
1334
|
console.log();
|
|
1291
1335
|
log(bold(" Aliases"));
|
|
1292
1336
|
log(` ${c("gray", "─".repeat(40))}`);
|
|
@@ -1305,6 +1349,8 @@ function cmdHelp() {
|
|
|
1305
1349
|
log(ex("tk learn"));
|
|
1306
1350
|
log(ex("tk learn --dry-run"));
|
|
1307
1351
|
log(ex("tk learn --head"));
|
|
1352
|
+
log(ex("tk learn --log=run.log"));
|
|
1353
|
+
log(ex("tk learn --log=eslint.log --strategy=harden"));
|
|
1308
1354
|
log(ex("tk case add"));
|
|
1309
1355
|
log(ex('tk case search "useEffect"'));
|
|
1310
1356
|
log(ex("tk case list"));
|
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
|
+
}
|