@tickernelz/wardmote-ui 2026.1114.1 → 2026.1114.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{ActiveAgentsPanel-CKzCe8AC.js → ActiveAgentsPanel-Budj8e9v.js} +1 -1
- package/dist/assets/{AdapterManager-DFPaPUUr.js → AdapterManager-DhiW44Eo.js} +1 -1
- package/dist/assets/{AdvancedToolsRoute-CN5fWS4T.js → AdvancedToolsRoute-CICI1XRd.js} +1 -1
- package/dist/assets/{AgentActionButtons-a9LacJPP.js → AgentActionButtons-DIhpv51Y.js} +1 -1
- package/dist/assets/{AgentChat-D5FDUYuV.js → AgentChat-CeuGtMXr.js} +1 -1
- package/dist/assets/{AgentChats-TN5SE_gN.js → AgentChats-CmDtTrMa.js} +1 -1
- package/dist/assets/{AgentDefaults-CiVVS_pQ.js → AgentDefaults-DpYaMGkf.js} +1 -1
- package/dist/assets/{AgentDetail-bCAmWRXs.js → AgentDetail-DFTeFc4-.js} +1 -1
- package/dist/assets/{AgentTodoCard-BpmvHEsm.js → AgentTodoCard-DRXZ7hmU.js} +1 -1
- package/dist/assets/{Agents-CToMMxGu.js → Agents-CClUUMUq.js} +3 -3
- package/dist/assets/{AppDetail-P807ou0a.js → AppDetail-DfHLFOtj.js} +1 -1
- package/dist/assets/{AppNotConnected-DuA4PukX.js → AppNotConnected-CcmXbFtD.js} +1 -1
- package/dist/assets/{ApprovalCard-BDdZDBMj.js → ApprovalCard-uT_9D_uH.js} +1 -1
- package/dist/assets/{ApprovalDetail-CVgy1uNi.js → ApprovalDetail-CE41WFbd.js} +1 -1
- package/dist/assets/{ApprovalPayload-H5zW6yQ4.js → ApprovalPayload-_zU9bukt.js} +1 -1
- package/dist/assets/{Approvals-DL6kx45P.js → Approvals-BXrjqpKc.js} +1 -1
- package/dist/assets/{AppsReview-Bf7oB0ES.js → AppsReview-C0Y3SxmZ.js} +1 -1
- package/dist/assets/{ArtifactCard-Cp4KPgZl.js → ArtifactCard-DKUUBZ0K.js} +1 -1
- package/dist/assets/{Artifacts-Dz3eHCaQ.js → Artifacts-Bsv5m0aU.js} +1 -1
- package/dist/assets/{AssistantConnection-5Y4fBVXq.js → AssistantConnection-Dm2PaSeU.js} +1 -1
- package/dist/assets/{AttentionInteractionResolver-DlP6a6AG.js → AttentionInteractionResolver-CBjNuhYo.js} +1 -1
- package/dist/assets/{AuditHub-Dz2UXl0c.js → AuditHub-DbUni0O_.js} +1 -1
- package/dist/assets/{BoardChat-DsMVXf5M.js → BoardChat-CgzCuFIL.js} +1 -1
- package/dist/assets/{BootstrapSetupUxLab-CWWisaHp.js → BootstrapSetupUxLab-D-niQCV5.js} +1 -1
- package/dist/assets/{Browse-Be6aSv-F.js → Browse-0bmB5mqw.js} +1 -1
- package/dist/assets/{BudgetPolicyCard-Dka022-Z.js → BudgetPolicyCard-CqFUHqOj.js} +1 -1
- package/dist/assets/{CaseDetail-DdJrlm0m.js → CaseDetail-DakrB2jI.js} +1 -1
- package/dist/assets/{Cases-Da1szfrr.js → Cases-DXbr4HJt.js} +1 -1
- package/dist/assets/{ChatEndpointDetail-DSOH-zfs.js → ChatEndpointDetail-BdDKo-Gq.js} +1 -1
- package/dist/assets/{ChatEndpointSetup-J23lq-xi.js → ChatEndpointSetup-BX3iDH7N.js} +1 -1
- package/dist/assets/{ChoiceControls-B9yrYshK.js → ChoiceControls-Bu-fd6qI.js} +1 -1
- package/dist/assets/{Companies-BkHWSxdB.js → Companies-FcUNLIkt.js} +1 -1
- package/dist/assets/{CompanyAccess-BaiGlxY1.js → CompanyAccess-BUcTNg7_.js} +1 -1
- package/dist/assets/{CompanyActivity-CMBXXwCw.js → CompanyActivity-ScpRBz1G.js} +1 -1
- package/dist/assets/{CompanyConnections-CVzsivTW.js → CompanyConnections-DMEwbZv7.js} +1 -1
- package/dist/assets/{CompanyEnvironments-K7piWRrx.js → CompanyEnvironments-EqXhVruZ.js} +1 -1
- package/dist/assets/{CompanyExport-Bo8tUPaY.js → CompanyExport-DQ9ffuua.js} +1 -1
- package/dist/assets/{CompanyImport-CBVjSXPA.js → CompanyImport-BhuZu4oc.js} +1 -1
- package/dist/assets/{CompanySettings-CuU9qSp5.js → CompanySettings-BSkg4ahA.js} +1 -1
- package/dist/assets/{CompanySettingsPluginPage-59_bMQQ3.js → CompanySettingsPluginPage-BzZkZqh-.js} +1 -1
- package/dist/assets/{CompanySkills-GBJMThWx.js → CompanySkills-BbA4RKIw.js} +1 -1
- package/dist/assets/{ConfigureBuiltInAgentModal-D8Xnl51H.js → ConfigureBuiltInAgentModal-BUJPbmWc.js} +1 -1
- package/dist/assets/{CopyableGatewayUrl-GuvA-DoQ.js → CopyableGatewayUrl-BZyE_jT9.js} +1 -1
- package/dist/assets/{Dashboard-Cgj9BeTt.js → Dashboard--lTwxjV-.js} +1 -1
- package/dist/assets/{DashboardLive-Ku1cHAj9.js → DashboardLive-BYyTgF5d.js} +1 -1
- package/dist/assets/{DecisionDateChips-Z97mgInq.js → DecisionDateChips-vXwAFdua.js} +1 -1
- package/dist/assets/{DecisionQueuePage-D8cyKm4V.js → DecisionQueuePage-BaaKuZBi.js} +1 -1
- package/dist/assets/{DesignGuide-DvO3NaE-.js → DesignGuide-DS6MuXWY.js} +1 -1
- package/dist/assets/{EmailEndpointSetup-Cm_KKjjw.js → EmailEndpointSetup-CJFYu2G0.js} +1 -1
- package/dist/assets/{ExecutionWorkspaceDetail-CVB4ZY8I.js → ExecutionWorkspaceDetail-CuD5xWOB.js} +1 -1
- package/dist/assets/{GatewayDetail-DB1J44bF.js → GatewayDetail-xNVOxSIs.js} +1 -1
- package/dist/assets/{GatewaysList-CKSwMmOi.js → GatewaysList-DsSKLm1h.js} +1 -1
- package/dist/assets/{GoalDetail-Bscma2qU.js → GoalDetail-oN5pyUUY.js} +1 -1
- package/dist/assets/{GoalTree-jEFB788p.js → GoalTree-DaFizciF.js} +1 -1
- package/dist/assets/{Goals-jLNZ4UKT.js → Goals-xgGKfQZi.js} +1 -1
- package/dist/assets/{ImageGalleryModal-CghUxjQC.js → ImageGalleryModal-CjHED0Lb.js} +1 -1
- package/dist/assets/{Inbox-DHwNNh-Z.js → Inbox-wHhHozfr.js} +1 -1
- package/dist/assets/{InstanceAdvanced-C5IIPBwh.js → InstanceAdvanced-Bdf2a4c_.js} +1 -1
- package/dist/assets/{InviteLanding-BHmCRaWY.js → InviteLanding-McBYpNeW.js} +1 -1
- package/dist/assets/{IssueChatLongThreadPerf-JH8rtLk0.js → IssueChatLongThreadPerf-DD3RLbBo.js} +1 -1
- package/dist/assets/{IssueChatThread-ByTyrsxz.js → IssueChatThread-BN-_8hT8.js} +1 -1
- package/dist/assets/{IssueDetail-BIif8Swu.js → IssueDetail-CsaD311l.js} +1 -1
- package/dist/assets/{IssueOutputSection-CFE6aU9L.js → IssueOutputSection-CDIMRaF0.js} +1 -1
- package/dist/assets/{IssueRecoveryActionCard-DBgE7aMm.js → IssueRecoveryActionCard-C9qJAHes.js} +1 -1
- package/dist/assets/{IssueThreadInteractionCard-C3LFe8cu.js → IssueThreadInteractionCard-BbigJB2U.js} +1 -1
- package/dist/assets/{Issues-B5QG33RC.js → Issues-BWoc80Y9.js} +1 -1
- package/dist/assets/{LiveNowTodoLine-D52WDE8-.js → LiveNowTodoLine-B9oTH2L0.js} +1 -1
- package/dist/assets/{ManagedAiConnectionDetails-C9nV0oIT.js → ManagedAiConnectionDetails-B0aWUPkf.js} +1 -1
- package/dist/assets/{McpConnect-Bk8Qskqw.js → McpConnect-Dzf7W2K6.js} +1 -1
- package/dist/assets/{MembershipAction-DjdBY6Bk.js → MembershipAction-oiLtxQm3.js} +1 -1
- package/dist/assets/{ModelsAndProviders-BtbhNxf_.js → ModelsAndProviders-BEb4Z38S.js} +1 -1
- package/dist/assets/{NewAgent-C4JqnMkp.js → NewAgent-C3MxIRJj.js} +1 -1
- package/dist/assets/{OmpAllSettings-aHENTYf5.js → OmpAllSettings-DBtL1qDL.js} +1 -1
- package/dist/assets/{PipelineSettings-CCoxV9Es.js → PipelineSettings-BcAtsehE.js} +1 -1
- package/dist/assets/{Pipelines-DaQPh688.js → Pipelines-CkiYUQS-.js} +1 -1
- package/dist/assets/{PixelsOffice-D1X7mdpk.js → PixelsOffice-BSlctoug.js} +1 -1
- package/dist/assets/{PluginPage-B4kdPADI.js → PluginPage-C6Qnf9ka.js} +1 -1
- package/dist/assets/{PluginSettings-yP8NX-sM.js → PluginSettings-Do37r6Zu.js} +1 -1
- package/dist/assets/{ProfileDetailRoute-DMdAvFmb.js → ProfileDetailRoute-DRFQNId6.js} +1 -1
- package/dist/assets/{ProfileSettings-DVm3Tqzs.js → ProfileSettings-BMwLBQDB.js} +1 -1
- package/dist/assets/{ProfileWizardRoute-CijS7-aN.js → ProfileWizardRoute-XnnvzH9S.js} +1 -1
- package/dist/assets/{ProjectDetail-DeLSGbmz.js → ProjectDetail-BW6Lr4Iq.js} +1 -1
- package/dist/assets/{ProjectWorkspaceDetail-DPajDjA-.js → ProjectWorkspaceDetail-DR4JCa1b.js} +1 -1
- package/dist/assets/{ProjectWorkspacesContent-BCATCcZI.js → ProjectWorkspacesContent-CadPZn0k.js} +1 -1
- package/dist/assets/{Projects-DPmo6PFV.js → Projects-DLBFbxcj.js} +1 -1
- package/dist/assets/{PublicIssueSharePage-B_W1Qpy_.js → PublicIssueSharePage-C9yRZOdP.js} +1 -1
- package/dist/assets/{ReviewQueueCard-DhfCjwYP.js → ReviewQueueCard-CIkiY-Lm.js} +1 -1
- package/dist/assets/{RichWorkProductCard-rJC8tWnB.js → RichWorkProductCard-JGHGU_RI.js} +1 -1
- package/dist/assets/{RoutineDetail-Cb0oYk5B.js → RoutineDetail-izWzADvA.js} +1 -1
- package/dist/assets/{RoutineRunVariablesDialog-CWNUGmiH.js → RoutineRunVariablesDialog-DiT_o5Dm.js} +1 -1
- package/dist/assets/{Routines-Ct6W3Ht-.js → Routines-CHtabiYj.js} +1 -1
- package/dist/assets/{ScrollToBottom-BvL4b3BQ.js → ScrollToBottom-pyHLjOjY.js} +1 -1
- package/dist/assets/{Search-CXiBakEC.js → Search-yNNB6kys.js} +1 -1
- package/dist/assets/{Secrets-XUpMCMhK.js → Secrets-BOyOk5BF.js} +1 -1
- package/dist/assets/{SkillSourceTree-Brg47aIX.js → SkillSourceTree-M58QwBFF.js} +1 -1
- package/dist/assets/{SkillSources-C3kuN9Hz.js → SkillSources-Cw4PU-Bz.js} +1 -1
- package/dist/assets/{SkillStudio-DVVVKjdn.js → SkillStudio-Cj_M3ZJa.js} +1 -1
- package/dist/assets/{SourceTrustBadge-D-MXuX_l.js → SourceTrustBadge-BZBQe5No.js} +1 -1
- package/dist/assets/{StatusCards-BmNOGr1d.js → StatusCards-DaJdQUN5.js} +1 -1
- package/dist/assets/{SummarySlotCard-DiTaQ4km.js → SummarySlotCard-DlSmN6PL.js} +1 -1
- package/dist/assets/{TaskChatLab-fOJfHKjI.js → TaskChatLab-CU5eA7nX.js} +1 -1
- package/dist/assets/{TaskChatMarker-Cgyrmeab.js → TaskChatMarker-wBVUFL3u.js} +1 -1
- package/dist/assets/{TaskChatProtocolCard-DrIe_IYV.js → TaskChatProtocolCard-D-Dwy2EL.js} +1 -1
- package/dist/assets/{TaskChatThreadView-DKqNA1fZ.js → TaskChatThreadView-Crlf9I05.js} +1 -1
- package/dist/assets/{TaskDetailRelationsPanel-C9mJfMvL.js → TaskDetailRelationsPanel-CkktN1EC.js} +1 -1
- package/dist/assets/{TaskTreeControls-B1CSnDVK.js → TaskTreeControls-B_ulMOi1.js} +1 -1
- package/dist/assets/{Terminal-CGmILZtz.js → Terminal-Bo-WuezO.js} +1 -1
- package/dist/assets/{TerminalView-BqCU9Vc3.js → TerminalView-AkFY5bLC.js} +1 -1
- package/dist/assets/{TrustPresetSection-D4qB_VZo.js → TrustPresetSection-DTc1Rj4q.js} +1 -1
- package/dist/assets/{UserProfile-Cavc3nhB.js → UserProfile-C6q55R0Q.js} +1 -1
- package/dist/assets/{WhatNeedsMe-B7BSt_wb.js → WhatNeedsMe-1igJA4gL.js} +1 -1
- package/dist/assets/{Workspaces-CDTiwIHd.js → Workspaces-rtQKliW0.js} +1 -1
- package/dist/assets/{connection-owner-Cx9obLlP.js → connection-owner-CZwxTEuM.js} +1 -1
- package/dist/assets/{index-B7mmhFG7.js → index-DDoARkPG.js} +3 -3
- package/dist/assets/{issue-properties-C_y5-tny.js → issue-properties-lmRBaUTG.js} +1 -1
- package/dist/assets/{issue-workspace-selection-ChtddJZC.js → issue-workspace-selection-4JI2Uh9p.js} +1 -1
- package/dist/assets/{pipeline-stage-presentation-jxAxpF6f.js → pipeline-stage-presentation-BSuBql6K.js} +1 -1
- package/dist/assets/{shared-hwt7Xn4W.js → shared-DDwmHbeD.js} +1 -1
- package/dist/assets/{tool-taxonomy-6170LibQ.js → tool-taxonomy-DR7Q8sVs.js} +1 -1
- package/dist/assets/{transcript-adapter-C9uEslxp.js → transcript-adapter-wiFIjKfq.js} +1 -1
- package/dist/assets/{useSummaryDraftStream-BulT3Wwh.js → useSummaryDraftStream-CWOQt25o.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/sw.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var z=Object.defineProperty;var r=(s,n)=>z(s,"name",{value:n,configurable:!0});import{i as f}from"./rolldown-runtime-ZpX3ckPj.js";import{l as T,na as q,ta as M}from"./createLucideIcon-DJi9suAC.js";import{n as U}from"./star-BZgQbzhV.js";import{t as $}from"./button-CMwV3L1P.js";import{t as D}from"./shield-alert-Be9GuMrS.js";import{a as j,t as F}from"./agent-config-primitives-BsZUnbf2.js";import{Cn as V,En as G,On as H,Sn as Q,Tn as W,_n as Y,bn as J,vn as y,wn as K,xn as X,yn as w}from"./index-
|
|
1
|
+
var z=Object.defineProperty;var r=(s,n)=>z(s,"name",{value:n,configurable:!0});import{i as f}from"./rolldown-runtime-ZpX3ckPj.js";import{l as T,na as q,ta as M}from"./createLucideIcon-DJi9suAC.js";import{n as U}from"./star-BZgQbzhV.js";import{t as $}from"./button-CMwV3L1P.js";import{t as D}from"./shield-alert-Be9GuMrS.js";import{a as j,t as F}from"./agent-config-primitives-BsZUnbf2.js";import{Cn as V,En as G,On as H,Sn as Q,Tn as W,_n as Y,bn as J,vn as y,wn as K,xn as X,yn as w}from"./index-DDoARkPG.js";var m=f(q(),1),e=f(M(),1),b="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:g,allowSingleIssue:P=!0}){const[S,C]=(0,m.useState)(!1),c=V(s),a=X(s),l=Q(a),[u,v]=(0,m.useState)(l?.type??"project"),k=c==="low_trust_review",x=W(a),E=K(a),B=s?.authorizationPolicy??null,L=(0,m.useMemo)(()=>w(s,c),[s,c]);(0,m.useEffect)(()=>{l&&v(l.type)},[l?.type]);function R(t){n(w(s,t==="low_trust_review"?"low_trust_review":"standard"))}r(R,"handlePresetChange");function A(t){!i||!t||n(G(s,i,{type:u,id:t}))}r(A,"handleBoundaryTargetChange");function I(){n(J(s))}r(I,"handleClearBoundary");const h=u==="project"?N:_,O=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:b,value:c,onChange:r(t=>R(t.target.value),"onChange"),disabled:d,children:[(0,e.jsx)("option",{value:"standard",children:y.standard}),(0,e.jsx)("option",{value:"low_trust_review",children:y.low_trust_review})]})}),(0,e.jsx)("p",{className:"text-xs text-ink-3",children:Y[c]}),k?(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)(D,{className:"mt-0.5 h-4 w-4 shrink-0"}):(0,e.jsx)(U,{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:b,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:b,value:O,onChange:r(t=>A(t.target.value),"onChange"),disabled:d||!i||g||h.length===0,children:[(0,e.jsx)("option",{value:"",children:g?"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)($,{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 ",H(a).toLowerCase()," and cannot be edited by the single-boundary editor."]})]}),(0,e.jsx)(F,{title:"View policy",open:S,onToggle:r(()=>C(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,m as z,na as L,ta as F,v as d,x}from"./createLucideIcon-DJi9suAC.js";import{v as H}from"./star-BZgQbzhV.js";import{r as D,t as T,v as C}from"./queryKeys-DYV5MhM_.js";import{o as K}from"./companies-query-D9PxIiMT.js";import{n as W}from"./CompanyContext-CSrVsSze.js";import{t as A}from"./router-2UfGeejU.js";import{a as G,n as Q,t as V}from"./avatar-UO226cef.js";import{t as Y}from"./circle-alert-C-L4OsHh.js";import{t as J}from"./button-CMwV3L1P.js";import{t as X}from"./user-round-CGxsJ0K8.js";import{t as Z}from"./useHiddenSettings-CcaZfHLD.js";import{n as ee}from"./BreadcrumbContext-BVZDZoC0.js";import{T as $,_ as se,fn as te,ma as ae}from"./index-B7mmhFG7.js";var b=S(L(),1),ne={get:r((s,n)=>D.get(`/companies/${s}/users/${encodeURIComponent(n)}/profile`),"get")},e=S(F(),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)(se,{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 ${z(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)(ae,{}),"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)(te,{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,m as z,na as L,ta as F,v as d,x}from"./createLucideIcon-DJi9suAC.js";import{v as H}from"./star-BZgQbzhV.js";import{r as D,t as T,v as C}from"./queryKeys-DYV5MhM_.js";import{o as K}from"./companies-query-D9PxIiMT.js";import{n as W}from"./CompanyContext-CSrVsSze.js";import{t as A}from"./router-2UfGeejU.js";import{a as G,n as Q,t as V}from"./avatar-UO226cef.js";import{t as Y}from"./circle-alert-C-L4OsHh.js";import{t as J}from"./button-CMwV3L1P.js";import{t as X}from"./user-round-CGxsJ0K8.js";import{t as Z}from"./useHiddenSettings-CcaZfHLD.js";import{n as ee}from"./BreadcrumbContext-BVZDZoC0.js";import{T as $,_ as se,fn as te,ma as ae}from"./index-DDoARkPG.js";var b=S(L(),1),ne={get:r((s,n)=>D.get(`/companies/${s}/users/${encodeURIComponent(n)}/profile`),"get")},e=S(F(),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)(se,{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 ${z(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)(ae,{}),"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)(te,{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 ns=Object.defineProperty;var i=(o,d)=>ns(o,"name",{value:d,configurable:!0});import{i as Ke}from"./rolldown-runtime-ZpX3ckPj.js";import{na as os,ta as as}from"./createLucideIcon-DJi9suAC.js";import{a as is,y as ls}from"./star-BZgQbzhV.js";import{t as F,v as H}from"./queryKeys-DYV5MhM_.js";import{o as rs}from"./companies-query-D9PxIiMT.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 bs,m as ws,n as Ss,o as X,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-Z97mgInq.js";import{n as Ts}from"./CompanyContext-CSrVsSze.js";import{o as Ks}from"./router-2UfGeejU.js";import{t as Cs}from"./inbox-C08arfF_.js";import{a as Os}from"./ToastContext-DMdt9oTd.js";import{t as _s}from"./agents-DmlgUVso.js";import{t as Ms}from"./heartbeats-DOyojsaN.js";import{n as Ls,t as Fs}from"./useSharedPolling-D4Xn8mY2.js";import{n as Hs}from"./BreadcrumbContext-BVZDZoC0.js";import{Qi as zs,Vt as Bs,_ as Ps,pi as qs,w as Gs,zt as Qs}from"./index-B7mmhFG7.js";var t=Ke(os(),1),n=Ke(as(),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 ft(){const{selectedCompanyId:o}=Ts(),{setBreadcrumbs:d}=Hs(),[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),[z,Me]=(0,t.useState)(!1),[B,Le]=(0,t.useState)(!1),[Fe,He]=(0,t.useState)(!1),[ze,Be]=(0,t.useState)(!1),[Pe,qe]=(0,t.useState)(!1),[P,Ge]=(0,t.useState)("all"),[q,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(P,Date.now(),q),[P,q]);(0,t.useEffect)(()=>{d([{label:"Decisions"}])},[d]),(0,t.useEffect)(()=>{se(ps(o)),te(hs(o))},[o]);const{data:b,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:bs,refetchOnWindowFocus:!1}),{data:M}=H({queryKey:F.agents.list(o),queryFn:i(()=>_s.list(o),"queryFn"),enabled:!!o}),me=F.liveRuns(o),Q=Ls({companyId:o,resourceKey:"live-runs",queryKey:me,enabled:!!o,refetchInterval:!1,leaderOnly:!0}),{data:U,dataUpdatedAt:$e}=H({queryKey:me,queryFn:i(()=>Ms.liveRunsForCompany(o),"queryFn"),enabled:Q.enabled,refetchInterval:Q.refetchInterval});Fs(Q,U,$e);const{data:pe}=H({queryKey:F.auth.session,queryFn:i(()=>rs.getSession(),"queryFn")}),L=pe?.user?.id??pe?.session?.userId??null,w=(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)},[b?.generatedAt]);const f=(0,t.useMemo)(()=>b?.items??[],[b]),Ve=i(e=>e.dismissal!=null&&e.dismissal.isActive,"isServerHidden"),R=(0,t.useMemo)(()=>f.filter(e=>(!Ve(e)||v.has(e.id))&&!ae.has(e.id)),[f,ae,v]),Y=(0,t.useMemo)(()=>b?.generatedAt?new Date(b.generatedAt).getTime():Date.now(),[b?.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=ws(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:z,dismissedItems:N,dismissedOpen:B,limit:Math.max($,e+1)})},[I,N,B,x,u,$,c,E,z]),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 Xe=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]),be=(0,t.useCallback)(e=>{A(s=>new Set(s).add(e.id)),p(s=>s===e.id?null:s)},[]),we=(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=Bs({defaultPrevented:s.defaultPrevented,key:s.key,metaKey:s.metaKey,ctrlKey:s.ctrlKey,altKey:s.altKey,target:s.target,hasOpenDialog:Qs(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:Xe,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:P,custom:q,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)(Vs,{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),V=Ie[0];je=(0,n.jsx)($s,{agentName:w.get(V?.subject.metadata?.originAgentId)?.name??null,title:V?.subject.metadata?.bundleTitle??null,originIssue:V?.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:w,agents:M,showTriage:!0,currentUserId:L,selected:Ce&&c===h.id,liveRuns:Te(h)?U:void 0,onRetried:be})})]},h.id)})})()})]},e.key)})}),E.length>0&&(0,n.jsx)(X,{label:"Snoozed",count:E.length,open:z,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:we,agentMap:w,currentUserId:L},e.id))}),N.length>0&&(0,n.jsx)(X,{label:"Dismissed",count:N.length,open:B,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:we,agentMap:w,currentUserId:L},e.id))}),W.length>0&&(0,n.jsxs)(X,{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:w,agents:M,currentUserId:L,expanded:l===e.id,onToggleExpand:Se,onDismiss:S,onSnooze:ve,liveRuns:Te(e)?U:void 0,onRetried:be},e.id))]})]}):(0,n.jsx)(Zs,{}),(0,n.jsx)(Is,{companyId:o,selectedSourceKinds:C.sourceKinds,bounds:_,agentMap:w,decidedOpen:ze,expiredOpen:Pe,onToggleDecided:i(()=>Be(e=>!e),"onToggleDecided"),onToggleExpired:i(()=>qe(e=>!e),"onToggleExpired")})]})}i(ft,"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 Vs({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(Vs,"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{ft as WhatNeedsMe};
|
|
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{na as os,ta as as}from"./createLucideIcon-DJi9suAC.js";import{a as is,y as ls}from"./star-BZgQbzhV.js";import{t as F,v as H}from"./queryKeys-DYV5MhM_.js";import{o as rs}from"./companies-query-D9PxIiMT.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 bs,m as ws,n as Ss,o as X,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-vXwAFdua.js";import{n as Ts}from"./CompanyContext-CSrVsSze.js";import{o as Ks}from"./router-2UfGeejU.js";import{t as Cs}from"./inbox-C08arfF_.js";import{a as Os}from"./ToastContext-DMdt9oTd.js";import{t as _s}from"./agents-DmlgUVso.js";import{t as Ms}from"./heartbeats-DOyojsaN.js";import{n as Ls,t as Fs}from"./useSharedPolling-D4Xn8mY2.js";import{n as Hs}from"./BreadcrumbContext-BVZDZoC0.js";import{Qi as zs,Vt as Bs,_ as Ps,pi as qs,w as Gs,zt as Qs}from"./index-DDoARkPG.js";var t=Ke(os(),1),n=Ke(as(),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 ft(){const{selectedCompanyId:o}=Ts(),{setBreadcrumbs:d}=Hs(),[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),[z,Me]=(0,t.useState)(!1),[B,Le]=(0,t.useState)(!1),[Fe,He]=(0,t.useState)(!1),[ze,Be]=(0,t.useState)(!1),[Pe,qe]=(0,t.useState)(!1),[P,Ge]=(0,t.useState)("all"),[q,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(P,Date.now(),q),[P,q]);(0,t.useEffect)(()=>{d([{label:"Decisions"}])},[d]),(0,t.useEffect)(()=>{se(ps(o)),te(hs(o))},[o]);const{data:b,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:bs,refetchOnWindowFocus:!1}),{data:M}=H({queryKey:F.agents.list(o),queryFn:i(()=>_s.list(o),"queryFn"),enabled:!!o}),me=F.liveRuns(o),Q=Ls({companyId:o,resourceKey:"live-runs",queryKey:me,enabled:!!o,refetchInterval:!1,leaderOnly:!0}),{data:U,dataUpdatedAt:$e}=H({queryKey:me,queryFn:i(()=>Ms.liveRunsForCompany(o),"queryFn"),enabled:Q.enabled,refetchInterval:Q.refetchInterval});Fs(Q,U,$e);const{data:pe}=H({queryKey:F.auth.session,queryFn:i(()=>rs.getSession(),"queryFn")}),L=pe?.user?.id??pe?.session?.userId??null,w=(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)},[b?.generatedAt]);const f=(0,t.useMemo)(()=>b?.items??[],[b]),Ve=i(e=>e.dismissal!=null&&e.dismissal.isActive,"isServerHidden"),R=(0,t.useMemo)(()=>f.filter(e=>(!Ve(e)||v.has(e.id))&&!ae.has(e.id)),[f,ae,v]),Y=(0,t.useMemo)(()=>b?.generatedAt?new Date(b.generatedAt).getTime():Date.now(),[b?.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=ws(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:z,dismissedItems:N,dismissedOpen:B,limit:Math.max($,e+1)})},[I,N,B,x,u,$,c,E,z]),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 Xe=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]),be=(0,t.useCallback)(e=>{A(s=>new Set(s).add(e.id)),p(s=>s===e.id?null:s)},[]),we=(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=Bs({defaultPrevented:s.defaultPrevented,key:s.key,metaKey:s.metaKey,ctrlKey:s.ctrlKey,altKey:s.altKey,target:s.target,hasOpenDialog:Qs(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:Xe,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:P,custom:q,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)(Vs,{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),V=Ie[0];je=(0,n.jsx)($s,{agentName:w.get(V?.subject.metadata?.originAgentId)?.name??null,title:V?.subject.metadata?.bundleTitle??null,originIssue:V?.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:w,agents:M,showTriage:!0,currentUserId:L,selected:Ce&&c===h.id,liveRuns:Te(h)?U:void 0,onRetried:be})})]},h.id)})})()})]},e.key)})}),E.length>0&&(0,n.jsx)(X,{label:"Snoozed",count:E.length,open:z,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:we,agentMap:w,currentUserId:L},e.id))}),N.length>0&&(0,n.jsx)(X,{label:"Dismissed",count:N.length,open:B,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:we,agentMap:w,currentUserId:L},e.id))}),W.length>0&&(0,n.jsxs)(X,{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:w,agents:M,currentUserId:L,expanded:l===e.id,onToggleExpand:Se,onDismiss:S,onSnooze:ve,liveRuns:Te(e)?U:void 0,onRetried:be},e.id))]})]}):(0,n.jsx)(Zs,{}),(0,n.jsx)(Is,{companyId:o,selectedSourceKinds:C.sourceKinds,bounds:_,agentMap:w,decidedOpen:ze,expiredOpen:Pe,onToggleDecided:i(()=>Be(e=>!e),"onToggleDecided"),onToggleExpired:i(()=>qe(e=>!e),"onToggleExpired")})]})}i(ft,"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 Vs({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(Vs,"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{ft as WhatNeedsMe};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var g=Object.defineProperty;var i=(e,o)=>g(e,"name",{value:o,configurable:!0});import{i as f}from"./rolldown-runtime-ZpX3ckPj.js";import{C as k,na as y,ta as h}from"./createLucideIcon-DJi9suAC.js";import{t as m,v as w}from"./queryKeys-DYV5MhM_.js";import{t as N}from"./useInfiniteQuery-B28xptxn.js";import{n as I}from"./CompanyContext-CSrVsSze.js";import{r as S,t as C}from"./router-2UfGeejU.js";import{t as b}from"./button-CMwV3L1P.js";import{t as W}from"./instanceSettings-D8g_QlS-.js";import{n as U}from"./BreadcrumbContext-BVZDZoC0.js";import{_ as x,tr as _}from"./index-
|
|
1
|
+
var g=Object.defineProperty;var i=(e,o)=>g(e,"name",{value:o,configurable:!0});import{i as f}from"./rolldown-runtime-ZpX3ckPj.js";import{C as k,na as y,ta as h}from"./createLucideIcon-DJi9suAC.js";import{t as m,v as w}from"./queryKeys-DYV5MhM_.js";import{t as N}from"./useInfiniteQuery-B28xptxn.js";import{n as I}from"./CompanyContext-CSrVsSze.js";import{r as S,t as C}from"./router-2UfGeejU.js";import{t as b}from"./button-CMwV3L1P.js";import{t as W}from"./instanceSettings-D8g_QlS-.js";import{n as U}from"./BreadcrumbContext-BVZDZoC0.js";import{_ as x,tr as _}from"./index-DDoARkPG.js";import{t as A}from"./SummarySlotCard-DlSmN6PL.js";import{t as P}from"./ProjectWorkspacesContent-CadPZn0k.js";var d=f(y(),1),s=f(h(),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)(x,{variant:"detail"}):n?j?(0,s.jsx)(x,{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{ta as l}from"./createLucideIcon-DJi9suAC.js";import{t as d}from"./Identity-Cv_2a9qJ.js";import{qa as f}from"./index-
|
|
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{ta as l}from"./createLucideIcon-DJi9suAC.js";import{t as d}from"./Identity-Cv_2a9qJ.js";import{qa as f}from"./index-DDoARkPG.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};
|