@athenaintel/react 0.9.3 → 0.9.5
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/index.cjs +16 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +16 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -20687,7 +20687,11 @@ async function listThreads(backendUrl, auth, opts = {}) {
|
|
|
20687
20687
|
const res = await fetch(`${base2}/api/conversations/threads/list`, {
|
|
20688
20688
|
method: "POST",
|
|
20689
20689
|
headers: { "Content-Type": "application/json", ...getAuthHeaders(auth) },
|
|
20690
|
-
body: JSON.stringify({
|
|
20690
|
+
body: JSON.stringify({
|
|
20691
|
+
limit: opts.limit ?? 50,
|
|
20692
|
+
offset: opts.offset ?? 0,
|
|
20693
|
+
exclude_triggered: opts.exclude_triggered ?? true
|
|
20694
|
+
})
|
|
20691
20695
|
});
|
|
20692
20696
|
if (!res.ok) {
|
|
20693
20697
|
throw new Error(`[AthenaSDK] Failed to list threads: ${res.status}`);
|
|
@@ -24314,7 +24318,7 @@ function useAthenaThreadListAdapter(config2) {
|
|
|
24314
24318
|
);
|
|
24315
24319
|
return React.useMemo(() => ({
|
|
24316
24320
|
async list() {
|
|
24317
|
-
if (!auth.token) {
|
|
24321
|
+
if (!auth.token && !auth.apiKey) {
|
|
24318
24322
|
return { threads: [] };
|
|
24319
24323
|
}
|
|
24320
24324
|
try {
|
|
@@ -24656,6 +24660,16 @@ function AthenaWithThreadList({
|
|
|
24656
24660
|
core.__internal_load();
|
|
24657
24661
|
}
|
|
24658
24662
|
}, [runtime]);
|
|
24663
|
+
const previousAuthRefreshKeyRef = React.useRef(null);
|
|
24664
|
+
const authRefreshKey = `${backendUrl}::${apiKey ?? ""}::${token ?? ""}`;
|
|
24665
|
+
React.useEffect(() => {
|
|
24666
|
+
const previousAuthRefreshKey = previousAuthRefreshKeyRef.current;
|
|
24667
|
+
previousAuthRefreshKeyRef.current = authRefreshKey;
|
|
24668
|
+
if (previousAuthRefreshKey === null || previousAuthRefreshKey === authRefreshKey) {
|
|
24669
|
+
return;
|
|
24670
|
+
}
|
|
24671
|
+
handleRefresh();
|
|
24672
|
+
}, [authRefreshKey, handleRefresh]);
|
|
24659
24673
|
const auiTools = React.useMemo(() => Tools({ toolkit: frontendTools }), [frontendTools]);
|
|
24660
24674
|
const aui = useAui({ tools: auiTools });
|
|
24661
24675
|
const athenaConfig = React.useMemo(
|