claude-code-workflow 6.2.2 → 6.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (346) hide show
  1. package/ccw/dist/cli.d.ts +2 -0
  2. package/ccw/dist/cli.d.ts.map +1 -0
  3. package/ccw/dist/cli.js +219 -0
  4. package/ccw/dist/cli.js.map +1 -0
  5. package/ccw/dist/commands/cli.d.ts +32 -0
  6. package/ccw/dist/commands/cli.d.ts.map +1 -0
  7. package/ccw/dist/commands/cli.js +619 -0
  8. package/ccw/dist/commands/cli.js.map +1 -0
  9. package/ccw/dist/commands/core-memory.d.ts +32 -0
  10. package/ccw/dist/commands/core-memory.d.ts.map +1 -0
  11. package/ccw/dist/commands/core-memory.js +640 -0
  12. package/ccw/dist/commands/core-memory.js.map +1 -0
  13. package/ccw/dist/commands/hook.d.ts +16 -0
  14. package/ccw/dist/commands/hook.d.ts.map +1 -0
  15. package/ccw/dist/commands/hook.js +276 -0
  16. package/ccw/dist/commands/hook.js.map +1 -0
  17. package/ccw/dist/commands/install.d.ts +12 -0
  18. package/ccw/dist/commands/install.d.ts.map +1 -0
  19. package/ccw/dist/commands/install.js +443 -0
  20. package/ccw/dist/commands/install.js.map +1 -0
  21. package/ccw/dist/commands/list.d.ts +5 -0
  22. package/ccw/dist/commands/list.d.ts.map +1 -0
  23. package/ccw/dist/commands/list.js +32 -0
  24. package/ccw/dist/commands/list.js.map +1 -0
  25. package/ccw/dist/commands/memory.d.ts +57 -0
  26. package/ccw/dist/commands/memory.d.ts.map +1 -0
  27. package/ccw/dist/commands/memory.js +890 -0
  28. package/ccw/dist/commands/memory.js.map +1 -0
  29. package/ccw/dist/commands/serve.d.ts +12 -0
  30. package/ccw/dist/commands/serve.d.ts.map +1 -0
  31. package/ccw/dist/commands/serve.js +63 -0
  32. package/ccw/dist/commands/serve.js.map +1 -0
  33. package/ccw/dist/commands/session-path-resolver.d.ts +45 -0
  34. package/ccw/dist/commands/session-path-resolver.d.ts.map +1 -0
  35. package/ccw/dist/commands/session-path-resolver.js +302 -0
  36. package/ccw/dist/commands/session-path-resolver.js.map +1 -0
  37. package/ccw/dist/commands/session.d.ts +12 -0
  38. package/ccw/dist/commands/session.d.ts.map +1 -0
  39. package/ccw/dist/commands/session.js +954 -0
  40. package/ccw/dist/commands/session.js.map +1 -0
  41. package/ccw/dist/commands/stop.d.ts +11 -0
  42. package/ccw/dist/commands/stop.d.ts.map +1 -0
  43. package/ccw/dist/commands/stop.js +96 -0
  44. package/ccw/dist/commands/stop.js.map +1 -0
  45. package/ccw/dist/commands/tool.d.ts +29 -0
  46. package/ccw/dist/commands/tool.d.ts.map +1 -0
  47. package/ccw/dist/commands/tool.js +173 -0
  48. package/ccw/dist/commands/tool.js.map +1 -0
  49. package/ccw/dist/commands/uninstall.d.ts +9 -0
  50. package/ccw/dist/commands/uninstall.d.ts.map +1 -0
  51. package/ccw/dist/commands/uninstall.js +239 -0
  52. package/ccw/dist/commands/uninstall.js.map +1 -0
  53. package/ccw/dist/commands/upgrade.d.ts +10 -0
  54. package/ccw/dist/commands/upgrade.d.ts.map +1 -0
  55. package/ccw/dist/commands/upgrade.js +288 -0
  56. package/ccw/dist/commands/upgrade.js.map +1 -0
  57. package/ccw/dist/commands/view.d.ts +14 -0
  58. package/ccw/dist/commands/view.d.ts.map +1 -0
  59. package/ccw/dist/commands/view.js +100 -0
  60. package/ccw/dist/commands/view.js.map +1 -0
  61. package/ccw/dist/config/storage-paths.d.ts +184 -0
  62. package/ccw/dist/config/storage-paths.d.ts.map +1 -0
  63. package/ccw/dist/config/storage-paths.js +536 -0
  64. package/ccw/dist/config/storage-paths.js.map +1 -0
  65. package/ccw/dist/core/cache-manager.d.ts +80 -0
  66. package/ccw/dist/core/cache-manager.d.ts.map +1 -0
  67. package/ccw/dist/core/cache-manager.js +260 -0
  68. package/ccw/dist/core/cache-manager.js.map +1 -0
  69. package/ccw/dist/core/claude-freshness.d.ts +53 -0
  70. package/ccw/dist/core/claude-freshness.d.ts.map +1 -0
  71. package/ccw/dist/core/claude-freshness.js +232 -0
  72. package/ccw/dist/core/claude-freshness.js.map +1 -0
  73. package/ccw/dist/core/core-memory-store.d.ts +320 -0
  74. package/ccw/dist/core/core-memory-store.d.ts.map +1 -0
  75. package/ccw/dist/core/core-memory-store.js +1177 -0
  76. package/ccw/dist/core/core-memory-store.js.map +1 -0
  77. package/ccw/dist/core/dashboard-generator-patch.d.ts +2 -0
  78. package/ccw/dist/core/dashboard-generator-patch.d.ts.map +1 -0
  79. package/ccw/dist/core/dashboard-generator-patch.js +48 -0
  80. package/ccw/dist/core/dashboard-generator-patch.js.map +1 -0
  81. package/ccw/dist/core/dashboard-generator.d.ts +8 -0
  82. package/ccw/dist/core/dashboard-generator.d.ts.map +1 -0
  83. package/ccw/dist/core/dashboard-generator.js +695 -0
  84. package/ccw/dist/core/dashboard-generator.js.map +1 -0
  85. package/ccw/dist/core/data-aggregator.d.ts +145 -0
  86. package/ccw/dist/core/data-aggregator.d.ts.map +1 -0
  87. package/ccw/dist/core/data-aggregator.js +416 -0
  88. package/ccw/dist/core/data-aggregator.js.map +1 -0
  89. package/ccw/dist/core/history-importer.d.ts +102 -0
  90. package/ccw/dist/core/history-importer.d.ts.map +1 -0
  91. package/ccw/dist/core/history-importer.js +493 -0
  92. package/ccw/dist/core/history-importer.js.map +1 -0
  93. package/ccw/dist/core/lite-scanner-complete.d.ts +81 -0
  94. package/ccw/dist/core/lite-scanner-complete.d.ts.map +1 -0
  95. package/ccw/dist/core/lite-scanner-complete.js +368 -0
  96. package/ccw/dist/core/lite-scanner-complete.js.map +1 -0
  97. package/ccw/dist/core/lite-scanner.d.ts +81 -0
  98. package/ccw/dist/core/lite-scanner.d.ts.map +1 -0
  99. package/ccw/dist/core/lite-scanner.js +368 -0
  100. package/ccw/dist/core/lite-scanner.js.map +1 -0
  101. package/ccw/dist/core/manifest.d.ts +88 -0
  102. package/ccw/dist/core/manifest.d.ts.map +1 -0
  103. package/ccw/dist/core/manifest.js +214 -0
  104. package/ccw/dist/core/manifest.js.map +1 -0
  105. package/ccw/dist/core/memory-embedder-bridge.d.ts +83 -0
  106. package/ccw/dist/core/memory-embedder-bridge.d.ts.map +1 -0
  107. package/ccw/dist/core/memory-embedder-bridge.js +181 -0
  108. package/ccw/dist/core/memory-embedder-bridge.js.map +1 -0
  109. package/ccw/dist/core/memory-store.d.ts +249 -0
  110. package/ccw/dist/core/memory-store.d.ts.map +1 -0
  111. package/ccw/dist/core/memory-store.js +781 -0
  112. package/ccw/dist/core/memory-store.js.map +1 -0
  113. package/ccw/dist/core/routes/ccw-routes.d.ts +20 -0
  114. package/ccw/dist/core/routes/ccw-routes.d.ts.map +1 -0
  115. package/ccw/dist/core/routes/ccw-routes.js +70 -0
  116. package/ccw/dist/core/routes/ccw-routes.js.map +1 -0
  117. package/ccw/dist/core/routes/claude-routes.d.ts +19 -0
  118. package/ccw/dist/core/routes/claude-routes.d.ts.map +1 -0
  119. package/ccw/dist/core/routes/claude-routes.js +1017 -0
  120. package/ccw/dist/core/routes/claude-routes.js.map +1 -0
  121. package/ccw/dist/core/routes/cli-routes.d.ts +20 -0
  122. package/ccw/dist/core/routes/cli-routes.d.ts.map +1 -0
  123. package/ccw/dist/core/routes/cli-routes.js +468 -0
  124. package/ccw/dist/core/routes/cli-routes.js.map +1 -0
  125. package/ccw/dist/core/routes/codexlens-routes.d.ts +20 -0
  126. package/ccw/dist/core/routes/codexlens-routes.d.ts.map +1 -0
  127. package/ccw/dist/core/routes/codexlens-routes.js +754 -0
  128. package/ccw/dist/core/routes/codexlens-routes.js.map +1 -0
  129. package/ccw/dist/core/routes/core-memory-routes.d.ts +21 -0
  130. package/ccw/dist/core/routes/core-memory-routes.d.ts.map +1 -0
  131. package/ccw/dist/core/routes/core-memory-routes.js +520 -0
  132. package/ccw/dist/core/routes/core-memory-routes.js.map +1 -0
  133. package/ccw/dist/core/routes/files-routes.d.ts +20 -0
  134. package/ccw/dist/core/routes/files-routes.d.ts.map +1 -0
  135. package/ccw/dist/core/routes/files-routes.js +374 -0
  136. package/ccw/dist/core/routes/files-routes.js.map +1 -0
  137. package/ccw/dist/core/routes/graph-routes.d.ts +20 -0
  138. package/ccw/dist/core/routes/graph-routes.d.ts.map +1 -0
  139. package/ccw/dist/core/routes/graph-routes.js +517 -0
  140. package/ccw/dist/core/routes/graph-routes.js.map +1 -0
  141. package/ccw/dist/core/routes/help-routes.d.ts +20 -0
  142. package/ccw/dist/core/routes/help-routes.d.ts.map +1 -0
  143. package/ccw/dist/core/routes/help-routes.js +250 -0
  144. package/ccw/dist/core/routes/help-routes.js.map +1 -0
  145. package/ccw/dist/core/routes/hooks-routes.d.ts +21 -0
  146. package/ccw/dist/core/routes/hooks-routes.d.ts.map +1 -0
  147. package/ccw/dist/core/routes/hooks-routes.js +346 -0
  148. package/ccw/dist/core/routes/hooks-routes.js.map +1 -0
  149. package/ccw/dist/core/routes/mcp-routes.d.ts +20 -0
  150. package/ccw/dist/core/routes/mcp-routes.d.ts.map +1 -0
  151. package/ccw/dist/core/routes/mcp-routes.js +1129 -0
  152. package/ccw/dist/core/routes/mcp-routes.js.map +1 -0
  153. package/ccw/dist/core/routes/mcp-templates-db.d.ts +54 -0
  154. package/ccw/dist/core/routes/mcp-templates-db.d.ts.map +1 -0
  155. package/ccw/dist/core/routes/mcp-templates-db.js +226 -0
  156. package/ccw/dist/core/routes/mcp-templates-db.js.map +1 -0
  157. package/ccw/dist/core/routes/memory-routes.d.ts +21 -0
  158. package/ccw/dist/core/routes/memory-routes.d.ts.map +1 -0
  159. package/ccw/dist/core/routes/memory-routes.js +1095 -0
  160. package/ccw/dist/core/routes/memory-routes.js.map +1 -0
  161. package/ccw/dist/core/routes/rules-routes.d.ts +20 -0
  162. package/ccw/dist/core/routes/rules-routes.d.ts.map +1 -0
  163. package/ccw/dist/core/routes/rules-routes.js +442 -0
  164. package/ccw/dist/core/routes/rules-routes.js.map +1 -0
  165. package/ccw/dist/core/routes/session-routes.d.ts +20 -0
  166. package/ccw/dist/core/routes/session-routes.d.ts.map +1 -0
  167. package/ccw/dist/core/routes/session-routes.js +423 -0
  168. package/ccw/dist/core/routes/session-routes.js.map +1 -0
  169. package/ccw/dist/core/routes/skills-routes.d.ts +20 -0
  170. package/ccw/dist/core/routes/skills-routes.d.ts.map +1 -0
  171. package/ccw/dist/core/routes/skills-routes.js +533 -0
  172. package/ccw/dist/core/routes/skills-routes.js.map +1 -0
  173. package/ccw/dist/core/routes/status-routes.d.ts +20 -0
  174. package/ccw/dist/core/routes/status-routes.d.ts.map +1 -0
  175. package/ccw/dist/core/routes/status-routes.js +38 -0
  176. package/ccw/dist/core/routes/status-routes.js.map +1 -0
  177. package/ccw/dist/core/routes/system-routes.d.ts +22 -0
  178. package/ccw/dist/core/routes/system-routes.d.ts.map +1 -0
  179. package/ccw/dist/core/routes/system-routes.js +354 -0
  180. package/ccw/dist/core/routes/system-routes.js.map +1 -0
  181. package/ccw/dist/core/server.d.ts +17 -0
  182. package/ccw/dist/core/server.d.ts.map +1 -0
  183. package/ccw/dist/core/server.js +386 -0
  184. package/ccw/dist/core/server.js.map +1 -0
  185. package/ccw/dist/core/session-clustering-service.d.ts +153 -0
  186. package/ccw/dist/core/session-clustering-service.d.ts.map +1 -0
  187. package/ccw/dist/core/session-clustering-service.js +1065 -0
  188. package/ccw/dist/core/session-clustering-service.js.map +1 -0
  189. package/ccw/dist/core/session-scanner.d.ts +32 -0
  190. package/ccw/dist/core/session-scanner.d.ts.map +1 -0
  191. package/ccw/dist/core/session-scanner.js +253 -0
  192. package/ccw/dist/core/session-scanner.js.map +1 -0
  193. package/ccw/dist/core/websocket.d.ts +23 -0
  194. package/ccw/dist/core/websocket.d.ts.map +1 -0
  195. package/ccw/dist/core/websocket.js +168 -0
  196. package/ccw/dist/core/websocket.js.map +1 -0
  197. package/ccw/dist/index.d.ts +10 -0
  198. package/ccw/dist/index.d.ts.map +1 -0
  199. package/ccw/dist/index.js +10 -0
  200. package/ccw/dist/index.js.map +1 -0
  201. package/ccw/dist/mcp-server/index.d.ts +7 -0
  202. package/ccw/dist/mcp-server/index.d.ts.map +1 -0
  203. package/ccw/dist/mcp-server/index.js +157 -0
  204. package/ccw/dist/mcp-server/index.js.map +1 -0
  205. package/ccw/dist/tools/classify-folders.d.ts +26 -0
  206. package/ccw/dist/tools/classify-folders.d.ts.map +1 -0
  207. package/ccw/dist/tools/classify-folders.js +201 -0
  208. package/ccw/dist/tools/classify-folders.js.map +1 -0
  209. package/ccw/dist/tools/cli-config-manager.d.ts +62 -0
  210. package/ccw/dist/tools/cli-config-manager.d.ts.map +1 -0
  211. package/ccw/dist/tools/cli-config-manager.js +221 -0
  212. package/ccw/dist/tools/cli-config-manager.js.map +1 -0
  213. package/ccw/dist/tools/cli-executor.d.ts +373 -0
  214. package/ccw/dist/tools/cli-executor.d.ts.map +1 -0
  215. package/ccw/dist/tools/cli-executor.js +1625 -0
  216. package/ccw/dist/tools/cli-executor.js.map +1 -0
  217. package/ccw/dist/tools/cli-history-store.d.ts +330 -0
  218. package/ccw/dist/tools/cli-history-store.d.ts.map +1 -0
  219. package/ccw/dist/tools/cli-history-store.js +916 -0
  220. package/ccw/dist/tools/cli-history-store.js.map +1 -0
  221. package/ccw/dist/tools/codex-lens.d.ts +118 -0
  222. package/ccw/dist/tools/codex-lens.d.ts.map +1 -0
  223. package/ccw/dist/tools/codex-lens.js +962 -0
  224. package/ccw/dist/tools/codex-lens.js.map +1 -0
  225. package/ccw/dist/tools/convert-tokens-to-css.d.ts +14 -0
  226. package/ccw/dist/tools/convert-tokens-to-css.d.ts.map +1 -0
  227. package/ccw/dist/tools/convert-tokens-to-css.js +244 -0
  228. package/ccw/dist/tools/convert-tokens-to-css.js.map +1 -0
  229. package/ccw/dist/tools/core-memory.d.ts +66 -0
  230. package/ccw/dist/tools/core-memory.d.ts.map +1 -0
  231. package/ccw/dist/tools/core-memory.js +324 -0
  232. package/ccw/dist/tools/core-memory.js.map +1 -0
  233. package/ccw/dist/tools/detect-changed-modules.d.ts +24 -0
  234. package/ccw/dist/tools/detect-changed-modules.d.ts.map +1 -0
  235. package/ccw/dist/tools/detect-changed-modules.js +277 -0
  236. package/ccw/dist/tools/detect-changed-modules.js.map +1 -0
  237. package/ccw/dist/tools/discover-design-files.d.ts +36 -0
  238. package/ccw/dist/tools/discover-design-files.d.ts.map +1 -0
  239. package/ccw/dist/tools/discover-design-files.js +147 -0
  240. package/ccw/dist/tools/discover-design-files.js.map +1 -0
  241. package/ccw/dist/tools/edit-file.d.ts +28 -0
  242. package/ccw/dist/tools/edit-file.d.ts.map +1 -0
  243. package/ccw/dist/tools/edit-file.js +479 -0
  244. package/ccw/dist/tools/edit-file.js.map +1 -0
  245. package/ccw/dist/tools/generate-module-docs.d.ts +22 -0
  246. package/ccw/dist/tools/generate-module-docs.d.ts.map +1 -0
  247. package/ccw/dist/tools/generate-module-docs.js +379 -0
  248. package/ccw/dist/tools/generate-module-docs.js.map +1 -0
  249. package/ccw/dist/tools/get-modules-by-depth.d.ts +15 -0
  250. package/ccw/dist/tools/get-modules-by-depth.d.ts.map +1 -0
  251. package/ccw/dist/tools/get-modules-by-depth.js +296 -0
  252. package/ccw/dist/tools/get-modules-by-depth.js.map +1 -0
  253. package/ccw/dist/tools/index.d.ts +55 -0
  254. package/ccw/dist/tools/index.d.ts.map +1 -0
  255. package/ccw/dist/tools/index.js +304 -0
  256. package/ccw/dist/tools/index.js.map +1 -0
  257. package/ccw/dist/tools/native-session-discovery.d.ts +97 -0
  258. package/ccw/dist/tools/native-session-discovery.d.ts.map +1 -0
  259. package/ccw/dist/tools/native-session-discovery.js +700 -0
  260. package/ccw/dist/tools/native-session-discovery.js.map +1 -0
  261. package/ccw/dist/tools/notifier.d.ts +50 -0
  262. package/ccw/dist/tools/notifier.d.ts.map +1 -0
  263. package/ccw/dist/tools/notifier.js +90 -0
  264. package/ccw/dist/tools/notifier.js.map +1 -0
  265. package/ccw/dist/tools/read-file.d.ts +32 -0
  266. package/ccw/dist/tools/read-file.d.ts.map +1 -0
  267. package/ccw/dist/tools/read-file.js +329 -0
  268. package/ccw/dist/tools/read-file.js.map +1 -0
  269. package/ccw/dist/tools/resume-strategy.d.ts +48 -0
  270. package/ccw/dist/tools/resume-strategy.d.ts.map +1 -0
  271. package/ccw/dist/tools/resume-strategy.js +248 -0
  272. package/ccw/dist/tools/resume-strategy.js.map +1 -0
  273. package/ccw/dist/tools/session-content-parser.d.ts +58 -0
  274. package/ccw/dist/tools/session-content-parser.d.ts.map +1 -0
  275. package/ccw/dist/tools/session-content-parser.js +420 -0
  276. package/ccw/dist/tools/session-content-parser.js.map +1 -0
  277. package/ccw/dist/tools/session-manager.d.ts +9 -0
  278. package/ccw/dist/tools/session-manager.d.ts.map +1 -0
  279. package/ccw/dist/tools/session-manager.js +834 -0
  280. package/ccw/dist/tools/session-manager.js.map +1 -0
  281. package/ccw/dist/tools/smart-context.d.ts +35 -0
  282. package/ccw/dist/tools/smart-context.d.ts.map +1 -0
  283. package/ccw/dist/tools/smart-context.js +182 -0
  284. package/ccw/dist/tools/smart-context.js.map +1 -0
  285. package/ccw/dist/tools/smart-search.d.ts +105 -0
  286. package/ccw/dist/tools/smart-search.d.ts.map +1 -0
  287. package/ccw/dist/tools/smart-search.js +1753 -0
  288. package/ccw/dist/tools/smart-search.js.map +1 -0
  289. package/ccw/dist/tools/storage-manager.d.ts +114 -0
  290. package/ccw/dist/tools/storage-manager.d.ts.map +1 -0
  291. package/ccw/dist/tools/storage-manager.js +392 -0
  292. package/ccw/dist/tools/storage-manager.js.map +1 -0
  293. package/ccw/dist/tools/ui-generate-preview.d.ts +39 -0
  294. package/ccw/dist/tools/ui-generate-preview.d.ts.map +1 -0
  295. package/ccw/dist/tools/ui-generate-preview.js +300 -0
  296. package/ccw/dist/tools/ui-generate-preview.js.map +1 -0
  297. package/ccw/dist/tools/ui-instantiate-prototypes.d.ts +75 -0
  298. package/ccw/dist/tools/ui-instantiate-prototypes.d.ts.map +1 -0
  299. package/ccw/dist/tools/ui-instantiate-prototypes.js +256 -0
  300. package/ccw/dist/tools/ui-instantiate-prototypes.js.map +1 -0
  301. package/ccw/dist/tools/update-module-claude.d.ts +80 -0
  302. package/ccw/dist/tools/update-module-claude.d.ts.map +1 -0
  303. package/ccw/dist/tools/update-module-claude.js +351 -0
  304. package/ccw/dist/tools/update-module-claude.js.map +1 -0
  305. package/ccw/dist/tools/write-file.d.ts +19 -0
  306. package/ccw/dist/tools/write-file.d.ts.map +1 -0
  307. package/ccw/dist/tools/write-file.js +193 -0
  308. package/ccw/dist/tools/write-file.js.map +1 -0
  309. package/ccw/dist/types/config.d.ts +11 -0
  310. package/ccw/dist/types/config.d.ts.map +1 -0
  311. package/ccw/dist/types/config.js +2 -0
  312. package/ccw/dist/types/config.js.map +1 -0
  313. package/ccw/dist/types/index.d.ts +4 -0
  314. package/ccw/dist/types/index.d.ts.map +1 -0
  315. package/ccw/dist/types/index.js +4 -0
  316. package/ccw/dist/types/index.js.map +1 -0
  317. package/ccw/dist/types/session.d.ts +20 -0
  318. package/ccw/dist/types/session.d.ts.map +1 -0
  319. package/ccw/dist/types/session.js +2 -0
  320. package/ccw/dist/types/session.js.map +1 -0
  321. package/ccw/dist/types/tool.d.ts +36 -0
  322. package/ccw/dist/types/tool.d.ts.map +1 -0
  323. package/ccw/dist/types/tool.js +11 -0
  324. package/ccw/dist/types/tool.js.map +1 -0
  325. package/ccw/dist/utils/browser-launcher.d.ts +13 -0
  326. package/ccw/dist/utils/browser-launcher.d.ts.map +1 -0
  327. package/ccw/dist/utils/browser-launcher.js +60 -0
  328. package/ccw/dist/utils/browser-launcher.js.map +1 -0
  329. package/ccw/dist/utils/file-utils.d.ts +25 -0
  330. package/ccw/dist/utils/file-utils.d.ts.map +1 -0
  331. package/ccw/dist/utils/file-utils.js +48 -0
  332. package/ccw/dist/utils/file-utils.js.map +1 -0
  333. package/ccw/dist/utils/path-resolver.d.ts +80 -0
  334. package/ccw/dist/utils/path-resolver.d.ts.map +1 -0
  335. package/ccw/dist/utils/path-resolver.js +260 -0
  336. package/ccw/dist/utils/path-resolver.js.map +1 -0
  337. package/ccw/dist/utils/path-validator.d.ts +49 -0
  338. package/ccw/dist/utils/path-validator.d.ts.map +1 -0
  339. package/ccw/dist/utils/path-validator.js +123 -0
  340. package/ccw/dist/utils/path-validator.js.map +1 -0
  341. package/ccw/dist/utils/ui.d.ts +62 -0
  342. package/ccw/dist/utils/ui.d.ts.map +1 -0
  343. package/ccw/dist/utils/ui.js +129 -0
  344. package/ccw/dist/utils/ui.js.map +1 -0
  345. package/ccw/package.json +1 -1
  346. package/package.json +5 -2
@@ -0,0 +1,39 @@
1
+ export namespace uiGeneratePreviewTool {
2
+ export let name: string;
3
+ export let description: string;
4
+ export namespace parameters {
5
+ let type: string;
6
+ namespace properties {
7
+ namespace prototypesDir {
8
+ let type_1: string;
9
+ export { type_1 as type };
10
+ let description_1: string;
11
+ export { description_1 as description };
12
+ let _default: string;
13
+ export { _default as default };
14
+ }
15
+ namespace template {
16
+ let type_2: string;
17
+ export { type_2 as type };
18
+ let description_2: string;
19
+ export { description_2 as description };
20
+ }
21
+ }
22
+ let required: never[];
23
+ }
24
+ export { execute };
25
+ }
26
+ /**
27
+ * Main execute function
28
+ */
29
+ declare function execute(params: any): Promise<{
30
+ success: boolean;
31
+ prototypes_dir: any;
32
+ styles: number;
33
+ layouts: number;
34
+ targets: any[];
35
+ total_prototypes: number;
36
+ files_generated: string[];
37
+ }>;
38
+ export {};
39
+ //# sourceMappingURL=ui-generate-preview.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui-generate-preview.d.ts","sourceRoot":"","sources":["../../src/tools/ui-generate-preview.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAqPA;;GAEG;AACH;;;;;;;;GAgDC"}
@@ -0,0 +1,300 @@
1
+ /**
2
+ * UI Generate Preview Tool
3
+ * Generate compare.html and index.html for UI prototypes
4
+ */
5
+ import { readdirSync, existsSync, readFileSync, writeFileSync } from 'fs';
6
+ import { resolve, basename } from 'path';
7
+ /**
8
+ * Auto-detect matrix dimensions from file patterns
9
+ * Pattern: {target}-style-{s}-layout-{l}.html
10
+ */
11
+ function detectMatrixDimensions(prototypesDir) {
12
+ const files = readdirSync(prototypesDir).filter(f => f.match(/.*-style-\d+-layout-\d+\.html$/));
13
+ const styles = new Set();
14
+ const layouts = new Set();
15
+ const targets = new Set();
16
+ files.forEach(file => {
17
+ const styleMatch = file.match(/-style-(\d+)-/);
18
+ const layoutMatch = file.match(/-layout-(\d+)\.html/);
19
+ const targetMatch = file.match(/^(.+)-style-/);
20
+ if (styleMatch)
21
+ styles.add(parseInt(styleMatch[1]));
22
+ if (layoutMatch)
23
+ layouts.add(parseInt(layoutMatch[1]));
24
+ if (targetMatch)
25
+ targets.add(targetMatch[1]);
26
+ });
27
+ return {
28
+ styles: Math.max(...Array.from(styles)),
29
+ layouts: Math.max(...Array.from(layouts)),
30
+ targets: Array.from(targets).sort()
31
+ };
32
+ }
33
+ /**
34
+ * Load template from file
35
+ */
36
+ function loadTemplate(templatePath) {
37
+ const defaultPath = resolve(process.env.HOME || process.env.USERPROFILE, '.claude/workflows/_template-compare-matrix.html');
38
+ const path = templatePath || defaultPath;
39
+ if (!existsSync(path)) {
40
+ // Return minimal fallback template
41
+ return `<!DOCTYPE html>
42
+ <html>
43
+ <head><title>UI Prototypes Comparison</title></head>
44
+ <body>
45
+ <h1>UI Prototypes Matrix</h1>
46
+ <p>Styles: {{style_variants}} | Layouts: {{layout_variants}}</p>
47
+ <p>Pages: {{pages_json}}</p>
48
+ <p>Generated: {{timestamp}}</p>
49
+ </body>
50
+ </html>`;
51
+ }
52
+ return readFileSync(path, 'utf8');
53
+ }
54
+ /**
55
+ * Generate compare.html from template
56
+ */
57
+ function generateCompareHtml(template, metadata) {
58
+ const { runId, sessionId, timestamp, styles, layouts, targets } = metadata;
59
+ const pagesJson = JSON.stringify(targets);
60
+ return template
61
+ .replace(/\{\{run_id\}\}/g, runId)
62
+ .replace(/\{\{session_id\}\}/g, sessionId)
63
+ .replace(/\{\{timestamp\}\}/g, timestamp)
64
+ .replace(/\{\{style_variants\}\}/g, styles.toString())
65
+ .replace(/\{\{layout_variants\}\}/g, layouts.toString())
66
+ .replace(/\{\{pages_json\}\}/g, pagesJson);
67
+ }
68
+ /**
69
+ * Generate index.html
70
+ */
71
+ function generateIndexHtml(metadata) {
72
+ const { styles, layouts, targets } = metadata;
73
+ const total = styles * layouts * targets.length;
74
+ return `<!DOCTYPE html>
75
+ <html lang="en">
76
+ <head>
77
+ <meta charset="UTF-8">
78
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
79
+ <title>UI Prototypes Index</title>
80
+ <style>
81
+ * { margin: 0; padding: 0; box-sizing: border-box; }
82
+ body {
83
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
84
+ max-width: 1200px;
85
+ margin: 0 auto;
86
+ padding: 40px 20px;
87
+ background: #f5f5f5;
88
+ }
89
+ h1 { margin-bottom: 10px; color: #333; }
90
+ .subtitle { color: #666; margin-bottom: 30px; }
91
+ .cta {
92
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
93
+ color: white;
94
+ padding: 20px;
95
+ border-radius: 8px;
96
+ margin-bottom: 30px;
97
+ box-shadow: 0 4px 6px rgba(0,0,0,0.1);
98
+ }
99
+ .cta h2 { margin-bottom: 10px; }
100
+ .cta a {
101
+ display: inline-block;
102
+ background: white;
103
+ color: #667eea;
104
+ padding: 10px 20px;
105
+ border-radius: 6px;
106
+ text-decoration: none;
107
+ font-weight: 600;
108
+ margin-top: 10px;
109
+ }
110
+ .stats {
111
+ display: grid;
112
+ grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
113
+ gap: 15px;
114
+ margin-bottom: 30px;
115
+ }
116
+ .stat {
117
+ background: white;
118
+ padding: 15px;
119
+ border-radius: 8px;
120
+ box-shadow: 0 2px 4px rgba(0,0,0,0.1);
121
+ }
122
+ .stat-label { font-size: 0.85em; color: #666; margin-bottom: 5px; }
123
+ .stat-value { font-size: 1.5em; font-weight: bold; color: #333; }
124
+ .files {
125
+ background: white;
126
+ padding: 20px;
127
+ border-radius: 8px;
128
+ box-shadow: 0 2px 4px rgba(0,0,0,0.1);
129
+ }
130
+ .files h2 { margin-bottom: 15px; color: #333; }
131
+ .file-list { list-style: none; }
132
+ .file-list li {
133
+ padding: 8px 0;
134
+ border-bottom: 1px solid #eee;
135
+ }
136
+ .file-list li:last-child { border-bottom: none; }
137
+ .file-list a {
138
+ color: #667eea;
139
+ text-decoration: none;
140
+ }
141
+ .file-list a:hover { text-decoration: underline; }
142
+ </style>
143
+ </head>
144
+ <body>
145
+ <h1>UI Prototypes</h1>
146
+ <p class="subtitle">Interactive design exploration matrix</p>
147
+
148
+ <div class="cta">
149
+ <h2>📊 Interactive Comparison</h2>
150
+ <p>View all prototypes side-by-side with synchronized scrolling</p>
151
+ <a href="compare.html">Open Comparison Matrix →</a>
152
+ </div>
153
+
154
+ <div class="stats">
155
+ <div class="stat">
156
+ <div class="stat-label">Style Variants</div>
157
+ <div class="stat-value">${styles}</div>
158
+ </div>
159
+ <div class="stat">
160
+ <div class="stat-label">Layout Variants</div>
161
+ <div class="stat-value">${layouts}</div>
162
+ </div>
163
+ <div class="stat">
164
+ <div class="stat-label">Pages/Components</div>
165
+ <div class="stat-value">${targets.length}</div>
166
+ </div>
167
+ <div class="stat">
168
+ <div class="stat-label">Total Prototypes</div>
169
+ <div class="stat-value">${total}</div>
170
+ </div>
171
+ </div>
172
+
173
+ <div class="files">
174
+ <h2>Individual Prototypes</h2>
175
+ <ul class="file-list">
176
+ ${targets.map(target => {
177
+ const items = [];
178
+ for (let s = 1; s <= styles; s++) {
179
+ for (let l = 1; l <= layouts; l++) {
180
+ const filename = `${target}-style-${s}-layout-${l}.html`;
181
+ items.push(` <li><a href="${filename}">${filename}</a></li>`);
182
+ }
183
+ }
184
+ return items.join('\n');
185
+ }).join('\n')}
186
+ </ul>
187
+ </div>
188
+ </body>
189
+ </html>`;
190
+ }
191
+ /**
192
+ * Generate PREVIEW.md
193
+ */
194
+ function generatePreviewMd(metadata) {
195
+ const { styles, layouts, targets } = metadata;
196
+ return `# UI Prototypes Preview
197
+
198
+ ## Matrix Dimensions
199
+
200
+ - **Style Variants**: ${styles}
201
+ - **Layout Variants**: ${layouts}
202
+ - **Pages/Components**: ${targets.join(', ')}
203
+ - **Total Prototypes**: ${styles * layouts * targets.length}
204
+
205
+ ## Quick Start
206
+
207
+ 1. **Interactive Comparison**: Open \`compare.html\` for side-by-side view with synchronized scrolling
208
+ 2. **Browse Index**: Open \`index.html\` for a navigable list of all prototypes
209
+ 3. **Individual Files**: Access specific prototypes directly (e.g., \`${targets[0]}-style-1-layout-1.html\`)
210
+
211
+ ## File Naming Convention
212
+
213
+ \`\`\`
214
+ {page}-style-{s}-layout-{l}.html
215
+ \`\`\`
216
+
217
+ - **page**: Component/page name (${targets.join(', ')})
218
+ - **s**: Style variant number (1-${styles})
219
+ - **l**: Layout variant number (1-${layouts})
220
+
221
+ ## Tips
222
+
223
+ - Use compare.html for quick visual comparison across all variants
224
+ - Synchronized scrolling helps identify consistency issues
225
+ - Check responsive behavior across different layout variants
226
+ `;
227
+ }
228
+ /**
229
+ * Main execute function
230
+ */
231
+ async function execute(params) {
232
+ const { prototypesDir = '.', template: templatePath } = params;
233
+ const targetPath = resolve(process.cwd(), prototypesDir);
234
+ if (!existsSync(targetPath)) {
235
+ throw new Error(`Directory not found: ${targetPath}`);
236
+ }
237
+ // Auto-detect matrix dimensions
238
+ const { styles, layouts, targets } = detectMatrixDimensions(targetPath);
239
+ if (styles === 0 || layouts === 0 || targets.length === 0) {
240
+ throw new Error('No prototype files found matching pattern {target}-style-{s}-layout-{l}.html');
241
+ }
242
+ // Generate metadata
243
+ const metadata = {
244
+ runId: `run-${new Date().toISOString().replace(/[:.]/g, '-').slice(0, -5)}`,
245
+ sessionId: 'standalone',
246
+ timestamp: new Date().toISOString(),
247
+ styles,
248
+ layouts,
249
+ targets
250
+ };
251
+ // Load template
252
+ const template = loadTemplate(templatePath);
253
+ // Generate files
254
+ const compareHtml = generateCompareHtml(template, metadata);
255
+ const indexHtml = generateIndexHtml(metadata);
256
+ const previewMd = generatePreviewMd(metadata);
257
+ // Write files
258
+ writeFileSync(resolve(targetPath, 'compare.html'), compareHtml, 'utf8');
259
+ writeFileSync(resolve(targetPath, 'index.html'), indexHtml, 'utf8');
260
+ writeFileSync(resolve(targetPath, 'PREVIEW.md'), previewMd, 'utf8');
261
+ return {
262
+ success: true,
263
+ prototypes_dir: prototypesDir,
264
+ styles,
265
+ layouts,
266
+ targets,
267
+ total_prototypes: styles * layouts * targets.length,
268
+ files_generated: ['compare.html', 'index.html', 'PREVIEW.md']
269
+ };
270
+ }
271
+ /**
272
+ * Tool Definition
273
+ */
274
+ export const uiGeneratePreviewTool = {
275
+ name: 'ui_generate_preview',
276
+ description: `Generate interactive preview files for UI prototypes.
277
+ Generates:
278
+ - compare.html: Interactive matrix view with synchronized scrolling
279
+ - index.html: Navigation and statistics
280
+ - PREVIEW.md: Usage guide
281
+
282
+ Auto-detects matrix dimensions from file pattern: {target}-style-{s}-layout-{l}.html`,
283
+ parameters: {
284
+ type: 'object',
285
+ properties: {
286
+ prototypesDir: {
287
+ type: 'string',
288
+ description: 'Prototypes directory path (default: current directory)',
289
+ default: '.'
290
+ },
291
+ template: {
292
+ type: 'string',
293
+ description: 'Optional path to compare.html template'
294
+ }
295
+ },
296
+ required: []
297
+ },
298
+ execute
299
+ };
300
+ //# sourceMappingURL=ui-generate-preview.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui-generate-preview.js","sourceRoot":"","sources":["../../src/tools/ui-generate-preview.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,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,MAAM,CAAC,CAAC;IACpE,aAAa,CAAC,OAAO,CAAC,UAAU,EAAE,YAAY,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IAEpE,OAAO;QACL,OAAO,EAAE,IAAI;QACb,cAAc,EAAE,aAAa;QAC7B,MAAM;QACN,OAAO;QACP,OAAO;QACP,gBAAgB,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC,MAAM;QACnD,eAAe,EAAE,CAAC,cAAc,EAAE,YAAY,EAAE,YAAY,CAAC;KAC9D,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE;;;;;;qFAMsE;IACnF,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,aAAa,EAAE;gBACb,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,wDAAwD;gBACrE,OAAO,EAAE,GAAG;aACb;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,wCAAwC;aACtD;SACF;QACD,QAAQ,EAAE,EAAE;KACb;IACD,OAAO;CACR,CAAC"}
@@ -0,0 +1,75 @@
1
+ export namespace uiInstantiatePrototypesTool {
2
+ export let name: string;
3
+ export let description: string;
4
+ export namespace parameters {
5
+ let type: string;
6
+ namespace properties {
7
+ namespace prototypesDir {
8
+ let type_1: string;
9
+ export { type_1 as type };
10
+ let description_1: string;
11
+ export { description_1 as description };
12
+ }
13
+ namespace pages {
14
+ let type_2: string;
15
+ export { type_2 as type };
16
+ let description_2: string;
17
+ export { description_2 as description };
18
+ }
19
+ namespace styleVariants {
20
+ let type_3: string;
21
+ export { type_3 as type };
22
+ let description_3: string;
23
+ export { description_3 as description };
24
+ }
25
+ namespace layoutVariants {
26
+ let type_4: string;
27
+ export { type_4 as type };
28
+ let description_4: string;
29
+ export { description_4 as description };
30
+ }
31
+ namespace runId {
32
+ let type_5: string;
33
+ export { type_5 as type };
34
+ let description_5: string;
35
+ export { description_5 as description };
36
+ }
37
+ namespace sessionId {
38
+ let type_6: string;
39
+ export { type_6 as type };
40
+ let description_6: string;
41
+ export { description_6 as description };
42
+ let _default: string;
43
+ export { _default as default };
44
+ }
45
+ namespace generatePreview {
46
+ let type_7: string;
47
+ export { type_7 as type };
48
+ let description_7: string;
49
+ export { description_7 as description };
50
+ let _default_1: boolean;
51
+ export { _default_1 as default };
52
+ }
53
+ }
54
+ let required: string[];
55
+ }
56
+ export { execute };
57
+ }
58
+ /**
59
+ * Main execute function
60
+ */
61
+ declare function execute(params: any): Promise<{
62
+ success: boolean;
63
+ run_id: any;
64
+ session_id: any;
65
+ prototypes_dir: string;
66
+ pages: any;
67
+ style_variants: number;
68
+ layout_variants: number;
69
+ total_prototypes: number;
70
+ files_generated: string[];
71
+ preview_files: string[];
72
+ message: string;
73
+ }>;
74
+ export {};
75
+ //# sourceMappingURL=ui-instantiate-prototypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui-instantiate-prototypes.d.ts","sourceRoot":"","sources":["../../src/tools/ui-instantiate-prototypes.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6IA;;GAEG;AACH;;;;;;;;;;;;GAsGC"}
@@ -0,0 +1,256 @@
1
+ /**
2
+ * UI Instantiate Prototypes Tool
3
+ * Create final UI prototypes from templates (Style × Layout × Page matrix)
4
+ */
5
+ import { readdirSync, existsSync, readFileSync, writeFileSync, mkdirSync, copyFileSync } from 'fs';
6
+ import { resolve, join, basename } from 'path';
7
+ /**
8
+ * Auto-detect pages from templates directory
9
+ */
10
+ function autoDetectPages(templatesDir) {
11
+ if (!existsSync(templatesDir)) {
12
+ return [];
13
+ }
14
+ const files = readdirSync(templatesDir).filter(f => f.match(/.*-layout-\d+\.html$/));
15
+ const pages = new Set();
16
+ files.forEach(file => {
17
+ const match = file.match(/^(.+)-layout-\d+\.html$/);
18
+ if (match)
19
+ pages.add(match[1]);
20
+ });
21
+ return Array.from(pages).sort();
22
+ }
23
+ /**
24
+ * Auto-detect style variants count
25
+ */
26
+ function autoDetectStyleVariants(basePath) {
27
+ const styleDir = resolve(basePath, '..', 'style-extraction');
28
+ if (!existsSync(styleDir)) {
29
+ return 3; // Default
30
+ }
31
+ const dirs = readdirSync(styleDir, { withFileTypes: true })
32
+ .filter(d => d.isDirectory() && d.name.startsWith('style-'));
33
+ return dirs.length > 0 ? dirs.length : 3;
34
+ }
35
+ /**
36
+ * Auto-detect layout variants count
37
+ */
38
+ function autoDetectLayoutVariants(templatesDir) {
39
+ if (!existsSync(templatesDir)) {
40
+ return 3; // Default
41
+ }
42
+ const files = readdirSync(templatesDir);
43
+ const firstPage = files.find(f => f.endsWith('-layout-1.html'));
44
+ if (!firstPage)
45
+ return 3;
46
+ const pageName = firstPage.replace(/-layout-1\.html$/, '');
47
+ const layoutFiles = files.filter(f => f.match(new RegExp(`^${pageName}-layout-\\d+\\.html$`)));
48
+ return layoutFiles.length > 0 ? layoutFiles.length : 3;
49
+ }
50
+ /**
51
+ * Load CSS tokens file
52
+ */
53
+ function loadTokensCss(styleDir, styleNum) {
54
+ const tokenPath = join(styleDir, `style-${styleNum}`, 'tokens.css');
55
+ if (existsSync(tokenPath)) {
56
+ return readFileSync(tokenPath, 'utf8');
57
+ }
58
+ return '/* No tokens.css found */';
59
+ }
60
+ /**
61
+ * Replace CSS placeholder in template
62
+ */
63
+ function replaceCssPlaceholder(html, tokensCss) {
64
+ // Replace {{tokens.css}} placeholder
65
+ return html.replace(/\{\{tokens\.css\}\}/g, tokensCss);
66
+ }
67
+ /**
68
+ * Generate prototype from template
69
+ */
70
+ function generatePrototype(templatePath, styleDir, styleNum, outputPath) {
71
+ const templateHtml = readFileSync(templatePath, 'utf8');
72
+ const tokensCss = loadTokensCss(styleDir, styleNum);
73
+ const finalHtml = replaceCssPlaceholder(templateHtml, tokensCss);
74
+ writeFileSync(outputPath, finalHtml, 'utf8');
75
+ }
76
+ /**
77
+ * Generate implementation notes
78
+ */
79
+ function generateImplementationNotes(page, styleNum, layoutNum) {
80
+ return `# Implementation Notes: ${page}-style-${styleNum}-layout-${layoutNum}
81
+
82
+ ## Overview
83
+ Prototype combining:
84
+ - **Page/Component**: ${page}
85
+ - **Style Variant**: ${styleNum}
86
+ - **Layout Variant**: ${layoutNum}
87
+
88
+ ## Implementation Checklist
89
+
90
+ ### 1. Style Integration
91
+ - [ ] Verify all CSS custom properties are applied correctly
92
+ - [ ] Check color palette consistency
93
+ - [ ] Validate typography settings
94
+ - [ ] Test spacing and border radius values
95
+
96
+ ### 2. Layout Verification
97
+ - [ ] Confirm component structure matches layout variant
98
+ - [ ] Test responsive behavior
99
+ - [ ] Verify flex/grid layouts
100
+ - [ ] Check alignment and spacing
101
+
102
+ ### 3. Accessibility
103
+ - [ ] Color contrast ratios (WCAG AA minimum)
104
+ - [ ] Keyboard navigation
105
+ - [ ] Screen reader compatibility
106
+ - [ ] Focus indicators
107
+
108
+ ### 4. Browser Testing
109
+ - [ ] Chrome/Edge
110
+ - [ ] Firefox
111
+ - [ ] Safari
112
+ - [ ] Mobile browsers
113
+
114
+ ## Next Steps
115
+ 1. Review prototype in browser
116
+ 2. Compare with design specifications
117
+ 3. Implement in production codebase
118
+ 4. Add interactive functionality
119
+ 5. Write tests
120
+ `;
121
+ }
122
+ /**
123
+ * Main execute function
124
+ */
125
+ async function execute(params) {
126
+ const { prototypesDir, pages: pagesParam, styleVariants: styleVariantsParam, layoutVariants: layoutVariantsParam, runId: runIdParam, sessionId = 'standalone', generatePreview = true } = params;
127
+ if (!prototypesDir) {
128
+ throw new Error('Parameter "prototypesDir" is required');
129
+ }
130
+ const basePath = resolve(process.cwd(), prototypesDir);
131
+ if (!existsSync(basePath)) {
132
+ throw new Error(`Directory not found: ${basePath}`);
133
+ }
134
+ const templatesDir = join(basePath, '_templates');
135
+ const styleDir = resolve(basePath, '..', 'style-extraction');
136
+ // Auto-detect or use provided parameters
137
+ let pages, styleVariants, layoutVariants;
138
+ if (pagesParam && styleVariantsParam && layoutVariantsParam) {
139
+ // Manual mode
140
+ pages = Array.isArray(pagesParam) ? pagesParam : pagesParam.split(',').map(p => p.trim());
141
+ styleVariants = parseInt(styleVariantsParam);
142
+ layoutVariants = parseInt(layoutVariantsParam);
143
+ }
144
+ else {
145
+ // Auto-detect mode
146
+ pages = autoDetectPages(templatesDir);
147
+ styleVariants = autoDetectStyleVariants(basePath);
148
+ layoutVariants = autoDetectLayoutVariants(templatesDir);
149
+ }
150
+ if (pages.length === 0) {
151
+ throw new Error('No pages detected. Ensure _templates directory contains layout files.');
152
+ }
153
+ // Generate run ID
154
+ const runId = runIdParam || `run-${new Date().toISOString().replace(/[:.]/g, '-').slice(0, -5)}`;
155
+ // Phase 1: Copy templates and replace CSS placeholders
156
+ const generatedFiles = [];
157
+ for (const page of pages) {
158
+ for (let s = 1; s <= styleVariants; s++) {
159
+ for (let l = 1; l <= layoutVariants; l++) {
160
+ const templateFile = `${page}-layout-${l}.html`;
161
+ const templatePath = join(templatesDir, templateFile);
162
+ if (!existsSync(templatePath)) {
163
+ console.warn(`Template not found: ${templateFile}, skipping...`);
164
+ continue;
165
+ }
166
+ const outputFile = `${page}-style-${s}-layout-${l}.html`;
167
+ const outputPath = join(basePath, outputFile);
168
+ // Generate prototype
169
+ generatePrototype(templatePath, styleDir, s, outputPath);
170
+ // Generate implementation notes
171
+ const notesFile = `${page}-style-${s}-layout-${l}-notes.md`;
172
+ const notesPath = join(basePath, notesFile);
173
+ const notes = generateImplementationNotes(page, s, l);
174
+ writeFileSync(notesPath, notes, 'utf8');
175
+ generatedFiles.push(outputFile);
176
+ }
177
+ }
178
+ }
179
+ // Phase 2: Generate preview files (optional)
180
+ const previewFiles = [];
181
+ if (generatePreview) {
182
+ // Import and execute ui_generate_preview tool
183
+ const { uiGeneratePreviewTool } = await import('./ui-generate-preview.js');
184
+ const previewResult = await uiGeneratePreviewTool.execute({ prototypesDir: basePath });
185
+ if (previewResult.success) {
186
+ previewFiles.push(...previewResult.files_generated);
187
+ }
188
+ }
189
+ return {
190
+ success: true,
191
+ run_id: runId,
192
+ session_id: sessionId,
193
+ prototypes_dir: basePath,
194
+ pages,
195
+ style_variants: styleVariants,
196
+ layout_variants: layoutVariants,
197
+ total_prototypes: generatedFiles.length,
198
+ files_generated: generatedFiles,
199
+ preview_files: previewFiles,
200
+ message: `Generated ${generatedFiles.length} prototypes (${styleVariants} styles × ${layoutVariants} layouts × ${pages.length} pages)`
201
+ };
202
+ }
203
+ /**
204
+ * Tool Definition
205
+ */
206
+ export const uiInstantiatePrototypesTool = {
207
+ name: 'ui_instantiate_prototypes',
208
+ description: `Create final UI prototypes from templates (Style × Layout × Page matrix).
209
+
210
+ Two Modes:
211
+ 1. Auto-detect (recommended): Only specify prototypesDir
212
+ 2. Manual: Specify prototypesDir, pages, styleVariants, layoutVariants
213
+
214
+ Features:
215
+ - Copies templates and replaces CSS placeholders with tokens.css
216
+ - Generates implementation notes for each prototype
217
+ - Optionally generates preview files (compare.html, index.html, PREVIEW.md)`,
218
+ parameters: {
219
+ type: 'object',
220
+ properties: {
221
+ prototypesDir: {
222
+ type: 'string',
223
+ description: 'Prototypes directory path'
224
+ },
225
+ pages: {
226
+ type: 'string',
227
+ description: 'Comma-separated list of pages (auto-detected if not provided)'
228
+ },
229
+ styleVariants: {
230
+ type: 'number',
231
+ description: 'Number of style variants (auto-detected if not provided)'
232
+ },
233
+ layoutVariants: {
234
+ type: 'number',
235
+ description: 'Number of layout variants (auto-detected if not provided)'
236
+ },
237
+ runId: {
238
+ type: 'string',
239
+ description: 'Run ID (auto-generated if not provided)'
240
+ },
241
+ sessionId: {
242
+ type: 'string',
243
+ description: 'Session ID (default: standalone)',
244
+ default: 'standalone'
245
+ },
246
+ generatePreview: {
247
+ type: 'boolean',
248
+ description: 'Generate preview files (default: true)',
249
+ default: true
250
+ }
251
+ },
252
+ required: ['prototypesDir']
253
+ },
254
+ execute
255
+ };
256
+ //# sourceMappingURL=ui-instantiate-prototypes.js.map