Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Fetch any URL via Chrome CDP and convert the rendered page to clean markdown with YouTube transcript support.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
scripts/lib/adapters/index.ts
1import type { Adapter, AdapterInput } from "./types";2import { genericAdapter } from "./generic";3import { hnAdapter } from "./hn";4import { xAdapter } from "./x";5import { youtubeAdapter } from "./youtube";67const adapters: Adapter[] = [xAdapter, youtubeAdapter, hnAdapter, genericAdapter];89export function listAdapters(): Adapter[] {10return adapters;11}1213export function resolveAdapter(input: AdapterInput, forcedName?: string): Adapter {14if (forcedName) {15const forced = adapters.find((adapter) => adapter.name === forcedName);16if (!forced) {17throw new Error(`Unknown adapter: ${forcedName}`);18}19return forced;20}2122const matched = adapters.find((adapter) => adapter.match(input));23if (!matched) {24throw new Error("No adapter matched the URL");25}26return matched;27}2829export { genericAdapter };30