@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,165 @@
1
+ // `seji component …`, `seji propose component …` and
2
+ // `seji proposal …`: argument parsing over the shared component operations (the
3
+ // HTTP API uses the same functions with the same catalog, see catalog.mjs).
4
+ import path from 'node:path'
5
+
6
+ import {
7
+ describeComponent,
8
+ parseFrames,
9
+ listComponents,
10
+ planComponentAction,
11
+ recordComponentAction,
12
+ revertComponentAction,
13
+ showComponent,
14
+ } from '../shared/componentOps.mjs'
15
+ import { decideProposal } from '../shared/proposals.mjs'
16
+ import { loadComponentCatalog } from './catalog.mjs'
17
+
18
+ const VALUE_FLAGS = new Set([
19
+ '--to',
20
+ '--into',
21
+ '--replacement',
22
+ '--reason',
23
+ '--design',
24
+ '--frames',
25
+ '--frame',
26
+ '--rationale',
27
+ '--note',
28
+ '--value',
29
+ '--config',
30
+ ])
31
+ const BOOLEAN_FLAGS = new Set(['--no-replacement', '--replace-all', '--dry-run', '--force'])
32
+ // Repeatable: every occurrence is kept (`--frame a --frame b`, `--frames a,b`, or both).
33
+ const LIST_FLAGS = new Set(['--frames', '--frame'])
34
+
35
+ function parse(argv) {
36
+ const positional = []
37
+ const flags = {}
38
+ for (let i = 0; i < argv.length; i += 1) {
39
+ const token = argv[i]
40
+ if (!token.startsWith('--')) {
41
+ positional.push(token)
42
+ continue
43
+ }
44
+ const [key, inline] = token.includes('=') ? [token.slice(0, token.indexOf('=')), token.slice(token.indexOf('=') + 1)] : [token, undefined]
45
+ if (BOOLEAN_FLAGS.has(key)) {
46
+ flags[key] = true
47
+ } else if (VALUE_FLAGS.has(key)) {
48
+ const value = inline ?? argv[i + 1]
49
+ if (value === undefined || (inline === undefined && value.startsWith('--'))) throw new Error(`${key} needs a value`)
50
+ if (LIST_FLAGS.has(key)) flags['--frames'] = [...(flags['--frames'] ?? []), value]
51
+ else flags[key] = value
52
+ if (inline === undefined) i += 1
53
+ } else {
54
+ throw new Error(`unknown option: ${key}`)
55
+ }
56
+ }
57
+ return { positional, flags }
58
+ }
59
+
60
+ const relative = (root, file) => path.relative(root, file).split(path.sep).join('/')
61
+ const SUBCOMMANDS = ['list', 'show', 'describe', 'rename', 'merge', 'deprecate', 'undeprecate', 'delete', 'tidy', 'revert']
62
+
63
+ function describeResult(root, name, result) {
64
+ if (result.op) {
65
+ const op = result.op
66
+ const left = op.leftovers.length
67
+ ? `\nLeft for the agent:\n${op.leftovers.map((place) => ` ${place.file}:${place.line}:${place.column} ${place.reason}${place.text ? ` ${place.text}` : ''}`).join('\n')}`
68
+ : ''
69
+ return `${op.summary}: tool changed ${op.counts.changed} place(s) in ${op.counts.files} file(s), left ${op.leftovers.length} for the agent. Recorded ${op.itemId} (batch ${op.batchId}) in ${relative(root, result.reviewPath)}${left}`
70
+ }
71
+ if (result.action === 'deprecate') {
72
+ return `Marked ${name} deprecated in design/components.json${result.entry?.replacement ? ` (replacement: ${result.entry.replacement})` : ' (no replacement)'}`
73
+ }
74
+ if (result.action === 'undeprecate') return `${name} is no longer deprecated in design/components.json`
75
+ const { item, reviewPath } = result
76
+ return `Recorded ${item.componentAction} of ${name} as ${item.id} in ${relative(root, reviewPath)}`
77
+ }
78
+
79
+ /** Returns the text to print. Throws on bad input. */
80
+ export async function runComponentCommand({ root, argv }) {
81
+ const [sub, ...rest] = argv
82
+ const { positional, flags } = parse(rest)
83
+ if (!SUBCOMMANDS.includes(sub)) {
84
+ throw new Error(`unknown component subcommand: ${sub ?? '(missing)'} (expected ${SUBCOMMANDS.join(', ')})`)
85
+ }
86
+ if (sub === 'revert') {
87
+ const batch = positional[0]
88
+ if (!batch) throw new Error('component revert needs a <batch> id')
89
+ const result = await revertComponentAction({ root, batch, design: flags['--design'], force: Boolean(flags['--force']), dryRun: Boolean(flags['--dry-run']) })
90
+ return JSON.stringify(result, null, 2)
91
+ }
92
+ const catalog = await loadComponentCatalog(root, { configFile: flags['--config'] })
93
+ if (sub === 'list') {
94
+ return JSON.stringify(await listComponents({ root, catalog }), null, 2)
95
+ }
96
+ const name = positional[0]
97
+ if (!name) throw new Error(`component ${sub} needs a component name`)
98
+ if (sub === 'show') {
99
+ const report = await showComponent({ root, name, catalog })
100
+ if (!report) throw new Error(`unknown component: ${name}`)
101
+ return JSON.stringify(report, null, 2)
102
+ }
103
+ if (sub === 'describe') {
104
+ const text = positional.slice(1).join(' ')
105
+ const entry = await describeComponent({ root, name, description: text, catalog })
106
+ return entry?.$description ? `Described ${name} in design/components.json` : `Cleared the usage note of ${name}`
107
+ }
108
+ const common = { root, name, catalog, design: flags['--design'], reason: flags['--reason'] }
109
+ let args
110
+ if (sub === 'rename') {
111
+ args = { ...common, action: 'rename', to: flags['--to'] ?? positional[1] }
112
+ } else if (sub === 'merge') {
113
+ args = { ...common, action: 'merge', to: flags['--into'] ?? positional[1] }
114
+ } else if (sub === 'deprecate') {
115
+ if (!flags['--replacement'] && !flags['--no-replacement']) {
116
+ throw new Error('deprecate needs --replacement <Component> or an explicit --no-replacement')
117
+ }
118
+ args = {
119
+ ...common,
120
+ action: 'deprecate',
121
+ to: flags['--no-replacement'] ? null : flags['--replacement'],
122
+ mode: flags['--replace-all'] ? 'replace' : 'mark',
123
+ }
124
+ } else if (sub === 'undeprecate') {
125
+ args = { ...common, action: 'undeprecate' }
126
+ } else if (sub === 'delete') {
127
+ args = { ...common, action: 'delete' }
128
+ } else {
129
+ args = { ...common, action: 'tidy', frames: parseFrames(flags['--frames']) }
130
+ }
131
+ if (flags['--dry-run']) {
132
+ return JSON.stringify(await planComponentAction(args), null, 2)
133
+ }
134
+ return describeResult(root, name, await recordComponentAction(args))
135
+ }
136
+
137
+ /** `propose component <Name> --frames a,b --rationale "…" [--reason "<summary>"] [--design <id>]` (tidy only). */
138
+ export async function proposeComponent({ root, argv }) {
139
+ const { positional, flags } = parse(argv)
140
+ const name = positional[0]
141
+ if (!name) throw new Error('propose component needs a component name')
142
+ if (!flags['--rationale']) throw new Error('propose component needs --rationale')
143
+ const catalog = await loadComponentCatalog(root, { configFile: flags['--config'] })
144
+ const { item, reviewPath } = await recordComponentAction({
145
+ root,
146
+ name,
147
+ catalog,
148
+ action: 'tidy',
149
+ design: flags['--design'],
150
+ reason: flags['--reason'],
151
+ frames: parseFrames(flags['--frames']),
152
+ author: 'agent',
153
+ rationale: flags['--rationale'],
154
+ })
155
+ return `Proposed tidy of ${name} (${(item.frames ?? []).join(', ')}) as ${item.id} in ${relative(root, reviewPath)}`
156
+ }
157
+
158
+ /** `proposal <design> <id> approve|reject|reset [--note <text>] [--value <value>]`. */
159
+ export function runProposalCommand({ root, argv }) {
160
+ const { positional, flags } = parse(argv)
161
+ const [design, id, decision] = positional
162
+ if (!design || !id || !decision) throw new Error('proposal needs <design> <id> approve|reject|reset')
163
+ const { item, reviewPath } = decideProposal({ root, design, id, decision, note: flags['--note'], value: flags['--value'] })
164
+ return `${item.id}: ${item.proposalDecision ?? 'undecided'} in ${relative(root, reviewPath)}`
165
+ }
@@ -0,0 +1,159 @@
1
+ // CLI front for `seji consolidate …` (src/tokens/consolidate).
2
+ import { ConsolidateError, runConsolidate } from '../tokens/consolidate/index.mjs'
3
+ import { TokenOpError } from '../tokens/ops.mjs'
4
+ import { baselineHooks, compareToolItem, toolSnapshotsRequest } from '../snapshots/toolOps.mjs'
5
+
6
+ const VALUE_FLAGS = new Map([
7
+ ['scope', ['scope', 'list']],
8
+ ['category', ['category', 'list']],
9
+ ['tolerance', ['tolerance', 'value']],
10
+ ['root-px', ['rootPx', 'value']],
11
+ ['design', ['design', 'value']],
12
+ ['action', ['action', 'value']],
13
+ ['token', ['token', 'value']],
14
+ ['name', ['name', 'value']],
15
+ ['tier', ['tier', 'value']],
16
+ ['description', ['description', 'value']],
17
+ ['value', ['value', 'value']],
18
+ ['merge', ['merge', 'list']],
19
+ ])
20
+ const BOOLEAN_FLAGS = new Map([
21
+ ['dry-run', ['dryRun', true]],
22
+ ['force', ['force', true]],
23
+ ['accept-visible-change', ['acceptVisibleChange', true]],
24
+ ['reject-visible-change', ['acceptVisibleChange', false]],
25
+ ['json', ['json', true]],
26
+ ['snapshots', ['snapshots', true]],
27
+ ])
28
+ const POSITIONALS = { show: ['plan'], set: ['plan', 'row'], apply: ['plan'], revert: ['plan'], discard: ['plan'] }
29
+
30
+ export function parseConsolidateArgs(command, argv) {
31
+ const args = {}
32
+ const positionals = []
33
+ for (let i = 0; i < argv.length; i += 1) {
34
+ const raw = argv[i]
35
+ if (!raw.startsWith('--') || raw === '--') {
36
+ positionals.push(raw)
37
+ continue
38
+ }
39
+ const eq = raw.indexOf('=')
40
+ const name = eq > 2 ? raw.slice(2, eq) : raw.slice(2)
41
+ if (BOOLEAN_FLAGS.has(name)) {
42
+ if (eq > 2) throw new Error(`--${name} takes no value`)
43
+ const [key, value] = BOOLEAN_FLAGS.get(name)
44
+ args[key] = value
45
+ continue
46
+ }
47
+ const flag = VALUE_FLAGS.get(name)
48
+ if (!flag) throw new Error(`unknown option for consolidate ${command}: --${name}`)
49
+ let value
50
+ if (eq > 2) value = raw.slice(eq + 1)
51
+ else {
52
+ value = argv[i + 1]
53
+ if (value === undefined) throw new Error(`--${name} requires a value`)
54
+ const nextName = value.startsWith('--') ? value.slice(2).split('=')[0] : null
55
+ // `--token --color-ink` is a value; `--token --dry-run` is a missing value.
56
+ if (nextName && (VALUE_FLAGS.has(nextName) || BOOLEAN_FLAGS.has(nextName))) throw new Error(`--${name} requires a value`)
57
+ i += 1
58
+ }
59
+ const [key, kind] = flag
60
+ if (kind === 'list') args[key] = [...(args[key] ?? []), value]
61
+ else args[key] = value
62
+ }
63
+ const names = POSITIONALS[command] ?? []
64
+ if (positionals.length > names.length) throw new Error(`unexpected argument: ${positionals[names.length]}`)
65
+ names.forEach((name, index) => {
66
+ if (positionals[index] !== undefined) args[name] = positionals[index]
67
+ })
68
+ return args
69
+ }
70
+
71
+ const short = (value, width) => {
72
+ const text = String(value ?? '')
73
+ return text.length > width ? `${text.slice(0, width - 1)}…` : text.padEnd(width)
74
+ }
75
+
76
+ function describeAction(row) {
77
+ if (row.action === 'skip') return row.suggestion?.action === 'merge' ? `skip (suggest merge ${row.suggestion.merge.join(', ')} → ${row.suggestion.token})` : row.suggestion?.action === 'keep' ? 'keep' : 'skip'
78
+ if (row.action === 'undecided') {
79
+ const proposed = row.proposed ? describeAction(row.proposed) : row.suggestion?.action
80
+ return `undecided — pick with --action (tool proposes: ${proposed})`
81
+ }
82
+ if (row.action === 'reuse') return `reuse ${row.token}`
83
+ if (row.action === 'merge') return `merge ${row.merge?.join(', ')} → ${row.token}`
84
+ if (row.action === 'create') return `create ${row.name || '<name?>'} [${row.tier || 'tier?'}] = ${row.value}`
85
+ return row.action
86
+ }
87
+
88
+ /** Human-readable table of scan / plan rows. */
89
+ export function formatRows(result) {
90
+ const lines = []
91
+ const header = result.id ? `Plan ${result.id} (${result.status})` : 'Consolidation scan'
92
+ const scope = result.options?.scope?.length ? result.options.scope.join(', ') : '(project)'
93
+ lines.push(`${header} · scope ${scope} · ${result.options?.categories?.join(', ')}`)
94
+ const c = result.counts ?? {}
95
+ lines.push(`${c.rows ?? result.rows.length} row(s) · ${c.occurrences ?? 0} hard-coded value(s), ${c.replaceable ?? 0} replaceable by the tool, ${c.leftovers ?? 0} for the agent · ${c.tokensInUse ?? 0} token(s) in use · ${c.visibleChanges ?? 0} row(s) change rendering`)
96
+ lines.push('')
97
+ lines.push(`${short('row', 5)} ${short('category', 12)} ${short('value', 22)} ${short('found', 12)} ${short('tokens', 28)} action`)
98
+ for (const row of result.rows) {
99
+ const values = row.values.length ? row.values.map((value) => value.canonical).join(' ') : row.anchor
100
+ const found = row.counts.occurrences ? `${row.counts.occurrences}× (${row.counts.replaceable} tool)` : '—'
101
+ const tokens = row.tokens.map((entry) => entry.path).join(', ') || '—'
102
+ const visible = row.visibleChange?.length
103
+ ? ` ⚠ changes rendering: ${row.visibleChange
104
+ .slice(0, 2)
105
+ .map((change) => `${change.token ? `${change.token} ` : ''}${change.from}→${change.to} ${Object.entries(change.delta).map(([key, value]) => `${key} ${value}`).join(' ')}`)
106
+ .join('; ')}${row.acceptVisibleChange ? ' (accepted)' : ''}`
107
+ : ''
108
+ lines.push(`${short(row.id, 5)} ${short(row.category, 12)} ${short(values, 22)} ${short(found, 12)} ${short(tokens, 28)} ${describeAction(row)}${visible}`)
109
+ }
110
+ if (result.readiness) {
111
+ lines.push('')
112
+ if (result.readiness.ready) lines.push('Ready to apply.')
113
+ for (const entry of result.readiness.blocked) lines.push(`Blocked ${entry.row}: ${entry.problems.join('; ')}`)
114
+ }
115
+ if (result.unclustered?.length) {
116
+ lines.push('')
117
+ lines.push(`Not clustered (computed / formula values, left for the agent): ${result.unclustered.length}`)
118
+ }
119
+ return lines.join('\n')
120
+ }
121
+
122
+ /** Run `seji consolidate <command> …`; prints JSON (or a table) and returns the exit code. */
123
+ export async function runConsolidateCli({ root, command, argv }) {
124
+ let args
125
+ try {
126
+ args = parseConsolidateArgs(command, argv)
127
+ } catch (error) {
128
+ console.error(`seji: ${error instanceof Error ? error.message : String(error)}`)
129
+ return 1
130
+ }
131
+ const { json, snapshots, ...rest } = args
132
+ const request = toolSnapshotsRequest({ kind: 'consolidate', op: command, snapshots, dryRun: rest.dryRun })
133
+ if (request.error) {
134
+ console.error(`seji: --${request.error.replace(/^snapshots: true\|false/, 'snapshots')}`)
135
+ return 1
136
+ }
137
+ try {
138
+ // `apply --snapshots`: render the affected screens before the write, compare after it.
139
+ const baseline = request.take ? baselineHooks({ root }) : null
140
+ const result = await runConsolidate({ root, command, args: rest, ...(baseline ? { hooks: baseline.hooks } : {}) })
141
+ if (baseline) result.snapshots = await compareToolItem({ root, state: baseline.state, result })
142
+ const table = !json && (command === 'scan' || command === 'plan' || command === 'show')
143
+ if (table) {
144
+ console.log(formatRows(result))
145
+ if (command === 'plan') console.log(`\nSaved ${result.file}. Edit rows with \`seji consolidate set ${result.id} <row> …\`, then \`consolidate apply ${result.id} --dry-run\`.`)
146
+ } else {
147
+ console.log(JSON.stringify(result, null, 2))
148
+ }
149
+ return result.refused ? 2 : 0
150
+ } catch (error) {
151
+ if (error instanceof ConsolidateError || error instanceof TokenOpError) {
152
+ console.log(JSON.stringify({ error: error.message, ...(error.details ?? {}) }, null, 2))
153
+ console.error(`seji: ${error.message}`)
154
+ return 1
155
+ }
156
+ console.error(`seji: ${error instanceof Error ? error.message : String(error)}`)
157
+ return 1
158
+ }
159
+ }
@@ -0,0 +1,68 @@
1
+ // The one write outside design/: `@import "./tokens.generated.css";` in the app's CSS entry,
2
+ // after `@import "tailwindcss"` (after the other leading @imports), with the path relative to the
3
+ // entry. Located and inserted through the postcss syntax tree; untouched nodes keep their text.
4
+ import { existsSync, readFileSync, writeFileSync } from 'node:fs'
5
+ import { dirname, relative, resolve, sep } from 'node:path'
6
+
7
+ import postcss from 'postcss'
8
+
9
+ import { cssImports } from './appScan.mjs'
10
+
11
+ const toPosix = (file) => file.split(sep).join('/')
12
+
13
+ export const importSpecifier = (cssEntry, generatedCss) => {
14
+ const rel = toPosix(relative(dirname(cssEntry), generatedCss))
15
+ return rel.startsWith('.') ? rel : `./${rel}`
16
+ }
17
+
18
+ /** Does `cssEntry` import `generatedCss`? */
19
+ export function hasTokenImport(cssEntry, generatedCss) {
20
+ if (!cssEntry || !existsSync(cssEntry)) return false
21
+ try {
22
+ const root = postcss.parse(readFileSync(cssEntry, 'utf8'), { from: cssEntry })
23
+ return cssImports(root).some(({ target }) => /^[./]/.test(target) && resolve(dirname(cssEntry), target) === resolve(generatedCss))
24
+ } catch {
25
+ return false
26
+ }
27
+ }
28
+
29
+ /** Insert the import. `{ status: 'added' | 'present' | 'skipped', file, line?, reason? }`. */
30
+ export function ensureTokenImport(cssEntry, generatedCss, { dryRun = false, displayRoot = dirname(cssEntry) } = {}) {
31
+ const file = toPosix(relative(displayRoot, cssEntry))
32
+ if (!/\.css$/i.test(cssEntry)) return { status: 'skipped', file, reason: `${file} is not plain CSS; add @import "${importSpecifier(cssEntry, generatedCss)}"; to it by hand` }
33
+ const text = readFileSync(cssEntry, 'utf8')
34
+ let root
35
+ try {
36
+ root = postcss.parse(text, { from: cssEntry })
37
+ } catch (error) {
38
+ return { status: 'skipped', file, reason: `${file} does not parse: ${error instanceof Error ? error.message : String(error)}` }
39
+ }
40
+ const imports = cssImports(root)
41
+ if (imports.some(({ target }) => /^[./]/.test(target) && resolve(dirname(cssEntry), target) === resolve(generatedCss))) return { status: 'present', file }
42
+ const spec = importSpecifier(cssEntry, generatedCss)
43
+ const node = postcss.atRule({ name: 'import', params: `"${spec}"` })
44
+ // Leading @charset / @import / @layer statements stay first; ours goes right after them.
45
+ let anchor = null
46
+ for (const child of root.nodes) {
47
+ if (child.type === 'comment') continue
48
+ if (child.type === 'atrule' && (child.name === 'import' || child.name === 'charset' || (child.name === 'layer' && !child.nodes))) {
49
+ anchor = child
50
+ continue
51
+ }
52
+ break
53
+ }
54
+ if (anchor) {
55
+ node.raws.before = '\n'
56
+ anchor.after(node)
57
+ } else {
58
+ const first = root.first
59
+ root.prepend(node)
60
+ node.raws.before = ''
61
+ if (first) first.raws.before = '\n\n'
62
+ }
63
+ if (node === root.last) root.raws.semicolon = true
64
+ const output = root.toString()
65
+ if (!dryRun) writeFileSync(cssEntry, output)
66
+ const line = output.slice(0, output.indexOf(`@import "${spec}"`)).split('\n').length
67
+ return { status: 'added', file, line, spec }
68
+ }