16 lines
684 B
JavaScript
16 lines
684 B
JavaScript
export const catalog = [
|
|
{ id: 'agent-loop', title: '工具执行循环', status: 'in_progress', tags: ['agent', 'tools'] },
|
|
{ id: 'session-recovery', title: '会话恢复', status: 'planned', tags: ['session', 'recovery'] },
|
|
{ id: 'change-review', title: '改动审查', status: 'done', tags: ['editor', 'diff'] },
|
|
];
|
|
|
|
export function searchCatalog(query) {
|
|
const normalized = query.trim().toLocaleLowerCase();
|
|
const keywords = normalized ? normalized.split(/\s+/) : [];
|
|
|
|
return catalog.filter(item => {
|
|
const searchableText = `${item.title} ${item.tags.join(' ')}`.toLocaleLowerCase();
|
|
return keywords.every(keyword => searchableText.includes(keyword));
|
|
});
|
|
}
|