openplanr 2.2641.2 → 3.0.1
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 +33 -0
- package/dist/cli/commands/doctor.d.ts.map +1 -1
- package/dist/cli/commands/doctor.js +19 -4
- package/dist/cli/commands/doctor.js.map +1 -1
- package/dist/cli/commands/upgrade.d.ts.map +1 -1
- package/dist/cli/commands/upgrade.js +15 -11
- package/dist/cli/commands/upgrade.js.map +1 -1
- package/dist/cli/error-boundary.d.ts.map +1 -1
- package/dist/cli/error-boundary.js +2 -1
- package/dist/cli/error-boundary.js.map +1 -1
- package/dist/dashboard/.vite/manifest.json +1 -1
- package/dist/dashboard/assets/{index-DI_TKz9J.js → index-n08LJ6bK.js} +2 -2
- package/dist/dashboard/assets/{index-DI_TKz9J.js.map → index-n08LJ6bK.js.map} +1 -1
- package/dist/dashboard/dashboard-manifest.json +8 -8
- package/dist/dashboard/index.html +1 -1
- package/dist/services/claude-plugin-service.d.ts +9 -0
- package/dist/services/claude-plugin-service.d.ts.map +1 -1
- package/dist/services/claude-plugin-service.js +12 -0
- package/dist/services/claude-plugin-service.js.map +1 -1
- package/dist/services/runtime-change-summary.d.ts +4 -0
- package/dist/services/runtime-change-summary.d.ts.map +1 -1
- package/dist/services/runtime-change-summary.js +7 -0
- package/dist/services/runtime-change-summary.js.map +1 -1
- package/dist/services/runtime-manager/doctor.js +1 -1
- package/dist/services/runtime-manager/doctor.js.map +1 -1
- package/dist/services/runtime-manager/runtime-package.d.ts +15 -0
- package/dist/services/runtime-manager/runtime-package.d.ts.map +1 -1
- package/dist/services/runtime-manager/runtime-package.js +50 -10
- package/dist/services/runtime-manager/runtime-package.js.map +1 -1
- package/dist/services/runtime-manager-service.d.ts +11 -0
- package/dist/services/runtime-manager-service.d.ts.map +1 -1
- package/dist/services/runtime-manager-service.js +88 -16
- package/dist/services/runtime-manager-service.js.map +1 -1
- package/dist/services/upgrade-report.d.ts +2 -2
- package/dist/services/upgrade-report.d.ts.map +1 -1
- package/dist/services/upgrade-report.js +14 -2
- package/dist/services/upgrade-report.js.map +1 -1
- package/dist/services/upgrade-service.d.ts +22 -2
- package/dist/services/upgrade-service.d.ts.map +1 -1
- package/dist/services/upgrade-service.js +108 -20
- package/dist/services/upgrade-service.js.map +1 -1
- package/docs/CLI.md +4 -1
- package/docs/TROUBLESHOOTING.md +9 -6
- package/install.ps1 +3 -3
- package/install.sh +3 -3
- package/lib/host-packages/adapter-registry.json +5 -5
- package/lib/host-packages/capability-map.json +1 -1
- package/lib/host-packages/claude/.claude-plugin/marketplace.json +2 -2
- package/lib/host-packages/claude/openplanr/.claude-plugin/plugin.json +2 -2
- package/lib/host-packages/claude/openplanr/.openplanr-content.json +21 -21
- package/lib/host-packages/claude/openplanr/README.md +1 -1
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/lib/artifact/ui/studio-shell.css +1 -1
- 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/enhancements.css +14 -4
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.css +14 -5
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/12-design-review-experience.js +28 -0
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/16-studio-shell.js +238 -68
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources.json +6 -6
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/package.json +6 -2
- 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 +1 -1
- package/lib/host-packages/claude/openplanr/skills/delegate/references/capsule-contract.md +1 -1
- package/lib/host-packages/claude/openplanr/skills/delegate/scripts/run-preparation.mjs +3 -3
- package/lib/host-packages/claude/openplanr/skills/design/references/utilities.md +1 -1
- package/lib/host-packages/claude/openplanr/skills/design-loop/references/utilities.md +1 -1
- package/lib/host-packages/claude/openplanr/skills/design-review/references/utilities.md +1 -1
- package/lib/host-packages/claude/openplanr/skills/doctor/SKILL.md +4 -1
- package/lib/host-packages/claude/openplanr/skills/doctor/references/upgrade.md +8 -0
- package/lib/host-packages/claude/openplanr/skills/plan/SKILL.md +2 -2
- package/lib/host-packages/cursor/openplanr/.openplanr-content.json +20 -20
- package/lib/host-packages/cursor/openplanr/manifest.json +1 -1
- package/lib/host-packages/cursor/openplanr/rules/planr-delegate/references/capsule-contract.md +1 -1
- package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/run-preparation.mjs +3 -3
- package/lib/host-packages/cursor/openplanr/rules/planr-delegate.mdc +1 -1
- package/lib/host-packages/cursor/openplanr/rules/planr-design/references/utilities.md +1 -1
- package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/references/utilities.md +1 -1
- package/lib/host-packages/cursor/openplanr/rules/planr-design-review/references/utilities.md +1 -1
- package/lib/host-packages/cursor/openplanr/rules/planr-doctor/references/upgrade.md +8 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-doctor.mdc +4 -1
- package/lib/host-packages/cursor/openplanr/rules/planr-plan.mdc +2 -2
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/lib/artifact/ui/studio-shell.css +1 -1
- 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/enhancements.css +14 -4
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.css +14 -5
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/12-design-review-experience.js +28 -0
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/16-studio-shell.js +238 -68
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources.json +6 -6
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/package.json +6 -2
- package/lib/host-packages/cursor/openplanr/runtime/plan/scripts/runtime/packages/protocol/package.json +6 -2
- package/lib/host-packages/openai/.claude-plugin/marketplace.json +2 -2
- package/lib/host-packages/openai/openplanr/.codex-plugin/plugin.json +1 -1
- package/lib/host-packages/openai/openplanr/.openplanr-content.json +20 -20
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/lib/artifact/ui/studio-shell.css +1 -1
- 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/enhancements.css +14 -4
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.css +14 -5
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/12-design-review-experience.js +28 -0
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/16-studio-shell.js +238 -68
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources.json +6 -6
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/package.json +6 -2
- 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 +1 -1
- package/lib/host-packages/openai/openplanr/skills/delegate/references/capsule-contract.md +1 -1
- package/lib/host-packages/openai/openplanr/skills/delegate/scripts/run-preparation.mjs +3 -3
- package/lib/host-packages/openai/openplanr/skills/design/references/utilities.md +1 -1
- package/lib/host-packages/openai/openplanr/skills/design-loop/references/utilities.md +1 -1
- package/lib/host-packages/openai/openplanr/skills/design-review/references/utilities.md +1 -1
- package/lib/host-packages/openai/openplanr/skills/doctor/SKILL.md +4 -1
- package/lib/host-packages/openai/openplanr/skills/doctor/references/upgrade.md +8 -0
- package/lib/host-packages/openai/openplanr/skills/plan/SKILL.md +2 -2
- package/lib/node-runtime.d.mts +1 -1
- package/lib/node-runtime.mjs +2 -7
- package/package.json +5 -6
- package/bin/planr.js +0 -7
|
@@ -24,7 +24,7 @@ import { classifyComponentDrift as classifyRuntimeComponentDrift, diagnoseManage
|
|
|
24
24
|
import { migrateLegacyGlobalRuntimeState, } from './runtime-manager/global-state.js';
|
|
25
25
|
import { inventoryManagedSkillFiles, planCodexUserBundleTransition, } from './runtime-manager/install-plan.js';
|
|
26
26
|
import { detectInstalledRuntimes, inspectRuntimeProjectContext, listInstalledRuntimeAdapters, planningFolderConflict, } from './runtime-manager/inventory.js';
|
|
27
|
-
import { inspectRuntimeLocator, inspectRuntimePackage, inspectThinRule, runtimeLocator, thinDiscoveryMetadata, thinSkillEntry, } from './runtime-manager/runtime-package.js';
|
|
27
|
+
import { caseVariantOf, describePackageDrift, inspectRuntimeLocator, inspectRuntimePackage, inspectThinRule, retainedPackageDrift, runtimeLocator, thinDiscoveryMetadata, thinSkillEntry, } from './runtime-manager/runtime-package.js';
|
|
28
28
|
export { classifyComponentDrift } from './runtime-manager/doctor.js';
|
|
29
29
|
const runtimeLockSchema = JSON.parse(readFileSync(new URL('../../lib/runtime-lock.schema.json', import.meta.url), 'utf8'));
|
|
30
30
|
// Setup and global help remain available when the optional pipeline package is absent.
|
|
@@ -663,13 +663,22 @@ function duplicateClaudePluginDiagnostic(inspection) {
|
|
|
663
663
|
.join(' && ')}`,
|
|
664
664
|
};
|
|
665
665
|
}
|
|
666
|
-
function bundledRuntimePackage(runtime
|
|
666
|
+
function bundledRuntimePackage(runtime) {
|
|
667
667
|
const host = runtime === 'claude-code' ? 'claude' : runtime === 'codex' ? 'openai' : 'cursor';
|
|
668
668
|
try {
|
|
669
|
-
return inspectRuntimePackage(path.join(bundledHostRoot(host), 'openplanr'), path.join(runtimeRoot(), 'packages'), host, readRegistry().pluginVersion,
|
|
669
|
+
return inspectRuntimePackage(path.join(bundledHostRoot(host), 'openplanr'), path.join(runtimeRoot(), 'packages'), host, readRegistry().pluginVersion, false);
|
|
670
670
|
}
|
|
671
671
|
catch (cause) {
|
|
672
|
-
throw new RuntimeManagerError('E_RUNTIME_PACKAGE_INVALID', `The exact ${runtime} runtime package could not be verified: ${cause instanceof Error ? cause.message : String(cause)}`, '
|
|
672
|
+
throw new RuntimeManagerError('E_RUNTIME_PACKAGE_INVALID', `The exact ${runtime} runtime package could not be verified: ${cause instanceof Error ? cause.message : String(cause)}`, 'Reinstall the OpenPlanr CLI or regenerate its host packages.');
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
/** Compares the retained copy of the bundled package with its reviewed bytes. */
|
|
676
|
+
function retainedRuntimePackageDrift(runtime, runtimePackage) {
|
|
677
|
+
try {
|
|
678
|
+
return retainedPackageDrift(runtimePackage);
|
|
679
|
+
}
|
|
680
|
+
catch (cause) {
|
|
681
|
+
throw new RuntimeManagerError('E_RUNTIME_PACKAGE_INVALID', `The ${runtime} runtime package ${runtimePackage.version} at ${runtimePackage.root} could not be inspected: ${cause instanceof Error ? cause.message : String(cause)}`, 'Remove the symbolic link or other unsupported entry it names, then rerun the command.');
|
|
673
682
|
}
|
|
674
683
|
}
|
|
675
684
|
function bundledSkillAssets(runtime, runtimePackage = bundledRuntimePackage(runtime)) {
|
|
@@ -826,7 +835,7 @@ function buildRuntimeLock(options, runtimes, runtimeScopes, registry, pipelineVe
|
|
|
826
835
|
}
|
|
827
836
|
return Buffer.from(`${JSON.stringify(lock, null, 2)}\n`);
|
|
828
837
|
}
|
|
829
|
-
function buildActions(options, runtimes, runtimeScopes, retainedProject) {
|
|
838
|
+
function buildActions(options, runtimes, runtimeScopes, retainedProject, packageRestores = []) {
|
|
830
839
|
if (options.minimal)
|
|
831
840
|
return [];
|
|
832
841
|
const { version, registry } = readRegistry();
|
|
@@ -850,8 +859,32 @@ function buildActions(options, runtimes, runtimeScopes, retainedProject) {
|
|
|
850
859
|
let skillAssets;
|
|
851
860
|
let runtimePackage;
|
|
852
861
|
try {
|
|
853
|
-
runtimePackage = bundledRuntimePackage(runtime
|
|
854
|
-
|
|
862
|
+
runtimePackage = bundledRuntimePackage(runtime);
|
|
863
|
+
skillAssets = bundledSkillAssets(runtime, runtimePackage);
|
|
864
|
+
}
|
|
865
|
+
catch (cause) {
|
|
866
|
+
throw new RuntimeManagerError('E_SKILL_DISTRIBUTION_INVALID', `The generated ${runtime} skill distribution is invalid: ${cause instanceof Error ? cause.message : String(cause)}`, 'Reinstall the OpenPlanr utility CLI or regenerate the host packages.');
|
|
867
|
+
}
|
|
868
|
+
if (usesThinEntries) {
|
|
869
|
+
const drift = retainedRuntimePackageDrift(runtime, runtimePackage);
|
|
870
|
+
if (drift.changed.length > 0 || drift.unexpected.length > 0) {
|
|
871
|
+
if (!options.restoreRuntimePackages) {
|
|
872
|
+
throw new RuntimeManagerError('E_RUNTIME_PACKAGE_CHANGED', `Files in the ${runtime} runtime package ${runtimePackage.version} were changed outside OpenPlanr: ${describePackageDrift(drift)}.`, `Run \`${CLI_COMMAND} doctor --fix\` to restore the package from this CLI; the changed files are backed up first.`);
|
|
873
|
+
}
|
|
874
|
+
// A restore never deletes a name that could open a packaged file.
|
|
875
|
+
const reviewed = runtimePackage.files.map((file) => file.relativePath);
|
|
876
|
+
const caseVariants = drift.unexpected.filter((file) => caseVariantOf(file, reviewed));
|
|
877
|
+
if (caseVariants.length > 0) {
|
|
878
|
+
throw new RuntimeManagerError('E_RUNTIME_PACKAGE_CHANGED', `Files in the ${runtime} runtime package ${runtimePackage.version} differ from packaged files only by letter case: ${caseVariants.join(', ')}.`, `OpenPlanr does not delete them. Remove them by hand, then rerun \`${CLI_COMMAND} doctor --fix\`.`);
|
|
879
|
+
}
|
|
880
|
+
packageRestores.push({
|
|
881
|
+
runtime,
|
|
882
|
+
version: runtimePackage.version,
|
|
883
|
+
root: runtimePackage.root,
|
|
884
|
+
...drift,
|
|
885
|
+
});
|
|
886
|
+
}
|
|
887
|
+
for (const file of runtimePackage.files) {
|
|
855
888
|
actions.push({
|
|
856
889
|
runtime: 'core',
|
|
857
890
|
scope: 'user',
|
|
@@ -862,10 +895,6 @@ function buildActions(options, runtimes, runtimeScopes, retainedProject) {
|
|
|
862
895
|
description: `Retain exact ${runtime} runtime package ${file.relativePath}`,
|
|
863
896
|
});
|
|
864
897
|
}
|
|
865
|
-
skillAssets = bundledSkillAssets(runtime, runtimePackage);
|
|
866
|
-
}
|
|
867
|
-
catch (cause) {
|
|
868
|
-
throw new RuntimeManagerError('E_SKILL_DISTRIBUTION_INVALID', `The generated ${runtime} skill distribution is invalid: ${cause instanceof Error ? cause.message : String(cause)}`, 'Reinstall the OpenPlanr utility CLI or regenerate the host packages.');
|
|
869
898
|
}
|
|
870
899
|
if (installUser) {
|
|
871
900
|
if (runtime === 'codex') {
|
|
@@ -1041,6 +1070,21 @@ function planRetiredCursorProjectRules(projectDir, runtimes, runtimeScopes) {
|
|
|
1041
1070
|
];
|
|
1042
1071
|
});
|
|
1043
1072
|
}
|
|
1073
|
+
/** Files added to a retained runtime package; a restore removes them after the backup. */
|
|
1074
|
+
function planPackageRetirements(restores) {
|
|
1075
|
+
return restores.flatMap((restore) => restore.unexpected.map((file) => {
|
|
1076
|
+
const target = path.join(restore.root, file);
|
|
1077
|
+
return {
|
|
1078
|
+
runtime: 'core',
|
|
1079
|
+
scope: 'user',
|
|
1080
|
+
target,
|
|
1081
|
+
content: readFileSync(target),
|
|
1082
|
+
kind: 'file',
|
|
1083
|
+
custody: 'runtime-package',
|
|
1084
|
+
description: `Remove ${file}, which was added to the exact ${restore.runtime} runtime package`,
|
|
1085
|
+
};
|
|
1086
|
+
}));
|
|
1087
|
+
}
|
|
1044
1088
|
function inventoryRegularFiles(root) {
|
|
1045
1089
|
return inventoryManagedSkillFiles(root, (message, recovery) => {
|
|
1046
1090
|
throw new RuntimeManagerError('E_MIGRATION_CONFLICT', message, recovery);
|
|
@@ -1407,8 +1451,10 @@ export async function previewSetup(options) {
|
|
|
1407
1451
|
const retainedProject = options.preserveExistingScopes
|
|
1408
1452
|
? (await loadState()).projects[projectKey(options.projectDir)]
|
|
1409
1453
|
: undefined;
|
|
1410
|
-
const
|
|
1411
|
-
|
|
1454
|
+
const packageRestores = [];
|
|
1455
|
+
const actions = buildActions(options, runtimes, runtimeScopes, retainedProject, packageRestores);
|
|
1456
|
+
const packageRetirements = planPackageRetirements(packageRestores);
|
|
1457
|
+
assertActionCustody([...actions, ...packageRetirements], options.projectDir);
|
|
1412
1458
|
const scopeRetirements = planScopeRetirements(options, (await loadState()).projects[projectKey(options.projectDir)], runtimes, actions);
|
|
1413
1459
|
const retiredProjectRules = planRetiredCursorProjectRules(options.projectDir, runtimes, runtimeScopes);
|
|
1414
1460
|
const needsTransitionState = runtimes.includes('codex') ||
|
|
@@ -1556,6 +1602,13 @@ export async function previewSetup(options) {
|
|
|
1556
1602
|
operation: operationFor(action),
|
|
1557
1603
|
description: action.description,
|
|
1558
1604
|
})),
|
|
1605
|
+
...packageRetirements.map((action) => ({
|
|
1606
|
+
runtime: action.runtime,
|
|
1607
|
+
scope: action.scope,
|
|
1608
|
+
target: action.target,
|
|
1609
|
+
operation: 'retire',
|
|
1610
|
+
description: action.description,
|
|
1611
|
+
})),
|
|
1559
1612
|
...retiredProjectRules.map((action) => ({
|
|
1560
1613
|
runtime: action.runtime,
|
|
1561
1614
|
scope: action.scope,
|
|
@@ -1585,6 +1638,7 @@ export async function previewSetup(options) {
|
|
|
1585
1638
|
...(codexInspection?.operations ?? []),
|
|
1586
1639
|
],
|
|
1587
1640
|
runtimeDiagnostics,
|
|
1641
|
+
...(packageRestores.length > 0 ? { runtimePackageRestores: packageRestores } : {}),
|
|
1588
1642
|
};
|
|
1589
1643
|
}
|
|
1590
1644
|
export async function applySetup(options) {
|
|
@@ -1621,8 +1675,11 @@ export async function applySetup(options) {
|
|
|
1621
1675
|
const retainedProject = options.preserveExistingScopes
|
|
1622
1676
|
? state.projects[projectKey(options.projectDir)]
|
|
1623
1677
|
: undefined;
|
|
1624
|
-
const
|
|
1625
|
-
|
|
1678
|
+
const packageRestores = [];
|
|
1679
|
+
const actions = buildActions(options, preview.runtimes, preview.runtimeScopes, retainedProject, packageRestores);
|
|
1680
|
+
const packageRetirements = planPackageRetirements(packageRestores);
|
|
1681
|
+
assertActionCustody([...actions, ...packageRetirements], options.projectDir);
|
|
1682
|
+
const restoredPackageTargets = new Set(packageRestores.flatMap((restore) => restore.changed.map((file) => path.join(restore.root, file))));
|
|
1626
1683
|
const scopeRetirements = planScopeRetirements(options, state.projects[projectKey(options.projectDir)], preview.runtimes, actions);
|
|
1627
1684
|
const retiredProjectRules = planRetiredCursorProjectRules(options.projectDir, preview.runtimes, preview.runtimeScopes);
|
|
1628
1685
|
const previousCodexMode = state.userBundles?.codex?.installMode ??
|
|
@@ -1672,6 +1729,7 @@ export async function applySetup(options) {
|
|
|
1672
1729
|
...changed,
|
|
1673
1730
|
...retirementActions,
|
|
1674
1731
|
...retiredProjectRules,
|
|
1732
|
+
...packageRetirements,
|
|
1675
1733
|
...scopeRetirements,
|
|
1676
1734
|
stateAction,
|
|
1677
1735
|
].filter((action, index, list) => list.findIndex((candidate) => candidate.target === action.target) === index);
|
|
@@ -1697,6 +1755,7 @@ export async function applySetup(options) {
|
|
|
1697
1755
|
verifyCurrent();
|
|
1698
1756
|
const content = actionBytes(action);
|
|
1699
1757
|
if (action.custody === 'runtime-package' &&
|
|
1758
|
+
!restoredPackageTargets.has(action.target) &&
|
|
1700
1759
|
existsSync(action.target) &&
|
|
1701
1760
|
!readFileSync(action.target).equals(content)) {
|
|
1702
1761
|
throw new RuntimeManagerError('E_MIGRATION_CONFLICT', `Immutable runtime bytes changed during setup: ${action.target}.`, 'Preserve the changed cache; rerun with the reviewed package after resolving its custody.');
|
|
@@ -1771,6 +1830,19 @@ export async function applySetup(options) {
|
|
|
1771
1830
|
await unlink(retired.target);
|
|
1772
1831
|
retiredTargets.add(retired.target);
|
|
1773
1832
|
}
|
|
1833
|
+
for (const retired of packageRetirements) {
|
|
1834
|
+
assertMutableOwnedTarget(retired.target, options.projectDir, 'E_MIGRATION_CONFLICT');
|
|
1835
|
+
if (!existsSync(retired.target))
|
|
1836
|
+
continue;
|
|
1837
|
+
const metadata = lstatSync(retired.target);
|
|
1838
|
+
if (metadata.isSymbolicLink() ||
|
|
1839
|
+
!metadata.isFile() ||
|
|
1840
|
+
hash(readFileSync(retired.target)) !== hash(retired.content)) {
|
|
1841
|
+
throw new RuntimeManagerError('E_MIGRATION_CONFLICT', `Runtime package bytes changed during setup: ${retired.target}.`, 'The concurrent edit was preserved; inspect it before rerunning setup.');
|
|
1842
|
+
}
|
|
1843
|
+
await unlink(retired.target);
|
|
1844
|
+
retiredTargets.add(retired.target);
|
|
1845
|
+
}
|
|
1774
1846
|
const updatedAt = new Date().toISOString();
|
|
1775
1847
|
state.schemaVersion = '2.0.0';
|
|
1776
1848
|
state.userBundles ??= {};
|
|
@@ -2526,7 +2598,7 @@ export async function runtimeDoctor(projectDir, options = {}) {
|
|
|
2526
2598
|
: 'Pinned runtime packages match their complete content inventories',
|
|
2527
2599
|
...(closureFailures.length
|
|
2528
2600
|
? {
|
|
2529
|
-
fix: `Run \`${CLI_COMMAND} doctor --fix\` to preview
|
|
2601
|
+
fix: `Run \`${CLI_COMMAND} doctor --fix\` to preview the repair; changed package files are backed up before anything is replaced.`,
|
|
2530
2602
|
}
|
|
2531
2603
|
: {}),
|
|
2532
2604
|
});
|