feat(core): add basic ui for doc search related tool calling (#13176)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Introduced support for document semantic search, keyword search, and
document reading tools in chat AI features.
* Added new interactive cards to display results for document keyword
search, semantic search, and reading operations within chat.
* Automatically restores and displays pinned chat sessions when
revisiting the workspace chat page.

* **Improvements**
* Enhanced the chat interface with new components for richer
document-related AI responses.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Cats Juice
2025-07-12 10:17:37 +08:00
committed by GitHub
parent 0d414d914a
commit 3dbdb99435
7 changed files with 309 additions and 1 deletions
@@ -306,6 +306,38 @@ export const Component = () => {
return () => sub.unsubscribe();
}, [framework, mockStd]);
// restore pinned session
useEffect(() => {
if (!chatContent) return;
const controller = new AbortController();
const signal = controller.signal;
client
.getSessions(
workspaceId,
{},
undefined,
{ pinned: true, limit: 1 },
signal
)
.then(sessions => {
if (!Array.isArray(sessions)) return;
const session = sessions[0];
if (!session) return;
setCurrentSession(session);
if (chatContent) {
chatContent.session = session;
chatContent.reloadSession();
}
})
.catch(console.error);
// abort the request
return () => {
controller.abort();
};
}, [chatContent, client, workspaceId]);
const onChatContainerRef = useCallback((node: HTMLDivElement) => {
if (node) {
setIsBodyProvided(true);