@blulotus/trellis 0.7.0 → 0.7.2
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 +2 -2
- package/dist/cli/index.js +2 -29
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/init.d.ts +0 -22
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +5 -12
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/mem.d.ts +2 -2
- package/dist/commands/mem.d.ts.map +1 -1
- package/dist/commands/mem.js +7 -40
- package/dist/commands/mem.js.map +1 -1
- package/dist/commands/uninstall.d.ts +1 -1
- package/dist/commands/uninstall.d.ts.map +1 -1
- package/dist/commands/uninstall.js +4 -34
- package/dist/commands/uninstall.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +2 -28
- package/dist/commands/update.js.map +1 -1
- package/dist/configurators/index.d.ts.map +1 -1
- package/dist/configurators/index.js +7 -73
- package/dist/configurators/index.js.map +1 -1
- package/dist/configurators/shared.d.ts +18 -70
- package/dist/configurators/shared.d.ts.map +1 -1
- package/dist/configurators/shared.js +20 -299
- package/dist/configurators/shared.js.map +1 -1
- package/dist/configurators/workflow.d.ts +0 -14
- package/dist/configurators/workflow.d.ts.map +1 -1
- package/dist/configurators/workflow.js +1 -37
- package/dist/configurators/workflow.js.map +1 -1
- package/dist/migrations/manifests/0.1.9.json +0 -12
- package/dist/migrations/manifests/0.2.14.json +0 -84
- package/dist/migrations/manifests/0.3.0-beta.0.json +0 -87
- package/dist/migrations/manifests/0.3.4.json +1 -13
- package/dist/migrations/manifests/0.4.0-beta.1.json +24 -176
- package/dist/migrations/manifests/0.5.0-beta.0.json +67 -1203
- package/dist/migrations/manifests/0.5.0-beta.15.json +0 -96
- package/dist/migrations/manifests/0.5.0-beta.5.json +0 -168
- package/dist/migrations/manifests/0.5.0-beta.9.json +0 -20
- package/dist/migrations/manifests/0.6.0-beta.23.json +0 -66
- package/dist/migrations/manifests/0.6.3.json +1 -16
- package/dist/migrations/manifests/0.6.6.json +1 -9
- package/dist/migrations/manifests/0.7.0.json +9 -0
- package/dist/migrations/manifests/0.7.1.json +9 -0
- package/dist/migrations/manifests/0.7.2.json +9 -0
- package/dist/migrations/manifests/0.8.0.json +9 -0
- package/dist/templates/codex/hooks/session-start.py +37 -13
- package/dist/templates/codex/hooks.json +5 -0
- package/dist/templates/common/bundled-skills/trellis-meta/SKILL.md +5 -5
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-agents.md +0 -10
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-hooks.md +1 -1
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-skills-or-commands.md +1 -13
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/overview.md +2 -2
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/bundled-skills.md +9 -28
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/generated-files.md +5 -5
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/overview.md +1 -1
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/agents.md +1 -17
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/hooks-and-settings.md +4 -12
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/overview.md +6 -6
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.md +5 -75
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/skills-and-commands.md +0 -16
- 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 +2 -3
- package/dist/templates/common/commands/continue.md +24 -4
- package/dist/templates/common/commands/finish-work.md +19 -9
- package/dist/templates/common/commands/start.md +38 -29
- package/dist/templates/extract.d.ts +0 -10
- package/dist/templates/extract.d.ts.map +1 -1
- package/dist/templates/extract.js +0 -24
- package/dist/templates/extract.js.map +1 -1
- package/dist/templates/markdown/spec/guides/code-reuse-thinking-guide.md.txt +7 -9
- package/dist/templates/markdown/spec/guides/cross-layer-thinking-guide.md.txt +4 -8
- package/dist/templates/markdown/spec/guides/cross-platform-thinking-guide.md.txt +5 -5
- package/dist/templates/shared-hooks/index.d.ts +11 -43
- package/dist/templates/shared-hooks/index.d.ts.map +1 -1
- package/dist/templates/shared-hooks/index.js +9 -86
- package/dist/templates/shared-hooks/index.js.map +1 -1
- package/dist/templates/shared-hooks/inject-spec-context.py +1 -1
- package/dist/templates/shared-hooks/inject-subagent-context.py +23 -85
- package/dist/templates/shared-hooks/inject-workflow-state.py +56 -86
- package/dist/templates/shared-hooks/session-start.py +76 -98
- package/dist/templates/trellis/config.yaml +8 -8
- package/dist/templates/trellis/index.d.ts +1 -4
- package/dist/templates/trellis/index.d.ts.map +1 -1
- package/dist/templates/trellis/index.js +1 -5
- package/dist/templates/trellis/index.js.map +1 -1
- package/dist/templates/trellis/scripts/add_session.py +12 -11
- package/dist/templates/trellis/scripts/common/__init__.py +2 -0
- package/dist/templates/trellis/scripts/common/active_task.py +80 -152
- package/dist/templates/trellis/scripts/common/config.py +7 -7
- package/dist/templates/trellis/scripts/common/git_context.py +1 -1
- package/dist/templates/trellis/scripts/common/session_context.py +2 -2
- package/dist/templates/trellis/scripts/common/spec_inject.py +2 -2
- package/dist/templates/trellis/scripts/common/task_store.py +8 -28
- package/dist/templates/trellis/scripts/common/workflow_phase.py +4 -8
- package/dist/templates/trellis/scripts/get_context.py +2 -2
- package/dist/templates/trellis/scripts/init_developer.py +1 -1
- package/dist/templates/trellis/scripts/task.py +90 -57
- package/dist/templates/trellis/workflow.md +44 -66
- package/dist/types/ai-tools.d.ts +10 -10
- package/dist/types/ai-tools.d.ts.map +1 -1
- package/dist/types/ai-tools.js +3 -434
- package/dist/types/ai-tools.js.map +1 -1
- package/dist/utils/uninstall-scrubbers.d.ts +3 -18
- package/dist/utils/uninstall-scrubbers.d.ts.map +1 -1
- package/dist/utils/uninstall-scrubbers.js +24 -154
- package/dist/utils/uninstall-scrubbers.js.map +1 -1
- package/package.json +2 -2
- package/dist/configurators/antigravity.d.ts +0 -7
- package/dist/configurators/antigravity.d.ts.map +0 -1
- package/dist/configurators/antigravity.js +0 -11
- package/dist/configurators/antigravity.js.map +0 -1
- package/dist/configurators/codebuddy.d.ts +0 -10
- package/dist/configurators/codebuddy.d.ts.map +0 -1
- package/dist/configurators/codebuddy.js +0 -24
- package/dist/configurators/codebuddy.js.map +0 -1
- package/dist/configurators/copilot.d.ts +0 -14
- package/dist/configurators/copilot.d.ts.map +0 -1
- package/dist/configurators/copilot.js +0 -46
- package/dist/configurators/copilot.js.map +0 -1
- package/dist/configurators/cursor.d.ts +0 -10
- package/dist/configurators/cursor.d.ts.map +0 -1
- package/dist/configurators/cursor.js +0 -23
- package/dist/configurators/cursor.js.map +0 -1
- package/dist/configurators/devin.d.ts +0 -8
- package/dist/configurators/devin.d.ts.map +0 -1
- package/dist/configurators/devin.js +0 -12
- package/dist/configurators/devin.js.map +0 -1
- package/dist/configurators/droid.d.ts +0 -10
- package/dist/configurators/droid.d.ts.map +0 -1
- package/dist/configurators/droid.js +0 -24
- package/dist/configurators/droid.js.map +0 -1
- package/dist/configurators/dsh.d.ts +0 -26
- package/dist/configurators/dsh.d.ts.map +0 -1
- package/dist/configurators/dsh.js +0 -76
- package/dist/configurators/dsh.js.map +0 -1
- package/dist/configurators/gemini.d.ts +0 -18
- package/dist/configurators/gemini.d.ts.map +0 -1
- package/dist/configurators/gemini.js +0 -39
- package/dist/configurators/gemini.js.map +0 -1
- package/dist/configurators/grok.d.ts +0 -17
- package/dist/configurators/grok.d.ts.map +0 -1
- package/dist/configurators/grok.js +0 -38
- package/dist/configurators/grok.js.map +0 -1
- package/dist/configurators/kilo.d.ts +0 -7
- package/dist/configurators/kilo.d.ts.map +0 -1
- package/dist/configurators/kilo.js +0 -11
- package/dist/configurators/kilo.js.map +0 -1
- package/dist/configurators/kimi.d.ts +0 -26
- package/dist/configurators/kimi.d.ts.map +0 -1
- package/dist/configurators/kimi.js +0 -74
- package/dist/configurators/kimi.js.map +0 -1
- package/dist/configurators/kiro.d.ts +0 -11
- package/dist/configurators/kiro.d.ts.map +0 -1
- package/dist/configurators/kiro.js +0 -30
- package/dist/configurators/kiro.js.map +0 -1
- package/dist/configurators/omp.d.ts +0 -6
- package/dist/configurators/omp.d.ts.map +0 -1
- package/dist/configurators/omp.js +0 -28
- package/dist/configurators/omp.js.map +0 -1
- package/dist/configurators/opencode.d.ts +0 -5
- package/dist/configurators/opencode.d.ts.map +0 -1
- package/dist/configurators/opencode.js +0 -84
- package/dist/configurators/opencode.js.map +0 -1
- package/dist/configurators/pi.d.ts +0 -5
- package/dist/configurators/pi.d.ts.map +0 -1
- package/dist/configurators/pi.js +0 -39
- package/dist/configurators/pi.js.map +0 -1
- package/dist/configurators/qoder.d.ts +0 -12
- package/dist/configurators/qoder.d.ts.map +0 -1
- package/dist/configurators/qoder.js +0 -30
- package/dist/configurators/qoder.js.map +0 -1
- package/dist/configurators/reasonix.d.ts +0 -17
- package/dist/configurators/reasonix.d.ts.map +0 -1
- package/dist/configurators/reasonix.js +0 -37
- package/dist/configurators/reasonix.js.map +0 -1
- package/dist/configurators/snow.d.ts +0 -25
- package/dist/configurators/snow.d.ts.map +0 -1
- package/dist/configurators/snow.js +0 -69
- package/dist/configurators/snow.js.map +0 -1
- package/dist/configurators/trae.d.ts +0 -16
- package/dist/configurators/trae.d.ts.map +0 -1
- package/dist/configurators/trae.js +0 -34
- package/dist/configurators/trae.js.map +0 -1
- package/dist/configurators/zcode.d.ts +0 -23
- package/dist/configurators/zcode.d.ts.map +0 -1
- package/dist/configurators/zcode.js +0 -63
- package/dist/configurators/zcode.js.map +0 -1
- package/dist/templates/codebuddy/agents/trellis-check.md +0 -115
- package/dist/templates/codebuddy/agents/trellis-implement.md +0 -115
- package/dist/templates/codebuddy/agents/trellis-research.md +0 -137
- package/dist/templates/codebuddy/index.d.ts +0 -15
- package/dist/templates/codebuddy/index.d.ts.map +0 -1
- package/dist/templates/codebuddy/index.js +0 -15
- package/dist/templates/codebuddy/index.js.map +0 -1
- package/dist/templates/codebuddy/settings.json +0 -69
- package/dist/templates/copilot/copilot-instructions.md +0 -11
- package/dist/templates/copilot/hooks/session-start.py +0 -564
- package/dist/templates/copilot/hooks.json +0 -19
- package/dist/templates/copilot/index.d.ts +0 -28
- package/dist/templates/copilot/index.d.ts.map +0 -1
- package/dist/templates/copilot/index.js +0 -61
- package/dist/templates/copilot/index.js.map +0 -1
- package/dist/templates/copilot/prompts/before-dev.prompt.md +0 -39
- package/dist/templates/copilot/prompts/brainstorm.prompt.md +0 -173
- package/dist/templates/copilot/prompts/break-loop.prompt.md +0 -129
- package/dist/templates/copilot/prompts/check-cross-layer.prompt.md +0 -170
- package/dist/templates/copilot/prompts/check.prompt.md +0 -110
- package/dist/templates/copilot/prompts/create-command.prompt.md +0 -116
- package/dist/templates/copilot/prompts/finish-work.prompt.md +0 -99
- package/dist/templates/copilot/prompts/integrate-skill.prompt.md +0 -223
- package/dist/templates/copilot/prompts/onboard.prompt.md +0 -362
- package/dist/templates/copilot/prompts/parallel.prompt.md +0 -204
- package/dist/templates/copilot/prompts/record-session.prompt.md +0 -66
- package/dist/templates/copilot/prompts/start.prompt.md +0 -63
- package/dist/templates/copilot/prompts/update-spec.prompt.md +0 -358
- package/dist/templates/cursor/agents/trellis-check.md +0 -114
- package/dist/templates/cursor/agents/trellis-implement.md +0 -114
- package/dist/templates/cursor/agents/trellis-research.md +0 -136
- package/dist/templates/cursor/hooks.json +0 -24
- package/dist/templates/cursor/index.d.ts +0 -13
- package/dist/templates/cursor/index.d.ts.map +0 -1
- package/dist/templates/cursor/index.js +0 -13
- package/dist/templates/cursor/index.js.map +0 -1
- package/dist/templates/droid/droids/trellis-check.md +0 -107
- package/dist/templates/droid/droids/trellis-implement.md +0 -107
- package/dist/templates/droid/droids/trellis-research.md +0 -137
- package/dist/templates/droid/index.d.ts +0 -15
- package/dist/templates/droid/index.d.ts.map +0 -1
- package/dist/templates/droid/index.js +0 -15
- package/dist/templates/droid/index.js.map +0 -1
- package/dist/templates/droid/settings.json +0 -69
- package/dist/templates/dsh/DSH.md +0 -80
- package/dist/templates/dsh/agents/trellis-check.md +0 -99
- package/dist/templates/dsh/agents/trellis-implement.md +0 -106
- package/dist/templates/dsh/agents/trellis-research.md +0 -134
- package/dist/templates/dsh/index.d.ts +0 -22
- package/dist/templates/dsh/index.d.ts.map +0 -1
- package/dist/templates/dsh/index.js +0 -27
- package/dist/templates/dsh/index.js.map +0 -1
- package/dist/templates/gemini/agents/trellis-check.md +0 -107
- package/dist/templates/gemini/agents/trellis-implement.md +0 -107
- package/dist/templates/gemini/agents/trellis-research.md +0 -136
- package/dist/templates/gemini/index.d.ts +0 -13
- package/dist/templates/gemini/index.d.ts.map +0 -1
- package/dist/templates/gemini/index.js +0 -13
- package/dist/templates/gemini/index.js.map +0 -1
- package/dist/templates/gemini/settings.json +0 -40
- package/dist/templates/grok/agents/trellis-check.md +0 -106
- package/dist/templates/grok/agents/trellis-implement.md +0 -121
- package/dist/templates/grok/agents/trellis-research.md +0 -146
- package/dist/templates/grok/index.d.ts +0 -16
- package/dist/templates/grok/index.d.ts.map +0 -1
- package/dist/templates/grok/index.js +0 -19
- package/dist/templates/grok/index.js.map +0 -1
- package/dist/templates/kimi/agents/trellis-check.md +0 -104
- package/dist/templates/kimi/agents/trellis-implement.md +0 -120
- package/dist/templates/kimi/agents/trellis-research.md +0 -144
- package/dist/templates/kimi/index.d.ts +0 -20
- package/dist/templates/kimi/index.d.ts.map +0 -1
- package/dist/templates/kimi/index.js +0 -23
- package/dist/templates/kimi/index.js.map +0 -1
- package/dist/templates/kiro/agents/trellis-check.json +0 -26
- package/dist/templates/kiro/agents/trellis-implement.json +0 -26
- package/dist/templates/kiro/agents/trellis-research.json +0 -30
- package/dist/templates/kiro/agents/trellis.json +0 -34
- package/dist/templates/kiro/hooks/trellis-workflow-state.kiro.hook +0 -14
- package/dist/templates/kiro/index.d.ts +0 -32
- package/dist/templates/kiro/index.d.ts.map +0 -1
- package/dist/templates/kiro/index.js +0 -28
- package/dist/templates/kiro/index.js.map +0 -1
- package/dist/templates/omp/agents/trellis-check.md +0 -41
- package/dist/templates/omp/agents/trellis-implement.md +0 -55
- package/dist/templates/omp/agents/trellis-research.md +0 -30
- package/dist/templates/omp/extensions/trellis/index.ts.txt +0 -592
- package/dist/templates/omp/index.d.ts +0 -4
- package/dist/templates/omp/index.d.ts.map +0 -1
- package/dist/templates/omp/index.js +0 -9
- package/dist/templates/omp/index.js.map +0 -1
- package/dist/templates/opencode/agents/trellis-check.md +0 -122
- package/dist/templates/opencode/agents/trellis-implement.md +0 -123
- package/dist/templates/opencode/agents/trellis-research.md +0 -145
- package/dist/templates/opencode/lib/context-visibility.js +0 -86
- package/dist/templates/opencode/lib/session-utils.js +0 -526
- package/dist/templates/opencode/lib/trellis-context.js +0 -627
- package/dist/templates/opencode/package.json +0 -5
- package/dist/templates/opencode/plugins/inject-spec-context.js +0 -121
- package/dist/templates/opencode/plugins/inject-subagent-context.js +0 -569
- package/dist/templates/opencode/plugins/inject-workflow-state.js +0 -340
- package/dist/templates/opencode/plugins/session-start.js +0 -74
- package/dist/templates/pi/agents/trellis-check.md +0 -37
- package/dist/templates/pi/agents/trellis-implement.md +0 -52
- package/dist/templates/pi/agents/trellis-research.md +0 -25
- package/dist/templates/pi/extensions/trellis/index.ts.txt +0 -2033
- package/dist/templates/pi/index.d.ts +0 -5
- package/dist/templates/pi/index.d.ts.map +0 -1
- package/dist/templates/pi/index.js +0 -12
- package/dist/templates/pi/index.js.map +0 -1
- package/dist/templates/pi/settings.json +0 -9
- package/dist/templates/qoder/agents/trellis-check.md +0 -108
- package/dist/templates/qoder/agents/trellis-implement.md +0 -108
- package/dist/templates/qoder/agents/trellis-research.md +0 -137
- package/dist/templates/qoder/index.d.ts +0 -15
- package/dist/templates/qoder/index.d.ts.map +0 -1
- package/dist/templates/qoder/index.js +0 -15
- package/dist/templates/qoder/index.js.map +0 -1
- package/dist/templates/qoder/settings.json +0 -59
- package/dist/templates/reasonix/agents/trellis-check.md +0 -36
- package/dist/templates/reasonix/agents/trellis-implement.md +0 -51
- package/dist/templates/reasonix/index.d.ts +0 -13
- package/dist/templates/reasonix/index.d.ts.map +0 -1
- package/dist/templates/reasonix/index.js +0 -16
- package/dist/templates/reasonix/index.js.map +0 -1
- package/dist/templates/shared-hooks/inject-shell-session-context.py +0 -292
- package/dist/templates/snow/SNOW.md +0 -86
- package/dist/templates/snow/agents/trellis-check.md +0 -136
- package/dist/templates/snow/agents/trellis-implement.md +0 -158
- package/dist/templates/snow/agents/trellis-research.md +0 -114
- package/dist/templates/snow/hooks/beforeSubAgentStart.json +0 -15
- package/dist/templates/snow/hooks/onSessionStart.json +0 -15
- package/dist/templates/snow/hooks/onUserMessage.json +0 -15
- package/dist/templates/snow/hooks/write-trellis-context.py +0 -644
- package/dist/templates/snow/index.d.ts +0 -26
- package/dist/templates/snow/index.d.ts.map +0 -1
- package/dist/templates/snow/index.js +0 -36
- package/dist/templates/snow/index.js.map +0 -1
- package/dist/templates/trae/agents/trellis-check.md +0 -108
- package/dist/templates/trae/agents/trellis-implement.md +0 -108
- package/dist/templates/trae/agents/trellis-research.md +0 -137
- package/dist/templates/trae/hooks.json +0 -39
- package/dist/templates/trae/index.d.ts +0 -15
- package/dist/templates/trae/index.d.ts.map +0 -1
- package/dist/templates/trae/index.js +0 -15
- package/dist/templates/trae/index.js.map +0 -1
- package/dist/templates/trellis/gitattributes.txt +0 -9
- package/dist/templates/trellis/scripts/common/cli_adapter.py +0 -982
- package/dist/templates/zcode/agents/trellis-check.md +0 -110
- package/dist/templates/zcode/agents/trellis-implement.md +0 -116
- package/dist/templates/zcode/agents/trellis-research.md +0 -133
- package/dist/templates/zcode/config.json +0 -52
- package/dist/templates/zcode/index.d.ts +0 -25
- package/dist/templates/zcode/index.d.ts.map +0 -1
- package/dist/templates/zcode/index.js +0 -29
- package/dist/templates/zcode/index.js.map +0 -1
|
@@ -19,18 +19,18 @@ max_journal_lines: 2000
|
|
|
19
19
|
#-------------------------------------------------------------------------------
|
|
20
20
|
|
|
21
21
|
# Auto-commit behavior for session journal + task archive operations.
|
|
22
|
-
# -
|
|
23
|
-
#
|
|
24
|
-
# -
|
|
25
|
-
#
|
|
22
|
+
# - false (default): scripts do not touch git. Files (journal-*.md, task archive
|
|
23
|
+
# moves) are still written to disk; you decide whether to git add / commit.
|
|
24
|
+
# - true: scripts auto-stage and auto-commit journal / task changes after
|
|
25
|
+
# add_session.py / task.py archive runs.
|
|
26
26
|
#
|
|
27
|
-
# Use `
|
|
28
|
-
#
|
|
29
|
-
#
|
|
27
|
+
# Use `true` if you want session records to land in git without extra steps.
|
|
28
|
+
# With `true` and parallel worktrees/branches, journal-*.md and index.md merges
|
|
29
|
+
# can conflict; resolve by keeping both sides' session blocks.
|
|
30
30
|
#
|
|
31
31
|
# Accepts: true / false / yes / no / 1 / 0 / on / off (case-insensitive).
|
|
32
32
|
#
|
|
33
|
-
|
|
33
|
+
session_auto_commit: false
|
|
34
34
|
|
|
35
35
|
#-------------------------------------------------------------------------------
|
|
36
36
|
# Task Lifecycle Hooks
|
|
@@ -15,8 +15,7 @@
|
|
|
15
15
|
* ├── scripts-shell-archive/ # Archived shell scripts (for reference)
|
|
16
16
|
* ├── workflow.md # Workflow guide
|
|
17
17
|
* ├── config.yaml # Trellis configuration
|
|
18
|
-
*
|
|
19
|
-
* └── gitattributes.txt # project-root .gitattributes content
|
|
18
|
+
* └── gitignore.txt # .gitignore content
|
|
20
19
|
*/
|
|
21
20
|
export declare const scriptsInit: string;
|
|
22
21
|
export declare const commonInit: string;
|
|
@@ -26,7 +25,6 @@ export declare const commonGitContext: string;
|
|
|
26
25
|
export declare const commonTaskQueue: string;
|
|
27
26
|
export declare const commonTaskUtils: string;
|
|
28
27
|
export declare const commonActiveTask: string;
|
|
29
|
-
export declare const commonCliAdapter: string;
|
|
30
28
|
export declare const commonConfig: string;
|
|
31
29
|
export declare const commonIo: string;
|
|
32
30
|
export declare const commonLog: string;
|
|
@@ -51,7 +49,6 @@ export declare const addSessionScript: string;
|
|
|
51
49
|
export declare const workflowMdTemplate: string;
|
|
52
50
|
export declare const configYamlTemplate: string;
|
|
53
51
|
export declare const gitignoreTemplate: string;
|
|
54
|
-
export declare const gitattributesTemplate: string;
|
|
55
52
|
export declare const implementAgentTemplate: string;
|
|
56
53
|
export declare const checkAgentTemplate: string;
|
|
57
54
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/trellis/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/trellis/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAcH,eAAO,MAAM,WAAW,QAAsC,CAAC;AAG/D,eAAO,MAAM,UAAU,QAA6C,CAAC;AACrE,eAAO,MAAM,WAAW,QAA0C,CAAC;AACnE,eAAO,MAAM,eAAe,QAA8C,CAAC;AAC3E,eAAO,MAAM,gBAAgB,QAAgD,CAAC;AAC9E,eAAO,MAAM,eAAe,QAA+C,CAAC;AAC5E,eAAO,MAAM,eAAe,QAA+C,CAAC;AAC5E,eAAO,MAAM,gBAAgB,QAAgD,CAAC;AAC9E,eAAO,MAAM,YAAY,QAA2C,CAAC;AACrE,eAAO,MAAM,QAAQ,QAAuC,CAAC;AAC7D,eAAO,MAAM,SAAS,QAAwC,CAAC;AAC/D,eAAO,MAAM,SAAS,QAAwC,CAAC;AAC/D,eAAO,MAAM,WAAW,QAA0C,CAAC;AACnE,eAAO,MAAM,WAAW,QAA0C,CAAC;AACnE,eAAO,MAAM,iBAAiB,QAAiD,CAAC;AAChF,eAAO,MAAM,eAAe,QAA+C,CAAC;AAC5E,eAAO,MAAM,oBAAoB,QAEhC,CAAC;AACF,eAAO,MAAM,qBAAqB,QAEjC,CAAC;AACF,eAAO,MAAM,mBAAmB,QAE/B,CAAC;AACF,eAAO,MAAM,uBAAuB,QAEnC,CAAC;AACF,eAAO,MAAM,mBAAmB,QAE/B,CAAC;AACF,eAAO,MAAM,eAAe,QAA+C,CAAC;AAC5E,eAAO,MAAM,gBAAgB,QAAgD,CAAC;AAC9E,eAAO,MAAM,gBAAgB,QAAgD,CAAC;AAG9E,eAAO,MAAM,kBAAkB,QAA2C,CAAC;AAC3E,eAAO,MAAM,mBAAmB,QAA4C,CAAC;AAC7E,eAAO,MAAM,UAAU,QAAkC,CAAC;AAC1D,eAAO,MAAM,gBAAgB,QAAyC,CAAC;AACvE,eAAO,MAAM,gBAAgB,QAAyC,CAAC;AAGvE,eAAO,MAAM,kBAAkB,QAA8B,CAAC;AAC9D,eAAO,MAAM,kBAAkB,QAA8B,CAAC;AAC9D,eAAO,MAAM,iBAAiB,QAAgC,CAAC;AAM/D,eAAO,MAAM,sBAAsB,QAAsC,CAAC;AAC1E,eAAO,MAAM,kBAAkB,QAAkC,CAAC;AAElE;;GAEG;AACH,wBAAgB,aAAa,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAuCnD;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAKlD"}
|
|
@@ -15,8 +15,7 @@
|
|
|
15
15
|
* ├── scripts-shell-archive/ # Archived shell scripts (for reference)
|
|
16
16
|
* ├── workflow.md # Workflow guide
|
|
17
17
|
* ├── config.yaml # Trellis configuration
|
|
18
|
-
*
|
|
19
|
-
* └── gitattributes.txt # project-root .gitattributes content
|
|
18
|
+
* └── gitignore.txt # .gitignore content
|
|
20
19
|
*/
|
|
21
20
|
import { readFileSync } from "node:fs";
|
|
22
21
|
import { dirname, join } from "node:path";
|
|
@@ -36,7 +35,6 @@ export const commonGitContext = readTemplate("scripts/common/git_context.py");
|
|
|
36
35
|
export const commonTaskQueue = readTemplate("scripts/common/task_queue.py");
|
|
37
36
|
export const commonTaskUtils = readTemplate("scripts/common/task_utils.py");
|
|
38
37
|
export const commonActiveTask = readTemplate("scripts/common/active_task.py");
|
|
39
|
-
export const commonCliAdapter = readTemplate("scripts/common/cli_adapter.py");
|
|
40
38
|
export const commonConfig = readTemplate("scripts/common/config.py");
|
|
41
39
|
export const commonIo = readTemplate("scripts/common/io.py");
|
|
42
40
|
export const commonLog = readTemplate("scripts/common/log.py");
|
|
@@ -63,7 +61,6 @@ export const addSessionScript = readTemplate("scripts/add_session.py");
|
|
|
63
61
|
export const workflowMdTemplate = readTemplate("workflow.md");
|
|
64
62
|
export const configYamlTemplate = readTemplate("config.yaml");
|
|
65
63
|
export const gitignoreTemplate = readTemplate("gitignore.txt");
|
|
66
|
-
export const gitattributesTemplate = readTemplate("gitattributes.txt");
|
|
67
64
|
// Channel runtime agent definitions (loaded by
|
|
68
65
|
// `packages/cli/src/commands/channel/agent-loader.ts` from `.trellis/agents/`).
|
|
69
66
|
// These are platform-agnostic Trellis runtime files dispatched at `trellis init`
|
|
@@ -85,7 +82,6 @@ export function getAllScripts() {
|
|
|
85
82
|
scripts.set("common/task_queue.py", commonTaskQueue);
|
|
86
83
|
scripts.set("common/task_utils.py", commonTaskUtils);
|
|
87
84
|
scripts.set("common/active_task.py", commonActiveTask);
|
|
88
|
-
scripts.set("common/cli_adapter.py", commonCliAdapter);
|
|
89
85
|
scripts.set("common/config.py", commonConfig);
|
|
90
86
|
scripts.set("common/io.py", commonIo);
|
|
91
87
|
scripts.set("common/log.py", commonLog);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/trellis/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/trellis/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC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AAY;IAC1B,MAAM,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAC;IACzC,MAAM,CAAC,GAAG,CAAC,cAAc,EAAE,sBAAsB,CAAC,CAAC;IACnD,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE,kBAAkB,CAAC,CAAC;IAC3C,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -4,16 +4,16 @@
|
|
|
4
4
|
Add a new session to journal file and update index.md.
|
|
5
5
|
|
|
6
6
|
Usage:
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
python add_session.py --title "Title" --commit "hash" --summary "Summary" [--package cli]
|
|
8
|
+
python add_session.py --title "Title" --branch "feat/my-branch"
|
|
9
9
|
|
|
10
10
|
# Pipe detailed content via stdin (use --stdin to opt in):
|
|
11
|
-
cat << 'EOF' |
|
|
11
|
+
cat << 'EOF' | python add_session.py --stdin --title "Title" --summary "Summary"
|
|
12
12
|
<session content here>
|
|
13
13
|
EOF
|
|
14
14
|
|
|
15
15
|
# Structured content (repeatable; a section with no bullets is omitted):
|
|
16
|
-
|
|
16
|
+
python add_session.py --title "Title" --change "Did X" --test "Ran Y" --next-step "Do Z"
|
|
17
17
|
|
|
18
18
|
Branch resolution order:
|
|
19
19
|
1. --branch CLI arg (explicit)
|
|
@@ -202,9 +202,9 @@ def is_git_worktree(repo_root: Path) -> bool:
|
|
|
202
202
|
|
|
203
203
|
|
|
204
204
|
def warn_if_parallel_worktree(repo_root: Path) -> None:
|
|
205
|
-
"""Non-blocking note:
|
|
206
|
-
are expected and safe. Only fires when running in a
|
|
207
|
-
(not the main tree) with `session_auto_commit` enabled
|
|
205
|
+
"""Non-blocking note: workspace merge conflicts across parallel
|
|
206
|
+
worktrees/branches are expected and safe. Only fires when running in a
|
|
207
|
+
linked git worktree (not the main tree) with `session_auto_commit` enabled.
|
|
208
208
|
"""
|
|
209
209
|
if not get_session_auto_commit(repo_root):
|
|
210
210
|
return
|
|
@@ -213,10 +213,11 @@ def warn_if_parallel_worktree(repo_root: Path) -> None:
|
|
|
213
213
|
print(
|
|
214
214
|
colored(
|
|
215
215
|
"[NOTE] Running in a git worktree with session_auto_commit enabled: "
|
|
216
|
-
"journal-*.md
|
|
217
|
-
"
|
|
218
|
-
"
|
|
219
|
-
"
|
|
216
|
+
"journal-*.md and index.md conflicts across parallel "
|
|
217
|
+
"worktrees/branches are expected and safe to resolve by keeping "
|
|
218
|
+
"both sides' session blocks (task state lives in task.json, not in "
|
|
219
|
+
"the workspace files). See "
|
|
220
|
+
".trellis/spec/cli/backend/directory-structure.md "
|
|
220
221
|
'("Workspace Journal Merge Behavior").',
|
|
221
222
|
Colors.YELLOW,
|
|
222
223
|
),
|
|
@@ -24,15 +24,16 @@ DIR_TASKS = "tasks"
|
|
|
24
24
|
DIR_RUNTIME = ".runtime"
|
|
25
25
|
DIR_SESSIONS = "sessions"
|
|
26
26
|
DIR_SHELL_TICKETS = "shell-tickets"
|
|
27
|
-
#
|
|
28
|
-
#
|
|
29
|
-
#
|
|
30
|
-
#
|
|
31
|
-
#
|
|
32
|
-
#
|
|
33
|
-
|
|
27
|
+
# Session engagement lives in its own runtime directory, NOT as a field on the
|
|
28
|
+
# session file. `clear_task_from_sessions` (archive) and `clear_active_task`
|
|
29
|
+
# (`task.py finish`) both *delete* the session file, which would silently
|
|
30
|
+
# un-engage a session that is mid-Phase-3 — dropping the per-turn breadcrumb
|
|
31
|
+
# that enforces 3.4 commit. Keeping the flag on a separate path also leaves the
|
|
32
|
+
# `sessions/` file count that `_resolve_single_session_fallback` depends on
|
|
33
|
+
# exactly as it was.
|
|
34
|
+
DIR_ENGAGED = "engaged"
|
|
34
35
|
SHELL_TICKET_TTL_SECONDS = 30
|
|
35
|
-
TASK_SESSION_COMMANDS = {"start", "current", "finish"}
|
|
36
|
+
TASK_SESSION_COMMANDS = {"start", "current", "finish", "engage"}
|
|
36
37
|
|
|
37
38
|
_SESSION_KEYS = ("session_id", "sessionId", "sessionID")
|
|
38
39
|
_CONVERSATION_KEYS = ("conversation_id", "conversationId", "conversationID")
|
|
@@ -41,39 +42,15 @@ _NESTED_KEYS = ("input", "properties", "event", "hook_input", "hookInput")
|
|
|
41
42
|
_KNOWN_PLATFORMS = {
|
|
42
43
|
"claude",
|
|
43
44
|
"codex",
|
|
44
|
-
"cursor",
|
|
45
|
-
"opencode",
|
|
46
|
-
"gemini",
|
|
47
|
-
"droid",
|
|
48
|
-
"qoder",
|
|
49
|
-
"codebuddy",
|
|
50
|
-
"kiro",
|
|
51
|
-
"copilot",
|
|
52
|
-
"pi",
|
|
53
|
-
"trae",
|
|
54
|
-
"grok",
|
|
55
|
-
"kimi",
|
|
56
|
-
"zcode",
|
|
57
|
-
"snow",
|
|
58
|
-
"dsh",
|
|
59
45
|
}
|
|
60
46
|
|
|
61
47
|
# Every name below records how it was checked. Do NOT add a name by analogy
|
|
62
|
-
# with a neighbour: a 2026-08-05 audit
|
|
63
|
-
#
|
|
64
|
-
#
|
|
65
|
-
#
|
|
66
|
-
#
|
|
48
|
+
# with a neighbour: a 2026-08-05 audit found several declared names had never
|
|
49
|
+
# existed anywhere — they were pattern-guessed from `<PLATFORM>_SESSION_ID`
|
|
50
|
+
# shape no vendor agreed to, and the uniformity was the only "evidence" behind
|
|
51
|
+
# them. A platform with no verified name belongs in no table; it resolves
|
|
52
|
+
# through TRELLIS_CONTEXT_ID or its hook bridge.
|
|
67
53
|
_ENV_SESSION_KEYS: tuple[tuple[str, tuple[str, ...]], ...] = (
|
|
68
|
-
# REAL (reported 2026-08-13 against DSH 0.1.0-rc.6 by @SajoLuo, from a live
|
|
69
|
-
# run: DSH exports DSH_SESSION_ID plus DSH_SHELL=1 into its managed shell).
|
|
70
|
-
# MUST STAY FIRST. A DSH session can inherit an outer host's identity — a
|
|
71
|
-
# DSH launched from Codex still carries CODEX_THREAD_ID — and the untargeted
|
|
72
|
-
# lookup below walks this table in order, so any earlier entry would claim
|
|
73
|
-
# the session and write a foreign `codex_<thread>` pointer for DSH work.
|
|
74
|
-
# DSH_SESSION_ID is the only name here no other vendor sets, so first place
|
|
75
|
-
# is safe: it cannot mis-claim a non-DSH session.
|
|
76
|
-
("dsh", ("DSH_SESSION_ID",)),
|
|
77
54
|
# REAL, undocumented (verified 2026-08-05 in a live Claude Code 2.1.221 bash
|
|
78
55
|
# child; absent from code.claude.com/docs/en/env-vars). CLAUDE_SESSION_ID
|
|
79
56
|
# was removed here — verified absent from that same live environment.
|
|
@@ -82,80 +59,9 @@ _ENV_SESSION_KEYS: tuple[tuple[str, tuple[str, ...]], ...] = (
|
|
|
82
59
|
# into shell children, absent from the parent env; openai/codex#19937).
|
|
83
60
|
# CODEX_SESSION_ID was removed — absent from a live `codex exec` env.
|
|
84
61
|
("codex", ("CODEX_THREAD_ID",)),
|
|
85
|
-
# REAL but HOOK-SCOPE ONLY (verified 2026-08-05): set by Gemini's
|
|
86
|
-
# hookRunner.ts. Its shell tool builds the child env in
|
|
87
|
-
# shellExecutionService.ts and adds only GEMINI_CLI/TERM/PAGER/GIT_PAGER, so
|
|
88
|
-
# this never reaches a bash child — it resolves only inside a hook process.
|
|
89
|
-
("gemini", ("GEMINI_SESSION_ID",)),
|
|
90
|
-
# REAL but HOOK-SCOPE ONLY (verified 2026-08-05): docs.qoder.com/zh/
|
|
91
|
-
# extensions/hooks documents it as injected during hook execution by the
|
|
92
|
-
# Qoder *IDE plugin*. Absent from the Qoder CLI hook docs and from Lingma.
|
|
93
|
-
("qoder", ("QODER_SESSION_ID",)),
|
|
94
|
-
# UNVERIFIED (2026-08-05): absent from kiro.dev/docs/hooks/, but Dynatrace
|
|
95
|
-
# dtctl, oh-my-agent and gastown all key agent detection on it and one notes
|
|
96
|
-
# it is "set in both interactive and --no-interactive". Kept because that is
|
|
97
|
-
# absence of evidence, not evidence of absence. To settle: run
|
|
98
|
-
# `env | grep KIRO` from a Kiro shell-tool call on a machine with Kiro.
|
|
99
|
-
("kiro", ("KIRO_SESSION_ID",)),
|
|
100
|
-
# UNVERIFIED (2026-08-05): absent from docs.github.com/en/copilot/reference/
|
|
101
|
-
# hooks-reference and from the CLI programmatic reference. To settle: run
|
|
102
|
-
# `copilot help environment` (the authoritative list per those docs) — not
|
|
103
|
-
# runnable here, the CLI is not installed and copilot-cli ships no source.
|
|
104
|
-
("copilot", ("COPILOT_SESSION_ID", "COPILOT_SESSIONID")),
|
|
105
|
-
# REASONED, UNVERIFIED (2026-08-05): ZCode is closed-source and not
|
|
106
|
-
# installable here. It mirrors Claude's naming elsewhere (CLAUDE_PLUGIN_ROOT
|
|
107
|
-
# / CLAUDE_PLUGIN_DATA compat aliases are in its docs), and the previously
|
|
108
|
-
# declared CLAUDE_SESSION_ID does not exist on Claude Code either — so the
|
|
109
|
-
# name ZCode would actually reuse is CLAUDE_CODE_SESSION_ID. Try that first,
|
|
110
|
-
# keep the historical name as a fallback: if neither exists nothing changes.
|
|
111
|
-
# Platform-scoped lookup (_iter_env_keys filters by platform name), so the
|
|
112
|
-
# entry only fires once the resolver detected "zcode" — no collision with
|
|
113
|
-
# the claude entry above.
|
|
114
|
-
("zcode", ("CLAUDE_CODE_SESSION_ID", "CLAUDE_SESSION_ID")),
|
|
115
|
-
# REAL by vendor design (verified 2026-08-05): Snow's sessionIdentityEnv.ts
|
|
116
|
-
# exports SNOW_SESSION_ID into hook/terminal/sub-agent children and names
|
|
117
|
-
# Trellis in its source header. TRELLIS_CONTEXT_ID stays the preferred
|
|
118
|
-
# override — Snow sets that too.
|
|
119
|
-
("snow", ("SNOW_SESSION_ID",)),
|
|
120
|
-
)
|
|
121
|
-
_ENV_CONVERSATION_KEYS: tuple[tuple[str, tuple[str, ...]], ...] = (
|
|
122
|
-
# REAL in cursor-agent (CLI), undocumented (verified 2026-08-05: the value
|
|
123
|
-
# matches ~/.cursor/chats/<ws>/<id>). The Cursor *IDE* is unverified — a
|
|
124
|
-
# 2026-05 forum request for it drew no staff reply. The invented
|
|
125
|
-
# CURSOR_SESSION_ID was removed from the session table: empty in a live
|
|
126
|
-
# cursor-agent shell. Cursor's other path is the shell ticket below
|
|
127
|
-
# (_lookup_shell_ticket_context_key), which is not Cursor-specific.
|
|
128
|
-
("cursor", ("CURSOR_CONVERSATION_ID", "CURSOR_CONVERSATIONID")),
|
|
129
|
-
)
|
|
130
|
-
_ENV_TRANSCRIPT_KEYS: tuple[tuple[str, tuple[str, ...]], ...] = (
|
|
131
|
-
# REAL but HOOK-SCOPE ONLY (verified 2026-08-05): documented for Cursor hook
|
|
132
|
-
# scripts; empty in the agent's own shell env.
|
|
133
|
-
("cursor", ("CURSOR_TRANSCRIPT_PATH",)),
|
|
134
|
-
# UNVERIFIED — never researched. The 2026-08-05 audit covered the session
|
|
135
|
-
# table only, so do not infer these are real *or* fake from that work
|
|
136
|
-
# (CLAUDE_/CODEX_TRANSCRIPT_PATH were removed because those two *were*
|
|
137
|
-
# checked: absent from docs and from live envs). To settle each: run
|
|
138
|
-
# `env | grep _TRANSCRIPT_PATH` inside a hook and inside a shell-tool call.
|
|
139
|
-
("gemini", ("GEMINI_TRANSCRIPT_PATH",)),
|
|
140
|
-
("droid", ("FACTORY_TRANSCRIPT_PATH", "DROID_TRANSCRIPT_PATH")),
|
|
141
|
-
("qoder", ("QODER_TRANSCRIPT_PATH",)),
|
|
142
|
-
("codebuddy", ("CODEBUDDY_TRANSCRIPT_PATH",)),
|
|
143
62
|
)
|
|
144
63
|
_ENV_PLATFORM_ALIASES = {
|
|
145
64
|
"claude-code": "claude",
|
|
146
|
-
"factory": "droid",
|
|
147
|
-
"factory-ai": "droid",
|
|
148
|
-
"github-copilot": "copilot",
|
|
149
|
-
}
|
|
150
|
-
# ZCode intentionally reuses Claude's session env var name. Hooks know the host
|
|
151
|
-
# is ZCode, while later shell commands see only the shared env name and resolve
|
|
152
|
-
# it through the claude entry. Canonicalize both paths to one runtime filename.
|
|
153
|
-
_CONTEXT_KEY_PLATFORM_ALIASES = {
|
|
154
|
-
"zcode": "claude",
|
|
155
|
-
# Factory Droid's config directory is `.factory/`, so a hook that names its
|
|
156
|
-
# platform after the directory it was installed in reports "factory". Its
|
|
157
|
-
# sibling hooks report "droid". One runtime filename either way.
|
|
158
|
-
"factory": "droid",
|
|
159
65
|
}
|
|
160
66
|
|
|
161
67
|
|
|
@@ -238,6 +144,10 @@ def _runtime_sessions_dir(repo_root: Path) -> Path:
|
|
|
238
144
|
return repo_root / DIR_WORKFLOW / DIR_RUNTIME / DIR_SESSIONS
|
|
239
145
|
|
|
240
146
|
|
|
147
|
+
def _runtime_engaged_dir(repo_root: Path) -> Path:
|
|
148
|
+
return repo_root / DIR_WORKFLOW / DIR_RUNTIME / DIR_ENGAGED
|
|
149
|
+
|
|
150
|
+
|
|
241
151
|
def _sanitize_key(raw: str) -> str:
|
|
242
152
|
safe = re.sub(r"[^A-Za-z0-9._-]+", "_", raw.strip())
|
|
243
153
|
safe = safe.strip("._-")
|
|
@@ -284,13 +194,10 @@ def _detect_platform(platform_input: dict[str, Any] | None, platform: str | None
|
|
|
284
194
|
value = _string_value(platform_input.get(key))
|
|
285
195
|
if value:
|
|
286
196
|
return _sanitize_key(value) or "session"
|
|
287
|
-
if _string_value(platform_input.get("cursor_version")):
|
|
288
|
-
return "cursor"
|
|
289
197
|
return "session"
|
|
290
198
|
|
|
291
199
|
|
|
292
200
|
def _context_key(platform_name: str, kind: str, value: str) -> str:
|
|
293
|
-
platform_name = _CONTEXT_KEY_PLATFORM_ALIASES.get(platform_name, platform_name)
|
|
294
201
|
if kind == "transcript":
|
|
295
202
|
return f"{platform_name}_transcript_{_hash_value(value)}"
|
|
296
203
|
safe_value = _sanitize_key(value)
|
|
@@ -337,18 +244,6 @@ def _lookup_env_context_key(platform_name: str | None) -> str | None:
|
|
|
337
244
|
if value:
|
|
338
245
|
return _context_key(name, "session", value)
|
|
339
246
|
|
|
340
|
-
for name, keys in _iter_env_keys(_ENV_CONVERSATION_KEYS, env_platform_name):
|
|
341
|
-
for key in keys:
|
|
342
|
-
value = _string_value(os.environ.get(key))
|
|
343
|
-
if value:
|
|
344
|
-
return _context_key(name, "conversation", value)
|
|
345
|
-
|
|
346
|
-
for name, keys in _iter_env_keys(_ENV_TRANSCRIPT_KEYS, env_platform_name):
|
|
347
|
-
for key in keys:
|
|
348
|
-
value = _string_value(os.environ.get(key))
|
|
349
|
-
if value:
|
|
350
|
-
return _context_key(name, "transcript", value)
|
|
351
|
-
|
|
352
247
|
return None
|
|
353
248
|
|
|
354
249
|
|
|
@@ -364,10 +259,7 @@ def _find_repo_root_from_cwd() -> Path | None:
|
|
|
364
259
|
|
|
365
260
|
def _shell_ticket_dirs(repo_root: Path) -> tuple[Path, ...]:
|
|
366
261
|
runtime_dir = repo_root / DIR_WORKFLOW / DIR_RUNTIME
|
|
367
|
-
return (
|
|
368
|
-
runtime_dir / DIR_SHELL_TICKETS,
|
|
369
|
-
runtime_dir / DIR_LEGACY_CURSOR_SHELL_TICKETS,
|
|
370
|
-
)
|
|
262
|
+
return (runtime_dir / DIR_SHELL_TICKETS,)
|
|
371
263
|
|
|
372
264
|
|
|
373
265
|
def _remove_file(path: Path) -> bool:
|
|
@@ -451,7 +343,8 @@ def _matching_ticket_context_key(
|
|
|
451
343
|
"""Accept a ticket on its merits, never on which platform wrote it.
|
|
452
344
|
|
|
453
345
|
The `platform` field a ticket carries is debugging metadata; gating on it
|
|
454
|
-
|
|
346
|
+
would make this bridge invisible to every platform but the one that wrote
|
|
347
|
+
the ticket.
|
|
455
348
|
"""
|
|
456
349
|
ticket = _read_json(ticket_path)
|
|
457
350
|
if ticket is None:
|
|
@@ -507,28 +400,6 @@ def resolve_context_key(
|
|
|
507
400
|
scripts and subprocesses. It does not store the task itself.
|
|
508
401
|
"""
|
|
509
402
|
if allow_environment_context:
|
|
510
|
-
# The optional dsh-trellis plugin contributes this managed DSH_* value
|
|
511
|
-
# per shell execution from the current DSH session header. DSH scrubs
|
|
512
|
-
# ambient DSH_* values before rebuilding that namespace, so this value
|
|
513
|
-
# cannot be inherited from an outer Claude/Codex Trellis session. It
|
|
514
|
-
# must outrank the generic override below, which ordinary child
|
|
515
|
-
# processes inherit indiscriminately.
|
|
516
|
-
dsh_override = _string_value(os.environ.get("DSH_TRELLIS_CONTEXT_ID"))
|
|
517
|
-
if dsh_override:
|
|
518
|
-
return _sanitize_key(dsh_override) or _hash_value(dsh_override)
|
|
519
|
-
|
|
520
|
-
# A real DSH managed shell rebuilds the complete DSH_* namespace: the
|
|
521
|
-
# paired sentinel and session id cannot be inherited from an outer
|
|
522
|
-
# Trellis host. Prefer that canonical env-table identity over
|
|
523
|
-
# a generic override that ordinary process inheritance may carry in.
|
|
524
|
-
if (
|
|
525
|
-
_string_value(os.environ.get("DSH_SHELL")) == "1"
|
|
526
|
-
and _string_value(os.environ.get("DSH_SESSION_ID"))
|
|
527
|
-
):
|
|
528
|
-
dsh_context_key = _lookup_env_context_key("dsh")
|
|
529
|
-
if dsh_context_key:
|
|
530
|
-
return dsh_context_key
|
|
531
|
-
|
|
532
403
|
override = _string_value(os.environ.get("TRELLIS_CONTEXT_ID"))
|
|
533
404
|
if override:
|
|
534
405
|
return _sanitize_key(override) or _hash_value(override)
|
|
@@ -615,6 +486,10 @@ def _context_path(repo_root: Path, context_key: str) -> Path:
|
|
|
615
486
|
return _runtime_sessions_dir(repo_root) / f"{context_key}.json"
|
|
616
487
|
|
|
617
488
|
|
|
489
|
+
def _engaged_path(repo_root: Path, context_key: str) -> Path:
|
|
490
|
+
return _runtime_engaged_dir(repo_root) / f"{context_key}.json"
|
|
491
|
+
|
|
492
|
+
|
|
618
493
|
def resolve_active_task(
|
|
619
494
|
repo_root: Path,
|
|
620
495
|
platform_input: dict[str, Any] | None = None,
|
|
@@ -628,8 +503,8 @@ def resolve_active_task(
|
|
|
628
503
|
A stale session task is returned as stale. Missing context identity or a
|
|
629
504
|
missing/empty session context falls back to single-session inference: if
|
|
630
505
|
exactly one session file exists in the runtime, return its task with
|
|
631
|
-
source_type="session-fallback" — covers pull-based
|
|
632
|
-
|
|
506
|
+
source_type="session-fallback" — covers pull-based sub-agents that don't
|
|
507
|
+
inherit the parent's session id. ≥2
|
|
633
508
|
files or 0 files yield ActiveTask(None) — refuses to guess across windows.
|
|
634
509
|
"""
|
|
635
510
|
context_key = resolve_context_key(
|
|
@@ -703,6 +578,59 @@ def _context_metadata(
|
|
|
703
578
|
return metadata
|
|
704
579
|
|
|
705
580
|
|
|
581
|
+
def mark_session_engaged(
|
|
582
|
+
repo_root: Path,
|
|
583
|
+
platform_input: dict[str, Any] | None = None,
|
|
584
|
+
platform: str | None = None,
|
|
585
|
+
) -> str | None:
|
|
586
|
+
"""Opt this session into the Trellis workflow.
|
|
587
|
+
|
|
588
|
+
Context injection is opt-in: `session-start.py` and `inject-workflow-state.py`
|
|
589
|
+
emit nothing until a session is engaged. The user engages by invoking one of
|
|
590
|
+
the three lifecycle entry points (`trellis-start` / `trellis-continue` /
|
|
591
|
+
`trellis-finish-work`), each of which runs `task.py engage` as its first
|
|
592
|
+
step.
|
|
593
|
+
|
|
594
|
+
Returns the context key on success, or None when no session identity is
|
|
595
|
+
available. Callers must surface that as an error — reporting success without
|
|
596
|
+
a written flag would leave the hooks permanently silent and the user with no
|
|
597
|
+
way to tell why.
|
|
598
|
+
"""
|
|
599
|
+
context_key = resolve_context_key(platform_input, platform)
|
|
600
|
+
if not context_key:
|
|
601
|
+
return None
|
|
602
|
+
|
|
603
|
+
engaged_path = _engaged_path(repo_root, context_key)
|
|
604
|
+
record = _read_json(engaged_path) or {}
|
|
605
|
+
record.update(_context_metadata(platform_input, platform, context_key))
|
|
606
|
+
record["engaged"] = True
|
|
607
|
+
# Re-running an entry point in the same session must not reset when the
|
|
608
|
+
# session first opted in; `last_seen_at` above already carries recency.
|
|
609
|
+
record.setdefault("engaged_at", _utc_now())
|
|
610
|
+
if not _write_json(engaged_path, record):
|
|
611
|
+
return None
|
|
612
|
+
return context_key
|
|
613
|
+
|
|
614
|
+
|
|
615
|
+
def is_session_engaged(
|
|
616
|
+
repo_root: Path,
|
|
617
|
+
platform_input: dict[str, Any] | None = None,
|
|
618
|
+
platform: str | None = None,
|
|
619
|
+
) -> bool:
|
|
620
|
+
"""Report whether THIS session opted into the Trellis workflow.
|
|
621
|
+
|
|
622
|
+
Deliberately has no single-session fallback, unlike `resolve_active_task`:
|
|
623
|
+
inheriting engagement from a file another window left behind is exactly the
|
|
624
|
+
failure the opt-in model exists to prevent. A new session that never ran an
|
|
625
|
+
entry point must stay silent even while a task is mid-flight.
|
|
626
|
+
"""
|
|
627
|
+
context_key = resolve_context_key(platform_input, platform)
|
|
628
|
+
if not context_key:
|
|
629
|
+
return False
|
|
630
|
+
record = _read_json(_engaged_path(repo_root, context_key)) or {}
|
|
631
|
+
return record.get("engaged") is True
|
|
632
|
+
|
|
633
|
+
|
|
706
634
|
def set_active_task(
|
|
707
635
|
task_path: str,
|
|
708
636
|
repo_root: Path,
|
|
@@ -167,7 +167,7 @@ def _next_content_line(lines: list[str], start: int) -> tuple[int, str]:
|
|
|
167
167
|
# Defaults
|
|
168
168
|
DEFAULT_SESSION_COMMIT_MESSAGE = "chore: record journal"
|
|
169
169
|
DEFAULT_MAX_JOURNAL_LINES = 2000
|
|
170
|
-
DEFAULT_SESSION_AUTO_COMMIT =
|
|
170
|
+
DEFAULT_SESSION_AUTO_COMMIT = False
|
|
171
171
|
DEFAULT_CODEX_DISPATCH_MODE = "auto"
|
|
172
172
|
|
|
173
173
|
CONFIG_FILE = "config.yaml"
|
|
@@ -220,14 +220,14 @@ def get_session_auto_commit(repo_root: Path | None = None) -> bool:
|
|
|
220
220
|
Governs both ``add_session.py:_auto_commit_workspace`` and
|
|
221
221
|
``task_store.py:_auto_commit_archive``.
|
|
222
222
|
|
|
223
|
-
Default: ``
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
223
|
+
Default: ``False`` — the journal / archive files are written to disk and
|
|
224
|
+
git is left untouched; the user manages ``git add`` / ``git commit``.
|
|
225
|
+
Set ``session_auto_commit: true`` in ``.trellis/config.yaml`` to let the
|
|
226
|
+
scripts auto-stage and auto-commit those changes.
|
|
227
227
|
|
|
228
228
|
Accepts native YAML booleans (``true`` / ``false``) and the string
|
|
229
229
|
aliases ``true / false / yes / no / 1 / 0 / on / off`` (case-insensitive).
|
|
230
|
-
Invalid values fall back to ``
|
|
230
|
+
Invalid values fall back to ``False`` with a stderr warning.
|
|
231
231
|
"""
|
|
232
232
|
config = _load_config(repo_root)
|
|
233
233
|
raw = config.get("session_auto_commit", DEFAULT_SESSION_AUTO_COMMIT)
|
|
@@ -239,7 +239,7 @@ def get_session_auto_commit(repo_root: Path | None = None) -> bool:
|
|
|
239
239
|
if s in ("false", "no", "0", "off"):
|
|
240
240
|
return False
|
|
241
241
|
print(
|
|
242
|
-
f"[WARN] invalid session_auto_commit value: {raw!r}; using
|
|
242
|
+
f"[WARN] invalid session_auto_commit value: {raw!r}; using false (default)",
|
|
243
243
|
file=sys.stderr,
|
|
244
244
|
)
|
|
245
245
|
return DEFAULT_SESSION_AUTO_COMMIT
|
|
@@ -69,7 +69,7 @@ def main() -> None:
|
|
|
69
69
|
)
|
|
70
70
|
parser.add_argument(
|
|
71
71
|
"--platform",
|
|
72
|
-
help="Platform name for --mode phase, e.g.
|
|
72
|
+
help="Platform name for --mode phase, e.g. claude, codex. Filters platform-tagged blocks.",
|
|
73
73
|
)
|
|
74
74
|
parser.add_argument(
|
|
75
75
|
"--file",
|
|
@@ -599,7 +599,7 @@ def get_context_text(repo_root: Path | None = None) -> str:
|
|
|
599
599
|
lines.append("## DEVELOPER")
|
|
600
600
|
if not developer:
|
|
601
601
|
lines.append(
|
|
602
|
-
f"ERROR: Not initialized. Run:
|
|
602
|
+
f"ERROR: Not initialized. Run: python ./{DIR_WORKFLOW}/{DIR_SCRIPTS}/init_developer.py <name>"
|
|
603
603
|
)
|
|
604
604
|
return "\n".join(lines)
|
|
605
605
|
|
|
@@ -818,7 +818,7 @@ def get_context_text_record(repo_root: Path | None = None) -> str:
|
|
|
818
818
|
developer = get_developer(repo_root)
|
|
819
819
|
if not developer:
|
|
820
820
|
lines.append(
|
|
821
|
-
f"ERROR: Not initialized. Run:
|
|
821
|
+
f"ERROR: Not initialized. Run: python ./{DIR_WORKFLOW}/{DIR_SCRIPTS}/init_developer.py <name>"
|
|
822
822
|
)
|
|
823
823
|
return "\n".join(lines)
|
|
824
824
|
|
|
@@ -295,7 +295,7 @@ def assemble_payload(
|
|
|
295
295
|
_all_index_lines = [_index_line(m) for m in matches]
|
|
296
296
|
_summary_upper = (
|
|
297
297
|
f"- (+{len(matches)} more governing specs over budget — run "
|
|
298
|
-
f"
|
|
298
|
+
f"python ./.trellis/scripts/get_context.py --mode spec "
|
|
299
299
|
f"--file {edited_rel} to list them)"
|
|
300
300
|
)
|
|
301
301
|
_summary_reserve = len("\n\n" + _index_block([_summary_upper]))
|
|
@@ -409,7 +409,7 @@ def assemble_payload(
|
|
|
409
409
|
noun = "spec" if dropped == 1 else "specs"
|
|
410
410
|
summary = (
|
|
411
411
|
f"- (+{dropped} more governing {noun} over budget — run "
|
|
412
|
-
f"
|
|
412
|
+
f"python ./.trellis/scripts/get_context.py --mode spec "
|
|
413
413
|
f"--file {edited_rel} to list them)"
|
|
414
414
|
)
|
|
415
415
|
if fits(_index_block([*chosen, summary])):
|