@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 dt=Object.defineProperty;var s=(t,i)=>dt(t,"name",{value:i,configurable:!0});import{a as He}from"./rolldown-runtime-DhZMWcEn.js";import{t as Oe}from"./search-DkTqg7ab.js";import{y as Se}from"./collections-BxrcELwt.js";import{$A as ut,$S as ct,$T as re,Ai as ce,Ap as xe,BA as n,BC as mt,B_ as Ke,EA as te,Ev as ht,FA as w,GS as N,HC as Qe,H_ as pe,IA as k,Kw as Be,LA as xt,LS as pt,ME as Me,Mi as me,Mp as gt,NE as q,Np as we,OA as ge,Op as ke,Pp as Ie,RA as ft,Sp as De,TA as Le,Up as yt,V_ as Ve,Vm as bt,WE as he,Yb as vt,_ as jt,__ as X,_v as Z,_w as _,aE as Nt,ab as We,bE as L,d as Ct,dy as St,fy as wt,g as kt,g_ as Ge,hC as Te,hE as F,hv as It,iD as V,ib as Tt,jT as Ye,jb as At,ji as Pt,kA as P,ki as Et,kp as Ae,ly as Mt,m_ as Rt,my as _t,nT as qt,nj as $t,oC as Je,on as Bt,p as Dt,pm as fe,pv as Lt,qC as Ft,rb as Ut,sy as zt,tT as Pe,uE as R,ub as Ee,uy as Ht,vb as Ot,x as ee,xE as U,xS as Kt,xT as Qt,xb as Vt,xv as Wt,yb as Gt,zE as E,z_ as Ze}from"./index-Bt31d8ga.js";import{t as Xe}from"./useSummaryDraftStream-DPQRvaXT.js";function Yt(t){try{return new Intl.DateTimeFormat("en",{timeZone:t}).format(),!0}catch{return!1}}s(Yt,"isValidTimeZone");var Jt=te(["compiling","active","error","paused_budget","paused_hours"]),Zt=te(["compile","full","incremental"]),Xt=te(["manual","interval","reactive","restore"]),es=te(["running","ok","failed"]),ts=k({statusTransitions:P().default(!0),membershipChanges:P().default(!0),humanComments:P().default(!0),assigneeChanges:P().default(!0),anyUpdate:P().default(!1)}),ye=k({mode:te(["manual","interval","reactive"]).default("manual"),intervalMinutes:w().int().positive().optional(),debounceSeconds:w().int().positive().optional(),maxUpdatesPerHour:w().int().positive().optional(),triggers:ts.prefault({}),activeHours:k({start:n().regex(/^([01]\d|2[0-3]):[0-5]\d$/),end:n().regex(/^([01]\d|2[0-3]):[0-5]\d$/),timezone:n().trim().min(1).refine(Yt,{message:"Invalid timezone identifier"})}).optional(),dailyTokenCap:w().int().positive().optional()}).superRefine((t,i)=>{t.mode==="interval"&&t.intervalMinutes===void 0&&i.addIssue({code:Le.custom,path:["intervalMinutes"],message:"Required for interval mode"}),t.mode==="reactive"&&t.debounceSeconds===void 0&&i.addIssue({code:Le.custom,path:["debounceSeconds"],message:"Required for reactive mode"})}),et=ye.parse({mode:"manual"}),ss=ft(n(),k({status:n(),updatedAt:n().datetime(),latestHumanCommentAt:n().datetime().nullable().optional(),identifier:n().nullable().optional(),title:n().optional(),assigneeAgentId:n().guid().nullable().optional(),assigneeUserId:n().nullable().optional()})),Rs=k({id:n().guid(),companyId:n().guid(),createdByUserId:n().nullable(),createdByAgentId:n().guid().nullable(),title:n().nullable(),titlePinned:P(),interestPrompt:n(),queries:ge(Oe),queryVersion:w().int().nonnegative(),queryCompiledAt:n().datetime().nullable(),queryCompiledByAgentId:n().guid().nullable(),agentId:n().guid().nullable(),refreshPolicy:ye,state:Jt,pendingChangeCount:w().int().nonnegative(),lastChangeAt:n().datetime().nullable(),fingerprint:ss.nullable(),fingerprintAt:n().datetime().nullable(),mentionedIssueIds:ge(n().guid()).default([]),documentId:n().guid().nullable(),lastUpdateRunKind:te(["full","incremental"]).nullable(),lastGeneratedAt:n().datetime().nullable(),lastModel:n().nullable(),generatingIssueId:n().guid().nullable(),failureReason:n().nullable(),nextEvalAt:n().datetime().nullable(),archivedAt:n().datetime().nullable(),archivedByUserId:n().nullable(),archivedByAgentId:n().guid().nullable(),createdAt:n().datetime(),updatedAt:n().datetime(),summaryBody:n().nullable().optional(),watchedIssueCount:w().int().nonnegative().optional(),todayTokens:w().int().nonnegative().optional(),todayCostCents:w().nonnegative().optional(),href:n().optional()}),as=k({issueId:n().guid(),identifier:n(),from:n().nullable(),to:n().nullable(),changeKind:n()}),_s=k({id:n().guid(),cardId:n().guid(),kind:Zt,trigger:Xt,generationIssueId:n().guid().nullable(),runId:n().guid().nullable(),changes:ge(as),inputTokens:w().int().nonnegative(),outputTokens:w().int().nonnegative(),costCents:w().nonnegative(),model:n().nullable(),queryVersion:w().int().nonnegative().nullable(),changeSummary:n().nullable(),startedAt:n().datetime(),finishedAt:n().datetime().nullable(),status:es,error:n().nullable()}),qs=k({id:n().guid(),revisionNumber:w().int().positive(),title:n().nullable(),body:n(),changeSummary:n().nullable(),createdAt:n().datetime()}),$s=k({archived:xt(t=>t==="true"?!0:t==="false"?!1:t,P().default(!1))}),Bs=k({interestPrompt:n().trim().min(1).max(2e4),title:n().trim().min(1).max(300).optional(),titlePinned:P().default(!1),agentId:n().guid().nullable().optional(),refreshPolicy:ye.default(et)}),Ds=k({interestPrompt:n().trim().min(1).max(2e4).optional(),title:n().trim().min(1).max(300).nullable().optional(),titlePinned:P().optional(),agentId:n().guid().nullable().optional(),refreshPolicy:ye.optional(),archived:P().optional()}).refine(t=>Object.keys(t).length>0,"At least one field is required"),Ls=k({full:P().default(!1)}),Fs=k({queries:ge(Oe).min(1).max(10),title:n().trim().min(1).max(300),changeSummary:n().trim().min(1).max(2e3),generationIssueId:n().guid()}),Us=k({markdown:n().trim().min(1).max(2e5),title:n().trim().min(1).max(300).optional(),changeSummary:n().trim().min(1).max(2e3),generationIssueId:n().guid(),model:n().trim().min(1).max(200).optional().nullable()}),g=He($t(),1),C={list:s((t,i=!1)=>R.get(`/companies/${t}/status-cards?archived=${i?"true":"false"}`),"list"),get:s(t=>R.get(`/status-cards/${t}`),"get"),create:s((t,i)=>R.post(`/companies/${t}/status-cards`,i),"create"),patch:s((t,i)=>R.patch(`/status-cards/${t}`,i),"patch"),remove:s(t=>R.delete(`/status-cards/${t}`),"remove"),updates:s(t=>R.get(`/status-cards/${t}/updates`),"updates"),summaryRevisions:s(t=>R.get(`/status-cards/${t}/summary-revisions`),"summaryRevisions"),refresh:s(t=>R.post(`/status-cards/${t}/refresh`,{}),"refresh"),recompile:s(t=>R.post(`/status-cards/${t}/recompile`,{}),"recompile"),dryRun:s(t=>R.get(`/status-cards/${t}/dry-run`),"dryRun")};function z(t){return t==null?null:t<1e3?`${t} tok`:`${(t/1e3).toFixed(1)}k tok`}s(z,"formatTokens");function W(t){if(t==null)return null;const i=t/100;return i===0?"$0.00":i<.1?`$${i.toFixed(3)}`:`$${i.toFixed(2)}`}s(W,"formatCents");function tt(t){return t.reduce((i,r)=>({updateCount:i.updateCount+(r.kind==="compile"?0:1),totalTokens:i.totalTokens+r.inputTokens+r.outputTokens,totalCostCents:i.totalCostCents+r.costCents}),{updateCount:0,totalTokens:0,totalCostCents:0})}s(tt,"accumulate");function ns(t){return tt(t)}s(ns,"rollupUpdates");function rs(t,i=new Date){const r=new Date(i);r.setUTCHours(0,0,0,0);const m=r.getTime();return tt(t.filter(d=>new Date(d.startedAt).getTime()>=m))}s(rs,"rollupUpdatesToday");var is=4500,ls=3,Fe=2e3,os=1;function ds(t){const i=t.activeHours;if(!i)return 1440;const[r,m]=i.start.split(":").map(Number),[d,c]=i.end.split(":").map(Number),x=r*60+m,f=d*60+c,l=f>x?f-x:1440-(x-f);return l>0?l:1440}s(ds,"activeWindowMinutes");function us(t){if(t.mode==="manual"){const h=`${W(ls)} · ${z(is)}`;return{cost:h,primary:`~1 rebuild per refresh ≈ ${h}`,note:"Manual cards only cost tokens when you press Refresh."}}const i=ds(t);let r,m;if(t.mode==="interval"){const h=t.intervalMinutes??15;r=Math.floor(i/h),m=`every ${h} min`}else{const h=t.maxUpdatesPerHour??6;r=Math.round(i/60*h),m=`up to ${h}/hour`}const d=t.dailyTokenCap??null,c=d!==null?Math.floor(d/Fe):1/0,x=Math.max(0,Math.min(r,c)),f=d!==null&&c<r,l=x*Fe,y=x*os,a=t.activeHours?" during active hours":"",p=`${W(y)} · ${z(l)}`;return{cost:p,primary:`Up to ~${x} updates/day (${m}${a}) ≈ ${p}`,note:f?`Capped by your ${z(d)} daily token cap — the card pauses when it's hit.`:"Only runs when something changed; a cheap no-op check otherwise."}}s(us,"estimateStatusCardCost");function cs(t,i){const r=s(m=>m<1e3?`${m}`:`${(m/1e3).toFixed(1)}k`,"fmt");return`${r(t)} in / ${r(i)} out`}s(cs,"formatTokenSplit");function Ne(t){switch(t){case"compile":return"compile";case"full":return"full rebuild";case"incremental":return"incremental";default:return t}}s(Ne,"updateKindLabel");function st(t){return t.archivedAt?"archived":t.state==="compiling"?"compiling":t.state==="error"?"error":t.state==="paused_budget"?"paused_budget":t.state==="paused_hours"?"paused_hours":t.generatingIssueId?"updating":t.pendingChangeCount>0?"stale":"fresh"}s(st,"deriveStatusCardLifecycle");var at={compiling:{label:"Setting up",dotClassName:"bg-cyan-400 animate-pulse",description:"Just created; setting up and generating the first summary.",dashedBorder:!0,keepsLastSummary:!1},fresh:{label:"Fresh",dotClassName:"bg-emerald-400",description:"Summary reflects all known changes; nothing pending.",dashedBorder:!1,keepsLastSummary:!0},stale:{label:"Stale",dotClassName:"bg-amber-400",description:"Changes are pending since the last update.",dashedBorder:!1,keepsLastSummary:!0},updating:{label:"Updating",dotClassName:"bg-blue-500 animate-pulse",description:"An update is streaming in now.",dashedBorder:!1,keepsLastSummary:!0},error:{label:"Error",dotClassName:"bg-red-500",description:"The last run failed; the last good summary stays visible.",dashedBorder:!1,keepsLastSummary:!0},paused_budget:{label:"Paused — budget",dotClassName:"bg-orange-400",description:"The daily token cap was hit; auto-updates are suspended.",dashedBorder:!1,keepsLastSummary:!0},paused_hours:{label:"Paused — hours",dotClassName:"bg-orange-400",description:"Outside active hours; changes batch into one update at window open.",dashedBorder:!1,keepsLastSummary:!0},archived:{label:"Archived",dotClassName:"bg-muted-foreground/50",description:"No auto-updates and no watches. Restore to start watching again.",dashedBorder:!1,keepsLastSummary:!0}};function nt(t){switch(t.mode){case"manual":return"manual";case"interval":return t.intervalMinutes?`every ${t.intervalMinutes}m if changed`:"on a schedule if changed";case"reactive":return`on change (${t.debounceSeconds??60}s)`;default:return"manual"}}s(nt,"describeRefreshPolicy");var e=He(ut(),1);function ms({className:t}){return(0,e.jsx)("span",{className:E("mt-1 inline-block h-2.5 w-2.5 shrink-0 rounded-full",t),"aria-hidden":"true"})}s(ms,"StateDot");function ne(t){return i=>{i.stopPropagation(),t()}}s(ne,"stopClick");function hs({card:t,companyId:i,onOpen:r,onRefresh:m,onRecompile:d,onEditInterest:c,onOpenDebug:x,onArchive:f,refreshPending:l,recompilePending:y}){const a=st(t),p=at[a],h=a==="compiling"&&!!t.generatingIssueId,b=(0,g.useMemo)(()=>a==="updating"&&t.generatingIssueId?{id:t.generatingIssueId,identifier:null,title:t.title??"Status update",status:"in_progress"}:null,[a,t.generatingIssueId,t.title]),S=Xe(i,b),G=nt(t.refreshPolicy),T=z(t.todayTokens),j=W(t.todayCostCents),H=t.lastGeneratedAt?V(t.lastGeneratedAt):"no summary yet",$=!!(t.summaryBody&&t.summaryBody.trim().length>0);return(0,e.jsxs)("div",{role:"button",tabIndex:0,onClick:r,onKeyDown:s(v=>{v.target===v.currentTarget&&(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),r())},"onKeyDown"),className:E("group flex h-72 cursor-pointer flex-col rounded-lg border border-border bg-card text-card-foreground transition-colors hover:border-muted-foreground/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",p.dashedBorder&&"border-dashed"),"data-testid":"status-card-tile","data-lifecycle":a,children:[(0,e.jsxs)("div",{className:"flex items-start gap-2 px-4 pt-4",children:[a==="compiling"?null:(0,e.jsx)(ms,{className:p.dotClassName}),(0,e.jsx)("span",{className:E("line-clamp-1 min-w-0 flex-1 text-sm font-semibold",a==="compiling"&&"text-muted-foreground"),title:t.title??t.interestPrompt,children:t.title??"New card"}),(0,e.jsx)("div",{onClick:s(v=>v.stopPropagation(),"onClick"),children:(0,e.jsxs)(Lt,{children:[(0,e.jsx)(ht,{asChild:!0,children:(0,e.jsx)(q,{variant:"ghost",size:"icon",className:"-mr-1 -mt-1 h-7 w-7 text-muted-foreground","aria-label":"Card actions",children:(0,e.jsx)(qt,{className:"h-4 w-4"})})}),(0,e.jsxs)(It,{align:"end",children:[(0,e.jsx)(Z,{onSelect:r,children:"Open detail"}),(0,e.jsx)(Z,{onSelect:m,disabled:l||a==="updating",children:"Refresh now"}),a==="compiling"&&!h||a==="error"?(0,e.jsx)(Z,{onSelect:d,disabled:y,children:"Run now"}):null,(0,e.jsx)(Z,{onSelect:c,children:"Edit interest & settings"}),(0,e.jsx)(Z,{onSelect:x,children:"Query debug"}),(0,e.jsx)(Wt,{}),(0,e.jsx)(Z,{onSelect:f,variant:"destructive",children:"Archive"})]})]})})]}),(0,e.jsxs)("div",{className:"px-4 pt-2",children:[a==="compiling"?(0,e.jsxs)("div",{className:"rounded-md bg-muted px-3 py-2 text-xs text-foreground",role:"status","aria-live":"polite",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[h?(0,e.jsx)(_,{className:"h-3.5 w-3.5 shrink-0 animate-spin text-muted-foreground"}):(0,e.jsx)(Te,{className:"h-3.5 w-3.5 shrink-0 text-amber-500"}),(0,e.jsx)("span",{children:h?"Setting up your card…":"Setup didn’t finish"})]}),(0,e.jsxs)("p",{className:"mt-1 line-clamp-2 text-muted-foreground",children:["“",t.interestPrompt,"”"]}),h?(0,e.jsxs)(re,{to:`/issues/${t.generatingIssueId}`,onClick:s(v=>v.stopPropagation(),"onClick"),className:"mt-2 inline-flex items-center gap-1.5 font-medium text-foreground underline-offset-2 hover:underline",children:[(0,e.jsx)(Pe,{className:"h-3.5 w-3.5"}),"View setup task"]}):(0,e.jsxs)("button",{type:"button",onClick:ne(d),disabled:y,className:"mt-2 inline-flex items-center gap-1.5 font-medium text-foreground underline-offset-2 hover:underline disabled:opacity-60",children:[(0,e.jsx)(Je,{className:E("h-3.5 w-3.5",y&&"animate-pulse")}),y?"Starting…":"Run now"]})]}):null,a==="updating"?(0,e.jsx)("div",{className:"rounded-md bg-muted px-3 py-2 text-xs text-foreground",role:"status","aria-live":"polite",children:(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(_,{className:"h-3.5 w-3.5 shrink-0 animate-spin text-muted-foreground"}),(0,e.jsx)("span",{className:"min-w-0 flex-1 truncate",title:S.statusLine??void 0,children:S.statusLine??(t.pendingChangeCount>0?`Integrating ${t.pendingChangeCount} ${t.pendingChangeCount===1?"change":"changes"}…`:"Updating now…")}),t.generatingIssueId?(0,e.jsxs)(re,{to:Kt(t.generatingIssueId),onClick:s(v=>v.stopPropagation(),"onClick"),className:"inline-flex shrink-0 items-center gap-1 font-medium underline-offset-2 hover:underline",children:[(0,e.jsx)(Pe,{className:"h-3.5 w-3.5"}),"View update task"]}):null]})}):null,a==="stale"?(0,e.jsxs)("button",{type:"button",onClick:ne(m),disabled:l,className:"flex w-full items-center justify-between gap-2 rounded-md border border-amber-500/40 bg-amber-500/5 px-3 py-1.5 text-left text-xs text-foreground transition-colors hover:bg-amber-500/10 disabled:opacity-60",children:[(0,e.jsxs)("span",{children:[t.pendingChangeCount," ",t.pendingChangeCount===1?"change":"changes"," since last update"]}),(0,e.jsx)("span",{className:"shrink-0 font-medium text-amber-700 dark:text-amber-400",children:"Refresh"})]}):null,a==="error"?(0,e.jsxs)("div",{className:"flex items-center justify-between gap-2 rounded-md border border-destructive/40 bg-destructive/5 px-3 py-1.5 text-xs",children:[(0,e.jsxs)("span",{className:"flex items-center gap-1.5 text-destructive",children:[(0,e.jsx)(Te,{className:"h-3.5 w-3.5 shrink-0"}),"Last update failed"]}),(0,e.jsxs)("span",{className:"flex shrink-0 items-center gap-3",children:[(0,e.jsx)("button",{type:"button",onClick:ne(m),disabled:l,className:"font-medium text-destructive hover:underline disabled:opacity-60",children:"Retry"}),(0,e.jsx)("button",{type:"button",onClick:ne(r),className:"text-muted-foreground hover:underline",children:"Details"})]})]}):null,a==="paused_budget"||a==="paused_hours"?(0,e.jsxs)("div",{className:"flex items-center gap-2 rounded-md border border-orange-500/40 bg-orange-500/5 px-3 py-1.5 text-xs text-foreground",children:[(0,e.jsx)(Qt,{className:"h-3.5 w-3.5 shrink-0 text-orange-500"}),(0,e.jsx)("span",{children:a==="paused_budget"?"Daily token cap reached — auto-updates paused":"Outside active hours — auto-updates paused"})]}):null]}),(0,e.jsxs)("div",{className:"min-h-0 flex-1 overflow-hidden px-4 pt-2",children:[a==="error"&&t.summaryBody?(0,e.jsx)("p",{className:"mb-1 text-(length:--text-micro) text-muted-foreground",children:"Showing last good summary:"}):null,$?(0,e.jsx)(ee,{className:"text-xs leading-6 text-foreground [&_p]:my-0.5",children:t.summaryBody}):a==="compiling"?(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:"You can add instructions and pick an update policy while this runs."}):a==="updating"&&S.draft?(0,e.jsx)(ee,{className:"text-xs leading-6 text-foreground [&_p]:my-0.5",children:S.draft}):(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:"No summary yet."})]}),(0,e.jsxs)("div",{className:"mt-auto flex items-center justify-between gap-2 border-t border-border px-4 py-2.5",children:[(0,e.jsx)("span",{className:"truncate text-(length:--text-micro) text-muted-foreground",children:a==="compiling"?"setting up · first summary pending":(0,e.jsxs)(e.Fragment,{children:[H," · ",G,T?` · ${T}`:"",j?` · ${j}`:""]})}),a==="fresh"||a==="paused_budget"||a==="paused_hours"?(0,e.jsx)(q,{variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0 text-muted-foreground",onClick:ne(m),disabled:l,"aria-label":"Refresh card",children:(0,e.jsx)(Qe,{className:E("h-3.5 w-3.5",l&&"animate-spin")})}):null]})]})}s(hs,"StatusCardTile");function Ue(t){return t?new Date(t).toLocaleDateString(void 0,{month:"short",day:"numeric"}):"—"}s(Ue,"shortDate");function xs({card:t,onView:i,onRestore:r,restorePending:m}){const d=U({queryKey:N.statusCards.updates(t.id),queryFn:s(()=>C.updates(t.id),"queryFn")}),c=d.data?ns(d.data):null;return(0,e.jsxs)("div",{className:"flex items-center justify-between gap-4 rounded-lg border border-border bg-muted/30 px-4 py-3",children:[(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsx)("p",{className:"truncate text-sm font-semibold",children:t.title??"Untitled card"}),(0,e.jsxs)("p",{className:"mt-0.5 text-xs text-muted-foreground",title:t.archivedAt?he(t.archivedAt):void 0,children:["archived ",Ue(t.archivedAt)," · last summary ",Ue(t.lastGeneratedAt),c?` · lifetime ${z(c.totalTokens)} / ${W(c.totalCostCents)}`:""]})]}),(0,e.jsxs)("div",{className:"flex shrink-0 gap-2",children:[(0,e.jsx)(q,{size:"sm",onClick:i,children:"View"}),(0,e.jsxs)(q,{variant:"outline",size:"sm",onClick:r,disabled:m,children:[m?(0,e.jsx)(_,{className:"animate-spin"}):null,"Restore"]})]})]})}s(xs,"ArchivedStatusCardRow");function rt({companyId:t,value:i,onChange:r,enabled:m=!0}){const d=U({queryKey:t?N.agents.list(t):["agents","none"],queryFn:s(()=>Ut.list(t),"queryFn"),enabled:!!t&&m}),c=(0,g.useMemo)(()=>new Map((d.data??[]).map(l=>[l.id,l])),[d.data]),x=(0,g.useMemo)(()=>(d.data??[]).filter(Rt).map(l=>({id:`agent:${l.id}`,label:l.name,searchText:`${l.name} ${l.role} ${l.title??""}`})),[d.data]),f=s(l=>{if(!l||!l.id)return(0,e.jsx)("span",{children:"Summarizer (default)"});const y=l.id.startsWith("agent:")?c.get(l.id.slice(6)):null;return(0,e.jsxs)(e.Fragment,{children:[y?(0,e.jsx)(At,{agent:y,size:16,className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}):null,(0,e.jsx)("span",{className:"truncate",children:l.label})]})},"renderAgent");return(0,e.jsx)(bt,{value:i?`agent:${i}`:"",options:x,placeholder:"Summarizer (default)",noneLabel:"Summarizer (default)",searchPlaceholder:"Search agents...",emptyMessage:"No agents found.",onChange:s(l=>r(l.startsWith("agent:")?l.slice(6):""),"onChange"),className:"h-8 text-sm",renderTriggerValue:f,renderOption:s(l=>f(l),"renderOption")})}s(rt,"SummarizerAgentSelect");var ps=["issues about evals","everything blocked this week","is feature X live? if not, the exact next actions to ship it"];function gs({companyId:t,open:i,onOpenChange:r}){const m=Me(),[d,c]=(0,g.useState)(""),[x,f]=(0,g.useState)(""),[l,y]=(0,g.useState)(null);function a(){c(""),f(""),y(null)}s(a,"reset");function p(){r(!1),window.setTimeout(a,200)}s(p,"close");const h=L({mutationFn:s(()=>C.create(t,{interestPrompt:d.trim(),titlePinned:!1,agentId:x||null,refreshPolicy:et}),"mutationFn"),onMutate:s(()=>y(null),"onMutate"),onSuccess:s(async()=>{await Promise.all([m.invalidateQueries({queryKey:N.statusCards.list(t,!1)}),m.invalidateQueries({queryKey:N.statusCards.list(t,!0)})]),p()},"onSuccess"),onError:s(b=>y(F(b,{action:"create the card"}).body),"onError")});return(0,e.jsx)(zt,{open:i,onOpenChange:s(b=>b?r(!0):p(),"onOpenChange"),children:(0,e.jsxs)(Mt,{className:"sm:max-w-2xl",children:[(0,e.jsxs)(wt,{children:[(0,e.jsx)(_t,{children:"New card"}),(0,e.jsx)(Ht,{children:"One message sets up the whole card: say what you want to watch and what each update should tell you. The agent builds the query from it and writes every update against it."})]}),l?(0,e.jsx)(fe,{tone:"danger",title:"Create failed",children:l}):null,(0,e.jsxs)("div",{className:"space-y-3",children:[(0,e.jsx)("label",{htmlFor:"status-card-prompt",className:"block pb-1 text-sm font-semibold",children:"What do you want to keep an eye on?"}),(0,e.jsx)(Ge,{id:"status-card-prompt",value:d,onChange:s(b=>c(b.target.value),"onChange"),rows:5,autoFocus:!0,placeholder:"Keep an eye on the ID and Cloud projects. Tell me whether the service is live, and if not, the exact three actions needed to get it to production.",className:"text-sm"}),(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:"Examples"}),ps.map(b=>(0,e.jsx)("button",{type:"button",onClick:s(()=>c(b),"onClick"),className:"rounded-full border border-border px-3 py-1 text-xs text-muted-foreground transition-colors hover:bg-accent/40",children:b},b))]})]}),(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)("label",{className:"block text-sm font-semibold",children:"Agent"}),(0,e.jsx)(rt,{companyId:t,value:x,onChange:f,enabled:i}),(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:"Runs this card's setup and updates. Leave on the default unless another agent should own it."})]}),(0,e.jsx)(St,{children:(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsx)(q,{variant:"outline",onClick:p,disabled:h.isPending,children:"Cancel"}),(0,e.jsxs)(q,{onClick:s(()=>h.mutate(),"onClick"),disabled:d.trim().length===0||h.isPending,children:[h.isPending?(0,e.jsx)(_,{className:"animate-spin"}):null,"Create card"]})]})})]})})}s(gs,"CreateStatusCardDialog");function fs(){return{refreshPolicy:{mode:"manual",triggers:{statusTransitions:!0,membershipChanges:!0,humanComments:!0,assigneeChanges:!0,anyUpdate:!1}}}}s(fs,"defaultSettingsValue");var ys=[5,15,30,60],bs=[30,60,120,300],vs=[{key:"statusTransitions",label:"Became blocked / needs review / done / cancelled"},{key:"membershipChanges",label:"New issue matches the query · issue leaves the query"},{key:"humanComments",label:"Human comments"},{key:"assigneeChanges",label:"Assignee changes"},{key:"anyUpdate",label:"Any update at all (noisy — includes in-progress churn)",noisy:!0}];function Ce({selected:t,title:i,badge:r,onSelect:m,children:d}){return(0,e.jsxs)("div",{className:E("rounded-md border px-3 py-2.5 transition-colors",t?"border-primary bg-primary/5 ring-1 ring-primary":"border-border hover:bg-accent/40"),children:[(0,e.jsxs)("button",{type:"button",role:"radio","aria-checked":t,onClick:m,className:"flex w-full items-center gap-2 text-left",children:[(0,e.jsx)("span",{className:E("flex h-4 w-4 shrink-0 items-center justify-center rounded-full border",t?"border-primary":"border-muted-foreground/50"),children:t?(0,e.jsx)("span",{className:"h-2 w-2 rounded-full bg-primary"}):null}),(0,e.jsx)("span",{className:"text-sm font-medium",children:i}),r]}),t&&d?(0,e.jsx)("div",{className:"mt-2 pl-6",children:d}):null]})}s(Ce,"RadioRow");function js({value:t,onChange:i}){const{refreshPolicy:r}=t,m=r.mode!=="manual",d=us(r),c=s(a=>i({...t,refreshPolicy:{...r,...a}}),"setPolicy"),x=s(a=>{const p={mode:a};a==="interval"&&(p.intervalMinutes=r.intervalMinutes??15),a==="reactive"&&(p.debounceSeconds=r.debounceSeconds??60,p.maxUpdatesPerHour=r.maxUpdatesPerHour??6),c(p)},"setMode"),f=s(a=>c({triggers:{...r.triggers,[a]:!r.triggers[a]}}),"toggleTrigger"),l=r.activeHours,y=s(a=>c({activeHours:a?{start:l?.start??"08:00",end:l?.end??"19:00",timezone:l?.timezone??"UTC"}:void 0}),"setActiveHoursEnabled");return(0,e.jsxs)("div",{className:"space-y-6",children:[(0,e.jsxs)("section",{className:"space-y-2",children:[(0,e.jsx)("h3",{className:"text-sm font-semibold",children:"Auto-update policy"}),(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(Ce,{selected:r.mode==="manual",title:"Manual only — updates when I press refresh",badge:(0,e.jsx)("span",{className:"ml-auto rounded-full bg-muted px-2 py-0.5 text-(length:--text-nano) font-medium uppercase tracking-wide text-muted-foreground",children:"Default"}),onSelect:s(()=>x("manual"),"onSelect")}),(0,e.jsx)(Ce,{selected:r.mode==="interval",title:"On a schedule, only if something changed",onSelect:s(()=>x("interval"),"onSelect"),children:(0,e.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,e.jsx)("span",{children:"Check every"}),(0,e.jsxs)(ke,{value:String(r.intervalMinutes??15),onValueChange:s(a=>c({intervalMinutes:Number(a)}),"onValueChange"),children:[(0,e.jsx)(we,{size:"sm",className:"w-28","aria-label":"Check interval",children:(0,e.jsx)(Ie,{})}),(0,e.jsx)(Ae,{children:ys.map(a=>(0,e.jsxs)(xe,{value:String(a),children:[a," min"]},a))})]})]})}),(0,e.jsx)(Ce,{selected:r.mode==="reactive",title:"As soon as something changes (debounced)",onSelect:s(()=>x("reactive"),"onSelect"),children:(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm text-muted-foreground",children:[(0,e.jsx)("span",{children:"Wait"}),(0,e.jsxs)(ke,{value:String(r.debounceSeconds??60),onValueChange:s(a=>c({debounceSeconds:Number(a)}),"onValueChange"),children:[(0,e.jsx)(we,{size:"sm",className:"w-24","aria-label":"Debounce",children:(0,e.jsx)(Ie,{})}),(0,e.jsx)(Ae,{children:bs.map(a=>(0,e.jsxs)(xe,{value:String(a),children:[a,"s"]},a))})]}),(0,e.jsx)("span",{className:"text-xs",children:"after the last change · max"}),(0,e.jsx)(X,{type:"number",min:1,max:60,value:r.maxUpdatesPerHour??6,onChange:s(a=>c({maxUpdatesPerHour:Math.max(1,Number(a.target.value)||1)}),"onChange"),className:"h-8 w-16 text-sm","aria-label":"Max updates per hour"}),(0,e.jsx)("span",{className:"text-xs",children:"updates/hour"})]})})]})]}),m?(0,e.jsxs)(Ze,{className:"rounded-md border border-border",children:[(0,e.jsxs)(Ve,{className:"group flex w-full items-center justify-between gap-2 px-3 py-2.5 text-sm font-semibold",children:["Advanced",(0,e.jsx)(Ye,{className:"h-4 w-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]}),(0,e.jsxs)(Ke,{className:"space-y-6 border-t border-border px-3 py-3",children:[(0,e.jsxs)("section",{className:"space-y-2",children:[(0,e.jsx)("h3",{className:"text-sm font-semibold",children:"Count as a change"}),(0,e.jsx)("div",{className:"space-y-2",children:vs.map(a=>(0,e.jsxs)("label",{className:"flex items-start gap-2.5 text-sm",children:[(0,e.jsx)(De,{checked:r.triggers[a.key],onCheckedChange:s(()=>f(a.key),"onCheckedChange"),className:"mt-0.5","aria-label":a.label}),(0,e.jsx)("span",{className:E(a.noisy&&"text-muted-foreground"),children:a.label})]},a.key))})]}),(0,e.jsxs)("section",{className:"space-y-3",children:[(0,e.jsx)("h3",{className:"text-sm font-semibold",children:"Guardrails"}),(0,e.jsxs)("label",{className:"flex items-start gap-2.5 text-sm",children:[(0,e.jsx)(De,{checked:!!l,onCheckedChange:s(a=>y(!!a),"onCheckedChange"),className:"mt-0.5","aria-label":"Limit to active hours"}),(0,e.jsx)("span",{children:"Only auto-update during active hours"})]}),l?(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2 pl-6 text-sm",children:[(0,e.jsx)(X,{type:"time",value:l.start,onChange:s(a=>c({activeHours:{...l,start:a.target.value}}),"onChange"),className:"h-8 w-32","aria-label":"Active hours start"}),(0,e.jsx)("span",{className:"text-muted-foreground",children:"–"}),(0,e.jsx)(X,{type:"time",value:l.end,onChange:s(a=>c({activeHours:{...l,end:a.target.value}}),"onChange"),className:"h-8 w-32","aria-label":"Active hours end"}),(0,e.jsx)(X,{value:l.timezone,onChange:s(a=>c({activeHours:{...l,timezone:a.target.value}}),"onChange"),className:"h-8 w-40",placeholder:"Timezone","aria-label":"Active hours timezone"})]}):null,(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[(0,e.jsx)("span",{className:"w-32 shrink-0",children:"Daily token cap"}),(0,e.jsx)(X,{type:"number",min:0,step:1e3,value:r.dailyTokenCap??"",onChange:s(a=>{const p=Number(a.target.value);c({dailyTokenCap:a.target.value===""||p<=0?void 0:p})},"onChange"),className:"h-8 w-36",placeholder:"no cap","aria-label":"Daily token cap"})]})]})]})]}):null,(0,e.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,e.jsx)("span",{className:"font-semibold",children:"Estimated cost"}),(0,e.jsx)("span",{className:"text-muted-foreground",children:"="}),(0,e.jsxs)(Ot,{children:[(0,e.jsx)(Vt,{asChild:!0,children:(0,e.jsx)("span",{className:"cursor-default font-medium text-foreground underline decoration-dotted decoration-muted-foreground/50 underline-offset-4",children:d.cost})}),(0,e.jsxs)(Gt,{className:"max-w-(--sz-18rem) text-left",children:[(0,e.jsx)("p",{children:d.primary}),d.note?(0,e.jsx)("p",{className:"mt-1 opacity-80",children:d.note}):null,(0,e.jsx)("p",{className:"mt-1 opacity-80",children:"Rough estimate from typical update sizes; actual cost is tracked per update."})]})]})]})]})}s(js,"StatusCardSettingsForm");function Ns({card:t,companyId:i,open:r,onOpenChange:m,initialTab:d="summary"}){const c=Me(),[x,f]=(0,g.useState)("summary"),[l,y]=(0,g.useState)(fs()),[a,p]=(0,g.useState)(""),[h,b]=(0,g.useState)(""),[S,G]=(0,g.useState)(""),[T,j]=(0,g.useState)(null),[H,$]=(0,g.useState)(null),[v,O]=(0,g.useState)(null);(0,g.useEffect)(()=>{t&&(y({refreshPolicy:t.refreshPolicy}),p(t.title??""),b(t.interestPrompt),G(t.agentId??""),j(null),$(null),O(null))},[t]),(0,g.useEffect)(()=>{r&&f(d)},[r,d]);const K=U({queryKey:t?N.statusCards.updates(t.id):["status-cards","detail","none","updates"],queryFn:s(()=>C.updates(t.id),"queryFn"),enabled:!!(t&&r)}),se=Ee(K),be=U({queryKey:t?N.statusCards.summaryRevisions(t.id):["status-cards","detail","none","summary-revisions"],queryFn:s(()=>C.summaryRevisions(t.id),"queryFn"),enabled:!!(t&&r&&t.documentId)}),D=U({queryKey:t?N.statusCards.dryRun(t.id):["status-cards","detail","none","dry-run"],queryFn:s(()=>C.dryRun(t.id),"queryFn"),enabled:!!(t&&r&&x==="watched"&&(t.queries.length>0||(t.mentionedIssueIds?.length??0)>0))}),M=Ee(D),A=t?st(t):"fresh",Y=(0,g.useMemo)(()=>t&&A==="updating"&&t.generatingIssueId?{id:t.generatingIssueId,identifier:null,title:t.title??"Status update",status:"in_progress"}:null,[t,A]),ie=Xe(i,Y),u=s(async()=>{t&&await Promise.all([c.invalidateQueries({queryKey:N.statusCards.list(t.companyId,!1)}),c.invalidateQueries({queryKey:N.statusCards.detail(t.id)})])},"invalidateCard"),B=L({mutationFn:s(()=>C.refresh(t.id),"mutationFn"),onMutate:s(()=>{j(null),$(null)},"onMutate"),onSuccess:s(async()=>{await u(),$("Refresh queued — the Summarizer is updating this card.")},"onSuccess"),onError:s(o=>j(F(o,{action:"refresh the card"}).body),"onError")}),le=L({mutationFn:s(()=>C.recompile(t.id),"mutationFn"),onMutate:s(()=>{j(null),$(null)},"onMutate"),onSuccess:s(async()=>{await u(),$("Run queued — the Summarizer is updating this card.")},"onSuccess"),onError:s(o=>j(F(o,{action:"run the card"}).body),"onError")}),ve=L({mutationFn:s(()=>{const o=a.trim(),je=h.trim(),ot=je.length>0&&je!==t.interestPrompt.trim();return C.patch(t.id,{title:o||null,titlePinned:o.length>0,...ot?{interestPrompt:je}:{},agentId:S||null,refreshPolicy:l.refreshPolicy})},"mutationFn"),onMutate:s(()=>j(null),"onMutate"),onSuccess:s(async()=>{t&&await Promise.all([c.invalidateQueries({queryKey:N.statusCards.list(t.companyId,!1)}),c.invalidateQueries({queryKey:N.statusCards.detail(t.id)})])},"onSuccess"),onError:s(o=>j(F(o,{action:"save the settings"}).body),"onError")});if(!t)return null;const ae=K.data??[],it=ae[0]??null,oe=rs(ae),Q=ae.filter(o=>o.status==="ok"&&o.finishedAt&&(o.kind==="full"||o.kind==="incremental")),I=v?Q.find(o=>o.id===v)??null:null,lt=be.data??[],Re=I?lt[Q.indexOf(I)]?.body??null:null,de=Q.length,_e=s(o=>de-Q.indexOf(o),"revisionNumberOf"),ue=I?I.changes:it?.changes??[],qe=at[A],$e=!!(t.summaryBody&&t.summaryBody.trim().length>0),J=A==="compiling"&&!!t.generatingIssueId;return(0,e.jsx)(Ct,{open:r,onOpenChange:m,children:(0,e.jsxs)(Dt,{className:"flex w-full flex-col gap-0 p-0 sm:max-w-2xl",children:[(0,e.jsxs)(kt,{className:"border-b border-border p-4",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 pr-8",children:[(0,e.jsx)("span",{className:E("inline-block h-2.5 w-2.5 shrink-0 rounded-full",qe.dotClassName),"aria-hidden":"true"}),(0,e.jsx)(jt,{className:"min-w-0 flex-1 truncate text-lg",children:t.title??"Untitled card"}),(0,e.jsx)(pe,{variant:"outline",children:qe.label}),A==="compiling"?(0,e.jsxs)(q,{variant:"outline",size:"sm",onClick:s(()=>le.mutate(),"onClick"),disabled:le.isPending||J,children:[J||le.isPending?(0,e.jsx)(_,{className:"h-3.5 w-3.5 animate-spin"}):(0,e.jsx)(Je,{className:"h-3.5 w-3.5"}),J?"Setting up…":le.isPending?"Running…":"Run now"]}):(0,e.jsxs)(q,{variant:"outline",size:"sm",onClick:s(()=>B.mutate(),"onClick"),disabled:B.isPending||A==="updating",children:[(0,e.jsx)(Qe,{className:E("h-3.5 w-3.5",B.isPending&&"animate-spin")}),B.isPending?"Refreshing…":"Refresh"]})]}),(0,e.jsxs)("p",{className:"text-xs text-muted-foreground",children:[t.lastGeneratedAt?`Updated ${V(t.lastGeneratedAt)}`:"No summary yet"," ·"," ",nt(t.refreshPolicy)]})]}),(0,e.jsxs)(Et,{value:x,onValueChange:f,className:"flex min-h-0 flex-1 flex-col gap-0",children:[(0,e.jsxs)(Pt,{variant:"line",className:"w-full justify-start gap-4 border-b border-border px-4",children:[(0,e.jsx)(me,{value:"summary",children:"Summary"}),(0,e.jsx)(me,{value:"settings",children:"Settings"}),(0,e.jsx)(me,{value:"watched",children:"Watched issues"}),(0,e.jsx)(me,{value:"history",children:"History"})]}),T?(0,e.jsx)("div",{className:"px-4 pt-3",children:(0,e.jsx)(fe,{tone:"warning",title:"Heads up",children:T})}):H?(0,e.jsx)("div",{className:"px-4 pt-3",children:(0,e.jsx)(fe,{tone:"info",title:"Working on it",children:H})}):null,(0,e.jsxs)("div",{className:"min-h-0 flex-1 overflow-y-auto p-4",children:[(0,e.jsxs)(ce,{value:"summary",className:"mt-0 space-y-5",children:[($e||Q.length>0)&&A!=="compiling"?(0,e.jsx)("div",{className:"flex items-center justify-end gap-2",children:Q.length>1?(0,e.jsxs)(ke,{value:v??"__latest__",onValueChange:s(o=>O(o==="__latest__"?null:o),"onValueChange"),children:[(0,e.jsxs)(we,{size:"sm",className:"w-auto gap-1.5","aria-label":"Select summary revision",children:[(0,e.jsx)(mt,{className:"h-3.5 w-3.5","aria-hidden":"true"}),(0,e.jsx)(Ie,{})]}),(0,e.jsxs)(Ae,{align:"end",position:"popper",children:[(0,e.jsxs)(xe,{value:"__latest__",className:"text-xs",children:["Revision ",de," · latest"]}),(0,e.jsx)(gt,{}),Q.slice(0,30).map(o=>(0,e.jsxs)(xe,{value:o.id,className:"text-xs",title:he(o.startedAt),children:["Rev ",_e(o)," · ",Ne(o.kind)," · ",V(o.startedAt)]},o.id))]})]}):de>0?(0,e.jsxs)("span",{className:"text-xs text-muted-foreground",children:["Revision ",de," · latest"]}):null}):null,A==="updating"&&ie.draft&&!I?(0,e.jsx)(ee,{className:"text-sm leading-7",children:ie.draft}):I?(0,e.jsxs)("div",{className:"space-y-2 rounded-md border border-border bg-muted/30 p-3",children:[(0,e.jsxs)("p",{className:"text-xs text-muted-foreground",title:he(I.startedAt),children:["Revision ",_e(I)," · ",Ne(I.kind)," ·"," ",V(I.startedAt)]}),Re?(0,e.jsx)(ee,{className:"text-sm leading-7",children:Re}):I.changeSummary?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(ee,{className:"text-sm leading-7",children:I.changeSummary}),(0,e.jsx)("p",{className:"text-xs text-muted-foreground/70",children:"The full summary text for this revision is unavailable — showing its change summary. The integrated changes below are the live ledger for this revision."})]}):(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"No change summary was recorded for this revision."})]}):$e?(0,e.jsx)(ee,{className:"text-sm leading-7",children:t.summaryBody}):A==="compiling"?(0,e.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,e.jsxs)("p",{className:"flex items-center gap-2",children:[J?(0,e.jsx)(_,{className:"h-4 w-4 shrink-0 animate-spin"}):(0,e.jsx)(Te,{className:"h-4 w-4 shrink-0 text-amber-500"}),J?"Setting up — the first summary is generated automatically once this finishes.":"Setup didn’t finish. Run it now to try again."]}),J&&t.generatingIssueId?(0,e.jsxs)(re,{to:`/issues/${t.generatingIssueId}`,className:"inline-flex items-center gap-1.5 text-xs font-medium text-foreground underline-offset-2 hover:underline",children:[(0,e.jsx)(Pe,{className:"h-3.5 w-3.5"}),"View setup task"]}):null]}):(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"No summary yet — the first one is generated automatically once this card finishes setting up."}),ue.length>0?(0,e.jsxs)("section",{className:"space-y-2",children:[(0,e.jsxs)("h3",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:[I?"Integrated in this revision":"Integrated in this update"," (",ue.length," ",ue.length===1?"change":"changes",")"]}),(0,e.jsx)("div",{className:"space-y-1.5",children:ue.map(o=>(0,e.jsx)(ws,{change:o},o.issueId))})]}):null]}),(0,e.jsx)(ce,{value:"history",className:"mt-0 space-y-3",children:K.isLoading||se.kind==="reconnecting"?(0,e.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,e.jsx)(_,{className:"h-4 w-4 animate-spin"})," Loading history…"]}):ae.length===0?(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"No updates recorded yet."}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"text-xs text-muted-foreground",children:["Today: ",oe.updateCount," ",oe.updateCount===1?"update":"updates"," ·"," ",z(oe.totalTokens)," · ",W(oe.totalCostCents),t.refreshPolicy.dailyTokenCap?` · daily cap ${z(t.refreshPolicy.dailyTokenCap)}`:""]}),(0,e.jsx)("div",{className:"divide-y divide-border",children:ae.map(o=>(0,e.jsxs)("div",{className:"py-2.5 first:pt-1",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,e.jsxs)("span",{className:"flex items-center gap-2 text-sm font-medium",children:[Ne(o.kind),(0,e.jsx)(pe,{variant:o.status==="failed"?"destructive":"secondary",children:o.status==="ok"?o.trigger:o.status})]}),(0,e.jsx)("span",{className:"text-xs text-muted-foreground",title:he(o.startedAt),children:V(o.startedAt)})]}),(0,e.jsxs)("p",{className:"mt-1 text-xs text-muted-foreground",children:[cs(o.inputTokens,o.outputTokens)," · ",W(o.costCents),o.model?` · ${o.model}`:"",o.changes.length>0?` · ${o.changes.length} changes`:""]}),o.error?(0,e.jsx)("p",{className:"mt-1 text-xs text-destructive",children:o.error}):null]},o.id))})]})}),(0,e.jsx)(ce,{value:"watched",className:"mt-0 space-y-3",children:t.queries.length===0&&(t.mentionedIssueIds?.length??0)===0?(0,e.jsx)("div",{className:"rounded-md border border-dashed border-border px-3 py-4 text-sm text-muted-foreground",children:"This card is still setting up — the issues it watches appear here once it's ready."}):D.isLoading||M.kind==="reconnecting"?(0,e.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,e.jsx)(_,{className:"h-4 w-4 animate-spin"})," Matching issues…"]}):M.kind==="error"?(0,e.jsx)(We,{error:M.error,action:"load matched issues",onRetry:M.retry,retrying:M.isFetching}):(0,e.jsx)(Ss,{queries:D.data?.queries??[],mentioned:D.data?.mentionedIssues??[]})}),(0,e.jsxs)(ce,{value:"settings",className:"mt-0 space-y-6",children:[(0,e.jsxs)("section",{className:"space-y-2",children:[(0,e.jsx)("h3",{className:"text-sm font-semibold",children:"Card name"}),(0,e.jsx)(X,{value:a,onChange:s(o=>p(o.target.value),"onChange"),placeholder:"Auto-named from the query",className:"text-sm","aria-label":"Card name"})]}),(0,e.jsxs)("section",{className:"space-y-2",children:[(0,e.jsx)("h3",{className:"text-sm font-semibold",children:"What this card watches & reports"}),(0,e.jsx)(Ge,{value:h,onChange:s(o=>b(o.target.value),"onChange"),rows:3,className:"text-sm","aria-label":"What this card watches & reports"}),(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:"This one message drives the whole card: the agent compiles the watch query from it and follows it as the instructions for every update. Editing it rebuilds the card."})]}),(0,e.jsxs)("section",{className:"space-y-2",children:[(0,e.jsx)("h3",{className:"text-sm font-semibold",children:"Agent"}),(0,e.jsx)(rt,{companyId:t.companyId,value:S,onChange:G,enabled:r})]}),(0,e.jsx)(js,{value:l,onChange:y}),(0,e.jsx)(Cs,{card:t}),(0,e.jsx)("div",{className:"flex justify-end border-t border-border pt-4",children:(0,e.jsxs)(q,{onClick:s(()=>ve.mutate(),"onClick"),disabled:ve.isPending,children:[ve.isPending?(0,e.jsx)(_,{className:"animate-spin"}):null,"Save"]})})]})]})]})]})})}s(Ns,"StatusCardDetailDrawer");function Cs({card:t}){const i=JSON.stringify({queries:t.queries,limit:50},null,2);return(0,e.jsxs)(Ze,{className:"rounded-md border border-border",children:[(0,e.jsxs)(Ve,{className:"group flex w-full items-center justify-between gap-2 px-3 py-2.5 text-sm font-semibold",children:[(0,e.jsxs)("span",{className:"flex items-center gap-2",children:["Query debug",(0,e.jsxs)(pe,{variant:"secondary",children:["v",t.queryVersion]})]}),(0,e.jsx)(Ye,{className:"h-4 w-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]}),(0,e.jsxs)(Ke,{className:"space-y-2 border-t border-border px-3 py-3",children:[(0,e.jsx)("pre",{className:E("max-h-64 overflow-auto rounded-md bg-muted p-3 font-mono text-xs text-foreground",ct),children:t.queries.length>0?i:"// query not compiled yet"}),(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:t.queryCompiledAt?`Compiled by Summarizer ${V(t.queryCompiledAt)} · version ${t.queryVersion}. Edit “What this card watches” above to rebuild it.`:"Not compiled yet. The query builds automatically once the card finishes setting up."})]})]})}s(Cs,"QueryDebugSection");function Ss({queries:t,mentioned:i}){const r=new Set,m=[];for(const{result:c}of t)for(const x of c.results)!x.issue||r.has(x.issue.id)||(r.add(x.issue.id),m.push(x.issue));const d=i.filter(c=>!r.has(c.id));return m.length===0&&d.length===0?(0,e.jsx)("div",{className:"rounded-md border border-dashed border-border px-3 py-4 text-sm text-muted-foreground",children:"The compiled query matches no issues right now."}):(0,e.jsxs)("div",{className:"space-y-3",children:[m.length>0?(0,e.jsx)("div",{className:"space-y-1.5",children:m.map(c=>(0,e.jsx)(ze,{issue:c},c.id))}):null,d.length>0?(0,e.jsxs)("div",{className:"space-y-1.5",children:[(0,e.jsx)("p",{className:"text-xs font-medium text-muted-foreground",children:"Mentioned in the latest update"}),d.map(c=>(0,e.jsx)(ze,{issue:c},c.id))]}):null]})}s(Ss,"MatchedIssueList");function ze({issue:t}){return(0,e.jsxs)("div",{className:"flex items-center gap-2 rounded-md border border-border px-3 py-2 text-xs",children:[(0,e.jsx)(re,{to:`/issues/${t.identifier??t.id}`,className:"shrink-0 font-medium text-muted-foreground underline-offset-2 hover:text-foreground hover:underline",children:t.identifier??t.id.slice(0,8)}),(0,e.jsx)(Se,{...yt(t)}),(0,e.jsx)("span",{className:"min-w-0 flex-1 truncate",children:t.title}),(0,e.jsx)("span",{className:"shrink-0 text-muted-foreground",children:V(t.updatedAt)})]})}s(ze,"WatchedIssueRow");function ws({change:t}){const i=!!(t.from&&t.to);return(0,e.jsxs)("div",{className:"flex items-center gap-2 rounded-md border border-border px-3 py-2 text-xs",children:[(0,e.jsx)(re,{to:`/issues/${t.identifier}`,className:"shrink-0 font-medium text-muted-foreground underline-offset-2 hover:text-foreground hover:underline",children:t.identifier}),i?(0,e.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,e.jsx)(Se,{status:t.from}),(0,e.jsx)("span",{"aria-hidden":"true",className:"text-muted-foreground",children:"→"}),(0,e.jsx)(Se,{status:t.to})]}):(0,e.jsx)("span",{className:"truncate text-muted-foreground",children:ks(t.changeKind)})]})}s(ws,"ChangeRow");function ks(t){return t==="entered_query"||t==="new"?"new issue matched the query":t==="left_query"?"left the query":t.replace(/_/g," ")}s(ks,"describeChangeKind");function zs(){const{selectedCompanyId:t}=pt(),{setBreadcrumbs:i}=Tt(),r=vt(),m=Me(),{cardId:d}=Nt(),[c,x]=(0,g.useState)(!1),[f,l]=(0,g.useState)(!1),[y,a]=(0,g.useState)("summary"),[p,h]=(0,g.useState)(null);(0,g.useEffect)(()=>{i([{label:"Status"}])},[i]);const b=U({queryKey:t?N.statusCards.list(t,!1):["status-cards","none","active"],queryFn:s(()=>C.list(t,!1),"queryFn"),enabled:!!t}),S=Ee(b),G=U({queryKey:t?N.statusCards.list(t,!0):["status-cards","none","archived"],queryFn:s(()=>C.list(t,!0),"queryFn"),enabled:!!t}),T=b.data??[],j=G.data??[],H=(0,g.useMemo)(()=>[...T,...j].find(u=>u.id===d)??null,[T,j,d]),$=U({queryKey:d?N.statusCards.detail(d):["status-cards","detail","none"],queryFn:s(()=>C.get(d),"queryFn"),enabled:!!d&&!H}),v=H??$.data??null,O=s(()=>t?Promise.all([m.invalidateQueries({queryKey:N.statusCards.list(t,!1)}),m.invalidateQueries({queryKey:N.statusCards.list(t,!0)})]):Promise.resolve(),"invalidateLists"),K=L({mutationFn:s(u=>C.refresh(u),"mutationFn"),onMutate:s(()=>h(null),"onMutate"),onSuccess:s(()=>O(),"onSuccess"),onError:s(u=>h(F(u,{action:"refresh the card"}).body),"onError")}),se=L({mutationFn:s(u=>C.recompile(u),"mutationFn"),onMutate:s(()=>h(null),"onMutate"),onSuccess:s(()=>O(),"onSuccess"),onError:s(u=>h(F(u,{action:"run the card"}).body),"onError")}),be=L({mutationFn:s(u=>C.patch(u,{archived:!0}),"mutationFn"),onMutate:s(()=>h(null),"onMutate"),onSuccess:s(()=>O(),"onSuccess"),onError:s(u=>h(F(u,{action:"archive the card"}).body),"onError")}),D=L({mutationFn:s(u=>C.patch(u,{archived:!1}),"mutationFn"),onMutate:s(()=>h(null),"onMutate"),onSuccess:s(()=>O(),"onSuccess"),onError:s(u=>h(F(u,{action:"restore the card"}).body),"onError")}),M=s((u,B="summary")=>{a(B),r(`/status/${u}`)},"openDetail"),A=s(()=>r("/status"),"closeDetail"),Y=T.reduce((u,B)=>({tokens:u.tokens+(B.todayTokens??0),cents:u.cents+(B.todayCostCents??0)}),{tokens:0,cents:0}),ie=Y.tokens>0||Y.cents>0;return(0,e.jsxs)("div",{className:"mx-auto max-w-6xl space-y-5",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)("h1",{className:"text-xl font-bold",children:"Status"}),(0,e.jsxs)(pe,{variant:"secondary",className:"gap-1",children:[(0,e.jsx)(Be,{className:"h-3 w-3"}),"Experimental"]})]}),(0,e.jsxs)("div",{className:"flex items-center gap-4",children:[ie?(0,e.jsxs)("span",{className:"text-xs text-muted-foreground",children:["Today: ",z(Y.tokens)," · ~",W(Y.cents)]}):null,(0,e.jsxs)(q,{onClick:s(()=>l(!0),"onClick"),disabled:!t,children:[(0,e.jsx)(Ft,{className:"h-4 w-4"}),"New card"]})]})]}),p?(0,e.jsx)(fe,{tone:"warning",title:"Heads up",children:p}):null,S.kind==="loading"||S.kind==="reconnecting"?(0,e.jsxs)("div",{className:"flex items-center gap-2 py-12 text-sm text-muted-foreground",children:[(0,e.jsx)(_,{className:"h-4 w-4 animate-spin"})," Loading cards…"]}):S.kind==="error"?(0,e.jsx)(We,{error:S.error,action:"load status cards",onRetry:S.retry,retrying:S.isFetching}):T.length===0?(0,e.jsx)(Bt,{icon:Be,title:"No status cards yet",message:"Create a card to keep a living summary of the issues you care about.",action:t?"New card":void 0,onAction:s(()=>l(!0),"onAction")}):(0,e.jsx)("div",{className:"grid gap-4 sm:grid-cols-2",children:T.map(u=>(0,e.jsx)(hs,{card:u,companyId:t,onOpen:s(()=>M(u.id),"onOpen"),onRefresh:s(()=>K.mutate(u.id),"onRefresh"),onRecompile:s(()=>se.mutate(u.id),"onRecompile"),onEditInterest:s(()=>M(u.id,"settings"),"onEditInterest"),onOpenDebug:s(()=>M(u.id,"settings"),"onOpenDebug"),onArchive:s(()=>be.mutate(u.id),"onArchive"),refreshPending:K.isPending&&K.variables===u.id,recompilePending:se.isPending&&se.variables===u.id},u.id))}),j.length>0?(0,e.jsxs)("div",{className:"space-y-3 pt-2",children:[(0,e.jsx)("button",{type:"button",onClick:s(()=>x(u=>!u),"onClick"),className:"text-xs text-muted-foreground underline-offset-2 hover:text-foreground hover:underline",children:c?"Hide archived":`Show archived (${j.length})`}),c?j.map(u=>(0,e.jsx)(xs,{card:u,onView:s(()=>M(u.id),"onView"),onRestore:s(()=>D.mutate(u.id),"onRestore"),restorePending:D.isPending&&D.variables===u.id},u.id)):null]}):null,t?(0,e.jsx)(gs,{companyId:t,open:f,onOpenChange:l}):null,(0,e.jsx)(Ns,{card:v,companyId:t,open:!!d,onOpenChange:s(u=>u?void 0:A(),"onOpenChange"),initialTab:y})]})}s(zs,"StatusCards");export{zs as StatusCards,zs as default};
1
+ var dt=Object.defineProperty;var s=(t,i)=>dt(t,"name",{value:i,configurable:!0});import{a as He}from"./rolldown-runtime-DhZMWcEn.js";import{t as Oe}from"./search-CG-QtPVH.js";import{y as Se}from"./collections-B58p51lw.js";import{$A as ut,$S as ct,$T as re,Ai as ce,Ap as xe,BA as n,BC as mt,B_ as Ke,EA as te,Ev as ht,FA as w,GS as N,HC as Qe,H_ as pe,IA as k,Kw as Be,LA as xt,LS as pt,ME as Me,Mi as me,Mp as gt,NE as q,Np as we,OA as ge,Op as ke,Pp as Ie,RA as ft,Sp as De,TA as Le,Up as yt,V_ as Ve,Vm as bt,WE as he,Yb as vt,_ as jt,__ as X,_v as Z,_w as _,aE as Nt,ab as We,bE as L,d as Ct,dy as St,fy as wt,g as kt,g_ as Ge,hC as Te,hE as F,hv as It,iD as V,ib as Tt,jT as Ye,jb as At,ji as Pt,kA as P,ki as Et,kp as Ae,ly as Mt,m_ as Rt,my as _t,nT as qt,nj as $t,oC as Je,on as Bt,p as Dt,pm as fe,pv as Lt,qC as Ft,rb as Ut,sy as zt,tT as Pe,uE as R,ub as Ee,uy as Ht,vb as Ot,x as ee,xE as U,xS as Kt,xT as Qt,xb as Vt,xv as Wt,yb as Gt,zE as E,z_ as Ze}from"./index-BJtnP7H1.js";import{t as Xe}from"./useSummaryDraftStream-NVNYNt72.js";function Yt(t){try{return new Intl.DateTimeFormat("en",{timeZone:t}).format(),!0}catch{return!1}}s(Yt,"isValidTimeZone");var Jt=te(["compiling","active","error","paused_budget","paused_hours"]),Zt=te(["compile","full","incremental"]),Xt=te(["manual","interval","reactive","restore"]),es=te(["running","ok","failed"]),ts=k({statusTransitions:P().default(!0),membershipChanges:P().default(!0),humanComments:P().default(!0),assigneeChanges:P().default(!0),anyUpdate:P().default(!1)}),ye=k({mode:te(["manual","interval","reactive"]).default("manual"),intervalMinutes:w().int().positive().optional(),debounceSeconds:w().int().positive().optional(),maxUpdatesPerHour:w().int().positive().optional(),triggers:ts.prefault({}),activeHours:k({start:n().regex(/^([01]\d|2[0-3]):[0-5]\d$/),end:n().regex(/^([01]\d|2[0-3]):[0-5]\d$/),timezone:n().trim().min(1).refine(Yt,{message:"Invalid timezone identifier"})}).optional(),dailyTokenCap:w().int().positive().optional()}).superRefine((t,i)=>{t.mode==="interval"&&t.intervalMinutes===void 0&&i.addIssue({code:Le.custom,path:["intervalMinutes"],message:"Required for interval mode"}),t.mode==="reactive"&&t.debounceSeconds===void 0&&i.addIssue({code:Le.custom,path:["debounceSeconds"],message:"Required for reactive mode"})}),et=ye.parse({mode:"manual"}),ss=ft(n(),k({status:n(),updatedAt:n().datetime(),latestHumanCommentAt:n().datetime().nullable().optional(),identifier:n().nullable().optional(),title:n().optional(),assigneeAgentId:n().guid().nullable().optional(),assigneeUserId:n().nullable().optional()})),Rs=k({id:n().guid(),companyId:n().guid(),createdByUserId:n().nullable(),createdByAgentId:n().guid().nullable(),title:n().nullable(),titlePinned:P(),interestPrompt:n(),queries:ge(Oe),queryVersion:w().int().nonnegative(),queryCompiledAt:n().datetime().nullable(),queryCompiledByAgentId:n().guid().nullable(),agentId:n().guid().nullable(),refreshPolicy:ye,state:Jt,pendingChangeCount:w().int().nonnegative(),lastChangeAt:n().datetime().nullable(),fingerprint:ss.nullable(),fingerprintAt:n().datetime().nullable(),mentionedIssueIds:ge(n().guid()).default([]),documentId:n().guid().nullable(),lastUpdateRunKind:te(["full","incremental"]).nullable(),lastGeneratedAt:n().datetime().nullable(),lastModel:n().nullable(),generatingIssueId:n().guid().nullable(),failureReason:n().nullable(),nextEvalAt:n().datetime().nullable(),archivedAt:n().datetime().nullable(),archivedByUserId:n().nullable(),archivedByAgentId:n().guid().nullable(),createdAt:n().datetime(),updatedAt:n().datetime(),summaryBody:n().nullable().optional(),watchedIssueCount:w().int().nonnegative().optional(),todayTokens:w().int().nonnegative().optional(),todayCostCents:w().nonnegative().optional(),href:n().optional()}),as=k({issueId:n().guid(),identifier:n(),from:n().nullable(),to:n().nullable(),changeKind:n()}),_s=k({id:n().guid(),cardId:n().guid(),kind:Zt,trigger:Xt,generationIssueId:n().guid().nullable(),runId:n().guid().nullable(),changes:ge(as),inputTokens:w().int().nonnegative(),outputTokens:w().int().nonnegative(),costCents:w().nonnegative(),model:n().nullable(),queryVersion:w().int().nonnegative().nullable(),changeSummary:n().nullable(),startedAt:n().datetime(),finishedAt:n().datetime().nullable(),status:es,error:n().nullable()}),qs=k({id:n().guid(),revisionNumber:w().int().positive(),title:n().nullable(),body:n(),changeSummary:n().nullable(),createdAt:n().datetime()}),$s=k({archived:xt(t=>t==="true"?!0:t==="false"?!1:t,P().default(!1))}),Bs=k({interestPrompt:n().trim().min(1).max(2e4),title:n().trim().min(1).max(300).optional(),titlePinned:P().default(!1),agentId:n().guid().nullable().optional(),refreshPolicy:ye.default(et)}),Ds=k({interestPrompt:n().trim().min(1).max(2e4).optional(),title:n().trim().min(1).max(300).nullable().optional(),titlePinned:P().optional(),agentId:n().guid().nullable().optional(),refreshPolicy:ye.optional(),archived:P().optional()}).refine(t=>Object.keys(t).length>0,"At least one field is required"),Ls=k({full:P().default(!1)}),Fs=k({queries:ge(Oe).min(1).max(10),title:n().trim().min(1).max(300),changeSummary:n().trim().min(1).max(2e3),generationIssueId:n().guid()}),Us=k({markdown:n().trim().min(1).max(2e5),title:n().trim().min(1).max(300).optional(),changeSummary:n().trim().min(1).max(2e3),generationIssueId:n().guid(),model:n().trim().min(1).max(200).optional().nullable()}),g=He($t(),1),C={list:s((t,i=!1)=>R.get(`/companies/${t}/status-cards?archived=${i?"true":"false"}`),"list"),get:s(t=>R.get(`/status-cards/${t}`),"get"),create:s((t,i)=>R.post(`/companies/${t}/status-cards`,i),"create"),patch:s((t,i)=>R.patch(`/status-cards/${t}`,i),"patch"),remove:s(t=>R.delete(`/status-cards/${t}`),"remove"),updates:s(t=>R.get(`/status-cards/${t}/updates`),"updates"),summaryRevisions:s(t=>R.get(`/status-cards/${t}/summary-revisions`),"summaryRevisions"),refresh:s(t=>R.post(`/status-cards/${t}/refresh`,{}),"refresh"),recompile:s(t=>R.post(`/status-cards/${t}/recompile`,{}),"recompile"),dryRun:s(t=>R.get(`/status-cards/${t}/dry-run`),"dryRun")};function z(t){return t==null?null:t<1e3?`${t} tok`:`${(t/1e3).toFixed(1)}k tok`}s(z,"formatTokens");function W(t){if(t==null)return null;const i=t/100;return i===0?"$0.00":i<.1?`$${i.toFixed(3)}`:`$${i.toFixed(2)}`}s(W,"formatCents");function tt(t){return t.reduce((i,r)=>({updateCount:i.updateCount+(r.kind==="compile"?0:1),totalTokens:i.totalTokens+r.inputTokens+r.outputTokens,totalCostCents:i.totalCostCents+r.costCents}),{updateCount:0,totalTokens:0,totalCostCents:0})}s(tt,"accumulate");function ns(t){return tt(t)}s(ns,"rollupUpdates");function rs(t,i=new Date){const r=new Date(i);r.setUTCHours(0,0,0,0);const m=r.getTime();return tt(t.filter(d=>new Date(d.startedAt).getTime()>=m))}s(rs,"rollupUpdatesToday");var is=4500,ls=3,Fe=2e3,os=1;function ds(t){const i=t.activeHours;if(!i)return 1440;const[r,m]=i.start.split(":").map(Number),[d,c]=i.end.split(":").map(Number),x=r*60+m,f=d*60+c,l=f>x?f-x:1440-(x-f);return l>0?l:1440}s(ds,"activeWindowMinutes");function us(t){if(t.mode==="manual"){const h=`${W(ls)} · ${z(is)}`;return{cost:h,primary:`~1 rebuild per refresh ≈ ${h}`,note:"Manual cards only cost tokens when you press Refresh."}}const i=ds(t);let r,m;if(t.mode==="interval"){const h=t.intervalMinutes??15;r=Math.floor(i/h),m=`every ${h} min`}else{const h=t.maxUpdatesPerHour??6;r=Math.round(i/60*h),m=`up to ${h}/hour`}const d=t.dailyTokenCap??null,c=d!==null?Math.floor(d/Fe):1/0,x=Math.max(0,Math.min(r,c)),f=d!==null&&c<r,l=x*Fe,y=x*os,a=t.activeHours?" during active hours":"",p=`${W(y)} · ${z(l)}`;return{cost:p,primary:`Up to ~${x} updates/day (${m}${a}) ≈ ${p}`,note:f?`Capped by your ${z(d)} daily token cap — the card pauses when it's hit.`:"Only runs when something changed; a cheap no-op check otherwise."}}s(us,"estimateStatusCardCost");function cs(t,i){const r=s(m=>m<1e3?`${m}`:`${(m/1e3).toFixed(1)}k`,"fmt");return`${r(t)} in / ${r(i)} out`}s(cs,"formatTokenSplit");function Ne(t){switch(t){case"compile":return"compile";case"full":return"full rebuild";case"incremental":return"incremental";default:return t}}s(Ne,"updateKindLabel");function st(t){return t.archivedAt?"archived":t.state==="compiling"?"compiling":t.state==="error"?"error":t.state==="paused_budget"?"paused_budget":t.state==="paused_hours"?"paused_hours":t.generatingIssueId?"updating":t.pendingChangeCount>0?"stale":"fresh"}s(st,"deriveStatusCardLifecycle");var at={compiling:{label:"Setting up",dotClassName:"bg-cyan-400 animate-pulse",description:"Just created; setting up and generating the first summary.",dashedBorder:!0,keepsLastSummary:!1},fresh:{label:"Fresh",dotClassName:"bg-emerald-400",description:"Summary reflects all known changes; nothing pending.",dashedBorder:!1,keepsLastSummary:!0},stale:{label:"Stale",dotClassName:"bg-amber-400",description:"Changes are pending since the last update.",dashedBorder:!1,keepsLastSummary:!0},updating:{label:"Updating",dotClassName:"bg-blue-500 animate-pulse",description:"An update is streaming in now.",dashedBorder:!1,keepsLastSummary:!0},error:{label:"Error",dotClassName:"bg-red-500",description:"The last run failed; the last good summary stays visible.",dashedBorder:!1,keepsLastSummary:!0},paused_budget:{label:"Paused — budget",dotClassName:"bg-orange-400",description:"The daily token cap was hit; auto-updates are suspended.",dashedBorder:!1,keepsLastSummary:!0},paused_hours:{label:"Paused — hours",dotClassName:"bg-orange-400",description:"Outside active hours; changes batch into one update at window open.",dashedBorder:!1,keepsLastSummary:!0},archived:{label:"Archived",dotClassName:"bg-muted-foreground/50",description:"No auto-updates and no watches. Restore to start watching again.",dashedBorder:!1,keepsLastSummary:!0}};function nt(t){switch(t.mode){case"manual":return"manual";case"interval":return t.intervalMinutes?`every ${t.intervalMinutes}m if changed`:"on a schedule if changed";case"reactive":return`on change (${t.debounceSeconds??60}s)`;default:return"manual"}}s(nt,"describeRefreshPolicy");var e=He(ut(),1);function ms({className:t}){return(0,e.jsx)("span",{className:E("mt-1 inline-block h-2.5 w-2.5 shrink-0 rounded-full",t),"aria-hidden":"true"})}s(ms,"StateDot");function ne(t){return i=>{i.stopPropagation(),t()}}s(ne,"stopClick");function hs({card:t,companyId:i,onOpen:r,onRefresh:m,onRecompile:d,onEditInterest:c,onOpenDebug:x,onArchive:f,refreshPending:l,recompilePending:y}){const a=st(t),p=at[a],h=a==="compiling"&&!!t.generatingIssueId,b=(0,g.useMemo)(()=>a==="updating"&&t.generatingIssueId?{id:t.generatingIssueId,identifier:null,title:t.title??"Status update",status:"in_progress"}:null,[a,t.generatingIssueId,t.title]),S=Xe(i,b),G=nt(t.refreshPolicy),T=z(t.todayTokens),j=W(t.todayCostCents),H=t.lastGeneratedAt?V(t.lastGeneratedAt):"no summary yet",$=!!(t.summaryBody&&t.summaryBody.trim().length>0);return(0,e.jsxs)("div",{role:"button",tabIndex:0,onClick:r,onKeyDown:s(v=>{v.target===v.currentTarget&&(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),r())},"onKeyDown"),className:E("group flex h-72 cursor-pointer flex-col rounded-lg border border-border bg-card text-card-foreground transition-colors hover:border-muted-foreground/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",p.dashedBorder&&"border-dashed"),"data-testid":"status-card-tile","data-lifecycle":a,children:[(0,e.jsxs)("div",{className:"flex items-start gap-2 px-4 pt-4",children:[a==="compiling"?null:(0,e.jsx)(ms,{className:p.dotClassName}),(0,e.jsx)("span",{className:E("line-clamp-1 min-w-0 flex-1 text-sm font-semibold",a==="compiling"&&"text-muted-foreground"),title:t.title??t.interestPrompt,children:t.title??"New card"}),(0,e.jsx)("div",{onClick:s(v=>v.stopPropagation(),"onClick"),children:(0,e.jsxs)(Lt,{children:[(0,e.jsx)(ht,{asChild:!0,children:(0,e.jsx)(q,{variant:"ghost",size:"icon",className:"-mr-1 -mt-1 h-7 w-7 text-muted-foreground","aria-label":"Card actions",children:(0,e.jsx)(qt,{className:"h-4 w-4"})})}),(0,e.jsxs)(It,{align:"end",children:[(0,e.jsx)(Z,{onSelect:r,children:"Open detail"}),(0,e.jsx)(Z,{onSelect:m,disabled:l||a==="updating",children:"Refresh now"}),a==="compiling"&&!h||a==="error"?(0,e.jsx)(Z,{onSelect:d,disabled:y,children:"Run now"}):null,(0,e.jsx)(Z,{onSelect:c,children:"Edit interest & settings"}),(0,e.jsx)(Z,{onSelect:x,children:"Query debug"}),(0,e.jsx)(Wt,{}),(0,e.jsx)(Z,{onSelect:f,variant:"destructive",children:"Archive"})]})]})})]}),(0,e.jsxs)("div",{className:"px-4 pt-2",children:[a==="compiling"?(0,e.jsxs)("div",{className:"rounded-md bg-muted px-3 py-2 text-xs text-foreground",role:"status","aria-live":"polite",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[h?(0,e.jsx)(_,{className:"h-3.5 w-3.5 shrink-0 animate-spin text-muted-foreground"}):(0,e.jsx)(Te,{className:"h-3.5 w-3.5 shrink-0 text-amber-500"}),(0,e.jsx)("span",{children:h?"Setting up your card…":"Setup didn’t finish"})]}),(0,e.jsxs)("p",{className:"mt-1 line-clamp-2 text-muted-foreground",children:["“",t.interestPrompt,"”"]}),h?(0,e.jsxs)(re,{to:`/issues/${t.generatingIssueId}`,onClick:s(v=>v.stopPropagation(),"onClick"),className:"mt-2 inline-flex items-center gap-1.5 font-medium text-foreground underline-offset-2 hover:underline",children:[(0,e.jsx)(Pe,{className:"h-3.5 w-3.5"}),"View setup task"]}):(0,e.jsxs)("button",{type:"button",onClick:ne(d),disabled:y,className:"mt-2 inline-flex items-center gap-1.5 font-medium text-foreground underline-offset-2 hover:underline disabled:opacity-60",children:[(0,e.jsx)(Je,{className:E("h-3.5 w-3.5",y&&"animate-pulse")}),y?"Starting…":"Run now"]})]}):null,a==="updating"?(0,e.jsx)("div",{className:"rounded-md bg-muted px-3 py-2 text-xs text-foreground",role:"status","aria-live":"polite",children:(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(_,{className:"h-3.5 w-3.5 shrink-0 animate-spin text-muted-foreground"}),(0,e.jsx)("span",{className:"min-w-0 flex-1 truncate",title:S.statusLine??void 0,children:S.statusLine??(t.pendingChangeCount>0?`Integrating ${t.pendingChangeCount} ${t.pendingChangeCount===1?"change":"changes"}…`:"Updating now…")}),t.generatingIssueId?(0,e.jsxs)(re,{to:Kt(t.generatingIssueId),onClick:s(v=>v.stopPropagation(),"onClick"),className:"inline-flex shrink-0 items-center gap-1 font-medium underline-offset-2 hover:underline",children:[(0,e.jsx)(Pe,{className:"h-3.5 w-3.5"}),"View update task"]}):null]})}):null,a==="stale"?(0,e.jsxs)("button",{type:"button",onClick:ne(m),disabled:l,className:"flex w-full items-center justify-between gap-2 rounded-md border border-amber-500/40 bg-amber-500/5 px-3 py-1.5 text-left text-xs text-foreground transition-colors hover:bg-amber-500/10 disabled:opacity-60",children:[(0,e.jsxs)("span",{children:[t.pendingChangeCount," ",t.pendingChangeCount===1?"change":"changes"," since last update"]}),(0,e.jsx)("span",{className:"shrink-0 font-medium text-amber-700 dark:text-amber-400",children:"Refresh"})]}):null,a==="error"?(0,e.jsxs)("div",{className:"flex items-center justify-between gap-2 rounded-md border border-destructive/40 bg-destructive/5 px-3 py-1.5 text-xs",children:[(0,e.jsxs)("span",{className:"flex items-center gap-1.5 text-destructive",children:[(0,e.jsx)(Te,{className:"h-3.5 w-3.5 shrink-0"}),"Last update failed"]}),(0,e.jsxs)("span",{className:"flex shrink-0 items-center gap-3",children:[(0,e.jsx)("button",{type:"button",onClick:ne(m),disabled:l,className:"font-medium text-destructive hover:underline disabled:opacity-60",children:"Retry"}),(0,e.jsx)("button",{type:"button",onClick:ne(r),className:"text-muted-foreground hover:underline",children:"Details"})]})]}):null,a==="paused_budget"||a==="paused_hours"?(0,e.jsxs)("div",{className:"flex items-center gap-2 rounded-md border border-orange-500/40 bg-orange-500/5 px-3 py-1.5 text-xs text-foreground",children:[(0,e.jsx)(Qt,{className:"h-3.5 w-3.5 shrink-0 text-orange-500"}),(0,e.jsx)("span",{children:a==="paused_budget"?"Daily token cap reached — auto-updates paused":"Outside active hours — auto-updates paused"})]}):null]}),(0,e.jsxs)("div",{className:"min-h-0 flex-1 overflow-hidden px-4 pt-2",children:[a==="error"&&t.summaryBody?(0,e.jsx)("p",{className:"mb-1 text-(length:--text-micro) text-muted-foreground",children:"Showing last good summary:"}):null,$?(0,e.jsx)(ee,{className:"text-xs leading-6 text-foreground [&_p]:my-0.5",children:t.summaryBody}):a==="compiling"?(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:"You can add instructions and pick an update policy while this runs."}):a==="updating"&&S.draft?(0,e.jsx)(ee,{className:"text-xs leading-6 text-foreground [&_p]:my-0.5",children:S.draft}):(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:"No summary yet."})]}),(0,e.jsxs)("div",{className:"mt-auto flex items-center justify-between gap-2 border-t border-border px-4 py-2.5",children:[(0,e.jsx)("span",{className:"truncate text-(length:--text-micro) text-muted-foreground",children:a==="compiling"?"setting up · first summary pending":(0,e.jsxs)(e.Fragment,{children:[H," · ",G,T?` · ${T}`:"",j?` · ${j}`:""]})}),a==="fresh"||a==="paused_budget"||a==="paused_hours"?(0,e.jsx)(q,{variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0 text-muted-foreground",onClick:ne(m),disabled:l,"aria-label":"Refresh card",children:(0,e.jsx)(Qe,{className:E("h-3.5 w-3.5",l&&"animate-spin")})}):null]})]})}s(hs,"StatusCardTile");function Ue(t){return t?new Date(t).toLocaleDateString(void 0,{month:"short",day:"numeric"}):"—"}s(Ue,"shortDate");function xs({card:t,onView:i,onRestore:r,restorePending:m}){const d=U({queryKey:N.statusCards.updates(t.id),queryFn:s(()=>C.updates(t.id),"queryFn")}),c=d.data?ns(d.data):null;return(0,e.jsxs)("div",{className:"flex items-center justify-between gap-4 rounded-lg border border-border bg-muted/30 px-4 py-3",children:[(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsx)("p",{className:"truncate text-sm font-semibold",children:t.title??"Untitled card"}),(0,e.jsxs)("p",{className:"mt-0.5 text-xs text-muted-foreground",title:t.archivedAt?he(t.archivedAt):void 0,children:["archived ",Ue(t.archivedAt)," · last summary ",Ue(t.lastGeneratedAt),c?` · lifetime ${z(c.totalTokens)} / ${W(c.totalCostCents)}`:""]})]}),(0,e.jsxs)("div",{className:"flex shrink-0 gap-2",children:[(0,e.jsx)(q,{size:"sm",onClick:i,children:"View"}),(0,e.jsxs)(q,{variant:"outline",size:"sm",onClick:r,disabled:m,children:[m?(0,e.jsx)(_,{className:"animate-spin"}):null,"Restore"]})]})]})}s(xs,"ArchivedStatusCardRow");function rt({companyId:t,value:i,onChange:r,enabled:m=!0}){const d=U({queryKey:t?N.agents.list(t):["agents","none"],queryFn:s(()=>Ut.list(t),"queryFn"),enabled:!!t&&m}),c=(0,g.useMemo)(()=>new Map((d.data??[]).map(l=>[l.id,l])),[d.data]),x=(0,g.useMemo)(()=>(d.data??[]).filter(Rt).map(l=>({id:`agent:${l.id}`,label:l.name,searchText:`${l.name} ${l.role} ${l.title??""}`})),[d.data]),f=s(l=>{if(!l||!l.id)return(0,e.jsx)("span",{children:"Summarizer (default)"});const y=l.id.startsWith("agent:")?c.get(l.id.slice(6)):null;return(0,e.jsxs)(e.Fragment,{children:[y?(0,e.jsx)(At,{agent:y,size:16,className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}):null,(0,e.jsx)("span",{className:"truncate",children:l.label})]})},"renderAgent");return(0,e.jsx)(bt,{value:i?`agent:${i}`:"",options:x,placeholder:"Summarizer (default)",noneLabel:"Summarizer (default)",searchPlaceholder:"Search agents...",emptyMessage:"No agents found.",onChange:s(l=>r(l.startsWith("agent:")?l.slice(6):""),"onChange"),className:"h-8 text-sm",renderTriggerValue:f,renderOption:s(l=>f(l),"renderOption")})}s(rt,"SummarizerAgentSelect");var ps=["issues about evals","everything blocked this week","is feature X live? if not, the exact next actions to ship it"];function gs({companyId:t,open:i,onOpenChange:r}){const m=Me(),[d,c]=(0,g.useState)(""),[x,f]=(0,g.useState)(""),[l,y]=(0,g.useState)(null);function a(){c(""),f(""),y(null)}s(a,"reset");function p(){r(!1),window.setTimeout(a,200)}s(p,"close");const h=L({mutationFn:s(()=>C.create(t,{interestPrompt:d.trim(),titlePinned:!1,agentId:x||null,refreshPolicy:et}),"mutationFn"),onMutate:s(()=>y(null),"onMutate"),onSuccess:s(async()=>{await Promise.all([m.invalidateQueries({queryKey:N.statusCards.list(t,!1)}),m.invalidateQueries({queryKey:N.statusCards.list(t,!0)})]),p()},"onSuccess"),onError:s(b=>y(F(b,{action:"create the card"}).body),"onError")});return(0,e.jsx)(zt,{open:i,onOpenChange:s(b=>b?r(!0):p(),"onOpenChange"),children:(0,e.jsxs)(Mt,{className:"sm:max-w-2xl",children:[(0,e.jsxs)(wt,{children:[(0,e.jsx)(_t,{children:"New card"}),(0,e.jsx)(Ht,{children:"One message sets up the whole card: say what you want to watch and what each update should tell you. The agent builds the query from it and writes every update against it."})]}),l?(0,e.jsx)(fe,{tone:"danger",title:"Create failed",children:l}):null,(0,e.jsxs)("div",{className:"space-y-3",children:[(0,e.jsx)("label",{htmlFor:"status-card-prompt",className:"block pb-1 text-sm font-semibold",children:"What do you want to keep an eye on?"}),(0,e.jsx)(Ge,{id:"status-card-prompt",value:d,onChange:s(b=>c(b.target.value),"onChange"),rows:5,autoFocus:!0,placeholder:"Keep an eye on the ID and Cloud projects. Tell me whether the service is live, and if not, the exact three actions needed to get it to production.",className:"text-sm"}),(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:"Examples"}),ps.map(b=>(0,e.jsx)("button",{type:"button",onClick:s(()=>c(b),"onClick"),className:"rounded-full border border-border px-3 py-1 text-xs text-muted-foreground transition-colors hover:bg-accent/40",children:b},b))]})]}),(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)("label",{className:"block text-sm font-semibold",children:"Agent"}),(0,e.jsx)(rt,{companyId:t,value:x,onChange:f,enabled:i}),(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:"Runs this card's setup and updates. Leave on the default unless another agent should own it."})]}),(0,e.jsx)(St,{children:(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsx)(q,{variant:"outline",onClick:p,disabled:h.isPending,children:"Cancel"}),(0,e.jsxs)(q,{onClick:s(()=>h.mutate(),"onClick"),disabled:d.trim().length===0||h.isPending,children:[h.isPending?(0,e.jsx)(_,{className:"animate-spin"}):null,"Create card"]})]})})]})})}s(gs,"CreateStatusCardDialog");function fs(){return{refreshPolicy:{mode:"manual",triggers:{statusTransitions:!0,membershipChanges:!0,humanComments:!0,assigneeChanges:!0,anyUpdate:!1}}}}s(fs,"defaultSettingsValue");var ys=[5,15,30,60],bs=[30,60,120,300],vs=[{key:"statusTransitions",label:"Became blocked / needs review / done / cancelled"},{key:"membershipChanges",label:"New issue matches the query · issue leaves the query"},{key:"humanComments",label:"Human comments"},{key:"assigneeChanges",label:"Assignee changes"},{key:"anyUpdate",label:"Any update at all (noisy — includes in-progress churn)",noisy:!0}];function Ce({selected:t,title:i,badge:r,onSelect:m,children:d}){return(0,e.jsxs)("div",{className:E("rounded-md border px-3 py-2.5 transition-colors",t?"border-primary bg-primary/5 ring-1 ring-primary":"border-border hover:bg-accent/40"),children:[(0,e.jsxs)("button",{type:"button",role:"radio","aria-checked":t,onClick:m,className:"flex w-full items-center gap-2 text-left",children:[(0,e.jsx)("span",{className:E("flex h-4 w-4 shrink-0 items-center justify-center rounded-full border",t?"border-primary":"border-muted-foreground/50"),children:t?(0,e.jsx)("span",{className:"h-2 w-2 rounded-full bg-primary"}):null}),(0,e.jsx)("span",{className:"text-sm font-medium",children:i}),r]}),t&&d?(0,e.jsx)("div",{className:"mt-2 pl-6",children:d}):null]})}s(Ce,"RadioRow");function js({value:t,onChange:i}){const{refreshPolicy:r}=t,m=r.mode!=="manual",d=us(r),c=s(a=>i({...t,refreshPolicy:{...r,...a}}),"setPolicy"),x=s(a=>{const p={mode:a};a==="interval"&&(p.intervalMinutes=r.intervalMinutes??15),a==="reactive"&&(p.debounceSeconds=r.debounceSeconds??60,p.maxUpdatesPerHour=r.maxUpdatesPerHour??6),c(p)},"setMode"),f=s(a=>c({triggers:{...r.triggers,[a]:!r.triggers[a]}}),"toggleTrigger"),l=r.activeHours,y=s(a=>c({activeHours:a?{start:l?.start??"08:00",end:l?.end??"19:00",timezone:l?.timezone??"UTC"}:void 0}),"setActiveHoursEnabled");return(0,e.jsxs)("div",{className:"space-y-6",children:[(0,e.jsxs)("section",{className:"space-y-2",children:[(0,e.jsx)("h3",{className:"text-sm font-semibold",children:"Auto-update policy"}),(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(Ce,{selected:r.mode==="manual",title:"Manual only — updates when I press refresh",badge:(0,e.jsx)("span",{className:"ml-auto rounded-full bg-muted px-2 py-0.5 text-(length:--text-nano) font-medium uppercase tracking-wide text-muted-foreground",children:"Default"}),onSelect:s(()=>x("manual"),"onSelect")}),(0,e.jsx)(Ce,{selected:r.mode==="interval",title:"On a schedule, only if something changed",onSelect:s(()=>x("interval"),"onSelect"),children:(0,e.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,e.jsx)("span",{children:"Check every"}),(0,e.jsxs)(ke,{value:String(r.intervalMinutes??15),onValueChange:s(a=>c({intervalMinutes:Number(a)}),"onValueChange"),children:[(0,e.jsx)(we,{size:"sm",className:"w-28","aria-label":"Check interval",children:(0,e.jsx)(Ie,{})}),(0,e.jsx)(Ae,{children:ys.map(a=>(0,e.jsxs)(xe,{value:String(a),children:[a," min"]},a))})]})]})}),(0,e.jsx)(Ce,{selected:r.mode==="reactive",title:"As soon as something changes (debounced)",onSelect:s(()=>x("reactive"),"onSelect"),children:(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm text-muted-foreground",children:[(0,e.jsx)("span",{children:"Wait"}),(0,e.jsxs)(ke,{value:String(r.debounceSeconds??60),onValueChange:s(a=>c({debounceSeconds:Number(a)}),"onValueChange"),children:[(0,e.jsx)(we,{size:"sm",className:"w-24","aria-label":"Debounce",children:(0,e.jsx)(Ie,{})}),(0,e.jsx)(Ae,{children:bs.map(a=>(0,e.jsxs)(xe,{value:String(a),children:[a,"s"]},a))})]}),(0,e.jsx)("span",{className:"text-xs",children:"after the last change · max"}),(0,e.jsx)(X,{type:"number",min:1,max:60,value:r.maxUpdatesPerHour??6,onChange:s(a=>c({maxUpdatesPerHour:Math.max(1,Number(a.target.value)||1)}),"onChange"),className:"h-8 w-16 text-sm","aria-label":"Max updates per hour"}),(0,e.jsx)("span",{className:"text-xs",children:"updates/hour"})]})})]})]}),m?(0,e.jsxs)(Ze,{className:"rounded-md border border-border",children:[(0,e.jsxs)(Ve,{className:"group flex w-full items-center justify-between gap-2 px-3 py-2.5 text-sm font-semibold",children:["Advanced",(0,e.jsx)(Ye,{className:"h-4 w-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]}),(0,e.jsxs)(Ke,{className:"space-y-6 border-t border-border px-3 py-3",children:[(0,e.jsxs)("section",{className:"space-y-2",children:[(0,e.jsx)("h3",{className:"text-sm font-semibold",children:"Count as a change"}),(0,e.jsx)("div",{className:"space-y-2",children:vs.map(a=>(0,e.jsxs)("label",{className:"flex items-start gap-2.5 text-sm",children:[(0,e.jsx)(De,{checked:r.triggers[a.key],onCheckedChange:s(()=>f(a.key),"onCheckedChange"),className:"mt-0.5","aria-label":a.label}),(0,e.jsx)("span",{className:E(a.noisy&&"text-muted-foreground"),children:a.label})]},a.key))})]}),(0,e.jsxs)("section",{className:"space-y-3",children:[(0,e.jsx)("h3",{className:"text-sm font-semibold",children:"Guardrails"}),(0,e.jsxs)("label",{className:"flex items-start gap-2.5 text-sm",children:[(0,e.jsx)(De,{checked:!!l,onCheckedChange:s(a=>y(!!a),"onCheckedChange"),className:"mt-0.5","aria-label":"Limit to active hours"}),(0,e.jsx)("span",{children:"Only auto-update during active hours"})]}),l?(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2 pl-6 text-sm",children:[(0,e.jsx)(X,{type:"time",value:l.start,onChange:s(a=>c({activeHours:{...l,start:a.target.value}}),"onChange"),className:"h-8 w-32","aria-label":"Active hours start"}),(0,e.jsx)("span",{className:"text-muted-foreground",children:"–"}),(0,e.jsx)(X,{type:"time",value:l.end,onChange:s(a=>c({activeHours:{...l,end:a.target.value}}),"onChange"),className:"h-8 w-32","aria-label":"Active hours end"}),(0,e.jsx)(X,{value:l.timezone,onChange:s(a=>c({activeHours:{...l,timezone:a.target.value}}),"onChange"),className:"h-8 w-40",placeholder:"Timezone","aria-label":"Active hours timezone"})]}):null,(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[(0,e.jsx)("span",{className:"w-32 shrink-0",children:"Daily token cap"}),(0,e.jsx)(X,{type:"number",min:0,step:1e3,value:r.dailyTokenCap??"",onChange:s(a=>{const p=Number(a.target.value);c({dailyTokenCap:a.target.value===""||p<=0?void 0:p})},"onChange"),className:"h-8 w-36",placeholder:"no cap","aria-label":"Daily token cap"})]})]})]})]}):null,(0,e.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,e.jsx)("span",{className:"font-semibold",children:"Estimated cost"}),(0,e.jsx)("span",{className:"text-muted-foreground",children:"="}),(0,e.jsxs)(Ot,{children:[(0,e.jsx)(Vt,{asChild:!0,children:(0,e.jsx)("span",{className:"cursor-default font-medium text-foreground underline decoration-dotted decoration-muted-foreground/50 underline-offset-4",children:d.cost})}),(0,e.jsxs)(Gt,{className:"max-w-(--sz-18rem) text-left",children:[(0,e.jsx)("p",{children:d.primary}),d.note?(0,e.jsx)("p",{className:"mt-1 opacity-80",children:d.note}):null,(0,e.jsx)("p",{className:"mt-1 opacity-80",children:"Rough estimate from typical update sizes; actual cost is tracked per update."})]})]})]})]})}s(js,"StatusCardSettingsForm");function Ns({card:t,companyId:i,open:r,onOpenChange:m,initialTab:d="summary"}){const c=Me(),[x,f]=(0,g.useState)("summary"),[l,y]=(0,g.useState)(fs()),[a,p]=(0,g.useState)(""),[h,b]=(0,g.useState)(""),[S,G]=(0,g.useState)(""),[T,j]=(0,g.useState)(null),[H,$]=(0,g.useState)(null),[v,O]=(0,g.useState)(null);(0,g.useEffect)(()=>{t&&(y({refreshPolicy:t.refreshPolicy}),p(t.title??""),b(t.interestPrompt),G(t.agentId??""),j(null),$(null),O(null))},[t]),(0,g.useEffect)(()=>{r&&f(d)},[r,d]);const K=U({queryKey:t?N.statusCards.updates(t.id):["status-cards","detail","none","updates"],queryFn:s(()=>C.updates(t.id),"queryFn"),enabled:!!(t&&r)}),se=Ee(K),be=U({queryKey:t?N.statusCards.summaryRevisions(t.id):["status-cards","detail","none","summary-revisions"],queryFn:s(()=>C.summaryRevisions(t.id),"queryFn"),enabled:!!(t&&r&&t.documentId)}),D=U({queryKey:t?N.statusCards.dryRun(t.id):["status-cards","detail","none","dry-run"],queryFn:s(()=>C.dryRun(t.id),"queryFn"),enabled:!!(t&&r&&x==="watched"&&(t.queries.length>0||(t.mentionedIssueIds?.length??0)>0))}),M=Ee(D),A=t?st(t):"fresh",Y=(0,g.useMemo)(()=>t&&A==="updating"&&t.generatingIssueId?{id:t.generatingIssueId,identifier:null,title:t.title??"Status update",status:"in_progress"}:null,[t,A]),ie=Xe(i,Y),u=s(async()=>{t&&await Promise.all([c.invalidateQueries({queryKey:N.statusCards.list(t.companyId,!1)}),c.invalidateQueries({queryKey:N.statusCards.detail(t.id)})])},"invalidateCard"),B=L({mutationFn:s(()=>C.refresh(t.id),"mutationFn"),onMutate:s(()=>{j(null),$(null)},"onMutate"),onSuccess:s(async()=>{await u(),$("Refresh queued — the Summarizer is updating this card.")},"onSuccess"),onError:s(o=>j(F(o,{action:"refresh the card"}).body),"onError")}),le=L({mutationFn:s(()=>C.recompile(t.id),"mutationFn"),onMutate:s(()=>{j(null),$(null)},"onMutate"),onSuccess:s(async()=>{await u(),$("Run queued — the Summarizer is updating this card.")},"onSuccess"),onError:s(o=>j(F(o,{action:"run the card"}).body),"onError")}),ve=L({mutationFn:s(()=>{const o=a.trim(),je=h.trim(),ot=je.length>0&&je!==t.interestPrompt.trim();return C.patch(t.id,{title:o||null,titlePinned:o.length>0,...ot?{interestPrompt:je}:{},agentId:S||null,refreshPolicy:l.refreshPolicy})},"mutationFn"),onMutate:s(()=>j(null),"onMutate"),onSuccess:s(async()=>{t&&await Promise.all([c.invalidateQueries({queryKey:N.statusCards.list(t.companyId,!1)}),c.invalidateQueries({queryKey:N.statusCards.detail(t.id)})])},"onSuccess"),onError:s(o=>j(F(o,{action:"save the settings"}).body),"onError")});if(!t)return null;const ae=K.data??[],it=ae[0]??null,oe=rs(ae),Q=ae.filter(o=>o.status==="ok"&&o.finishedAt&&(o.kind==="full"||o.kind==="incremental")),I=v?Q.find(o=>o.id===v)??null:null,lt=be.data??[],Re=I?lt[Q.indexOf(I)]?.body??null:null,de=Q.length,_e=s(o=>de-Q.indexOf(o),"revisionNumberOf"),ue=I?I.changes:it?.changes??[],qe=at[A],$e=!!(t.summaryBody&&t.summaryBody.trim().length>0),J=A==="compiling"&&!!t.generatingIssueId;return(0,e.jsx)(Ct,{open:r,onOpenChange:m,children:(0,e.jsxs)(Dt,{className:"flex w-full flex-col gap-0 p-0 sm:max-w-2xl",children:[(0,e.jsxs)(kt,{className:"border-b border-border p-4",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 pr-8",children:[(0,e.jsx)("span",{className:E("inline-block h-2.5 w-2.5 shrink-0 rounded-full",qe.dotClassName),"aria-hidden":"true"}),(0,e.jsx)(jt,{className:"min-w-0 flex-1 truncate text-lg",children:t.title??"Untitled card"}),(0,e.jsx)(pe,{variant:"outline",children:qe.label}),A==="compiling"?(0,e.jsxs)(q,{variant:"outline",size:"sm",onClick:s(()=>le.mutate(),"onClick"),disabled:le.isPending||J,children:[J||le.isPending?(0,e.jsx)(_,{className:"h-3.5 w-3.5 animate-spin"}):(0,e.jsx)(Je,{className:"h-3.5 w-3.5"}),J?"Setting up…":le.isPending?"Running…":"Run now"]}):(0,e.jsxs)(q,{variant:"outline",size:"sm",onClick:s(()=>B.mutate(),"onClick"),disabled:B.isPending||A==="updating",children:[(0,e.jsx)(Qe,{className:E("h-3.5 w-3.5",B.isPending&&"animate-spin")}),B.isPending?"Refreshing…":"Refresh"]})]}),(0,e.jsxs)("p",{className:"text-xs text-muted-foreground",children:[t.lastGeneratedAt?`Updated ${V(t.lastGeneratedAt)}`:"No summary yet"," ·"," ",nt(t.refreshPolicy)]})]}),(0,e.jsxs)(Et,{value:x,onValueChange:f,className:"flex min-h-0 flex-1 flex-col gap-0",children:[(0,e.jsxs)(Pt,{variant:"line",className:"w-full justify-start gap-4 border-b border-border px-4",children:[(0,e.jsx)(me,{value:"summary",children:"Summary"}),(0,e.jsx)(me,{value:"settings",children:"Settings"}),(0,e.jsx)(me,{value:"watched",children:"Watched issues"}),(0,e.jsx)(me,{value:"history",children:"History"})]}),T?(0,e.jsx)("div",{className:"px-4 pt-3",children:(0,e.jsx)(fe,{tone:"warning",title:"Heads up",children:T})}):H?(0,e.jsx)("div",{className:"px-4 pt-3",children:(0,e.jsx)(fe,{tone:"info",title:"Working on it",children:H})}):null,(0,e.jsxs)("div",{className:"min-h-0 flex-1 overflow-y-auto p-4",children:[(0,e.jsxs)(ce,{value:"summary",className:"mt-0 space-y-5",children:[($e||Q.length>0)&&A!=="compiling"?(0,e.jsx)("div",{className:"flex items-center justify-end gap-2",children:Q.length>1?(0,e.jsxs)(ke,{value:v??"__latest__",onValueChange:s(o=>O(o==="__latest__"?null:o),"onValueChange"),children:[(0,e.jsxs)(we,{size:"sm",className:"w-auto gap-1.5","aria-label":"Select summary revision",children:[(0,e.jsx)(mt,{className:"h-3.5 w-3.5","aria-hidden":"true"}),(0,e.jsx)(Ie,{})]}),(0,e.jsxs)(Ae,{align:"end",position:"popper",children:[(0,e.jsxs)(xe,{value:"__latest__",className:"text-xs",children:["Revision ",de," · latest"]}),(0,e.jsx)(gt,{}),Q.slice(0,30).map(o=>(0,e.jsxs)(xe,{value:o.id,className:"text-xs",title:he(o.startedAt),children:["Rev ",_e(o)," · ",Ne(o.kind)," · ",V(o.startedAt)]},o.id))]})]}):de>0?(0,e.jsxs)("span",{className:"text-xs text-muted-foreground",children:["Revision ",de," · latest"]}):null}):null,A==="updating"&&ie.draft&&!I?(0,e.jsx)(ee,{className:"text-sm leading-7",children:ie.draft}):I?(0,e.jsxs)("div",{className:"space-y-2 rounded-md border border-border bg-muted/30 p-3",children:[(0,e.jsxs)("p",{className:"text-xs text-muted-foreground",title:he(I.startedAt),children:["Revision ",_e(I)," · ",Ne(I.kind)," ·"," ",V(I.startedAt)]}),Re?(0,e.jsx)(ee,{className:"text-sm leading-7",children:Re}):I.changeSummary?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(ee,{className:"text-sm leading-7",children:I.changeSummary}),(0,e.jsx)("p",{className:"text-xs text-muted-foreground/70",children:"The full summary text for this revision is unavailable — showing its change summary. The integrated changes below are the live ledger for this revision."})]}):(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"No change summary was recorded for this revision."})]}):$e?(0,e.jsx)(ee,{className:"text-sm leading-7",children:t.summaryBody}):A==="compiling"?(0,e.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,e.jsxs)("p",{className:"flex items-center gap-2",children:[J?(0,e.jsx)(_,{className:"h-4 w-4 shrink-0 animate-spin"}):(0,e.jsx)(Te,{className:"h-4 w-4 shrink-0 text-amber-500"}),J?"Setting up — the first summary is generated automatically once this finishes.":"Setup didn’t finish. Run it now to try again."]}),J&&t.generatingIssueId?(0,e.jsxs)(re,{to:`/issues/${t.generatingIssueId}`,className:"inline-flex items-center gap-1.5 text-xs font-medium text-foreground underline-offset-2 hover:underline",children:[(0,e.jsx)(Pe,{className:"h-3.5 w-3.5"}),"View setup task"]}):null]}):(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"No summary yet — the first one is generated automatically once this card finishes setting up."}),ue.length>0?(0,e.jsxs)("section",{className:"space-y-2",children:[(0,e.jsxs)("h3",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:[I?"Integrated in this revision":"Integrated in this update"," (",ue.length," ",ue.length===1?"change":"changes",")"]}),(0,e.jsx)("div",{className:"space-y-1.5",children:ue.map(o=>(0,e.jsx)(ws,{change:o},o.issueId))})]}):null]}),(0,e.jsx)(ce,{value:"history",className:"mt-0 space-y-3",children:K.isLoading||se.kind==="reconnecting"?(0,e.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,e.jsx)(_,{className:"h-4 w-4 animate-spin"})," Loading history…"]}):ae.length===0?(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"No updates recorded yet."}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"text-xs text-muted-foreground",children:["Today: ",oe.updateCount," ",oe.updateCount===1?"update":"updates"," ·"," ",z(oe.totalTokens)," · ",W(oe.totalCostCents),t.refreshPolicy.dailyTokenCap?` · daily cap ${z(t.refreshPolicy.dailyTokenCap)}`:""]}),(0,e.jsx)("div",{className:"divide-y divide-border",children:ae.map(o=>(0,e.jsxs)("div",{className:"py-2.5 first:pt-1",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,e.jsxs)("span",{className:"flex items-center gap-2 text-sm font-medium",children:[Ne(o.kind),(0,e.jsx)(pe,{variant:o.status==="failed"?"destructive":"secondary",children:o.status==="ok"?o.trigger:o.status})]}),(0,e.jsx)("span",{className:"text-xs text-muted-foreground",title:he(o.startedAt),children:V(o.startedAt)})]}),(0,e.jsxs)("p",{className:"mt-1 text-xs text-muted-foreground",children:[cs(o.inputTokens,o.outputTokens)," · ",W(o.costCents),o.model?` · ${o.model}`:"",o.changes.length>0?` · ${o.changes.length} changes`:""]}),o.error?(0,e.jsx)("p",{className:"mt-1 text-xs text-destructive",children:o.error}):null]},o.id))})]})}),(0,e.jsx)(ce,{value:"watched",className:"mt-0 space-y-3",children:t.queries.length===0&&(t.mentionedIssueIds?.length??0)===0?(0,e.jsx)("div",{className:"rounded-md border border-dashed border-border px-3 py-4 text-sm text-muted-foreground",children:"This card is still setting up — the issues it watches appear here once it's ready."}):D.isLoading||M.kind==="reconnecting"?(0,e.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,e.jsx)(_,{className:"h-4 w-4 animate-spin"})," Matching issues…"]}):M.kind==="error"?(0,e.jsx)(We,{error:M.error,action:"load matched issues",onRetry:M.retry,retrying:M.isFetching}):(0,e.jsx)(Ss,{queries:D.data?.queries??[],mentioned:D.data?.mentionedIssues??[]})}),(0,e.jsxs)(ce,{value:"settings",className:"mt-0 space-y-6",children:[(0,e.jsxs)("section",{className:"space-y-2",children:[(0,e.jsx)("h3",{className:"text-sm font-semibold",children:"Card name"}),(0,e.jsx)(X,{value:a,onChange:s(o=>p(o.target.value),"onChange"),placeholder:"Auto-named from the query",className:"text-sm","aria-label":"Card name"})]}),(0,e.jsxs)("section",{className:"space-y-2",children:[(0,e.jsx)("h3",{className:"text-sm font-semibold",children:"What this card watches & reports"}),(0,e.jsx)(Ge,{value:h,onChange:s(o=>b(o.target.value),"onChange"),rows:3,className:"text-sm","aria-label":"What this card watches & reports"}),(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:"This one message drives the whole card: the agent compiles the watch query from it and follows it as the instructions for every update. Editing it rebuilds the card."})]}),(0,e.jsxs)("section",{className:"space-y-2",children:[(0,e.jsx)("h3",{className:"text-sm font-semibold",children:"Agent"}),(0,e.jsx)(rt,{companyId:t.companyId,value:S,onChange:G,enabled:r})]}),(0,e.jsx)(js,{value:l,onChange:y}),(0,e.jsx)(Cs,{card:t}),(0,e.jsx)("div",{className:"flex justify-end border-t border-border pt-4",children:(0,e.jsxs)(q,{onClick:s(()=>ve.mutate(),"onClick"),disabled:ve.isPending,children:[ve.isPending?(0,e.jsx)(_,{className:"animate-spin"}):null,"Save"]})})]})]})]})]})})}s(Ns,"StatusCardDetailDrawer");function Cs({card:t}){const i=JSON.stringify({queries:t.queries,limit:50},null,2);return(0,e.jsxs)(Ze,{className:"rounded-md border border-border",children:[(0,e.jsxs)(Ve,{className:"group flex w-full items-center justify-between gap-2 px-3 py-2.5 text-sm font-semibold",children:[(0,e.jsxs)("span",{className:"flex items-center gap-2",children:["Query debug",(0,e.jsxs)(pe,{variant:"secondary",children:["v",t.queryVersion]})]}),(0,e.jsx)(Ye,{className:"h-4 w-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]}),(0,e.jsxs)(Ke,{className:"space-y-2 border-t border-border px-3 py-3",children:[(0,e.jsx)("pre",{className:E("max-h-64 overflow-auto rounded-md bg-muted p-3 font-mono text-xs text-foreground",ct),children:t.queries.length>0?i:"// query not compiled yet"}),(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:t.queryCompiledAt?`Compiled by Summarizer ${V(t.queryCompiledAt)} · version ${t.queryVersion}. Edit “What this card watches” above to rebuild it.`:"Not compiled yet. The query builds automatically once the card finishes setting up."})]})]})}s(Cs,"QueryDebugSection");function Ss({queries:t,mentioned:i}){const r=new Set,m=[];for(const{result:c}of t)for(const x of c.results)!x.issue||r.has(x.issue.id)||(r.add(x.issue.id),m.push(x.issue));const d=i.filter(c=>!r.has(c.id));return m.length===0&&d.length===0?(0,e.jsx)("div",{className:"rounded-md border border-dashed border-border px-3 py-4 text-sm text-muted-foreground",children:"The compiled query matches no issues right now."}):(0,e.jsxs)("div",{className:"space-y-3",children:[m.length>0?(0,e.jsx)("div",{className:"space-y-1.5",children:m.map(c=>(0,e.jsx)(ze,{issue:c},c.id))}):null,d.length>0?(0,e.jsxs)("div",{className:"space-y-1.5",children:[(0,e.jsx)("p",{className:"text-xs font-medium text-muted-foreground",children:"Mentioned in the latest update"}),d.map(c=>(0,e.jsx)(ze,{issue:c},c.id))]}):null]})}s(Ss,"MatchedIssueList");function ze({issue:t}){return(0,e.jsxs)("div",{className:"flex items-center gap-2 rounded-md border border-border px-3 py-2 text-xs",children:[(0,e.jsx)(re,{to:`/issues/${t.identifier??t.id}`,className:"shrink-0 font-medium text-muted-foreground underline-offset-2 hover:text-foreground hover:underline",children:t.identifier??t.id.slice(0,8)}),(0,e.jsx)(Se,{...yt(t)}),(0,e.jsx)("span",{className:"min-w-0 flex-1 truncate",children:t.title}),(0,e.jsx)("span",{className:"shrink-0 text-muted-foreground",children:V(t.updatedAt)})]})}s(ze,"WatchedIssueRow");function ws({change:t}){const i=!!(t.from&&t.to);return(0,e.jsxs)("div",{className:"flex items-center gap-2 rounded-md border border-border px-3 py-2 text-xs",children:[(0,e.jsx)(re,{to:`/issues/${t.identifier}`,className:"shrink-0 font-medium text-muted-foreground underline-offset-2 hover:text-foreground hover:underline",children:t.identifier}),i?(0,e.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,e.jsx)(Se,{status:t.from}),(0,e.jsx)("span",{"aria-hidden":"true",className:"text-muted-foreground",children:"→"}),(0,e.jsx)(Se,{status:t.to})]}):(0,e.jsx)("span",{className:"truncate text-muted-foreground",children:ks(t.changeKind)})]})}s(ws,"ChangeRow");function ks(t){return t==="entered_query"||t==="new"?"new issue matched the query":t==="left_query"?"left the query":t.replace(/_/g," ")}s(ks,"describeChangeKind");function zs(){const{selectedCompanyId:t}=pt(),{setBreadcrumbs:i}=Tt(),r=vt(),m=Me(),{cardId:d}=Nt(),[c,x]=(0,g.useState)(!1),[f,l]=(0,g.useState)(!1),[y,a]=(0,g.useState)("summary"),[p,h]=(0,g.useState)(null);(0,g.useEffect)(()=>{i([{label:"Status"}])},[i]);const b=U({queryKey:t?N.statusCards.list(t,!1):["status-cards","none","active"],queryFn:s(()=>C.list(t,!1),"queryFn"),enabled:!!t}),S=Ee(b),G=U({queryKey:t?N.statusCards.list(t,!0):["status-cards","none","archived"],queryFn:s(()=>C.list(t,!0),"queryFn"),enabled:!!t}),T=b.data??[],j=G.data??[],H=(0,g.useMemo)(()=>[...T,...j].find(u=>u.id===d)??null,[T,j,d]),$=U({queryKey:d?N.statusCards.detail(d):["status-cards","detail","none"],queryFn:s(()=>C.get(d),"queryFn"),enabled:!!d&&!H}),v=H??$.data??null,O=s(()=>t?Promise.all([m.invalidateQueries({queryKey:N.statusCards.list(t,!1)}),m.invalidateQueries({queryKey:N.statusCards.list(t,!0)})]):Promise.resolve(),"invalidateLists"),K=L({mutationFn:s(u=>C.refresh(u),"mutationFn"),onMutate:s(()=>h(null),"onMutate"),onSuccess:s(()=>O(),"onSuccess"),onError:s(u=>h(F(u,{action:"refresh the card"}).body),"onError")}),se=L({mutationFn:s(u=>C.recompile(u),"mutationFn"),onMutate:s(()=>h(null),"onMutate"),onSuccess:s(()=>O(),"onSuccess"),onError:s(u=>h(F(u,{action:"run the card"}).body),"onError")}),be=L({mutationFn:s(u=>C.patch(u,{archived:!0}),"mutationFn"),onMutate:s(()=>h(null),"onMutate"),onSuccess:s(()=>O(),"onSuccess"),onError:s(u=>h(F(u,{action:"archive the card"}).body),"onError")}),D=L({mutationFn:s(u=>C.patch(u,{archived:!1}),"mutationFn"),onMutate:s(()=>h(null),"onMutate"),onSuccess:s(()=>O(),"onSuccess"),onError:s(u=>h(F(u,{action:"restore the card"}).body),"onError")}),M=s((u,B="summary")=>{a(B),r(`/status/${u}`)},"openDetail"),A=s(()=>r("/status"),"closeDetail"),Y=T.reduce((u,B)=>({tokens:u.tokens+(B.todayTokens??0),cents:u.cents+(B.todayCostCents??0)}),{tokens:0,cents:0}),ie=Y.tokens>0||Y.cents>0;return(0,e.jsxs)("div",{className:"mx-auto max-w-6xl space-y-5",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)("h1",{className:"text-xl font-bold",children:"Status"}),(0,e.jsxs)(pe,{variant:"secondary",className:"gap-1",children:[(0,e.jsx)(Be,{className:"h-3 w-3"}),"Experimental"]})]}),(0,e.jsxs)("div",{className:"flex items-center gap-4",children:[ie?(0,e.jsxs)("span",{className:"text-xs text-muted-foreground",children:["Today: ",z(Y.tokens)," · ~",W(Y.cents)]}):null,(0,e.jsxs)(q,{onClick:s(()=>l(!0),"onClick"),disabled:!t,children:[(0,e.jsx)(Ft,{className:"h-4 w-4"}),"New card"]})]})]}),p?(0,e.jsx)(fe,{tone:"warning",title:"Heads up",children:p}):null,S.kind==="loading"||S.kind==="reconnecting"?(0,e.jsxs)("div",{className:"flex items-center gap-2 py-12 text-sm text-muted-foreground",children:[(0,e.jsx)(_,{className:"h-4 w-4 animate-spin"})," Loading cards…"]}):S.kind==="error"?(0,e.jsx)(We,{error:S.error,action:"load status cards",onRetry:S.retry,retrying:S.isFetching}):T.length===0?(0,e.jsx)(Bt,{icon:Be,title:"No status cards yet",message:"Create a card to keep a living summary of the issues you care about.",action:t?"New card":void 0,onAction:s(()=>l(!0),"onAction")}):(0,e.jsx)("div",{className:"grid gap-4 sm:grid-cols-2",children:T.map(u=>(0,e.jsx)(hs,{card:u,companyId:t,onOpen:s(()=>M(u.id),"onOpen"),onRefresh:s(()=>K.mutate(u.id),"onRefresh"),onRecompile:s(()=>se.mutate(u.id),"onRecompile"),onEditInterest:s(()=>M(u.id,"settings"),"onEditInterest"),onOpenDebug:s(()=>M(u.id,"settings"),"onOpenDebug"),onArchive:s(()=>be.mutate(u.id),"onArchive"),refreshPending:K.isPending&&K.variables===u.id,recompilePending:se.isPending&&se.variables===u.id},u.id))}),j.length>0?(0,e.jsxs)("div",{className:"space-y-3 pt-2",children:[(0,e.jsx)("button",{type:"button",onClick:s(()=>x(u=>!u),"onClick"),className:"text-xs text-muted-foreground underline-offset-2 hover:text-foreground hover:underline",children:c?"Hide archived":`Show archived (${j.length})`}),c?j.map(u=>(0,e.jsx)(xs,{card:u,onView:s(()=>M(u.id),"onView"),onRestore:s(()=>D.mutate(u.id),"onRestore"),restorePending:D.isPending&&D.variables===u.id},u.id)):null]}):null,t?(0,e.jsx)(gs,{companyId:t,open:f,onOpenChange:l}):null,(0,e.jsx)(Ns,{card:v,companyId:t,open:!!d,onOpenChange:s(u=>u?void 0:A(),"onOpenChange"),initialTab:y})]})}s(zs,"StatusCards");export{zs as StatusCards,zs as default};
@@ -1 +1 @@
1
- var ke=Object.defineProperty;var n=(s,d)=>ke(s,"name",{value:d,configurable:!0});import{a as ue}from"./rolldown-runtime-DhZMWcEn.js";import{$A as we,$S as Se,Ap as re,BC as _e,EC as ie,GS as u,Gb as Z,HC as Ce,H_ as G,Hn as Re,Kv as Ae,ME as me,Mp as Ee,NE as b,Np as Te,Op as Le,Pp as Pe,QE as le,RT as Ie,WE as J,_w as L,ab as xe,as as qe,bE as ee,cv as ze,dy as Be,fy as Me,hE as De,iD as Ke,kp as $e,ly as Fe,mT as Qe,my as We,nj as Ge,pm as U,rb as Ue,sy as Oe,uE as O,ub as pe,uy as Ve,x as oe,xE as T,y_ as de,zE as ge}from"./index-Bt31d8ga.js";import{t as He}from"./ConfigureBuiltInAgentModal-BwW7XQ1O.js";import{t as Ye}from"./useSummaryDraftStream-DPQRvaXT.js";var e=ue(we(),1);function Xe(s){return s==="blocked"?"border-destructive/30 bg-destructive/5 text-destructive":s==="ready_with_warnings"?"border-amber-500/30 bg-amber-500/10 text-amber-800 dark:text-amber-300":"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300"}n(Xe,"readinessTone");function ms({workspaceId:s,workspaceName:d,currentStatus:l,open:c,onOpenChange:m,onClosed:P}){const R=me(),{pushToast:N}=ze(),A=l==="cleanup_failed"?"Retry close":"Close workspace",p=T({queryKey:u.executionWorkspaces.closeReadiness(s),queryFn:n(()=>de.getCloseReadiness(s),"queryFn"),enabled:c}),g=pe(p),h=ee({mutationFn:n(()=>de.update(s,{status:"archived"}),"mutationFn"),onSuccess:n(t=>{R.setQueryData(u.executionWorkspaces.detail(t.id),t),R.invalidateQueries({queryKey:u.executionWorkspaces.overview(t.companyId)}),R.invalidateQueries({queryKey:u.executionWorkspaces.closeReadiness(t.id)}),N({title:l==="cleanup_failed"?"Workspace close retried":"Workspace closed",tone:"success"}),m(!1),P?.(t)},"onSuccess"),onError:n(t=>{N({title:"Failed to close workspace",body:De(t).body,tone:"error"})},"onError")}),a=p.data??null,k=a?.linkedIssues.filter(t=>!t.isTerminal)??[],i=a?.linkedIssues.filter(t=>t.isTerminal)??[],E=l==="archived"||h.isPending||p.isLoading||a==null||a.state==="blocked";return(0,e.jsx)(Oe,{open:c,onOpenChange:n(t=>{h.isPending||m(t)},"onOpenChange"),children:(0,e.jsxs)(Fe,{className:"max-h-(--sz-85vh) overflow-y-auto sm:max-w-2xl",children:[(0,e.jsxs)(Me,{children:[(0,e.jsx)(We,{children:A}),(0,e.jsxs)(Ve,{className:"break-words",children:["Archive ",(0,e.jsx)("span",{className:"font-medium text-foreground",children:d})," and clean up any owned workspace artifacts. Microvac keeps the workspace record and task history, but removes it from active workspace views."]})]}),g.kind==="loading"||g.kind==="reconnecting"?(0,e.jsxs)("div",{className:"flex items-center gap-2 rounded-xl border border-border bg-background px-4 py-3 text-sm text-muted-foreground",children:[(0,e.jsx)(L,{className:"h-4 w-4 animate-spin"}),"Checking whether this workspace is safe to close..."]}):g.kind==="error"?(0,e.jsx)(xe,{error:g.error,action:"inspect workspace close readiness",onRetry:g.retry,retrying:g.isFetching}):a?(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsxs)("div",{className:`rounded-xl border px-4 py-3 text-sm ${Xe(a.state)}`,children:[(0,e.jsx)("div",{className:"font-medium",children:a.state==="blocked"?"Close is blocked":a.state==="ready_with_warnings"?"Close is allowed with warnings":"Close is ready"}),(0,e.jsx)("div",{className:"mt-1 text-xs opacity-80",children:a.isSharedWorkspace?"This is a shared workspace session. Archiving it removes this session record but keeps the underlying project workspace.":a.git?.workspacePath&&a.git.repoRoot&&a.git.workspacePath!==a.git.repoRoot?"This execution workspace has its own checkout path and can be archived independently.":a.isProjectPrimaryWorkspace?"This execution workspace currently points at the project's primary workspace path.":"This workspace is disposable and can be archived."})]}),k.length>0?(0,e.jsxs)("section",{className:"space-y-2",children:[(0,e.jsx)("h3",{className:"text-sm font-medium",children:"Blocking tasks"}),(0,e.jsx)("div",{className:"space-y-2",children:k.map(t=>(0,e.jsx)("div",{className:"rounded-xl border border-destructive/20 bg-destructive/5 px-4 py-3 text-sm",children:(0,e.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center justify-between gap-2",children:[(0,e.jsxs)(Z,{to:le(t),className:"min-w-0 break-words font-medium hover:underline",children:[t.identifier??t.id," · ",t.title]}),(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:t.status})]})},t.id))})]}):null,a.blockingReasons.length>0?(0,e.jsxs)("section",{className:"space-y-2",children:[(0,e.jsx)("h3",{className:"text-sm font-medium",children:"Blocking reasons"}),(0,e.jsx)("ul",{className:"space-y-2 text-sm text-muted-foreground",children:a.blockingReasons.map(t=>(0,e.jsx)("li",{className:"break-words rounded-lg border border-destructive/20 bg-destructive/5 px-3 py-2 text-destructive",children:t},t))})]}):null,a.warnings.length>0?(0,e.jsxs)("section",{className:"space-y-2",children:[(0,e.jsx)("h3",{className:"text-sm font-medium",children:"Warnings"}),(0,e.jsx)("ul",{className:"space-y-2 text-sm text-muted-foreground",children:a.warnings.map(t=>(0,e.jsx)("li",{className:"break-words rounded-lg border border-amber-500/20 bg-amber-500/5 px-3 py-2",children:t},t))})]}):null,a.git?(0,e.jsxs)("section",{className:"space-y-2",children:[(0,e.jsx)("h3",{className:"text-sm font-medium",children:"Git status"}),(0,e.jsx)("div",{className:"rounded-xl border border-border bg-background px-4 py-3 text-sm",children:(0,e.jsxs)("div",{className:"grid gap-2 sm:grid-cols-2",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"text-xs uppercase tracking-(--tracking-eyebrow) text-muted-foreground",children:"Branch"}),(0,e.jsx)("div",{className:"font-mono text-xs",children:a.git.branchName??"Unknown"})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"text-xs uppercase tracking-(--tracking-eyebrow) text-muted-foreground",children:"Base ref"}),(0,e.jsx)("div",{className:"font-mono text-xs",children:a.git.baseRef??"Not set"})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"text-xs uppercase tracking-(--tracking-eyebrow) text-muted-foreground",children:"Merged into base"}),(0,e.jsx)("div",{children:a.git.isMergedIntoBase==null?"Unknown":a.git.isMergedIntoBase?"Yes":"No"})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"text-xs uppercase tracking-(--tracking-eyebrow) text-muted-foreground",children:"Ahead / behind"}),(0,e.jsxs)("div",{children:[(a.git.aheadCount??0).toString()," / ",(a.git.behindCount??0).toString()]})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"text-xs uppercase tracking-(--tracking-eyebrow) text-muted-foreground",children:"Dirty tracked files"}),(0,e.jsx)("div",{children:a.git.dirtyEntryCount})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"text-xs uppercase tracking-(--tracking-eyebrow) text-muted-foreground",children:"Untracked files"}),(0,e.jsx)("div",{children:a.git.untrackedEntryCount})]})]})})]}):null,i.length>0?(0,e.jsxs)("section",{className:"space-y-2",children:[(0,e.jsx)("h3",{className:"text-sm font-medium",children:"Other linked tasks"}),(0,e.jsx)("div",{className:"space-y-2",children:i.map(t=>(0,e.jsx)("div",{className:"rounded-xl border border-border bg-background px-4 py-3 text-sm",children:(0,e.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center justify-between gap-2",children:[(0,e.jsxs)(Z,{to:le(t),className:"min-w-0 break-words font-medium hover:underline",children:[t.identifier??t.id," · ",t.title]}),(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:t.status})]})},t.id))})]}):null,a.runtimeServices.length>0?(0,e.jsxs)("section",{className:"space-y-2",children:[(0,e.jsx)("h3",{className:"text-sm font-medium",children:"Attached runtime services"}),(0,e.jsx)("div",{className:"space-y-2",children:a.runtimeServices.map(t=>(0,e.jsxs)("div",{className:"rounded-xl border border-border bg-background px-4 py-3 text-sm",children:[(0,e.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center justify-between gap-2",children:[(0,e.jsx)("span",{className:"font-medium",children:t.serviceName}),(0,e.jsxs)("span",{className:"text-xs text-muted-foreground",children:[t.status," · ",t.lifecycle]})]}),(0,e.jsx)("div",{className:"mt-1 break-words text-xs text-muted-foreground",children:t.url??t.command??"No additional details"})]},t.id))})]}):null,(0,e.jsxs)("section",{className:"space-y-2",children:[(0,e.jsx)("h3",{className:"text-sm font-medium",children:"Cleanup actions"}),(0,e.jsx)("div",{className:"space-y-2",children:a.plannedActions.map((t,z)=>(0,e.jsxs)("div",{className:"rounded-xl border border-border bg-background px-4 py-3 text-sm",children:[(0,e.jsx)("div",{className:"font-medium",children:t.label}),(0,e.jsx)("div",{className:"mt-1 break-words text-muted-foreground",children:t.description}),t.command?(0,e.jsx)("pre",{className:ge("mt-2 whitespace-pre-wrap break-all rounded-lg bg-background px-3 py-2 font-mono text-xs text-foreground",Se),children:t.command}):null]},`${t.kind}-${z}`))})]}),l==="cleanup_failed"?(0,e.jsx)("div",{className:"rounded-xl border border-amber-500/20 bg-amber-500/5 px-4 py-3 text-sm text-muted-foreground",children:"Cleanup previously failed on this workspace. Retrying close will rerun the cleanup flow and update the workspace status if it succeeds."}):null,l==="archived"?(0,e.jsx)("div",{className:"rounded-xl border border-border bg-background px-4 py-3 text-sm text-muted-foreground",children:"This workspace is already archived."}):null,a.git?.repoRoot?(0,e.jsxs)("div",{className:"break-words text-xs text-muted-foreground",children:["Repo root: ",(0,e.jsx)("span",{className:"font-mono break-all",children:a.git.repoRoot}),a.git.workspacePath?(0,e.jsxs)(e.Fragment,{children:[" · ","Workspace path: ",(0,e.jsx)("span",{className:"font-mono break-all",children:a.git.workspacePath})]}):null]}):null,(0,e.jsxs)("div",{className:"text-xs text-muted-foreground",children:["Last checked ",J(new Date(p.dataUpdatedAt))]})]}):null,(0,e.jsxs)(Be,{children:[(0,e.jsx)(b,{variant:"outline",onClick:n(()=>m(!1),"onClick"),disabled:h.isPending,children:"Cancel"}),(0,e.jsxs)(b,{variant:l==="cleanup_failed"?"default":"destructive",onClick:n(()=>h.mutate(),"onClick"),disabled:E,children:[h.isPending?(0,e.jsx)(L,{className:"mr-2 h-4 w-4 animate-spin"}):null,A]})]})]})})}n(ms,"ExecutionWorkspaceCloseDialog");var C=ue(Ge(),1);function V(s,d=""){const l=new URLSearchParams;s.scopeId&&l.set("scopeId",s.scopeId);const c=l.toString();return[`/companies/${s.companyId}/summary-slots/${s.scopeKind}/${s.slotKey}`,d,c?`?${c}`:""].join("")}n(V,"summarySlotPath");var H={get:n(s=>O.get(V(s)),"get"),revisions:n(s=>O.get(V(s,"/revisions")),"revisions"),generate:n(s=>O.post(V(s,"/generate"),{scopeId:s.scopeId??null}),"generate")},Ze="summarizer",Je=new Set(["done","cancelled"]),Y="__latest__",es=30;function ss(s){return s.identifier?`${s.identifier}: ${s.title}`:s.title}n(ss,"issueLabel");function ts(s){return`Rev ${s.revisionNumber}`}n(ts,"revisionLabel");function he(s){return new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hourCycle:"h23"}).format(new Date(s)).replace(",","")}n(he,"formatRevisionTimestamp");function ce(s){return`${ts(s)} - ${he(s.createdAt)}`}n(ce,"revisionOptionLabel");function ns(s,d){return`Latest (Rev ${s.latestRevisionNumber}) - ${he(d?.createdAt??s.updatedAt)}`}n(ns,"latestRevisionOptionLabel");function X(s){return typeof s=="string"&&s.trim().length>0?s.trim():null}n(X,"readPayloadString");function as(s){return s?s.message?s.message:s.lastAssistantSnippet?s.lastAssistantSnippet:s.currentToolName?`Working with ${s.currentToolName}`:null:null}n(as,"resolveGenerationStatusLine");function rs(s){const[d,l]=(0,C.useState)(null);return(0,C.useEffect)(()=>{l(null)},[s]),Re(c=>{if(!s||c.type!=="heartbeat.run.progress")return;const m=c.payload??{};m.issueId===s&&l({message:X(m.message),currentToolName:X(m.currentToolName),lastAssistantSnippet:X(m.lastAssistantSnippet)})}),s?d:null}n(rs,"useGenerationStatus");function is(s){return s&&(s.status==="not_provisioned"||s.status==="needs_setup"||s.status==="pending_approval")?s:null}n(is,"setupState");function xs({companyId:s,scopeKind:d,scopeId:l=null,slotKey:c="header",title:m,description:P,className:R}){const N=me(),[A,p]=(0,C.useState)(null),[g,h]=(0,C.useState)(!1),[a,k]=(0,C.useState)(null),i=s?{companyId:s,scopeKind:d,scopeId:l,slotKey:c}:null,E=T({queryKey:u.instance.experimentalSettings,queryFn:n(()=>Ae.getExperimental(),"queryFn")}),t=E.data?.enableSummaries===!0,z=E.data?.enableBuiltInAgents===!0,w=T({queryKey:u.builtInAgents.list(s??"__none__"),queryFn:n(()=>qe.list(s),"queryFn"),enabled:!!(s&&t&&z)}).data?.find(r=>r.definition.key===Ze),S=is(w),se=i?u.summarySlots.detail(i.companyId,i.scopeKind,i.slotKey,i.scopeId):u.summarySlots.detail("__none__",d,c,l),te=i?u.summarySlots.revisions(i.companyId,i.scopeKind,i.slotKey,i.scopeId):u.summarySlots.revisions("__none__",d,c,l),y=T({queryKey:se,queryFn:n(()=>H.get(i),"queryFn"),enabled:!!(i&&t),refetchInterval:n(r=>r.state.data?.slot?.status==="generating"?3e3:!1,"refetchInterval")}),_=pe(y),B=_.kind==="ready"||_.kind==="stale",fe=T({queryKey:te,queryFn:n(()=>H.revisions(i),"queryFn"),enabled:!!(i&&t&&y.data?.document)}),x=ee({mutationFn:n(()=>H.generate(i),"mutationFn"),onMutate:n(()=>k(null),"onMutate"),onSuccess:n(async()=>{p(null),await Promise.all([N.invalidateQueries({queryKey:se}),N.invalidateQueries({queryKey:te})])},"onSuccess"),onError:n(r=>{k(r instanceof Error?r.message:"Summary generation could not be started.")},"onError")}),M=ee({mutationFn:n(r=>Ue.resume(r,s??void 0),"mutationFn"),onSuccess:n(async()=>{s&&await N.invalidateQueries({queryKey:u.builtInAgents.list(s)})},"onSuccess")}),j=fe.data?.revisions??[],o=y.data?.document??null,D=(0,C.useMemo)(()=>j.find(r=>r.id===A)??null,[j,A]),K=o?j.find(r=>r.id===o.latestRevisionId)??null:null,v=D&&D.id!==o?.latestRevisionId?D:null,be=v?.body??o?.body??"",$=!!v,ne=(o?j.filter(r=>r.id!==o.latestRevisionId):j).toSorted((r,Ne)=>Ne.revisionNumber-r.revisionNumber).slice(0,es-(o?1:0)),ye=v?.id??Y,ae=o?ns(o,K):"Latest",f=y.data?.generatingIssue??null,je=as(rs(f?.id??null)),I=Ye(s,f),F=I.statusLine??je,q=y.data?.slot?.status==="generating"&&f&&!Je.has(f.status),Q=y.data?.slot?.status==="failed",ve=w?.status==="ready";if(E.isLoading||!t)return null;const W=n(()=>{!i||x.isPending||x.mutate()},"startGeneration");return(0,e.jsxs)("section",{className:ge("space-y-4",R),children:[(0,e.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,e.jsxs)("div",{className:"min-w-0 space-y-1",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsx)(ie,{className:"h-4 w-4 text-muted-foreground","aria-hidden":"true"}),(0,e.jsx)("h2",{className:"text-sm font-semibold",children:m}),q?(0,e.jsx)(G,{variant:"secondary",children:"Generating"}):null,$?(0,e.jsx)(G,{variant:"outline",children:"Historical revision"}):null,o&&!$?(0,e.jsx)(G,{variant:"outline",children:"Latest revision"}):null]}),P?(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:P}):null]}),(0,e.jsxs)("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:[$?(0,e.jsx)(b,{type:"button",size:"sm",variant:"outline",onClick:n(()=>p(null),"onClick"),children:"Latest"}):null,o&&!Q?(0,e.jsxs)(b,{type:"button",size:"sm",variant:"outline",onClick:W,disabled:!i||x.isPending||!!q,children:[x.isPending?(0,e.jsx)(L,{className:"animate-spin"}):(0,e.jsx)(Ce,{}),"Refresh"]}):null]})]}),S?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"flex flex-col items-start gap-3 rounded-lg border border-border bg-muted/30 p-4 sm:flex-row sm:items-center sm:justify-between",children:[(0,e.jsxs)("div",{className:"flex items-start gap-3",children:[S.status==="pending_approval"?(0,e.jsx)(Qe,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"}):(0,e.jsx)(Ie,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"}),(0,e.jsxs)("div",{className:"space-y-1 text-sm",children:[(0,e.jsx)("p",{className:"font-medium text-foreground",children:S.status==="pending_approval"?"Summarizer setup is pending approval":"Set up the Summarizer"}),(0,e.jsx)("p",{className:"text-muted-foreground",children:"Summaries are generated by Microvac's built-in Summarizer agent. Configure its adapter and model before requesting this summary."})]})]}),S.status==="pending_approval"?null:(0,e.jsx)(b,{type:"button",size:"sm",onClick:n(()=>h(!0),"onClick"),children:"Set up Summarizer"})]}),s?(0,e.jsx)(He,{companyId:s,state:S,open:g,onOpenChange:h,onConfigured:n(()=>k(null),"onConfigured")}):null]}):null,!S&&w?.status==="paused"&&w.agent?(0,e.jsx)(U,{tone:"warning",title:"Summarizer is paused",actions:(0,e.jsx)(b,{type:"button",size:"sm",onClick:n(()=>w.agent&&M.mutate(w.agent.id),"onClick"),disabled:M.isPending,children:M.isPending?"Resuming...":"Resume agent"}),children:"Existing summaries remain readable, but new summaries will not be generated until the agent resumes."}):null,a?(0,e.jsx)(U,{tone:"warning",title:"Summary request failed",children:a}):null,_.kind==="error"?(0,e.jsx)(xe,{size:"panel",error:_.error,action:"load the summary",onRetry:_.retry,retrying:_.isFetching}):null,B&&Q?(0,e.jsx)(U,{tone:"danger",title:"Summary generation failed",actions:(0,e.jsx)(b,{type:"button",size:"sm",onClick:W,disabled:!i||x.isPending,children:x.isPending?"Retrying...":"Retry"}),children:y.data?.slot?.failureReason??"The generation task ended before writing a summary."}):null,B&&q&&f?(0,e.jsxs)("div",{className:"flex items-start gap-3 text-sm",children:[(0,e.jsx)(L,{className:"mt-0.5 h-4 w-4 shrink-0 animate-spin text-muted-foreground"}),(0,e.jsxs)("div",{className:"min-w-0 space-y-1",children:[(0,e.jsx)("p",{className:"font-medium text-foreground",children:"Generating summary"}),F?(0,e.jsx)("p",{className:"animate-pulse truncate text-muted-foreground","aria-live":"polite","data-testid":"summary-generation-status-line",title:F,children:F}):null,I.draft?(0,e.jsxs)("div",{className:"mt-2 rounded-md border border-border bg-muted/20 p-3","data-testid":"summary-generation-draft","aria-live":"polite",children:[(0,e.jsx)(oe,{className:"text-sm leading-7 text-foreground",children:I.draft}),I.draftClosed?null:(0,e.jsx)("span",{className:"mt-1 inline-block h-4 w-px animate-pulse bg-foreground align-text-bottom","aria-hidden":"true","data-testid":"summary-generation-caret"})]}):null,(0,e.jsxs)("p",{className:"text-muted-foreground",children:["Summarizer is working in"," ",(0,e.jsx)(Z,{className:"underline",to:`/issues/${f.identifier??f.id}`,children:ss(f)}),"."]})]})]}):null,B&&!o&&!q&&!Q&&ve?(0,e.jsxs)("div",{className:"flex flex-col items-start gap-3 rounded-lg border border-border bg-muted/30 p-4 sm:flex-row sm:items-center sm:justify-between",children:[(0,e.jsxs)("div",{className:"space-y-1 text-sm",children:[(0,e.jsx)("p",{className:"font-medium text-foreground",children:"No summary yet"}),(0,e.jsx)("p",{className:"text-muted-foreground",children:"Generate a concise status snapshot for this surface."})]}),(0,e.jsxs)(b,{type:"button",size:"sm",onClick:W,disabled:!i||x.isPending,children:[x.isPending?(0,e.jsx)(L,{className:"animate-spin"}):(0,e.jsx)(ie,{}),x.isPending?"Generating...":"Generate summary"]})]}):null,o?(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsx)(oe,{className:"text-sm leading-7 text-foreground",children:be}),(0,e.jsxs)("div",{className:"flex flex-col gap-3 text-xs text-muted-foreground sm:flex-row sm:items-center sm:justify-between",children:[(0,e.jsxs)("span",{title:J(v?.createdAt??K?.createdAt??o.updatedAt),children:["Updated ",Ke(v?.createdAt??K?.createdAt??o.updatedAt)]}),j.length>1?(0,e.jsxs)(Le,{value:ye,onValueChange:n(r=>{p(r===Y?null:r)},"onValueChange"),children:[(0,e.jsx)(Te,{size:"sm",className:"h-auto border-0 bg-transparent p-0 text-xs shadow-none hover:text-foreground focus-visible:ring-0","aria-label":"Select summary revision",title:v?ce(v):ae,children:(0,e.jsxs)(Pe,{children:[(0,e.jsx)(_e,{className:"size-3.5","aria-hidden":"true"}),(0,e.jsxs)("span",{children:[j.length," revisions"]})]})}),(0,e.jsxs)($e,{align:"end",position:"popper",children:[(0,e.jsx)(re,{value:Y,className:"text-xs",children:ae}),ne.length>0?(0,e.jsx)(Ee,{}):null,ne.map(r=>(0,e.jsx)(re,{value:r.id,className:"text-xs",title:J(r.createdAt),children:ce(r)},r.id))]})]}):null]})]}):null]})}n(xs,"SummarySlotCard");export{ms as n,xs as t};
1
+ var ke=Object.defineProperty;var n=(s,d)=>ke(s,"name",{value:d,configurable:!0});import{a as ue}from"./rolldown-runtime-DhZMWcEn.js";import{$A as we,$S as Se,Ap as re,BC as _e,EC as ie,GS as u,Gb as Z,HC as Ce,H_ as G,Hn as Re,Kv as Ae,ME as me,Mp as Ee,NE as b,Np as Te,Op as Le,Pp as Pe,QE as le,RT as Ie,WE as J,_w as L,ab as xe,as as qe,bE as ee,cv as ze,dy as Be,fy as Me,hE as De,iD as Ke,kp as $e,ly as Fe,mT as Qe,my as We,nj as Ge,pm as U,rb as Ue,sy as Oe,uE as O,ub as pe,uy as Ve,x as oe,xE as T,y_ as de,zE as ge}from"./index-BJtnP7H1.js";import{t as He}from"./ConfigureBuiltInAgentModal-DgeD7t_i.js";import{t as Ye}from"./useSummaryDraftStream-NVNYNt72.js";var e=ue(we(),1);function Xe(s){return s==="blocked"?"border-destructive/30 bg-destructive/5 text-destructive":s==="ready_with_warnings"?"border-amber-500/30 bg-amber-500/10 text-amber-800 dark:text-amber-300":"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300"}n(Xe,"readinessTone");function ms({workspaceId:s,workspaceName:d,currentStatus:l,open:c,onOpenChange:m,onClosed:P}){const R=me(),{pushToast:N}=ze(),A=l==="cleanup_failed"?"Retry close":"Close workspace",p=T({queryKey:u.executionWorkspaces.closeReadiness(s),queryFn:n(()=>de.getCloseReadiness(s),"queryFn"),enabled:c}),g=pe(p),h=ee({mutationFn:n(()=>de.update(s,{status:"archived"}),"mutationFn"),onSuccess:n(t=>{R.setQueryData(u.executionWorkspaces.detail(t.id),t),R.invalidateQueries({queryKey:u.executionWorkspaces.overview(t.companyId)}),R.invalidateQueries({queryKey:u.executionWorkspaces.closeReadiness(t.id)}),N({title:l==="cleanup_failed"?"Workspace close retried":"Workspace closed",tone:"success"}),m(!1),P?.(t)},"onSuccess"),onError:n(t=>{N({title:"Failed to close workspace",body:De(t).body,tone:"error"})},"onError")}),a=p.data??null,k=a?.linkedIssues.filter(t=>!t.isTerminal)??[],i=a?.linkedIssues.filter(t=>t.isTerminal)??[],E=l==="archived"||h.isPending||p.isLoading||a==null||a.state==="blocked";return(0,e.jsx)(Oe,{open:c,onOpenChange:n(t=>{h.isPending||m(t)},"onOpenChange"),children:(0,e.jsxs)(Fe,{className:"max-h-(--sz-85vh) overflow-y-auto sm:max-w-2xl",children:[(0,e.jsxs)(Me,{children:[(0,e.jsx)(We,{children:A}),(0,e.jsxs)(Ve,{className:"break-words",children:["Archive ",(0,e.jsx)("span",{className:"font-medium text-foreground",children:d})," and clean up any owned workspace artifacts. Microvac keeps the workspace record and task history, but removes it from active workspace views."]})]}),g.kind==="loading"||g.kind==="reconnecting"?(0,e.jsxs)("div",{className:"flex items-center gap-2 rounded-xl border border-border bg-background px-4 py-3 text-sm text-muted-foreground",children:[(0,e.jsx)(L,{className:"h-4 w-4 animate-spin"}),"Checking whether this workspace is safe to close..."]}):g.kind==="error"?(0,e.jsx)(xe,{error:g.error,action:"inspect workspace close readiness",onRetry:g.retry,retrying:g.isFetching}):a?(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsxs)("div",{className:`rounded-xl border px-4 py-3 text-sm ${Xe(a.state)}`,children:[(0,e.jsx)("div",{className:"font-medium",children:a.state==="blocked"?"Close is blocked":a.state==="ready_with_warnings"?"Close is allowed with warnings":"Close is ready"}),(0,e.jsx)("div",{className:"mt-1 text-xs opacity-80",children:a.isSharedWorkspace?"This is a shared workspace session. Archiving it removes this session record but keeps the underlying project workspace.":a.git?.workspacePath&&a.git.repoRoot&&a.git.workspacePath!==a.git.repoRoot?"This execution workspace has its own checkout path and can be archived independently.":a.isProjectPrimaryWorkspace?"This execution workspace currently points at the project's primary workspace path.":"This workspace is disposable and can be archived."})]}),k.length>0?(0,e.jsxs)("section",{className:"space-y-2",children:[(0,e.jsx)("h3",{className:"text-sm font-medium",children:"Blocking tasks"}),(0,e.jsx)("div",{className:"space-y-2",children:k.map(t=>(0,e.jsx)("div",{className:"rounded-xl border border-destructive/20 bg-destructive/5 px-4 py-3 text-sm",children:(0,e.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center justify-between gap-2",children:[(0,e.jsxs)(Z,{to:le(t),className:"min-w-0 break-words font-medium hover:underline",children:[t.identifier??t.id," · ",t.title]}),(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:t.status})]})},t.id))})]}):null,a.blockingReasons.length>0?(0,e.jsxs)("section",{className:"space-y-2",children:[(0,e.jsx)("h3",{className:"text-sm font-medium",children:"Blocking reasons"}),(0,e.jsx)("ul",{className:"space-y-2 text-sm text-muted-foreground",children:a.blockingReasons.map(t=>(0,e.jsx)("li",{className:"break-words rounded-lg border border-destructive/20 bg-destructive/5 px-3 py-2 text-destructive",children:t},t))})]}):null,a.warnings.length>0?(0,e.jsxs)("section",{className:"space-y-2",children:[(0,e.jsx)("h3",{className:"text-sm font-medium",children:"Warnings"}),(0,e.jsx)("ul",{className:"space-y-2 text-sm text-muted-foreground",children:a.warnings.map(t=>(0,e.jsx)("li",{className:"break-words rounded-lg border border-amber-500/20 bg-amber-500/5 px-3 py-2",children:t},t))})]}):null,a.git?(0,e.jsxs)("section",{className:"space-y-2",children:[(0,e.jsx)("h3",{className:"text-sm font-medium",children:"Git status"}),(0,e.jsx)("div",{className:"rounded-xl border border-border bg-background px-4 py-3 text-sm",children:(0,e.jsxs)("div",{className:"grid gap-2 sm:grid-cols-2",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"text-xs uppercase tracking-(--tracking-eyebrow) text-muted-foreground",children:"Branch"}),(0,e.jsx)("div",{className:"font-mono text-xs",children:a.git.branchName??"Unknown"})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"text-xs uppercase tracking-(--tracking-eyebrow) text-muted-foreground",children:"Base ref"}),(0,e.jsx)("div",{className:"font-mono text-xs",children:a.git.baseRef??"Not set"})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"text-xs uppercase tracking-(--tracking-eyebrow) text-muted-foreground",children:"Merged into base"}),(0,e.jsx)("div",{children:a.git.isMergedIntoBase==null?"Unknown":a.git.isMergedIntoBase?"Yes":"No"})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"text-xs uppercase tracking-(--tracking-eyebrow) text-muted-foreground",children:"Ahead / behind"}),(0,e.jsxs)("div",{children:[(a.git.aheadCount??0).toString()," / ",(a.git.behindCount??0).toString()]})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"text-xs uppercase tracking-(--tracking-eyebrow) text-muted-foreground",children:"Dirty tracked files"}),(0,e.jsx)("div",{children:a.git.dirtyEntryCount})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"text-xs uppercase tracking-(--tracking-eyebrow) text-muted-foreground",children:"Untracked files"}),(0,e.jsx)("div",{children:a.git.untrackedEntryCount})]})]})})]}):null,i.length>0?(0,e.jsxs)("section",{className:"space-y-2",children:[(0,e.jsx)("h3",{className:"text-sm font-medium",children:"Other linked tasks"}),(0,e.jsx)("div",{className:"space-y-2",children:i.map(t=>(0,e.jsx)("div",{className:"rounded-xl border border-border bg-background px-4 py-3 text-sm",children:(0,e.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center justify-between gap-2",children:[(0,e.jsxs)(Z,{to:le(t),className:"min-w-0 break-words font-medium hover:underline",children:[t.identifier??t.id," · ",t.title]}),(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:t.status})]})},t.id))})]}):null,a.runtimeServices.length>0?(0,e.jsxs)("section",{className:"space-y-2",children:[(0,e.jsx)("h3",{className:"text-sm font-medium",children:"Attached runtime services"}),(0,e.jsx)("div",{className:"space-y-2",children:a.runtimeServices.map(t=>(0,e.jsxs)("div",{className:"rounded-xl border border-border bg-background px-4 py-3 text-sm",children:[(0,e.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center justify-between gap-2",children:[(0,e.jsx)("span",{className:"font-medium",children:t.serviceName}),(0,e.jsxs)("span",{className:"text-xs text-muted-foreground",children:[t.status," · ",t.lifecycle]})]}),(0,e.jsx)("div",{className:"mt-1 break-words text-xs text-muted-foreground",children:t.url??t.command??"No additional details"})]},t.id))})]}):null,(0,e.jsxs)("section",{className:"space-y-2",children:[(0,e.jsx)("h3",{className:"text-sm font-medium",children:"Cleanup actions"}),(0,e.jsx)("div",{className:"space-y-2",children:a.plannedActions.map((t,z)=>(0,e.jsxs)("div",{className:"rounded-xl border border-border bg-background px-4 py-3 text-sm",children:[(0,e.jsx)("div",{className:"font-medium",children:t.label}),(0,e.jsx)("div",{className:"mt-1 break-words text-muted-foreground",children:t.description}),t.command?(0,e.jsx)("pre",{className:ge("mt-2 whitespace-pre-wrap break-all rounded-lg bg-background px-3 py-2 font-mono text-xs text-foreground",Se),children:t.command}):null]},`${t.kind}-${z}`))})]}),l==="cleanup_failed"?(0,e.jsx)("div",{className:"rounded-xl border border-amber-500/20 bg-amber-500/5 px-4 py-3 text-sm text-muted-foreground",children:"Cleanup previously failed on this workspace. Retrying close will rerun the cleanup flow and update the workspace status if it succeeds."}):null,l==="archived"?(0,e.jsx)("div",{className:"rounded-xl border border-border bg-background px-4 py-3 text-sm text-muted-foreground",children:"This workspace is already archived."}):null,a.git?.repoRoot?(0,e.jsxs)("div",{className:"break-words text-xs text-muted-foreground",children:["Repo root: ",(0,e.jsx)("span",{className:"font-mono break-all",children:a.git.repoRoot}),a.git.workspacePath?(0,e.jsxs)(e.Fragment,{children:[" · ","Workspace path: ",(0,e.jsx)("span",{className:"font-mono break-all",children:a.git.workspacePath})]}):null]}):null,(0,e.jsxs)("div",{className:"text-xs text-muted-foreground",children:["Last checked ",J(new Date(p.dataUpdatedAt))]})]}):null,(0,e.jsxs)(Be,{children:[(0,e.jsx)(b,{variant:"outline",onClick:n(()=>m(!1),"onClick"),disabled:h.isPending,children:"Cancel"}),(0,e.jsxs)(b,{variant:l==="cleanup_failed"?"default":"destructive",onClick:n(()=>h.mutate(),"onClick"),disabled:E,children:[h.isPending?(0,e.jsx)(L,{className:"mr-2 h-4 w-4 animate-spin"}):null,A]})]})]})})}n(ms,"ExecutionWorkspaceCloseDialog");var C=ue(Ge(),1);function V(s,d=""){const l=new URLSearchParams;s.scopeId&&l.set("scopeId",s.scopeId);const c=l.toString();return[`/companies/${s.companyId}/summary-slots/${s.scopeKind}/${s.slotKey}`,d,c?`?${c}`:""].join("")}n(V,"summarySlotPath");var H={get:n(s=>O.get(V(s)),"get"),revisions:n(s=>O.get(V(s,"/revisions")),"revisions"),generate:n(s=>O.post(V(s,"/generate"),{scopeId:s.scopeId??null}),"generate")},Ze="summarizer",Je=new Set(["done","cancelled"]),Y="__latest__",es=30;function ss(s){return s.identifier?`${s.identifier}: ${s.title}`:s.title}n(ss,"issueLabel");function ts(s){return`Rev ${s.revisionNumber}`}n(ts,"revisionLabel");function he(s){return new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hourCycle:"h23"}).format(new Date(s)).replace(",","")}n(he,"formatRevisionTimestamp");function ce(s){return`${ts(s)} - ${he(s.createdAt)}`}n(ce,"revisionOptionLabel");function ns(s,d){return`Latest (Rev ${s.latestRevisionNumber}) - ${he(d?.createdAt??s.updatedAt)}`}n(ns,"latestRevisionOptionLabel");function X(s){return typeof s=="string"&&s.trim().length>0?s.trim():null}n(X,"readPayloadString");function as(s){return s?s.message?s.message:s.lastAssistantSnippet?s.lastAssistantSnippet:s.currentToolName?`Working with ${s.currentToolName}`:null:null}n(as,"resolveGenerationStatusLine");function rs(s){const[d,l]=(0,C.useState)(null);return(0,C.useEffect)(()=>{l(null)},[s]),Re(c=>{if(!s||c.type!=="heartbeat.run.progress")return;const m=c.payload??{};m.issueId===s&&l({message:X(m.message),currentToolName:X(m.currentToolName),lastAssistantSnippet:X(m.lastAssistantSnippet)})}),s?d:null}n(rs,"useGenerationStatus");function is(s){return s&&(s.status==="not_provisioned"||s.status==="needs_setup"||s.status==="pending_approval")?s:null}n(is,"setupState");function xs({companyId:s,scopeKind:d,scopeId:l=null,slotKey:c="header",title:m,description:P,className:R}){const N=me(),[A,p]=(0,C.useState)(null),[g,h]=(0,C.useState)(!1),[a,k]=(0,C.useState)(null),i=s?{companyId:s,scopeKind:d,scopeId:l,slotKey:c}:null,E=T({queryKey:u.instance.experimentalSettings,queryFn:n(()=>Ae.getExperimental(),"queryFn")}),t=E.data?.enableSummaries===!0,z=E.data?.enableBuiltInAgents===!0,w=T({queryKey:u.builtInAgents.list(s??"__none__"),queryFn:n(()=>qe.list(s),"queryFn"),enabled:!!(s&&t&&z)}).data?.find(r=>r.definition.key===Ze),S=is(w),se=i?u.summarySlots.detail(i.companyId,i.scopeKind,i.slotKey,i.scopeId):u.summarySlots.detail("__none__",d,c,l),te=i?u.summarySlots.revisions(i.companyId,i.scopeKind,i.slotKey,i.scopeId):u.summarySlots.revisions("__none__",d,c,l),y=T({queryKey:se,queryFn:n(()=>H.get(i),"queryFn"),enabled:!!(i&&t),refetchInterval:n(r=>r.state.data?.slot?.status==="generating"?3e3:!1,"refetchInterval")}),_=pe(y),B=_.kind==="ready"||_.kind==="stale",fe=T({queryKey:te,queryFn:n(()=>H.revisions(i),"queryFn"),enabled:!!(i&&t&&y.data?.document)}),x=ee({mutationFn:n(()=>H.generate(i),"mutationFn"),onMutate:n(()=>k(null),"onMutate"),onSuccess:n(async()=>{p(null),await Promise.all([N.invalidateQueries({queryKey:se}),N.invalidateQueries({queryKey:te})])},"onSuccess"),onError:n(r=>{k(r instanceof Error?r.message:"Summary generation could not be started.")},"onError")}),M=ee({mutationFn:n(r=>Ue.resume(r,s??void 0),"mutationFn"),onSuccess:n(async()=>{s&&await N.invalidateQueries({queryKey:u.builtInAgents.list(s)})},"onSuccess")}),j=fe.data?.revisions??[],o=y.data?.document??null,D=(0,C.useMemo)(()=>j.find(r=>r.id===A)??null,[j,A]),K=o?j.find(r=>r.id===o.latestRevisionId)??null:null,v=D&&D.id!==o?.latestRevisionId?D:null,be=v?.body??o?.body??"",$=!!v,ne=(o?j.filter(r=>r.id!==o.latestRevisionId):j).toSorted((r,Ne)=>Ne.revisionNumber-r.revisionNumber).slice(0,es-(o?1:0)),ye=v?.id??Y,ae=o?ns(o,K):"Latest",f=y.data?.generatingIssue??null,je=as(rs(f?.id??null)),I=Ye(s,f),F=I.statusLine??je,q=y.data?.slot?.status==="generating"&&f&&!Je.has(f.status),Q=y.data?.slot?.status==="failed",ve=w?.status==="ready";if(E.isLoading||!t)return null;const W=n(()=>{!i||x.isPending||x.mutate()},"startGeneration");return(0,e.jsxs)("section",{className:ge("space-y-4",R),children:[(0,e.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,e.jsxs)("div",{className:"min-w-0 space-y-1",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsx)(ie,{className:"h-4 w-4 text-muted-foreground","aria-hidden":"true"}),(0,e.jsx)("h2",{className:"text-sm font-semibold",children:m}),q?(0,e.jsx)(G,{variant:"secondary",children:"Generating"}):null,$?(0,e.jsx)(G,{variant:"outline",children:"Historical revision"}):null,o&&!$?(0,e.jsx)(G,{variant:"outline",children:"Latest revision"}):null]}),P?(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:P}):null]}),(0,e.jsxs)("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:[$?(0,e.jsx)(b,{type:"button",size:"sm",variant:"outline",onClick:n(()=>p(null),"onClick"),children:"Latest"}):null,o&&!Q?(0,e.jsxs)(b,{type:"button",size:"sm",variant:"outline",onClick:W,disabled:!i||x.isPending||!!q,children:[x.isPending?(0,e.jsx)(L,{className:"animate-spin"}):(0,e.jsx)(Ce,{}),"Refresh"]}):null]})]}),S?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"flex flex-col items-start gap-3 rounded-lg border border-border bg-muted/30 p-4 sm:flex-row sm:items-center sm:justify-between",children:[(0,e.jsxs)("div",{className:"flex items-start gap-3",children:[S.status==="pending_approval"?(0,e.jsx)(Qe,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"}):(0,e.jsx)(Ie,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"}),(0,e.jsxs)("div",{className:"space-y-1 text-sm",children:[(0,e.jsx)("p",{className:"font-medium text-foreground",children:S.status==="pending_approval"?"Summarizer setup is pending approval":"Set up the Summarizer"}),(0,e.jsx)("p",{className:"text-muted-foreground",children:"Summaries are generated by Microvac's built-in Summarizer agent. Configure its adapter and model before requesting this summary."})]})]}),S.status==="pending_approval"?null:(0,e.jsx)(b,{type:"button",size:"sm",onClick:n(()=>h(!0),"onClick"),children:"Set up Summarizer"})]}),s?(0,e.jsx)(He,{companyId:s,state:S,open:g,onOpenChange:h,onConfigured:n(()=>k(null),"onConfigured")}):null]}):null,!S&&w?.status==="paused"&&w.agent?(0,e.jsx)(U,{tone:"warning",title:"Summarizer is paused",actions:(0,e.jsx)(b,{type:"button",size:"sm",onClick:n(()=>w.agent&&M.mutate(w.agent.id),"onClick"),disabled:M.isPending,children:M.isPending?"Resuming...":"Resume agent"}),children:"Existing summaries remain readable, but new summaries will not be generated until the agent resumes."}):null,a?(0,e.jsx)(U,{tone:"warning",title:"Summary request failed",children:a}):null,_.kind==="error"?(0,e.jsx)(xe,{size:"panel",error:_.error,action:"load the summary",onRetry:_.retry,retrying:_.isFetching}):null,B&&Q?(0,e.jsx)(U,{tone:"danger",title:"Summary generation failed",actions:(0,e.jsx)(b,{type:"button",size:"sm",onClick:W,disabled:!i||x.isPending,children:x.isPending?"Retrying...":"Retry"}),children:y.data?.slot?.failureReason??"The generation task ended before writing a summary."}):null,B&&q&&f?(0,e.jsxs)("div",{className:"flex items-start gap-3 text-sm",children:[(0,e.jsx)(L,{className:"mt-0.5 h-4 w-4 shrink-0 animate-spin text-muted-foreground"}),(0,e.jsxs)("div",{className:"min-w-0 space-y-1",children:[(0,e.jsx)("p",{className:"font-medium text-foreground",children:"Generating summary"}),F?(0,e.jsx)("p",{className:"animate-pulse truncate text-muted-foreground","aria-live":"polite","data-testid":"summary-generation-status-line",title:F,children:F}):null,I.draft?(0,e.jsxs)("div",{className:"mt-2 rounded-md border border-border bg-muted/20 p-3","data-testid":"summary-generation-draft","aria-live":"polite",children:[(0,e.jsx)(oe,{className:"text-sm leading-7 text-foreground",children:I.draft}),I.draftClosed?null:(0,e.jsx)("span",{className:"mt-1 inline-block h-4 w-px animate-pulse bg-foreground align-text-bottom","aria-hidden":"true","data-testid":"summary-generation-caret"})]}):null,(0,e.jsxs)("p",{className:"text-muted-foreground",children:["Summarizer is working in"," ",(0,e.jsx)(Z,{className:"underline",to:`/issues/${f.identifier??f.id}`,children:ss(f)}),"."]})]})]}):null,B&&!o&&!q&&!Q&&ve?(0,e.jsxs)("div",{className:"flex flex-col items-start gap-3 rounded-lg border border-border bg-muted/30 p-4 sm:flex-row sm:items-center sm:justify-between",children:[(0,e.jsxs)("div",{className:"space-y-1 text-sm",children:[(0,e.jsx)("p",{className:"font-medium text-foreground",children:"No summary yet"}),(0,e.jsx)("p",{className:"text-muted-foreground",children:"Generate a concise status snapshot for this surface."})]}),(0,e.jsxs)(b,{type:"button",size:"sm",onClick:W,disabled:!i||x.isPending,children:[x.isPending?(0,e.jsx)(L,{className:"animate-spin"}):(0,e.jsx)(ie,{}),x.isPending?"Generating...":"Generate summary"]})]}):null,o?(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsx)(oe,{className:"text-sm leading-7 text-foreground",children:be}),(0,e.jsxs)("div",{className:"flex flex-col gap-3 text-xs text-muted-foreground sm:flex-row sm:items-center sm:justify-between",children:[(0,e.jsxs)("span",{title:J(v?.createdAt??K?.createdAt??o.updatedAt),children:["Updated ",Ke(v?.createdAt??K?.createdAt??o.updatedAt)]}),j.length>1?(0,e.jsxs)(Le,{value:ye,onValueChange:n(r=>{p(r===Y?null:r)},"onValueChange"),children:[(0,e.jsx)(Te,{size:"sm",className:"h-auto border-0 bg-transparent p-0 text-xs shadow-none hover:text-foreground focus-visible:ring-0","aria-label":"Select summary revision",title:v?ce(v):ae,children:(0,e.jsxs)(Pe,{children:[(0,e.jsx)(_e,{className:"size-3.5","aria-hidden":"true"}),(0,e.jsxs)("span",{children:[j.length," revisions"]})]})}),(0,e.jsxs)($e,{align:"end",position:"popper",children:[(0,e.jsx)(re,{value:Y,className:"text-xs",children:ae}),ne.length>0?(0,e.jsx)(Ee,{}):null,ne.map(r=>(0,e.jsx)(re,{value:r.id,className:"text-xs",title:J(r.createdAt),children:ce(r)},r.id))]})]}):null]})]}):null]})}n(xs,"SummarySlotCard");export{ms as n,xs as t};
@@ -1 +1 @@
1
- var M=Object.defineProperty;var n=(s,l)=>M(s,"name",{value:l,configurable:!0});import{a as k}from"./rolldown-runtime-DhZMWcEn.js";import{$A as L,$S as g,Gb as T,LS as A,ME as z,NE as c,Rp as E,bE as w,hE as f,ib as D,nj as K,oE as R,xE as $,zE as S}from"./index-Bt31d8ga.js";import{n as _,r as j,t as v}from"./useTailscaleConnections-BDff6dWx.js";import{t as F}from"./useAuthorizationWindow-DnFQsiFj.js";var h=k(K(),1),e=k(L(),1);function Q({connection:s,cancel:l,disabled:d}){const o=z(),[t,m]=(0,h.useState)(!1),r=$({queryKey:["tailscale-device-login",s.companyId,s.id],queryFn:n(()=>j.deviceLogin(s.companyId,s.id),"queryFn"),gcTime:0,refetchInterval:n(i=>t||i.state.error||i.state.data?.connection.status!=="authorizing"?!1:2e3,"refetchInterval"),refetchOnWindowFocus:!t});return(0,h.useEffect)(()=>{const i=r.data?.connection;!i||i.status==="authorizing"||o.setQueryData(v(s.companyId),x=>x?.map(u=>u.id===i.id?i:u))},[r.data,o,s.companyId]),(0,h.useEffect)(()=>{const i=r.data?.expiresAt?Date.parse(r.data.expiresAt):Date.now()+6e5,x=window.setTimeout(()=>m(!0),Math.max(0,i-Date.now()));return()=>window.clearTimeout(x)},[r.data?.expiresAt]),(0,e.jsxs)("div",{className:"space-y-3",children:[(0,e.jsx)("p",{className:"text-sm text-muted-foreground",role:"status",children:t?"Sign-in expired. Cancel and connect again.":r.data?.needsApproval?"Waiting for a Tailscale administrator to approve this device.":"Approve the connection in Tailscale. This page will update when you finish."}),r.error&&(0,e.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:f(r.error,{action:"check Tailscale sign-in"}).body}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[!t&&r.data?.authorizationUrl&&(0,e.jsx)(c,{variant:"outline",asChild:!0,children:(0,e.jsx)("a",{href:r.data.authorizationUrl,target:"_blank",rel:"noopener noreferrer",children:"Continue to Tailscale"})}),r.data?.needsApproval&&!t&&(0,e.jsx)(c,{variant:"outline",asChild:!0,children:(0,e.jsx)("a",{href:"https://login.tailscale.com/admin/machines",target:"_blank",rel:"noopener noreferrer",children:"Open Tailscale devices"})}),r.error&&!t&&(0,e.jsx)(c,{variant:"outline",onClick:n(()=>{r.refetch()},"onClick"),children:"Check again"}),(0,e.jsx)(c,{variant:"ghost",disabled:d,onClick:l,children:"Cancel sign-in"})]})]})}n(Q,"TailscaleDeviceSignIn");var U="/apps/tailscale";function G({onNavigate:s}){const{selectedCompanyId:l}=A(),d=_(l),o=d.data?.filter(t=>t.status==="connected")??[];return d.canManage?(0,e.jsxs)("div",{role:"listitem","data-app-slug":"tailscale","data-connected":String(o.length>0),className:"overflow-hidden rounded-xl border border-border",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-3 px-4 py-4",children:[(0,e.jsx)(E,{name:"Tailscale",brandKey:"tailscale",size:36}),(0,e.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,e.jsx)("h2",{className:"text-sm font-semibold text-foreground",children:"Tailscale"}),(0,e.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:"Connect your tailnet to use its machines in SSH environments."})]}),(0,e.jsx)(c,{type:"button",size:"sm",variant:"outline",onClick:n(()=>s(U),"onClick"),"aria-label":`${o.length?"Manage":"Connect"} Tailscale`,children:o.length?"Manage":"Connect"})]}),o.length>0&&(0,e.jsxs)("p",{className:"border-t border-border px-4 py-3 text-sm text-muted-foreground",children:[(0,e.jsx)("span",{className:"ph-mask ph-sensitive",children:o.map(t=>t.name).join(", ")})," · Connected"]}),d.error&&(0,e.jsx)("p",{role:"alert",className:"border-t border-border px-4 py-3 text-sm text-destructive",children:f(d.error,{action:"load Tailscale connections"}).body})]}):null}n(G,"TailscaleConnectorCard");function Y(){const{selectedCompanyId:s}=A(),{setBreadcrumbs:l}=D(),d=z(),[o]=R(),t=_(s),m=F(),r=(0,h.useRef)(s);r.current=s;const i=w({mutationFn:n(async a=>{const p=await j.connect(a.companyId,a.connectionId);d.setQueryData(v(a.companyId),I=>[...(I??[]).filter(P=>P.id!==p.connection.id),p.connection]),r.current===a.companyId&&(p.authorizationUrl?await m.open(p.authorizationUrl):m.cancel())},"mutationFn"),onError:n(()=>m.cancel(),"onError")}),x=n(a=>{s&&(m.reserve(),i.mutate({companyId:s,connectionId:a}))},"start"),u=w({mutationFn:n(a=>j.disconnect(s,a),"mutationFn"),onSuccess:n(()=>(m.cancel(),d.invalidateQueries({queryKey:v(s)})),"onSuccess")});if((0,h.useEffect)(()=>m.cancel,[s,m.cancel]),(0,h.useEffect)(()=>(l([{label:"Connectors",href:"/apps"},{label:"Tailscale"}]),()=>l([])),[l]),!s)return(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Select an organization to connect Tailscale."});if(t.access.isPending)return(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Checking Tailscale management access…"});if(t.access.error)return(0,e.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:f(t.access.error,{action:"check Tailscale management access"}).body});if(!t.canManage)return(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Ask an instance administrator to connect or manage Tailscale networks."});const y=i.error??u.error??t.error,b=o.get("tailscale_error"),C=b==="cancelled"?"Tailscale authorization was canceled. Try again to connect your network.":b==="failed"?"Tailscale authorization could not be completed. Try again.":null,N=t.data?.find(a=>a.id===o.get("tailscale_connection"));return(0,e.jsxs)("div",{className:"max-w-3xl space-y-6 pb-8",children:[(0,e.jsxs)("header",{className:"flex items-center gap-3",children:[(0,e.jsx)(E,{name:"Tailscale",brandKey:"tailscale",size:36}),(0,e.jsx)("h1",{className:"text-xl font-semibold",children:"Tailscale"})]}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Give Microvac access to your tailnet, then choose one of its machines when creating an SSH environment. Agents can use any harness supported by that environment."}),t.isPending&&(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading tailnet connections…"}),C&&(0,e.jsxs)("div",{role:"alert",className:"space-y-3",children:[(0,e.jsx)("p",{className:"text-sm text-destructive",children:C}),N&&(0,e.jsx)(c,{variant:"outline",disabled:i.isPending,onClick:n(()=>x(N.id),"onClick"),children:"Try again"})]}),y&&(0,e.jsxs)("div",{role:"alert",className:"space-y-3",children:[(0,e.jsx)("p",{className:"text-sm text-destructive",children:f(y,{action:"connect Tailscale"}).body}),(0,e.jsx)(c,{variant:"outline",onClick:n(()=>{t.refetch()},"onClick"),children:"Refresh connections"})]}),(0,e.jsx)("div",{className:S("divide-y divide-border",g),children:(t.data??[]).map(a=>(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)("p",{className:S("font-medium",g),children:a.name}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:a.status==="connected"?"Connected":a.status==="authorizing"?"Waiting for sign-in":a.status==="connecting"?"Connecting":a.status==="disconnected"?"Disconnected":a.status==="expired"?"Sign-in expired":"Authorization not completed"})]}),a.status==="connected"?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(c,{variant:"outline",asChild:!0,children:(0,e.jsx)(T,{to:`/company/settings/instance/environments/new?tailscale_connection=${encodeURIComponent(a.id)}`,children:"Create SSH environment"})}),(0,e.jsxs)(c,{variant:"ghost",disabled:u.isPending,onClick:n(()=>u.mutate(a.id),"onClick"),children:["Disconnect ",(0,e.jsx)("span",{className:g,children:a.name})]})]}):a.status==="authorizing"?(0,e.jsx)(Q,{connection:a,cancel:n(()=>u.mutate(a.id),"cancel"),disabled:u.isPending},`${s}:${a.id}`):(0,e.jsxs)(c,{variant:"outline",disabled:i.isPending,onClick:n(()=>x(a.id),"onClick"),children:["Reconnect ",(0,e.jsx)("span",{className:g,children:a.name})]})]},a.id))}),(0,e.jsxs)("footer",{className:"flex items-center justify-between gap-3 border-t border-border pt-4",children:[(0,e.jsx)(c,{variant:"ghost",asChild:!0,children:(0,e.jsx)(T,{to:"/apps",children:"Back to connectors"})}),(0,e.jsx)(c,{disabled:i.isPending||t.isError||t.data?.some(a=>a.status==="authorizing"),onClick:n(()=>x(),"onClick"),children:i.isPending?"Connecting…":"Connect Tailscale Network"})]})]})}n(Y,"TailscaleConnector");export{Y as TailscaleConnector,G as TailscaleConnectorCard};
1
+ var M=Object.defineProperty;var n=(s,l)=>M(s,"name",{value:l,configurable:!0});import{a as k}from"./rolldown-runtime-DhZMWcEn.js";import{$A as L,$S as g,Gb as T,LS as A,ME as z,NE as c,Rp as E,bE as w,hE as f,ib as D,nj as K,oE as R,xE as $,zE as S}from"./index-BJtnP7H1.js";import{n as _,r as j,t as v}from"./useTailscaleConnections-Dy52nCY3.js";import{t as F}from"./useAuthorizationWindow-tg3aKEU7.js";var h=k(K(),1),e=k(L(),1);function Q({connection:s,cancel:l,disabled:d}){const o=z(),[t,m]=(0,h.useState)(!1),r=$({queryKey:["tailscale-device-login",s.companyId,s.id],queryFn:n(()=>j.deviceLogin(s.companyId,s.id),"queryFn"),gcTime:0,refetchInterval:n(i=>t||i.state.error||i.state.data?.connection.status!=="authorizing"?!1:2e3,"refetchInterval"),refetchOnWindowFocus:!t});return(0,h.useEffect)(()=>{const i=r.data?.connection;!i||i.status==="authorizing"||o.setQueryData(v(s.companyId),x=>x?.map(u=>u.id===i.id?i:u))},[r.data,o,s.companyId]),(0,h.useEffect)(()=>{const i=r.data?.expiresAt?Date.parse(r.data.expiresAt):Date.now()+6e5,x=window.setTimeout(()=>m(!0),Math.max(0,i-Date.now()));return()=>window.clearTimeout(x)},[r.data?.expiresAt]),(0,e.jsxs)("div",{className:"space-y-3",children:[(0,e.jsx)("p",{className:"text-sm text-muted-foreground",role:"status",children:t?"Sign-in expired. Cancel and connect again.":r.data?.needsApproval?"Waiting for a Tailscale administrator to approve this device.":"Approve the connection in Tailscale. This page will update when you finish."}),r.error&&(0,e.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:f(r.error,{action:"check Tailscale sign-in"}).body}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[!t&&r.data?.authorizationUrl&&(0,e.jsx)(c,{variant:"outline",asChild:!0,children:(0,e.jsx)("a",{href:r.data.authorizationUrl,target:"_blank",rel:"noopener noreferrer",children:"Continue to Tailscale"})}),r.data?.needsApproval&&!t&&(0,e.jsx)(c,{variant:"outline",asChild:!0,children:(0,e.jsx)("a",{href:"https://login.tailscale.com/admin/machines",target:"_blank",rel:"noopener noreferrer",children:"Open Tailscale devices"})}),r.error&&!t&&(0,e.jsx)(c,{variant:"outline",onClick:n(()=>{r.refetch()},"onClick"),children:"Check again"}),(0,e.jsx)(c,{variant:"ghost",disabled:d,onClick:l,children:"Cancel sign-in"})]})]})}n(Q,"TailscaleDeviceSignIn");var U="/apps/tailscale";function G({onNavigate:s}){const{selectedCompanyId:l}=A(),d=_(l),o=d.data?.filter(t=>t.status==="connected")??[];return d.canManage?(0,e.jsxs)("div",{role:"listitem","data-app-slug":"tailscale","data-connected":String(o.length>0),className:"overflow-hidden rounded-xl border border-border",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-3 px-4 py-4",children:[(0,e.jsx)(E,{name:"Tailscale",brandKey:"tailscale",size:36}),(0,e.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,e.jsx)("h2",{className:"text-sm font-semibold text-foreground",children:"Tailscale"}),(0,e.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:"Connect your tailnet to use its machines in SSH environments."})]}),(0,e.jsx)(c,{type:"button",size:"sm",variant:"outline",onClick:n(()=>s(U),"onClick"),"aria-label":`${o.length?"Manage":"Connect"} Tailscale`,children:o.length?"Manage":"Connect"})]}),o.length>0&&(0,e.jsxs)("p",{className:"border-t border-border px-4 py-3 text-sm text-muted-foreground",children:[(0,e.jsx)("span",{className:"ph-mask ph-sensitive",children:o.map(t=>t.name).join(", ")})," · Connected"]}),d.error&&(0,e.jsx)("p",{role:"alert",className:"border-t border-border px-4 py-3 text-sm text-destructive",children:f(d.error,{action:"load Tailscale connections"}).body})]}):null}n(G,"TailscaleConnectorCard");function Y(){const{selectedCompanyId:s}=A(),{setBreadcrumbs:l}=D(),d=z(),[o]=R(),t=_(s),m=F(),r=(0,h.useRef)(s);r.current=s;const i=w({mutationFn:n(async a=>{const p=await j.connect(a.companyId,a.connectionId);d.setQueryData(v(a.companyId),I=>[...(I??[]).filter(P=>P.id!==p.connection.id),p.connection]),r.current===a.companyId&&(p.authorizationUrl?await m.open(p.authorizationUrl):m.cancel())},"mutationFn"),onError:n(()=>m.cancel(),"onError")}),x=n(a=>{s&&(m.reserve(),i.mutate({companyId:s,connectionId:a}))},"start"),u=w({mutationFn:n(a=>j.disconnect(s,a),"mutationFn"),onSuccess:n(()=>(m.cancel(),d.invalidateQueries({queryKey:v(s)})),"onSuccess")});if((0,h.useEffect)(()=>m.cancel,[s,m.cancel]),(0,h.useEffect)(()=>(l([{label:"Connectors",href:"/apps"},{label:"Tailscale"}]),()=>l([])),[l]),!s)return(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Select an organization to connect Tailscale."});if(t.access.isPending)return(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Checking Tailscale management access…"});if(t.access.error)return(0,e.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:f(t.access.error,{action:"check Tailscale management access"}).body});if(!t.canManage)return(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Ask an instance administrator to connect or manage Tailscale networks."});const y=i.error??u.error??t.error,b=o.get("tailscale_error"),C=b==="cancelled"?"Tailscale authorization was canceled. Try again to connect your network.":b==="failed"?"Tailscale authorization could not be completed. Try again.":null,N=t.data?.find(a=>a.id===o.get("tailscale_connection"));return(0,e.jsxs)("div",{className:"max-w-3xl space-y-6 pb-8",children:[(0,e.jsxs)("header",{className:"flex items-center gap-3",children:[(0,e.jsx)(E,{name:"Tailscale",brandKey:"tailscale",size:36}),(0,e.jsx)("h1",{className:"text-xl font-semibold",children:"Tailscale"})]}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Give Microvac access to your tailnet, then choose one of its machines when creating an SSH environment. Agents can use any harness supported by that environment."}),t.isPending&&(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading tailnet connections…"}),C&&(0,e.jsxs)("div",{role:"alert",className:"space-y-3",children:[(0,e.jsx)("p",{className:"text-sm text-destructive",children:C}),N&&(0,e.jsx)(c,{variant:"outline",disabled:i.isPending,onClick:n(()=>x(N.id),"onClick"),children:"Try again"})]}),y&&(0,e.jsxs)("div",{role:"alert",className:"space-y-3",children:[(0,e.jsx)("p",{className:"text-sm text-destructive",children:f(y,{action:"connect Tailscale"}).body}),(0,e.jsx)(c,{variant:"outline",onClick:n(()=>{t.refetch()},"onClick"),children:"Refresh connections"})]}),(0,e.jsx)("div",{className:S("divide-y divide-border",g),children:(t.data??[]).map(a=>(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)("p",{className:S("font-medium",g),children:a.name}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:a.status==="connected"?"Connected":a.status==="authorizing"?"Waiting for sign-in":a.status==="connecting"?"Connecting":a.status==="disconnected"?"Disconnected":a.status==="expired"?"Sign-in expired":"Authorization not completed"})]}),a.status==="connected"?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(c,{variant:"outline",asChild:!0,children:(0,e.jsx)(T,{to:`/company/settings/instance/environments/new?tailscale_connection=${encodeURIComponent(a.id)}`,children:"Create SSH environment"})}),(0,e.jsxs)(c,{variant:"ghost",disabled:u.isPending,onClick:n(()=>u.mutate(a.id),"onClick"),children:["Disconnect ",(0,e.jsx)("span",{className:g,children:a.name})]})]}):a.status==="authorizing"?(0,e.jsx)(Q,{connection:a,cancel:n(()=>u.mutate(a.id),"cancel"),disabled:u.isPending},`${s}:${a.id}`):(0,e.jsxs)(c,{variant:"outline",disabled:i.isPending,onClick:n(()=>x(a.id),"onClick"),children:["Reconnect ",(0,e.jsx)("span",{className:g,children:a.name})]})]},a.id))}),(0,e.jsxs)("footer",{className:"flex items-center justify-between gap-3 border-t border-border pt-4",children:[(0,e.jsx)(c,{variant:"ghost",asChild:!0,children:(0,e.jsx)(T,{to:"/apps",children:"Back to connectors"})}),(0,e.jsx)(c,{disabled:i.isPending||t.isError||t.data?.some(a=>a.status==="authorizing"),onClick:n(()=>x(),"onClick"),children:i.isPending?"Connecting…":"Connect Tailscale Network"})]})]})}n(Y,"TailscaleConnector");export{Y as TailscaleConnector,G as TailscaleConnectorCard};
@@ -1,4 +1,4 @@
1
- var F=Object.defineProperty;var l=(t,d)=>F(t,"name",{value:d,configurable:!0});import{a as D}from"./rolldown-runtime-DhZMWcEn.js";import{Bt as M,Ht as I,Tt as G,Ut as O,Vt as T,bt as H}from"./issue-detail-4PCbYpdv.js";import{$A as U,JC as $,MT as Y,QT as W,ZC as X,_w as J,aw as Q,cT as Z,gT as ee,nj as te,qC as ae,tl as se,zC as q,zE as N}from"./index-Bt31d8ga.js";var B={name:"grip-horizontal",size:24,node:[["circle",{cx:"12",cy:"9",r:"1",key:"124mty"}],["circle",{cx:"19",cy:"9",r:"1",key:"1ruzo2"}],["circle",{cx:"5",cy:"9",r:"1",key:"1a8b28"}],["circle",{cx:"12",cy:"15",r:"1",key:"1e56xg"}],["circle",{cx:"19",cy:"15",r:"1",key:"1a92ep"}],["circle",{cx:"5",cy:"15",r:"1",key:"5r1jwy"}]]};B.node;var re=W(B),o=D(te(),1),ne=["session-start","human-message","agent-message","thinking","responding","responding-burst","tool-call","diff","working","running","completed","activity-phases","awaiting-approval","plan-todo","interrupted","refused","truncated","live-token-cost"],ie={"session-start":{id:"session-start",label:"Session start",tier:"live",surface:"thread",protocol:'acpx.session → TranscriptEntry kind:"init"'},"human-message":{id:"human-message",label:"Human message",tier:"live",surface:"thread",protocol:'IssueComment authorType:"user"'},"agent-message":{id:"agent-message",label:"Final response",tier:"live",surface:"thread",protocol:'PRP item.delta kind:"agentMessage" channel:"final"'},thinking:{id:"thinking",label:"Thinking",tier:"live",surface:"thread",protocol:"text_delta stream:thought (ACP agent_thought_chunk)"},responding:{id:"responding",label:"Progress update (streaming)",tier:"live",surface:"thread",protocol:'PRP item.delta kind:"agentMessage" channel:"progress"'},"responding-burst":{id:"responding-burst",label:"Progress update burst",tier:"live",surface:"thread",protocol:"text_delta stream:output ×N, tool calls between (PAP-368 dwell)"},"tool-call":{id:"tool-call",label:"Tool call",tier:"live",surface:"thread",protocol:"acpx.tool_call (ACP tool_call / tool_call_update)"},diff:{id:"diff",label:"Diff",tier:"live",surface:"thread",protocol:'ToolCallContent type:"diff" → TranscriptEntry kind:"diff"'},working:{id:"working",label:"Working",tier:"live",surface:"thread",protocol:"heartbeat.run.progress + acpx.status"},running:{id:"running",label:"Running",tier:"live",surface:"thread",protocol:'message.status.type === "running"'},completed:{id:"completed",label:"Completed (collapsed)",tier:"live",surface:"thread",protocol:"acpx.result (StopReason in subtype)"},"activity-phases":{id:"activity-phases",label:"Long-run activity phases",tier:"live",surface:"thread",protocol:"assistant boundaries + chronological tool calls"},"awaiting-approval":{id:"awaiting-approval",label:"Awaiting approval",tier:"tier-b",surface:"thread",protocol:"ACP RequestPermissionRequest + PermissionOptionKind"},"plan-todo":{id:"plan-todo",label:"Plan / todo",tier:"tier-b",surface:"plan",protocol:"ACP Plan { entries: PlanEntry[] }, PlanEntryStatus"},interrupted:{id:"interrupted",label:"Interrupted",tier:"tier-b",surface:"thread",protocol:'AcpRuntimeTurnResult.status:"cancelled" / StopReason "cancelled"'},refused:{id:"refused",label:"Refused",tier:"tier-b",surface:"thread",protocol:'StopReason "refusal"'},truncated:{id:"truncated",label:"Truncated",tier:"tier-b",surface:"thread",protocol:'StopReason "max_tokens" | "max_turn_requests"'},"live-token-cost":{id:"live-token-cost",label:"Live token / cost",tier:"tier-b",surface:"thread",protocol:"ACP UsageUpdate { used, size, cost }"}},K=ne.map(t=>ie[t]),j="Atlas";function k(){return[{id:"m-user-1",kind:"message",author:"human",text:"Add a rate limiter to the login route.",timestamp:"2:31 PM"}]}l(k,"exchangePrefix");var oe={revision:2,updatedAt:"2:33 PM",entries:[{id:"p1",content:"Read the login route and existing middleware",status:"completed",priority:"medium"},{id:"p2",content:"Add a token-bucket rate limiter util",status:"in_progress",priority:"high"},{id:"p3",content:"Wire the limiter into POST /login",status:"pending",priority:"high"},{id:"p4",content:"Add tests for the limit + reset window",status:"pending",priority:"low"}]};function le(t){switch(t){case"session-start":return{surface:"thread",items:[{id:"mk-start",kind:"marker",variant:"session_start",label:"Session started",detail:"claude · Auto mode"},...k()]};case"human-message":return{surface:"thread",items:k()};case"agent-message":return{surface:"thread",items:[...k(),{id:"m-agent-1",kind:"message",author:"agent",authorName:j,agentIcon:"bot",text:"On it — I'll add a token-bucket limiter and wire it into the login route.",timestamp:"2:31 PM"}]};case"thinking":return{surface:"thread",items:[...k(),{id:"turn-thinking",kind:"turn",settled:!1,summary:{toolCount:1,added:0,removed:0},liveStatus:{id:"st-thinking",kind:"status",status:"running",label:"Thinking",startedAtMs:Date.now()-6100,tokens:{used:18240,size:2e5}},items:[{id:"th-grep",kind:"tool",name:"Grep",target:"rateLimit",toolKind:"search",status:"completed"}]}]};case"responding":return{surface:"thread",items:[...k(),{id:"turn-responding",kind:"turn",settled:!1,summary:{toolCount:1,added:0,removed:0},liveStatus:{id:"st-responding",kind:"status",status:"running",label:"Responding",startedAtMs:Date.now()-9300,tokens:{used:18240,size:2e5},selfTalk:"I found an existing ipRateLimit helper, so I'll extend it with a per-account token bucket keyed on the email address instead of adding a second limiter. The bucket refills at six requests a minute, matching the lockout policy the auth spec documents, and failed attempts drain it twice as fast so brute-force runs hit the ceiling quickly while a fat-fingered password barely registers."},items:[{id:"resp-read",kind:"tool",name:"Read",target:"server/src/routes/auth.ts",toolKind:"read",status:"completed"}]}]};case"responding-burst":return{surface:"thread",items:[...k(),{id:"turn-responding-burst",kind:"turn",settled:!1,summary:{toolCount:2,added:0,removed:0},liveStatus:{id:"st-responding-burst",kind:"status",status:"running",label:"Responding",startedAtMs:Date.now()-21400,tokens:{used:18240,size:2e5},selfTalk:`Found the existing ipRateLimit helper — extending it beats adding a second limiter.
1
+ var F=Object.defineProperty;var l=(t,d)=>F(t,"name",{value:d,configurable:!0});import{a as D}from"./rolldown-runtime-DhZMWcEn.js";import{Bt as M,Ht as I,Tt as G,Ut as O,Vt as T,bt as H}from"./issue-detail-CZfjXs0M.js";import{$A as U,JC as $,MT as Y,QT as W,ZC as X,_w as J,aw as Q,cT as Z,gT as ee,nj as te,qC as ae,tl as se,zC as q,zE as N}from"./index-BJtnP7H1.js";var B={name:"grip-horizontal",size:24,node:[["circle",{cx:"12",cy:"9",r:"1",key:"124mty"}],["circle",{cx:"19",cy:"9",r:"1",key:"1ruzo2"}],["circle",{cx:"5",cy:"9",r:"1",key:"1a8b28"}],["circle",{cx:"12",cy:"15",r:"1",key:"1e56xg"}],["circle",{cx:"19",cy:"15",r:"1",key:"1a92ep"}],["circle",{cx:"5",cy:"15",r:"1",key:"5r1jwy"}]]};B.node;var re=W(B),o=D(te(),1),ne=["session-start","human-message","agent-message","thinking","responding","responding-burst","tool-call","diff","working","running","completed","activity-phases","awaiting-approval","plan-todo","interrupted","refused","truncated","live-token-cost"],ie={"session-start":{id:"session-start",label:"Session start",tier:"live",surface:"thread",protocol:'acpx.session → TranscriptEntry kind:"init"'},"human-message":{id:"human-message",label:"Human message",tier:"live",surface:"thread",protocol:'IssueComment authorType:"user"'},"agent-message":{id:"agent-message",label:"Final response",tier:"live",surface:"thread",protocol:'PRP item.delta kind:"agentMessage" channel:"final"'},thinking:{id:"thinking",label:"Thinking",tier:"live",surface:"thread",protocol:"text_delta stream:thought (ACP agent_thought_chunk)"},responding:{id:"responding",label:"Progress update (streaming)",tier:"live",surface:"thread",protocol:'PRP item.delta kind:"agentMessage" channel:"progress"'},"responding-burst":{id:"responding-burst",label:"Progress update burst",tier:"live",surface:"thread",protocol:"text_delta stream:output ×N, tool calls between (PAP-368 dwell)"},"tool-call":{id:"tool-call",label:"Tool call",tier:"live",surface:"thread",protocol:"acpx.tool_call (ACP tool_call / tool_call_update)"},diff:{id:"diff",label:"Diff",tier:"live",surface:"thread",protocol:'ToolCallContent type:"diff" → TranscriptEntry kind:"diff"'},working:{id:"working",label:"Working",tier:"live",surface:"thread",protocol:"heartbeat.run.progress + acpx.status"},running:{id:"running",label:"Running",tier:"live",surface:"thread",protocol:'message.status.type === "running"'},completed:{id:"completed",label:"Completed (collapsed)",tier:"live",surface:"thread",protocol:"acpx.result (StopReason in subtype)"},"activity-phases":{id:"activity-phases",label:"Long-run activity phases",tier:"live",surface:"thread",protocol:"assistant boundaries + chronological tool calls"},"awaiting-approval":{id:"awaiting-approval",label:"Awaiting approval",tier:"tier-b",surface:"thread",protocol:"ACP RequestPermissionRequest + PermissionOptionKind"},"plan-todo":{id:"plan-todo",label:"Plan / todo",tier:"tier-b",surface:"plan",protocol:"ACP Plan { entries: PlanEntry[] }, PlanEntryStatus"},interrupted:{id:"interrupted",label:"Interrupted",tier:"tier-b",surface:"thread",protocol:'AcpRuntimeTurnResult.status:"cancelled" / StopReason "cancelled"'},refused:{id:"refused",label:"Refused",tier:"tier-b",surface:"thread",protocol:'StopReason "refusal"'},truncated:{id:"truncated",label:"Truncated",tier:"tier-b",surface:"thread",protocol:'StopReason "max_tokens" | "max_turn_requests"'},"live-token-cost":{id:"live-token-cost",label:"Live token / cost",tier:"tier-b",surface:"thread",protocol:"ACP UsageUpdate { used, size, cost }"}},K=ne.map(t=>ie[t]),j="Atlas";function k(){return[{id:"m-user-1",kind:"message",author:"human",text:"Add a rate limiter to the login route.",timestamp:"2:31 PM"}]}l(k,"exchangePrefix");var oe={revision:2,updatedAt:"2:33 PM",entries:[{id:"p1",content:"Read the login route and existing middleware",status:"completed",priority:"medium"},{id:"p2",content:"Add a token-bucket rate limiter util",status:"in_progress",priority:"high"},{id:"p3",content:"Wire the limiter into POST /login",status:"pending",priority:"high"},{id:"p4",content:"Add tests for the limit + reset window",status:"pending",priority:"low"}]};function le(t){switch(t){case"session-start":return{surface:"thread",items:[{id:"mk-start",kind:"marker",variant:"session_start",label:"Session started",detail:"claude · Auto mode"},...k()]};case"human-message":return{surface:"thread",items:k()};case"agent-message":return{surface:"thread",items:[...k(),{id:"m-agent-1",kind:"message",author:"agent",authorName:j,agentIcon:"bot",text:"On it — I'll add a token-bucket limiter and wire it into the login route.",timestamp:"2:31 PM"}]};case"thinking":return{surface:"thread",items:[...k(),{id:"turn-thinking",kind:"turn",settled:!1,summary:{toolCount:1,added:0,removed:0},liveStatus:{id:"st-thinking",kind:"status",status:"running",label:"Thinking",startedAtMs:Date.now()-6100,tokens:{used:18240,size:2e5}},items:[{id:"th-grep",kind:"tool",name:"Grep",target:"rateLimit",toolKind:"search",status:"completed"}]}]};case"responding":return{surface:"thread",items:[...k(),{id:"turn-responding",kind:"turn",settled:!1,summary:{toolCount:1,added:0,removed:0},liveStatus:{id:"st-responding",kind:"status",status:"running",label:"Responding",startedAtMs:Date.now()-9300,tokens:{used:18240,size:2e5},selfTalk:"I found an existing ipRateLimit helper, so I'll extend it with a per-account token bucket keyed on the email address instead of adding a second limiter. The bucket refills at six requests a minute, matching the lockout policy the auth spec documents, and failed attempts drain it twice as fast so brute-force runs hit the ceiling quickly while a fat-fingered password barely registers."},items:[{id:"resp-read",kind:"tool",name:"Read",target:"server/src/routes/auth.ts",toolKind:"read",status:"completed"}]}]};case"responding-burst":return{surface:"thread",items:[...k(),{id:"turn-responding-burst",kind:"turn",settled:!1,summary:{toolCount:2,added:0,removed:0},liveStatus:{id:"st-responding-burst",kind:"status",status:"running",label:"Responding",startedAtMs:Date.now()-21400,tokens:{used:18240,size:2e5},selfTalk:`Found the existing ipRateLimit helper — extending it beats adding a second limiter.
2
2
 
3
3
  Wiring a per-account token bucket keyed on the email address, refilling at six requests a minute per the auth spec.
4
4
 
@@ -1 +1 @@
1
- var o=Object.defineProperty;var s=(a,t)=>o(a,"name",{value:t,configurable:!0});import{a as u}from"./rolldown-runtime-DhZMWcEn.js";import{$A as d,IS as l,bt as p}from"./index-Bt31d8ga.js";var r=u(d(),1);function f({issues:a,label:t="Recent tasks",showIdentifier:i=!0,showUpdated:m=!0,issueLinkState:n}){return(0,r.jsx)("ul",{className:"task-summary-list","aria-label":t,children:a.map(e=>(0,r.jsx)("li",{children:(0,r.jsx)(p,{issue:e,presentation:"task",appearance:"refreshed",density:"comfortable",className:"task-summary-row",unreadState:"hidden",showIdentifier:i,trailingMeta:m?l(e.updatedAt):void 0,issueLinkState:n})},e.id))})}s(f,"TaskSummaryList");export{f as t};
1
+ var o=Object.defineProperty;var s=(a,t)=>o(a,"name",{value:t,configurable:!0});import{a as u}from"./rolldown-runtime-DhZMWcEn.js";import{$A as d,IS as l,bt as p}from"./index-BJtnP7H1.js";var r=u(d(),1);function f({issues:a,label:t="Recent tasks",showIdentifier:i=!0,showUpdated:m=!0,issueLinkState:n}){return(0,r.jsx)("ul",{className:"task-summary-list","aria-label":t,children:a.map(e=>(0,r.jsx)("li",{children:(0,r.jsx)(p,{issue:e,presentation:"task",appearance:"refreshed",density:"comfortable",className:"task-summary-row",unreadState:"hidden",showIdentifier:i,trailingMeta:m?l(e.updatedAt):void 0,issueLinkState:n})},e.id))})}s(f,"TaskSummaryList");export{f as t};