@tickernelz/wardmote-ui 2026.1114.1 → 2026.1114.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{ActiveAgentsPanel-CKzCe8AC.js → ActiveAgentsPanel-CF0fwsze.js} +1 -1
- package/dist/assets/{AdapterManager-DFPaPUUr.js → AdapterManager-DUXWwNxv.js} +1 -1
- package/dist/assets/{AdvancedToolsRoute-CN5fWS4T.js → AdvancedToolsRoute-BamlkE3p.js} +1 -1
- package/dist/assets/{AgentActionButtons-a9LacJPP.js → AgentActionButtons-CPIhsP04.js} +1 -1
- package/dist/assets/{AgentBubbleActionRow-DIr3TdR9.js → AgentBubbleActionRow-BUAUmJKa.js} +1 -1
- package/dist/assets/{AgentChat-D5FDUYuV.js → AgentChat-BAn_ghsu.js} +1 -1
- package/dist/assets/{AgentChats-TN5SE_gN.js → AgentChats-f73hodzr.js} +1 -1
- package/dist/assets/{AgentDefaults-CiVVS_pQ.js → AgentDefaults-BL1XYvEo.js} +1 -1
- package/dist/assets/{AgentDetail-bCAmWRXs.js → AgentDetail-DthxFfuB.js} +1 -1
- package/dist/assets/{AgentTodoCard-BpmvHEsm.js → AgentTodoCard-BvgkWD0T.js} +1 -1
- package/dist/assets/{Agents-CToMMxGu.js → Agents-D5qI6yZZ.js} +3 -3
- package/dist/assets/{AppDetail-P807ou0a.js → AppDetail-B6PtMl8J.js} +1 -1
- package/dist/assets/{AppNotConnected-DuA4PukX.js → AppNotConnected-C_tGn786.js} +1 -1
- package/dist/assets/{ApprovalCard-BDdZDBMj.js → ApprovalCard-DrfZAdGQ.js} +1 -1
- package/dist/assets/{ApprovalDetail-CVgy1uNi.js → ApprovalDetail-sfPpfdXc.js} +1 -1
- package/dist/assets/{ApprovalPayload-H5zW6yQ4.js → ApprovalPayload-C4F3ItGH.js} +1 -1
- package/dist/assets/{Approvals-DL6kx45P.js → Approvals-DZoMl7_m.js} +1 -1
- package/dist/assets/{AppsConnect-DH7aSjtS.js → AppsConnect-D8Gu187f.js} +1 -1
- package/dist/assets/{AppsReview-Bf7oB0ES.js → AppsReview-DokFETm0.js} +1 -1
- package/dist/assets/{ArtifactCard-Cp4KPgZl.js → ArtifactCard-BTf2-JIV.js} +1 -1
- package/dist/assets/{Artifacts-Dz3eHCaQ.js → Artifacts-CK8FaygC.js} +1 -1
- package/dist/assets/{AssistantConnection-5Y4fBVXq.js → AssistantConnection-BlKC7jk0.js} +1 -1
- package/dist/assets/{AttentionInteractionResolver-DlP6a6AG.js → AttentionInteractionResolver-C2iz6oqT.js} +1 -1
- package/dist/assets/{AuditHub-Dz2UXl0c.js → AuditHub-DMhunMn8.js} +1 -1
- package/dist/assets/{BoardChat-DsMVXf5M.js → BoardChat-C4W8JLKB.js} +1 -1
- package/dist/assets/{BootstrapSetupUxLab-CWWisaHp.js → BootstrapSetupUxLab-D58OwniR.js} +1 -1
- package/dist/assets/{Browse-Be6aSv-F.js → Browse-BDjohBak.js} +1 -1
- package/dist/assets/{BudgetPolicyCard-Dka022-Z.js → BudgetPolicyCard-DfAAgk9Z.js} +1 -1
- package/dist/assets/{CaseDetail-DdJrlm0m.js → CaseDetail-CL0FC5sG.js} +1 -1
- package/dist/assets/{Cases-Da1szfrr.js → Cases-C-7dXrEt.js} +1 -1
- package/dist/assets/{ChatEndpointDetail-DSOH-zfs.js → ChatEndpointDetail-C-IYAYG8.js} +1 -1
- package/dist/assets/{ChatEndpointSetup-J23lq-xi.js → ChatEndpointSetup-CM3QixMj.js} +1 -1
- package/dist/assets/{ChoiceControls-B9yrYshK.js → ChoiceControls-3Qpci4yE.js} +1 -1
- package/dist/assets/{Companies-BkHWSxdB.js → Companies-97toQ8Cw.js} +1 -1
- package/dist/assets/{CompanyAccess-BaiGlxY1.js → CompanyAccess-CKhS1BaS.js} +1 -1
- package/dist/assets/{CompanyActivity-CMBXXwCw.js → CompanyActivity-DzNrAyAb.js} +1 -1
- package/dist/assets/{CompanyConnections-CVzsivTW.js → CompanyConnections-ORCH4i3U.js} +1 -1
- package/dist/assets/{CompanyEnvironments-K7piWRrx.js → CompanyEnvironments-DphURbtb.js} +1 -1
- package/dist/assets/{CompanyExport-Bo8tUPaY.js → CompanyExport-XeVCUcK3.js} +1 -1
- package/dist/assets/{CompanyImport-CBVjSXPA.js → CompanyImport-DPKpUaRa.js} +1 -1
- package/dist/assets/{CompanySettings-CuU9qSp5.js → CompanySettings-4JQpzuS1.js} +1 -1
- package/dist/assets/{CompanySettingsPluginPage-59_bMQQ3.js → CompanySettingsPluginPage-cVvXh0_G.js} +1 -1
- package/dist/assets/{CompanySkills-GBJMThWx.js → CompanySkills-BA_9Ztwj.js} +1 -1
- package/dist/assets/{ComposerAddMenu-D9z2INup.js → ComposerAddMenu-DNp4ecG8.js} +1 -1
- package/dist/assets/{ConfigureBuiltInAgentModal-D8Xnl51H.js → ConfigureBuiltInAgentModal-CQCHDkl4.js} +1 -1
- package/dist/assets/{ConnectionSetupFlow-DKjP5RBZ.js → ConnectionSetupFlow-BaarToKu.js} +1 -1
- package/dist/assets/{CopyableGatewayUrl-GuvA-DoQ.js → CopyableGatewayUrl-DxQsV7Hr.js} +1 -1
- package/dist/assets/{Dashboard-Cgj9BeTt.js → Dashboard--iaPJqJp.js} +1 -1
- package/dist/assets/{DashboardLive-Ku1cHAj9.js → DashboardLive-4rGeotay.js} +1 -1
- package/dist/assets/{DecisionDateChips-Z97mgInq.js → DecisionDateChips-CJOLtNrJ.js} +1 -1
- package/dist/assets/{DecisionModelSettings-NrNERkaW.js → DecisionModelSettings-D-OxKIGP.js} +1 -1
- package/dist/assets/{DecisionQueuePage-D8cyKm4V.js → DecisionQueuePage-D-kNFav_.js} +1 -1
- package/dist/assets/{DesignGuide-DvO3NaE-.js → DesignGuide-D7486q4b.js} +1 -1
- package/dist/assets/{DocumentFrameHeader-DTSqcw4Q.js → DocumentFrameHeader-B61HhahB.js} +1 -1
- package/dist/assets/{EmailEndpointSetup-Cm_KKjjw.js → EmailEndpointSetup-6OHb9B4q.js} +1 -1
- package/dist/assets/{ExecutionWorkspaceDetail-CVB4ZY8I.js → ExecutionWorkspaceDetail-BGV-9D5Y.js} +1 -1
- package/dist/assets/{FolderControls-B7TWghGc.js → FolderControls-L2RzbfdQ.js} +1 -1
- package/dist/assets/{GatewayDetail-DB1J44bF.js → GatewayDetail-CdXNQ9gD.js} +1 -1
- package/dist/assets/{GatewaysList-CKSwMmOi.js → GatewaysList-B0Jq1IRC.js} +1 -1
- package/dist/assets/{GoalDetail-Bscma2qU.js → GoalDetail-D2VhPtvw.js} +1 -1
- package/dist/assets/{GoalTree-jEFB788p.js → GoalTree-kFpgH4dA.js} +1 -1
- package/dist/assets/{Goals-jLNZ4UKT.js → Goals-B-_gq_Qu.js} +1 -1
- package/dist/assets/{ImageGalleryModal-CghUxjQC.js → ImageGalleryModal-DzKBMOnu.js} +1 -1
- package/dist/assets/{Inbox-DHwNNh-Z.js → Inbox-zllmqRcB.js} +1 -1
- package/dist/assets/{InstanceAdvanced-C5IIPBwh.js → InstanceAdvanced-B7tDfjwG.js} +1 -1
- package/dist/assets/{InviteLanding-BHmCRaWY.js → InviteLanding-brwa_8NC.js} +1 -1
- package/dist/assets/{IssueChatLongThreadPerf-JH8rtLk0.js → IssueChatLongThreadPerf-D0HJe6IV.js} +1 -1
- package/dist/assets/{IssueChatThread-ByTyrsxz.js → IssueChatThread-CMXzuvrF.js} +1 -1
- package/dist/assets/{IssueDetail-BIif8Swu.js → IssueDetail-DGdg-mB8.js} +1 -1
- package/dist/assets/{IssueDocumentAnnotations-BVdH4RTa.js → IssueDocumentAnnotations-BK-LgExc.js} +1 -1
- package/dist/assets/{IssueOutputSection-CFE6aU9L.js → IssueOutputSection-aSyiE1pg.js} +1 -1
- package/dist/assets/{IssueRecoveryActionCard-DBgE7aMm.js → IssueRecoveryActionCard-vAuL_OEC.js} +1 -1
- package/dist/assets/{IssueThreadInteractionCard-C3LFe8cu.js → IssueThreadInteractionCard-wFidFTIh.js} +1 -1
- package/dist/assets/{Issues-B5QG33RC.js → Issues-CsmM33z_.js} +1 -1
- package/dist/assets/{LiveNowTodoLine-D52WDE8-.js → LiveNowTodoLine-CP32NNp_.js} +1 -1
- package/dist/assets/{ManagedAiConnectionDetails-C9nV0oIT.js → ManagedAiConnectionDetails-Ba0awZ-O.js} +1 -1
- package/dist/assets/{McpConnect-Bk8Qskqw.js → McpConnect-CYLP1yLX.js} +1 -1
- package/dist/assets/{MembershipAction-DjdBY6Bk.js → MembershipAction-CKs7Ua9x.js} +1 -1
- package/dist/assets/{ModelsAndProviders-BtbhNxf_.js → ModelsAndProviders-gaR7HDQm.js} +1 -1
- package/dist/assets/{NewAgent-C4JqnMkp.js → NewAgent-DBQzvxIr.js} +1 -1
- package/dist/assets/{OmpAllSettings-aHENTYf5.js → OmpAllSettings-B_Knr51Z.js} +1 -1
- package/dist/assets/{PipelineSettings-CCoxV9Es.js → PipelineSettings-Dl-94FB5.js} +1 -1
- package/dist/assets/{Pipelines-DaQPh688.js → Pipelines-CY9hGe0h.js} +1 -1
- package/dist/assets/{PixelsOffice-D1X7mdpk.js → PixelsOffice-BgyGZsiV.js} +1 -1
- package/dist/assets/{PluginPage-B4kdPADI.js → PluginPage-CMA4Ei50.js} +1 -1
- package/dist/assets/{PluginSettings-yP8NX-sM.js → PluginSettings-Cm4H1JRT.js} +1 -1
- package/dist/assets/{ProfileDetailRoute-DMdAvFmb.js → ProfileDetailRoute-BEBctbC6.js} +1 -1
- package/dist/assets/{ProfileSettings-DVm3Tqzs.js → ProfileSettings-Djo7BLIj.js} +1 -1
- package/dist/assets/{ProfileWizardRoute-CijS7-aN.js → ProfileWizardRoute-DxLujEtD.js} +1 -1
- package/dist/assets/{ProjectDetail-DeLSGbmz.js → ProjectDetail-CmmdvUHn.js} +1 -1
- package/dist/assets/{ProjectWorkspaceDetail-DPajDjA-.js → ProjectWorkspaceDetail-BsA0hJ-k.js} +1 -1
- package/dist/assets/{ProjectWorkspacesContent-BCATCcZI.js → ProjectWorkspacesContent-BNNI_WAk.js} +1 -1
- package/dist/assets/{Projects-DPmo6PFV.js → Projects-BTAauZr0.js} +1 -1
- package/dist/assets/{PublicIssueSharePage-B_W1Qpy_.js → PublicIssueSharePage-DdPjfmD9.js} +1 -1
- package/dist/assets/{ReviewQueueCard-DhfCjwYP.js → ReviewQueueCard-BC6VY8Bc.js} +1 -1
- package/dist/assets/{RichWorkProductCard-rJC8tWnB.js → RichWorkProductCard-ClpMt_Bh.js} +1 -1
- package/dist/assets/{RoutineDetail-Cb0oYk5B.js → RoutineDetail-BT6_GKnC.js} +1 -1
- package/dist/assets/{RoutineRunVariablesDialog-CWNUGmiH.js → RoutineRunVariablesDialog-D_Mls1sV.js} +1 -1
- package/dist/assets/{Routines-Ct6W3Ht-.js → Routines-4LevOfvV.js} +1 -1
- package/dist/assets/{ScrollToBottom-BvL4b3BQ.js → ScrollToBottom-jItsgDR8.js} +1 -1
- package/dist/assets/{Search-CXiBakEC.js → Search-bmcm0_m_.js} +1 -1
- package/dist/assets/{Secrets-XUpMCMhK.js → Secrets-DfR1fBAZ.js} +1 -1
- package/dist/assets/{SkillSourceTree-Brg47aIX.js → SkillSourceTree--FWKWyF3.js} +1 -1
- package/dist/assets/{SkillSources-C3kuN9Hz.js → SkillSources-jUDjqy5i.js} +1 -1
- package/dist/assets/{SkillStudio-DVVVKjdn.js → SkillStudio-BsqtUnzF.js} +1 -1
- package/dist/assets/{SourceTrustBadge-D-MXuX_l.js → SourceTrustBadge-CfBrvKL3.js} +1 -1
- package/dist/assets/{StatusCards-BmNOGr1d.js → StatusCards-Dt3zorUZ.js} +1 -1
- package/dist/assets/{SummarySlotCard-DiTaQ4km.js → SummarySlotCard-D1C0qH2L.js} +1 -1
- package/dist/assets/{TaskChatLab-fOJfHKjI.js → TaskChatLab-B0coUvdp.js} +1 -1
- package/dist/assets/{TaskChatMarker-Cgyrmeab.js → TaskChatMarker-C40twVjh.js} +1 -1
- package/dist/assets/{TaskChatProtocolCard-DrIe_IYV.js → TaskChatProtocolCard--bi_tc6i.js} +1 -1
- package/dist/assets/{TaskChatThreadView-DKqNA1fZ.js → TaskChatThreadView-DkzFDrLW.js} +1 -1
- package/dist/assets/{TaskDetailRelationsPanel-C9mJfMvL.js → TaskDetailRelationsPanel-DZGkinoJ.js} +1 -1
- package/dist/assets/{TaskTreeControls-B1CSnDVK.js → TaskTreeControls-DznugVpi.js} +1 -1
- package/dist/assets/Terminal-NjEb5-2b.js +1 -0
- package/dist/assets/TerminalView-DZxK2Ei5.js +58 -0
- package/dist/assets/{TrustPresetSection-D4qB_VZo.js → TrustPresetSection-CjNwNBo3.js} +1 -1
- package/dist/assets/{UserProfile-Cavc3nhB.js → UserProfile-Dujv3qdz.js} +1 -1
- package/dist/assets/{WhatNeedsMe-B7BSt_wb.js → WhatNeedsMe-C9P2EsqQ.js} +1 -1
- package/dist/assets/{Workspaces-CDTiwIHd.js → Workspaces-BTgSx9nA.js} +1 -1
- package/dist/assets/{connection-owner-Cx9obLlP.js → connection-owner-DL4yKhSt.js} +1 -1
- package/dist/assets/dist-ypeTPGg_.js +1 -0
- package/dist/assets/dropdown-menu-DEO3mF_E.js +1 -0
- package/dist/assets/{environment-variables-editor-CCxeFKKk.js → environment-variables-editor-0qgSPgNN.js} +1 -1
- package/dist/assets/{index-B7mmhFG7.js → index-3AxqhPET.js} +4 -4
- package/dist/assets/index-B5bd7Tk6.css +2 -0
- package/dist/assets/{issue-properties-C_y5-tny.js → issue-properties-B1cYnBDU.js} +1 -1
- package/dist/assets/{issue-workspace-selection-ChtddJZC.js → issue-workspace-selection-S8UgGgK1.js} +1 -1
- package/dist/assets/{pipeline-stage-presentation-jxAxpF6f.js → pipeline-stage-presentation-5UBw7nsb.js} +1 -1
- package/dist/assets/{shared-hwt7Xn4W.js → shared-4LF6wQ38.js} +1 -1
- package/dist/assets/{tool-taxonomy-6170LibQ.js → tool-taxonomy-B5zpbkHA.js} +1 -1
- package/dist/assets/{transcript-adapter-C9uEslxp.js → transcript-adapter-C29ZJiU2.js} +1 -1
- package/dist/assets/{useSummaryDraftStream-BulT3Wwh.js → useSummaryDraftStream-R2Y2bAUU.js} +1 -1
- package/dist/index.html +7 -6
- package/dist/sw.js +1 -1
- package/package.json +1 -1
- package/dist/assets/Terminal-CGmILZtz.js +0 -1
- package/dist/assets/TerminalView-BqCU9Vc3.js +0 -58
- package/dist/assets/dropdown-menu-CqRAF7Oj.js +0 -1
- package/dist/assets/index-KZ2bEg2H.css +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var pl=Object.defineProperty;var t=(s,l)=>pl(s,"name",{value:l,configurable:!0});import{i as aa}from"./rolldown-runtime-ZpX3ckPj.js";import{Ir as fl,O as gl,l as K,na as kl,t as As,ta as jl}from"./createLucideIcon-DJi9suAC.js";import{a as bl,n as vl,r as Xs,t as la,v as yl,y as Nl}from"./star-BZgQbzhV.js";import{X as ia,_ as he,n as Zt,t as F,v as Ne}from"./queryKeys-DYV5MhM_.js";import{n as wl}from"./CompanyContext-CSrVsSze.js";import{at as Sl,dt as Tn,o as Cl,t as Pe,tt as ra}from"./router-2UfGeejU.js";import{t as oa}from"./checkbox-BHQhs41k.js";import{c as ca,i as Ce,o as At,p as Cs,r as Is,s as qs,t as Fs}from"./dropdown-menu-CqRAF7Oj.js";import{i as Il,r as Fl,t as Ll}from"./tabs-B2Os_leL.js";import{c as ne,l as da,t as _l}from"./MarkdownEditor-DXD-Cu3u.js";import{t as qt}from"./arrow-left-Ce_LIut0.js";import{t as Ie}from"./boxes-fV98p9-r.js";import{t as Hs}from"./check-Ctsrlfa-.js";import{t as Ls}from"./chevron-down-BCvxsWfI.js";import{t as En}from"./chevron-left-DP4zwC0G.js";import{t as Ps}from"./chevron-right-s7L6hXXq.js";import{t as ma}from"./circle-alert-C-L4OsHh.js";import{t as Dl}from"./circle-question-mark-B1jR2is9.js";import{t as Ot}from"./MarkdownBody-BTjuUgFa.js";import{t as Pl}from"./code-xml-BWc3OvMt.js";import{t as ua}from"./copy-_wvZOjTe.js";import{t as xa}from"./ellipsis-BTiLRUn4.js";import{t as us}from"./external-link-nl1b263c.js";import{t as Rl}from"./eye-DRS7RbEp.js";import{t as Ml}from"./file-code-corner-CmZ_RihF.js";import{t as gt}from"./file-text-Cw7ntqRx.js";import{t as Al}from"./flask-conical-CEYKkO5k.js";import{t as Qs}from"./folder-open-8WDYv4mw.js";import{t as Jt}from"./folder-search-D0WkVTZt.js";import{t as kt}from"./link-2-CND-9QZ2.js";import{r as mt,t as w}from"./button-CMwV3L1P.js";import{t as Tl}from"./octagon-x-CBcXy1zJ.js";import{t as Ut}from"./pause-CJSwJvLv.js";import{t as Rs}from"./plus-C6fnr28l.js";import{t as ut}from"./refresh-cw-B_Oki9wZ.js";import{t as Tt}from"./save-CJ1Iqyew.js";import{t as Ws}from"./search-04O7m-IF.js";import{t as El}from"./settings-DuZndeX2.js";import{t as zl}from"./shield-alert-Be9GuMrS.js";import{t as ha}from"./shield-check-B0HVjzM_.js";import{t as pa}from"./trash-D7zTaHTj.js";import{t as Ys}from"./triangle-alert-CBVKiaXB.js";import{t as zn}from"./user-Ccom_Ph0.js";import{t as Bl}from"./users-DyKzwIh4.js";import{t as fa}from"./x-DRDFdlYE.js";import{t as Kl}from"./MootMark-DZAfkwdv.js";import{i as Ze,n as Je,t as es}from"./tooltip-B5WQ3lq5.js";import{t as ie}from"./badge-DuA2EgZC.js";import{t as Bn}from"./AgentAvatar-DgGEobSY.js";import{a as ga}from"./ToastContext-DMdt9oTd.js";import{t as it}from"./agents-DmlgUVso.js";import{t as $l}from"./projects-mixWrT5q.js";import{a as xs,i as xt,n as ss,r as hs,s as ts,t as ns}from"./dialog-CKUblzlR.js";import{t as Fe}from"./input-DobnTAyB.js";import{t as en}from"./github-icon-Bbgf67tg.js";import{n as ql}from"./BreadcrumbContext-BVZDZoC0.js";import"./AgentIdentity-I_kB4rMX.js";import{t as Vt}from"./textarea-BRPEfJ-g.js";import{t as Ol}from"./InlineBanner-VQ5mstsR.js";import{t as ka}from"./AgentMultiSelect-DsJfZtR2.js";import{t as Ul}from"./use-adapter-capabilities-Bu8XkVZ9.js";import{t as Vl}from"./use-copy-action-D5dEzo6L.js";import{Ar as Hl,Ea as ja,Na as Ql,Pa as Wl,Ra as Ht,T as Oe,Ua as Qt,_ as Ue,kr as Gl,wa as ba}from"./index-B7mmhFG7.js";import{a as rt,c as Xl,i as Yl,l as va,n as Zl,o as Et,r as zt,t as sn,u as ya}from"./SkillCardIcon-BTCafp8l.js";import{t as Jl}from"./CopyText-Cr673_Kx.js";import{t as ei}from"./line-diff-DAcZgvm2.js";import{t as si}from"./SkillBinaryFile-DNe-MmCv.js";import{_ as ti,a as ni,b as Ye,c as ai,d as li,g as tn,h as nn,i as ii,l as ri,m as jt,n as oi,p as an,r as ci,s as Ms,t as di,u as mi,v as Na,x as De,y as ui}from"./FolderControls-B7TWghGc.js";import{a as ln,i as Kn,n as xi,o as hi,r as Us,t as pi}from"./company-skill-routes-D5LJ1l8M.js";var wa={name:"file-exclamation-point",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["file-warning"]};wa.node;var Sa=As(wa),Ca={name:"folder-input",size:24,node:[["path",{d:"M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1",key:"fm4g5t"}],["path",{d:"M2 13h10",key:"pgb2dq"}],["path",{d:"m9 16 3-3-3-3",key:"6m91ic"}]]};Ca.node;var Ia=As(Ca),Fa={name:"folder-plus",size:24,node:[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]};Fa.node;var rn=As(Fa),La={name:"git-fork",size:24,node:[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]]};La.node;var _s=As(La),_a={name:"move-right",size:24,node:[["path",{d:"M18 8L22 12L18 16",key:"1r0oui"}],["path",{d:"M2 12H22",key:"1m8cig"}]]};_a.node;var fi=As(_a),Da={name:"pin",size:24,node:[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]};Da.node;var gi=As(Da),e=aa(jl(),1);function ki({skill:s}){const l=s.metadata?.skillSourceId??s.metadata?.legacySkillSourceId;if(typeof l!="string")return null;const i=s.metadata?.skillSourceState,o=s.metadata?.skillSourceId?i==="removed"?"Removed from source · last installed version retained":i==="not_syncing"?"Not syncing · installed copy retained":i==="update_failed"?"Update failed · last installed version retained":"Synced from GitHub":"Refresh this source to sync all files";return(0,e.jsxs)("div",{className:"flex flex-col gap-1 py-3 text-xs text-ink-3",children:[(0,e.jsx)("span",{children:o}),(0,e.jsxs)("span",{className:"break-all font-mono",children:[String(s.metadata?.skillSourcePath??""),s.sourceRef?` · ${s.sourceRef.slice(0,8)}`:""]}),(0,e.jsx)(Pe,{to:`/skills/sources/${l}`,className:"text-ink underline",children:"Manage source"})]})}t(ki,"SkillSourceProvenance");var d=aa(kl(),1);var ji=["skill_authentication_required","skill_company_boundary_denied","skill_workspace_boundary_denied","skill_source_validation_failed","skill_unsafe_content_blocked","skill_secret_handling_blocked","skill_actor_restricted"];var bi="An organization administrator can change the skill policy to allow this.",vi="This requires organization administration access. Ask an administrator to make this change.",yi={skill_authentication_required:"Sign in to manage skills.",skill_company_boundary_denied:"This skill belongs to another organization.",skill_workspace_boundary_denied:"This skill source is outside an allowed workspace.",skill_source_validation_failed:"This skill source failed validation.",skill_unsafe_content_blocked:"This skill contains unsafe content.",skill_secret_handling_blocked:"This skill exposes a secret value.",skill_actor_restricted:"This action isn't available for the current actor."},Ni={skill_authentication_required:"Sign in and try again.",skill_company_boundary_denied:"Open the skill from the organization that owns it.",skill_workspace_boundary_denied:"Import from a configured Wardmote workspace or the organization managed-skill directory.",skill_source_validation_failed:"Fix the flagged source and retry.",skill_unsafe_content_blocked:"Remove the fetch-and-execute or unsafe pattern before saving.",skill_secret_handling_blocked:"Remove the secret value before saving.",skill_actor_restricted:"Retry from an account with access to this action."};function wi(s){return s&&typeof s=="object"?s:null}t(wi,"asRecord");function Bt(s){return typeof s=="string"&&s.trim().length>0?s:null}t(Bt,"asString");function Si(s,l){if(!(s instanceof Zt))return null;const i=wi(s.body),o=Bt(i?.code),c=Bt(i?.reason),a=Bt(i?.remediation);return o==="skill_policy_denied"||c==="explicit_rule"||c==="policy_default"?{state:"policy",code:o,reason:c,title:l?`${l} is restricted by your organization policy.`:"This action is restricted by your organization policy.",remediation:a??bi}:o==="skill_policy_admin_required"?{state:"platform_admin",code:o,reason:c,title:"This change needs administration access.",remediation:a??vi}:o!==null&&ji.includes(o)||c==="platform_invariant"?{state:"platform",code:o,reason:c,title:(o&&yi[o])??"This action is blocked by a platform safety rule.",remediation:a??(o&&Ni[o])??"Fix the flagged issue and try again."}:null}t(Si,"classifySkillDenial");function Ci(){const[s,l]=(0,d.useState)(null);return{denial:s,capture:(0,d.useCallback)((i,o)=>{const c=Si(i,o);return c?(l(c),!0):!1},[]),reset:(0,d.useCallback)(()=>l(null),[])}}t(Ci,"useSkillPolicyDenial");function Ii({denial:s,onDismiss:l,className:i}){const o=l?(0,e.jsx)(w,{variant:"ghost",size:"sm",onClick:l,children:"Dismiss"}):void 0;return(0,e.jsx)(Ol,{tone:"warning",icon:s.state==="policy"?ha:Ys,title:s.title,actions:o,className:i,children:(0,e.jsx)("p",{children:s.remediation})})}t(Ii,"SkillPolicyDenialNotice");var ht=["./skills",".agents/skills",".claude/skills",".codex/skills",".cursor/skills"],Pa=34;function Ds(s,l){return`${s} ${l}`}t(Ds,"selectionKey");function Fi(s){return s.sourceType==="remote_managed"?!1:typeof s.cwd=="string"&&s.cwd.trim().length>0}t(Fi,"isScannableWorkspace");function Ra(s){return s.workspaces.filter(Fi)}t(Ra,"scannableWorkspaces");function Li(s){switch(s){case"git_repo":return"git";case"local_path":return"local";case"non_git_path":return"folder";case"remote_managed":return"remote";default:return s}}t(Li,"workspaceKindLabel");function _i(s){return Array.from(new Set(s.map(l=>Li(l.sourceType)))).join(", ")}t(_i,"summarizeWorkspaceKinds");function dt(s){return s.status==="new"||s.status==="conflict"}t(dt,"isSelectableCandidate");function Di(s,l){const i=l.trim().toLowerCase();return i?s.filter(o=>[o.name,o.slug,o.description,o.relativePath,o.workspaceName,o.directoryRoot,o.status].some(c=>c?.toLowerCase().includes(i))):s}t(Di,"filterCandidates");function Pi(s,l=[]){const i=new Map(l.map(c=>[c.id,c])),o=new Map;for(const c of s){let a=o.get(c.workspaceId);a||(a={key:c.workspaceId,workspaceId:c.workspaceId,workspaceName:c.workspaceName,isPrimary:i.get(c.workspaceId)?.isPrimary??!1,directories:[]},o.set(c.workspaceId,a));let m=a.directories.find(r=>r.directoryRoot===c.directoryRoot);m||(m={key:`${c.workspaceId} ${c.directoryRoot}`,directoryRoot:c.directoryRoot,candidates:[]},a.directories.push(m)),m.candidates.push(c)}return Array.from(o.values()).map(c=>({...c,directories:c.directories.sort((a,m)=>a.directoryRoot.localeCompare(m.directoryRoot))})).sort((c,a)=>c.isPrimary!==a.isPrimary?c.isPrimary?-1:1:c.workspaceName.localeCompare(a.workspaceName))}t(Pi,"groupCandidates");function Ri(s){return new Map}t(Ri,"defaultSelection");function Mi(s){const l=new Map;for(const i of s)i.status==="new"&&l.set(Ds(i.workspaceId,i.relativePath),{workspaceId:i.workspaceId,path:i.relativePath});return l}t(Mi,"selectAllSelection");function $n(s){return`${s.slug}-copy`}t($n,"suggestedConflictSlug");function Wt(s){if(s.slug===void 0)return!0;const l=s.slug.trim();return!!l&&fl(l)===l}t(Wt,"isValidSelectionSlug");function Gs(s){return s instanceof Zt?s.message||`Request failed: ${s.status}`:s instanceof Error?s.message:"Unexpected error"}t(Gs,"readableErrorMessage");function Ai(s){return s instanceof Zt?s.status===403:!1}t(Ai,"isGrantError");function Ti({status:s}){switch(s){case"already_imported":return(0,e.jsxs)(ie,{variant:"outline",className:"gap-1 px-1.5 py-0 font-normal text-ink-3 border-line/60",children:[(0,e.jsx)(kt,{className:"h-3 w-3"})," Imported"]});case"conflict":return(0,e.jsxs)(ie,{variant:"outline",className:"gap-1 px-1.5 py-0 font-normal text-amber-600 border-amber-500/40 dark:text-amber-400",children:[(0,e.jsx)(Ys,{className:"h-3 w-3"})," Conflict"]});case"skipped":return(0,e.jsxs)(ie,{variant:"outline",className:"gap-1 px-1.5 py-0 font-normal text-ink-3 border-line/60",children:[(0,e.jsx)(Sa,{className:"h-3 w-3"})," Skipped"]});default:return(0,e.jsxs)(ie,{variant:"outline",className:"gap-1 px-1.5 py-0 font-normal text-emerald-600 border-emerald-500/40 dark:text-emerald-400",children:[(0,e.jsx)(bl,{className:"h-3 w-3"})," New"]})}}t(Ti,"CandidateStatusBadge");function Ei({open:s,onOpenChange:l,companyId:i,onImportFromPath:o}){const c=ia(),a=ga(),[m,r]=(0,d.useState)("pick"),[x,g]=(0,d.useState)(""),[b,_]=(0,d.useState)(""),[f,v]=(0,d.useState)(null),[y,N]=(0,d.useState)(null),[D,k]=(0,d.useState)(null),[j,h]=(0,d.useState)(new Map),[P,A]=(0,d.useState)(null),[T,X]=(0,d.useState)(!1),[O,Q]=(0,d.useState)(null),C=(0,d.useRef)(0),M=Ne({queryKey:F.projects.list(i),queryFn:t(()=>$l.list(i),"queryFn"),enabled:s});(0,d.useEffect)(()=>{s&&(r("pick"),g(""),_(""),v(null),N(null),k(null),h(new Map),A(null),X(!1),Q(null),C.current+=1)},[s]);const ee=M.data??[],Y=(0,d.useMemo)(()=>{const L=x.trim().toLowerCase(),H=[...ee].sort((W,le)=>W.name.localeCompare(le.name));return L?H.filter(W=>W.name.toLowerCase().includes(L)):H},[ee,x]);function pe(L){v(L),N(null),k(null),h(new Map),r("scanning");const H=++C.current;ne.scanProjects(i,{projectIds:[L.id],mode:"preview"}).then(W=>{H===C.current&&(N(W),h(Ri(W.candidates)),r("select"))}).catch(W=>{H===C.current&&(k(W),r("select"))})}t(pe,"startScan");const ae=he({mutationFn:t(()=>{if(!f)throw new Error("No project selected.");const L=Array.from(j.values());return ne.scanProjects(i,{projectIds:[f.id],mode:"import",selection:L})},"mutationFn"),onSuccess:t(async L=>{A(L),r("result"),await c.invalidateQueries({queryKey:F.companySkills.list(i)});const H=L.imported.length;a.pushToast({tone:H>0?"success":"warn",title:H>0?"Skills imported":"Nothing imported",body:H>0?`${H} skill${H===1?"":"s"} imported as references from ${f?.name??"the project"}.`:"No skills were imported."})},"onSuccess"),onError:t(L=>{a.pushToast({tone:"error",title:"Import failed",body:Gs(L)})},"onError")}),Z=y?.candidates??[],Le=(0,d.useMemo)(()=>Z.filter(dt),[Z]),xe=(0,d.useMemo)(()=>Di(Z,b),[b,Z]),de=(0,d.useMemo)(()=>Pi(xe,f?.workspaces??[]),[xe,f]),S=j.size,U=Array.from(j.values()).some(L=>!Wt(L));function se(L){dt(L)&&h(H=>{const W=new Map(H),le=Ds(L.workspaceId,L.relativePath);return W.has(le)?W.delete(le):W.set(le,{workspaceId:L.workspaceId,path:L.relativePath,...L.status==="conflict"?{slug:$n(L)}:{}}),W})}t(se,"toggleCandidate");function Re(L,H){h(W=>{const le=new Map(W),te=Ds(L.workspaceId,L.relativePath),re=le.get(te);return re?(le.set(te,{...re,slug:H}),le):W})}t(Re,"renameCandidate");async function Me(L,H){if(!f)return;const W=H.toLowerCase().endsWith("/skill.md")?H.slice(0,-9)||".":H.toLowerCase()==="skill.md"?".":H,le=Ds(L,W);Q(le);try{const te=await ne.scanProjects(i,{projectIds:[f.id],mode:"preview",selection:[{workspaceId:L,path:W}]});N(te);const re=te.candidates.find(G=>G.workspaceId===L&&G.relativePath===W);re&&dt(re)?(h(G=>{const ge=new Map(G);return ge.set(le,{workspaceId:L,path:W,...re.status==="conflict"?{slug:$n(re)}:{}}),ge}),X(!1)):a.pushToast({tone:"warn",title:re?.status==="already_imported"?"Skill already imported":"Skill could not be added",body:re?.reason??"The selected folder does not contain a valid SKILL.md file."})}catch(te){a.pushToast({tone:"error",title:"Could not inspect skill",body:Gs(te)})}finally{Q(null)}}t(Me,"addBrowsedSkill");function ps(){h(Mi(Z))}t(ps,"selectAll");function as(){h(new Map)}t(as,"deselectAll");function we(){ae.isPending||l(!1)}t(we,"handleClose");function Ae(){C.current+=1,v(null),N(null),k(null),_(""),h(new Map),r("pick")}return t(Ae,"backToPick"),(0,e.jsx)(ns,{open:s,onOpenChange:t(L=>{L?l(!0):we()},"onOpenChange"),children:(0,e.jsxs)(ss,{showCloseButton:!1,className:"flex max-h-(--sz-85vh) flex-col gap-0 overflow-hidden p-0 sm:max-w-3xl","data-testid":"import-skills-from-project-dialog",children:[(0,e.jsxs)("header",{className:"flex shrink-0 items-start justify-between gap-3 border-b border-line/60 px-5 py-4",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,e.jsx)(ts,{className:"text-base font-semibold",children:"Import skills from project"}),(0,e.jsx)(hs,{className:"text-xs text-ink-3",children:"Pick a project, scan its workspaces for skills, and import them as references."})]}),(0,e.jsx)("button",{type:"button",className:"rounded-sm text-ink-3 opacity-70 transition-opacity hover:opacity-100",onClick:we,"aria-label":"Close import dialog",children:(0,e.jsx)(fa,{className:"h-4 w-4"})})]}),(0,e.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden","aria-live":"polite",children:[m==="pick"&&(0,e.jsx)(zi,{loading:M.isLoading,error:M.error,projects:Y,totalProjects:ee.length,filter:x,onFilterChange:g,onPick:pe}),m==="scanning"&&(0,e.jsx)(Bi,{projectName:f?.name??""}),m==="select"&&(0,e.jsx)($i,{scanError:D,onRetry:t(()=>f&&pe(f),"onRetry"),onImportFromPath:o,groups:de,totalCandidates:Z.length,filter:b,onFilterChange:_,selection:j,toggleCandidate:se,renameCandidate:Re,project:f,companyId:i,browseOpen:T,onBrowseOpenChange:X,onAddBrowsedSkill:Me,browseAddingKey:O}),m==="result"&&P&&(0,e.jsx)(qi,{result:P})]}),(0,e.jsxs)("footer",{className:"flex shrink-0 flex-col gap-2 border-t border-line/60 bg-bg-3/20 px-5 py-3 sm:flex-row sm:items-center sm:justify-between sm:gap-3",children:[m==="select"&&!D&&Z.length>0?(0,e.jsx)("div",{className:"min-w-0 flex-1 text-xs text-ink-3",children:(0,e.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,e.jsx)(kt,{className:"h-3.5 w-3.5 shrink-0"}),"Files stay in the project — Studio edits save directly to them."]})}):(0,e.jsx)("div",{className:"hidden min-w-0 flex-1 sm:block"}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center justify-end gap-2 sm:shrink-0",children:[m==="select"&&(0,e.jsxs)(e.Fragment,{children:[!D&&Z.length>0&&(0,e.jsxs)("div",{className:"mr-1 flex items-center gap-1",children:[(0,e.jsx)(w,{variant:"ghost",size:"sm",onClick:ps,disabled:Le.length===0,"data-testid":"select-all",children:"Select all"}),(0,e.jsx)(w,{variant:"ghost",size:"sm",onClick:as,disabled:S===0,"data-testid":"deselect-all",children:"Deselect all"})]}),(0,e.jsxs)(w,{variant:"secondary",size:"sm",onClick:Ae,children:[(0,e.jsx)(qt,{className:"mr-1 h-3.5 w-3.5"})," Back"]}),!D&&Z.length>0&&(0,e.jsx)(w,{size:"sm",onClick:t(()=>ae.mutate(),"onClick"),disabled:S===0||U||ae.isPending,"data-testid":"import-skills",children:ae.isPending?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(mt,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"})," Importing…"]}):`Import ${S} skill${S===1?"":"s"}`})]}),m==="pick"&&(0,e.jsx)(w,{variant:"ghost",size:"sm",onClick:we,children:"Cancel"}),m==="result"&&(0,e.jsx)(w,{size:"sm",onClick:we,children:"Done"})]})]})]})})}t(Ei,"ImportSkillsFromProjectDialog");function zi({loading:s,error:l,projects:i,totalProjects:o,filter:c,onFilterChange:a,onPick:m}){return(0,e.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,e.jsx)("div",{className:"border-b border-line/60 px-5 py-3",children:(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsx)(Ws,{className:"pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-ink-3"}),(0,e.jsx)(Fe,{value:c,onChange:t(r=>a(r.target.value),"onChange"),placeholder:"Filter projects",className:"pl-7 text-xs","aria-label":"Filter projects","data-testid":"project-filter"})]})}),(0,e.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto",children:s?(0,e.jsx)("div",{className:"p-6 text-center text-sm text-ink-3",children:"Loading projects…"}):l?(0,e.jsxs)("div",{className:"m-5 flex items-start gap-3 rounded-md border border-bad/40 bg-bad/10 p-4 text-sm text-bad",role:"alert",children:[(0,e.jsx)(ma,{className:"mt-0.5 h-4 w-4 shrink-0"}),(0,e.jsx)("div",{children:Gs(l)})]}):o===0?(0,e.jsx)(Oe,{icon:ra,message:"This organization has no projects yet."}):i.length===0?(0,e.jsx)(Oe,{icon:Ws,message:`No projects match "${c}".`}):(0,e.jsx)("ul",{className:"divide-y divide-line/60","data-testid":"project-list",children:i.map(r=>{const x=Ra(r),g=x.length===0,b=_i(r.workspaces);return(0,e.jsx)("li",{children:(0,e.jsxs)("button",{type:"button",className:K("flex w-full items-center gap-3 px-5 py-3 text-left transition-colors",g?"cursor-not-allowed opacity-60":"cursor-pointer hover:bg-bg-3/40"),onClick:t(()=>!g&&m(r),"onClick"),disabled:g,"aria-disabled":g,"data-testid":`project-row-${r.id}`,"data-disabled":g?"true":"false",children:[(0,e.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,e.jsx)("div",{className:"truncate text-sm font-medium",children:r.name}),(0,e.jsxs)("div",{className:"mt-0.5 text-xs text-ink-3",children:[r.workspaces.length," workspace",r.workspaces.length===1?"":"s",b?` · ${b}`:""]}),g&&(0,e.jsx)("div",{className:"mt-1 text-(length:--text-micro) text-ink-3",children:"Remote-only project — no locally scannable workspaces to import from."})]}),!g&&(0,e.jsxs)(ie,{variant:"outline",className:"shrink-0 px-1.5 py-0 font-normal",children:[x.length," scannable"]})]})},r.id)})})})]})}t(zi,"PickProjectStep");function Bi({projectName:s}){return(0,e.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center gap-4 p-8 text-center","data-testid":"scanning-step",children:[(0,e.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,e.jsx)(Jt,{className:"h-10 w-10 text-ink-3/60"}),(0,e.jsx)(mt,{className:"h-5 w-5 animate-spin text-ink-3"})]}),(0,e.jsxs)("div",{children:[(0,e.jsxs)("p",{className:"text-sm font-medium",children:["Scanning ",s||"project"," for skills…"]}),(0,e.jsx)("p",{className:"mt-1 text-xs text-ink-3",children:"Looking in well-known skill folders across each workspace."})]}),(0,e.jsxs)("div",{className:"flex max-w-md flex-wrap justify-center gap-1.5",children:[ht.map(l=>(0,e.jsx)(ie,{variant:"outline",className:"px-1.5 py-0 font-mono text-(length:--text-micro) font-normal text-ink-3",children:l},l)),(0,e.jsxs)(ie,{variant:"outline",className:"px-1.5 py-0 text-(length:--text-micro) font-normal text-ink-3",children:["+",Pa-ht.length," more"]})]})]})}t(Bi,"ScanningStep");function Ki({companyId:s,project:l,onBack:i,onAddSkill:o,addingKey:c}){const a=Ra(l),m=a.find(y=>y.isPrimary)??a[0]??null,[r,x]=(0,d.useState)(m?.id??""),[g,b]=(0,d.useState)("."),_=Ne({queryKey:["company-skills","browse-project",s,l.id,r,g],queryFn:t(()=>ne.browseProject(s,{projectId:l.id,workspaceId:r,path:g}),"queryFn"),enabled:!!r}),f=_.data;function v(y){x(y),b(".")}return t(v,"changeWorkspace"),(0,e.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col","data-testid":"project-skill-browser",children:[(0,e.jsxs)("div",{className:"shrink-0 border-b border-line/60 px-5 py-3",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"text-sm font-medium",children:"Browse project folders"}),(0,e.jsx)("p",{className:"mt-0.5 text-xs text-ink-3",children:"Open any folder and add directories or individual SKILL.md files."})]}),(0,e.jsxs)(w,{variant:"secondary",size:"sm",onClick:i,children:[(0,e.jsx)(qt,{className:"mr-1 h-3.5 w-3.5"})," Discovered skills"]})]}),a.length>1&&(0,e.jsx)("div",{className:"mt-3 flex flex-wrap gap-1.5","aria-label":"Project workspace",children:a.map(y=>(0,e.jsx)(w,{type:"button",variant:y.id===r?"secondary":"ghost",size:"sm",onClick:t(()=>v(y.id),"onClick"),children:y.name},y.id))})]}),(0,e.jsxs)("div",{className:"flex shrink-0 items-center gap-2 border-b border-line/60 bg-bg-3/20 px-5 py-2",children:[(0,e.jsx)(w,{variant:"ghost",size:"sm",onClick:t(()=>f?.parentPath&&b(f.parentPath),"onClick"),disabled:!f?.parentPath,"aria-label":"Open parent folder",children:(0,e.jsx)(qt,{className:"h-3.5 w-3.5"})}),(0,e.jsx)("span",{className:"min-w-0 truncate font-mono text-xs text-ink-3",children:f?.path??g})]}),(0,e.jsxs)("div",{className:"min-h-0 flex-1 overflow-y-auto",children:[_.isLoading?(0,e.jsxs)("div",{className:"flex items-center justify-center gap-2 p-8 text-sm text-ink-3",children:[(0,e.jsx)(mt,{className:"h-4 w-4 animate-spin"})," Loading folder…"]}):_.error?(0,e.jsx)("div",{className:"p-6 text-sm text-bad",children:Gs(_.error)}):f?.entries.length?(0,e.jsx)("ul",{className:"divide-y divide-line/60",children:f.entries.map(y=>{const N=y.kind==="file"?y.path.toLowerCase()==="skill.md"?".":y.path.slice(0,-9):y.path,D=Ds(r,N);return(0,e.jsxs)("li",{className:"flex items-center gap-3 px-5 py-2.5",children:[y.kind==="directory"?(0,e.jsx)(Xs,{className:"h-4 w-4 shrink-0 text-ink-3"}):(0,e.jsx)(gt,{className:"h-4 w-4 shrink-0 text-ink-3"}),(0,e.jsx)("button",{type:"button",className:K("min-w-0 flex-1 truncate text-left text-sm",y.kind==="directory"&&"font-medium hover:underline"),onClick:t(()=>y.kind==="directory"&&b(y.path),"onClick"),disabled:y.kind==="file",children:y.name}),y.isSkill?(0,e.jsx)(w,{size:"sm",onClick:t(()=>o(r,y.path),"onClick"),disabled:c===D,children:c===D?(0,e.jsx)(mt,{className:"h-3.5 w-3.5 animate-spin"}):"Add skill"}):y.kind==="directory"?(0,e.jsx)(Ps,{className:"h-4 w-4 text-ink-3"}):null]},y.path)})}):(0,e.jsx)("div",{className:"p-8 text-center text-sm text-ink-3",children:"This folder is empty."}),f?.truncated&&(0,e.jsx)("p",{className:"border-t border-line/60 px-5 py-2 text-xs text-ink-3",children:"Showing the first 250 entries."})]})]})}t(Ki,"ProjectSkillBrowser");function $i({scanError:s,onRetry:l,onImportFromPath:i,groups:o,totalCandidates:c,filter:a,onFilterChange:m,selection:r,toggleCandidate:x,renameCandidate:g,project:b,companyId:_,browseOpen:f,onBrowseOpenChange:v,onAddBrowsedSkill:y,browseAddingKey:N}){if(s){const D=Ai(s);return(0,e.jsx)("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6","data-testid":"scan-error",children:(0,e.jsxs)("div",{className:"max-w-md text-center",children:[(0,e.jsx)("div",{className:"mx-auto mb-4 w-fit bg-bg-3/50 p-4",children:D?(0,e.jsx)(zl,{className:"h-10 w-10 text-ink-3/60"}):(0,e.jsx)(ma,{className:"h-10 w-10 text-ink-3/60"})}),(0,e.jsx)("p",{className:"text-base font-semibold",children:D?"You can't import skills here":"Scan failed"}),(0,e.jsx)("p",{className:"mt-1.5 text-sm text-ink-3",children:D?"Your account doesn't have permission to add skills to this organization. Ask an owner to grant the skills permission, then try again.":Gs(s)}),!D&&(0,e.jsx)(w,{variant:"secondary",size:"sm",className:"mt-4",onClick:l,children:"Try again"})]})})}return f&&b?(0,e.jsx)(Ki,{companyId:_,project:b,onBack:t(()=>v(!1),"onBack"),onAddSkill:y,addingKey:N}):c===0?(0,e.jsx)("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6","data-testid":"select-empty",children:(0,e.jsxs)("div",{className:"max-w-md text-center",children:[(0,e.jsx)("div",{className:"mx-auto mb-4 w-fit bg-bg-3/50 p-4",children:(0,e.jsx)(Jt,{className:"h-10 w-10 text-ink-3/50"})}),(0,e.jsx)("p",{className:"text-base font-semibold",children:"No skills found"}),(0,e.jsxs)("p",{className:"mt-1.5 text-sm text-ink-3",children:["None of the well-known skill folders in this project's workspaces contain a"," ",(0,e.jsx)("code",{className:"rounded bg-bg-3 px-1 py-0.5 text-xs",children:"SKILL.md"}),". We searched"," ",ht.join(", ")," and ",Pa-ht.length," ","other agent-harness folders."]}),(0,e.jsxs)(w,{variant:"secondary",size:"sm",className:"mt-4",onClick:t(()=>v(!0),"onClick"),"data-testid":"browse-project-folders-empty",children:[(0,e.jsx)(Qs,{className:"mr-1.5 h-3.5 w-3.5"})," Browse project folders"]}),i&&(0,e.jsxs)("p",{className:"mt-3 text-sm text-ink-3",children:["For skills in non-standard folders, use"," ",(0,e.jsx)("button",{type:"button",className:"font-medium text-ink underline underline-offset-2",onClick:i,children:"Import from path or URL"}),"."]})]})}):(0,e.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col","data-testid":"candidate-list",children:[(0,e.jsxs)("div",{className:"flex shrink-0 items-center justify-between gap-3 border-b border-line/60 px-5 py-2.5",children:[(0,e.jsx)("p",{className:"text-xs text-ink-3",children:"Choose discovered skills, or browse any workspace folder."}),(0,e.jsxs)(w,{variant:"secondary",size:"sm",onClick:t(()=>v(!0),"onClick"),"data-testid":"browse-project-folders",children:[(0,e.jsx)(Qs,{className:"mr-1.5 h-3.5 w-3.5"})," Browse folders"]})]}),(0,e.jsx)("div",{className:"shrink-0 border-b border-line/60 px-5 py-2.5",children:(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsx)(Ws,{className:"absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-ink-3"}),(0,e.jsx)(Fe,{value:a,onChange:t(D=>m(D.target.value),"onChange"),placeholder:"Search discovered skills…",className:"h-8 pl-8 text-xs","aria-label":"Search discovered skills"})]})}),(0,e.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto",children:o.length===0?(0,e.jsxs)("div",{className:"flex h-full items-center justify-center p-6 text-sm text-ink-3",children:["No skills match “",a.trim(),"”."]}):o.map((D,k)=>(0,e.jsxs)("section",{children:[k>0&&!D.isPrimary&&o[k-1]?.isPrimary&&(0,e.jsx)("header",{className:"border-y border-line/60 bg-bg-3/30 px-5 py-2 text-xs uppercase tracking-wide text-ink-3",children:"Other Workspaces"}),(0,e.jsx)("header",{className:"sticky top-0 z-10 border-b border-line/60 bg-bg px-5 py-2 text-sm font-medium text-ink",children:D.workspaceName}),D.directories.map(j=>(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"bg-bg-3/30 px-5 py-1.5 font-mono text-(length:--text-micro) text-ink-3",children:j.directoryRoot}),(0,e.jsx)("ul",{className:"divide-y divide-line/60",children:j.candidates.map(h=>{const P=dt(h),A=Ds(h.workspaceId,h.relativePath),T=r.has(A),X=r.get(A);return(0,e.jsxs)("li",{className:K("flex items-start gap-3 px-5 py-2.5 transition-colors",P?"cursor-pointer hover:bg-bg-3/40":"opacity-70",T&&"bg-bg-3/50"),onClick:t(()=>x(h),"onClick"),"data-testid":`candidate-${h.relativePath}`,"data-status":h.status,"data-selected":T?"true":"false",children:[(0,e.jsx)("div",{className:"pt-0.5",onClick:t(O=>O.stopPropagation(),"onClick"),children:(0,e.jsx)(oa,{checked:T,onCheckedChange:t(()=>x(h),"onCheckedChange"),disabled:!P,"aria-label":`Select ${h.name}`})}),(0,e.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,e.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1",children:[(0,e.jsx)("span",{className:"min-w-0 truncate text-sm font-medium",children:h.name}),(0,e.jsx)(Ti,{status:h.status})]}),h.description&&(0,e.jsx)("p",{className:"mt-0.5 line-clamp-2 text-xs text-ink-3",children:h.description}),(0,e.jsx)("p",{className:"mt-0.5 font-mono text-(length:--text-micro) text-ink-3",children:h.relativePath}),h.reason&&(0,e.jsx)("p",{className:K("mt-0.5 text-(length:--text-micro)",h.status==="conflict"?"text-amber-600 dark:text-amber-400":"text-ink-3"),children:h.reason}),h.status==="conflict"&&T&&(0,e.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-2",onClick:t(O=>O.stopPropagation(),"onClick"),children:[(0,e.jsx)("label",{htmlFor:`rename-${h.workspaceId}-${h.slug}`,className:"shrink-0 text-xs text-ink-3",children:"Import as"}),(0,e.jsx)(Fe,{id:`rename-${h.workspaceId}-${h.slug}`,value:X?.slug??"",onChange:t(O=>g(h,O.target.value),"onChange"),className:"h-7 max-w-xs font-mono text-xs","aria-label":`Rename ${h.name}`,"aria-invalid":X?!Wt(X):void 0}),X&&!Wt(X)&&(0,e.jsx)("span",{className:"text-xs text-bad",children:"Use a lowercase URL-safe slug."})]})]})]},`${h.workspaceId} ${h.relativePath}`)})})]},j.key))]},D.key))})]})}t($i,"SelectStep");function qi({result:s}){const l=(0,d.useMemo)(()=>[...s.imported,...s.updated],[s]);return(0,e.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,e.jsxs)("div",{className:"border-b border-line/60 px-5 py-4","data-testid":"result-summary",children:[(0,e.jsxs)("div",{className:"flex items-start gap-3 rounded-md border border-emerald-500/30 bg-emerald-500/5 p-3",children:[(0,e.jsx)(kt,{className:"mt-0.5 h-4 w-4 shrink-0 text-emerald-600 dark:text-emerald-400"}),(0,e.jsxs)("div",{className:"text-xs leading-relaxed text-ink-3",children:[(0,e.jsx)("span",{className:"font-medium text-ink",children:"No files were copied."})," These skills reference the files in the project workspace — editing them in Skill Studio saves directly back to those files."]})]}),(0,e.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-3 text-xs text-ink-3",children:[(0,e.jsxs)("span",{className:"text-emerald-600 dark:text-emerald-400",children:["✓ ",s.imported.length," imported"]}),s.updated.length>0&&(0,e.jsxs)("span",{children:["↻ ",s.updated.length," updated"]}),s.skipped.length>0&&(0,e.jsxs)("span",{children:["⊘ ",s.skipped.length," skipped"]})]})]}),(0,e.jsxs)("div",{className:"min-h-0 flex-1 overflow-y-auto",children:[l.length>0&&(0,e.jsxs)("section",{children:[(0,e.jsxs)("header",{className:"bg-bg-3/30 px-5 py-1.5 text-xs uppercase tracking-wide text-ink-3",children:["Imported · ",l.length]}),(0,e.jsx)("ul",{className:"divide-y divide-line/60","data-testid":"result-imported",children:l.map(i=>(0,e.jsxs)("li",{className:"flex items-center gap-3 px-5 py-2.5 text-sm",children:[(0,e.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,e.jsx)("div",{className:"truncate font-medium",children:i.name}),i.description&&(0,e.jsx)("div",{className:"truncate text-xs text-ink-3",children:i.description})]}),(0,e.jsxs)(Pe,{to:ln(i.id),className:"inline-flex shrink-0 items-center gap-1 text-xs font-medium text-ink no-underline hover:underline",children:["Open ",(0,e.jsx)(us,{className:"h-3 w-3"})]})]},i.id))})]}),s.skipped.length>0&&(0,e.jsxs)("section",{children:[(0,e.jsxs)("header",{className:"bg-bg-3/30 px-5 py-1.5 text-xs uppercase tracking-wide text-ink-3",children:["Skipped · ",s.skipped.length]}),(0,e.jsx)("ul",{className:"divide-y divide-line/60","data-testid":"result-skipped",children:s.skipped.map((i,o)=>(0,e.jsxs)("li",{className:"flex items-start gap-2 px-5 py-2.5 text-xs",children:[(0,e.jsx)(Sa,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-ink-3"}),(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsx)("span",{className:"font-mono text-ink-3",children:i.path??"—"}),i.reason&&(0,e.jsx)("span",{className:"ml-2 text-ink-3",children:i.reason})]})]},`${i.workspaceId??"?"}-${i.path??o}`))})]}),s.warnings.length>0&&(0,e.jsxs)("section",{children:[(0,e.jsxs)("header",{className:"bg-bg-3/30 px-5 py-1.5 text-xs uppercase tracking-wide text-ink-3",children:["Warnings · ",s.warnings.length]}),(0,e.jsx)("ul",{className:"divide-y divide-line/60","data-testid":"result-warnings",children:s.warnings.map((i,o)=>(0,e.jsxs)("li",{className:"flex items-start gap-2 px-5 py-2.5 text-xs",children:[(0,e.jsx)(Ys,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-amber-500"}),(0,e.jsx)("span",{className:"text-ink-3",children:i})]},o))})]})]})]})}t(qi,"ResultStep");var ot=288,Gt=224,Xt=400,qn=16,Ma="wardmote.skills.folderRail.width";function pt(s){return Math.min(Xt,Math.max(Gt,s))}t(pt,"clampFolderRailWidth");function Oi(){if(typeof window>"u")return ot;try{const s=window.localStorage.getItem(Ma);if(!s)return ot;const l=Number.parseInt(s,10);return Number.isFinite(l)?pt(l):ot}catch{return ot}}t(Oi,"readStoredFolderRailWidth");function On(s){if(!(typeof window>"u"))try{window.localStorage.setItem(Ma,String(pt(s)))}catch{}}t(On,"writeStoredFolderRailWidth");function Ui(s){return!s.systemKey&&!jt(s)&&!nn(s)}t(Ui,"folderIsEditable");function Vi(s,l){return an(s,l).map(i=>i.id).filter(i=>i!==l)}t(Vi,"ancestorIds");function Hi({result:s,selection:l,loading:i=!1,tags:o,activeTag:c,onSelect:a,onSelectTag:m,onCreateFolder:r,onRenameFolder:x,onEditFolder:g,onMoveFolder:b,onDeleteFolder:_,onEnsureMyFolder:f}){const v=(0,d.useMemo)(()=>Ye(s),[s]),[y,N]=(0,d.useState)(()=>new Set),[D,k]=(0,d.useState)(null),[j,h]=(0,d.useState)(""),[P,A]=(0,d.useState)(Oi),[T,X]=(0,d.useState)(!1),O=(0,d.useRef)(P),Q=(0,d.useRef)(null);(0,d.useEffect)(()=>{if(l==="all"||l==="unfiled")return;const S=Vi(v,l);S.length!==0&&N(U=>{const se=new Set(U);let Re=!1;for(const Me of S)se.has(Me)||(se.add(Me),Re=!0);return Re?se:U})},[v,l]);function C(S){N(U=>{const se=new Set(U);return se.has(S)?se.delete(S):se.add(S),se})}t(C,"toggle");function M(S){k(S.id),h(S.name)}t(M,"startRename");function ee(S){const U=j.trim();U&&U!==S.name&&x(S,U),k(null)}t(ee,"commitRename");const Y=s?.allCount??0,pe=s?.unfiledCount??0,ae=(0,d.useCallback)(S=>{const U=pt(S);O.current=U,A(U),On(U)},[]),Z=(0,d.useCallback)(S=>{S.preventDefault(),S.currentTarget.setPointerCapture(S.pointerId),Q.current={startX:S.clientX,startWidth:O.current},X(!0)},[]),Le=(0,d.useCallback)(S=>{if(!Q.current)return;const U=pt(Q.current.startWidth+S.clientX-Q.current.startX);O.current=U,A(U)},[]),xe=(0,d.useCallback)(()=>{Q.current&&(Q.current=null,X(!1),On(O.current))},[]),de=(0,d.useCallback)(S=>{S.key==="ArrowLeft"?(S.preventDefault(),ae(P-qn)):S.key==="ArrowRight"?(S.preventDefault(),ae(P+qn)):S.key==="Home"?(S.preventDefault(),ae(Gt)):S.key==="End"&&(S.preventDefault(),ae(Xt))},[ae,P]);return(0,e.jsxs)("div",{className:"relative hidden h-full shrink-0 md:flex",style:{width:`${P}px`},children:[(0,e.jsxs)("nav",{"aria-label":"Skill folders",className:"flex min-w-0 flex-1 flex-col overflow-y-auto border-r border-line pr-3",children:[(0,e.jsxs)("div",{className:"mb-2 flex items-center justify-between gap-2 pt-0.5",children:[(0,e.jsx)("div",{className:"text-(length:--text-micro) font-medium uppercase tracking-wide text-ink-3",children:"Folders"}),(0,e.jsx)(w,{variant:"ghost",size:"icon-sm",title:"New folder",onClick:t(()=>r(null),"onClick"),children:(0,e.jsx)(Rs,{className:"h-3.5 w-3.5"})})]}),i?(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)("div",{className:"h-7 rounded-md bg-bg-3/60"}),(0,e.jsx)("div",{className:"h-7 rounded-md bg-bg-3/40"}),(0,e.jsx)("div",{className:"h-7 rounded-md bg-bg-3/30"})]}):(0,e.jsxs)("div",{className:"space-y-0.5",children:[(0,e.jsx)(ct,{active:l==="all",label:"All skills",count:Y,icon:(0,e.jsx)(ra,{className:"h-3.5 w-3.5"}),onSelect:t(()=>a("all"),"onSelect")}),v.my?(0,e.jsx)(Os,{node:v.my,depth:0,selection:l,expanded:y,renamingId:D,renameDraft:j,rootLabel:"My Skills",rootIcon:(0,e.jsx)(zn,{className:"h-3.5 w-3.5"}),onToggle:C,onSelect:a,onCreateFolder:r,onEditFolder:g,onMoveFolder:b,onDeleteFolder:_,onStartRename:M,onRenameDraftChange:h,onRenameCommit:ee,onRenameCancel:t(()=>k(null),"onRenameCancel")}):f?(0,e.jsx)(ct,{active:!1,label:"My Skills",count:0,icon:(0,e.jsx)(zn,{className:"h-3.5 w-3.5"}),muted:!0,onSelect:f}):null,(0,e.jsx)(Qi,{label:"Organization",onCreate:t(()=>r(null),"onCreate")}),v.company.length>0?v.company.map(S=>(0,e.jsx)(Os,{node:S,depth:0,selection:l,expanded:y,renamingId:D,renameDraft:j,onToggle:C,onSelect:a,onCreateFolder:r,onEditFolder:g,onMoveFolder:b,onDeleteFolder:_,onStartRename:M,onRenameDraftChange:h,onRenameCommit:ee,onRenameCancel:t(()=>k(null),"onRenameCancel")},S.folder.id)):(0,e.jsx)("div",{className:"px-2 py-1 text-xs text-ink-3",children:"No organization folders yet."}),v.projects?(0,e.jsx)(Os,{node:v.projects,depth:0,selection:l,expanded:y,renamingId:D,renameDraft:j,rootLabel:"Projects",rootIcon:(0,e.jsx)(Ie,{className:"h-3.5 w-3.5"}),onToggle:C,onSelect:a,onCreateFolder:r,onEditFolder:g,onMoveFolder:b,onDeleteFolder:_,onStartRename:M,onRenameDraftChange:h,onRenameCommit:ee,onRenameCancel:t(()=>k(null),"onRenameCancel")}):(0,e.jsx)(ct,{active:!1,label:"Projects",count:0,icon:(0,e.jsx)(Ie,{className:"h-3.5 w-3.5"}),muted:!0,disabled:!0,onSelect:t(()=>{},"onSelect")}),v.bundled?(0,e.jsx)(Os,{node:v.bundled,depth:0,selection:l,expanded:y,renamingId:D,renameDraft:j,rootLabel:"Bundled",rootIcon:(0,e.jsx)(Ie,{className:"h-3.5 w-3.5"}),onToggle:C,onSelect:a,onCreateFolder:r,onEditFolder:g,onMoveFolder:b,onDeleteFolder:_,onStartRename:M,onRenameDraftChange:h,onRenameCommit:ee,onRenameCancel:t(()=>k(null),"onRenameCancel")}):null,(0,e.jsx)("div",{className:"px-2 pb-1 pt-3 text-(length:--text-micro) font-medium uppercase tracking-wide text-ink-3",children:"System"}),(0,e.jsx)(ct,{active:l==="unfiled",label:"Unfiled",count:pe,icon:(0,e.jsx)(Ms,{color:null}),onSelect:t(()=>a("unfiled"),"onSelect")})]}),o.length>0?(0,e.jsxs)("div",{className:"mt-4 border-t border-line pt-3",children:[(0,e.jsxs)("div",{className:"mb-1.5 flex items-center gap-1.5 px-2 text-(length:--text-micro) font-medium uppercase tracking-wide text-ink-3",children:[(0,e.jsx)(da,{className:"h-3 w-3"}),"Tags"]}),(0,e.jsxs)("div",{className:"flex flex-wrap gap-1.5 px-1",children:[c?(0,e.jsxs)("button",{type:"button",onClick:t(()=>m(null),"onClick"),className:"inline-flex items-center gap-1 rounded-full border border-line bg-bg-3/60 px-2 py-0.5 text-xs text-ink",children:[c,(0,e.jsx)(Hs,{className:"h-3 w-3"})]}):null,o.filter(S=>S.slug!==c).map(S=>(0,e.jsxs)("button",{type:"button",onClick:t(()=>m(S.slug),"onClick"),className:"inline-flex items-center gap-1 rounded-full border border-line px-2 py-0.5 text-xs text-ink-3 transition-colors hover:bg-bg-3/40 hover:text-ink",children:[(0,e.jsx)("span",{className:"max-w-32 truncate",children:S.slug}),(0,e.jsx)("span",{className:"text-(length:--text-micro) opacity-70",children:S.count})]},S.slug))]})]}):null]}),(0,e.jsx)("div",{role:"separator","aria-label":"Resize skill folders","aria-orientation":"vertical","aria-valuemin":Gt,"aria-valuemax":Xt,"aria-valuenow":P,tabIndex:0,className:K("absolute inset-y-0 right-0 z-20 w-3 cursor-col-resize touch-none outline-none","before:absolute before:inset-y-0 before:left-1/2 before:w-px before:-translate-x-1/2 before:bg-transparent before:transition-colors","hover:before:bg-line focus-visible:before:bg-focus",T&&"before:bg-focus"),onPointerDown:Z,onPointerMove:Le,onPointerUp:xe,onPointerCancel:xe,onLostPointerCapture:xe,onKeyDown:de})]})}t(Hi,"SkillFolderRail");function Qi({label:s,onCreate:l}){return(0,e.jsxs)("div",{className:"group/heading flex items-center justify-between px-2 pb-0.5 pt-3",children:[(0,e.jsx)("span",{className:"text-(length:--text-micro) font-medium uppercase tracking-wide text-ink-3",children:s}),(0,e.jsx)("button",{type:"button",onClick:l,title:`New ${s.toLowerCase()} folder`,className:"opacity-0 transition-opacity group-hover/heading:opacity-100",children:(0,e.jsx)(Rs,{className:"h-3 w-3 text-ink-3"})})]})}t(Qi,"RailHeading");function ct({active:s,label:l,count:i,icon:o,muted:c=!1,disabled:a=!1,onSelect:m}){return(0,e.jsxs)("button",{type:"button",className:K("grid w-full grid-cols-(--gtc-folder-row-actions) items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm transition-colors hover:bg-bg-3/40",s?"bg-bg-3/60 text-ink":c?"text-ink-3/70":"text-ink-3"),"aria-current":s?"page":void 0,disabled:a,onClick:m,children:[(0,e.jsx)("span",{className:"flex h-4 w-4 items-center justify-center",children:o}),(0,e.jsx)("span",{className:"truncate",children:l}),(0,e.jsx)("span",{className:"text-right text-xs tabular-nums text-ink-3",children:i}),(0,e.jsx)("span",{className:"h-6 w-6","aria-hidden":"true"})]})}t(ct,"VirtualRow");function Os({node:s,depth:l,selection:i,expanded:o,renamingId:c,renameDraft:a,rootLabel:m,rootIcon:r,onToggle:x,onSelect:g,onCreateFolder:b,onEditFolder:_,onMoveFolder:f,onDeleteFolder:v,onStartRename:y,onRenameDraftChange:N,onRenameCommit:D,onRenameCancel:k}){const{folder:j,children:h}=s,P=o.has(j.id),A=i===j.id,T=Ui(j),X=!jt(j)&&!nn(j)&&j.depth<4,O=j.path.startsWith("my/"),Q=m??j.name;return(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{className:K("group grid grid-cols-(--gtc-folder-row-actions) items-center gap-2 rounded-md pr-2 text-sm transition-colors hover:bg-bg-3/40",A?"bg-bg-3/60 text-ink":"text-ink-3"),style:{paddingLeft:`${l*.75}rem`},children:[(0,e.jsx)("button",{type:"button","aria-label":P?"Collapse folder":"Expand folder",className:K("flex h-6 w-4 items-center justify-center text-ink-3",h.length===0&&"invisible"),onClick:t(()=>x(j.id),"onClick"),children:(0,e.jsx)(Ps,{className:K("h-3.5 w-3.5 transition-transform",P&&"rotate-90")})}),(0,e.jsxs)("button",{type:"button",className:"flex min-w-0 items-center gap-2 py-1 text-left","aria-current":A?"page":void 0,onClick:t(()=>{g(j.id),h.length>0&&x(j.id)},"onClick"),onDoubleClick:t(()=>T&&y(j),"onDoubleClick"),children:[r?(0,e.jsx)("span",{className:"flex h-4 w-4 items-center justify-center text-ink-3",children:r}):(0,e.jsx)(Ms,{color:j.color}),c===j.id?(0,e.jsx)("input",{value:a,onChange:t(C=>N(C.target.value),"onChange"),onClick:t(C=>C.stopPropagation(),"onClick"),onKeyDown:t(C=>{C.key==="Enter"&&D(j),C.key==="Escape"&&k()},"onKeyDown"),onBlur:t(()=>D(j),"onBlur"),className:"h-6 min-w-0 flex-1 rounded-sm border border-line bg-bg px-1 text-sm outline-none",autoFocus:!0}):(0,e.jsx)("span",{className:"truncate",children:Q})]}),(0,e.jsx)("span",{className:"text-right text-xs tabular-nums text-ink-3",children:j.itemCount}),T||X?(0,e.jsxs)(Fs,{children:[(0,e.jsx)(Cs,{asChild:!0,children:(0,e.jsx)(w,{variant:"ghost",size:"icon-sm",className:"h-6 w-6 opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100","aria-label":`Folder actions for ${Q}`,children:(0,e.jsx)(xa,{className:"h-3.5 w-3.5"})})}),(0,e.jsxs)(Is,{align:"end",children:[X?(0,e.jsxs)(Ce,{onSelect:t(()=>b(j.id),"onSelect"),children:[(0,e.jsx)(rn,{className:"h-3.5 w-3.5"}),"New subfolder"]}):null,T?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ce,{onSelect:t(()=>y(j),"onSelect"),children:"Rename"}),(0,e.jsx)(Ce,{onSelect:t(()=>_(j),"onSelect"),children:"Edit color"}),(0,e.jsxs)(Ce,{onSelect:t(()=>f(j,O?"company":"my"),"onSelect"),children:[(0,e.jsx)(fi,{className:"h-3.5 w-3.5"}),"Move to ",O?"Organization":"My Skills"]}),(0,e.jsx)(ca,{}),(0,e.jsxs)(Ce,{variant:"destructive",onSelect:t(()=>v(j),"onSelect"),children:[(0,e.jsx)(pa,{className:"h-3.5 w-3.5"}),"Delete"]})]}):null]})]}):(0,e.jsx)("span",{className:"h-6 w-6"})]}),P&&h.length>0?(0,e.jsx)("div",{children:h.map(C=>(0,e.jsx)(Os,{node:C,depth:l+1,selection:i,expanded:o,renamingId:c,renameDraft:a,onToggle:x,onSelect:g,onCreateFolder:b,onEditFolder:_,onMoveFolder:f,onDeleteFolder:v,onStartRename:y,onRenameDraftChange:N,onRenameCommit:D,onRenameCancel:k},C.folder.id))}):null]})}t(Os,"TreeBranch");function Wi({result:s,selection:l,onSelect:i}){const o=(0,d.useMemo)(()=>Ye(s),[s]),c=l==="all"||l==="unfiled"?[]:an(o,l);return(0,e.jsxs)("nav",{"aria-label":"Folder path",className:"flex flex-wrap items-center gap-1 text-sm",children:[(0,e.jsxs)("button",{type:"button",onClick:t(()=>i("all"),"onClick"),className:K("inline-flex items-center gap-1 rounded px-1.5 py-0.5 transition-colors hover:bg-bg-3/40",l==="all"?"font-medium text-ink":"text-ink-3"),children:[(0,e.jsx)(Wl,{className:"h-3.5 w-3.5"}),"All skills"]}),l==="unfiled"?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ps,{className:"h-3.5 w-3.5 text-ink-3/60"}),(0,e.jsx)("span",{className:"rounded px-1.5 py-0.5 font-medium text-ink",children:"Unfiled"})]}):null,c.map((a,m)=>{const r=m===c.length-1,x=m===0?tn(a):a.name;return(0,e.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,e.jsx)(Ps,{className:"h-3.5 w-3.5 text-ink-3/60"}),(0,e.jsxs)("button",{type:"button",onClick:t(()=>i(a.id),"onClick"),className:K("inline-flex items-center gap-1 rounded px-1.5 py-0.5 transition-colors hover:bg-bg-3/40",r?"font-medium text-ink":"text-ink-3"),children:[a.color?(0,e.jsx)(Ms,{color:a.color}):null,x]})]},a.id)})]})}t(Wi,"FolderBreadcrumb");function Gi({open:s,onOpenChange:l,result:i,title:o,subtitle:c,currentFolderId:a,pending:m=!1,onMove:r,onCreateFolder:x}){const g=(0,d.useMemo)(()=>Ye(i),[i]),[b,_]=(0,d.useState)(""),[f,v]=(0,d.useState)(void 0),[y,N]=(0,d.useState)(void 0),[D,k]=(0,d.useState)(""),[j,h]=(0,d.useState)(!1);(0,d.useEffect)(()=>{s&&(_(""),v(void 0),N(void 0),k(""))},[s]);const P=b.trim().toLowerCase(),A=t(M=>!P||M.name.toLowerCase().includes(P)||M.path.toLowerCase().includes(P),"matches"),T=f,X=typeof T=="string"?g.byId.get(T)??null:null,O=T===void 0?null:T===null?"Unfiled":X?.path??null;async function Q(){const M=D.trim();if(M){h(!0);try{const ee=await x(y??null,M);ee&&v(ee),N(void 0),k("")}finally{h(!1)}}}t(Q,"submitNewFolder");function C(M,ee){const{folder:Y}=M,pe=jt(Y),ae=!pe,Z=T===Y.id,Le=a===Y.id,xe=ae&&!nn(Y)&&Y.depth<4,de=M.children,S=A(Y),U=Aa(M,A);return P&&!S&&!U?null:(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{className:K("group flex items-center gap-2 rounded-md px-2 py-1.5 text-sm",ae?"cursor-pointer hover:bg-bg-3/40":"cursor-not-allowed opacity-50",Z&&"bg-bg-3/70"),style:{paddingLeft:`${.5+ee*.9}rem`},onClick:t(()=>ae&&v(Y.id),"onClick"),children:[Y.systemKey&&["my","projects","bundled"].includes(Y.systemKey)?(0,e.jsx)(Xs,{className:"h-3.5 w-3.5 shrink-0 text-ink-3"}):(0,e.jsx)(Ms,{color:Y.color}),(0,e.jsx)("span",{className:"min-w-0 flex-1 truncate",children:tn(Y)}),Le?(0,e.jsx)("span",{className:"text-xs text-ink-3",children:"current"}):null,pe?(0,e.jsx)("span",{className:"text-xs text-ink-3",children:"read-only"}):null,Z?(0,e.jsx)(Hs,{className:"h-3.5 w-3.5"}):null,xe?(0,e.jsx)("button",{type:"button",title:"New folder inside…",className:"opacity-0 transition-opacity group-hover:opacity-100",onClick:t(se=>{se.stopPropagation(),N(Y.id),k("")},"onClick"),children:(0,e.jsx)(rn,{className:"h-3.5 w-3.5 text-ink-3"})}):null]}),y===Y.id?(0,e.jsx)(Un,{depth:ee+1,value:D,pending:j,onChange:k,onSubmit:Q,onCancel:t(()=>N(void 0),"onCancel")}):null,de.map(se=>C(se,ee+1))]},Y.id)}return t(C,"renderNode"),(0,e.jsx)(ns,{open:s,onOpenChange:l,children:(0,e.jsxs)(ss,{className:"sm:max-w-lg",children:[(0,e.jsxs)(xs,{children:[(0,e.jsx)(ts,{children:o}),c?(0,e.jsx)(hs,{children:c}):null]}),(0,e.jsxs)("div",{className:"flex items-center gap-2 rounded-md border border-line px-2.5",children:[(0,e.jsx)(Ws,{className:"h-3.5 w-3.5 text-ink-3"}),(0,e.jsx)("input",{value:b,onChange:t(M=>_(M.target.value),"onChange"),placeholder:"Search folders",className:"h-8 min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-ink-3"})]}),(0,e.jsxs)("div",{className:"max-h-72 overflow-y-auto rounded-md border border-line p-1",children:[(0,e.jsxs)("div",{className:K("flex cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-sm hover:bg-bg-3/40",T===null&&"bg-bg-3/70"),onClick:t(()=>v(null),"onClick"),children:[(0,e.jsx)(Ms,{color:null}),(0,e.jsx)("span",{className:"min-w-0 flex-1 truncate",children:"Unfiled"}),a==null?(0,e.jsx)("span",{className:"text-xs text-ink-3",children:"current"}):null,T===null?(0,e.jsx)(Hs,{className:"h-3.5 w-3.5"}):null]}),g.roots.map(M=>C(M,0)),(0,e.jsx)("div",{className:"mt-1 border-t border-line pt-1",children:y===null?(0,e.jsx)(Un,{depth:0,value:D,pending:j,onChange:k,onSubmit:Q,onCancel:t(()=>N(void 0),"onCancel")}):(0,e.jsxs)("button",{type:"button",onClick:t(()=>{N(null),k("")},"onClick"),className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm text-ink-3 hover:bg-bg-3/40 hover:text-ink",children:[(0,e.jsx)(Rs,{className:"h-3.5 w-3.5"}),"New top-level folder…"]})})]}),(0,e.jsx)("div",{className:"min-h-5 text-xs text-ink-3",children:O?(0,e.jsxs)("span",{children:["Moving to ",(0,e.jsx)("span",{className:"font-mono text-ink",children:O})]}):(0,e.jsx)("span",{children:"Pick a destination folder."})}),(0,e.jsxs)(xt,{children:[(0,e.jsx)(w,{variant:"ghost",onClick:t(()=>l(!1),"onClick"),disabled:m,children:"Cancel"}),(0,e.jsx)(w,{disabled:m||T===void 0||T===a,onClick:t(()=>T!==void 0&&r(T),"onClick"),children:m?"Moving…":"Move here"})]})]})})}t(Gi,"MoveToFolderDialog");function Aa(s,l){return l(s.folder)?!0:s.children.some(i=>Aa(i,l))}t(Aa,"subtreeMatches");function Un({depth:s,value:l,pending:i,onChange:o,onSubmit:c,onCancel:a}){return(0,e.jsxs)("div",{className:"flex items-center gap-2 py-1",style:{paddingLeft:`${.5+s*.9}rem`},children:[(0,e.jsx)(rn,{className:"h-3.5 w-3.5 shrink-0 text-ink-3"}),(0,e.jsx)(Fe,{value:l,onChange:t(m=>o(m.target.value),"onChange"),placeholder:"Folder name",autoFocus:!0,className:"h-7 flex-1 text-sm",onKeyDown:t(m=>{m.key==="Enter"&&c(),m.key==="Escape"&&a()},"onKeyDown")}),(0,e.jsx)(w,{size:"sm",variant:"ghost",onClick:a,disabled:i,children:"Cancel"}),(0,e.jsx)(w,{size:"sm",onClick:c,disabled:i||!l.trim(),children:"Add"})]})}t(Un,"InlineNewFolder");var Vn=16,Hn=24,Qn="min-h-9";function Wn(s){return(0,e.jsx)("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",...s,children:(0,e.jsx)("path",{d:"M12 4 21 19H3z"})})}t(Wn,"VercelMark");function Ta(s){const l=s.replace(/\r\n/g,`
|
|
1
|
+
var pl=Object.defineProperty;var t=(s,l)=>pl(s,"name",{value:l,configurable:!0});import{i as aa}from"./rolldown-runtime-ZpX3ckPj.js";import{Ir as fl,O as gl,l as K,na as kl,t as As,ta as jl}from"./createLucideIcon-DJi9suAC.js";import{a as bl,n as vl,r as Xs,t as la,v as yl,y as Nl}from"./star-BZgQbzhV.js";import{X as ia,_ as he,n as Zt,t as F,v as Ne}from"./queryKeys-DYV5MhM_.js";import{n as wl}from"./CompanyContext-CSrVsSze.js";import{at as Sl,dt as Tn,o as Cl,t as Pe,tt as ra}from"./router-2UfGeejU.js";import{t as oa}from"./checkbox-BHQhs41k.js";import{c as ca,i as Ce,o as At,p as Cs,r as Is,s as qs,t as Fs}from"./dropdown-menu-DEO3mF_E.js";import{i as Il,r as Fl,t as Ll}from"./tabs-B2Os_leL.js";import{c as ne,l as da,t as _l}from"./MarkdownEditor-DXD-Cu3u.js";import{t as qt}from"./arrow-left-Ce_LIut0.js";import{t as Ie}from"./boxes-fV98p9-r.js";import{t as Hs}from"./check-Ctsrlfa-.js";import{t as Ls}from"./chevron-down-BCvxsWfI.js";import{t as En}from"./chevron-left-DP4zwC0G.js";import{t as Ps}from"./chevron-right-s7L6hXXq.js";import{t as ma}from"./circle-alert-C-L4OsHh.js";import{t as Dl}from"./circle-question-mark-B1jR2is9.js";import{t as Ot}from"./MarkdownBody-BTjuUgFa.js";import{t as Pl}from"./code-xml-BWc3OvMt.js";import{t as ua}from"./copy-_wvZOjTe.js";import{t as xa}from"./ellipsis-BTiLRUn4.js";import{t as us}from"./external-link-nl1b263c.js";import{t as Rl}from"./eye-DRS7RbEp.js";import{t as Ml}from"./file-code-corner-CmZ_RihF.js";import{t as gt}from"./file-text-Cw7ntqRx.js";import{t as Al}from"./flask-conical-CEYKkO5k.js";import{t as Qs}from"./folder-open-8WDYv4mw.js";import{t as Jt}from"./folder-search-D0WkVTZt.js";import{t as kt}from"./link-2-CND-9QZ2.js";import{r as mt,t as w}from"./button-CMwV3L1P.js";import{t as Tl}from"./octagon-x-CBcXy1zJ.js";import{t as Ut}from"./pause-CJSwJvLv.js";import{t as Rs}from"./plus-C6fnr28l.js";import{t as ut}from"./refresh-cw-B_Oki9wZ.js";import{t as Tt}from"./save-CJ1Iqyew.js";import{t as Ws}from"./search-04O7m-IF.js";import{t as El}from"./settings-DuZndeX2.js";import{t as zl}from"./shield-alert-Be9GuMrS.js";import{t as ha}from"./shield-check-B0HVjzM_.js";import{t as pa}from"./trash-D7zTaHTj.js";import{t as Ys}from"./triangle-alert-CBVKiaXB.js";import{t as zn}from"./user-Ccom_Ph0.js";import{t as Bl}from"./users-DyKzwIh4.js";import{t as fa}from"./x-DRDFdlYE.js";import{t as Kl}from"./MootMark-DZAfkwdv.js";import{i as Ze,n as Je,t as es}from"./tooltip-B5WQ3lq5.js";import{t as ie}from"./badge-DuA2EgZC.js";import{t as Bn}from"./AgentAvatar-DgGEobSY.js";import{a as ga}from"./ToastContext-DMdt9oTd.js";import{t as it}from"./agents-DmlgUVso.js";import{t as $l}from"./projects-mixWrT5q.js";import{a as xs,i as xt,n as ss,r as hs,s as ts,t as ns}from"./dialog-CKUblzlR.js";import{t as Fe}from"./input-DobnTAyB.js";import{t as en}from"./github-icon-Bbgf67tg.js";import{n as ql}from"./BreadcrumbContext-BVZDZoC0.js";import"./AgentIdentity-I_kB4rMX.js";import{t as Vt}from"./textarea-BRPEfJ-g.js";import{t as Ol}from"./InlineBanner-VQ5mstsR.js";import{t as ka}from"./AgentMultiSelect-DsJfZtR2.js";import{t as Ul}from"./use-adapter-capabilities-Bu8XkVZ9.js";import{t as Vl}from"./use-copy-action-D5dEzo6L.js";import{Ar as Hl,Ea as ja,Na as Ql,Pa as Wl,Ra as Ht,T as Oe,Ua as Qt,_ as Ue,kr as Gl,wa as ba}from"./index-3AxqhPET.js";import{a as rt,c as Xl,i as Yl,l as va,n as Zl,o as Et,r as zt,t as sn,u as ya}from"./SkillCardIcon-BTCafp8l.js";import{t as Jl}from"./CopyText-Cr673_Kx.js";import{t as ei}from"./line-diff-DAcZgvm2.js";import{t as si}from"./SkillBinaryFile-DNe-MmCv.js";import{_ as ti,a as ni,b as Ye,c as ai,d as li,g as tn,h as nn,i as ii,l as ri,m as jt,n as oi,p as an,r as ci,s as Ms,t as di,u as mi,v as Na,x as De,y as ui}from"./FolderControls-L2RzbfdQ.js";import{a as ln,i as Kn,n as xi,o as hi,r as Us,t as pi}from"./company-skill-routes-D5LJ1l8M.js";var wa={name:"file-exclamation-point",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["file-warning"]};wa.node;var Sa=As(wa),Ca={name:"folder-input",size:24,node:[["path",{d:"M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1",key:"fm4g5t"}],["path",{d:"M2 13h10",key:"pgb2dq"}],["path",{d:"m9 16 3-3-3-3",key:"6m91ic"}]]};Ca.node;var Ia=As(Ca),Fa={name:"folder-plus",size:24,node:[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]};Fa.node;var rn=As(Fa),La={name:"git-fork",size:24,node:[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]]};La.node;var _s=As(La),_a={name:"move-right",size:24,node:[["path",{d:"M18 8L22 12L18 16",key:"1r0oui"}],["path",{d:"M2 12H22",key:"1m8cig"}]]};_a.node;var fi=As(_a),Da={name:"pin",size:24,node:[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]};Da.node;var gi=As(Da),e=aa(jl(),1);function ki({skill:s}){const l=s.metadata?.skillSourceId??s.metadata?.legacySkillSourceId;if(typeof l!="string")return null;const i=s.metadata?.skillSourceState,o=s.metadata?.skillSourceId?i==="removed"?"Removed from source · last installed version retained":i==="not_syncing"?"Not syncing · installed copy retained":i==="update_failed"?"Update failed · last installed version retained":"Synced from GitHub":"Refresh this source to sync all files";return(0,e.jsxs)("div",{className:"flex flex-col gap-1 py-3 text-xs text-ink-3",children:[(0,e.jsx)("span",{children:o}),(0,e.jsxs)("span",{className:"break-all font-mono",children:[String(s.metadata?.skillSourcePath??""),s.sourceRef?` · ${s.sourceRef.slice(0,8)}`:""]}),(0,e.jsx)(Pe,{to:`/skills/sources/${l}`,className:"text-ink underline",children:"Manage source"})]})}t(ki,"SkillSourceProvenance");var d=aa(kl(),1);var ji=["skill_authentication_required","skill_company_boundary_denied","skill_workspace_boundary_denied","skill_source_validation_failed","skill_unsafe_content_blocked","skill_secret_handling_blocked","skill_actor_restricted"];var bi="An organization administrator can change the skill policy to allow this.",vi="This requires organization administration access. Ask an administrator to make this change.",yi={skill_authentication_required:"Sign in to manage skills.",skill_company_boundary_denied:"This skill belongs to another organization.",skill_workspace_boundary_denied:"This skill source is outside an allowed workspace.",skill_source_validation_failed:"This skill source failed validation.",skill_unsafe_content_blocked:"This skill contains unsafe content.",skill_secret_handling_blocked:"This skill exposes a secret value.",skill_actor_restricted:"This action isn't available for the current actor."},Ni={skill_authentication_required:"Sign in and try again.",skill_company_boundary_denied:"Open the skill from the organization that owns it.",skill_workspace_boundary_denied:"Import from a configured Wardmote workspace or the organization managed-skill directory.",skill_source_validation_failed:"Fix the flagged source and retry.",skill_unsafe_content_blocked:"Remove the fetch-and-execute or unsafe pattern before saving.",skill_secret_handling_blocked:"Remove the secret value before saving.",skill_actor_restricted:"Retry from an account with access to this action."};function wi(s){return s&&typeof s=="object"?s:null}t(wi,"asRecord");function Bt(s){return typeof s=="string"&&s.trim().length>0?s:null}t(Bt,"asString");function Si(s,l){if(!(s instanceof Zt))return null;const i=wi(s.body),o=Bt(i?.code),c=Bt(i?.reason),a=Bt(i?.remediation);return o==="skill_policy_denied"||c==="explicit_rule"||c==="policy_default"?{state:"policy",code:o,reason:c,title:l?`${l} is restricted by your organization policy.`:"This action is restricted by your organization policy.",remediation:a??bi}:o==="skill_policy_admin_required"?{state:"platform_admin",code:o,reason:c,title:"This change needs administration access.",remediation:a??vi}:o!==null&&ji.includes(o)||c==="platform_invariant"?{state:"platform",code:o,reason:c,title:(o&&yi[o])??"This action is blocked by a platform safety rule.",remediation:a??(o&&Ni[o])??"Fix the flagged issue and try again."}:null}t(Si,"classifySkillDenial");function Ci(){const[s,l]=(0,d.useState)(null);return{denial:s,capture:(0,d.useCallback)((i,o)=>{const c=Si(i,o);return c?(l(c),!0):!1},[]),reset:(0,d.useCallback)(()=>l(null),[])}}t(Ci,"useSkillPolicyDenial");function Ii({denial:s,onDismiss:l,className:i}){const o=l?(0,e.jsx)(w,{variant:"ghost",size:"sm",onClick:l,children:"Dismiss"}):void 0;return(0,e.jsx)(Ol,{tone:"warning",icon:s.state==="policy"?ha:Ys,title:s.title,actions:o,className:i,children:(0,e.jsx)("p",{children:s.remediation})})}t(Ii,"SkillPolicyDenialNotice");var ht=["./skills",".agents/skills",".claude/skills",".codex/skills",".cursor/skills"],Pa=34;function Ds(s,l){return`${s} ${l}`}t(Ds,"selectionKey");function Fi(s){return s.sourceType==="remote_managed"?!1:typeof s.cwd=="string"&&s.cwd.trim().length>0}t(Fi,"isScannableWorkspace");function Ra(s){return s.workspaces.filter(Fi)}t(Ra,"scannableWorkspaces");function Li(s){switch(s){case"git_repo":return"git";case"local_path":return"local";case"non_git_path":return"folder";case"remote_managed":return"remote";default:return s}}t(Li,"workspaceKindLabel");function _i(s){return Array.from(new Set(s.map(l=>Li(l.sourceType)))).join(", ")}t(_i,"summarizeWorkspaceKinds");function dt(s){return s.status==="new"||s.status==="conflict"}t(dt,"isSelectableCandidate");function Di(s,l){const i=l.trim().toLowerCase();return i?s.filter(o=>[o.name,o.slug,o.description,o.relativePath,o.workspaceName,o.directoryRoot,o.status].some(c=>c?.toLowerCase().includes(i))):s}t(Di,"filterCandidates");function Pi(s,l=[]){const i=new Map(l.map(c=>[c.id,c])),o=new Map;for(const c of s){let a=o.get(c.workspaceId);a||(a={key:c.workspaceId,workspaceId:c.workspaceId,workspaceName:c.workspaceName,isPrimary:i.get(c.workspaceId)?.isPrimary??!1,directories:[]},o.set(c.workspaceId,a));let m=a.directories.find(r=>r.directoryRoot===c.directoryRoot);m||(m={key:`${c.workspaceId} ${c.directoryRoot}`,directoryRoot:c.directoryRoot,candidates:[]},a.directories.push(m)),m.candidates.push(c)}return Array.from(o.values()).map(c=>({...c,directories:c.directories.sort((a,m)=>a.directoryRoot.localeCompare(m.directoryRoot))})).sort((c,a)=>c.isPrimary!==a.isPrimary?c.isPrimary?-1:1:c.workspaceName.localeCompare(a.workspaceName))}t(Pi,"groupCandidates");function Ri(s){return new Map}t(Ri,"defaultSelection");function Mi(s){const l=new Map;for(const i of s)i.status==="new"&&l.set(Ds(i.workspaceId,i.relativePath),{workspaceId:i.workspaceId,path:i.relativePath});return l}t(Mi,"selectAllSelection");function $n(s){return`${s.slug}-copy`}t($n,"suggestedConflictSlug");function Wt(s){if(s.slug===void 0)return!0;const l=s.slug.trim();return!!l&&fl(l)===l}t(Wt,"isValidSelectionSlug");function Gs(s){return s instanceof Zt?s.message||`Request failed: ${s.status}`:s instanceof Error?s.message:"Unexpected error"}t(Gs,"readableErrorMessage");function Ai(s){return s instanceof Zt?s.status===403:!1}t(Ai,"isGrantError");function Ti({status:s}){switch(s){case"already_imported":return(0,e.jsxs)(ie,{variant:"outline",className:"gap-1 px-1.5 py-0 font-normal text-ink-3 border-line/60",children:[(0,e.jsx)(kt,{className:"h-3 w-3"})," Imported"]});case"conflict":return(0,e.jsxs)(ie,{variant:"outline",className:"gap-1 px-1.5 py-0 font-normal text-amber-600 border-amber-500/40 dark:text-amber-400",children:[(0,e.jsx)(Ys,{className:"h-3 w-3"})," Conflict"]});case"skipped":return(0,e.jsxs)(ie,{variant:"outline",className:"gap-1 px-1.5 py-0 font-normal text-ink-3 border-line/60",children:[(0,e.jsx)(Sa,{className:"h-3 w-3"})," Skipped"]});default:return(0,e.jsxs)(ie,{variant:"outline",className:"gap-1 px-1.5 py-0 font-normal text-emerald-600 border-emerald-500/40 dark:text-emerald-400",children:[(0,e.jsx)(bl,{className:"h-3 w-3"})," New"]})}}t(Ti,"CandidateStatusBadge");function Ei({open:s,onOpenChange:l,companyId:i,onImportFromPath:o}){const c=ia(),a=ga(),[m,r]=(0,d.useState)("pick"),[x,g]=(0,d.useState)(""),[b,_]=(0,d.useState)(""),[f,v]=(0,d.useState)(null),[y,N]=(0,d.useState)(null),[D,k]=(0,d.useState)(null),[j,h]=(0,d.useState)(new Map),[P,A]=(0,d.useState)(null),[T,X]=(0,d.useState)(!1),[O,Q]=(0,d.useState)(null),C=(0,d.useRef)(0),M=Ne({queryKey:F.projects.list(i),queryFn:t(()=>$l.list(i),"queryFn"),enabled:s});(0,d.useEffect)(()=>{s&&(r("pick"),g(""),_(""),v(null),N(null),k(null),h(new Map),A(null),X(!1),Q(null),C.current+=1)},[s]);const ee=M.data??[],Y=(0,d.useMemo)(()=>{const L=x.trim().toLowerCase(),H=[...ee].sort((W,le)=>W.name.localeCompare(le.name));return L?H.filter(W=>W.name.toLowerCase().includes(L)):H},[ee,x]);function pe(L){v(L),N(null),k(null),h(new Map),r("scanning");const H=++C.current;ne.scanProjects(i,{projectIds:[L.id],mode:"preview"}).then(W=>{H===C.current&&(N(W),h(Ri(W.candidates)),r("select"))}).catch(W=>{H===C.current&&(k(W),r("select"))})}t(pe,"startScan");const ae=he({mutationFn:t(()=>{if(!f)throw new Error("No project selected.");const L=Array.from(j.values());return ne.scanProjects(i,{projectIds:[f.id],mode:"import",selection:L})},"mutationFn"),onSuccess:t(async L=>{A(L),r("result"),await c.invalidateQueries({queryKey:F.companySkills.list(i)});const H=L.imported.length;a.pushToast({tone:H>0?"success":"warn",title:H>0?"Skills imported":"Nothing imported",body:H>0?`${H} skill${H===1?"":"s"} imported as references from ${f?.name??"the project"}.`:"No skills were imported."})},"onSuccess"),onError:t(L=>{a.pushToast({tone:"error",title:"Import failed",body:Gs(L)})},"onError")}),Z=y?.candidates??[],Le=(0,d.useMemo)(()=>Z.filter(dt),[Z]),xe=(0,d.useMemo)(()=>Di(Z,b),[b,Z]),de=(0,d.useMemo)(()=>Pi(xe,f?.workspaces??[]),[xe,f]),S=j.size,U=Array.from(j.values()).some(L=>!Wt(L));function se(L){dt(L)&&h(H=>{const W=new Map(H),le=Ds(L.workspaceId,L.relativePath);return W.has(le)?W.delete(le):W.set(le,{workspaceId:L.workspaceId,path:L.relativePath,...L.status==="conflict"?{slug:$n(L)}:{}}),W})}t(se,"toggleCandidate");function Re(L,H){h(W=>{const le=new Map(W),te=Ds(L.workspaceId,L.relativePath),re=le.get(te);return re?(le.set(te,{...re,slug:H}),le):W})}t(Re,"renameCandidate");async function Me(L,H){if(!f)return;const W=H.toLowerCase().endsWith("/skill.md")?H.slice(0,-9)||".":H.toLowerCase()==="skill.md"?".":H,le=Ds(L,W);Q(le);try{const te=await ne.scanProjects(i,{projectIds:[f.id],mode:"preview",selection:[{workspaceId:L,path:W}]});N(te);const re=te.candidates.find(G=>G.workspaceId===L&&G.relativePath===W);re&&dt(re)?(h(G=>{const ge=new Map(G);return ge.set(le,{workspaceId:L,path:W,...re.status==="conflict"?{slug:$n(re)}:{}}),ge}),X(!1)):a.pushToast({tone:"warn",title:re?.status==="already_imported"?"Skill already imported":"Skill could not be added",body:re?.reason??"The selected folder does not contain a valid SKILL.md file."})}catch(te){a.pushToast({tone:"error",title:"Could not inspect skill",body:Gs(te)})}finally{Q(null)}}t(Me,"addBrowsedSkill");function ps(){h(Mi(Z))}t(ps,"selectAll");function as(){h(new Map)}t(as,"deselectAll");function we(){ae.isPending||l(!1)}t(we,"handleClose");function Ae(){C.current+=1,v(null),N(null),k(null),_(""),h(new Map),r("pick")}return t(Ae,"backToPick"),(0,e.jsx)(ns,{open:s,onOpenChange:t(L=>{L?l(!0):we()},"onOpenChange"),children:(0,e.jsxs)(ss,{showCloseButton:!1,className:"flex max-h-(--sz-85vh) flex-col gap-0 overflow-hidden p-0 sm:max-w-3xl","data-testid":"import-skills-from-project-dialog",children:[(0,e.jsxs)("header",{className:"flex shrink-0 items-start justify-between gap-3 border-b border-line/60 px-5 py-4",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,e.jsx)(ts,{className:"text-base font-semibold",children:"Import skills from project"}),(0,e.jsx)(hs,{className:"text-xs text-ink-3",children:"Pick a project, scan its workspaces for skills, and import them as references."})]}),(0,e.jsx)("button",{type:"button",className:"rounded-sm text-ink-3 opacity-70 transition-opacity hover:opacity-100",onClick:we,"aria-label":"Close import dialog",children:(0,e.jsx)(fa,{className:"h-4 w-4"})})]}),(0,e.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden","aria-live":"polite",children:[m==="pick"&&(0,e.jsx)(zi,{loading:M.isLoading,error:M.error,projects:Y,totalProjects:ee.length,filter:x,onFilterChange:g,onPick:pe}),m==="scanning"&&(0,e.jsx)(Bi,{projectName:f?.name??""}),m==="select"&&(0,e.jsx)($i,{scanError:D,onRetry:t(()=>f&&pe(f),"onRetry"),onImportFromPath:o,groups:de,totalCandidates:Z.length,filter:b,onFilterChange:_,selection:j,toggleCandidate:se,renameCandidate:Re,project:f,companyId:i,browseOpen:T,onBrowseOpenChange:X,onAddBrowsedSkill:Me,browseAddingKey:O}),m==="result"&&P&&(0,e.jsx)(qi,{result:P})]}),(0,e.jsxs)("footer",{className:"flex shrink-0 flex-col gap-2 border-t border-line/60 bg-bg-3/20 px-5 py-3 sm:flex-row sm:items-center sm:justify-between sm:gap-3",children:[m==="select"&&!D&&Z.length>0?(0,e.jsx)("div",{className:"min-w-0 flex-1 text-xs text-ink-3",children:(0,e.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,e.jsx)(kt,{className:"h-3.5 w-3.5 shrink-0"}),"Files stay in the project — Studio edits save directly to them."]})}):(0,e.jsx)("div",{className:"hidden min-w-0 flex-1 sm:block"}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center justify-end gap-2 sm:shrink-0",children:[m==="select"&&(0,e.jsxs)(e.Fragment,{children:[!D&&Z.length>0&&(0,e.jsxs)("div",{className:"mr-1 flex items-center gap-1",children:[(0,e.jsx)(w,{variant:"ghost",size:"sm",onClick:ps,disabled:Le.length===0,"data-testid":"select-all",children:"Select all"}),(0,e.jsx)(w,{variant:"ghost",size:"sm",onClick:as,disabled:S===0,"data-testid":"deselect-all",children:"Deselect all"})]}),(0,e.jsxs)(w,{variant:"secondary",size:"sm",onClick:Ae,children:[(0,e.jsx)(qt,{className:"mr-1 h-3.5 w-3.5"})," Back"]}),!D&&Z.length>0&&(0,e.jsx)(w,{size:"sm",onClick:t(()=>ae.mutate(),"onClick"),disabled:S===0||U||ae.isPending,"data-testid":"import-skills",children:ae.isPending?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(mt,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"})," Importing…"]}):`Import ${S} skill${S===1?"":"s"}`})]}),m==="pick"&&(0,e.jsx)(w,{variant:"ghost",size:"sm",onClick:we,children:"Cancel"}),m==="result"&&(0,e.jsx)(w,{size:"sm",onClick:we,children:"Done"})]})]})]})})}t(Ei,"ImportSkillsFromProjectDialog");function zi({loading:s,error:l,projects:i,totalProjects:o,filter:c,onFilterChange:a,onPick:m}){return(0,e.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,e.jsx)("div",{className:"border-b border-line/60 px-5 py-3",children:(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsx)(Ws,{className:"pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-ink-3"}),(0,e.jsx)(Fe,{value:c,onChange:t(r=>a(r.target.value),"onChange"),placeholder:"Filter projects",className:"pl-7 text-xs","aria-label":"Filter projects","data-testid":"project-filter"})]})}),(0,e.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto",children:s?(0,e.jsx)("div",{className:"p-6 text-center text-sm text-ink-3",children:"Loading projects…"}):l?(0,e.jsxs)("div",{className:"m-5 flex items-start gap-3 rounded-md border border-bad/40 bg-bad/10 p-4 text-sm text-bad",role:"alert",children:[(0,e.jsx)(ma,{className:"mt-0.5 h-4 w-4 shrink-0"}),(0,e.jsx)("div",{children:Gs(l)})]}):o===0?(0,e.jsx)(Oe,{icon:ra,message:"This organization has no projects yet."}):i.length===0?(0,e.jsx)(Oe,{icon:Ws,message:`No projects match "${c}".`}):(0,e.jsx)("ul",{className:"divide-y divide-line/60","data-testid":"project-list",children:i.map(r=>{const x=Ra(r),g=x.length===0,b=_i(r.workspaces);return(0,e.jsx)("li",{children:(0,e.jsxs)("button",{type:"button",className:K("flex w-full items-center gap-3 px-5 py-3 text-left transition-colors",g?"cursor-not-allowed opacity-60":"cursor-pointer hover:bg-bg-3/40"),onClick:t(()=>!g&&m(r),"onClick"),disabled:g,"aria-disabled":g,"data-testid":`project-row-${r.id}`,"data-disabled":g?"true":"false",children:[(0,e.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,e.jsx)("div",{className:"truncate text-sm font-medium",children:r.name}),(0,e.jsxs)("div",{className:"mt-0.5 text-xs text-ink-3",children:[r.workspaces.length," workspace",r.workspaces.length===1?"":"s",b?` · ${b}`:""]}),g&&(0,e.jsx)("div",{className:"mt-1 text-(length:--text-micro) text-ink-3",children:"Remote-only project — no locally scannable workspaces to import from."})]}),!g&&(0,e.jsxs)(ie,{variant:"outline",className:"shrink-0 px-1.5 py-0 font-normal",children:[x.length," scannable"]})]})},r.id)})})})]})}t(zi,"PickProjectStep");function Bi({projectName:s}){return(0,e.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center gap-4 p-8 text-center","data-testid":"scanning-step",children:[(0,e.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,e.jsx)(Jt,{className:"h-10 w-10 text-ink-3/60"}),(0,e.jsx)(mt,{className:"h-5 w-5 animate-spin text-ink-3"})]}),(0,e.jsxs)("div",{children:[(0,e.jsxs)("p",{className:"text-sm font-medium",children:["Scanning ",s||"project"," for skills…"]}),(0,e.jsx)("p",{className:"mt-1 text-xs text-ink-3",children:"Looking in well-known skill folders across each workspace."})]}),(0,e.jsxs)("div",{className:"flex max-w-md flex-wrap justify-center gap-1.5",children:[ht.map(l=>(0,e.jsx)(ie,{variant:"outline",className:"px-1.5 py-0 font-mono text-(length:--text-micro) font-normal text-ink-3",children:l},l)),(0,e.jsxs)(ie,{variant:"outline",className:"px-1.5 py-0 text-(length:--text-micro) font-normal text-ink-3",children:["+",Pa-ht.length," more"]})]})]})}t(Bi,"ScanningStep");function Ki({companyId:s,project:l,onBack:i,onAddSkill:o,addingKey:c}){const a=Ra(l),m=a.find(y=>y.isPrimary)??a[0]??null,[r,x]=(0,d.useState)(m?.id??""),[g,b]=(0,d.useState)("."),_=Ne({queryKey:["company-skills","browse-project",s,l.id,r,g],queryFn:t(()=>ne.browseProject(s,{projectId:l.id,workspaceId:r,path:g}),"queryFn"),enabled:!!r}),f=_.data;function v(y){x(y),b(".")}return t(v,"changeWorkspace"),(0,e.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col","data-testid":"project-skill-browser",children:[(0,e.jsxs)("div",{className:"shrink-0 border-b border-line/60 px-5 py-3",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"text-sm font-medium",children:"Browse project folders"}),(0,e.jsx)("p",{className:"mt-0.5 text-xs text-ink-3",children:"Open any folder and add directories or individual SKILL.md files."})]}),(0,e.jsxs)(w,{variant:"secondary",size:"sm",onClick:i,children:[(0,e.jsx)(qt,{className:"mr-1 h-3.5 w-3.5"})," Discovered skills"]})]}),a.length>1&&(0,e.jsx)("div",{className:"mt-3 flex flex-wrap gap-1.5","aria-label":"Project workspace",children:a.map(y=>(0,e.jsx)(w,{type:"button",variant:y.id===r?"secondary":"ghost",size:"sm",onClick:t(()=>v(y.id),"onClick"),children:y.name},y.id))})]}),(0,e.jsxs)("div",{className:"flex shrink-0 items-center gap-2 border-b border-line/60 bg-bg-3/20 px-5 py-2",children:[(0,e.jsx)(w,{variant:"ghost",size:"sm",onClick:t(()=>f?.parentPath&&b(f.parentPath),"onClick"),disabled:!f?.parentPath,"aria-label":"Open parent folder",children:(0,e.jsx)(qt,{className:"h-3.5 w-3.5"})}),(0,e.jsx)("span",{className:"min-w-0 truncate font-mono text-xs text-ink-3",children:f?.path??g})]}),(0,e.jsxs)("div",{className:"min-h-0 flex-1 overflow-y-auto",children:[_.isLoading?(0,e.jsxs)("div",{className:"flex items-center justify-center gap-2 p-8 text-sm text-ink-3",children:[(0,e.jsx)(mt,{className:"h-4 w-4 animate-spin"})," Loading folder…"]}):_.error?(0,e.jsx)("div",{className:"p-6 text-sm text-bad",children:Gs(_.error)}):f?.entries.length?(0,e.jsx)("ul",{className:"divide-y divide-line/60",children:f.entries.map(y=>{const N=y.kind==="file"?y.path.toLowerCase()==="skill.md"?".":y.path.slice(0,-9):y.path,D=Ds(r,N);return(0,e.jsxs)("li",{className:"flex items-center gap-3 px-5 py-2.5",children:[y.kind==="directory"?(0,e.jsx)(Xs,{className:"h-4 w-4 shrink-0 text-ink-3"}):(0,e.jsx)(gt,{className:"h-4 w-4 shrink-0 text-ink-3"}),(0,e.jsx)("button",{type:"button",className:K("min-w-0 flex-1 truncate text-left text-sm",y.kind==="directory"&&"font-medium hover:underline"),onClick:t(()=>y.kind==="directory"&&b(y.path),"onClick"),disabled:y.kind==="file",children:y.name}),y.isSkill?(0,e.jsx)(w,{size:"sm",onClick:t(()=>o(r,y.path),"onClick"),disabled:c===D,children:c===D?(0,e.jsx)(mt,{className:"h-3.5 w-3.5 animate-spin"}):"Add skill"}):y.kind==="directory"?(0,e.jsx)(Ps,{className:"h-4 w-4 text-ink-3"}):null]},y.path)})}):(0,e.jsx)("div",{className:"p-8 text-center text-sm text-ink-3",children:"This folder is empty."}),f?.truncated&&(0,e.jsx)("p",{className:"border-t border-line/60 px-5 py-2 text-xs text-ink-3",children:"Showing the first 250 entries."})]})]})}t(Ki,"ProjectSkillBrowser");function $i({scanError:s,onRetry:l,onImportFromPath:i,groups:o,totalCandidates:c,filter:a,onFilterChange:m,selection:r,toggleCandidate:x,renameCandidate:g,project:b,companyId:_,browseOpen:f,onBrowseOpenChange:v,onAddBrowsedSkill:y,browseAddingKey:N}){if(s){const D=Ai(s);return(0,e.jsx)("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6","data-testid":"scan-error",children:(0,e.jsxs)("div",{className:"max-w-md text-center",children:[(0,e.jsx)("div",{className:"mx-auto mb-4 w-fit bg-bg-3/50 p-4",children:D?(0,e.jsx)(zl,{className:"h-10 w-10 text-ink-3/60"}):(0,e.jsx)(ma,{className:"h-10 w-10 text-ink-3/60"})}),(0,e.jsx)("p",{className:"text-base font-semibold",children:D?"You can't import skills here":"Scan failed"}),(0,e.jsx)("p",{className:"mt-1.5 text-sm text-ink-3",children:D?"Your account doesn't have permission to add skills to this organization. Ask an owner to grant the skills permission, then try again.":Gs(s)}),!D&&(0,e.jsx)(w,{variant:"secondary",size:"sm",className:"mt-4",onClick:l,children:"Try again"})]})})}return f&&b?(0,e.jsx)(Ki,{companyId:_,project:b,onBack:t(()=>v(!1),"onBack"),onAddSkill:y,addingKey:N}):c===0?(0,e.jsx)("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6","data-testid":"select-empty",children:(0,e.jsxs)("div",{className:"max-w-md text-center",children:[(0,e.jsx)("div",{className:"mx-auto mb-4 w-fit bg-bg-3/50 p-4",children:(0,e.jsx)(Jt,{className:"h-10 w-10 text-ink-3/50"})}),(0,e.jsx)("p",{className:"text-base font-semibold",children:"No skills found"}),(0,e.jsxs)("p",{className:"mt-1.5 text-sm text-ink-3",children:["None of the well-known skill folders in this project's workspaces contain a"," ",(0,e.jsx)("code",{className:"rounded bg-bg-3 px-1 py-0.5 text-xs",children:"SKILL.md"}),". We searched"," ",ht.join(", ")," and ",Pa-ht.length," ","other agent-harness folders."]}),(0,e.jsxs)(w,{variant:"secondary",size:"sm",className:"mt-4",onClick:t(()=>v(!0),"onClick"),"data-testid":"browse-project-folders-empty",children:[(0,e.jsx)(Qs,{className:"mr-1.5 h-3.5 w-3.5"})," Browse project folders"]}),i&&(0,e.jsxs)("p",{className:"mt-3 text-sm text-ink-3",children:["For skills in non-standard folders, use"," ",(0,e.jsx)("button",{type:"button",className:"font-medium text-ink underline underline-offset-2",onClick:i,children:"Import from path or URL"}),"."]})]})}):(0,e.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col","data-testid":"candidate-list",children:[(0,e.jsxs)("div",{className:"flex shrink-0 items-center justify-between gap-3 border-b border-line/60 px-5 py-2.5",children:[(0,e.jsx)("p",{className:"text-xs text-ink-3",children:"Choose discovered skills, or browse any workspace folder."}),(0,e.jsxs)(w,{variant:"secondary",size:"sm",onClick:t(()=>v(!0),"onClick"),"data-testid":"browse-project-folders",children:[(0,e.jsx)(Qs,{className:"mr-1.5 h-3.5 w-3.5"})," Browse folders"]})]}),(0,e.jsx)("div",{className:"shrink-0 border-b border-line/60 px-5 py-2.5",children:(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsx)(Ws,{className:"absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-ink-3"}),(0,e.jsx)(Fe,{value:a,onChange:t(D=>m(D.target.value),"onChange"),placeholder:"Search discovered skills…",className:"h-8 pl-8 text-xs","aria-label":"Search discovered skills"})]})}),(0,e.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto",children:o.length===0?(0,e.jsxs)("div",{className:"flex h-full items-center justify-center p-6 text-sm text-ink-3",children:["No skills match “",a.trim(),"”."]}):o.map((D,k)=>(0,e.jsxs)("section",{children:[k>0&&!D.isPrimary&&o[k-1]?.isPrimary&&(0,e.jsx)("header",{className:"border-y border-line/60 bg-bg-3/30 px-5 py-2 text-xs uppercase tracking-wide text-ink-3",children:"Other Workspaces"}),(0,e.jsx)("header",{className:"sticky top-0 z-10 border-b border-line/60 bg-bg px-5 py-2 text-sm font-medium text-ink",children:D.workspaceName}),D.directories.map(j=>(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"bg-bg-3/30 px-5 py-1.5 font-mono text-(length:--text-micro) text-ink-3",children:j.directoryRoot}),(0,e.jsx)("ul",{className:"divide-y divide-line/60",children:j.candidates.map(h=>{const P=dt(h),A=Ds(h.workspaceId,h.relativePath),T=r.has(A),X=r.get(A);return(0,e.jsxs)("li",{className:K("flex items-start gap-3 px-5 py-2.5 transition-colors",P?"cursor-pointer hover:bg-bg-3/40":"opacity-70",T&&"bg-bg-3/50"),onClick:t(()=>x(h),"onClick"),"data-testid":`candidate-${h.relativePath}`,"data-status":h.status,"data-selected":T?"true":"false",children:[(0,e.jsx)("div",{className:"pt-0.5",onClick:t(O=>O.stopPropagation(),"onClick"),children:(0,e.jsx)(oa,{checked:T,onCheckedChange:t(()=>x(h),"onCheckedChange"),disabled:!P,"aria-label":`Select ${h.name}`})}),(0,e.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,e.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1",children:[(0,e.jsx)("span",{className:"min-w-0 truncate text-sm font-medium",children:h.name}),(0,e.jsx)(Ti,{status:h.status})]}),h.description&&(0,e.jsx)("p",{className:"mt-0.5 line-clamp-2 text-xs text-ink-3",children:h.description}),(0,e.jsx)("p",{className:"mt-0.5 font-mono text-(length:--text-micro) text-ink-3",children:h.relativePath}),h.reason&&(0,e.jsx)("p",{className:K("mt-0.5 text-(length:--text-micro)",h.status==="conflict"?"text-amber-600 dark:text-amber-400":"text-ink-3"),children:h.reason}),h.status==="conflict"&&T&&(0,e.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-2",onClick:t(O=>O.stopPropagation(),"onClick"),children:[(0,e.jsx)("label",{htmlFor:`rename-${h.workspaceId}-${h.slug}`,className:"shrink-0 text-xs text-ink-3",children:"Import as"}),(0,e.jsx)(Fe,{id:`rename-${h.workspaceId}-${h.slug}`,value:X?.slug??"",onChange:t(O=>g(h,O.target.value),"onChange"),className:"h-7 max-w-xs font-mono text-xs","aria-label":`Rename ${h.name}`,"aria-invalid":X?!Wt(X):void 0}),X&&!Wt(X)&&(0,e.jsx)("span",{className:"text-xs text-bad",children:"Use a lowercase URL-safe slug."})]})]})]},`${h.workspaceId} ${h.relativePath}`)})})]},j.key))]},D.key))})]})}t($i,"SelectStep");function qi({result:s}){const l=(0,d.useMemo)(()=>[...s.imported,...s.updated],[s]);return(0,e.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,e.jsxs)("div",{className:"border-b border-line/60 px-5 py-4","data-testid":"result-summary",children:[(0,e.jsxs)("div",{className:"flex items-start gap-3 rounded-md border border-emerald-500/30 bg-emerald-500/5 p-3",children:[(0,e.jsx)(kt,{className:"mt-0.5 h-4 w-4 shrink-0 text-emerald-600 dark:text-emerald-400"}),(0,e.jsxs)("div",{className:"text-xs leading-relaxed text-ink-3",children:[(0,e.jsx)("span",{className:"font-medium text-ink",children:"No files were copied."})," These skills reference the files in the project workspace — editing them in Skill Studio saves directly back to those files."]})]}),(0,e.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-3 text-xs text-ink-3",children:[(0,e.jsxs)("span",{className:"text-emerald-600 dark:text-emerald-400",children:["✓ ",s.imported.length," imported"]}),s.updated.length>0&&(0,e.jsxs)("span",{children:["↻ ",s.updated.length," updated"]}),s.skipped.length>0&&(0,e.jsxs)("span",{children:["⊘ ",s.skipped.length," skipped"]})]})]}),(0,e.jsxs)("div",{className:"min-h-0 flex-1 overflow-y-auto",children:[l.length>0&&(0,e.jsxs)("section",{children:[(0,e.jsxs)("header",{className:"bg-bg-3/30 px-5 py-1.5 text-xs uppercase tracking-wide text-ink-3",children:["Imported · ",l.length]}),(0,e.jsx)("ul",{className:"divide-y divide-line/60","data-testid":"result-imported",children:l.map(i=>(0,e.jsxs)("li",{className:"flex items-center gap-3 px-5 py-2.5 text-sm",children:[(0,e.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,e.jsx)("div",{className:"truncate font-medium",children:i.name}),i.description&&(0,e.jsx)("div",{className:"truncate text-xs text-ink-3",children:i.description})]}),(0,e.jsxs)(Pe,{to:ln(i.id),className:"inline-flex shrink-0 items-center gap-1 text-xs font-medium text-ink no-underline hover:underline",children:["Open ",(0,e.jsx)(us,{className:"h-3 w-3"})]})]},i.id))})]}),s.skipped.length>0&&(0,e.jsxs)("section",{children:[(0,e.jsxs)("header",{className:"bg-bg-3/30 px-5 py-1.5 text-xs uppercase tracking-wide text-ink-3",children:["Skipped · ",s.skipped.length]}),(0,e.jsx)("ul",{className:"divide-y divide-line/60","data-testid":"result-skipped",children:s.skipped.map((i,o)=>(0,e.jsxs)("li",{className:"flex items-start gap-2 px-5 py-2.5 text-xs",children:[(0,e.jsx)(Sa,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-ink-3"}),(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsx)("span",{className:"font-mono text-ink-3",children:i.path??"—"}),i.reason&&(0,e.jsx)("span",{className:"ml-2 text-ink-3",children:i.reason})]})]},`${i.workspaceId??"?"}-${i.path??o}`))})]}),s.warnings.length>0&&(0,e.jsxs)("section",{children:[(0,e.jsxs)("header",{className:"bg-bg-3/30 px-5 py-1.5 text-xs uppercase tracking-wide text-ink-3",children:["Warnings · ",s.warnings.length]}),(0,e.jsx)("ul",{className:"divide-y divide-line/60","data-testid":"result-warnings",children:s.warnings.map((i,o)=>(0,e.jsxs)("li",{className:"flex items-start gap-2 px-5 py-2.5 text-xs",children:[(0,e.jsx)(Ys,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-amber-500"}),(0,e.jsx)("span",{className:"text-ink-3",children:i})]},o))})]})]})]})}t(qi,"ResultStep");var ot=288,Gt=224,Xt=400,qn=16,Ma="wardmote.skills.folderRail.width";function pt(s){return Math.min(Xt,Math.max(Gt,s))}t(pt,"clampFolderRailWidth");function Oi(){if(typeof window>"u")return ot;try{const s=window.localStorage.getItem(Ma);if(!s)return ot;const l=Number.parseInt(s,10);return Number.isFinite(l)?pt(l):ot}catch{return ot}}t(Oi,"readStoredFolderRailWidth");function On(s){if(!(typeof window>"u"))try{window.localStorage.setItem(Ma,String(pt(s)))}catch{}}t(On,"writeStoredFolderRailWidth");function Ui(s){return!s.systemKey&&!jt(s)&&!nn(s)}t(Ui,"folderIsEditable");function Vi(s,l){return an(s,l).map(i=>i.id).filter(i=>i!==l)}t(Vi,"ancestorIds");function Hi({result:s,selection:l,loading:i=!1,tags:o,activeTag:c,onSelect:a,onSelectTag:m,onCreateFolder:r,onRenameFolder:x,onEditFolder:g,onMoveFolder:b,onDeleteFolder:_,onEnsureMyFolder:f}){const v=(0,d.useMemo)(()=>Ye(s),[s]),[y,N]=(0,d.useState)(()=>new Set),[D,k]=(0,d.useState)(null),[j,h]=(0,d.useState)(""),[P,A]=(0,d.useState)(Oi),[T,X]=(0,d.useState)(!1),O=(0,d.useRef)(P),Q=(0,d.useRef)(null);(0,d.useEffect)(()=>{if(l==="all"||l==="unfiled")return;const S=Vi(v,l);S.length!==0&&N(U=>{const se=new Set(U);let Re=!1;for(const Me of S)se.has(Me)||(se.add(Me),Re=!0);return Re?se:U})},[v,l]);function C(S){N(U=>{const se=new Set(U);return se.has(S)?se.delete(S):se.add(S),se})}t(C,"toggle");function M(S){k(S.id),h(S.name)}t(M,"startRename");function ee(S){const U=j.trim();U&&U!==S.name&&x(S,U),k(null)}t(ee,"commitRename");const Y=s?.allCount??0,pe=s?.unfiledCount??0,ae=(0,d.useCallback)(S=>{const U=pt(S);O.current=U,A(U),On(U)},[]),Z=(0,d.useCallback)(S=>{S.preventDefault(),S.currentTarget.setPointerCapture(S.pointerId),Q.current={startX:S.clientX,startWidth:O.current},X(!0)},[]),Le=(0,d.useCallback)(S=>{if(!Q.current)return;const U=pt(Q.current.startWidth+S.clientX-Q.current.startX);O.current=U,A(U)},[]),xe=(0,d.useCallback)(()=>{Q.current&&(Q.current=null,X(!1),On(O.current))},[]),de=(0,d.useCallback)(S=>{S.key==="ArrowLeft"?(S.preventDefault(),ae(P-qn)):S.key==="ArrowRight"?(S.preventDefault(),ae(P+qn)):S.key==="Home"?(S.preventDefault(),ae(Gt)):S.key==="End"&&(S.preventDefault(),ae(Xt))},[ae,P]);return(0,e.jsxs)("div",{className:"relative hidden h-full shrink-0 md:flex",style:{width:`${P}px`},children:[(0,e.jsxs)("nav",{"aria-label":"Skill folders",className:"flex min-w-0 flex-1 flex-col overflow-y-auto border-r border-line pr-3",children:[(0,e.jsxs)("div",{className:"mb-2 flex items-center justify-between gap-2 pt-0.5",children:[(0,e.jsx)("div",{className:"text-(length:--text-micro) font-medium uppercase tracking-wide text-ink-3",children:"Folders"}),(0,e.jsx)(w,{variant:"ghost",size:"icon-sm",title:"New folder",onClick:t(()=>r(null),"onClick"),children:(0,e.jsx)(Rs,{className:"h-3.5 w-3.5"})})]}),i?(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)("div",{className:"h-7 rounded-md bg-bg-3/60"}),(0,e.jsx)("div",{className:"h-7 rounded-md bg-bg-3/40"}),(0,e.jsx)("div",{className:"h-7 rounded-md bg-bg-3/30"})]}):(0,e.jsxs)("div",{className:"space-y-0.5",children:[(0,e.jsx)(ct,{active:l==="all",label:"All skills",count:Y,icon:(0,e.jsx)(ra,{className:"h-3.5 w-3.5"}),onSelect:t(()=>a("all"),"onSelect")}),v.my?(0,e.jsx)(Os,{node:v.my,depth:0,selection:l,expanded:y,renamingId:D,renameDraft:j,rootLabel:"My Skills",rootIcon:(0,e.jsx)(zn,{className:"h-3.5 w-3.5"}),onToggle:C,onSelect:a,onCreateFolder:r,onEditFolder:g,onMoveFolder:b,onDeleteFolder:_,onStartRename:M,onRenameDraftChange:h,onRenameCommit:ee,onRenameCancel:t(()=>k(null),"onRenameCancel")}):f?(0,e.jsx)(ct,{active:!1,label:"My Skills",count:0,icon:(0,e.jsx)(zn,{className:"h-3.5 w-3.5"}),muted:!0,onSelect:f}):null,(0,e.jsx)(Qi,{label:"Organization",onCreate:t(()=>r(null),"onCreate")}),v.company.length>0?v.company.map(S=>(0,e.jsx)(Os,{node:S,depth:0,selection:l,expanded:y,renamingId:D,renameDraft:j,onToggle:C,onSelect:a,onCreateFolder:r,onEditFolder:g,onMoveFolder:b,onDeleteFolder:_,onStartRename:M,onRenameDraftChange:h,onRenameCommit:ee,onRenameCancel:t(()=>k(null),"onRenameCancel")},S.folder.id)):(0,e.jsx)("div",{className:"px-2 py-1 text-xs text-ink-3",children:"No organization folders yet."}),v.projects?(0,e.jsx)(Os,{node:v.projects,depth:0,selection:l,expanded:y,renamingId:D,renameDraft:j,rootLabel:"Projects",rootIcon:(0,e.jsx)(Ie,{className:"h-3.5 w-3.5"}),onToggle:C,onSelect:a,onCreateFolder:r,onEditFolder:g,onMoveFolder:b,onDeleteFolder:_,onStartRename:M,onRenameDraftChange:h,onRenameCommit:ee,onRenameCancel:t(()=>k(null),"onRenameCancel")}):(0,e.jsx)(ct,{active:!1,label:"Projects",count:0,icon:(0,e.jsx)(Ie,{className:"h-3.5 w-3.5"}),muted:!0,disabled:!0,onSelect:t(()=>{},"onSelect")}),v.bundled?(0,e.jsx)(Os,{node:v.bundled,depth:0,selection:l,expanded:y,renamingId:D,renameDraft:j,rootLabel:"Bundled",rootIcon:(0,e.jsx)(Ie,{className:"h-3.5 w-3.5"}),onToggle:C,onSelect:a,onCreateFolder:r,onEditFolder:g,onMoveFolder:b,onDeleteFolder:_,onStartRename:M,onRenameDraftChange:h,onRenameCommit:ee,onRenameCancel:t(()=>k(null),"onRenameCancel")}):null,(0,e.jsx)("div",{className:"px-2 pb-1 pt-3 text-(length:--text-micro) font-medium uppercase tracking-wide text-ink-3",children:"System"}),(0,e.jsx)(ct,{active:l==="unfiled",label:"Unfiled",count:pe,icon:(0,e.jsx)(Ms,{color:null}),onSelect:t(()=>a("unfiled"),"onSelect")})]}),o.length>0?(0,e.jsxs)("div",{className:"mt-4 border-t border-line pt-3",children:[(0,e.jsxs)("div",{className:"mb-1.5 flex items-center gap-1.5 px-2 text-(length:--text-micro) font-medium uppercase tracking-wide text-ink-3",children:[(0,e.jsx)(da,{className:"h-3 w-3"}),"Tags"]}),(0,e.jsxs)("div",{className:"flex flex-wrap gap-1.5 px-1",children:[c?(0,e.jsxs)("button",{type:"button",onClick:t(()=>m(null),"onClick"),className:"inline-flex items-center gap-1 rounded-full border border-line bg-bg-3/60 px-2 py-0.5 text-xs text-ink",children:[c,(0,e.jsx)(Hs,{className:"h-3 w-3"})]}):null,o.filter(S=>S.slug!==c).map(S=>(0,e.jsxs)("button",{type:"button",onClick:t(()=>m(S.slug),"onClick"),className:"inline-flex items-center gap-1 rounded-full border border-line px-2 py-0.5 text-xs text-ink-3 transition-colors hover:bg-bg-3/40 hover:text-ink",children:[(0,e.jsx)("span",{className:"max-w-32 truncate",children:S.slug}),(0,e.jsx)("span",{className:"text-(length:--text-micro) opacity-70",children:S.count})]},S.slug))]})]}):null]}),(0,e.jsx)("div",{role:"separator","aria-label":"Resize skill folders","aria-orientation":"vertical","aria-valuemin":Gt,"aria-valuemax":Xt,"aria-valuenow":P,tabIndex:0,className:K("absolute inset-y-0 right-0 z-20 w-3 cursor-col-resize touch-none outline-none","before:absolute before:inset-y-0 before:left-1/2 before:w-px before:-translate-x-1/2 before:bg-transparent before:transition-colors","hover:before:bg-line focus-visible:before:bg-focus",T&&"before:bg-focus"),onPointerDown:Z,onPointerMove:Le,onPointerUp:xe,onPointerCancel:xe,onLostPointerCapture:xe,onKeyDown:de})]})}t(Hi,"SkillFolderRail");function Qi({label:s,onCreate:l}){return(0,e.jsxs)("div",{className:"group/heading flex items-center justify-between px-2 pb-0.5 pt-3",children:[(0,e.jsx)("span",{className:"text-(length:--text-micro) font-medium uppercase tracking-wide text-ink-3",children:s}),(0,e.jsx)("button",{type:"button",onClick:l,title:`New ${s.toLowerCase()} folder`,className:"opacity-0 transition-opacity group-hover/heading:opacity-100",children:(0,e.jsx)(Rs,{className:"h-3 w-3 text-ink-3"})})]})}t(Qi,"RailHeading");function ct({active:s,label:l,count:i,icon:o,muted:c=!1,disabled:a=!1,onSelect:m}){return(0,e.jsxs)("button",{type:"button",className:K("grid w-full grid-cols-(--gtc-folder-row-actions) items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm transition-colors hover:bg-bg-3/40",s?"bg-bg-3/60 text-ink":c?"text-ink-3/70":"text-ink-3"),"aria-current":s?"page":void 0,disabled:a,onClick:m,children:[(0,e.jsx)("span",{className:"flex h-4 w-4 items-center justify-center",children:o}),(0,e.jsx)("span",{className:"truncate",children:l}),(0,e.jsx)("span",{className:"text-right text-xs tabular-nums text-ink-3",children:i}),(0,e.jsx)("span",{className:"h-6 w-6","aria-hidden":"true"})]})}t(ct,"VirtualRow");function Os({node:s,depth:l,selection:i,expanded:o,renamingId:c,renameDraft:a,rootLabel:m,rootIcon:r,onToggle:x,onSelect:g,onCreateFolder:b,onEditFolder:_,onMoveFolder:f,onDeleteFolder:v,onStartRename:y,onRenameDraftChange:N,onRenameCommit:D,onRenameCancel:k}){const{folder:j,children:h}=s,P=o.has(j.id),A=i===j.id,T=Ui(j),X=!jt(j)&&!nn(j)&&j.depth<4,O=j.path.startsWith("my/"),Q=m??j.name;return(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{className:K("group grid grid-cols-(--gtc-folder-row-actions) items-center gap-2 rounded-md pr-2 text-sm transition-colors hover:bg-bg-3/40",A?"bg-bg-3/60 text-ink":"text-ink-3"),style:{paddingLeft:`${l*.75}rem`},children:[(0,e.jsx)("button",{type:"button","aria-label":P?"Collapse folder":"Expand folder",className:K("flex h-6 w-4 items-center justify-center text-ink-3",h.length===0&&"invisible"),onClick:t(()=>x(j.id),"onClick"),children:(0,e.jsx)(Ps,{className:K("h-3.5 w-3.5 transition-transform",P&&"rotate-90")})}),(0,e.jsxs)("button",{type:"button",className:"flex min-w-0 items-center gap-2 py-1 text-left","aria-current":A?"page":void 0,onClick:t(()=>{g(j.id),h.length>0&&x(j.id)},"onClick"),onDoubleClick:t(()=>T&&y(j),"onDoubleClick"),children:[r?(0,e.jsx)("span",{className:"flex h-4 w-4 items-center justify-center text-ink-3",children:r}):(0,e.jsx)(Ms,{color:j.color}),c===j.id?(0,e.jsx)("input",{value:a,onChange:t(C=>N(C.target.value),"onChange"),onClick:t(C=>C.stopPropagation(),"onClick"),onKeyDown:t(C=>{C.key==="Enter"&&D(j),C.key==="Escape"&&k()},"onKeyDown"),onBlur:t(()=>D(j),"onBlur"),className:"h-6 min-w-0 flex-1 rounded-sm border border-line bg-bg px-1 text-sm outline-none",autoFocus:!0}):(0,e.jsx)("span",{className:"truncate",children:Q})]}),(0,e.jsx)("span",{className:"text-right text-xs tabular-nums text-ink-3",children:j.itemCount}),T||X?(0,e.jsxs)(Fs,{children:[(0,e.jsx)(Cs,{asChild:!0,children:(0,e.jsx)(w,{variant:"ghost",size:"icon-sm",className:"h-6 w-6 opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100","aria-label":`Folder actions for ${Q}`,children:(0,e.jsx)(xa,{className:"h-3.5 w-3.5"})})}),(0,e.jsxs)(Is,{align:"end",children:[X?(0,e.jsxs)(Ce,{onSelect:t(()=>b(j.id),"onSelect"),children:[(0,e.jsx)(rn,{className:"h-3.5 w-3.5"}),"New subfolder"]}):null,T?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ce,{onSelect:t(()=>y(j),"onSelect"),children:"Rename"}),(0,e.jsx)(Ce,{onSelect:t(()=>_(j),"onSelect"),children:"Edit color"}),(0,e.jsxs)(Ce,{onSelect:t(()=>f(j,O?"company":"my"),"onSelect"),children:[(0,e.jsx)(fi,{className:"h-3.5 w-3.5"}),"Move to ",O?"Organization":"My Skills"]}),(0,e.jsx)(ca,{}),(0,e.jsxs)(Ce,{variant:"destructive",onSelect:t(()=>v(j),"onSelect"),children:[(0,e.jsx)(pa,{className:"h-3.5 w-3.5"}),"Delete"]})]}):null]})]}):(0,e.jsx)("span",{className:"h-6 w-6"})]}),P&&h.length>0?(0,e.jsx)("div",{children:h.map(C=>(0,e.jsx)(Os,{node:C,depth:l+1,selection:i,expanded:o,renamingId:c,renameDraft:a,onToggle:x,onSelect:g,onCreateFolder:b,onEditFolder:_,onMoveFolder:f,onDeleteFolder:v,onStartRename:y,onRenameDraftChange:N,onRenameCommit:D,onRenameCancel:k},C.folder.id))}):null]})}t(Os,"TreeBranch");function Wi({result:s,selection:l,onSelect:i}){const o=(0,d.useMemo)(()=>Ye(s),[s]),c=l==="all"||l==="unfiled"?[]:an(o,l);return(0,e.jsxs)("nav",{"aria-label":"Folder path",className:"flex flex-wrap items-center gap-1 text-sm",children:[(0,e.jsxs)("button",{type:"button",onClick:t(()=>i("all"),"onClick"),className:K("inline-flex items-center gap-1 rounded px-1.5 py-0.5 transition-colors hover:bg-bg-3/40",l==="all"?"font-medium text-ink":"text-ink-3"),children:[(0,e.jsx)(Wl,{className:"h-3.5 w-3.5"}),"All skills"]}),l==="unfiled"?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ps,{className:"h-3.5 w-3.5 text-ink-3/60"}),(0,e.jsx)("span",{className:"rounded px-1.5 py-0.5 font-medium text-ink",children:"Unfiled"})]}):null,c.map((a,m)=>{const r=m===c.length-1,x=m===0?tn(a):a.name;return(0,e.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,e.jsx)(Ps,{className:"h-3.5 w-3.5 text-ink-3/60"}),(0,e.jsxs)("button",{type:"button",onClick:t(()=>i(a.id),"onClick"),className:K("inline-flex items-center gap-1 rounded px-1.5 py-0.5 transition-colors hover:bg-bg-3/40",r?"font-medium text-ink":"text-ink-3"),children:[a.color?(0,e.jsx)(Ms,{color:a.color}):null,x]})]},a.id)})]})}t(Wi,"FolderBreadcrumb");function Gi({open:s,onOpenChange:l,result:i,title:o,subtitle:c,currentFolderId:a,pending:m=!1,onMove:r,onCreateFolder:x}){const g=(0,d.useMemo)(()=>Ye(i),[i]),[b,_]=(0,d.useState)(""),[f,v]=(0,d.useState)(void 0),[y,N]=(0,d.useState)(void 0),[D,k]=(0,d.useState)(""),[j,h]=(0,d.useState)(!1);(0,d.useEffect)(()=>{s&&(_(""),v(void 0),N(void 0),k(""))},[s]);const P=b.trim().toLowerCase(),A=t(M=>!P||M.name.toLowerCase().includes(P)||M.path.toLowerCase().includes(P),"matches"),T=f,X=typeof T=="string"?g.byId.get(T)??null:null,O=T===void 0?null:T===null?"Unfiled":X?.path??null;async function Q(){const M=D.trim();if(M){h(!0);try{const ee=await x(y??null,M);ee&&v(ee),N(void 0),k("")}finally{h(!1)}}}t(Q,"submitNewFolder");function C(M,ee){const{folder:Y}=M,pe=jt(Y),ae=!pe,Z=T===Y.id,Le=a===Y.id,xe=ae&&!nn(Y)&&Y.depth<4,de=M.children,S=A(Y),U=Aa(M,A);return P&&!S&&!U?null:(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{className:K("group flex items-center gap-2 rounded-md px-2 py-1.5 text-sm",ae?"cursor-pointer hover:bg-bg-3/40":"cursor-not-allowed opacity-50",Z&&"bg-bg-3/70"),style:{paddingLeft:`${.5+ee*.9}rem`},onClick:t(()=>ae&&v(Y.id),"onClick"),children:[Y.systemKey&&["my","projects","bundled"].includes(Y.systemKey)?(0,e.jsx)(Xs,{className:"h-3.5 w-3.5 shrink-0 text-ink-3"}):(0,e.jsx)(Ms,{color:Y.color}),(0,e.jsx)("span",{className:"min-w-0 flex-1 truncate",children:tn(Y)}),Le?(0,e.jsx)("span",{className:"text-xs text-ink-3",children:"current"}):null,pe?(0,e.jsx)("span",{className:"text-xs text-ink-3",children:"read-only"}):null,Z?(0,e.jsx)(Hs,{className:"h-3.5 w-3.5"}):null,xe?(0,e.jsx)("button",{type:"button",title:"New folder inside…",className:"opacity-0 transition-opacity group-hover:opacity-100",onClick:t(se=>{se.stopPropagation(),N(Y.id),k("")},"onClick"),children:(0,e.jsx)(rn,{className:"h-3.5 w-3.5 text-ink-3"})}):null]}),y===Y.id?(0,e.jsx)(Un,{depth:ee+1,value:D,pending:j,onChange:k,onSubmit:Q,onCancel:t(()=>N(void 0),"onCancel")}):null,de.map(se=>C(se,ee+1))]},Y.id)}return t(C,"renderNode"),(0,e.jsx)(ns,{open:s,onOpenChange:l,children:(0,e.jsxs)(ss,{className:"sm:max-w-lg",children:[(0,e.jsxs)(xs,{children:[(0,e.jsx)(ts,{children:o}),c?(0,e.jsx)(hs,{children:c}):null]}),(0,e.jsxs)("div",{className:"flex items-center gap-2 rounded-md border border-line px-2.5",children:[(0,e.jsx)(Ws,{className:"h-3.5 w-3.5 text-ink-3"}),(0,e.jsx)("input",{value:b,onChange:t(M=>_(M.target.value),"onChange"),placeholder:"Search folders",className:"h-8 min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-ink-3"})]}),(0,e.jsxs)("div",{className:"max-h-72 overflow-y-auto rounded-md border border-line p-1",children:[(0,e.jsxs)("div",{className:K("flex cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-sm hover:bg-bg-3/40",T===null&&"bg-bg-3/70"),onClick:t(()=>v(null),"onClick"),children:[(0,e.jsx)(Ms,{color:null}),(0,e.jsx)("span",{className:"min-w-0 flex-1 truncate",children:"Unfiled"}),a==null?(0,e.jsx)("span",{className:"text-xs text-ink-3",children:"current"}):null,T===null?(0,e.jsx)(Hs,{className:"h-3.5 w-3.5"}):null]}),g.roots.map(M=>C(M,0)),(0,e.jsx)("div",{className:"mt-1 border-t border-line pt-1",children:y===null?(0,e.jsx)(Un,{depth:0,value:D,pending:j,onChange:k,onSubmit:Q,onCancel:t(()=>N(void 0),"onCancel")}):(0,e.jsxs)("button",{type:"button",onClick:t(()=>{N(null),k("")},"onClick"),className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm text-ink-3 hover:bg-bg-3/40 hover:text-ink",children:[(0,e.jsx)(Rs,{className:"h-3.5 w-3.5"}),"New top-level folder…"]})})]}),(0,e.jsx)("div",{className:"min-h-5 text-xs text-ink-3",children:O?(0,e.jsxs)("span",{children:["Moving to ",(0,e.jsx)("span",{className:"font-mono text-ink",children:O})]}):(0,e.jsx)("span",{children:"Pick a destination folder."})}),(0,e.jsxs)(xt,{children:[(0,e.jsx)(w,{variant:"ghost",onClick:t(()=>l(!1),"onClick"),disabled:m,children:"Cancel"}),(0,e.jsx)(w,{disabled:m||T===void 0||T===a,onClick:t(()=>T!==void 0&&r(T),"onClick"),children:m?"Moving…":"Move here"})]})]})})}t(Gi,"MoveToFolderDialog");function Aa(s,l){return l(s.folder)?!0:s.children.some(i=>Aa(i,l))}t(Aa,"subtreeMatches");function Un({depth:s,value:l,pending:i,onChange:o,onSubmit:c,onCancel:a}){return(0,e.jsxs)("div",{className:"flex items-center gap-2 py-1",style:{paddingLeft:`${.5+s*.9}rem`},children:[(0,e.jsx)(rn,{className:"h-3.5 w-3.5 shrink-0 text-ink-3"}),(0,e.jsx)(Fe,{value:l,onChange:t(m=>o(m.target.value),"onChange"),placeholder:"Folder name",autoFocus:!0,className:"h-7 flex-1 text-sm",onKeyDown:t(m=>{m.key==="Enter"&&c(),m.key==="Escape"&&a()},"onKeyDown")}),(0,e.jsx)(w,{size:"sm",variant:"ghost",onClick:a,disabled:i,children:"Cancel"}),(0,e.jsx)(w,{size:"sm",onClick:c,disabled:i||!l.trim(),children:"Add"})]})}t(Un,"InlineNewFolder");var Vn=16,Hn=24,Qn="min-h-9";function Wn(s){return(0,e.jsx)("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",...s,children:(0,e.jsx)("path",{d:"M12 4 21 19H3z"})})}t(Wn,"VercelMark");function Ta(s){const l=s.replace(/\r\n/g,`
|
|
2
2
|
`);if(!l.startsWith(`---
|
|
3
3
|
`))return l.trim();const i=l.indexOf(`
|
|
4
4
|
---
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var It=Object.defineProperty;var n=(t,a)=>It(t,"name",{value:a,configurable:!0});import{i as Qe}from"./rolldown-runtime-ZpX3ckPj.js";import{l as _,na as Mt,t as Ue,ta as Tt}from"./createLucideIcon-DJi9suAC.js";import{n as He}from"./star-BZgQbzhV.js";import{X as Ve,_ as Ge,t as B,v as se}from"./queryKeys-DYV5MhM_.js";import{it as Ot,q as _t,t as zt,zt as me}from"./router-2UfGeejU.js";import{i as At,p as Dt,r as $t,t as Et}from"./dropdown-menu-CqRAF7Oj.js";import{o as We,r as Ye,t as Je}from"./popover-BhYHYj7q.js";import{t as Fe}from"./arrow-left-Ce_LIut0.js";import{t as G}from"./check-Ctsrlfa-.js";import{t as ue}from"./chevron-down-BCvxsWfI.js";import{r as je,t as Be}from"./button-CMwV3L1P.js";import{t as Pt}from"./pause-CJSwJvLv.js";import{t as Le}from"./play-CJNuUj69.js";import{t as Xe}from"./plus-C6fnr28l.js";import{t as Rt}from"./rotate-ccw-CQEJ4ewP.js";import{t as qe}from"./search-04O7m-IF.js";import{t as Ne}from"./x-DRDFdlYE.js";import{i as Ft,n as Bt,r as Lt,t as qt}from"./tooltip-B5WQ3lq5.js";import{t as ye}from"./agents-DmlgUVso.js";import{t as Kt}from"./attachment-icon-4xDiQblX.js";import{t as Qt}from"./toggle-switch-BHxNtSq9.js";import{n as we,t as Ut}from"./useMobileEntityPickerViewportStyle-C3R37KtS.js";import{_ as Ze,g as W,h as xe,m as et,p as tt,v as st,y as Se}from"./model-picker-fields-235ien8Z.js";import{n as Ht}from"./InlineEntitySelector-v2Q4C8oT.js";var at={name:"clipboard-list",size:24,node:[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]};at.node;var nt=Ue(at),rt={name:"message-circle-question-mark",size:24,node:[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["message-circle-question"]};rt.node;var it=Ue(rt),u=Qe(Mt(),1),e=Qe(Tt(),1),Vt={chip:"border-line bg-bg-3/40 text-ink-3 hover:bg-bg-3 hover:text-ink",container:"",menuItem:"text-ink",badge:""},Gt={chip:"border-sky-500/60 bg-sky-500/15 text-sky-800 hover:bg-sky-500/25 dark:border-sky-500/50 dark:bg-sky-500/15 dark:text-sky-200 dark:hover:bg-sky-500/25",container:"border-sky-500/60 bg-sky-50/60 supports-[backdrop-filter]:bg-sky-50/40 dark:border-sky-500/50 dark:bg-sky-500/[0.07] dark:supports-[backdrop-filter]:bg-sky-500/[0.07]",menuItem:"text-sky-700 dark:text-sky-300",badge:"border-sky-500/40 bg-sky-50 text-sky-700 dark:border-sky-500/40 dark:bg-sky-500/10 dark:text-sky-200"},Wt={chip:"border-amber-500/60 bg-amber-500/15 text-amber-800 hover:bg-amber-500/25 dark:border-amber-500/50 dark:bg-amber-500/15 dark:text-amber-200 dark:hover:bg-amber-500/25",container:"border-amber-500/60 bg-amber-50/60 supports-[backdrop-filter]:bg-amber-50/40 dark:border-amber-500/50 dark:bg-amber-500/[0.07] dark:supports-[backdrop-filter]:bg-amber-500/[0.07]",menuItem:"text-amber-700 dark:text-amber-300",badge:"border-amber-500/40 bg-amber-500/10 text-amber-700 dark:text-amber-300"};function Is(t){return t==="standard"||t==="ask"||t==="planning"}n(Is,"isIssueWorkMode");function lt(){return[{value:"standard",label:"Auto mode",icon:Ot,tone:"neutral",classes:Vt},{value:"planning",label:"Plan mode",icon:nt,tone:"planning",classes:Wt},{value:"ask",label:"Ask mode",icon:it,tone:"ask",classes:Gt}]}n(lt,"workModeMetaList");function Yt(t){const a=lt();return a.find(r=>r.value===t)??a[0]}n(Yt,"workModeMetaFor");function Ms(t){const a=lt();return a[(a.findIndex(r=>r.value===t)+1)%a.length]?.value??"standard"}n(Ms,"nextWorkMode");var Jt=[{value:"new",label:"New subtasks"},{value:"new_and_existing",label:"New and existing"}];function ot({inheritToSubtasks:t,subtaskScope:a,onInheritChange:r,onScopeChange:c,testIdPrefix:l,disabled:i=!1,propagation:d=null,className:h}){return(0,e.jsxs)("div",{className:_("flex flex-col gap-2 p-2",h),children:[(0,e.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,e.jsx)("span",{className:"text-xs",children:"Apply to subtasks"}),(0,e.jsx)(Qt,{checked:t,onCheckedChange:r,disabled:i,"data-testid":`${l}-inherit`})]}),t?(0,e.jsx)("div",{className:"flex items-center gap-1",role:"radiogroup",children:Jt.map(x=>(0,e.jsx)("button",{type:"button",role:"radio","aria-checked":a===x.value,disabled:i,"data-testid":`${l}-scope-${x.value}`,className:_("flex-1 rounded-md border border-line px-2 py-1 text-xs transition-colors hover:bg-bg-3/40 disabled:opacity-50",a===x.value&&"bg-bg-3 text-ink"),onClick:n(()=>c(x.value),"onClick"),children:x.label},x.value))}):null,d?(0,e.jsxs)("div",{className:"flex flex-col gap-0.5 px-1",children:[(0,e.jsxs)("p",{className:"text-xs text-ink-3","data-testid":`${l}-propagation`,children:[d.applied," of ",d.visited," subtasks updated",d.skipped>0?` · ${d.skipped} kept their own model`:""]}),d.limitReached?(0,e.jsx)("p",{className:"text-xs text-amber-600 dark:text-amber-400",role:"status","data-testid":`${l}-propagation-warning`,children:"Stopped at the safety limit; deeper subtasks were left unchanged."}):null]}):null]})}n(ot,"ModelOverrideSubtaskRows");function Ts(t,a=!1){const r=(0,u.useRef)(!1),[c,l]=(0,u.useState)(!1),[i,d]=(0,u.useState)(null);async function h(){if(!(!t||r.current||a)){r.current=!0,l(!0),d(null);try{await t()}catch(x){d(x instanceof Error?x.message:"Unable to stop. Try again.")}finally{r.current=!1,l(!1)}}}return n(h,"stop"),{stop:h,stopping:c||a,error:i}}n(Ts,"useComposerStop");var dt="wardmote:composer-effort";function Xt(t){try{const a=localStorage.getItem(`${dt}:${t}`);if(a===null)return;const r=JSON.parse(a);return r===null||typeof r=="string"?r:void 0}catch{return}}n(Xt,"getLastComposerEffort");function Ke(t,a){try{localStorage.setItem(`${dt}:${t}`,JSON.stringify(a))}catch{}}n(Ke,"rememberComposerEffort");function Ce({title:t,value:a,onClose:r,className:c}){return(0,e.jsxs)("div",{"data-mobile-sheet-header":"",className:_("hidden shrink-0 flex-col gap-1 border-b border-line/60 bg-bg-2 px-3 pb-2 pt-2 max-sm:flex",c),children:[(0,e.jsx)("div",{"aria-hidden":!0,className:"mx-auto h-1 w-10 shrink-0 rounded-full bg-line","data-mobile-sheet-handle":""}),(0,e.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,e.jsx)("span",{className:"shrink-0 text-sm font-medium",children:t}),a?(0,e.jsx)("span",{className:"min-w-0 flex-1 truncate text-right text-xs text-ink-3","data-mobile-sheet-value":"",children:a}):(0,e.jsx)("span",{className:"flex-1"}),r?(0,e.jsx)("button",{type:"button",onClick:r,"aria-label":`Close ${t} picker`,"data-mobile-sheet-close":"",className:"-mr-1 flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-ink-3 hover:bg-bg-3 hover:text-ink",children:(0,e.jsx)(Ne,{className:"h-4 w-4","aria-hidden":!0})}):null]})]})}n(Ce,"MobilePickerSheetHeader");var E="Agent default";function ct(t,a){const r=t.filter(l=>l.override);if(r.length>0)return r.map(l=>a(l,l.override)).join(" · ");const c=t.find(l=>l.key==="model");return c?.effective?a(c,c.effective):E}n(ct,"summarizeFields");function ut(t){return ct(t,(a,r)=>a.key==="model"?Se(W(r,a.options)):r)}n(ut,"triggerLabel");function mt({fields:t,className:a}){const r=t.filter(i=>i.override),c=t.find(i=>i.key==="model"),l=r.length>0?r.map(i=>({field:i,value:i.override})):c?.effective?[{field:c,value:c.effective}]:[];return l.length===0?(0,e.jsx)("span",{className:_("truncate",a),children:E}):(0,e.jsx)("span",{className:_("flex min-w-0 items-center gap-1",a),title:Zt(t),children:l.map(({field:i,value:d},h)=>(0,e.jsxs)(u.Fragment,{children:[h>0?(0,e.jsx)("span",{className:"shrink-0","aria-hidden":!0,children:"·"}):null,i.key==="model"?(0,e.jsx)(xe,{display:W(d,i.options),layout:"inline"}):(0,e.jsx)("span",{className:"shrink-0",children:d})]},i.key))})}n(mt,"RunSettingsSummary");function Zt(t){return ct(t,(a,r)=>r)}n(Zt,"triggerTitle");function es({field:t,pending:a,onSelect:r,collapsible:c,expanded:l,onToggle:i}){const[d,h]=(0,u.useState)(""),x=d.trim(),f=(0,u.useMemo)(()=>Ze(t.options.filter(m=>st(m,x))),[t.options,x]),w=t.effective?W(t.effective,t.options):null,S=t.agentDefault?W(t.agentDefault,t.options):null,z=t.freeText&&x.length>0&&!t.options.some(m=>m.value===x),C=!c||l;return(0,e.jsxs)("div",{className:_("flex min-w-0 flex-col gap-1 border-b border-line/60 p-2 last:border-b-0",C?"min-h-0 flex-1":"shrink-0"),"data-testid":`task-model-override-section-${t.key}`,"data-expanded":C?"true":"false",children:[(0,e.jsx)("div",{className:"flex items-baseline justify-between gap-2 px-1",children:c?(0,e.jsxs)("button",{type:"button",onClick:i,className:"flex min-w-0 flex-1 items-baseline justify-between gap-2 text-left","data-testid":`task-model-override-toggle-${t.key}`,"aria-expanded":C,children:[(0,e.jsx)("span",{className:"shrink-0 text-xs font-medium",children:t.label}),w?(0,e.jsx)(xe,{display:w,layout:"inline",className:"justify-end text-xs text-ink-3",testId:`task-model-override-effective-${t.key}`}):(0,e.jsx)("span",{className:"min-w-0 truncate text-xs text-ink-3","data-testid":`task-model-override-effective-${t.key}`,children:E})]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{className:"shrink-0 text-xs font-medium",children:t.label}),w?(0,e.jsx)(xe,{display:w,layout:"inline",className:"max-w-48 justify-end text-xs text-ink-3",testId:`task-model-override-effective-${t.key}`}):(0,e.jsx)("span",{className:"max-w-32 truncate text-xs text-ink-3","data-testid":`task-model-override-effective-${t.key}`,children:E})]})}),C&&(t.options.length>6||t.freeText)?(0,e.jsx)("input",{type:"text",value:d,onChange:n(m=>h(m.target.value),"onChange"),onKeyDown:n(m=>{m.key!=="Enter"||!z||(m.preventDefault(),r(t.key,x))},"onKeyDown"),placeholder:t.freeText?"Search or type a value…":"Search…",disabled:a,className:"h-8 w-full shrink-0 rounded-md border border-line-strong bg-transparent px-2 text-xs outline-none focus-visible:ring-1 focus-visible:ring-focus","data-testid":`task-model-override-search-${t.key}`}):null,C?(0,e.jsxs)("div",{"data-slot":"entity-option-list",className:"min-h-0 flex-1 overflow-y-auto overscroll-contain max-sm:max-h-none sm:max-h-48",children:[(0,e.jsxs)("button",{type:"button",disabled:a,onClick:n(()=>r(t.key,null),"onClick"),className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs hover:bg-bg-3 disabled:opacity-50","data-testid":`task-model-override-default-${t.key}`,children:[(0,e.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,e.jsx)("span",{className:"block truncate",children:E}),S?(0,e.jsx)("span",{className:"block truncate text-ink-3",title:S.id,"data-testid":`task-model-override-default-value-${t.key}`,children:Se(S)}):null]}),t.override===null?(0,e.jsx)(G,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":!0}):null]}),z?(0,e.jsx)("button",{type:"button",disabled:a,onClick:n(()=>r(t.key,x),"onClick"),className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs hover:bg-bg-3 disabled:opacity-50","data-testid":`task-model-override-custom-${t.key}`,children:(0,e.jsxs)("span",{className:"min-w-0 flex-1 truncate",children:["Use “",x,"”"]})}):null,f.map(m=>(0,e.jsxs)("div",{role:"group","aria-label":m.provider??void 0,children:[m.provider?(0,e.jsx)(tt,{provider:m.provider,testId:`task-model-override-group-${t.key}-${m.provider}`}):null,m.options.map(A=>(0,e.jsxs)("button",{type:"button",disabled:a,onClick:n(()=>r(t.key,A.value),"onClick"),className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs hover:bg-bg-3 disabled:opacity-50","data-testid":`task-model-override-option-${t.key}-${A.value}`,children:[(0,e.jsx)(et,{option:A}),t.override===A.value?(0,e.jsx)(G,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":!0}):null]},A.value))]},m.provider??""))]}):null]})}n(es,"FieldSection");var ts=["model","thinking"];function xt(t,a){if(!t)return[];const r=t.agents[0]?.current??{},c=[];for(const l of ts){const i=t.fields.find(x=>x.key===l);if(!i)continue;const d=r[l]??null,h=a[l]??null;c.push({key:l,label:i.label,hint:i.hint,freeText:i.freeText,options:i.options,agentDefault:d,override:h,effective:h??d})}return c}n(xt,"draftOverrideFields");function Os({issueId:t,draft:a,pendingIssue:r,footerSlot:c,subtaskRows:l=!1,disabled:i=!1,mobile:d=!1}){const h=Ve(),[x,f]=(0,u.useState)(!1),[w,S]=(0,u.useState)(null),[z,C]=(0,u.useState)(void 0),[m,A]=(0,u.useState)(null),[K,ae]=(0,u.useState)({}),P=(0,u.useRef)(null);we(x,{sheet:!0});const R=Ht(),D=a?null:t||m,$=a??r,ne=B.issues.modelOverride(D??"__none__"),Y=se({queryKey:ne,queryFn:n(()=>me.getModelOverride(D),"queryFn"),enabled:!!D,staleTime:3e4}),J=se({queryKey:B.agents.adapterConfigBatch($?.companyId??"__none__",$?.agentId?[$.agentId]:[]),queryFn:n(()=>ye.batchAdapterConfigPreview([$.agentId]),"queryFn"),enabled:!!$?.agentId&&!D,staleTime:6e4}),L=Ge({mutationFn:n(async p=>{let j=D;if(!j){if(!r)throw new Error("This conversation could not be opened.");P.current||(P.current=r.resolve().then(T=>(A(T),T),T=>{throw P.current=null,T instanceof Error?T:new Error("This conversation could not be opened.")})),j=await P.current}return{targetId:j,next:await me.setModelOverride(j,p)}},"mutationFn"),onSuccess:n(({targetId:p,next:j})=>{h.setQueryData(B.issues.modelOverride(p),j),S(null)},"onSuccess"),onError:n(p=>{S(p instanceof Error?p.message:"The override could not be saved.")},"onError")}),v=Y.data,re=a?.values,ie=J.data,Q=!!$&&!v?.fields.length,I=(0,u.useMemo)(()=>Q?xt(ie,re??K):v?.fields??[],[Q,ie,re,K,v]),b=!!a&&!a?.agentId;if(a){if(a.agentId&&J.isFetched&&I.length===0)return null}else if(D){if(!x&&(!v?.supported||v.fields.length===0))return null}else if(!r)return null;const y=L.isPending,M=I.some(p=>p.override),X=z===void 0?I[0]?.key??null:z;return(0,e.jsxs)(Je,{modal:R,open:x,onOpenChange:f,children:[(0,e.jsx)(We,{asChild:!0,children:(0,e.jsxs)("button",{type:"button",disabled:i||b,title:b?a.noAgentHint:"Model and thinking effort for this task",className:_("flex h-8 min-w-0 shrink items-center gap-1.5 rounded-md px-2.5 text-xs font-medium transition-colors hover:bg-bg-3 disabled:opacity-50",M?"text-ink":"text-ink-3"),"data-testid":"task-chat-composer-model-override","data-slot":"model-override-trigger","data-has-override":M?"true":"false",children:[b?(0,e.jsx)("span",{className:_("truncate",d?"max-w-20":"max-w-40"),children:E}):(0,e.jsx)(mt,{fields:I,className:d?"max-w-28":"max-w-56"}),y?(0,e.jsx)(je,{className:"h-3 w-3 shrink-0 animate-spin","aria-hidden":!0}):(0,e.jsx)(ue,{className:"h-3 w-3 shrink-0","aria-hidden":!0})]})}),(0,e.jsxs)(Ye,{align:"end",className:"w-(--sz-280px) max-w-(--sz-turn-status-popover) p-0","data-mobile-entity-picker":"","data-testid":"task-model-override-panel",children:[(0,e.jsx)(Ce,{title:"Task model",value:ut(I),onClose:n(()=>f(!1),"onClose")}),(0,e.jsxs)("div",{"data-mobile-sheet-body":"",className:"flex min-w-0 flex-col",children:[I.map(p=>(0,e.jsx)(es,{field:p,pending:y,collapsible:d,expanded:X===p.key,onToggle:n(()=>C(X===p.key?null:p.key),"onToggle"),onSelect:n((j,T)=>{if(a){a.onChange(j,T);return}if(!D){if(T===null&&!p.override)return;ae(le=>({...le,[j]:T}))}L.mutate({[j]:T})},"onSelect")},p.key)),I.length===0?(0,e.jsx)("p",{className:"px-3 py-2 text-xs text-ink-3","data-testid":"task-model-override-empty",children:v?.unsupportedReason??"Loading model options…"}):null]}),c?(0,e.jsx)("div",{"data-mobile-sheet-controls":"","data-testid":"task-model-override-footer",className:"shrink-0 border-t border-line/60",children:c}):l&&v?.inheritance?(0,e.jsx)("div",{"data-mobile-sheet-controls":"","data-testid":"task-model-override-footer",className:"shrink-0 border-t border-line/60",children:(0,e.jsx)(ot,{inheritToSubtasks:v.inheritance.inheritToSubtasks,subtaskScope:v.inheritance.subtaskScope,disabled:i||y,testIdPrefix:"task-model-override",propagation:v.propagation,onInheritChange:n(p=>L.mutate({inheritToSubtasks:p,subtaskScope:v.inheritance.subtaskScope}),"onInheritChange"),onScopeChange:n(p=>L.mutate({inheritToSubtasks:v.inheritance.inheritToSubtasks,subtaskScope:p}),"onScopeChange")})}):null,w?(0,e.jsx)("p",{className:"shrink-0 px-3 py-2 text-xs text-bad","data-testid":"task-model-override-error",children:w}):null]})]})}n(Os,"TaskModelOverrideControl");function _s(){const[t,a]=(0,u.useState)({}),r=(0,u.useCallback)((l,i)=>{a(d=>({...d,[l]:i}))},[]),c=(0,u.useCallback)(()=>a({}),[]);return{values:t,hasValues:Object.keys(t).length>0,set:r,clear:c}}n(_s,"useComposerRunSettingsStaging");function te(t){return t.startsWith("agent:")?t.slice(6):null}n(te,"agentIdOf");function ve(t){return t.override?t.options.findIndex(a=>a.value===t.override)+1:0}n(ve,"committedOptionIndex");function zs({issueId:t,pendingIssue:a,assigneeValue:r,currentAssigneeValue:c,options:l,onAssigneeChange:i,staging:d,renderAssigneeIdentity:h,subtaskRows:x=!1,draft:f=!1,companyId:w=null,footerSlot:S,triggerRef:z,disabled:C=!1,mobile:m=!1}){const A=Ve(),[K,ae]=(0,u.useState)(!1),[P,R]=(0,u.useState)("settings"),[D,$]=(0,u.useState)(""),[ne,Y]=(0,u.useState)(""),[J,L]=(0,u.useState)(null),[v,re]=(0,u.useState)(null),[ie,Q]=(0,u.useState)({}),I=(0,u.useRef)(null);we(K,{sheet:!0});const b=t||v,y=!!b&&r!==c,M=te(r),X=!!(b||a||f),p=X?f||y?M:b?null:M??a?.agentId??null:null,j=a?.companyId??"__composer__",T=se({queryKey:B.issues.modelOverride(b??"__none__"),queryFn:n(()=>me.getModelOverride(b),"queryFn"),enabled:!!b,staleTime:3e4}),le=(0,u.useRef)(c);(0,u.useEffect)(()=>{le.current!==c&&(le.current=c,b&&A.invalidateQueries({queryKey:B.issues.modelOverride(b)}))},[b,c,A]);const oe=se({queryKey:B.agents.adapterConfigBatch(j,p?[p]:[]),queryFn:n(()=>ye.batchAdapterConfigPreview([p]),"queryFn"),enabled:!!p,staleTime:6e4}),pe=(0,u.useMemo)(()=>l.flatMap(s=>te(s.id)?[te(s.id)]:[]),[l]),Ie=se({queryKey:B.agents.adapterConfigBatch(`${j}:roster`,pe),queryFn:n(()=>ye.batchAdapterConfigPreview(pe),"queryFn"),enabled:K&&pe.length>0,staleTime:6e4}),de=(0,u.useMemo)(()=>{const s=new Map;for(const o of Ie.data?.agents??[])s.set(o.agentId,o.adapterType);return s},[Ie.data]),Z=Ge({mutationFn:n(async s=>{let o=b;if(!o){if(!a)throw new Error("This conversation could not be opened.");I.current||(I.current=a.resolve().then(k=>(re(k),k),k=>{throw I.current=null,k instanceof Error?k:new Error("This conversation could not be opened.")})),o=await I.current}return{targetId:o,next:await me.setModelOverride(o,s)}},"mutationFn"),onSuccess:n(({targetId:s,next:o})=>{A.setQueryData(B.issues.modelOverride(s),o),L(null)},"onSuccess"),onError:n(s=>{L(s instanceof Error?s.message:"The override could not be saved.")},"onError")}),N=T.data,he=oe.data?.agents[0]?.adapterType??null,pt=(0,u.useMemo)(()=>{if(!y||!N||!he)return{};if(N.adapterType!==he)return{};const s={};for(const o of N.fields)o.override&&(s[o.key]=o.override);return s},[y,N,he]),Me=f?d.values:y?{...pt,...d.values}:ie,Te=!!p&&(y||!b),O=(0,u.useMemo)(()=>y&&!M?[]:Te?xt(oe.data,Me):N?.fields??[],[y,M,Te,oe.data,Me,N]),[Oe,_e]=(0,u.useState)({});(0,u.useEffect)(()=>{_e(s=>{const o={...s};let k=!1;for(const F of O)o[F.key]!==void 0&&o[F.key]===ve(F)&&(delete o[F.key],k=!0);return k?o:s})},[O]);const q=f?w:null,ze=d.values.thinking,Ae=d.set,be=O.find(s=>s.key==="thinking")?.options.map(s=>s.value).join(`
|
|
1
|
+
var It=Object.defineProperty;var n=(t,a)=>It(t,"name",{value:a,configurable:!0});import{i as Qe}from"./rolldown-runtime-ZpX3ckPj.js";import{l as _,na as Mt,t as Ue,ta as Tt}from"./createLucideIcon-DJi9suAC.js";import{n as He}from"./star-BZgQbzhV.js";import{X as Ve,_ as Ge,t as B,v as se}from"./queryKeys-DYV5MhM_.js";import{it as Ot,q as _t,t as zt,zt as me}from"./router-2UfGeejU.js";import{i as At,p as Dt,r as $t,t as Et}from"./dropdown-menu-DEO3mF_E.js";import{o as We,r as Ye,t as Je}from"./popover-BhYHYj7q.js";import{t as Fe}from"./arrow-left-Ce_LIut0.js";import{t as G}from"./check-Ctsrlfa-.js";import{t as ue}from"./chevron-down-BCvxsWfI.js";import{r as je,t as Be}from"./button-CMwV3L1P.js";import{t as Pt}from"./pause-CJSwJvLv.js";import{t as Le}from"./play-CJNuUj69.js";import{t as Xe}from"./plus-C6fnr28l.js";import{t as Rt}from"./rotate-ccw-CQEJ4ewP.js";import{t as qe}from"./search-04O7m-IF.js";import{t as Ne}from"./x-DRDFdlYE.js";import{i as Ft,n as Bt,r as Lt,t as qt}from"./tooltip-B5WQ3lq5.js";import{t as ye}from"./agents-DmlgUVso.js";import{t as Kt}from"./attachment-icon-4xDiQblX.js";import{t as Qt}from"./toggle-switch-BHxNtSq9.js";import{n as we,t as Ut}from"./useMobileEntityPickerViewportStyle-C3R37KtS.js";import{_ as Ze,g as W,h as xe,m as et,p as tt,v as st,y as Se}from"./model-picker-fields-235ien8Z.js";import{n as Ht}from"./InlineEntitySelector-v2Q4C8oT.js";var at={name:"clipboard-list",size:24,node:[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]};at.node;var nt=Ue(at),rt={name:"message-circle-question-mark",size:24,node:[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["message-circle-question"]};rt.node;var it=Ue(rt),u=Qe(Mt(),1),e=Qe(Tt(),1),Vt={chip:"border-line bg-bg-3/40 text-ink-3 hover:bg-bg-3 hover:text-ink",container:"",menuItem:"text-ink",badge:""},Gt={chip:"border-sky-500/60 bg-sky-500/15 text-sky-800 hover:bg-sky-500/25 dark:border-sky-500/50 dark:bg-sky-500/15 dark:text-sky-200 dark:hover:bg-sky-500/25",container:"border-sky-500/60 bg-sky-50/60 supports-[backdrop-filter]:bg-sky-50/40 dark:border-sky-500/50 dark:bg-sky-500/[0.07] dark:supports-[backdrop-filter]:bg-sky-500/[0.07]",menuItem:"text-sky-700 dark:text-sky-300",badge:"border-sky-500/40 bg-sky-50 text-sky-700 dark:border-sky-500/40 dark:bg-sky-500/10 dark:text-sky-200"},Wt={chip:"border-amber-500/60 bg-amber-500/15 text-amber-800 hover:bg-amber-500/25 dark:border-amber-500/50 dark:bg-amber-500/15 dark:text-amber-200 dark:hover:bg-amber-500/25",container:"border-amber-500/60 bg-amber-50/60 supports-[backdrop-filter]:bg-amber-50/40 dark:border-amber-500/50 dark:bg-amber-500/[0.07] dark:supports-[backdrop-filter]:bg-amber-500/[0.07]",menuItem:"text-amber-700 dark:text-amber-300",badge:"border-amber-500/40 bg-amber-500/10 text-amber-700 dark:text-amber-300"};function Is(t){return t==="standard"||t==="ask"||t==="planning"}n(Is,"isIssueWorkMode");function lt(){return[{value:"standard",label:"Auto mode",icon:Ot,tone:"neutral",classes:Vt},{value:"planning",label:"Plan mode",icon:nt,tone:"planning",classes:Wt},{value:"ask",label:"Ask mode",icon:it,tone:"ask",classes:Gt}]}n(lt,"workModeMetaList");function Yt(t){const a=lt();return a.find(r=>r.value===t)??a[0]}n(Yt,"workModeMetaFor");function Ms(t){const a=lt();return a[(a.findIndex(r=>r.value===t)+1)%a.length]?.value??"standard"}n(Ms,"nextWorkMode");var Jt=[{value:"new",label:"New subtasks"},{value:"new_and_existing",label:"New and existing"}];function ot({inheritToSubtasks:t,subtaskScope:a,onInheritChange:r,onScopeChange:c,testIdPrefix:l,disabled:i=!1,propagation:d=null,className:h}){return(0,e.jsxs)("div",{className:_("flex flex-col gap-2 p-2",h),children:[(0,e.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,e.jsx)("span",{className:"text-xs",children:"Apply to subtasks"}),(0,e.jsx)(Qt,{checked:t,onCheckedChange:r,disabled:i,"data-testid":`${l}-inherit`})]}),t?(0,e.jsx)("div",{className:"flex items-center gap-1",role:"radiogroup",children:Jt.map(x=>(0,e.jsx)("button",{type:"button",role:"radio","aria-checked":a===x.value,disabled:i,"data-testid":`${l}-scope-${x.value}`,className:_("flex-1 rounded-md border border-line px-2 py-1 text-xs transition-colors hover:bg-bg-3/40 disabled:opacity-50",a===x.value&&"bg-bg-3 text-ink"),onClick:n(()=>c(x.value),"onClick"),children:x.label},x.value))}):null,d?(0,e.jsxs)("div",{className:"flex flex-col gap-0.5 px-1",children:[(0,e.jsxs)("p",{className:"text-xs text-ink-3","data-testid":`${l}-propagation`,children:[d.applied," of ",d.visited," subtasks updated",d.skipped>0?` · ${d.skipped} kept their own model`:""]}),d.limitReached?(0,e.jsx)("p",{className:"text-xs text-amber-600 dark:text-amber-400",role:"status","data-testid":`${l}-propagation-warning`,children:"Stopped at the safety limit; deeper subtasks were left unchanged."}):null]}):null]})}n(ot,"ModelOverrideSubtaskRows");function Ts(t,a=!1){const r=(0,u.useRef)(!1),[c,l]=(0,u.useState)(!1),[i,d]=(0,u.useState)(null);async function h(){if(!(!t||r.current||a)){r.current=!0,l(!0),d(null);try{await t()}catch(x){d(x instanceof Error?x.message:"Unable to stop. Try again.")}finally{r.current=!1,l(!1)}}}return n(h,"stop"),{stop:h,stopping:c||a,error:i}}n(Ts,"useComposerStop");var dt="wardmote:composer-effort";function Xt(t){try{const a=localStorage.getItem(`${dt}:${t}`);if(a===null)return;const r=JSON.parse(a);return r===null||typeof r=="string"?r:void 0}catch{return}}n(Xt,"getLastComposerEffort");function Ke(t,a){try{localStorage.setItem(`${dt}:${t}`,JSON.stringify(a))}catch{}}n(Ke,"rememberComposerEffort");function Ce({title:t,value:a,onClose:r,className:c}){return(0,e.jsxs)("div",{"data-mobile-sheet-header":"",className:_("hidden shrink-0 flex-col gap-1 border-b border-line/60 bg-bg-2 px-3 pb-2 pt-2 max-sm:flex",c),children:[(0,e.jsx)("div",{"aria-hidden":!0,className:"mx-auto h-1 w-10 shrink-0 rounded-full bg-line","data-mobile-sheet-handle":""}),(0,e.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,e.jsx)("span",{className:"shrink-0 text-sm font-medium",children:t}),a?(0,e.jsx)("span",{className:"min-w-0 flex-1 truncate text-right text-xs text-ink-3","data-mobile-sheet-value":"",children:a}):(0,e.jsx)("span",{className:"flex-1"}),r?(0,e.jsx)("button",{type:"button",onClick:r,"aria-label":`Close ${t} picker`,"data-mobile-sheet-close":"",className:"-mr-1 flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-ink-3 hover:bg-bg-3 hover:text-ink",children:(0,e.jsx)(Ne,{className:"h-4 w-4","aria-hidden":!0})}):null]})]})}n(Ce,"MobilePickerSheetHeader");var E="Agent default";function ct(t,a){const r=t.filter(l=>l.override);if(r.length>0)return r.map(l=>a(l,l.override)).join(" · ");const c=t.find(l=>l.key==="model");return c?.effective?a(c,c.effective):E}n(ct,"summarizeFields");function ut(t){return ct(t,(a,r)=>a.key==="model"?Se(W(r,a.options)):r)}n(ut,"triggerLabel");function mt({fields:t,className:a}){const r=t.filter(i=>i.override),c=t.find(i=>i.key==="model"),l=r.length>0?r.map(i=>({field:i,value:i.override})):c?.effective?[{field:c,value:c.effective}]:[];return l.length===0?(0,e.jsx)("span",{className:_("truncate",a),children:E}):(0,e.jsx)("span",{className:_("flex min-w-0 items-center gap-1",a),title:Zt(t),children:l.map(({field:i,value:d},h)=>(0,e.jsxs)(u.Fragment,{children:[h>0?(0,e.jsx)("span",{className:"shrink-0","aria-hidden":!0,children:"·"}):null,i.key==="model"?(0,e.jsx)(xe,{display:W(d,i.options),layout:"inline"}):(0,e.jsx)("span",{className:"shrink-0",children:d})]},i.key))})}n(mt,"RunSettingsSummary");function Zt(t){return ct(t,(a,r)=>r)}n(Zt,"triggerTitle");function es({field:t,pending:a,onSelect:r,collapsible:c,expanded:l,onToggle:i}){const[d,h]=(0,u.useState)(""),x=d.trim(),f=(0,u.useMemo)(()=>Ze(t.options.filter(m=>st(m,x))),[t.options,x]),w=t.effective?W(t.effective,t.options):null,S=t.agentDefault?W(t.agentDefault,t.options):null,z=t.freeText&&x.length>0&&!t.options.some(m=>m.value===x),C=!c||l;return(0,e.jsxs)("div",{className:_("flex min-w-0 flex-col gap-1 border-b border-line/60 p-2 last:border-b-0",C?"min-h-0 flex-1":"shrink-0"),"data-testid":`task-model-override-section-${t.key}`,"data-expanded":C?"true":"false",children:[(0,e.jsx)("div",{className:"flex items-baseline justify-between gap-2 px-1",children:c?(0,e.jsxs)("button",{type:"button",onClick:i,className:"flex min-w-0 flex-1 items-baseline justify-between gap-2 text-left","data-testid":`task-model-override-toggle-${t.key}`,"aria-expanded":C,children:[(0,e.jsx)("span",{className:"shrink-0 text-xs font-medium",children:t.label}),w?(0,e.jsx)(xe,{display:w,layout:"inline",className:"justify-end text-xs text-ink-3",testId:`task-model-override-effective-${t.key}`}):(0,e.jsx)("span",{className:"min-w-0 truncate text-xs text-ink-3","data-testid":`task-model-override-effective-${t.key}`,children:E})]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{className:"shrink-0 text-xs font-medium",children:t.label}),w?(0,e.jsx)(xe,{display:w,layout:"inline",className:"max-w-48 justify-end text-xs text-ink-3",testId:`task-model-override-effective-${t.key}`}):(0,e.jsx)("span",{className:"max-w-32 truncate text-xs text-ink-3","data-testid":`task-model-override-effective-${t.key}`,children:E})]})}),C&&(t.options.length>6||t.freeText)?(0,e.jsx)("input",{type:"text",value:d,onChange:n(m=>h(m.target.value),"onChange"),onKeyDown:n(m=>{m.key!=="Enter"||!z||(m.preventDefault(),r(t.key,x))},"onKeyDown"),placeholder:t.freeText?"Search or type a value…":"Search…",disabled:a,className:"h-8 w-full shrink-0 rounded-md border border-line-strong bg-transparent px-2 text-xs outline-none focus-visible:ring-1 focus-visible:ring-focus","data-testid":`task-model-override-search-${t.key}`}):null,C?(0,e.jsxs)("div",{"data-slot":"entity-option-list",className:"min-h-0 flex-1 overflow-y-auto overscroll-contain max-sm:max-h-none sm:max-h-48",children:[(0,e.jsxs)("button",{type:"button",disabled:a,onClick:n(()=>r(t.key,null),"onClick"),className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs hover:bg-bg-3 disabled:opacity-50","data-testid":`task-model-override-default-${t.key}`,children:[(0,e.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,e.jsx)("span",{className:"block truncate",children:E}),S?(0,e.jsx)("span",{className:"block truncate text-ink-3",title:S.id,"data-testid":`task-model-override-default-value-${t.key}`,children:Se(S)}):null]}),t.override===null?(0,e.jsx)(G,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":!0}):null]}),z?(0,e.jsx)("button",{type:"button",disabled:a,onClick:n(()=>r(t.key,x),"onClick"),className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs hover:bg-bg-3 disabled:opacity-50","data-testid":`task-model-override-custom-${t.key}`,children:(0,e.jsxs)("span",{className:"min-w-0 flex-1 truncate",children:["Use “",x,"”"]})}):null,f.map(m=>(0,e.jsxs)("div",{role:"group","aria-label":m.provider??void 0,children:[m.provider?(0,e.jsx)(tt,{provider:m.provider,testId:`task-model-override-group-${t.key}-${m.provider}`}):null,m.options.map(A=>(0,e.jsxs)("button",{type:"button",disabled:a,onClick:n(()=>r(t.key,A.value),"onClick"),className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs hover:bg-bg-3 disabled:opacity-50","data-testid":`task-model-override-option-${t.key}-${A.value}`,children:[(0,e.jsx)(et,{option:A}),t.override===A.value?(0,e.jsx)(G,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":!0}):null]},A.value))]},m.provider??""))]}):null]})}n(es,"FieldSection");var ts=["model","thinking"];function xt(t,a){if(!t)return[];const r=t.agents[0]?.current??{},c=[];for(const l of ts){const i=t.fields.find(x=>x.key===l);if(!i)continue;const d=r[l]??null,h=a[l]??null;c.push({key:l,label:i.label,hint:i.hint,freeText:i.freeText,options:i.options,agentDefault:d,override:h,effective:h??d})}return c}n(xt,"draftOverrideFields");function Os({issueId:t,draft:a,pendingIssue:r,footerSlot:c,subtaskRows:l=!1,disabled:i=!1,mobile:d=!1}){const h=Ve(),[x,f]=(0,u.useState)(!1),[w,S]=(0,u.useState)(null),[z,C]=(0,u.useState)(void 0),[m,A]=(0,u.useState)(null),[K,ae]=(0,u.useState)({}),P=(0,u.useRef)(null);we(x,{sheet:!0});const R=Ht(),D=a?null:t||m,$=a??r,ne=B.issues.modelOverride(D??"__none__"),Y=se({queryKey:ne,queryFn:n(()=>me.getModelOverride(D),"queryFn"),enabled:!!D,staleTime:3e4}),J=se({queryKey:B.agents.adapterConfigBatch($?.companyId??"__none__",$?.agentId?[$.agentId]:[]),queryFn:n(()=>ye.batchAdapterConfigPreview([$.agentId]),"queryFn"),enabled:!!$?.agentId&&!D,staleTime:6e4}),L=Ge({mutationFn:n(async p=>{let j=D;if(!j){if(!r)throw new Error("This conversation could not be opened.");P.current||(P.current=r.resolve().then(T=>(A(T),T),T=>{throw P.current=null,T instanceof Error?T:new Error("This conversation could not be opened.")})),j=await P.current}return{targetId:j,next:await me.setModelOverride(j,p)}},"mutationFn"),onSuccess:n(({targetId:p,next:j})=>{h.setQueryData(B.issues.modelOverride(p),j),S(null)},"onSuccess"),onError:n(p=>{S(p instanceof Error?p.message:"The override could not be saved.")},"onError")}),v=Y.data,re=a?.values,ie=J.data,Q=!!$&&!v?.fields.length,I=(0,u.useMemo)(()=>Q?xt(ie,re??K):v?.fields??[],[Q,ie,re,K,v]),b=!!a&&!a?.agentId;if(a){if(a.agentId&&J.isFetched&&I.length===0)return null}else if(D){if(!x&&(!v?.supported||v.fields.length===0))return null}else if(!r)return null;const y=L.isPending,M=I.some(p=>p.override),X=z===void 0?I[0]?.key??null:z;return(0,e.jsxs)(Je,{modal:R,open:x,onOpenChange:f,children:[(0,e.jsx)(We,{asChild:!0,children:(0,e.jsxs)("button",{type:"button",disabled:i||b,title:b?a.noAgentHint:"Model and thinking effort for this task",className:_("flex h-8 min-w-0 shrink items-center gap-1.5 rounded-md px-2.5 text-xs font-medium transition-colors hover:bg-bg-3 disabled:opacity-50",M?"text-ink":"text-ink-3"),"data-testid":"task-chat-composer-model-override","data-slot":"model-override-trigger","data-has-override":M?"true":"false",children:[b?(0,e.jsx)("span",{className:_("truncate",d?"max-w-20":"max-w-40"),children:E}):(0,e.jsx)(mt,{fields:I,className:d?"max-w-28":"max-w-56"}),y?(0,e.jsx)(je,{className:"h-3 w-3 shrink-0 animate-spin","aria-hidden":!0}):(0,e.jsx)(ue,{className:"h-3 w-3 shrink-0","aria-hidden":!0})]})}),(0,e.jsxs)(Ye,{align:"end",className:"w-(--sz-280px) max-w-(--sz-turn-status-popover) p-0","data-mobile-entity-picker":"","data-testid":"task-model-override-panel",children:[(0,e.jsx)(Ce,{title:"Task model",value:ut(I),onClose:n(()=>f(!1),"onClose")}),(0,e.jsxs)("div",{"data-mobile-sheet-body":"",className:"flex min-w-0 flex-col",children:[I.map(p=>(0,e.jsx)(es,{field:p,pending:y,collapsible:d,expanded:X===p.key,onToggle:n(()=>C(X===p.key?null:p.key),"onToggle"),onSelect:n((j,T)=>{if(a){a.onChange(j,T);return}if(!D){if(T===null&&!p.override)return;ae(le=>({...le,[j]:T}))}L.mutate({[j]:T})},"onSelect")},p.key)),I.length===0?(0,e.jsx)("p",{className:"px-3 py-2 text-xs text-ink-3","data-testid":"task-model-override-empty",children:v?.unsupportedReason??"Loading model options…"}):null]}),c?(0,e.jsx)("div",{"data-mobile-sheet-controls":"","data-testid":"task-model-override-footer",className:"shrink-0 border-t border-line/60",children:c}):l&&v?.inheritance?(0,e.jsx)("div",{"data-mobile-sheet-controls":"","data-testid":"task-model-override-footer",className:"shrink-0 border-t border-line/60",children:(0,e.jsx)(ot,{inheritToSubtasks:v.inheritance.inheritToSubtasks,subtaskScope:v.inheritance.subtaskScope,disabled:i||y,testIdPrefix:"task-model-override",propagation:v.propagation,onInheritChange:n(p=>L.mutate({inheritToSubtasks:p,subtaskScope:v.inheritance.subtaskScope}),"onInheritChange"),onScopeChange:n(p=>L.mutate({inheritToSubtasks:v.inheritance.inheritToSubtasks,subtaskScope:p}),"onScopeChange")})}):null,w?(0,e.jsx)("p",{className:"shrink-0 px-3 py-2 text-xs text-bad","data-testid":"task-model-override-error",children:w}):null]})]})}n(Os,"TaskModelOverrideControl");function _s(){const[t,a]=(0,u.useState)({}),r=(0,u.useCallback)((l,i)=>{a(d=>({...d,[l]:i}))},[]),c=(0,u.useCallback)(()=>a({}),[]);return{values:t,hasValues:Object.keys(t).length>0,set:r,clear:c}}n(_s,"useComposerRunSettingsStaging");function te(t){return t.startsWith("agent:")?t.slice(6):null}n(te,"agentIdOf");function ve(t){return t.override?t.options.findIndex(a=>a.value===t.override)+1:0}n(ve,"committedOptionIndex");function zs({issueId:t,pendingIssue:a,assigneeValue:r,currentAssigneeValue:c,options:l,onAssigneeChange:i,staging:d,renderAssigneeIdentity:h,subtaskRows:x=!1,draft:f=!1,companyId:w=null,footerSlot:S,triggerRef:z,disabled:C=!1,mobile:m=!1}){const A=Ve(),[K,ae]=(0,u.useState)(!1),[P,R]=(0,u.useState)("settings"),[D,$]=(0,u.useState)(""),[ne,Y]=(0,u.useState)(""),[J,L]=(0,u.useState)(null),[v,re]=(0,u.useState)(null),[ie,Q]=(0,u.useState)({}),I=(0,u.useRef)(null);we(K,{sheet:!0});const b=t||v,y=!!b&&r!==c,M=te(r),X=!!(b||a||f),p=X?f||y?M:b?null:M??a?.agentId??null:null,j=a?.companyId??"__composer__",T=se({queryKey:B.issues.modelOverride(b??"__none__"),queryFn:n(()=>me.getModelOverride(b),"queryFn"),enabled:!!b,staleTime:3e4}),le=(0,u.useRef)(c);(0,u.useEffect)(()=>{le.current!==c&&(le.current=c,b&&A.invalidateQueries({queryKey:B.issues.modelOverride(b)}))},[b,c,A]);const oe=se({queryKey:B.agents.adapterConfigBatch(j,p?[p]:[]),queryFn:n(()=>ye.batchAdapterConfigPreview([p]),"queryFn"),enabled:!!p,staleTime:6e4}),pe=(0,u.useMemo)(()=>l.flatMap(s=>te(s.id)?[te(s.id)]:[]),[l]),Ie=se({queryKey:B.agents.adapterConfigBatch(`${j}:roster`,pe),queryFn:n(()=>ye.batchAdapterConfigPreview(pe),"queryFn"),enabled:K&&pe.length>0,staleTime:6e4}),de=(0,u.useMemo)(()=>{const s=new Map;for(const o of Ie.data?.agents??[])s.set(o.agentId,o.adapterType);return s},[Ie.data]),Z=Ge({mutationFn:n(async s=>{let o=b;if(!o){if(!a)throw new Error("This conversation could not be opened.");I.current||(I.current=a.resolve().then(k=>(re(k),k),k=>{throw I.current=null,k instanceof Error?k:new Error("This conversation could not be opened.")})),o=await I.current}return{targetId:o,next:await me.setModelOverride(o,s)}},"mutationFn"),onSuccess:n(({targetId:s,next:o})=>{A.setQueryData(B.issues.modelOverride(s),o),L(null)},"onSuccess"),onError:n(s=>{L(s instanceof Error?s.message:"The override could not be saved.")},"onError")}),N=T.data,he=oe.data?.agents[0]?.adapterType??null,pt=(0,u.useMemo)(()=>{if(!y||!N||!he)return{};if(N.adapterType!==he)return{};const s={};for(const o of N.fields)o.override&&(s[o.key]=o.override);return s},[y,N,he]),Me=f?d.values:y?{...pt,...d.values}:ie,Te=!!p&&(y||!b),O=(0,u.useMemo)(()=>y&&!M?[]:Te?xt(oe.data,Me):N?.fields??[],[y,M,Te,oe.data,Me,N]),[Oe,_e]=(0,u.useState)({});(0,u.useEffect)(()=>{_e(s=>{const o={...s};let k=!1;for(const F of O)o[F.key]!==void 0&&o[F.key]===ve(F)&&(delete o[F.key],k=!0);return k?o:s})},[O]);const q=f?w:null,ze=d.values.thinking,Ae=d.set,be=O.find(s=>s.key==="thinking")?.options.map(s=>s.value).join(`
|
|
2
2
|
`)??"";(0,u.useEffect)(()=>{if(!q||ze!==void 0||!be)return;const s=Xt(q);s&&be.split(`
|
|
3
3
|
`).includes(s)&&Ae("thinking",s)},[q,ze,be,Ae]);const g=O.find(s=>s.key==="model"),ht=O.filter(s=>s.key!=="model"&&s.options.length>0),U=Z.isPending,De=O.some(s=>s.override),bt=O.length?ut(O):E,ft=(0,u.useMemo)(()=>[{id:"",label:"No assignee",searchText:"Unassigned"},...l.filter(s=>s.id!=="")],[l]),ee=l.find(s=>s.id===r)?.label??(r?"Unassigned":"No assignee");function $e(s,o){if(q&&s==="thinking"&&Ke(q,o),y||f){d.set(s,o);return}b||Q(k=>({...k,[s]:o})),Z.mutate({[s]:o})}n($e,"applyValue");function gt(){const s={};for(const o of O)o.override&&(s[o.key]=null);if(Object.keys(s).length!==0){if(q&&Ke(q,null),y||f){for(const o of Object.keys(s))d.set(o,null);return}b||Q(o=>({...o,...s})),Z.mutate(s)}}n(gt,"resetOverrides");function kt(s){s!==r&&(i(s||null),d.clear(),Q({})),R("settings"),Y("")}n(kt,"chooseAssignee");function ce(s){$e("model",s),R("settings"),$("")}n(ce,"chooseModel");const Ee=ne.trim().toLowerCase(),Pe=ft.filter(s=>{if(!Ee)return!0;const o=te(s.id),k=o?de.get(o)??"":"";return`${s.label} ${s.searchText??""} ${k}`.toLowerCase().includes(Ee)}),H=D.trim(),fe=g?.options??[],Re=fe.filter(s=>st(s,H)),vt=Ze(Re),ge=g?.agentDefault?W(g.agentDefault,fe):null,yt=fe.some(s=>s.value===H),ke=!!g?.freeText&&H.length>0&&!yt,jt=(0,e.jsxs)("div",{className:"flex min-w-0 flex-col gap-3 p-3",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsxs)("button",{type:"button","aria-label":"Choose assignee",onClick:n(()=>R("agents"),"onClick"),className:"flex min-w-0 flex-1 items-center gap-2 rounded-md px-1 py-1 text-left hover:bg-bg-3 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus","data-testid":"composer-run-settings-assignee-row",children:[h?.(r,ee,"option"),(0,e.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,e.jsx)("span",{className:"block truncate text-sm font-medium",children:ee}),(0,e.jsx)("span",{className:"block truncate text-xs text-ink-3",children:M?de.get(M)??"Agent":"Person"})]}),(0,e.jsx)(ue,{className:"size-4 shrink-0 text-ink-3","aria-hidden":!0})]}),(0,e.jsx)("button",{type:"button","aria-label":"Reset to agent default",title:"Reset to agent default",disabled:!De||U,onClick:gt,className:"grid size-8 shrink-0 place-items-center rounded-md text-ink-3 hover:bg-bg-3 disabled:opacity-40","data-testid":"composer-run-settings-reset",children:(0,e.jsx)(Rt,{className:"size-4","aria-hidden":!0})})]}),g?(0,e.jsxs)("button",{type:"button","aria-label":"Choose exact model",onClick:n(()=>R("model"),"onClick"),className:"flex w-full items-center gap-2 rounded-md px-1 py-1 text-left hover:bg-bg-3 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus","data-testid":"composer-run-settings-model-row",children:[(0,e.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,e.jsx)("span",{className:"block text-xs text-ink-3",children:g.label}),g.effective?(0,e.jsx)(xe,{display:W(g.effective,g.options),layout:"stacked",testId:"composer-run-settings-model-value"}):(0,e.jsx)("span",{className:"block truncate text-sm font-medium","data-testid":"composer-run-settings-model-value",children:E})]}),(0,e.jsx)(ue,{className:"size-4 shrink-0 text-ink-3","aria-hidden":!0})]}):null,ht.map(s=>{const o=Oe[s.key]??ve(s),k=(o===0?null:s.options[o-1]??null)?.label??"Agent default",F=n(()=>{const V=Oe[s.key];V===void 0||V===ve(s)||$e(s.key,V===0?null:s.options[V-1]?.value??null)},"commit");return(0,e.jsxs)("div",{className:"px-1",children:[(0,e.jsxs)("div",{className:"flex items-baseline justify-between gap-2",children:[(0,e.jsx)("span",{className:"text-xs text-ink-3",children:s.label}),(0,e.jsx)("span",{className:"min-w-0 truncate text-sm font-medium","data-testid":`composer-run-settings-value-${s.key}`,children:k})]}),(0,e.jsx)("input",{type:"range",min:0,max:s.options.length,step:1,value:o,"aria-label":s.label,"aria-valuetext":k,onChange:n(V=>{const St=Number(V.target.value);_e(Ct=>({...Ct,[s.key]:St}))},"onChange"),onPointerUp:F,onKeyUp:F,onBlur:F,className:"mt-2 w-full accent-accent","data-testid":`composer-run-settings-range-${s.key}`})]},s.key)}),O.length===0&&X&&!(f&&M&&oe.isFetched)?(0,e.jsx)("p",{className:"px-1 text-xs text-ink-3","data-testid":"composer-run-settings-empty",children:f&&!M?"Pick an agent assignee first":N?.unsupportedReason??"Loading model options…"}):null]}),Nt=(0,e.jsxs)("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col p-2",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 px-1 py-1.5",children:[(0,e.jsx)("button",{type:"button","aria-label":"Back to run settings",onClick:n(()=>R("settings"),"onClick"),className:"grid size-7 shrink-0 place-items-center rounded-md hover:bg-bg-3",children:(0,e.jsx)(Fe,{className:"size-4","aria-hidden":!0})}),(0,e.jsx)("span",{className:"min-w-0 flex-1 text-xs font-semibold",children:"Choose assignee"})]}),(0,e.jsxs)("div",{className:"relative mt-1 shrink-0",children:[(0,e.jsx)(qe,{className:"pointer-events-none absolute left-2.5 top-2.5 size-4 text-ink-3","aria-hidden":!0}),(0,e.jsx)("input",{type:"search","aria-label":"Search assignees",placeholder:"Search assignees…",value:ne,onChange:n(s=>Y(s.target.value),"onChange"),className:"h-9 w-full rounded-md border border-line-strong bg-transparent pl-8 pr-2 text-sm outline-none focus-visible:ring-1 focus-visible:ring-focus","data-testid":"composer-run-settings-assignee-search"})]}),(0,e.jsxs)("div",{"data-slot":"entity-option-list",className:"mt-2 min-h-0 flex-1 overflow-y-auto overscroll-contain sm:max-h-60",role:"listbox","aria-label":"Assignees",children:[Pe.map(s=>{const o=te(s.id);return(0,e.jsxs)("button",{type:"button",role:"option","aria-selected":s.id===r,onClick:n(()=>kt(s.id),"onClick"),className:"flex w-full items-center gap-2 rounded-md px-2 py-2 text-left hover:bg-bg-3",children:[h?.(s.id,s.label,"option"),(0,e.jsx)("span",{className:"min-w-0 flex-1 truncate text-sm",children:s.label}),o&&de.get(o)?(0,e.jsx)("span",{className:"shrink-0 truncate text-xs text-ink-3",children:de.get(o)}):null,s.id===r?(0,e.jsx)(G,{className:"size-4 shrink-0","aria-hidden":!0}):null]},s.id)}),Pe.length===0?(0,e.jsx)("p",{className:"px-2 py-2 text-xs text-ink-3",children:"No matches."}):null]})]}),wt=(0,e.jsxs)("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col p-2",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 px-1 py-1.5",children:[(0,e.jsx)("button",{type:"button","aria-label":"Back to run settings",onClick:n(()=>R("settings"),"onClick"),className:"grid size-7 shrink-0 place-items-center rounded-md hover:bg-bg-3",children:(0,e.jsx)(Fe,{className:"size-4","aria-hidden":!0})}),(0,e.jsx)("span",{className:"min-w-0 flex-1 text-xs font-semibold",children:g?.label??"Model"})]}),(0,e.jsxs)("div",{className:"relative mt-1 shrink-0",children:[(0,e.jsx)(qe,{className:"pointer-events-none absolute left-2.5 top-2.5 size-4 text-ink-3","aria-hidden":!0}),(0,e.jsx)("input",{type:"search","aria-label":"Search or paste a model ID",placeholder:g?.freeText?"Search or paste a model ID":"Search models…",value:D,onChange:n(s=>$(s.target.value),"onChange"),onKeyDown:n(s=>{s.key!=="Enter"||!ke||(s.preventDefault(),ce(H))},"onKeyDown"),className:"h-9 w-full rounded-md border border-line-strong bg-transparent pl-8 pr-2 text-sm outline-none focus-visible:ring-1 focus-visible:ring-focus","data-testid":"composer-run-settings-model-search"})]}),(0,e.jsxs)("div",{"data-slot":"entity-option-list",className:"mt-2 min-h-0 flex-1 overflow-y-auto overscroll-contain sm:max-h-60",role:"listbox","aria-label":"Models",children:[(0,e.jsxs)("button",{type:"button",role:"option","aria-selected":!g?.override,disabled:U,onClick:n(()=>ce(null),"onClick"),className:"flex w-full items-center gap-2 rounded-md px-2 py-2 text-left text-sm hover:bg-bg-3 disabled:opacity-50","data-testid":"composer-run-settings-model-default",children:[(0,e.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,e.jsx)("span",{className:"block truncate",children:E}),ge?(0,e.jsx)("span",{className:"block truncate text-xs text-ink-3",title:ge.id,"data-testid":"composer-run-settings-model-default-value",children:Se(ge)}):null]}),g?.override?null:(0,e.jsx)(G,{className:"size-4 shrink-0","aria-hidden":!0})]}),vt.map(s=>(0,e.jsxs)("div",{role:"group","aria-label":s.provider??void 0,children:[s.provider?(0,e.jsx)(tt,{provider:s.provider,testId:`composer-run-settings-model-group-${s.provider}`}):null,s.options.map(o=>(0,e.jsxs)("button",{type:"button",role:"option","aria-selected":g?.override===o.value,disabled:U,onClick:n(()=>ce(o.value),"onClick"),className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm hover:bg-bg-3 disabled:opacity-50","data-testid":`composer-run-settings-model-option-${o.value}`,children:[(0,e.jsx)(et,{option:o}),g?.override===o.value?(0,e.jsx)(G,{className:"size-4 shrink-0","aria-hidden":!0}):null]},o.value))]},s.provider??"")),Re.length===0&&!ke?(0,e.jsx)("p",{className:"px-2 py-2 text-xs text-ink-3",children:"No catalog match."}):null]}),ke?(0,e.jsxs)("button",{type:"button",disabled:U,onClick:n(()=>ce(H),"onClick"),className:"mt-2 flex shrink-0 items-center gap-2 rounded-md border-t border-line/60 px-2 py-2 text-left text-sm hover:bg-bg-3 disabled:opacity-50","data-testid":"composer-run-settings-model-custom",children:[(0,e.jsx)(Xe,{className:"size-4 shrink-0","aria-hidden":!0}),(0,e.jsxs)("span",{className:"min-w-0 flex-1 truncate",children:["Use exact ID ",(0,e.jsx)("span",{className:"font-medium",children:H})]})]}):null]});return(0,e.jsxs)(Je,{modal:!0,open:K,onOpenChange:n(s=>{ae(s),!s&&(R("settings"),$(""),Y(""))},"onOpenChange"),children:[(0,e.jsx)(We,{asChild:!0,children:(0,e.jsxs)("button",{ref:z,type:"button",disabled:C,"aria-label":"Select assignee, model and thinking",className:"flex h-8 min-w-0 max-w-80 shrink items-center gap-1.5 rounded-md px-2.5 text-xs font-medium transition-colors hover:bg-bg-3 disabled:opacity-50","data-testid":"task-chat-composer-assignee","data-slot":"model-override-trigger","data-has-override":De?"true":"false",children:[h?.(r,ee,"trigger"),(0,e.jsx)("span",{className:_("truncate",m?"max-w-20":"max-w-32"),"data-testid":"task-chat-composer-assignee-label",children:ee}),(0,e.jsx)("span",{className:"shrink-0 text-ink-3","aria-hidden":!0,children:"·"}),(0,e.jsx)("span",{className:_("min-w-0 truncate text-ink-3",m&&"sr-only"),"data-testid":"task-chat-composer-run-summary",children:O.length?(0,e.jsx)(mt,{fields:O}):E}),U?(0,e.jsx)(je,{className:"size-3 shrink-0 animate-spin","aria-hidden":!0}):(0,e.jsx)(ue,{className:"size-3 shrink-0 text-ink-3","aria-hidden":!0})]})}),(0,e.jsxs)(Ye,{align:"end",side:"top",className:"w-(--sz-300px) max-w-full p-0","data-mobile-entity-picker":"","data-testid":"composer-run-settings-panel",children:[(0,e.jsx)(Ce,{title:"Run settings",value:`${ee} · ${bt}`,onClose:n(()=>ae(!1),"onClose")}),(0,e.jsx)("div",{"data-mobile-sheet-body":"",className:"flex min-w-0 flex-col",children:P==="settings"?jt:P==="agents"?Nt:wt}),P==="settings"&&!x&&S?(0,e.jsx)("div",{"data-mobile-sheet-controls":"","data-testid":"composer-run-settings-footer",className:"shrink-0 border-t border-line/60",children:S}):null,P==="settings"&&x&&N?.inheritance?(0,e.jsx)("div",{"data-mobile-sheet-controls":"","data-testid":"composer-run-settings-footer",className:"shrink-0 border-t border-line/60",children:(0,e.jsx)(ot,{inheritToSubtasks:N.inheritance.inheritToSubtasks,subtaskScope:N.inheritance.subtaskScope,disabled:C||U,testIdPrefix:"task-model-override",propagation:N.propagation,onInheritChange:n(s=>Z.mutate({inheritToSubtasks:s,subtaskScope:N.inheritance.subtaskScope}),"onInheritChange"),onScopeChange:n(s=>Z.mutate({inheritToSubtasks:N.inheritance.inheritToSubtasks,subtaskScope:s}),"onScopeChange")})}):null,J?(0,e.jsx)("p",{className:"shrink-0 px-3 py-2 text-xs text-bad","data-testid":"composer-run-settings-error",children:J}):null]})]})}n(zs,"ComposerRunSettingsPicker");function As({scope:t,resumeHref:a,hasDraft:r=!1,pending:c=!1,error:l,onResume:i}){const d=(0,u.useId)(),h=t==="subtree";return(0,e.jsxs)("section",{"aria-labelledby":d,"aria-busy":c,"data-testid":"paused-composer-takeover",className:"flex flex-col gap-4 rounded-(--radius-task-composer) border border-(--status-agent-paused)/40 bg-(--status-agent-paused)/10 p-(--sz-18px)",children:[(0,e.jsxs)("div",{className:"flex items-start gap-3",children:[(0,e.jsx)(Pt,{"aria-hidden":"true",className:"mt-0.5 size-4 shrink-0 text-(--status-task-icon-todo)"}),(0,e.jsxs)("div",{className:"flex min-w-0 flex-col gap-1",children:[(0,e.jsx)("h2",{id:d,className:"text-sm font-medium text-ink",children:h?"Subtree is paused.":"Task is paused."}),(0,e.jsx)("p",{className:"text-sm text-ink-3",children:h?"Resume this subtree to send a message.":"Resume this task to send a message."})]})]}),l?(0,e.jsx)("p",{role:"alert",className:"text-sm text-bad",children:l}):null,(0,e.jsxs)("div",{className:"flex flex-wrap items-center justify-end gap-3",children:[r?(0,e.jsx)("p",{className:"mr-auto text-xs text-ink-3",children:"Your draft is saved."}):null,a?(0,e.jsx)(Be,{asChild:!0,size:"sm",children:(0,e.jsxs)(zt,{to:a,children:[(0,e.jsx)(Le,{"aria-hidden":"true"}),"Resume subtree"]})}):(0,e.jsxs)(Be,{size:"sm",disabled:c||!i,onClick:i,children:[c?(0,e.jsx)(je,{"aria-hidden":"true",className:"animate-spin"}):(0,e.jsx)(Le,{"aria-hidden":"true"}),c?"Resuming…":h?"Resume subtree":"Resume task"]})]})]})}n(As,"TaskChatPausedTakeover");function Ds({mode:t,onModeChange:a,onAttachFile:r,attachDisabled:c,onGoal:l,privacy:i,disabled:d,mobile:h=!1,triggerTestId:x,menuTestId:f}){const[w,S]=(0,u.useState)(!1);Ut();const z=(0,u.useRef)(!1);if(we(w,{sheet:!0}),!a&&!r&&!l&&!i)return null;const C=[...r?[{id:"composer-add-file",label:"Files and images",Icon:Kt,select:r,disabled:c}]:[],...i?[{id:"composer-add-private",label:"Private task",detail:i.inherited,Icon:He,select:n(()=>i.onChange(!i.private),"select"),selected:i.private,disabled:!!i.inherited}]:[],...l?[{id:"composer-add-goal",label:"Goal",detail:"Keep pursuing",Icon:_t,select:l}]:[],...a?[{id:"composer-add-plan",label:"Plan mode",detail:"Plan before acting",Icon:nt,select:n(()=>a(t==="planning"?"standard":"planning"),"select"),selected:t==="planning"},{id:"composer-add-ask",label:"Ask mode",detail:"Answer without changes",Icon:it,select:n(()=>a(t==="ask"?"standard":"ask"),"select"),selected:t==="ask"}]:[]];return(0,e.jsxs)(Et,{open:w,onOpenChange:S,children:[(0,e.jsx)(Dt,{asChild:!0,children:(0,e.jsx)("button",{type:"button","aria-label":"Add to composer","aria-keyshortcuts":a?"Meta+Period Control+Period Shift+Tab":void 0,disabled:d,"data-testid":x,"data-slot":"icon-button",className:"flex size-8 shrink-0 items-center justify-center rounded-md text-ink-3 transition-colors hover:bg-bg-3 hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus disabled:opacity-50",children:(0,e.jsx)(Xe,{className:"size-4","aria-hidden":!0})})}),(0,e.jsxs)($t,{side:"top",align:"start",sideOffset:8,"data-mobile-entity-picker":"","data-testid":f,className:"w-(--sz-300px) max-w-full rounded-xl p-1.5 shadow-sm",onCloseAutoFocus:n(m=>{z.current&&(m.preventDefault(),z.current=!1)},"onCloseAutoFocus"),children:[(0,e.jsx)(Ce,{title:"Add",onClose:n(()=>S(!1),"onClose")}),(0,e.jsxs)("div",{"data-mobile-sheet-body":"",className:"flex min-w-0 flex-col",children:[(0,e.jsx)("div",{className:"px-2 py-1 text-xs text-ink-3 max-sm:hidden",children:"Add"}),(0,e.jsx)("div",{"data-slot":"entity-option-list",className:"min-w-0",children:C.map(m=>(0,e.jsxs)(At,{onSelect:n(()=>{z.current=m.id==="composer-add-goal",m.select()},"onSelect"),disabled:m.disabled,"data-testid":m.id,className:_(h&&"min-h-11"),children:[(0,e.jsx)(m.Icon,{className:"size-4 shrink-0 text-ink-3","aria-hidden":!0}),(0,e.jsxs)("span",{className:"flex min-w-0 flex-1 items-baseline gap-2",children:[(0,e.jsx)("span",{children:m.label}),m.detail?(0,e.jsx)("span",{className:"truncate text-xs text-ink-3",children:m.detail}):null]}),m.selected?(0,e.jsx)(G,{className:"size-4 shrink-0 text-ink-3","aria-hidden":!0}):null]},m.id))})]})]})]})}n(Ds,"ComposerAddMenu");function $s({mode:t,onRemove:a,disabled:r,testId:c,mobile:l=!1}){if(t==="standard")return null;const i=Yt(t),d=i.icon;return(0,e.jsxs)("button",{type:"button",onClick:a,disabled:r||!a,"aria-label":`Remove ${i.label}`,"data-pending-work-mode":t,"data-slot":"task-chat-mode-trigger","data-testid":c,className:_("inline-flex h-8 shrink-0 items-center rounded-full border text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus disabled:opacity-50",l?"gap-1 px-2":"gap-1 px-2 sm:gap-1.5 sm:px-2.5",i.classes.chip),children:[(0,e.jsx)(d,{className:"size-3.5","aria-hidden":!0}),(0,e.jsx)("span",{className:l?"sr-only":"max-sm:sr-only",children:i.label}),(0,e.jsx)(Ne,{className:"size-3.5","aria-hidden":!0})]})}n($s,"ComposerModeChip");function Es({inherited:t,onRemove:a,disabled:r}){const[c,l]=(0,u.useState)(!1),i=t??"Only you and people you share with can read this task";return(0,e.jsx)(Lt,{children:(0,e.jsxs)(qt,{open:c,onOpenChange:l,children:[(0,e.jsx)(Ft,{asChild:!0,children:(0,e.jsx)("span",{className:"inline-flex shrink-0",role:t?"button":void 0,tabIndex:t?0:void 0,"aria-label":t?i:void 0,onClick:t?d=>{d.preventDefault(),l(!0)}:void 0,onKeyDown:t?d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),l(!0))}:void 0,children:(0,e.jsxs)("button",{type:"button",onClick:a,"aria-label":t?"Private task":"Remove private task",title:i,disabled:r||!!t,"data-testid":"composer-private-chip",className:"inline-flex h-8 shrink-0 items-center gap-1 rounded-full border border-line bg-bg-3 px-2 text-xs font-medium text-ink transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus disabled:pointer-events-none disabled:opacity-50",children:[(0,e.jsx)(He,{className:"size-3.5","aria-hidden":!0}),(0,e.jsx)("span",{className:"max-sm:sr-only",children:"Private"}),t?null:(0,e.jsx)(Ne,{className:"size-3.5","aria-hidden":!0})]})})}),(0,e.jsx)(Bt,{className:"max-w-xs",children:i})]})})}n(Es,"ComposerPrivacyChip");export{zs as a,Ts as c,Ms as d,Yt as f,As as i,ot as l,$s as n,_s as o,nt as p,Es as r,Os as s,Ds as t,Is as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var Q=Object.defineProperty;var o=(n,r)=>Q(n,"name",{value:r,configurable:!0});import{i as B,n as $}from"./rolldown-runtime-ZpX3ckPj.js";import{na as z,ta as L}from"./createLucideIcon-DJi9suAC.js";import{X as H,_ as R,n as X,t as g,v as G}from"./queryKeys-DYV5MhM_.js";import{b as J,g as U,v as V}from"./ConnectionSetupFlow-
|
|
1
|
+
var Q=Object.defineProperty;var o=(n,r)=>Q(n,"name",{value:r,configurable:!0});import{i as B,n as $}from"./rolldown-runtime-ZpX3ckPj.js";import{na as z,ta as L}from"./createLucideIcon-DJi9suAC.js";import{X as H,_ as R,n as X,t as g,v as G}from"./queryKeys-DYV5MhM_.js";import{b as J,g as U,v as V}from"./ConnectionSetupFlow-BaarToKu.js";import{t as q}from"./button-CMwV3L1P.js";import{t as W}from"./agents-DmlgUVso.js";import{a as Y,i as Z,n as ee,r as te,s as ne,t as oe}from"./dialog-CKUblzlR.js";import{t as re}from"./input-DobnTAyB.js";import{d as se}from"./model-picker-fields-235ien8Z.js";import{t as S}from"./InlineBanner-VQ5mstsR.js";import{a as _}from"./agent-config-primitives-BsZUnbf2.js";import{sa as ae}from"./index-3AxqhPET.js";var Ae=$({ConfigureBuiltInAgentModal:o(()=>ue,"ConfigureBuiltInAgentModal")}),d=B(z(),1),t=B(L(),1);function ie(n){return!["process","command","http"].includes(n)}o(ie,"isModelBasedAdapter");function le(n){return n.definition.defaultAdapterType??n.definition.allowedAdapterTypes?.[0]??"omp_local"}o(le,"defaultAdapterType");function de(n){const r=n.trim();if(!r)return;const i=Math.round(Number(r)*100);return Number.isFinite(i)&&i>=0?i:void 0}o(de,"parseBudgetMonthlyCents");function ue({companyId:n,state:r,open:i,onOpenChange:f,onConfigured:D}){const h=H(),{definition:s}=r,[a,T]=(0,d.useState)(()=>r.agent?.adapterType??le(r)),[c,v]=(0,d.useState)(()=>{const e=r.agent?.adapterConfig,l=typeof e=="object"&&e!==null?e.model:null;if(typeof l=="string")return l;const N=r.definition.defaultAdapterConfig?.model;return typeof N=="string"?N:""}),[P,k]=(0,d.useState)(!1),[x,F]=(0,d.useState)(()=>{const e=s.defaultBudgetMonthlyCents??0;return e>0?String(e/100):""}),[j,M]=(0,d.useState)(null),K=(0,d.useMemo)(()=>{const e=new Set(s.allowedAdapterTypes??[]);return new Set(J().map(l=>l.value).filter(l=>e.size>0&&!e.has(l)))},[s.allowedAdapterTypes]),u=ie(a),{data:O}=G({queryKey:g.agents.adapterModels(n,a,null),queryFn:o(()=>W.adapterModels(n,a,{}),"queryFn"),enabled:i&&!!n&&u}),y=O??[],C=u,m=c.trim(),A=!m||y.length===0||y.some(e=>e.id===m),w=A?null:`Model “${m}” is not available for ${a}. Choose a known model.`,b=de(x),E=(!x.trim()||b!==void 0)&&A&&(u?!C||m.length>0:!0),I=u?`Configure & enable ${s.displayName}`:`Provision ${s.displayName}`,p=R({mutationFn:o(async()=>{const e={};return c.trim()&&(e.model=c.trim()),await ae.provision(n,s.key,{adapterType:a,adapterConfig:e,...b!==void 0?{budgetMonthlyCents:b}:{}})},"mutationFn"),onSuccess:o(e=>{h.invalidateQueries({queryKey:g.builtInAgents.list(n)}),h.invalidateQueries({queryKey:g.agents.list(n)}),e.agentId&&h.invalidateQueries({queryKey:g.agents.detail(e.agentId)}),D?.(e),f(!1)},"onSuccess"),onError:o(e=>{M(e instanceof X?e.message:"Failed to configure the built-in agent.")},"onError")});return(0,t.jsx)(oe,{open:i,onOpenChange:o(e=>p.isPending?void 0:f(e),"onOpenChange"),children:(0,t.jsxs)(ee,{className:"sm:max-w-lg",children:[(0,t.jsxs)(Y,{children:[(0,t.jsxs)(ne,{children:["Set up the ",s.displayName]}),(0,t.jsx)(te,{children:s.shortPurpose})]}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)(S,{tone:"info",compact:!0,children:["Creates ",(0,t.jsx)("strong",{children:s.displayName})," in your roster, badged"," ",(0,t.jsx)("strong",{children:"Built-in"}),". Organizations that require hire approval will queue this for the board."]}),(0,t.jsx)(_,{label:"Adapter type",children:(0,t.jsx)(U,{value:a,onChange:o(e=>{T(e),v("")},"onChange"),disabledTypes:K})}),C&&(0,t.jsx)(V,{models:y,value:c,onChange:v,open:P,onOpenChange:k,allowDefault:!0,required:!0,groupByProvider:!1,preserveOrder:se(a),creatable:!0}),w&&(0,t.jsx)("p",{className:"text-sm text-bad",role:"alert",children:w}),!u&&(0,t.jsx)(S,{tone:"warning",compact:!0,children:"This adapter needs command or endpoint fields before it can run. Provision the built-in row now, then finish those fields from the full agent configuration."}),(0,t.jsx)(_,{label:"Monthly budget (optional)",hint:"Leave blank for no cap.",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm text-ink-3",children:"$"}),(0,t.jsx)(re,{type:"number",min:"0",step:"1",inputMode:"decimal",placeholder:"0",value:x,onChange:o(e=>F(e.target.value),"onChange"),className:"w-32"}),(0,t.jsx)("span",{className:"text-sm text-ink-3",children:"/ month"})]})}),j&&(0,t.jsx)("p",{className:"text-sm text-bad",role:"alert",children:j})]}),(0,t.jsxs)(Z,{children:[(0,t.jsx)(q,{variant:"ghost",onClick:o(()=>f(!1),"onClick"),disabled:p.isPending,children:"Not now"}),(0,t.jsx)(q,{onClick:o(()=>{M(null),p.mutate()},"onClick"),disabled:!E||p.isPending,children:p.isPending?"Configuring…":I})]})]})})}o(ue,"ConfigureBuiltInAgentModal");export{Ae as n,ue as t};
|