openplanr 3.1.1 → 3.3.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/CHANGELOG.md +69 -0
- package/dist/cli/commands/groups/delivery.d.ts.map +1 -1
- package/dist/cli/commands/groups/delivery.js +2 -0
- package/dist/cli/commands/groups/delivery.js.map +1 -1
- package/dist/cli/commands/planning-artifacts.d.ts.map +1 -1
- package/dist/cli/commands/planning-artifacts.js +22 -12
- package/dist/cli/commands/planning-artifacts.js.map +1 -1
- package/dist/cli/commands/ship.d.ts +3 -0
- package/dist/cli/commands/ship.d.ts.map +1 -0
- package/dist/cli/commands/ship.js +65 -0
- package/dist/cli/commands/ship.js.map +1 -0
- package/dist/cli/commands/spec.d.ts +2 -1
- package/dist/cli/commands/spec.d.ts.map +1 -1
- package/dist/cli/commands/spec.js +45 -5
- package/dist/cli/commands/spec.js.map +1 -1
- package/dist/dashboard/.vite/manifest.json +1 -1
- package/dist/dashboard/assets/index-B_96uzCl.js +572 -0
- package/dist/dashboard/assets/index-B_96uzCl.js.map +1 -0
- package/dist/dashboard/dashboard-manifest.json +10 -10
- package/dist/dashboard/index.html +1 -1
- package/dist/models/schema.d.ts +39 -23
- package/dist/models/schema.d.ts.map +1 -1
- package/dist/models/schema.js +19 -12
- package/dist/models/schema.js.map +1 -1
- package/dist/models/types.d.ts +6 -0
- package/dist/models/types.d.ts.map +1 -1
- package/dist/services/claude-plugin-service.d.ts +5 -0
- package/dist/services/claude-plugin-service.d.ts.map +1 -1
- package/dist/services/claude-plugin-service.js +18 -2
- package/dist/services/claude-plugin-service.js.map +1 -1
- package/dist/services/codex-plugin-service.d.ts.map +1 -1
- package/dist/services/codex-plugin-service.js +11 -3
- package/dist/services/codex-plugin-service.js.map +1 -1
- package/dist/services/id-service.d.ts +1 -5
- package/dist/services/id-service.d.ts.map +1 -1
- package/dist/services/id-service.js +1 -34
- package/dist/services/id-service.js.map +1 -1
- package/dist/services/runtime-manager/codex-discovery.d.ts +1 -3
- package/dist/services/runtime-manager/codex-discovery.d.ts.map +1 -1
- package/dist/services/runtime-manager/codex-discovery.js +3 -16
- package/dist/services/runtime-manager/codex-discovery.js.map +1 -1
- package/dist/services/runtime-manager/doctor.d.ts +25 -0
- package/dist/services/runtime-manager/doctor.d.ts.map +1 -1
- package/dist/services/runtime-manager/doctor.js +480 -0
- package/dist/services/runtime-manager/doctor.js.map +1 -1
- package/dist/services/runtime-manager/errors.d.ts +12 -0
- package/dist/services/runtime-manager/errors.d.ts.map +1 -0
- package/dist/services/runtime-manager/errors.js +14 -0
- package/dist/services/runtime-manager/errors.js.map +1 -0
- package/dist/services/runtime-manager/global-state.d.ts +7 -0
- package/dist/services/runtime-manager/global-state.d.ts.map +1 -1
- package/dist/services/runtime-manager/global-state.js +116 -0
- package/dist/services/runtime-manager/global-state.js.map +1 -1
- package/dist/services/runtime-manager/host-version-probe.d.ts +8 -0
- package/dist/services/runtime-manager/host-version-probe.d.ts.map +1 -0
- package/dist/services/runtime-manager/host-version-probe.js +14 -0
- package/dist/services/runtime-manager/host-version-probe.js.map +1 -0
- package/dist/services/runtime-manager/install-plan.d.ts +25 -0
- package/dist/services/runtime-manager/install-plan.d.ts.map +1 -1
- package/dist/services/runtime-manager/install-plan.js +305 -0
- package/dist/services/runtime-manager/install-plan.js.map +1 -1
- package/dist/services/runtime-manager/inventory.d.ts +6 -0
- package/dist/services/runtime-manager/inventory.d.ts.map +1 -1
- package/dist/services/runtime-manager/inventory.js +16 -1
- package/dist/services/runtime-manager/inventory.js.map +1 -1
- package/dist/services/runtime-manager/legacy-adapters.d.ts +9 -0
- package/dist/services/runtime-manager/legacy-adapters.d.ts.map +1 -0
- package/dist/services/runtime-manager/legacy-adapters.js +187 -0
- package/dist/services/runtime-manager/legacy-adapters.js.map +1 -0
- package/dist/services/runtime-manager/paths.d.ts +18 -0
- package/dist/services/runtime-manager/paths.d.ts.map +1 -0
- package/dist/services/runtime-manager/paths.js +83 -0
- package/dist/services/runtime-manager/paths.js.map +1 -0
- package/dist/services/runtime-manager/runtime-package.d.ts +21 -0
- package/dist/services/runtime-manager/runtime-package.d.ts.map +1 -1
- package/dist/services/runtime-manager/runtime-package.js +77 -0
- package/dist/services/runtime-manager/runtime-package.js.map +1 -1
- package/dist/services/runtime-manager/storage.d.ts +47 -0
- package/dist/services/runtime-manager/storage.d.ts.map +1 -0
- package/dist/services/runtime-manager/storage.js +604 -0
- package/dist/services/runtime-manager/storage.js.map +1 -0
- package/dist/services/runtime-manager-service.d.ts +7 -17
- package/dist/services/runtime-manager-service.d.ts.map +1 -1
- package/dist/services/runtime-manager-service.js +32 -1695
- package/dist/services/runtime-manager-service.js.map +1 -1
- package/dist/services/ship-checks/changes.d.ts +24 -0
- package/dist/services/ship-checks/changes.d.ts.map +1 -0
- package/dist/services/ship-checks/changes.js +135 -0
- package/dist/services/ship-checks/changes.js.map +1 -0
- package/dist/services/ship-checks/contract.d.ts +93 -0
- package/dist/services/ship-checks/contract.d.ts.map +1 -0
- package/dist/services/ship-checks/contract.js +7 -0
- package/dist/services/ship-checks/contract.js.map +1 -0
- package/dist/services/ship-checks/coverage.d.ts +4 -0
- package/dist/services/ship-checks/coverage.d.ts.map +1 -0
- package/dist/services/ship-checks/coverage.js +113 -0
- package/dist/services/ship-checks/coverage.js.map +1 -0
- package/dist/services/ship-checks/discover.d.ts +10 -0
- package/dist/services/ship-checks/discover.d.ts.map +1 -0
- package/dist/services/ship-checks/discover.js +253 -0
- package/dist/services/ship-checks/discover.js.map +1 -0
- package/dist/services/ship-checks/glob.d.ts +5 -0
- package/dist/services/ship-checks/glob.d.ts.map +1 -0
- package/dist/services/ship-checks/glob.js +39 -0
- package/dist/services/ship-checks/glob.js.map +1 -0
- package/dist/services/ship-checks/hooks.d.ts +7 -0
- package/dist/services/ship-checks/hooks.d.ts.map +1 -0
- package/dist/services/ship-checks/hooks.js +65 -0
- package/dist/services/ship-checks/hooks.js.map +1 -0
- package/dist/services/ship-checks/packages.d.ts +29 -0
- package/dist/services/ship-checks/packages.d.ts.map +1 -0
- package/dist/services/ship-checks/packages.js +197 -0
- package/dist/services/ship-checks/packages.js.map +1 -0
- package/dist/services/ship-checks/related-tests.d.ts +13 -0
- package/dist/services/ship-checks/related-tests.d.ts.map +1 -0
- package/dist/services/ship-checks/related-tests.js +73 -0
- package/dist/services/ship-checks/related-tests.js.map +1 -0
- package/dist/services/ship-checks/scope.d.ts +8 -0
- package/dist/services/ship-checks/scope.d.ts.map +1 -0
- package/dist/services/ship-checks/scope.js +66 -0
- package/dist/services/ship-checks/scope.js.map +1 -0
- package/dist/services/ship-checks/task-requirements.d.ts +14 -0
- package/dist/services/ship-checks/task-requirements.d.ts.map +1 -0
- package/dist/services/ship-checks/task-requirements.js +145 -0
- package/dist/services/ship-checks/task-requirements.js.map +1 -0
- package/dist/services/ship-checks/workflows.d.ts +21 -0
- package/dist/services/ship-checks/workflows.d.ts.map +1 -0
- package/dist/services/ship-checks/workflows.js +208 -0
- package/dist/services/ship-checks/workflows.js.map +1 -0
- package/dist/services/spec-service.d.ts +18 -0
- package/dist/services/spec-service.d.ts.map +1 -1
- package/dist/services/spec-service.js +174 -9
- package/dist/services/spec-service.js.map +1 -1
- package/dist/services/template-service.d.ts +2 -0
- package/dist/services/template-service.d.ts.map +1 -1
- package/dist/services/template-service.js +4 -0
- package/dist/services/template-service.js.map +1 -1
- package/dist/templates/spec/spec-shaped.md.hbs +1 -1
- package/dist/templates/spec/spec.md.hbs +2 -2
- package/dist/utils/slugify.d.ts +1 -8
- package/dist/utils/slugify.d.ts.map +1 -1
- package/dist/utils/slugify.js +1 -25
- package/dist/utils/slugify.js.map +1 -1
- package/docs/CLI.md +96 -2
- package/lib/backlog-item.d.mts +49 -0
- package/lib/backlog-item.mjs +339 -0
- package/lib/host-packages/adapter-registry.json +5 -5
- package/lib/host-packages/capability-map.json +3 -3
- package/lib/host-packages/claude/.claude-plugin/marketplace.json +2 -2
- package/lib/host-packages/claude/openplanr/.claude-plugin/plugin.json +1 -1
- package/lib/host-packages/claude/openplanr/.openplanr-content.json +134 -94
- package/lib/host-packages/claude/openplanr/CONNECTORS.md +4 -6
- package/lib/host-packages/claude/openplanr/README.md +1 -1
- package/lib/host-packages/claude/openplanr/agents/planr-qa.md +5 -3
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-artifact-shell.mjs +1 -1
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-chunked-workspace-client.mjs +1 -1
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-document.mjs +471 -80
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-handoff.mjs +2 -2
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-resource-pack.mjs +1 -1
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-review.mjs +45 -4
- package/lib/host-packages/{cursor/openplanr/runtime/design/scripts/design-runtime-support-e34c388a8e59.mjs → claude/openplanr/runtime/design/scripts/design-runtime-support-25485dbf1cb2.mjs} +1 -1
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-share.mjs +8 -5
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-shared-artifact-support-dependencies-design-support-protocol-contracts-3d9b1a86.mjs +138 -12
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-shared-artifact-support-protocol-contracts-ea2cd15e.mjs +1 -1
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/{design-shared-protocol-contracts-31a760fc.mjs → design-shared-protocol-contracts-b5f28f94.mjs} +413 -45
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-upload-spool.mjs +1 -1
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design.mjs +482 -79
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +32 -32
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/02-artifact-review-ui.js +23 -23
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/03-protocol-contracts.js +322 -45
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/06-artifact-review-ui.js +12 -12
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/08-artifact-review-ui.js +47 -14
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources.json +11 -10
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/package.json +4 -3
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.css +16 -11
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/01-module-runtime.js +7 -11
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/02-react.js +165 -276
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/03-react-dom-client-fiber-foundations.js +494 -967
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/04-react-dom-client-reconciliation-hooks.js +346 -678
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/05-react-dom-client-render-phases.js +382 -810
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/06-react-dom-client-commit-effects.js +406 -730
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/07-react-dom-client-work-loop-scheduling.js +259 -522
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/08-react-dom-client-dom-events-properties-hydration.js +585 -937
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/09-react-dom-client-public-roots.js +119 -244
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/10-react.js +7 -17
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/11-artifact-review-ui.js +3 -4
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/12-protocol-contracts.js +285 -0
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/13-design-review-experience.js +2773 -0
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/14-studio-shell.js +134 -0
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/15-canvas-engine.js +2207 -0
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/16-design-review-experience.js +16 -0
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/17-studio-shell.js +8 -0
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/18-interface-primitives.js +3883 -0
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/19-interface-primitives.js +966 -0
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/{16-studio-shell.js → 20-studio-shell.js} +122 -227
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/21-design-studio.js +1597 -0
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources.json +101 -47
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/package.json +6 -2
- package/lib/host-packages/{openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0 → claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.22.0}/design-document.schema.json +207 -7
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.22.0/design-review-bundle.schema.json +822 -0
- package/lib/host-packages/claude/openplanr/runtime/plan/scripts/design-protocol-contracts.mjs +324 -45
- package/lib/host-packages/claude/openplanr/runtime/plan/scripts/design.mjs +73 -12
- package/lib/host-packages/claude/openplanr/runtime/plan/scripts/runtime/packages/protocol/package.json +6 -2
- package/lib/host-packages/claude/openplanr/skills/connect/references/connectors.md +4 -6
- package/lib/host-packages/claude/openplanr/skills/design/SKILL.md +12 -0
- package/lib/host-packages/claude/openplanr/skills/design/references/craft.md +14 -3
- package/lib/host-packages/claude/openplanr/skills/design/references/design-system.md +48 -1
- package/lib/host-packages/claude/openplanr/skills/design/references/discovery.md +18 -4
- package/lib/host-packages/claude/openplanr/skills/design/references/generation.md +133 -2
- package/lib/host-packages/claude/openplanr/skills/design/references/hosted-canvas.md +62 -0
- package/lib/host-packages/claude/openplanr/skills/design/references/review.md +46 -1
- package/lib/host-packages/claude/openplanr/skills/design/references/utilities.md +17 -1
- package/lib/host-packages/claude/openplanr/skills/design/schemas/design-document.schema.json +207 -7
- package/lib/host-packages/claude/openplanr/skills/design-loop/references/craft.md +14 -3
- package/lib/host-packages/claude/openplanr/skills/design-loop/references/design-system.md +48 -1
- package/lib/host-packages/claude/openplanr/skills/design-loop/references/discovery.md +18 -4
- package/lib/host-packages/claude/openplanr/skills/design-loop/references/generation.md +133 -2
- package/lib/host-packages/claude/openplanr/skills/design-loop/references/review.md +46 -1
- package/lib/host-packages/claude/openplanr/skills/design-loop/references/utilities.md +17 -1
- package/lib/host-packages/claude/openplanr/skills/design-loop/schemas/design-document.schema.json +207 -7
- package/lib/host-packages/claude/openplanr/skills/design-review/references/craft.md +14 -3
- package/lib/host-packages/claude/openplanr/skills/design-review/references/design-system.md +48 -1
- package/lib/host-packages/claude/openplanr/skills/design-review/references/discovery.md +18 -4
- package/lib/host-packages/claude/openplanr/skills/design-review/references/generation.md +133 -2
- package/lib/host-packages/claude/openplanr/skills/design-review/references/review.md +46 -1
- package/lib/host-packages/claude/openplanr/skills/design-review/references/utilities.md +17 -1
- package/lib/host-packages/claude/openplanr/skills/design-review/schemas/design-document.schema.json +207 -7
- package/lib/host-packages/claude/openplanr/skills/investigate/SKILL.md +11 -2
- package/lib/host-packages/claude/openplanr/skills/investigate/references/findings.md +92 -0
- package/lib/host-packages/claude/openplanr/skills/investigate/scripts/backlog-item.mjs +339 -0
- package/lib/host-packages/claude/openplanr/skills/plan/SKILL.md +24 -11
- package/lib/host-packages/claude/openplanr/skills/plan/schemas/design-document.schema.json +207 -7
- package/lib/host-packages/claude/openplanr/skills/share/references/connectors.md +4 -6
- package/lib/host-packages/claude/openplanr/skills/ship/SKILL.md +46 -14
- package/lib/host-packages/claude/openplanr/skills/ship/references/findings.md +92 -0
- package/lib/host-packages/claude/openplanr/skills/ship/references/result-contract.md +3 -1
- package/lib/host-packages/claude/openplanr/skills/ship/scripts/backlog-item.mjs +339 -0
- package/lib/host-packages/claude/openplanr/skills/spec/SKILL.md +6 -0
- package/lib/host-packages/claude/openplanr/skills/spec/references/specification-contract.md +3 -1
- package/lib/host-packages/claude/openplanr/skills/sprint/references/connectors.md +4 -6
- package/lib/host-packages/claude/openplanr/skills/status/references/connectors.md +4 -6
- package/lib/host-packages/claude/openplanr/skills/sync/references/connectors.md +4 -6
- package/lib/host-packages/cursor/openplanr/.openplanr-content.json +132 -92
- package/lib/host-packages/cursor/openplanr/CONNECTORS.md +4 -6
- package/lib/host-packages/cursor/openplanr/manifest.json +1 -1
- package/lib/host-packages/cursor/openplanr/rules/planr-connect/references/connectors.md +4 -6
- package/lib/host-packages/cursor/openplanr/rules/planr-design/references/craft.md +14 -3
- package/lib/host-packages/cursor/openplanr/rules/planr-design/references/design-system.md +48 -1
- package/lib/host-packages/cursor/openplanr/rules/planr-design/references/discovery.md +18 -4
- package/lib/host-packages/cursor/openplanr/rules/planr-design/references/generation.md +133 -2
- package/lib/host-packages/cursor/openplanr/rules/planr-design/references/hosted-canvas.md +62 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-design/references/review.md +46 -1
- package/lib/host-packages/cursor/openplanr/rules/planr-design/references/utilities.md +17 -1
- package/lib/host-packages/cursor/openplanr/rules/planr-design/schemas/design-document.schema.json +207 -7
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/references/craft.md +14 -3
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/references/design-system.md +48 -1
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/references/discovery.md +18 -4
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/references/generation.md +133 -2
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/references/review.md +46 -1
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/references/utilities.md +17 -1
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/schemas/design-document.schema.json +207 -7
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/references/craft.md +14 -3
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/references/design-system.md +48 -1
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/references/discovery.md +18 -4
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/references/generation.md +133 -2
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/references/review.md +46 -1
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/references/utilities.md +17 -1
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/schemas/design-document.schema.json +207 -7
- package/lib/host-packages/cursor/openplanr/rules/planr-design.mdc +12 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-investigate/references/findings.md +92 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-investigate/scripts/backlog-item.mjs +339 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-investigate.mdc +11 -2
- package/lib/host-packages/cursor/openplanr/rules/planr-plan/schemas/design-document.schema.json +207 -7
- package/lib/host-packages/cursor/openplanr/rules/planr-plan.mdc +24 -11
- package/lib/host-packages/cursor/openplanr/rules/planr-share/references/connectors.md +4 -6
- package/lib/host-packages/cursor/openplanr/rules/planr-ship/references/findings.md +92 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-ship/references/result-contract.md +3 -1
- package/lib/host-packages/cursor/openplanr/rules/planr-ship/scripts/backlog-item.mjs +339 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-ship.mdc +46 -14
- package/lib/host-packages/cursor/openplanr/rules/planr-spec/references/specification-contract.md +3 -1
- package/lib/host-packages/cursor/openplanr/rules/planr-spec.mdc +6 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-sprint/references/connectors.md +4 -6
- package/lib/host-packages/cursor/openplanr/rules/planr-status/references/connectors.md +4 -6
- package/lib/host-packages/cursor/openplanr/rules/planr-sync/references/connectors.md +4 -6
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-artifact-shell.mjs +1 -1
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-chunked-workspace-client.mjs +1 -1
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-document.mjs +471 -80
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-handoff.mjs +2 -2
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-resource-pack.mjs +1 -1
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-review.mjs +45 -4
- package/lib/host-packages/{openai/openplanr/runtime/design/scripts/design-runtime-support-e34c388a8e59.mjs → cursor/openplanr/runtime/design/scripts/design-runtime-support-25485dbf1cb2.mjs} +1 -1
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-share.mjs +8 -5
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-shared-artifact-support-dependencies-design-support-protocol-contracts-3d9b1a86.mjs +138 -12
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-shared-artifact-support-protocol-contracts-ea2cd15e.mjs +1 -1
- package/lib/host-packages/{openai/openplanr/runtime/design/scripts/design-shared-protocol-contracts-31a760fc.mjs → cursor/openplanr/runtime/design/scripts/design-shared-protocol-contracts-b5f28f94.mjs} +413 -45
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-upload-spool.mjs +1 -1
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design.mjs +482 -79
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +32 -32
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/02-artifact-review-ui.js +23 -23
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/03-protocol-contracts.js +322 -45
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/06-artifact-review-ui.js +12 -12
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/08-artifact-review-ui.js +47 -14
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources.json +11 -10
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/package.json +4 -3
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.css +16 -11
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/01-module-runtime.js +7 -11
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/02-react.js +165 -276
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/03-react-dom-client-fiber-foundations.js +494 -967
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/04-react-dom-client-reconciliation-hooks.js +346 -678
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/05-react-dom-client-render-phases.js +382 -810
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/06-react-dom-client-commit-effects.js +406 -730
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/07-react-dom-client-work-loop-scheduling.js +259 -522
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/08-react-dom-client-dom-events-properties-hydration.js +585 -937
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/09-react-dom-client-public-roots.js +119 -244
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/10-react.js +7 -17
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/11-artifact-review-ui.js +3 -4
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/12-protocol-contracts.js +285 -0
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/13-design-review-experience.js +2773 -0
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/14-studio-shell.js +134 -0
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/15-canvas-engine.js +2207 -0
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/16-design-review-experience.js +16 -0
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/17-studio-shell.js +8 -0
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/18-interface-primitives.js +3883 -0
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/19-interface-primitives.js +966 -0
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/{16-studio-shell.js → 20-studio-shell.js} +122 -227
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/21-design-studio.js +1597 -0
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources.json +101 -47
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/package.json +6 -2
- package/lib/host-packages/{claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0 → cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.22.0}/design-document.schema.json +207 -7
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.22.0/design-review-bundle.schema.json +822 -0
- package/lib/host-packages/cursor/openplanr/runtime/plan/scripts/design-protocol-contracts.mjs +324 -45
- package/lib/host-packages/cursor/openplanr/runtime/plan/scripts/design.mjs +73 -12
- package/lib/host-packages/cursor/openplanr/runtime/plan/scripts/runtime/packages/protocol/package.json +6 -2
- package/lib/host-packages/openai/.claude-plugin/marketplace.json +2 -2
- package/lib/host-packages/openai/openplanr/.codex-plugin/plugin.json +1 -1
- package/lib/host-packages/openai/openplanr/.openplanr-content.json +139 -99
- package/lib/host-packages/openai/openplanr/CONNECTORS.md +4 -6
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-artifact-shell.mjs +1 -1
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-chunked-workspace-client.mjs +1 -1
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-document.mjs +471 -80
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-handoff.mjs +2 -2
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-resource-pack.mjs +1 -1
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-review.mjs +45 -4
- package/lib/host-packages/{claude/openplanr/runtime/design/scripts/design-runtime-support-e34c388a8e59.mjs → openai/openplanr/runtime/design/scripts/design-runtime-support-25485dbf1cb2.mjs} +1 -1
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-share.mjs +8 -5
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-shared-artifact-support-dependencies-design-support-protocol-contracts-3d9b1a86.mjs +138 -12
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-shared-artifact-support-protocol-contracts-ea2cd15e.mjs +1 -1
- package/lib/host-packages/{cursor/openplanr/runtime/design/scripts/design-shared-protocol-contracts-31a760fc.mjs → openai/openplanr/runtime/design/scripts/design-shared-protocol-contracts-b5f28f94.mjs} +413 -45
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-upload-spool.mjs +1 -1
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design.mjs +482 -79
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +32 -32
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/02-artifact-review-ui.js +23 -23
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/03-protocol-contracts.js +322 -45
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/06-artifact-review-ui.js +12 -12
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/08-artifact-review-ui.js +47 -14
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources.json +11 -10
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/package.json +4 -3
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.css +16 -11
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/01-module-runtime.js +7 -11
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/02-react.js +165 -276
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/03-react-dom-client-fiber-foundations.js +494 -967
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/04-react-dom-client-reconciliation-hooks.js +346 -678
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/05-react-dom-client-render-phases.js +382 -810
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/06-react-dom-client-commit-effects.js +406 -730
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/07-react-dom-client-work-loop-scheduling.js +259 -522
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/08-react-dom-client-dom-events-properties-hydration.js +585 -937
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/09-react-dom-client-public-roots.js +119 -244
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/10-react.js +7 -17
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/11-artifact-review-ui.js +3 -4
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/12-protocol-contracts.js +285 -0
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/13-design-review-experience.js +2773 -0
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/14-studio-shell.js +134 -0
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/15-canvas-engine.js +2207 -0
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/16-design-review-experience.js +16 -0
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/17-studio-shell.js +8 -0
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/18-interface-primitives.js +3883 -0
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/19-interface-primitives.js +966 -0
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/{16-studio-shell.js → 20-studio-shell.js} +122 -227
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/21-design-studio.js +1597 -0
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources.json +101 -47
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/package.json +6 -2
- package/lib/host-packages/{cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0 → openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.22.0}/design-document.schema.json +207 -7
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.22.0/design-review-bundle.schema.json +822 -0
- package/lib/host-packages/openai/openplanr/runtime/plan/scripts/design-protocol-contracts.mjs +324 -45
- package/lib/host-packages/openai/openplanr/runtime/plan/scripts/design.mjs +73 -12
- package/lib/host-packages/openai/openplanr/runtime/plan/scripts/runtime/packages/protocol/package.json +6 -2
- package/lib/host-packages/openai/openplanr/skills/connect/references/connectors.md +4 -6
- package/lib/host-packages/openai/openplanr/skills/design/SKILL.md +12 -0
- package/lib/host-packages/openai/openplanr/skills/design/openplanr.skill.json +11 -0
- package/lib/host-packages/openai/openplanr/skills/design/references/craft.md +14 -3
- package/lib/host-packages/openai/openplanr/skills/design/references/design-system.md +48 -1
- package/lib/host-packages/openai/openplanr/skills/design/references/discovery.md +18 -4
- package/lib/host-packages/openai/openplanr/skills/design/references/generation.md +133 -2
- package/lib/host-packages/openai/openplanr/skills/design/references/hosted-canvas.md +62 -0
- package/lib/host-packages/openai/openplanr/skills/design/references/review.md +46 -1
- package/lib/host-packages/openai/openplanr/skills/design/references/utilities.md +17 -1
- package/lib/host-packages/openai/openplanr/skills/design/schemas/design-document.schema.json +207 -7
- package/lib/host-packages/openai/openplanr/skills/design-loop/references/craft.md +14 -3
- package/lib/host-packages/openai/openplanr/skills/design-loop/references/design-system.md +48 -1
- package/lib/host-packages/openai/openplanr/skills/design-loop/references/discovery.md +18 -4
- package/lib/host-packages/openai/openplanr/skills/design-loop/references/generation.md +133 -2
- package/lib/host-packages/openai/openplanr/skills/design-loop/references/review.md +46 -1
- package/lib/host-packages/openai/openplanr/skills/design-loop/references/utilities.md +17 -1
- package/lib/host-packages/openai/openplanr/skills/design-loop/schemas/design-document.schema.json +207 -7
- package/lib/host-packages/openai/openplanr/skills/design-review/references/craft.md +14 -3
- package/lib/host-packages/openai/openplanr/skills/design-review/references/design-system.md +48 -1
- package/lib/host-packages/openai/openplanr/skills/design-review/references/discovery.md +18 -4
- package/lib/host-packages/openai/openplanr/skills/design-review/references/generation.md +133 -2
- package/lib/host-packages/openai/openplanr/skills/design-review/references/review.md +46 -1
- package/lib/host-packages/openai/openplanr/skills/design-review/references/utilities.md +17 -1
- package/lib/host-packages/openai/openplanr/skills/design-review/schemas/design-document.schema.json +207 -7
- package/lib/host-packages/openai/openplanr/skills/investigate/SKILL.md +11 -2
- package/lib/host-packages/openai/openplanr/skills/investigate/agents/openai.yaml +1 -1
- package/lib/host-packages/openai/openplanr/skills/investigate/openplanr.skill.json +23 -1
- package/lib/host-packages/openai/openplanr/skills/investigate/references/findings.md +92 -0
- package/lib/host-packages/openai/openplanr/skills/investigate/scripts/backlog-item.mjs +339 -0
- package/lib/host-packages/openai/openplanr/skills/plan/SKILL.md +24 -11
- package/lib/host-packages/openai/openplanr/skills/plan/openplanr.skill.json +1 -1
- package/lib/host-packages/openai/openplanr/skills/plan/schemas/design-document.schema.json +207 -7
- package/lib/host-packages/openai/openplanr/skills/share/references/connectors.md +4 -6
- package/lib/host-packages/openai/openplanr/skills/ship/SKILL.md +46 -14
- package/lib/host-packages/openai/openplanr/skills/ship/agents/openai.yaml +1 -1
- package/lib/host-packages/openai/openplanr/skills/ship/openplanr.skill.json +23 -1
- package/lib/host-packages/openai/openplanr/skills/ship/references/findings.md +92 -0
- package/lib/host-packages/openai/openplanr/skills/ship/references/result-contract.md +3 -1
- package/lib/host-packages/openai/openplanr/skills/ship/scripts/backlog-item.mjs +339 -0
- package/lib/host-packages/openai/openplanr/skills/spec/SKILL.md +6 -0
- package/lib/host-packages/openai/openplanr/skills/spec/openplanr.skill.json +1 -1
- package/lib/host-packages/openai/openplanr/skills/spec/references/specification-contract.md +3 -1
- package/lib/host-packages/openai/openplanr/skills/sprint/references/connectors.md +4 -6
- package/lib/host-packages/openai/openplanr/skills/status/references/connectors.md +4 -6
- package/lib/host-packages/openai/openplanr/skills/sync/references/connectors.md +4 -6
- package/lib/json-schema.mjs +4 -0
- package/package.json +13 -13
- package/dist/dashboard/assets/index-G7ygVDGg.js +0 -572
- package/dist/dashboard/assets/index-G7ygVDGg.js.map +0 -1
- package/dist/templates/backlog/backlog-item.md.hbs +0 -40
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/12-design-review-experience.js +0 -3589
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/13-studio-shell.js +0 -184
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/14-interface-primitives.js +0 -5229
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/15-interface-primitives.js +0 -1733
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/17-design-studio.js +0 -1844
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/12-design-review-experience.js +0 -3589
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/13-studio-shell.js +0 -184
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/14-interface-primitives.js +0 -5229
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/15-interface-primitives.js +0 -1733
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/17-design-studio.js +0 -1844
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/12-design-review-experience.js +0 -3589
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/13-studio-shell.js +0 -184
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/14-interface-primitives.js +0 -5229
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/15-interface-primitives.js +0 -1733
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/17-design-studio.js +0 -1844
|
@@ -15,7 +15,9 @@ import {
|
|
|
15
15
|
} from "./design-handoff.mjs";
|
|
16
16
|
import {
|
|
17
17
|
inspectDesignDocument,
|
|
18
|
+
matchesDesignFrame,
|
|
18
19
|
prepareDesignDocument,
|
|
20
|
+
readDesignViewContext,
|
|
19
21
|
renderDesignDocument,
|
|
20
22
|
standaloneDesignHtml
|
|
21
23
|
} from "./design-document.mjs";
|
|
@@ -64,13 +66,13 @@ import {
|
|
|
64
66
|
PipelineError,
|
|
65
67
|
digestArtifactEnvelope
|
|
66
68
|
} from "./design-shared-artifact-support-protocol-contracts-ea2cd15e.mjs";
|
|
67
|
-
import "./design-shared-protocol-contracts-
|
|
69
|
+
import "./design-shared-protocol-contracts-b5f28f94.mjs";
|
|
68
70
|
import "./design-shared-protocol-contracts-75a938cc.mjs";
|
|
69
71
|
|
|
70
72
|
// packages/design/lib/design/utility.mjs
|
|
71
73
|
import { spawn } from "node:child_process";
|
|
72
|
-
import { existsSync, mkdirSync, readFileSync, realpathSync, writeFileSync } from "node:fs";
|
|
73
|
-
import { dirname, join as
|
|
74
|
+
import { existsSync as existsSync2, mkdirSync as mkdirSync2, readFileSync, realpathSync, writeFileSync as writeFileSync2 } from "node:fs";
|
|
75
|
+
import { dirname as dirname2, join as join4, resolve as resolve3 } from "node:path";
|
|
74
76
|
import { fileURLToPath } from "node:url";
|
|
75
77
|
|
|
76
78
|
// packages/design/lib/design/feedback-import.mjs
|
|
@@ -147,7 +149,7 @@ function validatePin(pin, bundle) {
|
|
|
147
149
|
const entry = bundle.entries.find((value) => value.artifactId === pin.artifactId);
|
|
148
150
|
const frame = bundle.document.frames.find((value) => value.id === entry?.frameId);
|
|
149
151
|
const screen = bundle.document.screens.find((value) => value.id === entry?.screenId);
|
|
150
|
-
if (!entry ||
|
|
152
|
+
if (!entry || !matchesDesignFrame(frame, pin.viewport))
|
|
151
153
|
invalid("Feedback pin does not match its original screen and captured frame.");
|
|
152
154
|
if (pin.variant !== void 0 && pin.variant !== entry.variantId)
|
|
153
155
|
invalid("Feedback pin targets another design direction.");
|
|
@@ -337,8 +339,234 @@ async function importDesignFeedback(file, { input, revision, allowStale = false,
|
|
|
337
339
|
}
|
|
338
340
|
}
|
|
339
341
|
|
|
342
|
+
// packages/design/lib/design/font-fetch.mjs
|
|
343
|
+
import {
|
|
344
|
+
chmodSync,
|
|
345
|
+
existsSync,
|
|
346
|
+
mkdirSync,
|
|
347
|
+
mkdtempSync,
|
|
348
|
+
readdirSync,
|
|
349
|
+
renameSync,
|
|
350
|
+
rmdirSync,
|
|
351
|
+
rmSync,
|
|
352
|
+
statSync,
|
|
353
|
+
writeFileSync
|
|
354
|
+
} from "node:fs";
|
|
355
|
+
import { dirname, join as join2, resolve as resolve2 } from "node:path";
|
|
356
|
+
var MAX_FAMILIES = 2;
|
|
357
|
+
var MAX_WEIGHTS = 3;
|
|
358
|
+
var TIMEOUT_MS = 2e4;
|
|
359
|
+
var MAX_FILE_BYTES = 15e5;
|
|
360
|
+
var MAX_TOTAL_BYTES = 5e6;
|
|
361
|
+
var CSS_ENDPOINT = "https://fonts.googleapis.com/css2";
|
|
362
|
+
var FONT_ORIGIN = "https://fonts.gstatic.com/";
|
|
363
|
+
var CATALOG_ROOT = "https://raw.githubusercontent.com/google/fonts/main";
|
|
364
|
+
var USER_AGENT = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36";
|
|
365
|
+
var LICENSES = Object.freeze([
|
|
366
|
+
{
|
|
367
|
+
directory: "ofl",
|
|
368
|
+
metadata: "OFL",
|
|
369
|
+
file: "OFL.txt",
|
|
370
|
+
id: "OFL-1.1",
|
|
371
|
+
text: /SIL Open Font License,?\s+Version 1\.1/iu
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
directory: "apache",
|
|
375
|
+
metadata: "APACHE2",
|
|
376
|
+
file: "LICENSE.txt",
|
|
377
|
+
id: "Apache-2.0",
|
|
378
|
+
text: /Apache License\s+Version 2\.0/iu
|
|
379
|
+
}
|
|
380
|
+
]);
|
|
381
|
+
var FAMILY_SPEC = /^([A-Za-z0-9](?:[A-Za-z0-9 ]*[A-Za-z0-9])?):(\d{3}(?:,\d{3})*)$/u;
|
|
382
|
+
function parseFontFamily(spec) {
|
|
383
|
+
const match = typeof spec === "string" ? FAMILY_SPEC.exec(spec.trim()) : null;
|
|
384
|
+
if (!match)
|
|
385
|
+
throw new Error(
|
|
386
|
+
`--family ${JSON.stringify(spec ?? "")} must look like "Inter:400,600" (a name, a colon, comma-separated weights).`
|
|
387
|
+
);
|
|
388
|
+
const weights = [...new Set(match[2].split(",").map(Number))].sort((a, b) => a - b);
|
|
389
|
+
const invalid2 = weights.find((weight) => weight < 100 || weight > 900 || weight % 100 !== 0);
|
|
390
|
+
if (invalid2 !== void 0)
|
|
391
|
+
throw new Error(`--family "${spec}" has weight ${invalid2}; use 100 to 900 in steps of 100.`);
|
|
392
|
+
if (weights.length > MAX_WEIGHTS)
|
|
393
|
+
throw new Error(
|
|
394
|
+
`--family "${spec}" has ${weights.length} weights; at most ${MAX_WEIGHTS} per family.`
|
|
395
|
+
);
|
|
396
|
+
return { family: match[1], weights };
|
|
397
|
+
}
|
|
398
|
+
function latinFontFaces(css, family) {
|
|
399
|
+
const faces = [];
|
|
400
|
+
for (const [, subset, body] of css.matchAll(
|
|
401
|
+
/\/\*\s*([\w-]+)\s*\*\/\s*@font-face\s*\{([^}]*)\}/gu
|
|
402
|
+
)) {
|
|
403
|
+
const value = (name) => new RegExp(`(?:^|;)\\s*${name}\\s*:\\s*([^;]+)`, "iu").exec(body)?.[1].trim();
|
|
404
|
+
if (subset !== "latin" || !/^U\+0000-00FF\b/iu.test(value("unicode-range") ?? "")) continue;
|
|
405
|
+
const source = /^url\(([^)\s]+)\)\s*format\(['"]woff2['"]\)$/u.exec(value("src") ?? "");
|
|
406
|
+
if (!source?.[1].startsWith(FONT_ORIGIN))
|
|
407
|
+
throw new Error(
|
|
408
|
+
`"${family}" Latin face is not a woff2 file on ${FONT_ORIGIN}: ${value("src")}`
|
|
409
|
+
);
|
|
410
|
+
faces.push({ weight: Number(value("font-weight")), url: source[1] });
|
|
411
|
+
}
|
|
412
|
+
return faces;
|
|
413
|
+
}
|
|
414
|
+
async function request(fetchImpl, url, { headers, allowMissing = false, redirect } = {}) {
|
|
415
|
+
let response;
|
|
416
|
+
try {
|
|
417
|
+
response = await fetchImpl(url, {
|
|
418
|
+
headers,
|
|
419
|
+
redirect,
|
|
420
|
+
signal: AbortSignal.timeout(TIMEOUT_MS)
|
|
421
|
+
});
|
|
422
|
+
} catch (error) {
|
|
423
|
+
const reason = error?.name === "TimeoutError" ? `no response within ${TIMEOUT_MS / 1e3} s` : error?.message;
|
|
424
|
+
throw new Error(`Font fetch failed: ${url}: ${reason}`);
|
|
425
|
+
}
|
|
426
|
+
if (allowMissing && response.status === 404) return null;
|
|
427
|
+
if (!response.ok) throw new Error(`Font fetch failed: ${url}: HTTP ${response.status}`);
|
|
428
|
+
return response;
|
|
429
|
+
}
|
|
430
|
+
async function verifiedLicense(fetchImpl, family) {
|
|
431
|
+
const slug = family.toLowerCase().replace(/[^a-z0-9]/gu, "");
|
|
432
|
+
const tried = [];
|
|
433
|
+
for (const license of LICENSES) {
|
|
434
|
+
const base = `${CATALOG_ROOT}/${license.directory}/${slug}`;
|
|
435
|
+
tried.push(`${base}/METADATA.pb`);
|
|
436
|
+
const metadata = await request(fetchImpl, `${base}/METADATA.pb`, { allowMissing: true });
|
|
437
|
+
if (!metadata) continue;
|
|
438
|
+
const text = await metadata.text();
|
|
439
|
+
const name = /^name:\s*"([^"]*)"/mu.exec(text)?.[1];
|
|
440
|
+
const declared = /^license:\s*"([^"]*)"/mu.exec(text)?.[1];
|
|
441
|
+
if (name !== family && name?.toLowerCase() === family.toLowerCase())
|
|
442
|
+
throw new Error(`"${family}" is listed as "${name}"; use the catalog name "${name}".`);
|
|
443
|
+
if (name !== family || declared !== license.metadata)
|
|
444
|
+
throw new Error(
|
|
445
|
+
`"${family}" is not verified as ${license.id}: ${base}/METADATA.pb names ${JSON.stringify(name)} with license ${JSON.stringify(declared)}. Use the system stack.`
|
|
446
|
+
);
|
|
447
|
+
const body = Buffer.from(
|
|
448
|
+
await (await request(fetchImpl, `${base}/${license.file}`, { redirect: "error" })).arrayBuffer()
|
|
449
|
+
);
|
|
450
|
+
if (!license.text.test(body.toString("utf8")))
|
|
451
|
+
throw new Error(
|
|
452
|
+
`"${family}" is not verified as ${license.id}: ${base}/${license.file} does not contain the license text. Use the system stack.`
|
|
453
|
+
);
|
|
454
|
+
return { slug, license, body };
|
|
455
|
+
}
|
|
456
|
+
throw new Error(
|
|
457
|
+
`"${family}" is not an OFL or Apache licensed Google Fonts family (checked ${tried.join(", ")}). Use the system stack.`
|
|
458
|
+
);
|
|
459
|
+
}
|
|
460
|
+
async function download(fetchImpl, url) {
|
|
461
|
+
const bytes = Buffer.from(
|
|
462
|
+
await (await request(fetchImpl, url, { redirect: "error" })).arrayBuffer()
|
|
463
|
+
);
|
|
464
|
+
if (bytes.length > MAX_FILE_BYTES)
|
|
465
|
+
throw new Error(`Font file is ${bytes.length} bytes, over the ${MAX_FILE_BYTES} limit: ${url}`);
|
|
466
|
+
if (bytes.toString("latin1", 0, 4) !== "wOF2") throw new Error(`Font file is not woff2: ${url}`);
|
|
467
|
+
return bytes;
|
|
468
|
+
}
|
|
469
|
+
function assertWritableDestination(dest) {
|
|
470
|
+
if (!existsSync(dest)) return;
|
|
471
|
+
if (!statSync(dest).isDirectory() || readdirSync(dest).length > 0)
|
|
472
|
+
throw new Error(
|
|
473
|
+
`Font destination already exists and is not empty: ${dest}. Choose a new --dest or remove it.`
|
|
474
|
+
);
|
|
475
|
+
}
|
|
476
|
+
function faceRule(family, weights, file) {
|
|
477
|
+
const weight = weights.length > 1 ? `${weights[0]} ${weights.at(-1)}` : `${weights[0]}`;
|
|
478
|
+
return `@font-face {
|
|
479
|
+
font-family: "${family}";
|
|
480
|
+
font-style: normal;
|
|
481
|
+
font-weight: ${weight};
|
|
482
|
+
font-display: swap;
|
|
483
|
+
src: url("${file}") format("woff2");
|
|
484
|
+
}
|
|
485
|
+
`;
|
|
486
|
+
}
|
|
487
|
+
async function fetchDesignFonts({ families, dest, fetchImpl = fetch }) {
|
|
488
|
+
if (!dest) throw new Error("fonts fetch requires --dest <design>/source/assets/fonts.");
|
|
489
|
+
const specs = (families ?? []).map(parseFontFamily);
|
|
490
|
+
if (specs.length === 0)
|
|
491
|
+
throw new Error('fonts fetch requires at least one --family "<Name>:<weights>".');
|
|
492
|
+
if (specs.length > MAX_FAMILIES)
|
|
493
|
+
throw new Error(
|
|
494
|
+
`${specs.length} families requested (${specs.map(({ family }) => family).join(", ")}); at most ${MAX_FAMILIES}.`
|
|
495
|
+
);
|
|
496
|
+
const names = specs.map(({ family }) => family.toLowerCase());
|
|
497
|
+
if (new Set(names).size !== names.length)
|
|
498
|
+
throw new Error(
|
|
499
|
+
`--family names a family twice: ${specs.map(({ family }) => family).join(", ")}.`
|
|
500
|
+
);
|
|
501
|
+
const target = resolve2(dest);
|
|
502
|
+
assertWritableDestination(target);
|
|
503
|
+
const files = /* @__PURE__ */ new Map();
|
|
504
|
+
const rules = [];
|
|
505
|
+
const summaries = [];
|
|
506
|
+
let totalBytes = 0;
|
|
507
|
+
const add = (path, bytes) => {
|
|
508
|
+
totalBytes += bytes.length;
|
|
509
|
+
if (totalBytes > MAX_TOTAL_BYTES)
|
|
510
|
+
throw new Error(`Font snapshot exceeds ${MAX_TOTAL_BYTES} bytes at ${path}.`);
|
|
511
|
+
files.set(path, bytes);
|
|
512
|
+
};
|
|
513
|
+
for (const { family, weights } of specs) {
|
|
514
|
+
const { slug, license, body } = await verifiedLicense(fetchImpl, family);
|
|
515
|
+
const source = `${CSS_ENDPOINT}?family=${encodeURIComponent(family).replaceAll("%20", "+")}:wght@${weights.join(";")}&display=swap`;
|
|
516
|
+
const css = await (await request(fetchImpl, source, { headers: { "user-agent": USER_AGENT } })).text();
|
|
517
|
+
const faces = latinFontFaces(css, family);
|
|
518
|
+
const byUrl = /* @__PURE__ */ new Map();
|
|
519
|
+
for (const weight of weights) {
|
|
520
|
+
const face = faces.find((item) => item.weight === weight);
|
|
521
|
+
if (!face)
|
|
522
|
+
throw new Error(`"${family}" has no Latin woff2 face for weight ${weight} in ${source}`);
|
|
523
|
+
byUrl.set(face.url, [...byUrl.get(face.url) ?? [], weight]);
|
|
524
|
+
}
|
|
525
|
+
rules.push(`/* ${family} (${license.id}, ${slug}/${license.file}): ${source} */
|
|
526
|
+
`);
|
|
527
|
+
for (const [url, covered] of byUrl) {
|
|
528
|
+
const range = covered.length > 1 ? `${covered[0]}-${covered.at(-1)}` : `${covered[0]}`;
|
|
529
|
+
const file = `${slug}/${slug}-${range}-latin.woff2`;
|
|
530
|
+
add(file, await download(fetchImpl, url));
|
|
531
|
+
rules.push(faceRule(family, covered, file));
|
|
532
|
+
}
|
|
533
|
+
add(`${slug}/${license.file}`, body);
|
|
534
|
+
summaries.push({
|
|
535
|
+
family,
|
|
536
|
+
license: license.id,
|
|
537
|
+
weights,
|
|
538
|
+
source,
|
|
539
|
+
licenseFile: `${slug}/${license.file}`
|
|
540
|
+
});
|
|
541
|
+
}
|
|
542
|
+
add("fonts.css", Buffer.from(rules.join("")));
|
|
543
|
+
mkdirSync(dirname(target), { recursive: true });
|
|
544
|
+
const staging = mkdtempSync(join2(dirname(target), ".fonts-fetch-"));
|
|
545
|
+
try {
|
|
546
|
+
for (const [path, bytes] of files) {
|
|
547
|
+
mkdirSync(dirname(join2(staging, path)), { recursive: true });
|
|
548
|
+
writeFileSync(join2(staging, path), bytes, { flag: "wx" });
|
|
549
|
+
}
|
|
550
|
+
assertWritableDestination(target);
|
|
551
|
+
if (existsSync(target)) rmdirSync(target);
|
|
552
|
+
chmodSync(staging, 493);
|
|
553
|
+
renameSync(staging, target);
|
|
554
|
+
} catch (error) {
|
|
555
|
+
rmSync(staging, { recursive: true, force: true });
|
|
556
|
+
throw error;
|
|
557
|
+
}
|
|
558
|
+
return {
|
|
559
|
+
ok: true,
|
|
560
|
+
dest: target,
|
|
561
|
+
css: join2(target, "fonts.css"),
|
|
562
|
+
families: summaries,
|
|
563
|
+
files: [...files].map(([path, bytes]) => ({ path, bytes: bytes.length })),
|
|
564
|
+
totalBytes
|
|
565
|
+
};
|
|
566
|
+
}
|
|
567
|
+
|
|
340
568
|
// packages/design/lib/design/studio-lifecycle.mjs
|
|
341
|
-
import { join as
|
|
569
|
+
import { join as join3 } from "node:path";
|
|
342
570
|
function localUrl(value, service, path) {
|
|
343
571
|
if (typeof value !== "string") return null;
|
|
344
572
|
try {
|
|
@@ -357,7 +585,7 @@ async function manageDesignStudio(file, { action = "status", instanceId, env = p
|
|
|
357
585
|
const services = (await listArtifactReviewServers({ env, fetchImpl })).filter(
|
|
358
586
|
(service2) => service2.kind === "design" && service2.projectRoot === current.root
|
|
359
587
|
);
|
|
360
|
-
const launcher = readJson(
|
|
588
|
+
const launcher = readJson(join3(current.root, ".design/server.json"), null);
|
|
361
589
|
let service = services.find((value) => value.instanceId === (instanceId ?? launcher?.instanceId));
|
|
362
590
|
if (instanceId !== void 0 && !service)
|
|
363
591
|
throw new Error(
|
|
@@ -422,7 +650,7 @@ async function manageDesignStudio(file, { action = "status", instanceId, env = p
|
|
|
422
650
|
}
|
|
423
651
|
|
|
424
652
|
// packages/design/lib/design/browser-audit.mjs
|
|
425
|
-
function auditRenderedScreen() {
|
|
653
|
+
function auditRenderedScreen({ height, frameBoundsSeverity = "warning" } = {}) {
|
|
426
654
|
const issues = [];
|
|
427
655
|
const add = (rule, severity, message) => issues.push({ rule, severity, message });
|
|
428
656
|
const label = (node) => node.getAttribute("data-planr-id") || node.id || `${node.tagName.toLowerCase()} \u201C${(node.textContent || node.getAttribute("aria-label") || "").trim().replace(/\s+/gu, " ").slice(0, 60)}\u201D`;
|
|
@@ -432,6 +660,19 @@ function auditRenderedScreen() {
|
|
|
432
660
|
add("screen-not-loaded", "error", "The frame has no authored design screen identity.");
|
|
433
661
|
if (document.readyState !== "complete")
|
|
434
662
|
add("screen-loading", "error", `The frame is still ${document.readyState}.`);
|
|
663
|
+
const documentHeight = document.documentElement.scrollHeight;
|
|
664
|
+
if (document.body && getComputedStyle(document.body).boxSizing !== "border-box")
|
|
665
|
+
add(
|
|
666
|
+
"board-root-box-sizing",
|
|
667
|
+
frameBoundsSeverity,
|
|
668
|
+
"The screen root body must use box-sizing: border-box."
|
|
669
|
+
);
|
|
670
|
+
if (height !== "auto" && documentHeight > viewport.height + 1)
|
|
671
|
+
add(
|
|
672
|
+
"vertical-overflow",
|
|
673
|
+
frameBoundsSeverity,
|
|
674
|
+
`The screen is ${documentHeight}px tall in a ${viewport.height}px frame.`
|
|
675
|
+
);
|
|
435
676
|
const nodes = [...document.querySelectorAll("body *")];
|
|
436
677
|
if (nodes.length > 5e3)
|
|
437
678
|
add(
|
|
@@ -476,9 +717,31 @@ function auditRenderedScreen() {
|
|
|
476
717
|
let checkedElements = 0, checkedContrast = 0, skippedContrast = 0, checkedFocus = 0;
|
|
477
718
|
const focusTargets = [];
|
|
478
719
|
for (const node of nodes.slice(0, 5e3)) {
|
|
720
|
+
const style = getComputedStyle(node);
|
|
721
|
+
const rect = node.getBoundingClientRect();
|
|
722
|
+
if (rect.width > 0 && rect.height > 0 && style.visibility !== "hidden" && style.visibility !== "collapse" && Number(style.opacity) > 0 && ["absolute", "fixed"].includes(style.position)) {
|
|
723
|
+
let { left, right, top, bottom } = rect;
|
|
724
|
+
for (let ancestor = node.parentElement; ancestor && ancestor !== document.body; ancestor = ancestor.parentElement) {
|
|
725
|
+
const clip = getComputedStyle(ancestor);
|
|
726
|
+
const bounds = ancestor.getBoundingClientRect();
|
|
727
|
+
if (["auto", "scroll", "hidden", "clip"].includes(clip.overflowX)) {
|
|
728
|
+
left = Math.max(left, bounds.left + ancestor.clientLeft);
|
|
729
|
+
right = Math.min(right, bounds.left + ancestor.clientLeft + ancestor.clientWidth);
|
|
730
|
+
}
|
|
731
|
+
if (["auto", "scroll", "hidden", "clip"].includes(clip.overflowY)) {
|
|
732
|
+
top = Math.max(top, bounds.top + ancestor.clientTop);
|
|
733
|
+
bottom = Math.min(bottom, bounds.top + ancestor.clientTop + ancestor.clientHeight);
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
if (right > left && bottom > top && (left < -1 || right > viewport.width + 1 || top < -1 || bottom > (height === "auto" ? documentHeight : viewport.height) + 1))
|
|
737
|
+
add(
|
|
738
|
+
"outside-frame",
|
|
739
|
+
frameBoundsSeverity,
|
|
740
|
+
`${label(node)} is positioned outside the frame box.`
|
|
741
|
+
);
|
|
742
|
+
}
|
|
479
743
|
if (!visible(node)) continue;
|
|
480
744
|
checkedElements += 1;
|
|
481
|
-
const style = getComputedStyle(node);
|
|
482
745
|
const directText = [...node.childNodes].some(
|
|
483
746
|
(child) => child.nodeType === 3 && child.textContent.trim()
|
|
484
747
|
);
|
|
@@ -595,8 +858,62 @@ function auditRenderedScreen() {
|
|
|
595
858
|
issues
|
|
596
859
|
};
|
|
597
860
|
}
|
|
598
|
-
async function
|
|
861
|
+
async function attachedArtifactFrame(page, artifactId, warn) {
|
|
862
|
+
const deadline = Date.now() + 5e3;
|
|
863
|
+
const escaped = artifactId.replace(
|
|
864
|
+
/[^a-z0-9_-]/giu,
|
|
865
|
+
(char) => `\\${char.codePointAt(0).toString(16)} `
|
|
866
|
+
);
|
|
867
|
+
const handle = await page.waitForSelector(
|
|
868
|
+
`iframe[data-planr-artifact-frame="${escaped}"], iframe[data-planr-artifact-id="${escaped}"]`,
|
|
869
|
+
{ state: "attached", timeout: 5e3 }
|
|
870
|
+
);
|
|
871
|
+
try {
|
|
872
|
+
return await new Promise((resolve4, reject) => {
|
|
873
|
+
let settled = false;
|
|
874
|
+
const finish = (error, frame) => {
|
|
875
|
+
if (settled) return;
|
|
876
|
+
settled = true;
|
|
877
|
+
clearTimeout(timer);
|
|
878
|
+
page.off("frameattached", inspect);
|
|
879
|
+
page.off("framenavigated", inspect);
|
|
880
|
+
if (error) reject(error);
|
|
881
|
+
else resolve4(frame);
|
|
882
|
+
};
|
|
883
|
+
const inspect = async (frame) => {
|
|
884
|
+
if (settled || frame === page.mainFrame?.()) return;
|
|
885
|
+
try {
|
|
886
|
+
const candidate = await frame.frameElement();
|
|
887
|
+
let matches;
|
|
888
|
+
try {
|
|
889
|
+
matches = await handle.evaluate((element, other) => element === other, candidate);
|
|
890
|
+
} finally {
|
|
891
|
+
await candidate.dispose?.();
|
|
892
|
+
}
|
|
893
|
+
if (matches) finish(null, frame);
|
|
894
|
+
} catch (error) {
|
|
895
|
+
if (!settled) warn(error);
|
|
896
|
+
}
|
|
897
|
+
};
|
|
898
|
+
const timer = setTimeout(
|
|
899
|
+
() => finish(new Error(`No frame attached for artifact ${artifactId} within 5000ms.`)),
|
|
900
|
+
Math.max(1, deadline - Date.now())
|
|
901
|
+
);
|
|
902
|
+
page.on("frameattached", inspect);
|
|
903
|
+
page.on("framenavigated", inspect);
|
|
904
|
+
handle.contentFrame().then((frame) => {
|
|
905
|
+
if (frame) finish(null, frame);
|
|
906
|
+
}, finish);
|
|
907
|
+
});
|
|
908
|
+
} finally {
|
|
909
|
+
await handle.dispose?.();
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
async function auditDesignPage(page, { revision, document: document2, entries = [], screenshotPaths = [], scenarios = [] } = {}) {
|
|
913
|
+
if (!document2 || typeof document2 !== "object" || Array.isArray(document2))
|
|
914
|
+
throw new TypeError("Audit requires a design document input.");
|
|
599
915
|
const issues = [], checkedArtifacts = [], screens = [];
|
|
916
|
+
const frameBoundsSeverity = document2.frames?.some((frame) => frame.height === "auto") ? "error" : "warning";
|
|
600
917
|
const expected = new Map(entries.map((entry) => [entry.artifactId, entry]));
|
|
601
918
|
const add = (artifactId, rule, severity, message) => issues.push({ artifactId, rule, severity, message });
|
|
602
919
|
if (!entries.length || expected.size !== entries.length)
|
|
@@ -626,62 +943,125 @@ async function auditDesignPage(page, { revision, entries = [], screenshotPaths =
|
|
|
626
943
|
};
|
|
627
944
|
}
|
|
628
945
|
const loaded = /* @__PURE__ */ new Set();
|
|
629
|
-
for (const
|
|
630
|
-
let
|
|
946
|
+
for (const entry of expected.values()) {
|
|
947
|
+
let frameHold;
|
|
631
948
|
try {
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
949
|
+
try {
|
|
950
|
+
frameHold = await page.evaluateHandle?.((id) => {
|
|
951
|
+
const stage = window.__openPlanrArtifactStage;
|
|
952
|
+
return stage?.frameBudget ? stage.holdFrames([id]) : null;
|
|
953
|
+
}, entry.artifactId);
|
|
954
|
+
await page.evaluate?.(async (id) => {
|
|
955
|
+
const stage = window.__openPlanrArtifactStage;
|
|
956
|
+
if (stage?.frameBudget) await stage.ensureFrames([id]);
|
|
957
|
+
}, entry.artifactId);
|
|
958
|
+
} catch (error) {
|
|
637
959
|
add(
|
|
638
|
-
artifactId,
|
|
639
|
-
"
|
|
960
|
+
entry.artifactId,
|
|
961
|
+
"frame-load-error",
|
|
640
962
|
"error",
|
|
641
|
-
|
|
963
|
+
`The rendered frame could not be mounted: ${error.message}`
|
|
642
964
|
);
|
|
643
965
|
continue;
|
|
644
966
|
}
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
967
|
+
let frames;
|
|
968
|
+
if (["waitForSelector", "on", "off"].every((method) => typeof page[method] === "function")) {
|
|
969
|
+
try {
|
|
970
|
+
const frame = await attachedArtifactFrame(
|
|
971
|
+
page,
|
|
972
|
+
entry.artifactId,
|
|
973
|
+
(error) => add(
|
|
974
|
+
entry.artifactId,
|
|
975
|
+
"frame-attachment-inspection-error",
|
|
976
|
+
"warning",
|
|
977
|
+
`A frame attachment could not be matched to artifact ${entry.artifactId}: ${error.message}`
|
|
978
|
+
)
|
|
979
|
+
);
|
|
980
|
+
frames = [frame, ...page.frames().filter((candidate) => candidate !== frame)];
|
|
981
|
+
} catch (error) {
|
|
982
|
+
add(
|
|
983
|
+
entry.artifactId,
|
|
984
|
+
"frame-load-error",
|
|
985
|
+
"error",
|
|
986
|
+
`Artifact ${entry.artifactId} has no frame attached for inspection: ${error.message}`
|
|
987
|
+
);
|
|
988
|
+
continue;
|
|
989
|
+
}
|
|
990
|
+
} else frames = page.frames();
|
|
991
|
+
for (const frame of frames) {
|
|
992
|
+
let handle, artifactId, panelState;
|
|
993
|
+
try {
|
|
994
|
+
if (frame === page.mainFrame?.()) continue;
|
|
995
|
+
handle = await frame.frameElement();
|
|
996
|
+
artifactId = await handle.getAttribute("data-planr-artifact-frame") ?? await handle.getAttribute("data-planr-artifact-id");
|
|
997
|
+
if (artifactId !== entry.artifactId) continue;
|
|
998
|
+
if (loaded.has(artifactId)) {
|
|
999
|
+
add(
|
|
1000
|
+
artifactId,
|
|
1001
|
+
"duplicate-frame",
|
|
1002
|
+
"error",
|
|
1003
|
+
"Multiple frames claim the same artifact identity."
|
|
1004
|
+
);
|
|
1005
|
+
continue;
|
|
1006
|
+
}
|
|
1007
|
+
loaded.add(artifactId);
|
|
1008
|
+
await frame.waitForLoadState?.("load", { timeout: 5e3 });
|
|
1009
|
+
panelState = await handle.evaluate((element) => {
|
|
1010
|
+
const panel = element.closest("[data-artifact-id]");
|
|
1011
|
+
if (!panel) return null;
|
|
1012
|
+
const hidden = panel.hidden;
|
|
1013
|
+
panel.hidden = false;
|
|
1014
|
+
return { hidden };
|
|
1015
|
+
});
|
|
1016
|
+
await page.keyboard?.press("Tab");
|
|
1017
|
+
const result = await frame.evaluate(auditRenderedScreen, {
|
|
1018
|
+
height: entry.height,
|
|
1019
|
+
frameBoundsSeverity
|
|
1020
|
+
});
|
|
1021
|
+
if (result.screenId !== entry.screenId) {
|
|
1022
|
+
add(
|
|
1023
|
+
artifactId,
|
|
1024
|
+
"screen-identity-mismatch",
|
|
1025
|
+
"error",
|
|
1026
|
+
`Expected screen ${entry.screenId}; loaded ${result.screenId ?? "none"}.`
|
|
1027
|
+
);
|
|
1028
|
+
continue;
|
|
1029
|
+
}
|
|
1030
|
+
checkedArtifacts.push(artifactId);
|
|
1031
|
+
screens.push({ artifactId, ...result });
|
|
1032
|
+
for (const issue of result.issues)
|
|
1033
|
+
add(artifactId, issue.rule, issue.severity, issue.message);
|
|
1034
|
+
} catch (error) {
|
|
1035
|
+
if (artifactId && expected.has(artifactId))
|
|
1036
|
+
add(
|
|
1037
|
+
artifactId,
|
|
1038
|
+
"frame-load-error",
|
|
1039
|
+
"error",
|
|
1040
|
+
`The rendered frame could not be inspected: ${error.message}`
|
|
1041
|
+
);
|
|
1042
|
+
} finally {
|
|
1043
|
+
if (panelState && handle) {
|
|
1044
|
+
await handle.evaluate((element, state) => {
|
|
1045
|
+
const panel = element.closest("[data-artifact-id]");
|
|
1046
|
+
if (panel) panel.hidden = state.hidden;
|
|
1047
|
+
}, panelState).catch(
|
|
1048
|
+
(error) => add(
|
|
1049
|
+
artifactId,
|
|
1050
|
+
"panel-visibility-restore-error",
|
|
1051
|
+
"warning",
|
|
1052
|
+
`Artifact ${artifactId} panel visibility could not be restored: ${error.message}`
|
|
1053
|
+
)
|
|
1054
|
+
);
|
|
1055
|
+
}
|
|
1056
|
+
await handle?.dispose?.();
|
|
1057
|
+
}
|
|
664
1058
|
}
|
|
665
|
-
checkedArtifacts.push(artifactId);
|
|
666
|
-
screens.push({ artifactId, ...result });
|
|
667
|
-
for (const issue of result.issues) add(artifactId, issue.rule, issue.severity, issue.message);
|
|
668
|
-
} catch (error) {
|
|
669
|
-
if (artifactId && expected.has(artifactId))
|
|
670
|
-
add(
|
|
671
|
-
artifactId,
|
|
672
|
-
"frame-load-error",
|
|
673
|
-
"error",
|
|
674
|
-
`The rendered frame could not be inspected: ${error.message}`
|
|
675
|
-
);
|
|
676
1059
|
} finally {
|
|
677
|
-
|
|
678
|
-
await
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
}, panelState).catch(() => {
|
|
682
|
-
});
|
|
1060
|
+
try {
|
|
1061
|
+
await frameHold?.evaluate((release) => release?.());
|
|
1062
|
+
} finally {
|
|
1063
|
+
await frameHold?.dispose();
|
|
683
1064
|
}
|
|
684
|
-
await handle?.dispose?.();
|
|
685
1065
|
}
|
|
686
1066
|
}
|
|
687
1067
|
for (const artifactId of expected.keys()) {
|
|
@@ -737,12 +1117,12 @@ function verifyDesignDocument(file, report) {
|
|
|
737
1117
|
const coverage = current.entries.every((entry) => {
|
|
738
1118
|
const frame = current.document.frames.find((item) => item.id === entry.frameId);
|
|
739
1119
|
const matches = screenEvidence.filter((item) => item?.artifactId === entry.artifactId);
|
|
740
|
-
return checkedArtifacts.includes(entry.artifactId) && matches.length === 1 && matches[0].screenId === entry.screenId &&
|
|
1120
|
+
return checkedArtifacts.includes(entry.artifactId) && matches.length === 1 && matches[0].screenId === entry.screenId && matchesDesignFrame(frame, matches[0].viewport) && Number.isInteger(matches[0].checkedElements) && matches[0].checkedElements > 0;
|
|
741
1121
|
});
|
|
742
1122
|
const images = (Array.isArray(report.screenshots) ? report.screenshots : []).filter((item) => {
|
|
743
1123
|
const path = typeof item === "string" ? item : item?.path;
|
|
744
1124
|
try {
|
|
745
|
-
return typeof path === "string" && isPng(readFileSync(
|
|
1125
|
+
return typeof path === "string" && isPng(readFileSync(resolve3(path)));
|
|
746
1126
|
} catch {
|
|
747
1127
|
return false;
|
|
748
1128
|
}
|
|
@@ -766,7 +1146,7 @@ function verifyDesignDocument(file, report) {
|
|
|
766
1146
|
screenshotCount: images.length,
|
|
767
1147
|
primaryJourneysChecked: Boolean(journeys)
|
|
768
1148
|
};
|
|
769
|
-
atomicJson(
|
|
1149
|
+
atomicJson(join4(current.root, ".design/verification", `${current.revision}.json`), saved);
|
|
770
1150
|
return saved;
|
|
771
1151
|
}
|
|
772
1152
|
async function designUtility(argv, {
|
|
@@ -778,7 +1158,7 @@ async function designUtility(argv, {
|
|
|
778
1158
|
} = {}) {
|
|
779
1159
|
if (argv.length === 0 || argv[0] === "--help" || argv[0] === "help") {
|
|
780
1160
|
const help = {
|
|
781
|
-
usage:
|
|
1161
|
+
usage: 'design.mjs inspect|validate|render|open|studio|view-context|export|feedback|verify|share|publish|sync|manage|handoff <design-document.json> | design.mjs fonts fetch --family "<Name>:<weights>" [--family ...] --dest <dir>',
|
|
782
1162
|
flags: [
|
|
783
1163
|
"--json",
|
|
784
1164
|
"--no-open",
|
|
@@ -791,12 +1171,15 @@ async function designUtility(argv, {
|
|
|
791
1171
|
"--action inspect|export|import|select|resolve|rotate|pause|resume|revoke|delete|recovery|restore|status|stop",
|
|
792
1172
|
"--input <private recovery or feedback JSON file>",
|
|
793
1173
|
"--revision <current-render-revision>",
|
|
1174
|
+
"--request-time <ISO-timestamp>",
|
|
794
1175
|
"--allow-stale",
|
|
795
1176
|
"--variant <id>",
|
|
796
1177
|
"--pins <id,id>",
|
|
797
|
-
"--summary <text>"
|
|
1178
|
+
"--summary <text>",
|
|
1179
|
+
"--family <Name>:<weight,weight> (fonts fetch; at most 2 families, 3 weights each)",
|
|
1180
|
+
"--dest <design>/source/assets/fonts (fonts fetch)"
|
|
798
1181
|
],
|
|
799
|
-
note: "The host authors design sources. This utility only validates, renders, reviews and exports them."
|
|
1182
|
+
note: "The host authors design sources. This utility only validates, renders, reviews and exports them; fonts fetch downloads open-license fonts only when run."
|
|
800
1183
|
};
|
|
801
1184
|
stdout(help);
|
|
802
1185
|
return help;
|
|
@@ -808,6 +1191,7 @@ async function designUtility(argv, {
|
|
|
808
1191
|
"render",
|
|
809
1192
|
"open",
|
|
810
1193
|
"studio",
|
|
1194
|
+
"view-context",
|
|
811
1195
|
"export",
|
|
812
1196
|
"feedback",
|
|
813
1197
|
"verify",
|
|
@@ -815,10 +1199,11 @@ async function designUtility(argv, {
|
|
|
815
1199
|
"publish",
|
|
816
1200
|
"sync",
|
|
817
1201
|
"manage",
|
|
818
|
-
"handoff"
|
|
1202
|
+
"handoff",
|
|
1203
|
+
"fonts"
|
|
819
1204
|
].includes(command) || !input)
|
|
820
1205
|
throw new Error(
|
|
821
|
-
|
|
1206
|
+
'Usage: design.mjs inspect|validate|render|open|studio|view-context|export|feedback|verify|share|publish|sync|manage|handoff <design-document.json> [--json] [--no-open] [--view canvas|prototype|walkthrough] | design.mjs fonts fetch --family "<Name>:<weights>" [--family ...] --dest <dir>'
|
|
822
1207
|
);
|
|
823
1208
|
const flags = {};
|
|
824
1209
|
for (let i = 0; i < args.length; i++) {
|
|
@@ -840,15 +1225,32 @@ async function designUtility(argv, {
|
|
|
840
1225
|
"input",
|
|
841
1226
|
"scope",
|
|
842
1227
|
"revision",
|
|
843
|
-
"
|
|
1228
|
+
"request-time",
|
|
1229
|
+
"allow-stale",
|
|
1230
|
+
"family",
|
|
1231
|
+
"dest"
|
|
844
1232
|
].includes(key))
|
|
845
1233
|
throw new Error(`Unknown option: ${args[i]}`);
|
|
846
|
-
|
|
1234
|
+
if (["family", "dest"].includes(key) && command !== "fonts")
|
|
1235
|
+
throw new Error(`Unknown option for ${command}: ${args[i]}`);
|
|
1236
|
+
if (key === "family") flags.family = [...flags.family ?? [], args[++i]];
|
|
1237
|
+
else flags[key] = ["json", "no-open", "allow-stale"].includes(key) ? true : args[++i];
|
|
847
1238
|
}
|
|
848
1239
|
if (flags.view && !["canvas", "prototype", "walkthrough"].includes(flags.view))
|
|
849
1240
|
throw new Error("View must be canvas, prototype, or walkthrough.");
|
|
850
|
-
|
|
1241
|
+
if (command === "fonts") {
|
|
1242
|
+
if (input !== "fetch")
|
|
1243
|
+
throw new Error(
|
|
1244
|
+
'Usage: design.mjs fonts fetch --family "<Name>:<weights>" [--family ...] --dest <dir>'
|
|
1245
|
+
);
|
|
1246
|
+
const result2 = await fetchDesignFonts({ families: flags.family, dest: flags.dest, fetchImpl });
|
|
1247
|
+
stdout(result2);
|
|
1248
|
+
return result2;
|
|
1249
|
+
}
|
|
1250
|
+
const file = resolve3(input);
|
|
851
1251
|
let result;
|
|
1252
|
+
if (command === "view-context")
|
|
1253
|
+
result = readDesignViewContext(file, { requestTime: flags["request-time"] });
|
|
852
1254
|
if (command === "studio")
|
|
853
1255
|
result = await manageDesignStudio(file, {
|
|
854
1256
|
action: flags.action,
|
|
@@ -861,7 +1263,7 @@ async function designUtility(argv, {
|
|
|
861
1263
|
if (action === "inspect") result = readDesignHandoff(file);
|
|
862
1264
|
else {
|
|
863
1265
|
const snapshot = readDesignHandoff(file);
|
|
864
|
-
const input2 = flags.input ? readJson(
|
|
1266
|
+
const input2 = flags.input ? readJson(resolve3(flags.input)) : {};
|
|
865
1267
|
result = await updateDesignHandoff(file, {
|
|
866
1268
|
...input2,
|
|
867
1269
|
action,
|
|
@@ -915,21 +1317,21 @@ async function designUtility(argv, {
|
|
|
915
1317
|
}
|
|
916
1318
|
if (command === "export") {
|
|
917
1319
|
const current = currentDesign(file), view = flags.view ?? current.document.defaultView;
|
|
918
|
-
const state = readJson(
|
|
1320
|
+
const state = readJson(join4(current.root, ".design/studio-state.json"), { state: {} }).state;
|
|
919
1321
|
if (flags.format && flags.format !== "html")
|
|
920
1322
|
throw new Error(
|
|
921
1323
|
"Portable export supports HTML. Use the studio PNG action for browser-rendered captures."
|
|
922
1324
|
);
|
|
923
|
-
const output =
|
|
924
|
-
if (
|
|
1325
|
+
const output = resolve3(flags.output ?? join4(current.root, `${view}-export.html`));
|
|
1326
|
+
if (existsSync2(output))
|
|
925
1327
|
throw new Error(`Export already exists: ${output}. Choose a new --output path.`);
|
|
926
|
-
|
|
927
|
-
|
|
1328
|
+
mkdirSync2(dirname2(output), { recursive: true });
|
|
1329
|
+
writeFileSync2(output, standaloneDesignHtml({ ...current, state }, view), { flag: "wx" });
|
|
928
1330
|
result = { ok: true, output, view, revision: current.revision };
|
|
929
1331
|
}
|
|
930
1332
|
if (command === "verify") {
|
|
931
1333
|
if (!flags.report) throw new Error("verify requires --report <browser-report.json>.");
|
|
932
|
-
result = verifyDesignDocument(file, readJson(
|
|
1334
|
+
result = verifyDesignDocument(file, readJson(resolve3(flags.report)));
|
|
933
1335
|
}
|
|
934
1336
|
if (command === "feedback") {
|
|
935
1337
|
const action = flags.action ?? "inspect";
|
|
@@ -949,12 +1351,12 @@ async function designUtility(argv, {
|
|
|
949
1351
|
if (!["current", "all"].includes(scope))
|
|
950
1352
|
throw new Error("Feedback export scope must be current or all.");
|
|
951
1353
|
if (!flags.output) throw new Error("Feedback export requires --output <path>.");
|
|
952
|
-
const output =
|
|
953
|
-
if (
|
|
1354
|
+
const output = resolve3(flags.output);
|
|
1355
|
+
if (existsSync2(output))
|
|
954
1356
|
throw new Error("Feedback export already exists. Choose a new --output path.");
|
|
955
1357
|
const snapshot = exportDesignReview(file, { scope, env });
|
|
956
|
-
|
|
957
|
-
|
|
1358
|
+
mkdirSync2(dirname2(output), { recursive: true });
|
|
1359
|
+
writeFileSync2(output, serializeDesignReviewExport(snapshot, format), {
|
|
958
1360
|
flag: "wx",
|
|
959
1361
|
mode: 384
|
|
960
1362
|
});
|
|
@@ -973,7 +1375,7 @@ async function designUtility(argv, {
|
|
|
973
1375
|
env
|
|
974
1376
|
});
|
|
975
1377
|
else if (action === "select") {
|
|
976
|
-
const current = currentDesign(file), saved = readJson(
|
|
1378
|
+
const current = currentDesign(file), saved = readJson(join4(current.root, ".design/studio-state.json"), {
|
|
977
1379
|
state: {},
|
|
978
1380
|
stateVersion: 0
|
|
979
1381
|
});
|
|
@@ -1023,5 +1425,6 @@ export {
|
|
|
1023
1425
|
auditRenderedScreen,
|
|
1024
1426
|
designUtility,
|
|
1025
1427
|
main,
|
|
1428
|
+
readDesignViewContext,
|
|
1026
1429
|
verifyDesignDocument
|
|
1027
1430
|
};
|