@tickernelz/wardmote-ui 2026.1115.2 → 2026.1115.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AdapterManager-DlCyzyMu.js → AdapterManager-DD2p5mWg.js} +1 -1
- package/dist/assets/{AdvancedToolsRoute-4n8ZC6o0.js → AdvancedToolsRoute-DlPZ_L6N.js} +1 -1
- package/dist/assets/{AgentActionButtons-LV4FbrTY.js → AgentActionButtons-sm-e5f06.js} +1 -1
- package/dist/assets/{AgentChat-CXR66MM4.js → AgentChat-b78UeZDu.js} +1 -1
- package/dist/assets/{AgentChats-C4cEfRO_.js → AgentChats-XK32PfX0.js} +1 -1
- package/dist/assets/{AgentDefaults-BZwFysUw.js → AgentDefaults-BZlzjR_2.js} +1 -1
- package/dist/assets/{AgentDetail-DPCbH362.js → AgentDetail-DwlY6mx-.js} +1 -1
- package/dist/assets/{AgentTodoCard-82Za1R6Y.js → AgentTodoCard-C6-lHXns.js} +1 -1
- package/dist/assets/{Agents-BotjqSPg.js → Agents-C1-WHkTj.js} +3 -3
- package/dist/assets/{AppDetail-B5T_4Bu-.js → AppDetail-9cue4nY2.js} +1 -1
- package/dist/assets/{AppNotConnected-eBGlritA.js → AppNotConnected-oZ4OtRZ5.js} +1 -1
- package/dist/assets/{ApprovalCard-CyXVBGnO.js → ApprovalCard-B1Fs4K4S.js} +1 -1
- package/dist/assets/{ApprovalDetail-BSNBUdim.js → ApprovalDetail-BchdkauI.js} +1 -1
- package/dist/assets/{ApprovalPayload-vezR61PH.js → ApprovalPayload-HdMQnZAw.js} +1 -1
- package/dist/assets/{Approvals-YzDki85i.js → Approvals-ecXixAXF.js} +1 -1
- package/dist/assets/{AppsReview-D02Q501S.js → AppsReview-DSeqYXkI.js} +1 -1
- package/dist/assets/{ArtifactCard-CC5aIvtf.js → ArtifactCard-B9GVJfR3.js} +1 -1
- package/dist/assets/{Artifacts-CnP5QapS.js → Artifacts-Cfi9iGlP.js} +1 -1
- package/dist/assets/{AssistantConnection-refIKgUa.js → AssistantConnection-D1H83dKT.js} +1 -1
- package/dist/assets/{AttentionInteractionResolver-_l8MisRg.js → AttentionInteractionResolver-K_Jeu6_2.js} +1 -1
- package/dist/assets/{AuditHub-CKyN1yDa.js → AuditHub-DlVx-mPL.js} +1 -1
- package/dist/assets/{BoardChat-Dn5D5hbo.js → BoardChat-BWW2praB.js} +1 -1
- package/dist/assets/{BootstrapSetupUxLab-CDn9Qoy4.js → BootstrapSetupUxLab-C4zke6Cv.js} +1 -1
- package/dist/assets/{Browse-BQApRQGO.js → Browse-DLwvtbXu.js} +1 -1
- package/dist/assets/{BudgetPolicyCard-BAwZpX0_.js → BudgetPolicyCard-B6DX8U3d.js} +1 -1
- package/dist/assets/{CaseDetail-CPGVCggR.js → CaseDetail-dci6PiNM.js} +1 -1
- package/dist/assets/{Cases-CpluIjg7.js → Cases-DySeA3ym.js} +1 -1
- package/dist/assets/{ChatEndpointDetail-C15kjogV.js → ChatEndpointDetail-DYg7hB9_.js} +1 -1
- package/dist/assets/{ChatEndpointSetup-Czgls4T4.js → ChatEndpointSetup-D82OKj2o.js} +1 -1
- package/dist/assets/{ChoiceControls-Dd_bVqHH.js → ChoiceControls-BCF1vPaa.js} +1 -1
- package/dist/assets/{Companies-DK47FHh_.js → Companies-gUbW68nN.js} +1 -1
- package/dist/assets/{CompanyAccess-G_ygWCdy.js → CompanyAccess-C0cDvj8M.js} +1 -1
- package/dist/assets/{CompanyActivity-BzF5S-ak.js → CompanyActivity-CbIPKv4K.js} +1 -1
- package/dist/assets/{CompanyConnections-V6QokJbP.js → CompanyConnections-BezhEQiP.js} +1 -1
- package/dist/assets/{CompanyEnvironments-Dtsf3CLS.js → CompanyEnvironments-6-P8NN3Q.js} +1 -1
- package/dist/assets/{CompanyExport-CMPWrtnT.js → CompanyExport-UdhY3JMr.js} +1 -1
- package/dist/assets/{CompanyImport-1brk-ZPP.js → CompanyImport-Dj5G-Ci_.js} +1 -1
- package/dist/assets/{CompanySettings-DXs4duFl.js → CompanySettings-ifpz0tmL.js} +1 -1
- package/dist/assets/{CompanySettingsPluginPage-C2DZeyFu.js → CompanySettingsPluginPage-BCK7KaI1.js} +1 -1
- package/dist/assets/{CompanySkills-BE6s5mI1.js → CompanySkills-mzA6IM7-.js} +1 -1
- package/dist/assets/{ConfigureBuiltInAgentModal-7wvPpeNM.js → ConfigureBuiltInAgentModal-DsiGg71e.js} +1 -1
- package/dist/assets/{CopyableGatewayUrl-i8-LiYxQ.js → CopyableGatewayUrl-DwtHLPUd.js} +1 -1
- package/dist/assets/{Dashboard-CU-kG6C4.js → Dashboard-CHGehxNs.js} +1 -1
- package/dist/assets/{DecisionDateChips-BhvEmkt1.js → DecisionDateChips-Ce1EP_35.js} +1 -1
- package/dist/assets/{DecisionQueuePage-CBULv6cY.js → DecisionQueuePage-B55ERukD.js} +1 -1
- package/dist/assets/{DesignGuide-BwncU-wB.js → DesignGuide-CoW-4sZp.js} +1 -1
- package/dist/assets/{EmailEndpointSetup-BPf_8pC0.js → EmailEndpointSetup-Q4I-LgnZ.js} +1 -1
- package/dist/assets/{ExecutionWorkspaceDetail-CqvRHX5r.js → ExecutionWorkspaceDetail-_LuHtfta.js} +1 -1
- package/dist/assets/{GatewayDetail-Br82oQib.js → GatewayDetail-BKCHLhcu.js} +1 -1
- package/dist/assets/{GatewaysList-kBD3cwdU.js → GatewaysList-CZ-_zFD_.js} +1 -1
- package/dist/assets/{GoalDetail-BFeUPzal.js → GoalDetail-Bd04vnyA.js} +1 -1
- package/dist/assets/{GoalTree-CaQSt6o5.js → GoalTree-DtvAb581.js} +1 -1
- package/dist/assets/{Goals-CnYUdXEo.js → Goals-BXW_WXNa.js} +1 -1
- package/dist/assets/{ImageGalleryModal-QrZd2HrQ.js → ImageGalleryModal-xeIIyU7g.js} +1 -1
- package/dist/assets/{Inbox-C6bCCEH6.js → Inbox-DmxWV98u.js} +1 -1
- package/dist/assets/{InstanceAdvanced-CTjlJp69.js → InstanceAdvanced-DMrEvjyY.js} +1 -1
- package/dist/assets/{InviteLanding-C65R08_E.js → InviteLanding-C-S7p6JM.js} +1 -1
- package/dist/assets/{IssueChatLongThreadPerf-mdn5NFzU.js → IssueChatLongThreadPerf-BWbJprSQ.js} +1 -1
- package/dist/assets/{IssueChatThread-CZ9Q-xq-.js → IssueChatThread-DmAyIOuN.js} +1 -1
- package/dist/assets/{IssueDetail-svM2GGnk.js → IssueDetail-issXYSBj.js} +1 -1
- package/dist/assets/{IssueOutputSection-Du3C5TFv.js → IssueOutputSection-BioA9Nux.js} +1 -1
- package/dist/assets/{IssueRecoveryActionCard-Bq2QDhQA.js → IssueRecoveryActionCard-CGWmkRkb.js} +1 -1
- package/dist/assets/{IssueReferencePill-Cnjk1Ugc.js → IssueReferencePill-DWL74G_c.js} +1 -1
- package/dist/assets/{IssueThreadInteractionCard-CAzrNSjO.js → IssueThreadInteractionCard-bP4n_lcw.js} +1 -1
- package/dist/assets/{Issues-D97SDuYL.js → Issues-ButYwujh.js} +1 -1
- package/dist/assets/{LiveNowTodoLine-Cq1ub6Gj.js → LiveNowTodoLine-CiCmi71g.js} +1 -1
- package/dist/assets/{ManagedAiConnectionDetails-COyNN_aD.js → ManagedAiConnectionDetails-CgCv2fqy.js} +1 -1
- package/dist/assets/{McpConnect-CYsPUSYV.js → McpConnect-CeT7gUW_.js} +1 -1
- package/dist/assets/{MembershipAction-DYMy7umB.js → MembershipAction-BX9XIExA.js} +1 -1
- package/dist/assets/{ModelsAndProviders-BJaNzbhV.js → ModelsAndProviders-SEGB5DIt.js} +1 -1
- package/dist/assets/{NewAgent-DGXol110.js → NewAgent-LKqNzfsM.js} +1 -1
- package/dist/assets/{OmpAllSettings-BvYkLMhp.js → OmpAllSettings-1aXWEp6h.js} +1 -1
- package/dist/assets/{PipelineSettings-B6Am-LrO.js → PipelineSettings-UFCz50OY.js} +1 -1
- package/dist/assets/{Pipelines-MgjAhzew.js → Pipelines-n5EQOzN2.js} +1 -1
- package/dist/assets/{PixelsOffice-DnBnPerp.js → PixelsOffice-De61dU2s.js} +1 -1
- package/dist/assets/{PluginPage-C1XADFT2.js → PluginPage-CBSnEw7x.js} +1 -1
- package/dist/assets/{PluginSettings-CapWiXsO.js → PluginSettings-D2pNKDKr.js} +1 -1
- package/dist/assets/{ProfileDetailRoute-PJCQrW25.js → ProfileDetailRoute-DCbTvhPd.js} +1 -1
- package/dist/assets/{ProfileSettings-DXbA8GQP.js → ProfileSettings-BUYIctBS.js} +1 -1
- package/dist/assets/{ProfileWizardRoute-DaZPFglw.js → ProfileWizardRoute-o4Kf_DhP.js} +1 -1
- package/dist/assets/{ProjectDetail-DQxMbc1Q.js → ProjectDetail-DOF0t71W.js} +1 -1
- package/dist/assets/{ProjectWorkspaceDetail-dA3zVCbf.js → ProjectWorkspaceDetail-BEbFq9oK.js} +1 -1
- package/dist/assets/{ProjectWorkspacesContent-DnzUTFfW.js → ProjectWorkspacesContent-DwVqtur5.js} +1 -1
- package/dist/assets/{Projects-D3ZC8FJk.js → Projects-BsZYs3Fo.js} +1 -1
- package/dist/assets/{PublicIssueSharePage-BtWc4gq4.js → PublicIssueSharePage-8uOICn1V.js} +1 -1
- package/dist/assets/{ReviewQueueCard-C9YVH9hi.js → ReviewQueueCard-rQxgVMx_.js} +1 -1
- package/dist/assets/{RichWorkProductCard-CJPI3xQY.js → RichWorkProductCard-FcmQ5fHH.js} +1 -1
- package/dist/assets/{RoutineDetail-DUZXGXpv.js → RoutineDetail-DWqy00zc.js} +1 -1
- package/dist/assets/{RoutineRunVariablesDialog-CQJpihoC.js → RoutineRunVariablesDialog-DaGovqJt.js} +1 -1
- package/dist/assets/{Routines-CZMUFOH1.js → Routines-BE2PduWG.js} +1 -1
- package/dist/assets/{ScrollToBottom-wVHhI6vr.js → ScrollToBottom-DiemLpd4.js} +1 -1
- package/dist/assets/{Search-8efHT3Mn.js → Search-B_dblFtf.js} +1 -1
- package/dist/assets/{Secrets-BZCIDLKj.js → Secrets-D8ZlRoVo.js} +1 -1
- package/dist/assets/{SkillSourceTree-D31jixpq.js → SkillSourceTree-CDK_UwP7.js} +1 -1
- package/dist/assets/{SkillSources-Bn1LRP0O.js → SkillSources-C8inxmWw.js} +1 -1
- package/dist/assets/{SkillStudio-C4o17_hm.js → SkillStudio-8S7xrus7.js} +1 -1
- package/dist/assets/{SourceTrustBadge-C0F4cAmH.js → SourceTrustBadge-DTVyCj4T.js} +1 -1
- package/dist/assets/{StatusCards-BIvnBXBN.js → StatusCards-BpujcoJb.js} +1 -1
- package/dist/assets/{SummarySlotCard-Bpu8HBIR.js → SummarySlotCard-CTolnfbx.js} +1 -1
- package/dist/assets/{TaskChatLab-DAEcgWdy.js → TaskChatLab-BfJcSULz.js} +1 -1
- package/dist/assets/{TaskChatMarker-Bbn6iq01.js → TaskChatMarker-BYJIRrTg.js} +1 -1
- package/dist/assets/{TaskChatProtocolCard-wllJ9P2o.js → TaskChatProtocolCard-DTsBzh1L.js} +1 -1
- package/dist/assets/{TaskChatThreadView-Bnyakc3A.js → TaskChatThreadView-CBwEERny.js} +1 -1
- package/dist/assets/{TaskTreeControls-BFz5K7U-.js → TaskTreeControls-BzPeXKPq.js} +1 -1
- package/dist/assets/{Terminal-DGUlqBL9.js → Terminal-DGY0GEez.js} +1 -1
- package/dist/assets/{TerminalView-Cz01H-I5.js → TerminalView-CZkTSDKg.js} +1 -1
- package/dist/assets/{TrustPresetSection-lyB0V8c9.js → TrustPresetSection-DeIvlixJ.js} +1 -1
- package/dist/assets/{UserProfile-5qgIbXdf.js → UserProfile-BkcJ9Wfx.js} +1 -1
- package/dist/assets/{WhatNeedsMe-DjxO39CR.js → WhatNeedsMe-Bg72QkYe.js} +1 -1
- package/dist/assets/{Workspaces-BzTr5cqx.js → Workspaces-BeS2M4CD.js} +1 -1
- package/dist/assets/{connection-owner-EECE9Eiz.js → connection-owner-qWfs2q4d.js} +1 -1
- package/dist/assets/{index-DbENFODe.js → index-CSIXA5y5.js} +3 -3
- package/dist/assets/{issue-properties-BmOIUOmd.js → issue-properties-D3qASSPI.js} +1 -1
- package/dist/assets/{issue-workspace-selection-CIvSmFv2.js → issue-workspace-selection-sfcpgxzV.js} +1 -1
- package/dist/assets/{pipeline-stage-presentation-DoJvVCJ3.js → pipeline-stage-presentation-C9WooPFB.js} +1 -1
- package/dist/assets/{shared-BMQlB2gM.js → shared-57amdu2f.js} +1 -1
- package/dist/assets/{transcript-adapter-DDVisW9K.js → transcript-adapter-D7nXUOr3.js} +1 -1
- package/dist/assets/{useSummaryDraftStream-BNKrqAT0.js → useSummaryDraftStream-1H3w75Dm.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/sw.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var g=Object.defineProperty;var a=(s,t)=>g(s,"name",{value:t,configurable:!0});import{i as N}from"./rolldown-runtime-ZpX3ckPj.js";import{l as y,ta as k}from"./createLucideIcon-B-uEJvX6.js";import{a as w}from"./star-BXywPGTx.js";import{d as v,u as _}from"./queryKeys-yuC-YxZI.js";import{on as C,t as A}from"./router-2HX_SyKK.js";import{t as I}from"./circle-x-BjJ9dhyd.js";import{t as u}from"./clock-CC_JLeqp.js";import{n as z,t as n}from"./button-D3bYvq4T.js";import{t as B}from"./badge-Dz4tmpgp.js";import{t as q}from"./AgentIdentity-DysUzsFa.js";import{t as R}from"./card-CtkberpO.js";import{a as F,i as E,o as S,r as T,t as V}from"./ApprovalPayload-
|
|
1
|
+
var g=Object.defineProperty;var a=(s,t)=>g(s,"name",{value:t,configurable:!0});import{i as N}from"./rolldown-runtime-ZpX3ckPj.js";import{l as y,ta as k}from"./createLucideIcon-B-uEJvX6.js";import{a as w}from"./star-BXywPGTx.js";import{d as v,u as _}from"./queryKeys-yuC-YxZI.js";import{on as C,t as A}from"./router-2HX_SyKK.js";import{t as I}from"./circle-x-BjJ9dhyd.js";import{t as u}from"./clock-CC_JLeqp.js";import{n as z,t as n}from"./button-D3bYvq4T.js";import{t as B}from"./badge-Dz4tmpgp.js";import{t as q}from"./AgentIdentity-DysUzsFa.js";import{t as R}from"./card-CtkberpO.js";import{a as F,i as E,o as S,r as T,t as V}from"./ApprovalPayload-HdMQnZAw.js";var e=N(k(),1);function O(s){return s==="approved"?(0,e.jsx)(w,{className:"h-3.5 w-3.5 text-green-600 dark:text-green-400"}):s==="rejected"?(0,e.jsx)(I,{className:"h-3.5 w-3.5 text-red-600 dark:text-red-400"}):s==="revision_requested"?(0,e.jsx)(u,{className:"h-3.5 w-3.5 text-amber-600 dark:text-amber-400"}):s==="pending"?(0,e.jsx)(u,{className:"h-3.5 w-3.5 text-yellow-600 dark:text-yellow-400"}):null}a(O,"statusIcon");function Z({approval:s,requesterAgent:t,onApprove:l,onReject:d,onOpen:r,detailLink:i,isPending:c=!1,pendingAction:o=null}){const m=v(),h=s.payload,j=F[s.type]??E,x=S[s.type]??s.type,f=T(h),p=!!(l&&d)&&s.type!=="budget_override_required"&&(s.status==="pending"||s.status==="revision_requested"),b=p||!!(i||r);return(0,e.jsxs)(R,{className:"block border-line/70 p-4",children:[(0,e.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,e.jsx)("div",{className:"min-w-0 flex-1",children:(0,e.jsxs)("div",{className:"flex items-start gap-3",children:[(0,e.jsx)("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-full border border-line/70 bg-bg/80",children:(0,e.jsx)(j,{className:"h-4 w-4 text-ink-3"})}),(0,e.jsxs)("div",{className:"min-w-0 flex-1 space-y-2",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsx)(B,{variant:"outline",className:"border-line/70 bg-bg/70 px-2 py-0.5 text-(length:--text-micro) font-medium uppercase tracking-(--tracking-label) text-ink-3",children:x}),t&&(0,e.jsxs)("div",{className:"inline-flex min-w-0 items-center gap-1.5 text-xs text-ink-3",children:[(0,e.jsx)("span",{children:"Requested by"}),(0,e.jsx)(q,{agent:t,size:"sm",className:"inline-flex"})]})]}),(0,e.jsxs)("div",{className:"space-y-1",children:[(0,e.jsx)("h3",{className:"text-base font-semibold leading-6 text-ink",children:f??x}),(0,e.jsxs)("p",{className:"text-xs leading-5 text-ink-3",children:["Approval request created ",C(s.createdAt)]})]})]})]})}),(0,e.jsx)("div",{className:"shrink-0",children:(0,e.jsxs)("div",{className:"inline-flex items-center gap-1.5 rounded-full border border-line/70 bg-bg/80 px-2.5 py-1 text-xs text-ink-3",children:[O(s.status),(0,e.jsx)("span",{className:"capitalize",children:s.status.replace(/_/g," ")})]})})]}),(0,e.jsx)("div",{className:"mt-4 border-t border-line/60 pt-4",children:(0,e.jsx)(V,{type:s.type,payload:s.payload,hidePrimaryTitle:!!f})}),s.decisionNote&&(0,e.jsxs)("div",{className:"mt-4 rounded-lg border border-line/60 bg-bg-3/30 px-3.5 py-3 text-xs leading-5 text-ink-3",children:[(0,e.jsx)("span",{className:"font-medium text-ink",children:"Decision note."})," ",s.decisionNote]}),b?(0,e.jsxs)("div",{className:"mt-4 flex flex-wrap items-center justify-between gap-3 border-t border-line/60 pt-4",children:[(0,e.jsx)("fieldset",{disabled:m,title:m?_:void 0,className:"m-0 flex min-w-0 flex-wrap items-center gap-2 border-0 p-0",children:p&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(n,{size:"sm",onClick:l,disabled:c,children:o==="approve"?"Approving...":"Approve"}),(0,e.jsx)(n,{variant:"secondary",size:"sm",onClick:d,disabled:c,children:o==="reject"?"Rejecting...":"Reject"})]})}),i||r?i?(0,e.jsx)(A,{to:i,className:y(z({variant:"ghost",size:"sm"}),"h-auto px-2 text-xs text-ink-3"),children:"View details"}):(0,e.jsx)(n,{variant:"ghost",size:"sm",className:"h-auto px-2 text-xs",onClick:r,children:"View details"}):null]}):null]})}a(Z,"ApprovalCard");export{Z as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var H=Object.defineProperty;var t=(n,u)=>H(n,"name",{value:u,configurable:!0});import{i as L}from"./rolldown-runtime-ZpX3ckPj.js";import{na as U,ta as V}from"./createLucideIcon-B-uEJvX6.js";import{a as W,v as Y,y as Z}from"./star-BXywPGTx.js";import{X as ee,_ as m,t as i,v as f}from"./queryKeys-yuC-YxZI.js";import{n as se}from"./CompanyContext-DDgccGSs.js";import{J as te,o as ae,t as I}from"./router-2HX_SyKK.js";import{t as ne}from"./chevron-right-DDmPvaMb.js";import{t as re}from"./MarkdownBody-B_U4yj24.js";import{t as d}from"./button-D3bYvq4T.js";import{t as ie}from"./Identity-J7JnIwUT.js";import{t as Q}from"./agents-DjsXf9UL.js";import{n as oe}from"./BreadcrumbContext-_dNLeVnD.js";import{t as D}from"./AgentIdentity-DysUzsFa.js";import{t as de}from"./textarea-9ySinQRQ.js";import{Dn as le,da as o,v as ce}from"./index-
|
|
1
|
+
var H=Object.defineProperty;var t=(n,u)=>H(n,"name",{value:u,configurable:!0});import{i as L}from"./rolldown-runtime-ZpX3ckPj.js";import{na as U,ta as V}from"./createLucideIcon-B-uEJvX6.js";import{a as W,v as Y,y as Z}from"./star-BXywPGTx.js";import{X as ee,_ as m,t as i,v as f}from"./queryKeys-yuC-YxZI.js";import{n as se}from"./CompanyContext-DDgccGSs.js";import{J as te,o as ae,t as I}from"./router-2HX_SyKK.js";import{t as ne}from"./chevron-right-DDmPvaMb.js";import{t as re}from"./MarkdownBody-B_U4yj24.js";import{t as d}from"./button-D3bYvq4T.js";import{t as ie}from"./Identity-J7JnIwUT.js";import{t as Q}from"./agents-DjsXf9UL.js";import{n as oe}from"./BreadcrumbContext-_dNLeVnD.js";import{t as D}from"./AgentIdentity-DysUzsFa.js";import{t as de}from"./textarea-9ySinQRQ.js";import{Dn as le,da as o,v as ce}from"./index-CSIXA5y5.js";import{a as me,i as pe,n as ue,t as xe}from"./ApprovalPayload-HdMQnZAw.js";var p=L(U(),1),e=L(V(),1);function Re(){const{approvalId:n}=Y(),{selectedCompanyId:u,setSelectedCompanyId:A}=se(),{setBreadcrumbs:w}=oe(),j=ae(),[$]=Z(),l=ee(),[b,C]=(0,p.useState)(""),[S,r]=(0,p.useState)(null),[E,T]=(0,p.useState)(!1),{data:a,isLoading:J}=f({queryKey:i.approvals.detail(n),queryFn:t(()=>o.get(n),"queryFn"),enabled:!!n}),k=a?.companyId??u,{data:P}=f({queryKey:i.approvals.comments(n),queryFn:t(()=>o.listComments(n),"queryFn"),enabled:!!n}),{data:x}=f({queryKey:i.approvals.issues(n),queryFn:t(()=>o.listIssues(n),"queryFn"),enabled:!!n}),{data:g}=f({queryKey:i.agents.list(k??""),queryFn:t(()=>Q.list(k??""),"queryFn"),enabled:!!k});(0,p.useEffect)(()=>{!a?.companyId||a.companyId===u||A(a.companyId,{source:"route_sync"})},[a?.companyId,u,A]),(0,p.useMemo)(()=>{const s=new Map;for(const y of g??[])s.set(y.id,y.name);return s},[g]),(0,p.useEffect)(()=>{w([{label:"Approvals",href:"/approvals"},{label:a?.id?.slice(0,8)??n??"Approval"}])},[w,a,n]);const c=t(()=>{n&&(l.invalidateQueries({queryKey:i.approvals.detail(n)}),l.invalidateQueries({queryKey:i.approvals.comments(n)}),l.invalidateQueries({queryKey:i.approvals.issues(n)}),a?.companyId&&(l.invalidateQueries({queryKey:i.approvals.list(a.companyId)}),l.invalidateQueries({queryKey:i.approvals.list(a.companyId,"pending")}),l.invalidateQueries({queryKey:i.agents.list(a.companyId)})))},"refresh"),R=m({mutationFn:t(()=>o.approve(n),"mutationFn"),onSuccess:t(()=>{r(null),c(),j(`/approvals/${n}?resolved=approved`,{replace:!0})},"onSuccess"),onError:t(s=>r(s instanceof Error?s.message:"Approve failed"),"onError")}),_=m({mutationFn:t(()=>o.reject(n),"mutationFn"),onSuccess:t(()=>{r(null),c()},"onSuccess"),onError:t(s=>r(s instanceof Error?s.message:"Reject failed"),"onError")}),B=m({mutationFn:t(()=>o.requestRevision(n),"mutationFn"),onSuccess:t(()=>{r(null),c()},"onSuccess"),onError:t(s=>r(s instanceof Error?s.message:"Revision request failed"),"onError")}),M=m({mutationFn:t(()=>o.resubmit(n),"mutationFn"),onSuccess:t(()=>{r(null),c()},"onSuccess"),onError:t(s=>r(s instanceof Error?s.message:"Resubmit failed"),"onError")}),N=m({mutationFn:t(()=>o.addComment(n,b.trim()),"mutationFn"),onSuccess:t(()=>{C(""),r(null),c()},"onSuccess"),onError:t(s=>r(s instanceof Error?s.message:"Comment failed"),"onError")}),z=m({mutationFn:t(s=>Q.remove(s),"mutationFn"),onSuccess:t(()=>{r(null),c(),j("/approvals")},"onSuccess"),onError:t(s=>r(s instanceof Error?s.message:"Delete failed"),"onError")});if(J)return(0,e.jsx)(ce,{variant:"detail"});if(!a)return(0,e.jsx)("p",{className:"text-sm text-ink-3",children:"Approval not found."});const v=a.payload,h=typeof v.agentId=="string"?v.agentId:null,O=a.status==="pending"||a.status==="revision_requested",F=a.type==="budget_override_required",X=me[a.type]??pe,G=$.get("resolved")==="approved"&&a.status==="approved",q=x?.[0]??null,K=q?{label:(x?.length??0)>1?"Review linked tasks":"Review linked task",to:`/issues/${q.identifier??q.id}`}:h?{label:"Open hired agent",to:`/agents/${h}`}:{label:"Back to approvals",to:"/approvals"};return(0,e.jsxs)("div",{className:"space-y-6 max-w-3xl",children:[G&&(0,e.jsx)("div",{className:"border border-green-300 dark:border-green-700/40 bg-green-50 dark:bg-green-900/20 rounded-lg px-4 py-3 animate-in fade-in zoom-in-95 duration-300",children:(0,e.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,e.jsxs)("div",{className:"flex items-start gap-2",children:[(0,e.jsxs)("div",{className:"relative mt-0.5",children:[(0,e.jsx)(W,{className:"h-4 w-4 text-green-600 dark:text-green-300"}),(0,e.jsx)(te,{className:"h-3 w-3 text-green-500 dark:text-green-200 absolute -right-2 -top-1 animate-pulse"})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"text-sm text-green-800 dark:text-green-100 font-medium",children:"Approval confirmed"}),(0,e.jsx)("p",{className:"text-xs text-green-700 dark:text-green-200/90",children:"Requesting agent was notified to review this approval and linked tasks."})]})]}),(0,e.jsx)(d,{size:"sm",variant:"secondary",onClick:t(()=>j(K.to),"onClick"),children:K.label})]})}),(0,e.jsxs)("div",{className:"border border-line rounded-lg p-4 space-y-3",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(X,{className:"h-5 w-5 text-ink-3 shrink-0"}),(0,e.jsxs)("div",{children:[(0,e.jsx)("h2",{className:"text-lg font-semibold",children:ue(a.type,a.payload)}),(0,e.jsx)("p",{className:"text-xs text-ink-3 font-mono",children:a.id})]})]}),(0,e.jsx)(le,{status:a.status})]}),(0,e.jsxs)("div",{className:"text-sm space-y-1",children:[a.requestedByAgentId&&(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("span",{className:"text-ink-3 text-xs",children:"Requested by"}),(0,e.jsx)(D,{agent:g?.find(s=>s.id===a.requestedByAgentId)??{id:a.requestedByAgentId,name:"Agent"},size:"sm"})]}),(0,e.jsx)(xe,{type:a.type,payload:v}),(0,e.jsxs)("button",{type:"button",className:"flex items-center gap-1 text-xs text-ink-3 hover:text-ink transition-colors mt-2",onClick:t(()=>T(s=>!s),"onClick"),children:[(0,e.jsx)(ne,{className:`h-3 w-3 transition-transform ${E?"rotate-90":""}`}),"See full request"]}),E&&(0,e.jsx)("pre",{className:"text-xs bg-bg-3/40 rounded-md p-3 overflow-x-auto",children:JSON.stringify(v,null,2)}),a.decisionNote&&(0,e.jsxs)("p",{className:"text-xs text-ink-3",children:["Decision note: ",a.decisionNote]})]}),S&&(0,e.jsx)("p",{className:"text-sm text-bad",children:S}),x&&x.length>0&&(0,e.jsxs)("div",{className:"pt-2 border-t border-line/60",children:[(0,e.jsx)("p",{className:"text-xs text-ink-3 mb-1.5",children:"Linked Tasks"}),(0,e.jsx)("div",{className:"space-y-1.5",children:x.map(s=>(0,e.jsxs)(I,{to:`/issues/${s.identifier??s.id}`,className:"block text-xs rounded border border-line/70 px-2 py-1.5 hover:bg-bg-3/20",children:[(0,e.jsx)("span",{className:"font-mono text-ink-3 mr-2",children:s.identifier??s.id.slice(0,8)}),(0,e.jsx)("span",{children:s.title})]},s.id))}),(0,e.jsx)("p",{className:"text-(length:--text-micro) text-ink-3 mt-2",children:"Linked tasks remain open until the requesting agent follows up and closes them."})]}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[O&&!F&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(d,{size:"sm",onClick:t(()=>R.mutate(),"onClick"),disabled:R.isPending,children:"Approve"}),(0,e.jsx)(d,{variant:"secondary",size:"sm",onClick:t(()=>_.mutate(),"onClick"),disabled:_.isPending,children:"Reject"})]}),F&&a.status==="pending"&&(0,e.jsxs)("p",{className:"text-sm text-ink-3",children:["Resolve this budget stop from the budget controls on ",(0,e.jsx)(I,{to:"/costs",className:"underline underline-offset-2",children:"/costs"}),"."]}),a.status==="pending"&&(0,e.jsx)(d,{size:"sm",variant:"secondary",onClick:t(()=>B.mutate(),"onClick"),disabled:B.isPending,children:"Request revision"}),a.status==="revision_requested"&&(0,e.jsx)(d,{size:"sm",variant:"secondary",onClick:t(()=>M.mutate(),"onClick"),disabled:M.isPending,children:"Mark resubmitted"}),a.status==="rejected"&&a.type==="hire_agent"&&h&&(0,e.jsx)(d,{size:"sm",variant:"danger",onClick:t(()=>{window.confirm("Delete this disapproved agent? This cannot be undone.")&&z.mutate(h)},"onClick"),disabled:z.isPending,children:"Delete disapproved agent"})]})]}),(0,e.jsxs)("div",{className:"border border-line rounded-lg p-4 space-y-3",children:[(0,e.jsxs)("h3",{className:"text-sm font-medium",children:["Comments (",P?.length??0,")"]}),(0,e.jsx)("div",{className:"space-y-2",children:(P??[]).map(s=>(0,e.jsxs)("div",{className:"border border-line/60 rounded-md p-3",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[s.authorAgentId?(0,e.jsx)(I,{to:`/agents/${s.authorAgentId}`,className:"hover:underline",children:(0,e.jsx)(D,{agent:g?.find(y=>y.id===s.authorAgentId)??{id:s.authorAgentId,name:"Agent"},size:"sm"})}):(0,e.jsx)(ie,{name:"Board",size:"sm"}),(0,e.jsx)("span",{className:"text-xs text-ink-3",children:new Date(s.createdAt).toLocaleString()})]}),(0,e.jsx)(re,{className:"text-sm",children:s.body})]},s.id))}),(0,e.jsx)(de,{value:b,onChange:t(s=>C(s.target.value),"onChange"),placeholder:"Add a comment...",rows:3}),(0,e.jsx)("div",{className:"flex justify-end",children:(0,e.jsx)(d,{size:"sm",onClick:t(()=>N.mutate(),"onClick"),disabled:!b.trim()||N.isPending,children:N.isPending?"Posting…":"Post comment"})})]})]})}t(Re,"ApprovalDetail");export{Re as ApprovalDetail};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var h=Object.defineProperty;var n=(e,s)=>h(e,"name",{value:s,configurable:!0});import{i as f}from"./rolldown-runtime-ZpX3ckPj.js";import{f as u,ta as b}from"./createLucideIcon-B-uEJvX6.js";import{et as j}from"./router-2HX_SyKK.js";import{t as m}from"./MarkdownBody-B_U4yj24.js";import{t as v}from"./shield-alert-CE3cG15R.js";import{t as p}from"./shield-check-EFhQ8TuB.js";import{ka as k}from"./index-
|
|
1
|
+
var h=Object.defineProperty;var n=(e,s)=>h(e,"name",{value:s,configurable:!0});import{i as f}from"./rolldown-runtime-ZpX3ckPj.js";import{f as u,ta as b}from"./createLucideIcon-B-uEJvX6.js";import{et as j}from"./router-2HX_SyKK.js";import{t as m}from"./MarkdownBody-B_U4yj24.js";import{t as v}from"./shield-alert-CE3cG15R.js";import{t as p}from"./shield-check-EFhQ8TuB.js";import{ka as k}from"./index-CSIXA5y5.js";var t=f(b(),1),N={hire_agent:"Hire Agent",approve_ceo_strategy:"CEO Strategy",budget_override_required:"Budget Override",request_board_approval:"Board Approval"};function l(...e){for(const s of e)if(typeof s=="string"&&s.trim().length>0)return s.trim();return null}n(l,"firstNonEmptyString");function A(e){return l(e?.title,e?.name,e?.summary,e?.recommendedAction)}n(A,"approvalSubject");function I(e,s){const r=N[e]??e,c=A(s);return c?`${r}: ${c}`:r}n(I,"approvalLabel");var H={hire_agent:k,approve_ceo_strategy:j,budget_override_required:v,request_board_approval:p},F=p;function i({label:e,value:s}){return s?(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-ink-3 w-20 sm:w-24 shrink-0 text-xs",children:e}),(0,t.jsx)("span",{children:String(s)})]}):null}n(i,"PayloadField");function _({values:e}){if(!Array.isArray(e))return null;const s=e.filter(r=>typeof r=="string").map(r=>r.trim()).filter(Boolean);return s.length===0?null:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)("span",{className:"text-ink-3 w-20 sm:w-24 shrink-0 text-xs pt-0.5",children:"Skills"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:s.map(r=>(0,t.jsx)("span",{className:"rounded bg-bg-3 px-1.5 py-0.5 font-mono text-(length:--text-micro) text-ink-3",children:r},r))})]})}n(_,"SkillList");function w({payload:e}){return(0,t.jsxs)("div",{className:"mt-3 space-y-1.5 text-sm",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-ink-3 w-20 sm:w-24 shrink-0 text-xs",children:"Name"}),(0,t.jsx)("span",{className:"font-medium",children:String(e.name??"—")})]}),(0,t.jsx)(i,{label:"Role",value:e.role}),(0,t.jsx)(i,{label:"Title",value:e.title}),(0,t.jsx)(i,{label:"Icon",value:e.icon}),!!e.capabilities&&(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)("span",{className:"text-ink-3 w-20 sm:w-24 shrink-0 text-xs pt-0.5",children:"Capabilities"}),(0,t.jsx)("span",{className:"text-ink-3",children:String(e.capabilities)})]}),!!e.adapterType&&(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-ink-3 w-20 sm:w-24 shrink-0 text-xs",children:"Adapter"}),(0,t.jsx)("span",{className:"font-mono text-xs bg-bg-3 px-1.5 py-0.5 rounded",children:String(e.adapterType)})]}),(0,t.jsx)(_,{values:e.desiredSkills})]})}n(w,"HireAgentPayload");function S({payload:e}){const s=e.plan??e.description??e.strategy??e.text;return(0,t.jsxs)("div",{className:"mt-3 space-y-1.5 text-sm",children:[(0,t.jsx)(i,{label:"Title",value:e.title}),!!s&&(0,t.jsx)("div",{className:"mt-2 rounded-md bg-bg-3/40 px-3 py-2 text-sm text-ink-3 whitespace-pre-wrap font-mono text-xs max-h-48 overflow-y-auto",children:String(s)}),!s&&(0,t.jsx)("pre",{className:"mt-2 rounded-md bg-bg-3/40 px-3 py-2 text-xs text-ink-3 overflow-x-auto max-h-48",children:JSON.stringify(e,null,2)})]})}n(S,"CeoStrategyPayload");function y({payload:e}){const s=typeof e.budgetAmount=="number"?e.budgetAmount:null,r=typeof e.observedAmount=="number"?e.observedAmount:null;return(0,t.jsxs)("div",{className:"mt-3 space-y-1.5 text-sm",children:[(0,t.jsx)(i,{label:"Scope",value:e.scopeName??e.scopeType}),(0,t.jsx)(i,{label:"Window",value:e.windowKind}),(0,t.jsx)(i,{label:"Metric",value:e.metric}),s!==null||r!==null?(0,t.jsxs)("div",{className:"rounded-md bg-bg-3/40 px-3 py-2 text-xs text-ink-3",children:["Limit ",s!==null?u(s):"—"," · Observed ",r!==null?u(r):"—"]}):null,!!e.guidance&&(0,t.jsx)("p",{className:"text-ink-3",children:String(e.guidance)})]})}n(y,"BudgetOverridePayload");function P({payload:e,hideTitle:s=!1}){const r=s?{...e,title:void 0}:e;return(0,t.jsx)(C,{payload:r})}n(P,"BoardApprovalPayload");function B(e){return e.replace(/^(?:[-*•]|\d+[.)])\s+/,"")}n(B,"stripLeadingListMarker");function C({payload:e}){const s=Array.isArray(e.risks)?e.risks.filter(a=>typeof a=="string").map(a=>B(a.trim())).filter(Boolean):[],r=l(e.title),c=l(e.summary),o=l(e.recommendedAction),x=l(e.nextActionOnApproval),d=l(e.proposedComment);return(0,t.jsxs)("div",{className:"mt-4 space-y-3.5 text-sm",children:[r&&(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("p",{className:"text-(length:--text-micro) font-medium uppercase tracking-(--tracking-label) text-ink-3",children:"Title"}),(0,t.jsx)("p",{className:"font-medium leading-6 text-ink",children:r})]}),c&&(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("p",{className:"text-(length:--text-micro) font-medium uppercase tracking-(--tracking-label) text-ink-3",children:"Summary"}),(0,t.jsx)(m,{className:"leading-6 text-ink/90",children:c})]}),o&&(0,t.jsxs)("div",{className:"rounded-lg border border-amber-500/20 bg-amber-500/10 px-3.5 py-3",children:[(0,t.jsx)("p",{className:"text-(length:--text-micro) font-medium uppercase tracking-(--tracking-label) text-amber-700 dark:text-amber-300",children:"Recommended action"}),(0,t.jsx)(m,{className:"mt-1 leading-6 text-ink",children:o})]}),x&&(0,t.jsxs)("div",{className:"rounded-lg border border-line/60 bg-bg/60 px-3.5 py-3",children:[(0,t.jsx)("p",{className:"text-(length:--text-micro) font-medium uppercase tracking-(--tracking-label) text-ink-3",children:"On approval"}),(0,t.jsx)(m,{className:"mt-1 leading-6 text-ink",children:x})]}),s.length>0&&(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("p",{className:"text-(length:--text-micro) font-medium uppercase tracking-(--tracking-label) text-ink-3",children:"Risks"}),(0,t.jsx)("ul",{className:"space-y-1 text-sm text-ink-3",children:s.map((a,g)=>(0,t.jsxs)("li",{className:"flex items-start gap-2",children:[(0,t.jsx)("span",{className:"mt-2 h-1.5 w-1.5 shrink-0 rounded-full bg-ink-3/60"}),(0,t.jsx)(m,{className:"leading-6",children:a})]},`${g}-${a}`))})]}),d&&(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("p",{className:"text-(length:--text-micro) font-medium uppercase tracking-(--tracking-label) text-ink-3",children:"Proposed comment"}),(0,t.jsx)("pre",{className:"max-h-48 overflow-auto rounded-lg border border-line/60 bg-bg-3/50 px-3.5 py-3 font-mono text-xs leading-5 text-ink-3 whitespace-pre-wrap",children:d})]})]})}n(C,"BoardApprovalPayloadContent");function J({type:e,payload:s,hidePrimaryTitle:r=!1}){return e==="hire_agent"?(0,t.jsx)(w,{payload:s}):e==="budget_override_required"?(0,t.jsx)(y,{payload:s}):e==="request_board_approval"?(0,t.jsx)(P,{payload:s,hideTitle:r}):(0,t.jsx)(S,{payload:s})}n(J,"ApprovalPayloadRenderer");export{H as a,F as i,I as n,N as o,A as r,J as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var _=Object.defineProperty;var s=(a,r)=>_(a,"name",{value:r,configurable:!0});import{i as b}from"./rolldown-runtime-ZpX3ckPj.js";import{l as C,na as E,ta as F}from"./createLucideIcon-B-uEJvX6.js";import{h as P}from"./star-BXywPGTx.js";import{X as S,_ as j,t as o,v as h}from"./queryKeys-yuC-YxZI.js";import{n as k}from"./CompanyContext-DDgccGSs.js";import{o as w}from"./router-2HX_SyKK.js";import{t as B}from"./tabs-BP71y3CO.js";import{t as K}from"./shield-check-EFhQ8TuB.js";import{t as M}from"./badge-Dz4tmpgp.js";import{t as Q}from"./agents-DjsXf9UL.js";import{n as T}from"./BreadcrumbContext-_dNLeVnD.js";import{da as m,oi as I,v as L}from"./index-
|
|
1
|
+
var _=Object.defineProperty;var s=(a,r)=>_(a,"name",{value:r,configurable:!0});import{i as b}from"./rolldown-runtime-ZpX3ckPj.js";import{l as C,na as E,ta as F}from"./createLucideIcon-B-uEJvX6.js";import{h as P}from"./star-BXywPGTx.js";import{X as S,_ as j,t as o,v as h}from"./queryKeys-yuC-YxZI.js";import{n as k}from"./CompanyContext-DDgccGSs.js";import{o as w}from"./router-2HX_SyKK.js";import{t as B}from"./tabs-BP71y3CO.js";import{t as K}from"./shield-check-EFhQ8TuB.js";import{t as M}from"./badge-Dz4tmpgp.js";import{t as Q}from"./agents-DjsXf9UL.js";import{n as T}from"./BreadcrumbContext-_dNLeVnD.js";import{da as m,oi as I,v as L}from"./index-CSIXA5y5.js";import{t as $}from"./ApprovalCard-B1Fs4K4S.js";var q=b(E(),1),t=b(F(),1);function te(){const{selectedCompanyId:a}=k(),{setBreadcrumbs:r}=T(),u=S(),g=w(),l=(P().pathname.split("/").pop()??"pending")==="all"?"all":"pending",[x,i]=(0,q.useState)(null);(0,q.useEffect)(()=>{r([{label:"Approvals"}])},[r]);const{data:v,isLoading:A,error:f}=h({queryKey:o.approvals.list(a),queryFn:s(()=>m.list(a),"queryFn"),enabled:!!a}),{data:N}=h({queryKey:o.agents.list(a),queryFn:s(()=>Q.list(a),"queryFn"),enabled:!!a}),p=j({mutationFn:s(e=>m.approve(e),"mutationFn"),onSuccess:s((e,n)=>{i(null),u.invalidateQueries({queryKey:o.approvals.list(a)}),g(`/approvals/${n}?resolved=approved`)},"onSuccess"),onError:s(e=>{i(e instanceof Error?e.message:"Failed to approve")},"onError")}),d=j({mutationFn:s(e=>m.reject(e),"mutationFn"),onSuccess:s(()=>{i(null),u.invalidateQueries({queryKey:o.approvals.list(a)})},"onSuccess"),onError:s(e=>{i(e instanceof Error?e.message:"Failed to reject")},"onError")}),c=(v??[]).filter(e=>l==="all"||e.status==="pending"||e.status==="revision_requested").sort((e,n)=>new Date(n.createdAt).getTime()-new Date(e.createdAt).getTime()),y=(v??[]).filter(e=>e.status==="pending"||e.status==="revision_requested").length;return a?A?(0,t.jsx)(L,{variant:"approvals"}):(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("div",{className:"flex items-center justify-between",children:(0,t.jsx)(B,{value:l,onValueChange:s(e=>g(`/approvals/${e}`),"onValueChange"),children:(0,t.jsx)(I,{items:[{value:"pending",label:(0,t.jsxs)(t.Fragment,{children:["Pending",y>0&&(0,t.jsx)(M,{variant:"ghost",className:C("ml-1.5 px-1.5 text-(length:--text-nano)","bg-yellow-500/20 text-yellow-500"),children:y})]})},{value:"all",label:"All"}]})})}),f&&(0,t.jsx)("p",{className:"text-sm text-bad",children:f.message}),x&&(0,t.jsx)("p",{className:"text-sm text-bad",children:x}),c.length===0&&(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[(0,t.jsx)(K,{className:"h-8 w-8 text-ink-3/30 mb-3"}),(0,t.jsx)("p",{className:"text-sm text-ink-3",children:l==="pending"?"No pending approvals.":"No approvals yet."})]}),c.length>0&&(0,t.jsx)("div",{className:"grid gap-3",children:c.map(e=>(0,t.jsx)($,{approval:e,requesterAgent:e.requestedByAgentId?(N??[]).find(n=>n.id===e.requestedByAgentId)??null:null,onApprove:s(()=>p.mutate(e.id),"onApprove"),onReject:s(()=>d.mutate(e.id),"onReject"),detailLink:`/approvals/${e.id}`,isPending:p.isPending||d.isPending,pendingAction:p.isPending?"approve":d.isPending?"reject":null},e.id))})]}):(0,t.jsx)("p",{className:"text-sm text-ink-3",children:"Select an organization first."})}s(te,"Approvals");export{te as Approvals};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var i=Object.defineProperty;var a=(t,r)=>i(t,"name",{value:r,configurable:!0});import{i as s}from"./rolldown-runtime-ZpX3ckPj.js";import{na as n,ta as o}from"./createLucideIcon-B-uEJvX6.js";import{n as m}from"./CompanyContext-DDgccGSs.js";import{n as c}from"./BreadcrumbContext-_dNLeVnD.js";import{t as l}from"./ReviewQueueCard-
|
|
1
|
+
var i=Object.defineProperty;var a=(t,r)=>i(t,"name",{value:r,configurable:!0});import{i as s}from"./rolldown-runtime-ZpX3ckPj.js";import{na as n,ta as o}from"./createLucideIcon-B-uEJvX6.js";import{n as m}from"./CompanyContext-DDgccGSs.js";import{n as c}from"./BreadcrumbContext-_dNLeVnD.js";import{t as l}from"./ReviewQueueCard-rQxgVMx_.js";var p=s(n(),1),e=s(o(),1);function w(){const{selectedCompanyId:t}=m(),{setBreadcrumbs:r}=c();return(0,p.useEffect)(()=>(r([{label:"Connectors",href:"/apps"},{label:"Review"}]),()=>r([])),[r]),t?(0,e.jsxs)("div",{className:"max-w-3xl space-y-6 pb-12",children:[(0,e.jsxs)("header",{children:[(0,e.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:"Review"}),(0,e.jsx)("p",{className:"mt-1 text-sm text-ink-3",children:"Actions your agents want to run that need your OK first. Approve, always-allow, or decline."})]}),(0,e.jsx)(l,{emptyState:"reassure",heading:"Waiting for your OK"})]}):(0,e.jsx)("div",{className:"p-6 text-sm text-ink-3",children:"Select an organization to review approvals."})}a(w,"AppsReview");export{w as AppsReview};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var B=Object.defineProperty;var n=(e,a)=>B(e,"name",{value:a,configurable:!0});import{i as F}from"./rolldown-runtime-ZpX3ckPj.js";import{l as C,m as I,na as K,t as $,ta as X}from"./createLucideIcon-B-uEJvX6.js";import{t as q,zt as P}from"./router-2HX_SyKK.js";import{t as G}from"./check-DtcbYVEc.js";import{t as V}from"./copy-B55HyIrd.js";import{t as H}from"./external-link-CxXijrsp.js";import{t as D}from"./play-BEx2fnvh.js";import{t as Q}from"./attachment-icon-ML6IBayL.js";import{t as J}from"./use-copy-action-DTcJkzd7.js";import{eo as A}from"./index-
|
|
1
|
+
var B=Object.defineProperty;var n=(e,a)=>B(e,"name",{value:a,configurable:!0});import{i as F}from"./rolldown-runtime-ZpX3ckPj.js";import{l as C,m as I,na as K,t as $,ta as X}from"./createLucideIcon-B-uEJvX6.js";import{t as q,zt as P}from"./router-2HX_SyKK.js";import{t as G}from"./check-DtcbYVEc.js";import{t as V}from"./copy-B55HyIrd.js";import{t as H}from"./external-link-CxXijrsp.js";import{t as D}from"./play-BEx2fnvh.js";import{t as Q}from"./attachment-icon-ML6IBayL.js";import{t as J}from"./use-copy-action-DTcJkzd7.js";import{eo as A}from"./index-CSIXA5y5.js";var W="document",Y=80,Z={markdown:"md",html:"html",json:"json",text:"txt"};function ee(e){return e.normalize("NFKD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,Y).replace(/-+$/g,"")||W}n(ee,"documentExportSlug");function te(e){return Z[(e??"").trim().toLowerCase()]??"md"}n(te,"documentExportExtension");function L(e,a){const r=a.replace(/^\.+/,"").toLowerCase()||"md";return`${ee(e)}.${r}`}n(L,"documentExportFileName");var R={name:"file-down",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]};R.node;var ne=$(R),l=F(K(),1);function S(e,a){const r=URL.createObjectURL(a),o=document.createElement("a");o.href=r,o.download=e,o.rel="noreferrer",o.style.display="none",document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(r)}n(S,"downloadBlob");function ae(e,a,r){S(e,new Blob([a],{type:`${r};charset=utf-8`}))}n(ae,"downloadTextFile");var t=F(X(),1),k="flex h-7 w-7 items-center justify-center rounded-md text-ink-3 transition-colors hover:bg-bg-3 hover:text-ink disabled:opacity-50";function re({issueId:e,documentKey:a,title:r,format:o,body:m,className:x}){const[i,c]=(0,l.useState)(null),[f,h]=(0,l.useState)(null),[j,d]=(0,l.useState)(null),{copy:u,copied:p,failed:w}=J(),v=(0,l.useRef)(void 0);(0,l.useEffect)(()=>()=>clearTimeout(v.current),[]);const T=(0,l.useCallback)(async(s,y)=>{c(s),d(null);try{await y(),h(s)}catch(E){h(null),d(E instanceof Error?E.message:"Export failed")}finally{c(null)}clearTimeout(v.current),v.current=setTimeout(()=>{h(null),d(null)},2e3)},[]),N=(0,l.useCallback)(async()=>m??(await P.getDocument(e,a)).body,[m,a,e]),M=(0,l.useCallback)(()=>{c("copy"),d(null),(async()=>{try{await u(await N())==="failed"&&d("Copy failed")}catch(s){d(s instanceof Error?s.message:"Copy failed")}finally{c(null)}})()},[u,N]),O=w||j==="Copy failed"?"Copy failed":p?"Copied!":"Copy full content",U=f==="download"?"Downloaded!":"Download source",z=f==="pdf"?"Downloaded!":"Export to PDF";return(0,t.jsxs)("div",{className:C("flex items-center gap-0.5",x),"data-testid":"document-export-actions",children:[(0,t.jsx)("button",{type:"button",className:k,disabled:i!==null,"aria-label":"Copy full content",title:O,"data-testid":"document-export-copy",onClick:n(s=>{s.preventDefault(),s.stopPropagation(),M()},"onClick"),children:p?(0,t.jsx)(G,{"aria-hidden":"true",className:"h-3.5 w-3.5"}):(0,t.jsx)(V,{"aria-hidden":"true",className:"h-3.5 w-3.5"})}),(0,t.jsx)("button",{type:"button",className:k,disabled:i!==null,"aria-label":"Download source",title:U,"data-testid":"document-export-download",onClick:n(s=>{s.preventDefault(),s.stopPropagation(),T("download",async()=>{const y=te(o);ae(L(r,y),await N(),y==="md"?"text/markdown":"text/plain")})},"onClick"),children:(0,t.jsx)(A,{"aria-hidden":"true",className:"h-3.5 w-3.5"})}),(0,t.jsx)("button",{type:"button",className:k,disabled:i!==null,"aria-label":"Export to PDF",title:z,"data-testid":"document-export-pdf",onClick:n(s=>{s.preventDefault(),s.stopPropagation(),T("pdf",async()=>{S(L(r,"pdf"),await P.getDocumentPdf(e,a))})},"onClick"),children:(0,t.jsx)(ne,{"aria-hidden":"true",className:"h-3.5 w-3.5"})}),(0,t.jsx)("span",{className:"sr-only",role:"status","aria-live":"polite",children:j??(p?"Copied!":w?"Copy failed":f?"Downloaded!":"")})]})}n(re,"DocumentExportActions");function b({children:e,className:a}){return(0,t.jsx)("div",{className:C("relative aspect-video w-full overflow-hidden bg-bg-3/20",a),children:e})}n(b,"PreviewFrame");function g({label:e}){return(0,t.jsx)(b,{className:"flex items-center justify-center",children:(0,t.jsxs)("div",{className:"flex flex-col items-center gap-1.5 text-ink-3/50",children:[(0,t.jsx)(Q,{className:"h-7 w-7","aria-hidden":"true"}),e?(0,t.jsx)("span",{className:"text-(length:--text-micro) font-medium uppercase tracking-wide",children:e}):null]})})}n(g,"PlaceholderPreview");function oe({artifact:e}){const[a,r]=(0,l.useState)(!1);return a||!e.contentPath?(0,t.jsx)(g,{label:"Image"}):(0,t.jsx)(b,{children:(0,t.jsx)("img",{src:e.contentPath,alt:e.title,loading:"lazy",className:"h-full w-full object-cover",onError:n(()=>r(!0),"onError")})})}n(oe,"ImagePreview");function se({artifact:e}){const[a,r]=(0,l.useState)(!1),[o,m]=(0,l.useState)(!1),x=(0,l.useRef)(!1),i=(0,l.useRef)(null);if((0,l.useEffect)(()=>()=>{i.current!==null&&window.clearTimeout(i.current)},[]),a||!e.contentPath)return(0,t.jsx)(b,{className:"flex items-center justify-center bg-black/80",children:(0,t.jsx)("div",{className:"flex h-11 w-11 items-center justify-center rounded-full bg-white/15",children:(0,t.jsx)(D,{className:"h-5 w-5 translate-x-0.5 text-white","aria-hidden":"true"})})});const c=n(()=>{i.current!==null&&(window.clearTimeout(i.current),i.current=null),m(!0)},"markFrameReady"),f=n(()=>{i.current!==null&&window.clearTimeout(i.current),i.current=window.setTimeout(c,3e3)},"scheduleFrameReadyFallback"),h=n(d=>{if(x.current)return;x.current=!0;const u=d.currentTarget,p=Number.isFinite(u.duration)&&u.duration>0?u.duration:0,w=p>0?Math.min(1,p/4):.05;try{Math.abs(u.currentTime-w)>.001?(u.currentTime=w,f()):c()}catch{c()}},"loadThumbnailFrame"),j=n(d=>{(x.current||d.currentTarget.currentTime>0)&&c()},"handleLoadedData");return(0,t.jsxs)(b,{className:"bg-black",children:[(0,t.jsx)("video",{src:e.contentPath,preload:"metadata",muted:!0,playsInline:!0,"data-frame-ready":o?"true":"false",className:C("h-full w-full object-contain transition-opacity",o?"opacity-100":"opacity-0"),onLoadedMetadata:h,onLoadedData:j,onSeeked:c,onError:n(()=>r(!0),"onError")}),(0,t.jsx)("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:(0,t.jsx)("div",{className:"flex h-11 w-11 items-center justify-center rounded-full bg-black/55",children:(0,t.jsx)(D,{className:"h-5 w-5 translate-x-0.5 text-white","aria-hidden":"true"})})})]})}n(se,"VideoPreview");function le({artifact:e}){const a=e.previewText?.trim();return a?(0,t.jsxs)(b,{className:"bg-bg-2",children:[(0,t.jsx)("div",{className:"absolute inset-0 overflow-hidden p-3",children:(0,t.jsx)("p",{className:"max-h-full overflow-hidden whitespace-pre-wrap break-words text-base leading-6 text-ink-3/75",children:a})}),(0,t.jsx)("div",{className:"pointer-events-none absolute bottom-0 left-0 right-0 h-10 bg-gradient-to-t from-bg-2 to-transparent"})]}):(0,t.jsx)(g,{label:e.source==="document"?"Document":"Text"})}n(le,"TextPreview");function ie({artifact:e}){switch(e.mediaKind){case"image":return(0,t.jsx)(oe,{artifact:e},e.contentPath);case"video":return(0,t.jsx)(se,{artifact:e},e.contentPath);case"text":case"document":return(0,t.jsx)(le,{artifact:e});case"file":return(0,t.jsx)(g,{label:"File"});default:return(0,t.jsx)(g,{})}}n(ie,"ArtifactPreview");function _({href:e,download:a,title:r,children:o}){return(0,t.jsx)("a",{href:e,...a?{download:""}:{target:"_blank",rel:"noreferrer"},title:r,"aria-label":r,onClick:n(m=>m.stopPropagation(),"onClick"),className:"flex h-7 w-7 items-center justify-center rounded-md text-ink-3 transition-colors hover:bg-bg-3 hover:text-ink",children:o})}n(_,"SecondaryAction");function ye({artifact:e}){return(0,t.jsxs)(q,{to:e.href,disableIssueQuicklook:!0,"data-testid":"artifact-card","data-media-kind":e.mediaKind,className:"group flex flex-col overflow-hidden rounded-lg border border-line bg-bg-2 cursor-pointer transition-colors hover:border-ink/20 hover:shadow-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus",children:[(0,t.jsx)(ie,{artifact:e}),(0,t.jsxs)("div",{className:"flex flex-1 flex-col gap-1 p-3",children:[(0,t.jsxs)("div",{className:"flex h-7 items-start justify-between gap-2",children:[(0,t.jsx)("h3",{className:"min-w-0 flex-1 truncate text-sm font-medium leading-7 text-ink/85",title:e.title,children:e.title}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-0.5 opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100",children:[e.source==="document"&&e.documentKey?(0,t.jsx)(re,{issueId:e.issue.id,documentKey:e.documentKey,title:e.title}):null,e.openPath?(0,t.jsx)(_,{href:e.openPath,title:"Open file in new tab",children:(0,t.jsx)(H,{className:"h-3.5 w-3.5"})}):null,e.downloadPath?(0,t.jsx)(_,{href:e.downloadPath,download:!0,title:"Download file",children:(0,t.jsx)(A,{className:"h-3.5 w-3.5"})}):null]})]}),(0,t.jsxs)("div",{className:"mt-0.5 flex items-center gap-1.5 text-(length:--text-micro) text-ink-3/65",children:[(0,t.jsxs)("span",{children:["Last edited ",I(e.updatedAt)]}),e.createdByAgent?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-ink-3/50",children:"·"}),(0,t.jsx)("span",{className:"truncate",children:e.createdByAgent.name})]}):null]})]})]})}n(ye,"ArtifactCard");export{ie as n,re as r,ye as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var X=Object.defineProperty;var n=(a,l)=>X(a,"name",{value:l,configurable:!0});import{i as G}from"./rolldown-runtime-ZpX3ckPj.js";import{l as M,m as Z,na as J,ta as W}from"./createLucideIcon-B-uEJvX6.js";import{y as Y}from"./star-BXywPGTx.js";import{t as ee}from"./queryKeys-yuC-YxZI.js";import{t as te}from"./useInfiniteQuery-KaGSl9U6.js";import{n as ae,t as se}from"./ArtifactCard-
|
|
1
|
+
var X=Object.defineProperty;var n=(a,l)=>X(a,"name",{value:l,configurable:!0});import{i as G}from"./rolldown-runtime-ZpX3ckPj.js";import{l as M,m as Z,na as J,ta as W}from"./createLucideIcon-B-uEJvX6.js";import{y as Y}from"./star-BXywPGTx.js";import{t as ee}from"./queryKeys-yuC-YxZI.js";import{t as te}from"./useInfiniteQuery-KaGSl9U6.js";import{n as ae,t as se}from"./ArtifactCard-B9GVJfR3.js";import{n as re}from"./CompanyContext-DDgccGSs.js";import{t as D,tt as N}from"./router-2HX_SyKK.js";import{a as ie,i as ne,p as le,r as ce,t as oe}from"./dropdown-menu-BdCU_bAX.js";import{t as de}from"./arrow-left-DbEq2ZQa.js";import{t as ue}from"./check-DtcbYVEc.js";import{t as E}from"./package-CtAS5cQ_.js";import{t as me}from"./button-D3bYvq4T.js";import{t as fe}from"./search-oKGByIam.js";import{t as xe}from"./x-hMw21ejo.js";import{t as pe}from"./badge-Dz4tmpgp.js";import{t as he}from"./input-It0utqV7.js";import{n as ge}from"./BreadcrumbContext-_dNLeVnD.js";import{E as L,v as be}from"./index-CSIXA5y5.js";import{t as ve}from"./artifacts-CVWeUMom.js";var r=G(J(),1),t=G(W(),1);function ke({group:a,to:l}){const c=a.count>1,m=a.previewArtifacts[0],u=`${a.count} artifact${a.count===1?"":"s"}`;return(0,t.jsxs)("div",{className:"relative",children:[c?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{"aria-hidden":"true","data-testid":"artifact-stack-layer",className:"pointer-events-none absolute inset-0 translate-x-(--sz-8px) translate-y-(--sz-8px) rounded-lg border border-line bg-bg-3/70"}),(0,t.jsx)("div",{"aria-hidden":"true","data-testid":"artifact-stack-layer",className:"pointer-events-none absolute inset-0 translate-x-(--sz-4px) translate-y-(--sz-4px) rounded-lg border border-line bg-bg-3/40"})]}):null,(0,t.jsxs)(D,{to:l,title:u,"data-testid":"artifact-group-card","data-group-id":a.id,"data-count":a.count,"data-stacked":c?"true":"false",className:"group relative flex flex-col overflow-hidden rounded-lg border border-line bg-bg-2 cursor-pointer transition-colors hover:border-ink/20 hover:shadow-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus",children:[(0,t.jsxs)("div",{className:"relative",children:[m?(0,t.jsx)(ae,{artifact:m}):(0,t.jsx)("div",{className:"flex aspect-video w-full items-center justify-center bg-bg-3/20 text-ink-3/50",children:(0,t.jsx)(N,{className:"h-7 w-7","aria-hidden":"true"})}),(0,t.jsxs)(pe,{variant:"ghost",className:"absolute right-2 top-2 bg-bg/85 text-(length:--text-micro) text-ink/90 shadow-sm backdrop-blur",children:[(0,t.jsx)(N,{className:"h-3 w-3","aria-hidden":"true"}),a.count]})]}),(0,t.jsxs)("div",{className:"flex flex-1 flex-col gap-1 p-3",children:[(0,t.jsxs)("div",{className:"flex h-7 items-center gap-2",children:[(0,t.jsx)("span",{className:"shrink-0 font-mono text-(length:--text-micro) text-ink-3",children:a.issue.identifier}),(0,t.jsx)("h3",{className:"min-w-0 flex-1 truncate text-sm font-medium leading-7 text-ink/85",title:a.title,children:a.title})]}),(0,t.jsxs)("div",{className:"mt-0.5 flex items-center gap-1.5 text-(length:--text-micro) text-ink-3/65",children:[(0,t.jsx)("span",{children:u}),(0,t.jsx)("span",{className:"text-ink-3/50",children:"·"}),(0,t.jsxs)("span",{children:["Updated ",Z(a.updatedAt)]})]})]})]})]})}n(ke,"ArtifactGroupCard");var je=30,Ne=250,F=[{value:"all",label:"All"},{value:"image",label:"Images"},{value:"video",label:"Videos"},{value:"document",label:"Documents"},{value:"text",label:"Text"},{value:"file",label:"Files"}],R=[{value:"none",label:"None"},{value:"task",label:"Task"},{value:"parent_task",label:"Parent task"}],ye=new Set(F.map(a=>a.value));function we(a){return a==="none"||a==="task"||a==="parent_task"?a:"task"}n(we,"parseGroupBy");function Se(a){return a&&ye.has(a)?a:"all"}n(Se,"parseKind");function Ie(a){return R.find(l=>l.value===a)?.label??"None"}n(Ie,"artifactGroupByLabel");function He(){const{selectedCompanyId:a}=re(),{setBreadcrumbs:l}=ge(),[c,m]=Y(),u=Se(c.get("kind")),o=c.get("q")??"",i=we(c.get("groupBy")),h=c.get("groupIssueId")??void 0,[g,y]=(0,r.useState)(o),C=(0,r.useRef)(null),w=i!=="none",q=w&&!h,b=w&&!!h;(0,r.useEffect)(()=>{y(e=>e.trim()===o?e:o)},[o]),(0,r.useEffect)(()=>{const e=g.trim();if(e===o)return;const s=window.setTimeout(()=>{m(d=>{const p=new URLSearchParams(d);return e?p.set("q",e):p.delete("q"),p},{replace:!0})},Ne);return()=>window.clearTimeout(s)},[g,o,m]);const v=(0,r.useCallback)(e=>{m(s=>{const d=new URLSearchParams(s);return e(d),d})},[m]),$=(0,r.useCallback)(e=>{v(s=>{e==="all"?s.delete("kind"):s.set("kind",e)})},[v]),U=(0,r.useCallback)(e=>{v(s=>{s.delete("groupIssueId"),e==="task"?s.delete("groupBy"):s.set("groupBy",e)})},[v]),k=(0,r.useCallback)(e=>{const s=new URLSearchParams(c);e(s);const d=s.toString();return d?`?${d}`:"?"},[c]),z=(0,r.useCallback)(e=>k(s=>{i==="task"?s.delete("groupBy"):i!=="none"&&s.set("groupBy",i),s.set("groupIssueId",e)}),[k,i]),K=(0,r.useMemo)(()=>k(e=>{i==="task"&&e.delete("groupBy"),e.delete("groupIssueId")}),[k,i]),{data:x,isLoading:O,isFetching:Q,isFetchingNextPage:S,hasNextPage:I,fetchNextPage:A,error:P}=te({queryKey:ee.artifacts.list(a,u,o,i,h),queryFn:n(({pageParam:e})=>ve.list(a,{kind:u,q:o||void 0,groupBy:i,groupIssueId:h,limit:je,cursor:e}),"queryFn"),enabled:!!a,initialPageParam:void 0,getNextPageParam:n(e=>e.nextCursor??void 0,"getNextPageParam")});(0,r.useEffect)(()=>{const e=C.current;if(!e||!I||S)return;const s=new IntersectionObserver(d=>{d.some(p=>p.isIntersecting)&&A()},{rootMargin:"320px 0px"});return s.observe(e),()=>s.disconnect()},[A,I,S]);const _=(0,r.useMemo)(()=>x?.pages.flatMap(e=>e.artifacts)??[],[x]),T=(0,r.useMemo)(()=>x?.pages.flatMap(e=>e.groups??[])??[],[x]),f=(0,r.useMemo)(()=>x?.pages.map(e=>e.selectedGroup).find(Boolean)??null,[x]),B=o.length>0;if((0,r.useEffect)(()=>{l(b&&f?[{label:"Artifacts",href:"/artifacts"},{label:`${f.issue.identifier} · ${f.title}`}]:[{label:"Artifacts"}])},[l,b,f]),!a)return(0,t.jsx)(L,{icon:E,message:"Select an organization to view artifacts."});const j=q,V=j?T:_,H=j?B?"No artifact stacks match this search.":"No artifact stacks yet.":B?"No artifacts match this search.":b?"No artifacts in this stack match the current filters.":u==="all"?"No artifacts yet. Outputs attached to issues will appear here.":"No artifacts of this type yet.";return(0,t.jsxs)("div",{className:"w-full max-w-6xl space-y-5",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,t.jsxs)("div",{className:"relative w-full sm:max-w-sm",children:[(0,t.jsx)(fe,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-ink-3"}),(0,t.jsx)(he,{value:g,onChange:n(e=>y(e.currentTarget.value),"onChange"),placeholder:"Search artifacts...","aria-label":"Search artifacts",className:"h-9 pl-9 pr-9 text-sm"}),g.length>0?(0,t.jsx)("button",{type:"button",onClick:n(()=>y(""),"onClick"),"aria-label":"Clear artifact search",className:"absolute right-2 top-1/2 inline-flex h-6 w-6 -translate-y-1/2 items-center justify-center rounded text-ink-3 transition-colors hover:bg-bg-3/50 hover:text-ink",children:(0,t.jsx)(xe,{className:"h-3.5 w-3.5"})}):null]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,t.jsxs)(oe,{children:[(0,t.jsx)(le,{asChild:!0,children:(0,t.jsx)(me,{active:w,type:"button",variant:"secondary",size:"icon","aria-label":`Group artifacts (currently ${Ie(i)})`,title:"Group artifacts","data-testid":"artifact-group-control","data-group-by":i,className:M("h-8 w-8 shrink-0"),children:(0,t.jsx)(N,{className:"h-3.5 w-3.5","aria-hidden":"true"})})}),(0,t.jsxs)(ce,{align:"end",className:"w-44",children:[(0,t.jsx)(ie,{children:"Group by"}),R.map(e=>(0,t.jsxs)(ne,{"data-testid":`artifact-group-option-${e.value}`,"aria-selected":i===e.value,onSelect:n(()=>U(e.value),"onSelect"),className:"justify-between",children:[e.label,i===e.value?(0,t.jsx)(ue,{className:"h-3.5 w-3.5"}):null]},e.value))]})]}),(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-1.5",role:"tablist","aria-label":"Filter artifacts by type",children:F.map(e=>(0,t.jsx)("button",{type:"button",role:"tab","aria-selected":u===e.value,onClick:n(()=>$(e.value),"onClick"),className:M("rounded-md px-2.5 py-1 text-xs font-medium transition-colors",u===e.value?"bg-bg-3 text-ink":"text-ink-3 hover:bg-bg-3/50 hover:text-ink"),children:e.label},e.value))})]})]}),b?(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[(0,t.jsxs)(D,{to:K,"data-testid":"artifact-stack-back",className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs font-medium text-ink-3 transition-colors hover:bg-bg-3/50 hover:text-ink",children:[(0,t.jsx)(de,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"All stacks"]}),f?(0,t.jsxs)("span",{className:"truncate text-ink-3",children:[(0,t.jsx)("span",{className:"text-ink/80",children:f.issue.identifier})," ",f.title]}):null]}):null,P&&(0,t.jsx)("p",{className:"text-sm text-bad",children:P.message}),O?(0,t.jsx)(be,{variant:"list"}):V.length===0?(0,t.jsx)(L,{icon:j?N:E,message:H}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-2 xl:grid-cols-3",children:j?T.map(e=>(0,t.jsx)(ke,{group:e,to:z(e.issue.id)},e.id)):_.map(e=>(0,t.jsx)(se,{artifact:e},`${e.source}:${e.id}`))}),(0,t.jsx)("div",{ref:C,className:"flex min-h-10 items-center justify-center pb-2 text-xs text-ink-3",children:S?"Loading more artifacts...":I?null:Q?"Updating artifacts...":null})]})]})}n(He,"Artifacts");export{He as Artifacts};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var $=Object.defineProperty;var a=(s,t)=>$(s,"name",{value:t,configurable:!0});import{i as w}from"./rolldown-runtime-ZpX3ckPj.js";import{ft as O,l as v,na as R,pt as E,ta as L,ut as F}from"./createLucideIcon-B-uEJvX6.js";import{X as W,_ as B,n as N,r as f,v as S}from"./queryKeys-yuC-YxZI.js";import{n as z}from"./CompanyContext-DDgccGSs.js";import{at as K,t as k}from"./router-2HX_SyKK.js";import{i as Q,r as H,t as Y}from"./tabs-BP71y3CO.js";import{t as D}from"./check-DtcbYVEc.js";import{t as V}from"./copy-B55HyIrd.js";import{t as G}from"./external-link-CxXijrsp.js";import{t as d}from"./button-D3bYvq4T.js";import{t as X}from"./plug-C6x6irKg.js";import{t as J}from"./terminal-CPu3HVdk.js";import{t as A}from"./MootMark-JzjkztPD.js";import{n as I,t as T}from"./Identity-J7JnIwUT.js";import{n as Z}from"./BreadcrumbContext-_dNLeVnD.js";import{t as ee}from"./clipboard-CTLKYvRL.js";import{t as se}from"./AgentSetupPrompt-kYvr8COH.js";import{ci as te}from"./index-DbENFODe.js";import{n as j}from"./connection-owner-EECE9Eiz.js";var u=w(R(),1),g={setup:a(()=>f.get("/mcp/setup"),"setup"),connections:a(()=>f.get("/mcp/connections"),"connections"),revoke:a(s=>f.delete(`/mcp/connections/${encodeURIComponent(s)}`),"revoke")},e=w(L(),1);function ne({className:s}){return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("img",{src:"/brands/opencode-logo-light-square.svg",alt:"OpenCode",className:v("dark:hidden",s)}),(0,e.jsx)("img",{src:"/brands/opencode-logo-dark-square.svg",alt:"OpenCode",className:v("hidden dark:block",s)})]})}a(ne,"OpenCodeLogoIcon");var ae="/apps/assistant-connection",b=["mcp-connections"],y=F;function ie({assistant:s}){return s==="codex"||s==="claude"?(0,e.jsx)("img",{src:`/brands/${s}-color.svg`,alt:"",className:"size-4 shrink-0"}):s==="opencode"?(0,e.jsx)("span",{"aria-hidden":"true",className:"inline-flex shrink-0",children:(0,e.jsx)(ne,{className:"size-4"})}):(0,e.jsx)(s==="browser"?K:s==="headless"?J:X,{className:"size-4","aria-hidden":"true"})}a(ie,"AssistantIcon");function P(s=!1){const{selectedCompanyId:t}=z(),i=S({queryKey:b,queryFn:g.connections,retry:!1,enabled:!!t,refetchInterval:s?5e3:!1});return{...i,rows:(i.data??[]).filter(r=>r.companyId===t&&!r.revokedAt&&!r.scopes.includes("wardmote:agent"))}}a(P,"useAssistantConnections");function Ae({onNavigate:s}){const t=P(),i=t.rows,r=t.isSuccess?i.length?"Manage":"Set up":"Open";return(0,e.jsxs)("div",{role:"listitem","data-app-slug":"assistant-connection","data-connected":t.isSuccess?String(i.length>0):void 0,className:"overflow-hidden rounded-xl border border-line",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-3 px-4 py-4",children:[(0,e.jsx)(A,{className:"size-9 shrink-0 p-1 text-ink","aria-hidden":"true"}),(0,e.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,e.jsx)("h2",{className:"text-sm font-semibold text-ink",children:"Assistant Connection (MCP)"}),(0,e.jsx)("p",{className:"mt-0.5 text-xs text-ink-3",children:"Use your Wardmote organization from Codex, Claude, OpenCode, or another assistant."})]}),(0,e.jsx)(d,{type:"button",size:"sm",variant:"secondary",onClick:a(()=>s(ae),"onClick"),"aria-label":`${r} Assistant Connection (MCP)`,children:r})]}),t.isPending&&(0,e.jsx)("p",{className:"border-t border-line px-4 py-3 text-xs text-ink-3",children:"Checking your connection status…"}),t.isError&&(0,e.jsxs)("div",{role:"alert",className:"flex flex-wrap items-center justify-between gap-3 border-t border-line px-4 py-3",children:[(0,e.jsx)("p",{className:"text-xs text-bad",children:"Couldn’t load your connection status."}),(0,e.jsx)(d,{size:"sm",variant:"ghost",disabled:t.isFetching,onClick:a(()=>{t.refetch()},"onClick"),children:"Try again"})]}),t.isSuccess&&i.length>0&&(0,e.jsx)("div",{className:"flex flex-wrap items-center gap-2 border-t border-line px-4 py-3 text-sm",children:i.map(c=>(0,e.jsx)(T,{name:j(c),avatarUrl:c.user?.image,initials:I(c.user?.name??"You"),size:"sm"},c.id))})]})}a(Ae,"AssistantConnectionCard");function C({value:s,label:t}){const[i,r]=(0,u.useState)(!1),[c,o]=(0,u.useState)(!1);return(0,u.useEffect)(()=>{r(!1),o(!1)},[s]),(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsxs)("div",{className:"flex items-start gap-3 rounded-md border border-line bg-bg-3/30 p-3",children:[(0,e.jsx)("pre",{className:"min-w-0 flex-1 overflow-x-auto whitespace-pre-wrap break-words font-mono text-xs leading-relaxed",children:s}),(0,e.jsx)(d,{type:"button",variant:"ghost",size:"icon",className:"size-8 shrink-0","aria-label":`Copy ${t}`,onClick:a(async()=>{try{await ee(s),r(!0),o(!1)}catch{o(!0)}},"onClick"),children:i?(0,e.jsx)(D,{className:"size-4"}):(0,e.jsx)(V,{className:"size-4"})})]}),(0,e.jsx)("p",{role:"status",className:"text-xs text-ink-3",children:c?"Couldn’t copy. Select and copy the text above.":i?"Copied":null})]})}a(C,"CopyValue");function re(s){return s instanceof N&&s.status===401?"Sign in to connect an assistant. This requires a Wardmote instance with authenticated user accounts.":s instanceof N&&s.status===404?"Assistant connections need an authenticated instance with a public HTTPS URL. Ask your instance administrator to configure the public URL, then try again.":"Couldn’t load assistant setup. Try again in a moment."}a(re,"setupError");function Ie({initialAssistant:s="codex"}={}){const{selectedCompany:t,selectedCompanyId:i}=z(),{setBreadcrumbs:r}=Z(),c=W(),[o,_]=(0,u.useState)(s),l=S({queryKey:["mcp-setup"],queryFn:g.setup,retry:!1,refetchOnWindowFocus:"always",refetchOnMount:"always"}),m=P(l.data?.enabled===!0),x=B({mutationFn:g.revoke,onSuccess:a((n,p)=>(c.setQueryData(b,M=>M?.filter(U=>U.id!==p)),c.invalidateQueries({queryKey:b})),"onSuccess")});if((0,u.useEffect)(()=>(r([{label:"Connectors",href:"/apps"},{label:"Assistant Connection (MCP)"}]),()=>r([])),[r]),!i||!t)return(0,e.jsx)("p",{className:"text-sm text-ink-3",children:"Select an organization to connect an assistant."});const h=l.data?.serverUrl??"",q=h?O(h,{id:i,name:t.name}):"";return(0,e.jsxs)("div",{className:"max-w-3xl space-y-6 pb-8",children:[(0,e.jsxs)("header",{className:"space-y-4",children:[(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)(A,{className:"size-7 shrink-0 text-ink"}),(0,e.jsx)("h1",{className:"text-xl font-semibold",children:"Assistant Connection (MCP)"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)(te,{companyName:t.name,logoUrl:t.logoUrl,className:"size-12 shrink-0 rounded-lg"}),(0,e.jsxs)("div",{className:"space-y-1",children:[(0,e.jsx)("p",{className:"font-medium",children:t.name}),(0,e.jsx)("p",{className:"text-sm text-ink-3",children:"Connect your assistant to Wardmote. Review work, create tasks, and follow up using your account’s access to this organization."})]})]})]}),l.isPending&&(0,e.jsx)("p",{className:"text-sm text-ink-3",children:"Loading assistant setup…"}),l.error&&(0,e.jsxs)("div",{role:"alert",className:"space-y-3",children:[(0,e.jsx)("p",{className:"text-sm text-bad",children:re(l.error)}),(0,e.jsx)(d,{variant:"secondary",onClick:a(()=>{l.refetch()},"onClick"),children:"Try again"})]}),l.data&&!l.data.enabled&&(0,e.jsxs)("section",{className:"space-y-3 rounded-lg border border-line bg-bg-3/30 p-4",children:[(0,e.jsx)("h2",{className:"text-sm font-semibold",children:"Enable assistant connections"}),(0,e.jsx)("p",{className:"text-sm text-ink-3",children:"An instance administrator must turn on Assistant connections in Settings > Features. Then return here to connect your assistant."}),(0,e.jsx)(d,{variant:"secondary",asChild:!0,children:(0,e.jsx)(k,{to:"/company/settings/instance/features",children:"Open Features"})})]}),l.data?.enabled&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("section",{className:"space-y-4","aria-label":"Invite your assistant",children:[(0,e.jsx)("p",{className:"text-sm text-ink-3",children:"Paste this invitation into your assistant. It will help set up the connection and ask you to approve access in Wardmote."}),(0,e.jsx)("div",{className:"flex justify-end",children:(0,e.jsx)(se,{prompt:q,label:"Copy invitation",title:"Invite your assistant",description:"Paste this invitation into your assistant. It will help set up the connection and ask you to approve access in Wardmote.",side:"bottom",align:"end"})})]}),(0,e.jsxs)("details",{className:"space-y-4 text-sm",children:[(0,e.jsx)("summary",{className:"cursor-pointer text-ink-3",children:"Set up manually"}),(0,e.jsx)(Y,{value:o,onValueChange:a(n=>_(n),"onValueChange"),className:"min-w-0",children:(0,e.jsx)("div",{className:"overflow-x-auto overflow-y-hidden scrollbar-none border-b border-line",children:(0,e.jsx)(H,{variant:"line",className:"min-w-full justify-start","aria-label":"Assistant setup instructions",children:Object.entries(y).map(([n,p])=>(0,e.jsxs)(Q,{value:n,className:"flex-none",children:[(0,e.jsx)(ie,{assistant:n}),p]},n))})})}),(0,e.jsxs)("section",{className:"space-y-4","aria-label":`Set up ${y[o]}`,children:[E(h,o).map((n,p)=>(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)("p",{className:"text-sm text-ink-3",children:n.text}),n.code&&(0,e.jsx)(C,{value:n.code,label:`${y[o]} setup step ${p+1}`})]},`${o}-${p}`)),o!=="browser"&&(0,e.jsx)("p",{className:"text-sm text-ink-3",children:"Authorization commands wait for human approval. When using an assistant shell tool, keep the command running in a persistent terminal or background process, capture its output privately, and share the approval URL immediately while it is still running. Client callback deadlines still apply. If the command timed out or stopped, start a fresh authorization request before sharing a link. If the host cannot keep the command alive across turns, ask the user to run it in their own terminal."}),(0,e.jsxs)("p",{className:"text-sm",children:["Choose ",(0,e.jsx)("strong",{children:t.name}),", review access, then click ",(0,e.jsx)("strong",{children:"Connect organization"}),"."]}),(0,e.jsx)("p",{className:"text-xs text-ink-3",children:"Creating tasks and adding comments may start agent work using the organization’s configured execution budget."})]}),(0,e.jsx)(C,{value:h,label:"MCP server URL"})]})]}),(0,e.jsxs)("section",{className:"space-y-3","aria-labelledby":"connected-assistants",children:[(0,e.jsx)("h2",{id:"connected-assistants",className:"text-sm font-semibold",children:"Your connected assistants"}),m.isPending&&(0,e.jsx)("p",{className:"text-sm text-ink-3",children:"Loading connections…"}),(m.error||x.error)&&(0,e.jsxs)("p",{role:"alert",className:"text-sm text-bad",children:[x.error?"Couldn’t revoke this connection. Try again.":"Couldn’t load your connections. Try again."," ",(0,e.jsx)("button",{type:"button",className:"underline",onClick:a(()=>{m.refetch()},"onClick"),children:"Refresh"})]}),m.isSuccess&&m.rows.length===0&&(0,e.jsxs)("p",{className:"text-sm text-ink-3",children:["No assistants connected to ",t.name," yet."]}),(0,e.jsx)("div",{className:"divide-y divide-line",children:m.rows.map(n=>(0,e.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3 py-3",children:[(0,e.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,e.jsx)(T,{name:j(n),avatarUrl:n.user?.image,initials:I(n.user?.name??"You"),className:"font-medium"}),(0,e.jsx)("p",{className:"text-xs text-ink-3",children:`Connected as you · ${n.scopes.includes("wardmote:write")?"Read and write":"Read only"}${n.scopes.includes("wardmote:configure")?" · Configure agents, projects and skills":""}`})]}),(0,e.jsx)(d,{variant:"secondary",size:"sm",disabled:x.isPending,onClick:a(()=>x.mutate(n.id),"onClick"),"aria-label":`Revoke ${j(n)}`,children:"Revoke"})]},n.id))})]}),(0,e.jsxs)("footer",{className:"flex items-center justify-between gap-3 border-t border-line pt-4",children:[(0,e.jsx)(d,{variant:"ghost",asChild:!0,children:(0,e.jsx)(k,{to:"/apps",children:"Back to Connections"})}),(0,e.jsxs)("a",{className:"inline-flex items-center gap-1 text-xs text-ink-3 underline",href:o==="opencode"?"https://opencode.ai/docs/mcp-servers/":o==="claude"?"https://code.claude.com/docs/en/mcp":"https://developers.openai.com/codex/mcp",target:"_blank",rel:"noreferrer",children:["Setup documentation ",(0,e.jsx)(G,{className:"size-3"})]})]})]})}a(Ie,"AssistantConnection");export{Ie as AssistantConnection,Ae as AssistantConnectionCard,P as useAssistantConnections};
|
|
1
|
+
var $=Object.defineProperty;var a=(s,t)=>$(s,"name",{value:t,configurable:!0});import{i as w}from"./rolldown-runtime-ZpX3ckPj.js";import{ft as O,l as v,na as R,pt as E,ta as L,ut as F}from"./createLucideIcon-B-uEJvX6.js";import{X as W,_ as B,n as N,r as f,v as S}from"./queryKeys-yuC-YxZI.js";import{n as z}from"./CompanyContext-DDgccGSs.js";import{at as K,t as k}from"./router-2HX_SyKK.js";import{i as Q,r as H,t as Y}from"./tabs-BP71y3CO.js";import{t as D}from"./check-DtcbYVEc.js";import{t as V}from"./copy-B55HyIrd.js";import{t as G}from"./external-link-CxXijrsp.js";import{t as d}from"./button-D3bYvq4T.js";import{t as X}from"./plug-C6x6irKg.js";import{t as J}from"./terminal-CPu3HVdk.js";import{t as A}from"./MootMark-JzjkztPD.js";import{n as I,t as T}from"./Identity-J7JnIwUT.js";import{n as Z}from"./BreadcrumbContext-_dNLeVnD.js";import{t as ee}from"./clipboard-CTLKYvRL.js";import{t as se}from"./AgentSetupPrompt-kYvr8COH.js";import{ci as te}from"./index-CSIXA5y5.js";import{n as j}from"./connection-owner-qWfs2q4d.js";var u=w(R(),1),g={setup:a(()=>f.get("/mcp/setup"),"setup"),connections:a(()=>f.get("/mcp/connections"),"connections"),revoke:a(s=>f.delete(`/mcp/connections/${encodeURIComponent(s)}`),"revoke")},e=w(L(),1);function ne({className:s}){return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("img",{src:"/brands/opencode-logo-light-square.svg",alt:"OpenCode",className:v("dark:hidden",s)}),(0,e.jsx)("img",{src:"/brands/opencode-logo-dark-square.svg",alt:"OpenCode",className:v("hidden dark:block",s)})]})}a(ne,"OpenCodeLogoIcon");var ae="/apps/assistant-connection",b=["mcp-connections"],y=F;function ie({assistant:s}){return s==="codex"||s==="claude"?(0,e.jsx)("img",{src:`/brands/${s}-color.svg`,alt:"",className:"size-4 shrink-0"}):s==="opencode"?(0,e.jsx)("span",{"aria-hidden":"true",className:"inline-flex shrink-0",children:(0,e.jsx)(ne,{className:"size-4"})}):(0,e.jsx)(s==="browser"?K:s==="headless"?J:X,{className:"size-4","aria-hidden":"true"})}a(ie,"AssistantIcon");function P(s=!1){const{selectedCompanyId:t}=z(),i=S({queryKey:b,queryFn:g.connections,retry:!1,enabled:!!t,refetchInterval:s?5e3:!1});return{...i,rows:(i.data??[]).filter(r=>r.companyId===t&&!r.revokedAt&&!r.scopes.includes("wardmote:agent"))}}a(P,"useAssistantConnections");function Ae({onNavigate:s}){const t=P(),i=t.rows,r=t.isSuccess?i.length?"Manage":"Set up":"Open";return(0,e.jsxs)("div",{role:"listitem","data-app-slug":"assistant-connection","data-connected":t.isSuccess?String(i.length>0):void 0,className:"overflow-hidden rounded-xl border border-line",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-3 px-4 py-4",children:[(0,e.jsx)(A,{className:"size-9 shrink-0 p-1 text-ink","aria-hidden":"true"}),(0,e.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,e.jsx)("h2",{className:"text-sm font-semibold text-ink",children:"Assistant Connection (MCP)"}),(0,e.jsx)("p",{className:"mt-0.5 text-xs text-ink-3",children:"Use your Wardmote organization from Codex, Claude, OpenCode, or another assistant."})]}),(0,e.jsx)(d,{type:"button",size:"sm",variant:"secondary",onClick:a(()=>s(ae),"onClick"),"aria-label":`${r} Assistant Connection (MCP)`,children:r})]}),t.isPending&&(0,e.jsx)("p",{className:"border-t border-line px-4 py-3 text-xs text-ink-3",children:"Checking your connection status…"}),t.isError&&(0,e.jsxs)("div",{role:"alert",className:"flex flex-wrap items-center justify-between gap-3 border-t border-line px-4 py-3",children:[(0,e.jsx)("p",{className:"text-xs text-bad",children:"Couldn’t load your connection status."}),(0,e.jsx)(d,{size:"sm",variant:"ghost",disabled:t.isFetching,onClick:a(()=>{t.refetch()},"onClick"),children:"Try again"})]}),t.isSuccess&&i.length>0&&(0,e.jsx)("div",{className:"flex flex-wrap items-center gap-2 border-t border-line px-4 py-3 text-sm",children:i.map(c=>(0,e.jsx)(T,{name:j(c),avatarUrl:c.user?.image,initials:I(c.user?.name??"You"),size:"sm"},c.id))})]})}a(Ae,"AssistantConnectionCard");function C({value:s,label:t}){const[i,r]=(0,u.useState)(!1),[c,o]=(0,u.useState)(!1);return(0,u.useEffect)(()=>{r(!1),o(!1)},[s]),(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsxs)("div",{className:"flex items-start gap-3 rounded-md border border-line bg-bg-3/30 p-3",children:[(0,e.jsx)("pre",{className:"min-w-0 flex-1 overflow-x-auto whitespace-pre-wrap break-words font-mono text-xs leading-relaxed",children:s}),(0,e.jsx)(d,{type:"button",variant:"ghost",size:"icon",className:"size-8 shrink-0","aria-label":`Copy ${t}`,onClick:a(async()=>{try{await ee(s),r(!0),o(!1)}catch{o(!0)}},"onClick"),children:i?(0,e.jsx)(D,{className:"size-4"}):(0,e.jsx)(V,{className:"size-4"})})]}),(0,e.jsx)("p",{role:"status",className:"text-xs text-ink-3",children:c?"Couldn’t copy. Select and copy the text above.":i?"Copied":null})]})}a(C,"CopyValue");function re(s){return s instanceof N&&s.status===401?"Sign in to connect an assistant. This requires a Wardmote instance with authenticated user accounts.":s instanceof N&&s.status===404?"Assistant connections need an authenticated instance with a public HTTPS URL. Ask your instance administrator to configure the public URL, then try again.":"Couldn’t load assistant setup. Try again in a moment."}a(re,"setupError");function Ie({initialAssistant:s="codex"}={}){const{selectedCompany:t,selectedCompanyId:i}=z(),{setBreadcrumbs:r}=Z(),c=W(),[o,_]=(0,u.useState)(s),l=S({queryKey:["mcp-setup"],queryFn:g.setup,retry:!1,refetchOnWindowFocus:"always",refetchOnMount:"always"}),m=P(l.data?.enabled===!0),x=B({mutationFn:g.revoke,onSuccess:a((n,p)=>(c.setQueryData(b,M=>M?.filter(U=>U.id!==p)),c.invalidateQueries({queryKey:b})),"onSuccess")});if((0,u.useEffect)(()=>(r([{label:"Connectors",href:"/apps"},{label:"Assistant Connection (MCP)"}]),()=>r([])),[r]),!i||!t)return(0,e.jsx)("p",{className:"text-sm text-ink-3",children:"Select an organization to connect an assistant."});const h=l.data?.serverUrl??"",q=h?O(h,{id:i,name:t.name}):"";return(0,e.jsxs)("div",{className:"max-w-3xl space-y-6 pb-8",children:[(0,e.jsxs)("header",{className:"space-y-4",children:[(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)(A,{className:"size-7 shrink-0 text-ink"}),(0,e.jsx)("h1",{className:"text-xl font-semibold",children:"Assistant Connection (MCP)"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)(te,{companyName:t.name,logoUrl:t.logoUrl,className:"size-12 shrink-0 rounded-lg"}),(0,e.jsxs)("div",{className:"space-y-1",children:[(0,e.jsx)("p",{className:"font-medium",children:t.name}),(0,e.jsx)("p",{className:"text-sm text-ink-3",children:"Connect your assistant to Wardmote. Review work, create tasks, and follow up using your account’s access to this organization."})]})]})]}),l.isPending&&(0,e.jsx)("p",{className:"text-sm text-ink-3",children:"Loading assistant setup…"}),l.error&&(0,e.jsxs)("div",{role:"alert",className:"space-y-3",children:[(0,e.jsx)("p",{className:"text-sm text-bad",children:re(l.error)}),(0,e.jsx)(d,{variant:"secondary",onClick:a(()=>{l.refetch()},"onClick"),children:"Try again"})]}),l.data&&!l.data.enabled&&(0,e.jsxs)("section",{className:"space-y-3 rounded-lg border border-line bg-bg-3/30 p-4",children:[(0,e.jsx)("h2",{className:"text-sm font-semibold",children:"Enable assistant connections"}),(0,e.jsx)("p",{className:"text-sm text-ink-3",children:"An instance administrator must turn on Assistant connections in Settings > Features. Then return here to connect your assistant."}),(0,e.jsx)(d,{variant:"secondary",asChild:!0,children:(0,e.jsx)(k,{to:"/company/settings/instance/features",children:"Open Features"})})]}),l.data?.enabled&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("section",{className:"space-y-4","aria-label":"Invite your assistant",children:[(0,e.jsx)("p",{className:"text-sm text-ink-3",children:"Paste this invitation into your assistant. It will help set up the connection and ask you to approve access in Wardmote."}),(0,e.jsx)("div",{className:"flex justify-end",children:(0,e.jsx)(se,{prompt:q,label:"Copy invitation",title:"Invite your assistant",description:"Paste this invitation into your assistant. It will help set up the connection and ask you to approve access in Wardmote.",side:"bottom",align:"end"})})]}),(0,e.jsxs)("details",{className:"space-y-4 text-sm",children:[(0,e.jsx)("summary",{className:"cursor-pointer text-ink-3",children:"Set up manually"}),(0,e.jsx)(Y,{value:o,onValueChange:a(n=>_(n),"onValueChange"),className:"min-w-0",children:(0,e.jsx)("div",{className:"overflow-x-auto overflow-y-hidden scrollbar-none border-b border-line",children:(0,e.jsx)(H,{variant:"line",className:"min-w-full justify-start","aria-label":"Assistant setup instructions",children:Object.entries(y).map(([n,p])=>(0,e.jsxs)(Q,{value:n,className:"flex-none",children:[(0,e.jsx)(ie,{assistant:n}),p]},n))})})}),(0,e.jsxs)("section",{className:"space-y-4","aria-label":`Set up ${y[o]}`,children:[E(h,o).map((n,p)=>(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)("p",{className:"text-sm text-ink-3",children:n.text}),n.code&&(0,e.jsx)(C,{value:n.code,label:`${y[o]} setup step ${p+1}`})]},`${o}-${p}`)),o!=="browser"&&(0,e.jsx)("p",{className:"text-sm text-ink-3",children:"Authorization commands wait for human approval. When using an assistant shell tool, keep the command running in a persistent terminal or background process, capture its output privately, and share the approval URL immediately while it is still running. Client callback deadlines still apply. If the command timed out or stopped, start a fresh authorization request before sharing a link. If the host cannot keep the command alive across turns, ask the user to run it in their own terminal."}),(0,e.jsxs)("p",{className:"text-sm",children:["Choose ",(0,e.jsx)("strong",{children:t.name}),", review access, then click ",(0,e.jsx)("strong",{children:"Connect organization"}),"."]}),(0,e.jsx)("p",{className:"text-xs text-ink-3",children:"Creating tasks and adding comments may start agent work using the organization’s configured execution budget."})]}),(0,e.jsx)(C,{value:h,label:"MCP server URL"})]})]}),(0,e.jsxs)("section",{className:"space-y-3","aria-labelledby":"connected-assistants",children:[(0,e.jsx)("h2",{id:"connected-assistants",className:"text-sm font-semibold",children:"Your connected assistants"}),m.isPending&&(0,e.jsx)("p",{className:"text-sm text-ink-3",children:"Loading connections…"}),(m.error||x.error)&&(0,e.jsxs)("p",{role:"alert",className:"text-sm text-bad",children:[x.error?"Couldn’t revoke this connection. Try again.":"Couldn’t load your connections. Try again."," ",(0,e.jsx)("button",{type:"button",className:"underline",onClick:a(()=>{m.refetch()},"onClick"),children:"Refresh"})]}),m.isSuccess&&m.rows.length===0&&(0,e.jsxs)("p",{className:"text-sm text-ink-3",children:["No assistants connected to ",t.name," yet."]}),(0,e.jsx)("div",{className:"divide-y divide-line",children:m.rows.map(n=>(0,e.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3 py-3",children:[(0,e.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,e.jsx)(T,{name:j(n),avatarUrl:n.user?.image,initials:I(n.user?.name??"You"),className:"font-medium"}),(0,e.jsx)("p",{className:"text-xs text-ink-3",children:`Connected as you · ${n.scopes.includes("wardmote:write")?"Read and write":"Read only"}${n.scopes.includes("wardmote:configure")?" · Configure agents, projects and skills":""}`})]}),(0,e.jsx)(d,{variant:"secondary",size:"sm",disabled:x.isPending,onClick:a(()=>x.mutate(n.id),"onClick"),"aria-label":`Revoke ${j(n)}`,children:"Revoke"})]},n.id))})]}),(0,e.jsxs)("footer",{className:"flex items-center justify-between gap-3 border-t border-line pt-4",children:[(0,e.jsx)(d,{variant:"ghost",asChild:!0,children:(0,e.jsx)(k,{to:"/apps",children:"Back to Connections"})}),(0,e.jsxs)("a",{className:"inline-flex items-center gap-1 text-xs text-ink-3 underline",href:o==="opencode"?"https://opencode.ai/docs/mcp-servers/":o==="claude"?"https://code.claude.com/docs/en/mcp":"https://developers.openai.com/codex/mcp",target:"_blank",rel:"noreferrer",children:["Setup documentation ",(0,e.jsx)(G,{className:"size-3"})]})]})]})}a(Ie,"AssistantConnection");export{Ie as AssistantConnection,Ae as AssistantConnectionCard,P as useAssistantConnections};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var w=Object.defineProperty;var n=(o,e)=>w(o,"name",{value:e,configurable:!0});import{i as x}from"./rolldown-runtime-ZpX3ckPj.js";import{na as F,ta as K}from"./createLucideIcon-B-uEJvX6.js";import{X as Q,_ as d,t as u,v as R}from"./queryKeys-yuC-YxZI.js";import{zt as a}from"./router-2HX_SyKK.js";import{r as T}from"./button-D3bYvq4T.js";import{p as L,t as N,u as k}from"./IssueThreadInteractionCard-
|
|
1
|
+
var w=Object.defineProperty;var n=(o,e)=>w(o,"name",{value:e,configurable:!0});import{i as x}from"./rolldown-runtime-ZpX3ckPj.js";import{na as F,ta as K}from"./createLucideIcon-B-uEJvX6.js";import{X as Q,_ as d,t as u,v as R}from"./queryKeys-yuC-YxZI.js";import{zt as a}from"./router-2HX_SyKK.js";import{r as T}from"./button-D3bYvq4T.js";import{p as L,t as N,u as k}from"./IssueThreadInteractionCard-bP4n_lcw.js";var O=x(F(),1),l=x(K(),1);function V(o,e){const r=o??[],m=r.findIndex(s=>s.id===e.id);return m<0?[...r,e]:r.map((s,y)=>y===m?e:s)}n(V,"replaceResolvedInteraction");function G({companyId:o,issueId:e,interactionId:r,agentMap:m,currentUserId:s,userLabelMap:y,onResolved:I}){const h=Q(),{data:v,isLoading:A,error:j}=R({queryKey:u.issues.interactions(e),queryFn:n(()=>a.listInteractions(e),"queryFn"),enabled:!!e,refetchInterval:n(t=>k(t.state.data),"refetchInterval")}),f=(0,O.useMemo)(()=>{const t=(v??[]).find(i=>i.id===r);return t&&L(t)?t:null},[v,r]),c=n(t=>{t&&h.setQueryData(u.issues.interactions(e),i=>V(i,t)),h.invalidateQueries({queryKey:u.issues.interactions(e)}),h.invalidateQueries({queryKey:u.attention(o)}),I?.()},"invalidate"),_=d({mutationFn:n(t=>a.acceptInteraction(e,t.interaction.id,{selectedClientKeys:t.selectedClientKeys,selectedOptionIds:t.selectedOptionIds,rememberAction:t.rememberAction,note:t.note}),"mutationFn"),onSuccess:c}),b=d({mutationFn:n(t=>a.rejectInteraction(e,t.interactionId,t.reason,t.note),"mutationFn"),onSuccess:c}),q=d({mutationFn:n(t=>a.respondToInteraction(e,t.interactionId,{answers:t.answers}),"mutationFn"),onSuccess:c}),M=d({mutationFn:n(t=>a.cancelInteraction(e,t.interactionId),"mutationFn"),onSuccess:c}),S=d({mutationFn:n(t=>a.submitInteractionVerdicts(e,t.interactionId,t.verdicts),"mutationFn"),onSuccess:c});return A?(0,l.jsxs)("div",{className:"flex items-center gap-2 py-3 text-xs text-ink-3",children:[(0,l.jsx)(T,{className:"h-3.5 w-3.5 animate-spin"})," Loading decision…"]}):j||!f?(0,l.jsx)("p",{className:"py-3 text-xs text-ink-3",children:"This decision is no longer available — it may have been resolved elsewhere."}):(0,l.jsx)(N,{interaction:f,agentMap:m,currentUserId:s,userLabelMap:y,onUploadImage:n(async t=>(await a.uploadAttachment(o,e,t)).contentPath,"onUploadImage"),onAcceptInteraction:n((t,i,p,C,g)=>_.mutateAsync({interaction:t,selectedClientKeys:i,selectedOptionIds:p,rememberAction:C,note:g}).then(()=>{}),"onAcceptInteraction"),onRejectInteraction:n((t,i,p)=>b.mutateAsync({interactionId:t.id,reason:i,note:p}).then(()=>{}),"onRejectInteraction"),onSubmitInteractionAnswers:n((t,i)=>q.mutateAsync({interactionId:t.id,answers:i}).then(()=>{}),"onSubmitInteractionAnswers"),onCancelInteraction:n(t=>M.mutateAsync({interactionId:t.id}).then(()=>{}),"onCancelInteraction"),onSubmitInteractionVerdicts:n((t,i)=>S.mutateAsync({interactionId:t.id,verdicts:i}).then(()=>{}),"onSubmitInteractionVerdicts")})}n(G,"AttentionInteractionResolver");export{G as t};
|