@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,432 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: seji-tokens
|
|
3
|
+
description: Use for any design-token, color, spacing, typography or theme work in a project that has Seji (design/tokens/*.tokens.json), including adding or changing CSS variables or hard-coded styles in components. Use when editing Seji tokens, proposing new tokens, migrating existing CSS variables, running token operations (rename, merge, deprecate, delete, describe, set, create, replace-literal, revert), consolidating hard-coded styles, or fixing token health. Covers DTCG source layout, tiers, aliases, build/check/extract, usage and health. For applying review items, status and verification use seji; for pages and component pages use seji-authoring.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Seji tokens
|
|
7
|
+
|
|
8
|
+
This skill owns the token source and every token command. Applying review items, `status` /
|
|
9
|
+
`reply`, the three checks (`verify`), snapshots and archive rules are in **seji**;
|
|
10
|
+
pages, frames and component pages in **seji-authoring**.
|
|
11
|
+
|
|
12
|
+
Token source is DTCG JSON under `design/tokens/`. Generated files are outputs. The browser
|
|
13
|
+
previews tokens as CSS variables; the agent proposes or edits DTCG source; the surface verifies
|
|
14
|
+
generated output.
|
|
15
|
+
|
|
16
|
+
## Source layout
|
|
17
|
+
|
|
18
|
+
```text
|
|
19
|
+
design/tokens/primitive.tokens.json
|
|
20
|
+
design/tokens/semantic.tokens.json
|
|
21
|
+
design/tokens/component.tokens.json
|
|
22
|
+
design/tokens.config.json
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Tiers:
|
|
26
|
+
|
|
27
|
+
| Tier | Use |
|
|
28
|
+
| --- | --- |
|
|
29
|
+
| `primitive` | Palette, raw scale, spacing, radius, font size, layout primitives. |
|
|
30
|
+
| `semantic` | Roles such as `surface.bg`, `surface.text`, `surface.accent`. |
|
|
31
|
+
| `component` | Component decisions that cannot be expressed semantically. |
|
|
32
|
+
|
|
33
|
+
Generated outputs (paths configurable in `design/tokens.config.json`; `tokens build` always
|
|
34
|
+
writes them):
|
|
35
|
+
|
|
36
|
+
```text
|
|
37
|
+
design/.seji/tokens.generated.ts tokenGroups, tokenValues, tokenSources, tokenAliases, tokenSourceHash, tokenHealth
|
|
38
|
+
design/.seji/tokens.manifest.json resolved values, source hash, usage, contrast, hardcoded report, clusters, unsupported
|
|
39
|
+
src/tokens.generated.css @theme or :root CSS variables (based on cssFormat), next to the CSS entry
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
The two `design/.seji/` files are the tool cache (gitignored); `tokens.generated.css` is
|
|
43
|
+
the app's and is committed. A `var(--x)` in the app's CSS that no token defines is one warning
|
|
44
|
+
listing every such name; fix it with `seji tokens extract <css files>` (light and dark
|
|
45
|
+
values become `$extensions` modes) or leave it.
|
|
46
|
+
|
|
47
|
+
Never edit generated files. Edit DTCG source, then run:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
seji tokens build
|
|
51
|
+
seji tokens check
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
To migrate existing CSS custom properties from `:root` or `@theme` into DTCG source:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
seji tokens extract [files...] [--dry-run]
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## DTCG shape
|
|
61
|
+
|
|
62
|
+
```json
|
|
63
|
+
{
|
|
64
|
+
"color": {
|
|
65
|
+
"$extensions": {
|
|
66
|
+
"design-surface": {
|
|
67
|
+
"tier": "primitive",
|
|
68
|
+
"group": "color",
|
|
69
|
+
"label": "Color",
|
|
70
|
+
"labelZh": "颜色"
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"$type": "color",
|
|
74
|
+
"primary": {
|
|
75
|
+
"$value": "#2563eb",
|
|
76
|
+
"$extensions": {
|
|
77
|
+
"design-surface": {
|
|
78
|
+
"label": "Primary",
|
|
79
|
+
"labelZh": "主色",
|
|
80
|
+
"uiType": "color"
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Common fields:
|
|
89
|
+
|
|
90
|
+
| Field | Meaning |
|
|
91
|
+
| --- | --- |
|
|
92
|
+
| `$type` | `color`, `dimension`, `string`; controls validation. |
|
|
93
|
+
| `$value` | Literal or `{path.to.token}` alias. |
|
|
94
|
+
| `$description` | Usage note agents read before using the token. Required for new tokens. |
|
|
95
|
+
| `$extensions.design-surface.tier` | `primitive`, `semantic`, `component`. Required: set it on the token or a parent group, or name the file `<tier>.tokens.json`; `tokens build` fails otherwise. |
|
|
96
|
+
| `$extensions.design-surface.cssName` | Optional CSS name override. Then `--name` ≠ the dotted path; look names up, do not derive them. |
|
|
97
|
+
| `$extensions.design-surface.group` | Group id (generated metadata). |
|
|
98
|
+
| `$extensions.design-surface.label` / `labelZh` | Display labels. |
|
|
99
|
+
| `$extensions.design-surface.uiType` | Form control: `color`, `length`, `text`, `select`. |
|
|
100
|
+
| `min` / `max` / `step` | Numeric bounds for length controls. |
|
|
101
|
+
|
|
102
|
+
Aliases:
|
|
103
|
+
|
|
104
|
+
```json
|
|
105
|
+
{
|
|
106
|
+
"surface": {
|
|
107
|
+
"accent": {
|
|
108
|
+
"$type": "color",
|
|
109
|
+
"$value": "{color.primary}"
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Alias paths use dots. No cycles. A token may alias another tier; the token page shows the alias
|
|
116
|
+
chain (来历) and edits the value only on the token that holds the literal.
|
|
117
|
+
|
|
118
|
+
## CSS variable mapping
|
|
119
|
+
|
|
120
|
+
```text
|
|
121
|
+
surface.accent -> --surface-accent
|
|
122
|
+
color.primary -> --color-primary
|
|
123
|
+
space.card -> --space-card
|
|
124
|
+
font-size.md -> --font-size-md
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
`target.token` in a review item is the CSS variable name; `tokenAlias` is the DTCG path.
|
|
128
|
+
|
|
129
|
+
## Token review items
|
|
130
|
+
|
|
131
|
+
A token item is design-scoped:
|
|
132
|
+
|
|
133
|
+
```json
|
|
134
|
+
{
|
|
135
|
+
"kind": "token",
|
|
136
|
+
"scope": "design",
|
|
137
|
+
"target": { "type": "token", "token": "--surface-accent" },
|
|
138
|
+
"source": "design/tokens/semantic.tokens.json",
|
|
139
|
+
"sourceHash": "<generated tokenSourceHash>",
|
|
140
|
+
"tokenType": "color",
|
|
141
|
+
"tokenAction": "update",
|
|
142
|
+
"from": "#2563eb",
|
|
143
|
+
"to": "#0f766e",
|
|
144
|
+
"status": "open"
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
| `tokenAction` | Source change | `to` | Who does it |
|
|
149
|
+
| --- | --- | --- | --- |
|
|
150
|
+
| `create` | Add the token to the requested tier. | Resolved value. | Agent. |
|
|
151
|
+
| `update` | Change `$value` (literal or alias). | Resolved value. | Agent, or `tokens set`. |
|
|
152
|
+
| `alias` | Set `$value` to `{target.path}`. | Target DTCG path. | Agent, or `tokens set <token> --value {path}`. |
|
|
153
|
+
| `rename` | New path takes the definition; the old path stays as an alias marked `$deprecated`; static references are rewritten. | New DTCG path. | **Tool** (`tokens rename`). |
|
|
154
|
+
| `merge` | The source becomes an alias of the target (marked `$deprecated`); static references move to the target. | Target DTCG path. | **Tool** (`tokens merge`). |
|
|
155
|
+
| `deprecate` | Keep the token, set DTCG `$deprecated` (reason) and alias it to the replacement; optionally rewrite references. **Never removes the token.** | Replacement path, or empty. | **Tool** (`tokens deprecate`). |
|
|
156
|
+
| `delete` | Remove the token. Only allowed at usage 0. | Empty. | **Tool** (`tokens delete`). |
|
|
157
|
+
| `describe` | Set `$description`. | Description. | Tool (`tokens describe`). |
|
|
158
|
+
| `replace-literal` | Replace an exact hard-coded value with `var(--token)`. | Token path. | Tool (`tokens replace-literal`). |
|
|
159
|
+
| `consolidate` | A consolidation plan applied as one operation (new tokens, merges, literal replacements). | Summary. | **Tool** (`consolidate apply`). |
|
|
160
|
+
|
|
161
|
+
For `alias` / `merge`, set `tokenAlias` to the target DTCG path. For `create`, `tokenTier` is
|
|
162
|
+
always explicit (the editor and CLI never default it) and `tokenDescription` is the `$description`
|
|
163
|
+
to write. A `create` with `replaces: { value, files }` is a promoted literal: create the token and
|
|
164
|
+
rewrite `value` to `var(--token)` in each listed file.
|
|
165
|
+
|
|
166
|
+
Tier rules: components use semantic or component tokens, not primitives (the inspector, the
|
|
167
|
+
component page and `component show` flag a primitive used directly, with the semantic aliases to
|
|
168
|
+
use instead; the token page and token list flag the same primitive — "used directly by N
|
|
169
|
+
components" — and count it under Problems, from the same rule: `usage <token>` reports
|
|
170
|
+
`warning: "primitive"` and `summary.directComponents`); a component token aliases a semantic token, not a primitive (`health` reports it).
|
|
171
|
+
Name new tokens with the project's existing prefixes (primitive `color.*`, semantic `chrome.*`, … —
|
|
172
|
+
check `seji usage` output or the manifest).
|
|
173
|
+
|
|
174
|
+
### Tool-executed token operations
|
|
175
|
+
|
|
176
|
+
Rename, merge, deprecate, delete, describe, set and literal replacement are done by the tool, not
|
|
177
|
+
by hand. Each prints JSON; `--dry-run` lists every place it would change and every leftover
|
|
178
|
+
without writing anything (a refused dry run carries `refused` + `why` and exits 2); a refused real
|
|
179
|
+
run prints `{ error, why, blockers, … }` and exits 1 (HTTP 409):
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
seji tokens rename color.surface-soft --to color.surface-muted [--no-alias] [--reason "…"] [--dry-run]
|
|
183
|
+
seji tokens merge color.panel-soft --into color.surface [--keep target|source] [--dry-run]
|
|
184
|
+
seji tokens deprecate color.old --replacement color.new [--mode mark-only|replace-all]
|
|
185
|
+
seji tokens deprecate color.old --no-replacement --reason "no longer part of the palette"
|
|
186
|
+
seji tokens delete color.unused # refused (with the blockers) unless usage is 0
|
|
187
|
+
seji tokens describe chrome.accent --description "Primary action color; not for text"
|
|
188
|
+
seji tokens set chrome.accent --value "{color.teal-600}" # or a literal value
|
|
189
|
+
seji tokens create chrome.accent-soft --value "{color.primary-soft}" --tier semantic --description "Selected rows; not for text"
|
|
190
|
+
seji tokens replace-literal "#2563eb" --token chrome.accent [--scope src/ui] [--property color]
|
|
191
|
+
seji tokens revert <batchId> [--force]
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Tokens are given as DTCG paths or CSS names; pass `--design <id>` when the project has more than one
|
|
195
|
+
design (the ledger that records the batch). The dev server exposes the same operations at
|
|
196
|
+
`POST /__seji/api/tokens/<op>` with a JSON body of camelCase arguments: `token`, `to`, `into`,
|
|
197
|
+
`keep`, `replacement`, `reason`, `mode`, `description`, `value`, `literal` (replace-literal),
|
|
198
|
+
`batch` (revert), `scope`, `property`, `design`, and the JSON booleans `dryRun`, `force`,
|
|
199
|
+
`noReplacement`, `alias` (`"alias": false` is `--no-alias`) and `snapshots`. Unknown keys and non-boolean flags
|
|
200
|
+
are rejected (400). Send `content-type: application/json`; cross-origin requests are refused.
|
|
201
|
+
|
|
202
|
+
What the tool does:
|
|
203
|
+
|
|
204
|
+
- edits the DTCG source (rename keeps the old name as a `$deprecated` alias unless `--no-alias`,
|
|
205
|
+
which is refused while leftovers remain; merge lets `--keep source` move the source value onto
|
|
206
|
+
the target; deprecate writes `$deprecated` with the reason and appends it to `$description`),
|
|
207
|
+
- rewrites static references with AST parsers (never by regex): `var(--x)` in CSS / CSS Modules /
|
|
208
|
+
SCSS / Less, string values in `style={{…}}` and StyleX, Tailwind classes in `className` /
|
|
209
|
+
`class` and `clsx` / `cn` / `cva` / `twMerge` literals (`bg-x`, `bg-(--x)`, `bg-[var(--x)]`),
|
|
210
|
+
- re-reads every file before the first write (re-parses a code file that changed, starts over if
|
|
211
|
+
a token source changed), refuses a result that would not build (alias cycles, missing aliases,
|
|
212
|
+
name collisions, renaming onto an existing group), then writes all files or none: any failure,
|
|
213
|
+
including recording the review item, restores every file and rebuilds,
|
|
214
|
+
- runs one operation at a time per project (a lock shared by the CLI and the dev server),
|
|
215
|
+
- rebuilds the generated tokens, then records **one** review item (`tokenOp.by: "tool"`,
|
|
216
|
+
"tool changed N, left M") and one revertible batch,
|
|
217
|
+
- with `--snapshots` (HTTP `"snapshots": true`), renders the affected screens as the item's
|
|
218
|
+
"before" baseline before writing and compares "after" when done, so the human sees the diffs.
|
|
219
|
+
|
|
220
|
+
The human runs the same operations from the editor's **Token** tab: each token page has Rename,
|
|
221
|
+
Merge into, Deprecate and Delete (disabled with the reason while anything uses it: the usage
|
|
222
|
+
report's `deletable` / `blockedBy`, the same rule `tokens delete` refuses with), plus inline value
|
|
223
|
+
and usage-note edits. Every dialog shows the live `--dry-run` first. "Compare the affected
|
|
224
|
+
screens" is a checkbox (on by default) that sends `snapshots: true`; it is not offered for
|
|
225
|
+
mark-only deprecation or Delete, and usage-note edits never compare (they change no pixels);
|
|
226
|
+
inline value edits always compare. Merge into lists the closest tokens first (OKLab ΔE for
|
|
227
|
+
colors, px for lengths, other hues last) with the difference shown. The token list's right
|
|
228
|
+
column is usage ("N components" / "unused"); the value is in the tooltip and on the page.
|
|
229
|
+
An operation run with snapshots opens its item in
|
|
230
|
+
**Changes**; without, the page follows a renamed or merged token. You use the CLI.
|
|
231
|
+
|
|
232
|
+
What is left to you (the item's `tokenOp.leftovers`, each with `file:line` and a reason): dynamic
|
|
233
|
+
references (template literals with expressions, computed class names), unsupported schemes
|
|
234
|
+
(styled-components / emotion tagged templates, vanilla-extract, UnoCSS), local redefinitions of
|
|
235
|
+
the token, bare token-name strings, shorthands containing a literal, files outside the project
|
|
236
|
+
root (`outside-project-root`: `scanDirs` such as `../shared/src`, symlinked dirs; the tools write
|
|
237
|
+
there only when the directory is listed in `writableDirs` in `design/tokens.config.json`, default
|
|
238
|
+
none), and naming judgment. Fix
|
|
239
|
+
those, run `tokens build` + `tokens check`, then mark the item resolved. Do not redo what the tool
|
|
240
|
+
already changed; the item resolves itself when nothing was left. Use `$description` (via
|
|
241
|
+
`tokens describe`) to say what a token is for and what not to use it for.
|
|
242
|
+
|
|
243
|
+
### Consolidating existing styles (整合已有样式)
|
|
244
|
+
|
|
245
|
+
To turn a codebase's hard-coded values into tokens, use `consolidate` instead of many
|
|
246
|
+
`replace-literal` calls:
|
|
247
|
+
|
|
248
|
+
```bash
|
|
249
|
+
seji consolidate scan --scope src/ui [--scope 'src/**/*.css'] [--category color --category spacing]
|
|
250
|
+
seji consolidate plan --scope src/ui # saves design/.seji/consolidate/<plan>.json
|
|
251
|
+
seji consolidate show <plan> # rows + what still blocks apply
|
|
252
|
+
seji consolidate set <plan> r3 --action create --name color.panel-hover --tier primitive --description "Hovered panel rows"
|
|
253
|
+
seji consolidate set <plan> r5 --action reuse --token chrome.accent --accept-visible-change
|
|
254
|
+
seji consolidate set <plan> r7 --action merge # fold the suggested duplicates into the row's token
|
|
255
|
+
seji consolidate set <plan> r9 --action skip
|
|
256
|
+
seji consolidate apply <plan> --dry-run && seji consolidate apply <plan>
|
|
257
|
+
seji consolidate revert <plan>
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
- The scan normalizes values (`#FFF` = `white` = `rgb(255 255 255)`; `0.75rem` = `12px` with
|
|
261
|
+
`--root-px 16`) and clusters near-identical ones (colors by OKLab ΔE ≤ 2 within one hue
|
|
262
|
+
family — OKLCH: a tint never joins a neutral gray, nor a tint of another hue more than 30°
|
|
263
|
+
away — lengths ±1px; `--tolerance` to change). Categories: `color`, `spacing`, `radius`, `font-size`, `font-weight`,
|
|
264
|
+
`line-height`, `border-width`, `shadow`, and opt-in `size`.
|
|
265
|
+
- Each row suggests `reuse` (prefers semantic tokens; a primitive gets a `primitive-token`
|
|
266
|
+
warning), `create` or `merge` (opt-in, never pre-selected: duplicates may be separate roles), or
|
|
267
|
+
`keep` (tokens only).
|
|
268
|
+
- **You name new tokens.** `create` rows come with `name: ""` and `suggestion.naming` (the prefixes
|
|
269
|
+
in use per tier). Choose a name with an existing prefix, an explicit `--tier` and a
|
|
270
|
+
`--description`; apply refuses otherwise. Prefer a semantic token aliasing a primitive for
|
|
271
|
+
component code (`--value "{color.x}"`).
|
|
272
|
+
- Rows with `visibleChange` change rendering and are never pre-selected: they come back as
|
|
273
|
+
`action: "undecided"` with the tool's suggestion under `proposed`. Pick an `--action` (reuse
|
|
274
|
+
fills in the proposed token), then confirm with `--accept-visible-change`, or pick another
|
|
275
|
+
token; `--accept-visible-change` alone is refused (`needs-decision`), and `apply` (dry run
|
|
276
|
+
too) refuses while any row is undecided. A visible change is a different value (`#2564eb → #2563eb, deltaE 0.3`), a
|
|
277
|
+
different written unit (`0.5rem → 8px`: equal only at a 16px root font size), a color outside
|
|
278
|
+
sRGB compared after clipping (`gamut`), or a merged token with another value. The acceptance
|
|
279
|
+
covers exactly the changes shown: `apply` recomputes them from the current files and token
|
|
280
|
+
values and refuses anything not accepted (a `tokens set` on the target, a new occurrence).
|
|
281
|
+
- New tokens keep the most common written form (a rem codebase gets rem tokens, `oklch()` stays
|
|
282
|
+
`oklch()`); in-gamut colors use the canonical hex.
|
|
283
|
+
- Tailwind width classes are written so they stay widths: `border-(length:--w)`,
|
|
284
|
+
`outline-(length:--w)`, `divide-x-(length:--w)`, `ring-(--w)`.
|
|
285
|
+
- Rows whose every occurrence is a leftover default to `skip`. `--token X` alone means
|
|
286
|
+
`--action reuse --token X`; `--name` alone means `--action create`.
|
|
287
|
+
- `apply` re-scans the files (never replays offsets), then runs like the other tool ops: one lock,
|
|
288
|
+
all files or none, rebuild, one `[tool op]` item (`tokenAction: "consolidate"`) + one batch.
|
|
289
|
+
Your job afterwards is the leftovers (`shorthand`, `mixed-value`, `computed-value`,
|
|
290
|
+
`typed-arbitrary-value`, `needs-judgment`, `escaped-string`, `outside-project-root`).
|
|
291
|
+
- HTTP: `GET /__seji/api/consolidate/scan?…`, `GET /__seji/api/consolidate/plan[?id=]`,
|
|
292
|
+
`POST /__seji/api/consolidate/<scan|plan|set|apply|revert|discard>` with camelCase JSON (`scope`,
|
|
293
|
+
`category`, `plan`, `row`, `action`, `token`, `name`, `tier`, `description`, `merge`,
|
|
294
|
+
`acceptVisibleChange`, `dryRun`, `snapshots` for apply).
|
|
295
|
+
- `consolidate apply <plan> --snapshots` captures the affected screens before writing and
|
|
296
|
+
compares them after; `consolidate discard <plan>` deletes a draft or reverted plan file (an
|
|
297
|
+
applied plan is refused: `consolidate revert <plan>` first). `set` on a reverted plan makes it a
|
|
298
|
+
draft again.
|
|
299
|
+
- In the editor this is **Token → Consolidate existing styles**: scope and category pickers, the
|
|
300
|
+
plan table (values | count | components | suggestion | note | decision), a confirm bar with the
|
|
301
|
+
dry-run summary, and Discard / Keep as draft / Confirm and run (`apply --snapshots`).
|
|
302
|
+
|
|
303
|
+
### Agent → Human token proposals
|
|
304
|
+
|
|
305
|
+
When authoring new components or pages, reuse existing semantic tokens first. Only when a semantic
|
|
306
|
+
role is genuinely missing, propose it via the CLI instead of silently inventing tokens in DTCG
|
|
307
|
+
source:
|
|
308
|
+
|
|
309
|
+
```bash
|
|
310
|
+
seji propose token <design> \
|
|
311
|
+
--name --surface-elevated \
|
|
312
|
+
--value "#ffffff" \
|
|
313
|
+
--tier semantic \
|
|
314
|
+
--description "Raised secondary cards; not for page background" \
|
|
315
|
+
--alias color.surface \
|
|
316
|
+
--type color \
|
|
317
|
+
--rationale "Shared by secondary cards"
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
`--tier` and `--description` are required for `create`. `--action` is `create` (default),
|
|
321
|
+
`update`, `alias` or `merge` (`alias` / `merge` need `--alias <dot.path>`); `--type` is `color`,
|
|
322
|
+
`length` or `text` (inferred when omitted). Add `--replaces "<literal>"` when the token replaces a
|
|
323
|
+
hard-coded value; the files that still contain it are attached from a fresh scan. The human
|
|
324
|
+
decides on the Changes page / token page or with `seji proposal <design> <id>
|
|
325
|
+
approve|reject|reset`.
|
|
326
|
+
|
|
327
|
+
- During the proposal stage (before approval and DTCG build), reference the proposed token in code
|
|
328
|
+
with an existing fallback: `var(--surface-elevated, var(--color-surface))`.
|
|
329
|
+
- `seji tokens check` allows unrejected agent proposal `var(--*)` references as a
|
|
330
|
+
report-only warning rather than failing with unknown CSS variable errors.
|
|
331
|
+
- Unreviewed proposals (`author: "agent"`, no `proposalDecision`) preview live in the UI and do
|
|
332
|
+
**not** appear in **Hand to agent** / `seji prompt` until the human decides.
|
|
333
|
+
- **`[approved proposal]`**: write the approved token (using the possibly adjusted `to` value) into
|
|
334
|
+
the named `design/tokens/<tier>.tokens.json` file, run `tokens build` and `tokens check`, and mark
|
|
335
|
+
`resolved` with `seji status <design> <itemId> resolved`.
|
|
336
|
+
- **`[rejected proposal]`**: do **not** create the token in DTCG source; switch usages back to
|
|
337
|
+
existing tokens following `decisionNote` and mark `resolved` with
|
|
338
|
+
`seji status <design> <itemId> resolved --reply "..."`. Rejected proposals archive
|
|
339
|
+
10 minutes after resolution without needing `verifiedAt`.
|
|
340
|
+
|
|
341
|
+
### Verification
|
|
342
|
+
|
|
343
|
+
`seji verify <design> [--snapshots]` checks resolved token items against the built
|
|
344
|
+
output (values, references, snapshots) and writes `verifiedAt`; what each action must satisfy,
|
|
345
|
+
the snapshot loop and the archive rules are in **seji** ("Verify"). Token-specific:
|
|
346
|
+
stale generated files verify nothing (run `tokens build` first), and tool items verify against
|
|
347
|
+
`tokenOp.expect` (e.g. `delete` expects the CSS name `absent`). Never write `verifiedAt`.
|
|
348
|
+
|
|
349
|
+
`sourceHash` is the generated token hash at proposal time. Do not edit it. If generated output is
|
|
350
|
+
stale, run `seji tokens build` and re-check.
|
|
351
|
+
|
|
352
|
+
## Usage index
|
|
353
|
+
|
|
354
|
+
Ask who uses a token before choosing, changing, merging or deprecating it:
|
|
355
|
+
|
|
356
|
+
```bash
|
|
357
|
+
seji usage # every token: tokens / components / screens / code-ref counts
|
|
358
|
+
seji usage chrome.accent # one token (dot path or --css-name)
|
|
359
|
+
seji usage --hardcoded src/ui # hard-coded color literals in a file, dir or Component
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
Output is JSON. For a token: `references` (what it points to), `referencedBy` (direct/transitive
|
|
363
|
+
tokens and local CSS aliases such as `--accent: var(--chrome-accent)`), `code` (direct references
|
|
364
|
+
with files and lines), `components` and `screens` (each with `match` = how it was found and `via` =
|
|
365
|
+
which name carried the use), and `summary` counts. Attribution is static: components come from
|
|
366
|
+
files that reference the token or use every class of a CSS rule that references it; screens are
|
|
367
|
+
designs whose import graph references it, uses such a class, or renders such a component, plus
|
|
368
|
+
component pages from `design/components.ts`. `--hardcoded` lists color literals only (the scanners
|
|
369
|
+
do not report literal lengths), each with exact-value token `matches`. The dev server serves the
|
|
370
|
+
same data at `GET /__seji/api/usage[?token=…|?hardcoded=…]`.
|
|
371
|
+
|
|
372
|
+
Per component, `seji component show <Name>` lists the tokens and hard-coded values its
|
|
373
|
+
styles use (`tokenRows`, `literals`). A hard-coded value promoted from a component page
|
|
374
|
+
("Promote to component token") is a `create` item with `tokenTier: "component"` whose
|
|
375
|
+
`replaces.files` is that component's file only — rewire just that file.
|
|
376
|
+
|
|
377
|
+
## Token health
|
|
378
|
+
|
|
379
|
+
`seji health` prints the full health report as JSON without the canvas (also
|
|
380
|
+
`GET /__seji/api/health`); exit code 1 means validation errors. The Token tab (problem filter, per-token health), manifest and
|
|
381
|
+
`health` report:
|
|
382
|
+
|
|
383
|
+
- duplicated values within a group
|
|
384
|
+
- orphan tokens with no usage and no alias
|
|
385
|
+
- semantic literals
|
|
386
|
+
- component tokens that alias primitives
|
|
387
|
+
- hardcoded color files and cross-file value `clusters`
|
|
388
|
+
- `unsupported` dynamic style expressions or uninstalled preprocessor parsers (report-only)
|
|
389
|
+
|
|
390
|
+
## Preview semantics
|
|
391
|
+
|
|
392
|
+
The Inspector previews token candidates as:
|
|
393
|
+
|
|
394
|
+
```css
|
|
395
|
+
padding: var(--space-card);
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
The actual component consumes the token. The preview is not the source. Inspector bindings are
|
|
399
|
+
browser-local drafts until the human saves them; only saved `suggestion` / `style` items in
|
|
400
|
+
`review.json` are work. The agent applies the token to TSX/CSS and updates the review item status
|
|
401
|
+
with `seji status`.
|
|
402
|
+
|
|
403
|
+
The inspector suggests the exact or nearest existing token for a literal (never for formulas),
|
|
404
|
+
warns when a component binds a primitive directly (use the semantic alias instead) and when a
|
|
405
|
+
token is deprecated (`$deprecated`, with its replacement). A **Promote to new token…** item is a
|
|
406
|
+
`create` with an explicit tier and `$description`, like any other new token.
|
|
407
|
+
|
|
408
|
+
## Checks
|
|
409
|
+
|
|
410
|
+
`seji tokens check` validates:
|
|
411
|
+
|
|
412
|
+
- DTCG types and alias cycles
|
|
413
|
+
- unknown `var()` references (unrejected agent proposals are allowed with a report-only warning)
|
|
414
|
+
- generated file freshness
|
|
415
|
+
- configured `contrastPairs`
|
|
416
|
+
- hardcoded color literals and unsupported style expressions (report-only)
|
|
417
|
+
|
|
418
|
+
If it reports generated files stale, run `seji tokens build` and check again.
|
|
419
|
+
|
|
420
|
+
## Common mistakes
|
|
421
|
+
|
|
422
|
+
- Editing `design/.seji/tokens.generated.ts` or `src/tokens.generated.css`.
|
|
423
|
+
- Editing `design/tokens.ts`; it re-exports generated metadata, not source.
|
|
424
|
+
- Using a CSS variable name in `tokenAlias`; use the DTCG path (e.g. `color.surface`).
|
|
425
|
+
- Adding a semantic token as a literal when an alias is expected.
|
|
426
|
+
- Marking a token resolved without rebuilding (`tokens build` + `tokens check`).
|
|
427
|
+
- Deleting a token without finding usages (`seji usage <token>`); use `tokens delete`, which refuses while it is used.
|
|
428
|
+
- Renaming, merging or deprecating tokens by hand-editing references; use the `tokens` ops and fix only the leftovers.
|
|
429
|
+
- Reading `deprecate` as delete: a deprecated token stays (alias + `$deprecated`).
|
|
430
|
+
- Leaving out the tier or `$description` on a new token.
|
|
431
|
+
- Deriving a CSS name from a dotted path by string replacement (breaks with `cssName` overrides).
|
|
432
|
+
- Writing `verifiedAt` or `archivedAt`.
|