Files
copilotkit__copilotkit/showcase/shell-docs/src/lib/setup-content.ts
2026-05-27 13:41:54 -07:00

32 lines
828 B
TypeScript

export interface SetupContentEntry {
framework: string;
concept: string;
source: string;
}
export interface SetupContentBundle {
version: 1;
concepts: Record<string, SetupContentEntry>;
}
export function setupContentKey(framework: string, concept: string): string {
return `${framework}::${concept}`;
}
const SETUP_CONTENT_FALLBACKS: Record<string, string[]> = {
"langgraph-fastapi": ["langgraph-python"],
};
export function resolveBundledSetupConcept(
framework: string,
concept: string,
bundle: SetupContentBundle,
): string | null {
const candidates = [framework, ...(SETUP_CONTENT_FALLBACKS[framework] ?? [])];
for (const candidate of candidates) {
const source = bundle.concepts[setupContentKey(candidate, concept)]?.source;
if (source !== undefined) return source;
}
return null;
}