pilotswarm 0.5.24 → 0.5.26
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/package.json +5 -3
- package/ui/core/src/selectors.js +7 -3
- package/ui/react/src/web-app.js +80 -11
- package/web/dist/assets/{abnfDiagram-VRR7QNED-Bjz_3uNq.js → abnfDiagram-VRR7QNED-C4qRR7va.js} +1 -1
- package/web/dist/assets/{arc-a3km8Cfi.js → arc-BQw2V2pL.js} +1 -1
- package/web/dist/assets/{architectureDiagram-ZJ3FMSHR-4twPAKdk.js → architectureDiagram-ZJ3FMSHR-DMdWnLGG.js} +1 -1
- package/web/dist/assets/{blockDiagram-677ZJIJ3-FnFRjWxr.js → blockDiagram-677ZJIJ3-DZnALw8j.js} +1 -1
- package/web/dist/assets/{c4Diagram-LMCZKHZV-B8R4iXqh.js → c4Diagram-LMCZKHZV-BGGZ42iX.js} +1 -1
- package/web/dist/assets/channel-CB157dQ5.js +1 -0
- package/web/dist/assets/{chunk-2Q5K7J3B-C7dcVQSj.js → chunk-2Q5K7J3B-Dastiegd.js} +1 -1
- package/web/dist/assets/{chunk-32BRIVSS-DQQ_NOog.js → chunk-32BRIVSS-B4XexRzf.js} +1 -1
- package/web/dist/assets/{chunk-5VM5RSS4-BRR5_oWJ.js → chunk-5VM5RSS4-D66MNGCN.js} +1 -1
- package/web/dist/assets/{chunk-EX3LRPZG-C0Jg_k6w.js → chunk-EX3LRPZG-DeqPS4Xm.js} +1 -1
- package/web/dist/assets/{chunk-JWPE2WC7-CoHkckoP.js → chunk-JWPE2WC7-DIMWiXpM.js} +1 -1
- package/web/dist/assets/{chunk-MOJQB5TN-CTIj5Opw.js → chunk-MOJQB5TN-vTyL0qgx.js} +1 -1
- package/web/dist/assets/{chunk-RYQCIY6F-BsP4OCo4.js → chunk-RYQCIY6F-C7U9MKGw.js} +1 -1
- package/web/dist/assets/{chunk-V7JOEXUC-B5KS36_O.js → chunk-V7JOEXUC-BzPwQ7n3.js} +1 -1
- package/web/dist/assets/{chunk-VR4S4FIN-Dm92_7ut.js → chunk-VR4S4FIN-CmDsyK3b.js} +1 -1
- package/web/dist/assets/{chunk-XXDRQBXY-BGivbXmv.js → chunk-XXDRQBXY-ZJn6BaGL.js} +1 -1
- package/web/dist/assets/classDiagram-OUVF2IWQ-B6JwBYlv.js +1 -0
- package/web/dist/assets/classDiagram-v2-EOCWNBFH-B6JwBYlv.js +1 -0
- package/web/dist/assets/{cose-bilkent-JH36ORCC-DVjdL84y.js → cose-bilkent-JH36ORCC-CAA8JZZM.js} +1 -1
- package/web/dist/assets/{cynefin-VYW2F7L2-pcKhk42O.js → cynefin-VYW2F7L2-B6pX-lUD.js} +1 -1
- package/web/dist/assets/{cynefinDiagram-TSTJHNR4-CdHQXyCH.js → cynefinDiagram-TSTJHNR4-sKTHU_UH.js} +1 -1
- package/web/dist/assets/{dagre-VKFMJZFB-Okt50Noy.js → dagre-VKFMJZFB-EuakJ578.js} +1 -1
- package/web/dist/assets/{diagram-FQU43EPY-D52R5ow3.js → diagram-FQU43EPY-DR3M_pic.js} +1 -1
- package/web/dist/assets/{diagram-G47NLZAW-KiJTa2OF.js → diagram-G47NLZAW-BlS6yM0u.js} +1 -1
- package/web/dist/assets/{diagram-NH7WQ7WH-DZ-NFYLH.js → diagram-NH7WQ7WH-CQNXe6dc.js} +1 -1
- package/web/dist/assets/{diagram-OA4YK3LP-et-Lf7yH.js → diagram-OA4YK3LP-BizBeSQo.js} +1 -1
- package/web/dist/assets/{diagram-WEI45ONY-eXhZ7Ksl.js → diagram-WEI45ONY-C-_KM6Gg.js} +1 -1
- package/web/dist/assets/{ebnfDiagram-CCIWWBDH-CTWYusI0.js → ebnfDiagram-CCIWWBDH-BapWEdic.js} +1 -1
- package/web/dist/assets/{erDiagram-Q63AITRT-DwTN2EqF.js → erDiagram-Q63AITRT-Btijn1Xj.js} +1 -1
- package/web/dist/assets/{flowDiagram-23GEKE2U-CmxOIpNk.js → flowDiagram-23GEKE2U-D8zK8HkH.js} +1 -1
- package/web/dist/assets/{ganttDiagram-NO4QXBWP-TsPnDFPN.js → ganttDiagram-NO4QXBWP-DyjkOIMW.js} +1 -1
- package/web/dist/assets/{gitGraphDiagram-IHSO6WYX-B_IVM0u8.js → gitGraphDiagram-IHSO6WYX-3r9_QeYN.js} +1 -1
- package/web/dist/assets/{index-CB16o5aO.js → index-CIt9PdC-.js} +2 -2
- package/web/dist/assets/index-CT2_MRcC.css +1 -0
- package/web/dist/assets/{infoDiagram-FWYZ7A6U-BFjk6921.js → infoDiagram-FWYZ7A6U-Ccd8ACUz.js} +1 -1
- package/web/dist/assets/{ishikawaDiagram-FXEZZL3T-BiTzJYKW.js → ishikawaDiagram-FXEZZL3T-DPRUC8V2.js} +1 -1
- package/web/dist/assets/{journeyDiagram-5HDEW3XC-eeyGUQSj.js → journeyDiagram-5HDEW3XC-CkvayMsL.js} +1 -1
- package/web/dist/assets/{kanban-definition-HUTT4EX6-DPYZ3frK.js → kanban-definition-HUTT4EX6-CAK9Z-ha.js} +1 -1
- package/web/dist/assets/{linear-Buu9IOJQ.js → linear-B-_ZjN2w.js} +1 -1
- package/web/dist/assets/{mermaid.core-xO1oSQS3.js → mermaid.core-BN9c--2r.js} +4 -4
- package/web/dist/assets/{mindmap-definition-LN4V7U3C-TasB4KZ4.js → mindmap-definition-LN4V7U3C-DuD_AHRU.js} +1 -1
- package/web/dist/assets/{pegDiagram-2B236MQR-Btr2u_Xy.js → pegDiagram-2B236MQR-Cc1v58KA.js} +1 -1
- package/web/dist/assets/{pieDiagram-ENE6RG2P-0iBpCJcu.js → pieDiagram-ENE6RG2P-Bc32--ur.js} +1 -1
- package/web/dist/assets/{pilotswarm-v4IdVngK.js → pilotswarm-BgzdDy09.js} +24 -24
- package/web/dist/assets/{quadrantDiagram-ABIIQ3AL-CbVQOzUs.js → quadrantDiagram-ABIIQ3AL-DpPTc2EP.js} +1 -1
- package/web/dist/assets/{railroadDiagram-RFXS5EU6-BkwzDhMx.js → railroadDiagram-RFXS5EU6-DXMzwejw.js} +1 -1
- package/web/dist/assets/{requirementDiagram-TGXJPOKE-DpF9yvmD.js → requirementDiagram-TGXJPOKE-B3ImAxw-.js} +1 -1
- package/web/dist/assets/{sankeyDiagram-HTMAVEWB-CjvbElms.js → sankeyDiagram-HTMAVEWB-hmVMffE2.js} +1 -1
- package/web/dist/assets/{sequenceDiagram-DBY2YBRQ-DRj2K28H.js → sequenceDiagram-DBY2YBRQ-D53fk6uF.js} +1 -1
- package/web/dist/assets/{sizeCapture-X5ZJPWSS-Bi3gxz8F.js → sizeCapture-X5ZJPWSS-4U-I5d2g.js} +1 -1
- package/web/dist/assets/{stateDiagram-2N3HPSRC-_INdmyGU.js → stateDiagram-2N3HPSRC-0Y5TgWhW.js} +1 -1
- package/web/dist/assets/stateDiagram-v2-6OUMAXLB-DqIcGfAY.js +1 -0
- package/web/dist/assets/{swimlanes-5IMT3BWC-D1pFtL4Y.js → swimlanes-5IMT3BWC-Umhy4qUu.js} +2 -2
- package/web/dist/assets/swimlanesDiagram-G3AALYLV-DA9txLi6.js +8 -0
- package/web/dist/assets/{timeline-definition-FHXFAJF6-PYQ9uRSp.js → timeline-definition-FHXFAJF6-D5hOg3Qu.js} +1 -1
- package/web/dist/assets/{vennDiagram-L72KCM5P-xCF6u31z.js → vennDiagram-L72KCM5P-QVIcE3UD.js} +1 -1
- package/web/dist/assets/{wardleyDiagram-EHGQE667-DPcm9Msn.js → wardleyDiagram-EHGQE667-BEj1M2cB.js} +1 -1
- package/web/dist/assets/{xychartDiagram-FW5EYKEG-D9ZNU0hG.js → xychartDiagram-FW5EYKEG-xojRIXIf.js} +1 -1
- package/web/dist/index.html +3 -3
- package/web/dist/assets/channel-BQwFhqIW.js +0 -1
- package/web/dist/assets/classDiagram-OUVF2IWQ-C12RKvcF.js +0 -1
- package/web/dist/assets/classDiagram-v2-EOCWNBFH-C12RKvcF.js +0 -1
- package/web/dist/assets/index-CN_7NnbR.css +0 -1
- package/web/dist/assets/stateDiagram-v2-6OUMAXLB-A5HcuE43.js +0 -1
- package/web/dist/assets/swimlanesDiagram-G3AALYLV-Bf_Rn9Zk.js +0 -8
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pilotswarm",
|
|
3
|
-
"version": "0.5.
|
|
4
|
-
"description": "PilotSwarm application package: terminal UI, browser portal + Web API server, and MCP server
|
|
3
|
+
"version": "0.5.26",
|
|
4
|
+
"description": "PilotSwarm application package: terminal UI, browser portal + Web API server, and MCP server \u2014 one install, three bins.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -67,7 +67,9 @@
|
|
|
67
67
|
"test:mcp:integration": "node mcp/test/integration/smoke.live.mjs",
|
|
68
68
|
"test:mcp:integration:horizondb": "MCP_PARITY_REQUIRE=search,graph node --env-file=../../.env.horizondb mcp/test/integration/parity.live.mjs",
|
|
69
69
|
"test:mcp:integration:all": "node mcp/test/integration/smoke.live.mjs && node mcp/test/integration/tools.live.mjs && node mcp/test/integration/edge-cases.live.mjs && node mcp/test/integration/verify.live.mjs && node mcp/test/integration/parity.live.mjs",
|
|
70
|
-
"clean": "rm -rf web/dist mcp/dist"
|
|
70
|
+
"clean": "rm -rf web/dist mcp/dist",
|
|
71
|
+
"test:e2e": "playwright test --config=web/playwright.config.mjs",
|
|
72
|
+
"test:e2e:ui": "playwright test --config=web/playwright.config.mjs --ui"
|
|
71
73
|
},
|
|
72
74
|
"dependencies": {
|
|
73
75
|
"@azure/msal-browser": "^4.26.1",
|
package/ui/core/src/selectors.js
CHANGED
|
@@ -2574,11 +2574,15 @@ export function selectOutboxOverlayLines(state, maxWidth = 80, options = {}) {
|
|
|
2574
2574
|
if (rejectedCount > 0) parts.push(`${rejectedCount} rejected`);
|
|
2575
2575
|
const label = parts.length > 0 ? parts.join(" · ") : "queued prompts";
|
|
2576
2576
|
const labelText = ` queued prompts: ${label} `;
|
|
2577
|
-
|
|
2577
|
+
// The trailing rule is drawn by CSS, not by repeating "─" to a computed
|
|
2578
|
+
// character count. That count is derived from a pane width measured in
|
|
2579
|
+
// CHARACTERS, and when the estimate exceeds what actually fits — easily
|
|
2580
|
+
// triggered by a font-size change, or by probing a pane whose font differs
|
|
2581
|
+
// from this one — label + rule overflow and the rule wraps onto its own
|
|
2582
|
+
// line. A flex rule fills whatever space is really left, at any font size.
|
|
2578
2583
|
const lines = [
|
|
2579
2584
|
[
|
|
2580
|
-
{ text: labelText, color: "gray" },
|
|
2581
|
-
{ text: "─".repeat(rightRule), color: "gray" },
|
|
2585
|
+
{ text: labelText, color: "gray", trailingRule: true },
|
|
2582
2586
|
],
|
|
2583
2587
|
];
|
|
2584
2588
|
|
package/ui/react/src/web-app.js
CHANGED
|
@@ -745,6 +745,10 @@ function useScrollSync(ref, lines, scrollOffset, scrollMode, paneKey, controller
|
|
|
745
745
|
};
|
|
746
746
|
}, [normalizedLines, ref, scrollMode, scrollOffset, stickyBottom, viewportRevision]);
|
|
747
747
|
|
|
748
|
+
const dispatchScrollOffset = useFrameCoalescedCallback((offset) => {
|
|
749
|
+
controller.dispatch({ type: "ui/scroll", pane: paneKey, offset });
|
|
750
|
+
});
|
|
751
|
+
|
|
748
752
|
const onScroll = React.useCallback(() => {
|
|
749
753
|
const node = ref.current;
|
|
750
754
|
if (!node || !paneKey) return;
|
|
@@ -779,15 +783,14 @@ function useScrollSync(ref, lines, scrollOffset, scrollMode, paneKey, controller
|
|
|
779
783
|
? Math.max(0, maxScroll - node.scrollTop)
|
|
780
784
|
: Math.max(0, node.scrollTop);
|
|
781
785
|
userScrollRef.current.lastDispatchedOffset = pixels / SCROLL_ROW_HEIGHT;
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
});
|
|
786
|
+
// One dispatch per frame. A scroll gesture fires far more events than
|
|
787
|
+
// the browser paints, and every dispatch notifies each subscriber —
|
|
788
|
+
// the offset the user actually sees is the last one in the frame.
|
|
789
|
+
dispatchScrollOffset(pixels / SCROLL_ROW_HEIGHT);
|
|
787
790
|
if (paneKey === "chat" && scrollMode === "bottom" && node.scrollTop <= PROGRAMMATIC_SCROLL_TOLERANCE_PX) {
|
|
788
791
|
controller.armChatTopHistoryLoad?.();
|
|
789
792
|
}
|
|
790
|
-
}, [controller, paneKey, ref, scrollMode, stickyBottom]);
|
|
793
|
+
}, [controller, dispatchScrollOffset, paneKey, ref, scrollMode, stickyBottom]);
|
|
791
794
|
|
|
792
795
|
const onWheel = React.useCallback((event) => {
|
|
793
796
|
const node = ref.current;
|
|
@@ -844,6 +847,16 @@ function Runs({ runs, theme }) {
|
|
|
844
847
|
fontWeight: run.bold ? 700 : 400,
|
|
845
848
|
textDecoration: run.underline ? "underline" : "none",
|
|
846
849
|
};
|
|
850
|
+
// A run flagged trailingRule renders its text then a CSS rule that
|
|
851
|
+
// fills the remaining width — see selectors.js for why this is not
|
|
852
|
+
// a repeated box-drawing character.
|
|
853
|
+
if (run?.trailingRule) {
|
|
854
|
+
return React.createElement("span", {
|
|
855
|
+
key: `${index}:rule`,
|
|
856
|
+
className: "ps-line-trailing-rule",
|
|
857
|
+
style,
|
|
858
|
+
}, run.text || "");
|
|
859
|
+
}
|
|
847
860
|
const href = String(run?.href || "").trim();
|
|
848
861
|
const isExternalHref = /^https?:\/\//i.test(href);
|
|
849
862
|
// artifact:// links used to render as an inert span — the only
|
|
@@ -892,7 +905,45 @@ function SystemNoticeLine({ line, theme }) {
|
|
|
892
905
|
: null);
|
|
893
906
|
}
|
|
894
907
|
|
|
895
|
-
|
|
908
|
+
/**
|
|
909
|
+
* Coalesce high-frequency dispatches to one per animation frame.
|
|
910
|
+
*
|
|
911
|
+
* pointermove and scroll fire many times per frame, and each dispatch
|
|
912
|
+
* notifies every subscriber, so a loaded transcript re-renders repeatedly
|
|
913
|
+
* between two painted frames — work that is thrown away before it is ever
|
|
914
|
+
* seen. Collapsing to one dispatch per frame keeps the interaction
|
|
915
|
+
* responsive without changing what the state ends up as: the LAST value in
|
|
916
|
+
* the frame wins, which is the one the user is actually looking at.
|
|
917
|
+
*/
|
|
918
|
+
function useFrameCoalescedCallback(fn) {
|
|
919
|
+
const frameRef = React.useRef(0);
|
|
920
|
+
const argsRef = React.useRef(null);
|
|
921
|
+
const fnRef = React.useRef(fn);
|
|
922
|
+
fnRef.current = fn;
|
|
923
|
+
|
|
924
|
+
React.useEffect(() => () => {
|
|
925
|
+
if (frameRef.current) cancelAnimationFrame(frameRef.current);
|
|
926
|
+
}, []);
|
|
927
|
+
|
|
928
|
+
return React.useCallback((...args) => {
|
|
929
|
+
argsRef.current = args;
|
|
930
|
+
if (frameRef.current) return;
|
|
931
|
+
frameRef.current = requestAnimationFrame(() => {
|
|
932
|
+
frameRef.current = 0;
|
|
933
|
+
const pending = argsRef.current;
|
|
934
|
+
argsRef.current = null;
|
|
935
|
+
if (pending) fnRef.current(...pending);
|
|
936
|
+
});
|
|
937
|
+
}, []);
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
/**
|
|
941
|
+
* Rendering a transcript is proportional to its length, so it must not repeat
|
|
942
|
+
* for state changes that do not alter the lines — scroll offset and pane
|
|
943
|
+
* resize both notify every subscriber. Memoizing on the line object keeps
|
|
944
|
+
* React from reconciling thousands of rows on every scroll event.
|
|
945
|
+
*/
|
|
946
|
+
const Line = React.memo(function Line({ line, theme, className = "" }) {
|
|
896
947
|
const lineClassName = className ? `ps-line ${className}` : "ps-line";
|
|
897
948
|
if (!line) {
|
|
898
949
|
return React.createElement("div", { className: lineClassName }, " ");
|
|
@@ -913,7 +964,7 @@ function Line({ line, theme, className = "" }) {
|
|
|
913
964
|
textDecoration: line.underline ? "underline" : "none",
|
|
914
965
|
},
|
|
915
966
|
}, line.text || " ");
|
|
916
|
-
}
|
|
967
|
+
});
|
|
917
968
|
|
|
918
969
|
function lineText(line) {
|
|
919
970
|
if (!line) return "";
|
|
@@ -5020,7 +5071,11 @@ function Toolbar({ controller, mobile, chatFocusMode = false, onToggleChatFocus
|
|
|
5020
5071
|
const [headerSlot, setHeaderSlot] = React.useState(null);
|
|
5021
5072
|
React.useEffect(() => {
|
|
5022
5073
|
if (typeof document === "undefined") return;
|
|
5023
|
-
|
|
5074
|
+
// Desktop centres the toolbar in the portal header regardless of chat
|
|
5075
|
+
// view — the terminal view was spending a whole strip on it while the
|
|
5076
|
+
// rich view had already handed that row back to the panes. Mobile keeps
|
|
5077
|
+
// the inline strip; there is no header room for it on a phone.
|
|
5078
|
+
setHeaderSlot(!mobile ? document.getElementById("ps-header-toolbar-slot") : null);
|
|
5024
5079
|
}, [richUi, mobile]);
|
|
5025
5080
|
const adminVisible = useControllerSelector(controller, (state) => Boolean(state.admin?.visible));
|
|
5026
5081
|
const chatView = useControllerSelector(controller, (state) => ({
|
|
@@ -5137,21 +5192,35 @@ function ColumnResizeHandle({ controller, paneAdjust = 0 }) {
|
|
|
5137
5192
|
document.body.classList.remove("is-resizing-pane-x");
|
|
5138
5193
|
};
|
|
5139
5194
|
|
|
5140
|
-
|
|
5195
|
+
// Apply at most one adjustment per frame. A drag emits pointermove far
|
|
5196
|
+
// faster than the browser paints, and each adjust re-renders every
|
|
5197
|
+
// pane — so most of that work was discarded before being displayed,
|
|
5198
|
+
// which is what made dragging a loaded layout feel heavy.
|
|
5199
|
+
let movePending = 0;
|
|
5200
|
+
let pendingClientX = 0;
|
|
5201
|
+
const applyMove = () => {
|
|
5202
|
+
movePending = 0;
|
|
5141
5203
|
const dragState = dragStateRef.current;
|
|
5142
5204
|
if (!dragState) return;
|
|
5143
|
-
const deltaCells = Math.round((
|
|
5205
|
+
const deltaCells = Math.round((pendingClientX - dragState.startX) / GRID_CELL_WIDTH);
|
|
5144
5206
|
const deltaIncrement = deltaCells - dragState.appliedCells;
|
|
5145
5207
|
if (!deltaIncrement) return;
|
|
5146
5208
|
controller.adjustPaneSplit(deltaIncrement);
|
|
5147
5209
|
dragState.appliedCells = deltaCells;
|
|
5148
5210
|
};
|
|
5211
|
+
const onPointerMove = (event) => {
|
|
5212
|
+
if (!dragStateRef.current) return;
|
|
5213
|
+
pendingClientX = event.clientX;
|
|
5214
|
+
if (movePending) return;
|
|
5215
|
+
movePending = requestAnimationFrame(applyMove);
|
|
5216
|
+
};
|
|
5149
5217
|
|
|
5150
5218
|
window.addEventListener("pointermove", onPointerMove);
|
|
5151
5219
|
window.addEventListener("pointerup", stopDragging);
|
|
5152
5220
|
window.addEventListener("pointercancel", stopDragging);
|
|
5153
5221
|
|
|
5154
5222
|
return () => {
|
|
5223
|
+
if (movePending) { cancelAnimationFrame(movePending); movePending = 0; }
|
|
5155
5224
|
window.removeEventListener("pointermove", onPointerMove);
|
|
5156
5225
|
window.removeEventListener("pointerup", stopDragging);
|
|
5157
5226
|
window.removeEventListener("pointercancel", stopDragging);
|
package/web/dist/assets/{abnfDiagram-VRR7QNED-Bjz_3uNq.js → abnfDiagram-VRR7QNED-C4qRR7va.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as p,r as u,d as a}from"./chunk-MOJQB5TN-
|
|
1
|
+
import{g as p,r as u,d as a}from"./chunk-MOJQB5TN-vTyL0qgx.js";import{p as f}from"./chunk-JWPE2WC7-DIMWiXpM.js";import{_ as n,l as o}from"./mermaid.core-BN9c--2r.js";import{M as c,b as d}from"./cynefin-VYW2F7L2-B6pX-lUD.js";import"./pilotswarm-BgzdDy09.js";var v=d().RailroadAbnf.parser.LangiumParser,i=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},B={parser:R,db:a,renderer:u,styles:p};export{B as diagram};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Y as ln,$ as an,a0 as F,a1 as q,a2 as j,a3 as un,a4 as y,a5 as tn,a6 as J,a7 as _,a8 as rn,a9 as o,aa as on,ab as sn,ac as fn}from"./mermaid.core-
|
|
1
|
+
import{Y as ln,$ as an,a0 as F,a1 as q,a2 as j,a3 as un,a4 as y,a5 as tn,a6 as J,a7 as _,a8 as rn,a9 as o,aa as on,ab as sn,ac as fn}from"./mermaid.core-BN9c--2r.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,I,D,v,A,z,a){var O=I-l,i=D-h,n=z-v,d=a-A,u=d*O-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*O,h+u*i]}function U(l,h,I,D,v,A,z){var a=l-I,O=h-D,i=(z?A:-A)/J(a*a+O*O),n=i*O,d=-i*a,u=l+n,s=h+d,f=I+n,c=D+d,B=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,S=(g<0?-1:1)*J(on(0,T*T*R-P*P)),Y=(P*g-m*S)/R,$=(-P*m-g*S)/R,w=(P*g+m*S)/R,p=(-P*m+g*S)/R,x=Y-B,e=$-t,r=w-B,C=p-t;return x*x+e*e>r*r+C*C&&(Y=w,$=p),{cx:Y,cy:$,x01:-n,y01:-d,x11:Y*(v/T-1),y11:$*(v/T-1)}}function hn(){var l=cn,h=yn,I=j(0),D=null,v=gn,A=dn,z=mn,a=null,O=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=A.apply(this,arguments)-un,B=rn(c-f),t=c>f;if(a||(a=n=O()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(B>tn-y)a.moveTo(s*F(f),s*q(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*F(c),u*q(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=B,S=B,Y=z.apply(this,arguments)/2,$=Y>y&&(D?+D.apply(this,arguments):J(u*u+s*s)),w=_(rn(s-u)/2,+I.apply(this,arguments)),p=w,x=w,e,r;if($>y){var C=sn($/u*q(Y)),K=sn($/s*q(Y));(P-=C*2)>y?(C*=t?1:-1,R+=C,T-=C):(P=0,R=T=(f+c)/2),(S-=K*2)>y?(K*=t?1:-1,m+=K,g-=K):(S=0,m=g=(f+c)/2)}var G=s*F(m),H=s*q(m),L=u*F(T),M=u*q(T);if(w>y){var N=s*F(g),Q=s*q(g),V=u*F(R),W=u*q(R),E;if(B<an)if(E=pn(G,H,V,W,N,Q,L,M)){var X=G-E[0],Z=H-E[1],b=N-E[0],k=Q-E[1],nn=1/q(fn((X*b+Z*k)/(J(X*X+Z*Z)*J(b*b+k*k)))/2),en=J(E[0]*E[0]+E[1]*E[1]);p=_(w,(u-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}S>y?x>y?(e=U(V,W,G,H,s,x,t),r=U(N,Q,L,M,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(G,H),a.arc(0,0,s,m,g,!t)):a.moveTo(G,H),!(u>y)||!(P>y)?a.lineTo(L,M):p>y?(e=U(L,M,N,Q,u,-p,t),r=U(G,H,V,W,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-an/2;return[F(d)*n,q(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:j(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:j(+n),i):h},i.cornerRadius=function(n){return arguments.length?(I=typeof n=="function"?n:j(+n),i):I},i.padRadius=function(n){return arguments.length?(D=n==null?null:typeof n=="function"?n:j(+n),i):D},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:j(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:j(+n),i):A},i.padAngle=function(n){return arguments.length?(z=typeof n=="function"?n:j(+n),i):z},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};
|