@blxzer/cursor-trellis 0.3.0 → 0.3.2
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 +30 -0
- package/README.md +51 -10
- package/README.zh-CN.md +21 -7
- package/bin/cstl.js +1 -1
- package/bin/smart-search.js +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +17 -15
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/capability-smoke.js +2 -2
- package/dist/commands/capability-smoke.js.map +1 -1
- package/dist/commands/channel/agent-loader.d.ts +1 -1
- package/dist/commands/channel/agent-loader.js +4 -4
- package/dist/commands/channel/agent-loader.js.map +1 -1
- package/dist/commands/channel/guard.d.ts +2 -2
- package/dist/commands/channel/guard.js +3 -3
- package/dist/commands/channel/guard.js.map +1 -1
- package/dist/commands/channel/index.js +3 -3
- package/dist/commands/channel/index.js.map +1 -1
- package/dist/commands/channel/list.d.ts +1 -1
- package/dist/commands/channel/list.js +1 -1
- package/dist/commands/channel/rm.d.ts +1 -1
- package/dist/commands/channel/rm.js +1 -1
- package/dist/commands/channel/store/lock.d.ts +1 -1
- package/dist/commands/channel/store/lock.js +1 -1
- package/dist/commands/channel/store/paths.js +1 -1
- package/dist/commands/channel/store/paths.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +105 -59
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/uninstall.d.ts +3 -3
- package/dist/commands/uninstall.js +10 -10
- package/dist/commands/uninstall.js.map +1 -1
- package/dist/commands/update.d.ts +6 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +83 -28
- package/dist/commands/update.js.map +1 -1
- package/dist/commands/workflow.d.ts +4 -4
- package/dist/commands/workflow.d.ts.map +1 -1
- package/dist/commands/workflow.js +10 -9
- package/dist/commands/workflow.js.map +1 -1
- package/dist/configurators/index.d.ts.map +1 -1
- package/dist/configurators/index.js +1 -1
- package/dist/configurators/index.js.map +1 -1
- package/dist/configurators/shared.js +6 -6
- package/dist/configurators/shared.js.map +1 -1
- package/dist/configurators/workflow.d.ts +4 -4
- package/dist/configurators/workflow.js +1 -1
- package/dist/constants/paths.d.ts +24 -24
- package/dist/constants/paths.d.ts.map +1 -1
- package/dist/constants/paths.js +16 -16
- package/dist/constants/paths.js.map +1 -1
- package/dist/migrations/manifests/0.3.1.json +32 -0
- package/dist/templates/common/bundled-skills/cstl-cursor2plus-setup/SKILL.md +11 -11
- package/dist/templates/common/bundled-skills/cstl-meta/SKILL.md +15 -15
- package/dist/templates/common/bundled-skills/cstl-meta/references/customize-local/add-project-local-conventions.md +12 -12
- package/dist/templates/common/bundled-skills/cstl-meta/references/customize-local/change-agents.md +2 -2
- package/dist/templates/common/bundled-skills/cstl-meta/references/customize-local/change-context-loading.md +21 -21
- package/dist/templates/common/bundled-skills/cstl-meta/references/customize-local/change-hooks.md +9 -9
- package/dist/templates/common/bundled-skills/cstl-meta/references/customize-local/change-skills-or-commands.md +7 -7
- package/dist/templates/common/bundled-skills/cstl-meta/references/customize-local/change-spec-structure.md +15 -15
- package/dist/templates/common/bundled-skills/cstl-meta/references/customize-local/change-task-lifecycle.md +27 -27
- package/dist/templates/common/bundled-skills/cstl-meta/references/customize-local/change-workflow.md +7 -7
- package/dist/templates/common/bundled-skills/cstl-meta/references/customize-local/overview.md +11 -11
- package/dist/templates/common/bundled-skills/cstl-meta/references/local-architecture/context-injection.md +12 -12
- package/dist/templates/common/bundled-skills/cstl-meta/references/local-architecture/generated-files.md +21 -21
- package/dist/templates/common/bundled-skills/cstl-meta/references/local-architecture/overview.md +14 -14
- package/dist/templates/common/bundled-skills/cstl-meta/references/local-architecture/spec-system.md +12 -12
- package/dist/templates/common/bundled-skills/cstl-meta/references/local-architecture/task-system.md +23 -23
- package/dist/templates/common/bundled-skills/cstl-meta/references/local-architecture/workflow.md +3 -3
- package/dist/templates/common/bundled-skills/cstl-meta/references/local-architecture/workspace-memory.md +16 -16
- package/dist/templates/common/bundled-skills/cstl-meta/references/platform-files/agents.md +2 -2
- package/dist/templates/common/bundled-skills/cstl-meta/references/platform-files/hooks-and-settings.md +6 -6
- package/dist/templates/common/bundled-skills/cstl-meta/references/platform-files/overview.md +5 -5
- package/dist/templates/common/bundled-skills/cstl-meta/references/platform-files/platform-map.md +3 -3
- package/dist/templates/common/bundled-skills/cstl-meta/references/platform-files/skills-and-commands.md +5 -5
- package/dist/templates/common/bundled-skills/cstl-skill-creator/SKILL.md +2 -2
- package/dist/templates/common/bundled-skills/cstl-skill-creator/references/review-checklist.md +1 -1
- package/dist/templates/common/bundled-skills/cstl-spec-bootstrap/SKILL.md +5 -5
- package/dist/templates/common/bundled-skills/cstl-spec-bootstrap/references/repository-analysis.md +1 -1
- package/dist/templates/common/bundled-skills/cstl-spec-bootstrap/references/spec-task-planning.md +3 -3
- package/dist/templates/common/bundled-skills/cstl-spec-bootstrap/references/spec-writing.md +1 -1
- package/dist/templates/common/commands/continue.md +6 -6
- package/dist/templates/common/commands/finish-work.md +5 -5
- package/dist/templates/common/commands/start.md +8 -8
- package/dist/templates/common/skills/before-dev.md +4 -4
- package/dist/templates/common/skills/brainstorm.md +5 -5
- package/dist/templates/common/skills/break-loop.md +3 -3
- package/dist/templates/common/skills/check.md +5 -5
- package/dist/templates/common/skills/update-spec.md +4 -4
- package/dist/templates/cursor/agents/cstl-check.md +6 -6
- package/dist/templates/cursor/agents/cstl-implement.md +7 -7
- package/dist/templates/cursor/agents/cstl-research.md +9 -9
- package/dist/templates/cursor/commands/cursor2plus-setup.md +10 -10
- package/dist/templates/cursor/rules/cstl-subagent-dispatch.mdc +2 -2
- package/dist/templates/cursor/rules/cstl-triage.mdc +2 -2
- package/dist/templates/cursor/rules/retrieval-routing.mdc +4 -4
- package/dist/templates/extract.d.ts +1 -1
- package/dist/templates/extract.js +1 -1
- package/dist/templates/markdown/agents.md +11 -11
- package/dist/templates/markdown/prompts/run-semantic-slice-12.md.txt +1 -1
- package/dist/templates/markdown/spec/guides/cross-platform-thinking-guide.md.txt +5 -5
- package/dist/templates/markdown/spec/guides/cursor-context-injection-guide.md.txt +3 -3
- package/dist/templates/markdown/spec/guides/cursor-semantic-compliance.md.txt +1 -1
- package/dist/templates/markdown/spec/guides/cursor-subagent-policy.md.txt +11 -11
- package/dist/templates/markdown/spec/guides/durable-learning-decision-guide.md.txt +8 -8
- package/dist/templates/markdown/spec/guides/execution-strategy.md.txt +3 -3
- package/dist/templates/markdown/spec/guides/retrieval-daily-guide.md.txt +10 -10
- package/dist/templates/markdown/workspace-index.md +3 -3
- package/dist/templates/markdown/worktree.yaml.txt +1 -1
- package/dist/templates/shared-hooks/index.d.ts +1 -1
- package/dist/templates/shared-hooks/index.js +1 -1
- package/dist/templates/shared-hooks/inject-retrieval-plan.py +3 -3
- package/dist/templates/shared-hooks/inject-shell-session-context.py +7 -7
- package/dist/templates/shared-hooks/inject-subagent-context.py +1 -1
- package/dist/templates/shared-hooks/inject-workflow-state.py +11 -11
- package/dist/templates/shared-hooks/research-end-retrieval-pack.py +1 -1
- package/dist/templates/shared-hooks/session-start.py +13 -13
- package/dist/templates/trellis/config.yaml +2 -22
- package/dist/templates/trellis/index.d.ts +2 -2
- package/dist/templates/trellis/index.js +2 -2
- package/dist/templates/trellis/local/README.md +3 -3
- package/dist/templates/trellis/local/patch_wpelc8.py +4 -4
- package/dist/templates/trellis/scripts/add_session.py +20 -20
- package/dist/templates/trellis/scripts/common/active_task.py +2 -2
- package/dist/templates/trellis/scripts/common/artifact_search.py +587 -587
- package/dist/templates/trellis/scripts/common/codebase_retrieval_router.py +6 -6
- package/dist/templates/trellis/scripts/common/config.py +3 -3
- package/dist/templates/trellis/scripts/common/developer.py +2 -2
- package/dist/templates/trellis/scripts/common/packages_context.py +23 -23
- package/dist/templates/trellis/scripts/common/parent_orchestration.py +16 -16
- package/dist/templates/trellis/scripts/common/paths.py +107 -107
- package/dist/templates/trellis/scripts/common/project_file_stats.py +1 -1
- package/dist/templates/trellis/scripts/common/retrieval_agent_instructions.py +1 -1
- package/dist/templates/trellis/scripts/common/safe_commit.py +31 -31
- package/dist/templates/trellis/scripts/common/session_memory.py +360 -360
- package/dist/templates/trellis/scripts/common/smart_search_evidence.py +514 -514
- package/dist/templates/trellis/scripts/common/smart_search_resolve.py +1 -1
- package/dist/templates/trellis/scripts/common/subagent_dispatch.py +2 -2
- package/dist/templates/trellis/scripts/common/task_context.py +1 -1
- package/dist/templates/trellis/scripts/common/task_dashboard.py +140 -140
- package/dist/templates/trellis/scripts/common/task_gates.py +23 -23
- package/dist/templates/trellis/scripts/common/task_store.py +5 -5
- package/dist/templates/trellis/scripts/common/task_utils.py +3 -3
- package/dist/templates/trellis/scripts/common/tasks.py +1 -1
- package/dist/templates/trellis/scripts/common/trellis_config.py +3 -3
- package/dist/templates/trellis/scripts/common/workflow_phase.py +1 -1
- package/dist/templates/trellis/scripts/cursor_retrieval_probe.py +3 -3
- package/dist/templates/trellis/scripts/cursor_retrieval_probe_prompt.md +11 -11
- package/dist/templates/trellis/scripts/hooks/linear_sync.py +8 -8
- package/dist/templates/trellis/scripts/init_developer.py +2 -2
- package/dist/templates/trellis/scripts/retrieval_probe_matrix_template.json +4 -4
- package/dist/templates/trellis/scripts/route_codebase_retrieval.py +1 -1
- package/dist/templates/trellis/scripts/task.py +918 -918
- package/dist/templates/trellis/tasks/templates/release-readiness/implement.md +2 -2
- package/dist/templates/trellis/workflow.md +64 -64
- package/dist/types/migration.d.ts +1 -1
- package/dist/types/migration.d.ts.map +1 -1
- package/dist/utils/agents-md.d.ts +37 -0
- package/dist/utils/agents-md.d.ts.map +1 -0
- package/dist/utils/agents-md.js +82 -0
- package/dist/utils/agents-md.js.map +1 -0
- package/dist/utils/codebase-retrieval-router.js +5 -5
- package/dist/utils/codebase-retrieval-router.js.map +1 -1
- package/dist/utils/manifest-prune.d.ts +2 -2
- package/dist/utils/manifest-prune.js +4 -4
- package/dist/utils/manifest-prune.js.map +1 -1
- package/dist/utils/mirror-check.d.ts +3 -1
- package/dist/utils/mirror-check.d.ts.map +1 -1
- package/dist/utils/mirror-check.js +22 -11
- package/dist/utils/mirror-check.js.map +1 -1
- package/dist/utils/project-capabilities.js +5 -5
- package/dist/utils/project-capabilities.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-fetcher.js +1 -1
- package/dist/utils/template-fetcher.js.map +1 -1
- package/dist/utils/template-hash.d.ts +2 -2
- package/dist/utils/template-hash.d.ts.map +1 -1
- package/dist/utils/template-hash.js +12 -10
- package/dist/utils/template-hash.js.map +1 -1
- package/dist/utils/workflow-dir.d.ts +13 -0
- package/dist/utils/workflow-dir.d.ts.map +1 -0
- package/dist/utils/workflow-dir.js +35 -0
- package/dist/utils/workflow-dir.js.map +1 -0
- package/dist/utils/workflow-ownership.d.ts +36 -0
- package/dist/utils/workflow-ownership.d.ts.map +1 -0
- package/dist/utils/workflow-ownership.js +137 -0
- package/dist/utils/workflow-ownership.js.map +1 -0
- package/dist/utils/workflow-resolver.d.ts +1 -1
- package/dist/utils/workflow-resolver.js +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template-hash.d.ts","sourceRoot":"","sources":["../../src/utils/template-hash.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAOH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"template-hash.d.ts","sourceRoot":"","sources":["../../src/utils/template-hash.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAOH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAgB5D;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,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AC;CACjB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,uBAA4B,GACpC,MAAM,CAyDR"}
|
|
@@ -17,6 +17,7 @@ import fs from "node:fs";
|
|
|
17
17
|
import path from "node:path";
|
|
18
18
|
import { DIR_NAMES, FILE_NAMES } from "../constants/paths.js";
|
|
19
19
|
import { toPosix } from "./posix.js";
|
|
20
|
+
import { resolveWorkflowDirName } from "./workflow-dir.js";
|
|
20
21
|
/** File name for storing template hashes */
|
|
21
22
|
const HASHES_FILE = ".template-hashes.json";
|
|
22
23
|
/** Current schema version for `.template-hashes.json` */
|
|
@@ -35,7 +36,8 @@ export function computeHash(content) {
|
|
|
35
36
|
* Get path to the hashes file
|
|
36
37
|
*/
|
|
37
38
|
function getHashesPath(cwd) {
|
|
38
|
-
|
|
39
|
+
const dirName = resolveWorkflowDirName(cwd) ?? DIR_NAMES.WORKFLOW;
|
|
40
|
+
return path.join(cwd, dirName, HASHES_FILE);
|
|
39
41
|
}
|
|
40
42
|
/**
|
|
41
43
|
* Normalize all keys of a hashes record to POSIX form.
|
|
@@ -203,7 +205,7 @@ export function getModificationStatus(cwd, relativePaths, hashes) {
|
|
|
203
205
|
return result;
|
|
204
206
|
}
|
|
205
207
|
/**
|
|
206
|
-
* Patterns to exclude from hash tracking (only applied to the .
|
|
208
|
+
* Patterns to exclude from hash tracking (only applied to the .cstl/ walk).
|
|
207
209
|
*/
|
|
208
210
|
const EXCLUDE_FROM_HASH = [
|
|
209
211
|
".template-hashes.json", // Hash file itself
|
|
@@ -213,7 +215,7 @@ const EXCLUDE_FROM_HASH = [
|
|
|
213
215
|
"workspace/", // Workspace files (user data)
|
|
214
216
|
"tasks/", // Task files (user data)
|
|
215
217
|
".current-task", // Current task marker (file, not directory)
|
|
216
|
-
".
|
|
218
|
+
".cstl/spec/", // User-customized spec files
|
|
217
219
|
".backup-", // Backup directories
|
|
218
220
|
];
|
|
219
221
|
/**
|
|
@@ -264,8 +266,8 @@ function collectFiles(cwd, dir) {
|
|
|
264
266
|
* where a blind directory walk of `.codex/` / `.claude/` swept up
|
|
265
267
|
* user-owned runtime data (chat history, session JSONLs).
|
|
266
268
|
*
|
|
267
|
-
* `.
|
|
268
|
-
* uninstall removes `.
|
|
269
|
+
* `.cstl/` is still walked recursively (with `EXCLUDE_FROM_HASH`) because
|
|
270
|
+
* uninstall removes `.cstl/` wholesale via `rm -rf` regardless of manifest
|
|
269
271
|
* content — accuracy there doesn't affect data-loss, only `trellis update`
|
|
270
272
|
* 3-way-merge fidelity (preserved by the existing walk).
|
|
271
273
|
*
|
|
@@ -277,8 +279,8 @@ export function initializeHashes(cwd, options = {}) {
|
|
|
277
279
|
// Platform + root files: hash only paths actually written this run.
|
|
278
280
|
if (trackedPaths) {
|
|
279
281
|
for (const relativePath of trackedPaths) {
|
|
280
|
-
// `.
|
|
281
|
-
if (relativePath.startsWith(".
|
|
282
|
+
// `.cstl/` paths are handled by the walk below — don't double-track.
|
|
283
|
+
if (relativePath.startsWith(".cstl/") || relativePath === ".cstl") {
|
|
282
284
|
continue;
|
|
283
285
|
}
|
|
284
286
|
const fullPath = path.join(cwd, ...relativePath.split("/"));
|
|
@@ -293,11 +295,11 @@ export function initializeHashes(cwd, options = {}) {
|
|
|
293
295
|
}
|
|
294
296
|
}
|
|
295
297
|
}
|
|
296
|
-
// .
|
|
298
|
+
// .cstl/ workflow tree: still walked recursively. Accuracy here is for
|
|
297
299
|
// `trellis update`'s 3-way merge of workflow.md / config.yaml / scripts;
|
|
298
|
-
// uninstall removes .
|
|
300
|
+
// uninstall removes .cstl/ wholesale so it does not matter for the
|
|
299
301
|
// data-loss bug this contract addresses.
|
|
300
|
-
const files = collectFiles(cwd, ".
|
|
302
|
+
const files = collectFiles(cwd, ".cstl");
|
|
301
303
|
for (const relativePath of files) {
|
|
302
304
|
const fullPath = path.join(cwd, relativePath);
|
|
303
305
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template-hash.js","sourceRoot":"","sources":["../../src/utils/template-hash.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAE9D,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"template-hash.js","sourceRoot":"","sources":["../../src/utils/template-hash.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAE9D,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,4CAA4C;AAC5C,MAAM,WAAW,GAAG,uBAAuB,CAAC;AAE5C,yDAAyD;AACzD,MAAM,qBAAqB,GAAG,CAAC,CAAC;AAQhC;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,OAAe;IACzC,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAClD,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACxE,CAAC;AAED;;GAEG;AACH,SAAS,aAAa,CAAC,GAAW;IAChC,MAAM,OAAO,GAAG,sBAAsB,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC,QAAQ,CAAC;IACl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CAAC,CAAC;QAC9C,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;YACnD,MAAM,CAAC,YAAY,CAAC,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;QAC9C,CAAC;QAAC,MAAM,CAAC;YACP,+CAA+C;QACjD,CAAC;IACH,CAAC;IAED,2EAA2E;IAC3E,0EAA0E;IAC1E,0EAA0E;IAC1E,qCAAqC;IACrC,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,KAAK,MAAM,YAAY,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;YAC/C,IAAI,qBAAqB,CAAC,YAAY,CAAC;gBAAE,SAAS;YAClD,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;YAC9C,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;gBAAE,SAAS;YACvC,IAAI,CAAC;gBACH,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;gBACnD,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;YACvD,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO;YACT,CAAC;QACH,CAAC;IACH,CAAC;IAED,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IACxB,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Pre-0.3.1 cursor-trellis runtime directory (upstream Trellis still uses this name). */
|
|
2
|
+
export declare const LEGACY_WORKFLOW_DIR = ".trellis";
|
|
3
|
+
/**
|
|
4
|
+
* Resolve the active workflow directory name for this project.
|
|
5
|
+
* Prefers `.cstl/`; falls back to legacy `.trellis/` for pre-migration trees.
|
|
6
|
+
*/
|
|
7
|
+
export declare function resolveWorkflowDirName(cwd: string): string | null;
|
|
8
|
+
/** Absolute path to the active workflow root, or null when not initialized. */
|
|
9
|
+
export declare function workflowDirPath(cwd: string): string | null;
|
|
10
|
+
export declare function isWorkflowInitialized(cwd: string): boolean;
|
|
11
|
+
/** Join a path segment under the active workflow dir (POSIX-style relative segments). */
|
|
12
|
+
export declare function workflowPath(cwd: string, ...segments: string[]): string | null;
|
|
13
|
+
//# sourceMappingURL=workflow-dir.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-dir.d.ts","sourceRoot":"","sources":["../../src/utils/workflow-dir.ts"],"names":[],"mappings":"AAKA,0FAA0F;AAC1F,eAAO,MAAM,mBAAmB,aAAa,CAAC;AAE9C;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAQjE;AAED,+EAA+E;AAC/E,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAG1D;AAED,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE1D;AAED,yFAAyF;AACzF,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,IAAI,CAM9E"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { DIR_NAMES } from "../constants/paths.js";
|
|
4
|
+
/** Pre-0.3.1 cursor-trellis runtime directory (upstream Trellis still uses this name). */
|
|
5
|
+
export const LEGACY_WORKFLOW_DIR = ".trellis";
|
|
6
|
+
/**
|
|
7
|
+
* Resolve the active workflow directory name for this project.
|
|
8
|
+
* Prefers `.cstl/`; falls back to legacy `.trellis/` for pre-migration trees.
|
|
9
|
+
*/
|
|
10
|
+
export function resolveWorkflowDirName(cwd) {
|
|
11
|
+
if (fs.existsSync(path.join(cwd, DIR_NAMES.WORKFLOW))) {
|
|
12
|
+
return DIR_NAMES.WORKFLOW;
|
|
13
|
+
}
|
|
14
|
+
if (fs.existsSync(path.join(cwd, LEGACY_WORKFLOW_DIR))) {
|
|
15
|
+
return LEGACY_WORKFLOW_DIR;
|
|
16
|
+
}
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
/** Absolute path to the active workflow root, or null when not initialized. */
|
|
20
|
+
export function workflowDirPath(cwd) {
|
|
21
|
+
const name = resolveWorkflowDirName(cwd);
|
|
22
|
+
return name ? path.join(cwd, name) : null;
|
|
23
|
+
}
|
|
24
|
+
export function isWorkflowInitialized(cwd) {
|
|
25
|
+
return resolveWorkflowDirName(cwd) !== null;
|
|
26
|
+
}
|
|
27
|
+
/** Join a path segment under the active workflow dir (POSIX-style relative segments). */
|
|
28
|
+
export function workflowPath(cwd, ...segments) {
|
|
29
|
+
const root = workflowDirPath(cwd);
|
|
30
|
+
if (!root) {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
return path.join(root, ...segments);
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=workflow-dir.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-dir.js","sourceRoot":"","sources":["../../src/utils/workflow-dir.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,0FAA0F;AAC1F,MAAM,CAAC,MAAM,mBAAmB,GAAG,UAAU,CAAC;AAE9C;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CAAC,GAAW;IAChD,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC;QACtD,OAAO,SAAS,CAAC,QAAQ,CAAC;IAC5B,CAAC;IACD,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,mBAAmB,CAAC,CAAC,EAAE,CAAC;QACvD,OAAO,mBAAmB,CAAC;IAC7B,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,eAAe,CAAC,GAAW;IACzC,MAAM,IAAI,GAAG,sBAAsB,CAAC,GAAG,CAAC,CAAC;IACzC,OAAO,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAC5C,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,GAAW;IAC/C,OAAO,sBAAsB,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;AAC9C,CAAC;AAED,yFAAyF;AACzF,MAAM,UAAU,YAAY,CAAC,GAAW,EAAE,GAAG,QAAkB;IAC7D,MAAM,IAAI,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC;IAClC,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,QAAQ,CAAC,CAAC;AACtC,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export interface CstlMigrateAssessment {
|
|
2
|
+
ok: boolean;
|
|
3
|
+
reason?: string;
|
|
4
|
+
}
|
|
5
|
+
export interface AssessCstlMigrateOptions {
|
|
6
|
+
/**
|
|
7
|
+
* F5 escape hatch: the user explicitly forces the `.trellis/` → `.cstl/`
|
|
8
|
+
* rename even when upstream Trellis signals are present. Still requires
|
|
9
|
+
* `.trellis/` to exist and `.cstl/` to be absent.
|
|
10
|
+
*/
|
|
11
|
+
forceCstlMigrate?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Decide whether `.trellis/` -> `.cstl/` rename-dir is safe for this project.
|
|
15
|
+
*
|
|
16
|
+
* Conservative by default (design §1 principle 3): the rename only proceeds
|
|
17
|
+
* when there is POSITIVE proof the tree is cursor-trellis-owned. Without that
|
|
18
|
+
* proof the rename is refused — the user should run `cstl init --cursor` to
|
|
19
|
+
* add `.cstl/` alongside an upstream `.trellis/` instead.
|
|
20
|
+
*
|
|
21
|
+
* Fingerprints (positive proof of cursor-trellis ownership):
|
|
22
|
+
* F1 — any `.cursor/commands/cstl-*.md`
|
|
23
|
+
* F2 — `.cursor/rules/cstl-triage.mdc`
|
|
24
|
+
* F3 — `.trellis/scripts/common/cli_adapter.py` contains `cstl`
|
|
25
|
+
*
|
|
26
|
+
* Upstream Trellis signals (suggest `.trellis/` is NOT cursor-trellis-owned):
|
|
27
|
+
* U1 — `.claude/agents/trellis-implement.md`
|
|
28
|
+
* U2 — trellis-named agents/skills under non-cursor platform dirs
|
|
29
|
+
* (codex/iflow/opencode/gemini/kilocode/kiro/qoder/.agents)
|
|
30
|
+
* U4 — `.cursor/commands/trellis-*.md` (legacy upstream Cursor adapter)
|
|
31
|
+
*
|
|
32
|
+
* Escape hatch:
|
|
33
|
+
* F5 — `options.forceCstlMigrate` overrides upstream-signal aborts.
|
|
34
|
+
*/
|
|
35
|
+
export declare function assessCstlDirectoryMigrate(cwd: string, options?: AssessCstlMigrateOptions): CstlMigrateAssessment;
|
|
36
|
+
//# sourceMappingURL=workflow-ownership.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-ownership.d.ts","sourceRoot":"","sources":["../../src/utils/workflow-ownership.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,qBAAqB;IACpC,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,wBAAwB;IACvC;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,0BAA0B,CACxC,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,wBAA6B,GACrC,qBAAqB,CAuDvB"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
/**
|
|
4
|
+
* Decide whether `.trellis/` -> `.cstl/` rename-dir is safe for this project.
|
|
5
|
+
*
|
|
6
|
+
* Conservative by default (design §1 principle 3): the rename only proceeds
|
|
7
|
+
* when there is POSITIVE proof the tree is cursor-trellis-owned. Without that
|
|
8
|
+
* proof the rename is refused — the user should run `cstl init --cursor` to
|
|
9
|
+
* add `.cstl/` alongside an upstream `.trellis/` instead.
|
|
10
|
+
*
|
|
11
|
+
* Fingerprints (positive proof of cursor-trellis ownership):
|
|
12
|
+
* F1 — any `.cursor/commands/cstl-*.md`
|
|
13
|
+
* F2 — `.cursor/rules/cstl-triage.mdc`
|
|
14
|
+
* F3 — `.trellis/scripts/common/cli_adapter.py` contains `cstl`
|
|
15
|
+
*
|
|
16
|
+
* Upstream Trellis signals (suggest `.trellis/` is NOT cursor-trellis-owned):
|
|
17
|
+
* U1 — `.claude/agents/trellis-implement.md`
|
|
18
|
+
* U2 — trellis-named agents/skills under non-cursor platform dirs
|
|
19
|
+
* (codex/iflow/opencode/gemini/kilocode/kiro/qoder/.agents)
|
|
20
|
+
* U4 — `.cursor/commands/trellis-*.md` (legacy upstream Cursor adapter)
|
|
21
|
+
*
|
|
22
|
+
* Escape hatch:
|
|
23
|
+
* F5 — `options.forceCstlMigrate` overrides upstream-signal aborts.
|
|
24
|
+
*/
|
|
25
|
+
export function assessCstlDirectoryMigrate(cwd, options = {}) {
|
|
26
|
+
const cstlDir = path.join(cwd, ".cstl");
|
|
27
|
+
const trellisDir = path.join(cwd, ".trellis");
|
|
28
|
+
if (fs.existsSync(cstlDir)) {
|
|
29
|
+
return {
|
|
30
|
+
ok: false,
|
|
31
|
+
reason: ".cstl/ already exists — migration already applied or manual setup present. " +
|
|
32
|
+
"If `.cstl/` is a stale partial write, remove it and re-run `cstl update --migrate`.",
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
if (!fs.existsSync(trellisDir)) {
|
|
36
|
+
return {
|
|
37
|
+
ok: false,
|
|
38
|
+
reason: "No .trellis/ directory to migrate — run `cstl init --cursor` to create .cstl/ from scratch.",
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
// F5 escape hatch: explicit user override. .trellis/ exists and .cstl/ is
|
|
42
|
+
// absent, which is the only structural precondition the rename needs.
|
|
43
|
+
if (options.forceCstlMigrate) {
|
|
44
|
+
return { ok: true };
|
|
45
|
+
}
|
|
46
|
+
const hasCstlFingerprint = detectCstlFingerprint(cwd);
|
|
47
|
+
const hasUpstreamSignal = detectUpstreamTrellis(cwd);
|
|
48
|
+
if (!hasCstlFingerprint) {
|
|
49
|
+
return {
|
|
50
|
+
ok: false,
|
|
51
|
+
reason: "No cursor-trellis fingerprint found (no .cursor/commands/cstl-*.md, " +
|
|
52
|
+
"no .cursor/rules/cstl-triage.mdc, and .trellis/scripts/common/cli_adapter.py " +
|
|
53
|
+
"is not cstl-flavored). Refusing to rename .trellis/ — it may belong to " +
|
|
54
|
+
"upstream Trellis. To add cursor-trellis alongside upstream Trellis, run " +
|
|
55
|
+
"`cstl init --cursor` (creates .cstl/ without touching .trellis/). " +
|
|
56
|
+
"If you are certain .trellis/ is cursor-trellis-owned, pass --force-cstl-migrate.",
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
if (hasUpstreamSignal) {
|
|
60
|
+
return {
|
|
61
|
+
ok: false,
|
|
62
|
+
reason: "Mixed layout: cursor-trellis fingerprints AND upstream Trellis signals " +
|
|
63
|
+
"both detected. Refusing to rename .trellis/ — it may be shared with " +
|
|
64
|
+
"upstream Trellis. Use `cstl init --cursor` to add .cstl/ alongside, or " +
|
|
65
|
+
"--force-cstl-migrate if you are certain .trellis/ is cursor-trellis-owned.",
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
return { ok: true };
|
|
69
|
+
}
|
|
70
|
+
/** F1/F2/F3 — positive proof the tree is cursor-trellis-owned. */
|
|
71
|
+
function detectCstlFingerprint(cwd) {
|
|
72
|
+
// F1 — any .cursor/commands/cstl-*.md
|
|
73
|
+
const cursorCommandsDir = path.join(cwd, ".cursor", "commands");
|
|
74
|
+
if (hasFileGlob(cursorCommandsDir, (f) => f.startsWith("cstl-") && f.endsWith(".md"))) {
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
// F2 — .cursor/rules/cstl-triage.mdc
|
|
78
|
+
if (fs.existsSync(path.join(cwd, ".cursor", "rules", "cstl-triage.mdc"))) {
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
81
|
+
// F3 — cstl-flavored .trellis/scripts/common/cli_adapter.py
|
|
82
|
+
const cliAdapter = path.join(cwd, ".trellis", "scripts", "common", "cli_adapter.py");
|
|
83
|
+
if (fs.existsSync(cliAdapter)) {
|
|
84
|
+
try {
|
|
85
|
+
const content = fs.readFileSync(cliAdapter, "utf-8");
|
|
86
|
+
if (content.includes("cstl")) {
|
|
87
|
+
return true;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
catch {
|
|
91
|
+
// ignore read errors
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
/** U1/U2/U4 — upstream Trellis signals (`.trellis/` may not be cursor-trellis-owned). */
|
|
97
|
+
function detectUpstreamTrellis(cwd) {
|
|
98
|
+
// U1 — upstream Claude adapter
|
|
99
|
+
if (fs.existsSync(path.join(cwd, ".claude", "agents", "trellis-implement.md"))) {
|
|
100
|
+
return true;
|
|
101
|
+
}
|
|
102
|
+
// U2 — trellis-named agents/skills under non-cursor platform dirs.
|
|
103
|
+
// cursor-trellis is Cursor-only, so any trellis-* artifact outside .cursor/
|
|
104
|
+
// indicates an upstream Trellis install.
|
|
105
|
+
const upstreamDirs = [
|
|
106
|
+
[".codex", "agents"],
|
|
107
|
+
[".iflow", "agents"],
|
|
108
|
+
[".opencode", "agents"],
|
|
109
|
+
[".gemini", "commands"],
|
|
110
|
+
[".kilocode", "workflows"],
|
|
111
|
+
[".kiro", "skills"],
|
|
112
|
+
[".qoder", "skills"],
|
|
113
|
+
[".agents", "skills"],
|
|
114
|
+
];
|
|
115
|
+
for (const [dir, sub] of upstreamDirs) {
|
|
116
|
+
if (hasFileGlob(path.join(cwd, dir, sub), (f) => /trellis/i.test(f))) {
|
|
117
|
+
return true;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
// U4 — legacy upstream Cursor adapter (.cursor/commands/trellis-*.md)
|
|
121
|
+
if (hasFileGlob(path.join(cwd, ".cursor", "commands"), (f) => f.startsWith("trellis-") && f.endsWith(".md"))) {
|
|
122
|
+
return true;
|
|
123
|
+
}
|
|
124
|
+
return false;
|
|
125
|
+
}
|
|
126
|
+
function hasFileGlob(dir, predicate) {
|
|
127
|
+
if (!fs.existsSync(dir) || !fs.statSync(dir).isDirectory()) {
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
try {
|
|
131
|
+
return fs.readdirSync(dir).some(predicate);
|
|
132
|
+
}
|
|
133
|
+
catch {
|
|
134
|
+
return false;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
//# sourceMappingURL=workflow-ownership.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-ownership.js","sourceRoot":"","sources":["../../src/utils/workflow-ownership.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAgB7B;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,0BAA0B,CACxC,GAAW,EACX,UAAoC,EAAE;IAEtC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,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 +15,7 @@
|
|
|
15
15
|
* The id used to refer to the bundled native workflow.
|
|
16
16
|
*
|
|
17
17
|
* Treated as Trellis-managed for hash-tracking: when this id is selected by
|
|
18
|
-
* `init --workflow` or `trellis workflow`, `.
|
|
18
|
+
* `init --workflow` or `trellis workflow`, `.cstl/workflow.md` stays in
|
|
19
19
|
* `.template-hashes.json`. Any other id is user-managed local workflow and
|
|
20
20
|
* must be removed from the hash file (the durable-state contract in
|
|
21
21
|
* design.md "Durable-state contract").
|
|
@@ -20,7 +20,7 @@ import { TIMEOUTS, TEMPLATE_INDEX_URL, RegistryBackendError, parseRegistrySource
|
|
|
20
20
|
* The id used to refer to the bundled native workflow.
|
|
21
21
|
*
|
|
22
22
|
* Treated as Trellis-managed for hash-tracking: when this id is selected by
|
|
23
|
-
* `init --workflow` or `trellis workflow`, `.
|
|
23
|
+
* `init --workflow` or `trellis workflow`, `.cstl/workflow.md` stays in
|
|
24
24
|
* `.template-hashes.json`. Any other id is user-managed local workflow and
|
|
25
25
|
* must be removed from the hash file (the durable-state contract in
|
|
26
26
|
* design.md "Durable-state contract").
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blxzer/cursor-trellis",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "AI capabilities grow like ivy — Trellis provides the structure to guide them along a disciplined path",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"inquirer": "^9.3.7",
|
|
36
36
|
"undici": "^6.21.0",
|
|
37
37
|
"zod": "^4.4.2",
|
|
38
|
-
"@blxzer/cursor-trellis-core": "0.3.
|
|
38
|
+
"@blxzer/cursor-trellis-core": "0.3.2"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@eslint/js": "^9.18.0",
|