@chorus-aidlc/chorus 0.17.3 → 0.18.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 (457) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/app-build-manifest.json +345 -341
  3. package/.next/standalone/.next/app-path-routes-manifest.json +35 -35
  4. package/.next/standalone/.next/build-manifest.json +5 -5
  5. package/.next/standalone/.next/prerender-manifest.json +27 -27
  6. package/.next/standalone/.next/server/app/(dashboard)/project-groups/[uuid]/page.js +1 -1
  7. package/.next/standalone/.next/server/app/(dashboard)/project-groups/[uuid]/page.js.nft.json +1 -1
  8. package/.next/standalone/.next/server/app/(dashboard)/project-groups/[uuid]/page_client-reference-manifest.js +1 -1
  9. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/activity/page.js +1 -1
  10. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/activity/page_client-reference-manifest.js +1 -1
  11. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/dashboard/[ideaUuid]/page.js +1 -1
  12. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/dashboard/[ideaUuid]/page_client-reference-manifest.js +1 -1
  13. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/dashboard/page.js +2 -2
  14. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/dashboard/page.js.nft.json +1 -1
  15. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/dashboard/page_client-reference-manifest.js +1 -1
  16. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/documents/[documentUuid]/page.js +2 -2
  17. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/documents/[documentUuid]/page.js.nft.json +1 -1
  18. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/documents/[documentUuid]/page_client-reference-manifest.js +1 -1
  19. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/documents/page.js +2 -2
  20. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/documents/page_client-reference-manifest.js +1 -1
  21. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/graph/page.js +2 -2
  22. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/graph/page.js.nft.json +1 -1
  23. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/graph/page_client-reference-manifest.js +1 -1
  24. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/[proposalUuid]/page.js +2 -2
  25. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/[proposalUuid]/page.js.nft.json +1 -1
  26. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/[proposalUuid]/page_client-reference-manifest.js +1 -1
  27. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/new/page.js +2 -2
  28. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/new/page.js.nft.json +1 -1
  29. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/new/page_client-reference-manifest.js +1 -1
  30. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/page.js +2 -2
  31. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/page_client-reference-manifest.js +1 -1
  32. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/[taskUuid]/page.js +1 -1
  33. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/[taskUuid]/page.js.nft.json +1 -1
  34. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/[taskUuid]/page_client-reference-manifest.js +1 -1
  35. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/page.js +1 -1
  36. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/page.js.nft.json +1 -1
  37. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/page_client-reference-manifest.js +1 -1
  38. package/.next/standalone/.next/server/app/(dashboard)/projects/page.js +1 -1
  39. package/.next/standalone/.next/server/app/(dashboard)/projects/page.js.nft.json +1 -1
  40. package/.next/standalone/.next/server/app/(dashboard)/projects/page_client-reference-manifest.js +1 -1
  41. package/.next/standalone/.next/server/app/(dashboard)/settings/page.js +2 -2
  42. package/.next/standalone/.next/server/app/(dashboard)/settings/page.js.nft.json +1 -1
  43. package/.next/standalone/.next/server/app/(dashboard)/settings/page_client-reference-manifest.js +1 -1
  44. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  45. package/.next/standalone/.next/server/app/_not-found.html +2 -2
  46. package/.next/standalone/.next/server/app/_not-found.rsc +2 -2
  47. package/.next/standalone/.next/server/app/admin/companies/[uuid]/page_client-reference-manifest.js +1 -1
  48. package/.next/standalone/.next/server/app/admin/companies/new/page_client-reference-manifest.js +1 -1
  49. package/.next/standalone/.next/server/app/admin/companies/new.html +2 -2
  50. package/.next/standalone/.next/server/app/admin/companies/new.rsc +2 -2
  51. package/.next/standalone/.next/server/app/admin/companies/page_client-reference-manifest.js +1 -1
  52. package/.next/standalone/.next/server/app/admin/companies.html +2 -2
  53. package/.next/standalone/.next/server/app/admin/companies.rsc +2 -2
  54. package/.next/standalone/.next/server/app/admin/page_client-reference-manifest.js +1 -1
  55. package/.next/standalone/.next/server/app/admin.html +2 -2
  56. package/.next/standalone/.next/server/app/admin.rsc +2 -2
  57. package/.next/standalone/.next/server/app/api/admin/companies/[uuid]/route_client-reference-manifest.js +1 -1
  58. package/.next/standalone/.next/server/app/api/admin/companies/route_client-reference-manifest.js +1 -1
  59. package/.next/standalone/.next/server/app/api/admin/login/route_client-reference-manifest.js +1 -1
  60. package/.next/standalone/.next/server/app/api/admin/session/route_client-reference-manifest.js +1 -1
  61. package/.next/standalone/.next/server/app/api/agent-connections/route.js.nft.json +1 -1
  62. package/.next/standalone/.next/server/app/api/agent-connections/route_client-reference-manifest.js +1 -1
  63. package/.next/standalone/.next/server/app/api/agents/[uuid]/route_client-reference-manifest.js +1 -1
  64. package/.next/standalone/.next/server/app/api/agents/[uuid]/sessions/route.js +1 -1
  65. package/.next/standalone/.next/server/app/api/agents/[uuid]/sessions/route.js.nft.json +1 -1
  66. package/.next/standalone/.next/server/app/api/agents/[uuid]/sessions/route_client-reference-manifest.js +1 -1
  67. package/.next/standalone/.next/server/app/api/agents/route_client-reference-manifest.js +1 -1
  68. package/.next/standalone/.next/server/app/api/api-keys/[uuid]/route_client-reference-manifest.js +1 -1
  69. package/.next/standalone/.next/server/app/api/api-keys/route_client-reference-manifest.js +1 -1
  70. package/.next/standalone/.next/server/app/api/auth/callback/route_client-reference-manifest.js +1 -1
  71. package/.next/standalone/.next/server/app/api/auth/check-default/route_client-reference-manifest.js +1 -1
  72. package/.next/standalone/.next/server/app/api/auth/company-oidc/route_client-reference-manifest.js +1 -1
  73. package/.next/standalone/.next/server/app/api/auth/default-login/route_client-reference-manifest.js +1 -1
  74. package/.next/standalone/.next/server/app/api/auth/identify/route_client-reference-manifest.js +1 -1
  75. package/.next/standalone/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  76. package/.next/standalone/.next/server/app/api/auth/me/route_client-reference-manifest.js +1 -1
  77. package/.next/standalone/.next/server/app/api/auth/sync-token/route_client-reference-manifest.js +1 -1
  78. package/.next/standalone/.next/server/app/api/comments/route.js +1 -1
  79. package/.next/standalone/.next/server/app/api/comments/route.js.nft.json +1 -1
  80. package/.next/standalone/.next/server/app/api/comments/route_client-reference-manifest.js +1 -1
  81. package/.next/standalone/.next/server/app/api/daemon/connection-heartbeat/route.js.nft.json +1 -1
  82. package/.next/standalone/.next/server/app/api/daemon/connection-heartbeat/route_client-reference-manifest.js +1 -1
  83. package/.next/standalone/.next/server/app/api/daemon/control/route.js +1 -1
  84. package/.next/standalone/.next/server/app/api/daemon/control/route.js.nft.json +1 -1
  85. package/.next/standalone/.next/server/app/api/daemon/control/route_client-reference-manifest.js +1 -1
  86. package/.next/standalone/.next/server/app/api/daemon/directory-request/report/route.js.nft.json +1 -1
  87. package/.next/standalone/.next/server/app/api/daemon/directory-request/report/route_client-reference-manifest.js +1 -1
  88. package/.next/standalone/.next/server/app/api/daemon/execution-state/route.js.nft.json +1 -1
  89. package/.next/standalone/.next/server/app/api/daemon/execution-state/route_client-reference-manifest.js +1 -1
  90. package/.next/standalone/.next/server/app/api/daemon/executions/route.js.nft.json +1 -1
  91. package/.next/standalone/.next/server/app/api/daemon/executions/route_client-reference-manifest.js +1 -1
  92. package/.next/standalone/.next/server/app/api/daemon/pending-turns/route.js +1 -1
  93. package/.next/standalone/.next/server/app/api/daemon/pending-turns/route.js.nft.json +1 -1
  94. package/.next/standalone/.next/server/app/api/daemon/pending-turns/route_client-reference-manifest.js +1 -1
  95. package/.next/standalone/.next/server/app/api/daemon/report-interrupt/route.js.nft.json +1 -1
  96. package/.next/standalone/.next/server/app/api/daemon/report-interrupt/route_client-reference-manifest.js +1 -1
  97. package/.next/standalone/.next/server/app/api/daemon/resume/route.js +1 -1
  98. package/.next/standalone/.next/server/app/api/daemon/resume/route.js.nft.json +1 -1
  99. package/.next/standalone/.next/server/app/api/daemon/resume/route_client-reference-manifest.js +1 -1
  100. package/.next/standalone/.next/server/app/api/daemon/transcript/route.js +1 -1
  101. package/.next/standalone/.next/server/app/api/daemon/transcript/route.js.nft.json +1 -1
  102. package/.next/standalone/.next/server/app/api/daemon/transcript/route_client-reference-manifest.js +1 -1
  103. package/.next/standalone/.next/server/app/api/daemon/turn-advance/route.js +1 -1
  104. package/.next/standalone/.next/server/app/api/daemon/turn-advance/route.js.nft.json +1 -1
  105. package/.next/standalone/.next/server/app/api/daemon/turn-advance/route_client-reference-manifest.js +1 -1
  106. package/.next/standalone/.next/server/app/api/daemon-directory-requests/[uuid]/route.js.nft.json +1 -1
  107. package/.next/standalone/.next/server/app/api/daemon-directory-requests/[uuid]/route_client-reference-manifest.js +1 -1
  108. package/.next/standalone/.next/server/app/api/daemon-directory-requests/route.js.nft.json +1 -1
  109. package/.next/standalone/.next/server/app/api/daemon-directory-requests/route_client-reference-manifest.js +1 -1
  110. package/.next/standalone/.next/server/app/api/daemon-sessions/[sessionUuid]/instruction/route.js +1 -1
  111. package/.next/standalone/.next/server/app/api/daemon-sessions/[sessionUuid]/instruction/route.js.nft.json +1 -1
  112. package/.next/standalone/.next/server/app/api/daemon-sessions/[sessionUuid]/instruction/route_client-reference-manifest.js +1 -1
  113. package/.next/standalone/.next/server/app/api/daemon-sessions/[sessionUuid]/repoint/route.js +1 -1
  114. package/.next/standalone/.next/server/app/api/daemon-sessions/[sessionUuid]/repoint/route.js.nft.json +1 -1
  115. package/.next/standalone/.next/server/app/api/daemon-sessions/[sessionUuid]/repoint/route_client-reference-manifest.js +1 -1
  116. package/.next/standalone/.next/server/app/api/daemon-sessions/[sessionUuid]/route.js +1 -1
  117. package/.next/standalone/.next/server/app/api/daemon-sessions/[sessionUuid]/route.js.nft.json +1 -1
  118. package/.next/standalone/.next/server/app/api/daemon-sessions/[sessionUuid]/route_client-reference-manifest.js +1 -1
  119. package/.next/standalone/.next/server/app/api/daemon-sessions/ad-hoc/route.js +1 -1
  120. package/.next/standalone/.next/server/app/api/daemon-sessions/ad-hoc/route.js.nft.json +1 -1
  121. package/.next/standalone/.next/server/app/api/daemon-sessions/ad-hoc/route_client-reference-manifest.js +1 -1
  122. package/.next/standalone/.next/server/app/api/daemon-sessions/route.js +1 -1
  123. package/.next/standalone/.next/server/app/api/daemon-sessions/route.js.nft.json +1 -1
  124. package/.next/standalone/.next/server/app/api/daemon-sessions/route_client-reference-manifest.js +1 -1
  125. package/.next/standalone/.next/server/app/api/documents/[uuid]/route_client-reference-manifest.js +1 -1
  126. package/.next/standalone/.next/server/app/api/entities/[type]/[uuid]/root-idea/route.js +1 -1
  127. package/.next/standalone/.next/server/app/api/entities/[type]/[uuid]/root-idea/route.js.nft.json +1 -1
  128. package/.next/standalone/.next/server/app/api/entities/[type]/[uuid]/root-idea/route_client-reference-manifest.js +1 -1
  129. package/.next/standalone/.next/server/app/api/events/notifications/route.js +1 -1
  130. package/.next/standalone/.next/server/app/api/events/notifications/route.js.nft.json +1 -1
  131. package/.next/standalone/.next/server/app/api/events/notifications/route_client-reference-manifest.js +1 -1
  132. package/.next/standalone/.next/server/app/api/events/route.js +1 -1
  133. package/.next/standalone/.next/server/app/api/events/route.js.nft.json +1 -1
  134. package/.next/standalone/.next/server/app/api/events/route_client-reference-manifest.js +1 -1
  135. package/.next/standalone/.next/server/app/api/health/route_client-reference-manifest.js +1 -1
  136. package/.next/standalone/.next/server/app/api/ideas/[uuid]/claim/route.js +1 -1
  137. package/.next/standalone/.next/server/app/api/ideas/[uuid]/claim/route.js.nft.json +1 -1
  138. package/.next/standalone/.next/server/app/api/ideas/[uuid]/claim/route_client-reference-manifest.js +1 -1
  139. package/.next/standalone/.next/server/app/api/ideas/[uuid]/move/preview/route.js +1 -1
  140. package/.next/standalone/.next/server/app/api/ideas/[uuid]/move/preview/route.js.nft.json +1 -1
  141. package/.next/standalone/.next/server/app/api/ideas/[uuid]/move/preview/route_client-reference-manifest.js +1 -1
  142. package/.next/standalone/.next/server/app/api/ideas/[uuid]/move/route.js +1 -1
  143. package/.next/standalone/.next/server/app/api/ideas/[uuid]/move/route.js.nft.json +1 -1
  144. package/.next/standalone/.next/server/app/api/ideas/[uuid]/move/route_client-reference-manifest.js +1 -1
  145. package/.next/standalone/.next/server/app/api/ideas/[uuid]/parent/route.js +1 -1
  146. package/.next/standalone/.next/server/app/api/ideas/[uuid]/parent/route.js.nft.json +1 -1
  147. package/.next/standalone/.next/server/app/api/ideas/[uuid]/parent/route_client-reference-manifest.js +1 -1
  148. package/.next/standalone/.next/server/app/api/ideas/[uuid]/release/route.js +1 -1
  149. package/.next/standalone/.next/server/app/api/ideas/[uuid]/release/route.js.nft.json +1 -1
  150. package/.next/standalone/.next/server/app/api/ideas/[uuid]/release/route_client-reference-manifest.js +1 -1
  151. package/.next/standalone/.next/server/app/api/ideas/[uuid]/route.js +1 -1
  152. package/.next/standalone/.next/server/app/api/ideas/[uuid]/route.js.nft.json +1 -1
  153. package/.next/standalone/.next/server/app/api/ideas/[uuid]/route_client-reference-manifest.js +1 -1
  154. package/.next/standalone/.next/server/app/api/ideas/[uuid]/wake-preview/route.js.nft.json +1 -1
  155. package/.next/standalone/.next/server/app/api/ideas/[uuid]/wake-preview/route_client-reference-manifest.js +1 -1
  156. package/.next/standalone/.next/server/app/api/ideas/conversational/route.js +1 -1
  157. package/.next/standalone/.next/server/app/api/ideas/conversational/route.js.nft.json +1 -1
  158. package/.next/standalone/.next/server/app/api/ideas/conversational/route_client-reference-manifest.js +1 -1
  159. package/.next/standalone/.next/server/app/api/mcp/route.js +1 -1
  160. package/.next/standalone/.next/server/app/api/mcp/route.js.nft.json +1 -1
  161. package/.next/standalone/.next/server/app/api/mcp/route_client-reference-manifest.js +1 -1
  162. package/.next/standalone/.next/server/app/api/me/assignments/route.js +1 -1
  163. package/.next/standalone/.next/server/app/api/me/assignments/route.js.nft.json +1 -1
  164. package/.next/standalone/.next/server/app/api/me/assignments/route_client-reference-manifest.js +1 -1
  165. package/.next/standalone/.next/server/app/api/mentionables/route.js +1 -1
  166. package/.next/standalone/.next/server/app/api/mentionables/route.js.nft.json +1 -1
  167. package/.next/standalone/.next/server/app/api/mentionables/route_client-reference-manifest.js +1 -1
  168. package/.next/standalone/.next/server/app/api/notifications/[uuid]/archive/route.js +1 -1
  169. package/.next/standalone/.next/server/app/api/notifications/[uuid]/archive/route.js.nft.json +1 -1
  170. package/.next/standalone/.next/server/app/api/notifications/[uuid]/archive/route_client-reference-manifest.js +1 -1
  171. package/.next/standalone/.next/server/app/api/notifications/[uuid]/read/route.js +1 -1
  172. package/.next/standalone/.next/server/app/api/notifications/[uuid]/read/route.js.nft.json +1 -1
  173. package/.next/standalone/.next/server/app/api/notifications/[uuid]/read/route_client-reference-manifest.js +1 -1
  174. package/.next/standalone/.next/server/app/api/notifications/preferences/route.js +1 -1
  175. package/.next/standalone/.next/server/app/api/notifications/preferences/route.js.nft.json +1 -1
  176. package/.next/standalone/.next/server/app/api/notifications/preferences/route_client-reference-manifest.js +1 -1
  177. package/.next/standalone/.next/server/app/api/notifications/read-all/route.js +1 -1
  178. package/.next/standalone/.next/server/app/api/notifications/read-all/route.js.nft.json +1 -1
  179. package/.next/standalone/.next/server/app/api/notifications/read-all/route_client-reference-manifest.js +1 -1
  180. package/.next/standalone/.next/server/app/api/notifications/route.js +1 -1
  181. package/.next/standalone/.next/server/app/api/notifications/route.js.nft.json +1 -1
  182. package/.next/standalone/.next/server/app/api/notifications/route_client-reference-manifest.js +1 -1
  183. package/.next/standalone/.next/server/app/api/notifications/unread-count/route.js +1 -1
  184. package/.next/standalone/.next/server/app/api/notifications/unread-count/route.js.nft.json +1 -1
  185. package/.next/standalone/.next/server/app/api/notifications/unread-count/route_client-reference-manifest.js +1 -1
  186. package/.next/standalone/.next/server/app/api/project-groups/[uuid]/dashboard/route_client-reference-manifest.js +1 -1
  187. package/.next/standalone/.next/server/app/api/project-groups/[uuid]/route_client-reference-manifest.js +1 -1
  188. package/.next/standalone/.next/server/app/api/project-groups/route_client-reference-manifest.js +1 -1
  189. package/.next/standalone/.next/server/app/api/project-visits/pin/route_client-reference-manifest.js +1 -1
  190. package/.next/standalone/.next/server/app/api/project-visits/route_client-reference-manifest.js +1 -1
  191. package/.next/standalone/.next/server/app/api/project-visits/visit/route_client-reference-manifest.js +1 -1
  192. package/.next/standalone/.next/server/app/api/projects/[uuid]/activity/route_client-reference-manifest.js +1 -1
  193. package/.next/standalone/.next/server/app/api/projects/[uuid]/agent-cwds/route.js.nft.json +1 -1
  194. package/.next/standalone/.next/server/app/api/projects/[uuid]/agent-cwds/route_client-reference-manifest.js +1 -1
  195. package/.next/standalone/.next/server/app/api/projects/[uuid]/available/route.js +1 -1
  196. package/.next/standalone/.next/server/app/api/projects/[uuid]/available/route.js.nft.json +1 -1
  197. package/.next/standalone/.next/server/app/api/projects/[uuid]/available/route_client-reference-manifest.js +1 -1
  198. package/.next/standalone/.next/server/app/api/projects/[uuid]/documents/route_client-reference-manifest.js +1 -1
  199. package/.next/standalone/.next/server/app/api/projects/[uuid]/group/route_client-reference-manifest.js +1 -1
  200. package/.next/standalone/.next/server/app/api/projects/[uuid]/ideas/route.js +1 -1
  201. package/.next/standalone/.next/server/app/api/projects/[uuid]/ideas/route.js.nft.json +1 -1
  202. package/.next/standalone/.next/server/app/api/projects/[uuid]/ideas/route_client-reference-manifest.js +1 -1
  203. package/.next/standalone/.next/server/app/api/projects/[uuid]/ideas/tracker/route.js +1 -1
  204. package/.next/standalone/.next/server/app/api/projects/[uuid]/ideas/tracker/route.js.nft.json +1 -1
  205. package/.next/standalone/.next/server/app/api/projects/[uuid]/ideas/tracker/route_client-reference-manifest.js +1 -1
  206. package/.next/standalone/.next/server/app/api/projects/[uuid]/proposals/[proposalUuid]/validate/route_client-reference-manifest.js +1 -1
  207. package/.next/standalone/.next/server/app/api/projects/[uuid]/proposals/route_client-reference-manifest.js +1 -1
  208. package/.next/standalone/.next/server/app/api/projects/[uuid]/proposals/summary/route_client-reference-manifest.js +1 -1
  209. package/.next/standalone/.next/server/app/api/projects/[uuid]/resource-graph/route.js +1 -1
  210. package/.next/standalone/.next/server/app/api/projects/[uuid]/resource-graph/route.js.nft.json +1 -1
  211. package/.next/standalone/.next/server/app/api/projects/[uuid]/resource-graph/route_client-reference-manifest.js +1 -1
  212. package/.next/standalone/.next/server/app/api/projects/[uuid]/route_client-reference-manifest.js +1 -1
  213. package/.next/standalone/.next/server/app/api/projects/[uuid]/stats/route_client-reference-manifest.js +1 -1
  214. package/.next/standalone/.next/server/app/api/projects/[uuid]/tasks/dependencies/route.js +1 -1
  215. package/.next/standalone/.next/server/app/api/projects/[uuid]/tasks/dependencies/route.js.nft.json +1 -1
  216. package/.next/standalone/.next/server/app/api/projects/[uuid]/tasks/dependencies/route_client-reference-manifest.js +1 -1
  217. package/.next/standalone/.next/server/app/api/projects/[uuid]/tasks/route.js +1 -1
  218. package/.next/standalone/.next/server/app/api/projects/[uuid]/tasks/route.js.nft.json +1 -1
  219. package/.next/standalone/.next/server/app/api/projects/[uuid]/tasks/route_client-reference-manifest.js +1 -1
  220. package/.next/standalone/.next/server/app/api/projects/agent-cwd-options/route.js.nft.json +1 -1
  221. package/.next/standalone/.next/server/app/api/projects/agent-cwd-options/route_client-reference-manifest.js +1 -1
  222. package/.next/standalone/.next/server/app/api/projects/route.js.nft.json +1 -1
  223. package/.next/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
  224. package/.next/standalone/.next/server/app/api/proposals/[uuid]/approve/route_client-reference-manifest.js +1 -1
  225. package/.next/standalone/.next/server/app/api/proposals/[uuid]/close/route_client-reference-manifest.js +1 -1
  226. package/.next/standalone/.next/server/app/api/proposals/[uuid]/reject/route_client-reference-manifest.js +1 -1
  227. package/.next/standalone/.next/server/app/api/proposals/[uuid]/revoke/route_client-reference-manifest.js +1 -1
  228. package/.next/standalone/.next/server/app/api/proposals/[uuid]/route_client-reference-manifest.js +1 -1
  229. package/.next/standalone/.next/server/app/api/references/[uuid]/route_client-reference-manifest.js +1 -1
  230. package/.next/standalone/.next/server/app/api/references/route_client-reference-manifest.js +1 -1
  231. package/.next/standalone/.next/server/app/api/search/route_client-reference-manifest.js +1 -1
  232. package/.next/standalone/.next/server/app/api/session/route_client-reference-manifest.js +1 -1
  233. package/.next/standalone/.next/server/app/api/sessions/[uuid]/route.js +1 -1
  234. package/.next/standalone/.next/server/app/api/sessions/[uuid]/route.js.nft.json +1 -1
  235. package/.next/standalone/.next/server/app/api/sessions/[uuid]/route_client-reference-manifest.js +1 -1
  236. package/.next/standalone/.next/server/app/api/tasks/[uuid]/claim/route.js +1 -1
  237. package/.next/standalone/.next/server/app/api/tasks/[uuid]/claim/route.js.nft.json +1 -1
  238. package/.next/standalone/.next/server/app/api/tasks/[uuid]/claim/route_client-reference-manifest.js +1 -1
  239. package/.next/standalone/.next/server/app/api/tasks/[uuid]/dependencies/[dependsOnUuid]/route.js +1 -1
  240. package/.next/standalone/.next/server/app/api/tasks/[uuid]/dependencies/[dependsOnUuid]/route.js.nft.json +1 -1
  241. package/.next/standalone/.next/server/app/api/tasks/[uuid]/dependencies/[dependsOnUuid]/route_client-reference-manifest.js +1 -1
  242. package/.next/standalone/.next/server/app/api/tasks/[uuid]/dependencies/route.js +1 -1
  243. package/.next/standalone/.next/server/app/api/tasks/[uuid]/dependencies/route.js.nft.json +1 -1
  244. package/.next/standalone/.next/server/app/api/tasks/[uuid]/dependencies/route_client-reference-manifest.js +1 -1
  245. package/.next/standalone/.next/server/app/api/tasks/[uuid]/release/route.js +1 -1
  246. package/.next/standalone/.next/server/app/api/tasks/[uuid]/release/route.js.nft.json +1 -1
  247. package/.next/standalone/.next/server/app/api/tasks/[uuid]/release/route_client-reference-manifest.js +1 -1
  248. package/.next/standalone/.next/server/app/api/tasks/[uuid]/route.js +1 -1
  249. package/.next/standalone/.next/server/app/api/tasks/[uuid]/route.js.nft.json +1 -1
  250. package/.next/standalone/.next/server/app/api/tasks/[uuid]/route_client-reference-manifest.js +1 -1
  251. package/.next/standalone/.next/server/app/api/tasks/[uuid]/sessions/route.js +1 -1
  252. package/.next/standalone/.next/server/app/api/tasks/[uuid]/sessions/route.js.nft.json +1 -1
  253. package/.next/standalone/.next/server/app/api/tasks/[uuid]/sessions/route_client-reference-manifest.js +1 -1
  254. package/.next/standalone/.next/server/app/index.html +2 -2
  255. package/.next/standalone/.next/server/app/index.rsc +2 -2
  256. package/.next/standalone/.next/server/app/login/admin/page_client-reference-manifest.js +1 -1
  257. package/.next/standalone/.next/server/app/login/admin.html +2 -2
  258. package/.next/standalone/.next/server/app/login/admin.rsc +2 -2
  259. package/.next/standalone/.next/server/app/login/callback/page_client-reference-manifest.js +1 -1
  260. package/.next/standalone/.next/server/app/login/callback.html +2 -2
  261. package/.next/standalone/.next/server/app/login/callback.rsc +2 -2
  262. package/.next/standalone/.next/server/app/login/page_client-reference-manifest.js +1 -1
  263. package/.next/standalone/.next/server/app/login/pick-workspace/page_client-reference-manifest.js +1 -1
  264. package/.next/standalone/.next/server/app/login/pick-workspace.html +2 -2
  265. package/.next/standalone/.next/server/app/login/pick-workspace.rsc +2 -2
  266. package/.next/standalone/.next/server/app/login.html +2 -2
  267. package/.next/standalone/.next/server/app/login.rsc +2 -2
  268. package/.next/standalone/.next/server/app/onboarding/page.js +2 -2
  269. package/.next/standalone/.next/server/app/onboarding/page.js.nft.json +1 -1
  270. package/.next/standalone/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  271. package/.next/standalone/.next/server/app/onboarding.html +2 -2
  272. package/.next/standalone/.next/server/app/onboarding.rsc +3 -3
  273. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  274. package/.next/standalone/.next/server/app/projects.html +2 -2
  275. package/.next/standalone/.next/server/app/projects.rsc +3 -3
  276. package/.next/standalone/.next/server/app/settings.html +2 -2
  277. package/.next/standalone/.next/server/app/settings.rsc +4 -4
  278. package/.next/standalone/.next/server/app-paths-manifest.json +35 -35
  279. package/.next/standalone/.next/server/chunks/1318.js +1 -1
  280. package/.next/standalone/.next/server/chunks/{5201.js → 1416.js} +2 -2
  281. package/.next/standalone/.next/server/chunks/1559.js +2 -2
  282. package/.next/standalone/.next/server/chunks/{3630.js → 2195.js} +1 -1
  283. package/.next/standalone/.next/server/chunks/2460.js +1 -0
  284. package/.next/standalone/.next/server/chunks/2572.js +2 -2
  285. package/.next/standalone/.next/server/chunks/2758.js +1 -0
  286. package/.next/standalone/.next/server/chunks/2961.js +1 -1
  287. package/.next/standalone/.next/server/chunks/3419.js +1 -1
  288. package/.next/standalone/.next/server/chunks/4066.js +1 -0
  289. package/.next/standalone/.next/server/chunks/4827.js +1 -1
  290. package/.next/standalone/.next/server/chunks/5245.js +1 -1
  291. package/.next/standalone/.next/server/chunks/5453.js +1 -1
  292. package/.next/standalone/.next/server/chunks/5489.js +1 -1
  293. package/.next/standalone/.next/server/chunks/6113.js +1 -1
  294. package/.next/standalone/.next/server/chunks/6506.js +2 -2
  295. package/.next/standalone/.next/server/chunks/6737.js +1 -0
  296. package/.next/standalone/.next/server/chunks/679.js +1 -1
  297. package/.next/standalone/.next/server/chunks/7368.js +1 -1
  298. package/.next/standalone/.next/server/chunks/7530.js +1 -1
  299. package/.next/standalone/.next/server/chunks/7578.js +2 -2
  300. package/.next/standalone/.next/server/chunks/7675.js +1 -0
  301. package/.next/standalone/.next/server/chunks/7789.js +1 -0
  302. package/.next/standalone/.next/server/chunks/{1201.js → 8030.js} +2 -2
  303. package/.next/standalone/.next/server/chunks/920.js +1 -1
  304. package/.next/standalone/.next/server/chunks/9213.js +1 -1
  305. package/.next/standalone/.next/server/chunks/9378.js +1 -1
  306. package/.next/standalone/.next/server/chunks/9931.js +1 -1
  307. package/.next/standalone/.next/server/instrumentation.js +1 -1
  308. package/.next/standalone/.next/server/middleware-build-manifest.js +1 -1
  309. package/.next/standalone/.next/server/middleware-manifest.json +5 -5
  310. package/.next/standalone/.next/server/pages/404.html +2 -2
  311. package/.next/standalone/.next/server/pages/500.html +1 -1
  312. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  313. package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
  314. package/.next/standalone/.next/static/chunks/11595.f080a1d100972212.js +1 -0
  315. package/.next/standalone/.next/static/chunks/14628-283d3983d1fb36c9.js +1 -0
  316. package/.next/standalone/.next/static/chunks/{29305-f587e7e81bc0b200.js → 17562-56f932146e9e6c94.js} +4 -4
  317. package/.next/standalone/.next/static/chunks/25080-25ad29e64c855338.js +1 -0
  318. package/.next/standalone/.next/static/chunks/28698-7fb271ffc6e63a26.js +1 -0
  319. package/.next/standalone/.next/static/chunks/{95225-96b44da3ebd6ddad.js → 32736-aeaaa1e4c4d5529b.js} +1 -1
  320. package/.next/standalone/.next/static/chunks/33456.20313bd67a5c41cc.js +1 -0
  321. package/.next/standalone/.next/static/chunks/4860.3b555a398cdffb19.js +1 -0
  322. package/.next/standalone/.next/static/chunks/75257-99c0ce24b436847b.js +1 -0
  323. package/.next/standalone/.next/static/chunks/79919-0c6dcda1dd8646f0.js +1 -0
  324. package/.next/standalone/.next/static/chunks/91328-f501e3c3ca519a92.js +1 -0
  325. package/.next/standalone/.next/static/chunks/94643-e54eff17e941a93b.js +1 -0
  326. package/.next/standalone/.next/static/chunks/99373.b8a95d1bec5ad4e7.js +1 -0
  327. package/.next/standalone/.next/static/chunks/app/(dashboard)/layout-f3c6431432d42c7c.js +1 -0
  328. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/dashboard/{page-77b175e52a85f3cb.js → page-5d723f974bdad33b.js} +1 -1
  329. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/documents/[documentUuid]/page-8d3b1f4d8b76d66c.js +1 -0
  330. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/documents/page-57c698dea2fa6e29.js +1 -0
  331. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/graph/{page-69d3162667f85677.js → page-d2bb622855e746f1.js} +1 -1
  332. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/[proposalUuid]/page-fc255dc3612032b9.js +1 -0
  333. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/new/{page-a3f83031dfbafc81.js → page-f032ee8a80d1f56a.js} +1 -1
  334. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/page-46a0ddfd0421b0a8.js +1 -0
  335. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/tasks/[taskUuid]/{page-3c7ff3a40a4615ac.js → page-3a83748ce0ae1c4f.js} +1 -1
  336. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/tasks/{page-7b8e11fdc5b596d0.js → page-8af9bb9f96ab0258.js} +1 -1
  337. package/.next/standalone/.next/static/chunks/app/(dashboard)/settings/page-b02939820affdae5.js +1 -0
  338. package/.next/standalone/.next/static/chunks/app/onboarding/page-d2c0c7951114e763.js +1 -0
  339. package/.next/standalone/.next/static/chunks/{webpack-dffb97a4feb8faba.js → webpack-de8a36d232a91d6b.js} +1 -1
  340. package/.next/standalone/.next/static/css/44f13b43a3de716d.css +1 -0
  341. package/.next/standalone/package.json +1 -1
  342. package/.next/standalone/public/chorus-plugin/.claude-plugin/plugin.json +2 -2
  343. package/.next/standalone/public/chorus-plugin/agents/code-reviewer.md +1 -0
  344. package/.next/standalone/public/chorus-plugin/agents/proposal-reviewer.md +12 -3
  345. package/.next/standalone/public/chorus-plugin/agents/task-reviewer.md +4 -0
  346. package/.next/standalone/public/chorus-plugin/bin/chorus-api.sh +1 -1
  347. package/.next/standalone/public/chorus-plugin/bin/on-post-submit-for-verify.sh +3 -3
  348. package/.next/standalone/public/chorus-plugin/bin/on-post-submit-proposal.sh +3 -3
  349. package/.next/standalone/public/chorus-plugin/bin/on-post-verify-task.sh +2 -2
  350. package/.next/standalone/public/chorus-plugin/bin/on-pre-spawn-agent.sh +22 -9
  351. package/.next/standalone/public/chorus-plugin/bin/on-session-start.sh +39 -64
  352. package/.next/standalone/public/chorus-plugin/bin/on-subagent-start.sh +44 -29
  353. package/.next/standalone/public/chorus-plugin/bin/on-subagent-stop.sh +100 -29
  354. package/.next/standalone/public/chorus-plugin/bin/resolve-spec-mode.sh +107 -0
  355. package/.next/standalone/public/chorus-plugin/bin/test-syntax.sh +6 -2
  356. package/.next/standalone/public/chorus-plugin/bin/tests/test-resolver-drift.sh +46 -0
  357. package/.next/standalone/public/chorus-plugin/bin/tests/test-skill-harness-fidelity-negative.sh +328 -0
  358. package/.next/standalone/public/chorus-plugin/bin/tests/test-skill-harness-fidelity.sh +372 -0
  359. package/.next/standalone/public/chorus-plugin/bin/tests/test-spec-mode-resolution.sh +83 -0
  360. package/.next/standalone/public/chorus-plugin/bin/tests/test-subagent-session-name.sh +599 -0
  361. package/.next/standalone/public/chorus-plugin/skills/brainstorm/SKILL.md +1 -1
  362. package/.next/standalone/public/chorus-plugin/skills/chorus/SKILL.md +11 -6
  363. package/.next/standalone/public/chorus-plugin/skills/chorus-cli/SKILL.md +1 -1
  364. package/.next/standalone/public/chorus-plugin/skills/develop/SKILL.md +14 -9
  365. package/.next/standalone/public/chorus-plugin/skills/docs/SKILL.md +1 -1
  366. package/.next/standalone/public/chorus-plugin/skills/idea/SKILL.md +1 -1
  367. package/.next/standalone/public/chorus-plugin/skills/openspec-aware/SKILL.md +27 -31
  368. package/.next/standalone/public/chorus-plugin/skills/orchestrate/SKILL.md +11 -1
  369. package/.next/standalone/public/chorus-plugin/skills/proposal/SKILL.md +14 -7
  370. package/.next/standalone/public/chorus-plugin/skills/quick-dev/SKILL.md +6 -4
  371. package/.next/standalone/public/chorus-plugin/skills/review/SKILL.md +10 -8
  372. package/.next/standalone/public/chorus-plugin/skills/spec-lite/SKILL.md +147 -0
  373. package/.next/standalone/public/chorus-plugin/skills/yolo/SKILL.md +49 -34
  374. package/.next/standalone/public/kiro-plugin/.kiro/agents/chorus-code-reviewer.json +1 -1
  375. package/.next/standalone/public/kiro-plugin/.kiro/agents/chorus-proposal-reviewer.json +2 -1
  376. package/.next/standalone/public/kiro-plugin/.kiro/agents/chorus-task-reviewer.json +1 -1
  377. package/.next/standalone/public/kiro-plugin/.kiro/agents/chorus.md +1 -1
  378. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-brainstorm/SKILL.md +1 -1
  379. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-cli/SKILL.md +1 -1
  380. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-develop/SKILL.md +9 -7
  381. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-docs/SKILL.md +1 -1
  382. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-idea/SKILL.md +1 -1
  383. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-openspec-aware/SKILL.md +35 -27
  384. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-orchestrate/SKILL.md +9 -1
  385. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-proposal/SKILL.md +14 -7
  386. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-quick-dev/SKILL.md +2 -2
  387. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-review/SKILL.md +8 -8
  388. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-spec-lite/SKILL.md +147 -0
  389. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-yolo/SKILL.md +39 -25
  390. package/.next/standalone/public/kiro-plugin/.kiro/steering/chorus.md +11 -6
  391. package/.next/standalone/public/kiro-plugin/bin/chorus-api.sh +1 -1
  392. package/.next/standalone/public/kiro-plugin/bin/on-agent-spawn.sh +41 -0
  393. package/.next/standalone/public/kiro-plugin/bin/on-post-submit-for-verify.sh +3 -3
  394. package/.next/standalone/public/kiro-plugin/bin/on-post-submit-proposal.sh +3 -3
  395. package/.next/standalone/public/kiro-plugin/bin/on-post-verify-task.sh +2 -2
  396. package/.next/standalone/public/kiro-plugin/bin/resolve-spec-mode.sh +107 -0
  397. package/.next/standalone/public/kiro-plugin/manifest.txt +2 -0
  398. package/.next/standalone/public/skill/chorus/SKILL.md +11 -1
  399. package/.next/standalone/public/skill/code-reviewer-chorus/SKILL.md +1 -0
  400. package/.next/standalone/public/skill/develop-chorus/SKILL.md +1 -1
  401. package/.next/standalone/public/skill/orchestrate-chorus/SKILL.md +11 -1
  402. package/.next/standalone/public/skill/proposal-reviewer-chorus/SKILL.md +5 -2
  403. package/.next/standalone/public/skill/quick-dev-chorus/SKILL.md +1 -1
  404. package/.next/standalone/public/skill/review-chorus/SKILL.md +5 -3
  405. package/.next/standalone/public/skill/task-reviewer-chorus/SKILL.md +4 -0
  406. package/.next/standalone/public/skill/yolo-chorus/SKILL.md +23 -7
  407. package/README.ja.md +3 -3
  408. package/README.ko.md +3 -3
  409. package/README.md +3 -3
  410. package/README.zh.md +3 -3
  411. package/chorus.mjs +30 -2
  412. package/cli/agent-cli-config.mjs +323 -0
  413. package/cli/agent-launcher.mjs +44 -16
  414. package/cli/child-exit.mjs +77 -0
  415. package/cli/claude-spawner.mjs +26 -14
  416. package/cli/codex-spawner.mjs +27 -16
  417. package/cli/control-handler.mjs +104 -6
  418. package/cli/credentials.mjs +7 -0
  419. package/cli/daemon-config.mjs +14 -0
  420. package/cli/daemon-rest-client.mjs +98 -29
  421. package/cli/daemon.mjs +37 -7
  422. package/cli/dsh-managed-config.mjs +26 -28
  423. package/cli/dsh-spawner.mjs +27 -16
  424. package/cli/init/steps/credential-seed.mjs +1 -1
  425. package/cli/kiro-spawner.mjs +26 -16
  426. package/cli/launch-diagnostics.mjs +67 -0
  427. package/cli/login.mjs +17 -1
  428. package/cli/pi-spawner.mjs +23 -13
  429. package/cli/prompts.mjs +52 -2
  430. package/cli/spawner-select.mjs +6 -11
  431. package/package.json +1 -1
  432. package/.next/standalone/.next/server/chunks/1114.js +0 -1
  433. package/.next/standalone/.next/server/chunks/1155.js +0 -1
  434. package/.next/standalone/.next/server/chunks/6465.js +0 -1
  435. package/.next/standalone/.next/server/chunks/8105.js +0 -1
  436. package/.next/standalone/.next/server/chunks/8232.js +0 -1
  437. package/.next/standalone/.next/static/chunks/11595.f7c3ef5cd7fc8feb.js +0 -1
  438. package/.next/standalone/.next/static/chunks/33456.c81079032acc2966.js +0 -1
  439. package/.next/standalone/.next/static/chunks/45262-38b332523f00a223.js +0 -1
  440. package/.next/standalone/.next/static/chunks/46021-f5d072b0cbcb7fac.js +0 -1
  441. package/.next/standalone/.next/static/chunks/4860.f0cfb1201191ae88.js +0 -1
  442. package/.next/standalone/.next/static/chunks/66609-64a01d5cb415465b.js +0 -1
  443. package/.next/standalone/.next/static/chunks/79919-c5a2a3fd8f5f9204.js +0 -1
  444. package/.next/standalone/.next/static/chunks/94394-38194b81b489275c.js +0 -1
  445. package/.next/standalone/.next/static/chunks/94643-f1bdf37fb3bb6adb.js +0 -1
  446. package/.next/standalone/.next/static/chunks/96482-2b3bdb2544d72e5a.js +0 -1
  447. package/.next/standalone/.next/static/chunks/99373.3c23ac2efbd4db02.js +0 -1
  448. package/.next/standalone/.next/static/chunks/app/(dashboard)/layout-66328332f62c7371.js +0 -1
  449. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/documents/[documentUuid]/page-87ceae13c4950fc9.js +0 -1
  450. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/documents/page-45e95154e546460e.js +0 -1
  451. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/[proposalUuid]/page-b7b2017e5be69564.js +0 -1
  452. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/page-8b06834ca0f663bb.js +0 -1
  453. package/.next/standalone/.next/static/chunks/app/(dashboard)/settings/page-efe5326c47aca9ca.js +0 -1
  454. package/.next/standalone/.next/static/chunks/app/onboarding/page-0ce33b9327fe3d8c.js +0 -1
  455. package/.next/standalone/.next/static/css/1d9cf83f50b6db00.css +0 -1
  456. /package/.next/standalone/.next/static/{wuqYN129vOIGymh_NEdZe → dot63ILT878Tloqi7Czj_}/_buildManifest.js +0 -0
  457. /package/.next/standalone/.next/static/{wuqYN129vOIGymh_NEdZe → dot63ILT878Tloqi7Czj_}/_ssgManifest.js +0 -0
package/cli/daemon.mjs CHANGED
@@ -40,12 +40,13 @@ import { EventRouter } from "./event-router.mjs";
40
40
  import { WakeQueue } from "./wake-queue.mjs";
41
41
  import { Waker } from "./waker.mjs";
42
42
  import { LineageResolver } from "./lineage.mjs";
43
- import { resolveClaudePath } from "./claude-spawner.mjs";
43
+ import { resolveClaudePath, isNewSession } from "./claude-spawner.mjs";
44
44
  import { resolveCodexPath } from "./codex-spawner.mjs";
45
45
  import { resolveDshPath } from "./dsh-spawner.mjs";
46
46
  import { prepareManagedDshConfig } from "./dsh-managed-config.mjs";
47
47
  import { resolveKiroPath } from "./kiro-spawner.mjs";
48
48
  import { selectSpawner } from "./spawner-select.mjs";
49
+ import { overlayAgentEnv } from "./agent-cli-config.mjs";
49
50
  import {
50
51
  createExecutionUploadHooks,
51
52
  createTranscriptUploadHooks,
@@ -61,6 +62,7 @@ import {
61
62
  resolveDaemonCwds,
62
63
  resolveBrowseRoots,
63
64
  resolveAgentConfigs,
65
+ resolveFlatAgentCliConfig,
64
66
  hasConfiguredAgents,
65
67
  } from "./daemon-config.mjs";
66
68
  import { discoverDirectories, validateDirectory } from "./directory-discovery.mjs";
@@ -124,7 +126,7 @@ function defaultLogger() {
124
126
  * maxConcurrency?: number,
125
127
  * permissionMode?: "chorus"|"yolo",
126
128
  * reportInterrupt?: (entityType: string, entityUuid: string, reason: "user"|"crash") => Promise<void>,
127
- * advanceTurn?: (params: { sessionId: string, status: "running"|"ended", entityType?: string|null, entityUuid?: string|null }) => Promise<void>,
129
+ * advanceTurn?: (params: { sessionId: string, status: "running"|"ended"|"interrupted", interruptedReason?: "user"|"crash"|"shutdown"|"invalid_path"|null, entityType?: string|null, entityUuid?: string|null }) => Promise<void>,
128
130
  * sigintTimeoutMs?: number,
129
131
  * }} [deps]
130
132
  */
@@ -157,6 +159,10 @@ export function buildDaemon(creds, deps = {}) {
157
159
  // passed through so the Codex backend can export the daemon key into the woken
158
160
  // process env (the Claude backend ignores creds — it gets its key via --mcp-config).
159
161
  const spawner = deps.spawner ?? selectSpawner(agentType, {
162
+ ...deps.spawnerOptions,
163
+ cliConfig: deps.cliConfig,
164
+ env: deps.env,
165
+ label: deps.label,
160
166
  logger,
161
167
  permissionMode,
162
168
  creds,
@@ -306,6 +312,7 @@ export function buildDaemon(creds, deps = {}) {
306
312
  creds,
307
313
  lineage,
308
314
  spawner,
315
+ isNewSessionFn: (sessionId, runCwd) => isNewSession(sessionId, runCwd, { env: spawner.env, platform: spawner.platform }),
309
316
  cwd: boundCwd,
310
317
  hooks,
311
318
  logger,
@@ -423,6 +430,10 @@ export function buildDaemon(creds, deps = {}) {
423
430
  sigintTimeoutMs,
424
431
  redispatchResume,
425
432
  deliverTurn,
433
+ // The SAME turn reporter the wakers use (declared above and passed into
434
+ // makeWaker) — one transport, so a no-child interrupt can close the
435
+ // server-side `running` turn (fix-phantom-running-turn, Tech Design D).
436
+ advanceTurn,
426
437
  handleDirectoryRequest: async (event) => {
427
438
  if (event.operation === "roots") {
428
439
  return { roots: [...browseRoots] };
@@ -664,6 +675,8 @@ export function buildMultiAgentDaemon(agentConfigs, deps = {}) {
664
675
  logger,
665
676
  permissionMode: cfg.permissionMode,
666
677
  agentType: cfg.agentType,
678
+ cliConfig: { args: cfg.args, env: cfg.env },
679
+ label: cfg.label,
667
680
  cwds: cfg.cwds,
668
681
  cwd: undefined,
669
682
  maxConcurrency: cfg.maxConcurrency,
@@ -862,6 +875,19 @@ export async function runDaemon(flags = {}, deps = {}) {
862
875
  return handleLifecycleAction(action, { log, errLog, lifecycle, service, pfDeps });
863
876
  }
864
877
 
878
+ // Validate flat customization before credential/network preflight, including
879
+ // the detach path. Lifecycle-only actions above do not launch an agent.
880
+ const multiAgent = hasConfiguredAgents({ readJson: deps.readJson, loginPath: deps.loginPath });
881
+ let cliConfig;
882
+ if (!multiAgent) {
883
+ try {
884
+ cliConfig = resolveFlatAgentCliConfig(agentType, { readJson: deps.readJson, loginPath: deps.loginPath });
885
+ } catch (error) {
886
+ errLog(`[Chorus] ${error.message}`);
887
+ return 1;
888
+ }
889
+ }
890
+
865
891
  // `-d` / --detach: complete any interactive preflight in THIS foreground process
866
892
  // (which holds the TTY), then spawn the daemon detached and return. The detached
867
893
  // child re-enters runDaemon with the DETACHED_ENV marker set, so it skips the
@@ -889,7 +915,7 @@ export async function runDaemon(flags = {}, deps = {}) {
889
915
  // credential preflight (interactive credential completion is a single-agent
890
916
  // affordance). Each agent authenticates on its own key; a failure is isolated
891
917
  // (logged + that agent skipped) so the rest still serve.
892
- if (hasConfiguredAgents({ readJson: deps.readJson, loginPath: deps.loginPath })) {
918
+ if (multiAgent) {
893
919
  const buildMulti = deps.buildMulti ?? buildMultiAgentDaemon;
894
920
  let agentConfigs;
895
921
  try {
@@ -950,6 +976,7 @@ export async function runDaemon(flags = {}, deps = {}) {
950
976
  const multiDaemon = buildMulti(okConfigs, {
951
977
  logger: { info: log, warn: errLog, error: errLog },
952
978
  verbose,
979
+ env,
953
980
  fetchImpl: deps.fetchImpl,
954
981
  killer: deps.killer,
955
982
  sseListener: deps.sseListener,
@@ -1002,14 +1029,15 @@ export async function runDaemon(flags = {}, deps = {}) {
1002
1029
  // arrives. The resolved path (or absence) is shown in the banner below. Each
1003
1030
  // backend probes its own binary, including the `dsh` CLI for dsh, so the
1004
1031
  // startup banner and warning report the selected runtime rather than Claude.
1032
+ const discoveryEnv = overlayAgentEnv(env, cliConfig.env);
1005
1033
  const cliPath =
1006
1034
  agentType === "codex"
1007
- ? findCodex()
1035
+ ? findCodex({ env: discoveryEnv })
1008
1036
  : agentType === "kiro"
1009
- ? findKiro()
1037
+ ? findKiro({ env: discoveryEnv })
1010
1038
  : agentType === "dsh"
1011
- ? findDsh()
1012
- : findClaude();
1039
+ ? findDsh({ env: discoveryEnv })
1040
+ : findClaude({ env: discoveryEnv });
1013
1041
 
1014
1042
  // The daemon.json the layered config readers (credentials, sigint timeout, cwds)
1015
1043
  // consult. Surfacing its absolute path + presence in the banner makes it obvious
@@ -1068,6 +1096,8 @@ export async function runDaemon(flags = {}, deps = {}) {
1068
1096
  logger: { info: log, warn: errLog, error: errLog },
1069
1097
  permissionMode,
1070
1098
  agentType,
1099
+ cliConfig,
1100
+ env,
1071
1101
  verbose,
1072
1102
  sigintTimeoutMs,
1073
1103
  cwds,
@@ -20,6 +20,8 @@
20
20
  // chorus-dsh-lifecycle plugin's documented fallback also reads $DSH_HOME/.env).
21
21
 
22
22
  import { spawnSync } from "node:child_process";
23
+ import { safeSpawnError, redactedSetupError } from "./launch-diagnostics.mjs";
24
+ import { getAgentEnv, overlayAgentEnv } from "./agent-cli-config.mjs";
23
25
  import { createHash, randomUUID } from "node:crypto";
24
26
  import {
25
27
  existsSync,
@@ -46,22 +48,10 @@ export const DEFAULT_DSH_PROVIDER = "deepseek-official";
46
48
  // check in activeState() and is transparently re-prepared.
47
49
  const STATE_VERSION = 2;
48
50
 
49
- function errorText(error) {
50
- return error instanceof Error ? error.message : String(error);
51
- }
52
-
53
51
  function nonEmpty(value) {
54
52
  return typeof value === "string" && value.trim() ? value.trim() : null;
55
53
  }
56
54
 
57
- function redactedErrorText(error, values = []) {
58
- let text = errorText(error);
59
- for (const value of values) {
60
- if (typeof value === "string" && value) text = text.replaceAll(value, "[REDACTED]");
61
- }
62
- return text;
63
- }
64
-
65
55
  function readJson(path) {
66
56
  try {
67
57
  return JSON.parse(readFileSync(path, "utf8"));
@@ -70,8 +60,8 @@ function readJson(path) {
70
60
  }
71
61
  }
72
62
 
73
- export function managedDshRoot(env = process.env) {
74
- const home = env.HOME || env.USERPROFILE || homedir();
63
+ export function managedDshRoot(env = process.env, platform = process.platform) {
64
+ const home = getAgentEnv(env, "HOME", platform) || getAgentEnv(env, "USERPROFILE", platform) || homedir();
75
65
  return join(home, ".chorus", "dsh");
76
66
  }
77
67
 
@@ -103,7 +93,7 @@ export function buildProviderPatch(provider) {
103
93
  function runCommand(command, argv, opts) {
104
94
  const platform = opts.platform ?? process.platform;
105
95
  const isCmd = platform === "win32" && /\.(cmd|bat)$/i.test(command);
106
- const executable = isCmd ? opts.env?.ComSpec || opts.env?.COMSPEC || "cmd.exe" : command;
96
+ const executable = isCmd ? getAgentEnv(opts.env ?? process.env, "COMSPEC", platform) || "cmd.exe" : command;
107
97
  const commandArgs = isCmd ? ["/d", "/s", "/c", command, ...argv] : argv;
108
98
  const result = spawnSync(executable, commandArgs, {
109
99
  cwd: opts.cwd,
@@ -115,7 +105,7 @@ function runCommand(command, argv, opts) {
115
105
  windowsHide: true,
116
106
  });
117
107
  if (result.error || result.status !== 0) {
118
- const detail = result.error?.message || result.stderr?.trim() || `exit ${result.status}`;
108
+ const detail = result.error ? safeSpawnError(result.error) : result.stderr?.trim() || `exit ${result.status}`;
119
109
  throw new Error(detail);
120
110
  }
121
111
  return result;
@@ -179,14 +169,13 @@ export function validateManagedDshProfile(home, opts = {}) {
179
169
  export function validateManagedDshComposition(home, opts = {}) {
180
170
  const dshPath = opts.dshPath;
181
171
  if (!dshPath) throw new Error("cannot validate dsh composition: the dsh CLI was not found");
182
- const env = {
183
- ...(opts.env ?? process.env),
172
+ const env = overlayAgentEnv(opts.env ?? process.env, {
184
173
  CHORUS_DAEMON_HEADLESS: "1",
185
174
  CHORUS_URL: opts.creds?.url ?? "http://127.0.0.1",
186
175
  CHORUS_API_KEY: opts.creds?.apiKey ?? "cho_validation",
187
176
  DSH_HOME: home,
188
177
  DSH_CWD: home,
189
- };
178
+ }, opts.platform);
190
179
  const argv = ["--profile", DSH_PROFILE, ...(opts.patchPath ? ["--patch", opts.patchPath] : [])];
191
180
  const request = `${JSON.stringify({
192
181
  jsonrpc: "2.0",
@@ -231,8 +220,19 @@ function activeState(root, pathExists = existsSync) {
231
220
  * patchPath:(string|null), validatedAt:string, reused:boolean }>}
232
221
  */
233
222
  export async function prepareManagedDshConfig(opts = {}) {
223
+ try {
224
+ return await prepareManagedDshConfigInternal(opts);
225
+ } catch (error) {
226
+ // Cover every failure path, including reuse validation and filesystem errors.
227
+ // Only fixed classifications/hints cross this boundary, never raw stderr.
228
+ throw new Error(redactedSetupError(error));
229
+ }
230
+ }
231
+
232
+ async function prepareManagedDshConfigInternal(opts) {
234
233
  const env = opts.env ?? process.env;
235
- const root = opts.root ?? managedDshRoot(env);
234
+ const platform = opts.platform ?? process.platform;
235
+ const root = opts.root ?? managedDshRoot(env, platform);
236
236
  const bundleVersion = opts.bundleVersion;
237
237
  if (!bundleVersion) throw new Error("dsh managed preparation requires a Chorus bundle version");
238
238
  const dshPath = opts.dshPath;
@@ -246,8 +246,8 @@ export async function prepareManagedDshConfig(opts = {}) {
246
246
  // and tested end-to-end against a real dsh runtime without publishing first.
247
247
  // Unset in production. `opts.bundleSpec` (tests) still wins over the env.
248
248
  const bundleSpec =
249
- opts.bundleSpec ?? nonEmpty(env.CHORUS_DSH_BUNDLE_SPEC) ?? `${DSH_BUNDLE}@${bundleVersion}`;
250
- const provider = nonEmpty(env.CHORUS_DSH_PROVIDER) ?? nonEmpty(env.DSH_PROVIDER) ?? DEFAULT_DSH_PROVIDER;
249
+ opts.bundleSpec ?? nonEmpty(getAgentEnv(env, "CHORUS_DSH_BUNDLE_SPEC", platform)) ?? `${DSH_BUNDLE}@${bundleVersion}`;
250
+ const provider = nonEmpty(getAgentEnv(env, "CHORUS_DSH_PROVIDER", platform)) ?? nonEmpty(getAgentEnv(env, "DSH_PROVIDER", platform)) ?? DEFAULT_DSH_PROVIDER;
251
251
  const providerPatch = buildProviderPatch(provider);
252
252
  // Bind the fingerprint to the ACTUAL external dsh runtime version: peers are a
253
253
  // lenient range now, so a managed profile composed against an older `dsh` must
@@ -278,14 +278,13 @@ export async function prepareManagedDshConfig(opts = {}) {
278
278
  const install = opts.install ?? ((home) => runner(
279
279
  dshPath,
280
280
  ["plugin", "--profile", DSH_PROFILE, "add", bundleSpec, "-w"],
281
- { cwd: home, env: { ...env, DSH_HOME: home }, timeout: opts.installTimeoutMs ?? 300_000, platform: opts.platform },
281
+ { cwd: home, env: overlayAgentEnv(env, { DSH_HOME: home }, platform), timeout: opts.installTimeoutMs ?? 300_000, platform: opts.platform },
282
282
  ));
283
283
  try {
284
284
  install(releaseDir);
285
285
  } catch (error) {
286
286
  throw new Error(
287
- `dsh managed profile installation failed: ` +
288
- redactedErrorText(error, [env.CHORUS_API_KEY, opts.creds?.apiKey]),
287
+ `dsh managed profile installation failed: ` + redactedSetupError(error),
289
288
  );
290
289
  }
291
290
 
@@ -307,11 +306,10 @@ export async function prepareManagedDshConfig(opts = {}) {
307
306
  } catch (error) {
308
307
  const hint =
309
308
  provider !== DEFAULT_DSH_PROVIDER
310
- ? ` (provider "${provider}" is non-default — the managed sdk profile mounts only the ${DEFAULT_DSH_PROVIDER} adapter; a custom provider needs its adapter pre-composed, e.g. point CHORUS_DSH_HOME at your own sdk profile)`
309
+ ? ` (a non-default provider is configured — the managed sdk profile mounts only the ${DEFAULT_DSH_PROVIDER} adapter; a custom provider needs its adapter pre-composed, e.g. point CHORUS_DSH_HOME at your own sdk profile)`
311
310
  : "";
312
311
  throw new Error(
313
- `dsh managed composition validation failed${hint}: ` +
314
- redactedErrorText(error, [env.CHORUS_API_KEY, opts.creds?.apiKey]),
312
+ `dsh managed composition validation failed${hint}: ` + redactedSetupError(error),
315
313
  );
316
314
  }
317
315
 
@@ -2,10 +2,13 @@
2
2
  // session are created per wake; no dsh session state is persisted by Chorus.
3
3
 
4
4
  import { spawn } from "node:child_process";
5
+ import { safeSpawnError, redactedSetupError } from "./launch-diagnostics.mjs";
6
+ import { validateAgentCliConfig, overlayAgentEnv, getAgentEnv, assertConfiguredShimArgs } from "./agent-cli-config.mjs";
5
7
  import { randomUUID } from "node:crypto";
6
8
  import { statSync } from "node:fs";
7
9
  import { win32 as pathWin32, posix as pathPosix } from "node:path";
8
10
  import { prepareManagedDshConfig } from "./dsh-managed-config.mjs";
11
+ import { awaitChildSettled } from "./child-exit.mjs";
9
12
 
10
13
  const NOOP_LOGGER = { info() {}, warn() {}, error() {} };
11
14
  export const DEFAULT_DSH_TIMEOUT_MS = 30 * 60 * 1000;
@@ -36,13 +39,13 @@ export function resolveDshPath(deps = {}) {
36
39
  const env = deps.env ?? process.env;
37
40
  const platform = deps.platform ?? process.platform;
38
41
  const fileProbe = deps.isFile ?? isFile;
39
- const override = nonEmpty(env.CHORUS_DSH_PATH);
42
+ const override = nonEmpty(getAgentEnv(env, "CHORUS_DSH_PATH", platform));
40
43
  if (override && fileProbe(override)) return override;
41
44
 
42
45
  const windows = platform === "win32";
43
46
  const path = windows ? pathWin32 : pathPosix;
44
47
  const names = windows ? ["dsh.cmd", "dsh.exe", "dsh"] : ["dsh"];
45
- const dirs = (env.PATH || env.Path || "").split(path.delimiter).filter(Boolean);
48
+ const dirs = (getAgentEnv(env, "PATH", platform) || env.Path || "").split(path.delimiter).filter(Boolean);
46
49
  for (const dir of dirs) {
47
50
  for (const name of names) {
48
51
  const candidate = path.join(dir, name);
@@ -58,8 +61,8 @@ export function resolveDshPath(deps = {}) {
58
61
  * profile preparation entirely (the escape hatch replacing the old
59
62
  * DSH_CORDIS_CONFIG override — which is gone with the removed cordis.yml model).
60
63
  */
61
- export function resolveDshHome(env = process.env) {
62
- return nonEmpty(env.CHORUS_DSH_HOME);
64
+ export function resolveDshHome(env = process.env, platform = process.platform) {
65
+ return nonEmpty(getAgentEnv(env, "CHORUS_DSH_HOME", platform)) ?? nonEmpty(getAgentEnv(env, "DSH_HOME", platform));
63
66
  }
64
67
 
65
68
  /** Windows npm command shims need cmd.exe while retaining argv isolation. */
@@ -67,7 +70,7 @@ export function resolveDshSpawnCommand(dshPath, platform = process.platform, env
67
70
  const lower = dshPath.toLowerCase();
68
71
  if (platform === "win32" && (lower.endsWith(".cmd") || lower.endsWith(".bat"))) {
69
72
  return {
70
- command: env.ComSpec || env.COMSPEC || "cmd.exe",
73
+ command: getAgentEnv(env, "COMSPEC", platform) || "cmd.exe",
71
74
  argv: ["/d", "/s", "/c", dshPath],
72
75
  };
73
76
  }
@@ -139,7 +142,8 @@ export class DshSpawner {
139
142
  this.logger = opts.logger ?? NOOP_LOGGER;
140
143
  this.creds = opts.creds ?? null;
141
144
  this.platform = opts.platform ?? process.platform;
142
- this.env = opts.env ?? process.env;
145
+ this.cliConfig = validateAgentCliConfig(opts.cliConfig, "dsh", opts.label);
146
+ this.env = overlayAgentEnv(opts.env ?? process.env, this.cliConfig.env, this.platform);
143
147
  this.bundleVersion = opts.bundleVersion ?? null;
144
148
  this.prepareManagedConfigFn = opts.prepareManagedConfigFn ?? prepareManagedDshConfig;
145
149
  this.timeoutMs = opts.timeoutMs ?? positiveInt(this.env.CHORUS_DSH_TIMEOUT_MS, DEFAULT_DSH_TIMEOUT_MS);
@@ -150,7 +154,7 @@ export class DshSpawner {
150
154
 
151
155
  async wake({ prompt, sessionId: anchor, cwd, onMessage, onChild }) {
152
156
  const dshPath = this.dshPath ?? this.resolveDshPathFn({ env: this.env, platform: this.platform });
153
- let dshHome = resolveDshHome(this.env);
157
+ let dshHome = resolveDshHome(this.env, this.platform);
154
158
  let patchPath = null;
155
159
  const result = (backendSessionId, exitCode) => ({
156
160
  sessionId: backendSessionId || anchor || "",
@@ -165,10 +169,12 @@ export class DshSpawner {
165
169
  );
166
170
  return result(null, null);
167
171
  }
172
+ assertConfiguredShimArgs(dshPath, this.cliConfig.args, this.platform);
168
173
  if (!dshHome) {
169
174
  try {
170
175
  const managed = await this.prepareManagedConfigFn({
171
176
  env: this.env,
177
+ platform: this.platform,
172
178
  bundleVersion: this.bundleVersion,
173
179
  dshPath,
174
180
  creds: this.creds,
@@ -176,22 +182,24 @@ export class DshSpawner {
176
182
  dshHome = managed.home;
177
183
  patchPath = managed.patchPath ?? null;
178
184
  } catch (error) {
179
- this.logger.error(`[Chorus] cannot prepare managed dsh profile: ${errorText(error)}`);
185
+ const detail = redactedSetupError(error);
186
+ this.logger.error(`[Chorus] cannot prepare managed dsh profile: ${detail}`);
180
187
  return result(null, null);
181
188
  }
189
+ } else {
190
+ this.logger.info("[Chorus] using existing DSH_HOME profile, skipping managed preparation");
182
191
  }
183
192
 
184
193
  const dshSessionId = `chorus-${this.uuidFn().replaceAll("-", "")}`;
185
194
  const provider =
186
- nonEmpty(this.env.CHORUS_DSH_PROVIDER) ?? nonEmpty(this.env.DSH_PROVIDER) ?? "deepseek-official";
195
+ nonEmpty(getAgentEnv(this.env, "CHORUS_DSH_PROVIDER", this.platform)) ?? nonEmpty(getAgentEnv(this.env, "DSH_PROVIDER", this.platform)) ?? "deepseek-official";
187
196
  const model =
188
- nonEmpty(this.env.CHORUS_DSH_MODEL) ?? nonEmpty(this.env.DSH_MODEL) ?? "deepseek-v4-flash";
189
- const childEnv = {
190
- ...this.env,
197
+ nonEmpty(getAgentEnv(this.env, "CHORUS_DSH_MODEL", this.platform)) ?? nonEmpty(getAgentEnv(this.env, "DSH_MODEL", this.platform)) ?? "deepseek-v4-flash";
198
+ const childEnv = overlayAgentEnv(this.env, {
191
199
  CHORUS_DAEMON_HEADLESS: "1",
192
200
  DSH_HOME: dshHome,
193
201
  DSH_CWD: cwd || process.cwd(),
194
- };
202
+ }, this.platform);
195
203
  if (this.creds?.url) childEnv.CHORUS_URL = this.creds.url;
196
204
  if (this.creds?.apiKey) childEnv.CHORUS_API_KEY = this.creds.apiKey;
197
205
  // Identity profile — the dsh doc-mirror wrapper passes this to `chorus mcp
@@ -213,6 +221,7 @@ export class DshSpawner {
213
221
  "--profile",
214
222
  "sdk",
215
223
  ...(patchPath ? ["--patch", patchPath] : []),
224
+ ...this.cliConfig.args,
216
225
  ];
217
226
  let child;
218
227
  try {
@@ -225,7 +234,7 @@ export class DshSpawner {
225
234
  windowsHide: true,
226
235
  });
227
236
  } catch (error) {
228
- this.logger.error(`[Chorus] failed to start dsh runtime: ${errorText(error)}`);
237
+ this.logger.error(`[Chorus] failed to start dsh runtime: ${safeSpawnError(error)}`);
229
238
  return result(dshSessionId, null);
230
239
  }
231
240
 
@@ -367,8 +376,10 @@ export class DshSpawner {
367
376
  if (line) this.logger.warn(`[dsh] ${line}`);
368
377
  }
369
378
  });
370
- child.on?.("error", (error) => fail(`dsh runtime process error: ${errorText(error)}`));
371
- child.on?.("close", (code) => {
379
+ child.on?.("error", (error) => fail(`dsh runtime process error: ${safeSpawnError(error)}`));
380
+ // Settle on process exit, not only on stdio close: a detached descendant can
381
+ // inherit the pipes and keep `close` from ever firing (see cli/child-exit.mjs).
382
+ awaitChildSettled(child, { logger: this.logger, label: "dsh" }).then((code) => {
372
383
  closeSeen = true;
373
384
  exitCode = code;
374
385
  if (stderrBuffer.trim()) this.logger.warn(`[dsh] ${stderrBuffer.trim()}`);
@@ -68,7 +68,7 @@ function nonEmpty(value) {
68
68
  * Whether an init selection id is the DeepSeek Harness (dsh). dsh needs a SECOND
69
69
  * credential sink beyond ~/.chorus/daemon.json — see {@link writeDshCredentialsEnv}.
70
70
  * We gate on the selection id, NOT the daemon agentType: dsh maps to the shared
71
- * "offline" agentType (agent-type-map.mjs) alongside opencode/openclaw/pi, so the
71
+ * "offline" agentType (agent-type-map.mjs) alongside opencode/openclaw, so the
72
72
  * agentType cannot single dsh out. The id can.
73
73
  * @param {string} id
74
74
  */
@@ -28,17 +28,20 @@
28
28
  // no-op here (this task owns spawn/resume/trust/interrupt + sessionId capture).
29
29
 
30
30
  import { spawn } from "node:child_process";
31
+ import { safeSpawnError } from "./launch-diagnostics.mjs";
32
+ import { validateAgentCliConfig, overlayAgentEnv, getAgentEnv, assertConfiguredShimArgs } from "./agent-cli-config.mjs";
31
33
  import { readdirSync, readFileSync, statSync } from "node:fs";
32
34
  import { homedir } from "node:os";
33
35
  import { win32 as pathWin32, posix as pathPosix, join } from "node:path";
34
36
  import { getSessionId as defaultGetSessionId, setSessionId as defaultSetSessionId } from "./kiro-session-map.mjs";
35
37
  import { reconstructTranscript as defaultReconstructTranscript } from "./kiro-transcript.mjs";
38
+ import { awaitChildSettled } from "./child-exit.mjs";
36
39
 
37
40
  const NOOP_LOGGER = { info() {}, warn() {}, error() {} };
38
41
 
39
42
  /** Directory Kiro persists its CLI session store under (per-cwd conversations). */
40
- export function kiroSessionsDir() {
41
- return join(homedir(), ".kiro", "sessions", "cli");
43
+ export function kiroSessionsDir(env = process.env, platform = process.platform) {
44
+ return join(getAgentEnv(env, "HOME", platform) || getAgentEnv(env, "USERPROFILE", platform) || homedir(), ".kiro", "sessions", "cli");
42
45
  }
43
46
 
44
47
  /**
@@ -96,14 +99,15 @@ export function resolveKiroPath(deps = {}) {
96
99
  }
97
100
  });
98
101
 
99
- if (env.CHORUS_KIRO_PATH && isFile(env.CHORUS_KIRO_PATH)) {
100
- return env.CHORUS_KIRO_PATH;
102
+ const override = getAgentEnv(env, "CHORUS_KIRO_PATH", platform);
103
+ if (override && isFile(override)) {
104
+ return override;
101
105
  }
102
106
 
103
107
  const isWin = platform === "win32";
104
108
  const p = isWin ? pathWin32 : pathPosix;
105
109
  const names = isWin ? ["kiro-cli.cmd", "kiro-cli.exe", "kiro-cli"] : ["kiro-cli"];
106
- const pathVar = env.PATH || env.Path || "";
110
+ const pathVar = getAgentEnv(env, "PATH", platform) || env.Path || "";
107
111
  const dirs = pathVar.split(p.delimiter).filter(Boolean);
108
112
  for (const dir of dirs) {
109
113
  for (const name of names) {
@@ -126,7 +130,7 @@ export function resolveSpawnCommand(kiroPath, args, platform = process.platform,
126
130
  const isWin = platform === "win32";
127
131
  const lower = kiroPath.toLowerCase();
128
132
  if (isWin && (lower.endsWith(".cmd") || lower.endsWith(".bat"))) {
129
- const comspec = env.ComSpec || env.COMSPEC || "cmd.exe";
133
+ const comspec = getAgentEnv(env, "COMSPEC", platform) || "cmd.exe";
130
134
  return { command: comspec, argv: ["/d", "/s", "/c", kiroPath, ...args] };
131
135
  }
132
136
  return { command: kiroPath, argv: args };
@@ -229,6 +233,8 @@ export class KiroSpawner {
229
233
  this.permissionMode = opts.permissionMode ?? "chorus";
230
234
  this.creds = opts.creds ?? null;
231
235
  this.platform = opts.platform ?? process.platform;
236
+ this.cliConfig = validateAgentCliConfig(opts.cliConfig, "kiro", opts.label);
237
+ this.env = overlayAgentEnv(opts.env ?? process.env, this.cliConfig.env, this.platform);
232
238
  this.getSessionIdFn = opts.getSessionIdFn ?? defaultGetSessionId;
233
239
  this.setSessionIdFn = opts.setSessionIdFn ?? defaultSetSessionId;
234
240
  this.resolveKiroPathFn = opts.resolveKiroPathFn ?? resolveKiroPath;
@@ -260,15 +266,16 @@ export class KiroSpawner {
260
266
  const knownSessionId = anchor ? this.getSessionIdFn(anchor) : null;
261
267
  const isNew = !knownSessionId;
262
268
 
263
- const kiroPath = this.kiroPath ?? this.resolveKiroPathFn();
269
+ const kiroPath = this.kiroPath ?? this.resolveKiroPathFn({ env: this.env, platform: this.platform });
264
270
  if (!kiroPath) {
265
271
  // No crash — surface visibly and resolve with a failure result.
266
272
  this.logger.error("[Chorus] cannot locate the `kiro-cli` executable on PATH; skipping wake");
267
273
  return { sessionId: anchor, exitCode: null, isNew };
268
274
  }
269
275
 
270
- const args = buildKiroArgs({ isNew, sessionId: knownSessionId, permissionMode: this.permissionMode });
271
- const { command, argv } = resolveSpawnCommand(kiroPath, args, this.platform);
276
+ assertConfiguredShimArgs(kiroPath, this.cliConfig.args, this.platform);
277
+ const args = [...buildKiroArgs({ isNew, sessionId: knownSessionId, permissionMode: this.permissionMode }), ...this.cliConfig.args];
278
+ const { command, argv } = resolveSpawnCommand(kiroPath, args, this.platform, this.env);
272
279
 
273
280
  // POSIX: detached process group so the interrupt path can group-kill the tree
274
281
  // (kiro-cli forks child shells for tools). Windows uses taskkill /T. stdio
@@ -277,7 +284,7 @@ export class KiroSpawner {
277
284
 
278
285
  // Export the daemon's authoritative connection pair. CHORUS_API_KEY is also
279
286
  // referenced by the plugin's MCP config; neither value is placed in argv.
280
- const childEnv = { ...process.env, CHORUS_DAEMON_HEADLESS: "1" };
287
+ const childEnv = { ...this.env, CHORUS_DAEMON_HEADLESS: "1" };
281
288
  if (this.creds) {
282
289
  if (this.creds.url) childEnv.CHORUS_URL = this.creds.url;
283
290
  if (this.creds.apiKey) childEnv.CHORUS_API_KEY = this.creds.apiKey;
@@ -303,8 +310,8 @@ export class KiroSpawner {
303
310
  detached,
304
311
  windowsHide: true,
305
312
  });
306
- } catch (err) {
307
- this.logger.error(`[Chorus] failed to spawn kiro-cli: ${err}`);
313
+ } catch (error) {
314
+ this.logger.error(`[Chorus] failed to spawn kiro-cli: ${safeSpawnError(error)}`);
308
315
  resolve({ sessionId: anchor, exitCode: null, isNew });
309
316
  return;
310
317
  }
@@ -332,12 +339,14 @@ export class KiroSpawner {
332
339
  if (text) this.logger.warn(`[Chorus] kiro-cli stderr: ${text}`);
333
340
  });
334
341
 
335
- child.on("error", (err) => {
336
- this.logger.error(`[Chorus] kiro-cli process error: ${err}`);
342
+ child.on("error", (error) => {
343
+ this.logger.error(`[Chorus] kiro-cli process error: ${safeSpawnError(error)}`);
337
344
  resolve({ sessionId: knownSessionId || anchor, exitCode: null, isNew });
338
345
  });
339
346
 
340
- child.on("close", (code) => {
347
+ // Settle on process exit, not only on stdio close: a detached descendant can
348
+ // inherit the pipes and keep `close` from ever firing (see cli/child-exit.mjs).
349
+ awaitChildSettled(child, { logger: this.logger, label: "kiro-cli" }).then((code) => {
341
350
  if (code !== 0) {
342
351
  this.logger.warn(`[Chorus] kiro-cli exited with code ${code}`);
343
352
  }
@@ -376,6 +385,7 @@ export class KiroSpawner {
376
385
  this.reconstructTranscript({
377
386
  sessionId: observedSessionId ?? "",
378
387
  cwd: runCwd,
388
+ dir: kiroSessionsDir(this.env, this.platform),
379
389
  onMessage,
380
390
  stdout: stdoutBuf,
381
391
  logger: this.logger,
@@ -407,7 +417,7 @@ export class KiroSpawner {
407
417
  /** Snapshot the store, swallowing any failure (best-effort id capture). */
408
418
  #safeSnapshot(cwd) {
409
419
  try {
410
- return this.snapshotSessionsFn(cwd, { logger: this.logger });
420
+ return this.snapshotSessionsFn(cwd, { logger: this.logger, dir: kiroSessionsDir(this.env, this.platform) });
411
421
  } catch (err) {
412
422
  this.logger.warn(`[Chorus] kiro session snapshot failed (${err}) — id capture degraded`);
413
423
  return new Map();
@@ -0,0 +1,67 @@
1
+ // Child-process error messages, paths, argv, code and syscall are untrusted.
2
+ // Only emit known classifications for spawn failures; never echo raw fields.
3
+ const SPAWN_CODES = new Map([
4
+ ["ENOENT", "executable or working directory not found; check PATH and cwd"],
5
+ ["EACCES", "permission denied; check executable and directory permissions"],
6
+ ["EPERM", "operation not permitted; check process permissions"],
7
+ ["ENOEXEC", "invalid executable format; check the installed binary"],
8
+ ["ENOTDIR", "path component is not a directory; check executable path and cwd"],
9
+ ["EINVAL", "invalid process options; check executable and launch configuration"],
10
+ ["E2BIG", "argument/environment size limit exceeded; reduce configuration size"],
11
+ ["ENOMEM", "insufficient memory to start process"],
12
+ ["EAGAIN", "process resource limit reached; retry or check system limits"],
13
+ ["EMFILE", "process file descriptor limit reached"],
14
+ ["ENFILE", "system file descriptor limit reached"],
15
+ ["ETIMEDOUT", "process startup timed out"],
16
+ ]);
17
+
18
+ export function safeSpawnError(error) {
19
+ const code = error?.code;
20
+ return typeof code === "string" && SPAWN_CODES.has(code)
21
+ ? `${code}: ${SPAWN_CODES.get(code)}`
22
+ : "unclassified startup failure; check executable installation, PATH, cwd and permissions";
23
+ }
24
+
25
+ // Setup stderr can embed arbitrary argv/env in JSON, escaped nested errors,
26
+ // URLs, or encodings we cannot enumerate. Substring replacement is NOT a safe
27
+ // output boundary. Classify known problems, but render only these fixed strings
28
+ // (never captures, original text, paths, codes, or even a "redacted" remainder).
29
+ // Keep the patterns recognizable in our own output: setup and spawner both call
30
+ // this helper, and the second boundary must retain the first one's useful hints.
31
+ const SETUP_HINTS = [
32
+ [/version mismatch/i, "version mismatch; check dsh runtime and Chorus bundle compatibility"],
33
+ [/no adapter registered/i, "no adapter registered; check that the selected provider adapter is installed"],
34
+ [/invalid plugin graph/i, "invalid plugin graph; rebuild the sdk profile and check plugin compatibility"],
35
+ [/bad key|unauthorized|authentication failed/i, "authentication failed; check provider and Chorus credentials"],
36
+ [/ERR_PNPM.*offline|package registry unavailable/i, "package registry unavailable; check network access and pnpm registry configuration"],
37
+ [/bundle version/i, "bundle version required; check the installed Chorus version"],
38
+ [/requires the dsh CLI|dsh CLI was not found|dsh CLI required/i, "dsh CLI required; install dsh or set CHORUS_DSH_PATH"],
39
+ [/missing.*bundle layer/i, "missing Chorus bundle layer; rebuild the managed sdk profile"],
40
+ [/did not install|Chorus bundle not installed/i, "Chorus bundle not installed; check package installation and rebuild the managed sdk profile"],
41
+ [/did not complete JSON-RPC initialization/i, "did not complete JSON-RPC initialization; check the dsh sdk profile and runtime compatibility"],
42
+ [/unexpected server identity/i, "unexpected server identity; check that the sdk profile loads the expected dsh runtime"],
43
+ ];
44
+ const SETUP_CODES = new Map([
45
+ ...SPAWN_CODES,
46
+ ["ENOSPC", "disk full; free space for the managed profile"],
47
+ ["EROFS", "read-only filesystem; use a writable managed profile home"],
48
+ ]);
49
+ const SETUP_FALLBACK = "unclassified setup failure; check dsh installation, sdk profile, provider adapter, package registry and filesystem permissions (raw details withheld)";
50
+
51
+ export function redactedSetupError(error) {
52
+ const text = error instanceof Error ? error.message : typeof error === "string" ? error : "";
53
+ const stages = [];
54
+ if (/profile installation failed/i.test(text)) stages.push("dsh managed profile installation failed");
55
+ if (/composition validation failed/i.test(text)) stages.push("dsh managed composition validation failed");
56
+ if (/non-default provider/i.test(text)) {
57
+ stages.push("a non-default provider is configured; the managed sdk profile mounts only the deepseek-official adapter; pre-compose its adapter and point CHORUS_DSH_HOME at your own sdk profile");
58
+ }
59
+ const hints = [];
60
+ for (const [code, hint] of SETUP_CODES) {
61
+ if (error?.code === code || new RegExp(`\\b${code}\\b`).test(text)) hints.push(`${code}: ${hint}`);
62
+ }
63
+ for (const [pattern, hint] of SETUP_HINTS) {
64
+ if (pattern.test(text)) hints.push(hint);
65
+ }
66
+ return [...stages, hints.length ? hints.join("; ") : SETUP_FALLBACK].join(": ");
67
+ }