ccjk 12.0.0 → 12.0.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/dist/chunks/agent-teams.mjs +17 -18
- package/dist/chunks/agent.mjs +105 -102
- package/dist/chunks/agents.mjs +87 -77
- package/dist/chunks/api-cli.mjs +41 -27
- package/dist/chunks/api-providers.mjs +2 -4
- package/dist/chunks/api.mjs +22 -11
- package/dist/chunks/auto-bootstrap.mjs +3 -5
- package/dist/chunks/auto-init.mjs +3 -4
- package/dist/chunks/auto-updater.mjs +103 -91
- package/dist/chunks/banner.mjs +41 -42
- package/dist/chunks/boost.mjs +30 -31
- package/dist/chunks/ccjk-agents.mjs +6 -9
- package/dist/chunks/ccjk-all.mjs +703 -85
- package/dist/chunks/ccjk-config.mjs +6 -6
- package/dist/chunks/ccjk-hooks.mjs +20 -9
- package/dist/chunks/ccjk-mcp.mjs +64 -52
- package/dist/chunks/ccjk-setup.mjs +35 -25
- package/dist/chunks/ccjk-skills.mjs +51 -41
- package/dist/chunks/ccr.mjs +42 -32
- package/dist/chunks/ccu.mjs +16 -12
- package/dist/chunks/check-updates.mjs +30 -19
- package/dist/chunks/claude-code-config-manager.mjs +25 -10
- package/dist/chunks/claude-code-incremental-manager.mjs +65 -51
- package/dist/chunks/claude-config.mjs +2 -2
- package/dist/chunks/claude-wrapper.mjs +9 -6
- package/dist/chunks/cleanup-migration.mjs +1 -1
- package/dist/chunks/cli-hook.mjs +10 -3
- package/dist/chunks/cloud-sync.mjs +1 -1
- package/dist/chunks/codex-config-switch.mjs +58 -45
- package/dist/chunks/codex-provider-manager.mjs +29 -16
- package/dist/chunks/codex-uninstaller.mjs +5 -6
- package/dist/chunks/codex.mjs +89 -89
- package/dist/chunks/commands.mjs +28 -29
- package/dist/chunks/commands2.mjs +4 -3
- package/dist/chunks/commit.mjs +42 -23
- package/dist/chunks/completion.mjs +46 -47
- package/dist/chunks/config-consolidator.mjs +12 -13
- package/dist/chunks/config-switch.mjs +66 -53
- package/dist/chunks/config.mjs +10 -10
- package/dist/chunks/config2.mjs +53 -42
- package/dist/chunks/config3.mjs +107 -93
- package/dist/chunks/constants.mjs +2 -4
- package/dist/chunks/context-loader.mjs +5 -4
- package/dist/chunks/context.mjs +77 -76
- package/dist/chunks/convoy-manager.mjs +4 -4
- package/dist/chunks/dashboard.mjs +28 -29
- package/dist/chunks/doctor.mjs +68 -54
- package/dist/chunks/evolution.mjs +37 -38
- package/dist/chunks/features.mjs +103 -92
- package/dist/chunks/fs-operations.mjs +1 -1
- package/dist/chunks/health-alerts.mjs +1 -1
- package/dist/chunks/health-check.mjs +1 -1
- package/dist/chunks/help.mjs +117 -116
- package/dist/chunks/hook-installer.mjs +3 -2
- package/dist/chunks/index.mjs +20 -6
- package/dist/chunks/index10.mjs +1171 -0
- package/dist/chunks/index11.mjs +1008 -0
- package/dist/chunks/index12.mjs +193 -0
- package/dist/chunks/index13.mjs +218 -0
- package/dist/chunks/index14.mjs +663 -0
- package/dist/chunks/index2.mjs +19 -10
- package/dist/chunks/index3.mjs +19079 -164
- package/dist/chunks/index4.mjs +8 -1171
- package/dist/chunks/index5.mjs +7479 -884
- package/dist/chunks/index6.mjs +160 -184
- package/dist/chunks/index7.mjs +3573 -653
- package/dist/chunks/index8.mjs +19 -0
- package/dist/chunks/index9.mjs +616 -0
- package/dist/chunks/init.mjs +173 -173
- package/dist/chunks/installer.mjs +92 -82
- package/dist/chunks/installer2.mjs +3 -2
- package/dist/chunks/interview.mjs +118 -107
- package/dist/chunks/json-config.mjs +3 -2
- package/dist/chunks/linux.mjs +3863 -0
- package/dist/chunks/macos.mjs +69 -0
- package/dist/chunks/main.mjs +635 -0
- package/dist/chunks/marketplace.mjs +69 -66
- package/dist/chunks/mcp-cli.mjs +61 -48
- package/dist/chunks/mcp.mjs +140 -127
- package/dist/chunks/menu.mjs +85 -85
- package/dist/chunks/metrics-display.mjs +41 -40
- package/dist/chunks/migrator.mjs +4 -5
- package/dist/chunks/monitor.mjs +95 -95
- package/dist/chunks/notification.mjs +151 -141
- package/dist/chunks/onboarding.mjs +26 -15
- package/dist/chunks/package.mjs +1 -1
- package/dist/chunks/paradigm.mjs +24 -23
- package/dist/chunks/permission-manager.mjs +10 -11
- package/dist/chunks/permissions.mjs +72 -57
- package/dist/chunks/persistence-manager.mjs +97 -84
- package/dist/chunks/persistence.mjs +1 -1
- package/dist/chunks/platform.mjs +29 -29
- package/dist/chunks/plugin.mjs +104 -105
- package/dist/chunks/prompts.mjs +36 -25
- package/dist/chunks/providers.mjs +68 -69
- package/dist/chunks/quick-actions.mjs +71 -72
- package/dist/chunks/quick-provider.mjs +56 -40
- package/dist/chunks/quick-setup.mjs +71 -60
- package/dist/chunks/remote.mjs +21 -12
- package/dist/chunks/session.mjs +116 -103
- package/dist/chunks/sessions.mjs +29 -28
- package/dist/chunks/silent-updater.mjs +8 -10
- package/dist/chunks/simple-config.mjs +13 -10
- package/dist/chunks/skill.mjs +8560 -103
- package/dist/chunks/skills-sync.mjs +5212 -79
- package/dist/chunks/skills.mjs +105 -94
- package/dist/chunks/slash-commands.mjs +36 -37
- package/dist/chunks/smart-defaults.mjs +7 -3
- package/dist/chunks/smart-guide.mjs +1 -1
- package/dist/chunks/startup.mjs +2 -4
- package/dist/chunks/stats.mjs +41 -42
- package/dist/chunks/status.mjs +49 -50
- package/dist/chunks/team.mjs +24 -12
- package/dist/chunks/thinking.mjs +74 -63
- package/dist/chunks/trace.mjs +20 -19
- package/dist/chunks/uninstall.mjs +69 -56
- package/dist/chunks/update.mjs +39 -28
- package/dist/chunks/upgrade-manager.mjs +24 -18
- package/dist/chunks/version-checker.mjs +45 -41
- package/dist/chunks/vim.mjs +81 -69
- package/dist/chunks/windows.mjs +14 -0
- package/dist/chunks/workflows.mjs +15 -15
- package/dist/chunks/wsl.mjs +129 -0
- package/dist/chunks/zero-config.mjs +45 -34
- package/dist/cli.mjs +20 -20
- package/dist/index.mjs +41 -31
- package/dist/shared/ccjk.BAGoDD49.mjs +36 -0
- package/dist/shared/ccjk.BBtCGd_g.mjs +899 -0
- package/dist/shared/{ccjk.CGcy7cNM.mjs → ccjk.BDKUdmLk.mjs} +1 -1
- package/dist/shared/{ccjk.DtMBiwVG.mjs → ccjk.BFxsJM0k.mjs} +1 -1
- package/dist/shared/{ccjk.j4uut26D.mjs → ccjk.BIxuVL3_.mjs} +5 -5
- package/dist/shared/ccjk.BRZ9ww8S.mjs +142 -0
- package/dist/shared/{ccjk.CN0edl87.mjs → ccjk.BSYWk9ML.mjs} +1 -1
- package/dist/shared/{ccjk.Dk1HDseQ.mjs → ccjk.BnpWvs9V.mjs} +75 -75
- package/dist/shared/ccjk.BoApaI4j.mjs +28 -0
- package/dist/shared/{ccjk.DKojSRzw.mjs → ccjk.BrPUmTqm.mjs} +1 -1
- package/dist/shared/{ccjk.C10pepYx.mjs → ccjk.BxSmJ8B7.mjs} +1 -1
- package/dist/shared/ccjk.Bx_rmYfN.mjs +69 -0
- package/dist/shared/ccjk.COweQ1RR.mjs +5 -0
- package/dist/shared/{ccjk.BN90X6oc.mjs → ccjk.CePkJq2S.mjs} +17 -17
- package/dist/shared/{ccjk.Bvoex4TZ.mjs → ccjk.CfKKcvWy.mjs} +1 -1
- package/dist/shared/ccjk.Cjgrln_h.mjs +297 -0
- package/dist/shared/ccjk.CxpGa6MC.mjs +2724 -0
- package/dist/shared/{ccjk.DfwJOEok.mjs → ccjk.D5MFQT7w.mjs} +1 -1
- package/dist/shared/{ccjk.cChAaGgT.mjs → ccjk.DG_o24cZ.mjs} +6 -6
- package/dist/shared/{ccjk.bhFAMRyc.mjs → ccjk.DLLw-h4Y.mjs} +32 -32
- package/dist/shared/ccjk.DOwtZMk8.mjs +4019 -0
- package/dist/shared/{ccjk.BsXQugfY.mjs → ccjk.DTdjs-qK.mjs} +13 -13
- package/dist/shared/{ccjk.Bdhyg3X-.mjs → ccjk.DsYaCCx4.mjs} +1 -1
- package/dist/shared/ccjk.KfSWcGlE.mjs +38 -0
- package/dist/shared/ccjk.RyizuzOI.mjs +21 -0
- package/dist/shared/{ccjk.h7_W-wTs.mjs → ccjk.SPoXMvZD.mjs} +1 -1
- package/dist/shared/ccjk.T_cX87dY.mjs +15 -0
- package/dist/shared/{ccjk.CrB6OYHv.mjs → ccjk._dESH4Rk.mjs} +2 -2
- package/dist/shared/ccjk.bQ7Dh1g4.mjs +249 -0
- package/dist/shared/{ccjk.CBhIZiPz.mjs → ccjk.hoqrwWdN.mjs} +1 -1
- package/dist/shared/{ccjk.BNwRnWYx.mjs → ccjk.s7OCVzdd.mjs} +1230 -33
- package/dist/shared/{ccjk.BOIUTf5z.mjs → ccjk.waa2ikKJ.mjs} +8 -9
- package/package.json +31 -30
- package/dist/shared/ccjk.DHbrGcgg.mjs +0 -13
- package/dist/shared/ccjk.DntgA8fQ.mjs +0 -42
package/dist/chunks/monitor.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { i18n } from './
|
|
1
|
+
import a from './index2.mjs';
|
|
2
|
+
import { i18n } from './index5.mjs';
|
|
3
3
|
import { displayBannerWithInfo } from './banner.mjs';
|
|
4
4
|
import process__default from 'node:process';
|
|
5
|
-
import { nanoid } from '
|
|
5
|
+
import { n as nanoid } from '../shared/ccjk.BoApaI4j.mjs';
|
|
6
|
+
import '../shared/ccjk.BAGoDD49.mjs';
|
|
6
7
|
import 'node:fs';
|
|
7
8
|
import 'node:url';
|
|
8
|
-
import '
|
|
9
|
-
import 'i18next-fs-backend';
|
|
10
|
-
import 'pathe';
|
|
9
|
+
import '../shared/ccjk.bQ7Dh1g4.mjs';
|
|
11
10
|
import './package.mjs';
|
|
11
|
+
import 'node:crypto';
|
|
12
12
|
|
|
13
13
|
const DEFAULT_STORAGE_CONFIG = {
|
|
14
14
|
maxRecords: 1e4,
|
|
@@ -669,16 +669,16 @@ function generateBarChart(data, options = {}) {
|
|
|
669
669
|
const lines = [];
|
|
670
670
|
for (const item of data) {
|
|
671
671
|
const barLength = Math.round(item.value / maxValue * width);
|
|
672
|
-
const bar =
|
|
672
|
+
const bar = a.green("\u2588".repeat(barLength)) + a.dim("\u2591".repeat(width - barLength));
|
|
673
673
|
const label = item.label.padEnd(maxLabelLength);
|
|
674
674
|
const value = showValues ? ` ${item.value.toFixed(0)}` : "";
|
|
675
|
-
lines.push(` ${
|
|
675
|
+
lines.push(` ${a.cyan(label)} ${bar}${a.yellow(value)}`);
|
|
676
676
|
}
|
|
677
677
|
return lines;
|
|
678
678
|
}
|
|
679
679
|
function generateSparkline(values, width = 20) {
|
|
680
680
|
if (values.length === 0)
|
|
681
|
-
return
|
|
681
|
+
return a.dim("\u2500".repeat(width));
|
|
682
682
|
const chars = ["\u2581", "\u2582", "\u2583", "\u2584", "\u2585", "\u2586", "\u2587", "\u2588"];
|
|
683
683
|
const min = Math.min(...values);
|
|
684
684
|
const max = Math.max(...values);
|
|
@@ -688,7 +688,7 @@ function generateSparkline(values, width = 20) {
|
|
|
688
688
|
return sampled.map((v) => {
|
|
689
689
|
const normalized = (v - min) / range;
|
|
690
690
|
const index = Math.min(Math.floor(normalized * chars.length), chars.length - 1);
|
|
691
|
-
return
|
|
691
|
+
return a.green(chars[index]);
|
|
692
692
|
}).join("");
|
|
693
693
|
}
|
|
694
694
|
function generateProgressBar(value, max, width = 20, options = {}) {
|
|
@@ -696,16 +696,16 @@ function generateProgressBar(value, max, width = 20, options = {}) {
|
|
|
696
696
|
const percent = Math.min(value / max, 1);
|
|
697
697
|
const filled = Math.round(percent * width);
|
|
698
698
|
const empty = width - filled;
|
|
699
|
-
let color =
|
|
699
|
+
let color = a.green;
|
|
700
700
|
if (colorThresholds) {
|
|
701
701
|
if (percent >= colorThresholds.critical)
|
|
702
|
-
color =
|
|
702
|
+
color = a.red;
|
|
703
703
|
else if (percent >= colorThresholds.warning)
|
|
704
|
-
color =
|
|
704
|
+
color = a.yellow;
|
|
705
705
|
}
|
|
706
|
-
const bar = color("\u2588".repeat(filled)) +
|
|
706
|
+
const bar = color("\u2588".repeat(filled)) + a.dim("\u2591".repeat(empty));
|
|
707
707
|
const percentStr = showPercent ? ` ${(percent * 100).toFixed(1)}%` : "";
|
|
708
|
-
return `[${bar}]${
|
|
708
|
+
return `[${bar}]${a.yellow(percentStr)}`;
|
|
709
709
|
}
|
|
710
710
|
function formatDuration(ms) {
|
|
711
711
|
if (ms < 1e3)
|
|
@@ -741,29 +741,29 @@ function formatUptime(ms) {
|
|
|
741
741
|
function getHealthColor(status) {
|
|
742
742
|
switch (status) {
|
|
743
743
|
case "healthy":
|
|
744
|
-
return
|
|
744
|
+
return a.green;
|
|
745
745
|
case "degraded":
|
|
746
|
-
return
|
|
746
|
+
return a.yellow;
|
|
747
747
|
case "unhealthy":
|
|
748
|
-
return
|
|
748
|
+
return a.red;
|
|
749
749
|
case "critical":
|
|
750
|
-
return
|
|
750
|
+
return a.red.bold;
|
|
751
751
|
default:
|
|
752
|
-
return
|
|
752
|
+
return a.gray;
|
|
753
753
|
}
|
|
754
754
|
}
|
|
755
755
|
function getHealthIcon(status) {
|
|
756
756
|
switch (status) {
|
|
757
757
|
case "healthy":
|
|
758
|
-
return
|
|
758
|
+
return a.green("\u25CF");
|
|
759
759
|
case "degraded":
|
|
760
|
-
return
|
|
760
|
+
return a.yellow("\u25D0");
|
|
761
761
|
case "unhealthy":
|
|
762
|
-
return
|
|
762
|
+
return a.red("\u25CB");
|
|
763
763
|
case "critical":
|
|
764
|
-
return
|
|
764
|
+
return a.red.bold("\u2716");
|
|
765
765
|
default:
|
|
766
|
-
return
|
|
766
|
+
return a.gray("?");
|
|
767
767
|
}
|
|
768
768
|
}
|
|
769
769
|
class DashboardRenderer {
|
|
@@ -824,9 +824,9 @@ class DashboardRenderer {
|
|
|
824
824
|
* Render dashboard header
|
|
825
825
|
*/
|
|
826
826
|
renderHeader() {
|
|
827
|
-
const title =
|
|
828
|
-
const time =
|
|
829
|
-
const separator =
|
|
827
|
+
const title = a.bold.cyan("CCJK Performance Monitor");
|
|
828
|
+
const time = a.dim((/* @__PURE__ */ new Date()).toLocaleString());
|
|
829
|
+
const separator = a.dim("\u2550".repeat(80));
|
|
830
830
|
return [
|
|
831
831
|
separator,
|
|
832
832
|
` ${title}${" ".repeat(80 - 30 - time.length)}${time}`,
|
|
@@ -850,12 +850,12 @@ class DashboardRenderer {
|
|
|
850
850
|
const healthColor = getHealthColor(health);
|
|
851
851
|
const healthIcon = getHealthIcon(health);
|
|
852
852
|
return [
|
|
853
|
-
|
|
854
|
-
|
|
853
|
+
a.bold.white(" System Overview"),
|
|
854
|
+
a.dim(` ${"\u2500".repeat(40)}`),
|
|
855
855
|
` ${healthIcon} Status: ${healthColor(health.toUpperCase())}`,
|
|
856
|
-
` ${
|
|
857
|
-
` ${
|
|
858
|
-
` ${
|
|
856
|
+
` ${a.cyan("\u23F1")} Uptime: ${a.yellow(formatUptime(uptime))}`,
|
|
857
|
+
` ${a.cyan("\u{1F4CA}")} Memory: ${formatBytes(memStats.current.heapUsed)} / ${formatBytes(memStats.current.heapTotal)}`,
|
|
858
|
+
` ${a.cyan("\u26A0")} Errors: ${errorStats.totalErrors > 0 ? a.red(errorStats.totalErrors.toString()) : a.green("0")}`
|
|
859
859
|
];
|
|
860
860
|
}
|
|
861
861
|
/**
|
|
@@ -867,8 +867,8 @@ class DashboardRenderer {
|
|
|
867
867
|
if (this.memoryHistory.length > 60)
|
|
868
868
|
this.memoryHistory.shift();
|
|
869
869
|
const lines = [
|
|
870
|
-
|
|
871
|
-
|
|
870
|
+
a.bold.white(" Memory Usage"),
|
|
871
|
+
a.dim(` ${"\u2500".repeat(40)}`)
|
|
872
872
|
];
|
|
873
873
|
const memBar = generateProgressBar(
|
|
874
874
|
stats.current.heapUsed,
|
|
@@ -877,12 +877,12 @@ class DashboardRenderer {
|
|
|
877
877
|
{ colorThresholds: { warning: 0.7, critical: 0.9 } }
|
|
878
878
|
);
|
|
879
879
|
lines.push(` Heap: ${memBar}`);
|
|
880
|
-
lines.push(` ${
|
|
881
|
-
lines.push(` ${
|
|
882
|
-
lines.push(` ${
|
|
883
|
-
const trendIcon = stats.trend === "increasing" ?
|
|
884
|
-
lines.push(` ${
|
|
885
|
-
lines.push(` ${
|
|
880
|
+
lines.push(` ${a.dim("Used:")} ${a.yellow(formatBytes(stats.current.heapUsed))}`);
|
|
881
|
+
lines.push(` ${a.dim("Total:")} ${a.yellow(formatBytes(stats.current.heapTotal))}`);
|
|
882
|
+
lines.push(` ${a.dim("RSS:")} ${a.yellow(formatBytes(stats.current.rss))}`);
|
|
883
|
+
const trendIcon = stats.trend === "increasing" ? a.red("\u2191") : stats.trend === "decreasing" ? a.green("\u2193") : a.gray("\u2192");
|
|
884
|
+
lines.push(` ${a.dim("Trend:")} ${trendIcon} ${stats.trend}`);
|
|
885
|
+
lines.push(` ${a.dim("History:")} ${generateSparkline(this.memoryHistory, 30)}`);
|
|
886
886
|
return lines;
|
|
887
887
|
}
|
|
888
888
|
/**
|
|
@@ -891,11 +891,11 @@ class DashboardRenderer {
|
|
|
891
891
|
renderApiSection() {
|
|
892
892
|
const stats = this.collector.getApiStats();
|
|
893
893
|
const lines = [
|
|
894
|
-
|
|
895
|
-
|
|
894
|
+
a.bold.white(" API Performance"),
|
|
895
|
+
a.dim(` ${"\u2500".repeat(40)}`)
|
|
896
896
|
];
|
|
897
897
|
if (stats.length === 0) {
|
|
898
|
-
lines.push(
|
|
898
|
+
lines.push(a.dim(" No API calls recorded"));
|
|
899
899
|
return lines;
|
|
900
900
|
}
|
|
901
901
|
const avgLatency = stats.reduce((sum, s) => sum + s.avgLatency, 0) / stats.length;
|
|
@@ -904,12 +904,12 @@ class DashboardRenderer {
|
|
|
904
904
|
this.apiLatencyHistory.shift();
|
|
905
905
|
for (const provider of stats.slice(0, 3)) {
|
|
906
906
|
const successRate = provider.totalCalls > 0 ? (provider.successCount / provider.totalCalls * 100).toFixed(1) : "0";
|
|
907
|
-
const rateColor = Number(successRate) >= 95 ?
|
|
908
|
-
lines.push(` ${
|
|
909
|
-
lines.push(` ${
|
|
910
|
-
lines.push(` ${
|
|
907
|
+
const rateColor = Number(successRate) >= 95 ? a.green : Number(successRate) >= 80 ? a.yellow : a.red;
|
|
908
|
+
lines.push(` ${a.cyan(provider.provider)}`);
|
|
909
|
+
lines.push(` ${a.dim("Calls:")} ${provider.totalCalls} | ${a.dim("Success:")} ${rateColor(`${successRate}%`)}`);
|
|
910
|
+
lines.push(` ${a.dim("Latency:")} ${a.yellow(formatDuration(provider.avgLatency))} (p95: ${formatDuration(provider.p95Latency)})`);
|
|
911
911
|
}
|
|
912
|
-
lines.push(` ${
|
|
912
|
+
lines.push(` ${a.dim("Latency:")} ${generateSparkline(this.apiLatencyHistory, 30)}`);
|
|
913
913
|
return lines;
|
|
914
914
|
}
|
|
915
915
|
/**
|
|
@@ -918,11 +918,11 @@ class DashboardRenderer {
|
|
|
918
918
|
renderCommandsSection() {
|
|
919
919
|
const stats = this.collector.getCommandStats();
|
|
920
920
|
const lines = [
|
|
921
|
-
|
|
922
|
-
|
|
921
|
+
a.bold.white(" Command Execution"),
|
|
922
|
+
a.dim(` ${"\u2500".repeat(40)}`)
|
|
923
923
|
];
|
|
924
924
|
if (stats.length === 0) {
|
|
925
|
-
lines.push(
|
|
925
|
+
lines.push(a.dim(" No commands recorded"));
|
|
926
926
|
return lines;
|
|
927
927
|
}
|
|
928
928
|
const sorted = [...stats].sort((a, b) => b.totalExecutions - a.totalExecutions).slice(0, 5);
|
|
@@ -935,7 +935,7 @@ class DashboardRenderer {
|
|
|
935
935
|
const totalSuccess = stats.reduce((sum, s) => sum + s.successCount, 0);
|
|
936
936
|
const successRate = totalExecs > 0 ? (totalSuccess / totalExecs * 100).toFixed(1) : "0";
|
|
937
937
|
lines.push("");
|
|
938
|
-
lines.push(` ${
|
|
938
|
+
lines.push(` ${a.dim("Total:")} ${totalExecs} | ${a.dim("Success:")} ${a.green(`${successRate}%`)}`);
|
|
939
939
|
return lines;
|
|
940
940
|
}
|
|
941
941
|
/**
|
|
@@ -944,14 +944,14 @@ class DashboardRenderer {
|
|
|
944
944
|
renderCacheSection() {
|
|
945
945
|
const stats = this.collector.getCacheStats();
|
|
946
946
|
const lines = [
|
|
947
|
-
|
|
948
|
-
|
|
947
|
+
a.bold.white(" Cache Performance"),
|
|
948
|
+
a.dim(` ${"\u2500".repeat(40)}`)
|
|
949
949
|
];
|
|
950
950
|
const hitRateBar = generateProgressBar(stats.hitRate, 1, 20, { showPercent: true });
|
|
951
951
|
lines.push(` Hit Rate: ${hitRateBar}`);
|
|
952
|
-
lines.push(` ${
|
|
953
|
-
lines.push(` ${
|
|
954
|
-
lines.push(` ${
|
|
952
|
+
lines.push(` ${a.dim("Hits:")} ${a.green(stats.hits.toString())} | ${a.dim("Misses:")} ${a.red(stats.misses.toString())}`);
|
|
953
|
+
lines.push(` ${a.dim("Avg Latency:")} ${a.yellow(formatDuration(stats.avgLatency))}`);
|
|
954
|
+
lines.push(` ${a.dim("Items:")} ${stats.itemCount} | ${a.dim("Size:")} ${formatBytes(stats.totalSize)}`);
|
|
955
955
|
return lines;
|
|
956
956
|
}
|
|
957
957
|
/**
|
|
@@ -960,25 +960,25 @@ class DashboardRenderer {
|
|
|
960
960
|
renderErrorsSection() {
|
|
961
961
|
const stats = this.collector.getErrorStats();
|
|
962
962
|
const lines = [
|
|
963
|
-
|
|
964
|
-
|
|
963
|
+
a.bold.white(" Recent Errors"),
|
|
964
|
+
a.dim(` ${"\u2500".repeat(76)}`)
|
|
965
965
|
];
|
|
966
966
|
if (stats.totalErrors === 0) {
|
|
967
|
-
lines.push(
|
|
967
|
+
lines.push(a.green(" No errors recorded"));
|
|
968
968
|
return lines;
|
|
969
969
|
}
|
|
970
970
|
const severityLine = [
|
|
971
|
-
`${
|
|
972
|
-
`${
|
|
973
|
-
`${
|
|
974
|
-
`${
|
|
971
|
+
`${a.red("Critical:")} ${stats.errorsBySeverity.critical}`,
|
|
972
|
+
`${a.red("High:")} ${stats.errorsBySeverity.high}`,
|
|
973
|
+
`${a.yellow("Medium:")} ${stats.errorsBySeverity.medium}`,
|
|
974
|
+
`${a.green("Low:")} ${stats.errorsBySeverity.low}`
|
|
975
975
|
].join(" | ");
|
|
976
976
|
lines.push(` ${severityLine}`);
|
|
977
977
|
lines.push("");
|
|
978
978
|
for (const error of stats.recentErrors.slice(0, 3)) {
|
|
979
|
-
const severityIcon = error.severity === "critical" ?
|
|
979
|
+
const severityIcon = error.severity === "critical" ? a.red("\u25CF") : error.severity === "high" ? a.red("\u25CB") : error.severity === "medium" ? a.yellow("\u25CB") : a.green("\u25CB");
|
|
980
980
|
const time = new Date(error.timestamp).toLocaleTimeString();
|
|
981
|
-
lines.push(` ${severityIcon} ${
|
|
981
|
+
lines.push(` ${severityIcon} ${a.dim(time)} ${a.cyan(error.type)}: ${error.message.slice(0, 50)}`);
|
|
982
982
|
}
|
|
983
983
|
return lines;
|
|
984
984
|
}
|
|
@@ -988,19 +988,19 @@ class DashboardRenderer {
|
|
|
988
988
|
renderAgentsSection() {
|
|
989
989
|
const stats = this.collector.getAgentStats();
|
|
990
990
|
const lines = [
|
|
991
|
-
|
|
992
|
-
|
|
991
|
+
a.bold.white(" Agent Tasks"),
|
|
992
|
+
a.dim(` ${"\u2500".repeat(76)}`)
|
|
993
993
|
];
|
|
994
994
|
if (stats.length === 0) {
|
|
995
|
-
lines.push(
|
|
995
|
+
lines.push(a.dim(" No agent tasks recorded"));
|
|
996
996
|
return lines;
|
|
997
997
|
}
|
|
998
|
-
lines.push(` ${
|
|
998
|
+
lines.push(` ${a.dim("Agent".padEnd(30))} ${a.dim("Tasks".padEnd(8))} ${a.dim("Success".padEnd(10))} ${a.dim("Avg Time")}`);
|
|
999
999
|
for (const agent of stats.slice(0, 5)) {
|
|
1000
1000
|
const successRate = `${(agent.successRate * 100).toFixed(0)}%`;
|
|
1001
|
-
const rateColor = agent.successRate >= 0.95 ?
|
|
1001
|
+
const rateColor = agent.successRate >= 0.95 ? a.green : agent.successRate >= 0.8 ? a.yellow : a.red;
|
|
1002
1002
|
lines.push(
|
|
1003
|
-
` ${
|
|
1003
|
+
` ${a.cyan(agent.agentName.slice(0, 28).padEnd(30))} ${agent.totalTasks.toString().padEnd(8)} ${rateColor(successRate.padEnd(10))} ${a.yellow(formatDuration(agent.avgDuration))}`
|
|
1004
1004
|
);
|
|
1005
1005
|
}
|
|
1006
1006
|
return lines;
|
|
@@ -1010,8 +1010,8 @@ class DashboardRenderer {
|
|
|
1010
1010
|
*/
|
|
1011
1011
|
renderFooter() {
|
|
1012
1012
|
return [
|
|
1013
|
-
|
|
1014
|
-
|
|
1013
|
+
a.dim("\u2550".repeat(80)),
|
|
1014
|
+
a.dim(` Press Ctrl+C to exit | Refresh: ${this.config.refreshInterval / 1e3}s | ${(/* @__PURE__ */ new Date()).toISOString()}`)
|
|
1015
1015
|
];
|
|
1016
1016
|
}
|
|
1017
1017
|
}
|
|
@@ -1728,7 +1728,7 @@ async function monitor(subcommand, options = {}) {
|
|
|
1728
1728
|
await monitorStart(options);
|
|
1729
1729
|
break;
|
|
1730
1730
|
case "stop":
|
|
1731
|
-
console.log(
|
|
1731
|
+
console.log(a.dim(isZh ? "\u63D0\u793A: \u6309 Ctrl+C \u9000\u51FA\u76D1\u63A7\u9762\u677F" : "Tip: Press Ctrl+C to exit the dashboard"));
|
|
1732
1732
|
break;
|
|
1733
1733
|
case "report":
|
|
1734
1734
|
await monitorReport(options);
|
|
@@ -1757,9 +1757,9 @@ async function monitorStart(options) {
|
|
|
1757
1757
|
showAgents: true
|
|
1758
1758
|
};
|
|
1759
1759
|
console.log("");
|
|
1760
|
-
console.log(
|
|
1760
|
+
console.log(a.bold.cyan(isZh ? "\u{1F4CA} \u542F\u52A8 CCJK \u6027\u80FD\u76D1\u63A7\u9762\u677F..." : "\u{1F4CA} Starting CCJK Performance Monitor..."));
|
|
1761
1761
|
console.log("");
|
|
1762
|
-
console.log(
|
|
1762
|
+
console.log(a.dim(isZh ? "\u63D0\u793A: \u6309 Ctrl+C \u9000\u51FA\u76D1\u63A7" : "Tip: Press Ctrl+C to exit monitoring"));
|
|
1763
1763
|
console.log("");
|
|
1764
1764
|
const dashboard = createDashboard(config);
|
|
1765
1765
|
dashboard.show();
|
|
@@ -1768,7 +1768,7 @@ async function monitorReport(options) {
|
|
|
1768
1768
|
const isZh = (options.lang || i18n.language) === "zh-CN";
|
|
1769
1769
|
const timeRange = options.range || "daily";
|
|
1770
1770
|
console.log("");
|
|
1771
|
-
console.log(
|
|
1771
|
+
console.log(a.bold.cyan(isZh ? "\u{1F4C8} \u751F\u6210\u6027\u80FD\u62A5\u544A..." : "\u{1F4C8} Generating Performance Report..."));
|
|
1772
1772
|
console.log("");
|
|
1773
1773
|
const reporter = createReporter({ timeRange });
|
|
1774
1774
|
const report = reporter.generateReport();
|
|
@@ -1778,14 +1778,14 @@ async function monitorReport(options) {
|
|
|
1778
1778
|
const fs = await import('node:fs/promises');
|
|
1779
1779
|
await fs.writeFile(options.output, reportText);
|
|
1780
1780
|
console.log("");
|
|
1781
|
-
console.log(
|
|
1781
|
+
console.log(a.green(`${isZh ? "\u62A5\u544A\u5DF2\u4FDD\u5B58\u5230" : "Report saved to"} ${options.output}`));
|
|
1782
1782
|
}
|
|
1783
1783
|
if (options.json) {
|
|
1784
1784
|
const jsonReport = reporter.formatReportAsJson(report);
|
|
1785
1785
|
const jsonOutput = options.output ? options.output.replace(/\.[^.]+$/, ".json") : "ccjk-monitor-report.json";
|
|
1786
1786
|
const fs = await import('node:fs/promises');
|
|
1787
1787
|
await fs.writeFile(jsonOutput, jsonReport);
|
|
1788
|
-
console.log(
|
|
1788
|
+
console.log(a.green(`${isZh ? "JSON \u62A5\u544A\u5DF2\u4FDD\u5B58\u5230" : "JSON report saved to"} ${jsonOutput}`));
|
|
1789
1789
|
}
|
|
1790
1790
|
console.log("");
|
|
1791
1791
|
}
|
|
@@ -1793,7 +1793,7 @@ async function monitorExport(options = {}) {
|
|
|
1793
1793
|
const isZh = (options.lang || i18n.language) === "zh-CN";
|
|
1794
1794
|
const format = options.format || "json";
|
|
1795
1795
|
console.log("");
|
|
1796
|
-
console.log(
|
|
1796
|
+
console.log(a.bold.cyan(isZh ? "\u{1F4BE} \u5BFC\u51FA\u76D1\u63A7\u6570\u636E..." : "\u{1F4BE} Exporting Monitoring Data..."));
|
|
1797
1797
|
console.log("");
|
|
1798
1798
|
const dashboard = createDashboard();
|
|
1799
1799
|
const data = dashboard.export(format);
|
|
@@ -1804,14 +1804,14 @@ async function monitorExport(options = {}) {
|
|
|
1804
1804
|
}
|
|
1805
1805
|
const fs = await import('node:fs/promises');
|
|
1806
1806
|
await fs.writeFile(outputFile, data);
|
|
1807
|
-
console.log(
|
|
1807
|
+
console.log(a.green(`${isZh ? "\u6570\u636E\u5DF2\u5BFC\u51FA\u5230" : "Data exported to"} ${outputFile}`));
|
|
1808
1808
|
console.log("");
|
|
1809
1809
|
}
|
|
1810
1810
|
function monitorHelp(options = {}) {
|
|
1811
1811
|
const isZh = (options.lang || i18n.language) === "zh-CN";
|
|
1812
1812
|
console.log("");
|
|
1813
|
-
console.log(
|
|
1814
|
-
console.log(
|
|
1813
|
+
console.log(a.bold.cyan(isZh ? "\u{1F4CA} CCJK \u6027\u80FD\u76D1\u63A7\u547D\u4EE4" : "\u{1F4CA} CCJK Performance Monitor Commands"));
|
|
1814
|
+
console.log(a.dim("\u2500".repeat(60)));
|
|
1815
1815
|
console.log("");
|
|
1816
1816
|
const commands = [
|
|
1817
1817
|
{
|
|
@@ -1836,20 +1836,20 @@ function monitorHelp(options = {}) {
|
|
|
1836
1836
|
}
|
|
1837
1837
|
];
|
|
1838
1838
|
for (const { cmd, desc } of commands) {
|
|
1839
|
-
console.log(` ${
|
|
1840
|
-
console.log(` ${
|
|
1839
|
+
console.log(` ${a.green(cmd)}`);
|
|
1840
|
+
console.log(` ${a.dim(desc)}`);
|
|
1841
1841
|
console.log("");
|
|
1842
1842
|
}
|
|
1843
|
-
console.log(
|
|
1843
|
+
console.log(a.bold.yellow(isZh ? "\u9009\u9879:" : "Options:"));
|
|
1844
1844
|
console.log("");
|
|
1845
|
-
console.log(` ${
|
|
1846
|
-
console.log(` ${
|
|
1847
|
-
console.log(` ${
|
|
1848
|
-
console.log(` ${
|
|
1849
|
-
console.log(` ${
|
|
1850
|
-
console.log(` ${
|
|
1845
|
+
console.log(` ${a.cyan("--refresh, -r <ms>")} ${isZh ? "\u5237\u65B0\u95F4\u9694 (\u6BEB\u79D2)" : "Refresh interval (milliseconds)"}`);
|
|
1846
|
+
console.log(` ${a.cyan("--range <timeRange>")} ${isZh ? "\u62A5\u544A\u65F6\u95F4\u8303\u56F4 (hourly|daily|weekly|monthly)" : "Report time range (hourly|daily|weekly|monthly)"}`);
|
|
1847
|
+
console.log(` ${a.cyan("--format, -f <format>")} ${isZh ? "\u5BFC\u51FA\u683C\u5F0F (json|csv|html)" : "Export format (json|csv|html)"}`);
|
|
1848
|
+
console.log(` ${a.cyan("--output, -o <file>")} ${isZh ? "\u8F93\u51FA\u6587\u4EF6\u8DEF\u5F84" : "Output file path"}`);
|
|
1849
|
+
console.log(` ${a.cyan("--json")} ${isZh ? "\u540C\u65F6\u8F93\u51FA JSON \u683C\u5F0F" : "Also output JSON format"}`);
|
|
1850
|
+
console.log(` ${a.cyan("--no-banner")} ${isZh ? "\u4E0D\u663E\u793A\u6A2A\u5E45" : "Do not display banner"}`);
|
|
1851
1851
|
console.log("");
|
|
1852
|
-
console.log(
|
|
1852
|
+
console.log(a.dim(isZh ? "\u{1F4A1} \u63D0\u793A: \u4F7F\u7528 ccjk monitor \u542F\u52A8\u5B9E\u65F6\u76D1\u63A7\u9762\u677F\uFF0C\u6309 Ctrl+C \u9000\u51FA" : '\u{1F4A1} Tip: Run "ccjk monitor" to start the dashboard, press Ctrl+C to exit'));
|
|
1853
1853
|
console.log("");
|
|
1854
1854
|
}
|
|
1855
1855
|
|