@mcpview/compose 0.12.0 → 0.13.0
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/CHANGELOG.md +11 -0
- package/README.md +27 -1
- package/esm/_dnt.polyfills.d.ts +49 -0
- package/esm/_dnt.polyfills.d.ts.map +1 -1
- package/esm/_dnt.polyfills.js +36 -0
- package/esm/src/code-mode/board.d.ts +4 -0
- package/esm/src/code-mode/board.d.ts.map +1 -1
- package/esm/src/code-mode/board.js +3 -1
- package/esm/src/core/collector/collector.d.ts +2 -1
- package/esm/src/core/collector/collector.d.ts.map +1 -1
- package/esm/src/core/collector/collector.js +6 -0
- package/esm/src/core/types/resources.d.ts +4 -0
- package/esm/src/core/types/resources.d.ts.map +1 -1
- package/esm/src/core/types/resources.js +10 -1
- package/esm/src/host/renderer/css/base.d.ts.map +1 -1
- package/esm/src/host/renderer/css/base.js +3 -0
- package/esm/src/host/renderer/css/layouts.d.ts.map +1 -1
- package/esm/src/host/renderer/css/layouts.js +17 -14
- package/esm/src/host/renderer/css/panel-controls.d.ts +3 -0
- package/esm/src/host/renderer/css/panel-controls.d.ts.map +1 -0
- package/esm/src/host/renderer/css/panel-controls.js +89 -0
- package/esm/src/host/renderer/html-generator.d.ts.map +1 -1
- package/esm/src/host/renderer/html-generator.js +38 -42
- package/esm/src/host/renderer/js/card-height.d.ts +3 -0
- package/esm/src/host/renderer/js/card-height.d.ts.map +1 -0
- package/esm/src/host/renderer/js/card-height.js +58 -0
- package/esm/src/host/renderer/js/event-bus.d.ts.map +1 -1
- package/esm/src/host/renderer/js/event-bus.js +32 -12
- package/esm/src/host/renderer/panel-controls.d.ts +23 -0
- package/esm/src/host/renderer/panel-controls.d.ts.map +1 -0
- package/esm/src/host/renderer/panel-controls.js +5 -0
- package/esm/src/host/renderer/panel-movement.d.ts +8 -0
- package/esm/src/host/renderer/panel-movement.d.ts.map +1 -0
- package/esm/src/host/renderer/panel-movement.js +392 -0
- package/esm/src/host/renderer/panel-reflow.d.ts +17 -0
- package/esm/src/host/renderer/panel-reflow.d.ts.map +1 -0
- package/esm/src/host/renderer/panel-reflow.js +342 -0
- package/esm/src/host/renderer/panel-resizing.d.ts +11 -0
- package/esm/src/host/renderer/panel-resizing.d.ts.map +1 -0
- package/esm/src/host/renderer/panel-resizing.js +347 -0
- package/esm/src/runtime/compose.d.ts.map +1 -1
- package/esm/src/runtime/compose.js +3 -0
- package/esm/src/runtime/manifest.d.ts.map +1 -1
- package/esm/src/runtime/manifest.js +4 -0
- package/esm/src/runtime/types.d.ts +2 -0
- package/esm/src/runtime/types.d.ts.map +1 -1
- package/esm/src/sdk/mcp-sdk.d.ts +2 -1
- package/esm/src/sdk/mcp-sdk.d.ts.map +1 -1
- package/esm/src/sdk/mcp-sdk.js +2 -2
- package/esm/src/version.d.ts +1 -1
- package/esm/src/version.js +1 -1
- package/package.json +1 -1
- package/script/_dnt.polyfills.d.ts +49 -0
- package/script/_dnt.polyfills.d.ts.map +1 -1
- package/script/_dnt.polyfills.js +36 -0
- package/script/src/code-mode/board.d.ts +4 -0
- package/script/src/code-mode/board.d.ts.map +1 -1
- package/script/src/code-mode/board.js +7 -2
- package/script/src/core/collector/collector.d.ts +2 -1
- package/script/src/core/collector/collector.d.ts.map +1 -1
- package/script/src/core/collector/collector.js +6 -0
- package/script/src/core/types/resources.d.ts +4 -0
- package/script/src/core/types/resources.d.ts.map +1 -1
- package/script/src/core/types/resources.js +11 -0
- package/script/src/host/renderer/css/base.d.ts.map +1 -1
- package/script/src/host/renderer/css/base.js +3 -0
- package/script/src/host/renderer/css/layouts.d.ts.map +1 -1
- package/script/src/host/renderer/css/layouts.js +17 -14
- package/script/src/host/renderer/css/panel-controls.d.ts +3 -0
- package/script/src/host/renderer/css/panel-controls.d.ts.map +1 -0
- package/script/src/host/renderer/css/panel-controls.js +92 -0
- package/script/src/host/renderer/html-generator.d.ts.map +1 -1
- package/script/src/host/renderer/html-generator.js +38 -42
- package/script/src/host/renderer/js/card-height.d.ts +3 -0
- package/script/src/host/renderer/js/card-height.d.ts.map +1 -0
- package/script/src/host/renderer/js/card-height.js +61 -0
- package/script/src/host/renderer/js/event-bus.d.ts.map +1 -1
- package/script/src/host/renderer/js/event-bus.js +32 -12
- package/script/src/host/renderer/panel-controls.d.ts +23 -0
- package/script/src/host/renderer/panel-controls.d.ts.map +1 -0
- package/script/src/host/renderer/panel-controls.js +11 -0
- package/script/src/host/renderer/panel-movement.d.ts +8 -0
- package/script/src/host/renderer/panel-movement.d.ts.map +1 -0
- package/script/src/host/renderer/panel-movement.js +395 -0
- package/script/src/host/renderer/panel-reflow.d.ts +17 -0
- package/script/src/host/renderer/panel-reflow.d.ts.map +1 -0
- package/script/src/host/renderer/panel-reflow.js +345 -0
- package/script/src/host/renderer/panel-resizing.d.ts +11 -0
- package/script/src/host/renderer/panel-resizing.d.ts.map +1 -0
- package/script/src/host/renderer/panel-resizing.js +350 -0
- package/script/src/runtime/compose.d.ts.map +1 -1
- package/script/src/runtime/compose.js +3 -0
- package/script/src/runtime/manifest.d.ts.map +1 -1
- package/script/src/runtime/manifest.js +4 -0
- package/script/src/runtime/types.d.ts +2 -0
- package/script/src/runtime/types.d.ts.map +1 -1
- package/script/src/sdk/mcp-sdk.d.ts +2 -1
- package/script/src/sdk/mcp-sdk.d.ts.map +1 -1
- package/script/src/sdk/mcp-sdk.js +2 -2
- package/script/src/version.d.ts +1 -1
- package/script/src/version.js +1 -1
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
import { createPanelReflow } from "./panel-reflow.js";
|
|
2
|
+
/**
|
|
3
|
+
* Choose one of a viewer's declared viewport widths from its bottom-right corner.
|
|
4
|
+
* The standalone host embeds this function as JavaScript and supplies the layout
|
|
5
|
+
* factory as the third argument. A viewer always owns its intrinsic height.
|
|
6
|
+
* @param {HTMLElement} container
|
|
7
|
+
* @param {AbortSignal} [signal]
|
|
8
|
+
* @param {typeof createPanelReflow} [createReflow]
|
|
9
|
+
*/
|
|
10
|
+
export function installPanelResizing(container, signal, createReflow = createPanelReflow) {
|
|
11
|
+
const doc = container.ownerDocument;
|
|
12
|
+
if (!doc.defaultView || signal?.aborted || container.hasAttribute("data-compose-resizing-ready"))
|
|
13
|
+
return;
|
|
14
|
+
const browser = doc.defaultView;
|
|
15
|
+
if (browser.getComputedStyle(container).display !== "grid")
|
|
16
|
+
return;
|
|
17
|
+
const panels = Array.from(
|
|
18
|
+
/** @type {NodeListOf<HTMLElement>} */ (container.querySelectorAll(":scope > [data-compose-panel]")));
|
|
19
|
+
if (!panels.length)
|
|
20
|
+
return;
|
|
21
|
+
/** @type {Map<HTMLElement, number[]>} */
|
|
22
|
+
const declared = new Map();
|
|
23
|
+
for (const panel of panels) {
|
|
24
|
+
const widths = (panel.dataset.composeWidths ?? "").trim().split(/\s+/)
|
|
25
|
+
.filter((s) => /^\d+$/.test(s)).map(Number)
|
|
26
|
+
.filter((n) => Number.isSafeInteger(n) && n > 0);
|
|
27
|
+
if (widths.length)
|
|
28
|
+
declared.set(panel, [...new Set(widths)].sort((a, b) => a - b));
|
|
29
|
+
}
|
|
30
|
+
if (!declared.size && panels.length < 2)
|
|
31
|
+
return;
|
|
32
|
+
container.setAttribute("data-compose-resizing-ready", "");
|
|
33
|
+
const reflow = createReflow(container);
|
|
34
|
+
const status = doc.createElement("span");
|
|
35
|
+
status.setAttribute("role", "status");
|
|
36
|
+
status.style.cssText =
|
|
37
|
+
"position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)";
|
|
38
|
+
if (declared.size)
|
|
39
|
+
container.append(status);
|
|
40
|
+
/** @type {Map<HTMLElement, number>} */
|
|
41
|
+
const choices = new Map();
|
|
42
|
+
/** @typedef {{beside:HTMLElement, side:"left"|"right"|"below"}} Placement */
|
|
43
|
+
/** @type {Map<HTMLElement, Placement>} */
|
|
44
|
+
let placements = new Map();
|
|
45
|
+
/** @type {Map<HTMLElement, Placement> | undefined} */
|
|
46
|
+
let manualPreview;
|
|
47
|
+
let lastSlots = panels.map(slot);
|
|
48
|
+
/** @type {Map<HTMLElement, HTMLButtonElement>} */
|
|
49
|
+
const handles = new Map();
|
|
50
|
+
/** @type {(() => void) | undefined} */
|
|
51
|
+
let cancelDrag;
|
|
52
|
+
/** @type {(() => void) | undefined} */
|
|
53
|
+
let projectDrag;
|
|
54
|
+
let available = -1, viewport = -1, pending = 0;
|
|
55
|
+
/** Return the chosen widths that fit now; a wider choice survives a temporary narrow viewport. */
|
|
56
|
+
function fittingChoices() {
|
|
57
|
+
/** @type {Map<HTMLElement, number>} */
|
|
58
|
+
const fitting = new Map();
|
|
59
|
+
for (const [panel, wanted] of choices) {
|
|
60
|
+
const widths = /** @type {number[]} */ (declared.get(panel));
|
|
61
|
+
const width = widths.filter((n) => n <= available && n <= wanted).at(-1);
|
|
62
|
+
if (width !== undefined)
|
|
63
|
+
fitting.set(panel, width);
|
|
64
|
+
}
|
|
65
|
+
return fitting;
|
|
66
|
+
}
|
|
67
|
+
/** @param {HTMLElement} panel */
|
|
68
|
+
function slot(panel) {
|
|
69
|
+
return panel.dataset.area ?? panel.style.order;
|
|
70
|
+
}
|
|
71
|
+
// Swapping a viewer supersedes its previous manual drop. During a swap
|
|
72
|
+
// preview keep the previous placement so canceling restores it.
|
|
73
|
+
function placementsAfterSwap() {
|
|
74
|
+
const result = new Map(placements);
|
|
75
|
+
panels.forEach((panel, i) => {
|
|
76
|
+
if (slot(panel) !== lastSlots[i])
|
|
77
|
+
result.delete(panel);
|
|
78
|
+
});
|
|
79
|
+
return result;
|
|
80
|
+
}
|
|
81
|
+
function place() {
|
|
82
|
+
reflow.layout(fittingChoices(), undefined, manualPreview ?? placementsAfterSwap());
|
|
83
|
+
}
|
|
84
|
+
/** @param {HTMLElement} panel @param {number} width */
|
|
85
|
+
function commitWidth(panel, width) {
|
|
86
|
+
choices.set(panel, width);
|
|
87
|
+
place();
|
|
88
|
+
status.textContent = (panel.dataset.panelLabel || "Viewer") + " width " + width + " pixels.";
|
|
89
|
+
}
|
|
90
|
+
/** @param {KeyboardEvent} event @param {HTMLElement} panel @param {number[]} widths */
|
|
91
|
+
function keyboard(event, panel, widths) {
|
|
92
|
+
if (cancelDrag)
|
|
93
|
+
return;
|
|
94
|
+
const options = widths.filter((n) => n <= available);
|
|
95
|
+
const current = panel.getBoundingClientRect().width;
|
|
96
|
+
let next;
|
|
97
|
+
switch (event.key) {
|
|
98
|
+
case "ArrowLeft":
|
|
99
|
+
next = options.filter((n) => n < current - 0.5).at(-1);
|
|
100
|
+
break;
|
|
101
|
+
case "ArrowRight":
|
|
102
|
+
next = options.find((n) => n > current + 0.5);
|
|
103
|
+
break;
|
|
104
|
+
case "Home":
|
|
105
|
+
next = options[0];
|
|
106
|
+
break;
|
|
107
|
+
case "End":
|
|
108
|
+
next = options.at(-1);
|
|
109
|
+
break;
|
|
110
|
+
default:
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
event.preventDefault();
|
|
114
|
+
if (next === undefined || Math.abs(next - current) < 0.5)
|
|
115
|
+
return;
|
|
116
|
+
commitWidth(panel, next);
|
|
117
|
+
schedule();
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* @param {PointerEvent} event @param {HTMLElement} panel
|
|
121
|
+
* @param {HTMLButtonElement} handle @param {number[]} widths
|
|
122
|
+
*/
|
|
123
|
+
function start(event, panel, handle, widths) {
|
|
124
|
+
if (container.hasAttribute("data-compose-dragging") || !event.isPrimary || event.button !== 0) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
const options = widths.filter((n) => n <= available);
|
|
128
|
+
const bounds = panel.getBoundingClientRect();
|
|
129
|
+
const initial = bounds.width;
|
|
130
|
+
// The authored (possibly fluid) width is the gesture's neutral position.
|
|
131
|
+
const stops = [...options.filter((n) => Math.abs(n - initial) > 0.5), initial].sort((a, b) => a - b);
|
|
132
|
+
if (stops.length < 2)
|
|
133
|
+
return;
|
|
134
|
+
const horizontal = new Map(stops.map((width) => [width, width - initial]));
|
|
135
|
+
const wider = stops.filter((width) => width > initial);
|
|
136
|
+
const down = new Map([initial, ...wider].map((width, i) => [width, i * 40]));
|
|
137
|
+
// At the physical edge the pointer cannot reach the next horizontal midpoint.
|
|
138
|
+
// Pulling down there steps through wider presets without changing height.
|
|
139
|
+
const firstGap = wider[0] - initial;
|
|
140
|
+
const edgeFallback = viewport - bounds.right <= 28 &&
|
|
141
|
+
viewport - event.clientX < firstGap / 2 + Math.min(6, firstGap / 8);
|
|
142
|
+
event.preventDefault();
|
|
143
|
+
const skeleton = doc.createElement("div");
|
|
144
|
+
skeleton.dataset.composeDropPreview = "";
|
|
145
|
+
skeleton.dataset.composeResizePreview = "";
|
|
146
|
+
skeleton.setAttribute("aria-hidden", "true");
|
|
147
|
+
skeleton.inert = true;
|
|
148
|
+
const drag = new AbortController();
|
|
149
|
+
let preview = initial;
|
|
150
|
+
handle.focus({ preventScroll: true });
|
|
151
|
+
handle.setPointerCapture(event.pointerId);
|
|
152
|
+
container.setAttribute("data-compose-dragging", "");
|
|
153
|
+
panel.setAttribute("data-compose-resizing", "");
|
|
154
|
+
/** @param {boolean} commit */
|
|
155
|
+
function finish(commit) {
|
|
156
|
+
drag.abort();
|
|
157
|
+
cancelDrag = undefined;
|
|
158
|
+
projectDrag = undefined;
|
|
159
|
+
if (handle.hasPointerCapture(event.pointerId))
|
|
160
|
+
handle.releasePointerCapture(event.pointerId);
|
|
161
|
+
container.removeAttribute("data-compose-dragging");
|
|
162
|
+
panel.removeAttribute("data-compose-resizing");
|
|
163
|
+
if (preview !== initial) {
|
|
164
|
+
if (commit)
|
|
165
|
+
commitWidth(panel, preview);
|
|
166
|
+
else
|
|
167
|
+
place();
|
|
168
|
+
}
|
|
169
|
+
schedule();
|
|
170
|
+
}
|
|
171
|
+
cancelDrag = () => finish(false);
|
|
172
|
+
projectDrag = () => {
|
|
173
|
+
// A new row can introduce a vertical scrollbar. Keep the gesture alive
|
|
174
|
+
// and project the same preset into the board's available width.
|
|
175
|
+
if (preview > available)
|
|
176
|
+
preview = initial;
|
|
177
|
+
const fitting = fittingChoices();
|
|
178
|
+
if (preview === initial)
|
|
179
|
+
reflow.layout(fitting, undefined, placements);
|
|
180
|
+
else {
|
|
181
|
+
fitting.set(panel, preview);
|
|
182
|
+
reflow.layout(fitting, { panel, skeleton }, placements);
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
browser.addEventListener("blur", cancelDrag, { signal: drag.signal });
|
|
186
|
+
handle.addEventListener("keydown", (key) => {
|
|
187
|
+
if (key.key === "Escape") {
|
|
188
|
+
key.preventDefault();
|
|
189
|
+
finish(false);
|
|
190
|
+
}
|
|
191
|
+
}, { signal: drag.signal });
|
|
192
|
+
handle.addEventListener("pointermove", (move) => {
|
|
193
|
+
if (move.pointerId !== event.pointerId)
|
|
194
|
+
return;
|
|
195
|
+
const dx = move.clientX - event.clientX;
|
|
196
|
+
const dy = move.clientY - event.clientY;
|
|
197
|
+
const pullDown = edgeFallback && dy > Math.abs(dx);
|
|
198
|
+
const positions = pullDown ? down : horizontal;
|
|
199
|
+
const delta = pullDown ? dy : dx;
|
|
200
|
+
let next = initial;
|
|
201
|
+
if (Math.abs(delta) >= 5) {
|
|
202
|
+
let nearest = 0;
|
|
203
|
+
for (const [width, offset] of positions) {
|
|
204
|
+
if (width !== initial && width > available)
|
|
205
|
+
continue;
|
|
206
|
+
if (Math.abs(delta - offset) < Math.abs(delta - nearest)) {
|
|
207
|
+
next = width;
|
|
208
|
+
nearest = offset;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
// A small band around the midpoint prevents jitter from moving neighbors.
|
|
212
|
+
const previous = positions.get(preview) ?? 0;
|
|
213
|
+
const hysteresis = Math.min(6, Math.abs(nearest - previous) / 8);
|
|
214
|
+
if (Math.abs(delta - previous) - Math.abs(delta - nearest) < 2 * hysteresis)
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
if (next === preview)
|
|
218
|
+
return;
|
|
219
|
+
preview = next;
|
|
220
|
+
projectDrag?.();
|
|
221
|
+
}, { signal: drag.signal });
|
|
222
|
+
for (const type of /** @type {const} */ (["pointerup", "pointercancel", "lostpointercapture"])) {
|
|
223
|
+
handle.addEventListener(type, (end) => {
|
|
224
|
+
if (end.pointerId === event.pointerId)
|
|
225
|
+
finish(type === "pointerup");
|
|
226
|
+
}, { signal: drag.signal });
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
function refresh() {
|
|
230
|
+
pending = 0;
|
|
231
|
+
const style = browser.getComputedStyle(container);
|
|
232
|
+
const padding = (parseFloat(style.paddingLeft) || 0) + (parseFloat(style.paddingRight) || 0);
|
|
233
|
+
const room = container.clientWidth - padding;
|
|
234
|
+
if (room !== available || viewport !== browser.innerWidth) {
|
|
235
|
+
available = room;
|
|
236
|
+
viewport = browser.innerWidth;
|
|
237
|
+
if (projectDrag)
|
|
238
|
+
projectDrag();
|
|
239
|
+
else
|
|
240
|
+
place();
|
|
241
|
+
}
|
|
242
|
+
for (const [panel, widths] of declared) {
|
|
243
|
+
const options = widths.filter((n) => n <= available);
|
|
244
|
+
const bounds = panel.getBoundingClientRect();
|
|
245
|
+
const current = bounds.width;
|
|
246
|
+
let handle = handles.get(panel);
|
|
247
|
+
if (!panel.hasAttribute("data-compose-resizing") &&
|
|
248
|
+
!options.some((n) => Math.abs(n - current) > 0.5)) {
|
|
249
|
+
handle?.remove();
|
|
250
|
+
handles.delete(panel);
|
|
251
|
+
continue;
|
|
252
|
+
}
|
|
253
|
+
if (!handle) {
|
|
254
|
+
handle = doc.createElement("button");
|
|
255
|
+
handle.type = "button";
|
|
256
|
+
handle.dataset.composeResize = "";
|
|
257
|
+
handle.dataset.composeCorner = "right";
|
|
258
|
+
handle.setAttribute("aria-label", "Resize " + (panel.dataset.panelLabel || "viewer") + " from bottom right");
|
|
259
|
+
handle.setAttribute("aria-keyshortcuts", "ArrowLeft ArrowRight Home End");
|
|
260
|
+
const grip = handle;
|
|
261
|
+
grip.addEventListener("keydown", (e) => keyboard(e, panel, widths), { signal });
|
|
262
|
+
grip.addEventListener("pointerdown", (e) => start(e, panel, grip, widths), { signal });
|
|
263
|
+
panel.append(grip);
|
|
264
|
+
handles.set(panel, grip);
|
|
265
|
+
}
|
|
266
|
+
handle.setAttribute("aria-description", "Current width " + Math.round(current) +
|
|
267
|
+
" pixels. Available widths: " + options.join(", ") +
|
|
268
|
+
" pixels. Use Left or Right to choose." +
|
|
269
|
+
(viewport - bounds.right <= 28 && options.some((width) => width > current)
|
|
270
|
+
? " At the screen edge, pull down to choose a wider size."
|
|
271
|
+
: ""));
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
function schedule() {
|
|
275
|
+
if (!pending && !signal?.aborted)
|
|
276
|
+
pending = browser.requestAnimationFrame(refresh);
|
|
277
|
+
}
|
|
278
|
+
const observer = new browser.ResizeObserver(schedule);
|
|
279
|
+
observer.observe(container);
|
|
280
|
+
for (const panel of declared.keys())
|
|
281
|
+
observer.observe(panel);
|
|
282
|
+
browser.addEventListener("resize", schedule, { signal });
|
|
283
|
+
container.addEventListener("compose-layout-preview", () => {
|
|
284
|
+
place();
|
|
285
|
+
schedule();
|
|
286
|
+
}, { signal });
|
|
287
|
+
container.addEventListener("compose-layout-change", () => {
|
|
288
|
+
placements = placementsAfterSwap();
|
|
289
|
+
manualPreview = undefined;
|
|
290
|
+
lastSlots = panels.map(slot);
|
|
291
|
+
place();
|
|
292
|
+
schedule();
|
|
293
|
+
}, { signal });
|
|
294
|
+
container.addEventListener("compose-panel-place", (event) => {
|
|
295
|
+
const d =
|
|
296
|
+
/** @type {CustomEvent<{phase:string, panel:HTMLElement, beside:HTMLElement, side:Placement["side"], placed:boolean}>} */ (event)
|
|
297
|
+
.detail;
|
|
298
|
+
if (!d)
|
|
299
|
+
return;
|
|
300
|
+
d.placed = false;
|
|
301
|
+
manualPreview = undefined;
|
|
302
|
+
if (d.phase === "cancel") {
|
|
303
|
+
place();
|
|
304
|
+
schedule();
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
if ((d.phase !== "preview" && d.phase !== "commit") || !panels.includes(d.panel) ||
|
|
308
|
+
!panels.includes(d.beside) || d.panel === d.beside ||
|
|
309
|
+
(d.side !== "left" && d.side !== "right" && d.side !== "below")) {
|
|
310
|
+
place();
|
|
311
|
+
return;
|
|
312
|
+
}
|
|
313
|
+
const proposed = new Map(placements);
|
|
314
|
+
proposed.delete(d.panel);
|
|
315
|
+
// A new anchor cannot remain a dependent of the moved viewer. Reverse
|
|
316
|
+
// that old relation only if the new drop is successfully committed.
|
|
317
|
+
let anchor = d.beside;
|
|
318
|
+
while (proposed.has(anchor)) {
|
|
319
|
+
const next = /** @type {Placement} */ (proposed.get(anchor)).beside;
|
|
320
|
+
if (next === d.panel) {
|
|
321
|
+
proposed.delete(d.beside);
|
|
322
|
+
break;
|
|
323
|
+
}
|
|
324
|
+
anchor = next;
|
|
325
|
+
}
|
|
326
|
+
proposed.set(d.panel, { beside: d.beside, side: d.side });
|
|
327
|
+
d.placed = reflow.layout(fittingChoices(), undefined, proposed);
|
|
328
|
+
if (!d.placed)
|
|
329
|
+
place();
|
|
330
|
+
else if (d.phase === "commit")
|
|
331
|
+
placements = proposed;
|
|
332
|
+
else
|
|
333
|
+
manualPreview = proposed;
|
|
334
|
+
schedule();
|
|
335
|
+
}, { signal });
|
|
336
|
+
signal?.addEventListener("abort", () => {
|
|
337
|
+
cancelDrag?.();
|
|
338
|
+
observer.disconnect();
|
|
339
|
+
browser.cancelAnimationFrame(pending);
|
|
340
|
+
reflow.reset();
|
|
341
|
+
for (const handle of handles.values())
|
|
342
|
+
handle.remove();
|
|
343
|
+
status.remove();
|
|
344
|
+
container.removeAttribute("data-compose-resizing-ready");
|
|
345
|
+
}, { once: true });
|
|
346
|
+
refresh();
|
|
347
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compose.d.ts","sourceRoot":"","sources":["../../../src/src/runtime/compose.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAiBhE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,aAAa,CAAC,
|
|
1
|
+
{"version":3,"file":"compose.d.ts","sourceRoot":"","sources":["../../../src/src/runtime/compose.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAiBhE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,aAAa,CAAC,CAuMxB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,yBAAyB,CAC7C,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,OAAO,CAAC,aAAa,CAAC,CAIxB"}
|
|
@@ -107,6 +107,8 @@ export async function composeDashboard(request) {
|
|
|
107
107
|
toolName: call.tool,
|
|
108
108
|
args: call.args,
|
|
109
109
|
surface: call.surface ?? source.surface,
|
|
110
|
+
supportedWidths: manifest.tools.find((tool) => tool.name === call.tool)
|
|
111
|
+
?.supportedWidths,
|
|
110
112
|
allowedToolNames,
|
|
111
113
|
allowedTools,
|
|
112
114
|
result,
|
|
@@ -137,6 +139,7 @@ export async function composeDashboard(request) {
|
|
|
137
139
|
const collected = collector.collect(outcome.qualifiedName, outcome.result, outcome.args, {
|
|
138
140
|
componentId: outcome.componentId,
|
|
139
141
|
surface: outcome.surface,
|
|
142
|
+
supportedWidths: outcome.supportedWidths,
|
|
140
143
|
});
|
|
141
144
|
if (!collected) {
|
|
142
145
|
warnings.push(`Tool "${outcome.qualifiedName}" did not return UI metadata (_meta.ui.resourceUri)`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../../src/src/runtime/manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../../src/src/runtime/manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAI9C;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,OAAO,GACZ;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAqEtC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,WAAW,CAwB1E;AAED;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAGrE;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAUnC"}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @module runtime/manifest
|
|
8
8
|
*/
|
|
9
|
+
import { isSupportedWidths } from "../core/types/resources.js";
|
|
9
10
|
import { RuntimeErrorCode } from "./types.js";
|
|
10
11
|
/**
|
|
11
12
|
* Validate a raw object as a manifest. Returns errors if invalid.
|
|
@@ -72,6 +73,9 @@ export function validateManifest(data) {
|
|
|
72
73
|
else if (tool.appCallable !== undefined && typeof tool.appCallable !== "boolean") {
|
|
73
74
|
errors.push(`tools[${i}].appCallable must be a boolean if provided`);
|
|
74
75
|
}
|
|
76
|
+
else if (tool.supportedWidths !== undefined && !isSupportedWidths(tool.supportedWidths)) {
|
|
77
|
+
errors.push(`tools[${i}].supportedWidths must be an array of positive safe integers`);
|
|
78
|
+
}
|
|
75
79
|
}
|
|
76
80
|
}
|
|
77
81
|
return { valid: errors.length === 0, errors };
|
|
@@ -88,6 +88,8 @@ export interface McpToolDeclaration {
|
|
|
88
88
|
accepts?: string[];
|
|
89
89
|
/** UI resource URI pattern. */
|
|
90
90
|
resourceUri?: string;
|
|
91
|
+
/** Widths offered by this tool's viewer in CSS pixels. An empty list disables resizing. */
|
|
92
|
+
supportedWidths?: readonly number[];
|
|
91
93
|
/**
|
|
92
94
|
* Whether an embedded MCP App may invoke this tool through Compose's host
|
|
93
95
|
* bridge. Omitted means deny: interactive capabilities are opt-in per tool.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/src/runtime/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAMpE;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,OAAO,CAAC;IACd,mCAAmC;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,yBAAyB;IACzB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,6CAA6C;IAC7C,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,0EAA0E;IAC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AAM,EAAE,SAAS,sBAAsB,EAAE,CAAC;IAC1C,qFAAqF;IACrF,OAAO,CAAC,EAAE,UAAU,CAAC;CACtB;AAMD,2BAA2B;AAC3B,oBAAY,gBAAgB;IAC1B,oBAAoB,yBAAyB;IAC7C,oBAAoB,yBAAyB;IAC7C,kBAAkB,uBAAuB;IACzC,oBAAoB,yBAAyB;IAC7C,gBAAgB,qBAAqB;IACrC,iBAAiB,sBAAsB;IACvC,gBAAgB,qBAAqB;IACrC,iBAAiB,sBAAsB;IACvC,oBAAoB,yBAAyB;IAC7C,qBAAqB,0BAA0B;IAC/C,oBAAoB,yBAAyB;IAC7C,qBAAqB,0BAA0B;IAC/C,YAAY,iBAAiB;CAC9B;AAED,gCAAgC;AAChC,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,gBAAgB,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB"}
|
package/esm/src/sdk/mcp-sdk.d.ts
CHANGED
|
@@ -54,9 +54,10 @@ export interface McpSdkCollector {
|
|
|
54
54
|
* @param toolName - Name of the tool that produced this result
|
|
55
55
|
* @param result - MCP SDK CallToolResult (or any structurally compatible object)
|
|
56
56
|
* @param context - Optional context data for the UI
|
|
57
|
+
* @param options - Compose layout options for the resulting viewer
|
|
57
58
|
* @returns Collected resource, or `null` if no UI metadata or if result is an error
|
|
58
59
|
*/
|
|
59
|
-
collectFromSdk(toolName: string, result: McpSdkCallToolResult, context?: Record<string, unknown>): CollectedUiResource | null;
|
|
60
|
+
collectFromSdk(toolName: string, result: McpSdkCallToolResult, context?: Record<string, unknown>, options?: Pick<CollectedUiResource, "supportedWidths">): CollectedUiResource | null;
|
|
60
61
|
/** Get all collected resources in slot order. */
|
|
61
62
|
getResources(): CollectedUiResource[];
|
|
62
63
|
/** Reset collected resources. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-sdk.d.ts","sourceRoot":"","sources":["../../../src/src/sdk/mcp-sdk.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAElE;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC,CAAC;IACzE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,eAAe;IAC9B
|
|
1
|
+
{"version":3,"file":"mcp-sdk.d.ts","sourceRoot":"","sources":["../../../src/src/sdk/mcp-sdk.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAElE;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC,CAAC;IACzE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;;;;;;;;OAWG;IACH,cAAc,CACZ,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,oBAAoB,EAC5B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,OAAO,CAAC,EAAE,IAAI,CAAC,mBAAmB,EAAE,iBAAiB,CAAC,GACrD,mBAAmB,GAAG,IAAI,CAAC;IAE9B,iDAAiD;IACjD,YAAY,IAAI,mBAAmB,EAAE,CAAC;IAEtC,iCAAiC;IACjC,KAAK,IAAI,IAAI,CAAC;IAEd,4CAA4C;IAC5C,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,qBAAqB,IAAI,eAAe,CAuBvD"}
|
package/esm/src/sdk/mcp-sdk.js
CHANGED
|
@@ -35,11 +35,11 @@ import { createCollector } from "../core/collector/collector.js";
|
|
|
35
35
|
export function createMcpSdkCollector() {
|
|
36
36
|
const inner = createCollector();
|
|
37
37
|
return {
|
|
38
|
-
collectFromSdk(toolName, result, context) {
|
|
38
|
+
collectFromSdk(toolName, result, context, options) {
|
|
39
39
|
if (result.isError) {
|
|
40
40
|
return null;
|
|
41
41
|
}
|
|
42
|
-
return inner.collect(toolName, result, context);
|
|
42
|
+
return inner.collect(toolName, result, context, options);
|
|
43
43
|
},
|
|
44
44
|
getResources() {
|
|
45
45
|
return inner.getResources();
|
package/esm/src/version.d.ts
CHANGED
package/esm/src/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,3 +1,52 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
interface Array<T> {
|
|
3
|
+
/**
|
|
4
|
+
* Returns the value of the last element in the array where predicate is true, and undefined
|
|
5
|
+
* otherwise.
|
|
6
|
+
* @param predicate find calls predicate once for each element of the array, in ascending
|
|
7
|
+
* order, until it finds one where predicate returns true. If such an element is found, find
|
|
8
|
+
* immediately returns that element value. Otherwise, find returns undefined.
|
|
9
|
+
* @param thisArg If provided, it will be used as the this value for each invocation of
|
|
10
|
+
* predicate. If it is not provided, undefined is used instead.
|
|
11
|
+
*/
|
|
12
|
+
findLast<S extends T>(predicate: (this: void, value: T, index: number, obj: T[]) => value is S, thisArg?: any): S | undefined;
|
|
13
|
+
findLast(predicate: (value: T, index: number, obj: T[]) => unknown, thisArg?: any): T | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Returns the index of the last element in the array where predicate is true, and -1
|
|
16
|
+
* otherwise.
|
|
17
|
+
* @param predicate find calls predicate once for each element of the array, in ascending
|
|
18
|
+
* order, until it finds one where predicate returns true. If such an element is found,
|
|
19
|
+
* findIndex immediately returns that element index. Otherwise, findIndex returns -1.
|
|
20
|
+
* @param thisArg If provided, it will be used as the this value for each invocation of
|
|
21
|
+
* predicate. If it is not provided, undefined is used instead.
|
|
22
|
+
*/
|
|
23
|
+
findLastIndex(predicate: (value: T, index: number, obj: T[]) => unknown, thisArg?: any): number;
|
|
24
|
+
}
|
|
25
|
+
interface Uint8Array {
|
|
26
|
+
/**
|
|
27
|
+
* Returns the value of the last element in the array where predicate is true, and undefined
|
|
28
|
+
* otherwise.
|
|
29
|
+
* @param predicate findLast calls predicate once for each element of the array, in descending
|
|
30
|
+
* order, until it finds one where predicate returns true. If such an element is found, findLast
|
|
31
|
+
* immediately returns that element value. Otherwise, findLast returns undefined.
|
|
32
|
+
* @param thisArg If provided, it will be used as the this value for each invocation of
|
|
33
|
+
* predicate. If it is not provided, undefined is used instead.
|
|
34
|
+
*/
|
|
35
|
+
findLast<S extends number>(predicate: (value: number, index: number, array: Uint8Array) => value is S, thisArg?: any): S | undefined;
|
|
36
|
+
findLast(predicate: (value: number, index: number, array: Uint8Array) => unknown, thisArg?: any): number | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* Returns the index of the last element in the array where predicate is true, and -1
|
|
39
|
+
* otherwise.
|
|
40
|
+
* @param predicate findLastIndex calls predicate once for each element of the array, in descending
|
|
41
|
+
* order, until it finds one where predicate returns true. If such an element is found,
|
|
42
|
+
* findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1.
|
|
43
|
+
* @param thisArg If provided, it will be used as the this value for each invocation of
|
|
44
|
+
* predicate. If it is not provided, undefined is used instead.
|
|
45
|
+
*/
|
|
46
|
+
findLastIndex(predicate: (value: number, index: number, array: Uint8Array) => unknown, thisArg?: any): number;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
export {};
|
|
1
50
|
declare global {
|
|
2
51
|
interface Object {
|
|
3
52
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_dnt.polyfills.d.ts","sourceRoot":"","sources":["../src/_dnt.polyfills.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"_dnt.polyfills.d.ts","sourceRoot":"","sources":["../src/_dnt.polyfills.ts"],"names":[],"mappings":"AACA,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,KAAK,CAAC,CAAC;QACf;;;;;;;;WAQG;QACH,QAAQ,CAAC,CAAC,SAAS,CAAC,EAClB,SAAS,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC,EACxE,OAAO,CAAC,EAAE,GAAG,GACZ,CAAC,GAAG,SAAS,CAAC;QACjB,QAAQ,CACN,SAAS,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,OAAO,EACzD,OAAO,CAAC,EAAE,GAAG,GACZ,CAAC,GAAG,SAAS,CAAC;QAEjB;;;;;;;;WAQG;QACH,aAAa,CACX,SAAS,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,OAAO,EACzD,OAAO,CAAC,EAAE,GAAG,GACZ,MAAM,CAAC;KACX;IACD,UAAU,UAAU;QAClB;;;;;;;;WAQG;QACH,QAAQ,CAAC,CAAC,SAAS,MAAM,EACvB,SAAS,EAAE,CACP,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,UAAU,KAChB,KAAK,IAAI,CAAC,EACf,OAAO,CAAC,EAAE,GAAG,GACZ,CAAC,GAAG,SAAS,CAAC;QACjB,QAAQ,CACJ,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,KAAK,OAAO,EACvE,OAAO,CAAC,EAAE,GAAG,GACd,MAAM,GAAG,SAAS,CAAC;QAEtB;;;;;;;;WAQG;QACH,aAAa,CACT,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,KAAK,OAAO,EACvE,OAAO,CAAC,EAAE,GAAG,GACd,MAAM,CAAC;KACX;CACF;AA4CD,OAAO,EAAE,CAAC;AAgBV,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd;;;;WAIG;QACH,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC;KAC5C;CACF;AAED,OAAO,EAAE,CAAC;AACV,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,KAAK;QACb,KAAK,CAAC,EAAE,OAAO,CAAC;KACjB;CACF;AAED,OAAO,EAAE,CAAC"}
|
package/script/_dnt.polyfills.js
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
function findLastIndex(self, callbackfn, that) {
|
|
4
|
+
const boundFunc = that === undefined ? callbackfn : callbackfn.bind(that);
|
|
5
|
+
let index = self.length - 1;
|
|
6
|
+
while (index >= 0) {
|
|
7
|
+
const result = boundFunc(self[index], index, self);
|
|
8
|
+
if (result) {
|
|
9
|
+
return index;
|
|
10
|
+
}
|
|
11
|
+
index--;
|
|
12
|
+
}
|
|
13
|
+
return -1;
|
|
14
|
+
}
|
|
15
|
+
function findLast(self, callbackfn, that) {
|
|
16
|
+
const index = self.findLastIndex(callbackfn, that);
|
|
17
|
+
return index === -1 ? undefined : self[index];
|
|
18
|
+
}
|
|
19
|
+
if (!Array.prototype.findLastIndex) {
|
|
20
|
+
Array.prototype.findLastIndex = function (callbackfn, that) {
|
|
21
|
+
return findLastIndex(this, callbackfn, that);
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
if (!Array.prototype.findLast) {
|
|
25
|
+
Array.prototype.findLast = function (callbackfn, that) {
|
|
26
|
+
return findLast(this, callbackfn, that);
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
if (!Uint8Array.prototype.findLastIndex) {
|
|
30
|
+
Uint8Array.prototype.findLastIndex = function (callbackfn, that) {
|
|
31
|
+
return findLastIndex(this, callbackfn, that);
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
if (!Uint8Array.prototype.findLast) {
|
|
35
|
+
Uint8Array.prototype.findLast = function (callbackfn, that) {
|
|
36
|
+
return findLast(this, callbackfn, that);
|
|
37
|
+
};
|
|
38
|
+
}
|
|
3
39
|
// https://github.com/tc39/proposal-accessible-object-hasownproperty/blob/main/polyfill.js
|
|
4
40
|
if (!Object.hasOwn) {
|
|
5
41
|
Object.defineProperty(Object, "hasOwn", {
|
|
@@ -6,6 +6,8 @@ import "../../_dnt.polyfills.js";
|
|
|
6
6
|
import type { ComponentSurface } from "../core/types/components.js";
|
|
7
7
|
import type { CompositeUiDescriptor } from "../core/types/descriptor.js";
|
|
8
8
|
import type { UiLayout } from "../core/types/layout.js";
|
|
9
|
+
export { getPanelControlsCss } from "../host/renderer/css/panel-controls.js";
|
|
10
|
+
export { installPanelMovement, installPanelResizing } from "../host/renderer/panel-controls.js";
|
|
9
11
|
/** MCP App result metadata containing the receipts selected by the program. */
|
|
10
12
|
export declare const SNIPPET_PANELS_META_KEY = "io.mcpview/snippet-panels";
|
|
11
13
|
/** A selected provider result. The receipt ID distinguishes calls to the same snippet. */
|
|
@@ -21,6 +23,8 @@ export interface SnippetPanelView {
|
|
|
21
23
|
readonly resourceUri: string;
|
|
22
24
|
readonly context?: Record<string, unknown>;
|
|
23
25
|
readonly surface?: ComponentSurface;
|
|
26
|
+
/** Widths offered by this local view in CSS pixels. An empty list disables resizing. */
|
|
27
|
+
readonly supportedWidths?: readonly number[];
|
|
24
28
|
}
|
|
25
29
|
/** Display options supplied by the board hosting the results. */
|
|
26
30
|
export interface SnippetBoardOptions {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"board.d.ts","sourceRoot":"","sources":["../../../src/src/code-mode/board.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,yBAAyB,CAAC;AAMjC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,+EAA+E;AAC/E,eAAO,MAAM,uBAAuB,8BAA8B,CAAC;AAEnE,0FAA0F;AAC1F,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC1C;AAED,4FAA4F;AAC5F,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,WAAW,EAAE,MAAM,CA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