@tickernelz/wardmote-ui 2026.1115.2 → 2026.1115.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.
- package/dist/assets/{AdapterManager-DlCyzyMu.js → AdapterManager-DD2p5mWg.js} +1 -1
- package/dist/assets/{AdvancedToolsRoute-4n8ZC6o0.js → AdvancedToolsRoute-DlPZ_L6N.js} +1 -1
- package/dist/assets/{AgentActionButtons-LV4FbrTY.js → AgentActionButtons-sm-e5f06.js} +1 -1
- package/dist/assets/{AgentChat-CXR66MM4.js → AgentChat-b78UeZDu.js} +1 -1
- package/dist/assets/{AgentChats-C4cEfRO_.js → AgentChats-XK32PfX0.js} +1 -1
- package/dist/assets/{AgentDefaults-BZwFysUw.js → AgentDefaults-BZlzjR_2.js} +1 -1
- package/dist/assets/{AgentDetail-DPCbH362.js → AgentDetail-DwlY6mx-.js} +1 -1
- package/dist/assets/{AgentTodoCard-82Za1R6Y.js → AgentTodoCard-C6-lHXns.js} +1 -1
- package/dist/assets/{Agents-BotjqSPg.js → Agents-C1-WHkTj.js} +3 -3
- package/dist/assets/{AppDetail-B5T_4Bu-.js → AppDetail-9cue4nY2.js} +1 -1
- package/dist/assets/{AppNotConnected-eBGlritA.js → AppNotConnected-oZ4OtRZ5.js} +1 -1
- package/dist/assets/{ApprovalCard-CyXVBGnO.js → ApprovalCard-B1Fs4K4S.js} +1 -1
- package/dist/assets/{ApprovalDetail-BSNBUdim.js → ApprovalDetail-BchdkauI.js} +1 -1
- package/dist/assets/{ApprovalPayload-vezR61PH.js → ApprovalPayload-HdMQnZAw.js} +1 -1
- package/dist/assets/{Approvals-YzDki85i.js → Approvals-ecXixAXF.js} +1 -1
- package/dist/assets/{AppsReview-D02Q501S.js → AppsReview-DSeqYXkI.js} +1 -1
- package/dist/assets/{ArtifactCard-CC5aIvtf.js → ArtifactCard-B9GVJfR3.js} +1 -1
- package/dist/assets/{Artifacts-CnP5QapS.js → Artifacts-Cfi9iGlP.js} +1 -1
- package/dist/assets/{AssistantConnection-refIKgUa.js → AssistantConnection-D1H83dKT.js} +1 -1
- package/dist/assets/{AttentionInteractionResolver-_l8MisRg.js → AttentionInteractionResolver-K_Jeu6_2.js} +1 -1
- package/dist/assets/{AuditHub-CKyN1yDa.js → AuditHub-DlVx-mPL.js} +1 -1
- package/dist/assets/{BoardChat-Dn5D5hbo.js → BoardChat-BWW2praB.js} +1 -1
- package/dist/assets/{BootstrapSetupUxLab-CDn9Qoy4.js → BootstrapSetupUxLab-C4zke6Cv.js} +1 -1
- package/dist/assets/{Browse-BQApRQGO.js → Browse-DLwvtbXu.js} +1 -1
- package/dist/assets/{BudgetPolicyCard-BAwZpX0_.js → BudgetPolicyCard-B6DX8U3d.js} +1 -1
- package/dist/assets/{CaseDetail-CPGVCggR.js → CaseDetail-dci6PiNM.js} +1 -1
- package/dist/assets/{Cases-CpluIjg7.js → Cases-DySeA3ym.js} +1 -1
- package/dist/assets/{ChatEndpointDetail-C15kjogV.js → ChatEndpointDetail-DYg7hB9_.js} +1 -1
- package/dist/assets/{ChatEndpointSetup-Czgls4T4.js → ChatEndpointSetup-D82OKj2o.js} +1 -1
- package/dist/assets/{ChoiceControls-Dd_bVqHH.js → ChoiceControls-BCF1vPaa.js} +1 -1
- package/dist/assets/{Companies-DK47FHh_.js → Companies-gUbW68nN.js} +1 -1
- package/dist/assets/{CompanyAccess-G_ygWCdy.js → CompanyAccess-C0cDvj8M.js} +1 -1
- package/dist/assets/{CompanyActivity-BzF5S-ak.js → CompanyActivity-CbIPKv4K.js} +1 -1
- package/dist/assets/{CompanyConnections-V6QokJbP.js → CompanyConnections-BezhEQiP.js} +1 -1
- package/dist/assets/{CompanyEnvironments-Dtsf3CLS.js → CompanyEnvironments-6-P8NN3Q.js} +1 -1
- package/dist/assets/{CompanyExport-CMPWrtnT.js → CompanyExport-UdhY3JMr.js} +1 -1
- package/dist/assets/{CompanyImport-1brk-ZPP.js → CompanyImport-Dj5G-Ci_.js} +1 -1
- package/dist/assets/{CompanySettings-DXs4duFl.js → CompanySettings-ifpz0tmL.js} +1 -1
- package/dist/assets/{CompanySettingsPluginPage-C2DZeyFu.js → CompanySettingsPluginPage-BCK7KaI1.js} +1 -1
- package/dist/assets/{CompanySkills-BE6s5mI1.js → CompanySkills-mzA6IM7-.js} +1 -1
- package/dist/assets/{ConfigureBuiltInAgentModal-7wvPpeNM.js → ConfigureBuiltInAgentModal-DsiGg71e.js} +1 -1
- package/dist/assets/{CopyableGatewayUrl-i8-LiYxQ.js → CopyableGatewayUrl-DwtHLPUd.js} +1 -1
- package/dist/assets/{Dashboard-CU-kG6C4.js → Dashboard-CHGehxNs.js} +1 -1
- package/dist/assets/{DecisionDateChips-BhvEmkt1.js → DecisionDateChips-Ce1EP_35.js} +1 -1
- package/dist/assets/{DecisionQueuePage-CBULv6cY.js → DecisionQueuePage-B55ERukD.js} +1 -1
- package/dist/assets/{DesignGuide-BwncU-wB.js → DesignGuide-CoW-4sZp.js} +1 -1
- package/dist/assets/{EmailEndpointSetup-BPf_8pC0.js → EmailEndpointSetup-Q4I-LgnZ.js} +1 -1
- package/dist/assets/{ExecutionWorkspaceDetail-CqvRHX5r.js → ExecutionWorkspaceDetail-_LuHtfta.js} +1 -1
- package/dist/assets/{GatewayDetail-Br82oQib.js → GatewayDetail-BKCHLhcu.js} +1 -1
- package/dist/assets/{GatewaysList-kBD3cwdU.js → GatewaysList-CZ-_zFD_.js} +1 -1
- package/dist/assets/{GoalDetail-BFeUPzal.js → GoalDetail-Bd04vnyA.js} +1 -1
- package/dist/assets/{GoalTree-CaQSt6o5.js → GoalTree-DtvAb581.js} +1 -1
- package/dist/assets/{Goals-CnYUdXEo.js → Goals-BXW_WXNa.js} +1 -1
- package/dist/assets/{ImageGalleryModal-QrZd2HrQ.js → ImageGalleryModal-xeIIyU7g.js} +1 -1
- package/dist/assets/{Inbox-C6bCCEH6.js → Inbox-DmxWV98u.js} +1 -1
- package/dist/assets/{InstanceAdvanced-CTjlJp69.js → InstanceAdvanced-DMrEvjyY.js} +1 -1
- package/dist/assets/{InviteLanding-C65R08_E.js → InviteLanding-C-S7p6JM.js} +1 -1
- package/dist/assets/{IssueChatLongThreadPerf-mdn5NFzU.js → IssueChatLongThreadPerf-BWbJprSQ.js} +1 -1
- package/dist/assets/{IssueChatThread-CZ9Q-xq-.js → IssueChatThread-DmAyIOuN.js} +1 -1
- package/dist/assets/{IssueDetail-svM2GGnk.js → IssueDetail-issXYSBj.js} +1 -1
- package/dist/assets/{IssueOutputSection-Du3C5TFv.js → IssueOutputSection-BioA9Nux.js} +1 -1
- package/dist/assets/{IssueRecoveryActionCard-Bq2QDhQA.js → IssueRecoveryActionCard-CGWmkRkb.js} +1 -1
- package/dist/assets/{IssueReferencePill-Cnjk1Ugc.js → IssueReferencePill-DWL74G_c.js} +1 -1
- package/dist/assets/{IssueThreadInteractionCard-CAzrNSjO.js → IssueThreadInteractionCard-bP4n_lcw.js} +1 -1
- package/dist/assets/{Issues-D97SDuYL.js → Issues-ButYwujh.js} +1 -1
- package/dist/assets/{LiveNowTodoLine-Cq1ub6Gj.js → LiveNowTodoLine-CiCmi71g.js} +1 -1
- package/dist/assets/{ManagedAiConnectionDetails-COyNN_aD.js → ManagedAiConnectionDetails-CgCv2fqy.js} +1 -1
- package/dist/assets/{McpConnect-CYsPUSYV.js → McpConnect-CeT7gUW_.js} +1 -1
- package/dist/assets/{MembershipAction-DYMy7umB.js → MembershipAction-BX9XIExA.js} +1 -1
- package/dist/assets/{ModelsAndProviders-BJaNzbhV.js → ModelsAndProviders-SEGB5DIt.js} +1 -1
- package/dist/assets/{NewAgent-DGXol110.js → NewAgent-LKqNzfsM.js} +1 -1
- package/dist/assets/{OmpAllSettings-BvYkLMhp.js → OmpAllSettings-1aXWEp6h.js} +1 -1
- package/dist/assets/{PipelineSettings-B6Am-LrO.js → PipelineSettings-UFCz50OY.js} +1 -1
- package/dist/assets/{Pipelines-MgjAhzew.js → Pipelines-n5EQOzN2.js} +1 -1
- package/dist/assets/{PixelsOffice-DnBnPerp.js → PixelsOffice-De61dU2s.js} +1 -1
- package/dist/assets/{PluginPage-C1XADFT2.js → PluginPage-CBSnEw7x.js} +1 -1
- package/dist/assets/{PluginSettings-CapWiXsO.js → PluginSettings-D2pNKDKr.js} +1 -1
- package/dist/assets/{ProfileDetailRoute-PJCQrW25.js → ProfileDetailRoute-DCbTvhPd.js} +1 -1
- package/dist/assets/{ProfileSettings-DXbA8GQP.js → ProfileSettings-BUYIctBS.js} +1 -1
- package/dist/assets/{ProfileWizardRoute-DaZPFglw.js → ProfileWizardRoute-o4Kf_DhP.js} +1 -1
- package/dist/assets/{ProjectDetail-DQxMbc1Q.js → ProjectDetail-DOF0t71W.js} +1 -1
- package/dist/assets/{ProjectWorkspaceDetail-dA3zVCbf.js → ProjectWorkspaceDetail-BEbFq9oK.js} +1 -1
- package/dist/assets/{ProjectWorkspacesContent-DnzUTFfW.js → ProjectWorkspacesContent-DwVqtur5.js} +1 -1
- package/dist/assets/{Projects-D3ZC8FJk.js → Projects-BsZYs3Fo.js} +1 -1
- package/dist/assets/{PublicIssueSharePage-BtWc4gq4.js → PublicIssueSharePage-8uOICn1V.js} +1 -1
- package/dist/assets/{ReviewQueueCard-C9YVH9hi.js → ReviewQueueCard-rQxgVMx_.js} +1 -1
- package/dist/assets/{RichWorkProductCard-CJPI3xQY.js → RichWorkProductCard-FcmQ5fHH.js} +1 -1
- package/dist/assets/{RoutineDetail-DUZXGXpv.js → RoutineDetail-DWqy00zc.js} +1 -1
- package/dist/assets/{RoutineRunVariablesDialog-CQJpihoC.js → RoutineRunVariablesDialog-DaGovqJt.js} +1 -1
- package/dist/assets/{Routines-CZMUFOH1.js → Routines-BE2PduWG.js} +1 -1
- package/dist/assets/{ScrollToBottom-wVHhI6vr.js → ScrollToBottom-DiemLpd4.js} +1 -1
- package/dist/assets/{Search-8efHT3Mn.js → Search-B_dblFtf.js} +1 -1
- package/dist/assets/{Secrets-BZCIDLKj.js → Secrets-D8ZlRoVo.js} +1 -1
- package/dist/assets/{SkillSourceTree-D31jixpq.js → SkillSourceTree-CDK_UwP7.js} +1 -1
- package/dist/assets/{SkillSources-Bn1LRP0O.js → SkillSources-C8inxmWw.js} +1 -1
- package/dist/assets/{SkillStudio-C4o17_hm.js → SkillStudio-8S7xrus7.js} +1 -1
- package/dist/assets/{SourceTrustBadge-C0F4cAmH.js → SourceTrustBadge-DTVyCj4T.js} +1 -1
- package/dist/assets/{StatusCards-BIvnBXBN.js → StatusCards-BpujcoJb.js} +1 -1
- package/dist/assets/{SummarySlotCard-Bpu8HBIR.js → SummarySlotCard-CTolnfbx.js} +1 -1
- package/dist/assets/{TaskChatLab-DAEcgWdy.js → TaskChatLab-BfJcSULz.js} +1 -1
- package/dist/assets/{TaskChatMarker-Bbn6iq01.js → TaskChatMarker-BYJIRrTg.js} +1 -1
- package/dist/assets/{TaskChatProtocolCard-wllJ9P2o.js → TaskChatProtocolCard-DTsBzh1L.js} +1 -1
- package/dist/assets/{TaskChatThreadView-Bnyakc3A.js → TaskChatThreadView-CBwEERny.js} +1 -1
- package/dist/assets/{TaskTreeControls-BFz5K7U-.js → TaskTreeControls-BzPeXKPq.js} +1 -1
- package/dist/assets/{Terminal-DGUlqBL9.js → Terminal-DGY0GEez.js} +1 -1
- package/dist/assets/{TerminalView-Cz01H-I5.js → TerminalView-CZkTSDKg.js} +1 -1
- package/dist/assets/{TrustPresetSection-lyB0V8c9.js → TrustPresetSection-DeIvlixJ.js} +1 -1
- package/dist/assets/{UserProfile-5qgIbXdf.js → UserProfile-BkcJ9Wfx.js} +1 -1
- package/dist/assets/{WhatNeedsMe-DjxO39CR.js → WhatNeedsMe-Bg72QkYe.js} +1 -1
- package/dist/assets/{Workspaces-BzTr5cqx.js → Workspaces-BeS2M4CD.js} +1 -1
- package/dist/assets/{connection-owner-EECE9Eiz.js → connection-owner-qWfs2q4d.js} +1 -1
- package/dist/assets/{index-DbENFODe.js → index-CSIXA5y5.js} +3 -3
- package/dist/assets/{issue-properties-BmOIUOmd.js → issue-properties-D3qASSPI.js} +1 -1
- package/dist/assets/{issue-workspace-selection-CIvSmFv2.js → issue-workspace-selection-sfcpgxzV.js} +1 -1
- package/dist/assets/{pipeline-stage-presentation-DoJvVCJ3.js → pipeline-stage-presentation-C9WooPFB.js} +1 -1
- package/dist/assets/{shared-BMQlB2gM.js → shared-57amdu2f.js} +1 -1
- package/dist/assets/{transcript-adapter-DDVisW9K.js → transcript-adapter-D7nXUOr3.js} +1 -1
- package/dist/assets/{useSummaryDraftStream-BNKrqAT0.js → useSummaryDraftStream-1H3w75Dm.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/sw.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var ct=Object.defineProperty;var o=(t,i)=>ct(t,"name",{value:i,configurable:!0});import{i as Ge}from"./rolldown-runtime-ZpX3ckPj.js";import{en as dt,h as ut,l as w,na as mt,t as pt,ta as ft}from"./createLucideIcon-B-uEJvX6.js";import{a as ht}from"./star-BXywPGTx.js";import{X as xt,d as gt,t as P,u as bt,v as ae}from"./queryKeys-yuC-YxZI.js";import{n as Xe}from"./CompanyContext-DDgccGSs.js";import{M as yt,on as Ye,q as vt,t as wt,tt as kt,zt as fe}from"./router-2HX_SyKK.js";import{c as jt,n as Nt,o as _t,p as It,r as Tt,s as Ct,t as St}from"./dropdown-menu-BdCU_bAX.js";import{t as At}from"./activity-BwjvcZxv.js";import{t as Et}from"./arrow-down-DEeYvDSD.js";import{t as Mt}from"./check-DtcbYVEc.js";import{t as Rt}from"./chevron-down-B_rMrTLq.js";import{t as Dt}from"./chevron-right-DDmPvaMb.js";import{t as zt}from"./circle-alert-IYSLYJUJ.js";import{t as $t}from"./circle-slash-CW8QpI4G.js";import{t as _e}from"./MarkdownBody-B_U4yj24.js";import{t as Ft}from"./package-CtAS5cQ_.js";import{t as qt}from"./file-text-Bsh0mVGb.js";import{t as Ot}from"./list-filter-Ral9WsjH.js";import{r as he,t as de}from"./button-D3bYvq4T.js";import{t as Lt}from"./log-in-v9DKL1c0.js";import{t as Pt}from"./message-square-plus-DfHcFdyP.js";import{t as Bt}from"./send-DeeMT_AN.js";import{t as ye}from"./settings-BCLiRXsG.js";import{t as Kt}from"./triangle-alert-Cpo2fj-L.js";import{t as Je}from"./user-D82a7TR4.js";import{t as Ht}from"./MootMark-JzjkztPD.js";import{i as ve,n as we,t as ke}from"./tooltip-CBtM5Ru1.js";import{t as Me}from"./AgentAvatar-B4hORIPc.js";import{t as Ze}from"./agents-DjsXf9UL.js";import{n as Ut,t as Wt}from"./useSharedPolling-C9W19bSA.js";import{t as Vt}from"./activity-BD29TjTr.js";import{n as Qt}from"./BreadcrumbContext-_dNLeVnD.js";import{t as Ke}from"./attachment-icon-ML6IBayL.js";import{t as Gt}from"./card-CtkberpO.js";import{Ca as Xt,Ha as Yt,On as Jt,Ra as Zt,io as es,ka as ts,lt as ss,ro as rs}from"./index-DbENFODe.js";import{r as as,t as ns}from"./AgentBubbleActionRow-DkXjmbLK.js";import{c as is,r as os,t as ls}from"./sheet-_2ap0Qlb.js";var et={name:"pencil-line",size:24,node:[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]};et.node;var cs=pt(et),r=Ge(mt(),1),e=Ge(ft(),1);function Se(t){return typeof t=="string"?t.replace(/_/g," "):String(t??"")}o(Se,"humanize");function ds(t,i,d="chronological"){switch(t){case"issue.created":return"opened";case"issue.updated":{const c=i?.status;if(c==="in_review"&&i?.externalConversationState==="waiting")return"moved to idle";if(typeof c=="string")return`moved to ${Se(c)}`;const p=i?.priority;return typeof p=="string"?`set priority to ${Se(p)} on`:"updated"}case"issue.document_created":return"wrote doc on";case"issue.document_updated":return"edited doc on";case"issue.document_deleted":return"deleted doc from";case"issue.work_product_created":return"delivered work on";case"issue.work_product_updated":return"updated work on";case"issue.work_product_deleted":return"removed work from";case"issue.checked_out":return"picked up";case"issue.released":return"released";case"issue.commented":case"issue.comment_added":return"commented on";case"issue.attachment_added":return"attached a file to";case"issue.attachment_removed":return"removed attachment from";case"issue.deleted":return"deleted";case"approval.created":return d==="pinned"?"needs approval on":"requested approval on";case"approval.approved":return"approved";case"approval.rejected":return"rejected";case"approval.revision_requested":return"requested changes on";case"agent.created":return d==="pinned"?"wants to hire":"hired";case"agent.paused":return"paused";case"agent.resumed":return"resumed";case"agent.updated":return"updated";case"agent.terminated":return"terminated";case"heartbeat.invoked":return"started a run on";case"heartbeat.cancelled":return"cancelled a run on";case"project.created":return"created project";case"project.updated":return"updated project";case"project.deleted":return"deleted project";case"goal.created":return"created goal";case"goal.updated":return"updated goal";case"goal.deleted":return"deleted goal";case"company.created":return"created organization";case"company.updated":return"updated organization";case"company.archived":return"archived organization";case"company.budget_updated":return"updated organization budget";default:return t.replace(/[._]/g," ")}}o(ds,"formatVerb");function us(t,i){switch(t){case"issue.created":return"todo";case"issue.updated":{const d=i?.status;return d==="in_review"&&i?.externalConversationState==="waiting"?"idle":typeof d=="string"?d:null}case"issue.document_created":case"issue.document_updated":return"in_progress";case"issue.work_product_created":return"in_review";case"approval.created":return"in_review";case"approval.approved":return"done";case"approval.rejected":case"approval.revision_requested":return"blocked";default:return null}}o(us,"deriveTaskStatus");function ms(t,i,d){const c=t.action;if(c.startsWith("heartbeat."))return d&&c==="heartbeat.invoked"?{kind:"lucide",Icon:he,color:"text-blue-600 dark:text-blue-400",spin:!0}:{kind:"lucide",Icon:he,color:"text-ink-3"};switch(c){case"approval.created":return{kind:"lucide",Icon:zt,color:"text-amber-600 dark:text-amber-400"};case"approval.approved":return{kind:"lucide",Icon:ht,color:"text-green-600 dark:text-green-400"};case"approval.rejected":return{kind:"lucide",Icon:$t,color:"text-red-600 dark:text-red-400"};case"approval.revision_requested":return{kind:"lucide",Icon:cs,color:"text-amber-600 dark:text-amber-400",filled:!0}}switch(c){case"agent.created":return{kind:"lucide",Icon:ts,color:"text-purple-600 dark:text-purple-400"};case"agent.paused":return{kind:"lucide",Icon:es,color:"text-ink-3"};case"agent.resumed":return{kind:"lucide",Icon:rs,color:"text-ink-3"};case"agent.updated":case"agent.terminated":return{kind:"lucide",Icon:ye,color:"text-ink-3"}}return c==="issue.document_created"||c==="issue.document_updated"?{kind:"lucide",Icon:qt,color:"text-blue-600 dark:text-blue-400"}:c.startsWith("issue.work_product_")?{kind:"lucide",Icon:Ft,color:"text-indigo-600 dark:text-indigo-400"}:c==="issue.commented"||c==="issue.comment_added"?{kind:"lucide",Icon:Yt,color:"text-ink-3"}:c==="issue.checked_out"?{kind:"lucide",Icon:Lt,color:"text-ink-3"}:t.entityType==="issue"?{kind:"status-circle",status:us(c,i)??"backlog"}:t.entityType==="goal"?{kind:"lucide",Icon:vt,color:"text-ink-3"}:{kind:"lucide",Icon:ye,color:"text-ink-3"}}o(ms,"getIconSpec");function ps({status:t}){const i=yt[t]??"text-ink-3 border-ink-3",d=t==="done";return(0,e.jsx)("span",{className:w("relative inline-flex h-4 w-4 shrink-0 rounded-full border-2",i),children:d&&(0,e.jsx)("span",{className:"absolute inset-0 m-auto h-2 w-2 rounded-full bg-current"})})}o(ps,"StatusCircle");function fs({spec:t}){if(t.kind==="status-circle")return(0,e.jsx)(ps,{status:t.status});const{Icon:i,color:d,filled:c,spin:p}=t;return(0,e.jsx)(i,{className:w("h-4 w-4 shrink-0",d,p&&"animate-spin"),fill:c?"currentColor":"none",strokeWidth:c?1.5:2})}o(fs,"EntityIcon");function hs(t,i,d,c){const p=t.details,h=t.actorType==="agent"?i.get(t.actorId)??null:null,b=h?.name??(t.actorType==="system"?"System":t.actorType==="user"?"Board":t.actorId||"Unknown"),S=c?.get(`${t.entityType}:${t.entityId}`)??null,g=t.entityType==="heartbeat_run",m=g?p?.agentId:void 0,f=g?m?d.get(`agent:${m}`)??null:null:d.get(`${t.entityType}:${t.entityId}`)??null,B=p?.key,A=t.action==="issue.document_created"||t.action==="issue.document_updated",E=f??t.entityId,$=p?.hiredAgentId,F=p?.requestedByAgentId,T=F?i.get(F)?.name??null:null,q=p?.type,k=g&&m?`/agents/${m}/runs/${t.entityId}`:t.entityType==="issue"?A&&B?`/issues/${E}#document-${encodeURIComponent(B)}`:`/issues/${E}`:t.entityType==="agent"?`/agents/${t.entityId}`:t.entityType==="approval"?t.action==="approval.approved"&&$?`/agents/${$}`:`/approvals/${t.entityId}`:t.entityType==="project"?`/projects/${dt(f,t.entityId)}`:t.entityType==="goal"?`/goals/${t.entityId}`:null;let y=null,j=!0,I=null;return t.entityType==="issue"?(y=f,I=S):t.entityType==="approval"?(T?y=T:(y=q?Se(q):"approval",j=!1),I=S):t.entityType==="agent"?(y=p?.name??f??t.entityId,I=null):g?(y=f,I=null):(y=f,I=S),{actorName:b,actorType:t.actorType,actor:h,identifier:y,identifierMono:j,title:I,link:k}}o(hs,"resolveContent");function xs({content:t}){return t.actorType==="agent"?(0,e.jsx)(Me,{agent:t.actor,size:16,className:"h-3.5 w-3.5 shrink-0 text-ink-3"}):t.actorType==="user"?(0,e.jsx)(Je,{className:"h-3.5 w-3.5 shrink-0 text-ink-3"}):(0,e.jsx)(ye,{className:"h-3.5 w-3.5 shrink-0 text-ink-3"})}o(xs,"ActorGlyph");function Ae({event:t,agentMap:i,entityNameMap:d,entityTitleMap:c,isActive:p=!1,isMuted:h=!1,isPinned:b=!1,className:S}){const g=t.details,m=hs(t,i,d,c),f=ds(t.action,g,b?"pinned":"chronological"),B=ms(t,g,p),A=h?"text-ink-3/70":"text-(--hex-959596)",E=h?"":"group-hover:text-white",$=(0,e.jsxs)(Gt,{"data-fc":"card",className:w("flex-row group ml-3 mr-3 md:ml-0 my-2 w-(--sz-calc-1) md:w-(--sz-calc-2) items-center gap-2 p-(--sz-18px) text-xs","transition-(--tp-background-color-border-color) duration-150",m.link&&"cursor-pointer hover:bg-bg-3 hover:border-ink-3/30",S),children:[(0,e.jsx)(fs,{spec:B}),(0,e.jsx)(xs,{content:m}),(0,e.jsxs)("span",{className:"flex min-w-0 flex-1 items-baseline gap-1 truncate",children:[(0,e.jsx)("span",{"data-fc":"actor",className:w("font-medium",A,E),children:m.actorName}),(0,e.jsx)("span",{"data-fc":"verb",className:A,children:f}),m.identifier&&(0,e.jsx)("span",{"data-fc":"id",className:w(m.identifierMono&&"font-mono",A,E),children:m.identifier}),m.title&&(0,e.jsx)("span",{"data-fc":"title",className:w("truncate",A,E),children:m.title})]}),b&&(0,e.jsx)("span",{className:"shrink-0 text-xs text-ink-3",children:"Review →"}),(0,e.jsx)("span",{"data-fc":"time",className:"shrink-0 text-ink-3",children:Ye(t.createdAt)})]});return m.link?(0,e.jsx)(wt,{to:m.link,"data-fc":"link",className:"block w-full no-underline text-inherit",issueQuicklookSide:"left",children:$}):$}o(Ae,"FeedCard");var gs={"issue.created":1,"issue.document_created":1,"approval.created":1,"approval.approved":1,"approval.rejected":1,"approval.revision_requested":1,"agent.created":1,"issue.work_product_created":1,"issue.updated":2,"issue.work_product_updated":2,"issue.work_product_deleted":2,"issue.checked_out":2,"issue.comment_added":2,"issue.commented":2,"heartbeat.invoked":2,"heartbeat.cancelled":2,"agent.paused":2,"agent.resumed":2,"agent.updated":2,"issue.read_marked":3,"issue.read_unmarked":3,"issue.inbox_archived":3,"issue.inbox_unarchived":3,"issue.released":3,"issue.attachment_added":3,"issue.attachment_removed":3,"issue.document_deleted":3,"issue.document_updated":2,"issue.deleted":3,"issue.feedback_vote_saved":3,"agent.key_created":3,"agent.budget_updated":3,"agent.runtime_session_reset":3,"agent.skills_synced":3,"agent.terminated":2,"approval.requester_wakeup_queued":3,"approval.requester_wakeup_failed":3,"company.created":3,"company.updated":3,"company.archived":3,"company.budget_updated":3,"company.skill_created":3,"company.skill_deleted":3,"project.created":2,"project.updated":3,"project.deleted":3,"goal.created":2,"goal.updated":3,"goal.deleted":3,"cost.reported":3,"cost.recorded":3};function Ee(t){return t.action==="issue.updated"&&t.details&&t.details.status==="in_review"?1:gs[t.action]??3}o(Ee,"getEventTier");var bs=[{value:"all",label:"All"},{value:"in-progress",label:"In Progress"},{value:"for-review",label:"In Review"},{value:"completed",label:"Done"}],ys={all:null,"in-progress":new Set(["issue.created","issue.checked_out","heartbeat.invoked"]),"for-review":new Set(["approval.created","issue.document_created","issue.document_updated"]),completed:new Set(["approval.approved"])},vs={all:null,"in-progress":new Set(["in_progress"]),"for-review":new Set(["in_review"]),completed:new Set(["done"])};function ws(t,i){if(i==="all"||ys[i]?.has(t.action))return!0;if(t.action==="issue.updated"&&t.details){const d=vs[i],c=t.details;if(d&&typeof c.status=="string"&&d.has(c.status))return!0}return!1}o(ws,"matchesFilter");var ks=3e5;function js(t){if(t.length===0)return[];const i=[];let d=[t[0]],c=`${t[0].entityType}:${t[0].entityId}`;for(let p=1;p<t.length;p++){const h=t[p],b=`${h.entityType}:${h.entityId}`,S=new Date(d[d.length-1].createdAt).getTime(),g=new Date(h.createdAt).getTime(),m=Math.abs(S-g)<=ks,f=Ee(h);b===c&&m&&f>=2?d.push(h):(He(d,i),d=[h],c=b)}return He(d,i),i}o(js,"collapseSequential");function He(t,i){if(t.length<=2)for(const d of t)i.push(d);else i.push({type:"collapsed",events:t,entityId:t[0].entityId,entityType:t[0].entityType,latestEvent:t[0]})}o(He,"flushGroup");var Ns=3e5;function Ie(t){return Date.now()-new Date(t).getTime()<Ns}o(Ie,"isRecent");var _s=`
|
|
1
|
+
var ct=Object.defineProperty;var o=(t,i)=>ct(t,"name",{value:i,configurable:!0});import{i as Ge}from"./rolldown-runtime-ZpX3ckPj.js";import{en as dt,h as ut,l as w,na as mt,t as pt,ta as ft}from"./createLucideIcon-B-uEJvX6.js";import{a as ht}from"./star-BXywPGTx.js";import{X as xt,d as gt,t as P,u as bt,v as ae}from"./queryKeys-yuC-YxZI.js";import{n as Xe}from"./CompanyContext-DDgccGSs.js";import{M as yt,on as Ye,q as vt,t as wt,tt as kt,zt as fe}from"./router-2HX_SyKK.js";import{c as jt,n as Nt,o as _t,p as It,r as Tt,s as Ct,t as St}from"./dropdown-menu-BdCU_bAX.js";import{t as At}from"./activity-BwjvcZxv.js";import{t as Et}from"./arrow-down-DEeYvDSD.js";import{t as Mt}from"./check-DtcbYVEc.js";import{t as Rt}from"./chevron-down-B_rMrTLq.js";import{t as Dt}from"./chevron-right-DDmPvaMb.js";import{t as zt}from"./circle-alert-IYSLYJUJ.js";import{t as $t}from"./circle-slash-CW8QpI4G.js";import{t as _e}from"./MarkdownBody-B_U4yj24.js";import{t as Ft}from"./package-CtAS5cQ_.js";import{t as qt}from"./file-text-Bsh0mVGb.js";import{t as Ot}from"./list-filter-Ral9WsjH.js";import{r as he,t as de}from"./button-D3bYvq4T.js";import{t as Lt}from"./log-in-v9DKL1c0.js";import{t as Pt}from"./message-square-plus-DfHcFdyP.js";import{t as Bt}from"./send-DeeMT_AN.js";import{t as ye}from"./settings-BCLiRXsG.js";import{t as Kt}from"./triangle-alert-Cpo2fj-L.js";import{t as Je}from"./user-D82a7TR4.js";import{t as Ht}from"./MootMark-JzjkztPD.js";import{i as ve,n as we,t as ke}from"./tooltip-CBtM5Ru1.js";import{t as Me}from"./AgentAvatar-B4hORIPc.js";import{t as Ze}from"./agents-DjsXf9UL.js";import{n as Ut,t as Wt}from"./useSharedPolling-C9W19bSA.js";import{t as Vt}from"./activity-BD29TjTr.js";import{n as Qt}from"./BreadcrumbContext-_dNLeVnD.js";import{t as Ke}from"./attachment-icon-ML6IBayL.js";import{t as Gt}from"./card-CtkberpO.js";import{Ca as Xt,Ha as Yt,On as Jt,Ra as Zt,io as es,ka as ts,lt as ss,ro as rs}from"./index-CSIXA5y5.js";import{r as as,t as ns}from"./AgentBubbleActionRow-DkXjmbLK.js";import{c as is,r as os,t as ls}from"./sheet-_2ap0Qlb.js";var et={name:"pencil-line",size:24,node:[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]};et.node;var cs=pt(et),r=Ge(mt(),1),e=Ge(ft(),1);function Se(t){return typeof t=="string"?t.replace(/_/g," "):String(t??"")}o(Se,"humanize");function ds(t,i,d="chronological"){switch(t){case"issue.created":return"opened";case"issue.updated":{const c=i?.status;if(c==="in_review"&&i?.externalConversationState==="waiting")return"moved to idle";if(typeof c=="string")return`moved to ${Se(c)}`;const p=i?.priority;return typeof p=="string"?`set priority to ${Se(p)} on`:"updated"}case"issue.document_created":return"wrote doc on";case"issue.document_updated":return"edited doc on";case"issue.document_deleted":return"deleted doc from";case"issue.work_product_created":return"delivered work on";case"issue.work_product_updated":return"updated work on";case"issue.work_product_deleted":return"removed work from";case"issue.checked_out":return"picked up";case"issue.released":return"released";case"issue.commented":case"issue.comment_added":return"commented on";case"issue.attachment_added":return"attached a file to";case"issue.attachment_removed":return"removed attachment from";case"issue.deleted":return"deleted";case"approval.created":return d==="pinned"?"needs approval on":"requested approval on";case"approval.approved":return"approved";case"approval.rejected":return"rejected";case"approval.revision_requested":return"requested changes on";case"agent.created":return d==="pinned"?"wants to hire":"hired";case"agent.paused":return"paused";case"agent.resumed":return"resumed";case"agent.updated":return"updated";case"agent.terminated":return"terminated";case"heartbeat.invoked":return"started a run on";case"heartbeat.cancelled":return"cancelled a run on";case"project.created":return"created project";case"project.updated":return"updated project";case"project.deleted":return"deleted project";case"goal.created":return"created goal";case"goal.updated":return"updated goal";case"goal.deleted":return"deleted goal";case"company.created":return"created organization";case"company.updated":return"updated organization";case"company.archived":return"archived organization";case"company.budget_updated":return"updated organization budget";default:return t.replace(/[._]/g," ")}}o(ds,"formatVerb");function us(t,i){switch(t){case"issue.created":return"todo";case"issue.updated":{const d=i?.status;return d==="in_review"&&i?.externalConversationState==="waiting"?"idle":typeof d=="string"?d:null}case"issue.document_created":case"issue.document_updated":return"in_progress";case"issue.work_product_created":return"in_review";case"approval.created":return"in_review";case"approval.approved":return"done";case"approval.rejected":case"approval.revision_requested":return"blocked";default:return null}}o(us,"deriveTaskStatus");function ms(t,i,d){const c=t.action;if(c.startsWith("heartbeat."))return d&&c==="heartbeat.invoked"?{kind:"lucide",Icon:he,color:"text-blue-600 dark:text-blue-400",spin:!0}:{kind:"lucide",Icon:he,color:"text-ink-3"};switch(c){case"approval.created":return{kind:"lucide",Icon:zt,color:"text-amber-600 dark:text-amber-400"};case"approval.approved":return{kind:"lucide",Icon:ht,color:"text-green-600 dark:text-green-400"};case"approval.rejected":return{kind:"lucide",Icon:$t,color:"text-red-600 dark:text-red-400"};case"approval.revision_requested":return{kind:"lucide",Icon:cs,color:"text-amber-600 dark:text-amber-400",filled:!0}}switch(c){case"agent.created":return{kind:"lucide",Icon:ts,color:"text-purple-600 dark:text-purple-400"};case"agent.paused":return{kind:"lucide",Icon:es,color:"text-ink-3"};case"agent.resumed":return{kind:"lucide",Icon:rs,color:"text-ink-3"};case"agent.updated":case"agent.terminated":return{kind:"lucide",Icon:ye,color:"text-ink-3"}}return c==="issue.document_created"||c==="issue.document_updated"?{kind:"lucide",Icon:qt,color:"text-blue-600 dark:text-blue-400"}:c.startsWith("issue.work_product_")?{kind:"lucide",Icon:Ft,color:"text-indigo-600 dark:text-indigo-400"}:c==="issue.commented"||c==="issue.comment_added"?{kind:"lucide",Icon:Yt,color:"text-ink-3"}:c==="issue.checked_out"?{kind:"lucide",Icon:Lt,color:"text-ink-3"}:t.entityType==="issue"?{kind:"status-circle",status:us(c,i)??"backlog"}:t.entityType==="goal"?{kind:"lucide",Icon:vt,color:"text-ink-3"}:{kind:"lucide",Icon:ye,color:"text-ink-3"}}o(ms,"getIconSpec");function ps({status:t}){const i=yt[t]??"text-ink-3 border-ink-3",d=t==="done";return(0,e.jsx)("span",{className:w("relative inline-flex h-4 w-4 shrink-0 rounded-full border-2",i),children:d&&(0,e.jsx)("span",{className:"absolute inset-0 m-auto h-2 w-2 rounded-full bg-current"})})}o(ps,"StatusCircle");function fs({spec:t}){if(t.kind==="status-circle")return(0,e.jsx)(ps,{status:t.status});const{Icon:i,color:d,filled:c,spin:p}=t;return(0,e.jsx)(i,{className:w("h-4 w-4 shrink-0",d,p&&"animate-spin"),fill:c?"currentColor":"none",strokeWidth:c?1.5:2})}o(fs,"EntityIcon");function hs(t,i,d,c){const p=t.details,h=t.actorType==="agent"?i.get(t.actorId)??null:null,b=h?.name??(t.actorType==="system"?"System":t.actorType==="user"?"Board":t.actorId||"Unknown"),S=c?.get(`${t.entityType}:${t.entityId}`)??null,g=t.entityType==="heartbeat_run",m=g?p?.agentId:void 0,f=g?m?d.get(`agent:${m}`)??null:null:d.get(`${t.entityType}:${t.entityId}`)??null,B=p?.key,A=t.action==="issue.document_created"||t.action==="issue.document_updated",E=f??t.entityId,$=p?.hiredAgentId,F=p?.requestedByAgentId,T=F?i.get(F)?.name??null:null,q=p?.type,k=g&&m?`/agents/${m}/runs/${t.entityId}`:t.entityType==="issue"?A&&B?`/issues/${E}#document-${encodeURIComponent(B)}`:`/issues/${E}`:t.entityType==="agent"?`/agents/${t.entityId}`:t.entityType==="approval"?t.action==="approval.approved"&&$?`/agents/${$}`:`/approvals/${t.entityId}`:t.entityType==="project"?`/projects/${dt(f,t.entityId)}`:t.entityType==="goal"?`/goals/${t.entityId}`:null;let y=null,j=!0,I=null;return t.entityType==="issue"?(y=f,I=S):t.entityType==="approval"?(T?y=T:(y=q?Se(q):"approval",j=!1),I=S):t.entityType==="agent"?(y=p?.name??f??t.entityId,I=null):g?(y=f,I=null):(y=f,I=S),{actorName:b,actorType:t.actorType,actor:h,identifier:y,identifierMono:j,title:I,link:k}}o(hs,"resolveContent");function xs({content:t}){return t.actorType==="agent"?(0,e.jsx)(Me,{agent:t.actor,size:16,className:"h-3.5 w-3.5 shrink-0 text-ink-3"}):t.actorType==="user"?(0,e.jsx)(Je,{className:"h-3.5 w-3.5 shrink-0 text-ink-3"}):(0,e.jsx)(ye,{className:"h-3.5 w-3.5 shrink-0 text-ink-3"})}o(xs,"ActorGlyph");function Ae({event:t,agentMap:i,entityNameMap:d,entityTitleMap:c,isActive:p=!1,isMuted:h=!1,isPinned:b=!1,className:S}){const g=t.details,m=hs(t,i,d,c),f=ds(t.action,g,b?"pinned":"chronological"),B=ms(t,g,p),A=h?"text-ink-3/70":"text-(--hex-959596)",E=h?"":"group-hover:text-white",$=(0,e.jsxs)(Gt,{"data-fc":"card",className:w("flex-row group ml-3 mr-3 md:ml-0 my-2 w-(--sz-calc-1) md:w-(--sz-calc-2) items-center gap-2 p-(--sz-18px) text-xs","transition-(--tp-background-color-border-color) duration-150",m.link&&"cursor-pointer hover:bg-bg-3 hover:border-ink-3/30",S),children:[(0,e.jsx)(fs,{spec:B}),(0,e.jsx)(xs,{content:m}),(0,e.jsxs)("span",{className:"flex min-w-0 flex-1 items-baseline gap-1 truncate",children:[(0,e.jsx)("span",{"data-fc":"actor",className:w("font-medium",A,E),children:m.actorName}),(0,e.jsx)("span",{"data-fc":"verb",className:A,children:f}),m.identifier&&(0,e.jsx)("span",{"data-fc":"id",className:w(m.identifierMono&&"font-mono",A,E),children:m.identifier}),m.title&&(0,e.jsx)("span",{"data-fc":"title",className:w("truncate",A,E),children:m.title})]}),b&&(0,e.jsx)("span",{className:"shrink-0 text-xs text-ink-3",children:"Review →"}),(0,e.jsx)("span",{"data-fc":"time",className:"shrink-0 text-ink-3",children:Ye(t.createdAt)})]});return m.link?(0,e.jsx)(wt,{to:m.link,"data-fc":"link",className:"block w-full no-underline text-inherit",issueQuicklookSide:"left",children:$}):$}o(Ae,"FeedCard");var gs={"issue.created":1,"issue.document_created":1,"approval.created":1,"approval.approved":1,"approval.rejected":1,"approval.revision_requested":1,"agent.created":1,"issue.work_product_created":1,"issue.updated":2,"issue.work_product_updated":2,"issue.work_product_deleted":2,"issue.checked_out":2,"issue.comment_added":2,"issue.commented":2,"heartbeat.invoked":2,"heartbeat.cancelled":2,"agent.paused":2,"agent.resumed":2,"agent.updated":2,"issue.read_marked":3,"issue.read_unmarked":3,"issue.inbox_archived":3,"issue.inbox_unarchived":3,"issue.released":3,"issue.attachment_added":3,"issue.attachment_removed":3,"issue.document_deleted":3,"issue.document_updated":2,"issue.deleted":3,"issue.feedback_vote_saved":3,"agent.key_created":3,"agent.budget_updated":3,"agent.runtime_session_reset":3,"agent.skills_synced":3,"agent.terminated":2,"approval.requester_wakeup_queued":3,"approval.requester_wakeup_failed":3,"company.created":3,"company.updated":3,"company.archived":3,"company.budget_updated":3,"company.skill_created":3,"company.skill_deleted":3,"project.created":2,"project.updated":3,"project.deleted":3,"goal.created":2,"goal.updated":3,"goal.deleted":3,"cost.reported":3,"cost.recorded":3};function Ee(t){return t.action==="issue.updated"&&t.details&&t.details.status==="in_review"?1:gs[t.action]??3}o(Ee,"getEventTier");var bs=[{value:"all",label:"All"},{value:"in-progress",label:"In Progress"},{value:"for-review",label:"In Review"},{value:"completed",label:"Done"}],ys={all:null,"in-progress":new Set(["issue.created","issue.checked_out","heartbeat.invoked"]),"for-review":new Set(["approval.created","issue.document_created","issue.document_updated"]),completed:new Set(["approval.approved"])},vs={all:null,"in-progress":new Set(["in_progress"]),"for-review":new Set(["in_review"]),completed:new Set(["done"])};function ws(t,i){if(i==="all"||ys[i]?.has(t.action))return!0;if(t.action==="issue.updated"&&t.details){const d=vs[i],c=t.details;if(d&&typeof c.status=="string"&&d.has(c.status))return!0}return!1}o(ws,"matchesFilter");var ks=3e5;function js(t){if(t.length===0)return[];const i=[];let d=[t[0]],c=`${t[0].entityType}:${t[0].entityId}`;for(let p=1;p<t.length;p++){const h=t[p],b=`${h.entityType}:${h.entityId}`,S=new Date(d[d.length-1].createdAt).getTime(),g=new Date(h.createdAt).getTime(),m=Math.abs(S-g)<=ks,f=Ee(h);b===c&&m&&f>=2?d.push(h):(He(d,i),d=[h],c=b)}return He(d,i),i}o(js,"collapseSequential");function He(t,i){if(t.length<=2)for(const d of t)i.push(d);else i.push({type:"collapsed",events:t,entityId:t[0].entityId,entityType:t[0].entityType,latestEvent:t[0]})}o(He,"flushGroup");var Ns=3e5;function Ie(t){return Date.now()-new Date(t).getTime()<Ns}o(Ie,"isRecent");var _s=`
|
|
2
2
|
@keyframes feed-slide-in {
|
|
3
3
|
from {
|
|
4
4
|
opacity: 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var c=Object.defineProperty;var t=(s,l)=>c(s,"name",{value:l,configurable:!0});import{i as m}from"./rolldown-runtime-ZpX3ckPj.js";import{ta as d}from"./createLucideIcon-B-uEJvX6.js";import{r,t as a}from"./button-D3bYvq4T.js";import{t as o}from"./shield-check-EFhQ8TuB.js";import{t as x}from"./terminal-CPu3HVdk.js";import{t as h}from"./triangle-alert-Cpo2fj-L.js";import{t as p}from"./card-CtkberpO.js";import{Ut as u}from"./index-
|
|
1
|
+
var c=Object.defineProperty;var t=(s,l)=>c(s,"name",{value:l,configurable:!0});import{i as m}from"./rolldown-runtime-ZpX3ckPj.js";import{ta as d}from"./createLucideIcon-B-uEJvX6.js";import{r,t as a}from"./button-D3bYvq4T.js";import{t as o}from"./shield-check-EFhQ8TuB.js";import{t as x}from"./terminal-CPu3HVdk.js";import{t as h}from"./triangle-alert-Cpo2fj-L.js";import{t as p}from"./card-CtkberpO.js";import{Ut as u}from"./index-CSIXA5y5.js";var e=m(d(),1),j={"signed-out-private":"1 · authenticated/private — signed out (browser claim available)","signed-in-private":"2 · authenticated/private — signed in (claim CTA primary)",claiming:"3 · authenticated/private — claim in flight","claim-error":"4 · authenticated/private — claim error (e.g. 409 already claimed)","claim-success":"5 · authenticated/private — claim succeeded, redirect pending","public-invite-only":"6 · authenticated/public — invite-only (no browser claim)"},f=["signed-out-private","signed-in-private","claiming","claim-error","claim-success","public-invite-only"];function n({hasActiveInvite:s}){return(0,e.jsxs)("div",{className:"mt-6 border-t border-line pt-5",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium",children:[(0,e.jsx)(x,{className:"size-4 text-ink-3","aria-hidden":!0}),(0,e.jsx)("span",{children:"Prefer to finish setup from the host?"})]}),(0,e.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:s?"A bootstrap invite is already active. Check your Wardmote startup logs for the first‑admin URL, or run this command on the host to rotate it:":"Run this command on the host that runs Wardmote to print a one‑time first‑admin invite URL:"}),(0,e.jsx)("pre",{className:"mt-3 overflow-x-auto rounded-md border border-line bg-bg-3/30 p-3 font-mono text-xs",children:u})]})}t(n,"CliFallback");function i({children:s}){return(0,e.jsx)("div",{className:"mx-auto max-w-xl py-10",children:(0,e.jsx)(p,{className:"block p-6",children:s})})}t(i,"StateChrome");function b(){return(0,e.jsxs)(i,{children:[(0,e.jsx)("h1",{className:"text-xl font-semibold",children:"Finish setting up this Wardmote"}),(0,e.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:"No admin has claimed this instance yet. Sign in or create your Wardmote account to become the first admin from this browser."}),(0,e.jsx)("div",{className:"mt-5",children:(0,e.jsx)(a,{asChild:!0,children:(0,e.jsx)("a",{href:"/auth?next=/",children:"Sign in / Create account"})})}),(0,e.jsx)(n,{hasActiveInvite:!1})]})}t(b,"SignedOutPrivate");function g(){return(0,e.jsxs)(i,{children:[(0,e.jsx)("h1",{className:"text-xl font-semibold",children:"Finish setting up this Wardmote"}),(0,e.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:"No admin has claimed this instance yet. Claim it now to become the first admin and start onboarding."}),(0,e.jsxs)("div",{className:"mt-5 flex flex-wrap items-center gap-3",children:[(0,e.jsx)(a,{children:"Claim this instance"}),(0,e.jsxs)("span",{className:"text-sm text-ink-3",children:["Signed in as ",(0,e.jsx)("span",{className:"font-medium text-ink",children:"jane@appliance.local"})]})]}),(0,e.jsxs)("p",{className:"mt-3 text-xs text-ink-3",children:["Wrong account?"," ",(0,e.jsx)("a",{href:"/auth?next=/",className:"underline underline-offset-2",children:"Switch account"}),"."]}),(0,e.jsx)(n,{hasActiveInvite:!1})]})}t(g,"SignedInPrivate");function N(){return(0,e.jsxs)(i,{children:[(0,e.jsx)("h1",{className:"text-xl font-semibold",children:"Finish setting up this Wardmote"}),(0,e.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:"No admin has claimed this instance yet. Claim it now to become the first admin and start onboarding."}),(0,e.jsxs)("div",{className:"mt-5 flex flex-wrap items-center gap-3",children:[(0,e.jsxs)(a,{disabled:!0,children:[(0,e.jsx)(r,{className:"mr-2 size-4 animate-spin","aria-hidden":!0}),"Claiming…"]}),(0,e.jsxs)("span",{className:"text-sm text-ink-3",children:["Signed in as ",(0,e.jsx)("span",{className:"font-medium text-ink",children:"jane@appliance.local"})]})]}),(0,e.jsx)(n,{hasActiveInvite:!1})]})}t(N,"ClaimingPrivate");function v(){return(0,e.jsxs)(i,{children:[(0,e.jsx)("h1",{className:"text-xl font-semibold",children:"Finish setting up this Wardmote"}),(0,e.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:"No admin has claimed this instance yet. Claim it now to become the first admin and start onboarding."}),(0,e.jsxs)("div",{className:"mt-5 flex flex-wrap items-center gap-3",children:[(0,e.jsx)(a,{children:"Claim this instance"}),(0,e.jsxs)("span",{className:"text-sm text-ink-3",children:["Signed in as ",(0,e.jsx)("span",{className:"font-medium text-ink",children:"jane@appliance.local"})]})]}),(0,e.jsxs)("div",{role:"alert",className:"mt-4 flex items-start gap-2 rounded-md border border-bad/40 bg-bad/10 p-3 text-sm text-bad",children:[(0,e.jsx)(h,{className:"mt-0.5 size-4 flex-shrink-0","aria-hidden":!0}),(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"font-medium",children:"Someone else has already claimed this instance."}),(0,e.jsxs)("p",{className:"mt-1 text-bad/90",children:["Refresh to sign in, or ask the existing admin to invite you from"," ",(0,e.jsx)("span",{className:"font-mono",children:"Settings → Access"}),"."]})]})]}),(0,e.jsx)(n,{hasActiveInvite:!1})]})}t(v,"ClaimErrorPrivate");function k(){return(0,e.jsxs)(i,{children:[(0,e.jsxs)("div",{className:"flex items-start gap-3",children:[(0,e.jsx)("div",{className:"mt-0.5 flex size-9 flex-shrink-0 items-center justify-center rounded-full bg-emerald-500/15 text-emerald-600 dark:text-emerald-400",children:(0,e.jsx)(o,{className:"size-5","aria-hidden":!0})}),(0,e.jsxs)("div",{children:[(0,e.jsx)("h1",{className:"text-xl font-semibold",children:"You’re the instance admin"}),(0,e.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:"Setup is complete. Taking you to onboarding to create your first organization…"})]})]}),(0,e.jsxs)("div",{className:"mt-5 flex items-center gap-3",children:[(0,e.jsx)(r,{className:"size-4 animate-spin text-ink-3","aria-hidden":!0}),(0,e.jsx)("span",{className:"text-sm text-ink-3",children:"Redirecting…"})]}),(0,e.jsx)("div",{className:"mt-5",children:(0,e.jsx)(a,{asChild:!0,variant:"secondary",children:(0,e.jsx)("a",{href:"/",children:"Continue to dashboard"})})})]})}t(k,"ClaimSuccess");function y(){return(0,e.jsxs)(i,{children:[(0,e.jsx)("h1",{className:"text-xl font-semibold",children:"This Wardmote is waiting on its first admin"}),(0,e.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:"This instance runs in invite‑only mode. The operator must generate a one‑time first‑admin invite URL from the host. Once you have the link, open it from this browser to finish setup."}),(0,e.jsx)(n,{hasActiveInvite:!0}),(0,e.jsx)("p",{className:"mt-4 text-xs text-ink-3",children:"Browser‑based claim is intentionally disabled in public mode so anyone on the network can’t promote themselves."})]})}t(y,"PublicInviteOnly");var C={"signed-out-private":(0,e.jsx)(b,{}),"signed-in-private":(0,e.jsx)(g,{}),claiming:(0,e.jsx)(N,{}),"claim-error":(0,e.jsx)(v,{}),"claim-success":(0,e.jsx)(k,{}),"public-invite-only":(0,e.jsx)(y,{})};function F(){return(0,e.jsxs)("div",{className:"bg-bg min-h-screen pb-16",children:[(0,e.jsx)("header",{className:"border-b border-line bg-bg-3/20",children:(0,e.jsxs)("div",{className:"mx-auto max-w-3xl px-6 py-6",children:[(0,e.jsx)("p",{className:"text-xs font-medium uppercase tracking-wider text-ink-3",children:"UX Lab"}),(0,e.jsx)("h1",{className:"mt-1 text-2xl font-semibold",children:"Bootstrap-pending setup states"}),(0,e.jsxs)("p",{className:"mt-2 max-w-2xl text-sm text-ink-3",children:["Fixtures for the bootstrap-pending screen in ",(0,e.jsx)("span",{className:"font-mono",children:"CloudAccessGate"}),". Used as the UX spec for"," ",(0,e.jsx)("a",{className:"underline underline-offset-2",href:"/PAP/issues/PAP-10113",children:"PAP-10113"})," ","and the implementation reference for"," ",(0,e.jsx)("a",{className:"underline underline-offset-2",href:"/PAP/issues/PAP-10114",children:"PAP-10114"}),". The browser claim CTA only appears when"," ",(0,e.jsx)("span",{className:"font-mono",children:'deploymentMode === "authenticated"'})," and"," ",(0,e.jsx)("span",{className:"font-mono",children:'deploymentExposure === "private"'}),"."]})]})}),(0,e.jsx)("main",{className:"mx-auto max-w-3xl space-y-12 px-6 pt-10",children:f.map(s=>(0,e.jsxs)("section",{"aria-labelledby":`lab-${s}`,children:[(0,e.jsx)("h2",{id:`lab-${s}`,className:"mb-3 text-xs font-medium uppercase tracking-wider text-ink-3",children:j[s]}),(0,e.jsx)("div",{className:"rounded-lg border border-dashed border-line/70 bg-bg-3/10 p-2",children:C[s]})]},s))})]})}t(F,"BootstrapSetupUxLab");export{F as BootstrapSetupUxLab};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var Ys=Object.defineProperty;var a=(t,s)=>Ys(t,"name",{value:s,configurable:!0});import{i as js}from"./rolldown-runtime-ZpX3ckPj.js";import{Br as Zs,Ct as ge,Gi as Se,Jr as Te,Lr as Js,Rr as Xs,St as et,Tt as st,Zr as tt,ct as $e,gr as nt,l as at,lt as le,na as rt,qr as it,st as J,ta as ot,xt as ps}from"./createLucideIcon-B-uEJvX6.js";import{X as ve,_ as fe,t as k,v as te}from"./queryKeys-yuC-YxZI.js";import{t as gs}from"./useQueries-CARcRe0M.js";import{i as ye}from"./companies-query-C3PiqvlB.js";import{n as lt}from"./ManagedAiConnectionDetails-COyNN_aD.js";import{n as Cs,t as ct}from"./retired-composio-DrxhEOpx.js";import{A as dt,C as ut,D as mt,E as pt,O as we,S as hs,T as gt,d as he,f as ht,k as W,l as ft,w as V,x as xt}from"./connection-identity-DxOISTHV.js";import{n as vt}from"./CompanyContext-DDgccGSs.js";import{o as yt,t as bt}from"./router-2HX_SyKK.js";import{a as jt,c as Ct,i as At,n as Nt,o as kt,r as St,s as wt,t as Et}from"./alert-dialog-B25sZXGU.js";import{c as As,i as Y,p as He,r as We,t as Ve}from"./dropdown-menu-BdCU_bAX.js";import{t as ce}from"./label-CPQI5V7i.js";import{t as It}from"./check-DtcbYVEc.js";import{t as _t}from"./chevron-right-DDmPvaMb.js";import{t as Tt}from"./clipboard-paste-CTGh3EHl.js";import{t as Ye}from"./ellipsis-DoMWjpQg.js";import{t as xe}from"./external-link-CxXijrsp.js";import{t as Ns}from"./link-2-k_0bFjUn.js";import{r as ks,t as A}from"./button-D3bYvq4T.js";import{t as $t}from"./search-oKGByIam.js";import{t as Mt}from"./server-cog-DTIiF5_T.js";import{t as es}from"./trash-CXx6ftRP.js";import{t as Ss}from"./triangle-alert-Cpo2fj-L.js";import{i as Dt,n as Pt,t as Rt}from"./tooltip-CBtM5Ru1.js";import{t as Ut}from"./AgentAvatar-B4hORIPc.js";import{i as ws}from"./ToastContext-BL2cptrZ.js";import{t as Lt}from"./agents-DjsXf9UL.js";import{a as Me,i as De,n as Pe,r as Re,s as Ue,t as Le}from"./dialog-DlsqN-fP.js";import{t as _e}from"./input-It0utqV7.js";import{t as qt}from"./access-RvWIoVKp.js";import{t as Ot}from"./skeleton-BrYUg3zU.js";import{t as fs}from"./chatEndpoints-DU1FUTHN.js";import{t as O}from"./tools-CXMpY5lh.js";import{t as Ee}from"./AppLogo-A080obfm.js";import{n as Ft}from"./BreadcrumbContext-_dNLeVnD.js";import{n as xs,r as Es,t as Kt}from"./app-connect-policy-BHI-V2Dg.js";import{io as Qt,no as zt,sr as Bt}from"./index-DbENFODe.js";import{t as Gt}from"./email-CK7WXZe2.js";import{i as Ge,r as Is,t as _s}from"./connection-owner-EECE9Eiz.js";import{AssistantConnectionCard as Ht,useAssistantConnections as Wt}from"./AssistantConnection-refIKgUa.js";var e=js(ot(),1),Vt=["wardmote","composio","arcade","installed","all"],Yt={wardmote:"Wardmote",composio:"Composio",arcade:"Arcade",executor:"Executor",installed:"Installed",all:"All"};function Zt({source:t,onChange:s}){return(0,e.jsx)("nav",{"aria-label":"App filters",className:"flex flex-wrap gap-1",children:Vt.map(l=>(0,e.jsx)(A,{active:l===t,variant:"ghost",size:"sm","aria-pressed":l===t,onClick:a(()=>s(l),"onClick"),className:at("rounded-full px-4 font-normal"),children:Yt[l]},l))})}a(Zt,"CatalogSourceFilters");var y=js(rt(),1);function Jt({connection:t,onClose:s}){const[l,d]=(0,y.useState)(typeof t.config?.managementUrl=="string"?t.config?.managementUrl:""),h=ve(),{userId:o,settled:b}=ye(),c=fe({mutationFn:a(async()=>{const m=$e("executor",l.trim());if(!m)throw new Error("Enter an HTTPS console URL without credentials.");await O.updateConnection(t.id,{config:{...t.config,managementUrl:m}}),await h.invalidateQueries({queryKey:k.tools.aggregatorApps(t.id,o)});const x=await O.syncAggregatorApps(t.id,!0);h.setQueryData(k.tools.aggregatorApps(t.id,o),x)},"mutationFn"),onSuccess:a(async()=>{await h.invalidateQueries({queryKey:k.tools.connections(t.companyId)}),s()},"onSuccess")});return(0,e.jsx)(Le,{open:!0,onOpenChange:a(m=>{!m&&!c.isPending&&s()},"onOpenChange"),children:(0,e.jsxs)(Pe,{children:[(0,e.jsxs)(Me,{children:[(0,e.jsx)(Ue,{children:"Executor console"}),(0,e.jsxs)(Re,{children:["Choose where to manage accounts for “",t.name,"”. Include your workspace path."]})]}),(0,e.jsxs)("form",{className:"space-y-4",onSubmit:a(m=>{m.preventDefault(),c.mutate()},"onSubmit"),children:[(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(ce,{htmlFor:"executor-console-url",children:"Console URL"}),(0,e.jsx)(_e,{id:"executor-console-url",type:"url",required:!0,value:l,onChange:a(m=>d(m.target.value),"onChange")})]}),c.isError?(0,e.jsx)("p",{role:"alert",className:"text-sm text-bad",children:c.error.message}):null,(0,e.jsxs)(De,{className:"sm:justify-between",children:[(0,e.jsx)(A,{type:"button",variant:"ghost",onClick:s,disabled:c.isPending,children:"Cancel"}),(0,e.jsx)(A,{type:"submit",disabled:!b||c.isPending||!l.trim(),children:c.isPending?"Saving…":"Save"})]})]})]})})}a(Jt,"ExecutorManagementSetup");function Xt({connection:t,onClose:s}){const[l,d]=(0,y.useState)(""),[h,o]=(0,y.useState)(""),b=ve(),{userId:c,settled:m}=ye(),x=fe({mutationFn:a(async()=>{const f=await O.configureArcadeDiscovery(t.id,{apiKey:l.trim(),userId:h.trim()});b.setQueryData(k.tools.aggregatorApps(t.id,c),f)},"mutationFn"),onSuccess:s});return(0,e.jsx)(Le,{open:!0,onOpenChange:a(f=>{!f&&!x.isPending&&s()},"onOpenChange"),children:(0,e.jsxs)(Pe,{children:[(0,e.jsxs)(Me,{children:[(0,e.jsx)(Ue,{children:"Sync Arcade accounts"}),(0,e.jsxs)(Re,{children:["See apps available through “",t.name,"”. Your gateway works without account sync."]})]}),(0,e.jsxs)("form",{className:"space-y-4",onSubmit:a(f=>{f.preventDefault(),x.mutate()},"onSubmit"),children:[(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(ce,{htmlFor:"arcade-discovery-key",children:"Project API key"}),(0,e.jsxs)("p",{className:"text-xs text-ink-3",children:["Create a key in ",(0,e.jsx)("a",{className:"underline",href:"https://app.arcade.dev",target:"_blank",rel:"noopener noreferrer",children:"Arcade"})," for the same project as this gateway. The key is stored securely and used only for account sync."]}),(0,e.jsx)(_e,{id:"arcade-discovery-key",type:"password",autoComplete:"off",required:!0,value:l,onChange:a(f=>d(f.target.value),"onChange")})]}),(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(ce,{htmlFor:"arcade-discovery-user",children:"Arcade user ID"}),(0,e.jsx)("p",{className:"text-xs text-ink-3",children:"Use the end-user ID configured for this gateway’s sign-in. This may differ from your email address."}),(0,e.jsx)(_e,{id:"arcade-discovery-user",autoComplete:"off",required:!0,value:h,onChange:a(f=>o(f.target.value),"onChange")})]}),x.isError?(0,e.jsx)("p",{role:"alert",className:"text-sm text-bad",children:x.error instanceof Error?x.error.message:"Couldn’t save account sync. Try again."}):null,(0,e.jsxs)(De,{className:"sm:justify-between",children:[(0,e.jsx)(A,{type:"button",variant:"ghost",disabled:x.isPending,onClick:s,children:"Cancel"}),(0,e.jsx)(A,{type:"submit",disabled:!m||x.isPending||!l.trim()||!h.trim(),children:x.isPending?"Saving…":"Save and sync"})]})]})]})})}a(Xt,"ArcadeDiscoverySetup");function en({app:t,connections:s,initialConnectionId:l,onClose:d}){const[h,o]=(0,y.useState)(l??s[0]?.id??""),b=s.find(m=>m.id===h),c=b?.config?.sourceTemplateKey;return(0,e.jsx)(Le,{open:!0,onOpenChange:a(m=>{m||d()},"onOpenChange"),children:(0,e.jsxs)(Pe,{children:[(0,e.jsxs)(Me,{children:[(0,e.jsxs)(Ue,{children:["Manage ",t.name]}),(0,e.jsxs)(Re,{children:["Accounts and sign-in are managed in ",le(c)?J[c]:"the provider","."]})]}),s.length>1?(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(ce,{htmlFor:"manage-aggregator-gateway",children:"Connection"}),(0,e.jsx)("select",{id:"manage-aggregator-gateway",className:"h-9 w-full rounded-md border border-line-strong bg-bg px-3 text-sm",value:h,onChange:a(m=>o(m.target.value),"onChange"),children:s.map(m=>(0,e.jsx)("option",{value:m.id,children:m.name},m.id))})]}):null,b?(0,e.jsx)(sn,{app:t,connection:b,onClose:d},b.id):(0,e.jsx)("p",{role:"alert",children:"This connection is no longer available."})]})})}a(en,"AggregatorAppManager");function sn({app:t,connection:s,onClose:l}){const d=ve(),{userId:h,settled:o}=ye(),b=k.tools.aggregatorApps(s.id,h),c=te({queryKey:b,enabled:o,queryFn:a(()=>O.listAggregatorApps(s.id),"queryFn"),refetchInterval:a(j=>j.state.data?.sync.status==="syncing"?1500:!1,"refetchInterval")}),m=(o?c.data?.apps:void 0)?.filter(j=>j.appSlug===t.slug)??[],x=m.flatMap(j=>j.accounts.map(S=>({account:S,snapshot:j}))),f=fe({mutationFn:a(async()=>{const j=await O.refreshAggregatorApps(s.id,m.map(S=>S.toolkit));d.setQueryData(b,j)},"mutationFn")}),I=c.data?.provider,E=I?J[I]:"provider",N=I?$e(I,x[0]?.account.managementUrl??(typeof s.config?.managementUrl=="string"?s.config?.managementUrl:null)):null;return(0,e.jsxs)(e.Fragment,{children:[c.isError||f.isError||c.data?.sync.status==="error"?(0,e.jsxs)("p",{role:"alert",className:"text-sm text-bad",children:["Couldn’t check ",E,". Last known accounts are shown."]}):null,c.isLoading?(0,e.jsx)("p",{role:"status",className:"text-sm text-ink-3",children:"Loading accounts…"}):x.length?(0,e.jsx)("div",{className:"divide-y divide-line",children:x.map(({account:j,snapshot:S})=>(0,e.jsxs)("div",{className:"py-3",children:[(0,e.jsx)("p",{className:"text-sm font-medium",children:j.alias||`${t.name} account`}),(0,e.jsx)("p",{className:"text-xs text-ink-3",children:S.freshness==="stale"||S.errorAt||Date.now()-new Date(S.checkedAt).getTime()>3e5||j.status==="UNVERIFIED"?"Not verified":j.status==="ACTIVE"?"Connected":j.status==="INITIATED"?"Waiting for sign-in":"Needs sign-in"})]},`${S.toolkit}:${j.id}`))}):(0,e.jsx)("p",{className:"text-sm text-ink-3",children:c.data?.discovery.message??`No connected ${t.name} accounts.`}),(0,e.jsxs)("p",{className:"text-xs text-ink-3",children:["Via ",(0,e.jsxs)(bt,{to:`/apps/${s.id}/permissions`,onClick:l,className:"underline underline-offset-2",children:["“",s.name,"”"]})]}),(0,e.jsxs)(De,{className:"sm:justify-between",children:[(0,e.jsx)(A,{variant:"ghost",onClick:l,children:"Close"}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsx)(A,{variant:"ghost",disabled:!o||f.isPending||c.data?.discovery.availability!=="available",onClick:a(()=>f.mutate(),"onClick"),children:"Refresh"}),N?(0,e.jsx)(A,{asChild:!0,children:(0,e.jsxs)("a",{href:N,target:"_blank",rel:"noopener noreferrer",children:["Open in ",E,(0,e.jsx)(xe,{className:"size-4"})]})}):null]})]})]})}a(sn,"AccountObservations");function tn({name:t,toolkit:s,connections:l,onClose:d,onBack:h,onConnectNew:o}){const b=ve(),{userId:c,settled:m}=ye(),{pushToast:x}=ws(),[f,I]=(0,y.useState)(null),E=f??l[0]?.id??"__new__",[N,j]=(0,y.useState)(null),[S,p]=(0,y.useState)(!1),[C,R]=(0,y.useState)(null),T=l.find(i=>i.id===E);async function D(i){if(!(S||!T||!m)){I(T.id),p(!0),R(null);try{const w=await O.setupComposioApp(T.id,s,i);j(w),await b.invalidateQueries({queryKey:k.tools.composioApps(T.id),exact:!0}),await b.invalidateQueries({queryKey:k.tools.aggregatorApps(T.id,c),exact:!0}),w.status==="connected"&&(x({title:`${t} is connected through Composio.`,tone:"success"}),d())}catch(w){R(w instanceof Error?w.message:"Couldn’t configure this app. Try again.")}finally{p(!1)}}}return a(D,"submit"),(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(ce,{htmlFor:"composio-app-account",children:"Composio account"}),(0,e.jsxs)("select",{id:"composio-app-account",value:E,disabled:S,onChange:a(i=>{I(i.target.value),j(null),R(null)},"onChange"),className:"h-9 w-full rounded-md border border-line-strong bg-bg px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus",children:[l.map(i=>(0,e.jsx)("option",{value:i.id,children:i.name},i.id)),(0,e.jsx)("option",{value:"__new__",children:"Connect a new account…"})]})]}),C?(0,e.jsx)("p",{role:"alert",className:"text-sm text-bad",children:C}):null,N?(0,e.jsxs)("p",{role:"status",className:"text-sm text-ink-3",children:["Finish connecting ",t," in Composio, then return here."]}):null,N?.authorizationUrl?(0,e.jsx)(A,{asChild:!0,variant:"secondary",className:"w-full",children:(0,e.jsxs)("a",{href:N.authorizationUrl,target:"_blank",rel:"noopener noreferrer",children:["Connect ",t," in Composio",(0,e.jsx)(xe,{className:"size-4"})]})}):null,(0,e.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,e.jsx)(A,{variant:"ghost",disabled:S,onClick:h??d,children:h?"Back":"Cancel"}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[N&&N.status!=="connected"?(0,e.jsx)(A,{variant:"ghost",disabled:S,onClick:a(()=>{D({action:"start"})},"onClick"),children:"Get a new link"}):null,(0,e.jsx)(A,{disabled:!m||S||!T&&E!=="__new__",onClick:a(()=>{E==="__new__"?o():D(N?{action:"complete"}:{action:"start"})},"onClick"),children:S?"Checking…":E==="__new__"?"Connect new account":N?"I’ve connected it":"Continue"})]})]})]})}a(tn,"ComposioAppSetup");function Ie(t,s){const l=new URLSearchParams({source:t.provider,targetToolkit:t.toolkit});return s&&l.set(s.status==="draft"?"resume":"reconnect",s.id),`/apps/connect?${l}`}a(Ie,"aggregatorAppConnectHref");function nn({app:t,connections:s,initialProvider:l,onClose:d,onNavigate:h}){const[o,b]=(0,y.useState)(""),[c,m]=(0,y.useState)(()=>t.routes.find(p=>p.provider===l)??(t.routes.length===1?t.routes[0]:null)),x=t.routes.length>1,f=c?s[c.provider]??[]:[],I=f.find(p=>p.status==="active"&&p.enabled&&!Se(p.healthStatus)),E=f.find(p=>p.id===o)??I??f[0],N=c?$e(c.provider,typeof E?.config?.managementUrl=="string"?E.config.managementUrl:null):null,j=c?hs[c.provider]:null;function S(p){(s[p.provider]??[]).length===0?(h(Ie(p)),d()):m(p)}return a(S,"choose"),(0,e.jsx)(Le,{open:!0,onOpenChange:a(p=>{p||d()},"onOpenChange"),children:(0,e.jsxs)(Pe,{children:[(0,e.jsxs)(Me,{children:[(0,e.jsx)(Ue,{children:j?`Connect ${t.name} through ${j.name}`:`Connect ${t.name}`}),(0,e.jsx)(Re,{className:c?.provider==="composio"?"sr-only":void 0,children:c?.provider==="composio"?`Choose a saved Composio account or connect a new one to use ${t.name}.`:j?`Your ${j.name} gateway is already saved. ${t.name} authorization is managed inside ${j.name}.`:"Which service would you like to use? This service handles the connection and requests to this app."})]}),c?(0,e.jsxs)("div",{className:"space-y-4",children:[c.provider!=="composio"?(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsxs)(ce,{htmlFor:"aggregator-account",children:[j.name," account"]}),(0,e.jsx)("select",{id:"aggregator-account",value:E?.id??"",onChange:a(p=>b(p.target.value),"onChange"),className:"h-9 w-full rounded-md border border-line-strong bg-bg px-3 text-sm",children:f.map(p=>(0,e.jsx)("option",{value:p.id,children:p.name},p.id))})]}):null,c.provider==="composio"?(0,e.jsx)(tn,{name:t.name,toolkit:c.toolkit,connections:f.filter(p=>p.status==="active"&&p.enabled&&!Se(p.healthStatus)),onClose:d,onBack:x?()=>m(null):void 0,onConnectNew:a(()=>{h(`${Ie(c)}&new=1`),d()},"onConnectNew")}):null]}):(0,e.jsx)("div",{className:"space-y-2",children:[...t.routes].sort((p,C)=>+!!s[C.provider]?.length-+!!s[p.provider]?.length).map(p=>{const C=s[p.provider]??[],R=hs[p.provider].name,T=C.some(D=>D.status==="active"&&D.enabled&&!Se(D.healthStatus))?"Already connected":C.some(D=>D.status==="draft")?"Setup incomplete":C.length?"Needs attention":"Set up a connection";return(0,e.jsxs)("button",{type:"button",onClick:a(()=>S(p),"onClick"),className:"flex w-full items-center gap-3 rounded-lg border border-line px-4 py-3 text-left hover:bg-bg-3 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus",children:[(0,e.jsx)(Ee,{name:R,brandKey:p.provider,size:24}),(0,e.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,e.jsx)("div",{className:"text-sm font-medium",children:R}),(0,e.jsx)("div",{className:"text-xs text-ink-3",children:T})]}),(0,e.jsx)("span",{className:"text-xs text-ink-3",children:"Continue →"})]},p.provider)})}),c?.provider!=="composio"?(0,e.jsxs)(De,{className:"sm:items-center sm:justify-between",children:[(0,e.jsx)(A,{variant:"ghost",onClick:c&&x?()=>m(null):d,children:c&&x?"Back":"Cancel"}),c?(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[N?(0,e.jsx)(A,{asChild:!0,children:(0,e.jsxs)("a",{href:N,target:"_blank",rel:"noopener noreferrer",onClick:d,children:["Continue",(0,e.jsx)(xe,{className:"size-4"})]})}):null,(0,e.jsx)(A,{variant:"link",size:"sm",className:"h-auto p-0 text-xs",onClick:a(()=>{h(`${Ie(c)}&new=1`),d()},"onClick"),children:"Connect a new account"})]}):null]}):null]})})}a(nn,"AggregatorConnectDialog");var vs=new Set(Object.values(Js).map(t=>t.appSlug));function Ze(t){return Te(t)?.methods.find(s=>s.purpose==="channel"&&s.provider)?.provider??null}a(Ze,"chatProviderForSlug");function an(t,s,l){const d=Te(t),h=Ze(t);if(!d||!h)return null;const o=new URLSearchParams({provider:h}),b=d.methods.some(c=>c.purpose==="tool"&&c.transport!=="chat_sdk")?s??`/apps/connect?source=${t}`:null;return b?o.set("toolHref",b):o.set("purpose","chat"),l&&o.set("agentId",l),`/apps/chat/connect?${o.toString()}`}a(an,"chatConnectHref");function Je(t){const s=W(t),l=Te(s);return Es(l)?Kt(s):null}a(Je,"connectHrefFor");function rn(t,s){const l=Je(t);if(!l)return null;const[d,h=""]=l.split("?"),o=new URLSearchParams(h);return o.set("applicationId",s),o.set("name",we(t)),o.set("new","1"),`${d}?${o.toString()}`}a(rn,"additionalConnectionHref");function Ts(t){return Cs(t)?{kind:"attention",label:"Retired",message:ct}:t.status==="draft"?{kind:"draft",label:"Setup incomplete",message:"Finish setup before agents can use this account."}:t.enabled===!1||t.status==="disabled"?{kind:"paused",label:"Paused",message:"Agents can’t use this account right now."}:t.connectionPurpose==="ai"&&(t.healthStatus!=="ok"||nt(t.config))||Se(t.healthStatus)?{kind:"attention",label:"Needs attention",message:t.healthMessage??t.lastError??(t.authKind==="oauth"?"Sign in again to restore access.":"Replace the credential to restore access.")}:{kind:"connected",label:"Connected",message:null}}a(Ts,"connectionState");function Xe(t){return t.status==="draft"?0:1}a(Xe,"connectionRank");function ys(t){return t.chatEndpoints.some(s=>s.status!=="draft")||t.connections.some(s=>Xe(s)===1)||t.upstreamApps?.some(s=>s.status==="connected")?2:Z(t)?1:0}a(ys,"rowRank");function Z(t){return t.connections.length>0||t.chatEndpoints.length>0||!!t.upstreamApps?.some(s=>s.accounts.length>0)}a(Z,"isInstalled");function on(t,s,l){if(t.aggregatorApp&&Z(t))return{label:"Manage",href:null};const d=t.applications[0]?.id??null,h=t.slug==="agentmail"||s?an(t.slug,t.entry?Je(t.entry):null,l):null;return t.connections.length>0||t.chatEndpoints.length>0?h?{label:"Add connection",href:h}:t.entry&&d?{label:"Add account",href:rn(t.entry,d)}:{label:"Add account",href:d?`/apps/app/${d}/permissions`:null}:t.entry?.availability?.available===!1?{label:"Unavailable",href:null,title:t.entry.availability.reason??"This connector is unavailable on this instance."}:h?{label:"Connect",href:h}:t.entry?{label:t.entry.methods?.some(o=>o.purpose==="ai")?"Connect":Xs(t.entry),href:Je(t.entry)}:{label:"Connect",href:d?`/apps/app/${d}/permissions`:null}}a(on,"connectorAction");function ln(t,s){if(s.status==="draft"&&t.entry)return xs(t.slug,s.id);if(s.status==="draft"){const l=V(s);if(l&&l===t.slug&&tt(l))return xs(l,s.id)}return`/apps/${s.id}/permissions`}a(ln,"accountActionHref");function sa({renderAccountDetails:t=a(s=>s.connectionPurpose==="ai"?(0,e.jsx)(lt,{connection:s}):null,"renderAccountDetails")}={}){const s=yt(),l=typeof window>"u"?null:new URLSearchParams(window.location.search).get("chatAgentId"),d=ve(),{pushToast:h}=ws(),{selectedCompanyId:o}=vt(),b=Wt(),{userId:c,settled:m}=ye(),{enabled:x,githubEnabled:f}=ht(),{enabled:I}=xt(),{setBreadcrumbs:E}=Ft(),[N,j]=(0,y.useState)(""),[S,p]=(0,y.useState)(1),[C,R]=(0,y.useState)("wardmote"),[T,D]=(0,y.useState)(!1),[i,w]=(0,y.useState)(null),[P,U]=(0,y.useState)(null),B=(0,y.useRef)(null),[X,ee]=(0,y.useState)(null),[Q,ne]=(0,y.useState)(null),[qe,Oe]=(0,y.useState)(),[$,be]=(0,y.useState)(null);(0,y.useEffect)(()=>(E([{label:"Connectors"}]),()=>E([])),[E]),(0,y.useEffect)(()=>{j(""),p(1),R("wardmote"),D(!1),U(null),ee(null),ne(null),Oe(void 0),be(null)},[o]),(0,y.useEffect)(()=>{const n=new URLSearchParams(window.location.search);n.get("source")==="composio"&&(ee((n.get("targetToolkit")?st(n.get("targetToolkit")):null)??null),Oe("composio"))},[o]);const ae=te({queryKey:k.apps.gallery(o??"__none__"),queryFn:a(()=>O.listGallery(o),"queryFn"),enabled:!!o}),de=te({queryKey:k.tools.applications(o??"__none__"),queryFn:a(()=>O.listApplications(o),"queryFn"),enabled:!!o}),G=te({queryKey:k.tools.connections(o??"__none__"),queryFn:a(()=>O.listConnections(o),"queryFn"),enabled:!!o}),re=te({queryKey:k.chatEndpoints.list(o??"__none__"),queryFn:a(()=>fs.list(o),"queryFn"),enabled:!!o}),ss=te({queryKey:k.agents.list(o??"__none__"),queryFn:a(()=>Lt.list(o),"queryFn"),enabled:!!o&&!!re.data?.length}),Ms=(0,y.useMemo)(()=>new Map((ss.data??[]).map(n=>[n.id,n])),[ss.data]),ts=te({queryKey:k.access.companyUserDirectory(o??"__none__"),queryFn:a(()=>qt.listUserDirectory(o),"queryFn"),enabled:!!o}),F=(0,y.useMemo)(()=>(G.data?.connections??[]).filter(n=>le(V(n))&&n.transport==="mcp_remote"&&n.status!=="archived"&&!Cs(n)),[G.data]),ie=gs({queries:F.map(n=>({queryKey:k.tools.aggregatorApps(n.id,c),queryFn:a(()=>O.listAggregatorApps(n.id),"queryFn"),enabled:m,staleTime:1/0,refetchOnWindowFocus:"always",retry:!1,refetchInterval:a(u=>u.state.data?.sync?.status==="syncing"?1500:6e4,"refetchInterval")}))}),ns=ie.flatMap((n,u)=>{const v=d.getQueryState([...k.tools.aggregatorApps(F[u].id,c),"sync"])?.status==="error";return(m?n.data?.apps??[]:[]).map(M=>n.isError||v||n.data?.sync.status==="error"?{...M,errorAt:M.errorAt??new Date().toISOString()}:M)}),ue=new Map;for(const n of ns)n.accounts.length!==0&&ue.set(n.appSlug,[...ue.get(n.appSlug)??[],n]);const je=et.map(n=>({...n,routes:[...n.routes]}));for(const n of ns){if(!n.accounts.length)continue;let u=je.find(M=>M.slug===n.appSlug);const v={provider:n.provider,toolkit:n.toolkit,logoUrl:"",docsUrl:""};u||(u={slug:n.appSlug,name:n.appName,aliases:[n.toolkit],routes:[]},je.push(u)),u.routes.some(M=>M.provider===n.provider)||u.routes.push(v)}const K=fe({retry:!1,mutationFn:a(async n=>{n.kind==="chat"?n.provider==="agentmail"?await Gt.control(n.id,"remove"):await fs.setup(n.id,{action:"remove"}):await O.archiveConnection(n.id)},"mutationFn"),onSuccess:a((n,u)=>{d.invalidateQueries({queryKey:["email-inboxes",o]}),d.invalidateQueries({queryKey:k.chatEndpoints.list(o)}),d.invalidateQueries({queryKey:k.tools.connections(o)}),d.invalidateQueries({queryKey:k.tools.applications(o)}),d.invalidateQueries({queryKey:k.apps.attention(o)}),h({title:"Connection removed",body:u.kind==="chat"?`${u.providerName} is disconnected. Existing Wardmote tasks remain available.`:u.remainingConnectionCount>0?`${u.providerName} still has ${u.remainingConnectionCount} active ${u.remainingConnectionCount===1?"connection":"connections"} available to agents.`:`${u.providerName} is no longer available to agents through this connection. Its saved credentials were deleted.`,tone:"success"}),be(null)},"onSuccess"),onError:a(n=>h({title:"Couldn't remove the connection",body:n instanceof Error?n.message:"Please try again.",tone:"error"}),"onError")});function Ds(n){K.reset(),be(n)}a(Ds,"requestConnectionRemoval");const me=(ae.data?.apps??[]).filter(n=>{if(!I&&dt(W(n)))return!1;const u=Te(W(n));return he(W(n),x,f)||!u?.methods.some(v=>v.purpose==="channel")||Es(u)}),Ps=(0,y.useMemo)(()=>Bt(ts.data?.users),[ts.data]),Rs=(0,y.useMemo)(()=>new Map((G.data?.connections??[]).map(n=>[n.id,n])),[G.data]),as=(0,y.useMemo)(()=>{const n=(G.data?.connections??[]).filter(r=>r.status!=="archived"&&r.connectionPurpose!=="channel"),u=(de.data?.applications??[]).filter(r=>r.status!=="archived"&&r.type!=="chat"&&r.metadata?.purpose!=="channel"),v=new Map;for(const r of n)v.set(r.applicationId,[...v.get(r.applicationId)??[],r]);const M=new Set(me.map(r=>W(r))),H=new Map(me.map(r=>[we(r).trim().toLocaleLowerCase(),W(r)])),z=new Map;for(const r of me){const g=W(r);z.set(g,{key:`gallery:${g}`,slug:g,name:we(r),description:!he(g,x,f)&&Ze(g)?ft(g).tagline:pt(r),brandKey:g,logoUrl:mt(r),darkLogoUrl:gt(r),entry:r,applications:[],connections:[],chatEndpoints:[]})}for(const r of[{slug:"agentmail",name:"AgentMail",description:"Give agents email inboxes and handle each conversation as a task."},{slug:"imessage-photon",name:"iMessage Photon",description:"Message agents and share photos from Apple Messages with a dedicated Photon number."},{slug:"slack",name:"Slack",description:"Chat with agents from Slack channels and direct messages."},{slug:"github-code-review-bot",name:"GitHub Code Review Bot",description:"Have an agent review pull requests and respond to GitHub mentions."},{slug:"discord",name:"Discord",description:"Chat with agents from Discord channels, threads, and direct messages."},{slug:"microsoft-teams",name:"Microsoft Teams",description:"Chat with agents from Teams channels and conversations."},{slug:"telegram",name:"Telegram",description:"Chat with agents from Telegram direct messages, groups, and topics."}].filter(g=>he(g.slug,x,f)))z.has(r.slug)||z.set(r.slug,{key:`native-chat:${r.slug}`,slug:r.slug,name:r.name,description:r.description,brandKey:r.slug,entry:null,applications:[],connections:[],chatEndpoints:[]});const ze=[];for(const r of u){const g=ut(r),L=v.get(r.id)??[];if(g==="gateway"&&L.length===0)continue;let q=L.filter(_=>!vs.has(V(_)??""));if((!g||g==="link")&&L.length>0&&q.length===0)continue;const Ne=q.length;if(q=q.filter(_=>{if(_.connectionPurpose!=="ai")return!0;const ms=V(_),ke=ms?z.get(ms):void 0;return ke?(ke.applications.some(Vs=>Vs.id===r.id)||ke.applications.push(r),ke.connections.push(_),!1):!0}),Ne>0&&q.length===0)continue;const Hs=q.map(_=>_.config?.sourceTemplateKey??_.transportConfig?.sourceTemplateKey).find(_=>typeof _=="string"&&M.has(_)),Ws=q.flatMap(_=>[_.config?.url,_.transportConfig?.url]).map(_=>typeof _=="string"&&W(it(_,me))||null).find(_=>!!_),us=g&&g!=="link"&&M.has(g)?g:Hs??Ws??H.get(r.name.trim().toLocaleLowerCase())??null,Be=us?z.get(us):null;if(Be){Be.applications.push(r),Be.connections.push(...q);continue}ze.push({key:`application:${r.id}`,slug:g??r.id,name:r.name,description:r.description??"A custom connector configured for this organization.",brandKey:g??r.name,entry:null,applications:[r],connections:q,chatEndpoints:[]})}for(const r of(re.data??[]).filter(g=>he(g.provider,x,f))){if(r.status==="archived")continue;let g=[...z.values()].find(L=>Ze(L.slug)===r.provider);if(!g){const L={speko:"Speko",slack:"Slack",github:"GitHub",discord:"Discord","microsoft-teams":"Microsoft Teams",telegram:"Telegram","imessage-photon":"iMessage Photon",openwa:"OpenWA",agentmail:"AgentMail"};g={key:`chat:${r.provider}`,slug:r.provider,name:L[r.provider],description:`Chat with agents through ${L[r.provider]}.`,brandKey:r.provider,entry:null,applications:[],connections:[],chatEndpoints:[]},ze.push(g)}g.chatEndpoints.push(r)}const Bs=new Set([...Zs,...ae.data?.apps??[]].flatMap(r=>[we(r),W(r)].map(ge)));for(const r of je){const g=ue.get(r.slug)??[],L=new Set([r.name,r.slug,...r.aliases].map(ge)),q=[...z.values()].find(Ne=>L.has(ge(Ne.slug))||L.has(ge(Ne.name)));q&&(q.upstreamApps=[...q.upstreamApps??[],...g],q.upstreamCatalogApp=r)}const Gs=je.filter(r=>![r.name,r.slug,...r.aliases].some(g=>Bs.has(ge(g)))).map(r=>({key:`aggregator:${r.slug}`,slug:r.slug,name:r.name,description:`Connect through ${r.routes.map(g=>J[g.provider]).join(" or ")}.`,brandKey:r.slug,logoUrl:r.routes[0]?.logoUrl,entry:null,applications:[],connections:[],chatEndpoints:[],aggregatorApp:r,upstreamApps:ue.get(r.slug)??[],upstreamCatalogApp:r}));return[...z.values(),...ze,...Gs].filter(r=>!vs.has(r.slug)||r.upstreamApps?.some(g=>g.accounts.length>0)).map(r=>({...r,connections:[...r.connections].sort((g,L)=>Xe(L)-Xe(g)||g.name.localeCompare(L.name,void 0,{sensitivity:"base"}))})).sort((r,g)=>ys(g)-ys(r)||+!!r.aggregatorApp-+!!g.aggregatorApp||r.name.localeCompare(g.name,void 0,{sensitivity:"base"})||r.key.localeCompare(g.key))},[de.data,re.data,x,f,G.data,me,ae.data,ue]),se=N.trim().toLocaleLowerCase(),Fe=(0,y.useMemo)(()=>{const n=as.filter(v=>C==="all"?!0:C==="installed"?Z(v):C==="wardmote"?!v.aggregatorApp||Z(v):le(C)&&(v.slug===C&&Z(v)||v.upstreamApps?.some(M=>M.provider===C&&M.accounts.length>0)||v.aggregatorApp?.routes.some(M=>M.provider===C)));if(!se)return n;const u=ps(se).split(" ").filter(Boolean);return n.filter(v=>{const M=ps([v.name,v.slug,v.description,...v.aggregatorApp?.aliases??[],...v.connections.map(H=>H.name),...(v.upstreamApps??[]).flatMap(H=>H.accounts.map(z=>z.alias)),...v.chatEndpoints.map(H=>H.assignedAgentName)].join(" "));return u.every(H=>M.includes(H))})},[as,se,C]),Us=Fe.filter(Z),pe=Fe.filter(n=>!Z(n)),Ke=Math.max(1,Math.ceil(pe.length/50)),oe=Math.min(S,Ke),Ce=(oe-1)*50,Ls=[...Us,...pe.slice(Ce,Ce+50)],qs=gs({queries:F.map((n,u)=>({queryKey:[...k.tools.aggregatorApps(n.id,c),"sync"],queryFn:a(async()=>{const v=await O.syncAggregatorApps(n.id);return d.setQueryData(k.tools.aggregatorApps(n.id,c),v),v},"queryFn"),enabled:m&&ie[u]?.isSuccess===!0&&ie[u].data?.discovery.availability==="available",staleTime:6e4,refetchInterval:6e4,refetchOnMount:"always",refetchOnWindowFocus:"always",retry:!1}))}),rs=ie.flatMap((n,u)=>n.isError||qs[u]?.isError?[J[V(F[u])]]:[]),Ae=fe({mutationFn:a(async n=>{await O.refreshCatalog(n);const u=await O.syncAggregatorApps(n,!0);d.setQueryData(k.tools.aggregatorApps(n,c),u),d.setQueryData([...k.tools.aggregatorApps(n,c),"sync"],u)},"mutationFn")}),Os=new Map(F.map((n,u)=>[n.id,ie[u]?.data?.sync?.status==="syncing"||Ae.isPending&&Ae.variables===n.id])),Fs=new Map(F.map((n,u)=>[n.id,ie[u]?.data])),is=(0,y.useMemo)(()=>({composio:F.filter(n=>V(n)==="composio"),arcade:F.filter(n=>V(n)==="arcade"),executor:F.filter(n=>V(n)==="executor")}),[F]);function os(n){C==="wardmote"&&!N.trim()&&n.trim()&&(R("all"),D(!0)),T&&!n.trim()&&(R("wardmote"),D(!1)),j(n),p(1)}a(os,"changeQuery");function Ks(){ee(null),d.invalidateQueries({queryKey:["tools","aggregator-apps"]}),new URLSearchParams(window.location.search).get("source")==="composio"&&s("/apps",{replace:!0})}a(Ks,"closeAggregatorSetup");function Qs(n){Oe(void 0),le(C)&&(n={...n,routes:n.routes.filter(v=>v.provider===C)});const u=n.routes.length===1?n.routes[0]:null;if(u&&is[u.provider].length===0){s(Ie(u));return}ee(n)}a(Qs,"connectAggregator");const ls=(C==="wardmote"||C==="all"||C==="installed"&&(!b.isSuccess||b.rows.some(n=>!n.revokedAt)))&&(!se||"assistant connection (mcp) wardmote codex claude opencode".includes(se)),cs=(C==="wardmote"||C==="all")&&(!se||"connect your own tool custom mcp server".includes(se));if(!o)return(0,e.jsx)("div",{className:"p-6 text-sm text-ink-3",children:"Select an organization to manage connectors."});const Qe=ae.isLoading||de.isLoading||G.isLoading||re.isLoading,ds=ae.isError||de.isError||G.isError||re.isError,zs=Fe.length===0&&!cs&&!ls;return(0,e.jsxs)("div",{ref:B,className:"max-w-5xl space-y-5 pb-12",children:[(0,e.jsxs)("header",{className:"flex flex-col items-start gap-3",children:[(0,e.jsxs)("div",{className:"relative w-full max-w-md",children:[(0,e.jsx)($t,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-ink-3"}),(0,e.jsx)(_e,{type:"search",value:N,onChange:a(n=>os(n.target.value),"onChange"),placeholder:"Search connectors…","aria-label":"Search connectors",className:"pl-9"})]}),(0,e.jsx)(Zt,{source:C,onChange:a(n=>{R(n),D(!1),p(1)},"onChange")})]}),ds?(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-3 rounded-lg border border-bad/40 bg-bad/5 px-4 py-3 text-sm text-bad",role:"alert",children:[(0,e.jsx)(Ss,{className:"h-4 w-4 shrink-0"}),(0,e.jsx)("p",{className:"min-w-0 flex-1",children:"Couldn’t load every connector. Existing accounts are shown where available."}),(0,e.jsx)(A,{type:"button",size:"sm",variant:"secondary",onClick:a(()=>{ae.refetch(),de.refetch(),G.refetch(),re.refetch()},"onClick"),children:"Try again"})]}):null,Ae.isError?(0,e.jsx)("p",{role:"alert",className:"text-sm text-bad",children:"Couldn’t refresh the gateway. Last known accounts are shown."}):null,Qe?(0,e.jsx)("div",{className:"space-y-3","aria-label":"Loading connectors",children:Array.from({length:6}).map((n,u)=>(0,e.jsx)(Ot,{className:"h-24 w-full rounded-xl"},u))}):zs?(0,e.jsxs)("div",{className:"flex flex-col items-start gap-3 rounded-xl border border-dashed border-line bg-bg-2 px-4 py-6 text-sm text-ink-3",children:[(0,e.jsxs)("p",{className:"flex items-center gap-2",children:[(0,e.jsx)(Ns,{className:"h-4 w-4"}),"No connectors match “",N.trim(),"”."]}),(0,e.jsx)(A,{variant:"secondary",size:"sm",onClick:a(()=>os(""),"onClick"),children:"Clear search"})]}):(0,e.jsxs)("div",{className:"space-y-3",role:"list","aria-label":"Connector list",children:[ls&&(0,e.jsx)(Ht,{onNavigate:s}),Ls.map(n=>(0,e.jsx)(cn,{renderAccountDetails:t,row:n,userProfileById:Ps,chatAgentById:Ms,connectionById:Rs,onNavigate:s,onRequestRemove:Ds,preselectedAgentId:l,chatConnectorsEnabled:x,githubReviewBotsEnabled:f,onConnectAggregator:Qs,onManageAggregator:a((u,v)=>ne({app:u,connectionId:v}),"onManageAggregator"),onRefreshAggregator:a(u=>Ae.mutate(u),"onRefreshAggregator"),aggregatorRefreshState:Os,discoveryByConnection:Fs,onConfigureArcade:a(u=>U(u),"onConfigureArcade"),onConfigureExecutor:a(u=>w(u),"onConfigureExecutor")},n.key)),cs?(0,e.jsx)(mn,{onNavigate:s}):null]}),rs.length?(0,e.jsxs)("p",{role:"alert",className:"text-sm text-bad",children:["Couldn’t load ",Array.from(new Set(rs)).join(" or ")," accounts. Use Refresh in the connection’s menu to try again."]}):null,!Qe&&pe.length>0?(0,e.jsxs)("nav",{"aria-label":"Connector catalog pages",className:"flex flex-wrap items-center justify-between gap-3 text-sm",children:[(0,e.jsxs)("p",{className:"text-ink-3",role:"status",children:[Ce+1,"–",Math.min(Ce+50,pe.length)," of ",pe.length.toLocaleString()," connectors"]}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(A,{variant:"secondary",size:"sm",disabled:oe===1,onClick:a(()=>{p(oe-1),B.current?.scrollIntoView?.({block:"start"})},"onClick"),children:"Previous"}),(0,e.jsxs)("span",{className:"text-xs text-ink-3",children:["Page ",oe," of ",Ke]}),(0,e.jsx)(A,{variant:"secondary",size:"sm",disabled:oe===Ke,onClick:a(()=>{p(oe+1),B.current?.scrollIntoView?.({block:"start"})},"onClick"),children:"Next"})]})]}):null,X&&!Qe&&!ds?(0,e.jsx)(nn,{app:X,initialProvider:qe,connections:is,onClose:Ks,onNavigate:s},X.slug):null,Q?(0,e.jsx)(en,{...Q,initialConnectionId:Q.connectionId,connections:F.filter(n=>Q.app.routes.some(u=>u.provider===V(n))),onClose:a(()=>ne(null),"onClose")},Q.app.slug):null,i?(0,e.jsx)(Jt,{connection:i,onClose:a(()=>w(null),"onClose")}):null,P?(0,e.jsx)(Xt,{connection:P,onClose:a(()=>U(null),"onClose")}):null,(0,e.jsx)(Et,{open:$!==null,onOpenChange:a(n=>{!n&&!K.isPending&&(be(null),K.reset())},"onOpenChange"),children:(0,e.jsxs)(At,{children:[(0,e.jsxs)(wt,{children:[(0,e.jsxs)(Ct,{children:["Remove ",$?.accountName??"this"," connection?"]}),(0,e.jsx)(jt,{children:$&&Object.values(J).includes($.providerName)?`This removes the saved ${$.providerName} connection from Wardmote and agents lose access through it. Your apps and accounts remain connected in ${$.providerName}.`:$?.kind==="chat"?`This connection will stop receiving new work from ${$.providerName}. Existing Wardmote tasks and conversation history remain available. This does not delete the app, bot, or account in ${$.providerName}.`:$&&$.remainingConnectionCount>0?`This connection's saved credentials are deleted and agents lose access through it immediately. They can still use ${$.providerName} through ${$.remainingConnectionCount} other active ${$.remainingConnectionCount===1?"connection":"connections"}.`:"The saved credentials are deleted and agents lose access immediately. Connecting it again later requires a new sign-in or key."})]}),K.isError?(0,e.jsx)("p",{role:"alert",className:"text-sm text-bad",children:K.error instanceof Error?K.error.message:"Couldn’t remove the connection. Please try again."}):null,(0,e.jsxs)(kt,{className:"sm:justify-between",children:[(0,e.jsx)(St,{disabled:K.isPending,children:"Cancel"}),(0,e.jsxs)(Nt,{className:"bg-bad text-accent-ink hover:bg-bad/90",disabled:!$||K.isPending,onClick:a(n=>{n.preventDefault(),$&&K.mutate($)},"onClick"),children:[K.isPending?(0,e.jsx)(ks,{className:"h-4 w-4 animate-spin"}):(0,e.jsx)(es,{}),K.isPending?"Removing…":"Remove connection"]})]})]})})]})}a(sa,"Browse");function cn({renderAccountDetails:t,row:s,userProfileById:l,chatAgentById:d,connectionById:h,onNavigate:o,onRequestRemove:b,preselectedAgentId:c,chatConnectorsEnabled:m,githubReviewBotsEnabled:x=!1,onConnectAggregator:f,onManageAggregator:I,onRefreshComposio:E,composioRefreshState:N,onRefreshAggregator:j,aggregatorRefreshState:S,discoveryByConnection:p,onConfigureArcade:C,onConfigureExecutor:R}){const T=on(s,he(s.slug,m,x),c),D=(s.upstreamApps??[]).flatMap(i=>{const w=h?.get(i.connectionId);return w?i.accounts.map((P,U)=>({connection:w,account:P,snapshot:i,name:P.alias||(i.accounts.length>1?`${s.name} account ${U+1}`:`${s.name} account`)})):[]});return(0,e.jsxs)("div",{role:"listitem","data-app-slug":s.slug,"data-connected":Z(s)?"true":"false",className:"overflow-hidden rounded-xl border border-line",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-3 px-4 py-4",children:[(0,e.jsx)(Ee,{name:s.name,brandKey:s.brandKey,logoUrl:s.logoUrl,darkLogoUrl:s.darkLogoUrl,size:36}),(0,e.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("h2",{className:"text-sm font-semibold text-ink",children:s.name}),s.aggregatorApp?.routes.map(i=>{const w=J[i.provider],P=s.upstreamApps?.find(X=>(X.provider??"composio")===i.provider&&X.accounts.length>0),U=!!P,B=`${U?"Manage":"Connect"} ${s.name} through ${w}, a third-party service`;return(0,e.jsxs)(Rt,{children:[(0,e.jsx)(Dt,{asChild:!0,children:(0,e.jsx)("button",{type:"button","aria-label":B,onClick:a(()=>U?I?.(s.aggregatorApp,P?.connectionId):f?.(s.aggregatorApp),"onClick"),className:"rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus",children:(0,e.jsx)(Ee,{name:w,brandKey:i.provider,size:16,compact:!0})})}),(0,e.jsx)(Pt,{children:B})]},i.provider)})]}),(0,e.jsx)("p",{className:"mt-0.5 text-xs text-ink-3",children:s.aggregatorApp&&s.upstreamApps?.some(i=>i.accounts.length>0)?`Accounts managed in ${[...new Set(s.upstreamApps?.map(i=>J[i.provider??"composio"]))].join(" and ")}.`:s.description})]}),(0,e.jsx)(A,{type:"button",size:"sm",variant:"secondary",disabled:!T.href&&!s.aggregatorApp,title:T.title,onClick:a(()=>{s.aggregatorApp&&Z(s)?I?.(s.aggregatorApp,s.upstreamApps?.find(i=>i.accounts.length>0)?.connectionId):s.aggregatorApp?f?.(s.aggregatorApp):T.href&&o(s.slug==="agentmail"?`${T.href}&setupId=${crypto.randomUUID()}`:T.href)},"onClick"),"aria-label":`${T.label} ${s.name}`,children:T.label})]}),s.connections.length>0?(0,e.jsx)("div",{className:"divide-y divide-line border-t border-line",children:s.connections.map(i=>(0,e.jsx)(dn,{details:t?.(i),row:s,connection:i,owner:Ge(i,l),onNavigate:o,onRefreshComposio:(S??N)?.has(i.id)&&(j??E)?()=>(j??E)?.(i.id):void 0,refreshingComposio:(S??N)?.get(i.id),discovery:p?.get(i.id),onConfigureArcade:C?()=>C(i):void 0,onConfigureExecutor:R?()=>R(i):void 0,onRemove:a(()=>{const w=Is(i,s.name,Ge(i,l));b({id:i.id,accountName:w,providerName:s.name,remainingConnectionCount:s.connections.filter(P=>P.id!==i.id&&P.status==="active"&&P.enabled).length})},"onRemove")},i.id))}):null,s.upstreamCatalogApp&&D.length>0?(0,e.jsx)("div",{className:"divide-y divide-line border-t border-line",children:D.map(({connection:i,account:w,name:P,snapshot:U})=>{const B=Ts(i),X=B.kind!=="connected"?B:U.freshness==="stale"||U.errorAt||Date.now()-new Date(U.checkedAt).getTime()>3e5?{kind:"attention",label:"Not verified",message:"Last known account · Refresh to verify"}:w.status==="UNVERIFIED"?{kind:"attention",label:"Not verified",message:"Account found upstream · Authorization not verified"}:w.status==="ACTIVE"?{kind:"connected",label:"Connected",message:null}:w.status==="INITIATED"?{kind:"draft",label:"Waiting for sign-in",message:"Finish connecting this account."}:{kind:"attention",label:"Needs sign-in",message:"Sign in again to restore access."},ee=U.provider??(le(i.config?.sourceTemplateKey)?i.config?.sourceTemplateKey:"composio"),Q=J[ee],ne=$e(ee,w.managementUrl??(typeof i.config?.managementUrl=="string"?i.config?.managementUrl:null)),qe=a(()=>I?.(s.upstreamCatalogApp,i.id),"manage");return(0,e.jsx)($s,{state:X,accountName:P,source:(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ee,{name:Q,brandKey:ee,size:16,compact:!0}),(0,e.jsxs)("span",{children:["Managed by ",Q," ·"]}),(0,e.jsxs)("button",{type:"button",className:"max-w-full truncate hover:underline",onClick:a(()=>o(`/apps/${i.id}/permissions`),"onClick"),children:["“",i.name,"”"]})]}),onOpen:qe,openLabel:`Manage ${P}`,children:(0,e.jsxs)(Ve,{children:[(0,e.jsx)(He,{asChild:!0,children:(0,e.jsx)(A,{type:"button",variant:"ghost",size:"icon-sm","aria-label":`Manage ${P} connection`,children:(0,e.jsx)(Ye,{className:"h-4 w-4"})})}),(0,e.jsx)(We,{align:"end",children:ne?(0,e.jsx)(Y,{asChild:!0,children:(0,e.jsxs)("a",{href:ne,target:"_blank",rel:"noopener noreferrer",children:["Open in ",Q,(0,e.jsx)(xe,{className:"size-4"})]})}):(0,e.jsxs)(Y,{disabled:!0,title:"Set the management URL on this gateway to open its console",children:["Open in ",Q,(0,e.jsx)(xe,{className:"size-4"})]})})]})},`${i.id}:${U.toolkit}:${w.id}`)})}):null,s.chatEndpoints.length>0?(0,e.jsx)("div",{className:"divide-y divide-line border-t border-line",children:s.chatEndpoints.map(i=>(0,e.jsxs)("div",{className:"flex flex-col gap-2 px-4 py-3 sm:flex-row sm:items-center sm:gap-3",children:[(0,e.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[(0,e.jsx)(Ut,{agent:d?.get(i.assignedAgentId)??{id:i.assignedAgentId,name:i.assignedAgentName},size:40,label:`${i.assignedAgentName} avatar`}),(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsxs)("button",{type:"button",className:"block max-w-full truncate text-left text-sm font-medium hover:underline",onClick:a(()=>o(`/apps/chat/${i.id}/settings`),"onClick"),children:[i.assignedAgentName," · ",i.provider==="agentmail"?"Email":i.provider==="github"?"Code review bot":"Chat"]}),(0,e.jsx)("p",{className:"truncate text-xs text-ink-3",children:i.providerAccountLabel??i.botLabel??"Provider identity"})]})]}),(0,e.jsxs)("div",{className:"flex items-center gap-2 self-end sm:self-auto",children:[(0,e.jsx)(_s,{owner:Ge({createdByUserId:(i.connectionId?h?.get(i.connectionId)?.createdByUserId:null)??i.sponsorUserId??null},l)}),["paused","attention","revoked"].includes(i.status)&&(0,e.jsx)("span",{className:"text-xs text-ink-3",children:i.status==="attention"?"Needs attention":i.status==="revoked"?"Access revoked":"Paused"}),i.status==="draft"?(0,e.jsx)(A,{size:"sm",variant:"secondary",onClick:a(()=>o(`/apps/chat/connect?provider=${i.provider}&purpose=chat&resume=${i.id}`),"onClick"),children:"Finish setup"}):null,(0,e.jsxs)(Ve,{children:[(0,e.jsx)(He,{asChild:!0,children:(0,e.jsx)(A,{type:"button",variant:"ghost",size:"icon-sm","aria-label":`Manage ${i.assignedAgentName} ${s.name} connection`,children:(0,e.jsx)(Ye,{className:"h-4 w-4"})})}),(0,e.jsxs)(We,{align:"end",children:[(0,e.jsx)(Y,{onSelect:a(()=>o(`/apps/chat/${i.id}/settings`),"onSelect"),children:"Manage"}),(0,e.jsx)(As,{}),(0,e.jsxs)(Y,{variant:"destructive",onSelect:a(()=>b({kind:"chat",provider:i.provider,id:i.id,accountName:`${i.assignedAgentName} · ${s.name}`,providerName:s.name,remainingConnectionCount:0}),"onSelect"),children:[(0,e.jsx)(es,{}),"Remove connection"]})]})]})]})]},i.id))}):null]})}a(cn,"ConnectorCard");function dn({details:t,row:s,connection:l,owner:d,onNavigate:h,onRemove:o,onRefreshComposio:b,refreshingComposio:c,discovery:m,onConfigureArcade:x,onConfigureExecutor:f}){const I=Ts(l),E=ln(s,l),N=Is(l,s.name,d);return(0,e.jsxs)($s,{state:I,accountName:N,owner:d,details:(0,e.jsxs)(e.Fragment,{children:[t,m?.discovery.message||m?.sync.status==="error"?(0,e.jsx)("p",{className:"text-xs text-ink-3",role:"status",children:m.discovery.message??m.sync.error}):null]}),openLabel:`Open ${N} permissions`,onOpen:a(()=>h(`/apps/${l.id}/permissions`),"onOpen"),children:[I.kind==="attention"||I.kind==="draft"?(0,e.jsx)(A,{type:"button",size:"sm",variant:"secondary",onClick:a(()=>h(E),"onClick"),children:I.kind==="attention"?l.requiresReauthorization===!1?"Retry access":"Reconnect":"Finish setup"}):null,(0,e.jsxs)(Ve,{children:[(0,e.jsx)(He,{asChild:!0,children:(0,e.jsx)(A,{type:"button",variant:"ghost",size:"icon-sm","aria-label":`Manage ${N} connection`,children:(0,e.jsx)(Ye,{className:"h-4 w-4"})})}),(0,e.jsxs)(We,{align:"end",children:[(0,e.jsx)(Y,{onSelect:a(()=>h(`/apps/${l.id}/permissions`),"onSelect"),children:"Permissions"}),b?(0,e.jsxs)(Y,{disabled:c,onSelect:b,children:[c?(0,e.jsx)(ks,{className:"animate-spin"}):null,"Refresh ",le(s.slug)?J[s.slug]:"Composio"]}):null,s.slug==="arcade"&&x?(0,e.jsx)(Y,{onSelect:x,children:m?.discovery.availability==="setup_required"?"Set up account sync":"Account sync settings"}):null,s.slug==="executor"&&f?(0,e.jsx)(Y,{onSelect:f,children:"Console URL"}):null,(0,e.jsx)(As,{}),(0,e.jsxs)(Y,{variant:"destructive",onSelect:o,children:[(0,e.jsx)(es,{}),"Remove connection"]})]})]})]})}a(dn,"ConnectionAccountRow");function $s({state:t,accountName:s,owner:l,source:d,details:h,openLabel:o,onOpen:b,children:c}){return(0,e.jsxs)("div",{className:"flex flex-col gap-2 px-4 py-3 sm:flex-row sm:items-center",children:[(0,e.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-2.5",children:[(0,e.jsx)(un,{state:t}),(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsx)("button",{type:"button",className:"block max-w-full cursor-pointer truncate text-left text-sm font-medium text-ink hover:underline focus-visible:underline","aria-label":o,onClick:b,children:s}),h,t.message?(0,e.jsx)("div",{className:t.kind==="attention"?"truncate text-xs text-bad":"truncate text-xs text-ink-3",children:t.message}):null]})]}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2 sm:justify-end",children:[(0,e.jsx)("div",{className:"flex items-center gap-1.5 text-xs text-ink-3",children:d??(0,e.jsx)(_s,{owner:l??null})}),c]})]})}a($s,"ConnectionAccountRowLayout");function un({state:t}){return t.kind==="connected"?(0,e.jsxs)("span",{className:"mt-0.5 text-emerald-600 dark:text-emerald-400",title:t.label,children:[(0,e.jsx)(It,{className:"h-4 w-4","aria-hidden":"true"}),(0,e.jsx)("span",{className:"sr-only",children:t.label})]}):t.kind==="attention"?(0,e.jsxs)("span",{className:"mt-0.5 text-bad",title:t.label,children:[(0,e.jsx)(Ss,{className:"h-4 w-4","aria-hidden":"true"}),(0,e.jsx)("span",{className:"sr-only",children:t.label})]}):t.kind==="draft"?(0,e.jsxs)("span",{className:"mt-0.5 text-amber-600 dark:text-amber-400",title:t.label,children:[(0,e.jsx)(zt,{className:"h-4 w-4","aria-hidden":"true"}),(0,e.jsx)("span",{className:"sr-only",children:t.label})]}):(0,e.jsxs)("span",{className:"mt-0.5 text-ink-3",title:t.label,children:[(0,e.jsx)(Qt,{className:"h-4 w-4","aria-hidden":"true"}),(0,e.jsx)("span",{className:"sr-only",children:t.label})]})}a(un,"ConnectionStatusIcon");function mn({onNavigate:t}){const[s,l]=(0,y.useState)(!1);return(0,e.jsxs)("div",{role:"listitem","data-app-slug":"custom-mcp",className:"overflow-hidden rounded-xl border border-line",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-3 px-4 py-4",children:[(0,e.jsx)("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-bg-3 text-ink-3",children:(0,e.jsx)(Ns,{className:"h-4 w-4"})}),(0,e.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,e.jsx)("h2",{className:"text-sm font-semibold text-ink",children:"Connect your own tool"}),(0,e.jsx)("p",{className:"mt-0.5 text-xs text-ink-3",children:"Add a custom MCP server or paste an existing configuration."})]}),(0,e.jsx)(A,{type:"button",size:"sm",variant:"secondary","aria-expanded":s,"aria-controls":"custom-connector-options",onClick:a(()=>l(d=>!d),"onClick"),children:s?"Close":"Connect"})]}),s?(0,e.jsxs)("div",{id:"custom-connector-options",className:"grid gap-2 border-t border-line px-4 py-3 sm:grid-cols-2",children:[(0,e.jsx)(bs,{icon:Mt,title:"Connect your own MCP server",description:"Enter the URL for a custom or self-hosted MCP server.",onClick:a(()=>t("/apps/byo"),"onClick")}),(0,e.jsx)(bs,{icon:Tt,title:"Paste a config",description:"Paste an existing setup snippet and connect it.",onClick:a(()=>t("/apps/advanced/paste-config"),"onClick")})]}):null]})}a(mn,"CustomConnectorCard");function bs({icon:t,title:s,description:l,onClick:d}){return(0,e.jsxs)("button",{type:"button",className:"flex items-center gap-3 rounded-lg border border-line px-3 py-3 text-left transition-colors hover:border-ink/30 hover:bg-bg-3/40",onClick:d,children:[(0,e.jsx)("span",{className:"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-line text-ink-3",children:(0,e.jsx)(t,{className:"h-4 w-4"})}),(0,e.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,e.jsx)("span",{className:"block text-sm font-semibold text-ink",children:s}),(0,e.jsx)("span",{className:"block text-xs text-ink-3",children:l})]}),(0,e.jsx)(_t,{className:"h-4 w-4 shrink-0 text-ink-3"})]})}a(bs,"CustomConnectorOption");export{sa as Browse};
|
|
1
|
+
var Ys=Object.defineProperty;var a=(t,s)=>Ys(t,"name",{value:s,configurable:!0});import{i as js}from"./rolldown-runtime-ZpX3ckPj.js";import{Br as Zs,Ct as ge,Gi as Se,Jr as Te,Lr as Js,Rr as Xs,St as et,Tt as st,Zr as tt,ct as $e,gr as nt,l as at,lt as le,na as rt,qr as it,st as J,ta as ot,xt as ps}from"./createLucideIcon-B-uEJvX6.js";import{X as ve,_ as fe,t as k,v as te}from"./queryKeys-yuC-YxZI.js";import{t as gs}from"./useQueries-CARcRe0M.js";import{i as ye}from"./companies-query-C3PiqvlB.js";import{n as lt}from"./ManagedAiConnectionDetails-CgCv2fqy.js";import{n as Cs,t as ct}from"./retired-composio-DrxhEOpx.js";import{A as dt,C as ut,D as mt,E as pt,O as we,S as hs,T as gt,d as he,f as ht,k as W,l as ft,w as V,x as xt}from"./connection-identity-DxOISTHV.js";import{n as vt}from"./CompanyContext-DDgccGSs.js";import{o as yt,t as bt}from"./router-2HX_SyKK.js";import{a as jt,c as Ct,i as At,n as Nt,o as kt,r as St,s as wt,t as Et}from"./alert-dialog-B25sZXGU.js";import{c as As,i as Y,p as He,r as We,t as Ve}from"./dropdown-menu-BdCU_bAX.js";import{t as ce}from"./label-CPQI5V7i.js";import{t as It}from"./check-DtcbYVEc.js";import{t as _t}from"./chevron-right-DDmPvaMb.js";import{t as Tt}from"./clipboard-paste-CTGh3EHl.js";import{t as Ye}from"./ellipsis-DoMWjpQg.js";import{t as xe}from"./external-link-CxXijrsp.js";import{t as Ns}from"./link-2-k_0bFjUn.js";import{r as ks,t as A}from"./button-D3bYvq4T.js";import{t as $t}from"./search-oKGByIam.js";import{t as Mt}from"./server-cog-DTIiF5_T.js";import{t as es}from"./trash-CXx6ftRP.js";import{t as Ss}from"./triangle-alert-Cpo2fj-L.js";import{i as Dt,n as Pt,t as Rt}from"./tooltip-CBtM5Ru1.js";import{t as Ut}from"./AgentAvatar-B4hORIPc.js";import{i as ws}from"./ToastContext-BL2cptrZ.js";import{t as Lt}from"./agents-DjsXf9UL.js";import{a as Me,i as De,n as Pe,r as Re,s as Ue,t as Le}from"./dialog-DlsqN-fP.js";import{t as _e}from"./input-It0utqV7.js";import{t as qt}from"./access-RvWIoVKp.js";import{t as Ot}from"./skeleton-BrYUg3zU.js";import{t as fs}from"./chatEndpoints-DU1FUTHN.js";import{t as O}from"./tools-CXMpY5lh.js";import{t as Ee}from"./AppLogo-A080obfm.js";import{n as Ft}from"./BreadcrumbContext-_dNLeVnD.js";import{n as xs,r as Es,t as Kt}from"./app-connect-policy-BHI-V2Dg.js";import{io as Qt,no as zt,sr as Bt}from"./index-CSIXA5y5.js";import{t as Gt}from"./email-CK7WXZe2.js";import{i as Ge,r as Is,t as _s}from"./connection-owner-qWfs2q4d.js";import{AssistantConnectionCard as Ht,useAssistantConnections as Wt}from"./AssistantConnection-D1H83dKT.js";var e=js(ot(),1),Vt=["wardmote","composio","arcade","installed","all"],Yt={wardmote:"Wardmote",composio:"Composio",arcade:"Arcade",executor:"Executor",installed:"Installed",all:"All"};function Zt({source:t,onChange:s}){return(0,e.jsx)("nav",{"aria-label":"App filters",className:"flex flex-wrap gap-1",children:Vt.map(l=>(0,e.jsx)(A,{active:l===t,variant:"ghost",size:"sm","aria-pressed":l===t,onClick:a(()=>s(l),"onClick"),className:at("rounded-full px-4 font-normal"),children:Yt[l]},l))})}a(Zt,"CatalogSourceFilters");var y=js(rt(),1);function Jt({connection:t,onClose:s}){const[l,d]=(0,y.useState)(typeof t.config?.managementUrl=="string"?t.config?.managementUrl:""),h=ve(),{userId:o,settled:b}=ye(),c=fe({mutationFn:a(async()=>{const m=$e("executor",l.trim());if(!m)throw new Error("Enter an HTTPS console URL without credentials.");await O.updateConnection(t.id,{config:{...t.config,managementUrl:m}}),await h.invalidateQueries({queryKey:k.tools.aggregatorApps(t.id,o)});const x=await O.syncAggregatorApps(t.id,!0);h.setQueryData(k.tools.aggregatorApps(t.id,o),x)},"mutationFn"),onSuccess:a(async()=>{await h.invalidateQueries({queryKey:k.tools.connections(t.companyId)}),s()},"onSuccess")});return(0,e.jsx)(Le,{open:!0,onOpenChange:a(m=>{!m&&!c.isPending&&s()},"onOpenChange"),children:(0,e.jsxs)(Pe,{children:[(0,e.jsxs)(Me,{children:[(0,e.jsx)(Ue,{children:"Executor console"}),(0,e.jsxs)(Re,{children:["Choose where to manage accounts for “",t.name,"”. Include your workspace path."]})]}),(0,e.jsxs)("form",{className:"space-y-4",onSubmit:a(m=>{m.preventDefault(),c.mutate()},"onSubmit"),children:[(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(ce,{htmlFor:"executor-console-url",children:"Console URL"}),(0,e.jsx)(_e,{id:"executor-console-url",type:"url",required:!0,value:l,onChange:a(m=>d(m.target.value),"onChange")})]}),c.isError?(0,e.jsx)("p",{role:"alert",className:"text-sm text-bad",children:c.error.message}):null,(0,e.jsxs)(De,{className:"sm:justify-between",children:[(0,e.jsx)(A,{type:"button",variant:"ghost",onClick:s,disabled:c.isPending,children:"Cancel"}),(0,e.jsx)(A,{type:"submit",disabled:!b||c.isPending||!l.trim(),children:c.isPending?"Saving…":"Save"})]})]})]})})}a(Jt,"ExecutorManagementSetup");function Xt({connection:t,onClose:s}){const[l,d]=(0,y.useState)(""),[h,o]=(0,y.useState)(""),b=ve(),{userId:c,settled:m}=ye(),x=fe({mutationFn:a(async()=>{const f=await O.configureArcadeDiscovery(t.id,{apiKey:l.trim(),userId:h.trim()});b.setQueryData(k.tools.aggregatorApps(t.id,c),f)},"mutationFn"),onSuccess:s});return(0,e.jsx)(Le,{open:!0,onOpenChange:a(f=>{!f&&!x.isPending&&s()},"onOpenChange"),children:(0,e.jsxs)(Pe,{children:[(0,e.jsxs)(Me,{children:[(0,e.jsx)(Ue,{children:"Sync Arcade accounts"}),(0,e.jsxs)(Re,{children:["See apps available through “",t.name,"”. Your gateway works without account sync."]})]}),(0,e.jsxs)("form",{className:"space-y-4",onSubmit:a(f=>{f.preventDefault(),x.mutate()},"onSubmit"),children:[(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(ce,{htmlFor:"arcade-discovery-key",children:"Project API key"}),(0,e.jsxs)("p",{className:"text-xs text-ink-3",children:["Create a key in ",(0,e.jsx)("a",{className:"underline",href:"https://app.arcade.dev",target:"_blank",rel:"noopener noreferrer",children:"Arcade"})," for the same project as this gateway. The key is stored securely and used only for account sync."]}),(0,e.jsx)(_e,{id:"arcade-discovery-key",type:"password",autoComplete:"off",required:!0,value:l,onChange:a(f=>d(f.target.value),"onChange")})]}),(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(ce,{htmlFor:"arcade-discovery-user",children:"Arcade user ID"}),(0,e.jsx)("p",{className:"text-xs text-ink-3",children:"Use the end-user ID configured for this gateway’s sign-in. This may differ from your email address."}),(0,e.jsx)(_e,{id:"arcade-discovery-user",autoComplete:"off",required:!0,value:h,onChange:a(f=>o(f.target.value),"onChange")})]}),x.isError?(0,e.jsx)("p",{role:"alert",className:"text-sm text-bad",children:x.error instanceof Error?x.error.message:"Couldn’t save account sync. Try again."}):null,(0,e.jsxs)(De,{className:"sm:justify-between",children:[(0,e.jsx)(A,{type:"button",variant:"ghost",disabled:x.isPending,onClick:s,children:"Cancel"}),(0,e.jsx)(A,{type:"submit",disabled:!m||x.isPending||!l.trim()||!h.trim(),children:x.isPending?"Saving…":"Save and sync"})]})]})]})})}a(Xt,"ArcadeDiscoverySetup");function en({app:t,connections:s,initialConnectionId:l,onClose:d}){const[h,o]=(0,y.useState)(l??s[0]?.id??""),b=s.find(m=>m.id===h),c=b?.config?.sourceTemplateKey;return(0,e.jsx)(Le,{open:!0,onOpenChange:a(m=>{m||d()},"onOpenChange"),children:(0,e.jsxs)(Pe,{children:[(0,e.jsxs)(Me,{children:[(0,e.jsxs)(Ue,{children:["Manage ",t.name]}),(0,e.jsxs)(Re,{children:["Accounts and sign-in are managed in ",le(c)?J[c]:"the provider","."]})]}),s.length>1?(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(ce,{htmlFor:"manage-aggregator-gateway",children:"Connection"}),(0,e.jsx)("select",{id:"manage-aggregator-gateway",className:"h-9 w-full rounded-md border border-line-strong bg-bg px-3 text-sm",value:h,onChange:a(m=>o(m.target.value),"onChange"),children:s.map(m=>(0,e.jsx)("option",{value:m.id,children:m.name},m.id))})]}):null,b?(0,e.jsx)(sn,{app:t,connection:b,onClose:d},b.id):(0,e.jsx)("p",{role:"alert",children:"This connection is no longer available."})]})})}a(en,"AggregatorAppManager");function sn({app:t,connection:s,onClose:l}){const d=ve(),{userId:h,settled:o}=ye(),b=k.tools.aggregatorApps(s.id,h),c=te({queryKey:b,enabled:o,queryFn:a(()=>O.listAggregatorApps(s.id),"queryFn"),refetchInterval:a(j=>j.state.data?.sync.status==="syncing"?1500:!1,"refetchInterval")}),m=(o?c.data?.apps:void 0)?.filter(j=>j.appSlug===t.slug)??[],x=m.flatMap(j=>j.accounts.map(S=>({account:S,snapshot:j}))),f=fe({mutationFn:a(async()=>{const j=await O.refreshAggregatorApps(s.id,m.map(S=>S.toolkit));d.setQueryData(b,j)},"mutationFn")}),I=c.data?.provider,E=I?J[I]:"provider",N=I?$e(I,x[0]?.account.managementUrl??(typeof s.config?.managementUrl=="string"?s.config?.managementUrl:null)):null;return(0,e.jsxs)(e.Fragment,{children:[c.isError||f.isError||c.data?.sync.status==="error"?(0,e.jsxs)("p",{role:"alert",className:"text-sm text-bad",children:["Couldn’t check ",E,". Last known accounts are shown."]}):null,c.isLoading?(0,e.jsx)("p",{role:"status",className:"text-sm text-ink-3",children:"Loading accounts…"}):x.length?(0,e.jsx)("div",{className:"divide-y divide-line",children:x.map(({account:j,snapshot:S})=>(0,e.jsxs)("div",{className:"py-3",children:[(0,e.jsx)("p",{className:"text-sm font-medium",children:j.alias||`${t.name} account`}),(0,e.jsx)("p",{className:"text-xs text-ink-3",children:S.freshness==="stale"||S.errorAt||Date.now()-new Date(S.checkedAt).getTime()>3e5||j.status==="UNVERIFIED"?"Not verified":j.status==="ACTIVE"?"Connected":j.status==="INITIATED"?"Waiting for sign-in":"Needs sign-in"})]},`${S.toolkit}:${j.id}`))}):(0,e.jsx)("p",{className:"text-sm text-ink-3",children:c.data?.discovery.message??`No connected ${t.name} accounts.`}),(0,e.jsxs)("p",{className:"text-xs text-ink-3",children:["Via ",(0,e.jsxs)(bt,{to:`/apps/${s.id}/permissions`,onClick:l,className:"underline underline-offset-2",children:["“",s.name,"”"]})]}),(0,e.jsxs)(De,{className:"sm:justify-between",children:[(0,e.jsx)(A,{variant:"ghost",onClick:l,children:"Close"}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsx)(A,{variant:"ghost",disabled:!o||f.isPending||c.data?.discovery.availability!=="available",onClick:a(()=>f.mutate(),"onClick"),children:"Refresh"}),N?(0,e.jsx)(A,{asChild:!0,children:(0,e.jsxs)("a",{href:N,target:"_blank",rel:"noopener noreferrer",children:["Open in ",E,(0,e.jsx)(xe,{className:"size-4"})]})}):null]})]})]})}a(sn,"AccountObservations");function tn({name:t,toolkit:s,connections:l,onClose:d,onBack:h,onConnectNew:o}){const b=ve(),{userId:c,settled:m}=ye(),{pushToast:x}=ws(),[f,I]=(0,y.useState)(null),E=f??l[0]?.id??"__new__",[N,j]=(0,y.useState)(null),[S,p]=(0,y.useState)(!1),[C,R]=(0,y.useState)(null),T=l.find(i=>i.id===E);async function D(i){if(!(S||!T||!m)){I(T.id),p(!0),R(null);try{const w=await O.setupComposioApp(T.id,s,i);j(w),await b.invalidateQueries({queryKey:k.tools.composioApps(T.id),exact:!0}),await b.invalidateQueries({queryKey:k.tools.aggregatorApps(T.id,c),exact:!0}),w.status==="connected"&&(x({title:`${t} is connected through Composio.`,tone:"success"}),d())}catch(w){R(w instanceof Error?w.message:"Couldn’t configure this app. Try again.")}finally{p(!1)}}}return a(D,"submit"),(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(ce,{htmlFor:"composio-app-account",children:"Composio account"}),(0,e.jsxs)("select",{id:"composio-app-account",value:E,disabled:S,onChange:a(i=>{I(i.target.value),j(null),R(null)},"onChange"),className:"h-9 w-full rounded-md border border-line-strong bg-bg px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus",children:[l.map(i=>(0,e.jsx)("option",{value:i.id,children:i.name},i.id)),(0,e.jsx)("option",{value:"__new__",children:"Connect a new account…"})]})]}),C?(0,e.jsx)("p",{role:"alert",className:"text-sm text-bad",children:C}):null,N?(0,e.jsxs)("p",{role:"status",className:"text-sm text-ink-3",children:["Finish connecting ",t," in Composio, then return here."]}):null,N?.authorizationUrl?(0,e.jsx)(A,{asChild:!0,variant:"secondary",className:"w-full",children:(0,e.jsxs)("a",{href:N.authorizationUrl,target:"_blank",rel:"noopener noreferrer",children:["Connect ",t," in Composio",(0,e.jsx)(xe,{className:"size-4"})]})}):null,(0,e.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,e.jsx)(A,{variant:"ghost",disabled:S,onClick:h??d,children:h?"Back":"Cancel"}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[N&&N.status!=="connected"?(0,e.jsx)(A,{variant:"ghost",disabled:S,onClick:a(()=>{D({action:"start"})},"onClick"),children:"Get a new link"}):null,(0,e.jsx)(A,{disabled:!m||S||!T&&E!=="__new__",onClick:a(()=>{E==="__new__"?o():D(N?{action:"complete"}:{action:"start"})},"onClick"),children:S?"Checking…":E==="__new__"?"Connect new account":N?"I’ve connected it":"Continue"})]})]})]})}a(tn,"ComposioAppSetup");function Ie(t,s){const l=new URLSearchParams({source:t.provider,targetToolkit:t.toolkit});return s&&l.set(s.status==="draft"?"resume":"reconnect",s.id),`/apps/connect?${l}`}a(Ie,"aggregatorAppConnectHref");function nn({app:t,connections:s,initialProvider:l,onClose:d,onNavigate:h}){const[o,b]=(0,y.useState)(""),[c,m]=(0,y.useState)(()=>t.routes.find(p=>p.provider===l)??(t.routes.length===1?t.routes[0]:null)),x=t.routes.length>1,f=c?s[c.provider]??[]:[],I=f.find(p=>p.status==="active"&&p.enabled&&!Se(p.healthStatus)),E=f.find(p=>p.id===o)??I??f[0],N=c?$e(c.provider,typeof E?.config?.managementUrl=="string"?E.config.managementUrl:null):null,j=c?hs[c.provider]:null;function S(p){(s[p.provider]??[]).length===0?(h(Ie(p)),d()):m(p)}return a(S,"choose"),(0,e.jsx)(Le,{open:!0,onOpenChange:a(p=>{p||d()},"onOpenChange"),children:(0,e.jsxs)(Pe,{children:[(0,e.jsxs)(Me,{children:[(0,e.jsx)(Ue,{children:j?`Connect ${t.name} through ${j.name}`:`Connect ${t.name}`}),(0,e.jsx)(Re,{className:c?.provider==="composio"?"sr-only":void 0,children:c?.provider==="composio"?`Choose a saved Composio account or connect a new one to use ${t.name}.`:j?`Your ${j.name} gateway is already saved. ${t.name} authorization is managed inside ${j.name}.`:"Which service would you like to use? This service handles the connection and requests to this app."})]}),c?(0,e.jsxs)("div",{className:"space-y-4",children:[c.provider!=="composio"?(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsxs)(ce,{htmlFor:"aggregator-account",children:[j.name," account"]}),(0,e.jsx)("select",{id:"aggregator-account",value:E?.id??"",onChange:a(p=>b(p.target.value),"onChange"),className:"h-9 w-full rounded-md border border-line-strong bg-bg px-3 text-sm",children:f.map(p=>(0,e.jsx)("option",{value:p.id,children:p.name},p.id))})]}):null,c.provider==="composio"?(0,e.jsx)(tn,{name:t.name,toolkit:c.toolkit,connections:f.filter(p=>p.status==="active"&&p.enabled&&!Se(p.healthStatus)),onClose:d,onBack:x?()=>m(null):void 0,onConnectNew:a(()=>{h(`${Ie(c)}&new=1`),d()},"onConnectNew")}):null]}):(0,e.jsx)("div",{className:"space-y-2",children:[...t.routes].sort((p,C)=>+!!s[C.provider]?.length-+!!s[p.provider]?.length).map(p=>{const C=s[p.provider]??[],R=hs[p.provider].name,T=C.some(D=>D.status==="active"&&D.enabled&&!Se(D.healthStatus))?"Already connected":C.some(D=>D.status==="draft")?"Setup incomplete":C.length?"Needs attention":"Set up a connection";return(0,e.jsxs)("button",{type:"button",onClick:a(()=>S(p),"onClick"),className:"flex w-full items-center gap-3 rounded-lg border border-line px-4 py-3 text-left hover:bg-bg-3 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus",children:[(0,e.jsx)(Ee,{name:R,brandKey:p.provider,size:24}),(0,e.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,e.jsx)("div",{className:"text-sm font-medium",children:R}),(0,e.jsx)("div",{className:"text-xs text-ink-3",children:T})]}),(0,e.jsx)("span",{className:"text-xs text-ink-3",children:"Continue →"})]},p.provider)})}),c?.provider!=="composio"?(0,e.jsxs)(De,{className:"sm:items-center sm:justify-between",children:[(0,e.jsx)(A,{variant:"ghost",onClick:c&&x?()=>m(null):d,children:c&&x?"Back":"Cancel"}),c?(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[N?(0,e.jsx)(A,{asChild:!0,children:(0,e.jsxs)("a",{href:N,target:"_blank",rel:"noopener noreferrer",onClick:d,children:["Continue",(0,e.jsx)(xe,{className:"size-4"})]})}):null,(0,e.jsx)(A,{variant:"link",size:"sm",className:"h-auto p-0 text-xs",onClick:a(()=>{h(`${Ie(c)}&new=1`),d()},"onClick"),children:"Connect a new account"})]}):null]}):null]})})}a(nn,"AggregatorConnectDialog");var vs=new Set(Object.values(Js).map(t=>t.appSlug));function Ze(t){return Te(t)?.methods.find(s=>s.purpose==="channel"&&s.provider)?.provider??null}a(Ze,"chatProviderForSlug");function an(t,s,l){const d=Te(t),h=Ze(t);if(!d||!h)return null;const o=new URLSearchParams({provider:h}),b=d.methods.some(c=>c.purpose==="tool"&&c.transport!=="chat_sdk")?s??`/apps/connect?source=${t}`:null;return b?o.set("toolHref",b):o.set("purpose","chat"),l&&o.set("agentId",l),`/apps/chat/connect?${o.toString()}`}a(an,"chatConnectHref");function Je(t){const s=W(t),l=Te(s);return Es(l)?Kt(s):null}a(Je,"connectHrefFor");function rn(t,s){const l=Je(t);if(!l)return null;const[d,h=""]=l.split("?"),o=new URLSearchParams(h);return o.set("applicationId",s),o.set("name",we(t)),o.set("new","1"),`${d}?${o.toString()}`}a(rn,"additionalConnectionHref");function Ts(t){return Cs(t)?{kind:"attention",label:"Retired",message:ct}:t.status==="draft"?{kind:"draft",label:"Setup incomplete",message:"Finish setup before agents can use this account."}:t.enabled===!1||t.status==="disabled"?{kind:"paused",label:"Paused",message:"Agents can’t use this account right now."}:t.connectionPurpose==="ai"&&(t.healthStatus!=="ok"||nt(t.config))||Se(t.healthStatus)?{kind:"attention",label:"Needs attention",message:t.healthMessage??t.lastError??(t.authKind==="oauth"?"Sign in again to restore access.":"Replace the credential to restore access.")}:{kind:"connected",label:"Connected",message:null}}a(Ts,"connectionState");function Xe(t){return t.status==="draft"?0:1}a(Xe,"connectionRank");function ys(t){return t.chatEndpoints.some(s=>s.status!=="draft")||t.connections.some(s=>Xe(s)===1)||t.upstreamApps?.some(s=>s.status==="connected")?2:Z(t)?1:0}a(ys,"rowRank");function Z(t){return t.connections.length>0||t.chatEndpoints.length>0||!!t.upstreamApps?.some(s=>s.accounts.length>0)}a(Z,"isInstalled");function on(t,s,l){if(t.aggregatorApp&&Z(t))return{label:"Manage",href:null};const d=t.applications[0]?.id??null,h=t.slug==="agentmail"||s?an(t.slug,t.entry?Je(t.entry):null,l):null;return t.connections.length>0||t.chatEndpoints.length>0?h?{label:"Add connection",href:h}:t.entry&&d?{label:"Add account",href:rn(t.entry,d)}:{label:"Add account",href:d?`/apps/app/${d}/permissions`:null}:t.entry?.availability?.available===!1?{label:"Unavailable",href:null,title:t.entry.availability.reason??"This connector is unavailable on this instance."}:h?{label:"Connect",href:h}:t.entry?{label:t.entry.methods?.some(o=>o.purpose==="ai")?"Connect":Xs(t.entry),href:Je(t.entry)}:{label:"Connect",href:d?`/apps/app/${d}/permissions`:null}}a(on,"connectorAction");function ln(t,s){if(s.status==="draft"&&t.entry)return xs(t.slug,s.id);if(s.status==="draft"){const l=V(s);if(l&&l===t.slug&&tt(l))return xs(l,s.id)}return`/apps/${s.id}/permissions`}a(ln,"accountActionHref");function sa({renderAccountDetails:t=a(s=>s.connectionPurpose==="ai"?(0,e.jsx)(lt,{connection:s}):null,"renderAccountDetails")}={}){const s=yt(),l=typeof window>"u"?null:new URLSearchParams(window.location.search).get("chatAgentId"),d=ve(),{pushToast:h}=ws(),{selectedCompanyId:o}=vt(),b=Wt(),{userId:c,settled:m}=ye(),{enabled:x,githubEnabled:f}=ht(),{enabled:I}=xt(),{setBreadcrumbs:E}=Ft(),[N,j]=(0,y.useState)(""),[S,p]=(0,y.useState)(1),[C,R]=(0,y.useState)("wardmote"),[T,D]=(0,y.useState)(!1),[i,w]=(0,y.useState)(null),[P,U]=(0,y.useState)(null),B=(0,y.useRef)(null),[X,ee]=(0,y.useState)(null),[Q,ne]=(0,y.useState)(null),[qe,Oe]=(0,y.useState)(),[$,be]=(0,y.useState)(null);(0,y.useEffect)(()=>(E([{label:"Connectors"}]),()=>E([])),[E]),(0,y.useEffect)(()=>{j(""),p(1),R("wardmote"),D(!1),U(null),ee(null),ne(null),Oe(void 0),be(null)},[o]),(0,y.useEffect)(()=>{const n=new URLSearchParams(window.location.search);n.get("source")==="composio"&&(ee((n.get("targetToolkit")?st(n.get("targetToolkit")):null)??null),Oe("composio"))},[o]);const ae=te({queryKey:k.apps.gallery(o??"__none__"),queryFn:a(()=>O.listGallery(o),"queryFn"),enabled:!!o}),de=te({queryKey:k.tools.applications(o??"__none__"),queryFn:a(()=>O.listApplications(o),"queryFn"),enabled:!!o}),G=te({queryKey:k.tools.connections(o??"__none__"),queryFn:a(()=>O.listConnections(o),"queryFn"),enabled:!!o}),re=te({queryKey:k.chatEndpoints.list(o??"__none__"),queryFn:a(()=>fs.list(o),"queryFn"),enabled:!!o}),ss=te({queryKey:k.agents.list(o??"__none__"),queryFn:a(()=>Lt.list(o),"queryFn"),enabled:!!o&&!!re.data?.length}),Ms=(0,y.useMemo)(()=>new Map((ss.data??[]).map(n=>[n.id,n])),[ss.data]),ts=te({queryKey:k.access.companyUserDirectory(o??"__none__"),queryFn:a(()=>qt.listUserDirectory(o),"queryFn"),enabled:!!o}),F=(0,y.useMemo)(()=>(G.data?.connections??[]).filter(n=>le(V(n))&&n.transport==="mcp_remote"&&n.status!=="archived"&&!Cs(n)),[G.data]),ie=gs({queries:F.map(n=>({queryKey:k.tools.aggregatorApps(n.id,c),queryFn:a(()=>O.listAggregatorApps(n.id),"queryFn"),enabled:m,staleTime:1/0,refetchOnWindowFocus:"always",retry:!1,refetchInterval:a(u=>u.state.data?.sync?.status==="syncing"?1500:6e4,"refetchInterval")}))}),ns=ie.flatMap((n,u)=>{const v=d.getQueryState([...k.tools.aggregatorApps(F[u].id,c),"sync"])?.status==="error";return(m?n.data?.apps??[]:[]).map(M=>n.isError||v||n.data?.sync.status==="error"?{...M,errorAt:M.errorAt??new Date().toISOString()}:M)}),ue=new Map;for(const n of ns)n.accounts.length!==0&&ue.set(n.appSlug,[...ue.get(n.appSlug)??[],n]);const je=et.map(n=>({...n,routes:[...n.routes]}));for(const n of ns){if(!n.accounts.length)continue;let u=je.find(M=>M.slug===n.appSlug);const v={provider:n.provider,toolkit:n.toolkit,logoUrl:"",docsUrl:""};u||(u={slug:n.appSlug,name:n.appName,aliases:[n.toolkit],routes:[]},je.push(u)),u.routes.some(M=>M.provider===n.provider)||u.routes.push(v)}const K=fe({retry:!1,mutationFn:a(async n=>{n.kind==="chat"?n.provider==="agentmail"?await Gt.control(n.id,"remove"):await fs.setup(n.id,{action:"remove"}):await O.archiveConnection(n.id)},"mutationFn"),onSuccess:a((n,u)=>{d.invalidateQueries({queryKey:["email-inboxes",o]}),d.invalidateQueries({queryKey:k.chatEndpoints.list(o)}),d.invalidateQueries({queryKey:k.tools.connections(o)}),d.invalidateQueries({queryKey:k.tools.applications(o)}),d.invalidateQueries({queryKey:k.apps.attention(o)}),h({title:"Connection removed",body:u.kind==="chat"?`${u.providerName} is disconnected. Existing Wardmote tasks remain available.`:u.remainingConnectionCount>0?`${u.providerName} still has ${u.remainingConnectionCount} active ${u.remainingConnectionCount===1?"connection":"connections"} available to agents.`:`${u.providerName} is no longer available to agents through this connection. Its saved credentials were deleted.`,tone:"success"}),be(null)},"onSuccess"),onError:a(n=>h({title:"Couldn't remove the connection",body:n instanceof Error?n.message:"Please try again.",tone:"error"}),"onError")});function Ds(n){K.reset(),be(n)}a(Ds,"requestConnectionRemoval");const me=(ae.data?.apps??[]).filter(n=>{if(!I&&dt(W(n)))return!1;const u=Te(W(n));return he(W(n),x,f)||!u?.methods.some(v=>v.purpose==="channel")||Es(u)}),Ps=(0,y.useMemo)(()=>Bt(ts.data?.users),[ts.data]),Rs=(0,y.useMemo)(()=>new Map((G.data?.connections??[]).map(n=>[n.id,n])),[G.data]),as=(0,y.useMemo)(()=>{const n=(G.data?.connections??[]).filter(r=>r.status!=="archived"&&r.connectionPurpose!=="channel"),u=(de.data?.applications??[]).filter(r=>r.status!=="archived"&&r.type!=="chat"&&r.metadata?.purpose!=="channel"),v=new Map;for(const r of n)v.set(r.applicationId,[...v.get(r.applicationId)??[],r]);const M=new Set(me.map(r=>W(r))),H=new Map(me.map(r=>[we(r).trim().toLocaleLowerCase(),W(r)])),z=new Map;for(const r of me){const g=W(r);z.set(g,{key:`gallery:${g}`,slug:g,name:we(r),description:!he(g,x,f)&&Ze(g)?ft(g).tagline:pt(r),brandKey:g,logoUrl:mt(r),darkLogoUrl:gt(r),entry:r,applications:[],connections:[],chatEndpoints:[]})}for(const r of[{slug:"agentmail",name:"AgentMail",description:"Give agents email inboxes and handle each conversation as a task."},{slug:"imessage-photon",name:"iMessage Photon",description:"Message agents and share photos from Apple Messages with a dedicated Photon number."},{slug:"slack",name:"Slack",description:"Chat with agents from Slack channels and direct messages."},{slug:"github-code-review-bot",name:"GitHub Code Review Bot",description:"Have an agent review pull requests and respond to GitHub mentions."},{slug:"discord",name:"Discord",description:"Chat with agents from Discord channels, threads, and direct messages."},{slug:"microsoft-teams",name:"Microsoft Teams",description:"Chat with agents from Teams channels and conversations."},{slug:"telegram",name:"Telegram",description:"Chat with agents from Telegram direct messages, groups, and topics."}].filter(g=>he(g.slug,x,f)))z.has(r.slug)||z.set(r.slug,{key:`native-chat:${r.slug}`,slug:r.slug,name:r.name,description:r.description,brandKey:r.slug,entry:null,applications:[],connections:[],chatEndpoints:[]});const ze=[];for(const r of u){const g=ut(r),L=v.get(r.id)??[];if(g==="gateway"&&L.length===0)continue;let q=L.filter(_=>!vs.has(V(_)??""));if((!g||g==="link")&&L.length>0&&q.length===0)continue;const Ne=q.length;if(q=q.filter(_=>{if(_.connectionPurpose!=="ai")return!0;const ms=V(_),ke=ms?z.get(ms):void 0;return ke?(ke.applications.some(Vs=>Vs.id===r.id)||ke.applications.push(r),ke.connections.push(_),!1):!0}),Ne>0&&q.length===0)continue;const Hs=q.map(_=>_.config?.sourceTemplateKey??_.transportConfig?.sourceTemplateKey).find(_=>typeof _=="string"&&M.has(_)),Ws=q.flatMap(_=>[_.config?.url,_.transportConfig?.url]).map(_=>typeof _=="string"&&W(it(_,me))||null).find(_=>!!_),us=g&&g!=="link"&&M.has(g)?g:Hs??Ws??H.get(r.name.trim().toLocaleLowerCase())??null,Be=us?z.get(us):null;if(Be){Be.applications.push(r),Be.connections.push(...q);continue}ze.push({key:`application:${r.id}`,slug:g??r.id,name:r.name,description:r.description??"A custom connector configured for this organization.",brandKey:g??r.name,entry:null,applications:[r],connections:q,chatEndpoints:[]})}for(const r of(re.data??[]).filter(g=>he(g.provider,x,f))){if(r.status==="archived")continue;let g=[...z.values()].find(L=>Ze(L.slug)===r.provider);if(!g){const L={speko:"Speko",slack:"Slack",github:"GitHub",discord:"Discord","microsoft-teams":"Microsoft Teams",telegram:"Telegram","imessage-photon":"iMessage Photon",openwa:"OpenWA",agentmail:"AgentMail"};g={key:`chat:${r.provider}`,slug:r.provider,name:L[r.provider],description:`Chat with agents through ${L[r.provider]}.`,brandKey:r.provider,entry:null,applications:[],connections:[],chatEndpoints:[]},ze.push(g)}g.chatEndpoints.push(r)}const Bs=new Set([...Zs,...ae.data?.apps??[]].flatMap(r=>[we(r),W(r)].map(ge)));for(const r of je){const g=ue.get(r.slug)??[],L=new Set([r.name,r.slug,...r.aliases].map(ge)),q=[...z.values()].find(Ne=>L.has(ge(Ne.slug))||L.has(ge(Ne.name)));q&&(q.upstreamApps=[...q.upstreamApps??[],...g],q.upstreamCatalogApp=r)}const Gs=je.filter(r=>![r.name,r.slug,...r.aliases].some(g=>Bs.has(ge(g)))).map(r=>({key:`aggregator:${r.slug}`,slug:r.slug,name:r.name,description:`Connect through ${r.routes.map(g=>J[g.provider]).join(" or ")}.`,brandKey:r.slug,logoUrl:r.routes[0]?.logoUrl,entry:null,applications:[],connections:[],chatEndpoints:[],aggregatorApp:r,upstreamApps:ue.get(r.slug)??[],upstreamCatalogApp:r}));return[...z.values(),...ze,...Gs].filter(r=>!vs.has(r.slug)||r.upstreamApps?.some(g=>g.accounts.length>0)).map(r=>({...r,connections:[...r.connections].sort((g,L)=>Xe(L)-Xe(g)||g.name.localeCompare(L.name,void 0,{sensitivity:"base"}))})).sort((r,g)=>ys(g)-ys(r)||+!!r.aggregatorApp-+!!g.aggregatorApp||r.name.localeCompare(g.name,void 0,{sensitivity:"base"})||r.key.localeCompare(g.key))},[de.data,re.data,x,f,G.data,me,ae.data,ue]),se=N.trim().toLocaleLowerCase(),Fe=(0,y.useMemo)(()=>{const n=as.filter(v=>C==="all"?!0:C==="installed"?Z(v):C==="wardmote"?!v.aggregatorApp||Z(v):le(C)&&(v.slug===C&&Z(v)||v.upstreamApps?.some(M=>M.provider===C&&M.accounts.length>0)||v.aggregatorApp?.routes.some(M=>M.provider===C)));if(!se)return n;const u=ps(se).split(" ").filter(Boolean);return n.filter(v=>{const M=ps([v.name,v.slug,v.description,...v.aggregatorApp?.aliases??[],...v.connections.map(H=>H.name),...(v.upstreamApps??[]).flatMap(H=>H.accounts.map(z=>z.alias)),...v.chatEndpoints.map(H=>H.assignedAgentName)].join(" "));return u.every(H=>M.includes(H))})},[as,se,C]),Us=Fe.filter(Z),pe=Fe.filter(n=>!Z(n)),Ke=Math.max(1,Math.ceil(pe.length/50)),oe=Math.min(S,Ke),Ce=(oe-1)*50,Ls=[...Us,...pe.slice(Ce,Ce+50)],qs=gs({queries:F.map((n,u)=>({queryKey:[...k.tools.aggregatorApps(n.id,c),"sync"],queryFn:a(async()=>{const v=await O.syncAggregatorApps(n.id);return d.setQueryData(k.tools.aggregatorApps(n.id,c),v),v},"queryFn"),enabled:m&&ie[u]?.isSuccess===!0&&ie[u].data?.discovery.availability==="available",staleTime:6e4,refetchInterval:6e4,refetchOnMount:"always",refetchOnWindowFocus:"always",retry:!1}))}),rs=ie.flatMap((n,u)=>n.isError||qs[u]?.isError?[J[V(F[u])]]:[]),Ae=fe({mutationFn:a(async n=>{await O.refreshCatalog(n);const u=await O.syncAggregatorApps(n,!0);d.setQueryData(k.tools.aggregatorApps(n,c),u),d.setQueryData([...k.tools.aggregatorApps(n,c),"sync"],u)},"mutationFn")}),Os=new Map(F.map((n,u)=>[n.id,ie[u]?.data?.sync?.status==="syncing"||Ae.isPending&&Ae.variables===n.id])),Fs=new Map(F.map((n,u)=>[n.id,ie[u]?.data])),is=(0,y.useMemo)(()=>({composio:F.filter(n=>V(n)==="composio"),arcade:F.filter(n=>V(n)==="arcade"),executor:F.filter(n=>V(n)==="executor")}),[F]);function os(n){C==="wardmote"&&!N.trim()&&n.trim()&&(R("all"),D(!0)),T&&!n.trim()&&(R("wardmote"),D(!1)),j(n),p(1)}a(os,"changeQuery");function Ks(){ee(null),d.invalidateQueries({queryKey:["tools","aggregator-apps"]}),new URLSearchParams(window.location.search).get("source")==="composio"&&s("/apps",{replace:!0})}a(Ks,"closeAggregatorSetup");function Qs(n){Oe(void 0),le(C)&&(n={...n,routes:n.routes.filter(v=>v.provider===C)});const u=n.routes.length===1?n.routes[0]:null;if(u&&is[u.provider].length===0){s(Ie(u));return}ee(n)}a(Qs,"connectAggregator");const ls=(C==="wardmote"||C==="all"||C==="installed"&&(!b.isSuccess||b.rows.some(n=>!n.revokedAt)))&&(!se||"assistant connection (mcp) wardmote codex claude opencode".includes(se)),cs=(C==="wardmote"||C==="all")&&(!se||"connect your own tool custom mcp server".includes(se));if(!o)return(0,e.jsx)("div",{className:"p-6 text-sm text-ink-3",children:"Select an organization to manage connectors."});const Qe=ae.isLoading||de.isLoading||G.isLoading||re.isLoading,ds=ae.isError||de.isError||G.isError||re.isError,zs=Fe.length===0&&!cs&&!ls;return(0,e.jsxs)("div",{ref:B,className:"max-w-5xl space-y-5 pb-12",children:[(0,e.jsxs)("header",{className:"flex flex-col items-start gap-3",children:[(0,e.jsxs)("div",{className:"relative w-full max-w-md",children:[(0,e.jsx)($t,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-ink-3"}),(0,e.jsx)(_e,{type:"search",value:N,onChange:a(n=>os(n.target.value),"onChange"),placeholder:"Search connectors…","aria-label":"Search connectors",className:"pl-9"})]}),(0,e.jsx)(Zt,{source:C,onChange:a(n=>{R(n),D(!1),p(1)},"onChange")})]}),ds?(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-3 rounded-lg border border-bad/40 bg-bad/5 px-4 py-3 text-sm text-bad",role:"alert",children:[(0,e.jsx)(Ss,{className:"h-4 w-4 shrink-0"}),(0,e.jsx)("p",{className:"min-w-0 flex-1",children:"Couldn’t load every connector. Existing accounts are shown where available."}),(0,e.jsx)(A,{type:"button",size:"sm",variant:"secondary",onClick:a(()=>{ae.refetch(),de.refetch(),G.refetch(),re.refetch()},"onClick"),children:"Try again"})]}):null,Ae.isError?(0,e.jsx)("p",{role:"alert",className:"text-sm text-bad",children:"Couldn’t refresh the gateway. Last known accounts are shown."}):null,Qe?(0,e.jsx)("div",{className:"space-y-3","aria-label":"Loading connectors",children:Array.from({length:6}).map((n,u)=>(0,e.jsx)(Ot,{className:"h-24 w-full rounded-xl"},u))}):zs?(0,e.jsxs)("div",{className:"flex flex-col items-start gap-3 rounded-xl border border-dashed border-line bg-bg-2 px-4 py-6 text-sm text-ink-3",children:[(0,e.jsxs)("p",{className:"flex items-center gap-2",children:[(0,e.jsx)(Ns,{className:"h-4 w-4"}),"No connectors match “",N.trim(),"”."]}),(0,e.jsx)(A,{variant:"secondary",size:"sm",onClick:a(()=>os(""),"onClick"),children:"Clear search"})]}):(0,e.jsxs)("div",{className:"space-y-3",role:"list","aria-label":"Connector list",children:[ls&&(0,e.jsx)(Ht,{onNavigate:s}),Ls.map(n=>(0,e.jsx)(cn,{renderAccountDetails:t,row:n,userProfileById:Ps,chatAgentById:Ms,connectionById:Rs,onNavigate:s,onRequestRemove:Ds,preselectedAgentId:l,chatConnectorsEnabled:x,githubReviewBotsEnabled:f,onConnectAggregator:Qs,onManageAggregator:a((u,v)=>ne({app:u,connectionId:v}),"onManageAggregator"),onRefreshAggregator:a(u=>Ae.mutate(u),"onRefreshAggregator"),aggregatorRefreshState:Os,discoveryByConnection:Fs,onConfigureArcade:a(u=>U(u),"onConfigureArcade"),onConfigureExecutor:a(u=>w(u),"onConfigureExecutor")},n.key)),cs?(0,e.jsx)(mn,{onNavigate:s}):null]}),rs.length?(0,e.jsxs)("p",{role:"alert",className:"text-sm text-bad",children:["Couldn’t load ",Array.from(new Set(rs)).join(" or ")," accounts. Use Refresh in the connection’s menu to try again."]}):null,!Qe&&pe.length>0?(0,e.jsxs)("nav",{"aria-label":"Connector catalog pages",className:"flex flex-wrap items-center justify-between gap-3 text-sm",children:[(0,e.jsxs)("p",{className:"text-ink-3",role:"status",children:[Ce+1,"–",Math.min(Ce+50,pe.length)," of ",pe.length.toLocaleString()," connectors"]}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(A,{variant:"secondary",size:"sm",disabled:oe===1,onClick:a(()=>{p(oe-1),B.current?.scrollIntoView?.({block:"start"})},"onClick"),children:"Previous"}),(0,e.jsxs)("span",{className:"text-xs text-ink-3",children:["Page ",oe," of ",Ke]}),(0,e.jsx)(A,{variant:"secondary",size:"sm",disabled:oe===Ke,onClick:a(()=>{p(oe+1),B.current?.scrollIntoView?.({block:"start"})},"onClick"),children:"Next"})]})]}):null,X&&!Qe&&!ds?(0,e.jsx)(nn,{app:X,initialProvider:qe,connections:is,onClose:Ks,onNavigate:s},X.slug):null,Q?(0,e.jsx)(en,{...Q,initialConnectionId:Q.connectionId,connections:F.filter(n=>Q.app.routes.some(u=>u.provider===V(n))),onClose:a(()=>ne(null),"onClose")},Q.app.slug):null,i?(0,e.jsx)(Jt,{connection:i,onClose:a(()=>w(null),"onClose")}):null,P?(0,e.jsx)(Xt,{connection:P,onClose:a(()=>U(null),"onClose")}):null,(0,e.jsx)(Et,{open:$!==null,onOpenChange:a(n=>{!n&&!K.isPending&&(be(null),K.reset())},"onOpenChange"),children:(0,e.jsxs)(At,{children:[(0,e.jsxs)(wt,{children:[(0,e.jsxs)(Ct,{children:["Remove ",$?.accountName??"this"," connection?"]}),(0,e.jsx)(jt,{children:$&&Object.values(J).includes($.providerName)?`This removes the saved ${$.providerName} connection from Wardmote and agents lose access through it. Your apps and accounts remain connected in ${$.providerName}.`:$?.kind==="chat"?`This connection will stop receiving new work from ${$.providerName}. Existing Wardmote tasks and conversation history remain available. This does not delete the app, bot, or account in ${$.providerName}.`:$&&$.remainingConnectionCount>0?`This connection's saved credentials are deleted and agents lose access through it immediately. They can still use ${$.providerName} through ${$.remainingConnectionCount} other active ${$.remainingConnectionCount===1?"connection":"connections"}.`:"The saved credentials are deleted and agents lose access immediately. Connecting it again later requires a new sign-in or key."})]}),K.isError?(0,e.jsx)("p",{role:"alert",className:"text-sm text-bad",children:K.error instanceof Error?K.error.message:"Couldn’t remove the connection. Please try again."}):null,(0,e.jsxs)(kt,{className:"sm:justify-between",children:[(0,e.jsx)(St,{disabled:K.isPending,children:"Cancel"}),(0,e.jsxs)(Nt,{className:"bg-bad text-accent-ink hover:bg-bad/90",disabled:!$||K.isPending,onClick:a(n=>{n.preventDefault(),$&&K.mutate($)},"onClick"),children:[K.isPending?(0,e.jsx)(ks,{className:"h-4 w-4 animate-spin"}):(0,e.jsx)(es,{}),K.isPending?"Removing…":"Remove connection"]})]})]})})]})}a(sa,"Browse");function cn({renderAccountDetails:t,row:s,userProfileById:l,chatAgentById:d,connectionById:h,onNavigate:o,onRequestRemove:b,preselectedAgentId:c,chatConnectorsEnabled:m,githubReviewBotsEnabled:x=!1,onConnectAggregator:f,onManageAggregator:I,onRefreshComposio:E,composioRefreshState:N,onRefreshAggregator:j,aggregatorRefreshState:S,discoveryByConnection:p,onConfigureArcade:C,onConfigureExecutor:R}){const T=on(s,he(s.slug,m,x),c),D=(s.upstreamApps??[]).flatMap(i=>{const w=h?.get(i.connectionId);return w?i.accounts.map((P,U)=>({connection:w,account:P,snapshot:i,name:P.alias||(i.accounts.length>1?`${s.name} account ${U+1}`:`${s.name} account`)})):[]});return(0,e.jsxs)("div",{role:"listitem","data-app-slug":s.slug,"data-connected":Z(s)?"true":"false",className:"overflow-hidden rounded-xl border border-line",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-3 px-4 py-4",children:[(0,e.jsx)(Ee,{name:s.name,brandKey:s.brandKey,logoUrl:s.logoUrl,darkLogoUrl:s.darkLogoUrl,size:36}),(0,e.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("h2",{className:"text-sm font-semibold text-ink",children:s.name}),s.aggregatorApp?.routes.map(i=>{const w=J[i.provider],P=s.upstreamApps?.find(X=>(X.provider??"composio")===i.provider&&X.accounts.length>0),U=!!P,B=`${U?"Manage":"Connect"} ${s.name} through ${w}, a third-party service`;return(0,e.jsxs)(Rt,{children:[(0,e.jsx)(Dt,{asChild:!0,children:(0,e.jsx)("button",{type:"button","aria-label":B,onClick:a(()=>U?I?.(s.aggregatorApp,P?.connectionId):f?.(s.aggregatorApp),"onClick"),className:"rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus",children:(0,e.jsx)(Ee,{name:w,brandKey:i.provider,size:16,compact:!0})})}),(0,e.jsx)(Pt,{children:B})]},i.provider)})]}),(0,e.jsx)("p",{className:"mt-0.5 text-xs text-ink-3",children:s.aggregatorApp&&s.upstreamApps?.some(i=>i.accounts.length>0)?`Accounts managed in ${[...new Set(s.upstreamApps?.map(i=>J[i.provider??"composio"]))].join(" and ")}.`:s.description})]}),(0,e.jsx)(A,{type:"button",size:"sm",variant:"secondary",disabled:!T.href&&!s.aggregatorApp,title:T.title,onClick:a(()=>{s.aggregatorApp&&Z(s)?I?.(s.aggregatorApp,s.upstreamApps?.find(i=>i.accounts.length>0)?.connectionId):s.aggregatorApp?f?.(s.aggregatorApp):T.href&&o(s.slug==="agentmail"?`${T.href}&setupId=${crypto.randomUUID()}`:T.href)},"onClick"),"aria-label":`${T.label} ${s.name}`,children:T.label})]}),s.connections.length>0?(0,e.jsx)("div",{className:"divide-y divide-line border-t border-line",children:s.connections.map(i=>(0,e.jsx)(dn,{details:t?.(i),row:s,connection:i,owner:Ge(i,l),onNavigate:o,onRefreshComposio:(S??N)?.has(i.id)&&(j??E)?()=>(j??E)?.(i.id):void 0,refreshingComposio:(S??N)?.get(i.id),discovery:p?.get(i.id),onConfigureArcade:C?()=>C(i):void 0,onConfigureExecutor:R?()=>R(i):void 0,onRemove:a(()=>{const w=Is(i,s.name,Ge(i,l));b({id:i.id,accountName:w,providerName:s.name,remainingConnectionCount:s.connections.filter(P=>P.id!==i.id&&P.status==="active"&&P.enabled).length})},"onRemove")},i.id))}):null,s.upstreamCatalogApp&&D.length>0?(0,e.jsx)("div",{className:"divide-y divide-line border-t border-line",children:D.map(({connection:i,account:w,name:P,snapshot:U})=>{const B=Ts(i),X=B.kind!=="connected"?B:U.freshness==="stale"||U.errorAt||Date.now()-new Date(U.checkedAt).getTime()>3e5?{kind:"attention",label:"Not verified",message:"Last known account · Refresh to verify"}:w.status==="UNVERIFIED"?{kind:"attention",label:"Not verified",message:"Account found upstream · Authorization not verified"}:w.status==="ACTIVE"?{kind:"connected",label:"Connected",message:null}:w.status==="INITIATED"?{kind:"draft",label:"Waiting for sign-in",message:"Finish connecting this account."}:{kind:"attention",label:"Needs sign-in",message:"Sign in again to restore access."},ee=U.provider??(le(i.config?.sourceTemplateKey)?i.config?.sourceTemplateKey:"composio"),Q=J[ee],ne=$e(ee,w.managementUrl??(typeof i.config?.managementUrl=="string"?i.config?.managementUrl:null)),qe=a(()=>I?.(s.upstreamCatalogApp,i.id),"manage");return(0,e.jsx)($s,{state:X,accountName:P,source:(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ee,{name:Q,brandKey:ee,size:16,compact:!0}),(0,e.jsxs)("span",{children:["Managed by ",Q," ·"]}),(0,e.jsxs)("button",{type:"button",className:"max-w-full truncate hover:underline",onClick:a(()=>o(`/apps/${i.id}/permissions`),"onClick"),children:["“",i.name,"”"]})]}),onOpen:qe,openLabel:`Manage ${P}`,children:(0,e.jsxs)(Ve,{children:[(0,e.jsx)(He,{asChild:!0,children:(0,e.jsx)(A,{type:"button",variant:"ghost",size:"icon-sm","aria-label":`Manage ${P} connection`,children:(0,e.jsx)(Ye,{className:"h-4 w-4"})})}),(0,e.jsx)(We,{align:"end",children:ne?(0,e.jsx)(Y,{asChild:!0,children:(0,e.jsxs)("a",{href:ne,target:"_blank",rel:"noopener noreferrer",children:["Open in ",Q,(0,e.jsx)(xe,{className:"size-4"})]})}):(0,e.jsxs)(Y,{disabled:!0,title:"Set the management URL on this gateway to open its console",children:["Open in ",Q,(0,e.jsx)(xe,{className:"size-4"})]})})]})},`${i.id}:${U.toolkit}:${w.id}`)})}):null,s.chatEndpoints.length>0?(0,e.jsx)("div",{className:"divide-y divide-line border-t border-line",children:s.chatEndpoints.map(i=>(0,e.jsxs)("div",{className:"flex flex-col gap-2 px-4 py-3 sm:flex-row sm:items-center sm:gap-3",children:[(0,e.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[(0,e.jsx)(Ut,{agent:d?.get(i.assignedAgentId)??{id:i.assignedAgentId,name:i.assignedAgentName},size:40,label:`${i.assignedAgentName} avatar`}),(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsxs)("button",{type:"button",className:"block max-w-full truncate text-left text-sm font-medium hover:underline",onClick:a(()=>o(`/apps/chat/${i.id}/settings`),"onClick"),children:[i.assignedAgentName," · ",i.provider==="agentmail"?"Email":i.provider==="github"?"Code review bot":"Chat"]}),(0,e.jsx)("p",{className:"truncate text-xs text-ink-3",children:i.providerAccountLabel??i.botLabel??"Provider identity"})]})]}),(0,e.jsxs)("div",{className:"flex items-center gap-2 self-end sm:self-auto",children:[(0,e.jsx)(_s,{owner:Ge({createdByUserId:(i.connectionId?h?.get(i.connectionId)?.createdByUserId:null)??i.sponsorUserId??null},l)}),["paused","attention","revoked"].includes(i.status)&&(0,e.jsx)("span",{className:"text-xs text-ink-3",children:i.status==="attention"?"Needs attention":i.status==="revoked"?"Access revoked":"Paused"}),i.status==="draft"?(0,e.jsx)(A,{size:"sm",variant:"secondary",onClick:a(()=>o(`/apps/chat/connect?provider=${i.provider}&purpose=chat&resume=${i.id}`),"onClick"),children:"Finish setup"}):null,(0,e.jsxs)(Ve,{children:[(0,e.jsx)(He,{asChild:!0,children:(0,e.jsx)(A,{type:"button",variant:"ghost",size:"icon-sm","aria-label":`Manage ${i.assignedAgentName} ${s.name} connection`,children:(0,e.jsx)(Ye,{className:"h-4 w-4"})})}),(0,e.jsxs)(We,{align:"end",children:[(0,e.jsx)(Y,{onSelect:a(()=>o(`/apps/chat/${i.id}/settings`),"onSelect"),children:"Manage"}),(0,e.jsx)(As,{}),(0,e.jsxs)(Y,{variant:"destructive",onSelect:a(()=>b({kind:"chat",provider:i.provider,id:i.id,accountName:`${i.assignedAgentName} · ${s.name}`,providerName:s.name,remainingConnectionCount:0}),"onSelect"),children:[(0,e.jsx)(es,{}),"Remove connection"]})]})]})]})]},i.id))}):null]})}a(cn,"ConnectorCard");function dn({details:t,row:s,connection:l,owner:d,onNavigate:h,onRemove:o,onRefreshComposio:b,refreshingComposio:c,discovery:m,onConfigureArcade:x,onConfigureExecutor:f}){const I=Ts(l),E=ln(s,l),N=Is(l,s.name,d);return(0,e.jsxs)($s,{state:I,accountName:N,owner:d,details:(0,e.jsxs)(e.Fragment,{children:[t,m?.discovery.message||m?.sync.status==="error"?(0,e.jsx)("p",{className:"text-xs text-ink-3",role:"status",children:m.discovery.message??m.sync.error}):null]}),openLabel:`Open ${N} permissions`,onOpen:a(()=>h(`/apps/${l.id}/permissions`),"onOpen"),children:[I.kind==="attention"||I.kind==="draft"?(0,e.jsx)(A,{type:"button",size:"sm",variant:"secondary",onClick:a(()=>h(E),"onClick"),children:I.kind==="attention"?l.requiresReauthorization===!1?"Retry access":"Reconnect":"Finish setup"}):null,(0,e.jsxs)(Ve,{children:[(0,e.jsx)(He,{asChild:!0,children:(0,e.jsx)(A,{type:"button",variant:"ghost",size:"icon-sm","aria-label":`Manage ${N} connection`,children:(0,e.jsx)(Ye,{className:"h-4 w-4"})})}),(0,e.jsxs)(We,{align:"end",children:[(0,e.jsx)(Y,{onSelect:a(()=>h(`/apps/${l.id}/permissions`),"onSelect"),children:"Permissions"}),b?(0,e.jsxs)(Y,{disabled:c,onSelect:b,children:[c?(0,e.jsx)(ks,{className:"animate-spin"}):null,"Refresh ",le(s.slug)?J[s.slug]:"Composio"]}):null,s.slug==="arcade"&&x?(0,e.jsx)(Y,{onSelect:x,children:m?.discovery.availability==="setup_required"?"Set up account sync":"Account sync settings"}):null,s.slug==="executor"&&f?(0,e.jsx)(Y,{onSelect:f,children:"Console URL"}):null,(0,e.jsx)(As,{}),(0,e.jsxs)(Y,{variant:"destructive",onSelect:o,children:[(0,e.jsx)(es,{}),"Remove connection"]})]})]})]})}a(dn,"ConnectionAccountRow");function $s({state:t,accountName:s,owner:l,source:d,details:h,openLabel:o,onOpen:b,children:c}){return(0,e.jsxs)("div",{className:"flex flex-col gap-2 px-4 py-3 sm:flex-row sm:items-center",children:[(0,e.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-2.5",children:[(0,e.jsx)(un,{state:t}),(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsx)("button",{type:"button",className:"block max-w-full cursor-pointer truncate text-left text-sm font-medium text-ink hover:underline focus-visible:underline","aria-label":o,onClick:b,children:s}),h,t.message?(0,e.jsx)("div",{className:t.kind==="attention"?"truncate text-xs text-bad":"truncate text-xs text-ink-3",children:t.message}):null]})]}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2 sm:justify-end",children:[(0,e.jsx)("div",{className:"flex items-center gap-1.5 text-xs text-ink-3",children:d??(0,e.jsx)(_s,{owner:l??null})}),c]})]})}a($s,"ConnectionAccountRowLayout");function un({state:t}){return t.kind==="connected"?(0,e.jsxs)("span",{className:"mt-0.5 text-emerald-600 dark:text-emerald-400",title:t.label,children:[(0,e.jsx)(It,{className:"h-4 w-4","aria-hidden":"true"}),(0,e.jsx)("span",{className:"sr-only",children:t.label})]}):t.kind==="attention"?(0,e.jsxs)("span",{className:"mt-0.5 text-bad",title:t.label,children:[(0,e.jsx)(Ss,{className:"h-4 w-4","aria-hidden":"true"}),(0,e.jsx)("span",{className:"sr-only",children:t.label})]}):t.kind==="draft"?(0,e.jsxs)("span",{className:"mt-0.5 text-amber-600 dark:text-amber-400",title:t.label,children:[(0,e.jsx)(zt,{className:"h-4 w-4","aria-hidden":"true"}),(0,e.jsx)("span",{className:"sr-only",children:t.label})]}):(0,e.jsxs)("span",{className:"mt-0.5 text-ink-3",title:t.label,children:[(0,e.jsx)(Qt,{className:"h-4 w-4","aria-hidden":"true"}),(0,e.jsx)("span",{className:"sr-only",children:t.label})]})}a(un,"ConnectionStatusIcon");function mn({onNavigate:t}){const[s,l]=(0,y.useState)(!1);return(0,e.jsxs)("div",{role:"listitem","data-app-slug":"custom-mcp",className:"overflow-hidden rounded-xl border border-line",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-3 px-4 py-4",children:[(0,e.jsx)("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-bg-3 text-ink-3",children:(0,e.jsx)(Ns,{className:"h-4 w-4"})}),(0,e.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,e.jsx)("h2",{className:"text-sm font-semibold text-ink",children:"Connect your own tool"}),(0,e.jsx)("p",{className:"mt-0.5 text-xs text-ink-3",children:"Add a custom MCP server or paste an existing configuration."})]}),(0,e.jsx)(A,{type:"button",size:"sm",variant:"secondary","aria-expanded":s,"aria-controls":"custom-connector-options",onClick:a(()=>l(d=>!d),"onClick"),children:s?"Close":"Connect"})]}),s?(0,e.jsxs)("div",{id:"custom-connector-options",className:"grid gap-2 border-t border-line px-4 py-3 sm:grid-cols-2",children:[(0,e.jsx)(bs,{icon:Mt,title:"Connect your own MCP server",description:"Enter the URL for a custom or self-hosted MCP server.",onClick:a(()=>t("/apps/byo"),"onClick")}),(0,e.jsx)(bs,{icon:Tt,title:"Paste a config",description:"Paste an existing setup snippet and connect it.",onClick:a(()=>t("/apps/advanced/paste-config"),"onClick")})]}):null]})}a(mn,"CustomConnectorCard");function bs({icon:t,title:s,description:l,onClick:d}){return(0,e.jsxs)("button",{type:"button",className:"flex items-center gap-3 rounded-lg border border-line px-3 py-3 text-left transition-colors hover:border-ink/30 hover:bg-bg-3/40",onClick:d,children:[(0,e.jsx)("span",{className:"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-line text-ink-3",children:(0,e.jsx)(t,{className:"h-4 w-4"})}),(0,e.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,e.jsx)("span",{className:"block text-sm font-semibold text-ink",children:s}),(0,e.jsx)("span",{className:"block text-xs text-ink-3",children:l})]}),(0,e.jsx)(_t,{className:"h-4 w-4 shrink-0 text-ink-3"})]})}a(bs,"CustomConnectorOption");export{sa as Browse};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var I=Object.defineProperty;var s=(e,a)=>I(e,"name",{value:a,configurable:!0});import{i as T}from"./rolldown-runtime-ZpX3ckPj.js";import{bn as $,f as c,l as i,na as U,t as W,ta as q,yn as S}from"./createLucideIcon-B-uEJvX6.js";import{t as D}from"./button-D3bYvq4T.js";import{t as K}from"./shield-alert-CE3cG15R.js";import{t as L}from"./triangle-alert-Cpo2fj-L.js";import{t as E}from"./input-It0utqV7.js";import{i as F,o as O,r as V,s as G,t as Z}from"./card-CtkberpO.js";import{io as J}from"./index-
|
|
1
|
+
var I=Object.defineProperty;var s=(e,a)=>I(e,"name",{value:a,configurable:!0});import{i as T}from"./rolldown-runtime-ZpX3ckPj.js";import{bn as $,f as c,l as i,na as U,t as W,ta as q,yn as S}from"./createLucideIcon-B-uEJvX6.js";import{t as D}from"./button-D3bYvq4T.js";import{t as K}from"./shield-alert-CE3cG15R.js";import{t as L}from"./triangle-alert-Cpo2fj-L.js";import{t as E}from"./input-It0utqV7.js";import{i as F,o as O,r as V,s as G,t as Z}from"./card-CtkberpO.js";import{io as J}from"./index-CSIXA5y5.js";var A={name:"wallet",size:24,node:[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]]};A.node;var Q=W(A),o=T(U(),1),t=T(q(),1);function M(e){return(e/100).toFixed(2)}s(M,"centsInputValue");function X(e){const a=e.trim();if(a.length===0)return 0;const r=Number(a);return!Number.isFinite(r)||r<0?null:Math.round(r*100)}s(X,"parseDollarInput");function P(e){return e==="lifetime"?"Lifetime budget":"Monthly UTC budget"}s(P,"windowLabel");function Y(e){return e==="hard_stop"?"text-red-700 dark:text-red-300 border-red-500/30 bg-red-500/10":e==="warning"?"text-amber-700 dark:text-amber-200 border-amber-500/30 bg-amber-500/10":"text-emerald-700 dark:text-emerald-200 border-emerald-500/30 bg-emerald-500/10"}s(Y,"statusTone");function de({summary:e,onSave:a,onUnpricedUsagePolicyChange:r,onReservationChange:u,isSaving:x,compact:h=!1,variant:R="card"}){const[v,m]=(0,o.useState)(M(e.amount));(0,o.useEffect)(()=>{m(M(e.amount))},[e.amount]);const[b,j]=(0,o.useState)(S(e.reservationCents??0)),f=(0,o.useId)();(0,o.useEffect)(()=>j(S(e.reservationCents??0)),[e.reservationCents]);let n=null;try{b.trim().startsWith("-")||(n=$(b.trim()))}catch{}const z=u?(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("label",{className:"text-sm",children:["Reserve per run (USD)",(0,t.jsx)(E,{"aria-label":"Reserve per run (USD)","aria-invalid":n===null,"aria-describedby":n===null?f:void 0,value:b,onChange:s(d=>j(d.target.value),"onChange"),inputMode:"decimal"})]}),n===null&&(0,t.jsx)("p",{id:f,role:"alert",className:"text-xs text-bad",children:"Enter a valid amount of zero or more."}),(0,t.jsx)("p",{className:"text-xs text-ink-3",children:"An estimate held before each run starts. Zero disables the estimate. Actual provider charges may exceed it."}),(0,t.jsx)(D,{variant:"secondary",disabled:x||n===null||n===(e.reservationCents??"0.0000000"),onClick:s(()=>{n!==null&&u(n)},"onClick"),children:"Update reservation"})]}):null,k=u||r?(0,t.jsxs)("details",{className:"space-y-3",children:[(0,t.jsx)("summary",{className:"cursor-pointer text-sm font-medium",children:"Advanced settings"}),(0,t.jsxs)("div",{className:"space-y-4",children:[r&&(0,t.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)("input",{type:"checkbox",checked:e.unpricedUsagePolicy!=="allow",disabled:x,onChange:s(d=>r(d.target.checked?"block":"allow"),"onChange")}),"Block new work when usage has no reliable price"]}),z]})]}):null,l=X(v),H=typeof l=="number"&&l!==e.amount&&!!a,g=e.amount>0?Math.min(100,e.utilizationPercent):0,N=e.status==="hard_stop"?K:e.status==="warning"?L:Q,p=R==="plain",w=p?(0,t.jsxs)("div",{className:"grid gap-6 sm:grid-cols-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-(length:--text-micro) uppercase tracking-(--tracking-caps) text-ink-3",children:"Observed"}),(0,t.jsx)("div",{className:"mt-2 text-xl font-semibold tabular-nums",children:c(e.observedAmount)}),(0,t.jsx)("div",{className:"mt-1 text-xs text-ink-3",children:e.amount>0?`${e.utilizationPercent}% of limit`:"No cap configured"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-(length:--text-micro) uppercase tracking-(--tracking-caps) text-ink-3",children:"Budget"}),(0,t.jsx)("div",{className:"mt-2 text-xl font-semibold tabular-nums",children:e.amount>0?c(e.amount):"Disabled"}),(0,t.jsxs)("div",{className:"mt-1 text-xs text-ink-3",children:["Soft alert at ",e.warnPercent,"%",e.paused&&e.pauseReason?` · ${e.pauseReason} pause`:""]})]})]}):(0,t.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,t.jsxs)("div",{className:"rounded-xl border border-line/70 bg-black/[0.18] px-4 py-3",children:[(0,t.jsx)("div",{className:"text-(length:--text-micro) uppercase tracking-(--tracking-caps) text-ink-3",children:"Observed"}),(0,t.jsx)("div",{className:"mt-2 text-xl font-semibold tabular-nums",children:c(e.observedAmount)}),(0,t.jsx)("div",{className:"mt-1 text-xs text-ink-3",children:e.amount>0?`${e.utilizationPercent}% of limit`:"No cap configured"})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-line/70 bg-black/[0.18] px-4 py-3",children:[(0,t.jsx)("div",{className:"text-(length:--text-micro) uppercase tracking-(--tracking-caps) text-ink-3",children:"Budget"}),(0,t.jsx)("div",{className:"mt-2 text-xl font-semibold tabular-nums",children:e.amount>0?c(e.amount):"Disabled"}),(0,t.jsxs)("div",{className:"mt-1 text-xs text-ink-3",children:["Soft alert at ",e.warnPercent,"%",e.paused&&e.pauseReason?` · ${e.pauseReason} pause`:""]})]})]}),C=(0,t.jsxs)("div",{className:"space-y-2",children:[e.pendingRunCount>0&&(0,t.jsxs)("p",{className:"text-sm text-bad",children:[e.pendingRunCount," completed runs await accounting."]}),e.unpricedEventCount>0&&(0,t.jsxs)("p",{className:"text-sm text-bad",children:[e.unpricedEventCount," usage events are unpriced. Known spend excludes their unknown cost."]}),(0,t.jsxs)("div",{className:"flex items-center justify-between text-xs text-ink-3",children:[(0,t.jsx)("span",{children:"Remaining"}),(0,t.jsx)("span",{children:e.amount>0?c(e.remainingAmount):"Unlimited"})]}),(0,t.jsx)("div",{className:i("h-2 overflow-hidden rounded-full",p?"bg-line/70":"bg-bg-3/70"),children:(0,t.jsx)("div",{role:"progressbar","aria-valuenow":Math.round(g),"aria-valuemin":0,"aria-valuemax":100,"aria-label":`Budget utilization: ${Math.round(g)}% used`,className:i("h-full rounded-full transition-(--tp-width-background-color) duration-200",e.status==="hard_stop"?"bg-(--status-task-blocked)":e.status==="warning"?"bg-(--status-task-todo)":"bg-(--status-task-done)"),style:{width:`${g}%`}})})]}),_=e.paused?(0,t.jsxs)("div",{className:"flex items-start gap-2 rounded-xl border border-red-500/30 bg-red-500/10 px-3 py-2 text-sm text-red-900 dark:text-red-100",children:[(0,t.jsx)(J,{className:"mt-0.5 h-4 w-4 shrink-0"}),(0,t.jsx)("div",{children:e.scopeType==="project"?"Execution is paused for this project until the budget block is resolved.":"Heartbeats are paused for this scope until the budget block is resolved."})]}):null,B=a?(0,t.jsxs)("div",{className:i("flex flex-col gap-3 sm:flex-row sm:items-end",p?"":"rounded-xl border border-line/70 bg-bg/50 p-3"),children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("label",{className:"text-(length:--text-micro) uppercase tracking-(--tracking-caps) text-ink-3",children:"Budget (USD)"}),(0,t.jsx)(E,{value:v,onChange:s(d=>m(d.target.value),"onChange"),className:"mt-2",inputMode:"decimal",placeholder:"0.00"})]}),(0,t.jsx)(D,{onClick:s(()=>{typeof l=="number"&&a&&a(l)},"onClick"),disabled:!H||x||l===null,children:x?"Saving...":e.amount>0?"Update budget":"Set budget"})]}):null;return p?(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-(length:--text-micro) uppercase tracking-(--tracking-caps) text-ink-3",children:e.scopeType}),(0,t.jsx)("div",{className:"mt-2 text-xl font-semibold",children:e.scopeName}),(0,t.jsx)("div",{className:"mt-2 text-sm text-ink-3",children:P(e.windowKind)})]}),(0,t.jsxs)("div",{className:i("inline-flex items-center gap-2 text-(length:--text-micro) uppercase tracking-(--tracking-caps)",e.status==="hard_stop"?"text-red-700 dark:text-red-300":e.status==="warning"?"text-amber-800 dark:text-amber-200":"text-ink-3"),children:[(0,t.jsx)(N,{className:"h-3.5 w-3.5"}),e.paused?"Paused":e.status==="warning"?"Warning":e.status==="hard_stop"?"Hard stop":"Healthy"]})]}),w,C,_,B,k,l===null?(0,t.jsx)("p",{className:"text-xs text-bad",children:"Enter a valid non-negative dollar amount."}):null]}):(0,t.jsxs)(Z,{className:i("overflow-hidden border-line/70 bg-bg-2/80",h?"":"shadow-(--shadow-extract-2)"),children:[(0,t.jsx)(O,{className:i("gap-3",h?"px-4 pt-4 pb-2":"px-5 pt-5 pb-3"),children:(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-(length:--text-micro) uppercase tracking-(--tracking-caps) text-ink-3",children:e.scopeType}),(0,t.jsx)(G,{className:"mt-1 text-base",children:e.scopeName}),(0,t.jsx)(F,{className:"mt-1",children:P(e.windowKind)})]}),(0,t.jsxs)("div",{className:i("inline-flex items-center gap-2 rounded-full border px-3 py-1 text-(length:--text-micro) uppercase tracking-(--tracking-caps)",Y(e.status)),children:[(0,t.jsx)(N,{className:"h-3.5 w-3.5"}),e.paused?"Paused":e.status==="warning"?"Warning":e.status==="hard_stop"?"Hard stop":"Healthy"]})]})}),(0,t.jsxs)(V,{className:i("space-y-4",h?"px-4 pb-4 pt-0":"px-5 pb-5 pt-0"),children:[w,C,_,B,k,l===null?(0,t.jsx)("p",{className:"text-xs text-bad",children:"Enter a valid non-negative dollar amount."}):null]})]})}s(de,"BudgetPolicyCard");export{de as t};
|