@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,592 @@
|
|
|
1
|
+
import type { ExtensionAPI } from "@oh-my-pi/pi-coding-agent";
|
|
2
|
+
import { existsSync, lstatSync, readFileSync, readdirSync, realpathSync } from "node:fs";
|
|
3
|
+
import { join, dirname, isAbsolute, relative, resolve } from "node:path";
|
|
4
|
+
import { spawnSync } from "node:child_process";
|
|
5
|
+
import { createHash } from "node:crypto";
|
|
6
|
+
|
|
7
|
+
// ---------------------------------------------------------------------------
|
|
8
|
+
// Project root detection
|
|
9
|
+
// ---------------------------------------------------------------------------
|
|
10
|
+
|
|
11
|
+
function findProjectRoot(startDir: string): string | null {
|
|
12
|
+
let current = startDir;
|
|
13
|
+
while (true) {
|
|
14
|
+
if (existsSync(join(current, ".trellis"))) return current;
|
|
15
|
+
const parent = dirname(current);
|
|
16
|
+
if (parent === current) break;
|
|
17
|
+
current = parent;
|
|
18
|
+
}
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// ---------------------------------------------------------------------------
|
|
23
|
+
// Session identity helpers (mirrors Python _sanitize_key / _hash_value / _context_key)
|
|
24
|
+
// ---------------------------------------------------------------------------
|
|
25
|
+
|
|
26
|
+
function sanitizeKey(raw: string): string {
|
|
27
|
+
const safe = raw.trim().replace(/[^A-Za-z0-9._-]+/g, "_").replace(/^[._-]+|[._-]+$/g, "");
|
|
28
|
+
return safe ? safe.slice(0, 160) : "";
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function hashValue(raw: string): string {
|
|
32
|
+
return createHash("sha256").update(raw).digest("hex").slice(0, 24);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function buildContextKey(platformName: string, kind: string, value: string): string {
|
|
36
|
+
if (kind === "transcript") {
|
|
37
|
+
return `${platformName}_transcript_${hashValue(value)}`;
|
|
38
|
+
}
|
|
39
|
+
const safeValue = sanitizeKey(value);
|
|
40
|
+
return safeValue ? `${platformName}_${safeValue}` : `${platformName}_${hashValue(value)}`;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function deriveContextKey(ctx?: { sessionManager?: { getSessionId?: () => string | undefined; getSessionFile?: () => string | undefined } }): string | null {
|
|
44
|
+
const sessionId = ctx?.sessionManager?.getSessionId?.();
|
|
45
|
+
if (sessionId) {
|
|
46
|
+
return buildContextKey("omp", "session", sessionId);
|
|
47
|
+
}
|
|
48
|
+
const sessionFile = ctx?.sessionManager?.getSessionFile?.();
|
|
49
|
+
if (sessionFile) {
|
|
50
|
+
return buildContextKey("omp", "transcript", sessionFile);
|
|
51
|
+
}
|
|
52
|
+
const override = process.env.TRELLIS_CONTEXT_ID?.trim();
|
|
53
|
+
return override ? sanitizeKey(override) || hashValue(override) : null;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function isInsideRoot(root: string, candidate: string): boolean {
|
|
57
|
+
const rel = relative(root, candidate);
|
|
58
|
+
return rel === "" || (rel !== ".." && !rel.startsWith("../") && !rel.startsWith("..\\") && !isAbsolute(rel));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// ---------------------------------------------------------------------------
|
|
62
|
+
// Trusted context roots (mirrors packages/cli/src/commands/channel/context-trust.ts;
|
|
63
|
+
// standalone copy since templates don't import from the CLI package).
|
|
64
|
+
// ---------------------------------------------------------------------------
|
|
65
|
+
|
|
66
|
+
const AUTO_TRUST_ENTRIES = ["tasks", "workspace"];
|
|
67
|
+
|
|
68
|
+
function stripTrustValue(s: string): string {
|
|
69
|
+
return s.trim().replace(/\s*#.*$/, "").trim().replace(/^['"]|['"]$/g, "");
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function parseChannelTrustSection(content: string): { trustedDirs: string[]; autoTrustSymlinks?: boolean } {
|
|
73
|
+
const lines = content.split("\n");
|
|
74
|
+
const trustedDirs: string[] = [];
|
|
75
|
+
let autoTrustSymlinks: boolean | undefined;
|
|
76
|
+
let inChannel = false;
|
|
77
|
+
let inList = false;
|
|
78
|
+
|
|
79
|
+
for (const raw of lines) {
|
|
80
|
+
const line = raw.replace(/\r$/, "");
|
|
81
|
+
const trimmed = line.trimEnd();
|
|
82
|
+
if (trimmed.trim().startsWith("#")) continue;
|
|
83
|
+
|
|
84
|
+
if (/^channel:\s*$/.test(trimmed)) {
|
|
85
|
+
inChannel = true;
|
|
86
|
+
inList = false;
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
if (!inChannel) continue;
|
|
90
|
+
|
|
91
|
+
if (trimmed.trim() !== "" && /^\S/.test(line)) {
|
|
92
|
+
inChannel = false;
|
|
93
|
+
inList = false;
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
if (trimmed.trim() === "") continue;
|
|
97
|
+
|
|
98
|
+
if (inList) {
|
|
99
|
+
const item = trimmed.match(/^ {4}-\s*(.+)$/);
|
|
100
|
+
if (item) {
|
|
101
|
+
const val = stripTrustValue(item[1]!);
|
|
102
|
+
if (val) trustedDirs.push(val);
|
|
103
|
+
continue;
|
|
104
|
+
}
|
|
105
|
+
inList = false;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if (/^ {2}trusted_context_dirs:\s*$/.test(trimmed)) {
|
|
109
|
+
inList = true;
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const boolMatch = trimmed.match(/^ {2}auto_trust_trellis_symlinks:\s*(.+)$/);
|
|
114
|
+
if (boolMatch) {
|
|
115
|
+
const val = stripTrustValue(boolMatch[1]!).toLowerCase();
|
|
116
|
+
if (val === "false") autoTrustSymlinks = false;
|
|
117
|
+
else if (val === "true") autoTrustSymlinks = true;
|
|
118
|
+
else process.stderr.write(`[channel] channel.auto_trust_trellis_symlinks: invalid value '${val}', ignoring\n`);
|
|
119
|
+
continue;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return { trustedDirs, autoTrustSymlinks };
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function resolveTrustedRoots(projectRoot: string): string[] {
|
|
127
|
+
const configPath = join(projectRoot, ".trellis", "config.yaml");
|
|
128
|
+
let config: { trustedDirs: string[]; autoTrustSymlinks?: boolean } = { trustedDirs: [] };
|
|
129
|
+
if (existsSync(configPath)) {
|
|
130
|
+
try {
|
|
131
|
+
config = parseChannelTrustSection(readFileSync(configPath, "utf-8"));
|
|
132
|
+
} catch {
|
|
133
|
+
// ignore
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
const roots: string[] = [];
|
|
138
|
+
for (const entry of config.trustedDirs) {
|
|
139
|
+
try {
|
|
140
|
+
roots.push(realpathSync(resolve(projectRoot, entry)));
|
|
141
|
+
} catch {
|
|
142
|
+
// entry not found or invalid — skip
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
if (config.autoTrustSymlinks !== false) {
|
|
147
|
+
for (const entryName of AUTO_TRUST_ENTRIES) {
|
|
148
|
+
const entryPath = join(projectRoot, ".trellis", entryName);
|
|
149
|
+
try {
|
|
150
|
+
if (lstatSync(entryPath).isSymbolicLink()) {
|
|
151
|
+
roots.push(realpathSync(entryPath));
|
|
152
|
+
}
|
|
153
|
+
} catch {
|
|
154
|
+
// missing / broken symlink — nothing to trust
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
return [...new Set(roots)];
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
function resolveProjectFile(
|
|
163
|
+
projectRoot: string,
|
|
164
|
+
file: string,
|
|
165
|
+
trustedRoots: string[],
|
|
166
|
+
): string | null {
|
|
167
|
+
try {
|
|
168
|
+
const rootReal = realpathSync(projectRoot);
|
|
169
|
+
const targetReal = realpathSync(resolve(projectRoot, file));
|
|
170
|
+
if (isInsideRoot(rootReal, targetReal)) return targetReal;
|
|
171
|
+
if (trustedRoots.some((root) => isInsideRoot(root, targetReal))) return targetReal;
|
|
172
|
+
return null;
|
|
173
|
+
} catch {
|
|
174
|
+
return null;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// ---------------------------------------------------------------------------
|
|
179
|
+
// Active task resolution
|
|
180
|
+
// ---------------------------------------------------------------------------
|
|
181
|
+
|
|
182
|
+
function resolveActiveTaskStatus(
|
|
183
|
+
projectRoot: string,
|
|
184
|
+
contextKey: string | null,
|
|
185
|
+
): { status: string; taskDir: string | null; taskTitle: string | null } {
|
|
186
|
+
const sessionsDir = join(projectRoot, ".trellis", ".runtime", "sessions");
|
|
187
|
+
if (!existsSync(sessionsDir)) return { status: "no_task", taskDir: null, taskTitle: null };
|
|
188
|
+
|
|
189
|
+
// --- 通过 context key 解析 session 文件 ---
|
|
190
|
+
let sessionFilePath: string | null = null;
|
|
191
|
+
|
|
192
|
+
if (contextKey) {
|
|
193
|
+
const candidate = join(sessionsDir, `${contextKey}.json`);
|
|
194
|
+
if (existsSync(candidate)) {
|
|
195
|
+
sessionFilePath = candidate;
|
|
196
|
+
} else {
|
|
197
|
+
return { status: "no_task", taskDir: null, taskTitle: null };
|
|
198
|
+
}
|
|
199
|
+
} else {
|
|
200
|
+
// No identity: use single-session fallback only when there is exactly one session file.
|
|
201
|
+
let sessionFiles: string[];
|
|
202
|
+
try {
|
|
203
|
+
sessionFiles = readdirSync(sessionsDir).filter((f) => f.endsWith(".json"));
|
|
204
|
+
} catch {
|
|
205
|
+
return { status: "no_task", taskDir: null, taskTitle: null };
|
|
206
|
+
}
|
|
207
|
+
if (sessionFiles.length === 1) {
|
|
208
|
+
sessionFilePath = join(sessionsDir, sessionFiles[0]);
|
|
209
|
+
} else {
|
|
210
|
+
return { status: "no_task", taskDir: null, taskTitle: null };
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
// --- 读取 session 数据 ---
|
|
215
|
+
let sessionData: Record<string, unknown>;
|
|
216
|
+
try {
|
|
217
|
+
sessionData = JSON.parse(readFileSync(sessionFilePath, "utf-8"));
|
|
218
|
+
} catch {
|
|
219
|
+
return { status: "no_task", taskDir: null, taskTitle: null };
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
const currentTask = sessionData.current_task;
|
|
223
|
+
if (typeof currentTask !== "string" || !currentTask)
|
|
224
|
+
return { status: "no_task", taskDir: null, taskTitle: null };
|
|
225
|
+
|
|
226
|
+
// Same jail the jsonl-referenced files already go through below. `task.py`
|
|
227
|
+
// now refuses to store a ref that leaves the project, but a session file
|
|
228
|
+
// written before that fix can still hold one, and `trellis update` does not
|
|
229
|
+
// rewrite session files — so a poisoned pointer outlives the upgrade that
|
|
230
|
+
// closed the writer.
|
|
231
|
+
const taskDir = resolveProjectFile(projectRoot, currentTask, resolveTrustedRoots(projectRoot));
|
|
232
|
+
if (!taskDir) return { status: "no_task", taskDir: null, taskTitle: null };
|
|
233
|
+
const taskJsonPath = join(taskDir, "task.json");
|
|
234
|
+
if (!existsSync(taskJsonPath)) return { status: "no_task", taskDir: null, taskTitle: null };
|
|
235
|
+
|
|
236
|
+
let taskData: Record<string, unknown>;
|
|
237
|
+
try {
|
|
238
|
+
taskData = JSON.parse(readFileSync(taskJsonPath, "utf-8"));
|
|
239
|
+
} catch {
|
|
240
|
+
return { status: "no_task", taskDir: null, taskTitle: null };
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
return {
|
|
244
|
+
status: typeof taskData.status === "string" ? taskData.status : "planning",
|
|
245
|
+
taskDir,
|
|
246
|
+
taskTitle: typeof taskData.title === "string" ? taskData.title : null,
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// ---------------------------------------------------------------------------
|
|
251
|
+
// Session context — spawns get_context.py default mode (same as Claude hook)
|
|
252
|
+
// ---------------------------------------------------------------------------
|
|
253
|
+
|
|
254
|
+
const SESSION_CONTEXT_TIMEOUT_MS = 5000;
|
|
255
|
+
|
|
256
|
+
function buildSessionContext(projectRoot: string, contextKey: string | null): string {
|
|
257
|
+
const script = join(projectRoot, ".trellis", "scripts", "get_context.py");
|
|
258
|
+
if (!existsSync(script)) return "";
|
|
259
|
+
|
|
260
|
+
try {
|
|
261
|
+
const result = spawnSync("python3", [script], {
|
|
262
|
+
cwd: projectRoot,
|
|
263
|
+
encoding: "utf-8",
|
|
264
|
+
env: contextKey
|
|
265
|
+
? { ...process.env, TRELLIS_CONTEXT_ID: contextKey }
|
|
266
|
+
: process.env,
|
|
267
|
+
timeout: SESSION_CONTEXT_TIMEOUT_MS,
|
|
268
|
+
windowsHide: true,
|
|
269
|
+
});
|
|
270
|
+
if (result.status !== 0 || !result.stdout?.trim()) {
|
|
271
|
+
return "";
|
|
272
|
+
}
|
|
273
|
+
return `<session-context>\n${result.stdout.trim()}\n</session-context>`;
|
|
274
|
+
} catch {
|
|
275
|
+
return "";
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
// ---------------------------------------------------------------------------
|
|
280
|
+
// Task context — prd.md, info.md, and jsonl-referenced spec/research files
|
|
281
|
+
// ---------------------------------------------------------------------------
|
|
282
|
+
|
|
283
|
+
type AgentType = "trellis-implement" | "trellis-check" | "trellis-research" | null;
|
|
284
|
+
|
|
285
|
+
function buildTaskContext(projectRoot: string, taskDir: string, agentType?: AgentType): string {
|
|
286
|
+
const parts: string[] = [];
|
|
287
|
+
// Resolved once per call (not per referenced file) — avoids re-parsing
|
|
288
|
+
// config.yaml for every jsonl row.
|
|
289
|
+
const trustedRoots = resolveTrustedRoots(projectRoot);
|
|
290
|
+
|
|
291
|
+
// prd.md and info.md — always included
|
|
292
|
+
let prd = "";
|
|
293
|
+
try { prd = readFileSync(join(taskDir, "prd.md"), "utf-8"); } catch { }
|
|
294
|
+
if (prd.trim()) parts.push(`## PRD\n\n${prd.trim()}`);
|
|
295
|
+
|
|
296
|
+
let info = "";
|
|
297
|
+
try { info = readFileSync(join(taskDir, "info.md"), "utf-8"); } catch { }
|
|
298
|
+
if (info.trim()) parts.push(`## Info\n\n${info.trim()}`);
|
|
299
|
+
|
|
300
|
+
// Determine which jsonl files to read based on agent type
|
|
301
|
+
let jsonlNames: string[];
|
|
302
|
+
if (agentType === "trellis-implement") {
|
|
303
|
+
jsonlNames = ["implement.jsonl"];
|
|
304
|
+
} else if (agentType === "trellis-check") {
|
|
305
|
+
jsonlNames = ["check.jsonl"];
|
|
306
|
+
} else if (agentType === "trellis-research") {
|
|
307
|
+
jsonlNames = []; // research agent gets only prd + info
|
|
308
|
+
} else {
|
|
309
|
+
jsonlNames = ["implement.jsonl", "check.jsonl"]; // main session: all
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
for (const jsonlName of jsonlNames) {
|
|
313
|
+
const jsonlPath = join(taskDir, jsonlName);
|
|
314
|
+
if (!existsSync(jsonlPath)) continue;
|
|
315
|
+
|
|
316
|
+
let lines: string[];
|
|
317
|
+
try {
|
|
318
|
+
lines = readFileSync(jsonlPath, "utf-8").split(/\r?\n/);
|
|
319
|
+
} catch {
|
|
320
|
+
continue;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
const fileChunks: string[] = [];
|
|
324
|
+
for (const line of lines) {
|
|
325
|
+
const trimmed = line.trim();
|
|
326
|
+
if (!trimmed) continue;
|
|
327
|
+
try {
|
|
328
|
+
const row = JSON.parse(trimmed) as Record<string, unknown>;
|
|
329
|
+
const file = typeof row.file === "string" ? row.file.trim() : "";
|
|
330
|
+
if (!file) continue;
|
|
331
|
+
const targetPath = resolveProjectFile(projectRoot, file, trustedRoots);
|
|
332
|
+
if (!targetPath) continue;
|
|
333
|
+
let content = "";
|
|
334
|
+
try { content = readFileSync(targetPath, "utf-8"); } catch { }
|
|
335
|
+
if (content.trim()) {
|
|
336
|
+
fileChunks.push(`### ${file}\n\n${content.trim()}`);
|
|
337
|
+
}
|
|
338
|
+
} catch {
|
|
339
|
+
// seed rows and malformed lines are non-fatal
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
if (fileChunks.length > 0) {
|
|
344
|
+
parts.push(`## ${jsonlName}\n\n${fileChunks.join("\n\n---\n\n")}`);
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
return parts.length > 0
|
|
349
|
+
? `<task-context>\n${parts.join("\n\n")}\n</task-context>`
|
|
350
|
+
: "";
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
// ---------------------------------------------------------------------------
|
|
354
|
+
// Per-turn cache — prevents redundant workflow-state resolution within a
|
|
355
|
+
// single event cascade (input, before_agent_start, and context fire closely)
|
|
356
|
+
// ---------------------------------------------------------------------------
|
|
357
|
+
|
|
358
|
+
const SESSION_OVERVIEW_TEXT =
|
|
359
|
+
"Trellis workflow system active. Use skills and agents as directed by the workflow state.";
|
|
360
|
+
|
|
361
|
+
class TurnContextCache {
|
|
362
|
+
private key: string | null = null;
|
|
363
|
+
private timestamp = 0;
|
|
364
|
+
private workflowMsg = "";
|
|
365
|
+
private static readonly TTL_MS = 1500;
|
|
366
|
+
|
|
367
|
+
get(projectRoot: string, contextKey: string | null): { workflowMsg: string } {
|
|
368
|
+
const now = Date.now();
|
|
369
|
+
const cacheKey = `${projectRoot}:${contextKey ?? ""}`;
|
|
370
|
+
if (
|
|
371
|
+
this.key === cacheKey &&
|
|
372
|
+
now - this.timestamp < TurnContextCache.TTL_MS
|
|
373
|
+
) {
|
|
374
|
+
return { workflowMsg: this.workflowMsg };
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
const { status } = resolveActiveTaskStatus(projectRoot, contextKey);
|
|
378
|
+
|
|
379
|
+
const workflowPath = join(projectRoot, ".trellis", "workflow.md");
|
|
380
|
+
let workflowMd = "";
|
|
381
|
+
try { workflowMd = readFileSync(workflowPath, "utf-8"); } catch { }
|
|
382
|
+
|
|
383
|
+
let workflowBody = "";
|
|
384
|
+
if (workflowMd) {
|
|
385
|
+
const blocks = parseWorkflowStateBlocks(workflowMd);
|
|
386
|
+
const activeBlock = blocks.find((b) => b.status === status);
|
|
387
|
+
if (activeBlock) {
|
|
388
|
+
workflowBody = `[workflow-state:${activeBlock.status}]\n${activeBlock.content}\n[/workflow-state:${activeBlock.status}]`;
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
if (!workflowBody) {
|
|
392
|
+
workflowBody = "Refer to workflow.md for current step.";
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
this.workflowMsg = `<workflow-state>\n${workflowBody}\n</workflow-state>\n\n<session-overview>\n${SESSION_OVERVIEW_TEXT}\n</session-overview>`;
|
|
396
|
+
|
|
397
|
+
this.key = cacheKey;
|
|
398
|
+
this.timestamp = now;
|
|
399
|
+
return { workflowMsg: this.workflowMsg };
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
// ---------------------------------------------------------------------------
|
|
404
|
+
// Workflow-state tag parsing
|
|
405
|
+
// ---------------------------------------------------------------------------
|
|
406
|
+
|
|
407
|
+
const WORKFLOW_STATE_RE =
|
|
408
|
+
/\[workflow-state:([A-Za-z0-9_-]+)\]\s*\n([\s\S]*?)\n\s*\[\/workflow-state:\1\]/g;
|
|
409
|
+
|
|
410
|
+
interface WorkflowStateBlock {
|
|
411
|
+
status: string;
|
|
412
|
+
content: string;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
function parseWorkflowStateBlocks(markdown: string): WorkflowStateBlock[] {
|
|
416
|
+
const blocks: WorkflowStateBlock[] = [];
|
|
417
|
+
for (const match of markdown.matchAll(WORKFLOW_STATE_RE)) {
|
|
418
|
+
blocks.push({
|
|
419
|
+
status: match[1],
|
|
420
|
+
content: match[2].trim(),
|
|
421
|
+
});
|
|
422
|
+
}
|
|
423
|
+
return blocks;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
// ---------------------------------------------------------------------------
|
|
427
|
+
// Sub-agent detection
|
|
428
|
+
// ---------------------------------------------------------------------------
|
|
429
|
+
|
|
430
|
+
const TRELLIS_AGENTS = new Set(["trellis-implement", "trellis-check", "trellis-research"]);
|
|
431
|
+
|
|
432
|
+
function detectAgentType(): AgentType {
|
|
433
|
+
const blocked = process.env.PI_BLOCKED_AGENT;
|
|
434
|
+
if (blocked && TRELLIS_AGENTS.has(blocked)) {
|
|
435
|
+
return blocked as AgentType;
|
|
436
|
+
}
|
|
437
|
+
return null;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
// ---------------------------------------------------------------------------
|
|
441
|
+
// Extension entry point
|
|
442
|
+
// ---------------------------------------------------------------------------
|
|
443
|
+
|
|
444
|
+
export default function(pi: ExtensionAPI): void {
|
|
445
|
+
let projectRoot: string | null = null;
|
|
446
|
+
const turnCache = new TurnContextCache();
|
|
447
|
+
const agentType = detectAgentType();
|
|
448
|
+
const isSubAgent = agentType !== null;
|
|
449
|
+
|
|
450
|
+
// Tracks compaction boundaries — context handler skips scanning when no
|
|
451
|
+
// compaction has occurred since last injection.
|
|
452
|
+
let lastCompactionTs = 0;
|
|
453
|
+
let lastInjectionTs = 0;
|
|
454
|
+
|
|
455
|
+
const rememberContextKey = (ctx?: { sessionManager?: { getSessionId?: () => string | undefined; getSessionFile?: () => string | undefined } }): string | null => {
|
|
456
|
+
const key = deriveContextKey(ctx);
|
|
457
|
+
if (!key) return null;
|
|
458
|
+
return key;
|
|
459
|
+
};
|
|
460
|
+
|
|
461
|
+
pi.on("session_start", async (_event, ctx) => {
|
|
462
|
+
projectRoot = findProjectRoot(ctx.cwd);
|
|
463
|
+
const contextKey = rememberContextKey(ctx);
|
|
464
|
+
|
|
465
|
+
if (!projectRoot) return;
|
|
466
|
+
|
|
467
|
+
if (isSubAgent) {
|
|
468
|
+
// Sub-agent: inject precise task context once
|
|
469
|
+
const { taskDir } = resolveActiveTaskStatus(projectRoot, contextKey);
|
|
470
|
+
if (taskDir) {
|
|
471
|
+
const taskContext = buildTaskContext(projectRoot, taskDir, agentType);
|
|
472
|
+
if (taskContext) {
|
|
473
|
+
await pi.sendMessage({
|
|
474
|
+
customType: "trellis-task-context",
|
|
475
|
+
content: taskContext,
|
|
476
|
+
display: false,
|
|
477
|
+
});
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
} else {
|
|
481
|
+
// Main session: inject session context (global map) + task context
|
|
482
|
+
const sessionContext = buildSessionContext(projectRoot, contextKey);
|
|
483
|
+
if (sessionContext) {
|
|
484
|
+
await pi.sendMessage({
|
|
485
|
+
customType: "trellis-session-context",
|
|
486
|
+
content: sessionContext,
|
|
487
|
+
display: false,
|
|
488
|
+
});
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
const { taskDir } = resolveActiveTaskStatus(projectRoot, contextKey);
|
|
492
|
+
if (taskDir) {
|
|
493
|
+
const taskContext = buildTaskContext(projectRoot, taskDir);
|
|
494
|
+
if (taskContext) {
|
|
495
|
+
await pi.sendMessage({
|
|
496
|
+
customType: "trellis-task-context",
|
|
497
|
+
content: taskContext,
|
|
498
|
+
display: false,
|
|
499
|
+
});
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
ctx.ui.notify("Trellis workflow system available", "info");
|
|
504
|
+
}
|
|
505
|
+
});
|
|
506
|
+
|
|
507
|
+
pi.on("session_before_compact", async () => {
|
|
508
|
+
lastCompactionTs = Date.now();
|
|
509
|
+
});
|
|
510
|
+
|
|
511
|
+
pi.on("before_agent_start", async (_event, ctx) => {
|
|
512
|
+
if (!projectRoot) {
|
|
513
|
+
projectRoot = findProjectRoot(ctx.cwd);
|
|
514
|
+
}
|
|
515
|
+
if (!projectRoot) return;
|
|
516
|
+
const contextKey = rememberContextKey(ctx);
|
|
517
|
+
|
|
518
|
+
// Persistent injection: workflow state for this turn
|
|
519
|
+
const cached = turnCache.get(projectRoot, contextKey);
|
|
520
|
+
lastInjectionTs = Date.now();
|
|
521
|
+
|
|
522
|
+
return {
|
|
523
|
+
message: {
|
|
524
|
+
customType: "trellis-workflow-state",
|
|
525
|
+
content: cached.workflowMsg,
|
|
526
|
+
display: false,
|
|
527
|
+
},
|
|
528
|
+
};
|
|
529
|
+
});
|
|
530
|
+
|
|
531
|
+
// context fires before EVERY LLM API call (including tool-use continuations
|
|
532
|
+
// and post-compaction agent.continue() paths). Acts as a safety net when
|
|
533
|
+
// before_agent_start's persisted message was removed by compaction.
|
|
534
|
+
pi.on("context", async (event, ctx) => {
|
|
535
|
+
if (!projectRoot) return;
|
|
536
|
+
const contextKey = rememberContextKey(ctx);
|
|
537
|
+
|
|
538
|
+
// Fast path: no compaction since last injection — message is still present
|
|
539
|
+
if (lastInjectionTs > lastCompactionTs) return;
|
|
540
|
+
|
|
541
|
+
const cached = turnCache.get(projectRoot, contextKey);
|
|
542
|
+
if (!cached.workflowMsg) return;
|
|
543
|
+
|
|
544
|
+
// Post-compaction: reverse-scan to confirm absence before injecting
|
|
545
|
+
const messages = event.messages as { role?: string; customType?: string }[];
|
|
546
|
+
for (let i = messages.length - 1; i >= 0; i--) {
|
|
547
|
+
if (messages[i].role === "custom" && messages[i].customType === "trellis-workflow-state") {
|
|
548
|
+
lastInjectionTs = Date.now();
|
|
549
|
+
return;
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
lastInjectionTs = Date.now();
|
|
554
|
+
return {
|
|
555
|
+
messages: [
|
|
556
|
+
...event.messages,
|
|
557
|
+
{
|
|
558
|
+
role: "custom" as const,
|
|
559
|
+
customType: "trellis-workflow-state",
|
|
560
|
+
content: cached.workflowMsg,
|
|
561
|
+
display: false,
|
|
562
|
+
timestamp: Date.now(),
|
|
563
|
+
},
|
|
564
|
+
],
|
|
565
|
+
};
|
|
566
|
+
});
|
|
567
|
+
|
|
568
|
+
// OMP passes Bash event.input through to the tool execution parameters, so
|
|
569
|
+
// inject the session key through the shell-agnostic env field. An explicit
|
|
570
|
+
// per-call value wins over the derived key.
|
|
571
|
+
pi.on("tool_call", (event, ctx) => {
|
|
572
|
+
if (event.toolName !== "bash") return;
|
|
573
|
+
const contextKey = rememberContextKey(ctx);
|
|
574
|
+
if (!contextKey) return;
|
|
575
|
+
const input = event.input as { env?: Record<string, string> };
|
|
576
|
+
input.env = {
|
|
577
|
+
TRELLIS_CONTEXT_ID: contextKey,
|
|
578
|
+
...input.env,
|
|
579
|
+
};
|
|
580
|
+
});
|
|
581
|
+
|
|
582
|
+
pi.on("input", async (_event, ctx) => {
|
|
583
|
+
if (!projectRoot) {
|
|
584
|
+
projectRoot = findProjectRoot(ctx.cwd);
|
|
585
|
+
}
|
|
586
|
+
// Resolve projectRoot on first input if session_start missed it
|
|
587
|
+
if (!projectRoot) return;
|
|
588
|
+
const contextKey = rememberContextKey(ctx);
|
|
589
|
+
// Pre-warm the cache so before_agent_start and context can use it
|
|
590
|
+
turnCache.get(projectRoot, contextKey);
|
|
591
|
+
});
|
|
592
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/omp/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAI1D,wBAAgB,YAAY,IAAI,aAAa,EAAE,CAE9C;AAED,wBAAgB,oBAAoB,IAAI,MAAM,CAE7C"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createTemplateReader } from "../template-utils.js";
|
|
2
|
+
const { listMdAgents, readTemplate } = createTemplateReader(import.meta.url);
|
|
3
|
+
export function getAllAgents() {
|
|
4
|
+
return listMdAgents();
|
|
5
|
+
}
|
|
6
|
+
export function getExtensionTemplate() {
|
|
7
|
+
return readTemplate("extensions/trellis/index.ts.txt");
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/omp/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAG5D,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,GAAG,oBAAoB,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE7E,MAAM,UAAU,YAAY;IAC1B,OAAO,YAAY,EAAE,CAAC;AACxB,CAAC;AAED,MAAM,UAAU,oBAAoB;IAClC,OAAO,YAAY,CAAC,iCAAiC,CAAC,CAAC;AACzD,CAAC"}
|