@inkeep/open-knowledge 0.49.1 → 0.50.0-beta.0

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 (290) hide show
  1. package/dist/{acp-harness-probe-C8FhVWZi.mjs → acp-harness-probe-LTFljjjT.mjs} +2 -2
  2. package/dist/cli.mjs +26 -26
  3. package/dist/constants-DKkdtsrQ.mjs +2 -0
  4. package/dist/{git-handle-r3d7s3VF.mjs → git-handle-B9WUn7B2.mjs} +2 -2
  5. package/dist/git-handle-BfyNyc1q.mjs +1 -0
  6. package/dist/index.mjs +192 -192
  7. package/dist/init-CUlzbSqG.mjs +1 -0
  8. package/dist/{init-VslWN3Iz.mjs → init-DoE9fKH8.mjs} +3 -3
  9. package/dist/{launch-json-removal-9-8M5r9e.mjs → launch-json-removal--afgb0jV.mjs} +2 -2
  10. package/dist/{loader-f3tIWlWk.mjs → loader-C00kGDZz.mjs} +2 -2
  11. package/dist/loader-Dd0F_wFU.mjs +1 -0
  12. package/dist/md-manager-DGG55-uN.mjs +2 -0
  13. package/dist/{open-browser-BgReR_t5.mjs → open-browser-BuOrhXvS.mjs} +2 -2
  14. package/dist/parse-worker.mjs +1 -1
  15. package/dist/{preview-CdESX2Ja.mjs → preview-CMjft0ek.mjs} +2 -2
  16. package/dist/preview-D-x1bfxi.mjs +1 -0
  17. package/dist/public/assets/ActivityModeContent-HRSmxB9_.js +1 -0
  18. package/dist/public/assets/{AgentDiffPane-T499-ugv.js → AgentDiffPane-BGYo5UN6.js} +1 -1
  19. package/dist/public/assets/{AgentThreadClientBinder-BlMGv16y.js → AgentThreadClientBinder-0uU00Tq4.js} +1 -1
  20. package/dist/public/assets/{AppMenubar-dik_dmjC.js → AppMenubar-Dk1BEmD9.js} +1 -1
  21. package/dist/public/assets/{BugReportHistory-DymFE_6x.js → BugReportHistory-CRlvJE2K.js} +1 -1
  22. package/dist/public/assets/{BugReportHistoryDialog-D28ahq-6.js → BugReportHistoryDialog-DIqnZXkT.js} +1 -1
  23. package/dist/public/assets/ChangedOutsideBadge-CG45zoCT.js +1 -0
  24. package/dist/public/assets/{CodeMirrorPropInput-3TWUbzXY.js → CodeMirrorPropInput-B__Dqs8P.js} +3 -3
  25. package/dist/public/assets/{ConfigSharingInfoTooltip-Bwt_R43K.js → ConfigSharingInfoTooltip-BNI3Q3Qo.js} +1 -1
  26. package/dist/public/assets/ConsentDialogBody-BlayjFQq.js +2 -0
  27. package/dist/public/assets/{CopyButton-DysciFW5.js → CopyButton-Q-6hSzy6.js} +1 -1
  28. package/dist/public/assets/{DiffView-DY54R06f.js → DiffView-BnNY_4OT.js} +1 -1
  29. package/dist/public/assets/DocumentContext-Dxzqsjf0.js +38 -0
  30. package/dist/public/assets/EditorModeToggle-OACqdrIA.js +1 -0
  31. package/dist/public/assets/EnableSyncConfirmDialog-DBMws9uC.js +1 -0
  32. package/dist/public/assets/FeedbackForm-YQbdmBFL.js +1 -0
  33. package/dist/public/assets/GraphPanel-BlBOG-me.js +44 -0
  34. package/dist/public/assets/ImportSkillDialog-CgeVAxXn.js +1 -0
  35. package/dist/public/assets/{LintConfigEditor-3f4-NF1O.js → LintConfigEditor-v0oqzBfd.js} +1 -1
  36. package/dist/public/assets/ManagedArtifactProperties-BfO4jYnj.js +2 -0
  37. package/dist/public/assets/ManagedArtifactProperties-Dmjq1ugS.js +1 -0
  38. package/dist/public/assets/McpConsentDialogBody-DcaMMYmf.js +1 -0
  39. package/dist/public/assets/{Mermaid-Cr48L9fH.js → Mermaid-cUFqNhzC.js} +1 -1
  40. package/dist/public/assets/{MermaidDocEditor-C30-UfMg.js → MermaidDocEditor-YEj8k0Fj.js} +1 -1
  41. package/dist/public/assets/{RegisteredAgentIcon-Cdt1gfjt.js → RegisteredAgentIcon-CCgDsAUc.js} +1 -1
  42. package/dist/public/assets/{ReportBugDialogBody-BUGec7jk.js → ReportBugDialogBody-f7fl9dVO.js} +1 -1
  43. package/dist/public/assets/SchemaConfigEditor-C_BBar0x.js +1 -0
  44. package/dist/public/assets/SessionsHost-DPObQsYR.js +2 -0
  45. package/dist/public/assets/SettingsDialogBody-C53PpDiP.js +12 -0
  46. package/dist/public/assets/ShareBranchSwitchDialog-DMbjNni-.js +1 -0
  47. package/dist/public/assets/ShareReceiveDialog-DMLSpBoi.js +1 -0
  48. package/dist/public/assets/{ShareReceiveMissDialog-B03ClkaE.js → ShareReceiveMissDialog-TTjnDvC9.js} +1 -1
  49. package/dist/public/assets/{SkillEditBanner-C7z-32HN.js → SkillEditBanner-Dmsi4hSW.js} +1 -1
  50. package/dist/public/assets/{SkillOriginInline-DgWSnmXH.js → SkillOriginInline-BoGssBkU.js} +1 -1
  51. package/dist/public/assets/{SkillToolbarControls-PvRY_LHn.js → SkillToolbarControls-C8yypIJ3.js} +1 -1
  52. package/dist/public/assets/SlidesToolbarControls-CWIkYgNX.js +1 -0
  53. package/dist/public/assets/SourceEditor-D3dXest3.js +1 -0
  54. package/dist/public/assets/{TerminalPanel-Bl3bWVA_.js → TerminalPanel-D_OODFVz.js} +3 -3
  55. package/dist/public/assets/{TerminalWindowApp-CFxcrkfe.js → TerminalWindowApp-Dwoah4yb.js} +1 -1
  56. package/dist/public/assets/{TextDocEditor-CHDC5byq.js → TextDocEditor-DzdzVGmP.js} +1 -1
  57. package/dist/public/assets/ThreadView-DJxvdzfd.js +10 -0
  58. package/dist/public/assets/TimelineDiffPane-D5U46urB.js +2 -0
  59. package/dist/public/assets/{agent-diff-store-B7oQn7l7.js → agent-diff-store-DmpkFUx3.js} +1 -1
  60. package/dist/public/assets/arrow-up-right-CXYxHO7Z.js +1 -0
  61. package/dist/public/assets/auth-state-cache-Dm1J9vyz.js +11 -0
  62. package/dist/public/assets/{braces-Ytg60O62.js → braces-54VO1tdr.js} +1 -1
  63. package/dist/public/assets/{calendar-GynmFVw0.js → calendar-BhCmsdcp.js} +1 -1
  64. package/dist/public/assets/{case-sensitive-DvBZDISP.js → case-sensitive-BpYLDHFG.js} +1 -1
  65. package/dist/public/assets/check-DA6LolTH.js +1 -0
  66. package/dist/public/assets/{checkbox-V0IoPAe3.js → checkbox-gpfWb1pY.js} +1 -1
  67. package/dist/public/assets/{chevron-down-DrpHBSgH.js → chevron-down-Ccgt58N5.js} +1 -1
  68. package/dist/public/assets/chevron-left-DY9flfyc.js +1 -0
  69. package/dist/public/assets/chevron-right-2RK4DD3b.js +1 -0
  70. package/dist/public/assets/{chevron-up-CsH_dTwv.js → chevron-up-DXAtCwKR.js} +1 -1
  71. package/dist/public/assets/client-version-BbTOZkhQ.js +1 -0
  72. package/dist/public/assets/{cm-theme-BJSRL90r.js → cm-theme-DPWSzbOc.js} +1 -1
  73. package/dist/public/assets/comment-chips-CNh6cTT4.js +5 -0
  74. package/dist/public/assets/config-provider-CZ_6SNHv.js +5 -0
  75. package/dist/public/assets/{dialog-eak3pI7G.js → dialog-O4u6_xiQ.js} +1 -1
  76. package/dist/public/assets/{dist-DndwauQ3.js → dist-BpOfJRMm.js} +1 -1
  77. package/dist/public/assets/{dist-hwUYIgzz.js → dist-C1TyNsxp.js} +1 -1
  78. package/dist/public/assets/{dist-BCM06z1D.js → dist-CDMQmWZl.js} +1 -1
  79. package/dist/public/assets/{dist-BDJLSjo2.js → dist-CI5_cNui.js} +1 -1
  80. package/dist/public/assets/{dist-CkHhDuKZ.js → dist-CJuiZAB0.js} +1 -1
  81. package/dist/public/assets/{dist-DvtYFuZI.js → dist-CNm9tACe.js} +1 -1
  82. package/dist/public/assets/{dist-DJ3iQH0N.js → dist-CebtYbHb.js} +1 -1
  83. package/dist/public/assets/{dist--4AcVRue.js → dist-CpwfhxFl.js} +1 -1
  84. package/dist/public/assets/{dist-DNV7r8rH.js → dist-DU2smIGg.js} +1 -1
  85. package/dist/public/assets/{dist-PVtTd_Sj2.js → dist-TVrIGknK2.js} +111 -111
  86. package/dist/public/assets/{dist-Wj2cwRLU.js → dist-hrQOAqN1.js} +1 -1
  87. package/dist/public/assets/{dist-yYRRvtMr.js → dist-wfUjMP-v.js} +1 -1
  88. package/dist/public/assets/{dist-ClczuKkQ.js → dist-y6w4IT08.js} +1 -1
  89. package/dist/public/assets/doc-paths-BKAhPn1c.js +1 -0
  90. package/dist/public/assets/{documents-events-COSAPFkC.js → documents-events-B6nWdFan.js} +1 -1
  91. package/dist/public/assets/{download-Bq4sKAdj.js → download-BuEN0lZf.js} +1 -1
  92. package/dist/public/assets/{dropdown-menu-BhMtMvZp.js → dropdown-menu-CP1RnfZI.js} +1 -1
  93. package/dist/public/assets/{eye-DYUvwA0Z.js → eye-CYj_zi2W.js} +1 -1
  94. package/dist/public/assets/{field-DN11CYjs.js → field-BADrt9_J.js} +1 -1
  95. package/dist/public/assets/{file-tree-adapter-B9dmiTPy.js → file-tree-adapter-Dhf8gmFi.js} +1 -1
  96. package/dist/public/assets/{file-tree-utils-CvsKsHRh.js → file-tree-utils-Cx1c51Ql.js} +1 -1
  97. package/dist/public/assets/{folder-Cnftw7jd.js → folder-CWVPrRtx.js} +1 -1
  98. package/dist/public/assets/folder-config-api-CKhPo3Lt.js +1 -0
  99. package/dist/public/assets/{folder-open-DoQalFip.js → folder-open-BXfoqsrp.js} +1 -1
  100. package/dist/public/assets/{follow-file-BymUhAtT.js → follow-file-BRGwJuKy.js} +1 -1
  101. package/dist/public/assets/{git-branch-BWBPTGqT.js → git-branch-CMN6cdzm.js} +1 -1
  102. package/dist/public/assets/globals-CIRDbOmQ.css +1 -0
  103. package/dist/public/assets/{hash-BZXl_HqD.js → hash-BS4ux6bl.js} +1 -1
  104. package/dist/public/assets/history-CiIvI4I4.js +1 -0
  105. package/dist/public/assets/i18n-iRTrMKQI.js +1 -0
  106. package/dist/public/assets/index-Dask65mE.js +2097 -0
  107. package/dist/public/assets/{info-Jj1j2YxC.js → info-160SNOuG.js} +1 -1
  108. package/dist/public/assets/{input-group-H-ZoGiXT.js → input-group-CPKSxoq5.js} +1 -1
  109. package/dist/public/assets/{lint-config-client-DkwFMG_T.js → lint-config-client-KRlZx1_T.js} +1 -1
  110. package/dist/public/assets/{list-plus-IYEFhKGU.js → list-plus-BPvSuFZX.js} +1 -1
  111. package/dist/public/assets/loader-circle-BbuX0POi.js +1 -0
  112. package/dist/public/assets/{local-menu-action-bus-DLozq_c4.js → local-menu-action-bus-BDB0W02w.js} +1 -1
  113. package/dist/public/assets/markdownlint-rule-browser-BAnqBevm.js +1 -0
  114. package/dist/public/assets/{mcp-consent-store-B_Tog3LX.js → mcp-consent-store-yqsuAEir.js} +1 -1
  115. package/dist/public/assets/messages-52Q73NDn.js +1 -0
  116. package/dist/public/assets/messages-B-LUKCxb.js +1 -0
  117. package/dist/public/assets/messages-Bjt29O_q.js +1 -0
  118. package/dist/public/assets/messages-BzwBNPDu.js +1 -0
  119. package/dist/public/assets/messages-CGjveR2E.js +1 -0
  120. package/dist/public/assets/messages-CkanzrCR.js +1 -0
  121. package/dist/public/assets/messages-Cy75Ipbk.js +1 -0
  122. package/dist/public/assets/messages-D2UntltU.js +1 -0
  123. package/dist/public/assets/messages-D8H0FnV4.js +1 -0
  124. package/dist/public/assets/messages-Dl7JEKLk.js +1 -0
  125. package/dist/public/assets/messages-s-nrsPLp.js +1 -0
  126. package/dist/public/assets/minus-Ba4o_31L.js +1 -0
  127. package/dist/public/assets/{miss-dialog-store--ihxgGwV.js → miss-dialog-store-CdaZpyLg.js} +1 -1
  128. package/dist/public/assets/{navigation-targets-DKe7BSku.js → navigation-targets-BhdJAW-R.js} +1 -1
  129. package/dist/public/assets/open-managed-artifact-tab-CgUiYJiR.js +1 -0
  130. package/dist/public/assets/{panel-right-open-BhUOm1Eq.js → panel-right-open-_nL1w4h-.js} +1 -1
  131. package/dist/public/assets/{paperclip-9gdTBktj.js → paperclip-DV67TMJS.js} +1 -1
  132. package/dist/public/assets/pending-receive-nav-store-Crda7hlg.js +1 -0
  133. package/dist/public/assets/{project-paths-fLhDAPyF.js → project-paths-BWmSfpDI.js} +1 -1
  134. package/dist/public/assets/prop-types-CvU-2DkU.js +1 -0
  135. package/dist/public/assets/{receive-store-BvkW9HUo.js → receive-store--Bc0z-E4.js} +1 -1
  136. package/dist/public/assets/{refresh-cw-REpEMEB2.js → refresh-cw-Bjv-Fpq5.js} +1 -1
  137. package/dist/public/assets/{schema-fields-view-intent-DZFjFt0c.js → schema-fields-view-intent-BMlW8LRz.js} +1 -1
  138. package/dist/public/assets/{select-CRztynyQ.js → select-BaOsrrG7.js} +1 -1
  139. package/dist/public/assets/{selection-context-CSP8zK1H.js → selection-context-CsRnyGFj.js} +1 -1
  140. package/dist/public/assets/{separator-k0mwGcaM.js → separator-BXBsYPiB.js} +1 -1
  141. package/dist/public/assets/skill-actions-B7Cmxryy.js +2 -0
  142. package/dist/public/assets/{skill-scope-Dr7iwSW3.js → skill-scope-CwmLPgmT.js} +1 -1
  143. package/dist/public/assets/{skills-api-qDbnaMmu.js → skills-api-DDfyPLwg.js} +1 -1
  144. package/dist/public/assets/{square-pen-D3oI-YUs.js → square-pen-CW0s3lqC.js} +1 -1
  145. package/dist/public/assets/{src-VcUCSe0b.js → src-DfI4uz3u.js} +1 -1
  146. package/dist/public/assets/{tag-pill-input-pBac7WXR.js → tag-pill-input-DnM-Fz1E.js} +1 -1
  147. package/dist/public/assets/{target-navigation-intent-DAyeqt__.js → target-navigation-intent-D8zAsaUV.js} +1 -1
  148. package/dist/public/assets/{telemetry-impl-C9jF13xo.js → telemetry-impl-DFcgjFFc.js} +1 -1
  149. package/dist/public/assets/{telemetry-startup-1DamiHqT.js → telemetry-startup-0F_AW_hr.js} +1 -1
  150. package/dist/public/assets/terminal-BNdVsbND.js +1 -0
  151. package/dist/public/assets/terminal-cli-display-Djf7X5gE.js +1 -0
  152. package/dist/public/assets/terminal-launch-events-B76nHQ-9.js +1 -0
  153. package/dist/public/assets/terminal-telemetry-CynEAJPS.js +1 -0
  154. package/dist/public/assets/{text-viewer-languages-BTzKrM_y.js → text-viewer-languages-BBrkAtBf.js} +2 -2
  155. package/dist/public/assets/thread-client-CER-baRK.js +1 -0
  156. package/dist/public/assets/{trash-2-BSr7FcE8.js → trash-2-rgduGgZB.js} +1 -1
  157. package/dist/public/assets/{triangle-alert-DNTyNeem.js → triangle-alert-CnW4IElJ.js} +1 -1
  158. package/dist/public/assets/{typing-burst-detector-BOmjXV-P.js → typing-burst-detector-DzIKrNKg.js} +4 -4
  159. package/dist/public/assets/{undo-2-u9f9OoCF.js → undo-2-BmxrL5XS.js} +1 -1
  160. package/dist/public/assets/{uninstall-36twrq5C.js → uninstall-DT91VYMe.js} +1 -1
  161. package/dist/public/assets/{use-activity-panel-BwANCYjg.js → use-activity-panel-CbIsW8Oq.js} +1 -1
  162. package/dist/public/assets/use-apply-config-color-theme-Cd_bVm8F.js +1 -0
  163. package/dist/public/assets/{use-collab-url-TKpnPAW8.js → use-collab-url-DESxkkaS.js} +1 -1
  164. package/dist/public/assets/use-live-xterm-theme-D9HFWiME.js +1 -0
  165. package/dist/public/assets/use-open-skill-DyTRfvTr.js +1 -0
  166. package/dist/public/assets/use-settings-route-BXWhuQbZ.js +1 -0
  167. package/dist/public/assets/{use-skill-directory-D9S5f8By.js → use-skill-directory-BaP9hj7C.js} +1 -1
  168. package/dist/public/assets/use-skill-origin-DBXnPKZS.js +1 -0
  169. package/dist/public/assets/{use-skills-D5kEHDif.js → use-skills-CVci-eTA.js} +1 -1
  170. package/dist/public/assets/use-terminal-enabled-DDthawVX.js +1 -0
  171. package/dist/public/assets/{use-timeline-entry-diff-CB_cI1yy.js → use-timeline-entry-diff-BC2rFPLm.js} +2 -2
  172. package/dist/public/assets/{use-workspace--QTATo27.js → use-workspace-CAcWHNxj.js} +1 -1
  173. package/dist/public/assets/{wrench-BPXVnAE5.js → wrench-DtGaC8XY.js} +1 -1
  174. package/dist/public/assets/x-D8xzRaMT.js +1 -0
  175. package/dist/public/index.html +122 -122
  176. package/dist/public/uninstall.html +14 -14
  177. package/dist/{repair-launch-json-DwJ_yLw4.mjs → repair-launch-json-DWyYbCft.mjs} +2 -2
  178. package/dist/{repair-mcp-configs-Q1hO02co.mjs → repair-mcp-configs-IqhFyLaP.mjs} +2 -2
  179. package/dist/repair-skills-Cl53MdUh.mjs +1 -0
  180. package/dist/{repair-skills-DADI6iaT.mjs → repair-skills-DwcUYwoH.mjs} +2 -2
  181. package/dist/server-lock-C5RpbiEy.mjs +1 -0
  182. package/dist/{server-lock-aXnDVUI8.mjs → server-lock-DQ_whZyH.mjs} +2 -2
  183. package/dist/{skill-teardown-onVYT1VF.mjs → skill-teardown-DzuNnHSF.mjs} +2 -2
  184. package/dist/src-BPPzfDas.mjs +2032 -0
  185. package/dist/src-BmsPBIN0.mjs +20 -0
  186. package/dist/src-CWRDxPCK.mjs +1 -0
  187. package/dist/{src-TKCctdpc.mjs → src-Cb3i1kcm.mjs} +5 -5
  188. package/dist/{src-cRpQSbXB.mjs → src-DpX6KBvU.mjs} +1 -1
  189. package/dist/start-BhtWVSU0.mjs +1 -0
  190. package/dist/{start-DRG6a2sz.mjs → start-CB1ruR88.mjs} +3 -3
  191. package/dist/{write-project-skill-DOogyZge.mjs → write-project-skill-DfjjNq9T.mjs} +2 -2
  192. package/package.json +5 -5
  193. package/dist/constants-BkYBCRUx.mjs +0 -2
  194. package/dist/git-handle-DBSzQutT.mjs +0 -1
  195. package/dist/init-BlCMJ0yB.mjs +0 -1
  196. package/dist/loader-Birwg2h1.mjs +0 -1
  197. package/dist/md-manager-BbSzMHHE.mjs +0 -2
  198. package/dist/preview-gKyXf1a0.mjs +0 -1
  199. package/dist/public/assets/ActivityModeContent-C08FYohG.js +0 -1
  200. package/dist/public/assets/ChangedOutsideBadge-GeQfL_b-.js +0 -1
  201. package/dist/public/assets/ConsentDialogBody-Clb82Qbo.js +0 -2
  202. package/dist/public/assets/DocumentContext-C-Lo65-_.js +0 -38
  203. package/dist/public/assets/EditorModeToggle-BjgmECAn.js +0 -1
  204. package/dist/public/assets/EnableSyncConfirmDialog-B1Eo_sVE.js +0 -1
  205. package/dist/public/assets/FeedbackForm-C_A-lpjC.js +0 -1
  206. package/dist/public/assets/GraphPanel-CxJeFUDp.js +0 -44
  207. package/dist/public/assets/ImportSkillDialog-ChsGV6eb.js +0 -1
  208. package/dist/public/assets/ManagedArtifactProperties-B1ZA0ofn.js +0 -2
  209. package/dist/public/assets/ManagedArtifactProperties-B_ecuboX.js +0 -1
  210. package/dist/public/assets/McpConsentDialogBody-CG5af4os.js +0 -1
  211. package/dist/public/assets/SchemaConfigEditor-DPK5XbMd.js +0 -1
  212. package/dist/public/assets/SessionsHost-BRUQMi7f.js +0 -2
  213. package/dist/public/assets/SettingsDialogBody-COTbFRqi.js +0 -12
  214. package/dist/public/assets/ShareBranchSwitchDialog-C0mAHHVQ.js +0 -1
  215. package/dist/public/assets/ShareReceiveDialog-Coi9tYAP.js +0 -1
  216. package/dist/public/assets/SlidesToolbarControls-8TzXHMwI.js +0 -1
  217. package/dist/public/assets/SourceEditor-Duqpede9.js +0 -1
  218. package/dist/public/assets/ThreadView-CAGruMiN.js +0 -10
  219. package/dist/public/assets/TimelineDiffPane-DnaRcvCk.js +0 -2
  220. package/dist/public/assets/agent-visibility-CHYjRInm.js +0 -1
  221. package/dist/public/assets/arrow-up-right-0IN5lFEX.js +0 -1
  222. package/dist/public/assets/auth-state-cache-BUYyIMUZ.js +0 -11
  223. package/dist/public/assets/check-BLuQ2zvV.js +0 -1
  224. package/dist/public/assets/chevron-left-BUr-yKA4.js +0 -1
  225. package/dist/public/assets/chevron-right-BU8AeJST.js +0 -1
  226. package/dist/public/assets/client-version-DfXcf1Qf.js +0 -1
  227. package/dist/public/assets/comment-chips-BhvfCPCk.js +0 -5
  228. package/dist/public/assets/config-context-DNY4at5d.js +0 -1
  229. package/dist/public/assets/config-provider-B7dMDFNr.js +0 -5
  230. package/dist/public/assets/doc-paths-CH8QyanF.js +0 -1
  231. package/dist/public/assets/folder-config-api-IGZhtkRo.js +0 -1
  232. package/dist/public/assets/globals-D9Q1kf3c.css +0 -1
  233. package/dist/public/assets/history-BNEST2Cx.js +0 -1
  234. package/dist/public/assets/i18n-CIRn0AvV.js +0 -1
  235. package/dist/public/assets/index-B-snLDY1.js +0 -2097
  236. package/dist/public/assets/loader-circle-Coob8S41.js +0 -1
  237. package/dist/public/assets/markdownlint-rule-browser-DY5CRVFm.js +0 -1
  238. package/dist/public/assets/messages-6Fd7I7zn.js +0 -1
  239. package/dist/public/assets/messages-BJIB1I1L.js +0 -1
  240. package/dist/public/assets/messages-BOXmrfhw.js +0 -1
  241. package/dist/public/assets/messages-BeOM8jWl.js +0 -1
  242. package/dist/public/assets/messages-CCWKIebo.js +0 -1
  243. package/dist/public/assets/messages-CQFityfC.js +0 -1
  244. package/dist/public/assets/messages-CzRXVtjz.js +0 -1
  245. package/dist/public/assets/messages-DYiuNk7y.js +0 -1
  246. package/dist/public/assets/messages-Db5U-G1d.js +0 -1
  247. package/dist/public/assets/messages-DohtKbKM.js +0 -1
  248. package/dist/public/assets/messages-WWFblTuV.js +0 -1
  249. package/dist/public/assets/minus-DPAjfzCa.js +0 -1
  250. package/dist/public/assets/open-managed-artifact-tab-DGO7syz6.js +0 -1
  251. package/dist/public/assets/pending-receive-nav-store-SZ8w-xKW.js +0 -1
  252. package/dist/public/assets/prop-types-DoONHMUn.js +0 -1
  253. package/dist/public/assets/skill-actions-98H3SnCL.js +0 -2
  254. package/dist/public/assets/terminal-launch-events-CIULxHeu.js +0 -1
  255. package/dist/public/assets/terminal-mGTI25Qq.js +0 -1
  256. package/dist/public/assets/terminal-telemetry-CqkILJJU.js +0 -1
  257. package/dist/public/assets/thread-client-DSDduEdo.js +0 -1
  258. package/dist/public/assets/use-live-xterm-theme-B8OPZLR3.js +0 -1
  259. package/dist/public/assets/use-open-skill-DCSEJ3jJ.js +0 -1
  260. package/dist/public/assets/use-settings-route-CKMxexs3.js +0 -1
  261. package/dist/public/assets/use-skill-origin-8_nwflm6.js +0 -1
  262. package/dist/public/assets/use-terminal-enabled-Ctosnrg_.js +0 -1
  263. package/dist/public/assets/x-COTyTduF.js +0 -1
  264. package/dist/repair-skills-DKwDAoHc.mjs +0 -1
  265. package/dist/server-lock-U8YDpJpq.mjs +0 -1
  266. package/dist/src-BgeIHNkQ.mjs +0 -1
  267. package/dist/src-DNPRz0-U.mjs +0 -20
  268. package/dist/src-Dt5dAyFQ.mjs +0 -2032
  269. package/dist/start-CWIlNpAT.mjs +0 -1
  270. /package/dist/public/assets/{asset-dispatch-Dst62kKY.js → asset-dispatch-_dEhJuVP.js} +0 -0
  271. /package/dist/public/assets/{auth-prompt-store-B92v76dM.js → auth-prompt-store-CeaWNesV.js} +0 -0
  272. /package/dist/public/assets/{badge-B89o8Vy9.js → badge-CY_v_nGy.js} +0 -0
  273. /package/dist/public/assets/{copilot-qpaFt06v.js → copilot-D0J83lOh.js} +0 -0
  274. /package/dist/public/assets/{createLucideIcon-BbftclCc.js → createLucideIcon-BcLKHslE.js} +0 -0
  275. /package/dist/public/assets/{cursor-Df-vt--2.js → cursor-B6-YoFzF.js} +0 -0
  276. /package/dist/public/assets/{desktop-bridge-types-BjBBs_pU.js → desktop-bridge-types-rBjHIYSI.js} +0 -0
  277. /package/dist/public/assets/{dist-BlH6jxEE.js → dist-BTu6o3T-.js} +0 -0
  278. /package/dist/public/assets/{dist-CEwo98ia.js → dist-Bkx5dDHT2.js} +0 -0
  279. /package/dist/public/assets/{dist-C7IFraT6.js → dist-DoS8xGN6.js} +0 -0
  280. /package/dist/public/assets/{documents-fetch-BTUkzxjd.js → documents-fetch-B8A9IAH3.js} +0 -0
  281. /package/dist/public/assets/{external-link-BkNoUOYg.js → external-link-Bw5EK5AQ.js} +0 -0
  282. /package/dist/public/assets/{file-tree-rename-validation-CEz8MVWM.js → file-tree-rename-validation-Dt6fQYnB.js} +0 -0
  283. /package/dist/public/assets/{globals-C-kRTFCu.js → globals-C9aYStL7.js} +0 -0
  284. /package/dist/public/assets/{input-BKUcczSW.js → input-_CzMpvY9.js} +0 -0
  285. /package/dist/public/assets/{overlay-layers-BqWhClsR.js → overlay-layers-C1Y78Wu8.js} +0 -0
  286. /package/dist/public/assets/{panel-CbGx_cRv.js → panel-DVJ8gssn.js} +0 -0
  287. /package/dist/public/assets/{parse-api-error-Cyn4P6OR.js → parse-api-error-Mgtc4OJu.js} +0 -0
  288. /package/dist/public/assets/{startup-marks-BzFN1cqP.js → startup-marks-BPO-vrjH.js} +0 -0
  289. /package/dist/public/assets/{stex-CyLY7DTo.js → stex-Cj2UNqUe.js} +0 -0
  290. /package/dist/public/assets/{workspace-paths-EgbOaHls.js → workspace-paths-D7hYulMY.js} +0 -0
@@ -0,0 +1,2 @@
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{Bn as n,L as r,Sn as i,i as a}from"./DocumentContext-Dxzqsjf0.js";import{t as o}from"./react-f2sANaYj.js";import{n as s,r as c}from"./dist-Nvb76hAm.js";import{t as l}from"./compiler-runtime-BfE3aGVn.js";import{s as u}from"./local-menu-action-bus-BDB0W02w.js";import{t as d}from"./utils-CPqDy6Hr.js";import{c as f,i as p,n as m,o as h,s as g,t as _}from"./ChangedOutsideBadge-CG45zoCT.js";import{t as v}from"./button-RQ5o7P7w.js";import{c as y,i as b,l as x,o as S,t as C}from"./dist-Bi80hc1t.js";import{i as w,n as T,t as E}from"./tooltip-x7BNUa3s.js";import{a as D,c as O,i as k,n as A,o as j,r as M,s as N,t as P}from"./dialog-O4u6_xiQ.js";import{_ as F,a as I,c as L,d as R,f as z,g as B,h as V,i as H,l as U,m as W,n as G,o as K,p as ee,r as q,s as J,t as Y,u as te}from"./dist-G89kioZo.js";import{a as X,d as ne,f as re,i as ie,n as ae,o as oe,p as se,u as ce}from"./dropdown-menu-CP1RnfZI.js";import{t as le}from"./label-BT2yjpKR.js";import{S as ue,a as de,f as fe,h as pe,i as me,m as he,n as ge,o as _e,p as ve,r as ye,s as be}from"./terminal-cli-display-Djf7X5gE.js";import{At as xe,Dn as Se,En as Ce,Er as we,Ft as Te,Pt as Ee,Qa as De,Sn as Oe,Tn as ke,Ya as Ae,Yt as je,_n as Me,bn as Ne,en as Pe,it as Fe,mi as Ie,nn as Le,qa as Re,rn as ze,rt as Be,vn as Ve,wa as He,wn as Ue,wt as We,yn as Ge}from"./dist-TVrIGknK2.js";import{i as Ke}from"./use-settings-route-BXWhuQbZ.js";import{t as qe}from"./dist-DoS8xGN6.js";import{n as Je}from"./dist-Bkx5dDHT2.js";import{c as Ye,n as Xe,o as Ze}from"./documents-events-B6nWdFan.js";import{m as Qe}from"./use-apply-config-color-theme-Cd_bVm8F.js";import{t as $e}from"./parse-api-error-Mgtc4OJu.js";import{n as et,t as tt}from"./workspace-paths-D7hYulMY.js";import{t as nt}from"./use-workspace-CAcWHNxj.js";import{t as rt}from"./createLucideIcon-BcLKHslE.js";import{t as it}from"./RegisteredAgentIcon-CCgDsAUc.js";import{n as at,r as ot}from"./ManagedArtifactProperties-BfO4jYnj.js";import{t as st}from"./check-DA6LolTH.js";import{t as ct}from"./chevron-right-2RK4DD3b.js";import{n as lt}from"./CopyButton-Q-6hSzy6.js";import{t as ut}from"./folder-open-BXfoqsrp.js";import{t as dt}from"./folder-CWVPrRtx.js";import{t as ft}from"./list-plus-BPvSuFZX.js";import{t as pt}from"./trash-2-rgduGgZB.js";import{t as mt}from"./input-_CzMpvY9.js";import{J as ht,q as gt,x as _t}from"./navigation-targets-BhdJAW-R.js";import{a as vt,c as yt,f as bt,n as xt,r as St}from"./skill-scope-CwmLPgmT.js";import{t as Ct}from"./badge-CY_v_nGy.js";import{C as wt,O as Tt,S as Et,a as Dt,b as Ot,j as kt,k as At,l as jt,n as Mt,p as Nt,r as Pt,t as Ft,v as It,y as Lt}from"./skills-api-DDfyPLwg.js";import{t as Rt}from"./use-skills-CVci-eTA.js";import{t as zt}from"./use-open-skill-DyTRfvTr.js";import{n as Bt}from"./clipboard-adapter-C4L1qX1X.js";import{t as Vt}from"./DiffView-BnNY_4OT.js";var Z=e(o(),1),Q=t(),Ht=`ContextMenu`,[Ut,Wt]=y(Ht,[F]),Gt=F(),[Kt,qt]=Ut(Ht),Jt=e=>{let{__scopeContextMenu:t,children:n,onOpenChange:r,dir:i,modal:a=!0}=e,[o,s]=Z.useState(!1),c=Gt(t),l=C(r),u=Z.useCallback(e=>{s(e),l(e)},[l]);return(0,Q.jsx)(Kt,{scope:t,open:o,onOpenChange:u,modal:a,children:(0,Q.jsx)(z,{...c,dir:i,open:o,onOpenChange:u,modal:a,children:n})})};Jt.displayName=Ht;var Yt=`ContextMenuTrigger`,Xt=Z.forwardRef((e,t)=>{let{__scopeContextMenu:n,disabled:r=!1,...i}=e,a=qt(Yt,n),o=Gt(n),s=Z.useRef({x:0,y:0}),c=Z.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...s.current})}),l=Z.useRef(0),u=Z.useCallback(()=>window.clearTimeout(l.current),[]),d=e=>{s.current={x:e.clientX,y:e.clientY},a.onOpenChange(!0)};return Z.useEffect(()=>u,[u]),Z.useEffect(()=>void(r&&u()),[r,u]),(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Y,{...o,virtualRef:c}),(0,Q.jsx)(x.span,{"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,...i,ref:t,style:{WebkitTouchCallout:`none`,...e.style},onContextMenu:r?e.onContextMenu:S(e.onContextMenu,e=>{u(),d(e),e.preventDefault()}),onPointerDown:r?e.onPointerDown:S(e.onPointerDown,En(e=>{u(),l.current=window.setTimeout(()=>d(e),700)})),onPointerMove:r?e.onPointerMove:S(e.onPointerMove,En(u)),onPointerCancel:r?e.onPointerCancel:S(e.onPointerCancel,En(u)),onPointerUp:r?e.onPointerUp:S(e.onPointerUp,En(u))})]})});Xt.displayName=Yt;var Zt=`ContextMenuPortal`,Qt=e=>{let{__scopeContextMenu:t,...n}=e,r=Gt(t);return(0,Q.jsx)(U,{...r,...n})};Qt.displayName=Zt;var $t=`ContextMenuContent`,en=Z.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=qt($t,n),a=Gt(n),o=Z.useRef(!1);return(0,Q.jsx)(H,{...a,...r,ref:t,side:`right`,sideOffset:2,align:`start`,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),!t.defaultPrevented&&o.current&&t.preventDefault(),o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),!t.defaultPrevented&&!i.modal&&(o.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-context-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-context-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-context-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-context-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});en.displayName=$t;var tn=`ContextMenuGroup`,nn=Z.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Gt(n);return(0,Q.jsx)(I,{...i,...r,ref:t})});nn.displayName=tn;var rn=`ContextMenuLabel`,an=Z.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Gt(n);return(0,Q.jsx)(L,{...i,...r,ref:t})});an.displayName=rn;var on=`ContextMenuItem`,sn=Z.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Gt(n);return(0,Q.jsx)(K,{...i,...r,ref:t})});sn.displayName=on;var cn=`ContextMenuCheckboxItem`,ln=Z.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Gt(n);return(0,Q.jsx)(q,{...i,...r,ref:t})});ln.displayName=cn;var un=`ContextMenuRadioGroup`,dn=Z.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Gt(n);return(0,Q.jsx)(te,{...i,...r,ref:t})});dn.displayName=un;var fn=`ContextMenuRadioItem`,pn=Z.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Gt(n);return(0,Q.jsx)(R,{...i,...r,ref:t})});pn.displayName=fn;var mn=`ContextMenuItemIndicator`,hn=Z.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Gt(n);return(0,Q.jsx)(J,{...i,...r,ref:t})});hn.displayName=mn;var gn=`ContextMenuSeparator`,_n=Z.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Gt(n);return(0,Q.jsx)(ee,{...i,...r,ref:t})});_n.displayName=gn;var vn=`ContextMenuArrow`,yn=Z.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Gt(n);return(0,Q.jsx)(G,{...i,...r,ref:t})});yn.displayName=vn;var bn=`ContextMenuSub`,xn=e=>{let{__scopeContextMenu:t,children:n,onOpenChange:r,open:i,defaultOpen:a}=e,o=Gt(t),[s,c]=b({prop:i,defaultProp:a??!1,onChange:r,caller:bn});return(0,Q.jsx)(W,{...o,open:s,onOpenChange:c,children:n})};xn.displayName=bn;var Sn=`ContextMenuSubTrigger`,Cn=Z.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Gt(n);return(0,Q.jsx)(B,{...i,...r,ref:t})});Cn.displayName=Sn;var wn=`ContextMenuSubContent`,Tn=Z.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Gt(n);return(0,Q.jsx)(V,{...i,...r,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-context-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-context-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-context-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-context-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Tn.displayName=wn;function En(e){return t=>t.pointerType===`mouse`?void 0:e(t)}var Dn=Jt,On=Xt,kn=Qt,An=en,jn=nn,Mn=an,Nn=sn,Pn=ln,Fn=hn,In=_n,Ln=xn,Rn=Cn,zn=Tn,$=l();function Bn(e){return{async install(t){let n;try{n=await e.buildAndOpen(t?.force?{force:!0}:void 0)}catch(e){return{ok:!1,reason:`bridge-error`,message:e instanceof Error?e.message:String(e)}}return n.ok?{ok:!0,path:n.path}:{ok:!1,reason:n.reason,message:n.message}}}}function Vn(e={}){let t=e.fetch??globalThis.fetch,n=`${e.apiOrigin??``}/api/install-skill`;return{async install(e){let r;try{r=await t(n,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e?.force?{force:!0}:{})})}catch(e){return{ok:!1,reason:`network-error`,message:e instanceof Error?e.message:String(e)}}if(!r.ok){let e=`HTTP ${r.status}`;try{let t=$e(await r.json());t&&(e=t)}catch{}return{ok:!1,reason:`http-error`,message:e}}let i;try{i=await r.json()}catch(e){return{ok:!1,reason:`parse-error`,message:e instanceof Error?e.message:qe._({id:`1vn0CI`})}}return!i||typeof i.status!=`string`?{ok:!1,reason:`parse-error`,message:qe._({id:`NoY1k4`})}:i.status===`failed`?{ok:!1,reason:`build-failed`,message:i.buildError??qe._({id:`MrUmCD`})}:{ok:!0,path:i.outputPath,handoffWarning:i.handoffError?.message}}}}function Hn(){if(typeof window>`u`)return null;let e=window.okDesktop?.skill;return e?Bn(e):Vn()}var Un=`ok:skill:cowork:installed`,Wn=`1`,Gn=250,Kn=`/api/skill/install-state`;function qn(e){return`${Un}:v${e}`}var Jn=new Map;async function Yn(e={},t={}){let n=t.force?`__force__`:`__default__`,r=Jn.get(n);if(r)return r;let i=Xn(e,t);return Jn.set(n,i),i.finally(()=>{Jn.get(n)===i&&Jn.delete(n)}),i}async function Xn(e,t){let n=e.installer===void 0?Hn():e.installer,r=Zn(e.storage),i=e.fetchSnapshot??$n,a=e.serverTimeoutMs??Gn,o=null;if(!t.force){try{o=await er(i(),a)}catch(e){console.warn(`[cowork-skill] server install-state check failed; falling through:`,e)}if(o){let e=o.targets[`claude-cowork`]??null;if(e&&e.version===o.currentVersion)return{kind:`already-installed`,source:`server`}}}let s=qn(o?.currentVersion??e.fallbackSkillVersion??Qn());if(!t.force&&r?.getItem(s)===Wn)return{kind:`already-installed`,source:`local`};if(!n)return{kind:`host-unsupported`};let c=await n.install({force:t.force??!1});if(!c.ok)return{kind:`install-failed`,reason:c.reason,message:c.message};try{r?.setItem(s,Wn)}catch(e){console.warn(`[cowork-skill] storage.setItem failed (guard will not persist):`,e)}return{kind:`installed-now`,path:c.path,handoffWarning:c.handoffWarning}}function Zn(e){if(e!==void 0)return e;if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function Qn(){return typeof window>`u`?`unknown`:window.okDesktop?.appVersion??`unknown`}async function $n(){let e;try{e=await fetch(Kn,{method:`GET`,cache:`no-store`})}catch{return null}if(!e.ok)return null;try{let t=await e.json();return typeof t?.currentVersion==`string`?t:null}catch{return null}}async function er(e,t){return Promise.race([e,new Promise(e=>{setTimeout(()=>e(null),t)})])}function tr(e){return Yn({},e)}function nr(){return Yn({},{force:!0})}async function rr(e,t){let n;try{n=await t(`/api/handoff`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})}catch(e){return{ok:!1,reason:`dispatch-error`,detail:e instanceof Error?e.message:String(e)}}return n.status===200?{ok:!0}:n.status===404?{ok:!1,reason:`not-installed`,detail:`POST /api/handoff returned 404`}:n.status===422?{ok:!1,reason:`not-installed`,detail:`POST /api/handoff returned ${n.status}`}:{ok:!1,reason:`dispatch-error`,detail:`POST /api/handoff returned ${n.status}`}}async function ir(e,t={}){let n=t.fetch??globalThis.fetch.bind(globalThis);switch(e.target){case`claude-cowork`:return rr({target:`claude-cowork`,url:Pe({mode:`cowork`},e)},n);case`claude-code`:return rr({target:`claude-code`,url:Pe({mode:`code`},e)},n);case`codex`:return rr({target:`codex`,url:Le(e)},n);case`cursor`:return rr({target:`cursor`,url:ze(e),workspacePath:e.projectDir},n);case`copilot`:return{ok:!1,reason:`invalid-payload`,detail:`copilot is terminal-only; launch via requestTerminalLaunch`};case`opencode`:return{ok:!1,reason:`invalid-payload`,detail:`opencode is terminal-only; launch via requestTerminalLaunch`};case`pi`:return{ok:!1,reason:`invalid-payload`,detail:`pi is terminal-only; launch via requestTerminalLaunch`};case`antigravity`:return{ok:!1,reason:`invalid-payload`,detail:`antigravity is terminal-only; launch via requestTerminalLaunch`};case`openclaw`:return{ok:!1,reason:`invalid-payload`,detail:`openclaw is terminal-only; launch via requestTerminalLaunch`};case`hermes`:return{ok:!1,reason:`invalid-payload`,detail:`hermes is terminal-only; launch via requestTerminalLaunch`};default:{let t=e.target;return{ok:!1,reason:`invalid-payload`,detail:`unknown target: ${String(t)}`}}}}async function ar(e,t={}){let n=t.okDesktop??(typeof window<`u`?window.okDesktop:void 0);if(n?.shell?.recordHandoff)try{await n.shell.recordHandoff(e)}catch(e){(t.warn??(e=>console.warn(e)))(`[handoff] recordHandoff IPC rejected (telemetry skipped): ${e instanceof Error?e.message:String(e)}`)}}var or=`open-knowledge:agent-thread-launch`;function sr(e,t=typeof window>`u`?new EventTarget:window){t.dispatchEvent(new CustomEvent(or,{detail:e}))}function cr(e,t=typeof window>`u`?new EventTarget:window){let n=t=>{let n=t instanceof CustomEvent?t.detail:void 0;n&&typeof n.agentId==`string`&&e(n)};return t.addEventListener(or,n),()=>t.removeEventListener(or,n)}function lr(e){if(!e.docName||!e.workspace)return null;let t=tt(e.docName),{contentDir:n,pathSeparator:r}=e.workspace;return{docContext:{relativePath:t},projectDir:n,docPath:et(n,t,r)}}function ur(e){return e.workspace?.contentDir?{docContext:null,projectDir:e.workspace.contentDir,docPath:``}:null}function dr(e){return e.workspace?.contentDir?{docContext:null,createDescription:e.description,createScenario:e.scenario,createMentions:e.mentions,projectDir:e.workspace.contentDir,docPath:``}:null}function fr(e){return pe(e.installUrl).then(()=>void 0)}function pr(e){return!e.workspace?.contentDir||!e.folderRelativePath?null:{docContext:null,folderRelativePath:e.folderRelativePath,projectDir:e.workspace.contentDir,docPath:``}}function mr(e){return!e.workspace?.contentDir||!e.skillName?null:{docContext:null,skill:{name:e.skillName,scope:e.scope},projectDir:e.workspace.contentDir,docPath:``}}function hr(e){if(!e.workspace?.contentDir)return null;let{contentDir:t,pathSeparator:n}=e.workspace;if(e.docName){let r=e.docRelativePath??tt(e.docName),i={scope:`doc`,docRelativePath:r,instruction:e.instruction,mentions:e.mentions};return{docContext:null,compose:e.selection===void 0?i:{...i,selection:e.selection},projectDir:t,docPath:et(t,r,n)}}return e.folderRelativePath?{docContext:null,compose:{scope:`folder`,folderRelativePath:e.folderRelativePath,instruction:e.instruction,mentions:e.mentions},projectDir:t,docPath:``}:{docContext:null,compose:{scope:`project`,instruction:e.instruction,mentions:e.mentions},projectDir:t,docPath:``}}function gr(e){return`Opened in ${e}.`}function _r(e,t=1){return t>=3?qe._({id:`bi2C2s`,values:{displayName:e}}):t===2?qe._({id:`1J0c0X`,values:{displayName:e}}):qe._({id:`Xs7IcT`,values:{displayName:e}})}function vr(e){return e>=3?null:e===2?qe._({id:`Xp94R1`}):qe._({id:`6gRgw8`})}function yr(e,t,n,r,i){let a=i===void 0?{}:{scope:i};return t.ok?{target:e,host:n,outcome:`ok`,ts:r,...a}:{target:e,host:n,outcome:`error`,ts:r,reason:t.reason,...a}}function br(e,t,n,r){if(e.scope===`doc`){let i={scope:`doc`,docRelativePath:e.docRelativePath,instruction:e.instruction,mentions:e.mentions,target:t,autoOpen:n,transport:r};return e.selection===void 0?i:{...i,selection:e.selection}}return e.scope===`folder`?{scope:`folder`,folderRelativePath:e.folderRelativePath,instruction:e.instruction,mentions:e.mentions,target:t,autoOpen:n,transport:r}:{scope:`project`,instruction:e.instruction,mentions:e.mentions,target:t,autoOpen:n,transport:r}}function xr(e,t,n,r){return e.compose?je(br(e.compose,t,n,r)):e.selection?Ue({...e.selection,target:t,transport:r}):e.skill?ke(e.skill.name,e.skill.scope,n):e.ask?Me(e.ask.relativePath,e.ask.instruction,n,t,r):Ie(e.docContext===null?e.folderRelativePath?Oe(e.folderRelativePath,n,e.instruction,r):e.createDescription===void 0?Ge(n,e.instruction,r):Ve(e.createDescription,n,e.createScenario??`new-project`,e.createMentions??[],r):Ne(e.docContext.relativePath,n,e.instruction,r))}function Sr(e,t){let n=typeof e.instruction==`string`&&e.instruction.trim()!==``;return e.compose!==void 0||e.createDescription!==void 0||n?`${Be} ${xr(e,Ee[t].handoffTarget,!1,`terminal`)}`:Ce(e.docContext?.relativePath??null)}function Cr(e){let t=typeof e.instruction==`string`&&e.instruction.trim()!==``;return e.compose!==void 0||e.createDescription!==void 0||t?`${Fe} ${xr(e,`claude-code`,!1,`terminal`)}`:Se(e.docContext?.relativePath??null)}function wr(e){let t=e.docContext?.relativePath;return typeof t!=`string`||t===``?null:t.replace(/\.(md|mdx)$/,``)}function Tr(e){let t=[e.compose?.instruction,e.selection?.instruction,e.ask?.instruction,e.createDescription,e.instruction];for(let e of t)if(typeof e==`string`&&e.trim()!==``)return e;return null}function Er(e,t){sr({agentSource:t?.agent?.source??`registry`,agentId:t?.agent?.id??``,prompt:Cr(e),docName:wr(e),titleHint:Tr(e)})}async function Dr(e,t,n,r=1){if(e===`claude-cowork`&&r===1){let e;try{e=await n.ensureCoworkSkillInstalled()}catch(e){let t=e instanceof Error?e.message:String(e);return n.toast.error(qe._({id:`wbpoGe`,values:{message:t}})),{ok:!1,reason:`dispatch-error`,detail:`install-error: ${t}`}}if(e.kind===`installed-now`)return n.toast.success(qe._({id:`PezM4_`})),{ok:!0};if(e.kind===`install-failed`){let t=e.message??e.reason;return n.toast.error(qe._({id:`wbpoGe`,values:{message:t}})),{ok:!1,reason:`dispatch-error`,detail:`install-failed: ${t}`}}}let i={target:e,projectDir:t.projectDir,docPath:t.docPath,prompt:xr(t,e,n.autoOpen,`url`)},a=await n.dispatchHandoff(i),o=n.isElectronHost()?`electron`:`web`,s=n.now().toISOString(),c=t.compose,l=yr(e,a,o,s,t.selection!=null||c?.scope===`doc`&&c.selection!==void 0?`selection`:void 0);await n.recordHandoff(l);let u=n.getDisplayName(e);if(a.ok)n.toast.success(gr(u));else{let i=vr(r),a=_r(u,r);i===null?n.toast.error(a):n.toast.error(a,{action:{label:i,onClick:()=>{Dr(e,t,n,r+1)}}})}return a}function Or(e){return ve.find(t=>t.id===e)?.displayName??e}function kr(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function Ar(){return{dispatchHandoff:ir,recordHandoff:ar,toast:{success:e=>{Je.success(e)},error:(e,t)=>{Je.error(e,t?{action:t.action}:void 0)}},now:()=>new Date,isElectronHost:()=>kr(),getDisplayName:Or,ensureCoworkSkillInstalled:tr,autoOpen:!0}}function jr(){let e=(0,$.c)(2),{merged:t}=Qe(),n=t?.appearance?.preview?.autoOpen??!0,r;return e[0]===n?r=e[1]:(r={dispatch:(e,t)=>Dr(e,t,{...Ar(),autoOpen:n}),reinstallCoworkSkill:nr},e[0]=n,e[1]=r),r}var Mr=rt(`arrow-left-right`,[[`path`,{d:`M8 3 4 7l4 4`,key:`9rb6wj`}],[`path`,{d:`M4 7h16`,key:`6tx8e3`}],[`path`,{d:`m16 21 4-4-4-4`,key:`siv7j2`}],[`path`,{d:`M20 17H4`,key:`h6l3hr`}]]),Nr=rt(`cloud-download`,[[`path`,{d:`M12 13v8l-4-4`,key:`1f5nwf`}],[`path`,{d:`m12 21 4-4`,key:`1lfcce`}],[`path`,{d:`M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284`,key:`ui1hmy`}]]),Pr=rt(`pencil-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),Fr=rt(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]);function Ir(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Q.jsx)(Dn,{"data-slot":`context-menu`,...n}),t[2]=n,t[3]=r),r}function Lr(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=d(`select-none`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Q.jsx)(On,{"data-slot":`context-menu-trigger`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Rr(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Q.jsx)(jn,{"data-slot":`context-menu-group`,...n}),t[2]=n,t[3]=r),r}function zr(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Q.jsx)(Ln,{"data-slot":`context-menu-sub`,...n}),t[2]=n,t[3]=r),r}function Br(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=d(`z-50 max-h-(--radix-context-menu-content-available-height) min-w-36 origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none motion-reduce:duration-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Q.jsx)(kn,{children:(0,Q.jsx)(An,{"data-slot":`context-menu-content`,className:i,...r})}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Vr(e){let t=(0,$.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,inset:r,variant:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?`default`:a,s;t[5]===n?s=t[6]:(s=d(`group/context-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 focus:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive`,n),t[5]=n,t[6]=s);let c;return t[7]!==r||t[8]!==i||t[9]!==s||t[10]!==o?(c=(0,Q.jsx)(Nn,{"data-slot":`context-menu-item`,"data-inset":r,"data-variant":o,className:s,...i}),t[7]=r,t[8]=i,t[9]=s,t[10]=o,t[11]=c):c=t[11],c}function Hr(e){let t=(0,$.c)(13),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,inset:i,children:n,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o;t[5]===r?o=t[6]:(o=d(`flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,r),t[5]=r,t[6]=o);let s;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Q.jsx)(ct,{className:`ml-auto`}),t[7]=s):s=t[7];let c;return t[8]!==n||t[9]!==i||t[10]!==a||t[11]!==o?(c=(0,Q.jsxs)(Rn,{"data-slot":`context-menu-sub-trigger`,"data-inset":i,className:o,...a,children:[n,s]}),t[8]=n,t[9]=i,t[10]=a,t[11]=o,t[12]=c):c=t[12],c}function Ur(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=d(`z-50 max-h-(--radix-context-menu-content-available-height) min-w-32 origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border bg-popover p-1 text-popover-foreground shadow-lg data-[state=closed]:overflow-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none motion-reduce:duration-0 subtle-scrollbar`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Q.jsx)(zn,{"data-slot":`context-menu-sub-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Wr(e){let t=(0,$.c)(15),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:i,children:r,checked:n,inset:a,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s;t[6]===i?s=t[7]:(s=d(`relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,i),t[6]=i,t[7]=s);let c;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Q.jsx)(`span`,{className:`pointer-events-none absolute right-2`,children:(0,Q.jsx)(Fn,{children:(0,Q.jsx)(st,{})})}),t[8]=c):c=t[8];let l;return t[9]!==n||t[10]!==r||t[11]!==a||t[12]!==o||t[13]!==s?(l=(0,Q.jsxs)(Pn,{"data-slot":`context-menu-checkbox-item`,"data-inset":a,className:s,checked:n,...o,children:[c,r]}),t[9]=n,t[10]=r,t[11]=a,t[12]=o,t[13]=s,t[14]=l):l=t[14],l}function Gr(e){let t=(0,$.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,inset:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=d(`px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7`,n),t[4]=n,t[5]=a);let o;return t[6]!==r||t[7]!==i||t[8]!==a?(o=(0,Q.jsx)(Mn,{"data-slot":`context-menu-label`,"data-inset":r,className:a,...i}),t[6]=r,t[7]=i,t[8]=a,t[9]=o):o=t[9],o}function Kr(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=d(`-mx-1 my-1 h-px bg-border`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Q.jsx)(In,{"data-slot":`context-menu-separator`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function qr(e){let t=(0,$.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Q.jsx)(Rr,{...r}):(0,Q.jsx)(ie,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Jr(e){let t=(0,$.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Q.jsx)(Vr,{...r}):(0,Q.jsx)(X,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Yr(e){let t=(0,$.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Q.jsx)(Wr,{...r}):(0,Q.jsx)(ae,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Xr(e){let t=(0,$.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Q.jsx)(Gr,{...r}):(0,Q.jsx)(oe,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Zr(e){let t=(0,$.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Q.jsx)(Kr,{...r}):(0,Q.jsx)(ce,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Qr(e){let t=(0,$.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Q.jsx)(zr,{...r}):(0,Q.jsx)(ne,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function $r(e){let t=(0,$.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Q.jsx)(Ur,{...r}):(0,Q.jsx)(re,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function ei(e){let t=(0,$.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Q.jsx)(Hr,{...r}):(0,Q.jsx)(se,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}var ti=Object.freeze({hosts:null,source:null}),ni=new Map,ri=new Map;function ii(e,t){return`${e}:${t}`}function ai(e){return ni.get(e)??ti}function oi(e,t){let n=ri.get(e)??new Set;return ri.set(e,n),n.add(t),()=>{n.delete(t),n.size===0&&ri.delete(e)}}function si(e,t){let n=ai(e),r={...n,...t};if(!(r.hosts===n.hosts&&r.source===n.source)){r.hosts===null&&r.source===null?ni.delete(e):ni.set(e,r);for(let t of ri.get(e)??[])t()}}var ci=xe.options,li=`min-w-[24rem]`;function ui(e,t){let n=(0,$.c)(45),r=t.installingName===e.name,i=(0,Z.useRef)(e),[a,o]=(0,Z.useState)(!1),s=(0,Z.useRef)(!1),c,l;n[0]===r?(c=n[1],l=n[2]):(c=()=>{s.current&&!r&&o(!0),s.current=r},l=[r],n[0]=r,n[1]=c,n[2]=l),(0,Z.useEffect)(c,l);let u,d;n[3]===e?(u=n[4],d=n[5]):(u=()=>{e!==i.current&&(i.current=e,o(!1))},d=[e],n[3]=e,n[4]=u,n[5]=d),(0,Z.useEffect)(u,d);let f=r||a,p;n[6]!==e.name||n[7]!==e.scope?(p=ii(e.scope,e.name),n[6]=e.name,n[7]=e.scope,n[8]=p):p=n[8];let m=p,h,g;n[9]===m?(h=n[10],g=n[11]):(h=e=>oi(m,e),g=()=>ai(m),n[9]=m,n[10]=h,n[11]=g);let _=(0,Z.useSyncExternalStore)(h,g),v=_.hosts,y=_.source,b,x;n[12]!==y||n[13]!==m||n[14]!==e.hosts?(b=()=>{y!==null&&e.hosts[0]===y&&si(m,{source:null})},x=[e.hosts,y,m],n[12]=y,n[13]=m,n[14]=e.hosts,n[15]=b,n[16]=x):(b=n[15],x=n[16]),(0,Z.useEffect)(b,x);let S=e.linkMode===!0,C=v??e.hosts,w;n[17]===C?w=n[18]:(w=new Set(C),n[17]=C,n[18]=w);let T=w,E=v?v.length>0:e.installed,D=(0,Z.useRef)(e.hosts),O,k;n[19]!==v||n[20]!==e.hosts?(O=()=>{v===null&&(D.current=e.hosts)},k=[v,e.hosts],n[19]=v,n[20]=e.hosts,n[21]=O,n[22]=k):(O=n[21],k=n[22]),(0,Z.useEffect)(O,k);let A;n[23]===e.hosts?A=n[24]:(A=[...e.hosts].sort().join(`,`),n[23]=e.hosts,n[24]=A);let j=A,M,N;n[25]!==m||n[26]!==j?(M=()=>{let e=ai(m).hosts;e&&[...e].sort().join(`,`)===j&&si(m,{hosts:null})},N=[j,m],n[25]=m,n[26]=j,n[27]=M,n[28]=N):(M=n[27],N=n[28]),(0,Z.useEffect)(M,N);let P=(0,Z.useRef)(null),F=(0,Z.useRef)(null),I,L;n[29]===Symbol.for(`react.memo_cache_sentinel`)?(I=()=>()=>{P.current&&clearTimeout(P.current),F.current?.(),F.current=null},L=[],n[29]=I,n[30]=L):(I=n[29],L=n[30]),(0,Z.useEffect)(I,L);let R;n[31]!==t||n[32]!==m||n[33]!==e?(R=function(n,r){D.current=n,si(m,{hosts:n}),P.current&&clearTimeout(P.current);let i=async()=>{F.current=null,P.current=null;let r=await t.install(e,n.filter(we));if(!r.ok){si(m,{hosts:null});return}D.current=[...r.hosts],si(m,{hosts:[...r.hosts]})};r?(F.current=()=>void i(),P.current=setTimeout(()=>void i(),350)):(F.current=null,i())},n[31]=t,n[32]=m,n[33]=e,n[34]=R):R=n[34];let z=R,B;return n[35]!==t||n[36]!==z||n[37]!==T||n[38]!==E||n[39]!==f||n[40]!==y||n[41]!==m||n[42]!==S||n[43]!==e?(B={hostSet:T,installed:E,installing:f,toggleEditor(e,t){let n=new Set(D.current);t?n.add(e):n.delete(e),z([...n],!0)},installAll(){let t=D.current.filter(pi),n=e.installableEditors??ci,r=ci.filter(e=>n.includes(e)||D.current.includes(e));z([...t,...r],!1)},linkMode:S,sourceHost:y??e.hosts[0],placeAt(n,r){t.runLocationWrite(e,()=>Lt({scope:e.scope,name:e.name,dir:n,mode:r})).then(fi)},unplaceAt(n){t.runLocationWrite(e,()=>At({scope:e.scope,name:e.name,path:n})).then(di)},setSource(n){si(m,{source:n}),t.runLocationWrite(e,()=>Tt({scope:e.scope,name:e.name,target:n})).then(e=>{e.ok||(si(m,{source:null}),Je.error(e.error))})},convertLocation(n,r){t.convertLocations(e,[{target:n,mode:r}])},convertLocations(n){t.convertLocations(e,n)}},n[35]=t,n[36]=z,n[37]=T,n[38]=E,n[39]=f,n[40]=y,n[41]=m,n[42]=S,n[43]=e,n[44]=B):B=n[44],B}function di(e){e.ok||Je.error(e.error)}function fi(e){e.ok||Je.error(e.error)}function pi(e){return!ci.includes(e)}function mi(e){let t=(0,$.c)(7),{hint:n,children:r}=e,i;t[0]===r?i=t[1]:(i=(0,Q.jsx)(w,{asChild:!0,children:r}),t[0]=r,t[1]=i);let a;t[2]===n?a=t[3]:(a=(0,Q.jsx)(T,{side:`right`,className:`max-w-xs`,children:n}),t[2]=n,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,Q.jsxs)(E,{children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function hi(e){let t=(0,$.c)(165),{toggles:n,skill:r,onResolveFork:i,onRunStart:a,menuKind:o}=e,l=o===void 0?`dropdown`:o,{_:u}=c(),{hostSet:d,toggleEditor:f,installAll:p}=n,h;t[0]===r?h=t[1]:(h=e=>r?`${yt(e,r.scope)}/${r.name}`:null,t[0]=r,t[1]=h);let g=h,y=Rt(),b;t[2]!==y.data||t[3]!==y.status||t[4]!==r?(b=r!==void 0&&((r.hosts??[]).includes(`agents`)||y.status===`ready`&&y.data.some(Di)),t[2]=y.data,t[3]=y.status,t[4]=r,t[5]=b):b=t[5];let x=b,S;t[6]!==y.data||t[7]!==y.status||t[8]!==r?(S=r?.hostAliases??(r&&y.status===`ready`?Object.assign({},...y.data.filter(e=>e.scope===r.scope).map(Ei)):{}),t[6]=y.data,t[7]=y.status,t[8]=r,t[9]=S):S=t[9];let C=S,w;t[10]!==y.data||t[11]!==y.status||t[12]!==r?(w=r?.installableEditors??(r&&y.status===`ready`?y.data.find(e=>e.scope===r.scope)?.installableEditors:void 0),t[10]=y.data,t[11]=y.status,t[12]=r,t[13]=w):w=t[13];let T=w,E,D,O,k,A,j,M;if(t[14]!==u||t[15]!==C||t[16]!==y.data||t[17]!==y.status||t[18]!==d||t[19]!==x||t[20]!==p||t[21]!==T||t[22]!==l||t[23]!==i||t[24]!==a||t[25]!==g||t[26]!==r||t[27]!==f||t[28]!==n){let e=T?new Set(T):null,o;t[36]===C?o=t[37]:(o=e=>!(e in C),t[36]=C,t[37]=o);let c=(x?[`agents`,...ci]:ci).filter(o).filter(t=>t===`agents`||e===null||e.has(t)||d.has(t)),h;t[38]===g?h=t[39]:(h=e=>g(e),t[38]=g,t[39]=h);let b=new Set(c.map(h)),S=r?.scope===`global`?`~/`:``,w;t[40]!==S||t[41]!==r?(w=r?.path?.includes(`/`)?`${S}${r.path.replace(/\/SKILL\.mdx?$/i,``)}`:null,t[40]=S,t[41]=r,t[42]=w):w=t[42];let N=w,P=N!==null&&!b.has(N)?N:null,F=P===null?n.sourceHost??r?.hosts?.[0]:void 0,I;t[43]===C?I=t[44]:(I=e=>xt(C,e),t[43]=C,t[44]=I);let L=I,R=Ti,z;t[45]!==u||t[46]!==L?(z=e=>{let t=L(e);return t.length===0?!0:window.confirm(u({id:`Uobeu9`,values:{0:t.map(R).join(`, `),rootRel:e}}))},t[45]=u,t[46]=L,t[47]=z):z=t[47];let B=z,V;t[48]!==u||t[49]!==r?(V=(e,t)=>{let n=e.includes(`/`)?e:yt(e,r?.scope??`project`);return(0,Q.jsx)(mi,{hint:u({id:`0dslv8`,values:{0:R(e),1:R(e),2:r?.name??``,poolRootRel:t,subRoot:n}}),children:(0,Q.jsx)(v,{variant:`ghost`,size:`sm`,className:`h-4 shrink-0 px-0`,"aria-label":u({id:`G6Lrs_`,values:{0:R(e)}}),onClick:i=>{i.preventDefault(),i.stopPropagation(),window.confirm(u({id:`iiqOKM`,values:{0:R(e),1:r.name,2:R(e),subRoot:n,poolRootRel:t}}))&&Ot({scope:r.scope,root:n,action:`unlink`,exclude:[r.name]}).then(e=>{e.ok?Ze():Je.error(u({id:`PRgIJh`,values:{0:e.error,subRoot:n}}))})},"data-testid":`skill-audience-unfollow-${e}`,children:(0,Q.jsx)(m,{host:e,"aria-hidden":!0,className:`size-3.5`})})},e)},t[48]=u,t[49]=r,t[50]=V):V=t[50];let H=V,U;t[51]===r?.conflictHosts?U=t[52]:(U=r?.conflictHosts??[],t[51]=r?.conflictHosts,t[52]=U);let W;t[53]===U?W=t[54]:(W=new Set(U),t[53]=U,t[54]=W);let G=W,K;t[55]===r?.driftPaths?K=t[56]:(K=r?.driftPaths??[],t[55]=r?.driftPaths,t[56]=K);let ee;t[57]===K?ee=t[58]:(ee=new Set(K),t[57]=K,t[58]=ee);let q=ee;E=n.installing;let J=wi,Y;t[59]===r?.symlinkedHosts?Y=t[60]:(Y=r?.symlinkedHosts??[],t[59]=r?.symlinkedHosts,t[60]=Y);let te;t[61]===Y?te=t[62]:(te=new Set(Y),t[61]=Y,t[62]=te);let X=te,ne=[...[...d].filter(e=>e!==F&&!(e in C)&&!G.has(e)&&!e.includes(`/`)).map(e=>X.has(e)?`link`:`copy`),...(r?.customPlacements??[]).map(Ci)],re=ne.filter(Si).length;O=ne.length===0?n.linkMode?`link`:`copy`:re*2>=ne.length?`link`:`copy`;let ie;t[63]!==C||t[64]!==G||t[65]!==d||t[66]!==X||t[67]!==g||t[68]!==F?(ie=[...d].filter(e=>e!==F&&!(e in C)&&!G.has(e)&&!e.includes(`/`)).map(e=>({target:e,display:g(e)??R(e),mode:X.has(e)?`link`:`copy`})),t[63]=C,t[64]=G,t[65]=d,t[66]=X,t[67]=g,t[68]=F,t[69]=ie):ie=t[69];let ae;t[70]===r?.customPlacements?ae=t[71]:(ae=r?.customPlacements??[],t[70]=r?.customPlacements,t[71]=ae);let oe;if(t[72]!==S||t[73]!==ie||t[74]!==ae){let e;t[76]===S?e=t[77]:(e=e=>({target:St(e),display:`${S}${e.path}`,mode:e.mode}),t[76]=S,t[77]=e),oe=[...ie,...ae.map(e)],t[72]=S,t[73]=ie,t[74]=ae,t[75]=oe}else oe=t[75];D=oe;let se;t[78]!==u||t[79]!==a||t[80]!==n?(se=(e,t,r)=>{let i=r===`link`?`copy`:`link`;return(0,Q.jsx)(mi,{hint:u(r===`link`?{id:`FeXcUS`,values:{display:t}}:{id:`ugQcJX`,values:{display:t}}),children:(0,Q.jsx)(v,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-yellow-500/40 bg-yellow-500/10 px-1 font-normal text-[10px] text-yellow-600 uppercase tracking-wide hover:bg-yellow-500/20`,onClick:r=>{r.preventDefault(),r.stopPropagation(),window.confirm(u(i===`link`?{id:`m0eHej`,values:{display:t}}:{id:`HbcQYf`,values:{display:t}}))&&(a?.(),n.convertLocation?.(e,i))},"data-testid":`skill-convert-${e}`,children:r===`link`?(0,Q.jsx)(s,{id:`uUCrBv`}):(0,Q.jsx)(s,{id:`iaPtht`})})})},t[78]=u,t[79]=a,t[80]=n,t[81]=se):se=t[81];let ce=se,le;t[82]===r?.customPlacements?le=t[83]:(le=r?.customPlacements??[],t[82]=r?.customPlacements,t[83]=le);let ue=new Map(le.map(xi)),de=new Set(ue.keys());if(y.status===`ready`&&r){for(let e of y.data)if(e.scope===r.scope)for(let t of e.customPlacements??[]){let e=St(t);e!==``&&de.add(e)}}let fe=r===void 0?[]:[...de].sort().map(e=>({root:e,display:`${S}${e}/${r.name}`,placed:ue.get(e)??null})).filter(e=>!b.has(e.display)&&e.display!==N&&!(e.root in C)),pe;t[84]===Symbol.for(`react.memo_cache_sentinel`)?(pe=(0,Q.jsx)(s,{id:`npcziF`}),t[84]=pe):pe=t[84];let me;t[85]===u?me=t[86]:(me=u({id:`6f_UX4`}),t[85]=u,t[86]=me);let he;t[87]===p?he=t[88]:(he=()=>p(),t[87]=p,t[88]=he);let ge;t[89]===Symbol.for(`react.memo_cache_sentinel`)?(ge=(0,Q.jsx)(s,{id:`N40H-G`}),t[89]=ge):ge=t[89];let _e;t[90]!==E||t[91]!==he?(_e=(0,Q.jsx)(v,{variant:`ghost`,size:`sm`,className:`h-5 px-1.5 font-normal text-[11px] text-muted-foreground hover:text-foreground`,disabled:E,onClick:he,"data-testid":`skill-install-all`,children:ge}),t[90]=E,t[91]=he,t[92]=_e):_e=t[92];let ve;t[93]!==me||t[94]!==_e?(ve=(0,Q.jsx)(mi,{hint:me,children:_e}),t[93]=me,t[94]=_e,t[95]=ve):ve=t[95],t[96]!==l||t[97]!==ve?(k=(0,Q.jsxs)(Xr,{menuKind:l,className:`flex items-center justify-between gap-2`,children:[pe,ve]}),t[96]=l,t[97]=ve,t[98]=k):k=t[98],t[99]!==u||t[100]!==H||t[101]!==E||t[102]!==l||t[103]!==P||t[104]!==L?(A=P===null?null:(0,Q.jsx)(mi,{hint:u({id:`pXB6SL`}),children:(0,Q.jsxs)(Yr,{menuKind:l,disabled:E,checked:!0,onSelect:bi,"data-testid":`skill-source-row`,children:[(0,Q.jsx)(dt,{"aria-hidden":!0,className:`size-4 text-muted-foreground`}),(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:P}),(()=>{let e=J(P).split(`/`).slice(0,-1).join(`/`),t=L(e);return t.length>0?(0,Q.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-source`,children:t.map(t=>H(t,e))}):null})(),(0,Q.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-border/60 px-1 text-[10px] uppercase tracking-wide text-muted-foreground`,children:(0,Q.jsx)(s,{id:`tiFPjk`})})]})]})}),t[99]=u,t[100]=H,t[101]=E,t[102]=l,t[103]=P,t[104]=L,t[105]=A):A=t[105];let ye;t[106]!==u||t[107]!==H||t[108]!==E||t[109]!==B||t[110]!==G||t[111]!==ce||t[112]!==q||t[113]!==O||t[114]!==d||t[115]!==X||t[116]!==l||t[117]!==i||t[118]!==g||t[119]!==r?.hosts||t[120]!==F||t[121]!==L||t[122]!==f||t[123]!==n?(ye=e=>{let t=g(e),a=e===`agents`?`.agents`:He[e],o=J(t).split(`/`).slice(0,-1).join(`/`),c=L(o);return(0,Q.jsx)(mi,{hint:G.has(e)?u({id:`8HvJlU`,values:{0:t??a}}):e===F?t?u({id:`ssk6rl`,values:{path:t}}):a:d.has(e)?u(t?{id:`9ieZhu`,values:{path:t}}:{id:`n3T3EE`,values:{label:a}}):u(t?O===`link`?{id:`1LtA5r`,values:{path:t}}:{id:`opPbzN`,values:{path:t}}:{id:`Pp0Vgd`,values:{label:a}}),children:(0,Q.jsxs)(Yr,{menuKind:l,disabled:E,checked:d.has(e),onCheckedChange:t=>{G.has(e)||t===!0&&!B(o)||f(e,t===!0)},onSelect:yi,className:`group`,"data-testid":`skill-install-editor-${e}`,children:[(0,Q.jsx)(m,{host:e,"aria-hidden":!0,className:`size-4`}),(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:t??a}),c.length>0?(0,Q.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-${e}`,children:c.map(e=>H(e,o))}):null,G.has(e)?(0,Q.jsx)(mi,{hint:u({id:`_O7dJS`}),children:(0,Q.jsx)(v,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-yellow-500/40 bg-yellow-500/10 px-1 text-[10px] text-yellow-600 uppercase tracking-wide hover:bg-yellow-500/20`,onClick:t=>{t.preventDefault(),i?.(e)},"data-testid":`skill-fork-chip-${e}`,children:(0,Q.jsx)(s,{id:`jng7Ko`})})}):e===F?(0,Q.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-border/60 px-1 text-[10px] uppercase tracking-wide text-muted-foreground`,children:(0,Q.jsx)(s,{id:`tiFPjk`})}):d.has(e)&&r?.hosts?(0,Q.jsxs)(Q.Fragment,{children:[!E&&(X.has(e)?`link`:`copy`)!==O?ce(e,t??a,X.has(e)?`link`:`copy`):null,(0,Q.jsx)(mi,{hint:u({id:`nBgzKO`}),children:(0,Q.jsx)(v,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-border/60 px-1 font-normal text-[10px] text-muted-foreground uppercase tracking-wide opacity-0 focus-visible:opacity-100 group-hover:opacity-100 hover:border-foreground/40 hover:text-foreground`,onClick:t=>{t.preventDefault(),t.stopPropagation(),n.setSource?.(e)},"data-testid":`skill-set-source-${e}`,children:(0,Q.jsx)(s,{id:`VNNRfN`})})})]}):null,!E&&q.has(J(t))?(0,Q.jsx)(mi,{hint:u({id:`iz1LdD`}),children:(0,Q.jsx)(_,{testId:`skill-drift-${e}`})}):null]})]})},e)},t[106]=u,t[107]=H,t[108]=E,t[109]=B,t[110]=G,t[111]=ce,t[112]=q,t[113]=O,t[114]=d,t[115]=X,t[116]=l,t[117]=i,t[118]=g,t[119]=r?.hosts,t[120]=F,t[121]=L,t[122]=f,t[123]=n,t[124]=ye):ye=t[124],j=c.map(ye);let be;t[125]!==u||t[126]!==H||t[127]!==E||t[128]!==B||t[129]!==ce||t[130]!==q||t[131]!==O||t[132]!==l||t[133]!==L||t[134]!==n?(be=e=>(0,Q.jsx)(mi,{hint:e.placed===null?u(O===`link`?{id:`ybWWR2`,values:{0:e.display}}:{id:`fDjZxw`,values:{0:e.display}}):u({id:`C0cll5`,values:{0:e.display}}),children:(0,Q.jsxs)(Yr,{menuKind:l,disabled:E,checked:e.placed!==null,onCheckedChange:t=>{if(t===!0&&e.placed===null){if(!B(e.root))return;n.placeAt(e.root,O)}else e.placed!==null&&n.unplaceAt?.(e.placed.path)},onSelect:vi,className:`group`,"data-testid":`skill-custom-root-${e.root}`,children:[e.root===`.agents/skills`?(0,Q.jsx)(m,{host:`agents`,"aria-hidden":!0,className:`size-4`}):(0,Q.jsx)(dt,{"aria-hidden":!0,className:`size-4 text-muted-foreground`}),(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:e.display}),L(e.root).length>0?(0,Q.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-custom-${e.root}`,children:L(e.root).map(t=>H(t,e.root))}):null,!E&&e.placed!==null&&q.has(e.placed.path)?(0,Q.jsx)(mi,{hint:u({id:`iz1LdD`}),children:(0,Q.jsx)(_,{testId:`skill-drift-custom-${e.root}`})}):e.placed===null?null:(0,Q.jsxs)(Q.Fragment,{children:[!E&&e.placed.mode!==O?ce(e.root,e.display,e.placed.mode):null,(0,Q.jsx)(mi,{hint:u({id:`nBgzKO`}),children:(0,Q.jsx)(v,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-border/60 px-1 font-normal text-[10px] text-muted-foreground uppercase tracking-wide opacity-0 focus-visible:opacity-100 group-hover:opacity-100 hover:border-foreground/40 hover:text-foreground`,onClick:t=>{t.preventDefault(),t.stopPropagation(),n.setSource?.(e.root)},"data-testid":`skill-set-source-custom-${e.root}`,children:(0,Q.jsx)(s,{id:`VNNRfN`})})})]})]})]})},e.root),t[125]=u,t[126]=H,t[127]=E,t[128]=B,t[129]=ce,t[130]=q,t[131]=O,t[132]=l,t[133]=L,t[134]=n,t[135]=be):be=t[135],M=fe.map(be),t[14]=u,t[15]=C,t[16]=y.data,t[17]=y.status,t[18]=d,t[19]=x,t[20]=p,t[21]=T,t[22]=l,t[23]=i,t[24]=a,t[25]=g,t[26]=r,t[27]=f,t[28]=n,t[29]=E,t[30]=D,t[31]=O,t[32]=k,t[33]=A,t[34]=j,t[35]=M}else E=t[29],D=t[30],O=t[31],k=t[32],A=t[33],j=t[34],M=t[35];let N;t[136]!==u||t[137]!==E||t[138]!==D||t[139]!==O||t[140]!==a||t[141]!==n?(N=D.length>0&&n.convertLocations?(0,Q.jsxs)(`div`,{className:`flex items-center gap-1 px-2 pt-1 pb-1.5`,children:[(0,Q.jsx)(v,{variant:`ghost`,size:`sm`,className:`h-auto whitespace-normal p-0 text-left font-normal text-[11px] text-muted-foreground leading-snug hover:bg-transparent hover:text-foreground`,onClick:e=>{e.preventDefault();let t=O===`link`?`copy`:`link`,r=D.filter(e=>e.mode!==t);if(r.length===0)return;let i=u(t===`copy`?{id:`iOAsF1`}:{id:`MS8lMS`}),o=u(t===`copy`?{id:`gZiT5e`}:{id:`PhIa-X`}),s=r.map(_i).join(`
2
+ `);window.confirm(`${i}\n\n${o}\n\n${s}\n\n${u({id:`Cu6GXQ`})}`)&&(a?.(),n.convertLocations?.(r.map(e=>({target:e.target,mode:t}))))},disabled:E,"data-testid":`skill-convert-all`,children:O===`link`?(0,Q.jsx)(s,{id:`rcJmK8`}):(0,Q.jsx)(s,{id:`LBv_TR`})}),(0,Q.jsx)(mi,{hint:u({id:`0J6nhG`}),children:(0,Q.jsx)(v,{variant:`ghost`,size:`sm`,"aria-label":u({id:`qJSo0_`}),className:`size-4 shrink-0 rounded-full border border-border/60 p-0 font-normal text-[9px] text-muted-foreground hover:border-foreground/40 hover:bg-transparent hover:text-foreground`,onClick:gi,"data-testid":`skill-convert-all-help`,children:`?`})})]}):null,t[136]=u,t[137]=E,t[138]=D,t[139]=O,t[140]=a,t[141]=n,t[142]=N):N=t[142];let P;t[143]===l?P=t[144]:(P=(0,Q.jsx)(Zr,{menuKind:l}),t[143]=l,t[144]=P);let F;t[145]===u?F=t[146]:(F=u({id:`jqe7Yq`}),t[145]=u,t[146]=F);let I;t[147]===r?.scope?I=t[148]:(I=()=>{window.location.hash=r?.scope===`global`?`#settings/user-skills`:`#settings/skills`},t[147]=r?.scope,t[148]=I);let L,R;t[149]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Q.jsx)(Fr,{"aria-hidden":!0}),R=(0,Q.jsx)(s,{id:`ZBF9fn`}),t[149]=L,t[150]=R):(L=t[149],R=t[150]);let z;t[151]!==l||t[152]!==I?(z=(0,Q.jsxs)(Jr,{menuKind:l,onSelect:I,children:[L,R]}),t[151]=l,t[152]=I,t[153]=z):z=t[153];let B;t[154]!==F||t[155]!==z?(B=(0,Q.jsx)(mi,{hint:F,children:z}),t[154]=F,t[155]=z,t[156]=B):B=t[156];let V;return t[157]!==N||t[158]!==P||t[159]!==B||t[160]!==k||t[161]!==A||t[162]!==j||t[163]!==M?(V=(0,Q.jsxs)(Q.Fragment,{children:[k,A,j,M,N,P,B]}),t[157]=N,t[158]=P,t[159]=B,t[160]=k,t[161]=A,t[162]=j,t[163]=M,t[164]=V):V=t[164],V}function gi(e){return e.preventDefault()}function _i(e){return e.display}function vi(e){return e.preventDefault()}function yi(e){return e.preventDefault()}function bi(e){return e.preventDefault()}function xi(e){return[St(e),e]}function Si(e){return e===`link`}function Ci(e){return e.mode}function wi(e){return(e??``).replace(/^~\//,``)}function Ti(e){return e===`agents`?`.agents`:He[e]??e}function Ei(e){return e.hostAliases??{}}function Di(e){return e.hosts.includes(`agents`)||e.path.startsWith(`.agents/`)}function Oi(e){let t=(0,$.c)(23),{onAddProperty:n,className:r,problemCount:i,problemMessages:a}=e,o=i===void 0?0:i,{_:l}=c(),u=o>0,f;t[0]!==l||t[1]!==u||t[2]!==o?(f=l(u?{id:`3KOHFt`,values:{problemCount:o}}:{id:`81H_23`}),t[0]=l,t[1]=u,t[2]=o,t[3]=f):f=t[3];let p=f,m;t[4]===r?m=t[5]:(m=d(`relative`,r),t[4]=r,t[5]=m);let h;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Q.jsx)(ft,{}),t[6]=h):h=t[6];let g;t[7]!==u||t[8]!==o?(g=u?(0,Q.jsx)(Ct,{variant:`notification`,"aria-hidden":`true`,"data-testid":`add-properties-problem-badge`,className:`pointer-events-none absolute -top-0.5 -right-0.5 size-3.5 rounded-full p-0 font-sans text-[9px] leading-none tabular-nums`,children:o>9?`9+`:o}):null,t[7]=u,t[8]=o,t[9]=g):g=t[9];let _;t[10]===g?_=t[11]:(_=(0,Q.jsxs)(w,{children:[h,g]}),t[10]=g,t[11]=_);let y;t[12]!==p||t[13]!==n||t[14]!==m||t[15]!==_?(y=(0,Q.jsx)(v,{variant:`ghost`,size:`icon`,"aria-label":p,onClick:n,"data-testid":`add-properties-button`,className:m,asChild:!0,children:_}),t[12]=p,t[13]=n,t[14]=m,t[15]=_,t[16]=y):y=t[16];let b;t[17]!==u||t[18]!==a?(b=(0,Q.jsx)(T,{side:`bottom`,children:u?(0,Q.jsxs)(`span`,{className:`flex flex-col gap-0.5`,children:[(0,Q.jsx)(`span`,{className:`font-medium`,children:(0,Q.jsx)(s,{id:`AwrGuz`})}),a?.map(ki),(0,Q.jsx)(`span`,{className:`pt-0.5 opacity-70`,children:(0,Q.jsx)(s,{id:`yh5-4s`})})]}):(0,Q.jsx)(s,{id:`81H_23`})}),t[17]=u,t[18]=a,t[19]=b):b=t[19];let x;return t[20]!==y||t[21]!==b?(x=(0,Q.jsxs)(E,{children:[y,b]}),t[20]=y,t[21]=b,t[22]=x):x=t[22],x}function ki(e,t){return(0,Q.jsx)(`span`,{className:`opacity-90`,children:e},t)}function Ai(e){return e?qe._({id:`wTcjov`}):null}function ji(e){let t=(0,$.c)(46),{_:n}=c(),a=r(),o=h(),l=ue(),d=fe();if(a)return null;let{input:f,installStates:p,dispatch:m}=e,g=f===null,_,v,y,b,x,S,C,w,T,E,D;if(t[0]!==n||t[1]!==m||t[2]!==f||t[3]!==g||t[4]!==p||t[5]!==d||t[6]!==l||t[7]!==o){let e=Ai(g),r;t[19]===d?r=t[20]:(r=e=>de(d,e.id),t[19]=d,t[20]=r);let a=he.filter(r),c;t[21]===d?c=t[22]:(c=e=>_e(d,e.source,e.id,!0,e.supported),t[21]=d,t[22]=c);let u=l.filter(c),h=o?Te.filter(e=>be(d,e,o.installedClis)):[];y=a.length>0,b=o!==null&&h.length>0,x=u.length>0,v=zr,t[23]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Q.jsxs)(Hr,{children:[(0,Q.jsx)(i,{"aria-hidden":`true`}),(0,Q.jsx)(s,{id:`O7_W_a`})]}),t[23]=D):D=t[23],_=Ur,S=`max-h-80`,C=x?(0,Q.jsxs)(Rr,{"aria-label":n({id:`vPKX2i`}),children:[(0,Q.jsxs)(Gr,{className:`flex items-center gap-1.5`,children:[(0,Q.jsx)(s,{id:`RXEbZy`}),(0,Q.jsx)(me,{})]}),u.map(t=>{let r=t.name;return(0,Q.jsxs)(Vr,{onSelect:()=>{f!==null&&Er(f,{agent:{source:t.source,id:t.id}})},disabled:g,"data-testid":`empty-space-open-in-thread-${t.id}`,"aria-label":e?n({id:`gtGQ9S`,values:{agentName:r,hint:e}}):void 0,children:[(0,Q.jsx)(it,{agentId:t.id,iconUrl:t.iconUrl,className:`size-4`}),(0,Q.jsx)(`span`,{className:`flex-1`,children:(0,Q.jsx)(s,{id:`5PrrYw`,values:{agentName:r}})}),e?(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},`${t.source}:${t.id}`)})]}):null,t[24]!==y||t[25]!==b||t[26]!==x?(w=x&&(b||y)?(0,Q.jsx)(Kr,{}):null,t[24]=y,t[25]=b,t[26]=x,t[27]=w):w=t[27],T=b?(0,Q.jsxs)(Rr,{"aria-label":n({id:`ALhMYW`}),children:[(0,Q.jsx)(Gr,{children:(0,Q.jsx)(s,{id:`ALhMYW`})}),h.map(t=>{let{displayName:r}=Ee[t];return(0,Q.jsxs)(Vr,{onSelect:()=>{f!==null&&o.launchInTerminal(f,t)},disabled:g,"data-testid":`empty-space-open-in-terminal-${t}`,"aria-label":n(e?{id:`AIn2Yv`,values:{displayName:r,hint:e}}:{id:`QYfQdv`,values:{displayName:r}}),children:[(0,Q.jsx)(ye,{id:ge(t),"aria-hidden":`true`}),(0,Q.jsx)(`span`,{className:`flex-1`,children:r}),e?(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t)})]}):null,E=y?(0,Q.jsxs)(Q.Fragment,{children:[b?(0,Q.jsx)(Kr,{}):null,(0,Q.jsxs)(Rr,{"aria-label":n({id:`BBqGS9`}),children:[(0,Q.jsx)(Gr,{children:(0,Q.jsx)(s,{id:`BBqGS9`})}),a.map(t=>{let r=!g,{displayName:i}=t,a=n(e?{id:`1ZpfyB`,values:{displayName:i,hint:e}}:{id:`WqLq6M`,values:{displayName:i}});return(0,Q.jsxs)(Vr,{disabled:!r,onSelect:()=>{if(f){if(p[t.id]?.installed!==!0){fr(t);return}m(t.id,f)}},"data-testid":`empty-space-open-in-${t.id}`,"aria-label":a,children:[(0,Q.jsx)(ye,{id:t.id,"aria-hidden":`true`}),(0,Q.jsx)(`span`,{className:`flex-1`,children:t.displayName}),e?(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t.id)})]})]}):null,t[0]=n,t[1]=m,t[2]=f,t[3]=g,t[4]=p,t[5]=d,t[6]=l,t[7]=o,t[8]=_,t[9]=v,t[10]=y,t[11]=b,t[12]=x,t[13]=S,t[14]=C,t[15]=w,t[16]=T,t[17]=E,t[18]=D}else _=t[8],v=t[9],y=t[10],b=t[11],x=t[12],S=t[13],C=t[14],w=t[15],T=t[16],E=t[17],D=t[18];let O;t[28]!==y||t[29]!==b||t[30]!==x?(O=x||b||y?(0,Q.jsx)(Kr,{}):null,t[28]=y,t[29]=b,t[30]=x,t[31]=O):O=t[31];let k;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,Q.jsx)(u,{"aria-hidden":`true`}),t[32]=k):k=t[32];let A;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Q.jsxs)(Vr,{onSelect:Ke,"data-testid":`empty-space-open-in-settings`,children:[k,(0,Q.jsx)(`span`,{className:`flex-1`,children:(0,Q.jsx)(s,{id:`jRAGrQ`})})]}),t[33]=A):A=t[33];let j;t[34]!==_||t[35]!==S||t[36]!==C||t[37]!==w||t[38]!==T||t[39]!==E||t[40]!==O?(j=(0,Q.jsxs)(_,{className:S,children:[C,w,T,E,O,A]}),t[34]=_,t[35]=S,t[36]=C,t[37]=w,t[38]=T,t[39]=E,t[40]=O,t[41]=j):j=t[41];let M;return t[42]!==v||t[43]!==D||t[44]!==j?(M=(0,Q.jsxs)(v,{children:[D,j]}),t[42]=v,t[43]=D,t[44]=j,t[45]=M):M=t[45],M}function Mi(e){return e===`darwin`?qe._({id:`LtSYdi`}):e===`win32`?qe._({id:`qi1F96`}):qe._({id:`e1Rn_k`})}function Ni(e){return e?qe._({id:`wTcjov`}):null}function Pi(e){let t=(0,$.c)(47),{_:n}=c(),a=r(),o=h(),l=ue(),d=fe();if(a)return null;let{input:f,installStates:p,dispatch:m,onBeforeLaunch:g}=e,_=f===null,v,y,b,x,S,C,w,T,E,D,O;if(t[0]!==n||t[1]!==m||t[2]!==f||t[3]!==_||t[4]!==p||t[5]!==g||t[6]!==d||t[7]!==l||t[8]!==o){let e=Ni(_),r;t[20]===d?r=t[21]:(r=e=>de(d,e.id),t[20]=d,t[21]=r);let a=he.filter(r),c;t[22]===d?c=t[23]:(c=e=>_e(d,e.source,e.id,!0,e.supported),t[22]=d,t[23]=c);let u=l.filter(c),h=o?Te.filter(e=>be(d,e,o.installedClis)):[];b=a.length>0,x=o!==null&&h.length>0,S=u.length>0,y=ne,t[24]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Q.jsxs)(se,{children:[(0,Q.jsx)(i,{"aria-hidden":`true`}),(0,Q.jsx)(s,{id:`O7_W_a`})]}),t[24]=O):O=t[24],v=re,C=`max-h-80`,w=S?(0,Q.jsxs)(ie,{"aria-label":n({id:`vPKX2i`}),children:[(0,Q.jsxs)(oe,{className:`flex items-center gap-1.5`,children:[(0,Q.jsx)(s,{id:`RXEbZy`}),(0,Q.jsx)(me,{})]}),u.map(t=>{let r=t.name;return(0,Q.jsxs)(X,{onSelect:()=>{f!==null&&(g?.(),Er(f,{agent:{source:t.source,id:t.id}}))},disabled:_,"data-testid":`file-tree-open-in-thread-${t.id}`,"aria-label":e?n({id:`gtGQ9S`,values:{agentName:r,hint:e}}):void 0,children:[(0,Q.jsx)(it,{agentId:t.id,iconUrl:t.iconUrl,className:`size-4`}),(0,Q.jsx)(`span`,{className:`flex-1`,children:(0,Q.jsx)(s,{id:`5PrrYw`,values:{agentName:r}})}),e?(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},`${t.source}:${t.id}`)})]}):null,t[25]!==b||t[26]!==x||t[27]!==S?(T=S&&(x||b)?(0,Q.jsx)(ce,{}):null,t[25]=b,t[26]=x,t[27]=S,t[28]=T):T=t[28],E=x?(0,Q.jsxs)(ie,{"aria-label":n({id:`ALhMYW`}),children:[(0,Q.jsx)(oe,{children:(0,Q.jsx)(s,{id:`ALhMYW`})}),h.map(t=>{let{displayName:r}=Ee[t];return(0,Q.jsxs)(X,{onSelect:()=>{f!==null&&(g?.(),o.launchInTerminal(f,t))},disabled:_,"data-testid":`file-tree-open-in-terminal-${t}`,"aria-label":n(e?{id:`AIn2Yv`,values:{displayName:r,hint:e}}:{id:`QYfQdv`,values:{displayName:r}}),children:[(0,Q.jsx)(ye,{id:ge(t),"aria-hidden":`true`}),(0,Q.jsx)(`span`,{className:`flex-1`,children:r}),e?(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t)})]}):null,D=b?(0,Q.jsxs)(Q.Fragment,{children:[x?(0,Q.jsx)(ce,{}):null,(0,Q.jsxs)(ie,{"aria-label":n({id:`BBqGS9`}),children:[(0,Q.jsx)(oe,{children:(0,Q.jsx)(s,{id:`BBqGS9`})}),a.map(t=>{let r=!_,{displayName:i}=t,a=n(e?{id:`1ZpfyB`,values:{displayName:i,hint:e}}:{id:`WqLq6M`,values:{displayName:i}});return(0,Q.jsxs)(X,{disabled:!r,onSelect:()=>{if(f){if(g?.(),p[t.id]?.installed!==!0){fr(t);return}m(t.id,f)}},"data-testid":`file-tree-open-in-${t.id}`,"aria-label":a,children:[(0,Q.jsx)(ye,{id:t.id,"aria-hidden":`true`}),(0,Q.jsx)(`span`,{className:`flex-1`,children:t.displayName}),e?(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t.id)})]})]}):null,t[0]=n,t[1]=m,t[2]=f,t[3]=_,t[4]=p,t[5]=g,t[6]=d,t[7]=l,t[8]=o,t[9]=v,t[10]=y,t[11]=b,t[12]=x,t[13]=S,t[14]=C,t[15]=w,t[16]=T,t[17]=E,t[18]=D,t[19]=O}else v=t[9],y=t[10],b=t[11],x=t[12],S=t[13],C=t[14],w=t[15],T=t[16],E=t[17],D=t[18],O=t[19];let k;t[29]!==b||t[30]!==x||t[31]!==S?(k=S||x||b?(0,Q.jsx)(ce,{}):null,t[29]=b,t[30]=x,t[31]=S,t[32]=k):k=t[32];let A;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Q.jsx)(u,{"aria-hidden":`true`}),t[33]=A):A=t[33];let j;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Q.jsxs)(X,{onSelect:Ke,"data-testid":`file-tree-open-in-settings`,children:[A,(0,Q.jsx)(`span`,{className:`flex-1`,children:(0,Q.jsx)(s,{id:`jRAGrQ`})})]}),t[34]=j):j=t[34];let M;t[35]!==v||t[36]!==C||t[37]!==w||t[38]!==T||t[39]!==E||t[40]!==D||t[41]!==k?(M=(0,Q.jsxs)(v,{className:C,children:[w,T,E,D,k,j]}),t[35]=v,t[36]=C,t[37]=w,t[38]=T,t[39]=E,t[40]=D,t[41]=k,t[42]=M):M=t[42];let N;return t[43]!==y||t[44]!==O||t[45]!==M?(N=(0,Q.jsxs)(y,{children:[O,M]}),t[43]=y,t[44]=O,t[45]=M,t[46]=N):N=t[46],N}function Fi(e){let t=Ae(e);if(t)return{scope:`project`,name:t.name,rel:t.rel};let n=Re(e);return n?{scope:`global`,name:n.name,rel:n.rel}:null}function Ii(e,t,n){return e.filter(e=>{let r=_t(e);if(r.kind===`skill-file`)return r.scope===t&&r.name===n;if(r.kind!==`doc`)return!1;let i=Fi(r.docName);return i?.scope===t&&i.name===n})}function Li(e,t,n){let r=gt(t,n);return e.filter(e=>{let i=_t(e);return i.kind===`skill-file`?i.scope===t.scope&&i.name===t.name&&i.path===n:i.kind===`doc`&&i.docName===r})}function Ri(e,t,n){let r=Fi(e);if(!r||r.rel===null)return null;let i=t.find(e=>e.scope===r.scope&&e.name===r.name);if(!i||i.managed)return null;let a=`references/${r.rel}${n}`;return gt(i,a)===e?{skill:i,filePath:a}:null}function zi(e,t){let n=new Map(t.map(e=>[`${e.scope}\u0000${e.name}`,e])),r=[];for(let t of e){let e=Fi(t);if(!e||n.has(`${e.scope}\u0000${e.name}`))continue;let i=e.scope===`project`?`global`:`project`,a=n.get(`${i}\u0000${e.name}`);e.rel===null&&a!==void 0?r.push({kind:`retarget`,fromDocName:t,toDocName:ht(a)}):r.push({kind:`close`,docName:t})}return r}function Bi(){let e=(0,$.c)(15),{openTabs:t,closeDocument:n}=a(),r=at(),i;e[0]===t?i=e[1]:(i=t.some(Hi),e[0]=t,e[1]=i);let o=i,s;e[2]===o?s=e[3]:(s={enabled:o},e[2]=o,e[3]=s);let c=Rt(s),l=(0,Z.useRef)(null),u;e[4]!==n||e[5]!==t||e[6]!==r||e[7]!==c.data||e[8]!==c.status?(u=()=>{if(c.status!==`ready`)return;let e=c.data,i=`${t.join(``)}\u0002${e.map(Vi).sort().join(``)}`;if(l.current===i)return;l.current=i;let a=zi(t,e);for(let e of a)e.kind===`retarget`?r(e.fromDocName,e.toDocName):n(e.docName)},e[4]=n,e[5]=t,e[6]=r,e[7]=c.data,e[8]=c.status,e[9]=u):u=e[9];let d;e[10]!==n||e[11]!==t||e[12]!==r||e[13]!==c?(d=[c,t,r,n],e[10]=n,e[11]=t,e[12]=r,e[13]=c,e[14]=d):d=e[14],(0,Z.useEffect)(u,d)}function Vi(e){return`${e.scope}\u0000${e.name}`}function Hi(e){return Fi(e)!==null}function Ui(e){let t=(0,$.c)(19),{skill:n,onOpenChange:r,onDeleted:i}=e,{_:o}=c(),{setSkillsSidebar:s,closeTabs:l,openTabs:u}=a(),[d,f]=(0,Z.useState)(!1),m;t[0]!==o||t[1]!==l||t[2]!==i||t[3]!==r||t[4]!==u||t[5]!==s?(m=async function(e){s(!0),f(!0);let t=await Mt(e.scope,e.name);if(f(!1),!t.ok){let{error:e}=t;Je.error(o({id:`AtBdnD`,values:{error:e}}));return}Je.success(o({id:`h9QFb9`,values:{0:e.name}})),l(Ii(u,e.scope,e.name),{force:!0}),i(),r(!1)},t[0]=o,t[1]=l,t[2]=i,t[3]=r,t[4]=u,t[5]=s,t[6]=m):m=t[6];let h=m,g=n!==null,_;t[7]!==d||t[8]!==r?(_=e=>{!e&&!d&&r(!1)},t[7]=d,t[8]=r,t[9]=_):_=t[9];let v;t[10]!==o||t[11]!==d||t[12]!==h||t[13]!==n?(v=n?(0,Q.jsx)(p,{itemName:o({id:`ExUzM4`,values:{0:n.name}}),isSubmitting:d,onDelete:()=>h(n),customDescription:n.origin?.source&&/\/plugins\/(?:cache|marketplaces)\//.test(n.origin.source)?o({id:`WnsbUT`,values:{0:n.path}}):o({id:`E1Da_b`,values:{0:n.path}})}):null,t[10]=o,t[11]=d,t[12]=h,t[13]=n,t[14]=v):v=t[14];let y;return t[15]!==g||t[16]!==_||t[17]!==v?(y=(0,Q.jsx)(P,{open:g,onOpenChange:_,children:v}),t[15]=g,t[16]=_,t[17]=v,t[18]=y):y=t[18],y}function Wi(e){let t=e.split(`/`);return t.some(e=>e===``||e===`.`||e===`..`)||t.length===0||t.length===1&&t[0].toLowerCase()===`skill.md`?!1:!/\s/.test(e)}function Gi(e){let t=(0,$.c)(66),{target:n,onOpenChange:r}=e,{_:i}=c(),{openTarget:o}=a(),l=(0,Z.useId)(),[u,d]=(0,Z.useState)(``),[f,p]=(0,Z.useState)(!1),m;t[0]===n?m=t[1]:(m=()=>{n&&d(n.prefix??`references/`)},t[0]=n,t[1]=m);let h=n?.skill.scope,g=n?.skill.name,_=n?.prefix,y;if(t[2]!==h||t[3]!==g||t[4]!==_?(y=[h,g,_],t[2]=h,t[3]=g,t[4]=_,t[5]=y):y=t[5],(0,Z.useEffect)(m,y),!n)return null;let b,x,S,C;t[6]!==u||t[7]!==f?(C=u.trim(),x=C===``||!Wi(C),b=!x&&!f,S=C.includes(`/`)?C.split(`/`).slice(0,-1).join(`/`):null,t[6]=u,t[7]=f,t[8]=b,t[9]=x,t[10]=S,t[11]=C):(b=t[8],x=t[9],S=t[10],C=t[11]);let w=S,T;t[12]!==i||t[13]!==b||t[14]!==r||t[15]!==o||t[16]!==n||t[17]!==C?(T=async function(){if(!n||!b)return;p(!0);let e=/\.mdx?$/i.test(C),t=await kt({scope:n.skill.scope,name:n.skill.name,path:C,content:e?`# ${C.split(`/`).pop()?.replace(/\.mdx?$/i,``)??``}\n`:``});if(p(!1),!t.ok){Je.error(i({id:`a_2_uB`,values:{0:t.error,trimmed:C}}));return}if(Je.success(i({id:`MXSt4t`,values:{0:t.path}})),e){let e=gt(n.skill,C);o({kind:`doc`,target:e,docName:e})}r(!1)},t[12]=i,t[13]=b,t[14]=r,t[15]=o,t[16]=n,t[17]=C,t[18]=T):T=t[18];let E=T,A;t[19]!==r||t[20]!==f?(A=e=>{!e&&!f&&r(!1)},t[19]=r,t[20]=f,t[21]=A):A=t[21];let M;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,Q.jsx)(O,{children:(0,Q.jsx)(s,{id:`wQvvZY`})}),t[22]=M):M=t[22];let F;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Q.jsxs)(N,{children:[M,(0,Q.jsx)(D,{children:(0,Q.jsx)(s,{id:`lM4c-I`})})]}),t[23]=F):F=t[23];let I;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,Q.jsx)(s,{id:`I6gXOa`}),t[24]=I):I=t[24];let L;t[25]===l?L=t[26]:(L=(0,Q.jsx)(le,{htmlFor:l,children:I}),t[25]=l,t[26]=L);let R;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(R=e=>d(e.target.value),t[27]=R):R=t[27];let z=x&&C!==``,B;t[28]===E?B=t[29]:(B=e=>{e.key===`Enter`&&E()},t[28]=E,t[29]=B);let V;t[30]!==l||t[31]!==u||t[32]!==z||t[33]!==B?(V=(0,Q.jsx)(mt,{id:l,value:u,onChange:R,placeholder:`references/notes.md`,"aria-invalid":z,onKeyDown:B}),t[30]=l,t[31]=u,t[32]=z,t[33]=B,t[34]=V):V=t[34];let H;t[35]!==w||t[36]!==x||t[37]!==C?(H=x&&C!==``?(0,Q.jsx)(`p`,{className:`text-destructive text-xs`,children:(0,Q.jsx)(s,{id:`fVzizW`})}):w?(0,Q.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:(0,Q.jsx)(s,{id:`9lso1Y`,values:{folderPart:w},components:{0:(0,Q.jsx)(`span`,{className:`font-mono text-foreground/80`})}})}):null,t[35]=w,t[36]=x,t[37]=C,t[38]=H):H=t[38];let U;t[39]!==L||t[40]!==V||t[41]!==H?(U=(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[L,V,H]}),t[39]=L,t[40]=V,t[41]=H,t[42]=U):U=t[42];let W;t[43]===r?W=t[44]:(W=()=>r(!1),t[43]=r,t[44]=W);let G;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,Q.jsx)(s,{id:`dEgA5A`}),t[45]=G):G=t[45];let K;t[46]!==f||t[47]!==W?(K=(0,Q.jsx)(v,{variant:`outline`,onClick:W,disabled:f,children:G}),t[46]=f,t[47]=W,t[48]=K):K=t[48];let ee;t[49]===E?ee=t[50]:(ee=()=>void E(),t[49]=E,t[50]=ee);let q=!b,J;t[51]===f?J=t[52]:(J=f?(0,Q.jsx)(s,{id:`E9bKSA`}):(0,Q.jsx)(s,{id:`hYgDIe`}),t[51]=f,t[52]=J);let Y;t[53]!==ee||t[54]!==q||t[55]!==J?(Y=(0,Q.jsx)(v,{onClick:ee,disabled:q,children:J}),t[53]=ee,t[54]=q,t[55]=J,t[56]=Y):Y=t[56];let te;t[57]!==K||t[58]!==Y?(te=(0,Q.jsxs)(j,{children:[K,Y]}),t[57]=K,t[58]=Y,t[59]=te):te=t[59];let X;t[60]!==U||t[61]!==te?(X=(0,Q.jsxs)(k,{className:`sm:max-w-md`,children:[F,U,te]}),t[60]=U,t[61]=te,t[62]=X):X=t[62];let ne;return t[63]!==X||t[64]!==A?(ne=(0,Q.jsx)(P,{open:!0,onOpenChange:A,children:X}),t[63]=X,t[64]=A,t[65]=ne):ne=t[65],ne}function Ki(e){let t=(0,$.c)(18),{target:n,onOpenChange:r}=e,{_:i}=c(),{setSkillsSidebar:o,closeTabs:s,openTabs:l}=a(),[u,d]=(0,Z.useState)(!1),f;t[0]!==i||t[1]!==s||t[2]!==r||t[3]!==l||t[4]!==o?(f=async function(e){let{skill:t,filePath:n}=e;o(!0),d(!0);let a=await Pt({scope:t.scope,name:t.name,path:n});if(d(!1),!a.ok){Je.error(i({id:`CBT70t`,values:{0:a.error}}));return}if(!a.existed){Je.error(i({id:`q4efaG`,values:{filePath:n}})),r(!1);return}Je.success(i({id:`gOmloS`,values:{filePath:n}})),s(Li(l,t,n),{force:!0}),r(!1)},t[0]=i,t[1]=s,t[2]=r,t[3]=l,t[4]=o,t[5]=f):f=t[5];let m=f,h=n!==null,g;t[6]!==u||t[7]!==r?(g=e=>{!e&&!u&&r(!1)},t[6]=u,t[7]=r,t[8]=g):g=t[8];let _;t[9]!==i||t[10]!==u||t[11]!==m||t[12]!==n?(_=n?(0,Q.jsx)(p,{itemName:i({id:`wZPUJx`,values:{0:n.filePath}}),isSubmitting:u,onDelete:()=>m(n),customDescription:i({id:`ppzof_`,values:{0:vt(n.skill.path),1:n.filePath,2:n.skill.name}})}):null,t[9]=i,t[10]=u,t[11]=m,t[12]=n,t[13]=_):_=t[13];let v;return t[14]!==h||t[15]!==g||t[16]!==_?(v=(0,Q.jsx)(P,{open:h,onOpenChange:g,children:_}),t[14]=h,t[15]=g,t[16]=_,t[17]=v):v=t[17],v}function qi(e){let t=(0,$.c)(64),{target:n,onOpenChange:r}=e,{_:i}=c(),a=at(),o=(0,Z.useId)(),[l,u]=(0,Z.useState)(``),[d,f]=(0,Z.useState)(!1),p;t[0]===n?p=t[1]:(p=()=>{n&&u(n.filePath)},t[0]=n,t[1]=p);let m=n?.skill.scope,h=n?.skill.name,g=n?.filePath,_;if(t[2]!==m||t[3]!==h||t[4]!==g?(_=[m,h,g],t[2]=m,t[3]=h,t[4]=g,t[5]=_):_=t[5],(0,Z.useEffect)(p,_),!n)return null;let y,b,x;t[6]!==l||t[7]!==n.filePath?(b=l.trim(),x=b===n.filePath,y=b===``||!Wi(b),t[6]=l,t[7]=n.filePath,t[8]=y,t[9]=b,t[10]=x):(y=t[8],b=t[9],x=t[10]);let S=y,C=!S&&!x&&!d,w;t[11]!==i||t[12]!==C||t[13]!==r||t[14]!==a||t[15]!==n||t[16]!==b?(w=async function(){if(!n||!C)return;f(!0);let e=await Et({scope:n.skill.scope,name:n.skill.name,from:n.filePath,to:b});if(f(!1),!e.ok){Je.error(i({id:`11ukmX`,values:{0:e.error}}));return}e.fromDocName!==void 0&&e.toDocName!==void 0&&a(e.fromDocName,e.toDocName),Je.success(i({id:`XszXjc`,values:{0:e.to}})),r(!1)},t[11]=i,t[12]=C,t[13]=r,t[14]=a,t[15]=n,t[16]=b,t[17]=w):w=t[17];let T=w,E;t[18]!==r||t[19]!==d?(E=e=>{!e&&!d&&r(!1)},t[18]=r,t[19]=d,t[20]=E):E=t[20];let A;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Q.jsx)(O,{children:(0,Q.jsx)(s,{id:`yckias`})}),t[21]=A):A=t[21];let M;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,Q.jsxs)(N,{children:[A,(0,Q.jsx)(D,{children:(0,Q.jsx)(s,{id:`HzVAoz`})})]}),t[22]=M):M=t[22];let F;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Q.jsx)(s,{id:`I6gXOa`}),t[23]=F):F=t[23];let I;t[24]===o?I=t[25]:(I=(0,Q.jsx)(le,{htmlFor:o,children:F}),t[24]=o,t[25]=I);let L;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(L=e=>u(e.target.value),t[26]=L):L=t[26];let R=S&&b!==``,z;t[27]===T?z=t[28]:(z=e=>{e.key===`Enter`&&T()},t[27]=T,t[28]=z);let B;t[29]!==o||t[30]!==l||t[31]!==R||t[32]!==z?(B=(0,Q.jsx)(mt,{id:o,value:l,onChange:L,"aria-invalid":R,onKeyDown:z}),t[29]=o,t[30]=l,t[31]=R,t[32]=z,t[33]=B):B=t[33];let V;t[34]!==S||t[35]!==b?(V=S&&b!==``?(0,Q.jsx)(`p`,{className:`text-destructive text-xs`,children:(0,Q.jsx)(s,{id:`fVzizW`})}):null,t[34]=S,t[35]=b,t[36]=V):V=t[36];let H;t[37]!==I||t[38]!==B||t[39]!==V?(H=(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[I,B,V]}),t[37]=I,t[38]=B,t[39]=V,t[40]=H):H=t[40];let U;t[41]===r?U=t[42]:(U=()=>r(!1),t[41]=r,t[42]=U);let W;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,Q.jsx)(s,{id:`dEgA5A`}),t[43]=W):W=t[43];let G;t[44]!==d||t[45]!==U?(G=(0,Q.jsx)(v,{variant:`outline`,onClick:U,disabled:d,children:W}),t[44]=d,t[45]=U,t[46]=G):G=t[46];let K;t[47]===T?K=t[48]:(K=()=>void T(),t[47]=T,t[48]=K);let ee=!C,q;t[49]===d?q=t[50]:(q=d?(0,Q.jsx)(s,{id:`tHKQ6j`}):(0,Q.jsx)(s,{id:`2wxgft`}),t[49]=d,t[50]=q);let J;t[51]!==K||t[52]!==ee||t[53]!==q?(J=(0,Q.jsx)(v,{onClick:K,disabled:ee,children:q}),t[51]=K,t[52]=ee,t[53]=q,t[54]=J):J=t[54];let Y;t[55]!==G||t[56]!==J?(Y=(0,Q.jsxs)(j,{children:[G,J]}),t[55]=G,t[56]=J,t[57]=Y):Y=t[57];let te;t[58]!==H||t[59]!==Y?(te=(0,Q.jsxs)(k,{className:`sm:max-w-md`,children:[M,H,Y]}),t[58]=H,t[59]=Y,t[60]=te):te=t[60];let X;return t[61]!==te||t[62]!==E?(X=(0,Q.jsx)(P,{open:!0,onOpenChange:E,children:te}),t[61]=te,t[62]=E,t[63]=X):X=t[63],X}function Ji(e){let t=(0,$.c)(59),{target:n,onOpenChange:r}=e,{_:i}=c(),a=(0,Z.useId)(),[o,l]=(0,Z.useState)(null),[u,d]=(0,Z.useState)(null),[f,p]=(0,Z.useState)(!1),[m,h]=(0,Z.useState)(!1),[g,_]=(0,Z.useState)(``),[y,b]=(0,Z.useState)(!1),x;t[0]===n?x=t[1]:(x=()=>{if(l(null),d(null),p(!1),h(!1),!n)return;let{skill:e,editor:t}=n,r=e.absolutePath?.slice(0,-`/${e.path}`.length)??null;if(r===null){p(!0);return}let i=`${r}/${e.path.replace(/\/SKILL\.mdx?$/i,``)}`,a=`${r}/${yt(t,e.scope)}/${e.name}`,o=new AbortController;for(let[t,n]of[[i,d],[a,l]])jt({source:t,name:e.name},o.signal).then(e=>{o.signal.aborted||(e.ok?n(e.skillMd):p(!0))}).catch(()=>{o.signal.aborted||p(!0)});return()=>o.abort()},t[0]=n,t[1]=x);let S=n?.skill.scope,C=n?.skill.name,w=n?.editor,T;if(t[2]!==S||t[3]!==C||t[4]!==w?(T=[S,C,w],t[2]=S,t[3]=C,t[4]=w,t[5]=T):T=t[5],(0,Z.useEffect)(x,T),!n)return null;let{skill:E,editor:M}=n,F;t[6]!==i||t[7]!==M||t[8]!==r||t[9]!==E.name||t[10]!==E.scope||t[11]!==n||t[12]!==g?(F=async function(e){if(!n)return;b(!0);let t=await wt({scope:E.scope,name:E.name,editor:M,action:e,...e===`rename`?{toName:g.trim()}:{}});if(b(!1),!t.ok){Je.error(i({id:`MIF36T`,values:{0:t.error}}));return}Je.success(i(e===`align`?{id:`QKgePK`,values:{editor:M}}:e===`make-source`?{id:`It9oAP`,values:{editor:M}}:{id:`b2ezG_`,values:{0:g.trim()}})),r(!1)},t[6]=i,t[7]=M,t[8]=r,t[9]=E.name,t[10]=E.scope,t[11]=n,t[12]=g,t[13]=F):F=t[13];let I=F,L,R;t[14]!==E.name||t[15]!==g?(R=g.trim(),L=R===``||!We.test(R)||R===E.name,t[14]=E.name,t[15]=g,t[16]=L,t[17]=R):(L=t[16],R=t[17]);let z=L,B;t[18]!==y||t[19]!==r?(B=e=>{!e&&!y&&r(!1)},t[18]=y,t[19]=r,t[20]=B):B=t[20];let V;t[21]!==M||t[22]!==E.name?(V=(0,Q.jsx)(O,{children:(0,Q.jsx)(s,{id:`q8aCbb`,values:{0:E.name,editor:M}})}),t[21]=M,t[22]=E.name,t[23]=V):V=t[23];let H;t[24]===M?H=t[25]:(H=(0,Q.jsx)(D,{children:(0,Q.jsx)(s,{id:`QASTNu`,values:{editor:M}})}),t[24]=M,t[25]=H);let U;t[26]!==H||t[27]!==V?(U=(0,Q.jsxs)(N,{children:[V,H]}),t[26]=H,t[27]=V,t[28]=U):U=t[28];let W;t[29]!==u||t[30]!==o||t[31]!==f?(W=u!==null&&o!==null?(0,Q.jsx)(Vt,{oldContent:u,newContent:o,layout:`unified`}):f?(0,Q.jsx)(`div`,{className:`flex min-h-56 items-center justify-center px-6 text-center text-muted-foreground text-sm`,children:(0,Q.jsx)(s,{id:`5BlXTD`})}):(0,Q.jsx)(`div`,{className:`flex min-h-56 items-center justify-center text-muted-foreground text-sm`,children:(0,Q.jsx)(s,{id:`1V17kO`})}),t[29]=u,t[30]=o,t[31]=f,t[32]=W):W=t[32];let G;t[33]!==I||t[34]!==M||t[35]!==a||t[36]!==z||t[37]!==m||t[38]!==E.name||t[39]!==g||t[40]!==R?(G=m?(0,Q.jsxs)(`div`,{className:`mt-3 space-y-1.5`,children:[(0,Q.jsx)(le,{htmlFor:a,children:(0,Q.jsx)(s,{id:`pSimwP`,values:{editor:M}})}),(0,Q.jsx)(mt,{id:a,value:g,onChange:e=>_(e.target.value),placeholder:`${E.name}-${M}`,"aria-invalid":z&&R!==``,onKeyDown:e=>{e.key===`Enter`&&!z&&I(`rename`)}})]}):null,t[33]=I,t[34]=M,t[35]=a,t[36]=z,t[37]=m,t[38]=E.name,t[39]=g,t[40]=R,t[41]=G):G=t[41];let K;t[42]!==W||t[43]!==G?(K=(0,Q.jsxs)(A,{className:`min-h-0 flex-1 overflow-auto`,children:[W,G]}),t[42]=W,t[43]=G,t[44]=K):K=t[44];let ee;t[45]!==I||t[46]!==y||t[47]!==M||t[48]!==z||t[49]!==m||t[50]!==E.name?(ee=(0,Q.jsx)(j,{children:m?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(v,{variant:`outline`,onClick:()=>h(!1),disabled:y,children:(0,Q.jsx)(s,{id:`iH8pgl`})}),(0,Q.jsx)(v,{onClick:()=>void I(`rename`),disabled:y||z,children:(0,Q.jsx)(s,{id:`AT0e50`})})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(v,{variant:`outline`,onClick:()=>{_(`${E.name}-${M}`),h(!0)},disabled:y,children:(0,Q.jsx)(s,{id:`AT0e50`})}),(0,Q.jsx)(v,{variant:`outline`,onClick:()=>void I(`make-source`),disabled:y,children:(0,Q.jsx)(s,{id:`xWomUD`,values:{editor:M}})}),(0,Q.jsx)(v,{onClick:()=>void I(`align`),disabled:y,children:(0,Q.jsx)(s,{id:`PZn2LP`})})]})}),t[45]=I,t[46]=y,t[47]=M,t[48]=z,t[49]=m,t[50]=E.name,t[51]=ee):ee=t[51];let q;t[52]!==U||t[53]!==K||t[54]!==ee?(q=(0,Q.jsxs)(k,{className:`flex max-h-[85vh] w-full max-w-3xl flex-col`,children:[U,K,ee]}),t[52]=U,t[53]=K,t[54]=ee,t[55]=q):q=t[55];let J;return t[56]!==q||t[57]!==B?(J=(0,Q.jsx)(P,{open:!0,onOpenChange:B,children:q}),t[56]=q,t[57]=B,t[58]=J):J=t[58],J}function Yi(e){let t=(0,$.c)(75),{skill:n,existingNames:r,onOpenChange:i,onRenamed:a}=e,o=ot(),c=n!==null,l=(0,Z.useId)(),[u,d]=(0,Z.useState)(``),[f,p]=(0,Z.useState)(!1),m;t[0]===n?m=t[1]:(m=()=>{n&&d(n.name)},t[0]=n,t[1]=m);let h=n?.scope,g=n?.name,_;if(t[2]!==h||t[3]!==g?(_=[h,g],t[2]=h,t[3]=g,t[4]=_):_=t[4],(0,Z.useEffect)(m,_),!n)return null;let y,b,x,S,C,w;if(t[5]!==r||t[6]!==u||t[7]!==n.name){C=u.trim(),w=C===n.name;let e;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(e=/\s/,t[14]=e):e=t[14];let i;t[15]===u?i=t[16]:(i=e.test(u),t[15]=u,t[16]=i),y=i,S=C.length>64,b=C===``||!We.test(C)||S,x=!b&&!w&&r.has(C),t[5]=r,t[6]=u,t[7]=n.name,t[8]=y,t[9]=b,t[10]=x,t[11]=S,t[12]=C,t[13]=w}else y=t[8],b=t[9],x=t[10],S=t[11],C=t[12],w=t[13];let T=x,E=!b&&!T&&!w&&!f,A;t[17]!==E||t[18]!==i||t[19]!==a||t[20]!==o||t[21]!==n||t[22]!==C?(A=async function(){if(!n||!E)return;p(!0);let e=await o({scope:n.scope,name:n.name},C);p(!1),e.ok&&(a?.(C),i(!1))},t[17]=E,t[18]=i,t[19]=a,t[20]=o,t[21]=n,t[22]=C,t[23]=A):A=t[23];let M=A,F;t[24]===i?F=t[25]:(F=e=>e?null:i(!1),t[24]=i,t[25]=F);let I;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,Q.jsx)(O,{children:(0,Q.jsx)(s,{id:`dw_3cv`})}),t[26]=I):I=t[26];let L;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Q.jsxs)(N,{children:[I,(0,Q.jsx)(D,{children:(0,Q.jsx)(s,{id:`R9IDFz`})})]}),t[27]=L):L=t[27];let R;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,Q.jsx)(s,{id:`6YtxFj`}),t[28]=R):R=t[28];let z;t[29]===l?z=t[30]:(z=(0,Q.jsx)(le,{htmlFor:l,children:R}),t[29]=l,t[30]=z);let B;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(B=e=>d(e.target.value),t[31]=B):B=t[31];let V;t[32]===M?V=t[33]:(V=e=>{e.key===`Enter`&&M()},t[32]=M,t[33]=V);let H=b||T,U=b&&C!==``||T?`${l}-error`:void 0,W;t[34]!==l||t[35]!==u||t[36]!==V||t[37]!==H||t[38]!==U?(W=(0,Q.jsx)(mt,{id:l,value:u,onChange:B,onKeyDown:V,spellCheck:!1,autoCapitalize:`off`,autoCorrect:`off`,maxLength:64,"aria-invalid":H,"aria-describedby":U,className:`font-mono`}),t[34]=l,t[35]=u,t[36]=V,t[37]=H,t[38]=U,t[39]=W):W=t[39];let G;t[40]!==T||t[41]!==y||t[42]!==l||t[43]!==b||t[44]!==S||t[45]!==C?(G=b&&C!==``?(0,Q.jsx)(`p`,{id:`${l}-error`,className:`text-xs text-destructive`,children:y?(0,Q.jsx)(s,{id:`iUwpZI`,components:{0:(0,Q.jsx)(`code`,{className:`font-mono`})}}):S?(0,Q.jsx)(s,{id:`lK9c4T`}):(0,Q.jsx)(s,{id:`A50vr3`,components:{0:(0,Q.jsx)(`code`,{className:`font-mono`})}})}):T?(0,Q.jsx)(`p`,{id:`${l}-error`,className:`text-xs text-destructive`,children:(0,Q.jsx)(s,{id:`YJ1BTp`})}):null,t[40]=T,t[41]=y,t[42]=l,t[43]=b,t[44]=S,t[45]=C,t[46]=G):G=t[46];let K;t[47]!==z||t[48]!==W||t[49]!==G?(K=(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[z,W,G]}),t[47]=z,t[48]=W,t[49]=G,t[50]=K):K=t[50];let ee;t[51]===i?ee=t[52]:(ee=()=>i(!1),t[51]=i,t[52]=ee);let q;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,Q.jsx)(s,{id:`dEgA5A`}),t[53]=q):q=t[53];let J;t[54]!==f||t[55]!==ee?(J=(0,Q.jsx)(v,{variant:`outline`,className:`font-mono uppercase`,onClick:ee,disabled:f,children:q}),t[54]=f,t[55]=ee,t[56]=J):J=t[56];let Y;t[57]===M?Y=t[58]:(Y=()=>void M(),t[57]=M,t[58]=Y);let te=!E,X;t[59]===f?X=t[60]:(X=f?(0,Q.jsx)(s,{id:`tHKQ6j`}):(0,Q.jsx)(s,{id:`2wxgft`}),t[59]=f,t[60]=X);let ne;t[61]!==Y||t[62]!==te||t[63]!==X?(ne=(0,Q.jsx)(v,{onClick:Y,disabled:te,children:X}),t[61]=Y,t[62]=te,t[63]=X,t[64]=ne):ne=t[64];let re;t[65]!==J||t[66]!==ne?(re=(0,Q.jsxs)(j,{children:[J,ne]}),t[65]=J,t[66]=ne,t[67]=re):re=t[67];let ie;t[68]!==K||t[69]!==re?(ie=(0,Q.jsxs)(k,{children:[L,K,re]}),t[68]=K,t[69]=re,t[70]=ie):ie=t[70];let ae;return t[71]!==c||t[72]!==ie||t[73]!==F?(ae=(0,Q.jsx)(P,{open:c,onOpenChange:F,children:ie}),t[71]=c,t[72]=ie,t[73]=F,t[74]=ae):ae=t[74],ae}function Xi(){let e=(0,$.c)(5),{_:t}=c(),n=bt(),r=at(),i=Rt(),a;return e[0]!==t||e[1]!==r||e[2]!==n||e[3]!==i?(a=async(e,a)=>{if(a===e.scope)return!1;Xe(e.scope,e.name);let o=await It({name:e.name,fromScope:e.scope,toScope:a});if(Ye(e.scope,e.name),!o.ok)return Je.error(t({id:`07eGJB`,values:{0:o.error}})),!1;Je.success(t({id:`yhI6P0`,values:{0:e.name,1:n[a]}}));let s=i.status===`ready`?i.data.find(t=>t.scope===e.scope&&t.name===e.name):void 0;return r(s?ht(s):De(e.scope,e.name),a===`project`&&o.path!==void 0?`${o.path.replace(/\/+$/,``)}/SKILL`:De(a,e.name)),!0},e[0]=t,e[1]=r,e[2]=n,e[3]=i,e[4]=a):a=e[4],a}function Zi(e){let t=(0,$.c)(38),{target:n,onOpenChange:r}=e,i=bt(),a=Xi(),[o,c]=(0,Z.useState)(!1);if(!n)return null;let{scope:l,name:u,toScope:d}=n,f;t[0]!==o||t[1]!==r?(f=e=>!e&&!o&&r(!1),t[0]=o,t[1]=r,t[2]=f):f=t[2];let p=i[d],m;t[3]===p?m=t[4]:(m=(0,Q.jsx)(O,{children:(0,Q.jsx)(s,{id:`SXEdCq`,values:{0:p}})}),t[3]=p,t[4]=m);let h=i[l],g=i[d],_=i[d],y;t[5]!==u||t[6]!==h||t[7]!==g||t[8]!==_?(y={0:h,1:g,2:_,name:u},t[5]=u,t[6]=h,t[7]=g,t[8]=_,t[9]=y):y=t[9];let b;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(b={0:(0,Q.jsx)(`code`,{className:`font-mono`})},t[10]=b):b=t[10];let x;t[11]===y?x=t[12]:(x=(0,Q.jsx)(D,{children:(0,Q.jsx)(s,{id:`7bIiJ7`,values:y,components:b})}),t[11]=y,t[12]=x);let S;t[13]!==m||t[14]!==x?(S=(0,Q.jsxs)(N,{children:[m,x]}),t[13]=m,t[14]=x,t[15]=S):S=t[15];let C;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Q.jsx)(s,{id:`dEgA5A`}),t[16]=C):C=t[16];let w;t[17]===o?w=t[18]:(w=(0,Q.jsx)(M,{asChild:!0,children:(0,Q.jsx)(v,{variant:`outline`,disabled:o,children:C})}),t[17]=o,t[18]=w);let T;t[19]!==a||t[20]!==u||t[21]!==r||t[22]!==l||t[23]!==d?(T=async()=>{c(!0),await a({scope:l,name:u},d),c(!1),r(!1)},t[19]=a,t[20]=u,t[21]=r,t[22]=l,t[23]=d,t[24]=T):T=t[24];let E;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,Q.jsx)(s,{id:`QWdKwH`}),t[25]=E):E=t[25];let A;t[26]!==o||t[27]!==T?(A=(0,Q.jsx)(v,{"data-testid":`skill-scope-move-confirm`,disabled:o,onClick:T,children:E}),t[26]=o,t[27]=T,t[28]=A):A=t[28];let F;t[29]!==w||t[30]!==A?(F=(0,Q.jsxs)(j,{children:[w,A]}),t[29]=w,t[30]=A,t[31]=F):F=t[31];let I;t[32]!==S||t[33]!==F?(I=(0,Q.jsxs)(k,{className:`sm:max-w-md`,children:[S,F]}),t[32]=S,t[33]=F,t[34]=I):I=t[34];let L;return t[35]!==f||t[36]!==I?(L=(0,Q.jsx)(P,{open:!0,onOpenChange:f,children:I}),t[35]=f,t[36]=I,t[37]=L):L=t[37],L}function Qi(){let e=(0,$.c)(50),{_:t}=c(),n=zt(),[r,i]=(0,Z.useState)(null),[a,o]=(0,Z.useState)(null),[s,l]=(0,Z.useState)(null),[u,d]=(0,Z.useState)(null),[f,p]=(0,Z.useState)(null),[m,h]=(0,Z.useState)(null),[g,_]=(0,Z.useState)(null),[v,y]=(0,Z.useState)(null),b;e[0]===t?b=e[1]:(b=async function(e,n,r){y(e.name);let i=await Nt({scope:e.scope,name:e.name,...n?{targets:[...n]}:{},...r?.linkMode===void 0?{}:{linkMode:r.linkMode}});if(y(null),!i.ok)return Je.error(t({id:`Mj8R8K`,values:{0:i.error}})),i;let a=$i,o=new Set(i.hosts),s=i.hosts.filter(t=>!e.hosts.includes(t)),c=e.hosts.filter(e=>!o.has(e)),l=e=>{let t=i.warningCodes.indexOf(e);return t>=0?i.warnings[t]:void 0},u=l(`no-targets`);if(u)return Je.warning(u),i;if(s.length>0){let e=l(`scripts-present`);e&&Je.warning(e);let t=l(`no-description`);t&&Je.warning(t)}return i.hosts.length===0?Je.success(t({id:`4pDZ2N`,values:{0:e.name}})):s.length>0&&c.length===0?Je.success(t({id:`PPFQ3o`,values:{0:e.name,1:a(s)}})):c.length>0&&s.length===0?Je.success(t({id:`OOIVJo`,values:{0:e.name,1:a(c)}})):s.length>0&&c.length>0?Je.success(t({id:`OxplNM`,values:{0:e.name,1:a(s),2:a(c)}})):Je.success(t({id:`wDgmsr`,values:{0:e.name,1:a(i.hosts)}})),i},e[0]=t,e[1]=b);let x=b,S;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(S=async function(e,t){if(t.length!==0){y(e.name);for(let{target:n,mode:r}of t){let t=await Ft({scope:e.scope,name:e.name,target:n,mode:r});if(!t.ok){Je.error(t.error);break}}y(null)}},e[2]=S):S=e[2];let C=S,w;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(w=async function(e,t){y(e.name);let n=await t();return y(null),n},e[3]=w):w=e[3];let T=w,E;e[4]!==t||e[5]!==n?(E=async function(e,r){let i=await Dt({scope:e.scope,name:e.name,existingNames:r});if(!i.ok){Je.error(t({id:`UPjaXD`,values:{0:e.name,1:i.error}}));return}Je.success(t({id:`0g7rCZ`,values:{0:i.name}})),n(e.scope,i.name)},e[4]=t,e[5]=n,e[6]=E):E=e[6];let D=E,O,k;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(O=e=>{e||i(null)},k=()=>i(null),e[7]=O,e[8]=k):(O=e[7],k=e[8]);let A;e[9]===r?A=e[10]:(A=(0,Q.jsx)(Ui,{skill:r,onOpenChange:O,onDeleted:k}),e[9]=r,e[10]=A);let j=a?.skill??null,M=a?.existingNames??ta,N,P;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(P=e=>{e||o(null)},N=()=>o(null),e[11]=N,e[12]=P):(N=e[11],P=e[12]);let F;e[13]!==j||e[14]!==M?(F=(0,Q.jsx)(Yi,{skill:j,existingNames:M,onOpenChange:P,onRenamed:N}),e[13]=j,e[14]=M,e[15]=F):F=e[15];let I;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(I=e=>{e||l(null)},e[16]=I):I=e[16];let L;e[17]===s?L=e[18]:(L=(0,Q.jsx)(Zi,{target:s,onOpenChange:I}),e[17]=s,e[18]=L);let R;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(R=e=>{e||d(null)},e[19]=R):R=e[19];let z;e[20]===u?z=e[21]:(z=(0,Q.jsx)(qi,{target:u,onOpenChange:R}),e[20]=u,e[21]=z);let B;e[22]===Symbol.for(`react.memo_cache_sentinel`)?(B=e=>{e||p(null)},e[22]=B):B=e[22];let V;e[23]===f?V=e[24]:(V=(0,Q.jsx)(Ki,{target:f,onOpenChange:B}),e[23]=f,e[24]=V);let H;e[25]===Symbol.for(`react.memo_cache_sentinel`)?(H=e=>{e||h(null)},e[25]=H):H=e[25];let U;e[26]===m?U=e[27]:(U=(0,Q.jsx)(Gi,{target:m,onOpenChange:H}),e[26]=m,e[27]=U);let W;e[28]===Symbol.for(`react.memo_cache_sentinel`)?(W=e=>{e||_(null)},e[28]=W):W=e[28];let G;e[29]===g?G=e[30]:(G=(0,Q.jsx)(Ji,{target:g,onOpenChange:W}),e[29]=g,e[30]=G);let K;e[31]!==F||e[32]!==L||e[33]!==z||e[34]!==V||e[35]!==U||e[36]!==G||e[37]!==A?(K=(0,Q.jsxs)(Q.Fragment,{children:[A,F,L,z,V,U,G]}),e[31]=F,e[32]=L,e[33]=z,e[34]=V,e[35]=U,e[36]=G,e[37]=A,e[38]=K):K=e[38];let ee=K,q,J,Y,te,X,ne;e[39]===Symbol.for(`react.memo_cache_sentinel`)?(q=(e,t)=>o({skill:e,existingNames:t}),J=(e,t)=>l({scope:e.scope,name:e.name,toScope:t}),Y=(e,t)=>d({skill:e,filePath:t}),te=(e,t)=>p({skill:e,filePath:t}),X=(e,t)=>h(t===void 0?{skill:e}:{skill:e,prefix:t}),ne=(e,t)=>_({skill:e,editor:t}),e[39]=q,e[40]=J,e[41]=Y,e[42]=te,e[43]=X,e[44]=ne):(q=e[39],J=e[40],Y=e[41],te=e[42],X=e[43],ne=e[44]);let re;return e[45]!==ee||e[46]!==D||e[47]!==x||e[48]!==v?(re={installingName:v,install:x,convertLocations:C,runLocationWrite:T,duplicate:D,requestDelete:i,requestRename:q,requestScopeMove:J,requestFileRename:Y,requestFileDelete:te,requestFileCreate:X,requestForkResolve:ne,dialogs:ee},e[45]=ee,e[46]=D,e[47]=x,e[48]=v,e[49]=re):re=e[49],re}function $i(e){return e.map(ea).join(`, `)}function ea(e){return He[e]??e}var ta=new Set;function na(e){let t=(0,$.c)(7),{absolutePath:n,menuKind:r}=e,i=r===void 0?`dropdown`:r,a=typeof window<`u`?window.okDesktop:void 0;if(!a||!n)return null;let o;t[0]===n?o=t[1]:(o=()=>void a.shell.showItemInFolder(n),t[0]=n,t[1]=o);let s,c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Q.jsx)(ut,{"aria-hidden":!0}),c=Mi(a.platform),t[2]=s,t[3]=c):(s=t[2],c=t[3]);let l;return t[4]!==i||t[5]!==o?(l=(0,Q.jsxs)(Jr,{menuKind:i,onSelect:o,children:[s,c]}),t[4]=i,t[5]=o,t[6]=l):l=t[6],l}function ra(e){let t=(0,$.c)(68),{skill:n,filePath:r,actions:i,menuKind:a}=e,o=a===void 0?`dropdown`:a,{_:l}=c(),u;t[0]!==r||t[1]!==n.absolutePath?(u=n.absolutePath?`${vt(n.absolutePath)}/${r}`:void 0,t[0]=r,t[1]=n.absolutePath,t[2]=u):u=t[2];let d=u,f;t[3]===n.path?f=t[4]:(f=vt(n.path),t[3]=n.path,t[4]=f);let p=`${f}/${r}`,m;t[5]===l?m=t[6]:(m=async function(e){try{await Bt(e),Je.success(l({id:`SXCSQd`}))}catch{Je.error(l({id:`cRHuuI`}))}},t[5]=l,t[6]=m);let h=m,g;t[7]!==i||t[8]!==r||t[9]!==n?(g=()=>i.requestFileRename(n,r),t[7]=i,t[8]=r,t[9]=n,t[10]=g):g=t[10];let _,v;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Q.jsx)(Pr,{"aria-hidden":!0}),v=(0,Q.jsx)(s,{id:`2wxgft`}),t[11]=_,t[12]=v):(_=t[11],v=t[12]);let y;t[13]!==o||t[14]!==g?(y=(0,Q.jsxs)(Jr,{menuKind:o,onSelect:g,children:[_,v]}),t[13]=o,t[14]=g,t[15]=y):y=t[15];let b;t[16]!==d||t[17]!==o?(b=(0,Q.jsx)(na,{absolutePath:d,menuKind:o}),t[16]=d,t[17]=o,t[18]=b):b=t[18];let x,S;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Q.jsx)(lt,{"aria-hidden":!0}),S=(0,Q.jsx)(s,{id:`zd00pH`}),t[19]=x,t[20]=S):(x=t[19],S=t[20]);let C;t[21]===o?C=t[22]:(C=(0,Q.jsxs)(ei,{menuKind:o,children:[x,S]}),t[21]=o,t[22]=C);let w;t[23]!==d||t[24]!==h||t[25]!==o?(w=d?(0,Q.jsx)(Jr,{menuKind:o,onSelect:()=>void h(d),children:(0,Q.jsx)(s,{id:`z2funE`})}):null,t[23]=d,t[24]=h,t[25]=o,t[26]=w):w=t[26];let T;t[27]!==h||t[28]!==p?(T=()=>void h(p),t[27]=h,t[28]=p,t[29]=T):T=t[29];let E;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,Q.jsx)(s,{id:`xloBjn`}),t[30]=E):E=t[30];let D;t[31]!==o||t[32]!==T?(D=(0,Q.jsx)(Jr,{menuKind:o,onSelect:T,children:E}),t[31]=o,t[32]=T,t[33]=D):D=t[33];let O;t[34]!==o||t[35]!==w||t[36]!==D?(O=(0,Q.jsxs)(qr,{menuKind:o,children:[w,D]}),t[34]=o,t[35]=w,t[36]=D,t[37]=O):O=t[37];let k;t[38]!==o||t[39]!==O?(k=(0,Q.jsx)($r,{menuKind:o,children:O}),t[38]=o,t[39]=O,t[40]=k):k=t[40];let A;t[41]!==o||t[42]!==C||t[43]!==k?(A=(0,Q.jsxs)(Qr,{menuKind:o,children:[C,k]}),t[41]=o,t[42]=C,t[43]=k,t[44]=A):A=t[44];let j;t[45]!==o||t[46]!==A||t[47]!==y||t[48]!==b?(j=(0,Q.jsxs)(qr,{menuKind:o,children:[y,b,A]}),t[45]=o,t[46]=A,t[47]=y,t[48]=b,t[49]=j):j=t[49];let M;t[50]===o?M=t[51]:(M=(0,Q.jsx)(Zr,{menuKind:o}),t[50]=o,t[51]=M);let N;t[52]!==i||t[53]!==r||t[54]!==n?(N=()=>i.requestFileDelete(n,r),t[52]=i,t[53]=r,t[54]=n,t[55]=N):N=t[55];let P,F;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,Q.jsx)(pt,{"aria-hidden":!0}),F=(0,Q.jsx)(s,{id:`cnGeoo`}),t[56]=P,t[57]=F):(P=t[56],F=t[57]);let I;t[58]!==o||t[59]!==N?(I=(0,Q.jsxs)(Jr,{menuKind:o,variant:`destructive`,onSelect:N,children:[P,F]}),t[58]=o,t[59]=N,t[60]=I):I=t[60];let L;t[61]!==o||t[62]!==I?(L=(0,Q.jsx)(qr,{menuKind:o,children:I}),t[61]=o,t[62]=I,t[63]=L):L=t[63];let R;return t[64]!==j||t[65]!==M||t[66]!==L?(R=(0,Q.jsxs)(Q.Fragment,{children:[j,M,L]}),t[64]=j,t[65]=M,t[66]=L,t[67]=R):R=t[67],R}function ia(e){let t=(0,$.c)(15),{skill:n,actions:r,existingNames:i,menuKind:a}=e,o=a===void 0?`dropdown`:a,s=nt(),c=g().states,{dispatch:l}=jr(),u=typeof window<`u`?window.okDesktop:void 0,d;t[0]!==n.name||t[1]!==n.scope||t[2]!==s?(d=mr({skillName:n.name,scope:n.scope,workspace:s}),t[0]=n.name,t[1]=n.scope,t[2]=s,t[3]=d):d=t[3];let f=d,p;t[4]!==l||t[5]!==f||t[6]!==c||t[7]!==o?(p=o===`context`?(0,Q.jsx)(ji,{input:f,installStates:c,dispatch:l}):(0,Q.jsx)(Pi,{input:f,installStates:c,isElectronHost:u!=null,dispatch:l}),t[4]=l,t[5]=f,t[6]=c,t[7]=o,t[8]=p):p=t[8];let m;return t[9]!==r||t[10]!==i||t[11]!==o||t[12]!==n||t[13]!==p?(m=(0,Q.jsx)(aa,{actions:r,existingNames:i,menuKind:o,skill:n,openWithAi:p}),t[9]=r,t[10]=i,t[11]=o,t[12]=n,t[13]=p,t[14]=m):m=t[14],m}function aa(e){let t=(0,$.c)(124),{actions:r,existingNames:i,menuKind:a,openWithAi:o,skill:l}=e,{_:u}=c(),d=bt(),p=ui(l,r),m=l.absolutePath,h;t[0]===u?h=t[1]:(h=async function(e){try{await Bt(e),Je.success(u({id:`SXCSQd`}))}catch{Je.error(u({id:`cRHuuI`}))}},t[0]=u,t[1]=h);let g=h,_;t[2]!==m||t[3]!==a?(_=(0,Q.jsx)(na,{absolutePath:m,menuKind:a}),t[2]=m,t[3]=a,t[4]=_):_=t[4];let v,y;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Q.jsx)(lt,{"aria-hidden":!0}),y=(0,Q.jsx)(s,{id:`zd00pH`}),t[5]=v,t[6]=y):(v=t[5],y=t[6]);let b;t[7]===a?b=t[8]:(b=(0,Q.jsxs)(ei,{menuKind:a,children:[v,y]}),t[7]=a,t[8]=b);let x;t[9]!==m||t[10]!==g||t[11]!==a?(x=m?(0,Q.jsx)(Jr,{menuKind:a,onSelect:()=>void g(m),children:(0,Q.jsx)(s,{id:`z2funE`})}):null,t[9]=m,t[10]=g,t[11]=a,t[12]=x):x=t[12];let S;t[13]!==g||t[14]!==l.path?(S=()=>void g(l.path),t[13]=g,t[14]=l.path,t[15]=S):S=t[15];let C;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Q.jsx)(s,{id:`xloBjn`}),t[16]=C):C=t[16];let w;t[17]!==a||t[18]!==S?(w=(0,Q.jsx)(Jr,{menuKind:a,onSelect:S,children:C}),t[17]=a,t[18]=S,t[19]=w):w=t[19];let T;t[20]!==a||t[21]!==x||t[22]!==w?(T=(0,Q.jsxs)(qr,{menuKind:a,children:[x,w]}),t[20]=a,t[21]=x,t[22]=w,t[23]=T):T=t[23];let E;t[24]!==a||t[25]!==T?(E=(0,Q.jsx)($r,{menuKind:a,children:T}),t[24]=a,t[25]=T,t[26]=E):E=t[26];let D;t[27]!==a||t[28]!==E||t[29]!==b?(D=(0,Q.jsxs)(Qr,{menuKind:a,children:[b,E]}),t[27]=a,t[28]=E,t[29]=b,t[30]=D):D=t[30];let O;t[31]!==a||t[32]!==o||t[33]!==D||t[34]!==_?(O=(0,Q.jsxs)(qr,{menuKind:a,children:[_,o,D]}),t[31]=a,t[32]=o,t[33]=D,t[34]=_,t[35]=O):O=t[35];let k;t[36]===a?k=t[37]:(k=(0,Q.jsx)(Zr,{menuKind:a}),t[36]=a,t[37]=k);let A;t[38]!==r||t[39]!==i||t[40]!==l?(A=()=>void r.duplicate(l,i),t[38]=r,t[39]=i,t[40]=l,t[41]=A):A=t[41];let j,M;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Q.jsx)(n,{"aria-hidden":!0}),M=(0,Q.jsx)(s,{id:`euc6Ns`}),t[42]=j,t[43]=M):(j=t[42],M=t[43]);let N;t[44]!==a||t[45]!==A?(N=(0,Q.jsxs)(Jr,{menuKind:a,onSelect:A,children:[j,M]}),t[44]=a,t[45]=A,t[46]=N):N=t[46];let P;t[47]!==r||t[48]!==i||t[49]!==l?(P=()=>r.requestRename(l,i),t[47]=r,t[48]=i,t[49]=l,t[50]=P):P=t[50];let F,I;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Q.jsx)(Pr,{"aria-hidden":!0}),I=(0,Q.jsx)(s,{id:`2wxgft`}),t[51]=F,t[52]=I):(F=t[51],I=t[52]);let L;t[53]!==a||t[54]!==P?(L=(0,Q.jsxs)(Jr,{menuKind:a,onSelect:P,children:[F,I]}),t[53]=a,t[54]=P,t[55]=L):L=t[55];let R;t[56]!==r||t[57]!==l?(R=()=>r.requestFileCreate(l),t[56]=r,t[57]=l,t[58]=R):R=t[58];let z,B;t[59]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,Q.jsx)(f,{"aria-hidden":!0}),B=(0,Q.jsx)(s,{id:`HdkSiO`}),t[59]=z,t[60]=B):(z=t[59],B=t[60]);let V;t[61]!==a||t[62]!==R?(V=(0,Q.jsxs)(Jr,{menuKind:a,onSelect:R,children:[z,B]}),t[61]=a,t[62]=R,t[63]=V):V=t[63];let H,U;t[64]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,Q.jsx)(Nr,{"aria-hidden":!0}),U=(0,Q.jsx)(s,{id:`TKQ7K-`}),t[64]=H,t[65]=U):(H=t[64],U=t[65]);let W;t[66]===a?W=t[67]:(W=(0,Q.jsxs)(ei,{menuKind:a,children:[H,U]}),t[66]=a,t[67]=W);let G;t[68]!==r||t[69]!==l?(G=e=>r.requestForkResolve(l,e),t[68]=r,t[69]=l,t[70]=G):G=t[70];let K;t[71]!==p||t[72]!==a||t[73]!==l||t[74]!==G?(K=(0,Q.jsx)(hi,{toggles:p,skill:l,menuKind:a,onResolveFork:G}),t[71]=p,t[72]=a,t[73]=l,t[74]=G,t[75]=K):K=t[75];let ee;t[76]!==a||t[77]!==K?(ee=(0,Q.jsx)(qr,{menuKind:a,children:K}),t[76]=a,t[77]=K,t[78]=ee):ee=t[78];let q;t[79]!==a||t[80]!==ee?(q=(0,Q.jsx)($r,{menuKind:a,className:li,children:ee}),t[79]=a,t[80]=ee,t[81]=q):q=t[81];let J;t[82]!==a||t[83]!==W||t[84]!==q?(J=(0,Q.jsxs)(Qr,{menuKind:a,children:[W,q]}),t[82]=a,t[83]=W,t[84]=q,t[85]=J):J=t[85];let Y;t[86]!==r||t[87]!==l?(Y=()=>r.requestScopeMove(l,l.scope===`project`?`global`:`project`),t[86]=r,t[87]=l,t[88]=Y):Y=t[88];let te;t[89]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,Q.jsx)(Mr,{"aria-hidden":!0}),t[89]=te):te=t[89];let X;t[90]!==d.global||t[91]!==d.project||t[92]!==l.scope?(X=l.scope===`project`?(0,Q.jsx)(s,{id:`bpytj4`,values:{0:d.global}}):(0,Q.jsx)(s,{id:`bpytj4`,values:{0:d.project}}),t[90]=d.global,t[91]=d.project,t[92]=l.scope,t[93]=X):X=t[93];let ne;t[94]!==a||t[95]!==Y||t[96]!==X?(ne=(0,Q.jsxs)(Jr,{menuKind:a,onSelect:Y,children:[te,X]}),t[94]=a,t[95]=Y,t[96]=X,t[97]=ne):ne=t[97];let re;t[98]!==a||t[99]!==N||t[100]!==L||t[101]!==V||t[102]!==J||t[103]!==ne?(re=(0,Q.jsxs)(qr,{menuKind:a,children:[N,L,V,J,ne]}),t[98]=a,t[99]=N,t[100]=L,t[101]=V,t[102]=J,t[103]=ne,t[104]=re):re=t[104];let ie;t[105]===a?ie=t[106]:(ie=(0,Q.jsx)(Zr,{menuKind:a}),t[105]=a,t[106]=ie);let ae;t[107]!==r||t[108]!==l?(ae=()=>r.requestDelete(l),t[107]=r,t[108]=l,t[109]=ae):ae=t[109];let oe,se;t[110]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,Q.jsx)(pt,{"aria-hidden":!0}),se=(0,Q.jsx)(s,{id:`cnGeoo`}),t[110]=oe,t[111]=se):(oe=t[110],se=t[111]);let ce;t[112]!==a||t[113]!==ae?(ce=(0,Q.jsxs)(Jr,{menuKind:a,variant:`destructive`,onSelect:ae,children:[oe,se]}),t[112]=a,t[113]=ae,t[114]=ce):ce=t[114];let le;t[115]!==a||t[116]!==ce?(le=(0,Q.jsx)(qr,{menuKind:a,children:ce}),t[115]=a,t[116]=ce,t[117]=le):le=t[117];let ue;return t[118]!==O||t[119]!==k||t[120]!==re||t[121]!==ie||t[122]!==le?(ue=(0,Q.jsxs)(Q.Fragment,{children:[O,k,re,ie,le]}),t[118]=O,t[119]=k,t[120]=re,t[121]=ie,t[122]=le,t[123]=ue):ue=t[123],ue}export{pr as A,Ur as C,Mr as D,Fr as E,fr as F,Er as I,jr as L,ur as M,Sr as N,hr as O,Or as P,cr as R,zr as S,Lr as T,Wr as _,Zi as a,Vr as b,Pi as c,Oi as d,ci as f,Ir as g,ui as h,Qi as i,lr as j,dr as k,Mi as l,hi as m,ra as n,Ri as o,li as p,na as r,Bi as s,ia as t,ji as u,Br as v,Hr as w,Kr as x,Rr as y};
@@ -1 +1 @@
1
- import{r as e}from"./dist-Nvb76hAm.js";import{At as t,Da as n,Ta as r,ja as i}from"./dist-PVtTd_Sj2.js";function a(e){return e.path.split(`/`).slice(0,-1).join(`/`)}var o=[`project`,`global`];function s(e){return{project:new Set(e.filter(e=>e.scope===`project`).map(e=>e.name)),global:new Set(e.filter(e=>e.scope===`global`).map(e=>e.name))}}function c(e){return e.startsWith(`open-knowledge-pack-`)?e.slice(i.length):e}function l(e){let t=e.path.replace(/\/SKILL\.mdx?$/i,``);return e.scope===`global`?`~/${t}`:t}function u(e){return e.replace(/^\/(?:Users|home)\/[^/]+/,`~`).replace(/^\/root/,`~`)}function d(e){let t=e.lastIndexOf(`/`);return t>0?e.slice(0,t):e}function f(){let{_:t}=e();return{project:t({id:`e0NrBM`}),global:t({id:`2GT3Hf`})}}function p(){let{_:t}=e();return{project:t({id:`Es3G-g`}),global:t({id:`fvrHin`})}}function m(e,t){if(e.includes(`/`))return t===`global`?`~/${e}`:e;let i=e===`agents`?`.agents/skills`:(t===`global`?n:r)[e]??`.${e}/skills`;return t===`global`?`~/${i}`:i}function h(e,t){return!e||t===``?[]:Object.keys(e).filter(n=>e[n]===t)}function g(e){let t=e.hostAliases??{},n=e=>e.split(`/`).slice(0,-1).join(`/`),r=new Set(e.hosts),i=new Set([...e.hosts.filter(e=>!e.includes(`/`)).map(t=>m(t,e.scope).replace(/^~\//,``)),...(e.customPlacements??[]).map(e=>n(e.path)),...e.path.includes(`/`)?[n(e.path.replace(/\/SKILL\.mdx?$/i,``))]:[]]);return Object.entries(t).filter(([e,t])=>!r.has(e)&&i.has(t)).map(([e])=>e)}function _(e){let t=new Set(e.symlinkedHosts??[]),n=[],r=new Set,i=(e,t)=>{r.has(e)||(r.add(e),n.push({dir:e,symlink:t}))};i(l(e),t.has(e.hosts[0]??``));for(let n of e.hosts)i(`${m(n,e.scope)}/${e.name}`,t.has(n));for(let t of e.customPlacements??[])i(t.path,t.mode===`link`);return n}function v(e,n=e.hosts){let r=t.options,i=g(e);return[...n.includes(`agents`)?[`agents`]:[],...r.filter(e=>n.includes(e)||i.includes(e)),...(e.customPlacements??[]).map(e=>a(e))]}export{d as a,m as c,p as d,f,v as i,s as l,h as n,c as o,a as r,_ as s,o as t,u};
1
+ import{r as e}from"./dist-Nvb76hAm.js";import{At as t,Da as n,Ta as r,ja as i}from"./dist-TVrIGknK2.js";function a(e){return e.path.split(`/`).slice(0,-1).join(`/`)}var o=[`project`,`global`];function s(e){return{project:new Set(e.filter(e=>e.scope===`project`).map(e=>e.name)),global:new Set(e.filter(e=>e.scope===`global`).map(e=>e.name))}}function c(e){return e.startsWith(`open-knowledge-pack-`)?e.slice(i.length):e}function l(e){let t=e.path.replace(/\/SKILL\.mdx?$/i,``);return e.scope===`global`?`~/${t}`:t}function u(e){return e.replace(/^\/(?:Users|home)\/[^/]+/,`~`).replace(/^\/root/,`~`)}function d(e){let t=e.lastIndexOf(`/`);return t>0?e.slice(0,t):e}function f(){let{_:t}=e();return{project:t({id:`e0NrBM`}),global:t({id:`2GT3Hf`})}}function p(){let{_:t}=e();return{project:t({id:`Es3G-g`}),global:t({id:`fvrHin`})}}function m(e,t){if(e.includes(`/`))return t===`global`?`~/${e}`:e;let i=e===`agents`?`.agents/skills`:(t===`global`?n:r)[e]??`.${e}/skills`;return t===`global`?`~/${i}`:i}function h(e,t){return!e||t===``?[]:Object.keys(e).filter(n=>e[n]===t)}function g(e){let t=e.hostAliases??{},n=e=>e.split(`/`).slice(0,-1).join(`/`),r=new Set(e.hosts),i=new Set([...e.hosts.filter(e=>!e.includes(`/`)).map(t=>m(t,e.scope).replace(/^~\//,``)),...(e.customPlacements??[]).map(e=>n(e.path)),...e.path.includes(`/`)?[n(e.path.replace(/\/SKILL\.mdx?$/i,``))]:[]]);return Object.entries(t).filter(([e,t])=>!r.has(e)&&i.has(t)).map(([e])=>e)}function _(e){let t=new Set(e.symlinkedHosts??[]),n=[],r=new Set,i=(e,t)=>{r.has(e)||(r.add(e),n.push({dir:e,symlink:t}))};i(l(e),t.has(e.hosts[0]??``));for(let n of e.hosts)i(`${m(n,e.scope)}/${e.name}`,t.has(n));for(let t of e.customPlacements??[])i(t.path,t.mode===`link`);return n}function v(e,n=e.hosts){let r=t.options,i=g(e);return[...n.includes(`agents`)?[`agents`]:[],...r.filter(e=>n.includes(e)||i.includes(e)),...(e.customPlacements??[]).map(e=>a(e))]}export{d as a,m as c,p as d,f,v as i,s as l,h as n,c as o,a as r,_ as s,o as t,u};
@@ -1 +1 @@
1
- import{Mt as e}from"./dist-PVtTd_Sj2.js";import{t}from"./dist-C7IFraT6.js";import{t as n}from"./parse-api-error-Cyn4P6OR.js";import{o as r}from"./documents-events-COSAPFkC.js";async function i(e){return n(await e.json().catch(()=>null))??`HTTP ${e.status}`}async function a(e,t){try{let n=await fetch(e,t?{signal:t}:void 0);return n.ok?{ok:!0,...await n.json()}:{ok:!1,error:await i(n)}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function o(e,t,n){try{let r=await fetch(e,{method:t,...n===void 0?{}:{headers:{"Content-Type":`application/json`},body:JSON.stringify(n)}});return r.ok?{ok:!0,...await r.json().catch(()=>null)??{}}:{ok:!1,error:await i(r)}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function s(e){let t=e.trim();return t.length<2?{ok:!0,results:[],backend:`skills.sh`,degraded:!1}:a(`/api/skills/search?q=${encodeURIComponent(t)}`)}async function c(){return a(`/api/skills/popular?limit=24`)}async function l(n,r){let i=await a(n?`/api/skills?scope=${n}`:`/api/skills`,r);if(!i.ok)return i;let{ok:o,...s}=i,c=e.safeParse(s);return c.success?{ok:!0,skills:c.data.skills}:{ok:!1,error:t._({id:`iXs0kt`})}}async function u(e){return a(`/api/skills/detail?${new URLSearchParams({source:e.source,name:e.name}).toString()}`)}async function d(e,t){return a(`/api/skills/preview?${new URLSearchParams({source:e.source,name:e.name}).toString()}`,t)}async function f(e,t){return a(`/api/skills/resolve-ref?${new URLSearchParams({ref:e.ref,scope:e.scope,from:e.from}).toString()}`,t)}async function p(e,t){return a(`/api/skills/discover?source=${encodeURIComponent(e)}`,t)}async function m(){return a(`/api/skills/installed`)}async function h(e){try{let n=await fetch(`/api/skill/edit-external`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!n.ok)return{ok:!1,error:await i(n)};let r=await n.json().catch(()=>null);return!r||typeof r.docName!=`string`?{ok:!1,error:t._({id:`iBVgIQ`})}:{ok:!0,docName:r.docName}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function g(e){try{let t=await fetch(`/api/skill`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await i(t)};let n=await t.json().catch(()=>null);return r(),{ok:!0,created:n?.created??!1,warnings:n?.warnings??[],...typeof n?.path==`string`?{path:n.path}:{}}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function _(e){try{let i=await fetch(`/api/skill/import`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!i.ok){let e=await i.json().catch(()=>null),t=n(e)??`HTTP ${i.status}`,r=typeof e?.detail==`string`&&/multiple skills/i.test(String(e?.title??``))?String(e.detail).split(`, `).map(e=>e.trim()).filter(Boolean):void 0;return r?{ok:!1,error:t,skills:r}:{ok:!1,error:t}}let a=await i.json().catch(()=>null);return!a||typeof a.name!=`string`?{ok:!1,error:t._({id:`HLoO-Z`})}:(r(),{ok:!0,name:a.name,alreadyImported:a?.alreadyImported??!1,collisionRenamedFrom:a?.collisionRenamedFrom,warnings:a?.warnings??[]})}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function v(e){try{let n=await fetch(`/api/skills/import-bulk`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!n.ok)return{ok:!1,error:await i(n)};let a=await n.json().catch(()=>null);return!a||!Array.isArray(a.results)?{ok:!1,error:t._({id:`HLoO-Z`})}:(r(),{ok:!0,...a})}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function y(e,n){try{let a=await fetch(`/api/skill-upload?scope=${encodeURIComponent(n)}`,{method:`POST`,body:e});if(!a.ok)return{ok:!1,error:await i(a)};let o=await a.json().catch(()=>null);return!o||typeof o.name!=`string`?{ok:!1,error:t._({id:`iodl3p`})}:(r(),{ok:!0,name:o.name,alreadyImported:o?.alreadyImported??!1,collisionRenamedFrom:o?.collisionRenamedFrom,warnings:o?.warnings??[]})}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}function b(e,t){let n=`${e}-copy`;if(!t.has(n))return n;for(let n=2;n<1e3;n+=1){let r=`${e}-copy-${n}`;if(!t.has(r))return r}return`${e}-copy-${t.size+1}`}async function x(e){try{let n=b(e.name,e.existingNames),a=await fetch(`/api/skill/duplicate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({scope:e.scope,name:e.name,toName:n})});if(!a.ok)return{ok:!1,error:await i(a)};let o=await a.json().catch(()=>null);return typeof o?.name==`string`?(r(),{ok:!0,name:o.name}):{ok:!1,error:t._({id:`emMrXQ`})}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function S(e){let{name:t,fromScope:n,toScope:a}=e;if(n===a)return{ok:!0,scope:a};try{let e=await fetch(`/api/skill/move-scope`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({name:t,fromScope:n,toScope:a})});if(!e.ok)return{ok:!1,error:await i(e)};let o=await e.json().catch(()=>null);return r(),{ok:!0,scope:a,...typeof o?.path==`string`?{path:o.path}:{}}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function C(e){try{let t=await fetch(`/api/skill`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await i(t)};let n=await t.json().catch(()=>null);return r(),{ok:!0,committed:n?.committed??!1,...typeof n?.to==`string`?{to:n.to}:{}}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function w(e,t){try{let n=`?name=${encodeURIComponent(t)}&scope=${encodeURIComponent(e)}`,a=await fetch(`/api/skill${n}`,{method:`DELETE`});if(!a.ok)return{ok:!1,error:await i(a)};let o=await a.json().catch(()=>null);return r(),{ok:!0,existed:o?.existed??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function T(e){let t=await o(`/api/skill/install`,`POST`,{scope:e.scope,name:e.name,fork:{editor:e.editor,action:e.action,...e.toName===void 0?{}:{toName:e.toName}}});return t.ok?(r(),{ok:!0}):t}async function E(e){try{let t=await fetch(`/api/skill-file`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await i(t)};let n=await t.json().catch(()=>null);return r(),{ok:!0,path:n?.path??e.path}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function D(e){try{let t=await fetch(`/api/skill-file/rename`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await i(t)};let n=await t.json().catch(()=>null);return r(),{ok:!0,from:n?.from??e.from,to:n?.to??e.to,...n?.fromDocName===void 0?{}:{fromDocName:n.fromDocName},...n?.toDocName===void 0?{}:{toDocName:n.toDocName}}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function O(e){try{let t=new URLSearchParams({scope:e.scope,name:e.name,path:e.path}),n=await fetch(`/api/skill-file?${t.toString()}`,{method:`DELETE`});if(!n.ok)return{ok:!1,error:await i(n)};let a=await n.json().catch(()=>null);return r(),{ok:!0,existed:a?.existed??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function k(e,t,n){try{let r=new URLSearchParams({name:t,scope:e,...n?{host:n}:{}}),a=await fetch(`/api/skill?${r.toString()}`);return a.ok?{ok:!0,files:(await a.json().catch(()=>null))?.skill?.files??[]}:{ok:!1,error:await i(a)}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function A(e){try{let t=new URLSearchParams({name:e.name,scope:e.scope,path:e.path,...e.host?{host:e.host}:{}}),n=await fetch(`/api/skill-file?${t.toString()}`,{signal:e.signal});if(!n.ok)return{ok:!1,status:n.status,error:await i(n)};let r=await n.json().catch(()=>null);return typeof r?.text==`string`?{ok:!0,text:r.text}:{ok:!1,status:n.status,error:`HTTP ${n.status}`}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}function j(e,t){return A({...e,signal:t}).then(e=>e.ok?{ok:!0,text:e.text}:{ok:!1,status:e.status})}async function M(e){try{let t=await fetch(`/api/skill/install`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await i(t)};let n=await t.json().catch(()=>null);return r(),{ok:!0,hosts:n?.hosts??[],scripts:n?.scripts??!1,warnings:n?.warnings??[],warningCodes:n?.warningCodes??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function N(e){try{let t=await fetch(`/api/skill/install`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({scope:e.scope,name:e.name,place:{dir:e.dir,mode:e.mode}})});if(!t.ok)return{ok:!1,error:await i(t)};let n=await t.json().catch(()=>null);return r(),{ok:!0,placedAt:n?.placedAt??e.dir}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function P(e){let t=await o(`/api/skill/install`,`POST`,{scope:e.scope,name:e.name,unplace:{path:e.path}});return t.ok?(r(),{ok:!0}):t}async function F(e){let t=await o(`/api/skill/install`,`POST`,{scope:e.scope,name:e.name,setSource:e.target});return t.ok?(r(),{ok:!0}):t}async function I(e){let t=await o(`/api/skill/install`,`POST`,{scope:e.scope,name:e.name,convert:{target:e.target,mode:e.mode}});return t.ok?(r(),{ok:!0}):t}async function L(e){try{let t=await fetch(`/api/skill-targets`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({folderAction:e})});return t.ok?{ok:!0}:{ok:!1,error:await i(t)}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function R(e){try{let t=await fetch(`/api/skill/reimport`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await i(t)};let n=await t.json().catch(()=>null);return e.dryRun||r(),{ok:!0,updated:n?.updated??!1,source:n?.source??``,localBody:n?.localBody,upstreamBody:n?.upstreamBody,...n?.gitTracked===void 0?{}:{gitTracked:n.gitTracked},warnings:n?.warnings??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function z(e){try{let t=await fetch(`/api/skill/revert`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await i(t)};let n=await t.json().catch(()=>null);return r(),{ok:!0,warnings:n?.warnings??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}export{y as A,T as C,s as D,g as E,F as O,D as S,z as T,C as _,x as a,L as b,u as c,_ as d,v as f,j as g,l as h,p as i,E as j,P as k,d as l,m,w as n,h as o,M as p,O as r,c as s,I as t,k as u,S as v,f as w,R as x,N as y};
1
+ import{Mt as e}from"./dist-TVrIGknK2.js";import{t}from"./dist-DoS8xGN6.js";import{o as n}from"./documents-events-B6nWdFan.js";import{t as r}from"./parse-api-error-Mgtc4OJu.js";async function i(e){return r(await e.json().catch(()=>null))??`HTTP ${e.status}`}async function a(e,t){try{let n=await fetch(e,t?{signal:t}:void 0);return n.ok?{ok:!0,...await n.json()}:{ok:!1,error:await i(n)}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function o(e,t,n){try{let r=await fetch(e,{method:t,...n===void 0?{}:{headers:{"Content-Type":`application/json`},body:JSON.stringify(n)}});return r.ok?{ok:!0,...await r.json().catch(()=>null)??{}}:{ok:!1,error:await i(r)}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function s(e){let t=e.trim();return t.length<2?{ok:!0,results:[],backend:`skills.sh`,degraded:!1}:a(`/api/skills/search?q=${encodeURIComponent(t)}`)}async function c(){return a(`/api/skills/popular?limit=24`)}async function l(n,r){let i=await a(n?`/api/skills?scope=${n}`:`/api/skills`,r);if(!i.ok)return i;let{ok:o,...s}=i,c=e.safeParse(s);return c.success?{ok:!0,skills:c.data.skills}:{ok:!1,error:t._({id:`iXs0kt`})}}async function u(e){return a(`/api/skills/detail?${new URLSearchParams({source:e.source,name:e.name}).toString()}`)}async function d(e,t){return a(`/api/skills/preview?${new URLSearchParams({source:e.source,name:e.name}).toString()}`,t)}async function f(e,t){return a(`/api/skills/resolve-ref?${new URLSearchParams({ref:e.ref,scope:e.scope,from:e.from}).toString()}`,t)}async function p(e,t){return a(`/api/skills/discover?source=${encodeURIComponent(e)}`,t)}async function m(){return a(`/api/skills/installed`)}async function h(e){try{let n=await fetch(`/api/skill/edit-external`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!n.ok)return{ok:!1,error:await i(n)};let r=await n.json().catch(()=>null);return!r||typeof r.docName!=`string`?{ok:!1,error:t._({id:`iBVgIQ`})}:{ok:!0,docName:r.docName}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function g(e){try{let t=await fetch(`/api/skill`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await i(t)};let r=await t.json().catch(()=>null);return n(),{ok:!0,created:r?.created??!1,warnings:r?.warnings??[],...typeof r?.path==`string`?{path:r.path}:{}}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function _(e){try{let i=await fetch(`/api/skill/import`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!i.ok){let e=await i.json().catch(()=>null),t=r(e)??`HTTP ${i.status}`,n=typeof e?.detail==`string`&&/multiple skills/i.test(String(e?.title??``))?String(e.detail).split(`, `).map(e=>e.trim()).filter(Boolean):void 0;return n?{ok:!1,error:t,skills:n}:{ok:!1,error:t}}let a=await i.json().catch(()=>null);return!a||typeof a.name!=`string`?{ok:!1,error:t._({id:`HLoO-Z`})}:(n(),{ok:!0,name:a.name,alreadyImported:a?.alreadyImported??!1,collisionRenamedFrom:a?.collisionRenamedFrom,warnings:a?.warnings??[]})}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function v(e){try{let r=await fetch(`/api/skills/import-bulk`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!r.ok)return{ok:!1,error:await i(r)};let a=await r.json().catch(()=>null);return!a||!Array.isArray(a.results)?{ok:!1,error:t._({id:`HLoO-Z`})}:(n(),{ok:!0,...a})}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function y(e,r){try{let a=await fetch(`/api/skill-upload?scope=${encodeURIComponent(r)}`,{method:`POST`,body:e});if(!a.ok)return{ok:!1,error:await i(a)};let o=await a.json().catch(()=>null);return!o||typeof o.name!=`string`?{ok:!1,error:t._({id:`iodl3p`})}:(n(),{ok:!0,name:o.name,alreadyImported:o?.alreadyImported??!1,collisionRenamedFrom:o?.collisionRenamedFrom,warnings:o?.warnings??[]})}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}function b(e,t){let n=`${e}-copy`;if(!t.has(n))return n;for(let n=2;n<1e3;n+=1){let r=`${e}-copy-${n}`;if(!t.has(r))return r}return`${e}-copy-${t.size+1}`}async function x(e){try{let r=b(e.name,e.existingNames),a=await fetch(`/api/skill/duplicate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({scope:e.scope,name:e.name,toName:r})});if(!a.ok)return{ok:!1,error:await i(a)};let o=await a.json().catch(()=>null);return typeof o?.name==`string`?(n(),{ok:!0,name:o.name}):{ok:!1,error:t._({id:`emMrXQ`})}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function S(e){let{name:t,fromScope:r,toScope:a}=e;if(r===a)return{ok:!0,scope:a};try{let e=await fetch(`/api/skill/move-scope`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({name:t,fromScope:r,toScope:a})});if(!e.ok)return{ok:!1,error:await i(e)};let o=await e.json().catch(()=>null);return n(),{ok:!0,scope:a,...typeof o?.path==`string`?{path:o.path}:{}}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function C(e){try{let t=await fetch(`/api/skill`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await i(t)};let r=await t.json().catch(()=>null);return n(),{ok:!0,committed:r?.committed??!1,...typeof r?.to==`string`?{to:r.to}:{}}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function w(e,t){try{let r=`?name=${encodeURIComponent(t)}&scope=${encodeURIComponent(e)}`,a=await fetch(`/api/skill${r}`,{method:`DELETE`});if(!a.ok)return{ok:!1,error:await i(a)};let o=await a.json().catch(()=>null);return n(),{ok:!0,existed:o?.existed??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function T(e){let t=await o(`/api/skill/install`,`POST`,{scope:e.scope,name:e.name,fork:{editor:e.editor,action:e.action,...e.toName===void 0?{}:{toName:e.toName}}});return t.ok?(n(),{ok:!0}):t}async function E(e){try{let t=await fetch(`/api/skill-file`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await i(t)};let r=await t.json().catch(()=>null);return n(),{ok:!0,path:r?.path??e.path}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function D(e){try{let t=await fetch(`/api/skill-file/rename`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await i(t)};let r=await t.json().catch(()=>null);return n(),{ok:!0,from:r?.from??e.from,to:r?.to??e.to,...r?.fromDocName===void 0?{}:{fromDocName:r.fromDocName},...r?.toDocName===void 0?{}:{toDocName:r.toDocName}}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function O(e){try{let t=new URLSearchParams({scope:e.scope,name:e.name,path:e.path}),r=await fetch(`/api/skill-file?${t.toString()}`,{method:`DELETE`});if(!r.ok)return{ok:!1,error:await i(r)};let a=await r.json().catch(()=>null);return n(),{ok:!0,existed:a?.existed??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function k(e,t,n){try{let r=new URLSearchParams({name:t,scope:e,...n?{host:n}:{}}),a=await fetch(`/api/skill?${r.toString()}`);return a.ok?{ok:!0,files:(await a.json().catch(()=>null))?.skill?.files??[]}:{ok:!1,error:await i(a)}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function A(e){try{let t=new URLSearchParams({name:e.name,scope:e.scope,path:e.path,...e.host?{host:e.host}:{}}),n=await fetch(`/api/skill-file?${t.toString()}`,{signal:e.signal});if(!n.ok)return{ok:!1,status:n.status,error:await i(n)};let r=await n.json().catch(()=>null);return typeof r?.text==`string`?{ok:!0,text:r.text}:{ok:!1,status:n.status,error:`HTTP ${n.status}`}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}function j(e,t){return A({...e,signal:t}).then(e=>e.ok?{ok:!0,text:e.text}:{ok:!1,status:e.status})}async function M(e){try{let t=await fetch(`/api/skill/install`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await i(t)};let r=await t.json().catch(()=>null);return n(),{ok:!0,hosts:r?.hosts??[],scripts:r?.scripts??!1,warnings:r?.warnings??[],warningCodes:r?.warningCodes??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function N(e){try{let t=await fetch(`/api/skill/install`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({scope:e.scope,name:e.name,place:{dir:e.dir,mode:e.mode}})});if(!t.ok)return{ok:!1,error:await i(t)};let r=await t.json().catch(()=>null);return n(),{ok:!0,placedAt:r?.placedAt??e.dir}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function P(e){let t=await o(`/api/skill/install`,`POST`,{scope:e.scope,name:e.name,unplace:{path:e.path}});return t.ok?(n(),{ok:!0}):t}async function F(e){let t=await o(`/api/skill/install`,`POST`,{scope:e.scope,name:e.name,setSource:e.target});return t.ok?(n(),{ok:!0}):t}async function I(e){let t=await o(`/api/skill/install`,`POST`,{scope:e.scope,name:e.name,convert:{target:e.target,mode:e.mode}});return t.ok?(n(),{ok:!0}):t}async function L(e){try{let t=await fetch(`/api/skill-targets`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({folderAction:e})});return t.ok?{ok:!0}:{ok:!1,error:await i(t)}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function R(e){try{let t=await fetch(`/api/skill/reimport`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await i(t)};let r=await t.json().catch(()=>null);return e.dryRun||n(),{ok:!0,updated:r?.updated??!1,source:r?.source??``,localBody:r?.localBody,upstreamBody:r?.upstreamBody,...r?.gitTracked===void 0?{}:{gitTracked:r.gitTracked},warnings:r?.warnings??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function z(e){try{let t=await fetch(`/api/skill/revert`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await i(t)};let r=await t.json().catch(()=>null);return n(),{ok:!0,warnings:r?.warnings??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}export{y as A,T as C,s as D,g as E,F as O,D as S,z as T,C as _,x as a,L as b,u as c,_ as d,v as f,j as g,l as h,p as i,E as j,P as k,d as l,m,w as n,h as o,M as p,O as r,c as s,I as t,k as u,S as v,f as w,R as x,N as y};
@@ -1 +1 @@
1
- import{t as e}from"./createLucideIcon-BbftclCc.js";var t=e(`square-pen`,[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]]);export{t};
1
+ import{t as e}from"./createLucideIcon-BcLKHslE.js";var t=e(`square-pen`,[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]]);export{t};
@@ -1,2 +1,2 @@
1
- import{R as e}from"./CodeMirrorPropInput-3TWUbzXY.js";import{E as t,H as n,I as r,S as i,T as a,U as o,W as s,h as c,nt as l,rt as u,x as d}from"./config-provider-B7dMDFNr.js";import{$ as f,Dt as p,J as m,Mt as h,Q as g,St as _,X as v,kt as y}from"./dist-BlH6jxEE.js";var b=class e{constructor(e,t){this.yanchor=e,this.yhead=t}toJSON(){return{yanchor:r(this.yanchor),yhead:r(this.yhead)}}static fromJSON(t){return new e(a(t.yanchor),a(t.yhead))}},x=class{constructor(e,t){this.ytext=e,this.awareness=t,this.undoManager=new c(e)}toYPos(e,n=0){return t(this.ytext,e,n)}fromYPos(e){let t=i(a(e),this.ytext.doc);if(t==null||t.type!==this.ytext)throw Error(`[y-codemirror] The position you want to retrieve was created by a different document`);return{pos:t.index,assoc:t.assoc}}toYRange(e){let t=e.assoc;return new b(this.toYPos(e.anchor,t),this.toYPos(e.head,t))}fromYRange(e){let t=this.fromYPos(e.yanchor),n=this.fromYPos(e.yhead);return t.pos===n.pos?p.cursor(n.pos,n.assoc):p.range(t.pos,n.pos)}},S=y.define({combine(e){return e[e.length-1]}}),C=_.define(),w=class{constructor(e){this.view=e,this.conf=e.state.facet(S),this._observer=(t,n)=>{if(n.origin!==this.conf){let n=t.delta,r=[],i=0;for(let e=0;e<n.length;e++){let t=n[e];t.insert==null?t.delete==null?i+=t.retain:(r.push({from:i,to:i+t.delete,insert:``}),i+=t.delete):r.push({from:i,to:i,insert:t.insert})}e.dispatch({changes:r,annotations:[C.of(this.conf)]})}},this._ytext=this.conf.ytext,this._ytext.observe(this._observer)}update(e){if(!e.docChanged||e.transactions.length>0&&e.transactions[0].annotation(C)===this.conf)return;let t=this.conf.ytext;t.doc.transact(()=>{let n=0;e.changes.iterChanges((e,r,i,a,o)=>{let s=o.sliceString(0,o.length,`
1
+ import{L as e}from"./CodeMirrorPropInput-B__Dqs8P.js";import{E as t,H as n,I as r,S as i,T as a,U as o,W as s,h as c,nt as l,rt as u,x as d}from"./config-provider-CZ_6SNHv.js";import{$ as f,Dt as p,J as m,Mt as h,Q as g,St as _,X as v,kt as y}from"./dist-BTu6o3T-.js";var b=class e{constructor(e,t){this.yanchor=e,this.yhead=t}toJSON(){return{yanchor:r(this.yanchor),yhead:r(this.yhead)}}static fromJSON(t){return new e(a(t.yanchor),a(t.yhead))}},x=class{constructor(e,t){this.ytext=e,this.awareness=t,this.undoManager=new c(e)}toYPos(e,n=0){return t(this.ytext,e,n)}fromYPos(e){let t=i(a(e),this.ytext.doc);if(t==null||t.type!==this.ytext)throw Error(`[y-codemirror] The position you want to retrieve was created by a different document`);return{pos:t.index,assoc:t.assoc}}toYRange(e){let t=e.assoc;return new b(this.toYPos(e.anchor,t),this.toYPos(e.head,t))}fromYRange(e){let t=this.fromYPos(e.yanchor),n=this.fromYPos(e.yhead);return t.pos===n.pos?p.cursor(n.pos,n.assoc):p.range(t.pos,n.pos)}},S=y.define({combine(e){return e[e.length-1]}}),C=_.define(),w=class{constructor(e){this.view=e,this.conf=e.state.facet(S),this._observer=(t,n)=>{if(n.origin!==this.conf){let n=t.delta,r=[],i=0;for(let e=0;e<n.length;e++){let t=n[e];t.insert==null?t.delete==null?i+=t.retain:(r.push({from:i,to:i+t.delete,insert:``}),i+=t.delete):r.push({from:i,to:i,insert:t.insert})}e.dispatch({changes:r,annotations:[C.of(this.conf)]})}},this._ytext=this.conf.ytext,this._ytext.observe(this._observer)}update(e){if(!e.docChanged||e.transactions.length>0&&e.transactions[0].annotation(C)===this.conf)return;let t=this.conf.ytext;t.doc.transact(()=>{let n=0;e.changes.iterChanges((e,r,i,a,o)=>{let s=o.sliceString(0,o.length,`
2
2
  `);e!==r&&t.delete(e+n,r-e),s.length>0&&t.insert(e+n,s),n+=s.length-(r-e)})},this.conf)}destroy(){this._ytext.unobserve(this._observer)}},T=g.fromClass(w),E=v.baseTheme({".cm-ySelection":{},".cm-yLineSelection":{padding:0,margin:`0px 2px 0px 4px`},".cm-ySelectionCaret":{position:`relative`,borderLeft:`1px solid black`,borderRight:`1px solid black`,marginLeft:`-1px`,marginRight:`-1px`,boxSizing:`border-box`,display:`inline`},".cm-ySelectionCaretDot":{borderRadius:`50%`,position:`absolute`,width:`.4em`,height:`.4em`,top:`-.2em`,left:`-.2em`,backgroundColor:`inherit`,transition:`transform .3s ease-in-out`,boxSizing:`border-box`},".cm-ySelectionCaret:hover > .cm-ySelectionCaretDot":{transformOrigin:`bottom center`,transform:`scale(0)`},".cm-ySelectionInfo":{position:`absolute`,top:`-1.05em`,left:`-1px`,fontSize:`.75em`,fontFamily:`serif`,fontStyle:`normal`,fontWeight:`normal`,lineHeight:`normal`,userSelect:`none`,color:`white`,paddingLeft:`2px`,paddingRight:`2px`,zIndex:101,transition:`opacity .3s ease-in-out`,backgroundColor:`inherit`,opacity:0,transitionDelay:`0s`,whiteSpace:`nowrap`},".cm-ySelectionCaret:hover > .cm-ySelectionInfo":{opacity:1,transitionDelay:`0s`}}),D=_.define(),O=class extends f{constructor(e,t){super(),this.color=e,this.name=t}toDOM(){return n(`span`,[s(`class`,`cm-ySelectionCaret`),s(`style`,`background-color: ${this.color}; border-color: ${this.color}`)],[o(`⁠`),n(`div`,[s(`class`,`cm-ySelectionCaretDot`)]),o(`⁠`),n(`div`,[s(`class`,`cm-ySelectionInfo`)],[o(this.name)]),o(`⁠`)])}eq(e){return e.color===this.color}compare(e){return e.color===this.color}updateDOM(){return!1}get estimatedHeight(){return-1}ignoreEvent(){return!0}},k=class{constructor(e){this.conf=e.state.facet(S),this._listener=({added:t,updated:n,removed:r},i,a)=>{t.concat(n).concat(r).findIndex(e=>e!==this.conf.awareness.doc.clientID)>=0&&e.dispatch({annotations:[D.of([])]})},this._awareness=this.conf.awareness,this._awareness.on(`change`,this._listener),this.decorations=h.of([])}destroy(){this._awareness.off(`change`,this._listener)}update(e){let n=this.conf.ytext,r=n.doc,o=this.conf.awareness,s=[],c=this.conf.awareness.getLocalState();if(c!=null){let r=e.view.hasFocus&&e.view.dom.ownerDocument.hasFocus(),i=r?e.state.selection.main:null,s=c.cursor==null?null:a(c.cursor.anchor),l=c.cursor==null?null:a(c.cursor.head);if(i!=null){let e=t(n,i.anchor),r=t(n,i.head);(c.cursor==null||!d(s,e)||!d(l,r))&&o.setLocalStateField(`cursor`,{anchor:e,head:r})}else c.cursor!=null&&r&&o.setLocalStateField(`cursor`,null)}o.getStates().forEach((t,a)=>{if(a===o.doc.clientID)return;let c=t.cursor;if(c==null||c.anchor==null||c.head==null)return;let d=i(c.anchor,r),f=i(c.head,r);if(d==null||f==null||d.type!==n||f.type!==n)return;let{color:p=`#30bced`,name:h=`Anonymous`}=t.user||{},g=t.user&&t.user.colorLight||p+`33`,_=u(d.index,f.index),v=l(d.index,f.index),y=e.view.state.doc.lineAt(_),b=e.view.state.doc.lineAt(v);if(y.number===b.number)s.push({from:_,to:v,value:m.mark({attributes:{style:`background-color: ${g}`},class:`cm-ySelection`})});else{s.push({from:_,to:y.from+y.length,value:m.mark({attributes:{style:`background-color: ${g}`},class:`cm-ySelection`})}),s.push({from:b.from,to:v,value:m.mark({attributes:{style:`background-color: ${g}`},class:`cm-ySelection`})});for(let t=y.number+1;t<b.number;t++){let n=e.view.state.doc.line(t).from;s.push({from:n,to:n,value:m.line({attributes:{style:`background-color: ${g}`,class:`cm-yLineSelection`}})})}}s.push({from:f.index,to:f.index,value:m.widget({side:f.index-d.index>0?-1:1,block:!1,widget:new O(p,h)})})}),this.decorations=m.set(s,!0)}},A=g.fromClass(k,{decorations:e=>e.decorations}),j=class{constructor(e){this.undoManager=e}addTrackedOrigin(e){this.undoManager.addTrackedOrigin(e)}removeTrackedOrigin(e){this.undoManager.removeTrackedOrigin(e)}undo(){return this.undoManager.undo()!=null}redo(){return this.undoManager.redo()!=null}},M=y.define({combine(e){return e[e.length-1]}});_.define();var N=class{constructor(t){this.view=t,this.conf=t.state.facet(M),this._undoManager=this.conf.undoManager,this.syncConf=t.state.facet(S),this._beforeChangeSelection=null,this._mux=e(),this._onStackItemAdded=({stackItem:e,changedParentTypes:t})=>{t.has(this.syncConf.ytext)&&this._beforeChangeSelection&&!e.meta.has(this)&&e.meta.set(this,this._beforeChangeSelection)},this._onStackItemPopped=({stackItem:e})=>{let n=e.meta.get(this);if(n){let e=this.syncConf.fromYRange(n);t.dispatch(t.state.update({selection:e,effects:[v.scrollIntoView(e)]})),this._storeSelection()}},this._storeSelection=()=>{this._beforeChangeSelection=this.syncConf.toYRange(this.view.state.selection.main)},this._undoManager.on(`stack-item-added`,this._onStackItemAdded),this._undoManager.on(`stack-item-popped`,this._onStackItemPopped),this._undoManager.addTrackedOrigin(this.syncConf)}update(e){e.selectionSet&&(e.transactions.length===0||e.transactions[0].annotation(C)!==this.syncConf)&&this._storeSelection()}destroy(){this._undoManager.off(`stack-item-added`,this._onStackItemAdded),this._undoManager.off(`stack-item-popped`,this._onStackItemPopped),this._undoManager.removeTrackedOrigin(this.syncConf)}},P=g.fromClass(N),F=({state:e,dispatch:t})=>e.facet(M).undo()||!0,I=({state:e,dispatch:t})=>e.facet(M).redo()||!0,L=[{key:`Mod-z`,run:F,preventDefault:!0},{key:`Mod-y`,mac:`Mod-Shift-z`,run:I,preventDefault:!0},{key:`Mod-Shift-z`,run:I,preventDefault:!0}],R=(e,t,{undoManager:n=new c(e)}={})=>{let r=new x(e,t),i=[S.of(r),T];return t&&i.push(E,A),n!==!1&&i.push(M.of(new j(n)),P,v.domEventHandlers({beforeinput(e,t){return e.inputType===`historyUndo`?F(t):e.inputType===`historyRedo`?I(t):!1}})),i};export{L as n,R as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{r}from"./dist-Nvb76hAm.js";import{t as i}from"./compiler-runtime-BfE3aGVn.js";import{t as a}from"./utils-CPqDy6Hr.js";import{i as o,n as ee,t as te}from"./tooltip-x7BNUa3s.js";import{Dr as ne}from"./dist-PVtTd_Sj2.js";import{t as re}from"./x-COTyTduF.js";import{t as ie}from"./badge-B89o8Vy9.js";var s=i(),c=e(n(),1),l=t();function u(e){let t=(0,s.c)(96),{value:n,onChange:i,onBlur:u,placeholder:d,id:f,disabled:p,grammar:ae,entryProblems:m,"aria-describedby":oe,"aria-invalid":se,ref:h}=e,ce=ae===void 0?`frontmatter-tag`:ae,{_:g}=r(),[_,le]=(0,c.useState)(``),[v,ue]=(0,c.useState)(null),[y,b]=(0,c.useState)(null),de=(0,c.useRef)(null),x;t[0]===h?x=t[1]:(x=e=>{de.current=e,typeof h==`function`?h(e):h&&(h.current=e)},t[0]=h,t[1]=x);let fe=x,[S,C]=(0,c.useState)(!1),pe=(0,c.useId)(),w=`${f??pe}-grammar-hint`,T=`${f??pe}-pill`,E;t[2]!==g||t[3]!==d?(E=d??g({id:`M5mfAe`}),t[2]=g,t[3]=d,t[4]=E):E=t[4];let me=E,D=ce===`frontmatter-tag`,O;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(O=()=>{le(``),C(!1),ue(null)},t[5]=O):O=t[5];let k=O,A;t[6]!==v||t[7]!==i||t[8]!==D||t[9]!==n?(A=e=>{let t=e.trim(),r=v===null?-1:n.indexOf(v);if(!t)return r!==-1&&i(n.filter((e,t)=>t!==r)),v!==null&&k(),!0;if(D&&!ne(t))return C(!0),!1;let a=D&&t.startsWith(`#`)?t.slice(1):t,o=n.indexOf(a);if(r===-1)return o===-1&&i([...n,a]),k(),!0;let ee=n.map((e,t)=>t===r?a:e);return i(o===-1||o===r?ee:ee.filter((e,t)=>t!==r)),k(),!0},t[6]=v,t[7]=i,t[8]=D,t[9]=n,t[10]=A):A=t[10];let j=A,M;t[11]!==i||t[12]!==n?(M=e=>{i(n.filter((t,n)=>n!==e))},t[11]=i,t[12]=n,t[13]=M):M=t[13];let N=M,P;t[14]!==j||t[15]!==p||t[16]!==_?(P=e=>{p||(_.trim()!==``&&j(_),le(e),C(!1),b(null),ue(e))},t[14]=j,t[15]=p,t[16]=_,t[17]=P):P=t[17];let F=P,I;t[18]!==y||t[19]!==n?(I=y===null?-1:n.indexOf(y),t[18]=y,t[19]=n,t[20]=I):I=t[20];let L=I,R;t[21]===n?R=t[22]:(R=e=>{b(e===null?null:n[e]??null)},t[21]=n,t[22]=R);let z=R,B,V;t[23]===v?(B=t[24],V=t[25]):(B=()=>{v!==null&&(de.current?.focus(),de.current?.select())},V=[v],t[23]=v,t[24]=B,t[25]=V),(0,c.useEffect)(B,V);let H=S?`true`:se,he=p&&`pointer-events-none opacity-60`,U;t[26]===he?U=t[27]:(U=a(`flex min-h-8 w-full flex-wrap items-center gap-1.5 rounded-lg border border-input bg-transparent px-2 py-1 text-sm transition-colors`,`focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50`,`aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20`,`dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,he),t[26]=he,t[27]=U);let W;if(t[28]!==g||t[29]!==F||t[30]!==p||t[31]!==v||t[32]!==m||t[33]!==y||t[34]!==T||t[35]!==N||t[36]!==D||t[37]!==n){let e;t[39]!==g||t[40]!==F||t[41]!==p||t[42]!==v||t[43]!==m||t[44]!==y||t[45]!==T||t[46]!==N||t[47]!==D?(e=(e,t)=>{if(e===v)return null;let n=D&&!ne(e),r=m?.get(e),i=n||r!==void 0,s=r??(n?`Tags must start with a letter or digit and contain only letters, digits, underscores, dashes, and slashes.`:void 0),c=e===y,u=(0,l.jsxs)(ie,{id:`${T}-${t}`,variant:i?`destructive`:`secondary`,"data-tag-invalid":n?`true`:void 0,"data-tag-problem":r===void 0?void 0:`true`,"data-highlighted":c?`true`:void 0,className:a(`gap-1 pl-2 pr-1 normal-case`,i&&`ring-1 ring-destructive/40`,c&&`ring-2 ring-ring/70`),children:[(0,l.jsx)(`button`,{type:`button`,tabIndex:-1,className:`cursor-pointer rounded-sm font-mono`,onDoubleClick:()=>F(e),disabled:p,"aria-label":g({id:`NkNfSr`,values:{tag:e}}),title:s===void 0?g({id:`vHlhDc`}):void 0,children:e}),(0,l.jsx)(`button`,{type:`button`,onClick:()=>N(t),"aria-label":g({id:`D4H2N6`,values:{tag:e}}),className:`rounded-sm p-0.5 hover:bg-background/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,disabled:p,children:(0,l.jsx)(re,{className:`size-3`,"aria-hidden":`true`})})]},e);return s===void 0?u:(0,l.jsxs)(te,{children:[(0,l.jsx)(o,{asChild:!0,children:u}),(0,l.jsx)(ee,{children:s})]},e)},t[39]=g,t[40]=F,t[41]=p,t[42]=v,t[43]=m,t[44]=y,t[45]=T,t[46]=N,t[47]=D,t[48]=e):e=t[48],W=n.map(e),t[28]=g,t[29]=F,t[30]=p,t[31]=v,t[32]=m,t[33]=y,t[34]=T,t[35]=N,t[36]=D,t[37]=n,t[38]=W}else W=t[38];let G;t[49]!==S||t[50]!==y?(G=e=>{le(e.target.value),S&&C(!1),y!==null&&b(null)},t[49]=S,t[50]=y,t[51]=G):G=t[51];let K;t[52]!==j||t[53]!==F||t[54]!==_||t[55]!==S||t[56]!==v||t[57]!==z||t[58]!==L||t[59]!==N||t[60]!==n?(K=e=>{let t=e.currentTarget,r=t.selectionStart===0&&t.selectionEnd===0;if(v===null&&n.length>0){if(e.key===`ArrowLeft`&&(L!==-1||r)){e.preventDefault(),z(L===-1?n.length-1:Math.max(0,L-1));return}if(e.key===`ArrowRight`&&L!==-1){e.preventDefault(),z(L===n.length-1?null:L+1);return}if((e.key===`Home`||e.key===`End`)&&L!==-1){e.preventDefault(),z(e.key===`Home`?0:n.length-1);return}}if(L!==-1&&v===null){if(e.key===`Enter`||e.key===` `){e.preventDefault();let t=n[L];t!==void 0&&F(t);return}if(e.key===`Backspace`||e.key===`Delete`){e.preventDefault();let t=n[L-1]??null,r=n[L+1]??null;N(L),b(e.key===`Backspace`?t??r:r??t);return}}e.key===`Enter`?(_.trim()||v!==null)&&(e.preventDefault(),j(_)):e.key===`,`?(e.preventDefault(),_.trim()&&j(_)):e.key===`Tab`?_.trim()&&(e.preventDefault(),j(_)):e.key===`Backspace`&&_===``&&n.length>0&&v===null?(e.preventDefault(),N(n.length-1)):e.key===`Escape`&&(v!==null||S?(e.preventDefault(),k(),b(null)):L!==-1&&(e.preventDefault(),b(null)))},t[52]=j,t[53]=F,t[54]=_,t[55]=S,t[56]=v,t[57]=z,t[58]=L,t[59]=N,t[60]=n,t[61]=K):K=t[61];let q;t[62]!==j||t[63]!==_||t[64]!==v||t[65]!==u?(q=()=>{(_.trim()||v!==null)&&!j(_)&&v!==null&&k(),b(null),u?.()},t[62]=j,t[63]=_,t[64]=v,t[65]=u,t[66]=q):q=t[66];let ge=n.length===0?me:``,_e=S?`true`:void 0,J;t[67]!==oe||t[68]!==S||t[69]!==w?(J=[S?w:void 0,oe].filter(Boolean).join(` `)||void 0,t[67]=oe,t[68]=S,t[69]=w,t[70]=J):J=t[70];let ve=S?`true`:se,ye=L===-1?void 0:`${T}-${L}`,Y=S&&`text-destructive placeholder:text-destructive/60`,X;t[71]===Y?X=t[72]:(X=a(`min-w-[8ch] flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed`,Y),t[71]=Y,t[72]=X);let Z;t[73]!==fe||t[74]!==p||t[75]!==_||t[76]!==f||t[77]!==G||t[78]!==K||t[79]!==q||t[80]!==ge||t[81]!==_e||t[82]!==J||t[83]!==ve||t[84]!==ye||t[85]!==X?(Z=(0,l.jsx)(`input`,{id:f,ref:fe,type:`text`,value:_,onChange:G,onKeyDown:K,onBlur:q,placeholder:ge,"data-tag-invalid":_e,"aria-describedby":J,"aria-invalid":ve,"aria-activedescendant":ye,disabled:p,className:X}),t[73]=fe,t[74]=p,t[75]=_,t[76]=f,t[77]=G,t[78]=K,t[79]=q,t[80]=ge,t[81]=_e,t[82]=J,t[83]=ve,t[84]=ye,t[85]=X,t[86]=Z):Z=t[86];let Q;t[87]!==S||t[88]!==w?(Q=S&&(0,l.jsx)(`span`,{id:w,role:`alert`,"data-testid":`tag-pill-input-error`,className:`w-full px-1 pt-0.5 text-xs text-destructive`,children:`Tags must start with a letter or digit and contain only letters, digits, underscores, dashes, and slashes.`}),t[87]=S,t[88]=w,t[89]=Q):Q=t[89];let $;return t[90]!==H||t[91]!==U||t[92]!==W||t[93]!==Z||t[94]!==Q?($=(0,l.jsxs)(`div`,{"data-slot":`tag-pill-input`,"aria-invalid":H,className:U,children:[W,Z,Q]}),t[90]=H,t[91]=U,t[92]=W,t[93]=Z,t[94]=Q,t[95]=$):$=t[95],$}export{u as t};
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{r}from"./dist-Nvb76hAm.js";import{t as i}from"./compiler-runtime-BfE3aGVn.js";import{t as a}from"./utils-CPqDy6Hr.js";import{i as o,n as ee,t as te}from"./tooltip-x7BNUa3s.js";import{Dr as ne}from"./dist-TVrIGknK2.js";import{t as re}from"./x-D8xzRaMT.js";import{t as ie}from"./badge-CY_v_nGy.js";var s=i(),c=e(n(),1),l=t();function u(e){let t=(0,s.c)(96),{value:n,onChange:i,onBlur:u,placeholder:d,id:f,disabled:p,grammar:ae,entryProblems:m,"aria-describedby":oe,"aria-invalid":se,ref:h}=e,ce=ae===void 0?`frontmatter-tag`:ae,{_:g}=r(),[_,le]=(0,c.useState)(``),[v,ue]=(0,c.useState)(null),[y,b]=(0,c.useState)(null),de=(0,c.useRef)(null),x;t[0]===h?x=t[1]:(x=e=>{de.current=e,typeof h==`function`?h(e):h&&(h.current=e)},t[0]=h,t[1]=x);let fe=x,[S,C]=(0,c.useState)(!1),pe=(0,c.useId)(),w=`${f??pe}-grammar-hint`,T=`${f??pe}-pill`,E;t[2]!==g||t[3]!==d?(E=d??g({id:`M5mfAe`}),t[2]=g,t[3]=d,t[4]=E):E=t[4];let me=E,D=ce===`frontmatter-tag`,O;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(O=()=>{le(``),C(!1),ue(null)},t[5]=O):O=t[5];let k=O,A;t[6]!==v||t[7]!==i||t[8]!==D||t[9]!==n?(A=e=>{let t=e.trim(),r=v===null?-1:n.indexOf(v);if(!t)return r!==-1&&i(n.filter((e,t)=>t!==r)),v!==null&&k(),!0;if(D&&!ne(t))return C(!0),!1;let a=D&&t.startsWith(`#`)?t.slice(1):t,o=n.indexOf(a);if(r===-1)return o===-1&&i([...n,a]),k(),!0;let ee=n.map((e,t)=>t===r?a:e);return i(o===-1||o===r?ee:ee.filter((e,t)=>t!==r)),k(),!0},t[6]=v,t[7]=i,t[8]=D,t[9]=n,t[10]=A):A=t[10];let j=A,M;t[11]!==i||t[12]!==n?(M=e=>{i(n.filter((t,n)=>n!==e))},t[11]=i,t[12]=n,t[13]=M):M=t[13];let N=M,P;t[14]!==j||t[15]!==p||t[16]!==_?(P=e=>{p||(_.trim()!==``&&j(_),le(e),C(!1),b(null),ue(e))},t[14]=j,t[15]=p,t[16]=_,t[17]=P):P=t[17];let F=P,I;t[18]!==y||t[19]!==n?(I=y===null?-1:n.indexOf(y),t[18]=y,t[19]=n,t[20]=I):I=t[20];let L=I,R;t[21]===n?R=t[22]:(R=e=>{b(e===null?null:n[e]??null)},t[21]=n,t[22]=R);let z=R,B,V;t[23]===v?(B=t[24],V=t[25]):(B=()=>{v!==null&&(de.current?.focus(),de.current?.select())},V=[v],t[23]=v,t[24]=B,t[25]=V),(0,c.useEffect)(B,V);let H=S?`true`:se,he=p&&`pointer-events-none opacity-60`,U;t[26]===he?U=t[27]:(U=a(`flex min-h-8 w-full flex-wrap items-center gap-1.5 rounded-lg border border-input bg-transparent px-2 py-1 text-sm transition-colors`,`focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50`,`aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20`,`dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,he),t[26]=he,t[27]=U);let W;if(t[28]!==g||t[29]!==F||t[30]!==p||t[31]!==v||t[32]!==m||t[33]!==y||t[34]!==T||t[35]!==N||t[36]!==D||t[37]!==n){let e;t[39]!==g||t[40]!==F||t[41]!==p||t[42]!==v||t[43]!==m||t[44]!==y||t[45]!==T||t[46]!==N||t[47]!==D?(e=(e,t)=>{if(e===v)return null;let n=D&&!ne(e),r=m?.get(e),i=n||r!==void 0,s=r??(n?`Tags must start with a letter or digit and contain only letters, digits, underscores, dashes, and slashes.`:void 0),c=e===y,u=(0,l.jsxs)(ie,{id:`${T}-${t}`,variant:i?`destructive`:`secondary`,"data-tag-invalid":n?`true`:void 0,"data-tag-problem":r===void 0?void 0:`true`,"data-highlighted":c?`true`:void 0,className:a(`gap-1 pl-2 pr-1 normal-case`,i&&`ring-1 ring-destructive/40`,c&&`ring-2 ring-ring/70`),children:[(0,l.jsx)(`button`,{type:`button`,tabIndex:-1,className:`cursor-pointer rounded-sm font-mono`,onDoubleClick:()=>F(e),disabled:p,"aria-label":g({id:`NkNfSr`,values:{tag:e}}),title:s===void 0?g({id:`vHlhDc`}):void 0,children:e}),(0,l.jsx)(`button`,{type:`button`,onClick:()=>N(t),"aria-label":g({id:`D4H2N6`,values:{tag:e}}),className:`rounded-sm p-0.5 hover:bg-background/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,disabled:p,children:(0,l.jsx)(re,{className:`size-3`,"aria-hidden":`true`})})]},e);return s===void 0?u:(0,l.jsxs)(te,{children:[(0,l.jsx)(o,{asChild:!0,children:u}),(0,l.jsx)(ee,{children:s})]},e)},t[39]=g,t[40]=F,t[41]=p,t[42]=v,t[43]=m,t[44]=y,t[45]=T,t[46]=N,t[47]=D,t[48]=e):e=t[48],W=n.map(e),t[28]=g,t[29]=F,t[30]=p,t[31]=v,t[32]=m,t[33]=y,t[34]=T,t[35]=N,t[36]=D,t[37]=n,t[38]=W}else W=t[38];let G;t[49]!==S||t[50]!==y?(G=e=>{le(e.target.value),S&&C(!1),y!==null&&b(null)},t[49]=S,t[50]=y,t[51]=G):G=t[51];let K;t[52]!==j||t[53]!==F||t[54]!==_||t[55]!==S||t[56]!==v||t[57]!==z||t[58]!==L||t[59]!==N||t[60]!==n?(K=e=>{let t=e.currentTarget,r=t.selectionStart===0&&t.selectionEnd===0;if(v===null&&n.length>0){if(e.key===`ArrowLeft`&&(L!==-1||r)){e.preventDefault(),z(L===-1?n.length-1:Math.max(0,L-1));return}if(e.key===`ArrowRight`&&L!==-1){e.preventDefault(),z(L===n.length-1?null:L+1);return}if((e.key===`Home`||e.key===`End`)&&L!==-1){e.preventDefault(),z(e.key===`Home`?0:n.length-1);return}}if(L!==-1&&v===null){if(e.key===`Enter`||e.key===` `){e.preventDefault();let t=n[L];t!==void 0&&F(t);return}if(e.key===`Backspace`||e.key===`Delete`){e.preventDefault();let t=n[L-1]??null,r=n[L+1]??null;N(L),b(e.key===`Backspace`?t??r:r??t);return}}e.key===`Enter`?(_.trim()||v!==null)&&(e.preventDefault(),j(_)):e.key===`,`?(e.preventDefault(),_.trim()&&j(_)):e.key===`Tab`?_.trim()&&(e.preventDefault(),j(_)):e.key===`Backspace`&&_===``&&n.length>0&&v===null?(e.preventDefault(),N(n.length-1)):e.key===`Escape`&&(v!==null||S?(e.preventDefault(),k(),b(null)):L!==-1&&(e.preventDefault(),b(null)))},t[52]=j,t[53]=F,t[54]=_,t[55]=S,t[56]=v,t[57]=z,t[58]=L,t[59]=N,t[60]=n,t[61]=K):K=t[61];let q;t[62]!==j||t[63]!==_||t[64]!==v||t[65]!==u?(q=()=>{(_.trim()||v!==null)&&!j(_)&&v!==null&&k(),b(null),u?.()},t[62]=j,t[63]=_,t[64]=v,t[65]=u,t[66]=q):q=t[66];let ge=n.length===0?me:``,_e=S?`true`:void 0,J;t[67]!==oe||t[68]!==S||t[69]!==w?(J=[S?w:void 0,oe].filter(Boolean).join(` `)||void 0,t[67]=oe,t[68]=S,t[69]=w,t[70]=J):J=t[70];let ve=S?`true`:se,ye=L===-1?void 0:`${T}-${L}`,Y=S&&`text-destructive placeholder:text-destructive/60`,X;t[71]===Y?X=t[72]:(X=a(`min-w-[8ch] flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed`,Y),t[71]=Y,t[72]=X);let Z;t[73]!==fe||t[74]!==p||t[75]!==_||t[76]!==f||t[77]!==G||t[78]!==K||t[79]!==q||t[80]!==ge||t[81]!==_e||t[82]!==J||t[83]!==ve||t[84]!==ye||t[85]!==X?(Z=(0,l.jsx)(`input`,{id:f,ref:fe,type:`text`,value:_,onChange:G,onKeyDown:K,onBlur:q,placeholder:ge,"data-tag-invalid":_e,"aria-describedby":J,"aria-invalid":ve,"aria-activedescendant":ye,disabled:p,className:X}),t[73]=fe,t[74]=p,t[75]=_,t[76]=f,t[77]=G,t[78]=K,t[79]=q,t[80]=ge,t[81]=_e,t[82]=J,t[83]=ve,t[84]=ye,t[85]=X,t[86]=Z):Z=t[86];let Q;t[87]!==S||t[88]!==w?(Q=S&&(0,l.jsx)(`span`,{id:w,role:`alert`,"data-testid":`tag-pill-input-error`,className:`w-full px-1 pt-0.5 text-xs text-destructive`,children:`Tags must start with a letter or digit and contain only letters, digits, underscores, dashes, and slashes.`}),t[87]=S,t[88]=w,t[89]=Q):Q=t[89];let $;return t[90]!==H||t[91]!==U||t[92]!==W||t[93]!==Z||t[94]!==Q?($=(0,l.jsxs)(`div`,{"data-slot":`tag-pill-input`,"aria-invalid":H,className:U,children:[W,Z,Q]}),t[90]=H,t[91]=U,t[92]=W,t[93]=Z,t[94]=Q,t[95]=$):$=t[95],$}export{u as t};
@@ -1 +1 @@
1
- import{m as e}from"./doc-paths-CH8QyanF.js";import{s as t}from"./navigation-targets-DKe7BSku.js";function n(e){switch(e.kind){case`doc`:case`large-file`:return`doc`;case`skill-file`:return`doc`;case`folder`:case`folder-index`:return`folder`;case`missing`:case`asset`:return`missing`}}function r(r,i){let a=t(r,i);return{resolvedTarget:a,hashDocName:a.target,hash:a.kind===`skill-file`?e({scope:a.scope,name:a.name,path:a.path,...a.host?{host:a.host}:{}}):null,displayState:n(a)}}export{r as t};
1
+ import{m as e}from"./doc-paths-BKAhPn1c.js";import{s as t}from"./navigation-targets-BhdJAW-R.js";function n(e){switch(e.kind){case`doc`:case`large-file`:return`doc`;case`skill-file`:return`doc`;case`folder`:case`folder-index`:return`folder`;case`missing`:case`asset`:return`missing`}}function r(r,i){let a=t(r,i);return{resolvedTarget:a,hashDocName:a.target,hash:a.kind===`skill-file`?e({scope:a.scope,name:a.name,path:a.path,...a.host?{host:a.host}:{}}):null,displayState:n(a)}}export{r as t};