instruckt 0.4.19 → 0.4.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/instruckt.cjs.js +22 -32
- package/dist/instruckt.cjs.js.map +1 -1
- package/dist/instruckt.esm.js +22 -32
- package/dist/instruckt.esm.js.map +1 -1
- package/dist/instruckt.iife.js +17 -17
- package/dist/instruckt.iife.js.map +1 -1
- package/package.json +1 -1
package/dist/instruckt.cjs.js
CHANGED
|
@@ -2372,20 +2372,6 @@ function nodeFilter(node) {
|
|
|
2372
2372
|
if ((_a2 = node.getAttribute) == null ? void 0 : _a2.call(node, "data-instruckt")) return false;
|
|
2373
2373
|
return true;
|
|
2374
2374
|
}
|
|
2375
|
-
function hasShadowDOM() {
|
|
2376
|
-
if (document.querySelector("[data-flux], flux\\:button, flux\\:input")) return true;
|
|
2377
|
-
for (const child of document.body.querySelectorAll("*")) {
|
|
2378
|
-
if (child.shadowRoot && !child.hasAttribute("data-instruckt")) return true;
|
|
2379
|
-
}
|
|
2380
|
-
return false;
|
|
2381
|
-
}
|
|
2382
|
-
var _useScreenCapture = null;
|
|
2383
|
-
function shouldUseScreenCapture() {
|
|
2384
|
-
if (_useScreenCapture === null) {
|
|
2385
|
-
_useScreenCapture = hasShadowDOM();
|
|
2386
|
-
}
|
|
2387
|
-
return _useScreenCapture;
|
|
2388
|
-
}
|
|
2389
2375
|
var activeStream = null;
|
|
2390
2376
|
async function getStream() {
|
|
2391
2377
|
if (activeStream && activeStream.active) return activeStream;
|
|
@@ -2432,15 +2418,13 @@ function captureRectFromStream(stream, rect) {
|
|
|
2432
2418
|
});
|
|
2433
2419
|
}
|
|
2434
2420
|
async function captureElement(el) {
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
} catch (e) {
|
|
2443
|
-
}
|
|
2421
|
+
try {
|
|
2422
|
+
const dataUrl = await domToPng(el, {
|
|
2423
|
+
scale: 2,
|
|
2424
|
+
filter: nodeFilter
|
|
2425
|
+
});
|
|
2426
|
+
if (dataUrl) return dataUrl;
|
|
2427
|
+
} catch (e) {
|
|
2444
2428
|
}
|
|
2445
2429
|
try {
|
|
2446
2430
|
const stream = await getStream();
|
|
@@ -2451,15 +2435,13 @@ async function captureElement(el) {
|
|
|
2451
2435
|
}
|
|
2452
2436
|
}
|
|
2453
2437
|
async function captureRegion(rect) {
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
} catch (e) {
|
|
2462
|
-
}
|
|
2438
|
+
try {
|
|
2439
|
+
const full = await domToPng(document.body, {
|
|
2440
|
+
scale: 2,
|
|
2441
|
+
filter: nodeFilter
|
|
2442
|
+
});
|
|
2443
|
+
if (full) return await cropImage(full, rect);
|
|
2444
|
+
} catch (e) {
|
|
2463
2445
|
}
|
|
2464
2446
|
try {
|
|
2465
2447
|
const stream = await getStream();
|
|
@@ -3794,6 +3776,14 @@ No open annotations.`;
|
|
|
3794
3776
|
lines.push("");
|
|
3795
3777
|
});
|
|
3796
3778
|
}
|
|
3779
|
+
const hasScreenshots = pending.some((a) => a.screenshot && !a.screenshot.startsWith("data:"));
|
|
3780
|
+
lines.push("---");
|
|
3781
|
+
lines.push("");
|
|
3782
|
+
if (hasScreenshots) {
|
|
3783
|
+
lines.push("Use the `instruckt.get_screenshot` MCP tool to view screenshots. After making changes, use `instruckt.resolve` to mark each annotation as resolved.");
|
|
3784
|
+
} else {
|
|
3785
|
+
lines.push("After making changes, use the `instruckt.resolve` MCP tool to mark each annotation as resolved.");
|
|
3786
|
+
}
|
|
3797
3787
|
return lines.join("\n").trim();
|
|
3798
3788
|
}
|
|
3799
3789
|
// ── Public API ────────────────────────────────────────────────
|