openplanr 3.2.0 → 3.4.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 +73 -0
- package/dist/cli/commands/artifact-design-share.d.ts +9 -0
- package/dist/cli/commands/artifact-design-share.d.ts.map +1 -0
- package/dist/cli/commands/artifact-design-share.js +200 -0
- package/dist/cli/commands/artifact-design-share.js.map +1 -0
- package/dist/cli/commands/artifact.d.ts.map +1 -1
- package/dist/cli/commands/artifact.js +5 -18
- package/dist/cli/commands/artifact.js.map +1 -1
- package/dist/cli/commands/ship.d.ts.map +1 -1
- package/dist/cli/commands/ship.js +2 -0
- package/dist/cli/commands/ship.js.map +1 -1
- package/dist/cli/commands/spec.d.ts +2 -1
- package/dist/cli/commands/spec.d.ts.map +1 -1
- package/dist/cli/commands/spec.js +45 -5
- package/dist/cli/commands/spec.js.map +1 -1
- package/dist/dashboard/.vite/manifest.json +2 -2
- package/dist/dashboard/assets/index-Cv4Vwhuw.css +2 -0
- package/dist/dashboard/assets/index-CvQAlBy3.js +75 -0
- package/dist/dashboard/assets/index-CvQAlBy3.js.map +1 -0
- package/dist/dashboard/dashboard-manifest.json +14 -14
- package/dist/dashboard/index.html +2 -2
- package/dist/services/claude-plugin-service.d.ts +5 -0
- package/dist/services/claude-plugin-service.d.ts.map +1 -1
- package/dist/services/claude-plugin-service.js +18 -2
- package/dist/services/claude-plugin-service.js.map +1 -1
- package/dist/services/codex-plugin-service.d.ts.map +1 -1
- package/dist/services/codex-plugin-service.js +11 -3
- package/dist/services/codex-plugin-service.js.map +1 -1
- package/dist/services/design-artifact-service.d.ts +20 -1
- package/dist/services/design-artifact-service.d.ts.map +1 -1
- package/dist/services/design-artifact-service.js +137 -18
- package/dist/services/design-artifact-service.js.map +1 -1
- package/dist/services/runtime-manager/codex-discovery.d.ts +1 -3
- package/dist/services/runtime-manager/codex-discovery.d.ts.map +1 -1
- package/dist/services/runtime-manager/codex-discovery.js +3 -16
- package/dist/services/runtime-manager/codex-discovery.js.map +1 -1
- package/dist/services/runtime-manager/doctor.d.ts +25 -0
- package/dist/services/runtime-manager/doctor.d.ts.map +1 -1
- package/dist/services/runtime-manager/doctor.js +480 -0
- package/dist/services/runtime-manager/doctor.js.map +1 -1
- package/dist/services/runtime-manager/errors.d.ts +12 -0
- package/dist/services/runtime-manager/errors.d.ts.map +1 -0
- package/dist/services/runtime-manager/errors.js +14 -0
- package/dist/services/runtime-manager/errors.js.map +1 -0
- package/dist/services/runtime-manager/global-state.d.ts +7 -0
- package/dist/services/runtime-manager/global-state.d.ts.map +1 -1
- package/dist/services/runtime-manager/global-state.js +116 -0
- package/dist/services/runtime-manager/global-state.js.map +1 -1
- package/dist/services/runtime-manager/host-version-probe.d.ts +8 -0
- package/dist/services/runtime-manager/host-version-probe.d.ts.map +1 -0
- package/dist/services/runtime-manager/host-version-probe.js +14 -0
- package/dist/services/runtime-manager/host-version-probe.js.map +1 -0
- package/dist/services/runtime-manager/install-plan.d.ts +25 -0
- package/dist/services/runtime-manager/install-plan.d.ts.map +1 -1
- package/dist/services/runtime-manager/install-plan.js +305 -0
- package/dist/services/runtime-manager/install-plan.js.map +1 -1
- package/dist/services/runtime-manager/inventory.d.ts +6 -0
- package/dist/services/runtime-manager/inventory.d.ts.map +1 -1
- package/dist/services/runtime-manager/inventory.js +16 -1
- package/dist/services/runtime-manager/inventory.js.map +1 -1
- package/dist/services/runtime-manager/legacy-adapters.d.ts +9 -0
- package/dist/services/runtime-manager/legacy-adapters.d.ts.map +1 -0
- package/dist/services/runtime-manager/legacy-adapters.js +187 -0
- package/dist/services/runtime-manager/legacy-adapters.js.map +1 -0
- package/dist/services/runtime-manager/paths.d.ts +18 -0
- package/dist/services/runtime-manager/paths.d.ts.map +1 -0
- package/dist/services/runtime-manager/paths.js +83 -0
- package/dist/services/runtime-manager/paths.js.map +1 -0
- package/dist/services/runtime-manager/runtime-package.d.ts +21 -0
- package/dist/services/runtime-manager/runtime-package.d.ts.map +1 -1
- package/dist/services/runtime-manager/runtime-package.js +77 -0
- package/dist/services/runtime-manager/runtime-package.js.map +1 -1
- package/dist/services/runtime-manager/storage.d.ts +47 -0
- package/dist/services/runtime-manager/storage.d.ts.map +1 -0
- package/dist/services/runtime-manager/storage.js +604 -0
- package/dist/services/runtime-manager/storage.js.map +1 -0
- package/dist/services/runtime-manager-service.d.ts +7 -17
- package/dist/services/runtime-manager-service.d.ts.map +1 -1
- package/dist/services/runtime-manager-service.js +32 -1695
- package/dist/services/runtime-manager-service.js.map +1 -1
- package/dist/services/ship-checks/contract.d.ts +15 -1
- package/dist/services/ship-checks/contract.d.ts.map +1 -1
- package/dist/services/ship-checks/contract.js +1 -1
- package/dist/services/ship-checks/contract.js.map +1 -1
- package/dist/services/ship-checks/coverage.d.ts +4 -0
- package/dist/services/ship-checks/coverage.d.ts.map +1 -0
- package/dist/services/ship-checks/coverage.js +113 -0
- package/dist/services/ship-checks/coverage.js.map +1 -0
- package/dist/services/ship-checks/discover.d.ts.map +1 -1
- package/dist/services/ship-checks/discover.js +5 -1
- package/dist/services/ship-checks/discover.js.map +1 -1
- package/dist/services/ship-checks/package-contents.d.ts +4 -0
- package/dist/services/ship-checks/package-contents.d.ts.map +1 -0
- package/dist/services/ship-checks/package-contents.js +91 -0
- package/dist/services/ship-checks/package-contents.js.map +1 -0
- package/dist/services/ship-checks/packages.d.ts +2 -0
- package/dist/services/ship-checks/packages.d.ts.map +1 -1
- package/dist/services/ship-checks/packages.js +4 -0
- package/dist/services/ship-checks/packages.js.map +1 -1
- package/dist/services/ship-checks/scope.js +2 -1
- package/dist/services/ship-checks/scope.js.map +1 -1
- package/dist/services/spec-service.d.ts +18 -0
- package/dist/services/spec-service.d.ts.map +1 -1
- package/dist/services/spec-service.js +174 -9
- package/dist/services/spec-service.js.map +1 -1
- package/dist/templates/spec/spec-shaped.md.hbs +1 -1
- package/dist/templates/spec/spec.md.hbs +2 -2
- package/dist/utils/splice-managed-block.js +1 -1
- package/dist/utils/splice-managed-block.js.map +1 -1
- package/docs/CLI.md +86 -2
- package/lib/host-packages/adapter-registry.json +5 -5
- package/lib/host-packages/capability-map.json +3 -3
- package/lib/host-packages/claude/.claude-plugin/marketplace.json +3 -3
- package/lib/host-packages/claude/openplanr/.claude-plugin/plugin.json +6 -6
- package/lib/host-packages/claude/openplanr/.openplanr-content.json +94 -146
- package/lib/host-packages/claude/openplanr/README.md +12 -12
- package/lib/host-packages/claude/openplanr/agents/planr-qa.md +5 -3
- package/lib/host-packages/claude/openplanr/references/agents/shared/modes/shared/task-context-resolution.md +4 -4
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-artifact-shell.mjs +2 -4
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-document.mjs +110 -25
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-handoff.mjs +851 -57
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-review-state-store.mjs +45 -0
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-review.mjs +65 -74
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-runtime-home.mjs +0 -1
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-share-cli-bridge.mjs +321 -0
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-shared-artifact-support-dependencies-design-support-protocol-contracts-d707e49b.mjs +1652 -0
- package/lib/host-packages/{openai/openplanr/runtime/design/scripts/design-shared-artifact-support-protocol-contracts-ea2cd15e.mjs → claude/openplanr/runtime/design/scripts/design-shared-artifact-support-protocol-contracts-9f6918b0.mjs} +537 -5
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-shared-design-support-0bac378d.mjs +137 -0
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design.mjs +374 -61
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +32 -59
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/02-artifact-review-ui.js +138 -133
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/03-protocol-contracts.js +1 -5608
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/04-artifact-review-ui.js +2568 -0
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources.json +10 -74
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/package.json +4 -4
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/share.js +8 -2
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/02-react.js +2 -2
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/09-react-dom-client-public-roots.js +5 -5
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/12-protocol-contracts.js +72 -2
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/13-design-review-experience.js +14 -7
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/15-canvas-engine.js +71 -34
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/21-design-studio.js +28 -14
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources.json +12 -12
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/package.json +6 -2
- package/lib/host-packages/{openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.20.0 → claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.22.0}/design-document.schema.json +131 -4
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.22.0/design-review-bundle.schema.json +822 -0
- package/lib/host-packages/claude/openplanr/runtime/plan/scripts/design-protocol-contracts.mjs +616 -4775
- package/lib/host-packages/claude/openplanr/runtime/plan/scripts/design.mjs +219 -424
- package/lib/host-packages/claude/openplanr/runtime/plan/scripts/runtime/packages/protocol/package.json +6 -2
- package/lib/host-packages/claude/openplanr/skills/delegate/SKILL.md +2 -1
- package/lib/host-packages/claude/openplanr/skills/delegate/references/integration-review.md +26 -20
- package/lib/host-packages/claude/openplanr/skills/delegate/references/operator-guide.md +25 -1
- package/lib/host-packages/claude/openplanr/skills/delegate/references/run-handoff.md +2 -2
- package/lib/host-packages/claude/openplanr/skills/delegate/references/worktree-custody.md +17 -9
- package/lib/host-packages/claude/openplanr/skills/delegate/scripts/adapters/claude.mjs +15 -3
- package/lib/host-packages/claude/openplanr/skills/delegate/scripts/adapters/codex.mjs +38 -2
- package/lib/host-packages/claude/openplanr/skills/delegate/scripts/adapters/native.mjs +5 -0
- package/lib/host-packages/claude/openplanr/skills/delegate/scripts/custody.mjs +217 -10
- package/lib/host-packages/claude/openplanr/skills/delegate/scripts/handoff.mjs +1080 -0
- package/lib/host-packages/claude/openplanr/skills/delegate/scripts/integrate.mjs +96 -201
- package/lib/host-packages/claude/openplanr/skills/delegate/scripts/integration-files.mjs +3 -382
- package/lib/host-packages/claude/openplanr/skills/delegate/scripts/presentation.mjs +29 -12
- package/lib/host-packages/claude/openplanr/skills/delegate/scripts/run-contract.mjs +11 -0
- package/lib/host-packages/claude/openplanr/skills/delegate/scripts/run-execution.mjs +1 -1
- package/lib/host-packages/claude/openplanr/skills/delegate/scripts/run-lifecycle.mjs +14 -10
- package/lib/host-packages/claude/openplanr/skills/delegate/scripts/run-preparation.mjs +4 -0
- package/lib/host-packages/claude/openplanr/skills/delegate/scripts/run-record.mjs +2 -2
- package/lib/host-packages/claude/openplanr/skills/design/references/design-system.md +17 -2
- package/lib/host-packages/claude/openplanr/skills/design/references/generation.md +60 -2
- package/lib/host-packages/claude/openplanr/skills/design/references/utilities.md +23 -7
- package/lib/host-packages/claude/openplanr/skills/design/schemas/design-document.schema.json +131 -4
- package/lib/host-packages/claude/openplanr/skills/design-loop/references/design-system.md +17 -2
- package/lib/host-packages/claude/openplanr/skills/design-loop/references/generation.md +60 -2
- package/lib/host-packages/claude/openplanr/skills/design-loop/references/utilities.md +23 -7
- package/lib/host-packages/claude/openplanr/skills/design-loop/schemas/design-document.schema.json +131 -4
- package/lib/host-packages/claude/openplanr/skills/design-review/references/design-system.md +17 -2
- package/lib/host-packages/claude/openplanr/skills/design-review/references/generation.md +60 -2
- package/lib/host-packages/claude/openplanr/skills/design-review/references/utilities.md +23 -7
- package/lib/host-packages/claude/openplanr/skills/design-review/schemas/design-document.schema.json +131 -4
- package/lib/host-packages/claude/openplanr/skills/investigate/SKILL.md +2 -1
- package/lib/host-packages/claude/openplanr/skills/investigate/references/fail-first.md +40 -0
- package/lib/host-packages/claude/openplanr/skills/plan/SKILL.md +21 -11
- package/lib/host-packages/claude/openplanr/skills/plan/schemas/design-document.schema.json +131 -4
- package/lib/host-packages/claude/openplanr/skills/ship/SKILL.md +51 -18
- package/lib/host-packages/claude/openplanr/skills/ship/references/fail-first.md +40 -0
- package/lib/host-packages/claude/openplanr/skills/ship/references/result-contract.md +7 -3
- package/lib/host-packages/claude/openplanr/skills/spec/SKILL.md +6 -0
- package/lib/host-packages/claude/openplanr/skills/spec/references/specification-contract.md +3 -1
- package/lib/host-packages/cursor/openplanr/.openplanr-content.json +91 -143
- package/lib/host-packages/cursor/openplanr/manifest.json +1 -1
- package/lib/host-packages/cursor/openplanr/rules/planr-delegate/references/integration-review.md +26 -20
- package/lib/host-packages/cursor/openplanr/rules/planr-delegate/references/operator-guide.md +25 -1
- package/lib/host-packages/cursor/openplanr/rules/planr-delegate/references/run-handoff.md +2 -2
- package/lib/host-packages/cursor/openplanr/rules/planr-delegate/references/worktree-custody.md +17 -9
- package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/adapters/claude.mjs +15 -3
- package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/adapters/codex.mjs +38 -2
- package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/adapters/native.mjs +5 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/custody.mjs +217 -10
- package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/handoff.mjs +1080 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/integrate.mjs +96 -201
- package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/integration-files.mjs +3 -382
- package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/presentation.mjs +29 -12
- package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/run-contract.mjs +11 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/run-execution.mjs +1 -1
- package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/run-lifecycle.mjs +14 -10
- package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/run-preparation.mjs +4 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/run-record.mjs +2 -2
- package/lib/host-packages/cursor/openplanr/rules/planr-delegate.mdc +2 -1
- package/lib/host-packages/cursor/openplanr/rules/planr-design/references/design-system.md +17 -2
- package/lib/host-packages/cursor/openplanr/rules/planr-design/references/generation.md +60 -2
- package/lib/host-packages/cursor/openplanr/rules/planr-design/references/utilities.md +23 -7
- package/lib/host-packages/cursor/openplanr/rules/planr-design/schemas/design-document.schema.json +131 -4
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/references/design-system.md +17 -2
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/references/generation.md +60 -2
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/references/utilities.md +23 -7
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/schemas/design-document.schema.json +131 -4
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/references/design-system.md +17 -2
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/references/generation.md +60 -2
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/references/utilities.md +23 -7
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/schemas/design-document.schema.json +131 -4
- package/lib/host-packages/cursor/openplanr/rules/planr-investigate/references/fail-first.md +40 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-investigate.mdc +2 -1
- package/lib/host-packages/cursor/openplanr/rules/planr-plan/schemas/design-document.schema.json +131 -4
- package/lib/host-packages/cursor/openplanr/rules/planr-plan.mdc +21 -11
- package/lib/host-packages/cursor/openplanr/rules/planr-ship/references/fail-first.md +40 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-ship/references/result-contract.md +7 -3
- package/lib/host-packages/cursor/openplanr/rules/planr-ship.mdc +51 -18
- package/lib/host-packages/cursor/openplanr/rules/planr-spec/references/specification-contract.md +3 -1
- package/lib/host-packages/cursor/openplanr/rules/planr-spec.mdc +6 -0
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-artifact-shell.mjs +2 -4
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-document.mjs +110 -25
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-handoff.mjs +851 -57
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-review-state-store.mjs +45 -0
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-review.mjs +65 -74
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-runtime-home.mjs +0 -1
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-share-cli-bridge.mjs +321 -0
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-shared-artifact-support-dependencies-design-support-protocol-contracts-d707e49b.mjs +1652 -0
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/{design-shared-artifact-support-protocol-contracts-ea2cd15e.mjs → design-shared-artifact-support-protocol-contracts-9f6918b0.mjs} +537 -5
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-shared-design-support-0bac378d.mjs +137 -0
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design.mjs +374 -61
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +32 -59
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/02-artifact-review-ui.js +138 -133
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/03-protocol-contracts.js +1 -5608
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/04-artifact-review-ui.js +2568 -0
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources.json +10 -74
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/package.json +4 -4
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/share.js +8 -2
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/02-react.js +2 -2
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/09-react-dom-client-public-roots.js +5 -5
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/12-protocol-contracts.js +72 -2
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/13-design-review-experience.js +14 -7
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/15-canvas-engine.js +71 -34
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/21-design-studio.js +28 -14
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources.json +12 -12
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/package.json +6 -2
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/{v1.20.0 → v1.22.0}/design-document.schema.json +131 -4
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.22.0/design-review-bundle.schema.json +822 -0
- package/lib/host-packages/cursor/openplanr/runtime/plan/scripts/design-protocol-contracts.mjs +616 -4775
- package/lib/host-packages/cursor/openplanr/runtime/plan/scripts/design.mjs +219 -424
- package/lib/host-packages/cursor/openplanr/runtime/plan/scripts/runtime/packages/protocol/package.json +6 -2
- package/lib/host-packages/openai/.claude-plugin/marketplace.json +3 -3
- package/lib/host-packages/openai/openplanr/.codex-plugin/plugin.json +2 -2
- package/lib/host-packages/openai/openplanr/.openplanr-content.json +98 -150
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-artifact-shell.mjs +2 -4
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-document.mjs +110 -25
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-handoff.mjs +851 -57
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-review-state-store.mjs +45 -0
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-review.mjs +65 -74
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-runtime-home.mjs +0 -1
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-share-cli-bridge.mjs +321 -0
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-shared-artifact-support-dependencies-design-support-protocol-contracts-d707e49b.mjs +1652 -0
- package/lib/host-packages/{claude/openplanr/runtime/design/scripts/design-shared-artifact-support-protocol-contracts-ea2cd15e.mjs → openai/openplanr/runtime/design/scripts/design-shared-artifact-support-protocol-contracts-9f6918b0.mjs} +537 -5
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-shared-design-support-0bac378d.mjs +137 -0
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design.mjs +374 -61
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +32 -59
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/02-artifact-review-ui.js +138 -133
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/03-protocol-contracts.js +1 -5608
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/04-artifact-review-ui.js +2568 -0
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources.json +10 -74
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/package.json +4 -4
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/share.js +8 -2
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/02-react.js +2 -2
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/09-react-dom-client-public-roots.js +5 -5
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/12-protocol-contracts.js +72 -2
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/13-design-review-experience.js +14 -7
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/15-canvas-engine.js +71 -34
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/21-design-studio.js +28 -14
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources.json +12 -12
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/package.json +6 -2
- package/lib/host-packages/{claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.20.0 → openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.22.0}/design-document.schema.json +131 -4
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.22.0/design-review-bundle.schema.json +822 -0
- package/lib/host-packages/openai/openplanr/runtime/plan/scripts/design-protocol-contracts.mjs +616 -4775
- package/lib/host-packages/openai/openplanr/runtime/plan/scripts/design.mjs +219 -424
- package/lib/host-packages/openai/openplanr/runtime/plan/scripts/runtime/packages/protocol/package.json +6 -2
- package/lib/host-packages/openai/openplanr/skills/delegate/SKILL.md +2 -1
- package/lib/host-packages/openai/openplanr/skills/delegate/openplanr.skill.json +1 -1
- package/lib/host-packages/openai/openplanr/skills/delegate/references/integration-review.md +26 -20
- package/lib/host-packages/openai/openplanr/skills/delegate/references/operator-guide.md +25 -1
- package/lib/host-packages/openai/openplanr/skills/delegate/references/run-handoff.md +2 -2
- package/lib/host-packages/openai/openplanr/skills/delegate/references/worktree-custody.md +17 -9
- package/lib/host-packages/openai/openplanr/skills/delegate/scripts/adapters/claude.mjs +15 -3
- package/lib/host-packages/openai/openplanr/skills/delegate/scripts/adapters/codex.mjs +38 -2
- package/lib/host-packages/openai/openplanr/skills/delegate/scripts/adapters/native.mjs +5 -0
- package/lib/host-packages/openai/openplanr/skills/delegate/scripts/custody.mjs +217 -10
- package/lib/host-packages/openai/openplanr/skills/delegate/scripts/handoff.mjs +1080 -0
- package/lib/host-packages/openai/openplanr/skills/delegate/scripts/integrate.mjs +96 -201
- package/lib/host-packages/openai/openplanr/skills/delegate/scripts/integration-files.mjs +3 -382
- package/lib/host-packages/openai/openplanr/skills/delegate/scripts/presentation.mjs +29 -12
- package/lib/host-packages/openai/openplanr/skills/delegate/scripts/run-contract.mjs +11 -0
- package/lib/host-packages/openai/openplanr/skills/delegate/scripts/run-execution.mjs +1 -1
- package/lib/host-packages/openai/openplanr/skills/delegate/scripts/run-lifecycle.mjs +14 -10
- package/lib/host-packages/openai/openplanr/skills/delegate/scripts/run-preparation.mjs +4 -0
- package/lib/host-packages/openai/openplanr/skills/delegate/scripts/run-record.mjs +2 -2
- package/lib/host-packages/openai/openplanr/skills/design/references/design-system.md +17 -2
- package/lib/host-packages/openai/openplanr/skills/design/references/generation.md +60 -2
- package/lib/host-packages/openai/openplanr/skills/design/references/utilities.md +23 -7
- package/lib/host-packages/openai/openplanr/skills/design/schemas/design-document.schema.json +131 -4
- package/lib/host-packages/openai/openplanr/skills/design-loop/references/design-system.md +17 -2
- package/lib/host-packages/openai/openplanr/skills/design-loop/references/generation.md +60 -2
- package/lib/host-packages/openai/openplanr/skills/design-loop/references/utilities.md +23 -7
- package/lib/host-packages/openai/openplanr/skills/design-loop/schemas/design-document.schema.json +131 -4
- package/lib/host-packages/openai/openplanr/skills/design-review/references/design-system.md +17 -2
- package/lib/host-packages/openai/openplanr/skills/design-review/references/generation.md +60 -2
- package/lib/host-packages/openai/openplanr/skills/design-review/references/utilities.md +23 -7
- package/lib/host-packages/openai/openplanr/skills/design-review/schemas/design-document.schema.json +131 -4
- package/lib/host-packages/openai/openplanr/skills/investigate/SKILL.md +2 -1
- package/lib/host-packages/openai/openplanr/skills/investigate/agents/openai.yaml +1 -1
- package/lib/host-packages/openai/openplanr/skills/investigate/openplanr.skill.json +12 -1
- package/lib/host-packages/openai/openplanr/skills/investigate/references/fail-first.md +40 -0
- package/lib/host-packages/openai/openplanr/skills/plan/SKILL.md +21 -11
- package/lib/host-packages/openai/openplanr/skills/plan/openplanr.skill.json +1 -1
- package/lib/host-packages/openai/openplanr/skills/plan/schemas/design-document.schema.json +131 -4
- package/lib/host-packages/openai/openplanr/skills/ship/SKILL.md +51 -18
- package/lib/host-packages/openai/openplanr/skills/ship/agents/openai.yaml +1 -1
- package/lib/host-packages/openai/openplanr/skills/ship/openplanr.skill.json +12 -1
- package/lib/host-packages/openai/openplanr/skills/ship/references/fail-first.md +40 -0
- package/lib/host-packages/openai/openplanr/skills/ship/references/result-contract.md +7 -3
- package/lib/host-packages/openai/openplanr/skills/spec/SKILL.md +6 -0
- package/lib/host-packages/openai/openplanr/skills/spec/openplanr.skill.json +1 -1
- package/lib/host-packages/openai/openplanr/skills/spec/references/specification-contract.md +3 -1
- package/lib/json-schema.mjs +4 -0
- package/package.json +16 -16
- package/dist/dashboard/assets/index-BU5fzjyz.css +0 -1
- package/dist/dashboard/assets/index-L8qtwqv6.js +0 -572
- package/dist/dashboard/assets/index-L8qtwqv6.js.map +0 -1
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-chunked-workspace-client.mjs +0 -555
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-compression.mjs +0 -4180
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-encrypted-workspace-client.mjs +0 -647
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-owner-custody.mjs +0 -129
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-resource-pack.mjs +0 -698
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-runtime-support-6774fd3d5d02.mjs +0 -24
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-share.mjs +0 -1993
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-shared-artifact-support-dependencies-design-support-protocol-contracts-3d9b1a86.mjs +0 -1020
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-shared-protocol-contracts-75a938cc.mjs +0 -222
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-shared-protocol-contracts-b5f28f94.mjs +0 -5778
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-upload-spool.mjs +0 -198
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/04-compression.js +0 -4175
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/05-artifact-sharing.js +0 -65
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/06-artifact-review-ui.js +0 -1755
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/07-artifact-sharing.js +0 -62
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/08-artifact-review-ui.js +0 -2633
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-paste.schema.json +0 -49
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-workspace.schema.json +0 -108
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-create.schema.json +0 -170
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-event.schema.json +0 -97
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-revision.schema.json +0 -56
- package/lib/host-packages/claude/openplanr/skills/delegate/scripts/integration-transaction.mjs +0 -958
- package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/integration-transaction.mjs +0 -958
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-chunked-workspace-client.mjs +0 -555
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-compression.mjs +0 -4180
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-encrypted-workspace-client.mjs +0 -647
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-owner-custody.mjs +0 -129
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-resource-pack.mjs +0 -698
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-runtime-support-6774fd3d5d02.mjs +0 -24
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-share.mjs +0 -1993
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-shared-artifact-support-dependencies-design-support-protocol-contracts-3d9b1a86.mjs +0 -1020
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-shared-protocol-contracts-75a938cc.mjs +0 -222
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-shared-protocol-contracts-b5f28f94.mjs +0 -5778
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-upload-spool.mjs +0 -198
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/04-compression.js +0 -4175
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/05-artifact-sharing.js +0 -65
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/06-artifact-review-ui.js +0 -1755
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/07-artifact-sharing.js +0 -62
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/08-artifact-review-ui.js +0 -2633
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-paste.schema.json +0 -49
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-workspace.schema.json +0 -108
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-create.schema.json +0 -170
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-event.schema.json +0 -97
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-revision.schema.json +0 -56
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-chunked-workspace-client.mjs +0 -555
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-compression.mjs +0 -4180
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-encrypted-workspace-client.mjs +0 -647
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-owner-custody.mjs +0 -129
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-resource-pack.mjs +0 -698
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-runtime-support-6774fd3d5d02.mjs +0 -24
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-share.mjs +0 -1993
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-shared-artifact-support-dependencies-design-support-protocol-contracts-3d9b1a86.mjs +0 -1020
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-shared-protocol-contracts-75a938cc.mjs +0 -222
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-shared-protocol-contracts-b5f28f94.mjs +0 -5778
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-upload-spool.mjs +0 -198
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/04-compression.js +0 -4175
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/05-artifact-sharing.js +0 -65
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/06-artifact-review-ui.js +0 -1755
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/07-artifact-sharing.js +0 -62
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/08-artifact-review-ui.js +0 -2633
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-paste.schema.json +0 -49
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-workspace.schema.json +0 -108
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-create.schema.json +0 -170
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-event.schema.json +0 -97
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-revision.schema.json +0 -56
- package/lib/host-packages/openai/openplanr/skills/delegate/scripts/integration-transaction.mjs +0 -958
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
DESIGN_REVIEW_BUNDLE_SCHEMA,
|
|
5
|
-
LARGE_OBJECT_LIMITS,
|
|
3
|
+
DESIGN_HANDOFF_SCHEMA,
|
|
6
4
|
assertPlainData,
|
|
5
|
+
assertReviewExperience,
|
|
7
6
|
canonicalizeJson,
|
|
8
7
|
validateJson
|
|
9
8
|
} from "./design-protocol-contracts.mjs";
|
|
10
9
|
|
|
11
10
|
// packages/design/lib/design/plan-handoff-utility.mjs
|
|
12
|
-
import { realpathSync as
|
|
13
|
-
import { resolve as
|
|
11
|
+
import { realpathSync as realpathSync3 } from "node:fs";
|
|
12
|
+
import { resolve as resolve4 } from "node:path";
|
|
14
13
|
import { fileURLToPath } from "node:url";
|
|
15
14
|
|
|
16
15
|
// packages/design/lib/design/handoff-reader.mjs
|
|
17
|
-
import { existsSync as
|
|
18
|
-
import { dirname as
|
|
16
|
+
import { existsSync as existsSync4, readFileSync as readFileSync6 } from "node:fs";
|
|
17
|
+
import { dirname as dirname4, join as join7 } from "node:path";
|
|
19
18
|
|
|
20
19
|
// packages/artifact/lib/artifact/envelope.mjs
|
|
21
20
|
import { createHash } from "node:crypto";
|
|
@@ -113,6 +112,24 @@ var PipelineError = class extends Error {
|
|
|
113
112
|
}
|
|
114
113
|
};
|
|
115
114
|
|
|
115
|
+
// packages/protocol/src/large-object-limits.mjs
|
|
116
|
+
var LARGE_OBJECT_LIMITS = Object.freeze({
|
|
117
|
+
uniqueHtmlBytes: 100 * 1024 * 1024,
|
|
118
|
+
decodedBytes: 128 * 1024 * 1024,
|
|
119
|
+
catalogBytes: 8 * 1024 * 1024,
|
|
120
|
+
manifestBytes: 64 * 1024,
|
|
121
|
+
chunkBytes: 1024 * 1024,
|
|
122
|
+
chunkPlaintextBytes: 1024 * 1024 - 16,
|
|
123
|
+
chunks: 129,
|
|
124
|
+
ciphertextBytes: 128 * 1024 * 1024 + 129 * 16,
|
|
125
|
+
sources: 256,
|
|
126
|
+
views: 4096,
|
|
127
|
+
resources: 1024,
|
|
128
|
+
eventBytes: 256 * 1024,
|
|
129
|
+
eventPageBytes: 1024 * 1024,
|
|
130
|
+
eventPageCount: 100
|
|
131
|
+
});
|
|
132
|
+
|
|
116
133
|
// packages/artifact/lib/artifact/artifact-sources.mjs
|
|
117
134
|
var ARTIFACT_SHARED_ENVELOPE_VERSION = "1.1.0";
|
|
118
135
|
|
|
@@ -149,9 +166,9 @@ function loadSchema(name, version = void 0) {
|
|
|
149
166
|
if (schemaCache.has(key)) return schemaCache.get(key);
|
|
150
167
|
const path = join(SCHEMAS_ROOT, candidateVersion, `${cleanName}.schema.json`);
|
|
151
168
|
try {
|
|
152
|
-
const
|
|
153
|
-
schemaCache.set(key,
|
|
154
|
-
return
|
|
169
|
+
const schema = JSON.parse(readFileSync(path, "utf-8"));
|
|
170
|
+
schemaCache.set(key, schema);
|
|
171
|
+
return schema;
|
|
155
172
|
} catch (error) {
|
|
156
173
|
if (error?.code !== "ENOENT") throw error;
|
|
157
174
|
}
|
|
@@ -269,241 +286,6 @@ function validateArtifactReview(review) {
|
|
|
269
286
|
return review;
|
|
270
287
|
}
|
|
271
288
|
|
|
272
|
-
// packages/protocol/src/review-experience-contracts.mjs
|
|
273
|
-
var text = { type: "string", maxLength: 16384 };
|
|
274
|
-
var id = { type: "string", minLength: 1, maxLength: 128 };
|
|
275
|
-
var digest = { type: "string", pattern: "^[a-f0-9]{64}$" };
|
|
276
|
-
var texts = { type: "array", maxItems: 256, items: text };
|
|
277
|
-
var closed = (properties, required = Object.keys(properties)) => ({
|
|
278
|
-
type: "object",
|
|
279
|
-
additionalProperties: false,
|
|
280
|
-
properties,
|
|
281
|
-
required
|
|
282
|
-
});
|
|
283
|
-
var list = (items, maxItems = 256) => ({ type: "array", maxItems, items });
|
|
284
|
-
var schema = (name, properties, required) => ({
|
|
285
|
-
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
286
|
-
$id: `https://openplanr.dev/schemas/v1.10.0/${name}.schema.json`,
|
|
287
|
-
"x-openplanr-contract": { id: name, version: "1.10.0" },
|
|
288
|
-
...closed(properties, required)
|
|
289
|
-
});
|
|
290
|
-
var DESIGN_REVIEW_CONTEXT_SCHEMA = schema(
|
|
291
|
-
"design-review-context",
|
|
292
|
-
{
|
|
293
|
-
kind: { const: "openplanr-design-review-context" },
|
|
294
|
-
schemaVersion: { const: "1.0.0" },
|
|
295
|
-
designId: id,
|
|
296
|
-
brief: closed({ purpose: text, requests: { ...texts, maxItems: 3 }, audience: text }, [
|
|
297
|
-
"purpose",
|
|
298
|
-
"requests"
|
|
299
|
-
]),
|
|
300
|
-
revisionSummary: text,
|
|
301
|
-
implementation: closed({
|
|
302
|
-
tokens: list(closed({ name: id, value: text, description: text }, ["name", "value"]), 512),
|
|
303
|
-
components: list(
|
|
304
|
-
closed(
|
|
305
|
-
{
|
|
306
|
-
id,
|
|
307
|
-
name: text,
|
|
308
|
-
screenIds: list(id),
|
|
309
|
-
anchorIds: list(id),
|
|
310
|
-
states: list(closed({ name: id, description: text })),
|
|
311
|
-
notes: text,
|
|
312
|
-
responsive: text,
|
|
313
|
-
accessibility: text
|
|
314
|
-
},
|
|
315
|
-
["id", "name"]
|
|
316
|
-
)
|
|
317
|
-
),
|
|
318
|
-
responsive: texts,
|
|
319
|
-
accessibility: texts
|
|
320
|
-
})
|
|
321
|
-
},
|
|
322
|
-
["kind", "schemaVersion", "designId", "brief", "implementation"]
|
|
323
|
-
);
|
|
324
|
-
var DESIGN_FINGERPRINT_SCHEMA = closed({
|
|
325
|
-
screenId: id,
|
|
326
|
-
variantId: id,
|
|
327
|
-
frameId: id,
|
|
328
|
-
contentDigest: digest,
|
|
329
|
-
guidanceDigest: digest
|
|
330
|
-
});
|
|
331
|
-
var bundleV11 = {
|
|
332
|
-
.../** @type {MutableSchema} */
|
|
333
|
-
structuredClone(DESIGN_REVIEW_BUNDLE_SCHEMA),
|
|
334
|
-
$id: "https://openplanr.dev/schemas/v1.10.0/design-review-bundle.schema.json",
|
|
335
|
-
"x-openplanr-contract": { id: "design-review-bundle", version: "1.10.0" }
|
|
336
|
-
};
|
|
337
|
-
Object.assign(bundleV11.properties, {
|
|
338
|
-
schemaVersion: { const: "1.1.0" },
|
|
339
|
-
reviewContext: DESIGN_REVIEW_CONTEXT_SCHEMA,
|
|
340
|
-
contextDigest: digest,
|
|
341
|
-
fingerprints: list(DESIGN_FINGERPRINT_SCHEMA)
|
|
342
|
-
});
|
|
343
|
-
bundleV11.required.push("reviewContext", "contextDigest", "fingerprints");
|
|
344
|
-
var DESIGN_REVIEW_BUNDLE_V11_SCHEMA = bundleV11;
|
|
345
|
-
var bundleV12 = (
|
|
346
|
-
/** @type {MutableSchema} */
|
|
347
|
-
structuredClone(DESIGN_REVIEW_BUNDLE_V11_SCHEMA)
|
|
348
|
-
);
|
|
349
|
-
bundleV12.$id = "https://openplanr.dev/schemas/v1.16.0/design-review-bundle.schema.json";
|
|
350
|
-
bundleV12["x-openplanr-contract"] = { id: "design-review-bundle", version: "1.16.0" };
|
|
351
|
-
Object.assign(bundleV12.properties, {
|
|
352
|
-
schemaVersion: { const: "1.2.0" },
|
|
353
|
-
envelope: {
|
|
354
|
-
type: "object",
|
|
355
|
-
required: ["schemaVersion", "sources", "artifacts", "viewer"],
|
|
356
|
-
properties: { schemaVersion: { const: "1.1.0" } }
|
|
357
|
-
},
|
|
358
|
-
entries: {
|
|
359
|
-
.../** @type {Record<string, unknown>} */
|
|
360
|
-
bundleV12.properties.entries,
|
|
361
|
-
maxItems: 4096
|
|
362
|
-
},
|
|
363
|
-
fingerprints: list(DESIGN_FINGERPRINT_SCHEMA, 4096)
|
|
364
|
-
});
|
|
365
|
-
var bundleCurrent = (
|
|
366
|
-
/** @type {MutableSchema} */
|
|
367
|
-
structuredClone(bundleV12)
|
|
368
|
-
);
|
|
369
|
-
bundleCurrent.$id = "https://openplanr.dev/schemas/v1.20.0/design-review-bundle.schema.json";
|
|
370
|
-
bundleCurrent["x-openplanr-contract"] = { id: "design-review-bundle", version: "1.20.0" };
|
|
371
|
-
bundleCurrent.properties.schemaVersion = { enum: ["1.1.0", "1.2.0"] };
|
|
372
|
-
bundleCurrent.properties.envelope = bundleV11.properties.envelope;
|
|
373
|
-
bundleCurrent.allOf = [
|
|
374
|
-
{
|
|
375
|
-
if: { properties: { schemaVersion: { const: "1.2.0" } } },
|
|
376
|
-
then: { properties: { envelope: bundleV12.properties.envelope } }
|
|
377
|
-
}
|
|
378
|
-
];
|
|
379
|
-
var currentDesign = (
|
|
380
|
-
/** @type {MutableSchema} */
|
|
381
|
-
bundleCurrent.properties.design
|
|
382
|
-
);
|
|
383
|
-
for (const key of ["frames", "layout"])
|
|
384
|
-
currentDesign.properties[key] = /** @type {Record<string, unknown>} */
|
|
385
|
-
DESIGN_DOCUMENT_SCHEMA.properties[key];
|
|
386
|
-
bundleCurrent.$defs = structuredClone(DESIGN_DOCUMENT_SCHEMA.$defs);
|
|
387
|
-
var currentEntries = (
|
|
388
|
-
/** @type {{ items: { properties: Record<string, unknown> } }} */
|
|
389
|
-
bundleCurrent.properties.entries
|
|
390
|
-
);
|
|
391
|
-
currentEntries.items.properties.height = { const: "auto" };
|
|
392
|
-
var item = closed(
|
|
393
|
-
{
|
|
394
|
-
pinId: id,
|
|
395
|
-
reviewId: id,
|
|
396
|
-
screenId: id,
|
|
397
|
-
revisionId: id,
|
|
398
|
-
text,
|
|
399
|
-
refinement: text,
|
|
400
|
-
stale: { type: "boolean" },
|
|
401
|
-
author: text,
|
|
402
|
-
reviewOf: digest,
|
|
403
|
-
source: text
|
|
404
|
-
},
|
|
405
|
-
["pinId", "text"]
|
|
406
|
-
);
|
|
407
|
-
var DESIGN_HANDOFF_CONTENT_SCHEMA = closed({
|
|
408
|
-
summary: text,
|
|
409
|
-
agreedChanges: list(item, 1e4),
|
|
410
|
-
openQuestions: list(item, 1e4),
|
|
411
|
-
deferred: list(item, 1e4),
|
|
412
|
-
rejected: list(item, 1e4)
|
|
413
|
-
});
|
|
414
|
-
var DESIGN_HANDOFF_SCHEMA = schema(
|
|
415
|
-
"design-review-handoff",
|
|
416
|
-
{
|
|
417
|
-
kind: { const: "openplanr-design-review-handoff" },
|
|
418
|
-
schemaVersion: { const: "1.0.0" },
|
|
419
|
-
title: text,
|
|
420
|
-
version: { type: "integer", minimum: 1 },
|
|
421
|
-
status: { enum: ["draft", "approved"] },
|
|
422
|
-
basis: closed({
|
|
423
|
-
designId: id,
|
|
424
|
-
sourceRevision: digest,
|
|
425
|
-
contextDigest: digest,
|
|
426
|
-
reviewOf: digest,
|
|
427
|
-
selectedVariant: id,
|
|
428
|
-
feedbackDigest: digest,
|
|
429
|
-
verificationDigest: digest,
|
|
430
|
-
feedbackWatermark: { type: "integer", minimum: 0 }
|
|
431
|
-
}),
|
|
432
|
-
content: DESIGN_HANDOFF_CONTENT_SCHEMA,
|
|
433
|
-
contentHash: digest,
|
|
434
|
-
markdown: { type: "string", maxLength: 2097152 },
|
|
435
|
-
affectedScreens: list(id),
|
|
436
|
-
verificationGaps: texts,
|
|
437
|
-
reviewNotes: list(closed({ reviewId: id, text }), 1e4),
|
|
438
|
-
approval: closed({ contentHash: digest, at: { type: "string", format: "date-time" } })
|
|
439
|
-
},
|
|
440
|
-
[
|
|
441
|
-
"kind",
|
|
442
|
-
"schemaVersion",
|
|
443
|
-
"title",
|
|
444
|
-
"version",
|
|
445
|
-
"status",
|
|
446
|
-
"basis",
|
|
447
|
-
"content",
|
|
448
|
-
"contentHash",
|
|
449
|
-
"markdown",
|
|
450
|
-
"affectedScreens",
|
|
451
|
-
"verificationGaps",
|
|
452
|
-
"reviewNotes"
|
|
453
|
-
]
|
|
454
|
-
);
|
|
455
|
-
var DESIGN_REVIEW_METADATA_PAYLOAD_SCHEMA = {
|
|
456
|
-
...schema(
|
|
457
|
-
"design-review-metadata-payload",
|
|
458
|
-
{
|
|
459
|
-
schemaVersion: { const: "1.0.0" },
|
|
460
|
-
kind: { enum: ["category", "disposition"] },
|
|
461
|
-
author: { ...text, minLength: 1, maxLength: 160 },
|
|
462
|
-
reviewOf: digest,
|
|
463
|
-
pinId: id,
|
|
464
|
-
category: { enum: ["question", "suggestion", "blocker"] },
|
|
465
|
-
disposition: { enum: ["accepted", "deferred", "rejected"] },
|
|
466
|
-
reason: text,
|
|
467
|
-
updatedAt: { type: "string", format: "date-time" }
|
|
468
|
-
},
|
|
469
|
-
["schemaVersion", "kind", "author", "reviewOf", "pinId", "updatedAt"]
|
|
470
|
-
),
|
|
471
|
-
allOf: [
|
|
472
|
-
{
|
|
473
|
-
if: { properties: { kind: { const: "category" } } },
|
|
474
|
-
then: { required: ["category"], not: { required: ["disposition"] } }
|
|
475
|
-
},
|
|
476
|
-
{
|
|
477
|
-
if: { properties: { kind: { const: "disposition" } } },
|
|
478
|
-
then: { required: ["disposition", "reason"], not: { required: ["category"] } }
|
|
479
|
-
}
|
|
480
|
-
]
|
|
481
|
-
};
|
|
482
|
-
var payloadV11 = {
|
|
483
|
-
.../** @type {MutableSchema} */
|
|
484
|
-
structuredClone(DESIGN_REVIEW_METADATA_PAYLOAD_SCHEMA),
|
|
485
|
-
$id: "https://openplanr.dev/schemas/v1.11.0/design-review-metadata-payload.schema.json",
|
|
486
|
-
"x-openplanr-contract": { id: "design-review-metadata-payload", version: "1.11.0" }
|
|
487
|
-
};
|
|
488
|
-
Object.assign(payloadV11.properties, {
|
|
489
|
-
schemaVersion: { const: "1.1.0" },
|
|
490
|
-
category: { enum: ["question", "suggestion", "change-request", "blocker"] }
|
|
491
|
-
});
|
|
492
|
-
function assertReviewExperience(value, contract) {
|
|
493
|
-
const errors = validateJson(value, contract);
|
|
494
|
-
if (errors.length)
|
|
495
|
-
throw new TypeError(
|
|
496
|
-
`Invalid ${contract["x-openplanr-contract"]?.id ?? "review data"}: ${errors.slice(0, 4).map((item2) => `${item2.path} ${item2.detail}`).join("; ")}`
|
|
497
|
-
);
|
|
498
|
-
return value;
|
|
499
|
-
}
|
|
500
|
-
var REVIEW_EXPERIENCE_SCHEMAS = Object.freeze({
|
|
501
|
-
"design-review-context": DESIGN_REVIEW_CONTEXT_SCHEMA,
|
|
502
|
-
"design-review-bundle": DESIGN_REVIEW_BUNDLE_V11_SCHEMA,
|
|
503
|
-
"design-review-handoff": DESIGN_HANDOFF_SCHEMA,
|
|
504
|
-
"design-review-metadata-payload": DESIGN_REVIEW_METADATA_PAYLOAD_SCHEMA
|
|
505
|
-
});
|
|
506
|
-
|
|
507
289
|
// packages/design/lib/design/context.mjs
|
|
508
290
|
import { createHash as createHash2 } from "node:crypto";
|
|
509
291
|
|
|
@@ -1650,7 +1432,7 @@ function recoverDesignPublication(root, { ownsRenderLock = false } = {}) {
|
|
|
1650
1432
|
function designSpecPath(root) {
|
|
1651
1433
|
return /(?:^|\/)output\/feats\/feat-[^/]+\/design$/u.test(root.replaceAll("\\", "/")) ? join2(dirname2(root), "design-spec.md") : join2(root, "design-spec.md");
|
|
1652
1434
|
}
|
|
1653
|
-
function
|
|
1435
|
+
function currentDesign(file, { recoverPublication = true } = {}) {
|
|
1654
1436
|
const root = realpathSync(dirname2(resolve(file)));
|
|
1655
1437
|
if (recoverPublication) recoverDesignPublication(root);
|
|
1656
1438
|
else {
|
|
@@ -2028,7 +1810,7 @@ function resolveArtifactReviewDestination({
|
|
|
2028
1810
|
// packages/design/lib/design/feedback-reader.mjs
|
|
2029
1811
|
var designReviewKey = (document) => `design-${hash(document.id).slice(0, 24)}`;
|
|
2030
1812
|
function designReviewPath(file, env = process.env, options = {}) {
|
|
2031
|
-
const { root, document } =
|
|
1813
|
+
const { root, document } = currentDesign(file, options);
|
|
2032
1814
|
return resolveArtifactReviewDestination({
|
|
2033
1815
|
cwd: root,
|
|
2034
1816
|
env,
|
|
@@ -2036,22 +1818,22 @@ function designReviewPath(file, env = process.env, options = {}) {
|
|
|
2036
1818
|
}).path;
|
|
2037
1819
|
}
|
|
2038
1820
|
function readDesignFeedback(file, env = process.env, options = {}) {
|
|
2039
|
-
const current =
|
|
1821
|
+
const current = currentDesign(file, options);
|
|
2040
1822
|
const ledger = readArtifactReviewState(designReviewPath(file, env, options), {
|
|
2041
1823
|
allowMissing: true
|
|
2042
1824
|
});
|
|
2043
|
-
const
|
|
1825
|
+
const digest = digestArtifactEnvelope(current.envelope);
|
|
2044
1826
|
const pins = (ledger?.reviews ?? []).flatMap(
|
|
2045
1827
|
(entry) => entry.review.pins.map((pin) => {
|
|
2046
|
-
const target = current.entries.find((
|
|
2047
|
-
const screen = target && current.document.screens.find((
|
|
1828
|
+
const target = current.entries.find((item) => item.artifactId === pin.artifactId);
|
|
1829
|
+
const screen = target && current.document.screens.find((item) => item.id === target.screenId);
|
|
2048
1830
|
const anchorMissing = pin.anchor?.planrId && screen?.anchors?.length && !screen.anchors.includes(pin.anchor.planrId) && pin.anchor.planrId !== screen.id;
|
|
2049
1831
|
return {
|
|
2050
1832
|
...pin,
|
|
2051
1833
|
reviewId: entry.review.reviewId,
|
|
2052
1834
|
reviewOf: entry.review.reviewOf,
|
|
2053
1835
|
...entry.review.reviewId.startsWith("shared-") ? { revisionId: entry.review.reviewId.slice(7) } : {},
|
|
2054
|
-
stale: entry.stale || entry.review.reviewOf !==
|
|
1836
|
+
stale: entry.stale || entry.review.reviewOf !== digest || !target || Boolean(anchorMissing),
|
|
2055
1837
|
...target ? { screenId: target.screenId, variantId: target.variantId } : {}
|
|
2056
1838
|
};
|
|
2057
1839
|
})
|
|
@@ -2070,7 +1852,7 @@ function readDesignFeedback(file, env = process.env, options = {}) {
|
|
|
2070
1852
|
}
|
|
2071
1853
|
|
|
2072
1854
|
// packages/design/lib/design/handoff-format.mjs
|
|
2073
|
-
var safeMd = (
|
|
1855
|
+
var safeMd = (text) => String(text).replaceAll("[", "\\[").replaceAll("]", "\\]").replaceAll("<", "<").replaceAll(">", ">");
|
|
2074
1856
|
function renderMarkdown(draft, title) {
|
|
2075
1857
|
const lines = [
|
|
2076
1858
|
`# ${safeMd(title)} \u2014 review handoff`,
|
|
@@ -2087,11 +1869,11 @@ function renderMarkdown(draft, title) {
|
|
|
2087
1869
|
["rejected", "Rejected"]
|
|
2088
1870
|
]) {
|
|
2089
1871
|
lines.push(`## ${label}`, "");
|
|
2090
|
-
for (const
|
|
1872
|
+
for (const item of draft.content[key]) {
|
|
2091
1873
|
lines.push(
|
|
2092
|
-
`- ${safeMd(
|
|
1874
|
+
`- ${safeMd(item.refinement ?? item.text)} \u2014 ${safeMd(item.author ?? "Reviewer")}${item.stale ? " \xB7 original revision" : ""} [source comment](${item.source})`
|
|
2093
1875
|
);
|
|
2094
|
-
if (
|
|
1876
|
+
if (item.refinement) lines.push(` Original comment: ${safeMd(item.text)}`);
|
|
2095
1877
|
}
|
|
2096
1878
|
if (!draft.content[key].length) lines.push("None recorded.");
|
|
2097
1879
|
lines.push("");
|
|
@@ -2325,7 +2107,7 @@ function compileDesignHandoffResolution(input) {
|
|
|
2325
2107
|
validatePin(pin);
|
|
2326
2108
|
counts.set(pin.id, (counts.get(pin.id) ?? 0) + 1);
|
|
2327
2109
|
}
|
|
2328
|
-
const duplicatePinIds = new Set([...counts].filter(([, count]) => count > 1).map(([
|
|
2110
|
+
const duplicatePinIds = new Set([...counts].filter(([, count]) => count > 1).map(([id]) => id));
|
|
2329
2111
|
const known = /* @__PURE__ */ new Set();
|
|
2330
2112
|
for (const pin of pins) {
|
|
2331
2113
|
const key = keyOf(pin);
|
|
@@ -2443,7 +2225,7 @@ function compileDesignHandoffResolution(input) {
|
|
|
2443
2225
|
)
|
|
2444
2226
|
);
|
|
2445
2227
|
const severity = new Set(diagnostics.map((value) => value.severity));
|
|
2446
|
-
const status = severity.has("stale") ? "stale" : severity.has("blocked") ? "blocked" : items.some((
|
|
2228
|
+
const status = severity.has("stale") ? "stale" : severity.has("blocked") ? "blocked" : items.some((item) => item.outcome === "open") ? "attention" : "ready";
|
|
2447
2229
|
return {
|
|
2448
2230
|
kind: "openplanr-design-handoff-resolution",
|
|
2449
2231
|
schemaVersion: "1.0.0",
|
|
@@ -2451,186 +2233,197 @@ function compileDesignHandoffResolution(input) {
|
|
|
2451
2233
|
status,
|
|
2452
2234
|
complete: source.historyComplete !== false && !["blocked", "stale"].includes(status),
|
|
2453
2235
|
items,
|
|
2454
|
-
implementationScope: items.filter((
|
|
2236
|
+
implementationScope: items.filter((item) => item.implementationScope).map((item) => item.id),
|
|
2455
2237
|
diagnostics
|
|
2456
2238
|
};
|
|
2457
2239
|
}
|
|
2458
2240
|
|
|
2459
|
-
// packages/design/lib/design/share-
|
|
2460
|
-
import {
|
|
2461
|
-
import {
|
|
2462
|
-
import {
|
|
2241
|
+
// packages/design/lib/design/share-cli-bridge.mjs
|
|
2242
|
+
import { execFile, execFileSync } from "node:child_process";
|
|
2243
|
+
import { existsSync as existsSync3, readFileSync as readFileSync5 } from "node:fs";
|
|
2244
|
+
import { join as join6 } from "node:path";
|
|
2463
2245
|
|
|
2464
|
-
// packages/
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2246
|
+
// packages/design/lib/design/share-compat.mjs
|
|
2247
|
+
var DESIGN_SHARE_COMPAT = 1;
|
|
2248
|
+
|
|
2249
|
+
// packages/design/lib/design/share-cli-bridge.mjs
|
|
2250
|
+
var CLI = "openplanr";
|
|
2251
|
+
var UPLOAD_TIMEOUT_MS = 30 * 6e4;
|
|
2252
|
+
var STATUS_TIMEOUT_MS = 5e3;
|
|
2253
|
+
var FAILED_HANDSHAKE_TTL_MS = 3e4;
|
|
2254
|
+
var STATUS_TTL_MS = 1e4;
|
|
2255
|
+
var INSTALL = "Install the OpenPlanr CLI with `npm install -g openplanr`, then retry; your local design is unchanged.";
|
|
2256
|
+
var UNAVAILABLE = Object.freeze([
|
|
2257
|
+
"E_DESIGN_SHARE_CLI_REQUIRED",
|
|
2258
|
+
"E_DESIGN_SHARE_CLI_UNRESPONSIVE",
|
|
2259
|
+
"E_DESIGN_SHARE_RUNTIME_MISMATCH",
|
|
2260
|
+
"E_DESIGN_SHARE_PIPELINE_MISSING"
|
|
2261
|
+
]);
|
|
2262
|
+
function shareError(code, message2, fix) {
|
|
2263
|
+
return Object.assign(new Error(fix ? `${message2} ${fix}` : message2), { code, name: code });
|
|
2264
|
+
}
|
|
2265
|
+
function cliMissing() {
|
|
2266
|
+
return shareError(
|
|
2267
|
+
"E_DESIGN_SHARE_CLI_REQUIRED",
|
|
2268
|
+
"Sharing runs in the OpenPlanr CLI, which is not installed.",
|
|
2269
|
+
INSTALL
|
|
2270
|
+
);
|
|
2483
2271
|
}
|
|
2484
|
-
function
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2272
|
+
function pathOf(env) {
|
|
2273
|
+
const key = Object.keys(env).find((name) => name.toUpperCase() === "PATH");
|
|
2274
|
+
return key ? env[key] ?? "" : "";
|
|
2275
|
+
}
|
|
2276
|
+
function cliLauncher({
|
|
2277
|
+
platform = process.platform,
|
|
2278
|
+
env = process.env,
|
|
2279
|
+
execPath = process.execPath
|
|
2280
|
+
} = {}) {
|
|
2281
|
+
if (platform !== "win32") return { file: CLI, args: [] };
|
|
2282
|
+
for (const directory of pathOf(env).split(";").filter(Boolean)) {
|
|
2283
|
+
const shim = join6(directory, `${CLI}.cmd`);
|
|
2284
|
+
if (!existsSync3(shim)) continue;
|
|
2285
|
+
const target = /"%~?dp0%?\\([^"\r\n]+?\.js)"/iu.exec(readFileSync5(shim, "utf8"))?.[1];
|
|
2286
|
+
const script = target ? join6(directory, ...target.split("\\")) : join6(directory, "node_modules", CLI, "bin", `${CLI}.js`);
|
|
2287
|
+
if (existsSync3(script)) return { file: execPath, args: [script] };
|
|
2491
2288
|
}
|
|
2289
|
+
return null;
|
|
2492
2290
|
}
|
|
2493
|
-
function
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2291
|
+
function lastJsonLine(stdout) {
|
|
2292
|
+
const line = String(stdout ?? "").trim().split("\n").at(-1);
|
|
2293
|
+
try {
|
|
2294
|
+
return line ? JSON.parse(line) : null;
|
|
2295
|
+
} catch {
|
|
2296
|
+
return null;
|
|
2497
2297
|
}
|
|
2498
2298
|
}
|
|
2499
|
-
function
|
|
2500
|
-
|
|
2501
|
-
if (
|
|
2502
|
-
throw
|
|
2503
|
-
|
|
2504
|
-
|
|
2299
|
+
function settle(command, timeout, error, stdout, stderr) {
|
|
2300
|
+
if (error?.code === "ENOENT") throw cliMissing();
|
|
2301
|
+
if (error?.code === "ETIMEDOUT" || error?.killed || error?.signal)
|
|
2302
|
+
throw shareError(
|
|
2303
|
+
"E_DESIGN_SHARE_CLI_UNRESPONSIVE",
|
|
2304
|
+
`The OpenPlanr CLI did not finish \`artifact ${command}\` within ${Math.round(timeout / 1e3)} s.`,
|
|
2305
|
+
"Check that `openplanr --version` answers, then retry."
|
|
2505
2306
|
);
|
|
2307
|
+
const value = lastJsonLine(stdout);
|
|
2308
|
+
if (!error && value && value.ok !== false) return value;
|
|
2309
|
+
if (value && value.ok === false)
|
|
2310
|
+
throw shareError(
|
|
2311
|
+
value.code ?? "E_DESIGN_SHARE_FAILED",
|
|
2312
|
+
value.problem ?? "The OpenPlanr CLI could not complete the sharing operation.",
|
|
2313
|
+
value.recovery
|
|
2314
|
+
);
|
|
2315
|
+
const detail = String(stderr ?? "").trim().split("\n").at(-1) || error?.message || "no output";
|
|
2316
|
+
throw shareError(
|
|
2317
|
+
"E_DESIGN_SHARE_FAILED",
|
|
2318
|
+
`openplanr artifact ${command} failed without a JSON result: ${detail}`
|
|
2319
|
+
);
|
|
2506
2320
|
}
|
|
2507
|
-
function
|
|
2508
|
-
|
|
2509
|
-
if (!stat.isDirectory() || stat.isSymbolicLink() || !recoveryOutput && process.platform !== "win32" && (stat.mode & 63 || stat.uid !== process.getuid()))
|
|
2510
|
-
throw custodyError(`${label} custody must use a private local directory.`);
|
|
2321
|
+
function argv(command, file, flags) {
|
|
2322
|
+
return ["artifact", command, ...flags, "--json", ...file === void 0 ? [] : ["--", file]];
|
|
2511
2323
|
}
|
|
2512
|
-
function
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
assertPrivateFile(path, label);
|
|
2521
|
-
let record;
|
|
2324
|
+
function launch(env) {
|
|
2325
|
+
const launcher = cliLauncher({ env });
|
|
2326
|
+
if (!launcher) throw cliMissing();
|
|
2327
|
+
return launcher;
|
|
2328
|
+
}
|
|
2329
|
+
function runSync(command, file, flags, { env = process.env, timeout = STATUS_TIMEOUT_MS } = {}) {
|
|
2330
|
+
const { file: program, args } = launch(env);
|
|
2331
|
+
let stdout;
|
|
2522
2332
|
try {
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2333
|
+
stdout = execFileSync(program, [...args, ...argv(command, file, flags)], {
|
|
2334
|
+
env,
|
|
2335
|
+
encoding: "utf8",
|
|
2336
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
2337
|
+
timeout,
|
|
2338
|
+
windowsHide: true
|
|
2339
|
+
});
|
|
2340
|
+
} catch (error) {
|
|
2341
|
+
return settle(command, timeout, error, error?.stdout, error?.stderr);
|
|
2526
2342
|
}
|
|
2527
|
-
|
|
2528
|
-
throw custodyError(`${label} owner custody is invalid.`, "E_OWNER_CUSTODY_INVALID");
|
|
2529
|
-
return record;
|
|
2343
|
+
return settle(command, timeout, null, stdout, "");
|
|
2530
2344
|
}
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
})
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
throw new TypeError(
|
|
2542
|
-
`${label} sharing requires an HTTPS origin or a local development server.`
|
|
2543
|
-
);
|
|
2544
|
-
return url.origin;
|
|
2345
|
+
function compatibility(runtime, error) {
|
|
2346
|
+
if (error) {
|
|
2347
|
+
if (UNAVAILABLE.includes(error.code)) return { error };
|
|
2348
|
+
return {
|
|
2349
|
+
error: shareError(
|
|
2350
|
+
"E_DESIGN_SHARE_RUNTIME_MISMATCH",
|
|
2351
|
+
`The installed OpenPlanr CLI is too old to share designs for this skill (${error.message}).`,
|
|
2352
|
+
"Update the CLI with `npm install -g openplanr`, then retry."
|
|
2353
|
+
)
|
|
2354
|
+
};
|
|
2545
2355
|
}
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2356
|
+
if (runtime.designShareCompat === DESIGN_SHARE_COMPAT) return { runtime };
|
|
2357
|
+
const older = typeof runtime.designShareCompat !== "number" || runtime.designShareCompat < DESIGN_SHARE_COMPAT;
|
|
2358
|
+
return {
|
|
2359
|
+
error: shareError(
|
|
2360
|
+
"E_DESIGN_SHARE_RUNTIME_MISMATCH",
|
|
2361
|
+
`The installed OpenPlanr CLI (${runtime.cli}) shares designs in format ${runtime.designShareCompat ?? "unknown"}, but this skill uses format ${DESIGN_SHARE_COMPAT}.`,
|
|
2362
|
+
older ? "Update the CLI with `npm install -g openplanr`, then retry." : "Update the OpenPlanr plugin or skills to match the CLI, then retry."
|
|
2363
|
+
)
|
|
2364
|
+
};
|
|
2365
|
+
}
|
|
2366
|
+
var handshakes = /* @__PURE__ */ new Map();
|
|
2367
|
+
function remembered(env) {
|
|
2368
|
+
const known = handshakes.get(pathOf(env));
|
|
2369
|
+
if (known?.outcome?.error && Date.now() - known.at > FAILED_HANDSHAKE_TTL_MS) {
|
|
2370
|
+
handshakes.delete(pathOf(env));
|
|
2371
|
+
return void 0;
|
|
2550
2372
|
}
|
|
2551
|
-
return
|
|
2373
|
+
return known;
|
|
2552
2374
|
}
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
const env = options.env ?? process.env;
|
|
2570
|
-
const root = resolve5(options.custodyRoot ?? join7(planrHome(env), "design-shares"));
|
|
2571
|
-
let project = current.root;
|
|
2572
|
-
for (let candidate = current.root; dirname5(candidate) !== candidate; candidate = dirname5(candidate)) {
|
|
2573
|
-
if (existsSync4(join7(candidate, ".git")) || existsSync4(join7(candidate, PLANNING_FOLDER))) {
|
|
2574
|
-
project = candidate;
|
|
2575
|
-
break;
|
|
2576
|
-
}
|
|
2375
|
+
function remember(env, outcome) {
|
|
2376
|
+
handshakes.set(pathOf(env), { at: Date.now(), outcome });
|
|
2377
|
+
return outcome;
|
|
2378
|
+
}
|
|
2379
|
+
function outcomeOf(outcome) {
|
|
2380
|
+
if (outcome.error) throw outcome.error;
|
|
2381
|
+
return outcome.runtime;
|
|
2382
|
+
}
|
|
2383
|
+
function requireCompatibleRuntime(env = process.env) {
|
|
2384
|
+
const known = remembered(env);
|
|
2385
|
+
if (known?.outcome) return outcomeOf(known.outcome);
|
|
2386
|
+
let outcome;
|
|
2387
|
+
try {
|
|
2388
|
+
outcome = compatibility(runSync("share-runtime", void 0, [], { env }));
|
|
2389
|
+
} catch (error) {
|
|
2390
|
+
outcome = compatibility(null, error);
|
|
2577
2391
|
}
|
|
2578
|
-
|
|
2579
|
-
${current.document.id}`);
|
|
2580
|
-
const path = join7(root, `${key}.json`);
|
|
2581
|
-
const within = relative3(project, root);
|
|
2582
|
-
if ((!allowMissing || existsSync4(path)) && (within === "" || !within.startsWith(`..${process.platform === "win32" ? "\\" : "/"}`) && within !== ".." && !isAbsolute3(within)))
|
|
2583
|
-
throw new Error(
|
|
2584
|
-
"Design owner keys must be stored outside the project. Set PLANR_HOME to a private user-level directory."
|
|
2585
|
-
);
|
|
2586
|
-
const legacyPath = !options.custodyRoot && !configuredPlanrHome(env) ? join7(realpathSync4(env.HOME || homedir3()), ".openplanr", "design-shares", `${key}.json`) : null;
|
|
2587
|
-
return { root, path, current, legacyPath };
|
|
2588
|
-
}
|
|
2589
|
-
function presentationFingerprint(current, { legacy = false } = {}) {
|
|
2590
|
-
const state = readJson(join7(current.root, ".design/studio-state.json"), { state: {} }).state;
|
|
2591
|
-
return hash(
|
|
2592
|
-
JSON.stringify({
|
|
2593
|
-
revision: current.revision,
|
|
2594
|
-
selectedVariant: state.selectedVariant ?? current.document.selectedVariant,
|
|
2595
|
-
...legacy ? { positions: state.positions ?? {} } : {},
|
|
2596
|
-
verification: current.verification.status
|
|
2597
|
-
})
|
|
2598
|
-
);
|
|
2392
|
+
return outcomeOf(remember(env, outcome));
|
|
2599
2393
|
}
|
|
2600
|
-
var
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
}
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
return safeStatus(record, current);
|
|
2394
|
+
var statuses = /* @__PURE__ */ new Map();
|
|
2395
|
+
function statusKey(file, env) {
|
|
2396
|
+
try {
|
|
2397
|
+
return `${pathOf(env)}\0${file}\0${currentDesign(file).revision}`;
|
|
2398
|
+
} catch {
|
|
2399
|
+
return null;
|
|
2400
|
+
}
|
|
2401
|
+
}
|
|
2402
|
+
function cachedStatus(key) {
|
|
2403
|
+
const known = key && statuses.get(key);
|
|
2404
|
+
return known && Date.now() - known.at <= STATUS_TTL_MS ? known.value : void 0;
|
|
2405
|
+
}
|
|
2406
|
+
function unavailableStatus(error) {
|
|
2407
|
+
if (!UNAVAILABLE.includes(error.code)) throw error;
|
|
2408
|
+
return { ok: true, shared: false, unavailable: { code: error.code, message: error.message } };
|
|
2409
|
+
}
|
|
2410
|
+
function getDesignShareStatus(file, { env } = {}) {
|
|
2411
|
+
const key = statusKey(file, env);
|
|
2412
|
+
const known = cachedStatus(key);
|
|
2413
|
+
if (known) return known;
|
|
2414
|
+
let value;
|
|
2415
|
+
try {
|
|
2416
|
+
requireCompatibleRuntime(env);
|
|
2417
|
+
value = runSync("status", file, [], { env });
|
|
2418
|
+
} catch (error) {
|
|
2419
|
+
value = unavailableStatus(error);
|
|
2420
|
+
}
|
|
2421
|
+
if (key) statuses.set(key, { at: Date.now(), value });
|
|
2422
|
+
return value;
|
|
2630
2423
|
}
|
|
2631
2424
|
|
|
2632
2425
|
// packages/design/lib/design/handoff-reader.mjs
|
|
2633
|
-
var metadataPath = (current) =>
|
|
2426
|
+
var metadataPath = (current) => join7(current.root, ".design/review-metadata.json");
|
|
2634
2427
|
var revisionOf2 = (pin) => pin.revisionId ?? pin.reviewId;
|
|
2635
2428
|
function metadata(current, feedback) {
|
|
2636
2429
|
const local = readJson(metadataPath(current), { version: 0, byRevision: {} });
|
|
@@ -2696,7 +2489,7 @@ function resolutionFor(value, shareStatus) {
|
|
|
2696
2489
|
});
|
|
2697
2490
|
}
|
|
2698
2491
|
function snapshot(file, env, shareOptions = {}) {
|
|
2699
|
-
const current =
|
|
2492
|
+
const current = currentDesign(file, shareOptions), feedback = readDesignFeedback(file, env, shareOptions), meta = metadata(current, feedback);
|
|
2700
2493
|
const reviewContext = current.reviewContext ?? emptyReviewContext(current.document);
|
|
2701
2494
|
const basis = {
|
|
2702
2495
|
designId: current.document.id,
|
|
@@ -2735,12 +2528,12 @@ function snapshot(file, env, shareOptions = {}) {
|
|
|
2735
2528
|
}
|
|
2736
2529
|
function readDesignHandoff(file, { env = process.env, ...shareOptions } = {}) {
|
|
2737
2530
|
const value = snapshot(file, env, shareOptions);
|
|
2738
|
-
const path =
|
|
2531
|
+
const path = join7(dirname4(designSpecPath(value.current.root)), "review-handoff.json");
|
|
2739
2532
|
const draft = readJson(path, null);
|
|
2740
2533
|
if (draft) {
|
|
2741
2534
|
assertDraft(draft);
|
|
2742
2535
|
const markdownPath = path.replace(/\.json$/u, ".md");
|
|
2743
|
-
if (!
|
|
2536
|
+
if (!existsSync4(markdownPath) || readFileSync6(markdownPath, "utf8") !== draft.markdown)
|
|
2744
2537
|
throw new Error(
|
|
2745
2538
|
"The handoff Markdown differs from its approved JSON. Rebuild the handoff projection before using it in Plan."
|
|
2746
2539
|
);
|
|
@@ -2777,9 +2570,9 @@ function assertDraft(draft) {
|
|
|
2777
2570
|
}
|
|
2778
2571
|
|
|
2779
2572
|
// packages/design/lib/design/plan-handoff-utility.mjs
|
|
2780
|
-
function inspectPlanDesignHandoff(
|
|
2573
|
+
function inspectPlanDesignHandoff(argv2, { stdout = (value) => process.stdout.write(`${JSON.stringify(value)}
|
|
2781
2574
|
`) } = {}) {
|
|
2782
|
-
if (
|
|
2575
|
+
if (argv2.length === 0 || argv2[0] === "help" || argv2.some((value) => ["--help", "-h"].includes(value))) {
|
|
2783
2576
|
const help = {
|
|
2784
2577
|
usage: "design.mjs handoff <design-document.json> [--action inspect] [--json]",
|
|
2785
2578
|
note: "Reads the existing handoff and its current approval; never renders, publishes, or starts implementation."
|
|
@@ -2787,7 +2580,9 @@ function inspectPlanDesignHandoff(argv, { stdout = (value) => process.stdout.wri
|
|
|
2787
2580
|
stdout(help);
|
|
2788
2581
|
return help;
|
|
2789
2582
|
}
|
|
2790
|
-
const [command, input, ...args] =
|
|
2583
|
+
const [command, input, ...args] = argv2;
|
|
2584
|
+
if (typeof input === "string" && input.startsWith("-"))
|
|
2585
|
+
throw new Error(`${input} must be a design document path, not an option.`);
|
|
2791
2586
|
if (command !== "handoff" || !input)
|
|
2792
2587
|
throw new Error("Usage: design.mjs handoff <design-document.json> [--action inspect] [--json]");
|
|
2793
2588
|
for (let index = 0; index < args.length; index += 1) {
|
|
@@ -2795,20 +2590,20 @@ function inspectPlanDesignHandoff(argv, { stdout = (value) => process.stdout.wri
|
|
|
2795
2590
|
if (args[index] === "--action" && args[++index] === "inspect") continue;
|
|
2796
2591
|
throw new Error("Plan handoff support only accepts --action inspect and --json.");
|
|
2797
2592
|
}
|
|
2798
|
-
const result = readDesignHandoff(
|
|
2593
|
+
const result = readDesignHandoff(resolve4(input), { recoverPublication: false });
|
|
2799
2594
|
stdout(result);
|
|
2800
2595
|
return result;
|
|
2801
2596
|
}
|
|
2802
|
-
async function main(
|
|
2597
|
+
async function main(argv2 = process.argv.slice(2)) {
|
|
2803
2598
|
try {
|
|
2804
|
-
return inspectPlanDesignHandoff(
|
|
2599
|
+
return inspectPlanDesignHandoff(argv2);
|
|
2805
2600
|
} catch (error) {
|
|
2806
2601
|
process.stderr.write(`${error.code ? `${error.code}: ` : ""}${error.message}
|
|
2807
2602
|
`);
|
|
2808
2603
|
process.exitCode = 1;
|
|
2809
2604
|
}
|
|
2810
2605
|
}
|
|
2811
|
-
if (process.argv[1] && fileURLToPath(import.meta.url) ===
|
|
2606
|
+
if (process.argv[1] && fileURLToPath(import.meta.url) === realpathSync3(process.argv[1]))
|
|
2812
2607
|
await main();
|
|
2813
2608
|
export {
|
|
2814
2609
|
inspectPlanDesignHandoff,
|