@athenaintel/react 0.10.6 → 0.10.7
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 +7 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -4
- package/dist/index.js +7 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -495,13 +495,11 @@ export declare interface AthenaTheme {
|
|
|
495
495
|
* Must be used inside `<AthenaProvider enableThreadList>`.
|
|
496
496
|
*/
|
|
497
497
|
export declare interface AthenaThreadManagerState {
|
|
498
|
-
/** The ID of the currently active thread, or null if not yet
|
|
498
|
+
/** The backend thread ID of the currently active thread, or null if not yet synced. */
|
|
499
499
|
activeThreadId: string | null;
|
|
500
|
-
/** All available (non-archived) thread IDs, sorted by most recent. */
|
|
501
|
-
threadIds: readonly string[];
|
|
502
500
|
/** Whether the thread list is still loading from the backend. */
|
|
503
501
|
isLoading: boolean;
|
|
504
|
-
/** Switch the chat to a different thread by ID. */
|
|
502
|
+
/** Switch the chat to a different thread by its backend thread ID. */
|
|
505
503
|
switchToThread: (threadId: string) => Promise<void>;
|
|
506
504
|
/** Create and switch to a new empty thread. */
|
|
507
505
|
switchToNewThread: () => Promise<void>;
|
package/dist/index.js
CHANGED
|
@@ -66588,8 +66588,10 @@ function ThreadListItem() {
|
|
|
66588
66588
|
}
|
|
66589
66589
|
function useAthenaThreadManager() {
|
|
66590
66590
|
const runtime = useAssistantRuntime({ optional: true });
|
|
66591
|
-
const
|
|
66592
|
-
|
|
66591
|
+
const remoteId = useThread({ optional: true, selector: (s) => {
|
|
66592
|
+
var _a2;
|
|
66593
|
+
return (_a2 = s.metadata) == null ? void 0 : _a2.remoteId;
|
|
66594
|
+
} });
|
|
66593
66595
|
const isLoading = useThreadList({ optional: true, selector: (s) => s.isLoading });
|
|
66594
66596
|
const runtimeRef = useRef(runtime);
|
|
66595
66597
|
runtimeRef.current = runtime;
|
|
@@ -66601,19 +66603,18 @@ function useAthenaThreadManager() {
|
|
|
66601
66603
|
() => runtimeRef.current.threads.switchToNewThread(),
|
|
66602
66604
|
[]
|
|
66603
66605
|
);
|
|
66604
|
-
const activeThreadId =
|
|
66606
|
+
const activeThreadId = remoteId ?? null;
|
|
66605
66607
|
return useMemo(() => {
|
|
66606
|
-
if (!runtime ||
|
|
66608
|
+
if (!runtime || isLoading == null) {
|
|
66607
66609
|
return null;
|
|
66608
66610
|
}
|
|
66609
66611
|
return {
|
|
66610
66612
|
activeThreadId,
|
|
66611
|
-
threadIds,
|
|
66612
66613
|
isLoading,
|
|
66613
66614
|
switchToThread,
|
|
66614
66615
|
switchToNewThread
|
|
66615
66616
|
};
|
|
66616
|
-
}, [runtime, activeThreadId,
|
|
66617
|
+
}, [runtime, activeThreadId, isLoading, switchToThread, switchToNewThread]);
|
|
66617
66618
|
}
|
|
66618
66619
|
function useAppendToComposer() {
|
|
66619
66620
|
const aui = useAui();
|