@particle-academy/agent-integrations 0.17.0 → 0.18.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/dist/components-shared-whiteboard.cjs +7 -2
- package/dist/components-shared-whiteboard.cjs.map +1 -1
- package/dist/index.cjs +78 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +31 -1
- package/dist/index.d.ts +31 -1
- package/dist/index.js +71 -1
- package/dist/index.js.map +1 -1
- package/dist/sharing.cjs +7 -2
- package/dist/sharing.cjs.map +1 -1
- package/package.json +4 -1
package/dist/index.cjs
CHANGED
|
@@ -8,8 +8,13 @@ var reactDom = require('react-dom');
|
|
|
8
8
|
|
|
9
9
|
var __defProp = Object.defineProperty;
|
|
10
10
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
11
|
-
var __esm = (fn, res) => function __init() {
|
|
12
|
-
|
|
11
|
+
var __esm = (fn, res, err) => function __init() {
|
|
12
|
+
if (err) throw err[0];
|
|
13
|
+
try {
|
|
14
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
15
|
+
} catch (e) {
|
|
16
|
+
throw err = [e], e;
|
|
17
|
+
}
|
|
13
18
|
};
|
|
14
19
|
var __export = (target, all) => {
|
|
15
20
|
for (var name in all)
|
|
@@ -3479,6 +3484,76 @@ function CoBrowseCursorLayer({ active = true, zIndex = 2147483e3 }) {
|
|
|
3479
3484
|
);
|
|
3480
3485
|
}
|
|
3481
3486
|
CoBrowseCursorLayer.displayName = "CoBrowseCursorLayer";
|
|
3487
|
+
function resolveCsrf(explicit) {
|
|
3488
|
+
if (explicit) return explicit;
|
|
3489
|
+
if (typeof document === "undefined") return void 0;
|
|
3490
|
+
return document.querySelector('meta[name="csrf-token"]')?.content;
|
|
3491
|
+
}
|
|
3492
|
+
function SimulateUsersButton({
|
|
3493
|
+
endpoint = "/active-users/simulate",
|
|
3494
|
+
count = 10,
|
|
3495
|
+
label,
|
|
3496
|
+
csrfToken,
|
|
3497
|
+
onTriggered,
|
|
3498
|
+
onError,
|
|
3499
|
+
className,
|
|
3500
|
+
style
|
|
3501
|
+
}) {
|
|
3502
|
+
const [busy, setBusy] = react.useState(false);
|
|
3503
|
+
async function trigger() {
|
|
3504
|
+
if (busy) return;
|
|
3505
|
+
setBusy(true);
|
|
3506
|
+
try {
|
|
3507
|
+
const token = resolveCsrf(csrfToken);
|
|
3508
|
+
const res = await fetch(endpoint, {
|
|
3509
|
+
method: "POST",
|
|
3510
|
+
headers: {
|
|
3511
|
+
"Content-Type": "application/json",
|
|
3512
|
+
"X-Requested-With": "XMLHttpRequest",
|
|
3513
|
+
...token ? { "X-CSRF-TOKEN": token } : {}
|
|
3514
|
+
},
|
|
3515
|
+
credentials: "same-origin",
|
|
3516
|
+
body: JSON.stringify({ count })
|
|
3517
|
+
});
|
|
3518
|
+
if (!res.ok) throw new Error(`Simulate request failed: ${res.status}`);
|
|
3519
|
+
onTriggered?.();
|
|
3520
|
+
} catch (err) {
|
|
3521
|
+
onError?.(err);
|
|
3522
|
+
} finally {
|
|
3523
|
+
setBusy(false);
|
|
3524
|
+
}
|
|
3525
|
+
}
|
|
3526
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3527
|
+
"button",
|
|
3528
|
+
{
|
|
3529
|
+
type: "button",
|
|
3530
|
+
"data-fai-simulate-users": "",
|
|
3531
|
+
className: ["fai-simulate-users", className ?? ""].filter(Boolean).join(" "),
|
|
3532
|
+
onClick: trigger,
|
|
3533
|
+
disabled: busy,
|
|
3534
|
+
style: {
|
|
3535
|
+
display: "inline-flex",
|
|
3536
|
+
alignItems: "center",
|
|
3537
|
+
gap: 8,
|
|
3538
|
+
padding: "8px 14px",
|
|
3539
|
+
borderRadius: 8,
|
|
3540
|
+
border: "1px solid rgba(139,92,246,0.4)",
|
|
3541
|
+
background: busy ? "rgba(139,92,246,0.15)" : "rgba(139,92,246,0.1)",
|
|
3542
|
+
color: "#7c3aed",
|
|
3543
|
+
font: "inherit",
|
|
3544
|
+
fontSize: 13,
|
|
3545
|
+
fontWeight: 500,
|
|
3546
|
+
cursor: busy ? "progress" : "pointer",
|
|
3547
|
+
opacity: busy ? 0.7 : 1,
|
|
3548
|
+
...style
|
|
3549
|
+
},
|
|
3550
|
+
children: [
|
|
3551
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, children: busy ? "\u23F3" : "\u2728" }),
|
|
3552
|
+
label ?? `Simulate ${count} active users`
|
|
3553
|
+
]
|
|
3554
|
+
}
|
|
3555
|
+
);
|
|
3556
|
+
}
|
|
3482
3557
|
|
|
3483
3558
|
// src/presence/index.ts
|
|
3484
3559
|
init_registry();
|
|
@@ -3622,6 +3697,7 @@ exports.MicroMcpServer = MicroMcpServer;
|
|
|
3622
3697
|
exports.RelayTransport = RelayTransport;
|
|
3623
3698
|
exports.ScreensActivityBridge = ScreensActivityBridge;
|
|
3624
3699
|
exports.ShareControls = ShareControls;
|
|
3700
|
+
exports.SimulateUsersButton = SimulateUsersButton;
|
|
3625
3701
|
exports.SseRelayTransport = SseRelayTransport;
|
|
3626
3702
|
exports.ToolRegistry = ToolRegistry;
|
|
3627
3703
|
exports.VscodeMark = VscodeMark;
|