@tickernelz/wardmote-ui 2026.1115.6 → 2026.1115.7

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.
Files changed (121) hide show
  1. package/dist/assets/{AdapterManager-CGgDyozB.js → AdapterManager-vFOS4UvI.js} +1 -1
  2. package/dist/assets/{AdvancedToolsRoute-Dxn10V2d.js → AdvancedToolsRoute-DZrRFpVP.js} +1 -1
  3. package/dist/assets/{AgentActionButtons-Dm8w7HmA.js → AgentActionButtons-Bfr9wZVC.js} +1 -1
  4. package/dist/assets/{AgentChat-Da_1R2b7.js → AgentChat-BVdXFVHr.js} +1 -1
  5. package/dist/assets/{AgentChats-C7TNoAC-.js → AgentChats-DpSwzEXp.js} +1 -1
  6. package/dist/assets/{AgentDefaults-w0CMLH3K.js → AgentDefaults-Bn23ypsB.js} +1 -1
  7. package/dist/assets/{AgentDetail-Bjd5GK2C.js → AgentDetail-CSGn8J_Q.js} +1 -1
  8. package/dist/assets/{AgentTodoCard-Df26qfgh.js → AgentTodoCard-BL20NPh0.js} +1 -1
  9. package/dist/assets/{Agents-ClpqZVSV.js → Agents-DRYQYGkt.js} +3 -3
  10. package/dist/assets/{AppDetail-Be1KCsgP.js → AppDetail-ostx-Mo0.js} +1 -1
  11. package/dist/assets/{AppNotConnected-BH1hnGgY.js → AppNotConnected-4tYAxPCb.js} +1 -1
  12. package/dist/assets/{ApprovalCard-CLdTr0Cy.js → ApprovalCard-BsUm9pGY.js} +1 -1
  13. package/dist/assets/{ApprovalDetail-BUvwiTAW.js → ApprovalDetail-Cmv0cnS4.js} +1 -1
  14. package/dist/assets/{ApprovalPayload-CUzY-_aO.js → ApprovalPayload-BcOZ42zi.js} +1 -1
  15. package/dist/assets/{Approvals-C_UgpGKf.js → Approvals-DQhnGOTm.js} +1 -1
  16. package/dist/assets/{AppsReview-5L0rNUE4.js → AppsReview-D37ZRgU_.js} +1 -1
  17. package/dist/assets/{ArtifactCard-Bf1xhbpz.js → ArtifactCard-DGei3ggf.js} +1 -1
  18. package/dist/assets/{Artifacts-Dus69-B7.js → Artifacts-DpG5RAQq.js} +1 -1
  19. package/dist/assets/{AssistantConnection-DU1syQHX.js → AssistantConnection-BpCKUhgx.js} +1 -1
  20. package/dist/assets/{AttentionInteractionResolver-CEmayofl.js → AttentionInteractionResolver-DidKULsS.js} +1 -1
  21. package/dist/assets/{AuditHub-DuWeO9qB.js → AuditHub-DRjix5ym.js} +1 -1
  22. package/dist/assets/{BoardChat-D9tNSWEM.js → BoardChat-C9Gvjyp9.js} +1 -1
  23. package/dist/assets/{BootstrapSetupUxLab-qh905Kmw.js → BootstrapSetupUxLab-C1vtprg5.js} +1 -1
  24. package/dist/assets/{Browse-j0APkVk0.js → Browse-DQua1gm8.js} +1 -1
  25. package/dist/assets/{BudgetPolicyCard-CAN7wbfW.js → BudgetPolicyCard-BOkxb4br.js} +1 -1
  26. package/dist/assets/{CaseDetail-BFv3C9Hw.js → CaseDetail-p0CLPDKa.js} +1 -1
  27. package/dist/assets/{Cases-DawmlLsv.js → Cases-S2ZFMlxW.js} +1 -1
  28. package/dist/assets/{ChatEndpointDetail-DSVrhbyP.js → ChatEndpointDetail-DRtj3uZr.js} +1 -1
  29. package/dist/assets/{ChatEndpointSetup-DEY5FJEC.js → ChatEndpointSetup-ST4Uis-a.js} +1 -1
  30. package/dist/assets/{ChoiceControls-Co4p9sM9.js → ChoiceControls-CWglRSOv.js} +1 -1
  31. package/dist/assets/{Companies-BvVtX-fX.js → Companies-DOKVvsbn.js} +1 -1
  32. package/dist/assets/{CompanyAccess-O2sXqLZM.js → CompanyAccess-CADLuNP1.js} +1 -1
  33. package/dist/assets/{CompanyActivity-lJ0_YGgq.js → CompanyActivity-CpLN-eRb.js} +1 -1
  34. package/dist/assets/{CompanyConnections-BShjoNce.js → CompanyConnections-BTb8yRjR.js} +1 -1
  35. package/dist/assets/{CompanyEnvironments-Q0yJZujv.js → CompanyEnvironments-BYYyGKfl.js} +1 -1
  36. package/dist/assets/{CompanyExport-BV-yZeTY.js → CompanyExport-Dq8Iby3Z.js} +1 -1
  37. package/dist/assets/{CompanyImport-BgrTt2o8.js → CompanyImport-DzGgh3AW.js} +1 -1
  38. package/dist/assets/{CompanySettings-DnH74imr.js → CompanySettings-CJJehp0r.js} +1 -1
  39. package/dist/assets/{CompanySettingsPluginPage-BvkDNTIK.js → CompanySettingsPluginPage-CPCQUHiM.js} +1 -1
  40. package/dist/assets/{CompanySkills-DhYPrq4m.js → CompanySkills-BaW3Eioj.js} +1 -1
  41. package/dist/assets/{ConfigureBuiltInAgentModal-CymJeIPr.js → ConfigureBuiltInAgentModal-DCCNnp-d.js} +1 -1
  42. package/dist/assets/{CopyableGatewayUrl--CoxBOEc.js → CopyableGatewayUrl-BcTuSy0s.js} +1 -1
  43. package/dist/assets/{Dashboard-D_T4RHbe.js → Dashboard-D7xfsZ8U.js} +1 -1
  44. package/dist/assets/{DecisionDateChips-C98aE9X7.js → DecisionDateChips-UVXfETFg.js} +1 -1
  45. package/dist/assets/{DecisionQueuePage-gDNqtd6b.js → DecisionQueuePage-C9GAeZNb.js} +1 -1
  46. package/dist/assets/{DesignGuide-2mdl6Wjj.js → DesignGuide-4Qrfxjl6.js} +1 -1
  47. package/dist/assets/{EmailEndpointSetup-CzGi8uWH.js → EmailEndpointSetup-Bbrc16Lf.js} +1 -1
  48. package/dist/assets/{ExecutionWorkspaceDetail-GxalfQ_R.js → ExecutionWorkspaceDetail-aC0Uqr5o.js} +1 -1
  49. package/dist/assets/{GatewayDetail-BGFFr0Qn.js → GatewayDetail-C0CQ8sbZ.js} +1 -1
  50. package/dist/assets/{GatewaysList-CgTby33f.js → GatewaysList-XMpYRCgP.js} +1 -1
  51. package/dist/assets/{GoalDetail-POxqRLqi.js → GoalDetail-RV8gzjju.js} +1 -1
  52. package/dist/assets/{GoalTree-BggQ-oPE.js → GoalTree-BjAXPQoC.js} +1 -1
  53. package/dist/assets/{Goals-don2YWD9.js → Goals-C0L3rtPa.js} +1 -1
  54. package/dist/assets/{ImageGalleryModal-BkQdIJyh.js → ImageGalleryModal-B-lxi_T9.js} +1 -1
  55. package/dist/assets/{Inbox-DiG0BF5q.js → Inbox-DL5FEs8Z.js} +1 -1
  56. package/dist/assets/{InstanceAdvanced-DPrl0ynz.js → InstanceAdvanced-6lGR4Rwt.js} +1 -1
  57. package/dist/assets/{InviteLanding-C4vIGf6o.js → InviteLanding-BzPKTOtF.js} +1 -1
  58. package/dist/assets/{IssueChatLongThreadPerf-C4wkVAND.js → IssueChatLongThreadPerf-qPXgwDuQ.js} +1 -1
  59. package/dist/assets/{IssueChatThread-jvPDwisa.js → IssueChatThread-CFY_zv5a.js} +1 -1
  60. package/dist/assets/{IssueDetail-Bj-rX3fF.js → IssueDetail-DsS131t7.js} +1 -1
  61. package/dist/assets/{IssueOutputSection-C1beiXJf.js → IssueOutputSection-D0qZxcsW.js} +1 -1
  62. package/dist/assets/{IssueRecoveryActionCard-B9P1rgRV.js → IssueRecoveryActionCard-BsCh8Q3n.js} +1 -1
  63. package/dist/assets/{IssueReferencePill-CYmqYnm0.js → IssueReferencePill-BIqEngfF.js} +1 -1
  64. package/dist/assets/{IssueThreadInteractionCard-9BcuJIdq.js → IssueThreadInteractionCard-X7Ug2b_D.js} +1 -1
  65. package/dist/assets/{Issues-Cifmo9n9.js → Issues-SB9BZhXv.js} +1 -1
  66. package/dist/assets/{LiveNowTodoLine-_PIa5EA3.js → LiveNowTodoLine-DNw0hUwJ.js} +1 -1
  67. package/dist/assets/{ManagedAiConnectionDetails-DyfStuZT.js → ManagedAiConnectionDetails-ClouvF1z.js} +1 -1
  68. package/dist/assets/{McpConnect-MZmzlTSL.js → McpConnect-BPZwJjlr.js} +1 -1
  69. package/dist/assets/{MembershipAction-CavUCHcB.js → MembershipAction-DbmMOc8R.js} +1 -1
  70. package/dist/assets/{ModelsAndProviders-C_wKDoIs.js → ModelsAndProviders-CkGVtQmQ.js} +1 -1
  71. package/dist/assets/{NewAgent-CR00m_MN.js → NewAgent-ChlmF_BP.js} +1 -1
  72. package/dist/assets/{OmpAllSettings-6p4gFX8M.js → OmpAllSettings-BR42FqrS.js} +1 -1
  73. package/dist/assets/{PipelineSettings-BpRevU4f.js → PipelineSettings-DQPSDvRj.js} +1 -1
  74. package/dist/assets/{Pipelines-DA1JJw_V.js → Pipelines-DOWRZl_U.js} +1 -1
  75. package/dist/assets/{PixelsOffice-BIXTDKTB.js → PixelsOffice-vdU7Eu18.js} +1 -1
  76. package/dist/assets/{PluginPage-Bnyw8CLE.js → PluginPage-I4wXPiy1.js} +1 -1
  77. package/dist/assets/{PluginSettings-CSroJuor.js → PluginSettings-D3eSi9fm.js} +1 -1
  78. package/dist/assets/{ProfileDetailRoute-B16K4Ayi.js → ProfileDetailRoute-B0FI1LeR.js} +1 -1
  79. package/dist/assets/{ProfileSettings-xrKVo4ou.js → ProfileSettings-m5z4GxBW.js} +1 -1
  80. package/dist/assets/{ProfileWizardRoute-D7h8JTyu.js → ProfileWizardRoute-Bz9k60fo.js} +1 -1
  81. package/dist/assets/{ProjectDetail-PV3nWSTs.js → ProjectDetail-Ci6IYGFE.js} +1 -1
  82. package/dist/assets/{ProjectWorkspaceDetail-CxZk4pjM.js → ProjectWorkspaceDetail-BJw0UaZZ.js} +1 -1
  83. package/dist/assets/{ProjectWorkspacesContent-D0hesmsL.js → ProjectWorkspacesContent-CABsgbUY.js} +1 -1
  84. package/dist/assets/{Projects-B2vVH6Nu.js → Projects-_hAvuiqZ.js} +1 -1
  85. package/dist/assets/{PublicIssueSharePage-D27-6Qm3.js → PublicIssueSharePage-DmXAuCrC.js} +1 -1
  86. package/dist/assets/{ReviewQueueCard-CfClQNIT.js → ReviewQueueCard-DFt_1J42.js} +1 -1
  87. package/dist/assets/{RichWorkProductCard-BN2jRtis.js → RichWorkProductCard-DYLsskP3.js} +1 -1
  88. package/dist/assets/{RoutineDetail-SUfyZmlS.js → RoutineDetail-DKfS8_Fc.js} +1 -1
  89. package/dist/assets/{RoutineRunVariablesDialog-DnH14Eof.js → RoutineRunVariablesDialog-DHpRgzNC.js} +1 -1
  90. package/dist/assets/{Routines-CKzkszmq.js → Routines-DoACth5s.js} +1 -1
  91. package/dist/assets/{ScrollToBottom-BxLqk3aD.js → ScrollToBottom-CxM9JETk.js} +1 -1
  92. package/dist/assets/{Search-Dske2c4I.js → Search-iR3yDQDr.js} +1 -1
  93. package/dist/assets/{Secrets-yhNfCVIC.js → Secrets-CICJWh_c.js} +1 -1
  94. package/dist/assets/{SkillSourceTree-CITIU9s6.js → SkillSourceTree-DxIIbsCy.js} +1 -1
  95. package/dist/assets/{SkillSources-UPem8_Cn.js → SkillSources-BulvGllC.js} +1 -1
  96. package/dist/assets/{SkillStudio-BnqwErR2.js → SkillStudio-pZkMRWB0.js} +1 -1
  97. package/dist/assets/{SourceTrustBadge-DJRlakKK.js → SourceTrustBadge-tx9pt8nw.js} +1 -1
  98. package/dist/assets/{StatusCards-DMMFj4la.js → StatusCards-C7Fx3HPg.js} +1 -1
  99. package/dist/assets/{SummarySlotCard-BZjJwHY3.js → SummarySlotCard-DprYZuSq.js} +1 -1
  100. package/dist/assets/{TaskChatLab-Cf7PQKKa.js → TaskChatLab-q2n_vacx.js} +1 -1
  101. package/dist/assets/{TaskChatMarker-C9Sy9FPy.js → TaskChatMarker-So51W60X.js} +1 -1
  102. package/dist/assets/{TaskChatProtocolCard-BvDJtGnF.js → TaskChatProtocolCard-C1PnM_U-.js} +1 -1
  103. package/dist/assets/{TaskChatThreadView-ZAdYeFu_.js → TaskChatThreadView-CbRI6fwT.js} +1 -1
  104. package/dist/assets/{TaskTreeControls-j9jXxmFS.js → TaskTreeControls-D3AR_tDr.js} +1 -1
  105. package/dist/assets/{Terminal-C0JX_Tab.js → Terminal-DMEEshGF.js} +1 -1
  106. package/dist/assets/{TerminalView-BPWshXQT.js → TerminalView-BhTSckxj.js} +1 -1
  107. package/dist/assets/{TrustPresetSection-DE_LsAo4.js → TrustPresetSection-B0hy2924.js} +1 -1
  108. package/dist/assets/{UserProfile-Z2ZQnGFP.js → UserProfile-_pr7F6BS.js} +1 -1
  109. package/dist/assets/{WhatNeedsMe-B772De0x.js → WhatNeedsMe-D6DK9gTX.js} +1 -1
  110. package/dist/assets/{Workspaces-leuG9Jak.js → Workspaces-D0Uq8AzW.js} +1 -1
  111. package/dist/assets/{connection-owner-CtoS0r1p.js → connection-owner-BcF9xtco.js} +1 -1
  112. package/dist/assets/{index-vkQSx4qF.js → index-B-KXIl2u.js} +3 -3
  113. package/dist/assets/{issue-properties-DHNV19Ml.js → issue-properties-DAwNT_WG.js} +1 -1
  114. package/dist/assets/{issue-workspace-selection-D_iNVf3u.js → issue-workspace-selection-DSiOc2Q2.js} +1 -1
  115. package/dist/assets/{pipeline-stage-presentation-DCX-eX5a.js → pipeline-stage-presentation-DOxlzv5L.js} +1 -1
  116. package/dist/assets/{shared-CiHyzKQS.js → shared-C40IN7FR.js} +1 -1
  117. package/dist/assets/{transcript-adapter-_k3Gfk5t.js → transcript-adapter-DmgP29P0.js} +1 -1
  118. package/dist/assets/{useSummaryDraftStream-ClmP-EW-.js → useSummaryDraftStream-C3FpvWr0.js} +1 -1
  119. package/dist/index.html +1 -1
  120. package/dist/sw.js +1 -1
  121. package/package.json +1 -1
@@ -1 +1 @@
1
- var oe=Object.defineProperty;var a=(t,i)=>oe(t,"name",{value:i,configurable:!0});import{i as se}from"./rolldown-runtime-ZpX3ckPj.js";import{l as N,na as de,ta as ce}from"./createLucideIcon-CnVGnh-n.js";import{X as me,_ as b,t as Y,v as ae}from"./queryKeys-DNib4smf.js";import{n as xe}from"./CompanyContext-D89SijyS.js";import{t as M}from"./label-BC7Ayivp.js";import{t as pe}from"./PathInstructionsModal-BiBAmfYj.js";import{n as L,t as te}from"./package-D54DBhDm.js";import{t as ne}from"./folder-open-BWyhdPrR.js";import{t as o}from"./button-C9JA0pR9.js";import{t as he}from"./plus-iKvhycbm.js";import{t as ue}from"./power-CiPDt_ah.js";import{t as ge}from"./refresh-cw-DftOekY1.js";import{t as je}from"./trash-D40f5EC4.js";import{t as ve}from"./triangle-alert-DeBU3xr-.js";import{t as y}from"./badge-B56aAvuf.js";import{a as fe}from"./ToastContext-D-Mqs4di.js";import{a as z,c as be,i as K,n as H,r as Q,s as U,t as W}from"./dialog-1GyfWgga.js";import{t as q}from"./input-BVJKSyV-.js";import{n as ye}from"./BreadcrumbContext-zDw93MZx.js";import{r as Z}from"./schema-config-fields-B3pt6O9F.js";import{n as ie}from"./adapter-display-registry-B-nxMkG4.js";import{t as ee}from"./dynamic-loader-ehitOaJV.js";import{t as u}from"./adapters-DoxgThMu.js";import{r as Ne,t as _}from"./card-BaBV-07q.js";import{eo as ke}from"./index-vkQSx4qF.js";var g=se(de(),1),e=se(ce(),1);function V({adapter:t,canRemove:i,onToggle:p,onRemove:l,onReload:d,onReinstall:r,isToggling:j,isReloading:h,isReinstalling:c,overriddenBy:v,toggleTitleEnabled:B,toggleTitleDisabled:k,disabledBadgeLabel:m}){return(0,e.jsx)("li",{children:(0,e.jsxs)("div",{className:"flex items-center gap-4 px-4 py-3",children:[(0,e.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsx)("span",{className:N("font-medium",t.disabled&&"text-ink-3 line-through"),children:t.label&&t.label!==t.type?t.label:ie(t.type)}),(0,e.jsx)(y,{variant:"outline",children:t.source==="external"?"External":"Built-in"}),t.source==="external"&&(t.isLocalPath?(0,e.jsx)("span",{title:"Installed from local path",children:(0,e.jsx)(ne,{className:"h-4 w-4 text-amber-500"})}):(0,e.jsx)("span",{title:"Installed from npm",children:(0,e.jsx)(te,{className:"h-4 w-4 text-red-500"})})),t.version&&(0,e.jsxs)(y,{variant:"secondary",className:"font-mono text-(length:--text-nano)",children:["v",t.version]}),t.overriddenBuiltin&&(0,e.jsx)(y,{variant:"secondary",className:"text-blue-600 border-blue-400",children:"Overrides built-in"}),v&&(0,e.jsxs)(y,{variant:"secondary",className:"text-blue-600 border-blue-400",children:["Overridden by ",v]}),t.disabled&&(0,e.jsx)(y,{variant:"secondary",className:"text-amber-600 border-amber-400",children:m??"Hidden from menus"})]}),(0,e.jsxs)("p",{className:"text-xs text-ink-3 mt-0.5",children:[t.type,t.packageName&&t.packageName!==t.type&&(0,e.jsxs)(e.Fragment,{children:[" · ",t.packageName]})," · ",t.modelsCount," models"]})]}),(0,e.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[r&&(0,e.jsx)(o,{variant:"secondary",size:"icon-sm",className:"h-8 w-8",title:"Reinstall adapter (pull latest from npm)",disabled:c,onClick:a(()=>r(t.type),"onClick"),children:(0,e.jsx)(ke,{className:N("h-4 w-4",c&&"animate-bounce")})}),d&&(0,e.jsx)(o,{variant:"secondary",size:"icon-sm",className:"h-8 w-8",title:"Reload adapter (hot-swap)",disabled:h,onClick:a(()=>d(t.type),"onClick"),children:(0,e.jsx)(ge,{className:N("h-4 w-4",h&&"animate-spin")})}),(0,e.jsx)(o,{variant:"secondary",size:"icon-sm",className:"h-8 w-8",title:t.disabled?B??"Show in agent menus":k??"Hide from agent menus",disabled:j,onClick:a(()=>p(t.type,!t.disabled),"onClick"),children:(0,e.jsx)(ue,{className:N("h-4 w-4",t.disabled?"text-ink-3":"text-green-600")})}),i&&(0,e.jsx)(o,{variant:"danger",size:"icon-sm",className:"h-8 w-8",title:"Remove adapter",onClick:a(()=>l(t.type),"onClick"),children:(0,e.jsx)(je,{className:"h-4 w-4"})})]})]})})}a(V,"AdapterRow");function we(t){return fetch(`https://registry.npmjs.org/${encodeURIComponent(t)}/latest`,{signal:AbortSignal.timeout(5e3)}).then(i=>i.json()).then(i=>typeof i?.version=="string"?i.version:null).catch(()=>null)}a(we,"fetchNpmLatestVersion");function Pe({adapter:t,open:i,isReinstalling:p,onConfirm:l,onCancel:d}){const{data:r,isLoading:j}=ae({queryKey:["npm-latest-version",t?.packageName],queryFn:a(()=>t?.packageName?we(t.packageName):null,"queryFn"),enabled:i&&!!t?.packageName,staleTime:6e4}),h=t?.version&&r&&t.version===r;return(0,e.jsx)(W,{open:i,onOpenChange:a(c=>{c||d()},"onOpenChange"),children:(0,e.jsxs)(H,{children:[(0,e.jsxs)(z,{children:[(0,e.jsx)(U,{children:"Reinstall Adapter"}),(0,e.jsxs)(Q,{children:["This will pull the latest version of"," ",(0,e.jsx)("strong",{children:t?.packageName})," from npm and hot-swap the running adapter module. Existing agents will use the new version on their next run."]})]}),(0,e.jsxs)("div",{className:"rounded-md border bg-bg-3/50 px-4 py-3 text-sm space-y-1",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsx)("span",{className:"text-ink-3",children:"Package"}),(0,e.jsx)("span",{className:"font-mono",children:t?.packageName})]}),(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsx)("span",{className:"text-ink-3",children:"Current"}),(0,e.jsx)("span",{className:"font-mono",children:t?.version?`v${t.version}`:"unknown"})]}),(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsx)("span",{className:"text-ink-3",children:"Latest on npm"}),(0,e.jsx)("span",{className:"font-mono",children:j?"checking...":r?`v${r}`:"unavailable"})]}),h&&(0,e.jsx)("p",{className:"text-xs text-ink-3 pt-1",children:"Already on the latest version."})]}),(0,e.jsxs)(K,{children:[(0,e.jsx)(o,{variant:"secondary",onClick:d,disabled:p,children:"Cancel"}),(0,e.jsx)(o,{disabled:p,onClick:l,children:p?"Reinstalling...":"Reinstall"})]})]})})}a(Pe,"ReinstallDialog");function Ye(){const{selectedCompany:t}=xe(),{setBreadcrumbs:i}=ye(),p=me(),{pushToast:l}=fe(),[d,r]=(0,g.useState)(""),[j,h]=(0,g.useState)(""),[c,v]=(0,g.useState)(!1),[B,k]=(0,g.useState)(!1),[m,C]=(0,g.useState)(null),[A,F]=(0,g.useState)(null);(0,g.useEffect)(()=>{i([{label:t?.name??"Organization",href:"/dashboard"},{label:"Settings",href:"/company/settings"},{label:"Adapters"}])},[t?.name,i]);const{data:T,isLoading:le}=ae({queryKey:Y.adapters.all,queryFn:a(()=>u.list(),"queryFn")}),f=a(()=>{p.invalidateQueries({queryKey:Y.adapters.all})},"invalidate"),R=b({mutationFn:a(s=>u.install(s),"mutationFn"),onSuccess:a(s=>{f(),k(!1),r(""),h(""),v(!1),l({title:"Adapter installed",body:`Type "${s.type}" registered successfully.${s.version?` (v${s.version})`:""}`,tone:"success"})},"onSuccess"),onError:a(s=>{l({title:"Install failed",body:s.message,tone:"error"})},"onError")}),S=b({mutationFn:a(s=>u.remove(s),"mutationFn"),onSuccess:a(()=>{f(),l({title:"Adapter removed",tone:"success"})},"onSuccess"),onError:a(s=>{l({title:"Removal failed",body:s.message,tone:"error"})},"onError")}),w=b({mutationFn:a(({type:s,disabled:n})=>u.setDisabled(s,n),"mutationFn"),onSuccess:a(()=>{f()},"onSuccess"),onError:a(s=>{l({title:"Toggle failed",body:s.message,tone:"error"})},"onError")}),I=b({mutationFn:a(({type:s,paused:n})=>u.setOverridePaused(s,n),"mutationFn"),onSuccess:a(()=>{f()},"onSuccess"),onError:a(s=>{l({title:"Override toggle failed",body:s.message,tone:"error"})},"onError")}),E=b({mutationFn:a(s=>u.reload(s),"mutationFn"),onSuccess:a(s=>{f(),ee(s.type),Z(s.type),l({title:"Adapter reloaded",body:`Type "${s.type}" reloaded.${s.version?` (v${s.version})`:""}`,tone:"success"})},"onSuccess"),onError:a(s=>{l({title:"Reload failed",body:s.message,tone:"error"})},"onError")}),D=b({mutationFn:a(s=>u.reinstall(s),"mutationFn"),onSuccess:a(s=>{f(),ee(s.type),Z(s.type),l({title:"Adapter reinstalled",body:`Type "${s.type}" updated from npm.${s.version?` (v${s.version})`:""}`,tone:"success"})},"onSuccess"),onError:a(s=>{l({title:"Reinstall failed",body:s.message,tone:"error"})},"onError")}),O=(T??[]).filter(s=>s.source==="builtin"),J=(T??[]).filter(s=>s.source==="external"),X=(T??[]).filter(s=>s.source==="external"&&s.overriddenBuiltin).filter(s=>!O.some(n=>n.type===s.type)).map(s=>({type:s.type,label:ie(s.type),overriddenBy:[s.packageName,s.version?`v${s.version}`:void 0].filter(Boolean).join(" "),overridePaused:!!s.overridePaused,menuDisabled:!!s.disabled}));if(le)return(0,e.jsx)("div",{className:"p-4 text-sm text-ink-3",children:"Loading adapters..."});const G=R.isPending||S.isPending||w.isPending||I.isPending||E.isPending||D.isPending;return(0,e.jsxs)("div",{className:"max-w-6xl space-y-6",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)(L,{className:"h-6 w-6 text-ink-3"}),(0,e.jsx)("h1",{className:"text-xl font-semibold",children:"Adapters"}),(0,e.jsx)(y,{variant:"outline",className:"text-amber-600 border-amber-400",children:"Alpha"})]}),(0,e.jsxs)(W,{open:B,onOpenChange:k,children:[(0,e.jsx)(be,{asChild:!0,children:(0,e.jsxs)(o,{size:"sm",className:"gap-2",children:[(0,e.jsx)(he,{className:"h-4 w-4"}),"Install Adapter"]})}),(0,e.jsxs)(H,{children:[(0,e.jsxs)(z,{children:[(0,e.jsx)(U,{children:"Install External Adapter"}),(0,e.jsxs)(Q,{children:["Add an adapter from npm or a local path. The adapter package must export ",(0,e.jsx)("code",{className:"text-xs bg-bg-3 px-1 py-0.5 rounded",children:"createServerAdapter()"}),"."]})]}),(0,e.jsxs)("div",{className:"grid gap-4 py-4",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsxs)("button",{type:"button",className:N("inline-flex items-center gap-1.5 rounded-md border px-3 py-1.5 text-xs transition-colors",c?"border-line text-ink-3 hover:text-ink hover:bg-bg-3/50":"border-ink bg-bg-3 text-ink"),onClick:a(()=>v(!1),"onClick"),children:[(0,e.jsx)(te,{className:"h-3.5 w-3.5"}),"npm package"]}),(0,e.jsxs)("button",{type:"button",className:N("inline-flex items-center gap-1.5 rounded-md border px-3 py-1.5 text-xs transition-colors",c?"border-ink bg-bg-3 text-ink":"border-line text-ink-3 hover:text-ink hover:bg-bg-3/50"),onClick:a(()=>v(!0),"onClick"),children:[(0,e.jsx)(ne,{className:"h-3.5 w-3.5"}),"Local path"]})]}),c?(0,e.jsxs)("div",{className:"grid gap-2",children:[(0,e.jsx)(M,{htmlFor:"adapterLocalPath",children:"Path to adapter package"}),(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsx)(q,{id:"adapterLocalPath",className:"flex-1 font-mono text-xs",placeholder:"/mnt/e/Projects/my-adapter or E:\\Projects\\my-adapter",value:d,onChange:a(s=>r(s.target.value),"onChange")}),(0,e.jsx)(pe,{})]}),(0,e.jsx)("p",{className:"text-xs text-ink-3",children:"Accepts Linux, WSL, and Windows paths. Windows paths are auto-converted."})]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"grid gap-2",children:[(0,e.jsx)(M,{htmlFor:"adapterPackageName",children:"Package Name"}),(0,e.jsx)(q,{id:"adapterPackageName",placeholder:"my-wardmote-adapter",value:d,onChange:a(s=>r(s.target.value),"onChange")})]}),(0,e.jsxs)("div",{className:"grid gap-2",children:[(0,e.jsx)(M,{htmlFor:"adapterVersion",children:"Version (optional)"}),(0,e.jsx)(q,{id:"adapterVersion",placeholder:"latest",value:j,onChange:a(s=>h(s.target.value),"onChange")})]})]})]}),(0,e.jsxs)(K,{children:[(0,e.jsx)(o,{variant:"secondary",onClick:a(()=>k(!1),"onClick"),children:"Cancel"}),(0,e.jsx)(o,{onClick:a(()=>R.mutate({packageName:d,version:j||void 0,isLocalPath:c}),"onClick"),disabled:!d||R.isPending,children:R.isPending?"Installing...":"Install"})]})]})]})]}),(0,e.jsx)("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/5 px-4 py-3",children:(0,e.jsxs)("div",{className:"flex items-start gap-3",children:[(0,e.jsx)(ve,{className:"mt-0.5 h-4 w-4 shrink-0 text-amber-700"}),(0,e.jsxs)("div",{className:"space-y-1 text-sm",children:[(0,e.jsx)("p",{className:"font-medium text-ink",children:"External adapters are alpha."}),(0,e.jsx)("p",{className:"text-ink-3",children:"The adapter plugin system is under active development. APIs and storage format may change. Use the power icon to hide adapters from agent menus without removing them."})]})]})}),(0,e.jsxs)("section",{className:"space-y-3",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(L,{className:"h-5 w-5 text-ink-3"}),(0,e.jsx)("h2",{className:"text-base font-semibold",children:"External Adapters"})]}),J.length===0?(0,e.jsx)(_,{className:"bg-bg-3/30",children:(0,e.jsxs)(Ne,{className:"flex flex-col items-center justify-center py-10",children:[(0,e.jsx)(L,{className:"h-10 w-10 text-ink-3 mb-4"}),(0,e.jsx)("p",{className:"text-sm font-medium",children:"No external adapters installed"}),(0,e.jsx)("p",{className:"text-xs text-ink-3 mt-1",children:"Install an adapter package to extend model support."})]})}):(0,e.jsx)(_,{className:"block py-0",children:(0,e.jsx)("ul",{className:"divide-y",children:J.map(s=>{const n=s.overriddenBuiltin,P=n&&!!s.overridePaused,re=n?{...s,disabled:P??!1}:s;return(0,e.jsx)(V,{adapter:re,canRemove:!0,onToggle:n?(x,$)=>I.mutate({type:x,paused:$}):(x,$)=>w.mutate({type:x,disabled:$}),onRemove:a(x=>C(x),"onRemove"),onReload:a(x=>E.mutate(x),"onReload"),onReinstall:s.isLocalPath?void 0:x=>F(s),isToggling:n?I.isPending:w.isPending,isReloading:E.isPending,isReinstalling:D.isPending,toggleTitleDisabled:n?"Pause external override":void 0,toggleTitleEnabled:n?"Resume external override":void 0,disabledBadgeLabel:n?"Override paused":void 0},s.type)})})})]}),(0,e.jsxs)("section",{className:"space-y-3",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(L,{className:"h-5 w-5 text-ink-3"}),(0,e.jsx)("h2",{className:"text-base font-semibold",children:"Built-in Adapters"})]}),O.length===0&&X.length===0?(0,e.jsx)("div",{className:"text-sm text-ink-3",children:"No built-in adapters found."}):(0,e.jsx)(_,{className:"block py-0",children:(0,e.jsxs)("ul",{className:"divide-y",children:[O.map(s=>(0,e.jsx)(V,{adapter:s,canRemove:!1,onToggle:a((n,P)=>w.mutate({type:n,disabled:P}),"onToggle"),onRemove:a(()=>{},"onRemove"),isToggling:G},s.type)),X.map(s=>(0,e.jsx)(V,{adapter:{type:s.type,label:s.label,source:"builtin",modelsCount:0,loaded:!0,disabled:s.menuDisabled,capabilities:{supportsInstructionsBundle:!1,supportsSkills:!1,supportsLocalAgentJwt:!1,requiresMaterializedRuntimeSkills:!1,supportsAcp:!1}},canRemove:!1,onToggle:a((n,P)=>w.mutate({type:n,disabled:P}),"onToggle"),onRemove:a(()=>{},"onRemove"),isToggling:G,overriddenBy:s.overridePaused?void 0:s.overriddenBy},s.type))]})})]}),(0,e.jsx)(W,{open:m!==null,onOpenChange:a(s=>{s||C(null)},"onOpenChange"),children:(0,e.jsxs)(H,{children:[(0,e.jsxs)(z,{children:[(0,e.jsx)(U,{children:"Remove Adapter"}),(0,e.jsxs)(Q,{children:["Are you sure you want to remove the ",(0,e.jsx)("strong",{children:m})," adapter? It will be unregistered and removed from the adapter store.",m&&T?.find(s=>s.type===m)?.packageName&&(0,e.jsx)(e.Fragment,{children:" npm packages will be cleaned up from disk."})," ","This action cannot be undone."]})]}),(0,e.jsxs)(K,{children:[(0,e.jsx)(o,{variant:"secondary",onClick:a(()=>C(null),"onClick"),children:"Cancel"}),(0,e.jsx)(o,{variant:"delete",disabled:S.isPending,onClick:a(()=>{m&&S.mutate(m,{onSettled:a(()=>C(null),"onSettled")})},"onClick"),children:S.isPending?"Removing...":"Remove"})]})]})}),(0,e.jsx)(Pe,{adapter:A,open:A!==null,isReinstalling:D.isPending,onConfirm:a(()=>{A&&D.mutate(A.type,{onSettled:a(()=>F(null),"onSettled")})},"onConfirm"),onCancel:a(()=>F(null),"onCancel")})]})}a(Ye,"AdapterManager");export{Ye as AdapterManager};
1
+ var oe=Object.defineProperty;var a=(t,i)=>oe(t,"name",{value:i,configurable:!0});import{i as se}from"./rolldown-runtime-ZpX3ckPj.js";import{l as N,na as de,ta as ce}from"./createLucideIcon-CnVGnh-n.js";import{X as me,_ as b,t as Y,v as ae}from"./queryKeys-DNib4smf.js";import{n as xe}from"./CompanyContext-D89SijyS.js";import{t as M}from"./label-BC7Ayivp.js";import{t as pe}from"./PathInstructionsModal-BiBAmfYj.js";import{n as L,t as te}from"./package-D54DBhDm.js";import{t as ne}from"./folder-open-BWyhdPrR.js";import{t as o}from"./button-C9JA0pR9.js";import{t as he}from"./plus-iKvhycbm.js";import{t as ue}from"./power-CiPDt_ah.js";import{t as ge}from"./refresh-cw-DftOekY1.js";import{t as je}from"./trash-D40f5EC4.js";import{t as ve}from"./triangle-alert-DeBU3xr-.js";import{t as y}from"./badge-B56aAvuf.js";import{a as fe}from"./ToastContext-D-Mqs4di.js";import{a as z,c as be,i as K,n as H,r as Q,s as U,t as W}from"./dialog-1GyfWgga.js";import{t as q}from"./input-BVJKSyV-.js";import{n as ye}from"./BreadcrumbContext-zDw93MZx.js";import{r as Z}from"./schema-config-fields-B3pt6O9F.js";import{n as ie}from"./adapter-display-registry-B-nxMkG4.js";import{t as ee}from"./dynamic-loader-ehitOaJV.js";import{t as u}from"./adapters-DoxgThMu.js";import{r as Ne,t as _}from"./card-BaBV-07q.js";import{eo as ke}from"./index-B-KXIl2u.js";var g=se(de(),1),e=se(ce(),1);function V({adapter:t,canRemove:i,onToggle:p,onRemove:l,onReload:d,onReinstall:r,isToggling:j,isReloading:h,isReinstalling:c,overriddenBy:v,toggleTitleEnabled:B,toggleTitleDisabled:k,disabledBadgeLabel:m}){return(0,e.jsx)("li",{children:(0,e.jsxs)("div",{className:"flex items-center gap-4 px-4 py-3",children:[(0,e.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsx)("span",{className:N("font-medium",t.disabled&&"text-ink-3 line-through"),children:t.label&&t.label!==t.type?t.label:ie(t.type)}),(0,e.jsx)(y,{variant:"outline",children:t.source==="external"?"External":"Built-in"}),t.source==="external"&&(t.isLocalPath?(0,e.jsx)("span",{title:"Installed from local path",children:(0,e.jsx)(ne,{className:"h-4 w-4 text-amber-500"})}):(0,e.jsx)("span",{title:"Installed from npm",children:(0,e.jsx)(te,{className:"h-4 w-4 text-red-500"})})),t.version&&(0,e.jsxs)(y,{variant:"secondary",className:"font-mono text-(length:--text-nano)",children:["v",t.version]}),t.overriddenBuiltin&&(0,e.jsx)(y,{variant:"secondary",className:"text-blue-600 border-blue-400",children:"Overrides built-in"}),v&&(0,e.jsxs)(y,{variant:"secondary",className:"text-blue-600 border-blue-400",children:["Overridden by ",v]}),t.disabled&&(0,e.jsx)(y,{variant:"secondary",className:"text-amber-600 border-amber-400",children:m??"Hidden from menus"})]}),(0,e.jsxs)("p",{className:"text-xs text-ink-3 mt-0.5",children:[t.type,t.packageName&&t.packageName!==t.type&&(0,e.jsxs)(e.Fragment,{children:[" · ",t.packageName]})," · ",t.modelsCount," models"]})]}),(0,e.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[r&&(0,e.jsx)(o,{variant:"secondary",size:"icon-sm",className:"h-8 w-8",title:"Reinstall adapter (pull latest from npm)",disabled:c,onClick:a(()=>r(t.type),"onClick"),children:(0,e.jsx)(ke,{className:N("h-4 w-4",c&&"animate-bounce")})}),d&&(0,e.jsx)(o,{variant:"secondary",size:"icon-sm",className:"h-8 w-8",title:"Reload adapter (hot-swap)",disabled:h,onClick:a(()=>d(t.type),"onClick"),children:(0,e.jsx)(ge,{className:N("h-4 w-4",h&&"animate-spin")})}),(0,e.jsx)(o,{variant:"secondary",size:"icon-sm",className:"h-8 w-8",title:t.disabled?B??"Show in agent menus":k??"Hide from agent menus",disabled:j,onClick:a(()=>p(t.type,!t.disabled),"onClick"),children:(0,e.jsx)(ue,{className:N("h-4 w-4",t.disabled?"text-ink-3":"text-green-600")})}),i&&(0,e.jsx)(o,{variant:"danger",size:"icon-sm",className:"h-8 w-8",title:"Remove adapter",onClick:a(()=>l(t.type),"onClick"),children:(0,e.jsx)(je,{className:"h-4 w-4"})})]})]})})}a(V,"AdapterRow");function we(t){return fetch(`https://registry.npmjs.org/${encodeURIComponent(t)}/latest`,{signal:AbortSignal.timeout(5e3)}).then(i=>i.json()).then(i=>typeof i?.version=="string"?i.version:null).catch(()=>null)}a(we,"fetchNpmLatestVersion");function Pe({adapter:t,open:i,isReinstalling:p,onConfirm:l,onCancel:d}){const{data:r,isLoading:j}=ae({queryKey:["npm-latest-version",t?.packageName],queryFn:a(()=>t?.packageName?we(t.packageName):null,"queryFn"),enabled:i&&!!t?.packageName,staleTime:6e4}),h=t?.version&&r&&t.version===r;return(0,e.jsx)(W,{open:i,onOpenChange:a(c=>{c||d()},"onOpenChange"),children:(0,e.jsxs)(H,{children:[(0,e.jsxs)(z,{children:[(0,e.jsx)(U,{children:"Reinstall Adapter"}),(0,e.jsxs)(Q,{children:["This will pull the latest version of"," ",(0,e.jsx)("strong",{children:t?.packageName})," from npm and hot-swap the running adapter module. Existing agents will use the new version on their next run."]})]}),(0,e.jsxs)("div",{className:"rounded-md border bg-bg-3/50 px-4 py-3 text-sm space-y-1",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsx)("span",{className:"text-ink-3",children:"Package"}),(0,e.jsx)("span",{className:"font-mono",children:t?.packageName})]}),(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsx)("span",{className:"text-ink-3",children:"Current"}),(0,e.jsx)("span",{className:"font-mono",children:t?.version?`v${t.version}`:"unknown"})]}),(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsx)("span",{className:"text-ink-3",children:"Latest on npm"}),(0,e.jsx)("span",{className:"font-mono",children:j?"checking...":r?`v${r}`:"unavailable"})]}),h&&(0,e.jsx)("p",{className:"text-xs text-ink-3 pt-1",children:"Already on the latest version."})]}),(0,e.jsxs)(K,{children:[(0,e.jsx)(o,{variant:"secondary",onClick:d,disabled:p,children:"Cancel"}),(0,e.jsx)(o,{disabled:p,onClick:l,children:p?"Reinstalling...":"Reinstall"})]})]})})}a(Pe,"ReinstallDialog");function Ye(){const{selectedCompany:t}=xe(),{setBreadcrumbs:i}=ye(),p=me(),{pushToast:l}=fe(),[d,r]=(0,g.useState)(""),[j,h]=(0,g.useState)(""),[c,v]=(0,g.useState)(!1),[B,k]=(0,g.useState)(!1),[m,C]=(0,g.useState)(null),[A,F]=(0,g.useState)(null);(0,g.useEffect)(()=>{i([{label:t?.name??"Organization",href:"/dashboard"},{label:"Settings",href:"/company/settings"},{label:"Adapters"}])},[t?.name,i]);const{data:T,isLoading:le}=ae({queryKey:Y.adapters.all,queryFn:a(()=>u.list(),"queryFn")}),f=a(()=>{p.invalidateQueries({queryKey:Y.adapters.all})},"invalidate"),R=b({mutationFn:a(s=>u.install(s),"mutationFn"),onSuccess:a(s=>{f(),k(!1),r(""),h(""),v(!1),l({title:"Adapter installed",body:`Type "${s.type}" registered successfully.${s.version?` (v${s.version})`:""}`,tone:"success"})},"onSuccess"),onError:a(s=>{l({title:"Install failed",body:s.message,tone:"error"})},"onError")}),S=b({mutationFn:a(s=>u.remove(s),"mutationFn"),onSuccess:a(()=>{f(),l({title:"Adapter removed",tone:"success"})},"onSuccess"),onError:a(s=>{l({title:"Removal failed",body:s.message,tone:"error"})},"onError")}),w=b({mutationFn:a(({type:s,disabled:n})=>u.setDisabled(s,n),"mutationFn"),onSuccess:a(()=>{f()},"onSuccess"),onError:a(s=>{l({title:"Toggle failed",body:s.message,tone:"error"})},"onError")}),I=b({mutationFn:a(({type:s,paused:n})=>u.setOverridePaused(s,n),"mutationFn"),onSuccess:a(()=>{f()},"onSuccess"),onError:a(s=>{l({title:"Override toggle failed",body:s.message,tone:"error"})},"onError")}),E=b({mutationFn:a(s=>u.reload(s),"mutationFn"),onSuccess:a(s=>{f(),ee(s.type),Z(s.type),l({title:"Adapter reloaded",body:`Type "${s.type}" reloaded.${s.version?` (v${s.version})`:""}`,tone:"success"})},"onSuccess"),onError:a(s=>{l({title:"Reload failed",body:s.message,tone:"error"})},"onError")}),D=b({mutationFn:a(s=>u.reinstall(s),"mutationFn"),onSuccess:a(s=>{f(),ee(s.type),Z(s.type),l({title:"Adapter reinstalled",body:`Type "${s.type}" updated from npm.${s.version?` (v${s.version})`:""}`,tone:"success"})},"onSuccess"),onError:a(s=>{l({title:"Reinstall failed",body:s.message,tone:"error"})},"onError")}),O=(T??[]).filter(s=>s.source==="builtin"),J=(T??[]).filter(s=>s.source==="external"),X=(T??[]).filter(s=>s.source==="external"&&s.overriddenBuiltin).filter(s=>!O.some(n=>n.type===s.type)).map(s=>({type:s.type,label:ie(s.type),overriddenBy:[s.packageName,s.version?`v${s.version}`:void 0].filter(Boolean).join(" "),overridePaused:!!s.overridePaused,menuDisabled:!!s.disabled}));if(le)return(0,e.jsx)("div",{className:"p-4 text-sm text-ink-3",children:"Loading adapters..."});const G=R.isPending||S.isPending||w.isPending||I.isPending||E.isPending||D.isPending;return(0,e.jsxs)("div",{className:"max-w-6xl space-y-6",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)(L,{className:"h-6 w-6 text-ink-3"}),(0,e.jsx)("h1",{className:"text-xl font-semibold",children:"Adapters"}),(0,e.jsx)(y,{variant:"outline",className:"text-amber-600 border-amber-400",children:"Alpha"})]}),(0,e.jsxs)(W,{open:B,onOpenChange:k,children:[(0,e.jsx)(be,{asChild:!0,children:(0,e.jsxs)(o,{size:"sm",className:"gap-2",children:[(0,e.jsx)(he,{className:"h-4 w-4"}),"Install Adapter"]})}),(0,e.jsxs)(H,{children:[(0,e.jsxs)(z,{children:[(0,e.jsx)(U,{children:"Install External Adapter"}),(0,e.jsxs)(Q,{children:["Add an adapter from npm or a local path. The adapter package must export ",(0,e.jsx)("code",{className:"text-xs bg-bg-3 px-1 py-0.5 rounded",children:"createServerAdapter()"}),"."]})]}),(0,e.jsxs)("div",{className:"grid gap-4 py-4",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsxs)("button",{type:"button",className:N("inline-flex items-center gap-1.5 rounded-md border px-3 py-1.5 text-xs transition-colors",c?"border-line text-ink-3 hover:text-ink hover:bg-bg-3/50":"border-ink bg-bg-3 text-ink"),onClick:a(()=>v(!1),"onClick"),children:[(0,e.jsx)(te,{className:"h-3.5 w-3.5"}),"npm package"]}),(0,e.jsxs)("button",{type:"button",className:N("inline-flex items-center gap-1.5 rounded-md border px-3 py-1.5 text-xs transition-colors",c?"border-ink bg-bg-3 text-ink":"border-line text-ink-3 hover:text-ink hover:bg-bg-3/50"),onClick:a(()=>v(!0),"onClick"),children:[(0,e.jsx)(ne,{className:"h-3.5 w-3.5"}),"Local path"]})]}),c?(0,e.jsxs)("div",{className:"grid gap-2",children:[(0,e.jsx)(M,{htmlFor:"adapterLocalPath",children:"Path to adapter package"}),(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsx)(q,{id:"adapterLocalPath",className:"flex-1 font-mono text-xs",placeholder:"/mnt/e/Projects/my-adapter or E:\\Projects\\my-adapter",value:d,onChange:a(s=>r(s.target.value),"onChange")}),(0,e.jsx)(pe,{})]}),(0,e.jsx)("p",{className:"text-xs text-ink-3",children:"Accepts Linux, WSL, and Windows paths. Windows paths are auto-converted."})]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"grid gap-2",children:[(0,e.jsx)(M,{htmlFor:"adapterPackageName",children:"Package Name"}),(0,e.jsx)(q,{id:"adapterPackageName",placeholder:"my-wardmote-adapter",value:d,onChange:a(s=>r(s.target.value),"onChange")})]}),(0,e.jsxs)("div",{className:"grid gap-2",children:[(0,e.jsx)(M,{htmlFor:"adapterVersion",children:"Version (optional)"}),(0,e.jsx)(q,{id:"adapterVersion",placeholder:"latest",value:j,onChange:a(s=>h(s.target.value),"onChange")})]})]})]}),(0,e.jsxs)(K,{children:[(0,e.jsx)(o,{variant:"secondary",onClick:a(()=>k(!1),"onClick"),children:"Cancel"}),(0,e.jsx)(o,{onClick:a(()=>R.mutate({packageName:d,version:j||void 0,isLocalPath:c}),"onClick"),disabled:!d||R.isPending,children:R.isPending?"Installing...":"Install"})]})]})]})]}),(0,e.jsx)("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/5 px-4 py-3",children:(0,e.jsxs)("div",{className:"flex items-start gap-3",children:[(0,e.jsx)(ve,{className:"mt-0.5 h-4 w-4 shrink-0 text-amber-700"}),(0,e.jsxs)("div",{className:"space-y-1 text-sm",children:[(0,e.jsx)("p",{className:"font-medium text-ink",children:"External adapters are alpha."}),(0,e.jsx)("p",{className:"text-ink-3",children:"The adapter plugin system is under active development. APIs and storage format may change. Use the power icon to hide adapters from agent menus without removing them."})]})]})}),(0,e.jsxs)("section",{className:"space-y-3",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(L,{className:"h-5 w-5 text-ink-3"}),(0,e.jsx)("h2",{className:"text-base font-semibold",children:"External Adapters"})]}),J.length===0?(0,e.jsx)(_,{className:"bg-bg-3/30",children:(0,e.jsxs)(Ne,{className:"flex flex-col items-center justify-center py-10",children:[(0,e.jsx)(L,{className:"h-10 w-10 text-ink-3 mb-4"}),(0,e.jsx)("p",{className:"text-sm font-medium",children:"No external adapters installed"}),(0,e.jsx)("p",{className:"text-xs text-ink-3 mt-1",children:"Install an adapter package to extend model support."})]})}):(0,e.jsx)(_,{className:"block py-0",children:(0,e.jsx)("ul",{className:"divide-y",children:J.map(s=>{const n=s.overriddenBuiltin,P=n&&!!s.overridePaused,re=n?{...s,disabled:P??!1}:s;return(0,e.jsx)(V,{adapter:re,canRemove:!0,onToggle:n?(x,$)=>I.mutate({type:x,paused:$}):(x,$)=>w.mutate({type:x,disabled:$}),onRemove:a(x=>C(x),"onRemove"),onReload:a(x=>E.mutate(x),"onReload"),onReinstall:s.isLocalPath?void 0:x=>F(s),isToggling:n?I.isPending:w.isPending,isReloading:E.isPending,isReinstalling:D.isPending,toggleTitleDisabled:n?"Pause external override":void 0,toggleTitleEnabled:n?"Resume external override":void 0,disabledBadgeLabel:n?"Override paused":void 0},s.type)})})})]}),(0,e.jsxs)("section",{className:"space-y-3",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(L,{className:"h-5 w-5 text-ink-3"}),(0,e.jsx)("h2",{className:"text-base font-semibold",children:"Built-in Adapters"})]}),O.length===0&&X.length===0?(0,e.jsx)("div",{className:"text-sm text-ink-3",children:"No built-in adapters found."}):(0,e.jsx)(_,{className:"block py-0",children:(0,e.jsxs)("ul",{className:"divide-y",children:[O.map(s=>(0,e.jsx)(V,{adapter:s,canRemove:!1,onToggle:a((n,P)=>w.mutate({type:n,disabled:P}),"onToggle"),onRemove:a(()=>{},"onRemove"),isToggling:G},s.type)),X.map(s=>(0,e.jsx)(V,{adapter:{type:s.type,label:s.label,source:"builtin",modelsCount:0,loaded:!0,disabled:s.menuDisabled,capabilities:{supportsInstructionsBundle:!1,supportsSkills:!1,supportsLocalAgentJwt:!1,requiresMaterializedRuntimeSkills:!1,supportsAcp:!1}},canRemove:!1,onToggle:a((n,P)=>w.mutate({type:n,disabled:P}),"onToggle"),onRemove:a(()=>{},"onRemove"),isToggling:G,overriddenBy:s.overridePaused?void 0:s.overriddenBy},s.type))]})})]}),(0,e.jsx)(W,{open:m!==null,onOpenChange:a(s=>{s||C(null)},"onOpenChange"),children:(0,e.jsxs)(H,{children:[(0,e.jsxs)(z,{children:[(0,e.jsx)(U,{children:"Remove Adapter"}),(0,e.jsxs)(Q,{children:["Are you sure you want to remove the ",(0,e.jsx)("strong",{children:m})," adapter? It will be unregistered and removed from the adapter store.",m&&T?.find(s=>s.type===m)?.packageName&&(0,e.jsx)(e.Fragment,{children:" npm packages will be cleaned up from disk."})," ","This action cannot be undone."]})]}),(0,e.jsxs)(K,{children:[(0,e.jsx)(o,{variant:"secondary",onClick:a(()=>C(null),"onClick"),children:"Cancel"}),(0,e.jsx)(o,{variant:"delete",disabled:S.isPending,onClick:a(()=>{m&&S.mutate(m,{onSettled:a(()=>C(null),"onSettled")})},"onClick"),children:S.isPending?"Removing...":"Remove"})]})]})}),(0,e.jsx)(Pe,{adapter:A,open:A!==null,isReinstalling:D.isPending,onConfirm:a(()=>{A&&D.mutate(A.type,{onSettled:a(()=>F(null),"onSettled")})},"onConfirm"),onCancel:a(()=>F(null),"onCancel")})]})}a(Ye,"AdapterManager");export{Ye as AdapterManager};
@@ -1,4 +1,4 @@
1
- var Qe=Object.defineProperty;var t=(s,a)=>Qe(s,"name",{value:a,configurable:!0});import{i as Oe}from"./rolldown-runtime-ZpX3ckPj.js";import{l as Y,na as Je,ta as Ve}from"./createLucideIcon-CnVGnh-n.js";import{a as Ye,c as Xe,v as Ze}from"./star-BfGDDjEq.js";import{X as be,_ as I,t as M,v as U}from"./queryKeys-DNib4smf.js";import{c as es,l as ss,ot as ts,r as ns}from"./ConnectionSetupFlow-BsbmkX_F.js";import{n as _e}from"./CompanyContext-D89SijyS.js";import{G as as,o as qe,r as ae,t as re}from"./router-C-DPy1sQ.js";import{c as rs,i as ee,p as is,r as ls,t as os}from"./dropdown-menu-dYAPklSF.js";import{t as cs}from"./label-BC7Ayivp.js";import{t as ds}from"./archive-restore-BlBTY_xq.js";import{t as ms}from"./book-open-BOWP0ehs.js";import{t as le}from"./check-C1U2nLnR.js";import{t as xs}from"./chevron-down-D5bzoGsg.js";import{t as us}from"./circle-question-mark-DLsjfYUH.js";import{t as hs}from"./circle-slash-BuNNgXEm.js";import{t as ue}from"./copy-D5hPdWqB.js";import{t as ps}from"./ellipsis-LWwv_d2o.js";import{t as we}from"./flask-conical-Bu0lk0C2.js";import{t as je}from"./key-round-mtvLGca-.js";import{t as fs}from"./link-i-ylU0dl.js";import{r as ve,t as v}from"./button-C9JA0pR9.js";import{t as ze}from"./minus-BiYpQ9LC.js";import{t as gs}from"./play-mKy5kgSo.js";import{t as $e}from"./plus-iKvhycbm.js";import{t as js}from"./power-CiPDt_ah.js";import{t as Be}from"./rotate-ccw-Ck2ggAft.js";import{t as bs}from"./server-cog-DQPBP3QT.js";import{t as vs}from"./shield-alert-DwjjnLTA.js";import{t as Ke}from"./shield-check-BSMrd2w9.js";import{t as Ns}from"./users-DRkjos5c.js";import{t as oe}from"./x-BbL4w9tC.js";import{t as te}from"./badge-B56aAvuf.js";import{i as Ne}from"./ToastContext-D-Mqs4di.js";import{t as ks}from"./agents-Boy51qGF.js";import{t as ys}from"./projects-DImC99Et.js";import{a as ws,c as Cs,n as Ss,r as As,s as Ts,t as Ps}from"./dialog-1GyfWgga.js";import{t as Ce}from"./input-BVJKSyV-.js";import{t as Ge}from"./access-Ch1N6jrN.js";import{t as _}from"./tools-JAYosseH.js";import"./routines-2f34fzsQ.js";import{n as Es}from"./BreadcrumbContext-zDw93MZx.js";import{t as Ue}from"./textarea-z7duB4oz.js";import{t as Ls}from"./toggle-switch-BvihF3FR.js";import{n as Ms}from"./AgentMultiSelect-BBgOsAC7.js";import"./select-DrTXvDZQ.js";import{t as Is}from"./clipboard-CTLKYvRL.js";import{t as Fs}from"./AgentSetupPrompt-DPqvATs9.js";import"./card-BaBV-07q.js";import{$r as Ds,Dn as Se,Yt as Rs,ei as Os,ni as he,ri as _s,ti as Ae}from"./index-vkQSx4qF.js";import{i as qs,o as zs,r as $s,s as Bs,t as Ks}from"./sheet-CP78zh80.js";import{a as ie,i as ke,r as X,s as He}from"./shared-CiHyzKQS.js";import{a as Gs,c as Q,i as Us,n as Hs,o as Ws,r as Te,s as Qs,t as Pe}from"./smoke-lab-matrix-DfF8zWZs.js";import{a as Js,i as Vs,n as Ys,r as Xs,t as Zs}from"./profile-summary-BU92PO5r.js";import{r as et,t as st}from"./useProfilesData-TUNJLYJC.js";var Ee=`I want to connect an MCP (Model Context Protocol) server to Wardmote, and I need a paste-ready config.
1
+ var Qe=Object.defineProperty;var t=(s,a)=>Qe(s,"name",{value:a,configurable:!0});import{i as Oe}from"./rolldown-runtime-ZpX3ckPj.js";import{l as Y,na as Je,ta as Ve}from"./createLucideIcon-CnVGnh-n.js";import{a as Ye,c as Xe,v as Ze}from"./star-BfGDDjEq.js";import{X as be,_ as I,t as M,v as U}from"./queryKeys-DNib4smf.js";import{c as es,l as ss,ot as ts,r as ns}from"./ConnectionSetupFlow-BsbmkX_F.js";import{n as _e}from"./CompanyContext-D89SijyS.js";import{G as as,o as qe,r as ae,t as re}from"./router-C-DPy1sQ.js";import{c as rs,i as ee,p as is,r as ls,t as os}from"./dropdown-menu-dYAPklSF.js";import{t as cs}from"./label-BC7Ayivp.js";import{t as ds}from"./archive-restore-BlBTY_xq.js";import{t as ms}from"./book-open-BOWP0ehs.js";import{t as le}from"./check-C1U2nLnR.js";import{t as xs}from"./chevron-down-D5bzoGsg.js";import{t as us}from"./circle-question-mark-DLsjfYUH.js";import{t as hs}from"./circle-slash-BuNNgXEm.js";import{t as ue}from"./copy-D5hPdWqB.js";import{t as ps}from"./ellipsis-LWwv_d2o.js";import{t as we}from"./flask-conical-Bu0lk0C2.js";import{t as je}from"./key-round-mtvLGca-.js";import{t as fs}from"./link-i-ylU0dl.js";import{r as ve,t as v}from"./button-C9JA0pR9.js";import{t as ze}from"./minus-BiYpQ9LC.js";import{t as gs}from"./play-mKy5kgSo.js";import{t as $e}from"./plus-iKvhycbm.js";import{t as js}from"./power-CiPDt_ah.js";import{t as Be}from"./rotate-ccw-Ck2ggAft.js";import{t as bs}from"./server-cog-DQPBP3QT.js";import{t as vs}from"./shield-alert-DwjjnLTA.js";import{t as Ke}from"./shield-check-BSMrd2w9.js";import{t as Ns}from"./users-DRkjos5c.js";import{t as oe}from"./x-BbL4w9tC.js";import{t as te}from"./badge-B56aAvuf.js";import{i as Ne}from"./ToastContext-D-Mqs4di.js";import{t as ks}from"./agents-Boy51qGF.js";import{t as ys}from"./projects-DImC99Et.js";import{a as ws,c as Cs,n as Ss,r as As,s as Ts,t as Ps}from"./dialog-1GyfWgga.js";import{t as Ce}from"./input-BVJKSyV-.js";import{t as Ge}from"./access-Ch1N6jrN.js";import{t as _}from"./tools-JAYosseH.js";import"./routines-2f34fzsQ.js";import{n as Es}from"./BreadcrumbContext-zDw93MZx.js";import{t as Ue}from"./textarea-z7duB4oz.js";import{t as Ls}from"./toggle-switch-BvihF3FR.js";import{n as Ms}from"./AgentMultiSelect-BBgOsAC7.js";import"./select-DrTXvDZQ.js";import{t as Is}from"./clipboard-CTLKYvRL.js";import{t as Fs}from"./AgentSetupPrompt-DPqvATs9.js";import"./card-BaBV-07q.js";import{$r as Ds,Dn as Se,Yt as Rs,ei as Os,ni as he,ri as _s,ti as Ae}from"./index-B-KXIl2u.js";import{i as qs,o as zs,r as $s,s as Bs,t as Ks}from"./sheet-CP78zh80.js";import{a as ie,i as ke,r as X,s as He}from"./shared-C40IN7FR.js";import{a as Gs,c as Q,i as Us,n as Hs,o as Ws,r as Te,s as Qs,t as Pe}from"./smoke-lab-matrix-DfF8zWZs.js";import{a as Js,i as Vs,n as Ys,r as Xs,t as Zs}from"./profile-summary-BU92PO5r.js";import{r as et,t as st}from"./useProfilesData-TUNJLYJC.js";var Ee=`I want to connect an MCP (Model Context Protocol) server to Wardmote, and I need a paste-ready config.
2
2
 
3
3
  Target server: <name the server, or ask me if I have not said>
4
4
 
@@ -1 +1 @@
1
- var he=Object.defineProperty;var r=(e,i)=>he(e,"name",{value:i,configurable:!0});import{i as W}from"./rolldown-runtime-ZpX3ckPj.js";import{na as xe,r as X,ta as ye}from"./createLucideIcon-CnVGnh-n.js";import{a as be}from"./star-BfGDDjEq.js";import{X as ve,_ as T,n as je,t as d}from"./queryKeys-DNib4smf.js";import{gt as Y,o as ge}from"./router-C-DPy1sQ.js";import{a as Ce,c as we,i as Ne,n as Se,o as Ae,r as ke,s as Pe,t as Re}from"./alert-dialog-CJbRV6SV.js";import{o as Te,r as De,t as _e}from"./popover-vHMlfgIl.js";import{t as V}from"./copy-D5hPdWqB.js";import{t as Ee}from"./ellipsis-LWwv_d2o.js";import{r as Fe,t as y}from"./button-C9JA0pR9.js";import{t as qe}from"./pause-BDr44-C7.js";import{t as Z}from"./play-mKy5kgSo.js";import{t as Oe}from"./plus-iKvhycbm.js";import{t as Ke}from"./rotate-ccw-Ck2ggAft.js";import{t as Be}from"./trash-D40f5EC4.js";import{a as Qe}from"./ToastContext-D-Mqs4di.js";import{t as l}from"./agents-Boy51qGF.js";import{t as $e}from"./clipboard-CTLKYvRL.js";import{Sa as Ie,Tn as Me}from"./index-vkQSx4qF.js";var m=W(xe(),1),Ge=["instructionsBundleMode","instructionsRootPath","instructionsEntryFile","instructionsFilePath","agentsMdPath","promptTemplate","bootstrapPromptTemplate"];function B(e){return e?JSON.parse(JSON.stringify(e)):{}}r(B,"cloneRecord");function z(e){return`${e.trim()||"Agent"} Copy`}r(z,"duplicateAgentName");function Je(e,i){const a=B(e.adapterConfig);for(const p of Ge)delete a[p];const n={name:z(e.name),role:e.role,adapterType:e.adapterType,adapterConfig:a,runtimeConfig:B(e.runtimeConfig),defaultEnvironmentId:e.defaultEnvironmentId??null,budgetMonthlyCents:e.budgetMonthlyCents??0,permissions:{canCreateAgents:!!e.permissions?.canCreateAgents,canCreateSkills:e.permissions?.canCreateSkills!==!1}};return e.title&&(n.title=e.title),e.icon&&(n.icon=e.icon),e.reportsTo&&(n.reportsTo=e.reportsTo),e.capabilities&&(n.capabilities=e.capabilities),e.metadata&&(n.metadata=B(e.metadata)),i&&Object.keys(i.files).length>0&&(n.instructionsBundle=i),n}r(Je,"buildDuplicateAgentPayload");var s=W(ye(),1);function Le({onClick:e,disabled:i,label:a="Run now",size:n="sm"}){return(0,s.jsxs)(y,{variant:"secondary",size:n,onClick:e,disabled:i,children:[(0,s.jsx)(Z,{className:"h-3.5 w-3.5 sm:mr-1"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:a})]})}r(Le,"RunButton");function He({isPaused:e,onPause:i,onResume:a,disabled:n,size:p="sm"}){return e?(0,s.jsxs)(y,{variant:"secondary",size:p,onClick:a,disabled:n,children:[(0,s.jsx)(Z,{className:"h-3.5 w-3.5 sm:mr-1"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"Resume"})]}):(0,s.jsxs)(y,{variant:"secondary",size:p,onClick:i,disabled:n,children:[(0,s.jsx)(qe,{className:"h-3.5 w-3.5 sm:mr-1"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"Pause"})]})}r(He,"PauseResumeButton");function Ue({onClick:e,disabled:i,size:a="sm"}){return(0,s.jsxs)(y,{variant:"danger",size:a,onClick:e,disabled:i,"aria-label":"Clear error and return agent to idle",children:[(0,s.jsx)(be,{className:"h-3.5 w-3.5 sm:mr-1"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"Clear error"})]})}r(Ue,"ClearErrorButton");function Xe(e,i){return i.deprecated||i.virtual?null:i.path}r(Xe,"duplicateInstructionFilePath");async function Ye(e,i){const a=await l.instructionsBundle(e,i),n={};for(const C of a.files){const w=Xe(a,C);w&&(n[w]=(await l.instructionsFile(e,C.path,i)).content)}const p=Object.prototype.hasOwnProperty.call(n,a.entryFile)?a.entryFile:Object.keys(n)[0]??"AGENTS.md";return Object.keys(n).length>0?{entryFile:p,files:n}:null}r(Ye,"loadDuplicateInstructionsBundle");function xs({agent:e,companyId:i,size:a="sm",assignLabel:n="Assign Task",runLabel:p="Run now",showStatus:C=!0,showRun:w=!0,actionsDisabled:ee=!1,workActionsDisabled:D=!1,workActionsDisabledReason:se,navigateToRunOnInvoke:N=!0,canRunWithProviderTrace:te=!1,hasPendingNavigationChanges:Q=!1,onBeforeNavigate:$,onActionError:f,onTerminateSuccess:I,pauseConfirm:S,hideTerminate:re=!1,children:ie,className:ne}){const _=ge(),c=ve(),{openNewIssue:ae}=Ie(),{pushToast:v}=Qe(),[oe,j]=(0,m.useState)(!1),[le,M]=(0,m.useState)(!1),E=(0,m.useRef)(Q),F=(0,m.useRef)($),b=(0,m.useRef)(!1),G=(0,m.useRef)(!1);E.current=Q,F.current=$;function A(t){return t.current=E.current,F.current?.()!==!1}r(A,"confirmNavigationStart");function k(t){return!E.current||t.current||F.current?.()!==!1}r(k,"confirmLateNavigationChanges");const o=i??e.companyId,P=X(e),J=e.lifecycleState?e.lifecycleState==="paused":e.status==="paused",ce=e.status==="error",q=(0,m.useCallback)(t=>{f?f(t):v({title:"Action failed",body:t,tone:"error"})},[f,v]),L=(0,m.useCallback)(()=>{c.invalidateQueries({queryKey:d.agents.detail(e.id)}),c.invalidateQueries({queryKey:d.agents.detail(P)}),c.invalidateQueries({queryKey:d.agents.runtimeState(e.id)}),c.invalidateQueries({queryKey:d.agents.taskSessions(e.id)}),o&&(c.invalidateQueries({queryKey:d.agents.list(o)}),c.invalidateQueries({queryKey:d.liveRuns(o)}),c.invalidateQueries({queryKey:d.heartbeats(o,e.id)}))},[e.id,P,c,o]),h=T({mutationFn:r(async t=>{switch(t){case"invoke":return l.invoke(e.id,o??void 0);case"pause":return l.pause(e.id,o??void 0);case"resume":return l.resume(e.id,o??void 0);case"clear_error":return l.clearError(e.id,o??void 0);case"approve":return l.approve(e.id,o??void 0);case"terminate":return l.terminate(e.id,o??void 0)}},"mutationFn"),onSuccess:r((t,u)=>{if(f?.(null),L(),u==="terminate"){const x=t.lifecycleState;if(x==="terminating"||x==="cleaning_up"||!k(b))return;I?.(t)}if(u==="invoke"&&N&&t&&typeof t=="object"&&"id"in t){if(!k(b))return;_(`/agents/${P}/runs/${t.id}`)}},"onSuccess"),onError:r(t=>{q(t instanceof Error?t.message:"Action failed")},"onError")}),H=T({mutationFn:r(()=>l.invoke(e.id,o??void 0,{debug:{providerTrace:"raw"}}),"mutationFn"),onSuccess:r(t=>{if(f?.(null),L(),N){if(!k(b))return;_(`/agents/${P}/runs/${t.id}`)}},"onSuccess"),onError:r(t=>{q(t instanceof Error?t.message:"Failed to start traced run")},"onError")}),g=T({mutationFn:r(async()=>{if(!o)throw new Error("Agent is not ready to duplicate");const t=await Ye(e.id,o),u=Je(e,t);try{return await l.create(o,u)}catch(x){if(x instanceof je&&x.status===409&&x.message.includes("requires board approval"))return(await l.hire(o,u)).agent;throw x}},"mutationFn"),onSuccess:r(async t=>{f?.(null),o&&await c.invalidateQueries({queryKey:d.agents.list(o)}),v({title:"Agent duplicated",body:t.name,tone:"success"}),k(G)&&_(`/agents/${X(t)}/dashboard`)},"onSuccess"),onError:r(t=>{const u=t instanceof Error?t.message:"Failed to duplicate agent";f?.(u),v({title:"Could not duplicate agent",body:u,tone:"error"})},"onError")}),ue=(0,m.useCallback)(()=>{if(g.isPending)return;const t=z(e.name),u=window.confirm(`Duplicate ${e.name} as ${t}?`);j(!1),!(!u||!A(G))&&g.mutate()},[e.name,g]),de=T({mutationFn:r(()=>l.resetSession(e.id,null,o??void 0),"mutationFn"),onSuccess:r(()=>{f?.(null),c.invalidateQueries({queryKey:d.agents.runtimeState(e.id)}),c.invalidateQueries({queryKey:d.agents.taskSessions(e.id)})},"onSuccess"),onError:r(t=>{q(t instanceof Error?t.message:"Failed to reset session")},"onError")}),U=e.status==="pending_approval",O=ee||h.isPending||H.isPending,K=O||U||D||e.status==="terminated",me=O||U||J&&D||!!(e.lifecycleState&&["pausing","terminating","cleaning_up","terminated","rejected"].includes(e.lifecycleState)),pe=O,R=e.runtimeConfig,fe=(R&&typeof R.debug=="object"&&R.debug!==null?R.debug:null)?.providerTrace==="raw";return(0,s.jsxs)("div",{className:ne??"flex items-center gap-1 sm:gap-2 shrink-0",children:[fe?(0,s.jsxs)("span",{className:"hidden items-center gap-1 rounded-md border border-accent/30 bg-accent/10 px-2 py-1 text-xs font-medium text-accent lg:inline-flex",title:"Exact provider traffic will be captured for future runs and retained for up to 24 hours.",children:[(0,s.jsx)(Y,{className:"h-3.5 w-3.5"}),"Raw tracing on"]}):null,(0,s.jsxs)(y,{variant:"secondary",size:a,onClick:r(()=>ae({assigneeAgentId:e.id}),"onClick"),disabled:K,title:D?se:void 0,children:[(0,s.jsx)(Oe,{className:"h-3.5 w-3.5 sm:mr-1"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:n})]}),w&&(0,s.jsx)(Le,{onClick:r(()=>{N&&!A(b)||h.mutate("invoke")},"onClick"),disabled:K,label:p,size:a}),te&&(0,s.jsxs)(y,{variant:"secondary",size:a,onClick:r(()=>{N&&!A(b)||H.mutate()},"onClick"),disabled:K,title:"Capture exact provider traffic for this run (expires after 24 hours)",children:[(0,s.jsx)(Y,{className:"h-3.5 w-3.5 sm:mr-1"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"Run with provider trace"})]}),ce?(0,s.jsx)(Ue,{onClick:r(()=>h.mutate("clear_error"),"onClick"),disabled:pe,size:a}):(0,s.jsx)(He,{isPaused:J,onPause:r(()=>S?M(!0):h.mutate("pause"),"onPause"),onResume:r(()=>h.mutate("resume"),"onResume"),disabled:me,size:a}),S&&(0,s.jsx)(Re,{open:le,onOpenChange:M,children:(0,s.jsxs)(Ne,{children:[(0,s.jsxs)(Pe,{children:[(0,s.jsx)(we,{children:S.title}),(0,s.jsx)(Ce,{asChild:!0,children:(0,s.jsx)("div",{children:S.description})})]}),(0,s.jsxs)(Ae,{children:[(0,s.jsx)(ke,{children:"Cancel"}),(0,s.jsx)(Se,{onClick:r(()=>h.mutate("pause"),"onClick"),children:"Pause anyway"})]})]})}),C&&(0,s.jsx)("span",{className:"hidden sm:inline",children:(0,s.jsx)(Me,{status:e.status})}),ie,(0,s.jsxs)(_e,{open:oe,onOpenChange:j,children:[(0,s.jsx)(Te,{asChild:!0,children:(0,s.jsx)(y,{variant:"ghost",size:"icon-xs","aria-label":`Open actions for ${e.name}`,children:(0,s.jsx)(Ee,{className:"h-4 w-4"})})}),(0,s.jsxs)(De,{className:"w-44 p-1",align:"end",children:[(0,s.jsxs)("button",{className:"flex items-center gap-2 w-full px-2 py-1.5 text-xs rounded hover:bg-bg-3/50",disabled:g.isPending,onClick:ue,children:[g.isPending?(0,s.jsx)(Fe,{className:"h-3 w-3 animate-spin"}):(0,s.jsx)(V,{className:"h-3 w-3"}),"Duplicate Agent"]}),(0,s.jsxs)("button",{className:"flex items-center gap-2 w-full px-2 py-1.5 text-xs rounded hover:bg-bg-3/50",onClick:r(()=>{$e(e.id).catch(()=>{v({title:"Copy failed",body:"Clipboard access is unavailable.",tone:"error"})}),j(!1)},"onClick"),children:[(0,s.jsx)(V,{className:"h-3 w-3"}),"Copy Agent ID"]}),(0,s.jsxs)("button",{className:"flex items-center gap-2 w-full px-2 py-1.5 text-xs rounded hover:bg-bg-3/50",onClick:r(()=>{de.mutate(),j(!1)},"onClick"),children:[(0,s.jsx)(Ke,{className:"h-3 w-3"}),"Reset Sessions"]}),!re&&(0,s.jsxs)("button",{className:"flex items-center gap-2 w-full px-2 py-1.5 text-xs rounded hover:bg-bg-3/50 text-bad",onClick:r(()=>{j(!1),!(I&&!A(b))&&h.mutate("terminate")},"onClick"),children:[(0,s.jsx)(Be,{className:"h-3 w-3"}),"Terminate"]})]})]})]})}r(xs,"AgentActionButtons");export{Le as n,xs as t};
1
+ var he=Object.defineProperty;var r=(e,i)=>he(e,"name",{value:i,configurable:!0});import{i as W}from"./rolldown-runtime-ZpX3ckPj.js";import{na as xe,r as X,ta as ye}from"./createLucideIcon-CnVGnh-n.js";import{a as be}from"./star-BfGDDjEq.js";import{X as ve,_ as T,n as je,t as d}from"./queryKeys-DNib4smf.js";import{gt as Y,o as ge}from"./router-C-DPy1sQ.js";import{a as Ce,c as we,i as Ne,n as Se,o as Ae,r as ke,s as Pe,t as Re}from"./alert-dialog-CJbRV6SV.js";import{o as Te,r as De,t as _e}from"./popover-vHMlfgIl.js";import{t as V}from"./copy-D5hPdWqB.js";import{t as Ee}from"./ellipsis-LWwv_d2o.js";import{r as Fe,t as y}from"./button-C9JA0pR9.js";import{t as qe}from"./pause-BDr44-C7.js";import{t as Z}from"./play-mKy5kgSo.js";import{t as Oe}from"./plus-iKvhycbm.js";import{t as Ke}from"./rotate-ccw-Ck2ggAft.js";import{t as Be}from"./trash-D40f5EC4.js";import{a as Qe}from"./ToastContext-D-Mqs4di.js";import{t as l}from"./agents-Boy51qGF.js";import{t as $e}from"./clipboard-CTLKYvRL.js";import{Sa as Ie,Tn as Me}from"./index-B-KXIl2u.js";var m=W(xe(),1),Ge=["instructionsBundleMode","instructionsRootPath","instructionsEntryFile","instructionsFilePath","agentsMdPath","promptTemplate","bootstrapPromptTemplate"];function B(e){return e?JSON.parse(JSON.stringify(e)):{}}r(B,"cloneRecord");function z(e){return`${e.trim()||"Agent"} Copy`}r(z,"duplicateAgentName");function Je(e,i){const a=B(e.adapterConfig);for(const p of Ge)delete a[p];const n={name:z(e.name),role:e.role,adapterType:e.adapterType,adapterConfig:a,runtimeConfig:B(e.runtimeConfig),defaultEnvironmentId:e.defaultEnvironmentId??null,budgetMonthlyCents:e.budgetMonthlyCents??0,permissions:{canCreateAgents:!!e.permissions?.canCreateAgents,canCreateSkills:e.permissions?.canCreateSkills!==!1}};return e.title&&(n.title=e.title),e.icon&&(n.icon=e.icon),e.reportsTo&&(n.reportsTo=e.reportsTo),e.capabilities&&(n.capabilities=e.capabilities),e.metadata&&(n.metadata=B(e.metadata)),i&&Object.keys(i.files).length>0&&(n.instructionsBundle=i),n}r(Je,"buildDuplicateAgentPayload");var s=W(ye(),1);function Le({onClick:e,disabled:i,label:a="Run now",size:n="sm"}){return(0,s.jsxs)(y,{variant:"secondary",size:n,onClick:e,disabled:i,children:[(0,s.jsx)(Z,{className:"h-3.5 w-3.5 sm:mr-1"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:a})]})}r(Le,"RunButton");function He({isPaused:e,onPause:i,onResume:a,disabled:n,size:p="sm"}){return e?(0,s.jsxs)(y,{variant:"secondary",size:p,onClick:a,disabled:n,children:[(0,s.jsx)(Z,{className:"h-3.5 w-3.5 sm:mr-1"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"Resume"})]}):(0,s.jsxs)(y,{variant:"secondary",size:p,onClick:i,disabled:n,children:[(0,s.jsx)(qe,{className:"h-3.5 w-3.5 sm:mr-1"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"Pause"})]})}r(He,"PauseResumeButton");function Ue({onClick:e,disabled:i,size:a="sm"}){return(0,s.jsxs)(y,{variant:"danger",size:a,onClick:e,disabled:i,"aria-label":"Clear error and return agent to idle",children:[(0,s.jsx)(be,{className:"h-3.5 w-3.5 sm:mr-1"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"Clear error"})]})}r(Ue,"ClearErrorButton");function Xe(e,i){return i.deprecated||i.virtual?null:i.path}r(Xe,"duplicateInstructionFilePath");async function Ye(e,i){const a=await l.instructionsBundle(e,i),n={};for(const C of a.files){const w=Xe(a,C);w&&(n[w]=(await l.instructionsFile(e,C.path,i)).content)}const p=Object.prototype.hasOwnProperty.call(n,a.entryFile)?a.entryFile:Object.keys(n)[0]??"AGENTS.md";return Object.keys(n).length>0?{entryFile:p,files:n}:null}r(Ye,"loadDuplicateInstructionsBundle");function xs({agent:e,companyId:i,size:a="sm",assignLabel:n="Assign Task",runLabel:p="Run now",showStatus:C=!0,showRun:w=!0,actionsDisabled:ee=!1,workActionsDisabled:D=!1,workActionsDisabledReason:se,navigateToRunOnInvoke:N=!0,canRunWithProviderTrace:te=!1,hasPendingNavigationChanges:Q=!1,onBeforeNavigate:$,onActionError:f,onTerminateSuccess:I,pauseConfirm:S,hideTerminate:re=!1,children:ie,className:ne}){const _=ge(),c=ve(),{openNewIssue:ae}=Ie(),{pushToast:v}=Qe(),[oe,j]=(0,m.useState)(!1),[le,M]=(0,m.useState)(!1),E=(0,m.useRef)(Q),F=(0,m.useRef)($),b=(0,m.useRef)(!1),G=(0,m.useRef)(!1);E.current=Q,F.current=$;function A(t){return t.current=E.current,F.current?.()!==!1}r(A,"confirmNavigationStart");function k(t){return!E.current||t.current||F.current?.()!==!1}r(k,"confirmLateNavigationChanges");const o=i??e.companyId,P=X(e),J=e.lifecycleState?e.lifecycleState==="paused":e.status==="paused",ce=e.status==="error",q=(0,m.useCallback)(t=>{f?f(t):v({title:"Action failed",body:t,tone:"error"})},[f,v]),L=(0,m.useCallback)(()=>{c.invalidateQueries({queryKey:d.agents.detail(e.id)}),c.invalidateQueries({queryKey:d.agents.detail(P)}),c.invalidateQueries({queryKey:d.agents.runtimeState(e.id)}),c.invalidateQueries({queryKey:d.agents.taskSessions(e.id)}),o&&(c.invalidateQueries({queryKey:d.agents.list(o)}),c.invalidateQueries({queryKey:d.liveRuns(o)}),c.invalidateQueries({queryKey:d.heartbeats(o,e.id)}))},[e.id,P,c,o]),h=T({mutationFn:r(async t=>{switch(t){case"invoke":return l.invoke(e.id,o??void 0);case"pause":return l.pause(e.id,o??void 0);case"resume":return l.resume(e.id,o??void 0);case"clear_error":return l.clearError(e.id,o??void 0);case"approve":return l.approve(e.id,o??void 0);case"terminate":return l.terminate(e.id,o??void 0)}},"mutationFn"),onSuccess:r((t,u)=>{if(f?.(null),L(),u==="terminate"){const x=t.lifecycleState;if(x==="terminating"||x==="cleaning_up"||!k(b))return;I?.(t)}if(u==="invoke"&&N&&t&&typeof t=="object"&&"id"in t){if(!k(b))return;_(`/agents/${P}/runs/${t.id}`)}},"onSuccess"),onError:r(t=>{q(t instanceof Error?t.message:"Action failed")},"onError")}),H=T({mutationFn:r(()=>l.invoke(e.id,o??void 0,{debug:{providerTrace:"raw"}}),"mutationFn"),onSuccess:r(t=>{if(f?.(null),L(),N){if(!k(b))return;_(`/agents/${P}/runs/${t.id}`)}},"onSuccess"),onError:r(t=>{q(t instanceof Error?t.message:"Failed to start traced run")},"onError")}),g=T({mutationFn:r(async()=>{if(!o)throw new Error("Agent is not ready to duplicate");const t=await Ye(e.id,o),u=Je(e,t);try{return await l.create(o,u)}catch(x){if(x instanceof je&&x.status===409&&x.message.includes("requires board approval"))return(await l.hire(o,u)).agent;throw x}},"mutationFn"),onSuccess:r(async t=>{f?.(null),o&&await c.invalidateQueries({queryKey:d.agents.list(o)}),v({title:"Agent duplicated",body:t.name,tone:"success"}),k(G)&&_(`/agents/${X(t)}/dashboard`)},"onSuccess"),onError:r(t=>{const u=t instanceof Error?t.message:"Failed to duplicate agent";f?.(u),v({title:"Could not duplicate agent",body:u,tone:"error"})},"onError")}),ue=(0,m.useCallback)(()=>{if(g.isPending)return;const t=z(e.name),u=window.confirm(`Duplicate ${e.name} as ${t}?`);j(!1),!(!u||!A(G))&&g.mutate()},[e.name,g]),de=T({mutationFn:r(()=>l.resetSession(e.id,null,o??void 0),"mutationFn"),onSuccess:r(()=>{f?.(null),c.invalidateQueries({queryKey:d.agents.runtimeState(e.id)}),c.invalidateQueries({queryKey:d.agents.taskSessions(e.id)})},"onSuccess"),onError:r(t=>{q(t instanceof Error?t.message:"Failed to reset session")},"onError")}),U=e.status==="pending_approval",O=ee||h.isPending||H.isPending,K=O||U||D||e.status==="terminated",me=O||U||J&&D||!!(e.lifecycleState&&["pausing","terminating","cleaning_up","terminated","rejected"].includes(e.lifecycleState)),pe=O,R=e.runtimeConfig,fe=(R&&typeof R.debug=="object"&&R.debug!==null?R.debug:null)?.providerTrace==="raw";return(0,s.jsxs)("div",{className:ne??"flex items-center gap-1 sm:gap-2 shrink-0",children:[fe?(0,s.jsxs)("span",{className:"hidden items-center gap-1 rounded-md border border-accent/30 bg-accent/10 px-2 py-1 text-xs font-medium text-accent lg:inline-flex",title:"Exact provider traffic will be captured for future runs and retained for up to 24 hours.",children:[(0,s.jsx)(Y,{className:"h-3.5 w-3.5"}),"Raw tracing on"]}):null,(0,s.jsxs)(y,{variant:"secondary",size:a,onClick:r(()=>ae({assigneeAgentId:e.id}),"onClick"),disabled:K,title:D?se:void 0,children:[(0,s.jsx)(Oe,{className:"h-3.5 w-3.5 sm:mr-1"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:n})]}),w&&(0,s.jsx)(Le,{onClick:r(()=>{N&&!A(b)||h.mutate("invoke")},"onClick"),disabled:K,label:p,size:a}),te&&(0,s.jsxs)(y,{variant:"secondary",size:a,onClick:r(()=>{N&&!A(b)||H.mutate()},"onClick"),disabled:K,title:"Capture exact provider traffic for this run (expires after 24 hours)",children:[(0,s.jsx)(Y,{className:"h-3.5 w-3.5 sm:mr-1"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"Run with provider trace"})]}),ce?(0,s.jsx)(Ue,{onClick:r(()=>h.mutate("clear_error"),"onClick"),disabled:pe,size:a}):(0,s.jsx)(He,{isPaused:J,onPause:r(()=>S?M(!0):h.mutate("pause"),"onPause"),onResume:r(()=>h.mutate("resume"),"onResume"),disabled:me,size:a}),S&&(0,s.jsx)(Re,{open:le,onOpenChange:M,children:(0,s.jsxs)(Ne,{children:[(0,s.jsxs)(Pe,{children:[(0,s.jsx)(we,{children:S.title}),(0,s.jsx)(Ce,{asChild:!0,children:(0,s.jsx)("div",{children:S.description})})]}),(0,s.jsxs)(Ae,{children:[(0,s.jsx)(ke,{children:"Cancel"}),(0,s.jsx)(Se,{onClick:r(()=>h.mutate("pause"),"onClick"),children:"Pause anyway"})]})]})}),C&&(0,s.jsx)("span",{className:"hidden sm:inline",children:(0,s.jsx)(Me,{status:e.status})}),ie,(0,s.jsxs)(_e,{open:oe,onOpenChange:j,children:[(0,s.jsx)(Te,{asChild:!0,children:(0,s.jsx)(y,{variant:"ghost",size:"icon-xs","aria-label":`Open actions for ${e.name}`,children:(0,s.jsx)(Ee,{className:"h-4 w-4"})})}),(0,s.jsxs)(De,{className:"w-44 p-1",align:"end",children:[(0,s.jsxs)("button",{className:"flex items-center gap-2 w-full px-2 py-1.5 text-xs rounded hover:bg-bg-3/50",disabled:g.isPending,onClick:ue,children:[g.isPending?(0,s.jsx)(Fe,{className:"h-3 w-3 animate-spin"}):(0,s.jsx)(V,{className:"h-3 w-3"}),"Duplicate Agent"]}),(0,s.jsxs)("button",{className:"flex items-center gap-2 w-full px-2 py-1.5 text-xs rounded hover:bg-bg-3/50",onClick:r(()=>{$e(e.id).catch(()=>{v({title:"Copy failed",body:"Clipboard access is unavailable.",tone:"error"})}),j(!1)},"onClick"),children:[(0,s.jsx)(V,{className:"h-3 w-3"}),"Copy Agent ID"]}),(0,s.jsxs)("button",{className:"flex items-center gap-2 w-full px-2 py-1.5 text-xs rounded hover:bg-bg-3/50",onClick:r(()=>{de.mutate(),j(!1)},"onClick"),children:[(0,s.jsx)(Ke,{className:"h-3 w-3"}),"Reset Sessions"]}),!re&&(0,s.jsxs)("button",{className:"flex items-center gap-2 w-full px-2 py-1.5 text-xs rounded hover:bg-bg-3/50 text-bad",onClick:r(()=>{j(!1),!(I&&!A(b))&&h.mutate("terminate")},"onClick"),children:[(0,s.jsx)(Be,{className:"h-3 w-3"}),"Terminate"]})]})]})]})}r(xs,"AgentActionButtons");export{Le as n,xs as t};
@@ -1 +1 @@
1
- var j=Object.defineProperty;var o=(r,t)=>j(r,"name",{value:t,configurable:!0});import{i as C}from"./rolldown-runtime-ZpX3ckPj.js";import{Fr as k,na as F,r as _,ta as I}from"./createLucideIcon-CnVGnh-n.js";import{v as K}from"./star-BfGDDjEq.js";import{X as E,t as u,v as y}from"./queryKeys-DNib4smf.js";import{o as N}from"./companies-query-FYH9QaJX.js";import{n as Q}from"./IssueDetail-Bj-rX3fF.js";import{n as w}from"./CompanyContext-D89SijyS.js";import"./router-C-DPy1sQ.js";import{t as A}from"./agents-Boy51qGF.js";import{t as P}from"./useAgentChatEnabled-tzN4IK9m.js";import{t as v}from"./agentChats-QaIYmlur.js";import{t as R}from"./recent-agent-chats-Ck-_LZ6Q.js";var p=C(F(),1),c=C(I(),1);function O(){const{agentRef:r=""}=K(),{selectedCompanyId:t}=w(),{enabled:d,loaded:b}=P(),f=E(),m=y({queryKey:u.agents.list(t),queryFn:o(()=>A.list(t),"queryFn"),enabled:!!t}),n=y({queryKey:u.auth.session,queryFn:o(()=>N.getSession(),"queryFn")}),a=n.data?.user?.id??n.data?.session?.userId??null,h=m.data?.find(g=>g.id===r||_(g)===r),l=y({queryKey:u.agents.detail(r),queryFn:o(()=>A.get(r,t),"queryFn"),enabled:d&&!!t&&m.isSuccess&&!h&&k(r)}),e=h??(l.data?.companyId===t?l.data:void 0),q=u.agentChats.detail(t,a,e?.id),s=y({queryKey:q,queryFn:o(()=>v.get(t,e.id),"queryFn"),enabled:d&&!!e&&n.isFetched}),x=(0,p.useRef)(null);(0,p.useEffect)(()=>{x.current=null},[t,a,e?.id]),(0,p.useEffect)(()=>{d&&e&&n.isSuccess&&s.isSuccess&&R(e.companyId,a,e.id,s.data?.id??null)},[d,e?.id,e?.companyId,a,n.isSuccess,s.isSuccess,s.data?.id]);const S=(0,p.useCallback)(async()=>{if(!e||!t)throw new Error("Agent not found");if(s.data)return s.data;const g=x.current??=v.ensure(t,e.id);try{const i=await g;return f.setQueryData(u.issues.detail(i.id),i),f.setQueryData(q,i),f.invalidateQueries({queryKey:u.agentChats.list(t,a)}),i}catch(i){throw x.current=null,i}},[e,t,s.data,f,a]);return!b||m.isPending||n.isPending||l.isFetching&&!e?(0,c.jsx)("p",{className:"text-sm text-ink-3",children:"Loading conversation…"}):!d&&!s.data?(0,c.jsx)("p",{className:"text-sm text-ink-3",children:"Agent chat is off. Turn it on in Settings > Features. Existing history remains available through task links."}):m.error||s.error||!h&&l.error?(0,c.jsx)("p",{className:"text-sm text-bad",children:(m.error??s.error??l.error)?.message}):e?s.isPending?(0,c.jsx)("p",{className:"text-sm text-ink-3",children:"Loading conversation…"}):(0,c.jsx)(Q,{conversation:{agent:e,issue:s.data??null,ensureIssue:S}},`${e.id}:${a}`):(0,c.jsx)("p",{className:"text-sm text-bad",children:"Agent not found."})}o(O,"AgentChat");export{O as AgentChat};
1
+ var j=Object.defineProperty;var o=(r,t)=>j(r,"name",{value:t,configurable:!0});import{i as C}from"./rolldown-runtime-ZpX3ckPj.js";import{Fr as k,na as F,r as _,ta as I}from"./createLucideIcon-CnVGnh-n.js";import{v as K}from"./star-BfGDDjEq.js";import{X as E,t as u,v as y}from"./queryKeys-DNib4smf.js";import{o as N}from"./companies-query-FYH9QaJX.js";import{n as Q}from"./IssueDetail-DsS131t7.js";import{n as w}from"./CompanyContext-D89SijyS.js";import"./router-C-DPy1sQ.js";import{t as A}from"./agents-Boy51qGF.js";import{t as P}from"./useAgentChatEnabled-tzN4IK9m.js";import{t as v}from"./agentChats-QaIYmlur.js";import{t as R}from"./recent-agent-chats-Ck-_LZ6Q.js";var p=C(F(),1),c=C(I(),1);function O(){const{agentRef:r=""}=K(),{selectedCompanyId:t}=w(),{enabled:d,loaded:b}=P(),f=E(),m=y({queryKey:u.agents.list(t),queryFn:o(()=>A.list(t),"queryFn"),enabled:!!t}),n=y({queryKey:u.auth.session,queryFn:o(()=>N.getSession(),"queryFn")}),a=n.data?.user?.id??n.data?.session?.userId??null,h=m.data?.find(g=>g.id===r||_(g)===r),l=y({queryKey:u.agents.detail(r),queryFn:o(()=>A.get(r,t),"queryFn"),enabled:d&&!!t&&m.isSuccess&&!h&&k(r)}),e=h??(l.data?.companyId===t?l.data:void 0),q=u.agentChats.detail(t,a,e?.id),s=y({queryKey:q,queryFn:o(()=>v.get(t,e.id),"queryFn"),enabled:d&&!!e&&n.isFetched}),x=(0,p.useRef)(null);(0,p.useEffect)(()=>{x.current=null},[t,a,e?.id]),(0,p.useEffect)(()=>{d&&e&&n.isSuccess&&s.isSuccess&&R(e.companyId,a,e.id,s.data?.id??null)},[d,e?.id,e?.companyId,a,n.isSuccess,s.isSuccess,s.data?.id]);const S=(0,p.useCallback)(async()=>{if(!e||!t)throw new Error("Agent not found");if(s.data)return s.data;const g=x.current??=v.ensure(t,e.id);try{const i=await g;return f.setQueryData(u.issues.detail(i.id),i),f.setQueryData(q,i),f.invalidateQueries({queryKey:u.agentChats.list(t,a)}),i}catch(i){throw x.current=null,i}},[e,t,s.data,f,a]);return!b||m.isPending||n.isPending||l.isFetching&&!e?(0,c.jsx)("p",{className:"text-sm text-ink-3",children:"Loading conversation…"}):!d&&!s.data?(0,c.jsx)("p",{className:"text-sm text-ink-3",children:"Agent chat is off. Turn it on in Settings > Features. Existing history remains available through task links."}):m.error||s.error||!h&&l.error?(0,c.jsx)("p",{className:"text-sm text-bad",children:(m.error??s.error??l.error)?.message}):e?s.isPending?(0,c.jsx)("p",{className:"text-sm text-ink-3",children:"Loading conversation…"}):(0,c.jsx)(Q,{conversation:{agent:e,issue:s.data??null,ensureIssue:S}},`${e.id}:${a}`):(0,c.jsx)("p",{className:"text-sm text-bad",children:"Agent not found."})}o(O,"AgentChat");export{O as AgentChat};
@@ -1 +1 @@
1
- var B=Object.defineProperty;var u=(s,r)=>B(s,"name",{value:r,configurable:!0});import{i as w}from"./rolldown-runtime-ZpX3ckPj.js";import{na as q,r as E,ta as L}from"./createLucideIcon-CnVGnh-n.js";import{o as T,t as U}from"./router-C-DPy1sQ.js";import{t as I}from"./button-C9JA0pR9.js";import{t as z}from"./AgentAvatar-BLZN7-3L.js";import{n as H}from"./BreadcrumbContext-zDw93MZx.js";import{Ea as M,Ha as W,fn as D,pn as G}from"./index-vkQSx4qF.js";import{n as R,r as J}from"./recent-agent-chats-Ck-_LZ6Q.js";var f=w(q(),1),e=w(L(),1);function re(){const{setBreadcrumbs:s}=H(),{companyId:r,userId:o,enabled:l,loaded:n,agents:a,chats:i,session:c}=D();return(0,f.useEffect)(()=>s([{label:"Chat"}]),[s]),(0,e.jsx)(K,{companyId:r,userId:o,enabled:l,loaded:n,agents:a,chats:i,session:c},`${r}:${o}`)}u(re,"AgentChats");function K({companyId:s,userId:r,enabled:o,loaded:l,agents:n,chats:a,session:i}){const c=M(s),F=G(s,r),v=T(),m=J(s??"",r),[N,C]=(0,f.useState)(null),[k,b]=(0,f.useState)(null),x=n.error??i.error,p=m[0],P=n.data?.find(t=>t.id===p),S=!!p&&(!P||!!R(s??"",r,p)),g=m.length>0&&!x&&(!n.isFetched||!i.isFetched||S&&!a.isFetched&&!a.error),O=l&&o&&s&&!x&&!g?m.map(t=>{const d=n.data?.find(j=>j.id===t),A=a.data?.find(j=>j.conversationAgentId===t),_=R(s,r,t);return _&&a.isSuccess&&A?.id!==_?null:d?`/chats/${encodeURIComponent(E(d))}`:A?`/chats/${encodeURIComponent(t)}`:null}).find(t=>t!==null):void 0,y=n.data?.find(t=>t.id===c?.primaryAgentId&&t.status!=="terminated"&&t.status!=="pending_approval"),h=O??(l&&o&&!x&&!g&&n.isFetched&&i.isFetched&&!c?.loading&&y?`/chats/${encodeURIComponent(E(y))}`:void 0);if((0,f.useEffect)(()=>{h&&v(h,{replace:!0})},[v,h]),!l)return(0,e.jsx)("p",{role:"status",className:"text-sm text-ink-3",children:"Loading chat…"});if(!o)return(0,e.jsx)("p",{className:"text-sm text-ink-3",children:"Agent chat is off. Turn it on in Settings > Features."});if(!s)return(0,e.jsx)("p",{className:"text-sm text-ink-3",children:"Select a company to start a conversation."});if(g||h||c?.loading)return(0,e.jsx)("p",{role:"status",className:"text-sm text-ink-3",children:"Opening chat…"});const $=x??(m.length>0?a.error:null);return(0,e.jsxs)("div",{className:"mx-auto flex h-full max-w-xl flex-col justify-center gap-6 px-4 py-12",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,e.jsx)(W,{className:"size-6 text-ink-3"}),(0,e.jsx)("h1",{className:"text-xl font-semibold",children:"Who would you like to talk to?"}),(0,e.jsx)("p",{className:"text-sm leading-relaxed text-ink-3",children:"Ask a question, think through an idea, or plan the next step with your team."})]}),$?(0,e.jsxs)("div",{role:"alert",className:"flex flex-col items-start gap-3",children:[(0,e.jsx)("p",{className:"text-sm",children:"Couldn’t load your chats."}),(0,e.jsx)(I,{variant:"secondary",onClick:u(()=>{n.refetch(),a.refetch(),i.refetch()},"onClick"),children:"Try again"})]}):n.isPending||i.isPending?(0,e.jsx)("p",{role:"status",className:"text-sm text-ink-3",children:"Loading agents…"}):(0,e.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:(n.data??[]).slice(0,6).map(t=>(0,e.jsxs)("button",{type:"button",disabled:N!==null,onClick:u(async()=>{C(t.id),b(null);try{await F(t)}catch(d){b(d instanceof Error?d.message:"Couldn’t open chat. Try again.")}finally{C(null)}},"onClick"),className:"flex items-center gap-3 rounded-lg border border-line p-4 text-left hover:bg-bg-3/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus disabled:opacity-50",children:[(0,e.jsx)(z,{agent:t,size:32}),(0,e.jsxs)("span",{className:"flex min-w-0 flex-col gap-1",children:[(0,e.jsx)("span",{className:"truncate text-sm font-medium",children:t.name}),(0,e.jsx)("span",{className:"text-xs text-ink-3",children:N===t.id?"Opening chat…":t.title??t.role})]})]},t.id))}),k&&(0,e.jsx)("p",{role:"alert",className:"text-sm text-bad",children:k}),n.data?.length===0&&(0,e.jsx)("p",{className:"text-sm text-ink-3",children:"Add an agent to start a conversation."}),(0,e.jsx)(I,{variant:"ghost",className:"self-start",asChild:!0,children:(0,e.jsx)(U,{to:"/agents/all",children:"Browse all agents"})})]})}u(K,"AgentChatsContent");export{re as AgentChats};
1
+ var B=Object.defineProperty;var u=(s,r)=>B(s,"name",{value:r,configurable:!0});import{i as w}from"./rolldown-runtime-ZpX3ckPj.js";import{na as q,r as E,ta as L}from"./createLucideIcon-CnVGnh-n.js";import{o as T,t as U}from"./router-C-DPy1sQ.js";import{t as I}from"./button-C9JA0pR9.js";import{t as z}from"./AgentAvatar-BLZN7-3L.js";import{n as H}from"./BreadcrumbContext-zDw93MZx.js";import{Ea as M,Ha as W,fn as D,pn as G}from"./index-B-KXIl2u.js";import{n as R,r as J}from"./recent-agent-chats-Ck-_LZ6Q.js";var f=w(q(),1),e=w(L(),1);function re(){const{setBreadcrumbs:s}=H(),{companyId:r,userId:o,enabled:l,loaded:n,agents:a,chats:i,session:c}=D();return(0,f.useEffect)(()=>s([{label:"Chat"}]),[s]),(0,e.jsx)(K,{companyId:r,userId:o,enabled:l,loaded:n,agents:a,chats:i,session:c},`${r}:${o}`)}u(re,"AgentChats");function K({companyId:s,userId:r,enabled:o,loaded:l,agents:n,chats:a,session:i}){const c=M(s),F=G(s,r),v=T(),m=J(s??"",r),[N,C]=(0,f.useState)(null),[k,b]=(0,f.useState)(null),x=n.error??i.error,p=m[0],P=n.data?.find(t=>t.id===p),S=!!p&&(!P||!!R(s??"",r,p)),g=m.length>0&&!x&&(!n.isFetched||!i.isFetched||S&&!a.isFetched&&!a.error),O=l&&o&&s&&!x&&!g?m.map(t=>{const d=n.data?.find(j=>j.id===t),A=a.data?.find(j=>j.conversationAgentId===t),_=R(s,r,t);return _&&a.isSuccess&&A?.id!==_?null:d?`/chats/${encodeURIComponent(E(d))}`:A?`/chats/${encodeURIComponent(t)}`:null}).find(t=>t!==null):void 0,y=n.data?.find(t=>t.id===c?.primaryAgentId&&t.status!=="terminated"&&t.status!=="pending_approval"),h=O??(l&&o&&!x&&!g&&n.isFetched&&i.isFetched&&!c?.loading&&y?`/chats/${encodeURIComponent(E(y))}`:void 0);if((0,f.useEffect)(()=>{h&&v(h,{replace:!0})},[v,h]),!l)return(0,e.jsx)("p",{role:"status",className:"text-sm text-ink-3",children:"Loading chat…"});if(!o)return(0,e.jsx)("p",{className:"text-sm text-ink-3",children:"Agent chat is off. Turn it on in Settings > Features."});if(!s)return(0,e.jsx)("p",{className:"text-sm text-ink-3",children:"Select a company to start a conversation."});if(g||h||c?.loading)return(0,e.jsx)("p",{role:"status",className:"text-sm text-ink-3",children:"Opening chat…"});const $=x??(m.length>0?a.error:null);return(0,e.jsxs)("div",{className:"mx-auto flex h-full max-w-xl flex-col justify-center gap-6 px-4 py-12",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,e.jsx)(W,{className:"size-6 text-ink-3"}),(0,e.jsx)("h1",{className:"text-xl font-semibold",children:"Who would you like to talk to?"}),(0,e.jsx)("p",{className:"text-sm leading-relaxed text-ink-3",children:"Ask a question, think through an idea, or plan the next step with your team."})]}),$?(0,e.jsxs)("div",{role:"alert",className:"flex flex-col items-start gap-3",children:[(0,e.jsx)("p",{className:"text-sm",children:"Couldn’t load your chats."}),(0,e.jsx)(I,{variant:"secondary",onClick:u(()=>{n.refetch(),a.refetch(),i.refetch()},"onClick"),children:"Try again"})]}):n.isPending||i.isPending?(0,e.jsx)("p",{role:"status",className:"text-sm text-ink-3",children:"Loading agents…"}):(0,e.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:(n.data??[]).slice(0,6).map(t=>(0,e.jsxs)("button",{type:"button",disabled:N!==null,onClick:u(async()=>{C(t.id),b(null);try{await F(t)}catch(d){b(d instanceof Error?d.message:"Couldn’t open chat. Try again.")}finally{C(null)}},"onClick"),className:"flex items-center gap-3 rounded-lg border border-line p-4 text-left hover:bg-bg-3/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus disabled:opacity-50",children:[(0,e.jsx)(z,{agent:t,size:32}),(0,e.jsxs)("span",{className:"flex min-w-0 flex-col gap-1",children:[(0,e.jsx)("span",{className:"truncate text-sm font-medium",children:t.name}),(0,e.jsx)("span",{className:"text-xs text-ink-3",children:N===t.id?"Opening chat…":t.title??t.role})]})]},t.id))}),k&&(0,e.jsx)("p",{role:"alert",className:"text-sm text-bad",children:k}),n.data?.length===0&&(0,e.jsx)("p",{className:"text-sm text-ink-3",children:"Add an agent to start a conversation."}),(0,e.jsx)(I,{variant:"ghost",className:"self-start",asChild:!0,children:(0,e.jsx)(U,{to:"/agents/all",children:"Browse all agents"})})]})}u(K,"AgentChatsContent");export{re as AgentChats};
@@ -1 +1 @@
1
- var R=Object.defineProperty;var n=(t,s)=>R(t,"name",{value:s,configurable:!0});import{i as D}from"./rolldown-runtime-ZpX3ckPj.js";import{G as $,J as _,L as F,R as M,X as K,Z as B,na as Q,ta as V,tt as I,z as P}from"./createLucideIcon-CnVGnh-n.js";import{X as U,_ as z,t as p,v as O}from"./queryKeys-DNib4smf.js";import{n as G}from"./CompanyContext-D89SijyS.js";import{t as X}from"./router-C-DPy1sQ.js";import{t as Y}from"./arrow-right-C_bgbn5v.js";import{t as H}from"./agents-Boy51qGF.js";import{n as J}from"./BreadcrumbContext-zDw93MZx.js";import{c as Z,d as E,l as W,r as ee,s as se,t as k,u as te}from"./omp-settings-model-jf15zx3y.js";import{n as ae,r as ne,t as re}from"./ChoiceControls-Co4p9sM9.js";var l=D(Q(),1),e=D(V(),1);function u(t,s){return`${t} ${s}${t===1?"":"s"}`}n(u,"plural");function le(t){return`$${(t/100).toFixed(2)}`}n(le,"formatCost");function ie(t){return t===null?"-":t<60?`${Math.round(t)} s`:`${Math.round(t/60)} min`}n(ie,"formatDuration");function oe({companyId:t}){const s=O({queryKey:p.agentDefaults.presetUsage(t),queryFn:n(()=>E.presetUsage(t),"queryFn")}),i=s.data?.rows??[];return(0,e.jsxs)("section",{"aria-labelledby":"preset-usage-title",className:"overflow-hidden rounded-lg border border-line bg-bg-2",children:[(0,e.jsx)("div",{className:"flex items-baseline justify-between gap-3 border-b border-line px-4 py-2.5 sm:px-5",children:(0,e.jsx)("h2",{id:"preset-usage-title",className:"text-xs font-semibold uppercase tracking-wide text-ink-3",children:"Style presets, last 7 days"})}),s.isLoading?(0,e.jsx)("p",{className:"px-4 py-3 text-sm text-ink-3 sm:px-5",children:"Loading..."}):i.length===0?(0,e.jsx)("p",{className:"px-4 py-3 text-sm text-ink-3 sm:px-5",children:"No runs with a Style preset yet. Numbers appear once agents run with one."}):(0,e.jsx)("div",{className:"px-4 sm:px-5",children:(0,e.jsxs)("table",{"aria-label":"Style presets, last 7 days",className:"stack-table w-full text-sm",children:[(0,e.jsx)("thead",{children:(0,e.jsxs)("tr",{className:"text-left text-xs text-ink-3",children:[(0,e.jsx)("th",{className:"py-2 font-medium",children:"Preset"}),(0,e.jsx)("th",{className:"py-2 font-medium",children:"Runs"}),(0,e.jsx)("th",{className:"py-2 font-medium",children:"Avg duration"}),(0,e.jsx)("th",{className:"py-2 text-right font-medium",children:"Cost"})]})}),(0,e.jsx)("tbody",{children:i.map(r=>(0,e.jsxs)("tr",{className:"border-t border-line",children:[(0,e.jsx)("td",{"data-cell":"title",children:$[r.preset]?.label??r.preset}),(0,e.jsx)("td",{"data-cell":"meta","data-label":"Runs",children:r.runs}),(0,e.jsx)("td",{"data-cell":"meta","data-label":"Avg",children:ie(r.avgDurationSec)}),(0,e.jsx)("td",{"data-cell":"end",className:"text-right tabular-nums",children:le(r.costCents)})]},r.preset))})]})})]})}n(oe,"PresetUsageTable");function ve(){const{setBreadcrumbs:t}=J(),{selectedCompanyId:s}=G(),i=U(),r=Z(s),g=W(s),N=te(s),w=O({queryKey:p.agents.list(s??""),queryFn:n(()=>H.list(s),"queryFn"),enabled:!!s}),[C,x]=(0,l.useState)({}),[T,f]=(0,l.useState)(null);(0,l.useEffect)(()=>{t([{label:"Settings",href:"/company/settings"},{label:"Agent defaults"}])},[t]);const o=r.data?.values??{},h=(0,l.useMemo)(()=>B(o),[o]),m=(0,l.useMemo)(()=>K(h,C),[h,C]),c=(0,l.useMemo)(()=>(w.data??[]).filter(a=>a.adapterType==="omp_local"&&a.status!=="terminated").map(a=>({id:a.id,name:a.name,adapterConfig:a.adapterConfig??{}})),[w.data]),y=(0,l.useMemo)(()=>se(m),[m]),d=(0,l.useMemo)(()=>I(c,o,y),[c,o,y]),A=ee(h,m),b=z({mutationFn:n(()=>E.save(s,y),"mutationFn"),onSuccess:n(async()=>{x({}),f(null),await Promise.all([i.invalidateQueries({queryKey:p.agentDefaults.values(s)}),i.invalidateQueries({queryKey:p.agents.list(s)}),i.invalidateQueries({queryKey:["agents","detail"]})])},"onSuccess"),onError:n(a=>f(a instanceof Error?a.message:"Defaults were not saved."),"onError")});if(!s)return null;if(r.isLoading)return(0,e.jsx)("div",{className:"text-sm text-ink-3",children:"Loading agent defaults..."});if(r.error)return(0,e.jsx)("div",{className:"text-sm text-bad",children:r.error.message||"Failed to load agent defaults."});const S=c.filter(a=>_(a.adapterConfig,o,M.flatMap(j=>[...P[j]]))).length,L=(N.data?.settings.length??0)+F.length;return(0,e.jsxs)("div",{className:"max-w-4xl space-y-5 pb-4",children:[(0,e.jsxs)("div",{className:"space-y-1",children:[(0,e.jsx)("h1",{className:"text-lg font-semibold",children:"Agent defaults"}),(0,e.jsxs)("p",{className:"text-sm text-ink-3",children:["Every OMP agent starts from these. ",u(S,"agent")," ",S===1?"has its":"have their"," own values for some of them."]})]}),g.error?(0,e.jsxs)("div",{role:"alert",className:"rounded-md border border-warn px-3 py-2 text-sm text-ink-2",children:["OMP did not report its models: ",g.error.message,". Model choices stay empty until it does."]}):null,(0,e.jsx)("section",{"aria-label":"Agent defaults",className:"overflow-hidden rounded-lg border border-line bg-bg-2",children:M.map(a=>{const j=c.filter(v=>!_(v.adapterConfig,o,P[a])).length;return(0,e.jsx)(ae,{label:k[a].label,sub:(0,e.jsxs)(e.Fragment,{children:[k[a].help,c.length>0?(0,e.jsxs)("span",{className:"block text-xs",children:[u(j,"agent")," follow this"]}):null]}),children:(0,e.jsx)(re,{control:a,config:m,models:g.data??[],disabled:b.isPending,onPatch:n(v=>x(q=>({...q,...v})),"onPatch")})},a)})}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,e.jsxs)(X,{to:"/company/settings/agent-defaults/all",className:"inline-flex min-h-6 items-center gap-1 text-sm text-accent underline underline-offset-4",children:["All settings",N.data?` (${L})`:"",(0,e.jsx)(Y,{"aria-hidden":"true",className:"size-3.5"})]}),(0,e.jsx)("span",{className:"text-sm text-ink-3",children:"For people who know OMP keys"})]}),(0,e.jsx)(oe,{companyId:s}),A.length>0?(0,e.jsx)(ne,{saving:b.isPending,error:T,onDiscard:n(()=>{x({}),f(null)},"onDiscard"),onSave:n(()=>b.mutate(),"onSave"),summary:(0,e.jsxs)("span",{children:[(0,e.jsx)("b",{children:u(A.length,"change")})," · applies to ",u(d.following,"agent"),d.ownValues>0?` · ${u(d.ownValues,"agent")} ${d.ownValues===1?"keeps its":"keep their"} own value`:""," · ",d.following===0?"no session changes":d.sessionKept?"keeps their sessions":"their next run starts a new session"]})}):null]})}n(ve,"AgentDefaults");export{ve as AgentDefaults};
1
+ var R=Object.defineProperty;var n=(t,s)=>R(t,"name",{value:s,configurable:!0});import{i as D}from"./rolldown-runtime-ZpX3ckPj.js";import{G as $,J as _,L as F,R as M,X as K,Z as B,na as Q,ta as V,tt as I,z as P}from"./createLucideIcon-CnVGnh-n.js";import{X as U,_ as z,t as p,v as O}from"./queryKeys-DNib4smf.js";import{n as G}from"./CompanyContext-D89SijyS.js";import{t as X}from"./router-C-DPy1sQ.js";import{t as Y}from"./arrow-right-C_bgbn5v.js";import{t as H}from"./agents-Boy51qGF.js";import{n as J}from"./BreadcrumbContext-zDw93MZx.js";import{c as Z,d as E,l as W,r as ee,s as se,t as k,u as te}from"./omp-settings-model-jf15zx3y.js";import{n as ae,r as ne,t as re}from"./ChoiceControls-CWglRSOv.js";var l=D(Q(),1),e=D(V(),1);function u(t,s){return`${t} ${s}${t===1?"":"s"}`}n(u,"plural");function le(t){return`$${(t/100).toFixed(2)}`}n(le,"formatCost");function ie(t){return t===null?"-":t<60?`${Math.round(t)} s`:`${Math.round(t/60)} min`}n(ie,"formatDuration");function oe({companyId:t}){const s=O({queryKey:p.agentDefaults.presetUsage(t),queryFn:n(()=>E.presetUsage(t),"queryFn")}),i=s.data?.rows??[];return(0,e.jsxs)("section",{"aria-labelledby":"preset-usage-title",className:"overflow-hidden rounded-lg border border-line bg-bg-2",children:[(0,e.jsx)("div",{className:"flex items-baseline justify-between gap-3 border-b border-line px-4 py-2.5 sm:px-5",children:(0,e.jsx)("h2",{id:"preset-usage-title",className:"text-xs font-semibold uppercase tracking-wide text-ink-3",children:"Style presets, last 7 days"})}),s.isLoading?(0,e.jsx)("p",{className:"px-4 py-3 text-sm text-ink-3 sm:px-5",children:"Loading..."}):i.length===0?(0,e.jsx)("p",{className:"px-4 py-3 text-sm text-ink-3 sm:px-5",children:"No runs with a Style preset yet. Numbers appear once agents run with one."}):(0,e.jsx)("div",{className:"px-4 sm:px-5",children:(0,e.jsxs)("table",{"aria-label":"Style presets, last 7 days",className:"stack-table w-full text-sm",children:[(0,e.jsx)("thead",{children:(0,e.jsxs)("tr",{className:"text-left text-xs text-ink-3",children:[(0,e.jsx)("th",{className:"py-2 font-medium",children:"Preset"}),(0,e.jsx)("th",{className:"py-2 font-medium",children:"Runs"}),(0,e.jsx)("th",{className:"py-2 font-medium",children:"Avg duration"}),(0,e.jsx)("th",{className:"py-2 text-right font-medium",children:"Cost"})]})}),(0,e.jsx)("tbody",{children:i.map(r=>(0,e.jsxs)("tr",{className:"border-t border-line",children:[(0,e.jsx)("td",{"data-cell":"title",children:$[r.preset]?.label??r.preset}),(0,e.jsx)("td",{"data-cell":"meta","data-label":"Runs",children:r.runs}),(0,e.jsx)("td",{"data-cell":"meta","data-label":"Avg",children:ie(r.avgDurationSec)}),(0,e.jsx)("td",{"data-cell":"end",className:"text-right tabular-nums",children:le(r.costCents)})]},r.preset))})]})})]})}n(oe,"PresetUsageTable");function ve(){const{setBreadcrumbs:t}=J(),{selectedCompanyId:s}=G(),i=U(),r=Z(s),g=W(s),N=te(s),w=O({queryKey:p.agents.list(s??""),queryFn:n(()=>H.list(s),"queryFn"),enabled:!!s}),[C,x]=(0,l.useState)({}),[T,f]=(0,l.useState)(null);(0,l.useEffect)(()=>{t([{label:"Settings",href:"/company/settings"},{label:"Agent defaults"}])},[t]);const o=r.data?.values??{},h=(0,l.useMemo)(()=>B(o),[o]),m=(0,l.useMemo)(()=>K(h,C),[h,C]),c=(0,l.useMemo)(()=>(w.data??[]).filter(a=>a.adapterType==="omp_local"&&a.status!=="terminated").map(a=>({id:a.id,name:a.name,adapterConfig:a.adapterConfig??{}})),[w.data]),y=(0,l.useMemo)(()=>se(m),[m]),d=(0,l.useMemo)(()=>I(c,o,y),[c,o,y]),A=ee(h,m),b=z({mutationFn:n(()=>E.save(s,y),"mutationFn"),onSuccess:n(async()=>{x({}),f(null),await Promise.all([i.invalidateQueries({queryKey:p.agentDefaults.values(s)}),i.invalidateQueries({queryKey:p.agents.list(s)}),i.invalidateQueries({queryKey:["agents","detail"]})])},"onSuccess"),onError:n(a=>f(a instanceof Error?a.message:"Defaults were not saved."),"onError")});if(!s)return null;if(r.isLoading)return(0,e.jsx)("div",{className:"text-sm text-ink-3",children:"Loading agent defaults..."});if(r.error)return(0,e.jsx)("div",{className:"text-sm text-bad",children:r.error.message||"Failed to load agent defaults."});const S=c.filter(a=>_(a.adapterConfig,o,M.flatMap(j=>[...P[j]]))).length,L=(N.data?.settings.length??0)+F.length;return(0,e.jsxs)("div",{className:"max-w-4xl space-y-5 pb-4",children:[(0,e.jsxs)("div",{className:"space-y-1",children:[(0,e.jsx)("h1",{className:"text-lg font-semibold",children:"Agent defaults"}),(0,e.jsxs)("p",{className:"text-sm text-ink-3",children:["Every OMP agent starts from these. ",u(S,"agent")," ",S===1?"has its":"have their"," own values for some of them."]})]}),g.error?(0,e.jsxs)("div",{role:"alert",className:"rounded-md border border-warn px-3 py-2 text-sm text-ink-2",children:["OMP did not report its models: ",g.error.message,". Model choices stay empty until it does."]}):null,(0,e.jsx)("section",{"aria-label":"Agent defaults",className:"overflow-hidden rounded-lg border border-line bg-bg-2",children:M.map(a=>{const j=c.filter(v=>!_(v.adapterConfig,o,P[a])).length;return(0,e.jsx)(ae,{label:k[a].label,sub:(0,e.jsxs)(e.Fragment,{children:[k[a].help,c.length>0?(0,e.jsxs)("span",{className:"block text-xs",children:[u(j,"agent")," follow this"]}):null]}),children:(0,e.jsx)(re,{control:a,config:m,models:g.data??[],disabled:b.isPending,onPatch:n(v=>x(q=>({...q,...v})),"onPatch")})},a)})}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,e.jsxs)(X,{to:"/company/settings/agent-defaults/all",className:"inline-flex min-h-6 items-center gap-1 text-sm text-accent underline underline-offset-4",children:["All settings",N.data?` (${L})`:"",(0,e.jsx)(Y,{"aria-hidden":"true",className:"size-3.5"})]}),(0,e.jsx)("span",{className:"text-sm text-ink-3",children:"For people who know OMP keys"})]}),(0,e.jsx)(oe,{companyId:s}),A.length>0?(0,e.jsx)(ne,{saving:b.isPending,error:T,onDiscard:n(()=>{x({}),f(null)},"onDiscard"),onSave:n(()=>b.mutate(),"onSave"),summary:(0,e.jsxs)("span",{children:[(0,e.jsx)("b",{children:u(A.length,"change")})," · applies to ",u(d.following,"agent"),d.ownValues>0?` · ${u(d.ownValues,"agent")} ${d.ownValues===1?"keeps its":"keep their"} own value`:""," · ",d.following===0?"no session changes":d.sessionKept?"keeps their sessions":"their next run starts a new session"]})}):null]})}n(ve,"AgentDefaults");export{ve as AgentDefaults};
@@ -1,4 +1,4 @@
1
- var Kn=Object.defineProperty;var n=(t,s)=>Kn(t,"name",{value:s,configurable:!0});import{i as tn}from"./rolldown-runtime-ZpX3ckPj.js";import{A as On,Dt as zn,Et as Wn,Fr as Un,J as Ss,O as We,R as Gt,X as Hn,Y as Qn,Z as Gn,gn as Vn,it as Cs,k as Jn,l as T,m as Mt,na as Yn,r as Nt,t as Ut,ta as Xn,x as Ge,z as It}from"./createLucideIcon-CnVGnh-n.js";import{a as xs,h as Zn,m as er,n as tr,r as sr,v as sn}from"./star-BfGDDjEq.js";import{X as Be,_ as ae,g as nr,h as Is,n as ps,t as k,v as W}from"./queryKeys-DNib4smf.js";import{t as rr}from"./useInfiniteQuery-C4lR2e-S.js";import{t as As}from"./useQueries-ho7DFwNj.js";import{A as ar,E as ir,M as lr,_ as or,a as cr,ct as dr,i as ur,j as mr,o as Dt,s as nn,w as xr,x as pr}from"./ConnectionSetupFlow-BsbmkX_F.js";import{n as hr,r as fr}from"./responsible-user-denial-Dyl0BwU5.js";import{d as gr,f as yr}from"./connection-identity-Bm66aoli.js";import{n as rn}from"./CompanyContext-D89SijyS.js";import{E as as,J as br,b as vr,o as pt,r as Rs,t as ce,zt as dt}from"./router-C-DPy1sQ.js";import{n as hs,r as fs,t as gs}from"./collapsible-Bs-NoX6d.js";import{a as an,c as ln,i as on,l as cn,n as dn,o as un,r as mn,s as xn,t as pn}from"./alert-dialog-CJbRV6SV.js";import{t as jr}from"./checkbox-6fEY2YjF.js";import{c as is,t as Nr}from"./MarkdownEditor-uTRtpg12.js";import{t as kr}from"./arrow-left-CtrJnaew.js";import{t as wr}from"./arrow-right-C_bgbn5v.js";import{t as Es}from"./boxes-CyuQgdnj.js";import{t as hn}from"./check-C1U2nLnR.js";import{t as He}from"./chevron-down-D5bzoGsg.js";import{t as Pe}from"./chevron-right-Bmb_ezMx.js";import{t as ys}from"./circle-alert-DPz75VwF.js";import{a as Sr,c as fn,d as Cr,i as Ir,l as Ar,n as Rr,o as Er,r as Tr,s as _r,t as Lr,u as Fr}from"./ScrollToBottom-BxLqk3aD.js";import{t as $t}from"./circle-question-mark-DLsjfYUH.js";import{t as $r}from"./circle-x-cIA5MZ-h.js";import{t as Bt}from"./clock-B4oKbxMj.js";import{t as st}from"./MarkdownBody-D5KQijmo.js";import{t as vt}from"./copy-D5hPdWqB.js";import{t as Pr}from"./external-link-CrKfWC2s.js";import{t as qr}from"./eye-off-Bv7z1y6E.js";import{t as gn}from"./eye-CkUyzQ21.js";import{t as Mr}from"./folder-open-BWyhdPrR.js";import{t as Dr}from"./link-2-BILyowKB.js";import{r as Kt,t as M}from"./button-C9JA0pR9.js";import{t as Br}from"./message-square-plus-Tl3pwEJu.js";import{r as Kr}from"./TaskChatProtocolCard-BvDJtGnF.js";import{t as Or}from"./plus-iKvhycbm.js";import{t as Pt}from"./rotate-ccw-Ck2ggAft.js";import{t as zr}from"./search-BCl----c.js";import{t as Vt}from"./triangle-alert-DeBU3xr-.js";import{t as Wr}from"./user-BnWruK-H.js";import{t as Ur}from"./x-BbL4w9tC.js";import{r as bs}from"./SidebarContext-B0ZkpTwu.js";import{t as Hr}from"./MootMark-B4vfsc5p.js";import{i as lt,n as ot,r as Qr,t as ct}from"./tooltip-DF9afEsd.js";import{t as Ue}from"./badge-B56aAvuf.js";import{a as vs}from"./ToastContext-D-Mqs4di.js";import{t as J}from"./agents-Boy51qGF.js";import{t as Fe}from"./heartbeats-B3Yvea7r.js";import{t as js}from"./instanceSettings-jpzLJAFD.js";import{t as Gr}from"./projects-DImC99Et.js";import{t as jt}from"./input-BVJKSyV-.js";import{t as Ot}from"./access-Ch1N6jrN.js";import{t as Ae}from"./skeleton-DQrVyaZJ.js";import{t as Vr}from"./chatEndpoints-DLBXmH-H.js";import{t as Ze}from"./tools-JAYosseH.js";import{t as Jr}from"./activity-DdoY6l3q.js";import{t as ls}from"./github-icon-C1i21pw6.js";import{n as Yr}from"./BreadcrumbContext-zDw93MZx.js";import{t as Xr}from"./assets-C8CDscdC.js";import{t as qt}from"./toggle-switch-BvihF3FR.js";import{t as kt}from"./InlineBanner-BJcDJhBs.js";import{i as Ts,n as Zr,o as ea,r as ta,s as sa}from"./select-DrTXvDZQ.js";import{t as yn}from"./adapter-display-registry-B-nxMkG4.js";import{c as na,u as ra}from"./agent-config-primitives-DdSnNM4K.js";import{t as aa}from"./clipboard-CTLKYvRL.js";import{t as ia}from"./use-adapter-capabilities-mjYxgAGx.js";import{t as la}from"./AgentCharacter-DByuzniB.js";import{Bt as oa,Dn as wt,Hr as ca,Jr as os,Ln as da,Ma as cs,Na as zt,Nn as ua,Qr as ma,S as xa,Ta as pa,W as ha,Xr as fa,Yr as ut,Zr as ds,_a as ga,dt as ya,ft as ba,ga as va,ha as ja,hr as Na,ma as ka,v as bn,va as wa,wa as Sa,xa as at,zt as Ca}from"./index-vkQSx4qF.js";import{t as Ia}from"./ConfigureBuiltInAgentModal-CymJeIPr.js";import{r as _s,t as Aa}from"./run-log-chunks-ZnzOvrXs.js";import{t as Ra}from"./runRetryState-BK1dhPq1.js";import{t as Ea}from"./IssueRecoveryActionCard-B9P1rgRV.js";import{n as Ta}from"./model-fallback-DMSSvw8C.js";import{t as _a}from"./ResponsibleUserDenialNotice-CvksPeJY.js";import{a as La,c as Fa,i as $a,l as Pa,o as qa,r as Ma,t as Da}from"./omp-settings-model-jf15zx3y.js";import{n as Ba,r as Ka,t as Oa}from"./ChoiceControls-Co4p9sM9.js";import{t as za,u as Wa}from"./SkillCardIcon-BSAyVL36.js";import{t as Ua}from"./AgentRoleEditor-DAHTdBJa.js";import{t as et}from"./CopyText-Bx0zB6z0.js";import{t as Ha}from"./MembershipAction-CavUCHcB.js";import{t as Qa}from"./AgentActionButtons-Dm8w7HmA.js";import{t as Ga}from"./TrustPresetSection-DE_LsAo4.js";import{t as Va}from"./EnforcementBanner-7AX-jCfE.js";import{i as Ja,o as Ya,r as Xa,t as Za}from"./shared-CiHyzKQS.js";import{t as ei}from"./OmpAllSettings-6p4gFX8M.js";var vn={name:"git-compare",size:24,node:[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]]};vn.node;var ti=Ut(vn),jn={name:"key",size:24,node:[["path",{d:"m2 21 9.6-9.6",key:"9l79m3"}],["path",{d:"m7.5 15.5 2.3 2.3a1 1 0 0 1 0 1.4l-2.1 2.1a1 1 0 0 1-1.4 0L4 19",key:"fw8biw"}],["circle",{cx:"15.5",cy:"7.5",r:"5.5",key:"4wxmhb"}]]};jn.node;var si=Ut(jn),Nn={name:"slash",size:24,node:[["path",{d:"M22 2 2 22",key:"y4kqgn"}]]};Nn.node;var ni=Ut(Nn),kn={name:"timer",size:24,node:[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]};kn.node;var ri=Ut(kn),u=tn(Yn(),1),e=tn(Xn(),1);function ai({agentId:t,companyId:s,path:r,currentRevisionId:i,disabled:l,onRestored:a}){const[d,c]=(0,u.useState)(!1),[m,p]=(0,u.useState)(null),x=rr({queryKey:["instruction-history",t,r,i],queryFn:n(({pageParam:b})=>J.instructionHistory(t,r,s,b),"queryFn"),initialPageParam:void 0,getNextPageParam:n(b=>b.nextCursor??void 0,"getNextPageParam"),enabled:d}),j=W({queryKey:["instruction-diff",t,r,m,i],queryFn:n(()=>J.instructionDiff(t,r,m,i,s),"queryFn"),enabled:d&&!!m}),N=ae({mutationFn:n(()=>J.restoreInstructions(t,{path:r,revisionId:m,baseRevisionId:i},s),"mutationFn"),onSuccess:n(b=>{p(null),a(b)},"onSuccess")}),R=x.error??j.error??N.error;return(0,e.jsxs)("div",{className:"space-y-3",children:[(0,e.jsx)(M,{type:"button",size:"sm",variant:"secondary","aria-expanded":d,onClick:n(()=>c(!d),"onClick"),children:"History"}),d&&(0,e.jsxs)("div",{className:"space-y-3",children:[x.isLoading&&(0,e.jsx)("p",{className:"text-sm text-ink-3",children:"Loading revisions…"}),R&&(0,e.jsx)("p",{role:"alert",className:"text-sm text-bad",children:R.message}),x.data?.pages.flatMap(b=>b.revisions).map(b=>(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)(M,{type:"button",size:"sm",variant:m===b.id?"secondary":"ghost",onClick:n(()=>p(b.id),"onClick"),children:(0,e.jsx)("span",{className:"font-mono",children:b.id.slice(0,8)})}),(0,e.jsxs)("span",{className:"text-sm text-ink-3",children:[b.source," ·"," ",new Date(b.createdAt).toLocaleString(),b.id===i?" · Current":""]})]},b.id)),x.hasNextPage&&(0,e.jsx)(M,{type:"button",variant:"ghost",disabled:x.isFetchingNextPage,onClick:n(()=>{x.fetchNextPage()},"onClick"),children:"Older revisions"}),j.data&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("p",{className:"text-sm text-ink-3",children:"Selected revision"}),(0,e.jsx)("pre",{className:"whitespace-pre-wrap break-words rounded-md border border-line p-3 font-mono text-sm",children:j.data.from.content}),(0,e.jsx)("p",{className:"text-sm text-ink-3",children:"Changes from selected revision to current"}),(0,e.jsxs)("pre",{className:"whitespace-pre-wrap break-words rounded-md border border-line p-3 font-mono text-sm",children:[j.data.removed&&`Removed:
1
+ var Kn=Object.defineProperty;var n=(t,s)=>Kn(t,"name",{value:s,configurable:!0});import{i as tn}from"./rolldown-runtime-ZpX3ckPj.js";import{A as On,Dt as zn,Et as Wn,Fr as Un,J as Ss,O as We,R as Gt,X as Hn,Y as Qn,Z as Gn,gn as Vn,it as Cs,k as Jn,l as T,m as Mt,na as Yn,r as Nt,t as Ut,ta as Xn,x as Ge,z as It}from"./createLucideIcon-CnVGnh-n.js";import{a as xs,h as Zn,m as er,n as tr,r as sr,v as sn}from"./star-BfGDDjEq.js";import{X as Be,_ as ae,g as nr,h as Is,n as ps,t as k,v as W}from"./queryKeys-DNib4smf.js";import{t as rr}from"./useInfiniteQuery-C4lR2e-S.js";import{t as As}from"./useQueries-ho7DFwNj.js";import{A as ar,E as ir,M as lr,_ as or,a as cr,ct as dr,i as ur,j as mr,o as Dt,s as nn,w as xr,x as pr}from"./ConnectionSetupFlow-BsbmkX_F.js";import{n as hr,r as fr}from"./responsible-user-denial-Dyl0BwU5.js";import{d as gr,f as yr}from"./connection-identity-Bm66aoli.js";import{n as rn}from"./CompanyContext-D89SijyS.js";import{E as as,J as br,b as vr,o as pt,r as Rs,t as ce,zt as dt}from"./router-C-DPy1sQ.js";import{n as hs,r as fs,t as gs}from"./collapsible-Bs-NoX6d.js";import{a as an,c as ln,i as on,l as cn,n as dn,o as un,r as mn,s as xn,t as pn}from"./alert-dialog-CJbRV6SV.js";import{t as jr}from"./checkbox-6fEY2YjF.js";import{c as is,t as Nr}from"./MarkdownEditor-uTRtpg12.js";import{t as kr}from"./arrow-left-CtrJnaew.js";import{t as wr}from"./arrow-right-C_bgbn5v.js";import{t as Es}from"./boxes-CyuQgdnj.js";import{t as hn}from"./check-C1U2nLnR.js";import{t as He}from"./chevron-down-D5bzoGsg.js";import{t as Pe}from"./chevron-right-Bmb_ezMx.js";import{t as ys}from"./circle-alert-DPz75VwF.js";import{a as Sr,c as fn,d as Cr,i as Ir,l as Ar,n as Rr,o as Er,r as Tr,s as _r,t as Lr,u as Fr}from"./ScrollToBottom-CxM9JETk.js";import{t as $t}from"./circle-question-mark-DLsjfYUH.js";import{t as $r}from"./circle-x-cIA5MZ-h.js";import{t as Bt}from"./clock-B4oKbxMj.js";import{t as st}from"./MarkdownBody-D5KQijmo.js";import{t as vt}from"./copy-D5hPdWqB.js";import{t as Pr}from"./external-link-CrKfWC2s.js";import{t as qr}from"./eye-off-Bv7z1y6E.js";import{t as gn}from"./eye-CkUyzQ21.js";import{t as Mr}from"./folder-open-BWyhdPrR.js";import{t as Dr}from"./link-2-BILyowKB.js";import{r as Kt,t as M}from"./button-C9JA0pR9.js";import{t as Br}from"./message-square-plus-Tl3pwEJu.js";import{r as Kr}from"./TaskChatProtocolCard-C1PnM_U-.js";import{t as Or}from"./plus-iKvhycbm.js";import{t as Pt}from"./rotate-ccw-Ck2ggAft.js";import{t as zr}from"./search-BCl----c.js";import{t as Vt}from"./triangle-alert-DeBU3xr-.js";import{t as Wr}from"./user-BnWruK-H.js";import{t as Ur}from"./x-BbL4w9tC.js";import{r as bs}from"./SidebarContext-B0ZkpTwu.js";import{t as Hr}from"./MootMark-B4vfsc5p.js";import{i as lt,n as ot,r as Qr,t as ct}from"./tooltip-DF9afEsd.js";import{t as Ue}from"./badge-B56aAvuf.js";import{a as vs}from"./ToastContext-D-Mqs4di.js";import{t as J}from"./agents-Boy51qGF.js";import{t as Fe}from"./heartbeats-B3Yvea7r.js";import{t as js}from"./instanceSettings-jpzLJAFD.js";import{t as Gr}from"./projects-DImC99Et.js";import{t as jt}from"./input-BVJKSyV-.js";import{t as Ot}from"./access-Ch1N6jrN.js";import{t as Ae}from"./skeleton-DQrVyaZJ.js";import{t as Vr}from"./chatEndpoints-DLBXmH-H.js";import{t as Ze}from"./tools-JAYosseH.js";import{t as Jr}from"./activity-DdoY6l3q.js";import{t as ls}from"./github-icon-C1i21pw6.js";import{n as Yr}from"./BreadcrumbContext-zDw93MZx.js";import{t as Xr}from"./assets-C8CDscdC.js";import{t as qt}from"./toggle-switch-BvihF3FR.js";import{t as kt}from"./InlineBanner-BJcDJhBs.js";import{i as Ts,n as Zr,o as ea,r as ta,s as sa}from"./select-DrTXvDZQ.js";import{t as yn}from"./adapter-display-registry-B-nxMkG4.js";import{c as na,u as ra}from"./agent-config-primitives-DdSnNM4K.js";import{t as aa}from"./clipboard-CTLKYvRL.js";import{t as ia}from"./use-adapter-capabilities-mjYxgAGx.js";import{t as la}from"./AgentCharacter-DByuzniB.js";import{Bt as oa,Dn as wt,Hr as ca,Jr as os,Ln as da,Ma as cs,Na as zt,Nn as ua,Qr as ma,S as xa,Ta as pa,W as ha,Xr as fa,Yr as ut,Zr as ds,_a as ga,dt as ya,ft as ba,ga as va,ha as ja,hr as Na,ma as ka,v as bn,va as wa,wa as Sa,xa as at,zt as Ca}from"./index-B-KXIl2u.js";import{t as Ia}from"./ConfigureBuiltInAgentModal-DCCNnp-d.js";import{r as _s,t as Aa}from"./run-log-chunks-ZnzOvrXs.js";import{t as Ra}from"./runRetryState-BK1dhPq1.js";import{t as Ea}from"./IssueRecoveryActionCard-BsCh8Q3n.js";import{n as Ta}from"./model-fallback-DMSSvw8C.js";import{t as _a}from"./ResponsibleUserDenialNotice-CvksPeJY.js";import{a as La,c as Fa,i as $a,l as Pa,o as qa,r as Ma,t as Da}from"./omp-settings-model-jf15zx3y.js";import{n as Ba,r as Ka,t as Oa}from"./ChoiceControls-CWglRSOv.js";import{t as za,u as Wa}from"./SkillCardIcon-BSAyVL36.js";import{t as Ua}from"./AgentRoleEditor-DAHTdBJa.js";import{t as et}from"./CopyText-Bx0zB6z0.js";import{t as Ha}from"./MembershipAction-DbmMOc8R.js";import{t as Qa}from"./AgentActionButtons-Bfr9wZVC.js";import{t as Ga}from"./TrustPresetSection-B0hy2924.js";import{t as Va}from"./EnforcementBanner-7AX-jCfE.js";import{i as Ja,o as Ya,r as Xa,t as Za}from"./shared-C40IN7FR.js";import{t as ei}from"./OmpAllSettings-BR42FqrS.js";var vn={name:"git-compare",size:24,node:[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]]};vn.node;var ti=Ut(vn),jn={name:"key",size:24,node:[["path",{d:"m2 21 9.6-9.6",key:"9l79m3"}],["path",{d:"m7.5 15.5 2.3 2.3a1 1 0 0 1 0 1.4l-2.1 2.1a1 1 0 0 1-1.4 0L4 19",key:"fw8biw"}],["circle",{cx:"15.5",cy:"7.5",r:"5.5",key:"4wxmhb"}]]};jn.node;var si=Ut(jn),Nn={name:"slash",size:24,node:[["path",{d:"M22 2 2 22",key:"y4kqgn"}]]};Nn.node;var ni=Ut(Nn),kn={name:"timer",size:24,node:[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]};kn.node;var ri=Ut(kn),u=tn(Yn(),1),e=tn(Xn(),1);function ai({agentId:t,companyId:s,path:r,currentRevisionId:i,disabled:l,onRestored:a}){const[d,c]=(0,u.useState)(!1),[m,p]=(0,u.useState)(null),x=rr({queryKey:["instruction-history",t,r,i],queryFn:n(({pageParam:b})=>J.instructionHistory(t,r,s,b),"queryFn"),initialPageParam:void 0,getNextPageParam:n(b=>b.nextCursor??void 0,"getNextPageParam"),enabled:d}),j=W({queryKey:["instruction-diff",t,r,m,i],queryFn:n(()=>J.instructionDiff(t,r,m,i,s),"queryFn"),enabled:d&&!!m}),N=ae({mutationFn:n(()=>J.restoreInstructions(t,{path:r,revisionId:m,baseRevisionId:i},s),"mutationFn"),onSuccess:n(b=>{p(null),a(b)},"onSuccess")}),R=x.error??j.error??N.error;return(0,e.jsxs)("div",{className:"space-y-3",children:[(0,e.jsx)(M,{type:"button",size:"sm",variant:"secondary","aria-expanded":d,onClick:n(()=>c(!d),"onClick"),children:"History"}),d&&(0,e.jsxs)("div",{className:"space-y-3",children:[x.isLoading&&(0,e.jsx)("p",{className:"text-sm text-ink-3",children:"Loading revisions…"}),R&&(0,e.jsx)("p",{role:"alert",className:"text-sm text-bad",children:R.message}),x.data?.pages.flatMap(b=>b.revisions).map(b=>(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)(M,{type:"button",size:"sm",variant:m===b.id?"secondary":"ghost",onClick:n(()=>p(b.id),"onClick"),children:(0,e.jsx)("span",{className:"font-mono",children:b.id.slice(0,8)})}),(0,e.jsxs)("span",{className:"text-sm text-ink-3",children:[b.source," ·"," ",new Date(b.createdAt).toLocaleString(),b.id===i?" · Current":""]})]},b.id)),x.hasNextPage&&(0,e.jsx)(M,{type:"button",variant:"ghost",disabled:x.isFetchingNextPage,onClick:n(()=>{x.fetchNextPage()},"onClick"),children:"Older revisions"}),j.data&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("p",{className:"text-sm text-ink-3",children:"Selected revision"}),(0,e.jsx)("pre",{className:"whitespace-pre-wrap break-words rounded-md border border-line p-3 font-mono text-sm",children:j.data.from.content}),(0,e.jsx)("p",{className:"text-sm text-ink-3",children:"Changes from selected revision to current"}),(0,e.jsxs)("pre",{className:"whitespace-pre-wrap break-words rounded-md border border-line p-3 font-mono text-sm",children:[j.data.removed&&`Removed:
2
2
  ${j.data.removed}
3
3
  `,j.data.added&&`Added:
4
4
  ${j.data.added}`,!j.data.removed&&!j.data.added&&"No content changes."]}),(0,e.jsx)(M,{type:"button",disabled:l||N.isPending||m===i,onClick:n(()=>N.mutate(),"onClick"),children:"Restore as new revision"}),l&&(0,e.jsx)("p",{className:"text-sm text-ink-3",children:"Save or cancel your edits before restoring."})]})]})]})}n(ai,"InstructionHistory");function ii(t,s){return t===s?!0:t.length!==s.length?!1:t.every((r,i)=>r===s[i])}n(ii,"arraysEqual");function us(t,s){const r=new Set(t),i=new Set(s);if(r.size!==i.size)return!1;for(const l of r)if(!i.has(l))return!1;return!0}n(us,"sameSkillSelection");function li(t,s){const r=!t.hasHydratedSnapshot||ii(t.draft,t.lastSaved);return{draft:r?s:t.draft,lastSaved:s,hasHydratedSnapshot:!0,shouldSkipAutosave:r}}n(li,"applyAgentSkillSnapshot");function Ls(t){return!(us(t.draft,t.lastSaved)||t.failedDraft&&us(t.draft,t.failedDraft))}n(Ls,"shouldScheduleSkillAutosave");function oi(t,s){return s.has(t.key)?!1:t.origin==="user_installed"||t.origin==="external_unknown"?!0:t.managed===!1&&t.state==="external"}n(oi,"isReadOnlyUnmanagedSkillEntry");function Fs({variant:t,data:s,checked:r=!1,disabled:i=!1,disabledReason:l,onCheckedChange:a,badge:d,accessory:c}){const m=t==="readonly",p=s.sourceMeta?.icon,x=(0,e.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[(0,e.jsx)(za,{card:s.icon,size:32}),(0,e.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("span",{className:"truncate text-sm font-medium text-ink",children:s.name}),d?(0,e.jsx)("span",{className:"shrink-0",children:d}):null,s.chip?(0,e.jsx)("span",{className:"hidden shrink-0 items-center rounded-full border border-line bg-bg-3/40 px-2 py-0.5 text-(length:--text-nano) capitalize text-ink-3 sm:inline-flex",children:s.chip}):null]}),s.summary?(0,e.jsx)("p",{className:"mt-0.5 truncate text-xs text-ink-3",children:s.summary}):null,s.sourceMeta&&p?(0,e.jsxs)("p",{className:"mt-0.5 flex min-w-0 items-center gap-1 text-(length:--text-nano) text-ink-3/80",children:[(0,e.jsx)(p,{className:"h-3 w-3 shrink-0","aria-hidden":"true"}),(0,e.jsx)("span",{className:"truncate",children:s.sourceMeta.label})]}):null,m&&s.originLabel?(0,e.jsxs)("p",{className:"mt-0.5 truncate text-(length:--text-nano) text-ink-3/80",children:[s.originLabel,s.locationLabel?` · ${s.locationLabel}`:""]}):null]})]}),j=T("flex min-h-11 flex-wrap items-center gap-x-3 gap-y-2 border-b border-line px-3 py-2.5 last:border-b-0 sm:flex-nowrap sm:gap-y-3",m?"bg-bg-3/20":"transition-colors hover:bg-bg-3/50"),N=s.linkTo?(0,e.jsx)(ce,{to:s.linkTo,className:"flex min-w-0 flex-1 items-center gap-3 no-underline outline-none focus-visible:ring-2 focus-visible:ring-focus rounded-sm",children:x}):x,R=m?(0,e.jsx)(tr,{className:"h-4 w-4 shrink-0 text-ink-3/60","aria-label":"Read-only"}):(()=>{const b=(0,e.jsx)(qt,{checked:r,disabled:i,onCheckedChange:n(v=>a?.(v),"onCheckedChange"),"aria-label":`${r?"Disable":"Enable"} ${s.name}`});return i&&l?(0,e.jsxs)(ct,{children:[(0,e.jsx)(lt,{asChild:!0,children:(0,e.jsx)("span",{className:"shrink-0",children:b})}),(0,e.jsx)(ot,{side:"left",children:l})]}):(0,e.jsx)("span",{className:"shrink-0",children:b})})();return(0,e.jsxs)("div",{className:j,children:[N,c&&!m?(0,e.jsx)("div",{className:"order-last w-full shrink-0 sm:order-none sm:w-auto",children:c}):null,R]})}n(Fs,"AgentSkillRow");function ci(t){return[t.name,t.slug??"",t.author??"",t.tagline??"",t.description??"",(t.categories??[]).join(" ")].join(" ").toLowerCase()}n(ci,"buildAgentSkillHaystack");function di(t,s){const r=s.trim();return r?ci(t).includes(r.toLowerCase()):!0}n(di,"agentSkillMatchesSearch");function Jt(t,s){const r=s.trim();return r?t.filter(i=>di(i,r)):t}n(Jt,"filterAgentSkills");function At(t){return t.replace(/\.git$/i,"")}n(At,"cleanRepoName");function Rt(t){const s=t?.trim();if(!s)return null;const r=n(a=>{const[d,c]=a.split("/").filter(Boolean);return!d||!c?null:`${d}/${At(c)}`},"parsePath");try{const a=new URL(s.startsWith("http")?s:`https://${s}`);if(a.hostname.toLowerCase().includes("github"))return r(a.pathname)}catch{}const i=s.match(/^git@[^:]+:([^/]+)\/([^/#?]+)(?:[/?#]|$)/i);if(i?.[1]&&i[2])return`${i[1]}/${At(i[2])}`;const l=s.match(/github\.com[:/]([^/]+)\/([^/#?]+)(?:[/?#]|$)/i);if(l?.[1]&&l[2])return`${l[1]}/${At(l[2])}`;if(!Ns(s)){const a=s.match(/^([^/\s]+)\/([^/\s]+)(?:[/?#]|$)/);if(a?.[1]&&a[2])return`${a[1]}/${At(a[2])}`}return null}n(Rt,"githubRepoLabel");function $s(t){const s=t?.trim();if(!s)return null;try{return new URL(s.startsWith("http")?s:`https://${s}`).hostname}catch{return null}}n($s,"hostLabel");function Ns(t){return t.startsWith("/")||t.startsWith("~/")||t.startsWith("./")||t.startsWith("../")||/^[A-Za-z]:[\\/]/.test(t)||t.includes("\\")||t.includes("/")&&!t.includes(" / ")}n(Ns,"isFilesystemLikeLabel");function ui(t){const s=t?.trim();return!s||Ns(s)?"Local folder":s}n(ui,"displayLocalSourceLabel");function Ps(t){const s=t?.trim();return!s||Ns(s)?"Catalog":s}n(Ps,"displayCatalogSourceLabel");function mi(t){if(t.sourceBadge==="github"||t.sourceType==="github"){const s=Rt(t.sourceLabel)??Rt(t.sourceLocator);return{icon:ls,label:s?`GitHub · ${s}`:"GitHub"}}if(t.sourceBadge==="skills_sh"||t.sourceType==="skills_sh"){const s=Rt(t.sourceLabel)??Rt(t.sourceLocator);return{icon:ls,label:s?`skills.sh · ${s}`:"skills.sh"}}return t.sourceBadge==="url"||t.sourceType==="url"?{icon:Dr,label:$s(t.sourceLabel)??$s(t.sourceLocator)??"URL"}:t.sourceBadge==="wardmote"?{icon:Hr,label:t.sourceLabel?.trim()||"Wardmote managed"}:t.sourceBadge==="catalog"||t.sourceType==="catalog"?{icon:Es,label:Ps(t.sourceLabel)}:t.sourceBadge==="local"||t.sourceType==="local_path"?{icon:sr,label:ui(t.sourceLabel)}:{icon:Es,label:Ps(t.sourceLabel)}}n(mi,"buildAgentSkillSourceMeta");var xi="default",Yt="Default — current (recommended)";function pi(t){if(!t)return null;const s=typeof t=="string"?t:t.toISOString();if(/^\d{4}-\d{2}-\d{2}$/.test(s))return s;const r=new Date(s);return Number.isNaN(r.getTime())?null:`${r.getFullYear()}-${String(r.getMonth()+1).padStart(2,"0")}-${String(r.getDate()).padStart(2,"0")}`}n(pi,"formatReleaseDate");function wn(t){return t.releaseName??t.label??t.releaseId??"Release"}n(wn,"releaseName");function hi(t){const s=wn(t),r=pi(t.releasedAt);return r?`${s} · released ${r}`:s}n(hi,"releaseOptionLabel");function fi(t){return(t.releaseName??t.label??t.releaseId??"Release").split(" — ")[0].trim()}n(fi,"releaseShortLabel");function gi({releases:t,value:s,disabled:r=!1,onChange:i}){const l=s?t.find(d=>d.id===s)??null:null,a=l?wn(l):Yt;return(0,e.jsxs)(Zr,{value:s??"default",disabled:r,onValueChange:n(d=>i(d==="default"?null:d),"onValueChange"),children:[(0,e.jsx)(ea,{size:"sm",className:"w-full max-w-(--sz-16rem) sm:w-(--sz-16rem)","aria-label":"Skill release",children:(0,e.jsx)(sa,{placeholder:Yt,children:a})}),(0,e.jsxs)(ta,{align:"end",className:"max-w-(--sz-20rem)",children:[(0,e.jsx)(Ts,{value:xi,children:Yt}),t.map(d=>(0,e.jsx)(Ts,{value:d.id,children:(0,e.jsxs)("span",{className:"flex items-center gap-2",children:[(0,e.jsx)("span",{className:"truncate",children:hi(d)}),(0,e.jsx)(Ue,{variant:"secondary",className:"shrink-0 text-(length:--text-nano)",children:"Beta"})]})},d.id))]})]})}n(gi,"AgentSkillReleasePicker");var yi="Enabled skills are materialized into the stable Wardmote-managed prompt bundle on the agent's next run.",Xt="tickernelz/wardmote/wardmote";function qs(t,s){return t.map(r=>s[r]?{key:r,versionId:s[r]}:r)}n(qs,"toDesiredSkillPayload");function bi(t){return typeof t=="string"?t:t.key}n(bi,"desiredSkillKey");function Ms(t){const s={};for(const r of t??[])r.versionId&&(s[r.key]=r.versionId);return s}n(Ms,"pinsFromEntries");function vi({agent:t,companyId:s}){const r=Be(),[i,l]=(0,u.useState)([]),[a,d]=(0,u.useState)([]),[c,m]=(0,u.useState)({}),p=(0,u.useRef)({}),[x,j]=(0,u.useState)(""),[N,R]=(0,u.useState)(!1),b=(0,u.useRef)([]),v=(0,u.useRef)(!1),C=(0,u.useRef)(!0),P=(0,u.useRef)(null),{data:A,isLoading:w}=W({queryKey:k.agents.skills(t.id),queryFn:n(()=>J.skills(t.id,s),"queryFn"),enabled:!!s}),{data:E}=W({queryKey:k.companySkills.list(s??""),queryFn:n(()=>is.list(s),"queryFn"),enabled:!!s}),{data:U}=W({queryKey:k.instance.experimentalSettings,queryFn:n(()=>js.getExperimental(),"queryFn")}),ne=U?.enableBetaSkills===!0,ie=(0,u.useMemo)(()=>(E??[]).find(g=>g.key===Xt)??null,[E,A]),{data:ue}=W({queryKey:k.companySkills.versions(s??"",ie?.id??""),queryFn:n(()=>is.versions(s,ie.id),"queryFn"),enabled:!!(s&&ne&&ie?.id)}),se=(0,u.useMemo)(()=>(ue??[]).filter(g=>g.releaseId!=null),[ue]),F=ae({mutationFn:n(g=>J.syncSkills(t.id,g,"replace",s),"mutationFn"),onSuccess:n(async g=>{r.setQueryData(k.agents.skills(t.id),g),b.current=g.desiredSkills,d(g.desiredSkills);const oe=Ms(g.desiredSkillEntries);p.current=oe,m(oe),await Promise.all([r.invalidateQueries({queryKey:k.agents.detail(t.id)}),r.invalidateQueries({queryKey:k.agents.detail(t.urlKey)})])},"onSuccess"),onError:n((g,oe)=>{P.current=oe.map(bi)},"onError")});(0,u.useEffect)(()=>{l([]),d([]),b.current=[],m({}),p.current={},v.current=!1,C.current=!0,P.current=null},[t.id]),(0,u.useEffect)(()=>{if(!A||F.isPending)return;const g=Ms(A.desiredSkillEntries);p.current=g,m(g)},[A,F.isPending]),(0,u.useEffect)(()=>{if(!A)return;const g=li({draft:i,lastSaved:b.current,hasHydratedSnapshot:v.current},A.desiredSkills);C.current=g.shouldSkipAutosave,v.current=g.hasHydratedSnapshot,l(g.draft),b.current=g.lastSaved,d(g.lastSaved)},[i,A]),(0,u.useEffect)(()=>{if(!A)return;if(C.current){C.current=!1;return}if(F.isPending||!Ls({draft:i,lastSaved:b.current,failedDraft:P.current}))return;const g=window.setTimeout(()=>{Ls({draft:i,lastSaved:b.current,failedDraft:P.current})&&F.mutate(qs(i,p.current))},250);return()=>window.clearTimeout(g)},[ne,i,A,F.isPending,F.isError,F.mutate]);const ee=(0,u.useMemo)(()=>new Map((E??[]).map(g=>[g.key,g])),[E]),re=(0,u.useMemo)(()=>new Set((E??[]).map(g=>g.key)),[E]);(0,u.useMemo)(()=>new Map((A?.entries??[]).map(g=>[g.key,g])),[A]);const X=A?.mode==="unsupported",H=(0,u.useMemo)(()=>(E??[]).filter(g=>!(A?.entries??[]).some(oe=>oe.key===g.key&&oe.readOnly)).map(g=>({key:g.key,name:g.name,icon:{key:g.key,name:g.name,slug:g.slug,iconUrl:g.iconUrl,color:g.color},summary:Wa(g,{fallbackKey:!0}),chip:g.categories[0]??null,sourceMeta:mi(g),linkTo:`/skills/${g.id}`,slug:g.slug,author:g.authorName??g.sourceLabel,tagline:g.tagline,description:g.description,categories:g.categories})),[E,A]),h=(0,u.useMemo)(()=>(A?.entries??[]).filter(g=>g.readOnly&&g.desired||oi(g,re)).map(g=>({key:g.key,name:g.runtimeName??g.key,icon:{key:g.key,name:g.runtimeName??g.key,slug:null,iconUrl:null,color:null},summary:g.detail??null,chip:null,linkTo:null,originLabel:g.originLabel??null,locationLabel:g.locationLabel??null})),[re,A]),f=(0,u.useMemo)(()=>H.filter(g=>i.includes(g.key)),[H,i]),$=(0,u.useMemo)(()=>H.filter(g=>!i.includes(g.key)),[H,i]),O=(0,u.useMemo)(()=>i.filter(g=>!ee.has(g)),[ee,i]),V=(0,u.useMemo)(()=>Jt(f,x),[f,x]),_=(0,u.useMemo)(()=>Jt($,x),[$,x]),le=(0,u.useMemo)(()=>Jt(h,x),[h,x]),xe=(0,u.useMemo)(()=>{switch(A?.mode){case"persistent":return"Kept in workspace";case"ephemeral":return"Applied on next run";case"unsupported":return"Tracked only";default:return null}},[A?.mode]),te=(0,u.useMemo)(()=>X?"Wardmote cannot manage skills for this adapter yet. Manage them in the adapter directly.":null,[X]),Ne=!us(i,a),he=n((g,oe)=>{l(L=>oe?Array.from(new Set([...L,g])):L.filter(ke=>ke!==g))},"toggleSkill"),S=n((g,oe)=>{const L={...p.current};oe?L[g]=oe:delete L[g],p.current=L,m(L),F.mutate(qs(i,L))},"handleReleaseChange"),B=ne&&se.length>0,Z=n((g,oe)=>{const L=t.adapterType==="wardmote_runner"&&oe==="available"&&g.key===Xt,ke=X||L,ye=L?"Wardmote Runner uses native semantic coordination and cannot attach the legacy Wardmote operational skill.":te,we=B&&oe==="enabled"&&g.key===Xt,de=c[g.key]??null,y=de?se.find(q=>q.id===de)??null:null;return(0,e.jsx)(Fs,{variant:oe,data:g,checked:oe==="enabled",disabled:ke,disabledReason:ye,onCheckedChange:n(q=>he(g.key,q),"onCheckedChange"),badge:we&&y?(0,e.jsxs)(Ue,{variant:"secondary",className:"text-(length:--text-nano)",children:["Beta · ",fi(y)]}):void 0,accessory:we?(0,e.jsx)(gi,{releases:se,value:de,disabled:ke||F.isPending,onChange:n(q=>S(g.key,q),"onChange")}):void 0},g.key)},"renderRow"),ge=H.length===0;return(0,e.jsxs)("div",{className:"max-w-4xl space-y-4",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsxs)("span",{className:"text-sm font-medium text-ink",children:[f.length," of ",H.length," enabled"]}),xe?(0,e.jsxs)(ct,{children:[(0,e.jsx)(lt,{asChild:!0,children:(0,e.jsx)("span",{className:"inline-flex cursor-default items-center rounded-full border border-line bg-bg-3/40 px-2 py-0.5 text-xs text-ink-3",children:xe})}),(0,e.jsx)(ot,{side:"bottom",className:"max-w-xs",children:X?te:yi})]}):null,(0,e.jsx)(ji,{pending:F.isPending,unsaved:Ne,error:F.isError&&Ne}),(0,e.jsxs)("div",{className:"ml-auto flex w-full flex-col items-stretch gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,e.jsxs)("div",{className:"relative w-full sm:w-auto",children:[(0,e.jsx)(zr,{className:"pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-ink-3"}),(0,e.jsx)(jt,{value:x,onChange:n(g=>j(g.target.value),"onChange"),placeholder:"Search skills",className:"h-8 w-full pl-8 sm:w-56","aria-label":"Search skills"})]}),(0,e.jsx)(M,{asChild:!0,variant:"secondary",size:"sm",className:"shrink-0",children:(0,e.jsxs)(ce,{to:"/skills",className:"no-underline",children:[(0,e.jsx)(cs,{className:"h-3.5 w-3.5"}),"Browse skills store"]})})]})]}),F.isError?(0,e.jsx)("p",{className:"text-xs text-bad",children:F.error instanceof Error?F.error.message:"Failed to update skills"}):null]}),te?(0,e.jsx)("div",{className:"rounded-lg border border-line bg-bg-3/30 px-4 py-3 text-sm text-ink-3",children:te}):null,O.length>0?(0,e.jsx)("div",{className:"overflow-hidden rounded-lg border border-amber-300/60 dark:border-amber-500/30",children:O.map(g=>(0,e.jsxs)("div",{className:"flex items-center justify-between gap-3 border-b border-amber-300/40 bg-amber-50/60 px-3 py-2 text-xs text-amber-800 last:border-b-0 dark:border-amber-500/20 dark:bg-amber-950/20 dark:text-amber-200",children:[(0,e.jsxs)("span",{className:"min-w-0 truncate",children:[(0,e.jsx)("span",{className:"font-medium",children:g})," is enabled but missing from the organization library."]}),(0,e.jsxs)(M,{variant:"secondary",size:"xs",className:"shrink-0",type:"button",onClick:n(()=>he(g,!1),"onClick"),children:[(0,e.jsx)(Ur,{className:"h-3 w-3"}),"Remove"]})]},g))}):null,w?(0,e.jsx)(bn,{variant:"list"}):ge&&h.length===0?(0,e.jsx)(Ni,{}):(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsx)(Ds,{title:"Enabled on this agent",count:V.length,children:V.length>0?V.map(g=>Z(g,"enabled")):(0,e.jsx)(Zt,{children:x?"No enabled skills match your search.":"No skills enabled on this agent yet."})}),(0,e.jsx)(Ds,{title:"Available from the library",count:_.length,children:_.length>0?_.map(g=>Z(g,"available")):(0,e.jsx)(Zt,{children:x?"No available skills match your search.":ge?"Import skills into the organization library to enable them here.":"Every library skill is enabled on this agent."})}),h.length>0?(0,e.jsx)(gs,{open:N,onOpenChange:R,children:(0,e.jsxs)("div",{className:"overflow-hidden rounded-lg border border-line",children:[(0,e.jsxs)(fs,{className:"flex w-full items-center gap-2 bg-bg-3/50 px-3 py-2 text-left outline-none focus-visible:ring-2 focus-visible:ring-focus",children:[(0,e.jsx)(He,{className:T("h-3.5 w-3.5 text-ink-3 transition-transform",N?"":"-rotate-90")}),(0,e.jsx)("span",{className:"text-xs font-medium text-ink-3",children:"Automatic and detected skills (read-only)"}),(0,e.jsx)("span",{className:"text-xs text-ink-3/70",children:le.length})]}),(0,e.jsx)(hs,{children:le.length>0?le.map(g=>(0,e.jsx)(Fs,{variant:"readonly",data:g},g.key)):(0,e.jsx)(Zt,{children:"No detected skills match your search."})})]})}):null,(0,e.jsxs)("div",{className:"text-xs text-ink-3",children:["Adapter: ",na[t.adapterType]??t.adapterType]})]})]})}n(vi,"AgentSkillsTab");function ji({pending:t,unsaved:s,error:r}){return t?(0,e.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-xs text-ink-3",children:[(0,e.jsx)(Kt,{className:"h-3.5 w-3.5 animate-spin"}),"Saving…"]}):r?(0,e.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-xs text-bad",children:[(0,e.jsx)(ys,{className:"h-3.5 w-3.5"}),"Couldn’t save"]}):s?(0,e.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-xs text-ink-3",children:[(0,e.jsx)(Kt,{className:"h-3.5 w-3.5 animate-spin"}),"Saving soon…"]}):(0,e.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-xs text-(--status-task-done)",children:[(0,e.jsx)(xs,{className:"h-3.5 w-3.5"}),"Saved"]})}n(ji,"SaveStatusChip");function Ds({title:t,count:s,children:r}){return(0,e.jsxs)("section",{className:"overflow-hidden rounded-lg border border-line",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 bg-bg-3/50 px-3 py-2",children:[(0,e.jsx)("span",{className:"text-xs font-medium text-ink-3",children:t}),(0,e.jsx)("span",{className:"text-xs text-ink-3/70",children:s})]}),(0,e.jsx)("div",{children:r})]})}n(Ds,"SkillSection");function Zt({children:t}){return(0,e.jsx)("div",{className:"px-3 py-4 text-xs text-ink-3",children:t})}n(Zt,"SectionEmpty");function Ni(){return(0,e.jsxs)("div",{className:"flex flex-col items-center gap-3 rounded-lg border border-dashed border-line px-6 py-10 text-center",children:[(0,e.jsx)(cs,{className:"h-8 w-8 text-ink-3/60"}),(0,e.jsxs)("div",{className:"space-y-1",children:[(0,e.jsx)("p",{className:"text-sm font-medium text-ink",children:"No skills in the organization library"}),(0,e.jsx)("p",{className:"text-xs text-ink-3",children:"Install skills to the organization, then enable them on this agent."})]}),(0,e.jsx)(M,{asChild:!0,variant:"secondary",size:"sm",children:(0,e.jsxs)(ce,{to:"/skills",className:"no-underline",children:[(0,e.jsx)(cs,{className:"h-3.5 w-3.5"}),"Browse skills store"]})})]})}n(Ni,"EmptyLibraryCard");var Bs={preparing:["Preparing agent","Required resources are being prepared. Work stays queued."],verifying:["Verifying agent","The saved execution configuration is being checked. Work stays queued."],pausing:["Pausing agent","Waiting for execution and required resources to stop."],resuming:["Resuming agent","Required resources are being started. Work stays queued."],terminating:["Terminating agent","Stopping execution before resource cleanup."],cleaning_up:["Cleaning up agent","Required resources are being removed. Termination is not complete."]};function Sn(t){return t&&t in Bs?Bs[t]:void 0}n(Sn,"pendingPhase");function ki(t){return Sn(t)?2e3:3e4}n(ki,"agentLifecycleRefetchInterval");function wi(t){return W({queryKey:[...k.agents.detail(t?.id??""),"lifecycle",t?.companyId],queryFn:n(()=>J.get(t.id,t.companyId),"queryFn"),enabled:!!t,select:n(s=>({status:s.status,lifecycleState:s.lifecycleState,lifecycleVersion:s.lifecycleVersion,lifecycleError:s.lifecycleError}),"select"),refetchInterval:n(s=>ki(s.state.data?.lifecycleState??t?.lifecycleState),"refetchInterval")})}n(wi,"useAgentLifecycleStatus");function Si({agent:t,onRetry:s,retryPending:r,refreshError:i=!1}){const l=Sn(t.lifecycleState);return!l&&!i?null:(0,e.jsxs)("div",{role:"status","aria-live":"polite",className:"space-y-2 text-sm",children:[i&&(0,e.jsx)("p",{className:"text-bad",children:"Could not refresh agent lifecycle status."}),l&&(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsxs)(Ue,{variant:t.lifecycleError?"destructive":"secondary",children:[!t.lifecycleError&&(0,e.jsx)(Kt,{"aria-hidden":"true",className:"mr-1 size-3 animate-spin motion-reduce:animate-none"}),l[0]]}),(0,e.jsx)("span",{className:"text-ink-3",children:l[1]})]}),l&&t.lifecycleError&&(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-bad",children:[(0,e.jsx)("span",{children:t.lifecycleError}),(0,e.jsx)(M,{variant:"secondary",size:"sm",disabled:r,onClick:s,children:r?"Retrying…":"Retry"})]})]})}n(Si,"AgentLifecycleStatus");var Ci={ready:{color:"green",glyph:"●",label:"Ready",title:"Materialized and matches the shipped default"},needs_setup:{color:"amber",glyph:"⚠",label:"Needs setup",title:"Present but not usable yet"},missing:{color:"amber",glyph:"⚠",label:"Missing",title:"Expected resource absent; reconcile will recreate it"},error:{color:"red",glyph:"✕",label:"Error",title:"Failed to load or reconcile"},update_available:{color:"blue",glyph:"↑",label:"Update available",title:"Unedited — a newer shipped default can be applied"},drifted:{color:"gray",glyph:"✎",label:"Drifted",title:"You've edited this; your changes are kept, not overwritten"},schedule_off:{color:"gray",glyph:"◌",label:"Schedule off",title:"No background work runs until you enable it — costs zero tokens"},schedule_on:{color:"green",glyph:"●",label:"Weekly",title:"Runs on the weekly schedule"},pending_approval:{color:"amber",glyph:"⚠",label:"Pending approval",title:"Waiting on board hire approval before it can run"},proposal_pending:{color:"blue",glyph:"↑",label:"Proposal pending",title:"A proposed update is waiting for your review"}};function it({variant:t,label:s,compact:r=!1,className:i}){const l=Ci[t];return(0,e.jsxs)(Ue,{variant:"outline",className:T(as[l.color],"font-medium",r&&"px-1.5 py-0 text-(length:--text-nano)",i),title:l.title,children:[(0,e.jsx)("span",{"aria-hidden":"true",children:l.glyph}),s??l.label]})}n(it,"ResourceStatusChip");function es(t,s){return t?.find(r=>r.resourceKind===s)}n(es,"findResource");function Ii(t){return t.stockStatus==="missing"?"missing":"ready"}n(Ii,"readinessVariant");function Et(t){return t.stockStatus==="missing"?null:t.stockStatus==="stock_update_available"?"update_available":t.stockStatus==="operator_modified"?"drifted":null}n(Et,"driftVariant");function Ai(t,s){return t.stockStatus==="stock_update_available"?{title:`Update ${s} to the newest default?`,body:"You haven't edited this, so Wardmote will replace it with the newer shipped version. Nothing you customized is affected, and your adapter credentials and settings are not touched.",confirmLabel:"Update",triggerLabel:"Update"}:t.stockStatus==="operator_modified"?{title:`Reset ${s} to the shipped default?`,body:"This replaces your edited version with Wardmote's current default. Your edits can't be recovered. Adapter credentials and settings are not touched.",confirmLabel:`Reset ${s}`,triggerLabel:"Reset"}:t.stockStatus==="missing"?{title:`Recreate ${s}?`,body:"This resource is missing. Wardmote will recreate it from the shipped default. Adapter credentials and settings are not touched.",confirmLabel:"Recreate",triggerLabel:"Recreate"}:null}n(Ai,"resourceActionCopy");function Ks({resource:t,label:s,onConfirm:r,pending:i}){const l=Ai(t,s);return l?(0,e.jsxs)(pn,{children:[(0,e.jsx)(cn,{asChild:!0,children:(0,e.jsx)(M,{variant:"secondary",size:"sm",disabled:i,children:i?"Working…":l.triggerLabel})}),(0,e.jsxs)(on,{children:[(0,e.jsxs)(xn,{children:[(0,e.jsx)(ln,{children:l.title}),(0,e.jsx)(an,{children:l.body})]}),(0,e.jsxs)(un,{children:[(0,e.jsx)(mn,{children:"Cancel"}),(0,e.jsx)(dn,{onClick:r,children:l.confirmLabel})]})]})]}):null}n(Ks,"ResourceActionButton");function ts({title:t,body:s,triggerLabel:r,confirmLabel:i,pending:l,onConfirm:a}){return(0,e.jsxs)(pn,{children:[(0,e.jsx)(cn,{asChild:!0,children:(0,e.jsx)(M,{variant:"secondary",size:"sm",disabled:l,children:l?"Working…":r})}),(0,e.jsxs)(on,{children:[(0,e.jsxs)(xn,{children:[(0,e.jsx)(ln,{children:t}),(0,e.jsx)(an,{children:s})]}),(0,e.jsxs)(un,{children:[(0,e.jsx)(mn,{children:"Cancel"}),(0,e.jsx)(dn,{onClick:a,children:i})]})]})]})}n(ts,"ConfirmActionButton");function Tt({label:t,secondary:s,chips:r,detail:i,detailTone:l="muted",actions:a}){return(0,e.jsxs)("div",{className:"flex flex-col gap-1 py-3 sm:flex-row sm:items-start sm:justify-between sm:gap-3",children:[(0,e.jsxs)("div",{className:"min-w-0 space-y-1",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsx)("span",{className:"text-sm font-medium",children:t}),s&&(0,e.jsx)("span",{className:"text-(length:--text-micro) text-ink-3",children:s}),r]}),i&&(0,e.jsx)("p",{className:T("text-(length:--text-micro) leading-snug",l==="error"?"text-red-600 dark:text-red-400":"text-ink-3"),children:i})]}),a&&(0,e.jsx)("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:a})]})}n(Tt,"BundleRow");function Ri(t){switch(t.stockStatus){case"operator_modified":return"You've edited this. Your changes are kept until you reset.";case"stock_update_available":return"Wardmote shipped a newer default.";case"missing":return"Not materialized yet — recreate it from the shipped default.";default:return}}n(Ri,"driftDetail");function Ei({state:t,agentRef:s,onConfigure:r,onResetResource:i,onRunRoutine:l,onEnableSchedule:a,onDisableSchedule:d,resettingResource:c=null,routineActionPending:m=null,className:p}){const{status:x,definition:j,resources:N}=t,R=j.bundle;if(!R)return null;const b=x==="ready"||x==="paused";let v="ready",C;x==="pending_approval"?(v="pending_approval",C="Waiting on board hire approval before this coach can run."):b||(v="needs_setup",C="Pick an adapter this coach can run on.");const P=es(N,"skill"),A=es(N,"instructions"),w=es(N,"routine"),E=w?.scheduleEnabled===!0,U=R.routine.routineKey,ne=R.routine.scheduleLabel??"Weekly schedule",ie=w?.pendingUpdateIssueIdentifier??w?.pendingUpdateIssueId??null,ue=ie&&w?.pendingUpdateInteractionId?`/issues/${ie}#interaction-${w.pendingUpdateInteractionId}`:null,se=n((F,ee,re,X,H)=>{const h=Et(H);return(0,e.jsx)(Tt,{label:ee,secondary:re,chips:(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(it,{variant:Ii(H)}),h&&(0,e.jsx)(it,{variant:h})]}),detail:Ri(H),actions:(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(M,{asChild:!0,variant:"link",size:"sm",children:(0,e.jsx)(ce,{to:X,children:"View"})}),(0,e.jsx)(Ks,{resource:H,label:ee,onConfirm:n(()=>i(F),"onConfirm"),pending:c===F})]})},F)},"renderResourceRow");return(0,e.jsxs)("section",{className:T("space-y-2",p),"aria-label":"Bundle status",children:[(0,e.jsx)("h3",{className:"text-sm font-medium",children:"Bundle status"}),(0,e.jsxs)("div",{className:"divide-y rounded-lg border px-4",children:[(0,e.jsx)(Tt,{label:"Adapter",chips:(0,e.jsx)(it,{variant:v}),detail:C,actions:(0,e.jsx)(M,{variant:"secondary",size:"sm",onClick:r,children:"Configure"})}),P&&se("skill","Skill",R.skill.displayName||P.resourceKey,`/agents/${s}/skills`,P),A&&se("instructions","Instructions",R.instructions.entryFile,`/agents/${s}/instructions`,A),(0,e.jsx)(Tt,{label:"Routine",secondary:R.routine.title,chips:(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(it,{variant:E?"schedule_on":"schedule_off",label:E?ne:void 0}),w&&Et(w)&&(0,e.jsx)(it,{variant:Et(w)})]}),detail:E?"The weekly schedule is enabled and can create background work.":"Nothing runs until you enable the weekly schedule — it costs zero tokens by default.",actions:w?(0,e.jsxs)(e.Fragment,{children:[l&&(0,e.jsx)(ts,{title:"Run Reflection Coach once?",body:"Wardmote will create one routine task now. This does not enable the weekly schedule or turn on background work.",triggerLabel:"Run once",confirmLabel:"Run once",pending:m==="run",onConfirm:n(()=>l(U),"onConfirm")}),E?d&&(0,e.jsx)(ts,{title:"Disable the weekly schedule?",body:"Wardmote will stop future scheduled Reflection Coach runs. Manual Run once remains available.",triggerLabel:"Disable schedule",confirmLabel:"Disable schedule",pending:m==="disable",onConfirm:n(()=>d(U),"onConfirm")}):a&&(0,e.jsx)(ts,{title:"Enable the weekly schedule?",body:"Wardmote will allow Reflection Coach to create routine tasks on the weekly schedule. It can spend tokens when those tasks run.",triggerLabel:"Enable weekly",confirmLabel:"Enable weekly",pending:m==="enable",onConfirm:n(()=>a(U),"onConfirm")}),Et(w)&&(0,e.jsx)(Ks,{resource:w,label:"routine",onConfirm:n(()=>i("routine"),"onConfirm"),pending:c==="routine"})]}):void 0}),ue&&(0,e.jsx)(Tt,{label:"Proposal",chips:(0,e.jsx)(it,{variant:"proposal_pending"}),detail:"A proposed Reflection Coach update is waiting for review.",actions:(0,e.jsx)(M,{asChild:!0,variant:"link",size:"sm",children:(0,e.jsx)(ce,{to:ue,children:"Review proposal"})})})]})]})}n(Ei,"BuiltInBundlePanel");function Os(t){if(!t)return null;const s=new Date(t);return Number.isNaN(s.getTime())?t:s.toLocaleString()}n(Os,"isoOrLocaleString");function zs(t,s){return`/issues/${s??t}`}n(zs,"issueLink");function bt({label:t,children:s}){return(0,e.jsxs)("div",{className:"grid grid-cols-(--gtc-10) gap-x-3 gap-y-0 py-1 text-xs sm:grid-cols-(--gtc-11)",children:[(0,e.jsx)("dt",{className:"truncate text-(length:--text-micro) font-medium uppercase tracking-(--tracking-label) text-emerald-900/70 dark:text-emerald-200/70",children:t}),(0,e.jsx)("dd",{className:"min-w-0 break-words text-emerald-950 dark:text-emerald-100",children:s})]})}n(bt,"MetaRow");function Ti({fold:t,finalizedAt:s,className:r}){const i=t.sourceIssueIdentifier??t.sourceIssueId.slice(0,8),l=Ar(t.sameRunEvidenceId),a=Os(t.sameRunEvidenceAt),d=_r(t.silenceAgeMs),c=Os(t.silenceStartedAt),m=Er(t.cleanup.outcome),p=s?We(s):null,x=t.evaluationIssueIdentifier??t.evaluationIssueId?.slice(0,8);return(0,e.jsxs)("section",{role:"status","aria-label":"Source-resolved watchdog fold","data-source-resolved-fold":!0,className:T("relative w-full overflow-hidden rounded-lg border text-sm shadow-(--shadow-extract-8)","border-emerald-300/70 bg-emerald-50/80 text-emerald-950","dark:border-emerald-500/40 dark:bg-emerald-500/10 dark:text-emerald-100",r),children:[(0,e.jsxs)("header",{className:"flex items-start gap-3 px-3 py-2.5 sm:px-4",children:[(0,e.jsx)("span",{className:T("mt-0.5 flex h-7 w-7 shrink-0 items-center justify-center rounded-md","bg-emerald-100 text-emerald-800 dark:bg-emerald-500/20 dark:text-emerald-200"),"aria-hidden":!0,children:(0,e.jsx)(br,{className:"h-4 w-4 text-emerald-700 dark:text-emerald-300"})}),(0,e.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-0.5 text-(length:--text-micro) font-semibold uppercase tracking-(--tracking-eyebrow)",children:[(0,e.jsx)("span",{className:"text-emerald-900 dark:text-emerald-200",children:"SOURCE-RESOLVED FOLD"}),(0,e.jsx)("span",{className:"text-ink-3/60","aria-hidden":!0,children:"·"}),(0,e.jsx)("span",{className:"font-medium normal-case tracking-normal text-ink-3",children:"system audit"}),p?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{className:"text-ink-3/60","aria-hidden":!0,children:"·"}),(0,e.jsx)("span",{className:"font-medium normal-case tracking-normal text-ink-3",children:p})]}):null]}),(0,e.jsx)("p",{className:"mt-1 text-sm leading-6",children:"This run was folded as a source-resolved false positive."})]})]}),(0,e.jsxs)("dl",{className:T("divide-y border-t bg-bg/40 px-3 py-2 sm:px-4 dark:bg-bg/20","border-emerald-300/60 dark:border-emerald-500/30","[&>*]:border-emerald-300/40 dark:[&>*]:border-emerald-500/20"),children:[(0,e.jsx)(bt,{label:"Source task",children:(0,e.jsxs)("span",{className:"inline-flex flex-wrap items-center gap-1.5",children:[(0,e.jsx)(ce,{to:zs(t.sourceIssueId,t.sourceIssueIdentifier),className:"rounded-sm font-medium underline-offset-2 hover:underline",children:i}),(0,e.jsx)("span",{className:"rounded-md border border-emerald-300/60 bg-bg/60 px-1.5 py-0.5 text-(length:--text-micro) font-medium text-emerald-900 dark:border-emerald-500/30 dark:text-emerald-200",children:t.sourceIssueStatus})]})}),(0,e.jsx)(bt,{label:"Same-run evidence",children:(0,e.jsxs)("span",{className:"inline-flex flex-wrap items-baseline gap-1.5",children:[(0,e.jsx)("span",{className:"rounded bg-bg/70 px-1.5 py-0.5 font-mono text-(length:--text-micro) text-emerald-900 dark:bg-bg/40 dark:text-emerald-100",children:t.sameRunEvidenceKind}),(0,e.jsx)("code",{className:"rounded bg-bg/70 px-1.5 py-0.5 font-mono text-(length:--text-micro) text-emerald-900 dark:bg-bg/40 dark:text-emerald-100",title:t.sameRunEvidenceId,children:l}),a?(0,e.jsxs)("span",{className:"text-(length:--text-micro) text-ink-3",children:["at ",a]}):null]})}),(0,e.jsx)(bt,{label:"Silence age before fold",children:d?(0,e.jsxs)("span",{children:[d,c?(0,e.jsxs)("span",{className:"text-ink-3",children:[" (silence started ",c,")"]}):null]}):(0,e.jsx)("span",{className:"text-ink-3",children:"unknown"})}),(0,e.jsx)(bt,{label:"Process cleanup",children:(0,e.jsxs)("span",{className:"inline-flex flex-wrap items-baseline gap-1.5",title:t.cleanup.outcome,children:[(0,e.jsx)("span",{children:m}),t.cleanup.error?(0,e.jsxs)("span",{className:"text-ink-3",children:["— ",t.cleanup.error]}):null]})}),t.evaluationIssueId?(0,e.jsx)(bt,{label:"Evaluation task",children:(0,e.jsx)(ce,{to:zs(t.evaluationIssueId,t.evaluationIssueIdentifier),className:"rounded-sm font-medium underline-offset-2 hover:underline",children:x})}):null]})]})}n(Ti,"SourceResolvedFoldCallout");function _i({run:t,agentRouteId:s}){const r=Ra(t);return r?(0,e.jsxs)("div",{className:"rounded-md border border-line/70 bg-bg-3/20 px-3 py-2 text-xs leading-5",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsx)("span",{className:T("rounded-md border px-1.5 py-0.5 text-(length:--text-micro) font-medium",r.tone),children:r.badgeLabel}),r.retryOfRunId&&(0,e.jsx)(ce,{to:`/agents/${s}/runs/${r.retryOfRunId}`,className:"font-mono text-ink hover:underline",children:r.retryOfRunId.slice(0,8)})]}),r.detail&&(0,e.jsx)("p",{className:"mt-2 text-ink-3",children:r.detail}),r.secondary&&(0,e.jsx)("p",{className:"text-ink-3",children:r.secondary})]}):null}n(_i,"RunRetryDetails");function ms({name:t,className:s}){const r=ha(t).icon;return(0,e.jsx)(r,{className:s})}n(ms,"ToolFamilyIcon");var Li=300,Ws=40,_t=36,Fi=180;function ze(t){return typeof t!="object"||t===null||Array.isArray(t)?null:t}n(ze,"asRecord$2");function De(t){return t.replace(/\s+/g," ").trim()}n(De,"compactWhitespace");function Le(t,s){return t.length>s?`${t.slice(0,Math.max(0,s-1))}…`:t}n(Le,"truncate");function St(t){return t.replace(/[_-]+/g," ").trim().replace(/\b\w/g,s=>s.toUpperCase())}n(St,"humanizeLabel");function Us(t){const s=De(t),r=s.match(/^(?:(?:\/bin\/)?(?:zsh|bash|sh)|cmd(?:\.exe)?(?:\s+\/d)?(?:\s+\/s)?(?:\s+\/c)?)\s+(?:-lc|\/c)\s+(.+)$/i)?.[1]??s;return De(r.match(/^(['"])([\s\S]*)\1$/)?.[2]??r)}n(Us,"stripWrappedShell");function Cn(t){if(typeof t=="string")return t;if(t==null)return"";try{return JSON.stringify(t,null,2)}catch{return String(t)}}n(Cn,"formatUnknown");function tt(t){if(typeof t=="string")try{return JSON.stringify(JSON.parse(t),null,2)}catch{return t}return Cn(t)}n(tt,"formatToolPayload");function $i(t){const s=ze(t);if(!s)return;const r=[s.toolUseId,s.tool_use_id,s.callId,s.call_id,s.id];for(const i of r)if(typeof i=="string"&&i.trim())return i}n($i,"extractToolUseId");function Hs(t,s){for(const r of s){const i=t[r];if(typeof i=="string"&&i.trim())return Le(De(i),120)}return null}n(Hs,"summarizeRecord");function Pi(t,s){if(s==null)return t;if(typeof s=="string")return s.trim().length>0?s:t;const r=ze(t),i=ze(s);return i?Object.keys(i).length===0?t:r?{...r,...i}:s:s}n(Pi,"mergeToolInput");function Wt(t,s,r){const i=r==="compact"?72:120;if(typeof s=="string")return Le(xt(t,s)?Us(s):De(s),i);const l=ze(s);if(!l){const m=De(Cn(s));return m?Le(m,i):`Inspect ${t} input`}const a=typeof l.command=="string"?l.command:typeof l.cmd=="string"?l.cmd:null;if(a&&xt(t,l))return Le(Us(a),i);const d=Hs(l,["command","cmd","path","filePath","file_path","query","url","prompt","message"])??Hs(l,["pattern","name","title","target","tool","text"])??null;if(d)return Le(d,i);if(Array.isArray(l.paths)&&l.paths.length>0){const m=l.paths.find(p=>typeof p=="string"&&p.trim().length>0);if(m)return Le(`${l.paths.length} paths, starting with ${m}`,i)}const c=Object.keys(l);return c.length===0?`No ${t} input`:c.length===1?Le(`${c[0]} payload`,i):Le(`${c.length} fields: ${c.slice(0,3).join(", ")}`,i)}n(Wt,"summarizeToolInput");function In(t){if(!t)return null;const s=t.split(/\r?\n/),r=new Map;let i=s.findIndex(a=>a.trim()==="");i===-1&&(i=s.length);for(let a=0;a<i;a+=1){const d=s[a]?.match(/^([a-z_]+):\s*(.+)$/i);d&&r.set(d[1].toLowerCase(),De(d[2]))}const l=s.slice(Math.min(i+1,s.length)).map(a=>De(a)).filter(Boolean).join(`
@@ -1 +1 @@
1
- var L=Object.defineProperty;var a=(e,s)=>L(e,"name",{value:s,configurable:!0});import{i as y}from"./rolldown-runtime-ZpX3ckPj.js";import{l as m,na as q,ta as z}from"./createLucideIcon-CnVGnh-n.js";import{t as P,v as B}from"./queryKeys-DNib4smf.js";import{on as D,zt as F}from"./router-C-DPy1sQ.js";import{t as T}from"./chevron-down-D5bzoGsg.js";import{t as w}from"./chevron-right-Bmb_ezMx.js";import{t as O}from"./list-todo-iCf4vWjc.js";import{t as v}from"./button-C9JA0pR9.js";import{t as A}from"./TaskChatProtocolCard-BvDJtGnF.js";import{Va as K}from"./index-vkQSx4qF.js";var u=y(q(),1),U=(0,u.createContext)(null);function M(e){return B({queryKey:P.issues.agentTodo(e??""),enabled:!!e&&!e?.startsWith("chat:"),queryFn:a(async()=>(await F.getAgentTodo(e)).snapshot,"queryFn")})}a(M,"useIssueAgentTodo");function S(e){let s=null,o=null;for(const n of e.phases)for(const r of n.tasks){if(r.status==="in_progress")return{kind:"current",task:r};r.status==="pending"?s??=r:r.status==="blocked"&&(o??=r)}return s?{kind:"next",task:s}:o?{kind:"blocked",task:o}:{kind:e.counts.total>0?"done":"empty",task:null}}a(S,"agentTodoFocus");function N(e){return e.task?e.task.content:e.kind==="done"?"All tasks done":"Todo list cleared"}a(N,"agentTodoFocusText");function V(e){switch(e.kind){case"current":return"In progress";case"next":return"Next";case"blocked":return"Blocked";case"done":return"Done";case"empty":return"Empty"}}a(V,"agentTodoFocusStatusLabel");function G(e){switch(e.kind){case"current":return"in_progress";case"next":return"queued";case"blocked":return"blocked";case"done":return"completed";case"empty":return"queued"}}a(G,"agentTodoFocusIconStatus");var $="wardmote:agent-todo-card:v1",_="expanded",H="collapsed";function C(){return typeof localStorage>"u"?null:localStorage}a(C,"browserStorage");function Q(e=C()){try{return e?.getItem($)===_}catch{return!1}}a(Q,"readAgentTodoCardExpanded");function W(e,s=C()){try{s?.setItem($,e?_:H)}catch{return}}a(W,"writeAgentTodoCardExpanded");var t=y(z(),1),X=new Set(["running","queued"]),Y={pending:"Pending",in_progress:"In progress",completed:"Completed",blocked:"Blocked",dropped:"Dropped"},J={pending:"queued",in_progress:"in_progress",completed:"completed",blocked:"blocked",dropped:"dropped"};function E(e){return e.status==="completed"||e.status==="dropped"}a(E,"isSettled");function I(e){return X.has(e.runStatus)}a(I,"isAgentTodoRunLive");function Z({task:e,dense:s}){const o=e.status==="dropped"?"text-ink-3/70 line-through":"text-ink-3 line-through";return(0,t.jsxs)("li",{className:m("flex items-start gap-2 rounded-sm px-1.5 text-sm",s?"py-0.5 leading-5":"py-1",e.status==="in_progress"&&"bg-bg-3 font-medium text-ink"),"data-status":e.status,"aria-current":e.status==="in_progress"?"step":void 0,children:[(0,t.jsx)(A,{status:J[e.status],className:m("mt-0.5 shrink-0",e.status==="dropped"&&"opacity-60")}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("span",{className:"sr-only",children:`${Y[e.status]}: `}),(0,t.jsx)("span",{className:m("break-words",E(e)&&o),children:e.content}),e.status==="blocked"&&e.blocker?(0,t.jsx)("p",{className:"mt-0.5 text-xs text-bad",children:`Blocked: ${e.blocker}`}):null]})]})}a(Z,"AgentTodoTaskRow");function ee({phase:e,index:s,dense:o}){const n=(0,u.useId)(),r=e.tasks.length>0&&e.tasks.every(E),[i,l]=(0,u.useState)(!r),g=e.tasks.filter(d=>d.status==="completed").length,x=e.name.trim()||`Phase ${s+1}`;return(0,t.jsxs)("section",{className:"flex flex-col gap-1",children:[(0,t.jsxs)("button",{type:"button",className:"flex min-w-0 items-center gap-1.5 rounded-sm text-left text-xs font-medium text-ink-3 hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus","aria-expanded":i,"aria-controls":n,onClick:a(()=>l(d=>!d),"onClick"),children:[i?(0,t.jsx)(T,{"aria-hidden":!0,className:"size-3.5 shrink-0"}):(0,t.jsx)(w,{"aria-hidden":!0,className:"size-3.5 shrink-0"}),(0,t.jsx)("span",{className:"min-w-0 truncate",children:x}),(0,t.jsx)("span",{className:"shrink-0 tabular-nums",children:`${g}/${e.tasks.length}`})]}),(0,t.jsx)("ol",{id:n,hidden:!i,"aria-label":`${x} tasks`,className:"flex flex-col gap-0.5",children:e.tasks.map((d,f)=>(0,t.jsx)(Z,{task:d,dense:o},`${f}:${d.content}`))})]})}a(ee,"AgentTodoPhaseSection");function te({snapshot:e,dense:s=!1}){const o=e.phases.reduce((r,i)=>r+i.tasks.length,0),n=Math.max(0,e.counts.total-o);return e.phases.length===0?(0,t.jsx)("p",{className:"text-sm text-ink-3",children:"The agent cleared its todo list."}):(0,t.jsxs)("div",{className:m("flex flex-col",s?"gap-2":"gap-3"),children:[e.phases.map((r,i)=>(0,t.jsx)(ee,{phase:r,index:i,dense:s},`${i}:${r.name}`)),n>0?(0,t.jsx)("p",{className:"text-xs text-ink-3",children:`+${n} more ${n===1?"task":"tasks"} not listed`}):null]})}a(te,"AgentTodoList");function ne({snapshot:e,showLiveDot:s=!0}){const{completed:o,total:n}=e.counts,r=n>0?Math.round(o/n*100):0,i=I(e);return(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-ink-3",children:[(0,t.jsx)("span",{className:"font-medium tabular-nums text-ink",children:`${o}/${n}`}),(0,t.jsx)("span",{"aria-hidden":!0,children:"·"}),(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[i&&s?(0,t.jsx)("span",{className:"size-1.5 shrink-0 animate-pulse rounded-full bg-(--status-agent-running) motion-reduce:animate-none","aria-hidden":!0,"data-testid":"agent-todo-live-dot"}):null,(0,t.jsxs)("span",{children:["from run ",(0,t.jsx)("span",{className:"font-mono",children:e.runId.slice(0,8)}),` · ${D(e.createdAt)}`]}),i?(0,t.jsx)("span",{className:"sr-only",children:"(run in progress)"}):null]})]}),(0,t.jsx)("div",{role:"progressbar","aria-label":"Agent todo progress","aria-valuemin":0,"aria-valuemax":n,"aria-valuenow":o,"aria-valuetext":`${o} of ${n} tasks completed`,className:"h-1 w-full overflow-hidden rounded-full bg-bg-3",children:(0,t.jsx)("div",{className:"h-full rounded-full bg-(--status-task-icon-done)",style:{width:`${r}%`}})})]})}a(ne,"AgentTodoProgress");function se({snapshot:e,className:s,"data-slot":o}){const n=S(e);return(0,t.jsxs)("span",{className:m("flex min-w-0 items-center gap-1.5 text-sm",s),"data-slot":o,"data-focus":n.kind,children:[(0,t.jsx)(A,{status:G(n),className:m("size-3.5 shrink-0",n.kind==="empty"&&"opacity-50")}),(0,t.jsx)("span",{className:"sr-only",children:`${V(n)}: `}),(0,t.jsx)("span",{className:"min-w-0 truncate",title:N(n),children:N(n)})]})}a(se,"AgentTodoFocusLine");function ge({issueId:e,className:s,frameClassName:o}){const{data:n}=M(e),r=(0,u.useContext)(U),i=(0,u.useId)(),[l,g]=(0,u.useState)(Q),x=(0,u.useRef)(null),d=n?S(n):null,f=d?.task?`${d.kind}:${d.task.content}`:null;if((0,u.useEffect)(()=>{if(!l)return;const c=x.current,j=c?.querySelector('[aria-current="step"]');if(!c||!j)return;const h=c.getBoundingClientRect(),p=j.getBoundingClientRect();p.top>=h.top&&p.bottom<=h.bottom||(c.scrollTop+=p.top-h.top-(c.clientHeight-p.height)/2)},[l,f]),!n)return null;const k=a(()=>{const c=!l;g(c),W(c)},"toggle"),R=I(n),b=(0,t.jsxs)("section",{"aria-label":"Agent todo",className:m("flex flex-col rounded-md border border-line bg-bg-2 px-3",l?"gap-2 py-2":"py-1.5",s),"data-testid":"agent-todo-card","data-expanded":l,children:[(0,t.jsxs)("header",{className:"flex min-w-0 items-center gap-2",children:[(0,t.jsx)(O,{"aria-hidden":!0,className:"size-4 shrink-0 text-ink-3"}),(0,t.jsx)("h2",{className:m(l?"min-w-0 flex-1 truncate text-sm font-medium text-ink":"sr-only"),children:"Agent todo"}),l?null:(0,t.jsx)("button",{type:"button",className:"min-w-0 flex-1 rounded-sm text-left text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus","aria-expanded":!1,"aria-controls":i,onClick:k,"data-testid":"agent-todo-collapsed-summary",children:(0,t.jsx)(se,{snapshot:n})}),l?null:(0,t.jsxs)("span",{className:"flex shrink-0 items-center gap-1.5 text-xs text-ink-3",children:[R?(0,t.jsx)("span",{className:"size-1.5 shrink-0 animate-pulse rounded-full bg-(--status-agent-running) motion-reduce:animate-none","aria-hidden":!0,"data-testid":"agent-todo-live-dot"}):null,(0,t.jsx)("span",{className:"font-medium tabular-nums text-ink",children:`${n.counts.completed}/${n.counts.total}`})]}),r?(0,t.jsx)(v,{type:"button",variant:"ghost",size:"icon-xs","aria-label":"Open agent todo in side panel",onClick:r,children:(0,t.jsx)(K,{"aria-hidden":!0})}):null,(0,t.jsx)(v,{type:"button",variant:"ghost",size:"icon-xs","aria-label":l?"Collapse agent todo":"Expand agent todo","aria-expanded":l,"aria-controls":i,onClick:k,children:l?(0,t.jsx)(T,{"aria-hidden":!0}):(0,t.jsx)(w,{"aria-hidden":!0})})]}),(0,t.jsxs)("div",{id:i,hidden:!l,className:"flex flex-col gap-2",children:[(0,t.jsx)(ne,{snapshot:n,showLiveDot:l}),(0,t.jsx)("div",{ref:x,className:"max-h-40 overflow-y-auto","data-testid":"agent-todo-card-list",children:(0,t.jsx)(te,{snapshot:n,dense:!0})})]})]});return o?(0,t.jsx)("div",{className:o,children:b}):b}a(ge,"AgentTodoCard");export{M as a,ne as i,se as n,U as o,te as r,ge as t};
1
+ var L=Object.defineProperty;var a=(e,s)=>L(e,"name",{value:s,configurable:!0});import{i as y}from"./rolldown-runtime-ZpX3ckPj.js";import{l as m,na as q,ta as z}from"./createLucideIcon-CnVGnh-n.js";import{t as P,v as B}from"./queryKeys-DNib4smf.js";import{on as D,zt as F}from"./router-C-DPy1sQ.js";import{t as T}from"./chevron-down-D5bzoGsg.js";import{t as w}from"./chevron-right-Bmb_ezMx.js";import{t as O}from"./list-todo-iCf4vWjc.js";import{t as v}from"./button-C9JA0pR9.js";import{t as A}from"./TaskChatProtocolCard-C1PnM_U-.js";import{Va as K}from"./index-B-KXIl2u.js";var u=y(q(),1),U=(0,u.createContext)(null);function M(e){return B({queryKey:P.issues.agentTodo(e??""),enabled:!!e&&!e?.startsWith("chat:"),queryFn:a(async()=>(await F.getAgentTodo(e)).snapshot,"queryFn")})}a(M,"useIssueAgentTodo");function S(e){let s=null,o=null;for(const n of e.phases)for(const r of n.tasks){if(r.status==="in_progress")return{kind:"current",task:r};r.status==="pending"?s??=r:r.status==="blocked"&&(o??=r)}return s?{kind:"next",task:s}:o?{kind:"blocked",task:o}:{kind:e.counts.total>0?"done":"empty",task:null}}a(S,"agentTodoFocus");function N(e){return e.task?e.task.content:e.kind==="done"?"All tasks done":"Todo list cleared"}a(N,"agentTodoFocusText");function V(e){switch(e.kind){case"current":return"In progress";case"next":return"Next";case"blocked":return"Blocked";case"done":return"Done";case"empty":return"Empty"}}a(V,"agentTodoFocusStatusLabel");function G(e){switch(e.kind){case"current":return"in_progress";case"next":return"queued";case"blocked":return"blocked";case"done":return"completed";case"empty":return"queued"}}a(G,"agentTodoFocusIconStatus");var $="wardmote:agent-todo-card:v1",_="expanded",H="collapsed";function C(){return typeof localStorage>"u"?null:localStorage}a(C,"browserStorage");function Q(e=C()){try{return e?.getItem($)===_}catch{return!1}}a(Q,"readAgentTodoCardExpanded");function W(e,s=C()){try{s?.setItem($,e?_:H)}catch{return}}a(W,"writeAgentTodoCardExpanded");var t=y(z(),1),X=new Set(["running","queued"]),Y={pending:"Pending",in_progress:"In progress",completed:"Completed",blocked:"Blocked",dropped:"Dropped"},J={pending:"queued",in_progress:"in_progress",completed:"completed",blocked:"blocked",dropped:"dropped"};function E(e){return e.status==="completed"||e.status==="dropped"}a(E,"isSettled");function I(e){return X.has(e.runStatus)}a(I,"isAgentTodoRunLive");function Z({task:e,dense:s}){const o=e.status==="dropped"?"text-ink-3/70 line-through":"text-ink-3 line-through";return(0,t.jsxs)("li",{className:m("flex items-start gap-2 rounded-sm px-1.5 text-sm",s?"py-0.5 leading-5":"py-1",e.status==="in_progress"&&"bg-bg-3 font-medium text-ink"),"data-status":e.status,"aria-current":e.status==="in_progress"?"step":void 0,children:[(0,t.jsx)(A,{status:J[e.status],className:m("mt-0.5 shrink-0",e.status==="dropped"&&"opacity-60")}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("span",{className:"sr-only",children:`${Y[e.status]}: `}),(0,t.jsx)("span",{className:m("break-words",E(e)&&o),children:e.content}),e.status==="blocked"&&e.blocker?(0,t.jsx)("p",{className:"mt-0.5 text-xs text-bad",children:`Blocked: ${e.blocker}`}):null]})]})}a(Z,"AgentTodoTaskRow");function ee({phase:e,index:s,dense:o}){const n=(0,u.useId)(),r=e.tasks.length>0&&e.tasks.every(E),[i,l]=(0,u.useState)(!r),g=e.tasks.filter(d=>d.status==="completed").length,x=e.name.trim()||`Phase ${s+1}`;return(0,t.jsxs)("section",{className:"flex flex-col gap-1",children:[(0,t.jsxs)("button",{type:"button",className:"flex min-w-0 items-center gap-1.5 rounded-sm text-left text-xs font-medium text-ink-3 hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus","aria-expanded":i,"aria-controls":n,onClick:a(()=>l(d=>!d),"onClick"),children:[i?(0,t.jsx)(T,{"aria-hidden":!0,className:"size-3.5 shrink-0"}):(0,t.jsx)(w,{"aria-hidden":!0,className:"size-3.5 shrink-0"}),(0,t.jsx)("span",{className:"min-w-0 truncate",children:x}),(0,t.jsx)("span",{className:"shrink-0 tabular-nums",children:`${g}/${e.tasks.length}`})]}),(0,t.jsx)("ol",{id:n,hidden:!i,"aria-label":`${x} tasks`,className:"flex flex-col gap-0.5",children:e.tasks.map((d,f)=>(0,t.jsx)(Z,{task:d,dense:o},`${f}:${d.content}`))})]})}a(ee,"AgentTodoPhaseSection");function te({snapshot:e,dense:s=!1}){const o=e.phases.reduce((r,i)=>r+i.tasks.length,0),n=Math.max(0,e.counts.total-o);return e.phases.length===0?(0,t.jsx)("p",{className:"text-sm text-ink-3",children:"The agent cleared its todo list."}):(0,t.jsxs)("div",{className:m("flex flex-col",s?"gap-2":"gap-3"),children:[e.phases.map((r,i)=>(0,t.jsx)(ee,{phase:r,index:i,dense:s},`${i}:${r.name}`)),n>0?(0,t.jsx)("p",{className:"text-xs text-ink-3",children:`+${n} more ${n===1?"task":"tasks"} not listed`}):null]})}a(te,"AgentTodoList");function ne({snapshot:e,showLiveDot:s=!0}){const{completed:o,total:n}=e.counts,r=n>0?Math.round(o/n*100):0,i=I(e);return(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-ink-3",children:[(0,t.jsx)("span",{className:"font-medium tabular-nums text-ink",children:`${o}/${n}`}),(0,t.jsx)("span",{"aria-hidden":!0,children:"·"}),(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[i&&s?(0,t.jsx)("span",{className:"size-1.5 shrink-0 animate-pulse rounded-full bg-(--status-agent-running) motion-reduce:animate-none","aria-hidden":!0,"data-testid":"agent-todo-live-dot"}):null,(0,t.jsxs)("span",{children:["from run ",(0,t.jsx)("span",{className:"font-mono",children:e.runId.slice(0,8)}),` · ${D(e.createdAt)}`]}),i?(0,t.jsx)("span",{className:"sr-only",children:"(run in progress)"}):null]})]}),(0,t.jsx)("div",{role:"progressbar","aria-label":"Agent todo progress","aria-valuemin":0,"aria-valuemax":n,"aria-valuenow":o,"aria-valuetext":`${o} of ${n} tasks completed`,className:"h-1 w-full overflow-hidden rounded-full bg-bg-3",children:(0,t.jsx)("div",{className:"h-full rounded-full bg-(--status-task-icon-done)",style:{width:`${r}%`}})})]})}a(ne,"AgentTodoProgress");function se({snapshot:e,className:s,"data-slot":o}){const n=S(e);return(0,t.jsxs)("span",{className:m("flex min-w-0 items-center gap-1.5 text-sm",s),"data-slot":o,"data-focus":n.kind,children:[(0,t.jsx)(A,{status:G(n),className:m("size-3.5 shrink-0",n.kind==="empty"&&"opacity-50")}),(0,t.jsx)("span",{className:"sr-only",children:`${V(n)}: `}),(0,t.jsx)("span",{className:"min-w-0 truncate",title:N(n),children:N(n)})]})}a(se,"AgentTodoFocusLine");function ge({issueId:e,className:s,frameClassName:o}){const{data:n}=M(e),r=(0,u.useContext)(U),i=(0,u.useId)(),[l,g]=(0,u.useState)(Q),x=(0,u.useRef)(null),d=n?S(n):null,f=d?.task?`${d.kind}:${d.task.content}`:null;if((0,u.useEffect)(()=>{if(!l)return;const c=x.current,j=c?.querySelector('[aria-current="step"]');if(!c||!j)return;const h=c.getBoundingClientRect(),p=j.getBoundingClientRect();p.top>=h.top&&p.bottom<=h.bottom||(c.scrollTop+=p.top-h.top-(c.clientHeight-p.height)/2)},[l,f]),!n)return null;const k=a(()=>{const c=!l;g(c),W(c)},"toggle"),R=I(n),b=(0,t.jsxs)("section",{"aria-label":"Agent todo",className:m("flex flex-col rounded-md border border-line bg-bg-2 px-3",l?"gap-2 py-2":"py-1.5",s),"data-testid":"agent-todo-card","data-expanded":l,children:[(0,t.jsxs)("header",{className:"flex min-w-0 items-center gap-2",children:[(0,t.jsx)(O,{"aria-hidden":!0,className:"size-4 shrink-0 text-ink-3"}),(0,t.jsx)("h2",{className:m(l?"min-w-0 flex-1 truncate text-sm font-medium text-ink":"sr-only"),children:"Agent todo"}),l?null:(0,t.jsx)("button",{type:"button",className:"min-w-0 flex-1 rounded-sm text-left text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus","aria-expanded":!1,"aria-controls":i,onClick:k,"data-testid":"agent-todo-collapsed-summary",children:(0,t.jsx)(se,{snapshot:n})}),l?null:(0,t.jsxs)("span",{className:"flex shrink-0 items-center gap-1.5 text-xs text-ink-3",children:[R?(0,t.jsx)("span",{className:"size-1.5 shrink-0 animate-pulse rounded-full bg-(--status-agent-running) motion-reduce:animate-none","aria-hidden":!0,"data-testid":"agent-todo-live-dot"}):null,(0,t.jsx)("span",{className:"font-medium tabular-nums text-ink",children:`${n.counts.completed}/${n.counts.total}`})]}),r?(0,t.jsx)(v,{type:"button",variant:"ghost",size:"icon-xs","aria-label":"Open agent todo in side panel",onClick:r,children:(0,t.jsx)(K,{"aria-hidden":!0})}):null,(0,t.jsx)(v,{type:"button",variant:"ghost",size:"icon-xs","aria-label":l?"Collapse agent todo":"Expand agent todo","aria-expanded":l,"aria-controls":i,onClick:k,children:l?(0,t.jsx)(T,{"aria-hidden":!0}):(0,t.jsx)(w,{"aria-hidden":!0})})]}),(0,t.jsxs)("div",{id:i,hidden:!l,className:"flex flex-col gap-2",children:[(0,t.jsx)(ne,{snapshot:n,showLiveDot:l}),(0,t.jsx)("div",{ref:x,className:"max-h-40 overflow-y-auto","data-testid":"agent-todo-card-list",children:(0,t.jsx)(te,{snapshot:n,dense:!0})})]})]});return o?(0,t.jsx)("div",{className:o,children:b}):b}a(ge,"AgentTodoCard");export{M as a,ne as i,se as n,U as o,te as r,ge as t};