@tickernelz/wardmote-ui 2026.1118.0 → 2026.1118.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/{AdapterManager-Cz1qnS9X.js → AdapterManager-DvntZ2AW.js} +1 -1
- package/dist/assets/{AdvancedToolsRoute-7YTRdxju.js → AdvancedToolsRoute-CUW8D9Ux.js} +1 -1
- package/dist/assets/{AgentActionButtons-CE0nmrqG.js → AgentActionButtons-CQLGCtfu.js} +1 -1
- package/dist/assets/{AgentBubbleActionRow-Dqrx638X.js → AgentBubbleActionRow-CnkfFlB3.js} +1 -1
- package/dist/assets/{AgentChat-AunGdpGT.js → AgentChat-DCwwZA2b.js} +1 -1
- package/dist/assets/{AgentChats-T9fzOwzH.js → AgentChats-DMMLdo-o.js} +1 -1
- package/dist/assets/{AgentDefaults-C0WFwQky.js → AgentDefaults-Cu8O2iTJ.js} +1 -1
- package/dist/assets/{AgentDetail-DEmzneVa.js → AgentDetail-BMVWOVp-.js} +7 -7
- package/dist/assets/{AgentIconPicker-BJerBmcL.js → AgentIconPicker-DJaVz-Vx.js} +1 -1
- package/dist/assets/{AgentTodoCard-D1lORgGy.js → AgentTodoCard-C4BfJg4x.js} +1 -1
- package/dist/assets/Agents-C0IDC6KD.js +3 -0
- package/dist/assets/{AppDetail-BX1FNfWC.js → AppDetail-DzEGsx94.js} +1 -1
- package/dist/assets/{AppNotConnected-7VCE3fbW.js → AppNotConnected-BVL32B49.js} +1 -1
- package/dist/assets/{ApprovalCard-BFjlBJIl.js → ApprovalCard-DCQ49PuW.js} +1 -1
- package/dist/assets/{ApprovalDetail-nh-aAVQ1.js → ApprovalDetail-B0J70llD.js} +1 -1
- package/dist/assets/{ApprovalPayload-CrxNpWYr.js → ApprovalPayload-8lqBw-XQ.js} +1 -1
- package/dist/assets/{Approvals-T3qTJIwh.js → Approvals-BkiVjx0M.js} +1 -1
- package/dist/assets/{AppsConnect-D7l2xnv-.js → AppsConnect-B_hvpdTB.js} +1 -1
- package/dist/assets/{AppsReview-BQpLs2ic.js → AppsReview-CeXp22cE.js} +1 -1
- package/dist/assets/{ArtifactCard-9vsmkZzO.js → ArtifactCard-BV82tDLI.js} +1 -1
- package/dist/assets/{Artifacts-DN7vvCse.js → Artifacts-CL5ZmZ3m.js} +1 -1
- package/dist/assets/{AssistantConnection-DFVB49U5.js → AssistantConnection-C5rmoEsm.js} +1 -1
- package/dist/assets/{AttentionInteractionResolver-61BN1ky5.js → AttentionInteractionResolver-DxZpuIIF.js} +1 -1
- package/dist/assets/AuditHub-DDPFGvHG.js +1 -0
- package/dist/assets/{Auth-D0lGuVnd.js → Auth-CkILt4fl.js} +1 -1
- package/dist/assets/{BoardChat-CMIqWEbi.js → BoardChat-DlaNGzcQ.js} +3 -3
- package/dist/assets/{BoardClaim-CbYY66Qd.js → BoardClaim-B135Nebr.js} +1 -1
- package/dist/assets/{BootstrapSetupUxLab-M3IOGjXI.js → BootstrapSetupUxLab-B2tOIzXd.js} +1 -1
- package/dist/assets/{Browse-AYCtuCFi.js → Browse-xEc9mGl7.js} +1 -1
- package/dist/assets/{BudgetPolicyCard-Cwm5wpvU.js → BudgetPolicyCard-Ccr3EX5M.js} +1 -1
- package/dist/assets/{CaseDetail-CgZ4u934.js → CaseDetail-CvMk_M-F.js} +2 -2
- package/dist/assets/{Cases-BvCHo_JJ.js → Cases-H1Y4Oipe.js} +2 -2
- package/dist/assets/{ChatEndpointDetail-CM83nK2S.js → ChatEndpointDetail-CjDVQWl8.js} +1 -1
- package/dist/assets/{ChatEndpointSetup-Dzm1h4LA.js → ChatEndpointSetup-BfohtKVM.js} +1 -1
- package/dist/assets/{ChatIdentityConfirm-Dc4AnYX8.js → ChatIdentityConfirm-tOTIxwjm.js} +1 -1
- package/dist/assets/{CliAuth-CatEsBxW.js → CliAuth-CE0EwTW_.js} +1 -1
- package/dist/assets/{Companies-BBdNER6U.js → Companies-C4ObCu9j.js} +1 -1
- package/dist/assets/{CompanyAccess-CX4qyiXc.js → CompanyAccess-J5Vwnko2.js} +1 -1
- package/dist/assets/{CompanyActivity-Csqqnldg.js → CompanyActivity-B7-kMNmz.js} +1 -1
- package/dist/assets/{CompanyConnections-Ds1e8fjb.js → CompanyConnections-D2N6UWXk.js} +1 -1
- package/dist/assets/{CompanyEnvironments-BQGpdLk1.js → CompanyEnvironments-ChSu4gxW.js} +1 -1
- package/dist/assets/{CompanyExport-CBJU6SZ5.js → CompanyExport-B_opHRSJ.js} +1 -1
- package/dist/assets/{CompanyImport-BtODUy1v.js → CompanyImport-DZAMEBBy.js} +1 -1
- package/dist/assets/{CompanySettings-x6CbuKeE.js → CompanySettings-Rz8cwgKC.js} +1 -1
- package/dist/assets/{CompanySettingsPluginPage-CEDKNwLY.js → CompanySettingsPluginPage-CM-ViPwj.js} +1 -1
- package/dist/assets/{CompanySkills-C32TKvfI.js → CompanySkills-BnwPuZze.js} +2 -2
- package/dist/assets/{ComposerAddMenu-BPPkbm0o.js → ComposerAddMenu-jKf-6Yli.js} +1 -1
- package/dist/assets/{ConfigureBuiltInAgentModal-v8kbSAuE.js → ConfigureBuiltInAgentModal-BAfoTveX.js} +1 -1
- package/dist/assets/{ConnectionSetupFlow-g6asOGFg.js → ConnectionSetupFlow-8alK3I_h.js} +1 -1
- package/dist/assets/{CopyableGatewayUrl-DM4I2CJE.js → CopyableGatewayUrl-D90Bjxj0.js} +1 -1
- package/dist/assets/{Dashboard-4TvnZKHQ.js → Dashboard-DepIxrje.js} +2 -2
- package/dist/assets/{DecisionDateChips-H3AqvYWG.js → DecisionDateChips-89KkV4mo.js} +1 -1
- package/dist/assets/{DecisionModelSettings-HEZJ0E6n.js → DecisionModelSettings-CvVCBVCM.js} +1 -1
- package/dist/assets/{DecisionQueuePage-C--TNteA.js → DecisionQueuePage-nU9qXzln.js} +1 -1
- package/dist/assets/{DesignGuide-PDM2oacG.js → DesignGuide-40TixHZ-.js} +4 -4
- package/dist/assets/{EmailEndpointSetup-B0haS5AA.js → EmailEndpointSetup-D7-8f1XV.js} +1 -1
- package/dist/assets/{EntityRow-B24YmFE7.js → EntityRow-jUxCK6IM.js} +1 -1
- package/dist/assets/ExecutionWorkspaceDetail-CnUD3jLO.js +19 -0
- package/dist/assets/{GatewayDetail-CtpVgcnJ.js → GatewayDetail-Bg7GU-1a.js} +2 -2
- package/dist/assets/{GatewaysList-DCuMJisg.js → GatewaysList-4vvZCBkY.js} +1 -1
- package/dist/assets/{GoalDetail-B4Iw4vhL.js → GoalDetail-h7WsjaOO.js} +1 -1
- package/dist/assets/{GoalTree-Bxei53eI.js → GoalTree-yPtfejUx.js} +1 -1
- package/dist/assets/{Goals-CszzFpXF.js → Goals-DOi3E4DX.js} +1 -1
- package/dist/assets/{ImageGalleryModal-7mN3BVkG.js → ImageGalleryModal-D_VQgcBt.js} +1 -1
- package/dist/assets/{Inbox-Dzj03JZw.js → Inbox-COKxRKhR.js} +2 -2
- package/dist/assets/{InlineBanner-DYx7A02D.js → InlineBanner-DeTqU5Gp.js} +1 -1
- package/dist/assets/{InlineEditor-BJTE1pyF.js → InlineEditor-4ew5gxf0.js} +1 -1
- package/dist/assets/{InstanceAdvanced-HzNvpWAC.js → InstanceAdvanced-DlMlwZbU.js} +1 -1
- package/dist/assets/{InstanceFeatures-C1eqcxDI.js → InstanceFeatures-BbDE9waY.js} +1 -1
- package/dist/assets/{InviteLanding-BHDk8eVb.js → InviteLanding-BGvJMHKw.js} +1 -1
- package/dist/assets/{IssueChatLongThreadPerf-E61LYLEE.js → IssueChatLongThreadPerf-C3U2FZKJ.js} +1 -1
- package/dist/assets/{IssueChatThread-DERjeWcT.js → IssueChatThread-CDKaIB6v.js} +10 -10
- package/dist/assets/{IssueDetail--oKqoH82.js → IssueDetail-BCwHANTn.js} +6 -6
- package/dist/assets/{IssueDocumentAnnotations-DjcRXcEw.js → IssueDocumentAnnotations-DpFXlkRb.js} +1 -1
- package/dist/assets/{IssueOutputSection-Dvul0VAn.js → IssueOutputSection-BzXRmoV7.js} +1 -1
- package/dist/assets/{IssueRecoveryActionCard-DpJjLu9A.js → IssueRecoveryActionCard-BYtbaP-M.js} +1 -1
- package/dist/assets/{IssueReferencePill-DIqTKSRc.js → IssueReferencePill-BT7NBEy_.js} +1 -1
- package/dist/assets/{IssueThreadInteractionCard-PnjBaM8M.js → IssueThreadInteractionCard-Btd0rZ23.js} +1 -1
- package/dist/assets/{Issues-Dwcvbvvw.js → Issues-XKf7zemQ.js} +3 -3
- package/dist/assets/{LiveNowTodoLine-B3GKP4a7.js → LiveNowTodoLine-CoL6ZNuK.js} +1 -1
- package/dist/assets/ManagedAiConnectionDetails-CebBi-Tw.js +1 -0
- package/dist/assets/{MarkdownBody-D7qCQaU_.js → MarkdownBody-cPGkwwjq.js} +1 -1
- package/dist/assets/{McpConnect-CYz1a9lA.js → McpConnect-ByorZN7G.js} +1 -1
- package/dist/assets/{MembershipAction-BCf-FK7R.js → MembershipAction-De0MBfgb.js} +1 -1
- package/dist/assets/{MetricCard-DlcBTKQs.js → MetricCard-CTOmJVRL.js} +1 -1
- package/dist/assets/{MissingPluginTabPlaceholder-l1R-Q4nh.js → MissingPluginTabPlaceholder-D3N0rd-p.js} +1 -1
- package/dist/assets/{ModelsAndProviders-CI6zoBD9.js → ModelsAndProviders-BqM4UJc7.js} +1 -1
- package/dist/assets/{NewAgent-BWaZTy_v.js → NewAgent-pMTQYNxn.js} +1 -1
- package/dist/assets/{OmpAllSettings-DTJLATQL.js → OmpAllSettings-BeXrdLBc.js} +1 -1
- package/dist/assets/{PipelineSettings-pFkHM2Ns.js → PipelineSettings-C2k3BzLQ.js} +2 -2
- package/dist/assets/Pipelines-Cr6Xs32p.js +1 -0
- package/dist/assets/PixelsOffice-Dfd4XKSj.js +2 -0
- package/dist/assets/{PluginManager-DkADWuR8.js → PluginManager-7ZdeHrGQ.js} +1 -1
- package/dist/assets/{PluginPage-CBAkPwZs.js → PluginPage-fPlWyFSc.js} +1 -1
- package/dist/assets/{PluginSettings-CsXh8PMi.js → PluginSettings-X_VHvvo5.js} +1 -1
- package/dist/assets/{ProfileDetailRoute-B6mZqIhS.js → ProfileDetailRoute-PAsWmN-1.js} +1 -1
- package/dist/assets/{ProfileSettings-BZG_OvIh.js → ProfileSettings-BACxlGZS.js} +1 -1
- package/dist/assets/{ProfileWizardRoute-yUXZqjqr.js → ProfileWizardRoute-Dbq0n7If.js} +1 -1
- package/dist/assets/ProjectDetail-DOJZUIWu.js +1 -0
- package/dist/assets/{ProjectWorkspaceDetail-rSo7mMQc.js → ProjectWorkspaceDetail-ZNnaHnuA.js} +1 -1
- package/dist/assets/{ProjectWorkspacesContent-DnGszD3v.js → ProjectWorkspacesContent-DrWfnTJY.js} +1 -1
- package/dist/assets/{Projects-kZ7Li_8n.js → Projects-CCzxmEZ8.js} +1 -1
- package/dist/assets/{PublicIssueSharePage-DMy8nXt2.js → PublicIssueSharePage-BUSkP1Js.js} +1 -1
- package/dist/assets/{QuestionForm-DF6R7lYE.js → QuestionForm-MfSDsey7.js} +1 -1
- package/dist/assets/{RepositoryEditor-BuV4JRgV.js → RepositoryEditor-2QyuT99t.js} +1 -1
- package/dist/assets/{ReviewQueueCard-Bz8uXwnD.js → ReviewQueueCard-CrCN_30c.js} +1 -1
- package/dist/assets/{RichWorkProductCard-BCB8SaZp.js → RichWorkProductCard-DndJn4LV.js} +1 -1
- package/dist/assets/{RoutineDetail-C-gt9_NY.js → RoutineDetail-B5MzV_74.js} +2 -2
- package/dist/assets/{RoutineRunVariablesDialog-CrKptoDW.js → RoutineRunVariablesDialog-kGyQVBid.js} +1 -1
- package/dist/assets/Routines-B2zX9h3J.js +1 -0
- package/dist/assets/ScrollToBottom-Dd3SpeJi.js +1 -0
- package/dist/assets/{Search-B-8DqpI2.js → Search-D4W3cZZf.js} +1 -1
- package/dist/assets/{Secrets-CPNzZnuu.js → Secrets-C4nbuMIh.js} +3 -3
- package/dist/assets/{SidebarNavItem-afEXEFeo.js → SidebarNavItem-kYI7H9f3.js} +1 -1
- package/dist/assets/{SkillSourceTree-CR8rC1PY.js → SkillSourceTree-BvGzMa2u.js} +1 -1
- package/dist/assets/{SkillSources-3haDckt2.js → SkillSources-DL2tNkcr.js} +1 -1
- package/dist/assets/{SkillStudio-CXzQR1ws.js → SkillStudio-BnZ2cfDq.js} +1 -1
- package/dist/assets/{SourceTrustBadge-DNvpVd9i.js → SourceTrustBadge-CCPQEGrC.js} +1 -1
- package/dist/assets/{StatusCards-D-O7dS5f.js → StatusCards-BkE-9R8F.js} +1 -1
- package/dist/assets/{StatusIcon-Bx4H7RuA.js → StatusIcon-Cs1RbJGu.js} +1 -1
- package/dist/assets/{SummarySlotCard-CYpYMfTa.js → SummarySlotCard-D1EyiciB.js} +1 -1
- package/dist/assets/{TaskChatLab-BfxurxKS.js → TaskChatLab-D3PsNRr5.js} +1 -1
- package/dist/assets/{TaskChatMarker-Cj8k3l9N.js → TaskChatMarker-DEF88_sr.js} +2 -2
- package/dist/assets/{TaskChatProtocolCard-BsdB1fYv.js → TaskChatProtocolCard-Ba_vhDxn.js} +1 -1
- package/dist/assets/{TaskChatThreadView-B90tQ4X1.js → TaskChatThreadView-BsPvbxiA.js} +1 -1
- package/dist/assets/{TaskTreeControls-zoH_P07l.js → TaskTreeControls-BKOIbilg.js} +2 -2
- package/dist/assets/{Terminal-y6EdGsxY.js → Terminal-1uPX7VEe.js} +1 -1
- package/dist/assets/{TerminalView-CWvRC4uL.js → TerminalView-DDv6s-R_.js} +1 -1
- package/dist/assets/{ToolsAdminGate-C5dQpL4C.js → ToolsAdminGate-BzvfSwod.js} +1 -1
- package/dist/assets/{TrustPresetSection-gUExLKOq.js → TrustPresetSection-BDb0N4Pe.js} +1 -1
- package/dist/assets/{UserProfile-uUu_7SHc.js → UserProfile-DqPRuGWk.js} +1 -1
- package/dist/assets/{WebhookUrlWarning-CbkWHsPb.js → WebhookUrlWarning-CHx5gr2m.js} +1 -1
- package/dist/assets/WhatNeedsMe-DtBxgH24.js +1 -0
- package/dist/assets/{WorkspaceRuntimeControls-Cp5E1FME.js → WorkspaceRuntimeControls-Clk2nzU6.js} +1 -1
- package/dist/assets/{Workspaces-MhwqOigu.js → Workspaces-BQOyG5HK.js} +1 -1
- package/dist/assets/{connection-owner-CslVCQSM.js → connection-owner-CPrMcD3t.js} +1 -1
- package/dist/assets/{index-D1wQsid4.js → index-QhteFtm-.js} +16 -16
- package/dist/assets/{issue-properties-BXissCm1.js → issue-properties--M7WE6Ot.js} +3 -3
- package/dist/assets/{issue-workspace-selection-Ey-jzxzA.js → issue-workspace-selection-pUdSkrJA.js} +1 -1
- package/dist/assets/{pipeline-stage-presentation-B_etSYde.js → pipeline-stage-presentation-Dv1xgEPW.js} +1 -1
- package/dist/assets/router-CJbFZfVR.js +1 -0
- package/dist/assets/{shared-CSvxoeyx.js → shared-B75ClBUg.js} +1 -1
- package/dist/assets/{slots-DZ1hj5sG.js → slots-B7lwlN1w.js} +1 -1
- package/dist/assets/system-notice-comment-D0I6rz8Y.js +1 -0
- package/dist/assets/{task-chat-attachments-DNPQ-jOG.js → task-chat-attachments-2KmZkOL7.js} +1 -1
- package/dist/assets/{transcript-adapter-CppFOMQA.js → transcript-adapter-ClaGWYVL.js} +1 -1
- package/dist/assets/useSummaryDraftStream-BDuMgNcA.js +3 -0
- package/dist/index.html +12 -13
- package/dist/sw.js +1 -1
- package/package.json +1 -1
- package/dist/assets/Agents-BwRQ91d5.js +0 -3
- package/dist/assets/AuditHub-CPsJe_Bl.js +0 -1
- package/dist/assets/ExecutionWorkspaceDetail-BI4rAhvY.js +0 -19
- package/dist/assets/ManagedAiConnectionDetails-D7zoLLKJ.js +0 -1
- package/dist/assets/Pipelines-C8_wN0Sv.js +0 -1
- package/dist/assets/PixelsOffice-GHMNmVjR.js +0 -2
- package/dist/assets/ProjectDetail-CTwwSUZn.js +0 -1
- package/dist/assets/Routines-D3JG-gCI.js +0 -1
- package/dist/assets/ScrollToBottom-CYzcByH1.js +0 -1
- package/dist/assets/WhatNeedsMe-JNJ5uJyH.js +0 -1
- package/dist/assets/heartbeats-D96c9g2n.js +0 -1
- package/dist/assets/router-BKzUF9uf.js +0 -1
- package/dist/assets/system-notice-comment-DPCHQ4-Y.js +0 -1
- package/dist/assets/useSummaryDraftStream-DQYbVHb7.js +0 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
var c=Object.defineProperty;var o=(r,t)=>c(r,"name",{value:t,configurable:!0});import{i as n}from"./rolldown-runtime-ZpX3ckPj.js";import{la as l}from"./createLucideIcon-CgrPXnTY.js";import{t as d,v as p}from"./queryKeys-BzT8CD34.js";import{n as x}from"./CompanyContext-fQCNWI_f.js";import{t as u}from"./router-
|
|
1
|
+
var c=Object.defineProperty;var o=(r,t)=>c(r,"name",{value:t,configurable:!0});import{i as n}from"./rolldown-runtime-ZpX3ckPj.js";import{la as l}from"./createLucideIcon-CgrPXnTY.js";import{t as d,v as p}from"./queryKeys-BzT8CD34.js";import{n as x}from"./CompanyContext-fQCNWI_f.js";import{t as u}from"./router-CJbFZfVR.js";import{t as h}from"./shield-alert-BAXWoBTh.js";import{t as f}from"./access-DhB95qNC.js";var e=n(l(),1);function _({children:r}){const{selectedCompanyId:t}=x(),i=p({queryKey:d.access.currentBoardAccess,queryFn:o(()=>f.getCurrentBoardAccess(),"queryFn"),retry:!1});if(i.isLoading)return(0,e.jsx)("div",{className:"mx-auto max-w-xl py-10 text-sm text-ink-3",children:"Loading…"});const a=i.data,s=a?.memberships?.find(m=>m.companyId===t&&m.status==="active");return a?.source==="local_implicit"||a?.isInstanceAdmin||s?.membershipRole==="owner"||s?.membershipRole==="admin"||s?.membershipRole==="operator"||s?.membershipRole==="member"?(0,e.jsx)(e.Fragment,{children:r}):(0,e.jsx)("div",{className:"mx-auto max-w-xl py-10",children:(0,e.jsxs)("div",{className:"flex flex-col gap-3 rounded-lg border border-line bg-bg-2 p-6",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 text-ink",children:[(0,e.jsx)(h,{className:"h-5 w-5 text-ink-3"}),(0,e.jsx)("h1",{className:"text-lg font-semibold",children:"Access profiles require editing access"})]}),(0,e.jsxs)("p",{className:"text-sm text-ink-3",children:["Access profiles decide which tools your agents can use. Ask a company editor to set these up, or head back to"," ",(0,e.jsx)(u,{to:"/apps",className:"font-medium text-accent hover:underline",children:"your apps"}),"."]})]})})}o(_,"ToolsAdminGate");export{_ as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var O=Object.defineProperty;var r=(s,n)=>O(s,"name",{value:n,configurable:!0});import{i as f}from"./rolldown-runtime-ZpX3ckPj.js";import{l as T,la as M,ua as q}from"./createLucideIcon-CgrPXnTY.js";import{n as F}from"./star-eem0qj3E.js";import{t as U}from"./button-DI4w5WP7.js";import{t as $}from"./shield-alert-BAXWoBTh.js";import{a as j,t as D}from"./agent-config-primitives-BJlDiwaH.js";import{An as y,Fn as V,In as G,Ln as H,Mn as Q,Nn as W,On as Y,Pn as J,jn as K,kn as w,zn as X}from"./index-
|
|
1
|
+
var O=Object.defineProperty;var r=(s,n)=>O(s,"name",{value:n,configurable:!0});import{i as f}from"./rolldown-runtime-ZpX3ckPj.js";import{l as T,la as M,ua as q}from"./createLucideIcon-CgrPXnTY.js";import{n as F}from"./star-eem0qj3E.js";import{t as U}from"./button-DI4w5WP7.js";import{t as $}from"./shield-alert-BAXWoBTh.js";import{a as j,t as D}from"./agent-config-primitives-BJlDiwaH.js";import{An as y,Fn as V,In as G,Ln as H,Mn as Q,Nn as W,On as Y,Pn as J,jn as K,kn as w,zn as X}from"./index-QhteFtm-.js";var m=f(q(),1),e=f(M(),1),g="w-full rounded-md border border-line px-2.5 py-1.5 bg-transparent outline-none text-sm font-mono placeholder:text-ink-3/40";function p(s,n,d){const i=s?.length??0;return i===0?"-":`${i} ${i===1?n:d}`}r(p,"formatCount");function o({label:s,value:n}){return(0,e.jsxs)("div",{className:"flex items-start justify-between gap-3 py-1.5 text-sm",children:[(0,e.jsx)("span",{className:"shrink-0 text-xs text-ink-3",children:s}),(0,e.jsx)("span",{className:T("min-w-0 text-right",n==="-"&&"text-ink-3"),children:n})]})}r(o,"PolicyRow");var Z={project:"Project",root_issue:"Root issue",issue:"Issue"};function le({permissions:s,onChange:n,disabled:d,companyId:i,projectCandidates:N=[],issueCandidates:_=[],candidatesLoading:b,allowSingleIssue:P=!0}){const[S,k]=(0,m.useState)(!1),c=J(s),a=Q(s),l=W(a),[u,v]=(0,m.useState)(l?.type??"project"),C=c==="low_trust_review",x=G(a),E=V(a),B=s?.authorizationPolicy??null,L=(0,m.useMemo)(()=>y(s,c),[s,c]);(0,m.useEffect)(()=>{l&&v(l.type)},[l?.type]);function A(t){n(y(s,t==="low_trust_review"?"low_trust_review":"standard"))}r(A,"handlePresetChange");function R(t){!i||!t||n(H(s,i,{type:u,id:t}))}r(R,"handleBoundaryTargetChange");function I(){n(K(s))}r(I,"handleClearBoundary");const h=u==="project"?N:_,z=l?.type===u?l.id:"";return(0,e.jsxs)("div",{children:[(0,e.jsx)("h3",{className:"mb-3 text-sm font-medium",children:"Trust"}),(0,e.jsxs)("div",{className:"rounded-lg border border-line p-4 space-y-3",children:[(0,e.jsx)(j,{label:"Trust preset",hint:"Choose how broadly this agent can read and act on Wardmote work objects.",children:(0,e.jsxs)("select",{className:g,value:c,onChange:r(t=>A(t.target.value),"onChange"),disabled:d,children:[(0,e.jsx)("option",{value:"standard",children:w.standard}),(0,e.jsx)("option",{value:"low_trust_review",children:w.low_trust_review})]})}),(0,e.jsx)("p",{className:"text-xs text-ink-3",children:Y[c]}),C?(0,e.jsxs)("div",{role:x?"status":"alert","aria-live":"polite",className:T("rounded-md border px-3 py-2.5 text-sm flex gap-2",x?"border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-100":"border-bad/30 bg-bad/10 text-bad"),children:[x?(0,e.jsx)($,{className:"mt-0.5 h-4 w-4 shrink-0"}):(0,e.jsx)(F,{className:"mt-0.5 h-4 w-4 shrink-0"}),(0,e.jsxs)("div",{className:"min-w-0 flex-1 space-y-2",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"font-medium",children:x?"Containment active":"Containment not configured"}),(0,e.jsx)("p",{className:"mt-1 text-xs leading-5",children:x?"This agent can only read and mutate work inside its assigned review boundary. Raw output is quarantined from higher-trust agents until a trusted reviewer promotes it.":"This agent is set to low-trust review, but no project, root issue, or issue scope is set in the core policy. Add a scope before this agent can run without denial."})]}),E?(0,e.jsxs)("div",{className:"rounded-md border border-line/70 bg-bg/70 p-3 text-ink space-y-3",children:[(0,e.jsxs)("div",{className:"grid gap-3 sm:grid-cols-(--gtc-12)",children:[(0,e.jsx)(j,{label:"Boundary type",children:(0,e.jsxs)("select",{className:g,value:u,onChange:r(t=>v(t.target.value),"onChange"),disabled:d,children:[(0,e.jsx)("option",{value:"project",children:"Project"}),(0,e.jsx)("option",{value:"root_issue",children:"Root issue"}),P&&(0,e.jsx)("option",{value:"issue",children:"Issue"})]})}),(0,e.jsx)(j,{label:Z[u],children:(0,e.jsxs)("select",{className:g,value:z,onChange:r(t=>R(t.target.value),"onChange"),disabled:d||!i||b||h.length===0,children:[(0,e.jsx)("option",{value:"",children:b?"Loading…":h.length===0?`No ${u==="project"?"projects":"issues"} available`:"Select boundary"}),h.map(t=>(0,e.jsx)("option",{value:t.id,children:t.label},t.id))]})})]}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,e.jsx)("p",{className:"text-xs text-ink-3",children:"CE saves one containment boundary at a time. Saved policies include this organization id."}),l?(0,e.jsx)(U,{type:"button",size:"sm",variant:"secondary",className:"h-7 px-2.5 text-xs",onClick:I,disabled:d,children:"Clear boundary"}):null]})]}):(0,e.jsxs)("div",{className:"rounded-md border border-line/70 bg-bg/70 p-3 text-ink",children:[(0,e.jsx)("p",{className:"text-sm font-medium",children:"Managed by API"}),(0,e.jsxs)("p",{className:"mt-1 text-xs leading-5 text-ink-3",children:["This policy has ",X(a).toLowerCase()," and cannot be edited by the single-boundary editor."]})]}),(0,e.jsx)(D,{title:"View policy",open:S,onToggle:r(()=>k(t=>!t),"onToggle"),children:(0,e.jsxs)("div",{className:"divide-y divide-line/60 text-ink",children:[(0,e.jsx)(o,{label:"Preset",value:"Low-trust review v1"}),(0,e.jsx)(o,{label:"Raw output",value:"Quarantined from higher-trust agents"}),(0,e.jsx)(o,{label:"Projects",value:p(a?.projectIds,"project","projects")}),(0,e.jsx)(o,{label:"Root issue",value:a?.rootIssueId?a.rootIssueId.slice(0,8):"-"}),(0,e.jsx)(o,{label:"Explicit issues",value:p(a?.issueIds,"issue","issues")}),(0,e.jsx)(o,{label:"Allowed agents",value:p(a?.allowedAgentIds,"agent","agents")}),(0,e.jsx)(o,{label:"Allowed tools",value:a?.allowedToolClasses?.join(" · ")||"-"}),(0,e.jsx)(o,{label:"Allowed secrets",value:p(a?.allowedSecretBindingIds,"binding","bindings")}),(0,e.jsx)(o,{label:"Promotion target",value:a?.outputPromotionTarget?.issueId?.slice(0,8)??"-"}),(0,e.jsx)(o,{label:"EE fields",value:Object.keys(B??{}).some(t=>!["trustPreset","reviewPreset","trustBoundary"].includes(t))?"Custom advanced policy fields preserved":"-"})]})})]})]}):null,L.authorizationPolicy?.reviewPreset?null:(0,e.jsx)("p",{className:"text-xs text-ink-3",children:"Advanced permissions remain editable through the EE permissions extension when installed."})]})]})}r(le,"TrustPresetSection");export{le as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var O=Object.defineProperty;var r=(s,n)=>O(s,"name",{value:n,configurable:!0});import{i as S}from"./rolldown-runtime-ZpX3ckPj.js";import{E as k,O as y,S as q,Vt as B,b as I,f as N,la as z,m as L,ua as F,v as d,x}from"./createLucideIcon-CgrPXnTY.js";import{v as H}from"./star-eem0qj3E.js";import{r as D,t as T,v as C}from"./queryKeys-BzT8CD34.js";import{o as K}from"./companies-query-BEdFiAhG.js";import{n as W}from"./CompanyContext-fQCNWI_f.js";import{t as A}from"./router-BKzUF9uf.js";import{a as G,n as Q,t as V}from"./avatar-qO_h93F8.js";import{t as Y}from"./circle-alert-C7T1cdKm.js";import{t as J}from"./button-DI4w5WP7.js";import{t as X}from"./user-round-B87hENhM.js";import{t as Z}from"./useHiddenSettings-D0HL2tkE.js";import{n as ee}from"./BreadcrumbContext-DNbB7zWn.js";import{Cn as se,T as $,Ta as te,_ as ae}from"./index-D1wQsid4.js";var b=S(F(),1),ne={get:r((s,n)=>D.get(`/companies/${s}/users/${encodeURIComponent(n)}/profile`),"get")},e=S(z(),1),ie="__none__",le="/company/settings/instance/profile";function re(s){const n=s?.trim()||"User",l=n.split(/\s+/).filter(Boolean);return l.length>1?`${l[0]?.[0]??""}${l[l.length-1]?.[0]??""}`.toUpperCase():n.slice(0,2).toUpperCase()}r(re,"initials");function u(s){return s.inputTokens+s.cachedInputTokens+s.outputTokens}r(u,"totalTokens");function _(s){return s.touchedIssues===0?"0%":`${Math.round(s.completedIssues/s.touchedIssues*100)}%`}r(_,"completionRate");function h({label:s,value:n,hint:l}){return(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsx)("div",{className:"text-2xl font-semibold tabular-nums sm:text-3xl",children:n}),(0,e.jsx)("div",{className:"mt-1 text-(length:--text-micro) font-medium uppercase tracking-wide text-ink-3",children:s}),l?(0,e.jsx)("div",{className:"mt-0.5 text-xs text-ink-3/70",children:l}):null]})}r(h,"HeroStat");function ce({stats:s}){const n=u(s);return(0,e.jsxs)("div",{className:"flex min-w-0 flex-col gap-4 border-l border-line pl-5 first:border-l-0 first:pl-0",children:[(0,e.jsxs)("div",{className:"flex items-baseline justify-between gap-3",children:[(0,e.jsx)("h2",{className:"text-(length:--text-micro) font-medium uppercase tracking-wide text-ink-3",children:s.label}),(0,e.jsxs)("span",{className:"text-(length:--text-micro) text-ink-3 tabular-nums",children:[_(s)," done"]})]}),(0,e.jsxs)("div",{className:"grid grid-cols-2 gap-x-5 gap-y-3",children:[(0,e.jsx)(g,{value:d(s.touchedIssues),label:"Touched"}),(0,e.jsx)(g,{value:d(s.completedIssues),label:"Completed"}),(0,e.jsx)(g,{value:d(s.commentCount),label:"Comments"}),(0,e.jsx)(g,{value:d(s.activityCount),label:"Actions"})]}),(0,e.jsxs)("div",{className:"grid grid-cols-2 gap-x-5 gap-y-1.5 pt-3 text-xs tabular-nums text-ink-3",children:[(0,e.jsx)("span",{children:"Tokens"}),(0,e.jsx)("span",{className:"text-right text-ink",children:x(n)}),(0,e.jsx)("span",{children:"Spend"}),(0,e.jsx)("span",{className:"text-right text-ink",children:N(s.costCents)}),(0,e.jsx)("span",{children:"Created"}),(0,e.jsx)("span",{className:"text-right text-ink",children:d(s.createdIssues)}),(0,e.jsx)("span",{children:"Open"}),(0,e.jsx)("span",{className:"text-right text-ink",children:d(s.assignedOpenIssues)})]})]})}r(ce,"WindowColumn");function g({value:s,label:n}){return(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsx)("div",{className:"truncate text-xl font-semibold tabular-nums",children:s}),(0,e.jsx)("div",{className:"mt-0.5 text-(length:--text-micro) text-ink-3",children:n})]})}r(g,"Metric");function de({points:s}){const n=s.map(i=>u(i)),l=Math.max(1,...n),m=Math.max(1,...s.map(i=>i.completedIssues)),a=n.reduce((i,c)=>i+c,0);return(0,e.jsxs)("section",{children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-baseline justify-between gap-3 border-b border-line pb-3",children:[(0,e.jsx)("h2",{className:"text-sm font-semibold",children:"Last 14 days"}),(0,e.jsxs)("div",{className:"flex items-baseline gap-4 text-xs text-ink-3",children:[(0,e.jsx)("span",{className:"tabular-nums text-ink",children:x(a)}),(0,e.jsx)("span",{children:"tokens total"})]})]}),(0,e.jsx)("div",{className:"mt-6 grid grid-cols-(--gtc-57) items-end gap-1.5 sm:gap-2",children:s.map(i=>{const c=u(i),j=c===0?0:Math.max(2,Math.round(c/l*100)),p=i.completedIssues===0?0:Math.max(8,Math.round(i.completedIssues/m*36));return(0,e.jsxs)("div",{className:"group flex h-36 flex-col justify-end",children:[(0,e.jsx)("div",{className:"w-full bg-ink/80 transition-opacity group-hover:bg-ink",style:{height:`${j}%`,minHeight:c===0?1:void 0},title:`${I(i.date)}: ${x(c)} tokens, ${i.completedIssues} completed`}),p>0?(0,e.jsx)("div",{className:"mt-1 w-full rounded-full bg-emerald-500/80",style:{height:2,opacity:Math.min(1,.35+p/100)}}):null]},i.date)})}),(0,e.jsx)("div",{className:"mt-2 grid grid-cols-(--gtc-57) gap-1.5 text-(length:--text-nano) tabular-nums text-ink-3 sm:gap-2",children:s.map((i,c)=>(0,e.jsx)("div",{className:"text-center",children:c===0||c===6||c===13?I(i.date):null},i.date))}),(0,e.jsxs)("div",{className:"mt-4 flex flex-wrap items-center gap-4 text-(length:--text-nano) uppercase tracking-wide text-ink-3",children:[(0,e.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,e.jsx)("span",{className:"h-2 w-2 bg-ink/80"})," tokens / day"]}),(0,e.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,e.jsx)("span",{className:"h-(--sz-3px) w-4 rounded-full bg-emerald-500/80"})," completions"]})]})]})}r(de,"UsageChart");function P({title:s,empty:n,rows:l}){return(0,e.jsxs)("section",{children:[(0,e.jsxs)("div",{className:"flex items-baseline justify-between gap-3 border-b border-line pb-3",children:[(0,e.jsx)("h2",{className:"text-sm font-semibold",children:s}),(0,e.jsx)("span",{className:"text-xs text-ink-3 tabular-nums",children:l.length})]}),l.length===0?(0,e.jsx)("div",{className:"pt-4 text-sm text-ink-3",children:n}):(0,e.jsx)("ul",{className:"divide-y divide-line",children:l.map(m=>(0,e.jsxs)("li",{className:"grid gap-2 py-2.5 sm:grid-cols-(--gtc-17) sm:items-center",children:[(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsx)("div",{className:"truncate text-sm font-medium",children:m.label}),(0,e.jsx)("div",{className:"truncate text-xs text-ink-3",children:m.sublabel})]}),(0,e.jsxs)("div",{className:"flex items-baseline gap-4 text-xs tabular-nums sm:justify-end",children:[(0,e.jsx)("span",{className:"text-ink-3",children:x(u(m))}),(0,e.jsx)("span",{className:"font-medium",children:N(m.costCents)})]})]},m.key))})]})}r(P,"UsageList");function Te(){const{userSlug:s=""}=H(),{selectedCompanyId:n}=W(),{setBreadcrumbs:l}=ee(),m=n??ie,{data:a,isLoading:i,error:c}=C({queryKey:T.userProfile(m,s),queryFn:r(()=>ne.get(m,s),"queryFn"),enabled:!!n&&!!s}),{data:j}=C({queryKey:T.auth.session,queryFn:r(()=>K.getSession(),"queryFn"),retry:!1}),{hidden:p}=Z(),U=!!a?.user.id&&a?.user.id===j?.user.id&&!B(p,"instance.profile");(0,b.useEffect)(()=>{l([{label:"Users"},{label:a?.user.name??s}])},[a?.user.name,l,s]);const o=a?.stats.find(t=>t.key==="all"),v=a?.stats.find(t=>t.key==="last7"),f=a?.user.name?.trim()||a?.user.email?.split("@")[0]||"User",M=(0,b.useMemo)(()=>(a?.topAgents??[]).map(t=>({key:t.agentId??"unknown",label:t.agentName??(t.agentId?t.agentId.slice(0,8):"Wardmote services"),sublabel:"Task-linked usage",costCents:t.costCents,inputTokens:t.inputTokens,cachedInputTokens:t.cachedInputTokens,outputTokens:t.outputTokens})),[a?.topAgents]),R=(0,b.useMemo)(()=>(a?.topProviders??[]).map(t=>({key:`${t.provider}:${t.biller}:${t.model}`,label:`${k(t.provider)} / ${t.model}`,sublabel:`Billed through ${k(t.biller)}`,costCents:t.costCents,inputTokens:t.inputTokens,cachedInputTokens:t.cachedInputTokens,outputTokens:t.outputTokens})),[a?.topProviders]);if(!n)return(0,e.jsx)($,{icon:X,message:"Select an organization to view user profiles."});if(i)return(0,e.jsx)(ae,{variant:"dashboard"});if(c||!a)return(0,e.jsx)($,{icon:Y,message:"User profile not found for this organization."});const w=o?u(o):0,E=[a.user.membershipRole??"member",a.user.membershipStatus,`joined ${L(a.user.joinedAt)}`];return(0,e.jsxs)("div",{className:"space-y-10 pb-10",children:[(0,e.jsxs)("section",{className:"flex flex-col gap-7 border-b border-line pb-8",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-5",children:[(0,e.jsxs)(V,{className:"size-16 border border-line",size:"lg",children:[a.user.image?(0,e.jsx)(G,{src:a.user.image,alt:f}):null,(0,e.jsx)(Q,{className:"text-lg font-semibold",children:re(f)})]}),(0,e.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-baseline gap-x-3 gap-y-1",children:[(0,e.jsx)("h1",{className:"truncate text-2xl font-semibold",children:f}),(0,e.jsxs)("span",{className:"text-sm text-ink-3",children:["@",a.user.slug]})]}),(0,e.jsxs)("div",{className:"mt-1.5 flex flex-wrap items-center gap-x-3 gap-y-0.5 text-xs text-ink-3",children:[a.user.email?(0,e.jsx)("span",{className:"truncate",children:a.user.email}):null,a.user.email?(0,e.jsx)("span",{"aria-hidden":!0,children:"·"}):null,(0,e.jsx)("span",{children:E.join(" · ")})]})]}),U?(0,e.jsx)(J,{asChild:!0,variant:"secondary",size:"sm",children:(0,e.jsxs)(A,{to:le,children:[(0,e.jsx)(te,{}),"Edit profile"]})}):null]}),(0,e.jsxs)("div",{className:"grid gap-6 sm:grid-cols-2 lg:grid-cols-4",children:[(0,e.jsx)(h,{label:"All-time tokens",value:x(w),hint:N(o?.costCents??0)+" spent"}),(0,e.jsx)(h,{label:"Completed",value:d(o?.completedIssues??0),hint:o?`${_(o)} rate`:void 0}),(0,e.jsx)(h,{label:"Open assigned",value:d(o?.assignedOpenIssues??0),hint:`${d(o?.createdIssues??0)} created`}),(0,e.jsx)(h,{label:"7-day actions",value:d(v?.activityCount??0),hint:`${d(v?.commentCount??0)} comments`})]})]}),(0,e.jsx)("section",{className:"grid gap-8 border-b border-line pb-8 lg:grid-cols-3",children:a.stats.map(t=>(0,e.jsx)(ce,{stats:t},t.key))}),(0,e.jsx)(de,{points:a.daily}),(0,e.jsxs)("div",{className:"grid gap-10 pt-2 xl:grid-cols-2",children:[(0,e.jsxs)("section",{children:[(0,e.jsxs)("div",{className:"flex items-baseline justify-between gap-3 border-b border-line pb-3",children:[(0,e.jsx)("h2",{className:"text-sm font-semibold",children:"Recent tasks"}),(0,e.jsx)("span",{className:"text-xs text-ink-3 tabular-nums",children:a.recentIssues.length})]}),a.recentIssues.length===0?(0,e.jsx)("div",{className:"pt-4 text-sm text-ink-3",children:"No touched tasks yet."}):(0,e.jsx)("ul",{className:"divide-y divide-line",children:a.recentIssues.map(t=>(0,e.jsx)("li",{children:(0,e.jsxs)(A,{to:q(t),className:"grid gap-2 py-2.5 transition-colors hover:bg-bg-3/40 sm:grid-cols-(--gtc-58) sm:items-center",children:[(0,e.jsx)("span",{className:"font-mono text-xs text-ink-3",children:t.identifier??t.id.slice(0,8)}),(0,e.jsx)("span",{className:"truncate text-sm",children:t.title}),(0,e.jsxs)("span",{className:"flex items-center gap-3 sm:justify-end",children:[(0,e.jsx)(se,{status:t.status}),(0,e.jsx)("span",{className:"text-xs tabular-nums text-ink-3",children:y(t.updatedAt)})]})]})},t.id))})]}),(0,e.jsxs)("section",{children:[(0,e.jsxs)("div",{className:"flex items-baseline justify-between gap-3 border-b border-line pb-3",children:[(0,e.jsx)("h2",{className:"text-sm font-semibold",children:"Recent activity"}),(0,e.jsx)("span",{className:"text-xs text-ink-3 tabular-nums",children:a.recentActivity.length})]}),a.recentActivity.length===0?(0,e.jsx)("div",{className:"pt-4 text-sm text-ink-3",children:"No direct user actions recorded yet."}):(0,e.jsx)("ul",{className:"divide-y divide-line",children:a.recentActivity.map(t=>(0,e.jsxs)("li",{className:"grid gap-2 py-2.5 sm:grid-cols-(--gtc-17) sm:items-center",children:[(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsx)("div",{className:"truncate text-sm",children:t.action.replaceAll("_"," ")}),(0,e.jsxs)("div",{className:"truncate text-xs text-ink-3",children:[t.entityType," · ",t.entityId.slice(0,12)]})]}),(0,e.jsx)("span",{className:"text-xs tabular-nums text-ink-3 sm:justify-self-end",children:y(t.createdAt)})]},t.id))})]})]}),(0,e.jsxs)("div",{className:"grid gap-10 xl:grid-cols-2",children:[(0,e.jsx)(P,{title:"Agent attribution",empty:"No issue-linked token usage yet.",rows:M}),(0,e.jsx)(P,{title:"Provider mix",empty:"No provider usage attributed yet.",rows:R})]})]})}r(Te,"UserProfile");export{Te as UserProfile};
|
|
1
|
+
var O=Object.defineProperty;var r=(s,n)=>O(s,"name",{value:n,configurable:!0});import{i as S}from"./rolldown-runtime-ZpX3ckPj.js";import{E as k,O as y,S as q,Vt as B,b as I,f as N,la as z,m as L,ua as F,v as d,x}from"./createLucideIcon-CgrPXnTY.js";import{v as H}from"./star-eem0qj3E.js";import{r as D,t as T,v as C}from"./queryKeys-BzT8CD34.js";import{o as K}from"./companies-query-BEdFiAhG.js";import{n as W}from"./CompanyContext-fQCNWI_f.js";import{t as A}from"./router-CJbFZfVR.js";import{a as G,n as Q,t as V}from"./avatar-qO_h93F8.js";import{t as Y}from"./circle-alert-C7T1cdKm.js";import{t as J}from"./button-DI4w5WP7.js";import{t as X}from"./user-round-B87hENhM.js";import{t as Z}from"./useHiddenSettings-D0HL2tkE.js";import{n as ee}from"./BreadcrumbContext-DNbB7zWn.js";import{Cn as se,Ea as te,T as $,_ as ae}from"./index-QhteFtm-.js";var b=S(F(),1),ne={get:r((s,n)=>D.get(`/companies/${s}/users/${encodeURIComponent(n)}/profile`),"get")},e=S(z(),1),ie="__none__",le="/company/settings/instance/profile";function re(s){const n=s?.trim()||"User",l=n.split(/\s+/).filter(Boolean);return l.length>1?`${l[0]?.[0]??""}${l[l.length-1]?.[0]??""}`.toUpperCase():n.slice(0,2).toUpperCase()}r(re,"initials");function u(s){return s.inputTokens+s.cachedInputTokens+s.outputTokens}r(u,"totalTokens");function _(s){return s.touchedIssues===0?"0%":`${Math.round(s.completedIssues/s.touchedIssues*100)}%`}r(_,"completionRate");function h({label:s,value:n,hint:l}){return(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsx)("div",{className:"text-2xl font-semibold tabular-nums sm:text-3xl",children:n}),(0,e.jsx)("div",{className:"mt-1 text-(length:--text-micro) font-medium uppercase tracking-wide text-ink-3",children:s}),l?(0,e.jsx)("div",{className:"mt-0.5 text-xs text-ink-3/70",children:l}):null]})}r(h,"HeroStat");function ce({stats:s}){const n=u(s);return(0,e.jsxs)("div",{className:"flex min-w-0 flex-col gap-4 border-l border-line pl-5 first:border-l-0 first:pl-0",children:[(0,e.jsxs)("div",{className:"flex items-baseline justify-between gap-3",children:[(0,e.jsx)("h2",{className:"text-(length:--text-micro) font-medium uppercase tracking-wide text-ink-3",children:s.label}),(0,e.jsxs)("span",{className:"text-(length:--text-micro) text-ink-3 tabular-nums",children:[_(s)," done"]})]}),(0,e.jsxs)("div",{className:"grid grid-cols-2 gap-x-5 gap-y-3",children:[(0,e.jsx)(g,{value:d(s.touchedIssues),label:"Touched"}),(0,e.jsx)(g,{value:d(s.completedIssues),label:"Completed"}),(0,e.jsx)(g,{value:d(s.commentCount),label:"Comments"}),(0,e.jsx)(g,{value:d(s.activityCount),label:"Actions"})]}),(0,e.jsxs)("div",{className:"grid grid-cols-2 gap-x-5 gap-y-1.5 pt-3 text-xs tabular-nums text-ink-3",children:[(0,e.jsx)("span",{children:"Tokens"}),(0,e.jsx)("span",{className:"text-right text-ink",children:x(n)}),(0,e.jsx)("span",{children:"Spend"}),(0,e.jsx)("span",{className:"text-right text-ink",children:N(s.costCents)}),(0,e.jsx)("span",{children:"Created"}),(0,e.jsx)("span",{className:"text-right text-ink",children:d(s.createdIssues)}),(0,e.jsx)("span",{children:"Open"}),(0,e.jsx)("span",{className:"text-right text-ink",children:d(s.assignedOpenIssues)})]})]})}r(ce,"WindowColumn");function g({value:s,label:n}){return(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsx)("div",{className:"truncate text-xl font-semibold tabular-nums",children:s}),(0,e.jsx)("div",{className:"mt-0.5 text-(length:--text-micro) text-ink-3",children:n})]})}r(g,"Metric");function de({points:s}){const n=s.map(i=>u(i)),l=Math.max(1,...n),m=Math.max(1,...s.map(i=>i.completedIssues)),a=n.reduce((i,c)=>i+c,0);return(0,e.jsxs)("section",{children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-baseline justify-between gap-3 border-b border-line pb-3",children:[(0,e.jsx)("h2",{className:"text-sm font-semibold",children:"Last 14 days"}),(0,e.jsxs)("div",{className:"flex items-baseline gap-4 text-xs text-ink-3",children:[(0,e.jsx)("span",{className:"tabular-nums text-ink",children:x(a)}),(0,e.jsx)("span",{children:"tokens total"})]})]}),(0,e.jsx)("div",{className:"mt-6 grid grid-cols-(--gtc-57) items-end gap-1.5 sm:gap-2",children:s.map(i=>{const c=u(i),j=c===0?0:Math.max(2,Math.round(c/l*100)),p=i.completedIssues===0?0:Math.max(8,Math.round(i.completedIssues/m*36));return(0,e.jsxs)("div",{className:"group flex h-36 flex-col justify-end",children:[(0,e.jsx)("div",{className:"w-full bg-ink/80 transition-opacity group-hover:bg-ink",style:{height:`${j}%`,minHeight:c===0?1:void 0},title:`${I(i.date)}: ${x(c)} tokens, ${i.completedIssues} completed`}),p>0?(0,e.jsx)("div",{className:"mt-1 w-full rounded-full bg-emerald-500/80",style:{height:2,opacity:Math.min(1,.35+p/100)}}):null]},i.date)})}),(0,e.jsx)("div",{className:"mt-2 grid grid-cols-(--gtc-57) gap-1.5 text-(length:--text-nano) tabular-nums text-ink-3 sm:gap-2",children:s.map((i,c)=>(0,e.jsx)("div",{className:"text-center",children:c===0||c===6||c===13?I(i.date):null},i.date))}),(0,e.jsxs)("div",{className:"mt-4 flex flex-wrap items-center gap-4 text-(length:--text-nano) uppercase tracking-wide text-ink-3",children:[(0,e.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,e.jsx)("span",{className:"h-2 w-2 bg-ink/80"})," tokens / day"]}),(0,e.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,e.jsx)("span",{className:"h-(--sz-3px) w-4 rounded-full bg-emerald-500/80"})," completions"]})]})]})}r(de,"UsageChart");function P({title:s,empty:n,rows:l}){return(0,e.jsxs)("section",{children:[(0,e.jsxs)("div",{className:"flex items-baseline justify-between gap-3 border-b border-line pb-3",children:[(0,e.jsx)("h2",{className:"text-sm font-semibold",children:s}),(0,e.jsx)("span",{className:"text-xs text-ink-3 tabular-nums",children:l.length})]}),l.length===0?(0,e.jsx)("div",{className:"pt-4 text-sm text-ink-3",children:n}):(0,e.jsx)("ul",{className:"divide-y divide-line",children:l.map(m=>(0,e.jsxs)("li",{className:"grid gap-2 py-2.5 sm:grid-cols-(--gtc-17) sm:items-center",children:[(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsx)("div",{className:"truncate text-sm font-medium",children:m.label}),(0,e.jsx)("div",{className:"truncate text-xs text-ink-3",children:m.sublabel})]}),(0,e.jsxs)("div",{className:"flex items-baseline gap-4 text-xs tabular-nums sm:justify-end",children:[(0,e.jsx)("span",{className:"text-ink-3",children:x(u(m))}),(0,e.jsx)("span",{className:"font-medium",children:N(m.costCents)})]})]},m.key))})]})}r(P,"UsageList");function Te(){const{userSlug:s=""}=H(),{selectedCompanyId:n}=W(),{setBreadcrumbs:l}=ee(),m=n??ie,{data:a,isLoading:i,error:c}=C({queryKey:T.userProfile(m,s),queryFn:r(()=>ne.get(m,s),"queryFn"),enabled:!!n&&!!s}),{data:j}=C({queryKey:T.auth.session,queryFn:r(()=>K.getSession(),"queryFn"),retry:!1}),{hidden:p}=Z(),U=!!a?.user.id&&a?.user.id===j?.user.id&&!B(p,"instance.profile");(0,b.useEffect)(()=>{l([{label:"Users"},{label:a?.user.name??s}])},[a?.user.name,l,s]);const o=a?.stats.find(t=>t.key==="all"),v=a?.stats.find(t=>t.key==="last7"),f=a?.user.name?.trim()||a?.user.email?.split("@")[0]||"User",M=(0,b.useMemo)(()=>(a?.topAgents??[]).map(t=>({key:t.agentId??"unknown",label:t.agentName??(t.agentId?t.agentId.slice(0,8):"Wardmote services"),sublabel:"Task-linked usage",costCents:t.costCents,inputTokens:t.inputTokens,cachedInputTokens:t.cachedInputTokens,outputTokens:t.outputTokens})),[a?.topAgents]),R=(0,b.useMemo)(()=>(a?.topProviders??[]).map(t=>({key:`${t.provider}:${t.biller}:${t.model}`,label:`${k(t.provider)} / ${t.model}`,sublabel:`Billed through ${k(t.biller)}`,costCents:t.costCents,inputTokens:t.inputTokens,cachedInputTokens:t.cachedInputTokens,outputTokens:t.outputTokens})),[a?.topProviders]);if(!n)return(0,e.jsx)($,{icon:X,message:"Select an organization to view user profiles."});if(i)return(0,e.jsx)(ae,{variant:"dashboard"});if(c||!a)return(0,e.jsx)($,{icon:Y,message:"User profile not found for this organization."});const E=o?u(o):0,w=[a.user.membershipRole??"member",a.user.membershipStatus,`joined ${L(a.user.joinedAt)}`];return(0,e.jsxs)("div",{className:"space-y-10 pb-10",children:[(0,e.jsxs)("section",{className:"flex flex-col gap-7 border-b border-line pb-8",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-5",children:[(0,e.jsxs)(V,{className:"size-16 border border-line",size:"lg",children:[a.user.image?(0,e.jsx)(G,{src:a.user.image,alt:f}):null,(0,e.jsx)(Q,{className:"text-lg font-semibold",children:re(f)})]}),(0,e.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-baseline gap-x-3 gap-y-1",children:[(0,e.jsx)("h1",{className:"truncate text-2xl font-semibold",children:f}),(0,e.jsxs)("span",{className:"text-sm text-ink-3",children:["@",a.user.slug]})]}),(0,e.jsxs)("div",{className:"mt-1.5 flex flex-wrap items-center gap-x-3 gap-y-0.5 text-xs text-ink-3",children:[a.user.email?(0,e.jsx)("span",{className:"truncate",children:a.user.email}):null,a.user.email?(0,e.jsx)("span",{"aria-hidden":!0,children:"·"}):null,(0,e.jsx)("span",{children:w.join(" · ")})]})]}),U?(0,e.jsx)(J,{asChild:!0,variant:"secondary",size:"sm",children:(0,e.jsxs)(A,{to:le,children:[(0,e.jsx)(te,{}),"Edit profile"]})}):null]}),(0,e.jsxs)("div",{className:"grid gap-6 sm:grid-cols-2 lg:grid-cols-4",children:[(0,e.jsx)(h,{label:"All-time tokens",value:x(E),hint:N(o?.costCents??0)+" spent"}),(0,e.jsx)(h,{label:"Completed",value:d(o?.completedIssues??0),hint:o?`${_(o)} rate`:void 0}),(0,e.jsx)(h,{label:"Open assigned",value:d(o?.assignedOpenIssues??0),hint:`${d(o?.createdIssues??0)} created`}),(0,e.jsx)(h,{label:"7-day actions",value:d(v?.activityCount??0),hint:`${d(v?.commentCount??0)} comments`})]})]}),(0,e.jsx)("section",{className:"grid gap-8 border-b border-line pb-8 lg:grid-cols-3",children:a.stats.map(t=>(0,e.jsx)(ce,{stats:t},t.key))}),(0,e.jsx)(de,{points:a.daily}),(0,e.jsxs)("div",{className:"grid gap-10 pt-2 xl:grid-cols-2",children:[(0,e.jsxs)("section",{children:[(0,e.jsxs)("div",{className:"flex items-baseline justify-between gap-3 border-b border-line pb-3",children:[(0,e.jsx)("h2",{className:"text-sm font-semibold",children:"Recent tasks"}),(0,e.jsx)("span",{className:"text-xs text-ink-3 tabular-nums",children:a.recentIssues.length})]}),a.recentIssues.length===0?(0,e.jsx)("div",{className:"pt-4 text-sm text-ink-3",children:"No touched tasks yet."}):(0,e.jsx)("ul",{className:"divide-y divide-line",children:a.recentIssues.map(t=>(0,e.jsx)("li",{children:(0,e.jsxs)(A,{to:q(t),className:"grid gap-2 py-2.5 transition-colors hover:bg-bg-3/40 sm:grid-cols-(--gtc-58) sm:items-center",children:[(0,e.jsx)("span",{className:"font-mono text-xs text-ink-3",children:t.identifier??t.id.slice(0,8)}),(0,e.jsx)("span",{className:"truncate text-sm",children:t.title}),(0,e.jsxs)("span",{className:"flex items-center gap-3 sm:justify-end",children:[(0,e.jsx)(se,{status:t.status}),(0,e.jsx)("span",{className:"text-xs tabular-nums text-ink-3",children:y(t.updatedAt)})]})]})},t.id))})]}),(0,e.jsxs)("section",{children:[(0,e.jsxs)("div",{className:"flex items-baseline justify-between gap-3 border-b border-line pb-3",children:[(0,e.jsx)("h2",{className:"text-sm font-semibold",children:"Recent activity"}),(0,e.jsx)("span",{className:"text-xs text-ink-3 tabular-nums",children:a.recentActivity.length})]}),a.recentActivity.length===0?(0,e.jsx)("div",{className:"pt-4 text-sm text-ink-3",children:"No direct user actions recorded yet."}):(0,e.jsx)("ul",{className:"divide-y divide-line",children:a.recentActivity.map(t=>(0,e.jsxs)("li",{className:"grid gap-2 py-2.5 sm:grid-cols-(--gtc-17) sm:items-center",children:[(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsx)("div",{className:"truncate text-sm",children:t.action.replaceAll("_"," ")}),(0,e.jsxs)("div",{className:"truncate text-xs text-ink-3",children:[t.entityType," · ",t.entityId.slice(0,12)]})]}),(0,e.jsx)("span",{className:"text-xs tabular-nums text-ink-3 sm:justify-self-end",children:y(t.createdAt)})]},t.id))})]})]}),(0,e.jsxs)("div",{className:"grid gap-10 xl:grid-cols-2",children:[(0,e.jsx)(P,{title:"Agent attribution",empty:"No issue-linked token usage yet.",rows:M}),(0,e.jsx)(P,{title:"Provider mix",empty:"No provider usage attributed yet.",rows:R})]})]})}r(Te,"UserProfile");export{Te as UserProfile};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var p=Object.defineProperty;var s=(r,t)=>p(r,"name",{value:t,configurable:!0});import{i as h}from"./rolldown-runtime-ZpX3ckPj.js";import{la as u}from"./createLucideIcon-CgrPXnTY.js";import{t as d}from"./InlineBanner-
|
|
1
|
+
var p=Object.defineProperty;var s=(r,t)=>p(r,"name",{value:t,configurable:!0});import{i as h}from"./rolldown-runtime-ZpX3ckPj.js";import{la as u}from"./createLucideIcon-CgrPXnTY.js";import{t as d}from"./InlineBanner-DeTqU5Gp.js";function c(r){const[t,e]=r;return t===127||t===0?"loopback":t===10||t===172&&e>=16&&e<=31||t===192&&e===168||t===169&&e===254||t===100&&e>=64&&e<=127?"private":null}s(c,"ipv4Warning");function f(r){if(!r)return null;let t;try{t=new URL(r)}catch{return"invalid"}if(t.protocol!=="http:"&&t.protocol!=="https:")return"invalid";const e=t.hostname.toLowerCase().replace(/^\[|\]$/g,"").replace(/\.$/,"");if(e==="localhost"||e.endsWith(".localhost")||e==="::1"||e==="::")return"loopback";if(e.includes(":")){const n=/^::ffff:([\da-f]{1,4}):([\da-f]{1,4})$/.exec(e);if(n){const i=parseInt(n[1],16),o=parseInt(n[2],16),l=c([i>>8,i&255,o>>8,o&255]);if(l)return l}if(/^(f[cd][\da-f]{2}|fe[89ab][\da-f]|fec[\da-f]):/.test(e))return"private"}else if(/^\d+\.\d+\.\d+\.\d+$/.test(e)){const n=c(e.split(".").map(Number));if(n)return n}else{if(e.endsWith(".ts.net"))return"tailscale";if(!e.includes(".")||/\.(local|internal|lan|home|corp|intranet|private|test)$/.test(e)||e.endsWith(".home.arpa"))return"private"}return t.protocol==="https:"?null:"https"}s(f,"webhookUrlWarningReason");var a=h(u(),1),m={loopback:{title:"Other apps can’t reach this localhost URL",message:"This address points back to the machine sending the request. Services such as GitHub can’t use it to reach Wardmote on your computer."},private:{title:"This webhook URL appears to be private",message:"Only senders with access to this network can reach this address. Apps on the public internet, such as GitHub, usually can’t deliver webhooks here."},tailscale:{title:"This Tailscale URL may not be public",message:"Tailscale Serve is private to your tailnet, even with HTTPS. Apps outside your tailnet need Tailscale Funnel or another public HTTPS address. If Funnel is already enabled for this URL, you can continue."},https:{title:"Use HTTPS for webhooks from other apps",message:"This URL uses HTTP. Many apps require HTTPS, and HTTP does not encrypt webhook credentials or payloads."},invalid:{title:"Check the webhook URL",message:"This is not a valid HTTP or HTTPS URL. Your sending app needs a complete address it can reach."}};function v({url:r}){const t=f(r);if(!t)return null;const e=m[t];return(0,a.jsx)(d,{tone:"warning",title:e.title,children:(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("p",{children:e.message}),(0,a.jsx)("p",{children:"You can continue for local or private-network use. For public senders, use a publicly reachable HTTPS URL."}),(0,a.jsx)("a",{className:"underline underline-offset-4",href:"https://github.com/tickernelz/wardmote/blob/main/docs/deploy/deployment-modes.md",target:"_blank",rel:"noopener noreferrer",children:"Learn how to set up HTTPS and public access"})]})})}s(v,"WebhookUrlWarning");export{v as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var ns=Object.defineProperty;var i=(o,d)=>ns(o,"name",{value:d,configurable:!0});import{i as Ke}from"./rolldown-runtime-ZpX3ckPj.js";import{la as os,ua as as}from"./createLucideIcon-CgrPXnTY.js";import{a as is,y as ls}from"./star-eem0qj3E.js";import{t as F,v as H}from"./queryKeys-BzT8CD34.js";import{o as rs}from"./companies-query-BEdFiAhG.js";import{C as ds,D as Re,E as cs,S as us,T as ms,_ as ps,a as fs,b as hs,c as Z,d as gs,f as xs,g as Ee,h as ys,i as vs,l as ws,m as bs,n as Ss,o as V,p as js,r as Is,s as As,t as Rs,u as Ne,v as Es,w as Ns,x as Ds,y as ks}from"./DecisionDateChips-89KkV4mo.js";import{n as Ts}from"./CompanyContext-fQCNWI_f.js";import{o as Ks}from"./router-CJbFZfVR.js";import{t as Cs}from"./inbox-BbL3s2C7.js";import{a as Os}from"./ToastContext-DyVJ6bCh.js";import{t as _s}from"./agents-B8n-p0aX.js";import{n as Ms,t as Ls}from"./useSharedPolling-CFeiZe2t.js";import{n as Fs}from"./BreadcrumbContext-DNbB7zWn.js";import{Qt as Hs,Xt as Bs,_ as Ps,_a as qs,la as zs,w as Gs,wi as Qs}from"./index-QhteFtm-.js";var t=Ke(as(),1),n=Ke(os(),1),De=i(()=>{},"noopToggleExpand"),ke=50,Us=100,Ys=480;function Te(o){return o.sourceKind==="failed_run"||o.sourceKind==="recovery_action"}i(Te,"offersRetry");function Ws(o){if(!o||typeof window>"u")return null;let d=o.parentElement;for(;d&&d!==document.body&&d!==document.documentElement;){const l=window.getComputedStyle(d).overflowY;if(l==="auto"||l==="scroll"||l==="overlay")return d;d=d.parentElement}return null}i(Ws,"findScrollContainer");function pt(){const{selectedCompanyId:o}=Ts(),{setBreadcrumbs:d}=Fs(),[l,p]=(0,t.useState)(null),[c,k]=(0,t.useState)(null),[Ce,T]=(0,t.useState)(!1),[J,ee]=(0,t.useState)(!1),[K,Oe]=(0,t.useState)(()=>Es()),[j,_e]=(0,t.useState)(()=>ks()),[C,se]=(0,t.useState)(()=>js),[I,te]=(0,t.useState)(()=>new Set),[B,Me]=(0,t.useState)(!1),[P,Le]=(0,t.useState)(!1),[Fe,He]=(0,t.useState)(!1),[Be,Pe]=(0,t.useState)(!1),[qe,ze]=(0,t.useState)(!1),[q,Ge]=(0,t.useState)("all"),[z,Qe]=(0,t.useState)({from:null,to:null}),[Ue,ne]=ls(),G=Ue.get("decisionId"),[oe,Ye]=(0,t.useState)(!1),[ae,A]=(0,t.useState)(()=>new Set),[v,ie]=(0,t.useState)(()=>new Set),{dismiss:le,snooze:re,restore:O}=Qs(o),{pushToast:de}=Os(),ce=Ks(),_=(0,t.useMemo)(()=>us(q,Date.now(),z),[q,z]);(0,t.useEffect)(()=>{d([{label:"Decisions"}])},[d]),(0,t.useEffect)(()=>{se(ps(o)),te(hs(o))},[o]);const{data:w,isLoading:We,error:ue}=H({queryKey:[...F.attention(o),"with-dismissed",_.activitySince??null,_.activityUntil??null],queryFn:i(()=>zs.list(o,{includeDismissed:!0,all:!0,..._}),"queryFn"),enabled:!!o,staleTime:ws,refetchOnWindowFocus:!1}),{data:M}=H({queryKey:F.agents.list(o),queryFn:i(()=>_s.list(o),"queryFn"),enabled:!!o}),me=F.liveRuns(o),Q=Ms({companyId:o,resourceKey:"live-runs",queryKey:me,enabled:!!o,refetchInterval:!1,leaderOnly:!0}),{data:U,dataUpdatedAt:$e}=H({queryKey:me,queryFn:i(()=>qs.liveRunsForCompany(o),"queryFn"),enabled:Q.enabled,refetchInterval:Q.refetchInterval});Ls(Q,U,$e);const{data:pe}=H({queryKey:F.auth.session,queryFn:i(()=>rs.getSession(),"queryFn")}),L=pe?.user?.id??pe?.session?.userId??null,b=(0,t.useMemo)(()=>{const e=new Map;for(const s of M??[])e.set(s.id,s);return e},[M]);(0,t.useEffect)(()=>{A(new Set),ie(new Set)},[w?.generatedAt]);const f=(0,t.useMemo)(()=>w?.items??[],[w]),Xe=i(e=>e.dismissal!=null&&e.dismissal.isActive,"isServerHidden"),R=(0,t.useMemo)(()=>f.filter(e=>(!Xe(e)||v.has(e.id))&&!ae.has(e.id)),[f,ae,v]),Y=(0,t.useMemo)(()=>w?.generatedAt?new Date(w.generatedAt).getTime():Date.now(),[w?.generatedAt]),W=(0,t.useMemo)(()=>R.filter(Ne),[R]),g=(0,t.useMemo)(()=>R.filter(e=>!Ne(e)),[R]),E=(0,t.useMemo)(()=>f.filter(e=>e.dismissal?.kind==="snooze"&&e.dismissal.isActive&&!v.has(e.id)),[f,v]),N=(0,t.useMemo)(()=>f.filter(e=>e.dismissal?.kind==="dismiss"&&e.dismissal.isActive&&!v.has(e.id)),[f,v]),Ze=(0,t.useMemo)(()=>vs(gs(g)),[g]),x=(0,t.useMemo)(()=>{const e=bs(g,C);if(K==="none")return xs(e,Y);const s=Re(e,j);return ys(s,K)},[g,C,j,K,Y]),fe=(0,t.useMemo)(()=>x.reduce((e,s)=>e+s.items.length,0),[x]),u=(0,t.useMemo)(()=>x.filter(e=>e.label===null||!I.has(e.key)).flatMap(e=>e.items),[I,x]),[$,he]=(0,t.useState)(ke),ge=(0,t.useRef)(null);(0,t.useEffect)(()=>{he(ke)},[o]);const D=(0,t.useMemo)(()=>{const e=c?u.findIndex(s=>s.id===c):-1;return Ds({groups:x,collapsedGroupKeys:I,snoozedItems:E,snoozedOpen:B,dismissedItems:N,dismissedOpen:P,limit:Math.max($,e+1)})},[I,N,P,x,u,$,c,E,B]),xe=(0,t.useCallback)(()=>{he(e=>e+Us)},[]);(0,t.useEffect)(()=>{if(!D.hasMoreRows)return;let e=null;const s=Ws(ge.current),a=s??window,r=i(()=>{e===null&&(e=window.requestAnimationFrame(()=>{e=null;const m=s?.scrollHeight??document.documentElement.scrollHeight;m!==0&&(s?s.scrollTop+s.clientHeight:window.scrollY+window.innerHeight)>=m-Ys&&xe()}))},"checkScrollPosition");return a.addEventListener("scroll",r,{passive:!0}),window.addEventListener("resize",r),r(),()=>{a.removeEventListener("scroll",r),window.removeEventListener("resize",r),e!==null&&window.cancelAnimationFrame(e)}},[xe,D.hasMoreRows,$]),(0,t.useEffect)(()=>{c&&!u.some(e=>e.id===c)&&(k(null),T(!1))},[u,c]),(0,t.useEffect)(()=>{c&&document.getElementById(`attention-row-${c}`)?.scrollIntoView({block:"nearest"})},[c]),(0,t.useEffect)(()=>{if(oe||!G||f.length===0)return;const e=f.find(s=>s.sourceKind==="decision"&&s.subject.id===G);Ye(!0),ee(!0),e&&(p(e.id),k(e.id),T(!0),ne(s=>{const a=new URLSearchParams(s);return a.delete("decisionId"),a},{replace:!0}))},[f,oe,G,ne]),(0,t.useEffect)(()=>{if(J||g.length===0)return;const e=Re(g,j).find(s=>Ee(s));e&&p(e.id),ee(!0)},[g,J,j]);const Ve=i(e=>{Oe(e),Ns(e)},"updateGroupBy"),Je=i(e=>{_e(e),ms(e)},"updateSortOrder"),es=i(e=>{se(e),ds(o,e)},"updateFilters"),ss=i(e=>{te(s=>{const a=new Set(s);return a.has(e)?a.delete(e):a.add(e),cs(o,a),a})},"toggleGroupCollapse"),ye=(0,t.useCallback)(e=>{A(s=>{const a=new Set(s);return a.delete(e.id),a}),O(e.dismissalKey)},[O]),S=(0,t.useCallback)(e=>{A(s=>new Set(s).add(e.id)),le(e.dismissalKey),p(s=>s===e.id?null:s),de({id:`attention-dismiss-${e.id}`,dedupeKey:`attention-dismiss-${e.dismissalKey}`,title:"Dismissed",body:e.subject.title??void 0,tone:"info",ttlMs:8e3,action:{label:"Undo",onClick:i(()=>ye(e),"onClick")}})},[le,ye,de]),ve=(0,t.useCallback)((e,s)=>{A(a=>new Set(a).add(e.id)),re(e.dismissalKey,s),p(a=>a===e.id?null:a)},[re]),we=(0,t.useCallback)(e=>{A(s=>new Set(s).add(e.id)),p(s=>s===e.id?null:s)},[]),be=(0,t.useCallback)(e=>{ie(s=>new Set(s).add(e.id)),O(e.dismissalKey)},[O]),Se=(0,t.useCallback)(e=>{k(e.id),T(!1),p(s=>s===e.id?null:e.id)},[]);if((0,t.useEffect)(()=>{const e=i(s=>{const a=Hs({defaultPrevented:s.defaultPrevented,key:s.key,metaKey:s.metaKey,ctrlKey:s.ctrlKey,altKey:s.altKey,target:s.target,hasOpenDialog:Bs(document),hasSelection:c!==null});if(a==="ignore"||u.length===0)return;if(a==="next"||a==="previous"){s.preventDefault();const m=c?u.findIndex(y=>y.id===c):-1,h=m<0?a==="next"?0:u.length-1:(m+(a==="next"?1:-1)+u.length)%u.length;k(u[h]?.id??null),T(!0);return}const r=u.find(m=>m.id===c);r&&(s.preventDefault(),a==="dismiss"?S(r):Ee(r)?p(m=>m===r.id?null:r.id):r.subject.href&&ce(r.subject.href))},"handleKeyDown");return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[S,u,ce,c]),!o)return(0,n.jsx)("p",{className:"text-sm text-ink-3",children:"Select an organization first."});if(We)return(0,n.jsx)(Ps,{variant:"approvals"});const ts=R.length>0||E.length>0||N.length>0;return(0,n.jsxs)("div",{ref:ge,className:"max-w-3xl space-y-4",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,n.jsx)("h1",{className:"text-xl font-bold",children:"Decisions"}),(0,n.jsx)(As,{visibleCount:fe,filterOptions:Ze,filters:C,onFiltersChange:es,groupBy:K,onGroupByChange:Ve,sortOrder:j,onSortOrderChange:Je})]}),(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)(Ss,{companyId:o,activeQueueKey:null}),(0,n.jsx)(Rs,{value:q,custom:z,onChange:i((e,s)=>{Ge(e),Qe(s)},"onChange")})]}),ue&&(0,n.jsx)("p",{className:"text-sm text-bad",children:ue.message}),ts?(0,n.jsxs)("div",{className:"space-y-4",children:[fe===0?(0,n.jsx)(Xs,{filtered:g.length>0}):(0,n.jsx)(n.Fragment,{children:x.map(e=>{const s=e.label,a=s!==null&&I.has(e.key);return(0,n.jsxs)("section",{className:"space-y-2",children:[s!==null&&(0,n.jsx)(Gs,{label:s,collapsible:!0,collapsed:a,onToggle:i(()=>ss(e.key),"onToggle"),trailing:(0,n.jsx)("span",{className:"text-xs tabular-nums text-ink-3",children:e.items.length})}),!a&&(0,n.jsx)("div",{className:"space-y-4",children:(()=>{const r=D.groupRows.get(e.key)??[],m=new Set;return r.map(h=>{const y=h.sourceKind==="decision"?h.subject.metadata?.bundleId??null:null;let je=null;if(y&&!m.has(y)){m.add(y);const Ie=r.filter(Ae=>Ae.sourceKind==="decision"&&(Ae.subject.metadata?.bundleId??null)===y),X=Ie[0];je=(0,n.jsx)($s,{agentName:b.get(X?.subject.metadata?.originAgentId)?.name??null,title:X?.subject.metadata?.bundleTitle??null,originIssue:X?.relatedIssue??null,count:Ie.length})}return(0,n.jsxs)(t.Fragment,{children:[je,(0,n.jsx)("div",{className:y?"border-l-2 border-violet-500/40 pl-3":void 0,children:(0,n.jsx)(Z,{item:h,companyId:o,expanded:l===h.id,onToggleExpand:Se,onDismiss:S,onSnooze:ve,agentMap:b,agents:M,showTriage:!0,currentUserId:L,selected:Ce&&c===h.id,liveRuns:Te(h)?U:void 0,onRetried:we})})]},h.id)})})()})]},e.key)})}),E.length>0&&(0,n.jsx)(V,{label:"Snoozed",count:E.length,open:B,onToggle:i(()=>Me(e=>!e),"onToggle"),children:D.snoozedRows.map(e=>(0,n.jsx)(Z,{item:e,companyId:o,variant:"hidden",expanded:!1,onToggleExpand:De,onDismiss:S,onRestore:be,agentMap:b,currentUserId:L},e.id))}),N.length>0&&(0,n.jsx)(V,{label:"Dismissed",count:N.length,open:P,onToggle:i(()=>Le(e=>!e),"onToggle"),children:D.dismissedRows.map(e=>(0,n.jsx)(Z,{item:e,companyId:o,variant:"hidden",expanded:!1,onToggleExpand:De,onDismiss:S,onRestore:be,agentMap:b,currentUserId:L},e.id))}),W.length>0&&(0,n.jsxs)(V,{label:"Aging",count:W.length,open:Fe,onToggle:i(()=>He(e=>!e),"onToggle"),children:[(0,n.jsxs)("p",{className:"text-xs text-ink-3",children:["Idle past ",30," days — kept off the desk. Keep any you still want surfaced."]}),W.map(e=>(0,n.jsx)(fs,{item:e,companyId:o,now:Y,agentMap:b,agents:M,currentUserId:L,expanded:l===e.id,onToggleExpand:Se,onDismiss:S,onSnooze:ve,liveRuns:Te(e)?U:void 0,onRetried:we},e.id))]})]}):(0,n.jsx)(Zs,{}),(0,n.jsx)(Is,{companyId:o,selectedSourceKinds:C.sourceKinds,bounds:_,agentMap:b,decidedOpen:Be,expiredOpen:qe,onToggleDecided:i(()=>Pe(e=>!e),"onToggleDecided"),onToggleExpired:i(()=>ze(e=>!e),"onToggleExpired")})]})}i(pt,"WhatNeedsMe");function $s({agentName:o,title:d,originIssue:l,count:p}){return(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-x-1.5 gap-y-0.5 rounded-sm border-l-2 border-violet-500/60 bg-violet-500/5 px-3 py-1.5 text-xs",children:[(0,n.jsxs)("span",{className:"font-semibold text-violet-800 dark:text-violet-200",children:[o??"An agent"," proposed ",p," ",p===1?"decision":"decisions"]}),l&&(l.identifier||l.title)&&(0,n.jsxs)("span",{className:"text-ink-3",children:["· from ",l.href?(0,n.jsx)("a",{href:l.href,className:"hover:underline",children:l.identifier??l.title}):l.identifier??l.title]}),d&&(0,n.jsxs)("span",{className:"text-ink-3",children:["· ",d]}),(0,n.jsxs)("span",{className:"text-ink-3",children:["· ",p," pending"]})]})}i($s,"DecisionBundleHeader");function Xs({filtered:o}){return(0,n.jsxs)("div",{className:"rounded-xl border border-dashed border-line py-10 text-center",children:[(0,n.jsx)("p",{className:"text-sm font-medium text-ink",children:o?"No decisions match your filters.":"You're all caught up."}),o&&(0,n.jsx)("p",{className:"mt-1 text-xs text-ink-3",children:"Adjust or clear the filters to see the rest."})]})}i(Xs,"CaughtUpNote");function Zs(){return(0,n.jsxs)("div",{className:"flex flex-col items-center justify-center rounded-xl border border-dashed border-line py-20 text-center",children:[(0,n.jsx)("div",{className:"mb-4 rounded-full bg-green-500/10 p-4",children:(0,n.jsx)(is,{className:"h-10 w-10 text-green-500"})}),(0,n.jsx)("p",{className:"text-lg font-semibold text-ink",children:"You're all caught up"}),(0,n.jsxs)("p",{className:"mt-1 flex items-center gap-1.5 text-sm text-ink-3",children:[(0,n.jsx)(Cs,{className:"h-4 w-4"}),"Nothing needs a decision from you right now."]})]})}i(Zs,"ZeroState");export{pt as WhatNeedsMe};
|
package/dist/assets/{WorkspaceRuntimeControls-Cp5E1FME.js → WorkspaceRuntimeControls-Clk2nzU6.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
var E=Object.defineProperty;var c=(e,s)=>E(e,"name",{value:s,configurable:!0});import{i as _}from"./rolldown-runtime-ZpX3ckPj.js";import{l as p,la as M}from"./createLucideIcon-CgrPXnTY.js";import{on as T}from"./router-BKzUF9uf.js";import{t as W}from"./activity-BwGRpduS.js";import{t as C}from"./external-link-BIcMNNSN.js";import{r as D,t as A}from"./button-DI4w5WP7.js";import{t as P}from"./play-Czm7OCYh.js";import{t as B}from"./rotate-ccw-DpzLJhXT.js";import{t as H}from"./square-CDo6rOf8.js";import{t as R}from"./badge-jeXr866I.js";import{t as U}from"./useManagedSandboxOnly-KE5BJrr7.js";var J="loopback",z=/(?:^|\s)--bind(?:-host)?(?:=|\s+)(?!--)[^\s]+/g,F=/(?:^|[\s;&|])(?:(?:pnpm|npm|yarn|bun)(?:\s+run)?\s+dev(?::once|:watch|:server)?(?=\s|$)|[^\s]*dev-runner(?:\.[cm]?[jt]s)?(?=\s|$))/;function K(e){return F.test(e)}c(K,"isWardmoteDevRunnerCommand");function G(e){if(!K(e))return e;const s=e.replace(z,"").trim();return s.length===0?e:`${s} --bind ${J}`}c(G,"forceLoopbackBindInCommand");function N(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}c(N,"isRecord");function m(e){if(typeof e!="string")return null;const s=e.trim();return s.length>0?s:null}c(m,"readNonEmptyString");function O(e){if(N(e)&&e.type==="auto")return null;const s=N(e)?e.value:e;return typeof s=="number"&&Number.isInteger(s)&&s>0&&s<=65535?s:null}c(O,"readConfiguredPort");function S(e){const s=(e??"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"");return s.length>0?s:null}c(S,"slugify");function Q(e){const s=S(e.explicitId);if(s)return s;const i=S(e.name);return i?`${e.kind}:${i}`:`${e.kind}:${e.index+1}`}c(Q,"deriveWorkspaceCommandId");function j(e){return{id:Q({kind:e.kind,explicitId:m(e.entry.id),name:m(e.entry.name)??m(e.entry.label)??m(e.entry.title)??e.fallbackName,index:e.sourceIndex}),name:m(e.entry.name)??m(e.entry.label)??m(e.entry.title)??e.fallbackName,kind:e.kind,command:m(e.entry.command),cwd:m(e.entry.cwd),port:O(e.entry.port),lifecycle:e.kind==="service"?e.entry.lifecycle==="ephemeral"?"ephemeral":"shared":null,serviceIndex:e.serviceIndex,disabledReason:m(e.entry.disabledReason),rawConfig:{...e.entry},source:{type:"wardmote",key:e.sourceKey,index:e.sourceIndex}}}c(j,"buildWorkspaceCommandDefinition");function V(e,s,i,n){if(!e.has(s))return e.add(s),s;const t=`${s}-${i}-${n+1}`;return e.add(t),t}c(V,"uniqueWorkspaceCommandId");function y(e,s){const i=e?.[s];return Array.isArray(i)?i.filter(n=>N(n)):[]}c(y,"readCommandEntries");function X(e){if(!e)return[];const s=y(e,"commands"),i=new Set;let n=0;const t=c(l=>({...l,id:V(i,l.id,l.source.key,l.source.index)}),"finalize");if(s.length>0)return s.map((l,d)=>t(j({entry:l,kind:l.kind==="job"?"job":"service",sourceKey:"commands",sourceIndex:d,serviceIndex:l.kind==="job"?null:n++,fallbackName:l.kind==="job"?`Job ${d+1}`:`Service ${d+1}`})));const u=y(e,"services").map((l,d)=>t(j({entry:l,kind:"service",sourceKey:"services",sourceIndex:d,serviceIndex:n++,fallbackName:`Service ${d+1}`}))),o=y(e,"jobs").map((l,d)=>t(j({entry:l,kind:"job",sourceKey:"jobs",sourceIndex:d,serviceIndex:null,fallbackName:`Job ${d+1}`})));return[...u,...o]}c(X,"listWorkspaceCommandDefinitions");function Y(e,s){const i=!!(e.command&&s.command&&s.exposure?.provider==="tailscale_https"&&s.command===G(e.command));if(e.command&&s.command&&s.command!==e.command&&!i||e.port!==null&&s.port!=null&&s.port!==e.port)return-1;if(e.serviceIndex!==null&&s.configIndex!==null&&s.configIndex!==void 0)return s.configIndex!==e.serviceIndex?-1:100+(e.port!==null&&s.port===e.port?8:0);let n=0;return e.port!==null&&s.port===e.port&&(n+=8),s.serviceName===e.name&&(n+=4),(s.command??null)===(e.command??null)&&(n+=4),e.cwd&&s.cwd&&(s.cwd===e.cwd||s.cwd.endsWith(`/${e.cwd}`))&&(n+=2),n}c(Y,"scoreWorkspaceRuntimeServiceMatch");function Z(e,s){let i=null,n=-1;for(const t of s??[]){const u=Y(e,t);u>n&&(i=t,n=u)}return n>0?i:null}c(Z,"matchWorkspaceRuntimeServiceToCommand");var r=_(M(),1);function q(e,s,i){return{key:`command:${e.id}:${s?.id??"idle"}`,title:e.name,kind:"service",statusLabel:s?.status??"stopped",lifecycle:s?.lifecycle??e.lifecycle,healthStatus:s?.healthStatus??"unknown",exposure:s?.exposure??null,command:s?.command??e.command,cwd:s?.cwd??e.cwd,port:s?.port??null,url:s?.url??null,canStart:i&&!e.disabledReason,canRun:!1,workspaceCommandId:e.id,runtimeServiceId:s?.id??null,serviceIndex:e.serviceIndex,disabledReason:e.disabledReason}}c(q,"buildServiceItem");function ee(e,s){return{key:`command:${e.id}`,title:e.name,kind:"job",statusLabel:"run once",lifecycle:null,healthStatus:null,exposure:null,command:e.command,cwd:e.cwd,port:null,url:null,canStart:!1,canRun:s&&!e.disabledReason&&!!e.command,workspaceCommandId:e.id,runtimeServiceId:null,serviceIndex:null,disabledReason:e.disabledReason??(e.command?null:"This job is missing a command.")}}c(ee,"buildJobItem");function he(e){const s=X(e.runtimeConfig),i=[...e.runtimeServices??[]],n=new Set,t=[],u=[];for(const o of s){if(o.kind==="job"){u.push(ee(o,e.canRunJobs??e.canStartServices));continue}const l=Z(o,i);l&&n.add(l.id),t.push(q(o,l,e.canStartServices))}return{services:t,jobs:u,otherServices:i.filter(o=>!n.has(o.id)&&(o.status==="provisioning"||o.status==="starting"||o.status==="running")).map(o=>({key:`runtime:${o.id}`,title:o.serviceName,kind:"service",statusLabel:o.status,lifecycle:o.lifecycle,healthStatus:o.healthStatus,exposure:o.exposure??null,command:o.command??null,cwd:o.cwd??null,port:o.port??null,url:o.url??null,canStart:!1,canRun:!1,workspaceCommandId:null,runtimeServiceId:o.id,serviceIndex:o.configIndex??null,disabledReason:"This runtime service no longer matches a configured workspace command."}))}}c(he,"buildWorkspaceRuntimeControlSections");function se(e){return[...e.services,...e.otherServices].find(s=>(s.statusLabel==="running"||s.statusLabel==="starting")&&s.url)?.url??null}c(se,"getRunningRuntimeServiceUrl");function w(e){return e==="running"||e==="starting"||e==="provisioning"}c(w,"isActiveStatusLabel");function $(e){return e?.state==="failed"?{label:"HTTPS unavailable",remediation:"Check the Tailscale broker and node HTTPS configuration."}:e?.state==="cleanup_pending"?{label:"HTTPS cleanup pending",remediation:"Restart the host broker before reusing this port."}:null}c($,"exposureFailureCopy");function ne({exposure:e}){const s=$(e);return s?(0,r.jsxs)("div",{className:"space-y-1 break-words text-xs text-bad",role:"alert",children:[(0,r.jsxs)("div",{className:"line-clamp-3 font-medium",title:e?.lastError??void 0,children:[s.label,e?.lastError?` · ${e.lastError}`:""]}),(0,r.jsx)("div",{children:s.remediation})]}):null}c(ne,"ExposureFailureDetail");function be(e){const s=new Map((e.runtimeServices??[]).map(n=>[n.id,n])),i=e.pendingRequests??(e.isPending&&e.pendingRequest?[e.pendingRequest]:[]);return[...e.sections.services,...e.sections.otherServices].map(n=>{let t=n.statusLabel==="running"?"running":n.statusLabel==="provisioning"?"provisioning":n.statusLabel==="starting"?"starting":n.statusLabel==="failed"?"failed":"stopped";const u=i.find(a=>a.action!=="run"&&(a.workspaceCommandId??null)===(n.workspaceCommandId??null)&&(a.runtimeServiceId??null)===(n.runtimeServiceId??null)&&(a.serviceIndex??null)===(n.serviceIndex??null));u&&(t=u.action==="stop"?"stopping":u.action==="restart"?"restarting":"starting");const o=n.runtimeServiceId?s.get(n.runtimeServiceId)??null:null,l=t==="failed"?`Service failed${o?.stoppedAt?` · ${T(o.stoppedAt)}`:""}`:null,d=o?.exposure??n.exposure,x=$(d),f=d?.state==="pending"?"Provisioning HTTPS…":d?.state==="ready"?"HTTPS ready":x?`${x.label} · ${x.remediation}`:null;return{key:n.key,name:n.title,state:t,healthStatus:n.healthStatus,url:n.url,port:n.port,failureDetail:l,exposureState:d?.state??null,exposureDetail:f,canStart:n.canStart}})}c(be,"buildWorkspaceServiceControlEntries");function ge(e,s,i){const n=[...e.services,...e.otherServices];if(i!==null){const t=n.find(u=>u.key===i);return t?[b(t,s)]:[]}return s==="stop"?n.filter(t=>w(t.statusLabel)).map(t=>b(t,"stop")):s==="start"?n.filter(t=>!w(t.statusLabel)&&t.canStart).map(t=>b(t,"start")):n.flatMap(t=>w(t.statusLabel)?[b(t,"restart")]:t.canStart?[b(t,"start")]:[])}c(ge,"resolveWorkspaceServiceControlRequests");function re(e,s){return e?.action===s.action&&(e?.workspaceCommandId??null)===(s.workspaceCommandId??null)&&(e?.runtimeServiceId??null)===(s.runtimeServiceId??null)&&(e?.serviceIndex??null)===(s.serviceIndex??null)}c(re,"requestMatchesPending");function b(e,s){return{action:s,workspaceCommandId:e.workspaceCommandId??null,runtimeServiceId:e.runtimeServiceId??null,serviceIndex:e.serviceIndex??null}}c(b,"buildRequest");function L({item:e,isPending:s,pendingRequest:i,onAction:n,square:t,iconOnly:u}){const o=e.kind==="job"?["run"]:e.statusLabel==="running"||e.statusLabel==="starting"?["stop",...e.canStart?["restart"]:[]]:["start"];return(0,r.jsx)("div",{className:p("flex gap-2",u?"w-auto flex-row flex-wrap":"w-full flex-col sm:w-auto sm:flex-row sm:flex-wrap"),children:o.map(l=>{const d=b(e,l),x=l==="stop"?H:l==="restart"?B:P,f=l==="run"?"Run":l==="start"?"Start":l==="stop"?"Stop":"Restart",a=s&&re(i,d),v=s||l==="run"&&!e.canRun||(l==="start"||l==="restart")&&!e.canStart;return(0,r.jsxs)(A,{variant:u?"secondary":l==="stop"?"danger":l==="restart"?"secondary":"primary",size:u?"icon-xs":"sm",className:p(u?"shrink-0":"w-full justify-start sm:w-auto",t?"rounded-none":null),disabled:v,onClick:c(()=>n(d),"onClick"),"aria-label":f,title:f,children:[a?(0,r.jsx)(D,{className:"h-4 w-4 animate-spin"}):(0,r.jsx)(x,{className:"h-4 w-4"}),u?(0,r.jsx)("span",{className:"sr-only",children:f}):f]},`${e.key}:${l}`)})})}c(L,"CommandActionButtons");function I({title:e,description:s,items:i,emptyMessage:n,disabledHint:t,isPending:u,pendingRequest:o,onAction:l,square:d,iconOnly:x}){const{hideHostPaths:f}=U();return(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsx)("div",{className:"text-sm font-medium",children:e}),(0,r.jsx)("p",{className:"text-xs text-ink-3",children:s})]}),i.length===0?(0,r.jsxs)("div",{className:p("border border-dashed border-line/80 bg-bg px-3 py-4 text-sm text-ink-3",d?"rounded-none":"rounded-xl"),children:[n,t?(0,r.jsx)("p",{className:"mt-2 text-xs",children:t}):null]}):(0,r.jsx)("div",{className:"space-y-3",children:i.map(a=>(0,r.jsx)("div",{className:p("border border-line/80 bg-bg px-3 py-3",d?"rounded-none":"rounded-xl"),children:(0,r.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsx)("div",{className:"text-sm font-medium",children:a.title}),(0,r.jsxs)("div",{className:"text-xs text-ink-3",children:[a.kind," · ",a.statusLabel,a.lifecycle?` · ${a.lifecycle}`:""]})]}),(0,r.jsx)(L,{item:a,isPending:u,pendingRequest:o,onAction:l,square:d,iconOnly:x})]}),(0,r.jsxs)("div",{className:"space-y-1 text-xs text-ink-3",children:[a.url?(0,r.jsxs)("a",{href:a.url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 hover:underline",children:[a.url,(0,r.jsx)(C,{className:"h-3.5 w-3.5"})]}):null,a.port?(0,r.jsxs)("div",{children:["Port ",a.port]}):null,a.command?(0,r.jsx)("div",{className:"break-all font-mono",children:a.command}):null,a.cwd&&!f?(0,r.jsx)("div",{className:"break-all font-mono",children:a.cwd}):null,a.disabledReason?(0,r.jsx)("div",{children:a.disabledReason}):null]}),(0,r.jsx)(ne,{exposure:a.exposure}),a.healthStatus&&a.statusLabel!=="stopped"?(0,r.jsx)("div",{className:"flex items-center gap-2",children:(0,r.jsx)(R,{variant:"outline",className:p("px-2.5 py-1 text-(length:--text-micro)",a.healthStatus==="healthy"?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":a.healthStatus==="unhealthy"?"border-bad/30 bg-bad/10 text-bad":"border-line text-ink-3"),children:a.healthStatus})}):null]})},a.key))})]})}c(I,"CommandSection");function ve({sections:e,items:s,isPending:i=!1,pendingRequest:n=null,serviceEmptyMessage:t="No services are configured for this workspace.",jobEmptyMessage:u="No one-shot jobs are configured for this workspace.",emptyMessage:o,disabledHint:l=null,onAction:d,className:x,square:f}){const a=e??{services:(s??[]).map(h=>({...h,statusLabel:h.statusLabel??h.status??"stopped"})),jobs:[],otherServices:[]},v=o??t,g=[...a.services,...a.otherServices].filter(h=>h.statusLabel==="running"||h.statusLabel==="starting").length,k=g>0||l===null?null:l;return(0,r.jsxs)("div",{className:p("space-y-4",x),children:[(0,r.jsx)("div",{className:p("border border-line/70 bg-bg p-3",f?"rounded-none":"rounded-xl"),children:(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsx)("div",{className:"text-xs font-medium uppercase tracking-(--tracking-eyebrow) text-ink-3",children:"Workspace commands"}),(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,r.jsxs)(R,{variant:"outline",className:p("gap-1.5 px-2.5 py-1",g>0?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":"border-line bg-bg text-ink-3"),children:[(0,r.jsx)(W,{className:"h-3.5 w-3.5"}),g>0?`${g} services running`:"No services running"]}),(0,r.jsx)("span",{className:"text-xs text-ink-3",children:a.jobs.length>0?`${a.jobs.length} job${a.jobs.length===1?"":"s"} available to run on demand.`:"Each command can be controlled independently."})]}),k?(0,r.jsx)("p",{className:"text-xs text-ink-3",children:k}):null]})}),(0,r.jsx)(I,{title:"Services",description:"Long-running commands that Wardmote can supervise for this workspace.",items:a.services,emptyMessage:v,disabledHint:k,isPending:i,pendingRequest:n,onAction:d,square:f}),(0,r.jsx)(I,{title:"Jobs",description:"One-shot commands that run now and exit when they finish.",items:a.jobs,emptyMessage:u,isPending:i,pendingRequest:n,onAction:d,square:f}),a.otherServices.length>0?(0,r.jsx)(I,{title:"Untracked services",description:"Running services that no longer match the current workspace command config.",items:a.otherServices,emptyMessage:"",isPending:i,pendingRequest:n,onAction:d,square:f}):null]})}c(ve,"WorkspaceRuntimeControls");function ke({sections:e,isPending:s=!1,pendingRequest:i=null,onAction:n,square:t,align:u="end",iconOnly:o=!1}){const l=e.services.length>0?e.services:e.otherServices,d=se(e),x=u==="end";return l.length===0&&!d?null:(0,r.jsxs)("div",{className:p("flex min-w-0 flex-col items-stretch gap-2",x?"sm:items-end":"sm:items-start"),children:[l.length>0?(0,r.jsx)("div",{className:p("flex max-w-full flex-col gap-2 sm:flex-row sm:flex-wrap",x?"sm:justify-end":"sm:justify-start"),children:l.map(f=>(0,r.jsxs)("div",{className:p("flex min-w-0 flex-col gap-1",x?"sm:items-end":"sm:items-start"),children:[l.length>1?(0,r.jsx)("span",{className:"truncate text-xs text-ink-3",children:f.title}):null,(0,r.jsx)(L,{item:f,isPending:s,pendingRequest:i,onAction:n,square:t,iconOnly:o})]},f.key))}):null,d?(0,r.jsxs)("a",{href:d,target:"_blank",rel:"noreferrer",className:p("inline-flex min-w-0 items-center gap-1 self-start break-all text-xs text-ink-3 hover:text-ink hover:underline",x?"sm:self-end":"sm:self-start"),children:[d,(0,r.jsx)(C,{className:"h-3.5 w-3.5 shrink-0"})]}):null]})}c(ke,"WorkspaceRuntimeQuickControls");export{ge as a,be as i,ke as n,he as r,ve as t};
|
|
1
|
+
var E=Object.defineProperty;var c=(e,s)=>E(e,"name",{value:s,configurable:!0});import{i as _}from"./rolldown-runtime-ZpX3ckPj.js";import{l as p,la as M}from"./createLucideIcon-CgrPXnTY.js";import{on as T}from"./router-CJbFZfVR.js";import{t as W}from"./activity-BwGRpduS.js";import{t as C}from"./external-link-BIcMNNSN.js";import{r as D,t as A}from"./button-DI4w5WP7.js";import{t as P}from"./play-Czm7OCYh.js";import{t as B}from"./rotate-ccw-DpzLJhXT.js";import{t as H}from"./square-CDo6rOf8.js";import{t as R}from"./badge-jeXr866I.js";import{t as U}from"./useManagedSandboxOnly-KE5BJrr7.js";var J="loopback",z=/(?:^|\s)--bind(?:-host)?(?:=|\s+)(?!--)[^\s]+/g,F=/(?:^|[\s;&|])(?:(?:pnpm|npm|yarn|bun)(?:\s+run)?\s+dev(?::once|:watch|:server)?(?=\s|$)|[^\s]*dev-runner(?:\.[cm]?[jt]s)?(?=\s|$))/;function K(e){return F.test(e)}c(K,"isWardmoteDevRunnerCommand");function G(e){if(!K(e))return e;const s=e.replace(z,"").trim();return s.length===0?e:`${s} --bind ${J}`}c(G,"forceLoopbackBindInCommand");function N(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}c(N,"isRecord");function m(e){if(typeof e!="string")return null;const s=e.trim();return s.length>0?s:null}c(m,"readNonEmptyString");function O(e){if(N(e)&&e.type==="auto")return null;const s=N(e)?e.value:e;return typeof s=="number"&&Number.isInteger(s)&&s>0&&s<=65535?s:null}c(O,"readConfiguredPort");function S(e){const s=(e??"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"");return s.length>0?s:null}c(S,"slugify");function Q(e){const s=S(e.explicitId);if(s)return s;const i=S(e.name);return i?`${e.kind}:${i}`:`${e.kind}:${e.index+1}`}c(Q,"deriveWorkspaceCommandId");function j(e){return{id:Q({kind:e.kind,explicitId:m(e.entry.id),name:m(e.entry.name)??m(e.entry.label)??m(e.entry.title)??e.fallbackName,index:e.sourceIndex}),name:m(e.entry.name)??m(e.entry.label)??m(e.entry.title)??e.fallbackName,kind:e.kind,command:m(e.entry.command),cwd:m(e.entry.cwd),port:O(e.entry.port),lifecycle:e.kind==="service"?e.entry.lifecycle==="ephemeral"?"ephemeral":"shared":null,serviceIndex:e.serviceIndex,disabledReason:m(e.entry.disabledReason),rawConfig:{...e.entry},source:{type:"wardmote",key:e.sourceKey,index:e.sourceIndex}}}c(j,"buildWorkspaceCommandDefinition");function V(e,s,i,n){if(!e.has(s))return e.add(s),s;const t=`${s}-${i}-${n+1}`;return e.add(t),t}c(V,"uniqueWorkspaceCommandId");function y(e,s){const i=e?.[s];return Array.isArray(i)?i.filter(n=>N(n)):[]}c(y,"readCommandEntries");function X(e){if(!e)return[];const s=y(e,"commands"),i=new Set;let n=0;const t=c(l=>({...l,id:V(i,l.id,l.source.key,l.source.index)}),"finalize");if(s.length>0)return s.map((l,d)=>t(j({entry:l,kind:l.kind==="job"?"job":"service",sourceKey:"commands",sourceIndex:d,serviceIndex:l.kind==="job"?null:n++,fallbackName:l.kind==="job"?`Job ${d+1}`:`Service ${d+1}`})));const u=y(e,"services").map((l,d)=>t(j({entry:l,kind:"service",sourceKey:"services",sourceIndex:d,serviceIndex:n++,fallbackName:`Service ${d+1}`}))),o=y(e,"jobs").map((l,d)=>t(j({entry:l,kind:"job",sourceKey:"jobs",sourceIndex:d,serviceIndex:null,fallbackName:`Job ${d+1}`})));return[...u,...o]}c(X,"listWorkspaceCommandDefinitions");function Y(e,s){const i=!!(e.command&&s.command&&s.exposure?.provider==="tailscale_https"&&s.command===G(e.command));if(e.command&&s.command&&s.command!==e.command&&!i||e.port!==null&&s.port!=null&&s.port!==e.port)return-1;if(e.serviceIndex!==null&&s.configIndex!==null&&s.configIndex!==void 0)return s.configIndex!==e.serviceIndex?-1:100+(e.port!==null&&s.port===e.port?8:0);let n=0;return e.port!==null&&s.port===e.port&&(n+=8),s.serviceName===e.name&&(n+=4),(s.command??null)===(e.command??null)&&(n+=4),e.cwd&&s.cwd&&(s.cwd===e.cwd||s.cwd.endsWith(`/${e.cwd}`))&&(n+=2),n}c(Y,"scoreWorkspaceRuntimeServiceMatch");function Z(e,s){let i=null,n=-1;for(const t of s??[]){const u=Y(e,t);u>n&&(i=t,n=u)}return n>0?i:null}c(Z,"matchWorkspaceRuntimeServiceToCommand");var r=_(M(),1);function q(e,s,i){return{key:`command:${e.id}:${s?.id??"idle"}`,title:e.name,kind:"service",statusLabel:s?.status??"stopped",lifecycle:s?.lifecycle??e.lifecycle,healthStatus:s?.healthStatus??"unknown",exposure:s?.exposure??null,command:s?.command??e.command,cwd:s?.cwd??e.cwd,port:s?.port??null,url:s?.url??null,canStart:i&&!e.disabledReason,canRun:!1,workspaceCommandId:e.id,runtimeServiceId:s?.id??null,serviceIndex:e.serviceIndex,disabledReason:e.disabledReason}}c(q,"buildServiceItem");function ee(e,s){return{key:`command:${e.id}`,title:e.name,kind:"job",statusLabel:"run once",lifecycle:null,healthStatus:null,exposure:null,command:e.command,cwd:e.cwd,port:null,url:null,canStart:!1,canRun:s&&!e.disabledReason&&!!e.command,workspaceCommandId:e.id,runtimeServiceId:null,serviceIndex:null,disabledReason:e.disabledReason??(e.command?null:"This job is missing a command.")}}c(ee,"buildJobItem");function he(e){const s=X(e.runtimeConfig),i=[...e.runtimeServices??[]],n=new Set,t=[],u=[];for(const o of s){if(o.kind==="job"){u.push(ee(o,e.canRunJobs??e.canStartServices));continue}const l=Z(o,i);l&&n.add(l.id),t.push(q(o,l,e.canStartServices))}return{services:t,jobs:u,otherServices:i.filter(o=>!n.has(o.id)&&(o.status==="provisioning"||o.status==="starting"||o.status==="running")).map(o=>({key:`runtime:${o.id}`,title:o.serviceName,kind:"service",statusLabel:o.status,lifecycle:o.lifecycle,healthStatus:o.healthStatus,exposure:o.exposure??null,command:o.command??null,cwd:o.cwd??null,port:o.port??null,url:o.url??null,canStart:!1,canRun:!1,workspaceCommandId:null,runtimeServiceId:o.id,serviceIndex:o.configIndex??null,disabledReason:"This runtime service no longer matches a configured workspace command."}))}}c(he,"buildWorkspaceRuntimeControlSections");function se(e){return[...e.services,...e.otherServices].find(s=>(s.statusLabel==="running"||s.statusLabel==="starting")&&s.url)?.url??null}c(se,"getRunningRuntimeServiceUrl");function w(e){return e==="running"||e==="starting"||e==="provisioning"}c(w,"isActiveStatusLabel");function $(e){return e?.state==="failed"?{label:"HTTPS unavailable",remediation:"Check the Tailscale broker and node HTTPS configuration."}:e?.state==="cleanup_pending"?{label:"HTTPS cleanup pending",remediation:"Restart the host broker before reusing this port."}:null}c($,"exposureFailureCopy");function ne({exposure:e}){const s=$(e);return s?(0,r.jsxs)("div",{className:"space-y-1 break-words text-xs text-bad",role:"alert",children:[(0,r.jsxs)("div",{className:"line-clamp-3 font-medium",title:e?.lastError??void 0,children:[s.label,e?.lastError?` · ${e.lastError}`:""]}),(0,r.jsx)("div",{children:s.remediation})]}):null}c(ne,"ExposureFailureDetail");function be(e){const s=new Map((e.runtimeServices??[]).map(n=>[n.id,n])),i=e.pendingRequests??(e.isPending&&e.pendingRequest?[e.pendingRequest]:[]);return[...e.sections.services,...e.sections.otherServices].map(n=>{let t=n.statusLabel==="running"?"running":n.statusLabel==="provisioning"?"provisioning":n.statusLabel==="starting"?"starting":n.statusLabel==="failed"?"failed":"stopped";const u=i.find(a=>a.action!=="run"&&(a.workspaceCommandId??null)===(n.workspaceCommandId??null)&&(a.runtimeServiceId??null)===(n.runtimeServiceId??null)&&(a.serviceIndex??null)===(n.serviceIndex??null));u&&(t=u.action==="stop"?"stopping":u.action==="restart"?"restarting":"starting");const o=n.runtimeServiceId?s.get(n.runtimeServiceId)??null:null,l=t==="failed"?`Service failed${o?.stoppedAt?` · ${T(o.stoppedAt)}`:""}`:null,d=o?.exposure??n.exposure,x=$(d),f=d?.state==="pending"?"Provisioning HTTPS…":d?.state==="ready"?"HTTPS ready":x?`${x.label} · ${x.remediation}`:null;return{key:n.key,name:n.title,state:t,healthStatus:n.healthStatus,url:n.url,port:n.port,failureDetail:l,exposureState:d?.state??null,exposureDetail:f,canStart:n.canStart}})}c(be,"buildWorkspaceServiceControlEntries");function ge(e,s,i){const n=[...e.services,...e.otherServices];if(i!==null){const t=n.find(u=>u.key===i);return t?[b(t,s)]:[]}return s==="stop"?n.filter(t=>w(t.statusLabel)).map(t=>b(t,"stop")):s==="start"?n.filter(t=>!w(t.statusLabel)&&t.canStart).map(t=>b(t,"start")):n.flatMap(t=>w(t.statusLabel)?[b(t,"restart")]:t.canStart?[b(t,"start")]:[])}c(ge,"resolveWorkspaceServiceControlRequests");function re(e,s){return e?.action===s.action&&(e?.workspaceCommandId??null)===(s.workspaceCommandId??null)&&(e?.runtimeServiceId??null)===(s.runtimeServiceId??null)&&(e?.serviceIndex??null)===(s.serviceIndex??null)}c(re,"requestMatchesPending");function b(e,s){return{action:s,workspaceCommandId:e.workspaceCommandId??null,runtimeServiceId:e.runtimeServiceId??null,serviceIndex:e.serviceIndex??null}}c(b,"buildRequest");function L({item:e,isPending:s,pendingRequest:i,onAction:n,square:t,iconOnly:u}){const o=e.kind==="job"?["run"]:e.statusLabel==="running"||e.statusLabel==="starting"?["stop",...e.canStart?["restart"]:[]]:["start"];return(0,r.jsx)("div",{className:p("flex gap-2",u?"w-auto flex-row flex-wrap":"w-full flex-col sm:w-auto sm:flex-row sm:flex-wrap"),children:o.map(l=>{const d=b(e,l),x=l==="stop"?H:l==="restart"?B:P,f=l==="run"?"Run":l==="start"?"Start":l==="stop"?"Stop":"Restart",a=s&&re(i,d),v=s||l==="run"&&!e.canRun||(l==="start"||l==="restart")&&!e.canStart;return(0,r.jsxs)(A,{variant:u?"secondary":l==="stop"?"danger":l==="restart"?"secondary":"primary",size:u?"icon-xs":"sm",className:p(u?"shrink-0":"w-full justify-start sm:w-auto",t?"rounded-none":null),disabled:v,onClick:c(()=>n(d),"onClick"),"aria-label":f,title:f,children:[a?(0,r.jsx)(D,{className:"h-4 w-4 animate-spin"}):(0,r.jsx)(x,{className:"h-4 w-4"}),u?(0,r.jsx)("span",{className:"sr-only",children:f}):f]},`${e.key}:${l}`)})})}c(L,"CommandActionButtons");function I({title:e,description:s,items:i,emptyMessage:n,disabledHint:t,isPending:u,pendingRequest:o,onAction:l,square:d,iconOnly:x}){const{hideHostPaths:f}=U();return(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsx)("div",{className:"text-sm font-medium",children:e}),(0,r.jsx)("p",{className:"text-xs text-ink-3",children:s})]}),i.length===0?(0,r.jsxs)("div",{className:p("border border-dashed border-line/80 bg-bg px-3 py-4 text-sm text-ink-3",d?"rounded-none":"rounded-xl"),children:[n,t?(0,r.jsx)("p",{className:"mt-2 text-xs",children:t}):null]}):(0,r.jsx)("div",{className:"space-y-3",children:i.map(a=>(0,r.jsx)("div",{className:p("border border-line/80 bg-bg px-3 py-3",d?"rounded-none":"rounded-xl"),children:(0,r.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsx)("div",{className:"text-sm font-medium",children:a.title}),(0,r.jsxs)("div",{className:"text-xs text-ink-3",children:[a.kind," · ",a.statusLabel,a.lifecycle?` · ${a.lifecycle}`:""]})]}),(0,r.jsx)(L,{item:a,isPending:u,pendingRequest:o,onAction:l,square:d,iconOnly:x})]}),(0,r.jsxs)("div",{className:"space-y-1 text-xs text-ink-3",children:[a.url?(0,r.jsxs)("a",{href:a.url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 hover:underline",children:[a.url,(0,r.jsx)(C,{className:"h-3.5 w-3.5"})]}):null,a.port?(0,r.jsxs)("div",{children:["Port ",a.port]}):null,a.command?(0,r.jsx)("div",{className:"break-all font-mono",children:a.command}):null,a.cwd&&!f?(0,r.jsx)("div",{className:"break-all font-mono",children:a.cwd}):null,a.disabledReason?(0,r.jsx)("div",{children:a.disabledReason}):null]}),(0,r.jsx)(ne,{exposure:a.exposure}),a.healthStatus&&a.statusLabel!=="stopped"?(0,r.jsx)("div",{className:"flex items-center gap-2",children:(0,r.jsx)(R,{variant:"outline",className:p("px-2.5 py-1 text-(length:--text-micro)",a.healthStatus==="healthy"?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":a.healthStatus==="unhealthy"?"border-bad/30 bg-bad/10 text-bad":"border-line text-ink-3"),children:a.healthStatus})}):null]})},a.key))})]})}c(I,"CommandSection");function ve({sections:e,items:s,isPending:i=!1,pendingRequest:n=null,serviceEmptyMessage:t="No services are configured for this workspace.",jobEmptyMessage:u="No one-shot jobs are configured for this workspace.",emptyMessage:o,disabledHint:l=null,onAction:d,className:x,square:f}){const a=e??{services:(s??[]).map(h=>({...h,statusLabel:h.statusLabel??h.status??"stopped"})),jobs:[],otherServices:[]},v=o??t,g=[...a.services,...a.otherServices].filter(h=>h.statusLabel==="running"||h.statusLabel==="starting").length,k=g>0||l===null?null:l;return(0,r.jsxs)("div",{className:p("space-y-4",x),children:[(0,r.jsx)("div",{className:p("border border-line/70 bg-bg p-3",f?"rounded-none":"rounded-xl"),children:(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsx)("div",{className:"text-xs font-medium uppercase tracking-(--tracking-eyebrow) text-ink-3",children:"Workspace commands"}),(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,r.jsxs)(R,{variant:"outline",className:p("gap-1.5 px-2.5 py-1",g>0?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":"border-line bg-bg text-ink-3"),children:[(0,r.jsx)(W,{className:"h-3.5 w-3.5"}),g>0?`${g} services running`:"No services running"]}),(0,r.jsx)("span",{className:"text-xs text-ink-3",children:a.jobs.length>0?`${a.jobs.length} job${a.jobs.length===1?"":"s"} available to run on demand.`:"Each command can be controlled independently."})]}),k?(0,r.jsx)("p",{className:"text-xs text-ink-3",children:k}):null]})}),(0,r.jsx)(I,{title:"Services",description:"Long-running commands that Wardmote can supervise for this workspace.",items:a.services,emptyMessage:v,disabledHint:k,isPending:i,pendingRequest:n,onAction:d,square:f}),(0,r.jsx)(I,{title:"Jobs",description:"One-shot commands that run now and exit when they finish.",items:a.jobs,emptyMessage:u,isPending:i,pendingRequest:n,onAction:d,square:f}),a.otherServices.length>0?(0,r.jsx)(I,{title:"Untracked services",description:"Running services that no longer match the current workspace command config.",items:a.otherServices,emptyMessage:"",isPending:i,pendingRequest:n,onAction:d,square:f}):null]})}c(ve,"WorkspaceRuntimeControls");function ke({sections:e,isPending:s=!1,pendingRequest:i=null,onAction:n,square:t,align:u="end",iconOnly:o=!1}){const l=e.services.length>0?e.services:e.otherServices,d=se(e),x=u==="end";return l.length===0&&!d?null:(0,r.jsxs)("div",{className:p("flex min-w-0 flex-col items-stretch gap-2",x?"sm:items-end":"sm:items-start"),children:[l.length>0?(0,r.jsx)("div",{className:p("flex max-w-full flex-col gap-2 sm:flex-row sm:flex-wrap",x?"sm:justify-end":"sm:justify-start"),children:l.map(f=>(0,r.jsxs)("div",{className:p("flex min-w-0 flex-col gap-1",x?"sm:items-end":"sm:items-start"),children:[l.length>1?(0,r.jsx)("span",{className:"truncate text-xs text-ink-3",children:f.title}):null,(0,r.jsx)(L,{item:f,isPending:s,pendingRequest:i,onAction:n,square:t,iconOnly:o})]},f.key))}):null,d?(0,r.jsxs)("a",{href:d,target:"_blank",rel:"noreferrer",className:p("inline-flex min-w-0 items-center gap-1 self-start break-all text-xs text-ink-3 hover:text-ink hover:underline",x?"sm:self-end":"sm:self-start"),children:[d,(0,r.jsx)(C,{className:"h-3.5 w-3.5 shrink-0"})]}):null]})}c(ke,"WorkspaceRuntimeQuickControls");export{ge as a,be as i,ke as n,he as r,ve as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var g=Object.defineProperty;var i=(e,o)=>g(e,"name",{value:o,configurable:!0});import{i as x}from"./rolldown-runtime-ZpX3ckPj.js";import{C as k,la as y,ua as h}from"./createLucideIcon-CgrPXnTY.js";import{t as m,v as w}from"./queryKeys-BzT8CD34.js";import{t as N}from"./useInfiniteQuery-DTEIZ1gz.js";import{n as I}from"./CompanyContext-fQCNWI_f.js";import{r as S,t as C}from"./router-
|
|
1
|
+
var g=Object.defineProperty;var i=(e,o)=>g(e,"name",{value:o,configurable:!0});import{i as x}from"./rolldown-runtime-ZpX3ckPj.js";import{C as k,la as y,ua as h}from"./createLucideIcon-CgrPXnTY.js";import{t as m,v as w}from"./queryKeys-BzT8CD34.js";import{t as N}from"./useInfiniteQuery-DTEIZ1gz.js";import{n as I}from"./CompanyContext-fQCNWI_f.js";import{r as S,t as C}from"./router-CJbFZfVR.js";import{t as b}from"./button-DI4w5WP7.js";import{t as W}from"./instanceSettings-D1nNVWU0.js";import{n as U}from"./BreadcrumbContext-DNbB7zWn.js";import{_ as f,fr as _}from"./index-QhteFtm-.js";import{t as A}from"./SummarySlotCard-D1EyiciB.js";import{t as P}from"./ProjectWorkspacesContent-DrWfnTJY.js";var d=x(h(),1),s=x(y(),1);function R(e){return{key:e.key,kind:e.kind,workspaceId:e.workspaceId,workspaceName:e.workspaceName,cwd:e.cwd,branchName:e.branchName,lastUpdatedAt:e.lastUpdatedAt,projectWorkspaceId:e.projectWorkspaceId,executionWorkspaceId:e.executionWorkspaceId,executionWorkspaceStatus:e.executionWorkspaceStatus,serviceCount:e.serviceCount,runningServiceCount:e.runningServiceCount,primaryServiceUrl:e.primaryServiceUrl,primaryServiceUrlRunning:e.primaryServiceUrlRunning,hasRuntimeConfig:e.hasRuntimeConfig,linkedIssueCount:e.linkedIssueCount,issues:e.linkedIssues}}i(R,"overviewItemToSummary");function q(e){const o=new Map;for(const r of e){const n=o.get(r.projectId),t=R(r);if(n){n.summaries.push(t),t.lastUpdatedAt.getTime()>n.lastUpdatedAt.getTime()&&(n.lastUpdatedAt=t.lastUpdatedAt),n.runningServiceCount+=t.runningServiceCount;continue}o.set(r.projectId,{projectId:r.projectId,projectName:r.projectName,projectRef:k({id:r.projectId,name:r.projectName,urlKey:r.projectUrlKey}),summaries:[t],lastUpdatedAt:t.lastUpdatedAt,runningServiceCount:t.runningServiceCount})}return[...o.values()].sort((r,n)=>{const t=n.runningServiceCount-r.runningServiceCount;if(t!==0)return t;const c=n.lastUpdatedAt.getTime()-r.lastUpdatedAt.getTime();return c!==0?c:r.projectName.localeCompare(n.projectName)})}i(q,"buildProjectWorkspaceGroups");function H(){const{selectedCompanyId:e}=I(),{setBreadcrumbs:o}=U(),r=w({queryKey:m.instance.experimentalSettings,queryFn:i(()=>W.getExperimental(),"queryFn")}),n=r.data?.enableIsolatedWorkspaces===!0,t=N({queryKey:e?m.executionWorkspaces.overview(e):["execution-workspaces","__workspaces-overview__","disabled"],queryFn:i(({pageParam:a})=>_.listOverview(e,{offset:a}),"queryFn"),initialPageParam:0,getNextPageParam:i(a=>a.nextOffset??void 0,"getNextPageParam"),enabled:!!(e&&n)});(0,d.useEffect)(()=>{o([{label:"Workspaces"}])},[o]);const c=t.data?.pages??[],p=(0,d.useMemo)(()=>c.flatMap(a=>a.items),[c]),u=(0,d.useMemo)(()=>q(p),[p]),v=(c[0]??null)?.total??p.length,j=t.isLoading,l=t.error;return r.isLoading?(0,s.jsx)(f,{variant:"detail"}):n?j?(0,s.jsx)(f,{variant:"list"}):l?(0,s.jsx)("p",{className:"text-sm text-bad",children:l.message}):(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsx)("div",{children:(0,s.jsx)("h2",{className:"text-xl font-bold",children:"Workspaces"})}),(0,s.jsx)(A,{companyId:e,scopeKind:"workspaces_overview",title:"Workspace summary",description:"Summarizer tracks workspace activity, live services, and follow-up needs across projects."}),u.length===0?(0,s.jsx)("p",{className:"text-sm text-ink-3",children:"No workspace activity yet."}):(0,s.jsxs)("div",{className:"space-y-8",children:[u.map(a=>(0,s.jsxs)("section",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-end justify-between gap-2",children:[(0,s.jsx)("div",{className:"min-w-0",children:(0,s.jsx)(C,{to:`/projects/${a.projectRef}/workspaces`,className:"text-base font-semibold hover:underline",children:a.projectName})}),(0,s.jsxs)("span",{className:"text-xs text-ink-3",children:[a.summaries.length," workspace",a.summaries.length===1?"":"s"]})]}),(0,s.jsx)(P,{companyId:e,projectId:a.projectId,projectRef:a.projectRef,summaries:a.summaries})]},a.projectId)),t.hasNextPage?(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3 border-t border-line pt-4",children:[(0,s.jsxs)("p",{className:"text-sm text-ink-3",children:["Showing ",p.length," of ",v," workspaces."]}),(0,s.jsx)(b,{type:"button",variant:"secondary",size:"sm",onClick:i(()=>{t.fetchNextPage()},"onClick"),disabled:t.isFetchingNextPage,children:t.isFetchingNextPage?"Loading...":"Load more"})]}):null]})]}):(0,s.jsx)(S,{to:"/issues",replace:!0})}i(H,"Workspaces");export{H as Workspaces};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var u=Object.defineProperty;var r=(e,t)=>u(e,"name",{value:t,configurable:!0});import{i as c}from"./rolldown-runtime-ZpX3ckPj.js";import{la as l}from"./createLucideIcon-CgrPXnTY.js";import{t as d}from"./Identity-8eG_HXAH.js";import{
|
|
1
|
+
var u=Object.defineProperty;var r=(e,t)=>u(e,"name",{value:t,configurable:!0});import{i as c}from"./rolldown-runtime-ZpX3ckPj.js";import{la as l}from"./createLucideIcon-CgrPXnTY.js";import{t as d}from"./Identity-8eG_HXAH.js";import{ao as f}from"./index-QhteFtm-.js";var i=c(l(),1);function B(e,t){return e.createdByUserId?t.get(e.createdByUserId)??{label:e.createdByUserId==="local-board"?"Board":"Board member",image:null}:null}r(B,"connectionOwnerProfile");function o(e){const t=e.trim();if(!t)return"Board";const n=t.split(/\s+/)[0]??t;return n.includes("@")?n.split("@")[0]||"Board":n}r(o,"ownerGivenName");function m(e){return e.toLowerCase().endsWith("s")?`${e}’`:`${e}’s`}r(m,"possessive");function w(e,t,n){const s=e.name.trim(),a=/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s)||/^(?:[a-z0-9-]+\.)+[a-z]{2,}$/i.test(s)?s:f(e);return!n||a.trim().toLocaleLowerCase()!==t.trim().toLocaleLowerCase()?a:`${m(o(n.label))} ${t}`}r(w,"connectionDisplayNameForOwner");function C(e){const t=e.clientName.trim();return`${e.user?`${m(o(e.user.name))} `:""}${t} connection`}r(C,"assistantConnectionDisplayName");function _({owner:e}){return e?(0,i.jsx)(d,{name:e.label,avatarUrl:e.image,size:"sm",className:"text-ink-3"}):(0,i.jsx)("span",{className:"text-xs text-ink-3",children:"Unknown"})}r(_,"ConnectionOwnerIdentity");export{B as i,C as n,w as r,_ as t};
|