forgebook 0.1.3 → 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 (339) hide show
  1. package/README.md +74 -6
  2. package/dist/bin/forgebook/agentClient.d.ts +17 -0
  3. package/dist/bin/forgebook/agentClient.d.ts.map +1 -1
  4. package/dist/bin/forgebook/agentClient.js +21 -0
  5. package/dist/bin/forgebook/agentClient.js.map +1 -1
  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 +37 -1
  11. package/dist/bin/forgebook/agentText.d.ts.map +1 -1
  12. package/dist/bin/forgebook/agentText.js +49 -2
  13. package/dist/bin/forgebook/agentText.js.map +1 -1
  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 +109 -84
  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 +29 -3
  42. package/dist/bin/forgebook/mcpTools.d.ts.map +1 -1
  43. package/dist/bin/forgebook/mcpTools.js +130 -7
  44. package/dist/bin/forgebook/mcpTools.js.map +1 -1
  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 +6 -10
  277. package/dist/src/viewState.d.ts.map +1 -1
  278. package/dist/src/viewState.js +20 -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 +32 -2
  289. package/dist/src/vite/agent.types.d.ts.map +1 -1
  290. package/dist/src/vite/agentApi.d.ts +15 -3
  291. package/dist/src/vite/agentApi.d.ts.map +1 -1
  292. package/dist/src/vite/agentApi.js +63 -9
  293. package/dist/src/vite/agentApi.js.map +1 -1
  294. package/dist/src/vite/agentRoutes.d.ts +8 -3
  295. package/dist/src/vite/agentRoutes.d.ts.map +1 -1
  296. package/dist/src/vite/agentRoutes.js +84 -23
  297. package/dist/src/vite/agentRoutes.js.map +1 -1
  298. package/dist/src/vite/configFile.d.ts +2 -1
  299. package/dist/src/vite/configFile.d.ts.map +1 -1
  300. package/dist/src/vite/configFile.js +29 -11
  301. package/dist/src/vite/configFile.js.map +1 -1
  302. package/dist/src/vite/docsExtractor.d.ts +26 -2
  303. package/dist/src/vite/docsExtractor.d.ts.map +1 -1
  304. package/dist/src/vite/docsExtractor.js +12 -9
  305. package/dist/src/vite/docsExtractor.js.map +1 -1
  306. package/dist/src/vite/docsWorker.js +18 -2
  307. package/dist/src/vite/docsWorker.js.map +1 -1
  308. package/dist/src/vite/forgebookPlugin.d.ts.map +1 -1
  309. package/dist/src/vite/forgebookPlugin.js +109 -16
  310. package/dist/src/vite/forgebookPlugin.js.map +1 -1
  311. package/dist/src/vite/indexStoryFile.d.ts +14 -0
  312. package/dist/src/vite/indexStoryFile.d.ts.map +1 -1
  313. package/dist/src/vite/indexStoryFile.js +13 -4
  314. package/dist/src/vite/indexStoryFile.js.map +1 -1
  315. package/dist/src/vite/mcpProtocol.d.ts +9 -0
  316. package/dist/src/vite/mcpProtocol.d.ts.map +1 -1
  317. package/dist/src/vite/mcpProtocol.js +6 -3
  318. package/dist/src/vite/mcpProtocol.js.map +1 -1
  319. package/dist/src/vite/storyFilesModule.d.ts +28 -1
  320. package/dist/src/vite/storyFilesModule.d.ts.map +1 -1
  321. package/dist/src/vite/storyFilesModule.js +34 -14
  322. package/dist/src/vite/storyFilesModule.js.map +1 -1
  323. package/dist/src/vite/usageGraph.d.ts +45 -0
  324. package/dist/src/vite/usageGraph.d.ts.map +1 -0
  325. package/dist/src/vite/usageGraph.js +246 -0
  326. package/dist/src/vite/usageGraph.js.map +1 -0
  327. package/dist/src/vite/usageModule.d.ts +33 -0
  328. package/dist/src/vite/usageModule.d.ts.map +1 -0
  329. package/dist/src/vite/usageModule.js +135 -0
  330. package/dist/src/vite/usageModule.js.map +1 -0
  331. package/dist/src/worstCase.d.ts +16 -0
  332. package/dist/src/worstCase.d.ts.map +1 -0
  333. package/dist/src/worstCase.js +16 -0
  334. package/dist/src/worstCase.js.map +1 -0
  335. package/package.json +14 -2
  336. package/dist/src/shell/SchemeSwitches.d.ts +0 -24
  337. package/dist/src/shell/SchemeSwitches.d.ts.map +0 -1
  338. package/dist/src/shell/SchemeSwitches.js +0 -36
  339. package/dist/src/shell/SchemeSwitches.js.map +0 -1
package/README.md CHANGED
@@ -84,23 +84,65 @@ Badge's page shows its stories, each in its own frame, and an API table read fro
84
84
  ## What a catalogue gives you
85
85
 
86
86
  - **One frame per story**, so a story's styles and globals never leak into another, and its address opens it alone.
87
- - **Switches** in the toolbar for theme, contrast and motion, and the languages you declare; a library adds its own
88
- (density, brand) through a preset.
87
+ - **Switches** for theme, contrast and motion, and the languages you declare; a library adds its own (density, brand)
88
+ through a preset. A direction switch draws every story right to left, and a language declared `dir: "rtl"` does
89
+ it by itself.
90
+ - **A toolbar each reader arranges**: whoever uses the catalogue pins the controls they use to the toolbar, orders
91
+ them and hides the rest in the View menu; their browser keeps it ([below](#the-toolbar)).
92
+ - **A light and a dark catalogue**: the reader picks Light, Dark or System at the sidebar's foot (their browser keeps
93
+ it); `appearance` in the configuration sets the default. The stories keep their own theme, from the view's switches.
94
+ - **Keys and named views**: a key cycles a control's values (`t` the theme, Shift+`t` back); the catalogue sets the
95
+ key of any control (`keys: { width: "w" }`), a reader changes theirs in the View menu. The View menu's values are
96
+ saved under a name and picked again; `views` in the configuration offers some to every reader. A dot marks each
97
+ control whose value is not its default.
89
98
  - **Widths** to draw a story at, and a **compare** view that draws the same story once per value of one or two
90
99
  switches (every theme at both contrasts), per text size or per style sheet, side by side.
91
100
  - **Props from the types**: the API table and the panel's controls come from the component's TypeScript props and
92
101
  their TSDoc, nothing written twice.
102
+ - **The worst case in one press**: the Props tab's Worst case button gives every text prop a long text with a word too
103
+ long to break and every number a huge one, kept in the address; the elements that then spill out of their parents
104
+ are outlined and counted, as the browser tests find them. Reset undoes it.
105
+ - **Examples that fill the page**: on a component's page, any story's box opens over the page, at a width of its own,
106
+ without loading its story again.
107
+ - **Used in**: a component's page lists the other components whose stories use it, directly or through another
108
+ component (Tree renders Row, Row renders DropLine), each with the stories to open; read from the types, never kept
109
+ by hand. A reader folds it away; `usedIn: false` in the configuration turns it off.
93
110
  - **Interaction states and motion**: `:hover`, `:active`, `:focus`, `:focus-visible` and `:focus-within` forced on a
94
111
  story without a pointer; motion replayed on demand.
95
112
  - **Packages as sources**: a library ships its stories (`StorySource`), and an app's catalogue lists them beside its
96
113
  own, each with its name, logo and texts.
97
- - **`CATALOG.md`** for coding agents: `forgebook-docs` writes one dense line per component, hook and helper of a
114
+ - **`CATALOG.md`** for coding agents: `forgebook docs` writes one dense line per component, hook and helper of a
98
115
  package, from its exports, their TSDoc and its stories.
99
116
  - **Tests from the stories**, with [`@forgebook/testing`](https://www.npmjs.com/package/@forgebook/testing): every
100
117
  story in the browser with axe, spills and overlays, screenshots, and every story rendered on the server.
101
118
 
102
119
  It adds about a dozen packages to a React and Vite project.
103
120
 
121
+ ## The toolbar
122
+
123
+ The View menu holds every control: the catalogue's switches, and Forgebook's own (the background, the style sheets, the
124
+ text size, the story's width). The catalogue says which start on the toolbar and which it does without; each reader
125
+ then pins, orders and hides them, and that arrangement stays in their browser, per catalogue, never in the address
126
+ (a link shares the values, not someone's toolbar).
127
+
128
+ ```ts
129
+ // forgebook.config.ts
130
+ export default defineConfig({
131
+ framework: react(),
132
+ title: "My components",
133
+ stories: ["src/**/*.stories.tsx"],
134
+ // what starts on the toolbar, in this order: a switch's id, or "backdrop", "sheets", "text", "width"
135
+ toolbar: ["theme", "contrast", "width", "text"],
136
+ // Forgebook's own controls this catalogue does without (direction: false drops the direction switch)
137
+ controls: { sheets: false }
138
+ });
139
+ ```
140
+
141
+ Without `toolbar`, the colour scheme, the contrast and the width start there. A control turned off in `controls`
142
+ shows nowhere, not even on the toolbar, and keeps its default (the width can still be dragged on the stage). A preset
143
+ may set both; the catalogue's `toolbar` wins, and a control is off when any of them turns it off. A name in `toolbar`
144
+ that is no control at all stops the catalogue with an error saying which.
145
+
104
146
  ## Coming from Storybook
105
147
 
106
148
  Forgebook reads Storybook's story files as they are: CSF 3 and CSF 2 (`Template.bind({})`), titles of any depth and
@@ -111,6 +153,13 @@ titles from the file's path, `args` and `argTypes` (with their controls), action
111
153
  It does not read MDX, doc blocks or addons. Actions are explicit only: an `on*` prop is not turned into an action by
112
154
  its name.
113
155
 
156
+ To try it on a Storybook project, run `npx forgebook init --from storybook` in the folder that holds `.storybook`. It
157
+ writes `forgebook.config.ts`: the story globs of `main` (the MDX pages left out), the preview as Forgebook's preview,
158
+ and a switch for each toolbar global of the preview, applied by code as its decorators expect. `main` is loaded, so a
159
+ computed `stories` list is read too; the preview is read from its source, so only `globalTypes` written as plain values
160
+ become switches. It reads React on Vite (`@storybook/react-vite`) only, never replaces a configuration without
161
+ `--force`, and lists what it left out.
162
+
114
163
  ## Commands
115
164
 
116
165
  | Command | What it does |
@@ -118,14 +167,24 @@ its name.
118
167
  | `forgebook dev` / `forgebook build` | Runs the catalogue of `forgebook.config.ts`, or builds it into static files |
119
168
  | `forgebook stories` | Lists every story with its id and links; fails when the story index has problems |
120
169
  | `forgebook story <id>` | One story: its args, its component's props, its links in a view (`--view theme=dark`) |
170
+ | `forgebook init --from storybook` | Writes `forgebook.config.ts` from a project's `.storybook` folder: its story globs, preview and toolbar globals |
171
+ | `forgebook new <file>` | Writes a component's first stories from its props: the main story, one per choice, the worst case |
172
+ | `forgebook check <id>` | Runs the catalogue's browser checks on a story (or a component's stories): accessibility, spills, overlays, errors; with `@forgebook/testing` |
173
+ | `forgebook errors` | Lists what the open frames reported while you edited (a story that could not be shown, a failed play); `--follow` keeps listing |
174
+ | `forgebook shot <id>` | Takes a story's pictures, one PNG per view, at the view's width and the story's height; with `@forgebook/testing` |
121
175
  | `forgebook mcp` | Serves the same answers to an agent over the Model Context Protocol |
122
- | `forgebook-docs` | Writes a package's `CATALOG.md` from its exports, their TSDoc and its stories |
176
+ | `forgebook agents` | Adds Forgebook's instructions to the project's `AGENTS.md` (and a Claude Code skill with `--skill`) |
177
+ | `forgebook docs` | Writes a package's `CATALOG.md` and `llms.txt` from its exports, their TSDoc and its stories |
123
178
  | `forgebook-texts` | Checks a package's story texts and lists what each language still has to translate |
124
179
 
125
180
  Each command prints its options with `--help`; `stories` and `story` print JSON with `--json`.
126
181
 
127
182
  ## For agents
128
183
 
184
+ `forgebook agents` gives a project's coding agents what they need without being told: how to write a story file here,
185
+ and the commands that check one, as a section of `AGENTS.md` (renewed in place when it runs again; `--skill` writes
186
+ the same as a Claude Code skill).
187
+
129
188
  A coding agent can use the catalogue while it works: find a story's id, read a story's args and its component's
130
189
  props, and hand a person the link that opens it. Add the MCP server to the project's agent configuration, for
131
190
  example `.mcp.json` for Claude Code:
@@ -134,12 +193,21 @@ example `.mcp.json` for Claude Code:
134
193
  { "mcpServers": { "forgebook": { "command": "npx", "args": ["forgebook", "mcp"] } } }
135
194
  ```
136
195
 
137
- It offers three tools: `list_stories`, `get_story` and `story_address`. Run from the catalogue's folder (or give
196
+ It offers seven tools: `list_stories`, `get_story`, `story_address`, `new_stories`, which writes a component's first stories from its props and answers the text without writing a file, `check_story`, which runs the catalogue's browser checks on a story and answers its problems (the project needs `@forgebook/testing` and Playwright for it), `recent_errors`, what the frames open in a browser reported while the agent edited (numbered: `since` gives only the new ones), and `story_shot`, a story's pictures in the answer itself, so the agent looks at what it made. `check`, `shot` and their tools take a view in the address's form (`theme=dark&width=360`) or as words (`"dark it 360"`). `get_story` also gives the components whose stories use the story's component (`usedIn`), so an agent finds a real use before writing one; `list_stories` gives it for every component when asked (`usedIn: true`, or `forgebook stories --used-in`), since it reads the package's import graph. Run from the catalogue's folder (or give
138
197
  `--config`), it uses the running `forgebook dev` when there is one, and starts a dev server of its own otherwise,
139
198
  kept while the agent's session lasts. The links name `http://localhost:5173` unless `--url` (or `FORGEBOOK_URL`) says
140
199
  where `forgebook dev` runs.
141
200
 
142
- In CI, `forgebook stories --json` fails on a broken story file (a title taken twice, a title that cannot be placed),
201
+ A library tells agents what it offers with `forgebook docs`, run in its folder: `CATALOG.md`, one dense line per
202
+ component, hook, helper and style module (what it is, how to import it, its props, the id of a story that shows it),
203
+ and `llms.txt`, which points an agent to it. The file's name, its sections and the subpaths left out are set in the
204
+ package's `package.json`:
205
+
206
+ ```json
207
+ { "forgebook": { "catalog": { "file": "CATALOG.md", "sections": ["components", "modules"], "exclude": ["./internal/*"] } } }
208
+ ```
209
+
210
+ `forgebook docs --check` fails in CI when either file is stale. In CI, `forgebook stories --json` fails on a broken story file (a title taken twice, a title that cannot be placed),
143
211
  and its JSON lists every story for a script.
144
212
 
145
213
  ## Packages
@@ -11,6 +11,23 @@ export type CatalogueClient = {
11
11
  /** Stops the server it started; nothing for a running one. */
12
12
  readonly close: () => Promise<void>;
13
13
  };
14
+ /** A catalogue a browser can open: its address, and how to let it go. */
15
+ export type ServedCatalogue = {
16
+ /** Its address (`http://localhost:5173`). */
17
+ readonly origin: string;
18
+ /** Where it was already running, or none for a server started for the command. */
19
+ readonly runningAt: string | undefined;
20
+ /** Stops the server it started; nothing for a running one. */
21
+ readonly close: () => Promise<void>;
22
+ };
23
+ /**
24
+ * The catalogue served over HTTP, for a browser to open its frames: the running dev server at the address when it
25
+ * serves this catalogue, else a dev server of its own on a free port (its answers' middleware has no address).
26
+ *
27
+ * @param config - the catalogue's configuration.
28
+ * @param url - where `forgebook dev` runs, when not at Vite's default address.
29
+ */
30
+ export declare const servedCatalogue: (config: ResolvedConfig, url: string | undefined) => Promise<ServedCatalogue>;
14
31
  /**
15
32
  * The catalogue's answers: the running dev server at the address when it serves this catalogue, a server of its own
16
33
  * otherwise.
@@ -1 +1 @@
1
- {"version":3,"file":"agentClient.d.ts","sourceRoot":"","sources":["../../../bin/forgebook/agentClient.ts"],"names":[],"mappings":"AAcA,OAAO,EAAa,KAAK,WAAW,EAA4B,MAAM,+BAA+B,CAAC;AACtG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAGnE,0EAA0E;AAC1E,eAAO,MAAM,cAAc,0BAA0B,CAAC;AAEtD,wDAAwD;AACxD,MAAM,MAAM,eAAe,GAAG;IAC5B,uEAAuE;IACvE,QAAQ,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC;IAC/E,kGAAkG;IAClG,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,8DAA8D;IAC9D,QAAQ,CAAC,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACrC,CAAC;AAiDF;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,GAC1B,QAAQ,cAAc,EACtB,KAAK,MAAM,GAAG,SAAS,KACtB,OAAO,CAAC,eAAe,CAGzB,CAAC"}
1
+ {"version":3,"file":"agentClient.d.ts","sourceRoot":"","sources":["../../../bin/forgebook/agentClient.ts"],"names":[],"mappings":"AAcA,OAAO,EAAa,KAAK,WAAW,EAA4B,MAAM,+BAA+B,CAAC;AACtG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAGnE,0EAA0E;AAC1E,eAAO,MAAM,cAAc,0BAA0B,CAAC;AAEtD,wDAAwD;AACxD,MAAM,MAAM,eAAe,GAAG;IAC5B,uEAAuE;IACvE,QAAQ,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC;IAC/E,kGAAkG;IAClG,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,8DAA8D;IAC9D,QAAQ,CAAC,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACrC,CAAC;AAiDF,yEAAyE;AACzE,MAAM,MAAM,eAAe,GAAG;IAC5B,6CAA6C;IAC7C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,kFAAkF;IAClF,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,8DAA8D;IAC9D,QAAQ,CAAC,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACrC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,GAC1B,QAAQ,cAAc,EACtB,KAAK,MAAM,GAAG,SAAS,KACtB,OAAO,CAAC,eAAe,CAczB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,GAC1B,QAAQ,cAAc,EACtB,KAAK,MAAM,GAAG,SAAS,KACtB,OAAO,CAAC,eAAe,CAGzB,CAAC"}
@@ -56,6 +56,27 @@ const ownClient = async (config, origin) => {
56
56
  close: () => server.close()
57
57
  };
58
58
  };
59
+ /**
60
+ * The catalogue served over HTTP, for a browser to open its frames: the running dev server at the address when it
61
+ * serves this catalogue, else a dev server of its own on a free port (its answers' middleware has no address).
62
+ *
63
+ * @param config - the catalogue's configuration.
64
+ * @param url - where `forgebook dev` runs, when not at Vite's default address.
65
+ */
66
+ export const servedCatalogue = async (config, url) => {
67
+ const origin = (url ?? DEFAULT_ORIGIN).replace(/\/+$/, "");
68
+ const running = await runningClient(origin, config);
69
+ if (running !== undefined)
70
+ return { origin, runningAt: origin, close: async () => undefined };
71
+ const server = await createServer(await catalogueVite(config, { server: { port: 0, host: "127.0.0.1" }, logLevel: "error" }));
72
+ await server.listen();
73
+ const address = server.resolvedUrls?.local[0]?.replace(/\/+$/, "");
74
+ if (address === undefined) {
75
+ await server.close();
76
+ throw new Error("The catalogue's dev server started with no address");
77
+ }
78
+ return { origin: address, runningAt: undefined, close: () => server.close() };
79
+ };
59
80
  /**
60
81
  * The catalogue's answers: the running dev server at the address when it serves this catalogue, a server of its own
61
82
  * otherwise.
@@ -1 +1 @@
1
- {"version":3,"file":"agentClient.js","sourceRoot":"","sources":["../../../bin/forgebook/agentClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,YAAY,EAAsB,MAAM,MAAM,CAAC;AAExD,OAAO,EAAE,SAAS,EAAoB,WAAW,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAEtG,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,0EAA0E;AAC1E,MAAM,CAAC,MAAM,cAAc,GAAG,uBAAuB,CAAC;AAYtD;;;;;;GAMG;AACH,MAAM,aAAa,GAAG,KAAK,EACzB,MAAc,EACd,MAAsB,EACgB,EAAE;IACxC,MAAM,GAAG,GAAG,KAAK,EAAE,KAAa,EAAE,MAAuB,EAAwB,EAAE;QACjF,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,MAAM,GAAG,SAAS,GAAG,KAAK,IAAI,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QACnF,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,IAAI,EA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 import { type ForgebookOptions } from "./catalogueCommands.ts";
3
+ /**
4
+ * The commands.
5
+ *
6
+ * @param forgebook - the scope of the `forgebook` command, whose options every command takes.
7
+ */
8
+ export declare const agentLoopCommands: (forgebook: CommandScope<ForgebookOptions>) => Readonly<Record<string, CommandNode>>;
9
+ //# sourceMappingURL=agentLoopCommands.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agentLoopCommands.d.mts","sourceRoot":"","sources":["../../../bin/forgebook/agentLoopCommands.mts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAQjF,OAAO,EAAqB,KAAK,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAIlF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAC5B,WAAW,YAAY,CAAC,gBAAgB,CAAC,KACxC,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAoMrC,CAAC"}
@@ -0,0 +1,217 @@
1
+ /**
2
+ * The commands of an agent's loop besides the answers: `agents` (the instructions a project's agents read), `check`
3
+ * (the catalogue's checks on a story, in a browser), `errors` (what the open frames reported while it edited), `shot`
4
+ * (a story's pictures, to look at it).
5
+ *
6
+ * @remarks
7
+ * Defined here, on the scope `forgebook.mts` hands them, so the entry stays a list of commands; their work lives in
8
+ * their own modules (`agentsText.ts`, `storyCheckRun.ts`, `errorsRun.ts`).
9
+ *
10
+ * @module
11
+ */
12
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
13
+ import { dirname, relative, resolve } from "node:path";
14
+ import { EXIT } from "@ensiria/cli-kit/constants";
15
+ import { formatJson } from "@ensiria/cli-kit/files";
16
+ import { ScriptError } from "@ensiria/cli-kit/script";
17
+ import { catalogueClient } from "./agentClient.js";
18
+ import { agentsSkill, withAgentsSection } from "./agentsText.js";
19
+ import { checkText, errorsOutput, shotText } from "./agentText.js";
20
+ import { COMMAND, configOf } from "./catalogueCommands.js";
21
+ import { askErrors, followErrors, sinceOf } from "./errorsRun.js";
22
+ import { runStoryCheck, runStoryShot } from "./storyCheckRun.js";
23
+ /**
24
+ * The commands.
25
+ *
26
+ * @param forgebook - the scope of the `forgebook` command, whose options every command takes.
27
+ */
28
+ export const agentLoopCommands = (forgebook) => ({
29
+ check: forgebook.command({
30
+ summary: "Run the catalogue's checks on a story in a browser: accessibility, spills, overlays, errors.",
31
+ json: true,
32
+ options: {
33
+ view: {
34
+ type: "string",
35
+ multiple: true,
36
+ valueName: "query",
37
+ description: "A view to check it in, as the catalogue's address writes it (theme=dark&width=360); the default view when none."
38
+ },
39
+ "all-variants": {
40
+ type: "boolean",
41
+ description: "Check every variant the catalogue's browser tests check."
42
+ },
43
+ url: {
44
+ type: "string",
45
+ env: "FORGEBOOK_URL",
46
+ valueName: "address",
47
+ description: "Where forgebook dev runs, when not at Vite's default address (http://localhost:5173)."
48
+ }
49
+ },
50
+ positionals: [
51
+ { name: "id", description: "A story's id, or a component's for its listed stories.", required: true }
52
+ ],
53
+ examples: [
54
+ {
55
+ command: `${COMMAND} check kit:inputs-select--overview`,
56
+ description: "One story, in the default view."
57
+ },
58
+ {
59
+ command: `${COMMAND} check kit:inputs-select --view "theme=dark" --json`,
60
+ description: "Every story of a component, in the dark theme, as JSON."
61
+ }
62
+ ],
63
+ run: async ({ args, options, io, isJson, style }) => {
64
+ const config = await configOf(options.config);
65
+ const report = await runStoryCheck(config, options.url, {
66
+ id: args.id,
67
+ views: options.view ?? [],
68
+ isAllVariants: options["all-variants"] === true
69
+ });
70
+ if (typeof report === "string")
71
+ throw new ScriptError(report);
72
+ io.stdout.write(isJson ? formatJson(report) : `${checkText(report, style)}\n`);
73
+ const problems = report.results.reduce((count, result) => count + result.problems.length, 0);
74
+ if (problems > 0)
75
+ throw new ScriptError(`${problems} problems`, { exitCode: EXIT.failure, isReported: true });
76
+ }
77
+ }),
78
+ errors: forgebook.command({
79
+ summary: "List what the open frames reported while you edited: stories that could not be shown, plays that failed.",
80
+ json: true,
81
+ options: {
82
+ since: {
83
+ type: "string",
84
+ valueName: "n",
85
+ description: "Only the errors after this number (the last answer's `last`)."
86
+ },
87
+ follow: { type: "boolean", description: "Keep listing new errors as they come, until stopped." },
88
+ url: {
89
+ type: "string",
90
+ env: "FORGEBOOK_URL",
91
+ valueName: "address",
92
+ description: "Where forgebook dev runs, when not at Vite's default address (http://localhost:5173)."
93
+ }
94
+ },
95
+ examples: [
96
+ {
97
+ command: `${COMMAND} errors --json`,
98
+ description: "The errors so far, and the story index's problems."
99
+ },
100
+ { command: `${COMMAND} errors --follow`, description: "New errors as you edit." }
101
+ ],
102
+ run: async ({ options, io, log, isJson, style }) => {
103
+ const config = await configOf(options.config);
104
+ const client = await catalogueClient(config, options.url);
105
+ if (client.runningAt === undefined)
106
+ log.warn("No catalogue running there: only frames open in a browser report, so there is nothing to list");
107
+ const since = sinceOf(options.since);
108
+ try {
109
+ if (options.follow === true) {
110
+ // each new error once, as it comes: one JSON line each with --json
111
+ const stopped = await followErrors(client.ask, since, (document) => io.stdout.write(errorsOutput(document, { isJson, isFollowing: true }, style)));
112
+ if (stopped !== undefined)
113
+ throw new ScriptError(stopped);
114
+ return;
115
+ }
116
+ const document = await askErrors(client.ask, since);
117
+ if (typeof document === "string")
118
+ throw new ScriptError(document);
119
+ io.stdout.write(errorsOutput(document, { isJson, isFollowing: false }, style));
120
+ for (const problem of document.problems)
121
+ log.warn(problem);
122
+ const count = document.errors.length + document.problems.length;
123
+ if (count > 0)
124
+ throw new ScriptError(`${count} errors and problems`, { exitCode: EXIT.failure, isReported: true });
125
+ }
126
+ finally {
127
+ await client.close();
128
+ }
129
+ }
130
+ }),
131
+ shot: forgebook.command({
132
+ summary: "Take a story's pictures in a browser, one PNG per view, to look at it.",
133
+ json: true,
134
+ options: {
135
+ view: {
136
+ type: "string",
137
+ multiple: true,
138
+ valueName: "view",
139
+ description: 'A view to picture it in: the address\'s form (theme=dark&width=360) or words ("dark it 360"); the default view when none.'
140
+ },
141
+ "all-variants": {
142
+ type: "boolean",
143
+ description: "Picture every variant the catalogue's browser tests check."
144
+ },
145
+ out: {
146
+ type: "string",
147
+ default: "forgebook-shots",
148
+ valueName: "folder",
149
+ description: "The folder the pictures go in."
150
+ },
151
+ url: {
152
+ type: "string",
153
+ env: "FORGEBOOK_URL",
154
+ valueName: "address",
155
+ description: "Where forgebook dev runs, when not at Vite's default address (http://localhost:5173)."
156
+ }
157
+ },
158
+ positionals: [
159
+ { name: "id", description: "A story's id, or a component's for its listed stories.", required: true }
160
+ ],
161
+ examples: [
162
+ {
163
+ command: `${COMMAND} shot kit:data-badge--default --view "dark 360"`,
164
+ description: "Dark, 360 px wide."
165
+ },
166
+ {
167
+ command: `${COMMAND} shot kit:data-badge --all-variants --json`,
168
+ description: "Every story of a component in every variant, listed as JSON."
169
+ }
170
+ ],
171
+ run: async ({ args, options, io, isJson, style }) => {
172
+ const config = await configOf(options.config);
173
+ const report = await runStoryShot(config, options.url, { id: args.id, views: options.view ?? [], isAllVariants: options["all-variants"] === true }, resolve(options.out));
174
+ if (typeof report === "string")
175
+ throw new ScriptError(report);
176
+ io.stdout.write(isJson ? formatJson(report) : `${shotText(report, (file) => relative(process.cwd(), file), style)}\n`);
177
+ }
178
+ }),
179
+ agents: forgebook.command({
180
+ summary: "Add Forgebook's instructions for coding agents to the project's AGENTS.md: how to write and check stories.",
181
+ options: {
182
+ file: {
183
+ type: "string",
184
+ default: "AGENTS.md",
185
+ valueName: "path",
186
+ description: "The file the instructions go in; its other sections are left as they are."
187
+ },
188
+ skill: {
189
+ type: "boolean",
190
+ description: "Also write them as a Claude Code skill, .claude/skills/forgebook/SKILL.md."
191
+ },
192
+ print: { type: "boolean", description: "Print the instructions instead of writing them." }
193
+ },
194
+ examples: [
195
+ { command: `${COMMAND} agents`, description: "Add or renew Forgebook's section of AGENTS.md." },
196
+ { command: `${COMMAND} agents --skill`, description: "And the Claude Code skill." }
197
+ ],
198
+ run: ({ options, io, log }) => {
199
+ const section = readFileSync(new URL("./agents.md", import.meta.url), "utf8");
200
+ if (options.print) {
201
+ io.stdout.write(section);
202
+ return;
203
+ }
204
+ const file = resolve(options.file);
205
+ const isNew = !existsSync(file);
206
+ writeFileSync(file, withAgentsSection(isNew ? undefined : readFileSync(file, "utf8"), section));
207
+ log.success(`${relative(process.cwd(), file)}: Forgebook's section ${isNew ? "written" : "renewed"}`);
208
+ if (options.skill !== true)
209
+ return;
210
+ const skill = resolve(".claude", "skills", "forgebook", "SKILL.md");
211
+ mkdirSync(dirname(skill), { recursive: true });
212
+ writeFileSync(skill, agentsSkill(section));
213
+ log.success(`${relative(process.cwd(), skill)} written`);
214
+ }
215
+ })
216
+ });
217
+ //# sourceMappingURL=agentLoopCommands.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agentLoopCommands.mjs","sourceRoot":"","sources":["../../../bin/forgebook/agentLoopCommands.mts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGvD,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAyB,MAAM,wBAAwB,CAAC;AAClF,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,gBAAgB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EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YAC/C,aAAa,CAAC,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC;YAC3C,GAAG,CAAC,OAAO,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;QAC3D,CAAC;KACF,CAAC;CACH,CAAC,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import type { OutputStyle } from "@ensiria/cli-kit/log.types";
2
- import type { StoriesDocument, StoryDocument } from "../../src/vite/agent.types.ts";
2
+ import type { StoryCheckReport, StoryShotReport } from "../../src/storyCheck.ts";
3
+ import type { ErrorsDocument, StoriesDocument, StoryDocument } from "../../src/vite/agent.types.ts";
3
4
  /**
4
5
  * The stories as a table: one row per story, its id first (what `forgebook story` takes, never cut), then its
5
6
  * component's title and its name.
@@ -15,4 +16,39 @@ export declare const storiesText: (document: StoriesDocument, style: OutputStyle
15
16
  * @param style - colours, glyphs and width.
16
17
  */
17
18
  export declare const storyText: (document: StoryDocument, style: OutputStyle) => string;
19
+ /**
20
+ * A check's report as a table: one row per problem, its story, its view and its kind; a story that passes in a view gets
21
+ * one row saying so.
22
+ *
23
+ * @param report - the check's report.
24
+ * @param style - colours, glyphs and width.
25
+ */
26
+ export declare const checkText: (report: StoryCheckReport, style: OutputStyle) => string;
27
+ /**
28
+ * The frames' errors as a table: their number, the story, what went wrong; nothing when there are none.
29
+ *
30
+ * @param document - the errors document.
31
+ * @param style - colours, glyphs and width.
32
+ */
33
+ export declare const errorsText: (document: ErrorsDocument, style: OutputStyle) => string;
34
+ /**
35
+ * What `forgebook errors` prints of an answer: its JSON (one line per error while following, so each can be read as it
36
+ * comes), or its table.
37
+ *
38
+ * @param document - the errors document.
39
+ * @param mode - whether as JSON, and whether following.
40
+ * @param style - colours, glyphs and width.
41
+ */
42
+ export declare const errorsOutput: (document: ErrorsDocument, mode: {
43
+ readonly isJson: boolean;
44
+ readonly isFollowing: boolean;
45
+ }, style: OutputStyle) => string;
46
+ /**
47
+ * The pictures taken as a table: the story, the view, the file.
48
+ *
49
+ * @param report - the picture run's report.
50
+ * @param shownFile - how a file is written for the reader (relative to where the command runs).
51
+ * @param style - colours, glyphs and width.
52
+ */
53
+ export declare const shotText: (report: StoryShotReport, shownFile: (file: string) => string, style: OutputStyle) => string;
18
54
  //# sourceMappingURL=agentText.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"agentText.d.ts","sourceRoot":"","sources":["../../../bin/forgebook/agentText.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAKpF;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,GAAI,UAAU,eAAe,EAAE,OAAO,WAAW,KAAG,MAUzE,CAAC;AAEJ;;;;;GAKG;AACH,eAAO,MAAM,SAAS,GAAI,UAAU,aAAa,EAAE,OAAO,WAAW,KAAG,MAYvE,CAAC"}
1
+ {"version":3,"file":"agentText.d.ts","sourceRoot":"","sources":["../../../bin/forgebook/agentText.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AACjF,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAKpG;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,GAAI,UAAU,eAAe,EAAE,OAAO,WAAW,KAAG,MAUzE,CAAC;AAEJ;;;;;GAKG;AACH,eAAO,MAAM,SAAS,GAAI,UAAU,aAAa,EAAE,OAAO,WAAW,KAAG,MAYvE,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,GAAI,QAAQ,gBAAgB,EAAE,OAAO,WAAW,KAAG,MAatE,CAAC;AAEJ;;;;;GAKG;AACH,eAAO,MAAM,UAAU,GAAI,UAAU,cAAc,EAAE,OAAO,WAAW,KAAG,MAOnE,CAAC;AAER;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,GACvB,UAAU,cAAc,EACxB,MAAM;IAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAA;CAAE,EACjE,OAAO,WAAW,KACjB,MAIF,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,GACnB,QAAQ,eAAe,EACvB,WAAW,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,EACnC,OAAO,WAAW,KACjB,MAKA,CAAC"}
@@ -1,12 +1,13 @@
1
1
  /**
2
- * The answers of `forgebook stories` and `forgebook story` as text for a terminal: a table of the stories, one story's
3
- * facts, and the problems. Pure: documents in, text out, laid out with cli-kit's helpers.
2
+ * The answers of `forgebook stories`, `forgebook story`, `forgebook check` and `forgebook errors` as text for a
3
+ * terminal: a table of the stories, one story's facts, a check's problems, the frames' errors, the pictures taken. Pure: documents in, text out, laid out with cli-kit's helpers.
4
4
  *
5
5
  * @remarks
6
6
  * Nothing is cut to the terminal's width: ids and links are what a reader copies, so a long line wraps instead.
7
7
  *
8
8
  * @module
9
9
  */
10
+ import { formatJson } from "@ensiria/cli-kit/files";
10
11
  import { keyValue, table } from "@ensiria/cli-kit/layout";
11
12
  /** The style with no width to fit, so no cell is cut. */
12
13
  const uncut = (style) => ({ ...style, width: Number.POSITIVE_INFINITY });
@@ -41,4 +42,50 @@ export const storyText = (document, style) => {
41
42
  entries.push(["About", document.story.description]);
42
43
  return keyValue(entries, uncut(style));
43
44
  };
45
+ /**
46
+ * A check's report as a table: one row per problem, its story, its view and its kind; a story that passes in a view gets
47
+ * one row saying so.
48
+ *
49
+ * @param report - the check's report.
50
+ * @param style - colours, glyphs and width.
51
+ */
52
+ export const checkText = (report, style) => table(report.results.flatMap((result) => result.problems.length === 0
53
+ ? [[result.storyId, result.view || "default", "passes"]]
54
+ : result.problems.map((problem) => [
55
+ result.storyId,
56
+ result.view || "default",
57
+ `${problem.kind}: ${problem.message}`
58
+ ])), { columns: [{ header: "Story" }, { header: "View", tone: "muted" }, { header: "Result" }] }, uncut(style));
59
+ /**
60
+ * The frames' errors as a table: their number, the story, what went wrong; nothing when there are none.
61
+ *
62
+ * @param document - the errors document.
63
+ * @param style - colours, glyphs and width.
64
+ */
65
+ export const errorsText = (document, style) => document.errors.length === 0
66
+ ? ""
67
+ : table(document.errors.map((error) => [String(error.n), error.storyId, `${error.kind}: ${error.message}`]), { columns: [{ header: "#", tone: "muted" }, { header: "Story" }, { header: "Error" }] }, uncut(style));
68
+ /**
69
+ * What `forgebook errors` prints of an answer: its JSON (one line per error while following, so each can be read as it
70
+ * comes), or its table.
71
+ *
72
+ * @param document - the errors document.
73
+ * @param mode - whether as JSON, and whether following.
74
+ * @param style - colours, glyphs and width.
75
+ */
76
+ export const errorsOutput = (document, mode, style) => {
77
+ if (!mode.isJson)
78
+ return `${errorsText(document, style)}\n`;
79
+ if (mode.isFollowing)
80
+ return document.errors.map((error) => `${JSON.stringify(error)}\n`).join("");
81
+ return formatJson(document);
82
+ };
83
+ /**
84
+ * The pictures taken as a table: the story, the view, the file.
85
+ *
86
+ * @param report - the picture run's report.
87
+ * @param shownFile - how a file is written for the reader (relative to where the command runs).
88
+ * @param style - colours, glyphs and width.
89
+ */
90
+ export const shotText = (report, shownFile, style) => table(report.shots.map((shot) => [shot.storyId, shot.view || "default", shownFile(shot.file)]), { columns: [{ header: "Story" }, { header: "View", tone: "muted" }, { header: "Picture" }] }, uncut(style));
44
91
  //# sourceMappingURL=agentText.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"agentText.js","sourceRoot":"","sources":["../../../bin/forgebook/agentText.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,QAAQ,EAAE,KAAK,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