terminal-pilot 0.0.30 → 0.0.31

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 (328) hide show
  1. package/dist/cli.js +1375 -435
  2. package/dist/cli.js.map +4 -4
  3. package/dist/commands/close-session.js +485 -6
  4. package/dist/commands/close-session.js.map +4 -4
  5. package/dist/commands/create-session.js +485 -6
  6. package/dist/commands/create-session.js.map +4 -4
  7. package/dist/commands/fill.js +485 -6
  8. package/dist/commands/fill.js.map +4 -4
  9. package/dist/commands/get-session.js +485 -6
  10. package/dist/commands/get-session.js.map +4 -4
  11. package/dist/commands/index.js +626 -44
  12. package/dist/commands/index.js.map +4 -4
  13. package/dist/commands/install.js +622 -40
  14. package/dist/commands/install.js.map +4 -4
  15. package/dist/commands/installer.js +68 -17
  16. package/dist/commands/installer.js.map +4 -4
  17. package/dist/commands/list-sessions.js +485 -6
  18. package/dist/commands/list-sessions.js.map +4 -4
  19. package/dist/commands/press-key.js +485 -6
  20. package/dist/commands/press-key.js.map +4 -4
  21. package/dist/commands/read-history.js +485 -6
  22. package/dist/commands/read-history.js.map +4 -4
  23. package/dist/commands/read-screen.js +485 -6
  24. package/dist/commands/read-screen.js.map +4 -4
  25. package/dist/commands/resize.js +485 -6
  26. package/dist/commands/resize.js.map +4 -4
  27. package/dist/commands/screenshot.js +485 -6
  28. package/dist/commands/screenshot.js.map +4 -4
  29. package/dist/commands/send-signal.js +485 -6
  30. package/dist/commands/send-signal.js.map +4 -4
  31. package/dist/commands/type.js +485 -6
  32. package/dist/commands/type.js.map +4 -4
  33. package/dist/commands/uninstall.js +550 -20
  34. package/dist/commands/uninstall.js.map +4 -4
  35. package/dist/commands/wait-for-exit.js +485 -6
  36. package/dist/commands/wait-for-exit.js.map +4 -4
  37. package/dist/commands/wait-for.js +485 -6
  38. package/dist/commands/wait-for.js.map +4 -4
  39. package/dist/testing/cli-repl.js +1375 -435
  40. package/dist/testing/cli-repl.js.map +4 -4
  41. package/dist/testing/qa-cli.js +1385 -445
  42. package/dist/testing/qa-cli.js.map +4 -4
  43. package/node_modules/@poe-code/agent-defs/README.md +35 -0
  44. package/node_modules/@poe-code/agent-defs/dist/agents/claude-code.d.ts +2 -0
  45. package/node_modules/@poe-code/agent-defs/dist/agents/claude-code.js +21 -0
  46. package/node_modules/@poe-code/agent-defs/dist/agents/claude-desktop.d.ts +2 -0
  47. package/node_modules/@poe-code/agent-defs/dist/agents/claude-desktop.js +18 -0
  48. package/node_modules/@poe-code/agent-defs/dist/agents/codex.d.ts +2 -0
  49. package/node_modules/@poe-code/agent-defs/dist/agents/codex.js +25 -0
  50. package/node_modules/@poe-code/agent-defs/dist/agents/cursor.d.ts +2 -0
  51. package/node_modules/@poe-code/agent-defs/dist/agents/cursor.js +15 -0
  52. package/node_modules/@poe-code/agent-defs/dist/agents/gemini-cli.d.ts +2 -0
  53. package/node_modules/@poe-code/agent-defs/dist/agents/gemini-cli.js +16 -0
  54. package/node_modules/@poe-code/agent-defs/dist/agents/goose.d.ts +2 -0
  55. package/node_modules/@poe-code/agent-defs/dist/agents/goose.js +16 -0
  56. package/node_modules/@poe-code/agent-defs/dist/agents/index.d.ts +9 -0
  57. package/node_modules/@poe-code/agent-defs/dist/agents/index.js +9 -0
  58. package/node_modules/@poe-code/agent-defs/dist/agents/kimi.d.ts +2 -0
  59. package/node_modules/@poe-code/agent-defs/dist/agents/kimi.js +16 -0
  60. package/node_modules/@poe-code/agent-defs/dist/agents/opencode.d.ts +2 -0
  61. package/node_modules/@poe-code/agent-defs/dist/agents/opencode.js +20 -0
  62. package/node_modules/@poe-code/agent-defs/dist/agents/poe-agent.d.ts +2 -0
  63. package/node_modules/@poe-code/agent-defs/dist/agents/poe-agent.js +14 -0
  64. package/node_modules/@poe-code/agent-defs/dist/index.d.ts +5 -0
  65. package/node_modules/@poe-code/agent-defs/dist/index.js +3 -0
  66. package/node_modules/@poe-code/agent-defs/dist/registry.d.ts +3 -0
  67. package/node_modules/@poe-code/agent-defs/dist/registry.js +45 -0
  68. package/node_modules/@poe-code/agent-defs/dist/specifier.d.ts +7 -0
  69. package/node_modules/@poe-code/agent-defs/dist/specifier.js +40 -0
  70. package/node_modules/@poe-code/agent-defs/dist/types.d.ts +28 -0
  71. package/node_modules/@poe-code/agent-defs/dist/types.js +1 -0
  72. package/node_modules/@poe-code/agent-defs/package.json +20 -0
  73. package/node_modules/@poe-code/agent-skill-config/dist/apply.js +2 -1
  74. package/node_modules/@poe-code/agent-skill-config/dist/bridge-active-skills.d.ts +1 -0
  75. package/node_modules/@poe-code/agent-skill-config/dist/bridge-active-skills.js +37 -18
  76. package/node_modules/@poe-code/agent-skill-config/dist/resolve-skill-reference.js +8 -4
  77. package/node_modules/@poe-code/agent-skill-config/package.json +1 -5
  78. package/node_modules/@poe-code/config-mutations/README.md +55 -0
  79. package/node_modules/@poe-code/config-mutations/dist/error-codes.d.ts +1 -0
  80. package/node_modules/@poe-code/config-mutations/dist/error-codes.js +6 -0
  81. package/node_modules/@poe-code/config-mutations/dist/execution/apply-mutation.d.ts +6 -0
  82. package/node_modules/@poe-code/config-mutations/dist/execution/apply-mutation.js +829 -0
  83. package/node_modules/@poe-code/config-mutations/dist/execution/path-utils.d.ts +17 -0
  84. package/node_modules/@poe-code/config-mutations/dist/execution/path-utils.js +64 -0
  85. package/node_modules/@poe-code/config-mutations/dist/execution/run-mutations.d.ts +7 -0
  86. package/node_modules/@poe-code/config-mutations/dist/execution/run-mutations.js +39 -0
  87. package/node_modules/@poe-code/config-mutations/dist/formats/index.d.ts +13 -0
  88. package/node_modules/@poe-code/config-mutations/dist/formats/index.js +49 -0
  89. package/node_modules/@poe-code/config-mutations/dist/formats/json.d.ts +32 -0
  90. package/node_modules/@poe-code/config-mutations/dist/formats/json.js +171 -0
  91. package/node_modules/@poe-code/config-mutations/dist/formats/object.d.ts +4 -0
  92. package/node_modules/@poe-code/config-mutations/dist/formats/object.js +27 -0
  93. package/node_modules/@poe-code/config-mutations/dist/formats/toml.d.ts +2 -0
  94. package/node_modules/@poe-code/config-mutations/dist/formats/toml.js +75 -0
  95. package/node_modules/@poe-code/config-mutations/dist/formats/yaml.d.ts +2 -0
  96. package/node_modules/@poe-code/config-mutations/dist/formats/yaml.js +76 -0
  97. package/node_modules/@poe-code/config-mutations/dist/fs-utils.d.ts +18 -0
  98. package/node_modules/@poe-code/config-mutations/dist/fs-utils.js +43 -0
  99. package/node_modules/@poe-code/config-mutations/dist/index.d.ts +8 -0
  100. package/node_modules/@poe-code/config-mutations/dist/index.js +8 -0
  101. package/node_modules/@poe-code/config-mutations/dist/mutations/config-mutation.d.ts +47 -0
  102. package/node_modules/@poe-code/config-mutations/dist/mutations/config-mutation.js +34 -0
  103. package/node_modules/@poe-code/config-mutations/dist/mutations/file-mutation.d.ts +62 -0
  104. package/node_modules/@poe-code/config-mutations/dist/mutations/file-mutation.js +55 -0
  105. package/node_modules/@poe-code/config-mutations/dist/mutations/template-mutation.d.ts +40 -0
  106. package/node_modules/@poe-code/config-mutations/dist/mutations/template-mutation.js +32 -0
  107. package/node_modules/@poe-code/config-mutations/dist/template/render.d.ts +6 -0
  108. package/node_modules/@poe-code/config-mutations/dist/template/render.js +8 -0
  109. package/node_modules/@poe-code/config-mutations/dist/testing/format-utils.d.ts +7 -0
  110. package/node_modules/@poe-code/config-mutations/dist/testing/format-utils.js +21 -0
  111. package/node_modules/@poe-code/config-mutations/dist/testing/index.d.ts +3 -0
  112. package/node_modules/@poe-code/config-mutations/dist/testing/index.js +2 -0
  113. package/node_modules/@poe-code/config-mutations/dist/testing/mock-fs.d.ts +25 -0
  114. package/node_modules/@poe-code/config-mutations/dist/testing/mock-fs.js +194 -0
  115. package/node_modules/@poe-code/config-mutations/dist/types.d.ts +168 -0
  116. package/node_modules/@poe-code/config-mutations/dist/types.js +6 -0
  117. package/node_modules/@poe-code/config-mutations/package.json +29 -0
  118. package/node_modules/@poe-code/frontmatter/README.md +35 -0
  119. package/node_modules/@poe-code/frontmatter/dist/fences.d.ts +25 -0
  120. package/node_modules/@poe-code/frontmatter/dist/fences.js +100 -0
  121. package/node_modules/@poe-code/frontmatter/dist/index.d.ts +3 -0
  122. package/node_modules/@poe-code/frontmatter/dist/index.js +3 -0
  123. package/node_modules/@poe-code/frontmatter/dist/parse.d.ts +20 -0
  124. package/node_modules/@poe-code/frontmatter/dist/parse.js +209 -0
  125. package/node_modules/@poe-code/frontmatter/dist/stringify.d.ts +1 -0
  126. package/node_modules/@poe-code/frontmatter/dist/stringify.js +48 -0
  127. package/node_modules/@poe-code/frontmatter/package.json +25 -0
  128. package/node_modules/toolcraft-design/README.md +160 -0
  129. package/node_modules/toolcraft-design/dist/acp/components.d.ts +12 -0
  130. package/node_modules/toolcraft-design/dist/acp/components.js +137 -0
  131. package/node_modules/toolcraft-design/dist/acp/index.d.ts +3 -0
  132. package/node_modules/toolcraft-design/dist/acp/index.js +2 -0
  133. package/node_modules/toolcraft-design/dist/acp/writer.d.ts +13 -0
  134. package/node_modules/toolcraft-design/dist/acp/writer.js +21 -0
  135. package/node_modules/toolcraft-design/dist/components/browser.d.ts +15 -0
  136. package/node_modules/toolcraft-design/dist/components/browser.js +31 -0
  137. package/node_modules/toolcraft-design/dist/components/catalog.d.ts +26 -0
  138. package/node_modules/toolcraft-design/dist/components/catalog.js +95 -0
  139. package/node_modules/toolcraft-design/dist/components/color.d.ts +31 -0
  140. package/node_modules/toolcraft-design/dist/components/color.js +102 -0
  141. package/node_modules/toolcraft-design/dist/components/command-errors.d.ts +16 -0
  142. package/node_modules/toolcraft-design/dist/components/command-errors.js +23 -0
  143. package/node_modules/toolcraft-design/dist/components/detail-card.d.ts +22 -0
  144. package/node_modules/toolcraft-design/dist/components/detail-card.js +45 -0
  145. package/node_modules/toolcraft-design/dist/components/help-formatter-plain.d.ts +5 -0
  146. package/node_modules/toolcraft-design/dist/components/help-formatter-plain.js +132 -0
  147. package/node_modules/toolcraft-design/dist/components/help-formatter.d.ts +33 -0
  148. package/node_modules/toolcraft-design/dist/components/help-formatter.js +213 -0
  149. package/node_modules/toolcraft-design/dist/components/index.d.ts +16 -0
  150. package/node_modules/toolcraft-design/dist/components/index.js +10 -0
  151. package/node_modules/toolcraft-design/dist/components/logger.d.ts +11 -0
  152. package/node_modules/toolcraft-design/dist/components/logger.js +60 -0
  153. package/node_modules/toolcraft-design/dist/components/symbols.d.ts +12 -0
  154. package/node_modules/toolcraft-design/dist/components/symbols.js +71 -0
  155. package/node_modules/toolcraft-design/dist/components/table.d.ts +15 -0
  156. package/node_modules/toolcraft-design/dist/components/table.js +302 -0
  157. package/node_modules/toolcraft-design/dist/components/template.d.ts +10 -0
  158. package/node_modules/toolcraft-design/dist/components/template.js +437 -0
  159. package/node_modules/toolcraft-design/dist/components/text.d.ts +16 -0
  160. package/node_modules/toolcraft-design/dist/components/text.js +145 -0
  161. package/node_modules/toolcraft-design/dist/dashboard/ansi.d.ts +18 -0
  162. package/node_modules/toolcraft-design/dist/dashboard/ansi.js +343 -0
  163. package/node_modules/toolcraft-design/dist/dashboard/buffer.d.ts +25 -0
  164. package/node_modules/toolcraft-design/dist/dashboard/buffer.js +219 -0
  165. package/node_modules/toolcraft-design/dist/dashboard/components/border.d.ts +9 -0
  166. package/node_modules/toolcraft-design/dist/dashboard/components/border.js +123 -0
  167. package/node_modules/toolcraft-design/dist/dashboard/components/footer.d.ts +8 -0
  168. package/node_modules/toolcraft-design/dist/dashboard/components/footer.js +56 -0
  169. package/node_modules/toolcraft-design/dist/dashboard/components/output-pane.d.ts +12 -0
  170. package/node_modules/toolcraft-design/dist/dashboard/components/output-pane.js +268 -0
  171. package/node_modules/toolcraft-design/dist/dashboard/components/stats-pane.d.ts +7 -0
  172. package/node_modules/toolcraft-design/dist/dashboard/components/stats-pane.js +107 -0
  173. package/node_modules/toolcraft-design/dist/dashboard/dashboard.d.ts +20 -0
  174. package/node_modules/toolcraft-design/dist/dashboard/dashboard.js +167 -0
  175. package/node_modules/toolcraft-design/dist/dashboard/demo.d.ts +13 -0
  176. package/node_modules/toolcraft-design/dist/dashboard/demo.js +145 -0
  177. package/node_modules/toolcraft-design/dist/dashboard/index.d.ts +8 -0
  178. package/node_modules/toolcraft-design/dist/dashboard/index.js +4 -0
  179. package/node_modules/toolcraft-design/dist/dashboard/keymap.d.ts +8 -0
  180. package/node_modules/toolcraft-design/dist/dashboard/keymap.js +233 -0
  181. package/node_modules/toolcraft-design/dist/dashboard/layout.d.ts +25 -0
  182. package/node_modules/toolcraft-design/dist/dashboard/layout.js +79 -0
  183. package/node_modules/toolcraft-design/dist/dashboard/should-use-dashboard.d.ts +10 -0
  184. package/node_modules/toolcraft-design/dist/dashboard/should-use-dashboard.js +7 -0
  185. package/node_modules/toolcraft-design/dist/dashboard/snapshot.d.ts +10 -0
  186. package/node_modules/toolcraft-design/dist/dashboard/snapshot.js +68 -0
  187. package/node_modules/toolcraft-design/dist/dashboard/store.d.ts +8 -0
  188. package/node_modules/toolcraft-design/dist/dashboard/store.js +51 -0
  189. package/node_modules/toolcraft-design/dist/dashboard/terminal-width.d.ts +4 -0
  190. package/node_modules/toolcraft-design/dist/dashboard/terminal-width.js +71 -0
  191. package/node_modules/toolcraft-design/dist/dashboard/terminal.d.ts +37 -0
  192. package/node_modules/toolcraft-design/dist/dashboard/terminal.js +264 -0
  193. package/node_modules/toolcraft-design/dist/dashboard/types.d.ts +38 -0
  194. package/node_modules/toolcraft-design/dist/dashboard/types.js +1 -0
  195. package/node_modules/toolcraft-design/dist/explorer/actions.d.ts +16 -0
  196. package/node_modules/toolcraft-design/dist/explorer/actions.js +39 -0
  197. package/node_modules/toolcraft-design/dist/explorer/demo.d.ts +13 -0
  198. package/node_modules/toolcraft-design/dist/explorer/demo.js +297 -0
  199. package/node_modules/toolcraft-design/dist/explorer/events.d.ts +67 -0
  200. package/node_modules/toolcraft-design/dist/explorer/events.js +1 -0
  201. package/node_modules/toolcraft-design/dist/explorer/filter.d.ts +10 -0
  202. package/node_modules/toolcraft-design/dist/explorer/filter.js +95 -0
  203. package/node_modules/toolcraft-design/dist/explorer/index.d.ts +8 -0
  204. package/node_modules/toolcraft-design/dist/explorer/index.js +8 -0
  205. package/node_modules/toolcraft-design/dist/explorer/jobs.d.ts +7 -0
  206. package/node_modules/toolcraft-design/dist/explorer/jobs.js +59 -0
  207. package/node_modules/toolcraft-design/dist/explorer/keymap.d.ts +21 -0
  208. package/node_modules/toolcraft-design/dist/explorer/keymap.js +376 -0
  209. package/node_modules/toolcraft-design/dist/explorer/layout.d.ts +20 -0
  210. package/node_modules/toolcraft-design/dist/explorer/layout.js +73 -0
  211. package/node_modules/toolcraft-design/dist/explorer/reducer.d.ts +9 -0
  212. package/node_modules/toolcraft-design/dist/explorer/reducer.js +782 -0
  213. package/node_modules/toolcraft-design/dist/explorer/render/detail.d.ts +4 -0
  214. package/node_modules/toolcraft-design/dist/explorer/render/detail.js +97 -0
  215. package/node_modules/toolcraft-design/dist/explorer/render/footer.d.ts +4 -0
  216. package/node_modules/toolcraft-design/dist/explorer/render/footer.js +73 -0
  217. package/node_modules/toolcraft-design/dist/explorer/render/header.d.ts +4 -0
  218. package/node_modules/toolcraft-design/dist/explorer/render/header.js +49 -0
  219. package/node_modules/toolcraft-design/dist/explorer/render/index.d.ts +8 -0
  220. package/node_modules/toolcraft-design/dist/explorer/render/index.js +53 -0
  221. package/node_modules/toolcraft-design/dist/explorer/render/list.d.ts +4 -0
  222. package/node_modules/toolcraft-design/dist/explorer/render/list.js +116 -0
  223. package/node_modules/toolcraft-design/dist/explorer/render/modal.d.ts +3 -0
  224. package/node_modules/toolcraft-design/dist/explorer/render/modal.js +87 -0
  225. package/node_modules/toolcraft-design/dist/explorer/render/test-fixtures.d.ts +8 -0
  226. package/node_modules/toolcraft-design/dist/explorer/render/test-fixtures.js +156 -0
  227. package/node_modules/toolcraft-design/dist/explorer/render/text.d.ts +12 -0
  228. package/node_modules/toolcraft-design/dist/explorer/render/text.js +81 -0
  229. package/node_modules/toolcraft-design/dist/explorer/runtime.d.ts +2 -0
  230. package/node_modules/toolcraft-design/dist/explorer/runtime.js +340 -0
  231. package/node_modules/toolcraft-design/dist/explorer/runtime.test-helpers.d.ts +50 -0
  232. package/node_modules/toolcraft-design/dist/explorer/runtime.test-helpers.js +101 -0
  233. package/node_modules/toolcraft-design/dist/explorer/state.d.ts +137 -0
  234. package/node_modules/toolcraft-design/dist/explorer/state.js +86 -0
  235. package/node_modules/toolcraft-design/dist/explorer/theme.d.ts +27 -0
  236. package/node_modules/toolcraft-design/dist/explorer/theme.js +29 -0
  237. package/node_modules/toolcraft-design/dist/index.d.ts +50 -0
  238. package/node_modules/toolcraft-design/dist/index.js +43 -0
  239. package/node_modules/toolcraft-design/dist/internal/color-support.d.ts +9 -0
  240. package/node_modules/toolcraft-design/dist/internal/color-support.js +12 -0
  241. package/node_modules/toolcraft-design/dist/internal/output-format.d.ts +6 -0
  242. package/node_modules/toolcraft-design/dist/internal/output-format.js +22 -0
  243. package/node_modules/toolcraft-design/dist/internal/strip-ansi.d.ts +1 -0
  244. package/node_modules/toolcraft-design/dist/internal/strip-ansi.js +50 -0
  245. package/node_modules/toolcraft-design/dist/internal/theme-detect.d.ts +12 -0
  246. package/node_modules/toolcraft-design/dist/internal/theme-detect.js +71 -0
  247. package/node_modules/toolcraft-design/dist/internal/theme-state.d.ts +12 -0
  248. package/node_modules/toolcraft-design/dist/internal/theme-state.js +35 -0
  249. package/node_modules/toolcraft-design/dist/prompts/index.d.ts +91 -0
  250. package/node_modules/toolcraft-design/dist/prompts/index.js +137 -0
  251. package/node_modules/toolcraft-design/dist/prompts/interactive/cancel-symbol.d.ts +2 -0
  252. package/node_modules/toolcraft-design/dist/prompts/interactive/cancel-symbol.js +4 -0
  253. package/node_modules/toolcraft-design/dist/prompts/interactive/confirm.d.ts +9 -0
  254. package/node_modules/toolcraft-design/dist/prompts/interactive/confirm.js +47 -0
  255. package/node_modules/toolcraft-design/dist/prompts/interactive/core.d.ts +55 -0
  256. package/node_modules/toolcraft-design/dist/prompts/interactive/core.js +274 -0
  257. package/node_modules/toolcraft-design/dist/prompts/interactive/glyphs.d.ts +20 -0
  258. package/node_modules/toolcraft-design/dist/prompts/interactive/glyphs.js +53 -0
  259. package/node_modules/toolcraft-design/dist/prompts/interactive/index.d.ts +6 -0
  260. package/node_modules/toolcraft-design/dist/prompts/interactive/index.js +6 -0
  261. package/node_modules/toolcraft-design/dist/prompts/interactive/keys.d.ts +2 -0
  262. package/node_modules/toolcraft-design/dist/prompts/interactive/keys.js +28 -0
  263. package/node_modules/toolcraft-design/dist/prompts/interactive/multiselect.d.ts +13 -0
  264. package/node_modules/toolcraft-design/dist/prompts/interactive/multiselect.js +131 -0
  265. package/node_modules/toolcraft-design/dist/prompts/interactive/pagination.d.ts +10 -0
  266. package/node_modules/toolcraft-design/dist/prompts/interactive/pagination.js +52 -0
  267. package/node_modules/toolcraft-design/dist/prompts/interactive/password.d.ts +10 -0
  268. package/node_modules/toolcraft-design/dist/prompts/interactive/password.js +55 -0
  269. package/node_modules/toolcraft-design/dist/prompts/interactive/select.d.ts +18 -0
  270. package/node_modules/toolcraft-design/dist/prompts/interactive/select.js +89 -0
  271. package/node_modules/toolcraft-design/dist/prompts/interactive/test-helpers.d.ts +21 -0
  272. package/node_modules/toolcraft-design/dist/prompts/interactive/test-helpers.js +32 -0
  273. package/node_modules/toolcraft-design/dist/prompts/interactive/text.d.ts +12 -0
  274. package/node_modules/toolcraft-design/dist/prompts/interactive/text.js +60 -0
  275. package/node_modules/toolcraft-design/dist/prompts/interactive/wrap.d.ts +4 -0
  276. package/node_modules/toolcraft-design/dist/prompts/interactive/wrap.js +18 -0
  277. package/node_modules/toolcraft-design/dist/prompts/primitives/cancel.d.ts +2 -0
  278. package/node_modules/toolcraft-design/dist/prompts/primitives/cancel.js +9 -0
  279. package/node_modules/toolcraft-design/dist/prompts/primitives/intro.d.ts +1 -0
  280. package/node_modules/toolcraft-design/dist/prompts/primitives/intro.js +16 -0
  281. package/node_modules/toolcraft-design/dist/prompts/primitives/log.d.ts +18 -0
  282. package/node_modules/toolcraft-design/dist/prompts/primitives/log.js +104 -0
  283. package/node_modules/toolcraft-design/dist/prompts/primitives/note.d.ts +1 -0
  284. package/node_modules/toolcraft-design/dist/prompts/primitives/note.js +39 -0
  285. package/node_modules/toolcraft-design/dist/prompts/primitives/outro.d.ts +1 -0
  286. package/node_modules/toolcraft-design/dist/prompts/primitives/outro.js +16 -0
  287. package/node_modules/toolcraft-design/dist/prompts/primitives/spinner.d.ts +6 -0
  288. package/node_modules/toolcraft-design/dist/prompts/primitives/spinner.js +74 -0
  289. package/node_modules/toolcraft-design/dist/prompts/theme.d.ts +11 -0
  290. package/node_modules/toolcraft-design/dist/prompts/theme.js +15 -0
  291. package/node_modules/toolcraft-design/dist/static/index.d.ts +4 -0
  292. package/node_modules/toolcraft-design/dist/static/index.js +2 -0
  293. package/node_modules/toolcraft-design/dist/static/menu.d.ts +11 -0
  294. package/node_modules/toolcraft-design/dist/static/menu.js +42 -0
  295. package/node_modules/toolcraft-design/dist/static/spinner.d.ts +14 -0
  296. package/node_modules/toolcraft-design/dist/static/spinner.js +52 -0
  297. package/node_modules/toolcraft-design/dist/terminal-markdown/ast.d.ts +92 -0
  298. package/node_modules/toolcraft-design/dist/terminal-markdown/ast.js +1 -0
  299. package/node_modules/toolcraft-design/dist/terminal-markdown/demo-content.d.ts +2 -0
  300. package/node_modules/toolcraft-design/dist/terminal-markdown/demo-content.js +139 -0
  301. package/node_modules/toolcraft-design/dist/terminal-markdown/index.d.ts +6 -0
  302. package/node_modules/toolcraft-design/dist/terminal-markdown/index.js +8 -0
  303. package/node_modules/toolcraft-design/dist/terminal-markdown/parser/block.d.ts +7 -0
  304. package/node_modules/toolcraft-design/dist/terminal-markdown/parser/block.js +1495 -0
  305. package/node_modules/toolcraft-design/dist/terminal-markdown/parser/frontmatter.d.ts +8 -0
  306. package/node_modules/toolcraft-design/dist/terminal-markdown/parser/frontmatter.js +36 -0
  307. package/node_modules/toolcraft-design/dist/terminal-markdown/parser/inline.d.ts +10 -0
  308. package/node_modules/toolcraft-design/dist/terminal-markdown/parser/inline.js +1190 -0
  309. package/node_modules/toolcraft-design/dist/terminal-markdown/parser.d.ts +5 -0
  310. package/node_modules/toolcraft-design/dist/terminal-markdown/parser.js +42 -0
  311. package/node_modules/toolcraft-design/dist/terminal-markdown/renderer.d.ts +6 -0
  312. package/node_modules/toolcraft-design/dist/terminal-markdown/renderer.js +615 -0
  313. package/node_modules/toolcraft-design/dist/terminal-markdown/testing/theme-render-fixture.d.ts +1 -0
  314. package/node_modules/toolcraft-design/dist/terminal-markdown/testing/theme-render-fixture.js +27 -0
  315. package/node_modules/toolcraft-design/dist/tokens/brand.d.ts +5 -0
  316. package/node_modules/toolcraft-design/dist/tokens/brand.js +5 -0
  317. package/node_modules/toolcraft-design/dist/tokens/colors.d.ts +37 -0
  318. package/node_modules/toolcraft-design/dist/tokens/colors.js +85 -0
  319. package/node_modules/toolcraft-design/dist/tokens/index.d.ts +6 -0
  320. package/node_modules/toolcraft-design/dist/tokens/index.js +5 -0
  321. package/node_modules/toolcraft-design/dist/tokens/spacing.d.ts +6 -0
  322. package/node_modules/toolcraft-design/dist/tokens/spacing.js +6 -0
  323. package/node_modules/toolcraft-design/dist/tokens/typography.d.ts +7 -0
  324. package/node_modules/toolcraft-design/dist/tokens/typography.js +8 -0
  325. package/node_modules/toolcraft-design/dist/tokens/widths.d.ts +5 -0
  326. package/node_modules/toolcraft-design/dist/tokens/widths.js +5 -0
  327. package/node_modules/toolcraft-design/package.json +44 -0
  328. package/package.json +15 -5
@@ -79,6 +79,9 @@ function isOptionalSchema(schema) {
79
79
  function getRequiredKeys(schema) {
80
80
  return Object.keys(schema.shape).filter((key) => !isOptionalSchema(schema.shape[key])).sort();
81
81
  }
82
+ function getRequiredKeyFingerprint(schema) {
83
+ return getRequiredKeys(schema).join("+");
84
+ }
82
85
  function assertUniqueRequiredKeyFingerprints(branches) {
83
86
  const fingerprints = /* @__PURE__ */ new Map();
84
87
  branches.forEach((branch, index) => {
@@ -116,6 +119,451 @@ function Union(branches) {
116
119
  };
117
120
  }
118
121
 
122
+ // ../toolcraft-schema/src/validate.ts
123
+ var missingValue = /* @__PURE__ */ Symbol("missingValue");
124
+ function validate(schema, value) {
125
+ const state = { issues: [] };
126
+ const result = walkSchema(schema, value, [], state);
127
+ if (state.issues.length > 0) {
128
+ return { ok: false, issues: state.issues };
129
+ }
130
+ return { ok: true, value: result.present ? result.value : void 0 };
131
+ }
132
+ function walkSchema(schema, value, path10, state) {
133
+ if (schema.kind === "optional") {
134
+ return walkOptional(schema, value, path10, state);
135
+ }
136
+ if (value === missingValue) {
137
+ addIssue(
138
+ state,
139
+ path10,
140
+ expectedFor(schema),
141
+ "missing",
142
+ `Expected ${expectedFor(schema)} at ${formatPath(path10)}`
143
+ );
144
+ return { present: false };
145
+ }
146
+ if (value === null && schema.nullable === true) {
147
+ return { present: true, value };
148
+ }
149
+ switch (schema.kind) {
150
+ case "string":
151
+ return walkString(schema, value, path10, state);
152
+ case "number":
153
+ return walkNumber(schema, value, path10, state);
154
+ case "boolean":
155
+ return walkBoolean(value, path10, state);
156
+ case "enum":
157
+ return walkEnum(schema, value, path10, state);
158
+ case "array":
159
+ return walkArray(schema, value, path10, state);
160
+ case "object":
161
+ return walkObject(schema, value, path10, state);
162
+ case "oneOf":
163
+ return walkOneOf(schema, value, path10, state);
164
+ case "union":
165
+ return walkUnion(schema, value, path10, state);
166
+ case "record":
167
+ return walkRecord(schema, value, path10, state);
168
+ case "json":
169
+ return walkJson(value, path10, state);
170
+ }
171
+ }
172
+ function walkOptional(schema, value, path10, state) {
173
+ if (value === missingValue || value === void 0) {
174
+ const defaultValue = getDefault(schema.inner);
175
+ if (defaultValue.present) {
176
+ return walkSchema(schema.inner, cloneDefault(defaultValue.value), path10, state);
177
+ }
178
+ return { present: false };
179
+ }
180
+ return walkSchema(schema.inner, value, path10, state);
181
+ }
182
+ function walkString(schema, value, path10, state) {
183
+ if (typeof value !== "string") {
184
+ addExpectedIssue(state, path10, "string", value);
185
+ return { present: true, value };
186
+ }
187
+ if (schema.minLength !== void 0 && value.length < schema.minLength) {
188
+ const expected = `string with length at least ${schema.minLength}`;
189
+ addIssue(
190
+ state,
191
+ path10,
192
+ expected,
193
+ `string with length ${value.length}`,
194
+ `Expected ${expected} at ${formatPath(path10)}`
195
+ );
196
+ }
197
+ if (schema.maxLength !== void 0 && value.length > schema.maxLength) {
198
+ const expected = `string with length at most ${schema.maxLength}`;
199
+ addIssue(
200
+ state,
201
+ path10,
202
+ expected,
203
+ `string with length ${value.length}`,
204
+ `Expected ${expected} at ${formatPath(path10)}`
205
+ );
206
+ }
207
+ if (schema.pattern !== void 0) {
208
+ const pattern = compilePattern(schema.pattern);
209
+ if (pattern === void 0 || !pattern.test(value)) {
210
+ const expected = `string matching pattern ${schema.pattern}`;
211
+ addIssue(state, path10, expected, value, `Expected ${expected} at ${formatPath(path10)}`);
212
+ }
213
+ }
214
+ return { present: true, value };
215
+ }
216
+ function walkNumber(schema, value, path10, state) {
217
+ if (typeof value !== "number" || !Number.isFinite(value)) {
218
+ addExpectedIssue(state, path10, schema.jsonType === "integer" ? "integer" : "number", value);
219
+ return { present: true, value };
220
+ }
221
+ if (schema.jsonType === "integer" && !Number.isInteger(value)) {
222
+ addExpectedIssue(state, path10, "integer", value);
223
+ }
224
+ if (schema.minimum !== void 0 && value < schema.minimum) {
225
+ const expected = `number greater than or equal to ${schema.minimum}`;
226
+ addIssue(state, path10, expected, String(value), `Expected ${expected} at ${formatPath(path10)}`);
227
+ }
228
+ if (schema.maximum !== void 0 && value > schema.maximum) {
229
+ const expected = `number less than or equal to ${schema.maximum}`;
230
+ addIssue(state, path10, expected, String(value), `Expected ${expected} at ${formatPath(path10)}`);
231
+ }
232
+ return { present: true, value };
233
+ }
234
+ function walkBoolean(value, path10, state) {
235
+ if (typeof value !== "boolean") {
236
+ addExpectedIssue(state, path10, "boolean", value);
237
+ }
238
+ return { present: true, value };
239
+ }
240
+ function walkEnum(schema, value, path10, state) {
241
+ if (!schema.values.includes(value)) {
242
+ const expected = `one of ${schema.values.join(", ")}`;
243
+ addIssue(
244
+ state,
245
+ path10,
246
+ expected,
247
+ receivedValue(value),
248
+ `Expected ${expected} at ${formatPath(path10)}`
249
+ );
250
+ }
251
+ return { present: true, value };
252
+ }
253
+ function walkArray(schema, value, path10, state) {
254
+ if (!Array.isArray(value)) {
255
+ addExpectedIssue(state, path10, "array", value);
256
+ return { present: true, value };
257
+ }
258
+ if (schema.minItems !== void 0 && value.length < schema.minItems) {
259
+ const expected = `array with at least ${schema.minItems} items`;
260
+ addIssue(
261
+ state,
262
+ path10,
263
+ expected,
264
+ `array with ${value.length} items`,
265
+ `Expected ${expected} at ${formatPath(path10)}`
266
+ );
267
+ }
268
+ if (schema.maxItems !== void 0 && value.length > schema.maxItems) {
269
+ const expected = `array with at most ${schema.maxItems} items`;
270
+ addIssue(
271
+ state,
272
+ path10,
273
+ expected,
274
+ `array with ${value.length} items`,
275
+ `Expected ${expected} at ${formatPath(path10)}`
276
+ );
277
+ }
278
+ const nextValue = value.map((item, index) => {
279
+ const result = walkSchema(schema.item, item, [...path10, String(index)], state);
280
+ return result.present ? result.value : item;
281
+ });
282
+ return { present: true, value: nextValue };
283
+ }
284
+ function walkObject(schema, value, path10, state, injectedProperties = {}) {
285
+ if (!isPlainRecord(value)) {
286
+ addExpectedIssue(state, path10, "object", value);
287
+ return { present: true, value };
288
+ }
289
+ const nextValue = {};
290
+ const allowedKeys = /* @__PURE__ */ new Set([...Object.keys(schema.shape), ...Object.keys(injectedProperties)]);
291
+ for (const [key, propertySchema] of Object.entries(schema.shape)) {
292
+ const propertyValue = Object.hasOwn(value, key) ? value[key] : missingValue;
293
+ const result = walkSchema(propertySchema, propertyValue, [...path10, key], state);
294
+ if (result.present) {
295
+ setOwnValue(nextValue, key, result.value);
296
+ }
297
+ }
298
+ for (const [key, injectedValue] of Object.entries(injectedProperties)) {
299
+ if (Object.hasOwn(value, key)) {
300
+ setOwnValue(nextValue, key, value[key]);
301
+ } else {
302
+ setOwnValue(nextValue, key, injectedValue);
303
+ }
304
+ }
305
+ for (const [key, propertyValue] of Object.entries(value)) {
306
+ if (allowedKeys.has(key)) {
307
+ continue;
308
+ }
309
+ if (schema.additionalProperties === true) {
310
+ setOwnValue(nextValue, key, propertyValue);
311
+ } else {
312
+ addUnexpectedPropertyIssue(state, [...path10, key]);
313
+ }
314
+ }
315
+ return { present: true, value: nextValue };
316
+ }
317
+ function walkOneOf(schema, value, path10, state) {
318
+ if (!isPlainRecord(value)) {
319
+ addExpectedIssue(state, path10, "object", value);
320
+ return { present: true, value };
321
+ }
322
+ const discriminatorValue = value[schema.discriminator];
323
+ const discriminatorPath = [...path10, schema.discriminator];
324
+ const branchValues = Object.keys(schema.branches);
325
+ const expected = `one of ${branchValues.join(", ")}`;
326
+ if (!Object.hasOwn(value, schema.discriminator)) {
327
+ addIssueWithMessage(
328
+ state,
329
+ discriminatorPath,
330
+ expected,
331
+ "missing",
332
+ `Missing discriminator "${schema.discriminator}" at ${formatPath(path10)}. Expected one of: ${branchValues.join(", ")}.`
333
+ );
334
+ return { present: true, value };
335
+ }
336
+ if (typeof discriminatorValue !== "string" || !Object.hasOwn(schema.branches, discriminatorValue)) {
337
+ addIssueWithMessage(
338
+ state,
339
+ discriminatorPath,
340
+ expected,
341
+ receivedValue(discriminatorValue),
342
+ `Expected ${expected} at ${formatPath(discriminatorPath)}, got ${formatReceivedDiscriminator(discriminatorValue)}`
343
+ );
344
+ return { present: true, value };
345
+ }
346
+ return walkObject(schema.branches[discriminatorValue], value, path10, state, {
347
+ [schema.discriminator]: discriminatorValue
348
+ });
349
+ }
350
+ function walkUnion(schema, value, path10, state) {
351
+ if (isPlainRecord(value)) {
352
+ const candidateBranches = schema.branches.filter((branch) => hasRequiredKeys(branch, value));
353
+ if (candidateBranches.length === 1) {
354
+ return walkObject(candidateBranches[0], value, path10, state);
355
+ }
356
+ }
357
+ const matches = [];
358
+ for (const branch of schema.branches) {
359
+ const branchState = { issues: [] };
360
+ const result = walkObject(branch, value, path10, branchState);
361
+ if (branchState.issues.length === 0 && result.present) {
362
+ matches.push({ fingerprint: getRequiredKeyFingerprint(branch), value: result.value });
363
+ }
364
+ }
365
+ if (matches.length === 1) {
366
+ return { present: true, value: matches[0].value };
367
+ }
368
+ if (matches.length === 0) {
369
+ const branchDescriptions = schema.branches.map((branch) => getRequiredKeyFingerprint(branch));
370
+ addIssueWithMessage(
371
+ state,
372
+ path10,
373
+ "exactly one union branch",
374
+ "0 matching branches",
375
+ `No union branch matched at ${formatPath(path10)}. Tried ${schema.branches.length} branches. Expected one of: ${branchDescriptions.join(" | ")}.`
376
+ );
377
+ return { present: true, value };
378
+ }
379
+ addIssueWithMessage(
380
+ state,
381
+ path10,
382
+ "exactly one union branch",
383
+ `${matches.length} matching branches`,
384
+ `Expected exactly one union branch at ${formatPath(path10)}, but matched more than one branch: ${matches.map((match) => match.fingerprint).join(" | ")}`
385
+ );
386
+ return { present: true, value };
387
+ }
388
+ function hasRequiredKeys(schema, value) {
389
+ for (const [key, propertySchema] of Object.entries(schema.shape)) {
390
+ if (propertySchema.kind !== "optional" && !Object.hasOwn(value, key)) {
391
+ return false;
392
+ }
393
+ }
394
+ return true;
395
+ }
396
+ function walkRecord(schema, value, path10, state) {
397
+ if (!isPlainRecord(value)) {
398
+ addExpectedIssue(state, path10, "object", value);
399
+ return { present: true, value };
400
+ }
401
+ const nextValue = {};
402
+ for (const [key, propertyValue] of Object.entries(value)) {
403
+ const result = walkSchema(schema.value, propertyValue, [...path10, key], state);
404
+ if (result.present) {
405
+ setOwnValue(nextValue, key, result.value);
406
+ }
407
+ }
408
+ return { present: true, value: nextValue };
409
+ }
410
+ function walkJson(value, path10, state) {
411
+ if (isJsonValue(value)) {
412
+ return { present: true, value };
413
+ }
414
+ addExpectedIssue(state, path10, "JSON value", value);
415
+ return { present: true, value };
416
+ }
417
+ function getDefault(schema) {
418
+ if (schema.default !== void 0) {
419
+ return { present: true, value: schema.default };
420
+ }
421
+ if (schema.kind === "optional") {
422
+ return getDefault(schema.inner);
423
+ }
424
+ return { present: false };
425
+ }
426
+ function isPlainRecord(value) {
427
+ if (typeof value !== "object" || value === null || Array.isArray(value)) {
428
+ return false;
429
+ }
430
+ const prototype = Object.getPrototypeOf(value);
431
+ return prototype === Object.prototype || prototype === null;
432
+ }
433
+ function isJsonValue(value, ancestors = /* @__PURE__ */ new Set()) {
434
+ if (value === null || typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
435
+ return typeof value !== "number" || Number.isFinite(value);
436
+ }
437
+ if (Array.isArray(value)) {
438
+ if (ancestors.has(value)) {
439
+ return false;
440
+ }
441
+ ancestors.add(value);
442
+ const result = value.every((item) => isJsonValue(item, ancestors));
443
+ ancestors.delete(value);
444
+ return result;
445
+ }
446
+ if (isPlainRecord(value)) {
447
+ if (ancestors.has(value)) {
448
+ return false;
449
+ }
450
+ ancestors.add(value);
451
+ const result = Object.values(value).every((item) => isJsonValue(item, ancestors));
452
+ ancestors.delete(value);
453
+ return result;
454
+ }
455
+ return false;
456
+ }
457
+ function cloneDefault(value) {
458
+ return structuredClone(value);
459
+ }
460
+ function setOwnValue(target, key, value) {
461
+ Object.defineProperty(target, key, {
462
+ configurable: true,
463
+ enumerable: true,
464
+ writable: true,
465
+ value
466
+ });
467
+ }
468
+ function expectedFor(schema) {
469
+ switch (schema.kind) {
470
+ case "string":
471
+ return "string";
472
+ case "number":
473
+ return schema.jsonType === "integer" ? "integer" : "number";
474
+ case "boolean":
475
+ return "boolean";
476
+ case "enum":
477
+ return `one of ${schema.values.join(", ")}`;
478
+ case "array":
479
+ return "array";
480
+ case "object":
481
+ case "oneOf":
482
+ case "record":
483
+ return "object";
484
+ case "union":
485
+ return "exactly one union branch";
486
+ case "json":
487
+ return "JSON value";
488
+ case "optional":
489
+ return expectedFor(schema.inner);
490
+ }
491
+ }
492
+ function addExpectedIssue(state, path10, expected, value) {
493
+ addIssue(
494
+ state,
495
+ path10,
496
+ expected,
497
+ receivedType(value),
498
+ `Expected ${expected} at ${formatPath(path10)}`
499
+ );
500
+ }
501
+ function addUnexpectedPropertyIssue(state, path10) {
502
+ addIssue(
503
+ state,
504
+ path10,
505
+ "no additional properties",
506
+ "unknown property",
507
+ `Unexpected property ${formatPath(path10)}`
508
+ );
509
+ }
510
+ function addIssue(state, path10, expected, received, _message) {
511
+ state.issues.push({
512
+ path: path10,
513
+ expected,
514
+ received,
515
+ message: formatIssueMessage(expected, path10, received)
516
+ });
517
+ }
518
+ function addIssueWithMessage(state, path10, expected, received, message2) {
519
+ state.issues.push({
520
+ path: path10,
521
+ expected,
522
+ received,
523
+ message: message2
524
+ });
525
+ }
526
+ function formatIssueMessage(expected, path10, received) {
527
+ return `Expected ${expected} at ${formatPath(path10)}, got ${received}`;
528
+ }
529
+ function formatPath(path10) {
530
+ return path10.length === 0 ? "value" : path10.join(".");
531
+ }
532
+ function compilePattern(pattern) {
533
+ try {
534
+ return new RegExp(pattern);
535
+ } catch {
536
+ return void 0;
537
+ }
538
+ }
539
+ function receivedType(value) {
540
+ if (value === null) {
541
+ return "null";
542
+ }
543
+ if (Array.isArray(value)) {
544
+ return "array";
545
+ }
546
+ if (typeof value === "number" && Number.isInteger(value)) {
547
+ return "integer";
548
+ }
549
+ return typeof value;
550
+ }
551
+ function receivedValue(value) {
552
+ if (typeof value === "string") {
553
+ return value;
554
+ }
555
+ if (value === void 0) {
556
+ return "undefined";
557
+ }
558
+ return String(value);
559
+ }
560
+ function formatReceivedDiscriminator(value) {
561
+ if (typeof value === "string") {
562
+ return JSON.stringify(value);
563
+ }
564
+ return receivedValue(value);
565
+ }
566
+
119
567
  // ../toolcraft-schema/src/index.ts
120
568
  function assertValidEnumValues(values) {
121
569
  if (values.length === 0) {
@@ -139,6 +587,22 @@ function assertFiniteNumber(value, name) {
139
587
  throw new Error(`${name} must be finite`);
140
588
  }
141
589
  }
590
+ function assertMinMaxOrder(minimum, maximum, minimumName, maximumName) {
591
+ if (minimum !== void 0 && maximum !== void 0 && minimum > maximum) {
592
+ throw new Error(`${minimumName} must be less than or equal to ${maximumName}`);
593
+ }
594
+ }
595
+ function assertValidDefault(schema) {
596
+ if (schema.default === void 0) {
597
+ return;
598
+ }
599
+ const result = validate(schema, schema.default);
600
+ if (!result.ok) {
601
+ throw new Error(
602
+ `default must satisfy schema: ${result.issues[0]?.message ?? "invalid default"}`
603
+ );
604
+ }
605
+ }
142
606
  function assertPattern(pattern) {
143
607
  if (pattern === void 0) {
144
608
  return;
@@ -153,56 +617,71 @@ var S = {
153
617
  String(options = {}) {
154
618
  assertNonNegativeInteger(options.minLength, "minLength");
155
619
  assertNonNegativeInteger(options.maxLength, "maxLength");
620
+ assertMinMaxOrder(options.minLength, options.maxLength, "minLength", "maxLength");
156
621
  assertPattern(options.pattern);
157
- return {
622
+ const schema = {
158
623
  kind: "string",
159
624
  ...options
160
625
  };
626
+ assertValidDefault(schema);
627
+ return schema;
161
628
  },
162
629
  Number(options = {}) {
163
630
  assertFiniteNumber(options.minimum, "minimum");
164
631
  assertFiniteNumber(options.maximum, "maximum");
632
+ assertMinMaxOrder(options.minimum, options.maximum, "minimum", "maximum");
165
633
  assertFiniteNumber(options.default, "default");
166
634
  if (options.jsonType === "integer" && options.default !== void 0 && !Number.isInteger(options.default)) {
167
635
  throw new Error("default must be an integer");
168
636
  }
169
- return {
637
+ const schema = {
170
638
  kind: "number",
171
639
  ...options
172
640
  };
641
+ assertValidDefault(schema);
642
+ return schema;
173
643
  },
174
644
  Boolean(options = {}) {
175
- return {
645
+ const schema = {
176
646
  kind: "boolean",
177
647
  ...options
178
648
  };
649
+ assertValidDefault(schema);
650
+ return schema;
179
651
  },
180
652
  Enum(values, options = {}) {
181
653
  assertValidEnumValues(values);
182
654
  if (options.jsonType === "integer" && values.some((value) => typeof value !== "number" || !Number.isInteger(value))) {
183
655
  throw new Error("Integer enum values must be integers");
184
656
  }
185
- return {
657
+ const schema = {
186
658
  kind: "enum",
187
659
  values,
188
660
  ...options
189
661
  };
662
+ assertValidDefault(schema);
663
+ return schema;
190
664
  },
191
665
  Array(item, options = {}) {
192
666
  assertNonNegativeInteger(options.minItems, "minItems");
193
667
  assertNonNegativeInteger(options.maxItems, "maxItems");
194
- return {
668
+ assertMinMaxOrder(options.minItems, options.maxItems, "minItems", "maxItems");
669
+ const schema = {
195
670
  kind: "array",
196
671
  item,
197
672
  ...options
198
673
  };
674
+ assertValidDefault(schema);
675
+ return schema;
199
676
  },
200
677
  Object(shape, options = {}) {
201
- return {
678
+ const schema = {
202
679
  kind: "object",
203
680
  shape,
204
681
  ...options
205
682
  };
683
+ assertValidDefault(schema);
684
+ return schema;
206
685
  },
207
686
  Optional(inner) {
208
687
  return {
@@ -1081,7 +1560,54 @@ var symbols = {
1081
1560
 
1082
1561
  // ../toolcraft-design/src/internal/strip-ansi.ts
1083
1562
  function stripAnsi(value) {
1084
- return value.replace(/\u001b\[[0-9;]*m/g, "");
1563
+ let output = "";
1564
+ let index = 0;
1565
+ while (index < value.length) {
1566
+ const char = value[index];
1567
+ if (char === "\x1B") {
1568
+ index = skipEscapeSequence(value, index);
1569
+ continue;
1570
+ }
1571
+ if (char === "\x9B") {
1572
+ index = skipCsiSequence(value, index + 1);
1573
+ continue;
1574
+ }
1575
+ output += char;
1576
+ index += char.length;
1577
+ }
1578
+ return output;
1579
+ }
1580
+ function skipEscapeSequence(value, index) {
1581
+ const next = value[index + 1];
1582
+ if (next === "[") {
1583
+ return skipCsiSequence(value, index + 2);
1584
+ }
1585
+ if (next === "]") {
1586
+ return skipOscSequence(value, index + 2);
1587
+ }
1588
+ return Math.min(value.length, index + 2);
1589
+ }
1590
+ function skipCsiSequence(value, index) {
1591
+ while (index < value.length) {
1592
+ const codePoint = value.charCodeAt(index);
1593
+ index += 1;
1594
+ if (codePoint >= 64 && codePoint <= 126) {
1595
+ break;
1596
+ }
1597
+ }
1598
+ return index;
1599
+ }
1600
+ function skipOscSequence(value, index) {
1601
+ while (index < value.length) {
1602
+ if (value[index] === "\x07") {
1603
+ return index + 1;
1604
+ }
1605
+ if (value[index] === "\x1B" && value[index + 1] === "\\") {
1606
+ return index + 2;
1607
+ }
1608
+ index += 1;
1609
+ }
1610
+ return index;
1085
1611
  }
1086
1612
 
1087
1613
  // ../toolcraft-design/src/prompts/primitives/log.ts
@@ -1278,6 +1804,10 @@ var graphemeSegmenter = new Intl.Segmenter(void 0, { granularity: "grapheme" });
1278
1804
  // ../toolcraft-design/src/components/table.ts
1279
1805
  var graphemeSegmenter2 = new Intl.Segmenter(void 0, { granularity: "grapheme" });
1280
1806
 
1807
+ // ../toolcraft-design/src/components/detail-card.ts
1808
+ import stringWidth from "fast-string-width";
1809
+ import { wrapAnsi } from "fast-wrap-ansi";
1810
+
1281
1811
  // ../toolcraft-design/src/components/browser.ts
1282
1812
  import { spawn } from "node:child_process";
1283
1813
  import process2 from "node:process";
@@ -1288,13 +1818,13 @@ import { LineCounter, parse, parseDocument } from "yaml";
1288
1818
  // ../frontmatter/src/stringify.ts
1289
1819
  import { stringify } from "yaml";
1290
1820
 
1821
+ // ../toolcraft-design/src/dashboard/terminal-width.ts
1822
+ var graphemeSegmenter3 = new Intl.Segmenter(void 0, { granularity: "grapheme" });
1823
+
1291
1824
  // ../toolcraft-design/src/acp/writer.ts
1292
1825
  import { AsyncLocalStorage as AsyncLocalStorage2 } from "node:async_hooks";
1293
1826
  var storage = new AsyncLocalStorage2();
1294
1827
 
1295
- // ../toolcraft-design/src/dashboard/terminal-width.ts
1296
- var graphemeSegmenter3 = new Intl.Segmenter(void 0, { granularity: "grapheme" });
1297
-
1298
1828
  // ../toolcraft-design/src/dashboard/terminal.ts
1299
1829
  import readline from "node:readline";
1300
1830
  import { PassThrough } from "node:stream";
@@ -1343,11 +1873,11 @@ import { EventEmitter } from "node:events";
1343
1873
  import * as readline2 from "node:readline";
1344
1874
 
1345
1875
  // ../toolcraft-design/src/prompts/interactive/wrap.ts
1346
- import { wrapAnsi } from "fast-wrap-ansi";
1347
- import stringWidth from "fast-string-width";
1876
+ import { wrapAnsi as wrapAnsi2 } from "fast-wrap-ansi";
1877
+ import stringWidth2 from "fast-string-width";
1348
1878
 
1349
1879
  // ../toolcraft-design/src/prompts/interactive/pagination.ts
1350
- import { wrapAnsi as wrapAnsi2 } from "fast-wrap-ansi";
1880
+ import { wrapAnsi as wrapAnsi3 } from "fast-wrap-ansi";
1351
1881
 
1352
1882
  // ../toolcraft-design/src/static/spinner.ts
1353
1883
  var SPINNER_FRAMES = Object.freeze(["\u25D2", "\u25D0", "\u25D3", "\u25D1"]);
@@ -1370,17 +1900,17 @@ import path5 from "node:path";
1370
1900
  import { fileURLToPath as fileURLToPath3 } from "node:url";
1371
1901
 
1372
1902
  // ../agent-skill-config/src/resolve-skill-reference.ts
1373
- import { statSync as statSync2 } from "node:fs";
1903
+ import * as fs from "node:fs";
1374
1904
  import path6 from "node:path";
1375
1905
 
1376
1906
  // ../agent-skill-config/src/git-exclude.ts
1377
1907
  import { execFileSync } from "node:child_process";
1378
1908
  import { randomUUID as randomUUID2 } from "node:crypto";
1379
- import * as fs from "node:fs";
1909
+ import * as fs2 from "node:fs";
1380
1910
  import path7 from "node:path";
1381
1911
 
1382
1912
  // ../agent-skill-config/src/bridge-active-skills.ts
1383
- import * as fs2 from "node:fs";
1913
+ import * as fs3 from "node:fs";
1384
1914
  import { createHash, randomUUID as randomUUID3 } from "node:crypto";
1385
1915
  import path8 from "node:path";
1386
1916
 
@@ -1434,12 +1964,12 @@ function getSkillFolderWithHome(agent, scope, cwd, homeDir) {
1434
1964
  )
1435
1965
  };
1436
1966
  }
1437
- async function assertNoSymbolicLinkPath(fs3, targetPath) {
1967
+ async function assertNoSymbolicLinkPath(fs4, targetPath) {
1438
1968
  const rootPath = path9.parse(targetPath).root;
1439
1969
  let currentPath = targetPath;
1440
1970
  while (currentPath !== rootPath) {
1441
1971
  try {
1442
- if ((await fs3.lstat(currentPath)).isSymbolicLink()) {
1972
+ if ((await fs4.lstat(currentPath)).isSymbolicLink()) {
1443
1973
  throw new UserError(`Refusing terminal-pilot skill operation through symbolic link: ${currentPath}`);
1444
1974
  }
1445
1975
  } catch (error2) {
@@ -1508,9 +2038,9 @@ var uninstall = defineCommand({
1508
2038
  };
1509
2039
  }
1510
2040
  });
1511
- async function folderExists(fs3, folderPath) {
2041
+ async function folderExists(fs4, folderPath) {
1512
2042
  try {
1513
- await fs3.stat(folderPath);
2043
+ await fs4.stat(folderPath);
1514
2044
  return true;
1515
2045
  } catch (error2) {
1516
2046
  if (hasOwnErrorCode(error2, "ENOENT")) {