zdashboard 2.8.0 → 2.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.
Files changed (33) hide show
  1. package/dist/cli.js +21 -11
  2. package/dist/cli.js.map +1 -1
  3. package/dist/web/assets/BatchView-BG4mP3YP.js +2 -0
  4. package/dist/web/assets/{CheckpointViewer-Dnakl7qw.js → CheckpointViewer-DDDL4LLT.js} +1 -1
  5. package/dist/web/assets/{CodeViewer-DKQhzhtt.js → CodeViewer-JhnG7iUT.js} +1 -1
  6. package/dist/web/assets/{DependencyGraph-M-usNrkC.js → DependencyGraph-D0WgxxUF.js} +1 -1
  7. package/dist/web/assets/{FileIcon-AydLkQKG.js → FileIcon-BmaRn48o.js} +1 -1
  8. package/dist/web/assets/{FilterPills-X52teHq7.js → FilterPills-Dh6YBt2R.js} +1 -1
  9. package/dist/web/assets/{ProgressBar-C8W_FpI2.js → ProgressBar-BmnZnTYq.js} +1 -1
  10. package/dist/web/assets/{Sidebar-R9gmd6Ss.js → Sidebar-CYyRqUZe.js} +1 -1
  11. package/dist/web/assets/{Sidebar-BUEb7NX4.js → Sidebar-ZYBrFJIk.js} +1 -1
  12. package/dist/web/assets/SingleChangeView-E0xbfiWi.js +1 -0
  13. package/dist/web/assets/ViewHeader-BGjZ06RN.js +1 -0
  14. package/dist/web/assets/Workspace-BwGBjSAY.js +2 -0
  15. package/dist/web/assets/{Workspace-C2bvxp8p.js → Workspace-CpKx4uWV.js} +1 -1
  16. package/dist/web/assets/{Workspace-Do07KofT.js → Workspace-DSphvDjC.js} +1 -1
  17. package/dist/web/assets/{Workspace-CkU9yWvw.js → Workspace-FTeTEgcv.js} +2 -2
  18. package/dist/web/assets/{Workspace-qzGIvIU-.js → Workspace-VaSVbceB.js} +1 -1
  19. package/dist/web/assets/index-B5TwQO_C.css +1 -0
  20. package/dist/web/assets/{index-B1epVp2c.js → index-BFfqeozW.js} +1372 -1372
  21. package/dist/web/assets/{index-DOZp2EHd.js → index-cqcRCemV.js} +1 -1
  22. package/dist/web/assets/{usePluginData-jGCocXxu.js → usePluginData-l4OWrSnb.js} +1 -1
  23. package/dist/web/assets/{web-VATakLhV.js → web-BeTYyAG8.js} +2 -2
  24. package/dist/web/assets/{web-C-_Hr8JN.js → web-Di4EgMTa.js} +2 -2
  25. package/dist/web/assets/{web-He9MXVk-.js → web-DwX6rkMl.js} +2 -2
  26. package/dist/web/assets/{web-BROwAvbQ.js → web-Dzj4gVNk.js} +2 -2
  27. package/dist/web/assets/{web-C4mUiGNR.js → web-gL1eNZ2l.js} +2 -2
  28. package/dist/web/index.html +2 -2
  29. package/package.json +2 -1
  30. package/dist/web/assets/BatchView-C7Y83zJ8.js +0 -2
  31. package/dist/web/assets/SingleChangeView-Cfr_Wkzz.js +0 -1
  32. package/dist/web/assets/Workspace-CqTemGJp.js +0 -2
  33. package/dist/web/assets/index-BJDneNeU.css +0 -1
package/dist/cli.js CHANGED
@@ -43,7 +43,7 @@ import { fileURLToPath } from "url";
43
43
  // package.json
44
44
  var package_default = {
45
45
  name: "zdashboard",
46
- version: "2.8.0",
46
+ version: "2.8.2",
47
47
  description: "ZCode skill dashboard platform \u2014 pluggable viewers for zdesign/zview/zreview/zgoal",
48
48
  type: "module",
49
49
  bin: {
@@ -83,6 +83,7 @@ var package_default = {
83
83
  "date-fns": "^3.6.0",
84
84
  filesize: "^11.0.0",
85
85
  "highlight.js": "^11.11.1",
86
+ "iconv-lite": "0.7.3",
86
87
  katex: "^0.16.11",
87
88
  ky: "^1.7.0",
88
89
  "lodash-es": "^4.17.21",
@@ -1044,7 +1045,16 @@ var DashboardService = class extends Service3 {
1044
1045
 
1045
1046
  // src/server/just-runner.ts
1046
1047
  import { spawn, execFile as execFile5 } from "child_process";
1048
+ import iconv from "iconv-lite";
1047
1049
  var MAX_BUFFER = 1e3;
1050
+ var utf8Strict = new TextDecoder("utf-8", { fatal: true });
1051
+ function decodeLine(buf) {
1052
+ try {
1053
+ return utf8Strict.decode(buf);
1054
+ } catch {
1055
+ return iconv.decode(buf, "gbk");
1056
+ }
1057
+ }
1048
1058
  var JustRunner = class {
1049
1059
  cwd;
1050
1060
  tasks = /* @__PURE__ */ new Map();
@@ -1096,7 +1106,7 @@ var JustRunner = class {
1096
1106
  /** 启动 recipe:同名先停旧进程(重启语义),不影响其他任务;调用方须先用 recipes() 校验名字 */
1097
1107
  start(recipe) {
1098
1108
  this.killOne(recipe);
1099
- const task = { recipe, child: null, state: "running", code: null, startedAt: Date.now(), buffer: [], pending: "" };
1109
+ const task = { recipe, child: null, state: "running", code: null, startedAt: Date.now(), buffer: [], pending: Buffer.alloc(0) };
1100
1110
  this.tasks.set(recipe, task);
1101
1111
  this.emit({ type: "clear", recipe });
1102
1112
  this.emit({ type: "state", recipe, state: "running", code: null, startedAt: task.startedAt });
@@ -1116,12 +1126,12 @@ var JustRunner = class {
1116
1126
  const isStale = () => this.tasks.get(recipe) !== task;
1117
1127
  const push = (d) => {
1118
1128
  if (isStale()) return;
1119
- task.pending += d.toString();
1129
+ task.pending = Buffer.concat([task.pending, d]);
1120
1130
  let idx;
1121
- while ((idx = task.pending.indexOf("\n")) >= 0) {
1122
- const line = task.pending.slice(0, idx + 1);
1123
- task.pending = task.pending.slice(idx + 1);
1124
- this.pushLine(task, line);
1131
+ while ((idx = task.pending.indexOf(10)) >= 0) {
1132
+ const line = task.pending.subarray(0, idx + 1);
1133
+ task.pending = task.pending.subarray(idx + 1);
1134
+ this.pushLine(task, decodeLine(line));
1125
1135
  }
1126
1136
  };
1127
1137
  child.stdout?.on("data", push);
@@ -1131,10 +1141,10 @@ var JustRunner = class {
1131
1141
  `);
1132
1142
  });
1133
1143
  child.on("exit", (code, signal) => {
1134
- if (task.pending && !isStale()) {
1135
- this.pushLine(task, task.pending + "\n");
1144
+ if (task.pending.length > 0 && !isStale()) {
1145
+ this.pushLine(task, decodeLine(task.pending) + "\n");
1136
1146
  }
1137
- task.pending = "";
1147
+ task.pending = Buffer.alloc(0);
1138
1148
  task.child = null;
1139
1149
  task.state = "exited";
1140
1150
  task.code = code ?? 0;
@@ -1162,7 +1172,7 @@ var JustRunner = class {
1162
1172
  const task = this.tasks.get(recipe);
1163
1173
  if (!task) return;
1164
1174
  task.buffer = [];
1165
- task.pending = "";
1175
+ task.pending = Buffer.alloc(0);
1166
1176
  this.emit({ type: "clear", recipe });
1167
1177
  }
1168
1178
  killOne(recipe) {