@pennixrv/trellis 0.7.0-beta.8 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (484) hide show
  1. package/README.md +1 -1
  2. package/dist/cli/index.d.ts.map +1 -1
  3. package/dist/cli/index.js +14 -26
  4. package/dist/cli/index.js.map +1 -1
  5. package/dist/commands/ablate.js +1 -1
  6. package/dist/commands/ablate.js.map +1 -1
  7. package/dist/commands/init.d.ts.map +1 -1
  8. package/dist/commands/init.js +30 -56
  9. package/dist/commands/init.js.map +1 -1
  10. package/dist/commands/task-progress.d.ts +2 -0
  11. package/dist/commands/task-progress.d.ts.map +1 -1
  12. package/dist/commands/task-progress.js +37 -30
  13. package/dist/commands/task-progress.js.map +1 -1
  14. package/dist/commands/{channel → teamwork}/adapters/claude.d.ts +3 -3
  15. package/dist/commands/teamwork/adapters/claude.d.ts.map +1 -0
  16. package/dist/commands/{channel → teamwork}/adapters/claude.js +3 -3
  17. package/dist/commands/teamwork/adapters/claude.js.map +1 -0
  18. package/dist/commands/{channel → teamwork}/adapters/codex.d.ts +1 -15
  19. package/dist/commands/teamwork/adapters/codex.d.ts.map +1 -0
  20. package/dist/commands/{channel → teamwork}/adapters/codex.js +5 -42
  21. package/dist/commands/teamwork/adapters/codex.js.map +1 -0
  22. package/dist/commands/{channel → teamwork}/adapters/index.d.ts +6 -6
  23. package/dist/commands/teamwork/adapters/index.d.ts.map +1 -0
  24. package/dist/commands/{channel → teamwork}/adapters/index.js +16 -52
  25. package/dist/commands/teamwork/adapters/index.js.map +1 -0
  26. package/dist/commands/{channel → teamwork}/adapters/types.d.ts +2 -2
  27. package/dist/commands/teamwork/adapters/types.d.ts.map +1 -0
  28. package/dist/commands/teamwork/adapters/types.js.map +1 -0
  29. package/dist/commands/{channel → teamwork}/agent-loader.d.ts +2 -4
  30. package/dist/commands/teamwork/agent-loader.d.ts.map +1 -0
  31. package/dist/commands/{channel → teamwork}/agent-loader.js +4 -35
  32. package/dist/commands/teamwork/agent-loader.js.map +1 -0
  33. package/dist/commands/teamwork/artifact.d.ts +177 -0
  34. package/dist/commands/teamwork/artifact.d.ts.map +1 -0
  35. package/dist/commands/teamwork/artifact.js +908 -0
  36. package/dist/commands/teamwork/artifact.js.map +1 -0
  37. package/dist/commands/{channel → teamwork}/context-loader.d.ts +1 -1
  38. package/dist/commands/teamwork/context-loader.d.ts.map +1 -0
  39. package/dist/commands/{channel → teamwork}/context-loader.js +12 -12
  40. package/dist/commands/teamwork/context-loader.js.map +1 -0
  41. package/dist/commands/{channel → teamwork}/context-trust.d.ts +6 -6
  42. package/dist/commands/teamwork/context-trust.d.ts.map +1 -0
  43. package/dist/commands/{channel → teamwork}/context-trust.js +16 -16
  44. package/dist/commands/teamwork/context-trust.js.map +1 -0
  45. package/dist/commands/teamwork/context.d.ts +16 -0
  46. package/dist/commands/teamwork/context.d.ts.map +1 -0
  47. package/dist/commands/{channel → teamwork}/context.js +17 -17
  48. package/dist/commands/teamwork/context.js.map +1 -0
  49. package/dist/commands/teamwork/coordinator.d.ts +89 -0
  50. package/dist/commands/teamwork/coordinator.d.ts.map +1 -0
  51. package/dist/commands/teamwork/coordinator.js +1198 -0
  52. package/dist/commands/teamwork/coordinator.js.map +1 -0
  53. package/dist/commands/teamwork/create.d.ts +23 -0
  54. package/dist/commands/teamwork/create.d.ts.map +1 -0
  55. package/dist/commands/teamwork/create.js +39 -0
  56. package/dist/commands/teamwork/create.js.map +1 -0
  57. package/dist/commands/{channel → teamwork}/dev-parse-trace.d.ts +1 -1
  58. package/dist/commands/teamwork/dev-parse-trace.d.ts.map +1 -0
  59. package/dist/commands/{channel → teamwork}/dev-parse-trace.js +1 -1
  60. package/dist/commands/teamwork/dev-parse-trace.js.map +1 -0
  61. package/dist/commands/{channel → teamwork}/guard.d.ts +27 -46
  62. package/dist/commands/teamwork/guard.d.ts.map +1 -0
  63. package/dist/commands/{channel → teamwork}/guard.js +54 -156
  64. package/dist/commands/teamwork/guard.js.map +1 -0
  65. package/dist/commands/teamwork/index.d.ts +3 -0
  66. package/dist/commands/teamwork/index.d.ts.map +1 -0
  67. package/dist/commands/{channel → teamwork}/index.js +135 -165
  68. package/dist/commands/teamwork/index.js.map +1 -0
  69. package/dist/commands/{channel → teamwork}/interrupt.d.ts +1 -1
  70. package/dist/commands/teamwork/interrupt.d.ts.map +1 -0
  71. package/dist/commands/teamwork/interrupt.js +22 -0
  72. package/dist/commands/teamwork/interrupt.js.map +1 -0
  73. package/dist/commands/teamwork/kill.d.ts +7 -0
  74. package/dist/commands/teamwork/kill.d.ts.map +1 -0
  75. package/dist/commands/{channel → teamwork}/kill.js +21 -21
  76. package/dist/commands/teamwork/kill.js.map +1 -0
  77. package/dist/commands/teamwork/list.d.ts +17 -0
  78. package/dist/commands/teamwork/list.d.ts.map +1 -0
  79. package/dist/commands/{channel → teamwork}/list.js +18 -27
  80. package/dist/commands/teamwork/list.js.map +1 -0
  81. package/dist/commands/{channel → teamwork}/messages.d.ts +1 -1
  82. package/dist/commands/teamwork/messages.d.ts.map +1 -0
  83. package/dist/commands/{channel → teamwork}/messages.js +18 -18
  84. package/dist/commands/teamwork/messages.js.map +1 -0
  85. package/dist/commands/teamwork/profiles.d.ts +25 -0
  86. package/dist/commands/teamwork/profiles.d.ts.map +1 -0
  87. package/dist/commands/teamwork/profiles.js +125 -0
  88. package/dist/commands/teamwork/profiles.js.map +1 -0
  89. package/dist/commands/teamwork/rm.d.ts +27 -0
  90. package/dist/commands/teamwork/rm.d.ts.map +1 -0
  91. package/dist/commands/{channel → teamwork}/rm.js +21 -22
  92. package/dist/commands/teamwork/rm.js.map +1 -0
  93. package/dist/commands/teamwork/run.d.ts +29 -0
  94. package/dist/commands/{channel → teamwork}/run.d.ts.map +1 -1
  95. package/dist/commands/teamwork/run.js +129 -0
  96. package/dist/commands/teamwork/run.js.map +1 -0
  97. package/dist/commands/{channel → teamwork}/send.d.ts +1 -1
  98. package/dist/commands/teamwork/send.d.ts.map +1 -0
  99. package/dist/commands/{channel → teamwork}/send.js +7 -7
  100. package/dist/commands/teamwork/send.js.map +1 -0
  101. package/dist/commands/{channel → teamwork}/spawn.d.ts +8 -12
  102. package/dist/commands/teamwork/spawn.d.ts.map +1 -0
  103. package/dist/commands/{channel → teamwork}/spawn.js +51 -112
  104. package/dist/commands/teamwork/spawn.js.map +1 -0
  105. package/dist/commands/teamwork/store/events.d.ts +22 -0
  106. package/dist/commands/teamwork/store/events.d.ts.map +1 -0
  107. package/dist/commands/{channel → teamwork}/store/events.js +8 -8
  108. package/dist/commands/teamwork/store/events.js.map +1 -0
  109. package/dist/commands/teamwork/store/filter.d.ts +3 -0
  110. package/dist/commands/teamwork/store/filter.d.ts.map +1 -0
  111. package/dist/commands/teamwork/store/filter.js +2 -0
  112. package/dist/commands/teamwork/store/filter.js.map +1 -0
  113. package/dist/commands/{channel → teamwork}/store/lock.d.ts +1 -1
  114. package/dist/commands/teamwork/store/lock.d.ts.map +1 -0
  115. package/dist/commands/{channel → teamwork}/store/lock.js +2 -2
  116. package/dist/commands/teamwork/store/lock.js.map +1 -0
  117. package/dist/commands/{channel → teamwork}/store/paths.d.ts +18 -32
  118. package/dist/commands/teamwork/store/paths.d.ts.map +1 -0
  119. package/dist/commands/{channel → teamwork}/store/paths.js +42 -109
  120. package/dist/commands/teamwork/store/paths.js.map +1 -0
  121. package/dist/commands/teamwork/store/schema.d.ts +18 -0
  122. package/dist/commands/teamwork/store/schema.d.ts.map +1 -0
  123. package/dist/commands/teamwork/store/schema.js +23 -0
  124. package/dist/commands/teamwork/store/schema.js.map +1 -0
  125. package/dist/commands/{channel → teamwork}/store/thread-state.d.ts +3 -3
  126. package/dist/commands/teamwork/store/thread-state.d.ts.map +1 -0
  127. package/dist/commands/{channel → teamwork}/store/thread-state.js +1 -1
  128. package/dist/commands/teamwork/store/thread-state.js.map +1 -0
  129. package/dist/commands/teamwork/store/watch.d.ts +19 -0
  130. package/dist/commands/teamwork/store/watch.d.ts.map +1 -0
  131. package/dist/commands/{channel → teamwork}/store/watch.js +8 -8
  132. package/dist/commands/teamwork/store/watch.js.map +1 -0
  133. package/dist/commands/teamwork/supervisor/idle.d.ts.map +1 -0
  134. package/dist/commands/teamwork/supervisor/idle.js.map +1 -0
  135. package/dist/commands/{channel → teamwork}/supervisor/inbox.d.ts +2 -2
  136. package/dist/commands/teamwork/supervisor/inbox.d.ts.map +1 -0
  137. package/dist/commands/{channel → teamwork}/supervisor/inbox.js +14 -14
  138. package/dist/commands/teamwork/supervisor/inbox.js.map +1 -0
  139. package/dist/commands/{channel → teamwork}/supervisor/shutdown.d.ts +3 -6
  140. package/dist/commands/teamwork/supervisor/shutdown.d.ts.map +1 -0
  141. package/dist/commands/{channel → teamwork}/supervisor/shutdown.js +7 -17
  142. package/dist/commands/teamwork/supervisor/shutdown.js.map +1 -0
  143. package/dist/commands/{channel → teamwork}/supervisor/stdout.d.ts +3 -5
  144. package/dist/commands/teamwork/supervisor/stdout.d.ts.map +1 -0
  145. package/dist/commands/{channel → teamwork}/supervisor/stdout.js +12 -23
  146. package/dist/commands/teamwork/supervisor/stdout.js.map +1 -0
  147. package/dist/commands/teamwork/supervisor/turns.d.ts.map +1 -0
  148. package/dist/commands/teamwork/supervisor/turns.js.map +1 -0
  149. package/dist/commands/{channel → teamwork}/supervisor/warning.d.ts +5 -5
  150. package/dist/commands/teamwork/supervisor/warning.d.ts.map +1 -0
  151. package/dist/commands/{channel → teamwork}/supervisor/warning.js +6 -6
  152. package/dist/commands/teamwork/supervisor/warning.js.map +1 -0
  153. package/dist/commands/{channel → teamwork}/supervisor.d.ts +21 -21
  154. package/dist/commands/teamwork/supervisor.d.ts.map +1 -0
  155. package/dist/commands/{channel → teamwork}/supervisor.js +53 -63
  156. package/dist/commands/teamwork/supervisor.js.map +1 -0
  157. package/dist/commands/teamwork/teammate-adapters.d.ts +31 -0
  158. package/dist/commands/teamwork/teammate-adapters.d.ts.map +1 -0
  159. package/dist/commands/teamwork/teammate-adapters.js +96 -0
  160. package/dist/commands/teamwork/teammate-adapters.js.map +1 -0
  161. package/dist/commands/teamwork/teammate-config.d.ts +19 -0
  162. package/dist/commands/teamwork/teammate-config.d.ts.map +1 -0
  163. package/dist/commands/teamwork/teammate-config.js +97 -0
  164. package/dist/commands/teamwork/teammate-config.js.map +1 -0
  165. package/dist/commands/teamwork/teammate-launch.d.ts +58 -0
  166. package/dist/commands/teamwork/teammate-launch.d.ts.map +1 -0
  167. package/dist/commands/teamwork/teammate-launch.js +125 -0
  168. package/dist/commands/teamwork/teammate-launch.js.map +1 -0
  169. package/dist/commands/teamwork/text-body.d.ts +13 -0
  170. package/dist/commands/teamwork/text-body.d.ts.map +1 -0
  171. package/dist/commands/{channel → teamwork}/text-body.js +3 -3
  172. package/dist/commands/teamwork/text-body.js.map +1 -0
  173. package/dist/commands/teamwork/threads.d.ts +35 -0
  174. package/dist/commands/teamwork/threads.d.ts.map +1 -0
  175. package/dist/commands/{channel → teamwork}/threads.js +19 -19
  176. package/dist/commands/teamwork/threads.js.map +1 -0
  177. package/dist/commands/teamwork/title.d.ts +12 -0
  178. package/dist/commands/teamwork/title.d.ts.map +1 -0
  179. package/dist/commands/teamwork/title.js +24 -0
  180. package/dist/commands/teamwork/title.js.map +1 -0
  181. package/dist/commands/{channel → teamwork}/wait.d.ts +1 -5
  182. package/dist/commands/teamwork/wait.d.ts.map +1 -0
  183. package/dist/commands/{channel → teamwork}/wait.js +8 -21
  184. package/dist/commands/teamwork/wait.js.map +1 -0
  185. package/dist/commands/update.d.ts.map +1 -1
  186. package/dist/commands/update.js +48 -89
  187. package/dist/commands/update.js.map +1 -1
  188. package/dist/commands/workflow.d.ts +1 -1
  189. package/dist/commands/workflow.d.ts.map +1 -1
  190. package/dist/commands/workflow.js +9 -10
  191. package/dist/commands/workflow.js.map +1 -1
  192. package/dist/configurators/claude.d.ts +0 -17
  193. package/dist/configurators/claude.d.ts.map +1 -1
  194. package/dist/configurators/claude.js +2 -61
  195. package/dist/configurators/claude.js.map +1 -1
  196. package/dist/configurators/shared.d.ts.map +1 -1
  197. package/dist/configurators/shared.js +2 -2
  198. package/dist/configurators/shared.js.map +1 -1
  199. package/dist/configurators/snow.js +1 -1
  200. package/dist/configurators/snow.js.map +1 -1
  201. package/dist/configurators/workflow.d.ts +1 -1
  202. package/dist/configurators/workflow.js +5 -5
  203. package/dist/configurators/workflow.js.map +1 -1
  204. package/dist/constants/paths.d.ts +1 -1
  205. package/dist/constants/paths.d.ts.map +1 -1
  206. package/dist/constants/paths.js +1 -1
  207. package/dist/constants/paths.js.map +1 -1
  208. package/dist/migrations/manifests/0.7.0-beta.10.json +9 -0
  209. package/dist/migrations/manifests/0.7.0-beta.11.json +9 -0
  210. package/dist/migrations/manifests/0.7.0-beta.12.json +9 -0
  211. package/dist/migrations/manifests/0.7.0-beta.13.json +9 -0
  212. package/dist/migrations/manifests/0.7.0-beta.14.json +9 -0
  213. package/dist/migrations/manifests/0.7.0-beta.15.json +9 -0
  214. package/dist/migrations/manifests/0.7.0-beta.16.json +9 -0
  215. package/dist/migrations/manifests/0.7.0-beta.17.json +9 -0
  216. package/dist/migrations/manifests/0.7.0-beta.18.json +9 -0
  217. package/dist/migrations/manifests/0.7.0-beta.19.json +9 -0
  218. package/dist/migrations/manifests/0.7.0-beta.20.json +9 -0
  219. package/dist/migrations/manifests/0.7.0-beta.21.json +17 -0
  220. package/dist/migrations/manifests/0.7.0-beta.22.json +9 -0
  221. package/dist/migrations/manifests/0.7.0-beta.23.json +9 -0
  222. package/dist/migrations/manifests/0.7.0-beta.24.json +9 -0
  223. package/dist/migrations/manifests/0.7.0-beta.25.json +9 -0
  224. package/dist/migrations/manifests/0.7.0-beta.26.json +9 -0
  225. package/dist/migrations/manifests/0.7.0-beta.27.json +9 -0
  226. package/dist/migrations/manifests/0.7.0-beta.28.json +9 -0
  227. package/dist/migrations/manifests/0.7.0-beta.29.json +9 -0
  228. package/dist/migrations/manifests/0.7.0-beta.30.json +9 -0
  229. package/dist/migrations/manifests/0.7.0-beta.31.json +9 -0
  230. package/dist/migrations/manifests/0.7.0-beta.32.json +9 -0
  231. package/dist/migrations/manifests/0.7.0-beta.33.json +9 -0
  232. package/dist/migrations/manifests/0.7.0-beta.34.json +9 -0
  233. package/dist/migrations/manifests/0.7.0-beta.35.json +9 -0
  234. package/dist/migrations/manifests/0.7.0-beta.36.json +9 -0
  235. package/dist/migrations/manifests/0.7.0-beta.37.json +9 -0
  236. package/dist/migrations/manifests/0.7.0-beta.38.json +9 -0
  237. package/dist/migrations/manifests/0.7.0-beta.39.json +9 -0
  238. package/dist/migrations/manifests/0.7.0-beta.40.json +9 -0
  239. package/dist/migrations/manifests/0.7.0-beta.41.json +9 -0
  240. package/dist/migrations/manifests/0.7.0-beta.42.json +9 -0
  241. package/dist/migrations/manifests/0.7.0-beta.43.json +9 -0
  242. package/dist/migrations/manifests/0.7.0-beta.44.json +9 -0
  243. package/dist/migrations/manifests/0.7.0-beta.45.json +9 -0
  244. package/dist/migrations/manifests/0.7.0-beta.46.json +9 -0
  245. package/dist/migrations/manifests/0.7.0-beta.47.json +9 -0
  246. package/dist/migrations/manifests/0.7.0-beta.48.json +9 -0
  247. package/dist/migrations/manifests/0.7.0-beta.49.json +13 -0
  248. package/dist/migrations/manifests/0.7.0-beta.50.json +12 -0
  249. package/dist/migrations/manifests/0.7.0-beta.51.json +9 -0
  250. package/dist/migrations/manifests/0.7.0-beta.52.json +9 -0
  251. package/dist/migrations/manifests/0.7.0-beta.53.json +27 -0
  252. package/dist/migrations/manifests/0.7.0-beta.54.json +8 -0
  253. package/dist/migrations/manifests/0.7.0-beta.9.json +9 -0
  254. package/dist/migrations/manifests/0.7.1.json +9 -0
  255. package/dist/templates/claude/hooks/statusline.py +0 -7
  256. package/dist/templates/codex/hooks/session-start.py +31 -38
  257. package/dist/templates/common/bundled-skills/trellis-decision-space-construction-and-merging/SKILL.md +10 -0
  258. package/dist/templates/common/bundled-skills/trellis-decision-space-construction-and-merging/workflow.md +40 -0
  259. package/dist/templates/common/bundled-skills/trellis-delivery-review-and-closeout/SKILL.md +10 -0
  260. package/dist/templates/common/bundled-skills/trellis-delivery-review-and-closeout/workflow.md +55 -0
  261. package/dist/templates/common/bundled-skills/trellis-goal-exploration-and-requirements/SKILL.md +10 -0
  262. package/dist/templates/common/bundled-skills/trellis-goal-exploration-and-requirements/workflow.md +33 -0
  263. package/dist/templates/common/bundled-skills/trellis-meta/SKILL.md +25 -25
  264. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-agents.md +1 -1
  265. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-skills-or-commands.md +13 -19
  266. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-spec-structure.md +1 -1
  267. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-task-lifecycle.md +27 -75
  268. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-workflow.md +17 -56
  269. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/overview.md +1 -1
  270. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/bundled-skills.md +14 -11
  271. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/generated-files.md +0 -33
  272. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/multi-agent-teamwork.md +32 -0
  273. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/spec-system.md +1 -1
  274. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/task-system.md +25 -111
  275. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/workflow.md +19 -60
  276. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/skills-and-commands.md +1 -1
  277. package/dist/templates/common/bundled-skills/trellis-session-insight/SKILL.md +1 -1
  278. package/dist/templates/common/bundled-skills/trellis-session-insight/references/cli-quick-reference.md +1 -1
  279. package/dist/templates/common/bundled-skills/trellis-solution-design-and-convergence/SKILL.md +10 -0
  280. package/dist/templates/common/bundled-skills/trellis-solution-design-and-convergence/workflow.md +36 -0
  281. package/dist/templates/common/bundled-skills/trellis-task-implementation/SKILL.md +10 -0
  282. package/dist/templates/common/bundled-skills/trellis-task-implementation/workflow.md +29 -0
  283. package/dist/templates/common/bundled-skills/trellis-teamwork/SKILL.md +73 -0
  284. package/dist/templates/common/bundled-skills/trellis-teamwork/references/coordination-modes.md +29 -0
  285. package/dist/templates/common/bundled-skills/trellis-teamwork/references/teammate-configuration-matrix.md +31 -0
  286. package/dist/templates/common/bundled-skills/trellis-teamwork/references/teammate-processes.md +37 -0
  287. package/dist/templates/common/bundled-skills/trellis-teamwork/references/teamwork-plan-construction.md +78 -0
  288. package/dist/templates/common/commands/continue.md +9 -49
  289. package/dist/templates/common/commands/finish-work.md +10 -58
  290. package/dist/templates/common/commands/start.md +19 -49
  291. package/dist/templates/common/skills/brainstorm.md +11 -191
  292. package/dist/templates/copilot/hooks/session-start.py +30 -26
  293. package/dist/templates/copilot/prompts/brainstorm.prompt.md +7 -150
  294. package/dist/templates/copilot/prompts/finish-work.prompt.md +11 -88
  295. package/dist/templates/copilot/prompts/record-session.prompt.md +4 -12
  296. package/dist/templates/copilot/prompts/start.prompt.md +12 -10
  297. package/dist/templates/dsh/DSH.md +2 -2
  298. package/dist/templates/kiro/agents/trellis.json +2 -2
  299. package/dist/templates/markdown/agents.md +14 -3
  300. package/dist/templates/markdown/spec/guides/cross-layer-thinking-guide.md.txt +9 -8
  301. package/dist/templates/markdown/spec/guides/cross-platform-thinking-guide.md.txt +1 -1
  302. package/dist/templates/markdown/workspace-index.md +0 -1
  303. package/dist/templates/omp/extensions/trellis/index.ts.txt +28 -17
  304. package/dist/templates/opencode/lib/session-utils.js +20 -25
  305. package/dist/templates/opencode/lib/trellis-context.js +4 -76
  306. package/dist/templates/opencode/plugins/inject-subagent-context.js +5 -4
  307. package/dist/templates/opencode/plugins/inject-workflow-state.js +14 -17
  308. package/dist/templates/shared-hooks/inject-shell-session-context.py +3 -3
  309. package/dist/templates/shared-hooks/inject-subagent-context.py +445 -67
  310. package/dist/templates/shared-hooks/inject-workflow-state.py +44 -36
  311. package/dist/templates/shared-hooks/session-start.py +21 -33
  312. package/dist/templates/trellis/agents/delegated-worktree-primary-agent.md +18 -0
  313. package/dist/templates/trellis/agents/teammate-profiles.json +8 -0
  314. package/dist/templates/trellis/agents/teammate.md +63 -0
  315. package/dist/templates/trellis/config.yaml +29 -38
  316. package/dist/templates/trellis/gitignore.txt +1 -0
  317. package/dist/templates/trellis/index.d.ts +8 -12
  318. package/dist/templates/trellis/index.d.ts.map +1 -1
  319. package/dist/templates/trellis/index.js +14 -25
  320. package/dist/templates/trellis/index.js.map +1 -1
  321. package/dist/templates/trellis/scripts/add_session.py +1 -1
  322. package/dist/templates/trellis/scripts/common/__init__.py +0 -1
  323. package/dist/templates/trellis/scripts/common/active_task.py +136 -100
  324. package/dist/templates/trellis/scripts/common/config.py +7 -9
  325. package/dist/templates/trellis/scripts/common/git_context.py +1 -1
  326. package/dist/templates/trellis/scripts/common/io.py +19 -0
  327. package/dist/templates/trellis/scripts/common/paths.py +0 -1
  328. package/dist/templates/trellis/scripts/common/safe_commit.py +11 -90
  329. package/dist/templates/trellis/scripts/common/session_context.py +1 -8
  330. package/dist/templates/trellis/scripts/common/spec_match.py +1 -1
  331. package/dist/templates/trellis/scripts/common/task_context.py +152 -59
  332. package/dist/templates/trellis/scripts/common/task_continuity.py +563 -0
  333. package/dist/templates/trellis/scripts/common/task_store.py +70 -548
  334. package/dist/templates/trellis/scripts/common/task_utils.py +4 -98
  335. package/dist/templates/trellis/scripts/common/task_workflow.py +1096 -0
  336. package/dist/templates/trellis/scripts/common/tasks.py +5 -8
  337. package/dist/templates/trellis/scripts/common/workflow_phase.py +8 -7
  338. package/dist/templates/trellis/scripts/hooks/linear_sync.py +3 -3
  339. package/dist/templates/trellis/scripts/task.py +114 -377
  340. package/dist/templates/trellis/workflow.md +111 -699
  341. package/dist/utils/agent-refs.d.ts +5 -5
  342. package/dist/utils/agent-refs.js +6 -6
  343. package/dist/utils/file-writer.d.ts +3 -2
  344. package/dist/utils/file-writer.d.ts.map +1 -1
  345. package/dist/utils/file-writer.js +3 -2
  346. package/dist/utils/file-writer.js.map +1 -1
  347. package/dist/utils/managed-paths.d.ts +0 -7
  348. package/dist/utils/managed-paths.d.ts.map +1 -1
  349. package/dist/utils/managed-paths.js +0 -40
  350. package/dist/utils/managed-paths.js.map +1 -1
  351. package/dist/utils/manifest-prune.d.ts.map +1 -1
  352. package/dist/utils/manifest-prune.js +2 -11
  353. package/dist/utils/manifest-prune.js.map +1 -1
  354. package/dist/utils/uninstall-scrubbers.d.ts.map +1 -1
  355. package/dist/utils/uninstall-scrubbers.js +3 -3
  356. package/dist/utils/uninstall-scrubbers.js.map +1 -1
  357. package/dist/utils/workflow-resolver.d.ts +10 -16
  358. package/dist/utils/workflow-resolver.d.ts.map +1 -1
  359. package/dist/utils/workflow-resolver.js +25 -36
  360. package/dist/utils/workflow-resolver.js.map +1 -1
  361. package/package.json +2 -2
  362. package/dist/commands/channel/adapters/claude.d.ts.map +0 -1
  363. package/dist/commands/channel/adapters/claude.js.map +0 -1
  364. package/dist/commands/channel/adapters/codex.d.ts.map +0 -1
  365. package/dist/commands/channel/adapters/codex.js.map +0 -1
  366. package/dist/commands/channel/adapters/index.d.ts.map +0 -1
  367. package/dist/commands/channel/adapters/index.js.map +0 -1
  368. package/dist/commands/channel/adapters/types.d.ts.map +0 -1
  369. package/dist/commands/channel/adapters/types.js.map +0 -1
  370. package/dist/commands/channel/agent-loader.d.ts.map +0 -1
  371. package/dist/commands/channel/agent-loader.js.map +0 -1
  372. package/dist/commands/channel/context-loader.d.ts.map +0 -1
  373. package/dist/commands/channel/context-loader.js.map +0 -1
  374. package/dist/commands/channel/context-trust.d.ts.map +0 -1
  375. package/dist/commands/channel/context-trust.js.map +0 -1
  376. package/dist/commands/channel/context.d.ts +0 -16
  377. package/dist/commands/channel/context.d.ts.map +0 -1
  378. package/dist/commands/channel/context.js.map +0 -1
  379. package/dist/commands/channel/create.d.ts +0 -29
  380. package/dist/commands/channel/create.d.ts.map +0 -1
  381. package/dist/commands/channel/create.js +0 -47
  382. package/dist/commands/channel/create.js.map +0 -1
  383. package/dist/commands/channel/dev-parse-trace.d.ts.map +0 -1
  384. package/dist/commands/channel/dev-parse-trace.js.map +0 -1
  385. package/dist/commands/channel/guard.d.ts.map +0 -1
  386. package/dist/commands/channel/guard.js.map +0 -1
  387. package/dist/commands/channel/index.d.ts +0 -3
  388. package/dist/commands/channel/index.d.ts.map +0 -1
  389. package/dist/commands/channel/index.js.map +0 -1
  390. package/dist/commands/channel/interrupt.d.ts.map +0 -1
  391. package/dist/commands/channel/interrupt.js +0 -22
  392. package/dist/commands/channel/interrupt.js.map +0 -1
  393. package/dist/commands/channel/kill.d.ts +0 -7
  394. package/dist/commands/channel/kill.d.ts.map +0 -1
  395. package/dist/commands/channel/kill.js.map +0 -1
  396. package/dist/commands/channel/list.d.ts +0 -18
  397. package/dist/commands/channel/list.d.ts.map +0 -1
  398. package/dist/commands/channel/list.js.map +0 -1
  399. package/dist/commands/channel/messages.d.ts.map +0 -1
  400. package/dist/commands/channel/messages.js.map +0 -1
  401. package/dist/commands/channel/rm.d.ts +0 -27
  402. package/dist/commands/channel/rm.d.ts.map +0 -1
  403. package/dist/commands/channel/rm.js.map +0 -1
  404. package/dist/commands/channel/run.d.ts +0 -32
  405. package/dist/commands/channel/run.js +0 -141
  406. package/dist/commands/channel/run.js.map +0 -1
  407. package/dist/commands/channel/send.d.ts.map +0 -1
  408. package/dist/commands/channel/send.js.map +0 -1
  409. package/dist/commands/channel/spawn.d.ts.map +0 -1
  410. package/dist/commands/channel/spawn.js.map +0 -1
  411. package/dist/commands/channel/store/events.d.ts +0 -22
  412. package/dist/commands/channel/store/events.d.ts.map +0 -1
  413. package/dist/commands/channel/store/events.js.map +0 -1
  414. package/dist/commands/channel/store/filter.d.ts +0 -3
  415. package/dist/commands/channel/store/filter.d.ts.map +0 -1
  416. package/dist/commands/channel/store/filter.js +0 -2
  417. package/dist/commands/channel/store/filter.js.map +0 -1
  418. package/dist/commands/channel/store/lock.d.ts.map +0 -1
  419. package/dist/commands/channel/store/lock.js.map +0 -1
  420. package/dist/commands/channel/store/paths.d.ts.map +0 -1
  421. package/dist/commands/channel/store/paths.js.map +0 -1
  422. package/dist/commands/channel/store/schema.d.ts +0 -27
  423. package/dist/commands/channel/store/schema.d.ts.map +0 -1
  424. package/dist/commands/channel/store/schema.js +0 -34
  425. package/dist/commands/channel/store/schema.js.map +0 -1
  426. package/dist/commands/channel/store/thread-state.d.ts.map +0 -1
  427. package/dist/commands/channel/store/thread-state.js.map +0 -1
  428. package/dist/commands/channel/store/watch.d.ts +0 -19
  429. package/dist/commands/channel/store/watch.d.ts.map +0 -1
  430. package/dist/commands/channel/store/watch.js.map +0 -1
  431. package/dist/commands/channel/supervisor/idle.d.ts.map +0 -1
  432. package/dist/commands/channel/supervisor/idle.js.map +0 -1
  433. package/dist/commands/channel/supervisor/inbox.d.ts.map +0 -1
  434. package/dist/commands/channel/supervisor/inbox.js.map +0 -1
  435. package/dist/commands/channel/supervisor/shutdown.d.ts.map +0 -1
  436. package/dist/commands/channel/supervisor/shutdown.js.map +0 -1
  437. package/dist/commands/channel/supervisor/stdout.d.ts.map +0 -1
  438. package/dist/commands/channel/supervisor/stdout.js.map +0 -1
  439. package/dist/commands/channel/supervisor/turns.d.ts.map +0 -1
  440. package/dist/commands/channel/supervisor/turns.js.map +0 -1
  441. package/dist/commands/channel/supervisor/warning.d.ts.map +0 -1
  442. package/dist/commands/channel/supervisor/warning.js.map +0 -1
  443. package/dist/commands/channel/supervisor.d.ts.map +0 -1
  444. package/dist/commands/channel/supervisor.js.map +0 -1
  445. package/dist/commands/channel/text-body.d.ts +0 -13
  446. package/dist/commands/channel/text-body.d.ts.map +0 -1
  447. package/dist/commands/channel/text-body.js.map +0 -1
  448. package/dist/commands/channel/threads.d.ts +0 -39
  449. package/dist/commands/channel/threads.d.ts.map +0 -1
  450. package/dist/commands/channel/threads.js.map +0 -1
  451. package/dist/commands/channel/title.d.ts +0 -12
  452. package/dist/commands/channel/title.d.ts.map +0 -1
  453. package/dist/commands/channel/title.js +0 -24
  454. package/dist/commands/channel/title.js.map +0 -1
  455. package/dist/commands/channel/wait.d.ts.map +0 -1
  456. package/dist/commands/channel/wait.js.map +0 -1
  457. package/dist/commands/channel/workers.d.ts +0 -9
  458. package/dist/commands/channel/workers.d.ts.map +0 -1
  459. package/dist/commands/channel/workers.js +0 -31
  460. package/dist/commands/channel/workers.js.map +0 -1
  461. package/dist/templates/common/bundled-skills/trellis-channel/SKILL.md +0 -69
  462. package/dist/templates/common/bundled-skills/trellis-channel/references/command-reference.md +0 -549
  463. package/dist/templates/common/bundled-skills/trellis-channel/references/forum.md +0 -233
  464. package/dist/templates/common/bundled-skills/trellis-channel/references/progress-debugging.md +0 -237
  465. package/dist/templates/common/bundled-skills/trellis-channel/references/subnode-work.md +0 -193
  466. package/dist/templates/common/bundled-skills/trellis-channel/references/workers.md +0 -295
  467. package/dist/templates/common/bundled-skills/trellis-channel/references/workflows.md +0 -131
  468. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/multi-agent-channel.md +0 -70
  469. package/dist/templates/common/bundled-skills/trellis-research-record/SKILL.md +0 -14
  470. package/dist/templates/copilot/prompts/parallel.prompt.md +0 -204
  471. package/dist/templates/trellis/agents/check.md +0 -70
  472. package/dist/templates/trellis/agents/implement.md +0 -71
  473. package/dist/templates/trellis/agents/subnode.env +0 -4
  474. package/dist/templates/trellis/agents/subnode.md +0 -69
  475. package/dist/templates/trellis/scripts/common/context_projection.py +0 -508
  476. package/dist/templates/trellis/scripts/common/continuation_record.py +0 -450
  477. package/dist/templates/trellis/scripts/common/ownership_record.py +0 -439
  478. package/dist/templates/trellis/scripts/subnode_artifact.py +0 -597
  479. package/dist/templates/trellis/scripts/workspace_note.py +0 -126
  480. /package/dist/commands/{channel → teamwork}/adapters/types.js +0 -0
  481. /package/dist/commands/{channel → teamwork}/supervisor/idle.d.ts +0 -0
  482. /package/dist/commands/{channel → teamwork}/supervisor/idle.js +0 -0
  483. /package/dist/commands/{channel → teamwork}/supervisor/turns.d.ts +0 -0
  484. /package/dist/commands/{channel → teamwork}/supervisor/turns.js +0 -0
@@ -0,0 +1,125 @@
1
+ import crypto from "node:crypto";
2
+ import fs from "node:fs";
3
+ import path from "node:path";
4
+ import { loadAgent } from "./agent-loader.js";
5
+ export const TEAMMATE_ROLE_ID = "teammate";
6
+ export const TEAMMATE_PROFILES_PATH = ".trellis/agents/teammate-profiles.json";
7
+ export const REASONING_EFFORTS = ["medium", "high", "xhigh"];
8
+ function text(value, field) {
9
+ if (value === undefined)
10
+ return undefined;
11
+ if (typeof value !== "string" ||
12
+ value.trim() === "" ||
13
+ value.length > 256 ||
14
+ /[\r\n\0]/.test(value)) {
15
+ throw new Error(`${field} must be bounded text`);
16
+ }
17
+ return value.trim();
18
+ }
19
+ function provider(value, field) {
20
+ const result = text(value, field);
21
+ if (result === undefined)
22
+ return undefined;
23
+ if (result !== "claude" &&
24
+ result !== "codex" &&
25
+ result !== "dsh" &&
26
+ result !== "copilot") {
27
+ throw new Error(`${field} must be claude, codex, dsh, or copilot`);
28
+ }
29
+ return result;
30
+ }
31
+ function record(value, field) {
32
+ if (!value || typeof value !== "object" || Array.isArray(value)) {
33
+ throw new Error(`${field} must be an object`);
34
+ }
35
+ return value;
36
+ }
37
+ function loadProfiles(cwd) {
38
+ const filePath = path.resolve(cwd, TEAMMATE_PROFILES_PATH);
39
+ if (!fs.existsSync(filePath))
40
+ return undefined;
41
+ const stat = fs.lstatSync(filePath);
42
+ if (!stat.isFile() || stat.isSymbolicLink() || stat.size > 64 * 1024) {
43
+ throw new Error(`invalid teammate profile file: ${TEAMMATE_PROFILES_PATH}`);
44
+ }
45
+ const raw = fs.readFileSync(filePath);
46
+ const value = record(JSON.parse(raw.toString("utf8")), "teammate profile file");
47
+ if (!value.profiles ||
48
+ typeof value.profiles !== "object" ||
49
+ Array.isArray(value.profiles)) {
50
+ throw new Error("teammate profile file must contain an object named profiles");
51
+ }
52
+ provider(value.default_provider, "default_provider");
53
+ text(value.default_model, "default_model");
54
+ for (const [id, entry] of Object.entries(value.profiles)) {
55
+ if (!/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/.test(id) ||
56
+ !entry ||
57
+ typeof entry !== "object" ||
58
+ Array.isArray(entry)) {
59
+ throw new Error(`invalid teammate profile '${id}'`);
60
+ }
61
+ provider(entry.provider, `profiles.${id}.provider`);
62
+ text(entry.model, `profiles.${id}.model`);
63
+ if (entry.reasoning_effort !== undefined &&
64
+ !REASONING_EFFORTS.includes(entry.reasoning_effort)) {
65
+ throw new Error(`profiles.${id}.reasoning_effort is invalid`);
66
+ }
67
+ if (entry.options !== undefined) {
68
+ const options = record(entry.options, `profiles.${id}.options`);
69
+ if (Object.keys(options).length > 32)
70
+ throw new Error(`profiles.${id}.options has too many entries`);
71
+ for (const [key, option] of Object.entries(options)) {
72
+ if (!/^[A-Za-z0-9._-]{1,64}$/.test(key))
73
+ throw new Error(`profiles.${id}.options has an invalid key`);
74
+ if (typeof option !== "string" &&
75
+ typeof option !== "number" &&
76
+ typeof option !== "boolean") {
77
+ throw new Error(`profiles.${id}.options.${key} must be a scalar`);
78
+ }
79
+ if (typeof option === "number" && !Number.isFinite(option))
80
+ throw new Error(`profiles.${id}.options.${key} must be finite`);
81
+ if (typeof option === "string")
82
+ text(option, `profiles.${id}.options.${key}`);
83
+ }
84
+ }
85
+ }
86
+ return {
87
+ file: value,
88
+ digest: crypto.createHash("sha256").update(raw).digest("hex"),
89
+ };
90
+ }
91
+ export function resolveTeammateProfile(input) {
92
+ const roleId = input.roleId ?? TEAMMATE_ROLE_ID;
93
+ if (roleId !== TEAMMATE_ROLE_ID)
94
+ throw new Error(`unsupported role '${roleId}'`);
95
+ const agent = loadAgent(roleId, input.cwd);
96
+ const loaded = loadProfiles(input.cwd);
97
+ const profile = input.profile
98
+ ? loaded?.file.profiles[input.profile]
99
+ : undefined;
100
+ if (input.profile && !profile)
101
+ throw new Error(`unknown teammate profile '${input.profile}'`);
102
+ const selectedProvider = input.provider ?? profile?.provider ?? loaded?.file.default_provider;
103
+ if (!selectedProvider)
104
+ throw new Error("teammate provider must be selected explicitly or by profile");
105
+ const selectedModel = input.model ?? profile?.model ?? loaded?.file.default_model;
106
+ return {
107
+ roleId,
108
+ provider: selectedProvider,
109
+ ...(selectedModel ? { model: selectedModel } : {}),
110
+ ...(input.profile ? { profile: input.profile } : {}),
111
+ ...(profile?.reasoning_effort
112
+ ? { reasoningEffort: profile.reasoning_effort }
113
+ : {}),
114
+ options: profile?.options ?? {},
115
+ rolePrompt: agent.systemPrompt,
116
+ rolePath: agent.filePath,
117
+ ...(loaded
118
+ ? {
119
+ profilePath: path.resolve(input.cwd, TEAMMATE_PROFILES_PATH),
120
+ profileDigest: loaded.digest,
121
+ }
122
+ : {}),
123
+ };
124
+ }
125
+ //# sourceMappingURL=profiles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profiles.js","sourceRoot":"","sources":["../../../src/commands/teamwork/profiles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,MAAM,CAAC,MAAM,gBAAgB,GAAG,UAAU,CAAC;AAC3C,MAAM,CAAC,MAAM,sBAAsB,GAAG,wCAAwC,CAAC;AAC/E,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAU,CAAC;AA8BtE,SAAS,IAAI,CAAC,KAAc,EAAE,KAAa;IACzC,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC1C,IACE,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE;Q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C,CAAC,EAAE,CAAC;QACpD,GAAG,CAAC,OAAO,EAAE,gBAAgB;YAC3B,CAAC,CAAC,EAAE,eAAe,EAAE,OAAO,CAAC,gBAAgB,EAAE;YAC/C,CAAC,CAAC,EAAE,CAAC;QACP,OAAO,EAAE,OAAO,EAAE,OAAO,IAAI,EAAE;QAC/B,UAAU,EAAE,KAAK,CAAC,YAAY;QAC9B,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,GAAG,CAAC,MAAM;YACR,CAAC,CAAC;gBACE,WAAW,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,sBAAsB,CAAC;gBAC5D,aAAa,EAAE,MAAM,CAAC,MAAM;aAC7B;YACH,CAAC,CAAC,EAAE,CAAC;KACR,CAAC;AACJ,CAAC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * `trellis teamwork rm <name>` — stop any live teammates, then remove the
3
+ * Teamwork Session directory under `~/.trellis/teamwork/`.
4
+ *
5
+ * `trellis teamwork prune [--all | --idle <duration> | --empty]` — bulk
6
+ * cleanup matching criteria.
7
+ */
8
+ export interface RmOptions {
9
+ force?: boolean;
10
+ /** Project bucket override. Defaults to current cwd's project. */
11
+ project?: string;
12
+ scope?: string;
13
+ }
14
+ export declare function teamworkSessionRm(name: string, opts?: RmOptions): Promise<void>;
15
+ export interface PruneOptions {
16
+ all?: boolean;
17
+ empty?: boolean;
18
+ idleMs?: number;
19
+ /** Remove only Teamwork Sessions marked `ephemeral: true` in their create event. */
20
+ ephemeral?: boolean;
21
+ dryRun?: boolean;
22
+ yes?: boolean;
23
+ keep?: string[];
24
+ scope?: string;
25
+ }
26
+ export declare function teamworkSessionPrune(opts: PruneOptions): Promise<void>;
27
+ //# sourceMappingURL=rm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rm.d.ts","sourceRoot":"","sources":["../../../src/commands/teamwork/rm.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAmBH,MAAM,WAAW,SAAS;IACxB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,kEAAkE;IAClE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE,SAAc,GACnB,OAAO,CAAC,IAAI,CAAC,CAef;AAED,MAAM,WAAW,YAAY;IAC3B,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oFAAoF;IACpF,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CA2I5E"}
@@ -1,30 +1,30 @@
1
1
  /**
2
- * `trellis channel rm <name>` — kill any live workers, then remove the
3
- * channel directory under `~/.trellis/channels/`.
2
+ * `trellis teamwork rm <name>` — stop any live teammates, then remove the
3
+ * Teamwork Session directory under `~/.trellis/teamwork/`.
4
4
  *
5
- * `trellis channel prune [--all | --idle <duration> | --empty]` — bulk
5
+ * `trellis teamwork prune [--all | --idle <duration> | --empty]` — bulk
6
6
  * cleanup matching criteria.
7
7
  */
8
8
  import fs from "node:fs";
9
9
  import path from "node:path";
10
- import { channelDir, channelRoot, currentProjectKey, eventsPath, listProjects, migrateLegacyChannels, projectDir, resolveExistingChannelRef, } from "./store/paths.js";
11
- import { GLOBAL_PROJECT_KEY, parseChannelScope } from "./store/schema.js";
12
- export async function channelRm(name, opts = {}) {
10
+ import { sessionDir, teamworkRoot, currentProjectKey, eventsPath, listProjects, projectDir, resolveExistingTeamworkSession, } from "./store/paths.js";
11
+ import { GLOBAL_PROJECT_KEY, parseTeamworkSessionScope, } from "./store/schema.js";
12
+ export async function teamworkSessionRm(name, opts = {}) {
13
13
  const project = opts.project ??
14
- resolveExistingChannelRef(name, {
15
- scope: parseChannelScope(opts.scope),
14
+ resolveExistingTeamworkSession(name, {
15
+ scope: parseTeamworkSessionScope(opts.scope),
16
16
  }).project;
17
- const dir = channelDir(name, project);
17
+ const dir = sessionDir(name, project);
18
18
  if (!fs.existsSync(dir)) {
19
- throw new Error(`Channel '${name}' not found at ${dir}`);
19
+ throw new Error(`Teamwork session '${name}' not found at ${dir}`);
20
20
  }
21
21
  await killLiveWorkers(dir);
22
22
  fs.rmSync(dir, { recursive: true, force: true });
23
23
  if (!opts.force) {
24
- console.log(`Removed channel '${name}'`);
24
+ console.log(`Removed Teamwork session '${name}'`);
25
25
  }
26
26
  }
27
- export async function channelPrune(opts) {
27
+ export async function teamworkSessionPrune(opts) {
28
28
  // The filter flags are mutually exclusive — combining them gives a
29
29
  // silently-ignored second filter under the else-if chain below. Catch
30
30
  // that up front so the user knows which one would have applied.
@@ -37,11 +37,10 @@ export async function channelPrune(opts) {
37
37
  if (modes.length > 1) {
38
38
  throw new Error(`prune flags are mutually exclusive: ${modes.join(" / ")}. Pick one.`);
39
39
  }
40
- migrateLegacyChannels();
41
- const scope = parseChannelScope(opts.scope);
42
- const root = channelRoot();
40
+ const scope = parseTeamworkSessionScope(opts.scope);
41
+ const root = teamworkRoot();
43
42
  if (!fs.existsSync(root)) {
44
- console.log("(no channels)");
43
+ console.log("(no Teamwork sessions)");
45
44
  return;
46
45
  }
47
46
  const keep = new Set(opts.keep ?? []);
@@ -67,7 +66,7 @@ export async function channelPrune(opts) {
67
66
  continue; // skip .bucket marker
68
67
  if (keep.has(name))
69
68
  continue;
70
- const chDir = channelDir(name, project);
69
+ const chDir = sessionDir(name, project);
71
70
  try {
72
71
  if (!fs.statSync(chDir).isDirectory())
73
72
  continue;
@@ -75,7 +74,7 @@ export async function channelPrune(opts) {
75
74
  catch {
76
75
  continue;
77
76
  }
78
- // Skip channels that still have a live worker.
77
+ // Skip Teamwork Sessions that still have a live teammate.
79
78
  if (hasLiveWorker(chDir))
80
79
  continue;
81
80
  const eventsFile = eventsPath(name, project);
@@ -140,23 +139,23 @@ export async function channelPrune(opts) {
140
139
  console.log(` ${c.name.padEnd(24)} ${last} (${c.reason})`);
141
140
  }
142
141
  if (opts.dryRun) {
143
- console.log(`\n(dry-run) would remove ${candidates.length} channel(s)`);
142
+ console.log(`\n(dry-run) would remove ${candidates.length} Teamwork session(s)`);
144
143
  return;
145
144
  }
146
145
  if (!opts.yes) {
147
- console.log(`\nRefusing to delete ${candidates.length} channel(s) without --yes. ` +
146
+ console.log(`\nRefusing to delete ${candidates.length} Teamwork Session(s) without --yes. ` +
148
147
  `Re-run with --yes (or --dry-run to preview).`);
149
148
  return;
150
149
  }
151
150
  for (const c of candidates) {
152
151
  try {
153
- await channelRm(c.name, { force: true, project: c.project });
152
+ await teamworkSessionRm(c.name, { force: true, project: c.project });
154
153
  }
155
154
  catch (err) {
156
155
  console.error(` failed to remove ${c.name}: ${err instanceof Error ? err.message : err}`);
157
156
  }
158
157
  }
159
- console.log(`\nRemoved ${candidates.length} channel(s)`);
158
+ console.log(`\nRemoved ${candidates.length} Teamwork session(s)`);
160
159
  }
161
160
  function hasLiveWorker(dir) {
162
161
  try {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rm.js","sourceRoot":"","sources":["../../../src/commands/teamwork/rm.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EACL,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,UAAU,EACV,8BAA8B,GAC/B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,kBAAkB,EAClB,yBAAyB,GAC1B,MAAM,mBAAmB,CAAC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IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,SAAS,KAAK,CAAC,EAAU;IACvB,OAAO,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/C,CAAC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * `teamwork run` — one-shot wrapper for short tasks: create an ephemeral
3
+ * Teamwork Session, spawn one teammate, send a single prompt, wait for `done`,
4
+ * print the teammate's final message, and clean up.
5
+ *
6
+ * Scope (decided in plan-r2):
7
+ * - single teammate only (multi-unit plans use `teamwork batch`)
8
+ * - failure preserves the Teamwork Session and prints its path so the user can
9
+ * inspect; success removes it
10
+ */
11
+ import type { Provider } from "./adapters/index.js";
12
+ export interface RunOptions {
13
+ /** Optional Teamwork Session name; auto-generated if omitted. */
14
+ name?: string;
15
+ agent?: string;
16
+ provider?: Provider;
17
+ as?: string;
18
+ cwd?: string;
19
+ model?: string;
20
+ files?: string[];
21
+ jsonls?: string[];
22
+ message?: string;
23
+ textFile?: string;
24
+ stdin?: boolean;
25
+ /** Per-worker timeout (defaults to 5m if not specified). */
26
+ timeoutMs?: number;
27
+ }
28
+ export declare function teamworkSessionRun(opts: RunOptions): Promise<void>;
29
+ //# sourceMappingURL=run.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/commands/channel/run.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AASpD,MAAM,WAAW,UAAU;IACzB,wDAAwD;IACxD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,4DAA4D;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iEAAiE;IACjE,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,wBAAsB,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAgEhE"}
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/commands/teamwork/run.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AASpD,MAAM,WAAW,UAAU;IACzB,iEAAiE;IACjE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,4DAA4D;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAqDxE"}
@@ -0,0 +1,129 @@
1
+ /**
2
+ * `teamwork run` — one-shot wrapper for short tasks: create an ephemeral
3
+ * Teamwork Session, spawn one teammate, send a single prompt, wait for `done`,
4
+ * print the teammate's final message, and clean up.
5
+ *
6
+ * Scope (decided in plan-r2):
7
+ * - single teammate only (multi-unit plans use `teamwork batch`)
8
+ * - failure preserves the Teamwork Session and prints its path so the user can
9
+ * inspect; success removes it
10
+ */
11
+ import crypto from "node:crypto";
12
+ import fs from "node:fs";
13
+ import { createTeamworkSession } from "./create.js";
14
+ import { teamworkSessionRm } from "./rm.js";
15
+ import { teamworkSessionSend } from "./send.js";
16
+ import { teamworkSessionSpawn } from "./spawn.js";
17
+ import { sessionDir, eventsPath } from "./store/paths.js";
18
+ import { watchEvents } from "./store/watch.js";
19
+ export async function teamworkSessionRun(opts) {
20
+ const name = opts.name ?? `run-${crypto.randomBytes(4).toString("hex")}`;
21
+ const timeoutMs = opts.timeoutMs ?? 5 * 60 * 1000;
22
+ await createTeamworkSession(name, {
23
+ by: "main",
24
+ cwd: opts.cwd,
25
+ ephemeral: true,
26
+ origin: "run",
27
+ });
28
+ let workerName = null;
29
+ let succeeded = false;
30
+ try {
31
+ const spawned = await teamworkSessionSpawn(name, {
32
+ agent: opts.agent,
33
+ provider: opts.provider,
34
+ as: opts.as,
35
+ cwd: opts.cwd,
36
+ model: opts.model,
37
+ timeoutMs,
38
+ files: opts.files,
39
+ jsonls: opts.jsonls,
40
+ });
41
+ workerName = spawned.worker;
42
+ await teamworkSessionSend(name, {
43
+ as: "main",
44
+ to: workerName,
45
+ text: opts.message,
46
+ textFile: opts.textFile,
47
+ stdin: opts.stdin,
48
+ });
49
+ await waitForDone(name, workerName, timeoutMs);
50
+ await printFinalMessage(name, workerName);
51
+ succeeded = true;
52
+ }
53
+ finally {
54
+ if (succeeded) {
55
+ // Clean removal — the Teamwork Session served its purpose.
56
+ await teamworkSessionRm(name, { force: true });
57
+ }
58
+ else {
59
+ // Failure path: keep the Teamwork Session so the user can inspect events.jsonl,
60
+ // logs, pid state etc. The ephemeral flag remains, so a later
61
+ // `teamwork prune --ephemeral` will still clean it.
62
+ const dir = sessionDir(name);
63
+ process.stderr.write(`Teamwork Session kept for inspection: ${dir}\n` +
64
+ `(ephemeral — will be removed by \`teamwork prune --ephemeral\`)\n`);
65
+ process.exitCode = 1;
66
+ }
67
+ }
68
+ }
69
+ /**
70
+ * Block until the worker emits a `done` event, throwing on timeout or
71
+ * `error` event (so the run.ts caller takes the "keep on failure" path).
72
+ */
73
+ async function waitForDone(sessionId, workerName, timeoutMs) {
74
+ const abort = new AbortController();
75
+ const timer = setTimeout(() => abort.abort(), timeoutMs);
76
+ try {
77
+ for await (const ev of watchEvents(sessionId, {
78
+ self: "main",
79
+ from: [workerName],
80
+ }, { signal: abort.signal })) {
81
+ if (ev.kind === "done")
82
+ return;
83
+ if (ev.kind === "error") {
84
+ const msg = ev.message ?? "(no message)";
85
+ throw new Error(`teammate ${workerName} reported error: ${msg}`);
86
+ }
87
+ if (ev.kind === "killed") {
88
+ const reason = ev.reason ?? "(unknown)";
89
+ throw new Error(`teammate ${workerName} killed before done: ${reason}`);
90
+ }
91
+ }
92
+ throw new Error(`timeout waiting for teammate ${workerName} to finish`);
93
+ }
94
+ finally {
95
+ clearTimeout(timer);
96
+ }
97
+ }
98
+ /**
99
+ * Print the worker's final user-visible message. Stdout is reserved for
100
+ * the body so callers can pipe it.
101
+ */
102
+ async function printFinalMessage(sessionId, workerName) {
103
+ const file = eventsPath(sessionId);
104
+ if (!fs.existsSync(file))
105
+ return;
106
+ const lines = fs
107
+ .readFileSync(file, "utf-8")
108
+ .split("\n")
109
+ .filter((l) => l.trim());
110
+ const events = [];
111
+ for (const l of lines) {
112
+ try {
113
+ events.push(JSON.parse(l));
114
+ }
115
+ catch {
116
+ // ignore
117
+ }
118
+ }
119
+ const candidate = events
120
+ .filter((e) => e.kind === "message" && e.by === workerName)
121
+ .pop();
122
+ if (!candidate)
123
+ return;
124
+ const text = candidate.text ?? "";
125
+ process.stdout.write(text);
126
+ if (!text.endsWith("\n"))
127
+ process.stdout.write("\n");
128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AAoB,EAAE,CAAC;IACnC,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;QACtB,IAAI,CAAC;YACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAkB,CAAC,CAAC;QAC9C,CAAC;QAAC,MAAM,CAAC;YACP,SAAS;QACX,CAAC;IACH,CAAC;IACD,MAAM,SAAS,GAAG,MAAM;SACrB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,SAAS,IAAI,CAAC,CAAC,EAAE,KAAK,UAAU,CAAC;SAC1D,GAAG,EAAE,CAAC;IACT,IAAI,CAAC,SAAS;QAAE,OAAO;IACvB,MAAM,IAAI,GAAI,SAA+B,CAAC,IAAI,IAAI,EAAE,CAAC;IACzD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC3B,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;QAAE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AACvD,CAAC"}
@@ -7,5 +7,5 @@ export interface SendOptions {
7
7
  to?: string;
8
8
  deliveryMode?: string;
9
9
  }
10
- export declare function channelSend(channelName: string, opts: SendOptions): Promise<void>;
10
+ export declare function teamworkSessionSend(sessionId: string, opts: SendOptions): Promise<void>;
11
11
  //# sourceMappingURL=send.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"send.d.ts","sourceRoot":"","sources":["../../../src/commands/teamwork/send.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,wBAAsB,mBAAmB,CACvC,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,WAAW,GAChB,OAAO,CAAC,IAAI,CAAC,CAuBf"}
@@ -1,17 +1,17 @@
1
- import { parseDeliveryMode, sendMessage as coreSendMessage, } from "@pennixrv/trellis-core/channel";
2
- import { parseChannelScope, parseCsv } from "./store/schema.js";
3
- import { resolveChannelTextBody } from "./text-body.js";
4
- export async function channelSend(channelName, opts) {
5
- const text = await resolveChannelTextBody(opts, {
1
+ import { parseDeliveryMode, sendMessage as coreSendMessage, } from "@pennixrv/trellis-core/teamwork";
2
+ import { parseTeamworkSessionScope, parseCsv } from "./store/schema.js";
3
+ import { resolveTeamworkSessionTextBody } from "./text-body.js";
4
+ export async function teamworkSessionSend(sessionId, opts) {
5
+ const text = await resolveTeamworkSessionTextBody(opts, {
6
6
  required: true,
7
7
  missingMessage: "No text provided (use <text> arg, --stdin, or --text-file)",
8
8
  emptyMessage: "Empty message",
9
9
  });
10
10
  const to = parseCsv(opts.to);
11
- const scope = parseChannelScope(opts.scope);
11
+ const scope = parseTeamworkSessionScope(opts.scope);
12
12
  const deliveryMode = parseDeliveryMode(opts.deliveryMode);
13
13
  const event = await coreSendMessage({
14
- channel: channelName,
14
+ sessionId: sessionId,
15
15
  by: opts.as,
16
16
  text: text,
17
17
  ...(scope !== undefined ? { scope } : {}),
@@ -0,0 +1 @@
1
+ {"version":3,"file":"send.js","sourceRoot":"","sources":["../../../src/commands/teamwork/send.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,WAAW,IAAI,eAAe,GAE/B,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,yBAAyB,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAAE,8BAA8B,EAAE,MAAM,gBAAgB,CAAC;AAYhE,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,SAAiB,EACjB,IAAiB;IAEjB,MAAM,IAAI,GAAG,MAAM,8BAA8B,CAAC,IAAI,EAAE;QACtD,QAAQ,EAAE,IAAI;QACd,cAAc,EACZ,4DAA4D;QAC9D,YAAY,EAAE,eAAe;KAC9B,CAAC,CAAC;IACH,MAAM,EAAE,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC7B,MAAM,KAAK,GAAqC,yBAAyB,CACvE,IAAI,CAAC,KAAK,CACX,CAAC;IACF,MAAM,YAAY,GAAG,iBAAiB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAE1D,MAAM,KAAK,GAAG,MAAM,eAAe,CAAC;QAClC,SAAS,EAAE,SAAS;QACpB,EAAE,EAAE,IAAI,CAAC,EAAE;QACX,IAAI,EAAE,IAAc;QACpB,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACzC,GAAG,CAAC,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACjE,GAAG,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACvD,MAAM,EAAE,KAAK;KACd,CAAC,CAAC;IACH,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;AACrC,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { InboxPolicy } from "@pennixrv/trellis-core/channel";
1
+ import type { InboxPolicy } from "@pennixrv/trellis-core/teamwork";
2
2
  import type { CodexSandboxMode } from "./adapters/codex.js";
3
3
  import type { Provider } from "./adapters/index.js";
4
4
  export interface SpawnOptions {
@@ -10,36 +10,32 @@ export interface SpawnOptions {
10
10
  resume?: string;
11
11
  /** Codex-only: overrides the `thread/start` sandbox mode (default `workspace-write`). */
12
12
  sandbox?: CodexSandboxMode;
13
- /** Auto-kill the worker after this many milliseconds (anti-zombie). */
13
+ /** Auto-kill the teammate process after this many milliseconds (anti-zombie). */
14
14
  timeoutMs?: number;
15
15
  /** Emit supervisor_warning this many milliseconds before timeout. */
16
16
  warnBeforeMs?: number;
17
- /** Files (or globs) to include in the worker's system prompt. */
17
+ /** Files (or globs) to include in the teammate's system prompt. */
18
18
  files?: string[];
19
19
  /** Trellis jsonl manifests to expand into the system prompt. */
20
20
  jsonls?: string[];
21
21
  scope?: string;
22
22
  /** Identity recorded as the `spawned` event author. Defaults to
23
- * the calling worker (`TRELLIS_CHANNEL_AS` env) or "main". */
23
+ * the calling teammate (`TRELLIS_TEAMWORK_AS` env) or "main". */
24
24
  by?: string;
25
- /** Worker inbox delivery policy (default `explicitOnly`). */
25
+ /** Teammate inbox delivery policy (default `explicitOnly`). */
26
26
  inboxPolicy?: InboxPolicy;
27
27
  /**
28
- * OOM-guard idle-cleanup TTL for this worker, in ms. `0` disables
28
+ * OOM-guard idle-cleanup TTL for this teammate, in ms. `0` disables
29
29
  * idle cleanup. Overrides env / config / built-in default.
30
30
  */
31
31
  idleTimeoutMs?: number;
32
32
  /**
33
- * OOM-guard live-worker budget for this spawn. `0` disables the
33
+ * OOM-guard live-teammate budget for this spawn. `0` disables the
34
34
  * spawn-time budget check. Overrides env / config / built-in default.
35
35
  */
36
36
  maxLiveWorkers?: number;
37
37
  }
38
- /** Parse a role-owned KEY=VALUE file without shell expansion or interpolation. */
39
- export declare function parseAgentEnvFile(filePath: string): Record<string, string>;
40
- /** Apply supervisor role defaults without consuming guard env precedence. */
41
- export declare function applySubnodeSupervisorDefaults(opts: SpawnOptions, cwd?: string): SpawnOptions;
42
- export declare function channelSpawn(channelName: string, opts: SpawnOptions): Promise<{
38
+ export declare function teamworkSessionSpawn(sessionId: string, opts: SpawnOptions): Promise<{
43
39
  pid: number;
44
40
  log: string;
45
41
  worker: string;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spawn.d.ts","sourceRoot":"","sources":["../../../src/commands/teamwork/spawn.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAGnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAmBpD,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,yFAAyF;IACzF,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,iFAAiF;IACjF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qEAAqE;IACrE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,mEAAmE;IACnE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,gEAAgE;IAChE,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;sEACkE;IAClE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,+DAA+D;IAC/D,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAmGD,wBAAsB,oBAAoB,CACxC,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,YAAY,GACjB,OAAO,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAA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