pilotswarm 0.5.72 → 0.5.73
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 +2 -2
- package/ui/react/src/web-app.js +112 -19
- package/web/dist/assets/{abnfDiagram-VRR7QNED-D__RWhK7.js → abnfDiagram-VRR7QNED-BnkQIEhH.js} +1 -1
- package/web/dist/assets/{arc-CjtcEiTR.js → arc-CGyB8bDx.js} +1 -1
- package/web/dist/assets/{architectureDiagram-ZJ3FMSHR-BDI8FioV.js → architectureDiagram-ZJ3FMSHR-DWKmcDN1.js} +1 -1
- package/web/dist/assets/{blockDiagram-677ZJIJ3-D62iIbEl.js → blockDiagram-677ZJIJ3-rn5c_Stz.js} +1 -1
- package/web/dist/assets/{c4Diagram-LMCZKHZV-BlJ596a2.js → c4Diagram-LMCZKHZV-DyDQ7Ifb.js} +1 -1
- package/web/dist/assets/channel-BTptNqYp.js +1 -0
- package/web/dist/assets/{chunk-2Q5K7J3B-CnVtHjtN.js → chunk-2Q5K7J3B-C5VqT-KF.js} +1 -1
- package/web/dist/assets/{chunk-32BRIVSS-g8IU-e70.js → chunk-32BRIVSS-DT-sPck4.js} +1 -1
- package/web/dist/assets/{chunk-5VM5RSS4-KKxfFv2y.js → chunk-5VM5RSS4-yOTPomtB.js} +1 -1
- package/web/dist/assets/{chunk-EX3LRPZG-C0eEpQtc.js → chunk-EX3LRPZG-DmFxJ0dk.js} +1 -1
- package/web/dist/assets/{chunk-JWPE2WC7-ZfmDblU2.js → chunk-JWPE2WC7-pjfQBm7p.js} +1 -1
- package/web/dist/assets/{chunk-MOJQB5TN-BOfHzBMe.js → chunk-MOJQB5TN-CHa4SOoq.js} +1 -1
- package/web/dist/assets/{chunk-RYQCIY6F-GvY7zGfa.js → chunk-RYQCIY6F-DgRDTwUy.js} +1 -1
- package/web/dist/assets/{chunk-V7JOEXUC-Bi28CvqE.js → chunk-V7JOEXUC-BdxruVNZ.js} +1 -1
- package/web/dist/assets/{chunk-VR4S4FIN-H1DY3Xw7.js → chunk-VR4S4FIN-DVyRDA0m.js} +1 -1
- package/web/dist/assets/{chunk-XXDRQBXY-JMwCi2he.js → chunk-XXDRQBXY-C_SZSWHx.js} +1 -1
- package/web/dist/assets/classDiagram-OUVF2IWQ-D_z8OghZ.js +1 -0
- package/web/dist/assets/classDiagram-v2-EOCWNBFH-D_z8OghZ.js +1 -0
- package/web/dist/assets/{cose-bilkent-JH36ORCC-DfFOvDA3.js → cose-bilkent-JH36ORCC-B4ttgAJ8.js} +1 -1
- package/web/dist/assets/{cynefin-VYW2F7L2-CD5a_UMt.js → cynefin-VYW2F7L2-B8cRqvMz.js} +1 -1
- package/web/dist/assets/{cynefinDiagram-TSTJHNR4-CRsYXGC9.js → cynefinDiagram-TSTJHNR4-CEubmFl-.js} +1 -1
- package/web/dist/assets/{dagre-VKFMJZFB-BuPdi3xA.js → dagre-VKFMJZFB-CgRi7BXz.js} +1 -1
- package/web/dist/assets/{diagram-FQU43EPY-MIVIpIBC.js → diagram-FQU43EPY-DfLMLNvB.js} +1 -1
- package/web/dist/assets/{diagram-G47NLZAW-D7-s_wbT.js → diagram-G47NLZAW-DMBnhSjJ.js} +1 -1
- package/web/dist/assets/{diagram-NH7WQ7WH-fmSlDjpy.js → diagram-NH7WQ7WH-CsVx_EMq.js} +1 -1
- package/web/dist/assets/{diagram-OA4YK3LP-DwEwWIum.js → diagram-OA4YK3LP-Cd8z9ubn.js} +1 -1
- package/web/dist/assets/{diagram-WEI45ONY-Gvb_KdCz.js → diagram-WEI45ONY-BIjozLvB.js} +1 -1
- package/web/dist/assets/{ebnfDiagram-CCIWWBDH-BOWGc2OC.js → ebnfDiagram-CCIWWBDH-BvEyKaUx.js} +1 -1
- package/web/dist/assets/{erDiagram-Q63AITRT-CrigFfDY.js → erDiagram-Q63AITRT-C1KyyEXS.js} +1 -1
- package/web/dist/assets/{flowDiagram-23GEKE2U-618PQgNe.js → flowDiagram-23GEKE2U-8vv4Bw3F.js} +1 -1
- package/web/dist/assets/{ganttDiagram-NO4QXBWP-lHe8_OHE.js → ganttDiagram-NO4QXBWP-BQXnAu0k.js} +1 -1
- package/web/dist/assets/{gitGraphDiagram-IHSO6WYX-CM3Jo1NF.js → gitGraphDiagram-IHSO6WYX-BGtXqY1X.js} +1 -1
- package/web/dist/assets/{index-G-9aAxKP.js → index-BixB0dRp.js} +2 -2
- package/web/dist/assets/index-CSMHeAhZ.css +1 -0
- package/web/dist/assets/{infoDiagram-FWYZ7A6U-CtDt5Yg1.js → infoDiagram-FWYZ7A6U-CVJezXGw.js} +1 -1
- package/web/dist/assets/{ishikawaDiagram-FXEZZL3T-DMDXe5yy.js → ishikawaDiagram-FXEZZL3T-D_Fi5Rxo.js} +1 -1
- package/web/dist/assets/{journeyDiagram-5HDEW3XC-BxUjwmwF.js → journeyDiagram-5HDEW3XC-Di1In_FH.js} +1 -1
- package/web/dist/assets/{kanban-definition-HUTT4EX6-Cey1IRnt.js → kanban-definition-HUTT4EX6-ozcJ7MQ3.js} +1 -1
- package/web/dist/assets/{linear-BAaF8u7Q.js → linear-BCHWKN_x.js} +1 -1
- package/web/dist/assets/{mermaid.core-D7ywN4EU.js → mermaid.core-DPy_PtTG.js} +4 -4
- package/web/dist/assets/{mindmap-definition-LN4V7U3C-BTSESh2V.js → mindmap-definition-LN4V7U3C-BUPXSGdc.js} +1 -1
- package/web/dist/assets/{papaparse.min-BhnWt-zK.js → papaparse.min-DLMQN21E.js} +1 -1
- package/web/dist/assets/{pegDiagram-2B236MQR-BTWzwmna.js → pegDiagram-2B236MQR-B0VRzHj8.js} +1 -1
- package/web/dist/assets/{pieDiagram-ENE6RG2P-qI9jL2eV.js → pieDiagram-ENE6RG2P-DJDr0spg.js} +1 -1
- package/web/dist/assets/pilotswarm-BchtZfEr.js +109 -0
- package/web/dist/assets/{quadrantDiagram-ABIIQ3AL-B54Va5N3.js → quadrantDiagram-ABIIQ3AL-D80hp41u.js} +1 -1
- package/web/dist/assets/{railroadDiagram-RFXS5EU6-CVXDflXo.js → railroadDiagram-RFXS5EU6-BVZxxDDn.js} +1 -1
- package/web/dist/assets/{requirementDiagram-TGXJPOKE-C7abNeEc.js → requirementDiagram-TGXJPOKE-BYBz1YgE.js} +1 -1
- package/web/dist/assets/{sankeyDiagram-HTMAVEWB-ND6Feq2w.js → sankeyDiagram-HTMAVEWB-Cm0EjuqP.js} +1 -1
- package/web/dist/assets/{sequenceDiagram-DBY2YBRQ-DXGwvQdf.js → sequenceDiagram-DBY2YBRQ-C08lIz44.js} +1 -1
- package/web/dist/assets/{sizeCapture-X5ZJPWSS-CrXKKsBI.js → sizeCapture-X5ZJPWSS-xEVPLUiU.js} +1 -1
- package/web/dist/assets/{stateDiagram-2N3HPSRC-BJWpN6s6.js → stateDiagram-2N3HPSRC-C54U2MIf.js} +1 -1
- package/web/dist/assets/stateDiagram-v2-6OUMAXLB-CQXFWqsn.js +1 -0
- package/web/dist/assets/{swimlanes-5IMT3BWC-Cy67JyBd.js → swimlanes-5IMT3BWC-DRPOWaFR.js} +2 -2
- package/web/dist/assets/swimlanesDiagram-G3AALYLV-BuWCDUQa.js +8 -0
- package/web/dist/assets/{timeline-definition-FHXFAJF6-CeDd4R0u.js → timeline-definition-FHXFAJF6-BUhUcJ_i.js} +1 -1
- package/web/dist/assets/{vennDiagram-L72KCM5P-BDrPrK0B.js → vennDiagram-L72KCM5P-DFFa7JWQ.js} +1 -1
- package/web/dist/assets/{wardleyDiagram-EHGQE667-Bp9PEqNv.js → wardleyDiagram-EHGQE667-Bjv--ELM.js} +1 -1
- package/web/dist/assets/{xychartDiagram-FW5EYKEG-DI_8u8T1.js → xychartDiagram-FW5EYKEG-BnGbWQJK.js} +1 -1
- package/web/dist/index.html +3 -3
- package/web/dist/assets/channel-CF_IY6bX.js +0 -1
- package/web/dist/assets/classDiagram-OUVF2IWQ-BoTycRRp.js +0 -1
- package/web/dist/assets/classDiagram-v2-EOCWNBFH-BoTycRRp.js +0 -1
- package/web/dist/assets/index-DHFBzAwY.css +0 -1
- package/web/dist/assets/pilotswarm-Dccv5YRO.js +0 -109
- package/web/dist/assets/stateDiagram-v2-6OUMAXLB-BQY9l8FM.js +0 -1
- package/web/dist/assets/swimlanesDiagram-G3AALYLV-DZ0Jn4Gp.js +0 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pilotswarm",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.73",
|
|
4
4
|
"description": "PilotSwarm application package: terminal UI, browser portal + Web API server, and MCP server — one install, three bins.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"ink": "^6.8.0",
|
|
82
82
|
"jose": "^6.2.2",
|
|
83
83
|
"mermaid": "^11.16.0",
|
|
84
|
-
"pilotswarm-sdk": "0.5.
|
|
84
|
+
"pilotswarm-sdk": "0.5.73",
|
|
85
85
|
"react": "^19.2.4",
|
|
86
86
|
"react-dom": "^19.2.4",
|
|
87
87
|
"ws": "^8.18.2"
|
package/ui/react/src/web-app.js
CHANGED
|
@@ -89,6 +89,7 @@ const PORTAL_MIN_CHAT_COLUMN_PX = 224;
|
|
|
89
89
|
const PORTAL_SESSION_COMPACT_COLUMN_PX = 190;
|
|
90
90
|
const PORTAL_SESSION_HIDDEN_COLUMN_PX = 48;
|
|
91
91
|
const SCROLL_ROW_HEIGHT = 16;
|
|
92
|
+
const HISTORY_SCROLL_GESTURE_GAP_MS = 200;
|
|
92
93
|
const SCROLL_BOTTOM_EPSILON_PX = 0.5;
|
|
93
94
|
const PROGRAMMATIC_SCROLL_TOLERANCE_PX = SCROLL_BOTTOM_EPSILON_PX;
|
|
94
95
|
// Minimum downward finger travel (px) while at the top of the chat pane before
|
|
@@ -1119,6 +1120,8 @@ function useScrollSync(ref, lines, scrollOffset, scrollMode, paneKey, controller
|
|
|
1119
1120
|
scrollOffset,
|
|
1120
1121
|
});
|
|
1121
1122
|
const previousContentRef = React.useRef(null);
|
|
1123
|
+
const historyScrollRef = React.useRef(null);
|
|
1124
|
+
React.useEffect(() => () => { historyScrollRef.current = null; }, []);
|
|
1122
1125
|
// Touch scrolling relies on native momentum for speed: a hard flick keeps
|
|
1123
1126
|
// scrolling long after the finger lifts. Re-asserting scrollTop from state
|
|
1124
1127
|
// on every render (live events, status updates) kills that momentum at the
|
|
@@ -1151,6 +1154,31 @@ function useScrollSync(ref, lines, scrollOffset, scrollMode, paneKey, controller
|
|
|
1151
1154
|
const firstLine = scrollBoundaryIdentity(normalizedLines);
|
|
1152
1155
|
const lastLine = scrollBoundaryIdentity(normalizedLines, true);
|
|
1153
1156
|
const previousContent = previousContentRef.current;
|
|
1157
|
+
let historyScroll = historyScrollRef.current;
|
|
1158
|
+
const activeSessionId = controller.getState().sessions.activeSessionId;
|
|
1159
|
+
if (historyScroll && historyScroll.sessionId !== activeSessionId) {
|
|
1160
|
+
historyScrollRef.current = null;
|
|
1161
|
+
historyScroll = null;
|
|
1162
|
+
}
|
|
1163
|
+
const oldestSeq = controller.getState().history.bySessionId.get(activeSessionId)?.events?.[0]?.seq;
|
|
1164
|
+
const pageArrived = historyScroll && !historyScroll.applied && oldestSeq < historyScroll.oldestSeq;
|
|
1165
|
+
let pageScrollTop = null;
|
|
1166
|
+
if (pageArrived) {
|
|
1167
|
+
// Measure the same visible block, not the total transcript height:
|
|
1168
|
+
// live content can also grow at the bottom while a page is loading.
|
|
1169
|
+
const anchor = historyScroll.anchor;
|
|
1170
|
+
const element = anchor?.element.isConnected && anchor.element.textContent === anchor.text
|
|
1171
|
+
? anchor.element
|
|
1172
|
+
: [...node.children].find(child => child.textContent === anchor?.text);
|
|
1173
|
+
const delta = element
|
|
1174
|
+
? element.getBoundingClientRect().top - anchor.top
|
|
1175
|
+
: node.scrollHeight - historyScroll.height;
|
|
1176
|
+
pageScrollTop = Math.max(0, Math.min(node.scrollHeight - node.clientHeight,
|
|
1177
|
+
node.scrollTop + delta - SCROLL_ROW_HEIGHT));
|
|
1178
|
+
historyScroll.applied = true;
|
|
1179
|
+
historyScroll.target = pageScrollTop;
|
|
1180
|
+
historyScroll.releaseAt = performance.now() + HISTORY_SCROLL_GESTURE_GAP_MS;
|
|
1181
|
+
}
|
|
1154
1182
|
const interaction = userScrollRef.current;
|
|
1155
1183
|
const now = typeof performance !== "undefined" ? performance.now() : Date.now();
|
|
1156
1184
|
const interacting = interaction.touching
|
|
@@ -1165,13 +1193,13 @@ function useScrollSync(ref, lines, scrollOffset, scrollMode, paneKey, controller
|
|
|
1165
1193
|
// state normally preserves scrollTop, which would push the same visible
|
|
1166
1194
|
// message down by the inserted height. Compensate with the measured DOM
|
|
1167
1195
|
// height delta. Appended live text keeps the old scrollTop unchanged.
|
|
1168
|
-
const prependedWhilePaused = stickyBottom
|
|
1196
|
+
const prependedWhilePaused = !historyScroll && stickyBottom
|
|
1169
1197
|
&& previousContent?.lastLine === lastLine
|
|
1170
1198
|
&& previousContent?.firstLine !== firstLine
|
|
1171
1199
|
&& node.scrollHeight > previousContent.scrollHeight
|
|
1172
1200
|
&& (preservePausedStickyScroll || node.scrollTop <= PROGRAMMATIC_SCROLL_TOLERANCE_PX);
|
|
1173
1201
|
if (
|
|
1174
|
-
!prependedWhilePaused
|
|
1202
|
+
!pageArrived && !prependedWhilePaused
|
|
1175
1203
|
&& interacting
|
|
1176
1204
|
&& scrollMode === previousViewportState?.scrollMode
|
|
1177
1205
|
&& (scrollOffset === previousViewportState?.scrollOffset || isEchoOffset)
|
|
@@ -1180,7 +1208,7 @@ function useScrollSync(ref, lines, scrollOffset, scrollMode, paneKey, controller
|
|
|
1180
1208
|
previousContentRef.current = { firstLine, lastLine, scrollHeight: node.scrollHeight };
|
|
1181
1209
|
return;
|
|
1182
1210
|
}
|
|
1183
|
-
const nextScrollTop = prependedWhilePaused
|
|
1211
|
+
const nextScrollTop = pageArrived ? pageScrollTop : prependedWhilePaused
|
|
1184
1212
|
? Math.max(0, Math.min(
|
|
1185
1213
|
node.scrollTop + (node.scrollHeight - previousContent.scrollHeight),
|
|
1186
1214
|
node.scrollHeight - node.clientHeight,
|
|
@@ -1198,7 +1226,7 @@ function useScrollSync(ref, lines, scrollOffset, scrollMode, paneKey, controller
|
|
|
1198
1226
|
}
|
|
1199
1227
|
});
|
|
1200
1228
|
}
|
|
1201
|
-
if (prependedWhilePaused && paneKey && typeof controller.updatePaneScrollFromViewport === "function") {
|
|
1229
|
+
if ((pageArrived || prependedWhilePaused) && paneKey && typeof controller.updatePaneScrollFromViewport === "function") {
|
|
1202
1230
|
// The measured DOM compensation above is the new durable paused
|
|
1203
1231
|
// position. Persist it too: otherwise switching sessions and back
|
|
1204
1232
|
// reapplies the pre-page offset and moves the reader by the full
|
|
@@ -1221,6 +1249,15 @@ function useScrollSync(ref, lines, scrollOffset, scrollMode, paneKey, controller
|
|
|
1221
1249
|
const onScroll = React.useCallback(() => {
|
|
1222
1250
|
const node = ref.current;
|
|
1223
1251
|
if (!node || !paneKey) return;
|
|
1252
|
+
const historyScroll = historyScrollRef.current;
|
|
1253
|
+
if (historyScroll?.applied && performance.now() <= historyScroll.releaseAt
|
|
1254
|
+
&& node.scrollTop < historyScroll.target) {
|
|
1255
|
+
// Native touch momentum may continue without another touchmove.
|
|
1256
|
+
node.scrollTop = historyScroll.target;
|
|
1257
|
+
historyScroll.releaseAt = performance.now() + HISTORY_SCROLL_GESTURE_GAP_MS;
|
|
1258
|
+
return;
|
|
1259
|
+
}
|
|
1260
|
+
if (historyScroll?.applied && performance.now() > historyScroll.releaseAt) historyScrollRef.current = null;
|
|
1224
1261
|
const pendingProgrammatic = programmaticScrollRef.current;
|
|
1225
1262
|
if (pendingProgrammatic) {
|
|
1226
1263
|
if (Math.abs(node.scrollTop - pendingProgrammatic.target) <= PROGRAMMATIC_SCROLL_TOLERANCE_PX) {
|
|
@@ -1268,13 +1305,49 @@ function useScrollSync(ref, lines, scrollOffset, scrollMode, paneKey, controller
|
|
|
1268
1305
|
}
|
|
1269
1306
|
}, [controller, dispatchScrollOffset, paneKey, ref, scrollMode, stickyBottom]);
|
|
1270
1307
|
|
|
1308
|
+
const requestHistoryPage = React.useCallback(() => {
|
|
1309
|
+
const node = ref.current;
|
|
1310
|
+
const state = controller.getState();
|
|
1311
|
+
const sessionId = state.sessions.activeSessionId;
|
|
1312
|
+
if (!node || !sessionId || historyScrollRef.current) return;
|
|
1313
|
+
const top = node.getBoundingClientRect().top;
|
|
1314
|
+
const element = [...node.children].find(child => child.textContent?.trim() && child.getBoundingClientRect().bottom > top + 6);
|
|
1315
|
+
const pending = {
|
|
1316
|
+
sessionId, oldestSeq: state.history.bySessionId.get(sessionId)?.events?.[0]?.seq,
|
|
1317
|
+
height: node.scrollHeight, applied: false,
|
|
1318
|
+
anchor: element ? { element, text: element.textContent, top: element.getBoundingClientRect().top } : null,
|
|
1319
|
+
};
|
|
1320
|
+
historyScrollRef.current = pending;
|
|
1321
|
+
const load = controller.handleChatTopHistoryScrollIntent?.(
|
|
1322
|
+
(node.scrollHeight - node.clientHeight) / SCROLL_ROW_HEIGHT,
|
|
1323
|
+
{ force: true, preserveDomAnchor: true },
|
|
1324
|
+
);
|
|
1325
|
+
Promise.resolve(load).catch(() => {}).finally(() => {
|
|
1326
|
+
if (historyScrollRef.current !== pending) return;
|
|
1327
|
+
const oldest = controller.getState().history.bySessionId.get(sessionId)?.events?.[0]?.seq;
|
|
1328
|
+
if (!(oldest < pending.oldestSeq)) historyScrollRef.current = null;
|
|
1329
|
+
else setViewportRevision(revision => revision + 1);
|
|
1330
|
+
});
|
|
1331
|
+
}, [controller, ref]);
|
|
1332
|
+
|
|
1271
1333
|
const onWheel = React.useCallback((event) => {
|
|
1272
1334
|
const node = ref.current;
|
|
1273
|
-
if (!node || paneKey !== "chat" || event.deltaY
|
|
1335
|
+
if (!node || paneKey !== "chat" || !event.deltaY || event.ctrlKey) return;
|
|
1336
|
+
const pending = historyScrollRef.current;
|
|
1337
|
+
if (pending && event.deltaY > 0) historyScrollRef.current = null;
|
|
1338
|
+
else if (pending) {
|
|
1339
|
+
if (!pending.applied || performance.now() <= pending.releaseAt) {
|
|
1340
|
+
pending.releaseAt = performance.now() + HISTORY_SCROLL_GESTURE_GAP_MS;
|
|
1341
|
+
event.preventDefault();
|
|
1342
|
+
return;
|
|
1343
|
+
}
|
|
1344
|
+
historyScrollRef.current = null;
|
|
1345
|
+
}
|
|
1346
|
+
if (event.deltaY >= 0) return;
|
|
1274
1347
|
if (node.scrollTop > PROGRAMMATIC_SCROLL_TOLERANCE_PX) return;
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
}, [
|
|
1348
|
+
event.preventDefault();
|
|
1349
|
+
requestHistoryPage();
|
|
1350
|
+
}, [paneKey, ref, requestHistoryPage]);
|
|
1278
1351
|
|
|
1279
1352
|
// Touch equivalent of the wheel-at-top gesture: touch devices never fire
|
|
1280
1353
|
// wheel events, and once scrollTop sits at 0 a further swipe-down emits no
|
|
@@ -1284,6 +1357,7 @@ function useScrollSync(ref, lines, scrollOffset, scrollMode, paneKey, controller
|
|
|
1284
1357
|
const touchPullRef = React.useRef({ startY: null, fired: false });
|
|
1285
1358
|
const onTouchStart = React.useCallback((event) => {
|
|
1286
1359
|
userScrollRef.current.touching = true;
|
|
1360
|
+
if (historyScrollRef.current?.applied) historyScrollRef.current = null;
|
|
1287
1361
|
if (paneKey !== "chat") return;
|
|
1288
1362
|
touchPullRef.current = { startY: event.touches?.[0]?.clientY ?? null, fired: false };
|
|
1289
1363
|
}, [paneKey]);
|
|
@@ -1292,26 +1366,45 @@ function useScrollSync(ref, lines, scrollOffset, scrollMode, paneKey, controller
|
|
|
1292
1366
|
// Momentum continues past the finger lift; onScroll keeps refreshing
|
|
1293
1367
|
// lastUserScrollAt for as long as the glide emits scroll events.
|
|
1294
1368
|
userScrollRef.current.lastUserScrollAt = typeof performance !== "undefined" ? performance.now() : Date.now();
|
|
1369
|
+
if (historyScrollRef.current?.applied) {
|
|
1370
|
+
historyScrollRef.current.releaseAt = performance.now() + HISTORY_SCROLL_GESTURE_GAP_MS;
|
|
1371
|
+
}
|
|
1295
1372
|
}, []);
|
|
1296
1373
|
const onTouchMove = React.useCallback((event) => {
|
|
1297
1374
|
const node = ref.current;
|
|
1298
1375
|
const pull = touchPullRef.current;
|
|
1299
|
-
if (!node || paneKey !== "chat") return;
|
|
1376
|
+
if (!node || paneKey !== "chat" || event.touches?.length !== 1) return;
|
|
1377
|
+
if (historyScrollRef.current) {
|
|
1378
|
+
historyScrollRef.current.releaseAt = performance.now() + HISTORY_SCROLL_GESTURE_GAP_MS;
|
|
1379
|
+
event.preventDefault();
|
|
1380
|
+
return;
|
|
1381
|
+
}
|
|
1300
1382
|
if (pull.fired || pull.startY == null) return;
|
|
1301
1383
|
if (node.scrollTop > PROGRAMMATIC_SCROLL_TOLERANCE_PX) return;
|
|
1302
1384
|
const y = event.touches?.[0]?.clientY;
|
|
1303
1385
|
if (y == null || y - pull.startY < TOUCH_TOP_PULL_THRESHOLD_PX) return;
|
|
1304
1386
|
pull.fired = true;
|
|
1305
1387
|
// A deliberate pull at the top of the pane is an unambiguous request:
|
|
1306
|
-
//
|
|
1307
|
-
//
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1388
|
+
// Request one page at the measured DOM boundary. The shared gesture
|
|
1389
|
+
// guard absorbs repeated wheel events and the remainder of this pull.
|
|
1390
|
+
event.preventDefault();
|
|
1391
|
+
requestHistoryPage();
|
|
1392
|
+
}, [paneKey, ref, requestHistoryPage]);
|
|
1393
|
+
|
|
1394
|
+
React.useEffect(() => {
|
|
1395
|
+
const node = ref.current;
|
|
1396
|
+
if (!node) return;
|
|
1397
|
+
// React's delegated wheel/touch listeners are passive. These must be
|
|
1398
|
+
// cancellable so one in-flight gesture cannot consume the new page.
|
|
1399
|
+
node.addEventListener("wheel", onWheel, { passive: false });
|
|
1400
|
+
node.addEventListener("touchmove", onTouchMove, { passive: false });
|
|
1401
|
+
return () => {
|
|
1402
|
+
node.removeEventListener("wheel", onWheel);
|
|
1403
|
+
node.removeEventListener("touchmove", onTouchMove);
|
|
1404
|
+
};
|
|
1405
|
+
}, [ref, onWheel, onTouchMove]);
|
|
1313
1406
|
|
|
1314
|
-
return { normalizedLines, onScroll,
|
|
1407
|
+
return { normalizedLines, onScroll, onTouchStart, onTouchEnd };
|
|
1315
1408
|
}
|
|
1316
1409
|
|
|
1317
1410
|
function Runs({ runs, theme }) {
|
|
@@ -4144,7 +4237,7 @@ function ScrollLinesPanel({ title, titleRight = null, color, focused, actions, l
|
|
|
4144
4237
|
}, [panelRef]);
|
|
4145
4238
|
const stickyRef = React.useRef(null);
|
|
4146
4239
|
const syncingHorizontalRef = React.useRef(false);
|
|
4147
|
-
const { normalizedLines, onScroll,
|
|
4240
|
+
const { normalizedLines, onScroll, onTouchStart, onTouchEnd } = useScrollSync(ref, lines, scrollOffset, scrollMode, paneKey, controller, { stickyBottom });
|
|
4148
4241
|
const normalizedSticky = React.useMemo(() => normalizeLines(stickyLines), [stickyLines]);
|
|
4149
4242
|
const normalizedBottomSticky = React.useMemo(() => normalizeLines(bottomStickyLines), [bottomStickyLines]);
|
|
4150
4243
|
const preserveHorizontalScroll = className.includes("is-preserve") && panelClassName.includes("has-preserved-sticky");
|
|
@@ -4243,7 +4336,7 @@ function ScrollLinesPanel({ title, titleRight = null, color, focused, actions, l
|
|
|
4243
4336
|
normalizedSticky.map((line, index) => React.createElement(Line, { key: `sticky:${index}`, line, theme })),
|
|
4244
4337
|
)
|
|
4245
4338
|
: null,
|
|
4246
|
-
React.createElement("div", { ref: setPanelNode, className: `ps-scroll-panel ${className}${scrollShadow.down ? " is-scrolled-down" : ""}${scrollShadow.up ? " is-scrolled-up" : ""}`.trim(), "data-session-scroll": focusRegion === "sessions" ? "1" : undefined, "aria-live": ariaLive || undefined, "aria-atomic": ariaLive ? "false" : undefined, onScroll: handleBodyScroll, onMouseDown: claimFocus, onTouchStart,
|
|
4339
|
+
React.createElement("div", { ref: setPanelNode, className: `ps-scroll-panel ${className}${scrollShadow.down ? " is-scrolled-down" : ""}${scrollShadow.up ? " is-scrolled-up" : ""}`.trim(), "data-session-scroll": focusRegion === "sessions" ? "1" : undefined, "aria-live": ariaLive || undefined, "aria-atomic": ariaLive ? "false" : undefined, onScroll: handleBodyScroll, onMouseDown: claimFocus, onTouchStart, onTouchEnd, onTouchCancel: onTouchEnd },
|
|
4247
4340
|
typeof renderBody === "function"
|
|
4248
4341
|
? renderBody(normalizedLines, theme)
|
|
4249
4342
|
: structuredBlocks
|
package/web/dist/assets/{abnfDiagram-VRR7QNED-D__RWhK7.js → abnfDiagram-VRR7QNED-BnkQIEhH.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-CHa4SOoq.js";import{p as f}from"./chunk-JWPE2WC7-pjfQBm7p.js";import{_ as n,l as o}from"./mermaid.core-DPy_PtTG.js";import{M as c,b as d}from"./cynefin-VYW2F7L2-B8cRqvMz.js";import"./pilotswarm-BchtZfEr.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-DPy_PtTG.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};
|