@pennixrv/trellis 0.7.0-beta.8 → 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.0-beta.9.json +9 -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 -191
- package/dist/templates/copilot/hooks/session-start.py +30 -26
- package/dist/templates/copilot/prompts/brainstorm.prompt.md +7 -150
- 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 -699
- 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 -193
- 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 -69
- 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 -597
- 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
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
*/
|
|
22
22
|
import { appendEvent } from "../store/events.js";
|
|
23
23
|
export function createShutdown(args) {
|
|
24
|
-
const {
|
|
24
|
+
const { sessionId, workerName, log, getChild, graceMs, timeoutMs, idleTimeoutMs, } = args;
|
|
25
25
|
let shutdownReason = null;
|
|
26
26
|
let requestSignal = null;
|
|
27
27
|
let terminalEmitted = false;
|
|
@@ -58,7 +58,7 @@ export function createShutdown(args) {
|
|
|
58
58
|
}, graceMs);
|
|
59
59
|
};
|
|
60
60
|
const writeKilled = async (reason, signal) => {
|
|
61
|
-
await appendEvent(
|
|
61
|
+
await appendEvent(sessionId, {
|
|
62
62
|
kind: "killed",
|
|
63
63
|
by: `supervisor:${workerName}`,
|
|
64
64
|
reason,
|
|
@@ -76,8 +76,6 @@ export function createShutdown(args) {
|
|
|
76
76
|
return true;
|
|
77
77
|
};
|
|
78
78
|
const request = async (signal, reason) => {
|
|
79
|
-
if (shutdownReason === "completed")
|
|
80
|
-
return;
|
|
81
79
|
// The kill ladder + killed-append are one-shot; whether we got here
|
|
82
80
|
// via `claim()` + `request()` (post-spawn error) or a single
|
|
83
81
|
// `request()` (signal / timeout), only run them once.
|
|
@@ -92,13 +90,6 @@ export function createShutdown(args) {
|
|
|
92
90
|
killedPromise = writeKilled(shutdownReason, requestSignal);
|
|
93
91
|
await killedPromise;
|
|
94
92
|
};
|
|
95
|
-
const complete = () => {
|
|
96
|
-
if (shutdownReason !== null)
|
|
97
|
-
return;
|
|
98
|
-
shutdownReason = "completed";
|
|
99
|
-
log.write("[supervisor] completed worker; cleaning up runtime\n");
|
|
100
|
-
startKillLadder(getChild());
|
|
101
|
-
};
|
|
102
93
|
const finalizeOnExit = async (code, signal) => {
|
|
103
94
|
log.write(`[supervisor] worker exit code=${code ?? "null"} signal=${signal ?? "null"}\n`);
|
|
104
95
|
// #1 fix: synthesise a terminal event so consumers blocked on
|
|
@@ -110,13 +101,13 @@ export function createShutdown(args) {
|
|
|
110
101
|
// The flag is claimed SYNCHRONOUSLY before the await so two
|
|
111
102
|
// concurrent `finalizeOnExit` calls (or `applyParseResult` racing
|
|
112
103
|
// with `child.on("exit")`) can't both pass the guard and emit
|
|
113
|
-
// duplicate synthetic events. `by` is the
|
|
114
|
-
// `supervisor:<name>`) so `wait --from <
|
|
104
|
+
// duplicate synthetic events. `by` is the teammate name (not
|
|
105
|
+
// `supervisor:<name>`) so `wait --from <teammate> --kind done` wakes
|
|
115
106
|
// for the synthesised event same as for an adapter-emitted one.
|
|
116
107
|
if (!terminalEmitted && shutdownReason === null) {
|
|
117
108
|
terminalEmitted = true;
|
|
118
109
|
if (code === 0) {
|
|
119
|
-
await appendEvent(
|
|
110
|
+
await appendEvent(sessionId, {
|
|
120
111
|
kind: "done",
|
|
121
112
|
by: workerName,
|
|
122
113
|
synthesized: true,
|
|
@@ -124,10 +115,10 @@ export function createShutdown(args) {
|
|
|
124
115
|
});
|
|
125
116
|
}
|
|
126
117
|
else {
|
|
127
|
-
await appendEvent(
|
|
118
|
+
await appendEvent(sessionId, {
|
|
128
119
|
kind: "error",
|
|
129
120
|
by: workerName,
|
|
130
|
-
message: `
|
|
121
|
+
message: `teammate exited without terminal event (code=${code ?? "null"}, signal=${signal ?? "null"})`,
|
|
131
122
|
synthesized: true,
|
|
132
123
|
exit_code: code,
|
|
133
124
|
exit_signal: signal,
|
|
@@ -141,7 +132,6 @@ export function createShutdown(args) {
|
|
|
141
132
|
};
|
|
142
133
|
return {
|
|
143
134
|
request,
|
|
144
|
-
complete,
|
|
145
135
|
claim,
|
|
146
136
|
isShuttingDown: () => shutdownReason !== null,
|
|
147
137
|
reason: () => shutdownReason,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shutdown.js","sourceRoot":"","sources":["../../../../src/commands/teamwork/supervisor/shutdown.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAKH,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAwDjD,MAAM,UAAU,cAAc,CAAC,IAAwB;IACrD,MAAM,EACJ,SAAS,EACT,UAAU,EACV,GAAG,EACH,QAAQ,EACR,OAAO,EACP,SAAS,EACT,aAAa,GACd,GAAG,IAAI,CAAC;IAET,IAAI,cAAc,GAA0B,IAAI,CAAC;IACjD,IAAI,aAAa,GAA0B,IAAI,CAAC;IAChD,IAAI,eAAe,GAAG,KAAK,CAAC;IAC5B,IAAI,aAAa,GAAyB,IAAI,CAAC;IAE/C,MAAM,iBAAiB,GAAG,CAAC,KAAY,EAAW,EAAE,CAClD,KAAK,CAAC,QAAQ,KAAK,IAAI,IAAI,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IAEvD,MAAM,eAAe,GAAG,CAAC,KAAY,EAAQ,EAAE;QAC7C,IAAI,CAAC;YACH,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;QACpB,CAAC;QAAC,MAAM,CAAC;YACP,iBAAiB;QACnB,CAAC;QACD,UAAU,CAAC,GAAG,EAAE;YACd,IAAI,iBAAiB,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC7B,GAAG,CAAC,KAAK,CAAC,8CAA8C,CAAC,CAAC;gBAC1D,IAAI,CAAC;oBACH,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;gBACxB,CAAC;gBAAC,MAAM,CAAC;oBACP,eAAe;gBACjB,CAAC;gBACD,UAAU,CAAC,GAAG,EAAE;oBACd,IAAI,iBAAiB,CAAC,KAAK,CAAC,EAAE,CAAC;wBAC7B,GAAG,CAAC,KAA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AC,CAAC;IAChE,CAAC,CAAC;IAEF,OAAO;QACL,OAAO;QACP,KAAK;QACL,cAAc,EAAE,GAAG,EAAE,CAAC,cAAc,KAAK,IAAI;QAC7C,MAAM,EAAE,GAAG,EAAE,CAAC,cAAc;QAC5B,mBAAmB,EAAE,GAAG,EAAE;YACxB,eAAe,GAAG,IAAI,CAAC;QACzB,CAAC;QACD,gBAAgB,EAAE,GAAG,EAAE,CAAC,eAAe;QACvC,cAAc;QACd,aAAa,EAAE,GAAG,EAAE,CAAC,aAAa,IAAI,OAAO,CAAC,OAAO,EAAE;KACxD,CAAC;AACJ,CAAC"}
|
|
@@ -42,19 +42,19 @@ export declare function createStdoutDrainControl(): {
|
|
|
42
42
|
*/
|
|
43
43
|
export declare function pumpStdout(stream: Readable, onLine: (line: string) => Promise<void> | void, onError?: (err: Error) => Promise<void> | void, signal?: AbortSignal): Promise<void>;
|
|
44
44
|
/**
|
|
45
|
-
* Translate an adapter `ParseResult` into
|
|
45
|
+
* Translate an adapter `ParseResult` into Teamwork Session events + adapter-level
|
|
46
46
|
* side-effects (session-id persistence, stdin writes). Also tells the
|
|
47
47
|
* shutdown controller when the adapter emits a `done`/`error` so the
|
|
48
48
|
* fallback synthesiser in `finalizeOnExit` doesn't duplicate.
|
|
49
49
|
*/
|
|
50
|
-
export declare function applyParseResult(
|
|
50
|
+
export declare function applyParseResult(sessionId: string, workerName: string, result: ParseResult, child: Child, shutdown: ShutdownController, turnTracker?: TurnTracker): Promise<void>;
|
|
51
51
|
/**
|
|
52
52
|
* Convenience wrapper: wire `pumpStdout` to `applyParseResult` with
|
|
53
53
|
* standard error-event-on-failure handling. The orchestrator just calls
|
|
54
54
|
* this and forgets about line buffering / parse plumbing.
|
|
55
55
|
*/
|
|
56
56
|
export declare function startStdoutPump(args: {
|
|
57
|
-
|
|
57
|
+
sessionId: string;
|
|
58
58
|
workerName: string;
|
|
59
59
|
child: Child;
|
|
60
60
|
adapter: WorkerAdapter;
|
|
@@ -64,8 +64,6 @@ export declare function startStdoutPump(args: {
|
|
|
64
64
|
};
|
|
65
65
|
shutdown: ShutdownController;
|
|
66
66
|
turnTracker?: TurnTracker;
|
|
67
|
-
project?: string;
|
|
68
|
-
onDone?: () => void;
|
|
69
67
|
processLines?: Promise<boolean>;
|
|
70
68
|
signal?: AbortSignal;
|
|
71
69
|
}): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stdout.d.ts","sourceRoot":"","sources":["../../../../src/commands/teamwork/supervisor/stdout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAE9D,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGxD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,KAAK,EAAe,WAAW,EAAE,MAAM,YAAY,CAAC;AAE3D,KAAK,KAAK,GAAG,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAE/D;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,IAAI;IAC1C,YAAY,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IAC/B,MAAM,EAAE,WAAW,CAAC;IACpB,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,EAAE,MAAM,IAAI,CAAC;CAC1B,CAiBA;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,QAAQ,EAChB,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,EAC9C,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,EAC9C,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,IAAI,CAAC,CA2Gf;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CACpC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,kBAAkB,EAC5B,WAAW,CAAC,EAAE,WAAW,GACxB,OAAO,CAAC,IAAI,CAAC,CAqDf;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,aAAa,CAAC;IACvB,UAAU,EAAE,OAAO,CAAC;IACpB,GAAG,EAAE;QAAE,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;KAAE,CAAC;IACvC,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,YAAY,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IAChC,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,GAAG,OAAO,CAAC,IAAI,CAAC,CAyChB"}
|
|
@@ -147,13 +147,12 @@ export function pumpStdout(stream, onLine, onError, signal) {
|
|
|
147
147
|
return streamFinished.then(() => queue);
|
|
148
148
|
}
|
|
149
149
|
/**
|
|
150
|
-
* Translate an adapter `ParseResult` into
|
|
150
|
+
* Translate an adapter `ParseResult` into Teamwork Session events + adapter-level
|
|
151
151
|
* side-effects (session-id persistence, stdin writes). Also tells the
|
|
152
152
|
* shutdown controller when the adapter emits a `done`/`error` so the
|
|
153
153
|
* fallback synthesiser in `finalizeOnExit` doesn't duplicate.
|
|
154
154
|
*/
|
|
155
|
-
export async function applyParseResult(
|
|
156
|
-
let doneSeen = false;
|
|
155
|
+
export async function applyParseResult(sessionId, workerName, result, child, shutdown, turnTracker) {
|
|
157
156
|
for (const ev of result.events) {
|
|
158
157
|
// Claim the terminal slot SYNCHRONOUSLY before the await so a
|
|
159
158
|
// racing `child.on("exit") → finalizeOnExit` can't see
|
|
@@ -162,41 +161,33 @@ export async function applyParseResult(channelName, workerName, result, child, s
|
|
|
162
161
|
if (ev.kind === "done" || ev.kind === "error") {
|
|
163
162
|
shutdown.markTerminalEmitted();
|
|
164
163
|
}
|
|
165
|
-
await appendEvent(
|
|
164
|
+
await appendEvent(sessionId, {
|
|
166
165
|
kind: ev.kind,
|
|
167
166
|
by: workerName,
|
|
168
167
|
...(ev.payload ?? {}),
|
|
169
|
-
}
|
|
168
|
+
});
|
|
170
169
|
if (ev.kind === "done" || ev.kind === "error") {
|
|
171
170
|
const turn = turnTracker?.finish();
|
|
172
171
|
if (turn) {
|
|
173
172
|
const outcome = ev.kind === "done" ? "done" : "error";
|
|
174
|
-
await appendEvent(
|
|
173
|
+
await appendEvent(sessionId, {
|
|
175
174
|
kind: "turn_finished",
|
|
176
175
|
by: workerName,
|
|
177
176
|
worker: workerName,
|
|
178
177
|
inputSeq: turn.inputSeq,
|
|
179
178
|
turnId: turn.turnId,
|
|
180
179
|
outcome,
|
|
181
|
-
}
|
|
180
|
+
});
|
|
182
181
|
}
|
|
183
182
|
}
|
|
184
|
-
if (ev.kind === "done")
|
|
185
|
-
doneSeen = true;
|
|
186
183
|
}
|
|
187
184
|
if (result.side) {
|
|
188
185
|
const { reply, persistSessionId, persistThreadId } = result.side;
|
|
189
186
|
if (persistSessionId) {
|
|
190
|
-
|
|
191
|
-
kind: "session_bound",
|
|
192
|
-
by: workerName,
|
|
193
|
-
worker: workerName,
|
|
194
|
-
sessionId: persistSessionId,
|
|
195
|
-
}, project);
|
|
196
|
-
fs.writeFileSync(workerFile(channelName, workerName, "session-id", project), persistSessionId);
|
|
187
|
+
fs.writeFileSync(workerFile(sessionId, workerName, "session-id"), persistSessionId);
|
|
197
188
|
}
|
|
198
189
|
if (persistThreadId) {
|
|
199
|
-
fs.writeFileSync(workerFile(
|
|
190
|
+
fs.writeFileSync(workerFile(sessionId, workerName, "thread-id"), persistThreadId);
|
|
200
191
|
}
|
|
201
192
|
if (reply) {
|
|
202
193
|
for (const r of reply) {
|
|
@@ -209,8 +200,6 @@ export async function applyParseResult(channelName, workerName, result, child, s
|
|
|
209
200
|
}
|
|
210
201
|
}
|
|
211
202
|
}
|
|
212
|
-
if (doneSeen)
|
|
213
|
-
onDone?.();
|
|
214
203
|
}
|
|
215
204
|
/**
|
|
216
205
|
* Convenience wrapper: wire `pumpStdout` to `applyParseResult` with
|
|
@@ -218,20 +207,20 @@ export async function applyParseResult(channelName, workerName, result, child, s
|
|
|
218
207
|
* this and forgets about line buffering / parse plumbing.
|
|
219
208
|
*/
|
|
220
209
|
export function startStdoutPump(args) {
|
|
221
|
-
const {
|
|
210
|
+
const { sessionId, workerName, child, adapter, adapterCtx, log, shutdown, turnTracker, processLines, signal, } = args;
|
|
222
211
|
const drained = pumpStdout(child.stdout, async (line) => {
|
|
223
212
|
if (processLines && !(await processLines))
|
|
224
213
|
return;
|
|
225
214
|
log.write(line + "\n");
|
|
226
215
|
const result = adapter.parseLine(line, adapterCtx);
|
|
227
|
-
await applyParseResult(
|
|
216
|
+
await applyParseResult(sessionId, workerName, result, child, shutdown, turnTracker);
|
|
228
217
|
}, async (err) => {
|
|
229
218
|
log.write(`[supervisor] stdout line handler failed: ${err.message}\n`);
|
|
230
|
-
await appendEvent(
|
|
219
|
+
await appendEvent(sessionId, {
|
|
231
220
|
kind: "error",
|
|
232
221
|
by: `supervisor:${workerName}`,
|
|
233
222
|
message: `stdout pipeline error: ${err.message}`,
|
|
234
|
-
}
|
|
223
|
+
}).catch(() => undefined);
|
|
235
224
|
}, signal);
|
|
236
225
|
return processLines
|
|
237
226
|
? Promise.all([drained, processLines]).then(() => undefined)
|
|
@@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;IACd,CAAC;IAED,OAAO;QACL,OAAO,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC;CACF"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Supervisor pre-timeout warning scheduler.
|
|
3
3
|
*
|
|
4
|
-
* Emits a one-shot `supervisor_warning`
|
|
4
|
+
* Emits a one-shot `supervisor_warning` TeamworkSession event when the teammate
|
|
5
5
|
* is approaching its lifetime timeout, so observers (dispatchers /
|
|
6
|
-
* `trellis
|
|
6
|
+
* `trellis teamwork messages`) can see the impending termination without
|
|
7
7
|
* having to poll. The event is observability-only — it never replaces
|
|
8
8
|
* the eventual `killed` / `done` / `error` terminal event, and is
|
|
9
9
|
* not part of the meaningful-event set so plain `wait` does not wake
|
|
@@ -20,7 +20,7 @@ export interface SupervisorShutdownProbe {
|
|
|
20
20
|
hasTerminalEvent(): boolean;
|
|
21
21
|
}
|
|
22
22
|
export interface ScheduleSupervisorTimeoutWarningArgs {
|
|
23
|
-
|
|
23
|
+
sessionId: string;
|
|
24
24
|
workerName: string;
|
|
25
25
|
timeoutMs: number;
|
|
26
26
|
/** Warning lead time in ms. `<= 0` disables the pre-timeout warning. */
|
|
@@ -38,11 +38,11 @@ export interface ScheduleSupervisorTimeoutWarningArgs {
|
|
|
38
38
|
* (clamped at 0 when the warning lead time is greater than the timeout).
|
|
39
39
|
* Guarded so the warning is emitted at most once, never after shutdown
|
|
40
40
|
* has been requested, never after a terminal event has been emitted,
|
|
41
|
-
* and never after the
|
|
41
|
+
* and never after the teammate process has exited.
|
|
42
42
|
*
|
|
43
43
|
* Returns a cancel handle that callers can invoke to drop the pending
|
|
44
44
|
* timer (e.g. on supervisor teardown). Append failures are logged via
|
|
45
|
-
* `log.write` only and do not affect
|
|
45
|
+
* `log.write` only and do not affect teammate lifecycle.
|
|
46
46
|
*/
|
|
47
47
|
export declare function scheduleSupervisorTimeoutWarning(args: ScheduleSupervisorTimeoutWarningArgs): () => void;
|
|
48
48
|
//# sourceMappingURL=warning.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"warning.d.ts","sourceRoot":"","sources":["../../../../src/commands/teamwork/supervisor/warning.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,gFAAgF;AAChF,eAAO,MAAM,uCAAuC,QAAa,CAAC;AAElE,MAAM,WAAW,uBAAuB;IACtC,cAAc,IAAI,OAAO,CAAC;IAC1B,gBAAgB,IAAI,OAAO,CAAC;CAC7B;AAED,MAAM,WAAW,oCAAoC;IACnD,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,wEAAwE;IACxE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,uBAAuB,CAAC;IAClC,gFAAgF;IAChF,aAAa,EAAE,MAAM,OAAO,CAAC;IAC7B,GAAG,EAAE;QAAE,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;KAAE,CAAC;IACvC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gCAAgC,CAC9C,IAAI,EAAE,oCAAoC,GACzC,MAAM,IAAI,CAuDZ"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Supervisor pre-timeout warning scheduler.
|
|
3
3
|
*
|
|
4
|
-
* Emits a one-shot `supervisor_warning`
|
|
4
|
+
* Emits a one-shot `supervisor_warning` TeamworkSession event when the teammate
|
|
5
5
|
* is approaching its lifetime timeout, so observers (dispatchers /
|
|
6
|
-
* `trellis
|
|
6
|
+
* `trellis teamwork messages`) can see the impending termination without
|
|
7
7
|
* having to poll. The event is observability-only — it never replaces
|
|
8
8
|
* the eventual `killed` / `done` / `error` terminal event, and is
|
|
9
9
|
* not part of the meaningful-event set so plain `wait` does not wake
|
|
@@ -21,14 +21,14 @@ export const SUPERVISOR_TIMEOUT_WARNING_REMAINING_MS = 5 * 60_000;
|
|
|
21
21
|
* (clamped at 0 when the warning lead time is greater than the timeout).
|
|
22
22
|
* Guarded so the warning is emitted at most once, never after shutdown
|
|
23
23
|
* has been requested, never after a terminal event has been emitted,
|
|
24
|
-
* and never after the
|
|
24
|
+
* and never after the teammate process has exited.
|
|
25
25
|
*
|
|
26
26
|
* Returns a cancel handle that callers can invoke to drop the pending
|
|
27
27
|
* timer (e.g. on supervisor teardown). Append failures are logged via
|
|
28
|
-
* `log.write` only and do not affect
|
|
28
|
+
* `log.write` only and do not affect teammate lifecycle.
|
|
29
29
|
*/
|
|
30
30
|
export function scheduleSupervisorTimeoutWarning(args) {
|
|
31
|
-
const {
|
|
31
|
+
const { sessionId, workerName, timeoutMs, shutdown, isChildExited, log } = args;
|
|
32
32
|
if (timeoutMs <= 0)
|
|
33
33
|
return () => undefined;
|
|
34
34
|
const warnBeforeMs = args.warnBeforeMs ?? SUPERVISOR_TIMEOUT_WARNING_REMAINING_MS;
|
|
@@ -51,7 +51,7 @@ export function scheduleSupervisorTimeoutWarning(args) {
|
|
|
51
51
|
warningEmitted = true;
|
|
52
52
|
void (async () => {
|
|
53
53
|
try {
|
|
54
|
-
await appendEvent(
|
|
54
|
+
await appendEvent(sessionId, {
|
|
55
55
|
kind: "supervisor_warning",
|
|
56
56
|
by: `supervisor:${workerName}`,
|
|
57
57
|
worker: workerName,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"warning.js","sourceRoot":"","sources":["../../../../src/commands/teamwork/supervisor/warning.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,gFAAgF;AAChF,MAAM,CAAC,MAAM,uCAAuC,GAAG,CAAC,GAAG,MAAM,CAAC;AAoBlE;;;;;;;;;;GAUG;AACH,MAAM,UAAU,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AC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;gBAC7D,GAAG,CAAC,KAAK,CAAC,uCAAuC,GAAG,IAAI,CAAC,CAAC;YAC5D,CAAC;QACH,CAAC,CAAC,EAAE,CAAC;IACP,CAAC,CAAC;IAEF,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACtC,gEAAgE;IAChE,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC;IAEhB,OAAO,GAAG,EAAE;QACV,SAAS,GAAG,IAAI,CAAC;QACjB,YAAY,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Supervisor process: owns
|
|
3
|
-
*
|
|
2
|
+
* Supervisor process: owns one teammate process (Claude Code or Codex) and
|
|
3
|
+
* bridges teammate messages with the TeamworkSession event log.
|
|
4
4
|
*
|
|
5
|
-
* Run as: `trellis
|
|
5
|
+
* Run as: `trellis teamwork __supervisor <sessionId> <teammate> <config-path>`
|
|
6
6
|
*
|
|
7
7
|
* Three concurrent loops:
|
|
8
|
-
* 1. stdout reader — parse
|
|
9
|
-
* 2. inbox watcher — read events.jsonl for `to=<
|
|
10
|
-
* translate via adapter.encodeUserMessage →
|
|
11
|
-
* 3. signal handler — SIGTERM → close
|
|
8
|
+
* 1. stdout reader — parse teammate output → adapter → append events
|
|
9
|
+
* 2. inbox watcher — read events.jsonl for `to=<teammate>` messages,
|
|
10
|
+
* translate via adapter.encodeUserMessage → process stdin
|
|
11
|
+
* 3. signal handler — SIGTERM → close process stdin → 3s → SIGTERM → 3s → SIGKILL
|
|
12
12
|
* → write `killed` event → exit
|
|
13
13
|
*/
|
|
14
|
-
import { type InboxPolicy } from "@pennixrv/trellis-core/
|
|
14
|
+
import { type InboxPolicy } from "@pennixrv/trellis-core/teamwork";
|
|
15
15
|
import type { CodexSandboxMode } from "./adapters/codex.js";
|
|
16
16
|
import { type Provider } from "./adapters/index.js";
|
|
17
17
|
export interface SupervisorConfig {
|
|
18
18
|
provider: Provider;
|
|
19
19
|
cwd: string;
|
|
20
|
-
/** Combined
|
|
20
|
+
/** Combined teammate system prompt: Teamwork protocol prefix + agent body.
|
|
21
21
|
* Injected via Claude `--append-system-prompt(-file)` or Codex
|
|
22
22
|
* `developerInstructions`. The supervisor also persists it to
|
|
23
|
-
* `<
|
|
23
|
+
* `<teammate>.system-prompt.md` and exposes the path as
|
|
24
24
|
* `view.systemPromptFile` so adapters can avoid OS argv-length limits.
|
|
25
|
-
* No "initial user prompt" — the
|
|
26
|
-
* inbox
|
|
25
|
+
* No "initial user prompt" — the teammate stays idle until its first
|
|
26
|
+
* inbox message arrives. */
|
|
27
27
|
systemPrompt: string;
|
|
28
28
|
/** Extra env vars (TRELLIS_HOOKS=0 etc. are added automatically). */
|
|
29
29
|
env?: Record<string, string>;
|
|
@@ -33,19 +33,19 @@ export interface SupervisorConfig {
|
|
|
33
33
|
resume?: string;
|
|
34
34
|
/** Codex-only: overrides the `thread/start` sandbox mode (default `workspace-write`). */
|
|
35
35
|
sandbox?: CodexSandboxMode;
|
|
36
|
-
/** Auto-kill
|
|
36
|
+
/** Auto-kill the teammate process after this many ms (anti-zombie). */
|
|
37
37
|
timeoutMs?: number;
|
|
38
38
|
/** Emit supervisor_warning this many ms before timeout. `<=0` disables it. */
|
|
39
39
|
warnBeforeMs?: number;
|
|
40
40
|
/**
|
|
41
|
-
*
|
|
41
|
+
* Teammate-guard idle-cleanup TTL in ms. When a running teammate stays idle
|
|
42
42
|
* for this long (no active turn), the supervisor self-terminates with
|
|
43
43
|
* `killed{reason:"idle-timeout"}`. `<=0` or undefined disables.
|
|
44
44
|
*/
|
|
45
45
|
idleTimeoutMs?: number;
|
|
46
46
|
/** Caller identity recorded on the `spawned` event (default "main"). */
|
|
47
47
|
spawnedBy?: string;
|
|
48
|
-
/** Agent definition
|
|
48
|
+
/** Agent definition loaded for this teammate, if any (recorded on `spawned`). */
|
|
49
49
|
agent?: string;
|
|
50
50
|
/** Relative paths injected via --file / --jsonl (recorded on `spawned`). */
|
|
51
51
|
contextFiles?: string[];
|
|
@@ -53,7 +53,7 @@ export interface SupervisorConfig {
|
|
|
53
53
|
* (recorded on `spawned` for observability — "I passed --jsonl X but
|
|
54
54
|
* X contained no real entries"). */
|
|
55
55
|
contextManifests?: string[];
|
|
56
|
-
/**
|
|
56
|
+
/** Teammate inbox delivery policy (recorded on `spawned`; default
|
|
57
57
|
* `explicitOnly`). */
|
|
58
58
|
inboxPolicy?: InboxPolicy;
|
|
59
59
|
}
|
|
@@ -62,7 +62,7 @@ interface ResolvedProviderPath {
|
|
|
62
62
|
prefixArgs: string[];
|
|
63
63
|
}
|
|
64
64
|
/**
|
|
65
|
-
* Drain
|
|
65
|
+
* Drain teammate output before synthesising terminal state and removing the
|
|
66
66
|
* supervisor's runtime files.
|
|
67
67
|
*/
|
|
68
68
|
export declare function finalizeSupervisorExit(args: {
|
|
@@ -78,14 +78,14 @@ export declare function finalizeSupervisorExit(args: {
|
|
|
78
78
|
* Resolve the real launch target for npm `.cmd` shims on Windows.
|
|
79
79
|
*
|
|
80
80
|
* @param provider CLI basename for the provider, such as `codex` or `claude`.
|
|
81
|
-
* @param cwd
|
|
81
|
+
* @param cwd Teammate launch directory, used to check local `node_modules/.bin` first.
|
|
82
82
|
* @returns Command and prefix arguments that can be passed directly to `spawn()`.
|
|
83
83
|
*/
|
|
84
84
|
export declare function resolveProviderPath(provider: string, cwd?: string): ResolvedProviderPath;
|
|
85
85
|
/**
|
|
86
|
-
* Entry point invoked by `trellis
|
|
86
|
+
* Entry point invoked by `trellis teamwork __supervisor <sessionId> <teammate> <config>`.
|
|
87
87
|
*/
|
|
88
|
-
export declare function runSupervisor(
|
|
89
|
-
export declare function writeSupervisorConfig(
|
|
88
|
+
export declare function runSupervisor(sessionId: string, workerName: string, configPath: string): Promise<void>;
|
|
89
|
+
export declare function writeSupervisorConfig(sessionId: string, workerName: string, config: SupervisorConfig, project?: string): string;
|
|
90
90
|
export {};
|
|
91
91
|
//# sourceMappingURL=supervisor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"supervisor.d.ts","sourceRoot":"","sources":["../../../src/commands/teamwork/supervisor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAOH,OAAO,EAEL,KAAK,WAAW,EACjB,MAAM,iCAAiC,CAAC;AAGzC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAc,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAahE,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,QAAQ,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ;;;;;;iCAM6B;IAC7B,YAAY,EAAE,MAAM,CAAC;IACrB,qEAAqE;IACrE,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,+BAA+B;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2DAA2D;IAC3D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,yFAAyF;IACzF,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,uEAAuE;IACvE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8EAA8E;IAC9E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wEAAwE;IACxE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iFAAiF;IACjF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB;;yCAEqC;IACrC,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B;2BACuB;IACvB,WAAW,CAAC,EAAE,W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