@tuturuuu/ui 0.3.1 → 0.3.2
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/CHANGELOG.md +7 -0
- package/package.json +6 -6
- package/src/components/ui/chat/chat-agent-details-operations-panel.test.tsx +396 -2
- package/src/components/ui/chat/chat-agent-details-operations-panel.tsx +36 -8
- package/src/components/ui/chat/chat-agent-details-setup-panel.tsx +14 -0
- package/src/components/ui/chat/chat-agent-details-sidebar.test.tsx +5 -0
- package/src/components/ui/chat/chat-agent-details-sidebar.tsx +21 -7
- package/src/components/ui/chat/chat-agent-details-utils.test.ts +73 -0
- package/src/components/ui/chat/chat-agent-details-utils.tsx +100 -26
- package/src/components/ui/chat/chat-agent-details-zalo-personal-panel.tsx +517 -0
- package/src/components/ui/chat/chat-workspace.tsx +31 -1
- package/src/components/ui/chat/hooks-messages.test.tsx +45 -1
- package/src/components/ui/chat/hooks-messages.ts +1 -1
- package/src/components/ui/chat/hooks-realtime.ts +13 -16
- package/src/hooks/use-semantic-task-search.ts +10 -33
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
import { useQuery } from '@tanstack/react-query';
|
|
2
|
+
import {
|
|
3
|
+
searchWorkspaceTasks,
|
|
4
|
+
type WorkspaceTaskSearchResult,
|
|
5
|
+
} from '@tuturuuu/internal-api/tasks';
|
|
2
6
|
|
|
3
|
-
|
|
4
|
-
id: string;
|
|
5
|
-
name: string;
|
|
6
|
-
description: string | null;
|
|
7
|
-
list_id: string;
|
|
8
|
-
start_date: string | null;
|
|
9
|
-
end_date: string | null;
|
|
10
|
-
completed: boolean;
|
|
11
|
-
archived: boolean;
|
|
12
|
-
similarity: number;
|
|
13
|
-
}
|
|
7
|
+
type SemanticSearchResult = WorkspaceTaskSearchResult;
|
|
14
8
|
|
|
15
9
|
interface UseSemanticTaskSearchOptions {
|
|
16
10
|
wsId: string;
|
|
@@ -41,28 +35,11 @@ export function useSemanticTaskSearch({
|
|
|
41
35
|
}
|
|
42
36
|
|
|
43
37
|
try {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
headers: {
|
|
50
|
-
'Content-Type': 'application/json',
|
|
51
|
-
},
|
|
52
|
-
body: JSON.stringify({
|
|
53
|
-
query: query.trim(),
|
|
54
|
-
matchThreshold,
|
|
55
|
-
matchCount,
|
|
56
|
-
}),
|
|
57
|
-
}
|
|
58
|
-
);
|
|
59
|
-
|
|
60
|
-
if (!response.ok) {
|
|
61
|
-
console.error('Semantic search failed:', await response.text());
|
|
62
|
-
return [];
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
const data = await response.json();
|
|
38
|
+
const data = await searchWorkspaceTasks(wsId, {
|
|
39
|
+
query: query.trim(),
|
|
40
|
+
matchThreshold,
|
|
41
|
+
matchCount,
|
|
42
|
+
});
|
|
66
43
|
return (data.tasks || []) as SemanticSearchResult[];
|
|
67
44
|
} catch (error) {
|
|
68
45
|
console.error('Error performing semantic search:', error);
|