@pennixrv/trellis 0.7.0-beta.9 → 0.7.1-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +14 -26
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/ablate.js +1 -1
- package/dist/commands/ablate.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +30 -56
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/task-progress.d.ts +2 -0
- package/dist/commands/task-progress.d.ts.map +1 -1
- package/dist/commands/task-progress.js +37 -30
- package/dist/commands/task-progress.js.map +1 -1
- package/dist/commands/{channel → teamwork}/adapters/claude.d.ts +3 -3
- package/dist/commands/teamwork/adapters/claude.d.ts.map +1 -0
- package/dist/commands/{channel → teamwork}/adapters/claude.js +3 -3
- package/dist/commands/teamwork/adapters/claude.js.map +1 -0
- package/dist/commands/{channel → teamwork}/adapters/codex.d.ts +1 -15
- package/dist/commands/teamwork/adapters/codex.d.ts.map +1 -0
- package/dist/commands/{channel → teamwork}/adapters/codex.js +5 -42
- package/dist/commands/teamwork/adapters/codex.js.map +1 -0
- package/dist/commands/{channel → teamwork}/adapters/index.d.ts +6 -6
- package/dist/commands/teamwork/adapters/index.d.ts.map +1 -0
- package/dist/commands/{channel → teamwork}/adapters/index.js +16 -52
- package/dist/commands/teamwork/adapters/index.js.map +1 -0
- package/dist/commands/{channel → teamwork}/adapters/types.d.ts +2 -2
- package/dist/commands/teamwork/adapters/types.d.ts.map +1 -0
- package/dist/commands/teamwork/adapters/types.js.map +1 -0
- package/dist/commands/{channel → teamwork}/agent-loader.d.ts +2 -4
- package/dist/commands/teamwork/agent-loader.d.ts.map +1 -0
- package/dist/commands/{channel → teamwork}/agent-loader.js +4 -35
- package/dist/commands/teamwork/agent-loader.js.map +1 -0
- package/dist/commands/teamwork/artifact.d.ts +177 -0
- package/dist/commands/teamwork/artifact.d.ts.map +1 -0
- package/dist/commands/teamwork/artifact.js +908 -0
- package/dist/commands/teamwork/artifact.js.map +1 -0
- package/dist/commands/{channel → teamwork}/context-loader.d.ts +1 -1
- package/dist/commands/teamwork/context-loader.d.ts.map +1 -0
- package/dist/commands/{channel → teamwork}/context-loader.js +12 -12
- package/dist/commands/teamwork/context-loader.js.map +1 -0
- package/dist/commands/{channel → teamwork}/context-trust.d.ts +6 -6
- package/dist/commands/teamwork/context-trust.d.ts.map +1 -0
- package/dist/commands/{channel → teamwork}/context-trust.js +16 -16
- package/dist/commands/teamwork/context-trust.js.map +1 -0
- package/dist/commands/teamwork/context.d.ts +16 -0
- package/dist/commands/teamwork/context.d.ts.map +1 -0
- package/dist/commands/{channel → teamwork}/context.js +17 -17
- package/dist/commands/teamwork/context.js.map +1 -0
- package/dist/commands/teamwork/coordinator.d.ts +89 -0
- package/dist/commands/teamwork/coordinator.d.ts.map +1 -0
- package/dist/commands/teamwork/coordinator.js +1198 -0
- package/dist/commands/teamwork/coordinator.js.map +1 -0
- package/dist/commands/teamwork/create.d.ts +23 -0
- package/dist/commands/teamwork/create.d.ts.map +1 -0
- package/dist/commands/teamwork/create.js +39 -0
- package/dist/commands/teamwork/create.js.map +1 -0
- package/dist/commands/{channel → teamwork}/dev-parse-trace.d.ts +1 -1
- package/dist/commands/teamwork/dev-parse-trace.d.ts.map +1 -0
- package/dist/commands/{channel → teamwork}/dev-parse-trace.js +1 -1
- package/dist/commands/teamwork/dev-parse-trace.js.map +1 -0
- package/dist/commands/{channel → teamwork}/guard.d.ts +27 -46
- package/dist/commands/teamwork/guard.d.ts.map +1 -0
- package/dist/commands/{channel → teamwork}/guard.js +54 -156
- package/dist/commands/teamwork/guard.js.map +1 -0
- package/dist/commands/teamwork/index.d.ts +3 -0
- package/dist/commands/teamwork/index.d.ts.map +1 -0
- package/dist/commands/{channel → teamwork}/index.js +135 -165
- package/dist/commands/teamwork/index.js.map +1 -0
- package/dist/commands/{channel → teamwork}/interrupt.d.ts +1 -1
- package/dist/commands/teamwork/interrupt.d.ts.map +1 -0
- package/dist/commands/teamwork/interrupt.js +22 -0
- package/dist/commands/teamwork/interrupt.js.map +1 -0
- package/dist/commands/teamwork/kill.d.ts +7 -0
- package/dist/commands/teamwork/kill.d.ts.map +1 -0
- package/dist/commands/{channel → teamwork}/kill.js +21 -21
- package/dist/commands/teamwork/kill.js.map +1 -0
- package/dist/commands/teamwork/list.d.ts +17 -0
- package/dist/commands/teamwork/list.d.ts.map +1 -0
- package/dist/commands/{channel → teamwork}/list.js +18 -27
- package/dist/commands/teamwork/list.js.map +1 -0
- package/dist/commands/{channel → teamwork}/messages.d.ts +1 -1
- package/dist/commands/teamwork/messages.d.ts.map +1 -0
- package/dist/commands/{channel → teamwork}/messages.js +18 -18
- package/dist/commands/teamwork/messages.js.map +1 -0
- package/dist/commands/teamwork/profiles.d.ts +25 -0
- package/dist/commands/teamwork/profiles.d.ts.map +1 -0
- package/dist/commands/teamwork/profiles.js +125 -0
- package/dist/commands/teamwork/profiles.js.map +1 -0
- package/dist/commands/teamwork/rm.d.ts +27 -0
- package/dist/commands/teamwork/rm.d.ts.map +1 -0
- package/dist/commands/{channel → teamwork}/rm.js +21 -22
- package/dist/commands/teamwork/rm.js.map +1 -0
- package/dist/commands/teamwork/run.d.ts +29 -0
- package/dist/commands/{channel → teamwork}/run.d.ts.map +1 -1
- package/dist/commands/teamwork/run.js +129 -0
- package/dist/commands/teamwork/run.js.map +1 -0
- package/dist/commands/{channel → teamwork}/send.d.ts +1 -1
- package/dist/commands/teamwork/send.d.ts.map +1 -0
- package/dist/commands/{channel → teamwork}/send.js +7 -7
- package/dist/commands/teamwork/send.js.map +1 -0
- package/dist/commands/{channel → teamwork}/spawn.d.ts +8 -12
- package/dist/commands/teamwork/spawn.d.ts.map +1 -0
- package/dist/commands/{channel → teamwork}/spawn.js +51 -112
- package/dist/commands/teamwork/spawn.js.map +1 -0
- package/dist/commands/teamwork/store/events.d.ts +22 -0
- package/dist/commands/teamwork/store/events.d.ts.map +1 -0
- package/dist/commands/{channel → teamwork}/store/events.js +8 -8
- package/dist/commands/teamwork/store/events.js.map +1 -0
- package/dist/commands/teamwork/store/filter.d.ts +3 -0
- package/dist/commands/teamwork/store/filter.d.ts.map +1 -0
- package/dist/commands/teamwork/store/filter.js +2 -0
- package/dist/commands/teamwork/store/filter.js.map +1 -0
- package/dist/commands/{channel → teamwork}/store/lock.d.ts +1 -1
- package/dist/commands/teamwork/store/lock.d.ts.map +1 -0
- package/dist/commands/{channel → teamwork}/store/lock.js +2 -2
- package/dist/commands/teamwork/store/lock.js.map +1 -0
- package/dist/commands/{channel → teamwork}/store/paths.d.ts +18 -32
- package/dist/commands/teamwork/store/paths.d.ts.map +1 -0
- package/dist/commands/{channel → teamwork}/store/paths.js +42 -109
- package/dist/commands/teamwork/store/paths.js.map +1 -0
- package/dist/commands/teamwork/store/schema.d.ts +18 -0
- package/dist/commands/teamwork/store/schema.d.ts.map +1 -0
- package/dist/commands/teamwork/store/schema.js +23 -0
- package/dist/commands/teamwork/store/schema.js.map +1 -0
- package/dist/commands/{channel → teamwork}/store/thread-state.d.ts +3 -3
- package/dist/commands/teamwork/store/thread-state.d.ts.map +1 -0
- package/dist/commands/{channel → teamwork}/store/thread-state.js +1 -1
- package/dist/commands/teamwork/store/thread-state.js.map +1 -0
- package/dist/commands/teamwork/store/watch.d.ts +19 -0
- package/dist/commands/teamwork/store/watch.d.ts.map +1 -0
- package/dist/commands/{channel → teamwork}/store/watch.js +8 -8
- package/dist/commands/teamwork/store/watch.js.map +1 -0
- package/dist/commands/teamwork/supervisor/idle.d.ts.map +1 -0
- package/dist/commands/teamwork/supervisor/idle.js.map +1 -0
- package/dist/commands/{channel → teamwork}/supervisor/inbox.d.ts +2 -2
- package/dist/commands/teamwork/supervisor/inbox.d.ts.map +1 -0
- package/dist/commands/{channel → teamwork}/supervisor/inbox.js +14 -14
- package/dist/commands/teamwork/supervisor/inbox.js.map +1 -0
- package/dist/commands/{channel → teamwork}/supervisor/shutdown.d.ts +3 -6
- package/dist/commands/teamwork/supervisor/shutdown.d.ts.map +1 -0
- package/dist/commands/{channel → teamwork}/supervisor/shutdown.js +7 -17
- package/dist/commands/teamwork/supervisor/shutdown.js.map +1 -0
- package/dist/commands/{channel → teamwork}/supervisor/stdout.d.ts +3 -5
- package/dist/commands/teamwork/supervisor/stdout.d.ts.map +1 -0
- package/dist/commands/{channel → teamwork}/supervisor/stdout.js +12 -23
- package/dist/commands/teamwork/supervisor/stdout.js.map +1 -0
- package/dist/commands/teamwork/supervisor/turns.d.ts.map +1 -0
- package/dist/commands/teamwork/supervisor/turns.js.map +1 -0
- package/dist/commands/{channel → teamwork}/supervisor/warning.d.ts +5 -5
- package/dist/commands/teamwork/supervisor/warning.d.ts.map +1 -0
- package/dist/commands/{channel → teamwork}/supervisor/warning.js +6 -6
- package/dist/commands/teamwork/supervisor/warning.js.map +1 -0
- package/dist/commands/{channel → teamwork}/supervisor.d.ts +21 -21
- package/dist/commands/teamwork/supervisor.d.ts.map +1 -0
- package/dist/commands/{channel → teamwork}/supervisor.js +53 -63
- package/dist/commands/teamwork/supervisor.js.map +1 -0
- package/dist/commands/teamwork/teammate-adapters.d.ts +31 -0
- package/dist/commands/teamwork/teammate-adapters.d.ts.map +1 -0
- package/dist/commands/teamwork/teammate-adapters.js +96 -0
- package/dist/commands/teamwork/teammate-adapters.js.map +1 -0
- package/dist/commands/teamwork/teammate-config.d.ts +19 -0
- package/dist/commands/teamwork/teammate-config.d.ts.map +1 -0
- package/dist/commands/teamwork/teammate-config.js +97 -0
- package/dist/commands/teamwork/teammate-config.js.map +1 -0
- package/dist/commands/teamwork/teammate-launch.d.ts +58 -0
- package/dist/commands/teamwork/teammate-launch.d.ts.map +1 -0
- package/dist/commands/teamwork/teammate-launch.js +125 -0
- package/dist/commands/teamwork/teammate-launch.js.map +1 -0
- package/dist/commands/teamwork/text-body.d.ts +13 -0
- package/dist/commands/teamwork/text-body.d.ts.map +1 -0
- package/dist/commands/{channel → teamwork}/text-body.js +3 -3
- package/dist/commands/teamwork/text-body.js.map +1 -0
- package/dist/commands/teamwork/threads.d.ts +35 -0
- package/dist/commands/teamwork/threads.d.ts.map +1 -0
- package/dist/commands/{channel → teamwork}/threads.js +19 -19
- package/dist/commands/teamwork/threads.js.map +1 -0
- package/dist/commands/teamwork/title.d.ts +12 -0
- package/dist/commands/teamwork/title.d.ts.map +1 -0
- package/dist/commands/teamwork/title.js +24 -0
- package/dist/commands/teamwork/title.js.map +1 -0
- package/dist/commands/{channel → teamwork}/wait.d.ts +1 -5
- package/dist/commands/teamwork/wait.d.ts.map +1 -0
- package/dist/commands/{channel → teamwork}/wait.js +8 -21
- package/dist/commands/teamwork/wait.js.map +1 -0
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +48 -89
- package/dist/commands/update.js.map +1 -1
- package/dist/commands/workflow.d.ts +1 -1
- package/dist/commands/workflow.d.ts.map +1 -1
- package/dist/commands/workflow.js +9 -10
- package/dist/commands/workflow.js.map +1 -1
- package/dist/configurators/claude.d.ts +0 -17
- package/dist/configurators/claude.d.ts.map +1 -1
- package/dist/configurators/claude.js +2 -61
- package/dist/configurators/claude.js.map +1 -1
- package/dist/configurators/shared.d.ts.map +1 -1
- package/dist/configurators/shared.js +2 -2
- package/dist/configurators/shared.js.map +1 -1
- package/dist/configurators/snow.js +1 -1
- package/dist/configurators/snow.js.map +1 -1
- package/dist/configurators/workflow.d.ts +1 -1
- package/dist/configurators/workflow.js +5 -5
- package/dist/configurators/workflow.js.map +1 -1
- package/dist/constants/paths.d.ts +1 -1
- package/dist/constants/paths.d.ts.map +1 -1
- package/dist/constants/paths.js +1 -1
- package/dist/constants/paths.js.map +1 -1
- package/dist/migrations/manifests/0.7.0-beta.10.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.11.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.12.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.13.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.14.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.15.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.16.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.17.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.18.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.19.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.20.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.21.json +17 -0
- package/dist/migrations/manifests/0.7.0-beta.22.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.23.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.24.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.25.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.26.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.27.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.28.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.29.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.30.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.31.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.32.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.33.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.34.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.35.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.36.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.37.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.38.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.39.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.40.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.41.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.42.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.43.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.44.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.45.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.46.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.47.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.48.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.49.json +13 -0
- package/dist/migrations/manifests/0.7.0-beta.50.json +12 -0
- package/dist/migrations/manifests/0.7.0-beta.51.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.52.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.53.json +27 -0
- package/dist/migrations/manifests/0.7.0-beta.54.json +8 -0
- package/dist/migrations/manifests/0.7.1-beta.0.json +9 -0
- package/dist/migrations/manifests/0.7.1.json +9 -0
- package/dist/templates/claude/hooks/statusline.py +0 -7
- package/dist/templates/codex/hooks/session-start.py +31 -38
- package/dist/templates/common/bundled-skills/trellis-decision-space-construction-and-merging/SKILL.md +10 -0
- package/dist/templates/common/bundled-skills/trellis-decision-space-construction-and-merging/workflow.md +40 -0
- package/dist/templates/common/bundled-skills/trellis-delivery-review-and-closeout/SKILL.md +10 -0
- package/dist/templates/common/bundled-skills/trellis-delivery-review-and-closeout/workflow.md +55 -0
- package/dist/templates/common/bundled-skills/trellis-goal-exploration-and-requirements/SKILL.md +10 -0
- package/dist/templates/common/bundled-skills/trellis-goal-exploration-and-requirements/workflow.md +33 -0
- package/dist/templates/common/bundled-skills/trellis-meta/SKILL.md +25 -25
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-agents.md +1 -1
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-skills-or-commands.md +13 -19
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-spec-structure.md +1 -1
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-task-lifecycle.md +27 -75
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-workflow.md +17 -56
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/overview.md +1 -1
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/bundled-skills.md +14 -11
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/generated-files.md +0 -33
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/multi-agent-teamwork.md +32 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/spec-system.md +1 -1
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/task-system.md +25 -111
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/workflow.md +19 -60
- 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-session-insight/references/cli-quick-reference.md +1 -1
- package/dist/templates/common/bundled-skills/trellis-solution-design-and-convergence/SKILL.md +10 -0
- package/dist/templates/common/bundled-skills/trellis-solution-design-and-convergence/workflow.md +36 -0
- package/dist/templates/common/bundled-skills/trellis-task-implementation/SKILL.md +10 -0
- package/dist/templates/common/bundled-skills/trellis-task-implementation/workflow.md +29 -0
- package/dist/templates/common/bundled-skills/trellis-teamwork/SKILL.md +73 -0
- package/dist/templates/common/bundled-skills/trellis-teamwork/references/coordination-modes.md +29 -0
- package/dist/templates/common/bundled-skills/trellis-teamwork/references/teammate-configuration-matrix.md +31 -0
- package/dist/templates/common/bundled-skills/trellis-teamwork/references/teammate-processes.md +37 -0
- package/dist/templates/common/bundled-skills/trellis-teamwork/references/teamwork-plan-construction.md +78 -0
- package/dist/templates/common/commands/continue.md +9 -49
- package/dist/templates/common/commands/finish-work.md +10 -58
- package/dist/templates/common/commands/start.md +19 -49
- package/dist/templates/common/skills/brainstorm.md +11 -199
- package/dist/templates/copilot/hooks/session-start.py +30 -26
- package/dist/templates/copilot/prompts/brainstorm.prompt.md +7 -160
- package/dist/templates/copilot/prompts/finish-work.prompt.md +11 -88
- package/dist/templates/copilot/prompts/record-session.prompt.md +4 -12
- package/dist/templates/copilot/prompts/start.prompt.md +12 -10
- package/dist/templates/dsh/DSH.md +2 -2
- package/dist/templates/kiro/agents/trellis.json +2 -2
- package/dist/templates/markdown/agents.md +14 -3
- package/dist/templates/markdown/spec/guides/cross-layer-thinking-guide.md.txt +9 -8
- package/dist/templates/markdown/spec/guides/cross-platform-thinking-guide.md.txt +1 -1
- package/dist/templates/markdown/workspace-index.md +0 -1
- package/dist/templates/omp/extensions/trellis/index.ts.txt +28 -17
- package/dist/templates/opencode/lib/session-utils.js +20 -25
- package/dist/templates/opencode/lib/trellis-context.js +4 -76
- package/dist/templates/opencode/plugins/inject-subagent-context.js +5 -4
- package/dist/templates/opencode/plugins/inject-workflow-state.js +14 -17
- package/dist/templates/shared-hooks/inject-shell-session-context.py +3 -3
- package/dist/templates/shared-hooks/inject-subagent-context.py +445 -67
- package/dist/templates/shared-hooks/inject-workflow-state.py +44 -36
- package/dist/templates/shared-hooks/session-start.py +21 -33
- package/dist/templates/trellis/agents/delegated-worktree-primary-agent.md +18 -0
- package/dist/templates/trellis/agents/teammate-profiles.json +8 -0
- package/dist/templates/trellis/agents/teammate.md +63 -0
- package/dist/templates/trellis/config.yaml +29 -38
- package/dist/templates/trellis/gitignore.txt +1 -0
- package/dist/templates/trellis/index.d.ts +8 -12
- package/dist/templates/trellis/index.d.ts.map +1 -1
- package/dist/templates/trellis/index.js +14 -25
- package/dist/templates/trellis/index.js.map +1 -1
- package/dist/templates/trellis/scripts/add_session.py +1 -1
- package/dist/templates/trellis/scripts/common/__init__.py +0 -1
- package/dist/templates/trellis/scripts/common/active_task.py +136 -100
- package/dist/templates/trellis/scripts/common/config.py +7 -9
- package/dist/templates/trellis/scripts/common/git_context.py +1 -1
- package/dist/templates/trellis/scripts/common/io.py +19 -0
- package/dist/templates/trellis/scripts/common/paths.py +0 -1
- package/dist/templates/trellis/scripts/common/safe_commit.py +11 -90
- package/dist/templates/trellis/scripts/common/session_context.py +1 -8
- package/dist/templates/trellis/scripts/common/spec_match.py +1 -1
- package/dist/templates/trellis/scripts/common/task_context.py +152 -59
- package/dist/templates/trellis/scripts/common/task_continuity.py +598 -0
- package/dist/templates/trellis/scripts/common/task_store.py +70 -548
- package/dist/templates/trellis/scripts/common/task_utils.py +4 -98
- package/dist/templates/trellis/scripts/common/task_workflow.py +1096 -0
- package/dist/templates/trellis/scripts/common/tasks.py +5 -8
- package/dist/templates/trellis/scripts/common/workflow_phase.py +8 -7
- package/dist/templates/trellis/scripts/hooks/linear_sync.py +3 -3
- package/dist/templates/trellis/scripts/task.py +119 -377
- package/dist/templates/trellis/workflow.md +111 -706
- package/dist/utils/agent-refs.d.ts +5 -5
- package/dist/utils/agent-refs.js +6 -6
- package/dist/utils/file-writer.d.ts +3 -2
- package/dist/utils/file-writer.d.ts.map +1 -1
- package/dist/utils/file-writer.js +3 -2
- package/dist/utils/file-writer.js.map +1 -1
- package/dist/utils/managed-paths.d.ts +0 -7
- package/dist/utils/managed-paths.d.ts.map +1 -1
- package/dist/utils/managed-paths.js +0 -40
- package/dist/utils/managed-paths.js.map +1 -1
- package/dist/utils/manifest-prune.d.ts.map +1 -1
- package/dist/utils/manifest-prune.js +2 -11
- package/dist/utils/manifest-prune.js.map +1 -1
- package/dist/utils/uninstall-scrubbers.d.ts.map +1 -1
- package/dist/utils/uninstall-scrubbers.js +3 -3
- package/dist/utils/uninstall-scrubbers.js.map +1 -1
- package/dist/utils/workflow-resolver.d.ts +10 -16
- package/dist/utils/workflow-resolver.d.ts.map +1 -1
- package/dist/utils/workflow-resolver.js +25 -36
- package/dist/utils/workflow-resolver.js.map +1 -1
- package/package.json +2 -2
- package/dist/commands/channel/adapters/claude.d.ts.map +0 -1
- package/dist/commands/channel/adapters/claude.js.map +0 -1
- package/dist/commands/channel/adapters/codex.d.ts.map +0 -1
- package/dist/commands/channel/adapters/codex.js.map +0 -1
- package/dist/commands/channel/adapters/index.d.ts.map +0 -1
- package/dist/commands/channel/adapters/index.js.map +0 -1
- package/dist/commands/channel/adapters/types.d.ts.map +0 -1
- package/dist/commands/channel/adapters/types.js.map +0 -1
- package/dist/commands/channel/agent-loader.d.ts.map +0 -1
- package/dist/commands/channel/agent-loader.js.map +0 -1
- package/dist/commands/channel/context-loader.d.ts.map +0 -1
- package/dist/commands/channel/context-loader.js.map +0 -1
- package/dist/commands/channel/context-trust.d.ts.map +0 -1
- package/dist/commands/channel/context-trust.js.map +0 -1
- package/dist/commands/channel/context.d.ts +0 -16
- package/dist/commands/channel/context.d.ts.map +0 -1
- package/dist/commands/channel/context.js.map +0 -1
- package/dist/commands/channel/create.d.ts +0 -29
- package/dist/commands/channel/create.d.ts.map +0 -1
- package/dist/commands/channel/create.js +0 -47
- package/dist/commands/channel/create.js.map +0 -1
- package/dist/commands/channel/dev-parse-trace.d.ts.map +0 -1
- package/dist/commands/channel/dev-parse-trace.js.map +0 -1
- package/dist/commands/channel/guard.d.ts.map +0 -1
- package/dist/commands/channel/guard.js.map +0 -1
- package/dist/commands/channel/index.d.ts +0 -3
- package/dist/commands/channel/index.d.ts.map +0 -1
- package/dist/commands/channel/index.js.map +0 -1
- package/dist/commands/channel/interrupt.d.ts.map +0 -1
- package/dist/commands/channel/interrupt.js +0 -22
- package/dist/commands/channel/interrupt.js.map +0 -1
- package/dist/commands/channel/kill.d.ts +0 -7
- package/dist/commands/channel/kill.d.ts.map +0 -1
- package/dist/commands/channel/kill.js.map +0 -1
- package/dist/commands/channel/list.d.ts +0 -18
- package/dist/commands/channel/list.d.ts.map +0 -1
- package/dist/commands/channel/list.js.map +0 -1
- package/dist/commands/channel/messages.d.ts.map +0 -1
- package/dist/commands/channel/messages.js.map +0 -1
- package/dist/commands/channel/rm.d.ts +0 -27
- package/dist/commands/channel/rm.d.ts.map +0 -1
- package/dist/commands/channel/rm.js.map +0 -1
- package/dist/commands/channel/run.d.ts +0 -32
- package/dist/commands/channel/run.js +0 -141
- package/dist/commands/channel/run.js.map +0 -1
- package/dist/commands/channel/send.d.ts.map +0 -1
- package/dist/commands/channel/send.js.map +0 -1
- package/dist/commands/channel/spawn.d.ts.map +0 -1
- package/dist/commands/channel/spawn.js.map +0 -1
- package/dist/commands/channel/store/events.d.ts +0 -22
- package/dist/commands/channel/store/events.d.ts.map +0 -1
- package/dist/commands/channel/store/events.js.map +0 -1
- package/dist/commands/channel/store/filter.d.ts +0 -3
- package/dist/commands/channel/store/filter.d.ts.map +0 -1
- package/dist/commands/channel/store/filter.js +0 -2
- package/dist/commands/channel/store/filter.js.map +0 -1
- package/dist/commands/channel/store/lock.d.ts.map +0 -1
- package/dist/commands/channel/store/lock.js.map +0 -1
- package/dist/commands/channel/store/paths.d.ts.map +0 -1
- package/dist/commands/channel/store/paths.js.map +0 -1
- package/dist/commands/channel/store/schema.d.ts +0 -27
- package/dist/commands/channel/store/schema.d.ts.map +0 -1
- package/dist/commands/channel/store/schema.js +0 -34
- package/dist/commands/channel/store/schema.js.map +0 -1
- package/dist/commands/channel/store/thread-state.d.ts.map +0 -1
- package/dist/commands/channel/store/thread-state.js.map +0 -1
- package/dist/commands/channel/store/watch.d.ts +0 -19
- package/dist/commands/channel/store/watch.d.ts.map +0 -1
- package/dist/commands/channel/store/watch.js.map +0 -1
- package/dist/commands/channel/supervisor/idle.d.ts.map +0 -1
- package/dist/commands/channel/supervisor/idle.js.map +0 -1
- package/dist/commands/channel/supervisor/inbox.d.ts.map +0 -1
- package/dist/commands/channel/supervisor/inbox.js.map +0 -1
- package/dist/commands/channel/supervisor/shutdown.d.ts.map +0 -1
- package/dist/commands/channel/supervisor/shutdown.js.map +0 -1
- package/dist/commands/channel/supervisor/stdout.d.ts.map +0 -1
- package/dist/commands/channel/supervisor/stdout.js.map +0 -1
- package/dist/commands/channel/supervisor/turns.d.ts.map +0 -1
- package/dist/commands/channel/supervisor/turns.js.map +0 -1
- package/dist/commands/channel/supervisor/warning.d.ts.map +0 -1
- package/dist/commands/channel/supervisor/warning.js.map +0 -1
- package/dist/commands/channel/supervisor.d.ts.map +0 -1
- package/dist/commands/channel/supervisor.js.map +0 -1
- package/dist/commands/channel/text-body.d.ts +0 -13
- package/dist/commands/channel/text-body.d.ts.map +0 -1
- package/dist/commands/channel/text-body.js.map +0 -1
- package/dist/commands/channel/threads.d.ts +0 -39
- package/dist/commands/channel/threads.d.ts.map +0 -1
- package/dist/commands/channel/threads.js.map +0 -1
- package/dist/commands/channel/title.d.ts +0 -12
- package/dist/commands/channel/title.d.ts.map +0 -1
- package/dist/commands/channel/title.js +0 -24
- package/dist/commands/channel/title.js.map +0 -1
- package/dist/commands/channel/wait.d.ts.map +0 -1
- package/dist/commands/channel/wait.js.map +0 -1
- package/dist/commands/channel/workers.d.ts +0 -9
- package/dist/commands/channel/workers.d.ts.map +0 -1
- package/dist/commands/channel/workers.js +0 -31
- package/dist/commands/channel/workers.js.map +0 -1
- package/dist/templates/common/bundled-skills/trellis-channel/SKILL.md +0 -69
- package/dist/templates/common/bundled-skills/trellis-channel/references/command-reference.md +0 -549
- package/dist/templates/common/bundled-skills/trellis-channel/references/forum.md +0 -233
- package/dist/templates/common/bundled-skills/trellis-channel/references/progress-debugging.md +0 -237
- package/dist/templates/common/bundled-skills/trellis-channel/references/subnode-work.md +0 -222
- package/dist/templates/common/bundled-skills/trellis-channel/references/workers.md +0 -295
- package/dist/templates/common/bundled-skills/trellis-channel/references/workflows.md +0 -131
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/multi-agent-channel.md +0 -70
- package/dist/templates/common/bundled-skills/trellis-research-record/SKILL.md +0 -14
- package/dist/templates/copilot/prompts/parallel.prompt.md +0 -204
- package/dist/templates/trellis/agents/check.md +0 -70
- package/dist/templates/trellis/agents/implement.md +0 -71
- package/dist/templates/trellis/agents/subnode.env +0 -4
- package/dist/templates/trellis/agents/subnode.md +0 -76
- package/dist/templates/trellis/scripts/common/context_projection.py +0 -508
- package/dist/templates/trellis/scripts/common/continuation_record.py +0 -450
- package/dist/templates/trellis/scripts/common/ownership_record.py +0 -439
- package/dist/templates/trellis/scripts/subnode_artifact.py +0 -735
- package/dist/templates/trellis/scripts/workspace_note.py +0 -126
- /package/dist/commands/{channel → teamwork}/adapters/types.js +0 -0
- /package/dist/commands/{channel → teamwork}/supervisor/idle.d.ts +0 -0
- /package/dist/commands/{channel → teamwork}/supervisor/idle.js +0 -0
- /package/dist/commands/{channel → teamwork}/supervisor/turns.d.ts +0 -0
- /package/dist/commands/{channel → teamwork}/supervisor/turns.js +0 -0
|
@@ -59,7 +59,7 @@ function isInsideRoot(root: string, candidate: string): boolean {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
// ---------------------------------------------------------------------------
|
|
62
|
-
// Trusted context roots (mirrors packages/cli/src/commands/
|
|
62
|
+
// Trusted context roots (mirrors packages/cli/src/commands/teamwork/context-trust.ts;
|
|
63
63
|
// standalone copy since templates don't import from the CLI package).
|
|
64
64
|
// ---------------------------------------------------------------------------
|
|
65
65
|
|
|
@@ -69,7 +69,7 @@ function stripTrustValue(s: string): string {
|
|
|
69
69
|
return s.trim().replace(/\s*#.*$/, "").trim().replace(/^['"]|['"]$/g, "");
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
function
|
|
72
|
+
function parseTeamworkTrustSection(content: string): { trustedDirs: string[]; autoTrustSymlinks?: boolean } {
|
|
73
73
|
const lines = content.split("\n");
|
|
74
74
|
const trustedDirs: string[] = [];
|
|
75
75
|
let autoTrustSymlinks: boolean | undefined;
|
|
@@ -115,7 +115,7 @@ function parseChannelTrustSection(content: string): { trustedDirs: string[]; aut
|
|
|
115
115
|
const val = stripTrustValue(boolMatch[1]!).toLowerCase();
|
|
116
116
|
if (val === "false") autoTrustSymlinks = false;
|
|
117
117
|
else if (val === "true") autoTrustSymlinks = true;
|
|
118
|
-
else process.stderr.write(`[
|
|
118
|
+
else process.stderr.write(`[teamwork] teamwork.auto_trust_trellis_symlinks: invalid value '${val}', ignoring\n`);
|
|
119
119
|
continue;
|
|
120
120
|
}
|
|
121
121
|
}
|
|
@@ -128,7 +128,7 @@ function resolveTrustedRoots(projectRoot: string): string[] {
|
|
|
128
128
|
let config: { trustedDirs: string[]; autoTrustSymlinks?: boolean } = { trustedDirs: [] };
|
|
129
129
|
if (existsSync(configPath)) {
|
|
130
130
|
try {
|
|
131
|
-
config =
|
|
131
|
+
config = parseTeamworkTrustSection(readFileSync(configPath, "utf-8"));
|
|
132
132
|
} catch {
|
|
133
133
|
// ignore
|
|
134
134
|
}
|
|
@@ -202,9 +202,9 @@ function displayProjectPath(projectRoot: string, filePath: string, taskDir?: str
|
|
|
202
202
|
function resolveActiveTaskStatus(
|
|
203
203
|
projectRoot: string,
|
|
204
204
|
contextKey: string | null,
|
|
205
|
-
): { status: string; taskDir: string | null; taskTitle: string | null } {
|
|
205
|
+
): { status: string; phaseStatus: string | null; taskDir: string | null; taskTitle: string | null } {
|
|
206
206
|
const sessionsDir = join(projectRoot, ".trellis", ".runtime", "sessions");
|
|
207
|
-
if (!existsSync(sessionsDir)) return { status: "no_task", taskDir: null, taskTitle: null };
|
|
207
|
+
if (!existsSync(sessionsDir)) return { status: "no_task", phaseStatus: null, taskDir: null, taskTitle: null };
|
|
208
208
|
|
|
209
209
|
// --- 通过 context key 解析 session 文件 ---
|
|
210
210
|
let sessionFilePath: string | null = null;
|
|
@@ -214,7 +214,7 @@ function resolveActiveTaskStatus(
|
|
|
214
214
|
if (existsSync(candidate)) {
|
|
215
215
|
sessionFilePath = candidate;
|
|
216
216
|
} else {
|
|
217
|
-
return { status: "no_task", taskDir: null, taskTitle: null };
|
|
217
|
+
return { status: "no_task", phaseStatus: null, taskDir: null, taskTitle: null };
|
|
218
218
|
}
|
|
219
219
|
} else {
|
|
220
220
|
// No identity: use single-session fallback only when there is exactly one session file.
|
|
@@ -222,12 +222,12 @@ function resolveActiveTaskStatus(
|
|
|
222
222
|
try {
|
|
223
223
|
sessionFiles = readdirSync(sessionsDir).filter((f) => f.endsWith(".json"));
|
|
224
224
|
} catch {
|
|
225
|
-
return { status: "no_task", taskDir: null, taskTitle: null };
|
|
225
|
+
return { status: "no_task", phaseStatus: null, taskDir: null, taskTitle: null };
|
|
226
226
|
}
|
|
227
227
|
if (sessionFiles.length === 1) {
|
|
228
228
|
sessionFilePath = join(sessionsDir, sessionFiles[0]);
|
|
229
229
|
} else {
|
|
230
|
-
return { status: "no_task", taskDir: null, taskTitle: null };
|
|
230
|
+
return { status: "no_task", phaseStatus: null, taskDir: null, taskTitle: null };
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
233
|
|
|
@@ -236,12 +236,12 @@ function resolveActiveTaskStatus(
|
|
|
236
236
|
try {
|
|
237
237
|
sessionData = JSON.parse(readFileSync(sessionFilePath, "utf-8"));
|
|
238
238
|
} catch {
|
|
239
|
-
return { status: "no_task", taskDir: null, taskTitle: null };
|
|
239
|
+
return { status: "no_task", phaseStatus: null, taskDir: null, taskTitle: null };
|
|
240
240
|
}
|
|
241
241
|
|
|
242
242
|
const currentTask = sessionData.current_task;
|
|
243
243
|
if (typeof currentTask !== "string" || !currentTask)
|
|
244
|
-
return { status: "no_task", taskDir: null, taskTitle: null };
|
|
244
|
+
return { status: "no_task", phaseStatus: null, taskDir: null, taskTitle: null };
|
|
245
245
|
|
|
246
246
|
// Same jail the jsonl-referenced files already go through below. `task.py`
|
|
247
247
|
// now refuses to store a ref that leaves the project, but a session file
|
|
@@ -249,19 +249,30 @@ function resolveActiveTaskStatus(
|
|
|
249
249
|
// rewrite session files — so a poisoned pointer outlives the upgrade that
|
|
250
250
|
// closed the writer.
|
|
251
251
|
const taskDir = resolveProjectFile(projectRoot, currentTask, resolveTrustedRoots(projectRoot));
|
|
252
|
-
if (!taskDir) return { status: "no_task", taskDir: null, taskTitle: null };
|
|
252
|
+
if (!taskDir) return { status: "no_task", phaseStatus: null, taskDir: null, taskTitle: null };
|
|
253
253
|
const taskJsonPath = join(taskDir, "task.json");
|
|
254
|
-
if (!existsSync(taskJsonPath)) return { status: "no_task", taskDir: null, taskTitle: null };
|
|
254
|
+
if (!existsSync(taskJsonPath)) return { status: "no_task", phaseStatus: null, taskDir: null, taskTitle: null };
|
|
255
255
|
|
|
256
256
|
let taskData: Record<string, unknown>;
|
|
257
257
|
try {
|
|
258
258
|
taskData = JSON.parse(readFileSync(taskJsonPath, "utf-8"));
|
|
259
259
|
} catch {
|
|
260
|
-
return { status: "no_task", taskDir: null, taskTitle: null };
|
|
260
|
+
return { status: "no_task", phaseStatus: null, taskDir: null, taskTitle: null };
|
|
261
261
|
}
|
|
262
262
|
|
|
263
|
+
const taskMeta = taskData.meta;
|
|
264
|
+
const phaseWorkflow = taskMeta && typeof taskMeta === "object" && !Array.isArray(taskMeta)
|
|
265
|
+
? (taskMeta as Record<string, unknown>).task_workflow as Record<string, unknown> | undefined
|
|
266
|
+
: undefined;
|
|
267
|
+
const route = phaseWorkflow?.phase_ids;
|
|
268
|
+
const phaseId = phaseWorkflow?.current_phase_id || (Array.isArray(route) ? route[route.length - 1] : undefined);
|
|
269
|
+
const phaseMap = phaseWorkflow?.phases;
|
|
270
|
+
const phase = typeof phaseId === "string" && phaseMap && typeof phaseMap === "object" && !Array.isArray(phaseMap)
|
|
271
|
+
? (phaseMap as Record<string, Record<string, unknown>>)[phaseId]
|
|
272
|
+
: null;
|
|
263
273
|
return {
|
|
264
|
-
status: typeof taskData.status === "string" ? taskData.status : "planning",
|
|
274
|
+
status: typeof phaseId === "string" && phase ? phaseId : (typeof taskData.status === "string" ? taskData.status : "planning"),
|
|
275
|
+
phaseStatus: typeof phase?.status === "string" ? phase.status : null,
|
|
265
276
|
taskDir,
|
|
266
277
|
taskTitle: typeof taskData.title === "string" ? taskData.title : null,
|
|
267
278
|
};
|
|
@@ -818,7 +829,7 @@ class TurnContextCache {
|
|
|
818
829
|
return { workflowMsg: this.workflowMsg };
|
|
819
830
|
}
|
|
820
831
|
|
|
821
|
-
const { status } = resolveActiveTaskStatus(projectRoot, contextKey);
|
|
832
|
+
const { status, phaseStatus } = resolveActiveTaskStatus(projectRoot, contextKey);
|
|
822
833
|
|
|
823
834
|
const workflowPath = join(projectRoot, ".trellis", "workflow.md");
|
|
824
835
|
let workflowMd = "";
|
|
@@ -839,7 +850,7 @@ class TurnContextCache {
|
|
|
839
850
|
// When skip keyword is present, skip workflow state injection this turn
|
|
840
851
|
this.workflowMsg = this.skipThisTurn
|
|
841
852
|
? ""
|
|
842
|
-
: `<workflow-state>\n${workflowBody}\n</workflow-state>\n\n<session-overview>\n${SESSION_OVERVIEW_TEXT}\n</session-overview>`;
|
|
853
|
+
: `<workflow-state>\n${phaseStatus ? `Phase: ${status} (${phaseStatus})\n` : ""}${workflowBody}\n</workflow-state>\n\n<session-overview>\n${SESSION_OVERVIEW_TEXT}\n</session-overview>`;
|
|
843
854
|
|
|
844
855
|
this.key = cacheKey;
|
|
845
856
|
this.timestamp = now;
|
|
@@ -71,12 +71,9 @@ function getTaskStatus(ctx, platformInput = null) {
|
|
|
71
71
|
const taskStatus = taskData.status || "unknown"
|
|
72
72
|
|
|
73
73
|
if (taskStatus === "completed") {
|
|
74
|
-
return `Status: COMPLETED\nTask: ${taskTitle}\nNext-Action:
|
|
74
|
+
return `Status: COMPLETED\nTask: ${taskTitle}\nNext-Action: Start another task or end the session; finish-work only records the session journal.`
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
const hasPrd = existsSync(join(taskDir, "prd.md"))
|
|
78
|
-
const hasDesign = existsSync(join(taskDir, "design.md"))
|
|
79
|
-
const hasImplementPlan = existsSync(join(taskDir, "implement.md"))
|
|
80
77
|
const artifactNames = ["prd.md", "design.md", "implement.md", "implement.jsonl", "check.jsonl"]
|
|
81
78
|
const present = artifactNames.filter(name => existsSync(join(taskDir, name)))
|
|
82
79
|
if (existsSync(join(taskDir, "research"))) present.push("research/")
|
|
@@ -87,24 +84,13 @@ function getTaskStatus(ctx, platformInput = null) {
|
|
|
87
84
|
(!existsSync(implementJsonl) || hasCuratedJsonlEntry(implementJsonl)) &&
|
|
88
85
|
(!existsSync(checkJsonl) || hasCuratedJsonlEntry(checkJsonl))
|
|
89
86
|
|
|
90
|
-
if (taskStatus === "planning" && !hasPrd) {
|
|
91
|
-
return `Status: PLANNING\nTask: ${taskTitle}\nPresent: ${presentLine}\nNext-Action: Load trellis-brainstorm and write prd.md. Stay in planning.`
|
|
92
|
-
}
|
|
93
|
-
|
|
94
87
|
if (taskStatus === "planning") {
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
if (missingComplex.length > 0) {
|
|
100
|
-
nextBits.push(
|
|
101
|
-
`Lightweight task can request start review with PRD-only; complex task must add ${missingComplex.join(", ")} before start`,
|
|
102
|
-
)
|
|
103
|
-
} else {
|
|
104
|
-
nextBits.push("Planning artifacts are present; ask for review before `task.py start`")
|
|
105
|
-
}
|
|
88
|
+
const nextBits = [
|
|
89
|
+
"Follow the current per-turn workflow-state; task lifecycle status and artifact presence do not identify the business phase",
|
|
90
|
+
"If no phase route is initialized, load `trellis-goal-exploration-and-requirements` and confirm the requirements baseline before initializing the route",
|
|
91
|
+
]
|
|
106
92
|
if (!jsonlReady) {
|
|
107
|
-
nextBits.push("curate
|
|
93
|
+
nextBits.push("curate task context manifests only when a dispatched agent needs them")
|
|
108
94
|
}
|
|
109
95
|
return `Status: PLANNING\nTask: ${taskTitle}\nPresent: ${presentLine}\nNext-Action: ${nextBits.join("; ")}. Do not enter implementation until the user confirms start.`
|
|
110
96
|
}
|
|
@@ -112,7 +98,7 @@ function getTaskStatus(ctx, platformInput = null) {
|
|
|
112
98
|
return (
|
|
113
99
|
`Status: ${String(taskStatus).toUpperCase()}\nTask: ${taskTitle}\n` +
|
|
114
100
|
`Present: ${presentLine}\n` +
|
|
115
|
-
"Next-Action: Follow the matching per-turn workflow-state. " +
|
|
101
|
+
"Next-Action: Follow the matching per-turn workflow-state; task lifecycle status does not identify the business phase. " +
|
|
116
102
|
"Implementation/check context order is jsonl entries -> `prd.md` -> `design.md if present` -> `implement.md if present`."
|
|
117
103
|
)
|
|
118
104
|
}
|
|
@@ -393,8 +379,8 @@ Trellis compact SessionStart context. Use it to orient the session; load details
|
|
|
393
379
|
if (workflowContent) {
|
|
394
380
|
const allLines = workflowContent.split("\n")
|
|
395
381
|
const overviewLines = [
|
|
396
|
-
"#
|
|
397
|
-
"
|
|
382
|
+
"# 工作流会话摘要",
|
|
383
|
+
"完整说明:.trellis/workflow.md。阶段详情:读取当前阶段提示指定的 Skill。",
|
|
398
384
|
"",
|
|
399
385
|
]
|
|
400
386
|
|
|
@@ -402,9 +388,18 @@ Trellis compact SessionStart context. Use it to orient the session; load details
|
|
|
402
388
|
let rangeEnd = allLines.length
|
|
403
389
|
for (let i = 0; i < allLines.length; i++) {
|
|
404
390
|
const stripped = allLines[i].trim()
|
|
405
|
-
|
|
391
|
+
const heading = stripped.replace(/^#{2,3}\s+/, "")
|
|
392
|
+
const isPhaseHeading =
|
|
393
|
+
/^#{2,3}\s+/.test(stripped) &&
|
|
394
|
+
["目标探索与需求核对阶段", "Goal Exploration and Requirements Confirmation Phase"].some(
|
|
395
|
+
(title) =>
|
|
396
|
+
heading === title ||
|
|
397
|
+
heading.endsWith(`:${title}`) ||
|
|
398
|
+
heading.endsWith(`: ${title}`),
|
|
399
|
+
)
|
|
400
|
+
if (rangeStart === -1 && ["## 阶段索引", "## Phase Index"].includes(stripped)) {
|
|
406
401
|
rangeStart = i
|
|
407
|
-
} else if (rangeStart !== -1 &&
|
|
402
|
+
} else if (rangeStart !== -1 && isPhaseHeading) {
|
|
408
403
|
rangeEnd = i
|
|
409
404
|
break
|
|
410
405
|
}
|
|
@@ -372,14 +372,10 @@ export class TrellisContext {
|
|
|
372
372
|
* Get active task from session runtime context.
|
|
373
373
|
*
|
|
374
374
|
* Resolution order (mirrors Python `active_task.resolve_active_task`):
|
|
375
|
-
* 1. Lookup the runtime file for the input-derived context key.
|
|
376
|
-
*
|
|
377
|
-
*
|
|
378
|
-
*
|
|
379
|
-
* exists locally, use it (`_resolveSingleSessionFallback`). Refuses to
|
|
380
|
-
* guess when 0 or ≥2 files exist so multi-window isolation holds.
|
|
381
|
-
* 3. If no session file exists, expose one resumable task assigned to the
|
|
382
|
-
* current developer as a read-only unbound projection.
|
|
375
|
+
* 1. Lookup the runtime file for the input-derived context key.
|
|
376
|
+
* 2. If that misses and exactly one session runtime file exists locally,
|
|
377
|
+
* use it (`_resolveSingleSessionFallback`). Refuses to guess when 0 or
|
|
378
|
+
* ≥2 files exist so multi-window isolation holds.
|
|
383
379
|
*/
|
|
384
380
|
getActiveTask(platformInput = null) {
|
|
385
381
|
const contextKey = this.getContextKey(platformInput)
|
|
@@ -394,11 +390,6 @@ export class TrellisContext {
|
|
|
394
390
|
stale: !taskDir || !existsSync(taskDir),
|
|
395
391
|
}
|
|
396
392
|
}
|
|
397
|
-
const unbound = this._resolveUnboundTask()
|
|
398
|
-
if (unbound) {
|
|
399
|
-
return unbound
|
|
400
|
-
}
|
|
401
|
-
return { taskPath: null, source: "none", stale: false }
|
|
402
393
|
}
|
|
403
394
|
|
|
404
395
|
const fallback = this._resolveSingleSessionFallback()
|
|
@@ -406,11 +397,6 @@ export class TrellisContext {
|
|
|
406
397
|
return fallback
|
|
407
398
|
}
|
|
408
399
|
|
|
409
|
-
const unbound = this._resolveUnboundTask()
|
|
410
|
-
if (unbound) {
|
|
411
|
-
return unbound
|
|
412
|
-
}
|
|
413
|
-
|
|
414
400
|
return { taskPath: null, source: "none", stale: false }
|
|
415
401
|
}
|
|
416
402
|
|
|
@@ -452,64 +438,6 @@ export class TrellisContext {
|
|
|
452
438
|
}
|
|
453
439
|
}
|
|
454
440
|
|
|
455
|
-
_resolveUnboundTask() {
|
|
456
|
-
const sessionsDir = join(this.directory, ".trellis", ".runtime", "sessions")
|
|
457
|
-
if (existsSync(sessionsDir)) {
|
|
458
|
-
let sessionFiles
|
|
459
|
-
try {
|
|
460
|
-
sessionFiles = readdirSync(sessionsDir).filter(name => name.endsWith(".json"))
|
|
461
|
-
} catch {
|
|
462
|
-
return null
|
|
463
|
-
}
|
|
464
|
-
if (sessionFiles.some(file => {
|
|
465
|
-
try {
|
|
466
|
-
const context = JSON.parse(readFileSync(join(sessionsDir, file), "utf-8"))
|
|
467
|
-
return Boolean(this.normalizeTaskRef(context?.current_task || ""))
|
|
468
|
-
} catch {
|
|
469
|
-
return false
|
|
470
|
-
}
|
|
471
|
-
})) return null
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
const developer = (process.env.TRELLIS_DEVELOPER || "").trim() || (() => {
|
|
475
|
-
try {
|
|
476
|
-
const content = readFileSync(join(this.directory, ".trellis", ".developer"), "utf-8")
|
|
477
|
-
return content.split(/\r?\n/).find(line => line.startsWith("name="))?.slice(5).trim() || ""
|
|
478
|
-
} catch {
|
|
479
|
-
return ""
|
|
480
|
-
}
|
|
481
|
-
})()
|
|
482
|
-
if (!developer) return null
|
|
483
|
-
|
|
484
|
-
const tasksDir = join(this.directory, ".trellis", "tasks")
|
|
485
|
-
let taskNames
|
|
486
|
-
try {
|
|
487
|
-
taskNames = readdirSync(tasksDir).filter(name => name !== "archive")
|
|
488
|
-
} catch {
|
|
489
|
-
return null
|
|
490
|
-
}
|
|
491
|
-
|
|
492
|
-
const candidates = taskNames.flatMap(name => {
|
|
493
|
-
try {
|
|
494
|
-
const data = JSON.parse(readFileSync(join(tasksDir, name, "task.json"), "utf-8"))
|
|
495
|
-
if (data.assignee !== developer || !["planning", "in_progress", "review"].includes(data.status)) return []
|
|
496
|
-
return [`.trellis/tasks/${name}`]
|
|
497
|
-
} catch {
|
|
498
|
-
return []
|
|
499
|
-
}
|
|
500
|
-
})
|
|
501
|
-
if (candidates.length === 0) return null
|
|
502
|
-
if (candidates.length === 1) {
|
|
503
|
-
return { taskPath: candidates[0], source: "unbound", stale: false }
|
|
504
|
-
}
|
|
505
|
-
return {
|
|
506
|
-
taskPath: null,
|
|
507
|
-
source: "unbound_ambiguous",
|
|
508
|
-
stale: false,
|
|
509
|
-
candidatePaths: candidates.sort(),
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
|
|
513
441
|
getCurrentTask(platformInput = null) {
|
|
514
442
|
return this.getActiveTask(platformInput).taskPath
|
|
515
443
|
}
|
|
@@ -471,9 +471,10 @@ export default async ({ directory, platform: hostPlatform = process.platform, en
|
|
|
471
471
|
// run when earlier ones miss):
|
|
472
472
|
// 1. Exact session runtime context lookup for input.sessionID
|
|
473
473
|
// 2. `Active task: <path>` hint in the dispatch prompt
|
|
474
|
-
// (explicit per-dispatch override
|
|
475
|
-
//
|
|
476
|
-
//
|
|
474
|
+
// (explicit per-dispatch override — beats single-session
|
|
475
|
+
// inference so multi-window users can disambiguate)
|
|
476
|
+
// 3. Single-session fallback — only when exactly 1 session
|
|
477
|
+
// runtime file exists locally
|
|
477
478
|
let taskDir = null
|
|
478
479
|
let taskSource = null
|
|
479
480
|
|
|
@@ -502,7 +503,7 @@ export default async ({ directory, platform: hostPlatform = process.platform, en
|
|
|
502
503
|
}
|
|
503
504
|
}
|
|
504
505
|
|
|
505
|
-
if (!taskDir
|
|
506
|
+
if (!taskDir) {
|
|
506
507
|
const fallback = ctx._resolveSingleSessionFallback()
|
|
507
508
|
if (fallback?.taskPath) {
|
|
508
509
|
const fallbackDir = ctx.resolveTaskDir(fallback.taskPath)
|
|
@@ -244,14 +244,6 @@ function loadBreadcrumbs(workflowPath) {
|
|
|
244
244
|
*/
|
|
245
245
|
function getActiveTask(ctx, platformInput = null) {
|
|
246
246
|
const active = ctx.getActiveTask(platformInput)
|
|
247
|
-
if (active.source === "unbound_ambiguous") {
|
|
248
|
-
return {
|
|
249
|
-
id: null,
|
|
250
|
-
status: "unbound_ambiguous",
|
|
251
|
-
source: active.source,
|
|
252
|
-
candidates: active.candidatePaths || [],
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
247
|
const taskRef = active.taskPath
|
|
256
248
|
if (!taskRef) return null
|
|
257
249
|
const taskDir = ctx.resolveTaskDir(taskRef)
|
|
@@ -264,8 +256,14 @@ function getActiveTask(ctx, platformInput = null) {
|
|
|
264
256
|
const data = JSON.parse(readFileSync(taskJsonPath, "utf-8"))
|
|
265
257
|
const status = typeof data.status === "string" ? data.status : ""
|
|
266
258
|
if (!status) return null
|
|
259
|
+
const phaseWorkflow = data.meta?.task_workflow
|
|
260
|
+
const phases = phaseWorkflow?.phases
|
|
261
|
+
const phaseId = phaseWorkflow?.current_phase_id || phaseWorkflow?.phase_ids?.at(-1)
|
|
262
|
+
const phase = typeof phaseId === "string" ? phases?.[phaseId] : null
|
|
267
263
|
const id = data.id || taskRef.split("/").pop()
|
|
268
|
-
if (
|
|
264
|
+
if (typeof phaseId === "string" && phase && typeof phase.status === "string") {
|
|
265
|
+
return { id, status: phaseId, phaseStatus: phase.status, source: active.source }
|
|
266
|
+
}
|
|
269
267
|
return { id, status, source: active.source }
|
|
270
268
|
} catch {
|
|
271
269
|
return null
|
|
@@ -279,17 +277,16 @@ function getActiveTask(ctx, platformInput = null) {
|
|
|
279
277
|
* "Refer to workflow.md for current step." line
|
|
280
278
|
* - no_task pseudo-status (id === null) → header omits task info
|
|
281
279
|
*/
|
|
282
|
-
function buildBreadcrumb(id, status, templates,
|
|
280
|
+
function buildBreadcrumb(id, status, templates, phaseStatus = null) {
|
|
283
281
|
let body = templates[status]
|
|
284
282
|
if (body === undefined) {
|
|
285
283
|
body = "Refer to workflow.md for current step."
|
|
286
284
|
}
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
}
|
|
285
|
+
const header = id === null
|
|
286
|
+
? `Status: ${status}`
|
|
287
|
+
: phaseStatus
|
|
288
|
+
? `Task: ${id}\nPhase: ${status} (${phaseStatus})`
|
|
289
|
+
: `Task: ${id} (${status})`
|
|
293
290
|
return `<workflow-state>\n${header}\n${body}\n</workflow-state>`
|
|
294
291
|
}
|
|
295
292
|
|
|
@@ -332,7 +329,7 @@ export default async ({ directory }) => {
|
|
|
332
329
|
const templates = loadBreadcrumbs(resolveWorkflowMd(ctx, directory, platformInput))
|
|
333
330
|
const task = getActiveTask(ctx, platformInput)
|
|
334
331
|
const breadcrumb = task
|
|
335
|
-
? buildBreadcrumb(task.id, task.status, templates, task.
|
|
332
|
+
? buildBreadcrumb(task.id, task.status, templates, task.phaseStatus)
|
|
336
333
|
: buildBreadcrumb(null, "no_task", templates)
|
|
337
334
|
|
|
338
335
|
prependEphemeralText(messages, breadcrumb)
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
No researched platform exports a session id into its shell tool's child
|
|
5
5
|
process, but every hook-capable one puts that id on hook stdin. So the hook
|
|
6
6
|
that fires just before a shell command writes a short-lived runtime ticket
|
|
7
|
-
whenever the pending command calls `task.py start/
|
|
7
|
+
whenever the pending command calls `task.py start/current/finish`, and the
|
|
8
8
|
task script consumes it when it has no native session environment.
|
|
9
9
|
|
|
10
10
|
Registered on whichever pre-shell event the host provides — Cursor's
|
|
@@ -35,7 +35,7 @@ if callable(_stdin_reconfigure):
|
|
|
35
35
|
DIR_WORKFLOW = ".trellis"
|
|
36
36
|
DIR_RUNTIME = ".runtime"
|
|
37
37
|
DIR_SHELL_TICKETS = "shell-tickets"
|
|
38
|
-
SESSION_SUBCOMMANDS = {"start", "
|
|
38
|
+
SESSION_SUBCOMMANDS = {"start", "current", "finish"}
|
|
39
39
|
TICKET_TTL_SECONDS = 30
|
|
40
40
|
CONTEXT_IDENTITY_KEYS = (
|
|
41
41
|
"session_id",
|
|
@@ -177,7 +177,7 @@ def _extract_task_subcommands(command: str) -> list[dict[str, str]]:
|
|
|
177
177
|
if name not in SESSION_SUBCOMMANDS:
|
|
178
178
|
continue
|
|
179
179
|
item = {"name": name}
|
|
180
|
-
if name
|
|
180
|
+
if name == "start" and index + 2 < len(tokens):
|
|
181
181
|
item["task_ref"] = tokens[index + 2]
|
|
182
182
|
subcommands.append(item)
|
|
183
183
|
return subcommands
|