glimmervoid 0.49.1-next.506 → 0.49.1-next.508

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 (89) hide show
  1. package/dist/bin/glimmervoid.js +4 -4
  2. package/dist/chunks/{agent-api-cli-B4EhNVX4.js → agent-api-cli-BzVCpGSu.js} +1 -1
  3. package/dist/chunks/{agent-api-cli-DExpTVWL.js → agent-api-cli-ZP54FlHn.js} +1 -448
  4. package/dist/chunks/{main-ugWOUmwy.js → main-CR3PXWUN.js} +249 -13
  5. package/dist/chunks/{settings-cli-C3GFj1Ny.js → settings-cli-BuFGt4jX.js} +1 -1
  6. package/dist/chunks/{shown-files-core-CiEXUXvy.js → shown-files-core-Dbzn7Pyl.js} +457 -10
  7. package/dist/chunks/{ssh-sign-cli-BSgXGArF.js → ssh-sign-cli-BE7Y3PTd.js} +1 -1
  8. package/dist/client/assets/{benchmark-panel-C3wT6WO5.js → benchmark-panel-CDhcgj8z.js} +1 -1
  9. package/dist/client/assets/benchmark-panel-CDhcgj8z.js.br +0 -0
  10. package/dist/client/assets/{boards-view-DY8Oayxv.js → boards-view-CNgYfri6.js} +1 -1
  11. package/dist/client/assets/boards-view-CNgYfri6.js.br +0 -0
  12. package/dist/client/assets/{community-panel-BSLOCCdp.js → community-panel-DxIZcu7N.js} +1 -1
  13. package/dist/client/assets/community-panel-DxIZcu7N.js.br +0 -0
  14. package/dist/client/assets/{dialogs-BEADTkSG.js → dialogs-DlMtvGSV.js} +1 -1
  15. package/dist/client/assets/dialogs-DlMtvGSV.js.br +0 -0
  16. package/dist/client/assets/{doc-editor-ui-DogQ7rXN.js → doc-editor-ui-cIK-nOb0.js} +1 -1
  17. package/dist/client/assets/doc-editor-ui-cIK-nOb0.js.br +0 -0
  18. package/dist/client/assets/{feature-hint-YkBCeuG3.js → feature-hint-wyjSUpzW.js} +1 -1
  19. package/dist/client/assets/feature-hint-wyjSUpzW.js.br +0 -0
  20. package/dist/client/assets/{first-run-checklist-DkvL3KRa.js → first-run-checklist-BlqxVK_o.js} +1 -1
  21. package/dist/client/assets/first-run-checklist-BlqxVK_o.js.br +0 -0
  22. package/dist/client/assets/{hooks-panel-CZOdupH_.js → hooks-panel-DZQrLyWw.js} +1 -1
  23. package/dist/client/assets/hooks-panel-DZQrLyWw.js.br +0 -0
  24. package/dist/client/assets/{index-DAfljtgZ.js → index-pqItVUwb.js} +5 -5
  25. package/dist/client/assets/index-pqItVUwb.js.br +0 -0
  26. package/dist/client/assets/{issues-panel-CQ6yLu_n.js → issues-panel-1d33xVLA.js} +1 -1
  27. package/dist/client/assets/issues-panel-1d33xVLA.js.br +0 -0
  28. package/dist/client/assets/{my-prs-panel-BJdbXG43.js → my-prs-panel--xxhzkjZ.js} +1 -1
  29. package/dist/client/assets/my-prs-panel--xxhzkjZ.js.br +0 -0
  30. package/dist/client/assets/{nyan-cat-BA2VaJxU.js → nyan-cat-BPgDQR25.js} +1 -1
  31. package/dist/client/assets/nyan-cat-BPgDQR25.js.br +0 -0
  32. package/dist/client/assets/{phone-shell-kU5d9CT6.js → phone-shell-BpP2o_V7.js} +1 -1
  33. package/dist/client/assets/phone-shell-BpP2o_V7.js.br +0 -0
  34. package/dist/client/assets/{plan-face-Dl9i1NDr.js → plan-face-CFnEkT2w.js} +1 -1
  35. package/dist/client/assets/plan-face-CFnEkT2w.js.br +0 -0
  36. package/dist/client/assets/{plan-render-DEUBu_u3.js → plan-render-DgqCpMLy.js} +1 -1
  37. package/dist/client/assets/plan-render-DgqCpMLy.js.br +0 -0
  38. package/dist/client/assets/{pr-queue-columns-DXv241gL.js → pr-queue-columns-BkGXPjaK.js} +1 -1
  39. package/dist/client/assets/pr-queue-columns-BkGXPjaK.js.br +0 -0
  40. package/dist/client/assets/{radar-panel-CDhIHjOp.js → radar-panel-DgHsTnJE.js} +1 -1
  41. package/dist/client/assets/radar-panel-DgHsTnJE.js.br +0 -0
  42. package/dist/client/assets/{repo-roots-adder-BJaY8Pj6.js → repo-roots-adder-C3EOOMj_.js} +1 -1
  43. package/dist/client/assets/repo-roots-adder-C3EOOMj_.js.br +0 -0
  44. package/dist/client/assets/{resume-dialog-B6YSyjuM.js → resume-dialog-D_jBebJC.js} +1 -1
  45. package/dist/client/assets/resume-dialog-D_jBebJC.js.br +0 -0
  46. package/dist/client/assets/{review-queue-panel-2uh0WdwV.js → review-queue-panel-Df0NvLme.js} +1 -1
  47. package/dist/client/assets/review-queue-panel-Df0NvLme.js.br +0 -0
  48. package/dist/client/assets/{settings-panel-OfV-rVzG.js → settings-panel-B1euTGwK.js} +2 -2
  49. package/dist/client/assets/settings-panel-B1euTGwK.js.br +0 -0
  50. package/dist/client/assets/{shown-face-Bx-vVzXo.js → shown-face-CZh-Db7M.js} +1 -1
  51. package/dist/client/assets/shown-face-CZh-Db7M.js.br +0 -0
  52. package/dist/client/assets/{team-review-panel-C4qu2_aJ.js → team-review-panel-DW5-d1ML.js} +1 -1
  53. package/dist/client/assets/team-review-panel-DW5-d1ML.js.br +0 -0
  54. package/dist/client/assets/{trace-panel-Cjzp2VyW.js → trace-panel-DM_F2-zX.js} +1 -1
  55. package/dist/client/assets/trace-panel-DM_F2-zX.js.br +0 -0
  56. package/dist/client/assets/{usage-panel-BBni6vzp.js → usage-panel-NPwBCO5C.js} +1 -1
  57. package/dist/client/assets/usage-panel-NPwBCO5C.js.br +0 -0
  58. package/dist/client/assets/{your-day-tip-B3fHIPYh.js → your-day-tip-BlvkGljf.js} +1 -1
  59. package/dist/client/assets/your-day-tip-BlvkGljf.js.br +0 -0
  60. package/dist/client/index.html +1 -1
  61. package/dist/client/index.html.br +0 -0
  62. package/dist/server/index.js +1 -1
  63. package/package.json +1 -1
  64. package/dist/client/assets/benchmark-panel-C3wT6WO5.js.br +0 -0
  65. package/dist/client/assets/boards-view-DY8Oayxv.js.br +0 -0
  66. package/dist/client/assets/community-panel-BSLOCCdp.js.br +0 -0
  67. package/dist/client/assets/dialogs-BEADTkSG.js.br +0 -0
  68. package/dist/client/assets/doc-editor-ui-DogQ7rXN.js.br +0 -0
  69. package/dist/client/assets/feature-hint-YkBCeuG3.js.br +0 -0
  70. package/dist/client/assets/first-run-checklist-DkvL3KRa.js.br +0 -0
  71. package/dist/client/assets/hooks-panel-CZOdupH_.js.br +0 -0
  72. package/dist/client/assets/index-DAfljtgZ.js.br +0 -0
  73. package/dist/client/assets/issues-panel-CQ6yLu_n.js.br +0 -0
  74. package/dist/client/assets/my-prs-panel-BJdbXG43.js.br +0 -0
  75. package/dist/client/assets/nyan-cat-BA2VaJxU.js.br +0 -0
  76. package/dist/client/assets/phone-shell-kU5d9CT6.js.br +0 -0
  77. package/dist/client/assets/plan-face-Dl9i1NDr.js.br +0 -0
  78. package/dist/client/assets/plan-render-DEUBu_u3.js.br +0 -0
  79. package/dist/client/assets/pr-queue-columns-DXv241gL.js.br +0 -0
  80. package/dist/client/assets/radar-panel-CDhIHjOp.js.br +0 -0
  81. package/dist/client/assets/repo-roots-adder-BJaY8Pj6.js.br +0 -0
  82. package/dist/client/assets/resume-dialog-B6YSyjuM.js.br +0 -0
  83. package/dist/client/assets/review-queue-panel-2uh0WdwV.js.br +0 -0
  84. package/dist/client/assets/settings-panel-OfV-rVzG.js.br +0 -0
  85. package/dist/client/assets/shown-face-Bx-vVzXo.js.br +0 -0
  86. package/dist/client/assets/team-review-panel-C4qu2_aJ.js.br +0 -0
  87. package/dist/client/assets/trace-panel-Cjzp2VyW.js.br +0 -0
  88. package/dist/client/assets/usage-panel-BBni6vzp.js.br +0 -0
  89. package/dist/client/assets/your-day-tip-B3fHIPYh.js.br +0 -0
@@ -75,7 +75,7 @@ var OWNED_COMMAND_RUNNERS = {
75
75
  return runAgentSetupCli();
76
76
  },
77
77
  settings: async (parsed) => {
78
- const { runParsedSettingsCli } = await import("../chunks/settings-cli-C3GFj1Ny.js");
78
+ const { runParsedSettingsCli } = await import("../chunks/settings-cli-BuFGt4jX.js");
79
79
  return runParsedSettingsCli(parsed);
80
80
  },
81
81
  why: async ({ positionals }) => {
@@ -83,7 +83,7 @@ var OWNED_COMMAND_RUNNERS = {
83
83
  return runWhyCli({ targetArgument: positionals[0] ?? "" });
84
84
  },
85
85
  "ssh-sign": async ({ rawArgs }) => {
86
- const { runSshSignCli } = await import("../chunks/ssh-sign-cli-BSgXGArF.js");
86
+ const { runSshSignCli } = await import("../chunks/ssh-sign-cli-BE7Y3PTd.js");
87
87
  return runSshSignCli(rawArgs);
88
88
  }
89
89
  };
@@ -105,7 +105,7 @@ async function runOwnedCommand(name, subcommandArgs) {
105
105
  return OWNED_COMMAND_RUNNERS[name](parsed);
106
106
  }
107
107
  var SUBCOMMAND_RUNNERS = new Map([...Object.keys(OWNED_COMMAND_SPECS).filter(isOwnedCommandName).map((name) => [name, (subcommandArgs) => runOwnedCommand(name, subcommandArgs)]), ...AGENT_API_VERBS.filter((verb) => !isOwnedCommandName(verb)).map((verb) => [verb, async (subcommandArgs, subcommandName) => {
108
- const { runAgentApiCli } = await import("../chunks/agent-api-cli-B4EhNVX4.js");
108
+ const { runAgentApiCli } = await import("../chunks/agent-api-cli-BzVCpGSu.js");
109
109
  return runAgentApiCli([subcommandName, ...subcommandArgs]);
110
110
  }])]);
111
111
  var AGENT_INSTALL_COMMAND_BY_ID = {
@@ -119,7 +119,7 @@ function missingAgentText(agentId) {
119
119
  }
120
120
  async function printSessionLimits() {
121
121
  if (!process.env["GLIMMERVOID_AGENT_URL"]) return;
122
- const { sessionLimitsHelpLines } = await import("../chunks/agent-api-cli-B4EhNVX4.js");
122
+ const { sessionLimitsHelpLines } = await import("../chunks/agent-api-cli-BzVCpGSu.js");
123
123
  const limitsLines = await sessionLimitsHelpLines();
124
124
  console.log(`\n${limitsLines.join("\n")}`);
125
125
  }
@@ -1 +1 @@
1
- export { t as askAgentApi, r as runAgentApiCli, i as sessionLimitsHelpLines } from "./agent-api-cli-DExpTVWL.js";
1
+ export { t as askAgentApi, r as runAgentApiCli, i as sessionLimitsHelpLines } from "./agent-api-cli-ZP54FlHn.js";
@@ -2,458 +2,11 @@ import { Z as UNIT_STATUSES, et as WhiteboardAgentReply, l as AgentLimitsReply,
2
2
  import { J as formatSessionLimits, i as agentCommandSpec, m as isAgentApiVerb, rt as parseCommand, t as AGENT_COMMAND_HELP } from "./agent-api-core-BCRpZ3sc.js";
3
3
  import { i as resolveHookTarget } from "./hook-relay-core-DA_bz2KA.js";
4
4
  import { t as parseJsonOrNull } from "./json-core-If8h-Qgy.js";
5
- import { _ as planSteps, i as describeOverCap, m as layoutBoard, p as escapeMarkup } from "./shown-files-core-CiEXUXvy.js";
5
+ import { h as layoutBoard, i as describeOverCap, p as boardSvgDocument, v as planSteps } from "./shown-files-core-Dbzn7Pyl.js";
6
6
  import fs from "node:fs";
7
7
  import path from "node:path";
8
8
  import http from "node:http";
9
9
  import { pipeline } from "node:stream";
10
- //#region shared/whiteboard-svg-core.ts
11
- var SVG_NAMESPACE = "http://www.w3.org/2000/svg";
12
- var BOX_TEXT_INSET = 12;
13
- var TITLE_BASELINE = 26;
14
- var TITLE_LINE_HEIGHT = 20;
15
- var BODY_LINE_HEIGHT = 18;
16
- var NOTE_LINE_HEIGHT = 17;
17
- var MUTED_INDENT = 14;
18
- var COLUMN_TITLE_LINE_HEIGHT = 16;
19
- var UNIT_LABEL_BASELINE = 24;
20
- var UNIT_LABEL_HEIGHT = 18;
21
- var PLAN_TITLE = "Plan";
22
- var LINKED_BOARD_TEXT = "open linked board";
23
- var PORT_RADIUS = 5;
24
- var BAND_LABEL_BASELINE = 17;
25
- var LOOP_BADGE_RADIUS = 6;
26
- var LOOP_BADGE_INSET = 20;
27
- var DECISION_POINT_INSET = 12;
28
- var OUTPUT_LABEL_BASELINE_OFFSET = 4;
29
- var OUTPUT_DOT_RADIUS = 3;
30
- var MONO_CHAR_WIDTH = 7.2;
31
- var CODE_BAND_RISE = 13;
32
- var CODE_BAND_HEIGHT = 17;
33
- var ITEM_DOT_RADIUS = 2.2;
34
- var LEGEND_SAMPLE_WIDTH = 28;
35
- var STANDALONE_STYLE = `
36
- svg { font-family: 'ComicMono', 'CommitMono', 'Cascadia Code', 'Menlo', monospace; }
37
- .wb-backdrop { fill: #0d0b16; }
38
- .wb-column-title { fill: #a79fc4; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
39
- .wb-column-rule { stroke: #4a4268; stroke-width: 1; stroke-dasharray: 2 5; }
40
- .wb-band-rule { stroke: #2a2440; stroke-width: 1; }
41
- .wb-band-label { font-size: 12px; font-weight: 700; }
42
- .wb-box-outline { fill: #15122a; stroke: #a79fc4; stroke-width: 1.6; }
43
- .wb-change-added .wb-box-outline { stroke: #22c55e; stroke-dasharray: 7 5; }
44
- .wb-change-removed { opacity: 0.6; }
45
- .wb-change-removed .wb-box-outline { fill: transparent; stroke: #ef4444; stroke-dasharray: 7 5; }
46
- .wb-change-removed .wb-box-title { text-decoration: line-through; }
47
- .wb-change-relabeled .wb-box-outline { stroke: #f5c26b; }
48
- .wb-box-was { fill: #a79fc4; font-size: 16px; text-decoration: line-through; }
49
- .wb-legend-swatch.wb-box-outline { stroke-width: 1.6; }
50
- .wb-box-title { fill: #e6e0f5; font-size: 16px; font-weight: 700; }
51
- .wb-box-line { fill: #e6e0f5; font-size: 12px; }
52
- .wb-box-line.wb-muted { fill: #a79fc4; }
53
- .wb-line-code { fill: #c4b5fd; }
54
- .wb-code-band { fill: #221d3a; }
55
- .wb-line-marker { fill: #a79fc4; font-size: 12px; }
56
- .wb-line-key { fill: #a79fc4; font-size: 12px; font-weight: 700; }
57
- .wb-item-dot { fill: #a79fc4; }
58
- .wb-panel-outline { fill: #110f20; stroke: #4a4268; stroke-width: 1.4; }
59
- .wb-panel-rule { stroke: #4a4268; stroke-width: 1; }
60
- .wb-output-divider { stroke: #4a4268; stroke-width: 1; }
61
- .wb-output-label { fill: #e6e0f5; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
62
- .wb-output-dot { fill: #a79fc4; }
63
- .wb-lane-pill { fill: transparent; stroke-width: 1.2; }
64
- .wb-lane-pill-text { font-size: 12px; font-weight: 700; }
65
- .wb-unit-outline { fill: #15122a; stroke: #c084fc; stroke-width: 1.6; }
66
- .wb-unit-label, .wb-unit-link { fill: #c084fc; font-size: 12px; font-weight: 700; }
67
- .wb-unit-status { fill: #a79fc4; font-size: 11px; }
68
- .wb-unit-building { fill: #f59e0b; }
69
- .wb-unit-landed { fill: #22c55e; }
70
- .wb-frame-outline { fill: rgba(192, 132, 252, 0.04); stroke: #4a4268; stroke-width: 1.4; stroke-dasharray: 10 6; }
71
- .wb-frame-title { fill: #a79fc4; font-size: 12px; font-weight: 700; }
72
- .wb-loop .wb-frame-outline { stroke: #c084fc; }
73
- .wb-loop-badge { fill: none; stroke: #c084fc; stroke-width: 1.6; }
74
- .wb-back .wb-wire-line { stroke: #c084fc; }
75
- .wb-wire-hit, .wb-port { display: none; }
76
- .wb-wire-line { fill: none; stroke: #a79fc4; stroke-width: 1.6; }
77
- .wb-wire-line.wb-dashed { stroke-dasharray: 7 6; }
78
- .wb-tone-fail .wb-wire-line { stroke: #ef4444; }
79
- .wb-tone-join .wb-wire-line { stroke: #c084fc; }
80
- .wb-wire-dot { fill: #a79fc4; }
81
- .wb-wire-label { fill: #e6e0f5; font-size: 12px; text-anchor: middle; paint-order: stroke; stroke: #0d0b16; stroke-width: 5; }
82
- .wb-note-card { fill: #2a2213; stroke: #f5c26b; stroke-width: 1.2; }
83
- .wb-note-text { fill: #f8e7c4; font-size: 12px; }
84
- .wb-note-byline { fill: #c9a868; font-size: 12px; }
85
- .wb-resolved { opacity: 0.5; }
86
- .wb-legend-text { fill: #a79fc4; font-size: 12px; }
87
- .wb-caption { fill: #a79fc4; font-size: 14px; }
88
- `;
89
- function attributesMarkup(attributes) {
90
- return Object.entries(attributes).flatMap(([name, value]) => value === null ? [] : [` ${name}="${escapeMarkup(value)}"`]).join("");
91
- }
92
- function tag(name, attributes, children = "") {
93
- return `<${name}${attributesMarkup(attributes)}>${children}</${name}>`;
94
- }
95
- function text(content, x, y, className, extra = {}) {
96
- return tag("text", {
97
- x,
98
- y,
99
- class: className,
100
- ...extra
101
- }, escapeMarkup(content));
102
- }
103
- function elementGroup(element, className, children) {
104
- return tag("g", {
105
- class: `wb-element ${className}`,
106
- "data-element-id": element.id,
107
- "data-element-kind": element.kind
108
- }, children.join(""));
109
- }
110
- function laneStroke(hex) {
111
- return hex ? `stroke:${hex}` : null;
112
- }
113
- function decisionOutlinePath(box) {
114
- const right = box.x + box.width;
115
- const headerMidY = box.y + box.headerHeight / 2;
116
- const top = `M${box.x + DECISION_POINT_INSET},${box.y} H${right - DECISION_POINT_INSET} L${right},${headerMidY}`;
117
- if (box.outputs.length === 0) return `${top} L${right - DECISION_POINT_INSET},${box.y + box.height} H${box.x + DECISION_POINT_INSET} L${box.x},${headerMidY} Z`;
118
- return `${top} V${box.y + box.height} H${box.x} V${headerMidY} Z`;
119
- }
120
- function outputRowsMarkup(box) {
121
- return box.outputs.flatMap((output) => {
122
- const rowHalfHeight = (box.height - box.headerHeight) / box.outputs.length / 2;
123
- const rowTop = output.port.y - rowHalfHeight;
124
- return [
125
- tag("line", {
126
- x1: box.x,
127
- y1: rowTop,
128
- x2: box.x + box.width,
129
- y2: rowTop,
130
- class: "wb-output-divider"
131
- }),
132
- text(output.label, box.x + BOX_TEXT_INSET, output.port.y + OUTPUT_LABEL_BASELINE_OFFSET, "wb-output-label"),
133
- tag("circle", {
134
- cx: output.port.x,
135
- cy: output.port.y,
136
- r: OUTPUT_DOT_RADIUS,
137
- class: "wb-output-dot"
138
- })
139
- ];
140
- });
141
- }
142
- function lineClassOf(line) {
143
- if (line.style === "code") return "wb-box-line wb-line-code";
144
- return line.muted ? "wb-box-line wb-muted" : "wb-box-line";
145
- }
146
- function lineRowMarkup(line, left, width, baseline) {
147
- const rowLeft = left + BOX_TEXT_INSET + (line.muted ? MUTED_INDENT : 0);
148
- const parts = [];
149
- if (line.style === "code") parts.push(tag("rect", {
150
- x: rowLeft - 4,
151
- y: baseline - CODE_BAND_RISE,
152
- width: left + width - BOX_TEXT_INSET + 4 - rowLeft + 4,
153
- height: CODE_BAND_HEIGHT,
154
- rx: 3,
155
- class: "wb-code-band"
156
- }));
157
- if (line.style === "item" && line.isFirstRow) parts.push(tag("circle", {
158
- cx: rowLeft + 4,
159
- cy: baseline - 4,
160
- r: ITEM_DOT_RADIUS,
161
- class: "wb-item-dot"
162
- }));
163
- if (line.marker !== null) parts.push(text(line.marker, rowLeft, baseline, line.style === "kv" ? "wb-line-key" : "wb-line-marker"));
164
- if (line.text) parts.push(text(line.text, rowLeft + line.indentChars * MONO_CHAR_WIDTH, baseline, lineClassOf(line)));
165
- return parts;
166
- }
167
- function bodyLinesMarkup(lines, left, width, top) {
168
- return lines.flatMap((line, index) => lineRowMarkup(line, left, width, top + index * BODY_LINE_HEIGHT));
169
- }
170
- function panelMarkup(panel) {
171
- const parts = [tag("rect", {
172
- x: panel.x,
173
- y: panel.y,
174
- width: panel.width,
175
- height: panel.height,
176
- rx: 6,
177
- class: "wb-panel-outline"
178
- })];
179
- panel.titleLines.forEach((line, index) => {
180
- parts.push(text(line, panel.x + BOX_TEXT_INSET, panel.y + TITLE_BASELINE + index * TITLE_LINE_HEIGHT, "wb-box-title"));
181
- });
182
- const bodyTop = panel.y + TITLE_BASELINE + panel.titleLines.length * TITLE_LINE_HEIGHT;
183
- if (panel.bodyLines.length > 0) parts.push(tag("line", {
184
- x1: panel.x + BOX_TEXT_INSET,
185
- y1: bodyTop - 12,
186
- x2: panel.x + panel.width - BOX_TEXT_INSET,
187
- y2: bodyTop - 12,
188
- class: "wb-panel-rule"
189
- }));
190
- parts.push(...bodyLinesMarkup(panel.bodyLines, panel.x, panel.width, bodyTop));
191
- return elementGroup(panel, "wb-panel", parts);
192
- }
193
- function boxOutlineMarkup(box) {
194
- if (box.shape === "decision") return tag("path", {
195
- d: decisionOutlinePath(box),
196
- class: "wb-box-outline",
197
- style: laneStroke(box.lane?.hex)
198
- });
199
- return tag("rect", {
200
- x: box.x,
201
- y: box.y,
202
- width: box.width,
203
- height: box.height,
204
- rx: 8,
205
- class: "wb-box-outline",
206
- style: laneStroke(box.lane?.hex)
207
- });
208
- }
209
- function boxMarkup(box) {
210
- const parts = [boxOutlineMarkup(box), ...outputRowsMarkup(box)];
211
- const midX = box.x + box.width / 2;
212
- const midY = box.y + box.height / 2;
213
- for (const [cx, cy] of [
214
- [midX, box.y],
215
- [box.x + box.width, midY],
216
- [midX, box.y + box.height],
217
- [box.x, midY]
218
- ]) parts.push(tag("circle", {
219
- cx,
220
- cy,
221
- r: PORT_RADIUS,
222
- class: "wb-port"
223
- }));
224
- box.wasLines.forEach((line, index) => {
225
- parts.push(text(line, box.x + BOX_TEXT_INSET, box.y + TITLE_BASELINE + index * TITLE_LINE_HEIGHT, "wb-box-was"));
226
- });
227
- const titleTop = box.y + TITLE_BASELINE + box.wasLines.length * TITLE_LINE_HEIGHT;
228
- box.titleLines.forEach((line, index) => {
229
- parts.push(text(line, box.x + BOX_TEXT_INSET, titleTop + index * TITLE_LINE_HEIGHT, "wb-box-title"));
230
- });
231
- const bodyTop = titleTop + box.titleLines.length * TITLE_LINE_HEIGHT;
232
- parts.push(...bodyLinesMarkup(box.bodyLines, box.x, box.width, bodyTop));
233
- if (box.lane && box.showsLanePill) {
234
- const pillY = box.y + box.headerHeight - 28;
235
- const pillWidth = Math.min(box.width - 24, 16 + box.lane.label.length * 8);
236
- parts.push(tag("rect", {
237
- x: box.x + BOX_TEXT_INSET,
238
- y: pillY,
239
- width: pillWidth,
240
- height: 18,
241
- rx: 9,
242
- class: "wb-lane-pill",
243
- style: laneStroke(box.lane.hex)
244
- }), text(box.lane.label, box.x + BOX_TEXT_INSET + 8, pillY + 13, "wb-lane-pill-text", { style: `fill:${box.lane.hex}` }));
245
- }
246
- return elementGroup(box, box.change === "none" ? "wb-box" : `wb-box wb-change-${box.change}`, parts);
247
- }
248
- function loopBadgeMarkup(frame) {
249
- const centerX = frame.x + frame.width - LOOP_BADGE_INSET;
250
- const centerY = frame.y + LOOP_BADGE_RADIUS + 6;
251
- return tag("path", {
252
- d: `M ${centerX + LOOP_BADGE_RADIUS} ${centerY} A ${LOOP_BADGE_RADIUS} ${LOOP_BADGE_RADIUS} 0 1 1 ${centerX} ${centerY - LOOP_BADGE_RADIUS}`,
253
- "marker-end": "url(#wb-arrow)",
254
- class: "wb-loop-badge"
255
- });
256
- }
257
- function frameMarkup(frame) {
258
- const parts = [tag("rect", {
259
- x: frame.x,
260
- y: frame.y,
261
- width: frame.width,
262
- height: frame.height,
263
- rx: 12,
264
- class: "wb-frame-outline"
265
- }), text(frame.title, frame.x + 14, frame.y + 18, "wb-frame-title")];
266
- if (frame.isLoop) parts.push(loopBadgeMarkup(frame));
267
- return elementGroup(frame, frame.isLoop ? "wb-frame wb-loop" : "wb-frame", parts);
268
- }
269
- function wireMarkup(wire) {
270
- const parts = [
271
- tag("path", {
272
- d: wire.path,
273
- class: "wb-wire-hit"
274
- }),
275
- tag("path", {
276
- d: wire.path,
277
- "marker-end": wire.hasArrowhead ? "url(#wb-arrow)" : null,
278
- class: wire.isDashed ? "wb-wire-line wb-dashed" : "wb-wire-line",
279
- style: laneStroke(wire.strokeHex ?? void 0)
280
- }),
281
- tag("circle", {
282
- cx: wire.start.x,
283
- cy: wire.start.y,
284
- r: 3,
285
- class: "wb-wire-dot"
286
- })
287
- ];
288
- if (wire.joinAt) parts.push(tag("circle", {
289
- cx: wire.joinAt.x,
290
- cy: wire.joinAt.y,
291
- r: 3,
292
- class: "wb-wire-dot"
293
- }));
294
- if (wire.label) parts.push(text(wire.label, wire.labelAt.x, wire.labelAt.y, "wb-wire-label"));
295
- return elementGroup(wire, wire.isBack ? `wb-wire wb-back wb-tone-${wire.tone}` : `wb-wire wb-tone-${wire.tone}`, parts);
296
- }
297
- function noteMarkup(note) {
298
- const parts = [tag("rect", {
299
- x: note.x,
300
- y: note.y,
301
- width: note.width,
302
- height: note.height,
303
- rx: 4,
304
- class: "wb-note-card"
305
- })];
306
- note.lines.forEach((line, index) => {
307
- parts.push(text(line, note.x + 10, note.y + 22 + index * NOTE_LINE_HEIGHT, "wb-note-text"));
308
- });
309
- if (note.byline) parts.push(text(note.byline, note.x + 10, note.y + 22 + note.lines.length * NOTE_LINE_HEIGHT, "wb-note-byline"));
310
- return elementGroup(note, note.isResolved ? "wb-note wb-resolved" : "wb-note", parts);
311
- }
312
- function unitMarkup(unit) {
313
- const parts = [
314
- tag("rect", {
315
- x: unit.x,
316
- y: unit.y,
317
- width: unit.width,
318
- height: unit.height,
319
- rx: 8,
320
- class: "wb-unit-outline"
321
- }),
322
- text(unit.label, unit.x + BOX_TEXT_INSET, unit.y + UNIT_LABEL_BASELINE, "wb-unit-label"),
323
- text(unit.status, unit.x + unit.width - BOX_TEXT_INSET, unit.y + UNIT_LABEL_BASELINE, `wb-unit-status wb-unit-${unit.status}`, { "text-anchor": "end" })
324
- ];
325
- const titleTop = unit.y + UNIT_LABEL_BASELINE + UNIT_LABEL_HEIGHT;
326
- unit.titleLines.forEach((line, index) => {
327
- parts.push(text(line, unit.x + BOX_TEXT_INSET, titleTop + index * TITLE_LINE_HEIGHT, "wb-box-title"));
328
- });
329
- const bodyTop = titleTop + unit.titleLines.length * TITLE_LINE_HEIGHT;
330
- parts.push(...bodyLinesMarkup(unit.bodyLines, unit.x, unit.width, bodyTop));
331
- if (unit.linkedBoardId) parts.push(text(LINKED_BOARD_TEXT, unit.x + BOX_TEXT_INSET, bodyTop + unit.bodyLines.length * BODY_LINE_HEIGHT, "wb-unit-link", { "data-linked-board-id": unit.linkedBoardId }));
332
- return elementGroup(unit, "wb-unit", parts);
333
- }
334
- function elementMarkup(element) {
335
- switch (element.kind) {
336
- case "box": return boxMarkup(element);
337
- case "frame": return frameMarkup(element);
338
- case "wire": return wireMarkup(element);
339
- case "note": return noteMarkup(element);
340
- case "unit": return unitMarkup(element);
341
- case "panel": return panelMarkup(element);
342
- }
343
- }
344
- function chromeMarkup(layout) {
345
- const parts = [];
346
- if (layout.plan) {
347
- parts.push(text(PLAN_TITLE, layout.plan.titleAt.x, layout.plan.titleAt.y, "wb-column-title"));
348
- for (const arrowPath of layout.plan.arrowPaths) parts.push(tag("path", {
349
- d: arrowPath,
350
- "marker-end": "url(#wb-arrow)",
351
- class: "wb-wire-line"
352
- }));
353
- }
354
- for (const band of layout.bands) {
355
- parts.push(tag("line", {
356
- x1: band.x,
357
- y1: band.y,
358
- x2: band.x + band.width,
359
- y2: band.y,
360
- class: "wb-band-rule"
361
- }));
362
- if (band.label) parts.push(text(band.label, band.x, band.y + BAND_LABEL_BASELINE, "wb-band-label", { style: `fill:${band.hex}` }));
363
- }
364
- for (const column of layout.columns) {
365
- if (column.titleLines.length === 0) continue;
366
- column.titleLines.forEach((line, index) => {
367
- parts.push(text(line, column.x, column.titleBaselineY + index * COLUMN_TITLE_LINE_HEIGHT, "wb-column-title"));
368
- });
369
- parts.push(tag("line", {
370
- x1: column.x,
371
- y1: column.ruleY,
372
- x2: column.x + column.width,
373
- y2: column.ruleY,
374
- class: "wb-column-rule"
375
- }));
376
- }
377
- for (const entry of layout.legend) parts.push(legendRowMarkup(entry));
378
- if (layout.caption) parts.push(text(layout.caption.text, layout.caption.x, layout.caption.y + 16, "wb-caption"));
379
- return tag("g", { class: "wb-chrome" }, parts.join(""));
380
- }
381
- function legendSwatchMarkup(entry) {
382
- const { swatch } = entry;
383
- if (swatch.kind === "lane") return tag("rect", {
384
- x: entry.x,
385
- y: entry.y,
386
- width: 14,
387
- height: 14,
388
- rx: 3,
389
- class: "wb-legend-swatch",
390
- style: `fill:${swatch.hex}`
391
- });
392
- if (swatch.kind === "change") return tag("g", { class: `wb-change-${swatch.change}` }, tag("rect", {
393
- x: entry.x,
394
- y: entry.y,
395
- width: LEGEND_SAMPLE_WIDTH,
396
- height: 14,
397
- rx: 3,
398
- class: "wb-legend-swatch wb-box-outline"
399
- }));
400
- const sample = tag("path", {
401
- d: `M${entry.x},${entry.y + 7} H${entry.x + LEGEND_SAMPLE_WIDTH}`,
402
- "marker-end": "url(#wb-arrow)",
403
- class: swatch.isDashed ? "wb-wire-line wb-dashed" : "wb-wire-line"
404
- });
405
- return tag("g", { class: swatch.isBack ? `wb-back wb-tone-${swatch.tone}` : `wb-tone-${swatch.tone}` }, sample);
406
- }
407
- function legendRowMarkup(entry) {
408
- const labelX = entry.x + (entry.swatch.kind === "lane" ? 22 : 40);
409
- return legendSwatchMarkup(entry) + text(entry.label, labelX, entry.y + 12, "wb-legend-text");
410
- }
411
- function arrowDefinitionsMarkup() {
412
- return tag("defs", {}, tag("marker", {
413
- id: "wb-arrow",
414
- viewBox: "0 0 10 10",
415
- refX: 9,
416
- refY: 5,
417
- markerWidth: 8,
418
- markerHeight: 8,
419
- orient: "auto-start-reverse"
420
- }, tag("path", {
421
- d: "M 0 1 L 10 5 L 0 9 z",
422
- fill: "context-stroke"
423
- })));
424
- }
425
- var LAYER_ORDER = [
426
- "frame",
427
- "wire",
428
- "box",
429
- "panel",
430
- "note",
431
- "unit"
432
- ];
433
- function boardSvgDocument(layout) {
434
- const { x, y, width, height } = layout.bounds;
435
- const layers = LAYER_ORDER.map((kind) => tag("g", { class: "wb-layer" }, layout.elements.filter((element) => element.kind === kind).map(elementMarkup).join("")));
436
- const body = [
437
- tag("style", {}, STANDALONE_STYLE),
438
- arrowDefinitionsMarkup(),
439
- tag("rect", {
440
- x,
441
- y,
442
- width,
443
- height,
444
- class: "wb-backdrop"
445
- }),
446
- chromeMarkup(layout),
447
- ...layers
448
- ].join("");
449
- return `${tag("svg", {
450
- xmlns: SVG_NAMESPACE,
451
- viewBox: `${x} ${y} ${width} ${height}`,
452
- width,
453
- height
454
- }, body)}\n`;
455
- }
456
- //#endregion
457
10
  //#region server/agent-api-cli.ts
458
11
  var AGENT_PATH_PREFIX = "/agent/";
459
12
  var HELP_LIMITS_TIMEOUT_MS = 2e3;