forked from CopilotKit/CopilotKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathregistry.ts
More file actions
133 lines (115 loc) · 3.11 KB
/
Copy pathregistry.ts
File metadata and controls
133 lines (115 loc) · 3.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
import registryData from "@/data/registry.json";
export interface Feature {
id: string;
name: string;
category: string;
description: string;
}
export interface FeatureCategory {
id: string;
name: string;
}
export interface Demo {
id: string;
name: string;
description: string;
tags: string[];
route?: string;
command?: string;
animated_preview_url?: string | null;
}
export interface Integration {
name: string;
slug: string;
category: string;
language: string;
logo?: string;
description: string;
partner_docs: string | null;
repo: string;
copilotkit_version: string;
backend_url: string;
deployed: boolean;
generative_ui?: string[];
interaction_modalities?: string[];
sort_order?: number;
managed_platform?: { name: string; url: string };
animated_preview_url?: string | null;
starter?: {
path: string;
name: string;
description?: string;
github_url?: string;
demo_url?: string;
clone_command?: string;
};
features: string[];
demos: Demo[];
}
export interface Registry {
feature_registry: {
version: string;
categories: FeatureCategory[];
features: Feature[];
};
integrations: Integration[];
}
const registry = registryData as Registry;
export function getRegistry(): Registry {
return registry;
}
export function getIntegrations(): Integration[] {
return registry.integrations;
}
export function getIntegration(slug: string): Integration | undefined {
return registry.integrations.find((i) => i.slug === slug);
}
export function getFeatures(): Feature[] {
return registry.feature_registry.features;
}
export function getFeature(id: string): Feature | undefined {
return registry.feature_registry.features.find((f) => f.id === id);
}
export function getFeatureCategories(): FeatureCategory[] {
return registry.feature_registry.categories;
}
export function getIntegrationsByCategory(): Record<string, Integration[]> {
const grouped: Record<string, Integration[]> = {};
for (const integration of registry.integrations) {
if (!grouped[integration.category]) {
grouped[integration.category] = [];
}
grouped[integration.category].push(integration);
}
return grouped;
}
export function getDemo(
integrationSlug: string,
demoId: string,
): { integration: Integration; demo: Demo } | undefined {
const integration = getIntegration(integrationSlug);
if (!integration) return undefined;
const demo = integration.demos.find((d) => d.id === demoId);
if (!demo) return undefined;
return { integration, demo };
}
const CATEGORY_LABELS: Record<string, string> = {
popular: "Most Popular",
"agent-framework": "Agent Frameworks",
"enterprise-platform": "Enterprise",
"provider-sdk": "Provider SDKs",
protocol: "Protocols & Standards",
emerging: "Emerging",
starter: "Getting Started",
};
export function getCategoryLabel(slug: string): string {
return CATEGORY_LABELS[slug] || slug;
}
const LANGUAGE_LABELS: Record<string, string> = {
python: "Python",
typescript: "TypeScript",
dotnet: ".NET",
};
export function getLanguageLabel(lang: string): string {
return LANGUAGE_LABELS[lang] || lang;
}