@tickernelz/wardmote-ui 2026.1114.2 → 2026.1114.3

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 (140) hide show
  1. package/dist/assets/{ActiveAgentsPanel-Budj8e9v.js → ActiveAgentsPanel-CF0fwsze.js} +1 -1
  2. package/dist/assets/{AdapterManager-DhiW44Eo.js → AdapterManager-DUXWwNxv.js} +1 -1
  3. package/dist/assets/{AdvancedToolsRoute-CICI1XRd.js → AdvancedToolsRoute-BamlkE3p.js} +1 -1
  4. package/dist/assets/{AgentActionButtons-DIhpv51Y.js → AgentActionButtons-CPIhsP04.js} +1 -1
  5. package/dist/assets/{AgentBubbleActionRow-DIr3TdR9.js → AgentBubbleActionRow-BUAUmJKa.js} +1 -1
  6. package/dist/assets/{AgentChat-CeuGtMXr.js → AgentChat-BAn_ghsu.js} +1 -1
  7. package/dist/assets/{AgentChats-CmDtTrMa.js → AgentChats-f73hodzr.js} +1 -1
  8. package/dist/assets/{AgentDefaults-DpYaMGkf.js → AgentDefaults-BL1XYvEo.js} +1 -1
  9. package/dist/assets/{AgentDetail-DFTeFc4-.js → AgentDetail-DthxFfuB.js} +1 -1
  10. package/dist/assets/{AgentTodoCard-DRXZ7hmU.js → AgentTodoCard-BvgkWD0T.js} +1 -1
  11. package/dist/assets/{Agents-CClUUMUq.js → Agents-D5qI6yZZ.js} +3 -3
  12. package/dist/assets/{AppDetail-DfHLFOtj.js → AppDetail-B6PtMl8J.js} +1 -1
  13. package/dist/assets/{AppNotConnected-CcmXbFtD.js → AppNotConnected-C_tGn786.js} +1 -1
  14. package/dist/assets/{ApprovalCard-uT_9D_uH.js → ApprovalCard-DrfZAdGQ.js} +1 -1
  15. package/dist/assets/{ApprovalDetail-CE41WFbd.js → ApprovalDetail-sfPpfdXc.js} +1 -1
  16. package/dist/assets/{ApprovalPayload-_zU9bukt.js → ApprovalPayload-C4F3ItGH.js} +1 -1
  17. package/dist/assets/{Approvals-BXrjqpKc.js → Approvals-DZoMl7_m.js} +1 -1
  18. package/dist/assets/{AppsConnect-DH7aSjtS.js → AppsConnect-D8Gu187f.js} +1 -1
  19. package/dist/assets/{AppsReview-C0Y3SxmZ.js → AppsReview-DokFETm0.js} +1 -1
  20. package/dist/assets/{ArtifactCard-DKUUBZ0K.js → ArtifactCard-BTf2-JIV.js} +1 -1
  21. package/dist/assets/{Artifacts-Bsv5m0aU.js → Artifacts-CK8FaygC.js} +1 -1
  22. package/dist/assets/{AssistantConnection-Dm2PaSeU.js → AssistantConnection-BlKC7jk0.js} +1 -1
  23. package/dist/assets/{AttentionInteractionResolver-CBjNuhYo.js → AttentionInteractionResolver-C2iz6oqT.js} +1 -1
  24. package/dist/assets/{AuditHub-DbUni0O_.js → AuditHub-DMhunMn8.js} +1 -1
  25. package/dist/assets/{BoardChat-CgzCuFIL.js → BoardChat-C4W8JLKB.js} +1 -1
  26. package/dist/assets/{BootstrapSetupUxLab-D-niQCV5.js → BootstrapSetupUxLab-D58OwniR.js} +1 -1
  27. package/dist/assets/{Browse-0bmB5mqw.js → Browse-BDjohBak.js} +1 -1
  28. package/dist/assets/{BudgetPolicyCard-CqFUHqOj.js → BudgetPolicyCard-DfAAgk9Z.js} +1 -1
  29. package/dist/assets/{CaseDetail-DakrB2jI.js → CaseDetail-CL0FC5sG.js} +1 -1
  30. package/dist/assets/{Cases-DXbr4HJt.js → Cases-C-7dXrEt.js} +1 -1
  31. package/dist/assets/{ChatEndpointDetail-BdDKo-Gq.js → ChatEndpointDetail-C-IYAYG8.js} +1 -1
  32. package/dist/assets/{ChatEndpointSetup-BX3iDH7N.js → ChatEndpointSetup-CM3QixMj.js} +1 -1
  33. package/dist/assets/{ChoiceControls-Bu-fd6qI.js → ChoiceControls-3Qpci4yE.js} +1 -1
  34. package/dist/assets/{Companies-FcUNLIkt.js → Companies-97toQ8Cw.js} +1 -1
  35. package/dist/assets/{CompanyAccess-BUcTNg7_.js → CompanyAccess-CKhS1BaS.js} +1 -1
  36. package/dist/assets/{CompanyActivity-ScpRBz1G.js → CompanyActivity-DzNrAyAb.js} +1 -1
  37. package/dist/assets/{CompanyConnections-DMEwbZv7.js → CompanyConnections-ORCH4i3U.js} +1 -1
  38. package/dist/assets/{CompanyEnvironments-EqXhVruZ.js → CompanyEnvironments-DphURbtb.js} +1 -1
  39. package/dist/assets/{CompanyExport-DQ9ffuua.js → CompanyExport-XeVCUcK3.js} +1 -1
  40. package/dist/assets/{CompanyImport-BhuZu4oc.js → CompanyImport-DPKpUaRa.js} +1 -1
  41. package/dist/assets/{CompanySettings-BSkg4ahA.js → CompanySettings-4JQpzuS1.js} +1 -1
  42. package/dist/assets/{CompanySettingsPluginPage-BzZkZqh-.js → CompanySettingsPluginPage-cVvXh0_G.js} +1 -1
  43. package/dist/assets/{CompanySkills-BbA4RKIw.js → CompanySkills-BA_9Ztwj.js} +1 -1
  44. package/dist/assets/{ComposerAddMenu-D9z2INup.js → ComposerAddMenu-DNp4ecG8.js} +1 -1
  45. package/dist/assets/{ConfigureBuiltInAgentModal-BUJPbmWc.js → ConfigureBuiltInAgentModal-CQCHDkl4.js} +1 -1
  46. package/dist/assets/{ConnectionSetupFlow-DKjP5RBZ.js → ConnectionSetupFlow-BaarToKu.js} +1 -1
  47. package/dist/assets/{CopyableGatewayUrl-BZyE_jT9.js → CopyableGatewayUrl-DxQsV7Hr.js} +1 -1
  48. package/dist/assets/{Dashboard--lTwxjV-.js → Dashboard--iaPJqJp.js} +1 -1
  49. package/dist/assets/{DashboardLive-BYyTgF5d.js → DashboardLive-4rGeotay.js} +1 -1
  50. package/dist/assets/{DecisionDateChips-vXwAFdua.js → DecisionDateChips-CJOLtNrJ.js} +1 -1
  51. package/dist/assets/{DecisionModelSettings-NrNERkaW.js → DecisionModelSettings-D-OxKIGP.js} +1 -1
  52. package/dist/assets/{DecisionQueuePage-BaaKuZBi.js → DecisionQueuePage-D-kNFav_.js} +1 -1
  53. package/dist/assets/{DesignGuide-DS6MuXWY.js → DesignGuide-D7486q4b.js} +1 -1
  54. package/dist/assets/{DocumentFrameHeader-DTSqcw4Q.js → DocumentFrameHeader-B61HhahB.js} +1 -1
  55. package/dist/assets/{EmailEndpointSetup-CJFYu2G0.js → EmailEndpointSetup-6OHb9B4q.js} +1 -1
  56. package/dist/assets/{ExecutionWorkspaceDetail-CuD5xWOB.js → ExecutionWorkspaceDetail-BGV-9D5Y.js} +1 -1
  57. package/dist/assets/{FolderControls-B7TWghGc.js → FolderControls-L2RzbfdQ.js} +1 -1
  58. package/dist/assets/{GatewayDetail-xNVOxSIs.js → GatewayDetail-CdXNQ9gD.js} +1 -1
  59. package/dist/assets/{GatewaysList-DsSKLm1h.js → GatewaysList-B0Jq1IRC.js} +1 -1
  60. package/dist/assets/{GoalDetail-oN5pyUUY.js → GoalDetail-D2VhPtvw.js} +1 -1
  61. package/dist/assets/{GoalTree-DaFizciF.js → GoalTree-kFpgH4dA.js} +1 -1
  62. package/dist/assets/{Goals-xgGKfQZi.js → Goals-B-_gq_Qu.js} +1 -1
  63. package/dist/assets/{ImageGalleryModal-CjHED0Lb.js → ImageGalleryModal-DzKBMOnu.js} +1 -1
  64. package/dist/assets/{Inbox-wHhHozfr.js → Inbox-zllmqRcB.js} +1 -1
  65. package/dist/assets/{InstanceAdvanced-Bdf2a4c_.js → InstanceAdvanced-B7tDfjwG.js} +1 -1
  66. package/dist/assets/{InviteLanding-McBYpNeW.js → InviteLanding-brwa_8NC.js} +1 -1
  67. package/dist/assets/{IssueChatLongThreadPerf-DD3RLbBo.js → IssueChatLongThreadPerf-D0HJe6IV.js} +1 -1
  68. package/dist/assets/{IssueChatThread-BN-_8hT8.js → IssueChatThread-CMXzuvrF.js} +1 -1
  69. package/dist/assets/{IssueDetail-CsaD311l.js → IssueDetail-DGdg-mB8.js} +1 -1
  70. package/dist/assets/{IssueDocumentAnnotations-BVdH4RTa.js → IssueDocumentAnnotations-BK-LgExc.js} +1 -1
  71. package/dist/assets/{IssueOutputSection-CDIMRaF0.js → IssueOutputSection-aSyiE1pg.js} +1 -1
  72. package/dist/assets/{IssueRecoveryActionCard-C9qJAHes.js → IssueRecoveryActionCard-vAuL_OEC.js} +1 -1
  73. package/dist/assets/{IssueThreadInteractionCard-BbigJB2U.js → IssueThreadInteractionCard-wFidFTIh.js} +1 -1
  74. package/dist/assets/{Issues-BWoc80Y9.js → Issues-CsmM33z_.js} +1 -1
  75. package/dist/assets/{LiveNowTodoLine-B9oTH2L0.js → LiveNowTodoLine-CP32NNp_.js} +1 -1
  76. package/dist/assets/{ManagedAiConnectionDetails-B0aWUPkf.js → ManagedAiConnectionDetails-Ba0awZ-O.js} +1 -1
  77. package/dist/assets/{McpConnect-Dzf7W2K6.js → McpConnect-CYLP1yLX.js} +1 -1
  78. package/dist/assets/{MembershipAction-oiLtxQm3.js → MembershipAction-CKs7Ua9x.js} +1 -1
  79. package/dist/assets/{ModelsAndProviders-BEb4Z38S.js → ModelsAndProviders-gaR7HDQm.js} +1 -1
  80. package/dist/assets/{NewAgent-C3MxIRJj.js → NewAgent-DBQzvxIr.js} +1 -1
  81. package/dist/assets/{OmpAllSettings-DBtL1qDL.js → OmpAllSettings-B_Knr51Z.js} +1 -1
  82. package/dist/assets/{PipelineSettings-BcAtsehE.js → PipelineSettings-Dl-94FB5.js} +1 -1
  83. package/dist/assets/{Pipelines-CkiYUQS-.js → Pipelines-CY9hGe0h.js} +1 -1
  84. package/dist/assets/{PixelsOffice-BSlctoug.js → PixelsOffice-BgyGZsiV.js} +1 -1
  85. package/dist/assets/{PluginPage-C6Qnf9ka.js → PluginPage-CMA4Ei50.js} +1 -1
  86. package/dist/assets/{PluginSettings-Do37r6Zu.js → PluginSettings-Cm4H1JRT.js} +1 -1
  87. package/dist/assets/{ProfileDetailRoute-DRFQNId6.js → ProfileDetailRoute-BEBctbC6.js} +1 -1
  88. package/dist/assets/{ProfileSettings-BMwLBQDB.js → ProfileSettings-Djo7BLIj.js} +1 -1
  89. package/dist/assets/{ProfileWizardRoute-XnnvzH9S.js → ProfileWizardRoute-DxLujEtD.js} +1 -1
  90. package/dist/assets/{ProjectDetail-BW6Lr4Iq.js → ProjectDetail-CmmdvUHn.js} +1 -1
  91. package/dist/assets/{ProjectWorkspaceDetail-DR4JCa1b.js → ProjectWorkspaceDetail-BsA0hJ-k.js} +1 -1
  92. package/dist/assets/{ProjectWorkspacesContent-CadPZn0k.js → ProjectWorkspacesContent-BNNI_WAk.js} +1 -1
  93. package/dist/assets/{Projects-DLBFbxcj.js → Projects-BTAauZr0.js} +1 -1
  94. package/dist/assets/{PublicIssueSharePage-C9yRZOdP.js → PublicIssueSharePage-DdPjfmD9.js} +1 -1
  95. package/dist/assets/{ReviewQueueCard-CIkiY-Lm.js → ReviewQueueCard-BC6VY8Bc.js} +1 -1
  96. package/dist/assets/{RichWorkProductCard-JGHGU_RI.js → RichWorkProductCard-ClpMt_Bh.js} +1 -1
  97. package/dist/assets/{RoutineDetail-izWzADvA.js → RoutineDetail-BT6_GKnC.js} +1 -1
  98. package/dist/assets/{RoutineRunVariablesDialog-DiT_o5Dm.js → RoutineRunVariablesDialog-D_Mls1sV.js} +1 -1
  99. package/dist/assets/{Routines-CHtabiYj.js → Routines-4LevOfvV.js} +1 -1
  100. package/dist/assets/{ScrollToBottom-pyHLjOjY.js → ScrollToBottom-jItsgDR8.js} +1 -1
  101. package/dist/assets/{Search-yNNB6kys.js → Search-bmcm0_m_.js} +1 -1
  102. package/dist/assets/{Secrets-BOyOk5BF.js → Secrets-DfR1fBAZ.js} +1 -1
  103. package/dist/assets/{SkillSourceTree-M58QwBFF.js → SkillSourceTree--FWKWyF3.js} +1 -1
  104. package/dist/assets/{SkillSources-Cw4PU-Bz.js → SkillSources-jUDjqy5i.js} +1 -1
  105. package/dist/assets/{SkillStudio-Cj_M3ZJa.js → SkillStudio-BsqtUnzF.js} +1 -1
  106. package/dist/assets/{SourceTrustBadge-BZBQe5No.js → SourceTrustBadge-CfBrvKL3.js} +1 -1
  107. package/dist/assets/{StatusCards-DaJdQUN5.js → StatusCards-Dt3zorUZ.js} +1 -1
  108. package/dist/assets/{SummarySlotCard-DlSmN6PL.js → SummarySlotCard-D1C0qH2L.js} +1 -1
  109. package/dist/assets/{TaskChatLab-CU5eA7nX.js → TaskChatLab-B0coUvdp.js} +1 -1
  110. package/dist/assets/{TaskChatMarker-wBVUFL3u.js → TaskChatMarker-C40twVjh.js} +1 -1
  111. package/dist/assets/{TaskChatProtocolCard-D-Dwy2EL.js → TaskChatProtocolCard--bi_tc6i.js} +1 -1
  112. package/dist/assets/{TaskChatThreadView-Crlf9I05.js → TaskChatThreadView-DkzFDrLW.js} +1 -1
  113. package/dist/assets/{TaskDetailRelationsPanel-CkktN1EC.js → TaskDetailRelationsPanel-DZGkinoJ.js} +1 -1
  114. package/dist/assets/{TaskTreeControls-B_ulMOi1.js → TaskTreeControls-DznugVpi.js} +1 -1
  115. package/dist/assets/Terminal-NjEb5-2b.js +1 -0
  116. package/dist/assets/TerminalView-DZxK2Ei5.js +58 -0
  117. package/dist/assets/{TrustPresetSection-DTc1Rj4q.js → TrustPresetSection-CjNwNBo3.js} +1 -1
  118. package/dist/assets/{UserProfile-C6q55R0Q.js → UserProfile-Dujv3qdz.js} +1 -1
  119. package/dist/assets/{WhatNeedsMe-1igJA4gL.js → WhatNeedsMe-C9P2EsqQ.js} +1 -1
  120. package/dist/assets/{Workspaces-rtQKliW0.js → Workspaces-BTgSx9nA.js} +1 -1
  121. package/dist/assets/{connection-owner-CZwxTEuM.js → connection-owner-DL4yKhSt.js} +1 -1
  122. package/dist/assets/dist-ypeTPGg_.js +1 -0
  123. package/dist/assets/dropdown-menu-DEO3mF_E.js +1 -0
  124. package/dist/assets/{environment-variables-editor-CCxeFKKk.js → environment-variables-editor-0qgSPgNN.js} +1 -1
  125. package/dist/assets/{index-DDoARkPG.js → index-3AxqhPET.js} +4 -4
  126. package/dist/assets/index-B5bd7Tk6.css +2 -0
  127. package/dist/assets/{issue-properties-lmRBaUTG.js → issue-properties-B1cYnBDU.js} +1 -1
  128. package/dist/assets/{issue-workspace-selection-4JI2Uh9p.js → issue-workspace-selection-S8UgGgK1.js} +1 -1
  129. package/dist/assets/{pipeline-stage-presentation-BSuBql6K.js → pipeline-stage-presentation-5UBw7nsb.js} +1 -1
  130. package/dist/assets/{shared-DDwmHbeD.js → shared-4LF6wQ38.js} +1 -1
  131. package/dist/assets/{tool-taxonomy-DR7Q8sVs.js → tool-taxonomy-B5zpbkHA.js} +1 -1
  132. package/dist/assets/{transcript-adapter-wiFIjKfq.js → transcript-adapter-C29ZJiU2.js} +1 -1
  133. package/dist/assets/{useSummaryDraftStream-CWOQt25o.js → useSummaryDraftStream-R2Y2bAUU.js} +1 -1
  134. package/dist/index.html +7 -6
  135. package/dist/sw.js +1 -1
  136. package/package.json +1 -1
  137. package/dist/assets/Terminal-Bo-WuezO.js +0 -1
  138. package/dist/assets/TerminalView-AkFY5bLC.js +0 -58
  139. package/dist/assets/dropdown-menu-CqRAF7Oj.js +0 -1
  140. package/dist/assets/index-KZ2bEg2H.css +0 -2
@@ -1,4 +1,4 @@
1
- var Ol=Object.defineProperty;var a=(t,n)=>Ol(t,"name",{value:n,configurable:!0});import{i as Is}from"./rolldown-runtime-ZpX3ckPj.js";import{O as ks,_i as va,gi as El,h as M,hi as Na,l as g,m as Wl,mi as $l,na as _l,pi as Ml,t as Ca,ta as Ll,w as Fl}from"./createLucideIcon-DJi9suAC.js";import{l as Bl}from"./dist-SzpVz8Pd.js";import{a as As,h as Ss}from"./star-BZgQbzhV.js";import{X as Ia,_ as Ce,n as Aa,t as j,v as A}from"./queryKeys-DYV5MhM_.js";import{o as ql}from"./companies-query-D9PxIiMT.js";import{t as Dl}from"./issue-attribution-DfN_3u2W.js";import{n as Ps,t as Rs}from"./IssueDocumentAnnotations-BVdH4RTa.js";import{n as zl,r as Ul}from"./WorkspaceRuntimeControls-T4YUoZvK.js";import{n as Kl}from"./CompanyContext-CSrVsSze.js";import{A as sa,P as Vl,a as Ql,an as jt,at as Hl,ot as It,t as V,v as na,zt as E}from"./router-2UfGeejU.js";import{i as Gl,p as Xl,r as Yl,t as Zl}from"./dropdown-menu-CqRAF7Oj.js";import{i as Jl,n as qe,r as ei,t as ti}from"./tabs-B2Os_leL.js";import{o as aa,r as ra,t as la}from"./popover-BhYHYj7q.js";import{t as si}from"./archive-restore-DeLPtKS0.js";import{t as ni}from"./arrow-right-BL5kYtCZ.js";import{t as yt}from"./arrow-up-right-BLYWl-we.js";import{t as ne}from"./check-Ctsrlfa-.js";import{t as ws}from"./chevron-down-BCvxsWfI.js";import{t as ai}from"./chevron-left-DP4zwC0G.js";import{t as ri}from"./chevron-right-s7L6hXXq.js";import{t as li}from"./circle-question-mark-B1jR2is9.js";import{t as Sa}from"./clock-CzrJT_cP.js";import{A as ii,E as Pa,I as oi,M as ia,N as ci,S as di,T as ui,j as xi,k as mi,n as Ra,t as Ts,x as hi}from"./MarkdownBody-BTjuUgFa.js";import{t as Ta}from"./external-link-nl1b263c.js";import{t as Os}from"./file-text-Cw7ntqRx.js";import{t as pi}from"./file-N19tC0jj.js";import{a as Oa,i as fi,n as gi,o as bi,t as ji}from"./RichWorkProductCard-JGHGU_RI.js";import{t as yi}from"./folder-open-8WDYv4mw.js";import{t as ki}from"./git-pull-request-CdCSG7CL.js";import{r as Ea,t as W}from"./button-CMwV3L1P.js";import{t as vs}from"./plus-C6fnr28l.js";import{t as wi}from"./repeat-DGPKlc5I.js";import{t as oa}from"./rotate-ccw-CQEJ4ewP.js";import{t as vi}from"./triangle-alert-CBVKiaXB.js";import{t as De}from"./user-Ccom_Ph0.js";import{t as Ni}from"./x-DRDFdlYE.js";import{i as Ci,n as Ii,r as Ai,t as Si}from"./tooltip-B5WQ3lq5.js";import{t as se}from"./badge-DuA2EgZC.js";import{t as Pi}from"./Identity-Cv_2a9qJ.js";import{t as ve}from"./AgentAvatar-DgGEobSY.js";import{t as Wa}from"./agents-DmlgUVso.js";import{t as $a}from"./instanceSettings-D8g_QlS-.js";import{u as Ri}from"./inboxArchiveCache-D8QGdg49.js";import{t as Ti}from"./projects-mixWrT5q.js";import{a as Oi,c as Ei,n as Wi,r as $i,s as _i,t as Mi}from"./dialog-CKUblzlR.js";import{t as Li}from"./access-GAosX22P.js";import{i as Fi,r as Bi}from"./assignees-DkQNbPzi.js";import{t as qi}from"./activity-BVYJmFzR.js";import{t as ca}from"./AgentIdentity-I_kB4rMX.js";import{t as Di}from"./textarea-BRPEfJ-g.js";import{t as zi}from"./recent-selections-BnN_nb6Y.js";import{a as Ui,i as Ki,r as Vi,t as Qi}from"./recent-assignees-DmalYaLf.js";import{t as Hi}from"./InlineEntitySelector-v2Q4C8oT.js";import{t as Gi}from"./clipboard-CTLKYvRL.js";import{t as kt}from"./StatusIcon-0GcYXDdN.js";import{_ as Xi,g as Yi,h as Zi,m as da,p as Ji,v as eo}from"./issue-blockers-DLfa24KC.js";import{An as to,Gn as so,Ia as no,In as ua,Kn as ao,Ln as ro,Mn as lo,Ra as io,Rn as xa,Vn as oo,Yn as ma,hr as co,kn as uo,nn as xo,nr as mo,pn as ho,qn as po,tr as ha,zn as fo}from"./index-DDoARkPG.js";import{d as _a,i as go,n as Ma,s as bo,t as jo}from"./ImageGalleryModal-CjHED0Lb.js";import{n as yo,r as ko}from"./TaskDetailRelationsPanel-CkktN1EC.js";import{t as wo}from"./query-placeholder-data-Bg4z2kcq.js";import{i as vo,o as No,p as Co,r as Io,u as Ao}from"./SourceTrustBadge-BZBQe5No.js";import{n as So}from"./runRetryState-BdjK4QQj.js";import{o as Po,s as Ro}from"./issue-output-CU3gasZ1.js";import{t as wt}from"./IssueReferencePill-DAEplgLd.js";import{n as To}from"./review-policy-BL48kYvb.js";import{t as Oo}from"./separator-B2LFqBpM.js";import{n as Eo,t as Wo}from"./issue-workspace-selection-4JI2Uh9p.js";import{o as $o}from"./cases-m9RZ5Cym.js";var La={name:"hard-drive",size:24,node:[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]]};La.node;var _o=Ca(La),Fa={name:"table-2",size:24,node:[["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]]};Fa.node;var Mo=Ca(Fa),e=Is(Ll(),1),d=Is(_l(),1);function Ba(t){const n=A({queryKey:j.issues.workProducts(t??"__none__"),queryFn:a(({signal:x})=>E.listWorkProducts(t,{signal:x,fresh:!0}),"queryFn"),enabled:!!t,refetchOnMount:"always",placeholderData:wo(t??"__none__")}),r=n.data?.filter(x=>x.type==="pull_request")??[],l=!!t&&r.length>0,c=A({queryKey:[...j.issues.workProductPullRequestRefresh(t??"__none__"),r],queryFn:a(({signal:x})=>E.listWorkProducts(t,{refreshPullRequests:!0,signal:x,fresh:!0}),"queryFn"),enabled:l,refetchOnMount:"always"}),o=(0,d.useMemo)(()=>{const x=new Map(c.data?.map(u=>[u.id,u]));return n.data?.map(u=>{const h=x.get(u.id);return u.type!=="pull_request"||!h||new Date(h.updatedAt).getTime()!==new Date(u.updatedAt).getTime()?u:{...u,metadata:h.metadata}})},[n.data,c.data]);return{...n,data:o,isFetching:n.isFetching||c.isFetching,isError:n.isError||c.isError,error:n.error??c.error,refetch:a(async()=>{await Promise.all([n.refetch(),...l?[c.refetch()]:[]])},"refetch")}}a(Ba,"useIssueWorkProducts");var pa=Is(Bl(),1);function qa(t){return A({queryKey:[...j.issues.documents(t??""),"plan"],enabled:!!t&&!t?.startsWith("chat:"),queryFn:a(async()=>{try{return await E.getDocument(t,"plan")}catch(n){if(n instanceof Aa&&n.status===404)return null;throw n}},"queryFn")})}a(qa,"useIssuePlanDocument");function Lo(t){return t.createdByAgentId?!0:!t.createdByUserId&&!t.issueCommentId}a(Lo,"isAgentAttachment");function Fo(t){const n=new Set;for(const r of t??[]){const l=Na(r);l&&n.add(l.attachmentId)}return n}a(Fo,"getAttachmentBackedWorkProductAttachmentIds");function Da(t,n){const r=Fo(n);return(t??[]).filter(l=>Lo(l)&&!r.has(l.id))}a(Da,"selectAgentArtifactAttachments");function za(t){if(t.url)return t.url;const n=t.metadata;if(!n)return null;for(const r of["openPath","url"]){const l=n[r];if(typeof l=="string"&&l.trim().length>0)return l}return null}a(za,"workProductHref");function Bo(t){if(t.title?.trim())return t.title;const n=t.key.replace(/[-_]+/g," ").trim();return n.charAt(0).toUpperCase()+n.slice(1)}a(Bo,"documentDisplayTitle");var vt=new Set(["merged","closed","archived"]);function Nt(t){return vt.has(t.status)?t.status:typeof t.metadata?.state=="string"?t.metadata.state:t.status}a(Nt,"pullRequestState");function Ns(t){const n=Nt(t);return!vt.has(n)&&n!=="changes_requested"&&t.reviewState==="needs_board_review"}a(Ns,"pullRequestNeedsReview");function At(t){const n=za(t);if(!n)return null;try{const r=new URL(n);return!["http:","https:"].includes(r.protocol)||r.username||r.password?null:r.href}catch{return null}}a(At,"pullRequestHref");function qo(t){const n=At(t);if(n){const r=new URL(n),l=r.pathname.match(/^\/([^/]+)\/([^/]+)\/pull\/(\d+)\/?$/);if(r.hostname==="github.com"&&l)return`${l[1]}/${l[2]}#${l[3]}`}return t.title}a(qo,"pullRequestLabel");function Ue(t){if(!t)return null;try{const n=new URL(t);if(!["http:","https:"].includes(n.protocol)||n.username||n.password)return null;const r=n.pathname.match(/^\/([^/]+)\/([^/]+)\/pull\/(\d+)(?:\/|$)/);return n.hostname==="github.com"&&!n.port&&r?`github.com/${r[1].toLowerCase()}/${r[2].toLowerCase()}/pull/${Number(r[3])}`:n.href}catch{return null}}a(Ue,"pullRequestIdentity");function Do(t){const n=(t??[]).filter(l=>l.type==="pull_request").sort((l,c)=>new Date(c.updatedAt).getTime()-new Date(l.updatedAt).getTime()||Number(vt.has(Nt(c)))-Number(vt.has(Nt(l)))),r=new Set;return n.filter(l=>{const c=Ue(At(l))??l.id;return r.has(c)?!1:(r.add(c),!0)}).sort((l,c)=>Number(Ns(c))-Number(Ns(l))||Number(c.isPrimary)-Number(l.isPrimary))}a(Do,"getIssuePullRequests");function zo({products:t,externalObjects:n=[]}){return(0,e.jsx)("ul",{className:"flex min-w-0 flex-col gap-2",children:t.map(r=>{const l=At(r),c=qo(r),o=Nt(r),x=Ue(l),u=x?n.find(w=>Ue(w.url)===x):void 0,h=u?Pa(u):null,b=u?.liveness==="fresh"&&(u.statusIconKey==="git-merge"||["merged","closed"].includes(h?.toLowerCase()??""));return(0,e.jsxs)("li",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[l?(0,e.jsx)("a",{href:l,target:"_blank",rel:"noopener noreferrer",title:r.title,className:"break-words text-sm text-accent underline-offset-2 hover:underline",children:c}):(0,e.jsxs)("span",{className:"break-words text-sm",children:[c," · No PR link provided"]}),u?(0,e.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs text-ink-3","data-external-status":u.statusCategory,"data-external-liveness":u.liveness,children:[(0,e.jsx)(Ra,{category:u.statusCategory,liveness:u.liveness,statusIconKey:u.statusIconKey,label:h}),(0,e.jsxs)("span",{children:[h,["fresh","unknown"].includes(u.liveness)?"":` (${ii(u.liveness)})`]})]}):null,Ns(r)&&!b?(0,e.jsx)(se,{variant:"outline",children:"Review requested"}):["merged","closed","archived","draft","changes_requested"].includes(o)&&h?.toLowerCase()!==o?(0,e.jsxs)("span",{className:"text-xs text-ink-3",children:[u?"Saved: ":"",o.replaceAll("_"," ")]}):null]},r.id)})})}a(zo,"IssuePullRequestLinks");function Ua(t){return A({queryKey:[...j.issues.documents(t??""),"list"],enabled:!!t&&!t?.startsWith("chat:"),queryFn:a(()=>E.listDocuments(t),"queryFn")})}a(Ua,"useIssueDocuments");function Uo(t){const n=(0,d.useMemo)(()=>ro(t),[t]),r=(0,d.useRef)(!1);return(0,d.useEffect)(()=>{if(n.success||r.current)return;r.current=!0;const l=n.error.issues[0]?.path[0];xo(new Error(`Invalid task execution policy (${l==="stages"?"stages":l==="monitor"?"monitor":l==="authorizationPolicy"?"authorization":l==="reviewPreset"?"review_preset":"policy"})`))},[n]),n}a(Uo,"useExecutionPolicy");function Ko({status:t}){return t==="completed"?(0,e.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-sm border border-emerald-500/50 bg-emerald-500/10 px-2 py-0.5 text-(length:--text-micro) font-medium text-emerald-900 dark:text-emerald-100",children:[(0,e.jsx)(As,{className:"h-3 w-3"}),"Completed"]}):(0,e.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-sm border border-amber-500/50 bg-amber-500/10 px-2 py-0.5 text-(length:--text-micro) font-medium text-amber-900 dark:text-amber-100",children:[(0,e.jsx)(Ea,{className:"h-3 w-3 animate-spin"}),"In flight"]})}a(Ko,"StatusBadge");function Vo({issueId:t,issueIdentifier:n,agentMap:r}){const{data:l}=A({queryKey:j.issues.acceptedPlanDecompositions(t),queryFn:a(()=>E.listAcceptedPlanDecompositions(t),"queryFn")}),c=(0,d.useMemo)(()=>l??[],[l]);return c.length===0?null:(0,e.jsxs)("div",{className:"space-y-3",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,e.jsx)("h3",{className:"text-sm font-medium text-ink-3",children:"Plan decomposition"}),(0,e.jsx)("span",{className:"text-(length:--text-micro) text-ink-3/80",children:c.length===1?"1 accepted plan revision":`${c.length} accepted plan revisions`})]}),(0,e.jsx)("ul",{className:"space-y-3",children:c.map(o=>{const x=o.requestedChildCount??0,u=o.childIssueIds?.length??0,h=o.ownerAgentId?r?.get(o.ownerAgentId)?.name??"agent":null,b=o.acceptedPlanRevisionNumber!=null?`revision ${o.acceptedPlanRevisionNumber}`:`revision ${o.acceptedPlanRevisionId.slice(0,8)}`,w=o.completedAt&&typeof o.completedAt=="string"?o.completedAt:o.completedAt instanceof Date?o.completedAt.toISOString():null,k=typeof o.updatedAt=="string"?o.updatedAt:o.updatedAt instanceof Date?o.updatedAt.toISOString():null,$=typeof o.createdAt=="string"?o.createdAt:o.createdAt instanceof Date?o.createdAt.toISOString():null;return(0,e.jsxs)("li",{className:"rounded-md border border-line bg-bg-2/50 p-3 text-sm",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsx)(Ko,{status:o.status}),(0,e.jsxs)("span",{className:"text-xs text-ink-3",children:["Plan ",b]}),(0,e.jsx)("span",{className:"text-xs text-ink-3/70",children:"·"}),(0,e.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs text-ink",children:[(0,e.jsx)(It,{className:"h-3 w-3 text-ink-3"}),u," of ",x," child ",x===1?"task":"tasks"," created"]}),o.status==="completed"&&x>0?(0,e.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-sm border border-sky-500/40 bg-sky-500/10 px-1.5 py-0.5 text-(length:--text-nano) font-medium text-sky-900 dark:text-sky-100",title:"Repeat attempts with this fingerprint reuse this record instead of creating new children",children:[(0,e.jsx)(wi,{className:"h-3 w-3"}),"Idempotent claim"]}):null]}),(0,e.jsxs)("div",{className:"mt-1 flex flex-wrap gap-x-3 gap-y-0.5 text-(length:--text-micro) text-ink-3",children:[h?(0,e.jsxs)("span",{children:["Owner: ",h]}):null,$?(0,e.jsxs)("span",{title:M($),children:["Started ",ks($)]}):null,w?(0,e.jsxs)("span",{title:M(w),children:["Completed ",ks(w)]}):k?(0,e.jsxs)("span",{title:M(k),children:["Updated ",ks(k)]}):null,n?(0,e.jsx)(V,{to:`/issues/${n}#document-plan`,className:"underline-offset-2 hover:underline",children:"Plan document"}):null]}),o.childIssues&&o.childIssues.length>0?(0,e.jsx)("ul",{className:"mt-2 flex flex-wrap gap-1.5",children:o.childIssues.map(v=>(0,e.jsx)("li",{children:(0,e.jsxs)(V,{to:`/issues/${v.identifier??v.id}`,className:g("inline-flex max-w-full items-center gap-1 rounded-sm border border-line bg-bg px-2 py-0.5 text-(length:--text-micro) text-ink transition-colors hover:bg-bg-3/40"),title:v.title,children:[(0,e.jsx)("span",{className:"font-medium",children:v.identifier??v.id.slice(0,8)}),(0,e.jsx)("span",{className:"truncate max-w-(--sz-24ch) text-ink-3",children:v.title}),(0,e.jsx)(ri,{className:"h-3 w-3 text-ink-3"})]})},v.id))}):null]},o.id)})})]})}a(Vo,"IssuePlanDecompositionsSection");function Qo(t){return(t??[]).some(n=>n.kind==="request_confirmation"&&n.status==="pending"&&n.payload.target?.type==="issue_document"&&n.payload.target.key==="plan")}a(Qo,"hasPendingPlanConfirmation");function Ho({issue:t}){const{data:n,isLoading:r}=qa(t.id),l=Ss(),[c,o]=(0,d.useState)(!1),{data:x}=A({queryKey:j.issues.acceptedPlanDecompositions(t.id),queryFn:a(()=>E.listAcceptedPlanDecompositions(t.id),"queryFn")}),{data:u}=A({queryKey:j.issues.interactions(t.id),queryFn:a(()=>E.listInteractions(t.id),"queryFn")}),h=(x?.length??0)>0,b=Qo(u);return!n&&!h?(0,e.jsx)("div",{className:"px-1 py-6 text-sm text-ink-3",children:r?"Loading plan…":t.workMode==="planning"?(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)("p",{children:"This task is in plan mode but no plan document has been written yet."}),b?(0,e.jsx)("p",{className:"text-amber-foreground",children:"A plan confirmation is pending, but the plan document it should confirm is missing."}):null]}):"No plan yet. The plan document, accepted plans, and their revisions will appear here."}):(0,e.jsxs)("div",{className:"space-y-4 py-2",children:[n?(0,e.jsxs)("section",{"data-testid":"issue-plan-document",className:"space-y-2",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1 text-xs text-ink-3",children:[`Revision ${n.latestRevisionNumber??1} · updated ${new Date(n.updatedAt).toLocaleString([],{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}`,(0,e.jsx)(Rs,{issueId:t.id,docKey:"plan",panelOpen:c,onToggle:a(()=>o(w=>!w),"onToggle")})]}),(0,e.jsx)(Ps,{issueId:t.id,doc:{key:"plan",latestRevisionId:n.latestRevisionId,latestRevisionNumber:n.latestRevisionNumber},bodyMarkdown:n.body,draftDirty:!1,draftConflicted:!1,historicalPreview:!1,locationHash:l.hash,panelOpen:c,onPanelOpenChange:o,panelPlacement:"popover",children:(0,e.jsx)(Ts,{children:n.body})})]}):null,h?(0,e.jsx)(Vo,{issueId:t.id,issueIdentifier:t.identifier}):null]})}a(Ho,"IssuePropertiesPlansTab");function T(t,...n){for(const r of n){const l=t?.[r];if(typeof l=="string"&&l.trim())return l.trim()}return""}a(T,"artifactText");function ue(t,...n){for(const r of n){const l=t?.[r];if(typeof l=="number"&&Number.isFinite(l)&&l>=0)return l}return null}a(ue,"artifactNumber");function ae(t){if(!t||/[\u0000-\u0020\\]/.test(t))return"";if(t.startsWith("/")&&!t.startsWith("//"))return t;try{const n=new URL(t);return["https:","http:"].includes(n.protocol)?t:""}catch{return""}}a(ae,"artifactUrl");function Ct(t){return/^\/api\/attachments\/[a-zA-Z0-9-]+\/content$/.test(t)?t:""}a(Ct,"artifactPreviewUrl");function Go(t){return t===null?"":t<1024?`${t} B`:t<1048576?`${(t/1024).toFixed(1)} KB`:`${(t/1048576).toFixed(1)} MB`}a(Go,"artifactFileSize");var Xo=50;function Yo(t){if(new TextEncoder().encode(t).length>1048576)throw new Error("CSV is too large to preview. Download the file to view it.");const n=[];let r=[],l="",c=!1,o=!1;const x=a(()=>{if(r.push(l),r.length>Xo)throw new Error("CSV has too many columns to preview. Download the file to view it.");l="",o=!1},"endField"),u=t.replace(/^\uFEFF/,"");for(let h=0;h<u.length;h++){const b=u[h];if(c)b==='"'&&u[h+1]==='"'?(l+='"',h++):b==='"'?(c=!1,o=!0):l+=b;else if(b===",")x();else if(b===`
1
+ var Ol=Object.defineProperty;var a=(t,n)=>Ol(t,"name",{value:n,configurable:!0});import{i as Is}from"./rolldown-runtime-ZpX3ckPj.js";import{O as ks,_i as va,gi as El,h as M,hi as Na,l as g,m as Wl,mi as $l,na as _l,pi as Ml,t as Ca,ta as Ll,w as Fl}from"./createLucideIcon-DJi9suAC.js";import{l as Bl}from"./dist-SzpVz8Pd.js";import{a as As,h as Ss}from"./star-BZgQbzhV.js";import{X as Ia,_ as Ce,n as Aa,t as j,v as A}from"./queryKeys-DYV5MhM_.js";import{o as ql}from"./companies-query-D9PxIiMT.js";import{t as Dl}from"./issue-attribution-DfN_3u2W.js";import{n as Ps,t as Rs}from"./IssueDocumentAnnotations-BK-LgExc.js";import{n as zl,r as Ul}from"./WorkspaceRuntimeControls-T4YUoZvK.js";import{n as Kl}from"./CompanyContext-CSrVsSze.js";import{A as sa,P as Vl,a as Ql,an as jt,at as Hl,ot as It,t as V,v as na,zt as E}from"./router-2UfGeejU.js";import{i as Gl,p as Xl,r as Yl,t as Zl}from"./dropdown-menu-DEO3mF_E.js";import{i as Jl,n as qe,r as ei,t as ti}from"./tabs-B2Os_leL.js";import{o as aa,r as ra,t as la}from"./popover-BhYHYj7q.js";import{t as si}from"./archive-restore-DeLPtKS0.js";import{t as ni}from"./arrow-right-BL5kYtCZ.js";import{t as yt}from"./arrow-up-right-BLYWl-we.js";import{t as ne}from"./check-Ctsrlfa-.js";import{t as ws}from"./chevron-down-BCvxsWfI.js";import{t as ai}from"./chevron-left-DP4zwC0G.js";import{t as ri}from"./chevron-right-s7L6hXXq.js";import{t as li}from"./circle-question-mark-B1jR2is9.js";import{t as Sa}from"./clock-CzrJT_cP.js";import{A as ii,E as Pa,I as oi,M as ia,N as ci,S as di,T as ui,j as xi,k as mi,n as Ra,t as Ts,x as hi}from"./MarkdownBody-BTjuUgFa.js";import{t as Ta}from"./external-link-nl1b263c.js";import{t as Os}from"./file-text-Cw7ntqRx.js";import{t as pi}from"./file-N19tC0jj.js";import{a as Oa,i as fi,n as gi,o as bi,t as ji}from"./RichWorkProductCard-ClpMt_Bh.js";import{t as yi}from"./folder-open-8WDYv4mw.js";import{t as ki}from"./git-pull-request-CdCSG7CL.js";import{r as Ea,t as W}from"./button-CMwV3L1P.js";import{t as vs}from"./plus-C6fnr28l.js";import{t as wi}from"./repeat-DGPKlc5I.js";import{t as oa}from"./rotate-ccw-CQEJ4ewP.js";import{t as vi}from"./triangle-alert-CBVKiaXB.js";import{t as De}from"./user-Ccom_Ph0.js";import{t as Ni}from"./x-DRDFdlYE.js";import{i as Ci,n as Ii,r as Ai,t as Si}from"./tooltip-B5WQ3lq5.js";import{t as se}from"./badge-DuA2EgZC.js";import{t as Pi}from"./Identity-Cv_2a9qJ.js";import{t as ve}from"./AgentAvatar-DgGEobSY.js";import{t as Wa}from"./agents-DmlgUVso.js";import{t as $a}from"./instanceSettings-D8g_QlS-.js";import{u as Ri}from"./inboxArchiveCache-D8QGdg49.js";import{t as Ti}from"./projects-mixWrT5q.js";import{a as Oi,c as Ei,n as Wi,r as $i,s as _i,t as Mi}from"./dialog-CKUblzlR.js";import{t as Li}from"./access-GAosX22P.js";import{i as Fi,r as Bi}from"./assignees-DkQNbPzi.js";import{t as qi}from"./activity-BVYJmFzR.js";import{t as ca}from"./AgentIdentity-I_kB4rMX.js";import{t as Di}from"./textarea-BRPEfJ-g.js";import{t as zi}from"./recent-selections-BnN_nb6Y.js";import{a as Ui,i as Ki,r as Vi,t as Qi}from"./recent-assignees-DmalYaLf.js";import{t as Hi}from"./InlineEntitySelector-v2Q4C8oT.js";import{t as Gi}from"./clipboard-CTLKYvRL.js";import{t as kt}from"./StatusIcon-0GcYXDdN.js";import{_ as Xi,g as Yi,h as Zi,m as da,p as Ji,v as eo}from"./issue-blockers-DLfa24KC.js";import{An as to,Gn as so,Ia as no,In as ua,Kn as ao,Ln as ro,Mn as lo,Ra as io,Rn as xa,Vn as oo,Yn as ma,hr as co,kn as uo,nn as xo,nr as mo,pn as ho,qn as po,tr as ha,zn as fo}from"./index-3AxqhPET.js";import{d as _a,i as go,n as Ma,s as bo,t as jo}from"./ImageGalleryModal-DzKBMOnu.js";import{n as yo,r as ko}from"./TaskDetailRelationsPanel-DZGkinoJ.js";import{t as wo}from"./query-placeholder-data-Bg4z2kcq.js";import{i as vo,o as No,p as Co,r as Io,u as Ao}from"./SourceTrustBadge-CfBrvKL3.js";import{n as So}from"./runRetryState-BdjK4QQj.js";import{o as Po,s as Ro}from"./issue-output-CU3gasZ1.js";import{t as wt}from"./IssueReferencePill-DAEplgLd.js";import{n as To}from"./review-policy-BL48kYvb.js";import{t as Oo}from"./separator-B2LFqBpM.js";import{n as Eo,t as Wo}from"./issue-workspace-selection-S8UgGgK1.js";import{o as $o}from"./cases-m9RZ5Cym.js";var La={name:"hard-drive",size:24,node:[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]]};La.node;var _o=Ca(La),Fa={name:"table-2",size:24,node:[["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]]};Fa.node;var Mo=Ca(Fa),e=Is(Ll(),1),d=Is(_l(),1);function Ba(t){const n=A({queryKey:j.issues.workProducts(t??"__none__"),queryFn:a(({signal:x})=>E.listWorkProducts(t,{signal:x,fresh:!0}),"queryFn"),enabled:!!t,refetchOnMount:"always",placeholderData:wo(t??"__none__")}),r=n.data?.filter(x=>x.type==="pull_request")??[],l=!!t&&r.length>0,c=A({queryKey:[...j.issues.workProductPullRequestRefresh(t??"__none__"),r],queryFn:a(({signal:x})=>E.listWorkProducts(t,{refreshPullRequests:!0,signal:x,fresh:!0}),"queryFn"),enabled:l,refetchOnMount:"always"}),o=(0,d.useMemo)(()=>{const x=new Map(c.data?.map(u=>[u.id,u]));return n.data?.map(u=>{const h=x.get(u.id);return u.type!=="pull_request"||!h||new Date(h.updatedAt).getTime()!==new Date(u.updatedAt).getTime()?u:{...u,metadata:h.metadata}})},[n.data,c.data]);return{...n,data:o,isFetching:n.isFetching||c.isFetching,isError:n.isError||c.isError,error:n.error??c.error,refetch:a(async()=>{await Promise.all([n.refetch(),...l?[c.refetch()]:[]])},"refetch")}}a(Ba,"useIssueWorkProducts");var pa=Is(Bl(),1);function qa(t){return A({queryKey:[...j.issues.documents(t??""),"plan"],enabled:!!t&&!t?.startsWith("chat:"),queryFn:a(async()=>{try{return await E.getDocument(t,"plan")}catch(n){if(n instanceof Aa&&n.status===404)return null;throw n}},"queryFn")})}a(qa,"useIssuePlanDocument");function Lo(t){return t.createdByAgentId?!0:!t.createdByUserId&&!t.issueCommentId}a(Lo,"isAgentAttachment");function Fo(t){const n=new Set;for(const r of t??[]){const l=Na(r);l&&n.add(l.attachmentId)}return n}a(Fo,"getAttachmentBackedWorkProductAttachmentIds");function Da(t,n){const r=Fo(n);return(t??[]).filter(l=>Lo(l)&&!r.has(l.id))}a(Da,"selectAgentArtifactAttachments");function za(t){if(t.url)return t.url;const n=t.metadata;if(!n)return null;for(const r of["openPath","url"]){const l=n[r];if(typeof l=="string"&&l.trim().length>0)return l}return null}a(za,"workProductHref");function Bo(t){if(t.title?.trim())return t.title;const n=t.key.replace(/[-_]+/g," ").trim();return n.charAt(0).toUpperCase()+n.slice(1)}a(Bo,"documentDisplayTitle");var vt=new Set(["merged","closed","archived"]);function Nt(t){return vt.has(t.status)?t.status:typeof t.metadata?.state=="string"?t.metadata.state:t.status}a(Nt,"pullRequestState");function Ns(t){const n=Nt(t);return!vt.has(n)&&n!=="changes_requested"&&t.reviewState==="needs_board_review"}a(Ns,"pullRequestNeedsReview");function At(t){const n=za(t);if(!n)return null;try{const r=new URL(n);return!["http:","https:"].includes(r.protocol)||r.username||r.password?null:r.href}catch{return null}}a(At,"pullRequestHref");function qo(t){const n=At(t);if(n){const r=new URL(n),l=r.pathname.match(/^\/([^/]+)\/([^/]+)\/pull\/(\d+)\/?$/);if(r.hostname==="github.com"&&l)return`${l[1]}/${l[2]}#${l[3]}`}return t.title}a(qo,"pullRequestLabel");function Ue(t){if(!t)return null;try{const n=new URL(t);if(!["http:","https:"].includes(n.protocol)||n.username||n.password)return null;const r=n.pathname.match(/^\/([^/]+)\/([^/]+)\/pull\/(\d+)(?:\/|$)/);return n.hostname==="github.com"&&!n.port&&r?`github.com/${r[1].toLowerCase()}/${r[2].toLowerCase()}/pull/${Number(r[3])}`:n.href}catch{return null}}a(Ue,"pullRequestIdentity");function Do(t){const n=(t??[]).filter(l=>l.type==="pull_request").sort((l,c)=>new Date(c.updatedAt).getTime()-new Date(l.updatedAt).getTime()||Number(vt.has(Nt(c)))-Number(vt.has(Nt(l)))),r=new Set;return n.filter(l=>{const c=Ue(At(l))??l.id;return r.has(c)?!1:(r.add(c),!0)}).sort((l,c)=>Number(Ns(c))-Number(Ns(l))||Number(c.isPrimary)-Number(l.isPrimary))}a(Do,"getIssuePullRequests");function zo({products:t,externalObjects:n=[]}){return(0,e.jsx)("ul",{className:"flex min-w-0 flex-col gap-2",children:t.map(r=>{const l=At(r),c=qo(r),o=Nt(r),x=Ue(l),u=x?n.find(w=>Ue(w.url)===x):void 0,h=u?Pa(u):null,b=u?.liveness==="fresh"&&(u.statusIconKey==="git-merge"||["merged","closed"].includes(h?.toLowerCase()??""));return(0,e.jsxs)("li",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[l?(0,e.jsx)("a",{href:l,target:"_blank",rel:"noopener noreferrer",title:r.title,className:"break-words text-sm text-accent underline-offset-2 hover:underline",children:c}):(0,e.jsxs)("span",{className:"break-words text-sm",children:[c," · No PR link provided"]}),u?(0,e.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs text-ink-3","data-external-status":u.statusCategory,"data-external-liveness":u.liveness,children:[(0,e.jsx)(Ra,{category:u.statusCategory,liveness:u.liveness,statusIconKey:u.statusIconKey,label:h}),(0,e.jsxs)("span",{children:[h,["fresh","unknown"].includes(u.liveness)?"":` (${ii(u.liveness)})`]})]}):null,Ns(r)&&!b?(0,e.jsx)(se,{variant:"outline",children:"Review requested"}):["merged","closed","archived","draft","changes_requested"].includes(o)&&h?.toLowerCase()!==o?(0,e.jsxs)("span",{className:"text-xs text-ink-3",children:[u?"Saved: ":"",o.replaceAll("_"," ")]}):null]},r.id)})})}a(zo,"IssuePullRequestLinks");function Ua(t){return A({queryKey:[...j.issues.documents(t??""),"list"],enabled:!!t&&!t?.startsWith("chat:"),queryFn:a(()=>E.listDocuments(t),"queryFn")})}a(Ua,"useIssueDocuments");function Uo(t){const n=(0,d.useMemo)(()=>ro(t),[t]),r=(0,d.useRef)(!1);return(0,d.useEffect)(()=>{if(n.success||r.current)return;r.current=!0;const l=n.error.issues[0]?.path[0];xo(new Error(`Invalid task execution policy (${l==="stages"?"stages":l==="monitor"?"monitor":l==="authorizationPolicy"?"authorization":l==="reviewPreset"?"review_preset":"policy"})`))},[n]),n}a(Uo,"useExecutionPolicy");function Ko({status:t}){return t==="completed"?(0,e.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-sm border border-emerald-500/50 bg-emerald-500/10 px-2 py-0.5 text-(length:--text-micro) font-medium text-emerald-900 dark:text-emerald-100",children:[(0,e.jsx)(As,{className:"h-3 w-3"}),"Completed"]}):(0,e.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-sm border border-amber-500/50 bg-amber-500/10 px-2 py-0.5 text-(length:--text-micro) font-medium text-amber-900 dark:text-amber-100",children:[(0,e.jsx)(Ea,{className:"h-3 w-3 animate-spin"}),"In flight"]})}a(Ko,"StatusBadge");function Vo({issueId:t,issueIdentifier:n,agentMap:r}){const{data:l}=A({queryKey:j.issues.acceptedPlanDecompositions(t),queryFn:a(()=>E.listAcceptedPlanDecompositions(t),"queryFn")}),c=(0,d.useMemo)(()=>l??[],[l]);return c.length===0?null:(0,e.jsxs)("div",{className:"space-y-3",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,e.jsx)("h3",{className:"text-sm font-medium text-ink-3",children:"Plan decomposition"}),(0,e.jsx)("span",{className:"text-(length:--text-micro) text-ink-3/80",children:c.length===1?"1 accepted plan revision":`${c.length} accepted plan revisions`})]}),(0,e.jsx)("ul",{className:"space-y-3",children:c.map(o=>{const x=o.requestedChildCount??0,u=o.childIssueIds?.length??0,h=o.ownerAgentId?r?.get(o.ownerAgentId)?.name??"agent":null,b=o.acceptedPlanRevisionNumber!=null?`revision ${o.acceptedPlanRevisionNumber}`:`revision ${o.acceptedPlanRevisionId.slice(0,8)}`,w=o.completedAt&&typeof o.completedAt=="string"?o.completedAt:o.completedAt instanceof Date?o.completedAt.toISOString():null,k=typeof o.updatedAt=="string"?o.updatedAt:o.updatedAt instanceof Date?o.updatedAt.toISOString():null,$=typeof o.createdAt=="string"?o.createdAt:o.createdAt instanceof Date?o.createdAt.toISOString():null;return(0,e.jsxs)("li",{className:"rounded-md border border-line bg-bg-2/50 p-3 text-sm",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsx)(Ko,{status:o.status}),(0,e.jsxs)("span",{className:"text-xs text-ink-3",children:["Plan ",b]}),(0,e.jsx)("span",{className:"text-xs text-ink-3/70",children:"·"}),(0,e.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs text-ink",children:[(0,e.jsx)(It,{className:"h-3 w-3 text-ink-3"}),u," of ",x," child ",x===1?"task":"tasks"," created"]}),o.status==="completed"&&x>0?(0,e.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-sm border border-sky-500/40 bg-sky-500/10 px-1.5 py-0.5 text-(length:--text-nano) font-medium text-sky-900 dark:text-sky-100",title:"Repeat attempts with this fingerprint reuse this record instead of creating new children",children:[(0,e.jsx)(wi,{className:"h-3 w-3"}),"Idempotent claim"]}):null]}),(0,e.jsxs)("div",{className:"mt-1 flex flex-wrap gap-x-3 gap-y-0.5 text-(length:--text-micro) text-ink-3",children:[h?(0,e.jsxs)("span",{children:["Owner: ",h]}):null,$?(0,e.jsxs)("span",{title:M($),children:["Started ",ks($)]}):null,w?(0,e.jsxs)("span",{title:M(w),children:["Completed ",ks(w)]}):k?(0,e.jsxs)("span",{title:M(k),children:["Updated ",ks(k)]}):null,n?(0,e.jsx)(V,{to:`/issues/${n}#document-plan`,className:"underline-offset-2 hover:underline",children:"Plan document"}):null]}),o.childIssues&&o.childIssues.length>0?(0,e.jsx)("ul",{className:"mt-2 flex flex-wrap gap-1.5",children:o.childIssues.map(v=>(0,e.jsx)("li",{children:(0,e.jsxs)(V,{to:`/issues/${v.identifier??v.id}`,className:g("inline-flex max-w-full items-center gap-1 rounded-sm border border-line bg-bg px-2 py-0.5 text-(length:--text-micro) text-ink transition-colors hover:bg-bg-3/40"),title:v.title,children:[(0,e.jsx)("span",{className:"font-medium",children:v.identifier??v.id.slice(0,8)}),(0,e.jsx)("span",{className:"truncate max-w-(--sz-24ch) text-ink-3",children:v.title}),(0,e.jsx)(ri,{className:"h-3 w-3 text-ink-3"})]})},v.id))}):null]},o.id)})})]})}a(Vo,"IssuePlanDecompositionsSection");function Qo(t){return(t??[]).some(n=>n.kind==="request_confirmation"&&n.status==="pending"&&n.payload.target?.type==="issue_document"&&n.payload.target.key==="plan")}a(Qo,"hasPendingPlanConfirmation");function Ho({issue:t}){const{data:n,isLoading:r}=qa(t.id),l=Ss(),[c,o]=(0,d.useState)(!1),{data:x}=A({queryKey:j.issues.acceptedPlanDecompositions(t.id),queryFn:a(()=>E.listAcceptedPlanDecompositions(t.id),"queryFn")}),{data:u}=A({queryKey:j.issues.interactions(t.id),queryFn:a(()=>E.listInteractions(t.id),"queryFn")}),h=(x?.length??0)>0,b=Qo(u);return!n&&!h?(0,e.jsx)("div",{className:"px-1 py-6 text-sm text-ink-3",children:r?"Loading plan…":t.workMode==="planning"?(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)("p",{children:"This task is in plan mode but no plan document has been written yet."}),b?(0,e.jsx)("p",{className:"text-amber-foreground",children:"A plan confirmation is pending, but the plan document it should confirm is missing."}):null]}):"No plan yet. The plan document, accepted plans, and their revisions will appear here."}):(0,e.jsxs)("div",{className:"space-y-4 py-2",children:[n?(0,e.jsxs)("section",{"data-testid":"issue-plan-document",className:"space-y-2",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1 text-xs text-ink-3",children:[`Revision ${n.latestRevisionNumber??1} · updated ${new Date(n.updatedAt).toLocaleString([],{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}`,(0,e.jsx)(Rs,{issueId:t.id,docKey:"plan",panelOpen:c,onToggle:a(()=>o(w=>!w),"onToggle")})]}),(0,e.jsx)(Ps,{issueId:t.id,doc:{key:"plan",latestRevisionId:n.latestRevisionId,latestRevisionNumber:n.latestRevisionNumber},bodyMarkdown:n.body,draftDirty:!1,draftConflicted:!1,historicalPreview:!1,locationHash:l.hash,panelOpen:c,onPanelOpenChange:o,panelPlacement:"popover",children:(0,e.jsx)(Ts,{children:n.body})})]}):null,h?(0,e.jsx)(Vo,{issueId:t.id,issueIdentifier:t.identifier}):null]})}a(Ho,"IssuePropertiesPlansTab");function T(t,...n){for(const r of n){const l=t?.[r];if(typeof l=="string"&&l.trim())return l.trim()}return""}a(T,"artifactText");function ue(t,...n){for(const r of n){const l=t?.[r];if(typeof l=="number"&&Number.isFinite(l)&&l>=0)return l}return null}a(ue,"artifactNumber");function ae(t){if(!t||/[\u0000-\u0020\\]/.test(t))return"";if(t.startsWith("/")&&!t.startsWith("//"))return t;try{const n=new URL(t);return["https:","http:"].includes(n.protocol)?t:""}catch{return""}}a(ae,"artifactUrl");function Ct(t){return/^\/api\/attachments\/[a-zA-Z0-9-]+\/content$/.test(t)?t:""}a(Ct,"artifactPreviewUrl");function Go(t){return t===null?"":t<1024?`${t} B`:t<1048576?`${(t/1024).toFixed(1)} KB`:`${(t/1048576).toFixed(1)} MB`}a(Go,"artifactFileSize");var Xo=50;function Yo(t){if(new TextEncoder().encode(t).length>1048576)throw new Error("CSV is too large to preview. Download the file to view it.");const n=[];let r=[],l="",c=!1,o=!1;const x=a(()=>{if(r.push(l),r.length>Xo)throw new Error("CSV has too many columns to preview. Download the file to view it.");l="",o=!1},"endField"),u=t.replace(/^\uFEFF/,"");for(let h=0;h<u.length;h++){const b=u[h];if(c)b==='"'&&u[h+1]==='"'?(l+='"',h++):b==='"'?(c=!1,o=!0):l+=b;else if(b===",")x();else if(b===`
2
2
  `||b==="\r"){if(x(),n.push(r),r=[],b==="\r"&&u[h+1]===`
3
3
  `&&h++,n.length>201)break}else if(b==='"'&&!l&&!o)c=!0;else{if(o||b==='"')throw new Error("CSV could not be previewed. Download the file to view it.");l+=b}}if(c)throw new Error("CSV could not be previewed. Download the file to view it.");return(l||r.length||o)&&(x(),n.push(r)),{columns:n[0]??[],rows:n.slice(1,201),truncated:n.length>201}}a(Yo,"parseArtifactCsv");async function Zo(t,n){if(!/^\/api\/attachments\/[a-zA-Z0-9-]+\/content$/.test(t))throw new Error("CSV preview is unavailable. Download the file to view it.");const r=await fetch(t,{credentials:"same-origin",redirect:"error",signal:n});if(!r.ok)throw new Error("CSV could not be loaded. Try again or download the file.");if(Number(r.headers.get("content-length"))>1048576)throw await r.body?.cancel(),new Error("CSV is too large to preview. Download the file to view it.");const l=r.body?.getReader();if(!l)throw new Error("CSV could not be loaded. Try again or download the file.");const c=new TextDecoder;let o="",x=0;try{for(;;){const{value:u,done:h}=await l.read();if(h)break;if(x+=u.byteLength,x>1048576)throw await l.cancel(),new Error("CSV is too large to preview. Download the file to view it.");o+=c.decode(u,{stream:!0})}o+=c.decode()}finally{l.releaseLock()}return Yo(o)}a(Zo,"loadArtifactCsv");function re({title:t,summary:n}){return(0,e.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,e.jsx)("h2",{className:"break-words text-lg font-semibold leading-snug",children:t}),n&&(0,e.jsx)("p",{className:"whitespace-pre-wrap text-sm leading-relaxed text-ink-3",children:n})]})}a(re,"Identity");function le({author:t,updatedAt:n,action:r,statusBadge:l}){return(0,e.jsxs)("footer",{className:"flex flex-wrap items-center justify-between gap-3 border-t border-line px-5 py-3",children:[(0,e.jsx)("span",{className:"text-xs text-ink-3",children:[t,n].filter(Boolean).join(" · ")}),l,r]})}a(le,"Footer");function ie({children:t}){return(0,e.jsx)("article",{className:"w-full overflow-hidden rounded-lg border border-line bg-bg-2 text-ink",children:t})}a(ie,"Card");function Ke({url:t,children:n}){return t?(0,e.jsx)(W,{variant:"secondary",size:"sm",asChild:!0,children:(0,e.jsxs)("a",{href:t,target:"_blank",rel:"noreferrer",children:[n,(0,e.jsx)(Ta,{className:"size-3"})]})}):(0,e.jsx)(W,{variant:"secondary",size:"sm",disabled:!0,children:n})}a(Ke,"SourceLink");function Es({title:t,description:n,action:r,children:l}){return(0,e.jsxs)(Mi,{children:[(0,e.jsx)(Ei,{asChild:!0,children:(0,e.jsx)(W,{size:"sm",variant:"secondary",children:r})}),(0,e.jsxs)(Wi,{className:"max-h-dvh overflow-y-auto sm:max-w-2xl",children:[(0,e.jsxs)(Oi,{children:[(0,e.jsx)(_i,{className:"pr-6",children:t}),(0,e.jsx)($i,{children:n})]}),l]})]})}a(Es,"Viewer");function Ka({additions:t,deletions:n,filesChanged:r}){return(0,e.jsxs)("div",{className:"flex flex-wrap gap-2 font-mono text-xs",children:[t!=null&&(0,e.jsxs)("span",{className:"text-(--status-task-icon-done)",children:["+",t.toLocaleString("en-US")]}),n!=null&&(0,e.jsxs)("span",{className:"text-(--status-task-icon-blocked)",children:["−",n.toLocaleString("en-US")]}),r!=null&&(0,e.jsxs)("span",{className:"text-ink-3",children:[r," ",r===1?"file":"files"]})]})}a(Ka,"Diff");var Jo={passed:"Checks passed",pending:"Checks pending",failed:"Checks failed",unknown:"Checks not available"},ec={open:"Open",draft:"Draft",merged:"Merged",closed:"Closed",unknown:"State unknown"};function tc(t){const{number:n,repository:r,sourceBranch:l,targetBranch:c,state:o,checks:x,evidenceSource:u,reviewSummary:h,url:b}=t,w={passed:As,pending:Sa,failed:vi,unknown:li}[x],k={passed:"text-(--status-task-icon-done)",pending:"text-ink-3",failed:"text-(--status-task-icon-blocked)",unknown:"text-ink-3"}[x];return(0,e.jsxs)(ie,{children:[(0,e.jsxs)("div",{className:"flex flex-col gap-4 p-5",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-xs text-ink-3",children:[(0,e.jsx)(ki,{className:"size-4"})," Pull request"," ",n!=null&&(0,e.jsxs)("span",{className:"font-mono",children:["#",n]})]}),(0,e.jsxs)(se,{variant:"outline",className:o==="merged"?"text-(--status-task-icon-done)":"text-ink-3",children:[o==="merged"&&(0,e.jsx)(oi,{className:"size-3"}),ec[o]]})]}),(0,e.jsx)(re,{...t}),(0,e.jsxs)("div",{className:"flex flex-col gap-2 text-xs text-ink-3",children:[(0,e.jsx)("span",{children:r}),(l||c)&&(0,e.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,e.jsx)(It,{className:"size-3.5 shrink-0"}),(0,e.jsx)("code",{className:"min-w-0 truncate",title:l,children:l}),l&&c&&(0,e.jsx)(ni,{className:"size-3.5 shrink-0"}),(0,e.jsx)("code",{className:"min-w-0 truncate",title:c,children:c})]})]}),(0,e.jsx)(Ka,{...t})]}),(0,e.jsxs)("div",{className:"flex flex-col gap-2 border-t border-line px-5 py-4",children:[(0,e.jsxs)("span",{className:"flex items-center gap-2 text-xs",children:[(0,e.jsx)(w,{className:`size-4 ${k}`}),Jo[x]]}),h&&(0,e.jsx)("p",{className:"text-xs leading-relaxed",children:h}),u&&(0,e.jsxs)("p",{className:"text-xs text-ink-3",children:["Source: ",u]})]}),(0,e.jsx)(le,{...t,action:(0,e.jsx)(Ke,{url:b,children:"Open pull request"})})]})}a(tc,"PullRequestCard");function sc(t){return(0,e.jsxs)(ie,{children:[(0,e.jsxs)("div",{className:"flex flex-col gap-4 p-5",children:[(0,e.jsxs)("span",{className:"flex items-center gap-2 text-xs text-ink-3",children:[(0,e.jsx)(no,{className:"size-4"})," Commit"," ",(0,e.jsx)("code",{title:t.sha,children:t.sha.slice(0,8)})]}),(0,e.jsx)(re,{...t}),(0,e.jsx)("span",{className:"break-words text-xs text-ink-3",children:t.repository}),t.branch&&(0,e.jsxs)("span",{className:"flex items-center gap-2 text-xs text-ink-3",children:[(0,e.jsx)(It,{className:"size-3.5"}),(0,e.jsx)("code",{className:"min-w-0 truncate",children:t.branch})]}),(0,e.jsx)(Ka,{...t})]}),(0,e.jsx)(le,{...t,action:(0,e.jsx)(Ke,{url:t.url,children:"View commit"})})]})}a(sc,"CommitCard");function fa({body:t}){return(0,e.jsx)("div",{className:"flex flex-col gap-3 text-sm leading-relaxed",children:(0,e.jsx)(di,{components:{h1:a(({children:n})=>(0,e.jsx)("h3",{className:"text-lg font-semibold",children:n}),"h1"),h2:a(({children:n})=>(0,e.jsx)("h3",{className:"text-base font-semibold",children:n}),"h2"),h3:a(({children:n})=>(0,e.jsx)("h4",{className:"text-sm font-semibold",children:n}),"h3"),ul:a(({children:n})=>(0,e.jsx)("ul",{className:"list-disc space-y-1 pl-5",children:n}),"ul"),ol:a(({children:n})=>(0,e.jsx)("ol",{className:"list-decimal space-y-1 pl-5",children:n}),"ol"),img:a(({src:n,alt:r})=>{const l=Ct(typeof n=="string"?n:"");if(l)return(0,e.jsx)("img",{src:l,alt:r??"",loading:"lazy",className:"h-auto max-w-full"});const c=ae(typeof n=="string"?n:"");return c?(0,e.jsx)("a",{href:c,target:"_blank",rel:"noreferrer",className:"underline underline-offset-4",children:r||"Open image"}):(0,e.jsx)("span",{children:r})},"img"),a:a(({children:n,href:r})=>(0,e.jsx)("a",{href:r,target:"_blank",rel:"noreferrer",className:"underline underline-offset-4",children:n}),"a")},children:t})})}a(fa,"Markdown");function Va(t){return(0,e.jsxs)(ie,{children:[t.body&&(0,e.jsx)("div",{className:"max-h-52 overflow-hidden border-b border-line bg-bg-3/20 p-5",inert:!0,children:(0,e.jsx)(fa,{body:t.body.slice(0,4e3)})}),(0,e.jsxs)("div",{className:"flex flex-col gap-3 p-5",children:[(0,e.jsxs)("span",{className:"flex items-center gap-2 text-xs text-ink-3",children:[(0,e.jsx)(Os,{className:"size-4"})," Markdown",t.revision!=null&&` · revision ${t.revision}`]}),(0,e.jsx)(re,{...t}),(0,e.jsx)("span",{className:"break-all font-mono text-xs text-ink-3",children:t.filename})]}),(0,e.jsx)(le,{...t,action:(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[t.actions,t.onOpen?(0,e.jsx)(W,{size:"sm",variant:"secondary","aria-expanded":t.expanded,onClick:t.onOpen,children:t.expanded?"Close document":"Read document"}):(0,e.jsx)(Es,{title:t.title,description:t.filename,action:"Read document",children:(0,e.jsx)(fa,{body:t.body})})]})})]})}a(Va,"DocumentCard");function ga({columns:t,rows:n}){return(0,e.jsxs)("div",{className:"overflow-x-auto",children:[(0,e.jsxs)("table",{className:"w-full text-left text-xs",children:[(0,e.jsx)("thead",{children:(0,e.jsx)("tr",{children:t.map((r,l)=>(0,e.jsx)("th",{className:"border-b border-line px-3 py-3 font-medium text-ink-3",children:r},l))})}),(0,e.jsx)("tbody",{children:n.map((r,l)=>(0,e.jsx)("tr",{children:t.map((c,o)=>(0,e.jsx)("td",{className:"border-b border-line/50 px-3 py-3",children:r[o]??""},o))},l))})]}),n.length===0&&(0,e.jsx)("p",{className:"p-4 text-xs text-ink-3",children:"No rows"})]})}a(ga,"DataTable");function nc(t){const n=[t.columns,...t.rows].map(r=>r.map(l=>`"${String(l).replaceAll('"','""')}"`).join(",")).join(`
4
4
  `);return(0,e.jsxs)(ie,{children:[(0,e.jsx)("div",{className:"border-b border-line bg-bg-3/20 px-2",children:(0,e.jsx)(ga,{columns:t.columns,rows:t.rows.slice(0,3)})}),(0,e.jsxs)("div",{className:"flex flex-col gap-3 p-5",children:[(0,e.jsxs)("span",{className:"flex items-center gap-2 text-xs text-ink-3",children:[(0,e.jsx)(Mo,{className:"size-4"})," CSV · ",t.truncated?"First ":"",t.rows.length," ",t.rows.length===1?"row":"rows"," ·"," ",t.columns.length," ",t.columns.length===1?"column":"columns"]}),(0,e.jsx)(re,{...t}),(0,e.jsx)("span",{className:"break-all font-mono text-xs text-ink-3",children:t.filename})]}),(0,e.jsx)(le,{...t,action:(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[t.actions,(0,e.jsxs)(Es,{title:t.title,description:t.filename,action:"View data",children:[(0,e.jsx)(ga,{...t}),(0,e.jsx)(W,{asChild:!0,variant:"secondary",size:"sm",className:"w-fit",children:(0,e.jsx)("a",{download:t.filename,href:t.downloadUrl||`data:text/csv;charset=utf-8,${encodeURIComponent(n)}`,children:"Download CSV"})})]})]})})]})}a(nc,"DataCard");function Cs({src:t,alt:n}){const[r,l]=(0,d.useState)(null);return t&&r!==t?(0,e.jsx)("img",{src:t,alt:n,onError:a(()=>l(t),"onError"),loading:"lazy",className:"aspect-video w-full object-contain"}):(0,e.jsxs)("div",{className:"flex aspect-video flex-col items-center justify-center gap-3 text-ink-3",children:[(0,e.jsx)(Oa,{className:"size-8"}),(0,e.jsx)("span",{className:"text-xs",children:"No preview available"})]})}a(Cs,"ImageContent");function ac(t){return(0,e.jsxs)(ie,{children:[(0,e.jsx)("div",{className:"border-b border-line bg-bg-3/20",children:(0,e.jsx)(Cs,{src:t.imageUrl,alt:t.alt})}),(0,e.jsxs)("div",{className:"flex flex-col gap-3 p-5",children:[(0,e.jsxs)("span",{className:"flex items-center gap-2 text-xs text-ink-3",children:[(0,e.jsx)(Oa,{className:"size-4"})," Image",t.width&&t.height?` · ${t.width} × ${t.height}`:""]}),(0,e.jsx)(re,{...t}),(0,e.jsx)("span",{className:"break-all font-mono text-xs text-ink-3",children:t.filename})]}),(0,e.jsx)(le,{...t,action:t.onOpen?(0,e.jsx)(W,{size:"sm",variant:"secondary","aria-label":`View image: ${t.title}`,onClick:t.onOpen,children:"View image"}):(0,e.jsx)(Es,{title:t.title,description:t.filename,action:"View image",children:(0,e.jsx)(Cs,{src:t.imageUrl,alt:t.alt})})})]})}a(ac,"ImageCard");function rc(t){return(0,e.jsxs)(ie,{children:[(0,e.jsx)("video",{src:t.videoUrl||void 0,poster:t.posterUrl||void 0,controls:!0,preload:"metadata","aria-label":t.title,className:"aspect-video w-full border-b border-line bg-bg-3"},t.videoUrl),(0,e.jsxs)("div",{className:"flex flex-col gap-3 p-5",children:[(0,e.jsxs)("span",{className:"flex items-center gap-2 text-xs text-ink-3",children:[(0,e.jsx)(bi,{className:"size-4"})," Video",t.duration&&` · ${t.duration}`]}),(0,e.jsx)(re,{...t}),(0,e.jsx)("span",{className:"break-all font-mono text-xs text-ink-3",children:t.filename})]}),(0,e.jsx)(le,{...t,action:t.onOpen?(0,e.jsx)(W,{size:"sm",variant:"secondary","aria-label":`Open video: ${t.title}`,onClick:t.onOpen,children:"Open video"}):(0,e.jsx)(Ke,{url:t.videoUrl,children:"Open video"})})]})}a(rc,"VideoCard");function lc(t){return(0,e.jsxs)(ie,{children:[t.imageUrl&&(0,e.jsx)("div",{className:"border-b border-line bg-bg-3/20",children:(0,e.jsx)(Cs,{src:t.imageUrl,alt:t.imageAlt})}),(0,e.jsxs)("div",{className:"flex flex-col gap-4 p-5",children:[(0,e.jsxs)("span",{className:"flex items-center gap-2 text-xs text-ink-3",children:[(0,e.jsx)(Hl,{className:"size-4"})," Link preview"]}),(0,e.jsx)(re,{...t}),(0,e.jsx)("span",{className:"break-all font-mono text-xs text-ink-3",children:t.url})]}),(0,e.jsx)(le,{...t,action:(0,e.jsx)(Ke,{url:t.url,children:"Open link"})})]})}a(lc,"LinkPreviewCard");function ic(t){return(0,e.jsxs)(ie,{children:[(0,e.jsxs)("div",{className:"flex flex-col gap-4 p-5",children:[(0,e.jsxs)("span",{className:"flex items-center gap-2 text-xs text-ink-3",children:[(0,e.jsx)(pi,{className:"size-4"})," File",t.fileSize&&` · ${t.fileSize}`]}),(0,e.jsx)(re,{...t}),(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,e.jsx)("span",{className:"break-all font-mono text-xs",children:t.filename}),(0,e.jsx)("span",{className:"break-all text-xs text-ink-3",children:t.contentType})]}),t.entries.length>0&&(0,e.jsx)("ul",{className:"flex flex-col gap-2 border-t border-line pt-4",children:t.entries.map((n,r)=>(0,e.jsxs)("li",{className:"flex items-center gap-2 font-mono text-xs text-ink-3",children:[(0,e.jsx)(Os,{className:"size-3.5 shrink-0"}),n]},r))})]}),(0,e.jsx)(le,{...t,action:(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[t.actions,t.openUrl&&(0,e.jsx)(Ke,{url:t.openUrl,children:"Open file"}),t.downloadUrl?(0,e.jsx)(W,{asChild:!0,size:"sm",variant:"secondary",children:(0,e.jsx)("a",{href:t.downloadUrl,download:t.filename,children:"Download file"})}):(0,e.jsx)(W,{size:"sm",variant:"secondary",disabled:!0,children:"Download unavailable"})]})})]})}a(ic,"FileCard");function Qa(t){const{metadata:n=null,attachmentId:r}=t,l=(0,d.useContext)(fi),c=(0,d.useContext)(_a),o=c&&r&&bo({contentType:t.contentType,originalFilename:t.filename})?(0,e.jsx)(W,{variant:"secondary",size:"sm","aria-label":`Open in tab: ${t.title}`,onClick:a(()=>c(r,t.filename),"onClick"),children:"Open in tab"}):null,[x,u]=(0,d.useState)(!1),[h,b]=(0,d.useState)(!1),w=Po(t.contentType,t.filename),k=Ro(t.contentType,t.filename),$=t.contentType.split(";")[0]==="text/csv"||/\.csv$/i.test(t.filename),v=t.byteSize!==null&&t.byteSize>1048576,Q=$&&/^\/api\/attachments\/[a-zA-Z0-9-]+\/content$/.test(t.contentPath),R=A({queryKey:["artifact-csv",t.id,t.contentPath,t.updatedAt],queryFn:a(({signal:P})=>Zo(t.contentPath,P),"queryFn"),enabled:Q&&!v&&h,retry:!1,staleTime:1/0}),S=ae(t.contentPath),N=ae(t.downloadPath),X=a(()=>{l?.(S)||u(!0)},"onOpen");return(w||k)&&S?(0,e.jsxs)(e.Fragment,{children:[k?(0,e.jsx)(rc,{...t,videoUrl:S,posterUrl:Ct(T(n,"posterUrl")),duration:T(n,"durationLabel"),onOpen:X}):(0,e.jsx)(ac,{...t,imageUrl:S,alt:T(n,"alt")||t.title,width:ue(n,"width"),height:ue(n,"height"),onOpen:X}),x&&(0,e.jsx)(jo,{items:[{id:t.id,contentPath:S,contentType:t.contentType,originalFilename:t.filename,downloadPath:N}],initialIndex:0,open:!0,onOpenChange:u})]}):Q&&!v&&R.data?(0,e.jsx)(nc,{...t,...R.data,downloadUrl:N,actions:(0,e.jsxs)(e.Fragment,{children:[o,N?(0,e.jsx)(W,{asChild:!0,size:"sm",variant:"secondary",children:(0,e.jsx)("a",{href:N,download:t.filename,children:"Download file"})}):null]})}):(0,e.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,e.jsx)(ic,{...t,fileSize:Go(t.byteSize),entries:[],downloadUrl:N,openUrl:ae(t.openPath)||S,actions:(0,e.jsxs)(e.Fragment,{children:[o,Q&&!v&&!R.isError?(0,e.jsx)(W,{variant:"secondary",size:"sm",disabled:R.isFetching,onClick:a(()=>b(!0),"onClick"),children:R.isFetching?"Loading preview…":"Preview data"}):null]})}),$&&(v||R.isError||!Q)&&(0,e.jsxs)("div",{className:"px-2 text-xs text-ink-3",role:"status",children:[v?"CSV is too large to preview. Download the file to view it.":R.isError?R.error.message:"CSV preview is unavailable. Download the file to view it.",R.isError&&(0,e.jsx)(W,{variant:"ghost",size:"sm",onClick:a(()=>{R.refetch()},"onClick"),children:"Retry preview"})]})]})}a(Qa,"IssueArtifactFile");function oc({workProduct:t,author:n}){const r=t.metadata,l=ae(za(t)),c=gi(t.type,t.status,t.reviewState),o={title:t.title,summary:t.summary??"",author:n,updatedAt:M(t.updatedAt),statusBadge:t.healthStatus==="unhealthy"?(0,e.jsx)(se,{variant:"destructive",children:"Unhealthy"}):c?(0,e.jsx)(se,{variant:"outline",children:c.label}):void 0},x={additions:ue(r,"additions"),deletions:ue(r,"deletions"),filesChanged:ue(r,"changedFiles","files")};if(t.type==="pull_request"){const u=T(r,"state")||(t.status==="active"?"open":t.status),h=T(r,"checks");return(0,e.jsx)(tc,{...o,...x,number:ue(r,"number","pullRequestNumber"),repository:T(r,"repo","repository","repositoryName"),sourceBranch:T(r,"headRef","head","headBranch","branch"),targetBranch:T(r,"baseRef","base","baseBranch"),state:u==="open"||u==="draft"||u==="merged"||u==="closed"?u:"unknown",checks:h==="passed"||h==="failed"||h==="pending"?h:"unknown",evidenceSource:T(r,"evidenceSource"),reviewSummary:T(r,"reviewSummary"),url:l,statusBadge:t.reviewState==="changes_requested"||t.reviewState==="needs_board_review"||t.status==="ready_for_review"||t.status==="changes_requested"||t.status==="failed"||t.healthStatus==="unhealthy"?o.statusBadge:void 0})}if(t.type==="commit")return(0,e.jsx)(sc,{...o,...x,sha:T(r,"sha","shortSha")||t.externalId||"",repository:T(r,"repo","repository","repositoryName"),branch:T(r,"branch","branchName"),url:l});if(t.type==="preview_url")return(0,e.jsx)(lc,{...o,url:l,imageUrl:Ct(T(r,"imageUrl")),imageAlt:T(r,"imageAlt")||t.title});if(t.type==="artifact"){const u=Na(t),h=ae(u?.contentPath||T(r,"contentPath")||l);return(0,e.jsx)(Qa,{...o,id:t.id,attachmentId:u?.attachmentId,filename:T(r,"originalFilename")||t.title,contentType:T(r,"contentType"),contentPath:h,openPath:ae(T(r,"openPath"))||l||h,downloadPath:ae(T(r,"downloadPath"))||(Ct(h)?Ma({contentPath:h}):l||h),byteSize:ue(r,"byteSize","size"),metadata:r})}return(0,e.jsx)(ji,{workProduct:t,href:l||null})}a(oc,"IssueWorkProductArtifactCard");function cc(t){switch(t){case"active":case"draft":return{label:"In progress",cssVar:"--status-task-in_progress"};case"ready_for_review":return{label:"For review",cssVar:"--status-task-in_review"};case"approved":case"merged":return{label:"Done",cssVar:"--status-task-done"};case"changes_requested":return{label:"Changes requested",cssVar:"--status-task-todo"};case"failed":return{label:"Failed",cssVar:"--status-task-blocked"};default:return null}}a(cc,"workProductStatusBadge");function dc({issueId:t,workProduct:n,metadata:r,reviewDoc:l,author:c,openRequestId:o}){const x=(0,d.useContext)(_a),[u,h]=(0,d.useState)(!1),[b,w]=(0,d.useState)(!1),k=(0,d.useRef)(null),$=Ss(),v=Ia(),Q=cc(n.status),R=r.byteSize>Ml,S=Ce({mutationFn:a(()=>E.ensureWorkProductReviewDocument(t,n.id),"mutationFn"),onSuccess:a(async()=>{await v.invalidateQueries({queryKey:j.issues.documents(t)})},"onSuccess")}),N=a(()=>{l||R||S.isPending||S.isSuccess||S.isError||S.mutate()},"requestPreview"),X=a(()=>{h(H=>(H||N(),!H))},"handleToggle");(0,d.useEffect)(()=>{o!==void 0&&h(!0)},[o]),(0,d.useEffect)(()=>{o===void 0||!u||k.current?.scrollIntoView({behavior:"smooth",block:"center"})},[u,o]),(0,d.useEffect)(()=>{o!==void 0&&N()},[o,l]);const P=S.error instanceof Aa&&[413,415,422].includes(S.error.status);let p;return R?p=(0,e.jsx)("p",{className:"text-sm text-ink-3",children:"This Markdown file is too large to preview. Use Raw or Download instead."}):l?p=l.body.trim().length>0?(0,e.jsx)(Ps,{issueId:t,doc:l,bodyMarkdown:l.body,draftDirty:!1,draftConflicted:!1,historicalPreview:!1,locationHash:$.hash,panelOpen:b,onPanelOpenChange:w,panelPlacement:"popover",children:(0,e.jsx)(Ts,{children:l.body})}):(0,e.jsx)("p",{className:"text-sm text-ink-3",children:"Document is empty."}):S.isError?p=(0,e.jsxs)("div",{className:"flex flex-col items-start gap-1.5",children:[(0,e.jsx)("p",{className:"text-sm text-ink-3",children:P?"This file can't be previewed as Markdown. Use Raw or Download instead.":"Preview failed to load."}),P?null:(0,e.jsx)("button",{type:"button",className:"rounded-md border border-line px-2 py-0.5 text-(length:--text-micro) text-ink-3 hover:bg-bg-3/50",onClick:a(()=>{S.reset(),S.mutate()},"onClick"),children:"Retry"})]}):p=(0,e.jsx)("p",{className:"text-sm text-ink-3",children:"Preparing preview…"}),(0,e.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,e.jsx)("div",{ref:k,children:(0,e.jsx)(Va,{title:n.title,summary:n.summary??"",author:c,updatedAt:M(n.updatedAt),filename:r.originalFilename??n.title,revision:l?.latestRevisionNumber,body:l?.body??"",onOpen:X,expanded:u,statusBadge:Q?(0,e.jsx)("span",{className:"text-xs text-ink-3",children:Q.label}):void 0,actions:(0,e.jsxs)(e.Fragment,{children:[l?(0,e.jsx)(Rs,{issueId:t,docKey:l.key,panelOpen:b,onToggle:a(()=>{h(!0),w(H=>!H)},"onToggle")}):null,x?(0,e.jsx)("button",{type:"button",onClick:a(()=>x(r.attachmentId,r.originalFilename??n.title),"onClick"),"aria-label":`Open in tab: ${n.title}`,title:"Open in tab",className:"shrink-0 px-1.5 py-1.5 text-ink-3 hover:text-ink",children:(0,e.jsx)(Os,{className:"h-3 w-3"})}):null,(0,e.jsx)("a",{href:r.openPath,target:"_blank",rel:"noreferrer","aria-label":`Open raw ${n.title}`,title:"Open raw",className:"shrink-0 px-1.5 py-1.5 text-ink-3 hover:text-ink",children:(0,e.jsx)(Ta,{className:"h-3 w-3"})}),(0,e.jsx)("a",{href:r.downloadPath,"aria-label":`Download ${n.title}`,title:"Download",className:"shrink-0 py-1.5 pr-2 pl-0.5 text-ink-3 hover:text-ink",children:(0,e.jsx)(io,{className:"h-3 w-3"})})]})})}),u?(0,e.jsx)("div",{className:"border-t border-line px-2.5 py-2",children:p}):null]})}a(dc,"MarkdownWorkProductRow");function uc({issueId:t,doc:n,author:r,openRequestId:l,onOpen:c}){const[o,x]=(0,d.useState)(!1),[u,h]=(0,d.useState)(!1),b=(0,d.useRef)(null),w=Ss();return(0,d.useEffect)(()=>{c||l===void 0||x(!0)},[c,l]),(0,d.useEffect)(()=>{c||l===void 0||!o||b.current?.scrollIntoView({behavior:"smooth",block:"center"})},[o,c,l]),(0,e.jsxs)("div",{ref:b,children:[(0,e.jsx)(Va,{title:Bo(n),summary:"",author:r,updatedAt:M(n.updatedAt),filename:`${n.key}.md`,revision:n.latestRevisionNumber,body:n.body,onOpen:c??(()=>x(k=>!k)),expanded:c?void 0:o,actions:c?void 0:(0,e.jsx)(Rs,{issueId:t,docKey:n.key,panelOpen:u,onToggle:a(()=>{x(!0),h(k=>!k)},"onToggle")})}),o?(0,e.jsx)("div",{className:"border-t border-line px-2.5 py-2",children:n.body.trim().length>0?(0,e.jsx)(Ps,{issueId:t,doc:n,bodyMarkdown:n.body,draftDirty:!1,draftConflicted:!1,historicalPreview:!1,locationHash:w.hash,panelOpen:u,onPanelOpenChange:h,panelPlacement:"popover",children:(0,e.jsx)(Ts,{children:n.body})}):(0,e.jsx)("p",{className:"text-sm text-ink-3",children:"Document is empty."})}):null]})}a(uc,"DocumentRow");function xc({issue:t,documentDeepLink:n,onOpenDocument:r}){const{data:l,isPending:c,isError:o,refetch:x}=A({queryKey:j.issues.attachments(t.id),queryFn:a(()=>E.listAttachments(t.id),"queryFn")}),{data:u,isPending:h,isError:b,refetch:w}=Ba(t.id),{data:k,isPending:$,isError:v,refetch:Q}=Ua(t.id),{data:R}=A({queryKey:j.issues.runs(t.id),queryFn:a(()=>qi.runsForIssue(t.id),"queryFn")}),{data:S}=A({queryKey:j.agents.list(t.companyId),queryFn:a(()=>Wa.list(t.companyId),"queryFn")}),N=u??[],X=(k??[]).filter(f=>!va(f.key)),P=new Map((k??[]).map(f=>[f.key,f])),p=Da(l,u),H=(0,d.useMemo)(()=>new Map((R??[]).map(f=>[f.runId,f])),[R]),Ie=(0,d.useMemo)(()=>new Map((S??[]).map(f=>[f.id,f])),[S]),Z=[...(0,d.useMemo)(()=>[...N.map(f=>({kind:"work_product",id:f.id,runId:f.createdByRunId,date:new Date(f.createdAt),value:f})),...X.map(f=>({kind:"document",id:f.id,runId:null,date:new Date(f.createdAt),value:f})),...p.map(f=>({kind:"attachment",id:f.id,runId:null,date:new Date(f.createdAt),value:f}))],[X,p,N]).reduce((f,z)=>{const Y=z.runId??"other",O=f.get(Y)??[];return O.push(z),f.set(Y,O),f},new Map)].map(([f,z])=>({runId:f,rows:z.sort((Y,O)=>O.date.getTime()-Y.date.getTime()),date:f==="other"?z[0]?.date??new Date(0):new Date(H.get(f)?.startedAt??z[0]?.date??0)})).sort((f,z)=>z.date.getTime()-f.date.getTime()),xe=o||b||v?(0,e.jsxs)("div",{role:"alert",className:"px-1 py-3 text-sm text-ink-3",children:["Some artifacts could not be loaded.",(0,e.jsx)("button",{className:"ml-2 underline",onClick:a(()=>{x(),w(),Q()},"onClick"),children:"Retry"})]}):c||h||$?(0,e.jsx)("p",{role:"status",className:"px-1 py-3 text-sm text-ink-3",children:"Loading artifacts…"}):null;return N.length===0&&X.length===0&&p.length===0?xe||(0,e.jsx)("div",{className:"px-1 py-6 text-sm text-ink-3",children:"No artifacts yet. Work products, documents, and agent-produced files will appear here."}):(0,e.jsxs)("div",{className:"@container flex flex-col gap-3 py-2",children:[xe,Z.map(f=>{const z=f.runId==="other"?null:H.get(f.runId),Y=z?Ie.get(z.agentId):null;return(0,e.jsxs)("section",{className:"flex flex-col gap-1.5",children:[f.runId!=="other"?(0,e.jsxs)("header",{className:"flex items-baseline justify-between gap-2 px-1",children:[(0,e.jsx)("h3",{className:"truncate text-xs font-medium text-ink",children:Y?.name??`Run ${f.runId.slice(0,8)}`}),(0,e.jsx)("time",{className:"shrink-0 text-(length:--text-micro) text-ink-3",dateTime:f.date.toISOString(),children:M(f.date)})]}):null,(0,e.jsx)("ul",{className:"grid grid-cols-1 gap-3",children:f.rows.map(O=>{if(O.kind==="work_product"){const L=O.value,Qe=El(L);if(Qe){const He=$l(L.id);return(0,e.jsx)("li",{className:"col-span-full min-w-0",children:(0,e.jsx)(dc,{issueId:t.id,workProduct:L,author:Y?.name??"",metadata:Qe,reviewDoc:P.get(He),openRequestId:n?.documentKey===He?n.requestId:void 0})},O.id)}return(0,e.jsx)("li",{className:"col-span-full min-w-0",children:(0,e.jsx)(oc,{workProduct:L,author:Y?.name??""})},O.id)}if(O.kind==="document"){const L=O.value;return(0,e.jsx)("li",{className:"col-span-full min-w-0",children:(0,e.jsx)(uc,{issueId:t.id,doc:L,author:Ie.get(L.updatedByAgentId??L.createdByAgentId??"")?.name??"",onOpen:r?()=>r(L):void 0,openRequestId:n?.documentKey===L.key?n.requestId:void 0})},O.id)}const B=O.value,Ve=B.originalFilename??B.objectKey;return(0,e.jsx)("li",{className:"col-span-full min-w-0",children:(0,e.jsx)(Qa,{id:B.id,attachmentId:B.id,title:Ve,summary:"",author:Ie.get(B.createdByAgentId??"")?.name??"",updatedAt:M(B.updatedAt),filename:Ve,contentType:B.contentType,contentPath:B.contentPath,openPath:go(B),downloadPath:Ma(B),byteSize:B.byteSize})},O.id)})})]},f.runId)})]})}a(xc,"IssuePropertiesArtifactsTab");function ze({children:t,className:n,title:r,first:l,streamlined:c}){return(0,e.jsxs)("div",{className:n,"data-property-section":"true",children:[r?(0,e.jsx)("div",{className:g(c?"pb-1 font-mono text-(length:--text-nano) font-normal uppercase tracking-wide text-ink-3/70":"text-xs font-semibold uppercase tracking-wide text-ink-3 pb-1",l?"pt-0":"pt-3"),children:r}):null,(0,e.jsx)("div",{className:"space-y-0.5",children:t})]})}a(ze,"PropertySection");function I({label:t,children:n,wrap:r}){return(0,e.jsxs)("div",{className:g("flex w-full min-w-0 gap-3 py-1",r?"items-start":"items-center"),"data-property-row":"true",children:[(0,e.jsx)("span",{className:g("text-xs text-ink-3 shrink-0 w-24 truncate",r&&"mt-0.5"),"data-property-label":typeof t=="string"?t:void 0,title:typeof t=="string"?t:void 0,children:t}),(0,e.jsx)("div",{className:g("flex min-w-0 flex-1 items-center gap-1.5",r&&"flex-col items-start"),"data-property-value":"true",children:n})]})}a(I,"PropertyRow");function ba({children:t,className:n,style:r,title:l}){return(0,e.jsx)(se,{variant:"outline",className:g("max-w-full min-w-0 justify-start truncate font-normal",n),style:r,title:l??(typeof t=="string"?t:void 0),children:t})}a(ba,"PropertyChip");function Ha({hiddenCount:t,expanded:n,onClick:r}){return!n&&t<=0?null:(0,e.jsx)("button",{type:"button",className:"inline-flex items-center gap-1 rounded-full border border-line px-2 py-0.5 text-xs text-ink-3 transition-colors hover:bg-bg-3/50 hover:text-ink",onClick:r,"aria-label":n?"Show fewer items":`Show ${t} more items`,children:n?"Show less":`Show ${t} more`})}a(Ha,"ExpandRelationListButton");var mc=5;function hc(t){return[...t].sort((n,r)=>{const l=ia(n.group.object?.statusTone);return ia(r.group.object?.statusTone)-l})}a(hc,"sortExternalObjectGroups");function Ga(t){const{pill:n}=t,r=n.displayKey?.trim();if(r)return r;if(n.providerKey==="github"){if(n.objectType==="pull_request")return"Github PR";if(n.objectType==="issue")return"Github Issue"}return ui(n.providerKey,n.objectType)}a(Ga,"externalObjectRowDisplayKey");function pc(t){const{pill:n}=t,r=Ga(t),l=mi(n.iconKey);return(0,e.jsxs)("span",{className:"inline-flex min-w-0 items-start gap-1",title:r,children:[l?(0,e.jsx)(l,{"aria-hidden":"true",className:"h-3.5 w-3.5 shrink-0 mt-0.5"}):null,(0,e.jsx)("span",{className:"truncate",children:r})]})}a(pc,"externalObjectRowLabel");function fc(t){if(!t)return null;try{const n=new URL(t);if(n.hostname!=="github.com")return null;const[,r,l,c,o]=n.pathname.split("/");return!r||!l||!o?null:c==="pull"?`PR ${o}`:c==="issues"?`Issue ${o}`:null}catch{return null}}a(fc,"githubObjectPropertyValue");function Ws(t){return Pa(t.pill)}a(Ws,"externalObjectPropertyStatusLabel");function Xa(t){const{pill:n}=t,r=Ws(t),l=(n.providerKey==="github"?fc(n.url):null)??n.displayTitle?.trim()??Ga(t);return r?`${l} - ${r}`:l}a(Xa,"externalObjectPropertyValue");function Ya(t){const n=Ws(t);return t.pill.statusIconKey==="git-merge"||n.toLowerCase()==="merged"}a(Ya,"isMergedExternalObject");function gc(t){return(Ya(t)?sa.merged:sa[t.pill.statusCategory]??"text-ink-3 border-ink-3").split(" ").filter(n=>n.startsWith("text-")).join(" ")}a(gc,"externalObjectPropertyTone");function bc(t){return Ya(t)?t.pill.statusIconKey??"git-merge":t.pill.statusIconKey}a(bc,"externalObjectPropertyStatusIconKey");function ja(t){const{pill:n,sourceLabels:r}=t,l=n.displayTitle??Xa(t);return r.length>0?`${l} - ${r.join(", ")}`:l}a(ja,"externalObjectPropertyTitle");function jc({group:t}){const{pill:n}=t,r=Ws(t),l=xi(n.providerKey),c=ci(n.objectType),o=Xa(t),x=(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ra,{category:n.statusCategory,liveness:n.liveness,statusIconKey:bc(t),sizeClassName:"h-3.5 w-3.5",label:`${l}: ${r}`}),(0,e.jsx)("span",{className:"min-w-0 truncate",children:o})]}),u=g("inline-flex min-w-0 max-w-full items-center gap-1.5 text-sm no-underline pointer-coarse:min-h-6",gc(t),n.url?"hover:underline focus-visible:outline-none focus-visible:ring-(length:--rad-3) focus-visible:ring-focus":"");return n.url?(0,e.jsx)("a",{href:n.url,target:"_blank",rel:"noopener noreferrer","data-mention-kind":"external-object","data-external-status":n.statusCategory,"data-external-liveness":n.liveness,className:u,title:ja(t),"aria-label":`${l} ${c} - ${r}: ${n.displayTitle??o}`,children:x}):(0,e.jsx)("span",{"data-mention-kind":"external-object","data-external-status":n.statusCategory,"data-external-liveness":n.liveness,className:u,title:ja(t),"aria-label":`${l} ${c} - ${r}: ${n.displayTitle??o}`,children:x})}a(jc,"ExternalObjectPropertyValue");function yc({externalObjects:t,externalObjectsLoading:n,externalObjectsError:r,onRetryExternalObjects:l}){const[c,o]=(0,d.useState)(!1);if((0,d.useEffect)(()=>{o(!1)},[t]),r)return(0,e.jsx)(I,{label:"External objects",children:(0,e.jsxs)("span",{className:"text-xs text-ink-3",children:["Couldn't load external objects.",l?(0,e.jsxs)(e.Fragment,{children:[" ",(0,e.jsx)("button",{type:"button",className:"text-accent underline-offset-2 hover:underline",onClick:l,children:"Retry"})]}):null]})});if(n)return(0,e.jsx)(I,{label:"External objects",children:(0,e.jsx)("span",{className:"h-4 w-24 animate-pulse rounded bg-bg-3/40"})});if(!t||t.length===0)return null;const x=hc(t),u=c?x:x.slice(0,mc),h=x.length-u.length;return(0,e.jsxs)(e.Fragment,{children:[u.map(b=>{const{pill:w,group:k}=b;return(0,e.jsx)(I,{label:pc(b),children:(0,e.jsx)(jc,{group:b})},k.object?.id??`${w.providerKey}:${w.objectType}:${w.url??"anon"}`)}),c||h>0?(0,e.jsx)(I,{label:"References",children:(0,e.jsx)(Ha,{hiddenCount:h,expanded:c,onClick:a(()=>o(b=>!b),"onClick")})}):null]})}a(yc,"ExternalObjectRows");function kc(t){return t?t.executionWorkspacePolicy?.defaultProjectWorkspaceId??t.workspaces?.find(n=>n.isPrimary)?.id??t.workspaces?.[0]?.id??null:null}a(kc,"defaultProjectWorkspaceIdForProject");function wc(t){const n=t?.executionWorkspacePolicy?.enabled?t.executionWorkspacePolicy.defaultMode:null;return n==="isolated_workspace"||n==="operator_branch"?n:n==="adapter_default"?"agent_default":"shared_workspace"}a(wc,"defaultExecutionWorkspaceModeForProject");function vc(t){return t?.primaryWorkspace?.id??t?.workspaces.find(n=>n.isPrimary)?.id??t?.workspaces[0]?.id??null}a(vc,"primaryWorkspaceIdForProject");function Nc(t){const n=t.issue.currentExecutionWorkspace??null,r=vc(t.project),l=n?.projectWorkspaceId??t.issue.projectWorkspaceId??null;return n?n.mode!=="shared_workspace"?!1:!l||!r?!0:n.mode==="shared_workspace"&&l===r:!l||!r?!0:l===r}a(Nc,"isMainIssueWorkspace");function ya(t){if(!t)return"";const n=new Date(t);if(Number.isNaN(n.getTime()))return"";const r=n.getTimezoneOffset()*6e4;return new Date(n.getTime()-r).toISOString().slice(0,16)}a(ya,"toDateTimeLocalValue");function Cc(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)?t:{}}a(Cc,"asRecord");function K({inline:t,label:n,open:r,onOpenChange:l,triggerContent:c,triggerClassName:o,popoverClassName:x,popoverAlign:u="end",extra:h,stacked:b=!1,separateTrigger:w=!1,children:k}){const $=g("inline-flex min-h-5 items-center gap-1.5 cursor-pointer hover:bg-bg-3/50 rounded px-1 -mx-1 py-0.5 transition-colors min-w-0 max-w-full text-left","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus",o);if(w){const v=(0,e.jsx)("button",{type:"button",className:g($,"shrink-0"),"aria-label":`Edit ${n.toLowerCase()}`,"aria-expanded":r,onClick:t?()=>l(!r):void 0,children:(0,e.jsx)(ws,{className:g("h-3 w-3 text-ink-3",r&&"rotate-180"),"aria-hidden":!0})});return(0,e.jsxs)("div",{children:[(0,e.jsxs)(I,{label:n,wrap:b,children:[(0,e.jsxs)("div",{className:"flex min-w-0 max-w-full items-start gap-1.5",children:[c,t?v:(0,e.jsxs)(la,{open:r,onOpenChange:l,children:[(0,e.jsx)(aa,{asChild:!0,children:v}),(0,e.jsx)(ra,{className:g("p-1",x),align:u,collisionPadding:16,children:k})]})]}),h]}),t&&r?(0,e.jsx)("div",{className:g("rounded-md border border-line bg-bg-2 p-1 mb-2",x),children:k}):null]})}return t?(0,e.jsxs)("div",{children:[(0,e.jsxs)(I,{label:n,wrap:b,children:[(0,e.jsxs)("button",{className:g($,b&&"items-start"),onClick:a(()=>l(!r),"onClick"),"aria-expanded":r,children:[c,(0,e.jsx)(ws,{className:g("ml-auto h-3 w-3 shrink-0 text-ink-3 transition-transform",r&&"rotate-180"),"aria-hidden":!0})]}),h]}),r&&(0,e.jsx)("div",{className:g("rounded-md border border-line bg-bg-2 p-1 mb-2",x),children:k})]}):(0,e.jsxs)(I,{label:n,wrap:b,children:[(0,e.jsxs)(la,{open:r,onOpenChange:l,children:[(0,e.jsx)(aa,{asChild:!0,children:(0,e.jsxs)("button",{className:g($,b&&"items-start"),"aria-expanded":r,children:[c,(0,e.jsx)(ws,{className:g("ml-auto h-3 w-3 shrink-0 text-ink-3 transition-transform",r&&"rotate-180"),"aria-hidden":!0})]})}),(0,e.jsx)(ra,{className:g("p-1",x),align:u,collisionPadding:16,children:k})]}),h]})}a(K,"PropertyPicker");var Ic={origin:"origin",work:"work",reference:"reference"};function Ac({issueId:t}){const n=Ql(),{data:r}=A({queryKey:j.instance.experimentalSettings,queryFn:a(()=>$a.getExperimental(),"queryFn")}),l=r?.enableCases===!0,c=A({queryKey:j.cases.forIssue(t),queryFn:a(()=>$o.listForIssue(t),"queryFn"),enabled:l&&!!t});if(!l)return null;const o=c.data??[];return c.isError?(0,e.jsxs)("section",{className:"space-y-2",children:[(0,e.jsx)("h3",{className:"text-xs font-semibold uppercase tracking-wide text-ink-3",children:"Cases"}),(0,e.jsx)("p",{className:"text-sm text-bad",children:"Could not load linked cases."})]}):o.length===0?null:(0,e.jsxs)("section",{className:"space-y-2",children:[(0,e.jsx)("h3",{className:"text-xs font-semibold uppercase tracking-wide text-ink-3",children:"Cases"}),(0,e.jsx)("div",{className:"space-y-1",children:o.map(x=>(0,e.jsxs)(V,{to:n(x.case.identifier),className:"flex items-center gap-2 rounded-md border border-line px-2.5 py-1.5 text-sm transition-colors hover:bg-bg-3/50",children:[(0,e.jsx)("span",{className:"font-mono text-xs text-ink-3 shrink-0",children:x.case.identifier}),(0,e.jsx)("span",{className:"min-w-0 flex-1 truncate",title:x.case.title,children:x.case.title}),(0,e.jsx)(se,{variant:"secondary",className:"shrink-0",children:Ic[x.role]}),(0,e.jsx)(ho,{status:x.case.status})]},x.id))})]})}a(Ac,"IssueCasesPanel");function Sc(t){const n=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return n<=0||n>=t.length-1?null:{prefix:t.slice(0,n+1),suffix:t.slice(n+1)}}a(Sc,"splitMiddleTruncation");function ka({value:t,icon:n}){const[r,l]=(0,d.useState)(!1),c=(0,d.useRef)(void 0);(0,d.useEffect)(()=>()=>clearTimeout(c.current),[]);const o=(0,d.useCallback)(async()=>{try{await Gi(t),l(!0),clearTimeout(c.current),c.current=setTimeout(()=>l(!1),1500)}catch{}},[t]),x=Sc(t);return(0,e.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0 flex-1",title:t,children:[(0,e.jsx)(n,{className:"h-3.5 w-3.5 text-ink-3 shrink-0"}),(0,e.jsx)("button",{type:"button",className:g("cursor-pointer text-left font-mono text-sm transition-colors hover:text-ink","min-w-0 flex-1"),onClick:o,title:t,"aria-label":`Copy ${t} to clipboard`,children:x?(0,e.jsxs)("span",{className:"flex min-w-0","data-middle-truncate":"true",children:[(0,e.jsx)("span",{className:"min-w-0 truncate",children:x.prefix}),(0,e.jsx)("span",{className:"max-w-1/2 shrink-0 truncate",children:x.suffix})]}):(0,e.jsx)("span",{className:"block truncate",children:t})}),r&&(0,e.jsxs)("span",{className:g("inline-flex items-center gap-1 text-xs shrink-0",Vl.done),role:"status",children:[(0,e.jsx)(ne,{className:"h-3 w-3 shrink-0"}),"Copied"]})]})}a(ka,"TruncatedCopyable");var Ne=50,Pc=5,wa="task-detail-pane-tab h-7 rounded-md text-sm font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus";function Hd({issue:t,childIssues:n=[],issueLinkState:r,onAddSubIssue:l,onUpdate:c,inline:o,hasActiveRun:x=!1,externalObjects:u,externalObjectsLoading:h,externalObjectsError:b,onRetryExternalObjects:w,onCheckMonitorNow:k,checkingMonitorNow:$=!1,documentDeepLink:v,sidePanelContentOnly:Q=!1}){const R=Uo(t.executionPolicy),S=R.success,N=R.success?R.data:null,{selectedCompanyId:X}=Kl(),P=Ia(),p=t.companyId??X,{data:H}=A({queryKey:j.instance.experimentalSettings,queryFn:a(()=>$a.getExperimental(),"queryFn")}),Ie=H===void 0||H.enableManagedSandboxOnly===!0,[Z,xe]=(0,d.useState)(null);(0,d.useEffect)(()=>{if(o){xe(null);return}xe(document.getElementById(co))},[o]);const{data:f}=qa(t.id),{data:z}=A({queryKey:j.issues.acceptedPlanDecompositions(t.id),queryFn:a(()=>E.listAcceptedPlanDecompositions(t.id),"queryFn"),enabled:!0}),{data:Y}=A({queryKey:j.issues.attachments(t.id),queryFn:a(()=>E.listAttachments(t.id),"queryFn"),enabled:!0}),{data:O,isError:B,refetch:Ve}=Ba(t.id),L=(0,d.useMemo)(()=>Do(O),[O]),Qe=(0,d.useMemo)(()=>{const s=new Set(L.map(i=>Ue(At(i))).filter(Boolean));return u?.filter(i=>!s.has(Ue(i.pill.url)))},[u,L]),{data:He}=Ua(t.id),$s=(He??[]).filter(s=>!va(s.key)),me=!!f||(z?.length??0)>0||$s.length>0,Ge=(O?.length??0)>0||$s.length>0||Da(Y,O).length>0,[he,Ae]=(0,d.useState)("properties"),[St,Xe]=(0,d.useState)(()=>new Set),Se=(0,d.useRef)(!1),Za=(0,d.useCallback)(s=>{Se.current=!0,Ae(s)},[]);(0,d.useEffect)(()=>{Xe(new Set)},[t.id]),(0,d.useEffect)(()=>{me&&!Se.current&&Ae("plans")},[me]),(0,d.useEffect)(()=>{if(!v)return;const s=v.tab;s!=="document"&&(Se.current=!0,Ae(s),Xe(i=>{if(!i.has(s))return i;const m=new Set(i);return m.delete(s),m}))},[v]);const[_s,Ms]=(0,d.useState)(!1),[Pt,Rt]=(0,d.useState)(""),[pe,Ye]=(0,d.useState)(null),[Ls,Fs]=(0,d.useState)(!1),[Tt,Bs]=(0,d.useState)(""),[qs,Ds]=(0,d.useState)(!1),[Ja,Ze]=(0,d.useState)("mode"),[Ot,Et]=(0,d.useState)(""),[Je,et]=(0,d.useState)(!1),[zs,tt]=(0,d.useState)(""),[Us,Ks]=(0,d.useState)(!1),[er,st]=(0,d.useState)(!1),[nt,Wt]=(0,d.useState)(!1),[Vs,Qs]=(0,d.useState)(""),[tr,sr]=(0,d.useState)(!1),[nr,Hs]=(0,d.useState)(""),[ar,rr]=(0,d.useState)(!1),[lr,Gs]=(0,d.useState)(""),[ir,at]=(0,d.useState)(!1),[or,Pe]=(0,d.useState)(!1),[cr,dr]=(0,d.useState)(!1),[ur,xr]=(0,d.useState)(!1),[mr,hr]=(0,d.useState)(!1),[$t,Xs]=(0,d.useState)(""),[_t,Ys]=(0,d.useState)(""),[Zs,pr]=(0,d.useState)("#6366f1"),[rt,Js]=(0,d.useState)(()=>ya(N?.monitor?.nextCheckAt)),[en,tn]=(0,d.useState)(N?.monitor?.notes??""),[sn,nn]=(0,d.useState)(N?.monitor?.serviceName??""),[an,rn]=(0,d.useState)(null),[ln,on]=(0,d.useState)(null),[cn,Mt]=(0,d.useState)(null),[Lt,lt]=(0,d.useState)(!1),[Re,Ft]=(0,d.useState)(t.watchdog?.watchdogAgentId??""),[dn,Bt]=(0,d.useState)(t.watchdog?.instructions??""),fe=zs.trim(),Te=Vs.trim();(0,d.useEffect)(()=>{Ks(!1)},[t.id]);const{data:un}=A({queryKey:j.auth.session,queryFn:a(()=>ql.getSession(),"queryFn")}),q=un?.user?.id??un?.session?.userId,{data:D}=A({queryKey:j.agents.list(p),queryFn:a(()=>Wa.list(p),"queryFn"),enabled:!!p}),{data:ge}=A({queryKey:j.access.companyUserDirectory(p),queryFn:a(()=>Li.listUserDirectory(p),"queryFn"),enabled:!!p}),{data:qt}=A({queryKey:j.projects.list(p,{includeArchived:!0}),queryFn:a(()=>Ti.list(p,{includeArchived:!0}),"queryFn"),enabled:!!p}),fr=(0,d.useMemo)(()=>(qt??[]).filter(s=>!s.archivedAt||s.id===t.projectId),[qt,t.projectId]),{orderedProjects:Dt}=oo({projects:fr,companyId:p,userId:q}),{data:zt}=A({queryKey:j.issues.labels(p),queryFn:a(()=>E.listLabels(p),"queryFn"),enabled:!!p}),{data:oe,isFetching:xn}=A({queryKey:j.issues.list(p),queryFn:a(()=>E.list(p),"queryFn"),enabled:!!p&&(nt||Je&&fe.length===0)}),{data:gr,isFetching:br}=A({queryKey:p?j.issues.search(p,fe,void 0,Ne):["issues","blocker-search",fe,Ne],queryFn:a(()=>E.list(p,{q:fe,limit:Ne}),"queryFn"),enabled:!!p&&Je&&fe.length>0}),{data:jr,isFetching:yr}=A({queryKey:p?j.issues.search(p,Te,void 0,Ne):["issues","blocker-search",Te,Ne],queryFn:a(()=>E.list(p,{q:Te,limit:Ne}),"queryFn"),enabled:!!p&&nt&&Te.length>0}),Ut=Ce({mutationFn:a(s=>E.createLabel(p,s),"mutationFn"),onSuccess:a(async s=>{P.setQueryData(j.issues.labels(p),i=>i?i.some(m=>m.id===s.id)?i:[...i,s]:[s]),c({labelIds:[...t.labelIds??[],s.id]}),P.invalidateQueries({queryKey:j.issues.labels(p)}),Ys("")},"onSuccess")}),Kt=Ce({mutationFn:a(()=>E.unarchiveFromInbox(t.id),"mutationFn"),onMutate:a(()=>{Mt(null)},"onMutate"),onSuccess:a(()=>{Mt(null),P.setQueryData(j.issues.detail(t.id),s=>s&&{...s,archivedAt:null,archivedByActorType:null,archivedByAgentId:null,archivedByRunId:null}),P.invalidateQueries({queryKey:j.issues.detail(t.id)}),p&&Ri(P,p)},"onSuccess"),onError:a(s=>{Mt(s instanceof Error&&s.message.trim().length>0?s.message:"Failed to unarchive this issue. Please try again.")},"onError")}),kr=a(s=>{const i=t.labelIds??[];c({labelIds:i.includes(s)?i.filter(m=>m!==s):[...i,s]})},"toggleLabel"),be=a(s=>!s||!D?null:D.find(i=>i.id===s)?.name??s.slice(0,8),"agentName"),mn=a(s=>s?Dt.find(i=>i.id===s)?.name??s.slice(0,8):s?.slice(0,8)??"None","projectName"),wr=t.projectId?Dt.find(s=>s.id===t.projectId)??null:null,je=t.project??wr,{visible:Vt}=mo(),Qt=Vt&&H?.enableIsolatedWorkspaces===!0&&!!je?.executionWorkspacePolicy?.enabled,{data:Ht,isLoading:vr,isError:Nr}=A({queryKey:j.executionWorkspaces.list(p,{projectId:t.projectId??void 0,projectWorkspaceId:t.projectWorkspaceId??void 0,reuseEligible:!0}),queryFn:a(()=>ha.list(p,{projectId:t.projectId??void 0,projectWorkspaceId:t.projectWorkspaceId??void 0,reuseEligible:!0}),"queryFn"),enabled:!!p&&!!t.projectId&&Qt&&qs}),hn=Eo(t,je),Cr=t.executionWorkspacePreference!=null||t.executionWorkspaceSettings!=null,ye=hn==="reuse_existing"?"reuse":Cr&&hn==="isolated_workspace"?"isolated":"default",pn=(0,d.useMemo)(()=>uo(to(Ht??[])).map(s=>({...s,options:s.options.filter(i=>lo(i,Ot))})).filter(s=>s.options.length>0),[Ht,Ot]),fn=(Ht??[]).find(s=>s.id===t.executionWorkspaceId)??t.currentExecutionWorkspace??null,Ir=ye==="isolated"?"New isolated workspace":ye==="reuse"?fn?.name??"Reuse existing workspace":"Default",Ar=ye==="reuse"?fn?.branchName??void 0:void 0,Sr=a(()=>{Ds(!1),Ze("mode"),Et("")},"closeWorkspacePicker"),Gt=a((s,i)=>{const m=Wo(s,i?.id,i?.mode);m&&(c(m),Sr())},"saveWorkspaceSelection"),Xt=(0,d.useMemo)(()=>Nc({issue:t,project:je}),[t,je]),Pr=!!t.executionWorkspaceId&&!Xt,Yt=Xt?null:t.currentExecutionWorkspace?.config?.workspaceRuntime??null,gn=t.currentExecutionWorkspace?.runtimeServices??[],Zt=!!t.currentExecutionWorkspace?.cwd,bn=!!Yt&&Zt,Jt=(0,d.useMemo)(()=>Ul({runtimeConfig:Yt,runtimeServices:gn,canStartServices:bn,canRunJobs:Zt}),[Zt,bn,Yt,gn]),jn=!Xt&&(Jt.services.length>0||Jt.otherServices.length>0),it=Ce({mutationFn:a(s=>{const i=t.currentExecutionWorkspace?.id??t.executionWorkspaceId;if(!i)throw new Error("This task is not attached to a workspace.");return ha.controlRuntimeCommands(i,s.action,s)},"mutationFn"),onSuccess:a((s,i)=>{P.setQueryData(j.executionWorkspaces.detail(s.workspace.id),s.workspace),P.invalidateQueries({queryKey:j.issues.detail(t.id)}),P.invalidateQueries({queryKey:j.projects.detail(s.workspace.projectId)}),P.invalidateQueries({queryKey:j.executionWorkspaces.overview(s.workspace.companyId)}),P.invalidateQueries({queryKey:j.executionWorkspaces.workspaceOperations(s.workspace.id)}),p&&(P.invalidateQueries({queryKey:j.issues.list(p)}),P.invalidateQueries({queryKey:j.executionWorkspaces.list(p)})),on(null),rn(i.action==="run"?"Workspace job completed.":i.action==="stop"?"Workspace service stopped.":i.action==="restart"?"Workspace service restarted.":"Workspace service started.")},"onSuccess"),onError:a(s=>{rn(null),on(s instanceof Error?s.message:"Failed to control workspace commands.")},"onError")}),Rr=it.isPending?it.variables??null:null,yn=t.referencedIssueIdentifiers??[],kn=(0,d.useMemo)(()=>{const s=t.relatedWork?.outbound.map(({issue:i})=>({id:i.id,identifier:i.identifier,title:i.title,status:i.status}))??[];return s.length>0?s:yn.map(i=>({id:i,identifier:i,title:i}))},[t.relatedWork?.outbound,yn]),wn=(0,d.useMemo)(()=>t.relatedWork?.inbound.map(({issue:s})=>({id:s.id,identifier:s.identifier,title:s.title,status:s.status}))??[],[t.relatedWork?.inbound]),Tr=a(s=>{if(!s)return null;const i=qt?.find(m=>m.id===s)??null;return i?Fl(i):`/projects/${s}`},"projectLink"),vn=(0,d.useMemo)(()=>Qi(),[_s]),Nn=(0,d.useMemo)(()=>Vi((D??[]).filter(ma),vn),[D,vn]),Or=(0,d.useMemo)(()=>fo(),[Ls]),es=(0,d.useMemo)(()=>ao(ge?.users),[ge?.users]),Er=(0,d.useMemo)(()=>po(ge?.users),[ge?.users]),Cn=(0,d.useMemo)(()=>so(ge?.users,{excludeUserIds:[q,t.createdByUserId]}),[ge?.users,q,t.createdByUserId]),Oe=t.assigneeAgentId?D?.find(s=>s.id===t.assigneeAgentId):null,ts=t.assigneeAdapterOverrides??null,Wr=ts!==null,ss=Cc(ts?.adapterConfig),$r=typeof ss.model=="string"?ss.model:"",_r=String(ss.effort??""),Mr=a(s=>{c({assigneeAdapterOverrides:s})},"updateAssigneeAdapterOverrides"),Lr=(()=>{if(ts?.adapterConfig){const s=[$r,_r].filter(Boolean),i=s.length>0?`Override · ${s.join(" · ")}`:"Override · adapter options";return(0,e.jsx)("span",{className:"min-w-0 truncate text-sm",title:`Task-level model override — replaces the agent's primary model for this issue.${s.length>0?` (${s.join(" · ")})`:""}`,children:i})}return(0,e.jsx)("span",{className:"text-sm text-ink-3",children:"Primary model"})})(),Fr=(0,e.jsxs)("div",{className:"w-full space-y-2 p-2",children:[(0,e.jsx)("p",{className:"text-xs text-ink-3",children:Oe?"This assignee's adapter does not expose editable task overrides.":"Select a compatible assignee agent to edit these overrides."}),(0,e.jsx)("button",{type:"button",className:"inline-flex items-center rounded-full border border-line px-2 py-0.5 text-xs text-ink-3 transition-colors hover:bg-bg-3/50 hover:text-ink",onClick:a(()=>Mr(null),"onClick"),children:"Clear adapter options"})]}),J=xa(t.executionPolicy,"review"),ee=xa(t.executionPolicy,"approval"),Ee=a(s=>Bi(s,q,es),"userLabel"),In=a(s=>Fi(s,es),"actualUserLabel"),ns=Ee(t.assigneeUserId),We=In(t.createdByUserId),U=Dl(t),An=U?.kind==="user"?Er.get(U.id):null,Sn=U?.kind==="user"&&U.viaAgentId?be(U.viaAgentId)??U.viaAgentId.slice(0,8):null,as=t.assigneeAgentId?`agent:${t.assigneeAgentId}`:t.assigneeUserId?`user:${t.assigneeUserId}`:"",Br=(0,d.useMemo)(()=>({agentMap:new Map((D??[]).map(s=>[s.id,s])),resolveUserLabel:a(s=>Ee(s),"resolveUserLabel")}),[D,es,q]),Pn=(0,d.useMemo)(()=>Co({runningAgentName:Oe?.name??null}),[Oe?.name]),Rn=a(()=>{Ms(!1),Rt(""),Ye(null)},"closeAssigneePicker"),Tn=a((s,i)=>{i?.(),c(s),Rn()},"applyAssignee"),rs=a((s,i,m)=>{if((s.assigneeAgentId?`agent:${s.assigneeAgentId}`:s.assigneeUserId?`user:${s.assigneeUserId}`:"")===as){Rn();return}if(x){Ye({...s,label:i,track:m});return}Tn(s,m)},"selectAssignee"),ls=a((s,i)=>{S&&c({executionPolicy:ua({existingPolicy:t.executionPolicy??null,reviewerValues:s,approverValues:i})})},"updateExecutionPolicy"),ot=a((s,i)=>{const m=s==="review"?J:ee,y=m.includes(i)?m.filter(te=>te!==i):[...m,i];ls(s==="review"?y:J,s==="approval"?y:ee)},"toggleExecutionParticipant"),On=a(s=>s.startsWith("agent:")?be(s.slice(6))??s.slice(6,14):s.startsWith("user:")?Ee(s.slice(5))??"User":s,"executionParticipantLabel"),En=J.map(s=>On(s)).join(", "),Wn=ee.map(s=>On(s)).join(", "),qr=J.length>0?(0,e.jsx)("span",{className:"text-sm truncate min-w-0",title:En,children:En}):(0,e.jsx)("span",{className:"text-sm text-ink-3",children:"None"}),Dr=ee.length>0?(0,e.jsx)("span",{className:"text-sm truncate min-w-0",title:Wn,children:Wn}):(0,e.jsx)("span",{className:"text-sm text-ink-3",children:"None"}),ct=To(t.reviewPolicy),$n=t.executionState?.status==="changes_requested"&&t.executionState.currentStageType?t.executionState.currentStageType:t.executionState?null:J.length>0?"review":ee.length>0?"approval":null,_n=a(s=>(0,e.jsx)(I,{label:"",children:(0,e.jsx)("button",{type:"button",className:"inline-flex items-center rounded-full border border-line px-2 py-0.5 text-xs text-ink-3 transition-colors hover:bg-bg-3/50 hover:text-ink",onClick:a(()=>c({status:"in_review"}),"onClick"),children:s==="review"?"Run review now":"Run approval now"})}),"runExecutionButton"),is=(()=>{if(!t.executionState?.currentStageType)return null;const s=t.executionState.currentStageType==="review"?"Review":"Approval",i=t.executionState.currentParticipant,m=i?i.type==="agent"?be(i.agentId??null):Ee(i.userId??null):null;return t.executionState.status==="changes_requested"?`${s} requested changes${m?` by ${m}`:""}`:`${s} pending${m?` with ${m}`:""}`})();(0,d.useEffect)(()=>{Js(ya(N?.monitor?.nextCheckAt)),tn(N?.monitor?.notes??""),nn(N?.monitor?.serviceName??"")},[N?.monitor?.nextCheckAt,N?.monitor?.notes,N?.monitor?.serviceName]),(0,d.useEffect)(()=>{Lt||(Ft(t.watchdog?.watchdogAgentId??""),Bt(t.watchdog?.instructions??""))},[t.watchdog?.watchdogAgentId,t.watchdog?.instructions,Lt]);const zr=(0,d.useMemo)(()=>(D??[]).filter(ma).map(s=>({id:s.id,label:s.name,searchText:`${s.name} ${s.role} ${s.title??""}`})),[D]),$e=Ce({mutationFn:a(s=>E.upsertWatchdog(t.id,s),"mutationFn"),onSuccess:a(s=>{P.setQueryData(j.issues.detail(t.id),i=>i&&{...i,watchdog:s}),P.invalidateQueries({queryKey:j.issues.detail(t.id)}),lt(!1)},"onSuccess")}),_e=Ce({mutationFn:a(()=>E.deleteWatchdog(t.id),"mutationFn"),onSuccess:a(()=>{P.setQueryData(j.issues.detail(t.id),s=>s&&{...s,watchdog:null}),P.invalidateQueries({queryKey:j.issues.detail(t.id)}),lt(!1)},"onSuccess")}),Ur=a(()=>{Re&&$e.mutate({agentId:Re,instructions:dn.trim()||null})},"saveWatchdog"),Kr=a(()=>{t.watchdog?_e.mutate():lt(!1),Ft(""),Bt("")},"removeWatchdog"),Mn=$e.error instanceof Error?$e.error.message:_e.error instanceof Error?_e.error.message:null,Me=(n??[]).find(s=>s.id===t.watchdog?.watchdogIssueId),Vr=t.watchdog?(0,e.jsxs)("span",{className:"inline-flex min-w-0 max-w-full items-center gap-1.5 text-sm",title:t.watchdog.instructions?.trim()||void 0,children:[(()=>{const s=(D??[]).find(i=>i.id===t.watchdog?.watchdogAgentId);return s?(0,e.jsx)(ve,{agent:s,size:16,className:"h-3.5 w-3.5 shrink-0 text-ink-3"}):null})(),(0,e.jsx)("span",{className:"shrink-0 max-w-40 truncate",children:be(t.watchdog.watchdogAgentId)}),t.watchdog.instructions?.trim()?(0,e.jsxs)("span",{className:"min-w-0 flex-1 truncate text-ink-3",children:["· ",t.watchdog.instructions.trim()]}):null,t.watchdog.status==="disabled"?(0,e.jsx)("span",{className:"shrink-0 text-xs text-ink-3",children:"(disabled)"}):null]}):(0,e.jsx)("span",{className:"text-sm text-ink-3",children:"None"}),Qr=void 0,Hr=(0,e.jsxs)("div",{className:"space-y-3 p-2",children:[(0,e.jsxs)("div",{className:"space-y-1.5",children:[(0,e.jsx)("div",{className:"text-xs font-medium text-ink",children:"Watchdog agent"}),(0,e.jsx)(Hi,{value:Re,options:zr,placeholder:"Select agent",noneLabel:"No watchdog agent",searchPlaceholder:"Search agents...",emptyMessage:"No agents found.",onChange:Ft,renderTriggerValue:a(s=>{if(!s)return(0,e.jsx)("span",{className:"text-ink-3",children:"Select agent"});const i=(D??[]).find(m=>m.id===s.id);return(0,e.jsxs)(e.Fragment,{children:[i?(0,e.jsx)(ve,{agent:i,size:16,className:"h-3 w-3 shrink-0 text-ink-3"}):null,(0,e.jsx)("span",{className:"truncate",children:s.label})]})},"renderTriggerValue"),renderOption:a(s=>{const i=(D??[]).find(m=>m.id===s.id);return(0,e.jsxs)(e.Fragment,{children:[i?(0,e.jsx)(ve,{agent:i,size:16,className:"h-3 w-3 shrink-0 text-ink-3"}):null,(0,e.jsx)("span",{className:"truncate",children:s.label})]})},"renderOption")})]}),(0,e.jsxs)("div",{className:"space-y-1.5",children:[(0,e.jsxs)("div",{className:"text-xs font-medium text-ink",children:["Instructions ",(0,e.jsx)("span",{className:"font-normal text-ink-3",children:"(optional)"})]}),(0,e.jsx)(Di,{value:dn,onChange:a(s=>Bt(s.target.value),"onChange"),placeholder:"What should the watchdog watch for and how should it keep work moving?",rows:4,className:"text-xs"})]}),Me?(0,e.jsxs)("div",{className:"text-xs text-ink-3",children:["Watchdog task:"," ",(0,e.jsx)(V,{to:`/issues/${Me.id}`,className:"text-accent hover:underline",children:Me.identifier??"View task"})]}):null,Mn?(0,e.jsx)("div",{className:"rounded border border-bad/40 bg-bad/10 px-2 py-1 text-xs text-bad",children:Mn}):null,(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsx)("button",{type:"button",className:"text-xs text-ink-3 hover:text-bad transition-colors disabled:opacity-50",disabled:_e.isPending||!t.watchdog&&!Re,onClick:Kr,children:_e.isPending?"Removing…":"Remove"}),(0,e.jsx)(W,{type:"button",size:"sm",className:"h-7 text-xs",disabled:!Re||$e.isPending,onClick:Ur,children:$e.isPending?"Saving…":t.watchdog?"Update":"Set watchdog"})]})]}),Ln=a(s=>{if(!S)return;const i=ua({existingPolicy:t.executionPolicy??null,reviewerValues:J,approverValues:ee});if(!i&&!s){c({executionPolicy:null});return}const{monitor:m,...y}=i??{};c({executionPolicy:{...y,mode:i?.mode??t.executionPolicy?.mode??"normal",commentRequired:!0,stages:i?.stages??[],...s?{monitor:s}:{}}})},"updateMonitor"),Gr=a(()=>{if(!rt)return;const s=new Date(rt);if(Number.isNaN(s.getTime()))return;const i=sn.trim()||null;Ln({nextCheckAt:s.toISOString(),notes:en.trim()||null,scheduledBy:"board",kind:i?"external_service":null,serviceName:i,externalRef:null}),at(!1)},"saveMonitor"),Fn=a(()=>{Ln(null),at(!1)},"clearMonitor"),ce=t.executionState?.monitor??null,G=ce?.nextCheckAt??t.monitorNextCheckAt??N?.monitor?.nextCheckAt??null,ke=t.monitorAttemptCount??ce?.attemptCount??0,dt=t.monitorLastTriggeredAt??ce?.lastTriggeredAt??null,Xr=N?.monitor?.serviceName??ce?.serviceName??null,Yr=N?.monitor?.notes??ce?.notes??null,os=eo(G),cs=G?Zi(G,os):null,Zr=cs==="due now",Jr=!!cs?.startsWith("overdue by "),el=G?Yi(G,os):ce?.status==="cleared"?"Cleared":"None",Bn=G?Zr?"checking momentarily…":`${Ji(G,{},os)}${Jr?" · fires on next tick":ke>0?` · Attempt ${ke}`:""}`:ce?.status==="cleared"?[dt?`last checked ${jt(dt)}`:null,ke>0?`after attempt ${ke}`:null].filter(Boolean).join(" · "):null,tl=(0,e.jsx)(Ai,{children:(0,e.jsxs)(Si,{open:or,onOpenChange:Pe,children:[(0,e.jsx)(Ci,{asChild:!0,children:(0,e.jsxs)("span",{className:"inline-flex min-w-0 items-start gap-1.5","data-testid":"monitor-row-trigger",onClick:a(()=>Pe(!1),"onClick"),children:[G?(0,e.jsx)(Sa,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-ink-3","aria-hidden":"true"}):null,(0,e.jsxs)("span",{className:"flex min-w-0 flex-col items-start",children:[(0,e.jsx)("span",{className:g("text-sm",G?"font-semibold text-ink":"text-ink-3"),children:el}),Bn?(0,e.jsx)("span",{className:"text-xs text-ink-3",children:Bn}):null]})]})}),G?(0,e.jsxs)(Ii,{side:"left",className:"w-80 border border-line bg-bg-2 p-0 text-ink shadow-md",onPointerDown:a(s=>s.stopPropagation(),"onPointerDown"),children:[(0,e.jsxs)("div",{className:"flex items-center justify-between border-b border-line px-4 py-3",children:[(0,e.jsx)("span",{className:"text-sm font-semibold",children:"Monitor"}),ke>0?(0,e.jsxs)("span",{className:"text-xs text-ink-3",children:["Attempt ",ke]}):null]}),(0,e.jsxs)("div",{className:"space-y-3 px-4 py-3 text-left",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"text-xs text-ink-3",children:"Next check"}),(0,e.jsx)("div",{className:"text-sm",children:da(G)}),(0,e.jsx)("div",{className:"text-xs text-ink-3",children:cs})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"text-xs text-ink-3",children:"Watching"}),(0,e.jsx)("div",{className:"text-sm",children:Xr??"—"})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"text-xs text-ink-3",children:"Notes"}),(0,e.jsx)("div",{className:"whitespace-normal text-sm",children:Yr??"—"})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"text-xs text-ink-3",children:"Last triggered"}),(0,e.jsx)("div",{className:"text-sm",children:dt?da(dt):"— not yet triggered"})]})]}),(0,e.jsxs)("div",{className:"flex gap-2 border-t border-line px-4 py-3",children:[k?(0,e.jsx)(W,{type:"button",size:"sm",variant:"secondary",disabled:$,onClick:a(()=>{Pe(!1),k()},"onClick"),children:$?"Checking…":"Check now"}):null,(0,e.jsx)(W,{type:"button",size:"sm",variant:"secondary",onClick:a(()=>{Pe(!1),at(!0)},"onClick"),children:"Edit"}),(0,e.jsx)(W,{type:"button",size:"sm",variant:"secondary",onClick:a(()=>{Pe(!1),Fn()},"onClick"),children:"Clear"})]})]}):null]})}),C=t.scheduledRetry??null,F=vo(t.id),qn=C&&C.status==="scheduled_retry",Dn=C?.scheduledRetryAt?new Date(C.scheduledRetryAt).toISOString():null,Le=Dn?Xi(Dn):null,ut=C?.scheduledRetryAt?M(C.scheduledRetryAt):null,zn=C?.scheduledRetryAt?Wl(new Date(C.scheduledRetryAt)):null,Un=So(C?.scheduledRetryReason),xt=typeof C?.scheduledRetryAttempt=="number"&&Number.isFinite(C.scheduledRetryAttempt)&&C.scheduledRetryAttempt>0?C.scheduledRetryAttempt:null,ds=C?.scheduledRetryReason==="max_turns_continuation",sl=(()=>{if(!Le)return"Pending schedule";const s=ds?"Continuation":"Retry";return Le==="now"?`${s} due now`:`${s} ${Le}`})(),us=F.isSuccess&&(F.data?.outcome==="promoted"||F.data?.outcome==="already_promoted"),nl=xt!==null?(0,e.jsxs)("span",{className:"whitespace-nowrap shrink-0 text-xs text-ink-3",children:["Attempt ",xt]}):null,al=(0,e.jsxs)("span",{className:"inline-flex min-w-0 items-center gap-1.5",children:[(0,e.jsx)(oa,{className:"h-3.5 w-3.5 shrink-0 text-ink-3","aria-hidden":"true"}),(0,e.jsx)("span",{className:"min-w-0 truncate text-sm text-ink",title:ut??void 0,children:sl}),zn?(0,e.jsx)("span",{className:"shrink-0 text-xs text-ink-3",title:ut??void 0,children:zn}):null]}),Kn=C?(0,e.jsxs)("div",{className:"flex w-full flex-col gap-2 p-2 text-xs",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsx)("span",{className:"text-sm font-medium text-ink",children:ds?"Scheduled continuation":"Scheduled retry"}),xt!==null?(0,e.jsxs)("span",{className:"text-xs text-ink-3",children:["Attempt ",xt]}):null]}),(0,e.jsxs)("dl",{className:"grid grid-cols-(--gtc-15) gap-y-1",children:[Un?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("dt",{className:"text-ink-3",children:"Reason"}),(0,e.jsx)("dd",{className:"text-ink",children:Un})]}):null,ut?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("dt",{className:"text-ink-3",children:"Next attempt"}),(0,e.jsxs)("dd",{className:"text-ink",children:[ut,Le?(0,e.jsxs)("span",{className:"ml-1 text-ink-3",children:["· ",Le]}):null]})]}):null,C.retryOfRunId?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("dt",{className:"text-ink-3",children:"Replaces run"}),(0,e.jsx)("dd",{className:"text-ink",children:(0,e.jsx)(V,{to:`/agents/${C.agentId}/runs/${C.retryOfRunId}`,className:"font-mono text-ink hover:underline",children:C.retryOfRunId.slice(0,8)})})]}):null,C.agentName?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("dt",{className:"text-ink-3",children:"Agent"}),(0,e.jsx)("dd",{className:"text-ink",children:(0,e.jsx)(V,{to:`/agents/${C.agentId}`,className:"text-ink hover:underline",children:C.agentName})})]}):null,C.error?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("dt",{className:"text-ink-3",children:"Last error"}),(0,e.jsx)("dd",{className:"text-ink break-words",children:C.error})]}):null]}),(0,e.jsx)(Io,{error:F.lastError,onRetry:a(()=>{F.reset(),F.mutate()},"onRetry")}),(0,e.jsx)(Oo,{className:"my-1"}),(0,e.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,e.jsx)(W,{type:"button",size:"sm",variant:"primary",onClick:a(()=>F.mutate(),"onClick"),disabled:F.isPending||us,"data-testid":"issue-scheduled-retry-properties-retry-now",children:F.isPending?(0,e.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,e.jsx)(Ea,{className:"h-3.5 w-3.5 animate-spin","aria-hidden":"true"}),"Retrying…"]}):us?(0,e.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,e.jsx)(As,{className:"h-3.5 w-3.5","aria-hidden":"true"}),F.data?.outcome==="already_promoted"?"Already promoted":"Promoted"]}):(0,e.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,e.jsx)(oa,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Retry now"]})}),(0,e.jsx)("span",{className:"text-right text-xs text-ink-3",children:F.isPending?"Promoting scheduled retry":us?F.data?.outcome==="already_promoted"?"Already promoted — run starting":"Promoted — run starting":F.data?.outcome==="waiting"&&F.data.scheduledRetry?.runId===C.runId?F.data.message:ds?"Pulls continuation forward immediately":"Pulls retry forward immediately"})]})]}):null,rl=(0,e.jsxs)("div",{className:"flex w-full flex-col gap-2",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-2 md:flex-row",children:[(0,e.jsx)("input",{type:"datetime-local",className:"rounded-md border border-line bg-transparent px-2 py-1 text-xs",value:rt,onChange:a(s=>Js(s.target.value),"onChange")}),(0,e.jsx)("input",{type:"text",className:"min-w-0 flex-1 rounded-md border border-line bg-transparent px-2 py-1 text-xs",placeholder:"What should the agent re-check?",value:en,onChange:a(s=>tn(s.target.value),"onChange")})]}),(0,e.jsxs)("div",{className:"flex flex-col gap-2 md:flex-row",children:[(0,e.jsx)("input",{type:"text",className:"min-w-0 flex-1 rounded-md border border-line bg-transparent px-2 py-1 text-xs",placeholder:"External service",value:sn,onChange:a(s=>nn(s.target.value),"onChange")}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("button",{type:"button",className:"inline-flex items-center rounded-full border border-line px-2 py-0.5 text-xs text-ink-3 transition-colors hover:bg-bg-3/50 hover:text-ink disabled:opacity-50",disabled:!rt,onClick:Gr,children:"Schedule"}),N?.monitor?(0,e.jsx)("button",{type:"button",className:"inline-flex items-center rounded-full border border-line px-2 py-0.5 text-xs text-ink-3 transition-colors hover:bg-bg-3/50 hover:text-ink",onClick:Fn,children:"Clear"}):null]})]})]}),mt=(0,d.useMemo)(()=>{const s=t.labelIds??[];if(s.length===0)return t.labels??[];const i=new Map;for(const m of zt??[])i.set(m.id,m);for(const m of t.labels??[])i.set(m.id,m);return s.map(m=>i.get(m)).filter(m=>!!m)},[t.labelIds,t.labels,zt]),ll=mt.length>0?(0,e.jsxs)("div",{className:"flex min-w-0 flex-col items-start gap-1",children:[mt.slice(0,3).map(s=>(0,e.jsx)(ba,{className:"border-0",style:{backgroundColor:`${s.color}22`,color:s.color},children:s.name},s.id)),mt.length>3&&(0,e.jsxs)(se,{variant:"outline",className:"border-line text-ink-3",children:["+",mt.length-3," more"]})]}):(0,e.jsx)("span",{className:"text-sm text-ink-3",children:"None"}),il=(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("input",{className:"w-full px-2 py-1.5 text-xs bg-transparent outline-none border-b border-line mb-1 placeholder:text-ink-3/50",placeholder:"Search labels...",value:$t,onChange:a(s=>Xs(s.target.value),"onChange"),autoFocus:!o}),(0,e.jsx)("div",{className:"max-h-44 overflow-y-auto overscroll-contain space-y-0.5",children:(zt??[]).filter(s=>$t.trim()?s.name.toLowerCase().includes($t.toLowerCase()):!0).map(s=>{const i=(t.labelIds??[]).includes(s.id);return(0,e.jsxs)("button",{className:g("flex items-center gap-2 w-full px-2 py-1.5 text-xs rounded hover:bg-bg-3/50 text-left",i&&"bg-bg-3"),onClick:a(()=>kr(s.id),"onClick"),children:[(0,e.jsx)("span",{className:"h-2.5 w-2.5 rounded-full shrink-0",style:{backgroundColor:s.color}}),(0,e.jsx)("span",{className:"truncate flex-1",children:s.name}),i&&(0,e.jsx)(ne,{className:"h-3.5 w-3.5 shrink-0 text-ink","aria-hidden":"true"})]},s.id)})}),(0,e.jsxs)("div",{className:"mt-2 border-t border-line pt-2 space-y-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("input",{className:"h-7 w-7 p-0 rounded bg-transparent",type:"color",value:Zs,onChange:a(s=>pr(s.target.value),"onChange")}),(0,e.jsx)("input",{className:"flex-1 px-2 py-1.5 text-xs bg-transparent outline-none rounded placeholder:text-ink-3/50",placeholder:"New label",value:_t,onChange:a(s=>Ys(s.target.value),"onChange")})]}),(0,e.jsxs)("button",{className:"flex items-center justify-center gap-1.5 w-full px-2 py-1.5 text-xs rounded border border-line hover:bg-bg-3/50 disabled:opacity-50",disabled:!_t.trim()||Ut.isPending,onClick:a(()=>Ut.mutate({name:_t.trim(),color:Zs}),"onClick"),children:[(0,e.jsx)(vs,{className:"h-3 w-3"}),Ut.isPending?"Creating…":"Create label"]})]})]}),ol=Oe?(0,e.jsx)(ca,{agent:Oe,size:"sm"}):ns?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(De,{className:"h-3.5 w-3.5 shrink-0 text-ink-3"}),(0,e.jsx)("span",{className:"min-w-0 truncate text-sm",title:ns,children:ns})]}):(0,e.jsx)("span",{className:"text-sm text-ink-3",children:"Unassigned"}),cl=[...q?[{kind:"user",value:`user:${q}`,userId:q,label:"Assign to me",searchText:Ee(q)??""}]:[],...t.createdByUserId&&t.createdByUserId!==q?[{kind:"user",value:`user:${t.createdByUserId}`,userId:t.createdByUserId,label:We?`Assign to ${We}`:"Assign to requester",searchText:We??"requester"}]:[],...Cn.map(s=>({kind:"user",value:s.id,userId:s.id.slice(5),label:s.label,searchText:s.searchText??""}))],dl=Nn.map(s=>({kind:"agent",value:`agent:${s.id}`,agent:s,label:s.name,searchText:`${s.name} ${s.role} ${s.title??""}`})),xs=a((s,i)=>Pt.trim()?`${s} ${i}`.toLowerCase().includes(Pt.toLowerCase()):!0,"matchesAssigneeSearch"),ms=a(s=>(0,e.jsxs)("button",{className:g("flex items-center gap-2 w-full px-2 py-1.5 text-xs rounded hover:bg-bg-3/50 text-left",s.value===as&&"bg-bg-3"),onClick:a(()=>{s.kind==="agent"?rs({assigneeAgentId:s.agent.id,assigneeUserId:null},s.label,()=>Ki(s.agent.id,p??void 0)):s.kind==="user"?rs({assigneeAgentId:null,assigneeUserId:s.userId},s.label,()=>Ui(s.userId,p??void 0)):rs({assigneeAgentId:null,assigneeUserId:null},s.label)},"onClick"),children:[s.kind==="agent"?(0,e.jsx)(ve,{agent:s.agent,size:16,className:"shrink-0 h-3 w-3 text-ink-3"}):s.kind==="user"?(0,e.jsx)(De,{className:"h-3 w-3 shrink-0 text-ink-3"}):null,(0,e.jsx)("span",{className:"min-w-0 flex-1 truncate",children:s.label}),s.value===as?(0,e.jsx)(ne,{className:"ml-auto h-3.5 w-3.5 shrink-0 text-ink","aria-hidden":"true"}):null]},s.value||"__none__"),"renderAssigneeOption"),hs=cl.filter(s=>xs(s.label,s.searchText)),ps=dl.filter(s=>xs(s.label,s.searchText)),Vn=xs("No assignee",""),Qn=a(s=>(0,e.jsx)("div",{className:"px-2 pb-0.5 pt-1.5 text-xs font-semibold uppercase tracking-wide text-ink-3",children:s}),"sectionHeader"),ul=pe?(0,e.jsx)("div",{className:"space-y-2 p-1",children:(0,e.jsx)(Ao,{copy:Pn,to:{agentId:pe.assigneeAgentId,userId:pe.assigneeUserId},resolvers:Br,onConfirm:a(()=>Tn({assigneeAgentId:pe.assigneeAgentId,assigneeUserId:pe.assigneeUserId},pe.track),"onConfirm"),onCancel:a(()=>Ye(null),"onCancel")})}):(0,e.jsxs)(e.Fragment,{children:[x?(0,e.jsx)("div",{className:"px-1 pt-1",children:(0,e.jsx)(No,{copy:Pn})}):null,(0,e.jsx)("input",{className:"w-full px-2 py-1.5 text-xs bg-transparent outline-none border-b border-line mb-1 placeholder:text-ink-3/50",placeholder:"Search assignees...",value:Pt,onChange:a(s=>Rt(s.target.value),"onChange"),autoFocus:!o}),(0,e.jsxs)("div",{className:"max-h-56 overflow-y-auto overscroll-contain",children:[Vn?ms({kind:"none",value:"",label:"No assignee",searchText:""}):null,ps.length>0?(0,e.jsxs)(e.Fragment,{children:[Qn("Agents"),ps.map(s=>ms(s))]}):null,hs.length>0?(0,e.jsxs)(e.Fragment,{children:[Qn("Board users"),hs.map(s=>ms(s))]}):null,!Vn&&ps.length===0&&hs.length===0?(0,e.jsx)("div",{className:"px-2 py-2 text-xs text-ink-3",children:"No matches."}):null]})]}),Hn=a((s,i,m,y,te)=>(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("input",{className:"w-full px-2 py-1.5 text-xs bg-transparent outline-none border-b border-line mb-1 placeholder:text-ink-3/50",placeholder:`Search ${s==="review"?"reviewers":"approvers"}...`,value:m,onChange:a(_=>y(_.target.value),"onChange"),autoFocus:!o}),(0,e.jsxs)("div",{className:"max-h-48 overflow-y-auto overscroll-contain",children:[(0,e.jsxs)("button",{className:g("flex items-center gap-2 w-full px-2 py-1.5 text-xs rounded hover:bg-bg-3/50",i.length===0&&"bg-bg-3"),onClick:te,children:["No ",s==="review"?"reviewers":"approvers"]}),q&&(0,e.jsxs)("button",{className:g("flex items-center gap-2 w-full px-2 py-1.5 text-xs rounded hover:bg-bg-3/50",i.includes(`user:${q}`)&&"bg-bg-3"),onClick:a(()=>ot(s,`user:${q}`),"onClick"),children:[(0,e.jsx)(De,{className:"h-3 w-3 shrink-0 text-ink-3"}),"Assign to me"]}),t.createdByUserId&&t.createdByUserId!==q&&(0,e.jsxs)("button",{className:g("flex items-center gap-2 w-full px-2 py-1.5 text-xs rounded hover:bg-bg-3/50",i.includes(`user:${t.createdByUserId}`)&&"bg-bg-3"),onClick:a(()=>ot(s,`user:${t.createdByUserId}`),"onClick"),children:[(0,e.jsx)(De,{className:"h-3 w-3 shrink-0 text-ink-3"}),We||"Requester"]}),Cn.filter(_=>m.trim()?`${_.label} ${_.searchText??""}`.toLowerCase().includes(m.toLowerCase()):!0).map(_=>(0,e.jsxs)("button",{className:g("flex items-center gap-2 w-full px-2 py-1.5 text-xs rounded hover:bg-bg-3/50",i.includes(_.id)&&"bg-bg-3"),onClick:a(()=>ot(s,_.id),"onClick"),children:[(0,e.jsx)(De,{className:"h-3 w-3 shrink-0 text-ink-3"}),_.label]},`${s}:${_.id}`)),Nn.filter(_=>m.trim()?_.name.toLowerCase().includes(m.toLowerCase()):!0).map(_=>{const ta=`agent:${_.id}`;return(0,e.jsxs)("button",{className:g("flex items-center gap-2 w-full px-2 py-1.5 text-xs rounded hover:bg-bg-3/50",i.includes(ta)&&"bg-bg-3"),onClick:a(()=>ot(s,ta),"onClick"),children:[(0,e.jsx)(ve,{agent:_,size:16,className:"shrink-0 h-3 w-3 text-ink-3"}),_.name]},`${s}:${_.id}`)})]})]}),"executionParticipantsContent"),xl=t.projectId?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(na,{color:je?.color??null,icon:je?.icon??null,size:"sm"}),(0,e.jsx)("span",{className:"text-sm truncate min-w-0",title:mn(t.projectId),children:mn(t.projectId)})]}):(0,e.jsx)("span",{className:"text-sm text-ink-3",children:"None"}),ml=zi([{id:"",kind:"none",name:"No project",color:null},...Dt.map(s=>({id:s.id,kind:"project",project:s,name:s.name,color:s.color??null}))],t.projectId??"",Or),hl=(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("input",{className:"w-full px-2 py-1.5 text-xs bg-transparent outline-none border-b border-line mb-1 placeholder:text-ink-3/50",placeholder:"Search projects...",value:Tt,onChange:a(s=>Bs(s.target.value),"onChange"),autoFocus:!o}),(0,e.jsx)("div",{className:"max-h-48 overflow-y-auto overscroll-contain",children:ml.filter(s=>{if(!Tt.trim())return!0;const i=Tt.toLowerCase();return s.name.toLowerCase().includes(i)}).map(s=>(0,e.jsxs)("button",{className:g("flex items-center gap-2 w-full px-2 py-1.5 text-xs rounded hover:bg-bg-3/50 whitespace-nowrap",s.id===(t.projectId??"")&&"bg-bg-3"),onClick:a(()=>{if(s.kind==="project"){const i=wc(s.project);c({projectId:s.project.id,projectWorkspaceId:kc(s.project),executionWorkspaceId:null,executionWorkspacePreference:Vt?i:null,executionWorkspaceSettings:Vt&&s.project.executionWorkspacePolicy?.enabled?{mode:i}:null})}else c({projectId:null,projectWorkspaceId:null,executionWorkspaceId:null,executionWorkspacePreference:null,executionWorkspaceSettings:null});Fs(!1)},"onClick"),children:[s.kind==="project"?(0,e.jsx)(na,{color:s.project.color??null,icon:s.project.icon??null,size:"xs"}):null,s.name]},s.id||"__none__"))})]}),we=t.blockedBy?.map(s=>s.id)??[],Fe=t.blockedBy??[],ht=t.blocks??[],Gn=Us?ht:ht.slice(0,Pc),pl=ht.length-Gn.length,fl=Fe.length>0?(0,e.jsxs)("div",{className:"flex min-w-0 flex-col items-start gap-1",children:[Fe.slice(0,2).map(s=>(0,e.jsx)(wt,{issue:s,onRemove:a(i=>c({blockedByIssueIds:we.filter(m=>m!==i)}),"onRemove")},s.id)),Fe.length>2?(0,e.jsx)(se,{asChild:!0,variant:"outline",className:"border-line text-ink-3 hover:bg-bg-3/50",children:(0,e.jsxs)("button",{type:"button",onClick:a(()=>et(!0),"onClick"),children:["+",Fe.length-2," more"]})}):null]}):(0,e.jsx)("span",{className:"text-sm text-ink-3",children:"None"}),gl=n.length>0?(0,e.jsxs)("div",{className:"flex min-w-0 flex-col items-start gap-1",children:[n.slice(0,2).map(s=>(0,e.jsx)(wt,{variant:"property",issue:s,className:"min-w-0 max-w-full"},s.id)),n.length>2?(0,e.jsx)(se,{asChild:!0,variant:"outline",className:"border-line text-ink-3 hover:bg-bg-3/50",children:(0,e.jsxs)("button",{type:"button",onClick:a(()=>st(!0),"onClick"),children:["+",n.length-2," more"]})}):null]}):(0,e.jsx)("span",{className:"text-sm text-ink-3",children:"None"}),bl=(0,d.useMemo)(()=>{if(!oe?.length)return new Set;const s=new Map;for(const y of oe){if(!y.parentId)continue;const te=s.get(y.parentId)??[];te.push(y.id),s.set(y.parentId,te)}const i=new Set,m=[...s.get(t.id)??[]];for(;m.length>0;){const y=m.pop();!y||i.has(y)||(i.add(y),m.push(...s.get(y)??[]))}return i},[oe,t.id]),fs=(0,d.useMemo)(()=>t.parentId?oe?.find(s=>s.id===t.parentId)??null:null,[oe,t.parentId]),Be=t.ancestors?.find(s=>s.id===t.parentId),jl=Be?.identifier??fs?.identifier,yl=Be?.title??fs?.title??t.parentId?.slice(0,8),kl=t.parentId?(0,e.jsx)(wt,{variant:"property",issue:hi(Be)?Be:{id:t.parentId,identifier:jl??t.parentId,title:yl??"Parent task",status:Be?.status??fs?.status},className:"min-w-0 max-w-full"}):(0,e.jsx)("span",{className:"text-sm text-ink-3",children:"None"}),Xn=Te.length>0,Yn=((Xn?jr:oe)??[]).filter(s=>s.id!==t.id).filter(s=>!bl.has(s.id)).sort((s,i)=>{const m=`${s.identifier??""} ${s.title}`.trim(),y=`${i.identifier??""} ${i.title}`.trim();return m.localeCompare(y)}),wl=nt&&(Xn?yr:xn),vl=(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("input",{className:"w-full px-2 py-1.5 text-xs bg-transparent outline-none border-b border-line mb-1 placeholder:text-ink-3/50",placeholder:"Search tasks...",value:Vs,onChange:a(s=>Qs(s.target.value),"onChange"),autoFocus:!o}),(0,e.jsxs)("div",{className:"max-h-48 overflow-y-auto overscroll-contain",children:[(0,e.jsx)("button",{className:g("flex items-center gap-2 w-full px-2 py-1.5 text-xs rounded hover:bg-bg-3/50",!t.parentId&&"bg-bg-3"),onClick:a(()=>{c({parentId:null}),Wt(!1)},"onClick"),children:"No parent"}),Yn.map(s=>(0,e.jsxs)("button",{className:g("flex w-full items-center gap-2 px-2 py-1.5 text-left text-xs rounded hover:bg-bg-3/50",s.id===t.parentId&&"bg-bg-3"),onClick:a(()=>{c({parentId:s.id}),Wt(!1)},"onClick"),children:[(0,e.jsx)(kt,{status:s.status,className:"h-3 w-3"}),(0,e.jsxs)("span",{className:"truncate",children:[s.identifier?`${s.identifier} `:"",s.title]})]},s.id)),wl?(0,e.jsx)("div",{className:"px-2 py-2 text-xs text-ink-3",children:"Searching tasks..."}):Yn.length===0?(0,e.jsx)("div",{className:"px-2 py-2 text-xs text-ink-3",children:"No matching tasks."}):null]})]}),gs=fe.length>0,Nl=gs?gr:[...t.blockedBy??[],...oe??[]],bs=Array.from(new Map((Nl??[]).filter(s=>s.id!==t.id).map(s=>[s.id,s])).values());gs||bs.sort((s,i)=>{const m=`${s.identifier??""} ${s.title}`.trim(),y=`${i.identifier??""} ${i.title}`.trim();return m.localeCompare(y)});const Cl=Je&&(gs?br:xn),Il=a(s=>{c({blockedByIssueIds:we.includes(s)?we.filter(i=>i!==s):[...we,s]}),et(!1),tt("")},"toggleBlockedBy"),Al=(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("input",{className:"w-full px-2 py-1.5 text-xs bg-transparent outline-none border-b border-line mb-1 placeholder:text-ink-3/50",placeholder:"Search tasks...",value:zs,onChange:a(s=>tt(s.target.value),"onChange"),autoFocus:!o,"aria-label":"Search tasks to add as blockers"}),(0,e.jsxs)("div",{className:"max-h-48 overflow-y-auto overscroll-contain",children:[(0,e.jsx)("button",{className:g("flex items-center gap-2 w-full px-2 py-1.5 text-xs rounded hover:bg-bg-3/50",we.length===0&&"bg-bg-3"),onClick:a(()=>{c({blockedByIssueIds:[]}),et(!1),tt("")},"onClick"),children:"No blockers"}),bs.map(s=>{const i=we.includes(s.id);return(0,e.jsxs)("button",{className:g("flex w-full items-center gap-2 px-2 py-1.5 text-left text-xs rounded hover:bg-bg-3/50",i&&"bg-bg-3"),onClick:a(()=>Il(s.id),"onClick"),children:[(0,e.jsx)(kt,{status:s.status,className:"h-3 w-3"}),(0,e.jsxs)("span",{className:"truncate",children:[s.identifier?`${s.identifier} `:"",s.title]}),i&&(0,e.jsx)(ne,{className:"ml-auto h-3.5 w-3.5 shrink-0 text-ink","aria-hidden":"true"})]},s.id)}),Cl?(0,e.jsx)("div",{className:"px-2 py-2 text-xs text-ink-3",children:"Searching tasks..."}):bs.length===0?(0,e.jsx)("div",{className:"px-2 py-2 text-xs text-ink-3",children:"No matching tasks."}):null]})]}),Sl=(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"max-h-48 overflow-y-auto overscroll-contain",children:n.length>0?n.map(s=>(0,e.jsxs)(V,{to:`/issues/${s.identifier??s.id}`,state:r,className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs hover:bg-bg-3/50",onClick:a(()=>st(!1),"onClick"),children:[(0,e.jsx)(kt,{status:s.status,className:"h-3 w-3"}),(0,e.jsxs)("span",{className:"min-w-0 truncate",children:[s.identifier?`${s.identifier} `:"",s.title]})]},s.id)):(0,e.jsx)("div",{className:"px-2 py-2 text-xs text-ink-3",children:"No subtasks yet."})}),l?(0,e.jsx)("div",{className:"mt-2 border-t border-line pt-2",children:(0,e.jsxs)("button",{type:"button",className:"flex w-full items-center justify-center gap-1.5 rounded border border-line px-2 py-1.5 text-xs hover:bg-bg-3/50",onClick:a(()=>{st(!1),l()},"onClick"),children:[(0,e.jsx)(vs,{className:"h-3 w-3"}),"Add subtask"]})}):null]}),js=(0,e.jsxs)("div",{className:g("task-detail-properties pl-4"),children:[(0,e.jsxs)(ze,{title:"Work",first:!0,streamlined:!0,children:[(0,e.jsx)(I,{label:"Status",children:(0,e.jsx)(kt,{status:t.status,externalConversationState:t.externalConversationState,glyphContainerClassName:"inline-flex size-6 shrink-0 items-center justify-center",blockerAttention:t.blockerAttention,onChange:a(s=>c({status:s}),"onChange"),showLabel:!0})}),!1,(0,e.jsx)(K,{inline:o,label:"Assignee",open:_s,onOpenChange:a(s=>{Ms(s),s||(Rt(""),Ye(null))},"onOpenChange"),triggerContent:ol,popoverClassName:"w-52",extra:t.assigneeAgentId?(0,e.jsx)(V,{to:`/agents/${t.assigneeAgentId}`,className:"inline-flex items-center justify-center h-5 w-5 rounded hover:bg-bg-3/50 transition-colors text-ink-3 hover:text-ink",onClick:a(s=>s.stopPropagation(),"onClick"),children:(0,e.jsx)(yt,{className:"h-3 w-3"})}):void 0,children:ul}),Wr?(0,e.jsx)(K,{inline:o,label:"Model",open:mr,onOpenChange:hr,triggerContent:Lr,triggerClassName:"min-w-0 max-w-full",popoverClassName:g("max-w-full",o?"w-full":"w-72"),children:Fr}):null,(0,e.jsx)(K,{inline:o,label:"Project",open:Ls,onOpenChange:a(s=>{Fs(s),s||Bs("")},"onOpenChange"),triggerContent:xl,triggerClassName:"min-w-0 max-w-full",popoverClassName:"w-fit min-w-(--sz-11rem)",extra:t.projectId?(0,e.jsx)(V,{to:Tr(t.projectId),className:"inline-flex items-center justify-center h-5 w-5 rounded hover:bg-bg-3/50 transition-colors text-ink-3 hover:text-ink",onClick:a(s=>s.stopPropagation(),"onClick"),children:(0,e.jsx)(yt,{className:"h-3 w-3"})}):void 0,children:hl}),(0,e.jsx)(K,{inline:o,label:"Labels",open:ur,onOpenChange:a(s=>{xr(s),s||Xs("")},"onOpenChange"),triggerContent:ll,triggerClassName:"min-w-0 max-w-full",popoverClassName:"w-64",extra:Qr,stacked:!0,children:il})]}),(0,e.jsxs)(ze,{title:"Relationships",streamlined:!0,children:[(0,e.jsx)(K,{inline:o,label:"Parent",open:nt,onOpenChange:a(s=>{Wt(s),s||Qs("")},"onOpenChange"),triggerContent:kl,triggerClassName:"min-w-0 max-w-full",popoverClassName:"w-72",separateTrigger:!!t.parentId,children:vl}),(0,e.jsx)(K,{inline:o,label:"Blocked by",open:Je,onOpenChange:a(s=>{et(s),s||tt("")},"onOpenChange"),separateTrigger:Fe.length>0,triggerContent:fl,triggerClassName:"min-w-0 max-w-full",popoverClassName:"w-72",stacked:!0,children:Al}),(0,e.jsx)(I,{label:"Blocking",wrap:!0,children:ht.length>0?(0,e.jsxs)("div",{className:"flex flex-col items-start gap-1.5",children:[Gn.map(s=>(0,e.jsx)(wt,{variant:"property",issue:s},s.id)),(0,e.jsx)(Ha,{hiddenCount:pl,expanded:Us,onClick:a(()=>Ks(s=>!s),"onClick")})]}):(0,e.jsx)("span",{className:"text-sm text-ink-3",children:"None"})}),(0,e.jsx)(K,{inline:o,label:"Subtasks",open:er,onOpenChange:st,separateTrigger:n.length>0,triggerContent:gl,triggerClassName:"min-w-0 max-w-full",popoverClassName:"w-72",stacked:!0,children:Sl}),L.length>0||B?(0,e.jsx)(I,{label:"Pull requests",wrap:!0,children:(0,e.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,e.jsx)(zo,{products:L,externalObjects:u?.map(s=>s.pill)}),B?(0,e.jsxs)("span",{className:"text-xs text-ink-3",children:["Couldn’t load pull requests. ",(0,e.jsx)("button",{type:"button",className:"text-accent hover:underline",onClick:a(()=>{Ve()},"onClick"),children:"Retry"})]}):null]})}):null,(0,e.jsx)(yc,{externalObjects:Qe,externalObjectsLoading:h,externalObjectsError:b,onRetryExternalObjects:w})]}),(0,e.jsxs)(ze,{title:"Execution",streamlined:!0,children:[ct?(0,e.jsx)(I,{label:"Approvals",children:(0,e.jsxs)(ba,{title:ct.description,children:[(0,e.jsx)(ct.Icon,{className:"shrink-0 text-ink-3","aria-hidden":!0}),(0,e.jsx)("span",{className:"min-w-0 truncate",children:ct.label})]})}):null,S?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(K,{inline:o,label:"Reviewers",open:tr,onOpenChange:a(s=>{sr(s),s||Hs("")},"onOpenChange"),triggerContent:qr,triggerClassName:"min-w-0 max-w-full",popoverClassName:"w-56",children:Hn("review",J,nr,Hs,()=>ls([],ee))}),$n==="review"&&J.length>0?_n("review"):null,(0,e.jsx)(K,{inline:o,label:"Approvers",open:ar,onOpenChange:a(s=>{rr(s),s||Gs("")},"onOpenChange"),triggerContent:Dr,triggerClassName:"min-w-0 max-w-full",popoverClassName:"w-56",children:Hn("approval",ee,lr,Gs,()=>ls(J,[]))}),$n==="approval"&&ee.length>0?_n("approval"):null]}):(0,e.jsx)(I,{label:"Execution policy",wrap:!0,children:(0,e.jsx)("span",{role:"status",className:"text-sm text-ink-3",children:"Execution policy unavailable. Refresh to try again."})}),is&&(0,e.jsx)(I,{label:"Execution",children:(0,e.jsx)("span",{className:"text-sm truncate min-w-0",title:is,children:is})}),qn&&C?.scheduledRetryReason==="workspace_busy"?(0,e.jsx)(I,{label:"Workspace",children:(0,e.jsx)("span",{className:"text-sm text-ink-3",children:"Waiting for workspace"})}):qn&&Kn?(0,e.jsx)(K,{inline:o,label:"Scheduled retry",open:cr,onOpenChange:dr,triggerContent:al,triggerClassName:"min-w-0 max-w-full",popoverClassName:g("max-w-full",o?"w-full":"w-80 sm:w-(--sz-32rem)"),extra:nl,children:Kn}):null,S?(0,e.jsx)(K,{inline:o,label:"Monitor",open:ir,onOpenChange:at,triggerContent:tl,triggerClassName:"min-w-0 max-w-full",popoverClassName:g("max-w-full",o?"w-full":"w-80 sm:w-(--sz-32rem)"),children:rl}):null,(0,e.jsx)(K,{inline:o,label:"Watchdog",open:Lt,onOpenChange:lt,triggerContent:Vr,triggerClassName:"min-w-0 max-w-full",popoverClassName:g("max-w-full",o?"w-full":"w-80 sm:w-96"),extra:Me?(0,e.jsx)(V,{to:`/issues/${Me.id}`,className:"inline-flex items-center justify-center h-5 w-5 rounded hover:bg-bg-3/50 transition-colors text-ink-3 hover:text-ink",title:"Open watchdog task","aria-label":"Open watchdog task",onClick:a(s=>s.stopPropagation(),"onClick"),children:(0,e.jsx)(yt,{className:"h-3 w-3"})}):void 0,children:Hr})]}),Qt||jn||t.currentExecutionWorkspace?.branchName||t.currentExecutionWorkspace?.cwd||t.executionWorkspaceId?(0,e.jsxs)(ze,{title:"Workspace",streamlined:!0,children:[Qt?(0,e.jsx)(K,{inline:o,label:"Execution",open:qs,onOpenChange:a(s=>{Ds(s),s||(Ze("mode"),Et(""))},"onOpenChange"),triggerContent:(0,e.jsx)("span",{className:"truncate",title:Ar,children:Ir}),triggerClassName:"min-w-0 max-w-full",popoverClassName:g("max-w-full",o?"w-full":"w-72"),children:Ja==="mode"?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"space-y-0.5",children:[(0,e.jsxs)("button",{type:"button",className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left hover:bg-bg-3/50",onClick:a(()=>Gt(null),"onClick"),children:[(0,e.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,e.jsx)("span",{className:"block text-sm",children:"Default"}),(0,e.jsx)("span",{className:"block text-xs text-ink-3",children:"Use the project workspace policy"})]}),ye==="default"?(0,e.jsx)(ne,{className:"h-3.5 w-3.5 shrink-0"}):null]}),(0,e.jsxs)("button",{type:"button",className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left hover:bg-bg-3/50",onClick:a(()=>Gt("isolated_workspace"),"onClick"),children:[(0,e.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,e.jsx)("span",{className:"block text-sm",children:"New isolated workspace"}),(0,e.jsx)("span",{className:"block text-xs text-ink-3",children:"Create a fresh workspace on the next run"})]}),ye==="isolated"?(0,e.jsx)(ne,{className:"h-3.5 w-3.5 shrink-0"}):null]}),(0,e.jsxs)("button",{type:"button",className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left hover:bg-bg-3/50",onClick:a(()=>Ze("reuse"),"onClick"),children:[(0,e.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,e.jsx)("span",{className:"block text-sm",children:"Reuse existing workspace…"}),(0,e.jsx)("span",{className:"block text-xs text-ink-3",children:"Pick a workspace to reuse"})]}),ye==="reuse"?(0,e.jsx)(ne,{className:"h-3.5 w-3.5 shrink-0"}):null]})]}),(0,e.jsx)("div",{className:"mt-1 border-t border-line px-2 py-1.5 text-xs text-ink-3",children:t.executionWorkspaceId?"Current workspace stays active. Applies on the next run.":"Applies on the next run."})]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"border-b border-line pb-1",children:[(0,e.jsxs)("button",{type:"button",className:"inline-flex items-center gap-1 rounded px-1 py-1 text-xs text-ink-3 hover:bg-bg-3/50 hover:text-ink",onClick:a(()=>Ze("mode"),"onClick"),"aria-label":"Back to workspace options",children:[(0,e.jsx)(ai,{className:"h-3.5 w-3.5"}),"Workspace mode"]}),(0,e.jsx)("input",{className:"block w-full bg-transparent px-2 py-1.5 text-xs outline-none placeholder:text-ink-3/50",placeholder:"Search workspaces...",value:Ot,onChange:a(s=>Et(s.target.value),"onChange"),autoFocus:!o,"aria-label":"Search reusable workspaces"})]}),(0,e.jsx)("div",{className:"max-h-48 overflow-y-auto overscroll-contain py-1",children:vr?(0,e.jsx)("div",{className:"px-2 py-2 text-xs text-ink-3",children:"Loading workspaces..."}):Nr?(0,e.jsx)("div",{className:"px-2 py-2 text-xs text-bad",children:"Failed to load workspaces."}):pn.length===0?(0,e.jsx)("div",{className:"px-2 py-2 text-xs text-ink-3",children:"No matching workspaces."}):pn.map(s=>(0,e.jsxs)("div",{className:"py-1",children:[(0,e.jsx)("div",{className:"px-2 pb-1 text-xs font-medium text-ink-3",children:s.label}),s.options.map(i=>(0,e.jsxs)("button",{type:"button",className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left hover:bg-bg-3/50",onClick:a(()=>Gt("reuse_existing",i.workspace),"onClick"),children:[(0,e.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,e.jsx)("span",{className:"block truncate text-sm",children:i.label}),(0,e.jsx)("span",{className:"block truncate text-xs text-ink-3",children:i.description})]}),t.executionWorkspaceId===i.workspaceId?(0,e.jsx)(ne,{className:"h-3.5 w-3.5 shrink-0"}):null]},i.key))]},s.id))}),(0,e.jsx)("div",{className:"border-t border-line px-2 py-1.5 text-xs text-ink-3",children:t.executionWorkspaceId?"Current workspace stays active. Applies on the next run.":"Applies on the next run."})]})}):null,Pr&&t.executionWorkspaceId&&(0,e.jsx)(I,{label:"Workspace",children:(0,e.jsxs)(V,{to:`/execution-workspaces/${t.executionWorkspaceId}`,className:"text-sm text-accent hover:underline inline-flex min-w-0 items-center gap-1.5",children:[(0,e.jsx)(_o,{className:"h-3.5 w-3.5 shrink-0 text-ink-3"}),"View workspace",(0,e.jsx)(yt,{className:"h-3 w-3 shrink-0"})]})}),jn&&(0,e.jsx)(I,{label:"Service",children:(0,e.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[(0,e.jsx)(zl,{sections:Jt,isPending:it.isPending,pendingRequest:Rr,onAction:a(s=>it.mutate(s),"onAction"),square:!0,align:"start",iconOnly:!0}),an?(0,e.jsx)("span",{className:"text-xs text-ink-3",role:"status",children:an}):null,ln?(0,e.jsx)("span",{className:"text-xs text-bad",role:"alert",children:ln}):null]})}),t.currentExecutionWorkspace?.branchName&&(0,e.jsx)(I,{label:"Branch",children:(0,e.jsx)(ka,{value:t.currentExecutionWorkspace.branchName,icon:It})}),t.currentExecutionWorkspace?.cwd&&!Ie&&(0,e.jsx)(I,{label:"Folder",children:(0,e.jsx)(ka,{value:t.currentExecutionWorkspace.cwd,icon:yi})})]}):null,(0,e.jsxs)(ze,{title:"About",streamlined:!0,children:[U?(0,e.jsx)(I,{label:"Originating",children:U.kind==="agent"?(0,e.jsx)(V,{to:`/agents/${U.id}`,className:"hover:underline",children:(0,e.jsx)(ca,{agent:D?.find(s=>s.id===U.id)??{id:U.id,name:be(U.id)??"Agent"},size:"sm"})}):(0,e.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,e.jsx)(Pi,{name:In(U.id)??An?.label??"User",avatarUrl:An?.image??null,size:"sm"}),Sn?(0,e.jsxs)("span",{className:"shrink-0 truncate text-xs text-ink-3",children:["via ",Sn]}):null]})}):null,t.startedAt&&(0,e.jsx)(I,{label:"Started",children:(0,e.jsx)("span",{className:"min-w-0 truncate whitespace-nowrap text-sm",title:M(t.startedAt),children:M(t.startedAt)})}),t.completedAt&&(0,e.jsx)(I,{label:"Completed",children:(0,e.jsx)("span",{className:"min-w-0 truncate whitespace-nowrap text-sm",title:M(t.completedAt),children:M(t.completedAt)})}),(0,e.jsx)(I,{label:"Created",children:(0,e.jsx)("span",{className:"min-w-0 truncate whitespace-nowrap text-sm",title:M(t.createdAt),children:M(t.createdAt)})}),(0,e.jsx)(I,{label:"Updated",children:(0,e.jsx)("span",{className:"min-w-0 truncate whitespace-nowrap text-sm",title:jt(t.updatedAt),children:jt(t.updatedAt)})}),t.archivedAt&&t.archivedByActorType==="agent"&&t.archivedByAgentId?(()=>{const s=(D??[]).find(m=>m.id===t.archivedByAgentId),i=be(t.archivedByAgentId);return(0,e.jsx)(I,{label:"Archived",children:(0,e.jsxs)("div",{className:"flex min-w-0 max-w-full flex-col items-start gap-1",children:[(0,e.jsxs)("span",{className:"flex min-w-0 max-w-full items-center gap-1.5 text-sm",title:`Archived by ${i} · ${M(t.archivedAt)}`,children:[s?(0,e.jsx)(ve,{agent:s,size:16,className:"h-3.5 w-3.5 shrink-0 text-ink-3"}):null,(0,e.jsx)("span",{className:"min-w-0 truncate",children:i})]}),(0,e.jsxs)("div",{className:"flex min-w-0 max-w-full items-center gap-2",children:[(0,e.jsx)("span",{className:"shrink-0 text-xs text-ink-3",children:jt(t.archivedAt)}),(0,e.jsxs)("button",{type:"button",className:"inline-flex items-center gap-1 rounded-full border border-line px-2 py-0.5 text-xs text-ink-3 transition-colors hover:bg-bg-3/50 hover:text-ink disabled:opacity-50",onClick:a(()=>Kt.mutate(),"onClick"),disabled:Kt.isPending,children:[(0,e.jsx)(si,{className:"h-3 w-3"}),Kt.isPending?"Unarchiving…":"Unarchive"]})]}),cn?(0,e.jsx)("p",{className:"text-xs text-bad",role:"alert",children:cn}):null]})})})():null,t.requestDepth>0&&(0,e.jsx)(I,{label:"Depth",children:(0,e.jsx)("span",{className:"text-sm font-mono",children:t.requestDepth})})]}),(0,e.jsx)("div",{className:"pt-3",children:(0,e.jsx)(Ac,{issueId:t.id})})]});if(Q)return js;const pt=n.length>0,ft=kn.length>0||wn.length>0,gt=[{value:"properties",label:"Properties",closable:!1},...pt?[{value:"subtasks",label:"Subtasks",count:n.length,closable:!0}]:[],...ft?[{value:"references",label:"References",closable:!0}]:[],...me?[{value:"plans",label:"Plan",closable:!0}]:[],...Ge?[{value:"artifacts",label:"Artifacts",closable:!0}]:[]],bt=gt.filter(s=>s.value==="properties"||!St.has(s.value)),ys=gt.filter(s=>St.has(s.value));if(!pt&&!ft&&!me&&!Ge)return(0,e.jsxs)(e.Fragment,{children:[Z?(0,pa.createPortal)((0,e.jsx)("div",{className:"flex items-center",role:"tablist","aria-label":"Properties panel sections",children:(0,e.jsx)("button",{type:"button",role:"tab","aria-selected":"true",className:g(wa,"inline-flex flex-none items-center bg-bg-3 px-3"),children:"Properties"})}),Z):null,js]});const Zn=he==="plans"&&!me||he==="artifacts"&&!Ge||he==="subtasks"&&!pt||he==="references"&&!ft||St.has(he)?"properties":he,Pl=a(s=>{if(s==="properties"||(Se.current=!0,Xe(y=>{const te=new Set(y);return te.add(s),te}),Zn!==s))return;const i=bt.findIndex(y=>y.value===s),m=bt[i-1]??bt[i+1]??gt[0];Ae(m.value)},"closePaneTab"),Rl=a(s=>{Se.current=!0,Xe(i=>{if(!i.has(s))return i;const m=new Set(i);return m.delete(s),m}),Ae(s)},"reopenPaneTab"),de=!!Z,Tl=Z?g(wa,"min-w-0 flex-1 justify-start overflow-hidden after:hidden"):void 0,Jn=(0,e.jsx)(ei,{variant:"line",className:Z?"min-w-0 flex-1 items-center justify-start gap-0 overflow-hidden p-0 group-data-[orientation=horizontal]/tabs:h-full":"w-full justify-start gap-1",children:(de?bt:gt).map((s,i)=>{const m=(0,e.jsxs)(Jl,{value:s.value,className:g(Tl,de&&"mx-1.5 hover:bg-bg-3/50 group-focus-within/pane-tab:bg-bg-3/50",de&&"px-3"),children:[(0,e.jsx)("span",{className:g(de&&"task-detail-pane-tab-label min-w-0 flex-1 overflow-hidden whitespace-nowrap"),title:s.label,children:s.label}),s.count?(0,e.jsx)("span",{className:"shrink-0 font-mono text-(length:--text-nano) text-ink-3 transition-opacity group-hover/pane-tab:opacity-0 group-focus-within/pane-tab:opacity-0",children:s.count}):null]},de?void 0:s.value);return de?(0,e.jsxs)("div",{"data-slot":"task-detail-pane-tab",className:"group/pane-tab relative flex min-w-0 flex-1 basis-0 items-center",children:[i>0?(0,e.jsx)("span",{"data-slot":"task-detail-pane-tab-divider","aria-hidden":"true",className:"absolute left-0 top-1/2 h-4 w-px -translate-y-1/2 bg-line"}):null,m,s.closable?(0,e.jsx)("button",{type:"button",className:"absolute right-2.5 top-1/2 z-20 inline-flex size-5 -translate-y-1/2 items-center justify-center rounded-sm text-ink-3 opacity-0 transition-opacity hover:bg-bg-3 hover:text-ink focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-(length:--rad-3) focus-visible:ring-focus group-hover/pane-tab:opacity-100 group-focus-within/pane-tab:opacity-100","aria-label":`Close ${s.label} tab`,onPointerDown:a(y=>{y.preventDefault(),y.stopPropagation()},"onPointerDown"),onClick:a(y=>{y.preventDefault(),y.stopPropagation(),Pl(s.value)},"onClick"),children:(0,e.jsx)(Ni,{className:"size-3.5","aria-hidden":!0})}):null]},s.value):m})}),ea=de?(0,e.jsxs)("div",{className:"flex h-full min-w-0 flex-1 items-center",children:[Jn,(0,e.jsxs)(Zl,{children:[(0,e.jsx)(Xl,{asChild:!0,children:(0,e.jsx)(W,{variant:"ghost",size:"icon-xs",className:"size-6 shrink-0",disabled:ys.length===0,"aria-label":"Open closed sidebar tab",title:ys.length===0?"All sidebar tabs are open":"Open closed sidebar tab",children:(0,e.jsx)(vs,{className:"size-3.5","aria-hidden":!0})})}),(0,e.jsx)(Yl,{align:"start",className:"min-w-(--sz-8rem)",children:ys.map(s=>(0,e.jsx)(Gl,{onClick:a(()=>Rl(s.value),"onClick"),children:s.label},s.value))})]})]}):Jn;return(0,e.jsxs)(ti,{value:Zn,onValueChange:Za,className:"flex min-h-0 flex-col gap-3",children:[Z?(0,pa.createPortal)((0,e.jsx)("div",{className:"group/tabs contents","data-orientation":"horizontal",children:ea}),Z):ea,(0,e.jsx)(qe,{value:"properties",children:js}),pt?(0,e.jsx)(qe,{value:"subtasks",children:(0,e.jsx)(ko,{items:n,onAddSubtask:l,issueLinkState:r})}):null,ft?(0,e.jsx)(qe,{value:"references",children:(0,e.jsx)(yo,{referenced:kn,mentionedIn:wn,issueLinkState:r})}):null,me?(0,e.jsx)(qe,{value:"plans",children:(0,e.jsx)(Ho,{issue:t,inline:o})}):null,Ge?(0,e.jsx)(qe,{value:"artifacts",children:(0,e.jsx)(xc,{issue:t,documentDeepLink:v?.tab==="artifacts"?v:null})}):null]})}a(Hd,"IssueProperties");export{xc as a,zo as c,Bo as d,Lo as f,Ba as g,qa as h,ze as i,Do as l,za as m,ba as n,Ho as o,Da as p,I as r,Ua as s,Hd as t,Ns as u};
@@ -1 +1 @@
1
- var t=Object.defineProperty;var o=(e,r)=>t(e,"name",{value:r,configurable:!0});import{Hn as c,Wn as u}from"./index-DDoARkPG.js";function s(e,r){const n=e.currentExecutionWorkspace?.mode??e.executionWorkspaceSettings?.mode??e.executionWorkspacePreference;return e.executionWorkspaceId&&(n==="isolated_workspace"||n==="operator_branch")?"reuse_existing":e.executionWorkspacePreference??e.executionWorkspaceSettings?.mode??c(r)}o(s,"currentWorkspaceSelection");function p(e,r,n){return e==="reuse_existing"&&!r?null:e===null?{executionWorkspacePreference:null,executionWorkspaceId:null,executionWorkspaceSettings:null}:{executionWorkspacePreference:e,executionWorkspaceId:e==="reuse_existing"?r:null,executionWorkspaceSettings:{mode:e==="reuse_existing"?u(n):e,environmentId:null}}}o(p,"buildWorkspaceSelectionUpdate");export{s as n,p as t};
1
+ var t=Object.defineProperty;var o=(e,r)=>t(e,"name",{value:r,configurable:!0});import{Hn as c,Wn as u}from"./index-3AxqhPET.js";function s(e,r){const n=e.currentExecutionWorkspace?.mode??e.executionWorkspaceSettings?.mode??e.executionWorkspacePreference;return e.executionWorkspaceId&&(n==="isolated_workspace"||n==="operator_branch")?"reuse_existing":e.executionWorkspacePreference??e.executionWorkspaceSettings?.mode??c(r)}o(s,"currentWorkspaceSelection");function p(e,r,n){return e==="reuse_existing"&&!r?null:e===null?{executionWorkspacePreference:null,executionWorkspaceId:null,executionWorkspaceSettings:null}:{executionWorkspacePreference:e,executionWorkspaceId:e==="reuse_existing"?r:null,executionWorkspaceSettings:{mode:e==="reuse_existing"?u(n):e,environmentId:null}}}o(p,"buildWorkspaceSelectionUpdate");export{s as n,p as t};
@@ -1,2 +1,2 @@
1
- var F=Object.defineProperty;var i=(e,t)=>F(e,"name",{value:t,configurable:!0});import{i as S}from"./rolldown-runtime-ZpX3ckPj.js";import{l as N,na as I,ta as C}from"./createLucideIcon-DJi9suAC.js";import{t as f,v as g}from"./queryKeys-DYV5MhM_.js";import{n as T}from"./CompanyContext-CSrVsSze.js";import{t as P}from"./router-2UfGeejU.js";import{t as L}from"./chevron-right-s7L6hXXq.js";import{t as _}from"./triangle-alert-CBVKiaXB.js";import{t as K}from"./agents-DmlgUVso.js";import{t as R}from"./projects-mixWrT5q.js";import{t as O}from"./access-GAosX22P.js";import{t as h}from"./assignees-DkQNbPzi.js";import{Jn as M}from"./index-DDoARkPG.js";function he(e){return e==="done"||e==="cancelled"}i(he,"isPipelineTerminalStageKind");function be(e){const t={};for(const r of e)(t[r.stageId]??=[]).push(r);return t}i(be,"groupWarningsByStage");var q=S(I(),1);function ye(e={}){const{selectedCompanyId:t}=T(),r=e.companyId??t,n=(e.enabled??!0)&&!!r,s=g({queryKey:r?f.agents.list(r):["agents","standard-mentions","none"],queryFn:i(()=>K.list(r),"queryFn"),enabled:n&&e.agents===void 0}),o=g({queryKey:r?f.projects.list(r):["projects","standard-mentions","none"],queryFn:i(()=>R.list(r),"queryFn"),enabled:n&&e.projects===void 0}),u=g({queryKey:r?f.access.companyUserDirectory(r):["access","standard-mentions","users","none"],queryFn:i(()=>O.listUserDirectory(r),"queryFn"),enabled:n&&e.members===void 0}),l=e.agents??s.data,c=e.projects??o.data,x=e.members??u.data?.users;return(0,q.useMemo)(()=>M({agents:l,projects:c,members:x}),[l,x,c])}i(ye,"useStandardMarkdownMentionOptions");var D=new Set(["nextSuggestedStageId","suggestionResolution","upstreamDrift","upstreamChanged","changeAcknowledgedAt","thisChanged"]);function d(e){return typeof e=="string"&&e.trim()?e.trim():null}i(d,"readString");function b(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}i(b,"readRecord");function y(e,t){return!t||!e?null:Array.isArray(e)?e.find(r=>r.key===t||r.id===t)?.name??null:e instanceof Map?e.get(t)??null:e[t]??null}i(y,"stageNameFromLookup");function v(e){return e.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").trim().replace(/\s+/g," ").replace(/^./,t=>t.toUpperCase())}i(v,"humanizeKey");function ve(e){if(!e)return"Open";const t=e.trim().toLowerCase();return t?{open:"Open",working:"In progress",done:"Done",cancelled:"Removed",in_review:"In review",review:"In review",in_progress:"In progress"}[t]??v(t):"Open"}i(ve,"humanizePipelineItemStatus");function $(e){if(Array.isArray(e)){const r=e.map($).filter(Boolean);return r.length?r.join(", "):"None"}if(e==null||e==="")return"None";if(typeof e=="boolean")return e?"Yes":"No";if(typeof e=="number")return String(e);if(typeof e=="string")return e;const t=b(e);return t?d(t.label)??d(t.name)??d(t.title)??"Added details":String(e)}i($,"formatFieldValue");function xe(e){return Object.entries(e??{}).filter(([t])=>!D.has(t)).map(([t,r])=>({key:t,label:v(t),value:$(r)}))}i(xe,"displayPipelineItemFields");var W=180;function B(e){const t=e.value.trim();return!t||t==="None"?!1:t.includes(`
1
+ var F=Object.defineProperty;var i=(e,t)=>F(e,"name",{value:t,configurable:!0});import{i as S}from"./rolldown-runtime-ZpX3ckPj.js";import{l as N,na as I,ta as C}from"./createLucideIcon-DJi9suAC.js";import{t as f,v as g}from"./queryKeys-DYV5MhM_.js";import{n as T}from"./CompanyContext-CSrVsSze.js";import{t as P}from"./router-2UfGeejU.js";import{t as L}from"./chevron-right-s7L6hXXq.js";import{t as _}from"./triangle-alert-CBVKiaXB.js";import{t as K}from"./agents-DmlgUVso.js";import{t as R}from"./projects-mixWrT5q.js";import{t as O}from"./access-GAosX22P.js";import{t as h}from"./assignees-DkQNbPzi.js";import{Jn as M}from"./index-3AxqhPET.js";function he(e){return e==="done"||e==="cancelled"}i(he,"isPipelineTerminalStageKind");function be(e){const t={};for(const r of e)(t[r.stageId]??=[]).push(r);return t}i(be,"groupWarningsByStage");var q=S(I(),1);function ye(e={}){const{selectedCompanyId:t}=T(),r=e.companyId??t,n=(e.enabled??!0)&&!!r,s=g({queryKey:r?f.agents.list(r):["agents","standard-mentions","none"],queryFn:i(()=>K.list(r),"queryFn"),enabled:n&&e.agents===void 0}),o=g({queryKey:r?f.projects.list(r):["projects","standard-mentions","none"],queryFn:i(()=>R.list(r),"queryFn"),enabled:n&&e.projects===void 0}),u=g({queryKey:r?f.access.companyUserDirectory(r):["access","standard-mentions","users","none"],queryFn:i(()=>O.listUserDirectory(r),"queryFn"),enabled:n&&e.members===void 0}),l=e.agents??s.data,c=e.projects??o.data,x=e.members??u.data?.users;return(0,q.useMemo)(()=>M({agents:l,projects:c,members:x}),[l,x,c])}i(ye,"useStandardMarkdownMentionOptions");var D=new Set(["nextSuggestedStageId","suggestionResolution","upstreamDrift","upstreamChanged","changeAcknowledgedAt","thisChanged"]);function d(e){return typeof e=="string"&&e.trim()?e.trim():null}i(d,"readString");function b(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}i(b,"readRecord");function y(e,t){return!t||!e?null:Array.isArray(e)?e.find(r=>r.key===t||r.id===t)?.name??null:e instanceof Map?e.get(t)??null:e[t]??null}i(y,"stageNameFromLookup");function v(e){return e.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").trim().replace(/\s+/g," ").replace(/^./,t=>t.toUpperCase())}i(v,"humanizeKey");function ve(e){if(!e)return"Open";const t=e.trim().toLowerCase();return t?{open:"Open",working:"In progress",done:"Done",cancelled:"Removed",in_review:"In review",review:"In review",in_progress:"In progress"}[t]??v(t):"Open"}i(ve,"humanizePipelineItemStatus");function $(e){if(Array.isArray(e)){const r=e.map($).filter(Boolean);return r.length?r.join(", "):"None"}if(e==null||e==="")return"None";if(typeof e=="boolean")return e?"Yes":"No";if(typeof e=="number")return String(e);if(typeof e=="string")return e;const t=b(e);return t?d(t.label)??d(t.name)??d(t.title)??"Added details":String(e)}i($,"formatFieldValue");function xe(e){return Object.entries(e??{}).filter(([t])=>!D.has(t)).map(([t,r])=>({key:t,label:v(t),value:$(r)}))}i(xe,"displayPipelineItemFields");var W=180;function B(e){const t=e.value.trim();return!t||t==="None"?!1:t.includes(`
2
2
  `)||t.length>=W}i(B,"isLongPipelineItemField");function ke(e){const t=[],r=[];for(const n of e)B(n)?r.push(n):t.push(n);return{shortFields:t,longFields:r}}i(ke,"splitPipelineItemFields");function p(e){return e?h(e)||h({assigneeAgentId:e.createdByAgentId}):""}i(p,"sourceIssueAssigneeValue");function Ae(e){const t=e.conversationIssue??null,r=h(t??{});if(r)return r;const n=e.conversationSource;if(n?.issue&&n.kind!=="explicit_conversation"){const o=p(n.issue);if(o)return o}const s=(e.issueLinks??[]).filter(o=>o.link.role!=="conversation").slice().reverse();return p(((t?.parentId?s.find(o=>o.issue.id===t.parentId):null)??s.find(o=>p(o.issue)))?.issue)}i(Ae,"pipelineConversationStarterAssigneeValue");function E(e){const t=e.pipeline?.id,r=e.stage;return!t||!r?null:{case:{id:e.id,pipelineId:t,stageId:r.id,caseKey:e.caseKey??null,title:e.title,fields:{},terminalKind:e.terminalKind??null,childCount:e.rollup?.total??e.childGroups?.reduce((n,s)=>n+(s.cases?.length??0),0)??0,createdAt:e.createdAt,updatedAt:e.updatedAt},stage:{id:r.id,pipelineId:t,key:r.key,name:r.name,kind:r.kind,position:0}}}i(E,"treeNodeToChildRow");function we(e){if(Array.isArray(e))return e.filter(r=>{const n=r;return!!(n.case?.id&&n.case.pipelineId&&n.stage?.id)});const t=b(e);return t?(t.childGroups??t.case?.childGroups??[]).flatMap(r=>r.cases??[]).map(E).filter(r=>!!r):[]}i(we,"normalizePipelineChildRows");function Se(e,t){const r=e.fields??{};if(r.suggestionResolution||r.changeAcknowledgedAt)return{visible:!1,reason:"resolved"};const n=e.pendingSuggestion??null,s=n?.toStageKey??d(r.nextSuggestedStageId);return s?{visible:!0,suggestionId:n?.id??null,toStageKey:s,stageName:y(t,s)??"the next stage",rationale:n?.rationale??null}:{visible:!1,reason:"no_next_stage"}}i(Se,"getPendingTransitionBannerState");function Ne(e){const t=e.fields??{};return e.changeAcknowledgedAt||t.changeAcknowledgedAt?null:e.thisChanged||t.thisChanged||t.upstreamChanged||t.upstreamDrift?{title:"This changed",body:"Upstream work changed after this item was created. Review the latest details before continuing."}:null}i(Ne,"itemHasChangedNotice");function U(e){const t=e.filter(r=>r.type==="drift_acknowledged").map(r=>new Date(r.createdAt).getTime()).filter(r=>Number.isFinite(r)).reduce((r,n)=>Math.max(r,n),0);return e.some(r=>{if(r.type!=="upstream_drift")return!1;const n=new Date(r.createdAt).getTime();return Number.isFinite(n)&&n>t})}i(U,"eventsHaveUnacknowledgedDrift");function _e(e){return U(e)?{title:"This changed",body:"Upstream work changed after this item was created. Review the latest details before continuing."}:null}i(_e,"changedNoticeFromEvents");function k(e,t,r){const n=r==="from"?e.fromStage:e.toStage;return n?.name?n.name:y(t,(r==="from"?e.fromStageId:e.toStageId)??void 0)}i(k,"stageName");function A(e){return d(e.decision)?.toLowerCase()??null}i(A,"readDecision");function z(e){return e.actorAgent?.name?e.actorAgent.name:e.actorType==="user"?"Board":e.actorType==="system"?"Wardmote":null}i(z,"actorName");function H(e){const t=d(e.reason);return t?t==="children_terminal"?"all child items done":t:null}i(H,"movementReason");function V(e,t){const r=d(t.transitionClass)?.toLowerCase();return r==="auto"||r==="automatic"||e.actorType==="system"&&d(t.reason)==="children_terminal"?"automatic":r==="manual"?"manual":r}i(V,"movementClass");function G(e){const t=e.automation?.issue;return t?t.identifier??t.title:null}i(G,"automationIssueLabel");function Q(e){return v(e).replace(/^./,t=>t.toLowerCase())}i(Q,"humanizeReason");function $e(e,t){const r=e.type.startsWith("case.")?e.type.slice(5):e.type,n=e.payload??{};if(r==="ingested")return"Item added.";if(r==="updated")return n.action==="stage_automation_rerun_requested"?"Stage automation re-run requested.":"Item details updated.";if(r==="transitioned"){const s=k(e,t,"from"),o=k(e,t,"to"),u=s&&o?`Moved from ${s} to ${o}`:o?`Moved to ${o}`:"Moved to another stage",l=H(n);if(V(e,n)==="automatic")return`${u} — automatic${l?` (${l})`:""}.`;const c=z(e);return l&&c?`${u} — ${c}: '${l}'.`:l?`${u} — '${l}'.`:c&&e.actorType!=="system"?`${u} — ${c}.`:`${u}.`}if(r==="suggested"||r==="transition_suggested")return`Suggested moving to ${y(t,d(b(n.suggestion)?.toStageKey)??d(n.toStageKey))??"the next stage"}.`;if(r==="suggestion_resolved"){const s=A(n);return s==="accept"?"Suggestion approved.":s==="dismiss"?"Suggestion dismissed.":"Suggestion resolved."}if(r==="reviewed"||r==="review_decided"){const s=A(n);return s==="request_changes"?"Review requested changes.":s==="drop"||s==="reject"?"Review removed this item.":s==="approve"?"Review approved this item.":"Review completed."}if(r==="conversation_opened")return"Conversation started.";if(r==="issue_linked")return"Linked to work.";if(r==="issue_unlinked")return"Work link removed.";if(r==="blockers_set")return"Waiting items updated.";if(r==="blockers_resolved")return"Waiting items cleared.";if(r==="children_terminal")return"Built-from items completed.";if(r==="upstream_drift"){const s=d(n.upstreamCaseKey);return s?`Upstream change detected from ${s}.`:"Upstream change detected."}if(r==="drift_acknowledged")return"Upstream change acknowledged.";if(r==="automation_executed"){const s=e.automation?.routine?.title??"the automation",o=G(e);return`Automation completed — ran ${s}${o?` -> ${o}`:""}.`}if(r==="automation_failed"){const s=d(n.error);return`Automation needs attention${s?` — ${Q(s)}`:""}.`}return r==="claimed"?"Work started.":r==="lease_released"||r==="lease_expired"?"Work handoff cleared.":"Activity recorded."}i($e,"formatPipelineItemEvent");var a=S(C(),1);function Y(e){return`${e} thing${e===1?"":"s"} to fix`}i(Y,"warningCount");var Z=5;function j({warning:e}){return(0,a.jsxs)(a.Fragment,{children:[e.message,e.href?(0,a.jsxs)(a.Fragment,{children:[" ",(0,a.jsx)(P,{to:e.href,className:"font-medium underline underline-offset-2",children:e.hrefLabel??"Open"})]}):null]})}i(j,"WarningMessage");function je({warnings:e,onSelectStage:t,className:r}){if(e.length===0)return null;const n=e.slice(0,Z),s=e.length-n.length;return(0,a.jsxs)("div",{role:"region","aria-labelledby":"pipeline-health-bar-heading",className:N("rounded-md border border-amber-200 bg-amber-50 px-3 py-2.5 text-amber-900 dark:border-amber-300/30 dark:bg-amber-400/10 dark:text-amber-200",r),children:[(0,a.jsxs)("h2",{id:"pipeline-health-bar-heading",className:"flex items-center gap-2 text-sm font-semibold",children:[(0,a.jsx)(_,{className:"h-4 w-4 shrink-0"}),(0,a.jsxs)("span",{children:["Some steps won't run yet — ",Y(e.length)]})]}),(0,a.jsx)("ul",{className:"mt-1.5 space-y-1 pl-6 text-sm",children:n.map((o,u)=>{const l=(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("span",{className:"font-medium",children:[o.stageName,":"]})," ",(0,a.jsx)(j,{warning:o})]});return(0,a.jsx)("li",{className:"list-disc",children:o.href?(0,a.jsx)("span",{children:l}):t?(0,a.jsxs)("button",{type:"button","aria-label":`Open ${o.stageName} settings`,className:"group flex w-full items-start gap-1 text-left underline-offset-2 hover:underline",onClick:i(()=>t(o.stageId),"onClick"),children:[(0,a.jsx)("span",{className:"min-w-0 flex-1",children:l}),(0,a.jsx)(L,{className:"mt-0.5 h-3 w-3 shrink-0 opacity-70","aria-hidden":"true"})]}):(0,a.jsx)("span",{children:l})},`${o.stageId}-${o.code}-${u}`)})}),s>0?(0,a.jsxs)("p",{className:"mt-1.5 pl-6 text-xs text-amber-800/80 dark:text-amber-200/70",children:["+",s," more in stage settings"]}):null]})}i(je,"PipelineHealthBar");function Fe({warnings:e,className:t}){return e.length===0?null:(0,a.jsxs)("div",{role:"region","aria-labelledby":"stage-health-warnings-heading",className:N("rounded-md border border-amber-200 bg-amber-50 px-3 py-2.5 text-sm text-amber-900 dark:border-amber-300/30 dark:bg-amber-400/10 dark:text-amber-200",t),children:[(0,a.jsxs)("h2",{id:"stage-health-warnings-heading",className:"flex items-center gap-2 text-sm font-semibold",children:[(0,a.jsx)(_,{className:"h-4 w-4 shrink-0"}),(0,a.jsx)("span",{children:e.length===1?"This step won't run yet":`This step won't run yet — ${e.length} things to fix`})]}),(0,a.jsx)("ul",{className:"mt-1.5 space-y-1 pl-6",children:e.map((r,n)=>(0,a.jsx)("li",{className:"list-disc",children:(0,a.jsx)(j,{warning:r})},`${r.code}-${n}`))})]})}i(Fe,"StageHealthWarnings");function m(e){return typeof e=="string"?e.trim():""}i(m,"asString");function w(e){if(!Array.isArray(e))return[];const t=new Set;return e.flatMap(r=>{const n=m(r);return!n||t.has(n)?[]:(t.add(n),[n])})}i(w,"asStringList");function J(e,t){const r=e.carryOverPolicy;if(r&&typeof r=="object"&&!Array.isArray(r)){const n=r;return{version:1,mode:n.mode==="all_except"||n.mode==="only"?n.mode:"all_except",includeFields:w(n.includeFields),excludeFields:w(n.excludeFields)}}return{version:1,mode:"only",includeFields:t,excludeFields:[]}}i(J,"readCarryOverPolicy");function X(e){const t=e.replace(/[^A-Za-z0-9]/g,"").toLowerCase();return t==="name"||t==="title"||t==="casename"||t==="casetitle"}i(X,"isCarryOverIdentityFieldKey");function Ie(e,t){return!e||X(t)?!1:e.mode==="only"?e.includeFields.includes(t):!e.excludeFields.includes(t)}i(Ie,"isCarryOverFieldEnabled");function Ce(e){const t=e?.config?.breakdown;if(!t||typeof t!="object"||Array.isArray(t))return null;const r=t,n=Array.isArray(r.inheritFields)?r.inheritFields.filter(o=>typeof o=="string"&&o.trim().length>0).map(o=>o.trim()):[],s=J(r,n);return{targetPipelineId:m(r.targetPipelineId),targetStageKey:m(r.targetStageKey),pieceNoun:m(r.pieceNoun)||"piece",inheritFields:n,carryOverPolicy:s,advanceTo:m(r.advanceTo)||null,waitForPieces:r.waitForPieces===!0,whenFinishedMoveTo:m(r.whenFinishedMoveTo)||null}}i(Ce,"readStageBreakdown");function Te(e){return`${e.trim()||"piece"}s`}i(Te,"pieceNounPlural");function ee(e){const t=e.filter(r=>r.trim().length>0);return t.length===0?"":t.length===1?t[0]:t.length===2?`${t[0]} and ${t[1]}`:`${t.slice(0,-1).join(", ")} and ${t[t.length-1]}`}i(ee,"joinWithAnd");function Pe(e,t){if(!e.targetPipelineId||!e.targetStageKey||!t.targetPipelineName)return null;const r=e.pieceNoun,n=[`Wardmote will create one ${r} per item in ${t.targetPipelineName} → ${t.entryStageName}`];t.inheritedFieldLabels.length>0&&n.push(`carry over ${ee(t.inheritedFieldLabels)}`),t.advanceToName&&n.push(`move this case to ${t.advanceToName}`);let s=n.join(", ");return e.waitForPieces&&t.whenFinishedName&&(s+=`, then wait until every ${r} is finished before moving it to ${t.whenFinishedName}`),`${s}.`}i(Pe,"breakdownSummarySentence");var te={outer:"border-line bg-bg",header:"border-line text-ink-3",meta:"border-line",body:"",bodyOver:"bg-bg-3/40"},re={review:{outer:"border-violet-500/25 bg-violet-50/50 dark:bg-violet-950/15",header:"border-violet-500/15 text-violet-700 dark:text-violet-300",meta:"border-violet-500/15",body:"bg-violet-50/30 dark:bg-violet-950/10",bodyOver:"bg-violet-100/65 dark:bg-violet-950/30"},in_review:{outer:"border-violet-500/25 bg-violet-50/50 dark:bg-violet-950/15",header:"border-violet-500/15 text-violet-700 dark:text-violet-300",meta:"border-violet-500/15",body:"bg-violet-50/30 dark:bg-violet-950/10",bodyOver:"bg-violet-100/65 dark:bg-violet-950/30"},done:{outer:"border-green-500/25 bg-green-50/50 dark:bg-green-950/15",header:"border-green-500/15 text-green-700 dark:text-green-300",meta:"border-green-500/15",body:"bg-green-50/30 dark:bg-green-950/10",bodyOver:"bg-green-100/65 dark:bg-green-950/30"},cancelled:{outer:"border-neutral-300/70 bg-bg-3/25 opacity-85 dark:border-neutral-700/70 dark:bg-neutral-900/20",header:"border-line/70 text-ink-3/80",meta:"border-line/70",body:"bg-bg-3/20",bodyOver:"bg-bg-3/45"}};function Le(e){return re[e?.trim().toLowerCase()??""]??te}i(Le,"getPipelineStageColumnTone");function Ke(e,t){return`/pipelines/${e}/settings?stage=${t}&section=instructions`}i(Ke,"pipelineStageAutomationSettingsHref");export{he as S,we as _,X as a,ye as b,je as c,_e as d,xe as f,Ne as g,ve as h,Ie as i,Fe as l,Se as m,Ke as n,Te as o,$e as p,Pe as r,Ce as s,Le as t,D as u,Ae as v,be as x,ke as y};
@@ -1 +1 @@
1
- var c=Object.defineProperty;var r=(e,s)=>c(e,"name",{value:s,configurable:!0});import{i as u}from"./rolldown-runtime-ZpX3ckPj.js";import{ta as m}from"./createLucideIcon-DJi9suAC.js";import{n as x}from"./queryKeys-DYV5MhM_.js";import{t as f}from"./triangle-alert-CBVKiaXB.js";import{t as i}from"./badge-DuA2EgZC.js";import{r as h,t as p}from"./card-Bru3x_SJ.js";import{pn as b}from"./index-DDoARkPG.js";var t=u(m(),1);function T({risk:e}){return e?(0,t.jsx)(i,{variant:e==="high"||e==="critical"?"destructive":e==="medium"?"secondary":"outline",children:e}):(0,t.jsx)(i,{variant:"outline",children:"unknown"})}r(T,"RiskBadge");function q({isReadOnly:e,isWrite:s,isDestructive:a}){return(0,t.jsxs)("span",{className:"inline-flex flex-wrap gap-1",children:[e?(0,t.jsx)(i,{variant:"outline",children:"read-only"}):null,s?(0,t.jsx)(i,{variant:"secondary",children:"write"}):null,a?(0,t.jsx)(i,{variant:"destructive",children:"destructive"}):null]})}r(q,"CapabilityBadges");function g(e){switch(e){case"allow":case"allowed":return{key:"allowed",label:"allowed"};case"deny":case"denied":return{key:"denied",label:"denied"};case"block":return{key:"block",label:"block"};case"require_approval":case"requires_approval":return{key:"require-approval",label:"require approval"};case"redact":case"redacted":return{key:"redacted",label:"redacted"};case"rate_limited":return{key:"rate-limit",label:"rate limited"};case"defer":case"deferred":return{key:"deferred",label:"deferred"};case"hidden":return{key:"hidden",label:"hidden"};default:return{key:e,label:e}}}r(g,"decisionToStatusKey");function C({decision:e}){if(!e)return(0,t.jsx)(i,{variant:"outline",children:"—"});const{key:s,label:a}=g(e.toString());return(0,t.jsx)(b,{status:s,label:a})}r(C,"DecisionBadge");function M({value:e}){if(!e)return(0,t.jsx)("span",{className:"text-ink-3",children:"never"});const s=typeof e=="string"?new Date(e):e;if(Number.isNaN(s.getTime()))return(0,t.jsx)("span",{className:"text-ink-3",children:"—"});const a=Date.now()-s.getTime(),n=Math.round(Math.abs(a)/6e4),o=a<0;let l;if(n<1)l="just now";else{const d=n<60?`${n}m`:n<1440?`${Math.round(n/60)}h`:`${Math.round(n/1440)}d`;l=o?`in ${d}`:`${d} ago`}return(0,t.jsx)("span",{title:s.toLocaleString(),className:"text-ink-3",children:l})}r(M,"RelativeTime");function B({title:e,description:s,actions:a}){return(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("h2",{className:"text-lg font-semibold text-ink",children:e}),s?(0,t.jsx)("p",{className:"max-w-2xl text-sm text-ink-3",children:s}):null]}),a?(0,t.jsx)("div",{className:"flex shrink-0 gap-2",children:a}):null]})}r(B,"ToolsPageHeader");function $({label:e="Loading…"}){return(0,t.jsxs)("div",{className:"flex items-center gap-2 py-10 text-sm text-ink-3",children:[(0,t.jsx)("span",{className:"h-4 w-4 animate-spin rounded-full border-2 border-ink-3/30 border-t-ink-3"}),e]})}r($,"LoadingState");function A({error:e,onRetry:s}){let a;return e instanceof x?e.status===403?a="You do not have permission to view this. Tools & Access requires board/admin access.":e.status===404||/route not found/i.test(e.message)?a="Tools & Access isn't available on this server yet — try refreshing after the next deployment.":a=e.message:e instanceof Error?a=e.message:a="Something went wrong.",(0,t.jsx)(p,{className:"border-bad/40",children:(0,t.jsxs)(h,{className:"flex flex-col gap-3 py-6",children:[(0,t.jsxs)("div",{className:"flex items-start gap-2 text-sm text-bad",children:[(0,t.jsx)(f,{className:"mt-0.5 h-4 w-4 shrink-0"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-medium",children:"Could not load this view"}),(0,t.jsx)("p",{className:"text-bad/80",children:a})]})]}),s?(0,t.jsx)("button",{type:"button",onClick:s,className:"self-start rounded-md border border-line px-3 py-1.5 text-xs font-medium hover:bg-bg-3",children:"Retry"}):null]})})}r(A,"ErrorState");export{M as a,$ as i,C as n,T as o,A as r,B as s,q as t};
1
+ var c=Object.defineProperty;var r=(e,s)=>c(e,"name",{value:s,configurable:!0});import{i as u}from"./rolldown-runtime-ZpX3ckPj.js";import{ta as m}from"./createLucideIcon-DJi9suAC.js";import{n as x}from"./queryKeys-DYV5MhM_.js";import{t as f}from"./triangle-alert-CBVKiaXB.js";import{t as i}from"./badge-DuA2EgZC.js";import{r as h,t as p}from"./card-Bru3x_SJ.js";import{pn as b}from"./index-3AxqhPET.js";var t=u(m(),1);function T({risk:e}){return e?(0,t.jsx)(i,{variant:e==="high"||e==="critical"?"destructive":e==="medium"?"secondary":"outline",children:e}):(0,t.jsx)(i,{variant:"outline",children:"unknown"})}r(T,"RiskBadge");function q({isReadOnly:e,isWrite:s,isDestructive:a}){return(0,t.jsxs)("span",{className:"inline-flex flex-wrap gap-1",children:[e?(0,t.jsx)(i,{variant:"outline",children:"read-only"}):null,s?(0,t.jsx)(i,{variant:"secondary",children:"write"}):null,a?(0,t.jsx)(i,{variant:"destructive",children:"destructive"}):null]})}r(q,"CapabilityBadges");function g(e){switch(e){case"allow":case"allowed":return{key:"allowed",label:"allowed"};case"deny":case"denied":return{key:"denied",label:"denied"};case"block":return{key:"block",label:"block"};case"require_approval":case"requires_approval":return{key:"require-approval",label:"require approval"};case"redact":case"redacted":return{key:"redacted",label:"redacted"};case"rate_limited":return{key:"rate-limit",label:"rate limited"};case"defer":case"deferred":return{key:"deferred",label:"deferred"};case"hidden":return{key:"hidden",label:"hidden"};default:return{key:e,label:e}}}r(g,"decisionToStatusKey");function C({decision:e}){if(!e)return(0,t.jsx)(i,{variant:"outline",children:"—"});const{key:s,label:a}=g(e.toString());return(0,t.jsx)(b,{status:s,label:a})}r(C,"DecisionBadge");function M({value:e}){if(!e)return(0,t.jsx)("span",{className:"text-ink-3",children:"never"});const s=typeof e=="string"?new Date(e):e;if(Number.isNaN(s.getTime()))return(0,t.jsx)("span",{className:"text-ink-3",children:"—"});const a=Date.now()-s.getTime(),n=Math.round(Math.abs(a)/6e4),o=a<0;let l;if(n<1)l="just now";else{const d=n<60?`${n}m`:n<1440?`${Math.round(n/60)}h`:`${Math.round(n/1440)}d`;l=o?`in ${d}`:`${d} ago`}return(0,t.jsx)("span",{title:s.toLocaleString(),className:"text-ink-3",children:l})}r(M,"RelativeTime");function B({title:e,description:s,actions:a}){return(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("h2",{className:"text-lg font-semibold text-ink",children:e}),s?(0,t.jsx)("p",{className:"max-w-2xl text-sm text-ink-3",children:s}):null]}),a?(0,t.jsx)("div",{className:"flex shrink-0 gap-2",children:a}):null]})}r(B,"ToolsPageHeader");function $({label:e="Loading…"}){return(0,t.jsxs)("div",{className:"flex items-center gap-2 py-10 text-sm text-ink-3",children:[(0,t.jsx)("span",{className:"h-4 w-4 animate-spin rounded-full border-2 border-ink-3/30 border-t-ink-3"}),e]})}r($,"LoadingState");function A({error:e,onRetry:s}){let a;return e instanceof x?e.status===403?a="You do not have permission to view this. Tools & Access requires board/admin access.":e.status===404||/route not found/i.test(e.message)?a="Tools & Access isn't available on this server yet — try refreshing after the next deployment.":a=e.message:e instanceof Error?a=e.message:a="Something went wrong.",(0,t.jsx)(p,{className:"border-bad/40",children:(0,t.jsxs)(h,{className:"flex flex-col gap-3 py-6",children:[(0,t.jsxs)("div",{className:"flex items-start gap-2 text-sm text-bad",children:[(0,t.jsx)(f,{className:"mt-0.5 h-4 w-4 shrink-0"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-medium",children:"Could not load this view"}),(0,t.jsx)("p",{className:"text-bad/80",children:a})]})]}),s?(0,t.jsx)("button",{type:"button",onClick:s,className:"self-start rounded-md border border-line px-3 py-1.5 text-xs font-medium hover:bg-bg-3",children:"Retry"}):null]})})}r(A,"ErrorState");export{M as a,$ as i,C as n,T as o,A as r,B as s,q as t};
@@ -1 +1 @@
1
- var E=Object.defineProperty;var a=(e,n)=>E(e,"name",{value:n,configurable:!0});import{i as j}from"./rolldown-runtime-ZpX3ckPj.js";import{t as h,ta as W}from"./createLucideIcon-DJi9suAC.js";import{G as U,_t as O}from"./router-2UfGeejU.js";import{t as T}from"./circle-question-mark-B1jR2is9.js";import{t as F}from"./file-pen-line-DX6PZQXR.js";import{a as G}from"./RichWorkProductCard-JGHGU_RI.js";import{t as P}from"./network-RCsafDTP.js";import{t as D}from"./search-04O7m-IF.js";import{t as Z}from"./shield-check-B0HVjzM_.js";import{t as B}from"./terminal-C0CKe_Zz.js";import{Ba as V,Ga as H,Ma as X}from"./index-DDoARkPG.js";var y={name:"chevrons-left-right-ellipsis",size:24,node:[["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"m17 7 5 5-5 5",key:"1xlxn0"}],["path",{d:"m7 7-5 5 5 5",key:"19njba"}],["path",{d:"M8 12h.01",key:"czm47f"}]]};y.node;var K=h(y),R={name:"message-square-reply",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"m10 8-3 3 3 3",key:"fp6dz7"}],["path",{d:"M17 14v-1a2 2 0 0 0-2-2H7",key:"1tkjnz"}]]};R.node;var Q=h(R),C={name:"search-code",size:24,node:[["path",{d:"m13 13.5 2-2.5-2-2.5",key:"1rvxrh"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}],["path",{d:"M9 8.5 7 11l2 2.5",key:"6ffwbx"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};C.node;var Y=h(C),d=j(W(),1);function J(e){return(0,d.jsxs)("svg",{viewBox:"0 0 180 180",fill:"none",stroke:"currentColor",strokeWidth:14,strokeLinecap:"round",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,d.jsx)("path",{d:"M18 84.8528L85.8822 16.9706C95.2548 7.59798 110.451 7.59798 119.823 16.9706C129.196 26.3431 129.196 41.5391 119.823 50.9117L68.5581 102.177"}),(0,d.jsx)("path",{d:"M69.2652 101.47L119.823 50.9117C129.196 41.5391 144.392 41.5391 153.765 50.9117L154.118 51.2652C163.491 60.6378 163.491 75.8338 154.118 85.2063L92.7248 146.6C89.6006 149.724 89.6006 154.789 92.7248 157.913L105.331 170.52"}),(0,d.jsx)("path",{d:"M102.853 33.9411L52.6482 84.1457C43.2756 93.5183 43.2756 108.714 52.6482 118.087C62.0208 127.459 77.2167 127.459 86.5893 118.087L136.794 67.8822"})]})}a(J,"McpIcon");var ee=new Set(["tool","tool call","tool_call","acp_tool"]);function l(e){const n=(e??"").trim().toLowerCase().replace(/\s*\((?:pending|in[_ -]?progress|completed|failed|cancelled|canceled)\)$/,"");return!n||ee.has(n)}a(l,"isGenericToolName");function L(e){const n=e.match(/^mcp__(.+?)__(.+)$/i);if(n)return{namespace:n[1],name:n[2]};const t=e.match(/^mcp\.([^.]+)\.(.+)$/i);return t?{namespace:t[1],name:t[2]}:null}a(L,"mcpToolIdentity");function f(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/[^A-Za-z0-9]+/g," ").trim().toLowerCase().split(/\s+/).filter(Boolean)}a(f,"identifierWords");function $(e){if(e.length===0)return"";const n=e.map(t=>["api","id","lsp","mcp","pr","url"].includes(t)?t.toUpperCase():t).join(" ");return n.charAt(0).toUpperCase()+n.slice(1)}a($,"sentenceCase");function b(e){const n=(e??"").trim();return l(n)?"Unnamed tool":$(f(L(n)?.name??n))}a(b,"humanizeToolName");var i=a((e,n,t)=>({key:e,singular:n,plural:t}),"group"),te={bash:{action:"run"},terminal:{action:"run"},shell:{action:"run"},command:{action:"run"},run:{action:"run"},execute:{action:"run"},exec_command:{action:"run"},apply_patch:{action:"update",running:"Applying a patch",completed:"Applied a patch"},read:{action:"read",running:"Reading a file",completed:"Read a file"},write:{action:"update",running:"Writing a file",completed:"Wrote a file"},edit:{action:"update",running:"Editing a file",completed:"Edited a file"},notebook_read:{action:"read",running:"Reading a notebook",completed:"Read a notebook"},notebook_edit:{action:"update",running:"Editing a notebook",completed:"Edited a notebook"},glob:{action:"search",running:"Searching files",completed:"Searched files"},grep:{action:"search",running:"Searching file contents",completed:"Searched file contents",family:"grep"},tool_search:{action:"search",running:"Searching available tools",completed:"Searched available tools",group:i("tool_search","tool search","tool searches")},web_search:{action:"search",running:"Searching the web",completed:"Searched the web",family:"web"},web_fetch:{action:"fetch",running:"Fetching a web page",completed:"Fetched a web page",family:"web"},todo_write:{action:"update",running:"Updating the task list",completed:"Updated the task list",family:"plan",group:i("task_operation","task operation","task operations")},task_create:{action:"create",running:"Creating a task",completed:"Created a task",family:"plan",group:i("task_operation","task operation","task operations")},task_update:{action:"update",running:"Updating a task",completed:"Updated a task",family:"plan",group:i("task_operation","task operation","task operations")},task_list:{action:"list",running:"Listing tasks",completed:"Listed tasks",family:"plan",group:i("task_operation","task operation","task operations")},task_get:{action:"read",running:"Reading a task",completed:"Read a task",family:"plan",group:i("task_operation","task operation","task operations")},enter_plan_mode:{action:"switch",running:"Entering plan mode",completed:"Entered plan mode",family:"plan"},exit_plan_mode:{action:"switch",running:"Leaving plan mode",completed:"Left plan mode",family:"plan"},skill:{action:"read",running:"Loading a skill",completed:"Loaded a skill"},ask_user_question:{action:"request",running:"Requesting input",completed:"Requested input",family:"question"},request_human_input:{action:"request",running:"Requesting input",completed:"Requested input",family:"question",group:i("task_operation","task operation","task operations")},agent:{action:"start",running:"Starting a subagent",completed:"Started a subagent",family:"agent"},task:{action:"start",running:"Starting a subagent",completed:"Started a subagent",family:"agent"},task_output:{action:"read",running:"Checking subagent progress",completed:"Checked subagent progress",family:"agent"},task_stop:{action:"stop",running:"Stopping a subagent",completed:"Stopped a subagent",family:"agent"},send_message:{action:"post",running:"Messaging a subagent",completed:"Messaged a subagent",family:"agent"},spawn_agent:{action:"start",running:"Starting a subagent",completed:"Started a subagent",family:"agent"},wait_agent:{action:"wait",running:"Checking subagent progress",completed:"Checked subagent progress",family:"agent"},wait_threads:{action:"wait",running:"Checking task progress",completed:"Checked task progress",family:"agent"},interrupt_agent:{action:"stop",running:"Interrupting a subagent",completed:"Interrupted a subagent",family:"agent"},report_findings:{action:"post",running:"Reporting findings",completed:"Reported findings",family:"safety"},guardian_review:{action:"think",running:"Reviewing safety",completed:"Reviewed safety",family:"safety"},lsp:{action:"read",running:"Inspecting code intelligence",completed:"Inspected code intelligence"},compact_conversation:{action:"think",running:"Compacting context",completed:"Compacted context"},image_generation:{action:"create",running:"Generating an image",completed:"Generated an image",family:"image"},view_image:{action:"read",running:"Viewing an image",completed:"Viewed an image",family:"image"},multi_tool_use_parallel:{action:"run",running:"Running tools in parallel",completed:"Ran tools in parallel"},get_task_context:{action:"read",running:"Reading task context",completed:"Read task context"},get_task_history:{action:"read",running:"Reading task history",completed:"Read task history"},list_documents:{action:"list",running:"Listing documents",completed:"Listed documents"},read_document:{action:"read",running:"Reading a document",completed:"Read a document"},list_document_revisions:{action:"list",running:"Listing document revisions",completed:"Listed document revisions"},report_progress:{action:"post",running:"Reporting progress",completed:"Reported progress"},answer_status_question:{action:"post",running:"Answering a status question",completed:"Answered a status question"},write_document:{action:"update",running:"Writing a document",completed:"Wrote a document"},register_deliverable:{action:"create",running:"Registering a deliverable",completed:"Registered a deliverable"},finish_task:{action:"finish",running:"Reporting completion",completed:"Reported completion"},wardmote_finish:{action:"finish",running:"Reporting completion",completed:"Reported completion"},block_task:{action:"block",running:"Reporting a blocker",completed:"Reported a blocker"},wardmote_block:{action:"block",running:"Reporting a blocker",completed:"Reported a blocker"},request_review:{action:"request",running:"Requesting review",completed:"Requested review"},list_agents:{action:"list",running:"Listing agents",completed:"Listed agents"},get_agent:{action:"read",running:"Reading agent details",completed:"Read agent details"},search_tasks:{action:"search",running:"Searching tasks",completed:"Searched tasks"},list_approvals:{action:"list",running:"Listing approvals",completed:"Listed approvals"},get_approval:{action:"read",running:"Reading an approval",completed:"Read an approval"},get_approval_context:{action:"read",running:"Reading approval context",completed:"Read approval context"},get_workspace_runtime:{action:"read",running:"Reading workspace status",completed:"Read workspace status"},control_workspace_service:{action:"run",running:"Controlling a workspace service",completed:"Controlled a workspace service"},set_dependencies:{action:"update",running:"Updating task dependencies",completed:"Updated task dependencies"},set_task_title:{action:"update",running:"Naming the task",completed:"Named the task"},create_task:{action:"create",running:"Creating a task",completed:"Created a task"},request_approval:{action:"request",running:"Requesting approval",completed:"Requested approval"},decide_approval:{action:"update",running:"Deciding an approval",completed:"Decided an approval"},comment_on_approval:{action:"post",running:"Commenting on an approval",completed:"Commented on an approval"},schedule_wake:{action:"create",running:"Scheduling a wake-up",completed:"Scheduled a wake-up",family:"wait"},generic_api_request:{action:"request",running:"Calling the Wardmote API",completed:"Called the Wardmote API"}},ne={read:["get","read","inspect","view"],list:["list","glob"],search:["find","search","grep","query","lookup"],fetch:["fetch","browse"],open:["open"],update:["write","edit","update","set","patch","upsert","sync"],create:["create","add","register","upload"],delete:["delete","remove"],move:["move","rename"],run:["run","execute","bash","shell","command"],request:["request","ask","prompt"],post:["send","message","comment","report","answer"],start:["start","spawn","delegate"],stop:["stop","cancel","interrupt"],wait:["wait","sleep","poll"],finish:["finish","complete"],block:["block"],think:["think","reason","compact","review"],switch:["switch","enter","exit"],other:[]},ae={read:"read",edit:"update",delete:"delete",move:"move",search:"search",list:"list",execute:"run",think:"think",fetch:"fetch",switch_mode:"switch"};function ie(e){return f(e).join("_")}a(ie,"normalizedKey");function re(e){const n=e[0];if(!n)return null;for(const[t,s]of Object.entries(ne))if(s.includes(n))return t;return null}a(re,"inferredAction");function oe(e){return e==="run"?"terminal":e==="read"||e==="list"?"read":e==="search"?"search":e==="fetch"||e==="open"?"web":["update","create","delete","move"].includes(e)?"edit":e==="request"?"question":e==="start"||e==="stop"?"agent":e==="wait"?"wait":"other"}a(oe,"actionFamily");var se={terminal:B,grep:Y,search:D,read:H,edit:F,web:K,plan:X,question:T,agent:P,safety:Z,image:G,wait:V,mcp:J,other:U};function ce(e,n){const t=n?` ${n}`:"";switch(e){case"read":return{running:`Reading${t||" data"}`,completed:`Read${t||" data"}`};case"list":return{running:`Listing${t||" items"}`,completed:`Listed${t||" items"}`};case"search":return{running:`Searching${t||""}`,completed:`Searched${t||""}`};case"fetch":return{running:`Fetching${t||" data"}`,completed:`Fetched${t||" data"}`};case"open":return{running:`Opening${t||" an item"}`,completed:`Opened${t||" an item"}`};case"update":return{running:`Updating${t||" data"}`,completed:`Updated${t||" data"}`};case"create":return{running:`Creating${t||" an item"}`,completed:`Created${t||" an item"}`};case"delete":return{running:`Deleting${t||" an item"}`,completed:`Deleted${t||" an item"}`};case"move":return{running:`Moving${t||" an item"}`,completed:`Moved${t||" an item"}`};case"run":return{running:"Running a command",completed:"Ran a command"};case"request":return{running:`Requesting${t||" input"}`,completed:`Requested${t||" input"}`};case"post":return{running:`Posting${t||" an update"}`,completed:`Posted${t||" an update"}`};case"start":return{running:`Starting${t||" an operation"}`,completed:`Started${t||" an operation"}`};case"stop":return{running:`Stopping${t||" an operation"}`,completed:`Stopped${t||" an operation"}`};case"wait":return{running:"Waiting",completed:"Finished waiting"};case"finish":return{running:"Reporting completion",completed:"Reported completion"};case"block":return{running:"Reporting a blocker",completed:"Reported a blocker"};case"think":return{running:"Thinking",completed:"Finished thinking"};case"switch":return{running:`Switching${t||" mode"}`,completed:`Switched${t||" mode"}`};case"other":return{running:"Running",completed:"Ran"}}}a(ce,"actionCopy");function pe(e){switch(e){case"run":return i("command","command","commands");case"read":case"list":return i("read","read","reads");case"search":return i("search","search","searches");case"update":case"create":case"delete":case"move":return i("file_change","file change","file changes");case"start":case"stop":return i("delegation","delegation","delegations");case"wait":return i("wait","wait","waits");default:return i("tool_action","tool action","tool actions")}}a(pe,"defaultSummaryGroup");function de(e){return e==="read"||e==="list"?i("wardmote_read","Wardmote read","Wardmote reads"):i("task_operation","task operation","task operations")}a(de,"wardmoteSummaryGroup");function le(e){const n=(e.name??"").trim(),t=L(n),s=(e.namespace??t?.namespace??"").trim(),k=(t?"mcp":e.transport??"builtin").toLowerCase(),o=(t?.name??n).trim(),u=f(o),S=ie(o),r=te[S],_=ae[(e.operation??"").trim().toLowerCase()],m=re(u),c=r?.action??_??m??"other",q=r?"exact":_?"kind":m?"inferred":l(o)?"unnamed":"fallback",g=l(o)?"Unnamed tool":b(o),x=/^[A-Za-z][A-Za-z0-9_.:-]*$/.test(o),w=m&&x&&u.length>1?u.slice(1):[],A=w.length?$(w).replace(/^./,z=>z.toLowerCase()):void 0,p=r?.running&&r.completed?{running:r.running,completed:r.completed}:c==="other"?l(o)?{running:"Running an unnamed tool",completed:"Ran an unnamed tool"}:{running:`Running ${g}`,completed:`Ran ${g}`}:ce(c,r?void 0:A),M=r?.family??oe(c),v=k==="mcp"?"mcp":M,I=s?b(s):k==="mcp"?"MCP":void 0,N=s.toLowerCase()==="wardmote"?de(c):r?.group??pe(c);return{icon:se[v],family:v,runningLabel:p.running,completedLabel:p.completed,failedLabel:`${p.completed} · failed`,interruptedLabel:`${p.running} · stopped`,displayName:g,sourceLabel:I,technicalName:n||void 0,confidence:q,summaryGroup:N}}a(le,"toolActivityPresentation");function Ce(e){const n=le({name:e});return{family:n.family,icon:n.icon,verbLabel:n.runningLabel}}a(Ce,"toolTaxonomy");function Le(e){const n=(e??"").trim().toLowerCase();return n==="thinking"?O:n==="responding"||n.startsWith("responding (")?Q:null}a(Le,"statusLabelIcon");export{le as a,Le as i,l as n,Ce as o,L as r,b as t};
1
+ var E=Object.defineProperty;var a=(e,n)=>E(e,"name",{value:n,configurable:!0});import{i as j}from"./rolldown-runtime-ZpX3ckPj.js";import{t as h,ta as W}from"./createLucideIcon-DJi9suAC.js";import{G as U,_t as O}from"./router-2UfGeejU.js";import{t as T}from"./circle-question-mark-B1jR2is9.js";import{t as F}from"./file-pen-line-DX6PZQXR.js";import{a as G}from"./RichWorkProductCard-ClpMt_Bh.js";import{t as P}from"./network-RCsafDTP.js";import{t as D}from"./search-04O7m-IF.js";import{t as Z}from"./shield-check-B0HVjzM_.js";import{t as B}from"./terminal-C0CKe_Zz.js";import{Ba as V,Ga as H,Ma as X}from"./index-3AxqhPET.js";var y={name:"chevrons-left-right-ellipsis",size:24,node:[["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"m17 7 5 5-5 5",key:"1xlxn0"}],["path",{d:"m7 7-5 5 5 5",key:"19njba"}],["path",{d:"M8 12h.01",key:"czm47f"}]]};y.node;var K=h(y),R={name:"message-square-reply",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"m10 8-3 3 3 3",key:"fp6dz7"}],["path",{d:"M17 14v-1a2 2 0 0 0-2-2H7",key:"1tkjnz"}]]};R.node;var Q=h(R),C={name:"search-code",size:24,node:[["path",{d:"m13 13.5 2-2.5-2-2.5",key:"1rvxrh"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}],["path",{d:"M9 8.5 7 11l2 2.5",key:"6ffwbx"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};C.node;var Y=h(C),d=j(W(),1);function J(e){return(0,d.jsxs)("svg",{viewBox:"0 0 180 180",fill:"none",stroke:"currentColor",strokeWidth:14,strokeLinecap:"round",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,d.jsx)("path",{d:"M18 84.8528L85.8822 16.9706C95.2548 7.59798 110.451 7.59798 119.823 16.9706C129.196 26.3431 129.196 41.5391 119.823 50.9117L68.5581 102.177"}),(0,d.jsx)("path",{d:"M69.2652 101.47L119.823 50.9117C129.196 41.5391 144.392 41.5391 153.765 50.9117L154.118 51.2652C163.491 60.6378 163.491 75.8338 154.118 85.2063L92.7248 146.6C89.6006 149.724 89.6006 154.789 92.7248 157.913L105.331 170.52"}),(0,d.jsx)("path",{d:"M102.853 33.9411L52.6482 84.1457C43.2756 93.5183 43.2756 108.714 52.6482 118.087C62.0208 127.459 77.2167 127.459 86.5893 118.087L136.794 67.8822"})]})}a(J,"McpIcon");var ee=new Set(["tool","tool call","tool_call","acp_tool"]);function l(e){const n=(e??"").trim().toLowerCase().replace(/\s*\((?:pending|in[_ -]?progress|completed|failed|cancelled|canceled)\)$/,"");return!n||ee.has(n)}a(l,"isGenericToolName");function L(e){const n=e.match(/^mcp__(.+?)__(.+)$/i);if(n)return{namespace:n[1],name:n[2]};const t=e.match(/^mcp\.([^.]+)\.(.+)$/i);return t?{namespace:t[1],name:t[2]}:null}a(L,"mcpToolIdentity");function f(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/[^A-Za-z0-9]+/g," ").trim().toLowerCase().split(/\s+/).filter(Boolean)}a(f,"identifierWords");function $(e){if(e.length===0)return"";const n=e.map(t=>["api","id","lsp","mcp","pr","url"].includes(t)?t.toUpperCase():t).join(" ");return n.charAt(0).toUpperCase()+n.slice(1)}a($,"sentenceCase");function b(e){const n=(e??"").trim();return l(n)?"Unnamed tool":$(f(L(n)?.name??n))}a(b,"humanizeToolName");var i=a((e,n,t)=>({key:e,singular:n,plural:t}),"group"),te={bash:{action:"run"},terminal:{action:"run"},shell:{action:"run"},command:{action:"run"},run:{action:"run"},execute:{action:"run"},exec_command:{action:"run"},apply_patch:{action:"update",running:"Applying a patch",completed:"Applied a patch"},read:{action:"read",running:"Reading a file",completed:"Read a file"},write:{action:"update",running:"Writing a file",completed:"Wrote a file"},edit:{action:"update",running:"Editing a file",completed:"Edited a file"},notebook_read:{action:"read",running:"Reading a notebook",completed:"Read a notebook"},notebook_edit:{action:"update",running:"Editing a notebook",completed:"Edited a notebook"},glob:{action:"search",running:"Searching files",completed:"Searched files"},grep:{action:"search",running:"Searching file contents",completed:"Searched file contents",family:"grep"},tool_search:{action:"search",running:"Searching available tools",completed:"Searched available tools",group:i("tool_search","tool search","tool searches")},web_search:{action:"search",running:"Searching the web",completed:"Searched the web",family:"web"},web_fetch:{action:"fetch",running:"Fetching a web page",completed:"Fetched a web page",family:"web"},todo_write:{action:"update",running:"Updating the task list",completed:"Updated the task list",family:"plan",group:i("task_operation","task operation","task operations")},task_create:{action:"create",running:"Creating a task",completed:"Created a task",family:"plan",group:i("task_operation","task operation","task operations")},task_update:{action:"update",running:"Updating a task",completed:"Updated a task",family:"plan",group:i("task_operation","task operation","task operations")},task_list:{action:"list",running:"Listing tasks",completed:"Listed tasks",family:"plan",group:i("task_operation","task operation","task operations")},task_get:{action:"read",running:"Reading a task",completed:"Read a task",family:"plan",group:i("task_operation","task operation","task operations")},enter_plan_mode:{action:"switch",running:"Entering plan mode",completed:"Entered plan mode",family:"plan"},exit_plan_mode:{action:"switch",running:"Leaving plan mode",completed:"Left plan mode",family:"plan"},skill:{action:"read",running:"Loading a skill",completed:"Loaded a skill"},ask_user_question:{action:"request",running:"Requesting input",completed:"Requested input",family:"question"},request_human_input:{action:"request",running:"Requesting input",completed:"Requested input",family:"question",group:i("task_operation","task operation","task operations")},agent:{action:"start",running:"Starting a subagent",completed:"Started a subagent",family:"agent"},task:{action:"start",running:"Starting a subagent",completed:"Started a subagent",family:"agent"},task_output:{action:"read",running:"Checking subagent progress",completed:"Checked subagent progress",family:"agent"},task_stop:{action:"stop",running:"Stopping a subagent",completed:"Stopped a subagent",family:"agent"},send_message:{action:"post",running:"Messaging a subagent",completed:"Messaged a subagent",family:"agent"},spawn_agent:{action:"start",running:"Starting a subagent",completed:"Started a subagent",family:"agent"},wait_agent:{action:"wait",running:"Checking subagent progress",completed:"Checked subagent progress",family:"agent"},wait_threads:{action:"wait",running:"Checking task progress",completed:"Checked task progress",family:"agent"},interrupt_agent:{action:"stop",running:"Interrupting a subagent",completed:"Interrupted a subagent",family:"agent"},report_findings:{action:"post",running:"Reporting findings",completed:"Reported findings",family:"safety"},guardian_review:{action:"think",running:"Reviewing safety",completed:"Reviewed safety",family:"safety"},lsp:{action:"read",running:"Inspecting code intelligence",completed:"Inspected code intelligence"},compact_conversation:{action:"think",running:"Compacting context",completed:"Compacted context"},image_generation:{action:"create",running:"Generating an image",completed:"Generated an image",family:"image"},view_image:{action:"read",running:"Viewing an image",completed:"Viewed an image",family:"image"},multi_tool_use_parallel:{action:"run",running:"Running tools in parallel",completed:"Ran tools in parallel"},get_task_context:{action:"read",running:"Reading task context",completed:"Read task context"},get_task_history:{action:"read",running:"Reading task history",completed:"Read task history"},list_documents:{action:"list",running:"Listing documents",completed:"Listed documents"},read_document:{action:"read",running:"Reading a document",completed:"Read a document"},list_document_revisions:{action:"list",running:"Listing document revisions",completed:"Listed document revisions"},report_progress:{action:"post",running:"Reporting progress",completed:"Reported progress"},answer_status_question:{action:"post",running:"Answering a status question",completed:"Answered a status question"},write_document:{action:"update",running:"Writing a document",completed:"Wrote a document"},register_deliverable:{action:"create",running:"Registering a deliverable",completed:"Registered a deliverable"},finish_task:{action:"finish",running:"Reporting completion",completed:"Reported completion"},wardmote_finish:{action:"finish",running:"Reporting completion",completed:"Reported completion"},block_task:{action:"block",running:"Reporting a blocker",completed:"Reported a blocker"},wardmote_block:{action:"block",running:"Reporting a blocker",completed:"Reported a blocker"},request_review:{action:"request",running:"Requesting review",completed:"Requested review"},list_agents:{action:"list",running:"Listing agents",completed:"Listed agents"},get_agent:{action:"read",running:"Reading agent details",completed:"Read agent details"},search_tasks:{action:"search",running:"Searching tasks",completed:"Searched tasks"},list_approvals:{action:"list",running:"Listing approvals",completed:"Listed approvals"},get_approval:{action:"read",running:"Reading an approval",completed:"Read an approval"},get_approval_context:{action:"read",running:"Reading approval context",completed:"Read approval context"},get_workspace_runtime:{action:"read",running:"Reading workspace status",completed:"Read workspace status"},control_workspace_service:{action:"run",running:"Controlling a workspace service",completed:"Controlled a workspace service"},set_dependencies:{action:"update",running:"Updating task dependencies",completed:"Updated task dependencies"},set_task_title:{action:"update",running:"Naming the task",completed:"Named the task"},create_task:{action:"create",running:"Creating a task",completed:"Created a task"},request_approval:{action:"request",running:"Requesting approval",completed:"Requested approval"},decide_approval:{action:"update",running:"Deciding an approval",completed:"Decided an approval"},comment_on_approval:{action:"post",running:"Commenting on an approval",completed:"Commented on an approval"},schedule_wake:{action:"create",running:"Scheduling a wake-up",completed:"Scheduled a wake-up",family:"wait"},generic_api_request:{action:"request",running:"Calling the Wardmote API",completed:"Called the Wardmote API"}},ne={read:["get","read","inspect","view"],list:["list","glob"],search:["find","search","grep","query","lookup"],fetch:["fetch","browse"],open:["open"],update:["write","edit","update","set","patch","upsert","sync"],create:["create","add","register","upload"],delete:["delete","remove"],move:["move","rename"],run:["run","execute","bash","shell","command"],request:["request","ask","prompt"],post:["send","message","comment","report","answer"],start:["start","spawn","delegate"],stop:["stop","cancel","interrupt"],wait:["wait","sleep","poll"],finish:["finish","complete"],block:["block"],think:["think","reason","compact","review"],switch:["switch","enter","exit"],other:[]},ae={read:"read",edit:"update",delete:"delete",move:"move",search:"search",list:"list",execute:"run",think:"think",fetch:"fetch",switch_mode:"switch"};function ie(e){return f(e).join("_")}a(ie,"normalizedKey");function re(e){const n=e[0];if(!n)return null;for(const[t,s]of Object.entries(ne))if(s.includes(n))return t;return null}a(re,"inferredAction");function oe(e){return e==="run"?"terminal":e==="read"||e==="list"?"read":e==="search"?"search":e==="fetch"||e==="open"?"web":["update","create","delete","move"].includes(e)?"edit":e==="request"?"question":e==="start"||e==="stop"?"agent":e==="wait"?"wait":"other"}a(oe,"actionFamily");var se={terminal:B,grep:Y,search:D,read:H,edit:F,web:K,plan:X,question:T,agent:P,safety:Z,image:G,wait:V,mcp:J,other:U};function ce(e,n){const t=n?` ${n}`:"";switch(e){case"read":return{running:`Reading${t||" data"}`,completed:`Read${t||" data"}`};case"list":return{running:`Listing${t||" items"}`,completed:`Listed${t||" items"}`};case"search":return{running:`Searching${t||""}`,completed:`Searched${t||""}`};case"fetch":return{running:`Fetching${t||" data"}`,completed:`Fetched${t||" data"}`};case"open":return{running:`Opening${t||" an item"}`,completed:`Opened${t||" an item"}`};case"update":return{running:`Updating${t||" data"}`,completed:`Updated${t||" data"}`};case"create":return{running:`Creating${t||" an item"}`,completed:`Created${t||" an item"}`};case"delete":return{running:`Deleting${t||" an item"}`,completed:`Deleted${t||" an item"}`};case"move":return{running:`Moving${t||" an item"}`,completed:`Moved${t||" an item"}`};case"run":return{running:"Running a command",completed:"Ran a command"};case"request":return{running:`Requesting${t||" input"}`,completed:`Requested${t||" input"}`};case"post":return{running:`Posting${t||" an update"}`,completed:`Posted${t||" an update"}`};case"start":return{running:`Starting${t||" an operation"}`,completed:`Started${t||" an operation"}`};case"stop":return{running:`Stopping${t||" an operation"}`,completed:`Stopped${t||" an operation"}`};case"wait":return{running:"Waiting",completed:"Finished waiting"};case"finish":return{running:"Reporting completion",completed:"Reported completion"};case"block":return{running:"Reporting a blocker",completed:"Reported a blocker"};case"think":return{running:"Thinking",completed:"Finished thinking"};case"switch":return{running:`Switching${t||" mode"}`,completed:`Switched${t||" mode"}`};case"other":return{running:"Running",completed:"Ran"}}}a(ce,"actionCopy");function pe(e){switch(e){case"run":return i("command","command","commands");case"read":case"list":return i("read","read","reads");case"search":return i("search","search","searches");case"update":case"create":case"delete":case"move":return i("file_change","file change","file changes");case"start":case"stop":return i("delegation","delegation","delegations");case"wait":return i("wait","wait","waits");default:return i("tool_action","tool action","tool actions")}}a(pe,"defaultSummaryGroup");function de(e){return e==="read"||e==="list"?i("wardmote_read","Wardmote read","Wardmote reads"):i("task_operation","task operation","task operations")}a(de,"wardmoteSummaryGroup");function le(e){const n=(e.name??"").trim(),t=L(n),s=(e.namespace??t?.namespace??"").trim(),k=(t?"mcp":e.transport??"builtin").toLowerCase(),o=(t?.name??n).trim(),u=f(o),S=ie(o),r=te[S],_=ae[(e.operation??"").trim().toLowerCase()],m=re(u),c=r?.action??_??m??"other",q=r?"exact":_?"kind":m?"inferred":l(o)?"unnamed":"fallback",g=l(o)?"Unnamed tool":b(o),x=/^[A-Za-z][A-Za-z0-9_.:-]*$/.test(o),w=m&&x&&u.length>1?u.slice(1):[],A=w.length?$(w).replace(/^./,z=>z.toLowerCase()):void 0,p=r?.running&&r.completed?{running:r.running,completed:r.completed}:c==="other"?l(o)?{running:"Running an unnamed tool",completed:"Ran an unnamed tool"}:{running:`Running ${g}`,completed:`Ran ${g}`}:ce(c,r?void 0:A),M=r?.family??oe(c),v=k==="mcp"?"mcp":M,I=s?b(s):k==="mcp"?"MCP":void 0,N=s.toLowerCase()==="wardmote"?de(c):r?.group??pe(c);return{icon:se[v],family:v,runningLabel:p.running,completedLabel:p.completed,failedLabel:`${p.completed} · failed`,interruptedLabel:`${p.running} · stopped`,displayName:g,sourceLabel:I,technicalName:n||void 0,confidence:q,summaryGroup:N}}a(le,"toolActivityPresentation");function Ce(e){const n=le({name:e});return{family:n.family,icon:n.icon,verbLabel:n.runningLabel}}a(Ce,"toolTaxonomy");function Le(e){const n=(e??"").trim().toLowerCase();return n==="thinking"?O:n==="responding"||n.startsWith("responding (")?Q:null}a(Le,"statusLabelIcon");export{le as a,Le as i,l as n,Ce as o,L as r,b as t};