forgebook 0.1.2 → 0.1.4

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 (345) hide show
  1. package/README.md +94 -5
  2. package/dist/bin/forgebook/agentClient.d.ts +39 -0
  3. package/dist/bin/forgebook/agentClient.d.ts.map +1 -0
  4. package/dist/bin/forgebook/agentClient.js +91 -0
  5. package/dist/bin/forgebook/agentClient.js.map +1 -0
  6. package/dist/bin/forgebook/agentLoopCommands.d.mts +9 -0
  7. package/dist/bin/forgebook/agentLoopCommands.d.mts.map +1 -0
  8. package/dist/bin/forgebook/agentLoopCommands.mjs +217 -0
  9. package/dist/bin/forgebook/agentLoopCommands.mjs.map +1 -0
  10. package/dist/bin/forgebook/agentText.d.ts +54 -0
  11. package/dist/bin/forgebook/agentText.d.ts.map +1 -0
  12. package/dist/bin/forgebook/agentText.js +91 -0
  13. package/dist/bin/forgebook/agentText.js.map +1 -0
  14. package/dist/bin/forgebook/agents.md +46 -0
  15. package/dist/bin/forgebook/agentsText.d.ts +29 -0
  16. package/dist/bin/forgebook/agentsText.d.ts.map +1 -0
  17. package/dist/bin/forgebook/agentsText.js +48 -0
  18. package/dist/bin/forgebook/agentsText.js.map +1 -0
  19. package/dist/bin/forgebook/catalogueCommands.d.ts +51 -0
  20. package/dist/bin/forgebook/catalogueCommands.d.ts.map +1 -0
  21. package/dist/bin/forgebook/catalogueCommands.js +90 -0
  22. package/dist/bin/forgebook/catalogueCommands.js.map +1 -0
  23. package/dist/bin/forgebook/errorsRun.d.ts +27 -0
  24. package/dist/bin/forgebook/errorsRun.d.ts.map +1 -0
  25. package/dist/bin/forgebook/errorsRun.js +60 -0
  26. package/dist/bin/forgebook/errorsRun.js.map +1 -0
  27. package/dist/bin/forgebook/forgebook.mjs +283 -79
  28. package/dist/bin/forgebook/forgebook.mjs.map +1 -1
  29. package/dist/bin/forgebook/importers/storybook.d.ts +53 -0
  30. package/dist/bin/forgebook/importers/storybook.d.ts.map +1 -0
  31. package/dist/bin/forgebook/importers/storybook.js +318 -0
  32. package/dist/bin/forgebook/importers/storybook.js.map +1 -0
  33. package/dist/bin/forgebook/initCommands.d.mts +9 -0
  34. package/dist/bin/forgebook/initCommands.d.mts.map +1 -0
  35. package/dist/bin/forgebook/initCommands.mjs +86 -0
  36. package/dist/bin/forgebook/initCommands.mjs.map +1 -0
  37. package/dist/bin/forgebook/initConfig.d.ts +22 -0
  38. package/dist/bin/forgebook/initConfig.d.ts.map +1 -0
  39. package/dist/bin/forgebook/initConfig.js +51 -0
  40. package/dist/bin/forgebook/initConfig.js.map +1 -0
  41. package/dist/bin/forgebook/mcpTools.d.ts +38 -0
  42. package/dist/bin/forgebook/mcpTools.d.ts.map +1 -0
  43. package/dist/bin/forgebook/mcpTools.js +212 -0
  44. package/dist/bin/forgebook/mcpTools.js.map +1 -0
  45. package/dist/bin/forgebook/newStories.d.ts +27 -0
  46. package/dist/bin/forgebook/newStories.d.ts.map +1 -0
  47. package/dist/bin/forgebook/newStories.js +109 -0
  48. package/dist/bin/forgebook/newStories.js.map +1 -0
  49. package/dist/bin/forgebook/newStoriesFile.d.ts +18 -0
  50. package/dist/bin/forgebook/newStoriesFile.d.ts.map +1 -0
  51. package/dist/bin/forgebook/newStoriesFile.js +58 -0
  52. package/dist/bin/forgebook/newStoriesFile.js.map +1 -0
  53. package/dist/bin/forgebook/storyCheckRun.d.ts +39 -0
  54. package/dist/bin/forgebook/storyCheckRun.d.ts.map +1 -0
  55. package/dist/bin/forgebook/storyCheckRun.js +177 -0
  56. package/dist/bin/forgebook/storyCheckRun.js.map +1 -0
  57. package/dist/bin/forgebook-docs/catalogueDocs.d.ts +24 -0
  58. package/dist/bin/forgebook-docs/catalogueDocs.d.ts.map +1 -0
  59. package/dist/bin/forgebook-docs/catalogueDocs.js +71 -0
  60. package/dist/bin/forgebook-docs/catalogueDocs.js.map +1 -0
  61. package/dist/bin/forgebook-docs/catalogueDocs.types.d.ts +8 -0
  62. package/dist/bin/forgebook-docs/catalogueDocs.types.d.ts.map +1 -1
  63. package/dist/bin/forgebook-docs/catalogueMarkdown.d.ts +3 -1
  64. package/dist/bin/forgebook-docs/catalogueMarkdown.d.ts.map +1 -1
  65. package/dist/bin/forgebook-docs/catalogueMarkdown.js +62 -42
  66. package/dist/bin/forgebook-docs/catalogueMarkdown.js.map +1 -1
  67. package/dist/bin/forgebook-docs/catalogueOptions.d.ts +39 -0
  68. package/dist/bin/forgebook-docs/catalogueOptions.d.ts.map +1 -0
  69. package/dist/bin/forgebook-docs/catalogueOptions.js +76 -0
  70. package/dist/bin/forgebook-docs/catalogueOptions.js.map +1 -0
  71. package/dist/bin/forgebook-docs/collectDocs.d.ts +3 -1
  72. package/dist/bin/forgebook-docs/collectDocs.d.ts.map +1 -1
  73. package/dist/bin/forgebook-docs/collectDocs.js +37 -13
  74. package/dist/bin/forgebook-docs/collectDocs.js.map +1 -1
  75. package/dist/bin/forgebook-docs/forgebook-docs.mjs +17 -80
  76. package/dist/bin/forgebook-docs/forgebook-docs.mjs.map +1 -1
  77. package/dist/bin/forgebook-docs/llmsText.d.ts +24 -0
  78. package/dist/bin/forgebook-docs/llmsText.d.ts.map +1 -0
  79. package/dist/bin/forgebook-docs/llmsText.js +33 -0
  80. package/dist/bin/forgebook-docs/llmsText.js.map +1 -0
  81. package/dist/bin/forgebook-docs/sourceId.d.ts +9 -0
  82. package/dist/bin/forgebook-docs/sourceId.d.ts.map +1 -0
  83. package/dist/bin/forgebook-docs/sourceId.js +45 -0
  84. package/dist/bin/forgebook-docs/sourceId.js.map +1 -0
  85. package/dist/bin/frameworkDocs.d.ts +10 -0
  86. package/dist/bin/frameworkDocs.d.ts.map +1 -0
  87. package/dist/bin/frameworkDocs.js +43 -0
  88. package/dist/bin/frameworkDocs.js.map +1 -0
  89. package/dist/src/argTypes.d.ts +23 -0
  90. package/dist/src/argTypes.d.ts.map +1 -1
  91. package/dist/src/argTypes.js +27 -0
  92. package/dist/src/argTypes.js.map +1 -1
  93. package/dist/src/catalogue.d.ts +70 -3
  94. package/dist/src/catalogue.d.ts.map +1 -1
  95. package/dist/src/catalogue.js +85 -3
  96. package/dist/src/catalogue.js.map +1 -1
  97. package/dist/src/controlKeys.d.ts +85 -0
  98. package/dist/src/controlKeys.d.ts.map +1 -0
  99. package/dist/src/controlKeys.js +118 -0
  100. package/dist/src/controlKeys.js.map +1 -0
  101. package/dist/src/frame/frame.css +33 -2
  102. package/dist/src/frame/frameView.d.ts +2 -2
  103. package/dist/src/frame/frameView.d.ts.map +1 -1
  104. package/dist/src/frame/frameView.js +7 -3
  105. package/dist/src/frame/frameView.js.map +1 -1
  106. package/dist/src/frame/mountFrame.d.ts.map +1 -1
  107. package/dist/src/frame/mountFrame.js +26 -2
  108. package/dist/src/frame/mountFrame.js.map +1 -1
  109. package/dist/src/frame/spillOutline.d.ts +10 -0
  110. package/dist/src/frame/spillOutline.d.ts.map +1 -0
  111. package/dist/src/frame/spillOutline.js +80 -0
  112. package/dist/src/frame/spillOutline.js.map +1 -0
  113. package/dist/src/liveErrors.d.ts +57 -0
  114. package/dist/src/liveErrors.d.ts.map +1 -0
  115. package/dist/src/liveErrors.js +52 -0
  116. package/dist/src/liveErrors.js.map +1 -0
  117. package/dist/src/messages.d.ts +12 -0
  118. package/dist/src/messages.d.ts.map +1 -1
  119. package/dist/src/messages.js +4 -0
  120. package/dist/src/messages.js.map +1 -1
  121. package/dist/src/namedViews.d.ts +80 -0
  122. package/dist/src/namedViews.d.ts.map +1 -0
  123. package/dist/src/namedViews.js +88 -0
  124. package/dist/src/namedViews.js.map +1 -0
  125. package/dist/src/shell/AppearanceMenu.d.ts +15 -0
  126. package/dist/src/shell/AppearanceMenu.d.ts.map +1 -0
  127. package/dist/src/shell/AppearanceMenu.js +28 -0
  128. package/dist/src/shell/AppearanceMenu.js.map +1 -0
  129. package/dist/src/shell/BoxWidth.d.ts +40 -0
  130. package/dist/src/shell/BoxWidth.d.ts.map +1 -0
  131. package/dist/src/shell/BoxWidth.js +56 -0
  132. package/dist/src/shell/BoxWidth.js.map +1 -0
  133. package/dist/src/shell/ComponentPage.d.ts +17 -1
  134. package/dist/src/shell/ComponentPage.d.ts.map +1 -1
  135. package/dist/src/shell/ComponentPage.js +19 -54
  136. package/dist/src/shell/ComponentPage.js.map +1 -1
  137. package/dist/src/shell/ControlKeyField.d.ts +21 -0
  138. package/dist/src/shell/ControlKeyField.d.ts.map +1 -0
  139. package/dist/src/shell/ControlKeyField.js +46 -0
  140. package/dist/src/shell/ControlKeyField.js.map +1 -0
  141. package/dist/src/shell/ControlRow.d.ts +31 -0
  142. package/dist/src/shell/ControlRow.d.ts.map +1 -0
  143. package/dist/src/shell/ControlRow.js +27 -0
  144. package/dist/src/shell/ControlRow.js.map +1 -0
  145. package/dist/src/shell/Example.d.ts +58 -0
  146. package/dist/src/shell/Example.d.ts.map +1 -0
  147. package/dist/src/shell/Example.js +89 -0
  148. package/dist/src/shell/Example.js.map +1 -0
  149. package/dist/src/shell/NamedViews.d.ts +23 -0
  150. package/dist/src/shell/NamedViews.d.ts.map +1 -0
  151. package/dist/src/shell/NamedViews.js +49 -0
  152. package/dist/src/shell/NamedViews.js.map +1 -0
  153. package/dist/src/shell/PinnedControl.d.ts +25 -0
  154. package/dist/src/shell/PinnedControl.d.ts.map +1 -0
  155. package/dist/src/shell/PinnedControl.js +81 -0
  156. package/dist/src/shell/PinnedControl.js.map +1 -0
  157. package/dist/src/shell/PropsTab.d.ts +5 -2
  158. package/dist/src/shell/PropsTab.d.ts.map +1 -1
  159. package/dist/src/shell/PropsTab.js +12 -15
  160. package/dist/src/shell/PropsTab.js.map +1 -1
  161. package/dist/src/shell/Shell.d.ts.map +1 -1
  162. package/dist/src/shell/Shell.js +27 -2
  163. package/dist/src/shell/Shell.js.map +1 -1
  164. package/dist/src/shell/Sidebar.d.ts +11 -9
  165. package/dist/src/shell/Sidebar.d.ts.map +1 -1
  166. package/dist/src/shell/Sidebar.js +48 -42
  167. package/dist/src/shell/Sidebar.js.map +1 -1
  168. package/dist/src/shell/SidebarEntries.d.ts +50 -0
  169. package/dist/src/shell/SidebarEntries.d.ts.map +1 -0
  170. package/dist/src/shell/SidebarEntries.js +51 -0
  171. package/dist/src/shell/SidebarEntries.js.map +1 -0
  172. package/dist/src/shell/Stage.d.ts.map +1 -1
  173. package/dist/src/shell/Stage.js +19 -2
  174. package/dist/src/shell/Stage.js.map +1 -1
  175. package/dist/src/shell/Toolbar.d.ts +7 -3
  176. package/dist/src/shell/Toolbar.d.ts.map +1 -1
  177. package/dist/src/shell/Toolbar.js +38 -68
  178. package/dist/src/shell/Toolbar.js.map +1 -1
  179. package/dist/src/shell/ToolbarControl.d.ts +47 -0
  180. package/dist/src/shell/ToolbarControl.d.ts.map +1 -0
  181. package/dist/src/shell/ToolbarControl.js +150 -0
  182. package/dist/src/shell/ToolbarControl.js.map +1 -0
  183. package/dist/src/shell/UsedIn.d.ts +38 -0
  184. package/dist/src/shell/UsedIn.d.ts.map +1 -0
  185. package/dist/src/shell/UsedIn.js +77 -0
  186. package/dist/src/shell/UsedIn.js.map +1 -0
  187. package/dist/src/shell/ViewMenu.d.ts +37 -0
  188. package/dist/src/shell/ViewMenu.d.ts.map +1 -0
  189. package/dist/src/shell/ViewMenu.js +216 -0
  190. package/dist/src/shell/ViewMenu.js.map +1 -0
  191. package/dist/src/shell/controlCycle.d.ts +28 -0
  192. package/dist/src/shell/controlCycle.d.ts.map +1 -0
  193. package/dist/src/shell/controlCycle.js +51 -0
  194. package/dist/src/shell/controlCycle.js.map +1 -0
  195. package/dist/src/shell/dockTabs.d.ts +3 -0
  196. package/dist/src/shell/dockTabs.d.ts.map +1 -1
  197. package/dist/src/shell/dockTabs.js +1 -1
  198. package/dist/src/shell/dockTabs.js.map +1 -1
  199. package/dist/src/shell/icons.d.ts +6 -0
  200. package/dist/src/shell/icons.d.ts.map +1 -1
  201. package/dist/src/shell/icons.js +7 -1
  202. package/dist/src/shell/icons.js.map +1 -1
  203. package/dist/src/shell/keyboard.d.ts +2 -1
  204. package/dist/src/shell/keyboard.d.ts.map +1 -1
  205. package/dist/src/shell/keyboard.js +5 -2
  206. package/dist/src/shell/keyboard.js.map +1 -1
  207. package/dist/src/shell/shell.css +826 -243
  208. package/dist/src/shell/strings.d.ts +45 -0
  209. package/dist/src/shell/strings.d.ts.map +1 -1
  210. package/dist/src/shell/strings.js +45 -0
  211. package/dist/src/shell/strings.js.map +1 -1
  212. package/dist/src/shell/useAppearance.d.ts +17 -0
  213. package/dist/src/shell/useAppearance.d.ts.map +1 -0
  214. package/dist/src/shell/useAppearance.js +36 -0
  215. package/dist/src/shell/useAppearance.js.map +1 -0
  216. package/dist/src/shell/useControlKeys.d.ts +23 -0
  217. package/dist/src/shell/useControlKeys.d.ts.map +1 -0
  218. package/dist/src/shell/useControlKeys.js +44 -0
  219. package/dist/src/shell/useControlKeys.js.map +1 -0
  220. package/dist/src/shell/useFold.d.ts +27 -0
  221. package/dist/src/shell/useFold.d.ts.map +1 -0
  222. package/dist/src/shell/useFold.js +87 -0
  223. package/dist/src/shell/useFold.js.map +1 -0
  224. package/dist/src/shell/useFrameMessages.d.ts +2 -0
  225. package/dist/src/shell/useFrameMessages.d.ts.map +1 -1
  226. package/dist/src/shell/useFrameMessages.js +3 -0
  227. package/dist/src/shell/useFrameMessages.js.map +1 -1
  228. package/dist/src/shell/useFullPage.d.ts +45 -0
  229. package/dist/src/shell/useFullPage.d.ts.map +1 -0
  230. package/dist/src/shell/useFullPage.js +149 -0
  231. package/dist/src/shell/useFullPage.js.map +1 -0
  232. package/dist/src/shell/usePopover.d.ts +17 -3
  233. package/dist/src/shell/usePopover.d.ts.map +1 -1
  234. package/dist/src/shell/usePopover.js +65 -4
  235. package/dist/src/shell/usePopover.js.map +1 -1
  236. package/dist/src/shell/useStored.d.ts +13 -2
  237. package/dist/src/shell/useStored.d.ts.map +1 -1
  238. package/dist/src/shell/useStored.js +1 -1
  239. package/dist/src/shell/useStored.js.map +1 -1
  240. package/dist/src/shell/useToolbarLayout.d.ts +39 -0
  241. package/dist/src/shell/useToolbarLayout.d.ts.map +1 -0
  242. package/dist/src/shell/useToolbarLayout.js +58 -0
  243. package/dist/src/shell/useToolbarLayout.js.map +1 -0
  244. package/dist/src/shell/useToolbarOverflow.d.ts +31 -0
  245. package/dist/src/shell/useToolbarOverflow.d.ts.map +1 -0
  246. package/dist/src/shell/useToolbarOverflow.js +62 -0
  247. package/dist/src/shell/useToolbarOverflow.js.map +1 -0
  248. package/dist/src/shell/useWorstCase.d.ts +46 -0
  249. package/dist/src/shell/useWorstCase.d.ts.map +1 -0
  250. package/dist/src/shell/useWorstCase.js +42 -0
  251. package/dist/src/shell/useWorstCase.js.map +1 -0
  252. package/dist/src/shell/worstArgs.d.ts +42 -0
  253. package/dist/src/shell/worstArgs.d.ts.map +1 -0
  254. package/dist/src/shell/worstArgs.js +47 -0
  255. package/dist/src/shell/worstArgs.js.map +1 -0
  256. package/dist/src/spills.d.ts +31 -0
  257. package/dist/src/spills.d.ts.map +1 -0
  258. package/dist/src/spills.js +65 -0
  259. package/dist/src/spills.js.map +1 -0
  260. package/dist/src/storyCheck.d.ts +105 -0
  261. package/dist/src/storyCheck.d.ts.map +1 -0
  262. package/dist/src/storyCheck.js +63 -0
  263. package/dist/src/storyCheck.js.map +1 -0
  264. package/dist/src/switches.d.ts +16 -4
  265. package/dist/src/switches.d.ts.map +1 -1
  266. package/dist/src/switches.js +30 -5
  267. package/dist/src/switches.js.map +1 -1
  268. package/dist/src/toolbarLayout.d.ts +119 -0
  269. package/dist/src/toolbarLayout.d.ts.map +1 -0
  270. package/dist/src/toolbarLayout.js +155 -0
  271. package/dist/src/toolbarLayout.js.map +1 -0
  272. package/dist/src/usedIn.d.ts +60 -0
  273. package/dist/src/usedIn.d.ts.map +1 -0
  274. package/dist/src/usedIn.js +92 -0
  275. package/dist/src/usedIn.js.map +1 -0
  276. package/dist/src/viewState.d.ts +15 -10
  277. package/dist/src/viewState.d.ts.map +1 -1
  278. package/dist/src/viewState.js +35 -18
  279. package/dist/src/viewState.js.map +1 -1
  280. package/dist/src/viewWords.d.ts +26 -0
  281. package/dist/src/viewWords.d.ts.map +1 -0
  282. package/dist/src/viewWords.js +29 -0
  283. package/dist/src/viewWords.js.map +1 -0
  284. package/dist/src/vite/adapter.d.ts +13 -4
  285. package/dist/src/vite/adapter.d.ts.map +1 -1
  286. package/dist/src/vite/adapter.js +4 -2
  287. package/dist/src/vite/adapter.js.map +1 -1
  288. package/dist/src/vite/agent.types.d.ts +120 -0
  289. package/dist/src/vite/agent.types.d.ts.map +1 -0
  290. package/dist/src/vite/agent.types.js +1 -0
  291. package/dist/src/vite/agent.types.js.map +1 -0
  292. package/dist/src/vite/agentApi.d.ts +106 -0
  293. package/dist/src/vite/agentApi.d.ts.map +1 -0
  294. package/dist/src/vite/agentApi.js +216 -0
  295. package/dist/src/vite/agentApi.js.map +1 -0
  296. package/dist/src/vite/agentRoutes.d.ts +50 -0
  297. package/dist/src/vite/agentRoutes.d.ts.map +1 -0
  298. package/dist/src/vite/agentRoutes.js +155 -0
  299. package/dist/src/vite/agentRoutes.js.map +1 -0
  300. package/dist/src/vite/configFile.d.ts +2 -1
  301. package/dist/src/vite/configFile.d.ts.map +1 -1
  302. package/dist/src/vite/configFile.js +29 -11
  303. package/dist/src/vite/configFile.js.map +1 -1
  304. package/dist/src/vite/docsExtractor.d.ts +26 -2
  305. package/dist/src/vite/docsExtractor.d.ts.map +1 -1
  306. package/dist/src/vite/docsExtractor.js +12 -9
  307. package/dist/src/vite/docsExtractor.js.map +1 -1
  308. package/dist/src/vite/docsWorker.js +18 -2
  309. package/dist/src/vite/docsWorker.js.map +1 -1
  310. package/dist/src/vite/forgebookPlugin.d.ts.map +1 -1
  311. package/dist/src/vite/forgebookPlugin.js +116 -16
  312. package/dist/src/vite/forgebookPlugin.js.map +1 -1
  313. package/dist/src/vite/indexStoryFile.d.ts +14 -0
  314. package/dist/src/vite/indexStoryFile.d.ts.map +1 -1
  315. package/dist/src/vite/indexStoryFile.js +13 -4
  316. package/dist/src/vite/indexStoryFile.js.map +1 -1
  317. package/dist/src/vite/mcpProtocol.d.ts +82 -0
  318. package/dist/src/vite/mcpProtocol.d.ts.map +1 -0
  319. package/dist/src/vite/mcpProtocol.js +184 -0
  320. package/dist/src/vite/mcpProtocol.js.map +1 -0
  321. package/dist/src/vite/pages.d.ts +12 -0
  322. package/dist/src/vite/pages.d.ts.map +1 -1
  323. package/dist/src/vite/pages.js +21 -0
  324. package/dist/src/vite/pages.js.map +1 -1
  325. package/dist/src/vite/storyFilesModule.d.ts +28 -1
  326. package/dist/src/vite/storyFilesModule.d.ts.map +1 -1
  327. package/dist/src/vite/storyFilesModule.js +34 -14
  328. package/dist/src/vite/storyFilesModule.js.map +1 -1
  329. package/dist/src/vite/usageGraph.d.ts +45 -0
  330. package/dist/src/vite/usageGraph.d.ts.map +1 -0
  331. package/dist/src/vite/usageGraph.js +246 -0
  332. package/dist/src/vite/usageGraph.js.map +1 -0
  333. package/dist/src/vite/usageModule.d.ts +33 -0
  334. package/dist/src/vite/usageModule.d.ts.map +1 -0
  335. package/dist/src/vite/usageModule.js +135 -0
  336. package/dist/src/vite/usageModule.js.map +1 -0
  337. package/dist/src/worstCase.d.ts +16 -0
  338. package/dist/src/worstCase.d.ts.map +1 -0
  339. package/dist/src/worstCase.js +16 -0
  340. package/dist/src/worstCase.js.map +1 -0
  341. package/package.json +18 -2
  342. package/dist/src/shell/SchemeSwitches.d.ts +0 -24
  343. package/dist/src/shell/SchemeSwitches.d.ts.map +0 -1
  344. package/dist/src/shell/SchemeSwitches.js +0 -36
  345. package/dist/src/shell/SchemeSwitches.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"viewState.js","sourceRoot":"","sources":["../../src/viewState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EAAE,aAAa,EAAE,cAAc,EAAmB,MAAM,eAAe,CAAC;AAS/E,gDAAgD;AAChD,MAAM,CAAC,MAA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AAe,CAAC,MAAM,CAAC,CAAC;IAC3C,KAAK,MAAM,IAAI,IAAI,gBAAgB;QAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACzD,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACvB,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IACxB,OAAO,GAAG,QAAQ,IAAI,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC;AAC5C,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,OAAe,EAAE,EAAU,EAAE,MAAc,EAAU,EAAE;IACpF,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC;IAC3C,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IAC3B,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACvB,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IACxB,OAAO,GAAG,OAAO,IAAI,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC;AAC3C,CAAC,CAAC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * A view written the short way, as words (`dark it 360`), turned into the address's form (`theme=dark&lang=it&width=360`),
3
+ * for `forgebook check`, `forgebook shot` and their MCP tools.
4
+ *
5
+ * @remarks
6
+ * A word is a value of exactly one of the catalogue's switches, or a number, the story's width. The words are
7
+ * separated by spaces or `+` (a comma would split the option into several views). A view that already holds `=` is the
8
+ * address's form and is kept as it is. A word no switch has, or one two switches share, is refused with what to write
9
+ * instead. Pure.
10
+ *
11
+ * @module
12
+ */
13
+ import type { ViewSwitch } from "./switches.ts";
14
+ /**
15
+ * A view in the address's form.
16
+ *
17
+ * @param text - the view: the address's form, or words.
18
+ * @param switches - the catalogue's switches.
19
+ * @returns the address's form, or why a word cannot be read.
20
+ */
21
+ export declare const viewQuery: (text: string, switches: readonly ViewSwitch[]) => {
22
+ readonly query: string;
23
+ } | {
24
+ readonly error: string;
25
+ };
26
+ //# sourceMappingURL=viewWords.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"viewWords.d.ts","sourceRoot":"","sources":["../../src/viewWords.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,GACpB,MAAM,MAAM,EACZ,UAAU,SAAS,UAAU,EAAE,KAC9B;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAkBvD,CAAC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * A view in the address's form.
3
+ *
4
+ * @param text - the view: the address's form, or words.
5
+ * @param switches - the catalogue's switches.
6
+ * @returns the address's form, or why a word cannot be read.
7
+ */
8
+ export const viewQuery = (text, switches) => {
9
+ if (text.includes("="))
10
+ return { query: text };
11
+ const parts = [];
12
+ for (const word of text.split(/[\s+]+/).filter((each) => each !== "")) {
13
+ if (/^\d+$/.test(word)) {
14
+ parts.push(`width=${word}`);
15
+ continue;
16
+ }
17
+ const owners = switches.filter((each) => each.values.some((value) => value.value === word));
18
+ const [owner] = owners;
19
+ if (owner === undefined)
20
+ return { error: `No switch has the value "${word}"` };
21
+ if (owners.length > 1)
22
+ return {
23
+ error: `"${word}" is a value of ${owners.map((each) => each.id).join(" and ")}: write ${owner.id}=${word}`
24
+ };
25
+ parts.push(`${owner.id}=${word}`);
26
+ }
27
+ return { query: parts.join("&") };
28
+ };
29
+ //# sourceMappingURL=viewWords.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"viewWords.js","sourceRoot":"","sources":["../../src/viewWords.ts"],"names":[],"mappings":"AAcA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CACvB,IAAY,EACZ,QAA+B,E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@ -59,12 +59,21 @@ export type FrameworkAdapter = {
59
59
  /** The Vite plugins the framework needs in a catalogue (React's Fast Refresh); none by default. */
60
60
  readonly vitePlugins?: () => Promise<readonly PluginOption[]>;
61
61
  };
62
+ /** Reads the component a file exports (`forgebook new`): the export named, or the file's only component. */
63
+ export type ExtractFileComponent = (file: string, exportName?: string) => StoryComponentResult;
64
+ /** A framework's docs module, as the plugin and the commands load it. */
65
+ export type DocsModule = {
66
+ /** Reads a story file's component. */
67
+ readonly extractStoryComponent: ExtractStoryComponent;
68
+ /** Reads a component a file exports; none in a framework package that does not offer it yet. */
69
+ readonly extractFileComponent?: ExtractFileComponent;
70
+ /** The module a story file imports its types from (`@forgebook/react`); none when not given. */
71
+ readonly storyTypesModule?: string;
72
+ };
62
73
  /**
63
- * Whether a loaded module is a docs module: it exports an `extractStoryComponent` function.
74
+ * Whether a module is a framework's docs module.
64
75
  *
65
76
  * @param module - the module, as `import()` gave it.
66
77
  */
67
- export declare const isDocsModule: (module: unknown) => module is {
68
- readonly extractStoryComponent: ExtractStoryComponent;
69
- };
78
+ export declare const isDocsModule: (module: unknown) => module is DocsModule;
70
79
  //# sourceMappingURL=adapter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/vite/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAEzC,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE1E,wEAAwE;AACxE,MAAM,MAAM,cAAc,GAAG;IAC3B,4BAA4B;IAC5B,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,sDAAsD;IACtD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC,CAAC;AAEF,uHAAuH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,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,YAAY,GAAI,QAAQ,OAAO,KAAG,MAAM,IAAI,UAMyB,CAAC"}
@@ -11,12 +11,14 @@
11
11
  * @module
12
12
  */
13
13
  /**
14
- * Whether a loaded module is a docs module: it exports an `extractStoryComponent` function.
14
+ * Whether a module is a framework's docs module.
15
15
  *
16
16
  * @param module - the module, as `import()` gave it.
17
17
  */
18
18
  export const isDocsModule = (module) => typeof module === "object" &&
19
19
  module !== null &&
20
20
  "extractStoryComponent" in module &&
21
- typeof module.extractStoryComponent === "function";
21
+ typeof module.extractStoryComponent === "function" &&
22
+ (!("extractFileComponent" in module) || typeof module.extractFileComponent === "function") &&
23
+ (!("storyTypesModule" in module) || typeof module.storyTypesModule === "string");
22
24
  //# sourceMappingURL=adapter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../../src/vite/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAuDH;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAC1B,MAAe,EACsD,EAAE,CACvE,OAAO,MAAM,KAAK,QAAQ;IAC1B,MAAM,KAAK,IAAI;IACf,uBAAuB,IAAI,MAAM;IACjC,OAAO,MAAM,CAAC,qBAAqB,KAAK,UAAU,CAAC"}
1
+ {"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../../src/vite/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAoEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAAe,EAAwB,EAAE,CACpE,OAAO,MAAM,KAAK,QAAQ;IAC1B,MAAM,KAAK,IAAI;IACf,uBAAuB,IAAI,MAAM;IACjC,OAAO,MAAM,CAAC,qBAAqB,KAAK,UAAU;IAClD,CAAC,CAAC,CAAC,sBAAsB,IAAI,MAAM,CAAC,IAAI,OAAO,MAAM,CAAC,oBAAoB,KAAK,UAAU,CAAC;IAC1F,CAAC,CAAC,CAAC,kBAAkB,IAAI,MAAM,CAAC,IAAI,OAAO,MAAM,CAAC,gBAAgB,KAAK,QAAQ,CAAC,CAAC"}
@@ -0,0 +1,120 @@
1
+ /**
2
+ * The documents the catalogue answers tools and agents with: the stories a catalogue has, and one story in detail.
3
+ * The dev server makes them (`/__forgebook/api/`), `forgebook stories` and `forgebook story` print them, and
4
+ * `forgebook mcp` hands them to an agent.
5
+ *
6
+ * @remarks
7
+ * Each document carries `schema`, so a tool can refuse a shape it does not know; a change that breaks a reader bumps
8
+ * it. Every story carries its links, so a person can open what a tool talks about in the same view.
9
+ *
10
+ * @module
11
+ */
12
+ import type { ComponentDocs } from "../componentDocs.ts";
13
+ import type { LiveError } from "../liveErrors.ts";
14
+ /** The version of the documents' shape. */
15
+ export type AgentSchema = 1;
16
+ /** Where a story opens, in the view the answer describes. */
17
+ export type StoryLinks = {
18
+ /** Its page in the catalogue (the shell, the story selected). */
19
+ readonly address: string;
20
+ /** Its frame alone: the story's own document, as the tests open it. */
21
+ readonly frame: string;
22
+ };
23
+ /** A story, as the list of stories gives it. */
24
+ export type AgentStory = {
25
+ /** `<source>:<title>--<export>` in kebab case: what `forgebook story` takes. */
26
+ readonly id: string;
27
+ /** The name the catalogue shows. */
28
+ readonly name: string;
29
+ /** The named export in the story file. */
30
+ readonly exportName: string;
31
+ /** What it shows and what to notice, from its TSDoc; none when it has none. */
32
+ readonly description: string | undefined;
33
+ /** Its tags, the meta's and its own. */
34
+ readonly tags: readonly string[];
35
+ /** Whether it is listed nowhere (`!dev`), opened only by its address. */
36
+ readonly isUnlisted: boolean;
37
+ /** The height its scene declares (`parameters.height`), in CSS px, when it declares one. */
38
+ readonly height?: number;
39
+ /** Where it opens. */
40
+ readonly links: StoryLinks;
41
+ };
42
+ /** A component whose stories use another ("Used in"). */
43
+ export type AgentUsingComponent = {
44
+ /** Its id, as `AgentComponent.id`. */
45
+ readonly id: string;
46
+ /** Its title. */
47
+ readonly title: string;
48
+ /** Whether one of its stories renders the component itself, not only through another component. */
49
+ readonly isDirect: boolean;
50
+ /** The ids of its stories that use the component. */
51
+ readonly stories: readonly string[];
52
+ };
53
+ /** A component (a story file) and its stories. */
54
+ export type AgentComponent = {
55
+ /** `<source>:<title>` in kebab case. */
56
+ readonly id: string;
57
+ /** Its whole title (`Inputs/Selection/Select`). */
58
+ readonly title: string;
59
+ /** The id of the source it belongs to. */
60
+ readonly source: string;
61
+ /** The story file, relative to the module that declares the source. */
62
+ readonly file: string;
63
+ /** Its stories: the listed ones in the catalogue's order, then the unlisted ones. */
64
+ readonly stories: readonly AgentStory[];
65
+ /**
66
+ * The other components of its source whose stories use it, direct users first; only when asked for (it reads the
67
+ * package's import graph) and the catalogue offers it.
68
+ */
69
+ readonly usedIn?: readonly AgentUsingComponent[];
70
+ };
71
+ /** A source of stories: a package's, or the project's own. */
72
+ export type AgentSource = {
73
+ /** Its id, the first part of its stories' ids. */
74
+ readonly id: string;
75
+ /** The name the catalogue shows. */
76
+ readonly name: string;
77
+ };
78
+ /** The stories a catalogue has, and what is wrong in their indexes. */
79
+ export type StoriesDocument = {
80
+ /** The shape's version. */
81
+ readonly schema: AgentSchema;
82
+ /** The catalogue's name. */
83
+ readonly title: string;
84
+ /** Its sources, in the catalogue's order. */
85
+ readonly sources: readonly AgentSource[];
86
+ /** Every component with its stories, in the catalogue's order. */
87
+ readonly components: readonly AgentComponent[];
88
+ /** One message per problem the index found (a title without a family, two files with the same title). */
89
+ readonly problems: readonly string[];
90
+ };
91
+ /** One story in detail: what an agent needs to use it or to write the next one. */
92
+ export type StoryDocument = {
93
+ /** The shape's version. */
94
+ readonly schema: AgentSchema;
95
+ /** The story, with its links in the view asked for. */
96
+ readonly story: AgentStory;
97
+ /** Its component's id and title, and its "Used in" when the catalogue offers it. */
98
+ readonly component: Pick<AgentComponent, "id" | "title" | "source" | "file" | "usedIn">;
99
+ /**
100
+ * The component's docs as the props panel reads them (its props, their types, defaults and TSDoc); none when the
101
+ * story file names no component, or its docs could not be read (the reason is then in `problems`).
102
+ */
103
+ readonly docs: ComponentDocs | undefined;
104
+ /** The story's args once its module ran, the meta's under its own; only what can be written as JSON. */
105
+ readonly args: Readonly<Record<string, unknown>>;
106
+ /** What went wrong while reading it: its module failing to load, its docs failing to be read. */
107
+ readonly problems: readonly string[];
108
+ };
109
+ /** What the open frames reported while someone edited, and the story index's problems. */
110
+ export type ErrorsDocument = {
111
+ /** The shape's version. */
112
+ readonly schema: AgentSchema;
113
+ /** The errors after the number asked for, oldest first: render errors and failed plays. */
114
+ readonly errors: readonly LiveError[];
115
+ /** The number of the last error so far: ask for the errors since it next time. */
116
+ readonly last: number;
117
+ /** The story index's problems now (a broken story file, a title taken twice). */
118
+ readonly problems: readonly string[];
119
+ };
120
+ //# sourceMappingURL=agent.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent.types.d.ts","sourceRoot":"","sources":["../../../src/vite/agent.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,2CAA2C;AAC3C,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC;AAE5B,6DAA6D;AAC7D,MAAM,MAAM,UAAU,GAAG;IACvB,iEAAiE;IACjE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,uEAAuE;IACvE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,gDAAgD;AAChD,MAAM,MAAM,UAAU,GAAG;IACvB,gFAAgF;IAChF,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,oCAAoC;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,0CAA0C;IAC1C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,+EAA+E;IAC/E,QAAQ,CAAC,WAAW,EAAE,MAA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CAAC"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=agent.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent.types.js","sourceRoot":"","sources":["../../../src/vite/agent.types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,106 @@
1
+ /**
2
+ * The documents the catalogue answers tools and agents with, made from what the pages use: the story tree, a story's
3
+ * module as the frame reads it, its component's docs as the props panel reads them. Pure: values in, documents out;
4
+ * the dev server loads the modules and hands them here.
5
+ *
6
+ * @module
7
+ */
8
+ import { type LoadedPreview } from "../frame/storyModule.ts";
9
+ import { type StoryLocation, type StoryTree } from "../storyTree.ts";
10
+ import type { UsageIndex } from "../usedIn.ts";
11
+ import type { ErrorsDocument, StoriesDocument, StoryDocument, StoryLinks } from "./agent.types.ts";
12
+ /** Where the catalogue is served, for the links: its page and its frame page. */
13
+ export type CataloguePages = {
14
+ /** The catalogue's page (`http://localhost:5173/`). */
15
+ readonly page: string;
16
+ /** The frame page (`http://localhost:5173/frame.html`). */
17
+ readonly frame: string;
18
+ };
19
+ /**
20
+ * A story's links in a view.
21
+ *
22
+ * @param pages - where the catalogue is served.
23
+ * @param id - the story's id.
24
+ * @param view - the view's query (`theme=dark&lang=it`); empty for the default view.
25
+ */
26
+ export declare const storyLinks: (pages: CataloguePages, id: string, view: string) => StoryLinks;
27
+ /**
28
+ * The stories a catalogue has.
29
+ *
30
+ * @param title - the catalogue's name.
31
+ * @param tree - its story tree.
32
+ * @param pages - where it is served, for the links.
33
+ * @param view - the view the links open in; empty for the default view.
34
+ * @param usage - each source's "Used in", by source id, when asked for.
35
+ */
36
+ export declare const storiesDocument: (title: string, tree: StoryTree, pages: CataloguePages, view: string, usage?: ReadonlyMap<string, UsageIndex>) => StoriesDocument;
37
+ /**
38
+ * A value as JSON keeps it: functions, symbols, `undefined` and cycles dropped, so a story's args can be printed
39
+ * whatever a story passes (an `fn()` spy, a React element is an object and stays as its JSON).
40
+ *
41
+ * @param value - any value.
42
+ */
43
+ export declare const jsonValue: (value: unknown) => unknown;
44
+ /** What the dev server loaded for one story, for `storyDocument`. */
45
+ export type LoadedStoryParts = {
46
+ /** The story file's module, or why it failed to load. */
47
+ readonly module: {
48
+ readonly value: unknown;
49
+ } | {
50
+ readonly error: string;
51
+ };
52
+ /** What the docs loader gave, or why it failed. */
53
+ readonly docs: {
54
+ readonly value: unknown;
55
+ } | {
56
+ readonly error: string;
57
+ };
58
+ /** The catalogue's previews merged, whose args are under every story's. */
59
+ readonly preview?: LoadedPreview;
60
+ };
61
+ /**
62
+ * One story in detail.
63
+ *
64
+ * @param location - the story's place in the tree.
65
+ * @param parts - its module and its docs, as the dev server loaded them.
66
+ * @param pages - where the catalogue is served, for the links.
67
+ * @param view - the view the links open in; empty for the default view.
68
+ * @param usage - the tree and the story's source's "Used in", when the catalogue offers it.
69
+ */
70
+ export declare const storyDocument: (location: StoryLocation, parts: LoadedStoryParts, pages: CataloguePages, view: string, usage?: {
71
+ readonly tree: StoryTree;
72
+ readonly index: UsageIndex;
73
+ }) => StoryDocument;
74
+ /** Which part of the catalogue a list keeps. */
75
+ export type StoriesFilter = {
76
+ /** A source's id; every source when none. */
77
+ readonly source?: string | undefined;
78
+ /** Text a component's title holds, any case (`button`); every component when none. */
79
+ readonly component?: string | undefined;
80
+ };
81
+ /**
82
+ * The stories document cut to the components a filter keeps; its sources and problems kept whole.
83
+ *
84
+ * @param document - the stories document.
85
+ * @param filter - the source and the text to keep.
86
+ */
87
+ export declare const filteredStories: (document: StoriesDocument, filter: StoriesFilter) => StoriesDocument;
88
+ /**
89
+ * Whether a value is the errors document, as a client receives it over HTTP.
90
+ *
91
+ * @param value - the answer's body.
92
+ */
93
+ export declare const isErrorsDocument: (value: unknown) => value is ErrorsDocument;
94
+ /**
95
+ * Whether a value is the stories document, as a client receives it over HTTP.
96
+ *
97
+ * @param value - the answer's body.
98
+ */
99
+ export declare const isStoriesDocument: (value: unknown) => value is StoriesDocument;
100
+ /**
101
+ * Whether a value is the story document, as a client receives it over HTTP.
102
+ *
103
+ * @param value - the answer's body.
104
+ */
105
+ export declare const isStoryDocument: (value: unknown) => value is StoryDocument;
106
+ //# sourceMappingURL=agentApi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agentApi.d.ts","sourceRoot":"","sources":["../../../src/vite/agentApi.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,KAAK,aAAa,EAAyB,MAAM,yBAAyB,CAAC;AAEpF,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,SAAS,EAEf,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,KAAK,EAIV,cAAc,EACd,eAAe,EACf,aAAa,EACb,UAAU,EACX,MAAM,kBAAkB,CAAC;AAE1B,iFAAiF;AACjF,MAAM,MAAM,cAAc,GAAG;IAC3B,uDAAuD;IACvD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,2DAA2D;IAC3D,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,GAAI,OAAO,cAAc,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,KAAG,UAG3E,CAAC;AAkEH;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,GAC1B,OAAO,MAAM,EACb,MAAM,SAAS,EACf,OAAO,cAAc,EACrB,MAAM,MAAM,EACZ,QAAQ,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,KACtC,eAoBD,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,SAAS,GAAI,OAAO,OAAO,KAAG,OAW1C,CAAC;AAMF,qEAAqE;AACrE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,yDAAyD;IACzD,QAAQ,CAAC,MAAM,EAAE;QAAE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;KAAE,GAAG;QAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1E,mDAAmD;IACnD,QAAQ,CAAC,IAAI,EAAE;QAAE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;KAAE,GAAG;QAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IACxE,2EAA2E;IAC3E,QAAQ,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC;CAClC,CAAC;AAcF;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,GACxB,UAAU,aAAa,EACvB,OAAO,gBAAgB,EACvB,OAAO,cAAc,EACrB,MAAM,MAAM,EACZ,QAAQ;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAA;CAAE,KAC/D,aAgCF,CAAC;AAEF,gDAAgD;AAChD,MAAM,MAAM,aAAa,GAAG;IAC1B,6CAA6C;IAC7C,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,sFAAsF;IACtF,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACzC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,eAAe,GAAI,UAAU,eAAe,EAAE,QAAQ,aAAa,KAAG,eAUlF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,cAkB5B,CAAC;AAEhC;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,eAI1B,CAAC;AAEnC;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,aACgD,CAAC"}
@@ -0,0 +1,216 @@
1
+ /**
2
+ * The documents the catalogue answers tools and agents with, made from what the pages use: the story tree, a story's
3
+ * module as the frame reads it, its component's docs as the props panel reads them. Pure: values in, documents out;
4
+ * the dev server loads the modules and hands them here.
5
+ *
6
+ * @module
7
+ */
8
+ import { isComponentDocs } from "../componentDocs.js";
9
+ import { NO_PREVIEW, readStory } from "../frame/storyModule.js";
10
+ import { isLiveErrorReport } from "../liveErrors.js";
11
+ import { componentId, findComponent } from "../storyTree.js";
12
+ import { frameAddressOf, storyAddressOf } from "../viewState.js";
13
+ /**
14
+ * A story's links in a view.
15
+ *
16
+ * @param pages - where the catalogue is served.
17
+ * @param id - the story's id.
18
+ * @param view - the view's query (`theme=dark&lang=it`); empty for the default view.
19
+ */
20
+ export const storyLinks = (pages, id, view) => ({
21
+ address: storyAddressOf(pages.page, id, view),
22
+ frame: frameAddressOf(pages.frame, id, view)
23
+ });
24
+ /** A story of the tree as the documents give it. */
25
+ const agentStory = (story, isUnlisted, pages, view) => ({
26
+ id: story.id,
27
+ name: story.name,
28
+ exportName: story.exportName,
29
+ description: story.description,
30
+ tags: story.tags,
31
+ isUnlisted,
32
+ ...(story.height === undefined ? {} : { height: story.height }),
33
+ links: storyLinks(pages, story.id, view)
34
+ });
35
+ /**
36
+ * A component's "Used in" as the documents give it: the users the tree still has, by their ids and their stories' ids.
37
+ *
38
+ * @param tree - the story tree.
39
+ * @param sourceId - the component's source.
40
+ * @param usage - the source's usage.
41
+ * @param title - the component's title.
42
+ */
43
+ const agentUsers = (tree, sourceId, usage, title) => (usage[title] ?? []).flatMap((user) => {
44
+ const id = componentId(sourceId, user.title);
45
+ const found = findComponent(tree, id)?.component;
46
+ if (found === undefined)
47
+ return [];
48
+ const stories = [...found.stories, ...found.unlisted]
49
+ .filter((story) => user.stories.includes(story.exportName))
50
+ .map((story) => story.id);
51
+ return [{ id, title: user.title, isDirect: user.isDirect, stories }];
52
+ });
53
+ /** A component of the tree as the documents give it, its listed stories first, its "Used in" when given. */
54
+ const agentComponent = (location, pages, view, usage) => {
55
+ const { source, component } = location;
56
+ return {
57
+ id: componentId(source.id, component.title),
58
+ title: component.title,
59
+ source: source.id,
60
+ file: component.file,
61
+ stories: [
62
+ ...component.stories.map((story) => agentStory(story, false, pages, view)),
63
+ ...component.unlisted.map((story) => agentStory(story, true, pages, view))
64
+ ],
65
+ ...(usage === undefined
66
+ ? {}
67
+ : { usedIn: agentUsers(usage.tree, source.id, usage.index, component.title) })
68
+ };
69
+ };
70
+ /**
71
+ * The stories a catalogue has.
72
+ *
73
+ * @param title - the catalogue's name.
74
+ * @param tree - its story tree.
75
+ * @param pages - where it is served, for the links.
76
+ * @param view - the view the links open in; empty for the default view.
77
+ * @param usage - each source's "Used in", by source id, when asked for.
78
+ */
79
+ export const storiesDocument = (title, tree, pages, view, usage) => ({
80
+ schema: 1,
81
+ title,
82
+ sources: tree.sources.map((source) => ({ id: source.id, name: source.name })),
83
+ components: tree.sources.flatMap((source) => source.families.flatMap((family) => family.groups.flatMap((group) => group.components.map((component) => {
84
+ const index = usage?.get(source.id);
85
+ return agentComponent({ source, family, group, component }, pages, view, index === undefined ? undefined : { tree, index });
86
+ })))),
87
+ problems: tree.problems
88
+ });
89
+ /**
90
+ * A value as JSON keeps it: functions, symbols, `undefined` and cycles dropped, so a story's args can be printed
91
+ * whatever a story passes (an `fn()` spy, a React element is an object and stays as its JSON).
92
+ *
93
+ * @param value - any value.
94
+ */
95
+ export const jsonValue = (value) => {
96
+ const seen = new WeakSet();
97
+ const text = JSON.stringify(value, (_key, item) => {
98
+ if (typeof item === "function" || typeof item === "symbol" || typeof item === "bigint")
99
+ return undefined;
100
+ if (typeof item === "object" && item !== null) {
101
+ if (seen.has(item))
102
+ return undefined;
103
+ seen.add(item);
104
+ }
105
+ return item;
106
+ });
107
+ return text === undefined ? undefined : JSON.parse(text);
108
+ };
109
+ /** Whether a value is a plain object. */
110
+ const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
111
+ /** The docs a story file's docs loader gave, as a document field, with the problem when there is one. */
112
+ const docsOf = (loaded) => {
113
+ if ("error" in loaded)
114
+ return { docs: undefined, problem: `Its component's docs failed: ${loaded.error}` };
115
+ const { value } = loaded;
116
+ if (isComponentDocs(value))
117
+ return { docs: value, problem: undefined };
118
+ if (typeof value === "object" && value !== null && "error" in value && typeof value.error === "string")
119
+ return { docs: undefined, problem: `Its component's docs failed: ${value.error}` };
120
+ return { docs: undefined, problem: undefined };
121
+ };
122
+ /**
123
+ * One story in detail.
124
+ *
125
+ * @param location - the story's place in the tree.
126
+ * @param parts - its module and its docs, as the dev server loaded them.
127
+ * @param pages - where the catalogue is served, for the links.
128
+ * @param view - the view the links open in; empty for the default view.
129
+ * @param usage - the tree and the story's source's "Used in", when the catalogue offers it.
130
+ */
131
+ export const storyDocument = (location, parts, pages, view, usage) => {
132
+ const component = agentComponent(location, pages, view, usage);
133
+ const story = component.stories.find((each) => each.id === location.story.id) ??
134
+ agentStory(location.story, false, pages, view);
135
+ const problems = [];
136
+ let args = {};
137
+ if ("error" in parts.module)
138
+ problems.push(`Its story file failed to load: ${parts.module.error}`);
139
+ else {
140
+ const read = readStory(parts.module.value, location.story.exportName, parts.preview ?? NO_PREVIEW);
141
+ if (typeof read === "string")
142
+ problems.push(read);
143
+ else {
144
+ const json = jsonValue(read.args);
145
+ if (isRecord(json))
146
+ args = json;
147
+ }
148
+ }
149
+ const { docs, problem } = docsOf(parts.docs);
150
+ if (problem !== undefined)
151
+ problems.push(problem);
152
+ return {
153
+ schema: 1,
154
+ story,
155
+ component: {
156
+ id: component.id,
157
+ title: component.title,
158
+ source: component.source,
159
+ file: component.file,
160
+ ...(component.usedIn === undefined ? {} : { usedIn: component.usedIn })
161
+ },
162
+ docs,
163
+ args,
164
+ problems
165
+ };
166
+ };
167
+ /**
168
+ * The stories document cut to the components a filter keeps; its sources and problems kept whole.
169
+ *
170
+ * @param document - the stories document.
171
+ * @param filter - the source and the text to keep.
172
+ */
173
+ export const filteredStories = (document, filter) => {
174
+ const text = filter.component?.toLowerCase();
175
+ return {
176
+ ...document,
177
+ components: document.components.filter((component) => (filter.source === undefined || component.source === filter.source) &&
178
+ (text === undefined || component.title.toLowerCase().includes(text)))
179
+ };
180
+ };
181
+ /**
182
+ * Whether a value is the errors document, as a client receives it over HTTP.
183
+ *
184
+ * @param value - the answer's body.
185
+ */
186
+ export const isErrorsDocument = (value) => typeof value === "object" &&
187
+ value !== null &&
188
+ "schema" in value &&
189
+ value.schema === 1 &&
190
+ "errors" in value &&
191
+ Array.isArray(value.errors) &&
192
+ value.errors.every((error) => isLiveErrorReport(error) &&
193
+ "n" in error &&
194
+ typeof error.n === "number" &&
195
+ "at" in error &&
196
+ typeof error.at === "string") &&
197
+ "last" in value &&
198
+ typeof value.last === "number" &&
199
+ "problems" in value &&
200
+ Array.isArray(value.problems);
201
+ /**
202
+ * Whether a value is the stories document, as a client receives it over HTTP.
203
+ *
204
+ * @param value - the answer's body.
205
+ */
206
+ export const isStoriesDocument = (value) => isRecord(value) &&
207
+ value["schema"] === 1 &&
208
+ Array.isArray(value["components"]) &&
209
+ Array.isArray(value["problems"]);
210
+ /**
211
+ * Whether a value is the story document, as a client receives it over HTTP.
212
+ *
213
+ * @param value - the answer's body.
214
+ */
215
+ export const isStoryDocument = (value) => isRecord(value) && value["schema"] === 1 && isRecord(value["story"]) && Array.isArray(value["problems"]);
216
+ //# sourceMappingURL=agentApi.js.map