@tickernelz/wardmote-ui 2026.1114.1 → 2026.1114.2
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/{ActiveAgentsPanel-CKzCe8AC.js → ActiveAgentsPanel-Budj8e9v.js} +1 -1
- package/dist/assets/{AdapterManager-DFPaPUUr.js → AdapterManager-DhiW44Eo.js} +1 -1
- package/dist/assets/{AdvancedToolsRoute-CN5fWS4T.js → AdvancedToolsRoute-CICI1XRd.js} +1 -1
- package/dist/assets/{AgentActionButtons-a9LacJPP.js → AgentActionButtons-DIhpv51Y.js} +1 -1
- package/dist/assets/{AgentChat-D5FDUYuV.js → AgentChat-CeuGtMXr.js} +1 -1
- package/dist/assets/{AgentChats-TN5SE_gN.js → AgentChats-CmDtTrMa.js} +1 -1
- package/dist/assets/{AgentDefaults-CiVVS_pQ.js → AgentDefaults-DpYaMGkf.js} +1 -1
- package/dist/assets/{AgentDetail-bCAmWRXs.js → AgentDetail-DFTeFc4-.js} +1 -1
- package/dist/assets/{AgentTodoCard-BpmvHEsm.js → AgentTodoCard-DRXZ7hmU.js} +1 -1
- package/dist/assets/{Agents-CToMMxGu.js → Agents-CClUUMUq.js} +3 -3
- package/dist/assets/{AppDetail-P807ou0a.js → AppDetail-DfHLFOtj.js} +1 -1
- package/dist/assets/{AppNotConnected-DuA4PukX.js → AppNotConnected-CcmXbFtD.js} +1 -1
- package/dist/assets/{ApprovalCard-BDdZDBMj.js → ApprovalCard-uT_9D_uH.js} +1 -1
- package/dist/assets/{ApprovalDetail-CVgy1uNi.js → ApprovalDetail-CE41WFbd.js} +1 -1
- package/dist/assets/{ApprovalPayload-H5zW6yQ4.js → ApprovalPayload-_zU9bukt.js} +1 -1
- package/dist/assets/{Approvals-DL6kx45P.js → Approvals-BXrjqpKc.js} +1 -1
- package/dist/assets/{AppsReview-Bf7oB0ES.js → AppsReview-C0Y3SxmZ.js} +1 -1
- package/dist/assets/{ArtifactCard-Cp4KPgZl.js → ArtifactCard-DKUUBZ0K.js} +1 -1
- package/dist/assets/{Artifacts-Dz3eHCaQ.js → Artifacts-Bsv5m0aU.js} +1 -1
- package/dist/assets/{AssistantConnection-5Y4fBVXq.js → AssistantConnection-Dm2PaSeU.js} +1 -1
- package/dist/assets/{AttentionInteractionResolver-DlP6a6AG.js → AttentionInteractionResolver-CBjNuhYo.js} +1 -1
- package/dist/assets/{AuditHub-Dz2UXl0c.js → AuditHub-DbUni0O_.js} +1 -1
- package/dist/assets/{BoardChat-DsMVXf5M.js → BoardChat-CgzCuFIL.js} +1 -1
- package/dist/assets/{BootstrapSetupUxLab-CWWisaHp.js → BootstrapSetupUxLab-D-niQCV5.js} +1 -1
- package/dist/assets/{Browse-Be6aSv-F.js → Browse-0bmB5mqw.js} +1 -1
- package/dist/assets/{BudgetPolicyCard-Dka022-Z.js → BudgetPolicyCard-CqFUHqOj.js} +1 -1
- package/dist/assets/{CaseDetail-DdJrlm0m.js → CaseDetail-DakrB2jI.js} +1 -1
- package/dist/assets/{Cases-Da1szfrr.js → Cases-DXbr4HJt.js} +1 -1
- package/dist/assets/{ChatEndpointDetail-DSOH-zfs.js → ChatEndpointDetail-BdDKo-Gq.js} +1 -1
- package/dist/assets/{ChatEndpointSetup-J23lq-xi.js → ChatEndpointSetup-BX3iDH7N.js} +1 -1
- package/dist/assets/{ChoiceControls-B9yrYshK.js → ChoiceControls-Bu-fd6qI.js} +1 -1
- package/dist/assets/{Companies-BkHWSxdB.js → Companies-FcUNLIkt.js} +1 -1
- package/dist/assets/{CompanyAccess-BaiGlxY1.js → CompanyAccess-BUcTNg7_.js} +1 -1
- package/dist/assets/{CompanyActivity-CMBXXwCw.js → CompanyActivity-ScpRBz1G.js} +1 -1
- package/dist/assets/{CompanyConnections-CVzsivTW.js → CompanyConnections-DMEwbZv7.js} +1 -1
- package/dist/assets/{CompanyEnvironments-K7piWRrx.js → CompanyEnvironments-EqXhVruZ.js} +1 -1
- package/dist/assets/{CompanyExport-Bo8tUPaY.js → CompanyExport-DQ9ffuua.js} +1 -1
- package/dist/assets/{CompanyImport-CBVjSXPA.js → CompanyImport-BhuZu4oc.js} +1 -1
- package/dist/assets/{CompanySettings-CuU9qSp5.js → CompanySettings-BSkg4ahA.js} +1 -1
- package/dist/assets/{CompanySettingsPluginPage-59_bMQQ3.js → CompanySettingsPluginPage-BzZkZqh-.js} +1 -1
- package/dist/assets/{CompanySkills-GBJMThWx.js → CompanySkills-BbA4RKIw.js} +1 -1
- package/dist/assets/{ConfigureBuiltInAgentModal-D8Xnl51H.js → ConfigureBuiltInAgentModal-BUJPbmWc.js} +1 -1
- package/dist/assets/{CopyableGatewayUrl-GuvA-DoQ.js → CopyableGatewayUrl-BZyE_jT9.js} +1 -1
- package/dist/assets/{Dashboard-Cgj9BeTt.js → Dashboard--lTwxjV-.js} +1 -1
- package/dist/assets/{DashboardLive-Ku1cHAj9.js → DashboardLive-BYyTgF5d.js} +1 -1
- package/dist/assets/{DecisionDateChips-Z97mgInq.js → DecisionDateChips-vXwAFdua.js} +1 -1
- package/dist/assets/{DecisionQueuePage-D8cyKm4V.js → DecisionQueuePage-BaaKuZBi.js} +1 -1
- package/dist/assets/{DesignGuide-DvO3NaE-.js → DesignGuide-DS6MuXWY.js} +1 -1
- package/dist/assets/{EmailEndpointSetup-Cm_KKjjw.js → EmailEndpointSetup-CJFYu2G0.js} +1 -1
- package/dist/assets/{ExecutionWorkspaceDetail-CVB4ZY8I.js → ExecutionWorkspaceDetail-CuD5xWOB.js} +1 -1
- package/dist/assets/{GatewayDetail-DB1J44bF.js → GatewayDetail-xNVOxSIs.js} +1 -1
- package/dist/assets/{GatewaysList-CKSwMmOi.js → GatewaysList-DsSKLm1h.js} +1 -1
- package/dist/assets/{GoalDetail-Bscma2qU.js → GoalDetail-oN5pyUUY.js} +1 -1
- package/dist/assets/{GoalTree-jEFB788p.js → GoalTree-DaFizciF.js} +1 -1
- package/dist/assets/{Goals-jLNZ4UKT.js → Goals-xgGKfQZi.js} +1 -1
- package/dist/assets/{ImageGalleryModal-CghUxjQC.js → ImageGalleryModal-CjHED0Lb.js} +1 -1
- package/dist/assets/{Inbox-DHwNNh-Z.js → Inbox-wHhHozfr.js} +1 -1
- package/dist/assets/{InstanceAdvanced-C5IIPBwh.js → InstanceAdvanced-Bdf2a4c_.js} +1 -1
- package/dist/assets/{InviteLanding-BHmCRaWY.js → InviteLanding-McBYpNeW.js} +1 -1
- package/dist/assets/{IssueChatLongThreadPerf-JH8rtLk0.js → IssueChatLongThreadPerf-DD3RLbBo.js} +1 -1
- package/dist/assets/{IssueChatThread-ByTyrsxz.js → IssueChatThread-BN-_8hT8.js} +1 -1
- package/dist/assets/{IssueDetail-BIif8Swu.js → IssueDetail-CsaD311l.js} +1 -1
- package/dist/assets/{IssueOutputSection-CFE6aU9L.js → IssueOutputSection-CDIMRaF0.js} +1 -1
- package/dist/assets/{IssueRecoveryActionCard-DBgE7aMm.js → IssueRecoveryActionCard-C9qJAHes.js} +1 -1
- package/dist/assets/{IssueThreadInteractionCard-C3LFe8cu.js → IssueThreadInteractionCard-BbigJB2U.js} +1 -1
- package/dist/assets/{Issues-B5QG33RC.js → Issues-BWoc80Y9.js} +1 -1
- package/dist/assets/{LiveNowTodoLine-D52WDE8-.js → LiveNowTodoLine-B9oTH2L0.js} +1 -1
- package/dist/assets/{ManagedAiConnectionDetails-C9nV0oIT.js → ManagedAiConnectionDetails-B0aWUPkf.js} +1 -1
- package/dist/assets/{McpConnect-Bk8Qskqw.js → McpConnect-Dzf7W2K6.js} +1 -1
- package/dist/assets/{MembershipAction-DjdBY6Bk.js → MembershipAction-oiLtxQm3.js} +1 -1
- package/dist/assets/{ModelsAndProviders-BtbhNxf_.js → ModelsAndProviders-BEb4Z38S.js} +1 -1
- package/dist/assets/{NewAgent-C4JqnMkp.js → NewAgent-C3MxIRJj.js} +1 -1
- package/dist/assets/{OmpAllSettings-aHENTYf5.js → OmpAllSettings-DBtL1qDL.js} +1 -1
- package/dist/assets/{PipelineSettings-CCoxV9Es.js → PipelineSettings-BcAtsehE.js} +1 -1
- package/dist/assets/{Pipelines-DaQPh688.js → Pipelines-CkiYUQS-.js} +1 -1
- package/dist/assets/{PixelsOffice-D1X7mdpk.js → PixelsOffice-BSlctoug.js} +1 -1
- package/dist/assets/{PluginPage-B4kdPADI.js → PluginPage-C6Qnf9ka.js} +1 -1
- package/dist/assets/{PluginSettings-yP8NX-sM.js → PluginSettings-Do37r6Zu.js} +1 -1
- package/dist/assets/{ProfileDetailRoute-DMdAvFmb.js → ProfileDetailRoute-DRFQNId6.js} +1 -1
- package/dist/assets/{ProfileSettings-DVm3Tqzs.js → ProfileSettings-BMwLBQDB.js} +1 -1
- package/dist/assets/{ProfileWizardRoute-CijS7-aN.js → ProfileWizardRoute-XnnvzH9S.js} +1 -1
- package/dist/assets/{ProjectDetail-DeLSGbmz.js → ProjectDetail-BW6Lr4Iq.js} +1 -1
- package/dist/assets/{ProjectWorkspaceDetail-DPajDjA-.js → ProjectWorkspaceDetail-DR4JCa1b.js} +1 -1
- package/dist/assets/{ProjectWorkspacesContent-BCATCcZI.js → ProjectWorkspacesContent-CadPZn0k.js} +1 -1
- package/dist/assets/{Projects-DPmo6PFV.js → Projects-DLBFbxcj.js} +1 -1
- package/dist/assets/{PublicIssueSharePage-B_W1Qpy_.js → PublicIssueSharePage-C9yRZOdP.js} +1 -1
- package/dist/assets/{ReviewQueueCard-DhfCjwYP.js → ReviewQueueCard-CIkiY-Lm.js} +1 -1
- package/dist/assets/{RichWorkProductCard-rJC8tWnB.js → RichWorkProductCard-JGHGU_RI.js} +1 -1
- package/dist/assets/{RoutineDetail-Cb0oYk5B.js → RoutineDetail-izWzADvA.js} +1 -1
- package/dist/assets/{RoutineRunVariablesDialog-CWNUGmiH.js → RoutineRunVariablesDialog-DiT_o5Dm.js} +1 -1
- package/dist/assets/{Routines-Ct6W3Ht-.js → Routines-CHtabiYj.js} +1 -1
- package/dist/assets/{ScrollToBottom-BvL4b3BQ.js → ScrollToBottom-pyHLjOjY.js} +1 -1
- package/dist/assets/{Search-CXiBakEC.js → Search-yNNB6kys.js} +1 -1
- package/dist/assets/{Secrets-XUpMCMhK.js → Secrets-BOyOk5BF.js} +1 -1
- package/dist/assets/{SkillSourceTree-Brg47aIX.js → SkillSourceTree-M58QwBFF.js} +1 -1
- package/dist/assets/{SkillSources-C3kuN9Hz.js → SkillSources-Cw4PU-Bz.js} +1 -1
- package/dist/assets/{SkillStudio-DVVVKjdn.js → SkillStudio-Cj_M3ZJa.js} +1 -1
- package/dist/assets/{SourceTrustBadge-D-MXuX_l.js → SourceTrustBadge-BZBQe5No.js} +1 -1
- package/dist/assets/{StatusCards-BmNOGr1d.js → StatusCards-DaJdQUN5.js} +1 -1
- package/dist/assets/{SummarySlotCard-DiTaQ4km.js → SummarySlotCard-DlSmN6PL.js} +1 -1
- package/dist/assets/{TaskChatLab-fOJfHKjI.js → TaskChatLab-CU5eA7nX.js} +1 -1
- package/dist/assets/{TaskChatMarker-Cgyrmeab.js → TaskChatMarker-wBVUFL3u.js} +1 -1
- package/dist/assets/{TaskChatProtocolCard-DrIe_IYV.js → TaskChatProtocolCard-D-Dwy2EL.js} +1 -1
- package/dist/assets/{TaskChatThreadView-DKqNA1fZ.js → TaskChatThreadView-Crlf9I05.js} +1 -1
- package/dist/assets/{TaskDetailRelationsPanel-C9mJfMvL.js → TaskDetailRelationsPanel-CkktN1EC.js} +1 -1
- package/dist/assets/{TaskTreeControls-B1CSnDVK.js → TaskTreeControls-B_ulMOi1.js} +1 -1
- package/dist/assets/{Terminal-CGmILZtz.js → Terminal-Bo-WuezO.js} +1 -1
- package/dist/assets/{TerminalView-BqCU9Vc3.js → TerminalView-AkFY5bLC.js} +1 -1
- package/dist/assets/{TrustPresetSection-D4qB_VZo.js → TrustPresetSection-DTc1Rj4q.js} +1 -1
- package/dist/assets/{UserProfile-Cavc3nhB.js → UserProfile-C6q55R0Q.js} +1 -1
- package/dist/assets/{WhatNeedsMe-B7BSt_wb.js → WhatNeedsMe-1igJA4gL.js} +1 -1
- package/dist/assets/{Workspaces-CDTiwIHd.js → Workspaces-rtQKliW0.js} +1 -1
- package/dist/assets/{connection-owner-Cx9obLlP.js → connection-owner-CZwxTEuM.js} +1 -1
- package/dist/assets/{index-B7mmhFG7.js → index-DDoARkPG.js} +3 -3
- package/dist/assets/{issue-properties-C_y5-tny.js → issue-properties-lmRBaUTG.js} +1 -1
- package/dist/assets/{issue-workspace-selection-ChtddJZC.js → issue-workspace-selection-4JI2Uh9p.js} +1 -1
- package/dist/assets/{pipeline-stage-presentation-jxAxpF6f.js → pipeline-stage-presentation-BSuBql6K.js} +1 -1
- package/dist/assets/{shared-hwt7Xn4W.js → shared-DDwmHbeD.js} +1 -1
- package/dist/assets/{tool-taxonomy-6170LibQ.js → tool-taxonomy-DR7Q8sVs.js} +1 -1
- package/dist/assets/{transcript-adapter-C9uEslxp.js → transcript-adapter-wiFIjKfq.js} +1 -1
- package/dist/assets/{useSummaryDraftStream-BulT3Wwh.js → useSummaryDraftStream-CWOQt25o.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/sw.js +1 -1
- package/package.json +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var z=Object.defineProperty;var o=(s,t)=>z(s,"name",{value:t,configurable:!0});import{i as I}from"./rolldown-runtime-ZpX3ckPj.js";import{C as q,bt as M,l as O,na as V,ta as K}from"./createLucideIcon-DJi9suAC.js";import{t as H,v as T}from"./queryKeys-DYV5MhM_.js";import{Jt as U,Ut as X,ot as W,t as F,zt as G}from"./router-2UfGeejU.js";import{n as J,r as Q,t as Y}from"./collapsible-CqjPlqOa.js";import{a as Z,c as k,d as ee,f as se,i as N,o as te,p as ae,r as re,s as D,t as ne,u as ie}from"./dropdown-menu-CqRAF7Oj.js";import{n as le}from"./PathInstructionsModal-D4GUYKIT.js";import{t as oe}from"./arrow-up-right-BLYWl-we.js";import{t as ce}from"./chevron-right-s7L6hXXq.js";import{t as de}from"./circle-x-CFlSbYzD.js";import{t as me}from"./MarkdownBody-BTjuUgFa.js";import{t as he}from"./code-xml-BWc3OvMt.js";import{t as xe}from"./ellipsis-BTiLRUn4.js";import{t as ue}from"./eye-DRS7RbEp.js";import{r as pe,t as f}from"./button-CMwV3L1P.js";import{t as fe}from"./refresh-cw-B_Oki9wZ.js";import{t as je}from"./repeat-DGPKlc5I.js";import{t as we}from"./square-B2aH51tE.js";import{t as ge}from"./x-DRDFdlYE.js";import{i as R,n as E,t as $}from"./tooltip-B5WQ3lq5.js";import{a as be,i as ve,n as ke,r as Ne,s as ye,t as Ce}from"./dialog-CKUblzlR.js";import{u as _}from"./issue-filters-BO9xiK0c.js";import{Ba as P,Ha as De,Ra as Se,Va as Me}from"./index-
|
|
1
|
+
var z=Object.defineProperty;var o=(s,t)=>z(s,"name",{value:t,configurable:!0});import{i as I}from"./rolldown-runtime-ZpX3ckPj.js";import{C as q,bt as M,l as O,na as V,ta as K}from"./createLucideIcon-DJi9suAC.js";import{t as H,v as T}from"./queryKeys-DYV5MhM_.js";import{Jt as U,Ut as X,ot as W,t as F,zt as G}from"./router-2UfGeejU.js";import{n as J,r as Q,t as Y}from"./collapsible-CqjPlqOa.js";import{a as Z,c as k,d as ee,f as se,i as N,o as te,p as ae,r as re,s as D,t as ne,u as ie}from"./dropdown-menu-CqRAF7Oj.js";import{n as le}from"./PathInstructionsModal-D4GUYKIT.js";import{t as oe}from"./arrow-up-right-BLYWl-we.js";import{t as ce}from"./chevron-right-s7L6hXXq.js";import{t as de}from"./circle-x-CFlSbYzD.js";import{t as me}from"./MarkdownBody-BTjuUgFa.js";import{t as he}from"./code-xml-BWc3OvMt.js";import{t as xe}from"./ellipsis-BTiLRUn4.js";import{t as ue}from"./eye-DRS7RbEp.js";import{r as pe,t as f}from"./button-CMwV3L1P.js";import{t as fe}from"./refresh-cw-B_Oki9wZ.js";import{t as je}from"./repeat-DGPKlc5I.js";import{t as we}from"./square-B2aH51tE.js";import{t as ge}from"./x-DRDFdlYE.js";import{i as R,n as E,t as $}from"./tooltip-B5WQ3lq5.js";import{a as be,i as ve,n as ke,r as Ne,s as ye,t as Ce}from"./dialog-CKUblzlR.js";import{u as _}from"./issue-filters-BO9xiK0c.js";import{Ba as P,Ha as De,Ra as Se,Va as Me}from"./index-DDoARkPG.js";import{l as Te,n as Re,o as Ee,s as $e,u as _e}from"./ImageGalleryModal-CjHED0Lb.js";import{i as Pe,r as Le,t as Be}from"./TaskDetailRelationsPanel-CkktN1EC.js";var e=I(K(),1);function Ie({createdFrom:s,issueLinkState:t,className:n}){if(!s)return null;const{issue:a,agent:i}=s,r=a.identifier??a.id;return(0,e.jsxs)("p",{"data-testid":"issue-created-from",className:O("flex min-w-0 items-center gap-1 text-xs text-ink-3",n),children:[(0,e.jsx)(W,{"aria-hidden":!0,className:"h-3 w-3 shrink-0"}),(0,e.jsx)("span",{className:"shrink-0",children:"Created from"}),(0,e.jsx)(F,{to:X(r),state:t,onClickCapture:o(()=>U(r,t),"onClickCapture"),className:"min-w-0 truncate hover:text-ink transition-colors",title:a.title,children:a.identifier?`${a.identifier} ${a.title}`:a.title}),i&&(0,e.jsxs)("span",{className:"shrink-0",children:["by ",i.name]})]})}o(Ie,"IssueCreatedFromNote");function y({name:s,projectPath:t,children:n}){return(0,e.jsx)(Y,{defaultOpen:!0,asChild:!0,children:(0,e.jsxs)("section",{"aria-label":s,children:[(0,e.jsxs)("div",{className:"group/header flex items-center gap-1 rounded-md hover:bg-bg-3/50",children:[(0,e.jsx)("h2",{children:(0,e.jsxs)(Q,{className:"group flex items-center gap-1 rounded-md py-1 text-left text-sm font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus",children:[(0,e.jsx)("span",{children:s}),(0,e.jsx)("span",{"aria-hidden":!0,className:"flex w-3.5 items-center justify-center opacity-0 transition-opacity duration-(--motion-duration-fast) ease-(--motion-ease-standard) group-hover/header:opacity-100 group-focus-within/header:opacity-100",children:(0,e.jsx)(ce,{className:"h-3.5 w-3.5 text-ink-3 transition-transform duration-(--motion-duration-fast) ease-(--motion-ease-standard) group-data-[state=open]:rotate-90"})})]})}),t&&(0,e.jsx)(F,{to:t,"aria-label":`Go to ${s} project`,title:`Go to ${s} project`,className:"ml-auto inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-ink-3 opacity-0 transition-opacity duration-(--motion-duration-fast) ease-(--motion-ease-standard) hover:bg-bg-3 hover:text-ink group-hover/header:opacity-100 group-focus-within/header:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus",children:(0,e.jsx)(oe,{"aria-hidden":!0,className:"h-3.5 w-3.5"})})]}),(0,e.jsx)(J,{className:"pt-2",children:n})]})})}o(y,"TaskGroup");function ws({ancestors:s=[],createdFrom:t=null,subtasks:n,createdTasks:a,projects:i,isLoading:r,hasError:c,onRetry:l,issueLinkState:d}){const m=L(n),p=new Map;for(const h of L(a)){const x=h.projectId??"no-project",g=h.projectId?i.find(w=>w.id===h.projectId)??h.project:null,u=p.get(x)??{name:g?.name??(h.projectId?"Project":"No project"),path:h.projectId?`/projects/${q(g??{id:h.projectId})}/issues`:void 0,tasks:[]};u.tasks.push(h),p.set(x,u)}return(0,e.jsxs)("section",{className:"flex flex-col gap-6","aria-label":"Related tasks",children:[t&&(0,e.jsx)(y,{name:"Created from",children:(0,e.jsx)(Ie,{createdFrom:t,issueLinkState:d,className:"px-2 text-sm"})}),s.length>0&&(0,e.jsx)(y,{name:"Ancestors",children:(0,e.jsx)(Be,{items:[...s].reverse(),emptyMessage:"",ariaLabel:"Ancestor tasks, root to parent",issueLinkState:d})}),m.length>0&&(0,e.jsx)(y,{name:"Subtasks",children:(0,e.jsx)(Le,{items:m,issueLinkState:d})}),[...p.entries()].sort(([,h],[,x])=>h.name.localeCompare(x.name)).map(([h,x])=>(0,e.jsx)(y,{name:x.name,projectPath:x.path,children:(0,e.jsx)(Pe,{items:x.tasks,ariaLabel:`${x.name} tasks`,issueLinkState:d})},h)),r&&(0,e.jsx)("p",{role:"status",className:"text-sm text-ink-3",children:"Loading tasks…"}),c&&(0,e.jsxs)("div",{role:"alert",className:"flex items-center gap-2 text-sm text-bad",children:[(0,e.jsx)("span",{children:"Could not load all tasks."}),l&&(0,e.jsx)(f,{variant:"ghost",size:"sm",onClick:l,children:"Retry"})]}),!r&&!c&&!t&&s.length===0&&n.length===0&&a.length===0&&(0,e.jsx)("p",{className:"py-6 text-center text-sm text-ink-3",children:"No tasks yet."})]})}o(ws,"TaskDetailTasksPanel");function L(s){return[...new Map(s.map(t=>[t.id,t])).values()].sort((t,n)=>_.indexOf(t.status)-_.indexOf(n.status))}o(L,"sortTasks");var C=I(V(),1);function Fe(s,t=""){return/\.csv$/i.test(s)||t.split(";")[0].trim().toLowerCase()==="text/csv"}o(Fe,"isCsvFile");function Ae(s){const t=s.replace(/^\uFEFF/,"");if(!t)return[];const n=[];let a=[],i="",r=!1;for(let c=0;c<t.length;c++){const l=t[c];l==='"'?r&&t[c+1]==='"'?(i+='"',c++):r||i===""?r=!r:i+=l:!r&&l===","?(a.push(i),i=""):!r&&(l===`
|
|
2
2
|
`||l==="\r")?(a.push(i),n.push(a),a=[],i="",l==="\r"&&t[c+1]===`
|
|
3
3
|
`&&c++):i+=l}if(r)throw new Error("A quoted field is incomplete. Switch to raw view to inspect the file.");return(i!==""||a.length||!/[\r\n]$/.test(t))&&(a.push(i),n.push(a)),n}o(Ae,"parseCsv");var S=500,B=100;function ze({text:s,title:t}){const n=(0,C.useMemo)(()=>{try{return{rows:Ae(s),error:null}}catch(l){return{rows:[],error:l.message}}},[s]);if(n.error)return(0,e.jsx)("p",{role:"alert",className:"p-4 text-sm text-ink-3",children:n.error});if(!n.rows.length)return(0,e.jsx)("p",{className:"p-4 text-sm text-ink-3",children:"File is empty."});const[a,...i]=n.rows,r=n.rows.reduce((l,d)=>Math.max(l,d.length),0),c=Array.from({length:Math.min(r,B)},(l,d)=>d);return(0,e.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col bg-bg",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2 border-b border-line px-4 py-2 text-xs text-ink-3",role:"status",children:[(0,e.jsx)("span",{className:"font-medium text-ink",children:"CSV preview"}),(0,e.jsxs)("span",{children:[i.length.toLocaleString()," ",i.length===1?"row":"rows"]}),(0,e.jsxs)("span",{children:[r.toLocaleString()," ",r===1?"column":"columns"]}),(i.length>S||r>B)&&(0,e.jsxs)("span",{children:["Showing the first ",Math.min(i.length,S)," rows and ",c.length," columns. Download for the complete file."]})]}),(0,e.jsx)("div",{className:"min-h-0 flex-1 overflow-auto focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-inset",role:"region","aria-label":`${t} CSV table`,tabIndex:0,children:(0,e.jsxs)("table",{className:"w-full border-collapse text-sm",children:[(0,e.jsxs)("caption",{className:"sr-only",children:[t," — first record used as column headers"]}),(0,e.jsx)("thead",{className:"sticky top-0 z-10 bg-bg-3",children:(0,e.jsxs)("tr",{children:[(0,e.jsxs)("th",{scope:"col",className:"w-10 border-b border-line px-3 py-3 text-right font-mono text-xs text-ink-3",children:[(0,e.jsx)("span",{className:"sr-only",children:"Row"}),"#"]}),c.map(l=>(0,e.jsx)("th",{scope:"col",className:"whitespace-nowrap border-b border-line px-4 py-3 text-left font-medium",children:a[l]||`Column ${l+1}`},l))]})}),(0,e.jsx)("tbody",{children:i.slice(0,S).map((l,d)=>(0,e.jsxs)("tr",{className:"even:bg-bg-3/30 hover:bg-bg-3/50",children:[(0,e.jsx)("th",{scope:"row",className:"border-b border-line/50 px-3 py-2 text-right font-mono text-xs font-normal text-ink-3",children:d+1}),c.map(m=>(0,e.jsx)("td",{className:"whitespace-pre-wrap border-b border-line/50 px-4 py-2 align-top",children:l[m]??""},m))]},d))})]})})]})}o(ze,"CsvPreview");function qe({html:s,title:t}){const n=(0,C.useMemo)(()=>Te(s),[s]);return(0,e.jsx)("iframe",{title:`${t} rendered HTML`,srcDoc:n,sandbox:"allow-scripts",referrerPolicy:"no-referrer",allow:"camera 'none'; microphone 'none'; geolocation 'none'; clipboard-read 'none'; clipboard-write 'none'; fullscreen 'none'",className:"block h-full min-h-0 w-full flex-1 border-0 bg-bg"})}o(qe,"HtmlArtifactPreview");function Oe({mode:s,onChange:t,label:n}){return(0,e.jsxs)("div",{className:"flex gap-1",role:"group","aria-label":n,children:[(0,e.jsx)(f,{type:"button",size:"icon-sm",variant:s==="rendered"?"secondary":"ghost","aria-label":"Rendered",title:"Rendered","aria-pressed":s==="rendered",onClick:o(()=>t("rendered"),"onClick"),children:(0,e.jsx)(ue,{"aria-hidden":!0})}),(0,e.jsx)(f,{type:"button",size:"icon-sm",variant:s==="raw"?"secondary":"ghost","aria-label":"Raw",title:"Raw","aria-pressed":s==="raw",onClick:o(()=>t("raw"),"onClick"),children:(0,e.jsx)(he,{"aria-hidden":!0})})]})}o(Oe,"FilePreviewModeToggle");async function Ve(s){if(!s.ok)throw new Error(`Could not load file (${s.status}).`);if(!s.body)throw new Error("The file response is empty.");const t=s.body.getReader(),n=new TextDecoder("utf-8",{fatal:!0});let a=0,i="";try{for(;;){const r=await t.read();if(r.done)break;if(a+=r.value.byteLength,a>524288)throw new Error("This file is too large to preview. Download it instead.");i+=n.decode(r.value,{stream:!0})}if(i+=n.decode(),i.includes("\0"))throw new Error("This file contains binary data. Download it instead.");return i}finally{await t.cancel(),t.releaseLock()}}o(Ve,"readTextPreview");function Ke({title:s,text:t,markdown:n,html:a=!1,csv:i=!1,downloadUrl:r}){const[c,l]=(0,C.useState)("rendered");(0,C.useEffect)(()=>l("rendered"),[s]);const d=i&&c==="rendered"&&t.length>0,m=a&&c==="rendered"&&t.length>0;return(0,e.jsxs)("div",{className:"flex h-full min-h-0 flex-col",children:[(0,e.jsxs)("header",{className:"flex items-center gap-2 border-b border-line px-3 py-2",children:[(0,e.jsx)("h2",{className:"min-w-0 flex-1 truncate text-sm font-medium",title:s,children:s}),n||a||i?(0,e.jsx)(Oe,{mode:c,onChange:l,label:a?"HTML view":i?"CSV view":"Markdown view"}):null,(0,e.jsx)(f,{asChild:!0,variant:"ghost",size:"icon-sm",children:(0,e.jsx)("a",{href:r,download:!0,"aria-label":`Download ${s}`,title:`Download ${s}`,children:(0,e.jsx)(Se,{"aria-hidden":!0})})})]}),(0,e.jsx)("div",{className:m||d?"flex min-h-0 flex-1 flex-col overflow-hidden":"min-h-0 flex-1 overflow-auto p-4",children:t.length===0?(0,e.jsx)("p",{className:"text-sm text-ink-3",children:"File is empty."}):d?(0,e.jsx)(ze,{text:t,title:s}):m?(0,e.jsx)(qe,{html:t,title:s}):n&&c==="rendered"?(0,e.jsx)(me,{mediaMode:"reference",children:t}):(0,e.jsx)("pre",{className:"whitespace-pre-wrap break-words font-mono text-sm","aria-label":`${s} raw text`,children:t})})]})}o(Ke,"TextAttachmentPreview");function gs({issueId:s,attachmentId:t}){const n=T({queryKey:H.issues.attachments(s),queryFn:o(()=>G.listAttachments(s),"queryFn")}),a=n.data?.find(l=>l.id===t),i=a&&$e(a)&&a.byteSize<=524288,r=T({queryKey:["task-text-attachment",s,t],queryFn:o(async({signal:l})=>Ve(await fetch(`/api/attachments/${encodeURIComponent(t)}/content`,{signal:l,credentials:"same-origin"})),"queryFn"),enabled:!!i,retry:!1});if(n.isLoading)return(0,e.jsx)("p",{className:"p-4 text-sm",role:"status",children:"Loading file…"});if(n.isError)return(0,e.jsxs)("div",{className:"p-4",role:"alert",children:["Could not load attachment details. ",(0,e.jsx)(f,{onClick:o(()=>{n.refetch()},"onClick"),children:"Retry"})]});if(!a)return(0,e.jsx)("p",{className:"p-4 text-sm",role:"status",children:"File no longer available. Close this tab or choose another file."});const c=Re(a);return!i||r.isError?(0,e.jsxs)("div",{className:"space-y-3 p-4",role:"alert",children:[(0,e.jsx)("p",{className:"text-sm",children:r.isError?"Could not preview this file. Retry or download it.":"This file is too large or is not supported for text preview. Download it instead."}),i?(0,e.jsx)(f,{onClick:o(()=>{r.refetch()},"onClick"),children:"Retry"}):null,(0,e.jsx)(f,{asChild:!0,variant:"secondary",children:(0,e.jsx)("a",{href:c,download:!0,children:"Download file"})})]}):r.data===void 0?(0,e.jsx)("p",{className:"p-4 text-sm",role:"status",children:"Loading file…"}):(0,e.jsx)(Ke,{title:a.originalFilename??a.id,text:r.data,csv:Fe(a.originalFilename??"",a.contentType),markdown:Ee(a),html:_e(a.contentType,a.originalFilename),downloadUrl:c},a.id)}o(gs,"TaskAttachmentPanel");function bs({browser:s,now:t,disabled:n=!1,onControl:a,onReconnect:i,viewport:r="fit",controlledElsewhere:c=!1,resizing:l=!1,resizeAvailable:d=!0,onResize:m}){const p=s.status==="running"||s.status==="idle",h=s.expiresAt?Date.parse(s.expiresAt):1/0,x=s.idleDeadline?Date.parse(s.idleDeadline):1/0,g=Math.min(x,h),u=Math.max(0,Math.ceil((g-t)/1e3)),w=s.status==="idle"&&u<=300,b=s.status==="idle"&&h>x&&g>t,v=`${Math.floor(u/60)}:${String(u%60).padStart(2,"0")}`,A=r==="fit"?"Fit to pane":M.find(j=>j.id===r)?.label??"Default";return p?(0,e.jsxs)("footer",{"aria-label":"Browser session",className:"flex shrink-0 flex-wrap items-center gap-x-3 gap-y-1 border-t px-3 py-2 text-xs text-ink-3",children:[w&&(0,e.jsxs)("span",{role:"timer","aria-live":"off",className:"flex items-center gap-1 whitespace-nowrap",children:[(0,e.jsx)(P,{className:"size-3","aria-hidden":"true"}),u>0?(0,e.jsxs)(e.Fragment,{children:["Closes in"," ",(0,e.jsx)("span",{className:"font-mono tabular-nums",children:v})]}):"Closing…"]}),c&&r==="fit"&&(0,e.jsx)("span",{children:"Size follows another viewer"}),l?(0,e.jsxs)("span",{role:"status",className:"flex items-center gap-1",children:[(0,e.jsx)(pe,{className:"size-3 animate-spin motion-reduce:animate-none","aria-hidden":"true"}),"Resizing…"]}):s.status==="running"&&(0,e.jsx)("span",{children:"Browsing"}),(0,e.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:[w&&b&&(0,e.jsxs)($,{children:[(0,e.jsx)(R,{asChild:!0,children:(0,e.jsx)(f,{size:"xs",variant:"ghost",disabled:n,onClick:o(()=>a("keep_open"),"onClick"),children:"Keep browsing"})}),(0,e.jsxs)(E,{children:["Keep this browser open for up to ",6e5/6e4," ","more minutes."]})]}),s.status==="running"&&(0,e.jsxs)($,{children:[(0,e.jsx)(R,{asChild:!0,children:(0,e.jsxs)(f,{size:"xs",variant:"ghost",disabled:n,onClick:o(()=>a("cancel"),"onClick"),children:[(0,e.jsx)(we,{"aria-hidden":"true"})," Stop browsing"]})}),(0,e.jsx)(E,{children:"Stop the agent’s browser work and leave the browser open."})]}),p&&(0,e.jsxs)(ne,{children:[(0,e.jsx)(ae,{asChild:!0,children:(0,e.jsx)(f,{size:"icon-xs",variant:"ghost","aria-label":"Browser options",disabled:n,children:(0,e.jsx)(xe,{"aria-hidden":"true"})})}),(0,e.jsxs)(re,{side:"top",align:"end",className:"w-64",children:[(0,e.jsxs)(ie,{children:[(0,e.jsxs)(se,{disabled:l||!d,children:[(0,e.jsx)(le,{"aria-hidden":"true"}),(0,e.jsx)("span",{children:"Browser size"}),(0,e.jsx)("span",{className:"ml-auto text-xs text-ink-3",children:A})]}),(0,e.jsxs)(ee,{className:"w-64",children:[(0,e.jsx)(Z,{children:"Browser size"}),(0,e.jsxs)(te,{value:r,onValueChange:o(j=>m(j),"onValueChange"),children:[(0,e.jsx)(D,{value:"fit",onSelect:o(()=>{r==="fit"&&m("fit")},"onSelect"),children:"Fit to pane"}),c&&(0,e.jsx)(N,{onSelect:o(()=>m("fit"),"onSelect"),children:"Fit to this pane instead"}),(0,e.jsx)(k,{}),(0,e.jsx)(D,{value:"default",onSelect:o(()=>{r==="default"&&m("default")},"onSelect"),children:"Browser default"}),(0,e.jsx)(k,{}),M.map(j=>(0,e.jsxs)(D,{value:j.id,onSelect:o(()=>{r===j.id&&m(j.id)},"onSelect"),children:[(0,e.jsx)("span",{children:j.label}),(0,e.jsxs)("span",{className:"ml-auto font-mono text-xs tabular-nums text-ink-3",children:[j.width," × ",j.height]})]},j.id))]})]})]}),(0,e.jsx)(k,{}),(0,e.jsxs)(N,{onSelect:i,className:"items-start",children:[(0,e.jsx)(fe,{className:"mt-0.5","aria-hidden":"true"}),(0,e.jsxs)("span",{className:"flex flex-col gap-1",children:[(0,e.jsx)("span",{children:"Reconnect view"}),(0,e.jsx)("span",{className:"text-xs font-normal text-ink-3",children:"Reload the live view. Browser work keeps running."})]})]}),b&&(0,e.jsxs)(N,{onSelect:o(()=>a("keep_open"),"onSelect"),className:"items-start",children:[(0,e.jsx)(P,{className:"mt-0.5","aria-hidden":"true"}),(0,e.jsxs)("span",{className:"flex flex-col gap-1",children:[(0,e.jsx)("span",{children:"Keep browser open"}),(0,e.jsx)("span",{className:"text-xs font-normal text-ink-3",children:"Keep it open for up to 10 more minutes."})]})]}),(0,e.jsx)(k,{}),(0,e.jsxs)(N,{variant:"destructive",onSelect:o(()=>a("end"),"onSelect"),className:"items-start",children:[(0,e.jsx)(ge,{className:"mt-0.5","aria-hidden":"true"}),(0,e.jsxs)("span",{className:"flex flex-col gap-1",children:[(0,e.jsx)("span",{children:"Close browser"}),(0,e.jsx)("span",{className:"text-xs font-normal text-ink-3",children:"End this browser and stop any browsing."})]})]})]})]})]})]}):null}o(bs,"TaskBrowserFooter");function vs({scope:s,canPause:t,canResume:n,canCancel:a,canRestore:i,pending:r,onPause:c,onResume:l,onCancel:d,onRestore:m}){const p="flex items-center gap-2 w-full px-2 py-1.5 text-xs rounded hover:bg-bg-3/50 disabled:opacity-50 disabled:pointer-events-none";return(0,e.jsxs)(e.Fragment,{children:[t?(0,e.jsxs)("button",{disabled:r,className:p,onClick:c,children:[(0,e.jsx)(De,{className:"h-3 w-3"}),s==="leaf"?"Pause work":"Pause subtree"]}):null,n?(0,e.jsxs)("button",{disabled:r,className:p,onClick:l,children:[(0,e.jsx)(Me,{className:"h-3 w-3"}),s==="leaf"?"Resume work":"Resume subtree"]}):null,a?(0,e.jsxs)("button",{disabled:r,className:`${p} text-bad`,onClick:d,children:[(0,e.jsx)(de,{className:"h-3 w-3"}),"Cancel subtree..."]}):null,i?(0,e.jsxs)("button",{disabled:r,className:p,onClick:m,children:[(0,e.jsx)(je,{className:"h-3 w-3"}),"Restore subtree..."]}):null]})}o(vs,"TaskTreeControlMenuItems");function ks({open:s,onOpenChange:t,mode:n,scope:a,affectedCount:i,affectedAgentCount:r,loading:c,error:l,pending:d,valid:m,wakeAgents:p,onWakeAgentsChange:h,onRetry:x,onApply:g}){const u=n==="cancel",w=`${i} task${i===1?"":"s"}`,b=u?"Cancel subtree?":n==="restore"?"Restore subtree":a==="leaf"?"Resume work":"Resume subtree";return(0,e.jsx)(Ce,{open:s,onOpenChange:o(v=>{d||t(v)},"onOpenChange"),children:(0,e.jsxs)(ke,{showCloseButton:!d,className:"max-h-(--sz-calc-18) overflow-y-auto sm:max-w-sm",children:[(0,e.jsxs)(be,{children:[(0,e.jsx)(ye,{children:b}),(0,e.jsx)(Ne,{children:c?"Loading…":u?`${w} will be cancelled.`:`${w} will ${n==="restore"?"be restored":"resume"}.`})]}),l?(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)("p",{role:"alert",className:"text-sm text-bad",children:l}),(0,e.jsx)(f,{size:"sm",variant:"secondary",disabled:d,onClick:x,children:"Retry preview"})]}):null,u?null:(0,e.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,e.jsx)("input",{type:"checkbox",checked:p,disabled:d||c||r===0,onChange:o(v=>h(v.target.checked),"onChange")}),"Wake affected agents (",r,")"]}),(0,e.jsxs)(ve,{children:[(0,e.jsx)(f,{variant:"secondary",disabled:d,onClick:o(()=>t(!1),"onClick"),children:u?"Keep tasks":"Close"}),(0,e.jsx)(f,{variant:u?"danger":"primary",disabled:d||c||!!l||!m,onClick:g,children:d?"Applying…":u?`Cancel ${w}`:n==="restore"?`Restore ${w}`:b})]})]})})}o(ks,"TaskTreeControlDialog");export{Ke as a,ze as c,gs as i,Fe as l,vs as n,Oe as o,bs as r,qe as s,ks as t,ws as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var xe=Object.defineProperty;var t=(n,l)=>xe(n,"name",{value:l,configurable:!0});import{i as ae}from"./rolldown-runtime-ZpX3ckPj.js";import{l as ee,na as pe,t as fe,ta as ge}from"./createLucideIcon-DJi9suAC.js";import{X as re,_ as Q,t as se,v as K}from"./queryKeys-DYV5MhM_.js";import{a as w,i as je,n as D,r as U,t as be}from"./TerminalView-BqCU9Vc3.js";import{n as ve}from"./CompanyContext-CSrVsSze.js";import{t as ye}from"./router-2UfGeejU.js";import{a as X,c as Se,i as p,p as Ne,r as ke,t as Ce}from"./dropdown-menu-CqRAF7Oj.js";import{t as G}from"./label-BPz3pg9_.js";import{t as S}from"./button-CMwV3L1P.js";import{t as te}from"./plus-C6fnr28l.js";import{t as ne}from"./server-DIhG4RDC.js";import{t as we}from"./trash-D7zTaHTj.js";import{t as De}from"./x-DRDFdlYE.js";import{a as Me,i as Ee,n as He,r as ze,s as Fe,t as Le}from"./dialog-CKUblzlR.js";import{t as P}from"./input-DobnTAyB.js";import{t as Ae}from"./access-GAosX22P.js";import{n as qe}from"./BreadcrumbContext-BVZDZoC0.js";import{t as Te}from"./environments-BLQs1ScE.js";import{ya as V}from"./index-B7mmhFG7.js";import{n as _e,r as Ke,t as Pe}from"./resizable-panels-Qjbo0P05.js";var ie={name:"columns-2",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],aliases:["columns"]};ie.node;var Qe=fe(ie),c=ae(pe(),1),e=ae(ge(),1);function Oe({companyId:n,open:l,savedHosts:u,onOpenChange:r,onConnect:m}){const M=re(),[N,j]=(0,c.useState)(""),[v,E]=(0,c.useState)(""),[y,L]=(0,c.useState)(""),[H,k]=(0,c.useState)(null),f=y.trim(),g=t(()=>M.invalidateQueries({queryKey:U.sshHosts(n)}),"refreshHosts"),C=Q({mutationFn:t(()=>D.createSshHost(n,{name:N.trim(),destination:v.trim(),...f?{port:Number.parseInt(f,10)}:{}}),"mutationFn"),onSuccess:t(o=>{k(null),j(""),E(""),L(""),g(),r(!1),m(o)},"onSuccess"),onError:t(o=>k(w(o,"Could not save the SSH host.")),"onError")}),b=Q({mutationFn:t(o=>D.removeSshHost(n,o),"mutationFn"),onSuccess:t(()=>{k(null),g()},"onSuccess"),onError:t(o=>k(w(o,"Could not remove the saved SSH host.")),"onError")}),z=f.length>0&&!/^[0-9]+$/.test(f),x=C.isPending||!N.trim()||!v.trim()||z;return(0,e.jsx)(Le,{open:l,onOpenChange:r,children:(0,e.jsxs)(He,{className:"sm:max-w-md",children:[(0,e.jsxs)(Me,{children:[(0,e.jsx)(Fe,{children:"Connect to host"}),(0,e.jsx)(ze,{children:"The session starts this server's ssh client with its own keys, agent and known hosts."})]}),(0,e.jsxs)("form",{className:"space-y-3",onSubmit:t(o=>{o.preventDefault(),x||C.mutate()},"onSubmit"),children:[(0,e.jsxs)("div",{className:"space-y-1",children:[(0,e.jsx)(G,{htmlFor:"ssh-host-name",children:"Name"}),(0,e.jsx)(P,{id:"ssh-host-name",value:N,placeholder:"prod-db",autoComplete:"off",onChange:t(o=>j(o.target.value),"onChange")})]}),(0,e.jsxs)("div",{className:"space-y-1",children:[(0,e.jsx)(G,{htmlFor:"ssh-host-destination",children:"Destination"}),(0,e.jsx)(P,{id:"ssh-host-destination",value:v,placeholder:"user@host",autoComplete:"off",onChange:t(o=>E(o.target.value),"onChange")})]}),(0,e.jsxs)("div",{className:"space-y-1",children:[(0,e.jsx)(G,{htmlFor:"ssh-host-port",children:"Port"}),(0,e.jsx)(P,{id:"ssh-host-port",value:y,placeholder:"22",inputMode:"numeric",autoComplete:"off","aria-invalid":z,onChange:t(o=>L(o.target.value),"onChange")})]}),H?(0,e.jsx)("p",{className:"text-xs text-bad",role:"alert",children:H}):null,u.length>0?(0,e.jsxs)("div",{className:"space-y-1 border-t border-line pt-3",children:[(0,e.jsx)("p",{className:"text-xs font-medium text-ink",children:"Saved hosts"}),(0,e.jsx)("ul",{className:"space-y-1",children:u.map(o=>(0,e.jsxs)("li",{className:"flex items-center gap-2 text-xs",children:[(0,e.jsxs)("button",{type:"button",className:"min-w-0 flex-1 truncate text-left hover:underline",onClick:t(()=>{r(!1),m(o)},"onClick"),children:[o.name,(0,e.jsxs)("span",{className:"ml-2 text-ink-3",children:[o.destination,o.port===null?"":`:${o.port}`]})]}),(0,e.jsx)(S,{type:"button",variant:"ghost",size:"icon-xs","aria-label":`Remove ${o.name}`,disabled:b.isPending&&b.variables===o.id,onClick:t(()=>b.mutate(o.id),"onClick"),children:(0,e.jsx)(we,{"aria-hidden":!0})})]},o.id))})]}):null,(0,e.jsxs)(Ee,{children:[(0,e.jsx)(S,{type:"button",variant:"ghost",onClick:t(()=>r(!1),"onClick"),children:"Cancel"}),(0,e.jsx)(S,{type:"submit",disabled:x,children:"Save and connect"})]})]})]})})}t(Oe,"SshHostDialog");var F=2;function le(n){return`wardmote:terminal-layout:v1:${n}`}t(le,"layoutKey");function Y(n){return`wardmote:terminal-titles:v1:${n}`}t(Y,"titlesKey");function oe(n){try{return JSON.parse(window.localStorage.getItem(n)??"null")}catch{return null}}t(oe,"readJson");function W(n,l){try{window.localStorage.setItem(n,JSON.stringify(l))}catch{return}}t(W,"writeJson");function $e(n){const l=oe(le(n)),u=Array.isArray(l?.panes)?l.panes.filter(r=>typeof r=="string").slice(0,F):[];return{panes:u,focused:typeof l?.focused=="number"&&l.focused>=0&&l.focused<u.length?l.focused:0}}t($e,"readLayout");function Be(n){const l=oe(Y(n));return!l||typeof l!="object"||Array.isArray(l)?{}:Object.fromEntries(Object.entries(l).filter(u=>typeof u[1]=="string"))}t(Be,"readTitles");function Re(n,l){const u=new Set(l.map(m=>m.id)),r=n.panes.filter((m,M)=>u.has(m)&&n.panes.indexOf(m)===M);return r.length===0&&l.length>0&&r.push(l[0].id),{panes:r,focused:Math.min(n.focused,Math.max(0,r.length-1))}}t(Re,"reconcileLayout");function Je(n,l){return n.focused===l.focused&&n.panes.length===l.panes.length&&n.panes.every((u,r)=>u===l.panes[r])}t(Je,"sameLayout");function Xe({companyId:n}){const l=re(),u=U.sessions(n),[r,m]=(0,c.useState)(()=>$e(n)),[M,N]=(0,c.useState)(()=>Be(n)),[j,v]=(0,c.useState)(null),[E,y]=(0,c.useState)(null),[L,H]=(0,c.useState)(!1),k=K({queryKey:se.access.currentBoardAccess,queryFn:t(()=>Ae.getCurrentBoardAccess(),"queryFn")}),f=je(k.data),g=K({queryKey:u,queryFn:t(()=>D.list(n),"queryFn")}),C=K({queryKey:se.environments.list(n),queryFn:t(()=>Te.list(n),"queryFn"),enabled:g.isSuccess}),b=(0,c.useMemo)(()=>g.data??[],[g.data]),z=(0,c.useMemo)(()=>(C.data??[]).filter(s=>s.driver==="ssh"),[C.data]),x=K({queryKey:U.sshHosts(n),queryFn:t(()=>D.listSshHosts(n),"queryFn"),enabled:f}),o=(0,c.useMemo)(()=>(x.data?.hosts??[]).filter(s=>s.source==="config"),[x.data]),A=(0,c.useMemo)(()=>(x.data?.hosts??[]).filter(s=>s.source==="saved"),[x.data]);(0,c.useEffect)(()=>{g.isSuccess&&m(s=>{const a=Re(s,b);return Je(s,a)?s:a})},[b,g.isSuccess]),(0,c.useEffect)(()=>{W(le(n),r)},[n,r]);const O=(0,c.useCallback)(s=>{l.setQueryData(u,(a=[])=>a.some(i=>i.id===s.id)?a.map(i=>i.id===s.id?s:i):[...a,s])},[l,u]),$=(0,c.useCallback)((s,a)=>{m(i=>{const d=i.panes.indexOf(s);if(d>=0)return{...i,focused:d};const h=a??i.focused,_=[...i.panes];return h>=_.length?_.push(s):_[h]=s,{panes:_.slice(0,F),focused:Math.min(h,1)}})},[]),q=Q({mutationFn:t(s=>D.create(n,s.body),"mutationFn"),onSuccess:t((s,a)=>{y(null),O(s),$(s.id,a.pane)},"onSuccess"),onError:t(s=>y(w(s,"Could not open a terminal session.")),"onError")}),B=Q({mutationFn:t(s=>D.remove(n,s),"mutationFn"),onSuccess:t((s,a)=>{y(null),l.setQueryData(u,(i=[])=>i.filter(d=>d.id!==a)),m(i=>{const d=i.panes.filter(h=>h!==a);return{panes:d,focused:Math.min(i.focused,Math.max(0,d.length-1))}}),N(i=>{if(!(a in i))return i;const{[a]:d,...h}=i;return W(Y(n),h),h})},"onSuccess"),onError:t(s=>y(w(s,"Could not close the terminal session.")),"onError")}),R=t(s=>q.mutate({body:{kind:"local"},pane:s}),"createLocal"),ce=t((s,a)=>q.mutate({body:{kind:"ssh",environmentId:s,title:a}}),"createSsh"),J=t(s=>q.mutate({body:{kind:"local",sshHostId:s.id,title:s.name}}),"createSshHost"),de=t(()=>{if(r.panes.length>=F){const a=r.panes[r.focused]??r.panes[0];m({panes:[a],focused:0});return}const s=b.find(a=>!r.panes.includes(a.id));s?$(s.id,r.panes.length):f&&R(r.panes.length)},"toggleSplit"),ue=t(s=>M[s.id]??s.title,"titleOf"),Z=t(()=>{if(!j)return;const s=j.value.trim();N(a=>{const{[j.id]:i,...d}=a,h=s?{...d,[j.id]:s}:d;return W(Y(n),h),h}),v(null)},"commitRename"),me=t(s=>{s.key==="Enter"?(s.preventDefault(),Z()):s.key==="Escape"&&(s.preventDefault(),v(null))},"onRenameKeyDown");if(g.isLoading)return(0,e.jsx)("p",{className:"p-4 text-sm text-ink-3",children:"Loading terminal sessions…"});if(g.isError)return(0,e.jsxs)("div",{className:"flex h-full min-h-(--sz-60vh) flex-col items-center justify-center gap-2 p-6 text-center","data-testid":"terminal-access-error",children:[(0,e.jsx)(V,{className:"size-6 text-ink-3","aria-hidden":!0}),(0,e.jsx)("p",{className:"text-sm font-medium text-ink",children:"Terminal unavailable"}),(0,e.jsx)("p",{className:"max-w-md text-sm text-ink-3",children:w(g.error,"Terminal sessions could not be loaded.")})]});const he=r.panes[r.focused]??null,I=new Map(b.map(s=>[s.id,s])),T=q.isPending;return(0,e.jsxs)("div",{className:"flex h-full min-h-(--sz-60vh) flex-col overflow-hidden rounded-md border border-line","data-testid":"terminal-workspace",children:[(0,e.jsxs)("div",{className:"flex shrink-0 items-center gap-1 border-b border-line px-2 py-1",children:[(0,e.jsx)("div",{role:"tablist","aria-label":"Terminal sessions",className:"flex min-w-0 flex-1 items-center gap-1 overflow-x-auto",children:b.map(s=>{const a=s.id===he,i=r.panes.includes(s.id),d=ue(s);return(0,e.jsxs)("div",{className:ee("group flex shrink-0 items-center gap-1 rounded-md border px-2 py-1 text-xs",a?"border-focus bg-bg-3 text-ink":i?"border-line text-ink":"border-transparent text-ink-3 hover:bg-bg-3"),children:[s.kind==="ssh"||s.sshHost?(0,e.jsx)(ne,{className:"size-3","aria-hidden":!0}):(0,e.jsx)(V,{className:"size-3","aria-hidden":!0}),j?.id===s.id?(0,e.jsx)(P,{autoFocus:!0,value:j.value,"aria-label":"Session title",onChange:t(h=>v({id:s.id,value:h.target.value}),"onChange"),onKeyDown:me,onBlur:Z,className:"h-6 w-32 px-1 text-xs md:text-xs"}):(0,e.jsxs)("button",{type:"button",role:"tab","aria-selected":a,title:"Double-click to rename",className:"max-w-48 truncate outline-none focus-visible:underline",onClick:t(()=>$(s.id),"onClick"),onDoubleClick:t(()=>v({id:s.id,value:d}),"onDoubleClick"),children:[d,s.status==="exited"?(0,e.jsx)("span",{className:"ml-1 text-ink-3",children:"(ended)"}):null]}),(0,e.jsx)("button",{type:"button","aria-label":`Close ${d}`,className:"rounded-sm text-ink-3 hover:text-ink",disabled:B.isPending&&B.variables===s.id,onClick:t(()=>B.mutate(s.id),"onClick"),children:(0,e.jsx)(De,{className:"size-3","aria-hidden":!0})})]},s.id)})}),f?(0,e.jsxs)(S,{type:"button",variant:"ghost",size:"xs",onClick:t(()=>R(),"onClick"),disabled:T,children:[(0,e.jsx)(te,{"aria-hidden":!0}),"Local"]}):null,(0,e.jsxs)(Ce,{children:[(0,e.jsx)(Ne,{asChild:!0,children:(0,e.jsxs)(S,{type:"button",variant:"ghost",size:"xs",disabled:T,children:[(0,e.jsx)(ne,{"aria-hidden":!0}),"SSH"]})}),(0,e.jsxs)(ke,{align:"end",className:"w-72",children:[f?(0,e.jsxs)(e.Fragment,{children:[x.isLoading?(0,e.jsx)(p,{disabled:!0,children:"Loading…"}):x.isError?(0,e.jsx)(p,{disabled:!0,className:"text-bad",children:w(x.error,"SSH hosts could not be loaded.")}):o.length===0&&A.length===0?(0,e.jsx)(p,{disabled:!0,children:"No SSH hosts"}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(X,{children:"~/.ssh/config"}),o.length===0?(0,e.jsx)(p,{disabled:!0,children:"No hosts"}):o.map(s=>(0,e.jsxs)(p,{onSelect:t(()=>J(s),"onSelect"),children:[(0,e.jsx)("span",{className:"truncate",children:s.name}),(0,e.jsx)("span",{className:"ml-auto truncate pl-2 text-xs text-ink-3",children:s.destination})]},s.id)),(0,e.jsx)(X,{children:"Saved"}),A.length===0?(0,e.jsx)(p,{disabled:!0,children:"No saved hosts"}):A.map(s=>(0,e.jsxs)(p,{onSelect:t(()=>J(s),"onSelect"),children:[(0,e.jsx)("span",{className:"truncate",children:s.name}),(0,e.jsxs)("span",{className:"ml-auto truncate pl-2 text-xs text-ink-3",children:[s.destination,s.port===null?"":`:${s.port}`]})]},s.id))]}),x.data?.configError?(0,e.jsx)(p,{disabled:!0,className:"text-ink-3",children:x.data.configError}):null]}):null,(0,e.jsx)(X,{children:"Environments"}),z.length===0?(0,e.jsx)(p,{disabled:!0,children:C.isLoading?"Loading…":"No SSH environments"}):z.map(s=>(0,e.jsx)(p,{onSelect:t(()=>ce(s.id,s.name),"onSelect"),children:s.name},s.id)),(0,e.jsx)(Se,{}),f?(0,e.jsx)(p,{onSelect:t(()=>H(!0),"onSelect"),children:"Connect to host…"}):null,(0,e.jsx)(p,{asChild:!0,children:(0,e.jsx)(ye,{to:"/company/settings/instance/environments",children:"Manage SSH environments"})})]})]}),(0,e.jsx)(S,{type:"button",variant:"ghost",size:"icon-xs","aria-label":r.panes.length>=F?"Close split":"Split terminal","aria-pressed":r.panes.length>=F,onClick:de,disabled:T||r.panes.length===0,children:(0,e.jsx)(Qe,{"aria-hidden":!0})})]}),(0,e.jsx)(Oe,{companyId:n,open:L,savedHosts:A,onOpenChange:H,onConnect:J}),E?(0,e.jsx)("p",{className:"shrink-0 border-b border-line px-3 py-1 text-xs text-bad",role:"alert",children:E}):null,r.panes.length===0?(0,e.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 p-6 text-center",children:[(0,e.jsx)(V,{className:"size-6 text-ink-3","aria-hidden":!0}),(0,e.jsx)("p",{className:"text-sm text-ink-3",children:"No terminal sessions yet."}),f?(0,e.jsxs)(S,{type:"button",variant:"secondary",size:"sm",onClick:t(()=>R(),"onClick"),disabled:T,children:[(0,e.jsx)(te,{"aria-hidden":!0}),"New local terminal"]}):(0,e.jsx)("p",{className:"max-w-md text-xs text-ink-3",children:"A shell on this host needs instance admin access. Open an SSH terminal to a registered environment instead."})]}):(0,e.jsx)(Ke,{className:"min-h-0 flex-1",children:r.panes.map((s,a)=>(0,e.jsxs)(c.Fragment,{children:[a>0?(0,e.jsx)(Pe,{}):null,(0,e.jsx)(_e,{id:`terminal-pane-${a}`,minSize:"20%",children:(0,e.jsx)("div",{className:ee("h-full min-h-0",r.panes.length>1&&a===r.focused&&"ring-1 ring-inset ring-focus"),onFocusCapture:t(()=>m(i=>i.focused===a?i:{...i,focused:a}),"onFocusCapture"),onMouseDown:t(()=>m(i=>i.focused===a?i:{...i,focused:a}),"onMouseDown"),"data-testid":`terminal-pane-${a}`,children:(0,e.jsx)(be,{companyId:n,sessionId:s,active:a===r.focused,onSessionChange:t(i=>{I.has(i.id)&&O(i)},"onSessionChange"),onExit:t(i=>{const d=I.get(s);d&&O({...d,status:"exited",exitCode:i.exitCode})},"onExit")})})})]},s))})]})}t(Xe,"TerminalWorkspace");function xs(){const{selectedCompanyId:n}=ve(),{setBreadcrumbs:l}=qe();return(0,c.useEffect)(()=>{l([{label:"Terminal"}])},[l]),n?(0,e.jsx)(Xe,{companyId:n},n):(0,e.jsx)("p",{className:"text-sm text-ink-3",children:"Select a company to open a terminal."})}t(xs,"Terminal");export{xs as Terminal};
|
|
1
|
+
var xe=Object.defineProperty;var t=(n,l)=>xe(n,"name",{value:l,configurable:!0});import{i as ae}from"./rolldown-runtime-ZpX3ckPj.js";import{l as ee,na as pe,t as fe,ta as ge}from"./createLucideIcon-DJi9suAC.js";import{X as re,_ as Q,t as se,v as K}from"./queryKeys-DYV5MhM_.js";import{a as w,i as je,n as D,r as U,t as be}from"./TerminalView-AkFY5bLC.js";import{n as ve}from"./CompanyContext-CSrVsSze.js";import{t as ye}from"./router-2UfGeejU.js";import{a as X,c as Se,i as p,p as Ne,r as ke,t as Ce}from"./dropdown-menu-CqRAF7Oj.js";import{t as G}from"./label-BPz3pg9_.js";import{t as S}from"./button-CMwV3L1P.js";import{t as te}from"./plus-C6fnr28l.js";import{t as ne}from"./server-DIhG4RDC.js";import{t as we}from"./trash-D7zTaHTj.js";import{t as De}from"./x-DRDFdlYE.js";import{a as Me,i as Ee,n as He,r as ze,s as Fe,t as Le}from"./dialog-CKUblzlR.js";import{t as P}from"./input-DobnTAyB.js";import{t as Ae}from"./access-GAosX22P.js";import{n as qe}from"./BreadcrumbContext-BVZDZoC0.js";import{t as Te}from"./environments-BLQs1ScE.js";import{ya as V}from"./index-DDoARkPG.js";import{n as _e,r as Ke,t as Pe}from"./resizable-panels-Qjbo0P05.js";var ie={name:"columns-2",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],aliases:["columns"]};ie.node;var Qe=fe(ie),c=ae(pe(),1),e=ae(ge(),1);function Oe({companyId:n,open:l,savedHosts:u,onOpenChange:r,onConnect:m}){const M=re(),[N,j]=(0,c.useState)(""),[v,E]=(0,c.useState)(""),[y,L]=(0,c.useState)(""),[H,k]=(0,c.useState)(null),f=y.trim(),g=t(()=>M.invalidateQueries({queryKey:U.sshHosts(n)}),"refreshHosts"),C=Q({mutationFn:t(()=>D.createSshHost(n,{name:N.trim(),destination:v.trim(),...f?{port:Number.parseInt(f,10)}:{}}),"mutationFn"),onSuccess:t(o=>{k(null),j(""),E(""),L(""),g(),r(!1),m(o)},"onSuccess"),onError:t(o=>k(w(o,"Could not save the SSH host.")),"onError")}),b=Q({mutationFn:t(o=>D.removeSshHost(n,o),"mutationFn"),onSuccess:t(()=>{k(null),g()},"onSuccess"),onError:t(o=>k(w(o,"Could not remove the saved SSH host.")),"onError")}),z=f.length>0&&!/^[0-9]+$/.test(f),x=C.isPending||!N.trim()||!v.trim()||z;return(0,e.jsx)(Le,{open:l,onOpenChange:r,children:(0,e.jsxs)(He,{className:"sm:max-w-md",children:[(0,e.jsxs)(Me,{children:[(0,e.jsx)(Fe,{children:"Connect to host"}),(0,e.jsx)(ze,{children:"The session starts this server's ssh client with its own keys, agent and known hosts."})]}),(0,e.jsxs)("form",{className:"space-y-3",onSubmit:t(o=>{o.preventDefault(),x||C.mutate()},"onSubmit"),children:[(0,e.jsxs)("div",{className:"space-y-1",children:[(0,e.jsx)(G,{htmlFor:"ssh-host-name",children:"Name"}),(0,e.jsx)(P,{id:"ssh-host-name",value:N,placeholder:"prod-db",autoComplete:"off",onChange:t(o=>j(o.target.value),"onChange")})]}),(0,e.jsxs)("div",{className:"space-y-1",children:[(0,e.jsx)(G,{htmlFor:"ssh-host-destination",children:"Destination"}),(0,e.jsx)(P,{id:"ssh-host-destination",value:v,placeholder:"user@host",autoComplete:"off",onChange:t(o=>E(o.target.value),"onChange")})]}),(0,e.jsxs)("div",{className:"space-y-1",children:[(0,e.jsx)(G,{htmlFor:"ssh-host-port",children:"Port"}),(0,e.jsx)(P,{id:"ssh-host-port",value:y,placeholder:"22",inputMode:"numeric",autoComplete:"off","aria-invalid":z,onChange:t(o=>L(o.target.value),"onChange")})]}),H?(0,e.jsx)("p",{className:"text-xs text-bad",role:"alert",children:H}):null,u.length>0?(0,e.jsxs)("div",{className:"space-y-1 border-t border-line pt-3",children:[(0,e.jsx)("p",{className:"text-xs font-medium text-ink",children:"Saved hosts"}),(0,e.jsx)("ul",{className:"space-y-1",children:u.map(o=>(0,e.jsxs)("li",{className:"flex items-center gap-2 text-xs",children:[(0,e.jsxs)("button",{type:"button",className:"min-w-0 flex-1 truncate text-left hover:underline",onClick:t(()=>{r(!1),m(o)},"onClick"),children:[o.name,(0,e.jsxs)("span",{className:"ml-2 text-ink-3",children:[o.destination,o.port===null?"":`:${o.port}`]})]}),(0,e.jsx)(S,{type:"button",variant:"ghost",size:"icon-xs","aria-label":`Remove ${o.name}`,disabled:b.isPending&&b.variables===o.id,onClick:t(()=>b.mutate(o.id),"onClick"),children:(0,e.jsx)(we,{"aria-hidden":!0})})]},o.id))})]}):null,(0,e.jsxs)(Ee,{children:[(0,e.jsx)(S,{type:"button",variant:"ghost",onClick:t(()=>r(!1),"onClick"),children:"Cancel"}),(0,e.jsx)(S,{type:"submit",disabled:x,children:"Save and connect"})]})]})]})})}t(Oe,"SshHostDialog");var F=2;function le(n){return`wardmote:terminal-layout:v1:${n}`}t(le,"layoutKey");function Y(n){return`wardmote:terminal-titles:v1:${n}`}t(Y,"titlesKey");function oe(n){try{return JSON.parse(window.localStorage.getItem(n)??"null")}catch{return null}}t(oe,"readJson");function W(n,l){try{window.localStorage.setItem(n,JSON.stringify(l))}catch{return}}t(W,"writeJson");function $e(n){const l=oe(le(n)),u=Array.isArray(l?.panes)?l.panes.filter(r=>typeof r=="string").slice(0,F):[];return{panes:u,focused:typeof l?.focused=="number"&&l.focused>=0&&l.focused<u.length?l.focused:0}}t($e,"readLayout");function Be(n){const l=oe(Y(n));return!l||typeof l!="object"||Array.isArray(l)?{}:Object.fromEntries(Object.entries(l).filter(u=>typeof u[1]=="string"))}t(Be,"readTitles");function Re(n,l){const u=new Set(l.map(m=>m.id)),r=n.panes.filter((m,M)=>u.has(m)&&n.panes.indexOf(m)===M);return r.length===0&&l.length>0&&r.push(l[0].id),{panes:r,focused:Math.min(n.focused,Math.max(0,r.length-1))}}t(Re,"reconcileLayout");function Je(n,l){return n.focused===l.focused&&n.panes.length===l.panes.length&&n.panes.every((u,r)=>u===l.panes[r])}t(Je,"sameLayout");function Xe({companyId:n}){const l=re(),u=U.sessions(n),[r,m]=(0,c.useState)(()=>$e(n)),[M,N]=(0,c.useState)(()=>Be(n)),[j,v]=(0,c.useState)(null),[E,y]=(0,c.useState)(null),[L,H]=(0,c.useState)(!1),k=K({queryKey:se.access.currentBoardAccess,queryFn:t(()=>Ae.getCurrentBoardAccess(),"queryFn")}),f=je(k.data),g=K({queryKey:u,queryFn:t(()=>D.list(n),"queryFn")}),C=K({queryKey:se.environments.list(n),queryFn:t(()=>Te.list(n),"queryFn"),enabled:g.isSuccess}),b=(0,c.useMemo)(()=>g.data??[],[g.data]),z=(0,c.useMemo)(()=>(C.data??[]).filter(s=>s.driver==="ssh"),[C.data]),x=K({queryKey:U.sshHosts(n),queryFn:t(()=>D.listSshHosts(n),"queryFn"),enabled:f}),o=(0,c.useMemo)(()=>(x.data?.hosts??[]).filter(s=>s.source==="config"),[x.data]),A=(0,c.useMemo)(()=>(x.data?.hosts??[]).filter(s=>s.source==="saved"),[x.data]);(0,c.useEffect)(()=>{g.isSuccess&&m(s=>{const a=Re(s,b);return Je(s,a)?s:a})},[b,g.isSuccess]),(0,c.useEffect)(()=>{W(le(n),r)},[n,r]);const O=(0,c.useCallback)(s=>{l.setQueryData(u,(a=[])=>a.some(i=>i.id===s.id)?a.map(i=>i.id===s.id?s:i):[...a,s])},[l,u]),$=(0,c.useCallback)((s,a)=>{m(i=>{const d=i.panes.indexOf(s);if(d>=0)return{...i,focused:d};const h=a??i.focused,_=[...i.panes];return h>=_.length?_.push(s):_[h]=s,{panes:_.slice(0,F),focused:Math.min(h,1)}})},[]),q=Q({mutationFn:t(s=>D.create(n,s.body),"mutationFn"),onSuccess:t((s,a)=>{y(null),O(s),$(s.id,a.pane)},"onSuccess"),onError:t(s=>y(w(s,"Could not open a terminal session.")),"onError")}),B=Q({mutationFn:t(s=>D.remove(n,s),"mutationFn"),onSuccess:t((s,a)=>{y(null),l.setQueryData(u,(i=[])=>i.filter(d=>d.id!==a)),m(i=>{const d=i.panes.filter(h=>h!==a);return{panes:d,focused:Math.min(i.focused,Math.max(0,d.length-1))}}),N(i=>{if(!(a in i))return i;const{[a]:d,...h}=i;return W(Y(n),h),h})},"onSuccess"),onError:t(s=>y(w(s,"Could not close the terminal session.")),"onError")}),R=t(s=>q.mutate({body:{kind:"local"},pane:s}),"createLocal"),ce=t((s,a)=>q.mutate({body:{kind:"ssh",environmentId:s,title:a}}),"createSsh"),J=t(s=>q.mutate({body:{kind:"local",sshHostId:s.id,title:s.name}}),"createSshHost"),de=t(()=>{if(r.panes.length>=F){const a=r.panes[r.focused]??r.panes[0];m({panes:[a],focused:0});return}const s=b.find(a=>!r.panes.includes(a.id));s?$(s.id,r.panes.length):f&&R(r.panes.length)},"toggleSplit"),ue=t(s=>M[s.id]??s.title,"titleOf"),Z=t(()=>{if(!j)return;const s=j.value.trim();N(a=>{const{[j.id]:i,...d}=a,h=s?{...d,[j.id]:s}:d;return W(Y(n),h),h}),v(null)},"commitRename"),me=t(s=>{s.key==="Enter"?(s.preventDefault(),Z()):s.key==="Escape"&&(s.preventDefault(),v(null))},"onRenameKeyDown");if(g.isLoading)return(0,e.jsx)("p",{className:"p-4 text-sm text-ink-3",children:"Loading terminal sessions…"});if(g.isError)return(0,e.jsxs)("div",{className:"flex h-full min-h-(--sz-60vh) flex-col items-center justify-center gap-2 p-6 text-center","data-testid":"terminal-access-error",children:[(0,e.jsx)(V,{className:"size-6 text-ink-3","aria-hidden":!0}),(0,e.jsx)("p",{className:"text-sm font-medium text-ink",children:"Terminal unavailable"}),(0,e.jsx)("p",{className:"max-w-md text-sm text-ink-3",children:w(g.error,"Terminal sessions could not be loaded.")})]});const he=r.panes[r.focused]??null,I=new Map(b.map(s=>[s.id,s])),T=q.isPending;return(0,e.jsxs)("div",{className:"flex h-full min-h-(--sz-60vh) flex-col overflow-hidden rounded-md border border-line","data-testid":"terminal-workspace",children:[(0,e.jsxs)("div",{className:"flex shrink-0 items-center gap-1 border-b border-line px-2 py-1",children:[(0,e.jsx)("div",{role:"tablist","aria-label":"Terminal sessions",className:"flex min-w-0 flex-1 items-center gap-1 overflow-x-auto",children:b.map(s=>{const a=s.id===he,i=r.panes.includes(s.id),d=ue(s);return(0,e.jsxs)("div",{className:ee("group flex shrink-0 items-center gap-1 rounded-md border px-2 py-1 text-xs",a?"border-focus bg-bg-3 text-ink":i?"border-line text-ink":"border-transparent text-ink-3 hover:bg-bg-3"),children:[s.kind==="ssh"||s.sshHost?(0,e.jsx)(ne,{className:"size-3","aria-hidden":!0}):(0,e.jsx)(V,{className:"size-3","aria-hidden":!0}),j?.id===s.id?(0,e.jsx)(P,{autoFocus:!0,value:j.value,"aria-label":"Session title",onChange:t(h=>v({id:s.id,value:h.target.value}),"onChange"),onKeyDown:me,onBlur:Z,className:"h-6 w-32 px-1 text-xs md:text-xs"}):(0,e.jsxs)("button",{type:"button",role:"tab","aria-selected":a,title:"Double-click to rename",className:"max-w-48 truncate outline-none focus-visible:underline",onClick:t(()=>$(s.id),"onClick"),onDoubleClick:t(()=>v({id:s.id,value:d}),"onDoubleClick"),children:[d,s.status==="exited"?(0,e.jsx)("span",{className:"ml-1 text-ink-3",children:"(ended)"}):null]}),(0,e.jsx)("button",{type:"button","aria-label":`Close ${d}`,className:"rounded-sm text-ink-3 hover:text-ink",disabled:B.isPending&&B.variables===s.id,onClick:t(()=>B.mutate(s.id),"onClick"),children:(0,e.jsx)(De,{className:"size-3","aria-hidden":!0})})]},s.id)})}),f?(0,e.jsxs)(S,{type:"button",variant:"ghost",size:"xs",onClick:t(()=>R(),"onClick"),disabled:T,children:[(0,e.jsx)(te,{"aria-hidden":!0}),"Local"]}):null,(0,e.jsxs)(Ce,{children:[(0,e.jsx)(Ne,{asChild:!0,children:(0,e.jsxs)(S,{type:"button",variant:"ghost",size:"xs",disabled:T,children:[(0,e.jsx)(ne,{"aria-hidden":!0}),"SSH"]})}),(0,e.jsxs)(ke,{align:"end",className:"w-72",children:[f?(0,e.jsxs)(e.Fragment,{children:[x.isLoading?(0,e.jsx)(p,{disabled:!0,children:"Loading…"}):x.isError?(0,e.jsx)(p,{disabled:!0,className:"text-bad",children:w(x.error,"SSH hosts could not be loaded.")}):o.length===0&&A.length===0?(0,e.jsx)(p,{disabled:!0,children:"No SSH hosts"}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(X,{children:"~/.ssh/config"}),o.length===0?(0,e.jsx)(p,{disabled:!0,children:"No hosts"}):o.map(s=>(0,e.jsxs)(p,{onSelect:t(()=>J(s),"onSelect"),children:[(0,e.jsx)("span",{className:"truncate",children:s.name}),(0,e.jsx)("span",{className:"ml-auto truncate pl-2 text-xs text-ink-3",children:s.destination})]},s.id)),(0,e.jsx)(X,{children:"Saved"}),A.length===0?(0,e.jsx)(p,{disabled:!0,children:"No saved hosts"}):A.map(s=>(0,e.jsxs)(p,{onSelect:t(()=>J(s),"onSelect"),children:[(0,e.jsx)("span",{className:"truncate",children:s.name}),(0,e.jsxs)("span",{className:"ml-auto truncate pl-2 text-xs text-ink-3",children:[s.destination,s.port===null?"":`:${s.port}`]})]},s.id))]}),x.data?.configError?(0,e.jsx)(p,{disabled:!0,className:"text-ink-3",children:x.data.configError}):null]}):null,(0,e.jsx)(X,{children:"Environments"}),z.length===0?(0,e.jsx)(p,{disabled:!0,children:C.isLoading?"Loading…":"No SSH environments"}):z.map(s=>(0,e.jsx)(p,{onSelect:t(()=>ce(s.id,s.name),"onSelect"),children:s.name},s.id)),(0,e.jsx)(Se,{}),f?(0,e.jsx)(p,{onSelect:t(()=>H(!0),"onSelect"),children:"Connect to host…"}):null,(0,e.jsx)(p,{asChild:!0,children:(0,e.jsx)(ye,{to:"/company/settings/instance/environments",children:"Manage SSH environments"})})]})]}),(0,e.jsx)(S,{type:"button",variant:"ghost",size:"icon-xs","aria-label":r.panes.length>=F?"Close split":"Split terminal","aria-pressed":r.panes.length>=F,onClick:de,disabled:T||r.panes.length===0,children:(0,e.jsx)(Qe,{"aria-hidden":!0})})]}),(0,e.jsx)(Oe,{companyId:n,open:L,savedHosts:A,onOpenChange:H,onConnect:J}),E?(0,e.jsx)("p",{className:"shrink-0 border-b border-line px-3 py-1 text-xs text-bad",role:"alert",children:E}):null,r.panes.length===0?(0,e.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 p-6 text-center",children:[(0,e.jsx)(V,{className:"size-6 text-ink-3","aria-hidden":!0}),(0,e.jsx)("p",{className:"text-sm text-ink-3",children:"No terminal sessions yet."}),f?(0,e.jsxs)(S,{type:"button",variant:"secondary",size:"sm",onClick:t(()=>R(),"onClick"),disabled:T,children:[(0,e.jsx)(te,{"aria-hidden":!0}),"New local terminal"]}):(0,e.jsx)("p",{className:"max-w-md text-xs text-ink-3",children:"A shell on this host needs instance admin access. Open an SSH terminal to a registered environment instead."})]}):(0,e.jsx)(Ke,{className:"min-h-0 flex-1",children:r.panes.map((s,a)=>(0,e.jsxs)(c.Fragment,{children:[a>0?(0,e.jsx)(Pe,{}):null,(0,e.jsx)(_e,{id:`terminal-pane-${a}`,minSize:"20%",children:(0,e.jsx)("div",{className:ee("h-full min-h-0",r.panes.length>1&&a===r.focused&&"ring-1 ring-inset ring-focus"),onFocusCapture:t(()=>m(i=>i.focused===a?i:{...i,focused:a}),"onFocusCapture"),onMouseDown:t(()=>m(i=>i.focused===a?i:{...i,focused:a}),"onMouseDown"),"data-testid":`terminal-pane-${a}`,children:(0,e.jsx)(be,{companyId:n,sessionId:s,active:a===r.focused,onSessionChange:t(i=>{I.has(i.id)&&O(i)},"onSessionChange"),onExit:t(i=>{const d=I.get(s);d&&O({...d,status:"exited",exitCode:i.exitCode})},"onExit")})})})]},s))})]})}t(Xe,"TerminalWorkspace");function xs(){const{selectedCompanyId:n}=ve(),{setBreadcrumbs:l}=qe();return(0,c.useEffect)(()=>{l([{label:"Terminal"}])},[l]),n?(0,e.jsx)(Xe,{companyId:n},n):(0,e.jsx)("p",{className:"text-sm text-ink-3",children:"Select a company to open a terminal."})}t(xs,"Terminal");export{xs as Terminal};
|