@visual-check/cli 0.0.0-stage → 0.1.0

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 (790) hide show
  1. package/LICENSE +21 -0
  2. package/dist/addon-build.d.ts +3 -0
  3. package/dist/addon-build.d.ts.map +1 -0
  4. package/dist/addon-build.js +4 -0
  5. package/dist/addon-build.js.map +1 -0
  6. package/dist/addon-child/addon-child.d.ts +63 -0
  7. package/dist/addon-child/addon-child.d.ts.map +1 -0
  8. package/dist/addon-child/addon-child.js +85 -0
  9. package/dist/addon-child/addon-child.js.map +1 -0
  10. package/dist/addon-child/image-files.d.ts +11 -0
  11. package/dist/addon-child/image-files.d.ts.map +1 -0
  12. package/dist/addon-child/image-files.js +138 -0
  13. package/dist/addon-child/image-files.js.map +1 -0
  14. package/dist/addon-child/protocol.d.ts +181 -0
  15. package/dist/addon-child/protocol.d.ts.map +1 -0
  16. package/dist/addon-child/protocol.js +2 -0
  17. package/dist/addon-child/protocol.js.map +1 -0
  18. package/dist/addon-child/read-request.d.ts +7 -0
  19. package/dist/addon-child/read-request.d.ts.map +1 -0
  20. package/dist/addon-child/read-request.js +25 -0
  21. package/dist/addon-child/read-request.js.map +1 -0
  22. package/dist/addon-child.d.ts +2 -0
  23. package/dist/addon-child.d.ts.map +1 -0
  24. package/dist/addon-child.js +61 -0
  25. package/dist/addon-child.js.map +1 -0
  26. package/dist/affected-stories/affected-stories.d.ts +128 -0
  27. package/dist/affected-stories/affected-stories.d.ts.map +1 -0
  28. package/dist/affected-stories/affected-stories.js +168 -0
  29. package/dist/affected-stories/affected-stories.js.map +1 -0
  30. package/dist/affected-stories/changed-file-rules.d.ts +98 -0
  31. package/dist/affected-stories/changed-file-rules.d.ts.map +1 -0
  32. package/dist/affected-stories/changed-file-rules.js +167 -0
  33. package/dist/affected-stories/changed-file-rules.js.map +1 -0
  34. package/dist/affected-stories/fallow-graph.d.ts +67 -0
  35. package/dist/affected-stories/fallow-graph.d.ts.map +1 -0
  36. package/dist/affected-stories/fallow-graph.js +180 -0
  37. package/dist/affected-stories/fallow-graph.js.map +1 -0
  38. package/dist/affected-stories/git-changes.d.ts +57 -0
  39. package/dist/affected-stories/git-changes.d.ts.map +1 -0
  40. package/dist/affected-stories/git-changes.js +203 -0
  41. package/dist/affected-stories/git-changes.js.map +1 -0
  42. package/dist/affected-stories/group-changes.d.ts +48 -0
  43. package/dist/affected-stories/group-changes.d.ts.map +1 -0
  44. package/dist/affected-stories/group-changes.js +41 -0
  45. package/dist/affected-stories/group-changes.js.map +1 -0
  46. package/dist/affected-stories/import-graph.d.ts +33 -0
  47. package/dist/affected-stories/import-graph.d.ts.map +1 -0
  48. package/dist/affected-stories/import-graph.js +99 -0
  49. package/dist/affected-stories/import-graph.js.map +1 -0
  50. package/dist/affected-stories/limited-map.d.ts +9 -0
  51. package/dist/affected-stories/limited-map.d.ts.map +1 -0
  52. package/dist/affected-stories/limited-map.js +24 -0
  53. package/dist/affected-stories/limited-map.js.map +1 -0
  54. package/dist/affected-stories/package-folder.d.ts +8 -0
  55. package/dist/affected-stories/package-folder.d.ts.map +1 -0
  56. package/dist/affected-stories/package-folder.js +45 -0
  57. package/dist/affected-stories/package-folder.js.map +1 -0
  58. package/dist/affected-stories/storybook-rules.d.ts +153 -0
  59. package/dist/affected-stories/storybook-rules.d.ts.map +1 -0
  60. package/dist/affected-stories/storybook-rules.js +161 -0
  61. package/dist/affected-stories/storybook-rules.js.map +1 -0
  62. package/dist/affected-stories/walk-back.d.ts +16 -0
  63. package/dist/affected-stories/walk-back.d.ts.map +1 -0
  64. package/dist/affected-stories/walk-back.js +46 -0
  65. package/dist/affected-stories/walk-back.js.map +1 -0
  66. package/dist/agent-skill/install-skill.d.ts +34 -0
  67. package/dist/agent-skill/install-skill.d.ts.map +1 -0
  68. package/dist/agent-skill/install-skill.js +43 -0
  69. package/dist/agent-skill/install-skill.js.map +1 -0
  70. package/dist/agent-skill/refresh-skill.d.ts +62 -0
  71. package/dist/agent-skill/refresh-skill.d.ts.map +1 -0
  72. package/dist/agent-skill/refresh-skill.js +105 -0
  73. package/dist/agent-skill/refresh-skill.js.map +1 -0
  74. package/dist/agent-skill/setup-file.d.ts +41 -0
  75. package/dist/agent-skill/setup-file.d.ts.map +1 -0
  76. package/dist/agent-skill/setup-file.js +38 -0
  77. package/dist/agent-skill/setup-file.js.map +1 -0
  78. package/dist/agent-skill/skill-files.d.ts +19 -0
  79. package/dist/agent-skill/skill-files.d.ts.map +1 -0
  80. package/dist/agent-skill/skill-files.js +29 -0
  81. package/dist/agent-skill/skill-files.js.map +1 -0
  82. package/dist/agent-skill/skill-markdown.d.ts +31 -0
  83. package/dist/agent-skill/skill-markdown.d.ts.map +1 -0
  84. package/dist/agent-skill/skill-markdown.js +54 -0
  85. package/dist/agent-skill/skill-markdown.js.map +1 -0
  86. package/dist/baselines/baseline-clash.d.ts +31 -0
  87. package/dist/baselines/baseline-clash.d.ts.map +1 -0
  88. package/dist/baselines/baseline-clash.js +23 -0
  89. package/dist/baselines/baseline-clash.js.map +1 -0
  90. package/dist/baselines/baseline-error.d.ts +39 -0
  91. package/dist/baselines/baseline-error.d.ts.map +1 -0
  92. package/dist/baselines/baseline-error.js +42 -0
  93. package/dist/baselines/baseline-error.js.map +1 -0
  94. package/dist/baselines/baseline-files.d.ts +130 -0
  95. package/dist/baselines/baseline-files.d.ts.map +1 -0
  96. package/dist/baselines/baseline-files.js +292 -0
  97. package/dist/baselines/baseline-files.js.map +1 -0
  98. package/dist/baselines/baseline-set.d.ts +42 -0
  99. package/dist/baselines/baseline-set.d.ts.map +1 -0
  100. package/dist/baselines/baseline-set.js +104 -0
  101. package/dist/baselines/baseline-set.js.map +1 -0
  102. package/dist/bin.d.ts +3 -0
  103. package/dist/bin.d.ts.map +1 -0
  104. package/dist/bin.js +57 -0
  105. package/dist/bin.js.map +1 -0
  106. package/dist/browser/browser-package.d.ts +54 -0
  107. package/dist/browser/browser-package.d.ts.map +1 -0
  108. package/dist/browser/browser-package.js +105 -0
  109. package/dist/browser/browser-package.js.map +1 -0
  110. package/dist/browser/browser-version.d.ts +67 -0
  111. package/dist/browser/browser-version.d.ts.map +1 -0
  112. package/dist/browser/browser-version.js +61 -0
  113. package/dist/browser/browser-version.js.map +1 -0
  114. package/dist/browser/chrome-for-testing-platform.d.ts +24 -0
  115. package/dist/browser/chrome-for-testing-platform.d.ts.map +1 -0
  116. package/dist/browser/chrome-for-testing-platform.js +39 -0
  117. package/dist/browser/chrome-for-testing-platform.js.map +1 -0
  118. package/dist/browser/image-marker.d.ts +46 -0
  119. package/dist/browser/image-marker.d.ts.map +1 -0
  120. package/dist/browser/image-marker.js +81 -0
  121. package/dist/browser/image-marker.js.map +1 -0
  122. package/dist/browser/read-browser-package.d.ts +58 -0
  123. package/dist/browser/read-browser-package.d.ts.map +1 -0
  124. package/dist/browser/read-browser-package.js +130 -0
  125. package/dist/browser/read-browser-package.js.map +1 -0
  126. package/dist/browser-download/browser-download-error.d.ts +19 -0
  127. package/dist/browser-download/browser-download-error.d.ts.map +1 -0
  128. package/dist/browser-download/browser-download-error.js +21 -0
  129. package/dist/browser-download/browser-download-error.js.map +1 -0
  130. package/dist/browser-download/cache-folder.d.ts +7 -0
  131. package/dist/browser-download/cache-folder.d.ts.map +1 -0
  132. package/dist/browser-download/cache-folder.js +34 -0
  133. package/dist/browser-download/cache-folder.js.map +1 -0
  134. package/dist/browser-download/download-file.d.ts +45 -0
  135. package/dist/browser-download/download-file.d.ts.map +1 -0
  136. package/dist/browser-download/download-file.js +340 -0
  137. package/dist/browser-download/download-file.js.map +1 -0
  138. package/dist/browser-download/install-headless-shell.d.ts +96 -0
  139. package/dist/browser-download/install-headless-shell.d.ts.map +1 -0
  140. package/dist/browser-download/install-headless-shell.js +491 -0
  141. package/dist/browser-download/install-headless-shell.js.map +1 -0
  142. package/dist/browser-download/proxy.d.ts +19 -0
  143. package/dist/browser-download/proxy.d.ts.map +1 -0
  144. package/dist/browser-download/proxy.js +102 -0
  145. package/dist/browser-download/proxy.js.map +1 -0
  146. package/dist/browser-download/unzip.d.ts +11 -0
  147. package/dist/browser-download/unzip.d.ts.map +1 -0
  148. package/dist/browser-download/unzip.js +96 -0
  149. package/dist/browser-download/unzip.js.map +1 -0
  150. package/dist/browser-process/start-browser-process.d.ts +30 -0
  151. package/dist/browser-process/start-browser-process.d.ts.map +1 -0
  152. package/dist/browser-process/start-browser-process.js +131 -0
  153. package/dist/browser-process/start-browser-process.js.map +1 -0
  154. package/dist/capture/capture-session.d.ts +472 -0
  155. package/dist/capture/capture-session.d.ts.map +1 -0
  156. package/dist/capture/capture-session.js +701 -0
  157. package/dist/capture/capture-session.js.map +1 -0
  158. package/dist/capture/driver/cdp/cdp-connection.d.ts +127 -0
  159. package/dist/capture/driver/cdp/cdp-connection.d.ts.map +1 -0
  160. package/dist/capture/driver/cdp/cdp-connection.js +243 -0
  161. package/dist/capture/driver/cdp/cdp-connection.js.map +1 -0
  162. package/dist/capture/driver/cdp/cdp-driver.d.ts +42 -0
  163. package/dist/capture/driver/cdp/cdp-driver.d.ts.map +1 -0
  164. package/dist/capture/driver/cdp/cdp-driver.js +270 -0
  165. package/dist/capture/driver/cdp/cdp-driver.js.map +1 -0
  166. package/dist/capture/driver/cdp/cdp-page.d.ts +10 -0
  167. package/dist/capture/driver/cdp/cdp-page.d.ts.map +1 -0
  168. package/dist/capture/driver/cdp/cdp-page.js +704 -0
  169. package/dist/capture/driver/cdp/cdp-page.js.map +1 -0
  170. package/dist/capture/driver/cdp/last-lines.d.ts +13 -0
  171. package/dist/capture/driver/cdp/last-lines.d.ts.map +1 -0
  172. package/dist/capture/driver/cdp/last-lines.js +49 -0
  173. package/dist/capture/driver/cdp/last-lines.js.map +1 -0
  174. package/dist/capture/driver/cdp/launch-arguments.d.ts +16 -0
  175. package/dist/capture/driver/cdp/launch-arguments.d.ts.map +1 -0
  176. package/dist/capture/driver/cdp/launch-arguments.js +142 -0
  177. package/dist/capture/driver/cdp/launch-arguments.js.map +1 -0
  178. package/dist/capture/driver/cdp/loaded-document.d.ts +61 -0
  179. package/dist/capture/driver/cdp/loaded-document.d.ts.map +1 -0
  180. package/dist/capture/driver/cdp/loaded-document.js +104 -0
  181. package/dist/capture/driver/cdp/loaded-document.js.map +1 -0
  182. package/dist/capture/driver/cdp/main-frame-navigation.d.ts +127 -0
  183. package/dist/capture/driver/cdp/main-frame-navigation.d.ts.map +1 -0
  184. package/dist/capture/driver/cdp/main-frame-navigation.js +214 -0
  185. package/dist/capture/driver/cdp/main-frame-navigation.js.map +1 -0
  186. package/dist/capture/driver/cdp/request-watch.d.ts +117 -0
  187. package/dist/capture/driver/cdp/request-watch.d.ts.map +1 -0
  188. package/dist/capture/driver/cdp/request-watch.js +244 -0
  189. package/dist/capture/driver/cdp/request-watch.js.map +1 -0
  190. package/dist/capture/driver/cdp/time-limit.d.ts +29 -0
  191. package/dist/capture/driver/cdp/time-limit.d.ts.map +1 -0
  192. package/dist/capture/driver/cdp/time-limit.js +51 -0
  193. package/dist/capture/driver/cdp/time-limit.js.map +1 -0
  194. package/dist/capture/driver/driver.d.ts +500 -0
  195. package/dist/capture/driver/driver.d.ts.map +1 -0
  196. package/dist/capture/driver/driver.js +283 -0
  197. package/dist/capture/driver/driver.js.map +1 -0
  198. package/dist/capture/end-state.d.ts +131 -0
  199. package/dist/capture/end-state.d.ts.map +1 -0
  200. package/dist/capture/end-state.js +818 -0
  201. package/dist/capture/end-state.js.map +1 -0
  202. package/dist/capture/page-roots.d.ts +18 -0
  203. package/dist/capture/page-roots.d.ts.map +1 -0
  204. package/dist/capture/page-roots.js +67 -0
  205. package/dist/capture/page-roots.js.map +1 -0
  206. package/dist/capture/page-script.d.ts +118 -0
  207. package/dist/capture/page-script.d.ts.map +1 -0
  208. package/dist/capture/page-script.js +399 -0
  209. package/dist/capture/page-script.js.map +1 -0
  210. package/dist/capture/prepare-capture.d.ts +228 -0
  211. package/dist/capture/prepare-capture.d.ts.map +1 -0
  212. package/dist/capture/prepare-capture.js +480 -0
  213. package/dist/capture/prepare-capture.js.map +1 -0
  214. package/dist/capture/read-options.d.ts +65 -0
  215. package/dist/capture/read-options.d.ts.map +1 -0
  216. package/dist/capture/read-options.js +211 -0
  217. package/dist/capture/read-options.js.map +1 -0
  218. package/dist/capture/remote-content.d.ts +45 -0
  219. package/dist/capture/remote-content.d.ts.map +1 -0
  220. package/dist/capture/remote-content.js +309 -0
  221. package/dist/capture/remote-content.js.map +1 -0
  222. package/dist/capture/worker-pool.d.ts +35 -0
  223. package/dist/capture/worker-pool.d.ts.map +1 -0
  224. package/dist/capture/worker-pool.js +51 -0
  225. package/dist/capture/worker-pool.js.map +1 -0
  226. package/dist/commands/abortable.d.ts +9 -0
  227. package/dist/commands/abortable.d.ts.map +1 -0
  228. package/dist/commands/abortable.js +18 -0
  229. package/dist/commands/abortable.js.map +1 -0
  230. package/dist/commands/browser-route.d.ts +86 -0
  231. package/dist/commands/browser-route.d.ts.map +1 -0
  232. package/dist/commands/browser-route.js +27 -0
  233. package/dist/commands/browser-route.js.map +1 -0
  234. package/dist/commands/capture-settings.d.ts +8 -0
  235. package/dist/commands/capture-settings.d.ts.map +1 -0
  236. package/dist/commands/capture-settings.js +17 -0
  237. package/dist/commands/capture-settings.js.map +1 -0
  238. package/dist/commands/check-story.d.ts +91 -0
  239. package/dist/commands/check-story.d.ts.map +1 -0
  240. package/dist/commands/check-story.js +52 -0
  241. package/dist/commands/check-story.js.map +1 -0
  242. package/dist/commands/check-storybooks.d.ts +71 -0
  243. package/dist/commands/check-storybooks.d.ts.map +1 -0
  244. package/dist/commands/check-storybooks.js +49 -0
  245. package/dist/commands/check-storybooks.js.map +1 -0
  246. package/dist/commands/consistency-check.d.ts +62 -0
  247. package/dist/commands/consistency-check.d.ts.map +1 -0
  248. package/dist/commands/consistency-check.js +63 -0
  249. package/dist/commands/consistency-check.js.map +1 -0
  250. package/dist/commands/consistency-output.d.ts +63 -0
  251. package/dist/commands/consistency-output.d.ts.map +1 -0
  252. package/dist/commands/consistency-output.js +63 -0
  253. package/dist/commands/consistency-output.js.map +1 -0
  254. package/dist/commands/docker-problem.d.ts +23 -0
  255. package/dist/commands/docker-problem.d.ts.map +1 -0
  256. package/dist/commands/docker-problem.js +18 -0
  257. package/dist/commands/docker-problem.js.map +1 -0
  258. package/dist/commands/launch-browser.d.ts +123 -0
  259. package/dist/commands/launch-browser.d.ts.map +1 -0
  260. package/dist/commands/launch-browser.js +113 -0
  261. package/dist/commands/launch-browser.js.map +1 -0
  262. package/dist/commands/missing-library.d.ts +6 -0
  263. package/dist/commands/missing-library.d.ts.map +1 -0
  264. package/dist/commands/missing-library.js +19 -0
  265. package/dist/commands/missing-library.js.map +1 -0
  266. package/dist/commands/network-warning.d.ts +36 -0
  267. package/dist/commands/network-warning.d.ts.map +1 -0
  268. package/dist/commands/network-warning.js +92 -0
  269. package/dist/commands/network-warning.js.map +1 -0
  270. package/dist/commands/parse-command-line.d.ts +133 -0
  271. package/dist/commands/parse-command-line.d.ts.map +1 -0
  272. package/dist/commands/parse-command-line.js +425 -0
  273. package/dist/commands/parse-command-line.js.map +1 -0
  274. package/dist/commands/place-browser.d.ts +75 -0
  275. package/dist/commands/place-browser.d.ts.map +1 -0
  276. package/dist/commands/place-browser.js +82 -0
  277. package/dist/commands/place-browser.js.map +1 -0
  278. package/dist/commands/plan-snapshots.d.ts +134 -0
  279. package/dist/commands/plan-snapshots.d.ts.map +1 -0
  280. package/dist/commands/plan-snapshots.js +278 -0
  281. package/dist/commands/plan-snapshots.js.map +1 -0
  282. package/dist/commands/platform-problem.d.ts +7 -0
  283. package/dist/commands/platform-problem.d.ts.map +1 -0
  284. package/dist/commands/platform-problem.js +12 -0
  285. package/dist/commands/platform-problem.js.map +1 -0
  286. package/dist/commands/read-image-fit.d.ts +16 -0
  287. package/dist/commands/read-image-fit.d.ts.map +1 -0
  288. package/dist/commands/read-image-fit.js +26 -0
  289. package/dist/commands/read-image-fit.js.map +1 -0
  290. package/dist/commands/remote-content-hint.d.ts +6 -0
  291. package/dist/commands/remote-content-hint.d.ts.map +1 -0
  292. package/dist/commands/remote-content-hint.js +37 -0
  293. package/dist/commands/remote-content-hint.js.map +1 -0
  294. package/dist/commands/report-entries.d.ts +94 -0
  295. package/dist/commands/report-entries.d.ts.map +1 -0
  296. package/dist/commands/report-entries.js +384 -0
  297. package/dist/commands/report-entries.js.map +1 -0
  298. package/dist/commands/run-browser.d.ts +128 -0
  299. package/dist/commands/run-browser.d.ts.map +1 -0
  300. package/dist/commands/run-browser.js +210 -0
  301. package/dist/commands/run-browser.js.map +1 -0
  302. package/dist/commands/run-cli.d.ts +125 -0
  303. package/dist/commands/run-cli.d.ts.map +1 -0
  304. package/dist/commands/run-cli.js +656 -0
  305. package/dist/commands/run-cli.js.map +1 -0
  306. package/dist/commands/run-output.d.ts +78 -0
  307. package/dist/commands/run-output.d.ts.map +1 -0
  308. package/dist/commands/run-output.js +71 -0
  309. package/dist/commands/run-output.js.map +1 -0
  310. package/dist/commands/run-report.d.ts +147 -0
  311. package/dist/commands/run-report.d.ts.map +1 -0
  312. package/dist/commands/run-report.js +137 -0
  313. package/dist/commands/run-report.js.map +1 -0
  314. package/dist/commands/run-selection.d.ts +191 -0
  315. package/dist/commands/run-selection.d.ts.map +1 -0
  316. package/dist/commands/run-selection.js +150 -0
  317. package/dist/commands/run-selection.js.map +1 -0
  318. package/dist/commands/run-snapshots.d.ts +272 -0
  319. package/dist/commands/run-snapshots.d.ts.map +1 -0
  320. package/dist/commands/run-snapshots.js +354 -0
  321. package/dist/commands/run-snapshots.js.map +1 -0
  322. package/dist/commands/same-address.d.ts +6 -0
  323. package/dist/commands/same-address.d.ts.map +1 -0
  324. package/dist/commands/same-address.js +32 -0
  325. package/dist/commands/same-address.js.map +1 -0
  326. package/dist/commands/select-stories.d.ts +40 -0
  327. package/dist/commands/select-stories.d.ts.map +1 -0
  328. package/dist/commands/select-stories.js +15 -0
  329. package/dist/commands/select-stories.js.map +1 -0
  330. package/dist/commands/shard-share.d.ts +41 -0
  331. package/dist/commands/shard-share.d.ts.map +1 -0
  332. package/dist/commands/shard-share.js +61 -0
  333. package/dist/commands/shard-share.js.map +1 -0
  334. package/dist/commands/snapshot-result.d.ts +165 -0
  335. package/dist/commands/snapshot-result.d.ts.map +1 -0
  336. package/dist/commands/snapshot-result.js +135 -0
  337. package/dist/commands/snapshot-result.js.map +1 -0
  338. package/dist/commands/stop-message.d.ts +65 -0
  339. package/dist/commands/stop-message.d.ts.map +1 -0
  340. package/dist/commands/stop-message.js +186 -0
  341. package/dist/commands/stop-message.js.map +1 -0
  342. package/dist/commands/stopped-run.d.ts +116 -0
  343. package/dist/commands/stopped-run.d.ts.map +1 -0
  344. package/dist/commands/stopped-run.js +103 -0
  345. package/dist/commands/stopped-run.js.map +1 -0
  346. package/dist/commands/story-run.d.ts +196 -0
  347. package/dist/commands/story-run.d.ts.map +1 -0
  348. package/dist/commands/story-run.js +258 -0
  349. package/dist/commands/story-run.js.map +1 -0
  350. package/dist/commands/take-snapshot.d.ts +27 -0
  351. package/dist/commands/take-snapshot.d.ts.map +1 -0
  352. package/dist/commands/take-snapshot.js +16 -0
  353. package/dist/commands/take-snapshot.js.map +1 -0
  354. package/dist/commands/test-plan.d.ts +100 -0
  355. package/dist/commands/test-plan.d.ts.map +1 -0
  356. package/dist/commands/test-plan.js +66 -0
  357. package/dist/commands/test-plan.js.map +1 -0
  358. package/dist/commands/test-snapshot.d.ts +52 -0
  359. package/dist/commands/test-snapshot.d.ts.map +1 -0
  360. package/dist/commands/test-snapshot.js +183 -0
  361. package/dist/commands/test-snapshot.js.map +1 -0
  362. package/dist/commands/update-baselines.d.ts +93 -0
  363. package/dist/commands/update-baselines.d.ts.map +1 -0
  364. package/dist/commands/update-baselines.js +120 -0
  365. package/dist/commands/update-baselines.js.map +1 -0
  366. package/dist/commands/update-snapshot.d.ts +69 -0
  367. package/dist/commands/update-snapshot.d.ts.map +1 -0
  368. package/dist/commands/update-snapshot.js +214 -0
  369. package/dist/commands/update-snapshot.js.map +1 -0
  370. package/dist/commands/update-story.d.ts +70 -0
  371. package/dist/commands/update-story.d.ts.map +1 -0
  372. package/dist/commands/update-story.js +64 -0
  373. package/dist/commands/update-story.js.map +1 -0
  374. package/dist/commands/warm-browser.d.ts +43 -0
  375. package/dist/commands/warm-browser.d.ts.map +1 -0
  376. package/dist/commands/warm-browser.js +192 -0
  377. package/dist/commands/warm-browser.js.map +1 -0
  378. package/dist/config/addon-image-folders.d.ts +13 -0
  379. package/dist/config/addon-image-folders.d.ts.map +1 -0
  380. package/dist/config/addon-image-folders.js +7 -0
  381. package/dist/config/addon-image-folders.js.map +1 -0
  382. package/dist/config/checks.d.ts +108 -0
  383. package/dist/config/checks.d.ts.map +1 -0
  384. package/dist/config/checks.js +190 -0
  385. package/dist/config/checks.js.map +1 -0
  386. package/dist/config/config-error.d.ts +23 -0
  387. package/dist/config/config-error.d.ts.map +1 -0
  388. package/dist/config/config-error.js +23 -0
  389. package/dist/config/config-error.js.map +1 -0
  390. package/dist/config/config-thread.d.ts +25 -0
  391. package/dist/config/config-thread.d.ts.map +1 -0
  392. package/dist/config/config-thread.js +73 -0
  393. package/dist/config/config-thread.js.map +1 -0
  394. package/dist/config/define-config.d.ts +192 -0
  395. package/dist/config/define-config.d.ts.map +1 -0
  396. package/dist/config/define-config.js +9 -0
  397. package/dist/config/define-config.js.map +1 -0
  398. package/dist/config/evaluate-config.d.ts +6 -0
  399. package/dist/config/evaluate-config.d.ts.map +1 -0
  400. package/dist/config/evaluate-config.js +39 -0
  401. package/dist/config/evaluate-config.js.map +1 -0
  402. package/dist/config/find-config.d.ts +35 -0
  403. package/dist/config/find-config.d.ts.map +1 -0
  404. package/dist/config/find-config.js +71 -0
  405. package/dist/config/find-config.js.map +1 -0
  406. package/dist/config/find-storybook-url-problem.d.ts +29 -0
  407. package/dist/config/find-storybook-url-problem.d.ts.map +1 -0
  408. package/dist/config/find-storybook-url-problem.js +34 -0
  409. package/dist/config/find-storybook-url-problem.js.map +1 -0
  410. package/dist/config/is-ci.d.ts +7 -0
  411. package/dist/config/is-ci.d.ts.map +1 -0
  412. package/dist/config/is-ci.js +10 -0
  413. package/dist/config/is-ci.js.map +1 -0
  414. package/dist/config/load-config.d.ts +72 -0
  415. package/dist/config/load-config.d.ts.map +1 -0
  416. package/dist/config/load-config.js +95 -0
  417. package/dist/config/load-config.js.map +1 -0
  418. package/dist/config/load-storybook-config.d.ts +71 -0
  419. package/dist/config/load-storybook-config.d.ts.map +1 -0
  420. package/dist/config/load-storybook-config.js +104 -0
  421. package/dist/config/load-storybook-config.js.map +1 -0
  422. package/dist/config/mode-rules.d.ts +42 -0
  423. package/dist/config/mode-rules.d.ts.map +1 -0
  424. package/dist/config/mode-rules.js +188 -0
  425. package/dist/config/mode-rules.js.map +1 -0
  426. package/dist/config/read-config-afresh.d.ts +13 -0
  427. package/dist/config/read-config-afresh.d.ts.map +1 -0
  428. package/dist/config/read-config-afresh.js +28 -0
  429. package/dist/config/read-config-afresh.js.map +1 -0
  430. package/dist/config/resolve-config.d.ts +162 -0
  431. package/dist/config/resolve-config.d.ts.map +1 -0
  432. package/dist/config/resolve-config.js +181 -0
  433. package/dist/config/resolve-config.js.map +1 -0
  434. package/dist/config/story-options.d.ts +69 -0
  435. package/dist/config/story-options.d.ts.map +1 -0
  436. package/dist/config/story-options.js +174 -0
  437. package/dist/config/story-options.js.map +1 -0
  438. package/dist/config/validate-config.d.ts +9 -0
  439. package/dist/config/validate-config.d.ts.map +1 -0
  440. package/dist/config/validate-config.js +185 -0
  441. package/dist/config/validate-config.js.map +1 -0
  442. package/dist/container/browser-container.d.ts +57 -0
  443. package/dist/container/browser-container.d.ts.map +1 -0
  444. package/dist/container/browser-container.js +112 -0
  445. package/dist/container/browser-container.js.map +1 -0
  446. package/dist/container/container-error.d.ts +47 -0
  447. package/dist/container/container-error.d.ts.map +1 -0
  448. package/dist/container/container-error.js +43 -0
  449. package/dist/container/container-error.js.map +1 -0
  450. package/dist/container/docker-probe.d.ts +37 -0
  451. package/dist/container/docker-probe.d.ts.map +1 -0
  452. package/dist/container/docker-probe.js +85 -0
  453. package/dist/container/docker-probe.js.map +1 -0
  454. package/dist/container/image-pull.d.ts +11 -0
  455. package/dist/container/image-pull.d.ts.map +1 -0
  456. package/dist/container/image-pull.js +40 -0
  457. package/dist/container/image-pull.js.map +1 -0
  458. package/dist/container/inside-container.d.ts +8 -0
  459. package/dist/container/inside-container.d.ts.map +1 -0
  460. package/dist/container/inside-container.js +11 -0
  461. package/dist/container/inside-container.js.map +1 -0
  462. package/dist/container/launch-through-proxy.d.ts +16 -0
  463. package/dist/container/launch-through-proxy.d.ts.map +1 -0
  464. package/dist/container/launch-through-proxy.js +51 -0
  465. package/dist/container/launch-through-proxy.js.map +1 -0
  466. package/dist/container/own-container.d.ts +12 -0
  467. package/dist/container/own-container.d.ts.map +1 -0
  468. package/dist/container/own-container.js +61 -0
  469. package/dist/container/own-container.js.map +1 -0
  470. package/dist/container/proxy-reach.d.ts +19 -0
  471. package/dist/container/proxy-reach.d.ts.map +1 -0
  472. package/dist/container/proxy-reach.js +101 -0
  473. package/dist/container/proxy-reach.js.map +1 -0
  474. package/dist/container/run-docker.d.ts +11 -0
  475. package/dist/container/run-docker.d.ts.map +1 -0
  476. package/dist/container/run-docker.js +61 -0
  477. package/dist/container/run-docker.js.map +1 -0
  478. package/dist/container/socks-proxy.d.ts +28 -0
  479. package/dist/container/socks-proxy.d.ts.map +1 -0
  480. package/dist/container/socks-proxy.js +335 -0
  481. package/dist/container/socks-proxy.js.map +1 -0
  482. package/dist/docs-site/docs-url.d.ts +7 -0
  483. package/dist/docs-site/docs-url.d.ts.map +1 -0
  484. package/dist/docs-site/docs-url.js +13 -0
  485. package/dist/docs-site/docs-url.js.map +1 -0
  486. package/dist/index.d.ts +5 -0
  487. package/dist/index.d.ts.map +1 -0
  488. package/dist/index.js +3 -0
  489. package/dist/index.js.map +1 -0
  490. package/dist/init/addon-question.d.ts +99 -0
  491. package/dist/init/addon-question.d.ts.map +1 -0
  492. package/dist/init/addon-question.js +111 -0
  493. package/dist/init/addon-question.js.map +1 -0
  494. package/dist/init/closing-message.d.ts +182 -0
  495. package/dist/init/closing-message.d.ts.map +1 -0
  496. package/dist/init/closing-message.js +189 -0
  497. package/dist/init/closing-message.js.map +1 -0
  498. package/dist/init/detect-project.d.ts +111 -0
  499. package/dist/init/detect-project.d.ts.map +1 -0
  500. package/dist/init/detect-project.js +166 -0
  501. package/dist/init/detect-project.js.map +1 -0
  502. package/dist/init/existing-config.d.ts +68 -0
  503. package/dist/init/existing-config.d.ts.map +1 -0
  504. package/dist/init/existing-config.js +149 -0
  505. package/dist/init/existing-config.js.map +1 -0
  506. package/dist/init/find-storybooks.d.ts +93 -0
  507. package/dist/init/find-storybooks.d.ts.map +1 -0
  508. package/dist/init/find-storybooks.js +165 -0
  509. package/dist/init/find-storybooks.js.map +1 -0
  510. package/dist/init/init-checks.d.ts +49 -0
  511. package/dist/init/init-checks.d.ts.map +1 -0
  512. package/dist/init/init-checks.js +151 -0
  513. package/dist/init/init-checks.js.map +1 -0
  514. package/dist/init/install.d.ts +286 -0
  515. package/dist/init/install.d.ts.map +1 -0
  516. package/dist/init/install.js +226 -0
  517. package/dist/init/install.js.map +1 -0
  518. package/dist/init/list-of.d.ts +10 -0
  519. package/dist/init/list-of.d.ts.map +1 -0
  520. package/dist/init/list-of.js +18 -0
  521. package/dist/init/list-of.js.map +1 -0
  522. package/dist/init/package-manager.d.ts +214 -0
  523. package/dist/init/package-manager.d.ts.map +1 -0
  524. package/dist/init/package-manager.js +308 -0
  525. package/dist/init/package-manager.js.map +1 -0
  526. package/dist/init/package-scripts.d.ts +72 -0
  527. package/dist/init/package-scripts.d.ts.map +1 -0
  528. package/dist/init/package-scripts.js +29 -0
  529. package/dist/init/package-scripts.js.map +1 -0
  530. package/dist/init/prompter.d.ts +143 -0
  531. package/dist/init/prompter.d.ts.map +1 -0
  532. package/dist/init/prompter.js +65 -0
  533. package/dist/init/prompter.js.map +1 -0
  534. package/dist/init/questions.d.ts +144 -0
  535. package/dist/init/questions.d.ts.map +1 -0
  536. package/dist/init/questions.js +342 -0
  537. package/dist/init/questions.js.map +1 -0
  538. package/dist/init/run-command.d.ts +27 -0
  539. package/dist/init/run-command.d.ts.map +1 -0
  540. package/dist/init/run-command.js +63 -0
  541. package/dist/init/run-command.js.map +1 -0
  542. package/dist/init/run-init.d.ts +133 -0
  543. package/dist/init/run-init.d.ts.map +1 -0
  544. package/dist/init/run-init.js +330 -0
  545. package/dist/init/run-init.js.map +1 -0
  546. package/dist/init/segment.d.ts +60 -0
  547. package/dist/init/segment.d.ts.map +1 -0
  548. package/dist/init/segment.js +54 -0
  549. package/dist/init/segment.js.map +1 -0
  550. package/dist/init/setup-files.d.ts +85 -0
  551. package/dist/init/setup-files.d.ts.map +1 -0
  552. package/dist/init/setup-files.js +191 -0
  553. package/dist/init/setup-files.js.map +1 -0
  554. package/dist/init/setup-progress.d.ts +46 -0
  555. package/dist/init/setup-progress.d.ts.map +1 -0
  556. package/dist/init/setup-progress.js +36 -0
  557. package/dist/init/setup-progress.js.map +1 -0
  558. package/dist/init/skill-setup.d.ts +55 -0
  559. package/dist/init/skill-setup.d.ts.map +1 -0
  560. package/dist/init/skill-setup.js +47 -0
  561. package/dist/init/skill-setup.js.map +1 -0
  562. package/dist/init/storybook-scripts.d.ts +47 -0
  563. package/dist/init/storybook-scripts.d.ts.map +1 -0
  564. package/dist/init/storybook-scripts.js +114 -0
  565. package/dist/init/storybook-scripts.js.map +1 -0
  566. package/dist/init/storybook-start.d.ts +145 -0
  567. package/dist/init/storybook-start.d.ts.map +1 -0
  568. package/dist/init/storybook-start.js +109 -0
  569. package/dist/init/storybook-start.js.map +1 -0
  570. package/dist/init/unlisted-dependencies.d.ts +75 -0
  571. package/dist/init/unlisted-dependencies.d.ts.map +1 -0
  572. package/dist/init/unlisted-dependencies.js +142 -0
  573. package/dist/init/unlisted-dependencies.js.map +1 -0
  574. package/dist/init/workspace-packages.d.ts +58 -0
  575. package/dist/init/workspace-packages.d.ts.map +1 -0
  576. package/dist/init/workspace-packages.js +86 -0
  577. package/dist/init/workspace-packages.js.map +1 -0
  578. package/dist/init/workspace.d.ts +109 -0
  579. package/dist/init/workspace.d.ts.map +1 -0
  580. package/dist/init/workspace.js +433 -0
  581. package/dist/init/workspace.js.map +1 -0
  582. package/dist/report/display-path.d.ts +7 -0
  583. package/dist/report/display-path.d.ts.map +1 -0
  584. package/dist/report/display-path.js +10 -0
  585. package/dist/report/display-path.js.map +1 -0
  586. package/dist/report/report-document.d.ts +682 -0
  587. package/dist/report/report-document.d.ts.map +1 -0
  588. package/dist/report/report-document.js +90 -0
  589. package/dist/report/report-document.js.map +1 -0
  590. package/dist/report/report-folder.d.ts +102 -0
  591. package/dist/report/report-folder.d.ts.map +1 -0
  592. package/dist/report/report-folder.js +160 -0
  593. package/dist/report/report-folder.js.map +1 -0
  594. package/dist/reporter/counts-line.d.ts +14 -0
  595. package/dist/reporter/counts-line.d.ts.map +1 -0
  596. package/dist/reporter/counts-line.js +18 -0
  597. package/dist/reporter/counts-line.js.map +1 -0
  598. package/dist/reporter/duration.d.ts +8 -0
  599. package/dist/reporter/duration.d.ts.map +1 -0
  600. package/dist/reporter/duration.js +18 -0
  601. package/dist/reporter/duration.js.map +1 -0
  602. package/dist/reporter/end-block.d.ts +42 -0
  603. package/dist/reporter/end-block.d.ts.map +1 -0
  604. package/dist/reporter/end-block.js +121 -0
  605. package/dist/reporter/end-block.js.map +1 -0
  606. package/dist/reporter/log-reporter.d.ts +10 -0
  607. package/dist/reporter/log-reporter.d.ts.map +1 -0
  608. package/dist/reporter/log-reporter.js +23 -0
  609. package/dist/reporter/log-reporter.js.map +1 -0
  610. package/dist/reporter/reporter-choice.d.ts +27 -0
  611. package/dist/reporter/reporter-choice.d.ts.map +1 -0
  612. package/dist/reporter/reporter-choice.js +12 -0
  613. package/dist/reporter/reporter-choice.js.map +1 -0
  614. package/dist/reporter/run-event.d.ts +90 -0
  615. package/dist/reporter/run-event.d.ts.map +1 -0
  616. package/dist/reporter/run-event.js +2 -0
  617. package/dist/reporter/run-event.js.map +1 -0
  618. package/dist/sharding/shard.d.ts +17 -0
  619. package/dist/sharding/shard.d.ts.map +1 -0
  620. package/dist/sharding/shard.js +2 -0
  621. package/dist/sharding/shard.js.map +1 -0
  622. package/dist/sharding/split-stories-files.d.ts +43 -0
  623. package/dist/sharding/split-stories-files.d.ts.map +1 -0
  624. package/dist/sharding/split-stories-files.js +70 -0
  625. package/dist/sharding/split-stories-files.js.map +1 -0
  626. package/dist/step-summary/step-summary.d.ts +45 -0
  627. package/dist/step-summary/step-summary.d.ts.map +1 -0
  628. package/dist/step-summary/step-summary.js +263 -0
  629. package/dist/step-summary/step-summary.js.map +1 -0
  630. package/dist/storybook/options-encoding.d.ts +115 -0
  631. package/dist/storybook/options-encoding.d.ts.map +1 -0
  632. package/dist/storybook/options-encoding.js +117 -0
  633. package/dist/storybook/options-encoding.js.map +1 -0
  634. package/dist/storybook/options-read.d.ts +146 -0
  635. package/dist/storybook/options-read.d.ts.map +1 -0
  636. package/dist/storybook/options-read.js +192 -0
  637. package/dist/storybook/options-read.js.map +1 -0
  638. package/dist/storybook/preview-script.d.ts +172 -0
  639. package/dist/storybook/preview-script.d.ts.map +1 -0
  640. package/dist/storybook/preview-script.js +804 -0
  641. package/dist/storybook/preview-script.js.map +1 -0
  642. package/dist/storybook/read-stories.d.ts +72 -0
  643. package/dist/storybook/read-stories.d.ts.map +1 -0
  644. package/dist/storybook/read-stories.js +317 -0
  645. package/dist/storybook/read-stories.js.map +1 -0
  646. package/dist/storybook/stories-matchers.d.ts +39 -0
  647. package/dist/storybook/stories-matchers.d.ts.map +1 -0
  648. package/dist/storybook/stories-matchers.js +149 -0
  649. package/dist/storybook/stories-matchers.js.map +1 -0
  650. package/dist/storybook/storybook-error.d.ts +24 -0
  651. package/dist/storybook/storybook-error.d.ts.map +1 -0
  652. package/dist/storybook/storybook-error.js +24 -0
  653. package/dist/storybook/storybook-error.js.map +1 -0
  654. package/dist/storybook/storybook-version.d.ts +62 -0
  655. package/dist/storybook/storybook-version.d.ts.map +1 -0
  656. package/dist/storybook/storybook-version.js +105 -0
  657. package/dist/storybook/storybook-version.js.map +1 -0
  658. package/dist/storybook/test-path.d.ts +19 -0
  659. package/dist/storybook/test-path.d.ts.map +1 -0
  660. package/dist/storybook/test-path.js +47 -0
  661. package/dist/storybook/test-path.js.map +1 -0
  662. package/dist/storybook/wait-hook.d.ts +64 -0
  663. package/dist/storybook/wait-hook.d.ts.map +1 -0
  664. package/dist/storybook/wait-hook.js +50 -0
  665. package/dist/storybook/wait-hook.js.map +1 -0
  666. package/dist/system-error/system-reason.d.ts +8 -0
  667. package/dist/system-error/system-reason.d.ts.map +1 -0
  668. package/dist/system-error/system-reason.js +15 -0
  669. package/dist/system-error/system-reason.js.map +1 -0
  670. package/dist/terminal-ui/answered-line.d.ts +21 -0
  671. package/dist/terminal-ui/answered-line.d.ts.map +1 -0
  672. package/dist/terminal-ui/answered-line.js +12 -0
  673. package/dist/terminal-ui/answered-line.js.map +1 -0
  674. package/dist/terminal-ui/brand-header.d.ts +21 -0
  675. package/dist/terminal-ui/brand-header.d.ts.map +1 -0
  676. package/dist/terminal-ui/brand-header.js +12 -0
  677. package/dist/terminal-ui/brand-header.js.map +1 -0
  678. package/dist/terminal-ui/checklist-question.d.ts +26 -0
  679. package/dist/terminal-ui/checklist-question.d.ts.map +1 -0
  680. package/dist/terminal-ui/checklist-question.js +62 -0
  681. package/dist/terminal-ui/checklist-question.js.map +1 -0
  682. package/dist/terminal-ui/choice-line.d.ts +29 -0
  683. package/dist/terminal-ui/choice-line.d.ts.map +1 -0
  684. package/dist/terminal-ui/choice-line.js +13 -0
  685. package/dist/terminal-ui/choice-line.js.map +1 -0
  686. package/dist/terminal-ui/coloured-text.d.ts +19 -0
  687. package/dist/terminal-ui/coloured-text.d.ts.map +1 -0
  688. package/dist/terminal-ui/coloured-text.js +16 -0
  689. package/dist/terminal-ui/coloured-text.js.map +1 -0
  690. package/dist/terminal-ui/confirm-question.d.ts +8 -0
  691. package/dist/terminal-ui/confirm-question.d.ts.map +1 -0
  692. package/dist/terminal-ui/confirm-question.js +44 -0
  693. package/dist/terminal-ui/confirm-question.js.map +1 -0
  694. package/dist/terminal-ui/init-screen.d.ts +23 -0
  695. package/dist/terminal-ui/init-screen.d.ts.map +1 -0
  696. package/dist/terminal-ui/init-screen.js +74 -0
  697. package/dist/terminal-ui/init-screen.js.map +1 -0
  698. package/dist/terminal-ui/init-view-state.d.ts +294 -0
  699. package/dist/terminal-ui/init-view-state.d.ts.map +1 -0
  700. package/dist/terminal-ui/init-view-state.js +148 -0
  701. package/dist/terminal-ui/init-view-state.js.map +1 -0
  702. package/dist/terminal-ui/init-view.d.ts +70 -0
  703. package/dist/terminal-ui/init-view.d.ts.map +1 -0
  704. package/dist/terminal-ui/init-view.js +128 -0
  705. package/dist/terminal-ui/init-view.js.map +1 -0
  706. package/dist/terminal-ui/live-screen.d.ts +22 -0
  707. package/dist/terminal-ui/live-screen.d.ts.map +1 -0
  708. package/dist/terminal-ui/live-screen.js +41 -0
  709. package/dist/terminal-ui/live-screen.js.map +1 -0
  710. package/dist/terminal-ui/live-view-state.d.ts +64 -0
  711. package/dist/terminal-ui/live-view-state.d.ts.map +1 -0
  712. package/dist/terminal-ui/live-view-state.js +54 -0
  713. package/dist/terminal-ui/live-view-state.js.map +1 -0
  714. package/dist/terminal-ui/live-view.d.ts +37 -0
  715. package/dist/terminal-ui/live-view.d.ts.map +1 -0
  716. package/dist/terminal-ui/live-view.js +67 -0
  717. package/dist/terminal-ui/live-view.js.map +1 -0
  718. package/dist/terminal-ui/message-line.d.ts +31 -0
  719. package/dist/terminal-ui/message-line.d.ts.map +1 -0
  720. package/dist/terminal-ui/message-line.js +79 -0
  721. package/dist/terminal-ui/message-line.js.map +1 -0
  722. package/dist/terminal-ui/output-tail.d.ts +29 -0
  723. package/dist/terminal-ui/output-tail.d.ts.map +1 -0
  724. package/dist/terminal-ui/output-tail.js +52 -0
  725. package/dist/terminal-ui/output-tail.js.map +1 -0
  726. package/dist/terminal-ui/progress-bar.d.ts +47 -0
  727. package/dist/terminal-ui/progress-bar.d.ts.map +1 -0
  728. package/dist/terminal-ui/progress-bar.js +23 -0
  729. package/dist/terminal-ui/progress-bar.js.map +1 -0
  730. package/dist/terminal-ui/question-header.d.ts +23 -0
  731. package/dist/terminal-ui/question-header.d.ts.map +1 -0
  732. package/dist/terminal-ui/question-header.js +24 -0
  733. package/dist/terminal-ui/question-header.js.map +1 -0
  734. package/dist/terminal-ui/question.d.ts +85 -0
  735. package/dist/terminal-ui/question.d.ts.map +1 -0
  736. package/dist/terminal-ui/question.js +77 -0
  737. package/dist/terminal-ui/question.js.map +1 -0
  738. package/dist/terminal-ui/select-question.d.ts +19 -0
  739. package/dist/terminal-ui/select-question.d.ts.map +1 -0
  740. package/dist/terminal-ui/select-question.js +24 -0
  741. package/dist/terminal-ui/select-question.js.map +1 -0
  742. package/dist/terminal-ui/spinner.d.ts +26 -0
  743. package/dist/terminal-ui/spinner.d.ts.map +1 -0
  744. package/dist/terminal-ui/spinner.js +39 -0
  745. package/dist/terminal-ui/spinner.js.map +1 -0
  746. package/dist/terminal-ui/step-list.d.ts +36 -0
  747. package/dist/terminal-ui/step-list.d.ts.map +1 -0
  748. package/dist/terminal-ui/step-list.js +122 -0
  749. package/dist/terminal-ui/step-list.js.map +1 -0
  750. package/dist/terminal-ui/summary.d.ts +20 -0
  751. package/dist/terminal-ui/summary.d.ts.map +1 -0
  752. package/dist/terminal-ui/summary.js +96 -0
  753. package/dist/terminal-ui/summary.js.map +1 -0
  754. package/dist/terminal-ui/text-input.d.ts +65 -0
  755. package/dist/terminal-ui/text-input.d.ts.map +1 -0
  756. package/dist/terminal-ui/text-input.js +72 -0
  757. package/dist/terminal-ui/text-input.js.map +1 -0
  758. package/dist/terminal-ui/text-question.d.ts +18 -0
  759. package/dist/terminal-ui/text-question.d.ts.map +1 -0
  760. package/dist/terminal-ui/text-question.js +60 -0
  761. package/dist/terminal-ui/text-question.js.map +1 -0
  762. package/dist/terminal-ui/theme.d.ts +106 -0
  763. package/dist/terminal-ui/theme.d.ts.map +1 -0
  764. package/dist/terminal-ui/theme.js +97 -0
  765. package/dist/terminal-ui/theme.js.map +1 -0
  766. package/dist/terminal-ui/wrapped-lines.d.ts +15 -0
  767. package/dist/terminal-ui/wrapped-lines.d.ts.map +1 -0
  768. package/dist/terminal-ui/wrapped-lines.js +105 -0
  769. package/dist/terminal-ui/wrapped-lines.js.map +1 -0
  770. package/dist/terminal-ui/wrapped-segments.d.ts +27 -0
  771. package/dist/terminal-ui/wrapped-segments.d.ts.map +1 -0
  772. package/dist/terminal-ui/wrapped-segments.js +37 -0
  773. package/dist/terminal-ui/wrapped-segments.js.map +1 -0
  774. package/dist/terminal-ui/wrapped-text.d.ts +21 -0
  775. package/dist/terminal-ui/wrapped-text.d.ts.map +1 -0
  776. package/dist/terminal-ui/wrapped-text.js +11 -0
  777. package/dist/terminal-ui/wrapped-text.js.map +1 -0
  778. package/dist/visual-diff/diff-thread.d.ts +27 -0
  779. package/dist/visual-diff/diff-thread.d.ts.map +1 -0
  780. package/dist/visual-diff/diff-thread.js +233 -0
  781. package/dist/visual-diff/diff-thread.js.map +1 -0
  782. package/dist/visual-diff/visual-diff.d.ts +259 -0
  783. package/dist/visual-diff/visual-diff.d.ts.map +1 -0
  784. package/dist/visual-diff/visual-diff.js +317 -0
  785. package/dist/visual-diff/visual-diff.js.map +1 -0
  786. package/fallow-graph.json +1 -0
  787. package/package.json +61 -3
  788. package/skill/SKILL.md +92 -0
  789. package/skill/scripts/run.mjs +1532 -0
  790. package/README.md +0 -3
@@ -0,0 +1,67 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { render } from 'ink';
3
+ import { LiveScreen } from './live-screen.js';
4
+ import { initialLiveViewState, liveViewStateOf } from './live-view-state.js';
5
+ import { colourEnabledOf, ThemeContext } from './theme.js';
6
+ /**
7
+ * Starts the `live` reporter, which draws a `test` or `update` run's progress stream in the terminal. It draws nothing
8
+ * until the run is planned, so what the run writes before, such as an image pull's progress on stderr, never mixes with
9
+ * it. Then it prints the header and its notes, then each `✗` and `!` line as its snapshot finishes, above one
10
+ * progress line: a spinner, the snapshots done of the total, the workers and the time taken, redrawn every second.
11
+ * Passes print nothing. `finish` removes the progress line, keeps the printed lines, and hands the terminal back; it
12
+ * never rejects. With `--reporter live` and no TTY it still draws as in one: erase sequences and spinner frames,
13
+ * wrapped at 80 columns.
14
+ *
15
+ * @public
16
+ */
17
+ export function startLiveView(options) {
18
+ let state = initialLiveViewState;
19
+ let instance;
20
+ const colour = colourEnabledOf(options.environment);
21
+ /**
22
+ * Draws the state as it is now, the first time once the run is planned.
23
+ */
24
+ const draw = () => {
25
+ const tree = (_jsx(ThemeContext, { value: { colour }, children: _jsx(LiveScreen, { elapsedMs: options.elapsedMs, state: state }) }));
26
+ if (instance !== undefined) {
27
+ instance.rerender(tree);
28
+ return;
29
+ }
30
+ if (state.planned) {
31
+ instance = render(tree, {
32
+ stdout: options.stdout,
33
+ patchConsole: false,
34
+ // The caller decided there's a terminal. Ink's own guess also looks for CI variables, and would draw nothing
35
+ // until the end.
36
+ interactive: true,
37
+ debug: options.debug ?? false,
38
+ });
39
+ }
40
+ };
41
+ return {
42
+ event(event) {
43
+ state = liveViewStateOf(state, event);
44
+ draw();
45
+ },
46
+ async finish() {
47
+ if (instance === undefined) {
48
+ return;
49
+ }
50
+ try {
51
+ state = { ...state, closed: true };
52
+ draw();
53
+ await instance.waitUntilRenderFlush();
54
+ // Ink ends even an empty frame with a newline; clearing it leaves no blank line where the progress line was.
55
+ instance.clear();
56
+ }
57
+ catch {
58
+ // Ending the view never fails the run: the lines it printed stay, and the terminal is handed back below.
59
+ }
60
+ finally {
61
+ instance.unmount();
62
+ }
63
+ await instance.waitUntilExit().catch(() => undefined);
64
+ },
65
+ };
66
+ }
67
+ //# sourceMappingURL=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AAC,KAAK,EAAE,KAAK,CAAC,CAAA;YACrC,IAAI,EAAE,CAAA;QACR,CAAC;QACD,KAAK,CAAC,MAAM;YACV,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;gBAC3B,OAAM;YACR,CAAC;YAED,IAAI,CAAC;gBACH,KAAK,GAAG,EAAE,GAAG,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,CAAA;gBAClC,IAAI,EAAE,CAAA;gBACN,MAAM,QAAQ,CAAC,oBAAoB,EAAE,CAAA;gBACrC,6GAA6G;gBAC7G,QAAQ,CAAC,KAAK,EAAE,CAAA;YAClB,CAAC;YAAC,MAAM,CAAC;gBACP,yGAAyG;YAC3G,CAAC;oBAAS,CAAC;gBACT,QAAQ,CAAC,OAAO,EAAE,CAAA;YACpB,CAAC;YAED,MAAM,QAAQ,CAAC,aAAa,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAA;QACvD,CAAC;KACF,CAAA;AACH,CAAC"}
@@ -0,0 +1,31 @@
1
+ import type { ReactNode } from 'react';
2
+ import { type Message } from '../init/segment.js';
3
+ /**
4
+ * What `NoteLine` takes.
5
+ */
6
+ interface NoteLineProps {
7
+ /**
8
+ * The note, such as `Warning: …`, `hint: …` or plain text, or a line of segments that starts so.
9
+ */
10
+ text: Message;
11
+ }
12
+ /**
13
+ * What `MessageLine` takes.
14
+ */
15
+ interface MessageLineProps {
16
+ /**
17
+ * The message, its lines kept.
18
+ */
19
+ text: Message;
20
+ }
21
+ /**
22
+ * A line of text that `init` shows between its questions, drawn as `ParsedNote` draws it.
23
+ */
24
+ export declare function NoteLine({ text }: NoteLineProps): ReactNode;
25
+ /**
26
+ * One of the messages a run of `init` ends with: a warning or a hint as a note, and anything else as a problem that
27
+ * stopped it. A message that spans lines stays one note or problem.
28
+ */
29
+ export declare function MessageLine({ text }: MessageLineProps): ReactNode;
30
+ export {};
31
+ //# sourceMappingURL=message-line.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message-line.d.ts","sourceRoot":"","sources":["../../src/terminal-ui/message-line.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,EAAE,KAAK,OAAO,EAAmC,MAAM,oBAAoB,CAAA;AAoBlF;;GAEG;AACH,UAAU,aAAa;IACrB;;OAEG;IACH,IAAI,EAAE,OAAO,CAAA;CACd;AAED;;GAEG;AACH,UAAU,gBAAgB;IACxB;;OAEG;IACH,IAAI,EAAE,OAAO,CAAA;CACd;AA0GD;;GAEG;AACH,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,EAAE,aAAa,GAAG,SAAS,CAE3D;AAmBD;;;GAGG;AACH,wBAAgB,WAAW,CAAC,EAAE,IAAI,EAAE,EAAE,gBAAgB,GAAG,SAAS,CAIjE"}
@@ -0,0 +1,79 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box, Text, useWindowSize } from 'ink';
3
+ import { segmentsOfMessage } from '../init/segment.js';
4
+ import { ColouredText } from './coloured-text.js';
5
+ import { glyphs } from './theme.js';
6
+ import { WrappedSegments } from './wrapped-segments.js';
7
+ /**
8
+ * What a note that is a warning starts with.
9
+ */
10
+ const warningPrefix = 'Warning: ';
11
+ /**
12
+ * What a note that is a hint starts with.
13
+ */
14
+ const hintPrefix = 'hint: ';
15
+ /**
16
+ * How far a note's text starts after its glyph: the glyph and a space.
17
+ */
18
+ const glyphIndent = 2;
19
+ /**
20
+ * Tells a message apart by its prefix, `Warning: ` or `hint: `, which is plain words, so it starts the first segment.
21
+ */
22
+ function parsedOf(message) {
23
+ const [first, ...others] = segmentsOfMessage(message);
24
+ for (const [kind, prefix] of [
25
+ ['warning', warningPrefix],
26
+ ['hint', hintPrefix],
27
+ ]) {
28
+ if (typeof first === 'string' && first.startsWith(prefix)) {
29
+ return { kind, segments: [first.slice(prefix.length), ...others] };
30
+ }
31
+ }
32
+ return { kind: 'plain', segments: segmentsOfMessage(message) };
33
+ }
34
+ /**
35
+ * A note after its glyph. A long note wraps under its own first letter, not under the glyph.
36
+ */
37
+ function GlyphNote({ glyph, children }) {
38
+ return (_jsxs(Box, { children: [_jsx(Box, { flexShrink: 0, marginRight: 1, children: glyph }), children] }));
39
+ }
40
+ /**
41
+ * Draws a note told apart by its prefix. A warning takes `▲` and the caution colour, a hint takes `·` and is dim, and
42
+ * any other note is plain. A folder or path it names takes the accent colour, in a dim hint too. A long note wraps to
43
+ * the terminal's width: a warning or a hint under its own first letter, not under the glyph.
44
+ */
45
+ function ParsedNote({ message: { kind, segments } }) {
46
+ const { columns } = useWindowSize();
47
+ switch (kind) {
48
+ case 'warning':
49
+ return (_jsx(GlyphNote, { glyph: _jsx(ColouredText, { colour: "caution", children: glyphs.caution }), children: _jsx(ColouredText, { colour: "caution", children: _jsx(WrappedSegments, { segments: segments, width: columns - glyphIndent }) }) }));
50
+ case 'hint':
51
+ return (_jsx(GlyphNote, { glyph: _jsx(Text, { dimColor: true, children: glyphs.hint }), children: _jsx(Text, { children: _jsx(WrappedSegments, { dim: true, segments: segments, width: columns - glyphIndent }) }) }));
52
+ case 'plain':
53
+ return (_jsx(Text, { children: _jsx(WrappedSegments, { segments: segments, width: columns }) }));
54
+ }
55
+ }
56
+ /**
57
+ * A line of text that `init` shows between its questions, drawn as `ParsedNote` draws it.
58
+ */
59
+ export function NoteLine({ text }) {
60
+ return _jsx(ParsedNote, { message: parsedOf(text) });
61
+ }
62
+ /**
63
+ * A problem that stopped `init`, after `✕`, all in the danger colour but what it names, which takes the accent colour.
64
+ * A long one wraps to the terminal's width under its own first letter, not under the glyph, and so does each line
65
+ * after its first.
66
+ */
67
+ function ProblemLine({ message }) {
68
+ const { columns } = useWindowSize();
69
+ return (_jsx(GlyphNote, { glyph: _jsx(ColouredText, { colour: "danger", children: glyphs.failed }), children: _jsx(ColouredText, { colour: "danger", children: _jsx(WrappedSegments, { segments: message.segments, width: columns - glyphIndent }) }) }));
70
+ }
71
+ /**
72
+ * One of the messages a run of `init` ends with: a warning or a hint as a note, and anything else as a problem that
73
+ * stopped it. A message that spans lines stays one note or problem.
74
+ */
75
+ export function MessageLine({ text }) {
76
+ const message = parsedOf(text);
77
+ return message.kind === 'plain' ? _jsx(ProblemLine, { message: message }) : _jsx(ParsedNote, { message: message });
78
+ }
79
+ //# sourceMappingURL=message-line.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message-line.js","sourceRoot":"","sources":["../../src/terminal-ui/message-line.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,KAAK,CAAA;AAE9C,OAAO,EAA8B,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAEvD;;GAEG;AACH,MAAM,aAAa,GAAG,WAAW,CAAA;AAEjC;;GAEG;AACH,MAAM,UAAU,GAAG,QAAQ,CAAA;AAE3B;;GAEG;AACH,MAAM,WAAW,GAAG,CAAC,CAAA;AA4DrB;;GAEG;AACH,SAAS,QAAQ,CAAC,OAAgB;IAChC,MAAM,CAAC,KAAK,EAAE,GAAG,MAAM,CAAC,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAA;IAErD,KAAK,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI;QAC3B,CAAC,SAAS,EAAE,aAAa,CAAC;QAC1B,CAAC,MAAM,EAAE,UAAU,CAAC;KACZ,EAAE,CAAC;QACX,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;YAC1D,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CA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ACR,CAAA;IACL,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,QAAQ,CAAC,EAAE,IAAI,EAAiB;IAC9C,OAAO,KAAC,UAAU,IAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,GAAI,CAAA;AAChD,CAAC;AAED;;;;GAIG;AACH,SAAS,WAAW,CAAC,EAAE,OAAO,EAAe;IAC3C,MAAM,EAAE,OAAO,EAAE,GAAG,aAAa,EAAE,CAAA;IAEnC,OAAO,CACL,KAAC,SAAS,IAAC,KAAK,EAAE,KAAC,YAAY,IAAC,MAAM,EAAC,QAAQ,YAAE,MAAM,CAAC,MAAM,GAAgB,YAC5E,KAAC,YAAY,IAAC,MAAM,EAAC,QAAQ,YAC3B,KAAC,eAAe,IAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,GAAG,WAAW,GAAI,GAChE,GACL,CACb,CAAA;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,EAAE,IAAI,EAAoB;IACpD,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAA;IAE9B,OAAO,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,KAAC,WAAW,IAAC,OAAO,EAAE,OAAO,GAAI,CAAC,CAAC,CAAC,KAAC,UAAU,IAAC,OAAO,EAAE,OAAO,GAAI,CAAA;AACxG,CAAC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * The end of a command's output, as the init view keeps it while the command runs.
3
+ */
4
+ export interface OutputTail {
5
+ /**
6
+ * The last finished lines that hold more than spaces, oldest first, without ANSI escapes.
7
+ */
8
+ lines: readonly string[];
9
+ /**
10
+ * The line still being written, as it has arrived since its last carriage return, ANSI escapes and all. An escape
11
+ * can arrive in two chunks, so it is stripped only once the line is shown or finished.
12
+ */
13
+ unfinished: string;
14
+ }
15
+ /**
16
+ * The tail of a command that has written nothing yet.
17
+ */
18
+ export declare const emptyOutputTail: OutputTail;
19
+ /**
20
+ * Adds a chunk of a command's output to its tail. The chunk can end partway through a line, which the next chunk
21
+ * finishes. Of a line drawn again after a carriage return, only the last drawing is kept.
22
+ */
23
+ export declare function outputTailOf(tail: OutputTail, chunk: string): OutputTail;
24
+ /**
25
+ * Gives the lines of a tail to show: the last `count` that hold more than spaces, the unfinished one included, without
26
+ * ANSI escapes. A tail keeps 15 finished lines, so a larger count shows no more.
27
+ */
28
+ export declare function shownLinesOf(tail: OutputTail, count: number): string[];
29
+ //# sourceMappingURL=output-tail.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"output-tail.d.ts","sourceRoot":"","sources":["../../src/terminal-ui/output-tail.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,KAAK,EAAE,SAAS,MAAM,EAAE,CAAA;IACxB;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAA;CACnB;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,UAA0C,CAAA;AA8BxE;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,GAAG,UAAU,CAUxE;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAKtE"}
@@ -0,0 +1,52 @@
1
+ import { stripVTControlCharacters } from 'node:util';
2
+ /**
3
+ * The tail of a command that has written nothing yet.
4
+ */
5
+ export const emptyOutputTail = { lines: [], unfinished: '' };
6
+ /**
7
+ * The most finished lines of a command's output a tail keeps: as many as the init view shows of a step that failed.
8
+ */
9
+ const keptLineCount = 15;
10
+ /**
11
+ * What ends a line of output: a line feed, after a carriage return on Windows.
12
+ */
13
+ const lineEnd = /\r?\n/;
14
+ /**
15
+ * Whether a line holds more than spaces.
16
+ */
17
+ function hasText(line) {
18
+ return line.trim() !== '';
19
+ }
20
+ /**
21
+ * Gives what a terminal shows of a line: the text after its last carriage return, which sends the cursor back to
22
+ * draw the line again, as a progress bar does. A carriage return at the end, such as the first half of a Windows line
23
+ * end, draws nothing yet, so the text before it stays.
24
+ */
25
+ function shownTextOf(line) {
26
+ const drawn = line.endsWith('\r') ? line.slice(0, -1) : line;
27
+ return drawn.slice(drawn.lastIndexOf('\r') + 1);
28
+ }
29
+ /**
30
+ * Adds a chunk of a command's output to its tail. The chunk can end partway through a line, which the next chunk
31
+ * finishes. Of a line drawn again after a carriage return, only the last drawing is kept.
32
+ */
33
+ export function outputTailOf(tail, chunk) {
34
+ const parts = `${tail.unfinished}${chunk}`.split(lineEnd);
35
+ const unfinished = parts.pop() ?? '';
36
+ const finished = parts.map((line) => stripVTControlCharacters(shownTextOf(line))).filter(hasText);
37
+ const pendingReturn = unfinished.endsWith('\r') ? '\r' : '';
38
+ return {
39
+ lines: [...tail.lines, ...finished].slice(-keptLineCount),
40
+ unfinished: `${shownTextOf(unfinished)}${pendingReturn}`,
41
+ };
42
+ }
43
+ /**
44
+ * Gives the lines of a tail to show: the last `count` that hold more than spaces, the unfinished one included, without
45
+ * ANSI escapes. A tail keeps 15 finished lines, so a larger count shows no more.
46
+ */
47
+ export function shownLinesOf(tail, count) {
48
+ const unfinished = stripVTControlCharacters(shownTextOf(tail.unfinished));
49
+ const lines = hasText(unfinished) ? [...tail.lines, unfinished] : tail.lines;
50
+ return lines.slice(-count);
51
+ }
52
+ //# sourceMappingURL=output-tail.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"output-tail.js","sourceRoot":"","sources":["../../src/terminal-ui/output-tail.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAA;AAiBpD;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAe,EAAE,KAAK,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,CAAA;AAExE;;GAEG;AACH,MAAM,aAAa,GAAG,EAAE,CAAA;AAExB;;GAEG;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AgB,EAAE,KAAa;IAC1D,MAAM,UAAU,GAAG,wBAAwB,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAA;IACzE,MAAM,KAAK,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAA;IAE5E,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAA;AAC5B,CAAC"}
@@ -0,0 +1,47 @@
1
+ import type { ReactNode } from 'react';
2
+ /**
3
+ * How many cells of a progress bar are filled and how many are empty.
4
+ */
5
+ interface ProgressCells {
6
+ /**
7
+ * The cells for the work done.
8
+ */
9
+ filled: number;
10
+ /**
11
+ * The cells for the work left.
12
+ */
13
+ empty: number;
14
+ }
15
+ /**
16
+ * What `ProgressBar` takes.
17
+ */
18
+ interface ProgressBarProps {
19
+ /**
20
+ * How many of the steps are done.
21
+ */
22
+ done: number;
23
+ /**
24
+ * How many steps there are.
25
+ */
26
+ total: number;
27
+ /**
28
+ * What follows the bar in place of the count, such as `Step 3 of 9`.
29
+ */
30
+ label?: string;
31
+ /**
32
+ * How many cells wide the bar is.
33
+ */
34
+ width?: number;
35
+ }
36
+ /**
37
+ * Splits a bar `width` cells wide into filled and empty cells for `done` of `total` steps, rounded to the nearest cell.
38
+ * `done` is clamped between none and `total`, and a bar with no steps is empty.
39
+ */
40
+ export declare function progressCellsOf(done: number, total: number, width: number): ProgressCells;
41
+ /**
42
+ * A bar of how many steps are done, in the accent colour, with the count after it, `━━━───── 3/8`, or the label in
43
+ * its place.
44
+ */
45
+ export declare function ProgressBar({ done, total, label, width }: ProgressBarProps): ReactNode;
46
+ export {};
47
+ //# sourceMappingURL=progress-bar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"progress-bar.d.ts","sourceRoot":"","sources":["../../src/terminal-ui/progress-bar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC;;GAEG;AACH,UAAU,aAAa;IACrB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;CACd;AAED;;GAEG;AACH,UAAU,gBAAgB;IACxB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,aAAa,CAQzF;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAA0B,EAAE,KAAU,EAAE,EAAE,gBAAgB,GAAG,SAAS,CAUhH"}
@@ -0,0 +1,23 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Text } from 'ink';
3
+ import { ColouredText } from './coloured-text.js';
4
+ /**
5
+ * Splits a bar `width` cells wide into filled and empty cells for `done` of `total` steps, rounded to the nearest cell.
6
+ * `done` is clamped between none and `total`, and a bar with no steps is empty.
7
+ */
8
+ export function progressCellsOf(done, total, width) {
9
+ if (total <= 0) {
10
+ return { filled: 0, empty: width };
11
+ }
12
+ const filled = Math.round((Math.min(Math.max(done, 0), total) / total) * width);
13
+ return { filled, empty: width - filled };
14
+ }
15
+ /**
16
+ * A bar of how many steps are done, in the accent colour, with the count after it, `━━━───── 3/8`, or the label in
17
+ * its place.
18
+ */
19
+ export function ProgressBar({ done, total, label = `${done}/${total}`, width = 20 }) {
20
+ const cells = progressCellsOf(done, total, width);
21
+ return (_jsxs(Text, { children: [_jsx(ColouredText, { colour: "accent", children: '━'.repeat(cells.filled) }), _jsx(Text, { dimColor: true, children: '─'.repeat(cells.empty) }), ` ${label}`] }));
22
+ }
23
+ //# sourceMappingURL=progress-bar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"progress-bar.js","sourceRoot":"","sources":["../../src/terminal-ui/progress-bar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAE1B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAsCjD;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,IAAY,EAAE,KAAa,EAAE,KAAa;IACxE,IAAI,KAAK,IAAI,CAAC,EAAE,CAAC;QACf,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACpC,CAAC;IAED,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC,CAAA;IAE/E,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,MAAM,EAAE,CAAA;AAC1C,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,GAAG,GAAG,IAAI,IAAI,KAAK,EAAE,EAAE,KAAK,GAAG,EAAE,EAAoB;IACnG,MAAM,KAAK,GAAG,eAAe,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,CAAA;IAEjD,OAAO,CACL,MAAC,IAAI,eACH,KAAC,YAAY,IAAC,MAAM,EAAC,QAAQ,YAAE,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,GAAgB,EACvE,KAAC,IAAI,IAAC,QAAQ,kBAAE,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,GAAQ,EAC9C,IAAI,KAAK,EAAE,IACP,CACR,CAAA;AACH,CAAC"}
@@ -0,0 +1,23 @@
1
+ import type { ReactNode } from 'react';
2
+ import { type Message } from '../init/segment.js';
3
+ /**
4
+ * What `QuestionHeader` takes.
5
+ */
6
+ interface QuestionHeaderProps {
7
+ /**
8
+ * The question: plain text, or segments, where a folder or name shows in the accent colour.
9
+ */
10
+ message: Message;
11
+ /**
12
+ * A line that helps answer it.
13
+ */
14
+ hint?: string | undefined;
15
+ }
16
+ /**
17
+ * The top of every question: `?` in the accent colour and the question bold, with the folders and names in it in the
18
+ * accent colour, then the hint dim, under the question, when there is one. A long question wraps to the terminal's
19
+ * width, and a long hint too, each of its lines indented to match.
20
+ */
21
+ export declare function QuestionHeader({ message, hint }: QuestionHeaderProps): ReactNode;
22
+ export {};
23
+ //# sourceMappingURL=question-header.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"question-header.d.ts","sourceRoot":"","sources":["../../src/terminal-ui/question-header.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,EAAE,KAAK,OAAO,EAAqB,MAAM,oBAAoB,CAAA;AAKpE;;GAEG;AACH,UAAU,mBAAmB;IAC3B;;OAEG;IACH,OAAO,EAAE,OAAO,CAAA;IAChB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC1B;AAYD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,mBAAmB,GAAG,SAAS,CAoBhF"}
@@ -0,0 +1,24 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box, Text, useWindowSize } from 'ink';
3
+ import { segmentsOfMessage } from '../init/segment.js';
4
+ import { ColouredText } from './coloured-text.js';
5
+ import { WrappedSegments } from './wrapped-segments.js';
6
+ import { WrappedText } from './wrapped-text.js';
7
+ /**
8
+ * How far the hint is indented, so it starts under the question.
9
+ */
10
+ const hintIndent = 2;
11
+ /**
12
+ * How many columns `? ` takes before the question.
13
+ */
14
+ const markerWidth = 2;
15
+ /**
16
+ * The top of every question: `?` in the accent colour and the question bold, with the folders and names in it in the
17
+ * accent colour, then the hint dim, under the question, when there is one. A long question wraps to the terminal's
18
+ * width, and a long hint too, each of its lines indented to match.
19
+ */
20
+ export function QuestionHeader({ message, hint }) {
21
+ const { columns } = useWindowSize();
22
+ return (_jsxs(_Fragment, { children: [_jsxs(Text, { children: [_jsx(ColouredText, { colour: "accent", children: "?" }), ' ', _jsx(Text, { bold: true, children: _jsx(WrappedSegments, { segments: segmentsOfMessage(message), width: columns - markerWidth }) })] }), hint === undefined ? null : (_jsx(Box, { marginLeft: hintIndent, children: _jsx(Text, { dimColor: true, children: _jsx(WrappedText, { indent: hintIndent, text: hint }) }) }))] }));
23
+ }
24
+ //# sourceMappingURL=question-header.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"question-header.js","sourceRoot":"","sources":["../../src/terminal-ui/question-header.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,KAAK,CAAA;AAE9C,OAAO,EAAgB,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAgB/C;;GAEG;AACH,MAAM,UAAU,GAAG,CAAC,CAAA;AAEpB;;GAEG;AACH,MAAM,WAAW,GAAG,CAAC,CAAA;AAErB;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,EAAE,OAAO,EAAE,IAAI,EAAuB;IACnE,MAAM,EAAE,OAAO,EAAE,GAAG,aAAa,EAAE,CAAA;IAEnC,OAAO,CACL,8BACE,MAAC,IAAI,eACH,KAAC,YAAY,IAAC,MAAM,EAAC,QAAQ,kBAAiB,EAAC,GAAG,EAClD,KAAC,IAAI,IAAC,IAAI,kBACR,KAAC,eAAe,IAAC,QAAQ,EAAE,iBAAiB,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,OAAO,GAAG,WAAW,GAAI,GAClF,IACF,EACN,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAC3B,KAAC,GAAG,IAAC,UAAU,EAAE,UAAU,YACzB,KAAC,IAAI,IAAC,QAAQ,kBACZ,KAAC,WAAW,IAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,GAAI,GAC1C,GACH,CACP,IACA,CACJ,CAAA;AACH,CAAC"}
@@ -0,0 +1,85 @@
1
+ import { type Key } from 'ink';
2
+ import type { Message } from '../init/segment.js';
3
+ /**
4
+ * What every question takes.
5
+ */
6
+ export interface QuestionProps<T> {
7
+ /**
8
+ * The question.
9
+ */
10
+ message: Message;
11
+ /**
12
+ * The answer the question starts on: what an empty text input gives, the side a yes or no question starts on, the
13
+ * choice a select question highlights first, or the values of the choices a checklist question starts with ticked.
14
+ */
15
+ defaultValue: T;
16
+ /**
17
+ * A line that helps answer the question.
18
+ */
19
+ hint?: string | undefined;
20
+ /**
21
+ * Takes the answer.
22
+ */
23
+ onSubmit: (value: T) => void;
24
+ /**
25
+ * Gives up on the question, on Ctrl+C or Ctrl+D.
26
+ */
27
+ onCancel: () => void;
28
+ }
29
+ /**
30
+ * How `useQuestionInput` hands on key presses.
31
+ */
32
+ interface QuestionInputOptions {
33
+ /**
34
+ * Whether the handler also gets keys pressed with Ctrl or Meta, other than Ctrl+C and Ctrl+D. The text question
35
+ * takes them, for Ctrl+U.
36
+ */
37
+ modifiedKeys?: boolean;
38
+ }
39
+ /**
40
+ * A question's state, as the last render drew it and as its key handler last left it.
41
+ */
42
+ interface LatestState<T> {
43
+ /**
44
+ * The state the last render drew.
45
+ */
46
+ value: T;
47
+ /**
48
+ * Gives the state the last `set` left, before React draws it.
49
+ */
50
+ latest: () => T;
51
+ /**
52
+ * Replaces the state.
53
+ */
54
+ set: (next: T) => void;
55
+ }
56
+ /**
57
+ * Whether a key press gives up on the question: Ctrl+C or Ctrl+D.
58
+ */
59
+ export declare function isCancelKey(input: string, key: Key): boolean;
60
+ /**
61
+ * Splits a chunk of input into the key presses it holds: the text between its line breaks, as typed, and Enter for each
62
+ * line break. Ink hands on text and the line breaks in it as one chunk when they arrive together, as when Enter follows
63
+ * typing at once, and would drop the Enter. A chunk without a line break is one key press, as it came.
64
+ */
65
+ export declare function keyPressesOf(input: string, key: Key): [string, Key][];
66
+ /**
67
+ * How far a key press moves the highlight or pointer: back one for ↑ or k, on one for ↓ or j, and nowhere for any
68
+ * other key.
69
+ */
70
+ export declare function stepOf(input: string, key: Key): number;
71
+ /**
72
+ * Hands a question's key presses to `handler`, after the keys every question shares: Ctrl+C and Ctrl+D call
73
+ * `onCancel`, and other keys pressed with Ctrl or Meta do nothing unless `options.modifiedKeys` lets them through. A
74
+ * chunk of input that holds line breaks reaches `handler` as its text and an Enter for each break. A bracketed paste
75
+ * arrives through Ink's paste events instead, whole.
76
+ */
77
+ export declare function useQuestionInput(onCancel: () => void, handler: (input: string, key: Key) => void, options?: QuestionInputOptions): void;
78
+ /**
79
+ * State a question's key handler reads back with `latest`. Ink runs the handler for every key in one chunk of input,
80
+ * such as `↓` and Enter sent together, before React draws again. A handler that read the drawn state would miss the
81
+ * keys before it in the chunk.
82
+ */
83
+ export declare function useLatestState<T>(initial: T): LatestState<T>;
84
+ export {};
85
+ //# sourceMappingURL=question.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../src/terminal-ui/question.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAY,MAAM,KAAK,CAAA;AAExC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAEjD;;GAEG;AACH,MAA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 -0,0 +1,77 @@
1
+ import { useInput } from 'ink';
2
+ import { useRef, useState } from 'react';
3
+ /**
4
+ * What ends a line in a chunk of input.
5
+ */
6
+ const lineBreak = /\r\n|\r|\n/;
7
+ /**
8
+ * Whether a key press gives up on the question: Ctrl+C or Ctrl+D.
9
+ */
10
+ export function isCancelKey(input, key) {
11
+ return key.ctrl && (input === 'c' || input === 'd');
12
+ }
13
+ /**
14
+ * Splits a chunk of input into the key presses it holds: the text between its line breaks, as typed, and Enter for each
15
+ * line break. Ink hands on text and the line breaks in it as one chunk when they arrive together, as when Enter follows
16
+ * typing at once, and would drop the Enter. A chunk without a line break is one key press, as it came.
17
+ */
18
+ export function keyPressesOf(input, key) {
19
+ const lines = input.split(lineBreak);
20
+ if (lines.length === 1) {
21
+ return [[input, key]];
22
+ }
23
+ const enter = { ...key, return: true };
24
+ return lines.flatMap((text, index) => [
25
+ ...(text === '' ? [] : [[text, key]]),
26
+ ...(index < lines.length - 1 ? [['', enter]] : []),
27
+ ]);
28
+ }
29
+ /**
30
+ * How far a key press moves the highlight or pointer: back one for ↑ or k, on one for ↓ or j, and nowhere for any
31
+ * other key.
32
+ */
33
+ export function stepOf(input, key) {
34
+ if (key.upArrow || input === 'k') {
35
+ return -1;
36
+ }
37
+ if (key.downArrow || input === 'j') {
38
+ return 1;
39
+ }
40
+ return 0;
41
+ }
42
+ /**
43
+ * Hands a question's key presses to `handler`, after the keys every question shares: Ctrl+C and Ctrl+D call
44
+ * `onCancel`, and other keys pressed with Ctrl or Meta do nothing unless `options.modifiedKeys` lets them through. A
45
+ * chunk of input that holds line breaks reaches `handler` as its text and an Enter for each break. A bracketed paste
46
+ * arrives through Ink's paste events instead, whole.
47
+ */
48
+ export function useQuestionInput(onCancel, handler, options = {}) {
49
+ useInput((input, key) => {
50
+ if (isCancelKey(input, key)) {
51
+ onCancel();
52
+ }
53
+ else if (options.modifiedKeys === true || !(key.ctrl || key.meta)) {
54
+ for (const [typed, pressed] of keyPressesOf(input, key)) {
55
+ handler(typed, pressed);
56
+ }
57
+ }
58
+ });
59
+ }
60
+ /**
61
+ * State a question's key handler reads back with `latest`. Ink runs the handler for every key in one chunk of input,
62
+ * such as `↓` and Enter sent together, before React draws again. A handler that read the drawn state would miss the
63
+ * keys before it in the chunk.
64
+ */
65
+ export function useLatestState(initial) {
66
+ const [value, setValue] = useState(initial);
67
+ const latest = useRef(initial);
68
+ return {
69
+ value,
70
+ latest: () => latest.current,
71
+ set: (next) => {
72
+ latest.current = next;
73
+ setValue(next);
74
+ },
75
+ };
76
+ }
77
+ //# sourceMappingURL=question.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"question.js","sourceRoot":"","sources":["../../src/terminal-ui/question.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,QAAQ,EAAE,MAAM,KAAK,CAAA;AACxC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AA2DxC;;GAEG;AACH,MAAM,SAAS,GAAG,YAAY,CAAA;AAE9B;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,KAAa,EAAE,GAAQ;IACjD,OAAO,GAAG,CAAC,IAAI,IAAI,CAAC,KAAK,KAAK,GAAG,IAAI,KAAK,KAAK,GAAG,CAAC,CAAA;AACrD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,KAAa,EAAE,GAAQ;IAClD,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA;IAEpC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,CAAC,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAA;IACvB,CAAC;IAED,MAAM,KAAK,GAAQ,EAAE,GAAG,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,CAAA;IAE3C,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK,EAAmB,EAAE,CAAC;QACrD,GAAG,CAAC,IAAI,KAAK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AAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAA;IAC3C,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,CAAA;IAE9B,OAAO;QACL,KAAK;QACL,MAAM,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO;QAC5B,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE;YACZ,MAAM,CAAC,OAAO,GAAG,IAAI,CAAA;YACrB,QAAQ,CAAC,IAAI,CAAC,CAAA;QAChB,CAAC;KACF,CAAA;AACH,CAAC"}
@@ -0,0 +1,19 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { Choice } from '../init/prompter.js';
3
+ import { type QuestionProps } from './question.js';
4
+ /**
5
+ * What `SelectQuestion` takes. `defaultValue` is the value of the choice highlighted at the start.
6
+ */
7
+ interface SelectQuestionProps<T extends string> extends QuestionProps<T> {
8
+ /**
9
+ * The answers, in the order they show. There is at least one.
10
+ */
11
+ choices: readonly [Choice<T>, ...Choice<T>[]];
12
+ }
13
+ /**
14
+ * Asks the person to pick one of a list. ↑/↓ or k/j move, wrapping round at the ends, and Enter picks the highlighted
15
+ * choice. Other keys with Ctrl or Meta do nothing.
16
+ */
17
+ export declare function SelectQuestion<T extends string>({ message, choices, defaultValue, hint, onSubmit, onCancel, }: SelectQuestionProps<T>): ReactNode;
18
+ export {};
19
+ //# sourceMappingURL=select-question.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"select-question.d.ts","sourceRoot":"","sources":["../../src/terminal-ui/select-question.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAEjD,OAAO,EAAE,KAAK,aAAa,EAA4C,MAAM,eAAe,CAAA;AAG5F;;GAEG;AACH,UAAU,mBAAmB,CAAC,CAAC,SAAS,MAAM,CAAE,SAAQ,aAAa,CAAC,CAAC,CAAC;IACtE;;OAEG;IACH,OAAO,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;CAC9C;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,MAAM,EAAE,EAC/C,OAAO,EACP,OAAO,EACP,YAAY,EACZ,IAAI,EACJ,QAAQ,EACR,QAAQ,GACT,EAAE,mBAAmB,CAAC,CAAC,CAAC,GAAG,SAAS,CA2BpC"}