@rien7/seji 0.0.0 → 0.6.1

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 (414) hide show
  1. package/bin/design-surface.mjs +6 -0
  2. package/bin/postinstall.mjs +19 -0
  3. package/bin/seji.mjs +585 -0
  4. package/dist/agent/host.d.mts +34 -0
  5. package/dist/agent/host.mjs +387 -0
  6. package/dist/agent/messages.d.mts +9 -0
  7. package/dist/agent/messages.mjs +70 -0
  8. package/dist/agent/runtimes.mjs +157 -0
  9. package/dist/cli/app.mjs +321 -0
  10. package/dist/cli/appScan.mjs +284 -0
  11. package/dist/cli/catalog.mjs +78 -0
  12. package/dist/cli/component.mjs +165 -0
  13. package/dist/cli/consolidate.mjs +159 -0
  14. package/dist/cli/cssImport.mjs +68 -0
  15. package/dist/cli/dev.mjs +339 -0
  16. package/dist/cli/doctor.mjs +311 -0
  17. package/dist/cli/init.mjs +338 -0
  18. package/dist/cli/legacyNames.mjs +266 -0
  19. package/dist/cli/migrate.mjs +163 -0
  20. package/dist/cli/prompt.mjs +34 -0
  21. package/dist/cli/propose.mjs +208 -0
  22. package/dist/cli/providers.mjs +344 -0
  23. package/dist/cli/reviewOps.mjs +110 -0
  24. package/dist/cli/semver.mjs +45 -0
  25. package/dist/cli/setup.mjs +360 -0
  26. package/dist/cli/sketches.mjs +47 -0
  27. package/dist/cli/skills.mjs +150 -0
  28. package/dist/cli/snapshot.mjs +107 -0
  29. package/dist/cli/tokenOps.mjs +120 -0
  30. package/dist/cli/types.mjs +191 -0
  31. package/dist/cli/updater.mjs +274 -0
  32. package/dist/components/astIndex.mjs +992 -0
  33. package/dist/components/ops.mjs +1069 -0
  34. package/dist/editor/AgentProposalCard.d.ts +10 -0
  35. package/dist/editor/AgentProposalCard.d.ts.map +1 -0
  36. package/dist/editor/AgentProposalCard.js +31 -0
  37. package/dist/editor/AgentProposalCard.js.map +1 -0
  38. package/dist/editor/App.d.ts +2 -0
  39. package/dist/editor/App.d.ts.map +1 -0
  40. package/dist/editor/App.js +2834 -0
  41. package/dist/editor/App.js.map +1 -0
  42. package/dist/editor/CanvasHud.d.ts +12 -0
  43. package/dist/editor/CanvasHud.d.ts.map +1 -0
  44. package/dist/editor/CanvasHud.js +13 -0
  45. package/dist/editor/CanvasHud.js.map +1 -0
  46. package/dist/editor/CanvasSurface.d.ts +31 -0
  47. package/dist/editor/CanvasSurface.d.ts.map +1 -0
  48. package/dist/editor/CanvasSurface.js +270 -0
  49. package/dist/editor/CanvasSurface.js.map +1 -0
  50. package/dist/editor/CommentPopover.d.ts +17 -0
  51. package/dist/editor/CommentPopover.d.ts.map +1 -0
  52. package/dist/editor/CommentPopover.js +62 -0
  53. package/dist/editor/CommentPopover.js.map +1 -0
  54. package/dist/editor/Comments.d.ts +13 -0
  55. package/dist/editor/Comments.d.ts.map +1 -0
  56. package/dist/editor/Comments.js +41 -0
  57. package/dist/editor/Comments.js.map +1 -0
  58. package/dist/editor/ComponentPage.d.ts +28 -0
  59. package/dist/editor/ComponentPage.d.ts.map +1 -0
  60. package/dist/editor/ComponentPage.js +55 -0
  61. package/dist/editor/ComponentPage.js.map +1 -0
  62. package/dist/editor/ComponentPanel.d.ts +38 -0
  63. package/dist/editor/ComponentPanel.d.ts.map +1 -0
  64. package/dist/editor/ComponentPanel.js +275 -0
  65. package/dist/editor/ComponentPanel.js.map +1 -0
  66. package/dist/editor/Glyph.d.ts +51 -0
  67. package/dist/editor/Glyph.d.ts.map +1 -0
  68. package/dist/editor/Glyph.js +50 -0
  69. package/dist/editor/Glyph.js.map +1 -0
  70. package/dist/editor/History.d.ts +7 -0
  71. package/dist/editor/History.d.ts.map +1 -0
  72. package/dist/editor/History.js +51 -0
  73. package/dist/editor/History.js.map +1 -0
  74. package/dist/editor/Inspector.d.ts +56 -0
  75. package/dist/editor/Inspector.d.ts.map +1 -0
  76. package/dist/editor/Inspector.js +510 -0
  77. package/dist/editor/Inspector.js.map +1 -0
  78. package/dist/editor/LazyMount.d.ts +10 -0
  79. package/dist/editor/LazyMount.d.ts.map +1 -0
  80. package/dist/editor/LazyMount.js +29 -0
  81. package/dist/editor/LazyMount.js.map +1 -0
  82. package/dist/editor/LocaleSwitch.d.ts +3 -0
  83. package/dist/editor/LocaleSwitch.d.ts.map +1 -0
  84. package/dist/editor/LocaleSwitch.js +9 -0
  85. package/dist/editor/LocaleSwitch.js.map +1 -0
  86. package/dist/editor/PreviewFrame.d.ts +10 -0
  87. package/dist/editor/PreviewFrame.d.ts.map +1 -0
  88. package/dist/editor/PreviewFrame.js +22 -0
  89. package/dist/editor/PreviewFrame.js.map +1 -0
  90. package/dist/editor/ProjectIndex.d.ts +12 -0
  91. package/dist/editor/ProjectIndex.d.ts.map +1 -0
  92. package/dist/editor/ProjectIndex.js +43 -0
  93. package/dist/editor/ProjectIndex.js.map +1 -0
  94. package/dist/editor/PromoteComponent.d.ts +28 -0
  95. package/dist/editor/PromoteComponent.d.ts.map +1 -0
  96. package/dist/editor/PromoteComponent.js +33 -0
  97. package/dist/editor/PromoteComponent.js.map +1 -0
  98. package/dist/editor/PromoteForm.d.ts +18 -0
  99. package/dist/editor/PromoteForm.d.ts.map +1 -0
  100. package/dist/editor/PromoteForm.js +35 -0
  101. package/dist/editor/PromoteForm.js.map +1 -0
  102. package/dist/editor/PromoteToken.d.ts +31 -0
  103. package/dist/editor/PromoteToken.d.ts.map +1 -0
  104. package/dist/editor/PromoteToken.js +94 -0
  105. package/dist/editor/PromoteToken.js.map +1 -0
  106. package/dist/editor/StatePreviews.d.ts +28 -0
  107. package/dist/editor/StatePreviews.d.ts.map +1 -0
  108. package/dist/editor/StatePreviews.js +113 -0
  109. package/dist/editor/StatePreviews.js.map +1 -0
  110. package/dist/editor/ValueCombo.d.ts +51 -0
  111. package/dist/editor/ValueCombo.d.ts.map +1 -0
  112. package/dist/editor/ValueCombo.js +260 -0
  113. package/dist/editor/ValueCombo.js.map +1 -0
  114. package/dist/editor/agent/AgentPanel.d.ts +19 -0
  115. package/dist/editor/agent/AgentPanel.d.ts.map +1 -0
  116. package/dist/editor/agent/AgentPanel.js +271 -0
  117. package/dist/editor/agent/AgentPanel.js.map +1 -0
  118. package/dist/editor/agent/Markdown.d.ts +5 -0
  119. package/dist/editor/agent/Markdown.d.ts.map +1 -0
  120. package/dist/editor/agent/Markdown.js +28 -0
  121. package/dist/editor/agent/Markdown.js.map +1 -0
  122. package/dist/editor/agent/agentApi.d.ts +106 -0
  123. package/dist/editor/agent/agentApi.d.ts.map +1 -0
  124. package/dist/editor/agent/agentApi.js +66 -0
  125. package/dist/editor/agent/agentApi.js.map +1 -0
  126. package/dist/editor/agent/toolLines.d.ts +38 -0
  127. package/dist/editor/agent/toolLines.d.ts.map +1 -0
  128. package/dist/editor/agent/toolLines.js +159 -0
  129. package/dist/editor/agent/toolLines.js.map +1 -0
  130. package/dist/editor/agent/useAgent.d.ts +15 -0
  131. package/dist/editor/agent/useAgent.d.ts.map +1 -0
  132. package/dist/editor/agent/useAgent.js +65 -0
  133. package/dist/editor/agent/useAgent.js.map +1 -0
  134. package/dist/editor/api.d.ts +378 -0
  135. package/dist/editor/api.d.ts.map +1 -0
  136. package/dist/editor/api.js +247 -0
  137. package/dist/editor/api.js.map +1 -0
  138. package/dist/editor/camera.d.ts +18 -0
  139. package/dist/editor/camera.d.ts.map +1 -0
  140. package/dist/editor/camera.js +40 -0
  141. package/dist/editor/camera.js.map +1 -0
  142. package/dist/editor/canvas.d.ts +25 -0
  143. package/dist/editor/canvas.d.ts.map +1 -0
  144. package/dist/editor/canvas.js +35 -0
  145. package/dist/editor/canvas.js.map +1 -0
  146. package/dist/editor/changes/ChangesPage.d.ts +25 -0
  147. package/dist/editor/changes/ChangesPage.d.ts.map +1 -0
  148. package/dist/editor/changes/ChangesPage.js +132 -0
  149. package/dist/editor/changes/ChangesPage.js.map +1 -0
  150. package/dist/editor/changes/changeModel.d.ts +25 -0
  151. package/dist/editor/changes/changeModel.d.ts.map +1 -0
  152. package/dist/editor/changes/changeModel.js +81 -0
  153. package/dist/editor/changes/changeModel.js.map +1 -0
  154. package/dist/editor/changes/changeState.d.mts +29 -0
  155. package/dist/editor/changes/changeState.mjs +187 -0
  156. package/dist/editor/chrome/EditorChrome.d.ts +49 -0
  157. package/dist/editor/chrome/EditorChrome.d.ts.map +1 -0
  158. package/dist/editor/chrome/EditorChrome.js +21 -0
  159. package/dist/editor/chrome/EditorChrome.js.map +1 -0
  160. package/dist/editor/drafts.d.ts +46 -0
  161. package/dist/editor/drafts.d.ts.map +1 -0
  162. package/dist/editor/drafts.js +38 -0
  163. package/dist/editor/drafts.js.map +1 -0
  164. package/dist/editor/i18n.d.ts +29 -0
  165. package/dist/editor/i18n.d.ts.map +1 -0
  166. package/dist/editor/i18n.js +2320 -0
  167. package/dist/editor/i18n.js.map +1 -0
  168. package/dist/editor/iconStroke.d.ts +6 -0
  169. package/dist/editor/iconStroke.d.ts.map +1 -0
  170. package/dist/editor/iconStroke.js +6 -0
  171. package/dist/editor/iconStroke.js.map +1 -0
  172. package/dist/editor/main.d.ts +2 -0
  173. package/dist/editor/main.d.ts.map +1 -0
  174. package/dist/editor/main.js +14 -0
  175. package/dist/editor/main.js.map +1 -0
  176. package/dist/editor/model.d.ts +16 -0
  177. package/dist/editor/model.d.ts.map +1 -0
  178. package/dist/editor/model.js +11 -0
  179. package/dist/editor/model.js.map +1 -0
  180. package/dist/editor/reasons.d.ts +44 -0
  181. package/dist/editor/reasons.d.ts.map +1 -0
  182. package/dist/editor/reasons.js +131 -0
  183. package/dist/editor/reasons.js.map +1 -0
  184. package/dist/editor/reviewLifecycle.d.ts +8 -0
  185. package/dist/editor/reviewLifecycle.d.ts.map +1 -0
  186. package/dist/editor/reviewLifecycle.js +21 -0
  187. package/dist/editor/reviewLifecycle.js.map +1 -0
  188. package/dist/editor/styles.css +8737 -0
  189. package/dist/editor/tokenMatch.d.ts +59 -0
  190. package/dist/editor/tokenMatch.d.ts.map +1 -0
  191. package/dist/editor/tokenMatch.js +198 -0
  192. package/dist/editor/tokenMatch.js.map +1 -0
  193. package/dist/editor/tokens/ConsolidatePage.d.ts +16 -0
  194. package/dist/editor/tokens/ConsolidatePage.d.ts.map +1 -0
  195. package/dist/editor/tokens/ConsolidatePage.js +244 -0
  196. package/dist/editor/tokens/ConsolidatePage.js.map +1 -0
  197. package/dist/editor/tokens/TokenActivity.d.ts +18 -0
  198. package/dist/editor/tokens/TokenActivity.d.ts.map +1 -0
  199. package/dist/editor/tokens/TokenActivity.js +18 -0
  200. package/dist/editor/tokens/TokenActivity.js.map +1 -0
  201. package/dist/editor/tokens/TokenDialogs.d.ts +26 -0
  202. package/dist/editor/tokens/TokenDialogs.d.ts.map +1 -0
  203. package/dist/editor/tokens/TokenDialogs.js +119 -0
  204. package/dist/editor/tokens/TokenDialogs.js.map +1 -0
  205. package/dist/editor/tokens/TokenList.d.ts +21 -0
  206. package/dist/editor/tokens/TokenList.d.ts.map +1 -0
  207. package/dist/editor/tokens/TokenList.js +98 -0
  208. package/dist/editor/tokens/TokenList.js.map +1 -0
  209. package/dist/editor/tokens/TokenPage.d.ts +25 -0
  210. package/dist/editor/tokens/TokenPage.d.ts.map +1 -0
  211. package/dist/editor/tokens/TokenPage.js +108 -0
  212. package/dist/editor/tokens/TokenPage.js.map +1 -0
  213. package/dist/editor/tokens/tokenModel.d.ts +35 -0
  214. package/dist/editor/tokens/tokenModel.d.ts.map +1 -0
  215. package/dist/editor/tokens/tokenModel.js +72 -0
  216. package/dist/editor/tokens/tokenModel.js.map +1 -0
  217. package/dist/editor/ui/Button.d.ts +3 -0
  218. package/dist/editor/ui/Button.d.ts.map +1 -0
  219. package/dist/editor/ui/Button.js +6 -0
  220. package/dist/editor/ui/Button.js.map +1 -0
  221. package/dist/editor/ui/CommentBox.d.ts +23 -0
  222. package/dist/editor/ui/CommentBox.d.ts.map +1 -0
  223. package/dist/editor/ui/CommentBox.js +41 -0
  224. package/dist/editor/ui/CommentBox.js.map +1 -0
  225. package/dist/editor/ui/Icon.d.ts +8 -0
  226. package/dist/editor/ui/Icon.d.ts.map +1 -0
  227. package/dist/editor/ui/Icon.js +6 -0
  228. package/dist/editor/ui/Icon.js.map +1 -0
  229. package/dist/editor/ui/IconButton.d.ts +11 -0
  230. package/dist/editor/ui/IconButton.d.ts.map +1 -0
  231. package/dist/editor/ui/IconButton.js +6 -0
  232. package/dist/editor/ui/IconButton.js.map +1 -0
  233. package/dist/editor/ui/NumberInput.d.ts +14 -0
  234. package/dist/editor/ui/NumberInput.d.ts.map +1 -0
  235. package/dist/editor/ui/NumberInput.js +6 -0
  236. package/dist/editor/ui/NumberInput.js.map +1 -0
  237. package/dist/editor/ui/PageLine.d.ts +14 -0
  238. package/dist/editor/ui/PageLine.d.ts.map +1 -0
  239. package/dist/editor/ui/PageLine.js +7 -0
  240. package/dist/editor/ui/PageLine.js.map +1 -0
  241. package/dist/editor/ui/SearchPicker.d.ts +41 -0
  242. package/dist/editor/ui/SearchPicker.d.ts.map +1 -0
  243. package/dist/editor/ui/SearchPicker.js +82 -0
  244. package/dist/editor/ui/SearchPicker.js.map +1 -0
  245. package/dist/editor/ui/Select.d.ts +19 -0
  246. package/dist/editor/ui/Select.d.ts.map +1 -0
  247. package/dist/editor/ui/Select.js +12 -0
  248. package/dist/editor/ui/Select.js.map +1 -0
  249. package/dist/editor/ui/TokenField.d.ts +14 -0
  250. package/dist/editor/ui/TokenField.d.ts.map +1 -0
  251. package/dist/editor/ui/TokenField.js +41 -0
  252. package/dist/editor/ui/TokenField.js.map +1 -0
  253. package/dist/editor/ui/TokenPicker.d.ts +31 -0
  254. package/dist/editor/ui/TokenPicker.d.ts.map +1 -0
  255. package/dist/editor/ui/TokenPicker.js +26 -0
  256. package/dist/editor/ui/TokenPicker.js.map +1 -0
  257. package/dist/editor/useBuildError.d.ts +7 -0
  258. package/dist/editor/useBuildError.d.ts.map +1 -0
  259. package/dist/editor/useBuildError.js +30 -0
  260. package/dist/editor/useBuildError.js.map +1 -0
  261. package/dist/editor/useLatestRequest.d.ts +22 -0
  262. package/dist/editor/useLatestRequest.d.ts.map +1 -0
  263. package/dist/editor/useLatestRequest.js +49 -0
  264. package/dist/editor/useLatestRequest.js.map +1 -0
  265. package/dist/editor-bundle/editor.css +2 -0
  266. package/dist/editor-bundle/editor.js +83 -0
  267. package/dist/editor-ui.d.ts +15 -0
  268. package/dist/editor-ui.d.ts.map +1 -0
  269. package/dist/editor-ui.js +14 -0
  270. package/dist/editor-ui.js.map +1 -0
  271. package/dist/inspector/runtime.d.ts +18 -0
  272. package/dist/inspector/runtime.d.ts.map +1 -0
  273. package/dist/inspector/runtime.js +1280 -0
  274. package/dist/inspector/runtime.js.map +1 -0
  275. package/dist/preview/main.d.ts +3 -0
  276. package/dist/preview/main.d.ts.map +1 -0
  277. package/dist/preview/main.js +320 -0
  278. package/dist/preview/main.js.map +1 -0
  279. package/dist/preview/preview.css +40 -0
  280. package/dist/runtime/index.d.ts +3 -0
  281. package/dist/runtime/index.d.ts.map +1 -0
  282. package/dist/runtime/index.js +2 -0
  283. package/dist/runtime/index.js.map +1 -0
  284. package/dist/shared/buildError.d.mts +27 -0
  285. package/dist/shared/buildError.mjs +141 -0
  286. package/dist/shared/cameraFit.d.mts +16 -0
  287. package/dist/shared/cameraFit.mjs +47 -0
  288. package/dist/shared/canvasLayout.d.mts +13 -0
  289. package/dist/shared/canvasLayout.mjs +171 -0
  290. package/dist/shared/commentShots.d.mts +12 -0
  291. package/dist/shared/commentShots.mjs +53 -0
  292. package/dist/shared/componentExtract.d.mts +43 -0
  293. package/dist/shared/componentExtract.mjs +136 -0
  294. package/dist/shared/componentMeta.d.mts +26 -0
  295. package/dist/shared/componentMeta.mjs +87 -0
  296. package/dist/shared/componentOps.d.mts +70 -0
  297. package/dist/shared/componentOps.mjs +407 -0
  298. package/dist/shared/componentTarget.d.mts +15 -0
  299. package/dist/shared/componentTarget.mjs +58 -0
  300. package/dist/shared/components.d.mts +30 -0
  301. package/dist/shared/components.mjs +106 -0
  302. package/dist/shared/consolidateCategories.d.mts +2 -0
  303. package/dist/shared/consolidateCategories.mjs +6 -0
  304. package/dist/shared/env.d.mts +4 -0
  305. package/dist/shared/env.mjs +18 -0
  306. package/dist/shared/gitChanges.d.mts +2 -0
  307. package/dist/shared/gitChanges.mjs +30 -0
  308. package/dist/shared/legacyPaths.d.mts +1 -0
  309. package/dist/shared/legacyPaths.mjs +9 -0
  310. package/dist/shared/oklab.d.mts +6 -0
  311. package/dist/shared/oklab.mjs +56 -0
  312. package/dist/shared/optimizeEntries.d.mts +5 -0
  313. package/dist/shared/optimizeEntries.mjs +24 -0
  314. package/dist/shared/packages.d.mts +11 -0
  315. package/dist/shared/packages.mjs +96 -0
  316. package/dist/shared/projectFiles.d.mts +23 -0
  317. package/dist/shared/projectFiles.mjs +72 -0
  318. package/dist/shared/prompt.d.mts +25 -0
  319. package/dist/shared/prompt.mjs +217 -0
  320. package/dist/shared/proposals.d.mts +11 -0
  321. package/dist/shared/proposals.mjs +42 -0
  322. package/dist/shared/protocol.d.ts +122 -0
  323. package/dist/shared/protocol.d.ts.map +1 -0
  324. package/dist/shared/protocol.js +7 -0
  325. package/dist/shared/protocol.js.map +1 -0
  326. package/dist/shared/reviewArchive.d.mts +4 -0
  327. package/dist/shared/reviewArchive.mjs +19 -0
  328. package/dist/shared/reviewStore.d.mts +30 -0
  329. package/dist/shared/reviewStore.mjs +218 -0
  330. package/dist/shared/reviewVerify.d.mts +21 -0
  331. package/dist/shared/reviewVerify.mjs +158 -0
  332. package/dist/shared/sizeModes.d.mts +15 -0
  333. package/dist/shared/sizeModes.mjs +53 -0
  334. package/dist/shared/sketches.d.mts +10 -0
  335. package/dist/shared/sketches.mjs +64 -0
  336. package/dist/shared/snapshotCheck.d.mts +13 -0
  337. package/dist/shared/snapshotCheck.mjs +81 -0
  338. package/dist/shared/timeout.d.mts +1 -0
  339. package/dist/shared/timeout.mjs +15 -0
  340. package/dist/shared/tokens.d.ts +2 -0
  341. package/dist/shared/tokens.d.ts.map +1 -0
  342. package/dist/shared/tokens.js +2 -0
  343. package/dist/shared/tokens.js.map +1 -0
  344. package/dist/shared/types.d.ts +689 -0
  345. package/dist/shared/types.d.ts.map +1 -0
  346. package/dist/shared/types.js +13 -0
  347. package/dist/shared/types.js.map +1 -0
  348. package/dist/shared/wheelRouting.d.mts +9 -0
  349. package/dist/shared/wheelRouting.mjs +31 -0
  350. package/dist/shared/writeScope.mjs +96 -0
  351. package/dist/snapshots/diff.d.mts +28 -0
  352. package/dist/snapshots/diff.mjs +263 -0
  353. package/dist/snapshots/index.d.mts +110 -0
  354. package/dist/snapshots/index.mjs +638 -0
  355. package/dist/snapshots/render.d.mts +24 -0
  356. package/dist/snapshots/render.mjs +250 -0
  357. package/dist/snapshots/toolOps.d.mts +25 -0
  358. package/dist/snapshots/toolOps.mjs +69 -0
  359. package/dist/tokens/adapters/css.mjs +51 -0
  360. package/dist/tokens/adapters/cssInCode.mjs +314 -0
  361. package/dist/tokens/adapters/oxcShared.mjs +80 -0
  362. package/dist/tokens/adapters/preprocessor.mjs +63 -0
  363. package/dist/tokens/adapters/registry.mjs +53 -0
  364. package/dist/tokens/adapters/tailwindcss.mjs +424 -0
  365. package/dist/tokens/adapters/types.mjs +117 -0
  366. package/dist/tokens/consolidate/index.d.mts +42 -0
  367. package/dist/tokens/consolidate/index.mjs +111 -0
  368. package/dist/tokens/consolidate/normalize.mjs +479 -0
  369. package/dist/tokens/consolidate/plan.mjs +726 -0
  370. package/dist/tokens/consolidate/scan.mjs +928 -0
  371. package/dist/tokens/extract.mjs +441 -0
  372. package/dist/tokens/moduleData.d.mts +14 -0
  373. package/dist/tokens/moduleData.mjs +32 -0
  374. package/dist/tokens/opLock.d.mts +4 -0
  375. package/dist/tokens/opLock.mjs +108 -0
  376. package/dist/tokens/ops.d.mts +71 -0
  377. package/dist/tokens/ops.mjs +1511 -0
  378. package/dist/tokens/pipeline.mjs +813 -0
  379. package/dist/tokens/report.d.mts +47 -0
  380. package/dist/tokens/report.mjs +257 -0
  381. package/dist/tokens/rewrite/code.mjs +172 -0
  382. package/dist/tokens/rewrite/css.mjs +154 -0
  383. package/dist/tokens/rewrite/index.mjs +244 -0
  384. package/dist/tokens/rewrite/tailwind.mjs +288 -0
  385. package/dist/tokens/rewrite/text.mjs +116 -0
  386. package/dist/tokens/rewrite/value.mjs +115 -0
  387. package/dist/tokens/usage.d.mts +97 -0
  388. package/dist/tokens/usage.mjs +680 -0
  389. package/dist/vite/agent.d.ts +21 -0
  390. package/dist/vite/agent.d.ts.map +1 -0
  391. package/dist/vite/agent.js +165 -0
  392. package/dist/vite/agent.js.map +1 -0
  393. package/dist/vite/events.d.ts +27 -0
  394. package/dist/vite/events.d.ts.map +1 -0
  395. package/dist/vite/events.js +156 -0
  396. package/dist/vite/events.js.map +1 -0
  397. package/dist/vite/layout.d.ts +2 -0
  398. package/dist/vite/layout.d.ts.map +1 -0
  399. package/dist/vite/layout.js +4 -0
  400. package/dist/vite/layout.js.map +1 -0
  401. package/dist/vite/plugin.d.ts +40 -0
  402. package/dist/vite/plugin.d.ts.map +1 -0
  403. package/dist/vite/plugin.js +1264 -0
  404. package/dist/vite/plugin.js.map +1 -0
  405. package/dist/vite/requestGuard.d.mts +3 -0
  406. package/dist/vite/requestGuard.mjs +43 -0
  407. package/dist/vite/review.d.ts +11 -0
  408. package/dist/vite/review.d.ts.map +1 -0
  409. package/dist/vite/review.js +283 -0
  410. package/dist/vite/review.js.map +1 -0
  411. package/package.json +106 -1
  412. package/skills/seji/SKILL.md +400 -0
  413. package/skills/seji-authoring/SKILL.md +397 -0
  414. package/skills/seji-tokens/SKILL.md +432 -0
@@ -0,0 +1,250 @@
1
+ // Headless rendering of design artboards for snapshot comparison.
2
+ //
3
+ // A Playwright Chromium page loads each artboard's preview route
4
+ // (`/__seji/preview?design=…&page=…&frame=…&snapshot=1`) from a Vite dev server — the
5
+ // one already running (`url`) or a short-lived one started here — waits for the frame to
6
+ // report ready, fonts and network idle, and screenshots the viewport at the artboard size.
7
+ // Snapshot mode in the preview skips pending review overrides and the inspector, so the
8
+ // image is what the source renders.
9
+ //
10
+ // Playwright is an optional peer dependency and is imported lazily.
11
+ import { existsSync } from 'node:fs'
12
+ import { createRequire } from 'node:module'
13
+ import net from 'node:net'
14
+ import { join } from 'node:path'
15
+ import { pathToFileURL } from 'node:url'
16
+
17
+ import { toolEnv } from '../shared/env.mjs'
18
+
19
+ const PLAYWRIGHT_HINT =
20
+ 'Snapshots need Playwright Chromium: install it in the project (`pnpm add -D playwright`, or npm/yarn equivalent) and download the browser with `npx playwright install chromium`.'
21
+
22
+ export class SnapshotUnavailableError extends Error {
23
+ constructor(message) {
24
+ super(message)
25
+ this.name = 'SnapshotUnavailableError'
26
+ }
27
+ }
28
+
29
+ /** Resolve Playwright from the host project first, then from this package. */
30
+ export async function loadPlaywright(root = process.cwd()) {
31
+ const candidates = []
32
+ const hostPkg = join(root, 'package.json')
33
+ for (const name of ['playwright', 'playwright-core']) {
34
+ if (existsSync(hostPkg)) {
35
+ try {
36
+ candidates.push(pathToFileURL(createRequire(hostPkg).resolve(name)).href)
37
+ } catch {
38
+ // not installed in the host
39
+ }
40
+ }
41
+ candidates.push(name)
42
+ }
43
+ for (const specifier of candidates) {
44
+ try {
45
+ const mod = await import(specifier)
46
+ const chromium = mod.chromium ?? mod.default?.chromium
47
+ if (chromium) return chromium
48
+ } catch {
49
+ // try the next candidate
50
+ }
51
+ }
52
+ throw new SnapshotUnavailableError(`Playwright is not installed. ${PLAYWRIGHT_HINT}`)
53
+ }
54
+
55
+ /** True when Playwright can be imported (does not launch a browser). */
56
+ export async function hasPlaywright(root) {
57
+ try {
58
+ await loadPlaywright(root)
59
+ return true
60
+ } catch {
61
+ return false
62
+ }
63
+ }
64
+
65
+ async function launchChromium(root) {
66
+ const chromium = await loadPlaywright(root)
67
+ const channel = toolEnv('BROWSER_CHANNEL')
68
+ const attempts = channel ? [{ channel }] : [{}, { channel: 'chrome' }]
69
+ let lastError
70
+ for (const extra of attempts) {
71
+ try {
72
+ return await chromium.launch({ headless: true, ...extra })
73
+ } catch (error) {
74
+ lastError = error
75
+ }
76
+ }
77
+ const detail = lastError instanceof Error ? lastError.message.split('\n')[0] : String(lastError)
78
+ throw new SnapshotUnavailableError(`Could not launch Chromium (${detail}). ${PLAYWRIGHT_HINT}`)
79
+ }
80
+
81
+ const freePort = () =>
82
+ new Promise((resolvePort, reject) => {
83
+ const server = net.createServer()
84
+ server.unref()
85
+ server.once('error', reject)
86
+ server.listen(0, '127.0.0.1', () => {
87
+ const { port } = server.address()
88
+ server.close(() => resolvePort(port))
89
+ })
90
+ })
91
+
92
+ /** Start a short-lived Vite dev server for the project with the design plugin mounted. */
93
+ export async function startSnapshotServer({ root = process.cwd(), configFile } = {}) {
94
+ const { resolveViteCreateServer, loadDesignPlugin, loadSurfaceConfig } = await import('../cli/dev.mjs')
95
+ const createServer = await resolveViteCreateServer(root)
96
+ const designPlugin = await loadDesignPlugin()
97
+ const port = await freePort()
98
+ const server = await createServer({
99
+ root,
100
+ ...(configFile ? { configFile } : {}),
101
+ logLevel: 'error',
102
+ clearScreen: false,
103
+ // The host config may already mount designPlugin; the plugin dedupes itself.
104
+ plugins: [designPlugin({ ...loadSurfaceConfig(root), snapshots: { autoBaseline: false } })],
105
+ // HMR stays on: after Vite optimizes newly discovered deps it reloads the page over the
106
+ // HMR socket; without it the page keeps requesting outdated deps and never renders.
107
+ server: { host: '127.0.0.1', port, strictPort: true, open: false },
108
+ })
109
+ await server.listen()
110
+ return { url: `http://127.0.0.1:${port}`, close: () => server.close() }
111
+ }
112
+
113
+ const SETTLE_SCRIPT = () =>
114
+ new Promise((resolveSettle) => {
115
+ const done = () => requestAnimationFrame(() => requestAnimationFrame(() => resolveSettle(true)))
116
+ if (document.fonts?.ready) document.fonts.ready.then(done, done)
117
+ else done()
118
+ })
119
+
120
+ /**
121
+ * A renderer bound to one server + browser. `frames(design)` lists the artboards of a design,
122
+ * `shoot(target)` returns a PNG buffer of one artboard. Always `close()` it.
123
+ */
124
+ export async function createRenderer({ root = process.cwd(), url, configFile, timeoutMs = 30_000 } = {}) {
125
+ const browser = await launchChromium(root)
126
+ let server = null
127
+ try {
128
+ if (!url) server = await startSnapshotServer({ root, configFile })
129
+ } catch (error) {
130
+ await browser.close().catch(() => {})
131
+ throw error
132
+ }
133
+ const base = String(url ?? server.url).replace(/\/$/, '')
134
+ const context = await browser.newContext({
135
+ deviceScaleFactor: 1,
136
+ colorScheme: 'light',
137
+ reducedMotion: 'reduce',
138
+ viewport: { width: 1280, height: 800 },
139
+ })
140
+ // Freeze Date so clock-dependent content (timestamps, "x minutes ago") renders the same before
141
+ // and after. Timers keep running. Needs Playwright >= 1.45.
142
+ await context.clock?.setFixedTime?.(new Date('2025-01-01T09:00:00Z'))
143
+ const page = await context.newPage()
144
+ page.setDefaultTimeout(timeoutMs)
145
+ // Recent page errors, attached to timeouts so a broken artboard explains itself.
146
+ let pageErrors = []
147
+ page.on('pageerror', (error) => pageErrors.push(error.message))
148
+ page.on('console', (message) => {
149
+ if (message.type() === 'error') pageErrors.push(message.text())
150
+ })
151
+ page.on('framenavigated', (frame) => {
152
+ if (frame === page.mainFrame()) pageErrors = []
153
+ })
154
+
155
+ const previewUrl = (params) => `${base}/__seji/preview?${new URLSearchParams(params)}`
156
+
157
+ const waitForSnapshotState = async (key, timeout = timeoutMs) => {
158
+ let handle
159
+ try {
160
+ handle = await page.waitForFunction(
161
+ (name) => {
162
+ const state = window.__designSurfaceSnapshot
163
+ return state && (state.error || state[name]) ? state : null
164
+ },
165
+ key,
166
+ { timeout },
167
+ )
168
+ } catch (error) {
169
+ const detail = pageErrors.slice(-3).join(' | ')
170
+ const message = error instanceof Error ? error.message.split('\n')[0] : String(error)
171
+ throw new Error(`${message}${detail ? ` (page errors: ${detail})` : ''}`)
172
+ }
173
+ const state = await handle.jsonValue()
174
+ if (state.error) {
175
+ const error = new Error(state.error)
176
+ error.reportedByFrame = true
177
+ throw error
178
+ }
179
+ return state
180
+ }
181
+
182
+ const manifests = new Map()
183
+ const frames = async (design) => {
184
+ if (!manifests.has(design)) {
185
+ // First loads can trigger Vite dependency optimization and a reload; retry, then settle.
186
+ let lastError
187
+ for (let attempt = 0; attempt < 3 && !manifests.has(design); attempt += 1) {
188
+ try {
189
+ await page.goto(previewUrl({ design, snapshot: 'manifest' }), { waitUntil: 'load' })
190
+ const state = await waitForSnapshotState('manifest', Math.min(timeoutMs, 20_000))
191
+ await page.waitForLoadState('networkidle', { timeout: 10_000 }).catch(() => {})
192
+ manifests.set(design, state.manifest)
193
+ } catch (error) {
194
+ lastError = error
195
+ if (error instanceof Error && error.reportedByFrame) break
196
+ }
197
+ }
198
+ if (!manifests.has(design)) throw lastError
199
+ }
200
+ return manifests.get(design)
201
+ }
202
+
203
+ const shootOnce = async ({ design, page: pageId, frame, size }) => {
204
+ await page.setViewportSize({ width: size[0], height: size[1] })
205
+ await page.goto(previewUrl({ design, page: pageId, frame, snapshot: '1' }), { waitUntil: 'load' })
206
+ await waitForSnapshotState('ready')
207
+ await page.waitForLoadState('networkidle', { timeout: 5_000 }).catch(() => {})
208
+ await page.evaluate(SETTLE_SCRIPT)
209
+ const image = await page.screenshot({ animations: 'disabled', caret: 'hide', scale: 'css', type: 'png' })
210
+ // A render error caught after `ready` (late effect, lazy chunk) still fails the frame.
211
+ const late = await page.evaluate(() => window.__designSurfaceSnapshot?.error ?? null)
212
+ if (late) {
213
+ const error = new Error(late)
214
+ error.reportedByFrame = true
215
+ throw error
216
+ }
217
+ return image
218
+ }
219
+
220
+ /**
221
+ * Screenshot until two consecutive captures match (late fonts, images, reloads). Returns
222
+ * `{ image, unstable }`; `unstable` means no two of the attempts matched, so the image may
223
+ * not be what the source settles on and must not be compared as if it were.
224
+ */
225
+ const shoot = async (target, attempts = 4) => {
226
+ let previous = null
227
+ for (let attempt = 0; attempt < attempts; attempt += 1) {
228
+ try {
229
+ const image = await shootOnce(target)
230
+ if (previous && previous.equals(image)) return { image, unstable: false }
231
+ previous = image
232
+ await page.waitForTimeout(150)
233
+ } catch (error) {
234
+ // A Vite dependency reload can destroy the page mid-capture; retry. Errors the frame
235
+ // reported itself (unknown frame, render error) are final.
236
+ if (attempt === attempts - 1 || (error instanceof Error && error.reportedByFrame)) throw error
237
+ previous = null
238
+ }
239
+ }
240
+ if (!previous) throw new Error('no capture succeeded')
241
+ return { image: previous, unstable: true }
242
+ }
243
+
244
+ const close = async () => {
245
+ await browser.close().catch(() => {})
246
+ if (server) await server.close().catch(() => {})
247
+ }
248
+
249
+ return { base, frames, shoot, close }
250
+ }
@@ -0,0 +1,25 @@
1
+ import type { TokenOpHooks } from '../tokens/ops.mjs'
2
+
3
+ export type BaselineState = { captured: boolean; error: string | null }
4
+
5
+ export declare function toolSnapshotsRequest(request: {
6
+ kind: 'tokens' | 'consolidate'
7
+ op: string
8
+ snapshots: unknown
9
+ dryRun?: unknown
10
+ }): { take: boolean; error?: undefined } | { error: string; take?: undefined }
11
+
12
+ export declare function baselineHooks(options?: {
13
+ root?: string
14
+ url?: string
15
+ run?: <T>(task: () => Promise<T>) => Promise<T>
16
+ capture?: (options: { root: string; item: import('../shared/types').ReviewItem; url?: string }) => Promise<unknown>
17
+ }): { state: BaselineState; hooks: Required<Pick<TokenOpHooks, 'beforeWrite'>> }
18
+
19
+ export declare function compareToolItem(options: {
20
+ root?: string
21
+ state: BaselineState
22
+ result: Record<string, unknown>
23
+ url?: string
24
+ compare?: (options: { root: string; design: string; itemIds: string[]; url?: string }) => Promise<{ compared: Array<Record<string, unknown>> }>
25
+ }): Promise<Record<string, unknown>>
@@ -0,0 +1,69 @@
1
+ // Before/after snapshots around a tool-executed change: `tokens <op> --snapshots`,
2
+ // `consolidate apply --snapshots`, or `snapshots: true` on the HTTP routes. The screens the
3
+ // change affects are rendered from the unchanged source right before the tool writes (the
4
+ // record is stored on the review item the operation creates), then compared after the write
5
+ // and the token rebuild, like `verify --snapshots` does for agent changes.
6
+ //
7
+ // This module only imports the renderer lazily (through ./index.mjs when a capture actually
8
+ // runs), so the CLI and the dev server can check a request without loading Playwright.
9
+
10
+ /**
11
+ * Whether a tool request takes snapshots — one rule for the CLI (`--snapshots`) and HTTP
12
+ * (`snapshots: true`). `kind` is `tokens` or `consolidate`; `op` the operation / command.
13
+ * Returns `{ error }` for a request to refuse, else `{ take }`: dry runs and `revert` never take
14
+ * snapshots (nothing is written / the batch's own item is archived), and for consolidation
15
+ * only `apply` accepts the flag.
16
+ */
17
+ export function toolSnapshotsRequest({ kind, op, snapshots, dryRun } = {}) {
18
+ if (snapshots === undefined) return { take: false }
19
+ if (typeof snapshots !== 'boolean') return { error: 'snapshots must be true or false' }
20
+ if (kind === 'consolidate' && op !== 'apply') return { error: 'snapshots: true|false only applies to consolidate apply' }
21
+ return { take: snapshots && dryRun !== true && op !== 'revert' }
22
+ }
23
+
24
+ const defaultCapture = async (options) => (await import('./index.mjs')).captureItemBaseline(options)
25
+ const defaultCompare = async (options) => (await import('./index.mjs')).compareSnapshots(options)
26
+
27
+ /**
28
+ * `hooks` for runTokenOp / runConsolidate that capture the baseline before the first write.
29
+ * `run` wraps the rendering (the dev server queues it with its other captures). A failed
30
+ * capture does not stop the operation: `state.error` says why and the item has no baseline.
31
+ * `capture` is the baseline renderer (a seam for tests).
32
+ */
33
+ export function baselineHooks({ root = process.cwd(), url, run = (task) => task(), capture = defaultCapture } = {}) {
34
+ const state = { captured: false, error: null }
35
+ return {
36
+ state,
37
+ hooks: {
38
+ beforeWrite: async (item) => {
39
+ try {
40
+ const snapshots = await run(() => capture({ root, item, url }))
41
+ state.captured = true
42
+ state.error = null
43
+ return { snapshots }
44
+ } catch (error) {
45
+ state.captured = false
46
+ state.error = error instanceof Error ? error.message : String(error)
47
+ return undefined
48
+ }
49
+ },
50
+ },
51
+ }
52
+ }
53
+
54
+ /**
55
+ * Compare the item a tool operation recorded (after its write and rebuild). Returns the
56
+ * compare summary of that item, or `{ error }`. `compare` is the comparer (a seam for tests).
57
+ */
58
+ export async function compareToolItem({ root = process.cwd(), state, result, url, compare = defaultCompare }) {
59
+ if (!state.captured) return { error: state.error ?? 'no baseline was captured' }
60
+ if (typeof result?.itemId !== 'string' || typeof result?.design !== 'string') {
61
+ return { error: 'the operation recorded no review item' }
62
+ }
63
+ try {
64
+ const compared = await compare({ root, design: result.design, itemIds: [result.itemId], url })
65
+ return compared.compared[0] ?? { error: 'nothing was compared' }
66
+ } catch (error) {
67
+ return { error: error instanceof Error ? error.message : String(error) }
68
+ }
69
+ }
@@ -0,0 +1,51 @@
1
+ import postcss from 'postcss'
2
+
3
+ import { extractCssValueDiagnostics } from './types.mjs'
4
+
5
+ function isCustomPropertyDeclarationBlock(decl) {
6
+ if (!decl.prop.startsWith('--')) return false
7
+ const parent = decl.parent
8
+ if (!parent) return false
9
+ if (parent.type === 'atrule' && parent.name.toLowerCase() === 'theme') return true
10
+ if (
11
+ parent.type === 'rule' &&
12
+ /(?:^|[,\s(]):root(?:\b|$|\s|,|\))/.test(parent.selector)
13
+ ) {
14
+ return true
15
+ }
16
+ return false
17
+ }
18
+
19
+ export function analyzeCssAst({ file, rootAst, adapter = 'css' }) {
20
+ const diagnostics = []
21
+ rootAst.walkDecls((decl) => {
22
+ const line = decl.source?.start?.line ?? 1
23
+ const column = decl.source?.start?.column ?? 1
24
+ const includeLiterals = !isCustomPropertyDeclarationBlock(decl)
25
+ // The enclosing rule selector lets the usage index map CSS refs to components by class name.
26
+ const selector = decl.parent?.type === 'rule' ? decl.parent.selector : undefined
27
+ for (const diag of extractCssValueDiagnostics({
28
+ file,
29
+ line,
30
+ column,
31
+ adapter,
32
+ property: decl.prop,
33
+ value: decl.value,
34
+ includeLiterals,
35
+ })) {
36
+ diagnostics.push(selector ? { ...diag, selector } : diag)
37
+ }
38
+ })
39
+ return diagnostics
40
+ }
41
+
42
+ export const cssAdapter = {
43
+ id: 'css',
44
+ detect(file) {
45
+ return /\.css$/i.test(file)
46
+ },
47
+ analyze(file, content) {
48
+ const rootAst = postcss.parse(content, { from: file })
49
+ return analyzeCssAst({ file, rootAst, adapter: 'css' })
50
+ },
51
+ }