@pennixrv/trellis 0.7.2-beta.2 → 0.7.2-beta.21

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 (438) hide show
  1. package/README.md +14 -0
  2. package/dist/commands/init.d.ts.map +1 -1
  3. package/dist/commands/init.js +105 -107
  4. package/dist/commands/init.js.map +1 -1
  5. package/dist/commands/teamwork/adapters/acp.d.ts.map +1 -1
  6. package/dist/commands/teamwork/adapters/acp.js +3 -0
  7. package/dist/commands/teamwork/adapters/acp.js.map +1 -1
  8. package/dist/commands/teamwork/adapters/index.d.ts +1 -1
  9. package/dist/commands/teamwork/adapters/index.d.ts.map +1 -1
  10. package/dist/commands/teamwork/artifact.d.ts +2 -0
  11. package/dist/commands/teamwork/artifact.d.ts.map +1 -1
  12. package/dist/commands/teamwork/artifact.js +4 -2
  13. package/dist/commands/teamwork/artifact.js.map +1 -1
  14. package/dist/commands/teamwork/batch-reservation.d.ts.map +1 -1
  15. package/dist/commands/teamwork/batch-reservation.js +16 -8
  16. package/dist/commands/teamwork/batch-reservation.js.map +1 -1
  17. package/dist/commands/teamwork/batch.d.ts +15 -1
  18. package/dist/commands/teamwork/batch.d.ts.map +1 -1
  19. package/dist/commands/teamwork/batch.js +279 -24
  20. package/dist/commands/teamwork/batch.js.map +1 -1
  21. package/dist/commands/teamwork/coordinator.d.ts +3 -0
  22. package/dist/commands/teamwork/coordinator.d.ts.map +1 -1
  23. package/dist/commands/teamwork/coordinator.js +22 -3
  24. package/dist/commands/teamwork/coordinator.js.map +1 -1
  25. package/dist/commands/teamwork/create.d.ts +1 -0
  26. package/dist/commands/teamwork/create.d.ts.map +1 -1
  27. package/dist/commands/teamwork/create.js +4 -0
  28. package/dist/commands/teamwork/create.js.map +1 -1
  29. package/dist/commands/teamwork/evidence-references.d.ts +19 -0
  30. package/dist/commands/teamwork/evidence-references.d.ts.map +1 -0
  31. package/dist/commands/teamwork/evidence-references.js +249 -0
  32. package/dist/commands/teamwork/evidence-references.js.map +1 -0
  33. package/dist/commands/teamwork/foreground-wait.d.ts +4 -1
  34. package/dist/commands/teamwork/foreground-wait.d.ts.map +1 -1
  35. package/dist/commands/teamwork/foreground-wait.js +15 -1
  36. package/dist/commands/teamwork/foreground-wait.js.map +1 -1
  37. package/dist/commands/teamwork/index.d.ts.map +1 -1
  38. package/dist/commands/teamwork/index.js +47 -5
  39. package/dist/commands/teamwork/index.js.map +1 -1
  40. package/dist/commands/teamwork/list.d.ts +1 -0
  41. package/dist/commands/teamwork/list.d.ts.map +1 -1
  42. package/dist/commands/teamwork/list.js +4 -1
  43. package/dist/commands/teamwork/list.js.map +1 -1
  44. package/dist/commands/teamwork/prompt.js +1 -1
  45. package/dist/commands/teamwork/prompt.js.map +1 -1
  46. package/dist/commands/teamwork/rm.d.ts +27 -4
  47. package/dist/commands/teamwork/rm.d.ts.map +1 -1
  48. package/dist/commands/teamwork/rm.js +155 -51
  49. package/dist/commands/teamwork/rm.js.map +1 -1
  50. package/dist/commands/teamwork/run.d.ts.map +1 -1
  51. package/dist/commands/teamwork/run.js +10 -1
  52. package/dist/commands/teamwork/run.js.map +1 -1
  53. package/dist/commands/teamwork/runtime.d.ts +1 -1
  54. package/dist/commands/teamwork/runtime.d.ts.map +1 -1
  55. package/dist/commands/teamwork/runtime.js +14 -4
  56. package/dist/commands/teamwork/runtime.js.map +1 -1
  57. package/dist/commands/teamwork/spawn.d.ts.map +1 -1
  58. package/dist/commands/teamwork/spawn.js +4 -1
  59. package/dist/commands/teamwork/spawn.js.map +1 -1
  60. package/dist/commands/teamwork/supervisor/stdout.d.ts.map +1 -1
  61. package/dist/commands/teamwork/supervisor/stdout.js +7 -0
  62. package/dist/commands/teamwork/supervisor/stdout.js.map +1 -1
  63. package/dist/commands/teamwork/supervisor.d.ts +1 -1
  64. package/dist/commands/teamwork/supervisor.d.ts.map +1 -1
  65. package/dist/commands/teamwork/teammate-adapters.d.ts +3 -0
  66. package/dist/commands/teamwork/teammate-adapters.d.ts.map +1 -1
  67. package/dist/commands/teamwork/teammate-adapters.js +14 -5
  68. package/dist/commands/teamwork/teammate-adapters.js.map +1 -1
  69. package/dist/commands/teamwork/teammate-launch.d.ts +3 -1
  70. package/dist/commands/teamwork/teammate-launch.d.ts.map +1 -1
  71. package/dist/commands/teamwork/teammate-launch.js +7 -5
  72. package/dist/commands/teamwork/teammate-launch.js.map +1 -1
  73. package/dist/commands/teamwork/workers.d.ts +8 -0
  74. package/dist/commands/teamwork/workers.d.ts.map +1 -0
  75. package/dist/commands/teamwork/workers.js +67 -0
  76. package/dist/commands/teamwork/workers.js.map +1 -0
  77. package/dist/commands/update.d.ts.map +1 -1
  78. package/dist/commands/update.js +109 -55
  79. package/dist/commands/update.js.map +1 -1
  80. package/dist/commands/workflow.d.ts.map +1 -1
  81. package/dist/commands/workflow.js +5 -7
  82. package/dist/commands/workflow.js.map +1 -1
  83. package/dist/configurators/codebuddy.d.ts +1 -8
  84. package/dist/configurators/codebuddy.d.ts.map +1 -1
  85. package/dist/configurators/codebuddy.js +2 -12
  86. package/dist/configurators/codebuddy.js.map +1 -1
  87. package/dist/configurators/codex.d.ts +0 -36
  88. package/dist/configurators/codex.d.ts.map +1 -1
  89. package/dist/configurators/codex.js +2 -99
  90. package/dist/configurators/codex.js.map +1 -1
  91. package/dist/configurators/copilot.d.ts +1 -12
  92. package/dist/configurators/copilot.d.ts.map +1 -1
  93. package/dist/configurators/copilot.js +2 -20
  94. package/dist/configurators/copilot.js.map +1 -1
  95. package/dist/configurators/cursor.d.ts +1 -8
  96. package/dist/configurators/cursor.d.ts.map +1 -1
  97. package/dist/configurators/cursor.js +2 -12
  98. package/dist/configurators/cursor.js.map +1 -1
  99. package/dist/configurators/droid.d.ts +1 -8
  100. package/dist/configurators/droid.d.ts.map +1 -1
  101. package/dist/configurators/droid.js +2 -12
  102. package/dist/configurators/droid.js.map +1 -1
  103. package/dist/configurators/dsh.d.ts +1 -21
  104. package/dist/configurators/dsh.d.ts.map +1 -1
  105. package/dist/configurators/dsh.js +4 -37
  106. package/dist/configurators/dsh.js.map +1 -1
  107. package/dist/configurators/gemini.d.ts +1 -16
  108. package/dist/configurators/gemini.d.ts.map +1 -1
  109. package/dist/configurators/gemini.js +3 -21
  110. package/dist/configurators/gemini.js.map +1 -1
  111. package/dist/configurators/grok.d.ts +1 -12
  112. package/dist/configurators/grok.d.ts.map +1 -1
  113. package/dist/configurators/grok.js +2 -18
  114. package/dist/configurators/grok.js.map +1 -1
  115. package/dist/configurators/kimi.d.ts +1 -21
  116. package/dist/configurators/kimi.d.ts.map +1 -1
  117. package/dist/configurators/kimi.js +2 -38
  118. package/dist/configurators/kimi.js.map +1 -1
  119. package/dist/configurators/kiro.d.ts +1 -9
  120. package/dist/configurators/kiro.d.ts.map +1 -1
  121. package/dist/configurators/kiro.js +1 -9
  122. package/dist/configurators/kiro.js.map +1 -1
  123. package/dist/configurators/omp.d.ts.map +1 -1
  124. package/dist/configurators/omp.js +1 -5
  125. package/dist/configurators/omp.js.map +1 -1
  126. package/dist/configurators/pi.d.ts.map +1 -1
  127. package/dist/configurators/pi.js +2 -5
  128. package/dist/configurators/pi.js.map +1 -1
  129. package/dist/configurators/qoder.d.ts +1 -10
  130. package/dist/configurators/qoder.d.ts.map +1 -1
  131. package/dist/configurators/qoder.js +3 -15
  132. package/dist/configurators/qoder.js.map +1 -1
  133. package/dist/configurators/reasonix.d.ts +1 -12
  134. package/dist/configurators/reasonix.d.ts.map +1 -1
  135. package/dist/configurators/reasonix.js +3 -22
  136. package/dist/configurators/reasonix.js.map +1 -1
  137. package/dist/configurators/shared.d.ts +1 -24
  138. package/dist/configurators/shared.d.ts.map +1 -1
  139. package/dist/configurators/shared.js +5 -184
  140. package/dist/configurators/shared.js.map +1 -1
  141. package/dist/configurators/snow.d.ts +1 -20
  142. package/dist/configurators/snow.d.ts.map +1 -1
  143. package/dist/configurators/snow.js +2 -25
  144. package/dist/configurators/snow.js.map +1 -1
  145. package/dist/configurators/trae.d.ts +1 -14
  146. package/dist/configurators/trae.d.ts.map +1 -1
  147. package/dist/configurators/trae.js +3 -19
  148. package/dist/configurators/trae.js.map +1 -1
  149. package/dist/configurators/workflow.d.ts +2 -0
  150. package/dist/configurators/workflow.d.ts.map +1 -1
  151. package/dist/configurators/workflow.js +72 -56
  152. package/dist/configurators/workflow.js.map +1 -1
  153. package/dist/configurators/zcode.d.ts +1 -13
  154. package/dist/configurators/zcode.d.ts.map +1 -1
  155. package/dist/configurators/zcode.js +2 -18
  156. package/dist/configurators/zcode.js.map +1 -1
  157. package/dist/migrations/manifests/0.5.0-beta.5.json +1 -212
  158. package/dist/migrations/manifests/0.7.2-beta.10.json +9 -0
  159. package/dist/migrations/manifests/0.7.2-beta.11.json +9 -0
  160. package/dist/migrations/manifests/0.7.2-beta.12.json +9 -0
  161. package/dist/migrations/manifests/0.7.2-beta.13.json +9 -0
  162. package/dist/migrations/manifests/0.7.2-beta.14.json +9 -0
  163. package/dist/migrations/manifests/0.7.2-beta.15.json +9 -0
  164. package/dist/migrations/manifests/0.7.2-beta.16.json +9 -0
  165. package/dist/migrations/manifests/0.7.2-beta.17.json +9 -0
  166. package/dist/migrations/manifests/0.7.2-beta.18.json +9 -0
  167. package/dist/migrations/manifests/0.7.2-beta.19.json +11 -0
  168. package/dist/migrations/manifests/0.7.2-beta.20.json +9 -0
  169. package/dist/migrations/manifests/0.7.2-beta.21.json +9 -0
  170. package/dist/migrations/manifests/0.7.2-beta.3.json +9 -0
  171. package/dist/migrations/manifests/0.7.2-beta.4.json +9 -0
  172. package/dist/migrations/manifests/0.7.2-beta.5.json +9 -0
  173. package/dist/migrations/manifests/0.7.2-beta.6.json +9 -0
  174. package/dist/migrations/manifests/0.7.2-beta.7.json +9 -0
  175. package/dist/migrations/manifests/0.7.2-beta.8.json +9 -0
  176. package/dist/migrations/manifests/0.7.2-beta.9.json +9 -0
  177. package/dist/migrations/retired-native-paths.d.ts +109 -0
  178. package/dist/migrations/retired-native-paths.d.ts.map +1 -0
  179. package/dist/migrations/retired-native-paths.js +263 -0
  180. package/dist/migrations/retired-native-paths.js.map +1 -0
  181. package/dist/templates/claude/index.d.ts +1 -16
  182. package/dist/templates/claude/index.d.ts.map +1 -1
  183. package/dist/templates/claude/index.js +5 -32
  184. package/dist/templates/claude/index.js.map +1 -1
  185. package/dist/templates/claude/settings.json +0 -22
  186. package/dist/templates/codebuddy/index.d.ts +2 -3
  187. package/dist/templates/codebuddy/index.d.ts.map +1 -1
  188. package/dist/templates/codebuddy/index.js +2 -3
  189. package/dist/templates/codebuddy/index.js.map +1 -1
  190. package/dist/templates/codebuddy/settings.json +0 -10
  191. package/dist/templates/codex/config.toml +2 -19
  192. package/dist/templates/codex/hooks/session-start.py +25 -30
  193. package/dist/templates/codex/hooks.json +0 -12
  194. package/dist/templates/codex/index.d.ts +0 -5
  195. package/dist/templates/codex/index.d.ts.map +1 -1
  196. package/dist/templates/codex/index.js +0 -13
  197. package/dist/templates/codex/index.js.map +1 -1
  198. package/dist/templates/common/bundled-skills/trellis-decision-space-construction-and-merging/SKILL.md +2 -0
  199. package/dist/templates/common/bundled-skills/trellis-decision-space-construction-and-merging/workflow.md +7 -3
  200. package/dist/templates/common/bundled-skills/trellis-delivery-review-and-closeout/SKILL.md +2 -0
  201. package/dist/templates/common/bundled-skills/trellis-delivery-review-and-closeout/workflow.md +2 -0
  202. package/dist/templates/common/bundled-skills/trellis-goal-exploration-and-requirements/SKILL.md +2 -0
  203. package/dist/templates/common/bundled-skills/trellis-meta/SKILL.md +7 -7
  204. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-agents.md +9 -51
  205. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-context-loading.md +3 -15
  206. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-hooks.md +1 -2
  207. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/context-injection.md +4 -9
  208. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/generated-files.md +2 -2
  209. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/multi-agent-teamwork.md +6 -0
  210. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/overview.md +1 -1
  211. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/spec-system.md +10 -8
  212. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/agents.md +9 -79
  213. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/hooks-and-settings.md +2 -4
  214. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/overview.md +3 -6
  215. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.md +24 -103
  216. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/skills-and-commands.md +1 -1
  217. package/dist/templates/common/bundled-skills/trellis-session-insight/SKILL.md +1 -1
  218. package/dist/templates/common/bundled-skills/trellis-solution-design-and-convergence/SKILL.md +2 -0
  219. package/dist/templates/common/bundled-skills/trellis-solution-design-and-convergence/workflow.md +14 -5
  220. package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/SKILL.md +6 -4
  221. package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/spec-task-planning.md +5 -9
  222. package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/spec-writing.md +8 -0
  223. package/dist/templates/common/bundled-skills/trellis-task-implementation/SKILL.md +2 -0
  224. package/dist/templates/common/bundled-skills/trellis-task-implementation/workflow.md +1 -1
  225. package/dist/templates/common/bundled-skills/trellis-teamwork/SKILL.md +8 -1
  226. package/dist/templates/common/bundled-skills/trellis-teamwork/references/teammate-processes.md +21 -1
  227. package/dist/templates/common/bundled-skills/trellis-teamwork/references/teamwork-plan-construction.md +13 -2
  228. package/dist/templates/common/bundled-skills/trellis-worktree-delegation/SKILL.md +14 -0
  229. package/dist/templates/common/bundled-skills/trellis-worktree-delegation/workflow.md +17 -0
  230. package/dist/templates/common/commands/continue.md +8 -0
  231. package/dist/templates/common/commands/start.md +2 -0
  232. package/dist/templates/common/skills/before-dev.md +3 -1
  233. package/dist/templates/common/skills/check.md +3 -1
  234. package/dist/templates/common/skills/request-intake.md +5 -3
  235. package/dist/templates/copilot/hooks/session-start.py +11 -30
  236. package/dist/templates/cursor/hooks.json +0 -7
  237. package/dist/templates/cursor/index.d.ts +1 -11
  238. package/dist/templates/cursor/index.d.ts.map +1 -1
  239. package/dist/templates/cursor/index.js +2 -10
  240. package/dist/templates/cursor/index.js.map +1 -1
  241. package/dist/templates/droid/index.d.ts +2 -3
  242. package/dist/templates/droid/index.d.ts.map +1 -1
  243. package/dist/templates/droid/index.js +2 -3
  244. package/dist/templates/droid/index.js.map +1 -1
  245. package/dist/templates/droid/settings.json +0 -10
  246. package/dist/templates/dsh/DSH.md +2 -33
  247. package/dist/templates/dsh/index.d.ts +1 -19
  248. package/dist/templates/dsh/index.d.ts.map +1 -1
  249. package/dist/templates/dsh/index.js +2 -21
  250. package/dist/templates/dsh/index.js.map +1 -1
  251. package/dist/templates/gemini/index.d.ts +1 -11
  252. package/dist/templates/gemini/index.d.ts.map +1 -1
  253. package/dist/templates/gemini/index.js +2 -10
  254. package/dist/templates/gemini/index.js.map +1 -1
  255. package/dist/templates/kiro/agents/trellis.json +1 -1
  256. package/dist/templates/kiro/index.d.ts +1 -13
  257. package/dist/templates/kiro/index.d.ts.map +1 -1
  258. package/dist/templates/kiro/index.js +1 -13
  259. package/dist/templates/kiro/index.js.map +1 -1
  260. package/dist/templates/markdown/agents.md +15 -3
  261. package/dist/templates/markdown/index.d.ts +1 -0
  262. package/dist/templates/markdown/index.d.ts.map +1 -1
  263. package/dist/templates/markdown/index.js +1 -0
  264. package/dist/templates/markdown/index.js.map +1 -1
  265. package/dist/templates/markdown/spec/index.md.txt +20 -0
  266. package/dist/templates/omp/extensions/trellis/index.ts.txt +11 -51
  267. package/dist/templates/omp/index.d.ts +0 -2
  268. package/dist/templates/omp/index.d.ts.map +1 -1
  269. package/dist/templates/omp/index.js +1 -4
  270. package/dist/templates/omp/index.js.map +1 -1
  271. package/dist/templates/opencode/lib/session-utils.js +17 -5
  272. package/dist/templates/opencode/lib/trellis-context.js +12 -321
  273. package/dist/templates/opencode/plugins/inject-shell-session-context.js +93 -0
  274. package/dist/templates/opencode/plugins/inject-workflow-state.js +4 -10
  275. package/dist/templates/opencode/plugins/session-start.js +2 -6
  276. package/dist/templates/pi/extensions/trellis/index.ts.txt +8 -1432
  277. package/dist/templates/pi/index.d.ts +1 -2
  278. package/dist/templates/pi/index.d.ts.map +1 -1
  279. package/dist/templates/pi/index.js +2 -5
  280. package/dist/templates/pi/index.js.map +1 -1
  281. package/dist/templates/qoder/index.d.ts +2 -3
  282. package/dist/templates/qoder/index.d.ts.map +1 -1
  283. package/dist/templates/qoder/index.js +2 -3
  284. package/dist/templates/qoder/index.js.map +1 -1
  285. package/dist/templates/shared-hooks/guard-teamwork-wait.py +118 -12
  286. package/dist/templates/shared-hooks/index.d.ts +2 -56
  287. package/dist/templates/shared-hooks/index.d.ts.map +1 -1
  288. package/dist/templates/shared-hooks/index.js +3 -70
  289. package/dist/templates/shared-hooks/index.js.map +1 -1
  290. package/dist/templates/shared-hooks/inject-spec-context.py +6 -35
  291. package/dist/templates/shared-hooks/inject-workflow-state.py +18 -77
  292. package/dist/templates/shared-hooks/session-start.py +8 -6
  293. package/dist/templates/snow/SNOW.md +6 -18
  294. package/dist/templates/snow/hooks/write-trellis-context.py +51 -133
  295. package/dist/templates/snow/index.d.ts +2 -21
  296. package/dist/templates/snow/index.d.ts.map +1 -1
  297. package/dist/templates/snow/index.js +3 -24
  298. package/dist/templates/snow/index.js.map +1 -1
  299. package/dist/templates/template-utils.d.ts +1 -2
  300. package/dist/templates/template-utils.d.ts.map +1 -1
  301. package/dist/templates/template-utils.js +1 -11
  302. package/dist/templates/template-utils.js.map +1 -1
  303. package/dist/templates/trae/index.d.ts +2 -3
  304. package/dist/templates/trae/index.d.ts.map +1 -1
  305. package/dist/templates/trae/index.js +2 -3
  306. package/dist/templates/trae/index.js.map +1 -1
  307. package/dist/templates/trellis/agents/delegated-worktree-primary-agent.md +20 -22
  308. package/dist/templates/trellis/agents/teammate.md +6 -2
  309. package/dist/templates/trellis/agents/worktree-delegation-node.md +24 -0
  310. package/dist/templates/trellis/config.yaml +7 -36
  311. package/dist/templates/trellis/gitignore.txt +4 -0
  312. package/dist/templates/trellis/index.d.ts +1 -0
  313. package/dist/templates/trellis/index.d.ts.map +1 -1
  314. package/dist/templates/trellis/index.js +3 -0
  315. package/dist/templates/trellis/index.js.map +1 -1
  316. package/dist/templates/trellis/scripts/common/active_task.py +23 -31
  317. package/dist/templates/trellis/scripts/common/config.py +1 -36
  318. package/dist/templates/trellis/scripts/common/git_context.py +13 -4
  319. package/dist/templates/trellis/scripts/common/io.py +2 -2
  320. package/dist/templates/trellis/scripts/common/packages_context.py +29 -1
  321. package/dist/templates/trellis/scripts/common/session_context.py +25 -50
  322. package/dist/templates/trellis/scripts/common/task_context.py +5 -3
  323. package/dist/templates/trellis/scripts/common/task_continuity.py +42 -9
  324. package/dist/templates/trellis/scripts/common/task_move.py +2 -2
  325. package/dist/templates/trellis/scripts/common/task_runtime.py +211 -0
  326. package/dist/templates/trellis/scripts/common/task_store.py +8 -78
  327. package/dist/templates/trellis/scripts/common/task_workflow.py +9 -26
  328. package/dist/templates/trellis/scripts/common/workflow_phase.py +3 -36
  329. package/dist/templates/trellis/scripts/common/workflow_selection.py +12 -2
  330. package/dist/templates/trellis/scripts/common/worktree_delegation.py +603 -0
  331. package/dist/templates/trellis/scripts/task.py +41 -2
  332. package/dist/templates/trellis/workflow.md +25 -10
  333. package/dist/templates/zcode/config.json +0 -10
  334. package/dist/templates/zcode/index.d.ts +3 -22
  335. package/dist/templates/zcode/index.d.ts.map +1 -1
  336. package/dist/templates/zcode/index.js +3 -24
  337. package/dist/templates/zcode/index.js.map +1 -1
  338. package/dist/types/ai-tools.d.ts +0 -4
  339. package/dist/types/ai-tools.d.ts.map +1 -1
  340. package/dist/types/ai-tools.js +4 -109
  341. package/dist/types/ai-tools.js.map +1 -1
  342. package/dist/utils/ablation-store.d.ts.map +1 -1
  343. package/dist/utils/ablation-store.js +24 -0
  344. package/dist/utils/ablation-store.js.map +1 -1
  345. package/dist/utils/asset-backup.d.ts.map +1 -1
  346. package/dist/utils/asset-backup.js +25 -20
  347. package/dist/utils/asset-backup.js.map +1 -1
  348. package/dist/utils/file-writer.d.ts +2 -0
  349. package/dist/utils/file-writer.d.ts.map +1 -1
  350. package/dist/utils/file-writer.js +1 -1
  351. package/dist/utils/file-writer.js.map +1 -1
  352. package/dist/utils/managed-markdown.d.ts +5 -0
  353. package/dist/utils/managed-markdown.d.ts.map +1 -0
  354. package/dist/utils/managed-markdown.js +64 -0
  355. package/dist/utils/managed-markdown.js.map +1 -0
  356. package/dist/utils/managed-removal.d.ts +2 -0
  357. package/dist/utils/managed-removal.d.ts.map +1 -1
  358. package/dist/utils/managed-removal.js +26 -2
  359. package/dist/utils/managed-removal.js.map +1 -1
  360. package/dist/utils/manifest-prune.d.ts.map +1 -1
  361. package/dist/utils/manifest-prune.js +5 -12
  362. package/dist/utils/manifest-prune.js.map +1 -1
  363. package/dist/utils/retired-native-assets.d.ts +17 -0
  364. package/dist/utils/retired-native-assets.d.ts.map +1 -0
  365. package/dist/utils/retired-native-assets.js +235 -0
  366. package/dist/utils/retired-native-assets.js.map +1 -0
  367. package/dist/utils/uninstall-scrubbers.d.ts.map +1 -1
  368. package/dist/utils/uninstall-scrubbers.js +6 -12
  369. package/dist/utils/uninstall-scrubbers.js.map +1 -1
  370. package/package.json +2 -2
  371. package/dist/templates/claude/agents/trellis-check.md +0 -115
  372. package/dist/templates/claude/agents/trellis-implement.md +0 -110
  373. package/dist/templates/claude/agents/trellis-research.md +0 -137
  374. package/dist/templates/codebuddy/agents/trellis-check.md +0 -115
  375. package/dist/templates/codebuddy/agents/trellis-implement.md +0 -110
  376. package/dist/templates/codebuddy/agents/trellis-research.md +0 -137
  377. package/dist/templates/codex/agents/trellis-check.toml +0 -56
  378. package/dist/templates/codex/agents/trellis-implement.toml +0 -37
  379. package/dist/templates/codex/agents/trellis-research.toml +0 -78
  380. package/dist/templates/cursor/agents/trellis-check.md +0 -114
  381. package/dist/templates/cursor/agents/trellis-implement.md +0 -109
  382. package/dist/templates/cursor/agents/trellis-research.md +0 -136
  383. package/dist/templates/droid/droids/trellis-check.md +0 -107
  384. package/dist/templates/droid/droids/trellis-implement.md +0 -102
  385. package/dist/templates/droid/droids/trellis-research.md +0 -137
  386. package/dist/templates/dsh/agents/trellis-check.md +0 -99
  387. package/dist/templates/dsh/agents/trellis-implement.md +0 -106
  388. package/dist/templates/dsh/agents/trellis-research.md +0 -134
  389. package/dist/templates/gemini/agents/trellis-check.md +0 -107
  390. package/dist/templates/gemini/agents/trellis-implement.md +0 -102
  391. package/dist/templates/gemini/agents/trellis-research.md +0 -136
  392. package/dist/templates/grok/agents/trellis-check.md +0 -105
  393. package/dist/templates/grok/agents/trellis-implement.md +0 -116
  394. package/dist/templates/grok/agents/trellis-research.md +0 -146
  395. package/dist/templates/grok/index.d.ts +0 -16
  396. package/dist/templates/grok/index.d.ts.map +0 -1
  397. package/dist/templates/grok/index.js +0 -19
  398. package/dist/templates/grok/index.js.map +0 -1
  399. package/dist/templates/kimi/agents/trellis-check.md +0 -103
  400. package/dist/templates/kimi/agents/trellis-implement.md +0 -115
  401. package/dist/templates/kimi/agents/trellis-research.md +0 -144
  402. package/dist/templates/kimi/index.d.ts +0 -20
  403. package/dist/templates/kimi/index.d.ts.map +0 -1
  404. package/dist/templates/kimi/index.js +0 -23
  405. package/dist/templates/kimi/index.js.map +0 -1
  406. package/dist/templates/kiro/agents/trellis-check.json +0 -26
  407. package/dist/templates/kiro/agents/trellis-implement.json +0 -26
  408. package/dist/templates/kiro/agents/trellis-research.json +0 -30
  409. package/dist/templates/omp/agents/trellis-check.md +0 -41
  410. package/dist/templates/omp/agents/trellis-implement.md +0 -45
  411. package/dist/templates/omp/agents/trellis-research.md +0 -30
  412. package/dist/templates/opencode/agents/trellis-check.md +0 -122
  413. package/dist/templates/opencode/agents/trellis-implement.md +0 -118
  414. package/dist/templates/opencode/agents/trellis-research.md +0 -145
  415. package/dist/templates/opencode/plugins/inject-subagent-context.js +0 -569
  416. package/dist/templates/pi/agents/trellis-check.md +0 -37
  417. package/dist/templates/pi/agents/trellis-implement.md +0 -42
  418. package/dist/templates/pi/agents/trellis-research.md +0 -25
  419. package/dist/templates/qoder/agents/trellis-check.md +0 -108
  420. package/dist/templates/qoder/agents/trellis-implement.md +0 -103
  421. package/dist/templates/qoder/agents/trellis-research.md +0 -137
  422. package/dist/templates/reasonix/agents/trellis-check.md +0 -36
  423. package/dist/templates/reasonix/agents/trellis-implement.md +0 -41
  424. package/dist/templates/reasonix/index.d.ts +0 -13
  425. package/dist/templates/reasonix/index.d.ts.map +0 -1
  426. package/dist/templates/reasonix/index.js +0 -16
  427. package/dist/templates/reasonix/index.js.map +0 -1
  428. package/dist/templates/shared-hooks/inject-subagent-context.py +0 -1217
  429. package/dist/templates/snow/agents/trellis-check.md +0 -135
  430. package/dist/templates/snow/agents/trellis-implement.md +0 -153
  431. package/dist/templates/snow/agents/trellis-research.md +0 -114
  432. package/dist/templates/snow/hooks/beforeSubAgentStart.json +0 -15
  433. package/dist/templates/trae/agents/trellis-check.md +0 -108
  434. package/dist/templates/trae/agents/trellis-implement.md +0 -103
  435. package/dist/templates/trae/agents/trellis-research.md +0 -137
  436. package/dist/templates/zcode/agents/trellis-check.md +0 -109
  437. package/dist/templates/zcode/agents/trellis-implement.md +0 -111
  438. package/dist/templates/zcode/agents/trellis-research.md +0 -133
@@ -3,6 +3,8 @@ import os from "node:os";
3
3
  import path from "node:path";
4
4
  import chalk from "chalk";
5
5
  import inquirer from "inquirer";
6
+ import { managedBlock, mergeManagedMarkdown, readManagedMarkdown, } from "../utils/managed-markdown.js";
7
+ import { writeFileAtomic } from "../utils/atomic-write.js";
6
8
  import { DIR_NAMES, FILE_NAMES, PATHS } from "../constants/paths.js";
7
9
  import { VERSION, PACKAGE_NAME } from "../constants/version.js";
8
10
  import { getMigrationsForVersion, getAllMigrations, getMigrationMetadata, getConfigSectionsAddedBetween, } from "../migrations/index.js";
@@ -20,22 +22,26 @@ import { agentsMdContent } from "../templates/markdown/index.js";
20
22
  import { COPILOT_INSTRUCTIONS_BLOCK_END, COPILOT_INSTRUCTIONS_BLOCK_START, COPILOT_INSTRUCTIONS_PATH, getCopilotInstructions, } from "../templates/copilot/index.js";
21
23
  import { getConfiguredPlatforms, collectPlatformTemplates, } from "../configurators/index.js";
22
24
  import { replacePythonCommandLiterals } from "../configurators/shared.js";
23
- import { preserveCodexAgentModelKeys } from "../configurators/codex.js";
24
25
  import { printZcodeSetupHint } from "../configurators/zcode.js";
25
26
  import { ensureGitattributes } from "../configurators/workflow.js";
26
27
  import { pruneOrphanManifestKeys } from "../utils/manifest-prune.js";
28
+ import { planNativeRetirement, executeNativeRetirement, assertCurrentExecutionTree, assertNativeRetirementWrites, mixedNativeAssets, } from "../utils/retired-native-assets.js";
27
29
  import { fetchRegistrySpecTemplates, collectDirectoryFiles, removeDirectory, parseRegistrySource, probeRegistryIndex, downloadTemplateById, } from "../utils/template-fetcher.js";
28
30
  import { loadSpecRegistryConfig } from "../utils/registry-config.js";
29
31
  import { cleanupEmptyDirs, TRELLIS_BLOCK_END, TRELLIS_BLOCK_START, } from "../utils/managed-paths.js";
30
32
  export { cleanupEmptyDirs, TRELLIS_BLOCK_END, TRELLIS_BLOCK_START, } from "../utils/managed-paths.js";
33
+ function writeUpdateFile(file) {
34
+ if (file.previousContent === undefined) {
35
+ fs.writeFileSync(file.path, file.newContent);
36
+ return;
37
+ }
38
+ if (file.previousContent !== undefined &&
39
+ readManagedMarkdown(file.path) !== file.previousContent) {
40
+ throw new Error(`Managed Markdown changed before write: ${file.relativePath}`);
41
+ }
42
+ writeFileAtomic(file.path, file.newContent, file.previousContent === null ? undefined : fs.statSync(file.path).mode);
43
+ }
31
44
  const CLAUDE_SETTINGS_PATH = ".claude/settings.json";
32
- const LEGACY_UNTRACKED_AGENTS_MD_BLOCK_HASHES = new Set([
33
- // v0.5.0-beta.17 and earlier wrote AGENTS.md but did not hash-track it.
34
- // This hash is the pristine Trellis-managed block before the Subagents
35
- // section was added, so old untouched projects can be updated without a
36
- // false "modified by you" conflict.
37
- "c1f511b1cfc1902f2147da159f09cc51f380b0c9e341cdb3ac5dea5233f3e307",
38
- ]);
39
45
  // Paths that should never be touched (true user data)
40
46
  // spec/ is user-customized content created during init; update should never modify it
41
47
  const PROTECTED_PATHS = [
@@ -46,28 +52,15 @@ const PROTECTED_PATHS = [
46
52
  `${DIR_NAMES.WORKFLOW}/.current-task`,
47
53
  ];
48
54
  function getManagedBlock(content, startMarker, endMarker) {
49
- const start = content.indexOf(startMarker);
50
- if (start === -1) {
51
- return null;
52
- }
53
- const end = content.indexOf(endMarker, start);
54
- if (end === -1) {
55
- return null;
56
- }
57
- return content.slice(start, end + endMarker.length);
58
- }
59
- function getTrellisManagedBlock(content) {
60
- return getManagedBlock(content, TRELLIS_BLOCK_START, TRELLIS_BLOCK_END);
55
+ return managedBlock(content, startMarker, endMarker);
61
56
  }
62
57
  function replaceManagedBlock(existingContent, templateContent, startMarker, endMarker) {
63
- const existingStart = existingContent.indexOf(startMarker);
64
- if (existingStart === -1) {
65
- return null;
66
- }
67
- const existingEnd = existingContent.indexOf(endMarker, existingStart);
68
- if (existingEnd === -1) {
58
+ const previous = managedBlock(existingContent, startMarker, endMarker);
59
+ if (!previous) {
69
60
  return null;
70
61
  }
62
+ const existingStart = existingContent.indexOf(startMarker);
63
+ const existingEnd = existingStart + previous.length - endMarker.length;
71
64
  const templateBlock = getManagedBlock(templateContent, startMarker, endMarker);
72
65
  if (!templateBlock) {
73
66
  return null;
@@ -85,15 +78,14 @@ function mergeManagedBlockContent(existingContent, templateContent, startMarker,
85
78
  if (!templateBlock) {
86
79
  return templateContent;
87
80
  }
88
- const trimmed = existingContent.replace(/\s+$/, "");
89
- return `${trimmed}\n\n${templateBlock}\n`;
81
+ return mergeManagedMarkdown(existingContent, templateContent, startMarker, endMarker);
90
82
  }
91
83
  function buildManagedBlockTemplate(cwd, relativePath, templateContent, startMarker, endMarker) {
92
84
  const fullPath = path.join(cwd, ...relativePath.split("/"));
93
- if (!fs.existsSync(fullPath)) {
85
+ const existingContent = readManagedMarkdown(fullPath);
86
+ if (existingContent === null) {
94
87
  return templateContent;
95
88
  }
96
- const existingContent = fs.readFileSync(fullPath, "utf-8");
97
89
  return mergeManagedBlockContent(existingContent, templateContent, startMarker, endMarker);
98
90
  }
99
91
  function buildAgentsMdTemplate(cwd) {
@@ -102,16 +94,6 @@ function buildAgentsMdTemplate(cwd) {
102
94
  function buildCopilotInstructionsTemplate(cwd) {
103
95
  return buildManagedBlockTemplate(cwd, COPILOT_INSTRUCTIONS_PATH, getCopilotInstructions(), COPILOT_INSTRUCTIONS_BLOCK_START, COPILOT_INSTRUCTIONS_BLOCK_END);
104
96
  }
105
- function isKnownUntrackedTemplate(relativePath, existingContent) {
106
- if (relativePath !== FILE_NAMES.AGENTS) {
107
- return false;
108
- }
109
- const managedBlock = getTrellisManagedBlock(existingContent);
110
- if (!managedBlock) {
111
- return false;
112
- }
113
- return LEGACY_UNTRACKED_AGENTS_MD_BLOCK_HASHES.has(computeHash(managedBlock));
114
- }
115
97
  function isSafeUntrackedCopilotInstructionsMerge(relativePath, existingContent, newContent) {
116
98
  if (relativePath !== COPILOT_INSTRUCTIONS_PATH) {
117
99
  return false;
@@ -528,6 +510,24 @@ function preserveExistingRegistryConfig(cwd, template) {
528
510
  ` source: ${registry.source}\n` +
529
511
  (registry.template ? ` template: ${registry.template}\n` : ""));
530
512
  }
513
+ const RUNTIME_IGNORE_RULES = [
514
+ "session-handoffs/",
515
+ "tasks/**/provider-stderr.log",
516
+ ];
517
+ function runtimeIgnoreContent(existing) {
518
+ const lines = existing.split(/\r?\n/).map((line) => line.trim());
519
+ const missing = RUNTIME_IGNORE_RULES.filter((rule) => {
520
+ const index = lines.lastIndexOf(rule);
521
+ return (index < 0 || lines.slice(index + 1).some((line) => line.startsWith("!")));
522
+ });
523
+ return missing.length
524
+ ? existing +
525
+ (existing.endsWith("\n") ? "\n" : "\n\n") +
526
+ "# Private Trellis handoff and provider diagnostics\n" +
527
+ missing.join("\n") +
528
+ "\n"
529
+ : existing;
530
+ }
531
531
  async function collectRegistrySpecTemplates(cwd) {
532
532
  const config = loadSpecRegistryConfig(cwd);
533
533
  if (!config)
@@ -606,7 +606,11 @@ bypassUpdateSkip = false) {
606
606
  // Configuration
607
607
  files.set(`${DIR_NAMES.WORKFLOW}/teamwork.json`, teamworkConfigTemplate);
608
608
  files.set(`${DIR_NAMES.WORKFLOW}/config.yaml`, preserveExistingRegistryConfig(cwd, configYamlTemplate));
609
- files.set(`${DIR_NAMES.WORKFLOW}/.gitignore`, gitignoreTemplate);
609
+ const ignorePath = `${DIR_NAMES.WORKFLOW}/.gitignore`;
610
+ const existingIgnore = path.join(cwd, ignorePath);
611
+ files.set(ignorePath, fs.existsSync(existingIgnore)
612
+ ? runtimeIgnoreContent(fs.readFileSync(existingIgnore, "utf8"))
613
+ : gitignoreTemplate);
610
614
  // workflow.md is included here because it is runtime-parsed by
611
615
  // get_context.py and shared hooks. Keep it on the normal template update
612
616
  // path: if the installed file still matches the tracked hash, update the
@@ -630,14 +634,6 @@ bypassUpdateSkip = false) {
630
634
  }
631
635
  }
632
636
  }
633
- // Users configure sub-agent models by editing `model` /
634
- // `model_reasoning_effort` directly on the generated agent tomls. Preserve
635
- // those two keys from the on-disk files into the freshly rendered desired
636
- // content so a project whose only local edit is these keys is not flagged
637
- // as a modified-file conflict by the hash comparison below.
638
- if (platforms.has("codex")) {
639
- preserveCodexAgentModelKeys(cwd, files);
640
- }
641
637
  preserveExistingClaudeStatusLine(cwd, files);
642
638
  for (const [filePath, content] of await collectRegistrySpecTemplates(cwd)) {
643
639
  files.set(filePath, content);
@@ -684,6 +680,9 @@ function analyzeChanges(cwd, hashes, templates) {
684
680
  path: fullPath,
685
681
  relativePath,
686
682
  newContent,
683
+ previousContent: relativePath === FILE_NAMES.AGENTS
684
+ ? readManagedMarkdown(fullPath)
685
+ : undefined,
687
686
  status: "new",
688
687
  };
689
688
  if (!exists) {
@@ -709,8 +708,9 @@ function analyzeChanges(cwd, hashes, templates) {
709
708
  const storedHash = hashes[relativePath];
710
709
  const currentHash = computeHash(existingContent);
711
710
  if ((storedHash && storedHash === currentHash) ||
712
- (!storedHash &&
713
- isKnownUntrackedTemplate(relativePath, existingContent)) ||
711
+ (relativePath === `${DIR_NAMES.WORKFLOW}/.gitignore` &&
712
+ newContent.startsWith(existingContent) &&
713
+ newContent === runtimeIgnoreContent(existingContent)) ||
714
714
  (!storedHash &&
715
715
  isSafeUntrackedCopilotInstructionsMerge(relativePath, existingContent, newContent))) {
716
716
  // Either the tracked hash matches, or this is a known pristine template
@@ -758,6 +758,8 @@ function collectUnchangedFileHashRepairs(changes, hashes) {
758
758
  const key = toPosix(file.relativePath);
759
759
  const recorded = hashes[key];
760
760
  if (recorded === undefined) {
761
+ if (key === FILE_NAMES.AGENTS)
762
+ continue;
761
763
  // A missing entry is only an omission for a path the receipt is meant
762
764
  // to carry. `EXCLUDE_FROM_HASH` holds paths deliberately left out —
763
765
  // `.trellis/.gitignore` among them — and adding those here would put
@@ -1625,6 +1627,14 @@ export async function update(options) {
1625
1627
  // Migration metadata is displayed at the end to prevent scrolling off screen
1626
1628
  // Load template hashes for modification detection
1627
1629
  let hashes = loadHashes(cwd);
1630
+ const retirementHashes = { ...hashes };
1631
+ // Keep ownership evidence before orphan pruning removes retired paths.
1632
+ const nativeRetirement = planNativeRetirement(cwd, hashes, loadUpdateSkipPaths(cwd));
1633
+ if (nativeRetirement.deletions.length > 0) {
1634
+ console.log(chalk.cyan("Retiring native execution assets:"));
1635
+ for (const entry of nativeRetirement.deletions)
1636
+ console.log(` Delete: ${entry.path}`);
1637
+ }
1628
1638
  const zcodeConfigured = getConfiguredPlatforms(cwd).has("zcode");
1629
1639
  const isFirstHashTracking = Object.keys(hashes).length === 0;
1630
1640
  // Handle unknown version - skip regular migrations but safe-file-delete still runs
@@ -1674,7 +1684,37 @@ export async function update(options) {
1674
1684
  return md.breaking && md.recommendMigrate;
1675
1685
  })();
1676
1686
  // Collect templates (used for both migration classification and change analysis)
1687
+ const agentsSnapshot = readManagedMarkdown(path.join(cwd, FILE_NAMES.AGENTS));
1677
1688
  const templates = await collectTemplateFiles(cwd, codexUpgradeNeeded ? new Set(["codex"]) : undefined, breakingBypass);
1689
+ const mixedBaselines = new Map();
1690
+ for (const relative of mixedNativeAssets) {
1691
+ const template = templates.get(relative);
1692
+ const absolute = path.join(cwd, relative);
1693
+ if (template === undefined || !fs.existsSync(absolute))
1694
+ continue;
1695
+ const current = fs.readFileSync(absolute, "utf8");
1696
+ if (nativeRetirement.edits.has(relative)) {
1697
+ mixedBaselines.set(relative, template);
1698
+ }
1699
+ else if (current !== template &&
1700
+ hashes[relative] === computeHash(current)) {
1701
+ // A mixed-content receipt cannot authorize replacing user fields.
1702
+ hashes[relative] = computeHash(template);
1703
+ mixedBaselines.set(relative, template);
1704
+ }
1705
+ }
1706
+ for (const [relative, content] of nativeRetirement.edits) {
1707
+ templates.set(relative, content);
1708
+ }
1709
+ for (const [relative, hash] of nativeRetirement.originalHashes) {
1710
+ hashes[relative] = hash;
1711
+ retirementHashes[relative] = hash;
1712
+ }
1713
+ assertNativeRetirementWrites(cwd, templates, retirementHashes, nativeRetirement.edits);
1714
+ if (readManagedMarkdown(path.join(cwd, FILE_NAMES.AGENTS)) !==
1715
+ agentsSnapshot) {
1716
+ throw new Error("AGENTS.md changed during template collection; preview again");
1717
+ }
1678
1718
  // Load update.skip paths (used for both safe-file-delete and template collection)
1679
1719
  const skipPaths = loadUpdateSkipPaths(cwd);
1680
1720
  // Collect safe-file-delete items from ALL manifests (hash match is the safety net)
@@ -1794,7 +1834,9 @@ export async function update(options) {
1794
1834
  changes.autoUpdateFiles.length === 0 &&
1795
1835
  changes.changedFiles.length === 0 &&
1796
1836
  !hasPendingMigrations &&
1797
- !hasSafeDeletes) {
1837
+ !hasSafeDeletes &&
1838
+ nativeRetirement.deletions.length === 0) {
1839
+ assertCurrentExecutionTree(cwd);
1798
1840
  // The "already up to date" exit still has to repair the receipt: this is
1799
1841
  // exactly the clean tree where every file is `unchanged`, so it is the run
1800
1842
  // where a wrong entry would otherwise be skipped again.
@@ -1906,6 +1948,7 @@ export async function update(options) {
1906
1948
  ];
1907
1949
  });
1908
1950
  const backupDir = createFullBackup(cwd, [
1951
+ ...nativeRetirement.deletions.map((entry) => entry.path),
1909
1952
  ...templates.keys(),
1910
1953
  ...changes.changedFiles.map((file) => `${file.relativePath}.new`),
1911
1954
  ...migrationScope,
@@ -1938,6 +1981,7 @@ export async function update(options) {
1938
1981
  }
1939
1982
  }
1940
1983
  // Execute safe-file-delete (after backup, before template writes)
1984
+ executeNativeRetirement(cwd, nativeRetirement);
1941
1985
  let safeDeleted = 0;
1942
1986
  if (hasSafeDeletes) {
1943
1987
  safeDeleted = executeSafeFileDeletes(safeFileDeletes, cwd);
@@ -1957,7 +2001,7 @@ export async function update(options) {
1957
2001
  for (const file of changes.newFiles) {
1958
2002
  const dir = path.dirname(file.path);
1959
2003
  fs.mkdirSync(dir, { recursive: true });
1960
- fs.writeFileSync(file.path, file.newContent);
2004
+ writeUpdateFile(file);
1961
2005
  // Make scripts executable
1962
2006
  if (file.relativePath.endsWith(".sh") ||
1963
2007
  file.relativePath.endsWith(".py")) {
@@ -1971,7 +2015,7 @@ export async function update(options) {
1971
2015
  if (changes.autoUpdateFiles.length > 0) {
1972
2016
  console.log(chalk.blue("\nAuto-updating template files..."));
1973
2017
  for (const file of changes.autoUpdateFiles) {
1974
- fs.writeFileSync(file.path, file.newContent);
2018
+ writeUpdateFile(file);
1975
2019
  // Make scripts executable
1976
2020
  if (file.relativePath.endsWith(".sh") ||
1977
2021
  file.relativePath.endsWith(".py")) {
@@ -1988,7 +2032,7 @@ export async function update(options) {
1988
2032
  for (const file of changes.changedFiles) {
1989
2033
  const action = await promptConflictResolution(file, options, applyToAll);
1990
2034
  if (action === "overwrite") {
1991
- fs.writeFileSync(file.path, file.newContent);
2035
+ writeUpdateFile(file);
1992
2036
  if (file.relativePath.endsWith(".sh") ||
1993
2037
  file.relativePath.endsWith(".py")) {
1994
2038
  fs.chmodSync(file.path, "755");
@@ -2020,18 +2064,25 @@ export async function update(options) {
2020
2064
  }
2021
2065
  }
2022
2066
  // Update version file
2067
+ assertCurrentExecutionTree(cwd);
2023
2068
  updateVersionFile(cwd);
2024
2069
  // Update template hashes for new, auto-updated, and overwritten files
2025
2070
  const filesToHash = new Map(unchangedFileHashRepairs);
2026
2071
  for (const file of changes.newFiles) {
2072
+ if (file.relativePath === `${DIR_NAMES.WORKFLOW}/.gitignore`)
2073
+ continue;
2027
2074
  filesToHash.set(file.relativePath, file.newContent);
2028
2075
  }
2029
2076
  // Auto-updated files always get new hash
2030
2077
  for (const file of changes.autoUpdateFiles) {
2078
+ if (file.relativePath === `${DIR_NAMES.WORKFLOW}/.gitignore`)
2079
+ continue;
2031
2080
  filesToHash.set(file.relativePath, file.newContent);
2032
2081
  }
2033
2082
  // Only hash overwritten files (not skipped or .new copies)
2034
2083
  for (const file of changes.changedFiles) {
2084
+ if (file.relativePath === `${DIR_NAMES.WORKFLOW}/.gitignore`)
2085
+ continue;
2035
2086
  const fullPath = path.join(cwd, file.relativePath);
2036
2087
  if (fs.existsSync(fullPath)) {
2037
2088
  const content = fs.readFileSync(fullPath, "utf-8");
@@ -2040,6 +2091,9 @@ export async function update(options) {
2040
2091
  }
2041
2092
  }
2042
2093
  }
2094
+ for (const [relative, template] of mixedBaselines) {
2095
+ filesToHash.set(relative, template);
2096
+ }
2043
2097
  if (filesToHash.size > 0) {
2044
2098
  updateHashes(cwd, filesToHash);
2045
2099
  }