@axiom-lattice/react-sdk 4.7.0 → 4.9.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/{AgentDetailSideApp-2JNOJJ5P.mjs → AgentDetailSideApp-ACWJRNBF.mjs} +6 -6
- package/dist/{AgentGovernanceWorkbench-7774UCO4.mjs → AgentGovernanceWorkbench-WPFLPKX2.mjs} +7 -7
- package/dist/{MessageGraph-H4EQ63JD.mjs → MessageGraph-ATBGFDKC.mjs} +2 -2
- package/dist/{ReactChart-OUESIJLS.mjs → ReactChart-MVMTUCC2.mjs} +2 -2
- package/dist/{TasksSideApp-U5Y2CDWG.mjs → TasksSideApp-4D57XVVN.mjs} +3 -3
- package/dist/{TeamWorkspace-PJDSDACR.mjs → TeamWorkspace-CKDGQXDK.mjs} +2 -2
- package/dist/{TopologyRuntimeView-SP5W2FQ6.mjs → TopologyRuntimeView-VQHTSHS7.mjs} +3 -3
- package/dist/{WorkflowAutomationView-ZJHBPJJS.mjs → WorkflowAutomationView-ML2C3UJ6.mjs} +5 -5
- package/dist/{chunk-EJSF5V4C.mjs → chunk-2XFDXZBC.mjs} +1419 -1194
- package/dist/chunk-2XFDXZBC.mjs.map +1 -0
- package/dist/{chunk-TY6EAWI3.mjs → chunk-4OHEHIO2.mjs} +4 -4
- package/dist/{chunk-K24VIDPM.mjs → chunk-6TVIQLUM.mjs} +4 -4
- package/dist/{chunk-DKZKSZKS.mjs → chunk-CXXXJ65D.mjs} +2 -2
- package/dist/{chunk-KCNPUCUF.mjs → chunk-H4KWXUGY.mjs} +5 -5
- package/dist/{chunk-4OIV2Y4N.mjs → chunk-ZFTTVO6A.mjs} +2 -2
- package/dist/{chunk-A74LL4G7.mjs → chunk-ZMSYTPCA.mjs} +2 -2
- package/dist/{embed-page-AgentDetailSideApp-RYW35RDW.js → embed-page-AgentDetailSideApp-BVJK7WIS.js} +1 -1
- package/dist/{embed-page-AgentGovernanceWorkbench-SSI2N4CW.js → embed-page-AgentGovernanceWorkbench-L2YHPRNE.js} +1 -1
- package/dist/{embed-page-MessageGraph-JMMRV4NA.js → embed-page-MessageGraph-JOQ46UE2.js} +1 -1
- package/dist/{embed-page-ReactChart-RR7SDQLQ.js → embed-page-ReactChart-I5AYTSII.js} +1 -1
- package/dist/{embed-page-SkillFlow-HY7PD43P.js → embed-page-SkillFlow-YLB5XPFH.js} +1 -1
- package/dist/{embed-page-TasksSideApp-BASG7DZU.js → embed-page-TasksSideApp-QLJVB7UK.js} +1 -1
- package/dist/{embed-page-TeamWorkspace-47MYCJUC.js → embed-page-TeamWorkspace-BZZEAYSB.js} +1 -1
- package/dist/{embed-page-TopologyRuntimeView-43FFLV2R.js → embed-page-TopologyRuntimeView-FRA3AXQQ.js} +1 -1
- package/dist/{embed-page-WorkflowAutomationView-PJFMBIO4.js → embed-page-WorkflowAutomationView-D745PK3W.js} +1 -1
- package/dist/{embed-page-chunk-Z47FPHYE.js → embed-page-chunk-4WBAN7QL.js} +154 -154
- package/dist/{embed-page-chunk-U5ZOEKY3.js → embed-page-chunk-FVMSMU4J.js} +1 -1
- package/dist/{embed-page-chunk-KYQEC2CK.js → embed-page-chunk-FWGNJMXD.js} +1 -1
- package/dist/{embed-page-chunk-2VT6CPNX.js → embed-page-chunk-K5YYUAPL.js} +1 -1
- package/dist/{embed-page-chunk-YZLW7PUO.js → embed-page-chunk-M2PV36MX.js} +1 -1
- package/dist/{embed-page-chunk-U7GYZWFZ.js → embed-page-chunk-P5PFV3N7.js} +1 -1
- package/dist/{embed-page-chunk-7ZBZKXBU.js → embed-page-chunk-WMLR2GQK.js} +4 -4
- package/dist/embed-page.js +1 -1
- package/dist/index.d.mts +5 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.js +2897 -2761
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -114
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/dist/chunk-EJSF5V4C.mjs.map +0 -1
- /package/dist/{AgentDetailSideApp-2JNOJJ5P.mjs.map → AgentDetailSideApp-ACWJRNBF.mjs.map} +0 -0
- /package/dist/{AgentGovernanceWorkbench-7774UCO4.mjs.map → AgentGovernanceWorkbench-WPFLPKX2.mjs.map} +0 -0
- /package/dist/{MessageGraph-H4EQ63JD.mjs.map → MessageGraph-ATBGFDKC.mjs.map} +0 -0
- /package/dist/{ReactChart-OUESIJLS.mjs.map → ReactChart-MVMTUCC2.mjs.map} +0 -0
- /package/dist/{TasksSideApp-U5Y2CDWG.mjs.map → TasksSideApp-4D57XVVN.mjs.map} +0 -0
- /package/dist/{TeamWorkspace-PJDSDACR.mjs.map → TeamWorkspace-CKDGQXDK.mjs.map} +0 -0
- /package/dist/{TopologyRuntimeView-SP5W2FQ6.mjs.map → TopologyRuntimeView-VQHTSHS7.mjs.map} +0 -0
- /package/dist/{WorkflowAutomationView-ZJHBPJJS.mjs.map → WorkflowAutomationView-ML2C3UJ6.mjs.map} +0 -0
- /package/dist/{chunk-TY6EAWI3.mjs.map → chunk-4OHEHIO2.mjs.map} +0 -0
- /package/dist/{chunk-K24VIDPM.mjs.map → chunk-6TVIQLUM.mjs.map} +0 -0
- /package/dist/{chunk-DKZKSZKS.mjs.map → chunk-CXXXJ65D.mjs.map} +0 -0
- /package/dist/{chunk-KCNPUCUF.mjs.map → chunk-H4KWXUGY.mjs.map} +0 -0
- /package/dist/{chunk-4OIV2Y4N.mjs.map → chunk-ZFTTVO6A.mjs.map} +0 -0
- /package/dist/{chunk-A74LL4G7.mjs.map → chunk-ZMSYTPCA.mjs.map} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
AgentGraphView,
|
|
5
5
|
AgentList,
|
|
6
6
|
CreateAssistantModal_default
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-4OHEHIO2.mjs";
|
|
8
8
|
import {
|
|
9
9
|
WorkflowAutomationView
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-6TVIQLUM.mjs";
|
|
11
11
|
import {
|
|
12
12
|
AgentChatApp,
|
|
13
13
|
AgentConfigGraph,
|
|
@@ -21,14 +21,14 @@ import {
|
|
|
21
21
|
getRoundRepresentativeScore,
|
|
22
22
|
isTrainingRound,
|
|
23
23
|
toAttachmentItems
|
|
24
|
-
} from "./chunk-
|
|
25
|
-
import "./chunk-
|
|
24
|
+
} from "./chunk-H4KWXUGY.mjs";
|
|
25
|
+
import "./chunk-CXXXJ65D.mjs";
|
|
26
26
|
import {
|
|
27
27
|
WorkflowCanvas_default,
|
|
28
28
|
WorkflowNode_default
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-ZFTTVO6A.mjs";
|
|
30
30
|
import "./chunk-7QQKL657.mjs";
|
|
31
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-ZMSYTPCA.mjs";
|
|
32
32
|
import "./chunk-7FWCKQNB.mjs";
|
|
33
33
|
import {
|
|
34
34
|
A2AKeyList,
|
|
@@ -186,9 +186,10 @@ import {
|
|
|
186
186
|
useTenants,
|
|
187
187
|
useUsers,
|
|
188
188
|
useVoiceRecorder,
|
|
189
|
+
useWebPush,
|
|
189
190
|
useWorkspaceContext,
|
|
190
191
|
useWorkspaceContextOptional
|
|
191
|
-
} from "./chunk-
|
|
192
|
+
} from "./chunk-2XFDXZBC.mjs";
|
|
192
193
|
import {
|
|
193
194
|
formatErrorMessage,
|
|
194
195
|
rootErrorMessage
|
|
@@ -3514,113 +3515,6 @@ var LatticeAgentWorkspace = ({
|
|
|
3514
3515
|
assistant_id,
|
|
3515
3516
|
...chatProps
|
|
3516
3517
|
}) => /* @__PURE__ */ jsx11(WorkspaceContextProvider, { workspaceId, projectId, children: /* @__PURE__ */ jsx11(AssistantContextProvider, { autoLoad: true, initialAssistantId: assistant_id, children: /* @__PURE__ */ jsx11(LatticeChat, { showProjectSelector: false, assistant_id, ...chatProps }) }) });
|
|
3517
|
-
|
|
3518
|
-
// src/integrations/push/useWebPush.ts
|
|
3519
|
-
import { useCallback as useCallback2, useEffect as useEffect4, useRef as useRef3, useState as useState4 } from "react";
|
|
3520
|
-
function supported() {
|
|
3521
|
-
return typeof navigator !== "undefined" && "serviceWorker" in navigator && typeof window !== "undefined" && "PushManager" in window && "Notification" in window;
|
|
3522
|
-
}
|
|
3523
|
-
function urlBase64ToUint8Array(base64) {
|
|
3524
|
-
const padding = "=".repeat((4 - base64.length % 4) % 4);
|
|
3525
|
-
const normalized = (base64 + padding).replace(/-/g, "+").replace(/_/g, "/");
|
|
3526
|
-
const raw = atob(normalized);
|
|
3527
|
-
const output = new Uint8Array(raw.length);
|
|
3528
|
-
for (let i = 0; i < raw.length; i += 1) output[i] = raw.charCodeAt(i);
|
|
3529
|
-
return output.buffer;
|
|
3530
|
-
}
|
|
3531
|
-
function authToken() {
|
|
3532
|
-
if (typeof window === "undefined") return "";
|
|
3533
|
-
return readAuthItem("lattice_token") ?? "";
|
|
3534
|
-
}
|
|
3535
|
-
function useWebPush(options = {}) {
|
|
3536
|
-
const { config } = useLatticeChatShellContext();
|
|
3537
|
-
const userId = useAuthOptional()?.user?.id;
|
|
3538
|
-
const baseURL = config.baseURL;
|
|
3539
|
-
const [permission, setPermission] = useState4(
|
|
3540
|
-
supported() ? Notification.permission : "unsupported"
|
|
3541
|
-
);
|
|
3542
|
-
const [subscribed, setSubscribed] = useState4(false);
|
|
3543
|
-
const [busy, setBusy] = useState4(false);
|
|
3544
|
-
const autoPromptedRef = useRef3(false);
|
|
3545
|
-
const vapidKeyUrl = options.vapidPublicKeyUrl ?? `${baseURL}/api/push/vapid-public-key`;
|
|
3546
|
-
const subscribeUrl = options.subscribeUrl ?? `${baseURL}/api/push/subscriptions`;
|
|
3547
|
-
const resolveVapidKey = useCallback2(async () => {
|
|
3548
|
-
if (options.vapidPublicKey !== void 0) return options.vapidPublicKey;
|
|
3549
|
-
try {
|
|
3550
|
-
const response = await fetch(vapidKeyUrl, { headers: authToken() ? { Authorization: `Bearer ${authToken()}` } : {} });
|
|
3551
|
-
if (!response.ok) return null;
|
|
3552
|
-
const payload = await response.json();
|
|
3553
|
-
const key = payload.data?.publicKey;
|
|
3554
|
-
return typeof key === "string" && key.length > 0 ? key : null;
|
|
3555
|
-
} catch {
|
|
3556
|
-
return null;
|
|
3557
|
-
}
|
|
3558
|
-
}, [options.vapidPublicKey, vapidKeyUrl]);
|
|
3559
|
-
const subscribe = useCallback2(async () => {
|
|
3560
|
-
if (!supported()) return;
|
|
3561
|
-
setBusy(true);
|
|
3562
|
-
try {
|
|
3563
|
-
const registration = await navigator.serviceWorker.ready;
|
|
3564
|
-
const vapidKey = await resolveVapidKey();
|
|
3565
|
-
if (vapidKey === null) return;
|
|
3566
|
-
const subscription = await registration.pushManager.subscribe({
|
|
3567
|
-
userVisibleOnly: true,
|
|
3568
|
-
applicationServerKey: urlBase64ToUint8Array(vapidKey)
|
|
3569
|
-
});
|
|
3570
|
-
const response = await fetch(subscribeUrl, {
|
|
3571
|
-
method: "POST",
|
|
3572
|
-
headers: { "Content-Type": "application/json", ...authToken() ? { Authorization: `Bearer ${authToken()}` } : {} },
|
|
3573
|
-
body: JSON.stringify(subscription.toJSON())
|
|
3574
|
-
});
|
|
3575
|
-
if (response.ok) setSubscribed(true);
|
|
3576
|
-
} finally {
|
|
3577
|
-
setBusy(false);
|
|
3578
|
-
}
|
|
3579
|
-
}, [resolveVapidKey, subscribeUrl]);
|
|
3580
|
-
const enable = useCallback2(async () => {
|
|
3581
|
-
if (!supported()) return;
|
|
3582
|
-
if (typeof userId !== "string") return;
|
|
3583
|
-
const result = await Notification.requestPermission();
|
|
3584
|
-
setPermission(result);
|
|
3585
|
-
if (result === "granted") await subscribe();
|
|
3586
|
-
}, [subscribe, userId]);
|
|
3587
|
-
const disable = useCallback2(async () => {
|
|
3588
|
-
if (!supported()) return;
|
|
3589
|
-
try {
|
|
3590
|
-
const registration = await navigator.serviceWorker.ready;
|
|
3591
|
-
const subscription = await registration.pushManager.getSubscription();
|
|
3592
|
-
if (subscription) {
|
|
3593
|
-
const endpoint = subscription.endpoint;
|
|
3594
|
-
await subscription.unsubscribe();
|
|
3595
|
-
await fetch(subscribeUrl, {
|
|
3596
|
-
method: "DELETE",
|
|
3597
|
-
headers: { "Content-Type": "application/json", ...authToken() ? { Authorization: `Bearer ${authToken()}` } : {} },
|
|
3598
|
-
body: JSON.stringify({ endpoint })
|
|
3599
|
-
});
|
|
3600
|
-
}
|
|
3601
|
-
setSubscribed(false);
|
|
3602
|
-
} catch {
|
|
3603
|
-
setSubscribed(false);
|
|
3604
|
-
}
|
|
3605
|
-
}, [subscribeUrl]);
|
|
3606
|
-
useEffect4(() => {
|
|
3607
|
-
if (options.autoEnable !== true || !supported() || autoPromptedRef.current) return;
|
|
3608
|
-
autoPromptedRef.current = true;
|
|
3609
|
-
if (Notification.permission === "granted") {
|
|
3610
|
-
void subscribe();
|
|
3611
|
-
return;
|
|
3612
|
-
}
|
|
3613
|
-
if (Notification.permission === "default" && typeof document !== "undefined") {
|
|
3614
|
-
const onFirstGesture = () => {
|
|
3615
|
-
document.removeEventListener("pointerdown", onFirstGesture);
|
|
3616
|
-
void enable();
|
|
3617
|
-
};
|
|
3618
|
-
document.addEventListener("pointerdown", onFirstGesture, { once: true });
|
|
3619
|
-
return () => document.removeEventListener("pointerdown", onFirstGesture);
|
|
3620
|
-
}
|
|
3621
|
-
}, [options.autoEnable, subscribe, enable]);
|
|
3622
|
-
return { supported: supported(), permission, subscribed, busy, enable, disable };
|
|
3623
|
-
}
|
|
3624
3518
|
export {
|
|
3625
3519
|
A2AKeyList,
|
|
3626
3520
|
AgentCardStats,
|