@blulotus/trellis 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +235 -0
- package/README.md +149 -0
- package/bin/trellis.js +3 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +276 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/commands/channel/adapters/claude.d.ts +29 -0
- package/dist/commands/channel/adapters/claude.d.ts.map +1 -0
- package/dist/commands/channel/adapters/claude.js +203 -0
- package/dist/commands/channel/adapters/claude.js.map +1 -0
- package/dist/commands/channel/adapters/codex.d.ts +93 -0
- package/dist/commands/channel/adapters/codex.d.ts.map +1 -0
- package/dist/commands/channel/adapters/codex.js +573 -0
- package/dist/commands/channel/adapters/codex.js.map +1 -0
- package/dist/commands/channel/adapters/index.d.ts +86 -0
- package/dist/commands/channel/adapters/index.d.ts.map +1 -0
- package/dist/commands/channel/adapters/index.js +115 -0
- package/dist/commands/channel/adapters/index.js.map +1 -0
- package/dist/commands/channel/adapters/types.d.ts +33 -0
- package/dist/commands/channel/adapters/types.d.ts.map +1 -0
- package/dist/commands/channel/adapters/types.js +2 -0
- package/dist/commands/channel/adapters/types.js.map +1 -0
- package/dist/commands/channel/agent-loader.d.ts +32 -0
- package/dist/commands/channel/agent-loader.d.ts.map +1 -0
- package/dist/commands/channel/agent-loader.js +158 -0
- package/dist/commands/channel/agent-loader.js.map +1 -0
- package/dist/commands/channel/context-loader.d.ts +26 -0
- package/dist/commands/channel/context-loader.d.ts.map +1 -0
- package/dist/commands/channel/context-loader.js +311 -0
- package/dist/commands/channel/context-loader.js.map +1 -0
- package/dist/commands/channel/context-trust.d.ts +31 -0
- package/dist/commands/channel/context-trust.d.ts.map +1 -0
- package/dist/commands/channel/context-trust.js +139 -0
- package/dist/commands/channel/context-trust.js.map +1 -0
- package/dist/commands/channel/context.d.ts +16 -0
- package/dist/commands/channel/context.d.ts.map +1 -0
- package/dist/commands/channel/context.js +83 -0
- package/dist/commands/channel/context.js.map +1 -0
- package/dist/commands/channel/create.d.ts +27 -0
- package/dist/commands/channel/create.d.ts.map +1 -0
- package/dist/commands/channel/create.js +39 -0
- package/dist/commands/channel/create.js.map +1 -0
- package/dist/commands/channel/dev-parse-trace.d.ts +14 -0
- package/dist/commands/channel/dev-parse-trace.d.ts.map +1 -0
- package/dist/commands/channel/dev-parse-trace.js +70 -0
- package/dist/commands/channel/dev-parse-trace.js.map +1 -0
- package/dist/commands/channel/guard.d.ts +150 -0
- package/dist/commands/channel/guard.d.ts.map +1 -0
- package/dist/commands/channel/guard.js +479 -0
- package/dist/commands/channel/guard.js.map +1 -0
- package/dist/commands/channel/index.d.ts +3 -0
- package/dist/commands/channel/index.d.ts.map +1 -0
- package/dist/commands/channel/index.js +535 -0
- package/dist/commands/channel/index.js.map +1 -0
- package/dist/commands/channel/interrupt.d.ts +10 -0
- package/dist/commands/channel/interrupt.d.ts.map +1 -0
- package/dist/commands/channel/interrupt.js +22 -0
- package/dist/commands/channel/interrupt.js.map +1 -0
- package/dist/commands/channel/kill.d.ts +7 -0
- package/dist/commands/channel/kill.d.ts.map +1 -0
- package/dist/commands/channel/kill.js +121 -0
- package/dist/commands/channel/kill.js.map +1 -0
- package/dist/commands/channel/list.d.ts +17 -0
- package/dist/commands/channel/list.d.ts.map +1 -0
- package/dist/commands/channel/list.js +233 -0
- package/dist/commands/channel/list.js.map +1 -0
- package/dist/commands/channel/messages.d.ts +15 -0
- package/dist/commands/channel/messages.d.ts.map +1 -0
- package/dist/commands/channel/messages.js +245 -0
- package/dist/commands/channel/messages.js.map +1 -0
- package/dist/commands/channel/rm.d.ts +27 -0
- package/dist/commands/channel/rm.d.ts.map +1 -0
- package/dist/commands/channel/rm.js +216 -0
- package/dist/commands/channel/rm.js.map +1 -0
- package/dist/commands/channel/run.d.ts +30 -0
- package/dist/commands/channel/run.d.ts.map +1 -0
- package/dist/commands/channel/run.js +130 -0
- package/dist/commands/channel/run.js.map +1 -0
- package/dist/commands/channel/send.d.ts +11 -0
- package/dist/commands/channel/send.d.ts.map +1 -0
- package/dist/commands/channel/send.js +24 -0
- package/dist/commands/channel/send.js.map +1 -0
- package/dist/commands/channel/spawn.d.ts +43 -0
- package/dist/commands/channel/spawn.d.ts.map +1 -0
- package/dist/commands/channel/spawn.js +247 -0
- package/dist/commands/channel/spawn.js.map +1 -0
- package/dist/commands/channel/store/events.d.ts +39 -0
- package/dist/commands/channel/store/events.d.ts.map +1 -0
- package/dist/commands/channel/store/events.js +87 -0
- package/dist/commands/channel/store/events.js.map +1 -0
- package/dist/commands/channel/store/filter.d.ts +3 -0
- package/dist/commands/channel/store/filter.d.ts.map +1 -0
- package/dist/commands/channel/store/filter.js +2 -0
- package/dist/commands/channel/store/filter.js.map +1 -0
- package/dist/commands/channel/store/lock.d.ts +23 -0
- package/dist/commands/channel/store/lock.d.ts.map +1 -0
- package/dist/commands/channel/store/lock.js +99 -0
- package/dist/commands/channel/store/lock.js.map +1 -0
- package/dist/commands/channel/store/paths.d.ts +77 -0
- package/dist/commands/channel/store/paths.d.ts.map +1 -0
- package/dist/commands/channel/store/paths.js +272 -0
- package/dist/commands/channel/store/paths.js.map +1 -0
- package/dist/commands/channel/store/schema.d.ts +27 -0
- package/dist/commands/channel/store/schema.d.ts.map +1 -0
- package/dist/commands/channel/store/schema.js +34 -0
- package/dist/commands/channel/store/schema.js.map +1 -0
- package/dist/commands/channel/store/thread-state.d.ts +5 -0
- package/dist/commands/channel/store/thread-state.d.ts.map +1 -0
- package/dist/commands/channel/store/thread-state.js +16 -0
- package/dist/commands/channel/store/thread-state.js.map +1 -0
- package/dist/commands/channel/store/watch.d.ts +19 -0
- package/dist/commands/channel/store/watch.d.ts.map +1 -0
- package/dist/commands/channel/store/watch.js +146 -0
- package/dist/commands/channel/store/watch.js.map +1 -0
- package/dist/commands/channel/supervisor/idle.d.ts +45 -0
- package/dist/commands/channel/supervisor/idle.d.ts.map +1 -0
- package/dist/commands/channel/supervisor/idle.js +70 -0
- package/dist/commands/channel/supervisor/idle.js.map +1 -0
- package/dist/commands/channel/supervisor/inbox.d.ts +30 -0
- package/dist/commands/channel/supervisor/inbox.d.ts.map +1 -0
- package/dist/commands/channel/supervisor/inbox.js +160 -0
- package/dist/commands/channel/supervisor/inbox.js.map +1 -0
- package/dist/commands/channel/supervisor/shutdown.d.ts +68 -0
- package/dist/commands/channel/supervisor/shutdown.d.ts.map +1 -0
- package/dist/commands/channel/supervisor/shutdown.js +146 -0
- package/dist/commands/channel/supervisor/shutdown.js.map +1 -0
- package/dist/commands/channel/supervisor/stdout.d.ts +53 -0
- package/dist/commands/channel/supervisor/stdout.d.ts.map +1 -0
- package/dist/commands/channel/supervisor/stdout.js +168 -0
- package/dist/commands/channel/supervisor/stdout.js.map +1 -0
- package/dist/commands/channel/supervisor/turns.d.ts +31 -0
- package/dist/commands/channel/supervisor/turns.d.ts.map +1 -0
- package/dist/commands/channel/supervisor/turns.js +45 -0
- package/dist/commands/channel/supervisor/turns.js.map +1 -0
- package/dist/commands/channel/supervisor/warning.d.ts +48 -0
- package/dist/commands/channel/supervisor/warning.d.ts.map +1 -0
- package/dist/commands/channel/supervisor/warning.js +77 -0
- package/dist/commands/channel/supervisor/warning.js.map +1 -0
- package/dist/commands/channel/supervisor.d.ts +75 -0
- package/dist/commands/channel/supervisor.d.ts.map +1 -0
- package/dist/commands/channel/supervisor.js +397 -0
- package/dist/commands/channel/supervisor.js.map +1 -0
- package/dist/commands/channel/text-body.d.ts +13 -0
- package/dist/commands/channel/text-body.d.ts.map +1 -0
- package/dist/commands/channel/text-body.js +47 -0
- package/dist/commands/channel/text-body.js.map +1 -0
- package/dist/commands/channel/threads.d.ts +39 -0
- package/dist/commands/channel/threads.d.ts.map +1 -0
- package/dist/commands/channel/threads.js +106 -0
- package/dist/commands/channel/threads.js.map +1 -0
- package/dist/commands/channel/title.d.ts +12 -0
- package/dist/commands/channel/title.d.ts.map +1 -0
- package/dist/commands/channel/title.js +24 -0
- package/dist/commands/channel/title.js.map +1 -0
- package/dist/commands/channel/wait.d.ts +17 -0
- package/dist/commands/channel/wait.d.ts.map +1 -0
- package/dist/commands/channel/wait.js +75 -0
- package/dist/commands/channel/wait.js.map +1 -0
- package/dist/commands/init.d.ts +71 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +1603 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/mem.d.ts +30 -0
- package/dist/commands/mem.d.ts.map +1 -0
- package/dist/commands/mem.js +447 -0
- package/dist/commands/mem.js.map +1 -0
- package/dist/commands/uninstall.d.ts +36 -0
- package/dist/commands/uninstall.d.ts.map +1 -0
- package/dist/commands/uninstall.js +410 -0
- package/dist/commands/uninstall.js.map +1 -0
- package/dist/commands/update.d.ts +111 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +2152 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/commands/upgrade.d.ts +28 -0
- package/dist/commands/upgrade.d.ts.map +1 -0
- package/dist/commands/upgrade.js +84 -0
- package/dist/commands/upgrade.js.map +1 -0
- package/dist/commands/workflow.d.ts +52 -0
- package/dist/commands/workflow.d.ts.map +1 -0
- package/dist/commands/workflow.js +454 -0
- package/dist/commands/workflow.js.map +1 -0
- package/dist/configurators/antigravity.d.ts +7 -0
- package/dist/configurators/antigravity.d.ts.map +1 -0
- package/dist/configurators/antigravity.js +11 -0
- package/dist/configurators/antigravity.js.map +1 -0
- package/dist/configurators/claude.d.ts +23 -0
- package/dist/configurators/claude.d.ts.map +1 -0
- package/dist/configurators/claude.js +123 -0
- package/dist/configurators/claude.js.map +1 -0
- package/dist/configurators/codebuddy.d.ts +10 -0
- package/dist/configurators/codebuddy.d.ts.map +1 -0
- package/dist/configurators/codebuddy.js +24 -0
- package/dist/configurators/codebuddy.js.map +1 -0
- package/dist/configurators/codex.d.ts +57 -0
- package/dist/configurators/codex.d.ts.map +1 -0
- package/dist/configurators/codex.js +170 -0
- package/dist/configurators/codex.js.map +1 -0
- package/dist/configurators/copilot.d.ts +14 -0
- package/dist/configurators/copilot.d.ts.map +1 -0
- package/dist/configurators/copilot.js +46 -0
- package/dist/configurators/copilot.js.map +1 -0
- package/dist/configurators/cursor.d.ts +10 -0
- package/dist/configurators/cursor.d.ts.map +1 -0
- package/dist/configurators/cursor.js +23 -0
- package/dist/configurators/cursor.js.map +1 -0
- package/dist/configurators/devin.d.ts +8 -0
- package/dist/configurators/devin.d.ts.map +1 -0
- package/dist/configurators/devin.js +12 -0
- package/dist/configurators/devin.js.map +1 -0
- package/dist/configurators/droid.d.ts +10 -0
- package/dist/configurators/droid.d.ts.map +1 -0
- package/dist/configurators/droid.js +24 -0
- package/dist/configurators/droid.js.map +1 -0
- package/dist/configurators/dsh.d.ts +26 -0
- package/dist/configurators/dsh.d.ts.map +1 -0
- package/dist/configurators/dsh.js +76 -0
- package/dist/configurators/dsh.js.map +1 -0
- package/dist/configurators/gemini.d.ts +18 -0
- package/dist/configurators/gemini.d.ts.map +1 -0
- package/dist/configurators/gemini.js +39 -0
- package/dist/configurators/gemini.js.map +1 -0
- package/dist/configurators/grok.d.ts +17 -0
- package/dist/configurators/grok.d.ts.map +1 -0
- package/dist/configurators/grok.js +38 -0
- package/dist/configurators/grok.js.map +1 -0
- package/dist/configurators/index.d.ts +68 -0
- package/dist/configurators/index.d.ts.map +1 -0
- package/dist/configurators/index.js +191 -0
- package/dist/configurators/index.js.map +1 -0
- package/dist/configurators/kilo.d.ts +7 -0
- package/dist/configurators/kilo.d.ts.map +1 -0
- package/dist/configurators/kilo.js +11 -0
- package/dist/configurators/kilo.js.map +1 -0
- package/dist/configurators/kimi.d.ts +26 -0
- package/dist/configurators/kimi.d.ts.map +1 -0
- package/dist/configurators/kimi.js +74 -0
- package/dist/configurators/kimi.js.map +1 -0
- package/dist/configurators/kiro.d.ts +11 -0
- package/dist/configurators/kiro.d.ts.map +1 -0
- package/dist/configurators/kiro.js +30 -0
- package/dist/configurators/kiro.js.map +1 -0
- package/dist/configurators/omp.d.ts +6 -0
- package/dist/configurators/omp.d.ts.map +1 -0
- package/dist/configurators/omp.js +28 -0
- package/dist/configurators/omp.js.map +1 -0
- package/dist/configurators/opencode.d.ts +5 -0
- package/dist/configurators/opencode.d.ts.map +1 -0
- package/dist/configurators/opencode.js +84 -0
- package/dist/configurators/opencode.js.map +1 -0
- package/dist/configurators/pi.d.ts +5 -0
- package/dist/configurators/pi.d.ts.map +1 -0
- package/dist/configurators/pi.js +39 -0
- package/dist/configurators/pi.js.map +1 -0
- package/dist/configurators/qoder.d.ts +12 -0
- package/dist/configurators/qoder.d.ts.map +1 -0
- package/dist/configurators/qoder.js +30 -0
- package/dist/configurators/qoder.js.map +1 -0
- package/dist/configurators/reasonix.d.ts +17 -0
- package/dist/configurators/reasonix.d.ts.map +1 -0
- package/dist/configurators/reasonix.js +37 -0
- package/dist/configurators/reasonix.js.map +1 -0
- package/dist/configurators/shared.d.ts +187 -0
- package/dist/configurators/shared.d.ts.map +1 -0
- package/dist/configurators/shared.js +590 -0
- package/dist/configurators/shared.js.map +1 -0
- package/dist/configurators/snow.d.ts +25 -0
- package/dist/configurators/snow.d.ts.map +1 -0
- package/dist/configurators/snow.js +69 -0
- package/dist/configurators/snow.js.map +1 -0
- package/dist/configurators/trae.d.ts +16 -0
- package/dist/configurators/trae.d.ts.map +1 -0
- package/dist/configurators/trae.js +34 -0
- package/dist/configurators/trae.js.map +1 -0
- package/dist/configurators/workflow.d.ts +51 -0
- package/dist/configurators/workflow.d.ts.map +1 -0
- package/dist/configurators/workflow.js +210 -0
- package/dist/configurators/workflow.js.map +1 -0
- package/dist/configurators/zcode.d.ts +23 -0
- package/dist/configurators/zcode.d.ts.map +1 -0
- package/dist/configurators/zcode.js +63 -0
- package/dist/configurators/zcode.js.map +1 -0
- package/dist/constants/paths.d.ts +74 -0
- package/dist/constants/paths.d.ts.map +1 -0
- package/dist/constants/paths.js +83 -0
- package/dist/constants/paths.js.map +1 -0
- package/dist/constants/version.d.ts +9 -0
- package/dist/constants/version.d.ts.map +1 -0
- package/dist/constants/version.js +15 -0
- package/dist/constants/version.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/migrations/index.d.ts +62 -0
- package/dist/migrations/index.d.ts.map +1 -0
- package/dist/migrations/index.js +187 -0
- package/dist/migrations/index.js.map +1 -0
- package/dist/migrations/manifests/0.1.9.json +30 -0
- package/dist/migrations/manifests/0.2.0.json +49 -0
- package/dist/migrations/manifests/0.2.12.json +9 -0
- package/dist/migrations/manifests/0.2.13.json +9 -0
- package/dist/migrations/manifests/0.2.14.json +175 -0
- package/dist/migrations/manifests/0.2.15.json +33 -0
- package/dist/migrations/manifests/0.3.0-beta.0.json +297 -0
- package/dist/migrations/manifests/0.3.0-beta.1.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.10.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.11.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.12.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.13.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.14.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.15.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.16.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.2.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.3.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.4.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.5.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.6.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.7.json +11 -0
- package/dist/migrations/manifests/0.3.0-beta.8.json +9 -0
- package/dist/migrations/manifests/0.3.0-beta.9.json +9 -0
- package/dist/migrations/manifests/0.3.0-rc.0.json +9 -0
- package/dist/migrations/manifests/0.3.0-rc.1.json +9 -0
- package/dist/migrations/manifests/0.3.0-rc.2.json +9 -0
- package/dist/migrations/manifests/0.3.0-rc.3.json +9 -0
- package/dist/migrations/manifests/0.3.0-rc.4.json +9 -0
- package/dist/migrations/manifests/0.3.0-rc.5.json +9 -0
- package/dist/migrations/manifests/0.3.0-rc.6.json +9 -0
- package/dist/migrations/manifests/0.3.0.json +11 -0
- package/dist/migrations/manifests/0.3.1.json +9 -0
- package/dist/migrations/manifests/0.3.10.json +9 -0
- package/dist/migrations/manifests/0.3.2.json +9 -0
- package/dist/migrations/manifests/0.3.3.json +9 -0
- package/dist/migrations/manifests/0.3.4.json +21 -0
- package/dist/migrations/manifests/0.3.5.json +9 -0
- package/dist/migrations/manifests/0.3.6.json +9 -0
- package/dist/migrations/manifests/0.3.7.json +9 -0
- package/dist/migrations/manifests/0.3.8.json +9 -0
- package/dist/migrations/manifests/0.3.9.json +9 -0
- package/dist/migrations/manifests/0.4.0-beta.1.json +228 -0
- package/dist/migrations/manifests/0.4.0-beta.10.json +9 -0
- package/dist/migrations/manifests/0.4.0-beta.2.json +9 -0
- package/dist/migrations/manifests/0.4.0-beta.3.json +9 -0
- package/dist/migrations/manifests/0.4.0-beta.4.json +9 -0
- package/dist/migrations/manifests/0.4.0-beta.5.json +9 -0
- package/dist/migrations/manifests/0.4.0-beta.6.json +9 -0
- package/dist/migrations/manifests/0.4.0-beta.7.json +9 -0
- package/dist/migrations/manifests/0.4.0-beta.8.json +34 -0
- package/dist/migrations/manifests/0.4.0-beta.9.json +9 -0
- package/dist/migrations/manifests/0.4.0-rc.0.json +9 -0
- package/dist/migrations/manifests/0.4.0-rc.1.json +9 -0
- package/dist/migrations/manifests/0.4.0.json +9 -0
- package/dist/migrations/manifests/0.5.0-beta.0.json +1646 -0
- package/dist/migrations/manifests/0.5.0-beta.1.json +9 -0
- package/dist/migrations/manifests/0.5.0-beta.10.json +9 -0
- package/dist/migrations/manifests/0.5.0-beta.11.json +9 -0
- package/dist/migrations/manifests/0.5.0-beta.12.json +9 -0
- package/dist/migrations/manifests/0.5.0-beta.13.json +9 -0
- package/dist/migrations/manifests/0.5.0-beta.14.json +9 -0
- package/dist/migrations/manifests/0.5.0-beta.15.json +116 -0
- package/dist/migrations/manifests/0.5.0-beta.16.json +9 -0
- package/dist/migrations/manifests/0.5.0-beta.17.json +9 -0
- package/dist/migrations/manifests/0.5.0-beta.18.json +9 -0
- package/dist/migrations/manifests/0.5.0-beta.19.json +9 -0
- package/dist/migrations/manifests/0.5.0-beta.2.json +9 -0
- package/dist/migrations/manifests/0.5.0-beta.3.json +9 -0
- package/dist/migrations/manifests/0.5.0-beta.4.json +9 -0
- package/dist/migrations/manifests/0.5.0-beta.5.json +222 -0
- package/dist/migrations/manifests/0.5.0-beta.6.json +9 -0
- package/dist/migrations/manifests/0.5.0-beta.7.json +9 -0
- package/dist/migrations/manifests/0.5.0-beta.8.json +9 -0
- package/dist/migrations/manifests/0.5.0-beta.9.json +48 -0
- package/dist/migrations/manifests/0.5.0-rc.0.json +9 -0
- package/dist/migrations/manifests/0.5.0-rc.1.json +9 -0
- package/dist/migrations/manifests/0.5.0-rc.2.json +9 -0
- package/dist/migrations/manifests/0.5.0-rc.3.json +9 -0
- package/dist/migrations/manifests/0.5.0-rc.4.json +9 -0
- package/dist/migrations/manifests/0.5.0-rc.5.json +9 -0
- package/dist/migrations/manifests/0.5.0-rc.6.json +9 -0
- package/dist/migrations/manifests/0.5.0-rc.7.json +9 -0
- package/dist/migrations/manifests/0.5.0.json +9 -0
- package/dist/migrations/manifests/0.5.1.json +9 -0
- package/dist/migrations/manifests/0.5.10.json +9 -0
- package/dist/migrations/manifests/0.5.11.json +16 -0
- package/dist/migrations/manifests/0.5.12.json +9 -0
- package/dist/migrations/manifests/0.5.13.json +9 -0
- package/dist/migrations/manifests/0.5.14.json +9 -0
- package/dist/migrations/manifests/0.5.15.json +9 -0
- package/dist/migrations/manifests/0.5.16.json +9 -0
- package/dist/migrations/manifests/0.5.17.json +9 -0
- package/dist/migrations/manifests/0.5.18.json +9 -0
- package/dist/migrations/manifests/0.5.19.json +9 -0
- package/dist/migrations/manifests/0.5.2.json +9 -0
- package/dist/migrations/manifests/0.5.3.json +9 -0
- package/dist/migrations/manifests/0.5.4.json +9 -0
- package/dist/migrations/manifests/0.5.5.json +9 -0
- package/dist/migrations/manifests/0.5.6.json +9 -0
- package/dist/migrations/manifests/0.5.7.json +16 -0
- package/dist/migrations/manifests/0.5.8.json +9 -0
- package/dist/migrations/manifests/0.5.9.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.0.json +16 -0
- package/dist/migrations/manifests/0.6.0-beta.1.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.10.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.11.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.12.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.13.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.14.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.15.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.16.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.17.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.18.json +16 -0
- package/dist/migrations/manifests/0.6.0-beta.19.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.2.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.20.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.21.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.22.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.23.json +88 -0
- package/dist/migrations/manifests/0.6.0-beta.3.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.4.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.5.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.6.json +16 -0
- package/dist/migrations/manifests/0.6.0-beta.7.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.8.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.9.json +9 -0
- package/dist/migrations/manifests/0.6.0-rc.0.json +9 -0
- package/dist/migrations/manifests/0.6.0.json +1 -0
- package/dist/migrations/manifests/0.6.1.json +9 -0
- package/dist/migrations/manifests/0.6.10.json +9 -0
- package/dist/migrations/manifests/0.6.11.json +9 -0
- package/dist/migrations/manifests/0.6.12.json +9 -0
- package/dist/migrations/manifests/0.6.13.json +9 -0
- package/dist/migrations/manifests/0.6.14.json +9 -0
- package/dist/migrations/manifests/0.6.2.json +9 -0
- package/dist/migrations/manifests/0.6.3.json +24 -0
- package/dist/migrations/manifests/0.6.4.json +9 -0
- package/dist/migrations/manifests/0.6.5.json +9 -0
- package/dist/migrations/manifests/0.6.6.json +17 -0
- package/dist/migrations/manifests/0.6.7.json +9 -0
- package/dist/migrations/manifests/0.6.8.json +17 -0
- package/dist/migrations/manifests/0.6.9.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.0.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.1.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.2.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.3.json +9 -0
- package/dist/templates/claude/agents/trellis-check.md +115 -0
- package/dist/templates/claude/agents/trellis-implement.md +115 -0
- package/dist/templates/claude/agents/trellis-research.md +137 -0
- package/dist/templates/claude/hooks/statusline.py +332 -0
- package/dist/templates/claude/index.d.ts +31 -0
- package/dist/templates/claude/index.d.ts.map +1 -0
- package/dist/templates/claude/index.js +57 -0
- package/dist/templates/claude/index.js.map +1 -0
- package/dist/templates/claude/settings.json +95 -0
- package/dist/templates/codebuddy/agents/trellis-check.md +115 -0
- package/dist/templates/codebuddy/agents/trellis-implement.md +115 -0
- package/dist/templates/codebuddy/agents/trellis-research.md +137 -0
- package/dist/templates/codebuddy/index.d.ts +15 -0
- package/dist/templates/codebuddy/index.d.ts.map +1 -0
- package/dist/templates/codebuddy/index.js +15 -0
- package/dist/templates/codebuddy/index.js.map +1 -0
- package/dist/templates/codebuddy/settings.json +69 -0
- package/dist/templates/codex/agents/trellis-check.toml +56 -0
- package/dist/templates/codex/agents/trellis-implement.toml +37 -0
- package/dist/templates/codex/agents/trellis-research.toml +78 -0
- package/dist/templates/codex/config.toml +39 -0
- package/dist/templates/codex/hooks/session-start.py +568 -0
- package/dist/templates/codex/hooks.json +52 -0
- package/dist/templates/codex/index.d.ts +35 -0
- package/dist/templates/codex/index.d.ts.map +1 -0
- package/dist/templates/codex/index.js +67 -0
- package/dist/templates/codex/index.js.map +1 -0
- package/dist/templates/common/bundled-skills/trellis-channel/SKILL.md +67 -0
- package/dist/templates/common/bundled-skills/trellis-channel/references/command-reference.md +480 -0
- package/dist/templates/common/bundled-skills/trellis-channel/references/forum.md +233 -0
- package/dist/templates/common/bundled-skills/trellis-channel/references/progress-debugging.md +226 -0
- package/dist/templates/common/bundled-skills/trellis-channel/references/workers.md +276 -0
- package/dist/templates/common/bundled-skills/trellis-channel/references/workflows.md +128 -0
- package/dist/templates/common/bundled-skills/trellis-meta/SKILL.md +85 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/add-project-local-conventions.md +83 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-agents.md +56 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-context-loading.md +84 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-hooks.md +57 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-skills-or-commands.md +123 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-spec-structure.md +83 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-task-lifecycle.md +90 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-workflow.md +65 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/overview.md +55 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/bundled-skills.md +159 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/context-injection.md +68 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/generated-files.md +80 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/multi-agent-channel.md +69 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/overview.md +51 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/spec-system.md +102 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/task-system.md +130 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/workflow.md +75 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/workspace-memory.md +71 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/agents.md +84 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/hooks-and-settings.md +73 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/overview.md +59 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.md +113 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/skills-and-commands.md +87 -0
- package/dist/templates/common/bundled-skills/trellis-session-insight/SKILL.md +81 -0
- package/dist/templates/common/bundled-skills/trellis-session-insight/references/cli-quick-reference.md +65 -0
- package/dist/templates/common/bundled-skills/trellis-session-insight/references/triggering-patterns.md +93 -0
- package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/SKILL.md +41 -0
- package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/mcp-setup.md +90 -0
- package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/repository-analysis.md +59 -0
- package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/spec-task-planning.md +61 -0
- package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/spec-writing.md +70 -0
- package/dist/templates/common/commands/continue.md +56 -0
- package/dist/templates/common/commands/finish-work.md +66 -0
- package/dist/templates/common/commands/start.md +59 -0
- package/dist/templates/common/index.d.ts +48 -0
- package/dist/templates/common/index.d.ts.map +1 -0
- package/dist/templates/common/index.js +104 -0
- package/dist/templates/common/index.js.map +1 -0
- package/dist/templates/common/skills/before-dev.md +46 -0
- package/dist/templates/common/skills/brainstorm.md +212 -0
- package/dist/templates/common/skills/break-loop.md +184 -0
- package/dist/templates/common/skills/check.md +106 -0
- package/dist/templates/common/skills/tdd.md +142 -0
- package/dist/templates/common/skills/update-spec.md +351 -0
- package/dist/templates/copilot/copilot-instructions.md +11 -0
- package/dist/templates/copilot/hooks/session-start.py +564 -0
- package/dist/templates/copilot/hooks.json +19 -0
- package/dist/templates/copilot/index.d.ts +28 -0
- package/dist/templates/copilot/index.d.ts.map +1 -0
- package/dist/templates/copilot/index.js +61 -0
- package/dist/templates/copilot/index.js.map +1 -0
- package/dist/templates/copilot/prompts/before-dev.prompt.md +39 -0
- package/dist/templates/copilot/prompts/brainstorm.prompt.md +173 -0
- package/dist/templates/copilot/prompts/break-loop.prompt.md +129 -0
- package/dist/templates/copilot/prompts/check-cross-layer.prompt.md +170 -0
- package/dist/templates/copilot/prompts/check.prompt.md +110 -0
- package/dist/templates/copilot/prompts/create-command.prompt.md +116 -0
- package/dist/templates/copilot/prompts/finish-work.prompt.md +99 -0
- package/dist/templates/copilot/prompts/integrate-skill.prompt.md +223 -0
- package/dist/templates/copilot/prompts/onboard.prompt.md +362 -0
- package/dist/templates/copilot/prompts/parallel.prompt.md +204 -0
- package/dist/templates/copilot/prompts/record-session.prompt.md +66 -0
- package/dist/templates/copilot/prompts/start.prompt.md +63 -0
- package/dist/templates/copilot/prompts/update-spec.prompt.md +358 -0
- package/dist/templates/cursor/agents/trellis-check.md +114 -0
- package/dist/templates/cursor/agents/trellis-implement.md +114 -0
- package/dist/templates/cursor/agents/trellis-research.md +136 -0
- package/dist/templates/cursor/hooks.json +24 -0
- package/dist/templates/cursor/index.d.ts +13 -0
- package/dist/templates/cursor/index.d.ts.map +1 -0
- package/dist/templates/cursor/index.js +13 -0
- package/dist/templates/cursor/index.js.map +1 -0
- package/dist/templates/droid/droids/trellis-check.md +107 -0
- package/dist/templates/droid/droids/trellis-implement.md +107 -0
- package/dist/templates/droid/droids/trellis-research.md +137 -0
- package/dist/templates/droid/index.d.ts +15 -0
- package/dist/templates/droid/index.d.ts.map +1 -0
- package/dist/templates/droid/index.js +15 -0
- package/dist/templates/droid/index.js.map +1 -0
- package/dist/templates/droid/settings.json +69 -0
- package/dist/templates/dsh/DSH.md +80 -0
- package/dist/templates/dsh/agents/trellis-check.md +99 -0
- package/dist/templates/dsh/agents/trellis-implement.md +106 -0
- package/dist/templates/dsh/agents/trellis-research.md +134 -0
- package/dist/templates/dsh/index.d.ts +22 -0
- package/dist/templates/dsh/index.d.ts.map +1 -0
- package/dist/templates/dsh/index.js +27 -0
- package/dist/templates/dsh/index.js.map +1 -0
- package/dist/templates/extract.d.ts +40 -0
- package/dist/templates/extract.d.ts.map +1 -0
- package/dist/templates/extract.js +106 -0
- package/dist/templates/extract.js.map +1 -0
- package/dist/templates/gemini/agents/trellis-check.md +107 -0
- package/dist/templates/gemini/agents/trellis-implement.md +107 -0
- package/dist/templates/gemini/agents/trellis-research.md +136 -0
- package/dist/templates/gemini/index.d.ts +13 -0
- package/dist/templates/gemini/index.d.ts.map +1 -0
- package/dist/templates/gemini/index.js +13 -0
- package/dist/templates/gemini/index.js.map +1 -0
- package/dist/templates/gemini/settings.json +40 -0
- package/dist/templates/grok/agents/trellis-check.md +106 -0
- package/dist/templates/grok/agents/trellis-implement.md +121 -0
- package/dist/templates/grok/agents/trellis-research.md +146 -0
- package/dist/templates/grok/index.d.ts +16 -0
- package/dist/templates/grok/index.d.ts.map +1 -0
- package/dist/templates/grok/index.js +19 -0
- package/dist/templates/grok/index.js.map +1 -0
- package/dist/templates/kimi/agents/trellis-check.md +104 -0
- package/dist/templates/kimi/agents/trellis-implement.md +120 -0
- package/dist/templates/kimi/agents/trellis-research.md +144 -0
- package/dist/templates/kimi/index.d.ts +20 -0
- package/dist/templates/kimi/index.d.ts.map +1 -0
- package/dist/templates/kimi/index.js +23 -0
- package/dist/templates/kimi/index.js.map +1 -0
- package/dist/templates/kiro/agents/trellis-check.json +26 -0
- package/dist/templates/kiro/agents/trellis-implement.json +26 -0
- package/dist/templates/kiro/agents/trellis-research.json +30 -0
- package/dist/templates/kiro/agents/trellis.json +34 -0
- package/dist/templates/kiro/hooks/trellis-workflow-state.kiro.hook +14 -0
- package/dist/templates/kiro/index.d.ts +32 -0
- package/dist/templates/kiro/index.d.ts.map +1 -0
- package/dist/templates/kiro/index.js +28 -0
- package/dist/templates/kiro/index.js.map +1 -0
- package/dist/templates/markdown/agents.md +21 -0
- package/dist/templates/markdown/gitignore.txt +15 -0
- package/dist/templates/markdown/index.d.ts +27 -0
- package/dist/templates/markdown/index.d.ts.map +1 -0
- package/dist/templates/markdown/index.js +52 -0
- package/dist/templates/markdown/index.js.map +1 -0
- package/dist/templates/markdown/spec/backend/database-guidelines.md.txt +51 -0
- package/dist/templates/markdown/spec/backend/directory-structure.md.txt +54 -0
- package/dist/templates/markdown/spec/backend/error-handling.md.txt +51 -0
- package/dist/templates/markdown/spec/backend/index.md.txt +38 -0
- package/dist/templates/markdown/spec/backend/logging-guidelines.md.txt +51 -0
- package/dist/templates/markdown/spec/backend/quality-guidelines.md.txt +51 -0
- package/dist/templates/markdown/spec/frontend/component-guidelines.md.txt +59 -0
- package/dist/templates/markdown/spec/frontend/directory-structure.md.txt +54 -0
- package/dist/templates/markdown/spec/frontend/hook-guidelines.md.txt +51 -0
- package/dist/templates/markdown/spec/frontend/index.md.txt +39 -0
- package/dist/templates/markdown/spec/frontend/quality-guidelines.md.txt +51 -0
- package/dist/templates/markdown/spec/frontend/state-management.md.txt +51 -0
- package/dist/templates/markdown/spec/frontend/type-safety.md.txt +51 -0
- package/dist/templates/markdown/spec/guides/code-reuse-thinking-guide.md.txt +223 -0
- package/dist/templates/markdown/spec/guides/cross-layer-thinking-guide.md.txt +327 -0
- package/dist/templates/markdown/spec/guides/cross-platform-thinking-guide.md.txt +633 -0
- package/dist/templates/markdown/spec/guides/index.md.txt +97 -0
- package/dist/templates/markdown/workspace-index.md +125 -0
- package/dist/templates/markdown/worktree.yaml.txt +58 -0
- package/dist/templates/omp/agents/trellis-check.md +41 -0
- package/dist/templates/omp/agents/trellis-implement.md +55 -0
- package/dist/templates/omp/agents/trellis-research.md +30 -0
- package/dist/templates/omp/extensions/trellis/index.ts.txt +592 -0
- package/dist/templates/omp/index.d.ts +4 -0
- package/dist/templates/omp/index.d.ts.map +1 -0
- package/dist/templates/omp/index.js +9 -0
- package/dist/templates/omp/index.js.map +1 -0
- package/dist/templates/opencode/agents/trellis-check.md +122 -0
- package/dist/templates/opencode/agents/trellis-implement.md +123 -0
- package/dist/templates/opencode/agents/trellis-research.md +145 -0
- package/dist/templates/opencode/lib/context-visibility.js +86 -0
- package/dist/templates/opencode/lib/session-utils.js +526 -0
- package/dist/templates/opencode/lib/trellis-context.js +627 -0
- package/dist/templates/opencode/package.json +5 -0
- package/dist/templates/opencode/plugins/inject-spec-context.js +121 -0
- package/dist/templates/opencode/plugins/inject-subagent-context.js +569 -0
- package/dist/templates/opencode/plugins/inject-workflow-state.js +340 -0
- package/dist/templates/opencode/plugins/session-start.js +74 -0
- package/dist/templates/pi/agents/trellis-check.md +37 -0
- package/dist/templates/pi/agents/trellis-implement.md +52 -0
- package/dist/templates/pi/agents/trellis-research.md +25 -0
- package/dist/templates/pi/extensions/trellis/index.ts.txt +2033 -0
- package/dist/templates/pi/index.d.ts +5 -0
- package/dist/templates/pi/index.d.ts.map +1 -0
- package/dist/templates/pi/index.js +12 -0
- package/dist/templates/pi/index.js.map +1 -0
- package/dist/templates/pi/settings.json +9 -0
- package/dist/templates/qoder/agents/trellis-check.md +108 -0
- package/dist/templates/qoder/agents/trellis-implement.md +108 -0
- package/dist/templates/qoder/agents/trellis-research.md +137 -0
- package/dist/templates/qoder/index.d.ts +15 -0
- package/dist/templates/qoder/index.d.ts.map +1 -0
- package/dist/templates/qoder/index.js +15 -0
- package/dist/templates/qoder/index.js.map +1 -0
- package/dist/templates/qoder/settings.json +59 -0
- package/dist/templates/reasonix/agents/trellis-check.md +36 -0
- package/dist/templates/reasonix/agents/trellis-implement.md +51 -0
- package/dist/templates/reasonix/index.d.ts +13 -0
- package/dist/templates/reasonix/index.d.ts.map +1 -0
- package/dist/templates/reasonix/index.js +16 -0
- package/dist/templates/reasonix/index.js.map +1 -0
- package/dist/templates/shared-hooks/index.d.ts +83 -0
- package/dist/templates/shared-hooks/index.d.ts.map +1 -0
- package/dist/templates/shared-hooks/index.js +152 -0
- package/dist/templates/shared-hooks/index.js.map +1 -0
- package/dist/templates/shared-hooks/inject-shell-session-context.py +292 -0
- package/dist/templates/shared-hooks/inject-spec-context.py +844 -0
- package/dist/templates/shared-hooks/inject-subagent-context.py +1175 -0
- package/dist/templates/shared-hooks/inject-workflow-state.py +501 -0
- package/dist/templates/shared-hooks/session-start.py +969 -0
- package/dist/templates/snow/SNOW.md +86 -0
- package/dist/templates/snow/agents/trellis-check.md +136 -0
- package/dist/templates/snow/agents/trellis-implement.md +158 -0
- package/dist/templates/snow/agents/trellis-research.md +114 -0
- package/dist/templates/snow/hooks/beforeSubAgentStart.json +15 -0
- package/dist/templates/snow/hooks/onSessionStart.json +15 -0
- package/dist/templates/snow/hooks/onUserMessage.json +15 -0
- package/dist/templates/snow/hooks/write-trellis-context.py +644 -0
- package/dist/templates/snow/index.d.ts +26 -0
- package/dist/templates/snow/index.d.ts.map +1 -0
- package/dist/templates/snow/index.js +36 -0
- package/dist/templates/snow/index.js.map +1 -0
- package/dist/templates/template-utils.d.ts +26 -0
- package/dist/templates/template-utils.d.ts.map +1 -0
- package/dist/templates/template-utils.js +64 -0
- package/dist/templates/template-utils.js.map +1 -0
- package/dist/templates/trae/agents/trellis-check.md +108 -0
- package/dist/templates/trae/agents/trellis-implement.md +108 -0
- package/dist/templates/trae/agents/trellis-research.md +137 -0
- package/dist/templates/trae/hooks.json +39 -0
- package/dist/templates/trae/index.d.ts +15 -0
- package/dist/templates/trae/index.d.ts.map +1 -0
- package/dist/templates/trae/index.js +15 -0
- package/dist/templates/trae/index.js.map +1 -0
- package/dist/templates/trellis/agents/check.md +70 -0
- package/dist/templates/trellis/agents/implement.md +81 -0
- package/dist/templates/trellis/config.yaml +205 -0
- package/dist/templates/trellis/gitattributes.txt +9 -0
- package/dist/templates/trellis/gitignore.txt +32 -0
- package/dist/templates/trellis/index.d.ts +70 -0
- package/dist/templates/trellis/index.d.ts.map +1 -0
- package/dist/templates/trellis/index.js +127 -0
- package/dist/templates/trellis/index.js.map +1 -0
- package/dist/templates/trellis/scripts/__init__.py +5 -0
- package/dist/templates/trellis/scripts/add_session.py +681 -0
- package/dist/templates/trellis/scripts/common/__init__.py +92 -0
- package/dist/templates/trellis/scripts/common/active_task.py +787 -0
- package/dist/templates/trellis/scripts/common/cli_adapter.py +982 -0
- package/dist/templates/trellis/scripts/common/config.py +587 -0
- package/dist/templates/trellis/scripts/common/developer.py +190 -0
- package/dist/templates/trellis/scripts/common/git.py +74 -0
- package/dist/templates/trellis/scripts/common/git_context.py +138 -0
- package/dist/templates/trellis/scripts/common/io.py +61 -0
- package/dist/templates/trellis/scripts/common/log.py +45 -0
- package/dist/templates/trellis/scripts/common/packages_context.py +238 -0
- package/dist/templates/trellis/scripts/common/paths.py +508 -0
- package/dist/templates/trellis/scripts/common/safe_commit.py +315 -0
- package/dist/templates/trellis/scripts/common/session_context.py +892 -0
- package/dist/templates/trellis/scripts/common/spec_inject.py +439 -0
- package/dist/templates/trellis/scripts/common/spec_match.py +395 -0
- package/dist/templates/trellis/scripts/common/task_context.py +372 -0
- package/dist/templates/trellis/scripts/common/task_queue.py +188 -0
- package/dist/templates/trellis/scripts/common/task_store.py +1016 -0
- package/dist/templates/trellis/scripts/common/task_utils.py +309 -0
- package/dist/templates/trellis/scripts/common/tasks.py +112 -0
- package/dist/templates/trellis/scripts/common/trellis_config.py +132 -0
- package/dist/templates/trellis/scripts/common/types.py +110 -0
- package/dist/templates/trellis/scripts/common/workflow_phase.py +243 -0
- package/dist/templates/trellis/scripts/common/workflow_selection.py +177 -0
- package/dist/templates/trellis/scripts/get_context.py +16 -0
- package/dist/templates/trellis/scripts/get_developer.py +26 -0
- package/dist/templates/trellis/scripts/hooks/linear_sync.py +243 -0
- package/dist/templates/trellis/scripts/init_developer.py +51 -0
- package/dist/templates/trellis/scripts/task.py +694 -0
- package/dist/templates/trellis/tasks/.gitkeep +0 -0
- package/dist/templates/trellis/workflow.md +777 -0
- package/dist/templates/zcode/agents/trellis-check.md +110 -0
- package/dist/templates/zcode/agents/trellis-implement.md +116 -0
- package/dist/templates/zcode/agents/trellis-research.md +133 -0
- package/dist/templates/zcode/config.json +52 -0
- package/dist/templates/zcode/index.d.ts +25 -0
- package/dist/templates/zcode/index.d.ts.map +1 -0
- package/dist/templates/zcode/index.js +29 -0
- package/dist/templates/zcode/index.js.map +1 -0
- package/dist/types/ai-tools.d.ts +95 -0
- package/dist/types/ai-tools.d.ts.map +1 -0
- package/dist/types/ai-tools.js +509 -0
- package/dist/types/ai-tools.js.map +1 -0
- package/dist/types/migration.d.ts +125 -0
- package/dist/types/migration.d.ts.map +1 -0
- package/dist/types/migration.js +8 -0
- package/dist/types/migration.js.map +1 -0
- package/dist/utils/agent-refs.d.ts +31 -0
- package/dist/utils/agent-refs.d.ts.map +1 -0
- package/dist/utils/agent-refs.js +63 -0
- package/dist/utils/agent-refs.js.map +1 -0
- package/dist/utils/atomic-write.d.ts +12 -0
- package/dist/utils/atomic-write.d.ts.map +1 -0
- package/dist/utils/atomic-write.js +30 -0
- package/dist/utils/atomic-write.js.map +1 -0
- package/dist/utils/compare-versions.d.ts +12 -0
- package/dist/utils/compare-versions.d.ts.map +1 -0
- package/dist/utils/compare-versions.js +86 -0
- package/dist/utils/compare-versions.js.map +1 -0
- package/dist/utils/cwd-guard.d.ts +38 -0
- package/dist/utils/cwd-guard.d.ts.map +1 -0
- package/dist/utils/cwd-guard.js +62 -0
- package/dist/utils/cwd-guard.js.map +1 -0
- package/dist/utils/file-writer.d.ts +36 -0
- package/dist/utils/file-writer.d.ts.map +1 -0
- package/dist/utils/file-writer.js +204 -0
- package/dist/utils/file-writer.js.map +1 -0
- package/dist/utils/manifest-prune.d.ts +61 -0
- package/dist/utils/manifest-prune.d.ts.map +1 -0
- package/dist/utils/manifest-prune.js +136 -0
- package/dist/utils/manifest-prune.js.map +1 -0
- package/dist/utils/posix.d.ts +13 -0
- package/dist/utils/posix.d.ts.map +1 -0
- package/dist/utils/posix.js +15 -0
- package/dist/utils/posix.js.map +1 -0
- package/dist/utils/project-detector.d.ts +46 -0
- package/dist/utils/project-detector.d.ts.map +1 -0
- package/dist/utils/project-detector.js +666 -0
- package/dist/utils/project-detector.js.map +1 -0
- package/dist/utils/proxy.d.ts +25 -0
- package/dist/utils/proxy.d.ts.map +1 -0
- package/dist/utils/proxy.js +60 -0
- package/dist/utils/proxy.js.map +1 -0
- package/dist/utils/registry-config.d.ts +7 -0
- package/dist/utils/registry-config.d.ts.map +1 -0
- package/dist/utils/registry-config.js +172 -0
- package/dist/utils/registry-config.js.map +1 -0
- package/dist/utils/task-json.d.ts +13 -0
- package/dist/utils/task-json.d.ts.map +1 -0
- package/dist/utils/task-json.js +12 -0
- package/dist/utils/task-json.js.map +1 -0
- package/dist/utils/template-fetcher.d.ts +161 -0
- package/dist/utils/template-fetcher.d.ts.map +1 -0
- package/dist/utils/template-fetcher.js +994 -0
- package/dist/utils/template-fetcher.js.map +1 -0
- package/dist/utils/template-hash.d.ts +123 -0
- package/dist/utils/template-hash.d.ts.map +1 -0
- package/dist/utils/template-hash.js +335 -0
- package/dist/utils/template-hash.js.map +1 -0
- package/dist/utils/uninstall-scrubbers.d.ts +67 -0
- package/dist/utils/uninstall-scrubbers.d.ts.map +1 -0
- package/dist/utils/uninstall-scrubbers.js +361 -0
- package/dist/utils/uninstall-scrubbers.js.map +1 -0
- package/dist/utils/workflow-resolver.d.ts +86 -0
- package/dist/utils/workflow-resolver.d.ts.map +1 -0
- package/dist/utils/workflow-resolver.js +265 -0
- package/dist/utils/workflow-resolver.js.map +1 -0
- package/package.json +89 -0
|
@@ -0,0 +1,501 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Trellis per-turn breadcrumb hook (UserPromptSubmit / BeforeAgent equivalent).
|
|
3
|
+
|
|
4
|
+
Runs on every user prompt. Resolves the active task through Trellis'
|
|
5
|
+
session-aware active task resolver and emits a short <workflow-state>
|
|
6
|
+
block reminding the main AI what task is active and its expected flow.
|
|
7
|
+
|
|
8
|
+
The emitted ``hookEventName`` field is platform-aware: most hosts expect
|
|
9
|
+
``UserPromptSubmit`` (Claude Code naming, also accepted by Cursor / Qoder /
|
|
10
|
+
CodeBuddy / Droid / Codex / Copilot wiring), but Gemini CLI 0.40.x renamed
|
|
11
|
+
its per-turn event to ``BeforeAgent`` and its schema validator rejects the
|
|
12
|
+
legacy name. ``_detect_platform`` picks the right value at runtime.
|
|
13
|
+
Breadcrumb text is pulled exclusively from the resolved workflow file's
|
|
14
|
+
[workflow-state:STATUS] tag blocks — the active task may select a
|
|
15
|
+
per-task variant (`.trellis/workflows/<id>.md` via task.json `workflow`),
|
|
16
|
+
otherwise personal, team, and global defaults are resolved in order.
|
|
17
|
+
There are no fallback dicts in this script: when the resolved workflow is
|
|
18
|
+
missing or a tag is absent, the breadcrumb degrades to a generic
|
|
19
|
+
"Refer to workflow.md for current step." line so users see (and fix)
|
|
20
|
+
the broken state instead of the hook silently masking it.
|
|
21
|
+
|
|
22
|
+
Which platforms register this hook is decided by SHARED_HOOKS_BY_PLATFORM
|
|
23
|
+
in templates/shared-hooks/index.ts — currently Claude, Codex, Gemini,
|
|
24
|
+
Qoder, Copilot, CodeBuddy, Droid, Kiro, Trae and ZCode. That table is the
|
|
25
|
+
source of truth; each listed platform's collect<Platform>Templates() pulls
|
|
26
|
+
this file into its template map through collectSharedHooks(), and a single
|
|
27
|
+
writer puts that map on disk at init time. Kiro wires this via the CLI
|
|
28
|
+
custom agent's ``hooks.userPromptSubmit`` and the IDE ``.kiro.hook``
|
|
29
|
+
``promptSubmit`` event; its output branch emits a plain-text breadcrumb
|
|
30
|
+
(Kiro adds hook stdout directly to the conversation context).
|
|
31
|
+
|
|
32
|
+
Silent exit 0 cases (no output):
|
|
33
|
+
- No .trellis/ directory found (not a Trellis project)
|
|
34
|
+
- task.json malformed or missing status
|
|
35
|
+
"""
|
|
36
|
+
from __future__ import annotations
|
|
37
|
+
|
|
38
|
+
import json
|
|
39
|
+
import os
|
|
40
|
+
import re
|
|
41
|
+
import sys
|
|
42
|
+
import queue
|
|
43
|
+
import threading
|
|
44
|
+
from pathlib import Path
|
|
45
|
+
|
|
46
|
+
# Force UTF-8 on stdin/stdout/stderr on Windows. Default codepage there is
|
|
47
|
+
# cp936 / cp1252 / etc. — non-ASCII content (Chinese task names, prd snippets)
|
|
48
|
+
# both in stdin (hook payload from host CLI) and stdout (our emitted blocks)
|
|
49
|
+
# raises UnicodeDecodeError / UnicodeEncodeError. Equivalent to `python -X utf8`
|
|
50
|
+
# but applied per-stream so we don't depend on host CLI's command wiring.
|
|
51
|
+
if sys.platform.startswith("win"):
|
|
52
|
+
import io as _io
|
|
53
|
+
for _stream_name in ("stdin", "stdout", "stderr"):
|
|
54
|
+
_stream = getattr(sys, _stream_name, None)
|
|
55
|
+
if _stream is None:
|
|
56
|
+
continue
|
|
57
|
+
if hasattr(_stream, "reconfigure"):
|
|
58
|
+
try:
|
|
59
|
+
_stream.reconfigure(encoding="utf-8", errors="replace") # type: ignore[union-attr]
|
|
60
|
+
except Exception:
|
|
61
|
+
pass # Optional Windows stream setup; keep hook startup non-fatal.
|
|
62
|
+
elif hasattr(_stream, "detach"):
|
|
63
|
+
try:
|
|
64
|
+
setattr(sys, _stream_name, _io.TextIOWrapper(_stream.detach(), encoding="utf-8", errors="replace"))
|
|
65
|
+
except Exception:
|
|
66
|
+
pass # Optional Windows stream setup; keep hook startup non-fatal.
|
|
67
|
+
from typing import Optional
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
# Bootstrap notice for Codex while the session has no active task. Codex does not
|
|
71
|
+
# get the full SessionStart overview; this short reminder points the main session
|
|
72
|
+
# at the start skill once and leaves the per-turn state block compact.
|
|
73
|
+
CODEX_NO_TASK_BOOTSTRAP_NOTICE = """<trellis-bootstrap>
|
|
74
|
+
If you have not already loaded Trellis context this session, read the `trellis-start` skill once.
|
|
75
|
+
</trellis-bootstrap>"""
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
# ---------------------------------------------------------------------------
|
|
79
|
+
# CWD-robust Trellis root discovery (fixes hook-path-robustness for this hook)
|
|
80
|
+
# ---------------------------------------------------------------------------
|
|
81
|
+
|
|
82
|
+
def find_trellis_root(start: Path) -> Optional[Path]:
|
|
83
|
+
"""Walk up from start to find directory containing .trellis/.
|
|
84
|
+
|
|
85
|
+
Handles CWD drift: subdirectory launches, monorepo packages, etc.
|
|
86
|
+
Returns None if no .trellis/ found (silent no-op).
|
|
87
|
+
"""
|
|
88
|
+
cur = start.resolve()
|
|
89
|
+
while cur != cur.parent:
|
|
90
|
+
if (cur / ".trellis").is_dir():
|
|
91
|
+
return cur
|
|
92
|
+
cur = cur.parent
|
|
93
|
+
return None
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
# ---------------------------------------------------------------------------
|
|
97
|
+
# Active task discovery
|
|
98
|
+
# ---------------------------------------------------------------------------
|
|
99
|
+
|
|
100
|
+
def _detect_platform(input_data: dict) -> str | None:
|
|
101
|
+
if isinstance(input_data.get("cursor_version"), str):
|
|
102
|
+
return "cursor"
|
|
103
|
+
# CLAUDE_PROJECT_DIR is a compatibility alias that several hosts set
|
|
104
|
+
# alongside their own variable — CodeBuddy, ZCode and Trae all do. It must
|
|
105
|
+
# therefore be checked LAST, or every one of them is detected as claude and
|
|
106
|
+
# the context key becomes `claude_<their-session-id>`. That key does not
|
|
107
|
+
# match the session file `task.py start` wrote under the host's real name,
|
|
108
|
+
# so every turn reports no_task while the pointer exists on disk.
|
|
109
|
+
# Observed on CodeBuddy IDE 4.10.4: session file `codebuddy_ae54840e….json`
|
|
110
|
+
# alongside marker `update-check-claude_ae54840e….marker`, same id.
|
|
111
|
+
env_map = {
|
|
112
|
+
"ZCODE_PROJECT_DIR": "zcode",
|
|
113
|
+
"CURSOR_PROJECT_DIR": "cursor",
|
|
114
|
+
"CODEBUDDY_PROJECT_DIR": "codebuddy",
|
|
115
|
+
"FACTORY_PROJECT_DIR": "droid",
|
|
116
|
+
"GEMINI_PROJECT_DIR": "gemini",
|
|
117
|
+
"QODER_PROJECT_DIR": "qoder",
|
|
118
|
+
"KIRO_PROJECT_DIR": "kiro",
|
|
119
|
+
"COPILOT_PROJECT_DIR": "copilot",
|
|
120
|
+
"TRAE_PROJECT_DIR": "trae",
|
|
121
|
+
# Last: the shared alias, only meaningful once no vendor key matched.
|
|
122
|
+
"CLAUDE_PROJECT_DIR": "claude",
|
|
123
|
+
}
|
|
124
|
+
for env_name, platform in env_map.items():
|
|
125
|
+
if os.environ.get(env_name):
|
|
126
|
+
return platform
|
|
127
|
+
script_parts = set(Path(sys.argv[0]).parts)
|
|
128
|
+
if ".claude" in script_parts:
|
|
129
|
+
return "claude"
|
|
130
|
+
if ".cursor" in script_parts:
|
|
131
|
+
return "cursor"
|
|
132
|
+
if ".codex" in script_parts:
|
|
133
|
+
return "codex"
|
|
134
|
+
if ".gemini" in script_parts:
|
|
135
|
+
return "gemini"
|
|
136
|
+
if ".qoder" in script_parts:
|
|
137
|
+
return "qoder"
|
|
138
|
+
if ".codebuddy" in script_parts:
|
|
139
|
+
return "codebuddy"
|
|
140
|
+
if ".factory" in script_parts:
|
|
141
|
+
return "droid"
|
|
142
|
+
if ".kiro" in script_parts:
|
|
143
|
+
return "kiro"
|
|
144
|
+
if ".trae" in script_parts:
|
|
145
|
+
return "trae"
|
|
146
|
+
if ".zcode" in script_parts:
|
|
147
|
+
return "zcode"
|
|
148
|
+
return None
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
def _resolve_active_task(root: Path, input_data: dict):
|
|
152
|
+
scripts_dir = root / ".trellis" / "scripts"
|
|
153
|
+
if str(scripts_dir) not in sys.path:
|
|
154
|
+
sys.path.insert(0, str(scripts_dir))
|
|
155
|
+
from common.active_task import resolve_active_task # type: ignore[import-not-found]
|
|
156
|
+
|
|
157
|
+
return resolve_active_task(root, input_data, platform=_detect_platform(input_data))
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
def get_active_task(root: Path, input_data: dict) -> Optional[tuple[str, str, str]]:
|
|
161
|
+
"""Return (task_id, status, source) from the current active task."""
|
|
162
|
+
active = _resolve_active_task(root, input_data)
|
|
163
|
+
if not active.task_path:
|
|
164
|
+
return None
|
|
165
|
+
|
|
166
|
+
task_dir = Path(active.task_path)
|
|
167
|
+
if not task_dir.is_absolute():
|
|
168
|
+
task_dir = root / task_dir
|
|
169
|
+
if active.stale:
|
|
170
|
+
return task_dir.name, f"stale_{active.source_type}", active.source
|
|
171
|
+
|
|
172
|
+
task_json = task_dir / "task.json"
|
|
173
|
+
if not task_json.is_file():
|
|
174
|
+
return None
|
|
175
|
+
try:
|
|
176
|
+
data = json.loads(task_json.read_text(encoding="utf-8"))
|
|
177
|
+
except (json.JSONDecodeError, OSError):
|
|
178
|
+
return None
|
|
179
|
+
|
|
180
|
+
task_id = data.get("id") or task_dir.name
|
|
181
|
+
status = data.get("status", "")
|
|
182
|
+
if not isinstance(status, str) or not status:
|
|
183
|
+
return None
|
|
184
|
+
return task_id, status, active.source
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
# ---------------------------------------------------------------------------
|
|
188
|
+
# Breadcrumb loading: parse workflow.md, fall back to hardcoded defaults
|
|
189
|
+
# ---------------------------------------------------------------------------
|
|
190
|
+
|
|
191
|
+
# Supports STATUS values with letters, digits, underscores, hyphens
|
|
192
|
+
# (so "in-review" / "blocked-by-team" work alongside "in_progress").
|
|
193
|
+
_TAG_RE = re.compile(
|
|
194
|
+
r"\[workflow-state:([A-Za-z0-9_-]+)\]\s*\n(.*?)\n\s*\[/workflow-state:\1\]",
|
|
195
|
+
re.DOTALL,
|
|
196
|
+
)
|
|
197
|
+
|
|
198
|
+
def _resolve_workflow_md(root: Path, input_data: dict) -> Path:
|
|
199
|
+
"""Resolve the active task's workflow file, falling back to the global one.
|
|
200
|
+
|
|
201
|
+
The per-task resolution rule lives in common.workflow_selection inside
|
|
202
|
+
.trellis/scripts. Older installed projects may not ship that module, and
|
|
203
|
+
hooks must never crash the session — ANY failure (import error, old
|
|
204
|
+
scripts tree, resolver bug) falls back to the global workflow.md.
|
|
205
|
+
"""
|
|
206
|
+
try:
|
|
207
|
+
scripts_dir = root / ".trellis" / "scripts"
|
|
208
|
+
if str(scripts_dir) not in sys.path:
|
|
209
|
+
sys.path.insert(0, str(scripts_dir))
|
|
210
|
+
from common.workflow_selection import resolve_workflow_md # type: ignore[import-not-found]
|
|
211
|
+
|
|
212
|
+
return resolve_workflow_md(
|
|
213
|
+
root, input_data, platform=_detect_platform(input_data)
|
|
214
|
+
)
|
|
215
|
+
except Exception:
|
|
216
|
+
return root / ".trellis" / "workflow.md"
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
def load_breadcrumbs(root: Path, input_data: dict) -> dict[str, str]:
|
|
220
|
+
"""Parse the resolved workflow file for [workflow-state:STATUS] blocks.
|
|
221
|
+
|
|
222
|
+
Returns {status: body_text}. The workflow file is the single source of
|
|
223
|
+
truth — there are no fallback dicts in this script. Missing tags
|
|
224
|
+
(or a missing/unreadable workflow file) fall back to a generic line
|
|
225
|
+
in build_breadcrumb so users see the broken state and fix
|
|
226
|
+
workflow.md, rather than the hook silently masking the issue.
|
|
227
|
+
The active task's per-task workflow selection (task.json `workflow`
|
|
228
|
+
field) is honored via _resolve_workflow_md; without a selection this
|
|
229
|
+
reads the global .trellis/workflow.md exactly as before.
|
|
230
|
+
"""
|
|
231
|
+
workflow = _resolve_workflow_md(root, input_data)
|
|
232
|
+
if not workflow.is_file():
|
|
233
|
+
return {}
|
|
234
|
+
try:
|
|
235
|
+
content = workflow.read_text(encoding="utf-8")
|
|
236
|
+
except OSError:
|
|
237
|
+
return {}
|
|
238
|
+
|
|
239
|
+
result: dict[str, str] = {}
|
|
240
|
+
for match in _TAG_RE.finditer(content):
|
|
241
|
+
status = match.group(1)
|
|
242
|
+
body = match.group(2).strip()
|
|
243
|
+
if body:
|
|
244
|
+
result[status] = body
|
|
245
|
+
return result
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
def _read_trellis_config(root: Path) -> dict:
|
|
249
|
+
"""Load .trellis/config.yaml via the bundled trellis_config helper.
|
|
250
|
+
|
|
251
|
+
The helper lives in .trellis/scripts/common; the hook lives outside the
|
|
252
|
+
scripts tree, so we extend sys.path before importing.
|
|
253
|
+
"""
|
|
254
|
+
scripts_dir = root / ".trellis" / "scripts"
|
|
255
|
+
if str(scripts_dir) not in sys.path:
|
|
256
|
+
sys.path.insert(0, str(scripts_dir))
|
|
257
|
+
try:
|
|
258
|
+
from common.trellis_config import read_trellis_config # type: ignore[import-not-found]
|
|
259
|
+
except Exception:
|
|
260
|
+
return {}
|
|
261
|
+
try:
|
|
262
|
+
return read_trellis_config(root)
|
|
263
|
+
except Exception:
|
|
264
|
+
return {}
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
DEFAULT_PROMPT_INJECTION_SKIP_KEYWORD = "no-trellis"
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
def _resolve_skip_keyword(config: dict) -> str:
|
|
271
|
+
"""Read `prompt_injection.skip_keyword` from parsed .trellis/config.yaml.
|
|
272
|
+
|
|
273
|
+
Mirrors `common.config.get_prompt_injection_config()`. Defaults to
|
|
274
|
+
"no-trellis"; "" disables the escape hatch entirely. A non-string value
|
|
275
|
+
falls back to the default.
|
|
276
|
+
"""
|
|
277
|
+
if isinstance(config, dict):
|
|
278
|
+
section = config.get("prompt_injection")
|
|
279
|
+
if isinstance(section, dict):
|
|
280
|
+
raw = section.get("skip_keyword", DEFAULT_PROMPT_INJECTION_SKIP_KEYWORD)
|
|
281
|
+
if isinstance(raw, str):
|
|
282
|
+
return raw
|
|
283
|
+
return DEFAULT_PROMPT_INJECTION_SKIP_KEYWORD
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
def prompt_has_skip_keyword(prompt: str, keyword: str) -> bool:
|
|
287
|
+
"""Case-insensitive, word-boundary match of `keyword` in `prompt`.
|
|
288
|
+
|
|
289
|
+
Hyphen counts as a word char so "no-trellisx" / "xno-trellis" /
|
|
290
|
+
"foo-no-trellis" don't match, but punctuation/whitespace boundaries do.
|
|
291
|
+
Empty keyword never matches (disables the escape hatch).
|
|
292
|
+
"""
|
|
293
|
+
if not keyword or not isinstance(prompt, str):
|
|
294
|
+
return False
|
|
295
|
+
pattern = r"(?<![\w-])" + re.escape(keyword) + r"(?![\w-])"
|
|
296
|
+
return re.search(pattern, prompt, re.IGNORECASE) is not None
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
def _resolve_codex_dispatch_mode(config: dict) -> str:
|
|
300
|
+
"""Normalize `codex.dispatch_mode` from .trellis/config.yaml to "auto" or "inline".
|
|
301
|
+
|
|
302
|
+
Defaults to `auto`. The legacy `sub-agent` value is an alias for `auto`.
|
|
303
|
+
Any other explicit value (including invalid ones) falls back to `inline`
|
|
304
|
+
without per-turn warnings. Shared by `_codex_mode_banner` (the per-turn
|
|
305
|
+
banner) and `resolve_breadcrumb_key` (the breadcrumb tag key) so the two
|
|
306
|
+
stay in lockstep.
|
|
307
|
+
"""
|
|
308
|
+
mode = "auto"
|
|
309
|
+
if isinstance(config, dict):
|
|
310
|
+
codex_cfg = config.get("codex")
|
|
311
|
+
if isinstance(codex_cfg, dict):
|
|
312
|
+
cfg_mode = str(codex_cfg.get("dispatch_mode", mode)).strip().lower()
|
|
313
|
+
if cfg_mode == "inline":
|
|
314
|
+
mode = "inline"
|
|
315
|
+
elif cfg_mode in ("auto", "sub-agent"):
|
|
316
|
+
mode = "auto"
|
|
317
|
+
else:
|
|
318
|
+
mode = "inline"
|
|
319
|
+
return mode
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
def _codex_mode_banner(config: dict) -> str:
|
|
323
|
+
"""Emit a `<codex-mode>` banner for the additionalContext payload.
|
|
324
|
+
|
|
325
|
+
Reads `codex.dispatch_mode` from .trellis/config.yaml; defaults to
|
|
326
|
+
`auto`, which dispatches Trellis sub-agents using native Codex context
|
|
327
|
+
injection with a child-side fallback. This does not rely on inherited
|
|
328
|
+
parent transcripts: `fork_turns` remains caller-controlled, and
|
|
329
|
+
fresh-history sub-agents still receive their explicit delegated task and
|
|
330
|
+
inherited session configuration. `inline` is an explicit opt-out; the
|
|
331
|
+
legacy `sub-agent` value is an alias for `auto`. Invalid explicit values
|
|
332
|
+
fall back to `inline` without per-turn warnings. The banner makes the
|
|
333
|
+
active mode explicit to Codex AI per turn, complementing the workflow-state
|
|
334
|
+
body which is per-status. Mode tells AI which dispatch protocol to follow;
|
|
335
|
+
workflow-state tells AI what step it's at.
|
|
336
|
+
"""
|
|
337
|
+
mode = _resolve_codex_dispatch_mode(config)
|
|
338
|
+
if mode == "auto":
|
|
339
|
+
meaning = (
|
|
340
|
+
"auto: implement/check work defaults to Trellis sub-agents; native Codex "
|
|
341
|
+
"context injection is preferred and child-side loading is the fallback. "
|
|
342
|
+
"The main session still coordinates, clarifies, updates specs, commits, and finishes."
|
|
343
|
+
)
|
|
344
|
+
else:
|
|
345
|
+
meaning = (
|
|
346
|
+
"inline: the main session implements/checks directly; "
|
|
347
|
+
"do not dispatch implement/check sub-agents."
|
|
348
|
+
)
|
|
349
|
+
return f"<codex-mode>{meaning}</codex-mode>"
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
def resolve_breadcrumb_key(
|
|
353
|
+
status: str, platform: str | None, config: dict
|
|
354
|
+
) -> str:
|
|
355
|
+
"""Pick the breadcrumb tag key based on Codex dispatch_mode.
|
|
356
|
+
|
|
357
|
+
Codex defaults to ``auto`` and therefore uses the ordinary ``<status>``
|
|
358
|
+
breadcrumb for native SubagentStart dispatch with child-side fallback;
|
|
359
|
+
it does not depend on an inherited parent transcript. ``inline`` selects
|
|
360
|
+
the parallel ``<status>-inline`` tag; ``sub-agent`` remains an alias for
|
|
361
|
+
``auto``. Invalid explicit values fall back to inline without per-turn
|
|
362
|
+
warnings.
|
|
363
|
+
|
|
364
|
+
Non-codex platforms return the plain status unchanged.
|
|
365
|
+
"""
|
|
366
|
+
if platform == "codex":
|
|
367
|
+
mode = _resolve_codex_dispatch_mode(config)
|
|
368
|
+
return f"{status}-inline" if mode == "inline" else status
|
|
369
|
+
return status
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
def build_breadcrumb(
|
|
373
|
+
task_id: Optional[str],
|
|
374
|
+
status: str,
|
|
375
|
+
templates: dict[str, str],
|
|
376
|
+
source: str | None = None,
|
|
377
|
+
breadcrumb_key: str | None = None,
|
|
378
|
+
) -> str:
|
|
379
|
+
"""Build the <workflow-state>...</workflow-state> block.
|
|
380
|
+
|
|
381
|
+
- Known status (tag present in workflow.md) → detailed template body
|
|
382
|
+
- Unknown status (no tag, or workflow.md missing) → generic
|
|
383
|
+
"Refer to workflow.md for current step." line
|
|
384
|
+
- `no_task` pseudo-status (task_id is None) → header omits task info
|
|
385
|
+
"""
|
|
386
|
+
lookup_key = breadcrumb_key or status
|
|
387
|
+
body = templates.get(lookup_key)
|
|
388
|
+
if body is None and lookup_key != status:
|
|
389
|
+
body = templates.get(status)
|
|
390
|
+
if body is None:
|
|
391
|
+
body = "Refer to workflow.md for current step."
|
|
392
|
+
header = f"Status: {status}" if task_id is None else f"Task: {task_id} ({status})"
|
|
393
|
+
return f"<workflow-state>\n{header}\n{body}\n</workflow-state>"
|
|
394
|
+
|
|
395
|
+
|
|
396
|
+
# ---------------------------------------------------------------------------
|
|
397
|
+
# Entry
|
|
398
|
+
# ---------------------------------------------------------------------------
|
|
399
|
+
|
|
400
|
+
def _load_hook_input() -> dict:
|
|
401
|
+
"""Read hook JSON without trusting host runners to close stdin.
|
|
402
|
+
|
|
403
|
+
Kiro IDE `runCommand` and similar hook runners can leave stdin open while
|
|
404
|
+
sending no payload. A plain `json.load(sys.stdin)` then blocks forever.
|
|
405
|
+
Normal hook runners write the complete JSON payload and close stdin, so the
|
|
406
|
+
short daemon read preserves that path while failing closed to `{}` for
|
|
407
|
+
non-piping hosts.
|
|
408
|
+
"""
|
|
409
|
+
result_queue: "queue.Queue[str | Exception]" = queue.Queue(maxsize=1)
|
|
410
|
+
|
|
411
|
+
def _read() -> None:
|
|
412
|
+
try:
|
|
413
|
+
result_queue.put(sys.stdin.read())
|
|
414
|
+
except Exception as exc:
|
|
415
|
+
result_queue.put(exc)
|
|
416
|
+
|
|
417
|
+
reader = threading.Thread(target=_read, daemon=True)
|
|
418
|
+
reader.start()
|
|
419
|
+
try:
|
|
420
|
+
raw = result_queue.get(timeout=0.2)
|
|
421
|
+
except queue.Empty:
|
|
422
|
+
return {}
|
|
423
|
+
|
|
424
|
+
if isinstance(raw, Exception):
|
|
425
|
+
return {}
|
|
426
|
+
try:
|
|
427
|
+
data = json.loads(raw) if raw.strip() else {}
|
|
428
|
+
except (json.JSONDecodeError, ValueError):
|
|
429
|
+
return {}
|
|
430
|
+
return data if isinstance(data, dict) else {}
|
|
431
|
+
|
|
432
|
+
|
|
433
|
+
def main() -> int:
|
|
434
|
+
if os.environ.get("TRELLIS_HOOKS") == "0" or os.environ.get("TRELLIS_DISABLE_HOOKS") == "1":
|
|
435
|
+
return 0
|
|
436
|
+
|
|
437
|
+
data = _load_hook_input()
|
|
438
|
+
|
|
439
|
+
cwd_str = data.get("cwd") or os.getcwd()
|
|
440
|
+
cwd = Path(cwd_str)
|
|
441
|
+
|
|
442
|
+
root = find_trellis_root(cwd)
|
|
443
|
+
if root is None:
|
|
444
|
+
return 0 # not a Trellis project
|
|
445
|
+
|
|
446
|
+
config = _read_trellis_config(root)
|
|
447
|
+
if prompt_has_skip_keyword(data.get("prompt", ""), _resolve_skip_keyword(config)):
|
|
448
|
+
return 0 # user opted out of the per-turn breadcrumb for this turn
|
|
449
|
+
|
|
450
|
+
templates = load_breadcrumbs(root, data)
|
|
451
|
+
platform = _detect_platform(data)
|
|
452
|
+
task = get_active_task(root, data)
|
|
453
|
+
if task is None:
|
|
454
|
+
# No active task — still emit a breadcrumb nudging AI toward
|
|
455
|
+
# trellis-brainstorm + task.py create when user describes real work.
|
|
456
|
+
no_task_key = resolve_breadcrumb_key("no_task", platform, config)
|
|
457
|
+
breadcrumb = build_breadcrumb(
|
|
458
|
+
None, "no_task", templates, breadcrumb_key=no_task_key
|
|
459
|
+
)
|
|
460
|
+
else:
|
|
461
|
+
task_id, status, source = task
|
|
462
|
+
status_key = resolve_breadcrumb_key(status, platform, config)
|
|
463
|
+
source_for_breadcrumb = None if platform == "codex" else source
|
|
464
|
+
breadcrumb = build_breadcrumb(
|
|
465
|
+
task_id, status, templates, source_for_breadcrumb, breadcrumb_key=status_key
|
|
466
|
+
)
|
|
467
|
+
if platform == "codex":
|
|
468
|
+
parts: list[str] = []
|
|
469
|
+
if task is None:
|
|
470
|
+
parts.append(CODEX_NO_TASK_BOOTSTRAP_NOTICE)
|
|
471
|
+
parts.append(_codex_mode_banner(config))
|
|
472
|
+
parts.append(breadcrumb)
|
|
473
|
+
breadcrumb = "\n\n".join(parts)
|
|
474
|
+
|
|
475
|
+
# Kiro (CLI userPromptSubmit / IDE promptSubmit) adds a hook's stdout
|
|
476
|
+
# directly to the conversation context — no JSON envelope. Emit the bare
|
|
477
|
+
# breadcrumb text. Conditionally isolated: all other platforms keep the
|
|
478
|
+
# hookSpecificOutput JSON path below unchanged.
|
|
479
|
+
if platform == "kiro":
|
|
480
|
+
print(breadcrumb)
|
|
481
|
+
return 0
|
|
482
|
+
|
|
483
|
+
# Gemini CLI 0.40.x rejects "UserPromptSubmit" — its per-turn event is
|
|
484
|
+
# named "BeforeAgent". Other platforms (Claude/Cursor/Qoder/CodeBuddy/
|
|
485
|
+
# Droid/Codex/Copilot) accept the original Claude-style name.
|
|
486
|
+
hook_event_name = (
|
|
487
|
+
"BeforeAgent" if platform == "gemini" else "UserPromptSubmit"
|
|
488
|
+
)
|
|
489
|
+
|
|
490
|
+
output = {
|
|
491
|
+
"hookSpecificOutput": {
|
|
492
|
+
"hookEventName": hook_event_name,
|
|
493
|
+
"additionalContext": breadcrumb,
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
print(json.dumps(output))
|
|
497
|
+
return 0
|
|
498
|
+
|
|
499
|
+
|
|
500
|
+
if __name__ == "__main__":
|
|
501
|
+
sys.exit(main())
|