@microvac/ui 0.0.0-stage → 0.1.0-rc.14

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 (609) hide show
  1. package/README.md +29 -2
  2. package/dist/android-chrome-192x192.png +0 -0
  3. package/dist/android-chrome-512x512.png +0 -0
  4. package/dist/announcement-preview.svg +11 -0
  5. package/dist/apple-touch-icon.png +0 -0
  6. package/dist/assets/ActiveAgentsPanel-C9AP9hJu.js +1 -0
  7. package/dist/assets/AdapterManager-CmxTUKJH.js +1 -0
  8. package/dist/assets/AdvancedToolsRoute-CXsQnTei.js +39 -0
  9. package/dist/assets/AgentActionButtons-DWq2OuVK.js +1 -0
  10. package/dist/assets/AgentAdvancedTab-dhBDxF-H.js +131 -0
  11. package/dist/assets/AgentBulkSettingsSheet-DYT4ovDg.js +1 -0
  12. package/dist/assets/AgentChat-r0TPOfPK.js +1 -0
  13. package/dist/assets/AgentDetailPage-Bc_okBuS.js +39 -0
  14. package/dist/assets/AgentIdentityChip-CB2NBXkZ.js +1 -0
  15. package/dist/assets/AgentRosterFilters-b7qMLv8-.js +2 -0
  16. package/dist/assets/Agents-BsvXy3pZ.js +2 -0
  17. package/dist/assets/Agents.production-BeOZmzaF.js +2 -0
  18. package/dist/assets/AnimatedDialogContent-CWshmxP2.js +1 -0
  19. package/dist/assets/AppDetail-DbqENTF_.js +1 -0
  20. package/dist/assets/AppNotConnected-BhnCqL0F.js +1 -0
  21. package/dist/assets/ApprovalDetail-B2KiYLTj.js +1 -0
  22. package/dist/assets/Approvals-j-wRmqKj.js +1 -0
  23. package/dist/assets/AppsConnect-CcPVEZ0C.js +1 -0
  24. package/dist/assets/AppsReview-B8eWvKkS.js +1 -0
  25. package/dist/assets/ArtifactEmptyGraphic-5mdkS5jj.js +1 -0
  26. package/dist/assets/Artifacts-Bz7Oo6VX.js +1 -0
  27. package/dist/assets/AssigneePickerInner-DdpF7hck.js +1 -0
  28. package/dist/assets/AssistantConnection-BpaaJDc_.js +1 -0
  29. package/dist/assets/AttentionInlineVerbs-DlPQVCO-.js +1 -0
  30. package/dist/assets/AttentionQueueRow-BC6ezctS.js +1 -0
  31. package/dist/assets/AuditHub-BVP7LKL9.js +1 -0
  32. package/dist/assets/AuditRuns-DqizHgX1.js +1 -0
  33. package/dist/assets/Auth-DOF0snjp.js +3 -0
  34. package/dist/assets/BoardChat-BYAbDtfd.js +18 -0
  35. package/dist/assets/BoardClaim-7y41Pr8e.js +1 -0
  36. package/dist/assets/BootstrapSetupUxLab-BftH1vOv.js +1 -0
  37. package/dist/assets/Browse-Ck01W1Yl.js +1 -0
  38. package/dist/assets/BudgetPolicyCard-CKhrzfgy.js +1 -0
  39. package/dist/assets/CaseDetail-qlXKJ66D.js +1 -0
  40. package/dist/assets/CaseStatus-B3RiZVDH.js +1 -0
  41. package/dist/assets/Cases-CFV3V-5X.js +1 -0
  42. package/dist/assets/ChatEndpointDetail-7Hi5TJNt.js +5 -0
  43. package/dist/assets/ChatEndpointSetup-CtwgH6sg.js +1 -0
  44. package/dist/assets/ChatIdentityConfirm-CXjksBwX.js +1 -0
  45. package/dist/assets/CliAuth-KVjrGMfZ.js +1 -0
  46. package/dist/assets/Companies-oeJem3De.js +1 -0
  47. package/dist/assets/CompanyAccess-vWT6G-n_.js +1 -0
  48. package/dist/assets/CompanyActivity-zOzzeN1B.js +1 -0
  49. package/dist/assets/CompanyActivity.production-DbaFBsM0.js +1 -0
  50. package/dist/assets/CompanyConnections-llSEaVa2.js +1 -0
  51. package/dist/assets/CompanyEnvironments-BrP-ENHg.css +1 -0
  52. package/dist/assets/CompanyEnvironments-DNyyGC_S.js +35 -0
  53. package/dist/assets/CompanyExport-CFa-F8Es.js +4 -0
  54. package/dist/assets/CompanyImport-DG6qwQ8F.js +1 -0
  55. package/dist/assets/CompanySettings-Dv5Z3ZQi.js +1 -0
  56. package/dist/assets/CompanySettingsPluginPage-CZk1d_0d.js +1 -0
  57. package/dist/assets/CompanySkills-CdzWhJfQ.js +10 -0
  58. package/dist/assets/CompanySkills.production-IoCRW5FQ.js +10 -0
  59. package/dist/assets/ConfigureBuiltInAgentModal-BwW7XQ1O.js +1 -0
  60. package/dist/assets/CopyableGatewayUrl-PTn061ft.js +1 -0
  61. package/dist/assets/CordisPluginSettings-C_BeeGEc.js +1 -0
  62. package/dist/assets/Costs-DhuNxwSj.js +1 -0
  63. package/dist/assets/CrossIssueCollaborationUxLab-ZaAXq46r.js +1 -0
  64. package/dist/assets/Dashboard-BaDnqiKo.js +2 -0
  65. package/dist/assets/DashboardLive-D-Ed7osd.js +1 -0
  66. package/dist/assets/DecisionDateChips-D3pl_mLn.js +1 -0
  67. package/dist/assets/DecisionHistoryPanel-D5MzyrOh.js +1 -0
  68. package/dist/assets/DecisionQueuePage-D3UZ9oRk.js +1 -0
  69. package/dist/assets/DesignGuide-COTo7ICj.js +25 -0
  70. package/dist/assets/DesignSandboxTaskThread-CMeCSQid.js +28 -0
  71. package/dist/assets/EmailConnectionAccess-kCL7obSr.js +1 -0
  72. package/dist/assets/EmailEndpointSetup-BGrksR_u.js +1 -0
  73. package/dist/assets/EnforcementBanner-_Eb_nK3M.js +1 -0
  74. package/dist/assets/EntityRow-gpsOgEtu.js +1 -0
  75. package/dist/assets/ExecutionWorkspaceDetail-DwGkH6d3.js +19 -0
  76. package/dist/assets/ExternalAgentInviteDialog-CGid6pM9.js +50 -0
  77. package/dist/assets/FilterBar-1D-VhrvG.js +1 -0
  78. package/dist/assets/FolderControls-CQ6kef3c.js +1 -0
  79. package/dist/assets/GatewayDetail-CCqekM1J.js +2 -0
  80. package/dist/assets/GatewaysList-nFsRcszh.js +1 -0
  81. package/dist/assets/GitHubConnectionRecovery-B9sFWJup.js +1 -0
  82. package/dist/assets/GoalDetail-BQ8y55P-.js +1 -0
  83. package/dist/assets/GoalTree-laRjXp0P.js +1 -0
  84. package/dist/assets/Goals-Cm14EaeP.js +1 -0
  85. package/dist/assets/InstanceAccess-DxQ-Akt_.js +1 -0
  86. package/dist/assets/InstanceExperimentalSettings-BxwqbXNw.js +1 -0
  87. package/dist/assets/InviteLanding-Cf0L_u6s.js +1 -0
  88. package/dist/assets/IssueChatLongThreadPerf-BfsF6FdF.js +2 -0
  89. package/dist/assets/JoinRequestQueue-BXCdTFG_.js +1 -0
  90. package/dist/assets/Layout.production-CqzU0qMi.js +1 -0
  91. package/dist/assets/McpConnect-COWnZ9Eb.js +1 -0
  92. package/dist/assets/MembershipAction-C9i9Sdmi.js +1 -0
  93. package/dist/assets/MetricCard-Bwnt3_p3.js +1 -0
  94. package/dist/assets/MissingPluginTabPlaceholder-B0Zxv1Kx.js +1 -0
  95. package/dist/assets/NewAgent-BIlJ5Dyt.js +1 -0
  96. package/dist/assets/NewAgentDialog-CJdMxxYL.js +1 -0
  97. package/dist/assets/NewGoalDialog-B8izfKLm.js +1 -0
  98. package/dist/assets/NewProjectDialog-DXqjTYFK.js +1 -0
  99. package/dist/assets/OnboardingPrimitives-DHYBqn_0.js +1 -0
  100. package/dist/assets/OnboardingWizard-DqSfZ13V.js +2 -0
  101. package/dist/assets/OrgChart.production-DrSFUf7i.js +1 -0
  102. package/dist/assets/PaperclipCloudOAuthHandoff-jPUvjJ8q.js +1 -0
  103. package/dist/assets/PluginManager-h3LFPaUq.js +1 -0
  104. package/dist/assets/PluginPage-E5Im4454.js +1 -0
  105. package/dist/assets/PluginSettings-BBO0jAgo.js +1 -0
  106. package/dist/assets/ProfileDetailRoute-CQBD7fms.js +1 -0
  107. package/dist/assets/ProfileSettings-BwnVEHLp.js +1 -0
  108. package/dist/assets/ProfileWizardRoute-By_SC6Gn.js +1 -0
  109. package/dist/assets/ProjectDetail-CbiwFBAE.js +1 -0
  110. package/dist/assets/ProjectRepositoryInput-DZF9bX4E.js +1 -0
  111. package/dist/assets/ProjectWorkspaceDetail-DPsl_4bD.js +29 -0
  112. package/dist/assets/ProjectWorkspacesContent-COH4dOWK.js +1 -0
  113. package/dist/assets/Projects-Ch9Qu7sn.js +1 -0
  114. package/dist/assets/QuotaBar-DIFOT9Uh.js +1 -0
  115. package/dist/assets/RepositoryEditor-DHB1bqId.js +1 -0
  116. package/dist/assets/Responsibilities-C5O0JXXG.js +4 -0
  117. package/dist/assets/ResponsibilityDetail-D6NpZpkm.js +1 -0
  118. package/dist/assets/ResponsibleUserDenialUxLab-CFrIWYwe.js +1 -0
  119. package/dist/assets/ReviewQueueCard-BPC4Lm67.js +1 -0
  120. package/dist/assets/RoutineAuditActivity-sKyzMajz.js +1 -0
  121. package/dist/assets/RoutineDetail-CG8HF5fp.js +2 -0
  122. package/dist/assets/RoutineRunVariablesDialog-CKh3CmLD.js +1 -0
  123. package/dist/assets/Routines-tF2qfUKo.js +1 -0
  124. package/dist/assets/Routines.production-BTyj1Ljr.js +1 -0
  125. package/dist/assets/RoutinesToolbar-CvUFVCGN.js +1 -0
  126. package/dist/assets/Search-Z9D0NuS1.js +1 -0
  127. package/dist/assets/Secrets-DgmbLOJK.js +4 -0
  128. package/dist/assets/SkillBinaryFile-F3_9qcaM.js +1 -0
  129. package/dist/assets/SkillCardIcon-CXHUCMej.js +2 -0
  130. package/dist/assets/SkillFolderTree-CB3lrTIE.js +1 -0
  131. package/dist/assets/SkillSourceTree-BbuciCo6.js +2 -0
  132. package/dist/assets/SkillSources-Dlo6Cew3.js +2 -0
  133. package/dist/assets/SkillStudio-ZO-Nf7eI.js +9 -0
  134. package/dist/assets/SkillsNavigationTabs-B9Iqnlqt.js +1 -0
  135. package/dist/assets/SpekoPhoneCallback-C4VnMiZh.js +1 -0
  136. package/dist/assets/SpekoProviderSetup-I4evPZb3.js +1 -0
  137. package/dist/assets/StatusCards-D0MVzbsw.js +1 -0
  138. package/dist/assets/SummarySlotCard-DUXgZPxG.js +1 -0
  139. package/dist/assets/TailscaleConnector-CMhT73gj.js +1 -0
  140. package/dist/assets/TaskChatLab-D9-KAE-7.js +11 -0
  141. package/dist/assets/TaskSummaryList-CUxieFNe.js +1 -0
  142. package/dist/assets/Timeline-BNMoRbtK.js +1 -0
  143. package/dist/assets/ToolsAdminGate-CEr0zy2T.js +1 -0
  144. package/dist/assets/TrustPresetSection-B9YXZtkh.js +1 -0
  145. package/dist/assets/UserProfile-D-tnW96X.js +1 -0
  146. package/dist/assets/WebhookUrlWarning-Ba_DixKh.js +1 -0
  147. package/dist/assets/WhatNeedsMe-B-Jzj8_M.js +1 -0
  148. package/dist/assets/Workspaces-BqhDI_Bl.js +1 -0
  149. package/dist/assets/abnfDiagram-YUKMZFIV-Bn9P-nUW.js +1 -0
  150. package/dist/assets/apl-MHzTCvfx.js +1 -0
  151. package/dist/assets/arc-Dnq9Aszq.js +1 -0
  152. package/dist/assets/architecture-WOLXFQ4H-V1ldsZlt.js +1 -0
  153. package/dist/assets/architectureDiagram-47P4ROYG-BkYxt-Gc.js +36 -0
  154. package/dist/assets/array-CL5Tisss.js +1 -0
  155. package/dist/assets/arrow-down-left-o81ENfeW.js +1 -0
  156. package/dist/assets/asciiarmor-DFLNSgns.js +1 -0
  157. package/dist/assets/asn1-CfPVWRYE.js +1 -0
  158. package/dist/assets/asterisk-CJ4OeA7Y.js +1 -0
  159. package/dist/assets/blockDiagram-E7TT5TSB-BO7pPYbp.js +140 -0
  160. package/dist/assets/brainfuck-NEHkmXMc.js +1 -0
  161. package/dist/assets/budgets-0Dw6TH1A.js +1 -0
  162. package/dist/assets/building-complex-DciZTnys.js +1 -0
  163. package/dist/assets/c4Diagram-CRA5TL53-D4EpmmzV.js +38 -0
  164. package/dist/assets/channel-BQh2vFIU.js +1 -0
  165. package/dist/assets/character-CguPM7IG.js +1 -0
  166. package/dist/assets/chat-channels-DWyry-9M.js +1 -0
  167. package/dist/assets/chunk-2BW5OAIV-DFXIyCJy.js +10 -0
  168. package/dist/assets/chunk-2Q5K7J3B-CkPHWFj-.js +1 -0
  169. package/dist/assets/chunk-3YJQHVM4-Dj5wEKIw.js +2 -0
  170. package/dist/assets/chunk-4EA7E6EY-5XiUVgzK.js +1 -0
  171. package/dist/assets/chunk-5VM5RSS4-2H3r6wq0.js +15 -0
  172. package/dist/assets/chunk-7TKQ45FW-D0opKcsy.js +1 -0
  173. package/dist/assets/chunk-AW2ZBBNX-DnjsTe04.js +88 -0
  174. package/dist/assets/chunk-DBDB3WZW-DNqSQPZ0.js +1 -0
  175. package/dist/assets/chunk-DUW6YSOI-slPglwIh.js +1 -0
  176. package/dist/assets/chunk-E2ZNV5FY-cjSf_BTz.js +70 -0
  177. package/dist/assets/chunk-EU5HNXII-CZYBiaSw.js +213 -0
  178. package/dist/assets/chunk-FVRAUYC3-DSc0-wJA.js +2 -0
  179. package/dist/assets/chunk-HJ2JQQFS-MXK0gYSP.js +1 -0
  180. package/dist/assets/chunk-HTAEGDNF-BjDZm_5k.js +1 -0
  181. package/dist/assets/chunk-J5ZVWO5B-ClU583ja.js +1 -0
  182. package/dist/assets/chunk-JWPE2WC7--HEGjv3t.js +1 -0
  183. package/dist/assets/chunk-KQW6MTUR-Bfj0tDmO.js +1 -0
  184. package/dist/assets/chunk-NGNAAXSQ-e5XI1hSt.js +128 -0
  185. package/dist/assets/chunk-NTY3LDVX-Bpz5TkVb.js +1 -0
  186. package/dist/assets/chunk-VPRB5NB3-CfeHjtbb.js +129 -0
  187. package/dist/assets/chunk-XC4XBNZT-FBCWmi6K.js +62 -0
  188. package/dist/assets/chunk-XXDRQBXY-BdWplhUD.js +1 -0
  189. package/dist/assets/chunk-Y2CYZVJY-OvsAdhaO.js +1 -0
  190. package/dist/assets/circle-slash-DqKFFqfb.js +1 -0
  191. package/dist/assets/classDiagram-v2-K4WV4PDN-DbC_J0kK.js +217 -0
  192. package/dist/assets/clike-CIx9nZSv.js +1 -0
  193. package/dist/assets/clojure-DFaIEz5O.js +1 -0
  194. package/dist/assets/cmake-koz-qBlo.js +1 -0
  195. package/dist/assets/cobol-Bo8Zw9gB.js +1 -0
  196. package/dist/assets/coffeescript-CXYzYf-Y.js +1 -0
  197. package/dist/assets/coins-BztUbqyl.js +1 -0
  198. package/dist/assets/collections-BxrcELwt.js +3 -0
  199. package/dist/assets/commonlisp-C4OOCwkD.js +1 -0
  200. package/dist/assets/company-skill-routes-D5LJ1l8M.js +1 -0
  201. package/dist/assets/company-skill-summary-DnWVmP1S.js +1 -0
  202. package/dist/assets/configuration-warnings-CZKSfHJv.js +2 -0
  203. package/dist/assets/connection-owner-D-ikSHyR.js +1 -0
  204. package/dist/assets/cose-bilkent-JH36ORCC-DFyVDb92.js +1 -0
  205. package/dist/assets/crystal-BlJXQDvy.js +1 -0
  206. package/dist/assets/css-DEZwfVpY.js +1 -0
  207. package/dist/assets/cynefin-EF2NZ3EQ-COwSJ4qP.js +1 -0
  208. package/dist/assets/cynefinDiagram-3GCD6N5R-diaEJq9Y.js +62 -0
  209. package/dist/assets/cypher-z2oFsVv2.js +1 -0
  210. package/dist/assets/cytoscape.esm-C2vp4vBx.js +321 -0
  211. package/dist/assets/d-Dkt6y7AQ.js +1 -0
  212. package/dist/assets/dagre-W4DXFKR2-BPAMRuIj.js +4 -0
  213. package/dist/assets/defaultLocale-C2Bpu8Ih.js +1 -0
  214. package/dist/assets/definition-DxwMBXnu.js +1 -0
  215. package/dist/assets/diagram-2UJZ2QOL-BvRnO1Id.js +200 -0
  216. package/dist/assets/diagram-OVF4WLC6-CDgBeD0m.js +24 -0
  217. package/dist/assets/diagram-PFPMY2P6-DAw9lREG.js +30 -0
  218. package/dist/assets/diagram-UMYRVEAY-ZQqQn22t.js +24 -0
  219. package/dist/assets/diagram-YEKJPTXX-CoJtGgWs.js +41 -0
  220. package/dist/assets/diagram-ZIFT7M5P-qW_Zn_bO.js +3 -0
  221. package/dist/assets/diff-C60bAYOU.js +1 -0
  222. package/dist/assets/dist-B2E6oBK1.js +1 -0
  223. package/dist/assets/dist-B6Qde8KJ.js +1 -0
  224. package/dist/assets/dist-BCJybC91.js +1 -0
  225. package/dist/assets/dist-CG-phytt.js +1 -0
  226. package/dist/assets/dist-CG6fC1Db.js +1 -0
  227. package/dist/assets/dist-CPgRB-NQ.js +1 -0
  228. package/dist/assets/dist-CTlCK4Pe.js +1 -0
  229. package/dist/assets/dist-CYRzGbSY.js +7 -0
  230. package/dist/assets/dist-Cd7wdKYE.js +39 -0
  231. package/dist/assets/dist-CdmdXwCZ.js +1 -0
  232. package/dist/assets/dist-CeSzCyeG.js +1 -0
  233. package/dist/assets/dist-CjRqeLFz.js +2 -0
  234. package/dist/assets/dist-CuwPDbnL.js +1 -0
  235. package/dist/assets/dist-CvRpZH53.js +1 -0
  236. package/dist/assets/dist-DKyBHaH2.js +1 -0
  237. package/dist/assets/dist-DML0cJH3.js +13 -0
  238. package/dist/assets/dist-DXjkgaZX.js +1 -0
  239. package/dist/assets/dist-DZIxMHOT.js +1 -0
  240. package/dist/assets/dist-DZruZxAk.js +1 -0
  241. package/dist/assets/dist-DbXGl-wj.js +3 -0
  242. package/dist/assets/dist-Dl94YqeS.js +1 -0
  243. package/dist/assets/dist-DylHAy-6.js +1 -0
  244. package/dist/assets/dist-IcdxEhjC.js +1 -0
  245. package/dist/assets/dist-_EtfntKJ.js +6 -0
  246. package/dist/assets/dist-ptDa9fKh.js +1 -0
  247. package/dist/assets/dockerfile-BttNdtK0.js +1 -0
  248. package/dist/assets/dtd-CCVZU5Da.js +1 -0
  249. package/dist/assets/dylan-3pmV5wzs.js +1 -0
  250. package/dist/assets/ebnf-bm-I2WIh.js +1 -0
  251. package/dist/assets/ebnfDiagram-VR2GEFS7-DA4UvKXV.js +1 -0
  252. package/dist/assets/ecl-BIv3PrZb.js +1 -0
  253. package/dist/assets/eiffel-DuLnr4-r.js +1 -0
  254. package/dist/assets/elk-IJKZMXRS-CM74d3mJ.js +25 -0
  255. package/dist/assets/elm-njbaCU-L.js +1 -0
  256. package/dist/assets/erDiagram-O2IAPWRE-d869V0qL.js +99 -0
  257. package/dist/assets/erlang-CuhOC2I8.js +1 -0
  258. package/dist/assets/eventmodeling-K75KTNOO-C-oz_eyI.js +1 -0
  259. package/dist/assets/factor-CM3-9V3b.js +1 -0
  260. package/dist/assets/fcl-nWsMJ92o.js +1 -0
  261. package/dist/assets/flowDiagram-OXPTDLAJ-Be1xLbJu.js +1 -0
  262. package/dist/assets/folder-plus-CxWXoYCi.js +1 -0
  263. package/dist/assets/forth-BQ9HrCVY.js +1 -0
  264. package/dist/assets/fortran-DHJe28ev.js +1 -0
  265. package/dist/assets/ganttDiagram-R7TSEDQI-BBul4Kpm.js +292 -0
  266. package/dist/assets/gas-ByO0qYMr.js +1 -0
  267. package/dist/assets/gherkin-CwOmHL5K.js +1 -0
  268. package/dist/assets/gitGraph-VSP46ZUC-BriEZgAq.js +1 -0
  269. package/dist/assets/gitGraphDiagram-XJZIOB7I-I12rg8s1.js +106 -0
  270. package/dist/assets/goals-CvMWzjH4.js +1 -0
  271. package/dist/assets/googleAccessRemoval-CQIi1dvu.js +1 -0
  272. package/dist/assets/graphlib-DHhK3saS.js +1 -0
  273. package/dist/assets/groovy-ByXGF8cx.js +1 -0
  274. package/dist/assets/haskell-CHSpCNOy.js +1 -0
  275. package/dist/assets/haxe-P2jh68ck.js +1 -0
  276. package/dist/assets/http-0jwMmfWP.js +1 -0
  277. package/dist/assets/idl-DTVVj6r5.js +1 -0
  278. package/dist/assets/index-Bt31d8ga.js +706 -0
  279. package/dist/assets/index-z7lcCz2I.css +1 -0
  280. package/dist/assets/info-OHQRW6UA-CxrcGiem.js +1 -0
  281. package/dist/assets/infoDiagram-5W2HQ5XZ-4Sm0LiOu.js +2 -0
  282. package/dist/assets/init-BXPE0p7i.js +1 -0
  283. package/dist/assets/invite-memory-BKdqfr5K.js +1 -0
  284. package/dist/assets/ishikawaDiagram-K3B6WC7H-CKXvKV-s.js +70 -0
  285. package/dist/assets/issue-detail-4PCbYpdv.js +119 -0
  286. package/dist/assets/javascript-Cblpdx44.js +1 -0
  287. package/dist/assets/journeyDiagram-COXZFDF6-BHsrZLvQ.js +139 -0
  288. package/dist/assets/julia-KVJvUu_F.js +1 -0
  289. package/dist/assets/kanban-definition-P3RFRI5V-8HhnIs_l.js +89 -0
  290. package/dist/assets/katex-Du_FPwxl.js +257 -0
  291. package/dist/assets/line-rrKrpB-b.js +1 -0
  292. package/dist/assets/linear-BRQgexd0.js +1 -0
  293. package/dist/assets/link-BecLzmfo.js +1 -0
  294. package/dist/assets/list-filter-BC3D4IoX.js +1 -0
  295. package/dist/assets/livescript-DSHsJPcD.js +1 -0
  296. package/dist/assets/log-in-BJCGwGGT.js +1 -0
  297. package/dist/assets/lua-Vher-70I.js +1 -0
  298. package/dist/assets/mathematica-CE9SaVsW.js +1 -0
  299. package/dist/assets/mbox-JGl1Fgvq.js +1 -0
  300. package/dist/assets/mcpSkills-DRs3pGKn.js +1 -0
  301. package/dist/assets/mermaid-parser.core-DmG0b4S0.js +7 -0
  302. package/dist/assets/mermaid.core-D1vILTuF.js +42 -0
  303. package/dist/assets/mindmap-definition-LZFPQGKD-DIMpL0de.js +96 -0
  304. package/dist/assets/mirc-BGWbO906.js +1 -0
  305. package/dist/assets/mllike-DuNQsEw8.js +1 -0
  306. package/dist/assets/model-DL5biheO.js +1 -0
  307. package/dist/assets/modelica-5XCgKQt8.js +1 -0
  308. package/dist/assets/mscgen-mVFg19ri.js +1 -0
  309. package/dist/assets/mumps-C7oS353s.js +1 -0
  310. package/dist/assets/nginx-DXVlpyCz.js +1 -0
  311. package/dist/assets/nsis-KFC6hioG.js +1 -0
  312. package/dist/assets/ntriples-5ckCopnn.js +1 -0
  313. package/dist/assets/octave-D1J2QQNt.js +1 -0
  314. package/dist/assets/onboarding-state-C5_mIw3o.js +1 -0
  315. package/dist/assets/ordinal-BJyFM1v8.js +1 -0
  316. package/dist/assets/oz-CPsllMDD.js +1 -0
  317. package/dist/assets/packet-JDAUHWVQ-BnbYht3G.js +1 -0
  318. package/dist/assets/palette-tokens-CL5ZDrEd.js +1 -0
  319. package/dist/assets/pascal-B-I6JP0Y.js +1 -0
  320. package/dist/assets/path-D6mommQw.js +1 -0
  321. package/dist/assets/pegDiagram-BGZESJAR-BUjtJVjT.js +1 -0
  322. package/dist/assets/perl-CI8WIWBi.js +1 -0
  323. package/dist/assets/pie-XZMESJXO-CM4VXUb-.js +1 -0
  324. package/dist/assets/pieDiagram-CAPJLFHJ-B3v8ryvG.js +39 -0
  325. package/dist/assets/pig-FQI0W3S3.js +1 -0
  326. package/dist/assets/portable-files-CloN_vbk.js +1 -0
  327. package/dist/assets/power-0mw59G-l.js +1 -0
  328. package/dist/assets/powershell-BAu6x78A.js +1 -0
  329. package/dist/assets/prod-C6Q7tISe.js +495 -0
  330. package/dist/assets/profile-summary-B5rPf8v-.js +1 -0
  331. package/dist/assets/properties-BKTTDgau.js +1 -0
  332. package/dist/assets/protobuf-UWh8gh_j.js +1 -0
  333. package/dist/assets/pug-C20tNwmy.js +1 -0
  334. package/dist/assets/puppet-BAHVzCkO.js +1 -0
  335. package/dist/assets/python-C2DOnsac.js +1 -0
  336. package/dist/assets/q-Cooe-Nh8.js +1 -0
  337. package/dist/assets/quadrantDiagram-GDMTTRAM-Cv-dS2Rn.js +7 -0
  338. package/dist/assets/r-CktBKya9.js +1 -0
  339. package/dist/assets/radar-ABXABTNO-v6yZj4Fk.js +1 -0
  340. package/dist/assets/railroad-I3PHUGI6-D-U8Cs0m.js +1 -0
  341. package/dist/assets/railroad-abnf-LNEFI6M7-Dw3fkrVy.js +1 -0
  342. package/dist/assets/railroad-ebnf-DWYD2UWJ-_ln-e3Tx.js +1 -0
  343. package/dist/assets/railroad-peg-JR7BVNR7-Bf8u1-RZ.js +1 -0
  344. package/dist/assets/railroadDiagram-SM67HX2B-Drr5UhQI.js +1 -0
  345. package/dist/assets/requirementDiagram-X7JNWC4A-D5ef6_ac.js +84 -0
  346. package/dist/assets/rolldown-runtime-DhZMWcEn.js +1 -0
  347. package/dist/assets/rough.esm-DnC5Tr1g.js +1 -0
  348. package/dist/assets/rpm-Csj9nLHl.js +1 -0
  349. package/dist/assets/ruby-bGx9eo-K.js +1 -0
  350. package/dist/assets/runtime-IAg0vdY9.js +4137 -0
  351. package/dist/assets/sankeyDiagram-UM26HJRW-DncJWIz_.js +40 -0
  352. package/dist/assets/sas-Drou_EQ9.js +1 -0
  353. package/dist/assets/saved-permissions-CizWg8-P.js +1 -0
  354. package/dist/assets/scheme-DcjG9bAf.js +1 -0
  355. package/dist/assets/scroll-text-Ck6HB7eM.js +1 -0
  356. package/dist/assets/sdk-CWyUlmcn.js +1 -0
  357. package/dist/assets/search-DkTqg7ab.js +1 -0
  358. package/dist/assets/send-CYVi50sh.js +1 -0
  359. package/dist/assets/sequenceDiagram-ZO4K6R2Y-Cs0nGCCg.js +169 -0
  360. package/dist/assets/shared-CIwISWMj.js +1 -0
  361. package/dist/assets/shell-BSKClwid.js +1 -0
  362. package/dist/assets/sieve-CcvsXPZo.js +1 -0
  363. package/dist/assets/simple-mode-B79cVo-x.js +1 -0
  364. package/dist/assets/sizeCapture-INFHLROL-XURNLuv_.js +1 -0
  365. package/dist/assets/skill-source-connect-return-eFTeuj7y.js +1 -0
  366. package/dist/assets/smalltalk-Cmg-4mjQ.js +1 -0
  367. package/dist/assets/smoke-lab-matrix-A7ubFpfk.js +1 -0
  368. package/dist/assets/solr-Dj8ahEwG.js +1 -0
  369. package/dist/assets/sparql-LAJYmgfk.js +1 -0
  370. package/dist/assets/spreadsheet-B8doD_pL.js +1 -0
  371. package/dist/assets/sql-C3kWxFGw.js +1 -0
  372. package/dist/assets/src-DYjgETqR.js +1 -0
  373. package/dist/assets/stateDiagram-v2-TBUQTH76-Dpp3m5Wq.js +291 -0
  374. package/dist/assets/stex-CW6K5Nmu.js +1 -0
  375. package/dist/assets/stylus-BS-Ienrc.js +1 -0
  376. package/dist/assets/swift-BD82LMDK.js +1 -0
  377. package/dist/assets/swimlanes-N4OXWK64-NXVbx1w8.js +1 -0
  378. package/dist/assets/swimlanesDiagram-K3J5GTZL-Ct3LnXZt.js +8 -0
  379. package/dist/assets/tcl-RZa1cqc-.js +1 -0
  380. package/dist/assets/textile-C-BY_OGF.js +1 -0
  381. package/dist/assets/tiddlywiki-C9bm_Oju.js +1 -0
  382. package/dist/assets/tiki-DJOT-rFT.js +1 -0
  383. package/dist/assets/timeline-definition-YOQAKGHF-DqI-Mv2e.js +120 -0
  384. package/dist/assets/toml-Civ2fTsu.js +1 -0
  385. package/dist/assets/treeView-D4JQ5SDB-CZBlE7ya.js +1 -0
  386. package/dist/assets/treemap-SAJKECNS-BlueznID.js +1 -0
  387. package/dist/assets/troff-Lns35Xcq.js +1 -0
  388. package/dist/assets/ttcn-7vlxVTUK.js +1 -0
  389. package/dist/assets/ttcn-cfg-B8qhhp6o.js +1 -0
  390. package/dist/assets/turtle-DTIS1YQ7.js +1 -0
  391. package/dist/assets/useAgentlessOnboardingAutoOpen-CnFwEQ-H.js +1 -0
  392. package/dist/assets/useAuthorizationWindow-DnFQsiFj.js +1 -0
  393. package/dist/assets/useDateRange-9EbqkWXy.js +1 -0
  394. package/dist/assets/useFastResponsesEnabled-D8dunm4j.js +1 -0
  395. package/dist/assets/usePageView-BiX5i8ck.js +1 -0
  396. package/dist/assets/useProfilesData-0VYQ4lAT.js +1 -0
  397. package/dist/assets/useReviewCount-WBWxwKI3.js +1 -0
  398. package/dist/assets/useRoutineFormOptions-DnX5DBn1.js +3 -0
  399. package/dist/assets/useSummaryDraftStream-DPQRvaXT.js +3 -0
  400. package/dist/assets/useTailscaleConnections-BDff6dWx.js +1 -0
  401. package/dist/assets/usecaseDiagram-VIAY4XPW-BSDn8OaJ.js +362 -0
  402. package/dist/assets/vb-BO8UacKu.js +1 -0
  403. package/dist/assets/vbscript-DWLru3lT.js +1 -0
  404. package/dist/assets/velocity-BIIn-Nl2.js +1 -0
  405. package/dist/assets/vennDiagram-BLWOH2XV-BBSA9KNN.js +34 -0
  406. package/dist/assets/verilog-BVYlmXGg.js +1 -0
  407. package/dist/assets/vhdl-Cn8cC8Yb.js +1 -0
  408. package/dist/assets/wardley-7MLQ67FV-CsT-rTZ9.js +1 -0
  409. package/dist/assets/wardleyDiagram-YMQ3BMBF-BLClsIjw.js +78 -0
  410. package/dist/assets/webidl-ChvzbZ5-.js +1 -0
  411. package/dist/assets/xquery-BKN7qEbU.js +1 -0
  412. package/dist/assets/xychartDiagram-TAQBALBS-2x4wB0gq.js +7 -0
  413. package/dist/assets/yacas-BG9ha7tU.js +1 -0
  414. package/dist/assets/z80-CB2cGLew.js +1 -0
  415. package/dist/brands/adapters/LICENSE +21 -0
  416. package/dist/brands/adapters/README.md +7 -0
  417. package/dist/brands/adapters/cursor-dark.svg +1 -0
  418. package/dist/brands/adapters/cursor.svg +1 -0
  419. package/dist/brands/adapters/gemini-color.svg +1 -0
  420. package/dist/brands/adapters/grok-dark.svg +1 -0
  421. package/dist/brands/adapters/grok.svg +1 -0
  422. package/dist/brands/adapters/hermesagent-dark.svg +1 -0
  423. package/dist/brands/adapters/hermesagent.svg +1 -0
  424. package/dist/brands/adapters/kimi-color-light.svg +1 -0
  425. package/dist/brands/adapters/kimi-color.svg +1 -0
  426. package/dist/brands/adapters/openai-dot.README.md +7 -0
  427. package/dist/brands/adapters/openai-dot.svg +3 -0
  428. package/dist/brands/adapters/pi-dark.svg +1 -0
  429. package/dist/brands/adapters/pi.svg +1 -0
  430. package/dist/brands/apps/1password-dark.svg +1 -0
  431. package/dist/brands/apps/1password.svg +1 -0
  432. package/dist/brands/apps/LOBE-LICENSE +21 -0
  433. package/dist/brands/apps/agentmail-dark.svg +16 -0
  434. package/dist/brands/apps/agentmail.svg +17 -0
  435. package/dist/brands/apps/airtable.svg +1 -0
  436. package/dist/brands/apps/anthropic-dark.svg +1 -0
  437. package/dist/brands/apps/anthropic.svg +1 -0
  438. package/dist/brands/apps/antigravity.svg +31 -0
  439. package/dist/brands/apps/api-key-generic.svg +1 -0
  440. package/dist/brands/apps/arcade.png +0 -0
  441. package/dist/brands/apps/asana.svg +12 -0
  442. package/dist/brands/apps/aws-dark.svg +1 -0
  443. package/dist/brands/apps/aws.svg +1 -0
  444. package/dist/brands/apps/bedrock.svg +1 -0
  445. package/dist/brands/apps/beehiiv.png +0 -0
  446. package/dist/brands/apps/bitly.svg +1 -0
  447. package/dist/brands/apps/box.svg +1 -0
  448. package/dist/brands/apps/braintrust-dark.png +0 -0
  449. package/dist/brands/apps/braintrust.png +0 -0
  450. package/dist/brands/apps/brex-dark.svg +1 -0
  451. package/dist/brands/apps/brex.svg +1 -0
  452. package/dist/brands/apps/browser-use.svg +6 -0
  453. package/dist/brands/apps/calendly.png +0 -0
  454. package/dist/brands/apps/candid.png +0 -0
  455. package/dist/brands/apps/circleback.png +0 -0
  456. package/dist/brands/apps/clickhouse-dark.svg +1 -0
  457. package/dist/brands/apps/clickhouse.svg +1 -0
  458. package/dist/brands/apps/clickup.png +0 -0
  459. package/dist/brands/apps/cloudflare.svg +1 -0
  460. package/dist/brands/apps/cloudinary-dark.svg +1 -0
  461. package/dist/brands/apps/cloudinary.svg +3 -0
  462. package/dist/brands/apps/coda.svg +1 -0
  463. package/dist/brands/apps/cognee.png +0 -0
  464. package/dist/brands/apps/composio-dark.svg +11 -0
  465. package/dist/brands/apps/composio.svg +16 -0
  466. package/dist/brands/apps/connection-pool.svg +1 -0
  467. package/dist/brands/apps/context7-dark.svg +8 -0
  468. package/dist/brands/apps/context7.svg +8 -0
  469. package/dist/brands/apps/daytona-dark.svg +1 -0
  470. package/dist/brands/apps/daytona.svg +1 -0
  471. package/dist/brands/apps/discord-dark.svg +1 -0
  472. package/dist/brands/apps/discord.svg +1 -0
  473. package/dist/brands/apps/ditto.png +0 -0
  474. package/dist/brands/apps/egnyte.svg +1 -0
  475. package/dist/brands/apps/embat.svg +1 -0
  476. package/dist/brands/apps/enterpret.png +0 -0
  477. package/dist/brands/apps/exa.svg +5 -0
  478. package/dist/brands/apps/executor.png +0 -0
  479. package/dist/brands/apps/firecrawl.svg +12 -0
  480. package/dist/brands/apps/fireflies.svg +76 -0
  481. package/dist/brands/apps/gauge.png +0 -0
  482. package/dist/brands/apps/github-copilot-dark.svg +1 -0
  483. package/dist/brands/apps/github-copilot.svg +1 -0
  484. package/dist/brands/apps/github-dark.svg +10 -0
  485. package/dist/brands/apps/github.svg +10 -0
  486. package/dist/brands/apps/gmail.svg +1 -0
  487. package/dist/brands/apps/google-calendar.svg +1 -0
  488. package/dist/brands/apps/google-chat.svg +1 -0
  489. package/dist/brands/apps/google-docs.svg +1 -0
  490. package/dist/brands/apps/google-drive.svg +1 -0
  491. package/dist/brands/apps/google-people.svg +1 -0
  492. package/dist/brands/apps/google-sheets.svg +1 -0
  493. package/dist/brands/apps/google-slides.svg +1 -0
  494. package/dist/brands/apps/google-workspace-search.svg +1 -0
  495. package/dist/brands/apps/google.svg +1 -0
  496. package/dist/brands/apps/gsc-wizard.png +0 -0
  497. package/dist/brands/apps/honcho.svg +33 -0
  498. package/dist/brands/apps/hugging-face.svg +8 -0
  499. package/dist/brands/apps/imessage-photon.png +0 -0
  500. package/dist/brands/apps/jam-dev-dark.svg +1 -0
  501. package/dist/brands/apps/jam-dev.svg +1 -0
  502. package/dist/brands/apps/jira-dark.svg +1 -0
  503. package/dist/brands/apps/jira.svg +4 -0
  504. package/dist/brands/apps/kernel.svg +3 -0
  505. package/dist/brands/apps/klaviyo.png +0 -0
  506. package/dist/brands/apps/linear-dark.svg +5 -0
  507. package/dist/brands/apps/linear.svg +5 -0
  508. package/dist/brands/apps/local-falcon.png +0 -0
  509. package/dist/brands/apps/make-dark.svg +1 -0
  510. package/dist/brands/apps/make.svg +1 -0
  511. package/dist/brands/apps/manifest.json +756 -0
  512. package/dist/brands/apps/manufact-dark.svg +6 -0
  513. package/dist/brands/apps/manufact.svg +5 -0
  514. package/dist/brands/apps/mem0.svg +1 -0
  515. package/dist/brands/apps/microsoft-teams.svg +68 -0
  516. package/dist/brands/apps/miro-dark.svg +1 -0
  517. package/dist/brands/apps/miro.svg +4 -0
  518. package/dist/brands/apps/mixpanel-dark.svg +1 -0
  519. package/dist/brands/apps/mixpanel.svg +1 -0
  520. package/dist/brands/apps/monday-dark.png +0 -0
  521. package/dist/brands/apps/monday.png +0 -0
  522. package/dist/brands/apps/neon.png +0 -0
  523. package/dist/brands/apps/netlify-dark.svg +1 -0
  524. package/dist/brands/apps/netlify.svg +16 -0
  525. package/dist/brands/apps/notion-dark.svg +1 -0
  526. package/dist/brands/apps/notion.svg +1 -0
  527. package/dist/brands/apps/oauth-generic.svg +1 -0
  528. package/dist/brands/apps/openai-dark.svg +1 -0
  529. package/dist/brands/apps/openai.svg +1 -0
  530. package/dist/brands/apps/openrouter-dark.svg +3 -0
  531. package/dist/brands/apps/openrouter.svg +3 -0
  532. package/dist/brands/apps/oreilly.svg +1 -0
  533. package/dist/brands/apps/pagerduty.svg +4 -0
  534. package/dist/brands/apps/paperclip-notebook-dark.svg +1 -0
  535. package/dist/brands/apps/paperclip-notebook.svg +1 -0
  536. package/dist/brands/apps/parallel-dark.svg +11 -0
  537. package/dist/brands/apps/parallel.svg +11 -0
  538. package/dist/brands/apps/planetscale-dark.svg +1 -0
  539. package/dist/brands/apps/planetscale.svg +1 -0
  540. package/dist/brands/apps/posthog-dark.svg +1 -0
  541. package/dist/brands/apps/posthog.svg +1 -0
  542. package/dist/brands/apps/postman.svg +1 -0
  543. package/dist/brands/apps/railway-dark.svg +1 -0
  544. package/dist/brands/apps/railway.svg +1 -0
  545. package/dist/brands/apps/razorpay-dark.svg +1 -0
  546. package/dist/brands/apps/razorpay.svg +1 -0
  547. package/dist/brands/apps/resend-dark.svg +1 -0
  548. package/dist/brands/apps/resend.svg +1 -0
  549. package/dist/brands/apps/sanity-dark.svg +1 -0
  550. package/dist/brands/apps/sanity.svg +1 -0
  551. package/dist/brands/apps/sentry-dark.svg +1 -0
  552. package/dist/brands/apps/sentry.svg +1 -0
  553. package/dist/brands/apps/shopify.svg +24 -0
  554. package/dist/brands/apps/similarweb-dark.svg +1 -0
  555. package/dist/brands/apps/similarweb.svg +1 -0
  556. package/dist/brands/apps/slack.png +0 -0
  557. package/dist/brands/apps/slack.svg +17 -0
  558. package/dist/brands/apps/speko.svg +16 -0
  559. package/dist/brands/apps/stripe.svg +11 -0
  560. package/dist/brands/apps/supabase.svg +15 -0
  561. package/dist/brands/apps/superagent.png +0 -0
  562. package/dist/brands/apps/supermemory.png +0 -0
  563. package/dist/brands/apps/tailscale.png +0 -0
  564. package/dist/brands/apps/tavily.png +0 -0
  565. package/dist/brands/apps/telegram.svg +12 -0
  566. package/dist/brands/apps/telem-dark.svg +9 -0
  567. package/dist/brands/apps/telem.svg +9 -0
  568. package/dist/brands/apps/ticket-tailor-dark.svg +1 -0
  569. package/dist/brands/apps/ticket-tailor.svg +1 -0
  570. package/dist/brands/apps/ticktick.svg +1 -0
  571. package/dist/brands/apps/todoist.svg +1 -0
  572. package/dist/brands/apps/unikraft.svg +1 -0
  573. package/dist/brands/apps/vercel-dark.svg +1 -0
  574. package/dist/brands/apps/vercel.svg +1 -0
  575. package/dist/brands/apps/webflow.svg +1 -0
  576. package/dist/brands/apps/windsor-ai.png +0 -0
  577. package/dist/brands/apps/wix-dark.svg +12 -0
  578. package/dist/brands/apps/wix.svg +12 -0
  579. package/dist/brands/apps/xai-dark.svg +1 -0
  580. package/dist/brands/apps/xai.svg +1 -0
  581. package/dist/brands/apps/xero.svg +1 -0
  582. package/dist/brands/apps/youcom-dark.svg +13 -0
  583. package/dist/brands/apps/youcom.svg +13 -0
  584. package/dist/brands/apps/zapier.svg +1 -0
  585. package/dist/brands/apps/zep.png +0 -0
  586. package/dist/brands/claude-color.svg +17 -0
  587. package/dist/brands/codex-color.svg +17 -0
  588. package/dist/brands/opencode-logo-dark-square.svg +18 -0
  589. package/dist/brands/opencode-logo-light-square.svg +18 -0
  590. package/dist/favicon-16x16.png +0 -0
  591. package/dist/favicon-32x32.png +0 -0
  592. package/dist/favicon.ico +0 -0
  593. package/dist/favicon.svg +7 -0
  594. package/dist/fonts/InterVariable-Italic.woff2 +0 -0
  595. package/dist/fonts/InterVariable.woff2 +0 -0
  596. package/dist/fonts/NOTICE.md +30 -0
  597. package/dist/fonts/PaperMono-OFL.txt +93 -0
  598. package/dist/fonts/PaperMono-Variable.woff2 +0 -0
  599. package/dist/index.html +165 -0
  600. package/dist/microvac-push-sw.js +37 -0
  601. package/dist/paperclip-thinking.svg +17 -0
  602. package/dist/site.webmanifest +30 -0
  603. package/dist/storybook/grok-comparison.csv +4 -0
  604. package/dist/sw.js +176 -0
  605. package/dist/worktree-favicon-16x16.png +0 -0
  606. package/dist/worktree-favicon-32x32.png +0 -0
  607. package/dist/worktree-favicon.ico +0 -0
  608. package/dist/worktree-favicon.svg +9 -0
  609. package/package.json +20 -4
@@ -0,0 +1 @@
1
+ var L=Object.defineProperty;var t=(s,n)=>L(s,"name",{value:n,configurable:!0});import{a as S,n as U}from"./rolldown-runtime-DhZMWcEn.js";import{$r as z,Qr as I,ei as B,ri as $}from"./issue-detail-4PCbYpdv.js";import{$A as Q,GS as T,Ga as V,Gb as E,HE as v,ME as M,NE as m,UT as W,__ as G,_w as N,bE as q,hC as O,lS as Y,n as H,nj as J,ov as D,tT as X,zC as Z,zE as ee}from"./index-Bt31d8ga.js";import{t as se}from"./budgets-0Dw6TH1A.js";var me=U({BudgetAlertActions:t(()=>re,"BudgetAlertActions"),FailedRunActions:t(()=>ne,"FailedRunActions")}),w=S(J(),1),e=S(Q(),1);function K({leading:s,children:n}){return(0,e.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2","data-attention-actions":"true",children:[s??(0,e.jsx)("span",{}),(0,e.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:n})]})}t(K,"ActionsFooter");function j(s,n){const i=s.subject.metadata?.[n];return typeof i=="string"&&i?i:null}t(j,"metadataString");function k(s,n){const i=s.subject.metadata?.[n];return typeof i=="number"&&Number.isFinite(i)?i:null}t(k,"metadataNumber");function te(s){const n=s.detail?.kind==="failed_run"||s.detail?.kind==="agent_error"?s.detail.failureReasonExcerpt:null;return j(s,"error")??j(s,"errorReason")??n??j(s,"errorCode")??"The run failed"}t(te,"failedRunError");function ne({item:s,companyId:n,leading:i,footerContext:C,onResolved:R,presentation:g="panel"}){const y=M(),f=D(),o=j(s,"issueId")??s.relatedIssue?.id??null,h=(0,w.useRef)(null),[u,x]=(0,w.useState)(null),a=q({mutationFn:t(()=>(h.current??=crypto.randomUUID(),Y.retryTask(o,{idempotencyKey:h.current,observedRunId:s.subject.id})),"mutationFn"),onMutate:t(()=>x(null),"onMutate"),onSuccess:t(d=>{const l=H(d);x(l),f?.pushToast({title:l?"Retry did not start":"Retry requested",body:l??s.relatedIssue?.identifier??void 0,tone:l?"info":"success"}),y.invalidateQueries({queryKey:T.attention(n)}),o&&y.invalidateQueries({queryKey:T.issues.detail(o)}),l||R?.()},"onSuccess"),onError:t(d=>{h.current=null,f?.pushToast({title:"Could not retry this run",body:d instanceof Error?d.message:void 0,tone:"error"})},"onError")});if(g==="card"){const d=te(s),l=j(s,"retryExhaustedReason"),p=[l&&l!==d?l:null,o?"Retry starts a new run.":null].filter(Boolean).join(" ");return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(I,{children:[(0,e.jsx)(B,{icon:(0,e.jsx)(O,{className:"text-destructive"}),title:d}),p?(0,e.jsx)(z,{children:p}):null]}),C,u?(0,e.jsx)("p",{role:"status",className:"text-sm text-muted-foreground",children:u}):null,(0,e.jsxs)($,{leading:i,children:[s.subject.href&&(0,e.jsx)(m,{asChild:!0,variant:o?"outline":"default",size:"sm",children:(0,e.jsx)(E,{to:s.subject.href,children:"View run"})}),o&&(0,e.jsxs)(m,{type:"button",size:"sm",disabled:a.isPending,onClick:t(()=>a.mutate(),"onClick"),children:[a.isPending&&(0,e.jsx)(N,{className:"h-3.5 w-3.5 animate-spin"}),"Retry run"]})]})]})}return(0,e.jsxs)(e.Fragment,{children:[u?(0,e.jsx)("p",{role:"status",className:"text-sm text-muted-foreground",children:u}):null,(0,e.jsxs)(K,{leading:i,children:[s.subject.href&&(0,e.jsx)(m,{asChild:!0,variant:"outline",size:"sm",children:(0,e.jsxs)(E,{to:s.subject.href,children:["Open run",(0,e.jsx)(X,{className:"h-3.5 w-3.5"})]})}),o&&(0,e.jsxs)(m,{type:"button",size:"sm",disabled:a.isPending,onClick:t(()=>a.mutate(),"onClick"),children:[a.isPending?(0,e.jsx)(N,{className:"h-3.5 w-3.5 animate-spin"}):(0,e.jsx)(Z,{className:"h-3.5 w-3.5"}),"Retry"]})]})]})}t(ne,"FailedRunActions");function ae(s){return(s/100).toFixed(2)}t(ae,"centsInputValue");function ie(s){const n=Number(s);return!Number.isFinite(n)||n<0?null:Math.round(n*100)}t(ie,"parseDollarInput");function re({item:s,companyId:n,leading:i,footerContext:C,onResolved:R,presentation:g="panel"}){const y=M(),f=D(),[o,h]=(0,w.useState)(!1),u=k(s,"amountObserved")??0,x=k(s,"amountLimit")??0,a=s.subject.metadata?.thresholdType==="soft",[d,l]=(0,w.useState)(()=>ae(Math.max(u+1e3,x+(a?1e3:0)))),p=ie(d),_=p!==null&&p<=u,c=q({mutationFn:t(r=>se.resolveIncident(n,s.subject.id,r),"mutationFn"),onSuccess:t((r,b)=>{f?.pushToast({title:b.action==="keep_paused"?a?"Warning dismissed":"Kept paused":"Limit raised",body:s.subject.title??void 0,tone:"success"}),V(y,n,s),R?.()},"onSuccess"),onError:t(r=>{f?.pushToast({title:"Could not update the budget",body:r instanceof Error?r.message:void 0,tone:"error"})},"onError")}),A=(0,e.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[(0,e.jsx)("label",{className:"text-xs font-medium text-muted-foreground",htmlFor:`attention-budget-${s.id}`,children:"New limit (USD)"}),(0,e.jsx)(G,{id:`attention-budget-${s.id}`,value:d,onChange:t(r=>l(r.target.value),"onChange"),inputMode:"decimal",className:"sm:max-w-40",autoFocus:g==="card"})]}),F=c.isPending||p===null||_,P=t(()=>{p!==null&&c.mutate({action:"raise_budget_and_resume",amount:p})},"raise");if(g==="card"){const r=k(s,"observedPercent")??(x>0?Math.round(u/x*100):0),b=j(s,"scopeType");return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(I,{children:[(0,e.jsxs)("div",{className:"flex items-baseline justify-between gap-3",children:[(0,e.jsx)("span",{className:"truncate text-(length:--text-compact) font-medium text-foreground",children:`${v(u)} spent of ${v(x)}`}),(0,e.jsx)("span",{className:"shrink-0 text-xs text-muted-foreground",children:`${r}% used`})]}),(0,e.jsx)("div",{className:"h-1 overflow-hidden rounded-full bg-muted",role:"progressbar","aria-label":"Budget used","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.min(r,100),children:(0,e.jsx)("div",{className:ee("h-full rounded-full",!a||r>=100?"bg-destructive":"bg-amber-500"),style:{width:`${Math.min(r,100)}%`}})}),(0,e.jsx)(z,{children:[b?`${b[0].toUpperCase()}${b.slice(1)} limit`:"Limit",a?"Work continues until the limit is reached":"New runs are paused"].join(" · ")}),o?A:null,o&&_?(0,e.jsx)("p",{className:"text-xs text-destructive",children:"The new limit must be more than the current spend."}):null]}),C,(0,e.jsxs)($,{leading:i,children:[(0,e.jsx)(m,{type:"button",variant:"ghost",size:"sm",disabled:c.isPending,onClick:t(()=>c.mutate({action:"keep_paused"}),"onClick"),children:a?"Dismiss warning":"Keep paused"}),o?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(m,{type:"button",variant:"outline",size:"sm",disabled:c.isPending,onClick:t(()=>h(!1),"onClick"),children:"Cancel"}),(0,e.jsxs)(m,{type:"button",size:"sm",disabled:F,onClick:P,children:[c.isPending&&(0,e.jsx)(N,{className:"h-3.5 w-3.5 animate-spin"}),a?"Raise limit":"Raise limit & resume"]})]}):(0,e.jsx)(m,{type:"button",size:"sm",disabled:c.isPending,onClick:t(()=>h(!0),"onClick"),children:"Increase limit…"})]})]})}return(0,e.jsxs)("div",{className:"space-y-3","data-attention-budget-actions":!0,children:[(0,e.jsxs)("p",{className:"text-sm text-muted-foreground",children:[`Spend is ${v(u)} of a ${v(x)} limit.`,a?" This warning does not pause work.":" Work in this scope is paused."]}),A,_&&(0,e.jsx)("p",{className:"text-xs text-destructive",children:"The new limit must be more than the current spend."}),(0,e.jsxs)(K,{leading:i,children:[(0,e.jsx)(m,{type:"button",variant:"outline",size:"sm",disabled:c.isPending,onClick:t(()=>c.mutate({action:"keep_paused"}),"onClick"),children:a?"Dismiss warning":"Keep paused"}),(0,e.jsxs)(m,{type:"button",size:"sm",disabled:F,onClick:P,children:[c.isPending?(0,e.jsx)(N,{className:"h-3.5 w-3.5 animate-spin"}):(0,e.jsx)(W,{className:"h-3.5 w-3.5"}),a?"Raise limit":"Raise limit & resume"]})]})]})}t(re,"BudgetAlertActions");export{re as n,ne as r,me as t};
@@ -0,0 +1 @@
1
+ var Je=Object.defineProperty;var n=(s,t)=>Je(s,"name",{value:t,configurable:!0});import{a as Ne}from"./rolldown-runtime-DhZMWcEn.js";import{$r as ee,Gr as Ge,Hr as He,Jr as Ye,Kr as We,Qr as V,Vr as Xe,Wr as Ze,an as es,cn as ss,ei as se,fn as ts,gn as ns,hn as as,in as rs,mn as is,pi as we,pn as os,ri as oe,rn as ls,xi as Z}from"./issue-detail-4PCbYpdv.js";import{S as $}from"./collections-BxrcELwt.js";import{$A as ds,$S as te,$a as cs,B_ as fe,Cx as ye,Ev as ke,Ex as Ce,GS as R,GT as us,Ga as le,Gb as B,HE as xs,H_ as de,IS as ms,Ja as ps,LD as hs,ME as L,Mi as fs,NE as g,NT as Ae,OT as js,QT as gs,Qa as bs,Qs as Se,RT as vs,TT as Ns,Tx as _e,UT as Ee,Xs as ws,Ys as ys,Yw as ks,Za as Cs,_v as Te,_w as C,a as As,ac as qe,ao as Ss,ax as _s,ay as U,bE as A,ck as Es,cv as H,dS as Ts,do as qs,ec as Rs,eo as Ps,fC as Ds,g_ as Re,hv as Pe,i as zs,iC as De,iD as Ks,jT as ce,ji as $s,ki as Fs,lS as J,lc as Os,nj as Bs,no as Ls,pv as ze,pw as Ms,qC as je,qa as Qs,qd as Ke,qs as Is,rb as Vs,ro as Us,tT as $e,tc as Fe,to as Js,u as O,uC as G,xE as ne,xc as Gs,zC as Hs,zE as _,z_ as ge}from"./index-Bt31d8ga.js";import{n as Ys,r as Ws}from"./AttentionInlineVerbs-DlPQVCO-.js";var Oe={name:"undo-2",size:24,node:[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]};Oe.node;var Xs=gs(Oe),D=Ne(Bs(),1),e=Ne(ds(),1);function K(s,t){const o=s?.[t];return typeof o=="string"&&o.trim()?o.trim():null}n(K,"payloadString");var Zs={request_board_approval:"Board approval request",approve_ceo_strategy:"Strategy approval",budget_override_required:"Budget override request"},et=n(s=>xs(s).replace(/\.00$/,""),"wholeDollars");function st({item:s,companyId:t,artifactRow:o,onViewDetails:r}){const d=s.subject.metadata?.type==="hire_agent",a=ne({queryKey:R.approvals.detail(s.subject.id),queryFn:n(()=>$.get(s.subject.id),"queryFn"),enabled:!o}).data?.payload,i=K(a,"reportsTo"),h=ne({queryKey:R.agents.list(t),queryFn:n(()=>Vs.list(t),"queryFn"),enabled:d&&!!i});if(o)return(0,e.jsx)(V,{children:o});if(d){const f=typeof a?.budgetMonthlyCents=="number"&&a.budgetMonthlyCents>0?a.budgetMonthlyCents:null,j=K(a,"name")??s.subject.title??"New agent",p=K(a,"role"),b=K(a,"adapterType"),m=i?h.data?.find(N=>N.id===i)?.name:null,y=[m?`Reports to ${m}`:null,K(a,"title")??(p?`${Es[p]??p} role`:null),b?Ke(b):null].filter(Boolean).join(" · ");return(0,e.jsxs)(V,{children:[(0,e.jsx)(se,{icon:(0,e.jsx)(G,{}),title:f?`${j} · ${et(f)} / month`:j,meta:y||void 0,onOpen:r,label:"View configuration"}),(0,e.jsx)(ee,{children:f?"Approval creates the agent with this monthly spending limit.":"Approval creates the agent."})]})}const u=Zs[String(s.subject.metadata?.type??"")]??"Approval request",x=K(a,"recommendedAction"),c=K(a,"nextActionOnApproval");return(0,e.jsxs)(V,{children:[(0,e.jsx)(se,{icon:(0,e.jsx)(ks,{}),title:x??u,meta:x?u:void 0,onOpen:r,label:"View details"}),c?(0,e.jsx)(ee,{children:`On approval: ${c}`}):null]})}n(st,"ApprovalCardPanel");var ae=36e5,tt=24*ae,nt=[{label:"1 hour",resolve:n(()=>new Date(Date.now()+ae).toISOString(),"resolve")},{label:"4 hours",resolve:n(()=>new Date(Date.now()+4*ae).toISOString(),"resolve")},{label:"Tomorrow",resolve:n(()=>{const s=new Date;return s.setDate(s.getDate()+1),s.setHours(9,0,0,0),s.toISOString()},"resolve")},{label:"Next week",resolve:n(()=>new Date(Date.now()+7*tt).toISOString(),"resolve")}];function at(s){return s.toLowerCase().trim().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,80)}n(at,"toQueueKey");function rt(s){const t=new Date(s).getTime()-Date.now();if(!Number.isFinite(t))return{text:"",overdue:!1};if(t<=0)return{text:"Expired",overdue:!0};const o=Math.round(t/6e4);if(o<60)return{text:`Expires in ${o}m`,overdue:!1};const r=Math.round(o/60);return r<24?{text:`Expires in ${r}h`,overdue:!1}:{text:`Expires in ${Math.round(r/24)}d`,overdue:!1}}n(rt,"expiryLabel");function it({item:s,companyId:t,agents:o}){const r=L(),{pushToast:d}=H(),a=s.sourceKind,i=s.subject.id,h=Fe(s),u=s.relatedIssue?.id??(typeof s.subject.metadata?.issueId=="string"?s.subject.metadata.issueId:null)??(s.subject.kind==="issue"?s.subject.id:null),x=n(()=>{r.invalidateQueries({queryKey:R.attention(t)}),r.invalidateQueries({queryKey:R.decisionQueues.list(t)}),r.invalidateQueries({queryKey:R.decisionQueues.triage(t,a,i)})},"invalidate"),c=n(l=>w=>d({title:`Could not ${l}`,body:w instanceof Error?w.message:"Please try again.",tone:"error"}),"onError"),f=A({mutationFn:n(l=>O.updateTriage(t,a,i,{decideBy:l}),"mutationFn"),onSuccess:x,onError:c("set when to decide")}),j=A({mutationFn:n(l=>O.updateTriage(t,a,i,{snoozedUntil:l}),"mutationFn"),onSuccess:x,onError:c("snooze")}),p=A({mutationFn:n(l=>O.addItem(t,l,a,i),"mutationFn"),onSuccess:x,onError:c("add to queue")}),b=A({mutationFn:n(l=>O.removeItem(t,l,a,i),"mutationFn"),onSuccess:x,onError:c("remove from queue")}),m=A({mutationFn:n(l=>{if(!u)throw new Error("This decision has no linked task to route from.");const w=`${`[@${l.name}](${hs(l.id)})`} — could you look at this decision${h?` on ${h.identifier}`:""}, prepare a recommendation, and re-surface it on the decisions desk? (routed from the desk)`;return J.addComment(u,w)},"mutationFn"),onSuccess:n((l,w)=>{x(),d({title:`Asked ${w.name} for a recommendation`,tone:"success"})},"onSuccess"),onError:c("ask that agent for a recommendation")}),y=f.isPending||j.isPending||p.isPending||b.isPending,N=s.decideBy,S=N!=null&&/^\d{4}-\d{2}-\d{2}$/.test(N);return(0,e.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-border bg-muted/30 p-3","data-decision-triage-strip":!0,onClick:n(l=>l.stopPropagation(),"onClick"),children:[s.expiresAt&&(()=>{const{text:l,overdue:w}=rt(s.expiresAt);return l?(0,e.jsxs)("div",{className:"flex items-center gap-1.5 text-xs",children:[(0,e.jsx)(Z,{className:_("h-3.5 w-3.5",w?"text-destructive":"text-muted-foreground")}),(0,e.jsx)("span",{className:w?"font-medium text-destructive":"text-muted-foreground",children:l})]}):null})(),(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:"When to decide"}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-1",role:"group","aria-label":"When to decide",children:[Is.map(([l,w])=>(0,e.jsx)(be,{active:N===l,disabled:y,onClick:n(()=>f.mutate(N===l?null:l),"onClick"),children:w},l)),(0,e.jsxs)(ye,{children:[(0,e.jsx)(Ce,{asChild:!0,children:(0,e.jsxs)(be,{active:S,disabled:y,children:[(0,e.jsx)(Ae,{className:"h-3.5 w-3.5"}),S?qe(N):"Pick date"]})}),(0,e.jsx)(_e,{align:"start",className:"w-auto p-2",children:(0,e.jsx)("input",{type:"date",defaultValue:S?N??"":"",className:"rounded-sm border border-border bg-background px-2 py-1 text-xs",onChange:n(l=>{l.target.value&&f.mutate(l.target.value)},"onChange")})})]})]})]}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:"Queues"}),s.queues.map(l=>(0,e.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-sm border border-border bg-background px-1.5 py-0.5 text-xs",children:[l.title,(0,e.jsx)("button",{type:"button",className:"text-muted-foreground hover:text-destructive disabled:opacity-50","aria-label":`Remove from ${l.title}`,disabled:y,onClick:n(()=>b.mutate(l.key),"onClick"),children:(0,e.jsx)(De,{className:"h-3 w-3"})})]},l.key)),(0,e.jsx)(ot,{companyId:t,existingKeys:new Set(s.queues.map(l=>l.key)),disabled:y,onAdd:n(l=>p.mutate(l),"onAdd")})]}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[s.snoozedUntil?(0,e.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground",children:[(0,e.jsx)(Z,{className:"h-3.5 w-3.5"}),"Snoozed until ",new Date(s.snoozedUntil).toLocaleString(),(0,e.jsx)("button",{type:"button",className:"text-muted-foreground hover:text-foreground",disabled:y,onClick:n(()=>j.mutate(null),"onClick"),children:"Clear"})]}):(0,e.jsxs)(ze,{children:[(0,e.jsx)(ke,{asChild:!0,children:(0,e.jsxs)(g,{type:"button",variant:"outline",size:"xs",className:"h-7 gap-1",disabled:y,children:[(0,e.jsx)(Z,{className:"h-3.5 w-3.5"}),"Snooze",(0,e.jsx)(ce,{className:"h-3 w-3"})]})}),(0,e.jsx)(Pe,{align:"start",children:nt.map(l=>(0,e.jsx)(Te,{onClick:n(()=>j.mutate(l.resolve()),"onClick"),children:l.label},l.label))})]}),(0,e.jsx)(dt,{agents:o??[],disabled:m.isPending||!u,disabledReason:u?void 0:"No linked task to ask about",onRoute:n(l=>m.mutate(l),"onRoute")}),y&&(0,e.jsx)(C,{className:"h-3.5 w-3.5 animate-spin text-muted-foreground"})]})]})}n(it,"DecisionTriageStrip");function be({active:s,disabled:t,onClick:o,children:r}){return(0,e.jsx)("button",{type:"button",disabled:t,onClick:o,"aria-pressed":s,className:_("inline-flex items-center gap-1 rounded-sm border px-2 py-1 text-xs transition-colors disabled:opacity-50",s?"border-primary bg-primary/10 font-medium text-primary":"border-border text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:r})}n(be,"SegmentButton");function ot({companyId:s,existingKeys:t,disabled:o,onAdd:r}){const d=L(),{pushToast:a}=H(),[i,h]=(0,D.useState)(!1),[u,x]=(0,D.useState)(!1),[c,f]=(0,D.useState)(""),{data:j}=ne({queryKey:R.decisionQueues.list(s),queryFn:n(()=>O.list(s),"queryFn"),enabled:i}),p=A({mutationFn:n(m=>O.create(s,{key:at(m),title:m.trim()}),"mutationFn"),onSuccess:n(m=>{d.invalidateQueries({queryKey:R.decisionQueues.list(s)}),r(m.key),f(""),x(!1),h(!1)},"onSuccess"),onError:n(m=>a({title:"Could not create queue",body:m instanceof Error?m.message:"Please try again.",tone:"error"}),"onError")}),b=(j??[]).filter(m=>!t.has(m.key));return(0,e.jsxs)(ye,{open:i,onOpenChange:h,children:[(0,e.jsx)(Ce,{asChild:!0,children:(0,e.jsxs)(g,{type:"button",variant:"outline",size:"xs",className:"h-7 gap-1",disabled:o,children:[(0,e.jsx)(je,{className:"h-3.5 w-3.5"}),"Queue"]})}),(0,e.jsx)(_e,{align:"start",className:"w-56 p-1",children:u?(0,e.jsxs)("div",{className:"flex flex-col gap-1.5 p-1",children:[(0,e.jsx)("input",{autoFocus:!0,value:c,onChange:n(m=>f(m.target.value),"onChange"),onKeyDown:n(m=>{m.key==="Enter"&&c.trim()&&p.mutate(c),m.key==="Escape"&&x(!1)},"onKeyDown"),placeholder:"New queue name…",className:"w-full rounded-sm border border-border bg-background px-2 py-1 text-xs"}),(0,e.jsxs)("div",{className:"flex justify-end gap-1",children:[(0,e.jsx)(g,{type:"button",variant:"ghost",size:"xs",onClick:n(()=>x(!1),"onClick"),children:"Cancel"}),(0,e.jsxs)(g,{type:"button",size:"xs",disabled:!c.trim()||p.isPending,onClick:n(()=>p.mutate(c),"onClick"),children:[p.isPending&&(0,e.jsx)(C,{className:"h-3 w-3 animate-spin"}),"Create"]})]})]}):(0,e.jsxs)("div",{className:"max-h-64 space-y-0.5 overflow-y-auto",children:[b.length===0&&(0,e.jsx)("p",{className:"px-2 py-1.5 text-xs text-muted-foreground",children:"No other queues yet."}),b.map(m=>(0,e.jsxs)("button",{type:"button",className:"flex w-full items-center justify-between rounded-sm px-2 py-1.5 text-left text-sm text-muted-foreground hover:bg-accent/50 hover:text-foreground",onClick:n(()=>{r(m.key),h(!1)},"onClick"),children:[(0,e.jsx)("span",{className:"truncate",children:m.title}),m.itemCount>0&&(0,e.jsx)("span",{className:"ml-2 shrink-0 text-(length:--text-nano) tabular-nums text-muted-foreground",children:m.itemCount})]},m.key)),(0,e.jsx)(lt,{}),(0,e.jsxs)("button",{type:"button",className:"flex w-full items-center gap-1.5 rounded-sm px-2 py-1.5 text-left text-sm text-muted-foreground hover:bg-accent/50 hover:text-foreground",onClick:n(()=>x(!0),"onClick"),children:[(0,e.jsx)(je,{className:"h-3.5 w-3.5"}),"New queue…"]})]})})]})}n(ot,"QueuePicker");function lt(){return(0,e.jsx)("div",{className:"my-1 h-px bg-border"})}n(lt,"DropdownMenuSeparatorLike");function dt({agents:s,disabled:t,disabledReason:o,onRoute:r}){const d=s.filter(a=>a.status!=="terminated");return(0,e.jsxs)(ze,{children:[(0,e.jsx)(ke,{asChild:!0,children:(0,e.jsxs)(g,{type:"button",variant:"outline",size:"xs",className:"h-7 gap-1",disabled:t||d.length===0,title:o,children:[(0,e.jsx)(Ds,{className:"h-3.5 w-3.5"}),"Ask agent for recommendation",(0,e.jsx)(ce,{className:"h-3 w-3"})]})}),(0,e.jsx)(Pe,{align:"start",className:"max-h-72 overflow-y-auto",children:d.map(a=>(0,e.jsx)(Te,{onClick:n(()=>r(a),"onClick"),children:a.name},a.id))})]})}n(dt,"AskAgentPicker");function _t({value:s,counts:t,onChange:o,everyone:r=!1,className:d}){return(0,e.jsx)(Fs,{value:s,onValueChange:n(a=>o(a),"onValueChange"),className:d,children:(0,e.jsx)($s,{variant:"line","aria-label":"Decision views",className:"p-0",children:Ls(r).map(a=>(0,e.jsxs)(fs,{value:a,"data-attention-view":a,children:[ps[a],a==="mine"?t.mine>0?(0,e.jsx)(de,{"data-attention-view-count":a,children:t.mine>99?"99+":t.mine}):null:(0,e.jsx)("span",{"data-attention-view-count":a,className:"text-xs tabular-nums text-muted-foreground",children:t[a]})]},a))})})}n(_t,"AttentionViewSwitch");function Et({count:s,onOpen:t}){return s<=0?null:(0,e.jsxs)("div",{role:"status","data-attention-unassigned-banner":!0,className:"flex flex-wrap items-center justify-between gap-2 rounded-lg border border-border bg-muted/40 px-3 py-2 text-sm",children:[(0,e.jsxs)("span",{className:"inline-flex items-center gap-2 text-foreground",children:[(0,e.jsx)(we,{className:"h-4 w-4 text-muted-foreground","aria-hidden":"true"}),Ss(s)]}),(0,e.jsxs)(g,{type:"button",variant:"ghost",size:"xs",onClick:t,children:["Open Unassigned",(0,e.jsx)(us,{className:"h-3 w-3"})]})]})}n(Et,"AttentionUnassignedBanner");function ct({item:s,currentUserId:t,userLabelMap:o,onClaim:r,claiming:d=!1,className:a}){const i=t?Us(s,t):null;if(!i)return null;const h=_("flex flex-wrap items-center gap-2 text-xs leading-5 text-muted-foreground",a),u=Ps(s,i,o);if(i.kind==="mine")return(0,e.jsxs)("p",{className:h,"data-attention-audience":"mine",children:[(0,e.jsx)("span",{className:"font-medium text-foreground",children:"Why me?"}),(0,e.jsxs)("span",{"data-attention-transferred-by":i.transferredByUserId,children:[i.transferredByUserId?`${i.text} @${o?.get(i.transferredByUserId)??"someone"}`:i.text,u?(0,e.jsxs)("span",{"data-attention-responders":!0,children:[". ",u]}):null]})]});if(i.kind==="other"){const c=o?.get(i.userId)??"another person";return(0,e.jsxs)("div",{className:h,"data-attention-audience":"other",children:[(0,e.jsxs)(de,{variant:"outline","data-attention-for-user":i.userId,children:[(0,e.jsx)(G,{"aria-hidden":"true"}),"For @",c]}),u?(0,e.jsx)("span",{"data-attention-responders":!0,children:u}):null]})}const x=r?bs(s):null;return(0,e.jsxs)("div",{className:h,"data-attention-audience":i.kind,children:[(0,e.jsx)("span",{children:Js(s,i,o)}),x?.kind==="none"?(0,e.jsx)("span",{"data-attention-no-claim":!0,children:Qs}):null,x?.kind==="assign"?(0,e.jsx)(g,{asChild:!0,variant:"outline",size:"xs",children:(0,e.jsxs)(B,{to:x.href,disableIssueQuicklook:!0,"data-attention-open-to-assign":!0,onClick:n(c=>c.stopPropagation(),"onClick"),children:[(0,e.jsx)(G,{className:"h-3 w-3"}),"Open to assign"]})}):null,i.claimable&&r?(0,e.jsxs)(g,{type:"button",variant:"outline",size:"xs",disabled:d,onClick:n(c=>{c.stopPropagation(),r(s)},"onClick"),children:[(0,e.jsx)(we,{className:"h-3 w-3"}),d?"Claiming…":"Claim"]}):null]})}n(ct,"AttentionAudienceLine");function Tt({receipts:s,userLabelMap:t,onDismiss:o,onOpen:r,dismissingId:d,className:a}){return s.length===0?null:(0,e.jsx)("section",{"aria-label":"Receipts","data-attention-receipts":!0,className:_("space-y-2",a),children:s.map(i=>{const h=i.href??i.issue?.href??null;return(0,e.jsxs)("div",{role:"status","data-attention-receipt":i.outcome,className:"flex items-start gap-3 rounded-lg border border-border bg-muted/40 px-3 py-2 text-sm",children:[(0,e.jsx)(Ms,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":"true"}),(0,e.jsxs)("div",{className:"min-w-0 flex-1 space-y-0.5",children:[(0,e.jsx)("p",{className:"font-medium text-foreground",children:cs(i,t)}),i.title?(0,e.jsx)("p",{className:"truncate text-muted-foreground",children:i.title}):null,i.reason?(0,e.jsxs)("p",{className:"text-muted-foreground",children:["Reason: ",i.reason]}):null,(0,e.jsxs)("p",{className:"text-xs text-muted-foreground",children:[i.issue?.identifier?`${i.issue.identifier} · `:null,(0,e.jsx)("time",{dateTime:i.createdAt,children:ms(i.createdAt)})]})]}),h&&r?(0,e.jsxs)(g,{type:"button",variant:"ghost",size:"xs",onClick:n(()=>r(h),"onClick"),children:["Open",(0,e.jsx)(Ee,{className:"h-3 w-3"})]}):null,(0,e.jsx)(g,{type:"button",variant:"ghost",size:"icon-xs","aria-label":"Dismiss receipt",disabled:d===i.id,onClick:n(()=>o(i),"onClick"),children:(0,e.jsx)(De,{className:"h-3 w-3"})})]},i.id)})})}n(Tt,"AttentionReceiptList");function ut({item:s,evidence:t,className:o}){return t?.length?(0,e.jsx)("ul",{"aria-label":"Part of this request","data-attention-obligation":s.obligationKey??void 0,className:_("space-y-1 border-l-2 border-border pl-3 text-xs leading-5 text-muted-foreground",o),children:t.map(r=>{const{title:d,detail:a}=As(r);return(0,e.jsxs)("li",{className:te,"data-attention-evidence":r.id,"data-attention-evidence-source":r.sourceKind,children:[(0,e.jsxs)("span",{className:"font-medium text-foreground",children:[zs(s,r),": "]}),r.subject.href?(0,e.jsxs)(B,{to:r.subject.href,className:"inline-flex items-center gap-1 hover:text-foreground",children:[d,(0,e.jsx)(Ee,{className:"h-3 w-3","aria-hidden":"true"})]}):(0,e.jsx)("span",{children:d}),a?(0,e.jsxs)("span",{children:[" — ",a]}):null]},r.id)})}):null}n(ut,"AttentionObligationEvidence");var xt={approve:"Review approved — issue marked done.",request_changes:"Changes requested — issue returned to the assignee.",send_back:"Sent back to work — issue returned to the assignee."};function mt({issueId:s,companyId:t,footerSlot:o,onResolved:r,reviewPolicy:d,approveLabel:a="Approve",presentation:i="panel",className:h}){const u=L(),{pushToast:x}=H(),[c,f]=(0,D.useState)(""),j=A({mutationFn:n(k=>J.decideStalledReview(s,{action:k,note:c.trim()?c.trim():void 0}),"mutationFn"),onSuccess:n((k,E)=>{u.invalidateQueries({queryKey:R.attention(t)}),u.invalidateQueries({queryKey:R.issues.detail(s)}),u.invalidateQueries({queryKey:R.issues.activity(s)}),f(""),x({title:xt[E],tone:"success"}),r?.(E)},"onSuccess"),onError:n(k=>{x({title:"Could not record the review decision",body:k instanceof Error?k.message:"Please try again.",tone:"error"})},"onError")}),p=j.isPending,b=c.trim().length===0,m=n(k=>p&&j.variables===k,"runningFor"),y=ls(d),N=i==="card",S=(0,e.jsxs)(g,{type:"button",variant:N?"ghost":"outline",size:"sm",className:N?void 0:"w-full sm:w-auto sm:flex-1 @xl:flex-none",disabled:p,onClick:n(()=>j.mutate("send_back"),"onClick"),"data-testid":"stalled-review-send-back",children:[m("send_back")?(0,e.jsx)(C,{className:"h-3.5 w-3.5 animate-spin","aria-hidden":!0}):N?null:(0,e.jsx)(Xs,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Send back to work"]}),l=(0,e.jsxs)(g,{type:"button",variant:"outline",size:"sm",className:N?void 0:"w-full border-amber-400/70 text-amber-900 hover:bg-amber-100 dark:border-amber-500/50 dark:text-amber-100 dark:hover:bg-amber-500/15 sm:w-auto sm:flex-1 @xl:flex-none",disabled:p||b,title:b?"Add a note to request changes":void 0,onClick:n(()=>j.mutate("request_changes"),"onClick"),"data-testid":"stalled-review-request-changes",children:[m("request_changes")?(0,e.jsx)(C,{className:"h-3.5 w-3.5 animate-spin","aria-hidden":!0}):N?null:(0,e.jsx)(Hs,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Request changes"]}),w=(0,e.jsxs)(g,{type:"button",size:"sm",className:N?void 0:"w-full sm:w-auto sm:flex-1 @xl:flex-none",disabled:p,onClick:n(()=>j.mutate("approve"),"onClick"),"data-testid":"stalled-review-approve",children:[m("approve")?(0,e.jsx)(C,{className:"h-3.5 w-3.5 animate-spin","aria-hidden":!0}):N?null:(0,e.jsx)(Ns,{className:"h-3.5 w-3.5","aria-hidden":!0}),a]});return(0,e.jsxs)("div",{className:_("flex flex-col gap-3",N&&"gap-4",h),children:[y?(0,e.jsxs)(de,{variant:"outline",className:"max-w-full min-w-0 self-start font-normal","data-testid":"review-policy-badge","data-review-policy":y.value,title:y.description,children:[(0,e.jsx)(y.Icon,{"aria-hidden":!0}),(0,e.jsx)("span",{className:"min-w-0 truncate",children:y.label})]}):null,(0,e.jsx)(Re,{value:c,onChange:n(k=>f(k.target.value),"onChange"),placeholder:"Add a note — required to request changes, optional otherwise…",className:"min-h-16 text-sm","data-testid":"stalled-review-note",disabled:p}),N?(0,e.jsxs)(oe,{leading:o,children:[S,l,w]}):(0,e.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center sm:justify-between",children:[o??(0,e.jsx)("span",{className:"hidden sm:block"}),(0,e.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-1 sm:flex-row sm:flex-wrap sm:items-center sm:justify-end @xl:flex-none",children:[S,l,w]})]})]})}n(mt,"StalledReviewActions");var Be="h-9 gap-1.5 px-3 text-sm @xl:h-6 @xl:gap-1 @xl:px-2 @xl:text-xs",qt=(0,D.memo)(n(function({item:t,companyId:o,expanded:r,onToggleExpand:d,onDismiss:a,onSnooze:i,onWithdraw:h,onTransfer:u,closing:x=!1,onRestore:c,agentMap:f,agents:j,showTriage:p=!1,currentUserId:b,userLabelMap:m,onClaim:y,claiming:N=!1,selected:S=!1,evidence:l}){const w=Gs(t.sourceKind),k=Rs(t),E=Fe(t),T=Os(t),F=t.subject.href,P=ws(t)??t.whyNow,q=ys(t),v=q.length>0,Y=t.relatedIssue?.href??F,ue=p,M=T||v||ue,xe=n(()=>{M&&d(t)},"activate"),Qe=n(z=>{M&&(z.key==="Enter"||z.key===" ")&&(z.preventDefault(),d(t))},"onHeaderKeyDown"),Ie=qs(t,b)===null?Le(t):[],W=He(t),Ve=Cs(t,b),me=!T&&!!F,Ue=v||T,X=M?(0,e.jsxs)("button",{type:"button",className:"inline-flex shrink-0 items-center gap-1 rounded-md text-xs font-medium text-muted-foreground hover:text-foreground focus-visible:ring-ring focus-visible:ring-(length:--rad-3) focus-visible:outline-none","aria-label":r?"Collapse decision":"Expand decision","aria-expanded":r,onClick:xe,children:[r?(0,e.jsx)(js,{className:"h-4 w-4"}):(0,e.jsx)(ce,{className:"h-4 w-4"}),r?"See less":"See more"]}):null,pe=n(({compact:z})=>{const he=Ie.length>0&&(z||!r);return!X&&!he&&!me?null:(0,e.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2","data-attention-actions":"true",children:[X??(0,e.jsx)("span",{}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2 @xl:justify-end",children:[he&&(0,e.jsx)(ht,{item:t,companyId:o,audience:W,onOpen:n(()=>d(t),"onOpen")}),me&&(0,e.jsx)(g,{asChild:!0,variant:"default",size:"xs",className:Be,children:(0,e.jsxs)(B,{to:F,children:["Open",(0,e.jsx)($e,{className:"h-3 w-3"})]})})]})]})},"renderFooter");return(0,e.jsxs)("div",{className:_("@container relative flex flex-col gap-4 overflow-hidden rounded-xl border border-border bg-card px-4 pt-3 pb-4","[content-visibility:auto] [contain-intrinsic-size:auto_104px]","motion-safe:transition-[opacity,transform,border-color,background-color] motion-safe:duration-200 motion-safe:ease-out hover:border-border/80",S&&"border-ring ring-1 ring-ring"),id:`attention-row-${t.id}`,"data-attention-row":!0,"data-attention-row-id":t.id,"data-attention-source":t.sourceKind,"data-attention-severity":t.severity,children:[(0,e.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,e.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-1",children:[(0,e.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-muted-foreground",children:[(0,e.jsx)(_s,{status:k,size:"md"}),w.label]}),E&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Q,{}),(0,e.jsx)(B,{to:E.href??"#",className:"font-mono text-(length:--text-nano) text-muted-foreground hover:text-foreground",onClick:n(z=>z.stopPropagation(),"onClick"),children:E.identifier})]}),t.decideBy&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Q,{}),(0,e.jsxs)("span",{className:"inline-flex items-center gap-1 text-(length:--text-nano) text-muted-foreground","data-attention-decide-by":t.decideBy,title:I(t)?`Set by ${I(t)}`:void 0,children:[(0,e.jsx)(Ae,{className:"h-3 w-3"}),qe(t.decideBy),I(t)&&(0,e.jsxs)("span",{className:"text-muted-foreground/80",children:["· set by ",I(t)]})]})]}),c&&t.dismissal?.isActive&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Q,{}),(0,e.jsx)(We,{item:t})]}),t.stale&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Q,{}),(0,e.jsx)(Ye,{item:t})]})]}),(0,e.jsxs)("div",{className:"flex shrink-0 items-center gap-1","data-attention-menu":"true",children:[(0,e.jsx)("span",{className:"text-(length:--text-nano) text-muted-foreground",children:Ks(t.activityAt)}),(0,e.jsx)(Ze,{item:t,currentUserId:b,userLabelMap:m,onWithdraw:h,onArchive:a,onSnooze:i,onTransfer:u,onRestore:c,busy:x})]})]}),(0,e.jsxs)("div",{className:_("min-w-0 rounded-md",M&&"cursor-pointer focus-visible:ring-ring focus-visible:ring-(length:--rad-3) focus-visible:outline-none"),...M?{role:"button",tabIndex:0,"aria-expanded":r,"aria-label":r?"Collapse decision":"Expand decision",onClick:xe,onKeyDown:Qe}:{},children:[(0,e.jsx)("span",{className:_("line-clamp-2 text-sm font-medium text-foreground",te),title:t.subject.title??void 0,children:t.subject.title??w.label}),(0,e.jsx)("p",{className:_("mt-0.5 line-clamp-2 text-xs text-muted-foreground",te),children:P})]}),(0,e.jsx)(ct,{item:t,currentUserId:b,userLabelMap:m,onClaim:y,claiming:N,className:"-mt-2"}),(0,e.jsx)(ut,{item:t,evidence:l}),Ue&&(0,e.jsx)(ge,{open:!r,className:"contents",children:(0,e.jsx)(fe,{"data-decision-disclosure":!0,className:"-mt-4",children:(0,e.jsxs)("div",{className:"flex flex-col gap-4 pt-4",children:[v&&(0,e.jsx)(jt,{images:q}),W&&!Ve&&(0,e.jsx)(Xe,{audience:W,variant:"compact"}),T&&pe({compact:!0})]})})}),(0,e.jsx)(ge,{open:r,onOpenChange:n(()=>d(t),"onOpenChange"),className:"contents",children:(0,e.jsx)(fe,{"data-decision-disclosure":!0,className:"-mt-4",children:(0,e.jsxs)("div",{className:"flex flex-col gap-4 pt-4",children:[v&&(0,e.jsx)(gt,{images:q,issueHref:Y}),ue&&(0,e.jsx)(it,{item:t,companyId:o,agents:j}),T&&(0,e.jsx)(Ge,{item:t,currentUserId:b,userLabelMap:m,children:(0,e.jsx)(bt,{item:t,companyId:o,agentMap:f,currentUserId:b,userLabelMap:m,toggle:X})})]})})}),!T&&pe({compact:!1})]})},"AttentionQueueRow"));function Q(){return(0,e.jsx)("span",{className:"text-xs text-muted-foreground","aria-hidden":!0,children:"·"})}n(Q,"EyebrowSeparator");function pt(s,t){return s.sourceKind==="approval"&&(t==="approve"||t==="reject"||t==="request_revision")||s.sourceKind==="join_request"&&(t==="approve"||t==="reject")||s.sourceKind==="issue_thread_interaction"&&s.subject.metadata?.kind==="request_confirmation"&&(t==="accept"||t==="reject")?t:null}n(pt,"compactDecisionAction");var ve={outline:0,destructive:1,default:2};function Le(s){return s.decisionVerbs.slice(0,3).flatMap(t=>{const o=pt(s,t.id);return o?[{action:o,label:t.label,id:t.id,description:t.description??""}]:[]}).sort((t,o)=>ve[ie(t)]-ve[ie(o)])}n(Le,"collectCompactActions");function ht({item:s,companyId:t,audience:o,onOpen:r}){const d=L(),{pushToast:a}=H(),i=Le(s),h=A({mutationFn:n(u=>{if(s.sourceKind==="approval")return u==="approve"?$.approve(s.subject.id):u==="reject"?$.reject(s.subject.id):$.requestRevision(s.subject.id);if(s.sourceKind==="join_request")return u==="approve"?U.approveJoinRequest(t,s.subject.id):U.rejectJoinRequest(t,s.subject.id);if(s.sourceKind==="issue_thread_interaction"){const x=s.subject.metadata?.issueId;if(typeof x!="string")throw new Error("Missing issue reference for this decision.");return u==="accept"?J.acceptInteraction(x,s.subject.id):J.rejectInteraction(x,s.subject.id)}throw new Error("This decision must be completed from its detail view.")},"mutationFn"),onSuccess:n((u,x)=>{le(d,t,s),a({title:ft(s.sourceKind,x),tone:"success"})},"onSuccess"),onError:n((u,x)=>{a({title:`Could not ${re(x)}`,body:Ts(u,o),tone:"error"})},"onError")});return i.length===0?null:(0,e.jsx)("div",{className:"flex w-full flex-wrap items-center gap-2 @xl:w-auto @xl:justify-end @xl:gap-1","aria-label":"Decision actions",children:i.map(({action:u,id:x,label:c,description:f})=>(0,e.jsxs)(g,{type:"button",variant:ie({id:x,label:c,description:f}),size:"xs",className:_(Be,"min-w-0 flex-1 @xl:flex-none"),disabled:h.isPending,onClick:n(j=>{if(j.stopPropagation(),s.sourceKind==="issue_thread_interaction"&&u==="reject"){r();return}h.mutate(u)},"onClick"),children:[h.isPending&&h.variables===u&&(0,e.jsx)(C,{className:"h-3 w-3 animate-spin"}),c]},x))})}n(ht,"CompactDecisionActions");function re(s){return s==="request_revision"?"sent for revision":s==="accept"||s==="approve"?"approved":"rejected"}n(re,"decisionLabel");function ft(s,t){return s==="approval"?`Approval ${re(t)}`:s==="join_request"?`Join request ${re(t)}`:t==="accept"?"Confirmation accepted":"Confirmation declined"}n(ft,"compactDecisionSuccessLabel");function ie(s){const t=`${s.label} ${s.description??""}`.toLowerCase();return/\b(reject|decline|deny|delete|remove)\b/.test(t)?"destructive":/\b(accept|approve|confirm|apply)\b/.test(t)?"default":"outline"}n(ie,"decisionVerbVariant");function jt({images:s}){const t=s.slice(0,3),o=s.length-t.length;return(0,e.jsxs)("div",{className:"flex shrink-0 items-center",children:[(0,e.jsx)("div",{className:"flex -space-x-3",children:t.map((r,d)=>(0,e.jsx)("img",{src:Se(r.assetId),alt:r.alt??"",loading:"lazy",style:{zIndex:t.length-d},className:"h-11 w-11 rounded-md border border-border bg-muted object-cover shadow-sm"},`${r.assetId}-${d}`))}),o>0&&(0,e.jsxs)("span",{className:"ml-1 inline-flex h-6 items-center rounded-md border border-border bg-muted px-1.5 text-(length:--text-nano) font-medium text-muted-foreground",children:["+",o]})]})}n(jt,"ThumbnailStack");function gt({images:s,issueHref:t}){const o=s.slice(0,3),r=s.length-o.length;return(0,e.jsxs)("div",{className:"flex flex-wrap items-stretch gap-2","data-attention-expanded-images":"true",children:[o.map((d,a)=>{const i=Se(d.assetId),h=`${d.assetId}-${a}`,u=(0,e.jsx)("img",{src:i,alt:d.alt??"",loading:"lazy",className:"h-32 w-44 rounded-md border border-border bg-muted object-cover shadow-sm"});return t?(0,e.jsx)(B,{to:t,disableIssueQuicklook:!0,className:"block rounded-md focus-visible:ring-ring focus-visible:ring-(length:--rad-3) focus-visible:outline-none",onClick:n(x=>x.stopPropagation(),"onClick"),children:u},h):(0,e.jsx)("span",{className:"block",children:u},h)}),r>0&&(t?(0,e.jsxs)(B,{to:t,disableIssueQuicklook:!0,onClick:n(d=>d.stopPropagation(),"onClick"),className:"flex h-32 w-24 flex-col items-center justify-center rounded-md border border-dashed border-border bg-muted/40 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-ring focus-visible:ring-(length:--rad-3) focus-visible:outline-none",children:[(0,e.jsxs)("span",{className:"text-base font-semibold",children:[r," more"]}),(0,e.jsxs)("span",{className:"mt-0.5 inline-flex items-center gap-1 text-(length:--text-nano)",children:["View issue",(0,e.jsx)($e,{className:"h-3 w-3"})]})]}):(0,e.jsxs)("span",{className:"flex h-32 w-24 items-center justify-center rounded-md border border-dashed border-border bg-muted/40 text-sm font-semibold text-muted-foreground",children:[r," more"]}))]})}n(gt,"ExpandedImages");function I(s){const t=s.decideByAttribution;return t?t.type==="agent"?t.agentName??"an agent":"you":null}n(I,"decideByProvenance");function bt({item:s,companyId:t,agentMap:o,currentUserId:r,userLabelMap:d,toggle:a}){if(s.sourceKind==="decision")return(0,e.jsx)(es,{companyId:t,decisionId:s.subject.id,originIssue:s.relatedIssue,agentMap:o});if(s.sourceKind==="issue_thread_interaction"){const i=s.subject.metadata?.issueId??s.relatedIssue?.id;return i?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(ss,{companyId:t,issueId:i,interactionId:s.subject.id,agentMap:o,currentUserId:r,userLabelMap:d}),a&&(0,e.jsx)("div",{className:"flex items-center",children:a})]}):(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:"Missing issue reference for this decision."})}return s.sourceKind==="approval"?(0,e.jsx)(vt,{item:s,companyId:t,toggle:a}):s.sourceKind==="join_request"?(0,e.jsx)(Nt,{item:s,companyId:t,toggle:a}):s.sourceKind==="failed_run"?(0,e.jsx)(Ws,{item:s,companyId:t,leading:a}):s.sourceKind==="budget_alert"?(0,e.jsx)(Ys,{item:s,companyId:t,leading:a}):s.sourceKind==="review"?(0,e.jsx)(mt,{issueId:s.subject.id,companyId:t,footerSlot:a,reviewPolicy:rs(s.subject.metadata)}):null}n(bt,"InlineResolver");function Me({toggle:s,children:t}){return(0,e.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2","data-attention-actions":"true",children:[s??(0,e.jsx)("span",{}),(0,e.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:t})]})}n(Me,"ResolverFooter");function vt({item:s,companyId:t,toggle:o,onResolved:r,shareDraft:d=!1,presentation:a="panel",artifactRow:i,onViewDetails:h,footerContext:u}){const x=L(),[c,f]=(0,D.useState)(null),j=n(v=>f(v instanceof Error?v.message:"The decision could not be saved."),"onError"),p=d?as(`approval:${s.subject.id}`,s.updatedAt):null,[b,m]=ns(p),[y,N]=(0,D.useState)(""),S=p?b.reason:y,l=n(v=>p?m({reason:v}):N(v),"setNote"),w=n(()=>{p&&os(p),le(x,t,s),r?.()},"invalidate"),k=n((v,Y)=>async()=>{if(p&&!ts(p,v))throw new Error("This approval is already being sent.");try{return await Y(S.trim()||void 0)}finally{p&&is(p)}},"send"),E=A({mutationFn:k("accept",v=>$.approve(s.subject.id,v)),onSuccess:w,onMutate:n(()=>f(null),"onMutate"),onError:j}),T=A({mutationFn:k("reject",v=>$.reject(s.subject.id,v)),onSuccess:w,onMutate:n(()=>f(null),"onMutate"),onError:j}),F=A({mutationFn:k("revise",v=>$.requestRevision(s.subject.id,v)),onSuccess:w,onMutate:n(()=>f(null),"onMutate"),onError:j}),P=E.isPending?"accept":T.isPending?"reject":F.isPending?"revise":b.working,q=P!==null;if(a==="card"){const v=s.subject.metadata?.type==="hire_agent";return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(st,{item:s,companyId:t,artifactRow:i,onViewDetails:h}),u,c?(0,e.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:c}):null,(0,e.jsxs)(oe,{leading:o,children:[h?(0,e.jsx)(g,{size:"sm",variant:"ghost",onClick:h,children:v?"View configuration":"View details"}):null,(0,e.jsxs)(g,{size:"sm",variant:"outline",onClick:n(()=>T.mutate(),"onClick"),disabled:q,children:[P==="reject"&&(0,e.jsx)(C,{className:"h-3.5 w-3.5 animate-spin"}),"Reject"]}),(0,e.jsxs)(g,{size:"sm",onClick:n(()=>E.mutate(),"onClick"),disabled:q,children:[P==="accept"&&(0,e.jsx)(C,{className:"h-3.5 w-3.5 animate-spin"}),v?"Approve hire":"Approve"]})]})]})}return(0,e.jsxs)(e.Fragment,{children:[c?(0,e.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:c}):null,(0,e.jsx)(Re,{value:S,onChange:n(v=>l(v.target.value),"onChange"),placeholder:"Optional decision note…",className:"min-h-16 text-sm",disabled:q}),(0,e.jsxs)(Me,{toggle:o,children:[(0,e.jsxs)(g,{size:"sm",variant:"outline",onClick:n(()=>F.mutate(),"onClick"),disabled:q,children:[P==="revise"&&(0,e.jsx)(C,{className:"h-3.5 w-3.5 animate-spin"}),"Request revision"]}),(0,e.jsxs)(g,{size:"sm",variant:"destructive",onClick:n(()=>T.mutate(),"onClick"),disabled:q,children:[P==="reject"&&(0,e.jsx)(C,{className:"h-3.5 w-3.5 animate-spin"}),"Reject"]}),(0,e.jsxs)(g,{size:"sm",onClick:n(()=>E.mutate(),"onClick"),disabled:q,children:[P==="accept"&&(0,e.jsx)(C,{className:"h-3.5 w-3.5 animate-spin"}),"Approve"]})]})]})}n(vt,"ApprovalResolver");function Nt({item:s,companyId:t,toggle:o,onResolved:r,presentation:d="panel"}){const a=L(),[i,h]=(0,D.useState)(null),u=n(p=>h(p instanceof Error?p.message:"The join request could not be saved."),"onError"),x=n(()=>{le(a,t,s),r?.()},"invalidate"),c=A({mutationFn:n(()=>U.approveJoinRequest(t,s.subject.id),"mutationFn"),onSuccess:x,onMutate:n(()=>h(null),"onMutate"),onError:u}),f=A({mutationFn:n(()=>U.rejectJoinRequest(t,s.subject.id),"mutationFn"),onSuccess:x,onMutate:n(()=>h(null),"onMutate"),onError:u}),j=c.isPending||f.isPending;if(d==="card"){const p=s.subject.metadata?.requestType==="agent",b=typeof s.subject.metadata?.adapterType=="string"?s.subject.metadata.adapterType:null;return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(V,{children:[(0,e.jsx)(se,{icon:p?(0,e.jsx)(vs,{}):(0,e.jsx)(G,{}),title:s.subject.title??"Join request",meta:p?["Agent access",b?Ke(b):null].filter(Boolean).join(" · "):"Member access"}),(0,e.jsx)(ee,{children:p?"Approval adds this agent to the company.":"Approval adds them to the company as a member."})]}),i?(0,e.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:i}):null,(0,e.jsxs)(oe,{leading:o,children:[(0,e.jsxs)(g,{size:"sm",variant:"ghost",onClick:n(()=>f.mutate(),"onClick"),disabled:j,children:[f.isPending&&(0,e.jsx)(C,{className:"h-3.5 w-3.5 animate-spin"}),"Decline"]}),(0,e.jsxs)(g,{size:"sm",onClick:n(()=>c.mutate(),"onClick"),disabled:j,children:[c.isPending&&(0,e.jsx)(C,{className:"h-3.5 w-3.5 animate-spin"}),"Approve access"]})]})]})}return(0,e.jsxs)(e.Fragment,{children:[i?(0,e.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:i}):null,(0,e.jsxs)(Me,{toggle:o,children:[(0,e.jsxs)(g,{size:"sm",variant:"destructive",onClick:n(()=>f.mutate(),"onClick"),disabled:j,children:[f.isPending&&(0,e.jsx)(C,{className:"h-3.5 w-3.5 animate-spin"}),"Reject"]}),(0,e.jsxs)(g,{size:"sm",onClick:n(()=>c.mutate(),"onClick"),disabled:j,children:[c.isPending&&(0,e.jsx)(C,{className:"h-3.5 w-3.5 animate-spin"}),"Approve"]})]})]})}n(Nt,"JoinRequestResolver");export{vt as ApprovalResolver,qt as AttentionQueueRow,Nt as JoinRequestResolver,_t as a,Et as i,ut as n,Tt as r,mt as t};
@@ -0,0 +1 @@
1
+ var W=Object.defineProperty;var r=(t,i)=>W(t,"name",{value:i,configurable:!0});import{a as H,n as Y}from"./rolldown-runtime-DhZMWcEn.js";import{t as q}from"./Costs-DhuNxwSj.js";import{n as Z,t as J}from"./AuditRuns-DqizHgX1.js";import{$A as X,AT as ee,Ap as b,BC as te,Di as se,GS as _,Gb as T,H_ as ae,IC as ne,Kr as L,LS as re,NE as C,Np as z,Op as D,Pp as F,Sw as K,UT as M,Yb as ie,__ as le,fy as oe,gs as ce,hE as O,hs as de,iD as me,ib as ue,kT as ge,ki as xe,kp as U,lw as he,ly as pe,ms as $,my as fe,nj as je,oE as V,on as G,rb as ye,sy as ve,uE as B,uy as be,x as Ce,xE as P}from"./index-Bt31d8ga.js";import{t as Ne}from"./RoutineAuditActivity-sKyzMajz.js";import{t as ke}from"./Timeline-BNMoRbtK.js";var g=H(je(),1),Q={list(t,i,c){const d=new URLSearchParams;for(const[m,a]of Object.entries(i))a!==void 0&&a!==""&&d.set(m,String(a));return B.get(`/companies/${t}/agent-commentary?${d}`,{signal:c})},get:r((t,i,c)=>B.get(`/companies/${t}/agent-commentary/${encodeURIComponent(i)}`,{signal:c}),"get")},e=H(X(),1),I=50,j="all";function E({kind:t}){return(0,e.jsxs)(ae,{variant:"outline",className:"gap-1.5 font-normal",children:[(0,e.jsx)(t==="suggestion"?K:he,{className:"size-3"}),t==="suggestion"?"Suggestion":"Complaint"]})}r(E,"MessageKind");function Se({entry:t,onOpen:i}){return(0,e.jsx)("li",{children:(0,e.jsxs)("button",{type:"button",onClick:r(c=>i(c.currentTarget),"onClick"),"aria-label":`Read ${t.kind} from ${t.agent.name}`,className:"group flex w-full flex-col gap-2 rounded-md px-3 py-4 text-left transition-colors hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring md:grid md:grid-cols-12 md:items-start md:gap-4",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between gap-3 md:col-span-2",children:[(0,e.jsx)(L,{agent:t.agent,size:"sm"}),(0,e.jsx)("span",{className:"md:hidden",children:(0,e.jsx)(E,{kind:t.kind})})]}),(0,e.jsx)("div",{className:"hidden md:col-span-2 md:block",children:(0,e.jsx)(E,{kind:t.kind})}),(0,e.jsxs)("div",{className:"flex min-w-0 flex-col gap-2 md:col-span-6",children:[(0,e.jsxs)("p",{className:"line-clamp-2 whitespace-pre-line break-words text-sm leading-relaxed text-foreground",children:[t.preview.trim(),t.preview.length>=280?"…":""]}),t.task&&(0,e.jsxs)("span",{className:"truncate text-xs text-muted-foreground",children:[(0,e.jsx)("span",{className:"font-mono",children:t.task.identifier??"Task"})," · ",t.task.title]})]}),(0,e.jsx)("time",{dateTime:t.createdAt,title:new Date(t.createdAt).toLocaleString(),className:"font-mono text-xs text-muted-foreground md:col-span-2 md:text-right",children:me(t.createdAt)})]})})}r(Se,"CommentaryRow");function we({companyId:t,id:i,onClose:c,triggerRef:d}){const m=P({queryKey:_.agentCommentary.detail(t,i),queryFn:r(({signal:n})=>Q.get(t,i,n),"queryFn"),enabled:i!==null}),a=m.data;return(0,e.jsx)(ve,{open:i!==null,onOpenChange:r(n=>{n||c()},"onOpenChange"),children:(0,e.jsxs)(pe,{className:"flex max-h-(--sz-85vh) flex-col gap-5 sm:max-w-3xl",onCloseAutoFocus:r(n=>{d.current?.isConnected&&(n.preventDefault(),d.current.focus())},"onCloseAutoFocus"),children:[(0,e.jsxs)(oe,{className:"shrink-0 pr-6",children:[(0,e.jsx)(fe,{children:a?.kind==="complaint"?"Complaint":a?"Suggestion":"Commentary"}),(0,e.jsx)(be,{children:a?`Submitted ${new Date(a.createdAt).toLocaleString()}`:"Message details and source context."})]}),m.isPending?(0,e.jsx)("p",{role:"status",className:"text-sm text-muted-foreground",children:"Loading message…"}):m.error?(0,e.jsxs)("div",{role:"alert",className:"flex flex-col items-start gap-3",children:[(0,e.jsx)("p",{className:"text-sm text-destructive",children:O(m.error).body}),(0,e.jsx)(C,{variant:"outline",size:"sm",onClick:r(()=>{m.refetch()},"onClick"),children:"Try again"})]}):a?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"flex shrink-0 flex-wrap items-center gap-3",children:[(0,e.jsx)(T,{to:`/agents/${a.agent.id}`,children:(0,e.jsx)(L,{agent:a.agent,size:"sm"})}),(0,e.jsx)(E,{kind:a.kind})]}),(0,e.jsx)("div",{className:"min-h-0 overflow-y-auto overscroll-contain break-words pr-2",children:(0,e.jsx)(Ce,{children:a.body})}),(0,e.jsxs)("div",{className:"flex shrink-0 flex-wrap items-center gap-4 border-t border-border pt-4 text-sm",children:[a.task&&(0,e.jsxs)(T,{to:`/issues/${a.task.identifier??a.task.id}`,className:"inline-flex items-center gap-1.5 text-muted-foreground hover:text-foreground",children:[(0,e.jsx)("span",{className:"font-mono",children:a.task.identifier??"Source task"}),(0,e.jsx)(M,{className:"size-3.5"})]}),(0,e.jsxs)(T,{to:`/agents/${a.agent.id}/runs/${a.runId}`,className:"inline-flex items-center gap-1.5 text-muted-foreground hover:text-foreground",children:["View run",(0,e.jsx)(M,{className:"size-3.5"})]})]})]}):null]})})}r(we,"CommentaryDetail");function Ae({companyId:t}){const[i,c]=V(),d=i.get("q")??"",m=i.get("agentId")??j,a=i.get("kind")==="suggestion"||i.get("kind")==="complaint"?i.get("kind"):void 0,n=Math.min(1e5,Math.max(0,Math.floor(Number(i.get("offset"))||0))),w=i.get("entry")||null,[p,y]=(0,g.useState)(d),N=(0,g.useRef)(null),x=(0,g.useCallback)(s=>{c(l=>{const h=new URLSearchParams(l);h.delete("offset"),h.delete("entry");for(const[R,A]of Object.entries(s))!A||A===j?h.delete(R):h.set(R,A);return h},{replace:!0})},[c]);(0,g.useEffect)(()=>y(d),[d]),(0,g.useEffect)(()=>{if(p===d)return;const s=window.setTimeout(()=>x({q:p}),250);return()=>window.clearTimeout(s)},[p,d,x]);function k(s){c(l=>{const h=new URLSearchParams(l);return s?h.set("entry",s):h.delete("entry"),h},{replace:s===null})}r(k,"selectEntry");const S={q:d||void 0,agentId:m===j?void 0:m,kind:a,offset:n,limit:I},u=P({queryKey:_.agentCommentary.list(t,S),queryFn:r(({signal:s})=>Q.list(t,S,s),"queryFn")}),v=P({queryKey:_.agents.list(t),queryFn:r(()=>ye.list(t),"queryFn")}),f=!!(d||m!==j||a),o=r(()=>x({q:"",agentId:"",kind:""}),"clearFilters");return(0,e.jsxs)("section",{className:"flex flex-col gap-5","aria-label":"Commentary",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,e.jsx)("h2",{className:"text-lg font-semibold",children:"Commentary"}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Suggestions and complaints from your agents."})]}),(0,e.jsxs)("div",{"data-canonical-toolbar":"audit-commentary",role:"toolbar","aria-label":"Commentary filters",className:"flex flex-wrap items-center gap-2",children:[(0,e.jsxs)("div",{className:"relative min-w-48 flex-1 sm:max-w-sm",children:[(0,e.jsx)(ne,{className:"pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"}),(0,e.jsx)(le,{"aria-label":"Search commentary",placeholder:"Search messages…",maxLength:200,value:p,onChange:r(s=>y(s.target.value),"onChange"),className:"pl-9"})]}),(0,e.jsxs)(D,{value:m,onValueChange:r(s=>x({agentId:s}),"onValueChange"),children:[(0,e.jsx)(z,{"aria-label":"Filter by agent",className:"min-w-40",children:(0,e.jsx)(F,{placeholder:"All agents"})}),(0,e.jsxs)(U,{children:[(0,e.jsx)(b,{value:j,children:"All agents"}),v.data?.map(s=>(0,e.jsx)(b,{value:s.id,children:(0,e.jsx)(L,{agent:s,size:"xs"})},s.id))]})]}),(0,e.jsxs)(D,{value:a??j,onValueChange:r(s=>x({kind:s}),"onValueChange"),children:[(0,e.jsx)(z,{"aria-label":"Filter by message type",className:"min-w-36",children:(0,e.jsx)(F,{})}),(0,e.jsxs)(U,{children:[(0,e.jsx)(b,{value:j,children:"All types"}),(0,e.jsx)(b,{value:"suggestion",children:"Suggestions"}),(0,e.jsx)(b,{value:"complaint",children:"Complaints"})]})]}),f&&(0,e.jsx)(C,{variant:"ghost",size:"sm",onClick:o,children:"Clear filters"})]}),v.error&&(0,e.jsxs)("p",{role:"alert",className:"text-sm text-destructive",children:["Could not load agent filters. ",(0,e.jsx)("button",{type:"button",className:"underline",onClick:r(()=>{v.refetch()},"onClick"),children:"Try again"})]}),u.isPending?(0,e.jsx)("p",{role:"status",className:"py-12 text-center text-sm text-muted-foreground",children:"Loading commentary…"}):u.error?(0,e.jsxs)("div",{role:"alert",className:"flex flex-col items-center gap-3 py-12",children:[(0,e.jsx)("p",{className:"text-sm text-destructive",children:O(u.error).body}),(0,e.jsx)(C,{variant:"outline",size:"sm",onClick:r(()=>{u.refetch()},"onClick"),children:"Try again"})]}):u.data?.items.length===0?(0,e.jsx)(G,{icon:K,message:n>0?"No messages on this page.":f?"No messages match these filters.":"No agent commentary yet.",description:n>0?"Return to the newest messages.":f?"Try another agent, message type, or search.":"Suggestions and complaints will appear here when agents submit them.",action:n>0?"Back to latest":f?"Clear filters":void 0,onAction:n>0?()=>x({offset:""}):f?o:void 0,hideActionIcon:!0}):u.data?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{"aria-hidden":"true",className:"hidden grid-cols-12 gap-4 border-b border-border px-3 pb-3 text-xs font-medium text-muted-foreground md:grid",children:[(0,e.jsx)("span",{className:"col-span-2",children:"Agent"}),(0,e.jsx)("span",{className:"col-span-2",children:"Type"}),(0,e.jsx)("span",{className:"col-span-6",children:"Message"}),(0,e.jsx)("span",{className:"col-span-2 text-right",children:"Submitted"})]}),(0,e.jsx)("ul",{"aria-label":"Commentary messages",className:"divide-y divide-border",children:u.data.items.map(s=>(0,e.jsx)(Se,{entry:s,onOpen:r(l=>{N.current=l,k(s.id)},"onOpen")},s.id))})]}),(0,e.jsxs)("div",{className:"flex items-center justify-between gap-3 border-t border-border pt-4",children:[(0,e.jsxs)("p",{role:"status",className:"font-mono text-xs text-muted-foreground",children:[n+1,"–",n+u.data.items.length," of ",u.data.total," messages"]}),(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsxs)(C,{variant:"outline",size:"sm","aria-label":"Previous page",disabled:n===0,onClick:r(()=>x({offset:String(Math.max(0,n-I))}),"onClick"),children:[(0,e.jsx)(ee,{className:"size-4"}),"Previous"]}),(0,e.jsxs)(C,{variant:"outline",size:"sm","aria-label":"Next page",disabled:n+u.data.items.length>=u.data.total,onClick:r(()=>x({offset:String(n+I)}),"onClick"),children:["Next",(0,e.jsx)(ge,{className:"size-4"})]})]})]})]}):null,(0,e.jsx)(we,{companyId:t,id:w,onClose:r(()=>k(null),"onClose"),triggerRef:N},t)]})}r(Ae,"AgentCommentary");var ze=Y({AuditHub:r(()=>Te,"AuditHub")});function Te({section:t}){const i=ie(),{selectedCompanyId:c}=re(),{setBreadcrumbs:d}=ue(),[m,a]=V(),n=de(m),w=n.mode==="agents"?"agents":"all",p=n.entityType==="routine"?n.entityId??void 0:void 0,y=m.get("action"),N=["issue.","case.","agent.","heartbeat.","approval.","project.","goal.","tool_","cost.","company."].includes(y??"")?y:"__all";(0,g.useEffect)(()=>{const o=$.find(s=>s.value===t);d([{label:"Audit",href:t==="activity"?void 0:"/activity"},...t==="activity"||!o?[]:[{label:o.label}]])},[t,d]);const x=(0,g.useCallback)(o=>{a(s=>{const l=new URLSearchParams(s);return o==="agents"?l.set("mode","agents"):l.delete("mode"),l},{replace:!0})},[a]),k=(0,g.useCallback)(o=>{a(s=>{const l=new URLSearchParams(s);return o==="__all"?l.delete("action"):l.set("action",o),l},{replace:!0})},[a]),S=(0,g.useCallback)(o=>{a(s=>{const l=new URLSearchParams(s);return o==="__all"?l.delete("entityType"):l.set("entityType",o),l.delete("entityId"),l},{replace:!0})},[a]),u=(0,g.useCallback)(o=>{a(s=>{const l=new URLSearchParams(s);return o.trim()?l.set("entityId",o):l.delete("entityId"),l},{replace:!0})},[a]),v=(0,g.useCallback)(()=>{a(o=>{const s=new URLSearchParams(o);return s.delete("action"),s.delete("entityType"),s.delete("entityId"),s},{replace:!0})},[a]),f=(0,g.useCallback)(o=>{i(ce(o,n))},[i,n]);return c?(0,e.jsxs)("div",{className:"min-w-0 max-w-full space-y-6",children:[(0,e.jsx)("div",{children:(0,e.jsx)("h1",{className:"text-3xl font-semibold tracking-tight text-foreground",children:"Audit"})}),(0,e.jsx)(xe,{value:t,onValueChange:f,children:(0,e.jsx)(se,{items:$,value:t,onValueChange:f,align:"start"})}),t==="commentary"?(0,e.jsx)(Ae,{companyId:c},c):t==="activity"&&p?(0,e.jsx)(Ne,{companyId:c,routineId:p}):t==="activity"?(0,e.jsx)(Z,{companyId:c,hideHeader:!0,mode:w,onModeChange:x,actionDomain:N,onActionDomainChange:k,entityType:n.entityType??"__all",onEntityTypeChange:S,entityId:n.entityId??"",onEntityIdChange:u,onClearFilters:v,lockedAgentId:n.agentId??void 0,lockedRunId:n.runId??void 0,lockedEntity:n.entityType&&n.entityId?{type:n.entityType,id:n.entityId}:void 0}):t==="runs"?(0,e.jsx)(J,{companyId:c,routineId:p}):t==="budgets"?(0,e.jsx)(q,{embedded:!0,initialTab:"budgets",lockTab:!0}):t==="timeline"?(0,e.jsx)(ke,{embedded:!0}):(0,e.jsx)(q,{embedded:!0,initialTab:"overview",hideBudgetsTab:!0})]}):(0,e.jsx)(G,{icon:te,message:"Select an organization to view Audit."})}r(Te,"AuditHub");export{ze as n,Te as t};
@@ -0,0 +1 @@
1
+ var Je=Object.defineProperty;var r=(t,a)=>Je(t,"name",{value:a,configurable:!0});import{a as ke}from"./rolldown-runtime-DhZMWcEn.js";import{a as We,i as Ie,o as Xe}from"./issue-detail-4PCbYpdv.js";import{C as et,b as Ue}from"./collections-BxrcELwt.js";import{t as tt}from"./scroll-text-Ck6HB7eM.js";import{$A as st,Ap as v,E_ as ie,GS as I,Gb as E,Jb as De,Kv as at,Mb as Ee,Mi as Ce,NE as V,Np as k,O_ as re,Op as U,Pp as D,QT as nt,Um as it,ZT as $e,__ as he,ab as fe,ay as rt,cv as lt,f_ as ot,hE as ct,iD as ye,jC as dt,jb as ut,ji as mt,ki as xt,kp as $,nj as pt,oE as ht,on as Fe,pE as gt,rS as ft,rT as yt,rb as Le,uE as jt,ub as ge,vE as vt,xE as F,zE as bt}from"./index-Bt31d8ga.js";import{i as Nt,n as At}from"./googleAccessRemoval-CQIi1dvu.js";var Me={name:"circle-dot-dashed",size:24,node:[["path",{d:"M10.1 2.18a9.93 9.93 0 0 1 3.8 0",key:"1qdqn0"}],["path",{d:"M17.6 3.71a9.95 9.95 0 0 1 2.69 2.7",key:"1bq7p6"}],["path",{d:"M21.82 10.1a9.93 9.93 0 0 1 0 3.8",key:"1rlaqf"}],["path",{d:"M20.29 17.6a9.95 9.95 0 0 1-2.7 2.69",key:"1xk03u"}],["path",{d:"M13.9 21.82a9.94 9.94 0 0 1-3.8 0",key:"l7re25"}],["path",{d:"M6.4 20.29a9.95 9.95 0 0 1-2.69-2.7",key:"1v18p6"}],["path",{d:"M2.18 13.9a9.93 9.93 0 0 1 0-3.8",key:"xdo6bj"}],["path",{d:"M3.71 6.4a9.95 9.95 0 0 1 2.7-2.69",key:"1jjmaz"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]};Me.node;var wt=nt(Me),u=ke(pt(),1);function Re(t){const a=new URLSearchParams;return t.actorScope&&a.set("actorScope",t.actorScope),t.agentId&&a.set("agentId",t.agentId),t.responsibleUserId&&a.set("responsibleUserId",t.responsibleUserId),t.runId&&a.set("runId",t.runId),t.entityType&&a.set("entityType",t.entityType),t.entityId&&a.set("entityId",t.entityId),t.action&&a.set("action",t.action),t.from&&a.set("from",t.from),t.to&&a.set("to",t.to),t.actorType&&a.set("actorType",t.actorType),t.cursor&&a.set("cursor",t.cursor),t.limit!=null&&a.set("limit",String(t.limit)),a}r(Re,"buildAuditQuery");var _e={listAgentActions:r((t,a={})=>{const n=Re(a).toString();return jt.get(`/companies/${t}/audit/agent-actions${n?`?${n}`:""}`)},"listAgentActions"),exportAgentActionsCsv:r(async(t,a={})=>{const n=Re(a).toString(),l=await fetch(`/api/companies/${t}/audit/agent-actions.csv${n?`?${n}`:""}`,{credentials:"include",headers:{Accept:"text/csv"}});if(!l.ok){const d=await l.json().catch(()=>null),h=vt.recoverIfNeeded(l.status,d);if(h)return h;const o=d?.error??`Export failed: ${l.status}`;throw new Error(o)}return l.blob()},"exportAgentActionsCsv")},e=ke(st(),1),St=50,c="__all",Tt=[{value:c,label:"All actions"},{value:"issue.",label:"Tasks"},{value:"case.",label:"Cases"},{value:"agent.",label:"Agents"},{value:"heartbeat.",label:"Runs"},{value:"approval.",label:"Approvals"},{value:"project.",label:"Projects"},{value:"goal.",label:"Goals"},{value:"tool_",label:"Apps & tools"},{value:"cost.",label:"Costs"},{value:"company.",label:"Organization"}],It=[{value:c,label:"All entities"},{value:"issue",label:"Task"},{value:"case",label:"Case"},{value:"agent",label:"Agent"},{value:"heartbeat_run",label:"Run"},{value:"routine",label:"Routine"},{value:"project",label:"Project"},{value:"goal",label:"Goal"},{value:"company",label:"Organization"},{value:"tool_connection",label:"Connection"}];function Et(t){if(!t)return;const a=new Date(`${t}T00:00:00.000Z`);return Number.isNaN(a.getTime())?void 0:a.toISOString()}r(Et,"toStartIso");function Ct(t){if(!t)return;const a=new Date(`${t}T23:59:59.999Z`);return Number.isNaN(a.getTime())?void 0:a.toISOString()}r(Ct,"toEndIso");function Rt({record:t,agentMap:a,userProfileMap:n}){const l=t.agentId??(t.actorType==="agent"?t.actorId:null),d=l?a.get(l):null;if(d)return(0,e.jsxs)("span",{className:"inline-flex min-w-0 items-center gap-1.5",title:d.name,children:[(0,e.jsx)(ut,{agent:d,size:20}),(0,e.jsx)("span",{className:"truncate font-medium text-foreground",children:d.name})]});if(t.actorType==="user"&&t.actorId){const o=n.get(t.actorId);return(0,e.jsx)(Ee,{name:o?.label??"User",avatarUrl:o?.image??null,size:"sm",className:"font-medium text-foreground"})}const h=t.actorType==="plugin"?"Plugin":t.actorType==="agent"?"Agent":t.actorType==="user"?"User":"System";return(0,e.jsx)(Ee,{name:h,size:"sm",className:"font-medium text-foreground"})}r(Rt,"AuditActor");function _t({record:t}){const a=De();if(t.entityType==="case"){const o=t.entity.case;return(0,e.jsx)(E,{to:a(o?.identifier??t.entityId),className:"font-medium text-primary hover:underline",children:o?`${o.identifier} · ${o.title}`:"the case"})}const{issue:n,document:l}=t.entity,d=n?.identifier??n?.id??null;if(d)return(0,e.jsx)(E,{to:`/issues/${d}`,className:"font-medium text-primary hover:underline",children:n?.identifier?`${n.identifier}${n.title?` · ${n.title}`:""}`:"the task"});if(l)return(0,e.jsx)("span",{className:"font-medium text-foreground",children:l.key});const h=t.entityType==="tool_connection"?t.entityId:typeof t.details?.connectionId=="string"?t.details.connectionId:null;return h?(0,e.jsx)(E,{to:`/apps/${h}/permissions`,className:"font-medium text-primary hover:underline",children:Ie("tool_connection",t.details)}):(0,e.jsx)("span",{className:"text-muted-foreground",children:Ie(t.entityType,t.details)})}r(_t,"AuditEntityNode");function kt(t){return t.action==="tool_connection.archived"||t.action==="tool_connection.grant_revoked"?(Nt(t.details?.providerAccess,t.action==="tool_connection.grant_revoked"?"credentials":"connection")??At(t.details?.signInRemoval))?.body??null:We(t.action,t.details)}r(kt,"auditOutcome");function Ut({record:t,agentMap:a,userProfileMap:n,casesEnabled:l}){const d=Xe(t.action,t.details,{agentMap:a,userProfileMap:n}),h=kt(t),o=t.responsibleUserId?n.get(t.responsibleUserId):null,y=!!(t.responsibleUserId&&!(t.actorType==="user"&&t.actorId===t.responsibleUserId)),b=o?.label??(t.responsibleUserId?"a user":null),j=t.entity.comment?.excerpt?.trim(),A=t.entity.issue&&t.entity.document?t.entity.document.key:null,x=l&&t.action.startsWith("case.handoff_")?t.details?.workflowTransition:null;return(0,e.jsx)("li",{className:"px-4 py-3 text-sm",children:(0,e.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,e.jsxs)("div",{className:"min-w-0 space-y-1",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-x-1.5 gap-y-1 text-foreground",children:[(0,e.jsx)(Rt,{record:t,agentMap:a,userProfileMap:n}),(0,e.jsx)("span",{className:"text-muted-foreground",children:d}),(0,e.jsx)(_t,{record:t})]}),h?(0,e.jsx)("p",{className:"text-muted-foreground",children:h}):null,j?(0,e.jsxs)("p",{className:"line-clamp-2 border-l-2 border-border pl-2 text-muted-foreground",children:["“",j,"”"]}):null,x?.from&&x?.to?(0,e.jsxs)("p",{className:"text-xs text-muted-foreground",children:[x.from.name??"Case instructions",x.from.phase?` · ${x.from.phase}`:""," → ",x.to.name??"Case instructions"," · ",x.to.phase]}):null,A?(0,e.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Document ",(0,e.jsx)("span",{className:"font-mono text-(length:--text-micro)",children:A})]}):null,(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[y&&b?(0,e.jsxs)("span",{className:"inline-flex items-center rounded-full bg-muted px-2 py-0.5",children:["on behalf of ",b]}):null,t.runId&&t.agentId?(0,e.jsx)(E,{to:`/agents/${t.agentId}/runs/${t.runId}`,className:"text-primary hover:underline",children:"View run"}):null,(0,e.jsx)("span",{className:"font-mono text-(length:--text-micro) opacity-70",children:t.action})]})]}),(0,e.jsx)("time",{className:"shrink-0 whitespace-nowrap text-xs text-muted-foreground",dateTime:t.createdAt,title:new Date(t.createdAt).toLocaleString(),children:ye(t.createdAt)})]})})}r(Ut,"AuditRow");function Dt(){return(0,e.jsx)(ie,{children:(0,e.jsxs)(re,{className:"flex flex-col items-center gap-3 py-14 text-center",children:[(0,e.jsx)(dt,{className:"h-10 w-10 text-muted-foreground/50"}),(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"text-sm font-medium text-foreground",children:"Agent audit is a Microvac Enterprise view"}),(0,e.jsxs)("p",{className:"mx-auto mt-1 max-w-md text-sm text-muted-foreground",children:["The agent audit log gives you a searchable, exportable record of everything your agents did — every comment, task change, approval, and run — with the responsible person for each action. Ask an administrator to grant you the"," ",(0,e.jsx)("span",{className:"font-mono text-(length:--text-micro)",children:"audit:view_agent_actions"})," ","permission to view it."]})]})]})})}r(Dt,"AuditUpsell");function Qt({companyId:t,lockedAgentId:a,lockedRunId:n,lockedEntity:l,hideHeader:d,mode:h,onModeChange:o,actionDomain:y,onActionDomainChange:b,entityType:j,onEntityTypeChange:A,entityId:x,onEntityIdChange:Q,onClearFilters:G}){const oe=De(),{pushToast:L}=lt(),[w,M]=(0,u.useState)(c),[i,f]=(0,u.useState)(c),[q,N]=(0,u.useState)(c),Z=y??q,qe=r(s=>{N(s),b?.(s)},"setActionDomain"),[Pe,je]=(0,u.useState)(c),C=j??Pe,ze=r(s=>{je(s),A?.(s)},"setEntityType"),[Be,ve]=(0,u.useState)(""),H=x??Be,[ce,Y]=(0,u.useState)(H);(0,u.useEffect)(()=>Y(H),[H]);const de=r(s=>{ve(s),Y(s),Q?.(s)},"setEntityId"),[J,be]=(0,u.useState)(""),[W,Ne]=(0,u.useState)(""),[Ae,we]=(0,u.useState)(!1),[X,Se]=(0,u.useState)(!1),ue=F({queryKey:I.agents.list(t),queryFn:r(()=>Le.list(t),"queryFn")}),me=F({queryKey:I.access.companyUserDirectory(t),queryFn:r(()=>rt.listUserDirectory(t),"queryFn")}),Oe=(0,u.useMemo)(()=>new Map((ue.data??[]).map(s=>[s.id,s])),[ue.data]),Ve=(0,u.useMemo)(()=>ot(me.data?.users),[me.data]),S=a||n?"agents":h??"all",T=!!(a||n||l),m={actorScope:S,agentId:a??(w===c?void 0:w),runId:n,responsibleUserId:i===c?void 0:i,action:Z===c?void 0:Z,entityType:l?.type??(C===c?void 0:C),entityId:l?.id??(C==="case"&&H.trim()||void 0),from:Et(J),to:Ct(W)},ee=!!(!a&&w!==c||i!==c||Z!==c||C!==c||J||W),Ke=!T&&(w!==c||i!==c),p=et({queryKey:I.audit.agentActions(t,{actorScope:m.actorScope,agentId:m.agentId,runId:m.runId,responsibleUserId:m.responsibleUserId,action:m.action,entityType:m.entityType,entityId:m.entityId,from:m.from,to:m.to}),queryFn:r(({pageParam:s})=>_e.listAgentActions(t,{...m,limit:St,cursor:s??void 0}),"queryFn"),initialPageParam:null,getNextPageParam:r(s=>s.nextCursor??void 0,"getNextPageParam")}),R=ge(p),xe=p.error instanceof gt&&p.error.status===403,te=p.data?.pages.some(s=>s.accessTier==="basic")??!1,Qe=p.data?.pages.some(s=>s.accessTier==="full")??!1,P=(0,u.useMemo)(()=>{const s=p.data?.pages??[];return(te?s.filter(_=>_.accessTier!=="full"):s).flatMap(_=>_.items)},[p.data,te]),{data:Ge}=F({queryKey:I.instance.experimentalSettings,queryFn:r(()=>at.getExperimental(),"queryFn"),enabled:P.some(s=>!!s.details?.workflowTransition)}),z=te?"basic":p.data?.pages[0]?.accessTier,se=l?.type==="case"?P.find(s=>s.entity.case)?.entity.case:null,ae=te&&Qe,pe=a||n?!0:z==="full",Ze=!!(ae&&X&&!p.isFetching),ne=!!(!T&&!Ze&&(xe&&Ke||ae)),B=!!(xe&&!T&&S==="agents"&&o),He=!!(!T&&o&&!B);(0,u.useEffect)(()=>{B&&o?.("all")},[B,o]),(0,u.useEffect)(()=>{!T&&(z==="basic"||ne)&&(M(c),f(c))},[z,T,ne]),(0,u.useEffect)(()=>{if(!ae){X&&Se(!1);return}X||(Se(!0),p.refetch())},[X,p,ae]);const Te=r(()=>{M(c),f(c),N(c),je(c),ve(""),Y(""),be(""),Ne(""),G?G():(b?.(c),A?.(c),Q?.(""))},"clearFilters"),Ye=r(async()=>{we(!0);try{const s=await _e.exportAgentActionsCsv(t,{actorScope:m.actorScope,agentId:m.agentId,runId:m.runId,responsibleUserId:m.responsibleUserId,action:m.action,entityType:m.entityType,entityId:m.entityId,from:m.from,to:m.to}),_=URL.createObjectURL(s),O=document.createElement("a");O.href=_,O.download=`${S==="agents"?"agent-audit":"activity"}-${t}.csv`,document.body.appendChild(O),O.click(),O.remove(),window.setTimeout(()=>URL.revokeObjectURL(_),5e3),L({title:"Audit exported",body:"Your CSV download has started.",tone:"success"})}catch(s){L({title:"Export failed",body:ct(s,{action:"export the audit log"}).body,tone:"error"})}finally{we(!1)}},"handleExport");return xe&&!ne&&!B?(0,e.jsx)(Dt,{}):(0,e.jsxs)("div",{className:"space-y-4",children:[d?null:(0,e.jsx)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:(0,e.jsxs)("div",{children:[(0,e.jsx)("h2",{className:"text-lg font-semibold text-foreground",children:"Activity"}),(0,e.jsxs)("p",{className:"mt-1 grid max-w-2xl text-sm text-muted-foreground",children:[(0,e.jsx)("span",{className:"col-start-1 row-start-1",style:{visibility:S==="agents"?"hidden":"visible"},children:"Everything happening in your organization, newest first — people, agents, and the system. Each line is one recorded action."}),(0,e.jsx)("span",{className:"col-start-1 row-start-1",style:{visibility:S==="agents"?"visible":"hidden"},children:"Every recorded agent action, newest first — with the responsible person and run behind each one."})]})]})}),He?(0,e.jsx)(xt,{"data-canonical-toolbar":"audit-scope",value:S,onValueChange:r(s=>o?.(s),"onValueChange"),children:(0,e.jsx)("div",{className:"design-view-toggle",children:(0,e.jsxs)(mt,{"aria-label":"Activity scope",children:[(0,e.jsx)(Ce,{value:"all",children:"Activity"}),(0,e.jsx)(Ce,{value:"agents",disabled:z==="basic",title:z==="basic"?"Agent Actions requires audit access":void 0,children:"Agent Actions"})]})})}):null,T?(0,e.jsx)("div",{className:"border-y border-border px-1 py-2 text-xs text-muted-foreground",children:n?`Scoped to run ${n.slice(0,8)}`:a?"Scoped to one agent":se?(0,e.jsxs)(e.Fragment,{children:["Case ",(0,e.jsxs)(E,{to:oe(se.identifier),className:"font-medium text-primary hover:underline",children:[se.identifier," · ",se.title]})]}):`Scoped to ${l?.label??l?.type??"entity"}`}):null,(0,e.jsxs)("div",{"data-canonical-toolbar":"audit-activity",role:"toolbar","aria-label":"Audit filters",className:"flex flex-wrap items-end gap-3 border-y border-border py-3",children:[pe&&!a&&!n?(0,e.jsxs)("label",{className:"grid gap-1 text-(length:--text-micro) font-medium text-muted-foreground",children:[(0,e.jsx)("span",{children:"Agent"}),(0,e.jsxs)(U,{value:w,onValueChange:M,children:[(0,e.jsx)(k,{className:"w-40",children:(0,e.jsx)(D,{placeholder:"Agent"})}),(0,e.jsxs)($,{children:[(0,e.jsx)(v,{value:c,children:"All agents"}),(ue.data??[]).map(s=>(0,e.jsx)(v,{value:s.id,children:s.name},s.id))]})]})]}):null,pe?(0,e.jsxs)("label",{className:"grid gap-1 text-(length:--text-micro) font-medium text-muted-foreground",children:[(0,e.jsx)("span",{children:"Responsible user"}),(0,e.jsxs)(U,{value:i,onValueChange:f,children:[(0,e.jsx)(k,{className:"w-52",children:(0,e.jsx)(D,{placeholder:"Responsible user"})}),(0,e.jsxs)($,{children:[(0,e.jsx)(v,{value:c,children:"All responsible users"}),(me.data?.users??[]).map(s=>(0,e.jsx)(v,{value:s.principalId,children:s.user?.name??s.user?.email??s.principalId.slice(0,8)},s.principalId))]})]})]}):null,(0,e.jsxs)("label",{className:"grid gap-1 text-(length:--text-micro) font-medium text-muted-foreground",children:[(0,e.jsx)("span",{children:"Action"}),(0,e.jsxs)(U,{value:Z,onValueChange:qe,children:[(0,e.jsx)(k,{className:"w-40",children:(0,e.jsx)(D,{placeholder:"Action"})}),(0,e.jsx)($,{children:Tt.map(s=>(0,e.jsx)(v,{value:s.value,children:s.label},s.value))})]})]}),l?null:(0,e.jsxs)("label",{className:"grid gap-1 text-(length:--text-micro) font-medium text-muted-foreground",children:[(0,e.jsx)("span",{children:"Entity"}),(0,e.jsxs)(U,{value:C,onValueChange:ze,children:[(0,e.jsx)(k,{className:"w-40",children:(0,e.jsx)(D,{placeholder:"Entity"})}),(0,e.jsx)($,{children:It.map(s=>(0,e.jsx)(v,{value:s.value,children:s.label},s.value))})]})]}),!l&&C==="case"?(0,e.jsxs)("label",{className:"grid gap-1 text-(length:--text-micro) font-medium text-muted-foreground",children:[(0,e.jsx)("span",{children:"Case"}),(0,e.jsx)(he,{type:"search","aria-label":"Case ID or identifier",placeholder:"CAS-C1",value:ce,onChange:r(s=>{Y(s.target.value),s.target.value||de("")},"onChange"),onBlur:r(()=>de(ce.trim()),"onBlur"),onKeyDown:r(s=>{s.key==="Enter"&&(s.preventDefault(),de(ce.trim()))},"onKeyDown"),className:"w-44 font-mono"})]}):null,(0,e.jsxs)("label",{className:"grid gap-1 text-(length:--text-micro) font-medium text-muted-foreground",children:[(0,e.jsx)("span",{children:"From"}),(0,e.jsx)(he,{type:"date","aria-label":"From date",value:J,max:W||void 0,onChange:r(s=>be(s.target.value),"onChange"),className:"w-36"})]}),(0,e.jsxs)("label",{className:"grid gap-1 text-(length:--text-micro) font-medium text-muted-foreground",children:[(0,e.jsx)("span",{children:"To"}),(0,e.jsx)(he,{type:"date","aria-label":"To date",value:W,min:J||void 0,onChange:r(s=>Ne(s.target.value),"onChange"),className:"w-36"})]}),ee?(0,e.jsx)(V,{variant:"ghost",size:"sm",onClick:Te,children:"Clear filters"}):null,pe?(0,e.jsxs)(V,{variant:"outline",size:"sm",className:"ml-auto",onClick:Ye,disabled:Ae||p.isLoading||P.length===0,children:[(0,e.jsx)(yt,{className:"mr-1.5 h-4 w-4"}),Ae?"Exporting…":"Export CSV"]}):null]}),ne||B?(0,e.jsx)(ie,{children:(0,e.jsx)(re,{className:"py-14 text-center text-sm text-muted-foreground",children:"Refreshing audit access…"})}):R.kind==="loading"||R.kind==="reconnecting"?(0,e.jsx)(ie,{children:(0,e.jsx)(re,{className:"py-14 text-center text-sm text-muted-foreground",children:"Loading…"})}):R.kind==="error"?(0,e.jsx)(fe,{error:R.error,action:"load the audit log",onRetry:R.retry,retrying:R.isFetching}):P.length===0?(0,e.jsx)(ie,{children:(0,e.jsxs)(re,{className:"flex flex-col items-center gap-3 py-14 text-center",children:[(0,e.jsx)(tt,{className:"h-10 w-10 text-muted-foreground/40"}),(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"text-sm font-medium text-foreground",children:ee?"No actions match these filters":"Nothing here yet"}),(0,e.jsx)("p",{className:"mt-1 max-w-md text-sm text-muted-foreground",children:ee?"Try a wider date range or different filters.":S==="agents"?"As soon as your agents start doing things, their actions show up here.":"As soon as anyone in your organization does something, it shows up here."})]}),ee?(0,e.jsx)(V,{variant:"outline",size:"sm",onClick:Te,children:"Clear filters"}):null]})}):(0,e.jsx)("div",{className:"border-y border-border",children:(0,e.jsx)("ul",{className:bt("divide-y divide-border"),"aria-label":"Audit activity",children:P.map(s=>(0,e.jsx)(Ut,{record:s,agentMap:Oe,userProfileMap:Ve,casesEnabled:Ge?.enableCases===!0},s.id))})}),p.hasNextPage?(0,e.jsx)("div",{className:"flex justify-center",children:(0,e.jsx)(V,{variant:"outline",size:"sm",onClick:r(()=>p.fetchNextPage(),"onClick"),disabled:p.isFetchingNextPage,children:p.isFetchingNextPage?"Loading…":"Load more"})}):null,(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:"Recorded by Microvac — entries can't be edited. Sensitive values are never stored."})]})}r(Qt,"AuditFeed");var g="__all",le=200;function $t(t){const a=t.resultJson,n=a?.summary??a?.result??t.error;return typeof n=="string"&&n.trim()?n.trim():null}r($t,"runSummary");function Ft(t){const a=t.startedAt?new Date(t.startedAt).getTime():null,n=t.finishedAt?new Date(t.finishedAt).getTime():null;if(a==null||n==null||!Number.isFinite(a)||!Number.isFinite(n))return null;const l=Math.max(0,Math.round((n-a)/1e3));return l<60?`${l}s`:`${Math.floor(l/60)}m ${l%60}s`}r(Ft,"runDuration");function K(t){return t.replaceAll("_"," ")}r(K,"readableSource");function Lt(t){return t.linkedIssue?.title??t.trigger?.label??"Routine run"}r(Lt,"routineRunTitle");function Mt({runs:t,view:a}){return a.kind==="loading"||a.kind==="reconnecting"?(0,e.jsx)("div",{className:"border-y border-border py-14 text-center text-sm text-muted-foreground",children:"Loading routine runs…"}):a.kind==="error"?(0,e.jsx)(fe,{error:a.error,action:"load routine runs",onRetry:a.retry,retrying:a.isFetching}):t.length===0?(0,e.jsx)(Fe,{icon:$e,message:"No routine runs yet."}):(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("h2",{className:"text-lg font-semibold text-foreground",children:"Routine runs"}),(0,e.jsx)("p",{className:"mt-1 max-w-2xl text-sm text-muted-foreground",children:"Executions created by this routine, newest first."})]}),(0,e.jsx)("ul",{className:"divide-y divide-border border-y border-border","aria-label":"Routine runs",children:t.map(n=>{const l=(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsx)("span",{className:"font-medium text-foreground",children:Lt(n)}),(0,e.jsx)(Ue,{status:n.status})]}),(0,e.jsx)("p",{className:"mt-1 truncate text-sm text-muted-foreground",children:n.trigger?.label??K(n.source)})]}),(0,e.jsxs)("div",{className:"flex shrink-0 items-center gap-2 text-xs text-muted-foreground sm:justify-end",children:[(0,e.jsx)("span",{className:"capitalize",children:K(n.source)}),(0,e.jsx)("time",{dateTime:new Date(n.triggeredAt).toISOString(),children:ye(n.triggeredAt)})]})]}),d="flex flex-col gap-2 px-1 py-3 text-inherit no-underline transition-colors hover:bg-muted/50 sm:flex-row sm:items-start sm:justify-between sm:px-3";return(0,e.jsx)("li",{children:n.linkedIssue?(0,e.jsx)(E,{to:`/issues/${n.linkedIssue.identifier??n.linkedIssue.id}`,className:d,children:l}):(0,e.jsx)("div",{className:d,children:l})},n.id)})}),(0,e.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Showing the ",le," most recent routine runs."]})]})}r(Mt,"RoutineScopedRuns");function Gt({companyId:t,routineId:a,lockedAgentId:n,hideHeader:l=!1}){const[d,h]=ht(),o=n??d.get("agentId")??g,y=d.get("runStatus")??g,b=F({queryKey:I.agents.list(t),queryFn:r(()=>Le.list(t),"queryFn"),enabled:!a}),j=F({queryKey:I.audit.runs(t,o===g?null:o),queryFn:r(()=>ft.list(t,o===g?void 0:o,le,{summary:!0}),"queryFn"),refetchInterval:15e3,enabled:!a}),A=F({queryKey:[...I.routines.runs(a??""),"audit"],queryFn:r(()=>it.listRuns(a,le),"queryFn"),enabled:!!a,refetchInterval:15e3}),x=ge(j),Q=ge(A),G=(0,u.useMemo)(()=>new Map((b.data??[]).map(i=>[i.id,i])),[b.data]),oe=(0,u.useMemo)(()=>Array.from(new Set((j.data??[]).map(i=>i.status))).sort(),[j.data]),L=(0,u.useMemo)(()=>(j.data??[]).filter(i=>y===g||i.status===y),[j.data,y]),w=r((i,f)=>{h(q=>{const N=new URLSearchParams(q);return f===g?N.delete(i):N.set(i,f),N},{replace:!0})},"updateFilter"),M=r(()=>{h(i=>{const f=new URLSearchParams(i);return f.delete("agentId"),f.delete("runStatus"),f},{replace:!0})},"clearFilters");return a?(0,e.jsx)(Mt,{runs:A.data??[],view:Q}):(0,e.jsxs)("div",{className:"space-y-4",children:[l?null:(0,e.jsxs)("div",{children:[(0,e.jsx)("h2",{className:"text-lg font-semibold text-foreground",children:"Runs"}),(0,e.jsx)("p",{className:"mt-1 max-w-2xl text-sm text-muted-foreground",children:"Recent agent executions across the organization. Open a run to inspect its transcript, output, and task context."})]}),(0,e.jsxs)("div",{"data-canonical-toolbar":"audit-runs",role:"toolbar","aria-label":"Audit filters",className:"flex flex-wrap items-end gap-3 border-y border-border py-3",children:[n?null:(0,e.jsxs)("label",{className:"grid gap-1 text-(length:--text-micro) font-medium text-muted-foreground",children:[(0,e.jsx)("span",{children:"Agent"}),(0,e.jsxs)(U,{value:o,onValueChange:r(i=>w("agentId",i),"onValueChange"),children:[(0,e.jsx)(k,{className:"w-48",children:(0,e.jsx)(D,{placeholder:"All agents"})}),(0,e.jsxs)($,{children:[(0,e.jsx)(v,{value:g,children:"All agents"}),(b.data??[]).map(i=>(0,e.jsx)(v,{value:i.id,children:i.name},i.id))]})]})]}),(0,e.jsxs)("label",{className:"grid gap-1 text-(length:--text-micro) font-medium text-muted-foreground",children:[(0,e.jsx)("span",{children:"Status"}),(0,e.jsxs)(U,{value:y,onValueChange:r(i=>w("runStatus",i),"onValueChange"),children:[(0,e.jsx)(k,{className:"w-40",children:(0,e.jsx)(D,{placeholder:"All statuses"})}),(0,e.jsxs)($,{children:[(0,e.jsx)(v,{value:g,children:"All statuses"}),oe.map(i=>(0,e.jsx)(v,{value:i,children:K(i)},i))]})]})]}),!n&&o!==g||y!==g?(0,e.jsx)(V,{variant:"ghost",size:"sm",onClick:M,children:"Clear filters"}):null]}),x.kind==="loading"||x.kind==="reconnecting"?(0,e.jsx)("div",{className:"border-y border-border py-14 text-center text-sm text-muted-foreground",children:"Loading runs…"}):x.kind==="error"?(0,e.jsx)(fe,{error:x.error,action:"load runs",onRetry:x.retry,retrying:x.isFetching}):L.length===0?(0,e.jsx)(Fe,{icon:o!==g||y!==g?wt:$e,message:o!==g||y!==g?"No runs match these filters.":"No runs yet."}):(0,e.jsx)("ul",{className:"divide-y divide-border border-y border-border","aria-label":"Recent runs",children:L.map(i=>{const f=G.get(i.agentId),q=$t(i),N=Ft(i);return(0,e.jsx)("li",{children:(0,e.jsxs)(E,{to:`/agents/${i.agentId}/runs/${i.id}`,className:"flex flex-col gap-2 px-1 py-3 text-inherit no-underline transition-colors hover:bg-muted/50 sm:flex-row sm:items-start sm:justify-between sm:px-3",children:[(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsx)("span",{className:"font-medium text-foreground",children:f?.name??"Unknown agent"}),(0,e.jsx)("span",{className:"font-mono text-(length:--text-micro) text-muted-foreground",children:i.id.slice(0,8)}),(0,e.jsx)(Ue,{status:i.status})]}),(0,e.jsx)("p",{className:"mt-1 truncate text-sm text-muted-foreground",children:q??`${K(i.invocationSource)} run`})]}),(0,e.jsxs)("div",{className:"flex shrink-0 items-center gap-2 text-xs text-muted-foreground sm:justify-end",children:[(0,e.jsx)("span",{className:"capitalize",children:K(i.invocationSource)}),N?(0,e.jsx)("span",{children:N}):null,(0,e.jsx)("time",{dateTime:new Date(i.createdAt).toISOString(),children:ye(i.createdAt)})]})]})},i.id)})}),(0,e.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Showing the ",le," most recent runs."]})]})}r(Gt,"AuditRuns");export{Qt as n,Gt as t};
@@ -0,0 +1,3 @@
1
+ var ee=Object.defineProperty;var s=(h,i)=>ee(h,"name",{value:i,configurable:!0});import{a as Z}from"./rolldown-runtime-DhZMWcEn.js";import{$A as te,$n as ne,C_ as re,GS as L,ME as ie,NE as ae,N_ as oe,Vb as se,YS as Y,Yb as le,ab as ce,bE as ue,by as de,er as me,hE as he,nj as fe,oE as ge,qv as xe,xE as O}from"./index-Bt31d8ga.js";import{n as pe}from"./invite-memory-BKdqfr5K.js";var E=Z(fe(),1),r=Z(te(),1),D=[" ",".","·","▪","▫","○"],ye=1e3/24,T=[[" ╭────╮ "," ╭╯╭──╮│ "," │ │ ││ "," │ │ ││ "," │ │ ││ "," │ │ ││ "," │ ╰──╯│ "," ╰─────╯ "],[" ╭─────╮ "," │╭──╮╰╮ "," ││ │ │ "," ││ │ │ "," ││ │ │ "," ││ │ │ "," │╰──╯ │ "," ╰────╯ "]];function J(h){const i=document.createElement("span");i.textContent="M",i.style.cssText="position:absolute;visibility:hidden;white-space:pre;font-size:inherit;font-family:inherit;line-height:1;",h.appendChild(i);const d=i.getBoundingClientRect();return h.removeChild(i),{w:d.width,h:d.height}}s(J,"measureChar");function ve(h){let i=0;for(const d of h)i=Math.max(i,d.length);return{width:i,height:h.length}}s(ve,"spriteSize");function be(){const h=(0,E.useRef)(null),i=(0,E.useRef)(null);return(0,E.useEffect)(()=>{if(!h.current)return;const d=h.current,m=window.matchMedia("(prefers-reduced-motion: reduce)");let k=document.visibilityState!=="hidden",p=!1,q=0,j=0,l=0,a=0,R=7,y=11,b=new Float32Array(0),S=new Float32Array(0),N=new Float32Array(0),w=new Uint16Array(0),M=[],_="";function I(o){const c=Math.floor(Math.max(0,Math.min(.999,o))*D.length);return D[c]??" "}s(I,"toGlyph");function z(){const o=Math.max(0,Math.ceil(d.clientWidth/Math.max(1,R))),c=Math.max(0,Math.ceil(d.clientHeight/Math.max(1,y)));if(o===l&&c===a)return;l=o,a=c;const C=l*a;b=new Float32Array(C),S=new Float32Array(l),N=new Float32Array(a),w=new Uint16Array(C),M=M.filter(u=>u.x>-u.width-2&&u.x<l+2&&u.y>-u.height-2&&u.y<a+2),_=""}s(z,"rebuildGrid");function Q(){if(l<=0||a<=0){d.textContent="";return}const o=Array.from({length:a},()=>Array.from({length:l},()=>" "));for(let n=0;n<a;n++)for(let t=0;t<l;t++){const e=(Math.sin(t*.11+n*.04)+Math.cos(n*.08-t*.02))*.18+.22;o[n][t]=I(e)}const c=18,C=13;for(let n=1;n<a-9;n+=C){const t=Math.floor(n/C)%2===0?2:10;for(let e=t;e<l-10;e+=c){const v=T[(e+n)%T.length];for(let g=0;g<v.length;g++){const x=v[g];for(let A=0;A<x.length;A++){const K=x[A]??" ";if(K===" ")continue;const U=n+g,V=e+A;U<0||U>=a||V<0||V>=l||(o[U][V]=K)}}}}const u=o.map(n=>n.join("")).join(`
2
+ `);d.textContent=u,_=u}s(Q,"drawStaticFrame");function W(){const o=T[Math.floor(Math.random()*T.length)],c=ve(o),C=Math.random();let u=0,n=0,t=0,e=0;C<.68?(u=Math.random()<.5?-c.width-1:l+1,n=Math.random()*Math.max(1,a-c.height),t=u<0?.04+Math.random()*.05:-(.04+Math.random()*.05),e=(Math.random()-.5)*.014):(u=Math.random()*Math.max(1,l-c.width),n=Math.random()<.5?-c.height-1:a+1,t=(Math.random()-.5)*.014,e=n<0?.028+Math.random()*.034:-(.028+Math.random()*.034)),M.push({x:u,y:n,vx:t,vy:e,life:0,maxLife:260+Math.random()*220,drift:(Math.random()-.5)*1.2,sprite:o,width:c.width,height:c.height})}s(W,"spawnClip");function F(o,c){const C=Math.round(o.x),u=Math.round(o.y);for(let n=0;n<o.sprite.length;n++){const t=o.sprite[n],e=u+n;if(!(e<0||e>=a))for(let v=0;v<t.length;v++){const g=t[v]??" ";if(g===" ")continue;const x=C+v;if(x<0||x>=l)continue;const A=e*l+x,K=g==="│"||g==="─"?.8:.92;b[A]=Math.max(b[A]??0,c*K),w[A]=g.charCodeAt(0)}}}s(F,"stampClip");function P(o){if(!p||(i.current=requestAnimationFrame(P),o-q<ye||l<=0||a<=0))return;const c=Math.min(2,q===0?1:(o-q)/16.6667);q=o,j+=c;const C=l*a,u=Math.max(3,Math.floor(C/2200));for(;M.length<u;)W();for(let t=0;t<b.length;t++)b[t]*=.92;w.fill(0);for(let t=M.length-1;t>=0;t--){const e=M[t];e.life+=c;const v=Math.sin((e.y+e.drift+j*.12)*.09)*.0018,g=Math.cos((e.x-e.drift-j*.09)*.08)*.0014;if(e.vx=(e.vx+v)*.998,e.vy=(e.vy+g)*.998,e.x+=e.vx*c,e.y+=e.vy*c,e.life>=e.maxLife||e.x<-e.width-2||e.x>l+2||e.y<-e.height-2||e.y>a+2){M.splice(t,1);continue}const x=e.life/e.maxLife;F(e,x<.12?x/.12:x>.88?(1-x)/.12:1)}for(let t=0;t<l;t++)S[t]=Math.sin(t*.08+j*.06);for(let t=0;t<a;t++)N[t]=Math.cos(t*.1-j*.05);let n="";for(let t=0;t<a;t++){for(let e=0;e<l;e++){const v=t*l+e,g=w[v];if(g>0){n+=String.fromCharCode(g);continue}const x=(S[e]+N[t])*.08+.1,A=Math.max(b[v]??0,x*.45);n+=I(A)}t<a-1&&(n+=`
3
+ `)}n!==_&&(d.textContent=n,_=n)}s(P,"step");function f(){const o=l>0&&a>0;if(m.matches){p&&(p=!1,i.current!==null&&cancelAnimationFrame(i.current),i.current=null),o&&Q();return}if(!k||!o){p&&(p=!1,i.current!==null&&cancelAnimationFrame(i.current),i.current=null);return}p||(p=!0,q=0,i.current=requestAnimationFrame(P))}s(f,"syncLoop");const G=s(()=>{const o=J(d);R=o.w,y=o.h,z(),f()},"measureGrid"),H=new ResizeObserver(G);H.observe(d),document.fonts?.addEventListener("loadingdone",G);const X=s(()=>{k=document.visibilityState!=="hidden",f()},"onVisibilityChange");document.addEventListener("visibilitychange",X);const $=s(()=>{f()},"onMotionChange");m.addEventListener("change",$);const B=J(d);return R=B.w,y=B.h,z(),f(),()=>{p=!1,i.current!==null&&cancelAnimationFrame(i.current),H.disconnect(),document.fonts?.removeEventListener("loadingdone",G),document.removeEventListener("visibilitychange",X),m.removeEventListener("change",$)}},[]),(0,r.jsx)("pre",{ref:h,className:"font-mono w-full h-full m-0 p-0 overflow-hidden text-muted-foreground/60 select-none leading-none",style:{fontSize:"var(--text-micro)"},"aria-hidden":"true"})}s(be,"AsciiArtAnimation");function Ae(){const h=ie(),i=le(),[d]=ge(),[m,k]=(0,E.useState)("sign_in"),[p,q]=(0,E.useState)(""),[j,l]=(0,E.useState)(""),[a,R]=(0,E.useState)(""),[y,b]=(0,E.useState)(null),S="auth-error",N=(0,E.useMemo)(()=>de(d.get("next")||pe()||"/"),[d]),w=O({queryKey:L.health,queryFn:s(()=>se.get(),"queryFn")}),M=O({queryKey:L.auth.session,queryFn:s(()=>Y.getSession(),"queryFn")}),{data:_,isLoading:I,error:z}=M,Q=w.error??z,W=w.isFetching||M.isFetching;(0,E.useEffect)(()=>{_&&(me(),i(N,{replace:!0}))},[_,i,N]);const F=ue({mutationFn:s(async()=>{if(m==="sign_in"){await Y.signInEmail({email:j.trim(),password:a});return}await Y.signUpEmail({name:p.trim(),email:j.trim(),password:a})},"mutationFn"),onSuccess:s(async()=>{b(null),await h.invalidateQueries({queryKey:L.auth.session}),await h.invalidateQueries({queryKey:L.health}),await h.resetQueries({queryKey:L.companies.all}),i(N,{replace:!0})},"onSuccess"),onError:s(f=>{b(he(f).body)},"onError")}),P=j.trim().length>0&&a.trim().length>0&&(m==="sign_in"||p.trim().length>0&&a.trim().length>=8);return w.isLoading||I||_?(0,r.jsx)("div",{className:"fixed inset-0 flex items-center justify-center",children:(0,r.jsx)(oe,{className:"min-h-0"})}):Q?(0,r.jsx)(ce,{size:"panel",className:"p-6",error:Q,action:"check sign-in",onRetry:s(()=>{w.refetch(),M.refetch()},"onRetry"),retrying:W}):w.data?.cloud?(0,r.jsx)(ne,{cloud:w.data.cloud,returnTo:N}):(0,r.jsxs)("div",{className:"fixed inset-0 flex bg-background",children:[(0,r.jsx)("div",{className:"absolute top-4 right-4 z-10",children:(0,r.jsx)(xe,{})}),(0,r.jsx)("div",{className:"w-full md:w-1/2 flex flex-col overflow-y-auto",children:(0,r.jsxs)("div",{className:"w-full max-w-md mx-auto my-auto px-8 py-12",children:[(0,r.jsx)("div",{className:"mb-8",children:(0,r.jsx)(re,{className:"h-5 w-auto"})}),(0,r.jsx)("h1",{className:"text-xl font-semibold",children:m==="sign_in"?"Sign in to Microvac":"Create your Microvac account"}),(0,r.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:m==="sign_in"?"Use your email and password to access this instance.":"Create an account for this instance. Email confirmation is not required in v1."}),(0,r.jsxs)("form",{className:"mt-6 space-y-4",method:"post",action:m==="sign_up"?"/api/auth/sign-up/email":"/api/auth/sign-in/email",onSubmit:s(f=>{if(f.preventDefault(),!F.isPending){if(!P){b("Please fill in all required fields.");return}F.mutate()}},"onSubmit"),children:[m==="sign_up"&&(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{htmlFor:"name",className:"text-xs text-muted-foreground mb-1 block",children:"Name"}),(0,r.jsx)("input",{id:"name",name:"name",className:"w-full rounded-md border border-border bg-transparent px-3 py-2 text-sm outline-none focus:ring-1 focus:ring-ring placeholder:text-muted-foreground/50",value:p,onChange:s(f=>q(f.target.value),"onChange"),autoComplete:"name",required:!0,"aria-required":"true","aria-invalid":y?!0:void 0,"aria-describedby":y?S:void 0,autoFocus:!0})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{htmlFor:"email",className:"text-xs text-muted-foreground mb-1 block",children:"Email"}),(0,r.jsx)("input",{id:"email",name:"email",className:"w-full rounded-md border border-border bg-transparent px-3 py-2 text-sm outline-none focus:ring-1 focus:ring-ring placeholder:text-muted-foreground/50",type:"email",value:j,onChange:s(f=>l(f.target.value),"onChange"),autoComplete:"username",required:!0,"aria-required":"true","aria-invalid":y?!0:void 0,"aria-describedby":y?S:void 0,autoFocus:m==="sign_in"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{htmlFor:"password",className:"text-xs text-muted-foreground mb-1 block",children:"Password"}),(0,r.jsx)("input",{id:"password",name:"password",className:"w-full rounded-md border border-border bg-transparent px-3 py-2 text-sm outline-none focus:ring-1 focus:ring-ring placeholder:text-muted-foreground/50",type:"password",value:a,onChange:s(f=>R(f.target.value),"onChange"),autoComplete:m==="sign_in"?"current-password":"new-password",required:!0,"aria-required":"true","aria-invalid":y?!0:void 0,"aria-describedby":y?S:void 0})]}),y&&(0,r.jsx)("p",{id:S,role:"alert",className:"text-xs text-destructive",children:y}),(0,r.jsx)(ae,{type:"submit",disabled:F.isPending,"aria-disabled":!P||F.isPending,className:`w-full ${!P&&!F.isPending?"opacity-50":""}`,children:F.isPending?"Working…":m==="sign_in"?"Sign In":"Create Account"})]}),(0,r.jsxs)("div",{className:"mt-5 text-sm text-muted-foreground",children:[m==="sign_in"?"Need an account?":"Already have an account?"," ",(0,r.jsx)("button",{type:"button",className:"font-medium text-foreground underline underline-offset-2",onClick:s(()=>{b(null),k(m==="sign_in"?"sign_up":"sign_in")},"onClick"),children:m==="sign_in"?"Create one":"Sign in"})]})]})}),(0,r.jsx)("div",{className:"hidden md:block w-1/2 overflow-hidden",children:(0,r.jsx)(be,{})})]})}s(Ae,"AuthPage");export{Ae as AuthPage};
@@ -0,0 +1,18 @@
1
+ var dt=Object.defineProperty;var i=(t,o)=>dt(t,"name",{value:o,configurable:!0});import{a as Ge}from"./rolldown-runtime-DhZMWcEn.js";import{Dt as lt,Et as ut,fi as mt}from"./issue-detail-4PCbYpdv.js";import{t as pt}from"./circle-slash-DqKFFqfb.js";import{t as ft}from"./list-filter-BC3D4IoX.js";import{t as ht}from"./log-in-BJCGwGGT.js";import{t as xt}from"./send-CYVi50sh.js";import{$A as gt,$C as bt,Ao as yt,BC as vt,ET as wt,E_ as jt,Ev as kt,GS as O,Gb as Nt,IS as Xe,JT as _t,LS as Ye,ME as It,MT as Tt,NC as be,NE as pe,Oy as Ct,QC as Ke,QT as St,TT as At,Tw as Et,WE as Mt,Yw as Rt,ZT as Dt,_w as fe,bT as zt,bv as $t,d as Ft,fC as qt,hC as Lt,hv as Ot,iS as Pt,ib as Bt,jT as Kt,jb as Me,jo as Wt,kT as Ht,lC as Je,lS as me,mv as Ut,mx as Vt,nj as Qt,p as Gt,pv as Xt,rb as Ze,uw as Yt,v as Jt,vC as Zt,vb as ye,wn as er,x as _e,xE as se,xT as tr,xb as ve,xv as rr,yb as we,yv as sr,zD as ar,zE as y}from"./index-Bt31d8ga.js";import{t as nr}from"./goals-CvMWzjH4.js";var et={name:"pencil-line",size:24,node:[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]};et.node;var or=St(et),s=Ge(Qt(),1),e=Ge(gt(),1);function Se(t){return typeof t=="string"?t.replace(/_/g," "):String(t??"")}i(Se,"humanize");function ir(t,o,l="chronological"){switch(t){case"issue.created":return"opened";case"issue.updated":{const d=o?.status;if(d==="in_review"&&o?.externalConversationState==="waiting")return"moved to idle";if(typeof d=="string")return`moved to ${Se(d)}`;const p=o?.priority;return typeof p=="string"?`set priority to ${Se(p)} on`:"updated"}case"issue.document_created":return"wrote doc on";case"issue.document_updated":return"edited doc on";case"issue.document_deleted":return"deleted doc from";case"issue.work_product_created":return"delivered work on";case"issue.work_product_updated":return"updated work on";case"issue.work_product_deleted":return"removed work from";case"issue.checked_out":return"picked up";case"issue.released":return"released";case"issue.commented":case"issue.comment_added":return"commented on";case"issue.attachment_added":return"attached a file to";case"issue.attachment_removed":return"removed attachment from";case"issue.deleted":return"deleted";case"approval.created":return l==="pinned"?"needs approval on":"requested approval on";case"approval.approved":return"approved";case"approval.rejected":return"rejected";case"approval.revision_requested":return"requested changes on";case"agent.created":return l==="pinned"?"wants to hire":"hired";case"agent.paused":return"paused";case"agent.resumed":return"resumed";case"agent.updated":return"updated";case"agent.terminated":return"terminated";case"heartbeat.invoked":return"started a run on";case"heartbeat.cancelled":return"cancelled a run on";case"project.created":return"created project";case"project.updated":return"updated project";case"project.deleted":return"deleted project";case"goal.created":return"created goal";case"goal.updated":return"updated goal";case"goal.deleted":return"deleted goal";case"company.created":return"created organization";case"company.updated":return"updated organization";case"company.archived":return"archived organization";case"company.budget_updated":return"updated organization budget";default:return t.replace(/[._]/g," ")}}i(ir,"formatVerb");function cr(t,o){switch(t){case"issue.created":return"todo";case"issue.updated":{const l=o?.status;return l==="in_review"&&o?.externalConversationState==="waiting"?"idle":typeof l=="string"?l:null}case"issue.document_created":case"issue.document_updated":return"in_progress";case"issue.work_product_created":return"in_review";case"approval.created":return"in_review";case"approval.approved":return"done";case"approval.rejected":case"approval.revision_requested":return"blocked";default:return null}}i(cr,"deriveTaskStatus");function dr(t,o,l){const d=t.action;if(d.startsWith("heartbeat."))return l&&d==="heartbeat.invoked"?{kind:"lucide",Icon:fe,color:"text-blue-600 dark:text-blue-400",spin:!0}:{kind:"lucide",Icon:fe,color:"text-muted-foreground"};switch(d){case"approval.created":return{kind:"lucide",Icon:wt,color:"text-amber-600 dark:text-amber-400"};case"approval.approved":return{kind:"lucide",Icon:At,color:"text-green-600 dark:text-green-400"};case"approval.rejected":return{kind:"lucide",Icon:pt,color:"text-red-600 dark:text-red-400"};case"approval.revision_requested":return{kind:"lucide",Icon:or,color:"text-amber-600 dark:text-amber-400",filled:!0}}switch(d){case"agent.created":return{kind:"lucide",Icon:qt,color:"text-purple-600 dark:text-purple-400"};case"agent.paused":return{kind:"lucide",Icon:tr,color:"text-muted-foreground"};case"agent.resumed":return{kind:"lucide",Icon:zt,color:"text-muted-foreground"};case"agent.updated":case"agent.terminated":return{kind:"lucide",Icon:be,color:"text-muted-foreground"}}return d==="issue.document_created"||d==="issue.document_updated"?{kind:"lucide",Icon:Rt,color:"text-blue-600 dark:text-blue-400"}:d.startsWith("issue.work_product_")?{kind:"lucide",Icon:bt,color:"text-indigo-600 dark:text-indigo-400"}:d==="issue.commented"||d==="issue.comment_added"?{kind:"lucide",Icon:Yt,color:"text-muted-foreground"}:d==="issue.checked_out"?{kind:"lucide",Icon:ht,color:"text-muted-foreground"}:t.entityType==="issue"?{kind:"status-circle",status:cr(d,o)??"backlog"}:t.entityType==="goal"?{kind:"lucide",Icon:Zt,color:"text-muted-foreground"}:{kind:"lucide",Icon:be,color:"text-muted-foreground"}}i(dr,"getIconSpec");function lr({status:t}){const o=Vt[t]??"text-muted-foreground border-muted-foreground",l=t==="done";return(0,e.jsx)("span",{className:y("relative inline-flex h-4 w-4 shrink-0 rounded-full border-2",o),children:l&&(0,e.jsx)("span",{className:"absolute inset-0 m-auto h-2 w-2 rounded-full bg-current"})})}i(lr,"StatusCircle");function ur({spec:t}){if(t.kind==="status-circle")return(0,e.jsx)(lr,{status:t.status});const{Icon:o,color:l,filled:d,spin:p}=t;return(0,e.jsx)(o,{className:y("h-4 w-4 shrink-0",l,p&&"animate-spin"),fill:d?"currentColor":"none",strokeWidth:d?1.5:2})}i(ur,"EntityIcon");function mr(t,o,l,d){const p=t.details,h=t.actorType==="agent"?o.get(t.actorId)??null:null,b=h?.name??(t.actorType==="system"?"System":t.actorType==="user"?"Board":t.actorId||"Unknown"),S=d?.get(`${t.entityType}:${t.entityId}`)??null,g=t.entityType==="heartbeat_run",m=g?p?.agentId:void 0,f=g?m?l.get(`agent:${m}`)??null:null:l.get(`${t.entityType}:${t.entityId}`)??null,P=p?.key,A=t.action==="issue.document_created"||t.action==="issue.document_updated",M=f??t.entityId,z=p?.hiredAgentId,$=p?.requestedByAgentId,I=$?o.get($)?.name??null:null,F=p?.type,w=g&&m?`/agents/${m}/runs/${t.entityId}`:t.entityType==="issue"?A&&P?`/issues/${M}#document-${encodeURIComponent(P)}`:`/issues/${M}`:t.entityType==="agent"?`/agents/${t.entityId}`:t.entityType==="approval"?t.action==="approval.approved"&&z?`/agents/${z}`:`/approvals/${t.entityId}`:t.entityType==="project"?`/projects/${ar(f,t.entityId)}`:t.entityType==="goal"?`/goals/${t.entityId}`:null;let v=null,j=!0,N=null;return t.entityType==="issue"?(v=f,N=S):t.entityType==="approval"?(I?v=I:(v=F?Se(F):"approval",j=!1),N=S):t.entityType==="agent"?(v=p?.name??f??t.entityId,N=null):g?(v=f,N=null):(v=f,N=S),{actorName:b,actorType:t.actorType,actor:h,identifier:v,identifierMono:j,title:N,link:w}}i(mr,"resolveContent");function pr({content:t}){return t.actorType==="agent"?(0,e.jsx)(Me,{agent:t.actor,size:16,className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}):t.actorType==="user"?(0,e.jsx)(Je,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}):(0,e.jsx)(be,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"})}i(pr,"ActorGlyph");function Ae({event:t,agentMap:o,entityNameMap:l,entityTitleMap:d,isActive:p=!1,isMuted:h=!1,isPinned:b=!1,className:S}){const g=t.details,m=mr(t,o,l,d),f=ir(t.action,g,b?"pinned":"chronological"),P=dr(t,g,p),A=h?"text-muted-foreground/70":"text-(--hex-959596)",M=h?"":"group-hover:text-white",z=(0,e.jsxs)(jt,{"data-fc":"card",className:y("flex-row group ml-3 mr-3 md:ml-0 my-2 w-(--sz-calc-1) md:w-(--sz-calc-2) items-center gap-2 p-(--sz-18px) text-xs","transition-(--tp-background-color-border-color) duration-150",m.link&&"cursor-pointer hover:bg-accent hover:border-muted-foreground/30",S),children:[(0,e.jsx)(ur,{spec:P}),(0,e.jsx)(pr,{content:m}),(0,e.jsxs)("span",{className:"flex min-w-0 flex-1 items-baseline gap-1 truncate",children:[(0,e.jsx)("span",{"data-fc":"actor",className:y("font-medium",A,M),children:m.actorName}),(0,e.jsx)("span",{"data-fc":"verb",className:A,children:f}),m.identifier&&(0,e.jsx)("span",{"data-fc":"id",className:y(m.identifierMono&&"font-mono",A,M),children:m.identifier}),m.title&&(0,e.jsx)("span",{"data-fc":"title",className:y("truncate",A,M),children:m.title})]}),b&&(0,e.jsx)("span",{className:"shrink-0 text-xs text-muted-foreground",children:"Review →"}),(0,e.jsx)("span",{"data-fc":"time",className:"shrink-0 text-muted-foreground",children:Xe(t.createdAt)})]});return m.link?(0,e.jsx)(Nt,{to:m.link,"data-fc":"link",className:"block w-full no-underline text-inherit",issueQuicklookSide:"left",children:z}):z}i(Ae,"FeedCard");var fr={"issue.created":1,"issue.document_created":1,"approval.created":1,"approval.approved":1,"approval.rejected":1,"approval.revision_requested":1,"agent.created":1,"issue.work_product_created":1,"issue.updated":2,"issue.work_product_updated":2,"issue.work_product_deleted":2,"issue.checked_out":2,"issue.comment_added":2,"issue.commented":2,"heartbeat.invoked":2,"heartbeat.cancelled":2,"agent.paused":2,"agent.resumed":2,"agent.updated":2,"issue.read_marked":3,"issue.read_unmarked":3,"issue.inbox_archived":3,"issue.inbox_unarchived":3,"issue.released":3,"issue.attachment_added":3,"issue.attachment_removed":3,"issue.document_deleted":3,"issue.document_updated":2,"issue.deleted":3,"issue.feedback_vote_saved":3,"agent.key_created":3,"agent.budget_updated":3,"agent.runtime_session_reset":3,"agent.skills_synced":3,"agent.terminated":2,"approval.requester_wakeup_queued":3,"approval.requester_wakeup_failed":3,"company.created":3,"company.updated":3,"company.archived":3,"company.budget_updated":3,"company.skill_created":3,"company.skill_deleted":3,"project.created":2,"project.updated":3,"project.deleted":3,"goal.created":2,"goal.updated":3,"goal.deleted":3,"cost.reported":3,"cost.recorded":3};function Ee(t){return t.action==="issue.updated"&&t.details&&t.details.status==="in_review"?1:fr[t.action]??3}i(Ee,"getEventTier");var hr=[{value:"all",label:"All"},{value:"in-progress",label:"In Progress"},{value:"for-review",label:"In Review"},{value:"completed",label:"Done"}],xr={all:null,"in-progress":new Set(["issue.created","issue.checked_out","heartbeat.invoked"]),"for-review":new Set(["approval.created","issue.document_created","issue.document_updated"]),completed:new Set(["approval.approved"])},gr={all:null,"in-progress":new Set(["in_progress"]),"for-review":new Set(["in_review"]),completed:new Set(["done"])};function br(t,o){if(o==="all"||xr[o]?.has(t.action))return!0;if(t.action==="issue.updated"&&t.details){const l=gr[o],d=t.details;if(l&&typeof d.status=="string"&&l.has(d.status))return!0}return!1}i(br,"matchesFilter");var yr=3e5;function vr(t){if(t.length===0)return[];const o=[];let l=[t[0]],d=`${t[0].entityType}:${t[0].entityId}`;for(let p=1;p<t.length;p++){const h=t[p],b=`${h.entityType}:${h.entityId}`,S=new Date(l[l.length-1].createdAt).getTime(),g=new Date(h.createdAt).getTime(),m=Math.abs(S-g)<=yr,f=Ee(h);b===d&&m&&f>=2?l.push(h):(We(l,o),l=[h],d=b)}return We(l,o),o}i(vr,"collapseSequential");function We(t,o){if(t.length<=2)for(const l of t)o.push(l);else o.push({type:"collapsed",events:t,entityId:t[0].entityId,entityType:t[0].entityType,latestEvent:t[0]})}i(We,"flushGroup");var wr=3e5;function Ie(t){return Date.now()-new Date(t).getTime()<wr}i(Ie,"isRecent");var jr=`
2
+ @keyframes feed-slide-in {
3
+ from {
4
+ opacity: 0;
5
+ transform: translateY(-8px);
6
+ }
7
+ to {
8
+ opacity: 1;
9
+ transform: translateY(0);
10
+ }
11
+ }
12
+ .feed-item-new {
13
+ animation: feed-slide-in 300ms ease-out;
14
+ }
15
+ `,He=50,kr=30;function Nr({group:t,agentMap:o,entityNameMap:l,entityTitleMap:d}){const[p,h]=(0,s.useState)(!1),b=t.latestEvent.actorType==="agent"?o.get(t.latestEvent.actorId):null,S=b?.name??(t.latestEvent.actorType==="system"?"System":t.latestEvent.actorType==="user"?"Board":"Unknown"),g=l.get(`${t.entityType}:${t.entityId}`);return(0,e.jsxs)("div",{children:[(0,e.jsxs)("button",{type:"button",onClick:i(()=>h(m=>!m),"onClick"),"data-fc":"card",className:y("group ml-3 mr-3 md:ml-0 my-2 flex w-(--sz-calc-1) md:w-(--sz-calc-2) items-center gap-2 rounded-lg border bg-card p-(--sz-18px) text-left text-xs transition-(--tp-background-color-border-color) duration-150","cursor-pointer hover:bg-accent hover:border-muted-foreground/30"),children:[p?(0,e.jsx)(Kt,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):(0,e.jsx)(Ht,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),t.latestEvent.actorType==="agent"?(0,e.jsx)(Me,{agent:b,size:16,className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}):t.latestEvent.actorType==="user"?(0,e.jsx)(Je,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}):(0,e.jsx)(be,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,e.jsxs)("span",{className:"flex-1 min-w-0 truncate",children:[(0,e.jsx)("span",{"data-fc":"actor",className:"font-medium text-(--hex-959596) group-hover:text-white",children:S}),(0,e.jsxs)("span",{"data-fc":"verb",className:"ml-1 text-(--hex-959596)",children:["made ",t.events.length," updates to"]}),(0,e.jsx)("span",{"data-fc":"title",className:"ml-1 text-(--hex-959596) group-hover:text-white",children:g??t.entityId})]}),(0,e.jsx)("span",{"data-fc":"time",className:"text-muted-foreground shrink-0",children:Xe(t.latestEvent.createdAt)})]}),p&&(0,e.jsx)("div",{className:"ml-8",children:t.events.map(m=>(0,e.jsx)(Ae,{event:m,agentMap:o,entityNameMap:l,entityTitleMap:d,isMuted:!0},m.id))})]})}i(Nr,"CollapsedFeedGroup");function Ue({className:t}){const{selectedCompanyId:o}=Ye(),[l,d]=(0,s.useState)("all"),[p,h]=(0,s.useState)("flat"),[b,S]=(0,s.useState)(!1),[g,m]=(0,s.useState)(He),f=(0,s.useRef)(null),P=(0,s.useRef)(new Set),A=(0,s.useRef)(!0);(0,s.useEffect)(()=>{const a="feed-animation-styles";if(document.getElementById(a))return;const c=document.createElement("style");c.id=a,c.textContent=jr,document.head.appendChild(c)},[]);const M=er({visibleMs:5e3}),z=O.activity(o??""),$=Wt({companyId:o,resourceKey:"activity",queryKey:z,enabled:!!o,refetchInterval:M,leaderOnly:!0}),{data:I,dataUpdatedAt:F}=se({queryKey:z,queryFn:i(({signal:a})=>Pt.list(o,void 0,{signal:a}),"queryFn"),enabled:$.enabled,refetchInterval:$.refetchInterval});yt($,I,F);const{data:w}=se({queryKey:O.agents.list(o??""),queryFn:i(()=>Ze.list(o),"queryFn"),enabled:!!o}),{data:v}=se({queryKey:O.issues.listIndex(o??""),queryFn:i(({signal:a})=>me.listCompact(o,{projection:"index"},{signal:a}),"queryFn"),enabled:!!o}),j=(0,s.useMemo)(()=>{const a=new Map;for(const c of w??[])a.set(c.id,c);return a},[w]),N=(0,s.useMemo)(()=>{const a=new Map;for(const c of w??[])a.set(`agent:${c.id}`,c.name);for(const c of v??[])a.set(`issue:${c.id}`,c.identifier??c.id);return a},[w,v]),B=(0,s.useMemo)(()=>{const a=new Map;for(const c of v??[])a.set(`issue:${c.id}`,c.title);return a},[v]),Y=(0,s.useMemo)(()=>vr((I??[]).filter(a=>{const c=Ee(a);return!b&&c===3?!1:br(a,l)}).sort((a,c)=>new Date(c.createdAt).getTime()-new Date(a.createdAt).getTime())),[I,l,b]),K=Y.slice(0,g),T=Y.length>g;(0,s.useEffect)(()=>{if(I&&A.current){for(const a of I)P.current.add(a.id);A.current=!1}},[I]);const W=(0,s.useCallback)(a=>A.current||P.current.has(a)?!1:(P.current.add(a),!0),[]);(0,s.useEffect)(()=>{m(He)},[l]);const J=(0,s.useCallback)(()=>{const a=f.current;!a||!T||a.scrollHeight-a.scrollTop-a.clientHeight<100&&m(c=>c+kr)},[T]),x=(0,s.useMemo)(()=>{const a=new Set;for(const c of I??[])c.action==="heartbeat.invoked"&&Ie(c.createdAt)&&a.add(c.entityId);for(const c of I??[])c.action==="heartbeat.cancelled"&&a.delete(c.entityId);return a},[I]),E=i((a,c,q)=>{let _=null;if(c>0){const H="type"in a?a.latestEvent.createdAt:a.createdAt,U=q[c-1],n=Ie("type"in U?U.latestEvent.createdAt:U.createdAt),ee=Ie(H);n&&!ee&&(_=(0,e.jsxs)("div",{className:"flex items-center gap-2 px-4 py-1.5",children:[(0,e.jsx)("div",{className:"h-px flex-1 bg-border"}),(0,e.jsx)("span",{className:"text-(length:--text-nano) font-medium text-muted-foreground uppercase tracking-wider",children:"Earlier"}),(0,e.jsx)("div",{className:"h-px flex-1 bg-border"})]},`sep-${c}`))}if("type"in a&&a.type==="collapsed"){const H=W(a.latestEvent.id)?"feed-item-new":"";return(0,e.jsxs)("div",{children:[_,(0,e.jsx)("div",{className:H,children:(0,e.jsx)(Nr,{group:a,agentMap:j,entityNameMap:N,entityTitleMap:B})})]},`group-${a.latestEvent.id}`)}const C=a,L=Ee(C),Z=W(C.id)?"feed-item-new":"",Q=x.has(C.entityId)&&C.action==="heartbeat.invoked";return L===1?(0,e.jsxs)("div",{children:[_,(0,e.jsx)("div",{className:Z||void 0,children:(0,e.jsx)(Ae,{event:C,agentMap:j,entityNameMap:N,entityTitleMap:B,isActive:Q})})]},C.id):(0,e.jsxs)("div",{children:[_,(0,e.jsx)("div",{className:Z||void 0,children:(0,e.jsx)(Ae,{event:C,agentMap:j,entityNameMap:N,entityTitleMap:B,isActive:Q,isMuted:!0})})]},C.id)},"renderItem"),ie=i(()=>{const a=new Map;for(const c of K){const q="type"in c||c.entityType==="issue"?c.entityId:"__other__",_=a.get(q)??[];_.push(c),a.set(q,_)}return Array.from(a.entries()).map(([c,q])=>{const _=c==="__other__",C=N.get(`issue:${c}`),L=B.get(`issue:${c}`),Z=_?"Other activity":`${C??c}${L?` — ${L}`:""}`;return(0,e.jsxs)("div",{className:"mb-2",children:[(0,e.jsx)("div",{className:"sticky top-0 z-10 bg-background/95 backdrop-blur-sm border-b px-4 py-1.5",children:(0,e.jsx)("p",{className:"text-xs font-medium text-muted-foreground truncate",children:Z})}),q.map((Q,H)=>E(Q,H,q))]},c)})},"renderGrouped"),ae=(0,s.useMemo)(()=>w?w.length===0?{text:"No agents set up yet. Add an agent to get started.",showPulse:!1}:w.every(a=>a.status==="paused")?{text:"All agents are paused. Resume agents from the sidebar to see activity.",showPulse:!1}:{text:"Your agents are running — activity will appear here shortly.",showPulse:!0}:null,[w]),R=K.length===0;return(0,e.jsxs)("aside",{className:y("flex min-h-0 min-w-0 flex-1 flex-col bg-background",t),children:[(0,e.jsxs)("div",{className:"relative flex shrink-0 items-start justify-between gap-2 px-4 py-3",children:[(0,e.jsx)("div",{className:"pointer-events-none absolute bottom-0 right-0 left-0 h-px bg-border md:-left-3","aria-hidden":!0}),(0,e.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,e.jsx)("h3",{className:"text-sm font-semibold",children:"Agent Feed"}),(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:"Live activity from your agents"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsxs)(ye,{children:[(0,e.jsx)(ve,{asChild:!0,children:(0,e.jsx)(pe,{type:"button",variant:p==="by-task"?"secondary":"ghost",size:"icon-sm",className:"shrink-0 text-muted-foreground","aria-label":"group by task",onClick:i(()=>h(a=>a==="flat"?"by-task":"flat"),"onClick"),children:(0,e.jsx)(Et,{className:"h-3.5 w-3.5"})})}),(0,e.jsx)(we,{side:"bottom",children:p==="flat"?"Group by task":"Show flat"})]}),(0,e.jsxs)(Xt,{children:[(0,e.jsxs)(ye,{children:[(0,e.jsx)(ve,{asChild:!0,children:(0,e.jsx)(kt,{asChild:!0,children:(0,e.jsx)(pe,{type:"button",variant:l!=="all"||b?"secondary":"ghost",size:"icon-sm",className:"shrink-0 text-muted-foreground","aria-label":"filter by",children:(0,e.jsx)(ft,{className:"h-3.5 w-3.5"})})})}),(0,e.jsx)(we,{side:"bottom",children:"Filter by"})]}),(0,e.jsxs)(Ot,{align:"end",className:"w-48",children:[(0,e.jsx)(sr,{value:l,onValueChange:i(a=>d(a),"onValueChange"),children:hr.map(({value:a,label:c})=>(0,e.jsx)($t,{value:a,children:c},a))}),(0,e.jsx)(rr,{}),(0,e.jsx)(Ut,{checked:b,onCheckedChange:i(a=>S(!!a),"onCheckedChange"),children:"Show all activity"})]})]})]})]}),(0,e.jsx)("div",{ref:f,className:"flex-1 min-h-0 overflow-y-auto",onScroll:J,children:R?(0,e.jsx)("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6 h-full",children:(0,e.jsxs)("div",{className:"flex flex-col items-center gap-2 max-w-(--sz-16rem)",children:[ae?.showPulse&&(0,e.jsxs)("span",{className:"relative flex h-2.5 w-2.5",children:[(0,e.jsx)("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-primary/40"}),(0,e.jsx)("span",{className:"relative inline-flex h-2.5 w-2.5 rounded-full bg-primary/60"})]}),(0,e.jsx)("p",{className:"text-center text-sm text-muted-foreground",children:ae?.text??"Activity from your agents will appear here."})]})}):p==="flat"?(0,e.jsx)("div",{className:"py-2",children:K.map((a,c)=>E(a,c,K))}):ie()})]})}i(Ue,"ActivityFeed");var _r=200;function Ir(t){return!t||t<=0?"":t<1024?`${t} B`:t<1048576?`${Math.round(t/1024)} KB`:`${(t/1048576).toFixed(1)} MB`}i(Ir,"formatAttachmentSize");function ge(t){const o=t.dataTransfer?.types;return o?Array.from(o).includes("Files"):!1}i(ge,"dragHasFiles");var Tr=(0,s.forwardRef)(i(function({value:o,onChange:l,onSubmit:d,placeholder:p="Message…",disabled:h=!1,submitting:b=!1,submitKey:S="mod-enter",singleLine:g=!1,tone:m="standard",surface:f="card",autoFocus:P=!1,sendLabel:A="Send message",onAttachFiles:M,attachments:z=[],attaching:$=!1,acceptFileTypes:I,leadingTools:F,trailingTools:w,hint:v,className:j,textareaClassName:N,inputTestId:B="chat-composer-input"},Y){const K=(0,s.useRef)(null),T=(0,s.useRef)(null),W=(0,s.useRef)(0),[J,x]=(0,s.useState)(!1),E=typeof M=="function",ie=m==="ask",ae=m==="planning",R=!h&&!b&&o.trim().length>0;(0,s.useImperativeHandle)(Y,()=>({focus:i(()=>K.current?.focus(),"focus")}),[]),(0,s.useLayoutEffect)(()=>{const n=K.current;!n||g||(n.style.height="auto",n.style.height=`${Math.min(n.scrollHeight,_r)}px`)},[o,g]);function a(n){l(g?n.target.value.replace(/\r?\n/g," "):n.target.value)}i(a,"handleChange");function c(n){n.key==="Enter"&&(S==="mod-enter"?n.metaKey||n.ctrlKey:!n.shiftKey&&!n.metaKey&&!n.ctrlKey)&&(n.preventDefault(),R&&d())}i(c,"handleKeyDown");function q(){T.current?.click()}i(q,"triggerFilePicker");async function _(n){!M||n.length===0||await M(n)}i(_,"emitFiles");async function C(n){await _(n.target.files?Array.from(n.target.files):[]),T.current&&(T.current.value="")}i(C,"handleFileInputChange");function L(){W.current=0,x(!1)}i(L,"resetDrag");function Z(n){!E||!ge(n)||(n.preventDefault(),W.current+=1,x(!0))}i(Z,"handleDragEnter");function Q(n){!E||!ge(n)||(n.preventDefault(),n.dataTransfer.dropEffect="copy")}i(Q,"handleDragOver");function H(n){!E||!ge(n)||(n.preventDefault(),W.current=Math.max(0,W.current-1),W.current===0&&x(!1))}i(H,"handleDragLeave");function U(n){!E||!ge(n)||(n.preventDefault(),L(),_(n.dataTransfer?.files?Array.from(n.dataTransfer.files):[]))}return i(U,"handleDrop"),(0,e.jsxs)("div",{"data-testid":"chat-composer","data-tone":m,"data-surface":f,className:y("relative rounded-xl border px-3 pt-2.5 pb-2 transition-colors duration-150 focus-within:border-muted-foreground/40",f==="translucent"?"border-border/70 bg-background/95 shadow-(--shadow-extract-4) backdrop-blur supports-[backdrop-filter]:bg-background/85 dark:shadow-(--shadow-extract-5)":"border-border bg-card",ie&&"border-sky-500/55 bg-sky-50/50 focus-within:border-sky-500/70 dark:border-sky-500/50 dark:bg-sky-500/[0.07]",ae&&"border-amber-500/55 bg-amber-50/50 focus-within:border-amber-500/70 dark:border-amber-500/50 dark:bg-amber-500/[0.07]",J&&E&&"border-muted-foreground/50 bg-accent/20",h&&"opacity-60",j),onDragEnter:Z,onDragOver:Q,onDragLeave:H,onDrop:U,children:[J&&E?(0,e.jsx)("div",{"data-testid":"chat-composer-drop-overlay",className:"pointer-events-none absolute inset-1.5 z-20 flex items-center justify-center rounded-lg border border-dashed border-muted-foreground/50 bg-background/80 text-xs text-muted-foreground backdrop-blur-(--blur-1px)",children:(0,e.jsxs)("span",{className:"inline-flex items-center gap-2",children:[(0,e.jsx)(Ke,{className:"h-3.5 w-3.5"}),"Drop to attach"]})}):null,(0,e.jsx)("textarea",{ref:K,"data-testid":B,value:o,onChange:a,onKeyDown:c,placeholder:p,disabled:h,autoFocus:P,rows:1,wrap:g?"off":"soft",className:y("block min-h-(--sz-22px) w-full resize-none border-0 bg-transparent p-0 text-sm leading-6 text-foreground outline-none placeholder:text-muted-foreground focus:outline-none focus:ring-0",g?"max-h-(--sz-22px) overflow-x-auto whitespace-nowrap":"max-h-(--sz-200px) overflow-y-auto",N)}),z.length>0?(0,e.jsx)("div",{"data-testid":"chat-composer-attachments",className:"mt-2 space-y-1 rounded-md border border-dashed border-border/80 bg-muted/20 p-1.5",children:z.map(n=>{const ee=Ir(n.size),ne=n.status==="uploading"?"Uploading…":n.status==="error"?n.error??"Upload failed":n.inline?"Inserted inline":"Attached";return(0,e.jsxs)("div",{className:y("flex min-w-0 items-center gap-2 rounded-sm px-2 py-1 text-xs",n.status==="error"?"bg-destructive/10 text-destructive":"bg-background/70 text-muted-foreground"),children:[n.status==="uploading"?(0,e.jsx)(fe,{className:"h-3.5 w-3.5 shrink-0 animate-spin"}):n.status==="attached"?(0,e.jsx)(Tt,{className:"h-3.5 w-3.5 shrink-0 text-green-600 dark:text-green-400"}):(0,e.jsx)(Lt,{className:"h-3.5 w-3.5 shrink-0"}),(0,e.jsx)("span",{className:"min-w-0 flex-1 truncate font-medium text-foreground",children:n.name}),ee?(0,e.jsx)("span",{className:"shrink-0",children:ee}):null,(0,e.jsx)("span",{className:"shrink-0",children:ne})]},n.id)})}):null,v?(0,e.jsx)("div",{className:"mt-2 inline-flex items-center rounded-full border border-border/70 bg-muted/30 px-2 py-0.5 text-(length:--text-micro) text-muted-foreground",children:v}):null,(0,e.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[E?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("input",{ref:T,type:"file",accept:I,className:"hidden",onChange:C}),(0,e.jsx)("button",{type:"button",onClick:q,disabled:h||$,"aria-label":"Attach files",title:"Attach files",className:"grid h-7 w-7 shrink-0 place-items-center rounded-md text-muted-foreground transition-colors duration-150 hover:bg-accent hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",children:$?(0,e.jsx)(fe,{className:"h-4 w-4 animate-spin"}):(0,e.jsx)(Ke,{className:"h-4 w-4"})})]}):null,F,(0,e.jsx)("span",{className:"flex-1"}),w,(0,e.jsx)("button",{type:"button",onClick:i(()=>{R&&d()},"onClick"),disabled:!R,"aria-label":A,title:A,className:y("grid h-7 w-7 shrink-0 place-items-center rounded-md transition-colors duration-150 disabled:cursor-not-allowed",R?"bg-foreground text-background hover:opacity-90":"bg-accent text-muted-foreground"),children:b?(0,e.jsx)(fe,{className:"h-3.5 w-3.5 animate-spin"}):(0,e.jsx)(xt,{className:"h-3.5 w-3.5"})})]})]})},"ChatComposer")),Ve=12,de=280,Cr=2/3,Te="max-w-full overflow-visible [&>*:first-child]:mt-0 [&>*:last-child]:mb-0 [&_pre]:max-w-full [&_pre]:overflow-x-auto [&_table]:block [&_table]:max-w-full [&_table]:overflow-x-auto",oe="min-w-0 max-w-(--pct-85) break-words px-3 py-2 text-sm overflow-x-auto overflow-y-visible";function Ce({agent:t}){return(0,e.jsxs)("div",{className:"mb-1 flex items-center gap-1.5 pl-1",children:[(0,e.jsx)(Me,{agent:t,size:24}),(0,e.jsx)("span",{className:"text-sm font-medium text-foreground",children:t.name})]})}i(Ce,"AgentBubbleHeader");function Qe(){return(0,e.jsx)("div",{className:"flex justify-start",children:(0,e.jsx)("div",{className:y(oe,"bg-card border border-border text-foreground [border-radius:14px_14px_14px_4px]"),children:(0,e.jsxs)("span",{className:"typing-dots","aria-label":"typing",children:[(0,e.jsx)("span",{}),(0,e.jsx)("span",{}),(0,e.jsx)("span",{})]})})})}i(Qe,"TypingBubble");function Lr(){const{selectedCompanyId:t,selectedCompany:o}=Ye(),{setBreadcrumbs:l}=Bt(),d=It();(0,s.useEffect)(()=>{l([{label:"Conference Room"}])},[l]);const p=(0,s.useRef)(null),[h,b]=(0,s.useState)(0),[S,g]=(0,s.useState)(Cr),m=(0,s.useRef)(!1);(0,s.useLayoutEffect)(()=>{const r=p.current;if(!r)return;const u=new ResizeObserver(()=>{b(r.clientWidth)});return u.observe(r),b(r.clientWidth),()=>u.disconnect()},[]);const f=Math.max(0,h-Ve),P=de,A=f-de,M=f>0?Math.min(1,de/f):0,z=f>0?Math.max(0,1-de/f):1,$=f>0?A<P?Math.max(0,Math.round(f/2)):Math.round(f*Math.min(z,Math.max(M,S))):0,I=(0,s.useCallback)(r=>{r.preventDefault(),m.current=!0;const u=r.clientX,k=$,V=i(X=>{if(!m.current)return;const le=(p.current?.clientWidth??h)-Ve,ce=de,ue=le-de,Ne=k+X.clientX-u;le<=0||(ue<ce?g(.5):g(Math.min(ue,Math.max(ce,Ne))/le))},"onMouseMove"),G=i(()=>{m.current=!1,document.removeEventListener("mousemove",V),document.removeEventListener("mouseup",G)},"onMouseUp");document.addEventListener("mousemove",V),document.addEventListener("mouseup",G)},[h,$]),[F,w]=(0,s.useState)(""),v=(0,s.useRef)(null),[j,N]=(0,s.useState)(!1),[B,Y]=(0,s.useState)(""),[K,T]=(0,s.useState)(""),[W,J]=(0,s.useState)(""),[x,E]=(0,s.useState)(null),[ie,ae]=(0,s.useState)(0),[R,a]=(0,s.useState)(null),c=(0,s.useRef)(null),q=(0,s.useRef)(null),_=(0,s.useRef)(!1),C=(0,s.useRef)(null),L=(0,s.useRef)(null),[Z,Q]=(0,s.useState)(!1),H=(0,s.useRef)(!0),U=(0,s.useCallback)((r="smooth")=>{c.current?.scrollIntoView({behavior:r,block:"end"}),H.current=!0,Q(!1)},[]),[n,ee]=(0,s.useState)(!1),[ne,je]=(0,s.useState)(!1),Re=(0,s.useRef)(t);(0,s.useEffect)(()=>{Re.current!==t&&(x&&d.removeQueries({queryKey:O.issues.comments(x)}),E(null),Y(""),T(""),N(!1),a(null),Re.current=t)},[t,x,d]),(0,s.useEffect)(()=>{if(t&&v.current!==t){try{const r=sessionStorage.getItem(`paperclip.boardChat.draft.${t}`);w(r??"")}catch{w("")}v.current=t}},[t]),(0,s.useEffect)(()=>{if(t&&v.current===t)try{const r=`paperclip.boardChat.draft.${t}`;F?sessionStorage.setItem(r,F):sessionStorage.removeItem(r)}catch{}},[F,t]);const{data:he}=se({queryKey:O.agents.list(t),queryFn:i(()=>Ze.list(t),"queryFn"),enabled:!!t}),te=(0,s.useMemo)(()=>he?.find(r=>r.role==="ceo"&&r.status!=="terminated"),[he]),{data:De}=se({queryKey:O.goals.list(t),queryFn:i(()=>nr.list(t),"queryFn"),enabled:!!t}),ze=(0,s.useMemo)(()=>(De??[]).find(r=>r.status==="active")?.title??null,[De]),{data:ke}=se({queryKey:O.issues.listIndex(t),queryFn:i(({signal:r})=>me.listCompact(t,{projection:"index"},{signal:r}),"queryFn"),enabled:!!t});(0,s.useEffect)(()=>{if(!ke){E(null);return}const r=ke.find(u=>u.title==="Board Operations"&&u.status!=="done"&&u.status!=="cancelled");E(r?.id??null)},[ke]);const{data:xe}=se({queryKey:O.issues.comments(x??""),queryFn:i(()=>me.listComments(x),"queryFn"),enabled:!!x,refetchInterval:3e3}),re=(xe??[]).slice().sort((r,u)=>new Date(r.createdAt).getTime()-new Date(u.createdAt).getTime()),tt=(0,s.useMemo)(()=>new Map((he??[]).map(r=>[r.id,r])),[he]),{data:$e}=se({queryKey:O.issues.feedbackVotes(x??""),queryFn:i(()=>me.listFeedbackVotes(x),"queryFn"),enabled:!!x}),rt=(0,s.useMemo)(()=>{const r=new Map;for(const u of $e??[])u.targetType==="issue_comment"&&r.set(u.targetId,u.vote);return r},[$e]),st=(0,s.useCallback)(async(r,u,k)=>{x&&(await me.upsertFeedbackVote(x,{targetType:"issue_comment",targetId:r,vote:u,reason:k?.reason,allowSharing:k?.allowSharing}),d.invalidateQueries({queryKey:O.issues.feedbackVotes(x)}))},[x,d]);(0,s.useEffect)(()=>{ee(!1),je(!1)},[t]);const{onboardingOpen:Fe}=Ct(),[qe,at]=(0,s.useState)(()=>document.visibilityState!=="hidden");(0,s.useEffect)(()=>{const r=i(()=>at(document.visibilityState!=="hidden"),"onVisibilityChange");return document.addEventListener("visibilitychange",r),()=>document.removeEventListener("visibilitychange",r)},[]);const Le=!!te&&!!o;(0,s.useEffect)(()=>{if(!Le||n||Fe||!qe)return;const r=setTimeout(()=>ee(!0),2e3);return()=>clearTimeout(r)},[Le,n,Fe,qe]),(0,s.useEffect)(()=>{if(!n||ne)return;const r=setTimeout(()=>je(!0),700);return()=>clearTimeout(r)},[n,ne]),(0,s.useEffect)(()=>{n&&ne||xe&&xe.some(r=>!r.authorAgentId&&r.authorUserId!=="board-concierge")&&(ee(!0),je(!0))},[xe,n,ne]),(0,s.useEffect)(()=>{R&&re.length>0&&[...re].reverse().find(r=>!r.authorAgentId&&r.authorUserId!=="board-concierge")?.body===R&&a(null)},[re,R]),(0,s.useEffect)(()=>{if(_.current||re.length===0)return;const r=q.current;if(r){try{const u=sessionStorage.getItem("paperclip.boardChat.scrollTop");if(u!=null){const k=Number(u);if(Number.isFinite(k)){r.scrollTop=k,_.current=!0;return}}}catch{}r.scrollTop=r.scrollHeight,_.current=!0}},[re.length]),(0,s.useEffect)(()=>{R&&U("smooth")},[R,U]),(0,s.useEffect)(()=>{_.current&&(H.current?U("smooth"):Q(!0))},[re.length,B,K,U]),(0,s.useEffect)(()=>{const r=q.current;if(!r)return;let u=null;const k=i(()=>{const V=r.scrollHeight-r.scrollTop-r.clientHeight<=80;H.current=V,V&&Q(!1),u==null&&(u=requestAnimationFrame(()=>{u=null;try{sessionStorage.setItem("paperclip.boardChat.scrollTop",String(r.scrollTop))}catch{}}))},"handleScroll");return r.addEventListener("scroll",k,{passive:!0}),()=>{r.removeEventListener("scroll",k),u!=null&&cancelAnimationFrame(u)}},[]),(0,s.useEffect)(()=>{if(j){ae(0);const r=Date.now();L.current=setInterval(()=>{ae((Date.now()-r)/1e3)},100)}else L.current&&(clearInterval(L.current),L.current=null);return()=>{L.current&&clearInterval(L.current)}},[j]);const Oe=(0,s.useCallback)(async r=>{const u=r.trim();if(!(!u||j||!t)){a(u),N(!0),w(""),Y(""),J(""),T("Connecting...");try{const k=new AbortController,V=setTimeout(()=>k.abort(),13e4),G=await fetch("/api/board/chat/stream",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({companyId:t,message:u,taskId:x??void 0}),signal:k.signal});if(clearTimeout(V),!G.ok||!G.body)throw new Error("Board chat stream not available");T("Thinking...");const X=G.body.getReader(),le=new TextDecoder;let ce="",ue="";for(;;){const{done:Ne,value:ct}=await X.read();if(Ne)break;ce+=le.decode(ct,{stream:!0});const Pe=ce.split(`
16
+ `);ce=Pe.pop()??"";for(const Be of Pe)if(Be.startsWith("data: "))try{const D=JSON.parse(Be.slice(6));D.type==="chunk"&&D.text?(ue+=D.text,Y(ue),T("")):D.type==="status"&&D.text?T(D.text):D.type==="start"&&D.issueId?E(D.issueId):D.type==="error"?(J(D.message||"The board assistant couldn't respond. Please try again."),T("")):D.type==="done"&&D.issueId&&(d.invalidateQueries({queryKey:O.issues.comments(D.issueId)}),d.invalidateQueries({queryKey:O.issues.list(t)}))}catch{}}Y(""),T(""),x&&d.invalidateQueries({queryKey:O.issues.comments(x)})}catch{T(""),J("The board assistant is unavailable right now. Please try again in a moment.")}finally{N(!1),C.current?.focus()}}},[j,t,x,d]),nt=(0,s.useCallback)(()=>{Oe(F)},[F,Oe]),[ot,it]=(0,s.useState)(!1);return t?(0,e.jsxs)("div",{className:"flex h-(--sz-calc-29) flex-col -m-6",children:[(0,e.jsxs)("div",{ref:p,className:"flex min-h-0 min-w-0 flex-1 flex-row",children:[(0,e.jsxs)("div",{className:y("relative flex min-h-0 min-w-0 shrink-0 flex-col bg-background","w-full md:w-auto",f<=0&&"md:w-2/3"),style:f>0&&h>=572?{width:$}:void 0,children:[(0,e.jsxs)("div",{className:"relative flex shrink-0 items-center justify-between gap-2 px-4 py-3",children:[(0,e.jsx)("div",{className:"pointer-events-none absolute bottom-0 left-0 right-0 h-px bg-border","aria-hidden":!0}),(0,e.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,e.jsx)("h3",{className:"text-sm font-semibold",children:te?.name??"Conference Room"}),(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:o?.name??"Your organization"})]}),(0,e.jsxs)("div",{className:"flex shrink-0 items-center gap-0.5",children:[(0,e.jsxs)(ye,{children:[(0,e.jsx)(ve,{asChild:!0,children:(0,e.jsx)(pe,{type:"button",variant:"ghost",size:"icon-sm",className:"text-muted-foreground","aria-label":"chat history",children:(0,e.jsx)(vt,{className:"h-4 w-4"})})}),(0,e.jsx)(we,{side:"bottom",children:"chat history"})]}),(0,e.jsxs)(ye,{children:[(0,e.jsx)(ve,{asChild:!0,children:(0,e.jsx)(pe,{type:"button",variant:"ghost",size:"icon-sm",className:"text-muted-foreground","aria-label":"new chat",children:(0,e.jsx)(mt,{className:"h-4 w-4"})})}),(0,e.jsx)(we,{side:"bottom",children:"new chat"})]})]})]}),(0,e.jsx)("div",{className:"relative min-h-0 min-w-0 flex-1",children:(0,e.jsx)("div",{ref:q,className:"scrollbar-auto-hide absolute inset-0 overflow-y-auto overflow-x-hidden",children:(0,e.jsxs)("div",{className:"flex flex-col gap-4 px-6 pt-3 pb-32",children:[!n&&(0,e.jsx)(Qe,{}),n&&te&&o&&(()=>{const r=te.name,u=o.name,k=`Welcome to **${u}**! I'm ${r}, your team lead. I've read through what you shared in the wizard${ze?` — your mission is "${ze}".`:"."}
17
+
18
+ Here are a few things I can help you put on paper right now. Pick one below and I'll draft it for you using everything you told us.`,V=re.some(X=>!X.authorAgentId&&X.authorUserId!=="board-concierge"),G=[{label:"Draft an Organization Brief",prompt:`Draft a one-page Organization Brief for ${u} — include our mission, team roster, and first priorities.`},{label:"Create a hiring plan",prompt:`Create a hiring plan for ${u}. List the next roles to hire, in priority order, with a short rationale for each.`},{label:"Outline our first 30 days",prompt:"Outline our first 30 days. Break it into weekly priorities with who owns what."},{label:"Write an intro pitch",prompt:`Write a short intro pitch for ${u} that I could reuse for investors, customers, or recruits.`}];return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"flex flex-col items-start",children:[(0,e.jsx)(Ce,{agent:{...te,name:r}}),(0,e.jsx)("div",{className:y(oe,"bg-card border border-border text-foreground [border-radius:14px_14px_14px_4px]"),children:(0,e.jsx)(_e,{className:Te,children:k})})]}),!V&&ne&&(0,e.jsx)("div",{className:"flex flex-wrap gap-2 pl-1",children:G.map(X=>(0,e.jsx)("button",{type:"button",onClick:i(()=>{w(X.prompt),C.current?.focus()},"onClick"),className:"rounded-full border border-border bg-card px-3 py-1.5 text-xs text-muted-foreground transition-colors duration-150 hover:bg-accent hover:text-foreground",children:X.label},X.label))})]})})(),re.map(r=>{if(!r.authorAgentId&&r.authorUserId!=="board-concierge")return(0,e.jsx)("div",{className:"flex justify-end",children:(0,e.jsx)("div",{className:y(oe,"bg-blue-600 text-white [border-radius:14px_14px_4px_14px]"),children:r.body??""})},r.id);const u=r.authorAgentId?tt.get(r.authorAgentId)??null:te??null,k=u?.name??"Assistant";return u?.icon,(0,e.jsxs)("div",{className:"flex flex-col items-start",children:[(0,e.jsx)(Ce,{agent:u??{id:r.authorAgentId??void 0,name:k}}),(0,e.jsx)("div",{className:y(oe,"bg-card border border-border text-foreground [border-radius:14px_14px_14px_4px]"),children:(0,e.jsx)(_e,{className:Te,children:r.body??""})}),(0,e.jsx)(ut,{copyText:r.body??"",dateLabel:lt(r.createdAt),dateTitle:Mt(r.createdAt),anchorHref:`#comment-${r.id}`,feedback:x?{activeVote:rt.get(r.id)??null,sharingPreference:"prompt",termsUrl:null,onVote:i((V,G)=>st(r.id,V,G),"onVote")}:null})]},r.id)}),R&&(0,e.jsx)("div",{className:"flex justify-end",children:(0,e.jsx)("div",{className:y(oe,"bg-blue-600 text-white [border-radius:14px_14px_4px_14px]"),children:R})}),B&&(0,e.jsxs)("div",{className:"flex flex-col items-start",children:[te&&(0,e.jsx)(Ce,{agent:te}),(0,e.jsx)("div",{className:y(oe,"bg-card border border-border text-foreground [border-radius:14px_14px_14px_4px]"),children:(0,e.jsx)(_e,{className:Te,children:B})})]}),j&&!B&&(0,e.jsx)(Qe,{}),j&&(0,e.jsxs)("div",{className:"flex items-center gap-2 pl-1 text-xs text-muted-foreground",children:[(0,e.jsx)("img",{src:"/paperclip-thinking.svg",alt:"",className:"inline-block shrink-0",style:{width:14,height:14}}),(0,e.jsx)("span",{children:K||"Thinking..."}),ie>0&&(0,e.jsxs)("span",{className:"opacity-50",children:[ie.toFixed(1),"s"]})]}),W&&!j&&(0,e.jsx)("div",{role:"alert",className:"flex justify-start",children:(0,e.jsx)("div",{className:y(oe,"bg-destructive/10 border border-destructive/30 text-destructive [border-radius:14px_14px_14px_4px]"),children:W})}),(0,e.jsx)("div",{ref:c})]})})}),Z&&(0,e.jsx)("button",{type:"button",onClick:i(()=>U("smooth"),"onClick"),"aria-label":"Jump to latest messages",className:"absolute bottom-24 left-1/2 z-20 grid h-8 w-8 -translate-x-1/2 place-items-center rounded-full border border-border bg-card text-foreground shadow-md transition-colors duration-150 hover:bg-accent hover:border-muted-foreground/30",children:(0,e.jsx)(_t,{className:"h-4 w-4"})}),(0,e.jsx)("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 z-10 bg-gradient-to-t from-background via-background/95 to-background/0 px-6 pt-6 pb-5",children:(0,e.jsx)(Tr,{ref:C,value:F,onChange:w,onSubmit:nt,placeholder:"Ask anything about your organization...",submitKey:"enter",surface:"translucent",submitting:j,disabled:j,sendLabel:"Send message",className:"pointer-events-auto"})})]}),(0,e.jsx)("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize board chat and agent feed",className:"group relative hidden w-3 shrink-0 cursor-col-resize bg-background md:flex",onMouseDown:I,children:(0,e.jsx)("div",{className:"pointer-events-none absolute top-0 bottom-0 left-0 w-px bg-border transition-colors group-hover:bg-foreground/20","aria-hidden":!0})}),(0,e.jsx)("div",{className:"hidden md:flex md:min-h-0 md:min-w-0 md:flex-1",children:(0,e.jsx)(Ue,{})})]}),(0,e.jsx)("div",{className:"md:hidden",children:(0,e.jsxs)(Ft,{open:ot,onOpenChange:it,children:[(0,e.jsx)(Jt,{asChild:!0,children:(0,e.jsx)(pe,{type:"button",size:"icon",variant:"secondary",className:"fixed bottom-20 right-4 z-20 h-10 w-10 rounded-full shadow-lg","aria-label":"Open agent feed",children:(0,e.jsx)(Dt,{className:"h-4 w-4"})})}),(0,e.jsx)(Gt,{side:"bottom",className:"h-(--sz-70vh) p-0 rounded-t-xl",children:(0,e.jsx)(Ue,{})})]})})]}):(0,e.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,e.jsxs)("div",{className:"text-center max-w-sm",children:[(0,e.jsx)("h2",{className:"text-lg font-semibold",children:"No organization selected"}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground mt-2",children:"Select an organization to start chatting with your board concierge."})]})})}i(Lr,"BoardChat");export{Lr as BoardChat};
@@ -0,0 +1 @@
1
+ var b=Object.defineProperty;var t=(r,m)=>b(r,"name",{value:m,configurable:!0});import{a as g}from"./rolldown-runtime-DhZMWcEn.js";import{$A as w,E_ as l,GS as n,Gb as h,ME as f,NE as d,YS as v,aE as C,ab as q,ay as y,bE as E,hE as S,nj as k,oE as Q,ub as _,xE as p}from"./index-Bt31d8ga.js";var B=g(k(),1),e=g(w(),1);function M(){const r=f(),m=C(),[j]=Q(),s=(m.token??"").trim(),a=(j.get("code")??"").trim(),N=(0,B.useMemo)(()=>`/board-claim/${encodeURIComponent(s)}${a?`?code=${encodeURIComponent(a)}`:""}`,[s,a]),u=p({queryKey:n.auth.session,queryFn:t(()=>v.getSession(),"queryFn")}),o=p({queryKey:["board-claim",s,a],queryFn:t(()=>y.getBoardClaimStatus(s,a),"queryFn"),enabled:s.length>0&&a.length>0}),c=_(o),i=E({mutationFn:t(()=>y.claimBoard(s,a),"mutationFn"),onSuccess:t(async()=>{await r.invalidateQueries({queryKey:n.auth.session}),await r.invalidateQueries({queryKey:n.health}),await r.invalidateQueries({queryKey:n.companies.all}),await r.invalidateQueries({queryKey:n.companies.stats}),await o.refetch()},"onSuccess")});if(!s||!a)return(0,e.jsx)("div",{className:"mx-auto max-w-xl py-10 text-sm text-destructive",children:"Invalid board claim URL."});if(o.isLoading||u.isLoading)return(0,e.jsx)("div",{className:"mx-auto max-w-xl py-10 text-sm text-muted-foreground",children:"Loading claim challenge..."});if(c.kind==="error")return(0,e.jsx)("div",{className:"mx-auto max-w-xl py-10",children:(0,e.jsx)(l,{className:"block p-6",children:(0,e.jsx)(q,{size:"panel",error:c.error,action:"load the board claim challenge",onRetry:c.retry,retrying:c.isFetching})})});const x=o.data;return x?x.status==="claimed"?(0,e.jsx)("div",{className:"mx-auto max-w-xl py-10",children:(0,e.jsxs)(l,{className:"block p-6",children:[(0,e.jsx)("h1",{className:"text-lg font-semibold",children:"Board ownership claimed"}),(0,e.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"This instance is now linked to your authenticated user."}),(0,e.jsx)(d,{asChild:!0,className:"mt-4",children:(0,e.jsx)(h,{to:"/",children:"Open board"})})]})}):u.data?(0,e.jsx)("div",{className:"mx-auto max-w-xl py-10",children:(0,e.jsxs)(l,{className:"block p-6",children:[(0,e.jsx)("h1",{className:"text-xl font-semibold",children:"Claim Board ownership"}),(0,e.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"This will promote your user to instance admin and migrate organization ownership access from local trusted mode."}),i.isError&&(0,e.jsx)("p",{className:"mt-3 text-sm text-destructive",children:S(i.error).body}),(0,e.jsx)(d,{className:"mt-5",onClick:t(()=>i.mutate(),"onClick"),disabled:i.isPending,children:i.isPending?"Claiming…":"Claim ownership"})]})}):(0,e.jsx)("div",{className:"mx-auto max-w-xl py-10",children:(0,e.jsxs)(l,{className:"block p-6",children:[(0,e.jsx)("h1",{className:"text-lg font-semibold",children:"Sign in required"}),(0,e.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"Sign in or create an account, then return to this page to claim Board ownership."}),(0,e.jsx)(d,{asChild:!0,className:"mt-4",children:(0,e.jsx)(h,{to:`/auth?next=${encodeURIComponent(N)}`,children:"Sign in / Create account"})})]})}):(0,e.jsx)("div",{className:"mx-auto max-w-xl py-10 text-sm text-destructive",children:"Claim challenge unavailable."})}t(M,"BoardClaimPage");export{M as BoardClaimPage};
@@ -0,0 +1 @@
1
+ var c=Object.defineProperty;var s=(t,d)=>c(t,"name",{value:d,configurable:!0});import{a as l}from"./rolldown-runtime-DhZMWcEn.js";import{$A as o,AC as m,E_ as x,NE as a,_C as h,_w as r,hC as u,tr as p}from"./index-Bt31d8ga.js";var e=l(o(),1),f={"signed-out-private":"1 · authenticated/private — signed out (browser claim available)","signed-in-private":"2 · authenticated/private — signed in (claim CTA primary)",claiming:"3 · authenticated/private — claim in flight","claim-error":"4 · authenticated/private — claim error (e.g. 409 already claimed)","claim-success":"5 · authenticated/private — claim succeeded, redirect pending","public-invite-only":"6 · authenticated/public — invite-only (no browser claim)"},j=["signed-out-private","signed-in-private","claiming","claim-error","claim-success","public-invite-only"];function n({hasActiveInvite:t}){return(0,e.jsxs)("div",{className:"mt-6 border-t border-border pt-5",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium",children:[(0,e.jsx)(h,{className:"size-4 text-muted-foreground","aria-hidden":!0}),(0,e.jsx)("span",{children:"Prefer to finish setup from the host?"})]}),(0,e.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:t?"A bootstrap invite is already active. Check your Microvac startup logs for the first‑admin URL, or run this command on the host to rotate it:":"Run this command on the host that runs Microvac to print a one‑time first‑admin invite URL:"}),(0,e.jsx)("pre",{className:"mt-3 overflow-x-auto rounded-md border border-border bg-muted/30 p-3 font-mono text-xs",children:p})]})}s(n,"CliFallback");function i({children:t}){return(0,e.jsx)("div",{className:"mx-auto max-w-xl py-10",children:(0,e.jsx)(x,{className:"block p-6",children:t})})}s(i,"StateChrome");function g(){return(0,e.jsxs)(i,{children:[(0,e.jsx)("h1",{className:"text-xl font-semibold",children:"Finish setting up this Microvac"}),(0,e.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"No admin has claimed this instance yet. Sign in or create your Microvac account to become the first admin from this browser."}),(0,e.jsx)("div",{className:"mt-5",children:(0,e.jsx)(a,{asChild:!0,children:(0,e.jsx)("a",{href:"/auth?next=/",children:"Sign in / Create account"})})}),(0,e.jsx)(n,{hasActiveInvite:!1})]})}s(g,"SignedOutPrivate");function v(){return(0,e.jsxs)(i,{children:[(0,e.jsx)("h1",{className:"text-xl font-semibold",children:"Finish setting up this Microvac"}),(0,e.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"No admin has claimed this instance yet. Claim it now to become the first admin and start onboarding."}),(0,e.jsxs)("div",{className:"mt-5 flex flex-wrap items-center gap-3",children:[(0,e.jsx)(a,{children:"Claim this instance"}),(0,e.jsxs)("span",{className:"text-sm text-muted-foreground",children:["Signed in as ",(0,e.jsx)("span",{className:"font-medium text-foreground",children:"jane@appliance.local"})]})]}),(0,e.jsxs)("p",{className:"mt-3 text-xs text-muted-foreground",children:["Wrong account?"," ",(0,e.jsx)("a",{href:"/auth?next=/",className:"underline underline-offset-2",children:"Switch account"}),"."]}),(0,e.jsx)(n,{hasActiveInvite:!1})]})}s(v,"SignedInPrivate");function b(){return(0,e.jsxs)(i,{children:[(0,e.jsx)("h1",{className:"text-xl font-semibold",children:"Finish setting up this Microvac"}),(0,e.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"No admin has claimed this instance yet. Claim it now to become the first admin and start onboarding."}),(0,e.jsxs)("div",{className:"mt-5 flex flex-wrap items-center gap-3",children:[(0,e.jsxs)(a,{disabled:!0,children:[(0,e.jsx)(r,{className:"mr-2 size-4 animate-spin","aria-hidden":!0}),"Claiming…"]}),(0,e.jsxs)("span",{className:"text-sm text-muted-foreground",children:["Signed in as ",(0,e.jsx)("span",{className:"font-medium text-foreground",children:"jane@appliance.local"})]})]}),(0,e.jsx)(n,{hasActiveInvite:!1})]})}s(b,"ClaimingPrivate");function N(){return(0,e.jsxs)(i,{children:[(0,e.jsx)("h1",{className:"text-xl font-semibold",children:"Finish setting up this Microvac"}),(0,e.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"No admin has claimed this instance yet. Claim it now to become the first admin and start onboarding."}),(0,e.jsxs)("div",{className:"mt-5 flex flex-wrap items-center gap-3",children:[(0,e.jsx)(a,{children:"Claim this instance"}),(0,e.jsxs)("span",{className:"text-sm text-muted-foreground",children:["Signed in as ",(0,e.jsx)("span",{className:"font-medium text-foreground",children:"jane@appliance.local"})]})]}),(0,e.jsxs)("div",{role:"alert",className:"mt-4 flex items-start gap-2 rounded-md border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive",children:[(0,e.jsx)(u,{className:"mt-0.5 size-4 flex-shrink-0","aria-hidden":!0}),(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"font-medium",children:"Someone else has already claimed this instance."}),(0,e.jsxs)("p",{className:"mt-1 text-destructive/90",children:["Refresh to sign in, or ask the existing admin to invite you from"," ",(0,e.jsx)("span",{className:"font-mono",children:"Settings → Access"}),"."]})]})]}),(0,e.jsx)(n,{hasActiveInvite:!1})]})}s(N,"ClaimErrorPrivate");function C(){return(0,e.jsxs)(i,{children:[(0,e.jsxs)("div",{className:"flex items-start gap-3",children:[(0,e.jsx)("div",{className:"mt-0.5 flex size-9 flex-shrink-0 items-center justify-center rounded-full bg-emerald-500/15 text-emerald-600 dark:text-emerald-400",children:(0,e.jsx)(m,{className:"size-5","aria-hidden":!0})}),(0,e.jsxs)("div",{children:[(0,e.jsx)("h1",{className:"text-xl font-semibold",children:"You’re the instance admin"}),(0,e.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"Setup is complete. Taking you to onboarding to create your first organization…"})]})]}),(0,e.jsxs)("div",{className:"mt-5 flex items-center gap-3",children:[(0,e.jsx)(r,{className:"size-4 animate-spin text-muted-foreground","aria-hidden":!0}),(0,e.jsx)("span",{className:"text-sm text-muted-foreground",children:"Redirecting…"})]}),(0,e.jsx)("div",{className:"mt-5",children:(0,e.jsx)(a,{asChild:!0,variant:"outline",children:(0,e.jsx)("a",{href:"/",children:"Continue to dashboard"})})})]})}s(C,"ClaimSuccess");function y(){return(0,e.jsxs)(i,{children:[(0,e.jsx)("h1",{className:"text-xl font-semibold",children:"This Microvac is waiting on its first admin"}),(0,e.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"This instance runs in invite‑only mode. The operator must generate a one‑time first‑admin invite URL from the host. Once you have the link, open it from this browser to finish setup."}),(0,e.jsx)(n,{hasActiveInvite:!0}),(0,e.jsx)("p",{className:"mt-4 text-xs text-muted-foreground",children:"Browser‑based claim is intentionally disabled in public mode so anyone on the network can’t promote themselves."})]})}s(y,"PublicInviteOnly");var w={"signed-out-private":(0,e.jsx)(g,{}),"signed-in-private":(0,e.jsx)(v,{}),claiming:(0,e.jsx)(b,{}),"claim-error":(0,e.jsx)(N,{}),"claim-success":(0,e.jsx)(C,{}),"public-invite-only":(0,e.jsx)(y,{})};function T(){return(0,e.jsxs)("div",{className:"bg-background min-h-screen pb-16",children:[(0,e.jsx)("header",{className:"border-b border-border bg-muted/20",children:(0,e.jsxs)("div",{className:"mx-auto max-w-3xl px-6 py-6",children:[(0,e.jsx)("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"UX Lab"}),(0,e.jsx)("h1",{className:"mt-1 text-2xl font-semibold",children:"Bootstrap-pending setup states"}),(0,e.jsxs)("p",{className:"mt-2 max-w-2xl text-sm text-muted-foreground",children:["Fixtures for the bootstrap-pending screen in ",(0,e.jsx)("span",{className:"font-mono",children:"CloudAccessGate"}),". Used as the UX spec for"," ",(0,e.jsx)("a",{className:"underline underline-offset-2",href:"/PAP/issues/PAP-10113",children:"PAP-10113"})," ","and the implementation reference for"," ",(0,e.jsx)("a",{className:"underline underline-offset-2",href:"/PAP/issues/PAP-10114",children:"PAP-10114"}),". The browser claim CTA only appears when"," ",(0,e.jsx)("span",{className:"font-mono",children:'deploymentMode === "authenticated"'})," and"," ",(0,e.jsx)("span",{className:"font-mono",children:'deploymentExposure === "private"'}),"."]})]})}),(0,e.jsx)("main",{className:"mx-auto max-w-3xl space-y-12 px-6 pt-10",children:j.map(t=>(0,e.jsxs)("section",{"aria-labelledby":`lab-${t}`,children:[(0,e.jsx)("h2",{id:`lab-${t}`,className:"mb-3 text-xs font-medium uppercase tracking-wider text-muted-foreground",children:f[t]}),(0,e.jsx)("div",{className:"rounded-lg border border-dashed border-border/70 bg-muted/10 p-2",children:w[t]})]},t))})]})}s(T,"BootstrapSetupUxLab");export{T as BootstrapSetupUxLab};