@chorus-aidlc/chorus 0.16.3 → 0.17.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 (355) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/app-build-manifest.json +445 -445
  3. package/.next/standalone/.next/app-path-routes-manifest.json +54 -54
  4. package/.next/standalone/.next/build-manifest.json +5 -5
  5. package/.next/standalone/.next/prerender-manifest.json +42 -42
  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_client-reference-manifest.js +1 -1
  18. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/documents/page.js +2 -2
  19. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/documents/page_client-reference-manifest.js +1 -1
  20. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/graph/page.js +2 -2
  21. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/graph/page.js.nft.json +1 -1
  22. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/graph/page_client-reference-manifest.js +1 -1
  23. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/[proposalUuid]/page.js +2 -2
  24. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/[proposalUuid]/page.js.nft.json +1 -1
  25. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/[proposalUuid]/page_client-reference-manifest.js +1 -1
  26. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/new/page.js +1 -1
  27. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/new/page_client-reference-manifest.js +1 -1
  28. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/page.js +2 -2
  29. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/page_client-reference-manifest.js +1 -1
  30. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/[taskUuid]/page.js +1 -1
  31. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/[taskUuid]/page.js.nft.json +1 -1
  32. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/[taskUuid]/page_client-reference-manifest.js +1 -1
  33. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/page.js +1 -1
  34. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/page.js.nft.json +1 -1
  35. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/page_client-reference-manifest.js +1 -1
  36. package/.next/standalone/.next/server/app/(dashboard)/projects/page.js +1 -1
  37. package/.next/standalone/.next/server/app/(dashboard)/projects/page.js.nft.json +1 -1
  38. package/.next/standalone/.next/server/app/(dashboard)/projects/page_client-reference-manifest.js +1 -1
  39. package/.next/standalone/.next/server/app/(dashboard)/settings/page.js +2 -2
  40. package/.next/standalone/.next/server/app/(dashboard)/settings/page.js.nft.json +1 -1
  41. package/.next/standalone/.next/server/app/(dashboard)/settings/page_client-reference-manifest.js +1 -1
  42. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  43. package/.next/standalone/.next/server/app/_not-found.html +2 -2
  44. package/.next/standalone/.next/server/app/_not-found.rsc +1 -1
  45. package/.next/standalone/.next/server/app/admin/companies/[uuid]/page_client-reference-manifest.js +1 -1
  46. package/.next/standalone/.next/server/app/admin/companies/new/page_client-reference-manifest.js +1 -1
  47. package/.next/standalone/.next/server/app/admin/companies/new.html +2 -2
  48. package/.next/standalone/.next/server/app/admin/companies/new.rsc +1 -1
  49. package/.next/standalone/.next/server/app/admin/companies/page_client-reference-manifest.js +1 -1
  50. package/.next/standalone/.next/server/app/admin/companies.html +2 -2
  51. package/.next/standalone/.next/server/app/admin/companies.rsc +1 -1
  52. package/.next/standalone/.next/server/app/admin/page_client-reference-manifest.js +1 -1
  53. package/.next/standalone/.next/server/app/admin.html +2 -2
  54. package/.next/standalone/.next/server/app/admin.rsc +1 -1
  55. package/.next/standalone/.next/server/app/api/admin/companies/[uuid]/route_client-reference-manifest.js +1 -1
  56. package/.next/standalone/.next/server/app/api/admin/companies/route_client-reference-manifest.js +1 -1
  57. package/.next/standalone/.next/server/app/api/admin/login/route_client-reference-manifest.js +1 -1
  58. package/.next/standalone/.next/server/app/api/admin/session/route_client-reference-manifest.js +1 -1
  59. package/.next/standalone/.next/server/app/api/agent-connections/route_client-reference-manifest.js +1 -1
  60. package/.next/standalone/.next/server/app/api/agents/[uuid]/route_client-reference-manifest.js +1 -1
  61. package/.next/standalone/.next/server/app/api/agents/[uuid]/sessions/route_client-reference-manifest.js +1 -1
  62. package/.next/standalone/.next/server/app/api/agents/route_client-reference-manifest.js +1 -1
  63. package/.next/standalone/.next/server/app/api/api-keys/[uuid]/route_client-reference-manifest.js +1 -1
  64. package/.next/standalone/.next/server/app/api/api-keys/route_client-reference-manifest.js +1 -1
  65. package/.next/standalone/.next/server/app/api/auth/callback/route_client-reference-manifest.js +1 -1
  66. package/.next/standalone/.next/server/app/api/auth/check-default/route_client-reference-manifest.js +1 -1
  67. package/.next/standalone/.next/server/app/api/auth/company-oidc/route_client-reference-manifest.js +1 -1
  68. package/.next/standalone/.next/server/app/api/auth/default-login/route_client-reference-manifest.js +1 -1
  69. package/.next/standalone/.next/server/app/api/auth/identify/route_client-reference-manifest.js +1 -1
  70. package/.next/standalone/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  71. package/.next/standalone/.next/server/app/api/auth/me/route_client-reference-manifest.js +1 -1
  72. package/.next/standalone/.next/server/app/api/auth/sync-token/route_client-reference-manifest.js +1 -1
  73. package/.next/standalone/.next/server/app/api/comments/route_client-reference-manifest.js +1 -1
  74. package/.next/standalone/.next/server/app/api/daemon/connection-heartbeat/route_client-reference-manifest.js +1 -1
  75. package/.next/standalone/.next/server/app/api/daemon/control/route_client-reference-manifest.js +1 -1
  76. package/.next/standalone/.next/server/app/api/daemon/directory-request/report/route_client-reference-manifest.js +1 -1
  77. package/.next/standalone/.next/server/app/api/daemon/execution-state/route_client-reference-manifest.js +1 -1
  78. package/.next/standalone/.next/server/app/api/daemon/executions/route_client-reference-manifest.js +1 -1
  79. package/.next/standalone/.next/server/app/api/daemon/pending-turns/route_client-reference-manifest.js +1 -1
  80. package/.next/standalone/.next/server/app/api/daemon/report-interrupt/route_client-reference-manifest.js +1 -1
  81. package/.next/standalone/.next/server/app/api/daemon/resume/route_client-reference-manifest.js +1 -1
  82. package/.next/standalone/.next/server/app/api/daemon/transcript/route_client-reference-manifest.js +1 -1
  83. package/.next/standalone/.next/server/app/api/daemon/turn-advance/route.js +1 -1
  84. package/.next/standalone/.next/server/app/api/daemon/turn-advance/route_client-reference-manifest.js +1 -1
  85. package/.next/standalone/.next/server/app/api/daemon-directory-requests/[uuid]/route_client-reference-manifest.js +1 -1
  86. package/.next/standalone/.next/server/app/api/daemon-directory-requests/route_client-reference-manifest.js +1 -1
  87. package/.next/standalone/.next/server/app/api/daemon-sessions/[sessionUuid]/instruction/route_client-reference-manifest.js +1 -1
  88. package/.next/standalone/.next/server/app/api/daemon-sessions/[sessionUuid]/repoint/route_client-reference-manifest.js +1 -1
  89. package/.next/standalone/.next/server/app/api/daemon-sessions/[sessionUuid]/route_client-reference-manifest.js +1 -1
  90. package/.next/standalone/.next/server/app/api/daemon-sessions/ad-hoc/route_client-reference-manifest.js +1 -1
  91. package/.next/standalone/.next/server/app/api/daemon-sessions/route_client-reference-manifest.js +1 -1
  92. package/.next/standalone/.next/server/app/api/documents/[uuid]/route_client-reference-manifest.js +1 -1
  93. package/.next/standalone/.next/server/app/api/entities/[type]/[uuid]/root-idea/route_client-reference-manifest.js +1 -1
  94. package/.next/standalone/.next/server/app/api/events/notifications/route_client-reference-manifest.js +1 -1
  95. package/.next/standalone/.next/server/app/api/events/route_client-reference-manifest.js +1 -1
  96. package/.next/standalone/.next/server/app/api/health/route_client-reference-manifest.js +1 -1
  97. package/.next/standalone/.next/server/app/api/ideas/[uuid]/claim/route_client-reference-manifest.js +1 -1
  98. package/.next/standalone/.next/server/app/api/ideas/[uuid]/move/preview/route_client-reference-manifest.js +1 -1
  99. package/.next/standalone/.next/server/app/api/ideas/[uuid]/move/route_client-reference-manifest.js +1 -1
  100. package/.next/standalone/.next/server/app/api/ideas/[uuid]/parent/route_client-reference-manifest.js +1 -1
  101. package/.next/standalone/.next/server/app/api/ideas/[uuid]/release/route_client-reference-manifest.js +1 -1
  102. package/.next/standalone/.next/server/app/api/ideas/[uuid]/route_client-reference-manifest.js +1 -1
  103. package/.next/standalone/.next/server/app/api/ideas/[uuid]/wake-preview/route_client-reference-manifest.js +1 -1
  104. package/.next/standalone/.next/server/app/api/ideas/conversational/route_client-reference-manifest.js +1 -1
  105. package/.next/standalone/.next/server/app/api/mcp/route.js +3 -3
  106. package/.next/standalone/.next/server/app/api/mcp/route_client-reference-manifest.js +1 -1
  107. package/.next/standalone/.next/server/app/api/me/assignments/route.js +1 -1
  108. package/.next/standalone/.next/server/app/api/me/assignments/route_client-reference-manifest.js +1 -1
  109. package/.next/standalone/.next/server/app/api/mentionables/route_client-reference-manifest.js +1 -1
  110. package/.next/standalone/.next/server/app/api/notifications/[uuid]/archive/route_client-reference-manifest.js +1 -1
  111. package/.next/standalone/.next/server/app/api/notifications/[uuid]/read/route_client-reference-manifest.js +1 -1
  112. package/.next/standalone/.next/server/app/api/notifications/preferences/route_client-reference-manifest.js +1 -1
  113. package/.next/standalone/.next/server/app/api/notifications/read-all/route_client-reference-manifest.js +1 -1
  114. package/.next/standalone/.next/server/app/api/notifications/route_client-reference-manifest.js +1 -1
  115. package/.next/standalone/.next/server/app/api/notifications/unread-count/route_client-reference-manifest.js +1 -1
  116. package/.next/standalone/.next/server/app/api/project-groups/[uuid]/dashboard/route_client-reference-manifest.js +1 -1
  117. package/.next/standalone/.next/server/app/api/project-groups/[uuid]/route_client-reference-manifest.js +1 -1
  118. package/.next/standalone/.next/server/app/api/project-groups/route_client-reference-manifest.js +1 -1
  119. package/.next/standalone/.next/server/app/api/project-visits/pin/route_client-reference-manifest.js +1 -1
  120. package/.next/standalone/.next/server/app/api/project-visits/route_client-reference-manifest.js +1 -1
  121. package/.next/standalone/.next/server/app/api/project-visits/visit/route_client-reference-manifest.js +1 -1
  122. package/.next/standalone/.next/server/app/api/projects/[uuid]/activity/route_client-reference-manifest.js +1 -1
  123. package/.next/standalone/.next/server/app/api/projects/[uuid]/agent-cwds/route_client-reference-manifest.js +1 -1
  124. package/.next/standalone/.next/server/app/api/projects/[uuid]/available/route.js +1 -1
  125. package/.next/standalone/.next/server/app/api/projects/[uuid]/available/route_client-reference-manifest.js +1 -1
  126. package/.next/standalone/.next/server/app/api/projects/[uuid]/documents/route_client-reference-manifest.js +1 -1
  127. package/.next/standalone/.next/server/app/api/projects/[uuid]/group/route_client-reference-manifest.js +1 -1
  128. package/.next/standalone/.next/server/app/api/projects/[uuid]/ideas/route_client-reference-manifest.js +1 -1
  129. package/.next/standalone/.next/server/app/api/projects/[uuid]/ideas/tracker/route_client-reference-manifest.js +1 -1
  130. package/.next/standalone/.next/server/app/api/projects/[uuid]/proposals/[proposalUuid]/validate/route_client-reference-manifest.js +1 -1
  131. package/.next/standalone/.next/server/app/api/projects/[uuid]/proposals/route_client-reference-manifest.js +1 -1
  132. package/.next/standalone/.next/server/app/api/projects/[uuid]/proposals/summary/route_client-reference-manifest.js +1 -1
  133. package/.next/standalone/.next/server/app/api/projects/[uuid]/resource-graph/route_client-reference-manifest.js +1 -1
  134. package/.next/standalone/.next/server/app/api/projects/[uuid]/route_client-reference-manifest.js +1 -1
  135. package/.next/standalone/.next/server/app/api/projects/[uuid]/stats/route_client-reference-manifest.js +1 -1
  136. package/.next/standalone/.next/server/app/api/projects/[uuid]/tasks/dependencies/route_client-reference-manifest.js +1 -1
  137. package/.next/standalone/.next/server/app/api/projects/[uuid]/tasks/route_client-reference-manifest.js +1 -1
  138. package/.next/standalone/.next/server/app/api/projects/agent-cwd-options/route_client-reference-manifest.js +1 -1
  139. package/.next/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
  140. package/.next/standalone/.next/server/app/api/proposals/[uuid]/approve/route_client-reference-manifest.js +1 -1
  141. package/.next/standalone/.next/server/app/api/proposals/[uuid]/close/route_client-reference-manifest.js +1 -1
  142. package/.next/standalone/.next/server/app/api/proposals/[uuid]/reject/route_client-reference-manifest.js +1 -1
  143. package/.next/standalone/.next/server/app/api/proposals/[uuid]/revoke/route_client-reference-manifest.js +1 -1
  144. package/.next/standalone/.next/server/app/api/proposals/[uuid]/route_client-reference-manifest.js +1 -1
  145. package/.next/standalone/.next/server/app/api/references/[uuid]/route_client-reference-manifest.js +1 -1
  146. package/.next/standalone/.next/server/app/api/references/route_client-reference-manifest.js +1 -1
  147. package/.next/standalone/.next/server/app/api/search/route_client-reference-manifest.js +1 -1
  148. package/.next/standalone/.next/server/app/api/session/route_client-reference-manifest.js +1 -1
  149. package/.next/standalone/.next/server/app/api/sessions/[uuid]/route_client-reference-manifest.js +1 -1
  150. package/.next/standalone/.next/server/app/api/tasks/[uuid]/claim/route_client-reference-manifest.js +1 -1
  151. package/.next/standalone/.next/server/app/api/tasks/[uuid]/dependencies/[dependsOnUuid]/route_client-reference-manifest.js +1 -1
  152. package/.next/standalone/.next/server/app/api/tasks/[uuid]/dependencies/route_client-reference-manifest.js +1 -1
  153. package/.next/standalone/.next/server/app/api/tasks/[uuid]/release/route_client-reference-manifest.js +1 -1
  154. package/.next/standalone/.next/server/app/api/tasks/[uuid]/route_client-reference-manifest.js +1 -1
  155. package/.next/standalone/.next/server/app/api/tasks/[uuid]/sessions/route_client-reference-manifest.js +1 -1
  156. package/.next/standalone/.next/server/app/index.html +2 -2
  157. package/.next/standalone/.next/server/app/index.rsc +1 -1
  158. package/.next/standalone/.next/server/app/login/admin/page_client-reference-manifest.js +1 -1
  159. package/.next/standalone/.next/server/app/login/admin.html +2 -2
  160. package/.next/standalone/.next/server/app/login/admin.rsc +1 -1
  161. package/.next/standalone/.next/server/app/login/callback/page_client-reference-manifest.js +1 -1
  162. package/.next/standalone/.next/server/app/login/callback.html +2 -2
  163. package/.next/standalone/.next/server/app/login/callback.rsc +1 -1
  164. package/.next/standalone/.next/server/app/login/page_client-reference-manifest.js +1 -1
  165. package/.next/standalone/.next/server/app/login/pick-workspace/page_client-reference-manifest.js +1 -1
  166. package/.next/standalone/.next/server/app/login/pick-workspace.html +2 -2
  167. package/.next/standalone/.next/server/app/login/pick-workspace.rsc +1 -1
  168. package/.next/standalone/.next/server/app/login.html +2 -2
  169. package/.next/standalone/.next/server/app/login.rsc +1 -1
  170. package/.next/standalone/.next/server/app/onboarding/page.js +2 -2
  171. package/.next/standalone/.next/server/app/onboarding/page.js.nft.json +1 -1
  172. package/.next/standalone/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  173. package/.next/standalone/.next/server/app/onboarding.html +2 -2
  174. package/.next/standalone/.next/server/app/onboarding.rsc +2 -2
  175. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  176. package/.next/standalone/.next/server/app/projects.html +2 -2
  177. package/.next/standalone/.next/server/app/projects.rsc +2 -2
  178. package/.next/standalone/.next/server/app/settings.html +2 -2
  179. package/.next/standalone/.next/server/app/settings.rsc +3 -3
  180. package/.next/standalone/.next/server/app-paths-manifest.json +54 -54
  181. package/.next/standalone/.next/server/chunks/1114.js +1 -1
  182. package/.next/standalone/.next/server/chunks/1318.js +1 -1
  183. package/.next/standalone/.next/server/chunks/1437.js +1 -0
  184. package/.next/standalone/.next/server/chunks/1559.js +2 -2
  185. package/.next/standalone/.next/server/chunks/2572.js +1 -1
  186. package/.next/standalone/.next/server/chunks/2618.js +1 -1
  187. package/.next/standalone/.next/server/chunks/2961.js +1 -1
  188. package/.next/standalone/.next/server/chunks/{9793.js → 3045.js} +1 -1
  189. package/.next/standalone/.next/server/chunks/3831.js +37 -0
  190. package/.next/standalone/.next/server/chunks/4827.js +1 -1
  191. package/.next/standalone/.next/server/chunks/5245.js +1 -1
  192. package/.next/standalone/.next/server/chunks/{4394.js → 5706.js} +1 -1
  193. package/.next/standalone/.next/server/chunks/6113.js +1 -1
  194. package/.next/standalone/.next/server/chunks/6207.js +1 -1
  195. package/.next/standalone/.next/server/chunks/6506.js +2 -2
  196. package/.next/standalone/.next/server/chunks/6515.js +2 -2
  197. package/.next/standalone/.next/server/chunks/679.js +1 -1
  198. package/.next/standalone/.next/server/chunks/7368.js +1 -1
  199. package/.next/standalone/.next/server/chunks/7530.js +1 -1
  200. package/.next/standalone/.next/server/chunks/8454.js +1 -1
  201. package/.next/standalone/.next/server/chunks/920.js +1 -1
  202. package/.next/standalone/.next/server/chunks/9213.js +1 -1
  203. package/.next/standalone/.next/server/chunks/9378.js +1 -1
  204. package/.next/standalone/.next/server/chunks/9449.js +1 -0
  205. package/.next/standalone/.next/server/chunks/9458.js +1 -0
  206. package/.next/standalone/.next/server/middleware-build-manifest.js +1 -1
  207. package/.next/standalone/.next/server/middleware-manifest.json +5 -5
  208. package/.next/standalone/.next/server/pages/404.html +2 -2
  209. package/.next/standalone/.next/server/pages/500.html +1 -1
  210. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  211. package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
  212. package/.next/standalone/.next/static/chunks/{11595.97e534422c57aee1.js → 11595.bbe40924d18958bf.js} +1 -1
  213. package/.next/standalone/.next/static/chunks/18139-e6ef4b5869593f8e.js +1 -0
  214. package/.next/standalone/.next/static/chunks/28856-ef2cb58fbd404ef9.js +1 -0
  215. package/.next/standalone/.next/static/chunks/{31308-fda6febfb2882a28.js → 31308-bb4a97b3f39c22dd.js} +1 -1
  216. package/.next/standalone/.next/static/chunks/{33456.6dc44a6aca1a01fd.js → 33456.5499eb8e892b110a.js} +1 -1
  217. package/.next/standalone/.next/static/chunks/{4860.7873ebc9ba435c8c.js → 4860.be77046fb2b3a2bd.js} +1 -1
  218. package/.next/standalone/.next/static/chunks/66873-e3be53f41b3f2255.js +1 -0
  219. package/.next/standalone/.next/static/chunks/70303-aec3d52ad87602a3.js +1 -0
  220. package/.next/standalone/.next/static/chunks/76201-83b26515f85ce37c.js +1 -0
  221. package/.next/standalone/.next/static/chunks/78917-a8a8dff98857c045.js +1 -0
  222. package/.next/standalone/.next/static/chunks/{94643-01be319472d751b3.js → 94643-ffa140f765c73daf.js} +1 -1
  223. package/.next/standalone/.next/static/chunks/97663-9c3ae4fd60b353db.js +1 -0
  224. package/.next/standalone/.next/static/chunks/{99373.d0e808c18408b8da.js → 99373.111493dc260a2a04.js} +1 -1
  225. package/.next/standalone/.next/static/chunks/app/(dashboard)/{layout-b742c51c0a764daf.js → layout-40fe7d026c5a7c6d.js} +1 -1
  226. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/dashboard/page-87d4d0fe90fca28c.js +1 -0
  227. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/documents/[documentUuid]/page-1206abaee85dc915.js +1 -0
  228. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/documents/{page-425acbe9ade5fa83.js → page-474e494097c8945f.js} +1 -1
  229. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/graph/page-e902b19328092ccf.js +1 -0
  230. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/[proposalUuid]/page-f273288c3530aa0f.js +1 -0
  231. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/new/page-6568a7b08bf9a54b.js +1 -0
  232. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/page-fbd3c27b68666234.js +1 -0
  233. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/tasks/[taskUuid]/{page-58b48aa0a11603c3.js → page-15bb6e1696668512.js} +1 -1
  234. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/tasks/{page-286faced32c6133f.js → page-2bea97214b1595cc.js} +1 -1
  235. package/.next/standalone/.next/static/chunks/app/(dashboard)/settings/page-2bf7ceee62b574c7.js +1 -0
  236. package/.next/standalone/.next/static/chunks/app/onboarding/{page-5c82cf3abd856301.js → page-540da64d7ba16dc7.js} +1 -1
  237. package/.next/standalone/.next/static/chunks/{webpack-fa066d7ff9ab2b29.js → webpack-7cbb3ba6792f1fb3.js} +1 -1
  238. package/.next/standalone/package.json +1 -1
  239. package/.next/standalone/public/chorus-plugin/.claude-plugin/plugin.json +1 -1
  240. package/.next/standalone/public/chorus-plugin/bin/chorus-api.sh +44 -1
  241. package/.next/standalone/public/chorus-plugin/bin/on-session-start.sh +4 -3
  242. package/.next/standalone/public/chorus-plugin/bin/tests/test-mcp-cli-delegation.sh +244 -0
  243. package/.next/standalone/public/chorus-plugin/skills/brainstorm/SKILL.md +1 -1
  244. package/.next/standalone/public/chorus-plugin/skills/chorus/SKILL.md +19 -1
  245. package/.next/standalone/public/chorus-plugin/skills/chorus-cli/SKILL.md +57 -0
  246. package/.next/standalone/public/chorus-plugin/skills/develop/SKILL.md +2 -2
  247. package/.next/standalone/public/chorus-plugin/skills/docs/SKILL.md +1 -1
  248. package/.next/standalone/public/chorus-plugin/skills/idea/SKILL.md +1 -1
  249. package/.next/standalone/public/chorus-plugin/skills/openspec-aware/SKILL.md +85 -42
  250. package/.next/standalone/public/chorus-plugin/skills/orchestrate/SKILL.md +1 -1
  251. package/.next/standalone/public/chorus-plugin/skills/proposal/SKILL.md +2 -2
  252. package/.next/standalone/public/chorus-plugin/skills/quick-dev/SKILL.md +1 -1
  253. package/.next/standalone/public/chorus-plugin/skills/review/SKILL.md +1 -1
  254. package/.next/standalone/public/chorus-plugin/skills/yolo/SKILL.md +3 -3
  255. package/.next/standalone/public/dsh-credentials.sh +30 -0
  256. package/.next/standalone/public/install-codex.sh +21 -406
  257. package/.next/standalone/public/install-kiro.sh +20 -344
  258. package/.next/standalone/public/install-opencode.sh +20 -275
  259. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-brainstorm/SKILL.md +1 -1
  260. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-cli/SKILL.md +57 -0
  261. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-develop/SKILL.md +2 -2
  262. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-docs/SKILL.md +1 -1
  263. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-idea/SKILL.md +1 -1
  264. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-openspec-aware/SKILL.md +85 -42
  265. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-orchestrate/SKILL.md +1 -1
  266. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-proposal/SKILL.md +2 -2
  267. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-quick-dev/SKILL.md +1 -1
  268. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-review/SKILL.md +1 -1
  269. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-yolo/SKILL.md +3 -3
  270. package/.next/standalone/public/kiro-plugin/bin/chorus-api.sh +44 -1
  271. package/.next/standalone/public/kiro-plugin/bin/on-agent-spawn.sh +6 -4
  272. package/.next/standalone/public/kiro-plugin/manifest.txt +41 -0
  273. package/.next/standalone/public/skill/brainstorm-chorus/SKILL.md +1 -1
  274. package/.next/standalone/public/skill/chorus/SKILL.md +19 -1
  275. package/.next/standalone/public/skill/code-reviewer-chorus/SKILL.md +1 -1
  276. package/.next/standalone/public/skill/develop-chorus/SKILL.md +1 -1
  277. package/.next/standalone/public/skill/docs-chorus/SKILL.md +1 -1
  278. package/.next/standalone/public/skill/idea-chorus/SKILL.md +1 -1
  279. package/.next/standalone/public/skill/orchestrate-chorus/SKILL.md +1 -1
  280. package/.next/standalone/public/skill/proposal-chorus/SKILL.md +1 -1
  281. package/.next/standalone/public/skill/proposal-reviewer-chorus/SKILL.md +1 -1
  282. package/.next/standalone/public/skill/quick-dev-chorus/SKILL.md +1 -1
  283. package/.next/standalone/public/skill/review-chorus/SKILL.md +1 -1
  284. package/.next/standalone/public/skill/task-reviewer-chorus/SKILL.md +1 -1
  285. package/.next/standalone/public/skill/yolo-chorus/SKILL.md +1 -1
  286. package/.next/standalone/public/test-dsh-credentials.sh +39 -0
  287. package/.next/standalone/public/test-install-codex.sh +31 -79
  288. package/README.ja.md +5 -3
  289. package/README.ko.md +5 -3
  290. package/README.md +5 -3
  291. package/README.zh.md +5 -3
  292. package/chorus.mjs +35 -1
  293. package/cli/agent-backend-prompt.mjs +94 -0
  294. package/cli/agents.mjs +329 -0
  295. package/cli/chorus-client.mjs +69 -0
  296. package/cli/claude-spawner.mjs +4 -0
  297. package/cli/client-args.mjs +11 -5
  298. package/cli/codex-spawner.mjs +11 -6
  299. package/cli/credentials.mjs +185 -3
  300. package/cli/daemon-agent.mjs +30 -5
  301. package/cli/daemon-banner.mjs +3 -3
  302. package/cli/daemon-config.mjs +27 -2
  303. package/cli/daemon-install-config.mjs +21 -14
  304. package/cli/daemon-rest-client.mjs +31 -8
  305. package/cli/daemon-service.mjs +120 -33
  306. package/cli/daemon.mjs +175 -28
  307. package/cli/dsh-managed-config.mjs +407 -0
  308. package/cli/dsh-spawner.mjs +445 -0
  309. package/cli/init/adapters.mjs +137 -0
  310. package/cli/init/agent-type-map.mjs +60 -0
  311. package/cli/init/chorus-plugin-consts.mjs +16 -0
  312. package/cli/init/codex-mcp-config.mjs +183 -0
  313. package/cli/init/contracts.mjs +120 -0
  314. package/cli/init/detect.mjs +97 -0
  315. package/cli/init/file-template.mjs +248 -0
  316. package/cli/init/install-methods.mjs +508 -0
  317. package/cli/init/registry.mjs +74 -0
  318. package/cli/init/run-command.mjs +30 -0
  319. package/cli/init/select.mjs +111 -0
  320. package/cli/init/steps/credential-seed.mjs +751 -0
  321. package/cli/init/steps/daemon-setup.mjs +246 -0
  322. package/cli/init/steps/plugin-install.mjs +37 -0
  323. package/cli/init-args.mjs +137 -0
  324. package/cli/init.mjs +198 -0
  325. package/cli/kiro-spawner.mjs +4 -0
  326. package/cli/login.mjs +26 -4
  327. package/cli/mcp-args.mjs +280 -0
  328. package/cli/mcp.mjs +164 -0
  329. package/cli/spawner-select.mjs +54 -2
  330. package/cli/turn-reporter.mjs +5 -2
  331. package/cli/upload-hooks.mjs +31 -1
  332. package/cli/waker.mjs +49 -6
  333. package/package.json +1 -1
  334. package/prisma/migrations/20260818024700_add_turn_backend_session_id/migration.sql +1 -0
  335. package/prisma/schema.prisma +3 -0
  336. package/.next/standalone/.next/server/chunks/3594.js +0 -1
  337. package/.next/standalone/.next/server/chunks/5351.js +0 -32
  338. package/.next/standalone/.next/server/chunks/6667.js +0 -1
  339. package/.next/standalone/.next/server/chunks/6995.js +0 -1
  340. package/.next/standalone/.next/static/chunks/19887-c0bb297a78a1c7cd.js +0 -1
  341. package/.next/standalone/.next/static/chunks/29108-5a11eea003f4cc11.js +0 -1
  342. package/.next/standalone/.next/static/chunks/53073-a7ed20af6538a178.js +0 -1
  343. package/.next/standalone/.next/static/chunks/6603-e70ddeab6ad09c50.js +0 -1
  344. package/.next/standalone/.next/static/chunks/78917-1b59cbb806b3ecfc.js +0 -1
  345. package/.next/standalone/.next/static/chunks/82751-3e161e1d8dbda3ac.js +0 -1
  346. package/.next/standalone/.next/static/chunks/99366-425e9ef22e60e3e2.js +0 -1
  347. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/dashboard/page-f636e00c28f425ea.js +0 -1
  348. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/documents/[documentUuid]/page-c004f1a194af7fa5.js +0 -1
  349. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/graph/page-fdd617457730a116.js +0 -1
  350. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/[proposalUuid]/page-6b3fb08d53826d02.js +0 -1
  351. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/new/page-d5b222f379b2e8ca.js +0 -1
  352. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/page-0a6c2d0e1b68e0e4.js +0 -1
  353. package/.next/standalone/.next/static/chunks/app/(dashboard)/settings/page-1507a761e67c2aa9.js +0 -1
  354. /package/.next/standalone/.next/static/{K8qIdwvKoIWbwQ_f01mnM → 0spgxl3lP26Fl1otd1D7R}/_buildManifest.js +0 -0
  355. /package/.next/standalone/.next/static/{K8qIdwvKoIWbwQ_f01mnM → 0spgxl3lP26Fl1otd1D7R}/_ssgManifest.js +0 -0
@@ -0,0 +1,407 @@
1
+ import { spawnSync } from "node:child_process";
2
+ import { createHash, randomUUID } from "node:crypto";
3
+ import {
4
+ existsSync,
5
+ mkdirSync,
6
+ readFileSync,
7
+ renameSync,
8
+ rmSync,
9
+ writeFileSync,
10
+ } from "node:fs";
11
+ import { homedir } from "node:os";
12
+ import { dirname, join, resolve } from "node:path";
13
+ import { createRequire } from "node:module";
14
+ import { pathToFileURL } from "node:url";
15
+
16
+ export const DSH_BUNDLE = "@chorus-aidlc/chorus-dsh";
17
+ export const DSH_PEERS = Object.freeze([
18
+ "@deepseek-ai/dsh-mcp-client",
19
+ "@deepseek-ai/dsh-skill-filesystem",
20
+ "@deepseek-ai/dsh-tool-skill",
21
+ "@deepseek-ai/dsh-persona",
22
+ ]);
23
+ export const DSH_RC_VERSION = "0.1.0-rc.7";
24
+ export const MANAGED_CONFIG_FILE = "cordis.yml";
25
+
26
+ // dsh-base supplies the core plugins used by the external JSON-RPC composition.
27
+ // Hoisted linking makes those transitive plugins visible from the config anchor.
28
+ const RUNTIME_PACKAGES = Object.freeze({
29
+ "@deepseek-ai/dsh-base": DSH_RC_VERSION,
30
+ "@deepseek-ai/dsh-agent-spine-demo": DSH_RC_VERSION,
31
+ "@deepseek-ai/dsh-sdk-jsonrpc-server": DSH_RC_VERSION,
32
+ "@deepseek-ai/dsh-sdk-jsonrpc-demo": DSH_RC_VERSION,
33
+ "@deepseek-ai/dsh-invariants": DSH_RC_VERSION,
34
+ "@deepseek-ai/cordis": "4.0.1",
35
+ });
36
+ const REQUIRED_IMPORTS = Object.freeze([DSH_BUNDLE, ...DSH_PEERS]);
37
+ const STATE_VERSION = 1;
38
+
39
+ const CONFIG_HEAD = `# Generated by Chorus. Secrets are read from the child environment.
40
+ # This file is managed; use CHORUS_DSH_CONFIG or DSH_CORDIS_CONFIG to override it.
41
+
42
+ - id: sdk-jsonrpc-server
43
+ name: '@deepseek-ai/dsh-sdk-jsonrpc-server'
44
+ config:
45
+ maxTokensAsSuccess: true
46
+
47
+ - id: llm-deepseek
48
+ name: '@deepseek-ai/dsh-llm-deepseek'
49
+ config:
50
+ thinking: enabled
51
+ reasoningEffort: max
52
+
53
+ - id: subprocess
54
+ name: '@deepseek-ai/dsh-subprocess-local'
55
+
56
+ - id: bash
57
+ name: '@deepseek-ai/dsh-bash-local'
58
+ config:
59
+ cwd: !!js process.env.DSH_CWD ?? process.cwd()
60
+ timeoutMs: 60000
61
+
62
+ - id: agent-spine
63
+ name: '@deepseek-ai/dsh-agent-spine-demo'
64
+ config:
65
+ persona: !!js process.env.DSH_SYSTEM_PROMPT ?? 'You are a coding agent.'
66
+ workspaceContext: false
67
+ skills:
68
+ enabled: false
69
+ toolBash:
70
+ enableRunInBackground: false
71
+ toolJobs: false
72
+
73
+ - id: sessions
74
+ name: '@deepseek-ai/dsh-session-persistence-jsonl'
75
+ config:
76
+ root: !!js process.env.DSH_SESSION_ROOT ?? './.sessions'
77
+ compression: zstd
78
+
79
+ - id: session-checkpoints
80
+ name: '@deepseek-ai/dsh-session-checkpoint-policy'
81
+
82
+ - id: subagent
83
+ name: '@deepseek-ai/dsh-subagent'
84
+
85
+ - id: subagent-spawn-in-process
86
+ name: '@deepseek-ai/dsh-subagent-spawn-in-process'
87
+ config:
88
+ providerName: spawn
89
+
90
+ - id: tool-subagent
91
+ name: '@deepseek-ai/dsh-tool-subagent'
92
+ config:
93
+ provider: spawn
94
+ toolName: subagent
95
+ enableRunInBackground: false
96
+
97
+ - id: tool-todo
98
+ name: '@deepseek-ai/dsh-tool-todo'
99
+ config:
100
+ allowParallelInProgress: true
101
+
102
+ - id: fs-local
103
+ name: '@deepseek-ai/dsh-fs-local'
104
+ config:
105
+ cwd: !!js process.env.DSH_CWD ?? process.cwd()
106
+
107
+ - id: fs-observation-policy
108
+ name: '@deepseek-ai/dsh-fs-observation-policy'
109
+
110
+ - id: tool-fs
111
+ name: '@deepseek-ai/dsh-tool-fs'
112
+
113
+ - id: token-meter
114
+ name: '@deepseek-ai/dsh-token-meter'
115
+
116
+ - id: compaction-basic
117
+ name: '@deepseek-ai/dsh-compaction-basic'
118
+ config:
119
+ thresholdRatio: 0.8
120
+ retainRatio: 0.16
121
+ maxTokens: 8192
122
+ compactionRetries: 1
123
+
124
+ - id: chorus-dsh-lifecycle
125
+ name: __CHORUS_BUNDLE__
126
+
127
+ - id: chorus-mcp
128
+ name: '@deepseek-ai/dsh-mcp-client'
129
+ inject: [chorusDshConfig]
130
+ config:
131
+ serverName: chorus
132
+ transport: streamable-http
133
+ url: !!js '\`\${chorusDshConfig.url}/api/mcp\`'
134
+ headers:
135
+ Authorization: !!js '\`Bearer \${chorusDshConfig.apiKey}\`'
136
+ failOnStartupError: false
137
+ reconnect:
138
+ enabled: true
139
+
140
+ - id: skill
141
+ name: '@deepseek-ai/dsh-skill'
142
+
143
+ - id: chorus-skill-filesystem
144
+ name: '@deepseek-ai/dsh-skill-filesystem'
145
+ config:
146
+ providerName: chorus
147
+ includeDefaultRoots: false
148
+ customSkillDirs:
149
+ - !!js "process.getBuiltinModule('node:path').join(process.getBuiltinModule('node:path').dirname(process.getBuiltinModule('node:module').createRequire(baseUrl).resolve('@chorus-aidlc/chorus-dsh/package.json')), 'skills')"
150
+
151
+ - id: chorus-persona
152
+ name: __CHORUS_PERSONA__
153
+ config:
154
+ plugin: '@deepseek-ai/dsh-persona'
155
+ text: |-
156
+ You are a Chorus PM and developer agent powered by {{model}}. Work from {{cwd}}.
157
+ Use the Chorus AI-DLC lifecycle and load the relevant Chorus skill before operating
158
+ a Chorus resource. Keep decisions, progress, acceptance evidence, and review verdicts
159
+ on the assigned resource. In a headless daemon turn, never wait for terminal input:
160
+ persist human decisions through Chorus, mention the requester, and end the turn.
161
+ Do not push, merge, publish, approve, verify, or cross a human-owned gate unless the
162
+ wake explicitly grants that authority.
163
+
164
+ - id: tool-skill
165
+ name: '@deepseek-ai/dsh-tool-skill'
166
+ `;
167
+
168
+ function errorText(error) {
169
+ return error instanceof Error ? error.message : String(error);
170
+ }
171
+
172
+ function redactedErrorText(error, values = []) {
173
+ let text = errorText(error);
174
+ for (const value of values) {
175
+ if (typeof value === "string" && value) text = text.replaceAll(value, "[REDACTED]");
176
+ }
177
+ return text;
178
+ }
179
+
180
+ function readJson(path) {
181
+ try {
182
+ return JSON.parse(readFileSync(path, "utf8"));
183
+ } catch {
184
+ return null;
185
+ }
186
+ }
187
+
188
+ function packageSpecs({ bundleVersion, bundleSpec }) {
189
+ return {
190
+ [DSH_BUNDLE]: bundleSpec ?? bundleVersion,
191
+ ...Object.fromEntries(DSH_PEERS.map((name) => [name, DSH_RC_VERSION])),
192
+ ...RUNTIME_PACKAGES,
193
+ };
194
+ }
195
+
196
+ export function managedDshRoot(env = process.env) {
197
+ const home = env.HOME || env.USERPROFILE || homedir();
198
+ return join(home, ".chorus", "dsh");
199
+ }
200
+
201
+ export function renderManagedDshConfig(bundleEntry = DSH_BUNDLE) {
202
+ const quote = (value) => `'${String(value).replaceAll("'", "''")}'`;
203
+ const personaEntry =
204
+ bundleEntry === DSH_BUNDLE ? `${DSH_BUNDLE}/persona` : join(dirname(bundleEntry), "persona.mjs");
205
+ const skillDir =
206
+ bundleEntry === DSH_BUNDLE
207
+ ? `"process.getBuiltinModule('node:path').join(process.getBuiltinModule('node:path').dirname(process.getBuiltinModule('node:module').createRequire(baseUrl).resolve('@chorus-aidlc/chorus-dsh/package.json')), 'skills')"`
208
+ : quote(resolve(dirname(bundleEntry), "..", "skills"));
209
+ return CONFIG_HEAD
210
+ .replace("__CHORUS_BUNDLE__", quote(bundleEntry))
211
+ .replace("__CHORUS_PERSONA__", quote(personaEntry))
212
+ .replace(
213
+ `"process.getBuiltinModule('node:path').join(process.getBuiltinModule('node:path').dirname(process.getBuiltinModule('node:module').createRequire(baseUrl).resolve('@chorus-aidlc/chorus-dsh/package.json')), 'skills')"`,
214
+ skillDir,
215
+ );
216
+ }
217
+
218
+ function resolveInstalledBundleEntry(projectDir) {
219
+ const pkgPath = join(projectDir, "node_modules", "@chorus-aidlc", "chorus-dsh", "package.json");
220
+ const pkg = readJson(pkgPath);
221
+ if (!pkg) return null;
222
+ const exported = pkg.exports?.["."]?.default ?? pkg.main;
223
+ return typeof exported === "string" ? resolve(dirname(pkgPath), exported) : null;
224
+ }
225
+
226
+ export async function validateManagedDshImports(projectDir, opts = {}) {
227
+ const requireFromConfig = createRequire(join(projectDir, MANAGED_CONFIG_FILE));
228
+ const resolveImport = opts.resolveImport ?? ((name) => requireFromConfig.resolve(name));
229
+ const importModule = opts.importModule ?? ((entry) => import(pathToFileURL(entry).href));
230
+ const resolved = {};
231
+ let usedBundleFallback = false;
232
+
233
+ for (const name of REQUIRED_IMPORTS) {
234
+ try {
235
+ resolved[name] = resolveImport(name);
236
+ } catch (error) {
237
+ if (name !== DSH_BUNDLE) {
238
+ throw new Error(`dsh managed import resolution failed for ${name}: ${errorText(error)}`);
239
+ }
240
+ const fallback =
241
+ opts.resolveBundleEntry?.(projectDir) ?? resolveInstalledBundleEntry(projectDir);
242
+ if (!fallback || !existsSync(fallback)) {
243
+ throw new Error(`dsh managed bundle resolution failed: ${errorText(error)}`);
244
+ }
245
+ resolved[name] = fallback;
246
+ usedBundleFallback = true;
247
+ }
248
+ }
249
+
250
+ for (const [name, entry] of Object.entries(resolved)) {
251
+ try {
252
+ await importModule(entry);
253
+ } catch (error) {
254
+ throw new Error(`dsh managed import load failed for ${name}: ${errorText(error)}`);
255
+ }
256
+ }
257
+ return {
258
+ resolved,
259
+ bundleEntry: resolved[DSH_BUNDLE],
260
+ usedBundleFallback,
261
+ };
262
+ }
263
+
264
+ function runCommand(command, argv, opts) {
265
+ const platform = opts.platform ?? process.platform;
266
+ const isCmd = platform === "win32" && /\.(cmd|bat)$/i.test(command);
267
+ const executable = isCmd ? opts.env?.ComSpec || opts.env?.COMSPEC || "cmd.exe" : command;
268
+ const commandArgs = isCmd ? ["/d", "/s", "/c", command, ...argv] : argv;
269
+ const result = spawnSync(executable, commandArgs, {
270
+ cwd: opts.cwd,
271
+ env: opts.env,
272
+ encoding: "utf8",
273
+ shell: false,
274
+ timeout: opts.timeout,
275
+ input: opts.input,
276
+ windowsHide: true,
277
+ });
278
+ if (result.error || result.status !== 0) {
279
+ const detail = result.error?.message || result.stderr?.trim() || `exit ${result.status}`;
280
+ throw new Error(detail);
281
+ }
282
+ return result;
283
+ }
284
+
285
+ export function validateManagedDshComposition(configPath, opts = {}) {
286
+ const dshPath = opts.dshPath;
287
+ if (!dshPath) throw new Error("cannot validate dsh composition: dsh-jsonrpc-agent was not found");
288
+ const env = {
289
+ ...(opts.env ?? process.env),
290
+ CHORUS_DAEMON_HEADLESS: "1",
291
+ CHORUS_URL: opts.creds?.url ?? "http://127.0.0.1",
292
+ CHORUS_API_KEY: opts.creds?.apiKey ?? "cho_validation",
293
+ DSH_CORDIS_CONFIG: configPath,
294
+ DSH_CWD: dirname(configPath),
295
+ };
296
+ const request =
297
+ `${JSON.stringify({ jsonrpc: "2.0", id: 1, method: "initialize", params: { cwd: dirname(configPath), provider: "deepseek-official", model: "deepseek-v4-flash" } })}\n`;
298
+ const runner = opts.runCommand ?? runCommand;
299
+ const result = runner(dshPath, [], {
300
+ cwd: dirname(configPath),
301
+ env,
302
+ input: request,
303
+ timeout: opts.timeoutMs ?? 20_000,
304
+ platform: opts.platform,
305
+ });
306
+ if (!String(result.stdout ?? "").includes('"id":1')) {
307
+ throw new Error("dsh composition validation did not complete JSON-RPC initialization");
308
+ }
309
+ }
310
+
311
+ function activeState(root, pathExists = existsSync) {
312
+ const state = readJson(join(root, "active.json"));
313
+ if (
314
+ !state ||
315
+ state.version !== STATE_VERSION ||
316
+ typeof state.configPath !== "string" ||
317
+ typeof state.runtimePath !== "string"
318
+ ) return null;
319
+ return pathExists(state.configPath) && pathExists(state.runtimePath) ? state : null;
320
+ }
321
+
322
+ export async function prepareManagedDshConfig(opts = {}) {
323
+ const env = opts.env ?? process.env;
324
+ const root = opts.root ?? managedDshRoot(env);
325
+ const bundleVersion = opts.bundleVersion;
326
+ if (!bundleVersion) throw new Error("dsh managed preparation requires a Chorus bundle version");
327
+ const specs = packageSpecs({ bundleVersion, bundleSpec: opts.bundleSpec });
328
+ const fingerprint = createHash("sha256")
329
+ .update(JSON.stringify({ version: STATE_VERSION, specs }))
330
+ .digest("hex")
331
+ .slice(0, 16);
332
+ const current = activeState(root, opts.statePathExists ?? existsSync);
333
+
334
+ if (current?.fingerprint === fingerprint) {
335
+ await (opts.validateImports ?? validateManagedDshImports)(dirname(current.configPath), opts);
336
+ return { ...current, reused: true };
337
+ }
338
+
339
+ const releaseDir = join(root, "releases", `${fingerprint}-${randomUUID()}`);
340
+ const markerTmp = join(root, `.active-${randomUUID()}.json`);
341
+ mkdirSync(releaseDir, { recursive: true });
342
+ try {
343
+ writeFileSync(
344
+ join(releaseDir, "package.json"),
345
+ `${JSON.stringify({ private: true, type: "module", dependencies: specs }, null, 2)}\n`,
346
+ { mode: 0o600 },
347
+ );
348
+ writeFileSync(join(releaseDir, ".npmrc"), "node-linker=hoisted\n", { mode: 0o600 });
349
+
350
+ const install = opts.install ?? ((cwd) => runCommand(
351
+ opts.packageManager ?? (opts.platform === "win32" ? "pnpm.cmd" : "pnpm"),
352
+ ["install", "--prod", "--ignore-scripts", "--frozen-lockfile=false"],
353
+ { cwd, env, timeout: opts.installTimeoutMs ?? 120_000, platform: opts.platform },
354
+ ));
355
+ try {
356
+ install(releaseDir);
357
+ } catch (error) {
358
+ throw new Error(
359
+ `dsh managed package installation failed: ` +
360
+ redactedErrorText(error, [env.CHORUS_API_KEY, opts.creds?.apiKey]),
361
+ );
362
+ }
363
+
364
+ const importResult = await (opts.validateImports ?? validateManagedDshImports)(releaseDir, opts);
365
+ const bundleEntry = importResult.usedBundleFallback ? importResult.bundleEntry : DSH_BUNDLE;
366
+ const configPath = join(releaseDir, MANAGED_CONFIG_FILE);
367
+ const runtimePath = join(
368
+ releaseDir,
369
+ "node_modules",
370
+ ".bin",
371
+ opts.platform === "win32" ? "dsh-jsonrpc-agent.cmd" : "dsh-jsonrpc-agent",
372
+ );
373
+ if (!(opts.runtimeExists ?? existsSync)(runtimePath)) {
374
+ throw new Error(`dsh managed runtime was not installed at ${runtimePath}`);
375
+ }
376
+ writeFileSync(configPath, renderManagedDshConfig(bundleEntry), { mode: 0o600 });
377
+
378
+ try {
379
+ (opts.validateComposition ?? validateManagedDshComposition)(configPath, {
380
+ ...opts,
381
+ dshPath: runtimePath,
382
+ });
383
+ } catch (error) {
384
+ throw new Error(
385
+ `dsh managed composition validation failed: ` +
386
+ redactedErrorText(error, [env.CHORUS_API_KEY, opts.creds?.apiKey]),
387
+ );
388
+ }
389
+
390
+ const state = {
391
+ version: STATE_VERSION,
392
+ fingerprint,
393
+ configPath,
394
+ bundleEntry,
395
+ runtimePath,
396
+ validatedAt: new Date().toISOString(),
397
+ };
398
+ mkdirSync(root, { recursive: true });
399
+ writeFileSync(markerTmp, `${JSON.stringify(state, null, 2)}\n`, { mode: 0o600 });
400
+ renameSync(markerTmp, join(root, "active.json"));
401
+ return { ...state, reused: false };
402
+ } catch (error) {
403
+ rmSync(markerTmp, { force: true });
404
+ rmSync(releaseDir, { recursive: true, force: true });
405
+ throw error;
406
+ }
407
+ }