@mindfoldhq/trellis 0.6.0-beta.9 → 0.6.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.
Files changed (328) hide show
  1. package/README.md +49 -49
  2. package/dist/cli/index.d.ts.map +1 -1
  3. package/dist/cli/index.js +36 -0
  4. package/dist/cli/index.js.map +1 -1
  5. package/dist/commands/channel/adapters/claude.d.ts +29 -0
  6. package/dist/commands/channel/adapters/claude.d.ts.map +1 -0
  7. package/dist/commands/channel/adapters/claude.js +203 -0
  8. package/dist/commands/channel/adapters/claude.js.map +1 -0
  9. package/dist/commands/channel/adapters/codex.d.ts +85 -0
  10. package/dist/commands/channel/adapters/codex.d.ts.map +1 -0
  11. package/dist/commands/channel/adapters/codex.js +505 -0
  12. package/dist/commands/channel/adapters/codex.js.map +1 -0
  13. package/dist/commands/channel/adapters/index.d.ts +84 -0
  14. package/dist/commands/channel/adapters/index.d.ts.map +1 -0
  15. package/dist/commands/channel/adapters/index.js +115 -0
  16. package/dist/commands/channel/adapters/index.js.map +1 -0
  17. package/dist/commands/channel/adapters/types.d.ts +33 -0
  18. package/dist/commands/channel/adapters/types.d.ts.map +1 -0
  19. package/dist/commands/channel/adapters/types.js +2 -0
  20. package/dist/commands/channel/adapters/types.js.map +1 -0
  21. package/dist/commands/channel/agent-loader.d.ts +32 -0
  22. package/dist/commands/channel/agent-loader.d.ts.map +1 -0
  23. package/dist/commands/channel/agent-loader.js +154 -0
  24. package/dist/commands/channel/agent-loader.js.map +1 -0
  25. package/dist/commands/channel/context-loader.d.ts +26 -0
  26. package/dist/commands/channel/context-loader.d.ts.map +1 -0
  27. package/dist/commands/channel/context-loader.js +290 -0
  28. package/dist/commands/channel/context-loader.js.map +1 -0
  29. package/dist/commands/channel/context.d.ts +16 -0
  30. package/dist/commands/channel/context.d.ts.map +1 -0
  31. package/dist/commands/channel/context.js +83 -0
  32. package/dist/commands/channel/context.js.map +1 -0
  33. package/dist/commands/channel/create.d.ts +27 -0
  34. package/dist/commands/channel/create.d.ts.map +1 -0
  35. package/dist/commands/channel/create.js +39 -0
  36. package/dist/commands/channel/create.js.map +1 -0
  37. package/dist/commands/channel/dev-parse-trace.d.ts +14 -0
  38. package/dist/commands/channel/dev-parse-trace.d.ts.map +1 -0
  39. package/dist/commands/channel/dev-parse-trace.js +70 -0
  40. package/dist/commands/channel/dev-parse-trace.js.map +1 -0
  41. package/dist/commands/channel/guard.d.ts +150 -0
  42. package/dist/commands/channel/guard.d.ts.map +1 -0
  43. package/dist/commands/channel/guard.js +474 -0
  44. package/dist/commands/channel/guard.js.map +1 -0
  45. package/dist/commands/channel/index.d.ts +3 -0
  46. package/dist/commands/channel/index.d.ts.map +1 -0
  47. package/dist/commands/channel/index.js +531 -0
  48. package/dist/commands/channel/index.js.map +1 -0
  49. package/dist/commands/channel/interrupt.d.ts +10 -0
  50. package/dist/commands/channel/interrupt.d.ts.map +1 -0
  51. package/dist/commands/channel/interrupt.js +22 -0
  52. package/dist/commands/channel/interrupt.js.map +1 -0
  53. package/dist/commands/channel/kill.d.ts +7 -0
  54. package/dist/commands/channel/kill.d.ts.map +1 -0
  55. package/dist/commands/channel/kill.js +121 -0
  56. package/dist/commands/channel/kill.js.map +1 -0
  57. package/dist/commands/channel/list.d.ts +17 -0
  58. package/dist/commands/channel/list.d.ts.map +1 -0
  59. package/dist/commands/channel/list.js +233 -0
  60. package/dist/commands/channel/list.js.map +1 -0
  61. package/dist/commands/channel/messages.d.ts +15 -0
  62. package/dist/commands/channel/messages.d.ts.map +1 -0
  63. package/dist/commands/channel/messages.js +245 -0
  64. package/dist/commands/channel/messages.js.map +1 -0
  65. package/dist/commands/channel/rm.d.ts +27 -0
  66. package/dist/commands/channel/rm.d.ts.map +1 -0
  67. package/dist/commands/channel/rm.js +216 -0
  68. package/dist/commands/channel/rm.js.map +1 -0
  69. package/dist/commands/channel/run.d.ts +30 -0
  70. package/dist/commands/channel/run.d.ts.map +1 -0
  71. package/dist/commands/channel/run.js +130 -0
  72. package/dist/commands/channel/run.js.map +1 -0
  73. package/dist/commands/channel/send.d.ts +11 -0
  74. package/dist/commands/channel/send.d.ts.map +1 -0
  75. package/dist/commands/channel/send.js +24 -0
  76. package/dist/commands/channel/send.js.map +1 -0
  77. package/dist/commands/channel/spawn.d.ts +40 -0
  78. package/dist/commands/channel/spawn.d.ts.map +1 -0
  79. package/dist/commands/channel/spawn.js +244 -0
  80. package/dist/commands/channel/spawn.js.map +1 -0
  81. package/dist/commands/channel/store/events.d.ts +39 -0
  82. package/dist/commands/channel/store/events.d.ts.map +1 -0
  83. package/dist/commands/channel/store/events.js +87 -0
  84. package/dist/commands/channel/store/events.js.map +1 -0
  85. package/dist/commands/channel/store/filter.d.ts +3 -0
  86. package/dist/commands/channel/store/filter.d.ts.map +1 -0
  87. package/dist/commands/channel/store/filter.js +2 -0
  88. package/dist/commands/channel/store/filter.js.map +1 -0
  89. package/dist/commands/channel/store/lock.d.ts +23 -0
  90. package/dist/commands/channel/store/lock.d.ts.map +1 -0
  91. package/dist/commands/channel/store/lock.js +99 -0
  92. package/dist/commands/channel/store/lock.js.map +1 -0
  93. package/dist/commands/channel/store/paths.d.ts +63 -0
  94. package/dist/commands/channel/store/paths.d.ts.map +1 -0
  95. package/dist/commands/channel/store/paths.js +246 -0
  96. package/dist/commands/channel/store/paths.js.map +1 -0
  97. package/dist/commands/channel/store/schema.d.ts +27 -0
  98. package/dist/commands/channel/store/schema.d.ts.map +1 -0
  99. package/dist/commands/channel/store/schema.js +34 -0
  100. package/dist/commands/channel/store/schema.js.map +1 -0
  101. package/dist/commands/channel/store/thread-state.d.ts +5 -0
  102. package/dist/commands/channel/store/thread-state.d.ts.map +1 -0
  103. package/dist/commands/channel/store/thread-state.js +16 -0
  104. package/dist/commands/channel/store/thread-state.js.map +1 -0
  105. package/dist/commands/channel/store/watch.d.ts +19 -0
  106. package/dist/commands/channel/store/watch.d.ts.map +1 -0
  107. package/dist/commands/channel/store/watch.js +146 -0
  108. package/dist/commands/channel/store/watch.js.map +1 -0
  109. package/dist/commands/channel/supervisor/idle.d.ts +46 -0
  110. package/dist/commands/channel/supervisor/idle.d.ts.map +1 -0
  111. package/dist/commands/channel/supervisor/idle.js +72 -0
  112. package/dist/commands/channel/supervisor/idle.js.map +1 -0
  113. package/dist/commands/channel/supervisor/inbox.d.ts +30 -0
  114. package/dist/commands/channel/supervisor/inbox.d.ts.map +1 -0
  115. package/dist/commands/channel/supervisor/inbox.js +160 -0
  116. package/dist/commands/channel/supervisor/inbox.js.map +1 -0
  117. package/dist/commands/channel/supervisor/shutdown.d.ts +68 -0
  118. package/dist/commands/channel/supervisor/shutdown.d.ts.map +1 -0
  119. package/dist/commands/channel/supervisor/shutdown.js +146 -0
  120. package/dist/commands/channel/supervisor/shutdown.js.map +1 -0
  121. package/dist/commands/channel/supervisor/stdout.d.ts +51 -0
  122. package/dist/commands/channel/supervisor/stdout.d.ts.map +1 -0
  123. package/dist/commands/channel/supervisor/stdout.js +121 -0
  124. package/dist/commands/channel/supervisor/stdout.js.map +1 -0
  125. package/dist/commands/channel/supervisor/turns.d.ts +31 -0
  126. package/dist/commands/channel/supervisor/turns.d.ts.map +1 -0
  127. package/dist/commands/channel/supervisor/turns.js +45 -0
  128. package/dist/commands/channel/supervisor/turns.js.map +1 -0
  129. package/dist/commands/channel/supervisor/warning.d.ts +48 -0
  130. package/dist/commands/channel/supervisor/warning.d.ts.map +1 -0
  131. package/dist/commands/channel/supervisor/warning.js +77 -0
  132. package/dist/commands/channel/supervisor/warning.js.map +1 -0
  133. package/dist/commands/channel/supervisor.d.ts +59 -0
  134. package/dist/commands/channel/supervisor.d.ts.map +1 -0
  135. package/dist/commands/channel/supervisor.js +344 -0
  136. package/dist/commands/channel/supervisor.js.map +1 -0
  137. package/dist/commands/channel/text-body.d.ts +13 -0
  138. package/dist/commands/channel/text-body.d.ts.map +1 -0
  139. package/dist/commands/channel/text-body.js +47 -0
  140. package/dist/commands/channel/text-body.js.map +1 -0
  141. package/dist/commands/channel/threads.d.ts +39 -0
  142. package/dist/commands/channel/threads.d.ts.map +1 -0
  143. package/dist/commands/channel/threads.js +106 -0
  144. package/dist/commands/channel/threads.js.map +1 -0
  145. package/dist/commands/channel/title.d.ts +12 -0
  146. package/dist/commands/channel/title.d.ts.map +1 -0
  147. package/dist/commands/channel/title.js +24 -0
  148. package/dist/commands/channel/title.js.map +1 -0
  149. package/dist/commands/channel/wait.d.ts +17 -0
  150. package/dist/commands/channel/wait.d.ts.map +1 -0
  151. package/dist/commands/channel/wait.js +75 -0
  152. package/dist/commands/channel/wait.js.map +1 -0
  153. package/dist/commands/init.d.ts +3 -0
  154. package/dist/commands/init.d.ts.map +1 -1
  155. package/dist/commands/init.js +162 -43
  156. package/dist/commands/init.js.map +1 -1
  157. package/dist/commands/mem.d.ts +13 -217
  158. package/dist/commands/mem.d.ts.map +1 -1
  159. package/dist/commands/mem.js +142 -1587
  160. package/dist/commands/mem.js.map +1 -1
  161. package/dist/commands/uninstall.d.ts.map +1 -1
  162. package/dist/commands/uninstall.js +28 -2
  163. package/dist/commands/uninstall.js.map +1 -1
  164. package/dist/commands/update.d.ts.map +1 -1
  165. package/dist/commands/update.js +102 -5
  166. package/dist/commands/update.js.map +1 -1
  167. package/dist/commands/workflow.d.ts +35 -0
  168. package/dist/commands/workflow.d.ts.map +1 -0
  169. package/dist/commands/workflow.js +232 -0
  170. package/dist/commands/workflow.js.map +1 -0
  171. package/dist/configurators/claude.d.ts.map +1 -1
  172. package/dist/configurators/claude.js +1 -0
  173. package/dist/configurators/claude.js.map +1 -1
  174. package/dist/configurators/index.d.ts.map +1 -1
  175. package/dist/configurators/index.js +5 -0
  176. package/dist/configurators/index.js.map +1 -1
  177. package/dist/configurators/reasonix.d.ts +23 -0
  178. package/dist/configurators/reasonix.d.ts.map +1 -0
  179. package/dist/configurators/reasonix.js +60 -0
  180. package/dist/configurators/reasonix.js.map +1 -0
  181. package/dist/configurators/shared.d.ts.map +1 -1
  182. package/dist/configurators/shared.js +8 -0
  183. package/dist/configurators/shared.js.map +1 -1
  184. package/dist/configurators/workflow.d.ts +8 -0
  185. package/dist/configurators/workflow.d.ts.map +1 -1
  186. package/dist/configurators/workflow.js +14 -3
  187. package/dist/configurators/workflow.js.map +1 -1
  188. package/dist/constants/paths.d.ts +4 -0
  189. package/dist/constants/paths.d.ts.map +1 -1
  190. package/dist/constants/paths.js +4 -0
  191. package/dist/constants/paths.js.map +1 -1
  192. package/dist/migrations/manifests/0.5.14.json +9 -0
  193. package/dist/migrations/manifests/0.5.15.json +9 -0
  194. package/dist/migrations/manifests/0.5.16.json +9 -0
  195. package/dist/migrations/manifests/0.5.17.json +9 -0
  196. package/dist/migrations/manifests/0.5.18.json +9 -0
  197. package/dist/migrations/manifests/0.5.19.json +9 -0
  198. package/dist/migrations/manifests/0.6.0-beta.10.json +9 -0
  199. package/dist/migrations/manifests/0.6.0-beta.11.json +9 -0
  200. package/dist/migrations/manifests/0.6.0-beta.12.json +9 -0
  201. package/dist/migrations/manifests/0.6.0-beta.13.json +9 -0
  202. package/dist/migrations/manifests/0.6.0-beta.14.json +9 -0
  203. package/dist/migrations/manifests/0.6.0-beta.15.json +9 -0
  204. package/dist/migrations/manifests/0.6.0-beta.16.json +9 -0
  205. package/dist/migrations/manifests/0.6.0-beta.17.json +9 -0
  206. package/dist/migrations/manifests/0.6.0-beta.18.json +16 -0
  207. package/dist/migrations/manifests/0.6.0-beta.19.json +9 -0
  208. package/dist/migrations/manifests/0.6.0-beta.20.json +9 -0
  209. package/dist/migrations/manifests/0.6.0-beta.21.json +9 -0
  210. package/dist/migrations/manifests/0.6.0-beta.22.json +9 -0
  211. package/dist/migrations/manifests/0.6.0-beta.23.json +88 -0
  212. package/dist/migrations/manifests/0.6.0-rc.0.json +9 -0
  213. package/dist/migrations/manifests/0.6.0.json +1 -0
  214. package/dist/templates/claude/agents/trellis-check.md +12 -6
  215. package/dist/templates/claude/agents/trellis-implement.md +1 -1
  216. package/dist/templates/claude/agents/trellis-research.md +1 -1
  217. package/dist/templates/codebuddy/agents/trellis-check.md +12 -6
  218. package/dist/templates/codebuddy/agents/trellis-implement.md +1 -1
  219. package/dist/templates/codebuddy/agents/trellis-research.md +1 -1
  220. package/dist/templates/codex/agents/trellis-check.toml +0 -25
  221. package/dist/templates/codex/agents/trellis-implement.toml +0 -25
  222. package/dist/templates/codex/config.toml +9 -16
  223. package/dist/templates/codex/hooks/session-start.py +22 -0
  224. package/dist/templates/codex/hooks.json +1 -1
  225. package/dist/templates/common/bundled-skills/trellis-channel/SKILL.md +67 -0
  226. package/dist/templates/common/bundled-skills/trellis-channel/references/command-reference.md +480 -0
  227. package/dist/templates/common/bundled-skills/trellis-channel/references/forum.md +233 -0
  228. package/dist/templates/common/bundled-skills/trellis-channel/references/progress-debugging.md +226 -0
  229. package/dist/templates/common/bundled-skills/trellis-channel/references/workers.md +276 -0
  230. package/dist/templates/common/bundled-skills/trellis-channel/references/workflows.md +128 -0
  231. package/dist/templates/common/bundled-skills/trellis-meta/SKILL.md +46 -34
  232. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-skills-or-commands.md +47 -3
  233. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/bundled-skills.md +146 -0
  234. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/multi-agent-channel.md +69 -0
  235. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/task-system.md +27 -0
  236. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.md +11 -1
  237. package/dist/templates/common/bundled-skills/trellis-session-insight/SKILL.md +81 -0
  238. package/dist/templates/common/bundled-skills/trellis-session-insight/references/cli-quick-reference.md +66 -0
  239. package/dist/templates/common/bundled-skills/trellis-session-insight/references/triggering-patterns.md +93 -0
  240. package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/SKILL.md +41 -0
  241. package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/mcp-setup.md +90 -0
  242. package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/repository-analysis.md +59 -0
  243. package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/spec-task-planning.md +61 -0
  244. package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/spec-writing.md +70 -0
  245. package/dist/templates/copilot/hooks/session-start.py +24 -0
  246. package/dist/templates/cursor/agents/trellis-check.md +12 -6
  247. package/dist/templates/cursor/agents/trellis-implement.md +1 -1
  248. package/dist/templates/cursor/agents/trellis-research.md +1 -1
  249. package/dist/templates/cursor/hooks.json +0 -6
  250. package/dist/templates/droid/droids/trellis-check.md +12 -6
  251. package/dist/templates/droid/droids/trellis-implement.md +1 -1
  252. package/dist/templates/droid/droids/trellis-research.md +1 -1
  253. package/dist/templates/gemini/agents/trellis-check.md +11 -5
  254. package/dist/templates/kiro/agents/trellis-check.json +1 -1
  255. package/dist/templates/markdown/spec/guides/code-reuse-thinking-guide.md.txt +127 -9
  256. package/dist/templates/markdown/spec/guides/cross-layer-thinking-guide.md.txt +130 -0
  257. package/dist/templates/markdown/spec/guides/cross-platform-thinking-guide.md.txt +38 -0
  258. package/dist/templates/markdown/spec/guides/index.md.txt +18 -0
  259. package/dist/templates/opencode/agents/trellis-check.md +11 -5
  260. package/dist/templates/pi/agents/trellis-check.md +5 -4
  261. package/dist/templates/pi/agents/trellis-implement.md +5 -4
  262. package/dist/templates/pi/extensions/trellis/index.ts.txt +1339 -913
  263. package/dist/templates/pi/settings.json +0 -9
  264. package/dist/templates/qoder/agents/trellis-check.md +12 -6
  265. package/dist/templates/qoder/agents/trellis-implement.md +1 -1
  266. package/dist/templates/qoder/agents/trellis-research.md +1 -1
  267. package/dist/templates/reasonix/agents/trellis-check.md +36 -0
  268. package/dist/templates/reasonix/agents/trellis-implement.md +41 -0
  269. package/dist/templates/reasonix/index.d.ts +13 -0
  270. package/dist/templates/reasonix/index.d.ts.map +1 -0
  271. package/dist/templates/reasonix/index.js +16 -0
  272. package/dist/templates/reasonix/index.js.map +1 -0
  273. package/dist/templates/shared-hooks/index.d.ts.map +1 -1
  274. package/dist/templates/shared-hooks/index.js +0 -1
  275. package/dist/templates/shared-hooks/index.js.map +1 -1
  276. package/dist/templates/shared-hooks/inject-workflow-state.py +22 -0
  277. package/dist/templates/shared-hooks/session-start.py +25 -8
  278. package/dist/templates/trellis/agents/check.md +70 -0
  279. package/dist/templates/trellis/agents/implement.md +71 -0
  280. package/dist/templates/trellis/config.yaml +20 -0
  281. package/dist/templates/trellis/index.d.ts +13 -0
  282. package/dist/templates/trellis/index.d.ts.map +1 -1
  283. package/dist/templates/trellis/index.js +22 -0
  284. package/dist/templates/trellis/index.js.map +1 -1
  285. package/dist/templates/trellis/scripts/common/safe_commit.py +49 -19
  286. package/dist/templates/trellis/scripts/common/task_store.py +94 -16
  287. package/dist/templates/trellis/workflow.md +21 -0
  288. package/dist/types/ai-tools.d.ts +4 -4
  289. package/dist/types/ai-tools.d.ts.map +1 -1
  290. package/dist/types/ai-tools.js +16 -0
  291. package/dist/types/ai-tools.js.map +1 -1
  292. package/dist/utils/agent-refs.d.ts +31 -0
  293. package/dist/utils/agent-refs.d.ts.map +1 -0
  294. package/dist/utils/agent-refs.js +63 -0
  295. package/dist/utils/agent-refs.js.map +1 -0
  296. package/dist/utils/cwd-guard.d.ts +38 -0
  297. package/dist/utils/cwd-guard.d.ts.map +1 -0
  298. package/dist/utils/cwd-guard.js +62 -0
  299. package/dist/utils/cwd-guard.js.map +1 -0
  300. package/dist/utils/file-writer.d.ts +13 -0
  301. package/dist/utils/file-writer.d.ts.map +1 -1
  302. package/dist/utils/file-writer.js +59 -1
  303. package/dist/utils/file-writer.js.map +1 -1
  304. package/dist/utils/manifest-prune.d.ts +61 -0
  305. package/dist/utils/manifest-prune.d.ts.map +1 -0
  306. package/dist/utils/manifest-prune.js +136 -0
  307. package/dist/utils/manifest-prune.js.map +1 -0
  308. package/dist/utils/registry-config.d.ts +7 -0
  309. package/dist/utils/registry-config.d.ts.map +1 -0
  310. package/dist/utils/registry-config.js +171 -0
  311. package/dist/utils/registry-config.js.map +1 -0
  312. package/dist/utils/task-json.d.ts +9 -42
  313. package/dist/utils/task-json.d.ts.map +1 -1
  314. package/dist/utils/task-json.js +8 -45
  315. package/dist/utils/task-json.js.map +1 -1
  316. package/dist/utils/template-fetcher.d.ts +11 -0
  317. package/dist/utils/template-fetcher.d.ts.map +1 -1
  318. package/dist/utils/template-fetcher.js +51 -2
  319. package/dist/utils/template-fetcher.js.map +1 -1
  320. package/dist/utils/template-hash.d.ts +32 -6
  321. package/dist/utils/template-hash.d.ts.map +1 -1
  322. package/dist/utils/template-hash.js +53 -31
  323. package/dist/utils/template-hash.js.map +1 -1
  324. package/dist/utils/workflow-resolver.d.ts +86 -0
  325. package/dist/utils/workflow-resolver.d.ts.map +1 -0
  326. package/dist/utils/workflow-resolver.js +265 -0
  327. package/dist/utils/workflow-resolver.js.map +1 -0
  328. package/package.json +9 -8
@@ -0,0 +1,480 @@
1
+ # Command Reference
2
+
3
+ Authoritative current command reference for `trellis channel` subcommands,
4
+ validated against the source in `packages/cli/src/commands/channel/`
5
+ (`index.ts` Commander wiring and each subcommand handler).
6
+
7
+ Every subcommand accepts `--scope <project|global>` unless noted; `project`
8
+ is the default and resolves against the current cwd's project bucket.
9
+
10
+ ## Top-level
11
+
12
+ ```
13
+ trellis channel <subcommand>
14
+ ```
15
+
16
+ > Multi-agent collaboration runtime — spawn / coordinate / interrupt worker
17
+ > agents through a shared event log.
18
+
19
+ ---
20
+
21
+ ## Create / List
22
+
23
+ ### `create <name>`
24
+
25
+ ```bash
26
+ trellis channel create <name>
27
+ [--scope project|global] # default: project
28
+ [--type chat|forum] # default: chat
29
+ [--task <path>] # associated Trellis task dir
30
+ [--project <slug>]
31
+ [--labels a,b,c]
32
+ [--description <text>] # stable channel description
33
+ [--context-file <abs-path>] ... # repeatable
34
+ [--context-raw <text>] ... # repeatable
35
+ [--linked-context-file <abs-path>] # [deprecated alias]
36
+ [--linked-context-raw <text>] # [deprecated alias]
37
+ [--cwd <path>] # recorded in create event
38
+ [--by <agent>] # default: main
39
+ [--force] # overwrite existing channel
40
+ [--ephemeral] # hide from default list, prunable
41
+ ```
42
+
43
+ Behavior:
44
+ - Appends a `create` event; immutable `type` (cannot mutate forum↔chat after).
45
+ - `--ephemeral` channels are hidden from `channel list` by default and are
46
+ the sweep target for `channel prune --ephemeral`.
47
+ - `--linked-context-*` are folded into `--context-*`; emit a deprecation
48
+ notice when used.
49
+
50
+ ### `list`
51
+
52
+ ```bash
53
+ trellis channel list
54
+ [--scope project|global]
55
+ [--json]
56
+ [--project <slug>] # substring match on task field
57
+ [--all] # include ephemeral (suffix '*')
58
+ [--all-projects] # scan every project bucket
59
+ ```
60
+
61
+ Behavior:
62
+ - Default scope: current cwd's project. `--all-projects` scans every bucket.
63
+ - Pretty mode prints `NAME WORKERS EVENTS LAST KIND TYPE TASK`, sorted by
64
+ recency, with a footer noting hidden ephemeral count.
65
+ - `--json` switches to a JSON array.
66
+
67
+ ---
68
+
69
+ ## Chat Messages
70
+
71
+ ### `send <name> [text]`
72
+
73
+ ```bash
74
+ trellis channel send <name> [text]
75
+ --as <agent> # REQUIRED — author
76
+ [--scope project|global]
77
+ [--to <agents,csv>] # default: broadcast
78
+ [--stdin | --text-file <path>] # body from stdin or file
79
+ [--delivery-mode appendOnly|requireKnownWorker|requireRunningWorker]
80
+ ```
81
+
82
+ Behavior:
83
+ - Body precedence: positional `[text]` → `--stdin` → `--text-file`.
84
+ - `--to` with one entry stores a string; multiple stores an array; omitted
85
+ means broadcast.
86
+ - `--delivery-mode` selects targeted-delivery validation:
87
+ - `appendOnly` (default-ish — just record),
88
+ - `requireKnownWorker` (the named target must have a `spawned` event),
89
+ - `requireRunningWorker` (the worker must currently be live).
90
+ - Prints the appended event as one JSON line on stdout.
91
+
92
+ > **Note:** `send` has **no** `--tag` and **no** `--kind` flag. See
93
+ > [`tag-vs-kind`](#tag-vs-kind--how-event-shape-is-actually-controlled) below.
94
+
95
+ ### `messages <name>`
96
+
97
+ ```bash
98
+ trellis channel messages <name>
99
+ [--scope project|global]
100
+ [--raw] # one JSON event per line
101
+ [--follow] # stream new events
102
+ [--last <N>] # last N matching events
103
+ [--since <seq>] # seq > N
104
+ [--kind <kind>] # one of CHANNEL_EVENT_KINDS
105
+ [--from <csv>] # author filter
106
+ [--to <target>] # routing target filter
107
+ [--thread <key>] # forum-only
108
+ [--action <thread-action>] # forum-only
109
+ [--no-progress] # hide progress events
110
+ ```
111
+
112
+ Behavior:
113
+ - Auto-detects forum channels: with no filters it renders the thread board
114
+ instead of the event stream. `--thread` / `--action` are forum-only and
115
+ error against chat channels.
116
+ - `--kind` is validated against `CHANNEL_EVENT_KINDS` (single value, not
117
+ CSV — that's the `wait` side).
118
+
119
+ ### `wait <name>`
120
+
121
+ ```bash
122
+ trellis channel wait <name>
123
+ --as <agent> # REQUIRED — self for filter ctx
124
+ [--scope project|global]
125
+ [--timeout <Ns|Nm|Nh|Nms>] # parsed by parseDuration
126
+ [--from <a,b>] # author CSV
127
+ [--kind <k1,k2>] # CSV, OR semantics
128
+ [--thread <key>] # forum filter
129
+ [--action <thread-action>] # forum filter
130
+ [--to <target>] # default: own agent (broadcast + me)
131
+ [--include-progress] # also wake on progress events
132
+ [--all] # require every --from to match
133
+ ```
134
+
135
+ Behavior:
136
+ - Streams matching events as JSON, one per line.
137
+ - Default `--to` filter is the caller's own agent (broadcast events still
138
+ match — broadcast + explicit-to-me).
139
+ - `--all` requires `--from` and blocks until every listed agent has produced
140
+ a matching event.
141
+ - **Timeout exits 124** and prints `timeout: still waiting on ...` to stderr
142
+ when `--all` was in play.
143
+
144
+ ---
145
+
146
+ ## tag-vs-kind — how event shape is actually controlled
147
+
148
+ There is **no `--tag` flag** anywhere in the v0.6.0 channel CLI; `--kind` is
149
+ not a legacy alias for any `--tag` flag.
150
+
151
+ Concrete model in the current source:
152
+
153
+ - `--kind` is the only event-type filter, and it is constrained to the
154
+ trellis-emitted whitelist (`CHANNEL_EVENT_KINDS` in
155
+ `packages/core/src/channel/internal/store/events.ts`):
156
+ - `create`, `join`, `leave`, `message`, `thread`, `context`, `channel`,
157
+ `spawned`, `killed`, `respawned`, `progress`, `done`, `error`,
158
+ `waiting`, `awake`, `undeliverable`, `interrupt_requested`,
159
+ `turn_started`, `turn_finished`, `interrupted`, `supervisor_warning`
160
+ - Passing anything else throws
161
+ `Invalid --kind '<x>'. Must be one of: …`.
162
+ - `--kind` lives on `wait` (CSV, OR semantics) and `messages` (single
163
+ value). `send` and `run` cannot emit a custom kind — every `send` writes
164
+ a `message` event.
165
+ - Mid-turn worker abort is **not** a tag. It is the dedicated
166
+ `channel interrupt` command, which appends an `interrupt_requested` /
167
+ `interrupted` pair and provider-level interrupts the worker.
168
+
169
+ Practical rule for dispatchers waiting on workers:
170
+
171
+ - Use `--kind done,turn_finished` for "worker finished a turn" — these are
172
+ system events that the supervisor fires automatically. Do not depend on
173
+ the worker LLM remembering to emit any custom signal.
174
+ - Use `trellis channel interrupt` (the command) only when you actually want
175
+ mid-turn abort behavior.
176
+ - Do **not** invent user-side tags as completion signals. There is no
177
+ `--tag` filter; a worker writing a custom string into its final message
178
+ is just text inside a `message` event and cannot be matched by `wait`.
179
+
180
+ Long bodies always go through stdin or a file:
181
+
182
+ ```bash
183
+ trellis channel send T --as A --stdin < /tmp/message.md
184
+ trellis channel send T --as A --text-file /tmp/message.md
185
+ ```
186
+
187
+ ---
188
+
189
+ ## Interrupt
190
+
191
+ ### `interrupt <name> [text]`
192
+
193
+ ```bash
194
+ trellis channel interrupt <name> [text]
195
+ --as <agent> # REQUIRED — caller
196
+ --to <agent> # REQUIRED — target worker
197
+ [--scope project|global]
198
+ [--stdin | --text-file <path>]
199
+ ```
200
+
201
+ Behavior:
202
+ - Appends an `interrupt` event with `reason: "user"` and a replacement
203
+ instruction body; supervisor performs provider-level interrupt where
204
+ supported (Claude `/interrupt`, Codex turn cancel).
205
+ - Prints the appended event JSON on stdout.
206
+
207
+ ---
208
+
209
+ ## Workers
210
+
211
+ ### `spawn <name>`
212
+
213
+ ```bash
214
+ trellis channel spawn <name>
215
+ [--scope project|global]
216
+ [--agent <agent-name>] # loads .trellis/agents/<name>.md
217
+ [--provider claude|codex] # overrides agent file
218
+ [--as <worker-name>] # default: agent name
219
+ [--cwd <path>]
220
+ [--model <id>]
221
+ [--resume <id>] # session/thread id resume
222
+ [--timeout <Ns|Nm|Nh>] # auto-kill after duration
223
+ [--warn-before <Ns|Nm|Nh>] # supervisor_warning lead time
224
+ # default 5m, 0ms disables
225
+ [--file <path>] ... # glob, repeatable; inject content
226
+ [--jsonl <path>] ... # Trellis manifest, repeatable
227
+ [--by <agent>] # spawn-event author
228
+ # default: TRELLIS_CHANNEL_AS env or 'main'
229
+ [--inbox-policy explicitOnly|broadcastAndExplicit]
230
+ # default explicitOnly
231
+ [--idle-timeout <Ns|Nm|Nh>] # OOM-guard idle TTL
232
+ # default 5m, 0 disables
233
+ [--max-live-workers <n>] # spawn-time live-worker budget
234
+ # default 6, 0 disables
235
+ ```
236
+
237
+ Behavior:
238
+ - Provider is validated against the adapter registry
239
+ (`packages/cli/src/commands/channel/adapters/`); current: `claude`,
240
+ `codex`.
241
+ - Worker stays inbox-idle until the first `send --to <worker>`.
242
+ - Records a `spawned` event with `pid`, `provider`, `agent`, `files`,
243
+ `manifests`.
244
+ - OOM-guard precedence: CLI flag → env var
245
+ (`TRELLIS_CHANNEL_WORKER_IDLE_TIMEOUT`,
246
+ `TRELLIS_CHANNEL_MAX_LIVE_WORKERS`) →
247
+ `.trellis/config.yaml#channel.worker_guard` → built-in defaults.
248
+
249
+ ### `run [name]`
250
+
251
+ ```bash
252
+ trellis channel run [name?]
253
+ [--agent <name>]
254
+ [--provider claude|codex]
255
+ [--as <worker-name>]
256
+ [--cwd <path>]
257
+ [--model <id>]
258
+ [--file <path>] ... # repeatable, glob
259
+ [--jsonl <path>] ... # repeatable
260
+ [--message <text> | --message-file <path> | --stdin]
261
+ [--timeout <Ns|Nm|Nh>] # default 5m
262
+ ```
263
+
264
+ Behavior:
265
+ - One-shot. Auto-generates `run-<hex>` if `name` omitted.
266
+ - Creates an ephemeral channel (`createMode=run`), spawns a single worker,
267
+ sends the prompt, waits for `done`, prints the final assistant text to
268
+ stdout, then removes the channel on success. On failure the channel is
269
+ kept for inspection and exit code is 1.
270
+
271
+ > `run` has **no** `--tag` flag. Completion is detected via the `done`
272
+ > event the supervisor emits.
273
+
274
+ ### `kill <name>`
275
+
276
+ ```bash
277
+ trellis channel kill <name>
278
+ --as <agent> # REQUIRED — worker agent name
279
+ [--scope project|global]
280
+ [--force] # SIGKILL immediately
281
+ ```
282
+
283
+ Behavior:
284
+ - Default path: SIGTERM → 8 s grace → SIGKILL escalation; the CLI writes a
285
+ `killed` event when SIGKILL was needed so the log stays truthful.
286
+ - Cleans `pid`, `worker-pid`, `config`, `spawnlock` sidecar files; keeps
287
+ `log`, `session-id`, `thread-id` for forensics / resume.
288
+
289
+ ### `rm <name>`
290
+
291
+ ```bash
292
+ trellis channel rm <name>
293
+ [--scope project|global]
294
+ ```
295
+
296
+ Behavior:
297
+ - Kills any live workers, then deletes the entire channel directory.
298
+ - Prints `Removed channel '<name>'`.
299
+
300
+ ### `prune`
301
+
302
+ ```bash
303
+ trellis channel prune
304
+ [--scope project|global] # omitted: scan every project
305
+ [--all | --empty | --idle <Ns|Nm|Nh|Nd> | --ephemeral] # mutually exclusive
306
+ [--yes] # actually delete (default: dry-run)
307
+ [--dry-run] # default true; redundant with default
308
+ [--keep <names,csv>] # exclusion list
309
+ ```
310
+
311
+ Behavior:
312
+ - Filter flags are mutually exclusive — error otherwise.
313
+ - Default is dry-run; `--yes` flips to real delete.
314
+ - Without `--scope`, scans **every** project bucket (intentional, repo-wide
315
+ cleanup); with `--scope project|global`, limited to that bucket.
316
+ - Live-worker channels are always skipped regardless of filter.
317
+ - Output: per-candidate line `name last-ts (reason)` plus a final summary.
318
+
319
+ ---
320
+
321
+ ## Forum Channels
322
+
323
+ ### `post <name> <action>`
324
+
325
+ ```bash
326
+ trellis channel post <name> <action>
327
+ --as <agent> # REQUIRED
328
+ [--scope project|global]
329
+ [--thread <key>] # required except action=opened
330
+ [--title <text>]
331
+ [--text <text> | --stdin | --text-file <path>]
332
+ [--description <text>] # stable thread description
333
+ [--status <status>]
334
+ [--labels a,b] # REPLACES thread labels
335
+ [--assignees a,b] # REPLACES assignees
336
+ [--summary <text>]
337
+ [--context-file <abs-path>] ...
338
+ [--context-raw <text>] ...
339
+ [--linked-context-file <abs-path>] # [deprecated alias]
340
+ [--linked-context-raw <text>] # [deprecated alias]
341
+ ```
342
+
343
+ Behavior:
344
+ - `<action>` is free-form on the CLI surface; conventional values include
345
+ `opened`, `comment`, `status`, `labels`, `assignees`, `summary`,
346
+ `processed`.
347
+ - `action=rename` is rejected — use `thread rename` instead.
348
+ - `--labels` / `--assignees` are replace-semantics, not append.
349
+ - Output: appended event JSON on stdout.
350
+
351
+ ### `forum <name>`
352
+
353
+ ```bash
354
+ trellis channel forum <name>
355
+ [--scope project|global]
356
+ [--status <status>]
357
+ [--raw]
358
+ ```
359
+
360
+ Behavior:
361
+ - Lists threads (reduced state). `--status` filters by current thread
362
+ status. `--raw` prints one JSON per thread.
363
+
364
+ ### `thread <name> <thread>` / `thread rename`
365
+
366
+ ```bash
367
+ trellis channel thread <name> <thread-key>
368
+ [--scope project|global]
369
+ [--raw]
370
+
371
+ trellis channel thread rename <name> <old-thread> <new-thread>
372
+ --as <agent> # REQUIRED
373
+ [--scope project|global]
374
+ ```
375
+
376
+ Behavior:
377
+ - `thread <name> <key>` shows one thread's timeline:
378
+ header `<thread> [<status>] <title>`, then description / labels /
379
+ assignees / summary / timeline lines. `--raw` switches to raw events.
380
+ - `thread rename` is the only mutation; `post --action rename` is rejected.
381
+
382
+ ---
383
+
384
+ ## Context / Title
385
+
386
+ ### `context add` / `context delete` / `context list`
387
+
388
+ ```bash
389
+ trellis channel context add <name>
390
+ [--as <agent>] # default: main
391
+ [--scope project|global]
392
+ [--thread <key>] # thread-level instead of channel-level
393
+ [--file <abs-path>] ... # repeatable
394
+ [--raw <text>] ... # repeatable
395
+ # at least one of --file or --raw
396
+
397
+ trellis channel context delete <name>
398
+ [--as <agent>] # default: main
399
+ [--scope project|global]
400
+ [--thread <key>]
401
+ [--file <abs-path>] ...
402
+ [--raw <text>] ...
403
+
404
+ trellis channel context list <name>
405
+ [--scope project|global]
406
+ [--thread <key>]
407
+ [--raw] # one JSON entry per line
408
+ ```
409
+
410
+ Behavior:
411
+ - `add` / `delete` append a `context` event and print the event JSON.
412
+ - `list` projects current context entries; pretty output is
413
+ `file <path>` / `raw <truncated text>` lines, `(no context)` when empty.
414
+
415
+ ### `title set <name>` / `title clear <name>`
416
+
417
+ ```bash
418
+ trellis channel title set <name>
419
+ --title <text> # REQUIRED
420
+ [--as <agent>] # default: main
421
+ [--scope project|global]
422
+
423
+ trellis channel title clear <name>
424
+ [--as <agent>] # default: main
425
+ [--scope project|global]
426
+ ```
427
+
428
+ Behavior:
429
+ - Appends a `title` event projecting a stable display title onto the
430
+ channel. Output: event JSON.
431
+
432
+ ---
433
+
434
+ ## Hidden / Internal
435
+
436
+ | Command | Purpose |
437
+ |---|---|
438
+ | `channel __supervisor <channel> <worker> <config>` | Forked entry point invoked by `spawn`. Do not invoke directly. |
439
+ | `channel __parse-trace <adapter> <file>` | Dev helper — replays a recorded stream-json / wire trace through the matching adapter and prints the resulting channel events. Adapter is validated against the provider registry. |
440
+
441
+ ---
442
+
443
+ ## Event Model
444
+
445
+ `CHANNEL_EVENT_KINDS` (whitelist enforced by `parseChannelKind`):
446
+
447
+ `create`, `join`, `leave`, `message`, `thread`, `context`, `channel`,
448
+ `spawned`, `killed`, `respawned`, `progress`, `done`, `error`, `waiting`,
449
+ `awake`, `undeliverable`, `interrupt_requested`, `turn_started`,
450
+ `turn_finished`, `interrupted`, `supervisor_warning`.
451
+
452
+ `MEANINGFUL_EVENT_KINDS` (default-visible subset used by `wait` /
453
+ `messages` when no explicit `--kind` is given):
454
+
455
+ `create`, `join`, `leave`, `message`, `thread`, `context`, `channel`,
456
+ `spawned`, `killed`, `respawned`, `done`, `error`.
457
+
458
+ Non-meaningful kinds (e.g. `progress`, `waiting`, `awake`,
459
+ `supervisor_warning`, the `turn_*` / `interrupt*` set) still flow through
460
+ the store; opt in via `--kind` or `--include-progress`.
461
+
462
+ Forum channels are event-sourced; use the CLI reducers
463
+ (`forum`, `thread`, `context list`) for state projection.
464
+
465
+ ---
466
+
467
+ ## Output Conventions
468
+
469
+ - **Mutations** (`send`, `interrupt`, `post`, `context add/delete`,
470
+ `title set/clear`, `thread rename`) print the appended event as one JSON
471
+ line on **stdout**.
472
+ - **Streaming reads** (`wait`, `messages --follow`) print one JSON event
473
+ per line on stdout.
474
+ - **Pretty reads** (`list`, `messages`, `forum`, `thread`, `context list`)
475
+ print colored, padded tables / timelines.
476
+ - **`run`** prints only the final assistant text on stdout (so callers can
477
+ pipe); diagnostic notes go to stderr.
478
+ - **Errors** go through `chalk.red("Error:")` to stderr and `exit 1`.
479
+ - **`wait` timeout** specifically exits **124**.
480
+