@microvac/ui 0.0.0-stage → 0.1.0-rc.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (609) hide show
  1. package/README.md +29 -2
  2. package/dist/android-chrome-192x192.png +0 -0
  3. package/dist/android-chrome-512x512.png +0 -0
  4. package/dist/announcement-preview.svg +11 -0
  5. package/dist/apple-touch-icon.png +0 -0
  6. package/dist/assets/ActiveAgentsPanel-BEx06tMt.js +1 -0
  7. package/dist/assets/AdapterManager-3kEEQWFJ.js +1 -0
  8. package/dist/assets/AdvancedToolsRoute-CgS6B-oh.js +39 -0
  9. package/dist/assets/AgentActionButtons-Cz3jCEd7.js +1 -0
  10. package/dist/assets/AgentAdvancedTab-BG6ZIAuN.js +131 -0
  11. package/dist/assets/AgentBulkSettingsSheet-BrrbvspS.js +1 -0
  12. package/dist/assets/AgentChat-Dw9iXD6H.js +1 -0
  13. package/dist/assets/AgentDetailPage-CuVIHv_q.js +39 -0
  14. package/dist/assets/AgentIdentityChip-BrVCcuHQ.js +1 -0
  15. package/dist/assets/AgentRosterFilters-GQ2bdXfW.js +2 -0
  16. package/dist/assets/Agents-clrVQnvc.js +2 -0
  17. package/dist/assets/Agents.production-DTopo7XB.js +2 -0
  18. package/dist/assets/AnimatedDialogContent-CDLfw-dJ.js +1 -0
  19. package/dist/assets/AppDetail-BcWBg5yW.js +1 -0
  20. package/dist/assets/AppNotConnected-NgfyHZ4L.js +1 -0
  21. package/dist/assets/ApprovalDetail-Dm_1V4tC.js +1 -0
  22. package/dist/assets/Approvals-i5AB3JPj.js +1 -0
  23. package/dist/assets/AppsConnect-D660Tpuo.js +1 -0
  24. package/dist/assets/AppsReview-DdTqOisY.js +1 -0
  25. package/dist/assets/ArtifactEmptyGraphic-DzxCruYA.js +1 -0
  26. package/dist/assets/Artifacts-CkXBz6nh.js +1 -0
  27. package/dist/assets/AssigneePickerInner-BNjyABBe.js +1 -0
  28. package/dist/assets/AssistantConnection-CNF6mDmO.js +1 -0
  29. package/dist/assets/AttentionInlineVerbs-BiyZ1ekZ.js +1 -0
  30. package/dist/assets/AttentionQueueRow-Bh0dKHpF.js +1 -0
  31. package/dist/assets/AuditHub-BK848cb4.js +1 -0
  32. package/dist/assets/AuditRuns-CUdlbP7S.js +1 -0
  33. package/dist/assets/Auth-DDqxm5gD.js +3 -0
  34. package/dist/assets/BoardChat-fvKqk0R7.js +18 -0
  35. package/dist/assets/BoardClaim-BEC5BZfz.js +1 -0
  36. package/dist/assets/BootstrapSetupUxLab-CXzErrin.js +1 -0
  37. package/dist/assets/Browse-DoovSMuF.js +1 -0
  38. package/dist/assets/BudgetPolicyCard-BYMlczCq.js +1 -0
  39. package/dist/assets/CaseDetail-UMAcSH_x.js +1 -0
  40. package/dist/assets/CaseStatus-BI0aMl9l.js +1 -0
  41. package/dist/assets/Cases-CMTkGghU.js +1 -0
  42. package/dist/assets/ChatEndpointDetail-CocNEInH.js +5 -0
  43. package/dist/assets/ChatEndpointSetup-Cyi2tI9K.js +1 -0
  44. package/dist/assets/ChatIdentityConfirm-Ba3JuTX1.js +1 -0
  45. package/dist/assets/CliAuth-D2jnueGH.js +1 -0
  46. package/dist/assets/Companies-K75I9dJs.js +1 -0
  47. package/dist/assets/CompanyAccess-Cw6nLUhE.js +1 -0
  48. package/dist/assets/CompanyActivity-BsgmVpWS.js +1 -0
  49. package/dist/assets/CompanyActivity.production-w-KGxvo6.js +1 -0
  50. package/dist/assets/CompanyConnections-yRPYSdm7.js +1 -0
  51. package/dist/assets/CompanyEnvironments-BA7kWdOJ.js +35 -0
  52. package/dist/assets/CompanyEnvironments-BrP-ENHg.css +1 -0
  53. package/dist/assets/CompanyExport-DfsK4b9c.js +4 -0
  54. package/dist/assets/CompanyImport-DJHAsmSF.js +1 -0
  55. package/dist/assets/CompanySettings-DwzHGXec.js +1 -0
  56. package/dist/assets/CompanySettingsPluginPage-Bpa81PF3.js +1 -0
  57. package/dist/assets/CompanySkills-eTqgbqQN.js +10 -0
  58. package/dist/assets/CompanySkills.production-CQSWfH0r.js +10 -0
  59. package/dist/assets/ConfigureBuiltInAgentModal-DgeD7t_i.js +1 -0
  60. package/dist/assets/CopyableGatewayUrl-B6K3rOal.js +1 -0
  61. package/dist/assets/CordisPluginSettings-DD3AnD2G.js +1 -0
  62. package/dist/assets/Costs-orBM8T-a.js +1 -0
  63. package/dist/assets/CrossIssueCollaborationUxLab-Bv9y9-NE.js +1 -0
  64. package/dist/assets/Dashboard-CrSBNKX1.js +2 -0
  65. package/dist/assets/DashboardLive-Cg8C9RiS.js +1 -0
  66. package/dist/assets/DecisionDateChips-BLZKZH71.js +1 -0
  67. package/dist/assets/DecisionHistoryPanel-yK-CP7Qg.js +1 -0
  68. package/dist/assets/DecisionQueuePage-BKXbERai.js +1 -0
  69. package/dist/assets/DesignGuide-2FswNsXz.js +25 -0
  70. package/dist/assets/DesignSandboxTaskThread-CGU--FXR.js +28 -0
  71. package/dist/assets/EmailConnectionAccess-CZ5QRKyg.js +1 -0
  72. package/dist/assets/EmailEndpointSetup-BI2vsd8Y.js +1 -0
  73. package/dist/assets/EnforcementBanner-B-iX466h.js +1 -0
  74. package/dist/assets/EntityRow-BsICt6pd.js +1 -0
  75. package/dist/assets/ExecutionWorkspaceDetail-CMqR9puh.js +19 -0
  76. package/dist/assets/ExternalAgentInviteDialog-De30ZrLP.js +50 -0
  77. package/dist/assets/FilterBar-rCmsTtG4.js +1 -0
  78. package/dist/assets/FolderControls-CmnB7Ap-.js +1 -0
  79. package/dist/assets/GatewayDetail-Duw9pJ10.js +2 -0
  80. package/dist/assets/GatewaysList-BBhVGhRq.js +1 -0
  81. package/dist/assets/GitHubConnectionRecovery-6VshLoNV.js +1 -0
  82. package/dist/assets/GoalDetail-CahntjlI.js +1 -0
  83. package/dist/assets/GoalTree-CU4GBFCh.js +1 -0
  84. package/dist/assets/Goals-CzM2NDFR.js +1 -0
  85. package/dist/assets/InstanceAccess-CZzkE65W.js +1 -0
  86. package/dist/assets/InstanceExperimentalSettings-DWumKtOK.js +1 -0
  87. package/dist/assets/InviteLanding-BIy2z50u.js +1 -0
  88. package/dist/assets/IssueChatLongThreadPerf-D4DJvdOG.js +2 -0
  89. package/dist/assets/JoinRequestQueue-C5rauGYm.js +1 -0
  90. package/dist/assets/Layout.production-BSDWnupa.js +1 -0
  91. package/dist/assets/McpConnect-BN8ST0RS.js +1 -0
  92. package/dist/assets/MembershipAction-DTjhGn-L.js +1 -0
  93. package/dist/assets/MetricCard-CeL9Pdn5.js +1 -0
  94. package/dist/assets/MissingPluginTabPlaceholder-CbQiSVnZ.js +1 -0
  95. package/dist/assets/NewAgent-BszrNpQk.js +1 -0
  96. package/dist/assets/NewAgentDialog-U9qAcTzc.js +1 -0
  97. package/dist/assets/NewGoalDialog-DqKbk4-i.js +1 -0
  98. package/dist/assets/NewProjectDialog-DrlUAF-N.js +1 -0
  99. package/dist/assets/OnboardingPrimitives-BkgPF4Mu.js +1 -0
  100. package/dist/assets/OnboardingWizard-CMBMcuXv.js +2 -0
  101. package/dist/assets/OrgChart.production-BLczTjRj.js +1 -0
  102. package/dist/assets/PaperclipCloudOAuthHandoff-BTtF8UPD.js +1 -0
  103. package/dist/assets/PluginManager-CCcqlfgK.js +1 -0
  104. package/dist/assets/PluginPage-B1empV69.js +1 -0
  105. package/dist/assets/PluginSettings-DtopaRqR.js +1 -0
  106. package/dist/assets/ProfileDetailRoute-BqvVpBZi.js +1 -0
  107. package/dist/assets/ProfileSettings-5__tVfGi.js +1 -0
  108. package/dist/assets/ProfileWizardRoute-vt-MRLuD.js +1 -0
  109. package/dist/assets/ProjectDetail-DJ4zjube.js +1 -0
  110. package/dist/assets/ProjectRepositoryInput-BJcnj3At.js +1 -0
  111. package/dist/assets/ProjectWorkspaceDetail-DEAO3q6v.js +29 -0
  112. package/dist/assets/ProjectWorkspacesContent-CZvO7p0i.js +1 -0
  113. package/dist/assets/Projects-Dm7-zXUH.js +1 -0
  114. package/dist/assets/QuotaBar-Drp3CaxX.js +1 -0
  115. package/dist/assets/RepositoryEditor-BT_VAkJu.js +1 -0
  116. package/dist/assets/Responsibilities-DbUEtGZu.js +4 -0
  117. package/dist/assets/ResponsibilityDetail--S8_GOkb.js +1 -0
  118. package/dist/assets/ResponsibleUserDenialUxLab-1PB3JNG0.js +1 -0
  119. package/dist/assets/ReviewQueueCard-B8w9aXKU.js +1 -0
  120. package/dist/assets/RoutineAuditActivity-BCo7pYe5.js +1 -0
  121. package/dist/assets/RoutineDetail-C9Dwn5G9.js +2 -0
  122. package/dist/assets/RoutineRunVariablesDialog-Baomcbe3.js +1 -0
  123. package/dist/assets/Routines-Dkv4gJno.js +1 -0
  124. package/dist/assets/Routines.production-Cs2Y-lpt.js +1 -0
  125. package/dist/assets/RoutinesToolbar-BNKfCrTo.js +1 -0
  126. package/dist/assets/Search-CVx4cl2o.js +1 -0
  127. package/dist/assets/Secrets-C2qv2HKZ.js +4 -0
  128. package/dist/assets/SkillBinaryFile-DDkhLlfC.js +1 -0
  129. package/dist/assets/SkillCardIcon-Cp_hws0N.js +2 -0
  130. package/dist/assets/SkillFolderTree-Cv0CmfYx.js +1 -0
  131. package/dist/assets/SkillSourceTree-DmjlUswf.js +2 -0
  132. package/dist/assets/SkillSources-nmlYypUU.js +2 -0
  133. package/dist/assets/SkillStudio-BK3y_3zr.js +9 -0
  134. package/dist/assets/SkillsNavigationTabs-DRwMP1eu.js +1 -0
  135. package/dist/assets/SpekoPhoneCallback-Cqi7AIyH.js +1 -0
  136. package/dist/assets/SpekoProviderSetup-CJI4oXk5.js +1 -0
  137. package/dist/assets/StatusCards-DKyyY81S.js +1 -0
  138. package/dist/assets/SummarySlotCard-f3RomdZS.js +1 -0
  139. package/dist/assets/TailscaleConnector-yQWLR1Ra.js +1 -0
  140. package/dist/assets/TaskChatLab-Dsr7eyj4.js +11 -0
  141. package/dist/assets/TaskSummaryList-eFDfK_QH.js +1 -0
  142. package/dist/assets/Timeline-BWA9dyk6.js +1 -0
  143. package/dist/assets/ToolsAdminGate-DpBg30hQ.js +1 -0
  144. package/dist/assets/TrustPresetSection-DtWjK9Kp.js +1 -0
  145. package/dist/assets/UserProfile-C66UI5xx.js +1 -0
  146. package/dist/assets/WebhookUrlWarning-CDygVnDH.js +1 -0
  147. package/dist/assets/WhatNeedsMe-BQ82RHus.js +1 -0
  148. package/dist/assets/Workspaces-DrjJes30.js +1 -0
  149. package/dist/assets/abnfDiagram-YUKMZFIV-Crkksu2D.js +1 -0
  150. package/dist/assets/apl-MHzTCvfx.js +1 -0
  151. package/dist/assets/arc-Dnq9Aszq.js +1 -0
  152. package/dist/assets/architecture-WOLXFQ4H-bHU8FW0c.js +1 -0
  153. package/dist/assets/architectureDiagram-47P4ROYG-Bj5Styf9.js +36 -0
  154. package/dist/assets/array-CL5Tisss.js +1 -0
  155. package/dist/assets/arrow-down-left-Ck9VQyqQ.js +1 -0
  156. package/dist/assets/asciiarmor-DFLNSgns.js +1 -0
  157. package/dist/assets/asn1-CfPVWRYE.js +1 -0
  158. package/dist/assets/asterisk-CJ4OeA7Y.js +1 -0
  159. package/dist/assets/blockDiagram-E7TT5TSB-OeHpNCQ-.js +140 -0
  160. package/dist/assets/brainfuck-NEHkmXMc.js +1 -0
  161. package/dist/assets/budgets-CAWPqcn4.js +1 -0
  162. package/dist/assets/building-complex-Dxiyk_pH.js +1 -0
  163. package/dist/assets/c4Diagram-CRA5TL53-QbK5p76P.js +38 -0
  164. package/dist/assets/channel-BSmZkKA8.js +1 -0
  165. package/dist/assets/character-CguPM7IG.js +1 -0
  166. package/dist/assets/chat-channels-CzTZV2fr.js +1 -0
  167. package/dist/assets/chunk-2BW5OAIV-Ckr4HfBO.js +10 -0
  168. package/dist/assets/chunk-2Q5K7J3B-CkPHWFj-.js +1 -0
  169. package/dist/assets/chunk-3YJQHVM4-C_uoPpLR.js +2 -0
  170. package/dist/assets/chunk-4EA7E6EY-BeMEfIRS.js +1 -0
  171. package/dist/assets/chunk-5VM5RSS4-2H3r6wq0.js +15 -0
  172. package/dist/assets/chunk-7TKQ45FW-DiwqWHvN.js +1 -0
  173. package/dist/assets/chunk-AW2ZBBNX-Cf57K3PO.js +88 -0
  174. package/dist/assets/chunk-DBDB3WZW-B2qouVQO.js +1 -0
  175. package/dist/assets/chunk-DUW6YSOI-slPglwIh.js +1 -0
  176. package/dist/assets/chunk-E2ZNV5FY-DG8wQ_NS.js +70 -0
  177. package/dist/assets/chunk-EU5HNXII-cxRrXRGV.js +213 -0
  178. package/dist/assets/chunk-FVRAUYC3-Dizswk0V.js +2 -0
  179. package/dist/assets/chunk-HJ2JQQFS-DL4lnpSv.js +1 -0
  180. package/dist/assets/chunk-HTAEGDNF-Zxjdb6kj.js +1 -0
  181. package/dist/assets/chunk-J5ZVWO5B-ClU583ja.js +1 -0
  182. package/dist/assets/chunk-JWPE2WC7--HEGjv3t.js +1 -0
  183. package/dist/assets/chunk-KQW6MTUR-BsVaJdnu.js +1 -0
  184. package/dist/assets/chunk-NGNAAXSQ-e5XI1hSt.js +128 -0
  185. package/dist/assets/chunk-NTY3LDVX-DyT9N5sM.js +1 -0
  186. package/dist/assets/chunk-VPRB5NB3-BNz5CtBn.js +129 -0
  187. package/dist/assets/chunk-XC4XBNZT-CCgIhjYS.js +62 -0
  188. package/dist/assets/chunk-XXDRQBXY-BdWplhUD.js +1 -0
  189. package/dist/assets/chunk-Y2CYZVJY-OvsAdhaO.js +1 -0
  190. package/dist/assets/circle-slash-uNv_ha0X.js +1 -0
  191. package/dist/assets/classDiagram-v2-K4WV4PDN-Cdh3CEl4.js +217 -0
  192. package/dist/assets/clike-CIx9nZSv.js +1 -0
  193. package/dist/assets/clojure-DFaIEz5O.js +1 -0
  194. package/dist/assets/cmake-koz-qBlo.js +1 -0
  195. package/dist/assets/cobol-Bo8Zw9gB.js +1 -0
  196. package/dist/assets/coffeescript-CXYzYf-Y.js +1 -0
  197. package/dist/assets/coins-BDAh8hDQ.js +1 -0
  198. package/dist/assets/collections-B58p51lw.js +3 -0
  199. package/dist/assets/commonlisp-C4OOCwkD.js +1 -0
  200. package/dist/assets/company-skill-routes-D5LJ1l8M.js +1 -0
  201. package/dist/assets/company-skill-summary-DnWVmP1S.js +1 -0
  202. package/dist/assets/configuration-warnings-CZKSfHJv.js +2 -0
  203. package/dist/assets/connection-owner-D8fNrFqC.js +1 -0
  204. package/dist/assets/cose-bilkent-JH36ORCC-DFyVDb92.js +1 -0
  205. package/dist/assets/crystal-BlJXQDvy.js +1 -0
  206. package/dist/assets/css-DEZwfVpY.js +1 -0
  207. package/dist/assets/cynefin-EF2NZ3EQ-BkwhfqJ0.js +1 -0
  208. package/dist/assets/cynefinDiagram-3GCD6N5R-DuGb_wq2.js +62 -0
  209. package/dist/assets/cypher-z2oFsVv2.js +1 -0
  210. package/dist/assets/cytoscape.esm-C2vp4vBx.js +321 -0
  211. package/dist/assets/d-Dkt6y7AQ.js +1 -0
  212. package/dist/assets/dagre-W4DXFKR2-Bxq_Mhia.js +4 -0
  213. package/dist/assets/defaultLocale-C2Bpu8Ih.js +1 -0
  214. package/dist/assets/definition-DxwMBXnu.js +1 -0
  215. package/dist/assets/diagram-2UJZ2QOL-B-P_hrXV.js +200 -0
  216. package/dist/assets/diagram-OVF4WLC6-Ds0BqQWH.js +24 -0
  217. package/dist/assets/diagram-PFPMY2P6-Dpqb2-Cb.js +30 -0
  218. package/dist/assets/diagram-UMYRVEAY-BJSoxjiu.js +24 -0
  219. package/dist/assets/diagram-YEKJPTXX-BxaG_9tT.js +41 -0
  220. package/dist/assets/diagram-ZIFT7M5P-6acvVOtc.js +3 -0
  221. package/dist/assets/diff-C60bAYOU.js +1 -0
  222. package/dist/assets/dist-0EWXio4m.js +1 -0
  223. package/dist/assets/dist-BGvZP_Cl.js +1 -0
  224. package/dist/assets/dist-BZ7AbEhN.js +1 -0
  225. package/dist/assets/dist-BlosHr86.js +6 -0
  226. package/dist/assets/dist-Bmr4uhSk.js +1 -0
  227. package/dist/assets/dist-C6yMfMNS.js +13 -0
  228. package/dist/assets/dist-CMZQedYl.js +1 -0
  229. package/dist/assets/dist-CTlCK4Pe.js +1 -0
  230. package/dist/assets/dist-C_N_-eaT.js +1 -0
  231. package/dist/assets/dist-CaUbG4Hl.js +1 -0
  232. package/dist/assets/dist-Cd7wdKYE.js +39 -0
  233. package/dist/assets/dist-Cn7-nxjU.js +1 -0
  234. package/dist/assets/dist-Cnj95_pX.js +1 -0
  235. package/dist/assets/dist-D9DR7k9k.js +3 -0
  236. package/dist/assets/dist-DIwsVdS2.js +2 -0
  237. package/dist/assets/dist-DVE0lLId.js +1 -0
  238. package/dist/assets/dist-DkAPL4CQ.js +1 -0
  239. package/dist/assets/dist-Dl6N3kpQ.js +1 -0
  240. package/dist/assets/dist-DmBvXBzK.js +1 -0
  241. package/dist/assets/dist-DpgXK0aZ.js +1 -0
  242. package/dist/assets/dist-gMRyU9GJ.js +7 -0
  243. package/dist/assets/dist-jQQX2kOU.js +1 -0
  244. package/dist/assets/dist-lUaUoFTq.js +1 -0
  245. package/dist/assets/dist-qw1ZF2vD.js +1 -0
  246. package/dist/assets/dist-rH4qrNAn.js +1 -0
  247. package/dist/assets/dockerfile-BttNdtK0.js +1 -0
  248. package/dist/assets/dtd-CCVZU5Da.js +1 -0
  249. package/dist/assets/dylan-3pmV5wzs.js +1 -0
  250. package/dist/assets/ebnf-bm-I2WIh.js +1 -0
  251. package/dist/assets/ebnfDiagram-VR2GEFS7-Ytj3Z5qC.js +1 -0
  252. package/dist/assets/ecl-BIv3PrZb.js +1 -0
  253. package/dist/assets/eiffel-DuLnr4-r.js +1 -0
  254. package/dist/assets/elk-IJKZMXRS-CJurNqqK.js +25 -0
  255. package/dist/assets/elm-njbaCU-L.js +1 -0
  256. package/dist/assets/erDiagram-O2IAPWRE-hyXckW2d.js +99 -0
  257. package/dist/assets/erlang-CuhOC2I8.js +1 -0
  258. package/dist/assets/eventmodeling-K75KTNOO-D3xQujrh.js +1 -0
  259. package/dist/assets/factor-CM3-9V3b.js +1 -0
  260. package/dist/assets/fcl-nWsMJ92o.js +1 -0
  261. package/dist/assets/flowDiagram-OXPTDLAJ-D4ojBTuY.js +1 -0
  262. package/dist/assets/folder-plus-BJZSMzuj.js +1 -0
  263. package/dist/assets/forth-BQ9HrCVY.js +1 -0
  264. package/dist/assets/fortran-DHJe28ev.js +1 -0
  265. package/dist/assets/ganttDiagram-R7TSEDQI-C8U_ITl4.js +292 -0
  266. package/dist/assets/gas-ByO0qYMr.js +1 -0
  267. package/dist/assets/gherkin-CwOmHL5K.js +1 -0
  268. package/dist/assets/gitGraph-VSP46ZUC-CDeq3yKT.js +1 -0
  269. package/dist/assets/gitGraphDiagram-XJZIOB7I-CST3EWE9.js +106 -0
  270. package/dist/assets/goals-BNJZ4nzg.js +1 -0
  271. package/dist/assets/googleAccessRemoval-CQIi1dvu.js +1 -0
  272. package/dist/assets/graphlib-DHhK3saS.js +1 -0
  273. package/dist/assets/groovy-ByXGF8cx.js +1 -0
  274. package/dist/assets/haskell-CHSpCNOy.js +1 -0
  275. package/dist/assets/haxe-P2jh68ck.js +1 -0
  276. package/dist/assets/http-0jwMmfWP.js +1 -0
  277. package/dist/assets/idl-DTVVj6r5.js +1 -0
  278. package/dist/assets/index-BJtnP7H1.js +706 -0
  279. package/dist/assets/index-z7lcCz2I.css +1 -0
  280. package/dist/assets/info-OHQRW6UA-CPvTWk7J.js +1 -0
  281. package/dist/assets/infoDiagram-5W2HQ5XZ-BPUiNdxI.js +2 -0
  282. package/dist/assets/init-BXPE0p7i.js +1 -0
  283. package/dist/assets/invite-memory-BKdqfr5K.js +1 -0
  284. package/dist/assets/ishikawaDiagram-K3B6WC7H-D5Z3rmaA.js +70 -0
  285. package/dist/assets/issue-detail-CZfjXs0M.js +119 -0
  286. package/dist/assets/javascript-Cblpdx44.js +1 -0
  287. package/dist/assets/journeyDiagram-COXZFDF6-CEkwEYdR.js +139 -0
  288. package/dist/assets/julia-KVJvUu_F.js +1 -0
  289. package/dist/assets/kanban-definition-P3RFRI5V-8h_R6Qjq.js +89 -0
  290. package/dist/assets/katex-Du_FPwxl.js +257 -0
  291. package/dist/assets/line-Ljt_vfsb.js +1 -0
  292. package/dist/assets/linear-BRQgexd0.js +1 -0
  293. package/dist/assets/link-DvgFK0mz.js +1 -0
  294. package/dist/assets/list-filter-BR4_dvwm.js +1 -0
  295. package/dist/assets/livescript-DSHsJPcD.js +1 -0
  296. package/dist/assets/log-in-Dvx9-FMC.js +1 -0
  297. package/dist/assets/lua-Vher-70I.js +1 -0
  298. package/dist/assets/mathematica-CE9SaVsW.js +1 -0
  299. package/dist/assets/mbox-JGl1Fgvq.js +1 -0
  300. package/dist/assets/mcpSkills-76szK_k1.js +1 -0
  301. package/dist/assets/mermaid-parser.core-BjFu937m.js +7 -0
  302. package/dist/assets/mermaid.core-B0t95EIS.js +42 -0
  303. package/dist/assets/mindmap-definition-LZFPQGKD-TVnHYUR4.js +96 -0
  304. package/dist/assets/mirc-BGWbO906.js +1 -0
  305. package/dist/assets/mllike-DuNQsEw8.js +1 -0
  306. package/dist/assets/model-DL5biheO.js +1 -0
  307. package/dist/assets/modelica-5XCgKQt8.js +1 -0
  308. package/dist/assets/mscgen-mVFg19ri.js +1 -0
  309. package/dist/assets/mumps-C7oS353s.js +1 -0
  310. package/dist/assets/nginx-DXVlpyCz.js +1 -0
  311. package/dist/assets/nsis-KFC6hioG.js +1 -0
  312. package/dist/assets/ntriples-5ckCopnn.js +1 -0
  313. package/dist/assets/octave-D1J2QQNt.js +1 -0
  314. package/dist/assets/onboarding-state-C5_mIw3o.js +1 -0
  315. package/dist/assets/ordinal-BJyFM1v8.js +1 -0
  316. package/dist/assets/oz-CPsllMDD.js +1 -0
  317. package/dist/assets/packet-JDAUHWVQ-aNGiRWLy.js +1 -0
  318. package/dist/assets/palette-tokens-CL5ZDrEd.js +1 -0
  319. package/dist/assets/pascal-B-I6JP0Y.js +1 -0
  320. package/dist/assets/path-D6mommQw.js +1 -0
  321. package/dist/assets/pegDiagram-BGZESJAR-DDadxqWQ.js +1 -0
  322. package/dist/assets/perl-CI8WIWBi.js +1 -0
  323. package/dist/assets/pie-XZMESJXO-CydFP1hd.js +1 -0
  324. package/dist/assets/pieDiagram-CAPJLFHJ-KhdUDwDS.js +39 -0
  325. package/dist/assets/pig-FQI0W3S3.js +1 -0
  326. package/dist/assets/portable-files-CloN_vbk.js +1 -0
  327. package/dist/assets/power-sYV-WuqQ.js +1 -0
  328. package/dist/assets/powershell-BAu6x78A.js +1 -0
  329. package/dist/assets/prod-C6Q7tISe.js +495 -0
  330. package/dist/assets/profile-summary-D4LPX-Dv.js +1 -0
  331. package/dist/assets/properties-BKTTDgau.js +1 -0
  332. package/dist/assets/protobuf-UWh8gh_j.js +1 -0
  333. package/dist/assets/pug-C20tNwmy.js +1 -0
  334. package/dist/assets/puppet-BAHVzCkO.js +1 -0
  335. package/dist/assets/python-C2DOnsac.js +1 -0
  336. package/dist/assets/q-Cooe-Nh8.js +1 -0
  337. package/dist/assets/quadrantDiagram-GDMTTRAM-B1X8K2Fs.js +7 -0
  338. package/dist/assets/r-CktBKya9.js +1 -0
  339. package/dist/assets/radar-ABXABTNO-BqodkLpx.js +1 -0
  340. package/dist/assets/railroad-I3PHUGI6-HmRKXDJj.js +1 -0
  341. package/dist/assets/railroad-abnf-LNEFI6M7-CkBttaHp.js +1 -0
  342. package/dist/assets/railroad-ebnf-DWYD2UWJ-C6DBawFA.js +1 -0
  343. package/dist/assets/railroad-peg-JR7BVNR7-Z9df3u5o.js +1 -0
  344. package/dist/assets/railroadDiagram-SM67HX2B-2vDUUppL.js +1 -0
  345. package/dist/assets/requirementDiagram-X7JNWC4A-DAuP39Hc.js +84 -0
  346. package/dist/assets/rolldown-runtime-DhZMWcEn.js +1 -0
  347. package/dist/assets/rough.esm-DnC5Tr1g.js +1 -0
  348. package/dist/assets/rpm-Csj9nLHl.js +1 -0
  349. package/dist/assets/ruby-bGx9eo-K.js +1 -0
  350. package/dist/assets/runtime-IAg0vdY9.js +4137 -0
  351. package/dist/assets/sankeyDiagram-UM26HJRW-ByS54QZK.js +40 -0
  352. package/dist/assets/sas-Drou_EQ9.js +1 -0
  353. package/dist/assets/saved-permissions-CPiYtxkZ.js +1 -0
  354. package/dist/assets/scheme-DcjG9bAf.js +1 -0
  355. package/dist/assets/scroll-text-CVSt6aO2.js +1 -0
  356. package/dist/assets/sdk-vrG4HtB4.js +1 -0
  357. package/dist/assets/search-CG-QtPVH.js +1 -0
  358. package/dist/assets/send-CH-0xdLm.js +1 -0
  359. package/dist/assets/sequenceDiagram-ZO4K6R2Y-DvWxKTLK.js +169 -0
  360. package/dist/assets/shared-D37zfckm.js +1 -0
  361. package/dist/assets/shell-BSKClwid.js +1 -0
  362. package/dist/assets/sieve-CcvsXPZo.js +1 -0
  363. package/dist/assets/simple-mode-B79cVo-x.js +1 -0
  364. package/dist/assets/sizeCapture-INFHLROL-XURNLuv_.js +1 -0
  365. package/dist/assets/skill-source-connect-return-eFTeuj7y.js +1 -0
  366. package/dist/assets/smalltalk-Cmg-4mjQ.js +1 -0
  367. package/dist/assets/smoke-lab-matrix-C5gR81E3.js +1 -0
  368. package/dist/assets/solr-Dj8ahEwG.js +1 -0
  369. package/dist/assets/sparql-LAJYmgfk.js +1 -0
  370. package/dist/assets/spreadsheet-B8doD_pL.js +1 -0
  371. package/dist/assets/sql-C3kWxFGw.js +1 -0
  372. package/dist/assets/src-DYjgETqR.js +1 -0
  373. package/dist/assets/stateDiagram-v2-TBUQTH76-DtiiZIXq.js +291 -0
  374. package/dist/assets/stex-CW6K5Nmu.js +1 -0
  375. package/dist/assets/stylus-BS-Ienrc.js +1 -0
  376. package/dist/assets/swift-BD82LMDK.js +1 -0
  377. package/dist/assets/swimlanes-N4OXWK64-BWSEtCbX.js +1 -0
  378. package/dist/assets/swimlanesDiagram-K3J5GTZL-Bl_9DvHU.js +8 -0
  379. package/dist/assets/tcl-RZa1cqc-.js +1 -0
  380. package/dist/assets/textile-C-BY_OGF.js +1 -0
  381. package/dist/assets/tiddlywiki-C9bm_Oju.js +1 -0
  382. package/dist/assets/tiki-DJOT-rFT.js +1 -0
  383. package/dist/assets/timeline-definition-YOQAKGHF-U4QcniMh.js +120 -0
  384. package/dist/assets/toml-Civ2fTsu.js +1 -0
  385. package/dist/assets/treeView-D4JQ5SDB-B2tdrtsj.js +1 -0
  386. package/dist/assets/treemap-SAJKECNS-DodN8j4n.js +1 -0
  387. package/dist/assets/troff-Lns35Xcq.js +1 -0
  388. package/dist/assets/ttcn-7vlxVTUK.js +1 -0
  389. package/dist/assets/ttcn-cfg-B8qhhp6o.js +1 -0
  390. package/dist/assets/turtle-DTIS1YQ7.js +1 -0
  391. package/dist/assets/useAgentlessOnboardingAutoOpen-DSWW7Juw.js +1 -0
  392. package/dist/assets/useAuthorizationWindow-tg3aKEU7.js +1 -0
  393. package/dist/assets/useDateRange-CnZQr2KO.js +1 -0
  394. package/dist/assets/useFastResponsesEnabled-B8tHSJ1y.js +1 -0
  395. package/dist/assets/usePageView-CtFMs34g.js +1 -0
  396. package/dist/assets/useProfilesData-CWHdMSuL.js +1 -0
  397. package/dist/assets/useReviewCount-W_bCZ2Hz.js +1 -0
  398. package/dist/assets/useRoutineFormOptions-CCLMmVSF.js +3 -0
  399. package/dist/assets/useSummaryDraftStream-NVNYNt72.js +3 -0
  400. package/dist/assets/useTailscaleConnections-Dy52nCY3.js +1 -0
  401. package/dist/assets/usecaseDiagram-VIAY4XPW-kEHhqgOj.js +362 -0
  402. package/dist/assets/vb-BO8UacKu.js +1 -0
  403. package/dist/assets/vbscript-DWLru3lT.js +1 -0
  404. package/dist/assets/velocity-BIIn-Nl2.js +1 -0
  405. package/dist/assets/vennDiagram-BLWOH2XV-NPJU0aCU.js +34 -0
  406. package/dist/assets/verilog-BVYlmXGg.js +1 -0
  407. package/dist/assets/vhdl-Cn8cC8Yb.js +1 -0
  408. package/dist/assets/wardley-7MLQ67FV-bUGKvIPT.js +1 -0
  409. package/dist/assets/wardleyDiagram-YMQ3BMBF-qtUDHfhb.js +78 -0
  410. package/dist/assets/webidl-ChvzbZ5-.js +1 -0
  411. package/dist/assets/xquery-BKN7qEbU.js +1 -0
  412. package/dist/assets/xychartDiagram-TAQBALBS-C-z57aZj.js +7 -0
  413. package/dist/assets/yacas-BG9ha7tU.js +1 -0
  414. package/dist/assets/z80-CB2cGLew.js +1 -0
  415. package/dist/brands/adapters/LICENSE +21 -0
  416. package/dist/brands/adapters/README.md +7 -0
  417. package/dist/brands/adapters/cursor-dark.svg +1 -0
  418. package/dist/brands/adapters/cursor.svg +1 -0
  419. package/dist/brands/adapters/gemini-color.svg +1 -0
  420. package/dist/brands/adapters/grok-dark.svg +1 -0
  421. package/dist/brands/adapters/grok.svg +1 -0
  422. package/dist/brands/adapters/hermesagent-dark.svg +1 -0
  423. package/dist/brands/adapters/hermesagent.svg +1 -0
  424. package/dist/brands/adapters/kimi-color-light.svg +1 -0
  425. package/dist/brands/adapters/kimi-color.svg +1 -0
  426. package/dist/brands/adapters/openai-dot.README.md +7 -0
  427. package/dist/brands/adapters/openai-dot.svg +3 -0
  428. package/dist/brands/adapters/pi-dark.svg +1 -0
  429. package/dist/brands/adapters/pi.svg +1 -0
  430. package/dist/brands/apps/1password-dark.svg +1 -0
  431. package/dist/brands/apps/1password.svg +1 -0
  432. package/dist/brands/apps/LOBE-LICENSE +21 -0
  433. package/dist/brands/apps/agentmail-dark.svg +16 -0
  434. package/dist/brands/apps/agentmail.svg +17 -0
  435. package/dist/brands/apps/airtable.svg +1 -0
  436. package/dist/brands/apps/anthropic-dark.svg +1 -0
  437. package/dist/brands/apps/anthropic.svg +1 -0
  438. package/dist/brands/apps/antigravity.svg +31 -0
  439. package/dist/brands/apps/api-key-generic.svg +1 -0
  440. package/dist/brands/apps/arcade.png +0 -0
  441. package/dist/brands/apps/asana.svg +12 -0
  442. package/dist/brands/apps/aws-dark.svg +1 -0
  443. package/dist/brands/apps/aws.svg +1 -0
  444. package/dist/brands/apps/bedrock.svg +1 -0
  445. package/dist/brands/apps/beehiiv.png +0 -0
  446. package/dist/brands/apps/bitly.svg +1 -0
  447. package/dist/brands/apps/box.svg +1 -0
  448. package/dist/brands/apps/braintrust-dark.png +0 -0
  449. package/dist/brands/apps/braintrust.png +0 -0
  450. package/dist/brands/apps/brex-dark.svg +1 -0
  451. package/dist/brands/apps/brex.svg +1 -0
  452. package/dist/brands/apps/browser-use.svg +6 -0
  453. package/dist/brands/apps/calendly.png +0 -0
  454. package/dist/brands/apps/candid.png +0 -0
  455. package/dist/brands/apps/circleback.png +0 -0
  456. package/dist/brands/apps/clickhouse-dark.svg +1 -0
  457. package/dist/brands/apps/clickhouse.svg +1 -0
  458. package/dist/brands/apps/clickup.png +0 -0
  459. package/dist/brands/apps/cloudflare.svg +1 -0
  460. package/dist/brands/apps/cloudinary-dark.svg +1 -0
  461. package/dist/brands/apps/cloudinary.svg +3 -0
  462. package/dist/brands/apps/coda.svg +1 -0
  463. package/dist/brands/apps/cognee.png +0 -0
  464. package/dist/brands/apps/composio-dark.svg +11 -0
  465. package/dist/brands/apps/composio.svg +16 -0
  466. package/dist/brands/apps/connection-pool.svg +1 -0
  467. package/dist/brands/apps/context7-dark.svg +8 -0
  468. package/dist/brands/apps/context7.svg +8 -0
  469. package/dist/brands/apps/daytona-dark.svg +1 -0
  470. package/dist/brands/apps/daytona.svg +1 -0
  471. package/dist/brands/apps/discord-dark.svg +1 -0
  472. package/dist/brands/apps/discord.svg +1 -0
  473. package/dist/brands/apps/ditto.png +0 -0
  474. package/dist/brands/apps/egnyte.svg +1 -0
  475. package/dist/brands/apps/embat.svg +1 -0
  476. package/dist/brands/apps/enterpret.png +0 -0
  477. package/dist/brands/apps/exa.svg +5 -0
  478. package/dist/brands/apps/executor.png +0 -0
  479. package/dist/brands/apps/firecrawl.svg +12 -0
  480. package/dist/brands/apps/fireflies.svg +76 -0
  481. package/dist/brands/apps/gauge.png +0 -0
  482. package/dist/brands/apps/github-copilot-dark.svg +1 -0
  483. package/dist/brands/apps/github-copilot.svg +1 -0
  484. package/dist/brands/apps/github-dark.svg +10 -0
  485. package/dist/brands/apps/github.svg +10 -0
  486. package/dist/brands/apps/gmail.svg +1 -0
  487. package/dist/brands/apps/google-calendar.svg +1 -0
  488. package/dist/brands/apps/google-chat.svg +1 -0
  489. package/dist/brands/apps/google-docs.svg +1 -0
  490. package/dist/brands/apps/google-drive.svg +1 -0
  491. package/dist/brands/apps/google-people.svg +1 -0
  492. package/dist/brands/apps/google-sheets.svg +1 -0
  493. package/dist/brands/apps/google-slides.svg +1 -0
  494. package/dist/brands/apps/google-workspace-search.svg +1 -0
  495. package/dist/brands/apps/google.svg +1 -0
  496. package/dist/brands/apps/gsc-wizard.png +0 -0
  497. package/dist/brands/apps/honcho.svg +33 -0
  498. package/dist/brands/apps/hugging-face.svg +8 -0
  499. package/dist/brands/apps/imessage-photon.png +0 -0
  500. package/dist/brands/apps/jam-dev-dark.svg +1 -0
  501. package/dist/brands/apps/jam-dev.svg +1 -0
  502. package/dist/brands/apps/jira-dark.svg +1 -0
  503. package/dist/brands/apps/jira.svg +4 -0
  504. package/dist/brands/apps/kernel.svg +3 -0
  505. package/dist/brands/apps/klaviyo.png +0 -0
  506. package/dist/brands/apps/linear-dark.svg +5 -0
  507. package/dist/brands/apps/linear.svg +5 -0
  508. package/dist/brands/apps/local-falcon.png +0 -0
  509. package/dist/brands/apps/make-dark.svg +1 -0
  510. package/dist/brands/apps/make.svg +1 -0
  511. package/dist/brands/apps/manifest.json +756 -0
  512. package/dist/brands/apps/manufact-dark.svg +6 -0
  513. package/dist/brands/apps/manufact.svg +5 -0
  514. package/dist/brands/apps/mem0.svg +1 -0
  515. package/dist/brands/apps/microsoft-teams.svg +68 -0
  516. package/dist/brands/apps/miro-dark.svg +1 -0
  517. package/dist/brands/apps/miro.svg +4 -0
  518. package/dist/brands/apps/mixpanel-dark.svg +1 -0
  519. package/dist/brands/apps/mixpanel.svg +1 -0
  520. package/dist/brands/apps/monday-dark.png +0 -0
  521. package/dist/brands/apps/monday.png +0 -0
  522. package/dist/brands/apps/neon.png +0 -0
  523. package/dist/brands/apps/netlify-dark.svg +1 -0
  524. package/dist/brands/apps/netlify.svg +16 -0
  525. package/dist/brands/apps/notion-dark.svg +1 -0
  526. package/dist/brands/apps/notion.svg +1 -0
  527. package/dist/brands/apps/oauth-generic.svg +1 -0
  528. package/dist/brands/apps/openai-dark.svg +1 -0
  529. package/dist/brands/apps/openai.svg +1 -0
  530. package/dist/brands/apps/openrouter-dark.svg +3 -0
  531. package/dist/brands/apps/openrouter.svg +3 -0
  532. package/dist/brands/apps/oreilly.svg +1 -0
  533. package/dist/brands/apps/pagerduty.svg +4 -0
  534. package/dist/brands/apps/paperclip-notebook-dark.svg +1 -0
  535. package/dist/brands/apps/paperclip-notebook.svg +1 -0
  536. package/dist/brands/apps/parallel-dark.svg +11 -0
  537. package/dist/brands/apps/parallel.svg +11 -0
  538. package/dist/brands/apps/planetscale-dark.svg +1 -0
  539. package/dist/brands/apps/planetscale.svg +1 -0
  540. package/dist/brands/apps/posthog-dark.svg +1 -0
  541. package/dist/brands/apps/posthog.svg +1 -0
  542. package/dist/brands/apps/postman.svg +1 -0
  543. package/dist/brands/apps/railway-dark.svg +1 -0
  544. package/dist/brands/apps/railway.svg +1 -0
  545. package/dist/brands/apps/razorpay-dark.svg +1 -0
  546. package/dist/brands/apps/razorpay.svg +1 -0
  547. package/dist/brands/apps/resend-dark.svg +1 -0
  548. package/dist/brands/apps/resend.svg +1 -0
  549. package/dist/brands/apps/sanity-dark.svg +1 -0
  550. package/dist/brands/apps/sanity.svg +1 -0
  551. package/dist/brands/apps/sentry-dark.svg +1 -0
  552. package/dist/brands/apps/sentry.svg +1 -0
  553. package/dist/brands/apps/shopify.svg +24 -0
  554. package/dist/brands/apps/similarweb-dark.svg +1 -0
  555. package/dist/brands/apps/similarweb.svg +1 -0
  556. package/dist/brands/apps/slack.png +0 -0
  557. package/dist/brands/apps/slack.svg +17 -0
  558. package/dist/brands/apps/speko.svg +16 -0
  559. package/dist/brands/apps/stripe.svg +11 -0
  560. package/dist/brands/apps/supabase.svg +15 -0
  561. package/dist/brands/apps/superagent.png +0 -0
  562. package/dist/brands/apps/supermemory.png +0 -0
  563. package/dist/brands/apps/tailscale.png +0 -0
  564. package/dist/brands/apps/tavily.png +0 -0
  565. package/dist/brands/apps/telegram.svg +12 -0
  566. package/dist/brands/apps/telem-dark.svg +9 -0
  567. package/dist/brands/apps/telem.svg +9 -0
  568. package/dist/brands/apps/ticket-tailor-dark.svg +1 -0
  569. package/dist/brands/apps/ticket-tailor.svg +1 -0
  570. package/dist/brands/apps/ticktick.svg +1 -0
  571. package/dist/brands/apps/todoist.svg +1 -0
  572. package/dist/brands/apps/unikraft.svg +1 -0
  573. package/dist/brands/apps/vercel-dark.svg +1 -0
  574. package/dist/brands/apps/vercel.svg +1 -0
  575. package/dist/brands/apps/webflow.svg +1 -0
  576. package/dist/brands/apps/windsor-ai.png +0 -0
  577. package/dist/brands/apps/wix-dark.svg +12 -0
  578. package/dist/brands/apps/wix.svg +12 -0
  579. package/dist/brands/apps/xai-dark.svg +1 -0
  580. package/dist/brands/apps/xai.svg +1 -0
  581. package/dist/brands/apps/xero.svg +1 -0
  582. package/dist/brands/apps/youcom-dark.svg +13 -0
  583. package/dist/brands/apps/youcom.svg +13 -0
  584. package/dist/brands/apps/zapier.svg +1 -0
  585. package/dist/brands/apps/zep.png +0 -0
  586. package/dist/brands/claude-color.svg +17 -0
  587. package/dist/brands/codex-color.svg +17 -0
  588. package/dist/brands/opencode-logo-dark-square.svg +18 -0
  589. package/dist/brands/opencode-logo-light-square.svg +18 -0
  590. package/dist/favicon-16x16.png +0 -0
  591. package/dist/favicon-32x32.png +0 -0
  592. package/dist/favicon.ico +0 -0
  593. package/dist/favicon.svg +7 -0
  594. package/dist/fonts/InterVariable-Italic.woff2 +0 -0
  595. package/dist/fonts/InterVariable.woff2 +0 -0
  596. package/dist/fonts/NOTICE.md +30 -0
  597. package/dist/fonts/PaperMono-OFL.txt +93 -0
  598. package/dist/fonts/PaperMono-Variable.woff2 +0 -0
  599. package/dist/index.html +165 -0
  600. package/dist/microvac-push-sw.js +37 -0
  601. package/dist/paperclip-thinking.svg +17 -0
  602. package/dist/site.webmanifest +30 -0
  603. package/dist/storybook/grok-comparison.csv +4 -0
  604. package/dist/sw.js +176 -0
  605. package/dist/worktree-favicon-16x16.png +0 -0
  606. package/dist/worktree-favicon-32x32.png +0 -0
  607. package/dist/worktree-favicon.ico +0 -0
  608. package/dist/worktree-favicon.svg +9 -0
  609. package/package.json +20 -4
@@ -0,0 +1 @@
1
+ var yt=Object.defineProperty;var s=(t,r)=>yt(t,"name",{value:r,configurable:!0});import{a as We}from"./rolldown-runtime-DhZMWcEn.js";import{Jt as kt,mi as He}from"./issue-detail-CZfjXs0M.js";import{t as Pe}from"./folder-plus-BJZSMzuj.js";import{$A as vt,$S as Nt,AC as Ct,Aw as St,DO as _t,ET as Rt,Ev as Pt,GS as Z,Gb as Ue,Gw as ze,H_ as U,IC as xe,IT as we,ME as Qe,MT as ke,NE as R,Nw as It,QT as se,Sp as Ve,TT as Lt,Tw as Ge,Wm as de,Ww as Ye,Yw as At,__ as pe,_v as J,_w as he,ab as Xe,bE as ve,cv as Je,dy as Tt,fy as Dt,gC as Mt,hC as Ie,hE as ue,hv as Et,iC as zt,jC as Ft,kT as fe,lC as Fe,ly as Ze,my as et,nT as $t,nj as Ot,on as $e,pE as tt,pm as Bt,pv as qt,qC as Le,qT as Ne,sy as st,tT as Kt,ub as rt,uy as nt,xE as ge,x_ as Wt,xv as Ht,xw as Ae,zE as O}from"./index-BJtnP7H1.js";import{t as le}from"./mcpSkills-76szK_k1.js";import{b as Te,g as at,h as De,m as Me,p as it,s as te}from"./FolderControls-CmnB7Ap-.js";import{a as Ut}from"./company-skill-routes-D5LJ1l8M.js";var lt={name:"circle-arrow-up",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]],aliases:["arrow-up-circle"]};lt.node;var Is=se(lt),ot={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"]};ot.node;var ct=se(ot),dt={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"}]]};dt.node;var Ls=se(dt),ut={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"}]]};ut.node;var As=se(ut),mt={name:"move-right",size:24,node:[["path",{d:"M18 8L22 12L18 16",key:"1r0oui"}],["path",{d:"M2 12H22",key:"1m8cig"}]]};mt.node;var Qt=se(mt),e=We(vt(),1);function Ts({skill:t}){const r=t.metadata?.skillSourceId??t.metadata?.legacySkillSourceId;if(typeof r!="string")return null;const n=t.metadata?.skillSourceState,i=t.metadata?.skillSourceId?n==="removed"?"Removed from source · last installed version retained":n==="not_syncing"?"Not syncing · installed copy retained":n==="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-muted-foreground",children:[(0,e.jsx)("span",{children:i}),(0,e.jsxs)("span",{className:"break-all font-mono",children:[String(t.metadata?.skillSourcePath??""),t.sourceRef?` · ${t.sourceRef.slice(0,8)}`:""]}),(0,e.jsx)(Ue,{to:`/skills/sources/${r}`,className:"text-foreground underline",children:"Manage source"})]})}s(Ts,"SkillSourceProvenance");var x=We(Ot(),1),Vt={pending_review:"Needs review",approved:"Approved",declined:"Declined",unavailable:"Not available"};function Gt(t){switch(t.statusReason){case"changed":return`${t.appName} changed this skill. Agents won't use it until you approve the new version.`;case"dynamic":return"This skill is generated each time it's used, so Microvac can't check its content. It isn't offered to agents.";case"too_large":return"This skill is bigger than apps can rely on (512 files or 16 MiB), so it isn't offered to agents.";case"invalid":return"This skill's listing doesn't follow the MCP skills format, so it isn't offered to agents.";case"verification_failed":return`${t.appName} sent files that didn't match what it listed, so Microvac stopped using this skill. Refresh the app to see its current version.`;case"removed":return`${t.appName} no longer offers this skill.`;default:return null}}s(Gt,"connectedAppSkillNote");function Yt({skills:t,pendingSkillId:r,preview:n,onPreview:i,onApprove:l,onDecline:o}){const[u,h]=(0,x.useState)({});if(!t.length)return null;const N=t.filter(a=>a.status==="pending_review").length;return(0,e.jsxs)("section",{"aria-labelledby":"connected-app-skills-heading",className:"mx-4 mt-4 rounded-lg border border-border",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-baseline justify-between gap-2 border-b border-border px-4 py-3",children:[(0,e.jsx)("h2",{id:"connected-app-skills-heading",className:"text-sm font-semibold",children:"Skills from connected apps"}),(0,e.jsxs)("p",{className:"text-xs text-muted-foreground",children:[N?`${N} waiting for review. `:"","Agents that use an app get its skills only after you approve them."]})]}),(0,e.jsx)("ul",{className:"divide-y divide-border",children:t.map(a=>{const y=Gt(a),g=a.status==="pending_review"||a.status==="declined",j=r===a.id,c=n?.skillId===a.id,k=!c||!!n?.markdown&&n?.manifestDigest===a.manifestDigest;return(0,e.jsxs)("li",{className:"flex flex-col gap-2 px-4 py-3",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsx)("span",{className:"font-medium",children:a.name}),(0,e.jsxs)("span",{className:"text-xs text-muted-foreground",children:["from ",a.appName]}),(0,e.jsx)(U,{variant:a.status==="pending_review"?"default":"outline",children:Vt[a.status]})]}),(0,e.jsx)("p",{className:"line-clamp-2 text-sm text-muted-foreground",children:a.description}),a.fileCount!==null&&a.totalBytes!==null?(0,e.jsxs)("p",{className:"text-xs text-muted-foreground",children:[a.fileCount===1?"1 file":`${a.fileCount} files`," · ",kt(a.totalBytes)]}):null,y?(0,e.jsx)("p",{className:"text-sm",children:y}):null,a.nameCollision?(0,e.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Another skill uses this name. Agents get this one under ",a.appName,"'s name, so neither replaces the other."]}):null,a.requestedTools.length?g?(0,e.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,e.jsx)(Ve,{checked:u[a.id]===!0,onCheckedChange:s(m=>h(b=>({...b,[a.id]:m===!0})),"onCheckedChange")}),"Also let it use: ",a.requestedTools.join(", ")]}):(0,e.jsxs)("p",{className:"text-xs text-muted-foreground",children:[a.allowedToolsApproved?"Can use":"Asked to use, not allowed",": ",a.requestedTools.join(", ")]}):null,a.status!=="unavailable"?(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[i?(0,e.jsx)(R,{size:"xs",variant:"ghost",onClick:s(()=>i(a),"onClick"),"aria-expanded":c,children:c?"Hide instructions":"Read instructions"}):null,g&&l?(0,e.jsx)(R,{size:"xs",disabled:j||!k,onClick:s(()=>l(a,u[a.id]===!0),"onClick"),children:"Approve"}):null,a.status!=="declined"&&o?(0,e.jsx)(R,{size:"xs",variant:"outline",disabled:j,onClick:s(()=>o(a),"onClick"),children:a.status==="approved"?"Turn off":"Decline"}):null]}):null,g?(0,e.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Approving lets agents that use ",a.appName," follow these instructions, including commands they describe."]}):null,c?n?.error?(0,e.jsx)("p",{className:"text-sm text-destructive",children:n.error}):n?.loading||!k?(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading instructions…"}):(0,e.jsx)("pre",{className:O("max-h-96 overflow-auto whitespace-pre-wrap rounded-md bg-muted p-3 font-mono text-xs",Nt),children:n?.markdown}):null]},a.id)})})]})}s(Yt,"ConnectedAppSkillsList");function Ds({companyId:t}){const r=Qe(),{pushToast:n}=Je(),[i,l]=(0,x.useState)(null),o=ge({queryKey:Z.mcpSkills.list(t??""),queryFn:s(()=>le.list(t),"queryFn"),enabled:!!t}),u=o.data?.find(c=>c.id===i)??null,h=ge({queryKey:Z.mcpSkills.content(t??"",i??"",u?.manifestDigest??""),queryFn:s(()=>le.content(t,i),"queryFn"),enabled:!!(t&&u?.manifestDigest)}),N=s(c=>k=>{n({tone:"error",title:c,body:ue(k).body}),r.invalidateQueries({queryKey:Z.mcpSkills.list(t??"")})},"reportError"),a=s(()=>r.invalidateQueries({queryKey:Z.mcpSkills.list(t??"")}),"refresh"),y=ve({mutationFn:s(({skill:c,allowTools:k})=>le.approve(t,c.id,{manifestDigest:c.manifestDigest,allowTools:k}),"mutationFn"),onSuccess:a,onError:N("Couldn't approve the skill")}),g=ve({mutationFn:s(c=>le.decline(t,c.id),"mutationFn"),onSuccess:a,onError:N("Couldn't update the skill")});if(o.error)return(0,e.jsxs)("p",{role:"alert",className:"mx-4 mt-4 text-sm text-destructive",children:["Couldn't load skills from connected apps. ",ue(o.error).body]});const j=y.isPending?y.variables?.skill.id:g.isPending?g.variables?.id:null;return(0,e.jsx)(Yt,{skills:o.data??[],pendingSkillId:j??null,preview:i?{skillId:i,manifestDigest:h.data?.manifestDigest,markdown:h.data?.markdown,loading:h.isLoading,error:h.error?ue(h.error).body:void 0}:null,onPreview:s(c=>l(k=>k===c.id?null:c.id),"onPreview"),onApprove:s((c,k)=>y.mutate({skill:c,allowTools:k}),"onApprove"),onDecline:s(c=>g.mutate(c),"onDecline")})}s(Ds,"ConnectedAppSkills");var Xt=["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 Jt="An organization administrator can change the skill policy to allow this.",Zt="This requires organization administration access. Ask an administrator to make this change.",es={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."},ts={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 Microvac 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 ss(t){return t&&typeof t=="object"?t:null}s(ss,"asRecord");function ye(t){return typeof t=="string"&&t.trim().length>0?t:null}s(ye,"asString");function rs(t,r){if(!(t instanceof tt))return null;const n=ss(t.body),i=ye(n?.code),l=ye(n?.reason),o=ye(n?.remediation);return i==="skill_policy_denied"||l==="explicit_rule"||l==="policy_default"?{state:"policy",code:i,reason:l,title:r?`${r} is restricted by your organization policy.`:"This action is restricted by your organization policy.",remediation:o??Jt}:i==="skill_policy_admin_required"?{state:"platform_admin",code:i,reason:l,title:"This change needs administration access.",remediation:o??Zt}:i!==null&&Xt.includes(i)||l==="platform_invariant"?{state:"platform",code:i,reason:l,title:(i&&es[i])??"This action is blocked by a platform safety rule.",remediation:o??(i&&ts[i])??"Fix the flagged issue and try again."}:null}s(rs,"classifySkillDenial");function Ms(){const[t,r]=(0,x.useState)(null);return{denial:t,capture:(0,x.useCallback)((n,i)=>{const l=rs(n,i);return l?(r(l),!0):!1},[]),reset:(0,x.useCallback)(()=>r(null),[])}}s(Ms,"useSkillPolicyDenial");function Es({denial:t,onDismiss:r,className:n}){const i=r?(0,e.jsx)(R,{variant:"ghost",size:"sm",onClick:r,children:"Dismiss"}):void 0;return(0,e.jsx)(Bt,{tone:"warning",icon:t.state==="policy"?Ct:Ie,title:t.title,actions:i,className:n,children:(0,e.jsx)("p",{children:t.remediation})})}s(Es,"SkillPolicyDenialNotice");var je=["./skills",".agents/skills",".claude/skills",".codex/skills",".cursor/skills"],xt=34;function X(t,r){return`${t} ${r}`}s(X,"selectionKey");function ns(t){return t.sourceType==="remote_managed"?!1:typeof t.cwd=="string"&&t.cwd.trim().length>0}s(ns,"isScannableWorkspace");function pt(t){return t.workspaces.filter(ns)}s(pt,"scannableWorkspaces");function as(t){switch(t){case"git_repo":return"git";case"local_path":return"local";case"non_git_path":return"folder";case"remote_managed":return"remote";default:return t}}s(as,"workspaceKindLabel");function is(t){return Array.from(new Set(t.map(r=>as(r.sourceType)))).join(", ")}s(is,"summarizeWorkspaceKinds");function me(t){return t.status==="new"||t.status==="conflict"}s(me,"isSelectableCandidate");function ls(t,r){const n=r.trim().toLowerCase();return n?t.filter(i=>[i.name,i.slug,i.description,i.relativePath,i.workspaceName,i.directoryRoot,i.status].some(l=>l?.toLowerCase().includes(n))):t}s(ls,"filterCandidates");function os(t,r=[]){const n=new Map(r.map(l=>[l.id,l])),i=new Map;for(const l of t){let o=i.get(l.workspaceId);o||(o={key:l.workspaceId,workspaceId:l.workspaceId,workspaceName:l.workspaceName,isPrimary:n.get(l.workspaceId)?.isPrimary??!1,directories:[]},i.set(l.workspaceId,o));let u=o.directories.find(h=>h.directoryRoot===l.directoryRoot);u||(u={key:`${l.workspaceId} ${l.directoryRoot}`,directoryRoot:l.directoryRoot,candidates:[]},o.directories.push(u)),u.candidates.push(l)}return Array.from(i.values()).map(l=>({...l,directories:l.directories.sort((o,u)=>o.directoryRoot.localeCompare(u.directoryRoot))})).sort((l,o)=>l.isPrimary!==o.isPrimary?l.isPrimary?-1:1:l.workspaceName.localeCompare(o.workspaceName))}s(os,"groupCandidates");function cs(t){return new Map}s(cs,"defaultSelection");function ds(t){const r=new Map;for(const n of t)n.status==="new"&&r.set(X(n.workspaceId,n.relativePath),{workspaceId:n.workspaceId,path:n.relativePath});return r}s(ds,"selectAllSelection");function Oe(t){return`${t.slug}-copy`}s(Oe,"suggestedConflictSlug");function Ce(t){if(t.slug===void 0)return!0;const r=t.slug.trim();return!!r&&_t(r)===r}s(Ce,"isValidSelectionSlug");function Se(t){return ue(t).body}s(Se,"readableErrorMessage");function us(t){return t instanceof tt?t.status===403:!1}s(us,"isGrantError");function ms({status:t}){switch(t){case"already_imported":return(0,e.jsxs)(U,{variant:"outline",className:"gap-1 px-1.5 py-0 font-normal text-muted-foreground border-border/60",children:[(0,e.jsx)(Ae,{className:"h-3 w-3"})," Imported"]});case"conflict":return(0,e.jsxs)(U,{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)(Ie,{className:"h-3 w-3"})," Conflict"]});case"skipped":return(0,e.jsxs)(U,{variant:"outline",className:"gap-1 px-1.5 py-0 font-normal text-muted-foreground border-border/60",children:[(0,e.jsx)(ct,{className:"h-3 w-3"})," Skipped"]});default:return(0,e.jsxs)(U,{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)(Lt,{className:"h-3 w-3"})," New"]})}}s(ms,"CandidateStatusBadge");function zs({open:t,onOpenChange:r,companyId:n,onImportFromPath:i}){const l=Qe(),o=Je(),[u,h]=(0,x.useState)("pick"),[N,a]=(0,x.useState)(""),[y,g]=(0,x.useState)(""),[j,c]=(0,x.useState)(null),[k,m]=(0,x.useState)(null),[b,v]=(0,x.useState)(null),[f,d]=(0,x.useState)(new Map),[I,F]=(0,x.useState)(null),[C,M]=(0,x.useState)(!1),[D,E]=(0,x.useState)(null),S=(0,x.useRef)(0),_=ge({...Wt(n),enabled:t}),z=rt(_);(0,x.useEffect)(()=>{t&&(h("pick"),a(""),g(""),c(null),m(null),v(null),d(new Map),F(null),M(!1),E(null),S.current+=1)},[t]);const A=_.data??[],G=(0,x.useMemo)(()=>{const w=N.trim().toLowerCase(),T=[...A].sort((L,K)=>L.name.localeCompare(K.name));return w?T.filter(L=>L.name.toLowerCase().includes(w)):T},[A,N]);function q(w){c(w),m(null),v(null),d(new Map),h("scanning");const T=++S.current;de.scanProjects(n,{projectIds:[w.id],mode:"preview"}).then(L=>{T===S.current&&(m(L),d(cs(L.candidates)),h("select"))}).catch(L=>{T===S.current&&(v(L),h("select"))})}s(q,"startScan");const W=ve({mutationFn:s(()=>{if(!j)throw new Error("No project selected.");const w=Array.from(f.values());return de.scanProjects(n,{projectIds:[j.id],mode:"import",selection:w})},"mutationFn"),onSuccess:s(async w=>{F(w),h("result"),await l.invalidateQueries({queryKey:Z.companySkills.list(n)});const T=w.imported.length;o.pushToast({tone:T>0?"success":"warn",title:T>0?"Skills imported":"Nothing imported",body:T>0?`${T} skill${T===1?"":"s"} imported as references from ${j?.name??"the project"}.`:"No skills were imported."})},"onSuccess"),onError:s(w=>{o.pushToast({tone:"error",title:"Import failed",body:Se(w)})},"onError")}),B=k?.candidates??[],Q=(0,x.useMemo)(()=>B.filter(me),[B]),Y=(0,x.useMemo)(()=>ls(B,y),[y,B]),p=(0,x.useMemo)(()=>os(Y,j?.workspaces??[]),[Y,j]),P=f.size,$=Array.from(f.values()).some(w=>!Ce(w));function re(w){me(w)&&d(T=>{const L=new Map(T),K=X(w.workspaceId,w.relativePath);return L.has(K)?L.delete(K):L.set(K,{workspaceId:w.workspaceId,path:w.relativePath,...w.status==="conflict"?{slug:Oe(w)}:{}}),L})}s(re,"toggleCandidate");function ne(w,T){d(L=>{const K=new Map(L),V=X(w.workspaceId,w.relativePath),H=K.get(V);return H?(K.set(V,{...H,slug:T}),K):L})}s(ne,"renameCandidate");async function gt(w,T){if(!j)return;const L=T.toLowerCase().endsWith("/skill.md")?T.slice(0,-9)||".":T.toLowerCase()==="skill.md"?".":T,K=X(w,L);E(K);try{const V=await de.scanProjects(n,{projectIds:[j.id],mode:"preview",selection:[{workspaceId:w,path:L}]});m(V);const H=V.candidates.find(ie=>ie.workspaceId===w&&ie.relativePath===L);H&&me(H)?(d(ie=>{const Ee=new Map(ie);return Ee.set(K,{workspaceId:w,path:L,...H.status==="conflict"?{slug:Oe(H)}:{}}),Ee}),M(!1)):o.pushToast({tone:"warn",title:H?.status==="already_imported"?"Skill already imported":"Skill could not be added",body:H?.reason??"The selected folder does not contain a valid SKILL.md file."})}catch(V){o.pushToast({tone:"error",title:"Could not inspect skill",body:Se(V)})}finally{E(null)}}s(gt,"addBrowsedSkill");function jt(){d(ds(B))}s(jt,"selectAll");function bt(){d(new Map)}s(bt,"deselectAll");function ae(){W.isPending||r(!1)}s(ae,"handleClose");function wt(){S.current+=1,c(null),m(null),v(null),g(""),d(new Map),h("pick")}return s(wt,"backToPick"),(0,e.jsx)(st,{open:t,onOpenChange:s(w=>{w?r(!0):ae()},"onOpenChange"),children:(0,e.jsxs)(Ze,{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-border/60 px-5 py-4",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,e.jsx)(et,{className:"text-base font-semibold",children:"Import skills from project"}),(0,e.jsx)(nt,{className:"text-xs text-muted-foreground",children:"Pick a project, scan its workspaces for skills, and import them as references."})]}),(0,e.jsx)("button",{type:"button",className:"rounded-sm text-muted-foreground opacity-70 transition-opacity hover:opacity-100",onClick:ae,"aria-label":"Close import dialog",children:(0,e.jsx)(zt,{className:"h-4 w-4"})})]}),(0,e.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden","aria-live":"polite",children:[u==="pick"&&(0,e.jsx)(xs,{loading:_.isLoading||z.kind==="reconnecting",error:z.kind==="error"?_.error:null,onRetry:z.retry,retrying:z.isFetching,projects:G,totalProjects:A.length,filter:N,onFilterChange:a,onPick:q}),u==="scanning"&&(0,e.jsx)(ps,{projectName:j?.name??""}),u==="select"&&(0,e.jsx)(fs,{scanError:b,onRetry:s(()=>j&&q(j),"onRetry"),onImportFromPath:i,groups:p,totalCandidates:B.length,filter:y,onFilterChange:g,selection:f,toggleCandidate:re,renameCandidate:ne,project:j,companyId:n,browseOpen:C,onBrowseOpenChange:M,onAddBrowsedSkill:gt,browseAddingKey:D}),u==="result"&&I&&(0,e.jsx)(gs,{result:I})]}),(0,e.jsxs)("footer",{className:"flex shrink-0 flex-col gap-2 border-t border-border/60 bg-muted/20 px-5 py-3 sm:flex-row sm:items-center sm:justify-between sm:gap-3",children:[u==="select"&&!b&&B.length>0?(0,e.jsx)("div",{className:"min-w-0 flex-1 text-xs text-muted-foreground",children:(0,e.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,e.jsx)(Ae,{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:[u==="select"&&(0,e.jsxs)(e.Fragment,{children:[!b&&B.length>0&&(0,e.jsxs)("div",{className:"mr-1 flex items-center gap-1",children:[(0,e.jsx)(R,{variant:"ghost",size:"sm",onClick:jt,disabled:Q.length===0,"data-testid":"select-all",children:"Select all"}),(0,e.jsx)(R,{variant:"ghost",size:"sm",onClick:bt,disabled:P===0,"data-testid":"deselect-all",children:"Deselect all"})]}),(0,e.jsxs)(R,{variant:"outline",size:"sm",onClick:wt,children:[(0,e.jsx)(Ne,{className:"mr-1 h-3.5 w-3.5"})," Back"]}),!b&&B.length>0&&(0,e.jsx)(R,{size:"sm",onClick:s(()=>W.mutate(),"onClick"),disabled:P===0||$||W.isPending,"data-testid":"import-skills",children:W.isPending?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(he,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"})," Importing…"]}):`Import ${P} skill${P===1?"":"s"}`})]}),u==="pick"&&(0,e.jsx)(R,{variant:"ghost",size:"sm",onClick:ae,children:"Cancel"}),u==="result"&&(0,e.jsx)(R,{size:"sm",onClick:ae,children:"Done"})]})]})]})})}s(zs,"ImportSkillsFromProjectDialog");function xs({loading:t,error:r,onRetry:n,retrying:i,projects:l,totalProjects:o,filter:u,onFilterChange:h,onPick:N}){return(0,e.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,e.jsx)("div",{className:"border-b border-border/60 px-5 py-3",children:(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsx)(xe,{className:"pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),(0,e.jsx)(pe,{value:u,onChange:s(a=>h(a.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:t?(0,e.jsx)("div",{className:"p-6 text-center text-sm text-muted-foreground",children:"Loading projects…"}):r?(0,e.jsx)(Xe,{className:"m-5",error:r,action:"load projects",onRetry:n,retrying:i}):o===0?(0,e.jsx)($e,{icon:Ge,message:"This organization has no projects yet."}):l.length===0?(0,e.jsx)($e,{icon:xe,message:`No projects match "${u}".`}):(0,e.jsx)("ul",{className:"divide-y divide-border/60","data-testid":"project-list",children:l.map(a=>{const y=pt(a),g=y.length===0,j=is(a.workspaces);return(0,e.jsx)("li",{children:(0,e.jsxs)("button",{type:"button",className:O("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-accent/40"),onClick:s(()=>!g&&N(a),"onClick"),disabled:g,"aria-disabled":g,"data-testid":`project-row-${a.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:a.name}),(0,e.jsxs)("div",{className:"mt-0.5 text-xs text-muted-foreground",children:[a.workspaces.length," workspace",a.workspaces.length===1?"":"s",j?` · ${j}`:""]}),g&&(0,e.jsx)("div",{className:"mt-1 text-(length:--text-micro) text-muted-foreground",children:"Remote-only project — no locally scannable workspaces to import from."})]}),!g&&(0,e.jsxs)(U,{variant:"outline",className:"shrink-0 px-1.5 py-0 font-normal",children:[y.length," scannable"]})]})},a.id)})})})]})}s(xs,"PickProjectStep");function ps({projectName:t}){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)(He,{className:"h-10 w-10 text-muted-foreground/60"}),(0,e.jsx)(he,{className:"h-5 w-5 animate-spin text-muted-foreground"})]}),(0,e.jsxs)("div",{children:[(0,e.jsxs)("p",{className:"text-sm font-medium",children:["Scanning ",t||"project"," for skills…"]}),(0,e.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",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:[je.map(r=>(0,e.jsx)(U,{variant:"outline",className:"px-1.5 py-0 font-mono text-(length:--text-micro) font-normal text-muted-foreground",children:r},r)),(0,e.jsxs)(U,{variant:"outline",className:"px-1.5 py-0 text-(length:--text-micro) font-normal text-muted-foreground",children:["+",xt-je.length," more"]})]})]})}s(ps,"ScanningStep");function hs({companyId:t,project:r,onBack:n,onAddSkill:i,addingKey:l}){const o=pt(r),u=o.find(m=>m.isPrimary)??o[0]??null,[h,N]=(0,x.useState)(u?.id??""),[a,y]=(0,x.useState)("."),g=ge({queryKey:["company-skills","browse-project",t,r.id,h,a],queryFn:s(()=>de.browseProject(t,{projectId:r.id,workspaceId:h,path:a}),"queryFn"),enabled:!!h}),j=rt(g),c=g.data;function k(m){N(m),y(".")}return s(k,"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-border/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-muted-foreground",children:"Open any folder and add directories or individual SKILL.md files."})]}),(0,e.jsxs)(R,{variant:"outline",size:"sm",onClick:n,children:[(0,e.jsx)(Ne,{className:"mr-1 h-3.5 w-3.5"})," Discovered skills"]})]}),o.length>1&&(0,e.jsx)("div",{className:"mt-3 flex flex-wrap gap-1.5","aria-label":"Project workspace",children:o.map(m=>(0,e.jsx)(R,{type:"button",variant:m.id===h?"secondary":"ghost",size:"sm",onClick:s(()=>k(m.id),"onClick"),children:m.name},m.id))})]}),(0,e.jsxs)("div",{className:"flex shrink-0 items-center gap-2 border-b border-border/60 bg-muted/20 px-5 py-2",children:[(0,e.jsx)(R,{variant:"ghost",size:"sm",onClick:s(()=>c?.parentPath&&y(c.parentPath),"onClick"),disabled:!c?.parentPath,"aria-label":"Open parent folder",children:(0,e.jsx)(Ne,{className:"h-3.5 w-3.5"})}),(0,e.jsx)("span",{className:"min-w-0 truncate font-mono text-xs text-muted-foreground",children:c?.path??a})]}),(0,e.jsxs)("div",{className:"min-h-0 flex-1 overflow-y-auto",children:[g.isLoading||j.kind==="reconnecting"?(0,e.jsxs)("div",{className:"flex items-center justify-center gap-2 p-8 text-sm text-muted-foreground",children:[(0,e.jsx)(he,{className:"h-4 w-4 animate-spin"})," Loading folder…"]}):j.kind==="error"?(0,e.jsx)(Xe,{className:"m-6",error:g.error,action:"load the folder",onRetry:j.retry,retrying:j.isFetching}):c?.entries.length?(0,e.jsx)("ul",{className:"divide-y divide-border/60",children:c.entries.map(m=>{const b=m.kind==="file"?m.path.toLowerCase()==="skill.md"?".":m.path.slice(0,-9):m.path,v=X(h,b);return(0,e.jsxs)("li",{className:"flex items-center gap-3 px-5 py-2.5",children:[m.kind==="directory"?(0,e.jsx)(Ye,{className:"h-4 w-4 shrink-0 text-muted-foreground"}):(0,e.jsx)(At,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),(0,e.jsx)("button",{type:"button",className:O("min-w-0 flex-1 truncate text-left text-sm",m.kind==="directory"&&"font-medium hover:underline"),onClick:s(()=>m.kind==="directory"&&y(m.path),"onClick"),disabled:m.kind==="file",children:m.name}),m.isSkill?(0,e.jsx)(R,{size:"sm",onClick:s(()=>i(h,m.path),"onClick"),disabled:l===v,children:l===v?(0,e.jsx)(he,{className:"h-3.5 w-3.5 animate-spin"}):"Add skill"}):m.kind==="directory"?(0,e.jsx)(fe,{className:"h-4 w-4 text-muted-foreground"}):null]},m.path)})}):(0,e.jsx)("div",{className:"p-8 text-center text-sm text-muted-foreground",children:"This folder is empty."}),c?.truncated&&(0,e.jsx)("p",{className:"border-t border-border/60 px-5 py-2 text-xs text-muted-foreground",children:"Showing the first 250 entries."})]})]})}s(hs,"ProjectSkillBrowser");function fs({scanError:t,onRetry:r,onImportFromPath:n,groups:i,totalCandidates:l,filter:o,onFilterChange:u,selection:h,toggleCandidate:N,renameCandidate:a,project:y,companyId:g,browseOpen:j,onBrowseOpenChange:c,onAddBrowsedSkill:k,browseAddingKey:m}){if(t){const b=us(t);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-muted/50 p-4",children:b?(0,e.jsx)(Ft,{className:"h-10 w-10 text-muted-foreground/60"}):(0,e.jsx)(Rt,{className:"h-10 w-10 text-muted-foreground/60"})}),(0,e.jsx)("p",{className:"text-base font-semibold",children:b?"You can't import skills here":"Scan failed"}),(0,e.jsx)("p",{className:"mt-1.5 text-sm text-muted-foreground",children:b?"Your account doesn't have permission to add skills to this organization. Ask an owner to grant the skills permission, then try again.":Se(t)}),!b&&(0,e.jsx)(R,{variant:"outline",size:"sm",className:"mt-4",onClick:r,children:"Try again"})]})})}return j&&y?(0,e.jsx)(hs,{companyId:g,project:y,onBack:s(()=>c(!1),"onBack"),onAddSkill:k,addingKey:m}):l===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-muted/50 p-4",children:(0,e.jsx)(He,{className:"h-10 w-10 text-muted-foreground/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-muted-foreground",children:["None of the well-known skill folders in this project's workspaces contain a"," ",(0,e.jsx)("code",{className:"rounded bg-muted px-1 py-0.5 text-xs",children:"SKILL.md"}),". We searched"," ",je.join(", ")," and ",xt-je.length," ","other agent-harness folders."]}),(0,e.jsxs)(R,{variant:"outline",size:"sm",className:"mt-4",onClick:s(()=>c(!0),"onClick"),"data-testid":"browse-project-folders-empty",children:[(0,e.jsx)(ze,{className:"mr-1.5 h-3.5 w-3.5"})," Browse project folders"]}),n&&(0,e.jsxs)("p",{className:"mt-3 text-sm text-muted-foreground",children:["For skills in non-standard folders, use"," ",(0,e.jsx)("button",{type:"button",className:"font-medium text-foreground underline underline-offset-2",onClick:n,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-border/60 px-5 py-2.5",children:[(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:"Choose discovered skills, or browse any workspace folder."}),(0,e.jsxs)(R,{variant:"outline",size:"sm",onClick:s(()=>c(!0),"onClick"),"data-testid":"browse-project-folders",children:[(0,e.jsx)(ze,{className:"mr-1.5 h-3.5 w-3.5"})," Browse folders"]})]}),(0,e.jsx)("div",{className:"shrink-0 border-b border-border/60 px-5 py-2.5",children:(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsx)(xe,{className:"absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),(0,e.jsx)(pe,{value:o,onChange:s(b=>u(b.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:i.length===0?(0,e.jsxs)("div",{className:"flex h-full items-center justify-center p-6 text-sm text-muted-foreground",children:["No skills match “",o.trim(),"”."]}):i.map((b,v)=>(0,e.jsxs)("section",{children:[v>0&&!b.isPrimary&&i[v-1]?.isPrimary&&(0,e.jsx)("header",{className:"border-y border-border/60 bg-muted/30 px-5 py-2 text-xs uppercase tracking-wide text-muted-foreground",children:"Other Workspaces"}),(0,e.jsx)("header",{className:"sticky top-0 z-10 border-b border-border/60 bg-background px-5 py-2 text-sm font-medium text-foreground",children:b.workspaceName}),b.directories.map(f=>(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"bg-muted/30 px-5 py-1.5 font-mono text-(length:--text-micro) text-muted-foreground",children:f.directoryRoot}),(0,e.jsx)("ul",{className:"divide-y divide-border/60",children:f.candidates.map(d=>{const I=me(d),F=X(d.workspaceId,d.relativePath),C=h.has(F),M=h.get(F);return(0,e.jsxs)("li",{className:O("flex items-start gap-3 px-5 py-2.5 transition-colors",I?"cursor-pointer hover:bg-accent/40":"opacity-70",C&&"bg-accent/50"),onClick:s(()=>N(d),"onClick"),"data-testid":`candidate-${d.relativePath}`,"data-status":d.status,"data-selected":C?"true":"false",children:[(0,e.jsx)("div",{className:"pt-0.5",onClick:s(D=>D.stopPropagation(),"onClick"),children:(0,e.jsx)(Ve,{checked:C,onCheckedChange:s(()=>N(d),"onCheckedChange"),disabled:!I,"aria-label":`Select ${d.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:d.name}),(0,e.jsx)(ms,{status:d.status})]}),d.description&&(0,e.jsx)("p",{className:"mt-0.5 line-clamp-2 text-xs text-muted-foreground",children:d.description}),(0,e.jsx)("p",{className:"mt-0.5 font-mono text-(length:--text-micro) text-muted-foreground",children:d.relativePath}),d.reason&&(0,e.jsx)("p",{className:O("mt-0.5 text-(length:--text-micro)",d.status==="conflict"?"text-amber-600 dark:text-amber-400":"text-muted-foreground"),children:d.reason}),d.status==="conflict"&&C&&(0,e.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-2",onClick:s(D=>D.stopPropagation(),"onClick"),children:[(0,e.jsx)("label",{htmlFor:`rename-${d.workspaceId}-${d.slug}`,className:"shrink-0 text-xs text-muted-foreground",children:"Import as"}),(0,e.jsx)(pe,{id:`rename-${d.workspaceId}-${d.slug}`,value:M?.slug??"",onChange:s(D=>a(d,D.target.value),"onChange"),className:"h-7 max-w-xs font-mono text-xs","aria-label":`Rename ${d.name}`,"aria-invalid":M?!Ce(M):void 0}),M&&!Ce(M)&&(0,e.jsx)("span",{className:"text-xs text-destructive",children:"Use a lowercase URL-safe slug."})]})]})]},`${d.workspaceId} ${d.relativePath}`)})})]},f.key))]},b.key))})]})}s(fs,"SelectStep");function gs({result:t}){const r=(0,x.useMemo)(()=>[...t.imported,...t.updated],[t]);return(0,e.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,e.jsxs)("div",{className:"border-b border-border/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)(Ae,{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-muted-foreground",children:[(0,e.jsx)("span",{className:"font-medium text-foreground",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-muted-foreground",children:[(0,e.jsxs)("span",{className:"text-emerald-600 dark:text-emerald-400",children:["✓ ",t.imported.length," imported"]}),t.updated.length>0&&(0,e.jsxs)("span",{children:["↻ ",t.updated.length," updated"]}),t.skipped.length>0&&(0,e.jsxs)("span",{children:["⊘ ",t.skipped.length," skipped"]})]})]}),(0,e.jsxs)("div",{className:"min-h-0 flex-1 overflow-y-auto",children:[r.length>0&&(0,e.jsxs)("section",{children:[(0,e.jsxs)("header",{className:"bg-muted/30 px-5 py-1.5 text-xs uppercase tracking-wide text-muted-foreground",children:["Imported · ",r.length]}),(0,e.jsx)("ul",{className:"divide-y divide-border/60","data-testid":"result-imported",children:r.map(n=>(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:n.name}),n.description&&(0,e.jsx)("div",{className:"truncate text-xs text-muted-foreground",children:n.description})]}),(0,e.jsxs)(Ue,{to:Ut(n.id),className:"inline-flex shrink-0 items-center gap-1 text-xs font-medium text-foreground no-underline hover:underline",children:["Open ",(0,e.jsx)(Kt,{className:"h-3 w-3"})]})]},n.id))})]}),t.skipped.length>0&&(0,e.jsxs)("section",{children:[(0,e.jsxs)("header",{className:"bg-muted/30 px-5 py-1.5 text-xs uppercase tracking-wide text-muted-foreground",children:["Skipped · ",t.skipped.length]}),(0,e.jsx)("ul",{className:"divide-y divide-border/60","data-testid":"result-skipped",children:t.skipped.map((n,i)=>(0,e.jsxs)("li",{className:"flex items-start gap-2 px-5 py-2.5 text-xs",children:[(0,e.jsx)(ct,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsx)("span",{className:"font-mono text-muted-foreground",children:n.path??"—"}),n.reason&&(0,e.jsx)("span",{className:"ml-2 text-muted-foreground",children:n.reason})]})]},`${n.workspaceId??"?"}-${n.path??i}`))})]}),t.warnings.length>0&&(0,e.jsxs)("section",{children:[(0,e.jsxs)("header",{className:"bg-muted/30 px-5 py-1.5 text-xs uppercase tracking-wide text-muted-foreground",children:["Warnings · ",t.warnings.length]}),(0,e.jsx)("ul",{className:"divide-y divide-border/60","data-testid":"result-warnings",children:t.warnings.map((n,i)=>(0,e.jsxs)("li",{className:"flex items-start gap-2 px-5 py-2.5 text-xs",children:[(0,e.jsx)(Ie,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-amber-500"}),(0,e.jsx)("span",{className:"text-muted-foreground",children:n})]},i))})]})]})]})}s(gs,"ResultStep");var oe=288,_e=224,Re=400,Be=16,ht="paperclip.skills.folderRail.width";function be(t){return Math.min(Re,Math.max(_e,t))}s(be,"clampFolderRailWidth");function js(){if(typeof window>"u")return oe;try{const t=window.localStorage.getItem(ht);if(!t)return oe;const r=Number.parseInt(t,10);return Number.isFinite(r)?be(r):oe}catch{return oe}}s(js,"readStoredFolderRailWidth");function qe(t){if(!(typeof window>"u"))try{window.localStorage.setItem(ht,String(be(t)))}catch{}}s(qe,"writeStoredFolderRailWidth");function bs(t){return!t.systemKey&&!Me(t)&&!De(t)}s(bs,"folderIsEditable");function ws(t,r){return it(t,r).map(n=>n.id).filter(n=>n!==r)}s(ws,"ancestorIds");function Fs({result:t,selection:r,loading:n=!1,tags:i,activeTag:l,onSelect:o,onSelectTag:u,onCreateFolder:h,onRenameFolder:N,onEditFolder:a,onMoveFolder:y,onDeleteFolder:g,onEnsureMyFolder:j}){const c=(0,x.useMemo)(()=>Te(t),[t]),[k,m]=(0,x.useState)(()=>new Set),[b,v]=(0,x.useState)(null),[f,d]=(0,x.useState)(""),[I,F]=(0,x.useState)(js),[C,M]=(0,x.useState)(!1),D=(0,x.useRef)(I),E=(0,x.useRef)(null);(0,x.useEffect)(()=>{if(r==="all"||r==="unfiled")return;const p=ws(c,r);p.length!==0&&m(P=>{const $=new Set(P);let re=!1;for(const ne of p)$.has(ne)||($.add(ne),re=!0);return re?$:P})},[c,r]);function S(p){m(P=>{const $=new Set(P);return $.has(p)?$.delete(p):$.add(p),$})}s(S,"toggle");function _(p){v(p.id),d(p.name)}s(_,"startRename");function z(p){const P=f.trim();P&&P!==p.name&&N(p,P),v(null)}s(z,"commitRename");const A=t?.allCount??0,G=t?.unfiledCount??0,q=(0,x.useCallback)(p=>{const P=be(p);D.current=P,F(P),qe(P)},[]),W=(0,x.useCallback)(p=>{p.preventDefault(),p.currentTarget.setPointerCapture(p.pointerId),E.current={startX:p.clientX,startWidth:D.current},M(!0)},[]),B=(0,x.useCallback)(p=>{if(!E.current)return;const P=be(E.current.startWidth+p.clientX-E.current.startX);D.current=P,F(P)},[]),Q=(0,x.useCallback)(()=>{E.current&&(E.current=null,M(!1),qe(D.current))},[]),Y=(0,x.useCallback)(p=>{p.key==="ArrowLeft"?(p.preventDefault(),q(I-Be)):p.key==="ArrowRight"?(p.preventDefault(),q(I+Be)):p.key==="Home"?(p.preventDefault(),q(_e)):p.key==="End"&&(p.preventDefault(),q(Re))},[q,I]);return(0,e.jsxs)("div",{className:"relative hidden h-full shrink-0 md:flex",style:{width:`${I}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-border 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-muted-foreground",children:"Folders"}),(0,e.jsx)(R,{variant:"ghost",size:"icon-sm",title:"New folder",onClick:s(()=>h(null),"onClick"),children:(0,e.jsx)(Le,{className:"h-3.5 w-3.5"})})]}),n?(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)("div",{className:"h-7 rounded-md bg-muted/60"}),(0,e.jsx)("div",{className:"h-7 rounded-md bg-muted/40"}),(0,e.jsx)("div",{className:"h-7 rounded-md bg-muted/30"})]}):(0,e.jsxs)("div",{className:"space-y-0.5",children:[(0,e.jsx)(ce,{active:r==="all",label:"All skills",count:A,icon:(0,e.jsx)(Ge,{className:"h-3.5 w-3.5"}),onSelect:s(()=>o("all"),"onSelect")}),c.my?(0,e.jsx)(ee,{node:c.my,depth:0,selection:r,expanded:k,renamingId:b,renameDraft:f,rootLabel:"My Skills",rootIcon:(0,e.jsx)(Fe,{className:"h-3.5 w-3.5"}),onToggle:S,onSelect:o,onCreateFolder:h,onEditFolder:a,onMoveFolder:y,onDeleteFolder:g,onStartRename:_,onRenameDraftChange:d,onRenameCommit:z,onRenameCancel:s(()=>v(null),"onRenameCancel")}):j?(0,e.jsx)(ce,{active:!1,label:"My Skills",count:0,icon:(0,e.jsx)(Fe,{className:"h-3.5 w-3.5"}),muted:!0,onSelect:j}):null,(0,e.jsx)(ys,{label:"Organization",onCreate:s(()=>h(null),"onCreate")}),c.company.length>0?c.company.map(p=>(0,e.jsx)(ee,{node:p,depth:0,selection:r,expanded:k,renamingId:b,renameDraft:f,onToggle:S,onSelect:o,onCreateFolder:h,onEditFolder:a,onMoveFolder:y,onDeleteFolder:g,onStartRename:_,onRenameDraftChange:d,onRenameCommit:z,onRenameCancel:s(()=>v(null),"onRenameCancel")},p.folder.id)):(0,e.jsx)("div",{className:"px-2 py-1 text-xs text-muted-foreground",children:"No organization folders yet."}),c.projects?(0,e.jsx)(ee,{node:c.projects,depth:0,selection:r,expanded:k,renamingId:b,renameDraft:f,rootLabel:"Projects",rootIcon:(0,e.jsx)(we,{className:"h-3.5 w-3.5"}),onToggle:S,onSelect:o,onCreateFolder:h,onEditFolder:a,onMoveFolder:y,onDeleteFolder:g,onStartRename:_,onRenameDraftChange:d,onRenameCommit:z,onRenameCancel:s(()=>v(null),"onRenameCancel")}):(0,e.jsx)(ce,{active:!1,label:"Projects",count:0,icon:(0,e.jsx)(we,{className:"h-3.5 w-3.5"}),muted:!0,disabled:!0,onSelect:s(()=>{},"onSelect")}),c.bundled?(0,e.jsx)(ee,{node:c.bundled,depth:0,selection:r,expanded:k,renamingId:b,renameDraft:f,rootLabel:"Bundled",rootIcon:(0,e.jsx)(we,{className:"h-3.5 w-3.5"}),onToggle:S,onSelect:o,onCreateFolder:h,onEditFolder:a,onMoveFolder:y,onDeleteFolder:g,onStartRename:_,onRenameDraftChange:d,onRenameCommit:z,onRenameCancel:s(()=>v(null),"onRenameCancel")}):null,(0,e.jsx)("div",{className:"px-2 pb-1 pt-3 text-(length:--text-micro) font-medium uppercase tracking-wide text-muted-foreground",children:"System"}),(0,e.jsx)(ce,{active:r==="unfiled",label:"Unfiled",count:G,icon:(0,e.jsx)(te,{color:null}),onSelect:s(()=>o("unfiled"),"onSelect")})]}),i.length>0?(0,e.jsxs)("div",{className:"mt-4 border-t border-border 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-muted-foreground",children:[(0,e.jsx)(It,{className:"h-3 w-3"}),"Tags"]}),(0,e.jsxs)("div",{className:"flex flex-wrap gap-1.5 px-1",children:[l?(0,e.jsxs)("button",{type:"button",onClick:s(()=>u(null),"onClick"),className:"inline-flex items-center gap-1 rounded-full border border-border bg-accent/60 px-2 py-0.5 text-xs text-foreground",children:[l,(0,e.jsx)(ke,{className:"h-3 w-3"})]}):null,i.filter(p=>p.slug!==l).map(p=>(0,e.jsxs)("button",{type:"button",onClick:s(()=>u(p.slug),"onClick"),className:"inline-flex items-center gap-1 rounded-full border border-border px-2 py-0.5 text-xs text-muted-foreground transition-colors hover:bg-accent/40 hover:text-foreground",children:[(0,e.jsx)("span",{className:"max-w-32 truncate",children:p.slug}),(0,e.jsx)("span",{className:"text-(length:--text-micro) opacity-70",children:p.count})]},p.slug))]})]}):null]}),(0,e.jsx)("div",{role:"separator","aria-label":"Resize skill folders","aria-orientation":"vertical","aria-valuemin":_e,"aria-valuemax":Re,"aria-valuenow":I,tabIndex:0,className:O("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-border focus-visible:before:bg-ring",C&&"before:bg-ring"),onPointerDown:W,onPointerMove:B,onPointerUp:Q,onPointerCancel:Q,onLostPointerCapture:Q,onKeyDown:Y})]})}s(Fs,"SkillFolderRail");function ys({label:t,onCreate:r}){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-muted-foreground",children:t}),(0,e.jsx)("button",{type:"button",onClick:r,title:`New ${t.toLowerCase()} folder`,className:"opacity-0 transition-opacity group-hover/heading:opacity-100",children:(0,e.jsx)(Le,{className:"h-3 w-3 text-muted-foreground"})})]})}s(ys,"RailHeading");function ce({active:t,label:r,count:n,icon:i,muted:l=!1,disabled:o=!1,onSelect:u}){return(0,e.jsxs)("button",{type:"button",className:O("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-accent/40",t?"bg-accent/60 text-foreground":l?"text-muted-foreground/70":"text-muted-foreground"),"aria-current":t?"page":void 0,disabled:o,onClick:u,children:[(0,e.jsx)("span",{className:"flex h-4 w-4 items-center justify-center",children:i}),(0,e.jsx)("span",{className:"truncate",children:r}),(0,e.jsx)("span",{className:"text-right text-xs tabular-nums text-muted-foreground",children:n}),(0,e.jsx)("span",{className:"h-6 w-6","aria-hidden":"true"})]})}s(ce,"VirtualRow");function ee({node:t,depth:r,selection:n,expanded:i,renamingId:l,renameDraft:o,rootLabel:u,rootIcon:h,onToggle:N,onSelect:a,onCreateFolder:y,onEditFolder:g,onMoveFolder:j,onDeleteFolder:c,onStartRename:k,onRenameDraftChange:m,onRenameCommit:b,onRenameCancel:v}){const{folder:f,children:d}=t,I=i.has(f.id),F=n===f.id,C=bs(f),M=!Me(f)&&!De(f)&&f.depth<4,D=f.path.startsWith("my/"),E=u??f.name;return(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{className:O("group grid grid-cols-(--gtc-folder-row-actions) items-center gap-2 rounded-md pr-2 text-sm transition-colors hover:bg-accent/40",F?"bg-accent/60 text-foreground":"text-muted-foreground"),style:{paddingLeft:`${r*.75}rem`},children:[(0,e.jsx)("button",{type:"button","aria-label":I?"Collapse folder":"Expand folder",className:O("flex h-6 w-4 items-center justify-center text-muted-foreground",d.length===0&&"invisible"),onClick:s(()=>N(f.id),"onClick"),children:(0,e.jsx)(fe,{className:O("h-3.5 w-3.5 transition-transform",I&&"rotate-90")})}),(0,e.jsxs)("button",{type:"button",className:"flex min-w-0 items-center gap-2 py-1 text-left","aria-current":F?"page":void 0,onClick:s(()=>{a(f.id),d.length>0&&N(f.id)},"onClick"),onDoubleClick:s(()=>C&&k(f),"onDoubleClick"),children:[h?(0,e.jsx)("span",{className:"flex h-4 w-4 items-center justify-center text-muted-foreground",children:h}):(0,e.jsx)(te,{color:f.color}),l===f.id?(0,e.jsx)("input",{value:o,onChange:s(S=>m(S.target.value),"onChange"),onClick:s(S=>S.stopPropagation(),"onClick"),onKeyDown:s(S=>{S.key==="Enter"&&b(f),S.key==="Escape"&&v()},"onKeyDown"),onBlur:s(()=>b(f),"onBlur"),className:"h-6 min-w-0 flex-1 rounded-sm border border-border bg-background px-1 text-sm outline-none",autoFocus:!0}):(0,e.jsx)("span",{className:"truncate",children:E})]}),(0,e.jsx)("span",{className:"text-right text-xs tabular-nums text-muted-foreground",children:f.itemCount}),C||M?(0,e.jsxs)(qt,{children:[(0,e.jsx)(Pt,{asChild:!0,children:(0,e.jsx)(R,{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 ${E}`,children:(0,e.jsx)($t,{className:"h-3.5 w-3.5"})})}),(0,e.jsxs)(Et,{align:"end",children:[M?(0,e.jsxs)(J,{onSelect:s(()=>y(f.id),"onSelect"),children:[(0,e.jsx)(Pe,{className:"h-3.5 w-3.5"}),"New subfolder"]}):null,C?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(J,{onSelect:s(()=>k(f),"onSelect"),children:"Rename"}),(0,e.jsx)(J,{onSelect:s(()=>g(f),"onSelect"),children:"Edit color"}),(0,e.jsxs)(J,{onSelect:s(()=>j(f,D?"company":"my"),"onSelect"),children:[(0,e.jsx)(Qt,{className:"h-3.5 w-3.5"}),"Move to ",D?"Organization":"My Skills"]}),(0,e.jsx)(Ht,{}),(0,e.jsxs)(J,{variant:"destructive",onSelect:s(()=>c(f),"onSelect"),children:[(0,e.jsx)(Mt,{className:"h-3.5 w-3.5"}),"Delete"]})]}):null]})]}):(0,e.jsx)("span",{className:"h-6 w-6"})]}),I&&d.length>0?(0,e.jsx)("div",{children:d.map(S=>(0,e.jsx)(ee,{node:S,depth:r+1,selection:n,expanded:i,renamingId:l,renameDraft:o,onToggle:N,onSelect:a,onCreateFolder:y,onEditFolder:g,onMoveFolder:j,onDeleteFolder:c,onStartRename:k,onRenameDraftChange:m,onRenameCommit:b,onRenameCancel:v},S.folder.id))}):null]})}s(ee,"TreeBranch");function $s({result:t,selection:r,onSelect:n}){const i=(0,x.useMemo)(()=>Te(t),[t]),l=r==="all"||r==="unfiled"?[]:it(i,r);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:s(()=>n("all"),"onClick"),className:O("inline-flex items-center gap-1 rounded px-1.5 py-0.5 transition-colors hover:bg-accent/40",r==="all"?"font-medium text-foreground":"text-muted-foreground"),children:[(0,e.jsx)(St,{className:"h-3.5 w-3.5"}),"All skills"]}),r==="unfiled"?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(fe,{className:"h-3.5 w-3.5 text-muted-foreground/60"}),(0,e.jsx)("span",{className:"rounded px-1.5 py-0.5 font-medium text-foreground",children:"Unfiled"})]}):null,l.map((o,u)=>{const h=u===l.length-1,N=u===0?at(o):o.name;return(0,e.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,e.jsx)(fe,{className:"h-3.5 w-3.5 text-muted-foreground/60"}),(0,e.jsxs)("button",{type:"button",onClick:s(()=>n(o.id),"onClick"),className:O("inline-flex items-center gap-1 rounded px-1.5 py-0.5 transition-colors hover:bg-accent/40",h?"font-medium text-foreground":"text-muted-foreground"),children:[o.color?(0,e.jsx)(te,{color:o.color}):null,N]})]},o.id)})]})}s($s,"FolderBreadcrumb");function Os({open:t,onOpenChange:r,result:n,title:i,subtitle:l,currentFolderId:o,pending:u=!1,onMove:h,onCreateFolder:N}){const a=(0,x.useMemo)(()=>Te(n),[n]),[y,g]=(0,x.useState)(""),[j,c]=(0,x.useState)(void 0),[k,m]=(0,x.useState)(void 0),[b,v]=(0,x.useState)(""),[f,d]=(0,x.useState)(!1);(0,x.useEffect)(()=>{t&&(g(""),c(void 0),m(void 0),v(""))},[t]);const I=y.trim().toLowerCase(),F=s(_=>!I||_.name.toLowerCase().includes(I)||_.path.toLowerCase().includes(I),"matches"),C=j,M=typeof C=="string"?a.byId.get(C)??null:null,D=C===void 0?null:C===null?"Unfiled":M?.path??null;async function E(){const _=b.trim();if(_){d(!0);try{const z=await N(k??null,_);z&&c(z),m(void 0),v("")}finally{d(!1)}}}s(E,"submitNewFolder");function S(_,z){const{folder:A}=_,G=Me(A),q=!G,W=C===A.id,B=o===A.id,Q=q&&!De(A)&&A.depth<4,Y=_.children,p=F(A),P=ft(_,F);return I&&!p&&!P?null:(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{className:O("group flex items-center gap-2 rounded-md px-2 py-1.5 text-sm",q?"cursor-pointer hover:bg-accent/40":"cursor-not-allowed opacity-50",W&&"bg-accent/70"),style:{paddingLeft:`${.5+z*.9}rem`},onClick:s(()=>q&&c(A.id),"onClick"),children:[A.systemKey&&["my","projects","bundled"].includes(A.systemKey)?(0,e.jsx)(Ye,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}):(0,e.jsx)(te,{color:A.color}),(0,e.jsx)("span",{className:"min-w-0 flex-1 truncate",children:at(A)}),B?(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:"current"}):null,G?(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:"read-only"}):null,W?(0,e.jsx)(ke,{className:"h-3.5 w-3.5"}):null,Q?(0,e.jsx)("button",{type:"button",title:"New folder inside…",className:"opacity-0 transition-opacity group-hover:opacity-100",onClick:s($=>{$.stopPropagation(),m(A.id),v("")},"onClick"),children:(0,e.jsx)(Pe,{className:"h-3.5 w-3.5 text-muted-foreground"})}):null]}),k===A.id?(0,e.jsx)(Ke,{depth:z+1,value:b,pending:f,onChange:v,onSubmit:E,onCancel:s(()=>m(void 0),"onCancel")}):null,Y.map($=>S($,z+1))]},A.id)}return s(S,"renderNode"),(0,e.jsx)(st,{open:t,onOpenChange:r,children:(0,e.jsxs)(Ze,{className:"sm:max-w-lg",children:[(0,e.jsxs)(Dt,{children:[(0,e.jsx)(et,{children:i}),l?(0,e.jsx)(nt,{children:l}):null]}),(0,e.jsxs)("div",{className:"flex items-center gap-2 rounded-md border border-border px-2.5",children:[(0,e.jsx)(xe,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,e.jsx)("input",{value:y,onChange:s(_=>g(_.target.value),"onChange"),placeholder:"Search folders",className:"h-8 min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),(0,e.jsxs)("div",{className:"max-h-72 overflow-y-auto rounded-md border border-border p-1",children:[(0,e.jsxs)("div",{className:O("flex cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-sm hover:bg-accent/40",C===null&&"bg-accent/70"),onClick:s(()=>c(null),"onClick"),children:[(0,e.jsx)(te,{color:null}),(0,e.jsx)("span",{className:"min-w-0 flex-1 truncate",children:"Unfiled"}),o==null?(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:"current"}):null,C===null?(0,e.jsx)(ke,{className:"h-3.5 w-3.5"}):null]}),a.roots.map(_=>S(_,0)),(0,e.jsx)("div",{className:"mt-1 border-t border-border pt-1",children:k===null?(0,e.jsx)(Ke,{depth:0,value:b,pending:f,onChange:v,onSubmit:E,onCancel:s(()=>m(void 0),"onCancel")}):(0,e.jsxs)("button",{type:"button",onClick:s(()=>{m(null),v("")},"onClick"),className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm text-muted-foreground hover:bg-accent/40 hover:text-foreground",children:[(0,e.jsx)(Le,{className:"h-3.5 w-3.5"}),"New top-level folder…"]})})]}),(0,e.jsx)("div",{className:"min-h-5 text-xs text-muted-foreground",children:D?(0,e.jsxs)("span",{children:["Moving to ",(0,e.jsx)("span",{className:"font-mono text-foreground",children:D})]}):(0,e.jsx)("span",{children:"Pick a destination folder."})}),(0,e.jsxs)(Tt,{children:[(0,e.jsx)(R,{variant:"ghost",onClick:s(()=>r(!1),"onClick"),disabled:u,children:"Cancel"}),(0,e.jsx)(R,{disabled:u||C===void 0||C===o,onClick:s(()=>C!==void 0&&h(C),"onClick"),children:u?"Moving…":"Move here"})]})]})})}s(Os,"MoveToFolderDialog");function ft(t,r){return r(t.folder)?!0:t.children.some(n=>ft(n,r))}s(ft,"subtreeMatches");function Ke({depth:t,value:r,pending:n,onChange:i,onSubmit:l,onCancel:o}){return(0,e.jsxs)("div",{className:"flex items-center gap-2 py-1",style:{paddingLeft:`${.5+t*.9}rem`},children:[(0,e.jsx)(Pe,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,e.jsx)(pe,{value:r,onChange:s(u=>i(u.target.value),"onChange"),placeholder:"Folder name",autoFocus:!0,className:"h-7 flex-1 text-sm",onKeyDown:s(u=>{u.key==="Enter"&&l(),u.key==="Escape"&&o()},"onKeyDown")}),(0,e.jsx)(R,{size:"sm",variant:"ghost",onClick:o,disabled:n,children:"Cancel"}),(0,e.jsx)(R,{size:"sm",onClick:l,disabled:n||!r.trim(),children:"Add"})]})}s(Ke,"InlineNewFolder");export{Es as a,Ds as c,Ls as d,Is as f,zs as i,Ts as l,Os as n,Ms as o,Fs as r,rs as s,$s as t,As as u};
@@ -0,0 +1,2 @@
1
+ var E=Object.defineProperty;var r=(a,c)=>E(a,"name",{value:c,configurable:!0});import{a as z}from"./rolldown-runtime-DhZMWcEn.js";import{$A as M,Dw as B,H_ as D,IC as F,In as W,Ln as L,NE as _,Rn as A,__ as R,hC as q,nj as K}from"./index-BJtnP7H1.js";var y=z(K(),1),s=z(M(),1);function O(a,c,f,g){const d=new Set(c);for(const l of a.filter(h=>!f||h.path.startsWith(`${f}/`)))g?d.add(l.path):d.delete(l.path);return d}r(O,"updateSkillTreeSelection");function H(a){const c=new Map(a.map(l=>[l.path,l])),f=new Map;function g(l){function h(u){return[...u].sort((i,o)=>+(o.name==="SKILL.md")-+(i.name==="SKILL.md")).map(i=>{const o=`${l.path}/${i.path}`;return f.set(o,{skill:l,filePath:i.path}),{...i,path:o,children:h(i.children)}})}return r(h,"prefix"),h(L(Object.fromEntries((l.inspection?.files??[]).map(u=>[u.path,null]))))}r(g,"packageFiles");function d(l){return l.map(h=>{if(h.kind==="file"){const o=c.get(h.path);return{...h,name:o.name,kind:"dir",children:g(o)}}const u=d(h.children);if(h.children.find(o=>o.kind==="file"&&c.has(o.path))&&u.length===1)return u[0];let i={...h,children:u};for(;i.children.length===1&&i.children[0].kind==="dir"&&!c.has(i.children[0].path);){const o=i.children[0];i={...o,name:`${i.name}/${o.name}`}}return i})}return r(d,"transform"),{nodes:d(L(Object.fromEntries(a.map(l=>[l.path,null])))),included:f}}r(H,"buildSkillPackageTree");function U({candidates:a,selected:c,excludedFolders:f,onChange:g,onPreview:d,disabled:l=!1,packageMode:h="skills"}){const[u,i]=(0,y.useState)(""),[o,$]=(0,y.useState)(new Map),{nodes:v,included:k}=(0,y.useMemo)(()=>H(a),[a]),x=new Map(a.map(e=>[e.path,e])),j=A(v,"dir"),N=new Set([...j].filter(e=>o.get(e)??!x.has(e))),S=u?new Set:void 0;if(S){let t=function(m){let p=!1;for(const n of m){const b=x.get(n.path)??k.get(n.path)?.skill,P=b&&`${b.path} ${b.name} ${b.description??""} ${(b.inspection?.files??[]).map(T=>T.path).join(" ")}`.toLowerCase().includes(e);(t(n.children)||P)&&(S.add(n.path),N.add(n.path),p=!0)}return p};r(t,"matches");const e=u.toLowerCase();t(v)}function C(e){if(l||k.has(e))return;if(x.has(e)){const n=new Set(c);n.has(e)?n.delete(e):n.add(e),g(n,f);return}const t=!a.filter(n=>!e||n.path.startsWith(`${e}/`)).every(n=>c.has(n.path)),m=O(a,c,e,t),p=f.filter(n=>!!e&&n!==e&&!n.startsWith(`${e}/`));t||p.push(e),g(m,p)}r(C,"toggleCheck");const w=a.filter(e=>c.has(e.path)).length,I=j.size>0&&N.size===0;return(0,s.jsxs)("div",{className:"flex min-h-0 flex-col overflow-hidden rounded-md border border-border",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 px-3",children:[(0,s.jsx)(F,{className:"size-4 shrink-0 text-muted-foreground"}),(0,s.jsx)(R,{className:"border-0 bg-transparent px-0 shadow-none focus-visible:ring-0 dark:bg-transparent",value:u,onChange:r(e=>i(e.target.value),"onChange"),placeholder:"Search skills or files…","aria-label":"Search discovered skills"})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2 border-y border-border bg-muted/30 px-3 py-1.5",children:[(0,s.jsxs)("label",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,s.jsx)("input",{type:"checkbox",className:"size-3.5 accent-foreground","aria-label":"Import folder Repository",checked:a.length>0&&w===a.length,ref:r(e=>{e&&(e.indeterminate=w>0&&w<a.length)},"ref"),disabled:l||a.length===0,onChange:r(()=>C(""),"onChange")}),(0,s.jsxs)("span",{children:[w," of ",a.length," selected"]})]}),(0,s.jsx)(_,{type:"button",variant:"ghost",size:"xs",className:"font-normal text-muted-foreground",disabled:l||!!u||j.size===0,onClick:r(()=>$(new Map([...j].map(e=>[e,I]))),"onClick"),children:I?"Expand all":"Collapse all"})]}),(0,s.jsx)("div",{className:"min-h-0 max-h-(--sz-480px) overflow-auto py-1",children:(0,s.jsx)(W,{layout:"explorer",wrapLabels:!1,nodes:v,selectedFile:null,expandedDirs:N,visiblePaths:S,disabled:l,ariaLabel:"Discovered skills",empty:{title:"No matching skills found.",description:"Try another skill name or path."},onToggleDir:r(e=>$(t=>new Map(t).set(e,!N.has(e))),"onToggleDir"),onSelectFile:r(e=>{const t=k.get(e);t&&d?.(t.skill,t.filePath)},"onSelectFile"),onToggleCheck:C,checkboxLabel:r(e=>x.has(e.path)?`Import ${e.path}`:`Import folder ${e.path}`,"checkboxLabel"),getCheckboxState:r(e=>{if(k.has(e.path))return null;if(x.has(e.path))return c.has(e.path)?"checked":"unchecked";const t=a.filter(p=>p.path.startsWith(`${e.path}/`)),m=t.filter(p=>c.has(p.path)).length;return m===0?"unchecked":m===t.length?"checked":"mixed"},"getCheckboxState"),renderLabel:r(e=>{const t=x.get(e.path);return t?(0,s.jsxs)("span",{className:"flex min-w-0 items-baseline gap-2",title:[t.path,t.description,t.error].filter(Boolean).join(`
2
+ `),children:[(0,s.jsx)("span",{className:"max-w-full shrink-0 truncate font-medium text-foreground",children:t.name}),t.description&&(0,s.jsx)("span",{className:"min-w-0 flex-1 truncate text-xs text-muted-foreground",children:t.description}),(0,s.jsxs)("span",{className:"hidden max-w-32 shrink-0 truncate font-mono text-xs text-muted-foreground md:inline",title:t.path,children:[t.path.split("/").at(-2)??".","/"]})]}):(0,s.jsx)("span",{className:"block truncate font-mono text-xs",title:k.get(e.path)?.filePath??e.path,children:e.name})},"renderLabel"),renderNodeExtra:r(e=>{const t=x.get(e.path);if(!t)return e.kind==="file"?(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:"Included"}):null;const m=t.error?"Needs setup":t.note==="New skill"?"New":t.note==="Already imported"?"Installed":t.note?.startsWith("Removed from source")?"Removed":t.note,p=t.inspection?.files.length??t.fileCount;return(0,s.jsxs)(s.Fragment,{children:[m&&(0,s.jsx)(D,{variant:"outline",className:"hidden font-normal text-muted-foreground sm:inline-flex",title:t.error??t.note,children:m}),p!==void 0&&(0,s.jsxs)("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:[p," ",p===1?"file":"files"]}),d&&(0,s.jsx)(_,{type:"button",size:"icon-xs",variant:"ghost",disabled:l,"aria-label":`Inspect ${t.name}`,onKeyDown:r(n=>n.stopPropagation(),"onKeyDown"),onClick:r(n=>{n.stopPropagation(),d(t)},"onClick"),children:t.inspection?.references.length?(0,s.jsx)(q,{className:"size-3.5"}):(0,s.jsx)(B,{className:"size-3.5"})})]})},"renderNodeExtra")})}),h==="skills"&&(0,s.jsx)("p",{className:"border-t border-border px-3 py-2 text-xs text-muted-foreground",children:"Select whole skill packages. Expand a skill to see its included files. Nested skills are selected separately."})]})}r(U,"SkillSourceTree");export{U as t};
@@ -0,0 +1,2 @@
1
+ var Xe=Object.defineProperty;var t=(r,s)=>Xe(r,"name",{value:s,configurable:!0});import{a as Ue}from"./rolldown-runtime-DhZMWcEn.js";import{Jt as es,gi as $e}from"./issue-detail-CZfjXs0M.js";import{$A as ss,$S as ts,Bw as Le,Cm as ns,ET as Me,Ep as rs,Ev as Ie,GS as G,Gb as B,HC as _e,IS as ze,In as is,LS as as,Ln as ls,ME as we,MT as Ne,NE as N,QT as os,Rn as cs,Sm as ds,To as le,Vc as ms,Yb as us,Yw as ge,__ as hs,_v as te,_w as oe,aE as xs,ab as Be,bE as V,bm as ps,fE as fs,fy as ce,hC as Te,hE as Y,hv as Ee,hw as gs,ib as js,ly as de,mv as bs,my as me,nj as vs,pE as J,pv as Ae,qC as qe,sy as ue,tT as Ge,uE as _,ub as je,uy as he,vm as ys,wm as ks,xE as ne,xm as Ns,ym as ws,yp as He,zE as Ss}from"./index-BJtnP7H1.js";import{r as Cs}from"./company-skill-routes-D5LJ1l8M.js";import{n as Rs}from"./SkillsNavigationTabs-DRwMP1eu.js";import{t as Ps}from"./SkillSourceTree-DmjlUswf.js";import{n as $s,t as Is}from"./skill-source-connect-return-eFTeuj7y.js";function De(r){try{if(r.includes("\\"))return null;const s=new URL(r.trim());if(s.protocol!=="https:"||s.hostname!=="github.com"||s.port||s.username||s.password||s.search||s.hash)return null;const l=/^\/([A-Za-z0-9_.-]+)\/([A-Za-z0-9_.-]+)(?:\/tree\/(.+?))?\/?$/.exec(s.pathname);if(!l)return null;const i=l[1],m=l[2].replace(/\.git$/,"");if([i,m].some(a=>!a||a==="."||a===".."))return null;const o=l[3]?decodeURIComponent(l[3]):void 0;if(o&&(o.length>255||/[\x00-\x20\x7f~^:?*\[\\]/.test(o)||o.includes("..")||o.includes("@{")||o==="@"||o.split("/").some(a=>!a||a.startsWith(".")||a.endsWith(".")||a.endsWith(".lock"))))return null;const p=`${i}/${m}`;return{fullName:p,repositoryUrl:`https://github.com/${p.toLowerCase()}`,...o?{trackingRef:o}:{}}}catch{return null}}t(De,"parseGitHubSkillRepositoryUrl");var Oe={name:"file-image",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["circle",{cx:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]]};Oe.node;var zs=os(Oe),e=Ue(ss(),1);function Es({repository:r,pending:s,backgroundPending:l,disabled:i,onImport:m}){const o=s||r.status==="pending",p=o||l;return(0,e.jsxs)("section",{className:"flex flex-col gap-2 py-3","aria-label":`Skills from ${r.projectName}`,"aria-busy":!!p,children:[(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)(le,{className:"size-5 shrink-0 text-muted-foreground"}),(0,e.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,e.jsx)("a",{href:r.repositoryUrl,target:"_blank",rel:"noreferrer",className:"block truncate text-sm font-medium hover:underline",children:r.repositoryUrl.replace("https://github.com/","")}),(0,e.jsxs)("p",{className:"truncate text-xs text-muted-foreground",children:[r.projectName," · ",r.trackingRef==="HEAD"?"Default branch":r.trackingRef,r.projectVisibility==="private"?" · Project access":""]})]}),(0,e.jsxs)(N,{size:"sm",variant:"outline",disabled:o||i,onClick:m,children:[p&&(0,e.jsx)(oe,{className:"size-3.5 animate-spin motion-reduce:animate-none"}),o?"Importing…":r.status==="error"?"Retry import":l?"Import remaining skills":"Import skills"]})]}),p&&(0,e.jsx)("p",{role:"status",className:"ml-8 text-xs text-muted-foreground",children:s?"Starting import…":r.importState==="importing"?"Checking repository for skills… This can take a few minutes for large repositories.":"Import queued. Skills will appear here when ready."}),r.lastError&&(0,e.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:r.lastError})]})}t(Es,"ProjectSkillRepositoryRow");var k=Ue(vs(),1),D=t(r=>`/companies/${r}/skill-sources`,"base"),z={list:t(r=>_.get(D(r)),"list"),projectRepositories:t(r=>_.get(`${D(r)}/project-repositories`),"projectRepositories"),adoptProject:t((r,s)=>_.post(`${D(r)}/adopt-project`,{workspaceId:s}),"adoptProject"),settings:t((r,s,l)=>_.patch(`${D(r)}/${s}/settings`,l),"settings"),branches:t((r,s,l={},i)=>_.get(`${D(r)}/${s}/branches${l.connectionId?`?connectionId=${encodeURIComponent(l.connectionId)}`:""}`,{signal:i}),"branches"),repositories:t(r=>_.get(`${D(r)}/repositories`),"repositories"),discover:t((r,s)=>_.post(`${D(r)}/discover`,s),"discover"),discoverStream:t(async(r,s,l,i)=>{const m=await fs(`${D(r)}/discover`,{method:"POST",body:JSON.stringify(s),headers:{Accept:"application/x-ndjson"},signal:i});if(!m.body||!m.headers.get("Content-Type")?.includes("application/x-ndjson"))throw new Error("Live scan unavailable. Refresh the page and try again.");const o=m.body.getReader(),p=new TextDecoder;let a="";try{for(;;){i?.throwIfAborted();const{value:x,done:c}=await o.read();i?.throwIfAborted(),a+=p.decode(x,{stream:!c});let v;for(;(v=a.indexOf(`
2
+ `))!==-1;){i?.throwIfAborted();const h=a.slice(0,v);if(a=a.slice(v+1),!h.trim())continue;const b=JSON.parse(h);if(b.type==="error")throw new J(b.error,b.status,b);if(b.type==="complete")return b.discovery;if(b.type==="progress"||b.type==="candidate")l(b);else throw new Error("Unexpected repository scan response. Try again.")}if(c)throw new Error("Repository scan interrupted. Try again.")}}finally{await o.cancel().catch(()=>{}),o.releaseLock()}},"discoverStream"),preview:t((r,s)=>_.post(`${D(r)}/preview`,s),"preview"),create:t((r,s)=>_.post(D(r),s),"create"),select:t((r,s,l)=>_.patch(`${D(r)}/${s}`,l),"select"),refresh:t((r,s)=>_.post(`${D(r)}/${s}/refresh`,{}),"refresh"),disconnect:t((r,s,l)=>_.delete(`${D(r)}/${s}`,l),"disconnect")};function As({value:r,branches:s,loading:l,error:i,disabled:m,onChange:o,onRetry:p}){const a=[...new Map(s.map(c=>[c.name,c])).values()].map(c=>({key:c.name,value:c.name,label:c.name,searchText:c.isDefault?"default branch":void 0,isDefault:c.isDefault}));r&&!a.some(c=>c.value===r)&&a.push({key:r,value:r,label:r});const x=[{id:"default",label:"Default branch",options:a.filter(c=>c.isDefault)},{id:"branches",label:"Branches",options:a.filter(c=>!c.isDefault)}];return(0,e.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,e.jsx)(ys,{value:r,groups:x,disabled:m,triggerAriaLabel:"Branch",mobileTitle:"Choose a branch",placeholder:"Choose a branch",searchPlaceholder:"Search or enter a branch name…",emptyMessage:l?"Branches are loading. You can still enter a name.":"No matching branches. Enter a branch name to use it.",onValueChange:t(c=>o(c),"onValueChange"),deriveGroups:t((c,v)=>{const h=c.trim();return h&&!a.some(b=>b.value===h)?[...v,{id:"entered",options:[{key:`entered:${h}`,value:h,label:h,entered:!0}]}]:v},"deriveGroups"),renderOption:t(c=>(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Le,{className:"size-4 shrink-0 text-muted-foreground"}),(0,e.jsx)("span",{className:"min-w-0 flex-1 truncate",title:c.value,children:c.entered?`Use “${c.value}”`:c.label}),c.isDefault&&(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:"Default"})]}),"renderOption")}),l&&(0,e.jsxs)("p",{role:"status",className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,e.jsx)(oe,{className:"size-3.5 animate-spin motion-reduce:animate-none"}),"Loading branches…"]}),i&&(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsxs)("p",{role:"alert",className:"text-sm text-destructive",children:[i," You can still enter a branch name."]}),p&&(0,e.jsx)(N,{type:"button",size:"sm",variant:"ghost",disabled:l||m,onClick:p,children:"Try again"})]})]})}t(As,"RepositoryBranchSelect");function Ds({repository:r,currentBranch:s,branches:l,loading:i,loadError:m,onRetry:o,onSave:p,onClose:a,onReturnFocus:x}){const[c,v]=(0,k.useState)(""),[h,b]=(0,k.useState)(!1),[j,S]=(0,k.useState)(null),d=(0,k.useRef)(null);async function R(){b(!0),S(null);try{await p(c),a()}catch(f){S(f instanceof Error?f.message:"Could not change the branch. Try again.")}finally{b(!1)}}return t(R,"save"),(0,e.jsx)(ue,{open:!0,onOpenChange:t(f=>{!f&&!h&&a()},"onOpenChange"),children:(0,e.jsxs)(de,{showCloseButton:!h,onOpenAutoFocus:t(f=>{f.preventDefault(),d.current?.focus()},"onOpenAutoFocus"),onCloseAutoFocus:t(f=>{x&&(f.preventDefault(),x())},"onCloseAutoFocus"),children:[(0,e.jsxs)(ce,{children:[(0,e.jsx)(me,{ref:d,tabIndex:-1,className:"outline-none",children:"Choose a new branch"}),(0,e.jsxs)(he,{className:"break-words",children:[r," · Currently tracking ",s==="HEAD"?"the default branch":s]})]}),(0,e.jsxs)("form",{className:"flex min-w-0 flex-col gap-4",onSubmit:t(f=>{f.preventDefault(),c&&!h&&R()},"onSubmit"),children:[(0,e.jsx)(As,{value:c,branches:l,loading:i,error:m,disabled:h,onChange:t(f=>{v(f),S(null)},"onChange"),onRetry:o}),j&&(0,e.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:j}),(0,e.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,e.jsx)(N,{type:"button",variant:"ghost",disabled:h,onClick:a,children:"Cancel"}),(0,e.jsxs)(N,{type:"submit",disabled:!c||h,children:[h&&(0,e.jsx)(oe,{className:"size-4 animate-spin motion-reduce:animate-none"}),h?"Changing branch…":"Change branch"]})]})]})]})})}t(Ds,"SkillSourceBranchRepairDialog");function Ke({companyId:r,source:s,connectionId:l,onSaved:i,onClose:m,onReturnFocus:o}){const p=we(),a=ne({queryKey:["skill-source-branches",r,s.id,l??s.connectionId],queryFn:t(({signal:c})=>z.branches(r,s.id,l?{connectionId:l}:{},c),"queryFn"),refetchOnMount:"always"});async function x(c){try{await z.settings(r,s.id,{revision:s.revision,trackingRef:c,...l?{connectionId:l}:{}})}catch(v){throw v instanceof J&&v.status===409&&v.body?.code==="skill_source_settings_changed"?(await p.invalidateQueries({queryKey:G.skillSources.all(r)}),new Error("This source is refreshing or changed. Your branch is still selected. Try saving again.")):v instanceof J&&v.body?.code==="skill_source_ref_unavailable"?new Error("GitHub could not find that branch or revision. Check the name or choose another branch."):v}await i()}return t(x,"save"),(0,e.jsx)(Ds,{repository:s.fullName,currentBranch:s.trackingRef,branches:a.data?.branches??[],loading:a.isFetching,loadError:a.error?Y(a.error).body:void 0,onRetry:t(()=>{a.refetch()},"onRetry"),onSave:x,onClose:m,onReturnFocus:o})}t(Ke,"SkillSourceBranchRepair");function Fs({companyId:r,source:s,onClose:l,onSaved:i,onReturnFocus:m}){const[o,p]=(0,k.useState)(s.connectionId??""),[a,x]=(0,k.useState)(!1),c=we(),v=ne({queryKey:G.skillSources.repositories(r),queryFn:t(()=>z.repositories(r),"queryFn"),refetchOnMount:"always"}),h=V({mutationFn:t(()=>z.settings(r,s.id,{revision:s.revision,connectionId:o}),"mutationFn"),onError:t(async d=>{d instanceof J&&d.status===409&&d.body?.code==="skill_source_settings_changed"&&await c.invalidateQueries({queryKey:G.skillSources.all(r)})},"onError"),onSuccess:t(async()=>{await i(),l()},"onSuccess")}),b=v.data?.connections??[],j=h.error instanceof J&&h.error.body?.code==="skill_source_ref_unavailable",S=b.some(d=>d.id===o);return a?(0,e.jsx)(Ke,{companyId:r,source:s,connectionId:o,onClose:t(()=>x(!1),"onClose"),onReturnFocus:m,onSaved:t(async()=>{await i(),l()},"onSaved")}):(0,e.jsx)(ue,{open:!0,onOpenChange:t(d=>{!d&&!h.isPending&&l()},"onOpenChange"),children:(0,e.jsxs)(de,{className:"flex max-h-(--sz-calc-18) flex-col overflow-hidden sm:max-w-md",onCloseAutoFocus:t(d=>{m&&(d.preventDefault(),m())},"onCloseAutoFocus"),children:[(0,e.jsxs)(ce,{className:"shrink-0",children:[(0,e.jsx)(me,{children:"Choose GitHub connection"}),(0,e.jsx)(he,{children:"Automatic updates will use your access to this connection. Installed skills and selections stay in place."})]}),(0,e.jsxs)("div",{className:"min-h-0 overflow-y-auto space-y-4",children:[v.isPending&&(0,e.jsx)("p",{role:"status",className:"text-sm text-muted-foreground",children:"Loading connections…"}),v.error&&(0,e.jsxs)("p",{role:"alert",className:"text-sm text-destructive",children:[Y(v.error).body," ",(0,e.jsx)(N,{variant:"ghost",size:"sm",onClick:t(()=>{v.refetch()},"onClick"),children:"Try again"})]}),(0,e.jsx)(He,{ariaLabel:"GitHub connection",className:ts,value:o,onValueChange:p,disabled:h.isPending,options:b.map(d=>({value:d.id,title:d.name}))}),v.isSuccess&&b.length===0&&(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Connect GitHub to continue."}),(0,e.jsx)(N,{asChild:!0,variant:"link",className:"justify-start p-0",children:(0,e.jsx)(B,{to:"/apps",children:"Manage GitHub connections"})}),h.error&&(0,e.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:h.error instanceof J&&h.error.status===409&&h.error.body?.code==="skill_source_settings_changed"?"This source was updated. Your connection is still selected. Save again to apply it.":h.error.message}),j&&s.accessScope!=="projects"&&!s.projects?.some(d=>d.active)&&(0,e.jsx)(N,{variant:"outline",disabled:!S||h.isPending,onClick:t(()=>x(!0),"onClick"),children:"Choose a new branch"})]}),(0,e.jsxs)("footer",{className:"flex shrink-0 items-center justify-between gap-3 border-t border-border pt-4",children:[(0,e.jsx)(N,{variant:"ghost",disabled:h.isPending,onClick:l,children:"Cancel"}),(0,e.jsx)(N,{disabled:!S||h.isPending,onClick:t(()=>h.mutate(),"onClick"),children:h.isPending?"Saving…":"Save connection"})]})]})})}t(Fs,"SkillSourceConnectionRepair");function Us({automaticUpdates:r,refreshing:s,disabled:l,onRefresh:i,onAutomaticUpdates:m,showPreference:o=!0}){return(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[o&&(0,e.jsxs)("label",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,e.jsx)(rs,{checked:r,disabled:l,onCheckedChange:m,"aria-label":"Automatic updates"}),"Automatic updates"]}),(0,e.jsxs)(N,{size:"sm",variant:"outline",disabled:l||s,onClick:i,children:[(0,e.jsx)(_e,{className:s?"size-3.5 animate-spin motion-reduce:animate-none":"size-3.5"}),s?"Refreshing…":"Refresh"]})]})}t(Us,"SkillSourceSyncControls");function Fe({repository:r,progress:s,found:l=[],importing:i=!1,count:m=0}){const o=s?.phase??"connecting",p=o==="connecting"||o==="downloading"?0:o==="listing"?1:2,a=o==="downloading"?s?.download:void 0,x=s?.totalSkills,c=!i&&o==="checking"&&x!=null,v=i?`Importing ${m} ${m===1?"skill":"skills"}`:c?`${x} ${x===1?"skill":"skills"} found`:o==="downloading"?a?.stage==="resolving"?"Preparing repository":"Downloading repository":o==="listing"?"Finding skills":"Opening repository",h=i?"Checking package files and saving local copies…":c?`${s?.checkedSkills??0} of ${x} checked`:o==="downloading"?a?`${a.percent}% ${a.stage==="resolving"?"prepared":"received"}${a.receivedBytes?` · ${es(a.receivedBytes)}`:""}`:"Receiving the repository from GitHub…":o==="listing"?"Searching every folder for SKILL.md…":"Connecting to GitHub and resolving the branch…",b=l.slice(-5);return(0,e.jsxs)("section",{className:"skill-import-enter flex min-w-0 flex-col gap-5","aria-label":i?"Import progress":"Repository scan progress",children:[(0,e.jsxs)("div",{className:"flex min-w-0 items-center gap-3 rounded-lg border border-border bg-muted/30 px-3 py-2.5",children:[(0,e.jsx)(le,{className:"size-5 shrink-0 text-muted-foreground"}),(0,e.jsx)("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",title:r,children:r})]}),(0,e.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)("span",{className:"flex size-10 shrink-0 items-center justify-center rounded-full bg-muted",children:(0,e.jsx)(oe,{className:"size-5 motion-safe:animate-spin text-muted-foreground","aria-hidden":!0})}),(0,e.jsxs)("div",{className:"min-w-0 flex-1",role:"status","aria-live":"polite","aria-atomic":"true",children:[(0,e.jsx)("h3",{className:"text-sm font-medium",children:v}),(0,e.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:h})]})]}),!i&&a?(0,e.jsx)("progress",{className:"skill-import-progress h-1 w-full",value:a.percent,max:100,"aria-label":a.stage==="resolving"?"Preparing repository":"Repository download"}):c&&x>0?(0,e.jsx)("progress",{className:"skill-import-progress h-1 w-full",value:s?.checkedSkills??0,max:x,"aria-label":"Skills checked"}):(0,e.jsx)("div",{className:"h-1 overflow-hidden rounded-full bg-muted",role:"progressbar","aria-label":i?"Saving skill snapshots":"Scanning repository",children:(0,e.jsx)("div",{className:"skill-import-sweep h-full rounded-full bg-foreground/30"})}),!i&&(0,e.jsx)("ol",{className:"flex items-center justify-between gap-2 text-xs text-muted-foreground","aria-label":"Scan stages",children:["Download","Find skills","Check files"].map((j,S)=>(0,e.jsxs)("li",{className:`flex items-center gap-1.5 ${S===p?"text-foreground":""}`,"aria-current":S===p?"step":void 0,children:[S<p?(0,e.jsx)(Ne,{className:"size-3","aria-hidden":!0}):(0,e.jsx)("span",{className:`size-1.5 rounded-full ${S===p?"bg-foreground motion-safe:animate-pulse":"bg-muted-foreground/40"}`}),j]},j))})]}),(0,e.jsxs)("div",{className:"overflow-hidden rounded-lg border border-border bg-muted/20",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between gap-2 border-b border-border px-3 py-2 text-xs text-muted-foreground",children:[(0,e.jsx)("span",{children:i?"Selected skills":"Recently checked"}),b.length>0&&(0,e.jsx)("span",{className:"tabular-nums",children:i?`${m} selected`:`${s?.checkedSkills??l.length} checked`})]}),b.length>0?(0,e.jsx)("ul",{className:"divide-y divide-border","aria-label":i?"Skills being imported":"Skills checked so far",children:b.map(j=>(0,e.jsxs)("li",{className:"skill-import-enter flex min-w-0 items-center gap-2.5 px-3 py-2.5",children:[j.error?(0,e.jsx)(Me,{className:"size-4 shrink-0 text-destructive","aria-label":"Validation issue"}):i?(0,e.jsx)(ge,{className:"size-4 shrink-0 text-muted-foreground","aria-hidden":!0}):(0,e.jsx)(Ne,{className:"size-4 shrink-0 text-muted-foreground","aria-hidden":!0}),(0,e.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,e.jsxs)("div",{className:"flex min-w-0 items-baseline gap-2",children:[(0,e.jsx)("span",{className:"truncate text-sm font-medium",children:j.name}),(0,e.jsxs)("span",{className:"shrink-0 text-xs text-muted-foreground",children:[j.fileCount," ",j.fileCount===1?"file":"files"]})]}),(0,e.jsx)("p",{className:`truncate text-xs ${j.error?"text-destructive":"text-muted-foreground"}`,title:j.error??j.path,children:j.error??j.path})]})]},j.path))}):(0,e.jsx)("div",{className:"flex flex-col gap-3 px-3 py-4","aria-hidden":"true",children:["w-2/3","w-1/2","w-3/4"].map(j=>(0,e.jsxs)("div",{className:"flex items-center gap-3 motion-safe:animate-pulse",children:[(0,e.jsx)(ge,{className:"size-4 text-muted-foreground/40"}),(0,e.jsx)("span",{className:`${j} h-2 rounded-full bg-muted`})]},j))}),(0,e.jsxs)("div",{className:"flex min-w-0 items-center gap-2 border-t border-border px-3 py-2 text-xs text-muted-foreground",children:[(0,e.jsx)(oe,{className:"size-3 shrink-0 motion-safe:animate-spin","aria-hidden":!0}),(0,e.jsx)("span",{className:"min-w-0 flex-1 truncate",title:s?.currentPath??void 0,children:i?"Saving complete packages, including scripts and references":s?.currentPath??"Waiting for repository contents…"}),c&&s?.totalFiles!=null&&(0,e.jsxs)("span",{className:"shrink-0 tabular-nums",children:[s.checkedFiles,"/",s.totalFiles," files"]})]})]}),(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:i?"This may take a moment for larger packages.":"You’ll choose what to import after every package has been checked."})]})}t(Fe,"SkillImportProgress");function Ls({companyId:r,repository:s,commitSha:l,skill:i,initialFile:m,repositoryPackage:o,onClose:p}){const a=o?{...o,references:[]}:i.inspection,[x,c]=(0,k.useState)(m??(o?i.path:"SKILL.md")),v=ls(Object.fromEntries((a?.files??[]).map(w=>[w.path,null]))).sort((w,$)=>+($.name==="SKILL.md")-+(w.name==="SKILL.md")),[h,b]=(0,k.useState)(new Set),j=new Set([...cs(v,"dir")].filter(w=>!h.has(w))),S=a?.files.find(w=>w.path===x),d=i.path.includes("/")?i.path.slice(0,i.path.lastIndexOf("/")):"",R=o?x:x==="SKILL.md"?i.path:[d,x].filter(Boolean).join("/"),f=ne({queryKey:[...G.skillSources.preview(r,s.repositoryUrl,s.connectionId??null,l,i.path,x),s.packageMode??"skills"],queryFn:t(()=>z.preview(r,{...s,commitSha:l,skillPath:i.path,filePath:s.packageMode==="repository"?R:x}),"queryFn"),enabled:!!(l&&S),staleTime:3e5,refetchOnWindowFocus:!1}),F=je(f),P=o?x:x==="SKILL.md"?i.path:[d,x].filter(Boolean).join("/"),q=l?`${s.repositoryUrl}/blob/${l}/${P.split("/").map(encodeURIComponent).join("/")}`:s.repositoryUrl;return(0,e.jsx)(ue,{open:!0,onOpenChange:t(w=>{w||p()},"onOpenChange"),children:(0,e.jsxs)(de,{className:"flex max-h-(--sz-calc-18) flex-col overflow-y-auto p-4 sm:max-w-4xl sm:p-6",children:[(0,e.jsxs)(ce,{children:[(0,e.jsx)(me,{children:o?"Included repository files":i.name}),(0,e.jsxs)(he,{className:"break-all font-mono text-xs",children:[o?"Repository root":d||"Repository root","/ · ",a?.files.length??i.fileCount??"?"," files",l?` · ${l.slice(0,8)}`:""]})]}),!a&&(0,e.jsx)("p",{role:"status",className:"text-sm text-muted-foreground",children:"Refresh this source to inspect its complete package contents."}),i.error&&(0,e.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Needs setup: ",i.error]}),a?.requirements&&(0,e.jsxs)("section",{className:"rounded-md border border-border bg-muted/30 p-3 text-sm",children:[(0,e.jsx)("h3",{className:"font-medium",children:"Runtime requirements"}),(0,e.jsx)("p",{className:"mt-1 whitespace-pre-wrap text-muted-foreground",children:a.requirements})]}),!!a?.references.length&&(0,e.jsxs)("section",{className:"rounded-md border border-border p-3 text-sm","aria-label":"Package reference warnings",children:[(0,e.jsxs)("h3",{className:"flex items-center gap-2 font-medium",children:[(0,e.jsx)(Te,{className:"size-4"}),"Files not included"]}),(0,e.jsx)("ul",{className:"mt-2 space-y-2",children:a.references.map(w=>(0,e.jsxs)("li",{className:"break-all text-xs",children:[(0,e.jsx)("span",{className:"font-mono",children:w.target})," · ",w.kind==="outside_package"?"Outside this package":"Not found",(0,e.jsxs)("span",{className:"text-muted-foreground",children:[" · referenced in ",w.fromPath]})]},`${w.fromPath}:${w.resolvedPath}`))})]}),!!a?.warnings.length&&(0,e.jsxs)("details",{className:"text-xs text-muted-foreground",children:[(0,e.jsxs)("summary",{className:"cursor-pointer",children:["Content audit · ",a.warnings.length," ",a.warnings.length===1?"notice":"notices"]}),(0,e.jsx)("ul",{className:"mt-2 space-y-1",children:a.warnings.map(w=>(0,e.jsx)("li",{children:w},w))})]}),a&&(0,e.jsxs)("div",{className:"flex min-h-0 flex-col overflow-hidden rounded-md border border-border md:flex-row",children:[(0,e.jsx)("div",{className:"max-h-48 shrink-0 overflow-auto border-b border-border py-1 md:max-h-(--sz-480px) md:w-56 md:border-b-0 md:border-r",children:(0,e.jsx)(is,{nodes:v,selectedFile:x,expandedDirs:j,showCheckboxes:!1,wrapLabels:!1,ariaLabel:"Included package files",onSelectFile:c,onToggleDir:t(w=>b($=>{const C=new Set($);return C.has(w)?C.delete(w):C.add(w),C}),"onToggleDir")})}),(0,e.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2 border-b border-border bg-muted/30 px-3 py-2 text-xs",children:[(0,e.jsx)("span",{className:"break-all font-mono",children:x}),S&&(0,e.jsxs)("span",{className:"text-muted-foreground",children:[S.sizeBytes.toLocaleString()," bytes",S.executable?" · executable":""]})]}),(0,e.jsxs)("div",{className:"max-h-(--sz-480px) min-h-40 overflow-auto p-3",children:[(f.isFetching||F.kind==="reconnecting")&&(0,e.jsx)("p",{role:"status",className:"text-sm text-muted-foreground",children:"Loading preview…"}),F.kind==="error"&&(0,e.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,e.jsx)(Be,{size:"inline",error:f.error,action:"load the preview",onRetry:F.retry,retrying:F.isFetching})," ",(0,e.jsx)(B,{to:"/apps",className:"underline",children:"Manage GitHub access"})]}),i.error&&(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Preview unavailable for a package that failed validation."}),f.data?.file.encoding==="base64"&&(0,e.jsxs)("div",{className:"flex flex-col items-center gap-3 py-8 text-sm text-muted-foreground",children:[(0,e.jsx)(zs,{className:"size-6"}),(0,e.jsx)("p",{children:"Binary asset · included without changes"}),(0,e.jsx)("p",{className:"text-xs",children:"Open on GitHub to preview or download this file."})]}),f.data?.content!==null&&f.data?.content!==void 0&&(0,e.jsx)("pre",{className:Ss("whitespace-pre-wrap break-words font-mono text-xs leading-relaxed","ph-mask ph-sensitive"),children:f.data.content}),f.data?.truncated&&(0,e.jsx)("p",{className:"mt-3 text-xs text-muted-foreground",children:"Showing the first 64 KB. The complete file is imported."})]})]})]}),(0,e.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,e.jsx)(N,{type:"button",variant:"outline",onClick:p,children:"Back to selection"}),(0,e.jsx)(N,{asChild:!0,variant:"ghost",size:"sm",children:(0,e.jsxs)("a",{href:q,target:"_blank",rel:"noreferrer",children:["Open on GitHub",(0,e.jsx)(Ge,{className:"size-3.5"})]})})]})]})})}t(Ls,"SkillPackagePreview");function Ve(r,s,l=[]){return[...new Set([...l,...s?.warnings??[],...s?.error?[s.error]:[],...r.flatMap(i=>[...i.error?[`${i.path} — Needs setup: ${i.error}`]:[],...i.inspection?.warnings.filter(m=>m.includes("not included")||m.includes("couldn’t be included"))??[],...i.inspection?.references.map(m=>`${m.resolvedPath} — Not included; referenced by ${i.path}.`)??[]])])]}t(Ve,"skillImportWarnings");function Qe({warnings:r}){return r.length?(0,e.jsxs)("details",{className:"text-sm","aria-label":"Import warnings",children:[(0,e.jsx)("summary",{className:"cursor-pointer text-muted-foreground",children:(0,e.jsxs)("span",{className:"inline-flex items-center gap-2",children:[(0,e.jsx)(Te,{className:"size-4 shrink-0"}),r.length," import ",r.length===1?"warning":"warnings"]})}),(0,e.jsx)("ul",{className:"mt-2 space-y-2 text-xs text-muted-foreground",children:r.map(s=>(0,e.jsx)("li",{className:"break-words",children:s},s))})]}):null}t(Qe,"SkillImportWarnings");function Ms(r){const s=new Map;for(const l of r){const i=JSON.stringify([l.repositoryUrl.toLowerCase(),l.trackingRef]),m=s.get(i)??[];m.push(l),s.set(i,m)}return[...s].map(([l,i])=>{const m=i.find(a=>a.status==="pending"),o=i.find(a=>a.status==="error"),p=i.filter(a=>a.status==="available"||a.status==="error");return{key:l,repository:{...i[0],projectName:[...new Set(i.map(a=>a.projectName))].join(", "),status:p.length?o?.status??"available":m?.status??i[0].status,lastError:o?.lastError??i[0].lastError,importState:i.some(a=>a.importState==="importing")?"importing":"queued"},workspaces:i,importableWorkspaces:p,hasPending:!!m}})}t(Ms,"groupProjectSkillRepositories");var ye=t(r=>G.skillSources.all(r),"sourceKey");function Ws(){const r=(0,k.useRef)({}),{selectedCompanyId:s,selectedCompany:l}=as(),{sourceId:i}=xs(),m=us(),o=we(),{setBreadcrumbs:p}=js(),[a,x]=(0,k.useState)({}),[c,v]=(0,k.useState)(null),[h,b]=(0,k.useState)(null),[j,S]=(0,k.useState)(null),d=s??"";(0,k.useEffect)(()=>{p([{label:"Skills",href:"/skills"},{label:"Sources"}])},[p]);const R=ne({queryKey:ye(d),queryFn:t(()=>z.list(d),"queryFn"),enabled:!!d,refetchInterval:5e3}),f=R.data?.find(n=>n.id===c),F=R.data?.find(n=>n.id===h),P=ne({queryKey:G.skillSources.projects(d),queryFn:t(()=>z.projectRepositories(d),"queryFn"),enabled:!!d,refetchInterval:5e3}),q=je(R),w=je(P);async function $(){await Promise.all([o.invalidateQueries({queryKey:G.skillSources.projects(d)}),o.invalidateQueries({queryKey:ye(d)}),o.invalidateQueries({queryKey:G.companySkills.list(d)})])}t($,"invalidate");const C=V({mutationFn:t(n=>z.refresh(d,n),"mutationFn"),onSuccess:t(async n=>{x(y=>({...y,[n.source.id]:null})),await $()},"onSuccess"),onError:t((n,y)=>{x(A=>({...A,[y]:{message:Y(n).body,failedAt:Date.now(),operation:"refresh"}})),$()},"onError")}),E=V({mutationFn:t(async n=>{for(const y of n.importableWorkspaces)await z.adoptProject(d,y.workspaceId)},"mutationFn"),onSuccess:$,onError:t(()=>{$()},"onError")}),Q=V({mutationFn:t(({source:n,enabled:y})=>z.settings(d,n.id,{revision:n.revision,automaticUpdates:y}),"mutationFn"),onSuccess:t(async(n,y)=>{x(A=>({...A,[y.source.id]:null})),await $()},"onSuccess"),onError:t((n,y)=>x(A=>({...A,[y.source.id]:{message:Y(n).body,failedAt:Date.now(),operation:"settings"}})),"onError")}),U=Ms(Array.isArray(P.data)?P.data.filter(n=>!n.sourceId):[]),re=t(n=>R.data?.find(y=>y.repositoryUrl.toLowerCase()===n.repository.repositoryUrl.toLowerCase()&&y.trackingRef===n.repository.trackingRef),"groupSource"),ie=U.filter(n=>!re(n)),L=V({mutationFn:t(({source:n,skills:y})=>z.disconnect(d,n.id,{revision:n.revision,skills:y}),"mutationFn"),onSuccess:t(async n=>{o.setQueryData(ye(d),y=>y?.filter(A=>A.id!==n.id)),await $(),await o.invalidateQueries({queryKey:G.folders.list(d,"skill")}),S(null)},"onSuccess")}),O=V({mutationFn:t(async()=>(await R.refetch({throwOnError:!0})).data?.find(n=>n.id===j?.id)??null,"mutationFn"),onSuccess:t(n=>{S(n),L.reset()},"onSuccess")}),Z=L.error instanceof J&&L.error.status===409,K=R.data?.find(n=>n.id===i);return d?(0,e.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-6 p-4 md:p-6",children:[(0,e.jsxs)("header",{className:"flex flex-wrap items-start justify-between gap-4",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("h1",{className:"text-xl font-semibold",children:"Skill sources"}),(0,e.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:"Skills from your repositories stay up to date automatically."})]}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsxs)(N,{onClick:t(()=>m("/skills/sources/new"),"onClick"),children:[(0,e.jsx)(qe,{className:"size-4"}),"Import from GitHub"]}),(0,e.jsxs)(Ae,{children:[(0,e.jsx)(Ie,{asChild:!0,children:(0,e.jsx)(N,{variant:"outline",size:"icon","aria-label":"More source actions",children:(0,e.jsx)($e,{className:"size-4"})})}),(0,e.jsx)(Ee,{align:"end",children:(0,e.jsx)(te,{asChild:!0,children:(0,e.jsx)(B,{to:"/apps",children:"Manage GitHub connection"})})})]})]})]}),(0,e.jsx)(Rs,{activeView:"sources"}),(q.kind==="loading"||q.kind==="reconnecting")&&(0,e.jsx)("p",{role:"status",className:"text-sm text-muted-foreground",children:"Loading sources…"}),q.kind==="error"&&(0,e.jsx)(Be,{error:R.error,action:"load skill sources",onRetry:q.retry,retrying:q.isFetching}),R.data?.length===0&&U.length===0&&(0,e.jsxs)("div",{className:"flex flex-col items-start gap-3 py-8",children:[(0,e.jsxs)("p",{className:"text-sm text-muted-foreground",children:["No repositories added yet. Import your skills to make them available in ",l?.name??"this company","."]}),(0,e.jsx)(N,{variant:"outline",onClick:t(()=>m("/skills/sources/new"),"onClick"),children:"Import from GitHub"})]}),w.kind==="error"&&(0,e.jsxs)("p",{role:"alert",className:"text-sm text-destructive",children:[Y(P.error).body," ",(0,e.jsx)(N,{variant:"ghost",size:"sm",onClick:t(()=>{P.refetch()},"onClick"),children:"Try again"})]}),E.error&&(0,e.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:Y(E.error).body}),ie.length>0&&(0,e.jsx)("div",{className:"divide-y divide-border","aria-label":"Project repositories",children:ie.map(n=>(0,e.jsx)(Es,{repository:n.repository,backgroundPending:n.hasPending,disabled:E.isPending,pending:E.isPending&&E.variables?.key===n.key,onImport:t(()=>E.mutate(n),"onImport")},n.key))}),(0,e.jsx)("div",{className:"divide-y divide-border",children:R.data?.map(n=>{const y=n.entries.filter(g=>g.skillId),A=n.entries.filter(g=>g.selection==="new"&&g.present).length,H=a[n.id],M=U.find(g=>re(g)?.id===n.id),X=M&&(M.hasPending||E.isPending&&E.variables?.key===M.key),I=H&&H.message!==n.lastError&&(H.operation==="settings"||!n.lastSuccessAt||new Date(n.lastSuccessAt).getTime()<H.failedAt)?H.message:null;return(0,e.jsxs)("section",{className:"flex flex-col gap-3 py-4","aria-label":n.fullName,children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,e.jsxs)("div",{className:"flex min-w-0 basis-full items-start gap-3 sm:flex-1 sm:basis-auto",children:[(0,e.jsx)(le,{className:"size-5 shrink-0 text-muted-foreground"}),(0,e.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,e.jsx)("a",{href:n.repositoryUrl,target:"_blank",rel:"noreferrer",title:n.fullName,className:"block truncate rounded-sm text-sm font-medium hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:n.fullName}),(0,e.jsxs)("p",{className:"truncate text-xs text-muted-foreground",children:[n.trackingRef==="HEAD"?"Default branch":n.trackingRef,n.lastSuccessAt?` · Updated ${ze(n.lastSuccessAt)}`:"",n.accessScope==="projects"?" · Project access":"",X&&(0,e.jsx)("span",{role:"status",children:" · Importing skills…"})]}),n.enabled&&n.automaticUpdates===!1&&(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:"Automatic updates paused"}),n.trackingActive===!1&&(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:"Repository tracking stopped · installed skills kept"}),!n.enabled&&(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:"Disconnected"}),C.isPending&&C.variables===n.id&&(0,e.jsx)("p",{role:"status",className:"text-xs text-muted-foreground",children:"Refreshing…"}),A>0&&(0,e.jsxs)(B,{to:`/skills/sources/${n.id}`,className:"text-xs underline",children:[A," new ",A===1?"skill":"skills"," available"]})]})]}),(0,e.jsx)(Us,{showPreference:!1,automaticUpdates:n.automaticUpdates??!0,refreshing:n.syncState==="refreshing"||C.isPending&&C.variables===n.id,disabled:!n.enabled||Q.isPending,onRefresh:t(()=>C.mutate(n.id),"onRefresh"),onAutomaticUpdates:t(g=>Q.mutate({source:n,enabled:g}),"onAutomaticUpdates")}),(0,e.jsxs)(Ae,{children:[(0,e.jsx)(Ie,{asChild:!0,children:(0,e.jsx)(N,{ref:t(g=>{r.current[n.id]=g},"ref"),size:"icon-sm",variant:"ghost",className:"shrink-0","aria-label":`More actions for ${n.fullName}`,children:(0,e.jsx)($e,{className:"size-4"})})}),(0,e.jsxs)(Ee,{align:"end",children:[(0,e.jsx)(bs,{checked:n.automaticUpdates??!0,disabled:!n.enabled||Q.isPending,onCheckedChange:t(g=>Q.mutate({source:n,enabled:g}),"onCheckedChange"),children:"Automatic updates"}),(0,e.jsx)(te,{onSelect:t(()=>m(`/skills/sources/${n.id}`),"onSelect"),children:"Select skills"}),M&&M.importableWorkspaces.length>0&&(0,e.jsx)(te,{disabled:E.isPending,onSelect:t(()=>E.mutate(M),"onSelect"),children:M.repository.status==="error"?"Retry project import":M.hasPending?"Import remaining project skills":"Import project skills"}),(0,e.jsx)(te,{onSelect:t(()=>v(n.id),"onSelect"),children:"Choose connection"}),n.accessScope!=="projects"&&!n.projects?.some(g=>g.active)&&(0,e.jsx)(te,{onSelect:t(()=>b(n.id),"onSelect"),children:"Choose a new branch"}),(0,e.jsx)(te,{variant:"destructive",disabled:L.isPending,onSelect:t(()=>{L.reset(),O.reset(),S(n)},"onSelect"),children:n.enabled?"Disconnect source":"Remove source"})]})]})]}),M?.repository.lastError&&(0,e.jsx)(ke,{message:M.repository.lastError}),y.length>0&&(0,e.jsx)("ul",{className:"ml-8 min-w-0","aria-label":`Installed skills from ${n.fullName}`,children:y.map(g=>(0,e.jsx)("li",{children:(0,e.jsxs)(B,{to:Cs(g.skillId),title:g.path,className:"group flex min-w-0 items-center gap-2 rounded-sm py-1 text-sm hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,e.jsx)(ge,{className:"size-3.5 shrink-0 text-muted-foreground"}),(0,e.jsx)("span",{className:"truncate font-medium group-hover:underline",children:g.name}),g.description&&(0,e.jsx)("span",{className:"min-w-0 flex-1 truncate text-xs text-muted-foreground",children:g.description}),!g.present&&(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:"Removed from source · installed copy kept"})]})},g.id))}),y.length===0&&n.entries.length===0&&n.syncState!=="refreshing"&&!n.lastError&&(0,e.jsxs)("p",{className:"ml-8 text-sm text-muted-foreground",children:["No skills found yet.",n.enabled&&n.automaticUpdates&&n.importNewSkills?" New skills will be imported automatically.":""]}),I&&(0,e.jsx)(ke,{message:I}),(0,e.jsx)(Qe,{warnings:Ve(n.entries.filter(g=>g.selection==="selected"),n.repositoryPackage)}),n.lastError&&(0,e.jsx)(ke,{message:n.lastError,detail:n.lastAttemptAt?`Last attempt ${ze(n.lastAttemptAt)}`:void 0,action:(0,e.jsx)(B,{to:`/skills/sources/${n.id}`,className:"font-medium text-destructive underline underline-offset-2",children:"Review source"})}),n.lastError&&(n.repairAction==="connection"||!n.repairAction&&!n.connectionId)&&(0,e.jsx)(N,{variant:"outline",size:"sm",className:"self-start",onClick:t(()=>v(n.id),"onClick"),children:"Choose connection"}),n.lastError&&n.repairAction==="branch"&&(n.accessScope==="projects"||n.projects?.some(g=>g.active)?(0,e.jsx)("div",{className:"flex flex-wrap gap-3",children:n.projects?.filter(g=>g.active).map(g=>(0,e.jsxs)(B,{to:`/projects/${g.id}`,className:"text-sm underline",children:["Update ",g.name," repository"]},g.id))}):(0,e.jsx)(N,{variant:"outline",size:"sm",className:"self-start",onClick:t(()=>b(n.id),"onClick"),children:"Choose a new branch"}))]},n.id)})}),F&&(0,e.jsx)(Ke,{companyId:d,source:F,onClose:t(()=>b(null),"onClose"),onReturnFocus:t(()=>r.current[F.id]?.focus(),"onReturnFocus"),onSaved:t(async()=>{x(n=>({...n,[F.id]:null})),await $()},"onSaved")}),f&&(0,e.jsx)(Fs,{companyId:d,source:f,onClose:t(()=>v(null),"onClose"),onReturnFocus:t(()=>r.current[f.id]?.focus(),"onReturnFocus"),onSaved:t(async()=>{x(n=>({...n,[f.id]:null})),await $()},"onSaved")}),j&&(0,e.jsx)(_s,{source:j,pending:L.isPending||O.isPending,error:O.error?.message??L.error?.message,stale:Z,onReload:t(()=>O.mutate(),"onReload"),onChoiceChange:t(()=>{Z||L.reset()},"onChoiceChange"),onClose:t(()=>S(null),"onClose"),onConfirm:t(n=>L.mutate({source:j,skills:n}),"onConfirm")},`${j.id}:${j.revision}`),i&&(i==="new"||K)&&(0,e.jsx)(Bs,{companyId:d,source:K,onClose:t(()=>m("/skills/sources"),"onClose"),onSaved:t(async n=>{x(y=>({...y,[n.source.id]:null})),await $(),m("/skills/sources")},"onSaved")},`${d}:${i}`),i&&i!=="new"&&R.isSuccess&&!K&&(0,e.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:"Source not found."})]}):(0,e.jsx)("p",{className:"p-6 text-sm text-muted-foreground",children:"Select a company to manage skill sources."})}t(Ws,"SkillSources");function ke({message:r,detail:s,action:l}){return(0,e.jsxs)("div",{role:"alert",className:"ml-8 flex min-w-0 items-start gap-2 rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-sm",children:[(0,e.jsx)(Me,{className:"mt-0.5 size-4 shrink-0 text-destructive","aria-hidden":"true"}),(0,e.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,e.jsx)("p",{className:"break-words text-foreground",children:r}),(s||l)&&(0,e.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs",children:[s&&(0,e.jsx)("span",{className:"text-muted-foreground",children:s}),l]})]})]})}t(ke,"SourceErrorNotice");function _s({source:r,pending:s,error:l,stale:i,onReload:m,onClose:o,onConfirm:p,onChoiceChange:a}){const x=new Set(r.entries.flatMap(b=>b.skillId?[b.skillId]:[])).size,[c,v]=(0,k.useState)(""),h=r.enabled?"Disconnect source":"Remove source";return(0,e.jsx)(ue,{open:!0,onOpenChange:t(b=>{!b&&!s&&o()},"onOpenChange"),children:(0,e.jsxs)(de,{children:[(0,e.jsxs)(ce,{children:[(0,e.jsxs)(me,{children:[r.enabled?"Disconnect":"Remove"," ",r.fullName,"?"]}),(0,e.jsx)(he,{children:x?`Remove this repository from Sources. What should happen to its ${x} imported ${x===1?"skill":"skills"}?`:"Remove this repository from Sources."})]}),x>0&&(0,e.jsx)(He,{ariaLabel:"Imported skills",value:c,onValueChange:t(b=>{v(b),a()},"onValueChange"),disabled:s,options:[{value:"copy",title:"Keep editable copies",description:r.accessScope==="projects"?"Move them to My Skills, keeping project access restrictions. Assigned agents keep using them.":"Move them to My Skills. Assigned agents keep using them."},{value:"delete",title:"Delete skills",description:"Remove them from the library. Detach skills used by agents first."}]}),l&&(0,e.jsxs)("div",{role:"alert",className:"text-sm text-destructive",children:[l,i&&(0,e.jsx)(N,{variant:"ghost",size:"sm",disabled:s,onClick:m,children:"Reload source"})]}),(0,e.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,e.jsx)(N,{variant:"outline",disabled:s,onClick:o,children:"Cancel"}),(0,e.jsx)(N,{variant:c==="delete"?"destructive":"default",disabled:s||i||!!(x&&!c),onClick:t(()=>p(c||"copy"),"onClick"),children:s?"Removing…":h})]})]})})}t(_s,"DisconnectSourceDialog");function Bs({companyId:r,source:s,onClose:l,onSaved:i}){const m=`paperclip.skill-source-draft:${r}:${s?.id??"new"}`,[o]=(0,k.useState)(s?.revision),[p]=(0,k.useState)(()=>{try{const u=JSON.parse(sessionStorage.getItem(m)??"{}");return!s||u.revision===s.revision?u:{}}catch{return{}}}),[a,x]=(0,k.useState)(p.repositoryUrl??s?.repositoryUrl??""),[c,v]=(0,k.useState)(p.showRepositoryUrl??!!p.repositoryUrl),[h,b]=(0,k.useState)("connectionId"in p?p.connectionId:s?.connectionId??null),[j,S]=(0,k.useState)(null),[d,R]=(0,k.useState)(s?p.packageMode??s.packageMode:"repository"),[f,F]=(0,k.useState)(!s&&p.packageMode==="skills"?null:p.discovery??null),[P,q]=(0,k.useState)(()=>new Set(p.selectedPaths??(s?s.entries.filter(u=>u.selection!=="excluded").map(u=>u.path):[]))),[w,$]=(0,k.useState)(p.excludedFolders??s?.excludedFolders??[]),C=ne({queryKey:G.skillSources.repositories(r),queryFn:t(()=>z.repositories(r),"queryFn"),refetchOnMount:"always"}),E=je(C),Q=C.isPending||E.kind==="reconnecting",U=C.data?.repositories??[],re=De(a),ie=U.find(u=>De(u.url)?.repositoryUrl===re?.repositoryUrl),L=ie?.connectionIds??[],O=h&&L.includes(h)?h:L[0]??null,Z=O??s?.connectionId??null,K=ms("github"),n=t(()=>$s(r,s?.id??"new"),"rememberReturn");(0,k.useEffect)(()=>{Is(r)},[r]),(0,k.useEffect)(()=>{sessionStorage.setItem(m,JSON.stringify({revision:o,packageMode:d,repositoryUrl:a,showRepositoryUrl:c,connectionId:h,discovery:f,selectedPaths:[...P],excludedFolders:w}))},[m,o,d,a,c,h,f,P,w]);const y=(0,k.useRef)(null),[A,H]=(0,k.useState)(null),[M,X]=(0,k.useState)([]);(0,k.useEffect)(()=>()=>{y.current?.abort()},[]);const I=V({mutationFn:t(async(u=d)=>{const T=new AbortController;y.current?.abort(),y.current=T,H(null),X([]);const Pe=t(ve=>z.discoverStream(r,{repositoryUrl:a,trackingRef:s?.trackingRef,packageMode:ve,connectionId:s?Z:O},se=>{T.signal.aborted||y.current!==T||(se.type==="progress"?H(se):X(Je=>[...Je.filter(Ze=>Ze.path!==se.candidate.path),se.candidate].slice(-5)))},T.signal),"discover");let ae=await Pe(u);return u==="skills"&&ae.candidates.some(ve=>ve.inspection?.references.some(se=>se.kind==="outside_package"))&&(X([]),ae=await Pe("repository")),{discovery:ae,connectionId:ae.connectionId===void 0?O:ae.connectionId,controller:T}},"mutationFn"),onSuccess:t(u=>{u.controller.signal.aborted||y.current!==u.controller||(F(u.discovery),R(u.discovery.packageMode??d),b(u.connectionId),s||(q(new Set(u.discovery.candidates.map(T=>T.path))),$([])))},"onSuccess")}),g=V({mutationFn:t(()=>s?z.select(r,s.id,{revision:o,packageMode:d,selectedPaths:[...P],excludedFolders:w,connectionId:Z}):z.create(r,{repositoryUrl:f.repositoryUrl,trackingRef:f.trackingRef,commitSha:f.commitSha,packageMode:d,connectionId:h,selectedPaths:[...P],excludedFolders:w}),"mutationFn"),onSuccess:t(async u=>{sessionStorage.removeItem(m),await i(u)},"onSuccess")}),ee=f?.candidates??(s?s.entries.map(u=>({...u,note:u.present?u.selection==="new"?"New skill":u.skillId?"Already imported":void 0:"Removed from source · installed copy retained"})):[]),xe=!!(s||f),pe=f?.repositoryPackage??s?.repositoryPackage,We=Ve(ee.filter(u=>P.has(u.path)),d==="repository"?pe:null,f?.warnings),Ye=(0,e.jsx)(Ps,{packageMode:d,onPreview:t((u,T)=>S({skill:u,filePath:T}),"onPreview"),candidates:ee,selected:P,excludedFolders:w,onChange:t((u,T)=>{q(u),$(T)},"onChange"),disabled:I.isPending||g.isPending}),fe=ee.filter(u=>P.has(u.path)).length,W=I.isPending||g.isPending,Se=(I.error?.name==="AbortError"?null:I.error)??g.error;function Ce(){y.current?.abort(),y.current=null,I.reset(),H(null),X([])}t(Ce,"stopScan");function be(){F(null),I.reset(),g.reset()}t(be,"clearScan");function Re(){Ce(),sessionStorage.removeItem(m),l()}return t(Re,"dismiss"),(0,e.jsx)(ue,{open:!0,onOpenChange:t(u=>{!u&&!g.isPending&&Re()},"onOpenChange"),children:(0,e.jsxs)(de,{className:"flex max-h-(--sz-calc-18) flex-col overflow-hidden p-4 sm:max-w-2xl sm:p-6","aria-describedby":s?"source-description":void 0,children:[(0,e.jsx)(ce,{className:"shrink-0 flex-row items-start justify-between gap-3 pr-6",children:(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsx)(me,{children:s?s.fullName:"Import from GitHub"}),s&&(0,e.jsx)(he,{id:"source-description",children:"Unchecked skills stay installed."})]})}),(0,e.jsxs)("div",{className:"min-h-0 space-y-4 overflow-y-auto",children:[!xe&&!I.isPending&&(0,e.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-2",children:[U.length>0&&(0,e.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsxs)("span",{className:"text-xs text-muted-foreground",children:[U.length," ",U.length===1?"repository":"repositories"]}),(0,e.jsx)(N,{type:"button",variant:"ghost",size:"icon-xs","aria-label":"Refresh repositories",title:"Refresh repositories",disabled:W||C.isFetching,onClick:t(()=>{C.refetch()},"onClick"),children:(0,e.jsx)(_e,{className:C.isFetching?"size-3 animate-spin":"size-3"})})]}),(0,e.jsx)(N,{asChild:!0,variant:"outline",size:"sm",children:(0,e.jsxs)(B,{onClick:n,to:K,children:[(0,e.jsx)(qe,{className:"size-4"}),"Add repos"]})})]}),Q&&(0,e.jsx)("p",{role:"status",className:"text-sm text-muted-foreground",children:"Loading your GitHub repositories…"}),U.length>0&&(0,e.jsxs)(ws,{className:"h-auto border border-border",label:"Source repositories",children:[(0,e.jsx)(ds,{placeholder:"Search repositories…","aria-label":"Search repositories",disabled:W}),(0,e.jsxs)(ks,{className:"max-h-48",children:[(0,e.jsx)(ps,{children:"No matching repositories."}),(0,e.jsx)(Ns,{children:U.map(u=>(0,e.jsxs)(ns,{value:u.fullName,keywords:u.connections,disabled:W,onSelect:t(()=>{x(u.url),be()},"onSelect"),children:[(0,e.jsx)(le,{className:"size-4 shrink-0"}),(0,e.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,e.jsx)("span",{className:"block truncate",children:u.fullName}),(0,e.jsx)("span",{className:"block truncate text-xs text-muted-foreground",children:u.connections.join(" · ")})]}),u.private&&(0,e.jsx)(gs,{className:"size-3 shrink-0 text-muted-foreground","aria-label":"Private repository"}),ie?.id===u.id&&(0,e.jsx)(Ne,{className:"size-4 shrink-0","aria-label":"Selected repository"})]},u.id))})]})]}),(E.kind==="error"||!!C.data?.failedConnectionCount)&&(0,e.jsxs)("p",{role:"alert",className:"text-xs text-destructive",children:[U.length?"Some GitHub connections could not load repositories.":"Could not load GitHub repositories."," ",(0,e.jsx)(N,{variant:"ghost",size:"sm",disabled:C.isFetching,onClick:t(()=>{C.refetch()},"onClick"),children:"Try again"}),(0,e.jsx)(B,{to:"/apps",className:"underline",children:"Manage connections"})]}),!Q&&U.length===0&&(0,e.jsx)(N,{asChild:!0,variant:"outline",className:"h-28 w-full flex-col gap-3 whitespace-normal text-center",children:(0,e.jsxs)(B,{onClick:n,to:K,children:[(0,e.jsx)(le,{className:"size-6"}),"Connect GitHub to see your repos"]})}),(0,e.jsx)(N,{type:"button",variant:"link",size:"sm",className:"h-auto self-end p-0 text-xs font-normal text-muted-foreground underline",disabled:W,"aria-expanded":c,"aria-controls":"source-repository-url",onClick:t(()=>v(!0),"onClick"),children:"... or add public repo by URL"})]}),c&&(0,e.jsxs)("label",{id:"source-repository-url",className:"flex flex-col gap-2 text-sm",children:["Repository URL",(0,e.jsx)(hs,{autoFocus:!0,value:a,onChange:t(u=>{x(u.target.value),be()},"onChange"),placeholder:"https://github.com/owner/repository",disabled:W})]})]}),xe&&!g.isPending&&(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-3 text-xs text-muted-foreground",children:[!s&&(0,e.jsx)("span",{className:"break-all",children:f?.fullName}),(0,e.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,e.jsx)(Le,{className:"size-3.5"}),(0,e.jsx)("span",{className:"font-mono",children:s?.trackingRef==="HEAD"?"Default branch":s?.trackingRef??f?.trackingRef})]}),(0,e.jsxs)("a",{href:s?.repositoryUrl??f?.repositoryUrl,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 hover:text-foreground",children:["View on GitHub",(0,e.jsx)(Ge,{className:"size-3"})]})]}),s?.lastError&&(0,e.jsxs)("p",{role:"alert",className:"text-sm text-destructive",children:[s.lastError," ",(0,e.jsx)(B,{onClick:n,to:s.connectionId?`/apps/${s.connectionId}/permissions`:K,className:"underline",children:"Manage GitHub connection"})]}),xe&&!g.isPending&&!I.isPending&&(0,e.jsxs)("div",{className:"space-y-3",children:[d==="repository"?(0,e.jsx)(e.Fragment,{children:ee[0]&&(0,e.jsxs)(N,{variant:"outline",size:"sm",onClick:t(()=>S({skill:ee[0],repository:!0}),"onClick"),children:[(0,e.jsx)(ge,{className:"size-4"}),"View ",pe?.files.length??0," ",pe?.files.length===1?"file":"files"]})}):null,Ye,(0,e.jsx)(Qe,{warnings:We})]}),Se&&(0,e.jsxs)("p",{role:"alert",className:"text-sm text-destructive",children:[Y(Se).body," ",(0,e.jsx)(B,{onClick:n,to:K,className:"underline",children:"Connect a GitHub account"})]}),I.isPending&&(0,e.jsx)(Fe,{repository:re?.fullName??a,progress:A,found:M}),g.isPending&&(0,e.jsx)(Fe,{importing:!0,repository:s?.fullName??f.fullName,count:fe,found:ee.filter(u=>P.has(u.path)&&!u.error).map(u=>({...u,fileCount:u.inspection?.files.length??1}))})]}),(0,e.jsxs)("footer",{className:"flex shrink-0 items-center justify-between gap-3 border-t border-border pt-4",children:[(0,e.jsx)(N,{variant:"ghost",disabled:g.isPending,onClick:t(()=>{I.isPending?Ce():f&&!s?be():Re()},"onClick"),children:I.isPending?"Cancel scan":f&&!s?"Back":"Cancel"}),xe?(0,e.jsx)(N,{disabled:W||!s&&d==="skills"&&fe===0,onClick:t(()=>g.mutate(),"onClick"),children:g.isPending?"Saving…":s?"Save selection":d==="repository"?"Import repository":`Import ${fe} ${fe===1?"skill":"skills"}`}):(0,e.jsx)(N,{disabled:W||C.isPending||!a.trim(),onClick:t(()=>I.mutate(d),"onClick"),children:I.isPending?"Scanning…":"Find skills"})]}),j&&(0,e.jsx)(Ls,{companyId:r,repositoryPackage:j.repository?pe??void 0:void 0,repository:{packageMode:d,repositoryUrl:s?.repositoryUrl??f.repositoryUrl,connectionId:s?Z:h},commitSha:j.skill.inspection?.commitSha??s?.lastScanCommit??f?.commitSha??null,skill:j.skill,initialFile:j.filePath,onClose:t(()=>S(null),"onClose")},`${d}:${j.repository}:${j.skill.path}:${j.filePath??""}`)]})})}t(Bs,"SourceDialog");export{Ws as SkillSources};