zdashboard 2.8.2 → 2.8.4
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/cli.js +19 -14
- package/dist/cli.js.map +1 -1
- package/dist/web/assets/BatchView-pClKtVa8.js +2 -0
- package/dist/web/assets/{CheckpointViewer-DDDL4LLT.js → CheckpointViewer-CAbXbMti.js} +1 -1
- package/dist/web/assets/{CodeViewer-JhnG7iUT.js → CodeViewer-Cs0mG1h6.js} +1 -1
- package/dist/web/assets/{DependencyGraph-D0WgxxUF.js → DependencyGraph-Czdg00AM.js} +1 -1
- package/dist/web/assets/{FileIcon-BmaRn48o.js → FileIcon-1KBdrfw3.js} +1 -1
- package/dist/web/assets/{FilterPills-Dh6YBt2R.js → FilterPills-CCubROoX.js} +1 -1
- package/dist/web/assets/{ProgressBar-BmnZnTYq.js → ProgressBar-DVfldtzq.js} +1 -1
- package/dist/web/assets/{Sidebar-CYyRqUZe.js → Sidebar-D4sJtPI_.js} +1 -1
- package/dist/web/assets/{Sidebar-ZYBrFJIk.js → Sidebar-DE0UBp9b.js} +1 -1
- package/dist/web/assets/{SingleChangeView-E0xbfiWi.js → SingleChangeView-BYcaGOyR.js} +1 -1
- package/dist/web/assets/{ViewHeader-BGjZ06RN.js → ViewHeader-DPfbaJmK.js} +1 -1
- package/dist/web/assets/Workspace-B7MhdnwY.js +2 -0
- package/dist/web/assets/{Workspace-VaSVbceB.js → Workspace-CAcrVL-m.js} +1 -1
- package/dist/web/assets/{Workspace-FTeTEgcv.js → Workspace-CvG5lIPT.js} +1 -1
- package/dist/web/assets/{Workspace-CpKx4uWV.js → Workspace-DWHHR42N.js} +1 -1
- package/dist/web/assets/{Workspace-DSphvDjC.js → Workspace-cXLWoMNL.js} +1 -1
- package/dist/web/assets/{index-BFfqeozW.js → index-Co7MWSFf.js} +2 -2
- package/dist/web/assets/index-CwS-KyOV.css +1 -0
- package/dist/web/assets/{index-cqcRCemV.js → index-D6EJRHBV.js} +1 -1
- package/dist/web/assets/{usePluginData-l4OWrSnb.js → usePluginData-IoRqReIJ.js} +1 -1
- package/dist/web/assets/{web-Dzj4gVNk.js → web-BZSTgldm.js} +2 -2
- package/dist/web/assets/web-CX1FEFxC.js +2 -0
- package/dist/web/assets/{web-BeTYyAG8.js → web-DLwxO4fO.js} +2 -2
- package/dist/web/assets/{web-Di4EgMTa.js → web-DOEmlI8d.js} +2 -2
- package/dist/web/assets/{web-DwX6rkMl.js → web-DxbVzGf3.js} +2 -2
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/web/assets/BatchView-BG4mP3YP.js +0 -2
- package/dist/web/assets/Workspace-BwGBjSAY.js +0 -2
- package/dist/web/assets/index-B5TwQO_C.css +0 -1
- package/dist/web/assets/web-gL1eNZ2l.js +0 -2
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.
|
|
46
|
+
version: "2.8.4",
|
|
47
47
|
description: "ZCode skill dashboard platform \u2014 pluggable viewers for zdesign/zview/zreview/zgoal",
|
|
48
48
|
type: "module",
|
|
49
49
|
bin: {
|
|
@@ -1486,10 +1486,10 @@ function readText2(p) {
|
|
|
1486
1486
|
return null;
|
|
1487
1487
|
}
|
|
1488
1488
|
}
|
|
1489
|
-
function readBatchState(root) {
|
|
1489
|
+
function readBatchState(root, explicitRun) {
|
|
1490
1490
|
const applyDir = path7.join(root, ".zdev", "apply");
|
|
1491
|
-
const
|
|
1492
|
-
const runId =
|
|
1491
|
+
const requested = explicitRun?.trim() ?? "";
|
|
1492
|
+
const runId = requested && RUN_ID_PATTERN.test(requested) ? requested : readText2(path7.join(applyDir, "CURRENT"))?.trim() ?? "";
|
|
1493
1493
|
if (!runId || !RUN_ID_PATTERN.test(runId)) {
|
|
1494
1494
|
return { run: null, state: null };
|
|
1495
1495
|
}
|
|
@@ -1511,20 +1511,24 @@ function projectGraph(state) {
|
|
|
1511
1511
|
if (!state) {
|
|
1512
1512
|
return { changes: [], batches: [], conflicts: [] };
|
|
1513
1513
|
}
|
|
1514
|
+
const rawChanges = state.changes;
|
|
1515
|
+
const rawBatches = state.batches;
|
|
1516
|
+
const rawConflicts = state.conflicts;
|
|
1514
1517
|
return {
|
|
1515
|
-
changes:
|
|
1518
|
+
changes: (Array.isArray(rawChanges) ? rawChanges : []).map((c) => ({
|
|
1516
1519
|
name: c.name,
|
|
1517
1520
|
status: c.status,
|
|
1518
|
-
dependencies: c.dependencies,
|
|
1521
|
+
dependencies: Array.isArray(c?.dependencies) ? c.dependencies : [],
|
|
1519
1522
|
batchIndex: c.batchIndex
|
|
1520
1523
|
})),
|
|
1521
|
-
batches:
|
|
1522
|
-
conflicts:
|
|
1524
|
+
batches: Array.isArray(rawBatches) ? rawBatches : [],
|
|
1525
|
+
conflicts: Array.isArray(rawConflicts) ? rawConflicts : []
|
|
1523
1526
|
};
|
|
1524
1527
|
}
|
|
1525
1528
|
var BATCH_LOGS_TAIL = 100;
|
|
1526
1529
|
function tailLogs(state) {
|
|
1527
|
-
|
|
1530
|
+
const logs = state?.logs;
|
|
1531
|
+
return (Array.isArray(logs) ? logs : []).slice(-BATCH_LOGS_TAIL);
|
|
1528
1532
|
}
|
|
1529
1533
|
function readBatchPlan(root, runId) {
|
|
1530
1534
|
return readText2(path7.join(root, ".zdev", "apply", "runs", runId, "plan.md"));
|
|
@@ -1561,11 +1565,12 @@ var apply4 = defineBuiltin({
|
|
|
1561
1565
|
return bad(e instanceof Error ? e.message : "unknown error");
|
|
1562
1566
|
}
|
|
1563
1567
|
});
|
|
1564
|
-
|
|
1565
|
-
ctx.route("/__apply/batch
|
|
1566
|
-
ctx.route("/__apply/batch/
|
|
1567
|
-
ctx.route("/__apply/batch/
|
|
1568
|
-
|
|
1568
|
+
const queryRun = (req) => new URL(req.url || "", "http://x").searchParams.get("run") ?? void 0;
|
|
1569
|
+
ctx.route("/__apply/batch", async (req) => readBatchState(root, queryRun(req)));
|
|
1570
|
+
ctx.route("/__apply/batch/graph", async (req) => projectGraph(readBatchState(root, queryRun(req)).state));
|
|
1571
|
+
ctx.route("/__apply/batch/logs", async (req) => tailLogs(readBatchState(root, queryRun(req)).state));
|
|
1572
|
+
ctx.route("/__apply/batch/plan", async (req, res) => {
|
|
1573
|
+
const snap = readBatchState(root, queryRun(req));
|
|
1569
1574
|
const plan = snap.run ? readBatchPlan(root, snap.run.id) : null;
|
|
1570
1575
|
if (plan == null) return errorResponse(res, 404, "plan not found");
|
|
1571
1576
|
return { plan };
|