@blxzer/cursor-trellis 0.4.1 → 0.4.3
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 +49 -0
- package/README.md +25 -14
- package/README.zh-CN.md +14 -10
- package/bin/smart-search.js +10 -2
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +36 -15
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/init.d.ts +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +42 -153
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/migrate.d.ts +10 -0
- package/dist/commands/migrate.d.ts.map +1 -0
- package/dist/commands/migrate.js +38 -0
- package/dist/commands/migrate.js.map +1 -0
- package/dist/commands/update.d.ts +5 -0
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +144 -41
- package/dist/commands/update.js.map +1 -1
- package/dist/configurators/cursor.d.ts +2 -1
- package/dist/configurators/cursor.d.ts.map +1 -1
- package/dist/configurators/cursor.js +4 -2
- package/dist/configurators/cursor.js.map +1 -1
- package/dist/configurators/index.js +4 -4
- package/dist/configurators/index.js.map +1 -1
- package/dist/configurators/shared.d.ts +8 -0
- package/dist/configurators/shared.d.ts.map +1 -1
- package/dist/configurators/shared.js +27 -1
- package/dist/configurators/shared.js.map +1 -1
- package/dist/configurators/workflow.d.ts +0 -9
- package/dist/configurators/workflow.d.ts.map +1 -1
- package/dist/configurators/workflow.js +12 -45
- package/dist/configurators/workflow.js.map +1 -1
- package/dist/constants/paths.d.ts +13 -0
- package/dist/constants/paths.d.ts.map +1 -1
- package/dist/constants/paths.js +17 -0
- package/dist/constants/paths.js.map +1 -1
- package/dist/migrations/manifests/0.3.0.json +1 -1
- package/dist/templates/common/bundled-skills/cstl-check/SKILL.md +1 -1
- package/dist/templates/common/bundled-skills/cstl-meta/references/platform-files/hooks-and-settings.md +2 -2
- package/dist/templates/common/bundled-skills/cstl-meta/references/platform-files/overview.md +1 -1
- package/dist/templates/common/bundled-skills/cstl-meta/references/platform-files/skills-and-commands.md +2 -4
- package/dist/templates/common/bundled-skills/cstl-skill-creator/SKILL.md +10 -7
- package/dist/templates/common/bundled-skills/cstl-skill-creator/references/authoring-rules.md +93 -19
- package/dist/templates/common/bundled-skills/cstl-skill-creator/references/general-authoring.md +189 -0
- package/dist/templates/common/bundled-skills/cstl-skill-creator/references/review-checklist.md +10 -5
- package/dist/templates/common/commands/continue.md +6 -5
- package/dist/templates/common/index.d.ts +20 -0
- package/dist/templates/common/index.d.ts.map +1 -1
- package/dist/templates/common/index.js +21 -2
- package/dist/templates/common/index.js.map +1 -1
- package/dist/templates/common/optional-skills/chrome-cdp/SKILL.md +179 -0
- package/dist/templates/common/optional-skills/chrome-cdp/examples/fetch-hook-api-capture.md +149 -0
- package/dist/templates/common/optional-skills/chrome-cdp/scripts/cdp.mjs +903 -0
- package/dist/templates/common/skills/brainstorm.md +2 -2
- package/dist/templates/cursor/agents/cstl-check.md +2 -2
- package/dist/templates/cursor/agents/cstl-implement.md +1 -1
- package/dist/templates/cursor/agents/cstl-research.md +2 -2
- package/dist/templates/cursor/fixtures/expected-rules.d.ts +1 -1
- package/dist/templates/cursor/fixtures/expected-rules.d.ts.map +1 -1
- package/dist/templates/cursor/fixtures/expected-rules.js +7 -24
- package/dist/templates/cursor/fixtures/expected-rules.js.map +1 -1
- package/dist/templates/cursor/hooks.json +4 -0
- package/dist/templates/cursor/index.d.ts +1 -1
- package/dist/templates/cursor/index.js +1 -1
- package/dist/templates/cursor/rules/cstl-bootstrap.mdc +17 -0
- package/dist/templates/markdown/agents.md +36 -3
- package/dist/templates/markdown/{spec/guides → framework}/cursor-native-modes-guide.md.txt +13 -10
- package/dist/templates/markdown/{spec/guides → framework}/cursor-subagent-policy.md.txt +63 -127
- package/dist/templates/markdown/framework/dogfood-only-surfaces.md.txt +29 -0
- package/dist/templates/markdown/{spec/guides → framework}/execution-strategy.md.txt +2 -0
- package/dist/templates/markdown/framework/index.md.txt +31 -0
- package/dist/templates/markdown/framework/internal-skills-cursor-reachability.md.txt +45 -0
- package/dist/templates/markdown/framework/middleware-protocol.md.txt +83 -0
- package/dist/templates/markdown/framework/parallel-first-execution.md.txt +78 -0
- package/dist/templates/markdown/framework/prd-grill-frontier.md.txt +83 -0
- package/dist/templates/markdown/framework/release-boundary.md.txt +30 -0
- package/dist/templates/markdown/{spec/guides → framework}/retrieval-daily-guide.md.txt +1 -1
- package/dist/templates/markdown/framework/upgrade.md.txt +15 -0
- package/dist/templates/markdown/{spec/guides → framework}/verification-strength-guide.md.txt +2 -2
- package/dist/templates/markdown/index.d.ts +26 -10
- package/dist/templates/markdown/index.d.ts.map +1 -1
- package/dist/templates/markdown/index.js +87 -11
- package/dist/templates/markdown/index.js.map +1 -1
- package/dist/templates/markdown/prompts/run-semantic-slice-12.md.txt +1 -1
- package/dist/templates/markdown/spec/guides/index.md.txt +5 -19
- package/dist/templates/markdown/spec/guides/prototype-guide.md.txt +10 -10
- package/dist/templates/markdown/spec/guides/test-discipline-guide.md.txt +1 -1
- package/dist/templates/shared-hooks/event-bridge.py +60 -0
- package/dist/templates/shared-hooks/index.d.ts +1 -1
- package/dist/templates/shared-hooks/index.d.ts.map +1 -1
- package/dist/templates/shared-hooks/index.js +1 -0
- package/dist/templates/shared-hooks/index.js.map +1 -1
- package/dist/templates/shared-hooks/session-start.py +19 -2
- package/dist/templates/trellis/CONTEXT.md +63 -3
- package/dist/templates/trellis/config.yaml +1 -1
- package/dist/templates/trellis/gitignore.txt +39 -39
- package/dist/templates/trellis/index.d.ts +12 -0
- package/dist/templates/trellis/index.d.ts.map +1 -1
- package/dist/templates/trellis/index.js +73 -15
- package/dist/templates/trellis/index.js.map +1 -1
- package/dist/templates/trellis/pool/README.md +12 -3
- package/dist/templates/trellis/pool/plan.md +24 -5
- package/dist/templates/trellis/scripts/common/adapter_middleware.py +158 -0
- package/dist/templates/trellis/scripts/common/artifact_locale.py +12 -3
- package/dist/templates/trellis/scripts/common/cursor_retrieval_env.py +5 -2
- package/dist/templates/trellis/scripts/common/full_quality.py +237 -0
- package/dist/templates/trellis/scripts/common/git.py +6 -0
- package/dist/templates/trellis/scripts/common/git_context.py +17 -5
- package/dist/templates/trellis/scripts/common/kernel_command.py +367 -0
- package/dist/templates/trellis/scripts/common/lite_context.py +280 -0
- package/dist/templates/trellis/scripts/common/ondemand_topology.py +225 -0
- package/dist/templates/trellis/scripts/common/parent_orchestration.py +1 -1
- package/dist/templates/trellis/scripts/common/pool_store.py +16 -4
- package/dist/templates/trellis/scripts/common/retrieval_agent_instructions.py +2 -2
- package/dist/templates/trellis/scripts/common/session_context.py +28 -2
- package/dist/templates/trellis/scripts/common/task_gates.py +73 -12
- package/dist/templates/trellis/scripts/common/task_map.py +42 -9
- package/dist/templates/trellis/scripts/common/task_store.py +293 -61
- package/dist/templates/trellis/scripts/common/test_adapter_middleware.py +56 -0
- package/dist/templates/trellis/scripts/common/test_depends_mode_block.py +9 -0
- package/dist/templates/trellis/scripts/common/test_full_quality.py +197 -0
- package/dist/templates/trellis/scripts/common/test_kernel_command.py +326 -0
- package/dist/templates/trellis/scripts/common/test_lite_path.py +190 -0
- package/dist/templates/trellis/scripts/common/test_observable_defaults.py +10 -4
- package/dist/templates/trellis/scripts/common/test_ondemand_topology.py +122 -0
- package/dist/templates/trellis/scripts/common/test_pool_store.py +17 -0
- package/dist/templates/trellis/scripts/common/test_task_store_kernel_patch.py +163 -0
- package/dist/templates/trellis/scripts/common/workflow_phase.py +3 -0
- package/dist/templates/trellis/scripts/cursor_retrieval_probe_prompt.md +4 -5
- package/dist/templates/trellis/scripts/get_context.py +1 -0
- package/dist/templates/trellis/scripts/pool.py +5 -0
- package/dist/templates/trellis/scripts/task.py +83 -7
- package/dist/templates/trellis/workflow.md +109 -23
- package/dist/utils/cursor-retrieval-env.d.ts +2 -1
- package/dist/utils/cursor-retrieval-env.d.ts.map +1 -1
- package/dist/utils/cursor-retrieval-env.js +3 -2
- package/dist/utils/cursor-retrieval-env.js.map +1 -1
- package/dist/utils/cursor2plus-residue-cleanup.d.ts +38 -0
- package/dist/utils/cursor2plus-residue-cleanup.d.ts.map +1 -0
- package/dist/utils/cursor2plus-residue-cleanup.js +145 -0
- package/dist/utils/cursor2plus-residue-cleanup.js.map +1 -0
- package/dist/utils/manifest-prune.d.ts.map +1 -1
- package/dist/utils/manifest-prune.js +7 -2
- package/dist/utils/manifest-prune.js.map +1 -1
- package/dist/utils/p36-upgrade.d.ts +62 -0
- package/dist/utils/p36-upgrade.d.ts.map +1 -0
- package/dist/utils/p36-upgrade.js +160 -0
- package/dist/utils/p36-upgrade.js.map +1 -0
- package/dist/utils/project-capabilities.d.ts +1 -12
- package/dist/utils/project-capabilities.d.ts.map +1 -1
- package/dist/utils/project-capabilities.js +3 -100
- package/dist/utils/project-capabilities.js.map +1 -1
- package/dist/utils/readiness.d.ts +10 -0
- package/dist/utils/readiness.d.ts.map +1 -1
- package/dist/utils/readiness.js +58 -26
- package/dist/utils/readiness.js.map +1 -1
- package/dist/utils/retrieval-agent-instructions.js +1 -1
- package/dist/utils/retrieval-agent-instructions.js.map +1 -1
- package/dist/utils/retrieval-execution-telemetry.js +1 -1
- package/dist/utils/retrieval-execution-telemetry.js.map +1 -1
- package/dist/utils/template-hash.d.ts.map +1 -1
- package/dist/utils/template-hash.js +11 -1
- package/dist/utils/template-hash.js.map +1 -1
- package/dist/utils/uninstall-scrubbers.d.ts.map +1 -1
- package/dist/utils/uninstall-scrubbers.js +52 -14
- package/dist/utils/uninstall-scrubbers.js.map +1 -1
- package/dist/utils/update-rollout-report.d.ts +14 -0
- package/dist/utils/update-rollout-report.d.ts.map +1 -1
- package/dist/utils/update-rollout-report.js +1 -0
- package/dist/utils/update-rollout-report.js.map +1 -1
- package/dist/utils/workflow-ownership.d.ts +1 -1
- package/dist/utils/workflow-ownership.js +4 -4
- package/dist/utils/workflow-ownership.js.map +1 -1
- package/package.json +5 -4
- package/scripts/postinstall.js +6 -7
- package/dist/commands/campaign/canvas-render.d.ts +0 -68
- package/dist/commands/campaign/canvas-render.d.ts.map +0 -1
- package/dist/commands/campaign/canvas-render.js +0 -414
- package/dist/commands/campaign/canvas-render.js.map +0 -1
- package/dist/commands/campaign/compose.d.ts +0 -15
- package/dist/commands/campaign/compose.d.ts.map +0 -1
- package/dist/commands/campaign/compose.js +0 -110
- package/dist/commands/campaign/compose.js.map +0 -1
- package/dist/commands/campaign/index.d.ts +0 -13
- package/dist/commands/campaign/index.d.ts.map +0 -1
- package/dist/commands/campaign/index.js +0 -134
- package/dist/commands/campaign/index.js.map +0 -1
- package/dist/commands/campaign/kind-map.d.ts +0 -6
- package/dist/commands/campaign/kind-map.d.ts.map +0 -1
- package/dist/commands/campaign/kind-map.js +0 -21
- package/dist/commands/campaign/kind-map.js.map +0 -1
- package/dist/commands/campaign/mcp-server.d.ts +0 -6
- package/dist/commands/campaign/mcp-server.d.ts.map +0 -1
- package/dist/commands/campaign/mcp-server.js +0 -167
- package/dist/commands/campaign/mcp-server.js.map +0 -1
- package/dist/commands/campaign/render.d.ts +0 -5
- package/dist/commands/campaign/render.d.ts.map +0 -1
- package/dist/commands/campaign/render.js +0 -103
- package/dist/commands/campaign/render.js.map +0 -1
- package/dist/commands/campaign/trellis-load.d.ts +0 -13
- package/dist/commands/campaign/trellis-load.d.ts.map +0 -1
- package/dist/commands/campaign/trellis-load.js +0 -122
- package/dist/commands/campaign/trellis-load.js.map +0 -1
- package/dist/commands/campaign/types.d.ts +0 -61
- package/dist/commands/campaign/types.d.ts.map +0 -1
- package/dist/commands/campaign/types.js +0 -3
- package/dist/commands/campaign/types.js.map +0 -1
- package/dist/commands/goal/index.d.ts +0 -3
- package/dist/commands/goal/index.d.ts.map +0 -1
- package/dist/commands/goal/index.js +0 -159
- package/dist/commands/goal/index.js.map +0 -1
- package/dist/commands/goal/review.d.ts +0 -6
- package/dist/commands/goal/review.d.ts.map +0 -1
- package/dist/commands/goal/review.js +0 -28
- package/dist/commands/goal/review.js.map +0 -1
- package/dist/commands/rpc/client.d.ts +0 -51
- package/dist/commands/rpc/client.d.ts.map +0 -1
- package/dist/commands/rpc/client.js +0 -147
- package/dist/commands/rpc/client.js.map +0 -1
- package/dist/commands/rpc/index.d.ts +0 -10
- package/dist/commands/rpc/index.d.ts.map +0 -1
- package/dist/commands/rpc/index.js +0 -157
- package/dist/commands/rpc/index.js.map +0 -1
- package/dist/commands/rpc/serve.d.ts +0 -23
- package/dist/commands/rpc/serve.d.ts.map +0 -1
- package/dist/commands/rpc/serve.js +0 -60
- package/dist/commands/rpc/serve.js.map +0 -1
- package/dist/commands/rpc/smoke.d.ts +0 -16
- package/dist/commands/rpc/smoke.d.ts.map +0 -1
- package/dist/commands/rpc/smoke.js +0 -92
- package/dist/commands/rpc/smoke.js.map +0 -1
- package/dist/commands/sdk/index.d.ts +0 -9
- package/dist/commands/sdk/index.d.ts.map +0 -1
- package/dist/commands/sdk/index.js +0 -58
- package/dist/commands/sdk/index.js.map +0 -1
- package/dist/commands/sdk/run.d.ts +0 -42
- package/dist/commands/sdk/run.d.ts.map +0 -1
- package/dist/commands/sdk/run.js +0 -220
- package/dist/commands/sdk/run.js.map +0 -1
- package/dist/commands/sdk/status.d.ts +0 -14
- package/dist/commands/sdk/status.d.ts.map +0 -1
- package/dist/commands/sdk/status.js +0 -69
- package/dist/commands/sdk/status.js.map +0 -1
- package/dist/configurators/cursor2plus-local.d.ts +0 -6
- package/dist/configurators/cursor2plus-local.d.ts.map +0 -1
- package/dist/configurators/cursor2plus-local.js +0 -21
- package/dist/configurators/cursor2plus-local.js.map +0 -1
- package/dist/goal/action-packet.d.ts +0 -89
- package/dist/goal/action-packet.d.ts.map +0 -1
- package/dist/goal/action-packet.js +0 -113
- package/dist/goal/action-packet.js.map +0 -1
- package/dist/goal/audit.d.ts +0 -14
- package/dist/goal/audit.d.ts.map +0 -1
- package/dist/goal/audit.js +0 -12
- package/dist/goal/audit.js.map +0 -1
- package/dist/goal/constants.d.ts +0 -26
- package/dist/goal/constants.d.ts.map +0 -1
- package/dist/goal/constants.js +0 -24
- package/dist/goal/constants.js.map +0 -1
- package/dist/goal/paths.d.ts +0 -8
- package/dist/goal/paths.d.ts.map +0 -1
- package/dist/goal/paths.js +0 -36
- package/dist/goal/paths.js.map +0 -1
- package/dist/goal/preflight.d.ts +0 -21
- package/dist/goal/preflight.d.ts.map +0 -1
- package/dist/goal/preflight.js +0 -97
- package/dist/goal/preflight.js.map +0 -1
- package/dist/goal/review-seam.d.ts +0 -44
- package/dist/goal/review-seam.d.ts.map +0 -1
- package/dist/goal/review-seam.js +0 -153
- package/dist/goal/review-seam.js.map +0 -1
- package/dist/goal/reviewer-rules.d.ts +0 -13
- package/dist/goal/reviewer-rules.d.ts.map +0 -1
- package/dist/goal/reviewer-rules.js +0 -153
- package/dist/goal/reviewer-rules.js.map +0 -1
- package/dist/goal/reviewer.d.ts +0 -9
- package/dist/goal/reviewer.d.ts.map +0 -1
- package/dist/goal/reviewer.js +0 -54
- package/dist/goal/reviewer.js.map +0 -1
- package/dist/goal/runtime.d.ts +0 -32
- package/dist/goal/runtime.d.ts.map +0 -1
- package/dist/goal/runtime.js +0 -242
- package/dist/goal/runtime.js.map +0 -1
- package/dist/goal/sdk-client.d.ts +0 -10
- package/dist/goal/sdk-client.d.ts.map +0 -1
- package/dist/goal/sdk-client.js +0 -34
- package/dist/goal/sdk-client.js.map +0 -1
- package/dist/goal/state.d.ts +0 -40
- package/dist/goal/state.d.ts.map +0 -1
- package/dist/goal/state.js +0 -37
- package/dist/goal/state.js.map +0 -1
- package/dist/goal/task-triggers.d.ts +0 -15
- package/dist/goal/task-triggers.d.ts.map +0 -1
- package/dist/goal/task-triggers.js +0 -23
- package/dist/goal/task-triggers.js.map +0 -1
- package/dist/goal/walls.d.ts +0 -12
- package/dist/goal/walls.d.ts.map +0 -1
- package/dist/goal/walls.js +0 -65
- package/dist/goal/walls.js.map +0 -1
- package/dist/goal/worker-prompt.d.ts +0 -13
- package/dist/goal/worker-prompt.d.ts.map +0 -1
- package/dist/goal/worker-prompt.js +0 -41
- package/dist/goal/worker-prompt.js.map +0 -1
- package/dist/goal/worker.d.ts +0 -42
- package/dist/goal/worker.d.ts.map +0 -1
- package/dist/goal/worker.js +0 -180
- package/dist/goal/worker.js.map +0 -1
- package/dist/templates/common/bundled-skills/cstl-cursor2plus-setup/SKILL.md +0 -63
- package/dist/templates/cursor/commands/cursor2plus-setup.md +0 -82
- package/dist/templates/cursor/rules/cstl-cursor-modes.mdc +0 -32
- package/dist/templates/cursor/rules/cstl-session-rename.mdc +0 -31
- package/dist/templates/cursor/rules/cstl-subagent-dispatch.mdc +0 -34
- package/dist/templates/cursor/rules/cstl-triage.mdc +0 -36
- package/dist/templates/cursor/rules/retrieval-routing.mdc +0 -78
- package/dist/templates/markdown/spec/guides/cursor-trellis-release-coexistence-guide.md.txt +0 -166
- package/dist/templates/markdown/spec/guides/goal-release-regression-runbook.md.txt +0 -132
- package/dist/templates/trellis/local/README.md +0 -85
- package/dist/templates/trellis/local/config.local.json.example +0 -6
- package/dist/templates/trellis/local/index.d.ts +0 -8
- package/dist/templates/trellis/local/index.d.ts.map +0 -1
- package/dist/templates/trellis/local/index.js +0 -15
- package/dist/templates/trellis/local/index.js.map +0 -1
- package/dist/templates/trellis/local/patch_wpelc8.py +0 -421
- package/dist/templates/trellis/local/smoke.py +0 -94
- package/dist/templates/trellis/local/subagent-models.json.example +0 -4
- package/dist/templates/trellis/local/trellis-task-models.json.example +0 -10
- package/dist/templates/trellis/local/trellis-task-models.json5.example +0 -45
- package/dist/templates/trellis/local/trellis_task_models_config.py +0 -200
- package/dist/utils/cursor-sdk-gate.d.ts +0 -10
- package/dist/utils/cursor-sdk-gate.d.ts.map +0 -1
- package/dist/utils/cursor-sdk-gate.js +0 -32
- package/dist/utils/cursor-sdk-gate.js.map +0 -1
- /package/dist/templates/markdown/{spec/guides → framework}/artifact-locale-guide.md.txt +0 -0
- /package/dist/templates/markdown/{spec/guides → framework}/cursor-context-injection-guide.md.txt +0 -0
- /package/dist/templates/markdown/{spec/guides → framework}/cursor-semantic-compliance.md.txt +0 -0
- /package/dist/templates/markdown/{spec/guides → framework}/injection-budget-guide.md.txt +0 -0
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hash-safe cleanup of retired Cursor++ managed residue.
|
|
3
|
+
*
|
|
4
|
+
* Cursor++ product surfaces are no longer shipped. On `cstl update`, delete
|
|
5
|
+
* known managed paths only when on-disk content matches a pristine template
|
|
6
|
+
* hash captured from the last shipped SSOT bytes. User-modified files are
|
|
7
|
+
* preserved with a warning.
|
|
8
|
+
*
|
|
9
|
+
* Never target `.cstl/middleware/` (user overlay). Residue paths are an
|
|
10
|
+
* explicit allow-list; overlay isolation is a separate contract.
|
|
11
|
+
*/
|
|
12
|
+
import fs from "node:fs";
|
|
13
|
+
import path from "node:path";
|
|
14
|
+
import { DIR_NAMES } from "../constants/paths.js";
|
|
15
|
+
import { computeHash, removeHash } from "./template-hash.js";
|
|
16
|
+
import { resolveWorkflowDirName } from "./workflow-dir.js";
|
|
17
|
+
/**
|
|
18
|
+
* Pristine hashes computed from packages/cli/src/templates before P23 deletion
|
|
19
|
+
* (LF-normalized SHA-256, same as computeHash).
|
|
20
|
+
*/
|
|
21
|
+
export const CURSOR2PLUS_RESIDUE_TARGETS = [
|
|
22
|
+
{
|
|
23
|
+
pathTemplate: "{workflow}/local/cursor2plus/patch_wpelc8.py",
|
|
24
|
+
allowedHashes: [
|
|
25
|
+
"480d24cb0b5f98691938525db2e73326dfc9e2c70783fb3c357bc442f4d4c427",
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
pathTemplate: "{workflow}/local/cursor2plus/smoke.py",
|
|
30
|
+
allowedHashes: [
|
|
31
|
+
"e7eecc069188e1dde85312ac5271932e797a3af37c3ae1bd397bbbbfe4f9785b",
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
pathTemplate: "{workflow}/local/cursor2plus/README.md",
|
|
36
|
+
allowedHashes: [
|
|
37
|
+
"d170822a5f3d2bc01238ca4b9e72acb197b2678da7f5f9ffa0226e09fdb2a312",
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
pathTemplate: "{workflow}/local/cursor2plus/config.local.json.example",
|
|
42
|
+
allowedHashes: [
|
|
43
|
+
"b01b653f74fed06070232eca22f2daeb8c14bf7c99db21446f6ee1105f0ce016",
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
pathTemplate: "{workflow}/local/cursor2plus/trellis_task_models_config.py",
|
|
48
|
+
allowedHashes: [
|
|
49
|
+
"d27ebea2caeb52ec990a99c9e1c20c6a8265f65ceb95f28e01771b4efd6fa891",
|
|
50
|
+
],
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
pathTemplate: "{workflow}/local/subagent-models.json.example",
|
|
54
|
+
allowedHashes: [
|
|
55
|
+
"57212acbb4d2434f13ca5a7b40ec7ca00136870748943a92e8036d8b1e8e7434",
|
|
56
|
+
],
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
pathTemplate: "{workflow}/local/trellis-task-models.json.example",
|
|
60
|
+
allowedHashes: [
|
|
61
|
+
"10b74000b32020fbd5d3be73deeb61c066b51ea6fcfe7c1bba5883deb24fce65",
|
|
62
|
+
],
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
pathTemplate: "{workflow}/local/trellis-task-models.json5.example",
|
|
66
|
+
allowedHashes: [
|
|
67
|
+
"30c7bf1809065eecd9afcafd67ad36d32b5d3a5a3c07f54b9a58a22b4f34f267",
|
|
68
|
+
],
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
pathTemplate: ".cursor/commands/cstl-cursor2plus-setup.md",
|
|
72
|
+
allowedHashes: [
|
|
73
|
+
"7792337f85639e1bd0162d525056ee26cadb3400bf77e98d1a9bfe18d09d885c",
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
pathTemplate: ".cursor/skills/cstl-cursor2plus-setup/SKILL.md",
|
|
78
|
+
allowedHashes: [
|
|
79
|
+
"bc3e11e550caceab6fa3feb994bcc5c4fb45ee612feb5223b0212b061d136d16",
|
|
80
|
+
],
|
|
81
|
+
},
|
|
82
|
+
];
|
|
83
|
+
function resolvePathTemplate(pathTemplate, workflowDirName) {
|
|
84
|
+
return pathTemplate.replaceAll("{workflow}", workflowDirName);
|
|
85
|
+
}
|
|
86
|
+
function tryRemoveEmptyParents(filePath, stopAt) {
|
|
87
|
+
let dir = path.dirname(filePath);
|
|
88
|
+
const stop = path.resolve(stopAt);
|
|
89
|
+
while (dir.startsWith(stop) && dir !== stop) {
|
|
90
|
+
if (!fs.existsSync(dir)) {
|
|
91
|
+
dir = path.dirname(dir);
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
const entries = fs.readdirSync(dir);
|
|
95
|
+
if (entries.length > 0)
|
|
96
|
+
break;
|
|
97
|
+
fs.rmdirSync(dir);
|
|
98
|
+
dir = path.dirname(dir);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Delete pristine Cursor++ residue under cwd. Never deletes user-modified files.
|
|
103
|
+
*/
|
|
104
|
+
export function cleanupCursor2plusResidue(cwd, options = {}) {
|
|
105
|
+
const workflowDirName = resolveWorkflowDirName(cwd) ?? DIR_NAMES.WORKFLOW;
|
|
106
|
+
const result = {
|
|
107
|
+
deleted: [],
|
|
108
|
+
preservedModified: [],
|
|
109
|
+
missing: [],
|
|
110
|
+
};
|
|
111
|
+
for (const target of CURSOR2PLUS_RESIDUE_TARGETS) {
|
|
112
|
+
const rel = resolvePathTemplate(target.pathTemplate, workflowDirName);
|
|
113
|
+
const fullPath = path.join(cwd, rel);
|
|
114
|
+
if (!fs.existsSync(fullPath)) {
|
|
115
|
+
result.missing.push(rel);
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
const content = fs.readFileSync(fullPath, "utf-8");
|
|
119
|
+
const hash = computeHash(content);
|
|
120
|
+
if (!target.allowedHashes.includes(hash)) {
|
|
121
|
+
result.preservedModified.push(rel);
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
if (!options.dryRun) {
|
|
125
|
+
fs.unlinkSync(fullPath);
|
|
126
|
+
removeHash(cwd, rel);
|
|
127
|
+
tryRemoveEmptyParents(fullPath, cwd);
|
|
128
|
+
}
|
|
129
|
+
result.deleted.push(rel);
|
|
130
|
+
}
|
|
131
|
+
return result;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* True when any Cursor++ local bundle directory still exists (residue notice).
|
|
135
|
+
*/
|
|
136
|
+
export function hasCursor2plusBundleResidue(cwd) {
|
|
137
|
+
const workflowDirName = resolveWorkflowDirName(cwd) ?? DIR_NAMES.WORKFLOW;
|
|
138
|
+
const candidates = [
|
|
139
|
+
path.join(cwd, workflowDirName, "local", "cursor2plus"),
|
|
140
|
+
path.join(cwd, ".cstl", "local", "cursor2plus"),
|
|
141
|
+
path.join(cwd, ".trellis", "local", "cursor2plus"),
|
|
142
|
+
];
|
|
143
|
+
return candidates.some((p) => fs.existsSync(p));
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=cursor2plus-residue-cleanup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cursor2plus-residue-cleanup.js","sourceRoot":"","sources":["../../src/utils/cursor2plus-residue-cleanup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAS3D;;;GA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;IACjB,6EAA6E;IAC7E,MAAM,EAAE,cAAc,CAAC;CACxB;AA0DD,MAAM,WAAW,YAAY;IAC3B;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,MAAM,EACX,mBAAmB,EAAE,SAAS,MAAM,EAAE,EACtC,MAAM,EAAE,cAAc,EACtB,OAAO,GAAE,YAAiB,GACzB,WAAW,
|
|
1
|
+
{"version":3,"file":"manifest-prune.d.ts","sourceRoot":"","sources":["../../src/utils/manifest-prune.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAWH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAK5D,MAAM,WAAW,WAAW;IAC1B,0DAA0D;IAC1D,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,6EAA6E;IAC7E,MAAM,EAAE,cAAc,CAAC;CACxB;AA0DD,MAAM,WAAW,YAAY;IAC3B;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,MAAM,EACX,mBAAmB,EAAE,SAAS,MAAM,EAAE,EACtC,MAAM,EAAE,cAAc,EACtB,OAAO,GAAE,YAAiB,GACzB,WAAW,CAwCb"}
|
|
@@ -34,7 +34,7 @@ import fs from "node:fs";
|
|
|
34
34
|
import path from "node:path";
|
|
35
35
|
import { collectPlatformTemplates } from "../configurators/index.js";
|
|
36
36
|
import { getWorkflowRootTemplateFiles } from "../configurators/workflow.js";
|
|
37
|
-
import { FILE_NAMES } from "../constants/paths.js";
|
|
37
|
+
import { FILE_NAMES, isUserMiddlewareOverlayPath } from "../constants/paths.js";
|
|
38
38
|
import { getAllMigrations } from "../migrations/index.js";
|
|
39
39
|
import { saveHashes } from "./template-hash.js";
|
|
40
40
|
import { toPosix } from "./posix.js";
|
|
@@ -115,7 +115,12 @@ export function pruneOrphanManifestKeys(cwd, configuredPlatforms, hashes, option
|
|
|
115
115
|
const key = toPosix(rawKey);
|
|
116
116
|
// Always preserve .cstl/ entries — they're for the workflow tree
|
|
117
117
|
// which uninstall removes wholesale and which update needs for
|
|
118
|
-
// modified-file detection.
|
|
118
|
+
// modified-file detection. Exception: user middleware overlay must
|
|
119
|
+
// never stay in the template hash (poisoned or accidental).
|
|
120
|
+
if (isUserMiddlewareOverlayPath(key)) {
|
|
121
|
+
pruned.push(key);
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
119
124
|
if (key.startsWith(".cstl/") || key === ".cstl") {
|
|
120
125
|
kept[key] = value;
|
|
121
126
|
continue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest-prune.js","sourceRoot":"","sources":["../../src/utils/manifest-prune.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,4BAA4B,EAAE,MAAM,8BAA8B,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"manifest-prune.js","sourceRoot":"","sources":["../../src/utils/manifest-prune.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,4BAA4B,EAAE,MAAM,8BAA8B,CAAC;AAC5E,OAAO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IAAI,GAAG,KAAK,OAAO,EAAE,CAAC;YAChD,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;YAClB,SAAS;QACX,CAAC;QACD,IAAI,GAAG,KAAK,UAAU,CAAC,MAAM,EAAE,CAAC;YAC9B,IAAI,kBAAkB,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC5B,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;YACpB,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACnB,CAAC;YACD,SAAS;QACX,CAAC;QACD,IAAI,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YACnB,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;YAClB,SAAS;QACX,CAAC;QACD,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACnB,CAAC;IAED,IAAI,OAAO,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACjC,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IACxB,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* P36 official-surface A planner + vernacular summary for `cstl update`.
|
|
3
|
+
*
|
|
4
|
+
* Wave A refreshes unmodified shipped files (already owned by update hash
|
|
5
|
+
* analysis) and retires leftover extra always-on rules. User-modified
|
|
6
|
+
* official files are listed and kept. Wave C stop-read is confirm-gated
|
|
7
|
+
* on the same `cstl update` + one confirm.
|
|
8
|
+
*/
|
|
9
|
+
import { type ArtifactMigratePlan, type WaveCPlan } from "@blxzer/cursor-trellis-core/task";
|
|
10
|
+
import type { TemplateHashes } from "../types/migration.js";
|
|
11
|
+
export declare const RETIRED_ALWAYS_ON_RULES: readonly [".cursor/rules/cstl-triage.mdc", ".cursor/rules/trellis-triage.mdc", ".cursor/rules/cstl-subagent-dispatch.mdc", ".cursor/rules/trellis-subagent-dispatch.mdc", ".cursor/rules/retrieval-routing.mdc", ".cursor/rules/cstl-retrieval-routing.mdc", ".cursor/rules/trellis-retrieval-routing.mdc"];
|
|
12
|
+
export declare const KEEP_ALWAYS_ON_RULES: readonly [".cursor/rules/cstl-bootstrap.mdc"];
|
|
13
|
+
export type OfficialRetireAction = "retire" | "preserve";
|
|
14
|
+
export interface OfficialSurfaceItem {
|
|
15
|
+
path: string;
|
|
16
|
+
action: OfficialRetireAction;
|
|
17
|
+
reason: string;
|
|
18
|
+
}
|
|
19
|
+
export interface OfficialSurfacePlan {
|
|
20
|
+
refresh: string[];
|
|
21
|
+
preserved: string[];
|
|
22
|
+
added: string[];
|
|
23
|
+
retire: OfficialSurfaceItem[];
|
|
24
|
+
preserve: OfficialSurfaceItem[];
|
|
25
|
+
}
|
|
26
|
+
export interface P36UpgradePlan {
|
|
27
|
+
official: OfficialSurfacePlan;
|
|
28
|
+
artifacts: ArtifactMigratePlan;
|
|
29
|
+
writeArtifacts: boolean;
|
|
30
|
+
waveC: WaveCPlan;
|
|
31
|
+
vernacular: string[];
|
|
32
|
+
}
|
|
33
|
+
export declare function planOfficialSurfaceA(options: {
|
|
34
|
+
cwd: string;
|
|
35
|
+
hashes: TemplateHashes;
|
|
36
|
+
refresh: string[];
|
|
37
|
+
preserved: string[];
|
|
38
|
+
added?: string[];
|
|
39
|
+
}): OfficialSurfacePlan;
|
|
40
|
+
export declare function applyOfficialRetire(cwd: string, plan: OfficialSurfacePlan): number;
|
|
41
|
+
export declare function composeP36Plan(options: {
|
|
42
|
+
official: OfficialSurfacePlan;
|
|
43
|
+
artifacts: ArtifactMigratePlan;
|
|
44
|
+
writeArtifacts: boolean;
|
|
45
|
+
waveC: WaveCPlan;
|
|
46
|
+
}): P36UpgradePlan;
|
|
47
|
+
export declare function printP36Vernacular(plan: P36UpgradePlan): void;
|
|
48
|
+
export declare function officialWorkPending(plan: OfficialSurfacePlan): boolean;
|
|
49
|
+
export declare function waveCWorkPending(plan: P36UpgradePlan): boolean;
|
|
50
|
+
export declare function p36SummaryForRollout(plan: P36UpgradePlan): {
|
|
51
|
+
officialRefresh: number;
|
|
52
|
+
officialPreserved: number;
|
|
53
|
+
officialRetire: number;
|
|
54
|
+
artifactDualRead: number;
|
|
55
|
+
artifactWritable: number;
|
|
56
|
+
degraded: string[];
|
|
57
|
+
writeArtifacts: boolean;
|
|
58
|
+
waveCConfirmed: boolean;
|
|
59
|
+
leftoverCloseout: number;
|
|
60
|
+
alreadyNewShape: number;
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=p36-upgrade.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"p36-upgrade.d.ts","sourceRoot":"","sources":["../../src/utils/p36-upgrade.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAOH,OAAO,EAGL,KAAK,mBAAmB,EACxB,KAAK,SAAS,EACf,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAI5D,eAAO,MAAM,uBAAuB,6SAQ1B,CAAC;AAEX,eAAO,MAAM,oBAAoB,+CAAgD,CAAC;AAElF,MAAM,MAAM,oBAAoB,GAAG,QAAQ,GAAG,UAAU,CAAC;AAEzD,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,oBAAoB,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,MAAM,EAAE,mBAAmB,EAAE,CAAC;IAC9B,QAAQ,EAAE,mBAAmB,EAAE,CAAC;CACjC;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,mBAAmB,CAAC;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;CACzB,CAiBA"}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* P36 official-surface A planner + vernacular summary for `cstl update`.
|
|
3
|
+
*
|
|
4
|
+
* Wave A refreshes unmodified shipped files (already owned by update hash
|
|
5
|
+
* analysis) and retires leftover extra always-on rules. User-modified
|
|
6
|
+
* official files are listed and kept. Wave C stop-read is confirm-gated
|
|
7
|
+
* on the same `cstl update` + one confirm.
|
|
8
|
+
*/
|
|
9
|
+
import fs from "node:fs";
|
|
10
|
+
import path from "node:path";
|
|
11
|
+
import chalk from "chalk";
|
|
12
|
+
import { formatArtifactVernacular, formatWaveCVernacular, } from "@blxzer/cursor-trellis-core/task";
|
|
13
|
+
import { computeHash, removeHash } from "./template-hash.js";
|
|
14
|
+
import { toPosix } from "./posix.js";
|
|
15
|
+
export const RETIRED_ALWAYS_ON_RULES = [
|
|
16
|
+
".cursor/rules/cstl-triage.mdc",
|
|
17
|
+
".cursor/rules/trellis-triage.mdc",
|
|
18
|
+
".cursor/rules/cstl-subagent-dispatch.mdc",
|
|
19
|
+
".cursor/rules/trellis-subagent-dispatch.mdc",
|
|
20
|
+
".cursor/rules/retrieval-routing.mdc",
|
|
21
|
+
".cursor/rules/cstl-retrieval-routing.mdc",
|
|
22
|
+
".cursor/rules/trellis-retrieval-routing.mdc",
|
|
23
|
+
];
|
|
24
|
+
export const KEEP_ALWAYS_ON_RULES = [".cursor/rules/cstl-bootstrap.mdc"];
|
|
25
|
+
export function planOfficialSurfaceA(options) {
|
|
26
|
+
const retire = [];
|
|
27
|
+
const preserve = [];
|
|
28
|
+
for (const relativePath of RETIRED_ALWAYS_ON_RULES) {
|
|
29
|
+
const fullPath = path.join(options.cwd, relativePath);
|
|
30
|
+
if (!fs.existsSync(fullPath))
|
|
31
|
+
continue;
|
|
32
|
+
const posix = toPosix(relativePath);
|
|
33
|
+
const stored = options.hashes[posix] ?? options.hashes[relativePath];
|
|
34
|
+
let currentHash = null;
|
|
35
|
+
try {
|
|
36
|
+
currentHash = computeHash(fs.readFileSync(fullPath, "utf-8"));
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
preserve.push({
|
|
40
|
+
path: posix,
|
|
41
|
+
action: "preserve",
|
|
42
|
+
reason: "unreadable leftover",
|
|
43
|
+
});
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
const unmodified = Boolean(stored && stored === currentHash);
|
|
47
|
+
const knownUntracked = !stored && hasAlwaysApply(fullPath);
|
|
48
|
+
if (unmodified || knownUntracked) {
|
|
49
|
+
retire.push({
|
|
50
|
+
path: posix,
|
|
51
|
+
action: "retire",
|
|
52
|
+
reason: unmodified
|
|
53
|
+
? "unmodified shipped always-on"
|
|
54
|
+
: "known official always-on path",
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
preserve.push({
|
|
59
|
+
path: posix,
|
|
60
|
+
action: "preserve",
|
|
61
|
+
reason: "you edited this official file",
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
refresh: [...options.refresh],
|
|
67
|
+
preserved: [...options.preserved],
|
|
68
|
+
added: [...(options.added ?? [])],
|
|
69
|
+
retire,
|
|
70
|
+
preserve,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
export function applyOfficialRetire(cwd, plan) {
|
|
74
|
+
let deleted = 0;
|
|
75
|
+
for (const item of plan.retire) {
|
|
76
|
+
const fullPath = path.join(cwd, item.path);
|
|
77
|
+
if (!fs.existsSync(fullPath))
|
|
78
|
+
continue;
|
|
79
|
+
fs.unlinkSync(fullPath);
|
|
80
|
+
try {
|
|
81
|
+
removeHash(cwd, item.path);
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
// Hash store is optional in unit fixtures; retiring the file is enough.
|
|
85
|
+
}
|
|
86
|
+
deleted += 1;
|
|
87
|
+
}
|
|
88
|
+
return deleted;
|
|
89
|
+
}
|
|
90
|
+
export function composeP36Plan(options) {
|
|
91
|
+
const officialCount = options.official.refresh.length +
|
|
92
|
+
options.official.added.length +
|
|
93
|
+
options.official.retire.length;
|
|
94
|
+
const preservedCount = options.official.preserved.length + options.official.preserve.length;
|
|
95
|
+
const vernacular = [
|
|
96
|
+
`官方面:将刷新 ${officialCount} 个未改过的官方文件/规则;你改过的 ${preservedCount} 个已保留。`,
|
|
97
|
+
"--force / --skip-all / --create-new 会套官方文件,但不写 .p36-wave-c.json;只有交互确认 Proceed? 才停读。",
|
|
98
|
+
...formatArtifactVernacular(options.artifacts, options.writeArtifacts),
|
|
99
|
+
...formatWaveCVernacular(options.waveC),
|
|
100
|
+
];
|
|
101
|
+
return {
|
|
102
|
+
official: options.official,
|
|
103
|
+
artifacts: options.artifacts,
|
|
104
|
+
writeArtifacts: options.writeArtifacts,
|
|
105
|
+
waveC: options.waveC,
|
|
106
|
+
vernacular,
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
export function printP36Vernacular(plan) {
|
|
110
|
+
console.log(chalk.cyan("升级摘要"));
|
|
111
|
+
for (const line of plan.vernacular) {
|
|
112
|
+
console.log(` ${line}`);
|
|
113
|
+
}
|
|
114
|
+
if (plan.official.preserve.length > 0) {
|
|
115
|
+
console.log(chalk.yellow(" 你改过、已保留:"));
|
|
116
|
+
for (const item of plan.official.preserve) {
|
|
117
|
+
console.log(chalk.yellow(` ? ${item.path}`));
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
if (plan.official.preserved.length > 0 && plan.official.preserve.length === 0) {
|
|
121
|
+
console.log(chalk.yellow(" 你改过、已保留:"));
|
|
122
|
+
for (const relativePath of plan.official.preserved.slice(0, 8)) {
|
|
123
|
+
console.log(chalk.yellow(` ? ${relativePath}`));
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
console.log("");
|
|
127
|
+
}
|
|
128
|
+
export function officialWorkPending(plan) {
|
|
129
|
+
return (plan.refresh.length > 0 ||
|
|
130
|
+
plan.added.length > 0 ||
|
|
131
|
+
plan.retire.length > 0);
|
|
132
|
+
}
|
|
133
|
+
export function waveCWorkPending(plan) {
|
|
134
|
+
return !plan.waveC.confirmed;
|
|
135
|
+
}
|
|
136
|
+
export function p36SummaryForRollout(plan) {
|
|
137
|
+
return {
|
|
138
|
+
officialRefresh: plan.official.refresh.length +
|
|
139
|
+
plan.official.added.length +
|
|
140
|
+
plan.official.retire.length,
|
|
141
|
+
officialPreserved: plan.official.preserved.length + plan.official.preserve.length,
|
|
142
|
+
officialRetire: plan.official.retire.length,
|
|
143
|
+
artifactDualRead: plan.artifacts.activeDualRead,
|
|
144
|
+
artifactWritable: plan.writeArtifacts ? plan.artifacts.writable.length : 0,
|
|
145
|
+
degraded: plan.artifacts.degraded,
|
|
146
|
+
writeArtifacts: plan.writeArtifacts,
|
|
147
|
+
waveCConfirmed: plan.waveC.confirmed,
|
|
148
|
+
leftoverCloseout: plan.waveC.leftoverCloseout,
|
|
149
|
+
alreadyNewShape: plan.waveC.alreadyNewShape,
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
function hasAlwaysApply(fullPath) {
|
|
153
|
+
try {
|
|
154
|
+
return /alwaysApply:\s*true/.test(fs.readFileSync(fullPath, "utf-8"));
|
|
155
|
+
}
|
|
156
|
+
catch {
|
|
157
|
+
return false;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
//# sourceMappingURL=p36-upgrade.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"p36-upgrade.js","sourceRoot":"","sources":["../../src/utils/p36-upgrade.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EACL,wBAAwB,EACxB,qBAAqB,GAGtB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MA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CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM;QAChE,cAAc,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM;QAC3C,gBAAgB,EAAE,IAAI,CAAC,SAAS,CAAC,cAAc;QAC/C,gBAAgB,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAC1E,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ;QACjC,cAAc,EAAE,IAAI,CAAC,cAAc;QACnC,cAAc,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS;QACpC,gBAAgB,EAAE,IAAI,CAAC,KAAK,CAAC,gBAAgB;QAC7C,eAAe,EAAE,IAAI,CAAC,KAAK,CAAC,eAAe;KAC5C,CAAC;AACJ,CAAC;AAED,SAAS,cAAc,CAAC,QAAgB;IACtC,IAAI,CAAC;QACH,OAAO,qBAAqB,CAAC,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;IACxE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AITool } from "../types/ai-tools.js";
|
|
2
|
-
export declare const PROJECT_CAPABILITY_IDS: readonly ["codebase-retrieval", "github-mcp", "playwright-mcp"
|
|
2
|
+
export declare const PROJECT_CAPABILITY_IDS: readonly ["codebase-retrieval", "github-mcp", "playwright-mcp"];
|
|
3
3
|
export type ProjectCapabilityId = (typeof PROJECT_CAPABILITY_IDS)[number];
|
|
4
4
|
export interface McpServerTemplate {
|
|
5
5
|
name: string;
|
|
@@ -50,17 +50,6 @@ export declare function getProjectCapabilityChoices(): {
|
|
|
50
50
|
id: ProjectCapabilityId;
|
|
51
51
|
name: string;
|
|
52
52
|
}[];
|
|
53
|
-
export type CursorSdkSelectionGateResult = {
|
|
54
|
-
selected: ProjectCapabilityId[];
|
|
55
|
-
skippedSdk: boolean;
|
|
56
|
-
enabledSdk: boolean;
|
|
57
|
-
message: string | null;
|
|
58
|
-
};
|
|
59
|
-
/**
|
|
60
|
-
* D1: keep `cursor-sdk` visible in UI, but drop it from the effective
|
|
61
|
-
* selection when CURSOR_API_KEY is missing (skip enablement + guidance).
|
|
62
|
-
*/
|
|
63
|
-
export declare function applyCursorSdkSelectionGate(selected: readonly ProjectCapabilityId[], env?: NodeJS.ProcessEnv): CursorSdkSelectionGateResult;
|
|
64
53
|
export declare function renderCapabilitiesJson(selected: readonly ProjectCapabilityId[], states?: Partial<Record<ProjectCapabilityId, StoredCapabilityState>>): string;
|
|
65
54
|
export declare function getProjectCapability(id: ProjectCapabilityId): ProjectCapability;
|
|
66
55
|
export declare function renderCapabilitiesMarkdown(selected: readonly ProjectCapabilityId[], states?: Partial<Record<ProjectCapabilityId, StoredCapabilityState>>): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-capabilities.d.ts","sourceRoot":"","sources":["../../src/utils/project-capabilities.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"project-capabilities.d.ts","sourceRoot":"","sources":["../../src/utils/project-capabilities.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAGnD,eAAO,MAAM,sBAAsB,iEAIzB,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1E,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,gBAAgB;IAC/B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