@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 +1 @@
1
- var E=Object.defineProperty;var n=(e,t)=>E(e,"name",{value:t,configurable:!0});import{i as N}from"./rolldown-runtime-ZpX3ckPj.js";import{Gi as $,l as G,na as P,ta as L}from"./createLucideIcon-DJi9suAC.js";import{X as M,_ as O,t as q,v as B}from"./queryKeys-DYV5MhM_.js";import{G as R}from"./router-2UfGeejU.js";import{t as K}from"./activity-CB9AQzZO.js";import{t as U}from"./boxes-fV98p9-r.js";import{t as H}from"./copy-_wvZOjTe.js";import{t as Q}from"./key-round-0RqEOB_C.js";import{t as v}from"./button-CMwV3L1P.js";import{i as A}from"./ToastContext-DMdt9oTd.js";import{a as F,i as W,n as z,r as Y,s as J,t as V}from"./dialog-CKUblzlR.js";import{t as X}from"./input-DobnTAyB.js";import{t as j}from"./tools-B-L_sU_9.js";import{t as Z}from"./clipboard-CTLKYvRL.js";import{Na as ee,qa as C}from"./index-DDoARkPG.js";var te=[{key:"overview",label:"Overview",icon:ee},{key:"apps",label:"Apps & tools",icon:U},{key:"tokens",label:"Tokens",icon:Q},{key:"activity",label:"Activity",icon:K},{key:"advanced",label:"Advanced",icon:R}];function ke(e,t){return`/apps/gateways/${e}/${t}`}n(ke,"gatewayTabHref");function Te(e){return te.some(t=>t.key===e)}n(Te,"isGatewayTabKey");var b=N(P(),1);function I(e){if(!e)return null;const t=e instanceof Date?e:new Date(e);return Number.isNaN(t.getTime())?null:t}n(I,"toDate");function ve(e){return`${e.tokenPrefix}•••`}n(ve,"maskedTokenLabel");function D(e,t=Date.now()){if(e.revokedAt)return"revoked";const o=I(e.expiresAt);if(!o)return"active";const s=o.getTime()-t;return s<=0?"expired":s<=12096e5?"expiring":"active"}n(D,"tokenStatus");var je={active:"Active",expiring:"Expiring",expired:"Expired",revoked:"Revoked"};function Ce(e,t=Date.now()){return e.tokens.filter(o=>{const s=D(o,t);return s==="active"||s==="expiring"}).length}n(Ce,"activeTokenCount");function Se(e,t=Date.now()){return e.tokens.filter(o=>D(o,t)==="expiring").length}n(Se,"expiringTokenCount");function Ne(e){return e.tokens.reduce((t,o)=>{const s=I(o.lastUsedAt);return s&&(!t||s.getTime()>t.getTime())?s:t},null)}n(Ne,"latestTokenActivity");function g(e){return e?e.length>12?`${e.slice(0,8)}…`:e:null}n(g,"shortId");function Ae(e,t,o){return e.contextScopeType!=="none"&&e.contextScopeId?e.contextScopeType==="project"?`Project · ${t.get(e.contextScopeId)??g(e.contextScopeId)}`:e.contextScopeType==="agent"?`Agent · ${o.get(e.contextScopeId)??g(e.contextScopeId)}`:`${e.contextScopeType} · ${g(e.contextScopeId)}`:e.projectId?`Project · ${t.get(e.projectId)??g(e.projectId)}`:e.agentId?`Agent · ${o.get(e.agentId)??g(e.agentId)}`:"Organization"}n(Ae,"formatScope");function Ie(e){return e.status==="active"}n(Ie,"isGatewayOn");function ne(e){if(!e)return"Profile unavailable";const{accessMode:t,allowedToolCount:o,totalToolCount:s,excludedToolCount:p}=e.summary,l=t==="all_except"?Math.max(s-p,0):o;return l===0?"No tools allowed":`${l} ${l===1?"tool":"tools"}`}n(ne,"allowedToolsLabel");function De(e,t,o){if(!e)return[];const s=new Map(t.map(i=>[i.id,i])),p=new Map(o.map(i=>[i.id,i])),l=new Map;for(const i of o)l.set(i.applicationId,[...l.get(i.applicationId)??[],i]);const u=new Map,x=new Set;for(const i of e.entries??[]){if(i.effect!=="include")continue;let c=i.applicationId??null;!c&&i.connectionId&&(c=p.get(i.connectionId)?.applicationId??null),c&&(x.add(c),(i.catalogEntryId||i.toolName)&&u.set(c,(u.get(c)??0)+1))}const y=[];for(const i of x){const c=s.get(i);if(!c||c.status==="archived")continue;const m=l.get(i)??[],h=m.find(f=>f.status!=="archived")??m[0]??null,d=m.find(f=>$(f.healthStatus));y.push({application:c,connection:h,toolCount:u.get(i)??0,needsAttention:!!d,attentionReason:d?"Sign-in expired — reconnect to restore access.":null})}return y.sort((i,c)=>i.application.name.localeCompare(c.application.name))}n(De,"deriveGatewayApps");function _e(e){return e.connection?C(e.connection):C(e.application.name)}n(_e,"gatewayAppDisplayName");var S=["cursor","claude_desktop","vscode","claude_code","opencode"];function Ee(e){return[...e].sort((t,o)=>S.indexOf(t.client)-S.indexOf(o.client))}n(Ee,"orderedSnippets");function $e(e,t=new Date){const o=t.toISOString().slice(0,16).replace(/[-:T]/g,"");return`${e.displaySlug}-${o}`}n($e,"defaultGatewayTokenName");function k(e,t){return typeof e=="string"?e.split(t.endpointPath).join(t.endpoint).replaceAll("pcgw_...",t.token):Array.isArray(e)?e.map(o=>k(o,t)):e&&typeof e=="object"?Object.fromEntries(Object.entries(e).map(([o,s])=>[o,k(s,t)])):e}n(k,"replaceSnippetConfigValue");function Ge(e,t){return JSON.stringify(k(e,t),null,2)}n(Ge,"formatHydratedSnippetConfig");var a=N(L(),1),oe=n(e=>["tools","gateways",e],"gatewaysQueryKey");function Pe({companyId:e,open:t,onOpenChange:o,onCreated:s}){const p=M(),{pushToast:l}=A(),[u,x]=(0,b.useState)(""),[y,i]=(0,b.useState)(""),[c,m]=(0,b.useState)(""),h=B({queryKey:q.tools.profiles(e),queryFn:n(()=>j.listProfiles(e),"queryFn"),enabled:t}),d=(h.data?.profiles??[]).filter(r=>r.status!=="archived");(0,b.useEffect)(()=>{t&&!c&&d[0]&&m(d[0].id)},[t,c,d]);const f=O({mutationFn:n(()=>j.createGateway(e,{name:u.trim(),description:y.trim()||null,profileId:c,defaultProfileMode:"gateway_only",contextScopeType:"company"}),"mutationFn"),onSuccess:n(async r=>{l({title:"Gateway created",body:r.name,tone:"success"}),await p.invalidateQueries({queryKey:oe(e)}),x(""),i(""),o(!1),s?.(r.id)},"onSuccess"),onError:n(r=>{l({title:"Gateway was not created",body:r instanceof Error?r.message:String(r),tone:"error"})},"onError")});function _(r){r.preventDefault(),!(!u.trim()||!c)&&f.mutate()}n(_,"submit");const T=h.isLoading,w=!T&&d.length===0;return(0,a.jsx)(V,{open:t,onOpenChange:o,children:(0,a.jsxs)(z,{className:"sm:max-w-lg",children:[(0,a.jsxs)(F,{children:[(0,a.jsx)(J,{children:"New gateway"}),(0,a.jsx)(Y,{children:"One safe MCP endpoint that exposes only the apps in its access profile. Hand it to a client like Cursor or Claude Desktop."})]}),(0,a.jsxs)("form",{className:"space-y-4",onSubmit:_,children:[(0,a.jsxs)("label",{className:"block space-y-1.5",children:[(0,a.jsx)("span",{className:"text-xs font-medium text-ink-3",children:"Name"}),(0,a.jsx)(X,{value:u,onChange:n(r=>x(r.target.value),"onChange"),placeholder:"CTO agents",required:!0,autoFocus:!0})]}),(0,a.jsxs)("label",{className:"block space-y-1.5",children:[(0,a.jsx)("span",{className:"text-xs font-medium text-ink-3",children:"Access profile"}),(0,a.jsxs)("select",{className:"w-full rounded-md border border-line-strong bg-bg px-3 py-2 text-sm",value:c,onChange:n(r=>m(r.target.value),"onChange"),required:!0,disabled:w,children:[(0,a.jsx)("option",{value:"",disabled:!0,children:T?"Loading profiles…":"Choose a profile"}),d.map(r=>(0,a.jsxs)("option",{value:r.id,children:[r.name," — ",ne(r)]},r.id))]}),(0,a.jsx)("span",{className:"text-xs text-ink-3",children:"The profile decides which tools this gateway allows. You can change it later."})]}),(0,a.jsxs)("label",{className:"block space-y-1.5",children:[(0,a.jsx)("span",{className:"text-xs font-medium text-ink-3",children:"Description (optional)"}),(0,a.jsx)("textarea",{className:"min-h-16 w-full rounded-md border border-line-strong bg-bg px-3 py-2 text-sm",value:y,onChange:n(r=>i(r.target.value),"onChange"),placeholder:"Who this endpoint is for and when it should be rotated."})]}),w?(0,a.jsx)("p",{className:"text-xs text-bad",children:"Create an access profile under Advanced before adding a gateway."}):null,(0,a.jsxs)(W,{children:[(0,a.jsx)(v,{type:"button",variant:"ghost",onClick:n(()=>o(!1),"onClick"),children:"Cancel"}),(0,a.jsx)(v,{type:"submit",disabled:f.isPending||w||!u.trim()||!c,children:f.isPending?"Creating…":"Create gateway"})]})]})]})})}n(Pe,"NewGatewayDialog");function ie(e){if(typeof window>"u")return e;try{return new URL(e,window.location.origin).toString()}catch{return e}}n(ie,"gatewayEndpointUrl");function Le({endpointPath:e,className:t}){const{pushToast:o}=A(),s=ie(e);async function p(){try{await Z(s),o({title:"Gateway URL copied",tone:"success"})}catch{o({title:"Copy failed",body:"Clipboard access is unavailable.",tone:"error"})}}return n(p,"copy"),(0,a.jsxs)("button",{type:"button",onClick:n(l=>{l.stopPropagation(),p()},"onClick"),className:G("flex min-w-0 max-w-full items-center gap-1 text-left font-mono text-xs text-ink-3 hover:text-ink",t),title:`${s} — click to copy`,"aria-label":"Copy gateway URL",children:[(0,a.jsx)("span",{className:"min-w-0 truncate",children:s}),(0,a.jsx)(H,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":"true"})]})}n(Le,"CopyableGatewayUrl");export{I as _,Ce as a,ke as b,De as c,Ae as d,_e as f,Ee as g,ve as h,je as i,Se as l,Ne as m,Pe as n,ne as o,Ie as p,oe as r,$e as s,Le as t,Ge as u,D as v,Te as x,te as y};
1
+ var E=Object.defineProperty;var n=(e,t)=>E(e,"name",{value:t,configurable:!0});import{i as N}from"./rolldown-runtime-ZpX3ckPj.js";import{Gi as $,l as G,na as P,ta as L}from"./createLucideIcon-DJi9suAC.js";import{X as M,_ as O,t as q,v as B}from"./queryKeys-DYV5MhM_.js";import{G as R}from"./router-2UfGeejU.js";import{t as K}from"./activity-CB9AQzZO.js";import{t as U}from"./boxes-fV98p9-r.js";import{t as H}from"./copy-_wvZOjTe.js";import{t as Q}from"./key-round-0RqEOB_C.js";import{t as v}from"./button-CMwV3L1P.js";import{i as A}from"./ToastContext-DMdt9oTd.js";import{a as F,i as W,n as z,r as Y,s as J,t as V}from"./dialog-CKUblzlR.js";import{t as X}from"./input-DobnTAyB.js";import{t as j}from"./tools-B-L_sU_9.js";import{t as Z}from"./clipboard-CTLKYvRL.js";import{Na as ee,qa as C}from"./index-3AxqhPET.js";var te=[{key:"overview",label:"Overview",icon:ee},{key:"apps",label:"Apps & tools",icon:U},{key:"tokens",label:"Tokens",icon:Q},{key:"activity",label:"Activity",icon:K},{key:"advanced",label:"Advanced",icon:R}];function ke(e,t){return`/apps/gateways/${e}/${t}`}n(ke,"gatewayTabHref");function Te(e){return te.some(t=>t.key===e)}n(Te,"isGatewayTabKey");var b=N(P(),1);function I(e){if(!e)return null;const t=e instanceof Date?e:new Date(e);return Number.isNaN(t.getTime())?null:t}n(I,"toDate");function ve(e){return`${e.tokenPrefix}•••`}n(ve,"maskedTokenLabel");function D(e,t=Date.now()){if(e.revokedAt)return"revoked";const o=I(e.expiresAt);if(!o)return"active";const s=o.getTime()-t;return s<=0?"expired":s<=12096e5?"expiring":"active"}n(D,"tokenStatus");var je={active:"Active",expiring:"Expiring",expired:"Expired",revoked:"Revoked"};function Ce(e,t=Date.now()){return e.tokens.filter(o=>{const s=D(o,t);return s==="active"||s==="expiring"}).length}n(Ce,"activeTokenCount");function Se(e,t=Date.now()){return e.tokens.filter(o=>D(o,t)==="expiring").length}n(Se,"expiringTokenCount");function Ne(e){return e.tokens.reduce((t,o)=>{const s=I(o.lastUsedAt);return s&&(!t||s.getTime()>t.getTime())?s:t},null)}n(Ne,"latestTokenActivity");function g(e){return e?e.length>12?`${e.slice(0,8)}…`:e:null}n(g,"shortId");function Ae(e,t,o){return e.contextScopeType!=="none"&&e.contextScopeId?e.contextScopeType==="project"?`Project · ${t.get(e.contextScopeId)??g(e.contextScopeId)}`:e.contextScopeType==="agent"?`Agent · ${o.get(e.contextScopeId)??g(e.contextScopeId)}`:`${e.contextScopeType} · ${g(e.contextScopeId)}`:e.projectId?`Project · ${t.get(e.projectId)??g(e.projectId)}`:e.agentId?`Agent · ${o.get(e.agentId)??g(e.agentId)}`:"Organization"}n(Ae,"formatScope");function Ie(e){return e.status==="active"}n(Ie,"isGatewayOn");function ne(e){if(!e)return"Profile unavailable";const{accessMode:t,allowedToolCount:o,totalToolCount:s,excludedToolCount:p}=e.summary,l=t==="all_except"?Math.max(s-p,0):o;return l===0?"No tools allowed":`${l} ${l===1?"tool":"tools"}`}n(ne,"allowedToolsLabel");function De(e,t,o){if(!e)return[];const s=new Map(t.map(i=>[i.id,i])),p=new Map(o.map(i=>[i.id,i])),l=new Map;for(const i of o)l.set(i.applicationId,[...l.get(i.applicationId)??[],i]);const u=new Map,x=new Set;for(const i of e.entries??[]){if(i.effect!=="include")continue;let c=i.applicationId??null;!c&&i.connectionId&&(c=p.get(i.connectionId)?.applicationId??null),c&&(x.add(c),(i.catalogEntryId||i.toolName)&&u.set(c,(u.get(c)??0)+1))}const y=[];for(const i of x){const c=s.get(i);if(!c||c.status==="archived")continue;const m=l.get(i)??[],h=m.find(f=>f.status!=="archived")??m[0]??null,d=m.find(f=>$(f.healthStatus));y.push({application:c,connection:h,toolCount:u.get(i)??0,needsAttention:!!d,attentionReason:d?"Sign-in expired — reconnect to restore access.":null})}return y.sort((i,c)=>i.application.name.localeCompare(c.application.name))}n(De,"deriveGatewayApps");function _e(e){return e.connection?C(e.connection):C(e.application.name)}n(_e,"gatewayAppDisplayName");var S=["cursor","claude_desktop","vscode","claude_code","opencode"];function Ee(e){return[...e].sort((t,o)=>S.indexOf(t.client)-S.indexOf(o.client))}n(Ee,"orderedSnippets");function $e(e,t=new Date){const o=t.toISOString().slice(0,16).replace(/[-:T]/g,"");return`${e.displaySlug}-${o}`}n($e,"defaultGatewayTokenName");function k(e,t){return typeof e=="string"?e.split(t.endpointPath).join(t.endpoint).replaceAll("pcgw_...",t.token):Array.isArray(e)?e.map(o=>k(o,t)):e&&typeof e=="object"?Object.fromEntries(Object.entries(e).map(([o,s])=>[o,k(s,t)])):e}n(k,"replaceSnippetConfigValue");function Ge(e,t){return JSON.stringify(k(e,t),null,2)}n(Ge,"formatHydratedSnippetConfig");var a=N(L(),1),oe=n(e=>["tools","gateways",e],"gatewaysQueryKey");function Pe({companyId:e,open:t,onOpenChange:o,onCreated:s}){const p=M(),{pushToast:l}=A(),[u,x]=(0,b.useState)(""),[y,i]=(0,b.useState)(""),[c,m]=(0,b.useState)(""),h=B({queryKey:q.tools.profiles(e),queryFn:n(()=>j.listProfiles(e),"queryFn"),enabled:t}),d=(h.data?.profiles??[]).filter(r=>r.status!=="archived");(0,b.useEffect)(()=>{t&&!c&&d[0]&&m(d[0].id)},[t,c,d]);const f=O({mutationFn:n(()=>j.createGateway(e,{name:u.trim(),description:y.trim()||null,profileId:c,defaultProfileMode:"gateway_only",contextScopeType:"company"}),"mutationFn"),onSuccess:n(async r=>{l({title:"Gateway created",body:r.name,tone:"success"}),await p.invalidateQueries({queryKey:oe(e)}),x(""),i(""),o(!1),s?.(r.id)},"onSuccess"),onError:n(r=>{l({title:"Gateway was not created",body:r instanceof Error?r.message:String(r),tone:"error"})},"onError")});function _(r){r.preventDefault(),!(!u.trim()||!c)&&f.mutate()}n(_,"submit");const T=h.isLoading,w=!T&&d.length===0;return(0,a.jsx)(V,{open:t,onOpenChange:o,children:(0,a.jsxs)(z,{className:"sm:max-w-lg",children:[(0,a.jsxs)(F,{children:[(0,a.jsx)(J,{children:"New gateway"}),(0,a.jsx)(Y,{children:"One safe MCP endpoint that exposes only the apps in its access profile. Hand it to a client like Cursor or Claude Desktop."})]}),(0,a.jsxs)("form",{className:"space-y-4",onSubmit:_,children:[(0,a.jsxs)("label",{className:"block space-y-1.5",children:[(0,a.jsx)("span",{className:"text-xs font-medium text-ink-3",children:"Name"}),(0,a.jsx)(X,{value:u,onChange:n(r=>x(r.target.value),"onChange"),placeholder:"CTO agents",required:!0,autoFocus:!0})]}),(0,a.jsxs)("label",{className:"block space-y-1.5",children:[(0,a.jsx)("span",{className:"text-xs font-medium text-ink-3",children:"Access profile"}),(0,a.jsxs)("select",{className:"w-full rounded-md border border-line-strong bg-bg px-3 py-2 text-sm",value:c,onChange:n(r=>m(r.target.value),"onChange"),required:!0,disabled:w,children:[(0,a.jsx)("option",{value:"",disabled:!0,children:T?"Loading profiles…":"Choose a profile"}),d.map(r=>(0,a.jsxs)("option",{value:r.id,children:[r.name," — ",ne(r)]},r.id))]}),(0,a.jsx)("span",{className:"text-xs text-ink-3",children:"The profile decides which tools this gateway allows. You can change it later."})]}),(0,a.jsxs)("label",{className:"block space-y-1.5",children:[(0,a.jsx)("span",{className:"text-xs font-medium text-ink-3",children:"Description (optional)"}),(0,a.jsx)("textarea",{className:"min-h-16 w-full rounded-md border border-line-strong bg-bg px-3 py-2 text-sm",value:y,onChange:n(r=>i(r.target.value),"onChange"),placeholder:"Who this endpoint is for and when it should be rotated."})]}),w?(0,a.jsx)("p",{className:"text-xs text-bad",children:"Create an access profile under Advanced before adding a gateway."}):null,(0,a.jsxs)(W,{children:[(0,a.jsx)(v,{type:"button",variant:"ghost",onClick:n(()=>o(!1),"onClick"),children:"Cancel"}),(0,a.jsx)(v,{type:"submit",disabled:f.isPending||w||!u.trim()||!c,children:f.isPending?"Creating…":"Create gateway"})]})]})]})})}n(Pe,"NewGatewayDialog");function ie(e){if(typeof window>"u")return e;try{return new URL(e,window.location.origin).toString()}catch{return e}}n(ie,"gatewayEndpointUrl");function Le({endpointPath:e,className:t}){const{pushToast:o}=A(),s=ie(e);async function p(){try{await Z(s),o({title:"Gateway URL copied",tone:"success"})}catch{o({title:"Copy failed",body:"Clipboard access is unavailable.",tone:"error"})}}return n(p,"copy"),(0,a.jsxs)("button",{type:"button",onClick:n(l=>{l.stopPropagation(),p()},"onClick"),className:G("flex min-w-0 max-w-full items-center gap-1 text-left font-mono text-xs text-ink-3 hover:text-ink",t),title:`${s} — click to copy`,"aria-label":"Copy gateway URL",children:[(0,a.jsx)("span",{className:"min-w-0 truncate",children:s}),(0,a.jsx)(H,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":"true"})]})}n(Le,"CopyableGatewayUrl");export{I as _,Ce as a,ke as b,De as c,Ae as d,_e as f,Ee as g,ve as h,je as i,Se as l,Ne as m,Pe as n,ne as o,Ie as p,oe as r,$e as s,Le as t,Ge as u,D as v,Te as x,te as y};
@@ -1,2 +1,2 @@
1
- var Ae=Object.defineProperty;var i=(t,s)=>Ae(t,"name",{value:s,configurable:!0});import{i as de}from"./rolldown-runtime-ZpX3ckPj.js";import{en as Ie,f as J,l as L,na as Ce,ta as Se}from"./createLucideIcon-DJi9suAC.js";import{h as ue}from"./star-BZgQbzhV.js";import{X as $e,_ as Te,t as y,v as j}from"./queryKeys-DYV5MhM_.js";import{n as De}from"./CompanyContext-CSrVsSze.js";import{an as me,t as T,zt as Re}from"./router-2UfGeejU.js";import{a as _e,n as Le,t as Me}from"./avatar-UO226cef.js";import{t as Z}from"./bot-C9arfJWx.js";import{t as Pe}from"./chevron-right-s7L6hXXq.js";import{t as qe}from"./circle-dot-zr8GONq2.js";import{t as Oe}from"./flask-conical-CEYKkO5k.js";import{t as ee}from"./layout-dashboard-DClZjSaR.js";import{t as M}from"./button-CMwV3L1P.js";import{t as ze}from"./shield-check-B0HVjzM_.js";import{t as Be}from"./MootMark-DZAfkwdv.js";import{n as Ke}from"./Identity-Cv_2a9qJ.js";import{t as Ee}from"./AgentAvatar-DgGEobSY.js";import{t as te}from"./agents-DmlgUVso.js";import{n as se,t as ae}from"./useSharedPolling-D4Xn8mY2.js";import{t as Fe}from"./projects-mixWrT5q.js";import{t as He}from"./access-GAosX22P.js";import{n as Ue}from"./slots-Dw517dxP.js";import{t as Qe}from"./activity-BVYJmFzR.js";import{n as Ve}from"./BreadcrumbContext-BVZDZoC0.js";import{t as We}from"./AgentIdentity-I_kB4rMX.js";import{t as ne}from"./InlineBanner-VQ5mstsR.js";import{t as z}from"./card-Bru3x_SJ.js";import{t as Xe}from"./StatusIcon-0GcYXDdN.js";import{Ha as B,Hr as Ye,Jt as Ge,T as re,Xi as Je,Xt as Ze,Yt as et,Zt as tt,_ as st,an as at,ca as nt,la as rt,on as it,qn as ot,qt as lt,za as ct,zr as dt}from"./index-DDoARkPG.js";import{t as ut}from"./IssueReferenceActivitySummary-CbpSjmdV.js";import{t as mt}from"./activity-format-zP89NM00.js";import{t as _}from"./MetricCard-DaAh5x_N.js";import{t as xt}from"./ActiveAgentsPanel-Budj8e9v.js";import{c as ie,o as ht,s as pt}from"./smoke-lab-matrix-0BhnGQeo.js";var f=de(Ce(),1),oe=new Set;function gt(t){return oe.has(t)?!1:(oe.add(t),!0)}i(gt,"claimOnboardingOffer");var e=de(Se(),1);function ft(t,s,a){switch(t){case"issue":return`/issues/${a??s}`;case"agent":return`/agents/${s}`;case"project":return`/projects/${Ie(a,s)}`;case"goal":return`/goals/${s}`;case"approval":return`/approvals/${s}`;default:return null}}i(ft,"entityLink");function bt({event:t,agentMap:s,userProfileMap:a,entityNameMap:r,entityTitleMap:c,className:m}){const o=mt(t.action,t.details,{agentMap:s,userProfileMap:a}),h=t.entityType==="heartbeat_run",l=h?t.details?.agentId:void 0,p=h?l?r.get(`agent:${l}`):null:r.get(`${t.entityType}:${t.entityId}`),u=c?.get(`${t.entityType}:${t.entityId}`)??(t.entityType==="issue"&&typeof t.details?.issueTitle=="string"?t.details.issueTitle:void 0),b=h&&l?`/agents/${l}/runs/${t.entityId}`:ft(t.entityType,t.entityId,p),I=t.actorType==="agent"?s.get(t.actorId):null,N=t.actorType==="user"?a?.get(t.actorId):null,k=I?.name??(t.actorType==="system"?"System":N?.label??(t.actorType==="user"?"Board":t.actorId||"Unknown")),C=N?.image??null,D=(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsxs)("div",{className:"flex items-start gap-2 @xl:grid @xl:grid-cols-(--dashboard-activity-list-columns) @xl:items-baseline",children:[t.actorType==="agent"?(0,e.jsx)(Ee,{agent:I,name:k,size:24,className:"@xl:self-center"}):(0,e.jsxs)(Me,{size:"sm","aria-hidden":"true",className:"@xl:self-center",children:[C&&(0,e.jsx)(_e,{src:C,alt:""}),(0,e.jsx)(Le,{children:Ke(k)})]}),(0,e.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1 @xl:contents",children:[(0,e.jsxs)("div",{className:"flex min-w-0 items-baseline gap-2 @xl:contents",children:[(0,e.jsxs)("p",{className:"flex h-6 min-w-0 flex-1 items-center gap-1.5",children:[(0,e.jsxs)("span",{className:"max-w-1/2 shrink-0 truncate",title:`${k} ${o}`,children:[(0,e.jsx)("span",{children:k})," ",(0,e.jsx)("span",{className:"text-ink-3",children:o})]}),t.entityType==="issue"?(0,e.jsx)("span",{className:"min-w-0 flex-1 truncate",title:u,children:u}):(0,e.jsxs)("span",{className:"min-w-0 flex-1 truncate",children:[p&&(0,e.jsx)("span",{className:"font-medium",children:p}),u&&(0,e.jsxs)("span",{className:"text-ink-3",children:[" — ",u]})]})]}),(0,e.jsx)("span",{className:"ml-auto shrink-0 truncate text-right font-mono text-(length:--text-micro) text-ink-3 @xl:w-(--dashboard-list-id-width)",children:t.entityType==="issue"?p:null})]}),(0,e.jsx)("div",{className:"flex min-h-6 min-w-0 items-center @xl:contents",children:(0,e.jsx)("span",{className:"ml-auto w-(--dashboard-list-time-width) shrink-0 whitespace-nowrap text-right text-xs text-ink-3",children:me(t.createdAt)})})]})]}),(0,e.jsx)(ut,{event:t})]}),d=L("dashboard-list-row text-sm",b&&"cursor-pointer hover:bg-bg-3/50 transition-colors",m);return b?(0,e.jsx)(T,{to:b,className:L(d,"no-underline text-inherit block"),children:D}):(0,e.jsx)("div",{className:d,children:D})}i(bt,"ActivityRow");function P(){return Array.from({length:14},(t,s)=>{const a=new Date;return a.setDate(a.getDate()-(13-s)),a.toISOString().slice(0,10)})}i(P,"getLast14Days");function yt(t){const s=new Date(t+"T12:00:00");return`${s.getMonth()+1}/${s.getDate()}`}i(yt,"formatDayLabel");function F(t){return{date:t,succeeded:0,failed:0,recovered:0,other:0,total:0,failedByErrorCode:{}}}i(F,"emptyRunDay");var v={succeeded:"var(--status-task-icon-done)",recovered:"var(--status-task-todo)",failed:"var(--status-task-icon-blocked)",other:"var(--hex-737373)"};function vt(t){const s=[`${t.date}: ${t.total} run${t.total===1?"":"s"}`];if(t.succeeded>0&&s.push(` succeeded: ${t.succeeded}`),t.recovered>0&&s.push(` recovered: ${t.recovered} (retry succeeded)`),t.failed>0){s.push(` failed: ${t.failed}`);const a=Object.entries(t.failedByErrorCode??{}).sort((r,c)=>c[1]-r[1]);for(const[r,c]of a)s.push(` ${r}: ${c}`)}return t.other>0&&s.push(` other: ${t.other}`),s.join(`
1
+ var Ae=Object.defineProperty;var i=(t,s)=>Ae(t,"name",{value:s,configurable:!0});import{i as de}from"./rolldown-runtime-ZpX3ckPj.js";import{en as Ie,f as J,l as L,na as Ce,ta as Se}from"./createLucideIcon-DJi9suAC.js";import{h as ue}from"./star-BZgQbzhV.js";import{X as $e,_ as Te,t as y,v as j}from"./queryKeys-DYV5MhM_.js";import{n as De}from"./CompanyContext-CSrVsSze.js";import{an as me,t as T,zt as Re}from"./router-2UfGeejU.js";import{a as _e,n as Le,t as Me}from"./avatar-UO226cef.js";import{t as Z}from"./bot-C9arfJWx.js";import{t as Pe}from"./chevron-right-s7L6hXXq.js";import{t as qe}from"./circle-dot-zr8GONq2.js";import{t as Oe}from"./flask-conical-CEYKkO5k.js";import{t as ee}from"./layout-dashboard-DClZjSaR.js";import{t as M}from"./button-CMwV3L1P.js";import{t as ze}from"./shield-check-B0HVjzM_.js";import{t as Be}from"./MootMark-DZAfkwdv.js";import{n as Ke}from"./Identity-Cv_2a9qJ.js";import{t as Ee}from"./AgentAvatar-DgGEobSY.js";import{t as te}from"./agents-DmlgUVso.js";import{n as se,t as ae}from"./useSharedPolling-D4Xn8mY2.js";import{t as Fe}from"./projects-mixWrT5q.js";import{t as He}from"./access-GAosX22P.js";import{n as Ue}from"./slots-Dw517dxP.js";import{t as Qe}from"./activity-BVYJmFzR.js";import{n as Ve}from"./BreadcrumbContext-BVZDZoC0.js";import{t as We}from"./AgentIdentity-I_kB4rMX.js";import{t as ne}from"./InlineBanner-VQ5mstsR.js";import{t as z}from"./card-Bru3x_SJ.js";import{t as Xe}from"./StatusIcon-0GcYXDdN.js";import{Ha as B,Hr as Ye,Jt as Ge,T as re,Xi as Je,Xt as Ze,Yt as et,Zt as tt,_ as st,an as at,ca as nt,la as rt,on as it,qn as ot,qt as lt,za as ct,zr as dt}from"./index-3AxqhPET.js";import{t as ut}from"./IssueReferenceActivitySummary-CbpSjmdV.js";import{t as mt}from"./activity-format-zP89NM00.js";import{t as _}from"./MetricCard-DaAh5x_N.js";import{t as xt}from"./ActiveAgentsPanel-CF0fwsze.js";import{c as ie,o as ht,s as pt}from"./smoke-lab-matrix-0BhnGQeo.js";var f=de(Ce(),1),oe=new Set;function gt(t){return oe.has(t)?!1:(oe.add(t),!0)}i(gt,"claimOnboardingOffer");var e=de(Se(),1);function ft(t,s,a){switch(t){case"issue":return`/issues/${a??s}`;case"agent":return`/agents/${s}`;case"project":return`/projects/${Ie(a,s)}`;case"goal":return`/goals/${s}`;case"approval":return`/approvals/${s}`;default:return null}}i(ft,"entityLink");function bt({event:t,agentMap:s,userProfileMap:a,entityNameMap:r,entityTitleMap:c,className:m}){const o=mt(t.action,t.details,{agentMap:s,userProfileMap:a}),h=t.entityType==="heartbeat_run",l=h?t.details?.agentId:void 0,p=h?l?r.get(`agent:${l}`):null:r.get(`${t.entityType}:${t.entityId}`),u=c?.get(`${t.entityType}:${t.entityId}`)??(t.entityType==="issue"&&typeof t.details?.issueTitle=="string"?t.details.issueTitle:void 0),b=h&&l?`/agents/${l}/runs/${t.entityId}`:ft(t.entityType,t.entityId,p),I=t.actorType==="agent"?s.get(t.actorId):null,N=t.actorType==="user"?a?.get(t.actorId):null,k=I?.name??(t.actorType==="system"?"System":N?.label??(t.actorType==="user"?"Board":t.actorId||"Unknown")),C=N?.image??null,D=(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsxs)("div",{className:"flex items-start gap-2 @xl:grid @xl:grid-cols-(--dashboard-activity-list-columns) @xl:items-baseline",children:[t.actorType==="agent"?(0,e.jsx)(Ee,{agent:I,name:k,size:24,className:"@xl:self-center"}):(0,e.jsxs)(Me,{size:"sm","aria-hidden":"true",className:"@xl:self-center",children:[C&&(0,e.jsx)(_e,{src:C,alt:""}),(0,e.jsx)(Le,{children:Ke(k)})]}),(0,e.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1 @xl:contents",children:[(0,e.jsxs)("div",{className:"flex min-w-0 items-baseline gap-2 @xl:contents",children:[(0,e.jsxs)("p",{className:"flex h-6 min-w-0 flex-1 items-center gap-1.5",children:[(0,e.jsxs)("span",{className:"max-w-1/2 shrink-0 truncate",title:`${k} ${o}`,children:[(0,e.jsx)("span",{children:k})," ",(0,e.jsx)("span",{className:"text-ink-3",children:o})]}),t.entityType==="issue"?(0,e.jsx)("span",{className:"min-w-0 flex-1 truncate",title:u,children:u}):(0,e.jsxs)("span",{className:"min-w-0 flex-1 truncate",children:[p&&(0,e.jsx)("span",{className:"font-medium",children:p}),u&&(0,e.jsxs)("span",{className:"text-ink-3",children:[" — ",u]})]})]}),(0,e.jsx)("span",{className:"ml-auto shrink-0 truncate text-right font-mono text-(length:--text-micro) text-ink-3 @xl:w-(--dashboard-list-id-width)",children:t.entityType==="issue"?p:null})]}),(0,e.jsx)("div",{className:"flex min-h-6 min-w-0 items-center @xl:contents",children:(0,e.jsx)("span",{className:"ml-auto w-(--dashboard-list-time-width) shrink-0 whitespace-nowrap text-right text-xs text-ink-3",children:me(t.createdAt)})})]})]}),(0,e.jsx)(ut,{event:t})]}),d=L("dashboard-list-row text-sm",b&&"cursor-pointer hover:bg-bg-3/50 transition-colors",m);return b?(0,e.jsx)(T,{to:b,className:L(d,"no-underline text-inherit block"),children:D}):(0,e.jsx)("div",{className:d,children:D})}i(bt,"ActivityRow");function P(){return Array.from({length:14},(t,s)=>{const a=new Date;return a.setDate(a.getDate()-(13-s)),a.toISOString().slice(0,10)})}i(P,"getLast14Days");function yt(t){const s=new Date(t+"T12:00:00");return`${s.getMonth()+1}/${s.getDate()}`}i(yt,"formatDayLabel");function F(t){return{date:t,succeeded:0,failed:0,recovered:0,other:0,total:0,failedByErrorCode:{}}}i(F,"emptyRunDay");var v={succeeded:"var(--status-task-icon-done)",recovered:"var(--status-task-todo)",failed:"var(--status-task-icon-blocked)",other:"var(--hex-737373)"};function vt(t){const s=[`${t.date}: ${t.total} run${t.total===1?"":"s"}`];if(t.succeeded>0&&s.push(` succeeded: ${t.succeeded}`),t.recovered>0&&s.push(` recovered: ${t.recovered} (retry succeeded)`),t.failed>0){s.push(` failed: ${t.failed}`);const a=Object.entries(t.failedByErrorCode??{}).sort((r,c)=>c[1]-r[1]);for(const[r,c]of a)s.push(` ${r}: ${c}`)}return t.other>0&&s.push(` other: ${t.other}`),s.join(`
2
2
  `)}i(vt,"runDayTooltip");function H({days:t}){return(0,e.jsx)("div",{className:"flex gap-(--sz-3px) mt-1.5",children:t.map((s,a)=>(0,e.jsx)("div",{className:"flex-1 text-center",children:a===0||a===6||a===13?(0,e.jsx)("span",{className:"text-(length:--text-nano) text-ink-3 tabular-nums",children:yt(s)}):null},s))})}i(H,"DateLabels");function xe({items:t}){return(0,e.jsx)("div",{className:"flex flex-wrap gap-x-2.5 gap-y-0.5 mt-2",children:t.map(s=>(0,e.jsxs)("span",{className:"flex items-center gap-1 text-(length:--text-nano) text-ink-3",children:[(0,e.jsx)("span",{className:"h-1.5 w-1.5 rounded-full shrink-0",style:{backgroundColor:s.color}}),s.label]},s.label))})}i(xe,"ChartLegend");function K({title:t,subtitle:s,className:a,children:r}){return(0,e.jsxs)("div",{className:L("border border-line rounded-lg p-4 space-y-3",a),children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("h3",{className:"text-xs font-medium text-ink-3",children:t}),s&&(0,e.jsx)("span",{className:"text-(length:--text-nano) text-ink-3/60",children:s})]}),r]})}i(K,"ChartCard");function jt(t=[]){const s=P(),a=new Map;for(const r of s)a.set(r,F(r));for(const r of t){const c=new Date(r.createdAt).toISOString().slice(0,10),m=a.get(c);if(m){if(r.status==="succeeded")m.succeeded++;else if(r.status==="failed"||r.status==="timed_out"){m.failed++;const o=r.errorCode&&r.errorCode.length>0?r.errorCode:"unknown";m.failedByErrorCode[o]=(m.failedByErrorCode[o]??0)+1}else m.other++;m.total++}}return Array.from(a.values())}i(jt,"aggregateRuns");function he(t){return Array.isArray(t.activity)?t.activity:Array.isArray(t.runs)?jt(t.runs):[]}i(he,"resolveRunActivity");function kt(t){const s=he(t),a=s.length>0?s.map(l=>l.date):P(),r=new Map(s.map(l=>[l.date,l])),c=Math.max(...s.map(l=>l.total),1),m=s.some(l=>l.total>0),o=s.some(l=>l.recovered>0);if(!m)return(0,e.jsx)("p",{className:"text-xs text-ink-3",children:"No runs yet"});const h=[{color:v.succeeded,label:"Succeeded"},...o?[{color:v.recovered,label:"Recovered"}]:[],{color:v.failed,label:"Failed"},{color:v.other,label:"Other"}];return(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"flex items-end gap-(--sz-3px) h-20",children:a.map(l=>{const p=r.get(l)??F(l),u=p.total,b=u/c*100;return(0,e.jsx)("div",{className:"flex-1 h-full flex flex-col justify-end",title:vt(p),children:u>0?(0,e.jsxs)("div",{className:"flex flex-col-reverse gap-px overflow-hidden",style:{height:`${b}%`,minHeight:2},children:[p.succeeded>0&&(0,e.jsx)("div",{style:{flex:p.succeeded,backgroundColor:v.succeeded}}),p.recovered>0&&(0,e.jsx)("div",{style:{flex:p.recovered,backgroundColor:v.recovered}}),p.failed>0&&(0,e.jsx)("div",{style:{flex:p.failed,backgroundColor:v.failed}}),p.other>0&&(0,e.jsx)("div",{style:{flex:p.other,backgroundColor:v.other}})]}):(0,e.jsx)("div",{className:"bg-bg-3/30 rounded-sm",style:{height:2}})},l)})}),(0,e.jsx)(H,{days:a}),(0,e.jsx)(xe,{items:h})]})}i(kt,"RunActivityChart");var le={todo:"var(--status-task-todo)",in_progress:"var(--status-task-icon-in_progress)",in_review:"var(--status-task-in_review)",done:"var(--status-task-icon-done)",blocked:"var(--status-task-icon-blocked)",cancelled:"var(--status-task-cancelled)",backlog:"var(--project-none)"},wt={todo:"To Do",in_progress:"In Progress",in_review:"In Review",done:"Done",blocked:"Blocked",cancelled:"Cancelled",backlog:"Backlog"};function Nt({issues:t}){const s=P(),a=new Set,r=new Map;for(const o of s)r.set(o,{});for(const o of t){const h=new Date(o.createdAt).toISOString().slice(0,10),l=r.get(h);l&&(l[o.status]=(l[o.status]??0)+1,a.add(o.status))}const c=["todo","in_progress","in_review","done","blocked","cancelled","backlog"].filter(o=>a.has(o)),m=Math.max(...Array.from(r.values()).map(o=>Object.values(o).reduce((h,l)=>h+l,0)),1);return a.size>0?(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"flex items-end gap-(--sz-3px) h-20",children:s.map(o=>{const h=r.get(o),l=Object.values(h).reduce((u,b)=>u+b,0),p=l/m*100;return(0,e.jsx)("div",{className:"flex-1 h-full flex flex-col justify-end",title:`${o}: ${l} issues`,children:l>0?(0,e.jsx)("div",{className:"flex flex-col-reverse gap-px overflow-hidden",style:{height:`${p}%`,minHeight:2},children:c.map(u=>(h[u]??0)>0?(0,e.jsx)("div",{style:{flex:h[u],backgroundColor:le[u]??"var(--hex-6b7280)"}},u):null)}):(0,e.jsx)("div",{className:"bg-bg-3/30 rounded-sm",style:{height:2}})},o)})}),(0,e.jsx)(H,{days:s}),(0,e.jsx)(xe,{items:c.map(o=>({color:le[o]??"var(--hex-6b7280)",label:wt[o]??o}))})]}):(0,e.jsx)("p",{className:"text-xs text-ink-3",children:"No tasks"})}i(Nt,"IssueStatusChart");function At(t){const s=he(t),a=s.length>0?s.map(c=>c.date):P(),r=new Map(s.map(c=>[c.date,c]));return s.some(c=>c.total>0)?(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"flex items-end gap-(--sz-3px) h-20",children:a.map(c=>{const m=r.get(c)??F(c),o=m.succeeded+m.recovered,h=m.total>0?o/m.total:0,l=m.total===0?void 0:h>=.8?"var(--status-task-icon-done)":h>=.5?"var(--hex-eab308)":"var(--status-task-icon-blocked)";return(0,e.jsx)("div",{className:"flex-1 h-full flex flex-col justify-end",title:`${c}: ${m.total>0?Math.round(h*100):0}% (${o}/${m.total})`,children:m.total>0?(0,e.jsx)("div",{style:{height:`${h*100}%`,minHeight:2,backgroundColor:l}}):(0,e.jsx)("div",{className:"bg-bg-3/30 rounded-sm",style:{height:2}})},c)})}),(0,e.jsx)(H,{days:a})]}):(0,e.jsx)("p",{className:"text-xs text-ink-3",children:"No runs yet"})}i(At,"SuccessRateChart");var It={green:"bg-emerald-500",amber:"bg-amber-500",red:"bg-bad",unknown:"bg-ink-3/40"},Ct={green:"All paths passing",amber:"Needs a run",red:"Failing paths",unknown:"No runs yet"};function St(t){if(!t)return"—";const s=new Date(t);return Number.isNaN(s.getTime())?"—":new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(s)}i(St,"formatTime");function $t({companyId:t}){const{enabled:s,loaded:a}=dt(),r=j({queryKey:y.smokeLab.runs(t),queryFn:i(()=>ie.listRuns(t),"queryFn"),enabled:s&&a}).data?.runs?.[0],c=j({queryKey:y.smokeLab.run(t,r?.id??"__none__"),queryFn:i(()=>ie.getRun(t,r.id),"queryFn"),enabled:s&&a&&!!r});if(!a||!s)return null;const m=c.data?.steps??[],o=pt(r,m),h=ht(m);return(0,e.jsxs)(T,{to:Ye("smoke-lab"),className:"group flex items-center justify-between gap-3 rounded-lg border border-line bg-bg-2 p-4 shadow-sm transition-colors hover:bg-bg-3/40","data-testid":"smoke-lab-dashboard-card",children:[(0,e.jsxs)("div",{className:"flex min-w-0 items-start gap-3",children:[(0,e.jsx)("span",{className:"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-bg-3",children:(0,e.jsx)(Oe,{className:"h-4 w-4 text-ink-3"})}),(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("span",{className:L("h-2.5 w-2.5 shrink-0 rounded-full",It[o])}),(0,e.jsx)("p",{className:"truncate text-sm font-semibold text-ink",children:"Integration smoke"})]}),(0,e.jsxs)("p",{className:"mt-0.5 truncate text-xs text-ink-3",children:[Ct[o],h.length>0&&`: ${h.join(", ")}`]}),(0,e.jsx)("p",{className:"mt-0.5 truncate text-(length:--text-micro) text-ink-3/80",children:r?`Last run ${St(r.startedAt)}`:"Run one from the Smoke Lab tab"})]})]}),(0,e.jsx)(Pe,{className:"h-4 w-4 shrink-0 text-ink-3 transition-transform group-hover:translate-x-0.5"})]})}i($t,"SmokeLabDashboardCard");function Tt(){const{pathname:t}=ue(),s=Ze(),a=tt(t),{onboardingOpen:r}=rt();if(!a||r)return null;const c=i(()=>{s==="ios-manual"?Ge(!0):lt()},"install");return(0,e.jsxs)("section",{role:"region","aria-label":"Install Wardmote",className:"flex flex-wrap items-center gap-3 rounded-(--r-lg) border border-line bg-bg-2 p-4",children:[(0,e.jsx)(Be,{className:"size-7 shrink-0 text-ink","aria-hidden":"true"}),(0,e.jsxs)("div",{className:"flex min-w-48 flex-1 flex-col gap-0.5",children:[(0,e.jsx)("span",{className:"text-sm font-semibold text-ink",children:"Install Wardmote"}),(0,e.jsx)("span",{className:"text-sm text-ink-3",children:"Opens in its own window and can notify you when an agent needs a decision."})]}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(M,{type:"button",variant:"ghost",size:"sm",onClick:i(()=>et(),"onClick"),children:"Not now"}),(0,e.jsx)(M,{type:"button",size:"sm",onClick:c,children:"Install"})]})]})}i(Tt,"InstallNudge");var E=10;function Dt(t){return[...t].sort((s,a)=>new Date(a.updatedAt).getTime()-new Date(s.updatedAt).getTime())}i(Dt,"getRecentIssues");function ce(t){if(!t||t.length===0)return null;const s=t.filter(a=>a.status==="paused"&&a.pauseReason==="import");return s.length>0?{kind:"imported",pausedImportedAgentIds:s.map(a=>a.id)}:t.every(a=>a.status==="paused")?{kind:"all-paused"}:null}i(ce,"derivePausedAgentBanner");function xs(){const{selectedCompanyId:t,companies:s}=De(),{openOnboarding:a}=nt(),r=ue(),{setBreadcrumbs:c}=Ve(),[m,o]=(0,f.useState)(new Set),h=(0,f.useRef)(new Set),l=(0,f.useRef)(!1),p=(0,f.useRef)([]),{data:u,isFetching:b}=j({queryKey:y.agents.list(t),queryFn:i(()=>te.list(t),"queryFn"),enabled:!!t}),I=$e(),N=Te({mutationFn:i(async()=>{const n=ce(u);if(!(!n||n.kind!=="imported"))for(const x of n.pausedImportedAgentIds)try{await te.resume(x,t??void 0)}catch{}},"mutationFn"),onSettled:i(async()=>{await Promise.all([I.invalidateQueries({queryKey:y.agents.list(t)}),I.invalidateQueries({queryKey:y.dashboard(t)})])},"onSettled")}),k=it({pathname:r.pathname,agentsLoaded:u!==void 0,agentsRefreshing:b,agentCount:u?.length??0});(0,f.useEffect)(()=>{!k||!t||gt(t)&&a({companyId:t,initialStep:at()})},[k,t,a]),(0,f.useEffect)(()=>{c([{label:"Dashboard"}])},[c]);const C=y.dashboard(t),D=se({companyId:t,resourceKey:"dashboard",queryKey:C,enabled:!!t}),{data:d,isLoading:pe,error:U,dataUpdatedAt:ge}=j({queryKey:C,queryFn:i(()=>Je.summary(t),"queryFn"),enabled:!!t});ae(D,d,ge);const Q=[...y.activity(t),{limit:E}],fe=se({companyId:t,resourceKey:`activity:limit:${E}`,queryKey:Q,enabled:!!t}),{data:q,dataUpdatedAt:be}=j({queryKey:Q,queryFn:i(()=>Qe.list(t,{limit:E}),"queryFn"),enabled:!!t});ae(fe,q,be);const{data:w}=j({queryKey:y.issues.list(t),queryFn:i(()=>Re.list(t),"queryFn"),enabled:!!t}),{data:V}=j({queryKey:y.projects.list(t,{includeArchived:!0}),queryFn:i(()=>Fe.list(t,{includeArchived:!0}),"queryFn"),enabled:!!t}),{data:W}=j({queryKey:y.access.companyUserDirectory(t),queryFn:i(()=>He.listUserDirectory(t),"queryFn"),enabled:!!t}),ye=(0,f.useMemo)(()=>ot(W?.users),[W?.users]),X=w?Dt(w):[],S=(0,f.useMemo)(()=>(q??[]).slice(0,10),[q]);(0,f.useEffect)(()=>{for(const n of p.current)window.clearTimeout(n);p.current=[],h.current=new Set,l.current=!1,o(new Set)},[t]),(0,f.useEffect)(()=>{if(S.length===0)return;const n=h.current,x=S.map(g=>g.id);if(!l.current){for(const g of x)n.add(g);l.current=!0;return}const A=x.filter(g=>!n.has(g));if(A.length===0){for(const g of x)n.add(g);return}o(g=>{const $=new Set(g);for(const O of A)$.add(O);return $});for(const g of A)n.add(g);const G=window.setTimeout(()=>{o(g=>{const $=new Set(g);for(const O of A)$.delete(O);return $}),p.current=p.current.filter(g=>g!==G)},980);p.current.push(G)},[S]),(0,f.useEffect)(()=>()=>{for(const n of p.current)window.clearTimeout(n)},[]);const ve=(0,f.useMemo)(()=>{const n=new Map;for(const x of u??[])n.set(x.id,x);return n},[u]),je=(0,f.useMemo)(()=>{const n=new Map;for(const x of w??[])n.set(`issue:${x.id}`,x.identifier??x.id.slice(0,8));for(const x of u??[])n.set(`agent:${x.id}`,x.name);for(const x of V??[])n.set(`project:${x.id}`,x.name);return n},[w,u,V]),ke=(0,f.useMemo)(()=>{const n=new Map;for(const x of w??[])n.set(`issue:${x.id}`,x.title);return n},[w]),we=i(n=>!n||!u?null:u.find(x=>x.id===n)?.name??null,"agentName");if(!t)return s.length===0?(0,e.jsx)(re,{icon:ee,message:"Welcome to Wardmote. Set up your first organization and agent to get started.",action:"Get Started",onAction:a}):(0,e.jsx)(re,{icon:ee,message:"Create or select an organization to view the dashboard."});if(pe)return(0,e.jsx)(st,{variant:"dashboard"});const Ne=u!==void 0&&!b&&u.length===0,R=ce(u),Y=R?.kind==="imported"?R.pausedImportedAgentIds.length:0;return(0,e.jsxs)("div",{className:"space-y-6",children:[U&&(0,e.jsx)("p",{className:"text-sm text-bad",children:U.message}),(0,e.jsx)(Tt,{}),R?.kind==="imported"?(0,e.jsx)(ne,{tone:"warning",icon:B,title:`${Y} imported agent${Y===1?" is":"s are"} paused and will not run.`,actions:(0,e.jsx)(M,{size:"sm",onClick:i(()=>N.mutate(),"onClick"),disabled:N.isPending,"data-testid":"dashboard-resume-imported-agents",children:N.isPending?"Resuming…":"Resume all"}),children:"Agents from an organization import arrive paused as a safety default. Resume them so assigned tasks can start."}):R?.kind==="all-paused"?(0,e.jsx)(ne,{tone:"warning",icon:B,title:"All agents in this organization are paused — nothing will run.",actions:(0,e.jsx)(M,{variant:"ghost",size:"sm",asChild:!0,children:(0,e.jsx)(T,{to:"/agents",children:"Review agents"})}),children:"Resume at least one agent to let assigned tasks start."}):null,Ne&&(0,e.jsxs)("div",{className:"flex items-center justify-between gap-3 rounded-md border border-amber-300 bg-amber-50 px-4 py-3 dark:border-amber-500/25 dark:bg-amber-950/60",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,e.jsx)(Z,{className:"h-4 w-4 text-amber-600 dark:text-amber-400 shrink-0"}),(0,e.jsx)("p",{className:"text-sm text-amber-900 dark:text-amber-100",children:"You have no agents."})]}),(0,e.jsx)("button",{onClick:i(()=>a({initialStep:3,companyId:t}),"onClick"),className:"text-sm font-medium text-amber-700 hover:text-amber-900 dark:text-amber-300 dark:hover:text-amber-100 underline underline-offset-2 shrink-0",children:"Create one here"})]}),(0,e.jsx)(xt,{companyId:t,dedupeLinkedTasks:!0}),d&&(0,e.jsxs)(e.Fragment,{children:[d.budgets.activeIncidents>0?(0,e.jsxs)("div",{className:"flex items-start justify-between gap-3 rounded-xl border border-red-500/20 bg-(image:--gradient-extract-1) px-4 py-3",children:[(0,e.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,e.jsx)(B,{className:"mt-0.5 h-4 w-4 shrink-0 text-red-700 dark:text-red-300"}),(0,e.jsxs)("div",{children:[(0,e.jsxs)("p",{className:"text-sm font-medium text-red-950 dark:text-red-50",children:[d.budgets.activeIncidents," active budget incident",d.budgets.activeIncidents===1?"":"s"]}),(0,e.jsxs)("p",{className:"text-xs text-red-900/70 dark:text-red-100/70",children:[d.budgets.pausedAgents," agents paused · ",d.budgets.pausedProjects," projects paused · ",d.budgets.pendingApprovals," pending budget approvals"]})]})]}),(0,e.jsx)(T,{to:"/costs",className:"text-sm underline underline-offset-2 text-red-900 dark:text-red-100",children:"Open budgets"})]}):null,(0,e.jsxs)("div",{className:"grid grid-cols-2 xl:grid-cols-4 gap-1 sm:gap-2",children:[(0,e.jsx)(_,{icon:Z,value:d.agents.active+d.agents.running+d.agents.paused+d.agents.error,label:"Agents Enabled",to:"/agents",description:(0,e.jsxs)("span",{children:[d.agents.running," running",", ",d.agents.paused," paused",", ",d.agents.error," errors"]})}),(0,e.jsx)(_,{icon:qe,value:d.tasks.inProgress,label:"Tasks In Progress",to:"/issues",description:(0,e.jsxs)("span",{children:[d.tasks.open," open",", ",d.tasks.blocked," blocked"]})}),(0,e.jsx)(_,{icon:ct,value:J(d.costs.monthSpendCents),label:"Month Spend",to:"/costs",description:(0,e.jsx)("span",{children:d.costs.monthBudgetCents>0?`${d.costs.monthUtilizationPercent}% of ${J(d.costs.monthBudgetCents)} budget`:"Unlimited budget"})}),(0,e.jsx)(_,{icon:ze,value:d.pendingApprovals+d.budgets.pendingApprovals,label:"Pending Approvals",to:"/approvals",description:(0,e.jsx)("span",{children:d.budgets.pendingApprovals>0?`${d.budgets.pendingApprovals} budget overrides awaiting board review`:"Awaiting board review"})})]}),(0,e.jsx)($t,{companyId:t}),(0,e.jsxs)("div",{className:"home-charts grid gap-4",children:[(0,e.jsx)(K,{title:"Run Activity",subtitle:"Last 14 days",className:"home-run-chart",children:(0,e.jsx)(kt,{activity:d.runActivity})}),!1,(0,e.jsx)(K,{title:"Tasks by Status",subtitle:"Last 14 days",children:(0,e.jsx)(Nt,{issues:w??[]})}),(0,e.jsx)(K,{title:"Success Rate",subtitle:"Last 14 days",children:(0,e.jsx)(At,{activity:d.runActivity})})]}),(0,e.jsx)(Ue,{slotTypes:["dashboardWidget"],context:{companyId:t},className:"grid gap-4 md:grid-cols-2",itemClassName:"rounded-lg border bg-bg-2 p-4 shadow-sm"}),(0,e.jsxs)("div",{className:"grid md:grid-cols-2 gap-4",children:[S.length>0&&(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsx)("h3",{className:"text-sm font-semibold text-ink-3 uppercase tracking-wide mb-3",children:"Recent Activity"}),(0,e.jsx)(z,{className:"@container block py-0 divide-y divide-line overflow-hidden",children:S.map(n=>(0,e.jsx)(bt,{event:n,agentMap:ve,userProfileMap:ye,entityNameMap:je,entityTitleMap:ke,className:m.has(n.id)?"activity-row-enter":void 0},n.id))})]}),(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsx)("h3",{className:"text-sm font-semibold text-ink-3 uppercase tracking-wide mb-3",children:"Recent Tasks"}),X.length===0?(0,e.jsx)(z,{className:"block p-4",children:(0,e.jsx)("p",{className:"text-sm text-ink-3",children:"No tasks yet."})}):(0,e.jsx)(z,{className:"@container block py-0 divide-y divide-line overflow-hidden",children:X.slice(0,10).map(n=>(0,e.jsx)(T,{to:`/issues/${n.identifier??n.id}`,className:"dashboard-list-row text-sm cursor-pointer hover:bg-bg-3/50 transition-colors no-underline text-inherit block",children:(0,e.jsxs)("div",{className:"flex items-start gap-2 @xl:grid @xl:grid-cols-(--dashboard-task-list-columns) @xl:items-baseline",children:[(0,e.jsx)("span",{className:"flex size-6 shrink-0 items-center justify-end @xl:self-center",children:(0,e.jsx)(Xe,{status:n.status,externalConversationState:n.externalConversationState,blockerAttention:n.blockerAttention})}),(0,e.jsxs)("span",{className:"flex min-w-0 flex-1 flex-col gap-1 @xl:contents",children:[(0,e.jsxs)("span",{className:"flex min-w-0 items-baseline gap-2 @xl:contents",children:[(0,e.jsx)("span",{className:"min-w-0 flex-1 truncate text-sm leading-6",title:n.title,children:n.title}),(0,e.jsx)("span",{className:"ml-auto shrink-0 truncate text-right font-mono text-(length:--text-micro) text-ink-3 @xl:col-start-4 @xl:row-start-1 @xl:w-(--dashboard-list-id-width)",children:n.identifier??n.id.slice(0,8)})]}),(0,e.jsxs)("span",{className:"flex min-h-6 min-w-0 items-center gap-2 @xl:contents",children:[(0,e.jsx)("span",{className:"flex min-w-0 flex-1 items-center @xl:col-start-3 @xl:row-start-1 @xl:self-center",children:n.assigneeAgentId&&(()=>{const x=we(n.assigneeAgentId);return x?(0,e.jsx)(We,{agent:u?.find(A=>A.id===n.assigneeAgentId)??{id:n.assigneeAgentId??void 0,name:x},size:"sm",className:"max-w-32"}):null})()}),(0,e.jsx)("span",{className:"ml-auto w-(--dashboard-list-time-width) shrink-0 whitespace-nowrap text-right text-xs text-ink-3",children:me(n.updatedAt)})]})]})]})},n.id))})]})]})]})]})}i(xs,"Dashboard");export{xs as Dashboard};
@@ -1 +1 @@
1
- var m=Object.defineProperty;var i=(t,r)=>m(t,"name",{value:r,configurable:!0});import{i as o}from"./rolldown-runtime-ZpX3ckPj.js";import{na as c,t as d,ta as l}from"./createLucideIcon-DJi9suAC.js";import{n as p}from"./CompanyContext-CSrVsSze.js";import{t as h}from"./router-2UfGeejU.js";import{t as x}from"./arrow-left-Ce_LIut0.js";import{n as f}from"./BreadcrumbContext-BVZDZoC0.js";import{T as u}from"./index-DDoARkPG.js";import{t as v}from"./ActiveAgentsPanel-Budj8e9v.js";var n={name:"radio-tower",size:24,node:[["path",{d:"M4.9 16.1C1 12.2 1 5.8 4.9 1.9",key:"s0qx1y"}],["path",{d:"M7.8 4.7a6.14 6.14 0 0 0-.8 7.5",key:"1idnkw"}],["circle",{cx:"12",cy:"9",r:"2",key:"1092wv"}],["path",{d:"M16.2 4.8c2 2 2.26 5.11.8 7.47",key:"ojru2q"}],["path",{d:"M19.1 1.9a9.96 9.96 0 0 1 0 14.1",key:"rhi7fg"}],["path",{d:"M9.5 18h5",key:"mfy3pd"}],["path",{d:"m8 22 4-11 4 11",key:"25yftu"}]]};n.node;var y=d(n),k=o(c(),1),e=o(l(),1),a=50;function D(){const{selectedCompanyId:t,companies:r}=p(),{setBreadcrumbs:s}=f();return(0,k.useEffect)(()=>{s([{label:"Dashboard",href:"/dashboard"},{label:"Live runs"}])},[s]),t?(0,e.jsxs)("div",{className:"space-y-5",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between",children:[(0,e.jsxs)("div",{children:[(0,e.jsxs)(h,{to:"/dashboard",className:"inline-flex items-center gap-1.5 text-sm text-ink-3 transition-colors hover:text-ink",children:[(0,e.jsx)(x,{className:"h-3.5 w-3.5"}),"Dashboard"]}),(0,e.jsx)("h1",{className:"mt-2 text-2xl font-semibold tracking-normal text-ink",children:"Live agent runs"}),(0,e.jsx)("p",{className:"mt-1 text-sm text-ink-3",children:"Active runs first, followed by the most recent completed runs."})]}),(0,e.jsxs)("div",{className:"text-sm text-ink-3",children:["Showing up to ",a]})]}),(0,e.jsx)(v,{companyId:t,title:"Active / recent",minRunCount:a,fetchLimit:a,cardLimit:a,emptyMessage:"No active or recent agent runs.",queryScope:"dashboard-live",showMoreLink:!1})]}):(0,e.jsx)(u,{icon:y,message:r.length===0?"Create an organization to view live runs.":"Select an organization to view live runs."})}i(D,"DashboardLive");export{D as DashboardLive};
1
+ var m=Object.defineProperty;var i=(t,r)=>m(t,"name",{value:r,configurable:!0});import{i as o}from"./rolldown-runtime-ZpX3ckPj.js";import{na as c,t as d,ta as l}from"./createLucideIcon-DJi9suAC.js";import{n as p}from"./CompanyContext-CSrVsSze.js";import{t as h}from"./router-2UfGeejU.js";import{t as x}from"./arrow-left-Ce_LIut0.js";import{n as f}from"./BreadcrumbContext-BVZDZoC0.js";import{T as u}from"./index-3AxqhPET.js";import{t as v}from"./ActiveAgentsPanel-CF0fwsze.js";var n={name:"radio-tower",size:24,node:[["path",{d:"M4.9 16.1C1 12.2 1 5.8 4.9 1.9",key:"s0qx1y"}],["path",{d:"M7.8 4.7a6.14 6.14 0 0 0-.8 7.5",key:"1idnkw"}],["circle",{cx:"12",cy:"9",r:"2",key:"1092wv"}],["path",{d:"M16.2 4.8c2 2 2.26 5.11.8 7.47",key:"ojru2q"}],["path",{d:"M19.1 1.9a9.96 9.96 0 0 1 0 14.1",key:"rhi7fg"}],["path",{d:"M9.5 18h5",key:"mfy3pd"}],["path",{d:"m8 22 4-11 4 11",key:"25yftu"}]]};n.node;var y=d(n),k=o(c(),1),e=o(l(),1),a=50;function D(){const{selectedCompanyId:t,companies:r}=p(),{setBreadcrumbs:s}=f();return(0,k.useEffect)(()=>{s([{label:"Dashboard",href:"/dashboard"},{label:"Live runs"}])},[s]),t?(0,e.jsxs)("div",{className:"space-y-5",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between",children:[(0,e.jsxs)("div",{children:[(0,e.jsxs)(h,{to:"/dashboard",className:"inline-flex items-center gap-1.5 text-sm text-ink-3 transition-colors hover:text-ink",children:[(0,e.jsx)(x,{className:"h-3.5 w-3.5"}),"Dashboard"]}),(0,e.jsx)("h1",{className:"mt-2 text-2xl font-semibold tracking-normal text-ink",children:"Live agent runs"}),(0,e.jsx)("p",{className:"mt-1 text-sm text-ink-3",children:"Active runs first, followed by the most recent completed runs."})]}),(0,e.jsxs)("div",{className:"text-sm text-ink-3",children:["Showing up to ",a]})]}),(0,e.jsx)(v,{companyId:t,title:"Active / recent",minRunCount:a,fetchLimit:a,cardLimit:a,emptyMessage:"No active or recent agent runs.",queryScope:"dashboard-live",showMoreLink:!1})]}):(0,e.jsx)(u,{icon:y,message:r.length===0?"Create an organization to view live runs.":"Select an organization to view live runs."})}i(D,"DashboardLive");export{D as DashboardLive};