@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 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src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
|
5
|
+
updatedAt: new Date().toISOString(),
|
|
6
|
+
tokens: [],
|
|
7
|
+
structure: [],
|
|
8
|
+
free: [],
|
|
9
|
+
comments: [],
|
|
10
|
+
styles: [],
|
|
11
|
+
suggestions: [],
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/shared/types.ts"],"names":[],"mappings":"AAgNA,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAAc,EAAE,KAAa,EAAW,EAAE,CAAC,CAAC;IACvE,OAAO,EAAE,CAAC;IACV,MAAM;IACN,KAAK;IACL,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;IACnC,MAAM,EAAE,EAAE;IACV,SAAS,EAAE,EAAE;IACb,IAAI,EAAE,EAAE;IACR,QAAQ,EAAE,EAAE;IACZ,MAAM,EAAE,EAAE;IACV,WAAW,EAAE,EAAE;CAChB,CAAC,CAAA","sourcesContent":["export type Rect = {\n x: number\n y: number\n width: number\n height: number\n}\n\nexport type VariableRef = {\n property: string\n token: string\n value: string\n}\n\nexport type InspectorStyle = {\n fontFamily: string\n fontSize: string\n fontWeight: string\n lineHeight: string\n letterSpacing: string\n color: string\n backgroundColor: string\n borderWidth: string\n borderStyle: string\n borderColor: string\n borderRadius: string\n opacity: string\n boxShadow: string\n padding: string\n display: string\n flexDirection: string\n flexWrap: string\n gap: string\n alignItems: string\n justifyContent: string\n textAlign: string\n}\n\nexport type ForcedState = 'hover' | 'active' | 'focus' | 'disabled'\n\n/** One color used inside a selection (the node itself or a descendant). */\nexport type SelectionColor = {\n id: number\n path: string\n anchor: string | null\n label: string\n property: string\n value: string\n token?: string\n}\n\nexport type NodeLayout = {\n widthMode: 'fixed' | 'fill' | 'hug'\n parentRow: boolean\n width: number\n /** Height as authored: no explicit height reads as hug (see shared/sizeModes.mjs). */\n heightMode?: 'fixed' | 'fill' | 'hug'\n height?: number\n /** The parent's layout: row / column flex or block. */\n parentKind?: 'row' | 'column' | 'block'\n}\n\nexport type InspectorNode = {\n id: number\n parentId: number | null\n tag: string\n name: string\n anchor: string | null\n ownAnchor?: string | null\n component?: string | null\n componentRoot?: boolean\n components?: string[]\n source?: string | null\n variables?: VariableRef[]\n path: string\n free: boolean\n freeRect?: Rect\n children: number[]\n rect?: Rect\n html?: string\n text?: string\n styles?: InspectorStyle\n layout?: NodeLayout\n colors?: SelectionColor[]\n /** Pseudo states that have matching rules and can be forced in the preview. */\n states?: ForcedState[]\n /** Pseudo state currently forced on this node in the preview. */\n state?: ForcedState | null\n}\n\nexport type NodeRef = {\n id: number\n anchor: string | null\n tag: string\n name: string\n component?: string | null\n components?: string[]\n source?: string | null\n path: string\n html: string\n rect?: Rect\n freeRect?: Rect\n}\n\nexport type TokenValue = {\n name: string\n value: string\n}\n\nexport type FlowSnapshot = {\n state: string\n history: string[]\n}\n\nexport type ChangeStatus = 'open' | 'in_progress' | 'resolved'\n\nexport type ChangeMeta = {\n status?: ChangeStatus\n resolvedAt?: string\n updatedAt?: string\n agentReply?: string\n}\n\nexport type SessionTokenChange = ChangeMeta & {\n name: string\n from: string\n value: string\n}\n\nexport type SessionStructureChange = ChangeMeta & {\n op: 'move'\n node: NodeRef\n target?: NodeRef\n parent: NodeRef | null\n index: number\n}\n\nexport type SessionFreeChange = ChangeMeta & {\n node: NodeRef\n from: Rect\n to: Rect\n}\n\nexport type SessionStyle = ChangeMeta & {\n node: NodeRef\n property: string\n value: string\n from?: string\n token?: string\n}\n\nexport type SessionSuggestion = ChangeMeta & {\n node: NodeRef\n property: string\n value: string\n token: string\n createdAt: string\n}\n\nexport type SessionCommentReply = {\n id: string\n body: string\n author: 'agent' | 'human'\n createdAt: string\n}\n\nexport type SessionComment = ChangeMeta & {\n id: string\n body: string\n createdAt: string\n node: NodeRef\n resolved?: boolean\n resolvedAt?: string\n editedAt?: string\n replies?: SessionCommentReply[]\n}\n\nexport type ArchiveItem = {\n id: string\n design: string\n frame: string\n kind: 'token' | 'style' | 'free' | 'structure' | 'suggestion' | 'comment'\n title: string\n change: unknown\n resolvedAt: string\n archivedAt: string\n}\n\nexport type SessionHistory = {\n version: 1\n design: string\n updatedAt: string\n items: ArchiveItem[]\n}\n\nexport type Session = {\n version: 1\n design: string\n frame: string\n updatedAt: string\n tokens: SessionTokenChange[]\n structure: SessionStructureChange[]\n free: SessionFreeChange[]\n comments: SessionComment[]\n styles?: SessionStyle[]\n suggestions?: SessionSuggestion[]\n notes?: string\n}\n\nexport const emptySession = (design: string, frame: string): Session => ({\n version: 1,\n design,\n frame,\n updatedAt: new Date().toISOString(),\n tokens: [],\n structure: [],\n free: [],\n comments: [],\n styles: [],\n suggestions: [],\n})\n\n\nexport type CanvasPosition = {\n x: number\n y: number\n}\n\nexport type CanvasCamera = {\n x: number\n y: number\n zoom: number\n}\n\nexport type CanvasLayout = {\n version: 1\n positions: Record<string, CanvasPosition>\n /** The last camera saved (a 0.4.3 cache has only this one). */\n camera?: CanvasCamera\n /** The camera of each page, by page id. */\n cameras?: Record<string, CanvasCamera>\n}\n\nexport type DesignComponent = {\n name: string\n exportName: string\n file: string\n line?: number\n}\n\n\nexport type ComponentPage = {\n design: string\n page: string\n}\n\nexport type ComponentGroup = {\n id: string\n label: string\n labelZh?: string\n components: DesignComponent[]\n}\n\n/* ------------------------------------------------------------------ */\n/* Component pages: metadata, layers and the usage report */\n/* ------------------------------------------------------------------ */\n\nexport type ComponentLayer = 'base' | 'composite'\n\nexport type ComponentDeprecation = {\n reason: string\n replacement: string | null\n at?: string\n}\n\nexport type ComponentSummary = {\n name: string\n file: string\n line?: number\n /** null when the project does not configure component layers. */\n layer: ComponentLayer | null\n page: ComponentPage | null\n description?: string\n deprecated: ComponentDeprecation | null\n /** Distinct tokens the component's styles reference. */\n tokens: number\n /** Hard-coded color literals in the component's styles. */\n hardcoded: number\n /** Primitive-tier tokens its styles use directly (should go through the semantic layer). */\n primitive: number\n /** Pending `component` review items for it, across every design ledger. */\n pending: number\n /** An agent proposal for it is waiting for a decision. */\n proposed: boolean\n}\n\nexport type ComponentList = {\n /** True when design/components.json configures `layers.base`. */\n layers: boolean\n components: ComponentSummary[]\n}\n\n/** One property (and pseudo state) a token styles on a component. */\nexport type ComponentTokenUse = {\n property: string\n state?: string\n count: number\n file: string\n line?: number\n match: string\n}\n\n/** One token a component's styles use, with every property it styles (one row per token). */\nexport type ComponentTokenRow = {\n token: string\n path?: string\n tier?: string\n count: number\n properties: ComponentTokenUse[]\n file: string\n line?: number\n match: string\n /** `primitive`: a base-layer token used directly; use a semantic token instead. */\n warning?: 'primitive'\n /** Semantic tokens that alias it (`alias`) or have the same value (`value`). */\n suggestions?: Array<{ token: string; path: string; via: 'alias' | 'value' }>\n}\n\nexport type ComponentLiteralRow = {\n property: string\n state?: string\n value: string\n count: number\n file: string\n line?: number\n match: string\n /** Tokens whose value is exactly this literal. */\n matches: string[]\n}\n\nexport type ComponentReport = ComponentSummary & {\n tokenRows: ComponentTokenRow[]\n literals: ComponentLiteralRow[]\n summary: {\n tokens: number\n primitive: number\n hardcoded: number\n }\n /** Deprecated components that name this one as their replacement. */\n replaces: Array<{ name: string; at?: string }>\n /** Pending `component` review items for it. */\n items: ReviewItem[]\n /** Names it had before pending tool renames: frames may still render it under them. */\n renamedFrom: string[]\n}\n\n/* ------------------------------------------------------------------ */\n/* Design-level review ledger */\n/* ------------------------------------------------------------------ */\n\nexport type ReviewScope = 'design' | 'page' | 'frame' | 'component' | 'editor'\nexport type ReviewStatus = 'open' | 'in_progress' | 'resolved' | 'archived'\nexport type ReviewKind =\n | 'token'\n | 'style'\n | 'free'\n | 'structure'\n | 'suggestion'\n | 'comment'\n | 'component'\n\n/**\n * What a `component` item is about. `rename` / `merge` (and `deprecate` with replace usages)\n * are executed by the tool (see ComponentOpRecord); the rest ask the agent for code changes.\n * `extract` (Promote to component) asks for a new component made from a selected element.\n */\nexport type ComponentAction = 'rename' | 'merge' | 'deprecate' | 'undeprecate' | 'delete' | 'tidy' | 'extract'\n\n/** Where a Promote to component selection comes from: the design's code, or an app component. */\nexport type ExtractFrom = 'design' | 'component'\n\nexport type ReviewTarget =\n | { type: 'node'; node: NodeRef }\n | { type: 'token'; token: string }\n | { type: 'component'; component: string }\n | { type: 'editor'; area: string }\n\nexport type ReviewReply = {\n id: string\n body: string\n author: 'agent' | 'human'\n createdAt: string\n}\n\nexport type ReviewItem = {\n id: string\n design: string\n kind: ReviewKind\n scope: ReviewScope\n page?: string\n frame?: string\n target: ReviewTarget\n property?: string\n /** Pseudo state a style applies to (hover/active/focus/disabled); absent = default. */\n state?: ForcedState\n token?: string\n from?: unknown\n to?: unknown\n body?: string\n thread?: ReviewReply[]\n status: ReviewStatus\n author?: 'human' | 'agent'\n rationale?: string\n proposalDecision?: 'approved' | 'rejected'\n decisionNote?: string\n agentReply?: string\n source?: string\n sourceHash?: string\n tokenType?: string\n tokenAction?:\n | 'create'\n | 'update'\n | 'merge'\n | 'deprecate'\n | 'alias'\n | 'rename'\n | 'delete'\n | 'describe'\n | 'replace-literal'\n | 'consolidate'\n tokenAlias?: string\n tokenTier?: string\n /** Usage note for a new token; written to the DTCG `$description`. */\n tokenDescription?: string\n /** Hard-coded literal this token replaces, and the files that still contain it. */\n replaces?: { value: string; files: string[] }\n /** `component` items: the action, and for deprecate whether usages move now or later. */\n componentAction?: ComponentAction\n componentMode?: 'replace' | 'mark'\n /** `component` tidy items: frame ids on the component page that should move elsewhere. */\n frames?: string[]\n /**\n * `component` extract items (Promote to component): `from` is `design` | `component`, `to`\n * the new name, `node` the selected element (as on style items), `componentDescription` the\n * usage note, `dir` the target directory; `parent` / `parentFile` for `from: 'component'`.\n */\n node?: Partial<NodeRef> & { path?: string }\n /**\n * `token` create items from the Inspector's \"Suggest promoting to token\": the name\n * (`target.token`, empty) and `tokenTier` are left for the agent, which writes them on the\n * item; `node` / `property` say where the literal (`to`, `replaces`) was seen.\n */\n tokenSuggested?: boolean\n componentDescription?: string\n dir?: string\n parent?: string\n parentFile?: string\n /** Set when the tool itself executed the token operation (see TokenOpRecord). */\n tokenOp?: TokenOpRecord\n /** Set when the tool itself rewrote the code for a component action (see ComponentOpRecord). */\n componentOp?: ComponentOpRecord\n verifiedAt?: string\n /** Last headless check run (`seji verify`). Tool-owned. */\n checks?: ReviewChecks\n /** Before/after snapshot comparison of the screens this item affects. Tool-owned. */\n snapshots?: ReviewSnapshots\n /** Comments: whether the target's source was a sketch (under design/) or product component when posted. */\n targetKind?: 'sketch' | 'product'\n /** Comments: git HEAD when created / moved to in_progress; resolve diffs against it. Tool-owned. */\n baseCommit?: string\n /** Root-relative PNG of the frame as the person saw it when the comment was posted. Tool-owned. */\n shot?: string\n createdAt: string\n updatedAt: string\n resolvedAt?: string\n archivedAt?: string\n}\n\n/** A place the tool rewrote, or one it left for the agent (with `reason`). */\nexport type TokenOpPlace = {\n file: string\n line: number\n column: number\n property?: string\n scheme?: string\n from?: string\n to?: string\n reason?: string\n text?: string\n}\n\n/** A translatable reason: the editor renders the text from `code` + `params` (the tool also sends English). */\nexport type ReasonCode = { code: string; params?: Record<string, unknown> }\n\n/** What a tool-executed token operation did (`seji tokens rename|merge|…`). */\nexport type TokenOpRecord = {\n op: 'rename' | 'merge' | 'deprecate' | 'delete' | 'describe' | 'set' | 'create' | 'replace-literal' | 'consolidate'\n batchId: string\n by: 'tool'\n /** Places changed by the tool (token sources + code). */\n changed: number\n /** Places left for the agent (`leftovers`). */\n left: number\n summary: string\n mode?: 'mark-only' | 'replace-all'\n values?: { source: string; target: string; kept: 'target' | 'source'; result: string }\n /** End state verification checks: CSS names present/absent, aliases, values. */\n expect: {\n present?: string[]\n absent?: string[]\n aliases?: Record<string, string>\n values?: Record<string, string>\n }\n tokenChanges: Array<{ file: string; token: string; change: string; from?: unknown; to?: unknown; reason?: string }>\n changes: TokenOpPlace[]\n changesTruncated?: number\n leftovers: TokenOpPlace[]\n notes?: string[]\n /** `notes` as codes, in the same order. */\n noteCodes?: ReasonCode[]\n /**\n * The operation's arguments, structured (`summary` is the English form): rename/merge\n * `{ from, to, alias, … }`, deprecate `{ token, replacement, mode, reason }`, set\n * `{ token, value }`, create `{ token, cssName, tier, value }`, consolidate `{ plan, rows, counts }`…\n */\n args?: Record<string, unknown>\n /** `consolidate`: the plan (design/.consolidate/<plan>.json) and what each applied row did. */\n plan?: string\n rows?: Array<{\n row: string\n category: string\n action: 'reuse' | 'create' | 'merge'\n token: string\n cssName: string\n values: string[]\n merged?: string[]\n found: number\n replaceable: number\n visibleChange?: Array<{ token?: string; from: string; to: string; occurrences?: number; delta: Record<string, number | boolean> }>\n }>\n revertedAt?: string\n}\n\nexport type ReviewCheckStatus = 'pass' | 'fail' | 'skip' | 'review' | 'pending'\n\nexport type ReviewCheck = {\n status: ReviewCheckStatus\n detail: string\n /** `detail` as a code (+ params) for the editor to translate. */\n code?: string\n params?: Record<string, unknown>\n [key: string]: unknown\n}\n\nexport type ReviewChecks = {\n checkedAt: string\n /** The built token source holds the requested value / alias. */\n values: ReviewCheck\n /** References implied by the change are all updated (usage index). */\n references: ReviewCheck\n /** Snapshot comparison: pass / review (decisions pending) / fail (rejected) / pending / skip. */\n snapshots: ReviewCheck\n}\n\nexport type SnapshotBox = { x: number; y: number; width: number; height: number; pixels: number }\n\nexport type SnapshotFrame = {\n /** `<design>/<page>__<frame>` */\n key: string\n design: string\n page: string\n frame: string\n title?: string\n size: [number, number]\n /** Root-relative PNG paths. */\n before?: string\n after?: string\n diff?: string\n beforeHash?: string\n afterHash?: string\n status: 'pending' | 'changed' | 'unchanged' | 'missing' | 'error'\n /** Captures did not settle on one image (animation, late resource, time-dependent content). */\n unstable?: boolean\n error?: string\n diffPixels?: number\n diffRatio?: number\n boxes?: SnapshotBox[]\n sizeChange?: { before: [number, number]; after: [number, number] }\n decision?: 'accepted' | 'rejected'\n reason?: string\n decidedAt?: string\n decidedHash?: string\n}\n\nexport type ReviewSnapshots = {\n /** Set while a baseline capture runs; cleared when it finishes. */\n capturingSince?: string\n baselineAt?: string\n comparedAt?: string\n targets: Array<{ design: string; page?: string; frame?: string; reason: string }>\n truncated?: number\n missing?: Array<{ design: string; page?: string; frame?: string; reason: string; error: string }>\n /** Differences first. */\n frames?: SnapshotFrame[]\n}\n\n/** A file the tool moved as part of a component rename. */\nexport type ComponentOpMove = { from: string; to: string }\n\n/**\n * What a tool-executed component operation did (`seji component rename|merge|\n * deprecate --replace-all`): every place it rewrote with the AST, and what it left.\n */\nexport type ComponentOpRecord = {\n op: 'rename' | 'merge' | 'replace'\n batchId: string\n by: 'tool'\n changed: number\n left: number\n summary: string\n files: Array<{ file: string; changed: number; left: number }>\n moves: ComponentOpMove[]\n changes: TokenOpPlace[]\n changesTruncated?: number\n leftovers: TokenOpPlace[]\n notes?: string[]\n revertedAt?: string\n}\n\n/** `dryRun` / result of a tool-executed component operation, as shown in the dialog. */\nexport type ComponentOpReport = {\n op: ComponentOpRecord['op']\n dryRun: boolean\n component: string\n to: string\n design?: string\n summary: string\n counts: { changed: number; leftovers: number; files: number }\n files: ComponentOpRecord['files']\n moves: ComponentOpMove[]\n changes: TokenOpPlace[]\n leftovers: TokenOpPlace[]\n notes?: string[]\n batchId?: string\n itemId?: string\n status?: ReviewStatus\n}\n\nexport type ReviewBatch = {\n id: string\n design: string\n createdAt: string\n itemIds: string[]\n /**\n * Tool batches keep undo edits so `tokens revert <id>` / `component revert <id>` restore\n * the files (component batches also list the files they moved).\n */\n kind?: 'token-op' | 'component-op'\n op?: TokenOpRecord['op'] | ComponentOpRecord['op']\n summary?: string\n revert?: {\n files: Array<{\n file: string\n beforeHash: string\n afterHash: string\n undo: Array<{ start: number; end: number; text: string }>\n }>\n moves?: ComponentOpMove[]\n }\n revertedAt?: string\n revertSkipped?: Array<{ file: string; reason: string }>\n}\n\nexport type ReviewLog = {\n version: 1\n design: string\n updatedAt: string\n items: ReviewItem[]\n batches: ReviewBatch[]\n}\n\nexport type ReviewOp =\n | { type: 'upsert'; item: ReviewItem }\n | { type: 'remove'; id: string }\n | { type: 'archive'; ids: string[]; archivedAt: string }\n | { type: 'patch'; id: string; patch: Partial<ReviewItem> }\n | { type: 'batch'; batch: ReviewBatch }\n\nexport type TokenOverride = {\n name: string\n from: string\n value: string\n status?: ReviewStatus\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type FrameWheelRoute = 'zoom' | 'pan' | 'native'
|
|
2
|
+
export declare function routeFrameWheel(input?: { ctrlKey?: boolean; metaKey?: boolean; inspecting?: boolean }): FrameWheelRoute
|
|
3
|
+
export declare function wheelPixels(input?: { deltaX?: number; deltaY?: number; deltaMode?: number }): { dx: number; dy: number }
|
|
4
|
+
export declare function framePointToViewport(
|
|
5
|
+
point: { clientX: number; clientY: number },
|
|
6
|
+
frame: { left: number; top: number; width: number },
|
|
7
|
+
frameWidth: number,
|
|
8
|
+
viewport: { left: number; top: number },
|
|
9
|
+
): { x: number; y: number }
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// Wheel over a preview frame (an iframe swallows wheel events, so the canvas never sees them).
|
|
2
|
+
// The preview decides per event, the editor applies it with the canvas's own zoom / pan code:
|
|
3
|
+
//
|
|
4
|
+
// ctrl / meta + wheel (a trackpad pinch arrives as ctrl + wheel) → 'zoom' the canvas around the
|
|
5
|
+
// pointer, like the empty canvas
|
|
6
|
+
// plain wheel, inspect mode → 'pan' the canvas (the frame is not interactive then)
|
|
7
|
+
// plain wheel, run mode → 'native': the frame scrolls its own content, nothing is forwarded
|
|
8
|
+
//
|
|
9
|
+
// 'zoom' and 'pan' are preventDefault-ed in the frame and forwarded as `design:wheel`.
|
|
10
|
+
|
|
11
|
+
/** @returns {'zoom' | 'pan' | 'native'} */
|
|
12
|
+
export function routeFrameWheel({ ctrlKey = false, metaKey = false, inspecting = false } = {}) {
|
|
13
|
+
if (ctrlKey || metaKey) return 'zoom'
|
|
14
|
+
return inspecting ? 'pan' : 'native'
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** Wheel deltas in CSS pixels (line-mode deltas are 16 px a line). */
|
|
18
|
+
export function wheelPixels({ deltaX = 0, deltaY = 0, deltaMode = 0 } = {}) {
|
|
19
|
+
const factor = deltaMode === 1 ? 16 : deltaMode === 2 ? 800 : 1
|
|
20
|
+
return { dx: deltaX * factor, dy: deltaY * factor }
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* A point in a frame (its own client coordinates) → the canvas viewport's coordinates. `frame` is
|
|
25
|
+
* the iframe's bounding rect in the editor (scaled with the canvas), `frameWidth` its unscaled
|
|
26
|
+
* CSS width, `viewport` the canvas viewport's bounding rect.
|
|
27
|
+
*/
|
|
28
|
+
export function framePointToViewport({ clientX, clientY }, frame, frameWidth, viewport) {
|
|
29
|
+
const scale = frameWidth > 0 ? frame.width / frameWidth : 1
|
|
30
|
+
return { x: frame.left + clientX * scale - viewport.left, y: frame.top + clientY * scale - viewport.top }
|
|
31
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// Which source files the tools may rewrite: ONE definition shared by token operations
|
|
2
|
+
// (src/tokens/ops.mjs) and component operations (src/components/ops.mjs), for applying a
|
|
3
|
+
// change and for reverting one.
|
|
4
|
+
//
|
|
5
|
+
// A file is writable when it is inside the project root, or inside a directory the project
|
|
6
|
+
// opted in with `writableDirs` in design/tokens.config.json, both by path and after resolving
|
|
7
|
+
// symlinks (the same base both ways), and is not itself a symlink. `writableDirs` is empty by
|
|
8
|
+
// default: the tools never write outside the root. A writable dir that is itself a symlink is
|
|
9
|
+
// ignored. Everything else the scan reaches (a `scanDirs` entry like `../shared/src` that is
|
|
10
|
+
// not listed, a symlinked folder) is only reported: what a tool would change there becomes an
|
|
11
|
+
// `outside-project-root` leftover.
|
|
12
|
+
import { lstatSync, realpathSync } from 'node:fs'
|
|
13
|
+
import { basename, dirname, isAbsolute, relative, resolve } from 'node:path'
|
|
14
|
+
|
|
15
|
+
const within = (base, file) => {
|
|
16
|
+
const rel = relative(base, file)
|
|
17
|
+
return Boolean(rel) && !rel.startsWith('..') && !isAbsolute(rel)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const realOf = (path) => {
|
|
21
|
+
try {
|
|
22
|
+
return realpathSync(path)
|
|
23
|
+
} catch {
|
|
24
|
+
return path
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const isLink = (path) => {
|
|
29
|
+
try {
|
|
30
|
+
return lstatSync(path).isSymbolicLink()
|
|
31
|
+
} catch {
|
|
32
|
+
return false
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const OUTSIDE = { reason: 'path outside the project' }
|
|
37
|
+
const SYMLINK = { reason: 'symlink' }
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The project's write scope.
|
|
41
|
+
* - `check(file, { missing })` → `{ abs }` or `{ reason }`. A missing file is refused unless
|
|
42
|
+
* `missing` is set; then its directory must be in scope and not a symlink (a revert that
|
|
43
|
+
* moves a renamed file back to its old name).
|
|
44
|
+
* - `isWritable(file)`, `split(files)` → `{ scan, outside }`.
|
|
45
|
+
*/
|
|
46
|
+
export function writeScope(root, { writableDirs = [] } = {}) {
|
|
47
|
+
const base = resolve(root)
|
|
48
|
+
// Each base as written and as its real path (the root itself may sit behind a symlink, like
|
|
49
|
+
// /tmp on macOS). A file must be under a base by path AND under the same base's real path,
|
|
50
|
+
// so a symlink inside the root never reaches into a writable dir (or anywhere else).
|
|
51
|
+
const bases = [base, ...writableDirs.map((dir) => resolve(base, String(dir))).filter((dir) => !isLink(dir))].map((dir) => ({
|
|
52
|
+
dir,
|
|
53
|
+
real: realOf(dir),
|
|
54
|
+
}))
|
|
55
|
+
const pathBases = (abs) => bases.filter(({ dir, real }) => within(dir, abs) || within(real, abs))
|
|
56
|
+
|
|
57
|
+
const check = (file, { missing = false } = {}) => {
|
|
58
|
+
if (typeof file !== 'string' || !file || file.includes('\0')) return { reason: 'invalid path' }
|
|
59
|
+
const abs = resolve(base, file)
|
|
60
|
+
const candidates = pathBases(abs)
|
|
61
|
+
if (!candidates.length) return OUTSIDE
|
|
62
|
+
let stat
|
|
63
|
+
try {
|
|
64
|
+
stat = lstatSync(abs)
|
|
65
|
+
} catch {
|
|
66
|
+
stat = null
|
|
67
|
+
}
|
|
68
|
+
let real
|
|
69
|
+
if (stat) {
|
|
70
|
+
if (stat.isSymbolicLink()) return SYMLINK
|
|
71
|
+
real = realpathSync(abs)
|
|
72
|
+
} else {
|
|
73
|
+
if (!missing) return { reason: 'file is missing' }
|
|
74
|
+
const parent = dirname(abs)
|
|
75
|
+
if (isLink(parent)) return SYMLINK
|
|
76
|
+
try {
|
|
77
|
+
real = resolve(realpathSync(parent), basename(abs))
|
|
78
|
+
} catch {
|
|
79
|
+
return { reason: 'directory is missing' }
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return candidates.some((candidate) => within(candidate.real, real)) ? { abs } : OUTSIDE
|
|
83
|
+
}
|
|
84
|
+
const isWritable = (file) => Boolean(check(file).abs)
|
|
85
|
+
return {
|
|
86
|
+
root: base,
|
|
87
|
+
check,
|
|
88
|
+
isWritable,
|
|
89
|
+
split(files) {
|
|
90
|
+
const scan = []
|
|
91
|
+
const outside = []
|
|
92
|
+
for (const file of files) (isWritable(file) ? scan : outside).push(file)
|
|
93
|
+
return { scan, outside }
|
|
94
|
+
},
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export type Box = { x: number; y: number; width: number; height: number; pixels: number }
|
|
2
|
+
export type Image = { width: number; height: number; data: Uint8Array }
|
|
3
|
+
export type DiffOptions = {
|
|
4
|
+
threshold?: number
|
|
5
|
+
includeAA?: boolean
|
|
6
|
+
gap?: number
|
|
7
|
+
cell?: number
|
|
8
|
+
maxBoxes?: number
|
|
9
|
+
minPixels?: number
|
|
10
|
+
}
|
|
11
|
+
export type Comparison = {
|
|
12
|
+
width: number
|
|
13
|
+
height: number
|
|
14
|
+
beforeSize: [number, number]
|
|
15
|
+
afterSize: [number, number]
|
|
16
|
+
diffPixels: number
|
|
17
|
+
diffRatio: number
|
|
18
|
+
boxes: Box[]
|
|
19
|
+
diff: Image
|
|
20
|
+
}
|
|
21
|
+
export declare const DIFF_DEFAULTS: Required<DiffOptions>
|
|
22
|
+
export declare function boxDistance(a: Box, b: Box): number
|
|
23
|
+
export declare function mergeBoxes(boxes: Array<Omit<Box, 'pixels'> & { pixels?: number }>, options?: { gap?: number; maxBoxes?: number }): Box[]
|
|
24
|
+
export declare function maskBoxes(mask: ArrayLike<number | boolean>, width: number, height: number, options?: DiffOptions): Box[]
|
|
25
|
+
export declare function compareImages(before: Image, after: Image, options?: DiffOptions): Comparison
|
|
26
|
+
export declare function decodePng(buffer: Uint8Array): Image
|
|
27
|
+
export declare function encodePng(image: Image): Buffer
|
|
28
|
+
export declare function comparePngs(before: Uint8Array, after: Uint8Array, options?: DiffOptions): Comparison & { diffPng: Buffer }
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
// Pixel diff for snapshot comparison: compares a before/after PNG pair, returns the
|
|
2
|
+
// changed-pixel count and ratio, merged bounding boxes of the changed regions, and a
|
|
3
|
+
// diff image (faded "after" + changed pixels in red + box outlines).
|
|
4
|
+
//
|
|
5
|
+
// Pure functions over RGBA buffers; `maskBoxes` / `mergeBoxes` are exported for tests.
|
|
6
|
+
import pixelmatch from 'pixelmatch'
|
|
7
|
+
import { PNG } from 'pngjs'
|
|
8
|
+
|
|
9
|
+
const DIFF_COLOR = [255, 0, 0]
|
|
10
|
+
const BOX_COLOR = [204, 0, 0]
|
|
11
|
+
|
|
12
|
+
/** Default comparison options. `threshold` is pixelmatch's per-pixel YIQ threshold (0..1). */
|
|
13
|
+
export const DIFF_DEFAULTS = {
|
|
14
|
+
threshold: 0.1,
|
|
15
|
+
includeAA: false,
|
|
16
|
+
/** Changed pixels closer than this (px) join one box. */
|
|
17
|
+
gap: 12,
|
|
18
|
+
/** Grid cell size (px) for the connected-component pass. */
|
|
19
|
+
cell: 8,
|
|
20
|
+
/** Boxes above this count are merged pairwise (closest first). */
|
|
21
|
+
maxBoxes: 24,
|
|
22
|
+
/** Boxes with fewer changed pixels than this are dropped as noise (0 keeps all). */
|
|
23
|
+
minPixels: 0,
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const area = (box) => box.width * box.height
|
|
27
|
+
|
|
28
|
+
const unionBox = (a, b) => {
|
|
29
|
+
const x = Math.min(a.x, b.x)
|
|
30
|
+
const y = Math.min(a.y, b.y)
|
|
31
|
+
const right = Math.max(a.x + a.width, b.x + b.width)
|
|
32
|
+
const bottom = Math.max(a.y + a.height, b.y + b.height)
|
|
33
|
+
return { x, y, width: right - x, height: bottom - y, pixels: (a.pixels ?? 0) + (b.pixels ?? 0) }
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Gap (px) between two boxes along the axis that separates them most; 0 when they overlap/touch. */
|
|
37
|
+
export function boxDistance(a, b) {
|
|
38
|
+
const dx = Math.max(0, Math.max(a.x, b.x) - Math.min(a.x + a.width, b.x + b.width))
|
|
39
|
+
const dy = Math.max(0, Math.max(a.y, b.y) - Math.min(a.y + a.height, b.y + b.height))
|
|
40
|
+
return Math.max(dx, dy)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Merge boxes that are within `gap` px of each other until stable, then merge the closest
|
|
45
|
+
* pairs until at most `maxBoxes` remain. Returns boxes sorted top-to-bottom, left-to-right.
|
|
46
|
+
*/
|
|
47
|
+
export function mergeBoxes(boxes, { gap = DIFF_DEFAULTS.gap, maxBoxes = DIFF_DEFAULTS.maxBoxes } = {}) {
|
|
48
|
+
let list = boxes.map((box) => ({ ...box, pixels: box.pixels ?? 0 }))
|
|
49
|
+
let merged = true
|
|
50
|
+
while (merged) {
|
|
51
|
+
merged = false
|
|
52
|
+
const next = []
|
|
53
|
+
for (const box of list) {
|
|
54
|
+
const hit = next.findIndex((other) => boxDistance(box, other) <= gap)
|
|
55
|
+
if (hit === -1) next.push(box)
|
|
56
|
+
else {
|
|
57
|
+
next[hit] = unionBox(next[hit], box)
|
|
58
|
+
merged = true
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
list = next
|
|
62
|
+
}
|
|
63
|
+
while (maxBoxes > 0 && list.length > maxBoxes) {
|
|
64
|
+
let best = null
|
|
65
|
+
for (let i = 0; i < list.length; i += 1) {
|
|
66
|
+
for (let j = i + 1; j < list.length; j += 1) {
|
|
67
|
+
const cost = area(unionBox(list[i], list[j])) - area(list[i]) - area(list[j])
|
|
68
|
+
if (!best || cost < best.cost) best = { i, j, cost }
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
const joined = unionBox(list[best.i], list[best.j])
|
|
72
|
+
list = list.filter((_, index) => index !== best.i && index !== best.j)
|
|
73
|
+
list.push(joined)
|
|
74
|
+
}
|
|
75
|
+
return list.sort((a, b) => a.y - b.y || a.x - b.x)
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Bounding boxes of changed regions in a boolean mask (`mask[y * width + x]` truthy = changed).
|
|
80
|
+
* A grid pass groups changed cells into 8-connected components, then nearby components merge.
|
|
81
|
+
*/
|
|
82
|
+
export function maskBoxes(mask, width, height, options = {}) {
|
|
83
|
+
const { cell: baseCell, gap, maxBoxes, minPixels } = { ...DIFF_DEFAULTS, ...options }
|
|
84
|
+
let cell = Math.max(1, baseCell)
|
|
85
|
+
for (;;) {
|
|
86
|
+
const cols = Math.ceil(width / cell)
|
|
87
|
+
const rows = Math.ceil(height / cell)
|
|
88
|
+
const cells = new Map()
|
|
89
|
+
for (let y = 0; y < height; y += 1) {
|
|
90
|
+
const row = y * width
|
|
91
|
+
const cy = Math.floor(y / cell)
|
|
92
|
+
for (let x = 0; x < width; x += 1) {
|
|
93
|
+
if (!mask[row + x]) continue
|
|
94
|
+
const key = cy * cols + Math.floor(x / cell)
|
|
95
|
+
const entry = cells.get(key)
|
|
96
|
+
if (!entry) cells.set(key, { minX: x, minY: y, maxX: x, maxY: y, pixels: 1 })
|
|
97
|
+
else {
|
|
98
|
+
if (x < entry.minX) entry.minX = x
|
|
99
|
+
if (x > entry.maxX) entry.maxX = x
|
|
100
|
+
if (y > entry.maxY) entry.maxY = y
|
|
101
|
+
entry.pixels += 1
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
if (!cells.size) return []
|
|
106
|
+
const seen = new Set()
|
|
107
|
+
const components = []
|
|
108
|
+
for (const start of cells.keys()) {
|
|
109
|
+
if (seen.has(start)) continue
|
|
110
|
+
seen.add(start)
|
|
111
|
+
const stack = [start]
|
|
112
|
+
let box = null
|
|
113
|
+
while (stack.length) {
|
|
114
|
+
const key = stack.pop()
|
|
115
|
+
const entry = cells.get(key)
|
|
116
|
+
const part = {
|
|
117
|
+
x: entry.minX,
|
|
118
|
+
y: entry.minY,
|
|
119
|
+
width: entry.maxX - entry.minX + 1,
|
|
120
|
+
height: entry.maxY - entry.minY + 1,
|
|
121
|
+
pixels: entry.pixels,
|
|
122
|
+
}
|
|
123
|
+
box = box ? unionBox(box, part) : part
|
|
124
|
+
const cx = key % cols
|
|
125
|
+
const cy = Math.floor(key / cols)
|
|
126
|
+
for (let dy = -1; dy <= 1; dy += 1) {
|
|
127
|
+
for (let dx = -1; dx <= 1; dx += 1) {
|
|
128
|
+
const nx = cx + dx
|
|
129
|
+
const ny = cy + dy
|
|
130
|
+
if (nx < 0 || ny < 0 || nx >= cols || ny >= rows) continue
|
|
131
|
+
const neighbor = ny * cols + nx
|
|
132
|
+
if (cells.has(neighbor) && !seen.has(neighbor)) {
|
|
133
|
+
seen.add(neighbor)
|
|
134
|
+
stack.push(neighbor)
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
components.push(box)
|
|
140
|
+
}
|
|
141
|
+
// Very noisy diffs: coarsen the grid instead of pairwise-merging thousands of boxes.
|
|
142
|
+
if (components.length > 400 && cell < Math.max(width, height)) {
|
|
143
|
+
cell *= 2
|
|
144
|
+
continue
|
|
145
|
+
}
|
|
146
|
+
const kept = minPixels > 0 ? components.filter((box) => box.pixels >= minPixels) : components
|
|
147
|
+
return mergeBoxes(kept, { gap, maxBoxes })
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/** Copy `src` RGBA into a `width`×`height` canvas (transparent padding). */
|
|
152
|
+
function padTo(src, width, height) {
|
|
153
|
+
if (src.width === width && src.height === height) return src.data
|
|
154
|
+
const out = new Uint8Array(width * height * 4)
|
|
155
|
+
for (let y = 0; y < src.height; y += 1) {
|
|
156
|
+
const from = y * src.width * 4
|
|
157
|
+
out.set(src.data.subarray(from, from + src.width * 4), y * width * 4)
|
|
158
|
+
}
|
|
159
|
+
return out
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
function strokeBox(data, width, height, box, color, pad = 2, thickness = 2) {
|
|
163
|
+
const x0 = Math.max(0, box.x - pad)
|
|
164
|
+
const y0 = Math.max(0, box.y - pad)
|
|
165
|
+
const x1 = Math.min(width - 1, box.x + box.width - 1 + pad)
|
|
166
|
+
const y1 = Math.min(height - 1, box.y + box.height - 1 + pad)
|
|
167
|
+
const put = (x, y) => {
|
|
168
|
+
const i = (y * width + x) * 4
|
|
169
|
+
data[i] = color[0]
|
|
170
|
+
data[i + 1] = color[1]
|
|
171
|
+
data[i + 2] = color[2]
|
|
172
|
+
data[i + 3] = 255
|
|
173
|
+
}
|
|
174
|
+
for (let t = 0; t < thickness; t += 1) {
|
|
175
|
+
for (let x = x0; x <= x1; x += 1) {
|
|
176
|
+
if (y0 + t <= y1) put(x, y0 + t)
|
|
177
|
+
if (y1 - t >= y0) put(x, y1 - t)
|
|
178
|
+
}
|
|
179
|
+
for (let y = y0; y <= y1; y += 1) {
|
|
180
|
+
if (x0 + t <= x1) put(x0 + t, y)
|
|
181
|
+
if (x1 - t >= x0) put(x1 - t, y)
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Compare two decoded RGBA images ({ width, height, data }). Size changes are compared on the
|
|
188
|
+
* larger canvas and the area outside the smaller image counts as changed.
|
|
189
|
+
*/
|
|
190
|
+
export function compareImages(before, after, options = {}) {
|
|
191
|
+
const opts = { ...DIFF_DEFAULTS, ...options }
|
|
192
|
+
const width = Math.max(before.width, after.width)
|
|
193
|
+
const height = Math.max(before.height, after.height)
|
|
194
|
+
const a = padTo(before, width, height)
|
|
195
|
+
const b = padTo(after, width, height)
|
|
196
|
+
const maskImage = new Uint8Array(width * height * 4)
|
|
197
|
+
pixelmatch(a, b, maskImage, width, height, {
|
|
198
|
+
threshold: opts.threshold,
|
|
199
|
+
includeAA: opts.includeAA,
|
|
200
|
+
diffMask: true,
|
|
201
|
+
diffColor: DIFF_COLOR,
|
|
202
|
+
})
|
|
203
|
+
const mask = new Uint8Array(width * height)
|
|
204
|
+
const innerW = Math.min(before.width, after.width)
|
|
205
|
+
const innerH = Math.min(before.height, after.height)
|
|
206
|
+
let diffPixels = 0
|
|
207
|
+
for (let y = 0; y < height; y += 1) {
|
|
208
|
+
for (let x = 0; x < width; x += 1) {
|
|
209
|
+
const p = y * width + x
|
|
210
|
+
if (maskImage[p * 4 + 3] > 0 || x >= innerW || y >= innerH) {
|
|
211
|
+
mask[p] = 1
|
|
212
|
+
diffPixels += 1
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
const boxes = maskBoxes(mask, width, height, opts)
|
|
217
|
+
// Diff image: "after" faded towards white, changed pixels solid red, boxes outlined.
|
|
218
|
+
const out = new Uint8Array(width * height * 4)
|
|
219
|
+
for (let p = 0; p < width * height; p += 1) {
|
|
220
|
+
const i = p * 4
|
|
221
|
+
if (mask[p]) {
|
|
222
|
+
out[i] = DIFF_COLOR[0]
|
|
223
|
+
out[i + 1] = DIFF_COLOR[1]
|
|
224
|
+
out[i + 2] = DIFF_COLOR[2]
|
|
225
|
+
out[i + 3] = 255
|
|
226
|
+
continue
|
|
227
|
+
}
|
|
228
|
+
const alpha = b[i + 3] / 255
|
|
229
|
+
for (let c = 0; c < 3; c += 1) {
|
|
230
|
+
const value = b[i + c] * alpha + 255 * (1 - alpha)
|
|
231
|
+
out[i + c] = Math.round(255 - (255 - value) * 0.25)
|
|
232
|
+
}
|
|
233
|
+
out[i + 3] = 255
|
|
234
|
+
}
|
|
235
|
+
for (const box of boxes) strokeBox(out, width, height, box, BOX_COLOR)
|
|
236
|
+
return {
|
|
237
|
+
width,
|
|
238
|
+
height,
|
|
239
|
+
beforeSize: [before.width, before.height],
|
|
240
|
+
afterSize: [after.width, after.height],
|
|
241
|
+
diffPixels,
|
|
242
|
+
diffRatio: width * height ? Number((diffPixels / (width * height)).toFixed(6)) : 0,
|
|
243
|
+
boxes,
|
|
244
|
+
diff: { width, height, data: out },
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
export const decodePng = (buffer) => {
|
|
249
|
+
const png = PNG.sync.read(buffer)
|
|
250
|
+
return { width: png.width, height: png.height, data: png.data }
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
export const encodePng = ({ width, height, data }) => {
|
|
254
|
+
const png = new PNG({ width, height })
|
|
255
|
+
png.data = Buffer.from(data.buffer, data.byteOffset, data.byteLength)
|
|
256
|
+
return PNG.sync.write(png)
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/** Compare two PNG buffers; returns the comparison plus the encoded diff PNG. */
|
|
260
|
+
export function comparePngs(beforeBuffer, afterBuffer, options = {}) {
|
|
261
|
+
const result = compareImages(decodePng(beforeBuffer), decodePng(afterBuffer), options)
|
|
262
|
+
return { ...result, diffPng: encodePng(result.diff) }
|
|
263
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import type { ReviewCheck, ReviewItem, ReviewSnapshots, SnapshotFrame } from '../shared/types'
|
|
2
|
+
import type { UsageIndex } from '../tokens/usage.mjs'
|
|
3
|
+
import type { Renderer } from './render.mjs'
|
|
4
|
+
|
|
5
|
+
export declare const SNAPSHOT_DIR: string
|
|
6
|
+
export declare const SNAPSHOT_KINDS: Array<'before' | 'after' | 'diff'>
|
|
7
|
+
export declare function itemDirName(id: string): string
|
|
8
|
+
export declare function frameKey(frame: { design: string; page: string; frame: string }): string
|
|
9
|
+
export declare function snapshotImagePath(
|
|
10
|
+
root: string,
|
|
11
|
+
design: string,
|
|
12
|
+
itemId: string,
|
|
13
|
+
key: string,
|
|
14
|
+
kind: string,
|
|
15
|
+
): string | null
|
|
16
|
+
export declare function affectedTargets(
|
|
17
|
+
item: ReviewItem,
|
|
18
|
+
index: UsageIndex | null,
|
|
19
|
+
): Array<{ design: string; page?: string; frame?: string; reason: string }>
|
|
20
|
+
export declare function sortFrames(frames: SnapshotFrame[]): SnapshotFrame[]
|
|
21
|
+
|
|
22
|
+
type RenderOptions = { root?: string; url?: string; configFile?: string; renderer?: Renderer }
|
|
23
|
+
|
|
24
|
+
export type BaselineClaim = {
|
|
25
|
+
design: string
|
|
26
|
+
/** `snapshots.capturingSince` written on the claimed items. */
|
|
27
|
+
token: string
|
|
28
|
+
claimed: string[]
|
|
29
|
+
/** Items another run is capturing right now. */
|
|
30
|
+
inProgress: string[]
|
|
31
|
+
/** Requested items that are archived or already have a baseline. */
|
|
32
|
+
skipped: string[]
|
|
33
|
+
}
|
|
34
|
+
export type CaptureResult = {
|
|
35
|
+
design: string
|
|
36
|
+
captured: Array<{ id: string; frames: number; errors: number; missing?: unknown[]; truncated?: number }>
|
|
37
|
+
skipped: string[]
|
|
38
|
+
inProgress?: string[]
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export declare function claimBaselines(options: {
|
|
42
|
+
root?: string
|
|
43
|
+
design: string
|
|
44
|
+
itemIds?: string[]
|
|
45
|
+
force?: boolean
|
|
46
|
+
now?: number
|
|
47
|
+
}): BaselineClaim
|
|
48
|
+
export declare function waitForBaselines(options: {
|
|
49
|
+
root?: string
|
|
50
|
+
design: string
|
|
51
|
+
itemIds?: string[]
|
|
52
|
+
timeoutMs?: number
|
|
53
|
+
pollMs?: number
|
|
54
|
+
}): Promise<{ design: string; capturing: string[] }>
|
|
55
|
+
export declare function captureBaselines(
|
|
56
|
+
options: RenderOptions & {
|
|
57
|
+
design: string
|
|
58
|
+
itemIds?: string[]
|
|
59
|
+
force?: boolean
|
|
60
|
+
maxFrames?: number
|
|
61
|
+
index?: UsageIndex | null
|
|
62
|
+
claim?: BaselineClaim
|
|
63
|
+
},
|
|
64
|
+
): Promise<CaptureResult>
|
|
65
|
+
/** Baseline record for an item a tool operation is about to write (not in the ledger yet). */
|
|
66
|
+
export declare function captureItemBaseline(
|
|
67
|
+
options: RenderOptions & { item: ReviewItem; maxFrames?: number; index?: UsageIndex | null },
|
|
68
|
+
): Promise<ReviewSnapshots>
|
|
69
|
+
export declare function emptyCaptures(result: CaptureResult): CaptureResult['captured']
|
|
70
|
+
export declare function emptyCaptureError(result: CaptureResult): string | null
|
|
71
|
+
export declare function compareSnapshots(
|
|
72
|
+
options: RenderOptions & { design: string; itemIds?: string[]; diffOptions?: Record<string, unknown> },
|
|
73
|
+
): Promise<{
|
|
74
|
+
design: string
|
|
75
|
+
compared: Array<{
|
|
76
|
+
id: string
|
|
77
|
+
frames: number
|
|
78
|
+
changed: number
|
|
79
|
+
accepted: number
|
|
80
|
+
rejected: number
|
|
81
|
+
errors: number
|
|
82
|
+
/** The baseline was recaptured while comparing; nothing was written. */
|
|
83
|
+
superseded?: boolean
|
|
84
|
+
}>
|
|
85
|
+
}>
|
|
86
|
+
export {
|
|
87
|
+
isCapturingBaseline,
|
|
88
|
+
snapshotArchiveHold,
|
|
89
|
+
snapshotCheck,
|
|
90
|
+
summarizeFrames,
|
|
91
|
+
} from '../shared/snapshotCheck.mjs'
|
|
92
|
+
export declare function decideSnapshots(options: {
|
|
93
|
+
root?: string
|
|
94
|
+
design: string
|
|
95
|
+
itemId: string
|
|
96
|
+
frames?: string[]
|
|
97
|
+
decision: 'accepted' | 'rejected'
|
|
98
|
+
reason?: string
|
|
99
|
+
}): { item: ReviewItem; frames: string[]; check: ReviewCheck }
|
|
100
|
+
export declare function snapshotView(
|
|
101
|
+
root: string,
|
|
102
|
+
design: string,
|
|
103
|
+
itemId: string,
|
|
104
|
+
base?: string,
|
|
105
|
+
): Partial<ReviewSnapshots> & {
|
|
106
|
+
design: string
|
|
107
|
+
item: string
|
|
108
|
+
check: ReviewCheck
|
|
109
|
+
frames: Array<SnapshotFrame & { urls: Partial<Record<'before' | 'after' | 'diff', string>> }>
|
|
110
|
+
}
|