openplanr 3.3.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 +52 -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/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/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/ship-checks/contract.d.ts +3 -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/discover.d.ts.map +1 -1
- package/dist/services/ship-checks/discover.js +2 -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/utils/splice-managed-block.js +1 -1
- package/dist/utils/splice-managed-block.js.map +1 -1
- package/docs/CLI.md +38 -1
- 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 +3 -3
- package/lib/host-packages/claude/openplanr/.claude-plugin/plugin.json +6 -6
- package/lib/host-packages/claude/openplanr/.openplanr-content.json +67 -123
- package/lib/host-packages/claude/openplanr/README.md +12 -12
- 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 +26 -26
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-handoff.mjs +850 -56
- 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/{openai/openplanr/runtime/design/scripts/design-shared-artifact-support-dependencies-design-support-protocol-contracts-3d9b1a86.mjs → claude/openplanr/runtime/design/scripts/design-shared-artifact-support-dependencies-design-support-protocol-contracts-d707e49b.mjs} +762 -223
- 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 +107 -37
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +0 -27
- 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 -5684
- 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 +3 -3
- 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/protocol/package.json +5 -1
- package/lib/host-packages/claude/openplanr/runtime/plan/scripts/design-protocol-contracts.mjs +545 -4781
- package/lib/host-packages/claude/openplanr/runtime/plan/scripts/design.mjs +219 -452
- package/lib/host-packages/claude/openplanr/runtime/plan/scripts/runtime/packages/protocol/package.json +5 -1
- 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/utilities.md +14 -8
- package/lib/host-packages/claude/openplanr/skills/design-loop/references/utilities.md +14 -8
- package/lib/host-packages/claude/openplanr/skills/design-review/references/utilities.md +14 -8
- package/lib/host-packages/claude/openplanr/skills/investigate/SKILL.md +1 -0
- package/lib/host-packages/claude/openplanr/skills/investigate/references/fail-first.md +40 -0
- package/lib/host-packages/claude/openplanr/skills/ship/SKILL.md +22 -10
- 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/cursor/openplanr/.openplanr-content.json +65 -121
- 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/utilities.md +14 -8
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/references/utilities.md +14 -8
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/references/utilities.md +14 -8
- 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 +1 -0
- 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 +22 -10
- 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 +26 -26
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-handoff.mjs +850 -56
- 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-3d9b1a86.mjs → design-shared-artifact-support-dependencies-design-support-protocol-contracts-d707e49b.mjs} +762 -223
- 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 +107 -37
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +0 -27
- 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 -5684
- 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 +3 -3
- 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/protocol/package.json +5 -1
- package/lib/host-packages/cursor/openplanr/runtime/plan/scripts/design-protocol-contracts.mjs +545 -4781
- package/lib/host-packages/cursor/openplanr/runtime/plan/scripts/design.mjs +219 -452
- package/lib/host-packages/cursor/openplanr/runtime/plan/scripts/runtime/packages/protocol/package.json +5 -1
- 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 +68 -124
- 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 +26 -26
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-handoff.mjs +850 -56
- 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/{claude/openplanr/runtime/design/scripts/design-shared-artifact-support-dependencies-design-support-protocol-contracts-3d9b1a86.mjs → openai/openplanr/runtime/design/scripts/design-shared-artifact-support-dependencies-design-support-protocol-contracts-d707e49b.mjs} +762 -223
- 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 +107 -37
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +0 -27
- 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 -5684
- 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 +3 -3
- 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/protocol/package.json +5 -1
- package/lib/host-packages/openai/openplanr/runtime/plan/scripts/design-protocol-contracts.mjs +545 -4781
- package/lib/host-packages/openai/openplanr/runtime/plan/scripts/design.mjs +219 -452
- package/lib/host-packages/openai/openplanr/runtime/plan/scripts/runtime/packages/protocol/package.json +5 -1
- 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/utilities.md +14 -8
- package/lib/host-packages/openai/openplanr/skills/design-loop/references/utilities.md +14 -8
- package/lib/host-packages/openai/openplanr/skills/design-review/references/utilities.md +14 -8
- package/lib/host-packages/openai/openplanr/skills/investigate/SKILL.md +1 -0
- 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/ship/SKILL.md +22 -10
- 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/package.json +8 -8
- package/dist/dashboard/assets/index-BU5fzjyz.css +0 -1
- package/dist/dashboard/assets/index-B_96uzCl.js +0 -572
- package/dist/dashboard/assets/index-B_96uzCl.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-25485dbf1cb2.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-protocol-contracts-75a938cc.mjs +0 -222
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-shared-protocol-contracts-b5f28f94.mjs +0 -5907
- 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-25485dbf1cb2.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-protocol-contracts-75a938cc.mjs +0 -222
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-shared-protocol-contracts-b5f28f94.mjs +0 -5907
- 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-25485dbf1cb2.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-protocol-contracts-75a938cc.mjs +0 -222
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-shared-protocol-contracts-b5f28f94.mjs +0 -5907
- 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
|
@@ -46,35 +46,35 @@
|
|
|
46
46
|
function normalized(value) {
|
|
47
47
|
return Math.round(clamp(value) * 1e6) / 1e6;
|
|
48
48
|
}
|
|
49
|
-
function assertRect(
|
|
50
|
-
if (!
|
|
49
|
+
function assertRect(rect) {
|
|
50
|
+
if (!rect || !Number.isFinite(rect.left) || !Number.isFinite(rect.top) || !Number.isFinite(rect.width) || !Number.isFinite(rect.height) || rect.width <= 0 || rect.height <= 0) {
|
|
51
51
|
throw new RangeError("Artifact bounds must have positive finite dimensions.");
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
function clientSelectionToNormalized(
|
|
55
|
-
assertRect(
|
|
54
|
+
function clientSelectionToNormalized(rect, start, end = start, { dragThreshold = ARTIFACT_ANNOTATION_LIMITS.dragThreshold } = {}) {
|
|
55
|
+
assertRect(rect);
|
|
56
56
|
const startX = clamp(
|
|
57
|
-
finite(start?.x ?? start?.clientX,
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
finite(start?.x ?? start?.clientX, rect.left),
|
|
58
|
+
rect.left,
|
|
59
|
+
rect.left + rect.width
|
|
60
60
|
);
|
|
61
61
|
const startY = clamp(
|
|
62
|
-
finite(start?.y ?? start?.clientY,
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
finite(start?.y ?? start?.clientY, rect.top),
|
|
63
|
+
rect.top,
|
|
64
|
+
rect.top + rect.height
|
|
65
65
|
);
|
|
66
|
-
const endX = clamp(finite(end?.x ?? end?.clientX, startX),
|
|
67
|
-
const endY = clamp(finite(end?.y ?? end?.clientY, startY),
|
|
66
|
+
const endX = clamp(finite(end?.x ?? end?.clientX, startX), rect.left, rect.left + rect.width);
|
|
67
|
+
const endY = clamp(finite(end?.y ?? end?.clientY, startY), rect.top, rect.top + rect.height);
|
|
68
68
|
const dragged = Math.hypot(endX - startX, endY - startY) >= Math.max(0, finite(dragThreshold, 4));
|
|
69
69
|
const left = dragged ? Math.min(startX, endX) : startX;
|
|
70
70
|
const top = dragged ? Math.min(startY, endY) : startY;
|
|
71
71
|
const right = dragged ? Math.max(startX, endX) : startX;
|
|
72
72
|
const bottom = dragged ? Math.max(startY, endY) : startY;
|
|
73
73
|
return Object.freeze({
|
|
74
|
-
x: normalized((left -
|
|
75
|
-
y: normalized((top -
|
|
76
|
-
w: normalized((right - left) /
|
|
77
|
-
h: normalized((bottom - top) /
|
|
74
|
+
x: normalized((left - rect.left) / rect.width),
|
|
75
|
+
y: normalized((top - rect.top) / rect.height),
|
|
76
|
+
w: normalized((right - left) / rect.width),
|
|
77
|
+
h: normalized((bottom - top) / rect.height)
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
80
|
function artifactAnchorPoint(region, viewport) {
|
|
@@ -126,11 +126,11 @@
|
|
|
126
126
|
}
|
|
127
127
|
function domToken(value) {
|
|
128
128
|
const source = String(value);
|
|
129
|
-
let
|
|
130
|
-
for (let
|
|
131
|
-
|
|
129
|
+
let token = "";
|
|
130
|
+
for (let index = 0; index < source.length; index += 1) {
|
|
131
|
+
token += source.charCodeAt(index).toString(16).padStart(4, "0");
|
|
132
132
|
}
|
|
133
|
-
return
|
|
133
|
+
return token;
|
|
134
134
|
}
|
|
135
135
|
function annotationDomIds(pinId) {
|
|
136
136
|
const suffix = domToken(pinId);
|
|
@@ -143,26 +143,26 @@
|
|
|
143
143
|
return typeof value === "string" ? value.trim().slice(0, max) : "";
|
|
144
144
|
}
|
|
145
145
|
function make(document2, tag, { className, textContent, attributes = {} } = {}) {
|
|
146
|
-
const
|
|
147
|
-
if (className)
|
|
148
|
-
if (textContent !== void 0)
|
|
146
|
+
const node = document2.createElement(tag);
|
|
147
|
+
if (className) node.className = className;
|
|
148
|
+
if (textContent !== void 0) node.textContent = textContent;
|
|
149
149
|
for (const [name, value] of Object.entries(attributes)) {
|
|
150
|
-
if (value !== void 0 && value !== null)
|
|
150
|
+
if (value !== void 0 && value !== null) node.setAttribute(name, String(value));
|
|
151
151
|
}
|
|
152
|
-
return
|
|
152
|
+
return node;
|
|
153
153
|
}
|
|
154
|
-
function setRegionStyle(
|
|
154
|
+
function setRegionStyle(node, region) {
|
|
155
155
|
const style = annotationStyle(region);
|
|
156
|
-
if (
|
|
157
|
-
if (
|
|
156
|
+
if (node.style.left !== style.left) node.style.left = style.left;
|
|
157
|
+
if (node.style.top !== style.top) node.style.top = style.top;
|
|
158
158
|
if (region.w > 0 || region.h > 0) {
|
|
159
|
-
if (
|
|
160
|
-
if (
|
|
159
|
+
if (node.style.width !== style.width) node.style.width = style.width;
|
|
160
|
+
if (node.style.height !== style.height) node.style.height = style.height;
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
163
|
function announce(document2, value) {
|
|
164
|
-
const
|
|
165
|
-
if (
|
|
164
|
+
const node = document2.querySelector('[data-planr-slot="review-announcer"]');
|
|
165
|
+
if (node) node.textContent = value;
|
|
166
166
|
}
|
|
167
167
|
function identityName(reviewController) {
|
|
168
168
|
return text(
|
|
@@ -175,14 +175,14 @@
|
|
|
175
175
|
className: "planr-intent-picker",
|
|
176
176
|
attributes: { role: "radiogroup", "aria-label": "Feedback intent" }
|
|
177
177
|
});
|
|
178
|
-
for (const [
|
|
178
|
+
for (const [index, intent] of INTENTS.entries()) {
|
|
179
179
|
const button = make(document2, "button", {
|
|
180
180
|
textContent: intent[0].toUpperCase() + intent.slice(1),
|
|
181
181
|
attributes: {
|
|
182
182
|
type: "button",
|
|
183
183
|
role: "radio",
|
|
184
|
-
"aria-checked": String(
|
|
185
|
-
tabindex:
|
|
184
|
+
"aria-checked": String(index === 0),
|
|
185
|
+
tabindex: index === 0 ? 0 : -1,
|
|
186
186
|
"data-planr-intent": intent
|
|
187
187
|
}
|
|
188
188
|
});
|
|
@@ -218,16 +218,16 @@
|
|
|
218
218
|
}
|
|
219
219
|
function layerFor(artifactId) {
|
|
220
220
|
return [...document2.querySelectorAll("[data-planr-annotation-layer]")].find(
|
|
221
|
-
(
|
|
221
|
+
(node) => node.dataset.planrAnnotationLayer === artifactId
|
|
222
222
|
) ?? null;
|
|
223
223
|
}
|
|
224
224
|
function frameFor(artifactId) {
|
|
225
225
|
return [...document2.querySelectorAll("[data-planr-artifact-frame]")].find(
|
|
226
|
-
(
|
|
226
|
+
(node) => node.dataset.planrArtifactFrame === artifactId
|
|
227
227
|
) ?? null;
|
|
228
228
|
}
|
|
229
229
|
function focusThread(pinId) {
|
|
230
|
-
const pin = review()?.pins?.find((
|
|
230
|
+
const pin = review()?.pins?.find((item) => item.id === pinId);
|
|
231
231
|
if (!pin) return;
|
|
232
232
|
reviewController.selectPin?.(pinId);
|
|
233
233
|
const state = stageController.getState();
|
|
@@ -238,7 +238,7 @@
|
|
|
238
238
|
queueMicrotask(() => document2.getElementById(annotationDomIds(pinId).thread)?.focus());
|
|
239
239
|
}
|
|
240
240
|
function focusPin(pinId) {
|
|
241
|
-
const pin = review()?.pins?.find((
|
|
241
|
+
const pin = review()?.pins?.find((item) => item.id === pinId);
|
|
242
242
|
if (!pin) return;
|
|
243
243
|
reviewController.selectPin?.(pinId);
|
|
244
244
|
const state = stageController.getState();
|
|
@@ -270,21 +270,21 @@
|
|
|
270
270
|
pin.viewport
|
|
271
271
|
]);
|
|
272
272
|
}
|
|
273
|
-
function setPinPosition(
|
|
274
|
-
const
|
|
275
|
-
setRegionStyle(
|
|
276
|
-
if (
|
|
277
|
-
if (
|
|
278
|
-
if (
|
|
273
|
+
function setPinPosition(record, region) {
|
|
274
|
+
const point = { x: region.x + region.w / 2, y: region.y + region.h / 2, w: 0, h: 0 };
|
|
275
|
+
setRegionStyle(record.button, point);
|
|
276
|
+
if (record.region) setRegionStyle(record.region, region);
|
|
277
|
+
if (record.button.hidden) record.button.hidden = false;
|
|
278
|
+
if (record.region?.hidden) record.region.hidden = false;
|
|
279
279
|
}
|
|
280
|
-
function hidePin(
|
|
281
|
-
if (!
|
|
282
|
-
if (
|
|
280
|
+
function hidePin(record) {
|
|
281
|
+
if (!record.button.hidden) record.button.hidden = true;
|
|
282
|
+
if (record.region && !record.region.hidden) record.region.hidden = true;
|
|
283
283
|
}
|
|
284
|
-
function removePin(
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
284
|
+
function removePin(record) {
|
|
285
|
+
record.pending = null;
|
|
286
|
+
record.button.remove();
|
|
287
|
+
record.region?.remove();
|
|
288
288
|
}
|
|
289
289
|
function refreshAnchors() {
|
|
290
290
|
if (destroyed) return;
|
|
@@ -295,40 +295,40 @@
|
|
|
295
295
|
frame
|
|
296
296
|
])
|
|
297
297
|
);
|
|
298
|
-
const records = [...pinRecords.values()].flatMap((records2) => [...records2.values()]).filter((
|
|
299
|
-
for (const
|
|
300
|
-
if (
|
|
301
|
-
const frame = frames.get(
|
|
298
|
+
const records = [...pinRecords.values()].flatMap((records2) => [...records2.values()]).filter((record) => record.pin.anchor?.planrId).sort((a, b) => a.requestedAt - b.requestedAt);
|
|
299
|
+
for (const record of records) {
|
|
300
|
+
if (record.pending || now - record.requestedAt < 200 || !record.button.isConnected) continue;
|
|
301
|
+
const frame = frames.get(record.pin.artifactId);
|
|
302
302
|
const bridge = frame?.__openPlanrBridge;
|
|
303
303
|
if (!bridge?.resolve || frame.closest("[hidden]") || frame.dataset.planrBridgeTrusted === "false" || (anchorRequests.get(frame) ?? 0) >= 8)
|
|
304
304
|
continue;
|
|
305
|
-
const request = {}, key =
|
|
306
|
-
|
|
307
|
-
|
|
305
|
+
const request = {}, key = record.geometryKey, pin = record.pin;
|
|
306
|
+
record.pending = request;
|
|
307
|
+
record.requestedAt = now;
|
|
308
308
|
anchorRequests.set(frame, (anchorRequests.get(frame) ?? 0) + 1);
|
|
309
|
-
Promise.resolve().then(() => bridge.resolve(pin.anchor.planrId, pin.anchor.screen)).then((
|
|
310
|
-
if (destroyed ||
|
|
309
|
+
Promise.resolve().then(() => bridge.resolve(pin.anchor.planrId, pin.anchor.screen)).then((anchor) => {
|
|
310
|
+
if (destroyed || record.pending !== request || record.geometryKey !== key || !record.button.isConnected || frame.__openPlanrBridge !== bridge)
|
|
311
311
|
return;
|
|
312
|
-
if (!
|
|
313
|
-
hidePin(
|
|
314
|
-
if (
|
|
315
|
-
|
|
312
|
+
if (!anchor || anchor.rect.width <= 0 || anchor.rect.height <= 0) {
|
|
313
|
+
hidePin(record);
|
|
314
|
+
if (record.button.dataset.planrAnchorStatus !== "unavailable")
|
|
315
|
+
record.button.dataset.planrAnchorStatus = "unavailable";
|
|
316
316
|
return;
|
|
317
317
|
}
|
|
318
318
|
const projected = anchorRegionToViewportRegion(
|
|
319
319
|
pin.region,
|
|
320
|
-
|
|
321
|
-
|
|
320
|
+
anchor.viewport ?? pin.viewport,
|
|
321
|
+
anchor.rect
|
|
322
322
|
);
|
|
323
|
-
setPinPosition(
|
|
324
|
-
if (
|
|
325
|
-
|
|
323
|
+
setPinPosition(record, projected);
|
|
324
|
+
if (record.button.dataset.planrAnchorStatus !== "resolved")
|
|
325
|
+
record.button.dataset.planrAnchorStatus = "resolved";
|
|
326
326
|
}).catch(() => {
|
|
327
327
|
}).finally(() => {
|
|
328
328
|
const remaining = (anchorRequests.get(frame) ?? 1) - 1;
|
|
329
329
|
if (remaining > 0) anchorRequests.set(frame, remaining);
|
|
330
330
|
else anchorRequests.delete(frame);
|
|
331
|
-
if (
|
|
331
|
+
if (record.pending === request) record.pending = null;
|
|
332
332
|
});
|
|
333
333
|
}
|
|
334
334
|
}
|
|
@@ -338,7 +338,7 @@
|
|
|
338
338
|
const layers = new Set(document2.querySelectorAll("[data-planr-annotation-layer]"));
|
|
339
339
|
for (const [layer, records] of pinRecords) {
|
|
340
340
|
if (layers.has(layer)) continue;
|
|
341
|
-
for (const
|
|
341
|
+
for (const record of records.values()) removePin(record);
|
|
342
342
|
pinRecords.delete(layer);
|
|
343
343
|
}
|
|
344
344
|
for (const layer of layers) {
|
|
@@ -348,24 +348,24 @@
|
|
|
348
348
|
pinRecords.set(layer, records);
|
|
349
349
|
}
|
|
350
350
|
const current = /* @__PURE__ */ new Set();
|
|
351
|
-
for (const [
|
|
351
|
+
for (const [index, pin] of pins.entries()) {
|
|
352
352
|
if (pin.artifactId !== layer.dataset.planrAnnotationLayer) continue;
|
|
353
353
|
current.add(pin.id);
|
|
354
|
-
const
|
|
354
|
+
const ids = annotationDomIds(pin.id), ordinal = index + 1;
|
|
355
355
|
const hasRegion = pin.region.w > 0 || pin.region.h > 0;
|
|
356
|
-
let
|
|
357
|
-
if (!
|
|
356
|
+
let record = records.get(pin.id);
|
|
357
|
+
if (!record) {
|
|
358
358
|
const button = make(document2, "button", {
|
|
359
359
|
attributes: {
|
|
360
360
|
type: "button",
|
|
361
|
-
id:
|
|
361
|
+
id: ids.pin,
|
|
362
362
|
"data-planr-pin-id": pin.id,
|
|
363
|
-
"aria-controls":
|
|
363
|
+
"aria-controls": ids.thread
|
|
364
364
|
}
|
|
365
365
|
});
|
|
366
366
|
button.addEventListener("click", () => focusThread(pin.id));
|
|
367
367
|
layer.append(button);
|
|
368
|
-
|
|
368
|
+
record = {
|
|
369
369
|
button,
|
|
370
370
|
region: null,
|
|
371
371
|
pin,
|
|
@@ -373,56 +373,56 @@
|
|
|
373
373
|
pending: null,
|
|
374
374
|
requestedAt: -Infinity
|
|
375
375
|
};
|
|
376
|
-
records.set(pin.id,
|
|
376
|
+
records.set(pin.id, record);
|
|
377
377
|
}
|
|
378
|
-
|
|
379
|
-
if (hasRegion && !
|
|
380
|
-
|
|
378
|
+
record.pin = pin;
|
|
379
|
+
if (hasRegion && !record.region) {
|
|
380
|
+
record.region = make(document2, "span", {
|
|
381
381
|
attributes: { "data-planr-pin-region-id": pin.id, "aria-hidden": "true" }
|
|
382
382
|
});
|
|
383
|
-
layer.insertBefore(
|
|
384
|
-
} else if (!hasRegion &&
|
|
385
|
-
|
|
386
|
-
|
|
383
|
+
layer.insertBefore(record.region, record.button);
|
|
384
|
+
} else if (!hasRegion && record.region) {
|
|
385
|
+
record.region.remove();
|
|
386
|
+
record.region = null;
|
|
387
387
|
}
|
|
388
|
-
const buttonClass = `planr-pin planr-pin-${pin.intent} planr-pin-${pin.status}${hasRegion ? " planr-pin-region-handle" : ""}${
|
|
389
|
-
if (
|
|
390
|
-
if (
|
|
391
|
-
|
|
388
|
+
const buttonClass = `planr-pin planr-pin-${pin.intent} planr-pin-${pin.status}${hasRegion ? " planr-pin-region-handle" : ""}${record.button.classList.contains("planr-pin-highlight") ? " planr-pin-highlight" : ""}`;
|
|
389
|
+
if (record.button.className !== buttonClass) record.button.className = buttonClass;
|
|
390
|
+
if (record.button.textContent !== String(ordinal))
|
|
391
|
+
record.button.textContent = String(ordinal);
|
|
392
392
|
for (const [name, value] of Object.entries({
|
|
393
393
|
"data-planr-intent": pin.intent,
|
|
394
394
|
"data-planr-status": pin.status,
|
|
395
395
|
"aria-label": `${pin.intent} comment ${ordinal}: ${pin.comment}`
|
|
396
396
|
})) {
|
|
397
|
-
if (
|
|
397
|
+
if (record.button.getAttribute(name) !== value) record.button.setAttribute(name, value);
|
|
398
398
|
}
|
|
399
|
-
if (
|
|
399
|
+
if (record.region) {
|
|
400
400
|
const regionClass = `planr-pin-region planr-pin-region-${pin.intent} planr-pin-region-${pin.status}`;
|
|
401
|
-
if (
|
|
401
|
+
if (record.region.className !== regionClass) record.region.className = regionClass;
|
|
402
402
|
}
|
|
403
403
|
const key = pinGeometryKey(pin);
|
|
404
|
-
if (
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
if (pin.anchor?.planrId) hidePin(
|
|
404
|
+
if (record.geometryKey !== key) {
|
|
405
|
+
record.geometryKey = key;
|
|
406
|
+
record.pending = null;
|
|
407
|
+
record.requestedAt = -Infinity;
|
|
408
|
+
if (pin.anchor?.planrId) hidePin(record);
|
|
409
409
|
else {
|
|
410
|
-
delete
|
|
411
|
-
setPinPosition(
|
|
410
|
+
delete record.button.dataset.planrAnchorStatus;
|
|
411
|
+
setPinPosition(record, pin.region);
|
|
412
412
|
}
|
|
413
413
|
}
|
|
414
414
|
}
|
|
415
|
-
for (const [
|
|
416
|
-
if (!current.has(
|
|
417
|
-
removePin(
|
|
418
|
-
records.delete(
|
|
415
|
+
for (const [id, record] of records) {
|
|
416
|
+
if (!current.has(id)) {
|
|
417
|
+
removePin(record);
|
|
418
|
+
records.delete(id);
|
|
419
419
|
}
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
422
|
refreshAnchors();
|
|
423
423
|
}
|
|
424
424
|
function closeComposer({ restoreFocus = false, preserveDraft = false } = {}) {
|
|
425
|
-
const
|
|
425
|
+
const snapshot = preserveDraft ? snapshotDraft() : null;
|
|
426
426
|
draftFieldCleanup?.();
|
|
427
427
|
draftFieldCleanup = null;
|
|
428
428
|
composerLayoutCleanup?.();
|
|
@@ -435,7 +435,7 @@
|
|
|
435
435
|
}
|
|
436
436
|
composer?.remove();
|
|
437
437
|
draft = null;
|
|
438
|
-
suspendedDraft =
|
|
438
|
+
suspendedDraft = snapshot;
|
|
439
439
|
draftToken += 1;
|
|
440
440
|
if (activeLayer && stageController.getState().reviewMode !== "comment") {
|
|
441
441
|
activeLayer.setAttribute("aria-disabled", "true");
|
|
@@ -446,22 +446,22 @@
|
|
|
446
446
|
}
|
|
447
447
|
composerReturnFocus = null;
|
|
448
448
|
}
|
|
449
|
-
async function resolveAnchor(
|
|
449
|
+
async function resolveAnchor(token, candidate) {
|
|
450
450
|
const frame = frameFor(candidate.artifactId);
|
|
451
|
-
const
|
|
451
|
+
const point = artifactAnchorPoint(candidate.region, candidate.viewport);
|
|
452
452
|
let result = null;
|
|
453
453
|
try {
|
|
454
|
-
const
|
|
455
|
-
if (
|
|
454
|
+
const anchor = frame?.__openPlanrBridge?.hitTest?.(point.x, point.y);
|
|
455
|
+
if (anchor) {
|
|
456
456
|
result = await Promise.race([
|
|
457
|
-
|
|
457
|
+
anchor,
|
|
458
458
|
new Promise((resolve) => window.setTimeout(() => resolve(null), 800))
|
|
459
459
|
]);
|
|
460
460
|
}
|
|
461
461
|
} catch {
|
|
462
462
|
result = null;
|
|
463
463
|
}
|
|
464
|
-
if (
|
|
464
|
+
if (token !== draftToken || !draft || draft.artifactId !== candidate.artifactId) return;
|
|
465
465
|
if (result?.planrId) {
|
|
466
466
|
draft.anchor = Object.freeze({
|
|
467
467
|
planrId: String(result.planrId).slice(0, 512),
|
|
@@ -485,16 +485,16 @@
|
|
|
485
485
|
const availableWidth = Math.max(1, viewport.width - margin * 2), availableHeight = Math.max(1, viewport.height - margin * 2);
|
|
486
486
|
composer.style.width = `${Math.min(360, availableWidth)}px`;
|
|
487
487
|
composer.style.maxHeight = `${Math.min(620, availableHeight)}px`;
|
|
488
|
-
const
|
|
489
|
-
const
|
|
490
|
-
x:
|
|
491
|
-
y:
|
|
488
|
+
const bounds = layer.getBoundingClientRect();
|
|
489
|
+
const point = {
|
|
490
|
+
x: bounds.left + clamp(draft.displayRegion.x + draft.displayRegion.w / 2) * bounds.width,
|
|
491
|
+
y: bounds.top + clamp(draft.displayRegion.y + draft.displayRegion.h / 2) * bounds.height
|
|
492
492
|
};
|
|
493
493
|
const size = composer.getBoundingClientRect();
|
|
494
494
|
const width = Math.min(size.width || 360, availableWidth), height = Math.min(size.height || 360, availableHeight);
|
|
495
|
-
const left =
|
|
495
|
+
const left = point.x + 16 + width <= viewport.x + viewport.width - margin ? point.x + 16 : point.x - width - 16;
|
|
496
496
|
composer.style.left = `${clamp(left, viewport.x + margin, viewport.x + viewport.width - width - margin)}px`;
|
|
497
|
-
composer.style.top = `${clamp(
|
|
497
|
+
composer.style.top = `${clamp(point.y + 16, viewport.y + margin, viewport.y + viewport.height - height - margin)}px`;
|
|
498
498
|
}
|
|
499
499
|
function openComposer(detail, { restoredDraft = null } = {}) {
|
|
500
500
|
const opener = document2.activeElement;
|
|
@@ -503,7 +503,7 @@
|
|
|
503
503
|
const layer = layerFor(detail.artifactId);
|
|
504
504
|
if (!layer) return;
|
|
505
505
|
draftToken += 1;
|
|
506
|
-
const
|
|
506
|
+
const token = draftToken;
|
|
507
507
|
draft = {
|
|
508
508
|
artifactId: detail.artifactId,
|
|
509
509
|
region: Object.freeze({ ...detail.region }),
|
|
@@ -637,7 +637,7 @@
|
|
|
637
637
|
return;
|
|
638
638
|
}
|
|
639
639
|
reviewController.setIdentity?.({ name: author });
|
|
640
|
-
const existingIds = new Set(review()?.pins?.map(({ id
|
|
640
|
+
const existingIds = new Set(review()?.pins?.map(({ id }) => id) ?? []);
|
|
641
641
|
const action = {
|
|
642
642
|
type: "add-pin",
|
|
643
643
|
pin: {
|
|
@@ -652,7 +652,7 @@
|
|
|
652
652
|
};
|
|
653
653
|
const next = reviewController.dispatch(action);
|
|
654
654
|
const nextReview = next?.review ?? next;
|
|
655
|
-
const created = nextReview?.pins?.find?.(({ id
|
|
655
|
+
const created = nextReview?.pins?.find?.(({ id }) => !existingIds.has(id));
|
|
656
656
|
closeComposer();
|
|
657
657
|
renderPins();
|
|
658
658
|
announce(document2, `${selectedIntent} comment added.`);
|
|
@@ -687,7 +687,7 @@
|
|
|
687
687
|
);
|
|
688
688
|
if (fields.size) {
|
|
689
689
|
let restoreFields = function() {
|
|
690
|
-
if (
|
|
690
|
+
if (token !== draftToken || !composer.isConnected) {
|
|
691
691
|
finish();
|
|
692
692
|
return;
|
|
693
693
|
}
|
|
@@ -711,7 +711,7 @@
|
|
|
711
711
|
draftFieldCleanup = finish;
|
|
712
712
|
restoreFields();
|
|
713
713
|
}
|
|
714
|
-
} else void resolveAnchor(
|
|
714
|
+
} else void resolveAnchor(token, draft);
|
|
715
715
|
}
|
|
716
716
|
function snapshotDraft() {
|
|
717
717
|
const composer = document2.querySelector("[data-planr-annotation-composer]");
|
|
@@ -736,17 +736,17 @@
|
|
|
736
736
|
selectionDirection: comment.selectionDirection
|
|
737
737
|
});
|
|
738
738
|
}
|
|
739
|
-
function restoreDraft(
|
|
740
|
-
if (!
|
|
739
|
+
function restoreDraft(snapshot) {
|
|
740
|
+
if (!snapshot || snapshot.reviewOf !== (reviewController.getReviewOf?.() ?? review()?.reviewOf ?? null))
|
|
741
741
|
return false;
|
|
742
|
-
const artifact = stageController.getState().artifacts.find((entry) => entry.id ===
|
|
743
|
-
if (!artifact || artifact.viewport.width !==
|
|
744
|
-
(key) => Number.isFinite(
|
|
742
|
+
const artifact = stageController.getState().artifacts.find((entry) => entry.id === snapshot.artifactId);
|
|
743
|
+
if (!artifact || artifact.viewport.width !== snapshot.viewport?.width || artifact.viewport.height !== snapshot.viewport?.height || !["x", "y", "w", "h"].every(
|
|
744
|
+
(key) => Number.isFinite(snapshot.region?.[key]) && snapshot.region[key] >= 0 && snapshot.region[key] <= 1
|
|
745
745
|
) || !["x", "y", "w", "h"].every(
|
|
746
|
-
(key) => Number.isFinite(
|
|
747
|
-
) || typeof
|
|
746
|
+
(key) => Number.isFinite(snapshot.displayRegion?.[key]) && snapshot.displayRegion[key] >= 0 && snapshot.displayRegion[key] <= 1
|
|
747
|
+
) || typeof snapshot.comment !== "string" || snapshot.comment.length > ARTIFACT_ANNOTATION_LIMITS.maxCommentLength || typeof snapshot.identity !== "string" || snapshot.identity.length > ARTIFACT_ANNOTATION_LIMITS.maxIdentityLength || !INTENTS.includes(snapshot.intent) || snapshot.anchor && (typeof snapshot.anchor.planrId !== "string" || snapshot.anchor.planrId.length > 512))
|
|
748
748
|
return false;
|
|
749
|
-
openComposer(
|
|
749
|
+
openComposer(snapshot, { restoredDraft: snapshot });
|
|
750
750
|
return Boolean(draft);
|
|
751
751
|
}
|
|
752
752
|
listen(window, "resize", positionComposer);
|
|
@@ -799,11 +799,16 @@
|
|
|
799
799
|
closeComposer();
|
|
800
800
|
for (const remove of cleanup.splice(0)) remove();
|
|
801
801
|
for (const records of pinRecords.values())
|
|
802
|
-
for (const
|
|
802
|
+
for (const record of records.values()) removePin(record);
|
|
803
803
|
pinRecords.clear();
|
|
804
804
|
anchorRequests.clear();
|
|
805
805
|
}
|
|
806
806
|
});
|
|
807
807
|
window.__openPlanrArtifactAnnotations = controller;
|
|
808
808
|
return controller;
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
// local-stage-stub:./durable-paste-share.mjs
|
|
812
|
+
function createDurablePasteShare() {
|
|
813
|
+
return null;
|
|
809
814
|
}
|