@pennixrv/trellis 0.7.0-beta.9 → 0.7.1-beta.1
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 +93 -90
- 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-beta.1.json +186 -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/extract.js +4 -0
- package/dist/templates/extract.js.map +1 -1
- 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 +2 -1
- package/dist/utils/manifest-prune.d.ts.map +1 -1
- package/dist/utils/manifest-prune.js +14 -16
- 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
|
@@ -2,12 +2,12 @@ import fs from "node:fs";
|
|
|
2
2
|
import os from "node:os";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { GLOBAL_PROJECT_KEY, } from "./schema.js";
|
|
5
|
-
/** Top-level Trellis
|
|
6
|
-
export function
|
|
7
|
-
const env = process.env.
|
|
5
|
+
/** Top-level Trellis Teamwork directory. */
|
|
6
|
+
export function teamworkRoot() {
|
|
7
|
+
const env = process.env.TRELLIS_TEAMWORK_ROOT;
|
|
8
8
|
if (env && env.length > 0)
|
|
9
9
|
return path.resolve(env);
|
|
10
|
-
return path.join(os.homedir(), ".trellis", "
|
|
10
|
+
return path.join(os.homedir(), ".trellis", "teamwork");
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
13
|
* Derive a per-project bucket name from an absolute cwd, mirroring
|
|
@@ -33,131 +33,68 @@ export function projectKey(cwd) {
|
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
35
|
* Project key for the current CLI invocation. Reads
|
|
36
|
-
* `
|
|
36
|
+
* `TRELLIS_TEAMWORK_PROJECT` env first (set by the supervisor spawn so
|
|
37
37
|
* detached children land in the same bucket as the spawning CLI), then
|
|
38
38
|
* falls back to deriving from `process.cwd()`.
|
|
39
39
|
*/
|
|
40
40
|
export function currentProjectKey() {
|
|
41
|
-
const env = process.env.
|
|
41
|
+
const env = process.env.TRELLIS_TEAMWORK_PROJECT;
|
|
42
42
|
if (env && env.length > 0)
|
|
43
43
|
return env;
|
|
44
44
|
return projectKey(process.cwd());
|
|
45
45
|
}
|
|
46
|
-
/** Directory holding
|
|
46
|
+
/** Directory holding Teamwork Sessions for a given project. */
|
|
47
47
|
export function projectDir(project = currentProjectKey()) {
|
|
48
|
-
return path.join(
|
|
48
|
+
return path.join(teamworkRoot(), project);
|
|
49
49
|
}
|
|
50
|
-
/** Marker file
|
|
51
|
-
* flat-layout channel. New project buckets touch this on first use. */
|
|
50
|
+
/** Marker file identifying a project bucket. New buckets create it on first use. */
|
|
52
51
|
const BUCKET_MARKER = ".bucket";
|
|
53
|
-
/** Characters allowed in a
|
|
52
|
+
/** Characters allowed in a Teamwork Session or teammate name used as a path segment. */
|
|
54
53
|
const SAFE_SEGMENT_RE = /^[A-Za-z0-9._-]+$/;
|
|
55
54
|
/**
|
|
56
|
-
* Whether a
|
|
55
|
+
* Whether a Teamwork Session or teammate name is usable as a filesystem segment.
|
|
57
56
|
* Discovery scans use this to skip directories created before name
|
|
58
57
|
* validation existed (spaces, CJK, ...) — they can never be valid
|
|
59
|
-
*
|
|
58
|
+
* valid Teamwork Sessions, and `assertSafeName` throwing mid-scan would kill the scan.
|
|
60
59
|
*/
|
|
61
60
|
export function isSafeName(name) {
|
|
62
61
|
return name !== "." && name !== ".." && SAFE_SEGMENT_RE.test(name);
|
|
63
62
|
}
|
|
64
63
|
/**
|
|
65
64
|
* Reject names that would escape their bucket when joined into a path.
|
|
66
|
-
* A
|
|
65
|
+
* A Teamwork Session ID or worker name becomes a filesystem segment; without this guard
|
|
67
66
|
* a name like `../../x` lets `path.join` resolve outside the store and a
|
|
68
67
|
* later `fs.rmSync(recursive)` deletes arbitrary directories.
|
|
69
68
|
*/
|
|
70
|
-
export function assertSafeName(name, kind = "
|
|
69
|
+
export function assertSafeName(name, kind = "Teamwork Session") {
|
|
71
70
|
if (!isSafeName(name)) {
|
|
72
71
|
throw new Error(`Invalid ${kind} name: ${JSON.stringify(name)}. ` +
|
|
73
72
|
`Names may only contain letters, digits, '.', '_' and '-'.`);
|
|
74
73
|
}
|
|
75
74
|
}
|
|
76
75
|
/**
|
|
77
|
-
*
|
|
76
|
+
* Teamwork Session directory inside its project bucket. Defaults to the current
|
|
78
77
|
* project (cwd-derived); pass an explicit project for cross-project
|
|
79
78
|
* addressing.
|
|
80
79
|
*/
|
|
81
|
-
export function
|
|
80
|
+
export function sessionDir(name, project = currentProjectKey()) {
|
|
82
81
|
assertSafeName(name);
|
|
83
82
|
return path.join(projectDir(project), name);
|
|
84
83
|
}
|
|
85
84
|
export function eventsPath(name, project = currentProjectKey()) {
|
|
86
|
-
return path.join(
|
|
85
|
+
return path.join(sessionDir(name, project), "events.jsonl");
|
|
87
86
|
}
|
|
88
87
|
export function lockPath(name, project = currentProjectKey()) {
|
|
89
|
-
return path.join(
|
|
88
|
+
return path.join(sessionDir(name, project), `${name}.lock`);
|
|
90
89
|
}
|
|
91
90
|
export function workerFile(name, worker, suffix, project = currentProjectKey()) {
|
|
92
91
|
assertSafeName(worker, "worker");
|
|
93
|
-
return path.join(
|
|
92
|
+
return path.join(sessionDir(name, project), `${worker}.${suffix}`);
|
|
94
93
|
}
|
|
95
94
|
export function workerLockPath(name, worker, project = currentProjectKey()) {
|
|
96
95
|
assertSafeName(worker, "worker");
|
|
97
|
-
return path.join(
|
|
96
|
+
return path.join(sessionDir(name, project), `${worker}.spawnlock`);
|
|
98
97
|
}
|
|
99
|
-
/**
|
|
100
|
-
* One-shot migration: move legacy flat channels at `<root>/<name>/` into
|
|
101
|
-
* a `_legacy/` bucket so the new project-scoped layout can use the top
|
|
102
|
-
* level. Called lazily by `currentProject*` consumers — safe to invoke
|
|
103
|
-
* multiple times (idempotent).
|
|
104
|
-
*
|
|
105
|
-
* A directory at `<root>/X` is treated as a legacy channel if:
|
|
106
|
-
* - it doesn't have a `.bucket` marker (so it's not a project bucket)
|
|
107
|
-
* - AND it contains an `events.jsonl` directly inside
|
|
108
|
-
*
|
|
109
|
-
* Buckets named `_legacy` and `_default` are reserved and never moved.
|
|
110
|
-
*/
|
|
111
|
-
export function migrateLegacyChannels() {
|
|
112
|
-
const root = channelRoot();
|
|
113
|
-
if (!fs.existsSync(root))
|
|
114
|
-
return;
|
|
115
|
-
const legacy = path.join(root, "_legacy");
|
|
116
|
-
let moved = 0;
|
|
117
|
-
let entries;
|
|
118
|
-
try {
|
|
119
|
-
entries = fs.readdirSync(root);
|
|
120
|
-
}
|
|
121
|
-
catch {
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
124
|
-
for (const entry of entries) {
|
|
125
|
-
if (entry === "_legacy" || entry === "_default")
|
|
126
|
-
continue;
|
|
127
|
-
const dir = path.join(root, entry);
|
|
128
|
-
let stat;
|
|
129
|
-
try {
|
|
130
|
-
stat = fs.statSync(dir);
|
|
131
|
-
}
|
|
132
|
-
catch {
|
|
133
|
-
continue;
|
|
134
|
-
}
|
|
135
|
-
if (!stat.isDirectory())
|
|
136
|
-
continue;
|
|
137
|
-
// Project bucket marker → skip.
|
|
138
|
-
if (fs.existsSync(path.join(dir, BUCKET_MARKER)))
|
|
139
|
-
continue;
|
|
140
|
-
// Heuristic: a legacy channel has events.jsonl directly.
|
|
141
|
-
if (!fs.existsSync(path.join(dir, "events.jsonl")))
|
|
142
|
-
continue;
|
|
143
|
-
// It's legacy — move it to _legacy/<name>/.
|
|
144
|
-
fs.mkdirSync(legacy, { recursive: true });
|
|
145
|
-
const target = path.join(legacy, entry);
|
|
146
|
-
try {
|
|
147
|
-
fs.renameSync(dir, target);
|
|
148
|
-
moved++;
|
|
149
|
-
}
|
|
150
|
-
catch (err) {
|
|
151
|
-
process.stderr.write(`[channel migrate] failed to move ${entry} to _legacy/: ${err instanceof Error ? err.message : err}\n`);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
if (moved > 0) {
|
|
155
|
-
fs.mkdirSync(legacy, { recursive: true });
|
|
156
|
-
fs.writeFileSync(path.join(legacy, BUCKET_MARKER), "");
|
|
157
|
-
process.stderr.write(`[channel migrate] moved ${moved} legacy channel(s) to ${legacy}\n`);
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
/** Mark a directory as a project bucket so the migrator skips it. */
|
|
161
98
|
export function ensureBucketMarker(project) {
|
|
162
99
|
const dir = projectDir(project);
|
|
163
100
|
fs.mkdirSync(dir, { recursive: true });
|
|
@@ -166,9 +103,9 @@ export function ensureBucketMarker(project) {
|
|
|
166
103
|
fs.writeFileSync(marker, "");
|
|
167
104
|
}
|
|
168
105
|
}
|
|
169
|
-
/** Enumerate all project buckets currently on disk
|
|
106
|
+
/** Enumerate all project buckets currently on disk. */
|
|
170
107
|
export function listProjects() {
|
|
171
|
-
const root =
|
|
108
|
+
const root = teamworkRoot();
|
|
172
109
|
if (!fs.existsSync(root))
|
|
173
110
|
return [];
|
|
174
111
|
const out = [];
|
|
@@ -181,18 +118,15 @@ export function listProjects() {
|
|
|
181
118
|
catch {
|
|
182
119
|
continue;
|
|
183
120
|
}
|
|
184
|
-
// A directory is a project bucket if it has the marker
|
|
185
|
-
// _legacy / _default / _global (reserved bucket names).
|
|
121
|
+
// A directory is a project bucket if it has the marker or is global.
|
|
186
122
|
if (fs.existsSync(path.join(dir, BUCKET_MARKER)) ||
|
|
187
|
-
entry === "_legacy" ||
|
|
188
|
-
entry === "_default" ||
|
|
189
123
|
entry === GLOBAL_PROJECT_KEY) {
|
|
190
124
|
out.push(entry);
|
|
191
125
|
}
|
|
192
126
|
}
|
|
193
127
|
return out;
|
|
194
128
|
}
|
|
195
|
-
export function
|
|
129
|
+
export function resolveTeamworkSessionProjectForCreate(name, opts = {}) {
|
|
196
130
|
const scope = opts.scope ?? "project";
|
|
197
131
|
const project = scope === "global"
|
|
198
132
|
? GLOBAL_PROJECT_KEY
|
|
@@ -203,11 +137,10 @@ export function resolveChannelProjectForCreate(name, opts = {}) {
|
|
|
203
137
|
name,
|
|
204
138
|
scope,
|
|
205
139
|
project,
|
|
206
|
-
dir:
|
|
140
|
+
dir: sessionDir(name, project),
|
|
207
141
|
};
|
|
208
142
|
}
|
|
209
|
-
export function
|
|
210
|
-
migrateLegacyChannels();
|
|
143
|
+
export function resolveExistingTeamworkSession(name, opts = {}) {
|
|
211
144
|
if (opts.scope) {
|
|
212
145
|
const project = opts.scope === "global"
|
|
213
146
|
? GLOBAL_PROJECT_KEY
|
|
@@ -215,10 +148,10 @@ export function resolveExistingChannelRef(name, opts = {}) {
|
|
|
215
148
|
? projectKey(opts.cwd)
|
|
216
149
|
: currentProjectKey();
|
|
217
150
|
if (!fs.existsSync(eventsPath(name, project))) {
|
|
218
|
-
throw new Error(`
|
|
151
|
+
throw new Error(`Teamwork Session '${name}' not found in ${opts.scope} scope (${project})`);
|
|
219
152
|
}
|
|
220
|
-
process.env.
|
|
221
|
-
return { name, scope: opts.scope, project, dir:
|
|
153
|
+
process.env.TRELLIS_TEAMWORK_PROJECT = project;
|
|
154
|
+
return { name, scope: opts.scope, project, dir: sessionDir(name, project) };
|
|
222
155
|
}
|
|
223
156
|
const current = currentProjectKey();
|
|
224
157
|
const projectMatches = listProjects()
|
|
@@ -226,47 +159,47 @@ export function resolveExistingChannelRef(name, opts = {}) {
|
|
|
226
159
|
.filter((project) => fs.existsSync(eventsPath(name, project)));
|
|
227
160
|
const globalExists = fs.existsSync(eventsPath(name, GLOBAL_PROJECT_KEY));
|
|
228
161
|
if (globalExists && projectMatches.length > 0) {
|
|
229
|
-
throw new Error(`
|
|
162
|
+
throw new Error(`Teamwork Session '${name}' exists in global and project scopes. Use --scope global or --scope project.`);
|
|
230
163
|
}
|
|
231
164
|
if (globalExists) {
|
|
232
|
-
process.env.
|
|
165
|
+
process.env.TRELLIS_TEAMWORK_PROJECT = GLOBAL_PROJECT_KEY;
|
|
233
166
|
return {
|
|
234
167
|
name,
|
|
235
168
|
scope: "global",
|
|
236
169
|
project: GLOBAL_PROJECT_KEY,
|
|
237
|
-
dir:
|
|
170
|
+
dir: sessionDir(name, GLOBAL_PROJECT_KEY),
|
|
238
171
|
};
|
|
239
172
|
}
|
|
240
173
|
if (fs.existsSync(eventsPath(name, current))) {
|
|
241
|
-
process.env.
|
|
174
|
+
process.env.TRELLIS_TEAMWORK_PROJECT = current;
|
|
242
175
|
return {
|
|
243
176
|
name,
|
|
244
177
|
scope: "project",
|
|
245
178
|
project: current,
|
|
246
|
-
dir:
|
|
179
|
+
dir: sessionDir(name, current),
|
|
247
180
|
};
|
|
248
181
|
}
|
|
249
182
|
if (projectMatches.length === 1) {
|
|
250
|
-
process.env.
|
|
183
|
+
process.env.TRELLIS_TEAMWORK_PROJECT = projectMatches[0];
|
|
251
184
|
return {
|
|
252
185
|
name,
|
|
253
186
|
scope: "project",
|
|
254
187
|
project: projectMatches[0],
|
|
255
|
-
dir:
|
|
188
|
+
dir: sessionDir(name, projectMatches[0]),
|
|
256
189
|
};
|
|
257
190
|
}
|
|
258
191
|
if (projectMatches.length > 1) {
|
|
259
|
-
throw new Error(`
|
|
192
|
+
throw new Error(`Teamwork Session '${name}' exists in multiple project buckets: ${projectMatches.join(", ")}. Run from the owning project cwd or use --scope.`);
|
|
260
193
|
}
|
|
261
|
-
throw new Error(`
|
|
194
|
+
throw new Error(`Teamwork Session '${name}' not found in current project bucket (${current}) or any known scope`);
|
|
262
195
|
}
|
|
263
196
|
/**
|
|
264
|
-
* Select the project bucket for an existing
|
|
197
|
+
* Select the project bucket for an existing Teamwork Session in this CLI process.
|
|
265
198
|
* Current cwd wins. If it is not there, fall back to a unique match across
|
|
266
|
-
* all buckets so users can run `
|
|
199
|
+
* all buckets so users can run `trellis teamwork send <name>` from a different cwd
|
|
267
200
|
* without silently writing a second event stream.
|
|
268
201
|
*/
|
|
269
|
-
export function
|
|
270
|
-
return
|
|
202
|
+
export function selectExistingTeamworkSessionProject(name) {
|
|
203
|
+
return resolveExistingTeamworkSession(name).project;
|
|
271
204
|
}
|
|
272
205
|
//# sourceMappingURL=paths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../../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wBAAwB,GAAG,OAAO,CAAC;QAC/C,OAAO;YACL,IAAI;YACJ,KAAK,EAAE,SAAS;YAChB,OAAO,EAAE,OAAO;YAChB,GAAG,EAAE,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC;SAC/B,CAAC;IACJ,CAAC;IAED,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAChC,OAAO,CAAC,GAAG,CAAC,wBAAwB,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC;QACzD,OAAO;YACL,IAAI;YACJ,KAAK,EAAE,SAAS;YAChB,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC;YAC1B,GAAG,EAAE,UAAU,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC;SACzC,CAAC;IACJ,CAAC;IAED,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CACb,qBAAqB,IAAI,yCAAyC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,mDAAmD,CAC/I,CAAC;IACJ,CAAC;IAED,MAAM,IAAI,KAAK,CACb,qBAAqB,IAAI,0CAA0C,OAAO,sBAAsB,CACjG,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,oCAAoC,CAAC,IAAY;IAC/D,OAAO,8BAA8B,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC;AACtD,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TeamworkSession schema re-exports.
|
|
3
|
+
*
|
|
4
|
+
* Canonical source: `@pennixrv/trellis-core/teamwork`. This module is
|
|
5
|
+
* kept as a thin pass-through during the supervisor/wait migration so
|
|
6
|
+
* CLI runtime code (supervisor, spawn, kill, wait) can continue to
|
|
7
|
+
* import from a stable local path while command files migrate to the
|
|
8
|
+
* core public API directly.
|
|
9
|
+
*/
|
|
10
|
+
export { GLOBAL_PROJECT_KEY, TEAMWORK_SESSION_TYPES, THREAD_ACTIONS, parseTeamworkSessionScope, parseTeamworkSessionType, parseThreadAction, normalizeThreadKey, asStringArray, asContextEntries, buildContextEntries, } from "@pennixrv/trellis-core/teamwork";
|
|
11
|
+
export type { TeamworkSessionScope, TeamworkSessionType, TeamworkSessionRef, TeamworkSessionMetadata, ContextEntry, FileContextEntry, RawContextEntry, ThreadAction, EventOrigin, } from "@pennixrv/trellis-core/teamwork";
|
|
12
|
+
/**
|
|
13
|
+
* CSV parser kept colocated with the schema for CLI command files that
|
|
14
|
+
* trim comma-separated label / target lists. Pure helper — does not
|
|
15
|
+
* touch Teamwork Session storage.
|
|
16
|
+
*/
|
|
17
|
+
export declare function parseCsv(value: string | undefined): string[] | undefined;
|
|
18
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/commands/teamwork/store/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,cAAc,EACd,yBAAyB,EACzB,wBAAwB,EACxB,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,iCAAiC,CAAC;AAEzC,YAAY,EACV,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,uBAAuB,EACvB,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,WAAW,GACZ,MAAM,iCAAiC,CAAC;AAEzC;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,EAAE,GAAG,SAAS,CAMxE"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TeamworkSession schema re-exports.
|
|
3
|
+
*
|
|
4
|
+
* Canonical source: `@pennixrv/trellis-core/teamwork`. This module is
|
|
5
|
+
* kept as a thin pass-through during the supervisor/wait migration so
|
|
6
|
+
* CLI runtime code (supervisor, spawn, kill, wait) can continue to
|
|
7
|
+
* import from a stable local path while command files migrate to the
|
|
8
|
+
* core public API directly.
|
|
9
|
+
*/
|
|
10
|
+
export { GLOBAL_PROJECT_KEY, TEAMWORK_SESSION_TYPES, THREAD_ACTIONS, parseTeamworkSessionScope, parseTeamworkSessionType, parseThreadAction, normalizeThreadKey, asStringArray, asContextEntries, buildContextEntries, } from "@pennixrv/trellis-core/teamwork";
|
|
11
|
+
/**
|
|
12
|
+
* CSV parser kept colocated with the schema for CLI command files that
|
|
13
|
+
* trim comma-separated label / target lists. Pure helper — does not
|
|
14
|
+
* touch Teamwork Session storage.
|
|
15
|
+
*/
|
|
16
|
+
export function parseCsv(value) {
|
|
17
|
+
const out = value
|
|
18
|
+
?.split(",")
|
|
19
|
+
.map((s) => s.trim())
|
|
20
|
+
.filter(Boolean);
|
|
21
|
+
return out && out.length > 0 ? out : undefined;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../src/commands/teamwork/store/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,cAAc,EACd,yBAAyB,EACzB,wBAAwB,EACxB,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,iCAAiC,CAAC;AAczC;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAyB;IAChD,MAAM,GAAG,GAAG,KAAK;QACf,EAAE,KAAK,CAAC,GAAG,CAAC;SACX,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;SACpB,MAAM,CAAC,OAAO,CAAC,CAAC;IACnB,OAAO,GAAG,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC;AACjD,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { reduceThreads, buildThreadAliasResolver, collectThreadTimeline, } from "@pennixrv/trellis-core/
|
|
2
|
-
export type { ThreadState, ThreadAliasResolver, } from "@pennixrv/trellis-core/
|
|
3
|
-
import type { ThreadState } from "@pennixrv/trellis-core/
|
|
1
|
+
export { reduceThreads, buildThreadAliasResolver, collectThreadTimeline, } from "@pennixrv/trellis-core/teamwork";
|
|
2
|
+
export type { ThreadState, ThreadAliasResolver, } from "@pennixrv/trellis-core/teamwork";
|
|
3
|
+
import type { ThreadState } from "@pennixrv/trellis-core/teamwork";
|
|
4
4
|
export declare function formatThreadBoard(states: ThreadState[]): string[];
|
|
5
5
|
//# sourceMappingURL=thread-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thread-state.d.ts","sourceRoot":"","sources":["../../../../src/commands/teamwork/store/thread-state.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,wBAAwB,EACxB,qBAAqB,GACtB,MAAM,iCAAiC,CAAC;AAEzC,YAAY,EACV,WAAW,EACX,mBAAmB,GACpB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAEnE,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,EAAE,CAcjE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { reduceThreads, buildThreadAliasResolver, collectThreadTimeline, } from "@pennixrv/trellis-core/
|
|
1
|
+
export { reduceThreads, buildThreadAliasResolver, collectThreadTimeline, } from "@pennixrv/trellis-core/teamwork";
|
|
2
2
|
export function formatThreadBoard(states) {
|
|
3
3
|
if (states.length === 0)
|
|
4
4
|
return ["(no threads)"];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thread-state.js","sourceRoot":"","sources":["../../../../src/commands/teamwork/store/thread-state.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,wBAAwB,EACxB,qBAAqB,GACtB,MAAM,iCAAiC,CAAC;AASzC,MAAM,UAAU,iBAAiB,CAAC,MAAqB;IACrD,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,CAAC,cAAc,CAAC,CAAC;IACjD,OAAO;QACL,uBAAuB;QACvB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;YACtB,MAAM,MAAM,GACV,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACrE,MAAM,SAAS,GACb,KAAK,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC;gBACxB,CAAC,CAAC,cAAc,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;gBAC3C,CAAC,CAAC,EAAE,CAAC;YACT,OAAO,GAAG,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,KAAK,IAAI,EAAE,GAAG,MAAM,GAAG,SAAS,EAAE,CAAC;QACvF,CAAC,CAAC;KACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { TeamworkEvent } from "./events.js";
|
|
2
|
+
import { type TeamworkEventFilter } from "./filter.js";
|
|
3
|
+
export type WatchFilter = TeamworkEventFilter;
|
|
4
|
+
/**
|
|
5
|
+
* Watch the Teamwork Session events.jsonl file for matching events.
|
|
6
|
+
*
|
|
7
|
+
* Yields each matching event as it arrives. Caller may break to stop;
|
|
8
|
+
* the function cleans up on iterator return.
|
|
9
|
+
*
|
|
10
|
+
* Implementation: fs.watch with a 200ms safety poll for platforms where
|
|
11
|
+
* fs.watch is lossy (Windows, NFS, etc.).
|
|
12
|
+
*/
|
|
13
|
+
export declare function watchEvents(sessionId: string, filter: WatchFilter, opts?: {
|
|
14
|
+
signal?: AbortSignal;
|
|
15
|
+
fromStart?: boolean;
|
|
16
|
+
sinceSeq?: number;
|
|
17
|
+
project?: string;
|
|
18
|
+
}): AsyncGenerator<TeamworkEvent, void, unknown>;
|
|
19
|
+
//# sourceMappingURL=watch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["../../../../src/commands/teamwork/store/watch.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAsB,KAAK,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAE3E,MAAM,MAAM,WAAW,GAAG,mBAAmB,CAAC;AAwD9C;;;;;;;;GAQG;AACH,wBAAuB,WAAW,CAChC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,WAAW,EACnB,IAAI,GAAE;IACJ,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CACb,GACL,cAAc,CAAC,aAAa,EAAE,IAAI,EAAE,OAAO,CAAC,CA2F9C"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import { StringDecoder } from "node:string_decoder";
|
|
3
|
-
import { eventsPath,
|
|
3
|
+
import { eventsPath, sessionDir } from "./paths.js";
|
|
4
4
|
import { matchesEventFilter } from "./filter.js";
|
|
5
5
|
async function readNewEvents(filePath, state) {
|
|
6
6
|
if (!fs.existsSync(filePath)) {
|
|
@@ -50,7 +50,7 @@ async function readNewEvents(filePath, state) {
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
53
|
-
* Watch the
|
|
53
|
+
* Watch the Teamwork Session events.jsonl file for matching events.
|
|
54
54
|
*
|
|
55
55
|
* Yields each matching event as it arrives. Caller may break to stop;
|
|
56
56
|
* the function cleans up on iterator return.
|
|
@@ -58,11 +58,11 @@ async function readNewEvents(filePath, state) {
|
|
|
58
58
|
* Implementation: fs.watch with a 200ms safety poll for platforms where
|
|
59
59
|
* fs.watch is lossy (Windows, NFS, etc.).
|
|
60
60
|
*/
|
|
61
|
-
export async function* watchEvents(
|
|
62
|
-
const file = eventsPath(
|
|
63
|
-
// Ensure
|
|
64
|
-
if (!fs.existsSync(
|
|
65
|
-
await fs.promises.mkdir(
|
|
61
|
+
export async function* watchEvents(sessionId, filter, opts = {}) {
|
|
62
|
+
const file = eventsPath(sessionId, opts.project);
|
|
63
|
+
// Ensure the Teamwork Session directory exists so fs.watch works.
|
|
64
|
+
if (!fs.existsSync(sessionDir(sessionId, opts.project))) {
|
|
65
|
+
await fs.promises.mkdir(sessionDir(sessionId, opts.project), {
|
|
66
66
|
recursive: true,
|
|
67
67
|
});
|
|
68
68
|
}
|
|
@@ -101,7 +101,7 @@ export async function* watchEvents(channelName, filter, opts = {}) {
|
|
|
101
101
|
};
|
|
102
102
|
let watcher = null;
|
|
103
103
|
try {
|
|
104
|
-
watcher = fs.watch(
|
|
104
|
+
watcher = fs.watch(sessionDir(sessionId, opts.project), () => wake());
|
|
105
105
|
watcher.on("error", () => {
|
|
106
106
|
try {
|
|
107
107
|
watcher?.close();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watch.js","sourceRoot":"","sources":["../../../../src/commands/teamwork/store/watch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAEpD,OAAO,EAAE,kBAAkB,EAA4B,MAAM,aAAa,CAAC;AAU3E,KAAK,UAA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EAAE;QACvB,IAAI,KAAK,EAAE,CAAC;YACV,YAAY,CAAC,KAAK,CAAC,CAAC;YACpB,KAAK,GAAG,SAAS,CAAC;QACpB,CAAC;IACH,CAAC,CAAC;IAEF,MAAM,IAAI,GAAG,GAAS,EAAE;QACtB,KAAK,GAAG,SAAS,CAAC;QAClB,IAAI,SAAS;YAAE,OAAO;QACtB,IAAI,QAAQ,CAAC,cAAc,EAAE,IAAI,aAAa,EAAE,EAAE,CAAC;YACjD,OAAO;QACT,CAAC;QACD,GAAG,CAAC,KAAK,CACP,6BAA6B,aAAa,mCAAmC,CAC9E,CAAC;QACF,KAAK,QAAQ,CAAC,OAAO,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;IACnD,CAAC,CAAC;IAEF,MAAM,KAAK,GAAG,GAAS,EAAE;QACvB,IAAI,SAAS;YAAE,OAAO;QACtB,KAAK,EAAE,CAAC;QACR,KAAK,GAAG,UAAU,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;QACxC,gEAAgE;QAChE,iEAAiE;QACjE,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC;IAClB,CAAC,CAAC;IAEF,yDAAyD;IACzD,KAAK,EAAE,CAAC;IAER,OAAO;QACL,KAAK,EAAE,KAAK;QACZ,KAAK,EAAE,KAAK;QACZ,MAAM,EAAE,GAAG,EAAE;YACX,SAAS,GAAG,IAAI,CAAC;YACjB,KAAK,EAAE,CAAC;QACV,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -10,12 +10,12 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import type { ChildProcessByStdio } from "node:child_process";
|
|
12
12
|
import type { Readable, Writable } from "node:stream";
|
|
13
|
-
import { type InboxPolicy } from "@pennixrv/trellis-core/
|
|
13
|
+
import { type InboxPolicy } from "@pennixrv/trellis-core/teamwork";
|
|
14
14
|
import type { WorkerAdapter } from "../adapters/index.js";
|
|
15
15
|
import type { TurnTracker } from "./turns.js";
|
|
16
16
|
type Child = ChildProcessByStdio<Writable, Readable, Readable>;
|
|
17
17
|
export interface InboxWatcherArgs {
|
|
18
|
-
|
|
18
|
+
sessionId: string;
|
|
19
19
|
workerName: string;
|
|
20
20
|
adapter: WorkerAdapter;
|
|
21
21
|
ctx: unknown;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inbox.d.ts","sourceRoot":"","sources":["../../../../src/commands/teamwork/supervisor/inbox.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAE9D,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEtD,OAAO,EAGL,KAAK,WAAW,EACjB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAI1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,KAAK,KAAK,GAAG,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAE/D,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,aAAa,CAAC;IACvB,GAAG,EAAE,OAAO,CAAC;IACb,KAAK,EAAE,KAAK,CAAC;IACb,MAAM,EAAE,WAAW,CAAC;IACpB,2EAA2E;IAC3E,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AAED,wBAAsB,eAAe,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAoH3E"}
|
|
@@ -9,17 +9,17 @@
|
|
|
9
9
|
* read/write helpers stay private to this module.
|
|
10
10
|
*/
|
|
11
11
|
import fs from "node:fs";
|
|
12
|
-
import { DEFAULT_INBOX_POLICY, matchesInboxPolicy, } from "@pennixrv/trellis-core/
|
|
12
|
+
import { DEFAULT_INBOX_POLICY, matchesInboxPolicy, } from "@pennixrv/trellis-core/teamwork";
|
|
13
13
|
import { appendEvent } from "../store/events.js";
|
|
14
14
|
import { workerFile } from "../store/paths.js";
|
|
15
15
|
import { watchEvents } from "../store/watch.js";
|
|
16
16
|
export async function runInboxWatcher(args) {
|
|
17
|
-
const {
|
|
17
|
+
const { sessionId, workerName, adapter, ctx, child, signal } = args;
|
|
18
18
|
const inboxPolicy = args.inboxPolicy ?? DEFAULT_INBOX_POLICY;
|
|
19
19
|
// Resume from persisted cursor: first-time spawn → 0 (read full backlog);
|
|
20
20
|
// respawn after kill → last forwarded seq (no replay).
|
|
21
|
-
let cursor = readInboxCursor(
|
|
22
|
-
for await (const ev of watchEvents(
|
|
21
|
+
let cursor = readInboxCursor(sessionId, workerName);
|
|
22
|
+
for await (const ev of watchEvents(sessionId, {
|
|
23
23
|
self: workerName, // ignore our own events
|
|
24
24
|
kind: ["message", "interrupt_requested"],
|
|
25
25
|
},
|
|
@@ -58,7 +58,7 @@ export async function runInboxWatcher(args) {
|
|
|
58
58
|
// never became ready; advance the cursor anyway so we don't
|
|
59
59
|
// re-attempt this exact event on next start.
|
|
60
60
|
cursor = ev.seq;
|
|
61
|
-
writeInboxCursor(
|
|
61
|
+
writeInboxCursor(sessionId, workerName, cursor);
|
|
62
62
|
continue;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
@@ -70,7 +70,7 @@ export async function runInboxWatcher(args) {
|
|
|
70
70
|
if (isInterrupt) {
|
|
71
71
|
const aborted = args.turnTracker?.abortCurrent();
|
|
72
72
|
if (aborted) {
|
|
73
|
-
await appendEvent(
|
|
73
|
+
await appendEvent(sessionId, {
|
|
74
74
|
kind: "turn_finished",
|
|
75
75
|
by: workerName,
|
|
76
76
|
worker: workerName,
|
|
@@ -79,7 +79,7 @@ export async function runInboxWatcher(args) {
|
|
|
79
79
|
outcome: "aborted",
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
|
-
await appendEvent(
|
|
82
|
+
await appendEvent(sessionId, {
|
|
83
83
|
kind: "interrupted",
|
|
84
84
|
by: workerName,
|
|
85
85
|
worker: workerName,
|
|
@@ -92,7 +92,7 @@ export async function runInboxWatcher(args) {
|
|
|
92
92
|
let turn = args.turnTracker?.begin(ev.seq);
|
|
93
93
|
try {
|
|
94
94
|
if (turn) {
|
|
95
|
-
await appendEvent(
|
|
95
|
+
await appendEvent(sessionId, {
|
|
96
96
|
kind: "turn_started",
|
|
97
97
|
by: workerName,
|
|
98
98
|
worker: workerName,
|
|
@@ -104,12 +104,12 @@ export async function runInboxWatcher(args) {
|
|
|
104
104
|
? adapter.encodeInterruptMessage(interruptText, ctx)
|
|
105
105
|
: adapter.encodeUserMessage(text, ctx));
|
|
106
106
|
cursor = ev.seq;
|
|
107
|
-
writeInboxCursor(
|
|
107
|
+
writeInboxCursor(sessionId, workerName, cursor);
|
|
108
108
|
}
|
|
109
109
|
catch {
|
|
110
110
|
if (turn) {
|
|
111
111
|
args.turnTracker?.finish();
|
|
112
|
-
await appendEvent(
|
|
112
|
+
await appendEvent(sessionId, {
|
|
113
113
|
kind: "turn_finished",
|
|
114
114
|
by: workerName,
|
|
115
115
|
worker: workerName,
|
|
@@ -131,9 +131,9 @@ export async function runInboxWatcher(args) {
|
|
|
131
131
|
* process. The cursor is the highest seq we've already turned into a
|
|
132
132
|
* worker stdin write.
|
|
133
133
|
*/
|
|
134
|
-
function readInboxCursor(
|
|
134
|
+
function readInboxCursor(sessionId, workerName) {
|
|
135
135
|
try {
|
|
136
|
-
const raw = fs.readFileSync(workerFile(
|
|
136
|
+
const raw = fs.readFileSync(workerFile(sessionId, workerName, "inbox-cursor"), "utf-8");
|
|
137
137
|
const n = Number(raw.trim());
|
|
138
138
|
return Number.isFinite(n) && n > 0 ? n : 0;
|
|
139
139
|
}
|
|
@@ -141,9 +141,9 @@ function readInboxCursor(channelName, workerName) {
|
|
|
141
141
|
return 0;
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
|
-
function writeInboxCursor(
|
|
144
|
+
function writeInboxCursor(sessionId, workerName, seq) {
|
|
145
145
|
try {
|
|
146
|
-
fs.writeFileSync(workerFile(
|
|
146
|
+
fs.writeFileSync(workerFile(sessionId, workerName, "inbox-cursor"), String(seq), "utf-8");
|
|
147
147
|
}
|
|
148
148
|
catch {
|
|
149
149
|
// ignore — cursor is best-effort; worst case we replay a message
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inbox.js","sourceRoot":"","sources":["../../../../src/commands/teamwork/supervisor/inbox.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,MAAM,SAAS,CAAC;AAGzB,OAAO,EACL,oBAAoB,EACpB,kBAAkB,GAEnB,MAAM,iCAAiC,CAAC;AAGzC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAiBhD,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,IAAsB;IAC1D,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACpE,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,IAAI,oBAAoB,CAAC;IAC7D,0EAA0E;IAC1E,uDAAuD;IACvD,IAAI,MAAM,GAAG,eAAe,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IAEpD,IAAI,KAAK,EAAE,MAAM,EAAE,IAAI,WAAW,CAChC,SAAS,EACT;QACE,IAAI,EAAE,UAAU,EAAE,wBAAwB;QAC1C,IAAI,EAAE,CAAC,SAAS,EAAE,qBAAqB,CAAC;KACzC;IACD,oEAAoE;IACpE,iEAAiE;IACjE,0BAA0B;IAC1B,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,SAA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AAC;QAC7B,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,CAAC,CAAC;IACX,CAAC;AACH,CAAC;AAED,SAAS,gBAAgB,CACvB,SAAiB,EACjB,UAAkB,EAClB,GAAW;IAEX,IAAI,CAAC;QACH,EAAE,CAAC,aAAa,CACd,UAAU,CAAC,SAAS,EAAE,UAAU,EAAE,cAAc,CAAC,EACjD,MAAM,CAAC,GAAG,CAAC,EACX,OAAO,CACR,CAAC;IACJ,CAAC;IAAC,MAAM,CAAC;QACP,iEAAiE;IACnE,CAAC;AACH,CAAC;AAED,SAAS,KAAK,CAAC,EAAU;IACvB,OAAO,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/C,CAAC;AAED,KAAK,UAAU,yBAAyB,CACtC,WAAoC,EACpC,MAAmB;IAEnB,OAAO,WAAW,EAAE,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACjD,MAAM,KAAK,CAAC,EAAE,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
|
|
@@ -22,14 +22,11 @@
|
|
|
22
22
|
import type { ChildProcessByStdio } from "node:child_process";
|
|
23
23
|
import type { Readable, Writable } from "node:stream";
|
|
24
24
|
type Child = ChildProcessByStdio<Writable, Readable, Readable>;
|
|
25
|
-
export type ShutdownReason = "explicit-kill" | "timeout" | "crash" | "idle-timeout"
|
|
26
|
-
type KillReason = Exclude<ShutdownReason, "completed">;
|
|
25
|
+
export type ShutdownReason = "explicit-kill" | "timeout" | "crash" | "idle-timeout";
|
|
27
26
|
export interface ShutdownController {
|
|
28
27
|
/** Idempotent: only the first call wins. Returns the killed-append
|
|
29
28
|
* promise so callers can await ordering if they need to. */
|
|
30
|
-
request(signal: NodeJS.Signals, reason:
|
|
31
|
-
/** End a successfully completed one-shot worker without appending `killed`. */
|
|
32
|
-
complete(): void;
|
|
29
|
+
request(signal: NodeJS.Signals, reason: ShutdownReason): Promise<void>;
|
|
33
30
|
/** Synchronously mark shutdown intent without starting the kill
|
|
34
31
|
* ladder or appending `killed`. Use when other code must see
|
|
35
32
|
* `isShuttingDown=true` BEFORE the caller proceeds to any await
|
|
@@ -52,7 +49,7 @@ export interface ShutdownController {
|
|
|
52
49
|
awaitFinalize(): Promise<void>;
|
|
53
50
|
}
|
|
54
51
|
export interface CreateShutdownArgs {
|
|
55
|
-
|
|
52
|
+
sessionId: string;
|
|
56
53
|
workerName: string;
|
|
57
54
|
log: {
|
|
58
55
|
write: (data: string) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shutdown.d.ts","sourceRoot":"","sources":["../../../../src/commands/teamwork/supervisor/shutdown.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAItD,KAAK,KAAK,GAAG,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAE/D,MAAM,MAAM,cAAc,GACtB,eAAe,GACf,SAAS,GACT,OAAO,GACP,cAAc,CAAC;AAEnB,MAAM,WAAW,kBAAkB;IACjC;iEAC6D;IAC7D,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACvE;;;;;4EAKwE;IACxE,KAAK,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC;IACvC,cAAc,IAAI,OAAO,CAAC;IAC1B,MAAM,IAAI,cAAc,GAAG,IAAI,CAAC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