@tpitre/story-ui 2.6.1 → 2.7.1

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 (295) hide show
  1. package/README.md +36 -37
  2. package/dist/cli/deploy.d.ts +4 -3
  3. package/dist/cli/deploy.d.ts.map +1 -1
  4. package/dist/cli/deploy.js +542 -46
  5. package/dist/cli/index.js +17 -14
  6. package/dist/cli/index.js.map +1 -0
  7. package/dist/cli/setup.d.ts.map +1 -1
  8. package/dist/cli/setup.js +4 -110
  9. package/dist/cli/setup.js.map +1 -0
  10. package/dist/cloudflare-edge/src/mcp-session.js +462 -0
  11. package/dist/cloudflare-edge/src/types.js +4 -0
  12. package/dist/cloudflare-edge/src/worker.js +106 -0
  13. package/dist/cloudflare-pages/vite.config.js +14 -0
  14. package/dist/index.d.ts +13 -0
  15. package/dist/index.d.ts.map +1 -0
  16. package/dist/index.js +12 -0
  17. package/dist/index.js.map +1 -0
  18. package/dist/mcp-server/index.js.map +1 -0
  19. package/dist/mcp-server/mcp-stdio-server.js.map +1 -0
  20. package/dist/mcp-server/routes/claude.js.map +1 -0
  21. package/dist/mcp-server/routes/components.js.map +1 -0
  22. package/dist/mcp-server/routes/generateStory.js.map +1 -0
  23. package/dist/mcp-server/routes/hybridStories.js.map +1 -0
  24. package/dist/mcp-server/routes/memoryStories.js.map +1 -0
  25. package/dist/mcp-server/routes/storySync.js.map +1 -0
  26. package/dist/mcp-server/routes/updateStory.js +246 -0
  27. package/dist/mcp-server/sessionManager.js.map +1 -0
  28. package/dist/playground/components/AIAssistant/AIAssistant.d.ts +6 -0
  29. package/dist/playground/components/AIAssistant/AIAssistant.d.ts.map +1 -0
  30. package/dist/playground/components/AIAssistant/AIAssistant.js +109 -0
  31. package/dist/playground/components/AIAssistant/AIAssistant.js.map +1 -0
  32. package/dist/playground/components/AIAssistant/AIAssistant.module.css +166 -0
  33. package/dist/playground/components/Canvas/Canvas.d.ts +9 -0
  34. package/dist/playground/components/Canvas/Canvas.d.ts.map +1 -0
  35. package/dist/playground/components/Canvas/Canvas.js +58 -0
  36. package/dist/playground/components/Canvas/Canvas.js.map +1 -0
  37. package/dist/playground/components/Canvas/Canvas.module.css +189 -0
  38. package/dist/playground/components/Canvas/CanvasWithDnd.d.ts +9 -0
  39. package/dist/playground/components/Canvas/CanvasWithDnd.d.ts.map +1 -0
  40. package/dist/playground/components/Canvas/CanvasWithDnd.js +158 -0
  41. package/dist/playground/components/Canvas/CanvasWithDnd.js.map +1 -0
  42. package/dist/playground/components/Canvas/ComponentRenderer.d.ts +15 -0
  43. package/dist/playground/components/Canvas/ComponentRenderer.d.ts.map +1 -0
  44. package/dist/playground/components/Canvas/ComponentRenderer.js +177 -0
  45. package/dist/playground/components/Canvas/ComponentRenderer.js.map +1 -0
  46. package/dist/playground/components/Canvas/DraggableComponent.d.ts +15 -0
  47. package/dist/playground/components/Canvas/DraggableComponent.d.ts.map +1 -0
  48. package/dist/playground/components/Canvas/DraggableComponent.js +49 -0
  49. package/dist/playground/components/Canvas/DraggableComponent.js.map +1 -0
  50. package/dist/playground/components/Canvas/index.d.ts +9 -0
  51. package/dist/playground/components/Canvas/index.d.ts.map +1 -0
  52. package/dist/playground/components/Canvas/index.js +5 -0
  53. package/dist/playground/components/Canvas/index.js.map +1 -0
  54. package/dist/playground/components/CodeView/CodeView.d.ts +12 -0
  55. package/dist/playground/components/CodeView/CodeView.d.ts.map +1 -0
  56. package/dist/playground/components/CodeView/CodeView.js +77 -0
  57. package/dist/playground/components/CodeView/CodeView.js.map +1 -0
  58. package/dist/playground/components/CodeView/CodeView.module.css +178 -0
  59. package/dist/playground/components/ComponentPalette/ComponentPalette.d.ts +17 -0
  60. package/dist/playground/components/ComponentPalette/ComponentPalette.d.ts.map +1 -0
  61. package/dist/playground/components/ComponentPalette/ComponentPalette.js +138 -0
  62. package/dist/playground/components/ComponentPalette/ComponentPalette.js.map +1 -0
  63. package/dist/playground/components/ComponentPalette/ComponentPalette.module.css +217 -0
  64. package/dist/playground/components/ComponentPalette/index.d.ts +3 -0
  65. package/dist/playground/components/ComponentPalette/index.d.ts.map +1 -0
  66. package/dist/playground/components/ComponentPalette/index.js +2 -0
  67. package/dist/playground/components/ComponentPalette/index.js.map +1 -0
  68. package/dist/playground/components/DropZone/DropZone.d.ts +17 -0
  69. package/dist/playground/components/DropZone/DropZone.d.ts.map +1 -0
  70. package/dist/playground/components/DropZone/DropZone.js +73 -0
  71. package/dist/playground/components/DropZone/DropZone.js.map +1 -0
  72. package/dist/playground/components/DropZone/DropZone.module.css +86 -0
  73. package/dist/playground/components/ExportDialog/ExportDialog.d.ts +10 -0
  74. package/dist/playground/components/ExportDialog/ExportDialog.d.ts.map +1 -0
  75. package/dist/playground/components/ExportDialog/ExportDialog.js +57 -0
  76. package/dist/playground/components/ExportDialog/ExportDialog.js.map +1 -0
  77. package/dist/playground/components/ExportDialog/ExportDialog.module.css +328 -0
  78. package/dist/playground/components/LayoutHelpers/LayoutHelpers.d.ts +134 -0
  79. package/dist/playground/components/LayoutHelpers/LayoutHelpers.d.ts.map +1 -0
  80. package/dist/playground/components/LayoutHelpers/LayoutHelpers.js +254 -0
  81. package/dist/playground/components/LayoutHelpers/LayoutHelpers.js.map +1 -0
  82. package/dist/playground/components/LayoutHelpers/index.d.ts +3 -0
  83. package/dist/playground/components/LayoutHelpers/index.d.ts.map +1 -0
  84. package/dist/playground/components/LayoutHelpers/index.js +2 -0
  85. package/dist/playground/components/LayoutHelpers/index.js.map +1 -0
  86. package/dist/playground/components/Playground/Playground.d.ts +10 -0
  87. package/dist/playground/components/Playground/Playground.d.ts.map +1 -0
  88. package/dist/playground/components/Playground/Playground.js +128 -0
  89. package/dist/playground/components/Playground/Playground.js.map +1 -0
  90. package/dist/playground/components/Playground/Playground.module.css +308 -0
  91. package/dist/playground/components/PropertiesPanel/PropertiesPanel.d.ts +10 -0
  92. package/dist/playground/components/PropertiesPanel/PropertiesPanel.d.ts.map +1 -0
  93. package/dist/playground/components/PropertiesPanel/PropertiesPanel.js +150 -0
  94. package/dist/playground/components/PropertiesPanel/PropertiesPanel.js.map +1 -0
  95. package/dist/playground/components/PropertiesPanel/PropertiesPanel.module.css +155 -0
  96. package/dist/playground/components/PropertiesPanel/index.d.ts +3 -0
  97. package/dist/playground/components/PropertiesPanel/index.d.ts.map +1 -0
  98. package/dist/playground/components/PropertiesPanel/index.js +2 -0
  99. package/dist/playground/components/PropertiesPanel/index.js.map +1 -0
  100. package/dist/playground/components/PropertyEditors/BooleanEditor.d.ts +12 -0
  101. package/dist/playground/components/PropertyEditors/BooleanEditor.d.ts.map +1 -0
  102. package/dist/playground/components/PropertyEditors/BooleanEditor.js +14 -0
  103. package/dist/playground/components/PropertyEditors/BooleanEditor.js.map +1 -0
  104. package/dist/playground/components/PropertyEditors/ColorEditor.d.ts +12 -0
  105. package/dist/playground/components/PropertyEditors/ColorEditor.d.ts.map +1 -0
  106. package/dist/playground/components/PropertyEditors/ColorEditor.js +62 -0
  107. package/dist/playground/components/PropertyEditors/ColorEditor.js.map +1 -0
  108. package/dist/playground/components/PropertyEditors/IconEditor.d.ts +12 -0
  109. package/dist/playground/components/PropertyEditors/IconEditor.d.ts.map +1 -0
  110. package/dist/playground/components/PropertyEditors/IconEditor.js +123 -0
  111. package/dist/playground/components/PropertyEditors/IconEditor.js.map +1 -0
  112. package/dist/playground/components/PropertyEditors/NumberEditor.d.ts +15 -0
  113. package/dist/playground/components/PropertyEditors/NumberEditor.d.ts.map +1 -0
  114. package/dist/playground/components/PropertyEditors/NumberEditor.js +46 -0
  115. package/dist/playground/components/PropertyEditors/NumberEditor.js.map +1 -0
  116. package/dist/playground/components/PropertyEditors/PropertyEditors.module.css +432 -0
  117. package/dist/playground/components/PropertyEditors/SelectEditor.d.ts +19 -0
  118. package/dist/playground/components/PropertyEditors/SelectEditor.d.ts.map +1 -0
  119. package/dist/playground/components/PropertyEditors/SelectEditor.js +17 -0
  120. package/dist/playground/components/PropertyEditors/SelectEditor.js.map +1 -0
  121. package/dist/playground/components/PropertyEditors/SpacingEditor.d.ts +19 -0
  122. package/dist/playground/components/PropertyEditors/SpacingEditor.d.ts.map +1 -0
  123. package/dist/playground/components/PropertyEditors/SpacingEditor.js +162 -0
  124. package/dist/playground/components/PropertyEditors/SpacingEditor.js.map +1 -0
  125. package/dist/playground/components/PropertyEditors/SpacingEditor.module.css +214 -0
  126. package/dist/playground/components/PropertyEditors/TextEditor.d.ts +14 -0
  127. package/dist/playground/components/PropertyEditors/TextEditor.d.ts.map +1 -0
  128. package/dist/playground/components/PropertyEditors/TextEditor.js +38 -0
  129. package/dist/playground/components/PropertyEditors/TextEditor.js.map +1 -0
  130. package/dist/playground/components/PropertyEditors/TokenEditor.d.ts +23 -0
  131. package/dist/playground/components/PropertyEditors/TokenEditor.d.ts.map +1 -0
  132. package/dist/playground/components/PropertyEditors/TokenEditor.js +50 -0
  133. package/dist/playground/components/PropertyEditors/TokenEditor.js.map +1 -0
  134. package/dist/playground/components/PropertyEditors/index.d.ts +20 -0
  135. package/dist/playground/components/PropertyEditors/index.d.ts.map +1 -0
  136. package/dist/playground/components/PropertyEditors/index.js +12 -0
  137. package/dist/playground/components/PropertyEditors/index.js.map +1 -0
  138. package/dist/playground/components/TreeView/TreeView.d.ts +10 -0
  139. package/dist/playground/components/TreeView/TreeView.d.ts.map +1 -0
  140. package/dist/playground/components/TreeView/TreeView.js +146 -0
  141. package/dist/playground/components/TreeView/TreeView.js.map +1 -0
  142. package/dist/playground/components/TreeView/TreeView.module.css +214 -0
  143. package/dist/playground/components/TreeView/index.d.ts +3 -0
  144. package/dist/playground/components/TreeView/index.d.ts.map +1 -0
  145. package/dist/playground/components/TreeView/index.js +2 -0
  146. package/dist/playground/components/TreeView/index.js.map +1 -0
  147. package/dist/playground/config/propertyDefinitions.d.ts +73 -0
  148. package/dist/playground/config/propertyDefinitions.d.ts.map +1 -0
  149. package/dist/playground/config/propertyDefinitions.js +809 -0
  150. package/dist/playground/config/propertyDefinitions.js.map +1 -0
  151. package/dist/playground/hooks/useKeyboardShortcuts.d.ts +38 -0
  152. package/dist/playground/hooks/useKeyboardShortcuts.d.ts.map +1 -0
  153. package/dist/playground/hooks/useKeyboardShortcuts.js +191 -0
  154. package/dist/playground/hooks/useKeyboardShortcuts.js.map +1 -0
  155. package/dist/playground/index.d.ts +21 -0
  156. package/dist/playground/index.d.ts.map +1 -0
  157. package/dist/playground/index.js +23 -0
  158. package/dist/playground/index.js.map +1 -0
  159. package/dist/playground/services/CodeGenerator.d.ts +73 -0
  160. package/dist/playground/services/CodeGenerator.d.ts.map +1 -0
  161. package/dist/playground/services/CodeGenerator.js +359 -0
  162. package/dist/playground/services/CodeGenerator.js.map +1 -0
  163. package/dist/playground/services/DragDropManager.d.ts +95 -0
  164. package/dist/playground/services/DragDropManager.d.ts.map +1 -0
  165. package/dist/playground/services/DragDropManager.js +408 -0
  166. package/dist/playground/services/DragDropManager.js.map +1 -0
  167. package/dist/playground/services/StoryParser.d.ts +73 -0
  168. package/dist/playground/services/StoryParser.d.ts.map +1 -0
  169. package/dist/playground/services/StoryParser.js +419 -0
  170. package/dist/playground/services/StoryParser.js.map +1 -0
  171. package/dist/playground/store/playgroundStore.d.ts +86 -0
  172. package/dist/playground/store/playgroundStore.d.ts.map +1 -0
  173. package/dist/playground/store/playgroundStore.js +337 -0
  174. package/dist/playground/store/playgroundStore.js.map +1 -0
  175. package/dist/playground/stories/PlaygroundDragDrop.stories.d.ts +13 -0
  176. package/dist/playground/stories/PlaygroundDragDrop.stories.d.ts.map +1 -0
  177. package/dist/playground/stories/PlaygroundDragDrop.stories.js +227 -0
  178. package/dist/playground/stories/PlaygroundDragDrop.stories.js.map +1 -0
  179. package/dist/playground/stories/PlaygroundPhase4.stories.d.ts +13 -0
  180. package/dist/playground/stories/PlaygroundPhase4.stories.d.ts.map +1 -0
  181. package/dist/playground/stories/PlaygroundPhase4.stories.js +334 -0
  182. package/dist/playground/stories/PlaygroundPhase4.stories.js.map +1 -0
  183. package/dist/playground/stories/PlaygroundPhase5.stories.d.ts +14 -0
  184. package/dist/playground/stories/PlaygroundPhase5.stories.d.ts.map +1 -0
  185. package/dist/playground/stories/PlaygroundPhase5.stories.js +512 -0
  186. package/dist/playground/stories/PlaygroundPhase5.stories.js.map +1 -0
  187. package/dist/playground/stories/PlaygroundProperties.stories.d.ts +13 -0
  188. package/dist/playground/stories/PlaygroundProperties.stories.d.ts.map +1 -0
  189. package/dist/playground/stories/PlaygroundProperties.stories.js +342 -0
  190. package/dist/playground/stories/PlaygroundProperties.stories.js.map +1 -0
  191. package/dist/playground/types/index.d.ts +251 -0
  192. package/dist/playground/types/index.d.ts.map +1 -0
  193. package/dist/playground/types/index.js +5 -0
  194. package/dist/playground/types/index.js.map +1 -0
  195. package/dist/scripts/verify-framework-adapters.js +105 -0
  196. package/dist/story-generator/componentBlacklist.js.map +1 -0
  197. package/dist/story-generator/componentDiscovery.js.map +1 -0
  198. package/dist/story-generator/configLoader.js.map +1 -0
  199. package/dist/story-generator/considerationsLoader.js.map +1 -0
  200. package/dist/story-generator/documentation-sources.js.map +1 -0
  201. package/dist/story-generator/documentationLoader.js.map +1 -0
  202. package/dist/story-generator/dynamicPackageDiscovery.js.map +1 -0
  203. package/dist/story-generator/enhancedComponentDiscovery.d.ts.map +1 -1
  204. package/dist/story-generator/enhancedComponentDiscovery.js +4 -6
  205. package/dist/story-generator/enhancedComponentDiscovery.js.map +1 -0
  206. package/dist/story-generator/generateStory.js.map +1 -0
  207. package/dist/story-generator/gitignoreManager.js.map +1 -0
  208. package/dist/story-generator/inMemoryStoryService.js.map +1 -0
  209. package/dist/story-generator/llm-providers/settings-manager.js +4 -4
  210. package/dist/story-generator/logger.js.map +1 -0
  211. package/dist/story-generator/postProcessStory.js.map +1 -0
  212. package/dist/story-generator/productionGitignoreManager.d.ts.map +1 -1
  213. package/dist/story-generator/productionGitignoreManager.js +6 -0
  214. package/dist/story-generator/productionGitignoreManager.js.map +1 -0
  215. package/dist/story-generator/promptGenerator.js.map +1 -0
  216. package/dist/story-generator/providerPresets.d.ts +54 -0
  217. package/dist/story-generator/providerPresets.d.ts.map +1 -0
  218. package/dist/story-generator/providerPresets.js +214 -0
  219. package/dist/story-generator/storyHistory.js.map +1 -0
  220. package/dist/story-generator/storySync.js.map +1 -0
  221. package/dist/story-generator/storyTracker.js.map +1 -0
  222. package/dist/story-generator/storyValidator.js.map +1 -0
  223. package/dist/story-generator/test_validation.d.ts +2 -0
  224. package/dist/story-generator/test_validation.d.ts.map +1 -0
  225. package/dist/story-generator/test_validation.js +51 -0
  226. package/dist/story-generator/universalDesignSystemAdapter.js.map +1 -0
  227. package/dist/story-generator/urlRedirectService.js.map +1 -0
  228. package/dist/story-generator/validateStory.js.map +1 -0
  229. package/dist/story-ui.config.js.map +1 -0
  230. package/dist/story-ui.config.loader.d.ts +36 -0
  231. package/dist/story-ui.config.loader.d.ts.map +1 -0
  232. package/dist/story-ui.config.loader.js +205 -0
  233. package/dist/story-ui.config.loader.js.map +1 -0
  234. package/dist/temp/package/templates/StoryUI/StoryUIPanel.js +807 -0
  235. package/dist/temp/package/templates/StoryUI/StoryUIPanel.stories.js +37 -0
  236. package/dist/temp/package/templates/StoryUI/index.js +2 -0
  237. package/dist/templates/StoryUI/StoryUIPanel.js.map +1 -0
  238. package/dist/templates/StoryUI/StoryUIPanel.stories.js.map +1 -0
  239. package/dist/templates/StoryUI/index.js.map +1 -0
  240. package/dist/templates/StoryUI/manager.d.ts +14 -0
  241. package/dist/templates/StoryUI/manager.d.ts.map +1 -0
  242. package/dist/templates/production-app/src/App.d.ts +10 -0
  243. package/dist/templates/production-app/src/App.d.ts.map +1 -0
  244. package/dist/templates/production-app/src/App.js +653 -0
  245. package/dist/templates/production-app/src/LivePreviewRenderer.d.ts +24 -0
  246. package/dist/templates/production-app/src/LivePreviewRenderer.d.ts.map +1 -0
  247. package/dist/templates/production-app/src/LivePreviewRenderer.js +199 -0
  248. package/dist/templates/production-app/src/componentRegistry.d.ts +20 -0
  249. package/dist/templates/production-app/src/componentRegistry.d.ts.map +1 -0
  250. package/dist/templates/production-app/src/componentRegistry.js +316 -0
  251. package/dist/templates/production-app/src/main.d.ts +9 -0
  252. package/dist/templates/production-app/src/main.d.ts.map +1 -0
  253. package/dist/templates/production-app/src/main.js +18 -0
  254. package/dist/templates/production-app/vite.config.d.ts +3 -0
  255. package/dist/templates/production-app/vite.config.d.ts.map +1 -0
  256. package/dist/templates/production-app/vite.config.js +71 -0
  257. package/dist/test-storybooks/angular-material-storybook/src/main.js +66 -0
  258. package/dist/test-storybooks/chakra-storybook/vite.config.js +6 -0
  259. package/dist/test-storybooks/mantine-storybook/vite.config.js +93 -0
  260. package/dist/test-storybooks/web-components-shoelace/vite.config.js +9 -0
  261. package/dist/tsconfig.tsbuildinfo +1 -0
  262. package/dist/visual-builder/components/Canvas/Canvas.js +70 -0
  263. package/dist/visual-builder/components/Canvas/ComponentRenderer.js +545 -0
  264. package/dist/visual-builder/components/CodeExporter/CodeExporter.js +25 -0
  265. package/dist/visual-builder/components/CodeExporter/codeGenerator.js +99 -0
  266. package/dist/visual-builder/components/ComponentPalette/ComponentPalette.js +8 -0
  267. package/dist/visual-builder/components/ComponentPalette/ComponentPaletteItem.js +51 -0
  268. package/dist/visual-builder/components/EmbeddedVisualBuilder.js +107 -0
  269. package/dist/visual-builder/components/PropertyEditor/PropertyEditor.js +16 -0
  270. package/dist/visual-builder/components/PropertyEditor/PropertyForm.js +88 -0
  271. package/dist/visual-builder/components/PropertyEditor/SpacingControl.js +145 -0
  272. package/dist/visual-builder/components/PropertyEditor/SpacingEditor.js +32 -0
  273. package/dist/visual-builder/components/StoryManager/SaveOnlyManager.js +94 -0
  274. package/dist/visual-builder/components/StoryManager/StoryManager.js +68 -0
  275. package/dist/visual-builder/components/StoryManager/index.js +1 -0
  276. package/dist/visual-builder/components/VisualBuilder.js +256 -0
  277. package/dist/visual-builder/config/componentRegistry.js +1758 -0
  278. package/dist/visual-builder/decorators/VisualBuilderDecorator.js +184 -0
  279. package/dist/visual-builder/example-integration.js +59 -0
  280. package/dist/visual-builder/example.js +23 -0
  281. package/dist/visual-builder/hooks/useDragAndDrop.js +137 -0
  282. package/dist/visual-builder/hooks/useSelection.js +27 -0
  283. package/dist/visual-builder/index.js +7 -0
  284. package/dist/visual-builder/store/visualBuilderStore.js +305 -0
  285. package/dist/visual-builder/types/index.js +1 -0
  286. package/dist/visual-builder/utils/__tests__/storyFileUpdater.test.js +145 -0
  287. package/dist/visual-builder/utils/aiParser.js +336 -0
  288. package/dist/visual-builder/utils/componentTreeUtils.js +111 -0
  289. package/dist/visual-builder/utils/parserValidation.js +122 -0
  290. package/dist/visual-builder/utils/storyFileManager.js +73 -0
  291. package/dist/visual-builder/utils/storyFileUpdater.js +326 -0
  292. package/dist/visual-builder/utils/storyNameExtraction.test.js +211 -0
  293. package/dist/visual-builder/utils/storyPersistence.js +180 -0
  294. package/dist/visual-builder/utils/storyToBuilder.js +813 -0
  295. package/package.json +1 -1
@@ -0,0 +1,462 @@
1
+ /**
2
+ * Story UI MCP Session Durable Object
3
+ *
4
+ * Handles per-session MCP protocol communication with:
5
+ * - SSE transport (legacy)
6
+ * - Streamable HTTP transport (new)
7
+ * - WebSocket hibernation for cost optimization
8
+ */
9
+ // MCP Protocol Constants
10
+ const MCP_VERSION = '2024-11-05';
11
+ const SERVER_NAME = 'story-ui-mcp-edge';
12
+ const SERVER_VERSION = '3.0.0';
13
+ // Story UI Tools Definition
14
+ const STORY_UI_TOOLS = [
15
+ {
16
+ name: 'test-connection',
17
+ description: 'Test the MCP connection to Story UI edge server',
18
+ inputSchema: {
19
+ type: 'object',
20
+ properties: {},
21
+ },
22
+ },
23
+ {
24
+ name: 'generate-story',
25
+ description: 'Generate a Storybook story for a component using AI',
26
+ inputSchema: {
27
+ type: 'object',
28
+ properties: {
29
+ prompt: {
30
+ type: 'string',
31
+ description: 'Description of the story to generate',
32
+ },
33
+ componentPath: {
34
+ type: 'string',
35
+ description: 'Path to the component file (optional)',
36
+ },
37
+ framework: {
38
+ type: 'string',
39
+ description: 'UI framework',
40
+ enum: ['react', 'vue', 'angular', 'svelte'],
41
+ },
42
+ },
43
+ required: ['prompt'],
44
+ },
45
+ },
46
+ {
47
+ name: 'list-stories',
48
+ description: 'List all generated stories in this session',
49
+ inputSchema: {
50
+ type: 'object',
51
+ properties: {
52
+ limit: {
53
+ type: 'number',
54
+ description: 'Maximum number of stories to return',
55
+ default: 50,
56
+ },
57
+ },
58
+ },
59
+ },
60
+ {
61
+ name: 'get-story',
62
+ description: 'Get the content of a specific story',
63
+ inputSchema: {
64
+ type: 'object',
65
+ properties: {
66
+ id: {
67
+ type: 'string',
68
+ description: 'Story ID',
69
+ },
70
+ },
71
+ required: ['id'],
72
+ },
73
+ },
74
+ {
75
+ name: 'delete-story',
76
+ description: 'Delete a generated story',
77
+ inputSchema: {
78
+ type: 'object',
79
+ properties: {
80
+ id: {
81
+ type: 'string',
82
+ description: 'Story ID',
83
+ },
84
+ },
85
+ required: ['id'],
86
+ },
87
+ },
88
+ ];
89
+ export class MCPSessionDO {
90
+ constructor(state, env) {
91
+ this.sessions = new Map();
92
+ this.sseWriters = new Map();
93
+ this.state = state;
94
+ this._env = env;
95
+ }
96
+ async fetch(request) {
97
+ const url = new URL(request.url);
98
+ try {
99
+ switch (url.pathname) {
100
+ case '/sse':
101
+ return this.handleSSE(request);
102
+ case '/messages':
103
+ return this.handleMessages(request, url);
104
+ case '/mcp':
105
+ return this.handleStreamableHTTP(request);
106
+ case '/health':
107
+ return this.handleHealth();
108
+ default:
109
+ return new Response('Not Found', { status: 404 });
110
+ }
111
+ }
112
+ catch (error) {
113
+ console.error('MCPSessionDO error:', error);
114
+ return new Response(JSON.stringify({ error: 'Internal Server Error' }), { status: 500, headers: { 'Content-Type': 'application/json' } });
115
+ }
116
+ }
117
+ /**
118
+ * Handle SSE connection (legacy transport)
119
+ */
120
+ async handleSSE(request) {
121
+ const sessionId = crypto.randomUUID();
122
+ // Create transform stream for SSE
123
+ const { readable, writable } = new TransformStream();
124
+ const writer = writable.getWriter();
125
+ const encoder = new TextEncoder();
126
+ // Store session
127
+ const session = {
128
+ id: sessionId,
129
+ createdAt: Date.now(),
130
+ lastActive: Date.now(),
131
+ };
132
+ this.sessions.set(sessionId, session);
133
+ this.sseWriters.set(sessionId, writer);
134
+ // Save to durable storage
135
+ await this.state.storage.put(`session:${sessionId}`, session);
136
+ // Send endpoint event
137
+ const endpointUrl = `/mcp-remote/messages?sessionId=${sessionId}`;
138
+ await writer.write(encoder.encode(`event: endpoint\ndata: ${endpointUrl}\n\n`));
139
+ // Clean up on close
140
+ request.signal.addEventListener('abort', async () => {
141
+ this.sessions.delete(sessionId);
142
+ this.sseWriters.delete(sessionId);
143
+ await this.state.storage.delete(`session:${sessionId}`);
144
+ console.log(`Session ${sessionId} closed`);
145
+ });
146
+ console.log(`SSE session ${sessionId} created`);
147
+ return new Response(readable, {
148
+ headers: {
149
+ 'Content-Type': 'text/event-stream',
150
+ 'Cache-Control': 'no-cache',
151
+ 'Connection': 'keep-alive',
152
+ 'Access-Control-Allow-Origin': '*',
153
+ },
154
+ });
155
+ }
156
+ /**
157
+ * Handle POST messages for SSE transport
158
+ */
159
+ async handleMessages(request, url) {
160
+ if (request.method !== 'POST') {
161
+ return new Response('Method Not Allowed', { status: 405 });
162
+ }
163
+ const sessionId = url.searchParams.get('sessionId');
164
+ if (!sessionId) {
165
+ return new Response(JSON.stringify({ error: 'Missing sessionId' }), { status: 400, headers: { 'Content-Type': 'application/json' } });
166
+ }
167
+ const session = this.sessions.get(sessionId);
168
+ if (!session) {
169
+ return new Response(JSON.stringify({ error: 'Session not found' }), { status: 404, headers: { 'Content-Type': 'application/json' } });
170
+ }
171
+ // Update last active
172
+ session.lastActive = Date.now();
173
+ // Parse message
174
+ const message = await request.json();
175
+ // Process and get response
176
+ const response = await this.processMessage(message);
177
+ // Send response via SSE
178
+ const writer = this.sseWriters.get(sessionId);
179
+ if (writer) {
180
+ const encoder = new TextEncoder();
181
+ await writer.write(encoder.encode(`event: message\ndata: ${JSON.stringify(response)}\n\n`));
182
+ }
183
+ return new Response(null, { status: 202 });
184
+ }
185
+ /**
186
+ * Handle Streamable HTTP transport (new MCP standard)
187
+ */
188
+ async handleStreamableHTTP(request) {
189
+ if (request.method !== 'POST') {
190
+ return new Response('Method Not Allowed', { status: 405 });
191
+ }
192
+ const message = await request.json();
193
+ const response = await this.processMessage(message);
194
+ return new Response(JSON.stringify(response), {
195
+ headers: {
196
+ 'Content-Type': 'application/json',
197
+ 'Access-Control-Allow-Origin': '*',
198
+ },
199
+ });
200
+ }
201
+ /**
202
+ * Process MCP JSON-RPC message
203
+ */
204
+ async processMessage(message) {
205
+ const { method, params, id } = message;
206
+ try {
207
+ switch (method) {
208
+ case 'initialize':
209
+ return this.handleInitialize(id, params);
210
+ case 'tools/list':
211
+ return this.handleListTools(id);
212
+ case 'tools/call':
213
+ return this.handleCallTool(id, params);
214
+ case 'ping':
215
+ return { jsonrpc: '2.0', id, result: {} };
216
+ default:
217
+ return {
218
+ jsonrpc: '2.0',
219
+ id,
220
+ error: { code: -32601, message: `Method not found: ${method}` },
221
+ };
222
+ }
223
+ }
224
+ catch (error) {
225
+ console.error(`Error processing ${method}:`, error);
226
+ return {
227
+ jsonrpc: '2.0',
228
+ id,
229
+ error: {
230
+ code: -32603,
231
+ message: error instanceof Error ? error.message : 'Internal error'
232
+ },
233
+ };
234
+ }
235
+ }
236
+ /**
237
+ * Handle MCP initialize
238
+ */
239
+ handleInitialize(id, params) {
240
+ // Store client info for potential future session tracking
241
+ const _clientInfo = params?.clientInfo;
242
+ return {
243
+ jsonrpc: '2.0',
244
+ id,
245
+ result: {
246
+ protocolVersion: MCP_VERSION,
247
+ capabilities: {
248
+ tools: {},
249
+ },
250
+ serverInfo: {
251
+ name: SERVER_NAME,
252
+ version: SERVER_VERSION,
253
+ },
254
+ },
255
+ };
256
+ }
257
+ /**
258
+ * Handle tools/list
259
+ */
260
+ handleListTools(id) {
261
+ return {
262
+ jsonrpc: '2.0',
263
+ id,
264
+ result: {
265
+ tools: STORY_UI_TOOLS,
266
+ },
267
+ };
268
+ }
269
+ /**
270
+ * Handle tools/call
271
+ */
272
+ async handleCallTool(id, params) {
273
+ const toolName = params?.name;
274
+ const toolArgs = params?.arguments;
275
+ const result = await this.executeTool(toolName, toolArgs || {});
276
+ return {
277
+ jsonrpc: '2.0',
278
+ id,
279
+ result,
280
+ };
281
+ }
282
+ /**
283
+ * Execute a tool
284
+ */
285
+ async executeTool(name, args) {
286
+ switch (name) {
287
+ case 'test-connection':
288
+ return {
289
+ content: [{
290
+ type: 'text',
291
+ text: JSON.stringify({
292
+ status: 'connected',
293
+ server: SERVER_NAME,
294
+ version: SERVER_VERSION,
295
+ transport: 'cloudflare-edge',
296
+ timestamp: new Date().toISOString(),
297
+ }, null, 2),
298
+ }],
299
+ };
300
+ case 'generate-story':
301
+ return this.generateStory(args);
302
+ case 'list-stories':
303
+ return this.listStories(args);
304
+ case 'get-story':
305
+ return this.getStory(args);
306
+ case 'delete-story':
307
+ return this.deleteStory(args);
308
+ default:
309
+ return {
310
+ content: [{ type: 'text', text: `Unknown tool: ${name}` }],
311
+ isError: true,
312
+ };
313
+ }
314
+ }
315
+ /**
316
+ * Generate a story (placeholder - needs LLM integration)
317
+ */
318
+ async generateStory(args) {
319
+ const prompt = args.prompt;
320
+ const componentPath = args.componentPath;
321
+ const framework = args.framework || 'react';
322
+ // Generate a unique story ID
323
+ const storyId = `story-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
324
+ // Create placeholder story content
325
+ const storyContent = `import type { Meta, StoryObj } from '@storybook/react';
326
+
327
+ // Generated by Story UI MCP Edge
328
+ // Prompt: ${prompt}
329
+ // Framework: ${framework}
330
+ ${componentPath ? `// Component: ${componentPath}` : ''}
331
+
332
+ const meta = {
333
+ title: 'Generated/${storyId}',
334
+ parameters: {
335
+ layout: 'centered',
336
+ },
337
+ } satisfies Meta;
338
+
339
+ export default meta;
340
+ type Story = StoryObj<typeof meta>;
341
+
342
+ export const Default: Story = {
343
+ render: () => (
344
+ <div>
345
+ {/* TODO: Implement based on prompt: ${prompt} */}
346
+ <p>Story generated on Cloudflare Edge</p>
347
+ </div>
348
+ ),
349
+ };
350
+ `;
351
+ // Store story
352
+ const story = {
353
+ id: storyId,
354
+ title: `Generated Story - ${prompt.substring(0, 50)}`,
355
+ componentPath,
356
+ createdAt: Date.now(),
357
+ framework,
358
+ };
359
+ await this.state.storage.put(`story:${storyId}`, { ...story, content: storyContent });
360
+ return {
361
+ content: [{
362
+ type: 'text',
363
+ text: JSON.stringify({
364
+ success: true,
365
+ storyId,
366
+ message: 'Story generated successfully on Cloudflare Edge',
367
+ note: 'Full LLM integration pending - this is a placeholder story',
368
+ content: storyContent,
369
+ }, null, 2),
370
+ }],
371
+ };
372
+ }
373
+ /**
374
+ * List stories in this session
375
+ */
376
+ async listStories(args) {
377
+ const limit = args.limit || 50;
378
+ const stories = [];
379
+ const storageMap = await this.state.storage.list({ prefix: 'story:' });
380
+ for (const [, value] of storageMap) {
381
+ const story = value;
382
+ stories.push({
383
+ id: story.id,
384
+ title: story.title,
385
+ componentPath: story.componentPath,
386
+ createdAt: story.createdAt,
387
+ framework: story.framework,
388
+ });
389
+ if (stories.length >= limit)
390
+ break;
391
+ }
392
+ return {
393
+ content: [{
394
+ type: 'text',
395
+ text: JSON.stringify({
396
+ stories,
397
+ count: stories.length,
398
+ }, null, 2),
399
+ }],
400
+ };
401
+ }
402
+ /**
403
+ * Get a specific story
404
+ */
405
+ async getStory(args) {
406
+ const id = args.id;
407
+ const story = await this.state.storage.get(`story:${id}`);
408
+ if (!story) {
409
+ return {
410
+ content: [{ type: 'text', text: `Story not found: ${id}` }],
411
+ isError: true,
412
+ };
413
+ }
414
+ return {
415
+ content: [{
416
+ type: 'text',
417
+ text: JSON.stringify(story, null, 2),
418
+ }],
419
+ };
420
+ }
421
+ /**
422
+ * Delete a story
423
+ */
424
+ async deleteStory(args) {
425
+ const id = args.id;
426
+ const existed = await this.state.storage.get(`story:${id}`);
427
+ if (!existed) {
428
+ return {
429
+ content: [{ type: 'text', text: `Story not found: ${id}` }],
430
+ isError: true,
431
+ };
432
+ }
433
+ await this.state.storage.delete(`story:${id}`);
434
+ return {
435
+ content: [{
436
+ type: 'text',
437
+ text: JSON.stringify({
438
+ success: true,
439
+ message: `Story ${id} deleted`,
440
+ }, null, 2),
441
+ }],
442
+ };
443
+ }
444
+ /**
445
+ * Health check
446
+ */
447
+ handleHealth() {
448
+ return new Response(JSON.stringify({
449
+ status: 'ok',
450
+ service: SERVER_NAME,
451
+ version: SERVER_VERSION,
452
+ transport: 'cloudflare-edge',
453
+ activeSessions: this.sessions.size,
454
+ timestamp: new Date().toISOString(),
455
+ }), {
456
+ headers: {
457
+ 'Content-Type': 'application/json',
458
+ 'Access-Control-Allow-Origin': '*',
459
+ },
460
+ });
461
+ }
462
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Story UI MCP Edge - Type Definitions
3
+ */
4
+ export {};
@@ -0,0 +1,106 @@
1
+ /**
2
+ * Story UI MCP Edge Worker
3
+ *
4
+ * Entry point for Cloudflare Workers deployment.
5
+ * Routes requests to Durable Objects for session management.
6
+ */
7
+ // Re-export Durable Object
8
+ export { MCPSessionDO } from './mcp-session.js';
9
+ export default {
10
+ async fetch(request, env, _ctx) {
11
+ const url = new URL(request.url);
12
+ // Handle CORS preflight
13
+ if (request.method === 'OPTIONS') {
14
+ return handleCORS();
15
+ }
16
+ try {
17
+ // Route based on path
18
+ if (url.pathname === '/mcp-remote/health' || url.pathname === '/health') {
19
+ return handleHealthCheck(env);
20
+ }
21
+ if (url.pathname.startsWith('/mcp-remote/')) {
22
+ return handleMCPRequest(request, env, url);
23
+ }
24
+ // Default response
25
+ return new Response(JSON.stringify({
26
+ service: 'story-ui-mcp-edge',
27
+ version: env.STORY_UI_VERSION,
28
+ endpoints: {
29
+ health: '/mcp-remote/health',
30
+ sse: '/mcp-remote/sse',
31
+ messages: '/mcp-remote/messages',
32
+ streamable: '/mcp-remote/mcp',
33
+ },
34
+ }), {
35
+ headers: {
36
+ 'Content-Type': 'application/json',
37
+ 'Access-Control-Allow-Origin': '*',
38
+ },
39
+ });
40
+ }
41
+ catch (error) {
42
+ console.error('Worker error:', error);
43
+ return new Response(JSON.stringify({ error: 'Internal Server Error' }), {
44
+ status: 500,
45
+ headers: {
46
+ 'Content-Type': 'application/json',
47
+ 'Access-Control-Allow-Origin': '*',
48
+ }
49
+ });
50
+ }
51
+ },
52
+ };
53
+ /**
54
+ * Handle CORS preflight requests
55
+ */
56
+ function handleCORS() {
57
+ return new Response(null, {
58
+ status: 204,
59
+ headers: {
60
+ 'Access-Control-Allow-Origin': '*',
61
+ 'Access-Control-Allow-Methods': 'GET, POST, DELETE, OPTIONS',
62
+ 'Access-Control-Allow-Headers': 'Content-Type, Authorization',
63
+ 'Access-Control-Max-Age': '86400',
64
+ },
65
+ });
66
+ }
67
+ /**
68
+ * Handle health check at gateway level
69
+ */
70
+ function handleHealthCheck(env) {
71
+ const health = {
72
+ status: 'ok',
73
+ service: 'story-ui-mcp-edge',
74
+ version: env.STORY_UI_VERSION,
75
+ transport: 'cloudflare-workers',
76
+ activeSessions: 0, // Gateway doesn't track sessions
77
+ timestamp: new Date().toISOString(),
78
+ };
79
+ return new Response(JSON.stringify(health), {
80
+ headers: {
81
+ 'Content-Type': 'application/json',
82
+ 'Access-Control-Allow-Origin': '*',
83
+ },
84
+ });
85
+ }
86
+ /**
87
+ * Route MCP requests to Durable Object
88
+ */
89
+ async function handleMCPRequest(request, env, url) {
90
+ // Determine session ID for DO routing
91
+ // For SSE, use a fixed ID per client (could be from auth token)
92
+ // For messages, extract from query string
93
+ const sessionId = url.searchParams.get('sessionId') || 'default-session';
94
+ // Get Durable Object stub
95
+ const doId = env.MCP_SESSIONS.idFromName(sessionId);
96
+ const stub = env.MCP_SESSIONS.get(doId);
97
+ // Map URL path for DO
98
+ const doPath = url.pathname.replace('/mcp-remote', '');
99
+ const doUrl = new URL(doPath + url.search, 'http://internal');
100
+ // Forward request to Durable Object
101
+ return stub.fetch(new Request(doUrl.toString(), {
102
+ method: request.method,
103
+ headers: request.headers,
104
+ body: request.body,
105
+ }));
106
+ }
@@ -0,0 +1,14 @@
1
+ import { defineConfig } from 'vite';
2
+ import react from '@vitejs/plugin-react';
3
+ export default defineConfig({
4
+ plugins: [react()],
5
+ define: {
6
+ // Edge MCP URL - REQUIRED: Set via VITE_EDGE_MCP_URL environment variable
7
+ // Example: VITE_EDGE_MCP_URL=https://your-worker.your-account.workers.dev npm run build
8
+ 'import.meta.env.VITE_EDGE_MCP_URL': JSON.stringify(process.env.VITE_EDGE_MCP_URL || ''),
9
+ },
10
+ build: {
11
+ outDir: 'dist',
12
+ sourcemap: true,
13
+ },
14
+ });
@@ -0,0 +1,13 @@
1
+ export * from './story-ui.config.js';
2
+ export * from './story-ui.config.loader.js';
3
+ export * from './story-generator/componentDiscovery.js';
4
+ export * from './story-generator/promptGenerator.js';
5
+ export type { StoryUIConfig, ComponentConfig, LayoutRules } from './story-ui.config.js';
6
+ export { createStoryUIConfig, DEFAULT_CONFIG, GENERIC_CONFIG_TEMPLATE } from './story-ui.config.js';
7
+ export { configLoader, loadStoryUIConfig } from './story-ui.config.loader.js';
8
+ export { discoverComponents, discoverComponentsFromDirectory, discoverComponentsFromCustomElements, discoverComponentsFromPackage } from './story-generator/componentDiscovery.js';
9
+ export { generatePrompt, buildClaudePrompt } from './story-generator/promptGenerator.js';
10
+ export { ProductionGitignoreManager, setupProductionGitignore } from './story-generator/productionGitignoreManager.js';
11
+ export { InMemoryStoryService, getInMemoryStoryService, GeneratedStory, StoryMetadata, MemoryStats } from './story-generator/inMemoryStoryService.js';
12
+ export { StorySyncService, getStorySyncService, SyncedStory, ChatSyncResult } from './story-generator/storySync.js';
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AACA,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yCAAyC,CAAC;AACxD,cAAc,sCAAsC,CAAC;AAGrD,YAAY,EACV,aAAa,EACb,eAAe,EACf,WAAW,EACZ,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,uBAAuB,EACxB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,YAAY,EACZ,iBAAiB,EAClB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACL,kBAAkB,EAClB,+BAA+B,EAC/B,oCAAoC,EACpC,6BAA6B,EAC9B,MAAM,yCAAyC,CAAC;AAEjD,OAAO,EACL,cAAc,EACd,iBAAiB,EAClB,MAAM,sCAAsC,CAAC;AAG9C,OAAO,EACL,0BAA0B,EAC1B,wBAAwB,EACzB,MAAM,iDAAiD,CAAC;AAEzD,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,cAAc,EACd,aAAa,EACb,WAAW,EACZ,MAAM,2CAA2C,CAAC;AAEnD,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,WAAW,EACX,cAAc,EACf,MAAM,gCAAgC,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,12 @@
1
+ // Main exports for Story UI package
2
+ export * from './story-ui.config.js';
3
+ export * from './story-ui.config.loader.js';
4
+ export * from './story-generator/componentDiscovery.js';
5
+ export * from './story-generator/promptGenerator.js';
6
+ export { createStoryUIConfig, DEFAULT_CONFIG, GENERIC_CONFIG_TEMPLATE } from './story-ui.config.js';
7
+ export { configLoader, loadStoryUIConfig } from './story-ui.config.loader.js';
8
+ export { discoverComponents, discoverComponentsFromDirectory, discoverComponentsFromCustomElements, discoverComponentsFromPackage } from './story-generator/componentDiscovery.js';
9
+ export { generatePrompt, buildClaudePrompt } from './story-generator/promptGenerator.js';
10
+ export { ProductionGitignoreManager, setupProductionGitignore } from './story-generator/productionGitignoreManager.js';
11
+ export { InMemoryStoryService, getInMemoryStoryService } from './story-generator/inMemoryStoryService.js';
12
+ export { StorySyncService, getStorySyncService } from './story-generator/storySync.js';
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yCAAyC,CAAC;AACxD,cAAc,sCAAsC,CAAC;AASrD,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,uBAAuB,EACxB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,YAAY,EACZ,iBAAiB,EAClB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACL,kBAAkB,EAClB,+BAA+B,EAC/B,oCAAoC,EACpC,6BAA6B,EAC9B,MAAM,yCAAyC,CAAC;AAEjD,OAAO,EACL,cAAc,EACd,iBAAiB,EAClB,MAAM,sCAAsC,CAAC;AAG9C,OAAO,EACL,0BAA0B,EAC1B,wBAAwB,EACzB,MAAM,iDAAiD,CAAC;AAEzD,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EAIxB,MAAM,2CAA2C,CAAC;AAEnD,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EAGpB,MAAM,gCAAgC,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../mcp-server/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,0CAA0C;AAC1C,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;AAE3C,8EAA8E;AAC9E,qEAAqE;AACrE,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,E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