@chorus-aidlc/chorus 0.17.0 → 0.17.2

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 (481) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/app-build-manifest.json +519 -519
  3. package/.next/standalone/.next/app-path-routes-manifest.json +44 -44
  4. package/.next/standalone/.next/build-manifest.json +6 -6
  5. package/.next/standalone/.next/prerender-manifest.json +45 -45
  6. package/.next/standalone/.next/react-loadable-manifest.json +1 -1
  7. package/.next/standalone/.next/required-server-files.json +4 -4
  8. package/.next/standalone/.next/server/app/(dashboard)/project-groups/[uuid]/page.js +2 -2
  9. package/.next/standalone/.next/server/app/(dashboard)/project-groups/[uuid]/page.js.nft.json +1 -1
  10. package/.next/standalone/.next/server/app/(dashboard)/project-groups/[uuid]/page_client-reference-manifest.js +1 -1
  11. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/activity/page.js +2 -2
  12. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/activity/page.js.nft.json +1 -1
  13. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/activity/page_client-reference-manifest.js +1 -1
  14. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/dashboard/[ideaUuid]/page.js +2 -2
  15. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/dashboard/[ideaUuid]/page.js.nft.json +1 -1
  16. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/dashboard/[ideaUuid]/page_client-reference-manifest.js +1 -1
  17. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/dashboard/page.js +2 -2
  18. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/dashboard/page.js.nft.json +1 -1
  19. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/dashboard/page_client-reference-manifest.js +1 -1
  20. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/documents/[documentUuid]/page.js +2 -2
  21. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/documents/[documentUuid]/page.js.nft.json +1 -1
  22. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/documents/[documentUuid]/page_client-reference-manifest.js +1 -1
  23. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/documents/page.js +2 -2
  24. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/documents/page.js.nft.json +1 -1
  25. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/documents/page_client-reference-manifest.js +1 -1
  26. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/graph/page.js +2 -2
  27. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/graph/page.js.nft.json +1 -1
  28. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/graph/page_client-reference-manifest.js +1 -1
  29. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/[proposalUuid]/page.js +2 -2
  30. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/[proposalUuid]/page.js.nft.json +1 -1
  31. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/[proposalUuid]/page_client-reference-manifest.js +1 -1
  32. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/new/page.js +2 -2
  33. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/new/page.js.nft.json +1 -1
  34. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/new/page_client-reference-manifest.js +1 -1
  35. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/page.js +2 -2
  36. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/page.js.nft.json +1 -1
  37. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/page_client-reference-manifest.js +1 -1
  38. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/[taskUuid]/page.js +2 -2
  39. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/[taskUuid]/page.js.nft.json +1 -1
  40. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/[taskUuid]/page_client-reference-manifest.js +1 -1
  41. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/page.js +2 -2
  42. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/page.js.nft.json +1 -1
  43. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/page_client-reference-manifest.js +1 -1
  44. package/.next/standalone/.next/server/app/(dashboard)/projects/page.js +3 -3
  45. package/.next/standalone/.next/server/app/(dashboard)/projects/page.js.nft.json +1 -1
  46. package/.next/standalone/.next/server/app/(dashboard)/projects/page_client-reference-manifest.js +1 -1
  47. package/.next/standalone/.next/server/app/(dashboard)/settings/page.js +2 -2
  48. package/.next/standalone/.next/server/app/(dashboard)/settings/page.js.nft.json +1 -1
  49. package/.next/standalone/.next/server/app/(dashboard)/settings/page_client-reference-manifest.js +1 -1
  50. package/.next/standalone/.next/server/app/_not-found/page.js +2 -2
  51. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  52. package/.next/standalone/.next/server/app/_not-found.html +2 -2
  53. package/.next/standalone/.next/server/app/_not-found.rsc +5 -5
  54. package/.next/standalone/.next/server/app/admin/companies/[uuid]/page.js +2 -2
  55. package/.next/standalone/.next/server/app/admin/companies/[uuid]/page.js.nft.json +1 -1
  56. package/.next/standalone/.next/server/app/admin/companies/[uuid]/page_client-reference-manifest.js +1 -1
  57. package/.next/standalone/.next/server/app/admin/companies/new/page.js +2 -2
  58. package/.next/standalone/.next/server/app/admin/companies/new/page.js.nft.json +1 -1
  59. package/.next/standalone/.next/server/app/admin/companies/new/page_client-reference-manifest.js +1 -1
  60. package/.next/standalone/.next/server/app/admin/companies/new.html +2 -2
  61. package/.next/standalone/.next/server/app/admin/companies/new.rsc +7 -7
  62. package/.next/standalone/.next/server/app/admin/companies/page.js +2 -2
  63. package/.next/standalone/.next/server/app/admin/companies/page.js.nft.json +1 -1
  64. package/.next/standalone/.next/server/app/admin/companies/page_client-reference-manifest.js +1 -1
  65. package/.next/standalone/.next/server/app/admin/companies.html +2 -2
  66. package/.next/standalone/.next/server/app/admin/companies.rsc +7 -7
  67. package/.next/standalone/.next/server/app/admin/page.js +2 -2
  68. package/.next/standalone/.next/server/app/admin/page.js.nft.json +1 -1
  69. package/.next/standalone/.next/server/app/admin/page_client-reference-manifest.js +1 -1
  70. package/.next/standalone/.next/server/app/admin.html +2 -2
  71. package/.next/standalone/.next/server/app/admin.rsc +7 -7
  72. package/.next/standalone/.next/server/app/api/admin/companies/[uuid]/route.js +1 -1
  73. package/.next/standalone/.next/server/app/api/admin/companies/[uuid]/route_client-reference-manifest.js +1 -1
  74. package/.next/standalone/.next/server/app/api/admin/companies/route.js +1 -1
  75. package/.next/standalone/.next/server/app/api/admin/companies/route_client-reference-manifest.js +1 -1
  76. package/.next/standalone/.next/server/app/api/admin/login/route.js +1 -1
  77. package/.next/standalone/.next/server/app/api/admin/login/route_client-reference-manifest.js +1 -1
  78. package/.next/standalone/.next/server/app/api/admin/session/route.js +1 -1
  79. package/.next/standalone/.next/server/app/api/admin/session/route_client-reference-manifest.js +1 -1
  80. package/.next/standalone/.next/server/app/api/agent-connections/route.js +1 -1
  81. package/.next/standalone/.next/server/app/api/agent-connections/route_client-reference-manifest.js +1 -1
  82. package/.next/standalone/.next/server/app/api/agents/[uuid]/route.js +1 -1
  83. package/.next/standalone/.next/server/app/api/agents/[uuid]/route_client-reference-manifest.js +1 -1
  84. package/.next/standalone/.next/server/app/api/agents/[uuid]/sessions/route.js +1 -1
  85. package/.next/standalone/.next/server/app/api/agents/[uuid]/sessions/route_client-reference-manifest.js +1 -1
  86. package/.next/standalone/.next/server/app/api/agents/route.js +1 -1
  87. package/.next/standalone/.next/server/app/api/agents/route_client-reference-manifest.js +1 -1
  88. package/.next/standalone/.next/server/app/api/api-keys/[uuid]/route.js +1 -1
  89. package/.next/standalone/.next/server/app/api/api-keys/[uuid]/route_client-reference-manifest.js +1 -1
  90. package/.next/standalone/.next/server/app/api/api-keys/route.js +1 -1
  91. package/.next/standalone/.next/server/app/api/api-keys/route_client-reference-manifest.js +1 -1
  92. package/.next/standalone/.next/server/app/api/auth/callback/route.js +1 -1
  93. package/.next/standalone/.next/server/app/api/auth/callback/route_client-reference-manifest.js +1 -1
  94. package/.next/standalone/.next/server/app/api/auth/check-default/route.js +1 -1
  95. package/.next/standalone/.next/server/app/api/auth/check-default/route_client-reference-manifest.js +1 -1
  96. package/.next/standalone/.next/server/app/api/auth/company-oidc/route.js +1 -1
  97. package/.next/standalone/.next/server/app/api/auth/company-oidc/route_client-reference-manifest.js +1 -1
  98. package/.next/standalone/.next/server/app/api/auth/default-login/route.js +1 -1
  99. package/.next/standalone/.next/server/app/api/auth/default-login/route_client-reference-manifest.js +1 -1
  100. package/.next/standalone/.next/server/app/api/auth/identify/route.js +1 -1
  101. package/.next/standalone/.next/server/app/api/auth/identify/route_client-reference-manifest.js +1 -1
  102. package/.next/standalone/.next/server/app/api/auth/logout/route.js +1 -1
  103. package/.next/standalone/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  104. package/.next/standalone/.next/server/app/api/auth/me/route.js +1 -1
  105. package/.next/standalone/.next/server/app/api/auth/me/route_client-reference-manifest.js +1 -1
  106. package/.next/standalone/.next/server/app/api/auth/sync-token/route.js +1 -1
  107. package/.next/standalone/.next/server/app/api/auth/sync-token/route_client-reference-manifest.js +1 -1
  108. package/.next/standalone/.next/server/app/api/comments/route.js +1 -1
  109. package/.next/standalone/.next/server/app/api/comments/route_client-reference-manifest.js +1 -1
  110. package/.next/standalone/.next/server/app/api/daemon/connection-heartbeat/route.js +1 -1
  111. package/.next/standalone/.next/server/app/api/daemon/connection-heartbeat/route_client-reference-manifest.js +1 -1
  112. package/.next/standalone/.next/server/app/api/daemon/control/route.js +1 -1
  113. package/.next/standalone/.next/server/app/api/daemon/control/route_client-reference-manifest.js +1 -1
  114. package/.next/standalone/.next/server/app/api/daemon/directory-request/report/route.js +1 -1
  115. package/.next/standalone/.next/server/app/api/daemon/directory-request/report/route_client-reference-manifest.js +1 -1
  116. package/.next/standalone/.next/server/app/api/daemon/execution-state/route.js +1 -1
  117. package/.next/standalone/.next/server/app/api/daemon/execution-state/route_client-reference-manifest.js +1 -1
  118. package/.next/standalone/.next/server/app/api/daemon/executions/route.js +1 -1
  119. package/.next/standalone/.next/server/app/api/daemon/executions/route_client-reference-manifest.js +1 -1
  120. package/.next/standalone/.next/server/app/api/daemon/pending-turns/route.js +1 -1
  121. package/.next/standalone/.next/server/app/api/daemon/pending-turns/route_client-reference-manifest.js +1 -1
  122. package/.next/standalone/.next/server/app/api/daemon/report-interrupt/route.js +1 -1
  123. package/.next/standalone/.next/server/app/api/daemon/report-interrupt/route_client-reference-manifest.js +1 -1
  124. package/.next/standalone/.next/server/app/api/daemon/resume/route.js +1 -1
  125. package/.next/standalone/.next/server/app/api/daemon/resume/route_client-reference-manifest.js +1 -1
  126. package/.next/standalone/.next/server/app/api/daemon/transcript/route.js +1 -1
  127. package/.next/standalone/.next/server/app/api/daemon/transcript/route_client-reference-manifest.js +1 -1
  128. package/.next/standalone/.next/server/app/api/daemon/turn-advance/route.js +1 -1
  129. package/.next/standalone/.next/server/app/api/daemon/turn-advance/route_client-reference-manifest.js +1 -1
  130. package/.next/standalone/.next/server/app/api/daemon-directory-requests/[uuid]/route.js +1 -1
  131. package/.next/standalone/.next/server/app/api/daemon-directory-requests/[uuid]/route_client-reference-manifest.js +1 -1
  132. package/.next/standalone/.next/server/app/api/daemon-directory-requests/route.js +1 -1
  133. package/.next/standalone/.next/server/app/api/daemon-directory-requests/route_client-reference-manifest.js +1 -1
  134. package/.next/standalone/.next/server/app/api/daemon-sessions/[sessionUuid]/instruction/route.js +1 -1
  135. package/.next/standalone/.next/server/app/api/daemon-sessions/[sessionUuid]/instruction/route_client-reference-manifest.js +1 -1
  136. package/.next/standalone/.next/server/app/api/daemon-sessions/[sessionUuid]/repoint/route.js +1 -1
  137. package/.next/standalone/.next/server/app/api/daemon-sessions/[sessionUuid]/repoint/route_client-reference-manifest.js +1 -1
  138. package/.next/standalone/.next/server/app/api/daemon-sessions/[sessionUuid]/route.js +1 -1
  139. package/.next/standalone/.next/server/app/api/daemon-sessions/[sessionUuid]/route_client-reference-manifest.js +1 -1
  140. package/.next/standalone/.next/server/app/api/daemon-sessions/ad-hoc/route.js +1 -1
  141. package/.next/standalone/.next/server/app/api/daemon-sessions/ad-hoc/route_client-reference-manifest.js +1 -1
  142. package/.next/standalone/.next/server/app/api/daemon-sessions/route.js +1 -1
  143. package/.next/standalone/.next/server/app/api/daemon-sessions/route_client-reference-manifest.js +1 -1
  144. package/.next/standalone/.next/server/app/api/documents/[uuid]/route.js +1 -1
  145. package/.next/standalone/.next/server/app/api/documents/[uuid]/route_client-reference-manifest.js +1 -1
  146. package/.next/standalone/.next/server/app/api/entities/[type]/[uuid]/root-idea/route.js +1 -1
  147. package/.next/standalone/.next/server/app/api/entities/[type]/[uuid]/root-idea/route_client-reference-manifest.js +1 -1
  148. package/.next/standalone/.next/server/app/api/events/notifications/route.js +1 -1
  149. package/.next/standalone/.next/server/app/api/events/notifications/route_client-reference-manifest.js +1 -1
  150. package/.next/standalone/.next/server/app/api/events/route.js +14 -6
  151. package/.next/standalone/.next/server/app/api/events/route_client-reference-manifest.js +1 -1
  152. package/.next/standalone/.next/server/app/api/health/route.js +1 -1
  153. package/.next/standalone/.next/server/app/api/health/route_client-reference-manifest.js +1 -1
  154. package/.next/standalone/.next/server/app/api/ideas/[uuid]/claim/route.js +1 -1
  155. package/.next/standalone/.next/server/app/api/ideas/[uuid]/claim/route_client-reference-manifest.js +1 -1
  156. package/.next/standalone/.next/server/app/api/ideas/[uuid]/move/preview/route.js +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_client-reference-manifest.js +1 -1
  160. package/.next/standalone/.next/server/app/api/ideas/[uuid]/parent/route.js +1 -1
  161. package/.next/standalone/.next/server/app/api/ideas/[uuid]/parent/route_client-reference-manifest.js +1 -1
  162. package/.next/standalone/.next/server/app/api/ideas/[uuid]/release/route.js +1 -1
  163. package/.next/standalone/.next/server/app/api/ideas/[uuid]/release/route_client-reference-manifest.js +1 -1
  164. package/.next/standalone/.next/server/app/api/ideas/[uuid]/route.js +1 -1
  165. package/.next/standalone/.next/server/app/api/ideas/[uuid]/route_client-reference-manifest.js +1 -1
  166. package/.next/standalone/.next/server/app/api/ideas/[uuid]/wake-preview/route.js +1 -1
  167. package/.next/standalone/.next/server/app/api/ideas/[uuid]/wake-preview/route_client-reference-manifest.js +1 -1
  168. package/.next/standalone/.next/server/app/api/ideas/conversational/route.js +1 -1
  169. package/.next/standalone/.next/server/app/api/ideas/conversational/route_client-reference-manifest.js +1 -1
  170. package/.next/standalone/.next/server/app/api/mcp/route.js +4 -4
  171. package/.next/standalone/.next/server/app/api/mcp/route_client-reference-manifest.js +1 -1
  172. package/.next/standalone/.next/server/app/api/me/assignments/route.js +1 -1
  173. package/.next/standalone/.next/server/app/api/me/assignments/route_client-reference-manifest.js +1 -1
  174. package/.next/standalone/.next/server/app/api/mentionables/route.js +1 -1
  175. package/.next/standalone/.next/server/app/api/mentionables/route_client-reference-manifest.js +1 -1
  176. package/.next/standalone/.next/server/app/api/notifications/[uuid]/archive/route.js +1 -1
  177. package/.next/standalone/.next/server/app/api/notifications/[uuid]/archive/route_client-reference-manifest.js +1 -1
  178. package/.next/standalone/.next/server/app/api/notifications/[uuid]/read/route.js +1 -1
  179. package/.next/standalone/.next/server/app/api/notifications/[uuid]/read/route_client-reference-manifest.js +1 -1
  180. package/.next/standalone/.next/server/app/api/notifications/preferences/route.js +1 -1
  181. package/.next/standalone/.next/server/app/api/notifications/preferences/route_client-reference-manifest.js +1 -1
  182. package/.next/standalone/.next/server/app/api/notifications/read-all/route.js +1 -1
  183. package/.next/standalone/.next/server/app/api/notifications/read-all/route_client-reference-manifest.js +1 -1
  184. package/.next/standalone/.next/server/app/api/notifications/route.js +1 -1
  185. package/.next/standalone/.next/server/app/api/notifications/route_client-reference-manifest.js +1 -1
  186. package/.next/standalone/.next/server/app/api/notifications/unread-count/route.js +1 -1
  187. package/.next/standalone/.next/server/app/api/notifications/unread-count/route_client-reference-manifest.js +1 -1
  188. package/.next/standalone/.next/server/app/api/project-groups/[uuid]/dashboard/route.js +1 -1
  189. package/.next/standalone/.next/server/app/api/project-groups/[uuid]/dashboard/route_client-reference-manifest.js +1 -1
  190. package/.next/standalone/.next/server/app/api/project-groups/[uuid]/route.js +1 -1
  191. package/.next/standalone/.next/server/app/api/project-groups/[uuid]/route_client-reference-manifest.js +1 -1
  192. package/.next/standalone/.next/server/app/api/project-groups/route.js +1 -1
  193. package/.next/standalone/.next/server/app/api/project-groups/route_client-reference-manifest.js +1 -1
  194. package/.next/standalone/.next/server/app/api/project-visits/pin/route.js +1 -1
  195. package/.next/standalone/.next/server/app/api/project-visits/pin/route_client-reference-manifest.js +1 -1
  196. package/.next/standalone/.next/server/app/api/project-visits/route.js +1 -1
  197. package/.next/standalone/.next/server/app/api/project-visits/route_client-reference-manifest.js +1 -1
  198. package/.next/standalone/.next/server/app/api/project-visits/visit/route.js +1 -1
  199. package/.next/standalone/.next/server/app/api/project-visits/visit/route_client-reference-manifest.js +1 -1
  200. package/.next/standalone/.next/server/app/api/projects/[uuid]/activity/route.js +1 -1
  201. package/.next/standalone/.next/server/app/api/projects/[uuid]/activity/route_client-reference-manifest.js +1 -1
  202. package/.next/standalone/.next/server/app/api/projects/[uuid]/agent-cwds/route.js +1 -1
  203. package/.next/standalone/.next/server/app/api/projects/[uuid]/agent-cwds/route_client-reference-manifest.js +1 -1
  204. package/.next/standalone/.next/server/app/api/projects/[uuid]/available/route.js +1 -1
  205. package/.next/standalone/.next/server/app/api/projects/[uuid]/available/route_client-reference-manifest.js +1 -1
  206. package/.next/standalone/.next/server/app/api/projects/[uuid]/documents/route.js +1 -1
  207. package/.next/standalone/.next/server/app/api/projects/[uuid]/documents/route_client-reference-manifest.js +1 -1
  208. package/.next/standalone/.next/server/app/api/projects/[uuid]/group/route.js +1 -1
  209. package/.next/standalone/.next/server/app/api/projects/[uuid]/group/route_client-reference-manifest.js +1 -1
  210. package/.next/standalone/.next/server/app/api/projects/[uuid]/ideas/route.js +1 -1
  211. package/.next/standalone/.next/server/app/api/projects/[uuid]/ideas/route_client-reference-manifest.js +1 -1
  212. package/.next/standalone/.next/server/app/api/projects/[uuid]/ideas/tracker/route.js +1 -1
  213. package/.next/standalone/.next/server/app/api/projects/[uuid]/ideas/tracker/route_client-reference-manifest.js +1 -1
  214. package/.next/standalone/.next/server/app/api/projects/[uuid]/proposals/[proposalUuid]/validate/route.js +1 -1
  215. package/.next/standalone/.next/server/app/api/projects/[uuid]/proposals/[proposalUuid]/validate/route_client-reference-manifest.js +1 -1
  216. package/.next/standalone/.next/server/app/api/projects/[uuid]/proposals/route.js +1 -1
  217. package/.next/standalone/.next/server/app/api/projects/[uuid]/proposals/route_client-reference-manifest.js +1 -1
  218. package/.next/standalone/.next/server/app/api/projects/[uuid]/proposals/summary/route.js +1 -1
  219. package/.next/standalone/.next/server/app/api/projects/[uuid]/proposals/summary/route_client-reference-manifest.js +1 -1
  220. package/.next/standalone/.next/server/app/api/projects/[uuid]/resource-graph/route.js +1 -1
  221. package/.next/standalone/.next/server/app/api/projects/[uuid]/resource-graph/route_client-reference-manifest.js +1 -1
  222. package/.next/standalone/.next/server/app/api/projects/[uuid]/route.js +1 -1
  223. package/.next/standalone/.next/server/app/api/projects/[uuid]/route_client-reference-manifest.js +1 -1
  224. package/.next/standalone/.next/server/app/api/projects/[uuid]/stats/route.js +1 -1
  225. package/.next/standalone/.next/server/app/api/projects/[uuid]/stats/route_client-reference-manifest.js +1 -1
  226. package/.next/standalone/.next/server/app/api/projects/[uuid]/tasks/dependencies/route.js +1 -1
  227. package/.next/standalone/.next/server/app/api/projects/[uuid]/tasks/dependencies/route_client-reference-manifest.js +1 -1
  228. package/.next/standalone/.next/server/app/api/projects/[uuid]/tasks/route.js +1 -1
  229. package/.next/standalone/.next/server/app/api/projects/[uuid]/tasks/route_client-reference-manifest.js +1 -1
  230. package/.next/standalone/.next/server/app/api/projects/agent-cwd-options/route.js +1 -1
  231. package/.next/standalone/.next/server/app/api/projects/agent-cwd-options/route_client-reference-manifest.js +1 -1
  232. package/.next/standalone/.next/server/app/api/projects/route.js +1 -1
  233. package/.next/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
  234. package/.next/standalone/.next/server/app/api/proposals/[uuid]/approve/route.js +1 -1
  235. package/.next/standalone/.next/server/app/api/proposals/[uuid]/approve/route_client-reference-manifest.js +1 -1
  236. package/.next/standalone/.next/server/app/api/proposals/[uuid]/close/route.js +1 -1
  237. package/.next/standalone/.next/server/app/api/proposals/[uuid]/close/route_client-reference-manifest.js +1 -1
  238. package/.next/standalone/.next/server/app/api/proposals/[uuid]/reject/route.js +1 -1
  239. package/.next/standalone/.next/server/app/api/proposals/[uuid]/reject/route_client-reference-manifest.js +1 -1
  240. package/.next/standalone/.next/server/app/api/proposals/[uuid]/revoke/route.js +1 -1
  241. package/.next/standalone/.next/server/app/api/proposals/[uuid]/revoke/route_client-reference-manifest.js +1 -1
  242. package/.next/standalone/.next/server/app/api/proposals/[uuid]/route.js +1 -1
  243. package/.next/standalone/.next/server/app/api/proposals/[uuid]/route_client-reference-manifest.js +1 -1
  244. package/.next/standalone/.next/server/app/api/references/[uuid]/route.js +1 -1
  245. package/.next/standalone/.next/server/app/api/references/[uuid]/route_client-reference-manifest.js +1 -1
  246. package/.next/standalone/.next/server/app/api/references/route.js +1 -1
  247. package/.next/standalone/.next/server/app/api/references/route_client-reference-manifest.js +1 -1
  248. package/.next/standalone/.next/server/app/api/search/route.js +1 -1
  249. package/.next/standalone/.next/server/app/api/search/route_client-reference-manifest.js +1 -1
  250. package/.next/standalone/.next/server/app/api/session/route.js +1 -1
  251. package/.next/standalone/.next/server/app/api/session/route_client-reference-manifest.js +1 -1
  252. package/.next/standalone/.next/server/app/api/sessions/[uuid]/route.js +1 -1
  253. package/.next/standalone/.next/server/app/api/sessions/[uuid]/route_client-reference-manifest.js +1 -1
  254. package/.next/standalone/.next/server/app/api/tasks/[uuid]/claim/route.js +1 -1
  255. package/.next/standalone/.next/server/app/api/tasks/[uuid]/claim/route_client-reference-manifest.js +1 -1
  256. package/.next/standalone/.next/server/app/api/tasks/[uuid]/dependencies/[dependsOnUuid]/route.js +1 -1
  257. package/.next/standalone/.next/server/app/api/tasks/[uuid]/dependencies/[dependsOnUuid]/route_client-reference-manifest.js +1 -1
  258. package/.next/standalone/.next/server/app/api/tasks/[uuid]/dependencies/route.js +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_client-reference-manifest.js +1 -1
  262. package/.next/standalone/.next/server/app/api/tasks/[uuid]/route.js +1 -1
  263. package/.next/standalone/.next/server/app/api/tasks/[uuid]/route_client-reference-manifest.js +1 -1
  264. package/.next/standalone/.next/server/app/api/tasks/[uuid]/sessions/route.js +1 -1
  265. package/.next/standalone/.next/server/app/api/tasks/[uuid]/sessions/route_client-reference-manifest.js +1 -1
  266. package/.next/standalone/.next/server/app/favicon.ico/route.js +1 -1
  267. package/.next/standalone/.next/server/app/index.html +2 -2
  268. package/.next/standalone/.next/server/app/index.rsc +6 -6
  269. package/.next/standalone/.next/server/app/login/admin/page.js +2 -2
  270. package/.next/standalone/.next/server/app/login/admin/page.js.nft.json +1 -1
  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 +2 -2
  273. package/.next/standalone/.next/server/app/login/admin.rsc +6 -6
  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 +2 -2
  278. package/.next/standalone/.next/server/app/login/callback.rsc +6 -6
  279. package/.next/standalone/.next/server/app/login/page.js +2 -2
  280. package/.next/standalone/.next/server/app/login/page.js.nft.json +1 -1
  281. package/.next/standalone/.next/server/app/login/page_client-reference-manifest.js +1 -1
  282. package/.next/standalone/.next/server/app/login/pick-workspace/page.js +2 -2
  283. package/.next/standalone/.next/server/app/login/pick-workspace/page.js.nft.json +1 -1
  284. package/.next/standalone/.next/server/app/login/pick-workspace/page_client-reference-manifest.js +1 -1
  285. package/.next/standalone/.next/server/app/login/pick-workspace.html +2 -2
  286. package/.next/standalone/.next/server/app/login/pick-workspace.rsc +6 -6
  287. package/.next/standalone/.next/server/app/login.html +2 -2
  288. package/.next/standalone/.next/server/app/login.rsc +6 -6
  289. package/.next/standalone/.next/server/app/onboarding/page.js +2 -2
  290. package/.next/standalone/.next/server/app/onboarding/page.js.nft.json +1 -1
  291. package/.next/standalone/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  292. package/.next/standalone/.next/server/app/onboarding.html +2 -2
  293. package/.next/standalone/.next/server/app/onboarding.rsc +6 -6
  294. package/.next/standalone/.next/server/app/page.js +2 -2
  295. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  296. package/.next/standalone/.next/server/app/projects.html +2 -2
  297. package/.next/standalone/.next/server/app/projects.rsc +7 -7
  298. package/.next/standalone/.next/server/app/settings.html +2 -2
  299. package/.next/standalone/.next/server/app/settings.rsc +7 -7
  300. package/.next/standalone/.next/server/app-paths-manifest.json +44 -44
  301. package/.next/standalone/.next/server/chunks/1114.js +1 -1
  302. package/.next/standalone/.next/server/chunks/1267.js +1 -0
  303. package/.next/standalone/.next/server/chunks/1318.js +1 -1
  304. package/.next/standalone/.next/server/chunks/1559.js +2 -2
  305. package/.next/standalone/.next/server/chunks/{3831.js → 2536.js} +6 -4
  306. package/.next/standalone/.next/server/chunks/2570.js +2 -2
  307. package/.next/standalone/.next/server/chunks/2572.js +1 -1
  308. package/.next/standalone/.next/server/chunks/2940.js +1 -1
  309. package/.next/standalone/.next/server/chunks/2953.js +1 -0
  310. package/.next/standalone/.next/server/chunks/2961.js +1 -1
  311. package/.next/standalone/.next/server/chunks/3197.js +1 -1
  312. package/.next/standalone/.next/server/chunks/378.js +4 -4
  313. package/.next/standalone/.next/server/chunks/4827.js +1 -1
  314. package/.next/standalone/.next/server/chunks/5162.js +1 -0
  315. package/.next/standalone/.next/server/chunks/5245.js +1 -1
  316. package/.next/standalone/.next/server/chunks/{5706.js → 6080.js} +1 -1
  317. package/.next/standalone/.next/server/chunks/6113.js +1 -1
  318. package/.next/standalone/.next/server/chunks/6145.js +1 -0
  319. package/.next/standalone/.next/server/chunks/6506.js +1 -1
  320. package/.next/standalone/.next/server/chunks/6515.js +2 -2
  321. package/.next/standalone/.next/server/chunks/6689.js +1 -0
  322. package/.next/standalone/.next/server/chunks/6753.js +3 -3
  323. package/.next/standalone/.next/server/chunks/679.js +1 -1
  324. package/.next/standalone/.next/server/chunks/7368.js +1 -1
  325. package/.next/standalone/.next/server/chunks/7530.js +1 -1
  326. package/.next/standalone/.next/server/chunks/8454.js +1 -1
  327. package/.next/standalone/.next/server/chunks/920.js +1 -1
  328. package/.next/standalone/.next/server/chunks/9213.js +1 -1
  329. package/.next/standalone/.next/server/chunks/9378.js +1 -1
  330. package/.next/standalone/.next/server/chunks/9667.js +1 -0
  331. package/.next/standalone/.next/server/chunks/9931.js +1 -0
  332. package/.next/standalone/.next/server/middleware-build-manifest.js +1 -1
  333. package/.next/standalone/.next/server/middleware-manifest.json +5 -5
  334. package/.next/standalone/.next/server/middleware-react-loadable-manifest.js +1 -1
  335. package/.next/standalone/.next/server/next-font-manifest.js +1 -1
  336. package/.next/standalone/.next/server/next-font-manifest.json +1 -1
  337. package/.next/standalone/.next/server/pages/404.html +2 -2
  338. package/.next/standalone/.next/server/pages/500.html +1 -1
  339. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  340. package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
  341. package/.next/standalone/.next/server/src/middleware.js +2 -2
  342. package/.next/standalone/.next/static/chunks/{11595.bbe40924d18958bf.js → 11595.b81c0bf7732c3b62.js} +1 -1
  343. package/.next/standalone/.next/static/chunks/24808-e3d95efc7ec039c5.js +1 -0
  344. package/.next/standalone/.next/static/chunks/{31308-bb4a97b3f39c22dd.js → 31308-32614efb88305738.js} +1 -1
  345. package/.next/standalone/.next/static/chunks/{33456.5499eb8e892b110a.js → 33456.cfc9aa607a62e879.js} +1 -1
  346. package/.next/standalone/.next/static/chunks/38366.fb931fab9c756890.js +1 -0
  347. package/.next/standalone/.next/static/chunks/{4860.be77046fb2b3a2bd.js → 4860.41351a823cf400e4.js} +1 -1
  348. package/.next/standalone/.next/static/chunks/51468-194d894e563580dd.js +1 -0
  349. package/.next/standalone/.next/static/chunks/61570-527701d072d00a24.js +1 -0
  350. package/.next/standalone/.next/static/chunks/65066-6da35d5cb080c7f5.js +1 -0
  351. package/.next/standalone/.next/static/chunks/{65096-f756aac39efad7a3.js → 65096-8295f53f97c40d47.js} +1 -1
  352. package/.next/standalone/.next/static/chunks/72875-0987d09cd8406614.js +1 -0
  353. package/.next/standalone/.next/static/chunks/75936-79860953212592fd.js +1 -0
  354. package/.next/standalone/.next/static/chunks/{78917-a8a8dff98857c045.js → 79919-e02963faee5cb563.js} +1 -1
  355. package/.next/standalone/.next/static/chunks/94643-e8f5fa25e2340cc8.js +1 -0
  356. package/.next/standalone/.next/static/chunks/{99373.111493dc260a2a04.js → 99373.633f7c25e64bcdac.js} +1 -1
  357. package/.next/standalone/.next/static/chunks/app/(dashboard)/layout-bb5ef11586301c72.js +1 -0
  358. package/.next/standalone/.next/static/chunks/app/(dashboard)/project-groups/[uuid]/{page-974781e4886529f8.js → page-82e90e222d6bc547.js} +1 -1
  359. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/activity/page-f1eccb50d38d8982.js +1 -0
  360. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/dashboard/page-eecb38fa4b8eb4e8.js +1 -0
  361. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/documents/[documentUuid]/page-725373108da1b08c.js +1 -0
  362. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/documents/page-cd7ec77596304a07.js +1 -0
  363. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/graph/page-97a9e6f949002004.js +1 -0
  364. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/[proposalUuid]/page-7d2f4713697eb0a7.js +1 -0
  365. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/new/page-cec15f4b835d34fc.js +1 -0
  366. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/page-0225f87552b977d9.js +1 -0
  367. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/tasks/[taskUuid]/{page-15bb6e1696668512.js → page-4ee117e690fda56f.js} +1 -1
  368. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/tasks/{page-2bea97214b1595cc.js → page-7fbc46dfb7b22bd3.js} +1 -1
  369. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/page-069c9738e516436b.js +1 -0
  370. package/.next/standalone/.next/static/chunks/app/(dashboard)/settings/page-8b30678a58e7b2ee.js +1 -0
  371. package/.next/standalone/.next/static/chunks/app/_not-found/{page-166b410da84336d4.js → page-b9d672df79b35e87.js} +1 -1
  372. package/.next/standalone/.next/static/chunks/app/admin/companies/[uuid]/{page-b2458ed001dc8177.js → page-56118c51122ad639.js} +1 -1
  373. package/.next/standalone/.next/static/chunks/app/admin/companies/new/page-4e20deb41357171c.js +1 -0
  374. package/.next/standalone/.next/static/chunks/app/admin/companies/page-0632f245bf9c1c27.js +1 -0
  375. package/.next/standalone/.next/static/chunks/app/admin/layout-725ab2331c642f36.js +1 -0
  376. package/.next/standalone/.next/static/chunks/app/admin/{page-0cc8cf246db43e5d.js → page-5a0271dd2b8b36fd.js} +1 -1
  377. package/.next/standalone/.next/static/chunks/app/{layout-985054e973f66999.js → layout-098288cec4490c5d.js} +1 -1
  378. package/.next/standalone/.next/static/chunks/app/login/admin/page-c8e40259e5d3d9e0.js +1 -0
  379. package/.next/standalone/.next/static/chunks/app/login/callback/page-527652f6c1a39274.js +1 -0
  380. package/.next/standalone/.next/static/chunks/app/login/{page-9b34375d1b5579d7.js → page-0a16a64855b771ef.js} +1 -1
  381. package/.next/standalone/.next/static/chunks/app/login/pick-workspace/page-47375a86e2375202.js +1 -0
  382. package/.next/standalone/.next/static/chunks/app/onboarding/{page-540da64d7ba16dc7.js → page-4fce966dc96d4ff1.js} +1 -1
  383. package/.next/standalone/.next/static/chunks/app/{page-79e2d32e69788bd2.js → page-91dbf7dfd85f805f.js} +1 -1
  384. package/.next/standalone/.next/static/chunks/main-app-1a7cacecc8900a4d.js +1 -0
  385. package/.next/standalone/.next/static/chunks/{webpack-7cbb3ba6792f1fb3.js → webpack-1bfc783412a06fc5.js} +1 -1
  386. package/.next/standalone/.next/static/css/1d9cf83f50b6db00.css +1 -0
  387. package/.next/standalone/package.json +2 -1
  388. package/.next/standalone/public/chorus-plugin/.claude-plugin/plugin.json +1 -1
  389. package/.next/standalone/public/chorus-plugin/bin/chorus-api.sh +1 -1
  390. package/.next/standalone/public/chorus-plugin/skills/brainstorm/SKILL.md +1 -1
  391. package/.next/standalone/public/chorus-plugin/skills/chorus/SKILL.md +2 -2
  392. package/.next/standalone/public/chorus-plugin/skills/chorus-cli/SKILL.md +11 -1
  393. package/.next/standalone/public/chorus-plugin/skills/develop/SKILL.md +2 -2
  394. package/.next/standalone/public/chorus-plugin/skills/docs/SKILL.md +1 -1
  395. package/.next/standalone/public/chorus-plugin/skills/idea/SKILL.md +2 -2
  396. package/.next/standalone/public/chorus-plugin/skills/openspec-aware/SKILL.md +1 -1
  397. package/.next/standalone/public/chorus-plugin/skills/orchestrate/SKILL.md +1 -1
  398. package/.next/standalone/public/chorus-plugin/skills/proposal/SKILL.md +1 -1
  399. package/.next/standalone/public/chorus-plugin/skills/quick-dev/SKILL.md +1 -1
  400. package/.next/standalone/public/chorus-plugin/skills/review/SKILL.md +1 -1
  401. package/.next/standalone/public/chorus-plugin/skills/yolo/SKILL.md +3 -3
  402. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-brainstorm/SKILL.md +1 -1
  403. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-cli/SKILL.md +11 -1
  404. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-develop/SKILL.md +2 -2
  405. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-docs/SKILL.md +1 -1
  406. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-idea/SKILL.md +2 -2
  407. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-openspec-aware/SKILL.md +1 -1
  408. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-orchestrate/SKILL.md +1 -1
  409. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-proposal/SKILL.md +1 -1
  410. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-quick-dev/SKILL.md +1 -1
  411. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-review/SKILL.md +1 -1
  412. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-yolo/SKILL.md +3 -3
  413. package/.next/standalone/public/kiro-plugin/.kiro/steering/chorus.md +1 -1
  414. package/.next/standalone/public/kiro-plugin/bin/chorus-api.sh +1 -1
  415. package/.next/standalone/public/kiro-plugin/manifest.txt +1 -0
  416. package/.next/standalone/public/skill/chorus/SKILL.md +1 -1
  417. package/.next/standalone/public/skill/develop-chorus/SKILL.md +1 -1
  418. package/.next/standalone/public/skill/idea-chorus/SKILL.md +1 -1
  419. package/.next/standalone/public/skill/yolo-chorus/SKILL.md +2 -2
  420. package/.next/standalone/server.js +1 -1
  421. package/README.ja.md +5 -1
  422. package/README.ko.md +5 -1
  423. package/README.md +5 -1
  424. package/README.zh.md +5 -1
  425. package/cli/agent-backend-prompt.mjs +5 -0
  426. package/cli/agent-launcher.mjs +341 -0
  427. package/cli/agents.mjs +12 -0
  428. package/cli/claude-spawner.mjs +52 -15
  429. package/cli/credentials.mjs +107 -1
  430. package/cli/daemon-agent.mjs +4 -2
  431. package/cli/init/adapters.mjs +5 -5
  432. package/cli/init/agent-type-map.mjs +5 -5
  433. package/cli/init/contracts.mjs +2 -0
  434. package/cli/init/install-methods.mjs +206 -31
  435. package/cli/init/pi-mcp-config.mjs +166 -0
  436. package/cli/init/steps/credential-seed.mjs +56 -3
  437. package/cli/init-args.mjs +4 -1
  438. package/cli/init.mjs +47 -2
  439. package/cli/kiro-spawner.mjs +1 -0
  440. package/cli/pi-spawner.mjs +286 -0
  441. package/cli/spawner-select.mjs +7 -1
  442. package/cli/upload-hooks.mjs +25 -1
  443. package/cli/waker.mjs +89 -38
  444. package/package.json +2 -1
  445. package/.next/standalone/.env +0 -18
  446. package/.next/standalone/.next/server/chunks/1437.js +0 -1
  447. package/.next/standalone/.next/server/chunks/3045.js +0 -1
  448. package/.next/standalone/.next/server/chunks/4545.js +0 -1
  449. package/.next/standalone/.next/server/chunks/6207.js +0 -1
  450. package/.next/standalone/.next/server/chunks/7091.js +0 -1
  451. package/.next/standalone/.next/server/chunks/9449.js +0 -1
  452. package/.next/standalone/.next/server/chunks/9458.js +0 -1
  453. package/.next/standalone/.next/static/chunks/18139-e6ef4b5869593f8e.js +0 -1
  454. package/.next/standalone/.next/static/chunks/28856-ef2cb58fbd404ef9.js +0 -1
  455. package/.next/standalone/.next/static/chunks/38366.e6e0132b8ba873d6.js +0 -1
  456. package/.next/standalone/.next/static/chunks/66873-e3be53f41b3f2255.js +0 -1
  457. package/.next/standalone/.next/static/chunks/70303-aec3d52ad87602a3.js +0 -1
  458. package/.next/standalone/.next/static/chunks/76201-83b26515f85ce37c.js +0 -1
  459. package/.next/standalone/.next/static/chunks/94643-ffa140f765c73daf.js +0 -1
  460. package/.next/standalone/.next/static/chunks/97663-9c3ae4fd60b353db.js +0 -1
  461. package/.next/standalone/.next/static/chunks/app/(dashboard)/layout-40fe7d026c5a7c6d.js +0 -1
  462. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/activity/page-20632dbec5a6dbc0.js +0 -1
  463. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/dashboard/page-87d4d0fe90fca28c.js +0 -1
  464. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/documents/[documentUuid]/page-1206abaee85dc915.js +0 -1
  465. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/documents/page-474e494097c8945f.js +0 -1
  466. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/graph/page-e902b19328092ccf.js +0 -1
  467. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/[proposalUuid]/page-f273288c3530aa0f.js +0 -1
  468. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/new/page-6568a7b08bf9a54b.js +0 -1
  469. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/page-fbd3c27b68666234.js +0 -1
  470. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/page-9d79e285b6fd2f8d.js +0 -1
  471. package/.next/standalone/.next/static/chunks/app/(dashboard)/settings/page-2bf7ceee62b574c7.js +0 -1
  472. package/.next/standalone/.next/static/chunks/app/admin/companies/new/page-e35dce890d6dfd8d.js +0 -1
  473. package/.next/standalone/.next/static/chunks/app/admin/companies/page-ef720c2b0856166c.js +0 -1
  474. package/.next/standalone/.next/static/chunks/app/admin/layout-c66ce38cbd88982a.js +0 -1
  475. package/.next/standalone/.next/static/chunks/app/login/admin/page-f032b6db3bd20a2c.js +0 -1
  476. package/.next/standalone/.next/static/chunks/app/login/callback/page-ec23211506e688ee.js +0 -1
  477. package/.next/standalone/.next/static/chunks/app/login/pick-workspace/page-7e4664af2c787d08.js +0 -1
  478. package/.next/standalone/.next/static/chunks/main-app-ec87f2c9ef083ff1.js +0 -1
  479. package/.next/standalone/.next/static/css/5f52bd39b284ccdf.css +0 -1
  480. /package/.next/standalone/.next/static/{0spgxl3lP26Fl1otd1D7R → WSN4XeA1kUCI6CeEHcaT_}/_buildManifest.js +0 -0
  481. /package/.next/standalone/.next/static/{0spgxl3lP26Fl1otd1D7R → WSN4XeA1kUCI6CeEHcaT_}/_ssgManifest.js +0 -0
package/cli/waker.mjs CHANGED
@@ -21,7 +21,7 @@
21
21
 
22
22
  import { buildBatchPrompt } from "./prompts.mjs";
23
23
  import { writeMcpConfig } from "./mcp-config.mjs";
24
- import { isNewSession } from "./claude-spawner.mjs";
24
+ import { isNewSession, SESSION_CONFLICT_FAILURE } from "./claude-spawner.mjs";
25
25
  import { killProcessTree, DEFAULT_SIGINT_TIMEOUT_MS } from "./process-killer.mjs";
26
26
 
27
27
  const NOOP_LOGGER = { info() {}, warn() {}, error() {} };
@@ -31,7 +31,7 @@ export class Waker {
31
31
  * @param {{
32
32
  * creds: { url: string, apiKey: string },
33
33
  * lineage: { resolve: (event: any) => Promise<{ rootIdeaUuid: string|null, directIdeaUuid: string|null }> },
34
- * spawner: { wake: (params: any) => Promise<{ sessionId: string, exitCode: number|null, isNew: boolean }> },
34
+ * spawner: { wake: (params: any) => Promise<{ sessionId: string, backendSessionId?: string|null, exitCode: number|null, isNew: boolean, failureClassification?: string }> },
35
35
  * cwd?: string, The connection/session-bound working directory this Waker serves; resolveCwd() is the single source the probe + spawn + resume use. `undefined` ⇒ the process default cwd (HARD-1 / single-path).
36
36
  * validateRuntimeCwd?: (cwd: string) => Promise<{normalizedPath?: string}>,
37
37
  * hooks?: import("./upload-hooks.mjs").UploadHooks,
@@ -101,6 +101,13 @@ export class Waker {
101
101
  // wake's exit path reads + clears it to decide reason=user vs reason=crash.
102
102
  /** @type {Set<string>} */
103
103
  this.interrupting = new Set();
104
+ // Session/entity lanes whose deterministic Claude conflict survived the one-shot
105
+ // resume fallback. Only a synthetic crash resume for the same lane is suppressed;
106
+ // unrelated wakes continue, and a fresh human instruction clears the lane so one
107
+ // new bounded recovery cycle is allowed. Daemon-local by design: construction
108
+ // (including daemon restart) starts with an empty guard.
109
+ /** @type {Set<string>} */
110
+ this.deterministicConflictGuards = new Set();
104
111
  // Daemon graceful-shutdown flag (fix-daemon-exit-orphan-running-turn). Set once
105
112
  // by interruptAll() and never cleared — a shutting-down Waker is on its way out.
106
113
  // The wake exit path reads it to report the TURN as interrupted(shutdown), and to
@@ -359,7 +366,28 @@ export class Waker {
359
366
  */
360
367
  async wakeBatch(notifications, key, attribution) {
361
368
  let cfg;
362
- const list = Array.isArray(notifications) ? notifications : [];
369
+ const receivedList = Array.isArray(notifications) ? notifications : [];
370
+ const hasFreshHumanInstruction = receivedList.some(
371
+ (n) => n?.action === "human_instruction",
372
+ );
373
+ if (hasFreshHumanInstruction && this.deterministicConflictGuards.delete(key)) {
374
+ this.logger.info(
375
+ `[Chorus] cleared deterministic session-conflict guard for ${key} on fresh human instruction`,
376
+ );
377
+ }
378
+ const list =
379
+ !hasFreshHumanInstruction && this.deterministicConflictGuards.has(key)
380
+ ? receivedList.filter((n) => {
381
+ const suppress =
382
+ n?.action === "resource_resumed" && n?.resumedFrom === "crash";
383
+ if (suppress) {
384
+ this.logger.warn(
385
+ `[Chorus] suppressed automatic crash resume for ${key}: deterministic session conflict fallback already exhausted`,
386
+ );
387
+ }
388
+ return !suppress;
389
+ })
390
+ : receivedList;
363
391
  // Physical batch size — how many wakes were coalesced into this one turn. Drives the
364
392
  // session-anchor synthesis (a coalesced batch shows ONE synthesized idea row) and the
365
393
  // arrival log label. Independent of the wire count below.
@@ -390,7 +418,7 @@ export class Waker {
390
418
  // all leave the executions map when the batch settles so the server reconcile ends the
391
419
  // queued rows the batch coalesced away (a coalesced batch shows only ONE running row).
392
420
  const drainedExecKeys = [];
393
- for (const n of list) {
421
+ for (const n of receivedList) {
394
422
  const e = this.#entityOf(n);
395
423
  if (e) drainedExecKeys.push(this.#execKey(e.entityType, e.entityUuid));
396
424
  }
@@ -515,7 +543,39 @@ export class Waker {
515
543
  // it even before spawner.wake() returns. (Do NOT reference the awaited
516
544
  // `result` inside onMessage — it's in the temporal dead zone there.)
517
545
  let observedSessionId = sessionId ?? "";
518
- const result = await this.spawner.wake({
546
+ const onChild = (child) => {
547
+ const entry = execKey ? this.executions.get(execKey) : null;
548
+ if (entry && entry.status === "running") entry.child = child;
549
+ if (sessionId && !turnAdvancedToRunning) {
550
+ turnAdvancedToRunning = true;
551
+ // Fire-and-forget; #advanceTurn swallows + logs its own failures so a
552
+ // turn-report error never crashes the spawn callback (no-silent-errors).
553
+ // The coalescedCount rides this → running edge so the server settles the
554
+ // (count − 1) same-session pending turns coalesced into this one (a single
555
+ // wake reports 1, which the client omits from the wire).
556
+ runningTurnUuidPromise = this.#advanceTurn(
557
+ sessionId,
558
+ "running",
559
+ entity,
560
+ null,
561
+ null,
562
+ null,
563
+ null,
564
+ coalescedCount,
565
+ );
566
+ }
567
+ };
568
+ const onMessage = (message) => {
569
+ if (message && typeof message.session_id === "string") observedSessionId = message.session_id;
570
+ // Fire-and-forget transcript hook (子1): keeps only user/assistant text and
571
+ // batch-POSTs to /api/daemon/transcript for the current turn. Warn-not-throw
572
+ // inside the hook; the trailing .catch is belt-and-braces so a rejected hook
573
+ // promise can never surface as an unhandled rejection in the wake path.
574
+ this.hooks
575
+ ?.onTranscriptMessage?.({ rootIdeaKey: key, sessionId: observedSessionId, message })
576
+ .catch(() => {});
577
+ };
578
+ const wakeParams = {
519
579
  prompt,
520
580
  sessionId,
521
581
  isNew,
@@ -526,39 +586,30 @@ export class Waker {
526
586
  // a re-keyed/dropped entry never throws here. ALSO advance the server turn
527
587
  // pending→running here (子1) — same hook keying, no parallel registry — since
528
588
  // this is the precise moment the subprocess actually started.
529
- onChild: (child) => {
530
- const entry = execKey ? this.executions.get(execKey) : null;
531
- if (entry && entry.status === "running") entry.child = child;
532
- if (sessionId) {
533
- turnAdvancedToRunning = true;
534
- // Fire-and-forget; #advanceTurn swallows + logs its own failures so a
535
- // turn-report error never crashes the spawn callback (no-silent-errors).
536
- // The coalescedCount rides this running edge so the server settles the
537
- // (count 1) same-session pending turns coalesced into this one (a single
538
- // wake reports 1, which the client omits from the wire).
539
- runningTurnUuidPromise = this.#advanceTurn(
540
- sessionId,
541
- "running",
542
- entity,
543
- null,
544
- null,
545
- null,
546
- null,
547
- coalescedCount,
548
- );
549
- }
550
- },
551
- onMessage: (message) => {
552
- if (message && typeof message.session_id === "string") observedSessionId = message.session_id;
553
- // Fire-and-forget transcript hook (子1): keeps only user/assistant text and
554
- // batch-POSTs to /api/daemon/transcript for the current turn. Warn-not-throw
555
- // inside the hook; the trailing .catch is belt-and-braces so a rejected hook
556
- // promise can never surface as an unhandled rejection in the wake path.
557
- this.hooks
558
- ?.onTranscriptMessage?.({ rootIdeaKey: key, sessionId: observedSessionId, message })
559
- .catch(() => {});
560
- },
561
- });
589
+ onChild,
590
+ onMessage,
591
+ };
592
+ let result = await this.spawner.wake(wakeParams);
593
+
594
+ // Claude can still reject a new-session launch when its durable session exists
595
+ // but the transcript probe missed it. Retry that classified conflict exactly once
596
+ // as a resume. The shared callbacks preserve transcript flow and replace the live
597
+ // child for interrupt handling; onChild's gate keeps pending→running exactly once.
598
+ if (
599
+ isNew &&
600
+ result?.failureClassification === SESSION_CONFLICT_FAILURE
601
+ ) {
602
+ this.logger.warn(
603
+ `[Chorus] new-session conflict for ${key}; retrying once with resume`,
604
+ );
605
+ result = await this.spawner.wake({ ...wakeParams, isNew: false });
606
+ if (result?.failureClassification === SESSION_CONFLICT_FAILURE) {
607
+ this.deterministicConflictGuards.add(key);
608
+ this.logger.warn(
609
+ `[Chorus] deterministic session conflict fallback exhausted for ${key}; future automatic crash resumes will be suppressed`,
610
+ );
611
+ }
612
+ }
562
613
 
563
614
  if (result && !probeIsAuthoritative) {
564
615
  this.logger.info(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chorus-aidlc/chorus",
3
- "version": "0.17.0",
3
+ "version": "0.17.2",
4
4
  "description": "The Agent Harness for AI-Human Collaboration — session lifecycle, task state, sub-agent orchestration, observability, and failure recovery",
5
5
  "homepage": "https://github.com/Chorus-AIDLC/Chorus",
6
6
  "repository": {
@@ -58,6 +58,7 @@
58
58
  "landing:build": "pnpm --filter chorus-landing run build",
59
59
  "landing:preview": "pnpm --filter chorus-landing run preview",
60
60
  "test": "vitest run",
61
+ "test:release-contract": "node --test scripts/coordinated-npm-release/__tests__/coordinated-npm-release.test.mjs",
61
62
  "test:watch": "vitest",
62
63
  "test:coverage": "vitest run --coverage",
63
64
  "prepack": "pnpm build && node scripts/prepack-pglite.mjs"
@@ -1,18 +0,0 @@
1
- # Database
2
- DATABASE_URL="postgresql://chorus:chorus@localhost:5433/chorus"
3
-
4
- # NextAuth
5
- NEXTAUTH_URL="http://localhost:8637"
6
- NEXTAUTH_SECRET="development-secret-change-in-production"
7
-
8
- # Super Admin
9
- SUPER_ADMIN_EMAIL="admin@chorus.dev"
10
- # admin123
11
- SUPER_ADMIN_PASSWORD_HASH="$2a$10$.q1sLxRvEIh3Dvqkkbp2KeMs49QEtZW.2vtUYlbIOfckP.tBXe25S"
12
-
13
- # Redis (optional — falls back to in-memory EventBus when unset)
14
- REDIS_URLx="redis://default:chorus-redis@localhost:6379"
15
-
16
- # Default User Auth (simple login without OIDC)
17
- DEFAULT_USER="admin@chorus.local"
18
- DEFAULT_PASSWORD="chorus"
@@ -1 +0,0 @@
1
- "use strict";exports.id=1437,exports.ids=[1437],exports.modules={644:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(56556).A)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},5918:(a,b,c)=>{c.d(b,{f:()=>e});var d=c(42377);let e=(0,d.createServerReference)("40df0e37bb7fd45eb2156127819f061544ddd8d6a9",d.callServer,void 0,d.findSourceMapURL,"getTaskActivitiesAction")},7500:(a,b,c)=>{c.d(b,{k:()=>e});var d=c(42377);let e=(0,d.createServerReference)("40ad697a1d14baa1161964adf881e5e7d690d9abf6",d.callServer,void 0,d.findSourceMapURL,"getProjectTasksForDependencyAction")},18786:(a,b,c)=>{c.d(b,{h:()=>e});var d=c(42377);let e=(0,d.createServerReference)("602f7574dd5442ac3794acee13648d1644a27e918c",d.callServer,void 0,d.findSourceMapURL,"markCriteriaAction")},21326:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(56556).A)("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]])},22293:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{TK:()=>l,kq:()=>m,wG:()=>k,xo:()=>j});var e=c(2613);c(50785);var f=c(9259),g=c(50530),h=c(12217),i=a([f,g]);async function j(a){let b=await (0,f.d)();if(!b)return{dependsOn:[],dependedBy:[]};try{return await g.vQ(b.companyUuid,a)}catch{return{dependsOn:[],dependedBy:[]}}}async function k(a,b){let c=await (0,f.d)();if(!c)return{success:!1,error:"Unauthorized"};try{return await g.QL(c.companyUuid,a,b),{success:!0}}catch(a){return{success:!1,error:a instanceof Error?a.message:"Unknown error"}}}async function l(a,b){let c=await (0,f.d)();if(!c)return{success:!1,error:"Unauthorized"};try{return await g.j9(c.companyUuid,a,b),{success:!0}}catch(a){return{success:!1,error:a instanceof Error?a.message:"Unknown error"}}}async function m(a){let b=await (0,f.d)();if(!b)return{tasks:[]};try{return{tasks:(await g.Vk({companyUuid:b.companyUuid,projectUuid:a,skip:0,take:1e3})).tasks.map(a=>({uuid:a.uuid,title:a.title,status:a.status}))}}catch{return{tasks:[]}}}[f,g]=i.then?(await i)():i,(0,h.D)([j,k,l,m]),(0,e.A)(j,"40d05690894458aaf82b0c2c4be8ee949fcaca80e7",null),(0,e.A)(k,"60a261760cd422a0ac8a315798976aa6fcaa045c06",null),(0,e.A)(l,"60d060df79ef2d59464d72cf12df59c5a5bd429d11",null),(0,e.A)(m,"40ad697a1d14baa1161964adf881e5e7d690d9abf6",null),d()}catch(a){d(a)}})},22374:(a,b,c)=>{c.d(b,{Y:()=>e});var d=c(42377);let e=(0,d.createServerReference)("40c633a7d138bc6dbd6fdd66fe5cb7198e52f7112d",d.callServer,void 0,d.findSourceMapURL,"updateTaskFieldsAction")},25848:(a,b,c)=>{c.d(b,{J:()=>e});var d=c(42377);let e=(0,d.createServerReference)("404c9a2469eaa7fc0ba47937f4bc5509315d0ee72f",d.callServer,void 0,d.findSourceMapURL,"getTaskSessionsAction")},29061:(a,b,c)=>{c.d(b,{N:()=>e});var d=c(42377);let e=(0,d.createServerReference)("6025177641cdabba8bf9655dbd3cd3761c125951a6",d.callServer,void 0,d.findSourceMapURL,"resetCriterionAction")},39347:(a,b,c)=>{c.d(b,{T:()=>e});var d=c(42377);let e=(0,d.createServerReference)("60cc8da4aa4989ffa3a5bad0a8f9cd7b59e7cd7173",d.callServer,void 0,d.findSourceMapURL,"deleteTaskAction")},52177:(a,b,c)=>{c.d(b,{T:()=>e});var d=c(42377);let e=(0,d.createServerReference)("60d060df79ef2d59464d72cf12df59c5a5bd429d11",d.callServer,void 0,d.findSourceMapURL,"removeTaskDependencyAction")},59179:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(56556).A)("timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]])},59871:(a,b,c)=>{c.d(b,{w:()=>e});var d=c(42377);let e=(0,d.createServerReference)("60a261760cd422a0ac8a315798976aa6fcaa045c06",d.callServer,void 0,d.findSourceMapURL,"addTaskDependencyAction")},60265:(a,b,c)=>{c.d(b,{_u:()=>x,c_:()=>r,nF:()=>w,qK:()=>u});var d=c(10837),e=c(21968),f=c(47797),g=c(92460);c(63410);var h=c(24346),i=c.n(h),j=c(9222),k=c(49599),l=c(74798);let m={open:"bg-[#FFF3E0] dark:bg-[#3a2a12] text-[#E65100] dark:text-[#F0A050]",assigned:"bg-[#E3F2FD] dark:bg-[#13253a] text-[#1976D2] dark:text-[#5AA9F0]",in_progress:"bg-[#E8F5E9] dark:bg-[#14281a] text-[#5A9E6F] dark:text-[#6FD19A]",to_verify:"bg-[#F3E5F5] dark:bg-[#281630] text-[#7B1FA2] dark:text-[#C98FE0]",done:"bg-[#E0F2F1] dark:bg-[#12292a] text-[#00796B] dark:text-[#4FD1C0]",closed:"bg-[#F5F5F5] dark:bg-[#1e1e20] text-muted-foreground"},n={open:"#E65100",assigned:"#1976D2",in_progress:"#5A9E6F",to_verify:"#7B1FA2",done:"#00796B",closed:"#9A9A9A"},o={low:"priority.low",medium:"priority.medium",high:"priority.high",critical:"priority.critical"},p={open:"status.open",assigned:"status.assigned",in_progress:"status.inProgress",to_verify:"status.toVerify",done:"status.done",closed:"status.closed"},q={low:"bg-[#9A9A9A]",medium:"bg-[#E65100]",high:"bg-[#D32F2F]",critical:"bg-[#B71C1C]"},r={taskNode:function({data:a}){let b=(0,j.c)();return(0,d.jsxs)("div",{className:"rounded-lg border-2 border-[#E5E2DC] dark:border-[#2a2a2e] bg-card px-4 py-3 shadow-sm min-w-[200px] max-w-[260px] cursor-pointer hover:border-primary transition-colors",children:[(0,d.jsx)(f.h7,{type:"target",position:g.yX.Top,className:"!bg-primary !w-2 !h-2"}),(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-1.5",children:[(0,d.jsx)(k.E,{className:`text-[10px] ${m[a.status]||""}`,children:b(p[a.status]||a.status)}),(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[(0,d.jsx)("div",{className:`h-1.5 w-1.5 rounded-full ${q[a.priority]||""}`}),(0,d.jsx)("span",{className:"text-[10px] text-muted-foreground",children:b(o[a.priority]||a.priority)})]})]}),(0,d.jsx)("p",{className:"text-xs font-medium text-foreground leading-snug line-clamp-2",children:a.title}),(0,d.jsx)(f.h7,{type:"source",position:g.yX.Bottom,className:"!bg-primary !w-2 !h-2"})]})}},s={taskNode:function({data:a}){let b=n[a.status]||"#E5E0D8";return(0,d.jsxs)("div",{className:"rounded-md border-[1.5px] bg-card px-2.5 py-1.5 shadow-sm",style:{borderColor:b,width:t},children:[(0,d.jsx)(f.h7,{type:"target",position:g.yX.Top,className:"!bg-primary !w-1.5 !h-1.5"}),(0,d.jsx)("p",{className:"text-[10px] font-medium text-foreground leading-tight line-clamp-2",children:a.title}),(0,d.jsx)(f.h7,{type:"source",position:g.yX.Bottom,className:"!bg-primary !w-1.5 !h-1.5"})]})}},t=150,u={animated:!0,style:{stroke:"#C67A52",strokeWidth:2},markerEnd:{type:"arrowclosed",color:"#C67A52"}},v={animated:!0,style:{stroke:"#C67A52",strokeWidth:1.5},markerEnd:{type:"arrowclosed",color:"#C67A52"}};function w(a,b,c){let d=c?.nodeWidth??240,e=c?.nodeHeight??80,f=new(i()).graphlib.Graph;return f.setDefaultEdgeLabel(()=>({})),f.setGraph({rankdir:"TB",nodesep:c?.nodesep??50,ranksep:c?.ranksep??80}),a.forEach(a=>{f.setNode(a.id,{width:d,height:e})}),b.forEach(a=>{f.setEdge(a.source,a.target)}),i().layout(f),{nodes:a.map(a=>{let b=f.node(a.id);return{...a,position:{x:b.x-d/2,y:b.y-e/2}}}),edges:b}}function x({tasks:a,edges:b,readonly:c=!1,compact:g=!1,height:h,onNodeClick:i,className:k}){let m=(0,j.c)(),n=(0,l.W)(),{layoutedNodes:o,layoutedEdges:p}=(0,e.useMemo)(()=>{let c=a.map(a=>({id:a.uuid,type:"taskNode",position:{x:0,y:0},data:{title:a.title,status:a.status,priority:a.priority,proposalUuid:a.proposalUuid??null}})),d=w(c,b.map((a,b)=>({id:`e-${b}`,source:a.to,target:a.from,...g?v:u})),g?{nodeWidth:t,nodeHeight:50,nodesep:20,ranksep:40}:void 0);return{layoutedNodes:d.nodes,layoutedEdges:d.edges}},[a,b,g]);return 0===a.length?(0,d.jsx)("div",{className:`flex items-center justify-center text-sm text-muted-foreground ${k||""}`,style:h?{height:h}:void 0,children:m("tasks.noTasksToDisplay")}):(0,d.jsx)("div",{className:`rounded-[10px] border border-border bg-[#F7F6F3] dark:bg-[#1e1d1b] ${k||""}`,style:h?{height:h}:void 0,children:(0,d.jsxs)(f.Gc,{colorMode:n?"dark":"light",nodes:o,edges:p,nodeTypes:g?s:r,onNodeClick:i?(a,b)=>i(b.id):void 0,fitView:!0,fitViewOptions:{padding:.2},minZoom:.3,maxZoom:1.5,proOptions:{hideAttribution:!0},nodesDraggable:!c,nodesConnectable:!c,elementsSelectable:!c,panOnDrag:!0,zoomOnScroll:!0,children:[(0,d.jsx)(f.VS,{color:n?"#40392f":"#E5E0D8",gap:20}),!c&&(0,d.jsx)(f.H2,{className:"[&>button]:border-border [&>button]:bg-card [&>button]:text-foreground [&>button:hover]:bg-background"})]})})}},64029:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{f:()=>l});var e=c(2613);c(50785);var f=c(9259),g=c(67738),h=c(50530),i=c(97307),j=c(12217),k=a([f,g,h]);async function l(a){let b=await (0,f.d)();if(!b)return{activities:[],total:0};try{let c=await (0,h.K4)(b.companyUuid,a);if(!c)return{activities:[],total:0};return await (0,g.listActivitiesWithActorNames)({companyUuid:b.companyUuid,projectUuid:c.projectUuid,targetType:"task",targetUuid:a,skip:0,take:50})}catch(a){return i.default.error({err:a},"Failed to get task activities"),{activities:[],total:0}}}[f,g,h]=k.then?(await k)():k,(0,j.D)([l]),(0,e.A)(l,"40df0e37bb7fd45eb2156127819f061544ddd8d6a9",null),d()}catch(a){d(a)}})},71353:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{IY:()=>n,Nq:()=>m,hD:()=>l});var e=c(2613);c(50785);var f=c(5562),g=c(9259),h=c(50530),i=c(97307),j=c(12217),k=a([g,h]);async function l(a,b){let c=await (0,g.d)();if(!c)return{success:!1,error:"Unauthorized"};if("user"!==c.type&&"super_admin"!==c.type)return{success:!1,error:"Only users can verify acceptance criteria"};try{let d=await (0,h.K4)(c.companyUuid,a);if(!d)return{success:!1,error:"Task not found"};let e=await (0,h._T)(c.companyUuid,a,b,{type:c.type,actorUuid:c.actorUuid});return(0,f.revalidatePath)(`/projects/${d.projectUuid}/tasks/${a}`),(0,f.revalidatePath)(`/projects/${d.projectUuid}/tasks`),{success:!0,data:e}}catch(a){return i.default.error({err:a},"Failed to mark acceptance criteria"),{success:!1,error:"Failed to mark acceptance criteria"}}}async function m(a,b){let c=await (0,g.d)();if(!c)return{success:!1,error:"Unauthorized"};if("user"!==c.type&&"super_admin"!==c.type)return{success:!1,error:"Only users can reset acceptance criteria"};try{let d=await (0,h.K4)(c.companyUuid,a);if(!d)return{success:!1,error:"Task not found"};return await (0,h.Qi)(c.companyUuid,a,b),(0,f.revalidatePath)(`/projects/${d.projectUuid}/tasks/${a}`),(0,f.revalidatePath)(`/projects/${d.projectUuid}/tasks`),{success:!0}}catch(a){return i.default.error({err:a},"Failed to reset acceptance criterion"),{success:!1,error:"Failed to reset acceptance criterion"}}}async function n(a,b){let c=await (0,g.d)();if(!c)return{success:!1,error:"Unauthorized"};try{let d=await (0,h.K4)(c.companyUuid,a);if(!d)return{success:!1,error:"Task not found"};let e=await (0,h.cn)(c.companyUuid,a,b,{type:c.type,actorUuid:c.actorUuid});return(0,f.revalidatePath)(`/projects/${d.projectUuid}/tasks/${a}`),(0,f.revalidatePath)(`/projects/${d.projectUuid}/tasks`),{success:!0,data:e}}catch(a){return i.default.error({err:a},"Failed to self-check acceptance criteria"),{success:!1,error:"Failed to self-check acceptance criteria"}}}[g,h]=k.then?(await k)():k,(0,j.D)([l,m,n]),(0,e.A)(l,"602f7574dd5442ac3794acee13648d1644a27e918c",null),(0,e.A)(m,"6025177641cdabba8bf9655dbd3cd3761c125951a6",null),(0,e.A)(n,"608c7511238bfe910679caf57864069da597e91356",null),d()}catch(a){d(a)}})},72189:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{F:()=>k});var e=c(2613);c(50785);var f=c(9259),g=c(97879),h=c(97307),i=c(12217),j=a([f,g]);async function k(a){let b=await (0,f.d)();if(!b)return null;try{let c=await (0,g.PK)(b.companyUuid,a);if(!c)return null;return{uuid:c.uuid,title:c.title}}catch(a){return h.default.error({err:a},"Failed to get task source"),null}}[f,g]=j.then?(await j)():j,(0,i.D)([k]),(0,e.A)(k,"40b8a3a23f0e4f33c48e57d7a07ec490e065b10540",null),d()}catch(a){d(a)}})},73393:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{A0:()=>w,G3:()=>A,M0:()=>r,TV:()=>y,Yw:()=>x,bd:()=>t,hR:()=>u,iY:()=>p,p2:()=>s,qb:()=>q,vq:()=>z,y9:()=>v});var e=c(2613);c(50785);var f=c(5562),g=c(9259),h=c(50530),i=c(28774),j=c(61076),k=c(25383),l=c(67738),m=c(97307),n=c(12217),o=a([g,h,i,j,k,l]);async function p(a){let b=await (0,g.d)();if(!b)return{success:!1,error:"Unauthorized"};try{let c=await (0,h.K4)(b.companyUuid,a);if(!c)return{success:!1,error:"Task not found"};if("open"!==c.status&&"assigned"!==c.status)return{success:!1,error:"Task is not available for claiming"};return await (0,h.QK)({taskUuid:a,companyUuid:b.companyUuid,assigneeType:b.type,assigneeUuid:b.actorUuid,assignedByType:"user",assignedByUuid:b.actorUuid}),await (0,l.createActivity)({companyUuid:b.companyUuid,projectUuid:c.projectUuid,targetType:"task",targetUuid:a,actorType:b.type,actorUuid:b.actorUuid,action:"assigned",value:{assigneeType:b.type,assigneeUuid:b.actorUuid}}),(0,f.revalidatePath)(`/projects/${c.projectUuid}/tasks/${a}`),(0,f.revalidatePath)(`/projects/${c.projectUuid}/tasks`),{success:!0}}catch(a){return m.default.error({err:a},"Failed to claim task"),{success:!1,error:"Failed to claim task"}}}async function q(a,b,c){let d=await (0,g.d)();if(!d||"user"!==d.type)return{success:!1,error:"Unauthorized"};try{let e=await (0,h.K4)(d.companyUuid,a);if(!e)return{success:!1,error:"Task not found"};if("open"!==e.status&&"assigned"!==e.status)return{success:!1,error:"Task is not available for claiming"};let g=await (0,k.gt)({companyUuid:d.companyUuid,actorUserUuid:d.actorUuid,projectUuid:e.projectUuid,agentUuid:b}),i="project_fixed"===g.source?g.agentInstanceUuid:c;return await (0,h.QK)({taskUuid:a,companyUuid:d.companyUuid,assigneeType:"agent",assigneeUuid:b,assignedByType:"user",assignedByUuid:d.actorUuid,instanceUuid:i??void 0,cwdSource:"project_fixed"===g.source?g.source:null,cwdHost:"project_fixed"===g.source?g.host:null,runtimeCwd:"project_fixed"===g.source?g.cwd:null}),await (0,l.createActivity)({companyUuid:d.companyUuid,projectUuid:e.projectUuid,targetType:"task",targetUuid:a,actorType:d.type,actorUuid:d.actorUuid,action:"assigned",value:{assigneeType:"agent",assigneeUuid:b,...i?{instanceUuid:i}:{},..."project_fixed"===g.source?{resolvedCwdSource:g.source,resolvedCwdHost:g.host,resolvedRuntimeCwd:g.cwd}:{}}}),(0,f.revalidatePath)(`/projects/${e.projectUuid}/tasks/${a}`),(0,f.revalidatePath)(`/projects/${e.projectUuid}/tasks`),{success:!0}}catch(a){return m.default.error({err:a},"Failed to claim task to agent"),{success:!1,error:"Failed to claim task"}}}async function r(a,b,c){let d=await (0,g.d)();if(!d||"user"!==d.type)return{success:!1,error:"Unauthorized"};try{let e=await (0,h.K4)(d.companyUuid,a);if(!e)return{success:!1,error:"Task not found"};if("open"!==e.status&&"assigned"!==e.status)return{success:!1,error:"Task is not available for claiming"};return await (0,h.QK)({taskUuid:a,companyUuid:d.companyUuid,assigneeType:"agent",assigneeUuid:b,assignedByType:"user",assignedByUuid:d.actorUuid,instanceUuid:c}),(0,f.revalidatePath)(`/projects/${e.projectUuid}/tasks/${a}`),(0,f.revalidatePath)(`/projects/${e.projectUuid}/tasks`),{success:!0}}catch(a){return m.default.error({err:a},"Failed to reassign task instance (no wake)"),{success:!1,error:"Failed to reassign task"}}}async function s(a){let b=await (0,g.d)();if(!b)return{success:!1,error:"Unauthorized"};try{let c=await (0,h.K4)(b.companyUuid,a);if(!c)return{success:!1,error:"Task not found"};if("assigned"!==c.status&&"in_progress"!==c.status)return{success:!1,error:"Task is not in assigned status"};return await (0,h.Fp)(a),await (0,l.createActivity)({companyUuid:b.companyUuid,projectUuid:c.projectUuid,targetType:"task",targetUuid:a,actorType:b.type,actorUuid:b.actorUuid,action:"released"}),(0,f.revalidatePath)(`/projects/${c.projectUuid}/tasks/${a}`),(0,f.revalidatePath)(`/projects/${c.projectUuid}/tasks`),{success:!0}}catch(a){return m.default.error({err:a},"Failed to release task"),{success:!1,error:"Failed to release task"}}}async function t(a,b){let c=await (0,g.d)();if(!c)return{success:!1,error:"Unauthorized"};try{let d=await (0,h.K4)(c.companyUuid,a);if(!d)return{success:!1,error:"Task not found"};return await (0,h.lC)(a,{status:b}),await (0,l.createActivity)({companyUuid:c.companyUuid,projectUuid:d.projectUuid,targetType:"task",targetUuid:a,actorType:c.type,actorUuid:c.actorUuid,action:"status_changed",value:{status:b}}),(0,f.revalidatePath)(`/projects/${d.projectUuid}/tasks/${a}`),(0,f.revalidatePath)(`/projects/${d.projectUuid}/tasks`),{success:!0}}catch(a){return m.default.error({err:a},"Failed to update task status"),{success:!1,error:"Failed to update task status"}}}async function u(a){let b=await (0,g.d)();if(!b||"user"!==b.type)return{success:!1,error:"Only humans can verify tasks"};try{let c=await (0,h.K4)(b.companyUuid,a);if(!c)return{success:!1,error:"Task not found"};if("to_verify"!==c.status)return{success:!1,error:"Task is not in to_verify status"};let d=await (0,h.Ew)(a);if(!d.allowed)return{success:!1,error:d.reason||"Not all required acceptance criteria are passed"};return await (0,h.lC)(a,{status:"done"}),(0,f.revalidatePath)(`/projects/${c.projectUuid}/tasks/${a}`),(0,f.revalidatePath)(`/projects/${c.projectUuid}/tasks`),{success:!0}}catch(a){return m.default.error({err:a},"Failed to verify task"),{success:!1,error:"Failed to verify task"}}}async function v(a,b){let c=await (0,g.d)();if(!c||"user"!==c.type)return{success:!1,error:"Unauthorized"};try{let d=await (0,h.K4)(c.companyUuid,a);if(!d)return{success:!1,error:"Task not found"};if("open"!==d.status&&"assigned"!==d.status)return{success:!1,error:"Task is not available for assigning"};return await (0,h.QK)({taskUuid:a,companyUuid:c.companyUuid,assigneeType:"user",assigneeUuid:b,assignedByType:"user",assignedByUuid:c.actorUuid}),await (0,l.createActivity)({companyUuid:c.companyUuid,projectUuid:d.projectUuid,targetType:"task",targetUuid:a,actorType:c.type,actorUuid:c.actorUuid,action:"assigned",value:{assigneeType:"user",assigneeUuid:b}}),(0,f.revalidatePath)(`/projects/${d.projectUuid}/tasks/${a}`),(0,f.revalidatePath)(`/projects/${d.projectUuid}/tasks`),{success:!0}}catch(a){return m.default.error({err:a},"Failed to assign task to user"),{success:!1,error:"Failed to assign task"}}}async function w(a){let b=await (0,g.d)();if(!b)return{success:!1,error:"Unauthorized"};try{let c=await (0,h.UT)({companyUuid:b.companyUuid,projectUuid:a.projectUuid,title:a.title,description:a.description||null,priority:a.priority||"medium",storyPoints:a.storyPoints,acceptanceCriteria:a.acceptanceCriteria,createdByUuid:b.actorUuid});return await (0,l.createActivity)({companyUuid:b.companyUuid,projectUuid:a.projectUuid,targetType:"task",targetUuid:c.uuid,actorType:b.type,actorUuid:b.actorUuid,action:"task_created"}),(0,f.revalidatePath)(`/projects/${a.projectUuid}/tasks`),{success:!0,taskUuid:c.uuid}}catch(a){return m.default.error({err:a},"Failed to create task"),{success:!1,error:"Failed to create task"}}}async function x(a){let b=await (0,g.d)();if(!b)return{success:!1,error:"Unauthorized"};try{if(!await (0,h.K4)(b.companyUuid,a.taskUuid))return{success:!1,error:"Task not found"};return await (0,h.lC)(a.taskUuid,{title:a.title,description:a.description,priority:a.priority,storyPoints:a.storyPoints,acceptanceCriteria:a.acceptanceCriteria}),void 0!==a.acceptanceCriteriaItems&&await (0,h.Pf)(b.companyUuid,a.taskUuid,a.acceptanceCriteriaItems),(0,f.revalidatePath)(`/projects/${a.projectUuid}/tasks`),{success:!0}}catch(a){return m.default.error({err:a},"Failed to update task"),{success:!1,error:a instanceof Error?a.message:"Failed to update task"}}}async function y(a,b){let c=await (0,g.d)();if(!c)return{success:!1,error:"Unauthorized"};try{if(!await (0,h.K4)(c.companyUuid,a))return{success:!1,error:"Task not found"};return await (0,h.vq)(a),(0,f.revalidatePath)(`/projects/${b}/tasks`),{success:!0}}catch(a){return m.default.error({err:a},"Failed to delete task"),{success:!1,error:"Failed to delete task"}}}async function z(){let a=await (0,g.d)();if(!a||"user"!==a.type)return{agents:[],users:[]};try{let[b,c]=await Promise.all([(0,i.ic)(a.companyUuid,"task:write",a.actorUuid),(0,i.A8)(a.companyUuid)]);return{agents:b,users:c,currentUserUuid:a.actorUuid}}catch(a){return m.default.error({err:a},"Failed to get assignable agents"),{agents:[],users:[]}}}async function A(a,b){let c=await (0,g.d)();if(!c||"user"!==c.type)return{instances:[],resolvedTarget:null};try{let[d,e]=await Promise.all([(0,j._R)(c.companyUuid,a),b?(0,k.gt)({companyUuid:c.companyUuid,actorUserUuid:c.actorUuid,projectUuid:b,agentUuid:a}):null]);return{instances:d.map(a=>({connectionUuid:a.uuid,agentInstanceUuid:a.agentInstanceUuid,host:a.host,cwd:a.cwd,effectiveStatus:a.effectiveStatus})),resolvedTarget:e}}catch(a){return m.default.error({err:a},"Failed to get agent instances"),{instances:[],resolvedTarget:null}}}[g,h,i,j,k,l]=o.then?(await o)():o,(0,n.D)([p,q,r,s,t,u,v,w,x,y,z,A]),(0,e.A)(p,"402c386373a4fabf2ad2d5dfaa365acb288aac83a0",null),(0,e.A)(q,"70282f0868538e338c4b3140249ed90c558fa6ab54",null),(0,e.A)(r,"70888b128e2a5365195c2ae5d34b864ab7dc9bbcdb",null),(0,e.A)(s,"40f2bf09e6782d17c46f275c86a593725b6ca03e60",null),(0,e.A)(t,"601072d7fca898d2c59da1c68fed0b2cfe8a4de4b1",null),(0,e.A)(u,"40c6582cbaa1a6200494b24766d26822c6e7793709",null),(0,e.A)(v,"60c2047b27bf7270af9d1a080b9e280000f8a9a205",null),(0,e.A)(w,"40aa8a7ab6b0810f2a49113c9c28a4716de01592a7",null),(0,e.A)(x,"40c633a7d138bc6dbd6fdd66fe5cb7198e52f7112d",null),(0,e.A)(y,"60cc8da4aa4989ffa3a5bad0a8f9cd7b59e7cd7173",null),(0,e.A)(z,"00d273393a8e550e51cf5e0502a312e65b6c9b100c",null),(0,e.A)(A,"605280db671df3a878e2b64c216bc17303e832abfe",null),d()}catch(a){d(a)}})},77521:(a,b,c)=>{c.d(b,{Bj:()=>i,L8:()=>e,Wl:()=>j,_5:()=>h,eT:()=>f,fw:()=>g});var d=c(76664);let e=480;function f(a){switch(a){case"done":return"bg-[#00796B]";case"in_progress":return"bg-[#1976D2]";case"to_verify":return"bg-[#7B1FA2]";case"open":case"assigned":return"bg-[#E65100]";case"closed":return"bg-[#9A9A9A]";default:return"bg-[#D9D9D9]"}}function g(a,b){let c=new Date(a),e=new Date().getTime()-c.getTime(),f=Math.floor(e/6e4),g=Math.floor(e/36e5),h=Math.floor(e/864e5);return f<1?b("time.justNow"):f<60?b("time.minutesAgo",{minutes:f}):g<24?b("time.hoursAgo",{hours:g}):h<7?b("time.daysAgo",{days:h}):(0,d.r)(c)}let h={todo:"bg-[#FFF3E0] text-[#E65100] dark:bg-[#3a2a12] dark:text-[#F0A050]",in_progress:"bg-[#E3F2FD] text-[#1976D2] dark:bg-[#13253a] dark:text-[#5AA9F0]",human_conduct_required:"bg-[#F3E5F5] text-[#7B1FA2] dark:bg-[#281630] dark:text-[#C98FE0]",done:"bg-[#E0F2F1] text-[#00796B] dark:bg-[#12292a] dark:text-[#4FD1C0]"},i={todo:"todo",in_progress:"inProgress",human_conduct_required:"humanConductRequired",done:"done"},j={open:"open",researching:"researching",answer_questions:"answerQuestions",planning:"planning",review_proposal:"reviewProposal",building:"building",verify_work:"verifyWork",done:"done"}},80112:(a,b,c)=>{c.d(b,{A:()=>e});var d=c(42377);let e=(0,d.createServerReference)("40aa8a7ab6b0810f2a49113c9c28a4716de01592a7",d.callServer,void 0,d.findSourceMapURL,"createTaskAction")},80267:(a,b,c)=>{c.d(b,{F:()=>e});var d=c(42377);let e=(0,d.createServerReference)("40b8a3a23f0e4f33c48e57d7a07ec490e065b10540",d.callServer,void 0,d.findSourceMapURL,"getTaskSourceAction")},81751:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{J:()=>l,h:()=>m});var e=c(2613);c(50785);var f=c(4687),g=c(9259),h=c(30457),i=c(97307),j=c(12217),k=a([g,h]);async function l(a){let b=await (0,g.d)();b||(0,f.redirect)("/login");try{let c=await (0,h.OU)(b.companyUuid,a);return{success:!0,data:c}}catch(a){return i.default.error({err:a},"Failed to fetch task sessions"),{success:!1,error:"Failed to fetch task sessions"}}}async function m(a){let b=await (0,g.d)();b||(0,f.redirect)("/login");try{let c=await (0,h.y_)(b.companyUuid,a);return{success:!0,data:c}}catch(a){return i.default.error({err:a},"Failed to fetch batch worker counts"),{success:!1,error:"Failed to fetch batch worker counts"}}}[g,h]=k.then?(await k)():k,(0,j.D)([l,m]),(0,e.A)(l,"404c9a2469eaa7fc0ba47937f4bc5509315d0ee72f",null),(0,e.A)(m,"40056a37711ca0f533e576b2db80ffba9280cd0da5",null),d()}catch(a){d(a)}})},82354:(a,b,c)=>{c.d(b,{b:()=>e});var d=c(42377);let e=(0,d.createServerReference)("601072d7fca898d2c59da1c68fed0b2cfe8a4de4b1",d.callServer,void 0,d.findSourceMapURL,"updateTaskStatusAction")},85282:(a,b,c)=>{c.d(b,{h:()=>e});var d=c(42377);let e=(0,d.createServerReference)("40056a37711ca0f533e576b2db80ffba9280cd0da5",d.callServer,void 0,d.findSourceMapURL,"getBatchWorkerCountsAction")},86104:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{v:()=>ae});var e=c(10837),f=c(21968),g=c(68884),h=c(9222),i=c(33407),j=c(10694),k=c(92900),l=c(35209),m=c(87461),n=c(65956),o=c(86460),p=c(67832),q=c(98893),r=c(97825),s=c(59179),t=c(55775),u=c(9810),v=c(97443),w=c(58270),x=c(644),y=c(21326),z=c(79543),A=c(49599),B=c(35198),C=c(42424),D=c(9994),E=c(20170),F=c(2852),G=c(74645),H=c(55732),I=c(6019),J=c(80251),K=c(6871),L=c(68797),M=c(7086),N=c(82354),O=c(80112),P=c(22374),Q=c(39347),R=c(18786),S=c(29061),T=c(56828),U=c(95627);c(5918),c(80267);var V=c(97450),W=c(73908),X=c(87707);c(94037),c(7500);var Y=c(59871),Z=c(52177);c(25848);var $=c(76664),_=c(31009),aa=c(45148),ab=c(77521),ac=a([L,T,V]);[L,T,V]=ac.then?(await ac)():ac;let af={open:"bg-[#FFF3E0] dark:bg-[#3a2a12] text-[#E65100] dark:text-[#F0A050]",assigned:"bg-[#E3F2FD] dark:bg-[#13253a] text-[#1976D2] dark:text-[#5AA9F0]",in_progress:"bg-[#E8F5E9] dark:bg-[#14281a] text-[#5A9E6F] dark:text-[#6FD19A]",to_verify:"bg-[#F3E5F5] dark:bg-[#281630] text-[#7B1FA2] dark:text-[#C98FE0]",done:"bg-[#E0F2F1] dark:bg-[#12292a] text-[#00796B] dark:text-[#4FD1C0]",closed:"bg-[#F5F5F5] dark:bg-[#1e1e20] text-[#9A9A9A]"},ag={open:"open",assigned:"assigned",in_progress:"inProgress",to_verify:"toVerify",done:"done",closed:"closed"},ah={low:"bg-[#F5F5F5] dark:bg-[#1e1e20] text-[#9A9A9A]",medium:"bg-[#FFF3E0] dark:bg-[#3a2a12] text-[#E65100] dark:text-[#F0A050]",high:"bg-[#FEE2E2] dark:bg-[#331619] text-[#D32F2F] dark:text-[#F08078]",critical:"bg-[#FFCDD2] dark:bg-[#3a181c] text-[#B71C1C] dark:text-[#F08078]"},ai={low:"lowPriority",medium:"mediumPriority",high:"highPriority",critical:"criticalPriority"};function ad(a,b){let c=new Date(a),d=new Date().getTime()-c.getTime(),e=Math.floor(d/6e4),f=Math.floor(d/36e5),g=Math.floor(d/864e5);return e<1?b("time.justNow"):e<60?b("time.minutesAgo",{minutes:e}):f<24?b("time.hoursAgo",{hours:f}):g<7?b("time.daysAgo",{days:g}):(0,$.r)(c)}function ae({task:a,projectUuid:b,currentUserUuid:c,mode:d="overlay",onClose:ac,onCreated:ae,onDependencyChange:aj,onBack:ak}){let al=(0,h.c)(),am=(0,g.r)(),[an,ao]=(0,f.useState)(!1),[ap,aq]=(0,f.useState)(!1),[ar,as]=(0,f.useState)([]),[at,au]=(0,f.useState)(!0),[av,aw]=(0,f.useState)(null),[ax,ay]=(0,f.useState)(!1),[az,aA]=(0,f.useState)([]),[aB,aC]=(0,f.useState)([]),[aD,aE]=(0,f.useState)(!1),[aF,aG]=(0,f.useState)([]),[aH,aI]=(0,f.useState)(null),[aJ,aK]=(0,f.useState)([]),[aL,aM]=(0,f.useState)([]),aN=null===a,[aO,aP]=(0,f.useState)(aN),[aQ,aR]=(0,f.useState)(a?.title||""),[aS,aT]=(0,f.useState)(a?.description||""),[aU,aV]=(0,f.useState)(a?.priority||"medium"),[aW,aX]=(0,f.useState)(a?.storyPoints!=null?String(a.storyPoints):""),[aY,aZ]=(0,f.useState)((a?.acceptanceCriteriaItems??[]).map(a=>({description:a.description,required:a.required??!0}))),[a$,a_]=(0,f.useState)(!1),[a0,a1]=(0,f.useState)(null),[a2,a3]=(0,f.useState)(!1),a4=(0,M.RU)(a?.assignee??null,{type:"user",uuid:c}),a5=a4&&a?.status==="assigned",a6=a4&&a?.status==="in_progress",a7=a?.status==="to_verify",a8=async b=>{if(!a)return;aq(!0);let c=await (0,N.b)(a.uuid,b);aq(!1),c.success&&(ac(),am.refresh())},a9=()=>{if(aN)return void ac();aP(!1),a&&(aR(a.title),aT(a.description||""),aV(a.priority),aX(null!=a.storyPoints?String(a.storyPoints):""),aZ((a.acceptanceCriteriaItems??[]).map(a=>({description:a.description,required:a.required??!0})))),a1(null)},ba=async()=>{if(!aQ.trim())return void a1(al("tasks.titleRequired"));a_(!0),a1(null);let c=aW.trim()?parseFloat(aW):null;if(aN){let a=await (0,O.A)({projectUuid:b,title:aQ.trim(),description:aS.trim()||void 0,priority:aU,storyPoints:c,acceptanceCriteria:null});a_(!1),a.success?(aL.length>0&&a.taskUuid&&(await Promise.all(aL.map(b=>(0,Y.w)(a.taskUuid,b.uuid))),aj?.()),ae?.(),ac(),am.refresh()):a1(a.error||al("tasks.createFailed"))}else{let d=(a.acceptanceCriteriaItems??[]).map(a=>({description:a.description,required:a.required??!0})),e=aY.filter(a=>a.description.trim().length>0),f=(0,W.K)(d,e);if(f&&0===e.length){a_(!1),a1(al("acceptanceCriteria.atLeastOneRequired"));return}let g=await (0,P.Y)({taskUuid:a.uuid,projectUuid:b,title:aQ.trim(),description:aS.trim()||null,priority:aU,storyPoints:c,...f?{acceptanceCriteriaItems:e.map(a=>({description:a.description.trim(),required:a.required}))}:{}});a_(!1),g.success?(aP(!1),am.refresh()):a1(g.error||al("tasks.updateFailed"))}},bb=async()=>{if(!a)return;a3(!0);let c=await (0,Q.T)(a.uuid,b);a3(!1),c.success&&(ac(),am.refresh())},bc=async b=>{if(!a)return;aI(null);let c=await (0,Y.w)(a.uuid,b);if(c.success){let a=aF.find(a=>a.uuid===b);a&&aA(b=>[...b,a]),aj?.()}else aI(c.error||al("tasks.failedToAddDep"))},bd=async b=>{if(!a)return;aI(null);let c=await (0,Z.T)(a.uuid,b);c.success?(aA(a=>a.filter(a=>a.uuid!==b)),aj?.()):aI(c.error||al("tasks.failedToRemoveDep"))},be=async b=>{if(!a)return;aI(null);let c=await (0,Z.T)(b,a.uuid);c.success?(aC(a=>a.filter(a=>a.uuid!==b)),aj?.()):aI(c.error||al("tasks.failedToRemoveDep"))},bf=aF.filter(b=>b.uuid!==a?.uuid&&!az.some(a=>a.uuid===b.uuid)),bg=aF.filter(a=>!aL.some(b=>b.uuid===a.uuid)),bh="sidebyside"===d;return(0,e.jsxs)(e.Fragment,{children:[!bh&&(0,e.jsx)("div",{className:"fixed inset-0 z-40 bg-black/20",onClick:ac}),(0,e.jsxs)("div",{className:`fixed top-14 md:top-0 flex h-[calc(100%-3.5rem)] md:h-full w-full md:w-[480px] flex-col bg-card shadow-xl border-l border-border ${bh?`z-40 ${an?"":"animate-in slide-in-from-right duration-300"}`:`z-50 right-0 ${an?"":"animate-in slide-in-from-right duration-300"}`}`,style:bh?{right:`${ab.L8}px`}:void 0,children:[(0,e.jsxs)("div",{className:"flex items-center justify-between border-b border-secondary px-6 py-5",children:[ak&&(0,e.jsx)(C.$,{variant:"ghost",size:"icon",className:"mr-2 h-8 w-8 shrink-0",onClick:ak,children:(0,e.jsx)(l.A,{className:"h-4 w-4 text-muted-foreground"})}),(0,e.jsx)("div",{className:"flex-1 min-w-0",children:aO?(0,e.jsx)("h2",{className:"text-base font-semibold text-foreground",children:aN?al("tasks.createTaskTitle"):al("tasks.editTask")}):a?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("h2",{className:"text-base font-semibold text-foreground truncate",children:a.title}),(0,e.jsxs)("div",{className:"mt-1.5 flex items-center gap-2",children:[(0,e.jsx)(A.E,{className:af[a.status]||"",children:al(`status.${ag[a.status]||a.status}`)}),(0,e.jsx)(A.E,{className:ah[a.priority]||"",children:al(`priority.${ai[a.priority]||a.priority}`)}),a.storyPoints&&(0,e.jsxs)("span",{className:"rounded bg-secondary px-2 py-0.5 text-xs font-medium text-muted-foreground",children:[a.storyPoints,"h"]})]})]}):null}),(0,e.jsxs)("div",{className:"flex items-center gap-2 ml-4",children:[a&&!aO&&(0,e.jsxs)(C.$,{variant:"outline",size:"sm",className:"h-8 gap-1.5 border-border text-foreground",onClick:()=>{a&&(aR(a.title),aT(a.description||""),aV(a.priority),aX(null!=a.storyPoints?String(a.storyPoints):""),aZ((a.acceptanceCriteriaItems??[]).map(a=>({description:a.description,required:a.required??!0}))),a1(null),aP(!0))},children:[(0,e.jsx)(m.A,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,e.jsx)("span",{className:"text-xs",children:al("common.edit")})]}),(0,e.jsx)(C.$,{variant:"outline",size:"icon",className:"h-8 w-8 border-border",onClick:aO&&!aN?a9:ac,children:(0,e.jsx)(j.A,{className:"h-4 w-4 text-muted-foreground"})})]})]}),(0,e.jsx)(G.F,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:(0,e.jsx)("div",{className:"flex min-h-full flex-col px-6 py-5",children:aO?(0,e.jsxs)("div",{className:"space-y-5",children:[a0&&(0,e.jsx)("div",{className:"rounded-lg bg-destructive/10 p-3 text-sm text-destructive",children:a0}),(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(F.J,{htmlFor:"edit-title",className:"text-[13px] font-medium text-foreground",children:al("tasks.titleLabel")}),(0,e.jsx)(D.p,{id:"edit-title",value:aQ,onChange:a=>aR(a.target.value),className:"border-border text-sm focus-visible:ring-primary",autoFocus:!0})]}),(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(F.J,{htmlFor:"edit-description",className:"text-[13px] font-medium text-foreground",children:al("tasks.descriptionLabel")}),(0,e.jsx)(E.T,{id:"edit-description",value:aS,onChange:a=>aT(a.target.value),rows:4,className:"border-border text-sm resize-none focus-visible:ring-primary"})]}),(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(F.J,{htmlFor:"edit-priority",className:"text-[13px] font-medium text-foreground",children:al("tasks.priorityLabel")}),(0,e.jsxs)(H.l6,{value:aU,onValueChange:aV,children:[(0,e.jsx)(H.bq,{className:"border-border text-sm focus:ring-primary",children:(0,e.jsx)(H.yv,{})}),(0,e.jsxs)(H.gC,{children:[(0,e.jsx)(H.eb,{value:"low",children:al("priority.low")}),(0,e.jsx)(H.eb,{value:"medium",children:al("priority.medium")}),(0,e.jsx)(H.eb,{value:"high",children:al("priority.high")})]})]})]}),(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(F.J,{htmlFor:"edit-story-points",className:"text-[13px] font-medium text-foreground",children:al("tasks.storyPointsLabel")}),(0,e.jsx)(D.p,{id:"edit-story-points",type:"number",min:"0",step:"0.5",value:aW,onChange:a=>aX(a.target.value),className:"border-border text-sm focus-visible:ring-primary"})]}),(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(F.J,{className:"text-[13px] font-medium text-foreground",children:al("acceptanceCriteria.title")}),(0,e.jsx)(W.C,{items:aY,onChange:aZ})]}),aN&&(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(F.J,{className:"text-[13px] font-medium text-foreground",children:al("tasks.dependencies")}),aL.length>0&&(0,e.jsx)("div",{className:"space-y-1.5",children:aL.map(a=>(0,e.jsxs)("div",{className:"group flex items-center justify-between rounded-lg bg-background p-2.5",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,e.jsx)(i.A,{className:"h-3.5 w-3.5 shrink-0 text-primary"}),(0,e.jsx)("span",{className:"text-xs text-foreground truncate",children:a.title}),(0,e.jsx)(A.E,{className:`shrink-0 text-[10px] ${af[a.status]||""}`,children:al(`status.${ag[a.status]||a.status}`)})]}),(0,e.jsx)(C.$,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 opacity-0 group-hover:opacity-100 transition-opacity ml-2 shrink-0",onClick:()=>aM(b=>b.filter(b=>b.uuid!==a.uuid)),children:(0,e.jsx)(j.A,{className:"h-3.5 w-3.5 text-[#9A9A9A] hover:text-[#D32F2F]"})})]},a.uuid))}),bg.length>0&&(0,e.jsxs)(H.l6,{onValueChange:a=>{let b=aF.find(b=>b.uuid===a);b&&aM(a=>[...a,b])},children:[(0,e.jsx)(H.bq,{className:"h-8 border-border text-xs text-muted-foreground focus:ring-primary",children:(0,e.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,e.jsx)(k.A,{className:"h-3 w-3"}),(0,e.jsx)(H.yv,{placeholder:al("tasks.addDependency")})]})}),(0,e.jsx)(H.gC,{children:bg.map(a=>(0,e.jsx)(H.eb,{value:a.uuid,children:(0,e.jsx)("span",{className:"truncate",children:a.title})},a.uuid))})]},aL.length)]})]}):a?(0,e.jsxs)(_.P.div,{variants:aa.qG,initial:"initial",animate:"animate",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:al("common.assignee")}),(0,e.jsx)("div",{className:"mt-2 flex items-center gap-2.5 rounded-lg bg-background p-3",children:a.assignee?(0,e.jsxs)(e.Fragment,{children:[(0,M.bB)(a.assignee)?(0,e.jsx)(K.AgentAvatar,{name:a.assignee.name,size:28,className:"rounded-full"}):(0,e.jsx)(J.eu,{className:"h-7 w-7",children:(0,e.jsx)(J.q5,{className:"bg-border text-muted-foreground",children:a.assignee.name.charAt(0).toUpperCase()})}),(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsx)("div",{className:"text-sm font-medium text-foreground",children:a.assignee.name}),(0,e.jsx)("div",{className:"text-xs text-muted-foreground",children:(0,M.bB)(a.assignee)?`${al("common.agent")} • ${a.assignee.assignedAt?(0,$.r)(a.assignee.assignedAt):""}`:al("common.user")}),"agent_instance"===a.assignee.type&&a.assignee.instance&&(0,e.jsx)("div",{className:"mt-1",children:(0,e.jsx)(L.jQ,{cwd:a.assignee.instance.cwd,host:a.assignee.instance.host})})]})]}):(0,e.jsx)("span",{className:"text-sm text-[#9A9A9A]",children:al("common.unassigned")})})]}),aJ.length>0&&(0,e.jsxs)("div",{className:"mt-5",children:[(0,e.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:al("sessions.activeWorkers")}),(0,e.jsx)("div",{className:"mt-2 space-y-1.5",children:aJ.map(a=>(0,e.jsxs)("div",{className:"flex items-center gap-2.5 rounded-lg bg-background p-2.5",children:[(0,e.jsxs)("div",{className:"relative flex-shrink-0",children:[(0,e.jsx)(K.AgentAvatar,{name:a.agentName,size:28,className:"rounded-full"}),(0,e.jsx)("span",{className:"absolute -bottom-0.5 -right-0.5 h-2 w-2 rounded-full bg-green-500 ring-2 ring-background"})]}),(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsx)("div",{className:"text-xs font-medium text-foreground truncate",children:a.sessionName}),(0,e.jsxs)("div",{className:"text-[10px] text-[#9A9A9A]",children:[a.agentName," \xb7 ",ad(a.checkinAt,al)]})]})]},a.sessionUuid))})]}),(0,e.jsxs)("div",{className:"mt-5",children:[(0,e.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:al("common.description")}),(0,e.jsx)("div",{className:"mt-2",children:a.description?(0,e.jsx)("div",{className:"prose prose-sm max-w-none text-[13px] leading-relaxed text-foreground",children:(0,e.jsx)(V.MarkdownContent,{children:a.description})}):(0,e.jsx)("p",{className:"text-sm italic text-[#9A9A9A]",children:al("common.noDescription")})})]}),a.acceptanceCriteria&&!(a.acceptanceCriteriaItems&&a.acceptanceCriteriaItems.length>0)&&(0,e.jsxs)("div",{className:"mt-5",children:[(0,e.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:al("tasks.acceptanceCriteria")}),(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)("div",{className:"prose prose-sm max-w-none text-[13px] leading-relaxed text-foreground",children:(0,e.jsx)(V.MarkdownContent,{children:a.acceptanceCriteria})})})]}),av&&(0,e.jsxs)("div",{className:"mt-5",children:[(0,e.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:al("common.source")}),(0,e.jsx)("a",{href:`/projects/${b}/proposals/${av.uuid}`,className:"mt-2 flex items-center justify-between rounded-lg bg-background p-3 hover:bg-[#F0EDE5] dark:hover:bg-[#26241f] transition-colors",children:(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(n.A,{className:"h-3.5 w-3.5 text-primary"}),(0,e.jsx)("span",{className:"text-xs text-foreground",children:av.title})]})})]}),(0,e.jsxs)("div",{className:"mt-5",children:[(0,e.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:al("tasks.dependencies")}),aH&&(0,e.jsx)("div",{className:"mt-2 rounded-lg bg-destructive/10 p-2.5 text-xs text-destructive",children:aH}),aD?(0,e.jsx)("div",{className:"mt-2 flex items-center justify-center py-4",children:(0,e.jsx)(o.A,{className:"h-4 w-4 animate-spin text-[#9A9A9A]"})}):(0,e.jsxs)(e.Fragment,{children:[az.length>0&&(0,e.jsxs)("div",{className:"mt-2",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5",children:[(0,e.jsx)(p.A,{className:"h-3 w-3 text-[#9A9A9A]"}),(0,e.jsx)("span",{className:"text-[10px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:al("tasks.dependsOn")})]}),(0,e.jsx)("div",{className:"space-y-1.5",children:az.map(a=>(0,e.jsxs)("div",{className:"group flex items-center justify-between rounded-lg bg-background p-3",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,e.jsx)(i.A,{className:"h-3.5 w-3.5 shrink-0 text-primary"}),(0,e.jsx)("span",{className:"text-xs text-foreground truncate",children:a.title}),(0,e.jsx)(A.E,{className:`shrink-0 text-[10px] ${af[a.status]||""}`,children:al(`status.${ag[a.status]||a.status}`)})]}),(0,e.jsx)(C.$,{variant:"ghost",size:"icon",className:"h-6 w-6 opacity-0 group-hover:opacity-100 transition-opacity ml-2 shrink-0",onClick:()=>bd(a.uuid),children:(0,e.jsx)(j.A,{className:"h-3.5 w-3.5 text-[#9A9A9A] hover:text-[#D32F2F]"})})]},a.uuid))})]}),aB.length>0&&(0,e.jsxs)("div",{className:"mt-3",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5",children:[(0,e.jsx)(p.A,{className:"h-3 w-3 rotate-180 text-[#9A9A9A]"}),(0,e.jsx)("span",{className:"text-[10px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:al("tasks.blockedByThis")})]}),(0,e.jsx)("div",{className:"space-y-1.5",children:aB.map(a=>(0,e.jsxs)("div",{className:"group flex items-center justify-between rounded-lg bg-background p-3",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,e.jsx)(i.A,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,e.jsx)("span",{className:"text-xs text-foreground truncate",children:a.title}),(0,e.jsx)(A.E,{className:`shrink-0 text-[10px] ${af[a.status]||""}`,children:al(`status.${ag[a.status]||a.status}`)})]}),(0,e.jsx)(C.$,{variant:"ghost",size:"icon",className:"h-6 w-6 opacity-0 group-hover:opacity-100 transition-opacity ml-2 shrink-0",onClick:()=>be(a.uuid),children:(0,e.jsx)(j.A,{className:"h-3.5 w-3.5 text-[#9A9A9A] hover:text-[#D32F2F]"})})]},a.uuid))})]}),0===az.length&&0===aB.length&&(0,e.jsx)("p",{className:"mt-2 text-sm italic text-[#9A9A9A]",children:al("tasks.noDependencies")}),bf.length>0&&(0,e.jsx)("div",{className:"mt-3",children:(0,e.jsxs)(H.l6,{onValueChange:a=>bc(a),children:[(0,e.jsx)(H.bq,{className:"h-8 border-border text-xs text-muted-foreground focus:ring-primary",children:(0,e.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,e.jsx)(k.A,{className:"h-3 w-3"}),(0,e.jsx)(H.yv,{placeholder:al("tasks.addDependency")})]})}),(0,e.jsx)(H.gC,{children:bf.map(a=>(0,e.jsx)(H.eb,{value:a.uuid,children:(0,e.jsx)("span",{className:"truncate",children:a.title})},a.uuid))})]},az.length)})]})]}),a&&a.acceptanceCriteriaItems&&a.acceptanceCriteriaItems.length>0&&(()=>{let b=a.acceptanceCriteriaItems,c=a.acceptanceSummary,d=a=>"passed"===a?(0,e.jsx)(q.A,{className:"h-4 w-4 text-green-600 dark:text-[#6FD19A]"}):"failed"===a?(0,e.jsx)(r.A,{className:"h-4 w-4 text-red-600 dark:text-[#F08078]"}):(0,e.jsx)(s.A,{className:"h-4 w-4 text-yellow-600 dark:text-[#E0B44E]"}),f=a=>"passed"===a?"bg-green-50 text-green-700 dark:bg-[#14281a] dark:text-[#6FD19A]":"failed"===a?"bg-red-50 text-red-700 dark:bg-[#331619] dark:text-[#F08078]":"bg-yellow-50 text-yellow-700 dark:bg-[#332a12] dark:text-[#E0B44E]",g=async(b,c)=>{(await (0,R.h)(a.uuid,[{uuid:b,status:c}])).success&&am.refresh()};return(0,e.jsxs)("div",{className:"mt-5",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:al("acceptanceCriteria.title")}),c&&(0,e.jsx)(A.E,{className:f(a.acceptanceStatus||"pending"),variant:"secondary",children:al("acceptanceCriteria.progress",{passed:c.passed,total:c.total})})]}),(0,e.jsxs)("div",{className:"mt-2 space-y-2",children:[b.map(b=>(0,e.jsx)(B.Zp,{className:"p-3",children:(0,e.jsxs)("div",{className:"flex items-start gap-2",children:[(0,e.jsx)("div",{className:"mt-0.5 shrink-0",children:d(b.status)}),(0,e.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,e.jsx)("span",{className:"text-xs text-foreground",children:b.description}),(0,e.jsx)(A.E,{variant:"outline",className:"text-[10px] shrink-0",children:b.required?al("acceptanceCriteria.required"):al("acceptanceCriteria.optional")})]}),(0,e.jsxs)("div",{className:"mt-2 space-y-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 text-[10px]",children:[(0,e.jsx)("span",{className:"text-[#9A9A9A] w-20 shrink-0",children:al("acceptanceCriteria.devSelfCheck")}),(0,e.jsxs)(A.E,{className:`text-[10px] ${f(b.devStatus)}`,variant:"secondary",children:[d(b.devStatus),(0,e.jsx)("span",{className:"ml-1",children:al(`acceptanceCriteria.status.${b.devStatus}`)})]})]}),(0,e.jsxs)("div",{className:"flex items-center gap-2 text-[10px]",children:[(0,e.jsx)("span",{className:"text-[#9A9A9A] w-20 shrink-0",children:al("acceptanceCriteria.verification")}),(0,e.jsxs)(A.E,{className:`text-[10px] ${f(b.status)}`,variant:"secondary",children:[d(b.status),(0,e.jsx)("span",{className:"ml-1",children:al(`acceptanceCriteria.status.${b.status}`)})]})]})]}),b.devEvidence&&(0,e.jsxs)("div",{className:"mt-2 rounded bg-background p-2",children:[(0,e.jsx)("span",{className:"text-[10px] font-medium text-[#9A9A9A]",children:al("acceptanceCriteria.devEvidence")}),(0,e.jsx)("p",{className:"text-[11px] text-foreground mt-0.5",children:b.devEvidence})]}),b.evidence&&(0,e.jsxs)("div",{className:"mt-2 rounded bg-background p-2",children:[(0,e.jsx)("span",{className:"text-[10px] font-medium text-[#9A9A9A]",children:al("acceptanceCriteria.verifyEvidence")}),(0,e.jsx)("p",{className:"text-[11px] text-foreground mt-0.5",children:b.evidence})]}),"pending"===b.status?(0,e.jsxs)("div",{className:"mt-2 flex gap-2",children:[(0,e.jsxs)(C.$,{size:"sm",variant:"outline",className:"h-8 min-h-[44px] sm:min-h-0 flex-1 sm:flex-none text-xs text-green-700 dark:text-[#6FD19A] border-green-200 dark:border-[#2a4a34] hover:bg-green-50 dark:hover:bg-[#14281a]",onClick:()=>g(b.uuid,"passed"),children:[(0,e.jsx)(q.A,{className:"h-3.5 w-3.5 mr-1"}),al("acceptanceCriteria.pass")]}),(0,e.jsxs)(C.$,{size:"sm",variant:"outline",className:"h-8 min-h-[44px] sm:min-h-0 flex-1 sm:flex-none text-xs text-red-700 dark:text-[#F08078] border-red-200 dark:border-[#5a2a2e] hover:bg-red-50 dark:hover:bg-[#331619]",onClick:()=>g(b.uuid,"failed"),children:[(0,e.jsx)(r.A,{className:"h-3.5 w-3.5 mr-1"}),al("acceptanceCriteria.fail")]})]}):(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)(C.$,{size:"sm",variant:"ghost",className:"h-7 min-h-[44px] sm:min-h-0 text-xs text-[#9A9A9A] hover:text-foreground",onClick:async()=>{(await (0,S.N)(a.uuid,b.uuid)).success&&am.refresh()},children:al("acceptanceCriteria.undoVerification")})})]})]})},b.uuid)),c&&(c.requiredPending>0||c.requiredFailed>0)&&(0,e.jsxs)("div",{className:"flex items-center gap-2 rounded-lg bg-yellow-50 dark:bg-[#332a12] p-3 mt-2",children:[(0,e.jsx)(t.A,{className:"h-4 w-4 text-yellow-600 dark:text-[#E0B44E] shrink-0"}),(0,e.jsx)("span",{className:"text-xs text-yellow-700 dark:text-[#E0B44E]",children:al("acceptanceCriteria.gateBlocked",{count:c.requiredPending+c.requiredFailed})})]}),c&&0===c.requiredPending&&0===c.requiredFailed&&c.required>0&&(0,e.jsxs)("div",{className:"flex items-center gap-2 rounded-lg bg-green-50 dark:bg-[#14281a] p-3 mt-2",children:[(0,e.jsx)(q.A,{className:"h-4 w-4 text-green-600 dark:text-[#6FD19A] shrink-0"}),(0,e.jsx)("span",{className:"text-xs text-green-700 dark:text-[#6FD19A]",children:al("acceptanceCriteria.gateReady")})]})]})]})})(),(0,e.jsxs)("div",{className:"mt-5 flex-1",children:[(0,e.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:al("common.activity")}),(0,e.jsx)("div",{className:"mt-2 space-y-3",children:at?(0,e.jsx)("div",{className:"flex items-center justify-center py-4",children:(0,e.jsx)(o.A,{className:"h-4 w-4 animate-spin text-[#9A9A9A]"})}):0===ar.length?(0,e.jsx)("p",{className:"text-sm text-[#9A9A9A] italic",children:al("common.noActivity")}):ar.map(a=>(0,e.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,e.jsx)("div",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-secondary",children:(0,e.jsx)("div",{className:`h-2 w-2 rounded-full ${function(a){switch(a){case"task_created":return"bg-primary";case"task_assigned":case"task_claimed":return"bg-[#1976D2]";case"task_started":return"bg-[#5A9E6F]";case"task_submitted":return"bg-[#7B1FA2]";case"task_completed":case"task_verified":return"bg-[#00796B]";case"task_released":return"bg-[#E65100]";default:return"bg-muted-foreground"}}(a.action)}`})}),(0,e.jsxs)("div",{className:"flex-1",children:[(0,e.jsx)("p",{className:"text-xs text-foreground",children:function(a,b){let c=a.sessionName?`${a.actorName} / ${a.sessionName}`:a.actorName,{action:d}=a;switch(d){case"task_created":return b("activity.taskCreated",{actor:c});case"task_assigned":return b("activity.taskAssigned",{actor:c});case"task_claimed":return b("activity.taskClaimed",{actor:c});case"task_started":return b("activity.taskStarted",{actor:c});case"task_submitted":return b("activity.taskSubmitted",{actor:c});case"task_completed":case"task_verified":return b("activity.taskCompleted",{actor:c});case"task_released":return b("activity.taskReleased",{actor:c});case"task_status_changed":return b("activity.taskStatusChanged",{actor:c});default:return`${c}: ${d}`}}(a,al)}),(0,e.jsx)("p",{className:"text-[10px] text-[#9A9A9A]",children:ad(a.createdAt,al)})]})]},a.uuid))})]}),(0,e.jsxs)("div",{className:"mt-5",children:[(0,e.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:al("references.title")}),(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)(U.ReferencesSection,{targetType:"task",targetUuid:a.uuid,canWrite:!0,compact:!0})})]}),(0,e.jsxs)("div",{className:"mt-5",children:[(0,e.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:al("comments.title")}),(0,e.jsx)("div",{className:"mt-3",children:(0,e.jsx)(T.$m,{targetType:"task",targetUuid:a.uuid,currentUserUuid:c,compact:!0})})]})]}):null})}),(0,e.jsx)("div",{className:"border-t border-secondary px-6 py-4",children:(0,e.jsx)("div",{className:"flex items-center gap-3",children:aO?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(C.$,{variant:"outline",className:"border-border",onClick:a9,disabled:a$,children:al("common.cancel")}),(0,e.jsx)(C.$,{className:"bg-primary hover:bg-[#B56A42] text-white",onClick:ba,disabled:a$||!aQ.trim(),children:a$?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(o.A,{className:"mr-2 h-4 w-4 animate-spin"}),al("common.saving")]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(u.A,{className:"mr-2 h-4 w-4"}),aN?al("common.create"):al("tasks.saveChanges")]})})]}):a?(0,e.jsxs)(e.Fragment,{children:["done"!==a.status&&"closed"!==a.status&&(0,e.jsxs)(C.$,{variant:"outline",className:"border-border",onClick:()=>ay(!0),disabled:ap,children:[(0,e.jsx)(v.A,{className:"mr-2 h-4 w-4"}),al("common.assign")]}),a5&&(0,e.jsxs)(C.$,{className:"flex-1 bg-[#1976D2] hover:bg-[#1565C0] text-white",onClick:()=>a8("in_progress"),disabled:ap,children:[(0,e.jsx)(w.A,{className:"mr-2 h-4 w-4"}),al("tasks.startWork")]}),a6&&(0,e.jsxs)(C.$,{className:"flex-1 bg-[#7B1FA2] hover:bg-[#6A1B9A] text-white",onClick:()=>a8("to_verify"),disabled:ap,children:[(0,e.jsx)(x.A,{className:"mr-2 h-4 w-4"}),al("tasks.submitForReview")]}),a7&&(0,e.jsxs)(C.$,{className:"flex-1 bg-[#22C55E] hover:bg-[#16A34A] text-white",onClick:()=>a8("done"),disabled:ap,children:[(0,e.jsx)(y.A,{className:"mr-2 h-4 w-4"}),al("tasks.markAsVerified")]}),("done"===a.status||"closed"===a.status)&&(0,e.jsx)("div",{className:"text-sm text-[#9A9A9A] text-center w-full",children:al("tasks.taskCompleted")}),(0,e.jsx)("div",{className:"ml-auto",children:(0,e.jsxs)(I.Lt,{children:[(0,e.jsx)(I.tv,{asChild:!0,children:(0,e.jsx)(C.$,{variant:"outline",size:"icon",className:"h-9 w-9 border-border text-[#D32F2F] dark:text-[#F08078] hover:bg-[#FFEBEE] dark:hover:bg-[#331619] hover:text-[#D32F2F] hover:border-[#D32F2F]",children:(0,e.jsx)(z.A,{className:"h-4 w-4"})})}),(0,e.jsxs)(I.EO,{children:[(0,e.jsxs)(I.wd,{children:[(0,e.jsx)(I.r7,{children:al("tasks.deleteTask")}),(0,e.jsx)(I.$v,{children:al("tasks.deleteTaskConfirm",{title:a.title})})]}),(0,e.jsxs)(I.ck,{children:[(0,e.jsx)(I.Zr,{children:al("common.cancel")}),(0,e.jsx)(I.Rx,{variant:"destructive",onClick:bb,disabled:a2,children:a2?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(o.A,{className:"mr-2 h-4 w-4 animate-spin"}),al("common.delete")]}):al("common.delete")})]})]})]})})]}):null})})]}),a&&ax&&(0,e.jsx)(X.Q,{task:a,projectUuid:b,currentUserUuid:c,onClose:()=>ay(!1)})]})}d()}catch(a){d(a)}})},87707:(a,b,c)=>{c.d(b,{Q:()=>y});var d=c(10837),e=c(21968),f=c(68884),g=c(9222),h=c(86460),i=c(21692),j=c(97443),k=c(42424),l=c(6871),m=c(94214),n=c(2852),o=c(11225),p=c(55732),q=c(23871),r=c(27696),s=c(27876),t=c(42377);t.callServer,t.findSourceMapURL,t.callServer,t.findSourceMapURL;let u=(0,t.createServerReference)("402c386373a4fabf2ad2d5dfaa365acb288aac83a0",t.callServer,void 0,t.findSourceMapURL,"claimTaskAction"),v=(0,t.createServerReference)("70282f0868538e338c4b3140249ed90c558fa6ab54",t.callServer,void 0,t.findSourceMapURL,"claimTaskToAgentAction"),w=(0,t.createServerReference)("60c2047b27bf7270af9d1a080b9e280000f8a9a205",t.callServer,void 0,t.findSourceMapURL,"claimTaskToUserAction"),x=(0,t.createServerReference)("40f2bf09e6782d17c46f275c86a593725b6ca03e60",t.callServer,void 0,t.findSourceMapURL,"releaseTaskAction");function y({task:a,projectUuid:b,currentUserUuid:c,onClose:t}){let y=(0,g.c)(),z=(0,f.r)(),[A,B]=(0,e.useState)(!1),[C,D]=(0,e.useState)("self"),[E,F]=(0,e.useState)(""),[G,H]=(0,e.useState)(""),[I,J]=(0,e.useState)([]),[K,L]=(0,e.useState)([]),[M,N]=(0,e.useState)(!0),[O,P]=(0,e.useState)(null),[Q,R]=(0,e.useState)([]),[S,T]=(0,e.useState)(!1),[U,V]=(0,e.useState)(null),[W,X]=(0,e.useState)(null),Y=!!a.assignee,Z=Q.find(a=>a.connectionUuid===W)??null,$=new Set(Q.map(a=>a.host)).size>1,_=async()=>{let b;if(B(!0),P(null),"self"===C)b=await u(a.uuid);else if("agent"===C&&E)b=await v(a.uuid,E,Z?.agentInstanceUuid??void 0);else if("user"===C&&G)b=await w(a.uuid,G);else{if("release"!==C)return void B(!1);b=await x(a.uuid)}B(!1),b?.success?(t(),z.refresh()):b?.error&&P(b.error)},aa="self"===C||"agent"===C&&E||"user"===C&&G||"release"===C&&Y;return(0,d.jsxs)(m._8,{open:!0,onOpenChange:a=>{a||t()},className:"bg-card sm:max-w-[400px]",header:(0,d.jsx)(m.AI,{className:"text-base font-semibold text-foreground",children:y("tasks.assignTask")}),footer:(0,d.jsxs)("div",{className:"flex w-full items-center justify-end gap-4",children:[(0,d.jsx)(k.$,{variant:"outline",onClick:t,disabled:A,className:"border-border",children:y("common.cancel")}),(0,d.jsx)(k.$,{onClick:_,disabled:A||!aa,className:"bg-primary hover:bg-[#B56A42] text-white",children:A?(0,d.jsx)(h.A,{className:"h-4 w-4 animate-spin"}):"release"===C?y("common.release"):function(){if("agent"!==C||!Z)return y("common.assign");let a=(0,r.kn)(Z.cwd),b=a.isUnknown?y(a.label):a.label,c=(0,r.g9)(Z.host),d=c.isUnknown?y(c.label):c.label;return $?y("assignInstance.assignToWithHost",{path:b,host:d}):y("assignInstance.assignTo",{path:b})}()})]}),bodyClassName:"space-y-4",children:[(0,d.jsxs)("div",{className:"rounded-lg bg-background p-3",children:[(0,d.jsx)("p",{className:"text-[13px] font-medium text-foreground",children:a.title}),a.description&&(0,d.jsx)("p",{className:"mt-1 text-[11px] text-muted-foreground line-clamp-2",children:a.description})]}),Y&&(0,d.jsx)("div",{className:"rounded-lg bg-[#E3F2FD] dark:bg-[#13253a] p-3",children:(0,d.jsxs)("p",{className:"text-xs text-[#1976D2] dark:text-[#5AA9F0]",children:[y("common.currentAssignee"),": ",(0,d.jsx)("span",{className:"font-medium",children:a.assignee?.name})]})}),O&&(0,d.jsx)("div",{className:"rounded-lg bg-[#FEE2E2] dark:bg-[#331619] p-3",children:(0,d.jsx)("p",{className:"text-xs text-[#D32F2F] dark:text-[#F08078]",children:O})}),(0,d.jsx)("p",{className:"text-[13px] text-muted-foreground",children:y("assign.selectAssignee")}),M?(0,d.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,d.jsx)(h.A,{className:"h-6 w-6 animate-spin text-[#9A9A9A]"})}):(0,d.jsxs)(o.z,{value:C,onValueChange:a=>D(a),className:"space-y-3",children:[(0,d.jsxs)("div",{className:`rounded-[10px] p-4 transition-colors cursor-pointer ${"self"===C?"bg-[#FDF8F6] dark:bg-[#201d1b] border-2 border-primary":"bg-card border border-border hover:border-primary/50"}`,onClick:()=>D("self"),children:[(0,d.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,d.jsx)(o.C,{value:"self",id:"self",className:"border-primary text-primary"}),(0,d.jsx)(n.J,{htmlFor:"self",className:"text-sm font-medium text-foreground cursor-pointer",children:y("assign.assignToMyself")})]}),(0,d.jsx)("p",{className:"mt-2 ml-6 text-xs text-muted-foreground leading-relaxed",children:y("assign.assignToMyselfDesc")})]}),(0,d.jsxs)("div",{className:`rounded-[10px] p-4 transition-colors ${"agent"===C?"bg-[#FDF8F6] dark:bg-[#201d1b] border-2 border-primary":"bg-card border border-border"}`,children:[(0,d.jsxs)("div",{className:"flex items-center gap-2.5 cursor-pointer",onClick:()=>D("agent"),children:[(0,d.jsx)(o.C,{value:"agent",id:"agent",className:"border-primary text-primary"}),(0,d.jsx)(n.J,{htmlFor:"agent",className:"text-sm font-medium text-foreground cursor-pointer",children:y("assign.orAssignToAgent")})]}),(0,d.jsx)("p",{className:"mt-2 ml-6 text-xs text-muted-foreground leading-relaxed",children:y("tasks.onlySelectedAgentCanWork")}),"agent"===C&&(0,d.jsxs)("div",{className:"mt-3 ml-6 space-y-3",children:[(0,d.jsxs)(p.l6,{value:E,onValueChange:F,children:[(0,d.jsx)(p.bq,{className:"w-full border-border",children:(0,d.jsx)(p.yv,{placeholder:y("tasks.selectAgent")})}),(0,d.jsx)(p.gC,{className:"z-[120]",children:I.length>0?I.map(a=>(0,d.jsx)(p.eb,{value:a.uuid,children:(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(l.AgentAvatar,{name:a.name,size:16,className:"rounded-full"}),(0,d.jsx)("span",{children:a.name})]})},a.uuid)):(0,d.jsx)("div",{className:"px-3 py-2 text-xs text-[#9A9A9A]",children:y("tasks.noAgentsAvailable")})})]}),E&&(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:y("assignInstance.workingDirectory")}),S?(0,d.jsxs)("div",{className:"flex items-center gap-2 py-2 text-xs text-[#9A9A9A]",children:[(0,d.jsx)(h.A,{className:"h-3.5 w-3.5 animate-spin"}),y("assignInstance.loadingInstances")]}):U?.source==="project_fixed"?(0,d.jsx)(s.Y,{target:U}):0===Q.length?(0,d.jsx)("p",{className:"rounded-lg bg-background p-2.5 text-[11px] leading-relaxed text-muted-foreground",children:y("assignInstance.noInstances")}):(0,d.jsx)(q.O,{instances:Q,selectedConnectionUuid:W,onSelect:a=>X(a.connectionUuid),ariaLabel:y("assignInstance.workingDirectory")}),U?.source!=="project_fixed"&&(0,d.jsxs)("div",{className:"flex items-start gap-1.5 text-[11px] leading-relaxed text-[#9A8C7E]",children:[(0,d.jsx)(i.A,{className:"mt-0.5 h-3.5 w-3.5 shrink-0","aria-hidden":!0}),(0,d.jsx)("span",{children:y("assignInstance.pinNote")})]})]})]})]}),(0,d.jsxs)("div",{className:`rounded-[10px] p-4 transition-colors ${"user"===C?"bg-[#FDF8F6] dark:bg-[#201d1b] border-2 border-primary":"bg-card border border-border"}`,children:[(0,d.jsxs)("div",{className:"flex items-center gap-2.5 cursor-pointer",onClick:()=>D("user"),children:[(0,d.jsx)(o.C,{value:"user",id:"user",className:"border-primary text-primary"}),(0,d.jsx)(n.J,{htmlFor:"user",className:"text-sm font-medium text-foreground cursor-pointer",children:y("assign.orAssignToUser")})]}),"user"===C&&(0,d.jsx)("div",{className:"mt-3 ml-6",children:(0,d.jsxs)(p.l6,{value:G,onValueChange:H,children:[(0,d.jsx)(p.bq,{className:"w-full border-border",children:(0,d.jsx)(p.yv,{placeholder:y("tasks.selectUser")})}),(0,d.jsx)(p.gC,{className:"z-[120]",children:K.length>0?K.map(a=>(0,d.jsx)(p.eb,{value:a.uuid,children:(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(j.A,{className:"h-4 w-4 text-muted-foreground"}),(0,d.jsx)("span",{children:a.name||a.email})]})},a.uuid)):(0,d.jsx)("div",{className:"px-3 py-2 text-xs text-[#9A9A9A]",children:y("tasks.noUsersAvailable")})})]})})]}),Y&&(0,d.jsxs)("div",{className:`rounded-[10px] p-4 transition-colors cursor-pointer ${"release"===C?"bg-[#FDF8F6] dark:bg-[#201d1b] border-2 border-primary":"bg-card border border-border hover:border-primary/50"}`,onClick:()=>D("release"),children:[(0,d.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,d.jsx)(o.C,{value:"release",id:"release",className:"border-primary text-primary"}),(0,d.jsx)(n.J,{htmlFor:"release",className:"text-sm font-medium text-foreground cursor-pointer",children:y("assign.releaseAssignee")})]}),(0,d.jsx)("p",{className:"mt-2 ml-6 text-xs text-muted-foreground leading-relaxed",children:y("assign.releaseAssigneeDesc")})]})]})]})}},94037:(a,b,c)=>{c.d(b,{x:()=>e});var d=c(42377);let e=(0,d.createServerReference)("40d05690894458aaf82b0c2c4be8ee949fcaca80e7",d.callServer,void 0,d.findSourceMapURL,"getTaskDependenciesAction")},98625:(a,b,c)=>{c.d(b,{T:()=>f});var d=c(21968),e=c(1007);function f(a,b){let c=(0,e.useSearchParams)(),f=(0,d.useRef)(!1),g=!f.current;f.current=!0;let h=c.get("panel")??(g?b??null:null),i=c.get("tab"),j=(0,d.useCallback)((b,c)=>{let d=new URLSearchParams(window.location.search);b?d.set("panel",b):d.delete("panel"),c?d.set("tab",c):d.delete("tab");let e=d.toString();return e?`${a}?${e}`:a},[a]),k=(0,d.useCallback)((a,b)=>{window.history.replaceState(null,"",j(a,b))},[j]),l=(0,d.useCallback)(()=>{window.history.replaceState(null,"",j(null))},[j]),m=(0,d.useCallback)(a=>{h&&window.history.replaceState(null,"",j(h,a))},[j,h]);return{selectedId:h,selectedTab:i,openPanel:k,closePanel:l,switchTab:m}}}};
@@ -1 +0,0 @@
1
- "use strict";exports.id=3045,exports.ids=[3045],exports.modules={2852:(a,b,c)=>{c.d(b,{J:()=>g});var d=c(10837);c(21968);var e=c(13277),f=c(96307);function g({className:a,...b}){return(0,d.jsx)(e.Root,{"data-slot":"label",className:(0,f.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",a),...b})}},7086:(a,b,c)=>{function d(a,b){return!!a&&!!b&&("user"===a.type?"user"===b.type&&a.uuid===b.uuid:"agent"===a.type?"agent"===b.type&&a.uuid===b.uuid:"agent_instance"===a.type&&"agent"===b.type&&!!a.agentUuid&&a.agentUuid===b.uuid)}function e(a){return!!a&&("agent"===a.type||"agent_instance"===a.type)}c.d(b,{RU:()=>d,bB:()=>e})},10297:(a,b,c)=>{c.d(b,{G7:()=>i,L$:()=>l,h_:()=>m,oI:()=>j,uB:()=>h,xL:()=>k});var d=c(10837);c(21968);var e=c(28918),f=c(75888),g=c(96307);function h({className:a,...b}){return(0,d.jsx)(e.uB,{"data-slot":"command",className:(0,g.cn)("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",a),...b})}function i({className:a,...b}){return(0,d.jsxs)("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[(0,d.jsx)(f.A,{className:"size-4 shrink-0 opacity-50"}),(0,d.jsx)(e.uB.Input,{"data-slot":"command-input",className:(0,g.cn)("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",a),...b})]})}function j({className:a,...b}){return(0,d.jsx)(e.uB.List,{"data-slot":"command-list",className:(0,g.cn)("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",a),...b})}function k({...a}){return(0,d.jsx)(e.uB.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...a})}function l({className:a,...b}){return(0,d.jsx)(e.uB.Group,{"data-slot":"command-group",className:(0,g.cn)("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",a),...b})}function m({className:a,...b}){return(0,d.jsx)(e.uB.Item,{"data-slot":"command-item",className:(0,g.cn)("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",a),...b})}},26078:(a,b,c)=>{c.d(b,{RU:()=>h,s8:()=>g});let d={developer_agent:["idea:read","proposal:read","document:read","project:read","task:read","task:write"],pm_agent:["idea:read","idea:write","proposal:read","proposal:write","document:read","document:write","task:read","task:write","project:read","project:write"],admin_agent:["idea:read","idea:write","idea:admin","proposal:read","proposal:write","proposal:admin","document:read","document:write","document:admin","task:read","task:write","task:admin","project:read","project:write","project:admin"]},e=["read","write","admin"],f=new Set(["idea","proposal","document","task","project"].flatMap(a=>e.map(b=>`${a}:${b}`)));function g(a){return f.has(a)}function h(a,b){let c=new Set;if(a)for(let b of a){let a=d[b.endsWith("_agent")?b:`${b}_agent`];if(a)for(let b of a)c.add(b)}if(b)for(let a of b)g(a)&&c.add(a);return c}},28774:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{A8:()=>q,CG:()=>o,Iq:()=>n,RB:()=>l,Sn:()=>i,d5:()=>m,ic:()=>p,tN:()=>k,x4:()=>j});var e=c(71255),f=c(77219),g=c(26078),h=a([e,f]);async function i({companyUuid:a,name:b,roles:c,ownerUuid:d,persona:f,systemPrompt:g,permissions:h}){return e.z.agent.create({data:{companyUuid:a,name:b,roles:c,ownerUuid:d,persona:f,systemPrompt:g,...void 0!==h&&{permissions:h}},select:{uuid:!0,name:!0,roles:!0,permissions:!0,persona:!0,systemPrompt:!0,ownerUuid:!0,createdAt:!0}})}async function j(a,b,c){if(c&&!await e.z.agent.findFirst({where:{uuid:a,companyUuid:c},select:{uuid:!0}}))throw Error("Agent not found");return e.z.agent.update({where:{uuid:a},data:b,select:{uuid:!0,name:!0,roles:!0,permissions:!0,persona:!0,systemPrompt:!0,ownerUuid:!0,lastActiveAt:!0,createdAt:!0}})}async function k(a,b){return e.z.apiKey.updateMany({where:{agentUuid:a,revokedAt:null},data:{name:b}})}async function l(a){return e.z.agent.delete({where:{uuid:a}})}async function m(a,b,c,d){let f={companyUuid:a,revokedAt:null,...d&&{agent:{ownerUuid:d}}},[g,h]=await Promise.all([e.z.apiKey.findMany({where:f,skip:b,take:c,orderBy:{createdAt:"desc"},include:{agent:{select:{uuid:!0,name:!0,roles:!0,permissions:!0,persona:!0}}}}),e.z.apiKey.count({where:f})]);return{apiKeys:g,total:h}}async function n({companyUuid:a,agentUuid:b,name:c,expiresAt:d}){let{key:g,hash:h,prefix:i}=(0,f.XH)();return{...await e.z.apiKey.create({data:{companyUuid:a,agentUuid:b,keyHash:h,keyPrefix:i,name:c,expiresAt:d},select:{uuid:!0,keyPrefix:!0,name:!0,expiresAt:!0,createdAt:!0}}),key:g}}async function o(a,b,c){return e.z.apiKey.findFirst({where:{uuid:b,companyUuid:a,...c&&{agent:{ownerUuid:c}}},select:{uuid:!0,agentUuid:!0,revokedAt:!0}})}async function p(a,b,c){return(await e.z.agent.findMany({where:{companyUuid:a,...c&&{ownerUuid:c}},select:{uuid:!0,name:!0,roles:!0,permissions:!0,ownerUuid:!0},orderBy:{name:"asc"}})).filter(a=>(0,g.RU)(a.roles,a.permissions).has(b)).map(({uuid:a,name:b,roles:c,ownerUuid:d})=>({uuid:a,name:b,roles:c,ownerUuid:d}))}async function q(a){return e.z.user.findMany({where:{companyUuid:a},select:{uuid:!0,name:!0,email:!0},orderBy:{name:"asc"}})}[e,f]=h.then?(await h)():h,d()}catch(a){d(a)}})},46398:(a,b,c)=>{c.d(b,{N2:()=>j,mP:()=>h,qQ:()=>i});var d=c(84797),e=c(97731),f=c(40260),g=c(96101);let h=["docs","repo","issue_pr","paper_blog"],i={docs:{labelKey:"references.typeDocs",badgeClass:"bg-blue-50 text-blue-700 dark:bg-[#13253a] dark:text-[#5AA9F0]",icon:d.A},repo:{labelKey:"references.typeRepo",badgeClass:"bg-green-50 text-green-700 dark:bg-[#14281a] dark:text-[#6FD19A]",icon:e.A},issue_pr:{labelKey:"references.typeIssuePr",badgeClass:"bg-purple-50 text-purple-700 dark:bg-[#281630] dark:text-[#C98FE0]",icon:f.A},paper_blog:{labelKey:"references.typePaperBlog",badgeClass:"bg-amber-50 text-amber-700 dark:bg-[#332a12] dark:text-[#E0B44E]",icon:g.A}};function j(a){return h.includes(a)}},52178:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{Y9:()=>l,bv:()=>n,jD:()=>k,t1:()=>m});var e=c(2613);c(50785);var f=c(9259),g=c(52768),h=c(97307),i=c(12217),j=a([f,g]);[f,g]=j.then?(await j)():j;let o=g.Sy;async function k(a,b){let c=await (0,f.d)();if(!c)return{success:!1,error:"unauthorized"};if(!o.includes(a))return{success:!1,error:`Invalid target type: ${a}`};try{let d=await (0,g.Xo)({companyUuid:c.companyUuid,targetType:a,targetUuid:b});return{success:!0,references:d}}catch(c){return h.default.error({err:c,targetType:a,targetUuid:b},"Failed to list references"),{success:!1,error:"Failed to load references"}}}async function l(a){let b=await (0,f.d)();if(!b)return{success:!1,error:"unauthorized"};if(!o.includes(a.targetType))return{success:!1,error:`Invalid target type: ${a.targetType}`};try{let c=await (0,g.kA)({companyUuid:b.companyUuid,targetType:a.targetType,targetUuid:a.targetUuid,type:a.type,url:a.url,title:a.title,notes:a.notes??null,createdByType:"user",createdByUuid:b.actorUuid});return{success:!0,reference:c}}catch(b){h.default.error({err:b},"Failed to create reference");let a=b instanceof Error?b.message:"Failed to add reference";return{success:!1,error:a}}}async function m(a){let b=await (0,f.d)();if(!b)return{success:!1,error:"unauthorized"};try{let c=await (0,g.Xp)(b.companyUuid,a.uuid,{...void 0!==a.type?{type:a.type}:{},...void 0!==a.url?{url:a.url}:{},...void 0!==a.title?{title:a.title}:{},...void 0!==a.notes?{notes:a.notes}:{}});return{success:!0,reference:c}}catch(c){h.default.error({err:c,uuid:a.uuid},"Failed to update reference");let b=c instanceof Error?c.message:"Failed to update reference";return{success:!1,error:b}}}async function n(a){let b=await (0,f.d)();if(!b)return{success:!1,error:"unauthorized"};try{return await (0,g.bA)(b.companyUuid,a),{success:!0}}catch(c){h.default.error({err:c,uuid:a},"Failed to delete reference");let b=c instanceof Error?c.message:"Failed to delete reference";return{success:!1,error:b}}}(0,i.D)([k,l,m,n]),(0,e.A)(k,"60c990921fffa4018101619839c15ebcac92625cd2",null),(0,e.A)(l,"406411d8d244f6200dfbab33bacf49984741a1a351",null),(0,e.A)(m,"40fd7fab1496150ee8374db007064b867b747c5c3d",null),(0,e.A)(n,"4088f1db3ff9868aadade6597a2951d87a4ce89538",null),d()}catch(a){d(a)}})},52768:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{Sy:()=>u,Xo:()=>o,Xp:()=>q,bA:()=>r,kA:()=>p});var e=c(71255),f=c(92633),g=c(62729),h=c(67738),i=c(97307),j=a([e,f,h]);[e,f,h]=j.then?(await j)():j;let s=i.default.child({module:"reference-artifact.service"}),t=["docs","repo","issue_pr","paper_blog"],u=["proposal","task","idea"],v={uuid:!0,targetType:!0,targetUuid:!0,type:!0,url:!0,title:!0,notes:!0,createdByType:!0,createdByUuid:!0,createdAt:!0,updatedAt:!0};async function k(a){let b=await (0,f.LS)(a.createdByUuid,"user"===a.createdByType||"agent"===a.createdByType?a.createdByType:void 0);return{uuid:a.uuid,targetType:a.targetType,targetUuid:a.targetUuid,type:a.type,url:a.url,title:a.title,notes:a.notes??null,createdBy:b,createdAt:a.createdAt.toISOString(),updatedAt:a.updatedAt.toISOString()}}function l(a){if(!t.includes(a))throw Error(`Invalid reference type: ${a}`)}function m(a){let b="string"==typeof a?a.trim():"";if(!b||!/^https?:\/\//i.test(b))throw Error(`Invalid reference url: ${a}`)}async function n(a,b,c){switch(b){case"proposal":{let b=await e.z.proposal.findFirst({where:{uuid:c,companyUuid:a},select:{projectUuid:!0}});if(!b)throw Error(`Target proposal with UUID ${c} not found`);return b.projectUuid}case"task":{let b=await e.z.task.findFirst({where:{uuid:c,companyUuid:a},select:{projectUuid:!0}});if(!b)throw Error(`Target task with UUID ${c} not found`);return b.projectUuid}case"idea":{let b=await e.z.idea.findFirst({where:{uuid:c,companyUuid:a},select:{projectUuid:!0}});if(!b)throw Error(`Target idea with UUID ${c} not found`);return b.projectUuid}default:throw Error(`Unsupported reference targetType: ${b}`)}}async function o({companyUuid:a,targetType:b,targetUuid:c}){let d=await e.z.referenceArtifact.findMany({where:{companyUuid:a,targetType:b,targetUuid:c},orderBy:{createdAt:"asc"},select:v});return Promise.all(d.map(a=>k(a)))}async function p(a){let{companyUuid:b,targetType:c,targetUuid:d,type:f,url:i,title:j,notes:o}=a;l(f),m(i);let p=await n(b,c,d),q=await e.z.referenceArtifact.create({data:{companyUuid:b,targetType:c,targetUuid:d,type:f,url:i,title:j,notes:o??null,createdByType:a.createdByType,createdByUuid:a.createdByUuid},select:v});try{g.B.emitChange({companyUuid:b,projectUuid:p,entityType:c,entityUuid:d,action:"updated",actorUuid:a.createdByUuid})}catch(a){s.warn({err:a,referenceUuid:q.uuid,targetType:c,targetUuid:d},"Failed to emit change event for reference artifact")}try{await h.createActivity({companyUuid:b,projectUuid:p,targetType:c,targetUuid:d,actorType:a.createdByType,actorUuid:a.createdByUuid,action:"reference_added",value:{referenceUuid:q.uuid,type:q.type,url:q.url,title:q.title}})}catch(a){s.warn({err:a,referenceUuid:q.uuid,targetType:c,targetUuid:d},"Failed to record reference_added Activity")}return k(q)}async function q(a,b,{type:c,url:d,title:f,notes:g}){if(void 0!==c&&l(c),void 0!==d&&m(d),!await e.z.referenceArtifact.findFirst({where:{uuid:b,companyUuid:a},select:{uuid:!0}}))throw Error(`Reference with UUID ${b} not found`);let h={};void 0!==c&&(h.type=c),void 0!==d&&(h.url=d),void 0!==f&&(h.title=f),void 0!==g&&(h.notes=g);let i=await e.z.referenceArtifact.update({where:{uuid:b},data:h,select:v});return k(i)}async function r(a,b){if(!await e.z.referenceArtifact.findFirst({where:{uuid:b,companyUuid:a},select:{uuid:!0}}))throw Error(`Reference with UUID ${b} not found`);await e.z.referenceArtifact.delete({where:{uuid:b}})}d()}catch(a){d(a)}})},61206:(a,b,c)=>{c.d(b,{L:()=>h});var d=c(10837),e=c(21968),f=c(9222),g=c(99127);function h({notes:a}){let b=(0,f.c)(),[c,h]=(0,e.useState)(!1),i=a?.trim();if(!i)return null;let j=(0,d.jsx)("button",{type:"button",onClick:()=>h(a=>!a),"aria-expanded":c,"aria-label":b("references.toggleNotes"),className:`mt-1 w-full cursor-pointer text-left text-xs leading-relaxed text-muted-foreground ${c?"block":"line-clamp-2"}`,children:i});return c?j:(0,d.jsx)(g.Bc,{delayDuration:200,children:(0,d.jsxs)(g.m_,{children:[(0,d.jsx)(g.k$,{asChild:!0,children:j}),(0,d.jsx)(g.ZI,{className:"max-w-xs whitespace-pre-wrap break-words",children:i})]})})}},73908:(a,b,c)=>{c.d(b,{C:()=>k,K:()=>m});var d=c(10837),e=c(9222),f=c(79543),g=c(92900),h=c(42424),i=c(9994),j=c(88536);function k({items:a,onChange:b,disabled:c}){let k=(0,e.c)(),l=(c,d)=>{let e=a.slice();e[c]={...e[c],...d},b(e)};return(0,d.jsxs)("div",{className:"space-y-3",children:[a.length>0&&(0,d.jsx)("div",{className:"space-y-2",children:a.map((e,g)=>(0,d.jsxs)("div",{className:"flex items-start gap-2 rounded-lg border border-[#E5E2DC] dark:border-[#2a2a2e] bg-background p-2.5",children:[(0,d.jsx)("div",{className:"flex-1 min-w-0",children:(0,d.jsx)(i.p,{value:e.description,onChange:a=>l(g,{description:a.target.value}),placeholder:k("acceptanceCriteria.criterionPlaceholder"),className:"border-[#E5E2DC] dark:border-[#2a2a2e] text-sm focus-visible:ring-primary h-8",disabled:c})}),(0,d.jsxs)("div",{className:"flex items-center gap-2 shrink-0 pt-1",children:[(0,d.jsx)(j.d,{checked:e.required,onCheckedChange:a=>l(g,{required:a}),className:"data-[state=checked]:bg-primary",disabled:c}),(0,d.jsx)("span",{className:"text-[10px] font-medium text-muted-foreground min-w-[52px]",children:e.required?k("acceptanceCriteria.required"):k("acceptanceCriteria.optional")}),(0,d.jsx)(h.$,{variant:"outline",size:"sm",className:"h-7 w-7 p-0 border-[#E5E2DC] dark:border-[#2a2a2e] text-muted-foreground hover:text-[#D32F2F] hover:border-[#D32F2F] hover:bg-[#FFEBEE] dark:hover:bg-[#331619]",onClick:()=>{b(a.filter((a,b)=>b!==g))},disabled:c,type:"button",children:(0,d.jsx)(f.A,{className:"h-3 w-3"})})]})]},g))}),(0,d.jsxs)(h.$,{variant:"outline",size:"sm",className:"h-8 gap-1.5 border-[#E5E2DC] dark:border-[#2a2a2e] text-xs text-muted-foreground hover:text-primary hover:border-primary",onClick:()=>{b([...a,{description:"",required:!0}])},disabled:c,type:"button",children:[(0,d.jsx)(g.A,{className:"h-3 w-3"}),k("acceptanceCriteria.addCriterion")]})]})}function l(a){return{description:a.description.trim(),required:!!a.required}}function m(a,b){if(a.length!==b.length)return!0;for(let c=0;c<a.length;c++){let d=l(a[c]),e=l(b[c]);if(d.description!==e.description||d.required!==e.required)return!0}return!1}},74798:(a,b,c)=>{c.d(b,{W:()=>e});var d=c(21968);function e(){let[a,b]=(0,d.useState)(!1);return a}},77219:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{XH:()=>h});var e=c(55511),f=c(71255);c(97307);var g=a([f]);f=(g.then?(await g)():g)[0];let i="cho_";function h(){var a;let b=(0,e.randomBytes)(32).toString("base64url"),c=`${i}${b}`,d=(a=c,(0,e.createHash)("sha256").update(a).digest("hex")),f=`${i}${b.slice(0,4)}...${b.slice(-4)}`;return{key:c,hash:d,prefix:f}}d()}catch(a){d(a)}})},78511:(a,b,c)=>{c.d(b,{j:()=>e});var d=c(42377);let e=(0,d.createServerReference)("60c990921fffa4018101619839c15ebcac92625cd2",d.callServer,void 0,d.findSourceMapURL,"listReferencesAction")},88536:(a,b,c)=>{c.d(b,{d:()=>g});var d=c(10837);c(21968);var e=c(15644),f=c(96307);function g({className:a,...b}){return(0,d.jsx)(e.Root,{"data-slot":"switch",className:(0,f.cn)("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:ring-ring/50 inline-flex h-5 w-9 shrink-0 items-center rounded-full border-2 border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",a),...b,children:(0,d.jsx)(e.Thumb,{"data-slot":"switch-thumb",className:(0,f.cn)("bg-background pointer-events-none block size-4 rounded-full ring-0 shadow-lg transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})})}},94214:(a,b,c)=>{c.d(b,{AI:()=>h,_8:()=>g});var d=c(10837);c(21968);var e=c(11568),f=c(96307);function g({open:a,onOpenChange:b,header:c,footer:g,children:h,className:i,bodyClassName:j,zIndexClassName:k="z-[110]",showCloseButton:l=!0}){return(0,d.jsx)(e.lG,{open:a,onOpenChange:b,children:(0,d.jsxs)(e.Cf,{className:(0,f.cn)("flex max-h-[85svh] flex-col gap-0 overflow-hidden p-0",k,i),overlayClassName:k,showCloseButton:l,children:[(0,d.jsx)(e.c7,{className:"shrink-0 border-b border-border px-6 py-5 text-left",children:c}),(0,d.jsx)("div",{className:(0,f.cn)("min-h-0 flex-1 overflow-y-auto px-6 py-4",j),children:h}),(0,d.jsx)(e.Es,{className:"shrink-0 border-t border-border px-6 py-5",children:g})]})})}let h=e.L3},95627:(a,b,c)=>{c.d(b,{ReferencesSection:()=>C});var d=c(10837),e=c(21968),f=c(68884),g=c(9222),h=c(59876),i=c(35312),j=c(87461),k=c(86460),l=c(79543),m=c(92900),n=c(49599),o=c(42424),p=c(9994),q=c(2852),r=c(20170),s=c(11568),t=c(55732),u=c(6019),v=c(78511),w=c(42377);let x=(0,w.createServerReference)("40fd7fab1496150ee8374db007064b867b747c5c3d",w.callServer,void 0,w.findSourceMapURL,"updateReferenceAction"),y=(0,w.createServerReference)("406411d8d244f6200dfbab33bacf49984741a1a351",w.callServer,void 0,w.findSourceMapURL,"createReferenceAction"),z=(0,w.createServerReference)("4088f1db3ff9868aadade6597a2951d87a4ce89538",w.callServer,void 0,w.findSourceMapURL,"deleteReferenceAction");var A=c(46398),B=c(61206);function C({targetType:a,targetUuid:b,canWrite:c,initialReferences:w,compact:C=!1}){let D=(0,g.c)(),E=(0,f.r)(),[F,G]=(0,e.useState)(w??[]),[H,I]=(0,e.useState)(void 0!==w),[J,K]=(0,e.useState)(!1),[L,M]=(0,e.useState)(null),[N,O]=(0,e.useState)("docs"),[P,Q]=(0,e.useState)(""),[R,S]=(0,e.useState)(""),[T,U]=(0,e.useState)(""),[V,W]=(0,e.useState)(null),[X,Y]=(0,e.useState)(!1),[Z,$]=(0,e.useState)(null),_=(0,e.useCallback)(async()=>{let c=await (0,v.j)(a,b);c.success&&G(c.references),I(!0)},[a,b]),aa=async()=>{if(!P.trim())return void W(D("references.urlRequired"));if(!R.trim())return void W(D("references.titleRequired"));Y(!0),W(null);let c=T.trim()?T.trim():null,d=L?await x({uuid:L.uuid,type:N,url:P.trim(),title:R.trim(),notes:c}):await y({targetType:a,targetUuid:b,type:N,url:P.trim(),title:R.trim(),notes:c});Y(!1),d.success?(K(!1),await _(),E.refresh()):W(d.error||(L?D("references.updateFailed"):D("references.addFailed")))},ab=async a=>{$(a);let b=await z(a);$(null),b.success&&(await _(),E.refresh())};return(0,d.jsxs)("div",{className:C?"space-y-2":"space-y-2.5",children:[0===F.length?(0,d.jsx)("p",{className:"text-sm italic text-muted-foreground",children:H?D("references.empty"):D("references.loading")}):(0,d.jsx)("div",{className:"space-y-2",children:F.map(a=>{let b=(0,A.N2)(a.type)?A.qQ[a.type]:null,e=b?.icon??h.A;return(0,d.jsx)("div",{className:"group rounded-lg border border-border bg-background p-3",children:(0,d.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("div",{className:"mb-1 flex items-center gap-2",children:(0,d.jsxs)(n.E,{className:`gap-1 border-0 text-[10px] font-medium ${b?.badgeClass??"bg-secondary text-muted-foreground"}`,children:[(0,d.jsx)(e,{className:"h-3 w-3"}),b?D(b.labelKey):a.type]})}),(0,d.jsxs)("a",{href:a.url,target:"_blank",rel:"noopener noreferrer",title:a.title,className:"flex min-w-0 items-center gap-1 text-sm font-medium text-primary hover:underline",children:[(0,d.jsx)("span",{className:"truncate",children:a.title}),(0,d.jsx)(i.A,{className:"h-3 w-3 shrink-0"})]}),(0,d.jsx)(B.L,{notes:a.notes})]}),c&&(0,d.jsxs)("div",{className:"flex shrink-0 items-center gap-0.5 transition-opacity md:opacity-0 md:group-hover:opacity-100 md:focus-within:opacity-100",children:[(0,d.jsx)(o.$,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>{M(a),O(a.type),Q(a.url),S(a.title),U(a.notes??""),W(null),K(!0)},"aria-label":D("references.editReference"),children:(0,d.jsx)(j.A,{className:"h-3.5 w-3.5 text-muted-foreground"})}),(0,d.jsxs)(u.Lt,{children:[(0,d.jsx)(u.tv,{asChild:!0,children:(0,d.jsx)(o.$,{variant:"ghost",size:"icon",className:"h-7 w-7","aria-label":D("references.deleteReference"),children:Z===a.uuid?(0,d.jsx)(k.A,{className:"h-3.5 w-3.5 animate-spin text-muted-foreground"}):(0,d.jsx)(l.A,{className:"h-3.5 w-3.5 text-destructive"})})}),(0,d.jsxs)(u.EO,{children:[(0,d.jsxs)(u.wd,{children:[(0,d.jsx)(u.r7,{children:D("references.deleteReference")}),(0,d.jsx)(u.$v,{children:D("references.deleteConfirm",{title:a.title})})]}),(0,d.jsxs)(u.ck,{children:[(0,d.jsx)(u.Zr,{children:D("common.cancel")}),(0,d.jsx)(u.Rx,{variant:"destructive",onClick:()=>ab(a.uuid),children:D("common.delete")})]})]})]})]})]})},a.uuid)})}),c&&(0,d.jsxs)(o.$,{variant:"outline",size:"sm",className:"h-8 w-full gap-1.5 border-border border-dashed text-xs text-muted-foreground",onClick:()=>{M(null),O("docs"),Q(""),S(""),U(""),W(null),K(!0)},children:[(0,d.jsx)(m.A,{className:"h-3.5 w-3.5"}),D("references.addReference")]}),(0,d.jsx)(s.lG,{open:J,onOpenChange:K,children:(0,d.jsxs)(s.Cf,{className:"sm:max-w-[480px]",children:[(0,d.jsx)(s.c7,{children:(0,d.jsx)(s.L3,{children:L?D("references.editReference"):D("references.addReference")})}),(0,d.jsxs)("div",{className:"space-y-4 py-2",children:[V&&(0,d.jsx)("div",{className:"rounded-lg bg-destructive/10 p-3 text-sm text-destructive",children:V}),(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)(q.J,{htmlFor:"ref-type",className:"text-[13px] font-medium text-foreground",children:D("references.typeLabel")}),(0,d.jsxs)(t.l6,{value:N,onValueChange:O,children:[(0,d.jsx)(t.bq,{id:"ref-type",className:"border-border focus:ring-primary",children:(0,d.jsx)(t.yv,{})}),(0,d.jsx)(t.gC,{children:A.mP.map(a=>(0,d.jsx)(t.eb,{value:a,children:D(A.qQ[a].labelKey)},a))})]})]}),(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsxs)(q.J,{htmlFor:"ref-url",className:"text-[13px] font-medium text-foreground",children:[D("references.urlLabel")," *"]}),(0,d.jsx)(p.p,{id:"ref-url",value:P,onChange:a=>Q(a.target.value),placeholder:D("references.urlPlaceholder"),className:"border-border focus-visible:ring-primary",autoFocus:!0})]}),(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsxs)(q.J,{htmlFor:"ref-title",className:"text-[13px] font-medium text-foreground",children:[D("references.titleLabel")," *"]}),(0,d.jsx)(p.p,{id:"ref-title",value:R,onChange:a=>S(a.target.value),placeholder:D("references.titlePlaceholder"),className:"border-border focus-visible:ring-primary"})]}),(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)(q.J,{htmlFor:"ref-notes",className:"text-[13px] font-medium text-foreground",children:D("references.notesLabel")}),(0,d.jsx)(r.T,{id:"ref-notes",value:T,onChange:a=>U(a.target.value),placeholder:D("references.notesPlaceholder"),rows:3,className:"resize-none border-border focus-visible:ring-primary"})]})]}),(0,d.jsxs)(s.Es,{children:[(0,d.jsx)(o.$,{variant:"outline",onClick:()=>K(!1),disabled:X,className:"border-border",children:D("common.cancel")}),(0,d.jsx)(o.$,{onClick:aa,disabled:X||!P.trim()||!R.trim(),className:"bg-primary hover:bg-primary/90 text-primary-foreground",children:X?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(k.A,{className:"mr-2 h-4 w-4 animate-spin"}),D("common.saving")]}):L?D("common.save"):D("references.add")})]})]})})]})}},99127:(a,b,c)=>{c.d(b,{Bc:()=>g,ZI:()=>j,k$:()=>i,m_:()=>h});var d=c(10837);c(21968);var e=c(80501),f=c(96307);function g({delayDuration:a=0,...b}){return(0,d.jsx)(e.Provider,{"data-slot":"tooltip-provider",delayDuration:a,...b})}function h({...a}){return(0,d.jsx)(e.Root,{"data-slot":"tooltip",...a})}function i({...a}){return(0,d.jsx)(e.Trigger,{"data-slot":"tooltip-trigger",...a})}function j({className:a,sideOffset:b=0,children:c,...g}){return(0,d.jsx)(e.Portal,{children:(0,d.jsxs)(e.Content,{"data-slot":"tooltip-content",sideOffset:b,className:(0,f.cn)("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",a),...g,children:[c,(0,d.jsx)(e.Arrow,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}}};
@@ -1 +0,0 @@
1
- exports.id=4545,exports.ids=[4545],exports.modules={12807:(a,b,c)=>{Promise.resolve().then(c.bind(c,87352))},18167:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(56556).A)("building-2",[["path",{d:"M10 12h4",key:"a56b0p"}],["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M14 21v-3a2 2 0 0 0-4 0v3",key:"1rgiei"}],["path",{d:"M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2",key:"secmi2"}],["path",{d:"M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16",key:"16ra0t"}]])},31482:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>r});var d=c(10837),e=c(21968),f=c(1007),g=c(68884),h=c(81512),i=c.n(h),j=c(9222),k=c(42424),l=c(70668),m=c(76723),n=c(18167),o=c(71197),p=c(71833),q=c(54722);function r({children:a}){let b=(0,j.c)(),c=(0,g.r)(),h=(0,f.usePathname)(),[r,s]=(0,e.useState)(null),[t,u]=(0,e.useState)(!0),v=async()=>{try{await fetch("/api/admin/session",{method:"DELETE"}),c.push("/login")}catch{q.q.error("Logout failed")}};if(t)return(0,d.jsx)("div",{className:"flex min-h-screen items-center justify-center bg-background",children:(0,d.jsx)("div",{className:"text-muted-foreground",children:b("common.loading")})});if(!r)return null;let w=[{href:"/admin",label:b("admin.dashboard"),icon:m.A},{href:"/admin/companies",label:b("admin.companies"),icon:n.A}];return(0,d.jsxs)("div",{className:"flex min-h-screen bg-background",children:[(0,d.jsxs)("aside",{className:"flex w-56 flex-col border-r bg-card",children:[(0,d.jsxs)("div",{className:"flex h-16 items-center gap-2 border-b px-4",children:[(0,d.jsx)("div",{className:"flex h-8 w-8 items-center justify-center rounded bg-destructive",children:(0,d.jsx)(o.A,{className:"h-4 w-4 text-destructive-foreground"})}),(0,d.jsx)("span",{className:"font-semibold",children:b("admin.title")})]}),(0,d.jsx)("nav",{className:"flex-1 space-y-1 p-4",children:w.map(a=>{let b=h===a.href||"/admin"!==a.href&&h.startsWith(a.href),c=a.icon;return(0,d.jsx)(i(),{href:a.href,children:(0,d.jsxs)(k.$,{variant:b?"secondary":"ghost",className:"w-full justify-start",children:[(0,d.jsx)(c,{className:"mr-3 h-5 w-5"}),a.label]})},a.href)})}),(0,d.jsxs)("div",{className:"border-t p-4",children:[(0,d.jsx)("div",{className:"mb-2 truncate text-sm text-muted-foreground",children:r.email}),(0,d.jsx)("div",{className:"mb-1 -ml-2",children:(0,d.jsx)(l.H,{})}),(0,d.jsxs)(k.$,{variant:"ghost",className:"w-full justify-start",onClick:v,children:[(0,d.jsx)(p.A,{className:"mr-2 h-4 w-4"}),b("common.signOut")]})]})]}),(0,d.jsx)("main",{className:"flex-1 overflow-auto",children:a})]})}},33863:(a,b,c)=>{"use strict";c.d(b,{Hr:()=>o,Ht:()=>l,SQ:()=>j,_2:()=>k,lp:()=>m,mB:()=>n,rI:()=>h,ty:()=>i});var d=c(10837);c(21968);var e=c(90856),f=c(5989),g=c(96307);function h({...a}){return(0,d.jsx)(f.Root,{"data-slot":"dropdown-menu",...a})}function i({...a}){return(0,d.jsx)(f.Trigger,{"data-slot":"dropdown-menu-trigger",...a})}function j({className:a,sideOffset:b=4,...c}){return(0,d.jsx)(f.Portal,{children:(0,d.jsx)(f.Content,{"data-slot":"dropdown-menu-content",sideOffset:b,className:(0,g.cn)("bg-popover text-popover-foreground z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a),...c})})}function k({className:a,inset:b,variant:c="default",...e}){return(0,d.jsx)(f.Item,{"data-slot":"dropdown-menu-item","data-inset":b,"data-variant":c,className:(0,g.cn)("focus:bg-accent focus:text-accent-foreground relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0","data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive","data-[inset]:pl-8 [&_svg]:size-4",a),...e})}function l({className:a,children:b,...c}){return(0,d.jsxs)(f.RadioItem,{"data-slot":"dropdown-menu-radio-item",className:(0,g.cn)("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-4",a),...c,children:[(0,d.jsx)("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:(0,d.jsx)(f.ItemIndicator,{children:(0,d.jsx)(e.A,{className:"size-2 fill-current"})})}),b]})}function m({className:a,inset:b,...c}){return(0,d.jsx)(f.Label,{"data-slot":"dropdown-menu-label","data-inset":b,className:(0,g.cn)("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",a),...c})}function n({className:a,...b}){return(0,d.jsx)(f.Separator,{"data-slot":"dropdown-menu-separator",className:(0,g.cn)("bg-border -mx-1 my-1 h-px",a),...b})}function o({...a}){return(0,d.jsx)(f.RadioGroup,{"data-slot":"dropdown-menu-radio-group",...a})}},52127:(a,b,c)=>{Promise.resolve().then(c.bind(c,31482))},70668:(a,b,c)=>{"use strict";c.d(b,{H:()=>p});var d=c(10837),e=c(21968),f=c(25065),g=c(9222),h=c(48152),i=c(49301),j=c(27936),k=c(59923),l=c(42424),m=c(33863),n=c(58857),o=c(97553);function p({mobile:a=!1}){let b=(0,g.c)(),{theme:c,setTheme:p}=(0,f.D)(),{locale:q,setLocale:r}=(0,n.Y)(),[s,t]=(0,e.useState)(!1),u=s?c:void 0,v="light"===u?h.A:"dark"===u?i.A:j.A,w=b("light"===u?"theme.light":"dark"===u?"theme.dark":"theme.system"),x=a?"h-8 min-w-8 px-2":"h-7 min-w-7 px-1.5",y=a?"h-4 w-4":"h-3.5 w-3.5";return(0,d.jsxs)("div",{className:"flex items-center gap-1 px-2 pt-0.5",children:[(0,d.jsxs)(m.rI,{children:[(0,d.jsx)(m.ty,{asChild:!0,children:(0,d.jsxs)(l.$,{variant:"ghost",size:"sm",className:`${x} justify-center gap-1.5 text-muted-foreground hover:text-foreground`,"aria-label":b("theme.toggleLabel"),title:b("theme.toggleLabel"),children:[(0,d.jsx)(v,{className:y}),(0,d.jsx)("span",{className:"text-[12px] font-medium",suppressHydrationWarning:!0,children:s?w:b("theme.system")})]})}),(0,d.jsxs)(m.SQ,{align:"start",side:"top",className:"w-40",children:[(0,d.jsx)(m.lp,{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:b("theme.toggleLabel")}),(0,d.jsxs)(m.Hr,{value:u??"system",onValueChange:a=>p(a),children:[(0,d.jsxs)(m.Ht,{value:"light",children:[(0,d.jsx)(h.A,{className:"mr-2 h-4 w-4"}),b("theme.light")]}),(0,d.jsxs)(m.Ht,{value:"dark",children:[(0,d.jsx)(i.A,{className:"mr-2 h-4 w-4"}),b("theme.dark")]}),(0,d.jsxs)(m.Ht,{value:"system",children:[(0,d.jsx)(j.A,{className:"mr-2 h-4 w-4"}),b("theme.system")]})]})]})]}),(0,d.jsx)("span",{className:"h-4 w-px bg-border","aria-hidden":!0}),(0,d.jsxs)(m.rI,{children:[(0,d.jsx)(m.ty,{asChild:!0,children:(0,d.jsxs)(l.$,{variant:"ghost",size:"sm",className:`${x} justify-center gap-1.5 text-muted-foreground hover:text-foreground`,"aria-label":b("settings.language"),title:b("settings.language"),children:[(0,d.jsx)(k.A,{className:y}),(0,d.jsx)("span",{className:"text-[12px] font-medium leading-none",children:o.L$[q]})]})}),(0,d.jsxs)(m.SQ,{align:"start",side:"top",className:"w-40",children:[(0,d.jsx)(m.lp,{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:b("settings.language")}),(0,d.jsx)(m.Hr,{value:q,onValueChange:a=>r(a),children:o.IB.map(a=>(0,d.jsx)(m.Ht,{value:a,children:o.L$[a]},a))})]})]})]})}},71197:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(56556).A)("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]])},87352:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>d});let d=(0,c(37143).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/ubuntu/dev/ai-pm/src/app/admin/layout.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/ubuntu/dev/ai-pm/src/app/admin/layout.tsx","default")}};