@rien7/seji 0.0.0 → 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.
- package/bin/design-surface.mjs +6 -0
- package/bin/postinstall.mjs +19 -0
- package/bin/seji.mjs +573 -0
- package/dist/agent/host.d.mts +34 -0
- package/dist/agent/host.mjs +387 -0
- package/dist/agent/messages.d.mts +9 -0
- package/dist/agent/messages.mjs +70 -0
- package/dist/agent/runtimes.mjs +157 -0
- package/dist/cli/app.mjs +321 -0
- package/dist/cli/appScan.mjs +284 -0
- package/dist/cli/catalog.mjs +78 -0
- package/dist/cli/component.mjs +165 -0
- package/dist/cli/consolidate.mjs +159 -0
- package/dist/cli/cssImport.mjs +68 -0
- package/dist/cli/dev.mjs +335 -0
- package/dist/cli/doctor.mjs +306 -0
- package/dist/cli/init.mjs +338 -0
- package/dist/cli/legacyNames.mjs +266 -0
- package/dist/cli/migrate.mjs +163 -0
- package/dist/cli/prompt.mjs +34 -0
- package/dist/cli/propose.mjs +208 -0
- package/dist/cli/providers.mjs +344 -0
- package/dist/cli/reviewOps.mjs +110 -0
- package/dist/cli/semver.mjs +45 -0
- package/dist/cli/setup.mjs +357 -0
- package/dist/cli/sketches.mjs +47 -0
- package/dist/cli/skills.mjs +150 -0
- package/dist/cli/snapshot.mjs +107 -0
- package/dist/cli/tokenOps.mjs +120 -0
- package/dist/cli/types.mjs +191 -0
- package/dist/cli/updater.mjs +274 -0
- package/dist/components/astIndex.mjs +992 -0
- package/dist/components/ops.mjs +1069 -0
- package/dist/editor/AgentProposalCard.d.ts +10 -0
- package/dist/editor/AgentProposalCard.d.ts.map +1 -0
- package/dist/editor/AgentProposalCard.js +31 -0
- package/dist/editor/AgentProposalCard.js.map +1 -0
- package/dist/editor/App.d.ts +2 -0
- package/dist/editor/App.d.ts.map +1 -0
- package/dist/editor/App.js +2832 -0
- package/dist/editor/App.js.map +1 -0
- package/dist/editor/CanvasHud.d.ts +12 -0
- package/dist/editor/CanvasHud.d.ts.map +1 -0
- package/dist/editor/CanvasHud.js +13 -0
- package/dist/editor/CanvasHud.js.map +1 -0
- package/dist/editor/CanvasSurface.d.ts +31 -0
- package/dist/editor/CanvasSurface.d.ts.map +1 -0
- package/dist/editor/CanvasSurface.js +270 -0
- package/dist/editor/CanvasSurface.js.map +1 -0
- package/dist/editor/CommentPopover.d.ts +17 -0
- package/dist/editor/CommentPopover.d.ts.map +1 -0
- package/dist/editor/CommentPopover.js +62 -0
- package/dist/editor/CommentPopover.js.map +1 -0
- package/dist/editor/Comments.d.ts +13 -0
- package/dist/editor/Comments.d.ts.map +1 -0
- package/dist/editor/Comments.js +41 -0
- package/dist/editor/Comments.js.map +1 -0
- package/dist/editor/ComponentPage.d.ts +28 -0
- package/dist/editor/ComponentPage.d.ts.map +1 -0
- package/dist/editor/ComponentPage.js +55 -0
- package/dist/editor/ComponentPage.js.map +1 -0
- package/dist/editor/ComponentPanel.d.ts +38 -0
- package/dist/editor/ComponentPanel.d.ts.map +1 -0
- package/dist/editor/ComponentPanel.js +275 -0
- package/dist/editor/ComponentPanel.js.map +1 -0
- package/dist/editor/Glyph.d.ts +51 -0
- package/dist/editor/Glyph.d.ts.map +1 -0
- package/dist/editor/Glyph.js +50 -0
- package/dist/editor/Glyph.js.map +1 -0
- package/dist/editor/History.d.ts +7 -0
- package/dist/editor/History.d.ts.map +1 -0
- package/dist/editor/History.js +51 -0
- package/dist/editor/History.js.map +1 -0
- package/dist/editor/Inspector.d.ts +56 -0
- package/dist/editor/Inspector.d.ts.map +1 -0
- package/dist/editor/Inspector.js +510 -0
- package/dist/editor/Inspector.js.map +1 -0
- package/dist/editor/LazyMount.d.ts +10 -0
- package/dist/editor/LazyMount.d.ts.map +1 -0
- package/dist/editor/LazyMount.js +29 -0
- package/dist/editor/LazyMount.js.map +1 -0
- package/dist/editor/LocaleSwitch.d.ts +3 -0
- package/dist/editor/LocaleSwitch.d.ts.map +1 -0
- package/dist/editor/LocaleSwitch.js +9 -0
- package/dist/editor/LocaleSwitch.js.map +1 -0
- package/dist/editor/PreviewFrame.d.ts +10 -0
- package/dist/editor/PreviewFrame.d.ts.map +1 -0
- package/dist/editor/PreviewFrame.js +22 -0
- package/dist/editor/PreviewFrame.js.map +1 -0
- package/dist/editor/ProjectIndex.d.ts +12 -0
- package/dist/editor/ProjectIndex.d.ts.map +1 -0
- package/dist/editor/ProjectIndex.js +43 -0
- package/dist/editor/ProjectIndex.js.map +1 -0
- package/dist/editor/PromoteComponent.d.ts +28 -0
- package/dist/editor/PromoteComponent.d.ts.map +1 -0
- package/dist/editor/PromoteComponent.js +33 -0
- package/dist/editor/PromoteComponent.js.map +1 -0
- package/dist/editor/PromoteForm.d.ts +18 -0
- package/dist/editor/PromoteForm.d.ts.map +1 -0
- package/dist/editor/PromoteForm.js +35 -0
- package/dist/editor/PromoteForm.js.map +1 -0
- package/dist/editor/PromoteToken.d.ts +31 -0
- package/dist/editor/PromoteToken.d.ts.map +1 -0
- package/dist/editor/PromoteToken.js +94 -0
- package/dist/editor/PromoteToken.js.map +1 -0
- package/dist/editor/StatePreviews.d.ts +28 -0
- package/dist/editor/StatePreviews.d.ts.map +1 -0
- package/dist/editor/StatePreviews.js +113 -0
- package/dist/editor/StatePreviews.js.map +1 -0
- package/dist/editor/ValueCombo.d.ts +51 -0
- package/dist/editor/ValueCombo.d.ts.map +1 -0
- package/dist/editor/ValueCombo.js +260 -0
- package/dist/editor/ValueCombo.js.map +1 -0
- package/dist/editor/agent/AgentPanel.d.ts +19 -0
- package/dist/editor/agent/AgentPanel.d.ts.map +1 -0
- package/dist/editor/agent/AgentPanel.js +271 -0
- package/dist/editor/agent/AgentPanel.js.map +1 -0
- package/dist/editor/agent/Markdown.d.ts +5 -0
- package/dist/editor/agent/Markdown.d.ts.map +1 -0
- package/dist/editor/agent/Markdown.js +28 -0
- package/dist/editor/agent/Markdown.js.map +1 -0
- package/dist/editor/agent/agentApi.d.ts +106 -0
- package/dist/editor/agent/agentApi.d.ts.map +1 -0
- package/dist/editor/agent/agentApi.js +66 -0
- package/dist/editor/agent/agentApi.js.map +1 -0
- package/dist/editor/agent/toolLines.d.ts +38 -0
- package/dist/editor/agent/toolLines.d.ts.map +1 -0
- package/dist/editor/agent/toolLines.js +159 -0
- package/dist/editor/agent/toolLines.js.map +1 -0
- package/dist/editor/agent/useAgent.d.ts +15 -0
- package/dist/editor/agent/useAgent.d.ts.map +1 -0
- package/dist/editor/agent/useAgent.js +65 -0
- package/dist/editor/agent/useAgent.js.map +1 -0
- package/dist/editor/api.d.ts +378 -0
- package/dist/editor/api.d.ts.map +1 -0
- package/dist/editor/api.js +247 -0
- package/dist/editor/api.js.map +1 -0
- package/dist/editor/camera.d.ts +18 -0
- package/dist/editor/camera.d.ts.map +1 -0
- package/dist/editor/camera.js +40 -0
- package/dist/editor/camera.js.map +1 -0
- package/dist/editor/canvas.d.ts +25 -0
- package/dist/editor/canvas.d.ts.map +1 -0
- package/dist/editor/canvas.js +35 -0
- package/dist/editor/canvas.js.map +1 -0
- package/dist/editor/changes/ChangesPage.d.ts +25 -0
- package/dist/editor/changes/ChangesPage.d.ts.map +1 -0
- package/dist/editor/changes/ChangesPage.js +132 -0
- package/dist/editor/changes/ChangesPage.js.map +1 -0
- package/dist/editor/changes/changeModel.d.ts +25 -0
- package/dist/editor/changes/changeModel.d.ts.map +1 -0
- package/dist/editor/changes/changeModel.js +81 -0
- package/dist/editor/changes/changeModel.js.map +1 -0
- package/dist/editor/changes/changeState.d.mts +29 -0
- package/dist/editor/changes/changeState.mjs +187 -0
- package/dist/editor/chrome/EditorChrome.d.ts +49 -0
- package/dist/editor/chrome/EditorChrome.d.ts.map +1 -0
- package/dist/editor/chrome/EditorChrome.js +21 -0
- package/dist/editor/chrome/EditorChrome.js.map +1 -0
- package/dist/editor/drafts.d.ts +46 -0
- package/dist/editor/drafts.d.ts.map +1 -0
- package/dist/editor/drafts.js +38 -0
- package/dist/editor/drafts.js.map +1 -0
- package/dist/editor/i18n.d.ts +29 -0
- package/dist/editor/i18n.d.ts.map +1 -0
- package/dist/editor/i18n.js +2320 -0
- package/dist/editor/i18n.js.map +1 -0
- package/dist/editor/iconStroke.d.ts +6 -0
- package/dist/editor/iconStroke.d.ts.map +1 -0
- package/dist/editor/iconStroke.js +6 -0
- package/dist/editor/iconStroke.js.map +1 -0
- package/dist/editor/main.d.ts +2 -0
- package/dist/editor/main.d.ts.map +1 -0
- package/dist/editor/main.js +14 -0
- package/dist/editor/main.js.map +1 -0
- package/dist/editor/model.d.ts +16 -0
- package/dist/editor/model.d.ts.map +1 -0
- package/dist/editor/model.js +11 -0
- package/dist/editor/model.js.map +1 -0
- package/dist/editor/reasons.d.ts +44 -0
- package/dist/editor/reasons.d.ts.map +1 -0
- package/dist/editor/reasons.js +131 -0
- package/dist/editor/reasons.js.map +1 -0
- package/dist/editor/reviewLifecycle.d.ts +8 -0
- package/dist/editor/reviewLifecycle.d.ts.map +1 -0
- package/dist/editor/reviewLifecycle.js +21 -0
- package/dist/editor/reviewLifecycle.js.map +1 -0
- package/dist/editor/styles.css +8737 -0
- package/dist/editor/tokenMatch.d.ts +59 -0
- package/dist/editor/tokenMatch.d.ts.map +1 -0
- package/dist/editor/tokenMatch.js +198 -0
- package/dist/editor/tokenMatch.js.map +1 -0
- package/dist/editor/tokens/ConsolidatePage.d.ts +16 -0
- package/dist/editor/tokens/ConsolidatePage.d.ts.map +1 -0
- package/dist/editor/tokens/ConsolidatePage.js +244 -0
- package/dist/editor/tokens/ConsolidatePage.js.map +1 -0
- package/dist/editor/tokens/TokenActivity.d.ts +18 -0
- package/dist/editor/tokens/TokenActivity.d.ts.map +1 -0
- package/dist/editor/tokens/TokenActivity.js +18 -0
- package/dist/editor/tokens/TokenActivity.js.map +1 -0
- package/dist/editor/tokens/TokenDialogs.d.ts +26 -0
- package/dist/editor/tokens/TokenDialogs.d.ts.map +1 -0
- package/dist/editor/tokens/TokenDialogs.js +119 -0
- package/dist/editor/tokens/TokenDialogs.js.map +1 -0
- package/dist/editor/tokens/TokenList.d.ts +21 -0
- package/dist/editor/tokens/TokenList.d.ts.map +1 -0
- package/dist/editor/tokens/TokenList.js +98 -0
- package/dist/editor/tokens/TokenList.js.map +1 -0
- package/dist/editor/tokens/TokenPage.d.ts +25 -0
- package/dist/editor/tokens/TokenPage.d.ts.map +1 -0
- package/dist/editor/tokens/TokenPage.js +108 -0
- package/dist/editor/tokens/TokenPage.js.map +1 -0
- package/dist/editor/tokens/tokenModel.d.ts +35 -0
- package/dist/editor/tokens/tokenModel.d.ts.map +1 -0
- package/dist/editor/tokens/tokenModel.js +72 -0
- package/dist/editor/tokens/tokenModel.js.map +1 -0
- package/dist/editor/ui/Button.d.ts +3 -0
- package/dist/editor/ui/Button.d.ts.map +1 -0
- package/dist/editor/ui/Button.js +6 -0
- package/dist/editor/ui/Button.js.map +1 -0
- package/dist/editor/ui/CommentBox.d.ts +23 -0
- package/dist/editor/ui/CommentBox.d.ts.map +1 -0
- package/dist/editor/ui/CommentBox.js +41 -0
- package/dist/editor/ui/CommentBox.js.map +1 -0
- package/dist/editor/ui/Icon.d.ts +8 -0
- package/dist/editor/ui/Icon.d.ts.map +1 -0
- package/dist/editor/ui/Icon.js +6 -0
- package/dist/editor/ui/Icon.js.map +1 -0
- package/dist/editor/ui/IconButton.d.ts +11 -0
- package/dist/editor/ui/IconButton.d.ts.map +1 -0
- package/dist/editor/ui/IconButton.js +6 -0
- package/dist/editor/ui/IconButton.js.map +1 -0
- package/dist/editor/ui/NumberInput.d.ts +14 -0
- package/dist/editor/ui/NumberInput.d.ts.map +1 -0
- package/dist/editor/ui/NumberInput.js +6 -0
- package/dist/editor/ui/NumberInput.js.map +1 -0
- package/dist/editor/ui/PageLine.d.ts +14 -0
- package/dist/editor/ui/PageLine.d.ts.map +1 -0
- package/dist/editor/ui/PageLine.js +7 -0
- package/dist/editor/ui/PageLine.js.map +1 -0
- package/dist/editor/ui/SearchPicker.d.ts +41 -0
- package/dist/editor/ui/SearchPicker.d.ts.map +1 -0
- package/dist/editor/ui/SearchPicker.js +82 -0
- package/dist/editor/ui/SearchPicker.js.map +1 -0
- package/dist/editor/ui/Select.d.ts +19 -0
- package/dist/editor/ui/Select.d.ts.map +1 -0
- package/dist/editor/ui/Select.js +12 -0
- package/dist/editor/ui/Select.js.map +1 -0
- package/dist/editor/ui/TokenField.d.ts +14 -0
- package/dist/editor/ui/TokenField.d.ts.map +1 -0
- package/dist/editor/ui/TokenField.js +41 -0
- package/dist/editor/ui/TokenField.js.map +1 -0
- package/dist/editor/ui/TokenPicker.d.ts +31 -0
- package/dist/editor/ui/TokenPicker.d.ts.map +1 -0
- package/dist/editor/ui/TokenPicker.js +26 -0
- package/dist/editor/ui/TokenPicker.js.map +1 -0
- package/dist/editor/useBuildError.d.ts +7 -0
- package/dist/editor/useBuildError.d.ts.map +1 -0
- package/dist/editor/useBuildError.js +30 -0
- package/dist/editor/useBuildError.js.map +1 -0
- package/dist/editor/useLatestRequest.d.ts +22 -0
- package/dist/editor/useLatestRequest.d.ts.map +1 -0
- package/dist/editor/useLatestRequest.js +49 -0
- package/dist/editor/useLatestRequest.js.map +1 -0
- package/dist/editor-bundle/editor.css +2 -0
- package/dist/editor-bundle/editor.js +83 -0
- package/dist/editor-ui.d.ts +15 -0
- package/dist/editor-ui.d.ts.map +1 -0
- package/dist/editor-ui.js +14 -0
- package/dist/editor-ui.js.map +1 -0
- package/dist/inspector/runtime.d.ts +18 -0
- package/dist/inspector/runtime.d.ts.map +1 -0
- package/dist/inspector/runtime.js +1280 -0
- package/dist/inspector/runtime.js.map +1 -0
- package/dist/preview/main.d.ts +3 -0
- package/dist/preview/main.d.ts.map +1 -0
- package/dist/preview/main.js +320 -0
- package/dist/preview/main.js.map +1 -0
- package/dist/preview/preview.css +40 -0
- package/dist/runtime/index.d.ts +3 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +2 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/shared/buildError.d.mts +27 -0
- package/dist/shared/buildError.mjs +141 -0
- package/dist/shared/cameraFit.d.mts +16 -0
- package/dist/shared/cameraFit.mjs +47 -0
- package/dist/shared/canvasLayout.d.mts +13 -0
- package/dist/shared/canvasLayout.mjs +171 -0
- package/dist/shared/commentShots.d.mts +12 -0
- package/dist/shared/commentShots.mjs +53 -0
- package/dist/shared/componentExtract.d.mts +43 -0
- package/dist/shared/componentExtract.mjs +136 -0
- package/dist/shared/componentMeta.d.mts +26 -0
- package/dist/shared/componentMeta.mjs +87 -0
- package/dist/shared/componentOps.d.mts +70 -0
- package/dist/shared/componentOps.mjs +407 -0
- package/dist/shared/componentTarget.d.mts +15 -0
- package/dist/shared/componentTarget.mjs +58 -0
- package/dist/shared/components.d.mts +30 -0
- package/dist/shared/components.mjs +106 -0
- package/dist/shared/consolidateCategories.d.mts +2 -0
- package/dist/shared/consolidateCategories.mjs +6 -0
- package/dist/shared/env.d.mts +4 -0
- package/dist/shared/env.mjs +18 -0
- package/dist/shared/gitChanges.d.mts +2 -0
- package/dist/shared/gitChanges.mjs +30 -0
- package/dist/shared/oklab.d.mts +6 -0
- package/dist/shared/oklab.mjs +56 -0
- package/dist/shared/optimizeEntries.d.mts +5 -0
- package/dist/shared/optimizeEntries.mjs +24 -0
- package/dist/shared/packages.d.mts +11 -0
- package/dist/shared/packages.mjs +96 -0
- package/dist/shared/projectFiles.d.mts +23 -0
- package/dist/shared/projectFiles.mjs +72 -0
- package/dist/shared/prompt.d.mts +20 -0
- package/dist/shared/prompt.mjs +201 -0
- package/dist/shared/proposals.d.mts +11 -0
- package/dist/shared/proposals.mjs +42 -0
- package/dist/shared/protocol.d.ts +122 -0
- package/dist/shared/protocol.d.ts.map +1 -0
- package/dist/shared/protocol.js +7 -0
- package/dist/shared/protocol.js.map +1 -0
- package/dist/shared/reviewArchive.d.mts +4 -0
- package/dist/shared/reviewArchive.mjs +19 -0
- package/dist/shared/reviewStore.d.mts +30 -0
- package/dist/shared/reviewStore.mjs +218 -0
- package/dist/shared/reviewVerify.d.mts +21 -0
- package/dist/shared/reviewVerify.mjs +158 -0
- package/dist/shared/sizeModes.d.mts +15 -0
- package/dist/shared/sizeModes.mjs +53 -0
- package/dist/shared/sketches.d.mts +10 -0
- package/dist/shared/sketches.mjs +64 -0
- package/dist/shared/snapshotCheck.d.mts +13 -0
- package/dist/shared/snapshotCheck.mjs +81 -0
- package/dist/shared/timeout.d.mts +1 -0
- package/dist/shared/timeout.mjs +15 -0
- package/dist/shared/tokens.d.ts +2 -0
- package/dist/shared/tokens.d.ts.map +1 -0
- package/dist/shared/tokens.js +2 -0
- package/dist/shared/tokens.js.map +1 -0
- package/dist/shared/types.d.ts +689 -0
- package/dist/shared/types.d.ts.map +1 -0
- package/dist/shared/types.js +13 -0
- package/dist/shared/types.js.map +1 -0
- package/dist/shared/wheelRouting.d.mts +9 -0
- package/dist/shared/wheelRouting.mjs +31 -0
- package/dist/shared/writeScope.mjs +96 -0
- package/dist/snapshots/diff.d.mts +28 -0
- package/dist/snapshots/diff.mjs +263 -0
- package/dist/snapshots/index.d.mts +110 -0
- package/dist/snapshots/index.mjs +638 -0
- package/dist/snapshots/render.d.mts +24 -0
- package/dist/snapshots/render.mjs +250 -0
- package/dist/snapshots/toolOps.d.mts +25 -0
- package/dist/snapshots/toolOps.mjs +69 -0
- package/dist/tokens/adapters/css.mjs +51 -0
- package/dist/tokens/adapters/cssInCode.mjs +314 -0
- package/dist/tokens/adapters/oxcShared.mjs +80 -0
- package/dist/tokens/adapters/preprocessor.mjs +63 -0
- package/dist/tokens/adapters/registry.mjs +53 -0
- package/dist/tokens/adapters/tailwindcss.mjs +424 -0
- package/dist/tokens/adapters/types.mjs +117 -0
- package/dist/tokens/consolidate/index.d.mts +42 -0
- package/dist/tokens/consolidate/index.mjs +111 -0
- package/dist/tokens/consolidate/normalize.mjs +479 -0
- package/dist/tokens/consolidate/plan.mjs +726 -0
- package/dist/tokens/consolidate/scan.mjs +928 -0
- package/dist/tokens/extract.mjs +441 -0
- package/dist/tokens/moduleData.d.mts +14 -0
- package/dist/tokens/moduleData.mjs +32 -0
- package/dist/tokens/opLock.d.mts +4 -0
- package/dist/tokens/opLock.mjs +108 -0
- package/dist/tokens/ops.d.mts +71 -0
- package/dist/tokens/ops.mjs +1511 -0
- package/dist/tokens/pipeline.mjs +813 -0
- package/dist/tokens/report.d.mts +47 -0
- package/dist/tokens/report.mjs +257 -0
- package/dist/tokens/rewrite/code.mjs +172 -0
- package/dist/tokens/rewrite/css.mjs +154 -0
- package/dist/tokens/rewrite/index.mjs +244 -0
- package/dist/tokens/rewrite/tailwind.mjs +288 -0
- package/dist/tokens/rewrite/text.mjs +116 -0
- package/dist/tokens/rewrite/value.mjs +115 -0
- package/dist/tokens/usage.d.mts +97 -0
- package/dist/tokens/usage.mjs +680 -0
- package/dist/vite/agent.d.ts +21 -0
- package/dist/vite/agent.d.ts.map +1 -0
- package/dist/vite/agent.js +165 -0
- package/dist/vite/agent.js.map +1 -0
- package/dist/vite/events.d.ts +27 -0
- package/dist/vite/events.d.ts.map +1 -0
- package/dist/vite/events.js +156 -0
- package/dist/vite/events.js.map +1 -0
- package/dist/vite/layout.d.ts +2 -0
- package/dist/vite/layout.d.ts.map +1 -0
- package/dist/vite/layout.js +4 -0
- package/dist/vite/layout.js.map +1 -0
- package/dist/vite/plugin.d.ts +40 -0
- package/dist/vite/plugin.d.ts.map +1 -0
- package/dist/vite/plugin.js +1255 -0
- package/dist/vite/plugin.js.map +1 -0
- package/dist/vite/requestGuard.d.mts +3 -0
- package/dist/vite/requestGuard.mjs +43 -0
- package/dist/vite/review.d.ts +11 -0
- package/dist/vite/review.d.ts.map +1 -0
- package/dist/vite/review.js +283 -0
- package/dist/vite/review.js.map +1 -0
- package/package.json +106 -1
- package/skills/seji/SKILL.md +395 -0
- package/skills/seji-authoring/SKILL.md +397 -0
- package/skills/seji-tokens/SKILL.md +432 -0
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
// `setup` moves a 0.4.2 project to the 0.4.4 layout (README "What lives in your project"):
|
|
2
|
+
// design/tokens.generated.ts, design/tokens.manifest.json → regenerated in design/.seji/
|
|
3
|
+
// design/.consolidate/ → design/.seji/consolidate/
|
|
4
|
+
// design/<design>/.session/ → design/.seji/session/<design>/
|
|
5
|
+
// the camera in design/<design>/canvas.json → design/.seji/canvas/<design>.json
|
|
6
|
+
// tokens.config.json tsOut / manifestOut at the old paths → the cache paths
|
|
7
|
+
// design/tokens.ts importing ./tokens.generated → ./.seji/tokens.generated (AST)
|
|
8
|
+
// <project>/.design-surface-dev.log → removed (dev writes design/.seji/dev.log)
|
|
9
|
+
// Each step reports what it did; nothing is touched when nothing is old.
|
|
10
|
+
import { cpSync, existsSync, readdirSync, readFileSync, renameSync, rmSync, writeFileSync } from 'node:fs'
|
|
11
|
+
import { join, resolve } from 'node:path'
|
|
12
|
+
|
|
13
|
+
import { migrateCanvasCamera } from '../shared/canvasLayout.mjs'
|
|
14
|
+
import { CACHE_PATHS, LEGACY_PATHS, sessionDir } from '../shared/projectFiles.mjs'
|
|
15
|
+
import { parseModule } from './appScan.mjs'
|
|
16
|
+
|
|
17
|
+
const move = (from, to) => {
|
|
18
|
+
try {
|
|
19
|
+
renameSync(from, to)
|
|
20
|
+
} catch {
|
|
21
|
+
cpSync(from, to, { recursive: true })
|
|
22
|
+
rmSync(from, { recursive: true, force: true })
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** Legacy files still present (for doctor): `[rel path]`. */
|
|
27
|
+
export function legacyLayout(root) {
|
|
28
|
+
const found = []
|
|
29
|
+
for (const rel of Object.values(LEGACY_PATHS)) if (existsSync(join(root, rel))) found.push(rel)
|
|
30
|
+
const design = join(root, 'design')
|
|
31
|
+
if (existsSync(design)) {
|
|
32
|
+
for (const entry of readdirSync(design, { withFileTypes: true })) {
|
|
33
|
+
if (!entry.isDirectory() || entry.name.startsWith('.')) continue
|
|
34
|
+
if (existsSync(join(design, entry.name, '.session'))) found.push(`design/${entry.name}/.session`)
|
|
35
|
+
const canvas = join(design, entry.name, 'canvas.json')
|
|
36
|
+
if (existsSync(canvas)) {
|
|
37
|
+
try {
|
|
38
|
+
const parsed = JSON.parse(readFileSync(canvas, 'utf8'))
|
|
39
|
+
if (parsed && typeof parsed === 'object' && 'camera' in parsed) found.push(`design/${entry.name}/canvas.json (camera)`)
|
|
40
|
+
} catch {
|
|
41
|
+
// not ours to judge
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
const config = join(root, 'design/tokens.config.json')
|
|
47
|
+
if (existsSync(config)) {
|
|
48
|
+
try {
|
|
49
|
+
const parsed = JSON.parse(readFileSync(config, 'utf8'))
|
|
50
|
+
if (parsed.tsOut === LEGACY_PATHS.tokensTs || parsed.manifestOut === LEGACY_PATHS.manifest) found.push('design/tokens.config.json (tsOut / manifestOut)')
|
|
51
|
+
} catch {
|
|
52
|
+
// reported by the tokens check
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
if (tokensTsImportEdit(root)) found.push('design/tokens.ts (imports ./tokens.generated)')
|
|
56
|
+
return found
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** The source-literal edit design/tokens.ts needs, or null. */
|
|
60
|
+
function tokensTsImportEdit(root) {
|
|
61
|
+
const file = join(root, 'design/tokens.ts')
|
|
62
|
+
if (!existsSync(file)) return null
|
|
63
|
+
const code = readFileSync(file, 'utf8')
|
|
64
|
+
let ast
|
|
65
|
+
try {
|
|
66
|
+
ast = parseModule(file, code)
|
|
67
|
+
} catch {
|
|
68
|
+
return null
|
|
69
|
+
}
|
|
70
|
+
const edits = []
|
|
71
|
+
for (const node of ast.program.body) {
|
|
72
|
+
const source = (node.type === 'ImportDeclaration' || node.type === 'ExportNamedDeclaration' || node.type === 'ExportAllDeclaration') && node.source
|
|
73
|
+
if (source && (source.value === './tokens.generated' || source.value === './tokens.generated.ts')) edits.push(source)
|
|
74
|
+
}
|
|
75
|
+
if (!edits.length) return null
|
|
76
|
+
return { file, code, edits }
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function migrateLayout(root, { dryRun = false } = {}) {
|
|
80
|
+
const results = []
|
|
81
|
+
const report = (file, status, detail) => results.push({ file, status, ...(detail ? { detail } : {}) })
|
|
82
|
+
|
|
83
|
+
for (const key of ['tokensTs', 'manifest']) {
|
|
84
|
+
const legacy = join(root, LEGACY_PATHS[key])
|
|
85
|
+
if (!existsSync(legacy)) continue
|
|
86
|
+
if (!dryRun) rmSync(legacy, { force: true })
|
|
87
|
+
report(LEGACY_PATHS[key], 'removed', `regenerated as ${CACHE_PATHS[key]}`)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const oldPlans = join(root, LEGACY_PATHS.consolidate)
|
|
91
|
+
if (existsSync(oldPlans)) {
|
|
92
|
+
const target = resolve(root, CACHE_PATHS.consolidate)
|
|
93
|
+
if (!dryRun) {
|
|
94
|
+
if (existsSync(target)) {
|
|
95
|
+
for (const name of readdirSync(oldPlans)) if (!existsSync(join(target, name))) move(join(oldPlans, name), join(target, name))
|
|
96
|
+
rmSync(oldPlans, { recursive: true, force: true })
|
|
97
|
+
} else {
|
|
98
|
+
cpSync(oldPlans, target, { recursive: true })
|
|
99
|
+
rmSync(oldPlans, { recursive: true, force: true })
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
report(LEGACY_PATHS.consolidate, 'moved', `→ ${CACHE_PATHS.consolidate}/`)
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const design = join(root, 'design')
|
|
106
|
+
if (existsSync(design)) {
|
|
107
|
+
for (const entry of readdirSync(design, { withFileTypes: true })) {
|
|
108
|
+
if (!entry.isDirectory() || entry.name.startsWith('.')) continue
|
|
109
|
+
const session = join(design, entry.name, '.session')
|
|
110
|
+
if (existsSync(session)) {
|
|
111
|
+
if (!dryRun) {
|
|
112
|
+
const target = sessionDir(root, entry.name)
|
|
113
|
+
cpSync(session, target, { recursive: true })
|
|
114
|
+
rmSync(session, { recursive: true, force: true })
|
|
115
|
+
}
|
|
116
|
+
report(`design/${entry.name}/.session`, 'moved', `→ ${CACHE_PATHS.session}/${entry.name}/`)
|
|
117
|
+
}
|
|
118
|
+
if (existsSync(join(design, entry.name, 'canvas.json')) && migrateCanvasCamera(root, entry.name, { dryRun })) {
|
|
119
|
+
report(`design/${entry.name}/canvas.json`, 'updated', `camera → ${CACHE_PATHS.canvas}/${entry.name}.json; positions stay`)
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const config = join(root, 'design/tokens.config.json')
|
|
125
|
+
if (existsSync(config)) {
|
|
126
|
+
try {
|
|
127
|
+
const parsed = JSON.parse(readFileSync(config, 'utf8'))
|
|
128
|
+
let changed = false
|
|
129
|
+
if (parsed.tsOut === LEGACY_PATHS.tokensTs) {
|
|
130
|
+
parsed.tsOut = CACHE_PATHS.tokensTs
|
|
131
|
+
changed = true
|
|
132
|
+
}
|
|
133
|
+
if (parsed.manifestOut === LEGACY_PATHS.manifest) {
|
|
134
|
+
parsed.manifestOut = CACHE_PATHS.manifest
|
|
135
|
+
changed = true
|
|
136
|
+
}
|
|
137
|
+
if (changed) {
|
|
138
|
+
if (!dryRun) writeFileSync(config, `${JSON.stringify(parsed, null, 2)}\n`)
|
|
139
|
+
report('design/tokens.config.json', 'updated', 'tsOut / manifestOut → design/.seji/')
|
|
140
|
+
}
|
|
141
|
+
} catch {
|
|
142
|
+
// an unreadable config is the tokens check's to report
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const edit = tokensTsImportEdit(root)
|
|
147
|
+
if (edit) {
|
|
148
|
+
let code = edit.code
|
|
149
|
+
for (const source of [...edit.edits].sort((a, b) => b.start - a.start)) {
|
|
150
|
+
const quote = code[source.start]
|
|
151
|
+
code = `${code.slice(0, source.start)}${quote}./.seji/tokens.generated${quote}${code.slice(source.end)}`
|
|
152
|
+
}
|
|
153
|
+
if (!dryRun) writeFileSync(edit.file, code)
|
|
154
|
+
report('design/tokens.ts', 'updated', "imports './.seji/tokens.generated'")
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
const oldLog = join(root, '.design-surface-dev.log')
|
|
158
|
+
if (existsSync(oldLog)) {
|
|
159
|
+
if (!dryRun) rmSync(oldLog, { force: true })
|
|
160
|
+
report('.design-surface-dev.log', 'removed', `dev writes ${CACHE_PATHS.devLog}`)
|
|
161
|
+
}
|
|
162
|
+
return results
|
|
163
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// `seji prompt <design>`: the same text as the editor's Hand to agent — the
|
|
2
|
+
// pending actionable items plus the catalog components that still have no page — built by
|
|
3
|
+
// the one shared builder (shared/prompt.mjs).
|
|
4
|
+
import { join } from 'node:path'
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
buildAgentPrompt,
|
|
8
|
+
isCopyableReviewItem,
|
|
9
|
+
isUnreviewedProposal,
|
|
10
|
+
missingComponentPages,
|
|
11
|
+
} from '../shared/prompt.mjs'
|
|
12
|
+
import { readReviewFile } from '../shared/reviewStore.mjs'
|
|
13
|
+
import { readComponentPages } from '../tokens/usage.mjs'
|
|
14
|
+
import { loadComponentCatalog } from './catalog.mjs'
|
|
15
|
+
|
|
16
|
+
/** The agent prompt for a design; throws when there is nothing to hand over. */
|
|
17
|
+
export async function agentPromptFor({ root = process.cwd(), design, catalog } = {}) {
|
|
18
|
+
if (!design) throw new Error('prompt requires a design id')
|
|
19
|
+
const review = readReviewFile(join(root, 'design', design, 'review.json'))
|
|
20
|
+
if (!review) throw new Error(`no review ledger for ${design}`)
|
|
21
|
+
const allPending = (review.items ?? []).filter((item) => item.status !== 'archived')
|
|
22
|
+
const items = allPending.filter(isCopyableReviewItem)
|
|
23
|
+
if (!items.length) {
|
|
24
|
+
const unreviewed = allPending.filter(isUnreviewedProposal).length
|
|
25
|
+
if (unreviewed) {
|
|
26
|
+
throw new Error(`no actionable review items for ${design} (${unreviewed} agent proposal(s) awaiting human approval)`)
|
|
27
|
+
}
|
|
28
|
+
throw new Error(`no pending review items for ${design}`)
|
|
29
|
+
}
|
|
30
|
+
const pages = readComponentPages(root)
|
|
31
|
+
const components = catalog === undefined ? await loadComponentCatalog(root) : catalog
|
|
32
|
+
const missingComponents = missingComponentPages(components, (name) => pages.has(name))
|
|
33
|
+
return buildAgentPrompt({ design, items, missingComponents })
|
|
34
|
+
}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from 'node:fs'
|
|
2
|
+
import { join, resolve } from 'node:path'
|
|
3
|
+
|
|
4
|
+
import { mutateReview } from '../shared/reviewStore.mjs'
|
|
5
|
+
import { analyzeTokens, colorToRgb, loadTokenConfig } from '../tokens/pipeline.mjs'
|
|
6
|
+
|
|
7
|
+
const SAFE_ID = /^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/
|
|
8
|
+
const VALID_ACTIONS = new Set(['create', 'update', 'alias', 'merge'])
|
|
9
|
+
const VALID_TIERS = new Set(['primitive', 'semantic', 'component'])
|
|
10
|
+
const VALID_TYPES = new Set(['color', 'length', 'text'])
|
|
11
|
+
const VALUE_FLAGS = new Set([
|
|
12
|
+
'name',
|
|
13
|
+
'value',
|
|
14
|
+
'tier',
|
|
15
|
+
'alias',
|
|
16
|
+
'type',
|
|
17
|
+
'action',
|
|
18
|
+
'rationale',
|
|
19
|
+
'description',
|
|
20
|
+
'replaces',
|
|
21
|
+
])
|
|
22
|
+
|
|
23
|
+
function parseArgs(argv) {
|
|
24
|
+
const flags = {}
|
|
25
|
+
const positionals = []
|
|
26
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
27
|
+
const token = argv[i]
|
|
28
|
+
if (token.startsWith('--')) {
|
|
29
|
+
const eq = token.indexOf('=')
|
|
30
|
+
if (eq > 2) {
|
|
31
|
+
const key = token.slice(2, eq)
|
|
32
|
+
if (!VALUE_FLAGS.has(key)) throw new Error(`unknown option: --${key}`)
|
|
33
|
+
flags[key] = token.slice(eq + 1)
|
|
34
|
+
continue
|
|
35
|
+
}
|
|
36
|
+
const key = token.slice(2)
|
|
37
|
+
if (!VALUE_FLAGS.has(key)) throw new Error(`unknown option: --${key}`)
|
|
38
|
+
const next = argv[i + 1]
|
|
39
|
+
if (next === undefined) throw new Error(`--${key} requires a value`)
|
|
40
|
+
flags[key] = next
|
|
41
|
+
i += 1
|
|
42
|
+
continue
|
|
43
|
+
}
|
|
44
|
+
positionals.push(token)
|
|
45
|
+
}
|
|
46
|
+
return { flags, positionals }
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function inferTokenType(value, targetType) {
|
|
50
|
+
if (targetType === 'color') return 'color'
|
|
51
|
+
if (targetType === 'dimension') return 'length'
|
|
52
|
+
if (typeof value === 'string') {
|
|
53
|
+
const trimmed = value.trim()
|
|
54
|
+
if (/^-?\d+(?:\.\d+)?(px|rem|em|%)$/.test(trimmed)) return 'length'
|
|
55
|
+
if (
|
|
56
|
+
colorToRgb(trimmed) ||
|
|
57
|
+
/^(?:color-mix|rgba?|hsla?|oklch|oklab|color)\(/i.test(trimmed)
|
|
58
|
+
) {
|
|
59
|
+
return 'color'
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return 'text'
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function readJson(file) {
|
|
66
|
+
if (!existsSync(file)) return null
|
|
67
|
+
try {
|
|
68
|
+
return JSON.parse(readFileSync(file, 'utf8'))
|
|
69
|
+
} catch {
|
|
70
|
+
return null
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export async function proposeToken({ root = process.cwd(), argv = [] } = {}) {
|
|
75
|
+
const { flags, positionals } = parseArgs(argv)
|
|
76
|
+
const design = positionals[0]
|
|
77
|
+
if (!design) throw new Error('propose token requires a <design> id')
|
|
78
|
+
if (!SAFE_ID.test(design)) throw new Error(`Invalid design id: ${design}`)
|
|
79
|
+
|
|
80
|
+
const name = flags.name
|
|
81
|
+
if (!name || !/^--[a-zA-Z0-9_-]+$/.test(name)) {
|
|
82
|
+
throw new Error('--name is required and must be a CSS custom property starting with "--"')
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const action = flags.action ?? 'create'
|
|
86
|
+
if (!VALID_ACTIONS.has(action)) {
|
|
87
|
+
throw new Error(`Invalid --action "${action}". Expected one of: create, update, alias, merge`)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const alias = flags.alias
|
|
91
|
+
if (alias !== undefined) {
|
|
92
|
+
if (!alias || alias.startsWith('--')) {
|
|
93
|
+
throw new Error('--alias must be a DTCG dot-path (e.g. color.surface), not a CSS variable name')
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
if ((action === 'alias' || action === 'merge') && !alias) {
|
|
97
|
+
throw new Error(`--alias is required when --action is ${action}`)
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const value = flags.value ?? (action === 'alias' || action === 'merge' ? alias : undefined)
|
|
101
|
+
if ((action === 'create' || action === 'update') && !value) {
|
|
102
|
+
throw new Error(`--value is required when --action is ${action}`)
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
let manifestPath = join(root, 'design/.seji/tokens.manifest.json')
|
|
106
|
+
let tokenDir = 'design/tokens'
|
|
107
|
+
try {
|
|
108
|
+
const config = loadTokenConfig(root)
|
|
109
|
+
manifestPath = resolve(root, config.manifestOut)
|
|
110
|
+
tokenDir = config.tokenDir
|
|
111
|
+
} catch {
|
|
112
|
+
// fallback to default manifest path
|
|
113
|
+
}
|
|
114
|
+
const manifest = readJson(manifestPath)
|
|
115
|
+
const manifestTokens = Array.isArray(manifest?.tokens) ? manifest.tokens : []
|
|
116
|
+
const existingToken = manifestTokens.find((entry) => entry.cssName === name)
|
|
117
|
+
const aliasTarget = alias ? manifestTokens.find((entry) => entry.path === alias) : undefined
|
|
118
|
+
|
|
119
|
+
const tokenType = flags.type ?? inferTokenType(value, aliasTarget?.type)
|
|
120
|
+
if (!VALID_TYPES.has(tokenType)) {
|
|
121
|
+
throw new Error(`Invalid --type "${tokenType}". Expected one of: color, length, text`)
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// The tier is never defaulted: new tokens must name it, other actions inherit it from the
|
|
125
|
+
// existing token.
|
|
126
|
+
const tier = flags.tier ?? (action === 'create' ? undefined : existingToken?.tier)
|
|
127
|
+
if (!tier) {
|
|
128
|
+
throw new Error(
|
|
129
|
+
action === 'create'
|
|
130
|
+
? '--tier is required when --action is create (primitive, semantic, or component)'
|
|
131
|
+
: `--tier is required: ${name} is not in the token manifest`,
|
|
132
|
+
)
|
|
133
|
+
}
|
|
134
|
+
if (!VALID_TIERS.has(tier)) {
|
|
135
|
+
throw new Error(`Invalid --tier "${tier}". Expected one of: primitive, semantic, component`)
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
const description = flags.description?.trim()
|
|
139
|
+
if (action === 'create' && !description) {
|
|
140
|
+
throw new Error('--description is required when --action is create (usage note agents read before using the token)')
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// --replaces <literal>: the hard-coded value this token replaces; files come from a fresh scan.
|
|
144
|
+
let replaces
|
|
145
|
+
if (flags.replaces !== undefined) {
|
|
146
|
+
const literal = flags.replaces.trim()
|
|
147
|
+
if (!literal) throw new Error('--replaces requires a hard-coded value')
|
|
148
|
+
const { usage } = await analyzeTokens({ root })
|
|
149
|
+
const cluster = usage.clusters.find((entry) => entry.value.toLowerCase() === literal.toLowerCase())
|
|
150
|
+
if (!cluster) throw new Error(`no hard-coded ${literal} found in the scanned sources`)
|
|
151
|
+
replaces = { value: cluster.value, files: cluster.files }
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
const source =
|
|
155
|
+
(action !== 'create' && existingToken?.source) ||
|
|
156
|
+
manifestTokens.find((entry) => entry.tier === tier)?.source ||
|
|
157
|
+
`${tokenDir}/${tier}.tokens.json`
|
|
158
|
+
const sourceHash = typeof manifest?.sourceHash === 'string' ? manifest.sourceHash : ''
|
|
159
|
+
const now = new Date().toISOString()
|
|
160
|
+
const id = `token-propose-${name}`
|
|
161
|
+
let item
|
|
162
|
+
|
|
163
|
+
const { file: reviewPath } = mutateReview(
|
|
164
|
+
root,
|
|
165
|
+
design,
|
|
166
|
+
(review) => {
|
|
167
|
+
const items = [...review.items]
|
|
168
|
+
const existingIndex = items.findIndex(
|
|
169
|
+
(entry) =>
|
|
170
|
+
entry.id === id ||
|
|
171
|
+
(entry.kind === 'token' &&
|
|
172
|
+
entry.author === 'agent' &&
|
|
173
|
+
entry.target?.type === 'token' &&
|
|
174
|
+
entry.target.token === name &&
|
|
175
|
+
entry.status !== 'archived'),
|
|
176
|
+
)
|
|
177
|
+
const prev = existingIndex >= 0 ? items[existingIndex] : null
|
|
178
|
+
item = {
|
|
179
|
+
id: prev?.id ?? id,
|
|
180
|
+
design,
|
|
181
|
+
kind: 'token',
|
|
182
|
+
scope: 'design',
|
|
183
|
+
author: 'agent',
|
|
184
|
+
target: { type: 'token', token: name },
|
|
185
|
+
from: action === 'create' ? '' : existingToken?.value ?? prev?.from ?? '',
|
|
186
|
+
to: value,
|
|
187
|
+
source,
|
|
188
|
+
...(sourceHash ? { sourceHash } : {}),
|
|
189
|
+
tokenType,
|
|
190
|
+
tokenAction: action,
|
|
191
|
+
...(alias ? { tokenAlias: alias } : {}),
|
|
192
|
+
tokenTier: tier,
|
|
193
|
+
...(description ? { tokenDescription: description } : {}),
|
|
194
|
+
...(replaces ? { replaces } : {}),
|
|
195
|
+
...(flags.rationale ? { rationale: flags.rationale } : {}),
|
|
196
|
+
status: 'open',
|
|
197
|
+
createdAt: prev?.createdAt ?? now,
|
|
198
|
+
updatedAt: now,
|
|
199
|
+
}
|
|
200
|
+
if (existingIndex >= 0) items[existingIndex] = item
|
|
201
|
+
else items.push(item)
|
|
202
|
+
return { ...review, items }
|
|
203
|
+
},
|
|
204
|
+
{ create: true },
|
|
205
|
+
)
|
|
206
|
+
|
|
207
|
+
return { item, reviewPath }
|
|
208
|
+
}
|