@blxzer/cursor-trellis 0.4.2 → 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 +24 -0
- package/README.md +23 -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 +137 -40
- 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 +2 -4
- package/dist/configurators/workflow.js.map +1 -1
- package/dist/constants/paths.d.ts +9 -0
- package/dist/constants/paths.d.ts.map +1 -1
- package/dist/constants/paths.js +13 -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-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 +5 -4
- 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/cursor/agents/cstl-research.md +1 -1
- 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 +15 -10
- package/dist/templates/markdown/framework/cursor-native-modes-guide.md.txt +12 -9
- package/dist/templates/markdown/framework/cursor-subagent-policy.md.txt +62 -126
- package/dist/templates/markdown/framework/dogfood-only-surfaces.md.txt +4 -6
- package/dist/templates/markdown/framework/execution-strategy.md.txt +2 -0
- package/dist/templates/markdown/framework/index.md.txt +4 -0
- package/dist/templates/markdown/framework/internal-skills-cursor-reachability.md.txt +4 -3
- 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/release-boundary.md.txt +30 -0
- package/dist/templates/markdown/framework/retrieval-daily-guide.md.txt +1 -1
- package/dist/templates/markdown/framework/upgrade.md.txt +15 -0
- package/dist/templates/markdown/index.d.ts +4 -0
- package/dist/templates/markdown/index.d.ts.map +1 -1
- package/dist/templates/markdown/index.js +17 -0
- package/dist/templates/markdown/index.js.map +1 -1
- package/dist/templates/markdown/spec/guides/index.md.txt +0 -6
- 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 +18 -1
- package/dist/templates/trellis/CONTEXT.md +63 -3
- 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 +286 -56
- 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_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/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 +100 -18
- 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/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/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
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""Cursor++ local bundle smoke check — whitelist metadata only, no secret reads."""
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
|
|
5
|
-
import json
|
|
6
|
-
import os
|
|
7
|
-
import sys
|
|
8
|
-
from pathlib import Path
|
|
9
|
-
|
|
10
|
-
from patch_wpelc8 import (
|
|
11
|
-
MARKER,
|
|
12
|
-
_load_config,
|
|
13
|
-
configured_slot_map,
|
|
14
|
-
probe_wpelc8_compat,
|
|
15
|
-
try_resolve_extension_js,
|
|
16
|
-
)
|
|
17
|
-
|
|
18
|
-
CAVEATS = [
|
|
19
|
-
"Cursor++ is third-party; reverse-engineering is version-bound",
|
|
20
|
-
"Never reads BYOK provider catalog file contents",
|
|
21
|
-
"Patch is operator-only; not part of CI or default Trellis workflow",
|
|
22
|
-
"Re-verify after any Cursor or Cursor++ upgrade",
|
|
23
|
-
]
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
def detect_env() -> tuple[str, str | None]:
|
|
27
|
-
env_flag = os.environ.get("TRELLIS_CURSOR_BYOK", "").strip()
|
|
28
|
-
if env_flag == "1":
|
|
29
|
-
return "byok", "TRELLIS_CURSOR_BYOK=1"
|
|
30
|
-
if env_flag == "0":
|
|
31
|
-
return "native", "TRELLIS_CURSOR_BYOK=0"
|
|
32
|
-
|
|
33
|
-
routes = Path.home() / ".ccursor" / "routes.json"
|
|
34
|
-
if routes.is_file():
|
|
35
|
-
try:
|
|
36
|
-
data = json.loads(routes.read_text(encoding="utf-8"))
|
|
37
|
-
byok = data.get("byokMode")
|
|
38
|
-
if byok in (1, "1", True):
|
|
39
|
-
return "byok", "routes.json:byokMode"
|
|
40
|
-
if byok in (0, "0", False):
|
|
41
|
-
return "native", "routes.json:byokMode"
|
|
42
|
-
except (OSError, json.JSONDecodeError, TypeError):
|
|
43
|
-
pass
|
|
44
|
-
return "unknown", None
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
def detect_patch_status(bundle_dir: Path, config: dict) -> tuple[str, dict[str, object]]:
|
|
48
|
-
extension = try_resolve_extension_js(bundle_dir, config)
|
|
49
|
-
meta: dict[str, object] = {"extension": str(extension) if extension else None}
|
|
50
|
-
if extension is None:
|
|
51
|
-
return "not-applied", meta
|
|
52
|
-
|
|
53
|
-
source = extension.read_text(encoding="utf-8", errors="ignore")
|
|
54
|
-
marker_present = MARKER in source
|
|
55
|
-
meta["patch_marker_present"] = marker_present
|
|
56
|
-
probe = probe_wpelc8_compat(source)
|
|
57
|
-
meta.update(probe)
|
|
58
|
-
|
|
59
|
-
if not marker_present:
|
|
60
|
-
return "not-applied", meta
|
|
61
|
-
|
|
62
|
-
if probe["wpelc8"] == "not_locatable" or probe["inject_anchor"] == "missing":
|
|
63
|
-
return "stale", meta
|
|
64
|
-
if probe["wpelc8"] == "unknown" or probe["inject_anchor"] == "unknown":
|
|
65
|
-
return "stale", meta
|
|
66
|
-
return "applied", meta
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
def main() -> int:
|
|
70
|
-
bundle_dir = Path(__file__).resolve().parent
|
|
71
|
-
config = _load_config(bundle_dir)
|
|
72
|
-
env, env_source = detect_env()
|
|
73
|
-
patch_status, patch_meta = detect_patch_status(bundle_dir, config)
|
|
74
|
-
slots = configured_slot_map(bundle_dir, config)
|
|
75
|
-
|
|
76
|
-
report = {
|
|
77
|
-
"env": env,
|
|
78
|
-
"env_source": env_source,
|
|
79
|
-
"patch_status": patch_status,
|
|
80
|
-
"patch_meta": patch_meta,
|
|
81
|
-
"current_map": {
|
|
82
|
-
"configured_roles": {
|
|
83
|
-
role: {"candidates": names} for role, names in sorted(slots.items())
|
|
84
|
-
},
|
|
85
|
-
"note": "Role names from user JSON5 config only; slugs not resolved (no provider catalog read)",
|
|
86
|
-
},
|
|
87
|
-
"caveats": CAVEATS,
|
|
88
|
-
}
|
|
89
|
-
print(json.dumps(report, indent=2, sort_keys=True))
|
|
90
|
-
return 0
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
if __name__ == "__main__":
|
|
94
|
-
raise SystemExit(main())
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"_comment": "Copy to ~/.ccursor/trellis-task-models.json (Windows: %USERPROFILE%\\.ccursor\\). Values: use apiModel or displayName from Cursor++ — patch_wpelc8.py resolves to slug at patch time. Optional keys: omit types you do not use.",
|
|
3
|
-
"_when_providers_change": "Run: python patch_wpelc8.py --list-models then fix this file and patch again.",
|
|
4
|
-
"cstl-research": "glm-5.1",
|
|
5
|
-
"cstl-implement": "qwen3.6-plus",
|
|
6
|
-
"cstl-check": "qwen3.7-max",
|
|
7
|
-
"generalPurpose": "gpt-5.5",
|
|
8
|
-
"shell": "grok-composer-2.5-fast",
|
|
9
|
-
"best-of-n-runner": "kimi-k2.7-code"
|
|
10
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
// Trellis + Cursor++ BYOK — Task 子代理模型路由(由 Agent 在 init 时协助填写)
|
|
2
|
-
// 复制到: Windows %USERPROFILE%\.ccursor\trellis-task-models.json5
|
|
3
|
-
// Linux/macOS ~/.ccursor/trellis-task-models.json5
|
|
4
|
-
//
|
|
5
|
-
// 用户:只说明「每个场景想用哪个模型」(Cursor++ 里显示的名字即可)
|
|
6
|
-
// Agent:运行 list-models → 写入本文件(保留注释)→ patch_wpelc8.py
|
|
7
|
-
//
|
|
8
|
-
// primary / fallback:providers.json 变更时,首选解析失败会自动用备选(WARN,不中断)
|
|
9
|
-
// Explore 子代理不在此文件 — 用 Cursor++ 面板单独选
|
|
10
|
-
|
|
11
|
-
{
|
|
12
|
-
"models": {
|
|
13
|
-
// Trellis 调研(Task cstl-research)
|
|
14
|
-
"cstl-research": {
|
|
15
|
-
"primary": "glm-5.1",
|
|
16
|
-
"fallback": "qwen3.7-max"
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
// Trellis 实现;Parent generate-child-prompt --mode subagent 默认派发此类型
|
|
20
|
-
"cstl-implement": {
|
|
21
|
-
"primary": "qwen3.6-plus",
|
|
22
|
-
"fallback": "kimi-k2.7-code"
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
// Trellis 验收(Task cstl-check)
|
|
26
|
-
"cstl-check": {
|
|
27
|
-
"primary": "qwen3.7-max",
|
|
28
|
-
"fallback": "glm-5.1"
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
// Cursor 内置 Task(可按需删掉不用的项)
|
|
32
|
-
"generalPurpose": {
|
|
33
|
-
"primary": "gpt-5.5",
|
|
34
|
-
"fallback": "glm-5.1"
|
|
35
|
-
},
|
|
36
|
-
"shell": {
|
|
37
|
-
"primary": "grok-composer-2.5-fast",
|
|
38
|
-
"fallback": "gpt-5.5"
|
|
39
|
-
},
|
|
40
|
-
"best-of-n-runner": {
|
|
41
|
-
"primary": "kimi-k2.7-code",
|
|
42
|
-
"fallback": "qwen3.6-plus"
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
"""Load trellis-task-models (JSON5) and resolve primary/fallback against providers.json."""
|
|
2
|
-
from __future__ import annotations
|
|
3
|
-
|
|
4
|
-
import json
|
|
5
|
-
from pathlib import Path
|
|
6
|
-
from typing import Any
|
|
7
|
-
|
|
8
|
-
KNOWN_SUBAGENT_TYPES = (
|
|
9
|
-
"cstl-research",
|
|
10
|
-
"cstl-implement",
|
|
11
|
-
"cstl-check",
|
|
12
|
-
"generalPurpose",
|
|
13
|
-
"shell",
|
|
14
|
-
"best-of-n-runner",
|
|
15
|
-
)
|
|
16
|
-
|
|
17
|
-
SUBAGENT_TYPE_HELP: dict[str, str] = {
|
|
18
|
-
"cstl-research": "Trellis 调研 Task(cstl-research)",
|
|
19
|
-
"cstl-implement": "Trellis 实现 Task;Parent/Child 默认派发类型",
|
|
20
|
-
"cstl-check": "Trellis 验收 Task(cstl-check)",
|
|
21
|
-
"generalPurpose": "Cursor 内置 Task:generalPurpose",
|
|
22
|
-
"shell": "Cursor 内置 Task:shell",
|
|
23
|
-
"best-of-n-runner": "Cursor 内置 Task:best-of-n-runner",
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
def strip_json5_comments(text: str) -> str:
|
|
28
|
-
out: list[str] = []
|
|
29
|
-
i = 0
|
|
30
|
-
n = len(text)
|
|
31
|
-
in_string = False
|
|
32
|
-
escape = False
|
|
33
|
-
while i < n:
|
|
34
|
-
c = text[i]
|
|
35
|
-
if in_string:
|
|
36
|
-
out.append(c)
|
|
37
|
-
if escape:
|
|
38
|
-
escape = False
|
|
39
|
-
elif c == "\\":
|
|
40
|
-
escape = True
|
|
41
|
-
elif c == '"':
|
|
42
|
-
in_string = False
|
|
43
|
-
i += 1
|
|
44
|
-
continue
|
|
45
|
-
if c == '"':
|
|
46
|
-
in_string = True
|
|
47
|
-
out.append(c)
|
|
48
|
-
i += 1
|
|
49
|
-
continue
|
|
50
|
-
if c == "/" and i + 1 < n:
|
|
51
|
-
nxt = text[i + 1]
|
|
52
|
-
if nxt == "/":
|
|
53
|
-
while i < n and text[i] != "\n":
|
|
54
|
-
i += 1
|
|
55
|
-
continue
|
|
56
|
-
if nxt == "*":
|
|
57
|
-
i += 2
|
|
58
|
-
while i + 1 < n and not (text[i] == "*" and text[i + 1] == "/"):
|
|
59
|
-
i += 1
|
|
60
|
-
i = min(i + 2, n)
|
|
61
|
-
continue
|
|
62
|
-
out.append(c)
|
|
63
|
-
i += 1
|
|
64
|
-
return "".join(out)
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
def load_providers_catalog(
|
|
68
|
-
providers_path: Path,
|
|
69
|
-
) -> tuple[dict[str, dict], dict[str, str]]:
|
|
70
|
-
by_slug: dict[str, dict] = {}
|
|
71
|
-
alias_to_slug: dict[str, str] = {}
|
|
72
|
-
if not providers_path.is_file():
|
|
73
|
-
return by_slug, alias_to_slug
|
|
74
|
-
try:
|
|
75
|
-
root = json.loads(providers_path.read_text(encoding="utf-8"))
|
|
76
|
-
except (OSError, json.JSONDecodeError):
|
|
77
|
-
return by_slug, alias_to_slug
|
|
78
|
-
for prov in root.get("providers") or []:
|
|
79
|
-
if not isinstance(prov, dict):
|
|
80
|
-
continue
|
|
81
|
-
pname = prov.get("name") or prov.get("id") or "?"
|
|
82
|
-
for m in prov.get("models") or []:
|
|
83
|
-
if not isinstance(m, dict):
|
|
84
|
-
continue
|
|
85
|
-
slug = m.get("id")
|
|
86
|
-
if not isinstance(slug, str) or not slug.strip():
|
|
87
|
-
continue
|
|
88
|
-
slug = slug.strip()
|
|
89
|
-
row = {
|
|
90
|
-
"slug": slug,
|
|
91
|
-
"apiModel": m.get("apiModel") or "",
|
|
92
|
-
"displayName": m.get("displayName") or "",
|
|
93
|
-
"provider": pname,
|
|
94
|
-
}
|
|
95
|
-
by_slug[slug] = row
|
|
96
|
-
for field in ("id", "apiModel", "displayName"):
|
|
97
|
-
val = m.get(field)
|
|
98
|
-
if isinstance(val, str) and val.strip():
|
|
99
|
-
key = val.strip().lower()
|
|
100
|
-
if key not in alias_to_slug:
|
|
101
|
-
alias_to_slug[key] = slug
|
|
102
|
-
return by_slug, alias_to_slug
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
def resolve_one_alias(
|
|
106
|
-
raw: str,
|
|
107
|
-
by_slug: dict[str, dict],
|
|
108
|
-
alias_to_slug: dict[str, str],
|
|
109
|
-
) -> str | None:
|
|
110
|
-
if raw in by_slug:
|
|
111
|
-
return raw
|
|
112
|
-
key = raw.strip().lower()
|
|
113
|
-
if key in alias_to_slug:
|
|
114
|
-
return alias_to_slug[key]
|
|
115
|
-
return None
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
def _coerce_slot(value: Any) -> list[str]:
|
|
119
|
-
if value is None:
|
|
120
|
-
return []
|
|
121
|
-
if isinstance(value, str) and value.strip():
|
|
122
|
-
return [value.strip()]
|
|
123
|
-
if isinstance(value, list):
|
|
124
|
-
out: list[str] = []
|
|
125
|
-
for item in value:
|
|
126
|
-
if isinstance(item, str) and item.strip():
|
|
127
|
-
out.append(item.strip())
|
|
128
|
-
return out
|
|
129
|
-
return []
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
def load_task_models_document(path: Path) -> dict[str, Any]:
|
|
133
|
-
if not path.is_file():
|
|
134
|
-
return {}
|
|
135
|
-
text = path.read_text(encoding="utf-8")
|
|
136
|
-
try:
|
|
137
|
-
data = json.loads(strip_json5_comments(text))
|
|
138
|
-
except json.JSONDecodeError:
|
|
139
|
-
return {}
|
|
140
|
-
return data if isinstance(data, dict) else {}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
def extract_raw_slots(doc: dict[str, Any]) -> dict[str, list[str]]:
|
|
144
|
-
"""subagent_type -> ordered candidates [primary, fallback, ...]."""
|
|
145
|
-
slots: dict[str, list[str]] = {}
|
|
146
|
-
for key, value in doc.items():
|
|
147
|
-
if not isinstance(key, str) or key.startswith("_"):
|
|
148
|
-
continue
|
|
149
|
-
if key == "models" and isinstance(value, dict):
|
|
150
|
-
for st, spec in value.items():
|
|
151
|
-
if not isinstance(st, str) or st.startswith("_"):
|
|
152
|
-
continue
|
|
153
|
-
if isinstance(spec, dict):
|
|
154
|
-
candidates = _coerce_slot(spec.get("primary"))
|
|
155
|
-
candidates.extend(_coerce_slot(spec.get("fallback")))
|
|
156
|
-
candidates.extend(_coerce_slot(spec.get("fallbacks")))
|
|
157
|
-
else:
|
|
158
|
-
candidates = _coerce_slot(spec)
|
|
159
|
-
if candidates:
|
|
160
|
-
slots[st] = candidates
|
|
161
|
-
continue
|
|
162
|
-
candidates = _coerce_slot(value)
|
|
163
|
-
if candidates:
|
|
164
|
-
slots[key] = candidates
|
|
165
|
-
return slots
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
def resolve_slots_to_slugs(
|
|
169
|
-
slots: dict[str, list[str]],
|
|
170
|
-
providers_path: Path,
|
|
171
|
-
) -> tuple[dict[str, str], list[str]]:
|
|
172
|
-
by_slug, alias_to_slug = load_providers_catalog(providers_path)
|
|
173
|
-
resolved: dict[str, str] = {}
|
|
174
|
-
notes: list[str] = []
|
|
175
|
-
for subagent_type, candidates in sorted(slots.items()):
|
|
176
|
-
chosen_slug: str | None = None
|
|
177
|
-
used_label: str | None = None
|
|
178
|
-
for idx, cand in enumerate(candidates):
|
|
179
|
-
slug = resolve_one_alias(cand, by_slug, alias_to_slug)
|
|
180
|
-
if slug:
|
|
181
|
-
chosen_slug = slug
|
|
182
|
-
used_label = cand
|
|
183
|
-
if idx > 0:
|
|
184
|
-
notes.append(
|
|
185
|
-
f" WARN {subagent_type}: primary unavailable; using fallback "
|
|
186
|
-
f"{cand!r} → {slug}"
|
|
187
|
-
)
|
|
188
|
-
elif len(candidates) > 1:
|
|
189
|
-
row = by_slug.get(slug, {})
|
|
190
|
-
label = row.get("displayName") or row.get("apiModel") or cand
|
|
191
|
-
notes.append(f" OK {subagent_type}: {cand!r} → {slug} ({label})")
|
|
192
|
-
break
|
|
193
|
-
if chosen_slug:
|
|
194
|
-
resolved[subagent_type] = chosen_slug
|
|
195
|
-
else:
|
|
196
|
-
tried = ", ".join(repr(c) for c in candidates)
|
|
197
|
-
notes.append(
|
|
198
|
-
f" ERROR {subagent_type}: no match for [{tried}] in providers.json"
|
|
199
|
-
)
|
|
200
|
-
return resolved, notes
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cursor SDK capability gate (productization): env probe + user-facing guidance.
|
|
3
|
-
* Never echoes the key value. Never writes secrets to the repo.
|
|
4
|
-
*/
|
|
5
|
-
export declare function hasCursorApiKey(env?: NodeJS.ProcessEnv): boolean;
|
|
6
|
-
/** Multi-line guide for missing CURSOR_API_KEY (init/update / sdk status). */
|
|
7
|
-
export declare function cursorApiKeySetupGuide(): string;
|
|
8
|
-
export declare function formatCursorSdkSkippedMessage(): string;
|
|
9
|
-
export declare function formatCursorSdkEnabledMessage(): string;
|
|
10
|
-
//# sourceMappingURL=cursor-sdk-gate.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cursor-sdk-gate.d.ts","sourceRoot":"","sources":["../../src/utils/cursor-sdk-gate.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,wBAAgB,eAAe,CAC7B,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,OAAO,CAET;AAED,8EAA8E;AAC9E,wBAAgB,sBAAsB,IAAI,MAAM,CAS/C;AAED,wBAAgB,6BAA6B,IAAI,MAAM,CAKtD;AAED,wBAAgB,6BAA6B,IAAI,MAAM,CAMtD"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cursor SDK capability gate (productization): env probe + user-facing guidance.
|
|
3
|
-
* Never echoes the key value. Never writes secrets to the repo.
|
|
4
|
-
*/
|
|
5
|
-
export function hasCursorApiKey(env = process.env) {
|
|
6
|
-
return Boolean(env.CURSOR_API_KEY?.trim());
|
|
7
|
-
}
|
|
8
|
-
/** Multi-line guide for missing CURSOR_API_KEY (init/update / sdk status). */
|
|
9
|
-
export function cursorApiKeySetupGuide() {
|
|
10
|
-
return [
|
|
11
|
-
"Cursor SDK live capability requires CURSOR_API_KEY in the current process environment.",
|
|
12
|
-
"Set it for your shell/session (user-level env or secret store) — never commit the key to the repo.",
|
|
13
|
-
"PowerShell example: $env:CURSOR_API_KEY = '<your-key>'",
|
|
14
|
-
"Then re-run init/update capability selection, or: cstl sdk status",
|
|
15
|
-
"Reminder: SDK live billing/privacy is a separate channel from Cursor IDE Native API vs Cursor++ BYOK model routing.",
|
|
16
|
-
"Until a key is set, cstl sdk run --mock still works; --live will refuse.",
|
|
17
|
-
].join("\n");
|
|
18
|
-
}
|
|
19
|
-
export function formatCursorSdkSkippedMessage() {
|
|
20
|
-
return [
|
|
21
|
-
"Skipped enabling capability `cursor-sdk` (CURSOR_API_KEY not set).",
|
|
22
|
-
cursorApiKeySetupGuide(),
|
|
23
|
-
].join("\n");
|
|
24
|
-
}
|
|
25
|
-
export function formatCursorSdkEnabledMessage() {
|
|
26
|
-
return [
|
|
27
|
-
"Enabled capability `cursor-sdk` (CURSOR_API_KEY is present in this process).",
|
|
28
|
-
"Use `cstl sdk status` to re-check, and `cstl sdk run --task <path> --live` only after you accept billing/privacy risk.",
|
|
29
|
-
"Native vs BYOK IDE routing does not replace CURSOR_API_KEY for SDK live runs.",
|
|
30
|
-
].join("\n");
|
|
31
|
-
}
|
|
32
|
-
//# sourceMappingURL=cursor-sdk-gate.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cursor-sdk-gate.js","sourceRoot":"","sources":["../../src/utils/cursor-sdk-gate.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,UAAU,eAAe,CAC7B,MAAyB,OAAO,CAAC,GAAG;IAEpC,OAAO,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC;AAC7C,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,sBAAsB;IACpC,OAAO;QACL,wFAAwF;QACxF,oGAAoG;QACpG,wDAAwD;QACxD,mEAAmE;QACnE,qHAAqH;QACrH,0EAA0E;KAC3E,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED,MAAM,UAAU,6BAA6B;IAC3C,OAAO;QACL,oEAAoE;QACpE,sBAAsB,EAAE;KACzB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED,MAAM,UAAU,6BAA6B;IAC3C,OAAO;QACL,8EAA8E;QAC9E,wHAAwH;QACxH,+EAA+E;KAChF,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
|