@pennixrv/trellis 0.7.2-beta.3 → 0.7.2-beta.31
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/README.md +14 -0
- package/dist/cli/index.js +4 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/ablate.d.ts.map +1 -1
- package/dist/commands/ablate.js +13 -0
- package/dist/commands/ablate.js.map +1 -1
- package/dist/commands/init.d.ts +2 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +138 -120
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/teamwork/adapters/acp.d.ts.map +1 -1
- package/dist/commands/teamwork/adapters/acp.js +3 -0
- package/dist/commands/teamwork/adapters/acp.js.map +1 -1
- package/dist/commands/teamwork/adapters/index.d.ts +1 -1
- package/dist/commands/teamwork/adapters/index.d.ts.map +1 -1
- package/dist/commands/teamwork/artifact.d.ts +2 -0
- package/dist/commands/teamwork/artifact.d.ts.map +1 -1
- package/dist/commands/teamwork/artifact.js +4 -2
- package/dist/commands/teamwork/artifact.js.map +1 -1
- package/dist/commands/teamwork/batch-reservation.d.ts.map +1 -1
- package/dist/commands/teamwork/batch-reservation.js +16 -8
- package/dist/commands/teamwork/batch-reservation.js.map +1 -1
- package/dist/commands/teamwork/batch.d.ts +15 -1
- package/dist/commands/teamwork/batch.d.ts.map +1 -1
- package/dist/commands/teamwork/batch.js +279 -24
- package/dist/commands/teamwork/batch.js.map +1 -1
- package/dist/commands/teamwork/coordinator.d.ts +3 -0
- package/dist/commands/teamwork/coordinator.d.ts.map +1 -1
- package/dist/commands/teamwork/coordinator.js +22 -3
- package/dist/commands/teamwork/coordinator.js.map +1 -1
- package/dist/commands/teamwork/create.d.ts +1 -0
- package/dist/commands/teamwork/create.d.ts.map +1 -1
- package/dist/commands/teamwork/create.js +4 -0
- package/dist/commands/teamwork/create.js.map +1 -1
- package/dist/commands/teamwork/evidence-references.d.ts +19 -0
- package/dist/commands/teamwork/evidence-references.d.ts.map +1 -0
- package/dist/commands/teamwork/evidence-references.js +249 -0
- package/dist/commands/teamwork/evidence-references.js.map +1 -0
- package/dist/commands/teamwork/foreground-wait.d.ts +4 -1
- package/dist/commands/teamwork/foreground-wait.d.ts.map +1 -1
- package/dist/commands/teamwork/foreground-wait.js +15 -1
- package/dist/commands/teamwork/foreground-wait.js.map +1 -1
- package/dist/commands/teamwork/index.d.ts.map +1 -1
- package/dist/commands/teamwork/index.js +47 -5
- package/dist/commands/teamwork/index.js.map +1 -1
- package/dist/commands/teamwork/list.d.ts +1 -0
- package/dist/commands/teamwork/list.d.ts.map +1 -1
- package/dist/commands/teamwork/list.js +4 -1
- package/dist/commands/teamwork/list.js.map +1 -1
- package/dist/commands/teamwork/prompt.js +1 -1
- package/dist/commands/teamwork/prompt.js.map +1 -1
- package/dist/commands/teamwork/rm.d.ts +27 -4
- package/dist/commands/teamwork/rm.d.ts.map +1 -1
- package/dist/commands/teamwork/rm.js +155 -51
- package/dist/commands/teamwork/rm.js.map +1 -1
- package/dist/commands/teamwork/run.d.ts.map +1 -1
- package/dist/commands/teamwork/run.js +10 -1
- package/dist/commands/teamwork/run.js.map +1 -1
- package/dist/commands/teamwork/runtime.d.ts +1 -1
- package/dist/commands/teamwork/runtime.d.ts.map +1 -1
- package/dist/commands/teamwork/runtime.js +14 -4
- package/dist/commands/teamwork/runtime.js.map +1 -1
- package/dist/commands/teamwork/spawn.d.ts.map +1 -1
- package/dist/commands/teamwork/spawn.js +4 -1
- package/dist/commands/teamwork/spawn.js.map +1 -1
- package/dist/commands/teamwork/supervisor/stdout.d.ts.map +1 -1
- package/dist/commands/teamwork/supervisor/stdout.js +7 -0
- package/dist/commands/teamwork/supervisor/stdout.js.map +1 -1
- package/dist/commands/teamwork/supervisor.d.ts +1 -1
- package/dist/commands/teamwork/supervisor.d.ts.map +1 -1
- package/dist/commands/teamwork/teammate-adapters.d.ts +3 -0
- package/dist/commands/teamwork/teammate-adapters.d.ts.map +1 -1
- package/dist/commands/teamwork/teammate-adapters.js +14 -5
- package/dist/commands/teamwork/teammate-adapters.js.map +1 -1
- package/dist/commands/teamwork/teammate-launch.d.ts +3 -1
- package/dist/commands/teamwork/teammate-launch.d.ts.map +1 -1
- package/dist/commands/teamwork/teammate-launch.js +7 -5
- package/dist/commands/teamwork/teammate-launch.js.map +1 -1
- package/dist/commands/teamwork/workers.d.ts +8 -0
- package/dist/commands/teamwork/workers.d.ts.map +1 -0
- package/dist/commands/teamwork/workers.js +67 -0
- package/dist/commands/teamwork/workers.js.map +1 -0
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +188 -59
- package/dist/commands/update.js.map +1 -1
- package/dist/commands/workflow.d.ts.map +1 -1
- package/dist/commands/workflow.js +5 -7
- package/dist/commands/workflow.js.map +1 -1
- package/dist/configurators/codebuddy.d.ts +1 -8
- package/dist/configurators/codebuddy.d.ts.map +1 -1
- package/dist/configurators/codebuddy.js +2 -12
- package/dist/configurators/codebuddy.js.map +1 -1
- package/dist/configurators/codex.d.ts +0 -36
- package/dist/configurators/codex.d.ts.map +1 -1
- package/dist/configurators/codex.js +13 -106
- package/dist/configurators/codex.js.map +1 -1
- package/dist/configurators/copilot.d.ts +1 -12
- package/dist/configurators/copilot.d.ts.map +1 -1
- package/dist/configurators/copilot.js +2 -20
- package/dist/configurators/copilot.js.map +1 -1
- package/dist/configurators/cursor.d.ts +1 -8
- package/dist/configurators/cursor.d.ts.map +1 -1
- package/dist/configurators/cursor.js +2 -12
- package/dist/configurators/cursor.js.map +1 -1
- package/dist/configurators/droid.d.ts +1 -8
- package/dist/configurators/droid.d.ts.map +1 -1
- package/dist/configurators/droid.js +2 -12
- package/dist/configurators/droid.js.map +1 -1
- package/dist/configurators/dsh.d.ts +1 -21
- package/dist/configurators/dsh.d.ts.map +1 -1
- package/dist/configurators/dsh.js +4 -37
- package/dist/configurators/dsh.js.map +1 -1
- package/dist/configurators/gemini.d.ts +1 -16
- package/dist/configurators/gemini.d.ts.map +1 -1
- package/dist/configurators/gemini.js +3 -21
- package/dist/configurators/gemini.js.map +1 -1
- package/dist/configurators/grok.d.ts +1 -12
- package/dist/configurators/grok.d.ts.map +1 -1
- package/dist/configurators/grok.js +2 -18
- package/dist/configurators/grok.js.map +1 -1
- package/dist/configurators/kimi.d.ts +1 -21
- package/dist/configurators/kimi.d.ts.map +1 -1
- package/dist/configurators/kimi.js +2 -38
- package/dist/configurators/kimi.js.map +1 -1
- package/dist/configurators/kiro.d.ts +1 -9
- package/dist/configurators/kiro.d.ts.map +1 -1
- package/dist/configurators/kiro.js +1 -9
- package/dist/configurators/kiro.js.map +1 -1
- package/dist/configurators/omp.d.ts.map +1 -1
- package/dist/configurators/omp.js +1 -5
- package/dist/configurators/omp.js.map +1 -1
- package/dist/configurators/pi.d.ts.map +1 -1
- package/dist/configurators/pi.js +2 -5
- package/dist/configurators/pi.js.map +1 -1
- package/dist/configurators/qoder.d.ts +1 -10
- package/dist/configurators/qoder.d.ts.map +1 -1
- package/dist/configurators/qoder.js +3 -15
- package/dist/configurators/qoder.js.map +1 -1
- package/dist/configurators/reasonix.d.ts +1 -12
- package/dist/configurators/reasonix.d.ts.map +1 -1
- package/dist/configurators/reasonix.js +3 -22
- package/dist/configurators/reasonix.js.map +1 -1
- package/dist/configurators/shared.d.ts +1 -24
- package/dist/configurators/shared.d.ts.map +1 -1
- package/dist/configurators/shared.js +5 -184
- package/dist/configurators/shared.js.map +1 -1
- package/dist/configurators/snow.d.ts +1 -20
- package/dist/configurators/snow.d.ts.map +1 -1
- package/dist/configurators/snow.js +2 -25
- package/dist/configurators/snow.js.map +1 -1
- package/dist/configurators/trae.d.ts +1 -14
- package/dist/configurators/trae.d.ts.map +1 -1
- package/dist/configurators/trae.js +3 -19
- package/dist/configurators/trae.js.map +1 -1
- package/dist/configurators/workflow.d.ts +5 -0
- package/dist/configurators/workflow.d.ts.map +1 -1
- package/dist/configurators/workflow.js +85 -57
- package/dist/configurators/workflow.js.map +1 -1
- package/dist/configurators/zcode.d.ts +1 -13
- package/dist/configurators/zcode.d.ts.map +1 -1
- package/dist/configurators/zcode.js +2 -18
- package/dist/configurators/zcode.js.map +1 -1
- package/dist/migrations/manifests/0.5.0-beta.5.json +1 -212
- package/dist/migrations/manifests/0.7.2-beta.10.json +9 -0
- package/dist/migrations/manifests/0.7.2-beta.11.json +9 -0
- package/dist/migrations/manifests/0.7.2-beta.12.json +9 -0
- package/dist/migrations/manifests/0.7.2-beta.13.json +9 -0
- package/dist/migrations/manifests/0.7.2-beta.14.json +9 -0
- package/dist/migrations/manifests/0.7.2-beta.15.json +9 -0
- package/dist/migrations/manifests/0.7.2-beta.16.json +9 -0
- package/dist/migrations/manifests/0.7.2-beta.17.json +9 -0
- package/dist/migrations/manifests/0.7.2-beta.18.json +9 -0
- package/dist/migrations/manifests/0.7.2-beta.19.json +11 -0
- package/dist/migrations/manifests/0.7.2-beta.20.json +9 -0
- package/dist/migrations/manifests/0.7.2-beta.21.json +9 -0
- package/dist/migrations/manifests/0.7.2-beta.22.json +9 -0
- package/dist/migrations/manifests/0.7.2-beta.23.json +9 -0
- package/dist/migrations/manifests/0.7.2-beta.24.json +8 -0
- package/dist/migrations/manifests/0.7.2-beta.25.json +8 -0
- package/dist/migrations/manifests/0.7.2-beta.26.json +8 -0
- package/dist/migrations/manifests/0.7.2-beta.27.json +8 -0
- package/dist/migrations/manifests/0.7.2-beta.28.json +8 -0
- package/dist/migrations/manifests/0.7.2-beta.29.json +8 -0
- package/dist/migrations/manifests/0.7.2-beta.30.json +10 -0
- package/dist/migrations/manifests/0.7.2-beta.31.json +9 -0
- package/dist/migrations/manifests/0.7.2-beta.4.json +9 -0
- package/dist/migrations/manifests/0.7.2-beta.5.json +9 -0
- package/dist/migrations/manifests/0.7.2-beta.6.json +9 -0
- package/dist/migrations/manifests/0.7.2-beta.7.json +9 -0
- package/dist/migrations/manifests/0.7.2-beta.8.json +9 -0
- package/dist/migrations/manifests/0.7.2-beta.9.json +9 -0
- package/dist/migrations/retired-native-paths.d.ts +109 -0
- package/dist/migrations/retired-native-paths.d.ts.map +1 -0
- package/dist/migrations/retired-native-paths.js +263 -0
- package/dist/migrations/retired-native-paths.js.map +1 -0
- package/dist/templates/claude/index.d.ts +1 -16
- package/dist/templates/claude/index.d.ts.map +1 -1
- package/dist/templates/claude/index.js +5 -32
- package/dist/templates/claude/index.js.map +1 -1
- package/dist/templates/claude/settings.json +0 -22
- package/dist/templates/codebuddy/index.d.ts +2 -3
- package/dist/templates/codebuddy/index.d.ts.map +1 -1
- package/dist/templates/codebuddy/index.js +2 -3
- package/dist/templates/codebuddy/index.js.map +1 -1
- package/dist/templates/codebuddy/settings.json +0 -10
- package/dist/templates/codex/config.toml +4 -19
- package/dist/templates/codex/hooks/session-start.py +25 -30
- package/dist/templates/codex/hooks/turn-guard.py +74 -0
- package/dist/templates/codex/hooks.json +57 -6
- package/dist/templates/codex/index.d.ts +0 -5
- package/dist/templates/codex/index.d.ts.map +1 -1
- package/dist/templates/codex/index.js +0 -13
- package/dist/templates/codex/index.js.map +1 -1
- package/dist/templates/common/bundled-skills/trellis-decision-space-construction-and-merging/SKILL.md +2 -0
- package/dist/templates/common/bundled-skills/trellis-decision-space-construction-and-merging/workflow.md +13 -3
- package/dist/templates/common/bundled-skills/trellis-delivery-review-and-closeout/SKILL.md +2 -0
- package/dist/templates/common/bundled-skills/trellis-delivery-review-and-closeout/workflow.md +17 -9
- package/dist/templates/common/bundled-skills/trellis-goal-exploration-and-requirements/SKILL.md +2 -0
- package/dist/templates/common/bundled-skills/trellis-goal-exploration-and-requirements/workflow.md +7 -3
- package/dist/templates/common/bundled-skills/trellis-meta/SKILL.md +7 -7
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-agents.md +9 -51
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-context-loading.md +3 -15
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-hooks.md +1 -2
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/bundled-skills.md +1 -1
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/context-injection.md +4 -9
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/generated-files.md +2 -2
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/multi-agent-teamwork.md +6 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/overview.md +1 -1
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/spec-system.md +10 -8
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/agents.md +9 -79
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/hooks-and-settings.md +2 -4
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/overview.md +3 -6
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.md +24 -103
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/skills-and-commands.md +1 -1
- package/dist/templates/common/bundled-skills/trellis-session-insight/SKILL.md +1 -1
- package/dist/templates/common/bundled-skills/trellis-solution-design-and-convergence/SKILL.md +2 -0
- package/dist/templates/common/bundled-skills/trellis-solution-design-and-convergence/workflow.md +27 -6
- package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/SKILL.md +9 -7
- package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/mcp-setup.md +12 -84
- package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/repository-analysis.md +5 -25
- package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/spec-task-planning.md +5 -9
- package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/spec-writing.md +8 -0
- package/dist/templates/common/bundled-skills/trellis-task-implementation/SKILL.md +2 -0
- package/dist/templates/common/bundled-skills/trellis-task-implementation/workflow.md +7 -3
- package/dist/templates/common/bundled-skills/trellis-teamwork/SKILL.md +8 -1
- package/dist/templates/common/bundled-skills/trellis-teamwork/references/teammate-processes.md +21 -1
- package/dist/templates/common/bundled-skills/trellis-teamwork/references/teamwork-plan-construction.md +13 -2
- package/dist/templates/common/bundled-skills/trellis-worktree-delegation/SKILL.md +14 -0
- package/dist/templates/common/bundled-skills/trellis-worktree-delegation/workflow.md +86 -0
- package/dist/templates/common/commands/continue.md +16 -1
- package/dist/templates/common/commands/start.md +2 -0
- package/dist/templates/common/skills/before-dev.md +3 -1
- package/dist/templates/common/skills/check.md +3 -1
- package/dist/templates/common/skills/request-intake.md +14 -1
- package/dist/templates/copilot/hooks/session-start.py +11 -30
- package/dist/templates/cursor/hooks.json +0 -7
- package/dist/templates/cursor/index.d.ts +1 -11
- package/dist/templates/cursor/index.d.ts.map +1 -1
- package/dist/templates/cursor/index.js +2 -10
- package/dist/templates/cursor/index.js.map +1 -1
- package/dist/templates/droid/index.d.ts +2 -3
- package/dist/templates/droid/index.d.ts.map +1 -1
- package/dist/templates/droid/index.js +2 -3
- package/dist/templates/droid/index.js.map +1 -1
- package/dist/templates/droid/settings.json +0 -10
- package/dist/templates/dsh/DSH.md +2 -33
- package/dist/templates/dsh/index.d.ts +1 -19
- package/dist/templates/dsh/index.d.ts.map +1 -1
- package/dist/templates/dsh/index.js +2 -21
- package/dist/templates/dsh/index.js.map +1 -1
- package/dist/templates/gemini/index.d.ts +1 -11
- package/dist/templates/gemini/index.d.ts.map +1 -1
- package/dist/templates/gemini/index.js +2 -10
- package/dist/templates/gemini/index.js.map +1 -1
- package/dist/templates/kiro/index.d.ts +1 -13
- package/dist/templates/kiro/index.d.ts.map +1 -1
- package/dist/templates/kiro/index.js +1 -13
- package/dist/templates/kiro/index.js.map +1 -1
- package/dist/templates/markdown/agents.md +9 -14
- package/dist/templates/markdown/index.d.ts +1 -0
- package/dist/templates/markdown/index.d.ts.map +1 -1
- package/dist/templates/markdown/index.js +1 -0
- package/dist/templates/markdown/index.js.map +1 -1
- package/dist/templates/markdown/spec/index.md.txt +20 -0
- package/dist/templates/omp/extensions/trellis/index.ts.txt +27 -60
- package/dist/templates/omp/index.d.ts +0 -2
- package/dist/templates/omp/index.d.ts.map +1 -1
- package/dist/templates/omp/index.js +1 -4
- package/dist/templates/omp/index.js.map +1 -1
- package/dist/templates/opencode/lib/session-utils.js +17 -5
- package/dist/templates/opencode/lib/trellis-context.js +12 -321
- package/dist/templates/opencode/plugins/inject-shell-session-context.js +93 -0
- package/dist/templates/opencode/plugins/inject-workflow-state.js +19 -17
- package/dist/templates/opencode/plugins/session-start.js +2 -6
- package/dist/templates/pi/extensions/trellis/index.ts.txt +17 -1436
- package/dist/templates/pi/index.d.ts +1 -2
- package/dist/templates/pi/index.d.ts.map +1 -1
- package/dist/templates/pi/index.js +2 -5
- package/dist/templates/pi/index.js.map +1 -1
- package/dist/templates/qoder/index.d.ts +2 -3
- package/dist/templates/qoder/index.d.ts.map +1 -1
- package/dist/templates/qoder/index.js +2 -3
- package/dist/templates/qoder/index.js.map +1 -1
- package/dist/templates/shared-hooks/guard-teamwork-wait.py +118 -12
- package/dist/templates/shared-hooks/index.d.ts +2 -56
- package/dist/templates/shared-hooks/index.d.ts.map +1 -1
- package/dist/templates/shared-hooks/index.js +4 -70
- package/dist/templates/shared-hooks/index.js.map +1 -1
- package/dist/templates/shared-hooks/inject-shell-session-context.py +46 -1
- package/dist/templates/shared-hooks/inject-spec-context.py +6 -35
- package/dist/templates/shared-hooks/inject-workflow-state.py +66 -104
- package/dist/templates/shared-hooks/session-start.py +8 -6
- package/dist/templates/snow/SNOW.md +6 -18
- package/dist/templates/snow/hooks/write-trellis-context.py +51 -133
- package/dist/templates/snow/index.d.ts +2 -21
- package/dist/templates/snow/index.d.ts.map +1 -1
- package/dist/templates/snow/index.js +3 -24
- package/dist/templates/snow/index.js.map +1 -1
- package/dist/templates/template-utils.d.ts +1 -2
- package/dist/templates/template-utils.d.ts.map +1 -1
- package/dist/templates/template-utils.js +1 -11
- package/dist/templates/template-utils.js.map +1 -1
- package/dist/templates/trae/index.d.ts +2 -3
- package/dist/templates/trae/index.d.ts.map +1 -1
- package/dist/templates/trae/index.js +2 -3
- package/dist/templates/trae/index.js.map +1 -1
- package/dist/templates/trellis/agents/delegated-worktree-primary-agent.md +22 -22
- package/dist/templates/trellis/agents/teammate.md +6 -2
- package/dist/templates/trellis/agents/worktree-delegation-node.md +32 -0
- package/dist/templates/trellis/config.yaml +7 -36
- package/dist/templates/trellis/gitignore.txt +4 -0
- package/dist/templates/trellis/index.d.ts +1 -0
- package/dist/templates/trellis/index.d.ts.map +1 -1
- package/dist/templates/trellis/index.js +9 -0
- package/dist/templates/trellis/index.js.map +1 -1
- package/dist/templates/trellis/scripts/common/active_task.py +23 -31
- package/dist/templates/trellis/scripts/common/config.py +16 -36
- package/dist/templates/trellis/scripts/common/git_context.py +13 -4
- package/dist/templates/trellis/scripts/common/io.py +2 -2
- package/dist/templates/trellis/scripts/common/markdown_format.py +107 -0
- package/dist/templates/trellis/scripts/common/packages_context.py +29 -1
- package/dist/templates/trellis/scripts/common/session_context.py +25 -50
- package/dist/templates/trellis/scripts/common/task_context.py +5 -3
- package/dist/templates/trellis/scripts/common/task_continuity.py +66 -9
- package/dist/templates/trellis/scripts/common/task_move.py +11 -5
- package/dist/templates/trellis/scripts/common/task_runtime.py +211 -0
- package/dist/templates/trellis/scripts/common/task_store.py +12 -82
- package/dist/templates/trellis/scripts/common/task_turn.py +518 -0
- package/dist/templates/trellis/scripts/common/task_workflow.py +383 -395
- package/dist/templates/trellis/scripts/common/workflow_phase.py +3 -36
- package/dist/templates/trellis/scripts/common/workflow_selection.py +35 -40
- package/dist/templates/trellis/scripts/common/worktree_delegation.py +690 -0
- package/dist/templates/trellis/scripts/common/worktree_delegation_contract.py +446 -0
- package/dist/templates/trellis/scripts/common/worktree_delegation_messages.py +376 -0
- package/dist/templates/trellis/scripts/common/worktree_delegation_transport.py +57 -0
- package/dist/templates/trellis/scripts/markdown_format.py +40 -0
- package/dist/templates/trellis/scripts/task.py +73 -10
- package/dist/templates/trellis/workflow.md +52 -11
- package/dist/templates/zcode/config.json +0 -10
- package/dist/templates/zcode/index.d.ts +3 -22
- package/dist/templates/zcode/index.d.ts.map +1 -1
- package/dist/templates/zcode/index.js +3 -24
- package/dist/templates/zcode/index.js.map +1 -1
- package/dist/types/ai-tools.d.ts +0 -4
- package/dist/types/ai-tools.d.ts.map +1 -1
- package/dist/types/ai-tools.js +4 -109
- package/dist/types/ai-tools.js.map +1 -1
- package/dist/utils/ablation-store.d.ts.map +1 -1
- package/dist/utils/ablation-store.js +41 -1
- package/dist/utils/ablation-store.js.map +1 -1
- package/dist/utils/asset-backup.d.ts +1 -0
- package/dist/utils/asset-backup.d.ts.map +1 -1
- package/dist/utils/asset-backup.js +131 -31
- package/dist/utils/asset-backup.js.map +1 -1
- package/dist/utils/atomic-write.d.ts +1 -1
- package/dist/utils/atomic-write.d.ts.map +1 -1
- package/dist/utils/atomic-write.js +8 -2
- package/dist/utils/atomic-write.js.map +1 -1
- package/dist/utils/codex-config-ownership.d.ts +13 -0
- package/dist/utils/codex-config-ownership.d.ts.map +1 -0
- package/dist/utils/codex-config-ownership.js +64 -0
- package/dist/utils/codex-config-ownership.js.map +1 -0
- package/dist/utils/file-writer.d.ts +2 -0
- package/dist/utils/file-writer.d.ts.map +1 -1
- package/dist/utils/file-writer.js +1 -1
- package/dist/utils/file-writer.js.map +1 -1
- package/dist/utils/managed-markdown.d.ts +5 -0
- package/dist/utils/managed-markdown.d.ts.map +1 -0
- package/dist/utils/managed-markdown.js +64 -0
- package/dist/utils/managed-markdown.js.map +1 -0
- package/dist/utils/managed-removal.d.ts +2 -0
- package/dist/utils/managed-removal.d.ts.map +1 -1
- package/dist/utils/managed-removal.js +62 -8
- package/dist/utils/managed-removal.js.map +1 -1
- package/dist/utils/manifest-prune.d.ts.map +1 -1
- package/dist/utils/manifest-prune.js +5 -12
- package/dist/utils/manifest-prune.js.map +1 -1
- package/dist/utils/project-init.d.ts +26 -0
- package/dist/utils/project-init.d.ts.map +1 -0
- package/dist/utils/project-init.js +484 -0
- package/dist/utils/project-init.js.map +1 -0
- package/dist/utils/retired-native-assets.d.ts +17 -0
- package/dist/utils/retired-native-assets.d.ts.map +1 -0
- package/dist/utils/retired-native-assets.js +221 -0
- package/dist/utils/retired-native-assets.js.map +1 -0
- package/dist/utils/uninstall-scrubbers.d.ts.map +1 -1
- package/dist/utils/uninstall-scrubbers.js +6 -12
- package/dist/utils/uninstall-scrubbers.js.map +1 -1
- package/package.json +2 -2
- package/dist/templates/claude/agents/trellis-check.md +0 -115
- package/dist/templates/claude/agents/trellis-implement.md +0 -110
- package/dist/templates/claude/agents/trellis-research.md +0 -137
- package/dist/templates/codebuddy/agents/trellis-check.md +0 -115
- package/dist/templates/codebuddy/agents/trellis-implement.md +0 -110
- package/dist/templates/codebuddy/agents/trellis-research.md +0 -137
- package/dist/templates/codex/agents/trellis-check.toml +0 -56
- package/dist/templates/codex/agents/trellis-implement.toml +0 -37
- package/dist/templates/codex/agents/trellis-research.toml +0 -78
- package/dist/templates/cursor/agents/trellis-check.md +0 -114
- package/dist/templates/cursor/agents/trellis-implement.md +0 -109
- package/dist/templates/cursor/agents/trellis-research.md +0 -136
- package/dist/templates/droid/droids/trellis-check.md +0 -107
- package/dist/templates/droid/droids/trellis-implement.md +0 -102
- package/dist/templates/droid/droids/trellis-research.md +0 -137
- package/dist/templates/dsh/agents/trellis-check.md +0 -99
- package/dist/templates/dsh/agents/trellis-implement.md +0 -106
- package/dist/templates/dsh/agents/trellis-research.md +0 -134
- package/dist/templates/gemini/agents/trellis-check.md +0 -107
- package/dist/templates/gemini/agents/trellis-implement.md +0 -102
- package/dist/templates/gemini/agents/trellis-research.md +0 -136
- package/dist/templates/grok/agents/trellis-check.md +0 -105
- package/dist/templates/grok/agents/trellis-implement.md +0 -116
- package/dist/templates/grok/agents/trellis-research.md +0 -146
- package/dist/templates/grok/index.d.ts +0 -16
- package/dist/templates/grok/index.d.ts.map +0 -1
- package/dist/templates/grok/index.js +0 -19
- package/dist/templates/grok/index.js.map +0 -1
- package/dist/templates/kimi/agents/trellis-check.md +0 -103
- package/dist/templates/kimi/agents/trellis-implement.md +0 -115
- package/dist/templates/kimi/agents/trellis-research.md +0 -144
- package/dist/templates/kimi/index.d.ts +0 -20
- package/dist/templates/kimi/index.d.ts.map +0 -1
- package/dist/templates/kimi/index.js +0 -23
- package/dist/templates/kimi/index.js.map +0 -1
- package/dist/templates/kiro/agents/trellis-check.json +0 -26
- package/dist/templates/kiro/agents/trellis-implement.json +0 -26
- package/dist/templates/kiro/agents/trellis-research.json +0 -30
- package/dist/templates/omp/agents/trellis-check.md +0 -41
- package/dist/templates/omp/agents/trellis-implement.md +0 -45
- package/dist/templates/omp/agents/trellis-research.md +0 -30
- package/dist/templates/opencode/agents/trellis-check.md +0 -122
- package/dist/templates/opencode/agents/trellis-implement.md +0 -118
- package/dist/templates/opencode/agents/trellis-research.md +0 -145
- package/dist/templates/opencode/plugins/inject-subagent-context.js +0 -569
- package/dist/templates/pi/agents/trellis-check.md +0 -37
- package/dist/templates/pi/agents/trellis-implement.md +0 -42
- package/dist/templates/pi/agents/trellis-research.md +0 -25
- package/dist/templates/qoder/agents/trellis-check.md +0 -108
- package/dist/templates/qoder/agents/trellis-implement.md +0 -103
- package/dist/templates/qoder/agents/trellis-research.md +0 -137
- package/dist/templates/reasonix/agents/trellis-check.md +0 -36
- package/dist/templates/reasonix/agents/trellis-implement.md +0 -41
- package/dist/templates/reasonix/index.d.ts +0 -13
- package/dist/templates/reasonix/index.d.ts.map +0 -1
- package/dist/templates/reasonix/index.js +0 -16
- package/dist/templates/reasonix/index.js.map +0 -1
- package/dist/templates/shared-hooks/inject-subagent-context.py +0 -1217
- package/dist/templates/snow/agents/trellis-check.md +0 -135
- package/dist/templates/snow/agents/trellis-implement.md +0 -153
- package/dist/templates/snow/agents/trellis-research.md +0 -114
- package/dist/templates/snow/hooks/beforeSubAgentStart.json +0 -15
- package/dist/templates/trae/agents/trellis-check.md +0 -108
- package/dist/templates/trae/agents/trellis-implement.md +0 -103
- package/dist/templates/trae/agents/trellis-research.md +0 -137
- package/dist/templates/zcode/agents/trellis-check.md +0 -109
- package/dist/templates/zcode/agents/trellis-implement.md +0 -111
- package/dist/templates/zcode/agents/trellis-research.md +0 -133
package/dist/commands/init.js
CHANGED
|
@@ -1,22 +1,30 @@
|
|
|
1
|
-
import { execSync } from "node:child_process";
|
|
1
|
+
import { execFileSync, execSync } from "node:child_process";
|
|
2
2
|
import fs from "node:fs";
|
|
3
|
+
import { assertCurrentExecutionTree } from "../utils/retired-native-assets.js";
|
|
3
4
|
import path from "node:path";
|
|
4
5
|
import readline from "node:readline";
|
|
5
6
|
import chalk from "chalk";
|
|
6
7
|
import figlet from "figlet";
|
|
7
8
|
import inquirer from "inquirer";
|
|
8
|
-
import { createWorkflowStructure } from "../configurators/workflow.js";
|
|
9
|
+
import { createWorkflowStructure, ensureSpecIndex, } from "../configurators/workflow.js";
|
|
9
10
|
import { withAssetMaintenance } from "../utils/asset-backup.js";
|
|
11
|
+
import { resolveProjectPolicy, preflightProjectInit, completeProjectInit, } from "../utils/project-init.js";
|
|
12
|
+
import { writeFileAtomic } from "../utils/atomic-write.js";
|
|
13
|
+
import { CODEX_CONFIG_PATH } from "../utils/codex-config-ownership.js";
|
|
14
|
+
import { getConfigTemplate as getCodexConfigTemplate } from "../templates/codex/index.js";
|
|
15
|
+
import { managedBlock, mergeManagedMarkdown, readManagedMarkdown, } from "../utils/managed-markdown.js";
|
|
16
|
+
import { TRELLIS_BLOCK_START, TRELLIS_BLOCK_END, } from "../utils/managed-paths.js";
|
|
17
|
+
import { recordWrite } from "../utils/file-writer.js";
|
|
10
18
|
import { getInitToolChoices, resolveCliFlag, configurePlatform, getConfiguredPlatforms, getPlatformsWithPythonHooks, } from "../configurators/index.js";
|
|
11
19
|
import { getPythonCommandForPlatform, setResolvedPythonCommand, } from "../configurators/shared.js";
|
|
12
20
|
import { AI_TOOLS } from "../types/ai-tools.js";
|
|
13
21
|
import { DIR_NAMES, FILE_NAMES, PATHS } from "../constants/paths.js";
|
|
14
22
|
import { VERSION } from "../constants/version.js";
|
|
15
23
|
import { agentsMdContent } from "../templates/markdown/index.js";
|
|
16
|
-
import { setWriteMode, startRecordingWrites, stopRecordingWrites,
|
|
24
|
+
import { setWriteMode, startRecordingWrites, stopRecordingWrites, } from "../utils/file-writer.js";
|
|
17
25
|
import { emptyTaskJson } from "../utils/task-json.js";
|
|
18
26
|
import { detectProjectType, detectMonorepo, sanitizePkgName, } from "../utils/project-detector.js";
|
|
19
|
-
import { initializeHashes, removeHash } from "../utils/template-hash.js";
|
|
27
|
+
import { computeHash, initializeHashes, loadHashes, removeHash, saveHashes, } from "../utils/template-hash.js";
|
|
20
28
|
import { NATIVE_WORKFLOW_ID, resolveWorkflowTemplate, } from "../utils/workflow-resolver.js";
|
|
21
29
|
import { isCwdHomedir, homedirGuardMessage, homedirBypassEnabled, } from "../utils/cwd-guard.js";
|
|
22
30
|
import { writeSpecRegistryConfig, } from "../utils/registry-config.js";
|
|
@@ -34,6 +42,11 @@ function tasksAreEmpty(cwd) {
|
|
|
34
42
|
progress.cancelled ===
|
|
35
43
|
0);
|
|
36
44
|
}
|
|
45
|
+
function initializeDeveloper(cwd, pythonCmd, name) {
|
|
46
|
+
const script = path.join(cwd, PATHS.SCRIPTS, "init_developer.py");
|
|
47
|
+
const [command, ...prefix] = pythonCmd === "py -3" ? ["py", "-3"] : [pythonCmd];
|
|
48
|
+
execFileSync(command, [...prefix, script, name], { cwd, stdio: "pipe" });
|
|
49
|
+
}
|
|
37
50
|
const MIN_PYTHON_MAJOR = 3;
|
|
38
51
|
const MIN_PYTHON_MINOR = 9;
|
|
39
52
|
const PYTHON_VERSION_RE = /Python (\d+)\.(\d+)/;
|
|
@@ -262,35 +275,22 @@ function writeTaskSkeleton(cwd, taskName, taskJson, prdContent) {
|
|
|
262
275
|
* stays canonical with `subtasks: string[]` (child task dir names, same as
|
|
263
276
|
* task_store.py).
|
|
264
277
|
*/
|
|
265
|
-
function getBootstrapChecklistItems(
|
|
278
|
+
function getBootstrapChecklistItems(_projectType, packages) {
|
|
266
279
|
if (packages && packages.length > 0) {
|
|
267
280
|
const items = packages.map((pkg) => `Fill guidelines for ${pkg.name}`);
|
|
268
281
|
items.push("Add code examples");
|
|
269
282
|
return items;
|
|
270
283
|
}
|
|
271
|
-
if (projectType === "frontend") {
|
|
272
|
-
return ["Fill frontend guidelines", "Add code examples"];
|
|
273
|
-
}
|
|
274
|
-
if (projectType === "backend") {
|
|
275
|
-
return ["Fill backend guidelines", "Add code examples"];
|
|
276
|
-
}
|
|
277
284
|
return [
|
|
278
|
-
"
|
|
279
|
-
"
|
|
280
|
-
"Add code examples",
|
|
285
|
+
"Establish applicable project guidelines",
|
|
286
|
+
"Add source-backed examples and verification",
|
|
281
287
|
];
|
|
282
288
|
}
|
|
283
|
-
function getBootstrapRelatedFiles(
|
|
289
|
+
function getBootstrapRelatedFiles(_projectType, packages) {
|
|
284
290
|
if (packages && packages.length > 0) {
|
|
285
291
|
return packages.map((pkg) => `.trellis/spec/${sanitizePkgName(pkg.name)}/`);
|
|
286
292
|
}
|
|
287
|
-
|
|
288
|
-
return [".trellis/spec/frontend/"];
|
|
289
|
-
}
|
|
290
|
-
if (projectType === "backend") {
|
|
291
|
-
return [".trellis/spec/backend/"];
|
|
292
|
-
}
|
|
293
|
-
return [".trellis/spec/backend/", ".trellis/spec/frontend/"];
|
|
293
|
+
return [".trellis/spec/index.md"];
|
|
294
294
|
}
|
|
295
295
|
function getBootstrapPrdContent(projectType, pythonCmd, packages) {
|
|
296
296
|
const checklistItems = getBootstrapChecklistItems(projectType, packages);
|
|
@@ -307,10 +307,8 @@ exists under \`.trellis/tasks/\`. When they want to work on it, they should star
|
|
|
307
307
|
this task from a session that provides Trellis session identity.
|
|
308
308
|
|
|
309
309
|
**Your job**: help them populate \`.trellis/spec/\` with the team's real
|
|
310
|
-
coding conventions.
|
|
311
|
-
|
|
312
|
-
listed in per-task jsonl manifests. Empty spec = sub-agents write generic
|
|
313
|
-
code. Real spec = sub-agents match the team's actual patterns.
|
|
310
|
+
coding conventions. Future AI sessions use these conventions during implementation and review.
|
|
311
|
+
Task JSONL manifests are optional context references, not execution authority.
|
|
314
312
|
|
|
315
313
|
Don't dump instructions. Open with a short greeting, figure out if the repo
|
|
316
314
|
has any existing convention docs (CLAUDE.md, .cursorrules, etc.), and drive
|
|
@@ -325,30 +323,6 @@ ${checklistMarkdown}
|
|
|
325
323
|
---
|
|
326
324
|
|
|
327
325
|
## Spec files to populate
|
|
328
|
-
`;
|
|
329
|
-
const backendSection = `
|
|
330
|
-
|
|
331
|
-
### Backend guidelines
|
|
332
|
-
|
|
333
|
-
| File | What to document |
|
|
334
|
-
|------|------------------|
|
|
335
|
-
| \`.trellis/spec/backend/directory-structure.md\` | Where different file types go (routes, services, utils) |
|
|
336
|
-
| \`.trellis/spec/backend/error-handling.md\` | How errors are caught, logged, and returned |
|
|
337
|
-
| \`.trellis/spec/backend/logging-guidelines.md\` | Log levels, format, what to log |
|
|
338
|
-
| \`.trellis/spec/backend/quality-guidelines.md\` | Code review standards, testing requirements |
|
|
339
|
-
`;
|
|
340
|
-
const frontendSection = `
|
|
341
|
-
|
|
342
|
-
### Frontend guidelines
|
|
343
|
-
|
|
344
|
-
| File | What to document |
|
|
345
|
-
|------|------------------|
|
|
346
|
-
| \`.trellis/spec/frontend/directory-structure.md\` | Component/page/hook organization |
|
|
347
|
-
| \`.trellis/spec/frontend/component-guidelines.md\` | Component patterns, props conventions |
|
|
348
|
-
| \`.trellis/spec/frontend/hook-guidelines.md\` | Custom hook naming, patterns |
|
|
349
|
-
| \`.trellis/spec/frontend/state-management.md\` | State library, patterns, what goes where |
|
|
350
|
-
| \`.trellis/spec/frontend/type-safety.md\` | TypeScript conventions, type organization |
|
|
351
|
-
| \`.trellis/spec/frontend/quality-guidelines.md\` | Linting, testing, accessibility |
|
|
352
326
|
`;
|
|
353
327
|
const footer = `
|
|
354
328
|
|
|
@@ -400,8 +374,7 @@ Scan real code to discover patterns. Before writing each spec file:
|
|
|
400
374
|
### Step 3: Document reality, not ideals
|
|
401
375
|
|
|
402
376
|
**Critical**: write what the code *actually does*, not what it should do.
|
|
403
|
-
|
|
404
|
-
codebase will cause sub-agents to write code that looks out of place.
|
|
377
|
+
AI sessions follow the spec, so describe existing patterns accurately.
|
|
405
378
|
|
|
406
379
|
If the team has known tech debt, document the current state — improvement
|
|
407
380
|
is a separate conversation, not a bootstrap concern.
|
|
@@ -410,13 +383,11 @@ is a separate conversation, not a bootstrap concern.
|
|
|
410
383
|
|
|
411
384
|
## Quick explainer of the runtime (share when they ask "why do we need spec at all")
|
|
412
385
|
|
|
413
|
-
-
|
|
414
|
-
|
|
415
|
-
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
into every sub-agent prompt, so the sub-agent codes/reviews per team
|
|
419
|
-
conventions without anyone pasting them manually.
|
|
386
|
+
- The main session implements and verifies the authorized contract.
|
|
387
|
+
- Tasks may have optional \`implement.jsonl\` / \`check.jsonl\` context manifests.
|
|
388
|
+
- Supported hooks inject current task and phase context. Without hook
|
|
389
|
+
context, explicitly read those references and the applicable spec indexes;
|
|
390
|
+
inspect the current phase with \`task.py phase show <task>\`.
|
|
420
391
|
- Source of truth: \`.trellis/spec/\`. That's why filling it well now pays
|
|
421
392
|
off forever.
|
|
422
393
|
|
|
@@ -448,27 +419,13 @@ etc.) I can pull from, or should I scan the codebase from scratch?"
|
|
|
448
419
|
if (packages && packages.length > 0) {
|
|
449
420
|
// Monorepo: generate per-package sections
|
|
450
421
|
for (const pkg of packages) {
|
|
451
|
-
const pkgType = pkg.type === "unknown" ? "fullstack" : pkg.type;
|
|
452
422
|
const specName = sanitizePkgName(pkg.name);
|
|
453
|
-
content += `\n### Package: ${pkg.name}
|
|
454
|
-
if (pkgType !== "frontend") {
|
|
455
|
-
content += `\n- Backend guidelines: \`.trellis/spec/${specName}/backend/\`\n`;
|
|
456
|
-
}
|
|
457
|
-
if (pkgType !== "backend") {
|
|
458
|
-
content += `\n- Frontend guidelines: \`.trellis/spec/${specName}/frontend/\`\n`;
|
|
459
|
-
}
|
|
423
|
+
content += `\n### Package: ${pkg.name}\n\nRead and populate \`.trellis/spec/${specName}/index.md\`.\n`;
|
|
460
424
|
}
|
|
461
425
|
}
|
|
462
|
-
else if (projectType === "frontend") {
|
|
463
|
-
content += frontendSection;
|
|
464
|
-
}
|
|
465
|
-
else if (projectType === "backend") {
|
|
466
|
-
content += backendSection;
|
|
467
|
-
}
|
|
468
426
|
else {
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
content += frontendSection;
|
|
427
|
+
content +=
|
|
428
|
+
"\nRead and populate `.trellis/spec/index.md`; add only evidence-backed topics.\n";
|
|
472
429
|
}
|
|
473
430
|
content += footer;
|
|
474
431
|
return content;
|
|
@@ -577,8 +534,8 @@ code every session.
|
|
|
577
534
|
carrying the current task + phase hint.
|
|
578
535
|
- **\`/trellis:continue\`** reads the active phase from the Trellis task record
|
|
579
536
|
and routes to that phase's Skill.
|
|
580
|
-
-
|
|
581
|
-
|
|
537
|
+
- Collaboration uses \`trellis teamwork\` for read-only packages or
|
|
538
|
+
\`paseo-based-parallelism\` for authorized implementation packages.
|
|
582
539
|
|
|
583
540
|
File layout (mention when they ask "where does what live"):
|
|
584
541
|
- \`.trellis/.runtime/sessions/<session>.json\` — session active-task state, gitignored
|
|
@@ -663,32 +620,43 @@ async function handleReinit(cwd, options, developerName, pythonCmd) {
|
|
|
663
620
|
if (options.yes) {
|
|
664
621
|
console.log(chalk.gray(`Already initialized with: ${configuredNames}`));
|
|
665
622
|
console.log(chalk.gray("Use platform flags (e.g., --codex) or -u <name> to add platforms/developer."));
|
|
666
|
-
return true;
|
|
667
623
|
}
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
{
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
624
|
+
else {
|
|
625
|
+
console.log(chalk.gray(`\n Already initialized with: ${configuredNames}\n`));
|
|
626
|
+
const { action } = await inquirer.prompt([
|
|
627
|
+
{
|
|
628
|
+
type: "list",
|
|
629
|
+
name: "action",
|
|
630
|
+
message: "Trellis is already initialized. What would you like to do?",
|
|
631
|
+
choices: [
|
|
632
|
+
{ name: "Add AI platform(s)", value: "add-platform" },
|
|
633
|
+
{
|
|
634
|
+
name: "Set up developer identity on this device",
|
|
635
|
+
value: "add-developer",
|
|
636
|
+
},
|
|
637
|
+
{ name: "Full re-initialize", value: "full" },
|
|
638
|
+
],
|
|
639
|
+
},
|
|
640
|
+
]);
|
|
641
|
+
if (action === "full") {
|
|
642
|
+
return false; // Fall through to full init
|
|
643
|
+
}
|
|
644
|
+
if (action === "add-platform")
|
|
645
|
+
doAddPlatforms = true;
|
|
646
|
+
if (action === "add-developer")
|
|
647
|
+
doAddDeveloper = true;
|
|
686
648
|
}
|
|
687
|
-
if (action === "add-platform")
|
|
688
|
-
doAddPlatforms = true;
|
|
689
|
-
if (action === "add-developer")
|
|
690
|
-
doAddDeveloper = true;
|
|
691
649
|
}
|
|
650
|
+
const specResult = ensureSpecIndex(cwd);
|
|
651
|
+
console.log(chalk.gray(`Spec root index: ${specResult}. Source-backed conventions require trellis-spec-bootstrap review.`));
|
|
652
|
+
const rootWritten = startRecordingWrites(cwd);
|
|
653
|
+
try {
|
|
654
|
+
await createRootFiles(cwd, options);
|
|
655
|
+
}
|
|
656
|
+
finally {
|
|
657
|
+
stopRecordingWrites();
|
|
658
|
+
}
|
|
659
|
+
initializeHashes(cwd, { trackedPaths: rootWritten, merge: true });
|
|
692
660
|
// --- Add platforms ---
|
|
693
661
|
if (doAddPlatforms) {
|
|
694
662
|
if (platformsToAdd.length === 0) {
|
|
@@ -769,11 +737,7 @@ async function handleReinit(cwd, options, developerName, pythonCmd) {
|
|
|
769
737
|
// joiner onboarding onto an existing Trellis project.
|
|
770
738
|
const hadDeveloperFileBefore = fs.existsSync(path.join(cwd, DIR_NAMES.WORKFLOW, FILE_NAMES.DEVELOPER));
|
|
771
739
|
try {
|
|
772
|
-
|
|
773
|
-
execSync(`${pythonCmd} "${scriptPath}" "${devName}"`, {
|
|
774
|
-
cwd,
|
|
775
|
-
stdio: "pipe",
|
|
776
|
-
});
|
|
740
|
+
initializeDeveloper(cwd, pythonCmd, devName);
|
|
777
741
|
console.log(chalk.green(`✓ Developer "${devName}" initialized`));
|
|
778
742
|
}
|
|
779
743
|
catch {
|
|
@@ -850,11 +814,24 @@ function writeMonorepoConfig(cwd, packages) {
|
|
|
850
814
|
// Use first non-submodule package as default, fallback to first package
|
|
851
815
|
const defaultPkg = packages.find((p) => !p.isSubmodule)?.name ?? packages[0]?.name;
|
|
852
816
|
if (defaultPkg) {
|
|
853
|
-
lines.push(`default_package: ${defaultPkg}`);
|
|
817
|
+
lines.push(`default_package: ${sanitizePkgName(defaultPkg)}`);
|
|
854
818
|
}
|
|
855
819
|
fs.writeFileSync(configPath, content.trimEnd() + "\n" + lines.join("\n") + "\n", "utf-8");
|
|
856
820
|
}
|
|
857
821
|
export async function init(options) {
|
|
822
|
+
// Existing legacy projects must use the ownership-aware update transaction.
|
|
823
|
+
assertCurrentExecutionTree(process.cwd());
|
|
824
|
+
const projectRoot = fs.realpathSync(process.cwd());
|
|
825
|
+
const otherPlatformSelected = !options.codex &&
|
|
826
|
+
Object.values(AI_TOOLS).some((tool) => options[tool.cliFlag] === true);
|
|
827
|
+
if (otherPlatformSelected && (options.trustCodex || options.codegraph))
|
|
828
|
+
throw new Error("Codex project automation requires selecting the Codex platform");
|
|
829
|
+
const projectPlan = otherPlatformSelected
|
|
830
|
+
? { trustCodex: false, codegraph: false }
|
|
831
|
+
: resolveProjectPolicy(projectRoot, options);
|
|
832
|
+
if (options.codex ||
|
|
833
|
+
fs.existsSync(path.join(projectRoot, ".codex/config.toml")))
|
|
834
|
+
await preflightProjectInit(projectRoot, projectPlan);
|
|
858
835
|
return withAssetMaintenance(process.cwd(), async () => {
|
|
859
836
|
// Refuse to run in $HOME — running here would scoop platform runtime data
|
|
860
837
|
// (Claude/Codex/OpenCode session histories etc.) into the trellis hash
|
|
@@ -938,8 +915,10 @@ export async function init(options) {
|
|
|
938
915
|
!tasksEmptyEarly &&
|
|
939
916
|
!hasTemplateRequest) {
|
|
940
917
|
const reinitDone = await handleReinit(cwd, options, developerName, pythonCmd);
|
|
941
|
-
if (reinitDone)
|
|
918
|
+
if (reinitDone) {
|
|
919
|
+
await completeProjectInit(projectRoot, projectPlan);
|
|
942
920
|
return;
|
|
921
|
+
}
|
|
943
922
|
// reinitDone === false means user chose "full re-initialize" → fall through
|
|
944
923
|
}
|
|
945
924
|
if (!developerName && !options.yes) {
|
|
@@ -1053,7 +1032,10 @@ export async function init(options) {
|
|
|
1053
1032
|
name: "specSource",
|
|
1054
1033
|
message: `Spec source for ${pkg.name} (${pkg.path}):`,
|
|
1055
1034
|
choices: [
|
|
1056
|
-
{
|
|
1035
|
+
{
|
|
1036
|
+
name: "From scratch (Trellis default)",
|
|
1037
|
+
value: "blank",
|
|
1038
|
+
},
|
|
1057
1039
|
{ name: "Download remote template", value: "remote" },
|
|
1058
1040
|
],
|
|
1059
1041
|
default: "blank",
|
|
@@ -1480,6 +1462,7 @@ export async function init(options) {
|
|
|
1480
1462
|
// platform/root entries — replacing the previous "walk every managed dir"
|
|
1481
1463
|
// approach that swept user-owned runtime files into the manifest
|
|
1482
1464
|
// (.codex/sessions/, .claude/projects/, pre-existing AGENTS.md).
|
|
1465
|
+
const previousHashes = loadHashes(cwd);
|
|
1483
1466
|
const writtenPaths = startRecordingWrites(cwd);
|
|
1484
1467
|
try {
|
|
1485
1468
|
// Create workflow structure with project type
|
|
@@ -1490,6 +1473,7 @@ export async function init(options) {
|
|
|
1490
1473
|
packages: monorepoPackages,
|
|
1491
1474
|
remoteSpecPackages,
|
|
1492
1475
|
workflowMdOverride,
|
|
1476
|
+
isFirstInit,
|
|
1493
1477
|
});
|
|
1494
1478
|
// Write monorepo packages to config.yaml (non-destructive patch)
|
|
1495
1479
|
if (monorepoPackages) {
|
|
@@ -1518,7 +1502,7 @@ export async function init(options) {
|
|
|
1518
1502
|
logPythonAdaptationNotice(pythonCmd);
|
|
1519
1503
|
}
|
|
1520
1504
|
// Create root files (skip if exists)
|
|
1521
|
-
await createRootFiles(cwd);
|
|
1505
|
+
await createRootFiles(cwd, options);
|
|
1522
1506
|
}
|
|
1523
1507
|
finally {
|
|
1524
1508
|
stopRecordingWrites();
|
|
@@ -1528,6 +1512,15 @@ export async function init(options) {
|
|
|
1528
1512
|
}
|
|
1529
1513
|
// Initialize template hashes for modification tracking
|
|
1530
1514
|
const hashedCount = initializeHashes(cwd, { trackedPaths: writtenPaths });
|
|
1515
|
+
const nextHashes = loadHashes(cwd);
|
|
1516
|
+
if (previousHashes[FILE_NAMES.AGENTS] &&
|
|
1517
|
+
!writtenPaths.has(FILE_NAMES.AGENTS))
|
|
1518
|
+
nextHashes[FILE_NAMES.AGENTS] = previousHashes[FILE_NAMES.AGENTS];
|
|
1519
|
+
if (writtenPaths.has(CODEX_CONFIG_PATH))
|
|
1520
|
+
nextHashes[CODEX_CONFIG_PATH] = computeHash(getCodexConfigTemplate().content);
|
|
1521
|
+
else if (previousHashes[CODEX_CONFIG_PATH])
|
|
1522
|
+
nextHashes[CODEX_CONFIG_PATH] = previousHashes[CODEX_CONFIG_PATH];
|
|
1523
|
+
saveHashes(cwd, nextHashes);
|
|
1531
1524
|
if (useRemoteTemplate) {
|
|
1532
1525
|
const specFilesToHash = new Map();
|
|
1533
1526
|
for (const relativePath of collectSpecPaths(cwd)) {
|
|
@@ -1551,11 +1544,7 @@ export async function init(options) {
|
|
|
1551
1544
|
// Initialize developer identity (silent - no output)
|
|
1552
1545
|
if (developerName) {
|
|
1553
1546
|
try {
|
|
1554
|
-
|
|
1555
|
-
execSync(`${pythonCmd} "${scriptPath}" "${developerName}"`, {
|
|
1556
|
-
cwd,
|
|
1557
|
-
stdio: "pipe", // Silent
|
|
1558
|
-
});
|
|
1547
|
+
initializeDeveloper(cwd, pythonCmd, developerName);
|
|
1559
1548
|
}
|
|
1560
1549
|
catch {
|
|
1561
1550
|
// Silent failure - user can run init_developer.py manually
|
|
@@ -1590,6 +1579,7 @@ export async function init(options) {
|
|
|
1590
1579
|
}
|
|
1591
1580
|
}
|
|
1592
1581
|
}
|
|
1582
|
+
await completeProjectInit(projectRoot, projectPlan);
|
|
1593
1583
|
});
|
|
1594
1584
|
}
|
|
1595
1585
|
/**
|
|
@@ -1607,12 +1597,40 @@ function askInput(prompt) {
|
|
|
1607
1597
|
});
|
|
1608
1598
|
});
|
|
1609
1599
|
}
|
|
1610
|
-
async function createRootFiles(cwd) {
|
|
1600
|
+
async function createRootFiles(cwd, options) {
|
|
1611
1601
|
const agentsPath = path.join(cwd, FILE_NAMES.AGENTS);
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1602
|
+
const previous = readManagedMarkdown(agentsPath);
|
|
1603
|
+
if (previous !== null) {
|
|
1604
|
+
const block = managedBlock(previous, TRELLIS_BLOCK_START, TRELLIS_BLOCK_END);
|
|
1605
|
+
if (options.skipExisting && !options.force) {
|
|
1606
|
+
console.log(chalk.gray(` ○ Skipped: AGENTS.md${block ? "" : " (Trellis guidance not installed)"}`));
|
|
1607
|
+
return;
|
|
1608
|
+
}
|
|
1609
|
+
if (block && !options.force) {
|
|
1610
|
+
if (options.yes || !process.stdin.isTTY)
|
|
1611
|
+
return;
|
|
1612
|
+
const answer = await inquirer.prompt([
|
|
1613
|
+
{
|
|
1614
|
+
type: "list",
|
|
1615
|
+
name: "action",
|
|
1616
|
+
message: "AGENTS.md already has Trellis guidance.",
|
|
1617
|
+
choices: [
|
|
1618
|
+
{ name: "Keep existing Trellis block", value: "skip" },
|
|
1619
|
+
{ name: "Update only Trellis block", value: "overwrite" },
|
|
1620
|
+
],
|
|
1621
|
+
},
|
|
1622
|
+
]);
|
|
1623
|
+
if (answer.action !== "overwrite")
|
|
1624
|
+
return;
|
|
1625
|
+
}
|
|
1616
1626
|
}
|
|
1627
|
+
const next = mergeManagedMarkdown(previous ?? "", agentsMdContent, TRELLIS_BLOCK_START, TRELLIS_BLOCK_END);
|
|
1628
|
+
if (next === previous)
|
|
1629
|
+
return;
|
|
1630
|
+
if (readManagedMarkdown(agentsPath) !== previous)
|
|
1631
|
+
throw new Error("AGENTS.md changed before write");
|
|
1632
|
+
writeFileAtomic(agentsPath, next, previous === null ? undefined : fs.statSync(agentsPath).mode);
|
|
1633
|
+
recordWrite(agentsPath);
|
|
1634
|
+
console.log(chalk.blue("📄 Installed Trellis guidance in AGENTS.md"));
|
|
1617
1635
|
}
|
|
1618
1636
|
//# sourceMappingURL=init.js.map
|