()
| 30 | * examples fetched from the registry. Offline / unreachable → bundled only. |
| 31 | */ |
| 32 | export async function resolveTemplateList(): Promise<TemplateOption[]> { |
| 33 | const bundled = [...BUNDLED_TEMPLATES]; |
| 34 | const bundledIds = new Set(bundled.map((t) => t.id)); |
| 35 | |
| 36 | const entries = await listRegistryItems({ type: "hyperframes:example" }); |
| 37 | const items = await loadAllItems(entries); |
| 38 | |
| 39 | const remoteOptions: TemplateOption[] = items |
| 40 | .filter((item) => !bundledIds.has(item.name)) |
| 41 | .map((item) => ({ |
| 42 | id: item.name, |
| 43 | label: item.title, |
| 44 | hint: item.description, |
| 45 | source: "remote" as const, |
| 46 | })); |
| 47 | |
| 48 | return [...bundled, ...remoteOptions]; |
| 49 | } |
no test coverage detected