@chorus-aidlc/chorus 0.10.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (659) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/app-build-manifest.json +463 -346
  3. package/.next/standalone/.next/app-path-routes-manifest.json +50 -36
  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/routes-manifest.json +25 -0
  7. package/.next/standalone/.next/server/app/(dashboard)/project-groups/[uuid]/page.js +2 -2
  8. package/.next/standalone/.next/server/app/(dashboard)/project-groups/[uuid]/page.js.nft.json +1 -1
  9. package/.next/standalone/.next/server/app/(dashboard)/project-groups/[uuid]/page_client-reference-manifest.js +1 -1
  10. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/activity/page.js +2 -2
  11. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/activity/page.js.nft.json +1 -1
  12. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/activity/page_client-reference-manifest.js +1 -1
  13. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/dashboard/[ideaUuid]/page.js +2 -2
  14. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/dashboard/[ideaUuid]/page.js.nft.json +1 -1
  15. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/dashboard/[ideaUuid]/page_client-reference-manifest.js +1 -1
  16. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/dashboard/page.js +2 -2
  17. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/dashboard/page.js.nft.json +1 -1
  18. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/dashboard/page_client-reference-manifest.js +1 -1
  19. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/documents/[documentUuid]/page.js +2 -2
  20. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/documents/[documentUuid]/page.js.nft.json +1 -1
  21. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/documents/[documentUuid]/page_client-reference-manifest.js +1 -1
  22. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/documents/page.js +2 -2
  23. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/documents/page.js.nft.json +1 -1
  24. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/documents/page_client-reference-manifest.js +1 -1
  25. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/[proposalUuid]/page.js +2 -3
  26. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/[proposalUuid]/page.js.nft.json +1 -1
  27. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/[proposalUuid]/page_client-reference-manifest.js +1 -1
  28. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/new/page.js +2 -2
  29. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/new/page.js.nft.json +1 -1
  30. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/new/page_client-reference-manifest.js +1 -1
  31. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/page.js +2 -2
  32. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/page.js.nft.json +1 -1
  33. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/page_client-reference-manifest.js +1 -1
  34. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/[taskUuid]/page.js +2 -2
  35. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/[taskUuid]/page.js.nft.json +1 -1
  36. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/[taskUuid]/page_client-reference-manifest.js +1 -1
  37. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/page.js +2 -2
  38. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/page.js.nft.json +1 -1
  39. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/page_client-reference-manifest.js +1 -1
  40. package/.next/standalone/.next/server/app/(dashboard)/projects/page.js +3 -3
  41. package/.next/standalone/.next/server/app/(dashboard)/projects/page.js.nft.json +1 -1
  42. package/.next/standalone/.next/server/app/(dashboard)/projects/page_client-reference-manifest.js +1 -1
  43. package/.next/standalone/.next/server/app/(dashboard)/settings/page.js +2 -8
  44. package/.next/standalone/.next/server/app/(dashboard)/settings/page.js.nft.json +1 -1
  45. package/.next/standalone/.next/server/app/(dashboard)/settings/page_client-reference-manifest.js +1 -1
  46. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  47. package/.next/standalone/.next/server/app/_not-found.html +1 -1
  48. package/.next/standalone/.next/server/app/_not-found.rsc +5 -5
  49. package/.next/standalone/.next/server/app/admin/companies/[uuid]/page_client-reference-manifest.js +1 -1
  50. package/.next/standalone/.next/server/app/admin/companies/new/page_client-reference-manifest.js +1 -1
  51. package/.next/standalone/.next/server/app/admin/companies/new.html +1 -1
  52. package/.next/standalone/.next/server/app/admin/companies/new.rsc +5 -5
  53. package/.next/standalone/.next/server/app/admin/companies/page_client-reference-manifest.js +1 -1
  54. package/.next/standalone/.next/server/app/admin/companies.html +1 -1
  55. package/.next/standalone/.next/server/app/admin/companies.rsc +5 -5
  56. package/.next/standalone/.next/server/app/admin/page_client-reference-manifest.js +1 -1
  57. package/.next/standalone/.next/server/app/admin.html +1 -1
  58. package/.next/standalone/.next/server/app/admin.rsc +5 -5
  59. package/.next/standalone/.next/server/app/api/admin/companies/[uuid]/route.js +1 -1
  60. package/.next/standalone/.next/server/app/api/admin/companies/[uuid]/route_client-reference-manifest.js +1 -1
  61. package/.next/standalone/.next/server/app/api/admin/companies/route.js +1 -1
  62. package/.next/standalone/.next/server/app/api/admin/companies/route_client-reference-manifest.js +1 -1
  63. package/.next/standalone/.next/server/app/api/admin/login/route.js +1 -1
  64. package/.next/standalone/.next/server/app/api/admin/login/route_client-reference-manifest.js +1 -1
  65. package/.next/standalone/.next/server/app/api/admin/session/route.js +1 -1
  66. package/.next/standalone/.next/server/app/api/admin/session/route_client-reference-manifest.js +1 -1
  67. package/.next/standalone/.next/server/app/api/agent-connections/route.js +1 -0
  68. package/.next/standalone/.next/server/app/api/agent-connections/route.js.nft.json +1 -0
  69. package/.next/standalone/.next/server/app/api/agent-connections/route_client-reference-manifest.js +1 -0
  70. package/.next/standalone/.next/server/app/api/agents/[uuid]/route.js +1 -1
  71. package/.next/standalone/.next/server/app/api/agents/[uuid]/route_client-reference-manifest.js +1 -1
  72. package/.next/standalone/.next/server/app/api/agents/[uuid]/sessions/route.js +1 -1
  73. package/.next/standalone/.next/server/app/api/agents/[uuid]/sessions/route.js.nft.json +1 -1
  74. package/.next/standalone/.next/server/app/api/agents/[uuid]/sessions/route_client-reference-manifest.js +1 -1
  75. package/.next/standalone/.next/server/app/api/agents/route.js +1 -1
  76. package/.next/standalone/.next/server/app/api/agents/route_client-reference-manifest.js +1 -1
  77. package/.next/standalone/.next/server/app/api/api-keys/[uuid]/route.js +1 -1
  78. package/.next/standalone/.next/server/app/api/api-keys/[uuid]/route_client-reference-manifest.js +1 -1
  79. package/.next/standalone/.next/server/app/api/api-keys/route.js +1 -1
  80. package/.next/standalone/.next/server/app/api/api-keys/route_client-reference-manifest.js +1 -1
  81. package/.next/standalone/.next/server/app/api/auth/callback/route.js +1 -1
  82. package/.next/standalone/.next/server/app/api/auth/callback/route_client-reference-manifest.js +1 -1
  83. package/.next/standalone/.next/server/app/api/auth/check-default/route.js +1 -1
  84. package/.next/standalone/.next/server/app/api/auth/check-default/route_client-reference-manifest.js +1 -1
  85. package/.next/standalone/.next/server/app/api/auth/company-oidc/route.js +1 -1
  86. package/.next/standalone/.next/server/app/api/auth/company-oidc/route_client-reference-manifest.js +1 -1
  87. package/.next/standalone/.next/server/app/api/auth/default-login/route.js +1 -1
  88. package/.next/standalone/.next/server/app/api/auth/default-login/route_client-reference-manifest.js +1 -1
  89. package/.next/standalone/.next/server/app/api/auth/identify/route.js +1 -1
  90. package/.next/standalone/.next/server/app/api/auth/identify/route_client-reference-manifest.js +1 -1
  91. package/.next/standalone/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  92. package/.next/standalone/.next/server/app/api/auth/me/route.js +1 -1
  93. package/.next/standalone/.next/server/app/api/auth/me/route_client-reference-manifest.js +1 -1
  94. package/.next/standalone/.next/server/app/api/auth/refresh/route.js +1 -1
  95. package/.next/standalone/.next/server/app/api/auth/refresh/route_client-reference-manifest.js +1 -1
  96. package/.next/standalone/.next/server/app/api/auth/session/route.js +1 -1
  97. package/.next/standalone/.next/server/app/api/auth/session/route_client-reference-manifest.js +1 -1
  98. package/.next/standalone/.next/server/app/api/auth/sync-token/route.js +1 -1
  99. package/.next/standalone/.next/server/app/api/auth/sync-token/route_client-reference-manifest.js +1 -1
  100. package/.next/standalone/.next/server/app/api/comments/route.js +1 -1
  101. package/.next/standalone/.next/server/app/api/comments/route.js.nft.json +1 -1
  102. package/.next/standalone/.next/server/app/api/comments/route_client-reference-manifest.js +1 -1
  103. package/.next/standalone/.next/server/app/api/daemon/control/route.js +1 -0
  104. package/.next/standalone/.next/server/app/api/daemon/control/route.js.nft.json +1 -0
  105. package/.next/standalone/.next/server/app/api/daemon/control/route_client-reference-manifest.js +1 -0
  106. package/.next/standalone/.next/server/app/api/daemon/execution-state/route.js +1 -0
  107. package/.next/standalone/.next/server/app/api/daemon/execution-state/route.js.nft.json +1 -0
  108. package/.next/standalone/.next/server/app/api/daemon/execution-state/route_client-reference-manifest.js +1 -0
  109. package/.next/standalone/.next/server/app/api/daemon/executions/route.js +1 -0
  110. package/.next/standalone/.next/server/app/api/daemon/executions/route.js.nft.json +1 -0
  111. package/.next/standalone/.next/server/app/api/daemon/executions/route_client-reference-manifest.js +1 -0
  112. package/.next/standalone/.next/server/app/api/daemon/pending-turns/route.js +1 -0
  113. package/.next/standalone/.next/server/app/api/daemon/pending-turns/route.js.nft.json +1 -0
  114. package/.next/standalone/.next/server/app/api/daemon/pending-turns/route_client-reference-manifest.js +1 -0
  115. package/.next/standalone/.next/server/app/api/daemon/report-interrupt/route.js +1 -0
  116. package/.next/standalone/.next/server/app/api/daemon/report-interrupt/route.js.nft.json +1 -0
  117. package/.next/standalone/.next/server/app/api/daemon/report-interrupt/route_client-reference-manifest.js +1 -0
  118. package/.next/standalone/.next/server/app/api/daemon/resume/route.js +1 -0
  119. package/.next/standalone/.next/server/app/api/daemon/resume/route.js.nft.json +1 -0
  120. package/.next/standalone/.next/server/app/api/daemon/resume/route_client-reference-manifest.js +1 -0
  121. package/.next/standalone/.next/server/app/api/daemon/transcript/route.js +1 -0
  122. package/.next/standalone/.next/server/app/api/daemon/transcript/route.js.nft.json +1 -0
  123. package/.next/standalone/.next/server/app/api/daemon/transcript/route_client-reference-manifest.js +1 -0
  124. package/.next/standalone/.next/server/app/api/daemon/turn-advance/route.js +1 -0
  125. package/.next/standalone/.next/server/app/api/daemon/turn-advance/route.js.nft.json +1 -0
  126. package/.next/standalone/.next/server/app/api/daemon/turn-advance/route_client-reference-manifest.js +1 -0
  127. package/.next/standalone/.next/server/app/api/daemon-sessions/[sessionUuid]/instruction/route.js +1 -0
  128. package/.next/standalone/.next/server/app/api/daemon-sessions/[sessionUuid]/instruction/route.js.nft.json +1 -0
  129. package/.next/standalone/.next/server/app/api/daemon-sessions/[sessionUuid]/instruction/route_client-reference-manifest.js +1 -0
  130. package/.next/standalone/.next/server/app/api/daemon-sessions/[sessionUuid]/route.js +1 -0
  131. package/.next/standalone/.next/server/app/api/daemon-sessions/[sessionUuid]/route.js.nft.json +1 -0
  132. package/.next/standalone/.next/server/app/api/daemon-sessions/[sessionUuid]/route_client-reference-manifest.js +1 -0
  133. package/.next/standalone/.next/server/app/api/daemon-sessions/ad-hoc/route.js +1 -0
  134. package/.next/standalone/.next/server/app/api/daemon-sessions/ad-hoc/route.js.nft.json +1 -0
  135. package/.next/standalone/.next/server/app/api/daemon-sessions/ad-hoc/route_client-reference-manifest.js +1 -0
  136. package/.next/standalone/.next/server/app/api/daemon-sessions/route.js +1 -0
  137. package/.next/standalone/.next/server/app/api/daemon-sessions/route.js.nft.json +1 -0
  138. package/.next/standalone/.next/server/app/api/daemon-sessions/route_client-reference-manifest.js +1 -0
  139. package/.next/standalone/.next/server/app/api/documents/[uuid]/route.js +1 -1
  140. package/.next/standalone/.next/server/app/api/documents/[uuid]/route_client-reference-manifest.js +1 -1
  141. package/.next/standalone/.next/server/app/api/entities/[type]/[uuid]/root-idea/route.js +1 -0
  142. package/.next/standalone/.next/server/app/api/entities/[type]/[uuid]/root-idea/route.js.nft.json +1 -0
  143. package/.next/standalone/.next/server/app/api/entities/[type]/[uuid]/root-idea/route_client-reference-manifest.js +1 -0
  144. package/.next/standalone/.next/server/app/api/events/notifications/route.js +6 -2
  145. package/.next/standalone/.next/server/app/api/events/notifications/route.js.nft.json +1 -1
  146. package/.next/standalone/.next/server/app/api/events/notifications/route_client-reference-manifest.js +1 -1
  147. package/.next/standalone/.next/server/app/api/events/route.js +7 -3
  148. package/.next/standalone/.next/server/app/api/events/route.js.nft.json +1 -1
  149. package/.next/standalone/.next/server/app/api/events/route_client-reference-manifest.js +1 -1
  150. package/.next/standalone/.next/server/app/api/health/route.js +1 -1
  151. package/.next/standalone/.next/server/app/api/health/route_client-reference-manifest.js +1 -1
  152. package/.next/standalone/.next/server/app/api/ideas/[uuid]/claim/route.js +1 -1
  153. package/.next/standalone/.next/server/app/api/ideas/[uuid]/claim/route.js.nft.json +1 -1
  154. package/.next/standalone/.next/server/app/api/ideas/[uuid]/claim/route_client-reference-manifest.js +1 -1
  155. package/.next/standalone/.next/server/app/api/ideas/[uuid]/move/preview/route.js +1 -1
  156. package/.next/standalone/.next/server/app/api/ideas/[uuid]/move/preview/route.js.nft.json +1 -1
  157. package/.next/standalone/.next/server/app/api/ideas/[uuid]/move/preview/route_client-reference-manifest.js +1 -1
  158. package/.next/standalone/.next/server/app/api/ideas/[uuid]/move/route.js +1 -1
  159. package/.next/standalone/.next/server/app/api/ideas/[uuid]/move/route.js.nft.json +1 -1
  160. package/.next/standalone/.next/server/app/api/ideas/[uuid]/move/route_client-reference-manifest.js +1 -1
  161. package/.next/standalone/.next/server/app/api/ideas/[uuid]/parent/route.js +1 -1
  162. package/.next/standalone/.next/server/app/api/ideas/[uuid]/parent/route.js.nft.json +1 -1
  163. package/.next/standalone/.next/server/app/api/ideas/[uuid]/parent/route_client-reference-manifest.js +1 -1
  164. package/.next/standalone/.next/server/app/api/ideas/[uuid]/release/route.js +1 -1
  165. package/.next/standalone/.next/server/app/api/ideas/[uuid]/release/route.js.nft.json +1 -1
  166. package/.next/standalone/.next/server/app/api/ideas/[uuid]/release/route_client-reference-manifest.js +1 -1
  167. package/.next/standalone/.next/server/app/api/ideas/[uuid]/route.js +1 -1
  168. package/.next/standalone/.next/server/app/api/ideas/[uuid]/route.js.nft.json +1 -1
  169. package/.next/standalone/.next/server/app/api/ideas/[uuid]/route_client-reference-manifest.js +1 -1
  170. package/.next/standalone/.next/server/app/api/mcp/route.js +5 -41
  171. package/.next/standalone/.next/server/app/api/mcp/route.js.nft.json +1 -1
  172. package/.next/standalone/.next/server/app/api/mcp/route_client-reference-manifest.js +1 -1
  173. package/.next/standalone/.next/server/app/api/me/assignments/route.js +1 -1
  174. package/.next/standalone/.next/server/app/api/me/assignments/route.js.nft.json +1 -1
  175. package/.next/standalone/.next/server/app/api/me/assignments/route_client-reference-manifest.js +1 -1
  176. package/.next/standalone/.next/server/app/api/mentionables/route.js +1 -1
  177. package/.next/standalone/.next/server/app/api/mentionables/route.js.nft.json +1 -1
  178. package/.next/standalone/.next/server/app/api/mentionables/route_client-reference-manifest.js +1 -1
  179. package/.next/standalone/.next/server/app/api/notifications/[uuid]/archive/route.js +1 -1
  180. package/.next/standalone/.next/server/app/api/notifications/[uuid]/archive/route.js.nft.json +1 -1
  181. package/.next/standalone/.next/server/app/api/notifications/[uuid]/archive/route_client-reference-manifest.js +1 -1
  182. package/.next/standalone/.next/server/app/api/notifications/[uuid]/read/route.js +1 -1
  183. package/.next/standalone/.next/server/app/api/notifications/[uuid]/read/route.js.nft.json +1 -1
  184. package/.next/standalone/.next/server/app/api/notifications/[uuid]/read/route_client-reference-manifest.js +1 -1
  185. package/.next/standalone/.next/server/app/api/notifications/preferences/route.js +1 -1
  186. package/.next/standalone/.next/server/app/api/notifications/preferences/route.js.nft.json +1 -1
  187. package/.next/standalone/.next/server/app/api/notifications/preferences/route_client-reference-manifest.js +1 -1
  188. package/.next/standalone/.next/server/app/api/notifications/read-all/route.js +1 -1
  189. package/.next/standalone/.next/server/app/api/notifications/read-all/route.js.nft.json +1 -1
  190. package/.next/standalone/.next/server/app/api/notifications/read-all/route_client-reference-manifest.js +1 -1
  191. package/.next/standalone/.next/server/app/api/notifications/route.js +1 -1
  192. package/.next/standalone/.next/server/app/api/notifications/route.js.nft.json +1 -1
  193. package/.next/standalone/.next/server/app/api/notifications/route_client-reference-manifest.js +1 -1
  194. package/.next/standalone/.next/server/app/api/notifications/unread-count/route.js +1 -1
  195. package/.next/standalone/.next/server/app/api/notifications/unread-count/route.js.nft.json +1 -1
  196. package/.next/standalone/.next/server/app/api/notifications/unread-count/route_client-reference-manifest.js +1 -1
  197. package/.next/standalone/.next/server/app/api/project-groups/[uuid]/dashboard/route.js +1 -1
  198. package/.next/standalone/.next/server/app/api/project-groups/[uuid]/dashboard/route_client-reference-manifest.js +1 -1
  199. package/.next/standalone/.next/server/app/api/project-groups/[uuid]/route.js +1 -1
  200. package/.next/standalone/.next/server/app/api/project-groups/[uuid]/route_client-reference-manifest.js +1 -1
  201. package/.next/standalone/.next/server/app/api/project-groups/route.js +1 -1
  202. package/.next/standalone/.next/server/app/api/project-groups/route_client-reference-manifest.js +1 -1
  203. package/.next/standalone/.next/server/app/api/projects/[uuid]/activity/route.js +1 -1
  204. package/.next/standalone/.next/server/app/api/projects/[uuid]/activity/route_client-reference-manifest.js +1 -1
  205. package/.next/standalone/.next/server/app/api/projects/[uuid]/available/route.js +1 -1
  206. package/.next/standalone/.next/server/app/api/projects/[uuid]/available/route.js.nft.json +1 -1
  207. package/.next/standalone/.next/server/app/api/projects/[uuid]/available/route_client-reference-manifest.js +1 -1
  208. package/.next/standalone/.next/server/app/api/projects/[uuid]/documents/route.js +1 -1
  209. package/.next/standalone/.next/server/app/api/projects/[uuid]/documents/route_client-reference-manifest.js +1 -1
  210. package/.next/standalone/.next/server/app/api/projects/[uuid]/group/route.js +1 -1
  211. package/.next/standalone/.next/server/app/api/projects/[uuid]/group/route_client-reference-manifest.js +1 -1
  212. package/.next/standalone/.next/server/app/api/projects/[uuid]/ideas/route.js +1 -1
  213. package/.next/standalone/.next/server/app/api/projects/[uuid]/ideas/route.js.nft.json +1 -1
  214. package/.next/standalone/.next/server/app/api/projects/[uuid]/ideas/route_client-reference-manifest.js +1 -1
  215. package/.next/standalone/.next/server/app/api/projects/[uuid]/ideas/tracker/route.js +1 -1
  216. package/.next/standalone/.next/server/app/api/projects/[uuid]/ideas/tracker/route.js.nft.json +1 -1
  217. package/.next/standalone/.next/server/app/api/projects/[uuid]/ideas/tracker/route_client-reference-manifest.js +1 -1
  218. package/.next/standalone/.next/server/app/api/projects/[uuid]/proposals/[proposalUuid]/validate/route.js +1 -1
  219. package/.next/standalone/.next/server/app/api/projects/[uuid]/proposals/[proposalUuid]/validate/route_client-reference-manifest.js +1 -1
  220. package/.next/standalone/.next/server/app/api/projects/[uuid]/proposals/route.js +1 -1
  221. package/.next/standalone/.next/server/app/api/projects/[uuid]/proposals/route_client-reference-manifest.js +1 -1
  222. package/.next/standalone/.next/server/app/api/projects/[uuid]/proposals/summary/route.js +1 -1
  223. package/.next/standalone/.next/server/app/api/projects/[uuid]/proposals/summary/route_client-reference-manifest.js +1 -1
  224. package/.next/standalone/.next/server/app/api/projects/[uuid]/route.js +1 -1
  225. package/.next/standalone/.next/server/app/api/projects/[uuid]/route_client-reference-manifest.js +1 -1
  226. package/.next/standalone/.next/server/app/api/projects/[uuid]/stats/route.js +1 -1
  227. package/.next/standalone/.next/server/app/api/projects/[uuid]/stats/route_client-reference-manifest.js +1 -1
  228. package/.next/standalone/.next/server/app/api/projects/[uuid]/tasks/dependencies/route.js +1 -1
  229. package/.next/standalone/.next/server/app/api/projects/[uuid]/tasks/dependencies/route.js.nft.json +1 -1
  230. package/.next/standalone/.next/server/app/api/projects/[uuid]/tasks/dependencies/route_client-reference-manifest.js +1 -1
  231. package/.next/standalone/.next/server/app/api/projects/[uuid]/tasks/route.js +1 -1
  232. package/.next/standalone/.next/server/app/api/projects/[uuid]/tasks/route.js.nft.json +1 -1
  233. package/.next/standalone/.next/server/app/api/projects/[uuid]/tasks/route_client-reference-manifest.js +1 -1
  234. package/.next/standalone/.next/server/app/api/projects/route.js +1 -1
  235. package/.next/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
  236. package/.next/standalone/.next/server/app/api/proposals/[uuid]/approve/route.js +1 -1
  237. package/.next/standalone/.next/server/app/api/proposals/[uuid]/approve/route_client-reference-manifest.js +1 -1
  238. package/.next/standalone/.next/server/app/api/proposals/[uuid]/close/route.js +1 -1
  239. package/.next/standalone/.next/server/app/api/proposals/[uuid]/close/route_client-reference-manifest.js +1 -1
  240. package/.next/standalone/.next/server/app/api/proposals/[uuid]/reject/route.js +1 -1
  241. package/.next/standalone/.next/server/app/api/proposals/[uuid]/reject/route_client-reference-manifest.js +1 -1
  242. package/.next/standalone/.next/server/app/api/proposals/[uuid]/revoke/route.js +1 -1
  243. package/.next/standalone/.next/server/app/api/proposals/[uuid]/revoke/route_client-reference-manifest.js +1 -1
  244. package/.next/standalone/.next/server/app/api/proposals/[uuid]/route.js +1 -1
  245. package/.next/standalone/.next/server/app/api/proposals/[uuid]/route_client-reference-manifest.js +1 -1
  246. package/.next/standalone/.next/server/app/api/search/route.js +1 -1
  247. package/.next/standalone/.next/server/app/api/search/route_client-reference-manifest.js +1 -1
  248. package/.next/standalone/.next/server/app/api/sessions/[uuid]/route.js +1 -1
  249. package/.next/standalone/.next/server/app/api/sessions/[uuid]/route.js.nft.json +1 -1
  250. package/.next/standalone/.next/server/app/api/sessions/[uuid]/route_client-reference-manifest.js +1 -1
  251. package/.next/standalone/.next/server/app/api/tasks/[uuid]/claim/route.js +1 -1
  252. package/.next/standalone/.next/server/app/api/tasks/[uuid]/claim/route.js.nft.json +1 -1
  253. package/.next/standalone/.next/server/app/api/tasks/[uuid]/claim/route_client-reference-manifest.js +1 -1
  254. package/.next/standalone/.next/server/app/api/tasks/[uuid]/dependencies/[dependsOnUuid]/route.js +1 -1
  255. package/.next/standalone/.next/server/app/api/tasks/[uuid]/dependencies/[dependsOnUuid]/route.js.nft.json +1 -1
  256. package/.next/standalone/.next/server/app/api/tasks/[uuid]/dependencies/[dependsOnUuid]/route_client-reference-manifest.js +1 -1
  257. package/.next/standalone/.next/server/app/api/tasks/[uuid]/dependencies/route.js +1 -1
  258. package/.next/standalone/.next/server/app/api/tasks/[uuid]/dependencies/route.js.nft.json +1 -1
  259. package/.next/standalone/.next/server/app/api/tasks/[uuid]/dependencies/route_client-reference-manifest.js +1 -1
  260. package/.next/standalone/.next/server/app/api/tasks/[uuid]/release/route.js +1 -1
  261. package/.next/standalone/.next/server/app/api/tasks/[uuid]/release/route.js.nft.json +1 -1
  262. package/.next/standalone/.next/server/app/api/tasks/[uuid]/release/route_client-reference-manifest.js +1 -1
  263. package/.next/standalone/.next/server/app/api/tasks/[uuid]/route.js +1 -1
  264. package/.next/standalone/.next/server/app/api/tasks/[uuid]/route.js.nft.json +1 -1
  265. package/.next/standalone/.next/server/app/api/tasks/[uuid]/route_client-reference-manifest.js +1 -1
  266. package/.next/standalone/.next/server/app/api/tasks/[uuid]/sessions/route.js +1 -1
  267. package/.next/standalone/.next/server/app/api/tasks/[uuid]/sessions/route.js.nft.json +1 -1
  268. package/.next/standalone/.next/server/app/api/tasks/[uuid]/sessions/route_client-reference-manifest.js +1 -1
  269. package/.next/standalone/.next/server/app/index.html +1 -1
  270. package/.next/standalone/.next/server/app/index.rsc +5 -5
  271. package/.next/standalone/.next/server/app/login/admin/page_client-reference-manifest.js +1 -1
  272. package/.next/standalone/.next/server/app/login/admin.html +1 -1
  273. package/.next/standalone/.next/server/app/login/admin.rsc +5 -5
  274. package/.next/standalone/.next/server/app/login/callback/page.js +2 -2
  275. package/.next/standalone/.next/server/app/login/callback/page.js.nft.json +1 -1
  276. package/.next/standalone/.next/server/app/login/callback/page_client-reference-manifest.js +1 -1
  277. package/.next/standalone/.next/server/app/login/callback.html +1 -1
  278. package/.next/standalone/.next/server/app/login/callback.rsc +5 -5
  279. package/.next/standalone/.next/server/app/login/page_client-reference-manifest.js +1 -1
  280. package/.next/standalone/.next/server/app/login/pick-workspace/page_client-reference-manifest.js +1 -1
  281. package/.next/standalone/.next/server/app/login/pick-workspace.html +1 -1
  282. package/.next/standalone/.next/server/app/login/pick-workspace.rsc +5 -5
  283. package/.next/standalone/.next/server/app/login/silent-refresh/page_client-reference-manifest.js +1 -1
  284. package/.next/standalone/.next/server/app/login/silent-refresh.html +1 -1
  285. package/.next/standalone/.next/server/app/login/silent-refresh.rsc +5 -5
  286. package/.next/standalone/.next/server/app/login.html +1 -1
  287. package/.next/standalone/.next/server/app/login.rsc +5 -5
  288. package/.next/standalone/.next/server/app/onboarding/page.js +2 -2
  289. package/.next/standalone/.next/server/app/onboarding/page.js.nft.json +1 -1
  290. package/.next/standalone/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  291. package/.next/standalone/.next/server/app/onboarding.html +1 -1
  292. package/.next/standalone/.next/server/app/onboarding.rsc +6 -6
  293. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  294. package/.next/standalone/.next/server/app/projects.html +1 -1
  295. package/.next/standalone/.next/server/app/projects.rsc +7 -7
  296. package/.next/standalone/.next/server/app/settings.html +1 -1
  297. package/.next/standalone/.next/server/app/settings.rsc +7 -7
  298. package/.next/standalone/.next/server/app-paths-manifest.json +50 -36
  299. package/.next/standalone/.next/server/chunks/1064.js +1 -0
  300. package/.next/standalone/.next/server/chunks/1596.js +13 -0
  301. package/.next/standalone/.next/server/chunks/2213.js +1 -0
  302. package/.next/standalone/.next/server/chunks/2618.js +1 -1
  303. package/.next/standalone/.next/server/chunks/2961.js +1 -1
  304. package/.next/standalone/.next/server/chunks/3219.js +2 -0
  305. package/.next/standalone/.next/server/chunks/3371.js +1 -0
  306. package/.next/standalone/.next/server/chunks/3419.js +1 -0
  307. package/.next/standalone/.next/server/chunks/369.js +1 -0
  308. package/.next/standalone/.next/server/chunks/4638.js +1 -0
  309. package/.next/standalone/.next/server/chunks/4711.js +530 -0
  310. package/.next/standalone/.next/server/chunks/5039.js +1 -0
  311. package/.next/standalone/.next/server/chunks/5300.js +1 -1
  312. package/.next/standalone/.next/server/chunks/5631.js +1 -0
  313. package/.next/standalone/.next/server/chunks/6044.js +1 -1
  314. package/.next/standalone/.next/server/chunks/6113.js +1 -1
  315. package/.next/standalone/.next/server/chunks/6207.js +1 -1
  316. package/.next/standalone/.next/server/chunks/6461.js +1 -0
  317. package/.next/standalone/.next/server/chunks/6712.js +1 -0
  318. package/.next/standalone/.next/server/chunks/7002.js +1 -1
  319. package/.next/standalone/.next/server/chunks/7063.js +2 -2
  320. package/.next/standalone/.next/server/chunks/7258.js +37 -0
  321. package/.next/standalone/.next/server/chunks/7368.js +1 -1
  322. package/.next/standalone/.next/server/chunks/7578.js +2 -2
  323. package/.next/standalone/.next/server/chunks/7867.js +1 -0
  324. package/.next/standalone/.next/server/chunks/7897.js +1 -0
  325. package/.next/standalone/.next/server/chunks/8012.js +1 -0
  326. package/.next/standalone/.next/server/chunks/8245.js +31 -0
  327. package/.next/standalone/.next/server/chunks/8322.js +1 -1
  328. package/.next/standalone/.next/server/chunks/9015.js +1 -1
  329. package/.next/standalone/.next/server/chunks/920.js +1 -1
  330. package/.next/standalone/.next/server/chunks/937.js +16 -2
  331. package/.next/standalone/.next/server/chunks/9629.js +1 -0
  332. package/.next/standalone/.next/server/chunks/9725.js +1 -0
  333. package/.next/standalone/.next/server/instrumentation.js +1 -1
  334. package/.next/standalone/.next/server/middleware-build-manifest.js +1 -1
  335. package/.next/standalone/.next/server/middleware-manifest.json +5 -5
  336. package/.next/standalone/.next/server/next-font-manifest.js +1 -1
  337. package/.next/standalone/.next/server/next-font-manifest.json +1 -1
  338. package/.next/standalone/.next/server/pages/404.html +1 -1
  339. package/.next/standalone/.next/server/pages/500.html +1 -1
  340. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  341. package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
  342. package/.next/standalone/.next/server/src/middleware.js +1 -1
  343. package/.next/standalone/.next/static/519aK55QLHaVN7b1TVDkB/_buildManifest.js +1 -0
  344. package/.next/standalone/.next/static/chunks/1217-323cc20b73ebfde9.js +1 -0
  345. package/.next/standalone/.next/static/chunks/{11207-8f4b154804f5a66f.js → 15183-5734d279b26e9414.js} +2 -2
  346. package/.next/standalone/.next/static/chunks/1879-7a8b283283218df2.js +1 -0
  347. package/.next/standalone/.next/static/chunks/19276-50b367d7b93d5f34.js +1 -0
  348. package/.next/standalone/.next/static/chunks/23466-e1176a6d814f4897.js +1 -0
  349. package/.next/standalone/.next/static/chunks/38040-a8687f86dd8e9d67.js +1 -0
  350. package/.next/standalone/.next/static/chunks/{4860.e071c0b9e32bd75f.js → 4860.43f5ad8a3aaed0e8.js} +1 -1
  351. package/.next/standalone/.next/static/chunks/58245-b2ea112ace9624d2.js +1 -0
  352. package/.next/standalone/.next/static/chunks/59296-783831c43aa0162e.js +1 -0
  353. package/.next/standalone/.next/static/chunks/60648-36ccbee4ce232d52.js +1 -0
  354. package/.next/standalone/.next/static/chunks/60694-68232120903209df.js +1 -0
  355. package/.next/standalone/.next/static/chunks/64648-81f03be6f9793ab9.js +1 -0
  356. package/.next/standalone/.next/static/chunks/{94655-1c75e0590a66215e.js → 66969-12f0b22c51f5a410.js} +1 -1
  357. package/.next/standalone/.next/static/chunks/70536-b8bf71098ae11f07.js +1 -0
  358. package/.next/standalone/.next/static/chunks/71350-88c2649fc693c1e8.js +1 -0
  359. package/.next/standalone/.next/static/chunks/78389-b32edc6bd5c570a9.js +1 -0
  360. package/.next/standalone/.next/static/chunks/78584-eb2fa8cf2f266329.js +1 -0
  361. package/.next/standalone/.next/static/chunks/78917-150ed14a99844aab.js +1 -0
  362. package/.next/standalone/.next/static/chunks/8574-b9739eb8d054c793.js +1 -0
  363. package/.next/standalone/.next/static/chunks/{99373.4c336ea9ad07311e.js → 99373.0768feb3a08c7da3.js} +1 -1
  364. package/.next/standalone/.next/static/chunks/app/(dashboard)/layout-0a28456fea4ce95a.js +1 -0
  365. package/.next/standalone/.next/static/chunks/app/(dashboard)/project-groups/[uuid]/page-a79969c5c9aadacd.js +1 -0
  366. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/dashboard/[ideaUuid]/page-4bc556c2fc8f3d24.js +1 -0
  367. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/dashboard/page-e00752a72c31663f.js +1 -0
  368. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/documents/[documentUuid]/page-ef82b871895245ea.js +1 -0
  369. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/documents/page-2c9bcbd11ddb8661.js +1 -0
  370. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/[proposalUuid]/page-630b168598513ce8.js +1 -0
  371. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/new/page-99639479cc98965f.js +1 -0
  372. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/page-335f2450e44a0fba.js +1 -0
  373. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/tasks/[taskUuid]/page-4a191d69b2b6e880.js +1 -0
  374. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/tasks/page-0faebb478be4c85d.js +1 -0
  375. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/{page-f198303c176c6e02.js → page-583e58d4d689d38b.js} +1 -1
  376. package/.next/standalone/.next/static/chunks/app/(dashboard)/settings/page-2e8fcb72687100df.js +1 -0
  377. package/.next/standalone/.next/static/chunks/app/api/admin/companies/[uuid]/route-4bc556c2fc8f3d24.js +1 -0
  378. package/.next/standalone/.next/static/chunks/app/api/admin/companies/route-4bc556c2fc8f3d24.js +1 -0
  379. package/.next/standalone/.next/static/chunks/app/api/admin/login/route-4bc556c2fc8f3d24.js +1 -0
  380. package/.next/standalone/.next/static/chunks/app/api/admin/session/route-4bc556c2fc8f3d24.js +1 -0
  381. package/.next/standalone/.next/static/chunks/app/api/agent-connections/route-4bc556c2fc8f3d24.js +1 -0
  382. package/.next/standalone/.next/static/chunks/app/api/agents/[uuid]/route-4bc556c2fc8f3d24.js +1 -0
  383. package/.next/standalone/.next/static/chunks/app/api/agents/[uuid]/sessions/route-4bc556c2fc8f3d24.js +1 -0
  384. package/.next/standalone/.next/static/chunks/app/api/agents/route-4bc556c2fc8f3d24.js +1 -0
  385. package/.next/standalone/.next/static/chunks/app/api/api-keys/[uuid]/route-4bc556c2fc8f3d24.js +1 -0
  386. package/.next/standalone/.next/static/chunks/app/api/api-keys/route-4bc556c2fc8f3d24.js +1 -0
  387. package/.next/standalone/.next/static/chunks/app/api/auth/callback/route-4bc556c2fc8f3d24.js +1 -0
  388. package/.next/standalone/.next/static/chunks/app/api/auth/check-default/route-4bc556c2fc8f3d24.js +1 -0
  389. package/.next/standalone/.next/static/chunks/app/api/auth/company-oidc/route-4bc556c2fc8f3d24.js +1 -0
  390. package/.next/standalone/.next/static/chunks/app/api/auth/default-login/route-4bc556c2fc8f3d24.js +1 -0
  391. package/.next/standalone/.next/static/chunks/app/api/auth/identify/route-4bc556c2fc8f3d24.js +1 -0
  392. package/.next/standalone/.next/static/chunks/app/api/auth/logout/route-4bc556c2fc8f3d24.js +1 -0
  393. package/.next/standalone/.next/static/chunks/app/api/auth/me/route-4bc556c2fc8f3d24.js +1 -0
  394. package/.next/standalone/.next/static/chunks/app/api/auth/refresh/route-4bc556c2fc8f3d24.js +1 -0
  395. package/.next/standalone/.next/static/chunks/app/api/auth/session/route-4bc556c2fc8f3d24.js +1 -0
  396. package/.next/standalone/.next/static/chunks/app/api/auth/sync-token/route-4bc556c2fc8f3d24.js +1 -0
  397. package/.next/standalone/.next/static/chunks/app/api/comments/route-4bc556c2fc8f3d24.js +1 -0
  398. package/.next/standalone/.next/static/chunks/app/api/daemon/control/route-4bc556c2fc8f3d24.js +1 -0
  399. package/.next/standalone/.next/static/chunks/app/api/daemon/execution-state/route-4bc556c2fc8f3d24.js +1 -0
  400. package/.next/standalone/.next/static/chunks/app/api/daemon/executions/route-4bc556c2fc8f3d24.js +1 -0
  401. package/.next/standalone/.next/static/chunks/app/api/daemon/pending-turns/route-4bc556c2fc8f3d24.js +1 -0
  402. package/.next/standalone/.next/static/chunks/app/api/daemon/report-interrupt/route-4bc556c2fc8f3d24.js +1 -0
  403. package/.next/standalone/.next/static/chunks/app/api/daemon/resume/route-4bc556c2fc8f3d24.js +1 -0
  404. package/.next/standalone/.next/static/chunks/app/api/daemon/transcript/route-4bc556c2fc8f3d24.js +1 -0
  405. package/.next/standalone/.next/static/chunks/app/api/daemon/turn-advance/route-4bc556c2fc8f3d24.js +1 -0
  406. package/.next/standalone/.next/static/chunks/app/api/daemon-sessions/[sessionUuid]/instruction/route-4bc556c2fc8f3d24.js +1 -0
  407. package/.next/standalone/.next/static/chunks/app/api/daemon-sessions/[sessionUuid]/route-4bc556c2fc8f3d24.js +1 -0
  408. package/.next/standalone/.next/static/chunks/app/api/daemon-sessions/ad-hoc/route-4bc556c2fc8f3d24.js +1 -0
  409. package/.next/standalone/.next/static/chunks/app/api/daemon-sessions/route-4bc556c2fc8f3d24.js +1 -0
  410. package/.next/standalone/.next/static/chunks/app/api/documents/[uuid]/route-4bc556c2fc8f3d24.js +1 -0
  411. package/.next/standalone/.next/static/chunks/app/api/entities/[type]/[uuid]/root-idea/route-4bc556c2fc8f3d24.js +1 -0
  412. package/.next/standalone/.next/static/chunks/app/api/events/notifications/route-4bc556c2fc8f3d24.js +1 -0
  413. package/.next/standalone/.next/static/chunks/app/api/events/route-4bc556c2fc8f3d24.js +1 -0
  414. package/.next/standalone/.next/static/chunks/app/api/health/route-4bc556c2fc8f3d24.js +1 -0
  415. package/.next/standalone/.next/static/chunks/app/api/ideas/[uuid]/claim/route-4bc556c2fc8f3d24.js +1 -0
  416. package/.next/standalone/.next/static/chunks/app/api/ideas/[uuid]/move/preview/route-4bc556c2fc8f3d24.js +1 -0
  417. package/.next/standalone/.next/static/chunks/app/api/ideas/[uuid]/move/route-4bc556c2fc8f3d24.js +1 -0
  418. package/.next/standalone/.next/static/chunks/app/api/ideas/[uuid]/parent/route-4bc556c2fc8f3d24.js +1 -0
  419. package/.next/standalone/.next/static/chunks/app/api/ideas/[uuid]/release/route-4bc556c2fc8f3d24.js +1 -0
  420. package/.next/standalone/.next/static/chunks/app/api/ideas/[uuid]/route-4bc556c2fc8f3d24.js +1 -0
  421. package/.next/standalone/.next/static/chunks/app/api/mcp/route-4bc556c2fc8f3d24.js +1 -0
  422. package/.next/standalone/.next/static/chunks/app/api/me/assignments/route-4bc556c2fc8f3d24.js +1 -0
  423. package/.next/standalone/.next/static/chunks/app/api/mentionables/route-4bc556c2fc8f3d24.js +1 -0
  424. package/.next/standalone/.next/static/chunks/app/api/notifications/[uuid]/archive/route-4bc556c2fc8f3d24.js +1 -0
  425. package/.next/standalone/.next/static/chunks/app/api/notifications/[uuid]/read/route-4bc556c2fc8f3d24.js +1 -0
  426. package/.next/standalone/.next/static/chunks/app/api/notifications/preferences/route-4bc556c2fc8f3d24.js +1 -0
  427. package/.next/standalone/.next/static/chunks/app/api/notifications/read-all/route-4bc556c2fc8f3d24.js +1 -0
  428. package/.next/standalone/.next/static/chunks/app/api/notifications/route-4bc556c2fc8f3d24.js +1 -0
  429. package/.next/standalone/.next/static/chunks/app/api/notifications/unread-count/route-4bc556c2fc8f3d24.js +1 -0
  430. package/.next/standalone/.next/static/chunks/app/api/project-groups/[uuid]/dashboard/route-4bc556c2fc8f3d24.js +1 -0
  431. package/.next/standalone/.next/static/chunks/app/api/project-groups/[uuid]/route-4bc556c2fc8f3d24.js +1 -0
  432. package/.next/standalone/.next/static/chunks/app/api/project-groups/route-4bc556c2fc8f3d24.js +1 -0
  433. package/.next/standalone/.next/static/chunks/app/api/projects/[uuid]/activity/route-4bc556c2fc8f3d24.js +1 -0
  434. package/.next/standalone/.next/static/chunks/app/api/projects/[uuid]/available/route-4bc556c2fc8f3d24.js +1 -0
  435. package/.next/standalone/.next/static/chunks/app/api/projects/[uuid]/documents/route-4bc556c2fc8f3d24.js +1 -0
  436. package/.next/standalone/.next/static/chunks/app/api/projects/[uuid]/group/route-4bc556c2fc8f3d24.js +1 -0
  437. package/.next/standalone/.next/static/chunks/app/api/projects/[uuid]/ideas/route-4bc556c2fc8f3d24.js +1 -0
  438. package/.next/standalone/.next/static/chunks/app/api/projects/[uuid]/ideas/tracker/route-4bc556c2fc8f3d24.js +1 -0
  439. package/.next/standalone/.next/static/chunks/app/api/projects/[uuid]/proposals/[proposalUuid]/validate/route-4bc556c2fc8f3d24.js +1 -0
  440. package/.next/standalone/.next/static/chunks/app/api/projects/[uuid]/proposals/route-4bc556c2fc8f3d24.js +1 -0
  441. package/.next/standalone/.next/static/chunks/app/api/projects/[uuid]/proposals/summary/route-4bc556c2fc8f3d24.js +1 -0
  442. package/.next/standalone/.next/static/chunks/app/api/projects/[uuid]/route-4bc556c2fc8f3d24.js +1 -0
  443. package/.next/standalone/.next/static/chunks/app/api/projects/[uuid]/stats/route-4bc556c2fc8f3d24.js +1 -0
  444. package/.next/standalone/.next/static/chunks/app/api/projects/[uuid]/tasks/dependencies/route-4bc556c2fc8f3d24.js +1 -0
  445. package/.next/standalone/.next/static/chunks/app/api/projects/[uuid]/tasks/route-4bc556c2fc8f3d24.js +1 -0
  446. package/.next/standalone/.next/static/chunks/app/api/projects/route-4bc556c2fc8f3d24.js +1 -0
  447. package/.next/standalone/.next/static/chunks/app/api/proposals/[uuid]/approve/route-4bc556c2fc8f3d24.js +1 -0
  448. package/.next/standalone/.next/static/chunks/app/api/proposals/[uuid]/close/route-4bc556c2fc8f3d24.js +1 -0
  449. package/.next/standalone/.next/static/chunks/app/api/proposals/[uuid]/reject/route-4bc556c2fc8f3d24.js +1 -0
  450. package/.next/standalone/.next/static/chunks/app/api/proposals/[uuid]/revoke/route-4bc556c2fc8f3d24.js +1 -0
  451. package/.next/standalone/.next/static/chunks/app/api/proposals/[uuid]/route-4bc556c2fc8f3d24.js +1 -0
  452. package/.next/standalone/.next/static/chunks/app/api/search/route-4bc556c2fc8f3d24.js +1 -0
  453. package/.next/standalone/.next/static/chunks/app/api/sessions/[uuid]/route-4bc556c2fc8f3d24.js +1 -0
  454. package/.next/standalone/.next/static/chunks/app/api/tasks/[uuid]/claim/route-4bc556c2fc8f3d24.js +1 -0
  455. package/.next/standalone/.next/static/chunks/app/api/tasks/[uuid]/dependencies/[dependsOnUuid]/route-4bc556c2fc8f3d24.js +1 -0
  456. package/.next/standalone/.next/static/chunks/app/api/tasks/[uuid]/dependencies/route-4bc556c2fc8f3d24.js +1 -0
  457. package/.next/standalone/.next/static/chunks/app/api/tasks/[uuid]/release/route-4bc556c2fc8f3d24.js +1 -0
  458. package/.next/standalone/.next/static/chunks/app/api/tasks/[uuid]/route-4bc556c2fc8f3d24.js +1 -0
  459. package/.next/standalone/.next/static/chunks/app/api/tasks/[uuid]/sessions/route-4bc556c2fc8f3d24.js +1 -0
  460. package/.next/standalone/.next/static/chunks/app/layout-9963339572e2e64e.js +1 -0
  461. package/.next/standalone/.next/static/chunks/app/onboarding/page-e9a69a0c537c704f.js +1 -0
  462. package/.next/standalone/.next/static/chunks/{webpack-5bb5740df10ed622.js → webpack-87284a4533d77eaf.js} +1 -1
  463. package/.next/standalone/.next/static/css/{84edd78de243cde6.css → b496025c9cd768cc.css} +1 -1
  464. package/.next/standalone/.next/static/css/e78b3c856420a09f.css +1 -0
  465. package/.next/standalone/.next/static/media/013b72fa676f92e0-s.woff2 +0 -0
  466. package/.next/standalone/.next/static/media/2b5b02fc7e511755-s.woff2 +0 -0
  467. package/.next/standalone/.next/static/media/65f03d54ccadf4a8-s.woff2 +0 -0
  468. package/.next/standalone/.next/static/media/7d4881bb7e1bf84d-s.p.woff2 +0 -0
  469. package/.next/standalone/.next/static/media/b9408752a0c24fb9-s.woff2 +0 -0
  470. package/.next/standalone/.next/static/media/e038a29029a234f2-s.woff2 +0 -0
  471. package/.next/standalone/package.json +3 -1
  472. package/.next/standalone/public/chorus-plugin/.claude-plugin/plugin.json +1 -1
  473. package/.next/standalone/public/chorus-plugin/skills/brainstorm/SKILL.md +1 -1
  474. package/.next/standalone/public/chorus-plugin/skills/chorus/SKILL.md +1 -1
  475. package/.next/standalone/public/chorus-plugin/skills/develop/SKILL.md +1 -1
  476. package/.next/standalone/public/chorus-plugin/skills/idea/SKILL.md +2 -1
  477. package/.next/standalone/public/chorus-plugin/skills/openspec-aware/SKILL.md +1 -1
  478. package/.next/standalone/public/chorus-plugin/skills/proposal/SKILL.md +1 -1
  479. package/.next/standalone/public/chorus-plugin/skills/quick-dev/SKILL.md +1 -1
  480. package/.next/standalone/public/chorus-plugin/skills/review/SKILL.md +1 -1
  481. package/.next/standalone/public/chorus-plugin/skills/yolo/SKILL.md +1 -1
  482. package/.next/standalone/public/skill/brainstorm-chorus/SKILL.md +1 -1
  483. package/.next/standalone/public/skill/chorus/SKILL.md +1 -1
  484. package/.next/standalone/public/skill/develop-chorus/SKILL.md +1 -1
  485. package/.next/standalone/public/skill/idea-chorus/SKILL.md +2 -1
  486. package/.next/standalone/public/skill/package.json +1 -1
  487. package/.next/standalone/public/skill/proposal-chorus/SKILL.md +1 -1
  488. package/.next/standalone/public/skill/proposal-reviewer-chorus/SKILL.md +1 -1
  489. package/.next/standalone/public/skill/quick-dev-chorus/SKILL.md +1 -1
  490. package/.next/standalone/public/skill/review-chorus/SKILL.md +1 -1
  491. package/.next/standalone/public/skill/task-reviewer-chorus/SKILL.md +1 -1
  492. package/.next/standalone/public/skill/yolo-chorus/SKILL.md +1 -1
  493. package/README.md +27 -0
  494. package/README.zh.md +27 -0
  495. package/chorus.mjs +120 -16
  496. package/cli/backfill.mjs +190 -0
  497. package/cli/chorus-client.mjs +154 -0
  498. package/cli/claude-spawner.mjs +415 -0
  499. package/cli/client-args.mjs +146 -0
  500. package/cli/control-handler.mjs +180 -0
  501. package/cli/credentials.mjs +155 -0
  502. package/cli/daemon-agent.mjs +38 -0
  503. package/cli/daemon-banner.mjs +80 -0
  504. package/cli/daemon-config.mjs +84 -0
  505. package/cli/daemon-lifecycle.mjs +191 -0
  506. package/cli/daemon-permission-mode.mjs +68 -0
  507. package/cli/daemon-rest-client.mjs +272 -0
  508. package/cli/daemon.mjs +572 -0
  509. package/cli/event-router.mjs +248 -0
  510. package/cli/interrupt-reporter.mjs +87 -0
  511. package/cli/lineage.mjs +155 -0
  512. package/cli/login.mjs +151 -0
  513. package/cli/mcp-config.mjs +58 -0
  514. package/cli/process-killer.mjs +205 -0
  515. package/cli/prompts.mjs +273 -0
  516. package/cli/sse-listener.mjs +258 -0
  517. package/cli/turn-reporter.mjs +75 -0
  518. package/cli/upload-hooks.mjs +400 -0
  519. package/cli/wake-queue.mjs +121 -0
  520. package/cli/waker.mjs +475 -0
  521. package/package.json +3 -1
  522. package/prisma/migrations/20260615082309_add_daemon_connection/migration.sql +37 -0
  523. package/prisma/migrations/20260616152622_add_daemon_task_execution/migration.sql +28 -0
  524. package/prisma/migrations/20260617013334_generalize_daemon_execution_to_any_resource/migration.sql +38 -0
  525. package/prisma/migrations/20260618022828_add_daemon_execution_interrupted/migration.sql +2 -0
  526. package/prisma/migrations/20260619055322_daemon_session_conversation/migration.sql +77 -0
  527. package/prisma/schema.prisma +366 -188
  528. package/.next/standalone/.next/server/chunks/1059.js +0 -1
  529. package/.next/standalone/.next/server/chunks/1165.js +0 -1
  530. package/.next/standalone/.next/server/chunks/1615.js +0 -31
  531. package/.next/standalone/.next/server/chunks/162.js +0 -16
  532. package/.next/standalone/.next/server/chunks/179.js +0 -158
  533. package/.next/standalone/.next/server/chunks/1871.js +0 -1
  534. package/.next/standalone/.next/server/chunks/2909.js +0 -98
  535. package/.next/standalone/.next/server/chunks/324.js +0 -1
  536. package/.next/standalone/.next/server/chunks/3555.js +0 -1
  537. package/.next/standalone/.next/server/chunks/4090.js +0 -13
  538. package/.next/standalone/.next/server/chunks/4343.js +0 -1
  539. package/.next/standalone/.next/server/chunks/4879.js +0 -1
  540. package/.next/standalone/.next/server/chunks/4913.js +0 -1
  541. package/.next/standalone/.next/server/chunks/5541.js +0 -1
  542. package/.next/standalone/.next/server/chunks/5561.js +0 -7
  543. package/.next/standalone/.next/server/chunks/6643.js +0 -1
  544. package/.next/standalone/.next/server/chunks/6767.js +0 -1
  545. package/.next/standalone/.next/server/chunks/7228.js +0 -2
  546. package/.next/standalone/.next/server/chunks/7462.js +0 -255
  547. package/.next/standalone/.next/server/chunks/7859.js +0 -1
  548. package/.next/standalone/.next/server/chunks/8277.js +0 -1
  549. package/.next/standalone/.next/server/chunks/8637.js +0 -1
  550. package/.next/standalone/.next/server/chunks/896.js +0 -1
  551. package/.next/standalone/.next/server/chunks/9269.js +0 -1
  552. package/.next/standalone/.next/server/chunks/9615.js +0 -1
  553. package/.next/standalone/.next/static/AKJHlhCKd44_-khht8nN0/_buildManifest.js +0 -1
  554. package/.next/standalone/.next/static/chunks/20051-c242544dafd3a690.js +0 -1
  555. package/.next/standalone/.next/static/chunks/21932-bce5ba937d1603e1.js +0 -1
  556. package/.next/standalone/.next/static/chunks/23095-5bf481236249fdd8.js +0 -1
  557. package/.next/standalone/.next/static/chunks/23466-842c126491b753bc.js +0 -1
  558. package/.next/standalone/.next/static/chunks/45436-c5427023f3f386a1.js +0 -1
  559. package/.next/standalone/.next/static/chunks/49852-5337f139a2f87c46.js +0 -1
  560. package/.next/standalone/.next/static/chunks/52206-7c1b0c695c8035eb.js +0 -1
  561. package/.next/standalone/.next/static/chunks/55469-ed5ff019ff71ef59.js +0 -1
  562. package/.next/standalone/.next/static/chunks/59296-50e66102d44d9677.js +0 -1
  563. package/.next/standalone/.next/static/chunks/60524-9811b38c62fed16e.js +0 -1
  564. package/.next/standalone/.next/static/chunks/68855-5c15991e7cf8dc8a.js +0 -1
  565. package/.next/standalone/.next/static/chunks/70093-0ff6fd59445b5cb9.js +0 -1
  566. package/.next/standalone/.next/static/chunks/74030-3a6a6b75e47f5b96.js +0 -1
  567. package/.next/standalone/.next/static/chunks/78917-ff0fda86a96cfa60.js +0 -1
  568. package/.next/standalone/.next/static/chunks/95627-8d9f6d2d88f7a641.js +0 -1
  569. package/.next/standalone/.next/static/chunks/app/(dashboard)/layout-5915ccd1a77ebcf8.js +0 -1
  570. package/.next/standalone/.next/static/chunks/app/(dashboard)/project-groups/[uuid]/page-94d102d945410b55.js +0 -1
  571. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/dashboard/[ideaUuid]/page-cd9411c54c8f5b35.js +0 -1
  572. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/dashboard/page-56c45b910f914895.js +0 -1
  573. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/documents/[documentUuid]/page-2e000a7010d1e9ea.js +0 -1
  574. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/documents/page-75e42d130404ca2b.js +0 -1
  575. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/[proposalUuid]/page-d7747749ae6192d8.js +0 -1
  576. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/new/page-26488809d26e1daa.js +0 -1
  577. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/page-8f91ed174c14d5f0.js +0 -1
  578. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/tasks/[taskUuid]/page-fcc9baa42e6de4d4.js +0 -1
  579. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/tasks/page-5233748464280e9d.js +0 -1
  580. package/.next/standalone/.next/static/chunks/app/(dashboard)/settings/page-ab87cbb18d0ee538.js +0 -1
  581. package/.next/standalone/.next/static/chunks/app/api/admin/companies/[uuid]/route-cd9411c54c8f5b35.js +0 -1
  582. package/.next/standalone/.next/static/chunks/app/api/admin/companies/route-cd9411c54c8f5b35.js +0 -1
  583. package/.next/standalone/.next/static/chunks/app/api/admin/login/route-cd9411c54c8f5b35.js +0 -1
  584. package/.next/standalone/.next/static/chunks/app/api/admin/session/route-cd9411c54c8f5b35.js +0 -1
  585. package/.next/standalone/.next/static/chunks/app/api/agents/[uuid]/route-cd9411c54c8f5b35.js +0 -1
  586. package/.next/standalone/.next/static/chunks/app/api/agents/[uuid]/sessions/route-cd9411c54c8f5b35.js +0 -1
  587. package/.next/standalone/.next/static/chunks/app/api/agents/route-cd9411c54c8f5b35.js +0 -1
  588. package/.next/standalone/.next/static/chunks/app/api/api-keys/[uuid]/route-cd9411c54c8f5b35.js +0 -1
  589. package/.next/standalone/.next/static/chunks/app/api/api-keys/route-cd9411c54c8f5b35.js +0 -1
  590. package/.next/standalone/.next/static/chunks/app/api/auth/callback/route-cd9411c54c8f5b35.js +0 -1
  591. package/.next/standalone/.next/static/chunks/app/api/auth/check-default/route-cd9411c54c8f5b35.js +0 -1
  592. package/.next/standalone/.next/static/chunks/app/api/auth/company-oidc/route-cd9411c54c8f5b35.js +0 -1
  593. package/.next/standalone/.next/static/chunks/app/api/auth/default-login/route-cd9411c54c8f5b35.js +0 -1
  594. package/.next/standalone/.next/static/chunks/app/api/auth/identify/route-cd9411c54c8f5b35.js +0 -1
  595. package/.next/standalone/.next/static/chunks/app/api/auth/logout/route-cd9411c54c8f5b35.js +0 -1
  596. package/.next/standalone/.next/static/chunks/app/api/auth/me/route-cd9411c54c8f5b35.js +0 -1
  597. package/.next/standalone/.next/static/chunks/app/api/auth/refresh/route-cd9411c54c8f5b35.js +0 -1
  598. package/.next/standalone/.next/static/chunks/app/api/auth/session/route-cd9411c54c8f5b35.js +0 -1
  599. package/.next/standalone/.next/static/chunks/app/api/auth/sync-token/route-cd9411c54c8f5b35.js +0 -1
  600. package/.next/standalone/.next/static/chunks/app/api/comments/route-cd9411c54c8f5b35.js +0 -1
  601. package/.next/standalone/.next/static/chunks/app/api/documents/[uuid]/route-cd9411c54c8f5b35.js +0 -1
  602. package/.next/standalone/.next/static/chunks/app/api/events/notifications/route-cd9411c54c8f5b35.js +0 -1
  603. package/.next/standalone/.next/static/chunks/app/api/events/route-cd9411c54c8f5b35.js +0 -1
  604. package/.next/standalone/.next/static/chunks/app/api/health/route-cd9411c54c8f5b35.js +0 -1
  605. package/.next/standalone/.next/static/chunks/app/api/ideas/[uuid]/claim/route-cd9411c54c8f5b35.js +0 -1
  606. package/.next/standalone/.next/static/chunks/app/api/ideas/[uuid]/move/preview/route-cd9411c54c8f5b35.js +0 -1
  607. package/.next/standalone/.next/static/chunks/app/api/ideas/[uuid]/move/route-cd9411c54c8f5b35.js +0 -1
  608. package/.next/standalone/.next/static/chunks/app/api/ideas/[uuid]/parent/route-cd9411c54c8f5b35.js +0 -1
  609. package/.next/standalone/.next/static/chunks/app/api/ideas/[uuid]/release/route-cd9411c54c8f5b35.js +0 -1
  610. package/.next/standalone/.next/static/chunks/app/api/ideas/[uuid]/route-cd9411c54c8f5b35.js +0 -1
  611. package/.next/standalone/.next/static/chunks/app/api/mcp/route-cd9411c54c8f5b35.js +0 -1
  612. package/.next/standalone/.next/static/chunks/app/api/me/assignments/route-cd9411c54c8f5b35.js +0 -1
  613. package/.next/standalone/.next/static/chunks/app/api/mentionables/route-cd9411c54c8f5b35.js +0 -1
  614. package/.next/standalone/.next/static/chunks/app/api/notifications/[uuid]/archive/route-cd9411c54c8f5b35.js +0 -1
  615. package/.next/standalone/.next/static/chunks/app/api/notifications/[uuid]/read/route-cd9411c54c8f5b35.js +0 -1
  616. package/.next/standalone/.next/static/chunks/app/api/notifications/preferences/route-cd9411c54c8f5b35.js +0 -1
  617. package/.next/standalone/.next/static/chunks/app/api/notifications/read-all/route-cd9411c54c8f5b35.js +0 -1
  618. package/.next/standalone/.next/static/chunks/app/api/notifications/route-cd9411c54c8f5b35.js +0 -1
  619. package/.next/standalone/.next/static/chunks/app/api/notifications/unread-count/route-cd9411c54c8f5b35.js +0 -1
  620. package/.next/standalone/.next/static/chunks/app/api/project-groups/[uuid]/dashboard/route-cd9411c54c8f5b35.js +0 -1
  621. package/.next/standalone/.next/static/chunks/app/api/project-groups/[uuid]/route-cd9411c54c8f5b35.js +0 -1
  622. package/.next/standalone/.next/static/chunks/app/api/project-groups/route-cd9411c54c8f5b35.js +0 -1
  623. package/.next/standalone/.next/static/chunks/app/api/projects/[uuid]/activity/route-cd9411c54c8f5b35.js +0 -1
  624. package/.next/standalone/.next/static/chunks/app/api/projects/[uuid]/available/route-cd9411c54c8f5b35.js +0 -1
  625. package/.next/standalone/.next/static/chunks/app/api/projects/[uuid]/documents/route-cd9411c54c8f5b35.js +0 -1
  626. package/.next/standalone/.next/static/chunks/app/api/projects/[uuid]/group/route-cd9411c54c8f5b35.js +0 -1
  627. package/.next/standalone/.next/static/chunks/app/api/projects/[uuid]/ideas/route-cd9411c54c8f5b35.js +0 -1
  628. package/.next/standalone/.next/static/chunks/app/api/projects/[uuid]/ideas/tracker/route-cd9411c54c8f5b35.js +0 -1
  629. package/.next/standalone/.next/static/chunks/app/api/projects/[uuid]/proposals/[proposalUuid]/validate/route-cd9411c54c8f5b35.js +0 -1
  630. package/.next/standalone/.next/static/chunks/app/api/projects/[uuid]/proposals/route-cd9411c54c8f5b35.js +0 -1
  631. package/.next/standalone/.next/static/chunks/app/api/projects/[uuid]/proposals/summary/route-cd9411c54c8f5b35.js +0 -1
  632. package/.next/standalone/.next/static/chunks/app/api/projects/[uuid]/route-cd9411c54c8f5b35.js +0 -1
  633. package/.next/standalone/.next/static/chunks/app/api/projects/[uuid]/stats/route-cd9411c54c8f5b35.js +0 -1
  634. package/.next/standalone/.next/static/chunks/app/api/projects/[uuid]/tasks/dependencies/route-cd9411c54c8f5b35.js +0 -1
  635. package/.next/standalone/.next/static/chunks/app/api/projects/[uuid]/tasks/route-cd9411c54c8f5b35.js +0 -1
  636. package/.next/standalone/.next/static/chunks/app/api/projects/route-cd9411c54c8f5b35.js +0 -1
  637. package/.next/standalone/.next/static/chunks/app/api/proposals/[uuid]/approve/route-cd9411c54c8f5b35.js +0 -1
  638. package/.next/standalone/.next/static/chunks/app/api/proposals/[uuid]/close/route-cd9411c54c8f5b35.js +0 -1
  639. package/.next/standalone/.next/static/chunks/app/api/proposals/[uuid]/reject/route-cd9411c54c8f5b35.js +0 -1
  640. package/.next/standalone/.next/static/chunks/app/api/proposals/[uuid]/revoke/route-cd9411c54c8f5b35.js +0 -1
  641. package/.next/standalone/.next/static/chunks/app/api/proposals/[uuid]/route-cd9411c54c8f5b35.js +0 -1
  642. package/.next/standalone/.next/static/chunks/app/api/search/route-cd9411c54c8f5b35.js +0 -1
  643. package/.next/standalone/.next/static/chunks/app/api/sessions/[uuid]/route-cd9411c54c8f5b35.js +0 -1
  644. package/.next/standalone/.next/static/chunks/app/api/tasks/[uuid]/claim/route-cd9411c54c8f5b35.js +0 -1
  645. package/.next/standalone/.next/static/chunks/app/api/tasks/[uuid]/dependencies/[dependsOnUuid]/route-cd9411c54c8f5b35.js +0 -1
  646. package/.next/standalone/.next/static/chunks/app/api/tasks/[uuid]/dependencies/route-cd9411c54c8f5b35.js +0 -1
  647. package/.next/standalone/.next/static/chunks/app/api/tasks/[uuid]/release/route-cd9411c54c8f5b35.js +0 -1
  648. package/.next/standalone/.next/static/chunks/app/api/tasks/[uuid]/route-cd9411c54c8f5b35.js +0 -1
  649. package/.next/standalone/.next/static/chunks/app/api/tasks/[uuid]/sessions/route-cd9411c54c8f5b35.js +0 -1
  650. package/.next/standalone/.next/static/chunks/app/layout-482dee7dace72c88.js +0 -1
  651. package/.next/standalone/.next/static/chunks/app/onboarding/page-d9dbd817391b462b.js +0 -1
  652. package/.next/standalone/.next/static/css/4279f38594ac772a.css +0 -1
  653. package/.next/standalone/.next/static/media/0f1bdadaf30e2d5f-s.woff2 +0 -0
  654. package/.next/standalone/.next/static/media/2c34d62a75506231-s.woff2 +0 -0
  655. package/.next/standalone/.next/static/media/601f5c280d60caca-s.woff2 +0 -0
  656. package/.next/standalone/.next/static/media/a115172161b307bb-s.woff2 +0 -0
  657. package/.next/standalone/.next/static/media/d100b2a099e34044-s.woff2 +0 -0
  658. package/.next/standalone/.next/static/media/f5271587012faf78-s.p.woff2 +0 -0
  659. /package/.next/standalone/.next/static/{AKJHlhCKd44_-khht8nN0 → 519aK55QLHaVN7b1TVDkB}/_ssgManifest.js +0 -0
@@ -0,0 +1,154 @@
1
+ // cli/chorus-client.mjs
2
+ // Minimal MCP client for the Chorus CLI daemon's OWN calls into the server
3
+ // (login validation, notification backfill, lineage resolution). Reuses
4
+ // @modelcontextprotocol/sdk, already a top-level dependency — adds no new dep
5
+ // (CLAUDE.md pitfall #9). Plain ESM port of packages/openclaw-plugin/src/mcp-client.ts.
6
+ //
7
+ // This is the daemon's client to Chorus; it is NOT how the spawned Claude Code
8
+ // gets its chorus_* tools (that's wired via --mcp-config in the spawner task).
9
+
10
+ import { Client } from "@modelcontextprotocol/sdk/client/index.js";
11
+ import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
12
+
13
+ const NOOP_LOGGER = { info() {}, warn() {}, error() {} };
14
+
15
+ /**
16
+ * @typedef {Object} ChorusClientOptions
17
+ * @property {string} url Chorus base URL.
18
+ * @property {string} apiKey `cho_` API key.
19
+ * @property {{info(m:string):void,warn(m:string):void,error(m:string):void}} [logger]
20
+ */
21
+
22
+ export class ChorusClient {
23
+ /** @param {ChorusClientOptions} opts */
24
+ constructor(opts) {
25
+ this.url = opts.url;
26
+ this.apiKey = opts.apiKey;
27
+ this.logger = opts.logger ?? NOOP_LOGGER;
28
+ /** @type {Client | null} */
29
+ this.client = null;
30
+ /** @type {StreamableHTTPClientTransport | null} */
31
+ this.transport = null;
32
+ this.status = "disconnected";
33
+ }
34
+
35
+ /** Lazily establish the MCP connection. */
36
+ async connect() {
37
+ if (this.status === "connected" && this.client) return;
38
+ this.status = "connecting";
39
+ try {
40
+ this.transport = new StreamableHTTPClientTransport(new URL("/api/mcp", this.url), {
41
+ requestInit: { headers: { Authorization: `Bearer ${this.apiKey}` } },
42
+ });
43
+ this.client = new Client({ name: "chorus-cli-daemon", version: "0.1.0" });
44
+ await this.client.connect(this.transport);
45
+ this.status = "connected";
46
+ } catch (err) {
47
+ this.status = "disconnected";
48
+ this.client = null;
49
+ this.transport = null;
50
+ throw err;
51
+ }
52
+ }
53
+
54
+ /**
55
+ * Call an MCP tool, returning the first text content block parsed as JSON
56
+ * (or the raw text if not JSON). Lazy-connects; retries once on a stateless
57
+ * 404 / session-expired error.
58
+ * @param {string} name
59
+ * @param {Record<string, unknown>} [args]
60
+ * @returns {Promise<unknown>}
61
+ */
62
+ async callTool(name, args = {}) {
63
+ if (!this.client || this.status !== "connected") await this.connect();
64
+ try {
65
+ return await this.#doCallTool(name, args);
66
+ } catch (err) {
67
+ if (this.#isSessionExpired(err)) {
68
+ this.logger.warn("MCP session expired, reconnecting...");
69
+ this.status = "reconnecting";
70
+ this.client = null;
71
+ this.transport = null;
72
+ await this.connect();
73
+ return await this.#doCallTool(name, args);
74
+ }
75
+ throw err;
76
+ }
77
+ }
78
+
79
+ async disconnect() {
80
+ if (this.client) {
81
+ try {
82
+ await this.client.close();
83
+ } catch {
84
+ // ignore
85
+ }
86
+ }
87
+ this.client = null;
88
+ this.transport = null;
89
+ this.status = "disconnected";
90
+ }
91
+
92
+ /** @param {string} name @param {Record<string, unknown>} args */
93
+ async #doCallTool(name, args) {
94
+ if (!this.client) throw new Error("MCP client not connected");
95
+ const result = await this.client.callTool({ name, arguments: args });
96
+ const blocks = /** @type {Array<{type:string,text?:string}>} */ (result.content ?? []);
97
+ if (result.isError) {
98
+ const text = blocks.filter((c) => c.type === "text").map((c) => c.text).join("\n");
99
+ // Tool-LEVEL error (e.g. "Task not found"): the call reached the server
100
+ // and the tool ran — this is NOT a transport/session failure. Tag it so
101
+ // #isSessionExpired won't mistake its text (which may contain "not found")
102
+ // for a stateless-404 and trigger a pointless reconnect + retry.
103
+ const err = new Error(`Chorus MCP tool error (${name}): ${text}`);
104
+ /** @type {any} */ (err).isToolError = true;
105
+ throw err;
106
+ }
107
+ const textBlock = blocks.find((c) => c.type === "text");
108
+ if (!textBlock?.text) return null;
109
+ try {
110
+ return JSON.parse(textBlock.text);
111
+ } catch {
112
+ return textBlock.text;
113
+ }
114
+ }
115
+
116
+ /** @param {unknown} err */
117
+ #isSessionExpired(err) {
118
+ if (!(err instanceof Error)) return false;
119
+ // A tool-level error reached the server and ran — never a session/transport
120
+ // issue, so don't reconnect+retry on it (it'd fail identically).
121
+ if (/** @type {any} */ (err).isToolError) return false;
122
+ const m = err.message.toLowerCase();
123
+ // Stateless-404 / lost-transport signals only. "not found" is intentionally
124
+ // NOT matched on its own (too broad — collides with entity-not-found tool
125
+ // text); a transport 404 still contains "404".
126
+ return m.includes("404") || m.includes("session");
127
+ }
128
+ }
129
+
130
+ /**
131
+ * Validate a url + apiKey pair by calling `chorus_checkin` and reading the
132
+ * authenticated agent identity. Returns the identity on success; throws on
133
+ * failure (bad key, unreachable server, unexpected shape).
134
+ *
135
+ * @param {{ url: string, apiKey: string }} creds
136
+ * @param {{ makeClient?: (o: ChorusClientOptions) => ChorusClient }} [deps]
137
+ * @returns {Promise<{ uuid: string, name: string }>}
138
+ */
139
+ export async function validateAndFetchIdentity(creds, deps = {}) {
140
+ const makeClient = deps.makeClient ?? ((o) => new ChorusClient(o));
141
+ const client = makeClient({ url: creds.url, apiKey: creds.apiKey });
142
+ try {
143
+ const result = /** @type {{ agent?: { uuid?: string, name?: string } }} */ (
144
+ await client.callTool("chorus_checkin", {})
145
+ );
146
+ const agent = result?.agent;
147
+ if (!agent || typeof agent.uuid !== "string") {
148
+ throw new Error("Unexpected chorus_checkin response — no agent identity returned");
149
+ }
150
+ return { uuid: agent.uuid, name: typeof agent.name === "string" ? agent.name : agent.uuid };
151
+ } finally {
152
+ await client.disconnect();
153
+ }
154
+ }
@@ -0,0 +1,415 @@
1
+ // cli/claude-spawner.mjs
2
+ // Cross-platform headless Claude Code spawner. This is the load-bearing
3
+ // engineering point of the daemon: parsing stream-json is plain JS and
4
+ // platform-neutral; the real work is spawning, and it is all Windows.
5
+ //
6
+ // Verified against Claude Code CLI 2.1.177:
7
+ // • `-p/--print` + `--output-format stream-json` emits NDJSON (one JSON object
8
+ // per line); every line carries `session_id`.
9
+ // • `--session-id <uuid>` sets the session id for a fresh run, and
10
+ // `--resume <uuid>` continues it. So we GENERATE the session id client-side
11
+ // and pass it in, rather than scraping it from the init event — the id is
12
+ // authoritative on our side. We still read `session_id` from the stream as
13
+ // confirmation.
14
+ // • `--mcp-config <file>` loads MCP servers from a JSON file.
15
+ //
16
+ // The flag list lives in ONE place (buildArgs) so a CLI flag change is a
17
+ // single-line edit.
18
+ //
19
+ // HEADLESS SIGNAL (add-daemon-headless-interaction-guard): wake() spawns the child
20
+ // with CHORUS_DAEMON_HEADLESS=1 merged over the inherited env — a machine-checkable
21
+ // marker that this is a daemon-woken, no-human-at-the-terminal run. buildArgs is
22
+ // deliberately NOT changed (no --append-system-prompt): the headless behavior rule is
23
+ // carried per-turn by the wake-prompt preamble in prompts.mjs, not at the system level.
24
+
25
+ import { spawn } from "node:child_process";
26
+ import { existsSync, statSync } from "node:fs";
27
+ import { homedir } from "node:os";
28
+ import { win32 as pathWin32, posix as pathPosix, join as pathJoin } from "node:path";
29
+
30
+ const NOOP_LOGGER = { info() {}, warn() {}, error() {} };
31
+
32
+ /** Matches a canonical lowercase UUID (any version). Chorus idea uuids are v4. */
33
+ const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
34
+
35
+ /**
36
+ * True iff `id` is a well-formed, lowercase UUID. The daemon anchors the Claude
37
+ * session id on a Chorus idea uuid (already lowercase v4); we validate before
38
+ * spawn as a cheap guardrail so a malformed id surfaces visibly instead of
39
+ * failing opaquely inside claude (no-silent-errors).
40
+ * @param {unknown} id
41
+ * @returns {boolean}
42
+ */
43
+ export function isValidSessionId(id) {
44
+ return typeof id === "string" && UUID_RE.test(id);
45
+ }
46
+
47
+ /**
48
+ * Claude Code's transcript directory for a working directory. Verified against the
49
+ * live install: claude escapes the ABSOLUTE cwd by replacing both `/` and `.` with
50
+ * `-` (e.g. `/home/u/dev/ai-pm` → `-home-u-dev-ai-pm`,
51
+ * `/home/u/.cfg/x` → `-home-u--cfg-x`). On Windows the separators/drive differ, so
52
+ * we escape backslashes and colons too; the rule there is best-effort and must be
53
+ * re-verified against a Windows claude before claiming Windows resume support.
54
+ * @param {string} cwd Absolute working directory.
55
+ * @param {NodeJS.Platform} [platform]
56
+ * @returns {string}
57
+ */
58
+ export function escapeCwd(cwd, platform = process.platform) {
59
+ // Replace path separators and dots with `-`. On POSIX that's `/` and `.`; on
60
+ // Windows also `\` and the drive-colon. Collapsing both `/` and `.` is what
61
+ // produces the verified double-dash on a leading-dot segment.
62
+ const re = platform === "win32" ? /[\\/.:]/g : /[/.]/g;
63
+ return cwd.replace(re, "-");
64
+ }
65
+
66
+ /**
67
+ * The on-disk transcript path for a session id under a given cwd:
68
+ * <configDir>/projects/<cwd-escaped>/<sessionId>.jsonl
69
+ * `<configDir>` honors CLAUDE_CONFIG_DIR (falling back to ~/.claude), matching
70
+ * Claude Code. Used to decide --session-id (absent) vs --resume (present).
71
+ * @param {string} sessionId @param {string} cwd
72
+ * @param {{ env?: NodeJS.ProcessEnv, platform?: NodeJS.Platform, home?: string }} [deps]
73
+ * @returns {string}
74
+ */
75
+ export function transcriptPath(sessionId, cwd, deps = {}) {
76
+ const env = deps.env ?? process.env;
77
+ const platform = deps.platform ?? process.platform;
78
+ const configDir = env.CLAUDE_CONFIG_DIR || pathJoin(deps.home ?? homedir(), ".claude");
79
+ return pathJoin(configDir, "projects", escapeCwd(cwd, platform), `${sessionId}.jsonl`);
80
+ }
81
+
82
+ /**
83
+ * Decide whether a wake for `sessionId` in `cwd` is a NEW session (`--session-id`)
84
+ * or a RESUME (`--resume`), by probing whether the transcript file already exists.
85
+ * The disk is the source of truth `claude --resume` itself consults, so the probe
86
+ * is stateless and survives daemon restarts. This layout is Claude Code-specific.
87
+ * @param {string} sessionId @param {string} cwd
88
+ * @param {{ env?: NodeJS.ProcessEnv, platform?: NodeJS.Platform, home?: string, exists?: (p: string) => boolean }} [deps]
89
+ * @returns {boolean} true → new session; false → resume an existing one.
90
+ */
91
+ export function isNewSession(sessionId, cwd, deps = {}) {
92
+ const exists = deps.exists ?? existsSync;
93
+ return !exists(transcriptPath(sessionId, cwd, deps));
94
+ }
95
+
96
+ /**
97
+ * Resolve the real `claude` executable path WITHOUT a shell. On Windows the bin
98
+ * is `claude.cmd` (npm shim); `spawn("claude")` without `shell:true` throws
99
+ * ENOENT because it won't resolve `.cmd`. We walk PATH for the platform's
100
+ * candidate names and return the first that exists. `shell:true` is avoided
101
+ * deliberately — it re-introduces the escaping/injection surface.
102
+ *
103
+ * @param {{ env?: NodeJS.ProcessEnv, platform?: NodeJS.Platform, isFile?: (p: string) => boolean }} [deps]
104
+ * @returns {string | null}
105
+ */
106
+ export function resolveClaudePath(deps = {}) {
107
+ const env = deps.env ?? process.env;
108
+ const platform = deps.platform ?? process.platform;
109
+ const isFile =
110
+ deps.isFile ??
111
+ ((p) => {
112
+ // isFile (not just exists): a directory named `claude` on PATH would
113
+ // otherwise be "found" and then fail at spawn time.
114
+ try {
115
+ return statSync(p).isFile();
116
+ } catch {
117
+ return false;
118
+ }
119
+ });
120
+
121
+ // An explicit override always wins (set by the daemon if the user configured it).
122
+ if (env.CHORUS_CLAUDE_PATH && isFile(env.CHORUS_CLAUDE_PATH)) {
123
+ return env.CHORUS_CLAUDE_PATH;
124
+ }
125
+
126
+ // Use platform-correct path semantics so the resolver is testable for
127
+ // Windows from a POSIX host (`;` delimiter + `\` join vs `:` + `/`).
128
+ const isWin = platform === "win32";
129
+ const p = isWin ? pathWin32 : pathPosix;
130
+ const names = isWin ? ["claude.cmd", "claude.exe", "claude"] : ["claude"];
131
+ const pathVar = env.PATH || env.Path || "";
132
+ const dirs = pathVar.split(p.delimiter).filter(Boolean);
133
+ for (const dir of dirs) {
134
+ for (const name of names) {
135
+ const candidate = p.join(dir, name);
136
+ if (isFile(candidate)) return candidate;
137
+ }
138
+ }
139
+ return null;
140
+ }
141
+
142
+ /**
143
+ * The MCP server name the daemon writes into --mcp-config (see mcp-config.mjs).
144
+ * Claude namespaces its tools as `mcp__<serverName>__<tool>`, so this drives the
145
+ * default allowlist below. Keep in sync with mcp-config.mjs's `mcpServers` key.
146
+ */
147
+ export const CHORUS_MCP_SERVER_NAME = "chorus";
148
+
149
+ /**
150
+ * Permission posture for the spawned headless Claude. Headless `claude -p`
151
+ * auto-DENIES any tool that isn't pre-approved (there's no interactive prompt to
152
+ * answer), so without one of these the woken agent can't call a single chorus_*
153
+ * tool and exits having done nothing. Verified against Claude Code 2.1.177.
154
+ *
155
+ * - "chorus" (default): `--allowedTools "mcp__chorus__*"` — the woken agent may
156
+ * use Chorus MCP tools (comment, claim, report, status) but NOT Bash / file
157
+ * edits. Safe default: covers comment/assign/elaboration wakes out of the box,
158
+ * minimal blast radius.
159
+ * - "yolo": `--dangerously-skip-permissions` — full autonomy (Bash, file writes,
160
+ * everything). Needed for real code-writing AI-DLC work. Dangerous: the woken
161
+ * agent gets a full shell under the daemon's key, with a prompt that embeds
162
+ * server-supplied strings. Use only in a trusted/sandboxed environment.
163
+ * @typedef {"chorus"|"yolo"} PermissionMode
164
+ */
165
+
166
+ /**
167
+ * Build the argv for a headless run. Prompt is NEVER here — it goes over stdin.
168
+ * @param {{ sessionId: string, isNew: boolean, mcpConfigPath?: string, permissionMode?: PermissionMode }} o
169
+ * @returns {string[]}
170
+ */
171
+ export function buildArgs({ sessionId, isNew, mcpConfigPath, permissionMode = "chorus" }) {
172
+ const args = ["-p", "--output-format", "stream-json", "--verbose"];
173
+ if (isNew) args.push("--session-id", sessionId);
174
+ else args.push("--resume", sessionId);
175
+ if (mcpConfigPath) args.push("--mcp-config", mcpConfigPath);
176
+ if (permissionMode === "yolo") {
177
+ args.push("--dangerously-skip-permissions");
178
+ } else {
179
+ // Default: allow only this daemon's Chorus MCP tools through, nothing else.
180
+ args.push("--allowedTools", `mcp__${CHORUS_MCP_SERVER_NAME}__*`);
181
+ }
182
+ return args;
183
+ }
184
+
185
+ /**
186
+ * Resolve the actual command + argv to spawn, given the resolved claude path
187
+ * and the headless args. On Windows a `.cmd`/`.bat` shim is NOT a PE executable,
188
+ * so `CreateProcess` (i.e. spawn with shell:false) cannot run it directly — it
189
+ * must be invoked through `cmd.exe /d /s /c <path> ...args`. We keep shell:false
190
+ * and pass argv as an array (no string concatenation), so there is no shell
191
+ * word-splitting / injection surface. On POSIX, and for a real `.exe`, we spawn
192
+ * the path directly.
193
+ *
194
+ * @param {string} claudePath
195
+ * @param {string[]} args
196
+ * @param {NodeJS.Platform} [platform]
197
+ * @param {NodeJS.ProcessEnv} [env]
198
+ * @returns {{ command: string, argv: string[] }}
199
+ */
200
+ export function resolveSpawnCommand(claudePath, args, platform = process.platform, env = process.env) {
201
+ const isWin = platform === "win32";
202
+ const lower = claudePath.toLowerCase();
203
+ if (isWin && (lower.endsWith(".cmd") || lower.endsWith(".bat"))) {
204
+ const comspec = env.ComSpec || env.COMSPEC || "cmd.exe";
205
+ // /d skip AutoRun, /s treat everything after /c literally, /c run then exit.
206
+ return { command: comspec, argv: ["/d", "/s", "/c", claudePath, ...args] };
207
+ }
208
+ return { command: claudePath, argv: args };
209
+ }
210
+
211
+ /**
212
+ * Parse a chunk of NDJSON, appending to a line buffer. Strips trailing CR
213
+ * (Windows \r\n) and ignores blank lines. Returns parsed objects; malformed
214
+ * lines are reported to `onWarn` and skipped (never throw).
215
+ *
216
+ * @param {string} buffer Carry-over from previous chunk.
217
+ * @param {string} chunk
218
+ * @param {(obj: any) => void} onObject
219
+ * @param {(msg: string) => void} [onWarn]
220
+ * @returns {string} New carry-over buffer (incomplete trailing line).
221
+ */
222
+ export function parseNdjsonChunk(buffer, chunk, onObject, onWarn = () => {}) {
223
+ buffer += chunk;
224
+ let nl;
225
+ while ((nl = buffer.indexOf("\n")) !== -1) {
226
+ const line = buffer.slice(0, nl).replace(/\r$/, "");
227
+ buffer = buffer.slice(nl + 1);
228
+ if (!line.trim()) continue;
229
+ try {
230
+ onObject(JSON.parse(line));
231
+ } catch (err) {
232
+ onWarn(`stream-json parse error: ${err} — line: ${line}`);
233
+ }
234
+ }
235
+ return buffer;
236
+ }
237
+
238
+ /**
239
+ * @typedef {Object} ClaudeSpawnerOptions
240
+ * @property {string} [claudePath] Resolved claude path (resolved lazily if omitted).
241
+ * @property {(o: object) => { stdin: any, stdout: any, stderr: any, on: Function, kill?: Function }} [spawnImpl]
242
+ * @property {{info(m:string):void,warn(m:string):void,error(m:string):void}} [logger]
243
+ * @property {PermissionMode} [permissionMode] How much the woken Claude may do (default "chorus").
244
+ * @property {NodeJS.Platform} [platform] Injectable for tests; gates `detached` (POSIX-only).
245
+ */
246
+
247
+ export class ClaudeSpawner {
248
+ /** @param {ClaudeSpawnerOptions} [opts] */
249
+ constructor(opts = {}) {
250
+ this.claudePath = opts.claudePath ?? null;
251
+ this.spawnImpl = opts.spawnImpl ?? spawn;
252
+ this.logger = opts.logger ?? NOOP_LOGGER;
253
+ this.permissionMode = opts.permissionMode ?? "chorus";
254
+ // POSIX spawns `detached: true` (process-group leader) so the interrupt path
255
+ // can group-kill the tree; Windows does not. Injectable so a POSIX test host
256
+ // can exercise the Windows branch and vice versa.
257
+ this.platform = opts.platform ?? process.platform;
258
+ }
259
+
260
+ /**
261
+ * Spawn a headless Claude run. Resolves when the subprocess exits. The prompt
262
+ * is written to stdin (never argv) — this is what keeps long prompts off the
263
+ * Windows command line and out of shell escaping/injection.
264
+ *
265
+ * The session id is supplied by the caller (the daemon passes the dispatched
266
+ * entity's DIRECT idea uuid, so the session is human-resumable by idea uuid) and
267
+ * MUST be a well-formed lowercase UUID — an invalid id is refused with a visible
268
+ * log and NO spawn (no-silent-errors). `isNew` (decided by the caller via a disk
269
+ * probe — see isNewSession) selects --session-id (new) vs --resume (continue).
270
+ * `cwd` is the spawn working directory; it MUST match the cwd the caller probed,
271
+ * since claude scopes transcripts (and --resume) to it.
272
+ *
273
+ * @param {{ prompt: string, sessionId: string, isNew: boolean, mcpConfigPath?: string,
274
+ * cwd?: string, onMessage?: (obj: any) => void,
275
+ * onChild?: (child: import("node:child_process").ChildProcess) => void }} params
276
+ * `onChild` (子3) hands the live ChildProcess to the caller the moment it spawns,
277
+ * so the waker can store the handle in its execution registry for the interrupt
278
+ * path BEFORE this promise resolves. It is invoked once, synchronously, only on a
279
+ * successful spawn; a spawn failure never calls it.
280
+ * @returns {Promise<{ sessionId: string, exitCode: number|null, isNew: boolean }>}
281
+ */
282
+ async wake({ prompt, sessionId, isNew, mcpConfigPath, cwd, onMessage, onChild }) {
283
+ const id = sessionId;
284
+
285
+ // Pre-validate the session id BEFORE locating claude or spawning: a malformed
286
+ // id (not a lowercase UUID) is refused visibly with no subprocess started.
287
+ if (!isValidSessionId(id)) {
288
+ this.logger.error(
289
+ `[Chorus] refusing to spawn: session id is not a valid lowercase UUID: ${id}`
290
+ );
291
+ return { sessionId: typeof id === "string" ? id : "", exitCode: null, isNew: Boolean(isNew) };
292
+ }
293
+
294
+ const claudePath = this.claudePath ?? resolveClaudePath();
295
+ if (!claudePath) {
296
+ // No crash — surface visibly and resolve with a failure result.
297
+ this.logger.error("[Chorus] cannot locate the `claude` executable on PATH; skipping wake");
298
+ return { sessionId: id, exitCode: null, isNew };
299
+ }
300
+
301
+ const args = buildArgs({ sessionId: id, isNew, mcpConfigPath, permissionMode: this.permissionMode });
302
+ // On Windows, a .cmd/.bat shim must be run via cmd.exe /c (CreateProcess
303
+ // can't exec a script directly). resolveSpawnCommand keeps shell:false and
304
+ // passes argv as an array — no shell injection surface either way.
305
+ const { command, argv } = resolveSpawnCommand(claudePath, args);
306
+
307
+ // POSIX: spawn `detached: true` so the child becomes a PROCESS GROUP LEADER
308
+ // (its pgid === its pid). The interrupt path then signals the whole group via
309
+ // `process.kill(-pid, sig)` so a forceful kill reaches grandchildren Claude may
310
+ // have spawned (子3 — daemon-interrupt-resume). This changes ONLY the process
311
+ // group: stdin/stdout/stderr stay piped exactly as before (stdio is unchanged),
312
+ // so prompt delivery over stdin and NDJSON stdout parsing are unaffected. We do
313
+ // NOT call `subprocess.unref()` — the daemon must stay attached to read the
314
+ // stream and observe the exit. On Windows `detached` is NOT used: taskkill /T
315
+ // walks the tree by pid, and detached there only spawns a new console window.
316
+ const detached = (this.platform ?? process.platform) !== "win32";
317
+
318
+ return new Promise((resolve) => {
319
+ let child;
320
+ try {
321
+ child = this.spawnImpl(command, argv, {
322
+ cwd: cwd ?? process.cwd(),
323
+ stdio: ["pipe", "pipe", "pipe"],
324
+ // Mark the child as a headless daemon-woken session (add-daemon-headless-
325
+ // interaction-guard). Merged OVER the inherited env so PATH, the Bedrock /
326
+ // credential vars, CLAUDE_CONFIG_DIR, etc. all survive — only this one var is
327
+ // added. It is a machine-checkable signal (the wake prompt also states it in
328
+ // text); this change only LAYS IT DOWN — no code here reads it back. Set
329
+ // unconditionally: the spawner only ever runs headless daemon wakes, so both
330
+ // "chorus" and "yolo" permission modes get it.
331
+ env: { ...process.env, CHORUS_DAEMON_HEADLESS: "1" },
332
+ // No shell:true — command is either the real executable or cmd.exe
333
+ // with the script as an argv element. Avoids shell word-splitting /
334
+ // injection; .cmd is handled explicitly via cmd.exe above.
335
+ shell: false,
336
+ detached,
337
+ windowsHide: true,
338
+ });
339
+ } catch (err) {
340
+ this.logger.error(`[Chorus] failed to spawn claude: ${err}`);
341
+ resolve({ sessionId: id, exitCode: null, isNew });
342
+ return;
343
+ }
344
+
345
+ // Hand the live child to the caller (子3) so the waker can register the handle
346
+ // for the interrupt path before this promise resolves. Never let a throwing
347
+ // callback escape into the spawn path.
348
+ if (onChild) {
349
+ try {
350
+ onChild(child);
351
+ } catch (err) {
352
+ this.logger.warn(`[Chorus] onChild handler threw: ${err}`);
353
+ }
354
+ }
355
+
356
+ let stdoutBuf = "";
357
+ let observedSessionId = id;
358
+
359
+ child.stdout?.setEncoding?.("utf8");
360
+ child.stdout?.on("data", (chunk) => {
361
+ stdoutBuf = parseNdjsonChunk(
362
+ stdoutBuf,
363
+ String(chunk),
364
+ (obj) => {
365
+ if (obj && typeof obj.session_id === "string") observedSessionId = obj.session_id;
366
+ if (onMessage) {
367
+ try {
368
+ onMessage(obj);
369
+ } catch (err) {
370
+ this.logger.warn(`[Chorus] onMessage handler threw: ${err}`);
371
+ }
372
+ }
373
+ },
374
+ (msg) => this.logger.warn(`[Chorus] ${msg}`)
375
+ );
376
+ });
377
+
378
+ child.stderr?.setEncoding?.("utf8");
379
+ child.stderr?.on("data", (chunk) => {
380
+ const text = String(chunk).trim();
381
+ if (text) this.logger.warn(`[Chorus] claude stderr: ${text}`);
382
+ });
383
+
384
+ child.on("error", (err) => {
385
+ // e.g. ENOENT if the resolved path vanished — log, don't throw.
386
+ this.logger.error(`[Chorus] claude process error: ${err}`);
387
+ resolve({ sessionId: observedSessionId, exitCode: null, isNew });
388
+ });
389
+
390
+ child.on("close", (code) => {
391
+ if (code !== 0) {
392
+ this.logger.warn(`[Chorus] claude exited with code ${code}`);
393
+ }
394
+ resolve({ sessionId: observedSessionId, exitCode: code, isNew });
395
+ });
396
+
397
+ // Guard against an ASYNC stdin error (EPIPE): if claude exits/closes
398
+ // stdin before the prompt finishes flushing, the writable emits an
399
+ // 'error' event. Without this listener it becomes an uncaughtException
400
+ // and crashes the daemon — violating "one failed wake does not kill the
401
+ // daemon". The try/catch below only catches a synchronous throw.
402
+ child.stdin?.on?.("error", (err) => {
403
+ this.logger.warn(`[Chorus] claude stdin error (ignored): ${err}`);
404
+ });
405
+
406
+ // Feed the prompt over stdin, then close it so the model runs.
407
+ try {
408
+ child.stdin?.write(prompt);
409
+ child.stdin?.end();
410
+ } catch (err) {
411
+ this.logger.warn(`[Chorus] failed writing prompt to claude stdin: ${err}`);
412
+ }
413
+ });
414
+ }
415
+ }