@microvac/ui 0.1.0-rc.14 → 0.1.0-rc.15

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 (280) hide show
  1. package/dist/assets/{ActiveAgentsPanel-C9AP9hJu.js → ActiveAgentsPanel-BEx06tMt.js} +1 -1
  2. package/dist/assets/{AdapterManager-CmxTUKJH.js → AdapterManager-3kEEQWFJ.js} +1 -1
  3. package/dist/assets/{AdvancedToolsRoute-CXsQnTei.js → AdvancedToolsRoute-CgS6B-oh.js} +1 -1
  4. package/dist/assets/{AgentActionButtons-DWq2OuVK.js → AgentActionButtons-Cz3jCEd7.js} +1 -1
  5. package/dist/assets/{AgentAdvancedTab-dhBDxF-H.js → AgentAdvancedTab-BG6ZIAuN.js} +1 -1
  6. package/dist/assets/{AgentBulkSettingsSheet-DYT4ovDg.js → AgentBulkSettingsSheet-BrrbvspS.js} +1 -1
  7. package/dist/assets/{AgentChat-r0TPOfPK.js → AgentChat-Dw9iXD6H.js} +1 -1
  8. package/dist/assets/{AgentDetailPage-Bc_okBuS.js → AgentDetailPage-CuVIHv_q.js} +3 -3
  9. package/dist/assets/{AgentIdentityChip-CB2NBXkZ.js → AgentIdentityChip-BrVCcuHQ.js} +1 -1
  10. package/dist/assets/{AgentRosterFilters-b7qMLv8-.js → AgentRosterFilters-GQ2bdXfW.js} +2 -2
  11. package/dist/assets/{Agents-BsvXy3pZ.js → Agents-clrVQnvc.js} +2 -2
  12. package/dist/assets/{Agents.production-BeOZmzaF.js → Agents.production-DTopo7XB.js} +2 -2
  13. package/dist/assets/{AnimatedDialogContent-CWshmxP2.js → AnimatedDialogContent-CDLfw-dJ.js} +1 -1
  14. package/dist/assets/{AppDetail-DbqENTF_.js → AppDetail-BcWBg5yW.js} +1 -1
  15. package/dist/assets/{AppNotConnected-BhnCqL0F.js → AppNotConnected-NgfyHZ4L.js} +1 -1
  16. package/dist/assets/{ApprovalDetail-B2KiYLTj.js → ApprovalDetail-Dm_1V4tC.js} +1 -1
  17. package/dist/assets/{Approvals-j-wRmqKj.js → Approvals-i5AB3JPj.js} +1 -1
  18. package/dist/assets/{AppsConnect-CcPVEZ0C.js → AppsConnect-D660Tpuo.js} +1 -1
  19. package/dist/assets/{AppsReview-B8eWvKkS.js → AppsReview-DdTqOisY.js} +1 -1
  20. package/dist/assets/{ArtifactEmptyGraphic-5mdkS5jj.js → ArtifactEmptyGraphic-DzxCruYA.js} +1 -1
  21. package/dist/assets/{Artifacts-Bz7Oo6VX.js → Artifacts-CkXBz6nh.js} +1 -1
  22. package/dist/assets/{AssigneePickerInner-DdpF7hck.js → AssigneePickerInner-BNjyABBe.js} +1 -1
  23. package/dist/assets/{AssistantConnection-BpaaJDc_.js → AssistantConnection-CNF6mDmO.js} +1 -1
  24. package/dist/assets/{AttentionInlineVerbs-DlPQVCO-.js → AttentionInlineVerbs-BiyZ1ekZ.js} +1 -1
  25. package/dist/assets/{AttentionQueueRow-BC6ezctS.js → AttentionQueueRow-Bh0dKHpF.js} +1 -1
  26. package/dist/assets/{AuditHub-BVP7LKL9.js → AuditHub-BK848cb4.js} +1 -1
  27. package/dist/assets/{AuditRuns-DqizHgX1.js → AuditRuns-CUdlbP7S.js} +1 -1
  28. package/dist/assets/{Auth-DOF0snjp.js → Auth-DDqxm5gD.js} +1 -1
  29. package/dist/assets/{BoardChat-BYAbDtfd.js → BoardChat-fvKqk0R7.js} +1 -1
  30. package/dist/assets/{BoardClaim-7y41Pr8e.js → BoardClaim-BEC5BZfz.js} +1 -1
  31. package/dist/assets/{BootstrapSetupUxLab-BftH1vOv.js → BootstrapSetupUxLab-CXzErrin.js} +1 -1
  32. package/dist/assets/{Browse-Ck01W1Yl.js → Browse-DoovSMuF.js} +1 -1
  33. package/dist/assets/{BudgetPolicyCard-CKhrzfgy.js → BudgetPolicyCard-BYMlczCq.js} +1 -1
  34. package/dist/assets/{CaseDetail-qlXKJ66D.js → CaseDetail-UMAcSH_x.js} +1 -1
  35. package/dist/assets/{CaseStatus-B3RiZVDH.js → CaseStatus-BI0aMl9l.js} +1 -1
  36. package/dist/assets/{Cases-CFV3V-5X.js → Cases-CMTkGghU.js} +1 -1
  37. package/dist/assets/{ChatEndpointDetail-7Hi5TJNt.js → ChatEndpointDetail-CocNEInH.js} +1 -1
  38. package/dist/assets/{ChatEndpointSetup-CtwgH6sg.js → ChatEndpointSetup-Cyi2tI9K.js} +1 -1
  39. package/dist/assets/{ChatIdentityConfirm-CXjksBwX.js → ChatIdentityConfirm-Ba3JuTX1.js} +1 -1
  40. package/dist/assets/{CliAuth-KVjrGMfZ.js → CliAuth-D2jnueGH.js} +1 -1
  41. package/dist/assets/{Companies-oeJem3De.js → Companies-K75I9dJs.js} +1 -1
  42. package/dist/assets/{CompanyAccess-vWT6G-n_.js → CompanyAccess-Cw6nLUhE.js} +1 -1
  43. package/dist/assets/{CompanyActivity-zOzzeN1B.js → CompanyActivity-BsgmVpWS.js} +1 -1
  44. package/dist/assets/CompanyActivity.production-w-KGxvo6.js +1 -0
  45. package/dist/assets/{CompanyConnections-llSEaVa2.js → CompanyConnections-yRPYSdm7.js} +1 -1
  46. package/dist/assets/{CompanyEnvironments-DNyyGC_S.js → CompanyEnvironments-BA7kWdOJ.js} +1 -1
  47. package/dist/assets/{CompanyExport-CFa-F8Es.js → CompanyExport-DfsK4b9c.js} +1 -1
  48. package/dist/assets/{CompanyImport-DG6qwQ8F.js → CompanyImport-DJHAsmSF.js} +1 -1
  49. package/dist/assets/{CompanySettings-Dv5Z3ZQi.js → CompanySettings-DwzHGXec.js} +1 -1
  50. package/dist/assets/{CompanySettingsPluginPage-CZk1d_0d.js → CompanySettingsPluginPage-Bpa81PF3.js} +1 -1
  51. package/dist/assets/{CompanySkills-CdzWhJfQ.js → CompanySkills-eTqgbqQN.js} +1 -1
  52. package/dist/assets/{CompanySkills.production-IoCRW5FQ.js → CompanySkills.production-CQSWfH0r.js} +1 -1
  53. package/dist/assets/{ConfigureBuiltInAgentModal-BwW7XQ1O.js → ConfigureBuiltInAgentModal-DgeD7t_i.js} +1 -1
  54. package/dist/assets/{CopyableGatewayUrl-PTn061ft.js → CopyableGatewayUrl-B6K3rOal.js} +1 -1
  55. package/dist/assets/{CordisPluginSettings-C_BeeGEc.js → CordisPluginSettings-DD3AnD2G.js} +1 -1
  56. package/dist/assets/{Costs-DhuNxwSj.js → Costs-orBM8T-a.js} +1 -1
  57. package/dist/assets/{CrossIssueCollaborationUxLab-ZaAXq46r.js → CrossIssueCollaborationUxLab-Bv9y9-NE.js} +1 -1
  58. package/dist/assets/{Dashboard-BaDnqiKo.js → Dashboard-CrSBNKX1.js} +1 -1
  59. package/dist/assets/{DashboardLive-D-Ed7osd.js → DashboardLive-Cg8C9RiS.js} +1 -1
  60. package/dist/assets/{DecisionDateChips-D3pl_mLn.js → DecisionDateChips-BLZKZH71.js} +1 -1
  61. package/dist/assets/{DecisionHistoryPanel-D5MzyrOh.js → DecisionHistoryPanel-yK-CP7Qg.js} +1 -1
  62. package/dist/assets/{DecisionQueuePage-D3UZ9oRk.js → DecisionQueuePage-BKXbERai.js} +1 -1
  63. package/dist/assets/{DesignGuide-COTo7ICj.js → DesignGuide-2FswNsXz.js} +1 -1
  64. package/dist/assets/{DesignSandboxTaskThread-CMeCSQid.js → DesignSandboxTaskThread-CGU--FXR.js} +1 -1
  65. package/dist/assets/{EmailConnectionAccess-kCL7obSr.js → EmailConnectionAccess-CZ5QRKyg.js} +1 -1
  66. package/dist/assets/{EmailEndpointSetup-BGrksR_u.js → EmailEndpointSetup-BI2vsd8Y.js} +1 -1
  67. package/dist/assets/{EnforcementBanner-_Eb_nK3M.js → EnforcementBanner-B-iX466h.js} +1 -1
  68. package/dist/assets/{EntityRow-gpsOgEtu.js → EntityRow-BsICt6pd.js} +1 -1
  69. package/dist/assets/{ExecutionWorkspaceDetail-DwGkH6d3.js → ExecutionWorkspaceDetail-CMqR9puh.js} +1 -1
  70. package/dist/assets/{ExternalAgentInviteDialog-CGid6pM9.js → ExternalAgentInviteDialog-De30ZrLP.js} +1 -1
  71. package/dist/assets/{FilterBar-1D-VhrvG.js → FilterBar-rCmsTtG4.js} +1 -1
  72. package/dist/assets/{FolderControls-CQ6kef3c.js → FolderControls-CmnB7Ap-.js} +1 -1
  73. package/dist/assets/{GatewayDetail-CCqekM1J.js → GatewayDetail-Duw9pJ10.js} +1 -1
  74. package/dist/assets/{GatewaysList-nFsRcszh.js → GatewaysList-BBhVGhRq.js} +1 -1
  75. package/dist/assets/{GitHubConnectionRecovery-B9sFWJup.js → GitHubConnectionRecovery-6VshLoNV.js} +1 -1
  76. package/dist/assets/{GoalDetail-BQ8y55P-.js → GoalDetail-CahntjlI.js} +1 -1
  77. package/dist/assets/{GoalTree-laRjXp0P.js → GoalTree-CU4GBFCh.js} +1 -1
  78. package/dist/assets/{Goals-Cm14EaeP.js → Goals-CzM2NDFR.js} +1 -1
  79. package/dist/assets/{InstanceAccess-DxQ-Akt_.js → InstanceAccess-CZzkE65W.js} +1 -1
  80. package/dist/assets/{InstanceExperimentalSettings-BxwqbXNw.js → InstanceExperimentalSettings-DWumKtOK.js} +1 -1
  81. package/dist/assets/{InviteLanding-Cf0L_u6s.js → InviteLanding-BIy2z50u.js} +1 -1
  82. package/dist/assets/{IssueChatLongThreadPerf-BfsF6FdF.js → IssueChatLongThreadPerf-D4DJvdOG.js} +1 -1
  83. package/dist/assets/{JoinRequestQueue-BXCdTFG_.js → JoinRequestQueue-C5rauGYm.js} +1 -1
  84. package/dist/assets/{Layout.production-CqzU0qMi.js → Layout.production-BSDWnupa.js} +1 -1
  85. package/dist/assets/{McpConnect-COWnZ9Eb.js → McpConnect-BN8ST0RS.js} +1 -1
  86. package/dist/assets/{MembershipAction-C9i9Sdmi.js → MembershipAction-DTjhGn-L.js} +1 -1
  87. package/dist/assets/{MetricCard-Bwnt3_p3.js → MetricCard-CeL9Pdn5.js} +1 -1
  88. package/dist/assets/{MissingPluginTabPlaceholder-B0Zxv1Kx.js → MissingPluginTabPlaceholder-CbQiSVnZ.js} +1 -1
  89. package/dist/assets/{NewAgent-BIlJ5Dyt.js → NewAgent-BszrNpQk.js} +1 -1
  90. package/dist/assets/{NewAgentDialog-CJdMxxYL.js → NewAgentDialog-U9qAcTzc.js} +1 -1
  91. package/dist/assets/{NewGoalDialog-B8izfKLm.js → NewGoalDialog-DqKbk4-i.js} +1 -1
  92. package/dist/assets/{NewProjectDialog-DXqjTYFK.js → NewProjectDialog-DrlUAF-N.js} +1 -1
  93. package/dist/assets/{OnboardingPrimitives-DHYBqn_0.js → OnboardingPrimitives-BkgPF4Mu.js} +1 -1
  94. package/dist/assets/{OnboardingWizard-DqSfZ13V.js → OnboardingWizard-CMBMcuXv.js} +1 -1
  95. package/dist/assets/{OrgChart.production-DrSFUf7i.js → OrgChart.production-BLczTjRj.js} +1 -1
  96. package/dist/assets/{PaperclipCloudOAuthHandoff-jPUvjJ8q.js → PaperclipCloudOAuthHandoff-BTtF8UPD.js} +1 -1
  97. package/dist/assets/{PluginManager-h3LFPaUq.js → PluginManager-CCcqlfgK.js} +1 -1
  98. package/dist/assets/{PluginPage-E5Im4454.js → PluginPage-B1empV69.js} +1 -1
  99. package/dist/assets/{PluginSettings-BBO0jAgo.js → PluginSettings-DtopaRqR.js} +1 -1
  100. package/dist/assets/{ProfileDetailRoute-CQBD7fms.js → ProfileDetailRoute-BqvVpBZi.js} +1 -1
  101. package/dist/assets/{ProfileSettings-BwnVEHLp.js → ProfileSettings-5__tVfGi.js} +1 -1
  102. package/dist/assets/{ProfileWizardRoute-By_SC6Gn.js → ProfileWizardRoute-vt-MRLuD.js} +1 -1
  103. package/dist/assets/{ProjectDetail-CbiwFBAE.js → ProjectDetail-DJ4zjube.js} +1 -1
  104. package/dist/assets/{ProjectRepositoryInput-DZF9bX4E.js → ProjectRepositoryInput-BJcnj3At.js} +1 -1
  105. package/dist/assets/{ProjectWorkspaceDetail-DPsl_4bD.js → ProjectWorkspaceDetail-DEAO3q6v.js} +1 -1
  106. package/dist/assets/{ProjectWorkspacesContent-COH4dOWK.js → ProjectWorkspacesContent-CZvO7p0i.js} +1 -1
  107. package/dist/assets/{Projects-Ch9Qu7sn.js → Projects-Dm7-zXUH.js} +1 -1
  108. package/dist/assets/{QuotaBar-DIFOT9Uh.js → QuotaBar-Drp3CaxX.js} +1 -1
  109. package/dist/assets/{RepositoryEditor-DHB1bqId.js → RepositoryEditor-BT_VAkJu.js} +1 -1
  110. package/dist/assets/{Responsibilities-C5O0JXXG.js → Responsibilities-DbUEtGZu.js} +1 -1
  111. package/dist/assets/{ResponsibilityDetail-D6NpZpkm.js → ResponsibilityDetail--S8_GOkb.js} +1 -1
  112. package/dist/assets/{ResponsibleUserDenialUxLab-CFrIWYwe.js → ResponsibleUserDenialUxLab-1PB3JNG0.js} +1 -1
  113. package/dist/assets/{ReviewQueueCard-BPC4Lm67.js → ReviewQueueCard-B8w9aXKU.js} +1 -1
  114. package/dist/assets/{RoutineAuditActivity-sKyzMajz.js → RoutineAuditActivity-BCo7pYe5.js} +1 -1
  115. package/dist/assets/{RoutineDetail-CG8HF5fp.js → RoutineDetail-C9Dwn5G9.js} +1 -1
  116. package/dist/assets/{RoutineRunVariablesDialog-CKh3CmLD.js → RoutineRunVariablesDialog-Baomcbe3.js} +1 -1
  117. package/dist/assets/{Routines-tF2qfUKo.js → Routines-Dkv4gJno.js} +1 -1
  118. package/dist/assets/{Routines.production-BTyj1Ljr.js → Routines.production-Cs2Y-lpt.js} +1 -1
  119. package/dist/assets/{RoutinesToolbar-CvUFVCGN.js → RoutinesToolbar-BNKfCrTo.js} +1 -1
  120. package/dist/assets/{Search-Z9D0NuS1.js → Search-CVx4cl2o.js} +1 -1
  121. package/dist/assets/{Secrets-DgmbLOJK.js → Secrets-C2qv2HKZ.js} +1 -1
  122. package/dist/assets/{SkillBinaryFile-F3_9qcaM.js → SkillBinaryFile-DDkhLlfC.js} +1 -1
  123. package/dist/assets/{SkillCardIcon-CXHUCMej.js → SkillCardIcon-Cp_hws0N.js} +1 -1
  124. package/dist/assets/{SkillFolderTree-CB3lrTIE.js → SkillFolderTree-Cv0CmfYx.js} +1 -1
  125. package/dist/assets/{SkillSourceTree-BbuciCo6.js → SkillSourceTree-DmjlUswf.js} +1 -1
  126. package/dist/assets/{SkillSources-Dlo6Cew3.js → SkillSources-nmlYypUU.js} +1 -1
  127. package/dist/assets/{SkillStudio-ZO-Nf7eI.js → SkillStudio-BK3y_3zr.js} +1 -1
  128. package/dist/assets/{SkillsNavigationTabs-B9Iqnlqt.js → SkillsNavigationTabs-DRwMP1eu.js} +1 -1
  129. package/dist/assets/{SpekoPhoneCallback-C4VnMiZh.js → SpekoPhoneCallback-Cqi7AIyH.js} +1 -1
  130. package/dist/assets/{SpekoProviderSetup-I4evPZb3.js → SpekoProviderSetup-CJI4oXk5.js} +1 -1
  131. package/dist/assets/{StatusCards-D0MVzbsw.js → StatusCards-DKyyY81S.js} +1 -1
  132. package/dist/assets/{SummarySlotCard-DUXgZPxG.js → SummarySlotCard-f3RomdZS.js} +1 -1
  133. package/dist/assets/{TailscaleConnector-CMhT73gj.js → TailscaleConnector-yQWLR1Ra.js} +1 -1
  134. package/dist/assets/{TaskChatLab-D9-KAE-7.js → TaskChatLab-Dsr7eyj4.js} +1 -1
  135. package/dist/assets/{TaskSummaryList-CUxieFNe.js → TaskSummaryList-eFDfK_QH.js} +1 -1
  136. package/dist/assets/{Timeline-BNMoRbtK.js → Timeline-BWA9dyk6.js} +1 -1
  137. package/dist/assets/{ToolsAdminGate-CEr0zy2T.js → ToolsAdminGate-DpBg30hQ.js} +1 -1
  138. package/dist/assets/{TrustPresetSection-B9YXZtkh.js → TrustPresetSection-DtWjK9Kp.js} +1 -1
  139. package/dist/assets/{UserProfile-D-tnW96X.js → UserProfile-C66UI5xx.js} +1 -1
  140. package/dist/assets/{WebhookUrlWarning-Ba_DixKh.js → WebhookUrlWarning-CDygVnDH.js} +1 -1
  141. package/dist/assets/{WhatNeedsMe-B-Jzj8_M.js → WhatNeedsMe-BQ82RHus.js} +1 -1
  142. package/dist/assets/{Workspaces-BqhDI_Bl.js → Workspaces-DrjJes30.js} +1 -1
  143. package/dist/assets/{abnfDiagram-YUKMZFIV-Bn9P-nUW.js → abnfDiagram-YUKMZFIV-Crkksu2D.js} +1 -1
  144. package/dist/assets/{architecture-WOLXFQ4H-V1ldsZlt.js → architecture-WOLXFQ4H-bHU8FW0c.js} +1 -1
  145. package/dist/assets/{architectureDiagram-47P4ROYG-BkYxt-Gc.js → architectureDiagram-47P4ROYG-Bj5Styf9.js} +1 -1
  146. package/dist/assets/{arrow-down-left-o81ENfeW.js → arrow-down-left-Ck9VQyqQ.js} +1 -1
  147. package/dist/assets/{blockDiagram-E7TT5TSB-BO7pPYbp.js → blockDiagram-E7TT5TSB-OeHpNCQ-.js} +1 -1
  148. package/dist/assets/{budgets-0Dw6TH1A.js → budgets-CAWPqcn4.js} +1 -1
  149. package/dist/assets/{building-complex-DciZTnys.js → building-complex-Dxiyk_pH.js} +1 -1
  150. package/dist/assets/{c4Diagram-CRA5TL53-D4EpmmzV.js → c4Diagram-CRA5TL53-QbK5p76P.js} +1 -1
  151. package/dist/assets/channel-BSmZkKA8.js +1 -0
  152. package/dist/assets/{chat-channels-DWyry-9M.js → chat-channels-CzTZV2fr.js} +1 -1
  153. package/dist/assets/{chunk-2BW5OAIV-DFXIyCJy.js → chunk-2BW5OAIV-Ckr4HfBO.js} +1 -1
  154. package/dist/assets/{chunk-3YJQHVM4-Dj5wEKIw.js → chunk-3YJQHVM4-C_uoPpLR.js} +1 -1
  155. package/dist/assets/{chunk-4EA7E6EY-5XiUVgzK.js → chunk-4EA7E6EY-BeMEfIRS.js} +1 -1
  156. package/dist/assets/{chunk-7TKQ45FW-D0opKcsy.js → chunk-7TKQ45FW-DiwqWHvN.js} +1 -1
  157. package/dist/assets/{chunk-AW2ZBBNX-DnjsTe04.js → chunk-AW2ZBBNX-Cf57K3PO.js} +1 -1
  158. package/dist/assets/{chunk-DBDB3WZW-DNqSQPZ0.js → chunk-DBDB3WZW-B2qouVQO.js} +1 -1
  159. package/dist/assets/{chunk-E2ZNV5FY-cjSf_BTz.js → chunk-E2ZNV5FY-DG8wQ_NS.js} +1 -1
  160. package/dist/assets/{chunk-EU5HNXII-CZYBiaSw.js → chunk-EU5HNXII-cxRrXRGV.js} +1 -1
  161. package/dist/assets/{chunk-FVRAUYC3-DSc0-wJA.js → chunk-FVRAUYC3-Dizswk0V.js} +1 -1
  162. package/dist/assets/{chunk-HJ2JQQFS-MXK0gYSP.js → chunk-HJ2JQQFS-DL4lnpSv.js} +1 -1
  163. package/dist/assets/{chunk-HTAEGDNF-BjDZm_5k.js → chunk-HTAEGDNF-Zxjdb6kj.js} +1 -1
  164. package/dist/assets/{chunk-KQW6MTUR-Bfj0tDmO.js → chunk-KQW6MTUR-BsVaJdnu.js} +1 -1
  165. package/dist/assets/{chunk-NTY3LDVX-Bpz5TkVb.js → chunk-NTY3LDVX-DyT9N5sM.js} +1 -1
  166. package/dist/assets/{chunk-VPRB5NB3-CfeHjtbb.js → chunk-VPRB5NB3-BNz5CtBn.js} +1 -1
  167. package/dist/assets/{chunk-XC4XBNZT-FBCWmi6K.js → chunk-XC4XBNZT-CCgIhjYS.js} +1 -1
  168. package/dist/assets/{circle-slash-DqKFFqfb.js → circle-slash-uNv_ha0X.js} +1 -1
  169. package/dist/assets/{classDiagram-v2-K4WV4PDN-DbC_J0kK.js → classDiagram-v2-K4WV4PDN-Cdh3CEl4.js} +1 -1
  170. package/dist/assets/{coins-BztUbqyl.js → coins-BDAh8hDQ.js} +1 -1
  171. package/dist/assets/{collections-BxrcELwt.js → collections-B58p51lw.js} +1 -1
  172. package/dist/assets/{connection-owner-D-ikSHyR.js → connection-owner-D8fNrFqC.js} +1 -1
  173. package/dist/assets/{cynefin-EF2NZ3EQ-COwSJ4qP.js → cynefin-EF2NZ3EQ-BkwhfqJ0.js} +1 -1
  174. package/dist/assets/{cynefinDiagram-3GCD6N5R-diaEJq9Y.js → cynefinDiagram-3GCD6N5R-DuGb_wq2.js} +1 -1
  175. package/dist/assets/{dagre-W4DXFKR2-BPAMRuIj.js → dagre-W4DXFKR2-Bxq_Mhia.js} +1 -1
  176. package/dist/assets/{diagram-2UJZ2QOL-BvRnO1Id.js → diagram-2UJZ2QOL-B-P_hrXV.js} +1 -1
  177. package/dist/assets/{diagram-OVF4WLC6-CDgBeD0m.js → diagram-OVF4WLC6-Ds0BqQWH.js} +1 -1
  178. package/dist/assets/{diagram-PFPMY2P6-DAw9lREG.js → diagram-PFPMY2P6-Dpqb2-Cb.js} +1 -1
  179. package/dist/assets/{diagram-UMYRVEAY-ZQqQn22t.js → diagram-UMYRVEAY-BJSoxjiu.js} +1 -1
  180. package/dist/assets/{diagram-YEKJPTXX-CoJtGgWs.js → diagram-YEKJPTXX-BxaG_9tT.js} +1 -1
  181. package/dist/assets/{diagram-ZIFT7M5P-qW_Zn_bO.js → diagram-ZIFT7M5P-6acvVOtc.js} +1 -1
  182. package/dist/assets/{dist-B2E6oBK1.js → dist-0EWXio4m.js} +1 -1
  183. package/dist/assets/{dist-IcdxEhjC.js → dist-BGvZP_Cl.js} +1 -1
  184. package/dist/assets/{dist-DXjkgaZX.js → dist-BZ7AbEhN.js} +1 -1
  185. package/dist/assets/{dist-_EtfntKJ.js → dist-BlosHr86.js} +1 -1
  186. package/dist/assets/{dist-DylHAy-6.js → dist-Bmr4uhSk.js} +1 -1
  187. package/dist/assets/{dist-DML0cJH3.js → dist-C6yMfMNS.js} +1 -1
  188. package/dist/assets/{dist-Dl94YqeS.js → dist-CMZQedYl.js} +1 -1
  189. package/dist/assets/{dist-DKyBHaH2.js → dist-C_N_-eaT.js} +1 -1
  190. package/dist/assets/{dist-CvRpZH53.js → dist-CaUbG4Hl.js} +1 -1
  191. package/dist/assets/{dist-ptDa9fKh.js → dist-Cn7-nxjU.js} +1 -1
  192. package/dist/assets/{dist-CG-phytt.js → dist-Cnj95_pX.js} +1 -1
  193. package/dist/assets/{dist-DbXGl-wj.js → dist-D9DR7k9k.js} +1 -1
  194. package/dist/assets/{dist-CjRqeLFz.js → dist-DIwsVdS2.js} +1 -1
  195. package/dist/assets/{dist-BCJybC91.js → dist-DVE0lLId.js} +1 -1
  196. package/dist/assets/{dist-CPgRB-NQ.js → dist-DkAPL4CQ.js} +1 -1
  197. package/dist/assets/{dist-CeSzCyeG.js → dist-Dl6N3kpQ.js} +1 -1
  198. package/dist/assets/{dist-DZruZxAk.js → dist-DmBvXBzK.js} +1 -1
  199. package/dist/assets/{dist-CdmdXwCZ.js → dist-DpgXK0aZ.js} +1 -1
  200. package/dist/assets/{dist-CYRzGbSY.js → dist-gMRyU9GJ.js} +1 -1
  201. package/dist/assets/{dist-CG6fC1Db.js → dist-jQQX2kOU.js} +1 -1
  202. package/dist/assets/{dist-DZIxMHOT.js → dist-lUaUoFTq.js} +1 -1
  203. package/dist/assets/{dist-CuwPDbnL.js → dist-qw1ZF2vD.js} +1 -1
  204. package/dist/assets/{dist-B6Qde8KJ.js → dist-rH4qrNAn.js} +1 -1
  205. package/dist/assets/{ebnfDiagram-VR2GEFS7-DA4UvKXV.js → ebnfDiagram-VR2GEFS7-Ytj3Z5qC.js} +1 -1
  206. package/dist/assets/{elk-IJKZMXRS-CM74d3mJ.js → elk-IJKZMXRS-CJurNqqK.js} +1 -1
  207. package/dist/assets/{erDiagram-O2IAPWRE-d869V0qL.js → erDiagram-O2IAPWRE-hyXckW2d.js} +1 -1
  208. package/dist/assets/{eventmodeling-K75KTNOO-C-oz_eyI.js → eventmodeling-K75KTNOO-D3xQujrh.js} +1 -1
  209. package/dist/assets/flowDiagram-OXPTDLAJ-D4ojBTuY.js +1 -0
  210. package/dist/assets/{folder-plus-CxWXoYCi.js → folder-plus-BJZSMzuj.js} +1 -1
  211. package/dist/assets/{ganttDiagram-R7TSEDQI-BBul4Kpm.js → ganttDiagram-R7TSEDQI-C8U_ITl4.js} +1 -1
  212. package/dist/assets/{gitGraph-VSP46ZUC-BriEZgAq.js → gitGraph-VSP46ZUC-CDeq3yKT.js} +1 -1
  213. package/dist/assets/{gitGraphDiagram-XJZIOB7I-I12rg8s1.js → gitGraphDiagram-XJZIOB7I-CST3EWE9.js} +1 -1
  214. package/dist/assets/{goals-CvMWzjH4.js → goals-BNJZ4nzg.js} +1 -1
  215. package/dist/assets/{index-Bt31d8ga.js → index-BJtnP7H1.js} +8 -8
  216. package/dist/assets/{info-OHQRW6UA-CxrcGiem.js → info-OHQRW6UA-CPvTWk7J.js} +1 -1
  217. package/dist/assets/{infoDiagram-5W2HQ5XZ-4Sm0LiOu.js → infoDiagram-5W2HQ5XZ-BPUiNdxI.js} +1 -1
  218. package/dist/assets/{ishikawaDiagram-K3B6WC7H-CKXvKV-s.js → ishikawaDiagram-K3B6WC7H-D5Z3rmaA.js} +1 -1
  219. package/dist/assets/{issue-detail-4PCbYpdv.js → issue-detail-CZfjXs0M.js} +3 -3
  220. package/dist/assets/{journeyDiagram-COXZFDF6-BHsrZLvQ.js → journeyDiagram-COXZFDF6-CEkwEYdR.js} +1 -1
  221. package/dist/assets/{kanban-definition-P3RFRI5V-8HhnIs_l.js → kanban-definition-P3RFRI5V-8h_R6Qjq.js} +1 -1
  222. package/dist/assets/{line-rrKrpB-b.js → line-Ljt_vfsb.js} +1 -1
  223. package/dist/assets/{link-BecLzmfo.js → link-DvgFK0mz.js} +1 -1
  224. package/dist/assets/{list-filter-BC3D4IoX.js → list-filter-BR4_dvwm.js} +1 -1
  225. package/dist/assets/{log-in-BJCGwGGT.js → log-in-Dvx9-FMC.js} +1 -1
  226. package/dist/assets/{mcpSkills-DRs3pGKn.js → mcpSkills-76szK_k1.js} +1 -1
  227. package/dist/assets/{mermaid-parser.core-DmG0b4S0.js → mermaid-parser.core-BjFu937m.js} +3 -3
  228. package/dist/assets/{mermaid.core-D1vILTuF.js → mermaid.core-B0t95EIS.js} +4 -4
  229. package/dist/assets/{mindmap-definition-LZFPQGKD-DIMpL0de.js → mindmap-definition-LZFPQGKD-TVnHYUR4.js} +1 -1
  230. package/dist/assets/{packet-JDAUHWVQ-BnbYht3G.js → packet-JDAUHWVQ-aNGiRWLy.js} +1 -1
  231. package/dist/assets/{pegDiagram-BGZESJAR-BUjtJVjT.js → pegDiagram-BGZESJAR-DDadxqWQ.js} +1 -1
  232. package/dist/assets/{pie-XZMESJXO-CM4VXUb-.js → pie-XZMESJXO-CydFP1hd.js} +1 -1
  233. package/dist/assets/{pieDiagram-CAPJLFHJ-B3v8ryvG.js → pieDiagram-CAPJLFHJ-KhdUDwDS.js} +1 -1
  234. package/dist/assets/{power-0mw59G-l.js → power-sYV-WuqQ.js} +1 -1
  235. package/dist/assets/{profile-summary-B5rPf8v-.js → profile-summary-D4LPX-Dv.js} +1 -1
  236. package/dist/assets/{quadrantDiagram-GDMTTRAM-Cv-dS2Rn.js → quadrantDiagram-GDMTTRAM-B1X8K2Fs.js} +1 -1
  237. package/dist/assets/{radar-ABXABTNO-v6yZj4Fk.js → radar-ABXABTNO-BqodkLpx.js} +1 -1
  238. package/dist/assets/{railroad-I3PHUGI6-D-U8Cs0m.js → railroad-I3PHUGI6-HmRKXDJj.js} +1 -1
  239. package/dist/assets/{railroad-abnf-LNEFI6M7-Dw3fkrVy.js → railroad-abnf-LNEFI6M7-CkBttaHp.js} +1 -1
  240. package/dist/assets/{railroad-ebnf-DWYD2UWJ-_ln-e3Tx.js → railroad-ebnf-DWYD2UWJ-C6DBawFA.js} +1 -1
  241. package/dist/assets/{railroad-peg-JR7BVNR7-Bf8u1-RZ.js → railroad-peg-JR7BVNR7-Z9df3u5o.js} +1 -1
  242. package/dist/assets/{railroadDiagram-SM67HX2B-Drr5UhQI.js → railroadDiagram-SM67HX2B-2vDUUppL.js} +1 -1
  243. package/dist/assets/{requirementDiagram-X7JNWC4A-D5ef6_ac.js → requirementDiagram-X7JNWC4A-DAuP39Hc.js} +1 -1
  244. package/dist/assets/{sankeyDiagram-UM26HJRW-DncJWIz_.js → sankeyDiagram-UM26HJRW-ByS54QZK.js} +1 -1
  245. package/dist/assets/{saved-permissions-CizWg8-P.js → saved-permissions-CPiYtxkZ.js} +1 -1
  246. package/dist/assets/{scroll-text-Ck6HB7eM.js → scroll-text-CVSt6aO2.js} +1 -1
  247. package/dist/assets/{sdk-CWyUlmcn.js → sdk-vrG4HtB4.js} +1 -1
  248. package/dist/assets/{search-DkTqg7ab.js → search-CG-QtPVH.js} +1 -1
  249. package/dist/assets/{send-CYVi50sh.js → send-CH-0xdLm.js} +1 -1
  250. package/dist/assets/{sequenceDiagram-ZO4K6R2Y-Cs0nGCCg.js → sequenceDiagram-ZO4K6R2Y-DvWxKTLK.js} +1 -1
  251. package/dist/assets/{shared-CIwISWMj.js → shared-D37zfckm.js} +1 -1
  252. package/dist/assets/{smoke-lab-matrix-A7ubFpfk.js → smoke-lab-matrix-C5gR81E3.js} +1 -1
  253. package/dist/assets/{stateDiagram-v2-TBUQTH76-Dpp3m5Wq.js → stateDiagram-v2-TBUQTH76-DtiiZIXq.js} +1 -1
  254. package/dist/assets/{swimlanes-N4OXWK64-NXVbx1w8.js → swimlanes-N4OXWK64-BWSEtCbX.js} +1 -1
  255. package/dist/assets/swimlanesDiagram-K3J5GTZL-Bl_9DvHU.js +8 -0
  256. package/dist/assets/{timeline-definition-YOQAKGHF-DqI-Mv2e.js → timeline-definition-YOQAKGHF-U4QcniMh.js} +1 -1
  257. package/dist/assets/{treeView-D4JQ5SDB-CZBlE7ya.js → treeView-D4JQ5SDB-B2tdrtsj.js} +1 -1
  258. package/dist/assets/{treemap-SAJKECNS-BlueznID.js → treemap-SAJKECNS-DodN8j4n.js} +1 -1
  259. package/dist/assets/{useAgentlessOnboardingAutoOpen-CnFwEQ-H.js → useAgentlessOnboardingAutoOpen-DSWW7Juw.js} +1 -1
  260. package/dist/assets/{useAuthorizationWindow-DnFQsiFj.js → useAuthorizationWindow-tg3aKEU7.js} +1 -1
  261. package/dist/assets/{useDateRange-9EbqkWXy.js → useDateRange-CnZQr2KO.js} +1 -1
  262. package/dist/assets/{useFastResponsesEnabled-D8dunm4j.js → useFastResponsesEnabled-B8tHSJ1y.js} +1 -1
  263. package/dist/assets/{usePageView-BiX5i8ck.js → usePageView-CtFMs34g.js} +1 -1
  264. package/dist/assets/{useProfilesData-0VYQ4lAT.js → useProfilesData-CWHdMSuL.js} +1 -1
  265. package/dist/assets/{useReviewCount-WBWxwKI3.js → useReviewCount-W_bCZ2Hz.js} +1 -1
  266. package/dist/assets/{useRoutineFormOptions-DnX5DBn1.js → useRoutineFormOptions-CCLMmVSF.js} +1 -1
  267. package/dist/assets/{useSummaryDraftStream-DPQRvaXT.js → useSummaryDraftStream-NVNYNt72.js} +1 -1
  268. package/dist/assets/{useTailscaleConnections-BDff6dWx.js → useTailscaleConnections-Dy52nCY3.js} +1 -1
  269. package/dist/assets/{usecaseDiagram-VIAY4XPW-BSDn8OaJ.js → usecaseDiagram-VIAY4XPW-kEHhqgOj.js} +1 -1
  270. package/dist/assets/{vennDiagram-BLWOH2XV-BBSA9KNN.js → vennDiagram-BLWOH2XV-NPJU0aCU.js} +1 -1
  271. package/dist/assets/{wardley-7MLQ67FV-CsT-rTZ9.js → wardley-7MLQ67FV-bUGKvIPT.js} +1 -1
  272. package/dist/assets/{wardleyDiagram-YMQ3BMBF-BLClsIjw.js → wardleyDiagram-YMQ3BMBF-qtUDHfhb.js} +1 -1
  273. package/dist/assets/{xychartDiagram-TAQBALBS-2x4wB0gq.js → xychartDiagram-TAQBALBS-C-z57aZj.js} +1 -1
  274. package/dist/index.html +4 -4
  275. package/dist/sw.js +1 -1
  276. package/package.json +1 -1
  277. package/dist/assets/CompanyActivity.production-DbaFBsM0.js +0 -1
  278. package/dist/assets/channel-BQh2vFIU.js +0 -1
  279. package/dist/assets/flowDiagram-OXPTDLAJ-Be1xLbJu.js +0 -1
  280. package/dist/assets/swimlanesDiagram-K3J5GTZL-Ct3LnXZt.js +0 -8
@@ -1 +1 @@
1
- var o=Object.defineProperty;var a=(t,e)=>o(t,"name",{value:e,configurable:!0});import{a as s}from"./rolldown-runtime-DhZMWcEn.js";import{Lt as l,Rt as n}from"./issue-detail-4PCbYpdv.js";import{$A as m}from"./index-Bt31d8ga.js";var c="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='480'%20height='320'%20viewBox='0%200%20480%20320'%3e%3crect%20width='480'%20height='320'%20fill='%23f5f5f4'/%3e%3cg%20transform='translate(192%20112)%20scale(4)'%20fill='none'%20stroke='%23242424'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3e%3cpath%20d='M16%206%20l-8.414%208.586%20a2%202%200%200%200%202.828%202.828%20l8.414%20-8.586%20a4%204%200%201%200%20-5.657%20-5.657%20l-8.379%208.551%20a6%206%200%201%200%208.485%208.485%20l8.379%20-8.551'/%3e%3c/g%3e%3c/svg%3e",i=s(m(),1);function g({kind:t="file",stack:e=!1}){const r=e?{kind:"image",title:"",thumbnailUrl:c,aspect:1.5}:{kind:t,title:"",...t==="document"?{ext:"md"}:{}};return e?(0,i.jsx)(l,{front:r}):(0,i.jsx)(n,{subject:r,showLabel:!1})}a(g,"ArtifactEmptyGraphic");export{g as t};
1
+ var o=Object.defineProperty;var a=(t,e)=>o(t,"name",{value:e,configurable:!0});import{a as s}from"./rolldown-runtime-DhZMWcEn.js";import{Lt as l,Rt as n}from"./issue-detail-CZfjXs0M.js";import{$A as m}from"./index-BJtnP7H1.js";var c="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='480'%20height='320'%20viewBox='0%200%20480%20320'%3e%3crect%20width='480'%20height='320'%20fill='%23f5f5f4'/%3e%3cg%20transform='translate(192%20112)%20scale(4)'%20fill='none'%20stroke='%23242424'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3e%3cpath%20d='M16%206%20l-8.414%208.586%20a2%202%200%200%200%202.828%202.828%20l8.414%20-8.586%20a4%204%200%201%200%20-5.657%20-5.657%20l-8.379%208.551%20a6%206%200%201%200%208.485%208.485%20l8.379%20-8.551'/%3e%3c/g%3e%3c/svg%3e",i=s(m(),1);function g({kind:t="file",stack:e=!1}){const r=e?{kind:"image",title:"",thumbnailUrl:c,aspect:1.5}:{kind:t,title:"",...t==="document"?{ext:"md"}:{}};return e?(0,i.jsx)(l,{front:r}):(0,i.jsx)(n,{subject:r,showLabel:!1})}a(g,"ArtifactEmptyGraphic");export{g as t};
@@ -1 +1 @@
1
- var Y=Object.defineProperty;var d=(a,l)=>Y(a,"name",{value:l,configurable:!0});import{a as D}from"./rolldown-runtime-DhZMWcEn.js";import{Ft as ee,It as te,Mt as ae,Ot as se,Pt as $,b as re,jt as ie,kt as ne,qt as E,zt as le}from"./issue-detail-4PCbYpdv.js";import{C as ce,x as oe}from"./collections-BxrcELwt.js";import{$A as de,$C as R,Ev as ue,GS as fe,Gb as z,H_ as me,LS as he,MT as xe,NE as ge,Oi as pe,Tw as C,UE as be,_v as ve,ab as je,hv as ye,ib as ke,nj as we,oE as Ne,on as V,pb as Ae,pv as Ce,qT as Se,ub as Ie,vv as Te,zE as Pe}from"./index-Bt31d8ga.js";import{t as Ee}from"./ArtifactEmptyGraphic-5mdkS5jj.js";var n=D(we(),1),t=D(de(),1);function _e({group:a,to:l}){const i=a.count>1,f=a.previewArtifacts[0],u=`${a.count} artifact${a.count===1?"":"s"}`;return(0,t.jsxs)("div",{className:"relative",children:[i?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{"aria-hidden":"true","data-testid":"artifact-stack-layer",className:"pointer-events-none absolute inset-0 translate-x-(--sz-8px) translate-y-(--sz-8px) rounded-lg border border-border bg-muted/70"}),(0,t.jsx)("div",{"aria-hidden":"true","data-testid":"artifact-stack-layer",className:"pointer-events-none absolute inset-0 translate-x-(--sz-4px) translate-y-(--sz-4px) rounded-lg border border-border bg-muted/40"})]}):null,(0,t.jsxs)(z,{to:l,title:u,"data-testid":"artifact-group-card","data-group-id":a.id,"data-count":a.count,"data-stacked":i?"true":"false",className:"group relative flex flex-col overflow-hidden rounded-lg border border-border bg-card cursor-pointer transition-colors hover:border-foreground/20 hover:shadow-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,t.jsxs)("div",{className:"relative",children:[f?(0,t.jsx)(ae,{artifact:f}):(0,t.jsx)("div",{className:"flex aspect-video w-full items-center justify-center bg-accent/20 text-muted-foreground/50",children:(0,t.jsx)(C,{className:"h-7 w-7","aria-hidden":"true"})}),(0,t.jsxs)(me,{variant:"ghost",className:"absolute right-2 top-2 bg-background/85 text-(length:--text-micro) text-foreground/90 shadow-sm backdrop-blur",children:[(0,t.jsx)(C,{className:"h-3 w-3","aria-hidden":"true"}),a.count]})]}),(0,t.jsxs)("div",{className:"flex flex-1 flex-col gap-1 p-3",children:[(0,t.jsxs)("div",{className:"flex h-7 items-center gap-2",children:[(0,t.jsx)("span",{className:"shrink-0 font-mono text-(length:--text-micro) text-muted-foreground",children:a.issue.identifier}),(0,t.jsx)("h3",{className:"min-w-0 flex-1 truncate text-sm font-medium leading-7 text-foreground/85",title:a.title,children:a.title})]}),(0,t.jsxs)("div",{className:"mt-0.5 flex items-center gap-1.5 text-(length:--text-micro) text-muted-foreground/65",children:[(0,t.jsx)("span",{children:u}),(0,t.jsx)("span",{className:"text-muted-foreground/50",children:"·"}),(0,t.jsxs)("span",{children:["Updated ",be(a.updatedAt)]})]})]})]})]})}d(_e,"ArtifactGroupCard");var K=[{value:"all",label:"All"},{value:"image",label:"Images"},{value:"video",label:"Videos"},{value:"document",label:"Documents"},{value:"text",label:"Text"},{value:"file",label:"Files"}],U=[{value:"none",label:"None"},{value:"task",label:"Task"},{value:"parent_task",label:"Parent task"}];function Ge(a){return U.find(l=>l.value===a)?.label??"None"}d(Ge,"artifactGroupByLabel");function Fe({kind:a,onKindChange:l,size:i="compact"}){return(0,t.jsx)(pe,{items:K,value:a,onValueChange:l,size:i,label:"Filter artifacts by type"})}d(Fe,"ArtifactKindFilters");function Me({query:a,onQueryChange:l,groupBy:i,onGroupByChange:f,kind:u,onKindChange:c,filters:o}){const j=i!=="none";return(0,t.jsxs)("div",{"data-canonical-toolbar":"artifacts",role:"toolbar","aria-label":"Artifacts controls",className:"flex flex-col items-start gap-4",children:[(0,t.jsxs)("div",{className:"design-toolbar-controls flex w-full flex-wrap items-center gap-4",children:[(0,t.jsx)(oe,{query:a,onQueryChange:l,label:"Search artifacts",placeholder:"Search artifacts…",clearLabel:"Clear artifact search"}),(0,t.jsxs)(Ce,{children:[(0,t.jsx)(ue,{asChild:!0,children:(0,t.jsx)(ge,{type:"button",variant:"outline",size:"icon","aria-label":`Group artifacts (currently ${Ge(i)})`,title:"Group artifacts","data-testid":"artifact-group-control","data-group-by":i,"data-active":j,className:Pe("h-8 w-8 shrink-0",j&&"bg-accent"),children:(0,t.jsx)(C,{className:"h-3.5 w-3.5","aria-hidden":"true"})})}),(0,t.jsxs)(ye,{align:"end",className:"w-44",children:[(0,t.jsx)(Te,{children:"Group by"}),U.map(r=>(0,t.jsxs)(ve,{"data-testid":`artifact-group-option-${r.value}`,"aria-selected":i===r.value,onSelect:d(()=>f(r.value),"onSelect"),className:"justify-between",children:[r.label,i===r.value?(0,t.jsx)(xe,{className:"h-3.5 w-3.5"}):null]},r.value))]})]})]}),o??(0,t.jsx)(Fe,{kind:u,onKindChange:c,size:"standard"})]})}d(Me,"ArtifactsToolbar");var Be=30,Le=250,qe=new Set(K.map(a=>a.value));function $e(a){return a==="none"||a==="task"||a==="parent_task"?a:"task"}d($e,"parseGroupBy");function Re(a){return a&&qe.has(a)?a:"all"}d(Re,"parseKind");function Oe(){const{selectedCompanyId:a}=he(),{setBreadcrumbs:l}=ke(),[i,f]=Ne(),{enabled:u}=le(),c=Re(i.get("kind")),o=i.get("q")??"",j=$e(i.get("groupBy")),r=u&&c!=="all"?"none":j,y=i.get("groupIssueId")??void 0,[S,_]=(0,n.useState)(o),I=(0,n.useRef)(null),G=r!=="none",Q=G&&!y,k=G&&!!y;(0,n.useEffect)(()=>{_(e=>e.trim()===o?e:o)},[o]),(0,n.useEffect)(()=>{const e=S.trim();if(e===o)return;const s=window.setTimeout(()=>{f(m=>{const v=new URLSearchParams(m);return e?v.set("q",e):v.delete("q"),v},{replace:!0})},Le);return()=>window.clearTimeout(s)},[S,o,f]);const x=(0,n.useCallback)(e=>{f(s=>{const m=new URLSearchParams(s);return e(m),m})},[f]),O=(0,n.useCallback)(e=>{x(s=>{e==="all"?s.delete("kind"):s.set("kind",e)})},[x]),H=(0,n.useCallback)(e=>{x(s=>{if(s.delete("groupIssueId"),e==="tasks"){s.delete("groupBy"),s.delete("kind");return}s.set("groupBy","none"),e==="all"?s.delete("kind"):s.set("kind",e)})},[x]),Z=(0,n.useCallback)(e=>{x(s=>{s.delete("groupIssueId"),e==="task"?s.delete("groupBy"):s.set("groupBy",e),u&&e!=="none"&&s.delete("kind")})},[x,u]),w=(0,n.useCallback)(e=>{const s=new URLSearchParams(i);e(s);const m=s.toString();return m?`?${m}`:"?"},[i]),F=(0,n.useCallback)(e=>w(s=>{r==="task"?s.delete("groupBy"):r!=="none"&&s.set("groupBy",r),s.set("groupIssueId",e)}),[w,r]),J=(0,n.useMemo)(()=>w(e=>{r==="task"&&e.delete("groupBy"),e.delete("groupIssueId")}),[w,r]),M=ce({queryKey:fe.artifacts.list(a,c,o,r,y),queryFn:d(({pageParam:e})=>re.list(a,{kind:c,q:o||void 0,groupBy:r,groupIssueId:y,limit:Be,cursor:e}),"queryFn"),enabled:!!a,initialPageParam:void 0,getNextPageParam:d(e=>e.nextCursor??void 0,"getNextPageParam")}),{data:g,isFetching:B,isFetchingNextPage:N,hasNextPage:A,fetchNextPage:L}=M,p=Ie(M);(0,n.useEffect)(()=>{const e=I.current;if(!e||!A||N)return;const s=new IntersectionObserver(m=>{m.some(v=>v.isIntersecting)&&L()},{rootMargin:"320px 0px"});return s.observe(e),()=>s.disconnect()},[L,A,N]);const T=(0,n.useMemo)(()=>g?.pages.flatMap(e=>e.artifacts)??[],[g]),P=(0,n.useMemo)(()=>g?.pages.flatMap(e=>e.groups??[])??[],[g]),h=(0,n.useMemo)(()=>g?.pages.map(e=>e.selectedGroup).find(Boolean)??null,[g]),q=o.length>0;if((0,n.useEffect)(()=>{l(k&&h?[{label:"Artifacts",href:"/artifacts"},{label:`${h.issue.identifier} · ${h.title}`}]:[{label:"Artifacts"}])},[l,k,h]),!a)return(0,t.jsx)(V,{icon:R,message:"Select an organization to view artifacts."});const b=Q,W=b?P:T,X=b?q?"No artifact stacks match this search.":"No artifact stacks yet.":q?"No artifacts match this search.":k?"No artifacts in this stack match the current filters.":c==="all"?"No artifacts yet. Outputs attached to tasks will appear here.":"No artifacts of this type yet.";return(0,t.jsxs)("div",{className:"w-full max-w-6xl space-y-5",children:[(0,t.jsx)(Me,{query:S,onQueryChange:_,groupBy:r,onGroupByChange:Z,kind:c,onKindChange:O,filters:u?(0,t.jsx)(se,{view:ne(r,c),onViewChange:H}):void 0}),k?(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[(0,t.jsxs)(z,{to:J,"data-testid":"artifact-stack-back",className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",children:[(0,t.jsx)(Se,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"All stacks"]}),h?(0,t.jsxs)("span",{className:"truncate text-muted-foreground",children:[(0,t.jsx)("span",{className:"text-foreground/80",children:h.issue.identifier})," ",h.title]}):null]}):null,p.kind==="loading"||p.kind==="reconnecting"?(0,t.jsx)(Ae,{variant:"list"}):p.kind==="error"?(0,t.jsx)(je,{error:p.error,action:"load artifacts",onRetry:p.retry,retrying:p.isFetching}):W.length===0?(0,t.jsx)(V,{icon:b?C:R,message:X,graphic:(0,t.jsx)(Ee,{stack:b,kind:c==="all"?"file":c==="text"?"code":c})}):u?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(te,{children:b?P.map(e=>{const s=e.previewArtifacts[0];return e.count>1||!s?(0,t.jsx)(ee,{identifier:e.issue.identifier,title:e.title,count:e.count,updatedAt:e.updatedAt,front:s?E(s):{kind:"file",title:e.title,updatedAt:e.updatedAt,taskIdentifier:e.issue.identifier},to:F(e.issue.id)},e.id):(0,t.jsx)($,{subject:E(s),to:s.href},e.id)}):T.map(e=>(0,t.jsx)($,{subject:E(e),to:e.href},`${e.source}:${e.id}`))}),(0,t.jsx)("div",{ref:I,className:"flex min-h-10 items-center justify-center pb-2 text-xs text-muted-foreground",children:N?"Loading more artifacts...":A?null:B?"Updating artifacts...":null})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-2 xl:grid-cols-3",children:b?P.map(e=>(0,t.jsx)(_e,{group:e,to:F(e.issue.id)},e.id)):T.map(e=>(0,t.jsx)(ie,{artifact:e},`${e.source}:${e.id}`))}),(0,t.jsx)("div",{ref:I,className:"flex min-h-10 items-center justify-center pb-2 text-xs text-muted-foreground",children:N?"Loading more artifacts...":A?null:B?"Updating artifacts...":null})]})]})}d(Oe,"Artifacts");export{Oe as Artifacts};
1
+ var Y=Object.defineProperty;var d=(a,l)=>Y(a,"name",{value:l,configurable:!0});import{a as D}from"./rolldown-runtime-DhZMWcEn.js";import{Ft as ee,It as te,Mt as ae,Ot as se,Pt as $,b as re,jt as ie,kt as ne,qt as E,zt as le}from"./issue-detail-CZfjXs0M.js";import{C as ce,x as oe}from"./collections-B58p51lw.js";import{$A as de,$C as R,Ev as ue,GS as fe,Gb as z,H_ as me,LS as he,MT as xe,NE as ge,Oi as pe,Tw as C,UE as be,_v as ve,ab as je,hv as ye,ib as ke,nj as we,oE as Ne,on as V,pb as Ae,pv as Ce,qT as Se,ub as Ie,vv as Te,zE as Pe}from"./index-BJtnP7H1.js";import{t as Ee}from"./ArtifactEmptyGraphic-DzxCruYA.js";var n=D(we(),1),t=D(de(),1);function _e({group:a,to:l}){const i=a.count>1,f=a.previewArtifacts[0],u=`${a.count} artifact${a.count===1?"":"s"}`;return(0,t.jsxs)("div",{className:"relative",children:[i?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{"aria-hidden":"true","data-testid":"artifact-stack-layer",className:"pointer-events-none absolute inset-0 translate-x-(--sz-8px) translate-y-(--sz-8px) rounded-lg border border-border bg-muted/70"}),(0,t.jsx)("div",{"aria-hidden":"true","data-testid":"artifact-stack-layer",className:"pointer-events-none absolute inset-0 translate-x-(--sz-4px) translate-y-(--sz-4px) rounded-lg border border-border bg-muted/40"})]}):null,(0,t.jsxs)(z,{to:l,title:u,"data-testid":"artifact-group-card","data-group-id":a.id,"data-count":a.count,"data-stacked":i?"true":"false",className:"group relative flex flex-col overflow-hidden rounded-lg border border-border bg-card cursor-pointer transition-colors hover:border-foreground/20 hover:shadow-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,t.jsxs)("div",{className:"relative",children:[f?(0,t.jsx)(ae,{artifact:f}):(0,t.jsx)("div",{className:"flex aspect-video w-full items-center justify-center bg-accent/20 text-muted-foreground/50",children:(0,t.jsx)(C,{className:"h-7 w-7","aria-hidden":"true"})}),(0,t.jsxs)(me,{variant:"ghost",className:"absolute right-2 top-2 bg-background/85 text-(length:--text-micro) text-foreground/90 shadow-sm backdrop-blur",children:[(0,t.jsx)(C,{className:"h-3 w-3","aria-hidden":"true"}),a.count]})]}),(0,t.jsxs)("div",{className:"flex flex-1 flex-col gap-1 p-3",children:[(0,t.jsxs)("div",{className:"flex h-7 items-center gap-2",children:[(0,t.jsx)("span",{className:"shrink-0 font-mono text-(length:--text-micro) text-muted-foreground",children:a.issue.identifier}),(0,t.jsx)("h3",{className:"min-w-0 flex-1 truncate text-sm font-medium leading-7 text-foreground/85",title:a.title,children:a.title})]}),(0,t.jsxs)("div",{className:"mt-0.5 flex items-center gap-1.5 text-(length:--text-micro) text-muted-foreground/65",children:[(0,t.jsx)("span",{children:u}),(0,t.jsx)("span",{className:"text-muted-foreground/50",children:"·"}),(0,t.jsxs)("span",{children:["Updated ",be(a.updatedAt)]})]})]})]})]})}d(_e,"ArtifactGroupCard");var K=[{value:"all",label:"All"},{value:"image",label:"Images"},{value:"video",label:"Videos"},{value:"document",label:"Documents"},{value:"text",label:"Text"},{value:"file",label:"Files"}],U=[{value:"none",label:"None"},{value:"task",label:"Task"},{value:"parent_task",label:"Parent task"}];function Ge(a){return U.find(l=>l.value===a)?.label??"None"}d(Ge,"artifactGroupByLabel");function Fe({kind:a,onKindChange:l,size:i="compact"}){return(0,t.jsx)(pe,{items:K,value:a,onValueChange:l,size:i,label:"Filter artifacts by type"})}d(Fe,"ArtifactKindFilters");function Me({query:a,onQueryChange:l,groupBy:i,onGroupByChange:f,kind:u,onKindChange:c,filters:o}){const j=i!=="none";return(0,t.jsxs)("div",{"data-canonical-toolbar":"artifacts",role:"toolbar","aria-label":"Artifacts controls",className:"flex flex-col items-start gap-4",children:[(0,t.jsxs)("div",{className:"design-toolbar-controls flex w-full flex-wrap items-center gap-4",children:[(0,t.jsx)(oe,{query:a,onQueryChange:l,label:"Search artifacts",placeholder:"Search artifacts…",clearLabel:"Clear artifact search"}),(0,t.jsxs)(Ce,{children:[(0,t.jsx)(ue,{asChild:!0,children:(0,t.jsx)(ge,{type:"button",variant:"outline",size:"icon","aria-label":`Group artifacts (currently ${Ge(i)})`,title:"Group artifacts","data-testid":"artifact-group-control","data-group-by":i,"data-active":j,className:Pe("h-8 w-8 shrink-0",j&&"bg-accent"),children:(0,t.jsx)(C,{className:"h-3.5 w-3.5","aria-hidden":"true"})})}),(0,t.jsxs)(ye,{align:"end",className:"w-44",children:[(0,t.jsx)(Te,{children:"Group by"}),U.map(r=>(0,t.jsxs)(ve,{"data-testid":`artifact-group-option-${r.value}`,"aria-selected":i===r.value,onSelect:d(()=>f(r.value),"onSelect"),className:"justify-between",children:[r.label,i===r.value?(0,t.jsx)(xe,{className:"h-3.5 w-3.5"}):null]},r.value))]})]})]}),o??(0,t.jsx)(Fe,{kind:u,onKindChange:c,size:"standard"})]})}d(Me,"ArtifactsToolbar");var Be=30,Le=250,qe=new Set(K.map(a=>a.value));function $e(a){return a==="none"||a==="task"||a==="parent_task"?a:"task"}d($e,"parseGroupBy");function Re(a){return a&&qe.has(a)?a:"all"}d(Re,"parseKind");function Oe(){const{selectedCompanyId:a}=he(),{setBreadcrumbs:l}=ke(),[i,f]=Ne(),{enabled:u}=le(),c=Re(i.get("kind")),o=i.get("q")??"",j=$e(i.get("groupBy")),r=u&&c!=="all"?"none":j,y=i.get("groupIssueId")??void 0,[S,_]=(0,n.useState)(o),I=(0,n.useRef)(null),G=r!=="none",Q=G&&!y,k=G&&!!y;(0,n.useEffect)(()=>{_(e=>e.trim()===o?e:o)},[o]),(0,n.useEffect)(()=>{const e=S.trim();if(e===o)return;const s=window.setTimeout(()=>{f(m=>{const v=new URLSearchParams(m);return e?v.set("q",e):v.delete("q"),v},{replace:!0})},Le);return()=>window.clearTimeout(s)},[S,o,f]);const x=(0,n.useCallback)(e=>{f(s=>{const m=new URLSearchParams(s);return e(m),m})},[f]),O=(0,n.useCallback)(e=>{x(s=>{e==="all"?s.delete("kind"):s.set("kind",e)})},[x]),H=(0,n.useCallback)(e=>{x(s=>{if(s.delete("groupIssueId"),e==="tasks"){s.delete("groupBy"),s.delete("kind");return}s.set("groupBy","none"),e==="all"?s.delete("kind"):s.set("kind",e)})},[x]),Z=(0,n.useCallback)(e=>{x(s=>{s.delete("groupIssueId"),e==="task"?s.delete("groupBy"):s.set("groupBy",e),u&&e!=="none"&&s.delete("kind")})},[x,u]),w=(0,n.useCallback)(e=>{const s=new URLSearchParams(i);e(s);const m=s.toString();return m?`?${m}`:"?"},[i]),F=(0,n.useCallback)(e=>w(s=>{r==="task"?s.delete("groupBy"):r!=="none"&&s.set("groupBy",r),s.set("groupIssueId",e)}),[w,r]),J=(0,n.useMemo)(()=>w(e=>{r==="task"&&e.delete("groupBy"),e.delete("groupIssueId")}),[w,r]),M=ce({queryKey:fe.artifacts.list(a,c,o,r,y),queryFn:d(({pageParam:e})=>re.list(a,{kind:c,q:o||void 0,groupBy:r,groupIssueId:y,limit:Be,cursor:e}),"queryFn"),enabled:!!a,initialPageParam:void 0,getNextPageParam:d(e=>e.nextCursor??void 0,"getNextPageParam")}),{data:g,isFetching:B,isFetchingNextPage:N,hasNextPage:A,fetchNextPage:L}=M,p=Ie(M);(0,n.useEffect)(()=>{const e=I.current;if(!e||!A||N)return;const s=new IntersectionObserver(m=>{m.some(v=>v.isIntersecting)&&L()},{rootMargin:"320px 0px"});return s.observe(e),()=>s.disconnect()},[L,A,N]);const T=(0,n.useMemo)(()=>g?.pages.flatMap(e=>e.artifacts)??[],[g]),P=(0,n.useMemo)(()=>g?.pages.flatMap(e=>e.groups??[])??[],[g]),h=(0,n.useMemo)(()=>g?.pages.map(e=>e.selectedGroup).find(Boolean)??null,[g]),q=o.length>0;if((0,n.useEffect)(()=>{l(k&&h?[{label:"Artifacts",href:"/artifacts"},{label:`${h.issue.identifier} · ${h.title}`}]:[{label:"Artifacts"}])},[l,k,h]),!a)return(0,t.jsx)(V,{icon:R,message:"Select an organization to view artifacts."});const b=Q,W=b?P:T,X=b?q?"No artifact stacks match this search.":"No artifact stacks yet.":q?"No artifacts match this search.":k?"No artifacts in this stack match the current filters.":c==="all"?"No artifacts yet. Outputs attached to tasks will appear here.":"No artifacts of this type yet.";return(0,t.jsxs)("div",{className:"w-full max-w-6xl space-y-5",children:[(0,t.jsx)(Me,{query:S,onQueryChange:_,groupBy:r,onGroupByChange:Z,kind:c,onKindChange:O,filters:u?(0,t.jsx)(se,{view:ne(r,c),onViewChange:H}):void 0}),k?(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[(0,t.jsxs)(z,{to:J,"data-testid":"artifact-stack-back",className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",children:[(0,t.jsx)(Se,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"All stacks"]}),h?(0,t.jsxs)("span",{className:"truncate text-muted-foreground",children:[(0,t.jsx)("span",{className:"text-foreground/80",children:h.issue.identifier})," ",h.title]}):null]}):null,p.kind==="loading"||p.kind==="reconnecting"?(0,t.jsx)(Ae,{variant:"list"}):p.kind==="error"?(0,t.jsx)(je,{error:p.error,action:"load artifacts",onRetry:p.retry,retrying:p.isFetching}):W.length===0?(0,t.jsx)(V,{icon:b?C:R,message:X,graphic:(0,t.jsx)(Ee,{stack:b,kind:c==="all"?"file":c==="text"?"code":c})}):u?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(te,{children:b?P.map(e=>{const s=e.previewArtifacts[0];return e.count>1||!s?(0,t.jsx)(ee,{identifier:e.issue.identifier,title:e.title,count:e.count,updatedAt:e.updatedAt,front:s?E(s):{kind:"file",title:e.title,updatedAt:e.updatedAt,taskIdentifier:e.issue.identifier},to:F(e.issue.id)},e.id):(0,t.jsx)($,{subject:E(s),to:s.href},e.id)}):T.map(e=>(0,t.jsx)($,{subject:E(e),to:e.href},`${e.source}:${e.id}`))}),(0,t.jsx)("div",{ref:I,className:"flex min-h-10 items-center justify-center pb-2 text-xs text-muted-foreground",children:N?"Loading more artifacts...":A?null:B?"Updating artifacts...":null})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-2 xl:grid-cols-3",children:b?P.map(e=>(0,t.jsx)(_e,{group:e,to:F(e.issue.id)},e.id)):T.map(e=>(0,t.jsx)(ie,{artifact:e},`${e.source}:${e.id}`))}),(0,t.jsx)("div",{ref:I,className:"flex min-h-10 items-center justify-center pb-2 text-xs text-muted-foreground",children:N?"Loading more artifacts...":A?null:B?"Updating artifacts...":null})]})]})}d(Oe,"Artifacts");export{Oe as Artifacts};
@@ -1 +1 @@
1
- var d=Object.defineProperty;var a=(s,r)=>d(s,"name",{value:r,configurable:!0});import{a as o}from"./rolldown-runtime-DhZMWcEn.js";import{$A as p,Bb as _,GS as y,Gg as t,Kg as A,ME as f,Vm as h,Yg as v,m_ as x,nj as S,rb as q,xE as I}from"./index-Bt31d8ga.js";var b=o(S(),1),j=o(p(),1);function $({companyId:s,value:r,onChange:l,disabled:u,className:c}){const g=f(),i=_({client:g}).userId??null,n=I({queryKey:y.agents.list(s),queryFn:a(()=>q.list(s),"queryFn")}),m=(0,b.useMemo)(()=>[...A(i),...(n.data??[]).filter(x).map(e=>({id:t({assigneeAgentId:e.id}),label:e.name,searchText:`${e.name} ${e.role} ${e.title??""}`}))],[n.data,i]);return(0,j.jsx)(h,{value:t(r),options:m,placeholder:"Assignee",noneLabel:"No assignee",searchPlaceholder:"Search assignees...",emptyMessage:"No assignees found.",onChange:a(e=>l(v(e)),"onChange"),disabled:u,className:c,triggerDataSlot:"microvac-assignee-picker"})}a($,"AssigneePickerInner");export{$ as default};
1
+ var d=Object.defineProperty;var a=(s,r)=>d(s,"name",{value:r,configurable:!0});import{a as o}from"./rolldown-runtime-DhZMWcEn.js";import{$A as p,Bb as _,GS as y,Gg as t,Kg as A,ME as f,Vm as h,Yg as v,m_ as x,nj as S,rb as q,xE as I}from"./index-BJtnP7H1.js";var b=o(S(),1),j=o(p(),1);function $({companyId:s,value:r,onChange:l,disabled:u,className:c}){const g=f(),i=_({client:g}).userId??null,n=I({queryKey:y.agents.list(s),queryFn:a(()=>q.list(s),"queryFn")}),m=(0,b.useMemo)(()=>[...A(i),...(n.data??[]).filter(x).map(e=>({id:t({assigneeAgentId:e.id}),label:e.name,searchText:`${e.name} ${e.role} ${e.title??""}`}))],[n.data,i]);return(0,j.jsx)(h,{value:t(r),options:m,placeholder:"Assignee",noneLabel:"No assignee",searchPlaceholder:"Search assignees...",emptyMessage:"No assignees found.",onChange:a(e=>l(v(e)),"onChange"),disabled:u,className:c,triggerDataSlot:"microvac-assignee-picker"})}a($,"AssigneePickerInner");export{$ as default};
@@ -1 +1 @@
1
- var F=Object.defineProperty;var n=(t,s)=>F(t,"name",{value:s,configurable:!0});import{a as S}from"./rolldown-runtime-DhZMWcEn.js";import{li as G}from"./issue-detail-4PCbYpdv.js";import{$A as B,$S as K,BA as Q,Cw as H,EA as W,Gb as Y,IA as J,Iw as X,LS as P,ME as Z,MT as T,Mb as ee,Mi as te,NE as h,Nb as se,QC as _,QT as j,RT as ae,Rp as ne,Wp as ie,Xd as oe,Yw as re,_C as ce,aT as le,ab as w,bE as de,cT as ue,dT as pe,hC as me,ib as he,ji as xe,kA as I,ki as ge,nj as fe,qC as ve,qp as ye,tT as be,uE as v,ub as L,uv as Ce,uw as je,xE as M,zE as N}from"./index-Bt31d8ga.js";import{n as A}from"./connection-owner-D-ikSHyR.js";var Ne=["paperclip:read","paperclip:write","paperclip:configure","offline_access"],De=J({decision:W(["approve","deny"]),companyId:Q().uuid().optional(),allowWrites:I().default(!1),allowConfiguration:I().default(!1)}).strict(),ke={codex:"Codex",claude:"Claude Code",opencode:"OpenCode",browser:"ChatGPT / Claude web",headless:"Headless",other:"Other"};function we(t,s){const a=new URL("/mcp/setup",t);return s&&a.searchParams.set("company",s),a.toString()}n(we,"mcpSetupUrl");function Ie(t,s){return`Connect to my ${s?`${s.name} `:""}Paperclip organization using the instructions at ${we(t,s?.id)}. Start authorization, give me the approval link, and verify the connection after I approve.`}n(Ie,"mcpInvitation");function Ae(t,s){const a=`'${t.replaceAll("'",`'"'"'`)}'`,i=Ne.join(" ");switch(s){case"codex":return[{text:"Check for an existing Paperclip server first. Reuse it only if its URL matches this instance. Add the remote server with the Codex CLI.",code:`codex mcp add paperclip --url ${a}`},{text:"Start browser authorization and give the user the approval link.",code:"codex mcp login paperclip --scopes paperclip:read,paperclip:write,paperclip:configure,offline_access"},{text:"If the current conversation does not reload its MCP tools, start a new conversation or restart the client. Verify the connection with paperclip_connection before claiming success."}];case"claude":return[{text:"Check existing servers and reuse a matching instance. Add the remote server using Claude Code.",code:`claude mcp add --transport http paperclip ${a}`},{text:"In Claude Code, run /mcp, select paperclip, and choose Authenticate. Versions that offer `claude mcp login --help` can also start authorization with `claude mcp login paperclip`. Give the user the approval link."},{text:"Reconnect through /mcp, or start a new session if needed. Verify the account and organization with paperclip_connection."}];case"opencode":return[{text:"Check `opencode --version` and existing configuration. For OpenCode 1.x, merge this entry into opencode.json without replacing other settings. OpenCode 2.x uses mcp.servers; use that version's documented format instead.",code:JSON.stringify({mcp:{paperclip:{type:"remote",url:t,enabled:!0,oauth:{scope:i}}}},null,2)},{text:"Run from the same project directory. OpenCode opens Paperclip's sign-in and consent page; give the user the approval link.",code:"opencode mcp auth paperclip"},{text:"If OpenCode was already running, restart it to load the connection. For the browser app, use this command. Verify the tools with paperclip_connection.",code:"opencode web"}];case"browser":return[{text:"Open your assistant's Apps / Connectors settings and add a custom remote MCP connection using this URL. Availability depends on the account and workspace policy. Reading this page in chat does not install a connector.",code:t},{text:"Choose OAuth / browser sign-in. Approve the connection in Paperclip, then select the connector in your conversation. If custom connectors are unavailable, use a supported local client. Verify the connected account and organization before doing work."}];case"headless":return[{text:"Use a Paperclip CLI version with `mcp login --device` support. This needs no callback listener; it prints a verification URL and user code, then waits for human approval.",code:`paperclipai mcp login --device --url ${a}`},{text:"After approval, configure a local stdio MCP server running the command below. Credentials stay in the CLI's private credential store. Do not copy tokens or device codes into chat or project configuration.",code:`paperclipai mcp proxy --url ${a}`},{text:"The user code is for the human to verify the request. The private device code remains inside the CLI. After connecting, call paperclip_connection to verify the account and organization."}];default:return[{text:"Add a remote HTTP MCP server at this URL, then choose OAuth / browser sign-in.",code:t},{text:"If the client cannot install MCP servers from chat, use its connection settings. If it cannot receive a browser callback, use the Headless instructions. After approval, verify the account and organization with paperclip_connection."}]}}n(Ae,"mcpSetupSteps");var R={name:"chart-column",size:24,node:[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],aliases:["bar-chart-3"]};R.node;var ze=j(R),$={name:"shopping-bag",size:24,node:[["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}],["path",{d:"M3.103 6.034h17.794",key:"awc11p"}],["path",{d:"M3.4 5.467a2 2 0 0 0-.4 1.2V20a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6.667a2 2 0 0 0-.4-1.2l-2-2.667A2 2 0 0 0 17 2H7a2 2 0 0 0-1.6.8z",key:"o988cm"}]]};$.node;var Se=j($),O={name:"square-check",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"m16 9-5.5 5.5L8 12",key:"xofnsj"}]],aliases:["check-square-2"]};O.node;var Pe=j(O),g=S(fe(),1),b={setup:n(()=>v.get("/mcp/setup"),"setup"),connections:n(()=>v.get("/mcp/connections"),"connections"),revoke:n(t=>v.delete(`/mcp/connections/${encodeURIComponent(t)}`),"revoke")},e=S(B(),1),U="relative z-10 grid size-8 shrink-0 place-items-center rounded-lg";function Te({state:t,label:s}){const a=t==="attention",i=a?me:T;return(0,e.jsxs)("span",{title:s,className:N(U,a?"bg-(--status-task-todo)/15 text-(--status-task-icon-todo)":"bg-(--status-task-done)/15 text-(--status-task-icon-done)"),children:[(0,e.jsx)(i,{className:"size-4","aria-hidden":!0}),(0,e.jsx)("span",{className:"sr-only",children:s})]})}n(Te,"StatusMark");function _e({slug:t,name:s,description:a,brandKey:i,logoUrl:c,darkLogoUrl:l,state:f,statusLabel:u,action:r,onOpen:d,icon:x}){const p=f!=="available";return(0,e.jsxs)("div",{role:"listitem","data-app-slug":t,"data-connected":p?"true":"false",className:"group relative flex min-w-0 flex-col gap-3 rounded-2xl bg-muted/50 p-5 transition-colors hover:bg-muted",children:[(0,e.jsxs)("div",{className:"flex min-h-8 items-center gap-3",children:[x??(0,e.jsx)(ne,{name:s,brandKey:i,logoUrl:c,darkLogoUrl:l,size:32,compact:!0,className:"bg-transparent"}),(0,e.jsx)("h3",{className:"min-w-0 flex-1 truncate text-sm font-semibold text-foreground",children:(0,e.jsx)("button",{type:"button",title:s,className:"block max-w-full truncate text-left outline-none after:absolute after:inset-0 after:rounded-2xl focus-visible:after:ring-2 focus-visible:after:ring-ring",onClick:d,children:s})}),r?(0,e.jsx)(h,{type:"button",variant:"ghost",size:"icon",className:N(U,"bg-foreground/5 hover:bg-foreground/10",p&&"opacity-0 transition-opacity group-hover:opacity-100 focus-visible:opacity-100"),disabled:r.disabled,title:r.title??`${r.label} ${s}`,"aria-label":`${r.label} ${s}`,onClick:r.onSelect,children:(0,e.jsx)(ve,{"aria-hidden":!0})}):null,p?(0,e.jsx)(Te,{state:f,label:u}):null]}),(0,e.jsx)("p",{className:"line-clamp-2 min-h-10 text-sm leading-5 text-muted-foreground",children:a})]})}n(_e,"PluginTile");var Le="grid gap-3 sm:grid-cols-2 xl:grid-cols-3";function Fe({id:t,title:s,count:a,onSeeAll:i,children:c}){return(0,e.jsxs)("section",{id:t,"aria-labelledby":`${t}-title`,className:"flex scroll-mt-6 flex-col gap-3",children:[(0,e.jsxs)("div",{className:"flex min-h-8 items-center justify-between gap-4",children:[(0,e.jsxs)("h2",{id:`${t}-title`,className:"text-base font-semibold text-foreground",children:[s,a===void 0?null:(0,e.jsxs)("span",{className:"font-normal text-muted-foreground tabular-nums",children:[" (",a.toLocaleString(),")"]})]}),i?(0,e.jsx)(h,{type:"button",variant:"ghost",size:"sm",className:"-mr-3 h-8 text-muted-foreground","aria-label":`See all ${s}`,onClick:i,children:"See all"}):null]}),(0,e.jsx)("div",{className:Le,children:c})]})}n(Fe,"PluginShelf");var Ge=["productivity","developer","communication","ai","data","analytics","content","commerce","other"],k={productivity:{label:"Productivity",icon:Pe},developer:{label:"Developer tools",icon:pe},communication:{label:"Communication",icon:je},ai:{label:"AI models & agents",icon:ae},data:{label:"Data",icon:le},analytics:{label:"Analytics",icon:ze},content:{label:"Content",icon:re},commerce:{label:"Commerce",icon:Se},other:{label:"Other",icon:H}},Be=n(t=>{const s=t?.[0];return s&&s in k?s:"other"},"pluginCategoryId"),Ke=n(t=>`plugins-category-${t}`,"pluginCategorySectionId"),Qe=n(t=>!!t&&t in k,"isPluginCategoryId");function He({categories:t,onOpen:s}){return t.length===0?null:(0,e.jsxs)("nav",{"aria-labelledby":"plugins-categories-title",className:"flex flex-col gap-3",children:[(0,e.jsx)("h2",{id:"plugins-categories-title",className:"text-base font-semibold text-foreground",children:"Categories"}),(0,e.jsx)("ul",{className:"-mx-2 grid gap-x-6 sm:grid-cols-2 lg:grid-cols-4",children:t.map(a=>{const{label:i,icon:c}=k[a];return(0,e.jsx)("li",{className:"min-w-0",children:(0,e.jsxs)("button",{type:"button",className:"flex h-10 w-full min-w-0 items-center gap-3 rounded-lg px-2 text-left text-sm text-foreground outline-none hover:bg-muted/50 focus-visible:ring-2 focus-visible:ring-ring",onClick:n(()=>s(a),"onClick"),children:[(0,e.jsx)(c,{className:"size-4 shrink-0 text-muted-foreground","aria-hidden":!0}),(0,e.jsx)("span",{className:"min-w-0 flex-1 truncate",children:i})]})},a)})})]})}n(He,"PluginCategories");var Me="/apps/assistant-connection",C=["mcp-connections"],y=ke;function Re({assistant:t}){return t==="codex"||t==="claude"?(0,e.jsx)("img",{src:`/brands/${t}-color.svg`,alt:"",className:"size-4 shrink-0"}):t==="opencode"?(0,e.jsx)("span",{"aria-hidden":"true",className:"inline-flex shrink-0",children:(0,e.jsx)(oe,{className:"size-4"})}):(0,e.jsx)(t==="browser"?X:t==="headless"?ce:G,{className:"size-4","aria-hidden":"true"})}n(Re,"AssistantIcon");function E(t=!1){const{selectedCompanyId:s}=P(),a=M({queryKey:C,queryFn:b.connections,enabled:!!s,refetchInterval:t?5e3:!1}),i=L(a);return{...a,view:i,loaded:i.kind==="ready"||i.kind==="stale",rows:(a.data??[]).filter(c=>c.companyId===s&&!c.revokedAt&&!c.scopes.includes("paperclip:agent"))}}n(E,"useAssistantConnections");function We({onNavigate:t}){const s=E(),a=s.view.kind==="error";return(0,e.jsx)(_e,{slug:"assistant-connection",name:"Assistant Connection (MCP)",description:a?"Couldn’t load your connection status. Open it to try again.":"Use your Microvac organization from Codex, Claude, OpenCode, or another assistant.",brandKey:"paperclip",icon:(0,e.jsx)(_,{className:"size-8 shrink-0 p-1 text-foreground","aria-hidden":"true"}),state:a?"attention":s.loaded&&s.rows.length>0?"connected":"available",statusLabel:a?"Needs attention":"Connected",action:null,onOpen:n(()=>t(Me),"onOpen")})}n(We,"AssistantConnectionTile");function z({value:t,label:s}){const[a,i]=(0,g.useState)(!1),[c,l]=(0,g.useState)(!1);return(0,g.useEffect)(()=>{i(!1),l(!1)},[t]),(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsxs)("div",{className:"flex items-start gap-3 rounded-md border border-border bg-muted/30 p-3",children:[(0,e.jsx)("pre",{className:N("min-w-0 flex-1 overflow-x-auto whitespace-pre-wrap break-words font-mono text-xs leading-relaxed",K),children:t}),(0,e.jsx)(h,{type:"button",variant:"ghost",size:"icon",className:"size-8 shrink-0","aria-label":`Copy ${s}`,onClick:n(async()=>{try{await ye(t),i(!0),l(!1)}catch{l(!0)}},"onClick"),children:a?(0,e.jsx)(T,{className:"size-4"}):(0,e.jsx)(ue,{className:"size-4"})})]}),(0,e.jsx)("p",{role:"status",className:"text-xs text-muted-foreground",children:c?"Couldn’t copy. Select and copy the text above.":a?"Copied":null})]})}n(z,"CopyValue");function $e(t){return t==="auth"?"Sign in to connect an assistant. This requires a Microvac instance with authenticated user accounts.":"Assistant connections need an authenticated instance with a public HTTPS URL. Ask your instance administrator to configure the public URL, then try again."}n($e,"setupUnavailableCopy");function Ye({initialAssistant:t="codex"}={}){const{selectedCompany:s,selectedCompanyId:a}=P(),{setBreadcrumbs:i}=he(),c=Z(),[l,f]=(0,g.useState)(t),u=M({queryKey:["mcp-setup"],queryFn:b.setup,refetchOnWindowFocus:"always",refetchOnMount:"always"}),r=L(u),d=E(u.isSuccess),x=de({mutationFn:b.revoke,onSuccess:n((o,m)=>(c.setQueryData(C,V=>V?.filter(D=>D.id!==m)),c.invalidateQueries({queryKey:C})),"onSuccess")});if((0,g.useEffect)(()=>(i([{label:"Connectors",href:"/apps"},{label:"Assistant Connection (MCP)"}]),()=>i([])),[i]),!a||!s)return(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Select an organization to connect an assistant."});const p=u.data?.serverUrl??"",q=p?Ie(p,{id:a,name:s.name}):"";return(0,e.jsxs)("div",{className:"max-w-3xl space-y-6 pb-8",children:[(0,e.jsxs)("header",{className:"space-y-4",children:[(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)(_,{className:"size-7 shrink-0"}),(0,e.jsx)("h1",{className:"text-xl font-semibold",children:"Assistant Connection (MCP)"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)(Ce,{companyName:s.name,logoUrl:s.logoUrl,className:"size-12 shrink-0 rounded-lg"}),(0,e.jsxs)("div",{className:"space-y-1",children:[(0,e.jsx)("p",{className:"font-medium",children:s.name}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Connect your assistant to Microvac. Review work, create tasks, and follow up using your account’s access to this organization."})]})]})]}),(u.isPending||r.kind==="reconnecting")&&(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading assistant setup…"}),r.kind==="error"&&(r.errorKind==="auth"||r.errorKind==="not_found"?(0,e.jsxs)("div",{role:"alert",className:"space-y-3",children:[(0,e.jsx)("p",{className:"text-sm text-destructive",children:$e(r.errorKind)}),(0,e.jsx)(h,{variant:"outline",disabled:r.isFetching,onClick:r.retry,children:"Try again"})]}):(0,e.jsx)(w,{error:u.error,action:"load assistant setup",onRetry:r.retry,retrying:r.isFetching})),u.data&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("section",{className:"space-y-4","aria-label":"Invite your assistant",children:[(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Paste this invitation into your assistant. It will help set up the connection and ask you to approve access in Microvac."}),(0,e.jsx)("div",{className:"flex justify-end",children:(0,e.jsx)(ie,{prompt:q,label:"Copy invitation",title:"Invite your assistant",description:"Paste this invitation into your assistant. It will help set up the connection and ask you to approve access in Microvac.",side:"bottom",align:"end"})})]}),(0,e.jsxs)("details",{className:"space-y-4 text-sm",children:[(0,e.jsx)("summary",{className:"cursor-pointer text-muted-foreground",children:"Set up manually"}),(0,e.jsx)(ge,{value:l,onValueChange:n(o=>f(o),"onValueChange"),className:"min-w-0",children:(0,e.jsx)("div",{className:"overflow-x-auto overflow-y-hidden scrollbar-none border-b border-border",children:(0,e.jsx)(xe,{variant:"line",className:"min-w-full justify-start","aria-label":"Assistant setup instructions",children:Object.entries(y).map(([o,m])=>(0,e.jsxs)(te,{value:o,className:"flex-none",children:[(0,e.jsx)(Re,{assistant:o}),m]},o))})})}),(0,e.jsxs)("section",{className:"space-y-4","aria-label":`Set up ${y[l]}`,children:[Ae(p,l).map((o,m)=>(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:o.text}),o.code&&(0,e.jsx)(z,{value:o.code,label:`${y[l]} setup step ${m+1}`})]},`${l}-${m}`)),l!=="browser"&&(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Authorization commands wait for human approval. When using an assistant shell tool, keep the command running in a persistent terminal or background process, capture its output privately, and share the approval URL immediately while it is still running. Client callback deadlines still apply. If the command timed out or stopped, start a fresh authorization request before sharing a link. If the host cannot keep the command alive across turns, ask the user to run it in their own terminal."}),(0,e.jsxs)("p",{className:"text-sm",children:["Choose ",(0,e.jsx)("strong",{children:s.name}),", review access, then click ",(0,e.jsx)("strong",{children:"Connect organization"}),"."]}),(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:"Creating tasks and adding comments may start agent work using the organization’s configured execution budget."})]}),(0,e.jsx)(z,{value:p,label:"MCP server URL"})]})]}),(0,e.jsxs)("section",{className:"space-y-3","aria-labelledby":"connected-assistants",children:[(0,e.jsx)("h2",{id:"connected-assistants",className:"text-sm font-semibold",children:"Your connected assistants"}),(d.isPending||d.view.kind==="reconnecting")&&(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading connections…"}),x.error&&(0,e.jsxs)("p",{role:"alert",className:"text-sm text-destructive",children:["Couldn’t revoke this connection. Try again. ",(0,e.jsx)("button",{type:"button",className:"underline",onClick:n(()=>{d.refetch()},"onClick"),children:"Refresh"})]}),d.view.kind==="error"&&(0,e.jsx)(w,{error:d.error,action:"load your connections",onRetry:d.view.retry,retrying:d.view.isFetching}),d.loaded&&d.rows.length===0&&(0,e.jsxs)("p",{className:"text-sm text-muted-foreground",children:["No assistants connected to ",s.name," yet."]}),(0,e.jsx)("div",{className:"divide-y divide-border",children:d.rows.map(o=>(0,e.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3 py-3",children:[(0,e.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,e.jsx)(ee,{name:A(o),avatarUrl:o.user?.image,initials:se(o.user?.name??"You"),className:"font-medium"}),(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:`Connected as you · ${o.scopes.includes("paperclip:write")?"Read and write":"Read only"}${o.scopes.includes("paperclip:configure")?" · Configure agents, projects and skills":""}`})]}),(0,e.jsx)(h,{variant:"outline",size:"sm",disabled:x.isPending,onClick:n(()=>x.mutate(o.id),"onClick"),"aria-label":`Revoke ${A(o)}`,children:"Revoke"})]},o.id))})]}),(0,e.jsxs)("footer",{className:"flex items-center justify-between gap-3 border-t border-border pt-4",children:[(0,e.jsx)(h,{variant:"ghost",asChild:!0,children:(0,e.jsx)(Y,{to:"/apps",children:"Back to Connections"})}),(0,e.jsxs)("a",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground underline",href:l==="opencode"?"https://opencode.ai/docs/mcp-servers/":l==="claude"?"https://code.claude.com/docs/en/mcp":"https://developers.openai.com/codex/mcp",target:"_blank",rel:"noreferrer",children:["Setup documentation ",(0,e.jsx)(be,{className:"size-3"})]})]})]})}n(Ye,"AssistantConnection");export{Ye as AssistantConnection,We as AssistantConnectionTile,Fe as a,Be as c,He as i,Ke as l,Ge as n,_e as o,Le as r,Qe as s,k as t,E as useAssistantConnections};
1
+ var F=Object.defineProperty;var n=(t,s)=>F(t,"name",{value:s,configurable:!0});import{a as S}from"./rolldown-runtime-DhZMWcEn.js";import{li as G}from"./issue-detail-CZfjXs0M.js";import{$A as B,$S as K,BA as Q,Cw as H,EA as W,Gb as Y,IA as J,Iw as X,LS as P,ME as Z,MT as T,Mb as ee,Mi as te,NE as h,Nb as se,QC as _,QT as j,RT as ae,Rp as ne,Wp as ie,Xd as oe,Yw as re,_C as ce,aT as le,ab as w,bE as de,cT as ue,dT as pe,hC as me,ib as he,ji as xe,kA as I,ki as ge,nj as fe,qC as ve,qp as ye,tT as be,uE as v,ub as L,uv as Ce,uw as je,xE as M,zE as N}from"./index-BJtnP7H1.js";import{n as A}from"./connection-owner-D8fNrFqC.js";var Ne=["paperclip:read","paperclip:write","paperclip:configure","offline_access"],De=J({decision:W(["approve","deny"]),companyId:Q().uuid().optional(),allowWrites:I().default(!1),allowConfiguration:I().default(!1)}).strict(),ke={codex:"Codex",claude:"Claude Code",opencode:"OpenCode",browser:"ChatGPT / Claude web",headless:"Headless",other:"Other"};function we(t,s){const a=new URL("/mcp/setup",t);return s&&a.searchParams.set("company",s),a.toString()}n(we,"mcpSetupUrl");function Ie(t,s){return`Connect to my ${s?`${s.name} `:""}Paperclip organization using the instructions at ${we(t,s?.id)}. Start authorization, give me the approval link, and verify the connection after I approve.`}n(Ie,"mcpInvitation");function Ae(t,s){const a=`'${t.replaceAll("'",`'"'"'`)}'`,i=Ne.join(" ");switch(s){case"codex":return[{text:"Check for an existing Paperclip server first. Reuse it only if its URL matches this instance. Add the remote server with the Codex CLI.",code:`codex mcp add paperclip --url ${a}`},{text:"Start browser authorization and give the user the approval link.",code:"codex mcp login paperclip --scopes paperclip:read,paperclip:write,paperclip:configure,offline_access"},{text:"If the current conversation does not reload its MCP tools, start a new conversation or restart the client. Verify the connection with paperclip_connection before claiming success."}];case"claude":return[{text:"Check existing servers and reuse a matching instance. Add the remote server using Claude Code.",code:`claude mcp add --transport http paperclip ${a}`},{text:"In Claude Code, run /mcp, select paperclip, and choose Authenticate. Versions that offer `claude mcp login --help` can also start authorization with `claude mcp login paperclip`. Give the user the approval link."},{text:"Reconnect through /mcp, or start a new session if needed. Verify the account and organization with paperclip_connection."}];case"opencode":return[{text:"Check `opencode --version` and existing configuration. For OpenCode 1.x, merge this entry into opencode.json without replacing other settings. OpenCode 2.x uses mcp.servers; use that version's documented format instead.",code:JSON.stringify({mcp:{paperclip:{type:"remote",url:t,enabled:!0,oauth:{scope:i}}}},null,2)},{text:"Run from the same project directory. OpenCode opens Paperclip's sign-in and consent page; give the user the approval link.",code:"opencode mcp auth paperclip"},{text:"If OpenCode was already running, restart it to load the connection. For the browser app, use this command. Verify the tools with paperclip_connection.",code:"opencode web"}];case"browser":return[{text:"Open your assistant's Apps / Connectors settings and add a custom remote MCP connection using this URL. Availability depends on the account and workspace policy. Reading this page in chat does not install a connector.",code:t},{text:"Choose OAuth / browser sign-in. Approve the connection in Paperclip, then select the connector in your conversation. If custom connectors are unavailable, use a supported local client. Verify the connected account and organization before doing work."}];case"headless":return[{text:"Use a Paperclip CLI version with `mcp login --device` support. This needs no callback listener; it prints a verification URL and user code, then waits for human approval.",code:`paperclipai mcp login --device --url ${a}`},{text:"After approval, configure a local stdio MCP server running the command below. Credentials stay in the CLI's private credential store. Do not copy tokens or device codes into chat or project configuration.",code:`paperclipai mcp proxy --url ${a}`},{text:"The user code is for the human to verify the request. The private device code remains inside the CLI. After connecting, call paperclip_connection to verify the account and organization."}];default:return[{text:"Add a remote HTTP MCP server at this URL, then choose OAuth / browser sign-in.",code:t},{text:"If the client cannot install MCP servers from chat, use its connection settings. If it cannot receive a browser callback, use the Headless instructions. After approval, verify the account and organization with paperclip_connection."}]}}n(Ae,"mcpSetupSteps");var R={name:"chart-column",size:24,node:[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],aliases:["bar-chart-3"]};R.node;var ze=j(R),$={name:"shopping-bag",size:24,node:[["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}],["path",{d:"M3.103 6.034h17.794",key:"awc11p"}],["path",{d:"M3.4 5.467a2 2 0 0 0-.4 1.2V20a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6.667a2 2 0 0 0-.4-1.2l-2-2.667A2 2 0 0 0 17 2H7a2 2 0 0 0-1.6.8z",key:"o988cm"}]]};$.node;var Se=j($),O={name:"square-check",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"m16 9-5.5 5.5L8 12",key:"xofnsj"}]],aliases:["check-square-2"]};O.node;var Pe=j(O),g=S(fe(),1),b={setup:n(()=>v.get("/mcp/setup"),"setup"),connections:n(()=>v.get("/mcp/connections"),"connections"),revoke:n(t=>v.delete(`/mcp/connections/${encodeURIComponent(t)}`),"revoke")},e=S(B(),1),U="relative z-10 grid size-8 shrink-0 place-items-center rounded-lg";function Te({state:t,label:s}){const a=t==="attention",i=a?me:T;return(0,e.jsxs)("span",{title:s,className:N(U,a?"bg-(--status-task-todo)/15 text-(--status-task-icon-todo)":"bg-(--status-task-done)/15 text-(--status-task-icon-done)"),children:[(0,e.jsx)(i,{className:"size-4","aria-hidden":!0}),(0,e.jsx)("span",{className:"sr-only",children:s})]})}n(Te,"StatusMark");function _e({slug:t,name:s,description:a,brandKey:i,logoUrl:c,darkLogoUrl:l,state:f,statusLabel:u,action:r,onOpen:d,icon:x}){const p=f!=="available";return(0,e.jsxs)("div",{role:"listitem","data-app-slug":t,"data-connected":p?"true":"false",className:"group relative flex min-w-0 flex-col gap-3 rounded-2xl bg-muted/50 p-5 transition-colors hover:bg-muted",children:[(0,e.jsxs)("div",{className:"flex min-h-8 items-center gap-3",children:[x??(0,e.jsx)(ne,{name:s,brandKey:i,logoUrl:c,darkLogoUrl:l,size:32,compact:!0,className:"bg-transparent"}),(0,e.jsx)("h3",{className:"min-w-0 flex-1 truncate text-sm font-semibold text-foreground",children:(0,e.jsx)("button",{type:"button",title:s,className:"block max-w-full truncate text-left outline-none after:absolute after:inset-0 after:rounded-2xl focus-visible:after:ring-2 focus-visible:after:ring-ring",onClick:d,children:s})}),r?(0,e.jsx)(h,{type:"button",variant:"ghost",size:"icon",className:N(U,"bg-foreground/5 hover:bg-foreground/10",p&&"opacity-0 transition-opacity group-hover:opacity-100 focus-visible:opacity-100"),disabled:r.disabled,title:r.title??`${r.label} ${s}`,"aria-label":`${r.label} ${s}`,onClick:r.onSelect,children:(0,e.jsx)(ve,{"aria-hidden":!0})}):null,p?(0,e.jsx)(Te,{state:f,label:u}):null]}),(0,e.jsx)("p",{className:"line-clamp-2 min-h-10 text-sm leading-5 text-muted-foreground",children:a})]})}n(_e,"PluginTile");var Le="grid gap-3 sm:grid-cols-2 xl:grid-cols-3";function Fe({id:t,title:s,count:a,onSeeAll:i,children:c}){return(0,e.jsxs)("section",{id:t,"aria-labelledby":`${t}-title`,className:"flex scroll-mt-6 flex-col gap-3",children:[(0,e.jsxs)("div",{className:"flex min-h-8 items-center justify-between gap-4",children:[(0,e.jsxs)("h2",{id:`${t}-title`,className:"text-base font-semibold text-foreground",children:[s,a===void 0?null:(0,e.jsxs)("span",{className:"font-normal text-muted-foreground tabular-nums",children:[" (",a.toLocaleString(),")"]})]}),i?(0,e.jsx)(h,{type:"button",variant:"ghost",size:"sm",className:"-mr-3 h-8 text-muted-foreground","aria-label":`See all ${s}`,onClick:i,children:"See all"}):null]}),(0,e.jsx)("div",{className:Le,children:c})]})}n(Fe,"PluginShelf");var Ge=["productivity","developer","communication","ai","data","analytics","content","commerce","other"],k={productivity:{label:"Productivity",icon:Pe},developer:{label:"Developer tools",icon:pe},communication:{label:"Communication",icon:je},ai:{label:"AI models & agents",icon:ae},data:{label:"Data",icon:le},analytics:{label:"Analytics",icon:ze},content:{label:"Content",icon:re},commerce:{label:"Commerce",icon:Se},other:{label:"Other",icon:H}},Be=n(t=>{const s=t?.[0];return s&&s in k?s:"other"},"pluginCategoryId"),Ke=n(t=>`plugins-category-${t}`,"pluginCategorySectionId"),Qe=n(t=>!!t&&t in k,"isPluginCategoryId");function He({categories:t,onOpen:s}){return t.length===0?null:(0,e.jsxs)("nav",{"aria-labelledby":"plugins-categories-title",className:"flex flex-col gap-3",children:[(0,e.jsx)("h2",{id:"plugins-categories-title",className:"text-base font-semibold text-foreground",children:"Categories"}),(0,e.jsx)("ul",{className:"-mx-2 grid gap-x-6 sm:grid-cols-2 lg:grid-cols-4",children:t.map(a=>{const{label:i,icon:c}=k[a];return(0,e.jsx)("li",{className:"min-w-0",children:(0,e.jsxs)("button",{type:"button",className:"flex h-10 w-full min-w-0 items-center gap-3 rounded-lg px-2 text-left text-sm text-foreground outline-none hover:bg-muted/50 focus-visible:ring-2 focus-visible:ring-ring",onClick:n(()=>s(a),"onClick"),children:[(0,e.jsx)(c,{className:"size-4 shrink-0 text-muted-foreground","aria-hidden":!0}),(0,e.jsx)("span",{className:"min-w-0 flex-1 truncate",children:i})]})},a)})})]})}n(He,"PluginCategories");var Me="/apps/assistant-connection",C=["mcp-connections"],y=ke;function Re({assistant:t}){return t==="codex"||t==="claude"?(0,e.jsx)("img",{src:`/brands/${t}-color.svg`,alt:"",className:"size-4 shrink-0"}):t==="opencode"?(0,e.jsx)("span",{"aria-hidden":"true",className:"inline-flex shrink-0",children:(0,e.jsx)(oe,{className:"size-4"})}):(0,e.jsx)(t==="browser"?X:t==="headless"?ce:G,{className:"size-4","aria-hidden":"true"})}n(Re,"AssistantIcon");function E(t=!1){const{selectedCompanyId:s}=P(),a=M({queryKey:C,queryFn:b.connections,enabled:!!s,refetchInterval:t?5e3:!1}),i=L(a);return{...a,view:i,loaded:i.kind==="ready"||i.kind==="stale",rows:(a.data??[]).filter(c=>c.companyId===s&&!c.revokedAt&&!c.scopes.includes("paperclip:agent"))}}n(E,"useAssistantConnections");function We({onNavigate:t}){const s=E(),a=s.view.kind==="error";return(0,e.jsx)(_e,{slug:"assistant-connection",name:"Assistant Connection (MCP)",description:a?"Couldn’t load your connection status. Open it to try again.":"Use your Microvac organization from Codex, Claude, OpenCode, or another assistant.",brandKey:"paperclip",icon:(0,e.jsx)(_,{className:"size-8 shrink-0 p-1 text-foreground","aria-hidden":"true"}),state:a?"attention":s.loaded&&s.rows.length>0?"connected":"available",statusLabel:a?"Needs attention":"Connected",action:null,onOpen:n(()=>t(Me),"onOpen")})}n(We,"AssistantConnectionTile");function z({value:t,label:s}){const[a,i]=(0,g.useState)(!1),[c,l]=(0,g.useState)(!1);return(0,g.useEffect)(()=>{i(!1),l(!1)},[t]),(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsxs)("div",{className:"flex items-start gap-3 rounded-md border border-border bg-muted/30 p-3",children:[(0,e.jsx)("pre",{className:N("min-w-0 flex-1 overflow-x-auto whitespace-pre-wrap break-words font-mono text-xs leading-relaxed",K),children:t}),(0,e.jsx)(h,{type:"button",variant:"ghost",size:"icon",className:"size-8 shrink-0","aria-label":`Copy ${s}`,onClick:n(async()=>{try{await ye(t),i(!0),l(!1)}catch{l(!0)}},"onClick"),children:a?(0,e.jsx)(T,{className:"size-4"}):(0,e.jsx)(ue,{className:"size-4"})})]}),(0,e.jsx)("p",{role:"status",className:"text-xs text-muted-foreground",children:c?"Couldn’t copy. Select and copy the text above.":a?"Copied":null})]})}n(z,"CopyValue");function $e(t){return t==="auth"?"Sign in to connect an assistant. This requires a Microvac instance with authenticated user accounts.":"Assistant connections need an authenticated instance with a public HTTPS URL. Ask your instance administrator to configure the public URL, then try again."}n($e,"setupUnavailableCopy");function Ye({initialAssistant:t="codex"}={}){const{selectedCompany:s,selectedCompanyId:a}=P(),{setBreadcrumbs:i}=he(),c=Z(),[l,f]=(0,g.useState)(t),u=M({queryKey:["mcp-setup"],queryFn:b.setup,refetchOnWindowFocus:"always",refetchOnMount:"always"}),r=L(u),d=E(u.isSuccess),x=de({mutationFn:b.revoke,onSuccess:n((o,m)=>(c.setQueryData(C,V=>V?.filter(D=>D.id!==m)),c.invalidateQueries({queryKey:C})),"onSuccess")});if((0,g.useEffect)(()=>(i([{label:"Connectors",href:"/apps"},{label:"Assistant Connection (MCP)"}]),()=>i([])),[i]),!a||!s)return(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Select an organization to connect an assistant."});const p=u.data?.serverUrl??"",q=p?Ie(p,{id:a,name:s.name}):"";return(0,e.jsxs)("div",{className:"max-w-3xl space-y-6 pb-8",children:[(0,e.jsxs)("header",{className:"space-y-4",children:[(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)(_,{className:"size-7 shrink-0"}),(0,e.jsx)("h1",{className:"text-xl font-semibold",children:"Assistant Connection (MCP)"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)(Ce,{companyName:s.name,logoUrl:s.logoUrl,className:"size-12 shrink-0 rounded-lg"}),(0,e.jsxs)("div",{className:"space-y-1",children:[(0,e.jsx)("p",{className:"font-medium",children:s.name}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Connect your assistant to Microvac. Review work, create tasks, and follow up using your account’s access to this organization."})]})]})]}),(u.isPending||r.kind==="reconnecting")&&(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading assistant setup…"}),r.kind==="error"&&(r.errorKind==="auth"||r.errorKind==="not_found"?(0,e.jsxs)("div",{role:"alert",className:"space-y-3",children:[(0,e.jsx)("p",{className:"text-sm text-destructive",children:$e(r.errorKind)}),(0,e.jsx)(h,{variant:"outline",disabled:r.isFetching,onClick:r.retry,children:"Try again"})]}):(0,e.jsx)(w,{error:u.error,action:"load assistant setup",onRetry:r.retry,retrying:r.isFetching})),u.data&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("section",{className:"space-y-4","aria-label":"Invite your assistant",children:[(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Paste this invitation into your assistant. It will help set up the connection and ask you to approve access in Microvac."}),(0,e.jsx)("div",{className:"flex justify-end",children:(0,e.jsx)(ie,{prompt:q,label:"Copy invitation",title:"Invite your assistant",description:"Paste this invitation into your assistant. It will help set up the connection and ask you to approve access in Microvac.",side:"bottom",align:"end"})})]}),(0,e.jsxs)("details",{className:"space-y-4 text-sm",children:[(0,e.jsx)("summary",{className:"cursor-pointer text-muted-foreground",children:"Set up manually"}),(0,e.jsx)(ge,{value:l,onValueChange:n(o=>f(o),"onValueChange"),className:"min-w-0",children:(0,e.jsx)("div",{className:"overflow-x-auto overflow-y-hidden scrollbar-none border-b border-border",children:(0,e.jsx)(xe,{variant:"line",className:"min-w-full justify-start","aria-label":"Assistant setup instructions",children:Object.entries(y).map(([o,m])=>(0,e.jsxs)(te,{value:o,className:"flex-none",children:[(0,e.jsx)(Re,{assistant:o}),m]},o))})})}),(0,e.jsxs)("section",{className:"space-y-4","aria-label":`Set up ${y[l]}`,children:[Ae(p,l).map((o,m)=>(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:o.text}),o.code&&(0,e.jsx)(z,{value:o.code,label:`${y[l]} setup step ${m+1}`})]},`${l}-${m}`)),l!=="browser"&&(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Authorization commands wait for human approval. When using an assistant shell tool, keep the command running in a persistent terminal or background process, capture its output privately, and share the approval URL immediately while it is still running. Client callback deadlines still apply. If the command timed out or stopped, start a fresh authorization request before sharing a link. If the host cannot keep the command alive across turns, ask the user to run it in their own terminal."}),(0,e.jsxs)("p",{className:"text-sm",children:["Choose ",(0,e.jsx)("strong",{children:s.name}),", review access, then click ",(0,e.jsx)("strong",{children:"Connect organization"}),"."]}),(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:"Creating tasks and adding comments may start agent work using the organization’s configured execution budget."})]}),(0,e.jsx)(z,{value:p,label:"MCP server URL"})]})]}),(0,e.jsxs)("section",{className:"space-y-3","aria-labelledby":"connected-assistants",children:[(0,e.jsx)("h2",{id:"connected-assistants",className:"text-sm font-semibold",children:"Your connected assistants"}),(d.isPending||d.view.kind==="reconnecting")&&(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading connections…"}),x.error&&(0,e.jsxs)("p",{role:"alert",className:"text-sm text-destructive",children:["Couldn’t revoke this connection. Try again. ",(0,e.jsx)("button",{type:"button",className:"underline",onClick:n(()=>{d.refetch()},"onClick"),children:"Refresh"})]}),d.view.kind==="error"&&(0,e.jsx)(w,{error:d.error,action:"load your connections",onRetry:d.view.retry,retrying:d.view.isFetching}),d.loaded&&d.rows.length===0&&(0,e.jsxs)("p",{className:"text-sm text-muted-foreground",children:["No assistants connected to ",s.name," yet."]}),(0,e.jsx)("div",{className:"divide-y divide-border",children:d.rows.map(o=>(0,e.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3 py-3",children:[(0,e.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,e.jsx)(ee,{name:A(o),avatarUrl:o.user?.image,initials:se(o.user?.name??"You"),className:"font-medium"}),(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:`Connected as you · ${o.scopes.includes("paperclip:write")?"Read and write":"Read only"}${o.scopes.includes("paperclip:configure")?" · Configure agents, projects and skills":""}`})]}),(0,e.jsx)(h,{variant:"outline",size:"sm",disabled:x.isPending,onClick:n(()=>x.mutate(o.id),"onClick"),"aria-label":`Revoke ${A(o)}`,children:"Revoke"})]},o.id))})]}),(0,e.jsxs)("footer",{className:"flex items-center justify-between gap-3 border-t border-border pt-4",children:[(0,e.jsx)(h,{variant:"ghost",asChild:!0,children:(0,e.jsx)(Y,{to:"/apps",children:"Back to Connections"})}),(0,e.jsxs)("a",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground underline",href:l==="opencode"?"https://opencode.ai/docs/mcp-servers/":l==="claude"?"https://code.claude.com/docs/en/mcp":"https://developers.openai.com/codex/mcp",target:"_blank",rel:"noreferrer",children:["Setup documentation ",(0,e.jsx)(be,{className:"size-3"})]})]})]})}n(Ye,"AssistantConnection");export{Ye as AssistantConnection,We as AssistantConnectionTile,Fe as a,Be as c,He as i,Ke as l,Ge as n,_e as o,Le as r,Qe as s,k as t,E as useAssistantConnections};
@@ -1 +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};
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-CZfjXs0M.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-BJtnP7H1.js";import{t as se}from"./budgets-CAWPqcn4.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};
@@ -1 +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};
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-CZfjXs0M.js";import{S as $}from"./collections-B58p51lw.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-BJtnP7H1.js";import{n as Ys,r as Ws}from"./AttentionInlineVerbs-BiyZ1ekZ.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};
@@ -1 +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};
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-orBM8T-a.js";import{n as Z,t as J}from"./AuditRuns-CUdlbP7S.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-BJtnP7H1.js";import{t as Ne}from"./RoutineAuditActivity-BCo7pYe5.js";import{t as ke}from"./Timeline-BWA9dyk6.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};