@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
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
* │ ├── __init__.py
|
|
11
11
|
* │ ├── common/ # Shared utilities (Python)
|
|
12
12
|
* │ └── *.py # Main scripts (Python)
|
|
13
|
-
* ├── agents/ #
|
|
14
|
-
* │ └── *.md
|
|
13
|
+
* ├── agents/ # Teamwork runtime agent definitions
|
|
14
|
+
* │ └── *.md # Loaded by `trellis teamwork spawn --agent <name>`
|
|
15
15
|
* ├── scripts-shell-archive/ # Archived shell scripts (for reference)
|
|
16
16
|
* ├── workflow.md # Workflow guide
|
|
17
17
|
* ├── config.yaml # Trellis configuration
|
|
@@ -44,11 +44,10 @@ export const commonGit = readTemplate("scripts/common/git.py");
|
|
|
44
44
|
export const commonTypes = readTemplate("scripts/common/types.py");
|
|
45
45
|
export const commonTasks = readTemplate("scripts/common/tasks.py");
|
|
46
46
|
export const commonTaskContext = readTemplate("scripts/common/task_context.py");
|
|
47
|
-
export const commonContextProjection = readTemplate("scripts/common/context_projection.py");
|
|
48
47
|
export const commonTaskStore = readTemplate("scripts/common/task_store.py");
|
|
48
|
+
export const commonTaskWorkflow = readTemplate("scripts/common/task_workflow.py");
|
|
49
|
+
export const commonTaskContinuity = readTemplate("scripts/common/task_continuity.py");
|
|
49
50
|
export const commonSessionContext = readTemplate("scripts/common/session_context.py");
|
|
50
|
-
export const commonContinuationRecord = readTemplate("scripts/common/continuation_record.py");
|
|
51
|
-
export const commonOwnershipRecord = readTemplate("scripts/common/ownership_record.py");
|
|
52
51
|
export const commonPackagesContext = readTemplate("scripts/common/packages_context.py");
|
|
53
52
|
export const commonWorkflowPhase = readTemplate("scripts/common/workflow_phase.py");
|
|
54
53
|
export const commonWorkflowSelection = readTemplate("scripts/common/workflow_selection.py");
|
|
@@ -62,21 +61,15 @@ export const initDeveloperScript = readTemplate("scripts/init_developer.py");
|
|
|
62
61
|
export const taskScript = readTemplate("scripts/task.py");
|
|
63
62
|
export const getContextScript = readTemplate("scripts/get_context.py");
|
|
64
63
|
export const addSessionScript = readTemplate("scripts/add_session.py");
|
|
65
|
-
export const subnodeArtifactScript = readTemplate("scripts/subnode_artifact.py");
|
|
66
|
-
export const workspaceNoteScript = readTemplate("scripts/workspace_note.py");
|
|
67
64
|
// Configuration files
|
|
68
65
|
export const workflowMdTemplate = readTemplate("workflow.md");
|
|
69
66
|
export const configYamlTemplate = readTemplate("config.yaml");
|
|
70
67
|
export const gitignoreTemplate = readTemplate("gitignore.txt");
|
|
71
68
|
export const gitattributesTemplate = readTemplate("gitattributes.txt");
|
|
72
|
-
//
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
export const implementAgentTemplate = readTemplate("agents/implement.md");
|
|
77
|
-
export const checkAgentTemplate = readTemplate("agents/check.md");
|
|
78
|
-
export const subnodeAgentTemplate = readTemplate("agents/subnode.md");
|
|
79
|
-
export const subnodeEnvTemplate = readTemplate("agents/subnode.env");
|
|
69
|
+
// Project agent roles loaded from `.trellis/agents/`.
|
|
70
|
+
export const teammateAgentTemplate = readTemplate("agents/teammate.md");
|
|
71
|
+
export const delegatedWorktreeAgentTemplate = readTemplate("agents/delegated-worktree-primary-agent.md");
|
|
72
|
+
export const teammateProfilesTemplate = readTemplate("agents/teammate-profiles.json");
|
|
80
73
|
/**
|
|
81
74
|
* Get all script templates as a map of relative path to content
|
|
82
75
|
*/
|
|
@@ -100,11 +93,10 @@ export function getAllScripts() {
|
|
|
100
93
|
scripts.set("common/types.py", commonTypes);
|
|
101
94
|
scripts.set("common/tasks.py", commonTasks);
|
|
102
95
|
scripts.set("common/task_context.py", commonTaskContext);
|
|
103
|
-
scripts.set("common/context_projection.py", commonContextProjection);
|
|
104
96
|
scripts.set("common/task_store.py", commonTaskStore);
|
|
97
|
+
scripts.set("common/task_workflow.py", commonTaskWorkflow);
|
|
98
|
+
scripts.set("common/task_continuity.py", commonTaskContinuity);
|
|
105
99
|
scripts.set("common/session_context.py", commonSessionContext);
|
|
106
|
-
scripts.set("common/continuation_record.py", commonContinuationRecord);
|
|
107
|
-
scripts.set("common/ownership_record.py", commonOwnershipRecord);
|
|
108
100
|
scripts.set("common/packages_context.py", commonPackagesContext);
|
|
109
101
|
scripts.set("common/workflow_phase.py", commonWorkflowPhase);
|
|
110
102
|
scripts.set("common/workflow_selection.py", commonWorkflowSelection);
|
|
@@ -118,12 +110,10 @@ export function getAllScripts() {
|
|
|
118
110
|
scripts.set("task.py", taskScript);
|
|
119
111
|
scripts.set("get_context.py", getContextScript);
|
|
120
112
|
scripts.set("add_session.py", addSessionScript);
|
|
121
|
-
scripts.set("subnode_artifact.py", subnodeArtifactScript);
|
|
122
|
-
scripts.set("workspace_note.py", workspaceNoteScript);
|
|
123
113
|
return scripts;
|
|
124
114
|
}
|
|
125
115
|
/**
|
|
126
|
-
* Get
|
|
116
|
+
* Get project agent role assets as a map of relative path
|
|
127
117
|
* (under `.trellis/agents/`) to content.
|
|
128
118
|
*
|
|
129
119
|
* Consumed by `trellis init` (to dispatch on first install) and by
|
|
@@ -132,10 +122,9 @@ export function getAllScripts() {
|
|
|
132
122
|
*/
|
|
133
123
|
export function getAllAgents() {
|
|
134
124
|
const agents = new Map();
|
|
135
|
-
agents.set("
|
|
136
|
-
agents.set("
|
|
137
|
-
agents.set("
|
|
138
|
-
agents.set("subnode.env", subnodeEnvTemplate);
|
|
125
|
+
agents.set("teammate.md", teammateAgentTemplate);
|
|
126
|
+
agents.set("delegated-worktree-primary-agent.md", delegatedWorktreeAgentTemplate);
|
|
127
|
+
agents.set("teammate-profiles.json", teammateProfilesTemplate);
|
|
139
128
|
return agents;
|
|
140
129
|
}
|
|
141
130
|
//# sourceMappingURL=index.js.map
|
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M,CAAC,GAAG,CAAC,aAAa,EAAE,qBAAqB,CAAC,CAAC;IACjD,MAAM,CAAC,GAAG,CACR,qCAAqC,EACrC,8BAA8B,CAC/B,CAAC;IACF,MAAM,CAAC,GAAG,CAAC,wBAAwB,EAAE,wBAAwB,CAAC,CAAC;IAC/D,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1107,7 +1107,7 @@ def _auto_commit_workspace(repo_root: Path) -> str:
|
|
|
1107
1107
|
|
|
1108
1108
|
commit_msg = get_session_commit_message(repo_root)
|
|
1109
1109
|
# Resolve the current task so staging is scoped to its dir only. The ref
|
|
1110
|
-
# is ``.trellis/tasks/<name>``
|
|
1110
|
+
# is ``.trellis/tasks/<name>`` — pass the bare task name.
|
|
1111
1111
|
current = get_current_task(repo_root)
|
|
1112
1112
|
if current:
|
|
1113
1113
|
task_name = Path(current).name
|
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
"""Session-scoped active task resolution.
|
|
3
3
|
|
|
4
4
|
The user-facing concept is a single "active task". Trellis stores that pointer
|
|
5
|
-
per AI session/window under `.trellis/.runtime/sessions/`;
|
|
6
|
-
|
|
5
|
+
per AI session/window under `.trellis/.runtime/sessions/`; without a stable
|
|
6
|
+
session key there is no active task.
|
|
7
7
|
"""
|
|
8
8
|
|
|
9
9
|
from __future__ import annotations
|
|
10
10
|
|
|
11
|
+
import contextlib
|
|
11
12
|
import hashlib
|
|
12
13
|
import os
|
|
13
14
|
import re
|
|
@@ -18,7 +19,7 @@ from datetime import datetime, timezone
|
|
|
18
19
|
from pathlib import Path
|
|
19
20
|
from typing import Any
|
|
20
21
|
|
|
21
|
-
from .io import read_json as _io_read_json, write_json as _io_write_json
|
|
22
|
+
from .io import JSON_READ_MISSING, read_json as _io_read_json, read_json_checked, write_json as _io_write_json
|
|
22
23
|
|
|
23
24
|
DIR_WORKFLOW = ".trellis"
|
|
24
25
|
DIR_TASKS = "tasks"
|
|
@@ -33,7 +34,7 @@ DIR_SHELL_TICKETS = "shell-tickets"
|
|
|
33
34
|
# platform that works today.
|
|
34
35
|
DIR_LEGACY_CURSOR_SHELL_TICKETS = "cursor-shell"
|
|
35
36
|
SHELL_TICKET_TTL_SECONDS = 30
|
|
36
|
-
TASK_SESSION_COMMANDS = {"start", "
|
|
37
|
+
TASK_SESSION_COMMANDS = {"start", "current", "finish"}
|
|
37
38
|
|
|
38
39
|
_SESSION_KEYS = ("session_id", "sessionId", "sessionID")
|
|
39
40
|
_CONVERSATION_KEYS = ("conversation_id", "conversationId", "conversationID")
|
|
@@ -168,7 +169,6 @@ class ActiveTask:
|
|
|
168
169
|
source_type: str
|
|
169
170
|
context_key: str | None = None
|
|
170
171
|
stale: bool = False
|
|
171
|
-
candidate_paths: tuple[str, ...] = ()
|
|
172
172
|
|
|
173
173
|
@property
|
|
174
174
|
def source(self) -> str:
|
|
@@ -425,7 +425,7 @@ def _pending_ticket_matches_args(ticket: dict[str, Any], repo_root: Path) -> boo
|
|
|
425
425
|
continue
|
|
426
426
|
if _string_value(subcommand.get("name")) != command_name:
|
|
427
427
|
continue
|
|
428
|
-
if command_name
|
|
428
|
+
if command_name != "start":
|
|
429
429
|
return True
|
|
430
430
|
task_ref = args[1] if len(args) > 1 else None
|
|
431
431
|
if _task_refs_match(_string_value(subcommand.get("task_ref")), task_ref, repo_root):
|
|
@@ -666,6 +666,36 @@ def _context_path(repo_root: Path, context_key: str) -> Path:
|
|
|
666
666
|
return _runtime_sessions_dir(repo_root) / f"{context_key}.json"
|
|
667
667
|
|
|
668
668
|
|
|
669
|
+
@contextlib.contextmanager
|
|
670
|
+
def _session_file_lock(context_path: Path):
|
|
671
|
+
"""Serialize changes to one session's active-task pointer."""
|
|
672
|
+
lock_path = context_path.with_suffix(".lock")
|
|
673
|
+
lock_path.parent.mkdir(parents=True, exist_ok=True)
|
|
674
|
+
with lock_path.open("a+b") as handle:
|
|
675
|
+
if os.name == "nt":
|
|
676
|
+
import msvcrt
|
|
677
|
+
|
|
678
|
+
handle.seek(0)
|
|
679
|
+
if handle.read(1) == b"":
|
|
680
|
+
handle.write(b"\0")
|
|
681
|
+
handle.flush()
|
|
682
|
+
handle.seek(0)
|
|
683
|
+
msvcrt.locking(handle.fileno(), msvcrt.LK_LOCK, 1)
|
|
684
|
+
try:
|
|
685
|
+
yield
|
|
686
|
+
finally:
|
|
687
|
+
handle.seek(0)
|
|
688
|
+
msvcrt.locking(handle.fileno(), msvcrt.LK_UNLCK, 1)
|
|
689
|
+
else:
|
|
690
|
+
import fcntl
|
|
691
|
+
|
|
692
|
+
fcntl.flock(handle.fileno(), fcntl.LOCK_EX)
|
|
693
|
+
try:
|
|
694
|
+
yield
|
|
695
|
+
finally:
|
|
696
|
+
fcntl.flock(handle.fileno(), fcntl.LOCK_UN)
|
|
697
|
+
|
|
698
|
+
|
|
669
699
|
def resolve_active_task(
|
|
670
700
|
repo_root: Path,
|
|
671
701
|
platform_input: dict[str, Any] | None = None,
|
|
@@ -676,12 +706,10 @@ def resolve_active_task(
|
|
|
676
706
|
) -> ActiveTask:
|
|
677
707
|
"""Resolve the active task from session runtime state only.
|
|
678
708
|
|
|
679
|
-
A stale session task is returned as stale. Missing or
|
|
680
|
-
identity does not infer ownership from the
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
one unrelated session file is opt-in; pull-based child agents use that
|
|
684
|
-
compatibility opt-in when they cannot inherit a parent session identity.
|
|
709
|
+
A stale session task is returned as stale. Missing context identity or a
|
|
710
|
+
Missing or unmatched session identity does not infer ownership from the
|
|
711
|
+
number of session files. Pull-based child-agent callers that cannot inherit
|
|
712
|
+
a parent identity must opt into the compatibility fallback explicitly.
|
|
685
713
|
"""
|
|
686
714
|
context_key = resolve_context_key(
|
|
687
715
|
platform_input,
|
|
@@ -694,20 +722,12 @@ def resolve_active_task(
|
|
|
694
722
|
active = _active_from_ref(task_ref, repo_root, "session", context_key)
|
|
695
723
|
if active:
|
|
696
724
|
return active
|
|
697
|
-
unbound = _resolve_unbound_task(repo_root)
|
|
698
|
-
if unbound is not None:
|
|
699
|
-
return unbound
|
|
700
|
-
return ActiveTask(None, "none", context_key)
|
|
701
725
|
|
|
702
726
|
if allow_single_session_fallback:
|
|
703
727
|
fallback = _resolve_single_session_fallback(repo_root)
|
|
704
728
|
if fallback is not None:
|
|
705
729
|
return fallback
|
|
706
730
|
|
|
707
|
-
unbound = _resolve_unbound_task(repo_root)
|
|
708
|
-
if unbound is not None:
|
|
709
|
-
return unbound
|
|
710
|
-
|
|
711
731
|
return ActiveTask(None, "none", context_key)
|
|
712
732
|
|
|
713
733
|
|
|
@@ -736,38 +756,6 @@ def _resolve_single_session_fallback(repo_root: Path) -> ActiveTask | None:
|
|
|
736
756
|
return _active_from_ref(task_ref, repo_root, "session-fallback", fallback_key)
|
|
737
757
|
|
|
738
758
|
|
|
739
|
-
def _resolve_unbound_task(repo_root: Path) -> ActiveTask | None:
|
|
740
|
-
"""Expose one developer-owned task when no session pointer exists."""
|
|
741
|
-
sessions_dir = _runtime_sessions_dir(repo_root)
|
|
742
|
-
if sessions_dir.is_dir():
|
|
743
|
-
session_files = sorted(sessions_dir.glob("*.json"))
|
|
744
|
-
if any(_string_value((_read_json(session) or {}).get("current_task")) for session in session_files):
|
|
745
|
-
return None
|
|
746
|
-
|
|
747
|
-
from .paths import get_developer, get_tasks_dir
|
|
748
|
-
from .tasks import iter_active_tasks
|
|
749
|
-
|
|
750
|
-
developer = get_developer(repo_root)
|
|
751
|
-
if not developer:
|
|
752
|
-
return None
|
|
753
|
-
|
|
754
|
-
candidates = [
|
|
755
|
-
task
|
|
756
|
-
for task in iter_active_tasks(get_tasks_dir(repo_root))
|
|
757
|
-
if task.assignee == developer and task.status in {"planning", "in_progress", "review"}
|
|
758
|
-
]
|
|
759
|
-
if len(candidates) == 0:
|
|
760
|
-
return None
|
|
761
|
-
|
|
762
|
-
task_paths = tuple(sorted(
|
|
763
|
-
task.directory.relative_to(repo_root).as_posix()
|
|
764
|
-
for task in candidates
|
|
765
|
-
))
|
|
766
|
-
if len(task_paths) == 1:
|
|
767
|
-
return ActiveTask(task_paths[0], "unbound", None)
|
|
768
|
-
return ActiveTask(None, "unbound_ambiguous", None, candidate_paths=task_paths)
|
|
769
|
-
|
|
770
|
-
|
|
771
759
|
def _utc_now() -> str:
|
|
772
760
|
return datetime.now(timezone.utc).replace(microsecond=0).isoformat().replace("+00:00", "Z")
|
|
773
761
|
|
|
@@ -814,15 +802,71 @@ def set_active_task(
|
|
|
814
802
|
return None
|
|
815
803
|
|
|
816
804
|
context_path = _context_path(repo_root, context_key)
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
805
|
+
from .task_continuity import active_task_change_guard
|
|
806
|
+
|
|
807
|
+
with active_task_change_guard(repo_root, context_key, canonical, clearing=False) as allowed:
|
|
808
|
+
if not allowed:
|
|
809
|
+
return None
|
|
810
|
+
with _session_file_lock(context_path):
|
|
811
|
+
context = _read_json(context_path) or {}
|
|
812
|
+
context.update(_context_metadata(platform_input, platform, context_key))
|
|
813
|
+
context["current_task"] = canonical
|
|
814
|
+
context.setdefault("current_run", None)
|
|
815
|
+
if not _write_json(context_path, context):
|
|
816
|
+
return None
|
|
823
817
|
return ActiveTask(canonical, "session", context_key)
|
|
824
818
|
|
|
825
819
|
|
|
820
|
+
def compare_and_set_active_task(
|
|
821
|
+
repo_root: Path,
|
|
822
|
+
context_key: str,
|
|
823
|
+
expected_task: str | None,
|
|
824
|
+
task_path: str | None,
|
|
825
|
+
) -> bool:
|
|
826
|
+
"""Change one direct session pointer only when its current value matches."""
|
|
827
|
+
context_path = _context_path(repo_root, context_key)
|
|
828
|
+
with _session_file_lock(context_path):
|
|
829
|
+
context, reason = read_json_checked(context_path)
|
|
830
|
+
if context is None and reason == JSON_READ_MISSING:
|
|
831
|
+
if expected_task is not None or task_path is None:
|
|
832
|
+
return False
|
|
833
|
+
context = {}
|
|
834
|
+
elif context is None:
|
|
835
|
+
return False
|
|
836
|
+
current = _string_value(context.get("current_task"))
|
|
837
|
+
current_ref = _canonical_task_ref(current, repo_root) if current else None
|
|
838
|
+
expected_ref = _canonical_task_ref(expected_task, repo_root) if expected_task else None
|
|
839
|
+
if current_ref != expected_ref:
|
|
840
|
+
return False
|
|
841
|
+
if task_path is None:
|
|
842
|
+
context.pop("current_task", None)
|
|
843
|
+
else:
|
|
844
|
+
canonical = _canonical_task_ref(task_path, repo_root)
|
|
845
|
+
if canonical is None:
|
|
846
|
+
return False
|
|
847
|
+
context["current_task"] = canonical
|
|
848
|
+
context.setdefault("current_run", None)
|
|
849
|
+
return _write_json(context_path, context)
|
|
850
|
+
|
|
851
|
+
|
|
852
|
+
def clear_active_task_if_matches(repo_root: Path, context_key: str, expected_task: str) -> bool:
|
|
853
|
+
"""Clear one session pointer when it still references the expected task."""
|
|
854
|
+
context_path = _context_path(repo_root, context_key)
|
|
855
|
+
with _session_file_lock(context_path):
|
|
856
|
+
context, reason = read_json_checked(context_path)
|
|
857
|
+
if context is None:
|
|
858
|
+
return reason == JSON_READ_MISSING
|
|
859
|
+
if not isinstance(context, dict):
|
|
860
|
+
return False
|
|
861
|
+
current = _string_value(context.get("current_task"))
|
|
862
|
+
current_ref = _canonical_task_ref(current, repo_root) if current else None
|
|
863
|
+
expected_ref = _canonical_task_ref(expected_task, repo_root)
|
|
864
|
+
if current_ref != expected_ref:
|
|
865
|
+
return True
|
|
866
|
+
context.pop("current_task", None)
|
|
867
|
+
return _write_json(context_path, context)
|
|
868
|
+
|
|
869
|
+
|
|
826
870
|
def clear_active_task(
|
|
827
871
|
repo_root: Path,
|
|
828
872
|
platform_input: dict[str, Any] | None = None,
|
|
@@ -838,27 +882,17 @@ def clear_active_task(
|
|
|
838
882
|
return previous
|
|
839
883
|
|
|
840
884
|
context_path = _context_path(repo_root, previous.context_key)
|
|
841
|
-
|
|
842
|
-
|
|
885
|
+
from .task_continuity import active_task_change_guard
|
|
886
|
+
|
|
887
|
+
with active_task_change_guard(repo_root, previous.context_key, previous.task_path, clearing=True) as allowed:
|
|
888
|
+
if not allowed:
|
|
889
|
+
return ActiveTask(previous.task_path, "session", previous.context_key)
|
|
890
|
+
with _session_file_lock(context_path):
|
|
891
|
+
if context_path.is_file():
|
|
892
|
+
_remove_file(context_path)
|
|
843
893
|
return previous
|
|
844
894
|
|
|
845
895
|
|
|
846
|
-
def clear_active_task_for_context(
|
|
847
|
-
context_key: str,
|
|
848
|
-
task_path: str,
|
|
849
|
-
repo_root: Path,
|
|
850
|
-
) -> str:
|
|
851
|
-
"""Clear one exact session pointer, refusing an unexpected replacement."""
|
|
852
|
-
context_path = _context_path(repo_root, context_key)
|
|
853
|
-
context = _read_json(context_path)
|
|
854
|
-
if context is None or not _string_value(context.get("current_task")):
|
|
855
|
-
return "absent"
|
|
856
|
-
current = _string_value(context.get("current_task"))
|
|
857
|
-
if not _task_refs_match(current, task_path, repo_root):
|
|
858
|
-
return "changed"
|
|
859
|
-
return "cleared" if context_path.is_file() and _remove_file(context_path) else "absent"
|
|
860
|
-
|
|
861
|
-
|
|
862
896
|
def clear_task_from_sessions(task_path: str, repo_root: Path) -> int:
|
|
863
897
|
"""Delete all session runtime files that point at a task."""
|
|
864
898
|
target = _canonical_task_ref(task_path, repo_root) or normalize_task_ref(task_path)
|
|
@@ -871,15 +905,16 @@ def clear_task_from_sessions(task_path: str, repo_root: Path) -> int:
|
|
|
871
905
|
return cleared
|
|
872
906
|
|
|
873
907
|
for session_path in sessions_dir.glob("*.json"):
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
908
|
+
with _session_file_lock(session_path):
|
|
909
|
+
context = _read_json(session_path) or {}
|
|
910
|
+
current = _string_value(context.get("current_task"))
|
|
911
|
+
if not current:
|
|
912
|
+
continue
|
|
913
|
+
current_ref = _canonical_task_ref(current, repo_root) or normalize_task_ref(current)
|
|
914
|
+
if current_ref != target:
|
|
915
|
+
continue
|
|
916
|
+
if session_path.is_file() and _remove_file(session_path):
|
|
917
|
+
cleared += 1
|
|
883
918
|
|
|
884
919
|
return cleared
|
|
885
920
|
|
|
@@ -888,7 +923,7 @@ def repoint_task_in_sessions(old_path: str, new_path: str, repo_root: Path) -> i
|
|
|
888
923
|
"""Move every session pointer from `old_path` to `new_path`.
|
|
889
924
|
|
|
890
925
|
Rename is the one lifecycle step where the task survives under a different
|
|
891
|
-
name, so clearing the pointers
|
|
926
|
+
name, so clearing the pointers would be wrong: the user
|
|
892
927
|
would silently lose their active task and have to run `task.py start`
|
|
893
928
|
again to get context injection back. Repointing keeps the session valid
|
|
894
929
|
across the rename.
|
|
@@ -908,20 +943,21 @@ def repoint_task_in_sessions(old_path: str, new_path: str, repo_root: Path) -> i
|
|
|
908
943
|
return moved
|
|
909
944
|
|
|
910
945
|
for session_path in sorted(sessions_dir.glob("*.json")):
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
current, repo_root
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
946
|
+
with _session_file_lock(session_path):
|
|
947
|
+
context = _read_json(session_path)
|
|
948
|
+
if not context:
|
|
949
|
+
continue
|
|
950
|
+
current = _string_value(context.get("current_task"))
|
|
951
|
+
if not current:
|
|
952
|
+
continue
|
|
953
|
+
current_ref = _canonical_task_ref(current, repo_root) or _relative_task_ref(
|
|
954
|
+
current, repo_root
|
|
955
|
+
)
|
|
956
|
+
if current_ref != target:
|
|
957
|
+
continue
|
|
958
|
+
context["current_task"] = replacement
|
|
959
|
+
if _write_json(session_path, context):
|
|
960
|
+
moved += 1
|
|
925
961
|
|
|
926
962
|
return moved
|
|
927
963
|
|
|
@@ -22,7 +22,7 @@ from .trellis_config import parse_simple_yaml
|
|
|
22
22
|
DEFAULT_SESSION_COMMIT_MESSAGE = "chore: record journal"
|
|
23
23
|
DEFAULT_MAX_JOURNAL_LINES = 2000
|
|
24
24
|
DEFAULT_SESSION_AUTO_COMMIT = True
|
|
25
|
-
DEFAULT_CODEX_DISPATCH_MODE = "
|
|
25
|
+
DEFAULT_CODEX_DISPATCH_MODE = "auto"
|
|
26
26
|
|
|
27
27
|
CONFIG_FILE = "config.yaml"
|
|
28
28
|
|
|
@@ -118,12 +118,11 @@ def get_max_journal_lines(repo_root: Path | None = None) -> int:
|
|
|
118
118
|
def get_session_auto_commit(repo_root: Path | None = None) -> bool:
|
|
119
119
|
"""Whether scripts should auto-stage + auto-commit session/task changes.
|
|
120
120
|
|
|
121
|
-
Governs
|
|
122
|
-
``task_store.py:_auto_commit_archive``.
|
|
121
|
+
Governs ``add_session.py:_auto_commit_workspace``.
|
|
123
122
|
|
|
124
123
|
Default: ``True`` (existing behavior — auto-stage + auto-commit).
|
|
125
124
|
Set ``session_auto_commit: false`` in ``.trellis/config.yaml`` to skip
|
|
126
|
-
auto-staging entirely;
|
|
125
|
+
auto-staging entirely; journal files are still written to
|
|
127
126
|
disk, but the user manages ``git add`` / ``git commit`` themselves.
|
|
128
127
|
|
|
129
128
|
Accepts native YAML booleans (``true`` / ``false``) and the string
|
|
@@ -140,10 +139,9 @@ def get_session_auto_commit(repo_root: Path | None = None) -> bool:
|
|
|
140
139
|
def get_codex_dispatch_mode(repo_root: Path | None = None) -> str:
|
|
141
140
|
"""Return Codex dispatch mode.
|
|
142
141
|
|
|
143
|
-
Default is ``
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
a backwards-compatible alias for ``auto``.
|
|
142
|
+
Default is ``auto``, which dispatches Trellis sub-agents and uses native
|
|
143
|
+
context injection with a child-side fallback. ``inline`` is an explicit
|
|
144
|
+
opt-out. ``sub-agent`` remains a backwards-compatible alias for ``auto``.
|
|
147
145
|
|
|
148
146
|
Invalid explicit configuration falls back to ``inline`` rather than
|
|
149
147
|
unexpectedly dispatching a sub-agent. This CLI-facing parser is the only
|
|
@@ -282,7 +280,7 @@ def get_hooks(event: str, repo_root: Path | None = None) -> list[str]:
|
|
|
282
280
|
"""Get hook commands for a lifecycle event.
|
|
283
281
|
|
|
284
282
|
Args:
|
|
285
|
-
event: Event name (e.g. "after_create", "
|
|
283
|
+
event: Event name (e.g. "after_create", "after_complete").
|
|
286
284
|
repo_root: Repository root path.
|
|
287
285
|
|
|
288
286
|
A hook the user believes is installed and which silently never runs is the
|
|
@@ -65,7 +65,7 @@ def main() -> None:
|
|
|
65
65
|
)
|
|
66
66
|
parser.add_argument(
|
|
67
67
|
"--step",
|
|
68
|
-
help="
|
|
68
|
+
help="Legacy workflow step id. Omit to get the Phase Index and load the active phase Skill.",
|
|
69
69
|
)
|
|
70
70
|
parser.add_argument(
|
|
71
71
|
"--platform",
|
|
@@ -10,6 +10,7 @@ from __future__ import annotations
|
|
|
10
10
|
|
|
11
11
|
import json
|
|
12
12
|
import os
|
|
13
|
+
import sys
|
|
13
14
|
import tempfile
|
|
14
15
|
from pathlib import Path
|
|
15
16
|
|
|
@@ -114,6 +115,24 @@ def write_json(path: Path, data: dict) -> bool:
|
|
|
114
115
|
|
|
115
116
|
Returns True on success, False on error.
|
|
116
117
|
"""
|
|
118
|
+
if path.name == "task.json" and path.is_file():
|
|
119
|
+
workflow_dir = next((parent for parent in path.parents if parent.name == ".trellis"), None)
|
|
120
|
+
if workflow_dir is not None:
|
|
121
|
+
repo_root = workflow_dir.parent
|
|
122
|
+
from .task_utils import is_within_tasks_dir
|
|
123
|
+
|
|
124
|
+
if is_within_tasks_dir(path.parent, repo_root):
|
|
125
|
+
current, _ = read_json_checked(path)
|
|
126
|
+
if current is None:
|
|
127
|
+
print("TASK_TRANSFER_WITHHELD: task.json cannot be checked before writing", file=sys.stderr)
|
|
128
|
+
return False
|
|
129
|
+
from .task_continuity import task_mutation_guard
|
|
130
|
+
|
|
131
|
+
with task_mutation_guard(repo_root, path.parent, current) as allowed:
|
|
132
|
+
if not allowed:
|
|
133
|
+
print("TASK_TRANSFER_ACTIVE: task changes are fenced until ownership is consumed or released", file=sys.stderr)
|
|
134
|
+
return False
|
|
135
|
+
return write_text_atomic(path, json.dumps(data, indent=2, ensure_ascii=False))
|
|
117
136
|
return write_text_atomic(path, json.dumps(data, indent=2, ensure_ascii=False))
|
|
118
137
|
|
|
119
138
|
|