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,24 +1,11 @@
|
|
|
1
|
+
import { effectiveCodexHome } from './paths.js';
|
|
2
|
+
export { effectiveCodexHome } from './paths.js';
|
|
1
3
|
import { createHash } from 'node:crypto';
|
|
2
|
-
import { existsSync, lstatSync, readdirSync, readFileSync
|
|
4
|
+
import { existsSync, lstatSync, readdirSync, readFileSync } from 'node:fs';
|
|
3
5
|
import path from 'node:path';
|
|
4
6
|
import { parse } from 'smol-toml';
|
|
5
7
|
import { userHome } from '../../../lib/planr-home.mjs';
|
|
6
8
|
import { inspectRuntimeLocator, inspectRuntimePackage } from './runtime-package.js';
|
|
7
|
-
function canonicalPath(directory) {
|
|
8
|
-
const resolved = path.resolve(directory);
|
|
9
|
-
let existing = resolved;
|
|
10
|
-
while (!existsSync(existing) && path.dirname(existing) !== existing)
|
|
11
|
-
existing = path.dirname(existing);
|
|
12
|
-
return path.join(realpathSync(existing), path.relative(existing, resolved));
|
|
13
|
-
}
|
|
14
|
-
/** Uses the native profile selected by the caller, without inspecting other accounts. */
|
|
15
|
-
export function effectiveCodexHome() {
|
|
16
|
-
const defaultHome = path.resolve(userHome(), '.codex');
|
|
17
|
-
const selected = process.env.CODEX_HOME?.trim();
|
|
18
|
-
if (!selected || canonicalPath(selected) === canonicalPath(defaultHome))
|
|
19
|
-
return defaultHome;
|
|
20
|
-
return canonicalPath(selected);
|
|
21
|
-
}
|
|
22
9
|
/** Hashes the complete installed closure, including missing or additional support files. */
|
|
23
10
|
function sourceHash(directory) {
|
|
24
11
|
const digest = createHash('sha256');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex-discovery.js","sourceRoot":"","sources":["../../../src/services/runtime-manager/codex-discovery.ts"],"names":[],"mappings":"AAAA,OAAO,EAA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,CAAC,CAAC;IACjE,IAAI,kBAAkB,CAAC,MAAM,KAAK,CAAC;QACjC,MAAM,CAAC,IAAI,CAAC,+CAA+C,WAAW,GAAG,CAAC,CAAC;IAC7E,OAAO;QACL,aAAa;QACb,iBAAiB;QACjB,kBAAkB,EAAE,KAAK,CAAC,kBAAkB;QAC5C,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,cAAc,EAAE,KAAK,CAAC,cAAc;QACpC,iBAAiB,EAAE,6BAA6B;QAChD,MAAM,EAAE,kBAAkB,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAC3C,YAAY,CAAC,SAAS,EAAE,KAAK,EAAE,KAAK,CAAC,cAAc,EAAE,gBAAgB,CAAC,CACvE;QACD,MAAM;KACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { type ClaudeCommandRunner } from '../claude-plugin-service.js';
|
|
2
|
+
import { type CodexCommandRunner } from '../codex-plugin-service.js';
|
|
3
|
+
import { type CodexSkillDiscovery } from './codex-discovery.js';
|
|
1
4
|
import type { OwnedFile } from './global-state.js';
|
|
2
5
|
export type RuntimeDoctorDiagnostic = Readonly<{
|
|
3
6
|
code: string;
|
|
@@ -32,4 +35,26 @@ export declare function pluginDocuments(runtime: string, root: string): Installe
|
|
|
32
35
|
* In a shared file, only the block setup manages is read.
|
|
33
36
|
*/
|
|
34
37
|
export declare function diagnoseRetiredCommandSkills(documents: readonly InstalledDocument[], commandRoots: readonly string[], managedBlock: (content: Buffer, marker?: string) => Buffer): RuntimeDoctorDiagnostic | null;
|
|
38
|
+
export declare function runtimeDoctor(projectDir: string, options?: {
|
|
39
|
+
pipelineRepair?: 'preview' | 'apply';
|
|
40
|
+
claudeCommandRunner?: ClaudeCommandRunner;
|
|
41
|
+
codexCommandRunner?: CodexCommandRunner;
|
|
42
|
+
/** CLI root commands; enables the check for installed skills that still run `planr`. */
|
|
43
|
+
commandRoots?: readonly string[];
|
|
44
|
+
}): Promise<{
|
|
45
|
+
ok: boolean;
|
|
46
|
+
codexDiscovery?: CodexSkillDiscovery;
|
|
47
|
+
repairs: Array<{
|
|
48
|
+
id: string;
|
|
49
|
+
operation: 'remove';
|
|
50
|
+
target: string;
|
|
51
|
+
applied: boolean;
|
|
52
|
+
}>;
|
|
53
|
+
diagnostics: Array<{
|
|
54
|
+
code: string;
|
|
55
|
+
status: 'pass' | 'warn' | 'fail';
|
|
56
|
+
message: string;
|
|
57
|
+
fix?: string;
|
|
58
|
+
}>;
|
|
59
|
+
}>;
|
|
35
60
|
//# sourceMappingURL=doctor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../../src/services/runtime-manager/doctor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../../src/services/runtime-manager/doctor.ts"],"names":[],"mappings":"AASA,OAAO,EACL,KAAK,mBAAmB,EAGzB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,KAAK,kBAAkB,EAAiC,MAAM,4BAA4B,CAAC;AAGpG,OAAO,EAAE,KAAK,mBAAmB,EAA8B,MAAM,sBAAsB,CAAC;AAE5F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAkCnD,MAAM,MAAM,uBAAuB,GAAG,QAAQ,CAAC;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,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SAAS,MAAM,EAAE,CAAC;CAC7B,GACL,OAAO,CAAC;IACT,EAAE,EAAE,OAAO,CAAC;IACZ,cAAc,CAAC,EAAE,mBAAmB,CAAC;IACrC,OAAO,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,QAAQ,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IACtF,WAAW,EAAE,KAAK,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;QACjC,OAAO,EAAE,MAAM,CAAC;QAChB,GAAG,CAAC,EAAE,MAAM,CAAC;KACd,CAAC,CAAC;CACJ,CAAC,CAuiBD"}
|
|
@@ -1,6 +1,21 @@
|
|
|
1
|
+
import { spawnSync } from 'node:child_process';
|
|
1
2
|
import { existsSync, readdirSync, readFileSync } from 'node:fs';
|
|
2
3
|
import path from 'node:path';
|
|
4
|
+
import { CLI_NODE_REMEDIATION, cliNodeVersionMessage, supportsCliNodeVersion, } from '../../../lib/node-runtime.mjs';
|
|
3
5
|
import { CLI_COMMAND, PLANNING_FOLDER } from '../../utils/constants.js';
|
|
6
|
+
import { duplicateClaudePluginDiagnostic, inspectBundledClaudePluginIntegration, } from '../claude-plugin-service.js';
|
|
7
|
+
import { inspectCodexPluginIntegration } from '../codex-plugin-service.js';
|
|
8
|
+
import { resolvePipelinePackage } from '../pipeline-package-service.js';
|
|
9
|
+
import { readOpenPlanrVersion } from '../provenance-service.js';
|
|
10
|
+
import { inspectCodexSkillDiscovery } from './codex-discovery.js';
|
|
11
|
+
import { RuntimeManagerError } from './errors.js';
|
|
12
|
+
import { inferRuntimeScope, loadState, previewHomeProjectCleanup, projectUsesUserRuntime, } from './global-state.js';
|
|
13
|
+
import { runtimeLockManifestDigest, validateRuntimeLockContract, } from './install-plan.js';
|
|
14
|
+
import { detectInstalledRuntimes as detectRuntimes, listInstalledRuntimeAdapters as listRuntimeAdapters, readRegistry, } from './inventory.js';
|
|
15
|
+
import { RETIRED_CLAUDE_AGENT_HASHES, RETIRED_CURSOR_AGENT_RULES, RETIRED_CURSOR_WORKFLOW_RULES, } from './legacy-adapters.js';
|
|
16
|
+
import { codexSkillsRoot, pathIsWithin, planrHome, projectKey, statePath } from './paths.js';
|
|
17
|
+
import { bundledHostRoot, bundledSkillAssets, inspectRuntimeLocator, inspectThinRule, } from './runtime-package.js';
|
|
18
|
+
import { managedBlockBytes, ownershipHash } from './storage.js';
|
|
4
19
|
const SETUP_RUNTIMES = {
|
|
5
20
|
'claude-code': 'claude',
|
|
6
21
|
codex: 'codex',
|
|
@@ -118,4 +133,469 @@ export function diagnoseRetiredCommandSkills(documents, commandRoots, managedBlo
|
|
|
118
133
|
: `Rerun \`${CLI_COMMAND} setup\`, then restart the agent.`,
|
|
119
134
|
};
|
|
120
135
|
}
|
|
136
|
+
export async function runtimeDoctor(projectDir, options = {}) {
|
|
137
|
+
const diagnostics = [];
|
|
138
|
+
const repairs = [];
|
|
139
|
+
let lockedAdapters;
|
|
140
|
+
const supportedNode = supportsCliNodeVersion(process.versions.node);
|
|
141
|
+
diagnostics.push({
|
|
142
|
+
code: 'node-version',
|
|
143
|
+
status: supportedNode ? 'pass' : 'fail',
|
|
144
|
+
message: supportedNode
|
|
145
|
+
? `Node.js ${process.versions.node}`
|
|
146
|
+
: cliNodeVersionMessage(process.versions.node),
|
|
147
|
+
...(!supportedNode ? { fix: CLI_NODE_REMEDIATION } : {}),
|
|
148
|
+
});
|
|
149
|
+
const state = await loadState();
|
|
150
|
+
const installed = state.projects[projectKey(projectDir)];
|
|
151
|
+
const detectedRuntimes = detectRuntimes();
|
|
152
|
+
for (const result of detectedRuntimes) {
|
|
153
|
+
const configured = installed?.runtimes.includes(result.runtime) ?? false;
|
|
154
|
+
diagnostics.push({
|
|
155
|
+
code: `runtime-${result.runtime}`,
|
|
156
|
+
status: result.installed || !configured ? 'pass' : 'warn',
|
|
157
|
+
message: result.installed
|
|
158
|
+
? `${result.runtime} detected`
|
|
159
|
+
: configured
|
|
160
|
+
? `${result.runtime} is configured but not detected`
|
|
161
|
+
: `${result.runtime} is not installed or configured`,
|
|
162
|
+
...(!result.installed && configured
|
|
163
|
+
? { fix: `Install ${result.command} only if you intend to use this adapter.` }
|
|
164
|
+
: {}),
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
for (const [runtime, candidates] of [
|
|
168
|
+
[
|
|
169
|
+
'claude',
|
|
170
|
+
Object.keys(RETIRED_CLAUDE_AGENT_HASHES).map((name) => path.join(projectDir, '.claude', 'agents', name)),
|
|
171
|
+
],
|
|
172
|
+
[
|
|
173
|
+
'cursor',
|
|
174
|
+
[
|
|
175
|
+
...RETIRED_CURSOR_WORKFLOW_RULES.map((name) => path.join(projectDir, '.cursor', 'rules', name)),
|
|
176
|
+
...RETIRED_CURSOR_AGENT_RULES.map((name) => path.join(projectDir, '.cursor', 'rules', 'agents', name)),
|
|
177
|
+
],
|
|
178
|
+
],
|
|
179
|
+
]) {
|
|
180
|
+
const leftovers = candidates.filter((target) => existsSync(target));
|
|
181
|
+
if (leftovers.length === 0)
|
|
182
|
+
continue;
|
|
183
|
+
diagnostics.push({
|
|
184
|
+
code: `runtime-${runtime}-legacy-agents`,
|
|
185
|
+
status: 'warn',
|
|
186
|
+
message: `Potential legacy ${runtime} adapter paths remain: ${leftovers.join(', ')}`,
|
|
187
|
+
fix: `Run \`${CLI_COMMAND} setup --runtime ${runtime} --scope project --dry-run\`, then rerun without --dry-run to back up and retire recognized generated files. Modified or unknown files are preserved; review those manually.`,
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
const pipeline = resolvePipelinePackage(false);
|
|
191
|
+
diagnostics.push({
|
|
192
|
+
code: 'pipeline-package',
|
|
193
|
+
status: pipeline ? 'pass' : 'warn',
|
|
194
|
+
message: pipeline
|
|
195
|
+
? `Optional deterministic pipeline utilities ${pipeline.version}`
|
|
196
|
+
: 'Optional deterministic pipeline utilities are not installed',
|
|
197
|
+
...(!pipeline
|
|
198
|
+
? { fix: 'Install optional dependencies only if you need pipeline utilities.' }
|
|
199
|
+
: {}),
|
|
200
|
+
});
|
|
201
|
+
const registry = listRuntimeAdapters();
|
|
202
|
+
for (const adapter of registry) {
|
|
203
|
+
const detected = detectedRuntimes.find((entry) => entry.runtime === adapter.id)?.installed;
|
|
204
|
+
const configured = installed?.runtimes.includes(adapter.id) ?? false;
|
|
205
|
+
if (!detected && !configured)
|
|
206
|
+
continue;
|
|
207
|
+
const mode = adapter.capabilities?.interactiveQuestions;
|
|
208
|
+
diagnostics.push({
|
|
209
|
+
code: `runtime-interaction-${adapter.id}`,
|
|
210
|
+
status: mode ? 'pass' : 'fail',
|
|
211
|
+
message: mode
|
|
212
|
+
? `${adapter.id} uses ${mode} host-native questions`
|
|
213
|
+
: `${adapter.id} does not declare a host-native question capability`,
|
|
214
|
+
...(!mode ? { fix: 'Reinstall the OpenPlanr utility CLI host package.' } : {}),
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
try {
|
|
218
|
+
const counts = {
|
|
219
|
+
claude: new Set(bundledSkillAssets('claude-code').map(({ skillId }) => skillId)).size,
|
|
220
|
+
codex: new Set(bundledSkillAssets('codex').map(({ skillId }) => skillId)).size,
|
|
221
|
+
cursor: new Set(bundledSkillAssets('cursor').map(({ skillId }) => skillId)).size,
|
|
222
|
+
};
|
|
223
|
+
const uniqueCounts = new Set(Object.values(counts));
|
|
224
|
+
const current = uniqueCounts.size === 1 && counts.claude > 0;
|
|
225
|
+
diagnostics.push({
|
|
226
|
+
code: 'host-skill-packages',
|
|
227
|
+
status: current ? 'pass' : 'fail',
|
|
228
|
+
message: current
|
|
229
|
+
? `Claude Code, Codex, and Cursor each expose all ${counts.claude} host-native skills`
|
|
230
|
+
: `Host skill package membership drifted (${JSON.stringify(counts)})`,
|
|
231
|
+
...(!current ? { fix: 'Reinstall the CLI or regenerate its host packages.' } : {}),
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
catch (cause) {
|
|
235
|
+
diagnostics.push({
|
|
236
|
+
code: 'host-skill-packages',
|
|
237
|
+
status: 'fail',
|
|
238
|
+
message: cause instanceof Error ? cause.message : String(cause),
|
|
239
|
+
fix: 'Reinstall the CLI or regenerate its host packages.',
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
const claudeManagedAtUserScope = Object.values(state.projects).some((project) => project.runtimes.includes('claude-code') &&
|
|
243
|
+
['user', 'both'].includes(project.runtimeScopes?.['claude-code'] ??
|
|
244
|
+
inferRuntimeScope(project.ownedFiles, 'claude-code')));
|
|
245
|
+
const pluginSkillDocuments = [];
|
|
246
|
+
const claudeDetected = Boolean(options.claudeCommandRunner) ||
|
|
247
|
+
(detectedRuntimes.find((runtime) => runtime.runtime === 'claude-code')?.installed ?? false);
|
|
248
|
+
if (claudeDetected && claudeManagedAtUserScope) {
|
|
249
|
+
const inspection = inspectBundledClaudePluginIntegration(bundledHostRoot('claude'), options.claudeCommandRunner);
|
|
250
|
+
if (inspection.error) {
|
|
251
|
+
diagnostics.push({
|
|
252
|
+
code: 'runtime-claude-plugins',
|
|
253
|
+
status: 'fail',
|
|
254
|
+
message: `Claude plugin state could not be inspected: ${inspection.error}`,
|
|
255
|
+
fix: `Update Claude Code, then run \`${CLI_COMMAND} runtime update claude --scope user\`.`,
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
else {
|
|
259
|
+
for (const root of [
|
|
260
|
+
...inspection.plugins.flatMap((plugin) => plugin.installPath ?? []),
|
|
261
|
+
...inspection.duplicatePluginPaths,
|
|
262
|
+
]) {
|
|
263
|
+
pluginSkillDocuments.push(...pluginDocuments('claude-code', root));
|
|
264
|
+
}
|
|
265
|
+
const drift = inspection.plugins.filter((plugin) => !plugin.installed ||
|
|
266
|
+
!plugin.enabled ||
|
|
267
|
+
!plugin.identityValid ||
|
|
268
|
+
plugin.installedVersion !== plugin.expectedVersion);
|
|
269
|
+
diagnostics.push({
|
|
270
|
+
code: 'runtime-claude-plugins',
|
|
271
|
+
status: inspection.ready ? 'pass' : 'fail',
|
|
272
|
+
message: inspection.ready
|
|
273
|
+
? `Claude plugins match compatibility versions (${inspection.plugins
|
|
274
|
+
.map((plugin) => `${plugin.name} ${plugin.expectedVersion}`)
|
|
275
|
+
.join(', ')})`
|
|
276
|
+
: `Claude plugin drift detected: ${drift
|
|
277
|
+
.map((plugin) => `${plugin.id} ${plugin.installedVersion ?? 'missing'} → ${plugin.expectedVersion}${!plugin.identityValid ? ' (invalid identity)' : ''}`)
|
|
278
|
+
.join(', ')}`,
|
|
279
|
+
...(!inspection.ready
|
|
280
|
+
? {
|
|
281
|
+
fix: `Run \`${CLI_COMMAND} runtime update claude --scope user\` and restart Claude Code.`,
|
|
282
|
+
}
|
|
283
|
+
: {}),
|
|
284
|
+
});
|
|
285
|
+
if (inspection.staleMarketplacePath) {
|
|
286
|
+
diagnostics.push({
|
|
287
|
+
code: 'runtime-claude-marketplace-path',
|
|
288
|
+
status: 'fail',
|
|
289
|
+
message: `The local OpenPlanr Claude marketplace points to another install: ${inspection.staleMarketplacePath}, not ${bundledHostRoot('claude')}`,
|
|
290
|
+
fix: `Run \`${CLI_COMMAND} setup --runtime claude --scope user\` to point it at this install.`,
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
if (inspection.legacyPluginIds.length > 0) {
|
|
294
|
+
diagnostics.push({
|
|
295
|
+
code: 'runtime-claude-legacy-plugin',
|
|
296
|
+
status: 'warn',
|
|
297
|
+
message: `Legacy Claude plugin installation detected: ${inspection.legacyPluginIds.join(', ')}`,
|
|
298
|
+
fix: 'Verify `planr@openplanr-local`, then remove the legacy plugin from Claude Code.',
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
if (inspection.duplicatePluginIds.length > 0) {
|
|
302
|
+
diagnostics.push({
|
|
303
|
+
code: 'runtime-claude-duplicate-plugin',
|
|
304
|
+
status: 'warn',
|
|
305
|
+
...duplicateClaudePluginDiagnostic(inspection),
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
const expectsProjectLock = installed?.ownedFiles.some((file) => file.scope === 'project') ?? false;
|
|
311
|
+
const lock = path.join(projectDir, PLANNING_FOLDER, 'runtime-lock.json');
|
|
312
|
+
if (!existsSync(lock)) {
|
|
313
|
+
// User-scope setup is recorded under the directory it ran in but serves every project.
|
|
314
|
+
const managed = Boolean(installed) ||
|
|
315
|
+
Object.values(state.projects).some((project) => project.runtimes.some((runtime) => projectUsesUserRuntime(project, runtime)));
|
|
316
|
+
const lockStatus = expectsProjectLock ? 'warn' : managed ? 'pass' : 'warn';
|
|
317
|
+
diagnostics.push({
|
|
318
|
+
code: 'runtime-lock',
|
|
319
|
+
status: lockStatus,
|
|
320
|
+
message: expectsProjectLock
|
|
321
|
+
? 'Project runtime lock missing'
|
|
322
|
+
: managed
|
|
323
|
+
? 'User-scope setup does not require a project runtime lock'
|
|
324
|
+
: 'No managed runtime setup found for this directory',
|
|
325
|
+
...(expectsProjectLock
|
|
326
|
+
? { fix: `Run \`${CLI_COMMAND} setup --scope project\`.` }
|
|
327
|
+
: !managed
|
|
328
|
+
? { fix: `Run \`${CLI_COMMAND} setup\`.` }
|
|
329
|
+
: {}),
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
else {
|
|
333
|
+
try {
|
|
334
|
+
const value = JSON.parse(readFileSync(lock, 'utf8'));
|
|
335
|
+
const errors = validateRuntimeLockContract(value);
|
|
336
|
+
if (errors.length) {
|
|
337
|
+
throw new RuntimeManagerError('E_RUNTIME_LOCK_INVALID', 'Project runtime lock does not match the supported contract.');
|
|
338
|
+
}
|
|
339
|
+
lockedAdapters = value.adapters;
|
|
340
|
+
const cliVersion = readOpenPlanrVersion();
|
|
341
|
+
const cliDrift = value.components?.cli !== cliVersion;
|
|
342
|
+
const componentDrift = cliDrift ||
|
|
343
|
+
(pipeline && value.components?.pipeline !== pipeline.version) ||
|
|
344
|
+
value.components?.skills !== readRegistry().pluginVersion;
|
|
345
|
+
const expectedDigest = runtimeLockManifestDigest({
|
|
346
|
+
protocolVersion: value.protocolVersion,
|
|
347
|
+
pipelineVersion: value.components?.pipeline,
|
|
348
|
+
adapters: value.adapters,
|
|
349
|
+
skillModes: value.skillModes,
|
|
350
|
+
});
|
|
351
|
+
const digestDrift = value.manifestDigest !== expectedDigest;
|
|
352
|
+
const registry = listRuntimeAdapters();
|
|
353
|
+
const adapterDrift = (value.adapters ?? []).some((locked) => {
|
|
354
|
+
const current = registry.find((adapter) => adapter.id === locked.runtime);
|
|
355
|
+
return (!current ||
|
|
356
|
+
current.version !== locked.version ||
|
|
357
|
+
current.capabilityLevel !== locked.capabilityLevel);
|
|
358
|
+
});
|
|
359
|
+
// An OpenPlanr upgrade advances the CLI version the lock recorded.
|
|
360
|
+
// When the CLI component trails the installed build and nothing that
|
|
361
|
+
// governs runtime dispatch (runtime adapters, manifest digest)
|
|
362
|
+
// diverged, the lock is simply behind an expected upgrade — surface it as
|
|
363
|
+
// an informational `warn`, not a `fail` implying the board is broken. A
|
|
364
|
+
// digest/adapter drift, or a component drift that does not include the CLI
|
|
365
|
+
// (for example a pinned obsolete skill bundle), remains a genuine `fail`.
|
|
366
|
+
// The warn/fail derivation lives in the single `classifyComponentDrift`
|
|
367
|
+
// helper so `openplanr upgrade status` reuses this exact distinction rather
|
|
368
|
+
// than re-deriving it; a digest/adapter drift is doctor's
|
|
369
|
+
// flavour of an incompatible tuple.
|
|
370
|
+
const { drift, genuineDrift, upgradeOnlyDrift, status } = classifyComponentDrift({
|
|
371
|
+
cliDrift,
|
|
372
|
+
componentDrift: Boolean(componentDrift),
|
|
373
|
+
incompatibleDrift: digestDrift || adapterDrift,
|
|
374
|
+
});
|
|
375
|
+
diagnostics.push({
|
|
376
|
+
code: drift ? 'lock-drift' : 'runtime-lock',
|
|
377
|
+
status,
|
|
378
|
+
message: genuineDrift
|
|
379
|
+
? `Runtime lock drift detected (components: ${componentDrift}, digest: ${digestDrift}, adapters: ${adapterDrift})`
|
|
380
|
+
: upgradeOnlyDrift
|
|
381
|
+
? `Runtime lock component versions trail an OpenPlanr upgrade (components: ${componentDrift}); this is expected after upgrading and does not affect runtime execution`
|
|
382
|
+
: drift
|
|
383
|
+
? `Runtime lock drift detected (components: ${componentDrift}, digest: ${digestDrift}, adapters: ${adapterDrift})`
|
|
384
|
+
: 'Project runtime lock matches installed component versions',
|
|
385
|
+
...(drift
|
|
386
|
+
? {
|
|
387
|
+
fix: upgradeOnlyDrift
|
|
388
|
+
? `Run \`${CLI_COMMAND} runtime update all --scope project\` to refresh the lock to the upgraded component versions.`
|
|
389
|
+
: `Run \`${CLI_COMMAND} runtime update all --scope project\`.`,
|
|
390
|
+
}
|
|
391
|
+
: {}),
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
catch {
|
|
395
|
+
diagnostics.push({
|
|
396
|
+
code: 'runtime-lock-invalid',
|
|
397
|
+
status: 'fail',
|
|
398
|
+
message: 'Project runtime lock is not valid JSON or does not match the supported contract',
|
|
399
|
+
fix: `Run \`${CLI_COMMAND} setup --scope project\` after reviewing the existing lock.`,
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
if (installed) {
|
|
404
|
+
if (lockedAdapters) {
|
|
405
|
+
const lockedState = lockedAdapters
|
|
406
|
+
.map((adapter) => `${adapter.runtime}:${adapter.installScope}`)
|
|
407
|
+
.sort();
|
|
408
|
+
const installedState = installed.runtimes
|
|
409
|
+
.map((runtime) => `${runtime}:${installed.runtimeScopes?.[runtime] ?? inferRuntimeScope(installed.ownedFiles, runtime)}`)
|
|
410
|
+
.sort();
|
|
411
|
+
const stateDrift = JSON.stringify(lockedState) !== JSON.stringify(installedState);
|
|
412
|
+
diagnostics.push({
|
|
413
|
+
code: stateDrift ? 'lock-state-drift' : 'lock-state',
|
|
414
|
+
status: stateDrift ? 'fail' : 'pass',
|
|
415
|
+
message: stateDrift
|
|
416
|
+
? 'Runtime lock adapters do not match the managed installation state'
|
|
417
|
+
: 'Runtime lock adapters match the managed installation state',
|
|
418
|
+
...(stateDrift
|
|
419
|
+
? { fix: `Run \`${CLI_COMMAND} setup --dry-run\`, then approve the repair.` }
|
|
420
|
+
: {}),
|
|
421
|
+
});
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
else if (lockedAdapters?.length) {
|
|
425
|
+
diagnostics.push({
|
|
426
|
+
code: 'runtime-state-missing',
|
|
427
|
+
status: 'warn',
|
|
428
|
+
message: 'The project has a runtime lock but this machine has no managed adapter state',
|
|
429
|
+
fix: `Run \`${CLI_COMMAND} setup\` to install the locked runtime adapters on this machine.`,
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
const globallyOwned = Object.values(state.userBundles ?? {}).flatMap((bundle) => bundle?.ownedFiles ?? []);
|
|
433
|
+
const managedFiles = [
|
|
434
|
+
...(installed?.ownedFiles ?? []),
|
|
435
|
+
...globallyOwned.filter((file, index, files) => files.findIndex((candidate) => candidate.target === file.target) === index),
|
|
436
|
+
];
|
|
437
|
+
const managedFileDiagnostic = diagnoseManagedRuntimeFiles(managedFiles, ownershipHash);
|
|
438
|
+
if (managedFileDiagnostic)
|
|
439
|
+
diagnostics.push(managedFileDiagnostic);
|
|
440
|
+
const commandDiagnostic = diagnoseRetiredCommandSkills([...managedFiles, ...pluginSkillDocuments], options.commandRoots ?? [], managedBlockBytes);
|
|
441
|
+
if (commandDiagnostic)
|
|
442
|
+
diagnostics.push(commandDiagnostic);
|
|
443
|
+
const verifiedPackages = new Map();
|
|
444
|
+
const closureFailures = [];
|
|
445
|
+
for (const file of managedFiles) {
|
|
446
|
+
try {
|
|
447
|
+
if (path.basename(file.target) === 'openplanr.install.json')
|
|
448
|
+
inspectRuntimeLocator(path.dirname(file.target), verifiedPackages);
|
|
449
|
+
else if (file.runtime === 'cursor' && file.target.endsWith('.mdc'))
|
|
450
|
+
inspectThinRule(file.target, verifiedPackages);
|
|
451
|
+
}
|
|
452
|
+
catch (cause) {
|
|
453
|
+
closureFailures.push(`${file.target}: ${cause instanceof Error ? cause.message : String(cause)}`);
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
if (verifiedPackages.size || closureFailures.length)
|
|
457
|
+
diagnostics.push({
|
|
458
|
+
code: 'runtime-package-custody',
|
|
459
|
+
status: closureFailures.length ? 'fail' : 'pass',
|
|
460
|
+
message: closureFailures.length
|
|
461
|
+
? `Pinned runtime package verification failed: ${closureFailures.join('; ')}`
|
|
462
|
+
: 'Pinned runtime packages match their complete content inventories',
|
|
463
|
+
...(closureFailures.length
|
|
464
|
+
? {
|
|
465
|
+
fix: `Run \`${CLI_COMMAND} doctor --fix\` to preview the repair; changed package files are backed up before anything is replaced.`,
|
|
466
|
+
}
|
|
467
|
+
: {}),
|
|
468
|
+
});
|
|
469
|
+
let codexDiscovery;
|
|
470
|
+
const codexBundle = state.userBundles?.codex;
|
|
471
|
+
if (options.codexCommandRunner ||
|
|
472
|
+
detectedRuntimes.some((runtime) => runtime.runtime === 'codex' && runtime.installed)) {
|
|
473
|
+
const configuredMode = codexBundle?.installMode ?? installed?.skillModes?.codex ?? 'direct';
|
|
474
|
+
const inspection = inspectCodexPluginIntegration(bundledHostRoot('openai'), configuredMode, configuredMode, options.codexCommandRunner);
|
|
475
|
+
codexDiscovery = inspectCodexSkillDiscovery({
|
|
476
|
+
hostPackageRoot: bundledHostRoot('openai'),
|
|
477
|
+
projectDir,
|
|
478
|
+
mode: configuredMode,
|
|
479
|
+
packageVersion: readOpenPlanrVersion(),
|
|
480
|
+
ownershipStatePath: statePath(),
|
|
481
|
+
activePlugin: inspection.installed
|
|
482
|
+
? { id: inspection.pluginId, version: inspection.installedVersion }
|
|
483
|
+
: undefined,
|
|
484
|
+
});
|
|
485
|
+
diagnostics.push({
|
|
486
|
+
code: 'runtime-codex-profile',
|
|
487
|
+
status: 'pass',
|
|
488
|
+
message: `Effective Codex profile: ${codexDiscovery.effectiveHome}; ownership: ${statePath()}`,
|
|
489
|
+
});
|
|
490
|
+
const stale = codexDiscovery.skills.filter((skill) => skill.resolution === 'stale');
|
|
491
|
+
const ambiguous = codexDiscovery.skills.filter((skill) => skill.resolution === 'ambiguous');
|
|
492
|
+
const missing = codexDiscovery.skills.filter((skill) => skill.resolution === 'missing');
|
|
493
|
+
const unreadable = codexDiscovery.skills.filter((skill) => skill.resolution === 'unreadable');
|
|
494
|
+
const oldCaches = codexDiscovery.skills.filter((skill) => skill.copies.some((copy) => copy.kind === 'plugin-cache' && !copy.current && copy.enabled !== true));
|
|
495
|
+
if (stale.length ||
|
|
496
|
+
ambiguous.length ||
|
|
497
|
+
missing.length ||
|
|
498
|
+
unreadable.length ||
|
|
499
|
+
codexDiscovery.issues.length) {
|
|
500
|
+
diagnostics.push({
|
|
501
|
+
code: 'runtime-codex-skill-resolution',
|
|
502
|
+
status: 'warn',
|
|
503
|
+
message: `${stale.length} stale skill(s), ${missing.length} missing skill(s), ${unreadable.length} unreadable skill(s), ${ambiguous.length} multiple discovery path(s), ${oldCaches.length} skill(s) with inactive cached copies. CLI package ${codexDiscovery.packageVersion}; per-skill and Protocol versions, paths and closure hashes are in doctor --json. An already-open session may retain earlier skills.`,
|
|
504
|
+
fix: `Run \`${CLI_COMMAND} setup --runtime codex --dry-run\` in this profile, review the installer repair, then restart Codex. Do not delete plugin caches by hand.`,
|
|
505
|
+
});
|
|
506
|
+
}
|
|
507
|
+
if (oldCaches.length > 0) {
|
|
508
|
+
diagnostics.push({
|
|
509
|
+
code: 'runtime-codex-cache-history',
|
|
510
|
+
status: 'pass',
|
|
511
|
+
message: `${oldCaches.length} skill(s) have inactive cached copies. These do not imply enabled duplicates; restart Codex if an open session still shows earlier skills.`,
|
|
512
|
+
});
|
|
513
|
+
}
|
|
514
|
+
const directSkillFiles = codexBundle?.ownedFiles.filter((file) => pathIsWithin(file.target, codexSkillsRoot()))
|
|
515
|
+
.length ?? 0;
|
|
516
|
+
if (inspection.error) {
|
|
517
|
+
diagnostics.push({
|
|
518
|
+
code: 'runtime-codex-plugin',
|
|
519
|
+
status: 'warn',
|
|
520
|
+
message: `Codex plugin state could not be inspected: ${inspection.error}`,
|
|
521
|
+
fix: `Run \`${CLI_COMMAND} setup --runtime codex --dry-run\` for an exact repair preview.`,
|
|
522
|
+
});
|
|
523
|
+
}
|
|
524
|
+
else {
|
|
525
|
+
diagnostics.push({
|
|
526
|
+
code: 'runtime-codex-install-mode',
|
|
527
|
+
status: inspection.ready ? 'pass' : 'warn',
|
|
528
|
+
message: inspection.ready
|
|
529
|
+
? `Codex ${configuredMode} discovery is current`
|
|
530
|
+
: inspection.operations.length > 0
|
|
531
|
+
? `Codex ${configuredMode} discovery needs repair: ${inspection.operations.map((operation) => operation.description).join('; ')}`
|
|
532
|
+
: `Codex ${configuredMode} discovery has conflicting enabled registrations: ${inspection.duplicates.join(', ')}`,
|
|
533
|
+
...(inspection.ready
|
|
534
|
+
? {}
|
|
535
|
+
: {
|
|
536
|
+
fix: `Run \`${CLI_COMMAND} doctor --fix\` to preview repairs while preserving your saved discovery choice.`,
|
|
537
|
+
}),
|
|
538
|
+
});
|
|
539
|
+
if ((directSkillFiles > 0 && inspection.installed) || inspection.duplicates.length > 0) {
|
|
540
|
+
diagnostics.push({
|
|
541
|
+
code: 'runtime-codex-duplicate-discovery',
|
|
542
|
+
status: 'warn',
|
|
543
|
+
message: `Codex has duplicate OpenPlanr discovery ownership${inspection.duplicates.length ? `: ${inspection.duplicates.join(', ')}` : ' across direct skills and the unified plugin'}`,
|
|
544
|
+
fix: 'Choose direct or unified-plugin mode, preview setup, and use --replace-managed only for manifest-owned content.',
|
|
545
|
+
});
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
const accidentalHomeFiles = await previewHomeProjectCleanup();
|
|
550
|
+
if (accidentalHomeFiles.length > 0) {
|
|
551
|
+
diagnostics.push({
|
|
552
|
+
code: 'home-project-install',
|
|
553
|
+
status: 'warn',
|
|
554
|
+
message: `${accidentalHomeFiles.length} project-scoped managed file(s) were installed in the home directory`,
|
|
555
|
+
fix: `Run \`${CLI_COMMAND} doctor --fix\` to preview and remove only recorded OpenPlanr-owned project content.`,
|
|
556
|
+
});
|
|
557
|
+
}
|
|
558
|
+
const provenanceDiagnostic = diagnoseRuntimeProvenance(projectDir);
|
|
559
|
+
if (provenanceDiagnostic)
|
|
560
|
+
diagnostics.push(provenanceDiagnostic);
|
|
561
|
+
if (pipeline) {
|
|
562
|
+
// The child gets the resolved home only, so it does not repeat the OPENPLANR_HOME warning.
|
|
563
|
+
const { OPENPLANR_HOME: _deprecatedHome, ...inheritedEnvironment } = process.env;
|
|
564
|
+
const result = spawnSync(process.execPath, [
|
|
565
|
+
path.join(pipeline.root, 'scripts', 'doctor.mjs'),
|
|
566
|
+
'--json',
|
|
567
|
+
...(options.pipelineRepair === 'preview' ? ['--repair-preview'] : []),
|
|
568
|
+
...(options.pipelineRepair === 'apply' ? ['--fix'] : []),
|
|
569
|
+
], {
|
|
570
|
+
cwd: projectDir,
|
|
571
|
+
encoding: 'utf8',
|
|
572
|
+
windowsHide: true,
|
|
573
|
+
env: { ...inheritedEnvironment, PLANR_HOME: planrHome() },
|
|
574
|
+
});
|
|
575
|
+
try {
|
|
576
|
+
const report = JSON.parse(result.stdout);
|
|
577
|
+
repairs.push(...(report.repairs ?? []));
|
|
578
|
+
for (const check of report.checks ?? []) {
|
|
579
|
+
if (check.status === 'ok')
|
|
580
|
+
continue;
|
|
581
|
+
diagnostics.push({
|
|
582
|
+
code: `pipeline-${check.id}`,
|
|
583
|
+
status: check.status,
|
|
584
|
+
message: check.message,
|
|
585
|
+
...(check.fix ? { fix: check.fix } : {}),
|
|
586
|
+
});
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
catch {
|
|
590
|
+
diagnostics.push({
|
|
591
|
+
code: 'pipeline-doctor-unavailable',
|
|
592
|
+
status: 'warn',
|
|
593
|
+
message: 'The pipeline doctor did not return valid JSON',
|
|
594
|
+
fix: `Run \`${CLI_COMMAND} doctor\` for direct diagnostics.`,
|
|
595
|
+
});
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
const fail = diagnostics.some((item) => item.status === 'fail');
|
|
599
|
+
return { ok: !fail, diagnostics, repairs, ...(codexDiscovery ? { codexDiscovery } : {}) };
|
|
600
|
+
}
|
|
121
601
|
//# sourceMappingURL=doctor.js.map
|