diff --git a/website/src/scripts/pages/agents.ts b/website/src/scripts/pages/agents.ts index fcc297c5..5fd6f71b 100644 --- a/website/src/scripts/pages/agents.ts +++ b/website/src/scripts/pages/agents.ts @@ -2,13 +2,11 @@ * Agents page functionality */ import { createChoices, getChoicesValues, type Choices } from '../choices'; -import { FuzzySearch } from '../search'; +import { FuzzySearch, SearchItem } from '../search'; import { fetchData, debounce, escapeHtml, getGitHubUrl, getInstallDropdownHtml, setupDropdownCloseHandlers, getActionButtonsHtml, setupActionHandlers } from '../utils'; import { setupModal, openFileModal } from '../modal'; -interface Agent { - title: string; - description?: string; +interface Agent extends SearchItem { path: string; model?: string; tools?: string[]; diff --git a/website/src/scripts/pages/collections.ts b/website/src/scripts/pages/collections.ts index 4c676859..3ad07f3d 100644 --- a/website/src/scripts/pages/collections.ts +++ b/website/src/scripts/pages/collections.ts @@ -2,15 +2,13 @@ * Collections page functionality */ import { createChoices, getChoicesValues, type Choices } from '../choices'; -import { FuzzySearch } from '../search'; +import { FuzzySearch, SearchItem } from '../search'; import { fetchData, debounce, escapeHtml, getGitHubUrl } from '../utils'; import { setupModal, openFileModal } from '../modal'; -interface Collection { +interface Collection extends SearchItem { id: string; name: string; - title: string; - description?: string; path: string; tags?: string[]; featured?: boolean; @@ -108,7 +106,7 @@ export async function initCollectionsPage(): Promise { allItems = data.items; // Map collection items to search items - const searchItems: SearchItem[] = allItems.map(item => ({ + const searchItems = allItems.map(item => ({ ...item, title: item.name, searchText: `${item.name} ${item.description} ${item.tags?.join(' ') || ''}`.toLowerCase() diff --git a/website/src/scripts/pages/instructions.ts b/website/src/scripts/pages/instructions.ts index 74513231..500e1757 100644 --- a/website/src/scripts/pages/instructions.ts +++ b/website/src/scripts/pages/instructions.ts @@ -2,13 +2,11 @@ * Instructions page functionality */ import { createChoices, getChoicesValues, type Choices } from '../choices'; -import { FuzzySearch } from '../search'; +import { FuzzySearch, SearchItem } from '../search'; import { fetchData, debounce, escapeHtml, getGitHubUrl, getInstallDropdownHtml, setupDropdownCloseHandlers, getActionButtonsHtml, setupActionHandlers } from '../utils'; import { setupModal, openFileModal } from '../modal'; -interface Instruction { - title: string; - description?: string; +interface Instruction extends SearchItem { path: string; applyTo?: string; extensions?: string[]; diff --git a/website/src/scripts/pages/prompts.ts b/website/src/scripts/pages/prompts.ts index bb711e7c..e660d727 100644 --- a/website/src/scripts/pages/prompts.ts +++ b/website/src/scripts/pages/prompts.ts @@ -2,13 +2,11 @@ * Prompts page functionality */ import { createChoices, getChoicesValues, type Choices } from '../choices'; -import { FuzzySearch } from '../search'; +import { FuzzySearch, SearchItem } from '../search'; import { fetchData, debounce, escapeHtml, getGitHubUrl, getInstallDropdownHtml, setupDropdownCloseHandlers, getActionButtonsHtml, setupActionHandlers } from '../utils'; import { setupModal, openFileModal } from '../modal'; -interface Prompt { - title: string; - description?: string; +interface Prompt extends SearchItem { path: string; tools?: string[]; } diff --git a/website/src/scripts/pages/skills.ts b/website/src/scripts/pages/skills.ts index 5ae556b5..ab0c8698 100644 --- a/website/src/scripts/pages/skills.ts +++ b/website/src/scripts/pages/skills.ts @@ -2,7 +2,7 @@ * Skills page functionality */ import { createChoices, getChoicesValues, type Choices } from '../choices'; -import { FuzzySearch } from '../search'; +import { FuzzySearch, SearchItem } from '../search'; import { fetchData, debounce, escapeHtml, getGitHubUrl, getRawGitHubUrl } from '../utils'; import { setupModal, openFileModal } from '../modal'; import JSZip from '../jszip'; @@ -12,10 +12,8 @@ interface SkillFile { path: string; } -interface Skill { +interface Skill extends SearchItem { id: string; - title: string; - description?: string; path: string; skillFile: string; category: string;