@rien7/seji 0.0.0-stage → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (413) hide show
  1. package/bin/design-surface.mjs +6 -0
  2. package/bin/postinstall.mjs +19 -0
  3. package/bin/seji.mjs +573 -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 +335 -0
  16. package/dist/cli/doctor.mjs +306 -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 +357 -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 +2832 -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/oklab.d.mts +6 -0
  309. package/dist/shared/oklab.mjs +56 -0
  310. package/dist/shared/optimizeEntries.d.mts +5 -0
  311. package/dist/shared/optimizeEntries.mjs +24 -0
  312. package/dist/shared/packages.d.mts +11 -0
  313. package/dist/shared/packages.mjs +96 -0
  314. package/dist/shared/projectFiles.d.mts +23 -0
  315. package/dist/shared/projectFiles.mjs +72 -0
  316. package/dist/shared/prompt.d.mts +20 -0
  317. package/dist/shared/prompt.mjs +201 -0
  318. package/dist/shared/proposals.d.mts +11 -0
  319. package/dist/shared/proposals.mjs +42 -0
  320. package/dist/shared/protocol.d.ts +122 -0
  321. package/dist/shared/protocol.d.ts.map +1 -0
  322. package/dist/shared/protocol.js +7 -0
  323. package/dist/shared/protocol.js.map +1 -0
  324. package/dist/shared/reviewArchive.d.mts +4 -0
  325. package/dist/shared/reviewArchive.mjs +19 -0
  326. package/dist/shared/reviewStore.d.mts +30 -0
  327. package/dist/shared/reviewStore.mjs +218 -0
  328. package/dist/shared/reviewVerify.d.mts +21 -0
  329. package/dist/shared/reviewVerify.mjs +158 -0
  330. package/dist/shared/sizeModes.d.mts +15 -0
  331. package/dist/shared/sizeModes.mjs +53 -0
  332. package/dist/shared/sketches.d.mts +10 -0
  333. package/dist/shared/sketches.mjs +64 -0
  334. package/dist/shared/snapshotCheck.d.mts +13 -0
  335. package/dist/shared/snapshotCheck.mjs +81 -0
  336. package/dist/shared/timeout.d.mts +1 -0
  337. package/dist/shared/timeout.mjs +15 -0
  338. package/dist/shared/tokens.d.ts +2 -0
  339. package/dist/shared/tokens.d.ts.map +1 -0
  340. package/dist/shared/tokens.js +2 -0
  341. package/dist/shared/tokens.js.map +1 -0
  342. package/dist/shared/types.d.ts +689 -0
  343. package/dist/shared/types.d.ts.map +1 -0
  344. package/dist/shared/types.js +13 -0
  345. package/dist/shared/types.js.map +1 -0
  346. package/dist/shared/wheelRouting.d.mts +9 -0
  347. package/dist/shared/wheelRouting.mjs +31 -0
  348. package/dist/shared/writeScope.mjs +96 -0
  349. package/dist/snapshots/diff.d.mts +28 -0
  350. package/dist/snapshots/diff.mjs +263 -0
  351. package/dist/snapshots/index.d.mts +110 -0
  352. package/dist/snapshots/index.mjs +638 -0
  353. package/dist/snapshots/render.d.mts +24 -0
  354. package/dist/snapshots/render.mjs +250 -0
  355. package/dist/snapshots/toolOps.d.mts +25 -0
  356. package/dist/snapshots/toolOps.mjs +69 -0
  357. package/dist/tokens/adapters/css.mjs +51 -0
  358. package/dist/tokens/adapters/cssInCode.mjs +314 -0
  359. package/dist/tokens/adapters/oxcShared.mjs +80 -0
  360. package/dist/tokens/adapters/preprocessor.mjs +63 -0
  361. package/dist/tokens/adapters/registry.mjs +53 -0
  362. package/dist/tokens/adapters/tailwindcss.mjs +424 -0
  363. package/dist/tokens/adapters/types.mjs +117 -0
  364. package/dist/tokens/consolidate/index.d.mts +42 -0
  365. package/dist/tokens/consolidate/index.mjs +111 -0
  366. package/dist/tokens/consolidate/normalize.mjs +479 -0
  367. package/dist/tokens/consolidate/plan.mjs +726 -0
  368. package/dist/tokens/consolidate/scan.mjs +928 -0
  369. package/dist/tokens/extract.mjs +441 -0
  370. package/dist/tokens/moduleData.d.mts +14 -0
  371. package/dist/tokens/moduleData.mjs +32 -0
  372. package/dist/tokens/opLock.d.mts +4 -0
  373. package/dist/tokens/opLock.mjs +108 -0
  374. package/dist/tokens/ops.d.mts +71 -0
  375. package/dist/tokens/ops.mjs +1511 -0
  376. package/dist/tokens/pipeline.mjs +813 -0
  377. package/dist/tokens/report.d.mts +47 -0
  378. package/dist/tokens/report.mjs +257 -0
  379. package/dist/tokens/rewrite/code.mjs +172 -0
  380. package/dist/tokens/rewrite/css.mjs +154 -0
  381. package/dist/tokens/rewrite/index.mjs +244 -0
  382. package/dist/tokens/rewrite/tailwind.mjs +288 -0
  383. package/dist/tokens/rewrite/text.mjs +116 -0
  384. package/dist/tokens/rewrite/value.mjs +115 -0
  385. package/dist/tokens/usage.d.mts +97 -0
  386. package/dist/tokens/usage.mjs +680 -0
  387. package/dist/vite/agent.d.ts +21 -0
  388. package/dist/vite/agent.d.ts.map +1 -0
  389. package/dist/vite/agent.js +165 -0
  390. package/dist/vite/agent.js.map +1 -0
  391. package/dist/vite/events.d.ts +27 -0
  392. package/dist/vite/events.d.ts.map +1 -0
  393. package/dist/vite/events.js +156 -0
  394. package/dist/vite/events.js.map +1 -0
  395. package/dist/vite/layout.d.ts +2 -0
  396. package/dist/vite/layout.d.ts.map +1 -0
  397. package/dist/vite/layout.js +4 -0
  398. package/dist/vite/layout.js.map +1 -0
  399. package/dist/vite/plugin.d.ts +40 -0
  400. package/dist/vite/plugin.d.ts.map +1 -0
  401. package/dist/vite/plugin.js +1255 -0
  402. package/dist/vite/plugin.js.map +1 -0
  403. package/dist/vite/requestGuard.d.mts +3 -0
  404. package/dist/vite/requestGuard.mjs +43 -0
  405. package/dist/vite/review.d.ts +11 -0
  406. package/dist/vite/review.d.ts.map +1 -0
  407. package/dist/vite/review.js +283 -0
  408. package/dist/vite/review.js.map +1 -0
  409. package/package.json +104 -4
  410. package/skills/seji/SKILL.md +395 -0
  411. package/skills/seji-authoring/SKILL.md +397 -0
  412. package/skills/seji-tokens/SKILL.md +432 -0
  413. package/README.md +0 -3
@@ -0,0 +1,136 @@
1
+ // "Promote to component": the selected element should become a new app component. The tool
2
+ // does not move code: choosing the props (only what varies), matching tokens and replacing
3
+ // the spot without a visual change needs judgment. The editor's form builds a `component`
4
+ // review item (`componentAction: 'extract'`) with this module and writes it through the
5
+ // review endpoint (POST /__seji/api/review, an `upsert` op) like any other item; the agent
6
+ // gets it in "Hand to agent" / `seji prompt` and follows the skill. Verification is
7
+ // the generic one (the "before" baseline the review endpoint captures for new items).
8
+ //
9
+ // from: 'design' the element is in the design's own code (design/…): a new component
10
+ // goes in the component directory and the design references it.
11
+ // from: 'component' the element is inside an app component (`parent`): it is split out
12
+ // and the parent references it.
13
+ //
14
+ // Pure (no Node APIs): the editor bundles it, tests import it directly.
15
+
16
+ export const COMPONENT_NAME = /^[A-Z][A-Za-z0-9_]*$/
17
+
18
+ /** A `component` review item that asks for a new component (Promote to component). */
19
+ export const isExtractItem = (item) => item?.kind === 'component' && item?.componentAction === 'extract'
20
+
21
+ const fileOf = (source) =>
22
+ typeof source === 'string' && source.trim()
23
+ ? source.trim().replaceAll('\\', '/').replace(/^\.\/+/, '').replace(/:\d+(?::\d+)?$/, '')
24
+ : null
25
+
26
+ /**
27
+ * Where a selection comes from. `catalog` is the app component names. A selection whose
28
+ * source is under `design/` (or that is in no app component) is `design`; one inside an app
29
+ * component (its own component, else the nearest one on its component stack) is `component`
30
+ * with that `parent`.
31
+ */
32
+ export function extractSourceOf(node, catalog) {
33
+ const names = catalog instanceof Set ? catalog : new Set(catalog ?? [])
34
+ const file = fileOf(node?.source)
35
+ const component = typeof node?.component === 'string' ? node.component : null
36
+ if (file && (file === 'design' || file.startsWith('design/'))) return { from: 'design', parent: null }
37
+ if (component && names.has(component)) return { from: 'component', parent: component }
38
+ // Inside a helper of an app component (e.g. a local FieldControl in TokenField): the nearest
39
+ // app component on the stack (outermost first) is the parent.
40
+ const stack = Array.isArray(node?.components) ? node.components : []
41
+ for (let index = stack.length - 1; index >= 0; index -= 1) {
42
+ if (names.has(stack[index])) return { from: 'component', parent: stack[index] }
43
+ }
44
+ return { from: 'design', parent: null }
45
+ }
46
+
47
+ /** The selection is already an app component (its root element): promoting it is refused. */
48
+ export const alreadyComponent = (node, catalog) => {
49
+ const names = catalog instanceof Set ? catalog : new Set(catalog ?? [])
50
+ return Boolean(node?.componentRoot && typeof node.component === 'string' && names.has(node.component))
51
+ ? node.component
52
+ : null
53
+ }
54
+
55
+ /**
56
+ * The names a new component may not take: app components, registered component pages and
57
+ * pending Promote to component items (not archived).
58
+ */
59
+ export function takenComponentNames({ catalog = [], pages = [], items = [] } = {}) {
60
+ const taken = new Set([...catalog, ...pages])
61
+ for (const item of items) if (isExtractItem(item) && item.status !== 'archived' && item.to) taken.add(item.to)
62
+ return taken
63
+ }
64
+
65
+ /**
66
+ * The form's first problem as a code, or null: invalid-name, name-taken,
67
+ * description-required, unknown-dir (when `dirs` lists the component directories).
68
+ */
69
+ export function extractError({ name, description, dir, dirs = [], taken } = {}) {
70
+ const value = String(name ?? '').trim()
71
+ if (!COMPONENT_NAME.test(value)) return 'invalid-name'
72
+ if (taken?.has(value)) return 'name-taken'
73
+ if (!String(description ?? '').trim()) return 'description-required'
74
+ if (dirs.length && dir && !dirs.some((entry) => (typeof entry === 'string' ? entry : entry.dir) === dir)) return 'unknown-dir'
75
+ return null
76
+ }
77
+
78
+ /** The node locator stored on the item (the fields style items carry), bounded. */
79
+ function locatorOf(node) {
80
+ const text = (value, max) => (typeof value === 'string' ? value.slice(0, max) : undefined)
81
+ return {
82
+ ...(typeof node?.id === 'number' ? { id: node.id } : {}),
83
+ anchor: text(node?.anchor, 200) ?? null,
84
+ tag: text(node?.tag, 80) ?? '',
85
+ name: text(node?.name, 200) ?? '',
86
+ component: text(node?.component, 200) ?? null,
87
+ source: text(node?.source, 500) ?? null,
88
+ path: text(node?.path, 2000) ?? '',
89
+ html: text(node?.html, 4000) ?? '',
90
+ }
91
+ }
92
+
93
+ /**
94
+ * The review item for a Promote to component form. `frame` is the frame key
95
+ * (`<page>__<frame>`); `parentFile` is the parent's source when known.
96
+ */
97
+ export function extractItem({
98
+ design,
99
+ node,
100
+ page,
101
+ frame,
102
+ name,
103
+ description,
104
+ dir,
105
+ from = 'design',
106
+ parent = null,
107
+ parentFile = null,
108
+ author = 'human',
109
+ id,
110
+ now = new Date().toISOString(),
111
+ }) {
112
+ const componentName = String(name).trim()
113
+ const suffix = id ?? Math.random().toString(36).slice(2, 10)
114
+ const locator = locatorOf(node)
115
+ return {
116
+ id: `component-extract-${componentName}-${suffix}`,
117
+ design,
118
+ kind: 'component',
119
+ scope: 'component',
120
+ ...(page ? { page } : frame && frame.includes('__') ? { page: frame.split('__')[0] } : {}),
121
+ ...(frame ? { frame } : {}),
122
+ target: { type: 'component', component: componentName },
123
+ node: locator,
124
+ componentAction: 'extract',
125
+ from,
126
+ to: componentName,
127
+ componentDescription: String(description).trim(),
128
+ ...(dir ? { dir } : {}),
129
+ ...(from === 'component' && parent ? { parent, ...(parentFile ? { parentFile: fileOf(parentFile) } : {}) } : {}),
130
+ ...(locator.source ? { source: locator.source } : {}),
131
+ status: 'open',
132
+ author: author === 'agent' ? 'agent' : 'human',
133
+ createdAt: now,
134
+ updatedAt: now,
135
+ }
136
+ }
@@ -0,0 +1,26 @@
1
+ export declare const COMPONENT_META_FILE: string
2
+
3
+ export type ComponentMetaEntry = {
4
+ $description?: string
5
+ $deprecated?: string | boolean
6
+ replacement?: string | null
7
+ deprecatedAt?: string
8
+ [key: string]: unknown
9
+ }
10
+
11
+ export type ComponentMeta = {
12
+ layers: { base: string[] } | null
13
+ components: Record<string, ComponentMetaEntry>
14
+ }
15
+
16
+ export declare function componentMetaPath(root: string): string
17
+ export declare function readComponentMeta(root: string): ComponentMeta
18
+ export declare function updateComponentMeta(
19
+ root: string,
20
+ name: string,
21
+ mutate: (entry: ComponentMetaEntry) => ComponentMetaEntry | null,
22
+ ): ComponentMetaEntry | null
23
+ export declare function baseLayerFiles(root: string, meta?: ComponentMeta): Promise<Set<string> | null>
24
+ export declare function deprecationOf(
25
+ entry: ComponentMetaEntry | undefined,
26
+ ): { reason: string; replacement: string | null; at?: string } | null
@@ -0,0 +1,87 @@
1
+ // design/components.json: project-level component metadata, read by the CLI, the HTTP API
2
+ // and the editor alike (no canvas needed).
3
+ //
4
+ // {
5
+ // "layers": { "base": ["src/components/ui/**/*.tsx"] },
6
+ // "components": {
7
+ // "Button": {
8
+ // "$description": "Usage note agents read before picking the component.",
9
+ // "$deprecated": "Why it is deprecated",
10
+ // "replacement": "OtherButton",
11
+ // "deprecatedAt": "2026-11-20T10:00:00.000Z"
12
+ // }
13
+ // }
14
+ // }
15
+ //
16
+ // `layers.base` lists root-relative globs for base components; every other catalog
17
+ // component is composite. Without it the editor shows no layer distinction.
18
+ // `$description` / `$deprecated` mirror the DTCG token fields: the tool writes them, agents
19
+ // read them. This file is their only owner. Rename, merge and replacing usages are executed
20
+ // by the tool (src/components/ops.mjs); delete and tidy are review items for the agent.
21
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs'
22
+ import { dirname, join, relative, sep } from 'node:path'
23
+
24
+ import { glob } from 'tinyglobby'
25
+
26
+ import { withFileLock } from './reviewStore.mjs'
27
+
28
+ export const COMPONENT_META_FILE = 'design/components.json'
29
+
30
+ const toPosix = (file) => file.split(sep).join('/')
31
+ const isObject = (value) => Boolean(value) && typeof value === 'object' && !Array.isArray(value)
32
+
33
+ export function componentMetaPath(root) {
34
+ return join(root, COMPONENT_META_FILE)
35
+ }
36
+
37
+ /** Normalized metadata. A missing file reads as empty; malformed JSON throws. */
38
+ export function readComponentMeta(root) {
39
+ const file = componentMetaPath(root)
40
+ if (!existsSync(file)) return { layers: null, components: {} }
41
+ let parsed
42
+ try {
43
+ parsed = JSON.parse(readFileSync(file, 'utf8'))
44
+ } catch {
45
+ throw new Error(`failed to parse ${COMPONENT_META_FILE}`)
46
+ }
47
+ const base = Array.isArray(parsed?.layers?.base) ? parsed.layers.base.map(String).filter(Boolean) : []
48
+ return {
49
+ ...(isObject(parsed) ? parsed : {}),
50
+ layers: base.length ? { ...parsed.layers, base } : null,
51
+ components: isObject(parsed?.components) ? parsed.components : {},
52
+ }
53
+ }
54
+
55
+ /** Locked read-modify-write of one component's entry. `mutate(entry)` returns the next entry (or null to drop it). */
56
+ export function updateComponentMeta(root, name, mutate) {
57
+ const file = componentMetaPath(root)
58
+ return withFileLock(file, () => {
59
+ const raw = existsSync(file) ? JSON.parse(readFileSync(file, 'utf8')) : {}
60
+ const components = isObject(raw.components) ? { ...raw.components } : {}
61
+ const next = mutate({ ...(components[name] ?? {}) })
62
+ if (next && Object.keys(next).length) components[name] = next
63
+ else delete components[name]
64
+ const sorted = Object.fromEntries(Object.entries(components).sort(([a], [b]) => a.localeCompare(b)))
65
+ const out = { ...raw, components: sorted }
66
+ mkdirSync(dirname(file), { recursive: true })
67
+ writeFileSync(file, `${JSON.stringify(out, null, 2)}\n`)
68
+ return sorted[name] ?? null
69
+ })
70
+ }
71
+
72
+ /** Root-relative posix paths matched by `layers.base`, or null when layers are not configured. */
73
+ export async function baseLayerFiles(root, meta = readComponentMeta(root)) {
74
+ if (!meta.layers) return null
75
+ const files = await glob(meta.layers.base, { cwd: root, absolute: true, onlyFiles: true, ignore: ['**/*.d.ts'] })
76
+ return new Set(files.map((file) => toPosix(relative(root, file))))
77
+ }
78
+
79
+ /** The deprecation of one entry, normalized: `{ reason, replacement, at }` or null. */
80
+ export function deprecationOf(entry) {
81
+ if (!entry || entry.$deprecated === undefined || entry.$deprecated === false) return null
82
+ return {
83
+ reason: typeof entry.$deprecated === 'string' ? entry.$deprecated : '',
84
+ replacement: typeof entry.replacement === 'string' && entry.replacement ? entry.replacement : null,
85
+ ...(typeof entry.deprecatedAt === 'string' ? { at: entry.deprecatedAt } : {}),
86
+ }
87
+ }
@@ -0,0 +1,70 @@
1
+ import type {
2
+ ComponentAction,
3
+ ComponentList,
4
+ ComponentOpReport,
5
+ ComponentReport,
6
+ DesignComponent,
7
+ ReviewItem,
8
+ } from './types'
9
+ import type { ComponentMetaEntry } from './componentMeta.mjs'
10
+
11
+ export declare const COMPONENT_ACTIONS: ComponentAction[]
12
+ export declare const TOOL_ACTIONS: ComponentAction[]
13
+
14
+ export declare class ComponentActionError extends Error {
15
+ code: string
16
+ details?: Record<string, unknown>
17
+ }
18
+
19
+ export declare function pendingComponentItems(root: string, name?: string): ReviewItem[]
20
+ export declare function listComponents(options: {
21
+ root?: string
22
+ catalog?: DesignComponent[]
23
+ }): Promise<ComponentList>
24
+ export declare function showComponent(options: {
25
+ root?: string
26
+ name: string
27
+ catalog?: DesignComponent[]
28
+ }): Promise<ComponentReport | null>
29
+ export declare function describeComponent(options: {
30
+ root?: string
31
+ name: string
32
+ description: string
33
+ catalog?: DesignComponent[]
34
+ }): Promise<ComponentMetaEntry | null>
35
+
36
+ export type ComponentActionArgs = {
37
+ root?: string
38
+ name: string
39
+ action: ComponentAction
40
+ design?: string
41
+ to?: string | null
42
+ reason?: string
43
+ mode?: 'replace' | 'mark'
44
+ frames?: string[] | string
45
+ author?: 'human' | 'agent'
46
+ rationale?: string
47
+ catalog?: DesignComponent[]
48
+ }
49
+
50
+ export type ComponentActionResult = {
51
+ action: ComponentAction
52
+ item?: ReviewItem
53
+ reviewPath?: string
54
+ op?: ComponentOpReport
55
+ entry?: ComponentMetaEntry | null
56
+ }
57
+
58
+ /** Frame ids from an array, a comma string, or both (trimmed, deduped). */
59
+ export declare function parseFrames(frames: unknown): string[]
60
+ export declare function planComponentAction(
61
+ options: Omit<ComponentActionArgs, 'design' | 'frames' | 'author' | 'rationale'>,
62
+ ): Promise<ComponentOpReport>
63
+ export declare function recordComponentAction(options: ComponentActionArgs): Promise<ComponentActionResult>
64
+ export declare function revertComponentAction(options: {
65
+ root?: string
66
+ batch: string
67
+ design?: string
68
+ force?: boolean
69
+ dryRun?: boolean
70
+ }): Promise<Record<string, unknown>>