@codyswann/lisa 7.1.5 → 8.0.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/all/copy-overwrite/scripts/check-npm-publish-landed.mjs +0 -2
- package/all/copy-overwrite/scripts/lib/push-timing.mjs +3 -6
- package/all/copy-overwrite/scripts/lisa-enforcement-fallback.sh +31 -32
- package/all/copy-overwrite/scripts/lisa-hooks/block-managed-file-edits.sh +201 -20
- package/all/copy-overwrite/scripts/npm-updater-helper-graph.json +3 -2
- package/dist/cli/admit-cmd.d.ts.map +1 -1
- package/dist/cli/admit-cmd.js +16 -10
- package/dist/cli/admit-cmd.js.map +1 -1
- package/dist/cli/apply.d.ts.map +1 -1
- package/dist/cli/apply.js +2 -2
- package/dist/cli/apply.js.map +1 -1
- package/dist/cli/check-cmd.d.ts.map +1 -1
- package/dist/cli/check-cmd.js +8 -4
- package/dist/cli/check-cmd.js.map +1 -1
- package/dist/cli/doctor-coderabbit.js +2 -2
- package/dist/cli/doctor-coderabbit.js.map +1 -1
- package/dist/cli/doctor-readiness-supply-chain-python.d.ts +5 -1
- package/dist/cli/doctor-readiness-supply-chain-python.d.ts.map +1 -1
- package/dist/cli/doctor-readiness-supply-chain-python.js +44 -10
- package/dist/cli/doctor-readiness-supply-chain-python.js.map +1 -1
- package/dist/cli/doctor-readiness.js +2 -2
- package/dist/cli/doctor-readiness.js.map +1 -1
- package/dist/cli/doctor-worker-journey.js +2 -2
- package/dist/cli/doctor-worker-journey.js.map +1 -1
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +7 -4
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/file-upstream-cmd.d.ts.map +1 -1
- package/dist/cli/file-upstream-cmd.js +20 -25
- package/dist/cli/file-upstream-cmd.js.map +1 -1
- package/dist/cli/gh-cli.d.ts +2 -2
- package/dist/cli/gh-cli.d.ts.map +1 -1
- package/dist/cli/gh-cli.js +13 -6
- package/dist/cli/gh-cli.js.map +1 -1
- package/dist/cli/health-cmd.d.ts.map +1 -1
- package/dist/cli/health-cmd.js +7 -19
- package/dist/cli/health-cmd.js.map +1 -1
- package/dist/cli/lisa-test-run-jest-merge.js +5 -5
- package/dist/cli/lisa-test-run-jest-merge.js.map +1 -1
- package/dist/cli/lisa-test-run.js +8 -4
- package/dist/cli/lisa-test-run.js.map +1 -1
- package/dist/cli/pr-landing.js +2 -2
- package/dist/cli/pr-landing.js.map +1 -1
- package/dist/cli/update-check.d.ts.map +1 -1
- package/dist/cli/update-check.js +7 -4
- package/dist/cli/update-check.js.map +1 -1
- package/dist/cli/update-cmd.d.ts.map +1 -1
- package/dist/cli/update-cmd.js +7 -4
- package/dist/cli/update-cmd.js.map +1 -1
- package/dist/cli/worktree-ownership.d.ts.map +1 -1
- package/dist/cli/worktree-ownership.js +3 -3
- package/dist/cli/worktree-ownership.js.map +1 -1
- package/dist/codex/hooks-catalog.d.ts +151 -0
- package/dist/codex/hooks-catalog.d.ts.map +1 -0
- package/dist/codex/hooks-catalog.js +315 -0
- package/dist/codex/hooks-catalog.js.map +1 -0
- package/dist/codex/hooks-compatibility.d.ts +14 -0
- package/dist/codex/hooks-compatibility.d.ts.map +1 -0
- package/dist/codex/hooks-compatibility.js +196 -0
- package/dist/codex/hooks-compatibility.js.map +1 -0
- package/dist/codex/hooks-installer.d.ts +2 -49
- package/dist/codex/hooks-installer.d.ts.map +1 -1
- package/dist/codex/hooks-installer.js +5 -546
- package/dist/codex/hooks-installer.js.map +1 -1
- package/dist/codex/hooks-source-links.d.ts +11 -0
- package/dist/codex/hooks-source-links.d.ts.map +1 -0
- package/dist/codex/hooks-source-links.js +74 -0
- package/dist/codex/hooks-source-links.js.map +1 -0
- package/dist/codex/scripts/block-migration-edits.sh +2 -2
- package/dist/codex/scripts/block-suppress-directives.sh +3 -3
- package/dist/codex/scripts/format-on-edit.sh +2 -2
- package/dist/codex/scripts/lint-on-edit.sh +2 -2
- package/dist/codex/scripts/lisa-edit-gate.sh +19 -15
- package/dist/codex/scripts/rubocop-on-edit.sh +2 -2
- package/dist/codex/scripts/sg-scan-on-edit.sh +2 -2
- package/dist/configs/coverage-scope.d.ts +0 -23
- package/dist/configs/coverage-scope.d.ts.map +1 -1
- package/dist/configs/coverage-scope.js +2 -3
- package/dist/configs/coverage-scope.js.map +1 -1
- package/dist/configs/eslint/base.d.ts +2 -113
- package/dist/configs/eslint/base.d.ts.map +1 -1
- package/dist/configs/eslint/base.js +2 -165
- package/dist/configs/eslint/base.js.map +1 -1
- package/dist/configs/eslint/cdk.d.ts.map +1 -1
- package/dist/configs/eslint/cdk.js +82 -66
- package/dist/configs/eslint/cdk.js.map +1 -1
- package/dist/configs/eslint/expo-overrides.d.ts +103 -0
- package/dist/configs/eslint/expo-overrides.d.ts.map +1 -0
- package/dist/configs/eslint/expo-overrides.js +187 -0
- package/dist/configs/eslint/expo-overrides.js.map +1 -0
- package/dist/configs/eslint/expo.d.ts +2 -7
- package/dist/configs/eslint/expo.d.ts.map +1 -1
- package/dist/configs/eslint/expo.js +186 -258
- package/dist/configs/eslint/expo.js.map +1 -1
- package/dist/configs/eslint/nestjs.d.ts.map +1 -1
- package/dist/configs/eslint/nestjs.js +86 -70
- package/dist/configs/eslint/nestjs.js.map +1 -1
- package/dist/configs/eslint/process-environment-bans.d.ts +41 -0
- package/dist/configs/eslint/process-environment-bans.d.ts.map +1 -0
- package/dist/configs/eslint/process-environment-bans.js +50 -0
- package/dist/configs/eslint/process-environment-bans.js.map +1 -0
- package/dist/configs/eslint/shared-rules.d.ts +130 -0
- package/dist/configs/eslint/shared-rules.d.ts.map +1 -0
- package/dist/configs/eslint/shared-rules.js +233 -0
- package/dist/configs/eslint/shared-rules.js.map +1 -0
- package/dist/configs/eslint/typescript.d.ts.map +1 -1
- package/dist/configs/eslint/typescript.js +2 -4
- package/dist/configs/eslint/typescript.js.map +1 -1
- package/dist/configs/vitest/base.d.ts +2 -2
- package/dist/configs/vitest/base.d.ts.map +1 -1
- package/dist/configs/vitest/base.js +5 -5
- package/dist/configs/vitest/base.js.map +1 -1
- package/dist/configs/vitest/coverage-reports-directory.d.ts.map +1 -1
- package/dist/configs/vitest/coverage-reports-directory.js +3 -2
- package/dist/configs/vitest/coverage-reports-directory.js.map +1 -1
- package/dist/configs/vitest/refusal-announcement.js +2 -2
- package/dist/configs/vitest/refusal-announcement.js.map +1 -1
- package/dist/core/admission-lock.js +2 -3
- package/dist/core/admission-lock.js.map +1 -1
- package/dist/core/admission-state.d.ts.map +1 -1
- package/dist/core/admission-state.js +11 -5
- package/dist/core/admission-state.js.map +1 -1
- package/dist/core/admission.d.ts.map +1 -1
- package/dist/core/admission.js +2 -2
- package/dist/core/admission.js.map +1 -1
- package/dist/core/bootstrap-environment.d.ts.map +1 -1
- package/dist/core/bootstrap-environment.js +8 -5
- package/dist/core/bootstrap-environment.js.map +1 -1
- package/dist/core/downstream-names.d.ts.map +1 -1
- package/dist/core/downstream-names.js +48 -47
- package/dist/core/downstream-names.js.map +1 -1
- package/dist/core/effectiveness-store.d.ts.map +1 -1
- package/dist/core/effectiveness-store.js +3 -5
- package/dist/core/effectiveness-store.js.map +1 -1
- package/dist/core/gate-declaration-drift.d.ts.map +1 -1
- package/dist/core/gate-declaration-drift.js +46 -27
- package/dist/core/gate-declaration-drift.js.map +1 -1
- package/dist/core/kane-cli-process.d.ts.map +1 -1
- package/dist/core/kane-cli-process.js +46 -33
- package/dist/core/kane-cli-process.js.map +1 -1
- package/dist/core/kane-cli.d.ts.map +1 -1
- package/dist/core/kane-cli.js +3 -4
- package/dist/core/kane-cli.js.map +1 -1
- package/dist/core/lisa-agent-emit-extra.d.ts +75 -0
- package/dist/core/lisa-agent-emit-extra.d.ts.map +1 -0
- package/dist/core/lisa-agent-emit-extra.js +231 -0
- package/dist/core/lisa-agent-emit-extra.js.map +1 -0
- package/dist/core/lisa-agent-emit.d.ts +79 -0
- package/dist/core/lisa-agent-emit.d.ts.map +1 -0
- package/dist/core/lisa-agent-emit.js +224 -0
- package/dist/core/lisa-agent-emit.js.map +1 -0
- package/dist/core/lisa-deletions.d.ts +116 -0
- package/dist/core/lisa-deletions.d.ts.map +1 -0
- package/dist/core/lisa-deletions.js +316 -0
- package/dist/core/lisa-deletions.js.map +1 -0
- package/dist/core/lisa-file-results.d.ts +58 -0
- package/dist/core/lisa-file-results.d.ts.map +1 -0
- package/dist/core/lisa-file-results.js +173 -0
- package/dist/core/lisa-file-results.js.map +1 -0
- package/dist/core/lisa-maintenance.d.ts +139 -0
- package/dist/core/lisa-maintenance.d.ts.map +1 -0
- package/dist/core/lisa-maintenance.js +324 -0
- package/dist/core/lisa-maintenance.js.map +1 -0
- package/dist/core/lisa-owned-hash-ledger.d.ts +7 -5
- package/dist/core/lisa-owned-hash-ledger.d.ts.map +1 -1
- package/dist/core/lisa-owned-hash-ledger.js +44 -6036
- package/dist/core/lisa-owned-hash-ledger.js.map +1 -1
- package/dist/core/lisa-owned-hash-ledger.json +6021 -0
- package/dist/core/lisa-plugin-sync.d.ts +96 -0
- package/dist/core/lisa-plugin-sync.d.ts.map +1 -0
- package/dist/core/lisa-plugin-sync.js +216 -0
- package/dist/core/lisa-plugin-sync.js.map +1 -0
- package/dist/core/lisa-plugins.d.ts +42 -0
- package/dist/core/lisa-plugins.d.ts.map +1 -0
- package/dist/core/lisa-plugins.js +155 -0
- package/dist/core/lisa-plugins.js.map +1 -0
- package/dist/core/lisa-state.d.ts +202 -0
- package/dist/core/lisa-state.d.ts.map +1 -0
- package/dist/core/lisa-state.js +205 -0
- package/dist/core/lisa-state.js.map +1 -0
- package/dist/core/lisa-summary-stats.d.ts +74 -0
- package/dist/core/lisa-summary-stats.d.ts.map +1 -0
- package/dist/core/lisa-summary-stats.js +189 -0
- package/dist/core/lisa-summary-stats.js.map +1 -0
- package/dist/core/lisa-summary.d.ts +34 -0
- package/dist/core/lisa-summary.d.ts.map +1 -0
- package/dist/core/lisa-summary.js +144 -0
- package/dist/core/lisa-summary.js.map +1 -0
- package/dist/core/lisa-templates.d.ts +98 -0
- package/dist/core/lisa-templates.d.ts.map +1 -0
- package/dist/core/lisa-templates.js +251 -0
- package/dist/core/lisa-templates.js.map +1 -0
- package/dist/core/lisa.d.ts +14 -903
- package/dist/core/lisa.d.ts.map +1 -1
- package/dist/core/lisa.js +30 -2275
- package/dist/core/lisa.js.map +1 -1
- package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
- package/dist/core/plugin-command.d.ts.map +1 -1
- package/dist/core/plugin-command.js +117 -61
- package/dist/core/plugin-command.js.map +1 -1
- package/dist/core/template-ownership.d.ts.map +1 -1
- package/dist/core/template-ownership.js +0 -1
- package/dist/core/template-ownership.js.map +1 -1
- package/dist/core/upstream-attribution-body.d.ts +4 -11
- package/dist/core/upstream-attribution-body.d.ts.map +1 -1
- package/dist/core/upstream-attribution-body.js +61 -373
- package/dist/core/upstream-attribution-body.js.map +1 -1
- package/dist/core/upstream-attribution-fields.d.ts +40 -0
- package/dist/core/upstream-attribution-fields.d.ts.map +1 -0
- package/dist/core/upstream-attribution-fields.js +167 -0
- package/dist/core/upstream-attribution-fields.js.map +1 -0
- package/dist/core/upstream-attribution-files.d.ts +15 -0
- package/dist/core/upstream-attribution-files.d.ts.map +1 -0
- package/dist/core/upstream-attribution-files.js +156 -0
- package/dist/core/upstream-attribution-files.js.map +1 -0
- package/dist/core/upstream-attribution-guards.d.ts +80 -0
- package/dist/core/upstream-attribution-guards.d.ts.map +1 -0
- package/dist/core/upstream-attribution-guards.js +284 -0
- package/dist/core/upstream-attribution-guards.js.map +1 -0
- package/dist/core/upstream-evidence-manifest.d.ts +1 -1
- package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
- package/dist/core/upstream-evidence-manifest.js +67 -30435
- package/dist/core/upstream-evidence-manifest.js.map +1 -1
- package/dist/core/upstream-evidence-manifest.json +30518 -0
- package/dist/health/agentic-contract.d.ts +94 -0
- package/dist/health/agentic-contract.d.ts.map +1 -0
- package/dist/health/agentic-contract.js +2 -0
- package/dist/health/agentic-contract.js.map +1 -0
- package/dist/health/agentic-evidence.d.ts +16 -0
- package/dist/health/agentic-evidence.d.ts.map +1 -0
- package/dist/health/agentic-evidence.js +213 -0
- package/dist/health/agentic-evidence.js.map +1 -0
- package/dist/health/agentic.d.ts +11 -74
- package/dist/health/agentic.d.ts.map +1 -1
- package/dist/health/agentic.js +42 -216
- package/dist/health/agentic.js.map +1 -1
- package/dist/health/deadline.d.ts +4 -1
- package/dist/health/deadline.d.ts.map +1 -1
- package/dist/health/deadline.js +4 -3
- package/dist/health/deadline.js.map +1 -1
- package/dist/health/deterministic-inputs.d.ts.map +1 -1
- package/dist/health/deterministic-inputs.js +3 -11
- package/dist/health/deterministic-inputs.js.map +1 -1
- package/dist/health/deterministic-probes.d.ts +52 -0
- package/dist/health/deterministic-probes.d.ts.map +1 -0
- package/dist/health/deterministic-probes.js +142 -0
- package/dist/health/deterministic-probes.js.map +1 -0
- package/dist/health/deterministic.d.ts +2 -25
- package/dist/health/deterministic.d.ts.map +1 -1
- package/dist/health/deterministic.js +14 -106
- package/dist/health/deterministic.js.map +1 -1
- package/dist/health/finding-utils.d.ts +4 -3
- package/dist/health/finding-utils.d.ts.map +1 -1
- package/dist/health/finding-utils.js +4 -4
- package/dist/health/finding-utils.js.map +1 -1
- package/dist/health/governance-probes.d.ts +29 -24
- package/dist/health/governance-probes.d.ts.map +1 -1
- package/dist/health/governance-probes.js +29 -25
- package/dist/health/governance-probes.js.map +1 -1
- package/dist/health/hook-inspection.d.ts +4 -3
- package/dist/health/hook-inspection.d.ts.map +1 -1
- package/dist/health/hook-inspection.js +17 -11
- package/dist/health/hook-inspection.js.map +1 -1
- package/dist/health/plugin-inspection.d.ts +6 -4
- package/dist/health/plugin-inspection.d.ts.map +1 -1
- package/dist/health/plugin-inspection.js +10 -9
- package/dist/health/plugin-inspection.js.map +1 -1
- package/dist/health/prepare.js +24 -8
- package/dist/health/prepare.js.map +1 -1
- package/dist/health/project-probes.d.ts +14 -7
- package/dist/health/project-probes.d.ts.map +1 -1
- package/dist/health/project-probes.js +14 -9
- package/dist/health/project-probes.js.map +1 -1
- package/dist/health/ruleset-compare.d.ts +30 -0
- package/dist/health/ruleset-compare.d.ts.map +1 -0
- package/dist/health/ruleset-compare.js +143 -0
- package/dist/health/ruleset-compare.js.map +1 -0
- package/dist/health/ruleset-config-checks.d.ts +66 -0
- package/dist/health/ruleset-config-checks.d.ts.map +1 -0
- package/dist/health/ruleset-config-checks.js +190 -0
- package/dist/health/ruleset-config-checks.js.map +1 -0
- package/dist/health/ruleset-expected.d.ts +39 -0
- package/dist/health/ruleset-expected.d.ts.map +1 -0
- package/dist/health/ruleset-expected.js +181 -0
- package/dist/health/ruleset-expected.js.map +1 -0
- package/dist/health/ruleset-gh.d.ts +85 -0
- package/dist/health/ruleset-gh.d.ts.map +1 -0
- package/dist/health/ruleset-gh.js +177 -0
- package/dist/health/ruleset-gh.js.map +1 -0
- package/dist/health/ruleset-inspection.d.ts +13 -117
- package/dist/health/ruleset-inspection.d.ts.map +1 -1
- package/dist/health/ruleset-inspection.js +8 -738
- package/dist/health/ruleset-inspection.js.map +1 -1
- package/dist/health/ruleset-normalize.d.ts +32 -0
- package/dist/health/ruleset-normalize.d.ts.map +1 -0
- package/dist/health/ruleset-normalize.js +160 -0
- package/dist/health/ruleset-normalize.js.map +1 -0
- package/dist/health/template-compose.d.ts +9 -0
- package/dist/health/template-compose.d.ts.map +1 -0
- package/dist/health/template-compose.js +105 -0
- package/dist/health/template-compose.js.map +1 -0
- package/dist/health/template-inspection.d.ts +5 -52
- package/dist/health/template-inspection.d.ts.map +1 -1
- package/dist/health/template-inspection.js +13 -435
- package/dist/health/template-inspection.js.map +1 -1
- package/dist/health/template-plan.d.ts +33 -0
- package/dist/health/template-plan.d.ts.map +1 -0
- package/dist/health/template-plan.js +154 -0
- package/dist/health/template-plan.js.map +1 -0
- package/dist/health/template-shape.d.ts +19 -0
- package/dist/health/template-shape.d.ts.map +1 -0
- package/dist/health/template-shape.js +122 -0
- package/dist/health/template-shape.js.map +1 -0
- package/dist/health/workflow-excerpt.d.ts +15 -0
- package/dist/health/workflow-excerpt.d.ts.map +1 -0
- package/dist/health/workflow-excerpt.js +88 -0
- package/dist/health/workflow-excerpt.js.map +1 -0
- package/dist/health/workflow-inputs-inspection.d.ts +16 -0
- package/dist/health/workflow-inputs-inspection.d.ts.map +1 -0
- package/dist/health/workflow-inputs-inspection.js +116 -0
- package/dist/health/workflow-inputs-inspection.js.map +1 -0
- package/dist/opencode/plugin-templates/block-managed-file-edits.sh +201 -20
- package/dist/standards/capture.d.ts.map +1 -1
- package/dist/standards/capture.js +73 -25
- package/dist/standards/capture.js.map +1 -1
- package/dist/standards/contract.d.ts.map +1 -1
- package/dist/standards/contract.js +26 -9
- package/dist/standards/contract.js.map +1 -1
- package/dist/standards/git-state.d.ts.map +1 -1
- package/dist/standards/git-state.js +2 -2
- package/dist/standards/git-state.js.map +1 -1
- package/dist/standards/registry-checks.d.ts +34 -0
- package/dist/standards/registry-checks.d.ts.map +1 -0
- package/dist/standards/registry-checks.js +137 -0
- package/dist/standards/registry-checks.js.map +1 -0
- package/dist/standards/registry.d.ts +3 -13
- package/dist/standards/registry.d.ts.map +1 -1
- package/dist/standards/registry.js +105 -194
- package/dist/standards/registry.js.map +1 -1
- package/dist/standards/storage.js +8 -10
- package/dist/standards/storage.js.map +1 -1
- package/dist/strategies/deduplicate-arrays.d.ts +18 -0
- package/dist/strategies/deduplicate-arrays.d.ts.map +1 -0
- package/dist/strategies/deduplicate-arrays.js +25 -0
- package/dist/strategies/deduplicate-arrays.js.map +1 -0
- package/dist/strategies/package-lisa-detect.d.ts +10 -0
- package/dist/strategies/package-lisa-detect.d.ts.map +1 -0
- package/dist/strategies/package-lisa-detect.js +178 -0
- package/dist/strategies/package-lisa-detect.js.map +1 -0
- package/dist/strategies/package-lisa-direct-floors.d.ts +16 -0
- package/dist/strategies/package-lisa-direct-floors.d.ts.map +1 -0
- package/dist/strategies/package-lisa-direct-floors.js +37 -0
- package/dist/strategies/package-lisa-direct-floors.js.map +1 -0
- package/dist/strategies/package-lisa-host-pins.d.ts +43 -0
- package/dist/strategies/package-lisa-host-pins.d.ts.map +1 -0
- package/dist/strategies/package-lisa-host-pins.js +254 -0
- package/dist/strategies/package-lisa-host-pins.js.map +1 -0
- package/dist/strategies/package-lisa-manifest-guards.d.ts +59 -0
- package/dist/strategies/package-lisa-manifest-guards.d.ts.map +1 -0
- package/dist/strategies/package-lisa-manifest-guards.js +234 -0
- package/dist/strategies/package-lisa-manifest-guards.js.map +1 -0
- package/dist/strategies/package-lisa-pin-alignment.d.ts +34 -0
- package/dist/strategies/package-lisa-pin-alignment.d.ts.map +1 -0
- package/dist/strategies/package-lisa-pin-alignment.js +106 -0
- package/dist/strategies/package-lisa-pin-alignment.js.map +1 -0
- package/dist/strategies/package-lisa-script-notes.d.ts +19 -0
- package/dist/strategies/package-lisa-script-notes.d.ts.map +1 -0
- package/dist/strategies/package-lisa-script-notes.js +145 -0
- package/dist/strategies/package-lisa-script-notes.js.map +1 -0
- package/dist/strategies/package-lisa-template-apply.d.ts +53 -0
- package/dist/strategies/package-lisa-template-apply.d.ts.map +1 -0
- package/dist/strategies/package-lisa-template-apply.js +216 -0
- package/dist/strategies/package-lisa-template-apply.js.map +1 -0
- package/dist/strategies/package-lisa-template-merge.d.ts +42 -0
- package/dist/strategies/package-lisa-template-merge.d.ts.map +1 -0
- package/dist/strategies/package-lisa-template-merge.js +202 -0
- package/dist/strategies/package-lisa-template-merge.js.map +1 -0
- package/dist/strategies/package-lisa-types.d.ts +5 -0
- package/dist/strategies/package-lisa-types.d.ts.map +1 -1
- package/dist/strategies/package-lisa.d.ts +1 -195
- package/dist/strategies/package-lisa.d.ts.map +1 -1
- package/dist/strategies/package-lisa.js +27 -1333
- package/dist/strategies/package-lisa.js.map +1 -1
- package/dist/strategies/tagged-merge-sections.d.ts +68 -0
- package/dist/strategies/tagged-merge-sections.d.ts.map +1 -0
- package/dist/strategies/tagged-merge-sections.js +113 -0
- package/dist/strategies/tagged-merge-sections.js.map +1 -0
- package/dist/strategies/tagged-merge.d.ts +1 -90
- package/dist/strategies/tagged-merge.d.ts.map +1 -1
- package/dist/strategies/tagged-merge.js +19 -190
- package/dist/strategies/tagged-merge.js.map +1 -1
- package/dist/utils/bounded-stream.d.ts +30 -0
- package/dist/utils/bounded-stream.d.ts.map +1 -0
- package/dist/utils/bounded-stream.js +63 -0
- package/dist/utils/bounded-stream.js.map +1 -0
- package/dist/utils/fibonacci.d.ts +3 -3
- package/dist/utils/fibonacci.d.ts.map +1 -1
- package/dist/utils/fibonacci.js +48 -10
- package/dist/utils/fibonacci.js.map +1 -1
- package/dist/utils/memo.d.ts +25 -0
- package/dist/utils/memo.d.ts.map +1 -0
- package/dist/utils/memo.js +32 -0
- package/dist/utils/memo.js.map +1 -0
- package/dist/utils/postinstall-trampoline.d.ts.map +1 -1
- package/dist/utils/postinstall-trampoline.js +3 -20
- package/dist/utils/postinstall-trampoline.js.map +1 -1
- package/dist/utils/process-environment.d.ts +42 -0
- package/dist/utils/process-environment.d.ts.map +1 -0
- package/dist/utils/process-environment.js +52 -0
- package/dist/utils/process-environment.js.map +1 -0
- package/dist/utils/resolve-executable.d.ts +89 -0
- package/dist/utils/resolve-executable.d.ts.map +1 -0
- package/dist/utils/resolve-executable.js +224 -0
- package/dist/utils/resolve-executable.js.map +1 -0
- package/dist/utils/shell-command-line.d.ts +9 -0
- package/dist/utils/shell-command-line.d.ts.map +1 -0
- package/dist/utils/shell-command-line.js +43 -0
- package/dist/utils/shell-command-line.js.map +1 -0
- package/dist/utils/usage-accounting-totals.d.ts +19 -0
- package/dist/utils/usage-accounting-totals.d.ts.map +1 -0
- package/dist/utils/usage-accounting-totals.js +145 -0
- package/dist/utils/usage-accounting-totals.js.map +1 -0
- package/dist/utils/usage-accounting.d.ts +2 -14
- package/dist/utils/usage-accounting.d.ts.map +1 -1
- package/dist/utils/usage-accounting.js +2 -169
- package/dist/utils/usage-accounting.js.map +1 -1
- package/eslint-plugin-code-organization/__tests__/enforce-statement-order-react-violations.test.js +213 -0
- package/eslint-plugin-code-organization/__tests__/enforce-statement-order-valid.test.js +251 -0
- package/eslint-plugin-code-organization/__tests__/enforce-statement-order-violations.test.js +222 -0
- package/eslint-plugin-code-organization/__tests__/statement-order-tester.js +42 -0
- package/eslint-plugin-code-organization/rules/enforce-statement-order.js +6 -8
- package/expo/copy-overwrite/jest.setup.ts +11 -10
- package/expo/create-only/scripts/zap-baseline.sh +6 -18
- package/harper-fabric/create-only/scripts/zap-baseline.sh +7 -9
- package/nestjs/create-only/scripts/zap-baseline.sh +6 -7
- package/package.json +4 -4
- package/phaser/copy-overwrite/.husky/pre-push.verify +2 -0
- package/plugins/lisa/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/skills/lisa-setup-remote-env/assets/session-start.sh +18 -5
- package/plugins/lisa/hooks/block-managed-file-edits.sh +201 -20
- package/plugins/lisa/hooks/block-masked-exit-status.sh +1 -1
- package/plugins/lisa/hooks/block-no-verify.agy.sh +1 -1
- package/plugins/lisa/hooks/enforce-verification-gate.sh +1 -2
- package/plugins/lisa/hooks/ticket-sync-reminder.sh +2 -17
- package/plugins/lisa/hooks/track-plan-sessions.sh +7 -131
- package/plugins/lisa/scripts/remote-agent-aws-setup.sh +3 -1
- package/plugins/lisa/skills/lisa-setup-remote-env/assets/session-start.sh +18 -5
- package/plugins/lisa-agy/hooks/block-managed-file-edits.sh +201 -20
- package/plugins/lisa-agy/hooks/block-no-verify.agy.sh +1 -1
- package/plugins/lisa-agy/plugin.json +1 -1
- package/plugins/lisa-agy/scripts/remote-agent-aws-setup.sh +3 -1
- package/plugins/lisa-agy/skills/lisa-setup-remote-env/assets/session-start.sh +18 -5
- package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-agy/plugin.json +1 -1
- package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/hooks/block-managed-file-edits.sh +201 -20
- package/plugins/lisa-copilot/hooks/block-masked-exit-status.sh +1 -1
- package/plugins/lisa-copilot/hooks/enforce-verification-gate.sh +1 -2
- package/plugins/lisa-copilot/scripts/remote-agent-aws-setup.sh +3 -1
- package/plugins/lisa-copilot/skills/lisa-setup-remote-env/assets/session-start.sh +18 -5
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/hooks/block-managed-file-edits.sh +201 -20
- package/plugins/lisa-cursor/hooks/block-masked-exit-status.sh +1 -1
- package/plugins/lisa-cursor/hooks/enforce-verification-gate.sh +1 -2
- package/plugins/lisa-cursor/scripts/remote-agent-aws-setup.sh +3 -1
- package/plugins/lisa-cursor/skills/lisa-setup-remote-env/assets/session-start.sh +18 -5
- package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-devin/hooks/block-managed-file-edits.sh +201 -20
- package/plugins/lisa-devin/hooks/block-masked-exit-status.sh +1 -1
- package/plugins/lisa-devin/hooks/enforce-verification-gate.sh +1 -2
- package/plugins/lisa-devin/scripts/remote-agent-aws-setup.sh +3 -1
- package/plugins/lisa-devin/skills/lisa-setup-remote-env/assets/session-start.sh +18 -5
- package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.codex-plugin/skills/building-native-ui/references/webgpu-three.md +19 -9
- package/plugins/lisa-expo/.codex-plugin/skills/expo-tailwind-setup/SKILL.md +15 -4
- package/plugins/lisa-expo/skills/building-native-ui/references/webgpu-three.md +19 -9
- package/plugins/lisa-expo/skills/expo-tailwind-setup/SKILL.md +15 -4
- package/plugins/lisa-expo-agy/plugin.json +1 -1
- package/plugins/lisa-expo-agy/skills/building-native-ui/references/webgpu-three.md +19 -9
- package/plugins/lisa-expo-agy/skills/expo-tailwind-setup/SKILL.md +15 -4
- package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-copilot/skills/building-native-ui/references/webgpu-three.md +19 -9
- package/plugins/lisa-expo-copilot/skills/expo-tailwind-setup/SKILL.md +15 -4
- package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-cursor/skills/building-native-ui/references/webgpu-three.md +19 -9
- package/plugins/lisa-expo-cursor/skills/expo-tailwind-setup/SKILL.md +15 -4
- package/plugins/lisa-expo-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-devin/skills/building-native-ui/references/webgpu-three.md +19 -9
- package/plugins/lisa-expo-devin/skills/expo-tailwind-setup/SKILL.md +15 -4
- package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/hooks/block-generated-artifact-edits.sh +196 -11
- package/plugins/lisa-harper-fabric/hooks/enforce-config-extensions.sh +1 -1
- package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-copilot/hooks/block-generated-artifact-edits.sh +196 -11
- package/plugins/lisa-harper-fabric-copilot/hooks/enforce-config-extensions.sh +1 -1
- package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-cursor/hooks/block-generated-artifact-edits.sh +196 -11
- package/plugins/lisa-harper-fabric-cursor/hooks/enforce-config-extensions.sh +1 -1
- package/plugins/lisa-harper-fabric-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-devin/hooks/block-generated-artifact-edits.sh +196 -11
- package/plugins/lisa-harper-fabric-devin/hooks/enforce-config-extensions.sh +1 -1
- package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.codex-plugin/skills/nestjs-rules/SKILL.md +39 -26
- package/plugins/lisa-nestjs/.codex-plugin/skills/typeorm-patterns/references/observability-patterns.md +18 -58
- package/plugins/lisa-nestjs/hooks/block-migration-edits.sh +1 -1
- package/plugins/lisa-nestjs/hooks/lisa-edit-gate.sh +19 -15
- package/plugins/lisa-nestjs/skills/nestjs-rules/SKILL.md +39 -26
- package/plugins/lisa-nestjs/skills/typeorm-patterns/references/observability-patterns.md +18 -58
- package/plugins/lisa-nestjs-agy/plugin.json +1 -1
- package/plugins/lisa-nestjs-agy/skills/nestjs-rules/SKILL.md +39 -26
- package/plugins/lisa-nestjs-agy/skills/typeorm-patterns/references/observability-patterns.md +18 -58
- package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-copilot/hooks/block-migration-edits.sh +1 -1
- package/plugins/lisa-nestjs-copilot/hooks/lisa-edit-gate.sh +19 -15
- package/plugins/lisa-nestjs-copilot/skills/nestjs-rules/SKILL.md +39 -26
- package/plugins/lisa-nestjs-copilot/skills/typeorm-patterns/references/observability-patterns.md +18 -58
- package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-cursor/hooks/block-migration-edits.sh +1 -1
- package/plugins/lisa-nestjs-cursor/hooks/lisa-edit-gate.sh +19 -15
- package/plugins/lisa-nestjs-cursor/skills/nestjs-rules/SKILL.md +39 -26
- package/plugins/lisa-nestjs-cursor/skills/typeorm-patterns/references/observability-patterns.md +18 -58
- package/plugins/lisa-nestjs-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-devin/hooks/block-migration-edits.sh +1 -1
- package/plugins/lisa-nestjs-devin/hooks/lisa-edit-gate.sh +19 -15
- package/plugins/lisa-nestjs-devin/skills/nestjs-rules/SKILL.md +39 -26
- package/plugins/lisa-nestjs-devin/skills/typeorm-patterns/references/observability-patterns.md +18 -58
- package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-agy/plugin.json +1 -1
- package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/hooks/lisa-edit-gate.sh +19 -15
- package/plugins/lisa-rails/hooks/rubocop-on-edit.sh +2 -2
- package/plugins/lisa-rails/hooks/sg-scan-on-edit.sh +3 -3
- package/plugins/lisa-rails-agy/plugin.json +1 -1
- package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-copilot/hooks/lisa-edit-gate.sh +19 -15
- package/plugins/lisa-rails-copilot/hooks/rubocop-on-edit.sh +2 -2
- package/plugins/lisa-rails-copilot/hooks/sg-scan-on-edit.sh +3 -3
- package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-cursor/hooks/lisa-edit-gate.sh +19 -15
- package/plugins/lisa-rails-cursor/hooks/rubocop-on-edit.sh +2 -2
- package/plugins/lisa-rails-cursor/hooks/sg-scan-on-edit.sh +3 -3
- package/plugins/lisa-rails-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-devin/hooks/lisa-edit-gate.sh +19 -15
- package/plugins/lisa-rails-devin/hooks/rubocop-on-edit.sh +2 -2
- package/plugins/lisa-rails-devin/hooks/sg-scan-on-edit.sh +3 -3
- package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/hooks/block-suppress-directives.sh +2 -2
- package/plugins/lisa-typescript/hooks/format-on-edit.sh +2 -2
- package/plugins/lisa-typescript/hooks/lint-on-edit.sh +2 -2
- package/plugins/lisa-typescript/hooks/lisa-edit-gate.sh +19 -15
- package/plugins/lisa-typescript/hooks/sg-scan-on-edit.sh +3 -3
- package/plugins/lisa-typescript-agy/plugin.json +1 -1
- package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-copilot/hooks/block-suppress-directives.sh +2 -2
- package/plugins/lisa-typescript-copilot/hooks/format-on-edit.sh +2 -2
- package/plugins/lisa-typescript-copilot/hooks/lint-on-edit.sh +2 -2
- package/plugins/lisa-typescript-copilot/hooks/lisa-edit-gate.sh +19 -15
- package/plugins/lisa-typescript-copilot/hooks/sg-scan-on-edit.sh +3 -3
- package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-cursor/hooks/block-suppress-directives.sh +2 -2
- package/plugins/lisa-typescript-cursor/hooks/format-on-edit.sh +2 -2
- package/plugins/lisa-typescript-cursor/hooks/lint-on-edit.sh +2 -2
- package/plugins/lisa-typescript-cursor/hooks/lisa-edit-gate.sh +19 -15
- package/plugins/lisa-typescript-cursor/hooks/sg-scan-on-edit.sh +3 -3
- package/plugins/lisa-typescript-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-devin/hooks/block-suppress-directives.sh +2 -2
- package/plugins/lisa-typescript-devin/hooks/format-on-edit.sh +2 -2
- package/plugins/lisa-typescript-devin/hooks/lint-on-edit.sh +2 -2
- package/plugins/lisa-typescript-devin/hooks/lisa-edit-gate.sh +19 -15
- package/plugins/lisa-typescript-devin/hooks/sg-scan-on-edit.sh +3 -3
- package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-agy/plugin.json +1 -1
- package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/src/base/hooks/block-managed-file-edits.sh +201 -20
- package/plugins/src/base/hooks/block-masked-exit-status.sh +1 -1
- package/plugins/src/base/hooks/block-no-verify.agy.sh +1 -1
- package/plugins/src/base/hooks/enforce-verification-gate.sh +1 -2
- package/plugins/src/base/hooks/ticket-sync-reminder.sh +2 -17
- package/plugins/src/base/hooks/track-plan-sessions.sh +7 -131
- package/plugins/src/base/scripts/remote-agent-aws-setup.sh +3 -1
- package/plugins/src/base/skills/lisa-setup-remote-env/assets/session-start.sh +18 -5
- package/plugins/src/expo/skills/building-native-ui/references/webgpu-three.md +19 -9
- package/plugins/src/expo/skills/expo-tailwind-setup/SKILL.md +15 -4
- package/plugins/src/harper-fabric/hooks/block-generated-artifact-edits.sh +196 -11
- package/plugins/src/harper-fabric/hooks/enforce-config-extensions.sh +1 -1
- package/plugins/src/nestjs/hooks/block-migration-edits.sh +1 -1
- package/plugins/src/nestjs/hooks/lisa-edit-gate.sh +19 -15
- package/plugins/src/nestjs/skills/nestjs-rules/SKILL.md +39 -26
- package/plugins/src/nestjs/skills/typeorm-patterns/references/observability-patterns.md +18 -58
- package/plugins/src/rails/hooks/lisa-edit-gate.sh +19 -15
- package/plugins/src/rails/hooks/rubocop-on-edit.sh +2 -2
- package/plugins/src/rails/hooks/sg-scan-on-edit.sh +3 -3
- package/plugins/src/typescript/hooks/block-suppress-directives.sh +2 -2
- package/plugins/src/typescript/hooks/format-on-edit.sh +2 -2
- package/plugins/src/typescript/hooks/lint-on-edit.sh +2 -2
- package/plugins/src/typescript/hooks/lisa-edit-gate.sh +19 -15
- package/plugins/src/typescript/hooks/sg-scan-on-edit.sh +3 -3
- package/scripts/build-plugins.sh +1 -1
- package/scripts/check-derived-artifacts.mjs +2 -2
- package/scripts/check-generated-artifact-merge-coverage.mjs +45 -4
- package/scripts/check-orphan-test-processes.mjs +0 -1
- package/scripts/check-self-dependency-pin.mjs +0 -2
- package/scripts/claude-remote-setup.sh +12 -7
- package/scripts/cleanup-amplify-branches.sh +0 -1
- package/scripts/generate-export-surface.mjs +131 -61
- package/scripts/generate-lisa-owned-hash-ledger.mjs +87 -102
- package/scripts/generate-upstream-evidence-manifest.mjs +56 -49
- package/scripts/github-status-check.sh +5 -25
- package/scripts/install-claude-plugins.sh +10 -8
- package/scripts/lib/merge-generated-json.mjs +274 -0
- package/scripts/lib/upstream-manifest-staleness.mjs +38 -34
- package/scripts/lib/upstream-public-commits.mjs +35 -18
- package/scripts/lisa-commit-and-pr-local.sh +1 -1
- package/scripts/lisa-enforcement-fallback.sh +31 -32
- package/scripts/lisa-github-environments.sh +5 -1
- package/scripts/lisa-github-repo-settings.sh +5 -1
- package/scripts/lisa-github-repo-setup.sh +1 -2
- package/scripts/lisa-github-rulesets.sh +8 -8
- package/scripts/lisa-remote-env/session-start.sh +18 -5
- package/scripts/lisa-rollback-release.mjs +0 -2
- package/scripts/lisa-update-local.sh +1 -1
- package/scripts/merge-generated-artifact.mjs +18 -6
- package/scripts/raise-self-dependency-pin.mjs +0 -2
- package/scripts/run-artifact-checks.mjs +1 -1
- package/scripts/verify-packed-learnings-contract.mjs +36 -3
- package/scripts/verify-self-pin-raise.mjs +0 -2
- package/typescript/copy-contents/.husky/commit-msg +8 -2
- package/typescript/copy-contents/.husky/post-checkout +2 -0
- package/typescript/copy-contents/.husky/post-merge +2 -0
- package/typescript/copy-contents/.husky/pre-commit +10 -3
- package/typescript/copy-contents/.husky/pre-push +29 -16
- package/typescript/copy-contents/.husky/prepare-commit-msg +2 -0
- package/typescript/create-only/.husky/pre-push.local +2 -0
- package/eslint-plugin-code-organization/__tests__/enforce-statement-order.test.js +0 -643
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file deduplicate-arrays.ts
|
|
3
|
+
* @description The array union both JSON-governing strategies apply to their
|
|
4
|
+
* `merge` sections: Lisa's items first, then the project's unique additions.
|
|
5
|
+
* @module strategies
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Concatenate two arrays and drop every later duplicate, preserving order.
|
|
9
|
+
* @remarks
|
|
10
|
+
* Equality is `JSON.stringify` equality, so objects and arrays with the same
|
|
11
|
+
* content count as duplicates — which is what lets a list of package names
|
|
12
|
+
* with version specifiers deduplicate. The first occurrence of each value wins.
|
|
13
|
+
* @param firstItems - Items that come first (Lisa's)
|
|
14
|
+
* @param laterItems - Items appended when not already present (the project's)
|
|
15
|
+
* @returns The order-preserving union of both arrays
|
|
16
|
+
*/
|
|
17
|
+
export declare function deduplicateArrays(firstItems: readonly unknown[], laterItems: readonly unknown[]): unknown[];
|
|
18
|
+
//# sourceMappingURL=deduplicate-arrays.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deduplicate-arrays.d.ts","sourceRoot":"","sources":["../../src/strategies/deduplicate-arrays.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,SAAS,OAAO,EAAE,EAC9B,UAAU,EAAE,SAAS,OAAO,EAAE,GAC7B,OAAO,EAAE,CAWX"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file deduplicate-arrays.ts
|
|
3
|
+
* @description The array union both JSON-governing strategies apply to their
|
|
4
|
+
* `merge` sections: Lisa's items first, then the project's unique additions.
|
|
5
|
+
* @module strategies
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Concatenate two arrays and drop every later duplicate, preserving order.
|
|
9
|
+
* @remarks
|
|
10
|
+
* Equality is `JSON.stringify` equality, so objects and arrays with the same
|
|
11
|
+
* content count as duplicates — which is what lets a list of package names
|
|
12
|
+
* with version specifiers deduplicate. The first occurrence of each value wins.
|
|
13
|
+
* @param firstItems - Items that come first (Lisa's)
|
|
14
|
+
* @param laterItems - Items appended when not already present (the project's)
|
|
15
|
+
* @returns The order-preserving union of both arrays
|
|
16
|
+
*/
|
|
17
|
+
export function deduplicateArrays(firstItems, laterItems) {
|
|
18
|
+
const combined = [...firstItems, ...laterItems];
|
|
19
|
+
const keys = combined.map(item => JSON.stringify(item));
|
|
20
|
+
// Built from the reversed pairs so the EARLIEST index of each key is the one
|
|
21
|
+
// the Map keeps: a later entry for the same key overwrites an earlier one.
|
|
22
|
+
const firstIndex = new Map(keys.map((key, index) => [key, index]).reverse());
|
|
23
|
+
return keys.flatMap((key, index) => firstIndex.get(key) === index ? [combined[index]] : []);
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=deduplicate-arrays.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deduplicate-arrays.js","sourceRoot":"","sources":["../../src/strategies/deduplicate-arrays.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;;;;GASG;AACH,MAAM,UAAU,iBAAiB,CAC/B,UAA8B,EAC9B,UAA8B;IAE9B,MAAM,QAAQ,GAAG,CAAC,GAAG,UAAU,EAAE,GAAG,UAAU,CAAC,CAAC;IAChD,MAAM,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IACxD,6EAA6E;IAC7E,2EAA2E;IAC3E,MAAM,UAAU,GAAG,IAAI,GAAG,CACxB,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,KAAK,CAAU,CAAC,CAAC,OAAO,EAAE,CAC1D,CAAC;IACF,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CACjC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CACvD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ProjectType } from "../core/config.js";
|
|
2
|
+
/**
|
|
3
|
+
* Detect which project types apply to this project
|
|
4
|
+
* (TypeScript, Expo, NestJS, CDK, Harper/Fabric, Phaser, npm-package).
|
|
5
|
+
* Probes run one after another, in report order.
|
|
6
|
+
* @param projectDir - Root directory of the project
|
|
7
|
+
* @returns Array of detected project types
|
|
8
|
+
*/
|
|
9
|
+
export declare function detectProjectTypes(projectDir: string): Promise<ProjectType[]>;
|
|
10
|
+
//# sourceMappingURL=package-lisa-detect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-lisa-detect.d.ts","sourceRoot":"","sources":["../../src/strategies/package-lisa-detect.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAqNrD;;;;;;GAMG;AACH,wBAAsB,kBAAkB,CACtC,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,WAAW,EAAE,CAAC,CAQxB"}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file package-lisa-detect.ts
|
|
3
|
+
* @description Detects which project types a host is, so the package-lisa
|
|
4
|
+
* strategy can resolve the matching template inheritance chain.
|
|
5
|
+
* @module strategies
|
|
6
|
+
*/
|
|
7
|
+
import { readFile } from "node:fs/promises";
|
|
8
|
+
import path from "node:path";
|
|
9
|
+
import * as fse from "fs-extra";
|
|
10
|
+
import { CDK_APP_MARKER } from "../core/cdk-preset-adoption.js";
|
|
11
|
+
import { readJsonOrNull } from "../utils/json-utils.js";
|
|
12
|
+
const PACKAGE_JSON = "package.json";
|
|
13
|
+
const TSCONFIG_JSON = "tsconfig.json";
|
|
14
|
+
const APP_JSON = "app.json";
|
|
15
|
+
const EAS_JSON = "eas.json";
|
|
16
|
+
const NEST_CLI_JSON = "nest-cli.json";
|
|
17
|
+
const HARPER_APP_CONFIG = path.join("harper-app", "config.yaml");
|
|
18
|
+
const HARPER_APP_SCHEMA = path.join("harper-app", "schema.graphql");
|
|
19
|
+
/**
|
|
20
|
+
* Report whether a file exists relative to the project root.
|
|
21
|
+
* @param projectDir - The project directory
|
|
22
|
+
* @param relativePath - Path inside the project
|
|
23
|
+
* @returns True when the path exists
|
|
24
|
+
*/
|
|
25
|
+
async function exists(projectDir, relativePath) {
|
|
26
|
+
return fse.pathExists(path.join(projectDir, relativePath));
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Check if package.json dependencies/devDependencies contain a specific package
|
|
30
|
+
* @param projectDir - The project directory to check
|
|
31
|
+
* @param packageName - The exact package name to check for (e.g., "typescript", "expo")
|
|
32
|
+
* @returns True if the package is in dependencies or devDependencies, false otherwise
|
|
33
|
+
*/
|
|
34
|
+
async function packageJsonHasDependency(projectDir, packageName) {
|
|
35
|
+
const packageJson = await readJsonOrNull(path.join(projectDir, PACKAGE_JSON));
|
|
36
|
+
if (!packageJson)
|
|
37
|
+
return false;
|
|
38
|
+
return (packageJson.dependencies?.[packageName] !== undefined ||
|
|
39
|
+
packageJson.devDependencies?.[packageName] !== undefined);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Check if package.json dependencies/devDependencies contain a package starting with prefix
|
|
43
|
+
* @param projectDir - The project directory to check
|
|
44
|
+
* @param prefix - The prefix to check for (e.g., "@nestjs", "aws-cdk")
|
|
45
|
+
* @returns True if any dependency starts with the given prefix, false otherwise
|
|
46
|
+
*/
|
|
47
|
+
async function packageJsonHasDependencyPrefix(projectDir, prefix) {
|
|
48
|
+
const packageJson = await readJsonOrNull(path.join(projectDir, PACKAGE_JSON));
|
|
49
|
+
if (!packageJson)
|
|
50
|
+
return false;
|
|
51
|
+
const deps = packageJson.dependencies ?? {};
|
|
52
|
+
const devDeps = packageJson.devDependencies ?? {};
|
|
53
|
+
return (Object.keys(deps).some(key => key.startsWith(prefix)) ||
|
|
54
|
+
Object.keys(devDeps).some(key => key.startsWith(prefix)));
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Get a field value from package.json
|
|
58
|
+
* @param projectDir - The project directory containing the package.json
|
|
59
|
+
* @param fieldName - The field name to retrieve from package.json
|
|
60
|
+
* @returns The field value if found, undefined if not found or if package.json doesn't exist
|
|
61
|
+
*/
|
|
62
|
+
async function packageJsonField(projectDir, fieldName) {
|
|
63
|
+
const packageJson = await readJsonOrNull(path.join(projectDir, PACKAGE_JSON));
|
|
64
|
+
if (!packageJson)
|
|
65
|
+
return undefined;
|
|
66
|
+
return packageJson[fieldName];
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Check whether harper-app/config.yaml declares the expected Harper component
|
|
70
|
+
* resource keys.
|
|
71
|
+
* @param projectDir - The project directory to check
|
|
72
|
+
* @returns True if the config has Harper/Fabric component signals
|
|
73
|
+
*/
|
|
74
|
+
async function harperConfigHasComponentSignals(projectDir) {
|
|
75
|
+
try {
|
|
76
|
+
const content = await readFile(path.join(projectDir, HARPER_APP_CONFIG), "utf8");
|
|
77
|
+
return (content.includes("graphqlSchema:") &&
|
|
78
|
+
content.includes("jsResource:") &&
|
|
79
|
+
content.includes("static:"));
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* TypeScript: a tsconfig.json or a `typescript` dependency.
|
|
87
|
+
* @param projectDir - The project directory
|
|
88
|
+
* @returns True for a TypeScript project
|
|
89
|
+
*/
|
|
90
|
+
async function isTypeScript(projectDir) {
|
|
91
|
+
return ((await exists(projectDir, TSCONFIG_JSON)) ||
|
|
92
|
+
(await packageJsonHasDependency(projectDir, "typescript")));
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Expo: an app.json, an eas.json, or an `expo` dependency.
|
|
96
|
+
* @param projectDir - The project directory
|
|
97
|
+
* @returns True for an Expo project
|
|
98
|
+
*/
|
|
99
|
+
async function isExpo(projectDir) {
|
|
100
|
+
return ((await exists(projectDir, APP_JSON)) ||
|
|
101
|
+
(await exists(projectDir, EAS_JSON)) ||
|
|
102
|
+
(await packageJsonHasDependency(projectDir, "expo")));
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* NestJS: a nest-cli.json or any `@nestjs` dependency.
|
|
106
|
+
* @param projectDir - The project directory
|
|
107
|
+
* @returns True for a NestJS project
|
|
108
|
+
*/
|
|
109
|
+
async function isNestJs(projectDir) {
|
|
110
|
+
return ((await exists(projectDir, NEST_CLI_JSON)) ||
|
|
111
|
+
(await packageJsonHasDependencyPrefix(projectDir, "@nestjs")));
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* CDK: cdk.json only. An `aws-cdk*` dependency means the project uses CDK
|
|
115
|
+
* constructs, not that it is a CDK app with the preset's layout.
|
|
116
|
+
* @param projectDir - The project directory
|
|
117
|
+
* @returns True for a CDK app
|
|
118
|
+
*/
|
|
119
|
+
async function isCdk(projectDir) {
|
|
120
|
+
return exists(projectDir, CDK_APP_MARKER);
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Harper/Fabric: the harper-app config and schema, plus either component
|
|
124
|
+
* signals in the config or a `harperdb` dependency.
|
|
125
|
+
* @param projectDir - The project directory
|
|
126
|
+
* @returns True for a Harper/Fabric project
|
|
127
|
+
*/
|
|
128
|
+
async function isHarperFabric(projectDir) {
|
|
129
|
+
return ((await exists(projectDir, HARPER_APP_CONFIG)) &&
|
|
130
|
+
(await exists(projectDir, HARPER_APP_SCHEMA)) &&
|
|
131
|
+
((await harperConfigHasComponentSignals(projectDir)) ||
|
|
132
|
+
(await packageJsonHasDependency(projectDir, "harperdb"))));
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Phaser: a `phaser` dependency.
|
|
136
|
+
* @param projectDir - The project directory
|
|
137
|
+
* @returns True for a Phaser project
|
|
138
|
+
*/
|
|
139
|
+
async function isPhaser(projectDir) {
|
|
140
|
+
return packageJsonHasDependency(projectDir, "phaser");
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* npm package: not private, and declares any field a published package uses.
|
|
144
|
+
* @param projectDir - The project directory
|
|
145
|
+
* @returns True for a publishable npm package
|
|
146
|
+
*/
|
|
147
|
+
async function isNpmPackage(projectDir) {
|
|
148
|
+
const isPrivate = await packageJsonField(projectDir, "private");
|
|
149
|
+
const hasPublishField = (await packageJsonField(projectDir, "main")) !== undefined ||
|
|
150
|
+
(await packageJsonField(projectDir, "bin")) !== undefined ||
|
|
151
|
+
(await packageJsonField(projectDir, "exports")) !== undefined ||
|
|
152
|
+
(await packageJsonField(projectDir, "files")) !== undefined;
|
|
153
|
+
return !isPrivate && hasPublishField;
|
|
154
|
+
}
|
|
155
|
+
/** Every probe, in the order detected types are reported. */
|
|
156
|
+
const TYPE_PROBES = [
|
|
157
|
+
["typescript", isTypeScript],
|
|
158
|
+
["expo", isExpo],
|
|
159
|
+
["nestjs", isNestJs],
|
|
160
|
+
["cdk", isCdk],
|
|
161
|
+
["harper-fabric", isHarperFabric],
|
|
162
|
+
["phaser", isPhaser],
|
|
163
|
+
["npm-package", isNpmPackage],
|
|
164
|
+
];
|
|
165
|
+
/**
|
|
166
|
+
* Detect which project types apply to this project
|
|
167
|
+
* (TypeScript, Expo, NestJS, CDK, Harper/Fabric, Phaser, npm-package).
|
|
168
|
+
* Probes run one after another, in report order.
|
|
169
|
+
* @param projectDir - Root directory of the project
|
|
170
|
+
* @returns Array of detected project types
|
|
171
|
+
*/
|
|
172
|
+
export async function detectProjectTypes(projectDir) {
|
|
173
|
+
return TYPE_PROBES.reduce(async (pending, [type, probe]) => {
|
|
174
|
+
const found = await pending;
|
|
175
|
+
return (await probe(projectDir)) ? [...found, type] : found;
|
|
176
|
+
}, Promise.resolve([]));
|
|
177
|
+
}
|
|
178
|
+
//# sourceMappingURL=package-lisa-detect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-lisa-detect.js","sourceRoot":"","sources":["../../src/strategies/package-lisa-detect.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAEhE,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,YAAY,GAAG,cAAc,CAAC;AACpC,MAAM,aAAa,GAAG,eAAe,CAAC;AACtC,MAAM,QAAQ,GAAG,UAAU,CAAC;AAC5B,MAAM,QAAQ,GAAG,UAAU,CAAC;AAC5B,MAAM,aAAa,GAAG,eAAe,CAAC;AACtC,MAAM,iBAAiB,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC;AACjE,MAAM,iBAAiB,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,gBAAgB,CAAC,CAAC;AAWpE;;;;;GAKG;AACH,KAAK,UAAU,MAAM,CACnB,UAAkB,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AAE,MAAM,CAAC;IAChB,CAAC,QAAQ,EAAE,QAAQ,CAAC;IACpB,CAAC,KAAK,EAAE,KAAK,CAAC;IACd,CAAC,eAAe,EAAE,cAAc,CAAC;IACjC,CAAC,QAAQ,EAAE,QAAQ,CAAC;IACpB,CAAC,aAAa,EAAE,YAAY,CAAC;CAC9B,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,UAAkB;IAElB,OAAO,WAAW,CAAC,MAAM,CACvB,KAAK,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE;QAC/B,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC;QAC5B,OAAO,CAAC,MAAM,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IAC9D,CAAC,EACD,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CACpB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ResolvedPackageLisaTemplate } from "./package-lisa-types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Hold a host's direct ranges at or above Lisa's minimums, refusing a raise
|
|
4
|
+
* that would cross a major, then raise any direct range still below a Lisa
|
|
5
|
+
* force floor.
|
|
6
|
+
* @param pkg - Merged package.json about to be persisted
|
|
7
|
+
* @param template - The effective template supplying minimums and force floors
|
|
8
|
+
* @param fileName - Basename used in error messages
|
|
9
|
+
* @throws {JsonMergeError} naming every range no same-major raise reaches
|
|
10
|
+
* @returns The fitted manifest and one note per range it raised
|
|
11
|
+
*/
|
|
12
|
+
export declare function fitDirectRangesToLisaFloors(pkg: Record<string, unknown>, template: Pick<ResolvedPackageLisaTemplate, "force" | "minimums">, fileName: string): {
|
|
13
|
+
readonly packageJson: Record<string, unknown>;
|
|
14
|
+
readonly notes: readonly string[];
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=package-lisa-direct-floors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-lisa-direct-floors.d.ts","sourceRoot":"","sources":["../../src/strategies/package-lisa-direct-floors.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAE3E;;;;;;;;;GASG;AACH,wBAAgB,2BAA2B,CACzC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC5B,QAAQ,EAAE,IAAI,CAAC,2BAA2B,EAAE,OAAO,GAAG,UAAU,CAAC,EACjE,QAAQ,EAAE,MAAM,GACf;IACD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9C,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC,CAyBA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file package-lisa-direct-floors.ts
|
|
3
|
+
* @description Holds and raises a host's direct dependency ranges to Lisa's
|
|
4
|
+
* minimums and force floors before the manifest is persisted.
|
|
5
|
+
* @module strategies
|
|
6
|
+
*/
|
|
7
|
+
import { applyDirectMinimums, describeDirectMinimumConflicts, describeDirectMinimumRaise, } from "../core/direct-minimums.js";
|
|
8
|
+
import { raiseDirectRangesToLisaFloors } from "../core/direct-range-raise.js";
|
|
9
|
+
import { JsonMergeError } from "../errors/index.js";
|
|
10
|
+
/**
|
|
11
|
+
* Hold a host's direct ranges at or above Lisa's minimums, refusing a raise
|
|
12
|
+
* that would cross a major, then raise any direct range still below a Lisa
|
|
13
|
+
* force floor.
|
|
14
|
+
* @param pkg - Merged package.json about to be persisted
|
|
15
|
+
* @param template - The effective template supplying minimums and force floors
|
|
16
|
+
* @param fileName - Basename used in error messages
|
|
17
|
+
* @throws {JsonMergeError} naming every range no same-major raise reaches
|
|
18
|
+
* @returns The fitted manifest and one note per range it raised
|
|
19
|
+
*/
|
|
20
|
+
export function fitDirectRangesToLisaFloors(pkg, template, fileName) {
|
|
21
|
+
const held = applyDirectMinimums(pkg, template.minimums);
|
|
22
|
+
const [first, ...rest] = held.conflicts;
|
|
23
|
+
if (first !== undefined) {
|
|
24
|
+
throw new JsonMergeError(fileName, describeDirectMinimumConflicts([first, ...rest]));
|
|
25
|
+
}
|
|
26
|
+
const raised = raiseDirectRangesToLisaFloors(held.packageJson, template.force);
|
|
27
|
+
return {
|
|
28
|
+
packageJson: raised.packageJson,
|
|
29
|
+
notes: [
|
|
30
|
+
...held.raises.map(describeDirectMinimumRaise),
|
|
31
|
+
...raised.raises.map(raise => `Raised ${raise.section}.${raise.name} from ${JSON.stringify(raise.from)} to ` +
|
|
32
|
+
`${JSON.stringify(raise.to)} to meet Lisa's floor ` +
|
|
33
|
+
`${JSON.stringify(raise.floorRange)}.`),
|
|
34
|
+
],
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=package-lisa-direct-floors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-lisa-direct-floors.js","sourceRoot":"","sources":["../../src/strategies/package-lisa-direct-floors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EACL,mBAAmB,EACnB,8BAA8B,EAC9B,0BAA0B,GAC3B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,6BAA6B,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGpD;;;;;;;;;GASG;AACH,MAAM,UAAU,2BAA2B,CACzC,GAA4B,EAC5B,QAAiE,EACjE,QAAgB;IAKhB,MAAM,IAAI,GAAG,mBAAmB,CAAC,GAAG,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACzD,MAAM,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC;IACxC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,MAAM,IAAI,cAAc,CACtB,QAAQ,EACR,8BAA8B,CAAC,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,CAAC,CACjD,CAAC;IACJ,CAAC;IACD,MAAM,MAAM,GAAG,6BAA6B,CAC1C,IAAI,CAAC,WAAW,EAChB,QAAQ,CAAC,KAAK,CACf,CAAC;IACF,OAAO;QACL,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,KAAK,EAAE;YACL,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,0BAA0B,CAAC;YAC9C,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,CAClB,KAAK,CAAC,EAAE,CACN,UAAU,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,IAAI,SAAS,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM;gBAC9E,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,wBAAwB;gBACnD,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CACzC;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { PackageJsonPlan } from "./package-lisa-types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Restore host dependency pins that sit ABOVE Lisa's template.
|
|
4
|
+
* @remarks
|
|
5
|
+
* Every `force` pin exists to push a project PAST a CVE, so it is a security
|
|
6
|
+
* FLOOR — not an assignment. Phase 1 applies it with `deepMerge`, where Lisa's
|
|
7
|
+
* value wins unconditionally, and that is only correct while the template is the
|
|
8
|
+
* higher of the two. The moment a host raises a pin beyond the template (or the
|
|
9
|
+
* template simply lags a fresh advisory), the same "security write" silently
|
|
10
|
+
* walks the host BACKWARDS into the vulnerable range it had already escaped.
|
|
11
|
+
*
|
|
12
|
+
* This is not hypothetical: a caller repo in the portfolio pinned at
|
|
13
|
+
* `dependencies.tar >=7.5.21` was reverted to `>=7.5.19` on every `bun install`,
|
|
14
|
+
* readmitting the two releases GHSA-r292-9mhp-454m covers. A floor can only be
|
|
15
|
+
* right by coincidence when it is written as an overwrite.
|
|
16
|
+
*
|
|
17
|
+
* The decision is deliberately narrow, because Lisa must be able to PROVE the
|
|
18
|
+
* host is ahead — the same standard `preserveIfHostAhead` holds the file lane
|
|
19
|
+
* to, applied to the strictly easier case where a semver range makes "ahead"
|
|
20
|
+
* decidable rather than merely suspected:
|
|
21
|
+
*
|
|
22
|
+
* - Host floor not above Lisa's: Lisa is raising, which is the whole point of
|
|
23
|
+
* the mechanism. Phase 1 stands.
|
|
24
|
+
* - Host floor above Lisa's AND the host range is a subset of Lisa's: the host
|
|
25
|
+
* admits only versions Lisa allows, so it is provably the stricter of the
|
|
26
|
+
* two. Keep the host.
|
|
27
|
+
* - Host floor above Lisa's and neither range contains the other: both sides
|
|
28
|
+
* carry a constraint the other drops. Lisa cannot decide it, so it REFUSES
|
|
29
|
+
* and names both rather than picking one — silently picking one is how a
|
|
30
|
+
* lowered floor shipped in the first place.
|
|
31
|
+
*
|
|
32
|
+
* A value that cannot be parsed — npm's `"$name"` self-references, git URLs,
|
|
33
|
+
* `workspace:*` — is left as Phase 1 produced it, so this can only ever RAISE
|
|
34
|
+
* a pin or stop.
|
|
35
|
+
* @param projectJson - The host package.json as it was before Phase 1.
|
|
36
|
+
* @param afterForce - The result of Phase 1's force merge.
|
|
37
|
+
* @param fileName - Basename used in error messages.
|
|
38
|
+
* @throws {JsonMergeError} when a host pin is higher but the two ranges are
|
|
39
|
+
* incomparable.
|
|
40
|
+
* @returns `afterForce` with host-side higher pins restored, plus notes.
|
|
41
|
+
*/
|
|
42
|
+
export declare function preserveHigherHostPins(projectJson: Record<string, unknown>, afterForce: Record<string, unknown>, fileName: string): PackageJsonPlan;
|
|
43
|
+
//# sourceMappingURL=package-lisa-host-pins.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-lisa-host-pins.d.ts","sourceRoot":"","sources":["../../src/strategies/package-lisa-host-pins.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AA6B/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAgB,sBAAsB,CACpC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACpC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACnC,QAAQ,EAAE,MAAM,GACf,eAAe,CA4BjB"}
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file package-lisa-host-pins.ts
|
|
3
|
+
* @description Phase 1 floor guard of the package-lisa apply: restore host
|
|
4
|
+
* dependency pins that provably sit above Lisa's forced floor, and refuse when
|
|
5
|
+
* neither range can be proven ahead.
|
|
6
|
+
* @module strategies
|
|
7
|
+
*/
|
|
8
|
+
import semver from "semver";
|
|
9
|
+
import { asRecord, DIRECT_DEPENDENCY_SECTIONS, OVERRIDE_SECTIONS, } from "../core/override-floors.js";
|
|
10
|
+
import { JsonMergeError } from "../errors/index.js";
|
|
11
|
+
/**
|
|
12
|
+
* Every section whose forced values are a version FLOOR rather than an
|
|
13
|
+
* assignment, and which therefore may never be merged downwards.
|
|
14
|
+
* @remarks
|
|
15
|
+
* `overrides`/`resolutions` alone was the original list, and it left the hole
|
|
16
|
+
* this exists to close: `overrides.tar` is `"$tar"`, npm's self-reference, so
|
|
17
|
+
* its effective floor IS `dependencies.tar`. Guarding only the override
|
|
18
|
+
* sections preserved a `$tar` that had quietly come to mean something weaker —
|
|
19
|
+
* the protection intact and hollow at the same time, with a test asserting the
|
|
20
|
+
* override survived passing either way.
|
|
21
|
+
*/
|
|
22
|
+
const FLOOR_SECTIONS = [
|
|
23
|
+
...DIRECT_DEPENDENCY_SECTIONS,
|
|
24
|
+
...OVERRIDE_SECTIONS,
|
|
25
|
+
];
|
|
26
|
+
/**
|
|
27
|
+
* Restore host dependency pins that sit ABOVE Lisa's template.
|
|
28
|
+
* @remarks
|
|
29
|
+
* Every `force` pin exists to push a project PAST a CVE, so it is a security
|
|
30
|
+
* FLOOR — not an assignment. Phase 1 applies it with `deepMerge`, where Lisa's
|
|
31
|
+
* value wins unconditionally, and that is only correct while the template is the
|
|
32
|
+
* higher of the two. The moment a host raises a pin beyond the template (or the
|
|
33
|
+
* template simply lags a fresh advisory), the same "security write" silently
|
|
34
|
+
* walks the host BACKWARDS into the vulnerable range it had already escaped.
|
|
35
|
+
*
|
|
36
|
+
* This is not hypothetical: a caller repo in the portfolio pinned at
|
|
37
|
+
* `dependencies.tar >=7.5.21` was reverted to `>=7.5.19` on every `bun install`,
|
|
38
|
+
* readmitting the two releases GHSA-r292-9mhp-454m covers. A floor can only be
|
|
39
|
+
* right by coincidence when it is written as an overwrite.
|
|
40
|
+
*
|
|
41
|
+
* The decision is deliberately narrow, because Lisa must be able to PROVE the
|
|
42
|
+
* host is ahead — the same standard `preserveIfHostAhead` holds the file lane
|
|
43
|
+
* to, applied to the strictly easier case where a semver range makes "ahead"
|
|
44
|
+
* decidable rather than merely suspected:
|
|
45
|
+
*
|
|
46
|
+
* - Host floor not above Lisa's: Lisa is raising, which is the whole point of
|
|
47
|
+
* the mechanism. Phase 1 stands.
|
|
48
|
+
* - Host floor above Lisa's AND the host range is a subset of Lisa's: the host
|
|
49
|
+
* admits only versions Lisa allows, so it is provably the stricter of the
|
|
50
|
+
* two. Keep the host.
|
|
51
|
+
* - Host floor above Lisa's and neither range contains the other: both sides
|
|
52
|
+
* carry a constraint the other drops. Lisa cannot decide it, so it REFUSES
|
|
53
|
+
* and names both rather than picking one — silently picking one is how a
|
|
54
|
+
* lowered floor shipped in the first place.
|
|
55
|
+
*
|
|
56
|
+
* A value that cannot be parsed — npm's `"$name"` self-references, git URLs,
|
|
57
|
+
* `workspace:*` — is left as Phase 1 produced it, so this can only ever RAISE
|
|
58
|
+
* a pin or stop.
|
|
59
|
+
* @param projectJson - The host package.json as it was before Phase 1.
|
|
60
|
+
* @param afterForce - The result of Phase 1's force merge.
|
|
61
|
+
* @param fileName - Basename used in error messages.
|
|
62
|
+
* @throws {JsonMergeError} when a host pin is higher but the two ranges are
|
|
63
|
+
* incomparable.
|
|
64
|
+
* @returns `afterForce` with host-side higher pins restored, plus notes.
|
|
65
|
+
*/
|
|
66
|
+
export function preserveHigherHostPins(projectJson, afterForce, fileName) {
|
|
67
|
+
return FLOOR_SECTIONS.reduce((plan, section) => {
|
|
68
|
+
const forcedSection = asRecord(plan.packageJson[section]);
|
|
69
|
+
const preserved = collectPreservedPins(section, asRecord(projectJson[section]), forcedSection, fileName);
|
|
70
|
+
if (preserved.length === 0) {
|
|
71
|
+
return plan;
|
|
72
|
+
}
|
|
73
|
+
return {
|
|
74
|
+
packageJson: {
|
|
75
|
+
...plan.packageJson,
|
|
76
|
+
[section]: {
|
|
77
|
+
...forcedSection,
|
|
78
|
+
...Object.fromEntries(preserved.map(pin => [pin.name, pin.hostRange])),
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
notes: [...plan.notes, ...preserved.map(formatPreservedPinNote)],
|
|
82
|
+
};
|
|
83
|
+
}, { packageJson: afterForce, notes: [] });
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Find every host pin in one section that must survive Phase 1's force merge.
|
|
87
|
+
* @param section - Section name, used in notes and error messages
|
|
88
|
+
* @param hostSection - The host's entries for this section, pre-merge
|
|
89
|
+
* @param forcedSection - The entries Phase 1 produced for this section
|
|
90
|
+
* @param fileName - Basename used in error messages
|
|
91
|
+
* @throws {JsonMergeError} on the first incomparable pin
|
|
92
|
+
* @returns Pins whose host value must be restored
|
|
93
|
+
*/
|
|
94
|
+
function collectPreservedPins(section, hostSection, forcedSection, fileName) {
|
|
95
|
+
return Object.entries(hostSection).flatMap(([name, hostValue]) => {
|
|
96
|
+
const forcedValue = forcedSection[name];
|
|
97
|
+
const verdict = classifyHostPin(hostValue, forcedValue);
|
|
98
|
+
if (verdict === "template") {
|
|
99
|
+
return [];
|
|
100
|
+
}
|
|
101
|
+
const pin = {
|
|
102
|
+
section,
|
|
103
|
+
name,
|
|
104
|
+
hostRange: hostValue,
|
|
105
|
+
forcedRange: forcedValue,
|
|
106
|
+
};
|
|
107
|
+
if (verdict === "incomparable") {
|
|
108
|
+
throw new JsonMergeError(fileName, formatIncomparablePinMessage(pin));
|
|
109
|
+
}
|
|
110
|
+
return [pin];
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Decide what to do with one dependency where host and template disagree.
|
|
115
|
+
* @param hostValue - The host's range for this dependency.
|
|
116
|
+
* @param forcedValue - The range Phase 1 wrote for the same dependency.
|
|
117
|
+
* @returns Which side wins, or `incomparable` when neither can be proven ahead.
|
|
118
|
+
*/
|
|
119
|
+
function classifyHostPin(hostValue, forcedValue) {
|
|
120
|
+
if (typeof hostValue !== "string" || typeof forcedValue !== "string") {
|
|
121
|
+
return "template";
|
|
122
|
+
}
|
|
123
|
+
const hostFloor = rangeFloor(hostValue);
|
|
124
|
+
const forcedFloor = rangeFloor(forcedValue);
|
|
125
|
+
if (hostFloor === null ||
|
|
126
|
+
forcedFloor === null ||
|
|
127
|
+
!semver.gt(hostFloor, forcedFloor)) {
|
|
128
|
+
return "template";
|
|
129
|
+
}
|
|
130
|
+
return rangeContains(forcedValue, hostValue) ? "host" : "incomparable";
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* npm's exclusive-ceiling convention: the lowest possible prerelease of the
|
|
134
|
+
* excluded version, so that no prerelease of it is admitted.
|
|
135
|
+
*/
|
|
136
|
+
const CEILING_PRERELEASE_SENTINEL = "-0";
|
|
137
|
+
/**
|
|
138
|
+
* Rewrite a range's bare `<X.Y.Z` ceilings into npm's `<X.Y.Z-0` form.
|
|
139
|
+
* @remarks
|
|
140
|
+
* `semver` desugars `^5.0.1` to `>=5.0.1 <6.0.0-0` — the `-0` sentinel excludes
|
|
141
|
+
* every prerelease of the ceiling. A hand-written `>=5.0.9 <6.0.0` carries no
|
|
142
|
+
* sentinel, and since `6.0.0-0 < 6.0.0`, its interval is strictly the taller of
|
|
143
|
+
* the two: it contains the points `6.0.0-0` and `6.0.0-alpha.1` that the caret
|
|
144
|
+
* form excludes. `semver.subset` is pure interval algebra, so it answers `false`
|
|
145
|
+
* for `subset(">=5.0.9 <6.0.0", "^5.0.1")` — correctly, for the intervals as
|
|
146
|
+
* literally written. That is not a `semver` defect and there is nothing upstream
|
|
147
|
+
* to wait for.
|
|
148
|
+
*
|
|
149
|
+
* It is still the wrong answer to the question this module is asking. Those
|
|
150
|
+
* extra points are not versions any install can select: `satisfies` excludes
|
|
151
|
+
* prereleases unless a comparator names the same `major.minor.patch` with its
|
|
152
|
+
* own prerelease tag, so `6.0.0-alpha.1` satisfies NEITHER range. The two
|
|
153
|
+
* spellings admit exactly the same installable versions, and the disagreement is
|
|
154
|
+
* an artifact of which spelling the operator reached for — which is precisely
|
|
155
|
+
* the symptom: `^5.0.9` was accepted while the identical interval written as
|
|
156
|
+
* `>=5.0.9 <6.0.0` was refused, telling the operator the guard was broken rather
|
|
157
|
+
* than the range wrong.
|
|
158
|
+
*
|
|
159
|
+
* `includePrerelease: true` does not fix it — it widens BOTH sides, so the
|
|
160
|
+
* ceilings stay unequal and the subset test still fails. Putting both sides into
|
|
161
|
+
* one convention is what makes them comparable.
|
|
162
|
+
*
|
|
163
|
+
* Only a bare `<` ceiling is rewritten. `<=X.Y.Z` is left alone because it
|
|
164
|
+
* genuinely admits `X.Y.Z` itself, and a ceiling that already carries a
|
|
165
|
+
* prerelease tag already says what it means. A range with no `<` comparator at
|
|
166
|
+
* all — an unbounded `>=5.0.9`, or `*` — comes back untouched and stays
|
|
167
|
+
* incomparable, which is the bite that protects a hardened floor.
|
|
168
|
+
* @param range - An npm version range.
|
|
169
|
+
* @returns The same range with bare exclusive ceilings carrying the sentinel.
|
|
170
|
+
*/
|
|
171
|
+
function normalizeRangeCeilings(range) {
|
|
172
|
+
return new semver.Range(range).set
|
|
173
|
+
.map(comparators => comparators.map(comparator => formatCeiling(comparator)).join(" "))
|
|
174
|
+
.join(" || ");
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Render one comparator, adding the prerelease sentinel to a bare `<` ceiling.
|
|
178
|
+
* @param comparator - A single parsed comparator from a range's comparator set.
|
|
179
|
+
* @returns The comparator's source text, or its sentinel-carrying equivalent.
|
|
180
|
+
*/
|
|
181
|
+
function formatCeiling(comparator) {
|
|
182
|
+
const version = comparator.semver;
|
|
183
|
+
if (comparator.operator !== "<" ||
|
|
184
|
+
version === undefined ||
|
|
185
|
+
version === null ||
|
|
186
|
+
version.prerelease.length > 0) {
|
|
187
|
+
return comparator.value;
|
|
188
|
+
}
|
|
189
|
+
return `<${version.major}.${version.minor}.${version.patch}${CEILING_PRERELEASE_SENTINEL}`;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Decide whether every version one range admits is admitted by another.
|
|
193
|
+
* @remarks
|
|
194
|
+
* Both sides are put into one ceiling convention first — see
|
|
195
|
+
* {@link normalizeRangeCeilings} — so that a caret and the compound range that
|
|
196
|
+
* desugars to the same interval reach the same verdict. Normalizing can only
|
|
197
|
+
* LOWER a bare ceiling, so it can only turn a `false` into a `true`; the
|
|
198
|
+
* direction is safe here because this branch KEEPS a host pin whose floor is
|
|
199
|
+
* already proven higher, and keeping a higher floor can never lower one.
|
|
200
|
+
*
|
|
201
|
+
* A value `semver` cannot parse at all — `"$name"` self-references, `npm:`
|
|
202
|
+
* aliases, `workspace:`, `file:` and git specs — throws here and is reported as
|
|
203
|
+
* "does not contain", exactly as before.
|
|
204
|
+
* @param outer - The wider candidate range.
|
|
205
|
+
* @param inner - The narrower candidate range.
|
|
206
|
+
* @returns True when `inner` admits nothing `outer` forbids.
|
|
207
|
+
*/
|
|
208
|
+
function rangeContains(outer, inner) {
|
|
209
|
+
try {
|
|
210
|
+
return semver.subset(normalizeRangeCeilings(inner), normalizeRangeCeilings(outer));
|
|
211
|
+
}
|
|
212
|
+
catch {
|
|
213
|
+
return false;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Format the operator-visible explanation for a preserved host pin.
|
|
218
|
+
* @param pin - The pin that was kept, with both ranges
|
|
219
|
+
* @returns Human-readable note for apply output
|
|
220
|
+
*/
|
|
221
|
+
function formatPreservedPinNote(pin) {
|
|
222
|
+
return (`Kept host ${pin.section}.${pin.name} ${JSON.stringify(pin.hostRange)}: ` +
|
|
223
|
+
`it admits only versions Lisa's ${JSON.stringify(pin.forcedRange)} allows ` +
|
|
224
|
+
`and starts higher, so applying the template would lower the host's floor.`);
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Format the refusal for a host pin Lisa cannot prove itself ahead of.
|
|
228
|
+
* @param pin - The pin that could not be decided, with both ranges
|
|
229
|
+
* @returns Human-readable error message naming both ranges
|
|
230
|
+
*/
|
|
231
|
+
function formatIncomparablePinMessage(pin) {
|
|
232
|
+
return (`${pin.section}.${pin.name} cannot be merged: the host range ` +
|
|
233
|
+
`${JSON.stringify(pin.hostRange)} starts above Lisa's ` +
|
|
234
|
+
`${JSON.stringify(pin.forcedRange)}, but neither range contains the other, ` +
|
|
235
|
+
`so each admits versions the other forbids and Lisa cannot prove which is ` +
|
|
236
|
+
`correct. Overwriting the host here is how a hardened floor gets silently ` +
|
|
237
|
+
`lowered, so this apply stops instead. Reconcile the two by hand: pick one ` +
|
|
238
|
+
`range in the host package.json that satisfies both constraints, or raise ` +
|
|
239
|
+
`Lisa's template pin to cover the host's.`);
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Resolve the lowest version a range admits.
|
|
243
|
+
* @param range - An npm version range.
|
|
244
|
+
* @returns The minimum version, or null when the range is not comparable.
|
|
245
|
+
*/
|
|
246
|
+
function rangeFloor(range) {
|
|
247
|
+
try {
|
|
248
|
+
return semver.minVersion(range)?.version ?? null;
|
|
249
|
+
}
|
|
250
|
+
catch {
|
|
251
|
+
return null;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
//# sourceMappingURL=package-lisa-host-pins.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-lisa-host-pins.js","sourceRoot":"","sources":["../../src/strategies/package-lisa-host-pins.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,OAAO,EACL,QAAQ,EACR,0BAA0B,EAC1B,iBAAiB,GAClB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGpD;;;;;;;;;;GAUG;AACH,MAAM,cAAc,GAAG;IACrB,GAAG,0BAA0B;IAC7B,GAAG,iBAAiB;CACZ,CAAC;AAaX;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,MAAM,UAAU,sBAAsB,CACpC,WAAoC,EACpC,UAAmC,EACnC,QAAgB;IAEhB,OAAO,cAAc,CAAC,MAAM,CAC1B,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE;QAChB,MAAM,aAAa,GAAG,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC;QAC1D,MAAM,SAAS,GAAG,oBAAoB,CACpC,OAAO,EACP,QAAQ,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,EAC9B,aAAa,EACb,QAAQ,CACT,CAAC;QACF,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC3B,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO;YACL,WAAW,EAAE;gBACX,GAAG,IAAI,CAAC,WAAW;gBACnB,CAAC,OAAO,CAAC,EAAE;oBACT,GAAG,aAAa;oBAChB,GAAG,MAAM,CAAC,WAAW,CACnB,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,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