@athenaintel/react 0.10.7 → 0.10.8
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 +6 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +6 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -498,7 +498,9 @@ export declare interface AthenaThreadManagerState {
|
|
|
498
498
|
/** The backend thread ID of the currently active thread, or null if not yet synced. */
|
|
499
499
|
activeThreadId: string | null;
|
|
500
500
|
/** Whether the thread list is still loading from the backend. */
|
|
501
|
-
|
|
501
|
+
isListLoading: boolean;
|
|
502
|
+
/** Whether the current thread is loading its message history (e.g. after a thread switch). */
|
|
503
|
+
isThreadLoading: boolean;
|
|
502
504
|
/** Switch the chat to a different thread by its backend thread ID. */
|
|
503
505
|
switchToThread: (threadId: string) => Promise<void>;
|
|
504
506
|
/** Create and switch to a new empty thread. */
|
package/dist/index.js
CHANGED
|
@@ -66592,7 +66592,8 @@ function useAthenaThreadManager() {
|
|
|
66592
66592
|
var _a2;
|
|
66593
66593
|
return (_a2 = s.metadata) == null ? void 0 : _a2.remoteId;
|
|
66594
66594
|
} });
|
|
66595
|
-
const
|
|
66595
|
+
const isThreadLoading = useThread({ optional: true, selector: (s) => s.isLoading }) ?? false;
|
|
66596
|
+
const isListLoading = useThreadList({ optional: true, selector: (s) => s.isLoading });
|
|
66596
66597
|
const runtimeRef = useRef(runtime);
|
|
66597
66598
|
runtimeRef.current = runtime;
|
|
66598
66599
|
const switchToThread = useCallback(
|
|
@@ -66605,16 +66606,17 @@ function useAthenaThreadManager() {
|
|
|
66605
66606
|
);
|
|
66606
66607
|
const activeThreadId = remoteId ?? null;
|
|
66607
66608
|
return useMemo(() => {
|
|
66608
|
-
if (!runtime ||
|
|
66609
|
+
if (!runtime || isListLoading == null) {
|
|
66609
66610
|
return null;
|
|
66610
66611
|
}
|
|
66611
66612
|
return {
|
|
66612
66613
|
activeThreadId,
|
|
66613
|
-
|
|
66614
|
+
isListLoading,
|
|
66615
|
+
isThreadLoading,
|
|
66614
66616
|
switchToThread,
|
|
66615
66617
|
switchToNewThread
|
|
66616
66618
|
};
|
|
66617
|
-
}, [runtime, activeThreadId,
|
|
66619
|
+
}, [runtime, activeThreadId, isListLoading, isThreadLoading, switchToThread, switchToNewThread]);
|
|
66618
66620
|
}
|
|
66619
66621
|
function useAppendToComposer() {
|
|
66620
66622
|
const aui = useAui();
|