openplanr 3.4.0 → 3.5.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 +28 -0
- package/dist/cli/commands/design.d.ts +3 -0
- package/dist/cli/commands/design.d.ts.map +1 -0
- package/dist/cli/commands/design.js +137 -0
- package/dist/cli/commands/design.js.map +1 -0
- package/dist/cli/commands/groups/operations.d.ts.map +1 -1
- package/dist/cli/commands/groups/operations.js +2 -0
- package/dist/cli/commands/groups/operations.js.map +1 -1
- package/dist/dashboard/.vite/manifest.json +1 -1
- package/dist/dashboard/assets/{index-CvQAlBy3.js → index-B-l_941W.js} +2 -2
- package/dist/dashboard/assets/{index-CvQAlBy3.js.map → index-B-l_941W.js.map} +1 -1
- package/dist/dashboard/dashboard-manifest.json +13 -13
- package/dist/dashboard/index.html +1 -1
- package/dist/services/design-artifact-service.d.ts +22 -0
- package/dist/services/design-artifact-service.d.ts.map +1 -1
- package/dist/services/design-artifact-service.js +76 -16
- package/dist/services/design-artifact-service.js.map +1 -1
- package/dist/services/runtime-manager/runtime-package.js +1 -1
- package/dist/services/runtime-manager/runtime-package.js.map +1 -1
- package/docs/CLI.md +29 -0
- package/lib/host-packages/adapter-registry.json +5 -5
- package/lib/host-packages/capability-map.json +1 -1
- 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 +24 -340
- package/lib/host-packages/claude/openplanr/README.md +8 -8
- package/lib/host-packages/claude/openplanr/skills/artifact/references/design-sharing.md +2 -2
- package/lib/host-packages/claude/openplanr/skills/design/SKILL.md +23 -12
- package/lib/host-packages/claude/openplanr/skills/design/references/design-system.md +2 -2
- package/lib/host-packages/claude/openplanr/skills/design/references/generation.md +3 -3
- package/lib/host-packages/claude/openplanr/skills/design/references/hosted-canvas.md +6 -3
- package/lib/host-packages/claude/openplanr/skills/design/references/review.md +6 -6
- package/lib/host-packages/claude/openplanr/skills/design/references/team-review.md +3 -4
- package/lib/host-packages/claude/openplanr/skills/design/references/utilities.md +78 -38
- package/lib/host-packages/claude/openplanr/skills/design-loop/SKILL.md +15 -7
- package/lib/host-packages/claude/openplanr/skills/design-loop/references/design-system.md +2 -2
- package/lib/host-packages/claude/openplanr/skills/design-loop/references/generation.md +3 -3
- package/lib/host-packages/claude/openplanr/skills/design-loop/references/review.md +6 -6
- package/lib/host-packages/claude/openplanr/skills/design-loop/references/team-review.md +3 -4
- package/lib/host-packages/claude/openplanr/skills/design-loop/references/utilities.md +78 -38
- package/lib/host-packages/claude/openplanr/skills/design-review/SKILL.md +25 -5
- package/lib/host-packages/claude/openplanr/skills/design-review/references/design-system.md +2 -2
- package/lib/host-packages/claude/openplanr/skills/design-review/references/generation.md +3 -3
- package/lib/host-packages/claude/openplanr/skills/design-review/references/review.md +6 -6
- package/lib/host-packages/claude/openplanr/skills/design-review/references/team-review.md +3 -4
- package/lib/host-packages/claude/openplanr/skills/design-review/references/utilities.md +78 -38
- package/lib/host-packages/claude/openplanr/skills/plan/SKILL.md +7 -3
- package/lib/host-packages/cursor/openplanr/.openplanr-content.json +23 -339
- package/lib/host-packages/cursor/openplanr/manifest.json +1 -1
- package/lib/host-packages/cursor/openplanr/rules/planr-artifact/references/design-sharing.md +2 -2
- package/lib/host-packages/cursor/openplanr/rules/planr-design/references/design-system.md +2 -2
- package/lib/host-packages/cursor/openplanr/rules/planr-design/references/generation.md +3 -3
- package/lib/host-packages/cursor/openplanr/rules/planr-design/references/hosted-canvas.md +6 -3
- package/lib/host-packages/cursor/openplanr/rules/planr-design/references/review.md +6 -6
- package/lib/host-packages/cursor/openplanr/rules/planr-design/references/team-review.md +3 -4
- package/lib/host-packages/cursor/openplanr/rules/planr-design/references/utilities.md +78 -38
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/references/design-system.md +2 -2
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/references/generation.md +3 -3
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/references/review.md +6 -6
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/references/team-review.md +3 -4
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/references/utilities.md +78 -38
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop.mdc +15 -7
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/references/design-system.md +2 -2
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/references/generation.md +3 -3
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/references/review.md +6 -6
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/references/team-review.md +3 -4
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/references/utilities.md +78 -38
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review.mdc +25 -5
- package/lib/host-packages/cursor/openplanr/rules/planr-design.mdc +23 -12
- package/lib/host-packages/cursor/openplanr/rules/planr-plan.mdc +7 -3
- 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 +27 -343
- package/lib/host-packages/openai/openplanr/skills/artifact/references/design-sharing.md +2 -2
- package/lib/host-packages/openai/openplanr/skills/design/SKILL.md +23 -12
- package/lib/host-packages/openai/openplanr/skills/design/openplanr.skill.json +0 -11
- package/lib/host-packages/openai/openplanr/skills/design/references/design-system.md +2 -2
- package/lib/host-packages/openai/openplanr/skills/design/references/generation.md +3 -3
- package/lib/host-packages/openai/openplanr/skills/design/references/hosted-canvas.md +6 -3
- package/lib/host-packages/openai/openplanr/skills/design/references/review.md +6 -6
- package/lib/host-packages/openai/openplanr/skills/design/references/team-review.md +3 -4
- package/lib/host-packages/openai/openplanr/skills/design/references/utilities.md +78 -38
- package/lib/host-packages/openai/openplanr/skills/design-loop/SKILL.md +15 -7
- package/lib/host-packages/openai/openplanr/skills/design-loop/openplanr.skill.json +0 -11
- package/lib/host-packages/openai/openplanr/skills/design-loop/references/design-system.md +2 -2
- package/lib/host-packages/openai/openplanr/skills/design-loop/references/generation.md +3 -3
- package/lib/host-packages/openai/openplanr/skills/design-loop/references/review.md +6 -6
- package/lib/host-packages/openai/openplanr/skills/design-loop/references/team-review.md +3 -4
- package/lib/host-packages/openai/openplanr/skills/design-loop/references/utilities.md +78 -38
- package/lib/host-packages/openai/openplanr/skills/design-review/SKILL.md +25 -5
- package/lib/host-packages/openai/openplanr/skills/design-review/openplanr.skill.json +0 -11
- package/lib/host-packages/openai/openplanr/skills/design-review/references/design-system.md +2 -2
- package/lib/host-packages/openai/openplanr/skills/design-review/references/generation.md +3 -3
- package/lib/host-packages/openai/openplanr/skills/design-review/references/review.md +6 -6
- package/lib/host-packages/openai/openplanr/skills/design-review/references/team-review.md +3 -4
- package/lib/host-packages/openai/openplanr/skills/design-review/references/utilities.md +78 -38
- package/lib/host-packages/openai/openplanr/skills/plan/SKILL.md +7 -3
- package/lib/host-packages/openai/openplanr/skills/plan/openplanr.skill.json +0 -11
- package/package.json +2 -2
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-artifact-shell.mjs +0 -1772
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-document.mjs +0 -2937
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-entities.mjs +0 -439
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-handoff.mjs +0 -2370
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-loopback-server.mjs +0 -359
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-parse5-parser.mjs +0 -3970
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-parse5-tokenizer.mjs +0 -3501
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-review-state-store.mjs +0 -45
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-review.mjs +0 -3376
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-runtime-home.mjs +0 -38
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-sandbox-guards.mjs +0 -1102
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-share-cli-bridge.mjs +0 -321
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-shared-artifact-support-dependencies-design-support-protocol-contracts-d707e49b.mjs +0 -1652
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-shared-artifact-support-protocol-contracts-9f6918b0.mjs +0 -1037
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-shared-design-support-0bac378d.mjs +0 -137
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design.mjs +0 -1500
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +0 -2023
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/lib/artifact/ui/studio-shell.css +0 -2
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/01-module-runtime.js +0 -18
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/02-artifact-review-ui.js +0 -814
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/03-protocol-contracts.js +0 -10
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/04-artifact-review-ui.js +0 -2568
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources.json +0 -60
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/package.json +0 -65
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/enhancements.css +0 -388
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/handoff-center.css +0 -81
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/share.css +0 -1
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/share.js +0 -139
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.css +0 -1159
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/01-module-runtime.js +0 -30
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/02-react.js +0 -900
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/03-react-dom-client-fiber-foundations.js +0 -2261
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/04-react-dom-client-reconciliation-hooks.js +0 -1595
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/05-react-dom-client-render-phases.js +0 -1467
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/06-react-dom-client-commit-effects.js +0 -1860
- 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 +0 -914
- 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 +0 -2578
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/09-react-dom-client-public-roots.js +0 -582
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/10-react.js +0 -17
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/11-artifact-review-ui.js +0 -12
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/12-protocol-contracts.js +0 -285
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/13-design-review-experience.js +0 -2773
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/14-studio-shell.js +0 -134
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/15-canvas-engine.js +0 -2207
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/16-design-review-experience.js +0 -16
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/17-studio-shell.js +0 -8
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/18-interface-primitives.js +0 -3883
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/19-interface-primitives.js +0 -966
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/20-studio-shell.js +0 -520
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/21-design-studio.js +0 -1597
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources.json +0 -311
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/package.json +0 -163
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/registries/artifact-theme.json +0 -64
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.0.0/design-manifest.schema.json +0 -90
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-envelope.schema.json +0 -142
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-review.schema.json +0 -97
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-bundle.schema.json +0 -584
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-context.schema.json +0 -191
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-handoff.schema.json +0 -407
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-metadata-payload.schema.json +0 -106
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.11.0/design-handoff-readiness.schema.json +0 -398
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.11.0/design-implementation-handoff.schema.json +0 -518
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.11.0/design-planning-lineage.schema.json +0 -106
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.11.0/design-review-metadata-payload.schema.json +0 -107
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.14.0/artifact-theme.schema.json +0 -316
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.16.0/artifact-envelope.schema.json +0 -408
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.16.0/design-review-bundle.schema.json +0 -590
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.22.0/design-document.schema.json +0 -506
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.22.0/design-review-bundle.schema.json +0 -822
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-bundle.schema.json +0 -346
- package/lib/host-packages/claude/openplanr/runtime/plan/scripts/design-protocol-contracts.mjs +0 -1232
- package/lib/host-packages/claude/openplanr/runtime/plan/scripts/design.mjs +0 -2611
- package/lib/host-packages/claude/openplanr/runtime/plan/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +0 -21
- package/lib/host-packages/claude/openplanr/runtime/plan/scripts/runtime/packages/protocol/package.json +0 -163
- package/lib/host-packages/claude/openplanr/runtime/plan/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-review.schema.json +0 -97
- package/lib/host-packages/claude/openplanr/skills/design/scripts/design.mjs +0 -12
- package/lib/host-packages/claude/openplanr/skills/design-loop/scripts/design.mjs +0 -12
- package/lib/host-packages/claude/openplanr/skills/design-review/scripts/design.mjs +0 -12
- package/lib/host-packages/claude/openplanr/skills/plan/scripts/design.mjs +0 -12
- package/lib/host-packages/cursor/openplanr/rules/planr-design/scripts/design.mjs +0 -12
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/scripts/design.mjs +0 -12
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/scripts/design.mjs +0 -12
- package/lib/host-packages/cursor/openplanr/rules/planr-plan/scripts/design.mjs +0 -12
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-artifact-shell.mjs +0 -1772
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-document.mjs +0 -2937
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-entities.mjs +0 -439
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-handoff.mjs +0 -2370
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-loopback-server.mjs +0 -359
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-parse5-parser.mjs +0 -3970
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-parse5-tokenizer.mjs +0 -3501
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-review-state-store.mjs +0 -45
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-review.mjs +0 -3376
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-runtime-home.mjs +0 -38
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-sandbox-guards.mjs +0 -1102
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-share-cli-bridge.mjs +0 -321
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-shared-artifact-support-dependencies-design-support-protocol-contracts-d707e49b.mjs +0 -1652
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-shared-artifact-support-protocol-contracts-9f6918b0.mjs +0 -1037
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-shared-design-support-0bac378d.mjs +0 -137
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design.mjs +0 -1500
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +0 -2023
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/lib/artifact/ui/studio-shell.css +0 -2
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/01-module-runtime.js +0 -18
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/02-artifact-review-ui.js +0 -814
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/03-protocol-contracts.js +0 -10
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/04-artifact-review-ui.js +0 -2568
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources.json +0 -60
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/package.json +0 -65
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/enhancements.css +0 -388
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/handoff-center.css +0 -81
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/share.css +0 -1
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/share.js +0 -139
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.css +0 -1159
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/01-module-runtime.js +0 -30
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/02-react.js +0 -900
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/03-react-dom-client-fiber-foundations.js +0 -2261
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/04-react-dom-client-reconciliation-hooks.js +0 -1595
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/05-react-dom-client-render-phases.js +0 -1467
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/06-react-dom-client-commit-effects.js +0 -1860
- 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 +0 -914
- 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 +0 -2578
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/09-react-dom-client-public-roots.js +0 -582
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/10-react.js +0 -17
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/11-artifact-review-ui.js +0 -12
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/12-protocol-contracts.js +0 -285
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/13-design-review-experience.js +0 -2773
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/14-studio-shell.js +0 -134
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/15-canvas-engine.js +0 -2207
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/16-design-review-experience.js +0 -16
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/17-studio-shell.js +0 -8
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/18-interface-primitives.js +0 -3883
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/19-interface-primitives.js +0 -966
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/20-studio-shell.js +0 -520
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/21-design-studio.js +0 -1597
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources.json +0 -311
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/package.json +0 -163
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/registries/artifact-theme.json +0 -64
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.0.0/design-manifest.schema.json +0 -90
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-envelope.schema.json +0 -142
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-review.schema.json +0 -97
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-bundle.schema.json +0 -584
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-context.schema.json +0 -191
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-handoff.schema.json +0 -407
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-metadata-payload.schema.json +0 -106
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.11.0/design-handoff-readiness.schema.json +0 -398
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.11.0/design-implementation-handoff.schema.json +0 -518
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.11.0/design-planning-lineage.schema.json +0 -106
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.11.0/design-review-metadata-payload.schema.json +0 -107
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.14.0/artifact-theme.schema.json +0 -316
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.16.0/artifact-envelope.schema.json +0 -408
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.16.0/design-review-bundle.schema.json +0 -590
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.22.0/design-document.schema.json +0 -506
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.22.0/design-review-bundle.schema.json +0 -822
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-bundle.schema.json +0 -346
- package/lib/host-packages/cursor/openplanr/runtime/plan/scripts/design-protocol-contracts.mjs +0 -1232
- package/lib/host-packages/cursor/openplanr/runtime/plan/scripts/design.mjs +0 -2611
- package/lib/host-packages/cursor/openplanr/runtime/plan/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +0 -21
- package/lib/host-packages/cursor/openplanr/runtime/plan/scripts/runtime/packages/protocol/package.json +0 -163
- package/lib/host-packages/cursor/openplanr/runtime/plan/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-review.schema.json +0 -97
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-artifact-shell.mjs +0 -1772
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-document.mjs +0 -2937
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-entities.mjs +0 -439
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-handoff.mjs +0 -2370
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-loopback-server.mjs +0 -359
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-parse5-parser.mjs +0 -3970
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-parse5-tokenizer.mjs +0 -3501
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-review-state-store.mjs +0 -45
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-review.mjs +0 -3376
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-runtime-home.mjs +0 -38
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-sandbox-guards.mjs +0 -1102
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-share-cli-bridge.mjs +0 -321
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-shared-artifact-support-dependencies-design-support-protocol-contracts-d707e49b.mjs +0 -1652
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-shared-artifact-support-protocol-contracts-9f6918b0.mjs +0 -1037
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-shared-design-support-0bac378d.mjs +0 -137
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design.mjs +0 -1500
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +0 -2023
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/lib/artifact/ui/studio-shell.css +0 -2
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/01-module-runtime.js +0 -18
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/02-artifact-review-ui.js +0 -814
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/03-protocol-contracts.js +0 -10
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/04-artifact-review-ui.js +0 -2568
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources.json +0 -60
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/package.json +0 -65
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/enhancements.css +0 -388
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/handoff-center.css +0 -81
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/share.css +0 -1
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/share.js +0 -139
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.css +0 -1159
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/01-module-runtime.js +0 -30
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/02-react.js +0 -900
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/03-react-dom-client-fiber-foundations.js +0 -2261
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/04-react-dom-client-reconciliation-hooks.js +0 -1595
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/05-react-dom-client-render-phases.js +0 -1467
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/06-react-dom-client-commit-effects.js +0 -1860
- 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 +0 -914
- 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 +0 -2578
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/09-react-dom-client-public-roots.js +0 -582
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/10-react.js +0 -17
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/11-artifact-review-ui.js +0 -12
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/12-protocol-contracts.js +0 -285
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/13-design-review-experience.js +0 -2773
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/14-studio-shell.js +0 -134
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/15-canvas-engine.js +0 -2207
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/16-design-review-experience.js +0 -16
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/17-studio-shell.js +0 -8
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/18-interface-primitives.js +0 -3883
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/19-interface-primitives.js +0 -966
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/20-studio-shell.js +0 -520
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/21-design-studio.js +0 -1597
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources.json +0 -311
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/package.json +0 -163
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/registries/artifact-theme.json +0 -64
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.0.0/design-manifest.schema.json +0 -90
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-envelope.schema.json +0 -142
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-review.schema.json +0 -97
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-bundle.schema.json +0 -584
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-context.schema.json +0 -191
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-handoff.schema.json +0 -407
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-metadata-payload.schema.json +0 -106
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.11.0/design-handoff-readiness.schema.json +0 -398
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.11.0/design-implementation-handoff.schema.json +0 -518
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.11.0/design-planning-lineage.schema.json +0 -106
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.11.0/design-review-metadata-payload.schema.json +0 -107
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.14.0/artifact-theme.schema.json +0 -316
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.16.0/artifact-envelope.schema.json +0 -408
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.16.0/design-review-bundle.schema.json +0 -590
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.22.0/design-document.schema.json +0 -506
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.22.0/design-review-bundle.schema.json +0 -822
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-bundle.schema.json +0 -346
- package/lib/host-packages/openai/openplanr/runtime/plan/scripts/design-protocol-contracts.mjs +0 -1232
- package/lib/host-packages/openai/openplanr/runtime/plan/scripts/design.mjs +0 -2611
- package/lib/host-packages/openai/openplanr/runtime/plan/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +0 -21
- package/lib/host-packages/openai/openplanr/runtime/plan/scripts/runtime/packages/protocol/package.json +0 -163
- package/lib/host-packages/openai/openplanr/runtime/plan/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-review.schema.json +0 -97
- package/lib/host-packages/openai/openplanr/skills/design/scripts/design.mjs +0 -12
- package/lib/host-packages/openai/openplanr/skills/design-loop/scripts/design.mjs +0 -12
- package/lib/host-packages/openai/openplanr/skills/design-review/scripts/design.mjs +0 -12
- package/lib/host-packages/openai/openplanr/skills/plan/scripts/design.mjs +0 -12
package/lib/host-packages/cursor/openplanr/runtime/plan/scripts/design-protocol-contracts.mjs
DELETED
|
@@ -1,1232 +0,0 @@
|
|
|
1
|
-
// packages/protocol/src/canonical-json.mjs
|
|
2
|
-
var hasOwn = (value, key) => Object.hasOwn(value, key);
|
|
3
|
-
function assertUnicodeScalarString(value, path) {
|
|
4
|
-
for (let index = 0; index < value.length; index += 1) {
|
|
5
|
-
const code = value.charCodeAt(index);
|
|
6
|
-
if (code >= 55296 && code <= 56319) {
|
|
7
|
-
const next = value.charCodeAt(index + 1);
|
|
8
|
-
if (!(next >= 56320 && next <= 57343)) {
|
|
9
|
-
throw new TypeError(`JCS cannot canonicalize a lone high surrogate at ${path}.`);
|
|
10
|
-
}
|
|
11
|
-
index += 1;
|
|
12
|
-
} else if (code >= 56320 && code <= 57343) {
|
|
13
|
-
throw new TypeError(`JCS cannot canonicalize a lone low surrogate at ${path}.`);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
function serialize(value, path, seen) {
|
|
18
|
-
if (value === null) return "null";
|
|
19
|
-
if (typeof value === "boolean") return value ? "true" : "false";
|
|
20
|
-
if (typeof value === "string") {
|
|
21
|
-
assertUnicodeScalarString(value, path);
|
|
22
|
-
return JSON.stringify(value);
|
|
23
|
-
}
|
|
24
|
-
if (typeof value === "number") {
|
|
25
|
-
if (!Number.isFinite(value)) throw new TypeError(`JCS requires a finite number at ${path}.`);
|
|
26
|
-
return JSON.stringify(value);
|
|
27
|
-
}
|
|
28
|
-
if (typeof value !== "object")
|
|
29
|
-
throw new TypeError(`JCS cannot canonicalize ${typeof value} at ${path}.`);
|
|
30
|
-
if (seen.has(value)) throw new TypeError(`JCS cannot canonicalize a cycle at ${path}.`);
|
|
31
|
-
seen.add(value);
|
|
32
|
-
try {
|
|
33
|
-
if (Array.isArray(value)) {
|
|
34
|
-
const entries2 = [];
|
|
35
|
-
for (let index = 0; index < value.length; index += 1) {
|
|
36
|
-
if (!hasOwn(value, index))
|
|
37
|
-
throw new TypeError(`JCS cannot canonicalize a sparse array at ${path}[${index}].`);
|
|
38
|
-
entries2.push(serialize(value[index], `${path}[${index}]`, seen));
|
|
39
|
-
}
|
|
40
|
-
return `[${entries2.join(",")}]`;
|
|
41
|
-
}
|
|
42
|
-
const prototype = Object.getPrototypeOf(value);
|
|
43
|
-
if (prototype !== Object.prototype && prototype !== null) {
|
|
44
|
-
throw new TypeError(`JCS requires a plain JSON object at ${path}.`);
|
|
45
|
-
}
|
|
46
|
-
const entries = Object.keys(value).sort().map((key) => {
|
|
47
|
-
assertUnicodeScalarString(key, `${path} key`);
|
|
48
|
-
return `${JSON.stringify(key)}:${serialize(value[key], `${path}.${key}`, seen)}`;
|
|
49
|
-
});
|
|
50
|
-
return `{${entries.join(",")}}`;
|
|
51
|
-
} finally {
|
|
52
|
-
seen.delete(value);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
function canonicalizeJson(value) {
|
|
56
|
-
return serialize(value, "$", /* @__PURE__ */ new Set());
|
|
57
|
-
}
|
|
58
|
-
function assertPlainDataAt(value, label, depth, seen) {
|
|
59
|
-
if (depth > 64) throw new TypeError(`${label} exceeds the maximum nesting depth.`);
|
|
60
|
-
if (value === null || ["string", "boolean"].includes(typeof value)) return;
|
|
61
|
-
if (typeof value === "number" && Number.isFinite(value)) return;
|
|
62
|
-
if (typeof value !== "object" || seen.has(value))
|
|
63
|
-
throw new TypeError(`${label} must be finite, acyclic JSON.`);
|
|
64
|
-
if (!Array.isArray(value) && ![Object.prototype, null].includes(Object.getPrototypeOf(value)))
|
|
65
|
-
throw new TypeError(`${label} must contain only plain JSON objects.`);
|
|
66
|
-
seen.add(value);
|
|
67
|
-
for (const [key, descriptor] of Object.entries(Object.getOwnPropertyDescriptors(value))) {
|
|
68
|
-
if (["__proto__", "prototype", "constructor"].includes(key) || !Object.hasOwn(descriptor, "value"))
|
|
69
|
-
throw new TypeError(`${label} contains a forbidden property.`);
|
|
70
|
-
assertPlainDataAt(descriptor.value, label, depth + 1, seen);
|
|
71
|
-
}
|
|
72
|
-
seen.delete(value);
|
|
73
|
-
}
|
|
74
|
-
function assertPlainData(value, label) {
|
|
75
|
-
assertPlainDataAt(value, label, 0, /* @__PURE__ */ new Set());
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
// packages/protocol/src/json-schema.mjs
|
|
79
|
-
var typeOf = (v) => {
|
|
80
|
-
if (v === null) return "null";
|
|
81
|
-
if (Array.isArray(v)) return "array";
|
|
82
|
-
if (Number.isInteger(v)) return "integer";
|
|
83
|
-
if (typeof v === "number") return "number";
|
|
84
|
-
return typeof v;
|
|
85
|
-
};
|
|
86
|
-
var matchesType = (v, t) => {
|
|
87
|
-
if (t === "integer") return Number.isInteger(v);
|
|
88
|
-
if (t === "number") return typeof v === "number";
|
|
89
|
-
if (t === "string") return typeof v === "string";
|
|
90
|
-
if (t === "boolean") return typeof v === "boolean";
|
|
91
|
-
if (t === "null") return v === null;
|
|
92
|
-
if (t === "array") return Array.isArray(v);
|
|
93
|
-
if (t === "object") return v !== null && typeof v === "object" && !Array.isArray(v);
|
|
94
|
-
return false;
|
|
95
|
-
};
|
|
96
|
-
var FORMAT_DATE = /^\d{4}-\d{2}-\d{2}$/;
|
|
97
|
-
var FORMAT_DATETIME = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/;
|
|
98
|
-
var SUPPORTED_FORMATS = /* @__PURE__ */ new Set(["date", "date-time"]);
|
|
99
|
-
var ANNOTATION_KEYWORDS = [
|
|
100
|
-
"$schema",
|
|
101
|
-
"$id",
|
|
102
|
-
"$defs",
|
|
103
|
-
"$comment",
|
|
104
|
-
"title",
|
|
105
|
-
"description",
|
|
106
|
-
"default",
|
|
107
|
-
"examples",
|
|
108
|
-
"deprecated",
|
|
109
|
-
"readOnly",
|
|
110
|
-
"writeOnly"
|
|
111
|
-
];
|
|
112
|
-
var VALIDATION_KEYWORDS = [
|
|
113
|
-
"$ref",
|
|
114
|
-
"type",
|
|
115
|
-
"const",
|
|
116
|
-
"enum",
|
|
117
|
-
"minLength",
|
|
118
|
-
"maxLength",
|
|
119
|
-
"pattern",
|
|
120
|
-
"format",
|
|
121
|
-
"minimum",
|
|
122
|
-
"maximum",
|
|
123
|
-
"exclusiveMinimum",
|
|
124
|
-
"minItems",
|
|
125
|
-
"maxItems",
|
|
126
|
-
"prefixItems",
|
|
127
|
-
"items",
|
|
128
|
-
"uniqueItems",
|
|
129
|
-
"contains",
|
|
130
|
-
"minContains",
|
|
131
|
-
"maxContains",
|
|
132
|
-
"required",
|
|
133
|
-
"properties",
|
|
134
|
-
"propertyNames",
|
|
135
|
-
"additionalProperties",
|
|
136
|
-
"maxProperties",
|
|
137
|
-
"dependentRequired",
|
|
138
|
-
"unevaluatedProperties",
|
|
139
|
-
"oneOf",
|
|
140
|
-
"anyOf",
|
|
141
|
-
"allOf",
|
|
142
|
-
"if",
|
|
143
|
-
"then",
|
|
144
|
-
"else",
|
|
145
|
-
"not"
|
|
146
|
-
];
|
|
147
|
-
var KNOWN_KEYWORDS = /* @__PURE__ */ new Set([...ANNOTATION_KEYWORDS, ...VALIDATION_KEYWORDS]);
|
|
148
|
-
var TYPE_NAMES = /* @__PURE__ */ new Set(["array", "boolean", "integer", "null", "number", "object", "string"]);
|
|
149
|
-
var isSchema = (value) => typeof value === "boolean" || value !== null && typeof value === "object" && !Array.isArray(value);
|
|
150
|
-
var isPlainObject = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
151
|
-
var isCount = (value) => Number.isSafeInteger(value) && value >= 0;
|
|
152
|
-
var isUniqueStrings = (value) => Array.isArray(value) && value.every((item2) => typeof item2 === "string") && new Set(value).size === value.length;
|
|
153
|
-
var isSchemaArray = (value) => Array.isArray(value) && value.length > 0 && value.every(isSchema);
|
|
154
|
-
var isSchemaMap = (value) => isPlainObject(value) && Object.values(value).every(isSchema);
|
|
155
|
-
var compiledPatterns = /* @__PURE__ */ new Map();
|
|
156
|
-
var MAX_COMPILED_PATTERNS = 1024;
|
|
157
|
-
var tryCompilePattern = (source) => {
|
|
158
|
-
try {
|
|
159
|
-
return new RegExp(source);
|
|
160
|
-
} catch (error) {
|
|
161
|
-
if (error instanceof SyntaxError) return null;
|
|
162
|
-
throw error;
|
|
163
|
-
}
|
|
164
|
-
};
|
|
165
|
-
var compilePattern = (source) => {
|
|
166
|
-
if (!compiledPatterns.has(source)) {
|
|
167
|
-
if (compiledPatterns.size >= MAX_COMPILED_PATTERNS) compiledPatterns.clear();
|
|
168
|
-
compiledPatterns.set(source, tryCompilePattern(source));
|
|
169
|
-
}
|
|
170
|
-
return compiledPatterns.get(source) ?? null;
|
|
171
|
-
};
|
|
172
|
-
var describeValue = (value) => {
|
|
173
|
-
const text2 = String(JSON.stringify(value));
|
|
174
|
-
return text2.length > 80 ? `${text2.slice(0, 77)}...` : text2;
|
|
175
|
-
};
|
|
176
|
-
var KEYWORD_SHAPES = {
|
|
177
|
-
$ref: ["a string", (value) => typeof value === "string"],
|
|
178
|
-
$defs: ["an object of schemas", isSchemaMap],
|
|
179
|
-
type: [
|
|
180
|
-
"a type name or a non-empty array of unique type names",
|
|
181
|
-
(value) => typeof value === "string" && TYPE_NAMES.has(value) || isUniqueStrings(value) && value.length > 0 && value.every((name) => TYPE_NAMES.has(name))
|
|
182
|
-
],
|
|
183
|
-
enum: ["an array", Array.isArray],
|
|
184
|
-
minLength: ["a non-negative integer", isCount],
|
|
185
|
-
maxLength: ["a non-negative integer", isCount],
|
|
186
|
-
pattern: [
|
|
187
|
-
"a valid regular expression string",
|
|
188
|
-
(value) => typeof value === "string" && compilePattern(value) !== null
|
|
189
|
-
],
|
|
190
|
-
minimum: ["a finite number", Number.isFinite],
|
|
191
|
-
maximum: ["a finite number", Number.isFinite],
|
|
192
|
-
exclusiveMinimum: ["a finite number", Number.isFinite],
|
|
193
|
-
minItems: ["a non-negative integer", isCount],
|
|
194
|
-
maxItems: ["a non-negative integer", isCount],
|
|
195
|
-
prefixItems: ["a non-empty array of schemas", isSchemaArray],
|
|
196
|
-
items: ["a schema", isSchema],
|
|
197
|
-
uniqueItems: ["a boolean", (value) => typeof value === "boolean"],
|
|
198
|
-
contains: ["a schema", isSchema],
|
|
199
|
-
minContains: ["a non-negative integer", isCount],
|
|
200
|
-
maxContains: ["a non-negative integer", isCount],
|
|
201
|
-
required: ["an array of unique strings", isUniqueStrings],
|
|
202
|
-
properties: ["an object of schemas", isSchemaMap],
|
|
203
|
-
propertyNames: ["a schema", isSchema],
|
|
204
|
-
additionalProperties: ["a schema", isSchema],
|
|
205
|
-
maxProperties: ["a non-negative integer", isCount],
|
|
206
|
-
dependentRequired: [
|
|
207
|
-
"an object of unique string arrays",
|
|
208
|
-
(value) => isPlainObject(value) && Object.values(value).every(isUniqueStrings)
|
|
209
|
-
],
|
|
210
|
-
unevaluatedProperties: ["a schema", isSchema],
|
|
211
|
-
oneOf: ["a non-empty array of schemas", isSchemaArray],
|
|
212
|
-
anyOf: ["a non-empty array of schemas", isSchemaArray],
|
|
213
|
-
allOf: ["a non-empty array of schemas", isSchemaArray],
|
|
214
|
-
if: ["a schema", isSchema],
|
|
215
|
-
then: ["a schema", isSchema],
|
|
216
|
-
else: ["a schema", isSchema],
|
|
217
|
-
not: ["a schema", isSchema]
|
|
218
|
-
};
|
|
219
|
-
function resolveJsonPointer(root, reference) {
|
|
220
|
-
if (reference === "#") return root;
|
|
221
|
-
if (!reference.startsWith("#/")) return null;
|
|
222
|
-
return reference.slice(2).split("/").map((part) => part.replaceAll("~1", "/").replaceAll("~0", "~")).reduce((value, part) => value?.[part], root);
|
|
223
|
-
}
|
|
224
|
-
var wellFormedSchemas = /* @__PURE__ */ new WeakSet();
|
|
225
|
-
var isFrozenNode = (schema2) => Object.isFrozen(schema2) && Object.values(schema2).every(Object.isFrozen) && (!isPlainObject(schema2.dependentRequired) || Object.values(schema2.dependentRequired).every(Object.isFrozen));
|
|
226
|
-
var checkSchemaNode = (schema2, path, context) => {
|
|
227
|
-
if (wellFormedSchemas.has(schema2) || context.checkedSchemas.has(schema2)) return;
|
|
228
|
-
context.checkedSchemas.add(schema2);
|
|
229
|
-
const errorCount = context.schemaErrors.length;
|
|
230
|
-
for (const keyword of Object.keys(schema2)) {
|
|
231
|
-
if (!KNOWN_KEYWORDS.has(keyword) && !keyword.startsWith("x-")) {
|
|
232
|
-
context.schemaErrors.push({
|
|
233
|
-
path,
|
|
234
|
-
rule: "unsupported-keyword",
|
|
235
|
-
detail: `schema keyword '${keyword}' is not supported by this validator`
|
|
236
|
-
});
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
if (Object.hasOwn(schema2, "format") && !SUPPORTED_FORMATS.has(schema2.format)) {
|
|
240
|
-
context.schemaErrors.push({
|
|
241
|
-
path,
|
|
242
|
-
rule: "unsupported-format",
|
|
243
|
-
detail: `schema format ${JSON.stringify(schema2.format)} is not supported by this validator`
|
|
244
|
-
});
|
|
245
|
-
}
|
|
246
|
-
for (const [keyword, [expected, isValid]] of Object.entries(KEYWORD_SHAPES)) {
|
|
247
|
-
if (Object.hasOwn(schema2, keyword) && !isValid(schema2[keyword])) {
|
|
248
|
-
context.schemaErrors.push({
|
|
249
|
-
path,
|
|
250
|
-
rule: "schema",
|
|
251
|
-
detail: `schema keyword '${keyword}' must be ${expected}, got ${describeValue(schema2[keyword])}`
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
if (context.schemaErrors.length === errorCount && isFrozenNode(schema2)) {
|
|
256
|
-
wellFormedSchemas.add(schema2);
|
|
257
|
-
}
|
|
258
|
-
};
|
|
259
|
-
var reportReference = (schema2, path, detail, context) => {
|
|
260
|
-
if (context.reportedReferences.has(schema2)) return;
|
|
261
|
-
context.reportedReferences.add(schema2);
|
|
262
|
-
context.schemaErrors.push({ path, rule: "$ref", detail });
|
|
263
|
-
};
|
|
264
|
-
var validateNode = (value, schema2, path, errs, context) => {
|
|
265
|
-
const evaluated = /* @__PURE__ */ new Set();
|
|
266
|
-
if (schema2 === true) return evaluated;
|
|
267
|
-
if (schema2 === false) {
|
|
268
|
-
errs.push({ path, rule: "schema:false", detail: "value not allowed" });
|
|
269
|
-
return evaluated;
|
|
270
|
-
}
|
|
271
|
-
if (!isSchema(schema2)) return evaluated;
|
|
272
|
-
checkSchemaNode(schema2, path, context);
|
|
273
|
-
if (typeof schema2?.$ref === "string") {
|
|
274
|
-
const reference = schema2.$ref;
|
|
275
|
-
let resolved;
|
|
276
|
-
let nextRoot = context.rootSchema;
|
|
277
|
-
let resolvedBase = context.base;
|
|
278
|
-
if (reference.startsWith("#")) {
|
|
279
|
-
resolved = resolveJsonPointer(context.rootSchema, reference);
|
|
280
|
-
} else if (typeof context.resolveRef === "function") {
|
|
281
|
-
const result = context.resolveRef(reference, { base: context.base });
|
|
282
|
-
resolved = result?.schema ?? result;
|
|
283
|
-
nextRoot = result?.rootSchema ?? resolved;
|
|
284
|
-
resolvedBase = result?.base ?? resolved?.$id ?? context.base;
|
|
285
|
-
}
|
|
286
|
-
if (!isSchema(resolved)) {
|
|
287
|
-
const detail = resolved === void 0 || resolved === null ? `could not resolve schema reference ${reference}` : `schema reference ${reference} resolved to ${typeOf(resolved)}, not a schema`;
|
|
288
|
-
reportReference(schema2, path, detail, context);
|
|
289
|
-
return evaluated;
|
|
290
|
-
}
|
|
291
|
-
const referenceKey = `${path} ${context.base ?? "<root>"}:${reference}`;
|
|
292
|
-
if (context.referenceStack.includes(referenceKey)) {
|
|
293
|
-
reportReference(schema2, path, `circular schema reference ${reference}`, context);
|
|
294
|
-
return evaluated;
|
|
295
|
-
}
|
|
296
|
-
const referenced = validateNode(value, resolved, path, errs, {
|
|
297
|
-
...context,
|
|
298
|
-
rootSchema: nextRoot,
|
|
299
|
-
base: resolvedBase,
|
|
300
|
-
referenceStack: [...context.referenceStack, referenceKey]
|
|
301
|
-
});
|
|
302
|
-
for (const key of referenced) evaluated.add(key);
|
|
303
|
-
}
|
|
304
|
-
if (schema2.type !== void 0) {
|
|
305
|
-
const types = Array.isArray(schema2.type) ? schema2.type : [schema2.type];
|
|
306
|
-
if (!types.some((t) => matchesType(value, t))) {
|
|
307
|
-
errs.push({
|
|
308
|
-
path,
|
|
309
|
-
rule: "type",
|
|
310
|
-
detail: `expected ${types.join("|")}, got ${typeOf(value)}`
|
|
311
|
-
});
|
|
312
|
-
return evaluated;
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
if (schema2.const !== void 0) {
|
|
316
|
-
if (value !== schema2.const) {
|
|
317
|
-
errs.push({
|
|
318
|
-
path,
|
|
319
|
-
rule: "const",
|
|
320
|
-
detail: `expected ${JSON.stringify(schema2.const)}, got ${JSON.stringify(value)}`
|
|
321
|
-
});
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
if (Array.isArray(schema2.enum)) {
|
|
325
|
-
if (!schema2.enum.includes(value)) {
|
|
326
|
-
errs.push({
|
|
327
|
-
path,
|
|
328
|
-
rule: "enum",
|
|
329
|
-
detail: `value ${JSON.stringify(value)} not in enum [${schema2.enum.map((x) => JSON.stringify(x)).join(", ")}]`
|
|
330
|
-
});
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
if (typeof value === "string") {
|
|
334
|
-
if (typeof schema2.minLength === "number" && value.length < schema2.minLength) {
|
|
335
|
-
errs.push({
|
|
336
|
-
path,
|
|
337
|
-
rule: "minLength",
|
|
338
|
-
detail: `length ${value.length} < ${schema2.minLength}`
|
|
339
|
-
});
|
|
340
|
-
}
|
|
341
|
-
if (typeof schema2.maxLength === "number" && value.length > schema2.maxLength) {
|
|
342
|
-
errs.push({
|
|
343
|
-
path,
|
|
344
|
-
rule: "maxLength",
|
|
345
|
-
detail: `length ${value.length} > ${schema2.maxLength}`
|
|
346
|
-
});
|
|
347
|
-
}
|
|
348
|
-
const pattern = typeof schema2.pattern === "string" ? compilePattern(schema2.pattern) : null;
|
|
349
|
-
if (pattern && !pattern.test(value)) {
|
|
350
|
-
errs.push({
|
|
351
|
-
path,
|
|
352
|
-
rule: "pattern",
|
|
353
|
-
detail: `value ${JSON.stringify(value)} does not match /${schema2.pattern}/`
|
|
354
|
-
});
|
|
355
|
-
}
|
|
356
|
-
if (typeof schema2.format === "string") {
|
|
357
|
-
if (schema2.format === "date" && !FORMAT_DATE.test(value)) {
|
|
358
|
-
errs.push({
|
|
359
|
-
path,
|
|
360
|
-
rule: "format:date",
|
|
361
|
-
detail: `value ${JSON.stringify(value)} is not YYYY-MM-DD`
|
|
362
|
-
});
|
|
363
|
-
} else if (schema2.format === "date-time" && !FORMAT_DATETIME.test(value)) {
|
|
364
|
-
errs.push({
|
|
365
|
-
path,
|
|
366
|
-
rule: "format:date-time",
|
|
367
|
-
detail: `value ${JSON.stringify(value)} is not ISO 8601 date-time`
|
|
368
|
-
});
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
if (typeof value === "number") {
|
|
373
|
-
if (typeof schema2.minimum === "number" && value < schema2.minimum) {
|
|
374
|
-
errs.push({ path, rule: "minimum", detail: `value ${value} < ${schema2.minimum}` });
|
|
375
|
-
}
|
|
376
|
-
if (typeof schema2.maximum === "number" && value > schema2.maximum) {
|
|
377
|
-
errs.push({ path, rule: "maximum", detail: `value ${value} > ${schema2.maximum}` });
|
|
378
|
-
}
|
|
379
|
-
if (typeof schema2.exclusiveMinimum === "number" && value <= schema2.exclusiveMinimum) {
|
|
380
|
-
errs.push({
|
|
381
|
-
path,
|
|
382
|
-
rule: "exclusiveMinimum",
|
|
383
|
-
detail: `value ${value} <= ${schema2.exclusiveMinimum}`
|
|
384
|
-
});
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
if (Array.isArray(value)) {
|
|
388
|
-
if (typeof schema2.minItems === "number" && value.length < schema2.minItems) {
|
|
389
|
-
errs.push({ path, rule: "minItems", detail: `length ${value.length} < ${schema2.minItems}` });
|
|
390
|
-
}
|
|
391
|
-
if (typeof schema2.maxItems === "number" && value.length > schema2.maxItems) {
|
|
392
|
-
errs.push({ path, rule: "maxItems", detail: `length ${value.length} > ${schema2.maxItems}` });
|
|
393
|
-
}
|
|
394
|
-
const prefixLength = Array.isArray(schema2.prefixItems) ? schema2.prefixItems.length : 0;
|
|
395
|
-
if (prefixLength > 0) {
|
|
396
|
-
for (let i = 0; i < Math.min(value.length, prefixLength); i++) {
|
|
397
|
-
validateNode(value[i], schema2.prefixItems[i], `${path}[${i}]`, errs, context);
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
if (schema2.items !== void 0) {
|
|
401
|
-
for (let i = prefixLength; i < value.length; i++) {
|
|
402
|
-
validateNode(value[i], schema2.items, `${path}[${i}]`, errs, context);
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
if (schema2.uniqueItems === true) {
|
|
406
|
-
const seen = /* @__PURE__ */ new Set();
|
|
407
|
-
for (const item2 of value) {
|
|
408
|
-
const key = JSON.stringify(item2);
|
|
409
|
-
if (seen.has(key)) {
|
|
410
|
-
errs.push({ path, rule: "uniqueItems", detail: `duplicate item ${key}` });
|
|
411
|
-
break;
|
|
412
|
-
}
|
|
413
|
-
seen.add(key);
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
if (schema2.contains !== void 0) {
|
|
417
|
-
let matches = 0;
|
|
418
|
-
for (let index = 0; index < value.length; index += 1) {
|
|
419
|
-
const containedErrors = [];
|
|
420
|
-
validateNode(value[index], schema2.contains, `${path}[${index}]`, containedErrors, context);
|
|
421
|
-
if (containedErrors.length === 0) matches += 1;
|
|
422
|
-
}
|
|
423
|
-
const minimum = Number.isSafeInteger(schema2.minContains) ? schema2.minContains : 1;
|
|
424
|
-
const maximum = Number.isSafeInteger(schema2.maxContains) ? schema2.maxContains : null;
|
|
425
|
-
if (matches < minimum) {
|
|
426
|
-
errs.push({
|
|
427
|
-
path,
|
|
428
|
-
rule: "contains",
|
|
429
|
-
detail: `matched ${matches} contained items; expected at least ${minimum}`
|
|
430
|
-
});
|
|
431
|
-
}
|
|
432
|
-
if (maximum !== null && matches > maximum) {
|
|
433
|
-
errs.push({
|
|
434
|
-
path,
|
|
435
|
-
rule: "contains",
|
|
436
|
-
detail: `matched ${matches} contained items; expected at most ${maximum}`
|
|
437
|
-
});
|
|
438
|
-
}
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
if (value !== null && typeof value === "object" && !Array.isArray(value)) {
|
|
442
|
-
if (Array.isArray(schema2.required)) {
|
|
443
|
-
for (const req of schema2.required) {
|
|
444
|
-
if (!Object.hasOwn(value, req)) {
|
|
445
|
-
errs.push({ path, rule: "required", detail: `missing required property '${req}'` });
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
|
-
}
|
|
449
|
-
if (typeof schema2.maxProperties === "number" && Object.keys(value).length > schema2.maxProperties) {
|
|
450
|
-
errs.push({
|
|
451
|
-
path,
|
|
452
|
-
rule: "maxProperties",
|
|
453
|
-
detail: `property count ${Object.keys(value).length} > ${schema2.maxProperties}`
|
|
454
|
-
});
|
|
455
|
-
}
|
|
456
|
-
if (schema2.dependentRequired !== null && typeof schema2.dependentRequired === "object") {
|
|
457
|
-
for (const [trigger, dependencies] of Object.entries(schema2.dependentRequired)) {
|
|
458
|
-
if (!Object.hasOwn(value, trigger) || !Array.isArray(dependencies)) continue;
|
|
459
|
-
for (const dependency of dependencies) {
|
|
460
|
-
if (!Object.hasOwn(value, dependency)) {
|
|
461
|
-
errs.push({
|
|
462
|
-
path,
|
|
463
|
-
rule: "dependentRequired",
|
|
464
|
-
detail: `property '${trigger}' requires property '${dependency}'`
|
|
465
|
-
});
|
|
466
|
-
}
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
const props = schema2.properties || {};
|
|
471
|
-
for (const [k, v] of Object.entries(value)) {
|
|
472
|
-
if (schema2.propertyNames !== void 0)
|
|
473
|
-
validateNode(k, schema2.propertyNames, `${path}.${k}`, errs, context);
|
|
474
|
-
if (Object.hasOwn(props, k)) evaluated.add(k);
|
|
475
|
-
else if (schema2.additionalProperties !== void 0) evaluated.add(k);
|
|
476
|
-
if (!Object.hasOwn(props, k)) {
|
|
477
|
-
if (schema2.additionalProperties === false) {
|
|
478
|
-
errs.push({ path, rule: "additionalProperties", detail: `unknown property '${k}'` });
|
|
479
|
-
} else if (schema2.additionalProperties === true || schema2.additionalProperties !== null && typeof schema2.additionalProperties === "object") {
|
|
480
|
-
validateNode(v, schema2.additionalProperties, `${path}.${k}`, errs, context);
|
|
481
|
-
}
|
|
482
|
-
}
|
|
483
|
-
}
|
|
484
|
-
for (const [k, v] of Object.entries(value)) {
|
|
485
|
-
if (Object.hasOwn(props, k)) validateNode(v, props[k], `${path}.${k}`, errs, context);
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
if (Array.isArray(schema2.oneOf)) {
|
|
489
|
-
let matched = 0;
|
|
490
|
-
for (const sub of schema2.oneOf) {
|
|
491
|
-
const e = [];
|
|
492
|
-
const branch = validateNode(value, sub, path, e, context);
|
|
493
|
-
if (e.length === 0) {
|
|
494
|
-
matched++;
|
|
495
|
-
for (const key of branch) evaluated.add(key);
|
|
496
|
-
}
|
|
497
|
-
}
|
|
498
|
-
if (matched !== 1) {
|
|
499
|
-
const titles = schema2.oneOf.map((s) => s.title || "(unnamed)").join(" | ");
|
|
500
|
-
errs.push({
|
|
501
|
-
path,
|
|
502
|
-
rule: "oneOf",
|
|
503
|
-
detail: `matched ${matched}/${schema2.oneOf.length} branches (expected exactly 1). Branches: ${titles}`
|
|
504
|
-
});
|
|
505
|
-
}
|
|
506
|
-
}
|
|
507
|
-
if (Array.isArray(schema2.anyOf)) {
|
|
508
|
-
let matched = 0;
|
|
509
|
-
for (const sub of schema2.anyOf) {
|
|
510
|
-
const candidateErrors = [];
|
|
511
|
-
const branch = validateNode(value, sub, path, candidateErrors, context);
|
|
512
|
-
if (candidateErrors.length === 0) {
|
|
513
|
-
matched += 1;
|
|
514
|
-
for (const key of branch) evaluated.add(key);
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
if (matched === 0) {
|
|
518
|
-
const titles = schema2.anyOf.map((sub) => sub.title || "(unnamed)").join(" | ");
|
|
519
|
-
errs.push({
|
|
520
|
-
path,
|
|
521
|
-
rule: "anyOf",
|
|
522
|
-
detail: `matched 0/${schema2.anyOf.length} branches (expected at least 1). Branches: ${titles}`
|
|
523
|
-
});
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
|
-
if (Array.isArray(schema2.allOf)) {
|
|
527
|
-
for (const sub of schema2.allOf) {
|
|
528
|
-
for (const key of validateNode(value, sub, path, errs, context)) evaluated.add(key);
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
if (schema2.if !== void 0) {
|
|
532
|
-
const conditionErrors = [];
|
|
533
|
-
const condition = validateNode(value, schema2.if, path, conditionErrors, context);
|
|
534
|
-
const passed = conditionErrors.length === 0;
|
|
535
|
-
if (passed) for (const key of condition) evaluated.add(key);
|
|
536
|
-
const branch = passed ? schema2.then : schema2.else;
|
|
537
|
-
if (branch !== void 0) {
|
|
538
|
-
const branchErrors = [];
|
|
539
|
-
const branchEvaluated = validateNode(value, branch, path, branchErrors, context);
|
|
540
|
-
errs.push(...branchErrors);
|
|
541
|
-
if (branchErrors.length === 0) for (const key of branchEvaluated) evaluated.add(key);
|
|
542
|
-
}
|
|
543
|
-
}
|
|
544
|
-
if (schema2.not !== void 0) {
|
|
545
|
-
const e = [];
|
|
546
|
-
validateNode(value, schema2.not, path, e, context);
|
|
547
|
-
if (e.length === 0) {
|
|
548
|
-
errs.push({ path, rule: "not", detail: "value matched a forbidden subschema" });
|
|
549
|
-
}
|
|
550
|
-
}
|
|
551
|
-
if (schema2.unevaluatedProperties !== void 0 && value !== null && typeof value === "object" && !Array.isArray(value)) {
|
|
552
|
-
for (const [k, v] of Object.entries(value)) {
|
|
553
|
-
if (evaluated.has(k)) continue;
|
|
554
|
-
if (schema2.unevaluatedProperties === false) {
|
|
555
|
-
errs.push({ path, rule: "unevaluatedProperties", detail: `unevaluated property '${k}'` });
|
|
556
|
-
} else {
|
|
557
|
-
validateNode(v, schema2.unevaluatedProperties, `${path}.${k}`, errs, context);
|
|
558
|
-
}
|
|
559
|
-
evaluated.add(k);
|
|
560
|
-
}
|
|
561
|
-
}
|
|
562
|
-
return evaluated;
|
|
563
|
-
};
|
|
564
|
-
var validateJson = (value, schema2, {
|
|
565
|
-
resolveRef,
|
|
566
|
-
base = (
|
|
567
|
-
/** @type {{ $id?: string } | null | undefined} */
|
|
568
|
-
schema2?.$id ?? null
|
|
569
|
-
)
|
|
570
|
-
} = {}) => {
|
|
571
|
-
const errs = [];
|
|
572
|
-
const schemaErrors = [];
|
|
573
|
-
if (!isSchema(schema2)) {
|
|
574
|
-
return [
|
|
575
|
-
{
|
|
576
|
-
path: "$",
|
|
577
|
-
rule: "schema",
|
|
578
|
-
detail: `expected a schema object or boolean, got ${typeOf(schema2)}`
|
|
579
|
-
}
|
|
580
|
-
];
|
|
581
|
-
}
|
|
582
|
-
validateNode(value, schema2, "$", errs, {
|
|
583
|
-
rootSchema: schema2,
|
|
584
|
-
resolveRef,
|
|
585
|
-
base,
|
|
586
|
-
referenceStack: [],
|
|
587
|
-
schemaErrors,
|
|
588
|
-
checkedSchemas: /* @__PURE__ */ new WeakSet(),
|
|
589
|
-
reportedReferences: /* @__PURE__ */ new WeakSet()
|
|
590
|
-
});
|
|
591
|
-
return [...schemaErrors, ...errs];
|
|
592
|
-
};
|
|
593
|
-
|
|
594
|
-
// packages/protocol/src/design-contracts.mjs
|
|
595
|
-
var DESIGN_DOCUMENT_VERSION = "1.0.0";
|
|
596
|
-
var freeze = (value) => {
|
|
597
|
-
if (value && typeof value === "object") {
|
|
598
|
-
for (const nested of Object.values(value)) freeze(nested);
|
|
599
|
-
Object.freeze(value);
|
|
600
|
-
}
|
|
601
|
-
return value;
|
|
602
|
-
};
|
|
603
|
-
var FRAME_SCHEMA = {
|
|
604
|
-
type: "array",
|
|
605
|
-
minItems: 1,
|
|
606
|
-
items: {
|
|
607
|
-
type: "object",
|
|
608
|
-
additionalProperties: false,
|
|
609
|
-
required: ["id", "label", "width", "height"],
|
|
610
|
-
properties: {
|
|
611
|
-
id: { $ref: "#/$defs/id" },
|
|
612
|
-
label: { $ref: "#/$defs/text" },
|
|
613
|
-
width: { type: "integer", minimum: 1, maximum: 16384 },
|
|
614
|
-
height: { type: "integer", minimum: 1, maximum: 16384 }
|
|
615
|
-
}
|
|
616
|
-
}
|
|
617
|
-
};
|
|
618
|
-
var DESIGN_DOCUMENT_V1_SCHEMA = freeze({
|
|
619
|
-
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
620
|
-
$id: "https://openplanr.dev/schemas/v1.9.0/design-document.schema.json",
|
|
621
|
-
"x-openplanr-contract": { id: "design-document", version: "1.9.0" },
|
|
622
|
-
title: "OpenPlanr authored design document",
|
|
623
|
-
type: "object",
|
|
624
|
-
additionalProperties: false,
|
|
625
|
-
required: [
|
|
626
|
-
"kind",
|
|
627
|
-
"schemaVersion",
|
|
628
|
-
"id",
|
|
629
|
-
"title",
|
|
630
|
-
"brief",
|
|
631
|
-
"frames",
|
|
632
|
-
"screens",
|
|
633
|
-
"screenOrder",
|
|
634
|
-
"variants",
|
|
635
|
-
"selectedVariant",
|
|
636
|
-
"defaultView"
|
|
637
|
-
],
|
|
638
|
-
properties: {
|
|
639
|
-
kind: { const: "openplanr-design-document" },
|
|
640
|
-
schemaVersion: { const: DESIGN_DOCUMENT_VERSION },
|
|
641
|
-
id: { $ref: "#/$defs/id" },
|
|
642
|
-
title: { $ref: "#/$defs/text" },
|
|
643
|
-
brief: {
|
|
644
|
-
type: "object",
|
|
645
|
-
additionalProperties: false,
|
|
646
|
-
required: ["text", "source", "provenance"],
|
|
647
|
-
properties: {
|
|
648
|
-
text: { $ref: "#/$defs/text" },
|
|
649
|
-
source: { enum: ["spec", "png", "describe"] },
|
|
650
|
-
provenance: { enum: ["spec", "inferred"] },
|
|
651
|
-
references: { type: "array", items: { $ref: "#/$defs/text" }, uniqueItems: true }
|
|
652
|
-
}
|
|
653
|
-
},
|
|
654
|
-
designSystem: {
|
|
655
|
-
type: "object",
|
|
656
|
-
additionalProperties: false,
|
|
657
|
-
properties: {
|
|
658
|
-
path: { $ref: "#/$defs/localPath" },
|
|
659
|
-
tokens: { $ref: "#/$defs/localPath" },
|
|
660
|
-
spacing: {
|
|
661
|
-
type: "array",
|
|
662
|
-
minItems: 1,
|
|
663
|
-
uniqueItems: true,
|
|
664
|
-
items: { type: "number", minimum: 0, maximum: 16384 }
|
|
665
|
-
}
|
|
666
|
-
}
|
|
667
|
-
},
|
|
668
|
-
assets: { $ref: "#/$defs/paths" },
|
|
669
|
-
frames: FRAME_SCHEMA,
|
|
670
|
-
screens: {
|
|
671
|
-
type: "array",
|
|
672
|
-
minItems: 1,
|
|
673
|
-
items: {
|
|
674
|
-
type: "object",
|
|
675
|
-
additionalProperties: false,
|
|
676
|
-
required: ["id", "title", "source"],
|
|
677
|
-
properties: {
|
|
678
|
-
id: { $ref: "#/$defs/id" },
|
|
679
|
-
title: { $ref: "#/$defs/text" },
|
|
680
|
-
description: { $ref: "#/$defs/text" },
|
|
681
|
-
source: { $ref: "#/$defs/source" },
|
|
682
|
-
anchors: { $ref: "#/$defs/ids" }
|
|
683
|
-
}
|
|
684
|
-
}
|
|
685
|
-
},
|
|
686
|
-
screenOrder: { type: "array", minItems: 1, items: { $ref: "#/$defs/id" }, uniqueItems: true },
|
|
687
|
-
flows: {
|
|
688
|
-
type: "array",
|
|
689
|
-
items: {
|
|
690
|
-
type: "object",
|
|
691
|
-
additionalProperties: false,
|
|
692
|
-
required: ["id", "title", "screens"],
|
|
693
|
-
properties: {
|
|
694
|
-
id: { $ref: "#/$defs/id" },
|
|
695
|
-
title: { $ref: "#/$defs/text" },
|
|
696
|
-
screens: { type: "array", minItems: 1, items: { $ref: "#/$defs/id" } }
|
|
697
|
-
}
|
|
698
|
-
}
|
|
699
|
-
},
|
|
700
|
-
variants: {
|
|
701
|
-
type: "array",
|
|
702
|
-
minItems: 1,
|
|
703
|
-
items: {
|
|
704
|
-
type: "object",
|
|
705
|
-
additionalProperties: false,
|
|
706
|
-
required: ["id", "label", "status"],
|
|
707
|
-
properties: {
|
|
708
|
-
id: { $ref: "#/$defs/id" },
|
|
709
|
-
label: { $ref: "#/$defs/text" },
|
|
710
|
-
description: { $ref: "#/$defs/text" },
|
|
711
|
-
status: { enum: ["ready", "failed"] },
|
|
712
|
-
issue: { $ref: "#/$defs/text" },
|
|
713
|
-
sources: { type: "object", additionalProperties: { $ref: "#/$defs/source" } }
|
|
714
|
-
},
|
|
715
|
-
if: { properties: { status: { const: "failed" } } },
|
|
716
|
-
then: { required: ["issue"] }
|
|
717
|
-
}
|
|
718
|
-
},
|
|
719
|
-
selectedVariant: { $ref: "#/$defs/id" },
|
|
720
|
-
defaultView: { enum: ["canvas", "prototype", "walkthrough"] }
|
|
721
|
-
},
|
|
722
|
-
$defs: {
|
|
723
|
-
id: { type: "string", minLength: 1, maxLength: 128, pattern: "^[A-Za-z][A-Za-z0-9_-]*$" },
|
|
724
|
-
text: { type: "string", minLength: 1, pattern: "\\S" },
|
|
725
|
-
ids: { type: "array", items: { $ref: "#/$defs/id" }, uniqueItems: true },
|
|
726
|
-
localPath: {
|
|
727
|
-
type: "string",
|
|
728
|
-
minLength: 1,
|
|
729
|
-
description: "Path relative to the authored document directory. No URL, traversal, encoded path, query or fragment.",
|
|
730
|
-
pattern: "^(?!/)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*//)(?!.*[/ ]$)[^\\\\:\\u0000-\\u001F%?#]+$"
|
|
731
|
-
},
|
|
732
|
-
paths: { type: "array", items: { $ref: "#/$defs/localPath" }, uniqueItems: true },
|
|
733
|
-
source: {
|
|
734
|
-
type: "object",
|
|
735
|
-
additionalProperties: false,
|
|
736
|
-
required: ["html"],
|
|
737
|
-
properties: {
|
|
738
|
-
html: { $ref: "#/$defs/localPath" },
|
|
739
|
-
styles: { $ref: "#/$defs/paths" },
|
|
740
|
-
scripts: { $ref: "#/$defs/paths" }
|
|
741
|
-
}
|
|
742
|
-
}
|
|
743
|
-
}
|
|
744
|
-
});
|
|
745
|
-
var DESIGN_DOCUMENT_V120_SCHEMA = freeze({
|
|
746
|
-
...DESIGN_DOCUMENT_V1_SCHEMA,
|
|
747
|
-
$id: "https://openplanr.dev/schemas/v1.20.0/design-document.schema.json",
|
|
748
|
-
"x-openplanr-contract": { id: "design-document", version: "1.20.0" },
|
|
749
|
-
properties: {
|
|
750
|
-
.../** @type {Record<string, unknown>} */
|
|
751
|
-
DESIGN_DOCUMENT_V1_SCHEMA.properties,
|
|
752
|
-
frames: {
|
|
753
|
-
...FRAME_SCHEMA,
|
|
754
|
-
items: {
|
|
755
|
-
...FRAME_SCHEMA.items,
|
|
756
|
-
properties: {
|
|
757
|
-
...FRAME_SCHEMA.items.properties,
|
|
758
|
-
height: { anyOf: [{ type: "integer", minimum: 1, maximum: 16384 }, { const: "auto" }] }
|
|
759
|
-
}
|
|
760
|
-
}
|
|
761
|
-
},
|
|
762
|
-
layout: {
|
|
763
|
-
type: "object",
|
|
764
|
-
additionalProperties: false,
|
|
765
|
-
properties: {
|
|
766
|
-
boards: {
|
|
767
|
-
type: "object",
|
|
768
|
-
description: "Keys are screenId, screenId/frameId or screenId/frameId/variantId; each ID must exist in the document.",
|
|
769
|
-
additionalProperties: {
|
|
770
|
-
type: "object",
|
|
771
|
-
additionalProperties: false,
|
|
772
|
-
required: ["x", "y"],
|
|
773
|
-
properties: {
|
|
774
|
-
x: { $ref: "#/$defs/coordinate" },
|
|
775
|
-
y: { $ref: "#/$defs/coordinate" },
|
|
776
|
-
title: { $ref: "#/$defs/text" }
|
|
777
|
-
}
|
|
778
|
-
}
|
|
779
|
-
},
|
|
780
|
-
sections: {
|
|
781
|
-
type: "array",
|
|
782
|
-
items: {
|
|
783
|
-
type: "object",
|
|
784
|
-
additionalProperties: false,
|
|
785
|
-
required: ["id", "x", "y", "text"],
|
|
786
|
-
properties: {
|
|
787
|
-
id: { $ref: "#/$defs/id" },
|
|
788
|
-
x: { $ref: "#/$defs/coordinate" },
|
|
789
|
-
y: { $ref: "#/$defs/coordinate" },
|
|
790
|
-
text: { $ref: "#/$defs/text" },
|
|
791
|
-
maxW: { type: "integer", minimum: 1, maximum: 16384 }
|
|
792
|
-
}
|
|
793
|
-
}
|
|
794
|
-
}
|
|
795
|
-
}
|
|
796
|
-
}
|
|
797
|
-
},
|
|
798
|
-
$defs: {
|
|
799
|
-
.../** @type {Record<string, unknown>} */
|
|
800
|
-
DESIGN_DOCUMENT_V1_SCHEMA.$defs,
|
|
801
|
-
coordinate: { type: "number", minimum: -1e7, maximum: 1e7 }
|
|
802
|
-
}
|
|
803
|
-
});
|
|
804
|
-
var PROP_TOKEN_SCHEMA = {
|
|
805
|
-
type: "string",
|
|
806
|
-
minLength: 1,
|
|
807
|
-
maxLength: 128,
|
|
808
|
-
pattern: "^[a-z][a-z0-9-]*(?![\\s\\S])"
|
|
809
|
-
};
|
|
810
|
-
var propTokenPattern = new RegExp(PROP_TOKEN_SCHEMA.pattern, "u");
|
|
811
|
-
var currentDocument = (
|
|
812
|
-
/** @type {{ properties: Record<string, unknown>; [key: string]: unknown }} */
|
|
813
|
-
structuredClone(DESIGN_DOCUMENT_V120_SCHEMA)
|
|
814
|
-
);
|
|
815
|
-
currentDocument.$id = "https://openplanr.dev/schemas/v1.22.0/design-document.schema.json";
|
|
816
|
-
currentDocument["x-openplanr-contract"] = { id: "design-document", version: "1.22.0" };
|
|
817
|
-
currentDocument.properties.schemaVersion = { enum: ["1.0.0", "1.1.0"] };
|
|
818
|
-
var screenSchema = (
|
|
819
|
-
/** @type {{ items: { properties: Record<string, unknown> } }} */
|
|
820
|
-
currentDocument.properties.screens
|
|
821
|
-
);
|
|
822
|
-
screenSchema.items.properties.props = {
|
|
823
|
-
type: "object",
|
|
824
|
-
propertyNames: PROP_TOKEN_SCHEMA,
|
|
825
|
-
additionalProperties: {
|
|
826
|
-
oneOf: [
|
|
827
|
-
{
|
|
828
|
-
type: "object",
|
|
829
|
-
additionalProperties: false,
|
|
830
|
-
required: ["type", "options", "default"],
|
|
831
|
-
properties: {
|
|
832
|
-
type: { const: "enum" },
|
|
833
|
-
options: {
|
|
834
|
-
type: "array",
|
|
835
|
-
minItems: 1,
|
|
836
|
-
uniqueItems: true,
|
|
837
|
-
items: PROP_TOKEN_SCHEMA
|
|
838
|
-
},
|
|
839
|
-
default: PROP_TOKEN_SCHEMA
|
|
840
|
-
}
|
|
841
|
-
},
|
|
842
|
-
{
|
|
843
|
-
type: "object",
|
|
844
|
-
additionalProperties: false,
|
|
845
|
-
required: ["type", "default"],
|
|
846
|
-
properties: { type: { const: "boolean" }, default: { type: "boolean" } }
|
|
847
|
-
}
|
|
848
|
-
]
|
|
849
|
-
}
|
|
850
|
-
};
|
|
851
|
-
var variantSchema = (
|
|
852
|
-
/** @type {{ items: { properties: Record<string, unknown> } }} */
|
|
853
|
-
currentDocument.properties.variants
|
|
854
|
-
);
|
|
855
|
-
variantSchema.items.properties.props = {
|
|
856
|
-
type: "object",
|
|
857
|
-
propertyNames: { $ref: "#/$defs/id" },
|
|
858
|
-
additionalProperties: {
|
|
859
|
-
type: "object",
|
|
860
|
-
propertyNames: PROP_TOKEN_SCHEMA,
|
|
861
|
-
additionalProperties: { anyOf: [PROP_TOKEN_SCHEMA, { type: "boolean" }] }
|
|
862
|
-
}
|
|
863
|
-
};
|
|
864
|
-
currentDocument.allOf = [
|
|
865
|
-
{
|
|
866
|
-
if: { properties: { schemaVersion: { const: "1.1.0" } }, required: ["schemaVersion"] },
|
|
867
|
-
else: {
|
|
868
|
-
properties: {
|
|
869
|
-
screens: { items: { not: { required: ["props"] } } },
|
|
870
|
-
variants: { items: { not: { required: ["props"] } } }
|
|
871
|
-
}
|
|
872
|
-
}
|
|
873
|
-
}
|
|
874
|
-
];
|
|
875
|
-
var DESIGN_DOCUMENT_SCHEMA = freeze(currentDocument);
|
|
876
|
-
|
|
877
|
-
// packages/protocol/src/design-review-bundle-contracts.mjs
|
|
878
|
-
var DESIGN_WORKSPACE_VERSION = "1.0.0";
|
|
879
|
-
var designProperties = (
|
|
880
|
-
/** @type {Record<string, { items: { properties: Record<string, unknown>; required: string[] } }>} */
|
|
881
|
-
structuredClone(DESIGN_DOCUMENT_V1_SCHEMA.properties)
|
|
882
|
-
);
|
|
883
|
-
for (const key of ["kind", "schemaVersion", "brief", "assets", "designSystem"])
|
|
884
|
-
delete designProperties[key];
|
|
885
|
-
delete designProperties.screens.items.properties.source;
|
|
886
|
-
designProperties.screens.items.required = ["id", "title"];
|
|
887
|
-
delete designProperties.variants.items.properties.sources;
|
|
888
|
-
var DESIGN_REVIEW_BUNDLE_SCHEMA = {
|
|
889
|
-
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
890
|
-
$id: "https://openplanr.dev/schemas/v1.9.0/design-review-bundle.schema.json",
|
|
891
|
-
"x-openplanr-contract": { id: "design-review-bundle", version: "1.9.0" },
|
|
892
|
-
type: "object",
|
|
893
|
-
additionalProperties: false,
|
|
894
|
-
properties: {
|
|
895
|
-
kind: { const: "openplanr-design-review-bundle" },
|
|
896
|
-
schemaVersion: { const: DESIGN_WORKSPACE_VERSION },
|
|
897
|
-
design: {
|
|
898
|
-
type: "object",
|
|
899
|
-
additionalProperties: false,
|
|
900
|
-
properties: designProperties,
|
|
901
|
-
required: [
|
|
902
|
-
"id",
|
|
903
|
-
"title",
|
|
904
|
-
"frames",
|
|
905
|
-
"screens",
|
|
906
|
-
"screenOrder",
|
|
907
|
-
"variants",
|
|
908
|
-
"selectedVariant",
|
|
909
|
-
"defaultView"
|
|
910
|
-
]
|
|
911
|
-
},
|
|
912
|
-
envelope: {
|
|
913
|
-
type: "object",
|
|
914
|
-
required: ["schemaVersion", "artifacts", "viewer"]
|
|
915
|
-
},
|
|
916
|
-
entries: {
|
|
917
|
-
type: "array",
|
|
918
|
-
minItems: 1,
|
|
919
|
-
maxItems: 256,
|
|
920
|
-
items: {
|
|
921
|
-
type: "object",
|
|
922
|
-
additionalProperties: false,
|
|
923
|
-
required: ["artifactId", "screenId", "variantId", "frameId"],
|
|
924
|
-
properties: Object.fromEntries(
|
|
925
|
-
["artifactId", "screenId", "variantId", "frameId"].map((key) => [
|
|
926
|
-
key,
|
|
927
|
-
{ type: "string", minLength: 1, maxLength: 128 }
|
|
928
|
-
])
|
|
929
|
-
)
|
|
930
|
-
}
|
|
931
|
-
},
|
|
932
|
-
state: {
|
|
933
|
-
type: ["object", "null"],
|
|
934
|
-
additionalProperties: false,
|
|
935
|
-
properties: {
|
|
936
|
-
positions: {
|
|
937
|
-
type: "object",
|
|
938
|
-
additionalProperties: {
|
|
939
|
-
type: "object",
|
|
940
|
-
additionalProperties: false,
|
|
941
|
-
required: ["x", "y"],
|
|
942
|
-
properties: {
|
|
943
|
-
x: { type: "number", minimum: -1e7, maximum: 1e7 },
|
|
944
|
-
y: { type: "number", minimum: -1e7, maximum: 1e7 }
|
|
945
|
-
}
|
|
946
|
-
}
|
|
947
|
-
}
|
|
948
|
-
}
|
|
949
|
-
},
|
|
950
|
-
revision: { type: "string", minLength: 1, maxLength: 128 },
|
|
951
|
-
verification: {
|
|
952
|
-
type: ["object", "null"],
|
|
953
|
-
additionalProperties: false,
|
|
954
|
-
properties: {
|
|
955
|
-
status: { enum: ["verified", "unverified", "failed", "pending"] }
|
|
956
|
-
}
|
|
957
|
-
}
|
|
958
|
-
},
|
|
959
|
-
required: ["kind", "schemaVersion", "design", "envelope", "entries", "revision"],
|
|
960
|
-
$defs: structuredClone(DESIGN_DOCUMENT_V1_SCHEMA.$defs)
|
|
961
|
-
};
|
|
962
|
-
|
|
963
|
-
// packages/protocol/src/review-experience-contracts.mjs
|
|
964
|
-
var text = { type: "string", maxLength: 16384 };
|
|
965
|
-
var id = { type: "string", minLength: 1, maxLength: 128 };
|
|
966
|
-
var digest = { type: "string", pattern: "^[a-f0-9]{64}$" };
|
|
967
|
-
var texts = { type: "array", maxItems: 256, items: text };
|
|
968
|
-
var closed = (properties, required = Object.keys(properties)) => ({
|
|
969
|
-
type: "object",
|
|
970
|
-
additionalProperties: false,
|
|
971
|
-
properties,
|
|
972
|
-
required
|
|
973
|
-
});
|
|
974
|
-
var list = (items, maxItems = 256) => ({ type: "array", maxItems, items });
|
|
975
|
-
var schema = (name, properties, required) => ({
|
|
976
|
-
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
977
|
-
$id: `https://openplanr.dev/schemas/v1.10.0/${name}.schema.json`,
|
|
978
|
-
"x-openplanr-contract": { id: name, version: "1.10.0" },
|
|
979
|
-
...closed(properties, required)
|
|
980
|
-
});
|
|
981
|
-
var DESIGN_REVIEW_CONTEXT_SCHEMA = schema(
|
|
982
|
-
"design-review-context",
|
|
983
|
-
{
|
|
984
|
-
kind: { const: "openplanr-design-review-context" },
|
|
985
|
-
schemaVersion: { const: "1.0.0" },
|
|
986
|
-
designId: id,
|
|
987
|
-
brief: closed({ purpose: text, requests: { ...texts, maxItems: 3 }, audience: text }, [
|
|
988
|
-
"purpose",
|
|
989
|
-
"requests"
|
|
990
|
-
]),
|
|
991
|
-
revisionSummary: text,
|
|
992
|
-
implementation: closed({
|
|
993
|
-
tokens: list(closed({ name: id, value: text, description: text }, ["name", "value"]), 512),
|
|
994
|
-
components: list(
|
|
995
|
-
closed(
|
|
996
|
-
{
|
|
997
|
-
id,
|
|
998
|
-
name: text,
|
|
999
|
-
screenIds: list(id),
|
|
1000
|
-
anchorIds: list(id),
|
|
1001
|
-
states: list(closed({ name: id, description: text })),
|
|
1002
|
-
notes: text,
|
|
1003
|
-
responsive: text,
|
|
1004
|
-
accessibility: text
|
|
1005
|
-
},
|
|
1006
|
-
["id", "name"]
|
|
1007
|
-
)
|
|
1008
|
-
),
|
|
1009
|
-
responsive: texts,
|
|
1010
|
-
accessibility: texts
|
|
1011
|
-
})
|
|
1012
|
-
},
|
|
1013
|
-
["kind", "schemaVersion", "designId", "brief", "implementation"]
|
|
1014
|
-
);
|
|
1015
|
-
var DESIGN_FINGERPRINT_SCHEMA = closed({
|
|
1016
|
-
screenId: id,
|
|
1017
|
-
variantId: id,
|
|
1018
|
-
frameId: id,
|
|
1019
|
-
contentDigest: digest,
|
|
1020
|
-
guidanceDigest: digest
|
|
1021
|
-
});
|
|
1022
|
-
var bundleV11 = {
|
|
1023
|
-
.../** @type {MutableSchema} */
|
|
1024
|
-
structuredClone(DESIGN_REVIEW_BUNDLE_SCHEMA),
|
|
1025
|
-
$id: "https://openplanr.dev/schemas/v1.10.0/design-review-bundle.schema.json",
|
|
1026
|
-
"x-openplanr-contract": { id: "design-review-bundle", version: "1.10.0" }
|
|
1027
|
-
};
|
|
1028
|
-
Object.assign(bundleV11.properties, {
|
|
1029
|
-
schemaVersion: { const: "1.1.0" },
|
|
1030
|
-
reviewContext: DESIGN_REVIEW_CONTEXT_SCHEMA,
|
|
1031
|
-
contextDigest: digest,
|
|
1032
|
-
fingerprints: list(DESIGN_FINGERPRINT_SCHEMA)
|
|
1033
|
-
});
|
|
1034
|
-
bundleV11.required.push("reviewContext", "contextDigest", "fingerprints");
|
|
1035
|
-
var DESIGN_REVIEW_BUNDLE_V11_SCHEMA = bundleV11;
|
|
1036
|
-
var bundleV12 = (
|
|
1037
|
-
/** @type {MutableSchema} */
|
|
1038
|
-
structuredClone(DESIGN_REVIEW_BUNDLE_V11_SCHEMA)
|
|
1039
|
-
);
|
|
1040
|
-
bundleV12.$id = "https://openplanr.dev/schemas/v1.16.0/design-review-bundle.schema.json";
|
|
1041
|
-
bundleV12["x-openplanr-contract"] = { id: "design-review-bundle", version: "1.16.0" };
|
|
1042
|
-
Object.assign(bundleV12.properties, {
|
|
1043
|
-
schemaVersion: { const: "1.2.0" },
|
|
1044
|
-
envelope: {
|
|
1045
|
-
type: "object",
|
|
1046
|
-
required: ["schemaVersion", "sources", "artifacts", "viewer"],
|
|
1047
|
-
properties: { schemaVersion: { const: "1.1.0" } }
|
|
1048
|
-
},
|
|
1049
|
-
entries: {
|
|
1050
|
-
.../** @type {Record<string, unknown>} */
|
|
1051
|
-
bundleV12.properties.entries,
|
|
1052
|
-
maxItems: 4096
|
|
1053
|
-
},
|
|
1054
|
-
fingerprints: list(DESIGN_FINGERPRINT_SCHEMA, 4096)
|
|
1055
|
-
});
|
|
1056
|
-
var bundleCurrent = (
|
|
1057
|
-
/** @type {MutableSchema} */
|
|
1058
|
-
structuredClone(bundleV12)
|
|
1059
|
-
);
|
|
1060
|
-
bundleCurrent.$id = "https://openplanr.dev/schemas/v1.20.0/design-review-bundle.schema.json";
|
|
1061
|
-
bundleCurrent["x-openplanr-contract"] = { id: "design-review-bundle", version: "1.20.0" };
|
|
1062
|
-
bundleCurrent.properties.schemaVersion = { enum: ["1.1.0", "1.2.0"] };
|
|
1063
|
-
bundleCurrent.properties.envelope = bundleV11.properties.envelope;
|
|
1064
|
-
bundleCurrent.allOf = [
|
|
1065
|
-
{
|
|
1066
|
-
if: { properties: { schemaVersion: { const: "1.2.0" } } },
|
|
1067
|
-
then: { properties: { envelope: bundleV12.properties.envelope } }
|
|
1068
|
-
}
|
|
1069
|
-
];
|
|
1070
|
-
var currentDesign = (
|
|
1071
|
-
/** @type {MutableSchema} */
|
|
1072
|
-
bundleCurrent.properties.design
|
|
1073
|
-
);
|
|
1074
|
-
for (const key of ["frames", "layout"])
|
|
1075
|
-
currentDesign.properties[key] = /** @type {Record<string, unknown>} */
|
|
1076
|
-
DESIGN_DOCUMENT_V120_SCHEMA.properties[key];
|
|
1077
|
-
bundleCurrent.$defs = structuredClone(DESIGN_DOCUMENT_V120_SCHEMA.$defs);
|
|
1078
|
-
var currentEntries = (
|
|
1079
|
-
/** @type {{ items: { properties: Record<string, unknown> } }} */
|
|
1080
|
-
bundleCurrent.properties.entries
|
|
1081
|
-
);
|
|
1082
|
-
currentEntries.items.properties.height = { const: "auto" };
|
|
1083
|
-
var bundleProps = (
|
|
1084
|
-
/** @type {MutableSchema} */
|
|
1085
|
-
structuredClone(bundleCurrent)
|
|
1086
|
-
);
|
|
1087
|
-
bundleProps.$id = "https://openplanr.dev/schemas/v1.22.0/design-review-bundle.schema.json";
|
|
1088
|
-
bundleProps["x-openplanr-contract"] = { id: "design-review-bundle", version: "1.22.0" };
|
|
1089
|
-
var propsDesign = (
|
|
1090
|
-
/** @type {MutableSchema} */
|
|
1091
|
-
bundleProps.properties.design
|
|
1092
|
-
);
|
|
1093
|
-
var authoredProperties = (
|
|
1094
|
-
/** @type {Record<string, unknown>} */
|
|
1095
|
-
DESIGN_DOCUMENT_SCHEMA.properties
|
|
1096
|
-
);
|
|
1097
|
-
propsDesign.properties.schemaVersion = authoredProperties.schemaVersion;
|
|
1098
|
-
for (const key of ["screens", "variants"]) {
|
|
1099
|
-
const projected = (
|
|
1100
|
-
/** @type {{ items: { properties: Record<string, unknown> } }} */
|
|
1101
|
-
propsDesign.properties[key]
|
|
1102
|
-
);
|
|
1103
|
-
const authored = (
|
|
1104
|
-
/** @type {{ items: { properties: Record<string, unknown> } }} */
|
|
1105
|
-
authoredProperties[key]
|
|
1106
|
-
);
|
|
1107
|
-
projected.items.properties.props = authored.items.properties.props;
|
|
1108
|
-
}
|
|
1109
|
-
propsDesign.allOf = structuredClone(DESIGN_DOCUMENT_SCHEMA.allOf);
|
|
1110
|
-
var item = closed(
|
|
1111
|
-
{
|
|
1112
|
-
pinId: id,
|
|
1113
|
-
reviewId: id,
|
|
1114
|
-
screenId: id,
|
|
1115
|
-
revisionId: id,
|
|
1116
|
-
text,
|
|
1117
|
-
refinement: text,
|
|
1118
|
-
stale: { type: "boolean" },
|
|
1119
|
-
author: text,
|
|
1120
|
-
reviewOf: digest,
|
|
1121
|
-
source: text
|
|
1122
|
-
},
|
|
1123
|
-
["pinId", "text"]
|
|
1124
|
-
);
|
|
1125
|
-
var DESIGN_HANDOFF_CONTENT_SCHEMA = closed({
|
|
1126
|
-
summary: text,
|
|
1127
|
-
agreedChanges: list(item, 1e4),
|
|
1128
|
-
openQuestions: list(item, 1e4),
|
|
1129
|
-
deferred: list(item, 1e4),
|
|
1130
|
-
rejected: list(item, 1e4)
|
|
1131
|
-
});
|
|
1132
|
-
var DESIGN_HANDOFF_SCHEMA = schema(
|
|
1133
|
-
"design-review-handoff",
|
|
1134
|
-
{
|
|
1135
|
-
kind: { const: "openplanr-design-review-handoff" },
|
|
1136
|
-
schemaVersion: { const: "1.0.0" },
|
|
1137
|
-
title: text,
|
|
1138
|
-
version: { type: "integer", minimum: 1 },
|
|
1139
|
-
status: { enum: ["draft", "approved"] },
|
|
1140
|
-
basis: closed({
|
|
1141
|
-
designId: id,
|
|
1142
|
-
sourceRevision: digest,
|
|
1143
|
-
contextDigest: digest,
|
|
1144
|
-
reviewOf: digest,
|
|
1145
|
-
selectedVariant: id,
|
|
1146
|
-
feedbackDigest: digest,
|
|
1147
|
-
verificationDigest: digest,
|
|
1148
|
-
feedbackWatermark: { type: "integer", minimum: 0 }
|
|
1149
|
-
}),
|
|
1150
|
-
content: DESIGN_HANDOFF_CONTENT_SCHEMA,
|
|
1151
|
-
contentHash: digest,
|
|
1152
|
-
markdown: { type: "string", maxLength: 2097152 },
|
|
1153
|
-
affectedScreens: list(id),
|
|
1154
|
-
verificationGaps: texts,
|
|
1155
|
-
reviewNotes: list(closed({ reviewId: id, text }), 1e4),
|
|
1156
|
-
approval: closed({ contentHash: digest, at: { type: "string", format: "date-time" } })
|
|
1157
|
-
},
|
|
1158
|
-
[
|
|
1159
|
-
"kind",
|
|
1160
|
-
"schemaVersion",
|
|
1161
|
-
"title",
|
|
1162
|
-
"version",
|
|
1163
|
-
"status",
|
|
1164
|
-
"basis",
|
|
1165
|
-
"content",
|
|
1166
|
-
"contentHash",
|
|
1167
|
-
"markdown",
|
|
1168
|
-
"affectedScreens",
|
|
1169
|
-
"verificationGaps",
|
|
1170
|
-
"reviewNotes"
|
|
1171
|
-
]
|
|
1172
|
-
);
|
|
1173
|
-
var DESIGN_REVIEW_METADATA_PAYLOAD_SCHEMA = {
|
|
1174
|
-
...schema(
|
|
1175
|
-
"design-review-metadata-payload",
|
|
1176
|
-
{
|
|
1177
|
-
schemaVersion: { const: "1.0.0" },
|
|
1178
|
-
kind: { enum: ["category", "disposition"] },
|
|
1179
|
-
author: { ...text, minLength: 1, maxLength: 160 },
|
|
1180
|
-
reviewOf: digest,
|
|
1181
|
-
pinId: id,
|
|
1182
|
-
category: { enum: ["question", "suggestion", "blocker"] },
|
|
1183
|
-
disposition: { enum: ["accepted", "deferred", "rejected"] },
|
|
1184
|
-
reason: text,
|
|
1185
|
-
updatedAt: { type: "string", format: "date-time" }
|
|
1186
|
-
},
|
|
1187
|
-
["schemaVersion", "kind", "author", "reviewOf", "pinId", "updatedAt"]
|
|
1188
|
-
),
|
|
1189
|
-
allOf: [
|
|
1190
|
-
{
|
|
1191
|
-
if: { properties: { kind: { const: "category" } } },
|
|
1192
|
-
then: { required: ["category"], not: { required: ["disposition"] } }
|
|
1193
|
-
},
|
|
1194
|
-
{
|
|
1195
|
-
if: { properties: { kind: { const: "disposition" } } },
|
|
1196
|
-
then: { required: ["disposition", "reason"], not: { required: ["category"] } }
|
|
1197
|
-
}
|
|
1198
|
-
]
|
|
1199
|
-
};
|
|
1200
|
-
var payloadV11 = {
|
|
1201
|
-
.../** @type {MutableSchema} */
|
|
1202
|
-
structuredClone(DESIGN_REVIEW_METADATA_PAYLOAD_SCHEMA),
|
|
1203
|
-
$id: "https://openplanr.dev/schemas/v1.11.0/design-review-metadata-payload.schema.json",
|
|
1204
|
-
"x-openplanr-contract": { id: "design-review-metadata-payload", version: "1.11.0" }
|
|
1205
|
-
};
|
|
1206
|
-
Object.assign(payloadV11.properties, {
|
|
1207
|
-
schemaVersion: { const: "1.1.0" },
|
|
1208
|
-
category: { enum: ["question", "suggestion", "change-request", "blocker"] }
|
|
1209
|
-
});
|
|
1210
|
-
function assertReviewExperience(value, contract) {
|
|
1211
|
-
const errors = validateJson(value, contract);
|
|
1212
|
-
if (errors.length)
|
|
1213
|
-
throw new TypeError(
|
|
1214
|
-
`Invalid ${contract["x-openplanr-contract"]?.id ?? "review data"}: ${errors.slice(0, 4).map((item2) => `${item2.path} ${item2.detail}`).join("; ")}`
|
|
1215
|
-
);
|
|
1216
|
-
return value;
|
|
1217
|
-
}
|
|
1218
|
-
var REVIEW_EXPERIENCE_SCHEMAS = Object.freeze({
|
|
1219
|
-
"design-review-context": DESIGN_REVIEW_CONTEXT_SCHEMA,
|
|
1220
|
-
"design-review-bundle": DESIGN_REVIEW_BUNDLE_V11_SCHEMA,
|
|
1221
|
-
"design-review-handoff": DESIGN_HANDOFF_SCHEMA,
|
|
1222
|
-
"design-review-metadata-payload": DESIGN_REVIEW_METADATA_PAYLOAD_SCHEMA
|
|
1223
|
-
});
|
|
1224
|
-
|
|
1225
|
-
export {
|
|
1226
|
-
validateJson,
|
|
1227
|
-
canonicalizeJson,
|
|
1228
|
-
assertPlainData,
|
|
1229
|
-
DESIGN_REVIEW_CONTEXT_SCHEMA,
|
|
1230
|
-
DESIGN_HANDOFF_SCHEMA,
|
|
1231
|
-
assertReviewExperience
|
|
1232
|
-
};
|