@datalayer/agent-runtimes 0.0.8 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (275) hide show
  1. package/README.md +2 -1
  2. package/lib/{examples/components → components}/AgentConfiguration.d.ts +27 -12
  3. package/lib/{examples/components → components}/AgentConfiguration.js +170 -22
  4. package/lib/{examples/components → components}/FooterMetrics.d.ts +1 -2
  5. package/lib/{examples/components → components}/Header.d.ts +1 -6
  6. package/lib/{examples/components → components}/Header.js +5 -39
  7. package/lib/{examples/components → components}/HeaderControls.d.ts +1 -2
  8. package/lib/{examples/components → components}/HeaderControls.js +1 -1
  9. package/lib/{examples/components → components}/LexicalEditor.d.ts +2 -3
  10. package/lib/{examples/components → components}/LexicalEditor.js +2 -2
  11. package/lib/components/MainContent.d.ts +34 -0
  12. package/lib/{examples/components → components}/MainContent.js +18 -9
  13. package/lib/components/McpServerManager.d.ts +30 -0
  14. package/lib/components/McpServerManager.js +331 -0
  15. package/lib/{examples/components → components}/MockFileBrowser.d.ts +1 -2
  16. package/lib/{examples/components → components}/SessionTabs.d.ts +2 -3
  17. package/lib/{examples/components → components}/TimeTravel.d.ts +1 -2
  18. package/lib/components/chat/components/AgentDetails.d.ts +3 -1
  19. package/lib/components/chat/components/AgentDetails.js +323 -31
  20. package/lib/components/chat/components/Chat.d.ts +37 -3
  21. package/lib/components/chat/components/Chat.js +29 -10
  22. package/lib/components/chat/components/ChatFloating.d.ts +27 -2
  23. package/lib/components/chat/components/ChatFloating.js +17 -10
  24. package/lib/components/chat/components/ChatPopupStandalone.js +1 -1
  25. package/lib/components/chat/components/ChatSidebar.d.ts +1 -1
  26. package/lib/components/chat/components/ChatStandalone.d.ts +1 -1
  27. package/lib/components/chat/components/ChatStandalone.js +1 -1
  28. package/lib/components/chat/components/ContextDistribution.d.ts +70 -6
  29. package/lib/components/chat/components/ContextDistribution.js +11 -4
  30. package/lib/components/chat/components/ContextInspector.d.ts +81 -0
  31. package/lib/components/chat/components/ContextInspector.js +261 -0
  32. package/lib/components/chat/components/ContextPanel.d.ts +112 -0
  33. package/lib/components/chat/components/ContextPanel.js +373 -0
  34. package/lib/components/chat/components/base/ChatBase.d.ts +74 -19
  35. package/lib/components/chat/components/base/ChatBase.js +296 -37
  36. package/lib/components/chat/components/index.d.ts +3 -1
  37. package/lib/components/chat/components/index.js +2 -0
  38. package/lib/components/chat/extensions/ExtensionRegistry.d.ts +1 -1
  39. package/lib/components/chat/extensions/index.d.ts +1 -0
  40. package/lib/components/chat/index.d.ts +3 -3
  41. package/lib/components/chat/protocols/AGUIAdapter.js +24 -4
  42. package/lib/components/chat/protocols/VercelAIAdapter.js +35 -1
  43. package/lib/components/chat/store/chatStore.d.ts +2 -3
  44. package/lib/components/chat/store/conversationStore.d.ts +83 -0
  45. package/lib/components/chat/store/conversationStore.js +174 -0
  46. package/lib/components/chat/store/index.d.ts +2 -1
  47. package/lib/components/chat/store/index.js +1 -0
  48. package/lib/components/chat/types/inference.d.ts +17 -0
  49. package/lib/components/chat/types/protocol.d.ts +10 -0
  50. package/lib/components/index.d.ts +23 -0
  51. package/lib/components/index.js +11 -0
  52. package/lib/config/agents.d.ts +33 -0
  53. package/lib/config/agents.js +424 -0
  54. package/lib/config/index.d.ts +4 -0
  55. package/lib/config/index.js +8 -0
  56. package/lib/config/mcpServers.d.ts +18 -0
  57. package/lib/config/mcpServers.js +129 -0
  58. package/lib/config/skills.d.ts +25 -0
  59. package/lib/config/skills.js +54 -0
  60. package/lib/{lib → config}/utils.d.ts +1 -1
  61. package/lib/{lib → config}/utils.js +2 -2
  62. package/lib/examples/AgentRuntimeLexical2Example.d.ts +1 -0
  63. package/lib/examples/AgentRuntimeLexical2Example.js +3 -2
  64. package/lib/examples/AgentRuntimeLexicalExample.d.ts +1 -0
  65. package/lib/examples/AgentRuntimeLexicalExample.js +5 -3
  66. package/lib/examples/AgentRuntimeLexicalSidebarExample.d.ts +1 -0
  67. package/lib/examples/AgentRuntimeLexicalSidebarExample.js +3 -3
  68. package/lib/examples/AgentRuntimeNotebookExample.js +1 -1
  69. package/lib/examples/AgentSpaceFormExample.d.ts +2 -2
  70. package/lib/examples/AgentSpaceFormExample.js +167 -29
  71. package/lib/examples/CopilotKitLexicalExample.d.ts +1 -0
  72. package/lib/examples/CopilotKitLexicalExample.js +3 -2
  73. package/lib/examples/index.d.ts +1 -0
  74. package/lib/examples/stores/notebooks/NotebookExample2.ipynb.json +43 -43
  75. package/lib/hooks/useAGUI.d.ts +1 -1
  76. package/lib/hooks/useAGUI.js +1 -1
  77. package/lib/identity/types.d.ts +1 -1
  78. package/lib/index.d.ts +2 -0
  79. package/lib/index.js +1 -0
  80. package/lib/runtime/index.d.ts +3 -0
  81. package/lib/runtime/runtimeStore.d.ts +3 -4
  82. package/lib/runtime/useAgentConnection.d.ts +2 -3
  83. package/lib/runtime/useAgentRuntime.d.ts +2 -3
  84. package/lib/stories/Cell.stories.js +1 -1
  85. package/lib/tools/adapters/agent-runtimes/notebookHooks.js +1 -0
  86. package/lib/tools/adapters/copilotkit/notebookHooks.js +1 -0
  87. package/lib/types.d.ts +150 -0
  88. package/package.json +4 -5
  89. package/scripts/apply-patches.sh +32 -0
  90. package/scripts/codegen/generate_agents.py +452 -0
  91. package/scripts/codegen/generate_mcp_servers.py +424 -0
  92. package/scripts/codegen/generate_skills.py +321 -0
  93. package/scripts/download-ai-elements.py +35 -20
  94. package/scripts/sync-jupyter.sh +6 -0
  95. package/lib/components/ui/accordion.d.ts +0 -7
  96. package/lib/components/ui/accordion.js +0 -22
  97. package/lib/components/ui/alert-dialog.d.ts +0 -14
  98. package/lib/components/ui/alert-dialog.js +0 -43
  99. package/lib/components/ui/alert.d.ts +0 -9
  100. package/lib/components/ui/alert.js +0 -24
  101. package/lib/components/ui/aspect-ratio.d.ts +0 -3
  102. package/lib/components/ui/aspect-ratio.js +0 -11
  103. package/lib/components/ui/avatar.d.ts +0 -6
  104. package/lib/components/ui/avatar.js +0 -18
  105. package/lib/components/ui/badge.d.ts +0 -9
  106. package/lib/components/ui/badge.js +0 -22
  107. package/lib/components/ui/breadcrumb.d.ts +0 -11
  108. package/lib/components/ui/breadcrumb.js +0 -27
  109. package/lib/components/ui/button-group.d.ts +0 -11
  110. package/lib/components/ui/button-group.js +0 -31
  111. package/lib/components/ui/button.d.ts +0 -13
  112. package/lib/components/ui/button.js +0 -39
  113. package/lib/components/ui/calendar.d.ts +0 -8
  114. package/lib/components/ui/calendar.js +0 -80
  115. package/lib/components/ui/card.d.ts +0 -9
  116. package/lib/components/ui/card.js +0 -24
  117. package/lib/components/ui/carousel.d.ts +0 -19
  118. package/lib/components/ui/carousel.js +0 -95
  119. package/lib/components/ui/chart.d.ts +0 -53
  120. package/lib/components/ui/chart.js +0 -136
  121. package/lib/components/ui/checkbox.d.ts +0 -4
  122. package/lib/components/ui/checkbox.js +0 -13
  123. package/lib/components/ui/collapsible.d.ts +0 -5
  124. package/lib/components/ui/collapsible.js +0 -17
  125. package/lib/components/ui/command.d.ts +0 -18
  126. package/lib/components/ui/command.js +0 -38
  127. package/lib/components/ui/context-menu.d.ts +0 -25
  128. package/lib/components/ui/context-menu.js +0 -55
  129. package/lib/components/ui/dialog.d.ts +0 -15
  130. package/lib/components/ui/dialog.js +0 -40
  131. package/lib/components/ui/drawer.d.ts +0 -13
  132. package/lib/components/ui/drawer.js +0 -39
  133. package/lib/components/ui/dropdown-menu.d.ts +0 -25
  134. package/lib/components/ui/dropdown-menu.js +0 -55
  135. package/lib/components/ui/empty.d.ts +0 -11
  136. package/lib/components/ui/empty.js +0 -37
  137. package/lib/components/ui/field.d.ts +0 -24
  138. package/lib/components/ui/field.js +0 -80
  139. package/lib/components/ui/form.d.ts +0 -24
  140. package/lib/components/ui/form.js +0 -63
  141. package/lib/components/ui/hover-card.d.ts +0 -6
  142. package/lib/components/ui/hover-card.js +0 -18
  143. package/lib/components/ui/input-group.d.ts +0 -19
  144. package/lib/components/ui/input-group.js +0 -69
  145. package/lib/components/ui/input-otp.d.ts +0 -11
  146. package/lib/components/ui/input-otp.js +0 -25
  147. package/lib/components/ui/input.d.ts +0 -3
  148. package/lib/components/ui/input.js +0 -6
  149. package/lib/components/ui/item.d.ts +0 -23
  150. package/lib/components/ui/item.js +0 -66
  151. package/lib/components/ui/kbd.d.ts +0 -3
  152. package/lib/components/ui/kbd.js +0 -13
  153. package/lib/components/ui/label.d.ts +0 -4
  154. package/lib/components/ui/label.js +0 -12
  155. package/lib/components/ui/menubar.d.ts +0 -26
  156. package/lib/components/ui/menubar.js +0 -58
  157. package/lib/components/ui/navigation-menu.d.ts +0 -14
  158. package/lib/components/ui/navigation-menu.js +0 -31
  159. package/lib/components/ui/pagination.d.ts +0 -13
  160. package/lib/components/ui/pagination.js +0 -29
  161. package/lib/components/ui/popover.d.ts +0 -7
  162. package/lib/components/ui/popover.js +0 -21
  163. package/lib/components/ui/progress.d.ts +0 -4
  164. package/lib/components/ui/progress.js +0 -12
  165. package/lib/components/ui/radio-group.d.ts +0 -5
  166. package/lib/components/ui/radio-group.js +0 -16
  167. package/lib/components/ui/resizable.d.ts +0 -8
  168. package/lib/components/ui/resizable.js +0 -19
  169. package/lib/components/ui/scroll-area.d.ts +0 -5
  170. package/lib/components/ui/scroll-area.js +0 -17
  171. package/lib/components/ui/select.d.ts +0 -15
  172. package/lib/components/ui/select.js +0 -42
  173. package/lib/components/ui/separator.d.ts +0 -4
  174. package/lib/components/ui/separator.js +0 -12
  175. package/lib/components/ui/sheet.d.ts +0 -13
  176. package/lib/components/ui/sheet.js +0 -44
  177. package/lib/components/ui/sidebar.d.ts +0 -69
  178. package/lib/components/ui/sidebar.js +0 -216
  179. package/lib/components/ui/skeleton.d.ts +0 -2
  180. package/lib/components/ui/skeleton.js +0 -10
  181. package/lib/components/ui/slider.d.ts +0 -4
  182. package/lib/components/ui/slider.js +0 -18
  183. package/lib/components/ui/sonner.d.ts +0 -3
  184. package/lib/components/ui/sonner.js +0 -25
  185. package/lib/components/ui/spinner.d.ts +0 -2
  186. package/lib/components/ui/spinner.js +0 -11
  187. package/lib/components/ui/switch.d.ts +0 -4
  188. package/lib/components/ui/switch.js +0 -12
  189. package/lib/components/ui/table.d.ts +0 -10
  190. package/lib/components/ui/table.js +0 -32
  191. package/lib/components/ui/tabs.d.ts +0 -7
  192. package/lib/components/ui/tabs.js +0 -21
  193. package/lib/components/ui/textarea.d.ts +0 -3
  194. package/lib/components/ui/textarea.js +0 -6
  195. package/lib/components/ui/toast.d.ts +0 -15
  196. package/lib/components/ui/toast.js +0 -38
  197. package/lib/components/ui/toaster.d.ts +0 -1
  198. package/lib/components/ui/toaster.js +0 -14
  199. package/lib/components/ui/toggle-group.d.ts +0 -9
  200. package/lib/components/ui/toggle-group.js +0 -26
  201. package/lib/components/ui/toggle.d.ts +0 -9
  202. package/lib/components/ui/toggle.js +0 -30
  203. package/lib/components/ui/tooltip.d.ts +0 -7
  204. package/lib/components/ui/tooltip.js +0 -21
  205. package/lib/components/vercel-ai-elements/artifact.d.ts +0 -23
  206. package/lib/components/vercel-ai-elements/artifact.js +0 -24
  207. package/lib/components/vercel-ai-elements/code-block.d.ts +0 -17
  208. package/lib/components/vercel-ai-elements/code-block.js +0 -94
  209. package/lib/components/vercel-ai-elements/conversation.d.ts +0 -15
  210. package/lib/components/vercel-ai-elements/conversation.js +0 -21
  211. package/lib/components/vercel-ai-elements/loader.d.ts +0 -5
  212. package/lib/components/vercel-ai-elements/loader.js +0 -8
  213. package/lib/components/vercel-ai-elements/message.d.ts +0 -46
  214. package/lib/components/vercel-ai-elements/message.js +0 -109
  215. package/lib/components/vercel-ai-elements/model-selector.d.ts +0 -35
  216. package/lib/components/vercel-ai-elements/model-selector.js +0 -22
  217. package/lib/components/vercel-ai-elements/prompt-input.d.ts +0 -195
  218. package/lib/components/vercel-ai-elements/prompt-input.js +0 -589
  219. package/lib/components/vercel-ai-elements/reasoning.d.ts +0 -26
  220. package/lib/components/vercel-ai-elements/reasoning.js +0 -80
  221. package/lib/components/vercel-ai-elements/shimmer.d.ts +0 -9
  222. package/lib/components/vercel-ai-elements/shimmer.js +0 -22
  223. package/lib/components/vercel-ai-elements/sources.d.ts +0 -12
  224. package/lib/components/vercel-ai-elements/sources.js +0 -13
  225. package/lib/components/vercel-ai-elements/suggestion.d.ts +0 -10
  226. package/lib/components/vercel-ai-elements/suggestion.js +0 -16
  227. package/lib/components/vercel-ai-elements/tool.d.ts +0 -23
  228. package/lib/components/vercel-ai-elements/tool.js +0 -52
  229. package/lib/examples/components/MainContent.d.ts +0 -19
  230. package/lib/examples/components/index.d.ts +0 -10
  231. package/lib/examples/components/index.js +0 -13
  232. package/lib/examples/vercel-ai-elements/VercelAiElementsShowcase.d.ts +0 -12
  233. package/lib/examples/vercel-ai-elements/VercelAiElementsShowcase.js +0 -69
  234. package/lib/examples/vercel-ai-elements/components/ArtifactShowcase.d.ts +0 -1
  235. package/lib/examples/vercel-ai-elements/components/ArtifactShowcase.js +0 -85
  236. package/lib/examples/vercel-ai-elements/components/CodeBlockShowcase.d.ts +0 -1
  237. package/lib/examples/vercel-ai-elements/components/CodeBlockShowcase.js +0 -62
  238. package/lib/examples/vercel-ai-elements/components/ConversationShowcase.d.ts +0 -1
  239. package/lib/examples/vercel-ai-elements/components/ConversationShowcase.js +0 -51
  240. package/lib/examples/vercel-ai-elements/components/LoaderShowcase.d.ts +0 -1
  241. package/lib/examples/vercel-ai-elements/components/LoaderShowcase.js +0 -9
  242. package/lib/examples/vercel-ai-elements/components/MessageShowcase.d.ts +0 -1
  243. package/lib/examples/vercel-ai-elements/components/MessageShowcase.js +0 -56
  244. package/lib/examples/vercel-ai-elements/components/ModelSelectorShowcase.d.ts +0 -1
  245. package/lib/examples/vercel-ai-elements/components/ModelSelectorShowcase.js +0 -50
  246. package/lib/examples/vercel-ai-elements/components/PromptInputShowcase.d.ts +0 -1
  247. package/lib/examples/vercel-ai-elements/components/PromptInputShowcase.js +0 -16
  248. package/lib/examples/vercel-ai-elements/components/ReasoningShowcase.d.ts +0 -1
  249. package/lib/examples/vercel-ai-elements/components/ReasoningShowcase.js +0 -72
  250. package/lib/examples/vercel-ai-elements/components/ShimmerShowcase.d.ts +0 -1
  251. package/lib/examples/vercel-ai-elements/components/ShimmerShowcase.js +0 -9
  252. package/lib/examples/vercel-ai-elements/components/SourcesShowcase.d.ts +0 -1
  253. package/lib/examples/vercel-ai-elements/components/SourcesShowcase.js +0 -43
  254. package/lib/examples/vercel-ai-elements/components/SuggestionShowcase.d.ts +0 -1
  255. package/lib/examples/vercel-ai-elements/components/SuggestionShowcase.js +0 -31
  256. package/lib/examples/vercel-ai-elements/components/ToolShowcase.d.ts +0 -1
  257. package/lib/examples/vercel-ai-elements/components/ToolShowcase.js +0 -54
  258. package/lib/examples/vercel-ai-elements/index.d.ts +0 -13
  259. package/lib/examples/vercel-ai-elements/index.js +0 -17
  260. package/lib/examples/vercel-ai-elements/main.d.ts +0 -1
  261. package/lib/examples/vercel-ai-elements/main.js +0 -9
  262. package/lib/examples/vercel-ai-elements/showcase.css +0 -128
  263. package/lib/hooks/useToast.d.ts +0 -44
  264. package/lib/hooks/useToast.js +0 -128
  265. package/patches/@datalayer+jupyter-lexical+1.0.8.patch +0 -11628
  266. package/patches/@datalayer+jupyter-react+2.0.2.patch +0 -5338
  267. package/style/showcase-vercel-ai.css +0 -137
  268. /package/lib/{examples/components → components}/FooterMetrics.js +0 -0
  269. /package/lib/{examples/components → components}/MockFileBrowser.js +0 -0
  270. /package/lib/{examples/components → components}/SessionTabs.js +0 -0
  271. /package/lib/{examples/components → components}/TimeTravel.js +0 -0
  272. /package/lib/{models → types}/AIAgent.d.ts +0 -0
  273. /package/lib/{models → types}/AIAgent.js +0 -0
  274. /package/lib/{models → types}/index.d.ts +0 -0
  275. /package/lib/{models → types}/index.js +0 -0
@@ -0,0 +1,321 @@
1
+ #!/usr/bin/env python3
2
+ # Copyright (c) 2025-2026 Datalayer, Inc.
3
+ # Distributed under the terms of the Modified BSD License.
4
+
5
+ """
6
+ Generate Python and TypeScript code from YAML skill specifications.
7
+
8
+ Usage:
9
+ python generate_skills.py \\
10
+ --specs-dir specs/skills \\
11
+ --python-output agent_runtimes/config/skills.py \\
12
+ --typescript-output src/config/skills.ts
13
+ """
14
+
15
+ import argparse
16
+ import sys
17
+ from pathlib import Path
18
+ from typing import Any
19
+
20
+ import yaml
21
+
22
+
23
+ def _fmt_list(items: list[str]) -> str:
24
+ """Format a list of strings with double quotes for ruff compliance."""
25
+ if not items:
26
+ return "[]"
27
+ return "[" + ", ".join(f'"{item}"' for item in items) + "]"
28
+
29
+
30
+ def load_skill_specs(specs_dir: Path) -> list[dict[str, Any]]:
31
+ """Load all skill YAML specifications from a directory."""
32
+ specs = []
33
+ for yaml_file in sorted(specs_dir.glob("*.yaml")):
34
+ with open(yaml_file) as f:
35
+ spec = yaml.safe_load(f)
36
+ specs.append(spec)
37
+ return specs
38
+
39
+
40
+ def generate_python_code(specs: list[dict[str, Any]]) -> str:
41
+ """Generate Python code from skill specifications."""
42
+ lines = [
43
+ "# Copyright (c) 2025-2026 Datalayer, Inc.",
44
+ "# Distributed under the terms of the Modified BSD License.",
45
+ '"""',
46
+ "Skill Catalog.",
47
+ "",
48
+ "Predefined skill configurations that can be used by agents.",
49
+ "",
50
+ "This file is AUTO-GENERATED from YAML specifications.",
51
+ "DO NOT EDIT MANUALLY - run 'make specs' to regenerate.",
52
+ '"""',
53
+ "",
54
+ "import os",
55
+ "from typing import Any, Dict, List",
56
+ "from dataclasses import dataclass",
57
+ "",
58
+ "",
59
+ "@dataclass",
60
+ "class SkillSpec:",
61
+ ' """Skill specification."""',
62
+ "",
63
+ " id: str",
64
+ " name: str",
65
+ " description: str",
66
+ " module: str",
67
+ " required_env_vars: List[str]",
68
+ " optional_env_vars: List[str]",
69
+ " dependencies: List[str]",
70
+ " tags: List[str]",
71
+ " enabled: bool",
72
+ "",
73
+ "",
74
+ "# " + "=" * 76,
75
+ "# Skill Definitions",
76
+ "# " + "=" * 76,
77
+ "",
78
+ ]
79
+
80
+ # Generate skill constants
81
+ for spec in specs:
82
+ skill_id = spec["id"]
83
+ const_name = f"{skill_id.upper().replace('-', '_')}_SKILL_SPEC"
84
+
85
+ lines.extend(
86
+ [
87
+ f"{const_name} = SkillSpec(",
88
+ f' id="{skill_id}",',
89
+ f' name="{spec["name"]}",',
90
+ f' description="{spec["description"]}",',
91
+ f' module="{spec.get("module", "")}",',
92
+ f" required_env_vars={_fmt_list(spec.get('required_env_vars', []))},",
93
+ f" optional_env_vars={_fmt_list(spec.get('optional_env_vars', []))},",
94
+ f" dependencies={_fmt_list(spec.get('dependencies', []))},",
95
+ f" tags={_fmt_list(spec.get('tags', []))},",
96
+ f" enabled={spec.get('enabled', True)},",
97
+ ")",
98
+ "",
99
+ ]
100
+ )
101
+
102
+ # Generate catalog dictionary
103
+ lines.extend(
104
+ [
105
+ "# " + "=" * 76,
106
+ "# Skill Catalog",
107
+ "# " + "=" * 76,
108
+ "",
109
+ "SKILL_CATALOG: Dict[str, SkillSpec] = {",
110
+ ]
111
+ )
112
+
113
+ for spec in specs:
114
+ skill_id = spec["id"]
115
+ const_name = f"{skill_id.upper().replace('-', '_')}_SKILL_SPEC"
116
+ lines.append(f' "{skill_id}": {const_name},')
117
+
118
+ lines.extend(
119
+ [
120
+ "}",
121
+ "",
122
+ "",
123
+ "def check_env_vars_available(env_vars: List[str]) -> bool:",
124
+ ' """',
125
+ " Check if all required environment variables are set.",
126
+ "",
127
+ " Args:",
128
+ " env_vars: List of environment variable names to check.",
129
+ "",
130
+ " Returns:",
131
+ " True if all env vars are set (non-empty), False otherwise.",
132
+ ' """',
133
+ " if not env_vars:",
134
+ " return True",
135
+ " return all(os.environ.get(var) for var in env_vars)",
136
+ "",
137
+ "",
138
+ "def get_skill_spec(skill_id: str) -> SkillSpec | None:",
139
+ ' """',
140
+ " Get a skill specification by ID.",
141
+ "",
142
+ " Args:",
143
+ " skill_id: The unique identifier of the skill.",
144
+ "",
145
+ " Returns:",
146
+ " The SkillSpec, or None if not found.",
147
+ ' """',
148
+ " return SKILL_CATALOG.get(skill_id)",
149
+ "",
150
+ "",
151
+ "def list_skill_specs() -> List[SkillSpec]:",
152
+ ' """',
153
+ " List all skill specifications.",
154
+ "",
155
+ " Returns:",
156
+ " List of all SkillSpec configurations.",
157
+ ' """',
158
+ " return list(SKILL_CATALOG.values())",
159
+ "",
160
+ ]
161
+ )
162
+
163
+ return "\n".join(lines)
164
+
165
+
166
+ def generate_typescript_code(specs: list[dict[str, Any]]) -> str:
167
+ """Generate TypeScript code from skill specifications."""
168
+ lines = [
169
+ "/*",
170
+ " * Copyright (c) 2025-2026 Datalayer, Inc.",
171
+ " * Distributed under the terms of the Modified BSD License.",
172
+ " */",
173
+ "",
174
+ "/**",
175
+ " * Skill Catalog",
176
+ " *",
177
+ " * Predefined skill configurations.",
178
+ " *",
179
+ " * This file is AUTO-GENERATED from YAML specifications.",
180
+ " * DO NOT EDIT MANUALLY - run 'make specs' to regenerate.",
181
+ " */",
182
+ "",
183
+ "export interface SkillSpec {",
184
+ " id: string;",
185
+ " name: string;",
186
+ " description: string;",
187
+ " module: string;",
188
+ " requiredEnvVars: string[];",
189
+ " optionalEnvVars: string[];",
190
+ " dependencies: string[];",
191
+ " tags: string[];",
192
+ " enabled: boolean;",
193
+ "}",
194
+ "",
195
+ "// " + "=" * 76,
196
+ "// Skill Definitions",
197
+ "// " + "=" * 76,
198
+ "",
199
+ ]
200
+
201
+ # Generate skill constants
202
+ for spec in specs:
203
+ skill_id = spec["id"]
204
+ const_name = f"{skill_id.upper().replace('-', '_')}_SKILL_SPEC"
205
+
206
+ # Format arrays for TypeScript
207
+ required_env_vars_json = str(spec.get("required_env_vars", [])).replace(
208
+ "'", '"'
209
+ )
210
+ optional_env_vars_json = str(spec.get("optional_env_vars", [])).replace(
211
+ "'", '"'
212
+ )
213
+ dependencies_json = str(spec.get("dependencies", [])).replace("'", '"')
214
+ tags_json = str(spec.get("tags", [])).replace("'", '"')
215
+
216
+ lines.extend(
217
+ [
218
+ f"export const {const_name}: SkillSpec = {{",
219
+ f" id: '{skill_id}',",
220
+ f" name: '{spec['name']}',",
221
+ f" description: '{spec['description']}',",
222
+ f" module: '{spec.get('module', '')}',",
223
+ f" requiredEnvVars: {required_env_vars_json},",
224
+ f" optionalEnvVars: {optional_env_vars_json},",
225
+ f" dependencies: {dependencies_json},",
226
+ f" tags: {tags_json},",
227
+ f" enabled: {str(spec.get('enabled', True)).lower()},",
228
+ "};",
229
+ "",
230
+ ]
231
+ )
232
+
233
+ # Generate catalog object
234
+ lines.extend(
235
+ [
236
+ "// " + "=" * 76,
237
+ "// Skill Catalog",
238
+ "// " + "=" * 76,
239
+ "",
240
+ "export const SKILL_CATALOG: Record<string, SkillSpec> = {",
241
+ ]
242
+ )
243
+
244
+ for spec in specs:
245
+ skill_id = spec["id"]
246
+ const_name = f"{skill_id.upper().replace('-', '_')}_SKILL_SPEC"
247
+ lines.append(f" '{skill_id}': {const_name},")
248
+
249
+ lines.extend(
250
+ [
251
+ "};",
252
+ "",
253
+ "export function getSkillSpecs(): SkillSpec[] {",
254
+ " return Object.values(SKILL_CATALOG);",
255
+ "}",
256
+ "",
257
+ "export function getSkillSpec(skillId: string): SkillSpec | undefined {",
258
+ " return SKILL_CATALOG[skillId];",
259
+ "}",
260
+ "",
261
+ ]
262
+ )
263
+
264
+ return "\n".join(lines)
265
+
266
+
267
+ def main():
268
+ """Main entry point."""
269
+ parser = argparse.ArgumentParser(
270
+ description="Generate Python and TypeScript code from YAML skill specifications"
271
+ )
272
+ parser.add_argument(
273
+ "--specs-dir",
274
+ type=Path,
275
+ required=True,
276
+ help="Directory containing YAML specification files",
277
+ )
278
+ parser.add_argument(
279
+ "--python-output",
280
+ type=Path,
281
+ required=True,
282
+ help="Output path for generated Python file",
283
+ )
284
+ parser.add_argument(
285
+ "--typescript-output",
286
+ type=Path,
287
+ required=True,
288
+ help="Output path for generated TypeScript file",
289
+ )
290
+
291
+ args = parser.parse_args()
292
+
293
+ # Validate specs directory
294
+ if not args.specs_dir.exists():
295
+ print(f"Error: Specs directory does not exist: {args.specs_dir}")
296
+ sys.exit(1)
297
+
298
+ # Load specifications
299
+ print(f"Loading skill specs from {args.specs_dir}...")
300
+ specs = load_skill_specs(args.specs_dir)
301
+ print(f"Loaded {len(specs)} skill specifications")
302
+
303
+ # Generate Python code
304
+ print(f"Generating Python code...")
305
+ python_code = generate_python_code(specs)
306
+ args.python_output.parent.mkdir(parents=True, exist_ok=True)
307
+ args.python_output.write_text(python_code)
308
+ print(f"✓ Generated {args.python_output}")
309
+
310
+ # Generate TypeScript code
311
+ print(f"Generating TypeScript code...")
312
+ typescript_code = generate_typescript_code(specs)
313
+ args.typescript_output.parent.mkdir(parents=True, exist_ok=True)
314
+ args.typescript_output.write_text(typescript_code)
315
+ print(f"✓ Generated {args.typescript_output}")
316
+
317
+ print(f"\n✓ Successfully generated code from {len(specs)} skill specs")
318
+
319
+
320
+ if __name__ == "__main__":
321
+ main()
@@ -3,13 +3,14 @@
3
3
  # Distributed under the terms of the Modified BSD License.
4
4
 
5
5
  """
6
- Download AI Elements components directly from the registry
6
+ Download AI Elements components directly from the registry.
7
7
  """
8
8
 
9
9
  import json
10
10
  import os
11
- import urllib.request
12
11
  import sys
12
+ import urllib.request
13
+ from urllib.parse import urlparse
13
14
 
14
15
  BASE_URL = "https://registry.ai-sdk.dev"
15
16
  COMPONENTS_DIR = "src/components/ai-elements"
@@ -30,57 +31,71 @@ COMPONENTS = [
30
31
  "shimmer",
31
32
  ]
32
33
 
34
+
33
35
  def download_component(component_name):
34
- """Download a component from the registry"""
36
+ """
37
+ Download a component from the registry.
38
+ """
35
39
  url = f"{BASE_URL}/{component_name}.json"
36
40
  print(f"Downloading {component_name}...")
37
-
41
+
42
+ # Validate URL scheme to prevent B310 security issue
43
+ parsed = urlparse(url)
44
+ if parsed.scheme not in ("http", "https"):
45
+ raise ValueError(
46
+ f"Invalid URL scheme: {parsed.scheme}. Only http and https are allowed."
47
+ )
48
+
38
49
  try:
39
- with urllib.request.urlopen(url) as response:
50
+ with urllib.request.urlopen(url) as response: # nosec B310
40
51
  data = json.loads(response.read())
41
-
52
+
42
53
  # Get the first file (main component file)
43
- if 'files' in data and len(data['files']) > 0:
44
- file_data = data['files'][0]
45
- content = file_data.get('content', '')
46
- target = file_data.get('target', f"components/ai-elements/{component_name}.tsx")
47
-
54
+ if "files" in data and len(data["files"]) > 0:
55
+ file_data = data["files"][0]
56
+ content = file_data.get("content", "")
57
+ target = file_data.get(
58
+ "target", f"components/ai-elements/{component_name}.tsx"
59
+ )
60
+
48
61
  # Adjust target path
49
62
  target_path = os.path.join(COMPONENTS_DIR, f"{component_name}.tsx")
50
-
63
+
51
64
  # Ensure directory exists
52
65
  os.makedirs(os.path.dirname(target_path), exist_ok=True)
53
-
66
+
54
67
  # Write file
55
- with open(target_path, 'w') as f:
68
+ with open(target_path, "w") as f:
56
69
  f.write(content)
57
-
70
+
58
71
  print(f"✓ Downloaded {component_name} to {target_path}")
59
72
  return True
60
73
  else:
61
74
  print(f"✗ No files found for {component_name}")
62
75
  return False
63
-
76
+
64
77
  except Exception as e:
65
78
  print(f"✗ Error downloading {component_name}: {e}")
66
79
  return False
67
80
 
81
+
68
82
  def main():
69
83
  print(f"Downloading AI Elements components to {COMPONENTS_DIR}")
70
84
  print(f"Components: {', '.join(COMPONENTS)}\n")
71
-
85
+
72
86
  # Create components directory
73
87
  os.makedirs(COMPONENTS_DIR, exist_ok=True)
74
-
88
+
75
89
  success_count = 0
76
90
  for component in COMPONENTS:
77
91
  if download_component(component):
78
92
  success_count += 1
79
-
93
+
80
94
  print(f"\n✓ Successfully downloaded {success_count}/{len(COMPONENTS)} components")
81
-
95
+
82
96
  if success_count < len(COMPONENTS):
83
97
  sys.exit(1)
84
98
 
99
+
85
100
  if __name__ == "__main__":
86
101
  main()
@@ -56,6 +56,9 @@ sync_packages() {
56
56
  rm -rf node_modules/@datalayer/jupyter-react/lib
57
57
  mkdir -p node_modules/@datalayer/jupyter-react/lib
58
58
  cp -r "$JUPYTER_UI_ROOT/packages/react/lib/." node_modules/@datalayer/jupyter-react/lib/
59
+ # Copy style directory
60
+ rm -rf node_modules/@datalayer/jupyter-react/style
61
+ cp -r "$JUPYTER_UI_ROOT/packages/react/style" node_modules/@datalayer/jupyter-react/
59
62
  cp "$JUPYTER_UI_ROOT/packages/react/package.json" node_modules/@datalayer/jupyter-react/
60
63
 
61
64
  # Now build jupyter-lexical (finds react via workspace hoisting)
@@ -75,6 +78,9 @@ sync_packages() {
75
78
  rm -rf node_modules/@datalayer/jupyter-lexical/lib
76
79
  mkdir -p node_modules/@datalayer/jupyter-lexical/lib
77
80
  cp -r "$JUPYTER_UI_ROOT/packages/lexical/lib/." node_modules/@datalayer/jupyter-lexical/lib/
81
+ # Copy style directory
82
+ rm -rf node_modules/@datalayer/jupyter-lexical/style
83
+ cp -r "$JUPYTER_UI_ROOT/packages/lexical/style" node_modules/@datalayer/jupyter-lexical/
78
84
  cp "$JUPYTER_UI_ROOT/packages/lexical/package.json" node_modules/@datalayer/jupyter-lexical/
79
85
 
80
86
  echo -e "${GREEN}✅ Successfully synced at $(date +"%H:%M:%S")${NC}"
@@ -1,7 +0,0 @@
1
- import * as React from 'react';
2
- import * as AccordionPrimitive from '@radix-ui/react-accordion';
3
- declare function Accordion({ ...props }: React.ComponentProps<typeof AccordionPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
- declare function AccordionItem({ className, ...props }: React.ComponentProps<typeof AccordionPrimitive.Item>): import("react/jsx-runtime").JSX.Element;
5
- declare function AccordionTrigger({ className, children, ...props }: React.ComponentProps<typeof AccordionPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
6
- declare function AccordionContent({ className, children, ...props }: React.ComponentProps<typeof AccordionPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
7
- export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
@@ -1,22 +0,0 @@
1
- /*
2
- * Copyright (c) 2025-2026 Datalayer, Inc.
3
- * Distributed under the terms of the Modified BSD License.
4
- */
5
- 'use client';
6
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
7
- import * as AccordionPrimitive from '@radix-ui/react-accordion';
8
- import { ChevronDownIcon } from 'lucide-react';
9
- import { cn } from '@/lib/utils';
10
- function Accordion({ ...props }) {
11
- return _jsx(AccordionPrimitive.Root, { "data-slot": "accordion", ...props });
12
- }
13
- function AccordionItem({ className, ...props }) {
14
- return (_jsx(AccordionPrimitive.Item, { "data-slot": "accordion-item", className: cn('border-b last:border-b-0', className), ...props }));
15
- }
16
- function AccordionTrigger({ className, children, ...props }) {
17
- return (_jsx(AccordionPrimitive.Header, { className: "flex", children: _jsxs(AccordionPrimitive.Trigger, { "data-slot": "accordion-trigger", className: cn('focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180', className), ...props, children: [children, _jsx(ChevronDownIcon, { className: "text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200" })] }) }));
18
- }
19
- function AccordionContent({ className, children, ...props }) {
20
- return (_jsx(AccordionPrimitive.Content, { "data-slot": "accordion-content", className: "data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm", ...props, children: _jsx("div", { className: cn('pt-0 pb-4', className), children: children }) }));
21
- }
22
- export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
@@ -1,14 +0,0 @@
1
- import * as React from 'react';
2
- import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
3
- declare function AlertDialog({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
- declare function AlertDialogTrigger({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
5
- declare function AlertDialogPortal({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
6
- declare function AlertDialogOverlay({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Overlay>): import("react/jsx-runtime").JSX.Element;
7
- declare function AlertDialogContent({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
8
- declare function AlertDialogHeader({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
9
- declare function AlertDialogFooter({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
10
- declare function AlertDialogTitle({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Title>): import("react/jsx-runtime").JSX.Element;
11
- declare function AlertDialogDescription({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Description>): import("react/jsx-runtime").JSX.Element;
12
- declare function AlertDialogAction({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Action>): import("react/jsx-runtime").JSX.Element;
13
- declare function AlertDialogCancel({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Cancel>): import("react/jsx-runtime").JSX.Element;
14
- export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, };
@@ -1,43 +0,0 @@
1
- /*
2
- * Copyright (c) 2025-2026 Datalayer, Inc.
3
- * Distributed under the terms of the Modified BSD License.
4
- */
5
- 'use client';
6
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
7
- import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
8
- import { cn } from '@/lib/utils';
9
- import { buttonVariants } from '@/components/ui/button';
10
- function AlertDialog({ ...props }) {
11
- return _jsx(AlertDialogPrimitive.Root, { "data-slot": "alert-dialog", ...props });
12
- }
13
- function AlertDialogTrigger({ ...props }) {
14
- return (_jsx(AlertDialogPrimitive.Trigger, { "data-slot": "alert-dialog-trigger", ...props }));
15
- }
16
- function AlertDialogPortal({ ...props }) {
17
- return (_jsx(AlertDialogPrimitive.Portal, { "data-slot": "alert-dialog-portal", ...props }));
18
- }
19
- function AlertDialogOverlay({ className, ...props }) {
20
- return (_jsx(AlertDialogPrimitive.Overlay, { "data-slot": "alert-dialog-overlay", className: cn('data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50', className), ...props }));
21
- }
22
- function AlertDialogContent({ className, ...props }) {
23
- return (_jsxs(AlertDialogPortal, { children: [_jsx(AlertDialogOverlay, {}), _jsx(AlertDialogPrimitive.Content, { "data-slot": "alert-dialog-content", className: cn('bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg', className), ...props })] }));
24
- }
25
- function AlertDialogHeader({ className, ...props }) {
26
- return (_jsx("div", { "data-slot": "alert-dialog-header", className: cn('flex flex-col gap-2 text-center sm:text-left', className), ...props }));
27
- }
28
- function AlertDialogFooter({ className, ...props }) {
29
- return (_jsx("div", { "data-slot": "alert-dialog-footer", className: cn('flex flex-col-reverse gap-2 sm:flex-row sm:justify-end', className), ...props }));
30
- }
31
- function AlertDialogTitle({ className, ...props }) {
32
- return (_jsx(AlertDialogPrimitive.Title, { "data-slot": "alert-dialog-title", className: cn('text-lg font-semibold', className), ...props }));
33
- }
34
- function AlertDialogDescription({ className, ...props }) {
35
- return (_jsx(AlertDialogPrimitive.Description, { "data-slot": "alert-dialog-description", className: cn('text-muted-foreground text-sm', className), ...props }));
36
- }
37
- function AlertDialogAction({ className, ...props }) {
38
- return (_jsx(AlertDialogPrimitive.Action, { className: cn(buttonVariants(), className), ...props }));
39
- }
40
- function AlertDialogCancel({ className, ...props }) {
41
- return (_jsx(AlertDialogPrimitive.Cancel, { className: cn(buttonVariants({ variant: 'outline' }), className), ...props }));
42
- }
43
- export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, };
@@ -1,9 +0,0 @@
1
- import * as React from 'react';
2
- import { type VariantProps } from 'class-variance-authority';
3
- declare const alertVariants: (props?: ({
4
- variant?: "default" | "destructive" | null | undefined;
5
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
- declare function Alert({ className, variant, ...props }: React.ComponentProps<'div'> & VariantProps<typeof alertVariants>): import("react/jsx-runtime").JSX.Element;
7
- declare function AlertTitle({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
8
- declare function AlertDescription({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
9
- export { Alert, AlertTitle, AlertDescription };
@@ -1,24 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { cva } from 'class-variance-authority';
3
- import { cn } from '@/lib/utils';
4
- const alertVariants = cva('relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current', {
5
- variants: {
6
- variant: {
7
- default: 'bg-card text-card-foreground',
8
- destructive: 'text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90',
9
- },
10
- },
11
- defaultVariants: {
12
- variant: 'default',
13
- },
14
- });
15
- function Alert({ className, variant, ...props }) {
16
- return (_jsx("div", { "data-slot": "alert", role: "alert", className: cn(alertVariants({ variant }), className), ...props }));
17
- }
18
- function AlertTitle({ className, ...props }) {
19
- return (_jsx("div", { "data-slot": "alert-title", className: cn('col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight', className), ...props }));
20
- }
21
- function AlertDescription({ className, ...props }) {
22
- return (_jsx("div", { "data-slot": "alert-description", className: cn('text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed', className), ...props }));
23
- }
24
- export { Alert, AlertTitle, AlertDescription };
@@ -1,3 +0,0 @@
1
- import * as AspectRatioPrimitive from '@radix-ui/react-aspect-ratio';
2
- declare function AspectRatio({ ...props }: React.ComponentProps<typeof AspectRatioPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
3
- export { AspectRatio };
@@ -1,11 +0,0 @@
1
- /*
2
- * Copyright (c) 2025-2026 Datalayer, Inc.
3
- * Distributed under the terms of the Modified BSD License.
4
- */
5
- 'use client';
6
- import { jsx as _jsx } from "react/jsx-runtime";
7
- import * as AspectRatioPrimitive from '@radix-ui/react-aspect-ratio';
8
- function AspectRatio({ ...props }) {
9
- return _jsx(AspectRatioPrimitive.Root, { "data-slot": "aspect-ratio", ...props });
10
- }
11
- export { AspectRatio };
@@ -1,6 +0,0 @@
1
- import * as React from 'react';
2
- import * as AvatarPrimitive from '@radix-ui/react-avatar';
3
- declare function Avatar({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
- declare function AvatarImage({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Image>): import("react/jsx-runtime").JSX.Element;
5
- declare function AvatarFallback({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Fallback>): import("react/jsx-runtime").JSX.Element;
6
- export { Avatar, AvatarImage, AvatarFallback };
@@ -1,18 +0,0 @@
1
- /*
2
- * Copyright (c) 2025-2026 Datalayer, Inc.
3
- * Distributed under the terms of the Modified BSD License.
4
- */
5
- 'use client';
6
- import { jsx as _jsx } from "react/jsx-runtime";
7
- import * as AvatarPrimitive from '@radix-ui/react-avatar';
8
- import { cn } from '@/lib/utils';
9
- function Avatar({ className, ...props }) {
10
- return (_jsx(AvatarPrimitive.Root, { "data-slot": "avatar", className: cn('relative flex size-8 shrink-0 overflow-hidden rounded-full', className), ...props }));
11
- }
12
- function AvatarImage({ className, ...props }) {
13
- return (_jsx(AvatarPrimitive.Image, { "data-slot": "avatar-image", className: cn('aspect-square size-full', className), ...props }));
14
- }
15
- function AvatarFallback({ className, ...props }) {
16
- return (_jsx(AvatarPrimitive.Fallback, { "data-slot": "avatar-fallback", className: cn('bg-muted flex size-full items-center justify-center rounded-full', className), ...props }));
17
- }
18
- export { Avatar, AvatarImage, AvatarFallback };
@@ -1,9 +0,0 @@
1
- import * as React from 'react';
2
- import { type VariantProps } from 'class-variance-authority';
3
- declare const badgeVariants: (props?: ({
4
- variant?: "default" | "outline" | "secondary" | "destructive" | null | undefined;
5
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
- declare function Badge({ className, variant, asChild, ...props }: React.ComponentProps<'span'> & VariantProps<typeof badgeVariants> & {
7
- asChild?: boolean;
8
- }): import("react/jsx-runtime").JSX.Element;
9
- export { Badge, badgeVariants };
@@ -1,22 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Slot } from '@radix-ui/react-slot';
3
- import { cva } from 'class-variance-authority';
4
- import { cn } from '@/lib/utils';
5
- const badgeVariants = cva('inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden', {
6
- variants: {
7
- variant: {
8
- default: 'border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90',
9
- secondary: 'border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90',
10
- destructive: 'border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60',
11
- outline: 'text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground',
12
- },
13
- },
14
- defaultVariants: {
15
- variant: 'default',
16
- },
17
- });
18
- function Badge({ className, variant, asChild = false, ...props }) {
19
- const Comp = asChild ? Slot : 'span';
20
- return (_jsx(Comp, { "data-slot": "badge", className: cn(badgeVariants({ variant }), className), ...props }));
21
- }
22
- export { Badge, badgeVariants };