feat(chat): unify resource chips and browse recent files in @ mention

Add recent=true to knowledge search so the mention picker can list recent
files without a keyword, and consolidate KB/FAQ/file chip styling across
chat input and message history.
This commit is contained in:
wizardchen
2026-06-24 20:30:56 +08:00
committed by lyingbug
parent babe3f2315
commit 122408b283
8 changed files with 194 additions and 224 deletions
+5 -2
View File
@@ -458,16 +458,19 @@ export function searchKnowledge(
offset = 0,
limit = 20,
fileTypes?: string[],
options?: { agent_id?: string }
options?: { agent_id?: string; recent?: boolean }
) {
const query = new URLSearchParams();
query.set('keyword', keyword);
if (keyword) {
query.set('keyword', keyword);
}
query.set('offset', String(offset));
query.set('limit', String(limit));
if (fileTypes && fileTypes.length > 0) {
query.set('file_types', fileTypes.join(','));
}
if (options?.agent_id) query.set('agent_id', options.agent_id);
if (options?.recent) query.set('recent', 'true');
return get(`/api/v1/knowledge/search?${query.toString()}`);
}