@inkeep/open-knowledge 0.53.1 → 0.53.2

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 (225) hide show
  1. package/dist/{acp-harness-probe-CwhklR1t.mjs → acp-harness-probe-BnGJfP5G.mjs} +2 -2
  2. package/dist/assets/skills/project/references/linking.md +1 -1
  3. package/dist/cli.mjs +62 -62
  4. package/dist/constants-CibuukV7.mjs +2 -0
  5. package/dist/git-handle-CEoe8TIl.mjs +1 -0
  6. package/dist/{git-handle-CH1DpBYP.mjs → git-handle-VuHcNtS4.mjs} +2 -2
  7. package/dist/index.mjs +173 -173
  8. package/dist/{init-DryQvpzo.mjs → init-BbAtilzZ.mjs} +4 -4
  9. package/dist/init-OoQjBgC9.mjs +1 -0
  10. package/dist/{launch-json-removal-C04K7xd0.mjs → launch-json-removal-DfpCmQT9.mjs} +2 -2
  11. package/dist/{loader-DAyo63Sq.mjs → loader-BOUyv05v.mjs} +2 -2
  12. package/dist/loader-P0nrGvJv.mjs +1 -0
  13. package/dist/md-manager-45eVlaBq.mjs +2 -0
  14. package/dist/{open-browser-DF0vEOcg.mjs → open-browser-BA50pLLQ.mjs} +2 -2
  15. package/dist/parse-worker.mjs +1 -1
  16. package/dist/preview-D2AT6aBO.mjs +1 -0
  17. package/dist/{preview-Dvl3K5Z6.mjs → preview-DoBitDZ-.mjs} +2 -2
  18. package/dist/public/assets/{ActivityModeContent-rgEhhGgw.js → ActivityModeContent-BmQRzJZw.js} +1 -1
  19. package/dist/public/assets/{AgentDiffPane-DtG18o1u.js → AgentDiffPane-DCXp5E1P.js} +1 -1
  20. package/dist/public/assets/{AgentThreadClientBinder-DkD2M_dd.js → AgentThreadClientBinder-B7pwGsKU.js} +1 -1
  21. package/dist/public/assets/{BugReportHistory-C59fSH13.js → BugReportHistory-CDRTpJV0.js} +1 -1
  22. package/dist/public/assets/{BugReportHistoryDialog-C2b4xA3d.js → BugReportHistoryDialog--YdGm_GJ.js} +1 -1
  23. package/dist/public/assets/{ChangedOutsideBadge-DdpCQcxq.js → ChangedOutsideBadge-J6l1plFR.js} +1 -1
  24. package/dist/public/assets/CodeMirrorPropInput-DiDkBTg6.js +3 -0
  25. package/dist/public/assets/{ConfigSharingInfoTooltip-4T5uhyyt.js → ConfigSharingInfoTooltip-CuqrTakc.js} +1 -1
  26. package/dist/public/assets/{ConsentDialogBody-DfhGpXdb.js → ConsentDialogBody-CmMu4IpT.js} +1 -1
  27. package/dist/public/assets/{DiffView-C-imhjB8.js → DiffView-BcZip7m3.js} +1 -1
  28. package/dist/public/assets/DocumentContext-J495RUh0.js +38 -0
  29. package/dist/public/assets/{EditorModeToggle-CrnEz11k.js → EditorModeToggle-BsFjeEn4.js} +1 -1
  30. package/dist/public/assets/{EnableSyncConfirmDialog-623sSYbd.js → EnableSyncConfirmDialog-DNDI39lu.js} +1 -1
  31. package/dist/public/assets/FeedbackForm-BwQovorQ.js +1 -0
  32. package/dist/public/assets/{GraphPanel-C-3KrSdC.js → GraphPanel-CsRKre3D.js} +1 -1
  33. package/dist/public/assets/{ImportSkillDialog-B7gKx_GY.js → ImportSkillDialog-DNZi7-O6.js} +1 -1
  34. package/dist/public/assets/{LintConfigEditor-B-XaVu0m.js → LintConfigEditor-nq2Ekm-O.js} +1 -1
  35. package/dist/public/assets/{ManagedArtifactProperties-iclZPRJv.js → ManagedArtifactProperties-CeSsPfJA.js} +1 -1
  36. package/dist/public/assets/ManagedArtifactProperties-D5Q8gGkr.js +1 -0
  37. package/dist/public/assets/{McpConsentDialogBody-BS3RE3LY.js → McpConsentDialogBody-DEhSeOSg.js} +1 -1
  38. package/dist/public/assets/{Mermaid-BHfANkja.js → Mermaid-mUyEEsA0.js} +1 -1
  39. package/dist/public/assets/{MermaidDocEditor-CI90q10w.js → MermaidDocEditor-DceTAjtX.js} +1 -1
  40. package/dist/public/assets/{RegisteredAgentIcon-gjOJZp_B.js → RegisteredAgentIcon-BxpJAHOj.js} +1 -1
  41. package/dist/public/assets/{ReportBugDialogBody-BWXO0gto.js → ReportBugDialogBody-DO7eotFd.js} +1 -1
  42. package/dist/public/assets/{SchemaConfigEditor-eh-ijdLu.js → SchemaConfigEditor-D23bGRYq.js} +1 -1
  43. package/dist/public/assets/{SessionsHost-BOgQOcv6.js → SessionsHost-BD8Io20F.js} +2 -2
  44. package/dist/public/assets/SettingsDialogBody-D_2SfOcL.js +12 -0
  45. package/dist/public/assets/{ShareBranchSwitchDialog-DpmQmmrq.js → ShareBranchSwitchDialog-B7Bl6qR0.js} +1 -1
  46. package/dist/public/assets/{ShareReceiveDialog-C3fS1Ax2.js → ShareReceiveDialog-BmMkjWTr.js} +1 -1
  47. package/dist/public/assets/{ShareReceiveMissDialog-DzeOwnyS.js → ShareReceiveMissDialog-BDYU64bD.js} +1 -1
  48. package/dist/public/assets/{SkillEditBanner-DGB_nnDm.js → SkillEditBanner-B2U7UdOB.js} +1 -1
  49. package/dist/public/assets/{SkillOriginInline-C4x3nMIH.js → SkillOriginInline-B3wOLT3t.js} +1 -1
  50. package/dist/public/assets/{SkillToolbarControls-DXBGIWug.js → SkillToolbarControls-BP8iught.js} +1 -1
  51. package/dist/public/assets/{SlidesToolbarControls-Buv-SEot.js → SlidesToolbarControls-56-P71vE.js} +1 -1
  52. package/dist/public/assets/{SourceEditor-B64VJl_F.js → SourceEditor-8vj7fGo1.js} +1 -1
  53. package/dist/public/assets/{TerminalPanel-Bch10p1r.js → TerminalPanel-Clr6j-jo.js} +3 -3
  54. package/dist/public/assets/{TerminalWindowApp-s4mNyUki.js → TerminalWindowApp-Bzu1XJoP.js} +1 -1
  55. package/dist/public/assets/{TextDocEditor-DtDvo7eF.js → TextDocEditor-Kaj3NBL9.js} +1 -1
  56. package/dist/public/assets/{ThreadView-CGOz1ms_.js → ThreadView-C0oxDyxf.js} +1 -1
  57. package/dist/public/assets/{TimelineDiffPane-B7aD7QN-.js → TimelineDiffPane-CG6Z1uma.js} +1 -1
  58. package/dist/public/assets/{agent-diff-store-BJiYj2BI.js → agent-diff-store-DxMs0J9Y.js} +1 -1
  59. package/dist/public/assets/{auth-state-cache-5wocICj2.js → auth-state-cache-CGY7eNch.js} +3 -3
  60. package/dist/public/assets/{checkbox-vidgONxv.js → checkbox-Bxl4H4lV.js} +1 -1
  61. package/dist/public/assets/client-version-BenFW72U.js +1 -0
  62. package/dist/public/assets/{cm-theme-DZT10ikr.js → cm-theme-BygK2tYf.js} +1 -1
  63. package/dist/public/assets/comment-chips-Q0_SZK9C.js +5 -0
  64. package/dist/public/assets/{config-provider-DGQwNZtP.js → config-provider-B6fsarOv.js} +3 -3
  65. package/dist/public/assets/{dialog-DztIj-ZS.js → dialog-R8GugqUq.js} +1 -1
  66. package/dist/public/assets/{dist-BgBcg3TP.js → dist-BE8rPie-.js} +1 -1
  67. package/dist/public/assets/{dist-CkFATl39.js → dist-BR5M-SiF.js} +1 -1
  68. package/dist/public/assets/{dist-DfLFtHzK.js → dist-BTo1AB3U.js} +1 -1
  69. package/dist/public/assets/{dist-BRmJz2fY.js → dist-BZW14CKf.js} +1 -1
  70. package/dist/public/assets/{dist-z-y_5Bgj.js → dist-CElLQlwI.js} +1 -1
  71. package/dist/public/assets/{dist-DsH7eETa.js → dist-CUhsr-gg.js} +1 -1
  72. package/dist/public/assets/{dist-dO0W-CVt.js → dist-CcIAtWVJ.js} +1 -1
  73. package/dist/public/assets/{dist-DM6osNK2.js → dist-Cfmj7R4I.js} +1 -1
  74. package/dist/public/assets/{dist-ofeGnIBD.js → dist-D7MIhDGJ.js} +1 -1
  75. package/dist/public/assets/{dist-DQyQPRvE.js → dist-DBhufbLS.js} +1 -1
  76. package/dist/public/assets/{dist-BVpMlVG3.js → dist-DRufJFR7.js} +1 -1
  77. package/dist/public/assets/{dist-BiwzWInZ.js → dist-Dm-VLxvd.js} +1 -1
  78. package/dist/public/assets/{dist-GenOktAv.js → dist-ILlrHFKs.js} +183 -183
  79. package/dist/public/assets/{doc-paths-CB3USVY1.js → doc-paths-DAh95jxf.js} +1 -1
  80. package/dist/public/assets/{documents-events-rgFBXE2Z.js → documents-events-CCW6R-r2.js} +1 -1
  81. package/dist/public/assets/{file-tree-adapter-4JTjxhHS.js → file-tree-adapter-Bf1ZqkPA.js} +1 -1
  82. package/dist/public/assets/{file-tree-utils-CYn1f82_.js → file-tree-utils-CgJ4lrP9.js} +1 -1
  83. package/dist/public/assets/{folder-config-api-ByqyyP9w.js → folder-config-api-CKV5STj1.js} +1 -1
  84. package/dist/public/assets/follow-file-D4LD9UAw.js +4 -0
  85. package/dist/public/assets/i18n-C3d0M4ue.js +1 -0
  86. package/dist/public/assets/{index-DmXrGqKD.js → index-Du6HTehY.js} +17 -17
  87. package/dist/public/assets/{input-group-BiaQ-rIw.js → input-group-ClrIuhWi.js} +1 -1
  88. package/dist/public/assets/{lint-config-client-DydgEnDK.js → lint-config-client-xawAT1mQ.js} +1 -1
  89. package/dist/public/assets/lint-plugin-meta-CsGPauME.js +1 -0
  90. package/dist/public/assets/{markdownlint-rule-browser-DwEGxp2H.js → markdownlint-rule-browser-B3UPVPG_.js} +1 -1
  91. package/dist/public/assets/messages-B6wDP6_L.js +1 -0
  92. package/dist/public/assets/messages-BS6hWxWK.js +1 -0
  93. package/dist/public/assets/messages-Bg44_w_B.js +1 -0
  94. package/dist/public/assets/messages-D9hQcSkC.js +1 -0
  95. package/dist/public/assets/messages-DAPhT0w6.js +1 -0
  96. package/dist/public/assets/messages-DaVac3jo.js +1 -0
  97. package/dist/public/assets/messages-Dbqu7ts9.js +1 -0
  98. package/dist/public/assets/messages-DdoJCt_r.js +1 -0
  99. package/dist/public/assets/messages-Djc_MIS0.js +1 -0
  100. package/dist/public/assets/messages-DmHqd1yQ.js +1 -0
  101. package/dist/public/assets/messages-xKq8BSm6.js +1 -0
  102. package/dist/public/assets/navigation-targets-C1boWExT.js +1 -0
  103. package/dist/public/assets/{open-managed-artifact-tab-DpfEVLG-.js → open-managed-artifact-tab-G7xdjHph.js} +1 -1
  104. package/dist/public/assets/{pending-receive-nav-store-BHeTqy0Z.js → pending-receive-nav-store-BZigj_ik.js} +1 -1
  105. package/dist/public/assets/{project-paths-_w2mRvRX.js → project-paths-DOOtPmjl.js} +1 -1
  106. package/dist/public/assets/prop-types-BIrEWnOv.js +1 -0
  107. package/dist/public/assets/{receive-store-R5sEQn80.js → receive-store-BrOspwat.js} +1 -1
  108. package/dist/public/assets/{schema-fields-view-intent-DiE8NL9y.js → schema-fields-view-intent-D0jz38_6.js} +1 -1
  109. package/dist/public/assets/{selection-context-CHJ-gfRx.js → selection-context-PgPm0oHr.js} +1 -1
  110. package/dist/public/assets/{skill-actions-B9BGbzJZ.js → skill-actions-Btw-8DsB.js} +2 -2
  111. package/dist/public/assets/{skill-scope-CFwClOyk.js → skill-scope-8PP6d5Gw.js} +1 -1
  112. package/dist/public/assets/{skills-api-B41p5sp3.js → skills-api-DQ0PK-8O.js} +1 -1
  113. package/dist/public/assets/{src-gXOrH5MP.js → src-DoCu_Oe2.js} +1 -1
  114. package/dist/public/assets/{tag-pill-input-BTKlFD92.js → tag-pill-input-BHj2SAnj.js} +1 -1
  115. package/dist/public/assets/{target-navigation-intent-CIjVZTkZ.js → target-navigation-intent-DpIU3fe6.js} +1 -1
  116. package/dist/public/assets/{telemetry-startup-C8JOSRcr.js → telemetry-startup-htUA83Zn.js} +1 -1
  117. package/dist/public/assets/{terminal-cli-display-CW7j5kqb.js → terminal-cli-display-CgJpdKCI.js} +1 -1
  118. package/dist/public/assets/{terminal-launch-events-CW7Dk9L6.js → terminal-launch-events-DQ0KtteM.js} +1 -1
  119. package/dist/public/assets/{terminal-telemetry-CxkpCpp5.js → terminal-telemetry-CE1yzjKD.js} +1 -1
  120. package/dist/public/assets/{text-viewer-languages-oVDGEYYY.js → text-viewer-languages-epnUVwhY.js} +2 -2
  121. package/dist/public/assets/{typing-burst-detector-fIHJv2J1.js → typing-burst-detector-XmZhxL72.js} +4 -4
  122. package/dist/public/assets/{uninstall-CYpAgTNE.js → uninstall-CDJGY7Qx.js} +1 -1
  123. package/dist/public/assets/{use-activity-panel-BEnqyFcJ.js → use-activity-panel-DeQ1S88x.js} +1 -1
  124. package/dist/public/assets/{use-apply-config-color-theme-Dw8J4H8Z.js → use-apply-config-color-theme-BatIDUX7.js} +1 -1
  125. package/dist/public/assets/{use-collab-url-CbdhvhFJ.js → use-collab-url-7XE2_0_k.js} +1 -1
  126. package/dist/public/assets/{use-live-xterm-theme-B_qB957b.js → use-live-xterm-theme-DS89T4Os.js} +1 -1
  127. package/dist/public/assets/{use-open-skill-Ca4D1I53.js → use-open-skill-CgnR7yXa.js} +1 -1
  128. package/dist/public/assets/{use-popular-skills-ByV4BHXd.js → use-popular-skills-BefXxEcp.js} +1 -1
  129. package/dist/public/assets/{use-settings-route-4qI--CpZ.js → use-settings-route-DN0TWdfX.js} +1 -1
  130. package/dist/public/assets/{use-skill-origin-DGj0sj4C.js → use-skill-origin-COh1_mOK.js} +1 -1
  131. package/dist/public/assets/{use-skills-WWbAKl3q.js → use-skills-C_HuRxth.js} +1 -1
  132. package/dist/public/assets/{use-terminal-enabled-Dz_qAFuD.js → use-terminal-enabled-DPQRp9bB.js} +1 -1
  133. package/dist/public/assets/use-timeline-entry-diff-Bw_6uLLl.js +6 -0
  134. package/dist/public/assets/{use-workspace-BRfhPAI8.js → use-workspace-CNCW4CS8.js} +1 -1
  135. package/dist/public/index.html +102 -102
  136. package/dist/public/uninstall.html +10 -10
  137. package/dist/{repair-launch-json-CMlO4J6-.mjs → repair-launch-json-r4ZvDSZL.mjs} +2 -2
  138. package/dist/{repair-mcp-configs-C5d_qH2p.mjs → repair-mcp-configs-8YO27I4W.mjs} +2 -2
  139. package/dist/repair-skills-BWNXcIRv.mjs +1 -0
  140. package/dist/{repair-skills-hlHv35hU.mjs → repair-skills-Dk0Hee-r.mjs} +2 -2
  141. package/dist/server-lock-CDm0H6LS.mjs +1 -0
  142. package/dist/{server-lock-D8tFCW-G.mjs → server-lock-CeKMy65H.mjs} +2 -2
  143. package/dist/{skill-teardown-BCQ-qH0I.mjs → skill-teardown-DtXC2fAI.mjs} +2 -2
  144. package/dist/{src-C3V2v4Fb.mjs → src--XQg-7vm.mjs} +1 -1
  145. package/dist/{src-BZC89n0v.mjs → src-BwjoUUIl.mjs} +4 -4
  146. package/dist/src-DK8qZiyv.mjs +1 -0
  147. package/dist/{src-RGB2pEts.mjs → src-Dj6UxpKM.mjs} +124 -124
  148. package/dist/{src-Bev_iKqg.mjs → src-DvuwJKkU.mjs} +405 -405
  149. package/dist/start-D_Gfcl0_.mjs +12 -0
  150. package/dist/start-ZpOYP9oW.mjs +1 -0
  151. package/dist/{ui-CXX6eedF.mjs → ui-7z12LoCq.mjs} +3 -3
  152. package/dist/{write-project-skill-CTfu6uzb.mjs → write-project-skill-DUj7e5tZ.mjs} +3 -3
  153. package/package.json +4 -4
  154. package/dist/constants-ggtyHegG.mjs +0 -2
  155. package/dist/git-handle-D_uW8fTU.mjs +0 -1
  156. package/dist/init-DzEphcZj.mjs +0 -1
  157. package/dist/loader-tHonavs_.mjs +0 -1
  158. package/dist/md-manager-CUGZ0GRt.mjs +0 -2
  159. package/dist/preview-CbOTxxpX.mjs +0 -1
  160. package/dist/public/assets/CodeMirrorPropInput-Cydg0jHr.js +0 -3
  161. package/dist/public/assets/DocumentContext-BN8gSwJ-.js +0 -38
  162. package/dist/public/assets/FeedbackForm-CiQQiFp-.js +0 -1
  163. package/dist/public/assets/ManagedArtifactProperties-CUMQh4tz.js +0 -1
  164. package/dist/public/assets/SettingsDialogBody-BaYDHshm.js +0 -12
  165. package/dist/public/assets/client-version---DsZj2h.js +0 -1
  166. package/dist/public/assets/comment-chips-BjkVSykR.js +0 -5
  167. package/dist/public/assets/follow-file-kuGZjRsi.js +0 -4
  168. package/dist/public/assets/i18n-CrYaxckE.js +0 -1
  169. package/dist/public/assets/lint-plugin-meta-FPoTE-0t.js +0 -1
  170. package/dist/public/assets/messages-7cAk2vbZ.js +0 -1
  171. package/dist/public/assets/messages-BNv51jKY.js +0 -1
  172. package/dist/public/assets/messages-BS_zCLy8.js +0 -1
  173. package/dist/public/assets/messages-BmYExk_R.js +0 -1
  174. package/dist/public/assets/messages-C3vvvgBK.js +0 -1
  175. package/dist/public/assets/messages-CmD7dBQ3.js +0 -1
  176. package/dist/public/assets/messages-CpVNkvrj.js +0 -1
  177. package/dist/public/assets/messages-CxF28E4J.js +0 -1
  178. package/dist/public/assets/messages-D9UyuwOS.js +0 -1
  179. package/dist/public/assets/messages-DQ5yKIrs.js +0 -1
  180. package/dist/public/assets/messages-DdBrUUBf.js +0 -1
  181. package/dist/public/assets/navigation-targets-iVnea4YK.js +0 -1
  182. package/dist/public/assets/prop-types-ClS-DLuz.js +0 -1
  183. package/dist/public/assets/use-timeline-entry-diff-RrvwSA9l.js +0 -6
  184. package/dist/repair-skills-Bjx_4xAb.mjs +0 -1
  185. package/dist/server-lock-CTrzO_5l.mjs +0 -1
  186. package/dist/src-DChs1wj2.mjs +0 -1
  187. package/dist/start-B8fRTezu.mjs +0 -12
  188. package/dist/start-CZ-kN2jU.mjs +0 -1
  189. /package/dist/public/assets/{CopyButton-ByR_1gcU.js → CopyButton-CKyZY1PL.js} +0 -0
  190. /package/dist/public/assets/{asset-dispatch-Cz1weVX3.js → asset-dispatch-Ccnji1rt.js} +0 -0
  191. /package/dist/public/assets/{auth-prompt-store-BYOv6_8O.js → auth-prompt-store-C4YJf5De.js} +0 -0
  192. /package/dist/public/assets/{badge-DFX4S3a5.js → badge-BYteLKha.js} +0 -0
  193. /package/dist/public/assets/{copilot-Dh1BU6kS.js → copilot-CmkvU8CH.js} +0 -0
  194. /package/dist/public/assets/{cursor-B6reg1lS.js → cursor-CIl_AjI1.js} +0 -0
  195. /package/dist/public/assets/{dist-DAqA-GDU.js → dist-sSZdzHur.js} +0 -0
  196. /package/dist/public/assets/{documents-fetch-CV8lWh8v.js → documents-fetch-DnpUYK4R.js} +0 -0
  197. /package/dist/public/assets/{download-C3PYuI1f.js → download-Dn5ulvxm.js} +0 -0
  198. /package/dist/public/assets/{external-link-BIMZpgNa.js → external-link-3El87eIe.js} +0 -0
  199. /package/dist/public/assets/{eye-CSz7ogHo.js → eye-DmhHKPNd.js} +0 -0
  200. /package/dist/public/assets/{field-CtVP3IIV.js → field-CvwbVfuf.js} +0 -0
  201. /package/dist/public/assets/{file-tree-rename-validation-CCqiFGp1.js → file-tree-rename-validation-C2Ibtqn6.js} +0 -0
  202. /package/dist/public/assets/{folder-CopDpuy5.js → folder-CWlDik9N.js} +0 -0
  203. /package/dist/public/assets/{folder-open-DUSc8NL8.js → folder-open-BTTec8yg.js} +0 -0
  204. /package/dist/public/assets/{hash-DI30zEBt.js → hash-PyoMEEnH.js} +0 -0
  205. /package/dist/public/assets/{info-CV59RycV.js → info-w0kv2CeC.js} +0 -0
  206. /package/dist/public/assets/{input-BYiOK210.js → input-BFt4qZaV.js} +0 -0
  207. /package/dist/public/assets/{list-plus-DBdmIc6v.js → list-plus-2r7_ATZj.js} +0 -0
  208. /package/dist/public/assets/{minus-D07ZsfDZ.js → minus-DNhR60ON.js} +0 -0
  209. /package/dist/public/assets/{miss-dialog-store-sSyy54tn.js → miss-dialog-store-DzXIxgCB.js} +0 -0
  210. /package/dist/public/assets/{panel-CbGx_cRv.js → panel-D2VXQC58.js} +0 -0
  211. /package/dist/public/assets/{panel-right-open-B66oA9M1.js → panel-right-open-DAyUhiQN.js} +0 -0
  212. /package/dist/public/assets/{paperclip-BlKB6Xwa.js → paperclip-B6sgPA4f.js} +0 -0
  213. /package/dist/public/assets/{refresh-cw-DQervzDZ.js → refresh-cw-CR2QWccs.js} +0 -0
  214. /package/dist/public/assets/{spinner-BqySY7qY.js → spinner-CHTY-VE-.js} +0 -0
  215. /package/dist/public/assets/{square-pen-Cb57Y3fg.js → square-pen-DdAKbKU7.js} +0 -0
  216. /package/dist/public/assets/{startup-marks-Cdkh8q3E.js → startup-marks-CTM7uDIJ.js} +0 -0
  217. /package/dist/public/assets/{stex-PMopVeEZ.js → stex-s_JxeNEZ.js} +0 -0
  218. /package/dist/public/assets/{terminal-Cvoe7pfU.js → terminal-DRi0ugpC.js} +0 -0
  219. /package/dist/public/assets/{textarea-yZk4yd9U.js → textarea-CzW0aR0j.js} +0 -0
  220. /package/dist/public/assets/{trash-2-N0ilsnnr.js → trash-2-BWJWOK8-.js} +0 -0
  221. /package/dist/public/assets/{triangle-alert-COo6wbUK.js → triangle-alert-DV20-jn9.js} +0 -0
  222. /package/dist/public/assets/{undo-2-WGCwknr8.js → undo-2-CMyZc9mZ.js} +0 -0
  223. /package/dist/public/assets/{use-installed-clis-Cydpb5jd.js → use-installed-clis-DmyaQmU9.js} +0 -0
  224. /package/dist/public/assets/{wrench-CP2MIQHF.js → wrench-C3BL-uHg.js} +0 -0
  225. /package/dist/public/assets/{x-DS57FvHW.js → x-BaJrHZK_.js} +0 -0
@@ -1,2 +1,2 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{Tn as n,Wn as r,a as i,z as a}from"./DocumentContext-BN8gSwJ-.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-Cypryz6Z.js";import{t as d}from"./utils-CPqDy6Hr.js";import{a as f,g as p,h as m,i as h,m as g,n as _,t as v}from"./ChangedOutsideBadge-DdpCQcxq.js";import{t as y}from"./button-CA0dewJJ.js";import{i as b,n as x,t as S}from"./tooltip-DHXgxWLL.js";import{a as C,c as w,i as T,n as E,o as D,r as O,s as k,t as A}from"./dialog-DztIj-ZS.js";import{a as j,c as M,i as N,l as P,n as F,o as I,s as L,u as R}from"./context-menu-D1MgERPo.js";import{a as z,d as B,f as V,i as H,n as U,o as W,p as G,u as K}from"./dropdown-menu-CLgDYkh1.js";import{t as ee}from"./label-B5yNUINo.js";import{S as q,a as J,f as Y,h as te,i as ne,m as re,n as ie,o as ae,p as oe,r as se,s as ce}from"./terminal-cli-display-CW7j5kqb.js";import{An as le,Ba as ue,Fn as de,Gt as fe,In as pe,Kt as me,Ln as he,Lr as ge,Nn as _e,On as ve,Ot as ye,Rn as be,Vt as xe,co as Se,dn as Ce,do as we,ho as Te,jn as Ee,ki as De,kn as Oe,mn as ke,on as Ae,ot as je,pn as Me,st as Ne,uo as Pe}from"./dist-GenOktAv.js";import{i as Fe}from"./use-settings-route-4qI--CpZ.js";import{t as Ie}from"./dist-DUfEoSbR.js";import{n as X}from"./dist-B6jB2qbD2.js";import{f as Le,l as Re,m as ze,n as Be,p as Ve,r as He,s as Ue,u as We}from"./documents-events-rgFBXE2Z.js";import{h as Ge}from"./use-apply-config-color-theme-Dw8J4H8Z.js";import{t as Ke}from"./parse-api-error-DfesE4Y7.js";import{n as qe,t as Je}from"./workspace-paths-CKUFX0v6.js";import{t as Ye}from"./use-workspace-BRfhPAI8.js";import{t as Xe}from"./createLucideIcon-Bhw2PmPp.js";import{t as Ze}from"./RegisteredAgentIcon-gjOJZp_B.js";import{n as Qe,r as $e}from"./ManagedArtifactProperties-iclZPRJv.js";import{n as et}from"./CopyButton-ByR_1gcU.js";import{t as tt}from"./folder-open-DUSc8NL8.js";import{t as nt}from"./folder-CopDpuy5.js";import{t as rt}from"./list-plus-DBdmIc6v.js";import{t as it}from"./trash-2-N0ilsnnr.js";import{t as at}from"./input-BYiOK210.js";import{J as ot,q as st,x as ct}from"./navigation-targets-iVnea4YK.js";import{a as lt,c as ut,f as dt,n as ft,r as pt}from"./skill-scope-CFwClOyk.js";import{t as mt}from"./badge-DFX4S3a5.js";import{C as ht,N as gt,a as _t,b as vt,j as yt,k as bt,m as xt,n as St,r as Ct,t as wt,u as Tt,w as Et,x as Dt,y as Ot}from"./skills-api-B41p5sp3.js";import{t as kt}from"./use-skills-WWbAKl3q.js";import{t as At}from"./use-open-skill-Ca4D1I53.js";import{n as jt}from"./clipboard-adapter-DqemxSWT.js";import{t as Mt}from"./DiffView-C-imhjB8.js";import{n as Nt}from"./platform-labels-glrfxkSh.js";var Z=t(),Q=e(o(),1),$=l();function Pt(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 Ft(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=Ke(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:Ie._({id:`1vn0CI`})}}return!i||typeof i.status!=`string`?{ok:!1,reason:`parse-error`,message:Ie._({id:`NoY1k4`})}:i.status===`failed`?{ok:!1,reason:`build-failed`,message:i.buildError??Ie._({id:`MrUmCD`})}:{ok:!0,path:i.outputPath,handoffWarning:i.handoffError?.message}}}}function It(){if(typeof window>`u`)return null;let e=window.okDesktop?.skill;return e?Pt(e):Ft()}var Lt=`ok:skill:cowork:installed`,Rt=`1`,zt=250,Bt=`/api/skill/install-state`;function Vt(e){return`${Lt}:v${e}`}var Ht=new Map;async function Ut(e={},t={}){let n=t.force?`__force__`:`__default__`,r=Ht.get(n);if(r)return r;let i=Wt(e,t);return Ht.set(n,i),i.finally(()=>{Ht.get(n)===i&&Ht.delete(n)}),i}async function Wt(e,t){let n=e.installer===void 0?It():e.installer,r=Gt(e.storage),i=e.fetchSnapshot??qt,a=e.serverTimeoutMs??zt,o=null;if(!t.force){try{o=await Jt(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=Vt(o?.currentVersion??e.fallbackSkillVersion??Kt());if(!t.force&&r?.getItem(s)===Rt)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,Rt)}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 Gt(e){if(e!==void 0)return e;if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function Kt(){return typeof window>`u`?`unknown`:window.okDesktop?.appVersion??`unknown`}async function qt(){let e;try{e=await fetch(Bt,{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 Jt(e,t){return Promise.race([e,new Promise(e=>{setTimeout(()=>e(null),t)})])}function Yt(e){return Ut({},e)}function Xt(){return Ut({},{force:!0})}async function Zt(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 Qt(e,t={}){let n=t.fetch??globalThis.fetch.bind(globalThis);switch(e.target){case`claude-cowork`:return Zt({target:`claude-cowork`,url:Ce({mode:`cowork`},e)},n);case`claude-code`:return Zt({target:`claude-code`,url:Ce({mode:`code`},e)},n);case`codex`:return Zt({target:`codex`,url:Me(e)},n);case`cursor`:return Zt({target:`cursor`,url:ke(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 $t(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 en=`open-knowledge:agent-thread-launch`;function tn(e,t=typeof window>`u`?new EventTarget:window){t.dispatchEvent(new CustomEvent(en,{detail:e}))}function nn(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(en,n),()=>t.removeEventListener(en,n)}function rn(e){if(!e.docName||!e.workspace)return null;let t=Je(e.docName),{contentDir:n,pathSeparator:r}=e.workspace;return{docContext:{relativePath:t},projectDir:n,docPath:qe(n,t,r)}}function an(e){return e.workspace?.contentDir?{docContext:null,projectDir:e.workspace.contentDir,docPath:``}:null}function on(e){return e.workspace?.contentDir?{docContext:null,createDescription:e.description,createScenario:e.scenario,createMentions:e.mentions,projectDir:e.workspace.contentDir,docPath:``}:null}function sn(e){return te(e.installUrl).then(()=>void 0)}function cn(e){return!e.workspace?.contentDir||!e.folderRelativePath?null:{docContext:null,folderRelativePath:e.folderRelativePath,projectDir:e.workspace.contentDir,docPath:``}}function ln(e){return!e.workspace?.contentDir||!e.skillName?null:{docContext:null,skill:{name:e.skillName,scope:e.scope},projectDir:e.workspace.contentDir,docPath:``}}function un(e){if(!e.workspace?.contentDir)return null;let{contentDir:t,pathSeparator:n}=e.workspace;if(e.docName){let r=e.docRelativePath??Je(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:qe(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 dn(e){return`Opened in ${e}.`}function fn(e,t=1){return t>=3?Ie._({id:`bi2C2s`,values:{displayName:e}}):t===2?Ie._({id:`1J0c0X`,values:{displayName:e}}):Ie._({id:`Xs7IcT`,values:{displayName:e}})}function pn(e){return e>=3?null:e===2?Ie._({id:`Xp94R1`}):Ie._({id:`6gRgw8`})}function mn(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 hn(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 gn(e,t,n,r){return e.compose?Ae(hn(e.compose,t,n,r)):e.selection?de({...e.selection,target:t,transport:r}):e.skill?pe(e.skill.name,e.skill.scope,n):e.ask?ve(e.ask.relativePath,e.ask.instruction,n,t,r):De(e.docContext===null?e.folderRelativePath?_e(e.folderRelativePath,n,e.instruction,r):e.createDescription===void 0?le(n,e.instruction,r):Oe(e.createDescription,n,e.createScenario??`new-project`,e.createMentions??[],r):Ee(e.docContext.relativePath,n,e.instruction,r))}function _n(e,t){let n=typeof e.instruction==`string`&&e.instruction.trim()!==``;return e.compose!==void 0||e.createDescription!==void 0||n?`${je} ${gn(e,fe[t].handoffTarget,!1,`terminal`)}`:he(e.docContext?.relativePath??null)}function vn(e){let t=typeof e.instruction==`string`&&e.instruction.trim()!==``;return e.compose!==void 0||e.createDescription!==void 0||t?`${Ne} ${gn(e,`claude-code`,!1,`terminal`)}`:be(e.docContext?.relativePath??null)}function yn(e){let t=e.docContext?.relativePath;return typeof t!=`string`||t===``?null:t.replace(/\.(md|mdx)$/,``)}function bn(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 xn(e,t){tn({agentSource:t?.agent?.source??`registry`,agentId:t?.agent?.id??``,prompt:vn(e),docName:yn(e),titleHint:bn(e)})}async function Sn(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(Ie._({id:`wbpoGe`,values:{message:t}})),{ok:!1,reason:`dispatch-error`,detail:`install-error: ${t}`}}if(e.kind===`installed-now`)return n.toast.success(Ie._({id:`PezM4_`})),{ok:!0};if(e.kind===`install-failed`){let t=e.message??e.reason;return n.toast.error(Ie._({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:gn(t,e,n.autoOpen,`url`)},a=await n.dispatchHandoff(i),o=n.isElectronHost()?`electron`:`web`,s=n.now().toISOString(),c=t.compose,l=mn(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(dn(u));else{let i=pn(r),a=fn(u,r);i===null?n.toast.error(a):n.toast.error(a,{action:{label:i,onClick:()=>{Sn(e,t,n,r+1)}}})}return a}function Cn(e){return oe.find(t=>t.id===e)?.displayName??e}function wn(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function Tn(){return{dispatchHandoff:Qt,recordHandoff:$t,toast:{success:e=>{X.success(e)},error:(e,t)=>{X.error(e,t?{action:t.action}:void 0)}},now:()=>new Date,isElectronHost:()=>wn(),getDisplayName:Cn,ensureCoworkSkillInstalled:Yt,autoOpen:!0}}function En(){let e=(0,$.c)(2),{merged:t}=Ge(),n=t?.appearance?.preview?.autoOpen??!0,r;return e[0]===n?r=e[1]:(r={dispatch:(e,t)=>Sn(e,t,{...Tn(),autoOpen:n}),reinstallCoworkSkill:Xt},e[0]=n,e[1]=r),r}var Dn=Xe(`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`}]]),On=Xe(`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`}]]),kn=Xe(`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`}]]),An=Xe(`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 jn(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,Z.jsx)(N,{...r}):(0,Z.jsx)(H,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Mn(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,Z.jsx)(j,{...r}):(0,Z.jsx)(z,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Nn(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,Z.jsx)(F,{...r}):(0,Z.jsx)(U,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Pn(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,Z.jsx)(I,{...r}):(0,Z.jsx)(W,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Fn(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,Z.jsx)(L,{...r}):(0,Z.jsx)(K,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function In(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,Z.jsx)(M,{...r}):(0,Z.jsx)(B,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Ln(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,Z.jsx)(P,{...r}):(0,Z.jsx)(V,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Rn(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,Z.jsx)(R,{...r}):(0,Z.jsx)(G,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}var zn=Object.freeze({hosts:null,source:null}),Bn=new Map,Vn=new Map;function Hn(e,t){return`${e}:${t}`}function Un(e){return Bn.get(e)??zn}function Wn(e,t){let n=Vn.get(e)??new Set;return Vn.set(e,n),n.add(t),()=>{n.delete(t),n.size===0&&Vn.delete(e)}}function Gn(e,t){let n=Un(e),r={...n,...t};if(!(r.hosts===n.hosts&&r.source===n.source)){r.hosts===null&&r.source===null?Bn.delete(e):Bn.set(e,r);for(let t of Vn.get(e)??[])t()}}var Kn=xe.options,qn=`.agents/`;function Jn({skill:e,allSkills:t,hostSet:n,sourceHostOverlay:r,linkMode:i}){let a=t=>e?`${ut(t,e.scope)}/${e.name}`:null,o=e!==void 0&&((e.hosts??[]).includes(`agents`)||t?.some(e=>e.hosts.includes(`agents`)||e.path.startsWith(qn))),s=e?.hostAliases??(e&&t!==null?Object.assign({},...t.filter(t=>t.scope===e.scope).map(e=>e.hostAliases??{})):{}),c=e?.installableEditors??(e&&t!==null?t.find(t=>t.scope===e.scope)?.installableEditors:void 0),l=c?new Set(c):null,u=(o?[`agents`,...Kn]:Kn).filter(e=>!(e in s)).filter(e=>e===`agents`||l===null||l.has(e)||n.has(e)),d=new Set(u.map(e=>a(e))),f=e?.scope===`global`?`~/`:``,p=e?.path?.includes(`/`)?`${f}${e.path.replace(/\/SKILL\.mdx?$/i,``)}`:null,m=p!==null&&!d.has(p)?p:null,h=m===null?r??e?.hosts?.[0]:void 0,g=new Set(e?.conflictHosts??[]),_=new Set(e?.driftPaths??[]),v=new Set(e?.symlinkedHosts??[]),y=[...[...n].filter(e=>e!==h&&!(e in s)&&!g.has(e)&&!e.includes(`/`)).map(e=>({target:e,display:a(e)??e,mode:v.has(e)?`link`:`copy`})),...(e?.customPlacements??[]).map(e=>({target:pt(e),display:`${f}${e.path}`,mode:e.mode}))],b=y.map(e=>e.mode),x=b.filter(e=>e===`link`).length,S=b.length===0?i?`link`:`copy`:x*2>=b.length?`link`:`copy`,C=new Map((e?.customPlacements??[]).map(e=>[pt(e),e])),w=new Set(C.keys());if(t!==null&&e){for(let n of t)if(n.scope===e.scope)for(let e of n.customPlacements??[]){let t=pt(e);t!==``&&w.add(t)}}return{pathFor:a,aliases:s,rows:u,sourceRow:m,sourceHost:h,conflicted:g,drifted:_,linked:v,expectedMode:S,convertible:y,customRootRows:e===void 0?[]:[...w].sort().map(t=>({root:t,display:`${f}${t}/${e.name}`,placed:C.get(t)??null})).filter(e=>!d.has(e.display)&&e.display!==p&&!(e.root in s))}}var Yn=`min-w-[24rem]`;function Xn(e,t){let n=(0,$.c)(45),r=t.installingName===e.name,i=(0,Q.useRef)(e),[a,o]=(0,Q.useState)(!1),s=(0,Q.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,Q.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,Q.useEffect)(u,d);let f=r||a,p;n[6]!==e.name||n[7]!==e.scope?(p=Hn(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=>Wn(m,e),g=()=>Un(m),n[9]=m,n[10]=h,n[11]=g);let _=(0,Q.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&&Gn(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,Q.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,Q.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,Q.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=Un(m).hosts;e&&[...e].sort().join(`,`)===j&&Gn(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,Q.useEffect)(M,N);let P=(0,Q.useRef)(null),F=(0,Q.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,Q.useEffect)(I,L);let R;n[31]!==t||n[32]!==m||n[33]!==e?(R=function(n,r){D.current=n,Gn(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(ge));if(!r.ok){Gn(m,{hosts:null});return}D.current=[...r.hosts],Gn(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($n),n=e.installableEditors??Kn,r=Kn.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,()=>vt({scope:e.scope,name:e.name,dir:n,mode:r})).then(Qn)},unplaceAt(n){t.runLocationWrite(e,()=>yt({scope:e.scope,name:e.name,path:n})).then(Zn)},setSource(n){Gn(m,{source:n}),t.runLocationWrite(e,()=>bt({scope:e.scope,name:e.name,target:n})).then(e=>{e.ok||(Gn(m,{source:null}),X.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 Zn(e){e.ok||X.error(e.error)}function Qn(e){e.ok||X.error(e.error)}function $n(e){return!Kn.includes(e)}function er(e){let t=(0,$.c)(7),{hint:n,children:r}=e,i;t[0]===r?i=t[1]:(i=(0,Z.jsx)(b,{asChild:!0,children:r}),t[0]=r,t[1]=i);let a;t[2]===n?a=t[3]:(a=(0,Z.jsx)(x,{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,Z.jsxs)(S,{children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function tr(e){let t=(0,$.c)(69),{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,m=kt(),h,g,b,x,S,C,w;if(t[0]!==u||t[1]!==m.data||t[2]!==m.status||t[3]!==d||t[4]!==p||t[5]!==l||t[6]!==i||t[7]!==a||t[8]!==r||t[9]!==f||t[10]!==n){let{pathFor:e,aliases:o,rows:c,sourceRow:T,sourceHost:E,conflicted:D,drifted:O,linked:k,expectedMode:A,convertible:j,customRootRows:M}=Jn({skill:r,allSkills:m.status===`ready`?m.data:null,hostSet:d,sourceHostOverlay:n.sourceHost,linkMode:n.linkMode});b=A,g=j;let N=e=>ft(o,e),P=cr,F=e=>{let t=N(e);return t.length===0?!0:window.confirm(u({id:`Uobeu9`,values:{0:t.map(P).join(`, `),rootRel:e}}))},I;t[18]!==u||t[19]!==r?(I=(e,t)=>{let n=e.includes(`/`)?e:ut(e,r?.scope??`project`);return(0,Z.jsx)(er,{hint:u({id:`0dslv8`,values:{0:P(e),1:P(e),2:r?.name??``,poolRootRel:t,subRoot:n}}),children:(0,Z.jsx)(y,{variant:`ghost`,size:`sm`,className:`h-4 shrink-0 px-0`,"aria-label":u({id:`G6Lrs_`,values:{0:P(e)}}),onClick:i=>{i.preventDefault(),i.stopPropagation(),window.confirm(u({id:`iiqOKM`,values:{0:P(e),1:r.name,2:P(e),subRoot:n,poolRootRel:t}}))&&Dt({scope:r.scope,root:n,action:`unlink`,exclude:[r.name]}).then(e=>{e.ok?Ue():X.error(u({id:`PRgIJh`,values:{0:e.error,subRoot:n}}))})},"data-testid":`skill-audience-unfollow-${e}`,children:(0,Z.jsx)(_,{host:e,"aria-hidden":!0,className:`size-3.5`})})},e)},t[18]=u,t[19]=r,t[20]=I):I=t[20];let L=I;h=n.installing;let R=sr,z;t[21]!==u||t[22]!==a||t[23]!==n?(z=(e,t,r)=>{let i=r===`link`?`copy`:`link`;return(0,Z.jsx)(er,{hint:u(r===`link`?{id:`FeXcUS`,values:{display:t}}:{id:`ugQcJX`,values:{display:t}}),children:(0,Z.jsx)(y,{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,Z.jsx)(s,{id:`uUCrBv`}):(0,Z.jsx)(s,{id:`iaPtht`})})})},t[21]=u,t[22]=a,t[23]=n,t[24]=z):z=t[24];let B=z,V;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,Z.jsx)(s,{id:`npcziF`}),t[25]=V):V=t[25];let H;t[26]===u?H=t[27]:(H=u({id:`6f_UX4`}),t[26]=u,t[27]=H);let U;t[28]===p?U=t[29]:(U=()=>p(),t[28]=p,t[29]=U);let W;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,Z.jsx)(s,{id:`N40H-G`}),t[30]=W):W=t[30];let G;t[31]!==h||t[32]!==U?(G=(0,Z.jsx)(y,{variant:`ghost`,size:`sm`,className:`h-5 px-1.5 font-normal text-[11px] text-muted-foreground hover:text-foreground`,disabled:h,onClick:U,"data-testid":`skill-install-all`,children:W}),t[31]=h,t[32]=U,t[33]=G):G=t[33];let K;t[34]!==H||t[35]!==G?(K=(0,Z.jsx)(er,{hint:H,children:G}),t[34]=H,t[35]=G,t[36]=K):K=t[36],t[37]!==l||t[38]!==K?(x=(0,Z.jsxs)(Pn,{menuKind:l,className:`flex items-center justify-between gap-2`,children:[V,K]}),t[37]=l,t[38]=K,t[39]=x):x=t[39],S=T===null?null:(0,Z.jsx)(er,{hint:u({id:`pXB6SL`}),children:(0,Z.jsxs)(Nn,{menuKind:l,disabled:h,checked:!0,onSelect:or,"data-testid":`skill-source-row`,children:[(0,Z.jsx)(nt,{"aria-hidden":!0,className:`size-4 text-muted-foreground`}),(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,Z.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:T}),(()=>{let e=R(T).split(`/`).slice(0,-1).join(`/`),t=N(e);return t.length>0?(0,Z.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-source`,children:t.map(t=>L(t,e))}):null})(),(0,Z.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,Z.jsx)(s,{id:`tiFPjk`})})]})]})}),C=c.map(t=>{let a=e(t),o=t===`agents`?`.agents`:ue[t],c=R(a).split(`/`).slice(0,-1).join(`/`),p=N(c);return(0,Z.jsx)(er,{hint:D.has(t)?u({id:`8HvJlU`,values:{0:a??o}}):t===E?a?u({id:`ssk6rl`,values:{path:a}}):o:d.has(t)?u(a?{id:`9ieZhu`,values:{path:a}}:{id:`n3T3EE`,values:{label:o}}):u(a?b===`link`?{id:`1LtA5r`,values:{path:a}}:{id:`opPbzN`,values:{path:a}}:{id:`Pp0Vgd`,values:{label:o}}),children:(0,Z.jsxs)(Nn,{menuKind:l,disabled:h,checked:d.has(t),onCheckedChange:e=>{D.has(t)||e===!0&&!F(c)||f(t,e===!0)},onSelect:ar,className:`group`,"data-testid":`skill-install-editor-${t}`,children:[(0,Z.jsx)(_,{host:t,"aria-hidden":!0,className:`size-4`}),(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,Z.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:a??o}),p.length>0?(0,Z.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-${t}`,children:p.map(e=>L(e,c))}):null,D.has(t)?(0,Z.jsx)(er,{hint:u({id:`_O7dJS`}),children:(0,Z.jsx)(y,{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:e=>{e.preventDefault(),i?.(t)},"data-testid":`skill-fork-chip-${t}`,children:(0,Z.jsx)(s,{id:`jng7Ko`})})}):t===E?(0,Z.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,Z.jsx)(s,{id:`tiFPjk`})}):d.has(t)&&r?.hosts?(0,Z.jsxs)(Z.Fragment,{children:[!h&&(k.has(t)?`link`:`copy`)!==b?B(t,a??o,k.has(t)?`link`:`copy`):null,(0,Z.jsx)(er,{hint:u({id:`nBgzKO`}),children:(0,Z.jsx)(y,{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:e=>{e.preventDefault(),e.stopPropagation(),n.setSource?.(t)},"data-testid":`skill-set-source-${t}`,children:(0,Z.jsx)(s,{id:`VNNRfN`})})})]}):null,!h&&O.has(R(a))?(0,Z.jsx)(er,{hint:u({id:`iz1LdD`}),children:(0,Z.jsx)(v,{testId:`skill-drift-${t}`})}):null]})]})},t)}),w=M.map(e=>(0,Z.jsx)(er,{hint:e.placed===null?u(b===`link`?{id:`ybWWR2`,values:{0:e.display}}:{id:`fDjZxw`,values:{0:e.display}}):u({id:`C0cll5`,values:{0:e.display}}),children:(0,Z.jsxs)(Nn,{menuKind:l,disabled:h,checked:e.placed!==null,onCheckedChange:t=>{if(t===!0&&e.placed===null){if(!F(e.root))return;n.placeAt(e.root,b)}else e.placed!==null&&n.unplaceAt?.(e.placed.path)},onSelect:ir,className:`group`,"data-testid":`skill-custom-root-${e.root}`,children:[e.root===`.agents/skills`?(0,Z.jsx)(_,{host:`agents`,"aria-hidden":!0,className:`size-4`}):(0,Z.jsx)(nt,{"aria-hidden":!0,className:`size-4 text-muted-foreground`}),(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,Z.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:e.display}),N(e.root).length>0?(0,Z.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-custom-${e.root}`,children:N(e.root).map(t=>L(t,e.root))}):null,!h&&e.placed!==null&&O.has(e.placed.path)?(0,Z.jsx)(er,{hint:u({id:`iz1LdD`}),children:(0,Z.jsx)(v,{testId:`skill-drift-custom-${e.root}`})}):e.placed===null?null:(0,Z.jsxs)(Z.Fragment,{children:[!h&&e.placed.mode!==b?B(e.root,e.display,e.placed.mode):null,(0,Z.jsx)(er,{hint:u({id:`nBgzKO`}),children:(0,Z.jsx)(y,{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,Z.jsx)(s,{id:`VNNRfN`})})})]})]})]})},e.root)),t[0]=u,t[1]=m.data,t[2]=m.status,t[3]=d,t[4]=p,t[5]=l,t[6]=i,t[7]=a,t[8]=r,t[9]=f,t[10]=n,t[11]=h,t[12]=g,t[13]=b,t[14]=x,t[15]=S,t[16]=C,t[17]=w}else h=t[11],g=t[12],b=t[13],x=t[14],S=t[15],C=t[16],w=t[17];let T;t[40]!==u||t[41]!==h||t[42]!==g||t[43]!==b||t[44]!==a||t[45]!==n?(T=g.length>0&&n.convertLocations?(0,Z.jsxs)(`div`,{className:`flex items-center gap-1 px-2 pt-1 pb-1.5`,children:[(0,Z.jsx)(y,{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=b===`link`?`copy`:`link`,r=g.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(rr).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:h,"data-testid":`skill-convert-all`,children:b===`link`?(0,Z.jsx)(s,{id:`rcJmK8`}):(0,Z.jsx)(s,{id:`LBv_TR`})}),(0,Z.jsx)(er,{hint:u({id:`0J6nhG`}),children:(0,Z.jsx)(y,{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:nr,"data-testid":`skill-convert-all-help`,children:`?`})})]}):null,t[40]=u,t[41]=h,t[42]=g,t[43]=b,t[44]=a,t[45]=n,t[46]=T):T=t[46];let E;t[47]===l?E=t[48]:(E=(0,Z.jsx)(Fn,{menuKind:l}),t[47]=l,t[48]=E);let D;t[49]===u?D=t[50]:(D=u({id:`jqe7Yq`}),t[49]=u,t[50]=D);let O;t[51]===r?.scope?O=t[52]:(O=()=>{window.location.hash=r?.scope===`global`?`#settings/user-skills`:`#settings/skills`},t[51]=r?.scope,t[52]=O);let k,A;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,Z.jsx)(An,{"aria-hidden":!0}),A=(0,Z.jsx)(s,{id:`ZBF9fn`}),t[53]=k,t[54]=A):(k=t[53],A=t[54]);let j;t[55]!==l||t[56]!==O?(j=(0,Z.jsxs)(Mn,{menuKind:l,onSelect:O,children:[k,A]}),t[55]=l,t[56]=O,t[57]=j):j=t[57];let M;t[58]!==j||t[59]!==D?(M=(0,Z.jsx)(er,{hint:D,children:j}),t[58]=j,t[59]=D,t[60]=M):M=t[60];let N;return t[61]!==M||t[62]!==x||t[63]!==S||t[64]!==C||t[65]!==w||t[66]!==T||t[67]!==E?(N=(0,Z.jsxs)(Z.Fragment,{children:[x,S,C,w,T,E,M]}),t[61]=M,t[62]=x,t[63]=S,t[64]=C,t[65]=w,t[66]=T,t[67]=E,t[68]=N):N=t[68],N}function nr(e){return e.preventDefault()}function rr(e){return e.display}function ir(e){return e.preventDefault()}function ar(e){return e.preventDefault()}function or(e){return e.preventDefault()}function sr(e){return(e??``).replace(/^~\//,``)}function cr(e){return e===`agents`?`.agents`:ue[e]??e}function lr(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,Z.jsx)(rt,{}),t[6]=h):h=t[6];let g;t[7]!==u||t[8]!==o?(g=u?(0,Z.jsx)(mt,{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,Z.jsxs)(b,{children:[h,g]}),t[10]=g,t[11]=_);let v;t[12]!==p||t[13]!==n||t[14]!==m||t[15]!==_?(v=(0,Z.jsx)(y,{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]=v):v=t[16];let C;t[17]!==u||t[18]!==a?(C=(0,Z.jsx)(x,{side:`bottom`,children:u?(0,Z.jsxs)(`span`,{className:`flex flex-col gap-0.5`,children:[(0,Z.jsx)(`span`,{className:`font-medium`,children:(0,Z.jsx)(s,{id:`AwrGuz`})}),a?.map(ur),(0,Z.jsx)(`span`,{className:`pt-0.5 opacity-70`,children:(0,Z.jsx)(s,{id:`yh5-4s`})})]}):(0,Z.jsx)(s,{id:`81H_23`})}),t[17]=u,t[18]=a,t[19]=C):C=t[19];let w;return t[20]!==v||t[21]!==C?(w=(0,Z.jsxs)(S,{children:[v,C]}),t[20]=v,t[21]=C,t[22]=w):w=t[22],w}function ur(e,t){return(0,Z.jsx)(`span`,{className:`opacity-90`,children:e},t)}function dr(e){return e?Ie._({id:`wTcjov`}):null}function fr(e){let t=(0,$.c)(46),{_:r}=c(),i=a(),o=g(),l=q(),d=Y();if(i)return null;let{input:f,installStates:p,dispatch:m}=e,h=f===null,_,v,y,b,x,S,C,w,T,E,D;if(t[0]!==r||t[1]!==m||t[2]!==f||t[3]!==h||t[4]!==p||t[5]!==d||t[6]!==l||t[7]!==o){let e=dr(h),i;t[19]===d?i=t[20]:(i=e=>J(d,e.id),t[19]=d,t[20]=i);let a=re.filter(i),c;t[21]===d?c=t[22]:(c=e=>ae(d,e.source,e.id,!0,e.supported),t[21]=d,t[22]=c);let u=l.filter(c),g=o?me.filter(e=>ce(d,e,o.installedClis)):[];y=a.length>0,b=o!==null&&g.length>0,x=u.length>0,v=M,t[23]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Z.jsxs)(R,{children:[(0,Z.jsx)(n,{"aria-hidden":`true`}),(0,Z.jsx)(s,{id:`O7_W_a`})]}),t[23]=D):D=t[23],_=P,S=`max-h-80`,C=x?(0,Z.jsxs)(N,{"aria-label":r({id:`vPKX2i`}),children:[(0,Z.jsxs)(I,{className:`flex items-center gap-1.5`,children:[(0,Z.jsx)(s,{id:`RXEbZy`}),(0,Z.jsx)(ne,{})]}),u.map(t=>{let n=t.name;return(0,Z.jsxs)(j,{onSelect:()=>{f!==null&&xn(f,{agent:{source:t.source,id:t.id}})},disabled:h,"data-testid":`empty-space-open-in-thread-${t.id}`,"aria-label":e?r({id:`gtGQ9S`,values:{agentName:n,hint:e}}):void 0,children:[(0,Z.jsx)(Ze,{agentId:t.id,iconUrl:t.iconUrl,className:`size-4`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:(0,Z.jsx)(s,{id:`5PrrYw`,values:{agentName:n}})}),e?(0,Z.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,Z.jsx)(L,{}):null,t[24]=y,t[25]=b,t[26]=x,t[27]=w):w=t[27],T=b?(0,Z.jsxs)(N,{"aria-label":r({id:`ALhMYW`}),children:[(0,Z.jsx)(I,{children:(0,Z.jsx)(s,{id:`ALhMYW`})}),g.map(t=>{let{displayName:n}=fe[t];return(0,Z.jsxs)(j,{onSelect:()=>{f!==null&&o.launchInTerminal(f,t)},disabled:h,"data-testid":`empty-space-open-in-terminal-${t}`,"aria-label":r(e?{id:`AIn2Yv`,values:{displayName:n,hint:e}}:{id:`QYfQdv`,values:{displayName:n}}),children:[(0,Z.jsx)(se,{id:ie(t),"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:n}),e?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t)})]}):null,E=y?(0,Z.jsxs)(Z.Fragment,{children:[b?(0,Z.jsx)(L,{}):null,(0,Z.jsxs)(N,{"aria-label":r({id:`BBqGS9`}),children:[(0,Z.jsx)(I,{children:(0,Z.jsx)(s,{id:`BBqGS9`})}),a.map(t=>{let n=!h,{displayName:i}=t,a=r(e?{id:`1ZpfyB`,values:{displayName:i,hint:e}}:{id:`WqLq6M`,values:{displayName:i}});return(0,Z.jsxs)(j,{disabled:!n,onSelect:()=>{if(f){if(p[t.id]?.installed!==!0){sn(t);return}m(t.id,f)}},"data-testid":`empty-space-open-in-${t.id}`,"aria-label":a,children:[(0,Z.jsx)(se,{id:t.id,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:t.displayName}),e?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t.id)})]})]}):null,t[0]=r,t[1]=m,t[2]=f,t[3]=h,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,Z.jsx)(L,{}):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,Z.jsx)(u,{"aria-hidden":`true`}),t[32]=k):k=t[32];let A;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Z.jsxs)(j,{onSelect:Fe,"data-testid":`empty-space-open-in-settings`,children:[k,(0,Z.jsx)(`span`,{className:`flex-1`,children:(0,Z.jsx)(s,{id:`jRAGrQ`})})]}),t[33]=A):A=t[33];let F;t[34]!==_||t[35]!==S||t[36]!==C||t[37]!==w||t[38]!==T||t[39]!==E||t[40]!==O?(F=(0,Z.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]=F):F=t[41];let z;return t[42]!==v||t[43]!==D||t[44]!==F?(z=(0,Z.jsxs)(v,{children:[D,F]}),t[42]=v,t[43]=D,t[44]=F,t[45]=z):z=t[45],z}function pr(e){return e?Ie._({id:`wTcjov`}):null}function mr(e){let t=(0,$.c)(47),{_:r}=c(),i=a(),o=g(),l=q(),d=Y();if(i)return null;let{input:f,installStates:p,dispatch:m,onBeforeLaunch:h}=e,_=f===null,v,y,b,x,S,C,w,T,E,D,O;if(t[0]!==r||t[1]!==m||t[2]!==f||t[3]!==_||t[4]!==p||t[5]!==h||t[6]!==d||t[7]!==l||t[8]!==o){let e=pr(_),i;t[20]===d?i=t[21]:(i=e=>J(d,e.id),t[20]=d,t[21]=i);let a=re.filter(i),c;t[22]===d?c=t[23]:(c=e=>ae(d,e.source,e.id,!0,e.supported),t[22]=d,t[23]=c);let u=l.filter(c),g=o?me.filter(e=>ce(d,e,o.installedClis)):[];b=a.length>0,x=o!==null&&g.length>0,S=u.length>0,y=B,t[24]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Z.jsxs)(G,{children:[(0,Z.jsx)(n,{"aria-hidden":`true`}),(0,Z.jsx)(s,{id:`O7_W_a`})]}),t[24]=O):O=t[24],v=V,C=`max-h-80`,w=S?(0,Z.jsxs)(H,{"aria-label":r({id:`vPKX2i`}),children:[(0,Z.jsxs)(W,{className:`flex items-center gap-1.5`,children:[(0,Z.jsx)(s,{id:`RXEbZy`}),(0,Z.jsx)(ne,{})]}),u.map(t=>{let n=t.name;return(0,Z.jsxs)(z,{onSelect:()=>{f!==null&&(h?.(),xn(f,{agent:{source:t.source,id:t.id}}))},disabled:_,"data-testid":`file-tree-open-in-thread-${t.id}`,"aria-label":e?r({id:`gtGQ9S`,values:{agentName:n,hint:e}}):void 0,children:[(0,Z.jsx)(Ze,{agentId:t.id,iconUrl:t.iconUrl,className:`size-4`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:(0,Z.jsx)(s,{id:`5PrrYw`,values:{agentName:n}})}),e?(0,Z.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,Z.jsx)(K,{}):null,t[25]=b,t[26]=x,t[27]=S,t[28]=T):T=t[28],E=x?(0,Z.jsxs)(H,{"aria-label":r({id:`ALhMYW`}),children:[(0,Z.jsx)(W,{children:(0,Z.jsx)(s,{id:`ALhMYW`})}),g.map(t=>{let{displayName:n}=fe[t];return(0,Z.jsxs)(z,{onSelect:()=>{f!==null&&(h?.(),o.launchInTerminal(f,t))},disabled:_,"data-testid":`file-tree-open-in-terminal-${t}`,"aria-label":r(e?{id:`AIn2Yv`,values:{displayName:n,hint:e}}:{id:`QYfQdv`,values:{displayName:n}}),children:[(0,Z.jsx)(se,{id:ie(t),"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:n}),e?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t)})]}):null,D=b?(0,Z.jsxs)(Z.Fragment,{children:[x?(0,Z.jsx)(K,{}):null,(0,Z.jsxs)(H,{"aria-label":r({id:`BBqGS9`}),children:[(0,Z.jsx)(W,{children:(0,Z.jsx)(s,{id:`BBqGS9`})}),a.map(t=>{let n=!_,{displayName:i}=t,a=r(e?{id:`1ZpfyB`,values:{displayName:i,hint:e}}:{id:`WqLq6M`,values:{displayName:i}});return(0,Z.jsxs)(z,{disabled:!n,onSelect:()=>{if(f){if(h?.(),p[t.id]?.installed!==!0){sn(t);return}m(t.id,f)}},"data-testid":`file-tree-open-in-${t.id}`,"aria-label":a,children:[(0,Z.jsx)(se,{id:t.id,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:t.displayName}),e?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t.id)})]})]}):null,t[0]=r,t[1]=m,t[2]=f,t[3]=_,t[4]=p,t[5]=h,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,Z.jsx)(K,{}):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,Z.jsx)(u,{"aria-hidden":`true`}),t[33]=A):A=t[33];let j;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Z.jsxs)(z,{onSelect:Fe,"data-testid":`file-tree-open-in-settings`,children:[A,(0,Z.jsx)(`span`,{className:`flex-1`,children:(0,Z.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,Z.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,Z.jsxs)(y,{children:[O,M]}),t[43]=y,t[44]=O,t[45]=M,t[46]=N):N=t[46],N}var hr=/^\.[A-Za-z0-9_-]+\/skills\/([^/]+)\/(.+)$/;function gr(e){let t=we(e);if(t)return{scope:`project`,name:t.name,rel:t.rel};let n=Se(e);if(n)return{scope:`global`,name:n.name,rel:n.rel};let r=Pe(e);if(r?.kind===`skill`)return{scope:r.scope,name:r.name,rel:r.rel};let i=hr.exec(e);return i?{scope:`project`,name:i[1],rel:i[2]}:null}function _r(e,t,n){return e.filter(e=>{let r=ct(e);if(r.kind===`skill-file`)return r.scope===t&&r.name===n;if(r.kind!==`doc`)return!1;let i=gr(r.docName);return i?.scope===t&&i.name===n})}function vr(e,t,n){let r=st(t,n);return e.filter(e=>{let i=ct(e);return i.kind===`skill-file`?i.scope===t.scope&&i.name===t.name&&i.path===n:i.kind===`doc`&&i.docName===r})}function yr(e,t,n){let r=gr(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 st(i,a)===e?{skill:i,filePath:a}:null}function br(e,t,n=(e,t)=>Le(e,t)||Ve(e,t)){let r=new Map(t.map(e=>[`${e.scope}\u0000${e.name}`,e])),i=[],a=new Set;for(let t of e){let e=gr(t);e!==null&&e.rel===null&&a.add(`${e.scope}\u0000${e.name}`)}for(let t of e){let e=gr(t);if(!e||r.has(`${e.scope}\u0000${e.name}`))continue;let o=e.scope===`project`?`global`:`project`,s=r.get(`${o}\u0000${e.name}`);e.rel===null&&s!==void 0?i.push({kind:`retarget`,fromDocName:t,toDocName:ot(s)}):n(e.scope,e.name)||(s!==void 0&&!a.has(`${e.scope}\u0000${e.name}`)?(a.add(`${e.scope}\u0000${e.name}`),i.push({kind:`retarget`,fromDocName:t,toDocName:ot(s)})):i.push({kind:`close`,docName:t}))}return i}function xr(){let e=(0,$.c)(15),{openTabs:t,closeDocument:n}=i(),r=Qe(),a;e[0]===t?a=e[1]:(a=t.some(Cr),e[0]=t,e[1]=a);let o=a,s;e[2]===o?s=e[3]:(s={enabled:o},e[2]=o,e[3]=s);let c=kt(s),l=(0,Q.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(Sr).sort().join(``)}\u0002${ze()}`;if(l.current===i)return;l.current=i;let a=br(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,Q.useEffect)(u,d)}function Sr(e){return`${e.scope}\u0000${e.name}`}function Cr(e){return gr(e)!==null}function wr(e){let t=(0,$.c)(19),{skill:n,onOpenChange:r,onDeleted:a}=e,{_:o}=c(),{setSkillsSidebar:s,closeTabs:l,openTabs:u}=i(),[d,p]=(0,Q.useState)(!1),m;t[0]!==o||t[1]!==l||t[2]!==a||t[3]!==r||t[4]!==u||t[5]!==s?(m=async function(e){s(!0),p(!0);let t=await St(e.scope,e.name);if(p(!1),!t.ok){let{error:e}=t;X.error(o({id:`AtBdnD`,values:{error:e}}));return}X.success(o({id:`h9QFb9`,values:{0:e.name}})),l(_r(u,e.scope,e.name),{force:!0}),a(),r(!1)},t[0]=o,t[1]=l,t[2]=a,t[3]=r,t[4]=u,t[5]=s,t[6]=m):m=t[6];let g=m,_=n!==null,v;t[7]!==d||t[8]!==r?(v=e=>{!e&&!d&&r(!1)},t[7]=d,t[8]=r,t[9]=v):v=t[9];let y;t[10]!==o||t[11]!==d||t[12]!==g||t[13]!==n?(y=n?(0,Z.jsx)(h,{itemName:o({id:`ExUzM4`,values:{0:n.name}}),isSubmitting:d,onDelete:()=>g(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]=g,t[13]=n,t[14]=y):y=t[14];let b;return t[15]!==_||t[16]!==v||t[17]!==y?(b=(0,Z.jsx)(f,{open:_,onOpenChange:v,children:y}),t[15]=_,t[16]=v,t[17]=y,t[18]=b):b=t[18],b}function Tr(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 Er(e){let t=(0,$.c)(66),{target:n,onOpenChange:r}=e,{_:a}=c(),{openTarget:o}=i(),l=(0,Q.useId)(),[u,d]=(0,Q.useState)(``),[f,p]=(0,Q.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,v;if(t[2]!==h||t[3]!==g||t[4]!==_?(v=[h,g,_],t[2]=h,t[3]=g,t[4]=_,t[5]=v):v=t[5],(0,Q.useEffect)(m,v),!n)return null;let b,x,S,E;t[6]!==u||t[7]!==f?(E=u.trim(),x=E===``||!Tr(E),b=!x&&!f,S=E.includes(`/`)?E.split(`/`).slice(0,-1).join(`/`):null,t[6]=u,t[7]=f,t[8]=b,t[9]=x,t[10]=S,t[11]=E):(b=t[8],x=t[9],S=t[10],E=t[11]);let O=S,j;t[12]!==a||t[13]!==b||t[14]!==r||t[15]!==o||t[16]!==n||t[17]!==E?(j=async function(){if(!n||!b)return;p(!0);let e=/\.mdx?$/i.test(E),t=await gt({scope:n.skill.scope,name:n.skill.name,path:E,content:e?`# ${E.split(`/`).pop()?.replace(/\.mdx?$/i,``)??``}\n`:``});if(p(!1),!t.ok){X.error(a({id:`a_2_uB`,values:{0:t.error,trimmed:E}}));return}if(X.success(a({id:`MXSt4t`,values:{0:t.path}})),e){let e=st(n.skill,E);o({kind:`doc`,target:e,docName:e})}r(!1)},t[12]=a,t[13]=b,t[14]=r,t[15]=o,t[16]=n,t[17]=E,t[18]=j):j=t[18];let M=j,N;t[19]!==r||t[20]!==f?(N=e=>{!e&&!f&&r(!1)},t[19]=r,t[20]=f,t[21]=N):N=t[21];let P;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,Z.jsx)(w,{children:(0,Z.jsx)(s,{id:`wQvvZY`})}),t[22]=P):P=t[22];let F;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Z.jsxs)(k,{children:[P,(0,Z.jsx)(C,{children:(0,Z.jsx)(s,{id:`lM4c-I`})})]}),t[23]=F):F=t[23];let I;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,Z.jsx)(s,{id:`I6gXOa`}),t[24]=I):I=t[24];let L;t[25]===l?L=t[26]:(L=(0,Z.jsx)(ee,{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&&E!==``,B;t[28]===M?B=t[29]:(B=e=>{e.key===`Enter`&&M()},t[28]=M,t[29]=B);let V;t[30]!==l||t[31]!==u||t[32]!==z||t[33]!==B?(V=(0,Z.jsx)(at,{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]!==O||t[36]!==x||t[37]!==E?(H=x&&E!==``?(0,Z.jsx)(`p`,{className:`text-destructive text-xs`,children:(0,Z.jsx)(s,{id:`fVzizW`})}):O?(0,Z.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:(0,Z.jsx)(s,{id:`9lso1Y`,values:{folderPart:O},components:{0:(0,Z.jsx)(`span`,{className:`font-mono text-foreground/80`})}})}):null,t[35]=O,t[36]=x,t[37]=E,t[38]=H):H=t[38];let U;t[39]!==L||t[40]!==V||t[41]!==H?(U=(0,Z.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,Z.jsx)(s,{id:`dEgA5A`}),t[45]=G):G=t[45];let K;t[46]!==f||t[47]!==W?(K=(0,Z.jsx)(y,{variant:`outline`,onClick:W,disabled:f,children:G}),t[46]=f,t[47]=W,t[48]=K):K=t[48];let q;t[49]===M?q=t[50]:(q=()=>void M(),t[49]=M,t[50]=q);let J=!b,Y;t[51]===f?Y=t[52]:(Y=f?(0,Z.jsx)(s,{id:`E9bKSA`}):(0,Z.jsx)(s,{id:`hYgDIe`}),t[51]=f,t[52]=Y);let te;t[53]!==q||t[54]!==J||t[55]!==Y?(te=(0,Z.jsx)(y,{onClick:q,disabled:J,children:Y}),t[53]=q,t[54]=J,t[55]=Y,t[56]=te):te=t[56];let ne;t[57]!==K||t[58]!==te?(ne=(0,Z.jsxs)(D,{children:[K,te]}),t[57]=K,t[58]=te,t[59]=ne):ne=t[59];let re;t[60]!==U||t[61]!==ne?(re=(0,Z.jsxs)(T,{className:`sm:max-w-md`,children:[F,U,ne]}),t[60]=U,t[61]=ne,t[62]=re):re=t[62];let ie;return t[63]!==re||t[64]!==N?(ie=(0,Z.jsx)(A,{open:!0,onOpenChange:N,children:re}),t[63]=re,t[64]=N,t[65]=ie):ie=t[65],ie}function Dr(e){let t=(0,$.c)(18),{target:n,onOpenChange:r}=e,{_:a}=c(),{setSkillsSidebar:o,closeTabs:s,openTabs:l}=i(),[u,d]=(0,Q.useState)(!1),p;t[0]!==a||t[1]!==s||t[2]!==r||t[3]!==l||t[4]!==o?(p=async function(e){let{skill:t,filePath:n}=e;o(!0),d(!0);let i=await Ct({scope:t.scope,name:t.name,path:n});if(d(!1),!i.ok){X.error(a({id:`CBT70t`,values:{0:i.error}}));return}if(!i.existed){X.error(a({id:`q4efaG`,values:{filePath:n}})),r(!1);return}X.success(a({id:`gOmloS`,values:{filePath:n}})),s(vr(l,t,n),{force:!0}),r(!1)},t[0]=a,t[1]=s,t[2]=r,t[3]=l,t[4]=o,t[5]=p):p=t[5];let m=p,g=n!==null,_;t[6]!==u||t[7]!==r?(_=e=>{!e&&!u&&r(!1)},t[6]=u,t[7]=r,t[8]=_):_=t[8];let v;t[9]!==a||t[10]!==u||t[11]!==m||t[12]!==n?(v=n?(0,Z.jsx)(h,{itemName:a({id:`wZPUJx`,values:{0:n.filePath}}),isSubmitting:u,onDelete:()=>m(n),customDescription:a({id:`ppzof_`,values:{0:lt(n.skill.path),1:n.filePath,2:n.skill.name}})}):null,t[9]=a,t[10]=u,t[11]=m,t[12]=n,t[13]=v):v=t[13];let y;return t[14]!==g||t[15]!==_||t[16]!==v?(y=(0,Z.jsx)(f,{open:g,onOpenChange:_,children:v}),t[14]=g,t[15]=_,t[16]=v,t[17]=y):y=t[17],y}function Or(e){let t=(0,$.c)(64),{target:n,onOpenChange:r}=e,{_:i}=c(),a=Qe(),o=(0,Q.useId)(),[l,u]=(0,Q.useState)(``),[d,f]=(0,Q.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,Q.useEffect)(p,_),!n)return null;let v,b,x;t[6]!==l||t[7]!==n.filePath?(b=l.trim(),x=b===n.filePath,v=b===``||!Tr(b),t[6]=l,t[7]=n.filePath,t[8]=v,t[9]=b,t[10]=x):(v=t[8],b=t[9],x=t[10]);let S=v,E=!S&&!x&&!d,O;t[11]!==i||t[12]!==E||t[13]!==r||t[14]!==a||t[15]!==n||t[16]!==b?(O=async function(){if(!n||!E)return;f(!0);let e=await ht({scope:n.skill.scope,name:n.skill.name,from:n.filePath,to:b});if(f(!1),!e.ok){X.error(i({id:`11ukmX`,values:{0:e.error}}));return}e.fromDocName!==void 0&&e.toDocName!==void 0&&a(e.fromDocName,e.toDocName),X.success(i({id:`XszXjc`,values:{0:e.to}})),r(!1)},t[11]=i,t[12]=E,t[13]=r,t[14]=a,t[15]=n,t[16]=b,t[17]=O):O=t[17];let j=O,M;t[18]!==r||t[19]!==d?(M=e=>{!e&&!d&&r(!1)},t[18]=r,t[19]=d,t[20]=M):M=t[20];let N;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,Z.jsx)(w,{children:(0,Z.jsx)(s,{id:`yckias`})}),t[21]=N):N=t[21];let P;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,Z.jsxs)(k,{children:[N,(0,Z.jsx)(C,{children:(0,Z.jsx)(s,{id:`HzVAoz`})})]}),t[22]=P):P=t[22];let F;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Z.jsx)(s,{id:`I6gXOa`}),t[23]=F):F=t[23];let I;t[24]===o?I=t[25]:(I=(0,Z.jsx)(ee,{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]===j?z=t[28]:(z=e=>{e.key===`Enter`&&j()},t[27]=j,t[28]=z);let B;t[29]!==o||t[30]!==l||t[31]!==R||t[32]!==z?(B=(0,Z.jsx)(at,{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,Z.jsx)(`p`,{className:`text-destructive text-xs`,children:(0,Z.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,Z.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,Z.jsx)(s,{id:`dEgA5A`}),t[43]=W):W=t[43];let G;t[44]!==d||t[45]!==U?(G=(0,Z.jsx)(y,{variant:`outline`,onClick:U,disabled:d,children:W}),t[44]=d,t[45]=U,t[46]=G):G=t[46];let K;t[47]===j?K=t[48]:(K=()=>void j(),t[47]=j,t[48]=K);let q=!E,J;t[49]===d?J=t[50]:(J=d?(0,Z.jsx)(s,{id:`tHKQ6j`}):(0,Z.jsx)(s,{id:`2wxgft`}),t[49]=d,t[50]=J);let Y;t[51]!==K||t[52]!==q||t[53]!==J?(Y=(0,Z.jsx)(y,{onClick:K,disabled:q,children:J}),t[51]=K,t[52]=q,t[53]=J,t[54]=Y):Y=t[54];let te;t[55]!==G||t[56]!==Y?(te=(0,Z.jsxs)(D,{children:[G,Y]}),t[55]=G,t[56]=Y,t[57]=te):te=t[57];let ne;t[58]!==H||t[59]!==te?(ne=(0,Z.jsxs)(T,{className:`sm:max-w-md`,children:[P,H,te]}),t[58]=H,t[59]=te,t[60]=ne):ne=t[60];let re;return t[61]!==ne||t[62]!==M?(re=(0,Z.jsx)(A,{open:!0,onOpenChange:M,children:ne}),t[61]=ne,t[62]=M,t[63]=re):re=t[63],re}function kr(e){let t=(0,$.c)(59),{target:n,onOpenChange:r}=e,{_:i}=c(),a=(0,Q.useId)(),[o,l]=(0,Q.useState)(null),[u,d]=(0,Q.useState)(null),[f,p]=(0,Q.useState)(!1),[m,h]=(0,Q.useState)(!1),[g,_]=(0,Q.useState)(``),[v,b]=(0,Q.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}/${ut(t,e.scope)}/${e.name}`,o=new AbortController;for(let[t,n]of[[i,d],[a,l]])Tt({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,O=n?.skill.name,j=n?.editor,M;if(t[2]!==S||t[3]!==O||t[4]!==j?(M=[S,O,j],t[2]=S,t[3]=O,t[4]=j,t[5]=M):M=t[5],(0,Q.useEffect)(x,M),!n)return null;let{skill:N,editor:P}=n,F;t[6]!==i||t[7]!==P||t[8]!==r||t[9]!==N.name||t[10]!==N.scope||t[11]!==n||t[12]!==g?(F=async function(e){if(!n)return;b(!0);let t=await Et({scope:N.scope,name:N.name,editor:P,action:e,...e===`rename`?{toName:g.trim()}:{}});if(b(!1),!t.ok){X.error(i({id:`MIF36T`,values:{0:t.error}}));return}X.success(i(e===`align`?{id:`QKgePK`,values:{editor:P}}:e===`make-source`?{id:`It9oAP`,values:{editor:P}}:{id:`b2ezG_`,values:{0:g.trim()}})),r(!1)},t[6]=i,t[7]=P,t[8]=r,t[9]=N.name,t[10]=N.scope,t[11]=n,t[12]=g,t[13]=F):F=t[13];let I=F,L,R;t[14]!==N.name||t[15]!==g?(R=g.trim(),L=R===``||!ye.test(R)||R===N.name,t[14]=N.name,t[15]=g,t[16]=L,t[17]=R):(L=t[16],R=t[17]);let z=L,B;t[18]!==v||t[19]!==r?(B=e=>{!e&&!v&&r(!1)},t[18]=v,t[19]=r,t[20]=B):B=t[20];let V;t[21]!==P||t[22]!==N.name?(V=(0,Z.jsx)(w,{children:(0,Z.jsx)(s,{id:`q8aCbb`,values:{0:N.name,editor:P}})}),t[21]=P,t[22]=N.name,t[23]=V):V=t[23];let H;t[24]===P?H=t[25]:(H=(0,Z.jsx)(C,{children:(0,Z.jsx)(s,{id:`QASTNu`,values:{editor:P}})}),t[24]=P,t[25]=H);let U;t[26]!==H||t[27]!==V?(U=(0,Z.jsxs)(k,{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,Z.jsx)(Mt,{oldContent:u,newContent:o,layout:`unified`}):f?(0,Z.jsx)(`div`,{className:`flex min-h-56 items-center justify-center px-6 text-center text-muted-foreground text-sm`,children:(0,Z.jsx)(s,{id:`5BlXTD`})}):(0,Z.jsx)(`div`,{className:`flex min-h-56 items-center justify-center text-muted-foreground text-sm`,children:(0,Z.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]!==P||t[35]!==a||t[36]!==z||t[37]!==m||t[38]!==N.name||t[39]!==g||t[40]!==R?(G=m?(0,Z.jsxs)(`div`,{className:`mt-3 space-y-1.5`,children:[(0,Z.jsx)(ee,{htmlFor:a,children:(0,Z.jsx)(s,{id:`pSimwP`,values:{editor:P}})}),(0,Z.jsx)(at,{id:a,value:g,onChange:e=>_(e.target.value),placeholder:`${N.name}-${P}`,"aria-invalid":z&&R!==``,onKeyDown:e=>{e.key===`Enter`&&!z&&I(`rename`)}})]}):null,t[33]=I,t[34]=P,t[35]=a,t[36]=z,t[37]=m,t[38]=N.name,t[39]=g,t[40]=R,t[41]=G):G=t[41];let K;t[42]!==W||t[43]!==G?(K=(0,Z.jsxs)(E,{className:`min-h-0 flex-1 overflow-auto`,children:[W,G]}),t[42]=W,t[43]=G,t[44]=K):K=t[44];let q;t[45]!==I||t[46]!==v||t[47]!==P||t[48]!==z||t[49]!==m||t[50]!==N.name?(q=(0,Z.jsx)(D,{children:m?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(y,{variant:`outline`,onClick:()=>h(!1),disabled:v,children:(0,Z.jsx)(s,{id:`iH8pgl`})}),(0,Z.jsx)(y,{onClick:()=>void I(`rename`),disabled:v||z,children:(0,Z.jsx)(s,{id:`AT0e50`})})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(y,{variant:`outline`,onClick:()=>{_(`${N.name}-${P}`),h(!0)},disabled:v,children:(0,Z.jsx)(s,{id:`AT0e50`})}),(0,Z.jsx)(y,{variant:`outline`,onClick:()=>void I(`make-source`),disabled:v,children:(0,Z.jsx)(s,{id:`xWomUD`,values:{editor:P}})}),(0,Z.jsx)(y,{onClick:()=>void I(`align`),disabled:v,children:(0,Z.jsx)(s,{id:`PZn2LP`})})]})}),t[45]=I,t[46]=v,t[47]=P,t[48]=z,t[49]=m,t[50]=N.name,t[51]=q):q=t[51];let J;t[52]!==U||t[53]!==K||t[54]!==q?(J=(0,Z.jsxs)(T,{className:`flex max-h-[85vh] w-full max-w-3xl flex-col`,children:[U,K,q]}),t[52]=U,t[53]=K,t[54]=q,t[55]=J):J=t[55];let Y;return t[56]!==J||t[57]!==B?(Y=(0,Z.jsx)(A,{open:!0,onOpenChange:B,children:J}),t[56]=J,t[57]=B,t[58]=Y):Y=t[58],Y}function Ar(e){let t=(0,$.c)(75),{skill:n,existingNames:r,onOpenChange:i,onRenamed:a}=e,o=$e(),c=n!==null,l=(0,Q.useId)(),[u,d]=(0,Q.useState)(``),[f,p]=(0,Q.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,Q.useEffect)(m,_),!n)return null;let v,b,x,S,E,O;if(t[5]!==r||t[6]!==u||t[7]!==n.name){E=u.trim(),O=E===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),v=i,S=E.length>64,b=E===``||!ye.test(E)||S,x=!b&&!O&&r.has(E),t[5]=r,t[6]=u,t[7]=n.name,t[8]=v,t[9]=b,t[10]=x,t[11]=S,t[12]=E,t[13]=O}else v=t[8],b=t[9],x=t[10],S=t[11],E=t[12],O=t[13];let j=x,M=!b&&!j&&!O&&!f,N;t[17]!==M||t[18]!==i||t[19]!==a||t[20]!==o||t[21]!==n||t[22]!==E?(N=async function(){if(!n||!M)return;p(!0);let e=await o({scope:n.scope,name:n.name},E);p(!1),e.ok&&(a?.(E),i(!1))},t[17]=M,t[18]=i,t[19]=a,t[20]=o,t[21]=n,t[22]=E,t[23]=N):N=t[23];let P=N,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,Z.jsx)(w,{children:(0,Z.jsx)(s,{id:`dw_3cv`})}),t[26]=I):I=t[26];let L;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Z.jsxs)(k,{children:[I,(0,Z.jsx)(C,{children:(0,Z.jsx)(s,{id:`R9IDFz`})})]}),t[27]=L):L=t[27];let R;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,Z.jsx)(s,{id:`6YtxFj`}),t[28]=R):R=t[28];let z;t[29]===l?z=t[30]:(z=(0,Z.jsx)(ee,{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]===P?V=t[33]:(V=e=>{e.key===`Enter`&&P()},t[32]=P,t[33]=V);let H=b||j,U=b&&E!==``||j?`${l}-error`:void 0,W;t[34]!==l||t[35]!==u||t[36]!==V||t[37]!==H||t[38]!==U?(W=(0,Z.jsx)(at,{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]!==j||t[41]!==v||t[42]!==l||t[43]!==b||t[44]!==S||t[45]!==E?(G=b&&E!==``?(0,Z.jsx)(`p`,{id:`${l}-error`,className:`text-xs text-destructive`,children:v?(0,Z.jsx)(s,{id:`iUwpZI`,components:{0:(0,Z.jsx)(`code`,{className:`font-mono`})}}):S?(0,Z.jsx)(s,{id:`lK9c4T`}):(0,Z.jsx)(s,{id:`A50vr3`,components:{0:(0,Z.jsx)(`code`,{className:`font-mono`})}})}):j?(0,Z.jsx)(`p`,{id:`${l}-error`,className:`text-xs text-destructive`,children:(0,Z.jsx)(s,{id:`YJ1BTp`})}):null,t[40]=j,t[41]=v,t[42]=l,t[43]=b,t[44]=S,t[45]=E,t[46]=G):G=t[46];let K;t[47]!==z||t[48]!==W||t[49]!==G?(K=(0,Z.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 q;t[51]===i?q=t[52]:(q=()=>i(!1),t[51]=i,t[52]=q);let J;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,Z.jsx)(s,{id:`dEgA5A`}),t[53]=J):J=t[53];let Y;t[54]!==f||t[55]!==q?(Y=(0,Z.jsx)(y,{variant:`outline`,className:`font-mono uppercase`,onClick:q,disabled:f,children:J}),t[54]=f,t[55]=q,t[56]=Y):Y=t[56];let te;t[57]===P?te=t[58]:(te=()=>void P(),t[57]=P,t[58]=te);let ne=!M,re;t[59]===f?re=t[60]:(re=f?(0,Z.jsx)(s,{id:`tHKQ6j`}):(0,Z.jsx)(s,{id:`2wxgft`}),t[59]=f,t[60]=re);let ie;t[61]!==te||t[62]!==ne||t[63]!==re?(ie=(0,Z.jsx)(y,{onClick:te,disabled:ne,children:re}),t[61]=te,t[62]=ne,t[63]=re,t[64]=ie):ie=t[64];let ae;t[65]!==Y||t[66]!==ie?(ae=(0,Z.jsxs)(D,{children:[Y,ie]}),t[65]=Y,t[66]=ie,t[67]=ae):ae=t[67];let oe;t[68]!==K||t[69]!==ae?(oe=(0,Z.jsxs)(T,{children:[L,K,ae]}),t[68]=K,t[69]=ae,t[70]=oe):oe=t[70];let se;return t[71]!==c||t[72]!==oe||t[73]!==F?(se=(0,Z.jsx)(A,{open:c,onOpenChange:F,children:oe}),t[71]=c,t[72]=oe,t[73]=F,t[74]=se):se=t[74],se}function jr(){let e=(0,$.c)(7),{_:t}=c(),n=dt(),r=Qe(),{setSkillsSidebar:a,openTabs:o}=i(),s=kt(),l;return e[0]!==t||e[1]!==o||e[2]!==r||e[3]!==n||e[4]!==a||e[5]!==s?(l=async(e,i)=>{if(i===e.scope)return!1;He(e.scope,e.name),Be(e.scope,e.name);let c=await Ot({name:e.name,fromScope:e.scope,toScope:i});if(Re(e.scope,e.name),!c.ok)return We(e.scope,e.name),X.error(t({id:`07eGJB`,values:{0:c.error}})),!1;X.success(t({id:`yhI6P0`,values:{0:e.name,1:n[i]}}));let l=s.status===`ready`?s.data.find(t=>t.scope===e.scope&&t.name===e.name):void 0,u=o.map(Nr).filter(t=>{if(t.kind!==`doc`)return!1;let n=gr(t.docName);return n?.scope===e.scope&&n.name===e.name}),d=u.find(Mr)??u[0],f=d?.kind===`doc`?d.docName:l?ot(l):e.scope===`global`?Te(e.scope,e.name):null,p=i===`project`&&c.path!==void 0?`${c.path.replace(/\/+$/,``)}/SKILL`:Te(i,e.name);try{f!==null&&r(f,p)}catch(e){console.error(`[skill-move-scope] retarget failed after a successful move`,e)}return a(!0),We(e.scope,e.name),!0},e[0]=t,e[1]=o,e[2]=r,e[3]=n,e[4]=a,e[5]=s,e[6]=l):l=e[6],l}function Mr(e){return e.kind===`doc`&&gr(e.docName)?.rel===null}function Nr(e){return ct(e)}function Pr(e){let t=(0,$.c)(38),{target:n,onOpenChange:r}=e,i=dt(),a=jr(),[o,c]=(0,Q.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,Z.jsx)(w,{children:(0,Z.jsx)(s,{id:`SXEdCq`,values:{0:p}})}),t[3]=p,t[4]=m);let h=i[l],g=i[d],_=i[d],v;t[5]!==u||t[6]!==h||t[7]!==g||t[8]!==_?(v={0:h,1:g,2:_,name:u},t[5]=u,t[6]=h,t[7]=g,t[8]=_,t[9]=v):v=t[9];let b;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(b={0:(0,Z.jsx)(`code`,{className:`font-mono`})},t[10]=b):b=t[10];let x;t[11]===v?x=t[12]:(x=(0,Z.jsx)(C,{children:(0,Z.jsx)(s,{id:`7bIiJ7`,values:v,components:b})}),t[11]=v,t[12]=x);let S;t[13]!==m||t[14]!==x?(S=(0,Z.jsxs)(k,{children:[m,x]}),t[13]=m,t[14]=x,t[15]=S):S=t[15];let E;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,Z.jsx)(s,{id:`dEgA5A`}),t[16]=E):E=t[16];let j;t[17]===o?j=t[18]:(j=(0,Z.jsx)(O,{asChild:!0,children:(0,Z.jsx)(y,{variant:`outline`,disabled:o,children:E})}),t[17]=o,t[18]=j);let M;t[19]!==a||t[20]!==u||t[21]!==r||t[22]!==l||t[23]!==d?(M=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]=M):M=t[24];let N;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,Z.jsx)(s,{id:`QWdKwH`}),t[25]=N):N=t[25];let P;t[26]!==o||t[27]!==M?(P=(0,Z.jsx)(y,{"data-testid":`skill-scope-move-confirm`,disabled:o,onClick:M,children:N}),t[26]=o,t[27]=M,t[28]=P):P=t[28];let F;t[29]!==j||t[30]!==P?(F=(0,Z.jsxs)(D,{children:[j,P]}),t[29]=j,t[30]=P,t[31]=F):F=t[31];let I;t[32]!==S||t[33]!==F?(I=(0,Z.jsxs)(T,{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,Z.jsx)(A,{open:!0,onOpenChange:f,children:I}),t[35]=f,t[36]=I,t[37]=L):L=t[37],L}function Fr(){let e=(0,$.c)(50),{_:t}=c(),n=At(),[r,i]=(0,Q.useState)(null),[a,o]=(0,Q.useState)(null),[s,l]=(0,Q.useState)(null),[u,d]=(0,Q.useState)(null),[f,p]=(0,Q.useState)(null),[m,h]=(0,Q.useState)(null),[g,_]=(0,Q.useState)(null),[v,y]=(0,Q.useState)(null),b;e[0]===t?b=e[1]:(b=async function(e,n,r){y(e.name),He(e.scope,e.name);let i=await xt({scope:e.scope,name:e.name,...n?{targets:[...n]}:{},...r?.linkMode===void 0?{}:{linkMode:r.linkMode}});if(We(e.scope,e.name),y(null),!i.ok)return X.error(t({id:`Mj8R8K`,values:{0:i.error}})),i;let a=Ir,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 X.warning(u),i;if(s.length>0){let e=l(`scripts-present`);e&&X.warning(e);let t=l(`no-description`);t&&X.warning(t)}return i.hosts.length===0?X.success(t({id:`4pDZ2N`,values:{0:e.name}})):s.length>0&&c.length===0?X.success(t({id:`PPFQ3o`,values:{0:e.name,1:a(s)}})):c.length>0&&s.length===0?X.success(t({id:`OOIVJo`,values:{0:e.name,1:a(c)}})):s.length>0&&c.length>0?X.success(t({id:`OxplNM`,values:{0:e.name,1:a(s),2:a(c)}})):X.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),He(e.scope,e.name);for(let{target:n,mode:r}of t){let t=await wt({scope:e.scope,name:e.name,target:n,mode:r});if(!t.ok){X.error(t.error);break}}We(e.scope,e.name),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),He(e.scope,e.name);let n=await t();return We(e.scope,e.name),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 _t({scope:e.scope,name:e.name,existingNames:r});if(!i.ok){X.error(t({id:`UPjaXD`,values:{0:e.name,1:i.error}}));return}X.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,Z.jsx)(wr,{skill:r,onOpenChange:O,onDeleted:k}),e[9]=r,e[10]=A);let j=a?.skill??null,M=a?.existingNames??Rr,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,Z.jsx)(Ar,{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,Z.jsx)(Pr,{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,Z.jsx)(Or,{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,Z.jsx)(Dr,{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,Z.jsx)(Er,{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,Z.jsx)(kr,{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,Z.jsxs)(Z.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,ne,re;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}),ne=(e,t)=>h(t===void 0?{skill:e}:{skill:e,prefix:t}),re=(e,t)=>_({skill:e,editor:t}),e[39]=q,e[40]=J,e[41]=Y,e[42]=te,e[43]=ne,e[44]=re):(q=e[39],J=e[40],Y=e[41],te=e[42],ne=e[43],re=e[44]);let ie;return e[45]!==ee||e[46]!==D||e[47]!==x||e[48]!==v?(ie={installingName:v,install:x,convertLocations:C,runLocationWrite:T,duplicate:D,requestDelete:i,requestRename:q,requestScopeMove:J,requestFileRename:Y,requestFileDelete:te,requestFileCreate:ne,requestForkResolve:re,dialogs:ee},e[45]=ee,e[46]=D,e[47]=x,e[48]=v,e[49]=ie):ie=e[49],ie}function Ir(e){return e.map(Lr).join(`, `)}function Lr(e){return ue[e]??e}var Rr=new Set;function zr(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,Z.jsx)(tt,{"aria-hidden":!0}),c=Nt(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,Z.jsxs)(Mn,{menuKind:i,onSelect:o,children:[s,c]}),t[4]=i,t[5]=o,t[6]=l):l=t[6],l}function Br(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?`${lt(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=lt(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 jt(e),X.success(l({id:`SXCSQd`}))}catch{X.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,Z.jsx)(kn,{"aria-hidden":!0}),v=(0,Z.jsx)(s,{id:`2wxgft`}),t[11]=_,t[12]=v):(_=t[11],v=t[12]);let y;t[13]!==o||t[14]!==g?(y=(0,Z.jsxs)(Mn,{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,Z.jsx)(zr,{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,Z.jsx)(et,{"aria-hidden":!0}),S=(0,Z.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,Z.jsxs)(Rn,{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,Z.jsx)(Mn,{menuKind:o,onSelect:()=>void h(d),children:(0,Z.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,Z.jsx)(s,{id:`xloBjn`}),t[30]=E):E=t[30];let D;t[31]!==o||t[32]!==T?(D=(0,Z.jsx)(Mn,{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,Z.jsxs)(jn,{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,Z.jsx)(Ln,{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,Z.jsxs)(In,{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,Z.jsxs)(jn,{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,Z.jsx)(Fn,{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,Z.jsx)(it,{"aria-hidden":!0}),F=(0,Z.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,Z.jsxs)(Mn,{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,Z.jsx)(jn,{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,Z.jsxs)(Z.Fragment,{children:[j,M,L]}),t[64]=j,t[65]=M,t[66]=L,t[67]=R):R=t[67],R}function Vr(e){let t=(0,$.c)(15),{skill:n,actions:r,existingNames:i,menuKind:a}=e,o=a===void 0?`dropdown`:a,s=Ye(),c=m().states,{dispatch:l}=En(),u=typeof window<`u`?window.okDesktop:void 0,d;t[0]!==n.name||t[1]!==n.scope||t[2]!==s?(d=ln({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,Z.jsx)(fr,{input:f,installStates:c,dispatch:l}):(0,Z.jsx)(mr,{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 h;return t[9]!==r||t[10]!==i||t[11]!==o||t[12]!==n||t[13]!==p?(h=(0,Z.jsx)(Hr,{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]=h):h=t[14],h}function Hr(e){let t=(0,$.c)(124),{actions:n,existingNames:i,menuKind:a,openWithAi:o,skill:l}=e,{_:u}=c(),d=dt(),f=Xn(l,n),m=l.absolutePath,h;t[0]===u?h=t[1]:(h=async function(e){try{await jt(e),X.success(u({id:`SXCSQd`}))}catch{X.error(u({id:`cRHuuI`}))}},t[0]=u,t[1]=h);let g=h,_;t[2]!==m||t[3]!==a?(_=(0,Z.jsx)(zr,{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,Z.jsx)(et,{"aria-hidden":!0}),y=(0,Z.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,Z.jsxs)(Rn,{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,Z.jsx)(Mn,{menuKind:a,onSelect:()=>void g(m),children:(0,Z.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,Z.jsx)(s,{id:`xloBjn`}),t[16]=C):C=t[16];let w;t[17]!==a||t[18]!==S?(w=(0,Z.jsx)(Mn,{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,Z.jsxs)(jn,{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,Z.jsx)(Ln,{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,Z.jsxs)(In,{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,Z.jsxs)(jn,{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,Z.jsx)(Fn,{menuKind:a}),t[36]=a,t[37]=k);let A;t[38]!==n||t[39]!==i||t[40]!==l?(A=()=>void n.duplicate(l,i),t[38]=n,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,Z.jsx)(r,{"aria-hidden":!0}),M=(0,Z.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,Z.jsxs)(Mn,{menuKind:a,onSelect:A,children:[j,M]}),t[44]=a,t[45]=A,t[46]=N):N=t[46];let P;t[47]!==n||t[48]!==i||t[49]!==l?(P=()=>n.requestRename(l,i),t[47]=n,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,Z.jsx)(kn,{"aria-hidden":!0}),I=(0,Z.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,Z.jsxs)(Mn,{menuKind:a,onSelect:P,children:[F,I]}),t[53]=a,t[54]=P,t[55]=L):L=t[55];let R;t[56]!==n||t[57]!==l?(R=()=>n.requestFileCreate(l),t[56]=n,t[57]=l,t[58]=R):R=t[58];let z,B;t[59]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,Z.jsx)(p,{"aria-hidden":!0}),B=(0,Z.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,Z.jsxs)(Mn,{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,Z.jsx)(On,{"aria-hidden":!0}),U=(0,Z.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,Z.jsxs)(Rn,{menuKind:a,children:[H,U]}),t[66]=a,t[67]=W);let G;t[68]!==n||t[69]!==l?(G=e=>n.requestForkResolve(l,e),t[68]=n,t[69]=l,t[70]=G):G=t[70];let K;t[71]!==f||t[72]!==a||t[73]!==l||t[74]!==G?(K=(0,Z.jsx)(tr,{toggles:f,skill:l,menuKind:a,onResolveFork:G}),t[71]=f,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,Z.jsx)(jn,{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,Z.jsx)(Ln,{menuKind:a,className:Yn,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,Z.jsxs)(In,{menuKind:a,children:[W,q]}),t[82]=a,t[83]=W,t[84]=q,t[85]=J):J=t[85];let Y;t[86]!==n||t[87]!==l?(Y=()=>n.requestScopeMove(l,l.scope===`project`?`global`:`project`),t[86]=n,t[87]=l,t[88]=Y):Y=t[88];let te;t[89]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,Z.jsx)(Dn,{"aria-hidden":!0}),t[89]=te):te=t[89];let ne;t[90]!==d.global||t[91]!==d.project||t[92]!==l.scope?(ne=l.scope===`project`?(0,Z.jsx)(s,{id:`bpytj4`,values:{0:d.global}}):(0,Z.jsx)(s,{id:`bpytj4`,values:{0:d.project}}),t[90]=d.global,t[91]=d.project,t[92]=l.scope,t[93]=ne):ne=t[93];let re;t[94]!==a||t[95]!==Y||t[96]!==ne?(re=(0,Z.jsxs)(Mn,{menuKind:a,onSelect:Y,children:[te,ne]}),t[94]=a,t[95]=Y,t[96]=ne,t[97]=re):re=t[97];let ie;t[98]!==a||t[99]!==N||t[100]!==L||t[101]!==V||t[102]!==J||t[103]!==re?(ie=(0,Z.jsxs)(jn,{menuKind:a,children:[N,L,V,J,re]}),t[98]=a,t[99]=N,t[100]=L,t[101]=V,t[102]=J,t[103]=re,t[104]=ie):ie=t[104];let ae;t[105]===a?ae=t[106]:(ae=(0,Z.jsx)(Fn,{menuKind:a}),t[105]=a,t[106]=ae);let oe;t[107]!==n||t[108]!==l?(oe=()=>n.requestDelete(l),t[107]=n,t[108]=l,t[109]=oe):oe=t[109];let se,ce;t[110]===Symbol.for(`react.memo_cache_sentinel`)?(se=(0,Z.jsx)(it,{"aria-hidden":!0}),ce=(0,Z.jsx)(s,{id:`cnGeoo`}),t[110]=se,t[111]=ce):(se=t[110],ce=t[111]);let le;t[112]!==a||t[113]!==oe?(le=(0,Z.jsxs)(Mn,{menuKind:a,variant:`destructive`,onSelect:oe,children:[se,ce]}),t[112]=a,t[113]=oe,t[114]=le):le=t[114];let ue;t[115]!==a||t[116]!==le?(ue=(0,Z.jsx)(jn,{menuKind:a,children:le}),t[115]=a,t[116]=le,t[117]=ue):ue=t[117];let de;return t[118]!==O||t[119]!==k||t[120]!==ie||t[121]!==ae||t[122]!==ue?(de=(0,Z.jsxs)(Z.Fragment,{children:[O,k,ie,ae,ue]}),t[118]=O,t[119]=k,t[120]=ie,t[121]=ae,t[122]=ue,t[123]=de):de=t[123],de}export{Cn as C,nn as D,En as E,_n as S,xn as T,un as _,Pr as a,rn as b,mr as c,Yn as d,tr as f,Dn as g,An as h,Fr as i,fr as l,Kn as m,Br as n,yr as o,Xn as p,zr as r,xr as s,Vr as t,lr as u,on as v,sn as w,an as x,cn as y};
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{Tn as n,Wn as r,a as i,z as a}from"./DocumentContext-J495RUh0.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-Cypryz6Z.js";import{t as d}from"./utils-CPqDy6Hr.js";import{a as f,g as p,h as m,i as h,m as g,n as _,t as v}from"./ChangedOutsideBadge-J6l1plFR.js";import{t as y}from"./button-CA0dewJJ.js";import{i as b,n as x,t as S}from"./tooltip-DHXgxWLL.js";import{a as C,c as w,i as T,n as E,o as D,r as O,s as k,t as A}from"./dialog-R8GugqUq.js";import{a as j,c as M,i as N,l as P,n as F,o as I,s as L,u as R}from"./context-menu-D1MgERPo.js";import{a as z,d as B,f as V,i as H,n as U,o as W,p as G,u as K}from"./dropdown-menu-CLgDYkh1.js";import{t as ee}from"./label-B5yNUINo.js";import{S as q,a as J,f as Y,h as te,i as ne,m as re,n as ie,o as ae,p as oe,r as se,s as ce}from"./terminal-cli-display-CgJpdKCI.js";import{An as le,Bn as ue,Co as de,Fn as fe,Gt as pe,Hr as me,Ja as he,Kt as ge,Li as _e,Ln as ve,Mn as ye,Nn as be,Ot as xe,Rn as Se,Vt as Ce,dn as we,go as Te,jn as Ee,mn as De,on as Oe,ot as ke,pn as Ae,st as je,vo as Me,yo as Ne,zn as Pe}from"./dist-ILlrHFKs.js";import{i as Fe}from"./use-settings-route-DN0TWdfX.js";import{t as Ie}from"./dist-DUfEoSbR.js";import{n as X}from"./dist-B6jB2qbD2.js";import{f as Le,l as Re,m as ze,n as Be,p as Ve,r as He,s as Ue,u as We}from"./documents-events-CCW6R-r2.js";import{h as Ge}from"./use-apply-config-color-theme-BatIDUX7.js";import{t as Ke}from"./parse-api-error-DfesE4Y7.js";import{n as qe,t as Je}from"./workspace-paths-CKUFX0v6.js";import{t as Ye}from"./use-workspace-CNCW4CS8.js";import{t as Xe}from"./createLucideIcon-Bhw2PmPp.js";import{t as Ze}from"./RegisteredAgentIcon-BxpJAHOj.js";import{n as Qe,r as $e}from"./ManagedArtifactProperties-CeSsPfJA.js";import{n as et}from"./CopyButton-CKyZY1PL.js";import{t as tt}from"./folder-open-BTTec8yg.js";import{t as nt}from"./folder-CWlDik9N.js";import{t as rt}from"./list-plus-2r7_ATZj.js";import{t as it}from"./trash-2-BWJWOK8-.js";import{t as at}from"./input-BFt4qZaV.js";import{J as ot,q as st,x as ct}from"./navigation-targets-C1boWExT.js";import{a as lt,c as ut,f as dt,n as ft,r as pt}from"./skill-scope-8PP6d5Gw.js";import{t as mt}from"./badge-BYteLKha.js";import{C as ht,N as gt,a as _t,b as vt,j as yt,k as bt,m as xt,n as St,r as Ct,t as wt,u as Tt,w as Et,x as Dt,y as Ot}from"./skills-api-DQ0PK-8O.js";import{t as kt}from"./use-skills-C_HuRxth.js";import{t as At}from"./use-open-skill-CgnR7yXa.js";import{n as jt}from"./clipboard-adapter-DqemxSWT.js";import{t as Mt}from"./DiffView-BcZip7m3.js";import{n as Nt}from"./platform-labels-glrfxkSh.js";var Z=t(),Q=e(o(),1),$=l();function Pt(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 Ft(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=Ke(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:Ie._({id:`1vn0CI`})}}return!i||typeof i.status!=`string`?{ok:!1,reason:`parse-error`,message:Ie._({id:`NoY1k4`})}:i.status===`failed`?{ok:!1,reason:`build-failed`,message:i.buildError??Ie._({id:`MrUmCD`})}:{ok:!0,path:i.outputPath,handoffWarning:i.handoffError?.message}}}}function It(){if(typeof window>`u`)return null;let e=window.okDesktop?.skill;return e?Pt(e):Ft()}var Lt=`ok:skill:cowork:installed`,Rt=`1`,zt=250,Bt=`/api/skill/install-state`;function Vt(e){return`${Lt}:v${e}`}var Ht=new Map;async function Ut(e={},t={}){let n=t.force?`__force__`:`__default__`,r=Ht.get(n);if(r)return r;let i=Wt(e,t);return Ht.set(n,i),i.finally(()=>{Ht.get(n)===i&&Ht.delete(n)}),i}async function Wt(e,t){let n=e.installer===void 0?It():e.installer,r=Gt(e.storage),i=e.fetchSnapshot??qt,a=e.serverTimeoutMs??zt,o=null;if(!t.force){try{o=await Jt(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=Vt(o?.currentVersion??e.fallbackSkillVersion??Kt());if(!t.force&&r?.getItem(s)===Rt)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,Rt)}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 Gt(e){if(e!==void 0)return e;if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function Kt(){return typeof window>`u`?`unknown`:window.okDesktop?.appVersion??`unknown`}async function qt(){let e;try{e=await fetch(Bt,{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 Jt(e,t){return Promise.race([e,new Promise(e=>{setTimeout(()=>e(null),t)})])}function Yt(e){return Ut({},e)}function Xt(){return Ut({},{force:!0})}async function Zt(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 Qt(e,t={}){let n=t.fetch??globalThis.fetch.bind(globalThis);switch(e.target){case`claude-cowork`:return Zt({target:`claude-cowork`,url:we({mode:`cowork`},e)},n);case`claude-code`:return Zt({target:`claude-code`,url:we({mode:`code`},e)},n);case`codex`:return Zt({target:`codex`,url:Ae(e)},n);case`cursor`:return Zt({target:`cursor`,url:De(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 $t(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 en=`open-knowledge:agent-thread-launch`;function tn(e,t=typeof window>`u`?new EventTarget:window){t.dispatchEvent(new CustomEvent(en,{detail:e}))}function nn(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(en,n),()=>t.removeEventListener(en,n)}function rn(e){if(!e.docName||!e.workspace)return null;let t=Je(e.docName),{contentDir:n,pathSeparator:r}=e.workspace;return{docContext:{relativePath:t},projectDir:n,docPath:qe(n,t,r)}}function an(e){return e.workspace?.contentDir?{docContext:null,projectDir:e.workspace.contentDir,docPath:``}:null}function on(e){return e.workspace?.contentDir?{docContext:null,createDescription:e.description,createScenario:e.scenario,createMentions:e.mentions,projectDir:e.workspace.contentDir,docPath:``}:null}function sn(e){return te(e.installUrl).then(()=>void 0)}function cn(e){return!e.workspace?.contentDir||!e.folderRelativePath?null:{docContext:null,folderRelativePath:e.folderRelativePath,projectDir:e.workspace.contentDir,docPath:``}}function ln(e){return!e.workspace?.contentDir||!e.skillName?null:{docContext:null,skill:{name:e.skillName,scope:e.scope},projectDir:e.workspace.contentDir,docPath:``}}function un(e){if(!e.workspace?.contentDir)return null;let{contentDir:t,pathSeparator:n}=e.workspace;if(e.docName){let r=e.docRelativePath??Je(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:qe(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 dn(e){return`Opened in ${e}.`}function fn(e,t=1){return t>=3?Ie._({id:`bi2C2s`,values:{displayName:e}}):t===2?Ie._({id:`1J0c0X`,values:{displayName:e}}):Ie._({id:`Xs7IcT`,values:{displayName:e}})}function pn(e){return e>=3?null:e===2?Ie._({id:`Xp94R1`}):Ie._({id:`6gRgw8`})}function mn(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 hn(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 gn(e,t,n,r){return e.compose?Oe(hn(e.compose,t,n,r)):e.selection?ve({...e.selection,target:t,transport:r}):e.skill?Se(e.skill.name,e.skill.scope,n):e.ask?le(e.ask.relativePath,e.ask.instruction,n,t,r):_e(e.docContext===null?e.folderRelativePath?fe(e.folderRelativePath,n,e.instruction,r):e.createDescription===void 0?ye(n,e.instruction,r):Ee(e.createDescription,n,e.createScenario??`new-project`,e.createMentions??[],r):be(e.docContext.relativePath,n,e.instruction,r))}function _n(e,t){let n=typeof e.instruction==`string`&&e.instruction.trim()!==``;return e.compose!==void 0||e.createDescription!==void 0||n?`${ke} ${gn(e,pe[t].handoffTarget,!1,`terminal`)}`:Pe(e.docContext?.relativePath??null)}function vn(e){let t=typeof e.instruction==`string`&&e.instruction.trim()!==``;return e.compose!==void 0||e.createDescription!==void 0||t?`${je} ${gn(e,`claude-code`,!1,`terminal`)}`:ue(e.docContext?.relativePath??null)}function yn(e){let t=e.docContext?.relativePath;return typeof t!=`string`||t===``?null:t.replace(/\.(md|mdx)$/,``)}function bn(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 xn(e,t){tn({agentSource:t?.agent?.source??`registry`,agentId:t?.agent?.id??``,prompt:vn(e),docName:yn(e),titleHint:bn(e)})}async function Sn(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(Ie._({id:`wbpoGe`,values:{message:t}})),{ok:!1,reason:`dispatch-error`,detail:`install-error: ${t}`}}if(e.kind===`installed-now`)return n.toast.success(Ie._({id:`PezM4_`})),{ok:!0};if(e.kind===`install-failed`){let t=e.message??e.reason;return n.toast.error(Ie._({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:gn(t,e,n.autoOpen,`url`)},a=await n.dispatchHandoff(i),o=n.isElectronHost()?`electron`:`web`,s=n.now().toISOString(),c=t.compose,l=mn(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(dn(u));else{let i=pn(r),a=fn(u,r);i===null?n.toast.error(a):n.toast.error(a,{action:{label:i,onClick:()=>{Sn(e,t,n,r+1)}}})}return a}function Cn(e){return oe.find(t=>t.id===e)?.displayName??e}function wn(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function Tn(){return{dispatchHandoff:Qt,recordHandoff:$t,toast:{success:e=>{X.success(e)},error:(e,t)=>{X.error(e,t?{action:t.action}:void 0)}},now:()=>new Date,isElectronHost:()=>wn(),getDisplayName:Cn,ensureCoworkSkillInstalled:Yt,autoOpen:!0}}function En(){let e=(0,$.c)(2),{merged:t}=Ge(),n=t?.appearance?.preview?.autoOpen??!0,r;return e[0]===n?r=e[1]:(r={dispatch:(e,t)=>Sn(e,t,{...Tn(),autoOpen:n}),reinstallCoworkSkill:Xt},e[0]=n,e[1]=r),r}var Dn=Xe(`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`}]]),On=Xe(`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`}]]),kn=Xe(`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`}]]),An=Xe(`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 jn(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,Z.jsx)(N,{...r}):(0,Z.jsx)(H,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Mn(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,Z.jsx)(j,{...r}):(0,Z.jsx)(z,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Nn(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,Z.jsx)(F,{...r}):(0,Z.jsx)(U,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Pn(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,Z.jsx)(I,{...r}):(0,Z.jsx)(W,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Fn(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,Z.jsx)(L,{...r}):(0,Z.jsx)(K,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function In(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,Z.jsx)(M,{...r}):(0,Z.jsx)(B,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Ln(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,Z.jsx)(P,{...r}):(0,Z.jsx)(V,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Rn(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,Z.jsx)(R,{...r}):(0,Z.jsx)(G,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}var zn=Object.freeze({hosts:null,source:null}),Bn=new Map,Vn=new Map;function Hn(e,t){return`${e}:${t}`}function Un(e){return Bn.get(e)??zn}function Wn(e,t){let n=Vn.get(e)??new Set;return Vn.set(e,n),n.add(t),()=>{n.delete(t),n.size===0&&Vn.delete(e)}}function Gn(e,t){let n=Un(e),r={...n,...t};if(!(r.hosts===n.hosts&&r.source===n.source)){r.hosts===null&&r.source===null?Bn.delete(e):Bn.set(e,r);for(let t of Vn.get(e)??[])t()}}var Kn=Ce.options,qn=`.agents/`;function Jn({skill:e,allSkills:t,hostSet:n,sourceHostOverlay:r,linkMode:i}){let a=t=>e?`${ut(t,e.scope)}/${e.name}`:null,o=e!==void 0&&((e.hosts??[]).includes(`agents`)||t?.some(e=>e.hosts.includes(`agents`)||e.path.startsWith(qn))),s=e?.hostAliases??(e&&t!==null?Object.assign({},...t.filter(t=>t.scope===e.scope).map(e=>e.hostAliases??{})):{}),c=e?.installableEditors??(e&&t!==null?t.find(t=>t.scope===e.scope)?.installableEditors:void 0),l=c?new Set(c):null,u=(o?[`agents`,...Kn]:Kn).filter(e=>!(e in s)).filter(e=>e===`agents`||l===null||l.has(e)||n.has(e)),d=new Set(u.map(e=>a(e))),f=e?.scope===`global`?`~/`:``,p=e?.path?.includes(`/`)?`${f}${e.path.replace(/\/SKILL\.mdx?$/i,``)}`:null,m=p!==null&&!d.has(p)?p:null,h=m===null?r??e?.hosts?.[0]:void 0,g=new Set(e?.conflictHosts??[]),_=new Set(e?.driftPaths??[]),v=new Set(e?.symlinkedHosts??[]),y=[...[...n].filter(e=>e!==h&&!(e in s)&&!g.has(e)&&!e.includes(`/`)).map(e=>({target:e,display:a(e)??e,mode:v.has(e)?`link`:`copy`})),...(e?.customPlacements??[]).map(e=>({target:pt(e),display:`${f}${e.path}`,mode:e.mode}))],b=y.map(e=>e.mode),x=b.filter(e=>e===`link`).length,S=b.length===0?i?`link`:`copy`:x*2>=b.length?`link`:`copy`,C=new Map((e?.customPlacements??[]).map(e=>[pt(e),e])),w=new Set(C.keys());if(t!==null&&e){for(let n of t)if(n.scope===e.scope)for(let e of n.customPlacements??[]){let t=pt(e);t!==``&&w.add(t)}}return{pathFor:a,aliases:s,rows:u,sourceRow:m,sourceHost:h,conflicted:g,drifted:_,linked:v,expectedMode:S,convertible:y,customRootRows:e===void 0?[]:[...w].sort().map(t=>({root:t,display:`${f}${t}/${e.name}`,placed:C.get(t)??null})).filter(e=>!d.has(e.display)&&e.display!==p&&!(e.root in s))}}var Yn=`min-w-[24rem]`;function Xn(e,t){let n=(0,$.c)(45),r=t.installingName===e.name,i=(0,Q.useRef)(e),[a,o]=(0,Q.useState)(!1),s=(0,Q.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,Q.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,Q.useEffect)(u,d);let f=r||a,p;n[6]!==e.name||n[7]!==e.scope?(p=Hn(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=>Wn(m,e),g=()=>Un(m),n[9]=m,n[10]=h,n[11]=g);let _=(0,Q.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&&Gn(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,Q.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,Q.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,Q.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=Un(m).hosts;e&&[...e].sort().join(`,`)===j&&Gn(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,Q.useEffect)(M,N);let P=(0,Q.useRef)(null),F=(0,Q.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,Q.useEffect)(I,L);let R;n[31]!==t||n[32]!==m||n[33]!==e?(R=function(n,r){D.current=n,Gn(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(me));if(!r.ok){Gn(m,{hosts:null});return}D.current=[...r.hosts],Gn(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($n),n=e.installableEditors??Kn,r=Kn.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,()=>vt({scope:e.scope,name:e.name,dir:n,mode:r})).then(Qn)},unplaceAt(n){t.runLocationWrite(e,()=>yt({scope:e.scope,name:e.name,path:n})).then(Zn)},setSource(n){Gn(m,{source:n}),t.runLocationWrite(e,()=>bt({scope:e.scope,name:e.name,target:n})).then(e=>{e.ok||(Gn(m,{source:null}),X.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 Zn(e){e.ok||X.error(e.error)}function Qn(e){e.ok||X.error(e.error)}function $n(e){return!Kn.includes(e)}function er(e){let t=(0,$.c)(7),{hint:n,children:r}=e,i;t[0]===r?i=t[1]:(i=(0,Z.jsx)(b,{asChild:!0,children:r}),t[0]=r,t[1]=i);let a;t[2]===n?a=t[3]:(a=(0,Z.jsx)(x,{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,Z.jsxs)(S,{children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function tr(e){let t=(0,$.c)(69),{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,m=kt(),h,g,b,x,S,C,w;if(t[0]!==u||t[1]!==m.data||t[2]!==m.status||t[3]!==d||t[4]!==p||t[5]!==l||t[6]!==i||t[7]!==a||t[8]!==r||t[9]!==f||t[10]!==n){let{pathFor:e,aliases:o,rows:c,sourceRow:T,sourceHost:E,conflicted:D,drifted:O,linked:k,expectedMode:A,convertible:j,customRootRows:M}=Jn({skill:r,allSkills:m.status===`ready`?m.data:null,hostSet:d,sourceHostOverlay:n.sourceHost,linkMode:n.linkMode});b=A,g=j;let N=e=>ft(o,e),P=cr,F=e=>{let t=N(e);return t.length===0?!0:window.confirm(u({id:`Uobeu9`,values:{0:t.map(P).join(`, `),rootRel:e}}))},I;t[18]!==u||t[19]!==r?(I=(e,t)=>{let n=e.includes(`/`)?e:ut(e,r?.scope??`project`);return(0,Z.jsx)(er,{hint:u({id:`0dslv8`,values:{0:P(e),1:P(e),2:r?.name??``,poolRootRel:t,subRoot:n}}),children:(0,Z.jsx)(y,{variant:`ghost`,size:`sm`,className:`h-4 shrink-0 px-0`,"aria-label":u({id:`G6Lrs_`,values:{0:P(e)}}),onClick:i=>{i.preventDefault(),i.stopPropagation(),window.confirm(u({id:`iiqOKM`,values:{0:P(e),1:r.name,2:P(e),subRoot:n,poolRootRel:t}}))&&Dt({scope:r.scope,root:n,action:`unlink`,exclude:[r.name]}).then(e=>{e.ok?Ue():X.error(u({id:`PRgIJh`,values:{0:e.error,subRoot:n}}))})},"data-testid":`skill-audience-unfollow-${e}`,children:(0,Z.jsx)(_,{host:e,"aria-hidden":!0,className:`size-3.5`})})},e)},t[18]=u,t[19]=r,t[20]=I):I=t[20];let L=I;h=n.installing;let R=sr,z;t[21]!==u||t[22]!==a||t[23]!==n?(z=(e,t,r)=>{let i=r===`link`?`copy`:`link`;return(0,Z.jsx)(er,{hint:u(r===`link`?{id:`FeXcUS`,values:{display:t}}:{id:`ugQcJX`,values:{display:t}}),children:(0,Z.jsx)(y,{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,Z.jsx)(s,{id:`uUCrBv`}):(0,Z.jsx)(s,{id:`iaPtht`})})})},t[21]=u,t[22]=a,t[23]=n,t[24]=z):z=t[24];let B=z,V;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,Z.jsx)(s,{id:`npcziF`}),t[25]=V):V=t[25];let H;t[26]===u?H=t[27]:(H=u({id:`6f_UX4`}),t[26]=u,t[27]=H);let U;t[28]===p?U=t[29]:(U=()=>p(),t[28]=p,t[29]=U);let W;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,Z.jsx)(s,{id:`N40H-G`}),t[30]=W):W=t[30];let G;t[31]!==h||t[32]!==U?(G=(0,Z.jsx)(y,{variant:`ghost`,size:`sm`,className:`h-5 px-1.5 font-normal text-[11px] text-muted-foreground hover:text-foreground`,disabled:h,onClick:U,"data-testid":`skill-install-all`,children:W}),t[31]=h,t[32]=U,t[33]=G):G=t[33];let K;t[34]!==H||t[35]!==G?(K=(0,Z.jsx)(er,{hint:H,children:G}),t[34]=H,t[35]=G,t[36]=K):K=t[36],t[37]!==l||t[38]!==K?(x=(0,Z.jsxs)(Pn,{menuKind:l,className:`flex items-center justify-between gap-2`,children:[V,K]}),t[37]=l,t[38]=K,t[39]=x):x=t[39],S=T===null?null:(0,Z.jsx)(er,{hint:u({id:`pXB6SL`}),children:(0,Z.jsxs)(Nn,{menuKind:l,disabled:h,checked:!0,onSelect:or,"data-testid":`skill-source-row`,children:[(0,Z.jsx)(nt,{"aria-hidden":!0,className:`size-4 text-muted-foreground`}),(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,Z.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:T}),(()=>{let e=R(T).split(`/`).slice(0,-1).join(`/`),t=N(e);return t.length>0?(0,Z.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-source`,children:t.map(t=>L(t,e))}):null})(),(0,Z.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,Z.jsx)(s,{id:`tiFPjk`})})]})]})}),C=c.map(t=>{let a=e(t),o=t===`agents`?`.agents`:he[t],c=R(a).split(`/`).slice(0,-1).join(`/`),p=N(c);return(0,Z.jsx)(er,{hint:D.has(t)?u({id:`8HvJlU`,values:{0:a??o}}):t===E?a?u({id:`ssk6rl`,values:{path:a}}):o:d.has(t)?u(a?{id:`9ieZhu`,values:{path:a}}:{id:`n3T3EE`,values:{label:o}}):u(a?b===`link`?{id:`1LtA5r`,values:{path:a}}:{id:`opPbzN`,values:{path:a}}:{id:`Pp0Vgd`,values:{label:o}}),children:(0,Z.jsxs)(Nn,{menuKind:l,disabled:h,checked:d.has(t),onCheckedChange:e=>{D.has(t)||e===!0&&!F(c)||f(t,e===!0)},onSelect:ar,className:`group`,"data-testid":`skill-install-editor-${t}`,children:[(0,Z.jsx)(_,{host:t,"aria-hidden":!0,className:`size-4`}),(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,Z.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:a??o}),p.length>0?(0,Z.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-${t}`,children:p.map(e=>L(e,c))}):null,D.has(t)?(0,Z.jsx)(er,{hint:u({id:`_O7dJS`}),children:(0,Z.jsx)(y,{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:e=>{e.preventDefault(),i?.(t)},"data-testid":`skill-fork-chip-${t}`,children:(0,Z.jsx)(s,{id:`jng7Ko`})})}):t===E?(0,Z.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,Z.jsx)(s,{id:`tiFPjk`})}):d.has(t)&&r?.hosts?(0,Z.jsxs)(Z.Fragment,{children:[!h&&(k.has(t)?`link`:`copy`)!==b?B(t,a??o,k.has(t)?`link`:`copy`):null,(0,Z.jsx)(er,{hint:u({id:`nBgzKO`}),children:(0,Z.jsx)(y,{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:e=>{e.preventDefault(),e.stopPropagation(),n.setSource?.(t)},"data-testid":`skill-set-source-${t}`,children:(0,Z.jsx)(s,{id:`VNNRfN`})})})]}):null,!h&&O.has(R(a))?(0,Z.jsx)(er,{hint:u({id:`iz1LdD`}),children:(0,Z.jsx)(v,{testId:`skill-drift-${t}`})}):null]})]})},t)}),w=M.map(e=>(0,Z.jsx)(er,{hint:e.placed===null?u(b===`link`?{id:`ybWWR2`,values:{0:e.display}}:{id:`fDjZxw`,values:{0:e.display}}):u({id:`C0cll5`,values:{0:e.display}}),children:(0,Z.jsxs)(Nn,{menuKind:l,disabled:h,checked:e.placed!==null,onCheckedChange:t=>{if(t===!0&&e.placed===null){if(!F(e.root))return;n.placeAt(e.root,b)}else e.placed!==null&&n.unplaceAt?.(e.placed.path)},onSelect:ir,className:`group`,"data-testid":`skill-custom-root-${e.root}`,children:[e.root===`.agents/skills`?(0,Z.jsx)(_,{host:`agents`,"aria-hidden":!0,className:`size-4`}):(0,Z.jsx)(nt,{"aria-hidden":!0,className:`size-4 text-muted-foreground`}),(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,Z.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:e.display}),N(e.root).length>0?(0,Z.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-custom-${e.root}`,children:N(e.root).map(t=>L(t,e.root))}):null,!h&&e.placed!==null&&O.has(e.placed.path)?(0,Z.jsx)(er,{hint:u({id:`iz1LdD`}),children:(0,Z.jsx)(v,{testId:`skill-drift-custom-${e.root}`})}):e.placed===null?null:(0,Z.jsxs)(Z.Fragment,{children:[!h&&e.placed.mode!==b?B(e.root,e.display,e.placed.mode):null,(0,Z.jsx)(er,{hint:u({id:`nBgzKO`}),children:(0,Z.jsx)(y,{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,Z.jsx)(s,{id:`VNNRfN`})})})]})]})]})},e.root)),t[0]=u,t[1]=m.data,t[2]=m.status,t[3]=d,t[4]=p,t[5]=l,t[6]=i,t[7]=a,t[8]=r,t[9]=f,t[10]=n,t[11]=h,t[12]=g,t[13]=b,t[14]=x,t[15]=S,t[16]=C,t[17]=w}else h=t[11],g=t[12],b=t[13],x=t[14],S=t[15],C=t[16],w=t[17];let T;t[40]!==u||t[41]!==h||t[42]!==g||t[43]!==b||t[44]!==a||t[45]!==n?(T=g.length>0&&n.convertLocations?(0,Z.jsxs)(`div`,{className:`flex items-center gap-1 px-2 pt-1 pb-1.5`,children:[(0,Z.jsx)(y,{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=b===`link`?`copy`:`link`,r=g.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(rr).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:h,"data-testid":`skill-convert-all`,children:b===`link`?(0,Z.jsx)(s,{id:`rcJmK8`}):(0,Z.jsx)(s,{id:`LBv_TR`})}),(0,Z.jsx)(er,{hint:u({id:`0J6nhG`}),children:(0,Z.jsx)(y,{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:nr,"data-testid":`skill-convert-all-help`,children:`?`})})]}):null,t[40]=u,t[41]=h,t[42]=g,t[43]=b,t[44]=a,t[45]=n,t[46]=T):T=t[46];let E;t[47]===l?E=t[48]:(E=(0,Z.jsx)(Fn,{menuKind:l}),t[47]=l,t[48]=E);let D;t[49]===u?D=t[50]:(D=u({id:`jqe7Yq`}),t[49]=u,t[50]=D);let O;t[51]===r?.scope?O=t[52]:(O=()=>{window.location.hash=r?.scope===`global`?`#settings/user-skills`:`#settings/skills`},t[51]=r?.scope,t[52]=O);let k,A;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,Z.jsx)(An,{"aria-hidden":!0}),A=(0,Z.jsx)(s,{id:`ZBF9fn`}),t[53]=k,t[54]=A):(k=t[53],A=t[54]);let j;t[55]!==l||t[56]!==O?(j=(0,Z.jsxs)(Mn,{menuKind:l,onSelect:O,children:[k,A]}),t[55]=l,t[56]=O,t[57]=j):j=t[57];let M;t[58]!==j||t[59]!==D?(M=(0,Z.jsx)(er,{hint:D,children:j}),t[58]=j,t[59]=D,t[60]=M):M=t[60];let N;return t[61]!==M||t[62]!==x||t[63]!==S||t[64]!==C||t[65]!==w||t[66]!==T||t[67]!==E?(N=(0,Z.jsxs)(Z.Fragment,{children:[x,S,C,w,T,E,M]}),t[61]=M,t[62]=x,t[63]=S,t[64]=C,t[65]=w,t[66]=T,t[67]=E,t[68]=N):N=t[68],N}function nr(e){return e.preventDefault()}function rr(e){return e.display}function ir(e){return e.preventDefault()}function ar(e){return e.preventDefault()}function or(e){return e.preventDefault()}function sr(e){return(e??``).replace(/^~\//,``)}function cr(e){return e===`agents`?`.agents`:he[e]??e}function lr(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,Z.jsx)(rt,{}),t[6]=h):h=t[6];let g;t[7]!==u||t[8]!==o?(g=u?(0,Z.jsx)(mt,{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,Z.jsxs)(b,{children:[h,g]}),t[10]=g,t[11]=_);let v;t[12]!==p||t[13]!==n||t[14]!==m||t[15]!==_?(v=(0,Z.jsx)(y,{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]=v):v=t[16];let C;t[17]!==u||t[18]!==a?(C=(0,Z.jsx)(x,{side:`bottom`,children:u?(0,Z.jsxs)(`span`,{className:`flex flex-col gap-0.5`,children:[(0,Z.jsx)(`span`,{className:`font-medium`,children:(0,Z.jsx)(s,{id:`AwrGuz`})}),a?.map(ur),(0,Z.jsx)(`span`,{className:`pt-0.5 opacity-70`,children:(0,Z.jsx)(s,{id:`yh5-4s`})})]}):(0,Z.jsx)(s,{id:`81H_23`})}),t[17]=u,t[18]=a,t[19]=C):C=t[19];let w;return t[20]!==v||t[21]!==C?(w=(0,Z.jsxs)(S,{children:[v,C]}),t[20]=v,t[21]=C,t[22]=w):w=t[22],w}function ur(e,t){return(0,Z.jsx)(`span`,{className:`opacity-90`,children:e},t)}function dr(e){return e?Ie._({id:`wTcjov`}):null}function fr(e){let t=(0,$.c)(46),{_:r}=c(),i=a(),o=g(),l=q(),d=Y();if(i)return null;let{input:f,installStates:p,dispatch:m}=e,h=f===null,_,v,y,b,x,S,C,w,T,E,D;if(t[0]!==r||t[1]!==m||t[2]!==f||t[3]!==h||t[4]!==p||t[5]!==d||t[6]!==l||t[7]!==o){let e=dr(h),i;t[19]===d?i=t[20]:(i=e=>J(d,e.id),t[19]=d,t[20]=i);let a=re.filter(i),c;t[21]===d?c=t[22]:(c=e=>ae(d,e.source,e.id,!0,e.supported),t[21]=d,t[22]=c);let u=l.filter(c),g=o?ge.filter(e=>ce(d,e,o.installedClis)):[];y=a.length>0,b=o!==null&&g.length>0,x=u.length>0,v=M,t[23]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Z.jsxs)(R,{children:[(0,Z.jsx)(n,{"aria-hidden":`true`}),(0,Z.jsx)(s,{id:`O7_W_a`})]}),t[23]=D):D=t[23],_=P,S=`max-h-80`,C=x?(0,Z.jsxs)(N,{"aria-label":r({id:`vPKX2i`}),children:[(0,Z.jsxs)(I,{className:`flex items-center gap-1.5`,children:[(0,Z.jsx)(s,{id:`RXEbZy`}),(0,Z.jsx)(ne,{})]}),u.map(t=>{let n=t.name;return(0,Z.jsxs)(j,{onSelect:()=>{f!==null&&xn(f,{agent:{source:t.source,id:t.id}})},disabled:h,"data-testid":`empty-space-open-in-thread-${t.id}`,"aria-label":e?r({id:`gtGQ9S`,values:{agentName:n,hint:e}}):void 0,children:[(0,Z.jsx)(Ze,{agentId:t.id,iconUrl:t.iconUrl,className:`size-4`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:(0,Z.jsx)(s,{id:`5PrrYw`,values:{agentName:n}})}),e?(0,Z.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,Z.jsx)(L,{}):null,t[24]=y,t[25]=b,t[26]=x,t[27]=w):w=t[27],T=b?(0,Z.jsxs)(N,{"aria-label":r({id:`ALhMYW`}),children:[(0,Z.jsx)(I,{children:(0,Z.jsx)(s,{id:`ALhMYW`})}),g.map(t=>{let{displayName:n}=pe[t];return(0,Z.jsxs)(j,{onSelect:()=>{f!==null&&o.launchInTerminal(f,t)},disabled:h,"data-testid":`empty-space-open-in-terminal-${t}`,"aria-label":r(e?{id:`AIn2Yv`,values:{displayName:n,hint:e}}:{id:`QYfQdv`,values:{displayName:n}}),children:[(0,Z.jsx)(se,{id:ie(t),"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:n}),e?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t)})]}):null,E=y?(0,Z.jsxs)(Z.Fragment,{children:[b?(0,Z.jsx)(L,{}):null,(0,Z.jsxs)(N,{"aria-label":r({id:`BBqGS9`}),children:[(0,Z.jsx)(I,{children:(0,Z.jsx)(s,{id:`BBqGS9`})}),a.map(t=>{let n=!h,{displayName:i}=t,a=r(e?{id:`1ZpfyB`,values:{displayName:i,hint:e}}:{id:`WqLq6M`,values:{displayName:i}});return(0,Z.jsxs)(j,{disabled:!n,onSelect:()=>{if(f){if(p[t.id]?.installed!==!0){sn(t);return}m(t.id,f)}},"data-testid":`empty-space-open-in-${t.id}`,"aria-label":a,children:[(0,Z.jsx)(se,{id:t.id,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:t.displayName}),e?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t.id)})]})]}):null,t[0]=r,t[1]=m,t[2]=f,t[3]=h,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,Z.jsx)(L,{}):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,Z.jsx)(u,{"aria-hidden":`true`}),t[32]=k):k=t[32];let A;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Z.jsxs)(j,{onSelect:Fe,"data-testid":`empty-space-open-in-settings`,children:[k,(0,Z.jsx)(`span`,{className:`flex-1`,children:(0,Z.jsx)(s,{id:`jRAGrQ`})})]}),t[33]=A):A=t[33];let F;t[34]!==_||t[35]!==S||t[36]!==C||t[37]!==w||t[38]!==T||t[39]!==E||t[40]!==O?(F=(0,Z.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]=F):F=t[41];let z;return t[42]!==v||t[43]!==D||t[44]!==F?(z=(0,Z.jsxs)(v,{children:[D,F]}),t[42]=v,t[43]=D,t[44]=F,t[45]=z):z=t[45],z}function pr(e){return e?Ie._({id:`wTcjov`}):null}function mr(e){let t=(0,$.c)(47),{_:r}=c(),i=a(),o=g(),l=q(),d=Y();if(i)return null;let{input:f,installStates:p,dispatch:m,onBeforeLaunch:h}=e,_=f===null,v,y,b,x,S,C,w,T,E,D,O;if(t[0]!==r||t[1]!==m||t[2]!==f||t[3]!==_||t[4]!==p||t[5]!==h||t[6]!==d||t[7]!==l||t[8]!==o){let e=pr(_),i;t[20]===d?i=t[21]:(i=e=>J(d,e.id),t[20]=d,t[21]=i);let a=re.filter(i),c;t[22]===d?c=t[23]:(c=e=>ae(d,e.source,e.id,!0,e.supported),t[22]=d,t[23]=c);let u=l.filter(c),g=o?ge.filter(e=>ce(d,e,o.installedClis)):[];b=a.length>0,x=o!==null&&g.length>0,S=u.length>0,y=B,t[24]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Z.jsxs)(G,{children:[(0,Z.jsx)(n,{"aria-hidden":`true`}),(0,Z.jsx)(s,{id:`O7_W_a`})]}),t[24]=O):O=t[24],v=V,C=`max-h-80`,w=S?(0,Z.jsxs)(H,{"aria-label":r({id:`vPKX2i`}),children:[(0,Z.jsxs)(W,{className:`flex items-center gap-1.5`,children:[(0,Z.jsx)(s,{id:`RXEbZy`}),(0,Z.jsx)(ne,{})]}),u.map(t=>{let n=t.name;return(0,Z.jsxs)(z,{onSelect:()=>{f!==null&&(h?.(),xn(f,{agent:{source:t.source,id:t.id}}))},disabled:_,"data-testid":`file-tree-open-in-thread-${t.id}`,"aria-label":e?r({id:`gtGQ9S`,values:{agentName:n,hint:e}}):void 0,children:[(0,Z.jsx)(Ze,{agentId:t.id,iconUrl:t.iconUrl,className:`size-4`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:(0,Z.jsx)(s,{id:`5PrrYw`,values:{agentName:n}})}),e?(0,Z.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,Z.jsx)(K,{}):null,t[25]=b,t[26]=x,t[27]=S,t[28]=T):T=t[28],E=x?(0,Z.jsxs)(H,{"aria-label":r({id:`ALhMYW`}),children:[(0,Z.jsx)(W,{children:(0,Z.jsx)(s,{id:`ALhMYW`})}),g.map(t=>{let{displayName:n}=pe[t];return(0,Z.jsxs)(z,{onSelect:()=>{f!==null&&(h?.(),o.launchInTerminal(f,t))},disabled:_,"data-testid":`file-tree-open-in-terminal-${t}`,"aria-label":r(e?{id:`AIn2Yv`,values:{displayName:n,hint:e}}:{id:`QYfQdv`,values:{displayName:n}}),children:[(0,Z.jsx)(se,{id:ie(t),"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:n}),e?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t)})]}):null,D=b?(0,Z.jsxs)(Z.Fragment,{children:[x?(0,Z.jsx)(K,{}):null,(0,Z.jsxs)(H,{"aria-label":r({id:`BBqGS9`}),children:[(0,Z.jsx)(W,{children:(0,Z.jsx)(s,{id:`BBqGS9`})}),a.map(t=>{let n=!_,{displayName:i}=t,a=r(e?{id:`1ZpfyB`,values:{displayName:i,hint:e}}:{id:`WqLq6M`,values:{displayName:i}});return(0,Z.jsxs)(z,{disabled:!n,onSelect:()=>{if(f){if(h?.(),p[t.id]?.installed!==!0){sn(t);return}m(t.id,f)}},"data-testid":`file-tree-open-in-${t.id}`,"aria-label":a,children:[(0,Z.jsx)(se,{id:t.id,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:t.displayName}),e?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t.id)})]})]}):null,t[0]=r,t[1]=m,t[2]=f,t[3]=_,t[4]=p,t[5]=h,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,Z.jsx)(K,{}):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,Z.jsx)(u,{"aria-hidden":`true`}),t[33]=A):A=t[33];let j;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Z.jsxs)(z,{onSelect:Fe,"data-testid":`file-tree-open-in-settings`,children:[A,(0,Z.jsx)(`span`,{className:`flex-1`,children:(0,Z.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,Z.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,Z.jsxs)(y,{children:[O,M]}),t[43]=y,t[44]=O,t[45]=M,t[46]=N):N=t[46],N}var hr=/^\.[A-Za-z0-9_-]+\/skills\/([^/]+)\/(.+)$/;function gr(e){let t=Ne(e);if(t)return{scope:`project`,name:t.name,rel:t.rel};let n=Te(e);if(n)return{scope:`global`,name:n.name,rel:n.rel};let r=Me(e);if(r?.kind===`skill`)return{scope:r.scope,name:r.name,rel:r.rel};let i=hr.exec(e);return i?{scope:`project`,name:i[1],rel:i[2]}:null}function _r(e,t,n){return e.filter(e=>{let r=ct(e);if(r.kind===`skill-file`)return r.scope===t&&r.name===n;if(r.kind!==`doc`)return!1;let i=gr(r.docName);return i?.scope===t&&i.name===n})}function vr(e,t,n){let r=st(t,n);return e.filter(e=>{let i=ct(e);return i.kind===`skill-file`?i.scope===t.scope&&i.name===t.name&&i.path===n:i.kind===`doc`&&i.docName===r})}function yr(e,t,n){let r=gr(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 st(i,a)===e?{skill:i,filePath:a}:null}function br(e,t,n=(e,t)=>Le(e,t)||Ve(e,t)){let r=new Map(t.map(e=>[`${e.scope}\u0000${e.name}`,e])),i=[],a=new Set;for(let t of e){let e=gr(t);e!==null&&e.rel===null&&a.add(`${e.scope}\u0000${e.name}`)}for(let t of e){let e=gr(t);if(!e||r.has(`${e.scope}\u0000${e.name}`))continue;let o=e.scope===`project`?`global`:`project`,s=r.get(`${o}\u0000${e.name}`);e.rel===null&&s!==void 0?i.push({kind:`retarget`,fromDocName:t,toDocName:ot(s)}):n(e.scope,e.name)||(s!==void 0&&!a.has(`${e.scope}\u0000${e.name}`)?(a.add(`${e.scope}\u0000${e.name}`),i.push({kind:`retarget`,fromDocName:t,toDocName:ot(s)})):i.push({kind:`close`,docName:t}))}return i}function xr(){let e=(0,$.c)(15),{openTabs:t,closeDocument:n}=i(),r=Qe(),a;e[0]===t?a=e[1]:(a=t.some(Cr),e[0]=t,e[1]=a);let o=a,s;e[2]===o?s=e[3]:(s={enabled:o},e[2]=o,e[3]=s);let c=kt(s),l=(0,Q.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(Sr).sort().join(``)}\u0002${ze()}`;if(l.current===i)return;l.current=i;let a=br(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,Q.useEffect)(u,d)}function Sr(e){return`${e.scope}\u0000${e.name}`}function Cr(e){return gr(e)!==null}function wr(e){let t=(0,$.c)(19),{skill:n,onOpenChange:r,onDeleted:a}=e,{_:o}=c(),{setSkillsSidebar:s,closeTabs:l,openTabs:u}=i(),[d,p]=(0,Q.useState)(!1),m;t[0]!==o||t[1]!==l||t[2]!==a||t[3]!==r||t[4]!==u||t[5]!==s?(m=async function(e){s(!0),p(!0);let t=await St(e.scope,e.name);if(p(!1),!t.ok){let{error:e}=t;X.error(o({id:`AtBdnD`,values:{error:e}}));return}X.success(o({id:`h9QFb9`,values:{0:e.name}})),l(_r(u,e.scope,e.name),{force:!0}),a(),r(!1)},t[0]=o,t[1]=l,t[2]=a,t[3]=r,t[4]=u,t[5]=s,t[6]=m):m=t[6];let g=m,_=n!==null,v;t[7]!==d||t[8]!==r?(v=e=>{!e&&!d&&r(!1)},t[7]=d,t[8]=r,t[9]=v):v=t[9];let y;t[10]!==o||t[11]!==d||t[12]!==g||t[13]!==n?(y=n?(0,Z.jsx)(h,{itemName:o({id:`ExUzM4`,values:{0:n.name}}),isSubmitting:d,onDelete:()=>g(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]=g,t[13]=n,t[14]=y):y=t[14];let b;return t[15]!==_||t[16]!==v||t[17]!==y?(b=(0,Z.jsx)(f,{open:_,onOpenChange:v,children:y}),t[15]=_,t[16]=v,t[17]=y,t[18]=b):b=t[18],b}function Tr(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 Er(e){let t=(0,$.c)(66),{target:n,onOpenChange:r}=e,{_:a}=c(),{openTarget:o}=i(),l=(0,Q.useId)(),[u,d]=(0,Q.useState)(``),[f,p]=(0,Q.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,v;if(t[2]!==h||t[3]!==g||t[4]!==_?(v=[h,g,_],t[2]=h,t[3]=g,t[4]=_,t[5]=v):v=t[5],(0,Q.useEffect)(m,v),!n)return null;let b,x,S,E;t[6]!==u||t[7]!==f?(E=u.trim(),x=E===``||!Tr(E),b=!x&&!f,S=E.includes(`/`)?E.split(`/`).slice(0,-1).join(`/`):null,t[6]=u,t[7]=f,t[8]=b,t[9]=x,t[10]=S,t[11]=E):(b=t[8],x=t[9],S=t[10],E=t[11]);let O=S,j;t[12]!==a||t[13]!==b||t[14]!==r||t[15]!==o||t[16]!==n||t[17]!==E?(j=async function(){if(!n||!b)return;p(!0);let e=/\.mdx?$/i.test(E),t=await gt({scope:n.skill.scope,name:n.skill.name,path:E,content:e?`# ${E.split(`/`).pop()?.replace(/\.mdx?$/i,``)??``}\n`:``});if(p(!1),!t.ok){X.error(a({id:`a_2_uB`,values:{0:t.error,trimmed:E}}));return}if(X.success(a({id:`MXSt4t`,values:{0:t.path}})),e){let e=st(n.skill,E);o({kind:`doc`,target:e,docName:e})}r(!1)},t[12]=a,t[13]=b,t[14]=r,t[15]=o,t[16]=n,t[17]=E,t[18]=j):j=t[18];let M=j,N;t[19]!==r||t[20]!==f?(N=e=>{!e&&!f&&r(!1)},t[19]=r,t[20]=f,t[21]=N):N=t[21];let P;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,Z.jsx)(w,{children:(0,Z.jsx)(s,{id:`wQvvZY`})}),t[22]=P):P=t[22];let F;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Z.jsxs)(k,{children:[P,(0,Z.jsx)(C,{children:(0,Z.jsx)(s,{id:`lM4c-I`})})]}),t[23]=F):F=t[23];let I;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,Z.jsx)(s,{id:`I6gXOa`}),t[24]=I):I=t[24];let L;t[25]===l?L=t[26]:(L=(0,Z.jsx)(ee,{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&&E!==``,B;t[28]===M?B=t[29]:(B=e=>{e.key===`Enter`&&M()},t[28]=M,t[29]=B);let V;t[30]!==l||t[31]!==u||t[32]!==z||t[33]!==B?(V=(0,Z.jsx)(at,{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]!==O||t[36]!==x||t[37]!==E?(H=x&&E!==``?(0,Z.jsx)(`p`,{className:`text-destructive text-xs`,children:(0,Z.jsx)(s,{id:`fVzizW`})}):O?(0,Z.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:(0,Z.jsx)(s,{id:`9lso1Y`,values:{folderPart:O},components:{0:(0,Z.jsx)(`span`,{className:`font-mono text-foreground/80`})}})}):null,t[35]=O,t[36]=x,t[37]=E,t[38]=H):H=t[38];let U;t[39]!==L||t[40]!==V||t[41]!==H?(U=(0,Z.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,Z.jsx)(s,{id:`dEgA5A`}),t[45]=G):G=t[45];let K;t[46]!==f||t[47]!==W?(K=(0,Z.jsx)(y,{variant:`outline`,onClick:W,disabled:f,children:G}),t[46]=f,t[47]=W,t[48]=K):K=t[48];let q;t[49]===M?q=t[50]:(q=()=>void M(),t[49]=M,t[50]=q);let J=!b,Y;t[51]===f?Y=t[52]:(Y=f?(0,Z.jsx)(s,{id:`E9bKSA`}):(0,Z.jsx)(s,{id:`hYgDIe`}),t[51]=f,t[52]=Y);let te;t[53]!==q||t[54]!==J||t[55]!==Y?(te=(0,Z.jsx)(y,{onClick:q,disabled:J,children:Y}),t[53]=q,t[54]=J,t[55]=Y,t[56]=te):te=t[56];let ne;t[57]!==K||t[58]!==te?(ne=(0,Z.jsxs)(D,{children:[K,te]}),t[57]=K,t[58]=te,t[59]=ne):ne=t[59];let re;t[60]!==U||t[61]!==ne?(re=(0,Z.jsxs)(T,{className:`sm:max-w-md`,children:[F,U,ne]}),t[60]=U,t[61]=ne,t[62]=re):re=t[62];let ie;return t[63]!==re||t[64]!==N?(ie=(0,Z.jsx)(A,{open:!0,onOpenChange:N,children:re}),t[63]=re,t[64]=N,t[65]=ie):ie=t[65],ie}function Dr(e){let t=(0,$.c)(18),{target:n,onOpenChange:r}=e,{_:a}=c(),{setSkillsSidebar:o,closeTabs:s,openTabs:l}=i(),[u,d]=(0,Q.useState)(!1),p;t[0]!==a||t[1]!==s||t[2]!==r||t[3]!==l||t[4]!==o?(p=async function(e){let{skill:t,filePath:n}=e;o(!0),d(!0);let i=await Ct({scope:t.scope,name:t.name,path:n});if(d(!1),!i.ok){X.error(a({id:`CBT70t`,values:{0:i.error}}));return}if(!i.existed){X.error(a({id:`q4efaG`,values:{filePath:n}})),r(!1);return}X.success(a({id:`gOmloS`,values:{filePath:n}})),s(vr(l,t,n),{force:!0}),r(!1)},t[0]=a,t[1]=s,t[2]=r,t[3]=l,t[4]=o,t[5]=p):p=t[5];let m=p,g=n!==null,_;t[6]!==u||t[7]!==r?(_=e=>{!e&&!u&&r(!1)},t[6]=u,t[7]=r,t[8]=_):_=t[8];let v;t[9]!==a||t[10]!==u||t[11]!==m||t[12]!==n?(v=n?(0,Z.jsx)(h,{itemName:a({id:`wZPUJx`,values:{0:n.filePath}}),isSubmitting:u,onDelete:()=>m(n),customDescription:a({id:`ppzof_`,values:{0:lt(n.skill.path),1:n.filePath,2:n.skill.name}})}):null,t[9]=a,t[10]=u,t[11]=m,t[12]=n,t[13]=v):v=t[13];let y;return t[14]!==g||t[15]!==_||t[16]!==v?(y=(0,Z.jsx)(f,{open:g,onOpenChange:_,children:v}),t[14]=g,t[15]=_,t[16]=v,t[17]=y):y=t[17],y}function Or(e){let t=(0,$.c)(64),{target:n,onOpenChange:r}=e,{_:i}=c(),a=Qe(),o=(0,Q.useId)(),[l,u]=(0,Q.useState)(``),[d,f]=(0,Q.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,Q.useEffect)(p,_),!n)return null;let v,b,x;t[6]!==l||t[7]!==n.filePath?(b=l.trim(),x=b===n.filePath,v=b===``||!Tr(b),t[6]=l,t[7]=n.filePath,t[8]=v,t[9]=b,t[10]=x):(v=t[8],b=t[9],x=t[10]);let S=v,E=!S&&!x&&!d,O;t[11]!==i||t[12]!==E||t[13]!==r||t[14]!==a||t[15]!==n||t[16]!==b?(O=async function(){if(!n||!E)return;f(!0);let e=await ht({scope:n.skill.scope,name:n.skill.name,from:n.filePath,to:b});if(f(!1),!e.ok){X.error(i({id:`11ukmX`,values:{0:e.error}}));return}e.fromDocName!==void 0&&e.toDocName!==void 0&&a(e.fromDocName,e.toDocName),X.success(i({id:`XszXjc`,values:{0:e.to}})),r(!1)},t[11]=i,t[12]=E,t[13]=r,t[14]=a,t[15]=n,t[16]=b,t[17]=O):O=t[17];let j=O,M;t[18]!==r||t[19]!==d?(M=e=>{!e&&!d&&r(!1)},t[18]=r,t[19]=d,t[20]=M):M=t[20];let N;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,Z.jsx)(w,{children:(0,Z.jsx)(s,{id:`yckias`})}),t[21]=N):N=t[21];let P;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,Z.jsxs)(k,{children:[N,(0,Z.jsx)(C,{children:(0,Z.jsx)(s,{id:`HzVAoz`})})]}),t[22]=P):P=t[22];let F;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Z.jsx)(s,{id:`I6gXOa`}),t[23]=F):F=t[23];let I;t[24]===o?I=t[25]:(I=(0,Z.jsx)(ee,{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]===j?z=t[28]:(z=e=>{e.key===`Enter`&&j()},t[27]=j,t[28]=z);let B;t[29]!==o||t[30]!==l||t[31]!==R||t[32]!==z?(B=(0,Z.jsx)(at,{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,Z.jsx)(`p`,{className:`text-destructive text-xs`,children:(0,Z.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,Z.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,Z.jsx)(s,{id:`dEgA5A`}),t[43]=W):W=t[43];let G;t[44]!==d||t[45]!==U?(G=(0,Z.jsx)(y,{variant:`outline`,onClick:U,disabled:d,children:W}),t[44]=d,t[45]=U,t[46]=G):G=t[46];let K;t[47]===j?K=t[48]:(K=()=>void j(),t[47]=j,t[48]=K);let q=!E,J;t[49]===d?J=t[50]:(J=d?(0,Z.jsx)(s,{id:`tHKQ6j`}):(0,Z.jsx)(s,{id:`2wxgft`}),t[49]=d,t[50]=J);let Y;t[51]!==K||t[52]!==q||t[53]!==J?(Y=(0,Z.jsx)(y,{onClick:K,disabled:q,children:J}),t[51]=K,t[52]=q,t[53]=J,t[54]=Y):Y=t[54];let te;t[55]!==G||t[56]!==Y?(te=(0,Z.jsxs)(D,{children:[G,Y]}),t[55]=G,t[56]=Y,t[57]=te):te=t[57];let ne;t[58]!==H||t[59]!==te?(ne=(0,Z.jsxs)(T,{className:`sm:max-w-md`,children:[P,H,te]}),t[58]=H,t[59]=te,t[60]=ne):ne=t[60];let re;return t[61]!==ne||t[62]!==M?(re=(0,Z.jsx)(A,{open:!0,onOpenChange:M,children:ne}),t[61]=ne,t[62]=M,t[63]=re):re=t[63],re}function kr(e){let t=(0,$.c)(59),{target:n,onOpenChange:r}=e,{_:i}=c(),a=(0,Q.useId)(),[o,l]=(0,Q.useState)(null),[u,d]=(0,Q.useState)(null),[f,p]=(0,Q.useState)(!1),[m,h]=(0,Q.useState)(!1),[g,_]=(0,Q.useState)(``),[v,b]=(0,Q.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}/${ut(t,e.scope)}/${e.name}`,o=new AbortController;for(let[t,n]of[[i,d],[a,l]])Tt({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,O=n?.skill.name,j=n?.editor,M;if(t[2]!==S||t[3]!==O||t[4]!==j?(M=[S,O,j],t[2]=S,t[3]=O,t[4]=j,t[5]=M):M=t[5],(0,Q.useEffect)(x,M),!n)return null;let{skill:N,editor:P}=n,F;t[6]!==i||t[7]!==P||t[8]!==r||t[9]!==N.name||t[10]!==N.scope||t[11]!==n||t[12]!==g?(F=async function(e){if(!n)return;b(!0);let t=await Et({scope:N.scope,name:N.name,editor:P,action:e,...e===`rename`?{toName:g.trim()}:{}});if(b(!1),!t.ok){X.error(i({id:`MIF36T`,values:{0:t.error}}));return}X.success(i(e===`align`?{id:`QKgePK`,values:{editor:P}}:e===`make-source`?{id:`It9oAP`,values:{editor:P}}:{id:`b2ezG_`,values:{0:g.trim()}})),r(!1)},t[6]=i,t[7]=P,t[8]=r,t[9]=N.name,t[10]=N.scope,t[11]=n,t[12]=g,t[13]=F):F=t[13];let I=F,L,R;t[14]!==N.name||t[15]!==g?(R=g.trim(),L=R===``||!xe.test(R)||R===N.name,t[14]=N.name,t[15]=g,t[16]=L,t[17]=R):(L=t[16],R=t[17]);let z=L,B;t[18]!==v||t[19]!==r?(B=e=>{!e&&!v&&r(!1)},t[18]=v,t[19]=r,t[20]=B):B=t[20];let V;t[21]!==P||t[22]!==N.name?(V=(0,Z.jsx)(w,{children:(0,Z.jsx)(s,{id:`q8aCbb`,values:{0:N.name,editor:P}})}),t[21]=P,t[22]=N.name,t[23]=V):V=t[23];let H;t[24]===P?H=t[25]:(H=(0,Z.jsx)(C,{children:(0,Z.jsx)(s,{id:`QASTNu`,values:{editor:P}})}),t[24]=P,t[25]=H);let U;t[26]!==H||t[27]!==V?(U=(0,Z.jsxs)(k,{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,Z.jsx)(Mt,{oldContent:u,newContent:o,layout:`unified`}):f?(0,Z.jsx)(`div`,{className:`flex min-h-56 items-center justify-center px-6 text-center text-muted-foreground text-sm`,children:(0,Z.jsx)(s,{id:`5BlXTD`})}):(0,Z.jsx)(`div`,{className:`flex min-h-56 items-center justify-center text-muted-foreground text-sm`,children:(0,Z.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]!==P||t[35]!==a||t[36]!==z||t[37]!==m||t[38]!==N.name||t[39]!==g||t[40]!==R?(G=m?(0,Z.jsxs)(`div`,{className:`mt-3 space-y-1.5`,children:[(0,Z.jsx)(ee,{htmlFor:a,children:(0,Z.jsx)(s,{id:`pSimwP`,values:{editor:P}})}),(0,Z.jsx)(at,{id:a,value:g,onChange:e=>_(e.target.value),placeholder:`${N.name}-${P}`,"aria-invalid":z&&R!==``,onKeyDown:e=>{e.key===`Enter`&&!z&&I(`rename`)}})]}):null,t[33]=I,t[34]=P,t[35]=a,t[36]=z,t[37]=m,t[38]=N.name,t[39]=g,t[40]=R,t[41]=G):G=t[41];let K;t[42]!==W||t[43]!==G?(K=(0,Z.jsxs)(E,{className:`min-h-0 flex-1 overflow-auto`,children:[W,G]}),t[42]=W,t[43]=G,t[44]=K):K=t[44];let q;t[45]!==I||t[46]!==v||t[47]!==P||t[48]!==z||t[49]!==m||t[50]!==N.name?(q=(0,Z.jsx)(D,{children:m?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(y,{variant:`outline`,onClick:()=>h(!1),disabled:v,children:(0,Z.jsx)(s,{id:`iH8pgl`})}),(0,Z.jsx)(y,{onClick:()=>void I(`rename`),disabled:v||z,children:(0,Z.jsx)(s,{id:`AT0e50`})})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(y,{variant:`outline`,onClick:()=>{_(`${N.name}-${P}`),h(!0)},disabled:v,children:(0,Z.jsx)(s,{id:`AT0e50`})}),(0,Z.jsx)(y,{variant:`outline`,onClick:()=>void I(`make-source`),disabled:v,children:(0,Z.jsx)(s,{id:`xWomUD`,values:{editor:P}})}),(0,Z.jsx)(y,{onClick:()=>void I(`align`),disabled:v,children:(0,Z.jsx)(s,{id:`PZn2LP`})})]})}),t[45]=I,t[46]=v,t[47]=P,t[48]=z,t[49]=m,t[50]=N.name,t[51]=q):q=t[51];let J;t[52]!==U||t[53]!==K||t[54]!==q?(J=(0,Z.jsxs)(T,{className:`flex max-h-[85vh] w-full max-w-3xl flex-col`,children:[U,K,q]}),t[52]=U,t[53]=K,t[54]=q,t[55]=J):J=t[55];let Y;return t[56]!==J||t[57]!==B?(Y=(0,Z.jsx)(A,{open:!0,onOpenChange:B,children:J}),t[56]=J,t[57]=B,t[58]=Y):Y=t[58],Y}function Ar(e){let t=(0,$.c)(75),{skill:n,existingNames:r,onOpenChange:i,onRenamed:a}=e,o=$e(),c=n!==null,l=(0,Q.useId)(),[u,d]=(0,Q.useState)(``),[f,p]=(0,Q.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,Q.useEffect)(m,_),!n)return null;let v,b,x,S,E,O;if(t[5]!==r||t[6]!==u||t[7]!==n.name){E=u.trim(),O=E===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),v=i,S=E.length>64,b=E===``||!xe.test(E)||S,x=!b&&!O&&r.has(E),t[5]=r,t[6]=u,t[7]=n.name,t[8]=v,t[9]=b,t[10]=x,t[11]=S,t[12]=E,t[13]=O}else v=t[8],b=t[9],x=t[10],S=t[11],E=t[12],O=t[13];let j=x,M=!b&&!j&&!O&&!f,N;t[17]!==M||t[18]!==i||t[19]!==a||t[20]!==o||t[21]!==n||t[22]!==E?(N=async function(){if(!n||!M)return;p(!0);let e=await o({scope:n.scope,name:n.name},E);p(!1),e.ok&&(a?.(E),i(!1))},t[17]=M,t[18]=i,t[19]=a,t[20]=o,t[21]=n,t[22]=E,t[23]=N):N=t[23];let P=N,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,Z.jsx)(w,{children:(0,Z.jsx)(s,{id:`dw_3cv`})}),t[26]=I):I=t[26];let L;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Z.jsxs)(k,{children:[I,(0,Z.jsx)(C,{children:(0,Z.jsx)(s,{id:`R9IDFz`})})]}),t[27]=L):L=t[27];let R;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,Z.jsx)(s,{id:`6YtxFj`}),t[28]=R):R=t[28];let z;t[29]===l?z=t[30]:(z=(0,Z.jsx)(ee,{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]===P?V=t[33]:(V=e=>{e.key===`Enter`&&P()},t[32]=P,t[33]=V);let H=b||j,U=b&&E!==``||j?`${l}-error`:void 0,W;t[34]!==l||t[35]!==u||t[36]!==V||t[37]!==H||t[38]!==U?(W=(0,Z.jsx)(at,{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]!==j||t[41]!==v||t[42]!==l||t[43]!==b||t[44]!==S||t[45]!==E?(G=b&&E!==``?(0,Z.jsx)(`p`,{id:`${l}-error`,className:`text-xs text-destructive`,children:v?(0,Z.jsx)(s,{id:`iUwpZI`,components:{0:(0,Z.jsx)(`code`,{className:`font-mono`})}}):S?(0,Z.jsx)(s,{id:`lK9c4T`}):(0,Z.jsx)(s,{id:`A50vr3`,components:{0:(0,Z.jsx)(`code`,{className:`font-mono`})}})}):j?(0,Z.jsx)(`p`,{id:`${l}-error`,className:`text-xs text-destructive`,children:(0,Z.jsx)(s,{id:`YJ1BTp`})}):null,t[40]=j,t[41]=v,t[42]=l,t[43]=b,t[44]=S,t[45]=E,t[46]=G):G=t[46];let K;t[47]!==z||t[48]!==W||t[49]!==G?(K=(0,Z.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 q;t[51]===i?q=t[52]:(q=()=>i(!1),t[51]=i,t[52]=q);let J;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,Z.jsx)(s,{id:`dEgA5A`}),t[53]=J):J=t[53];let Y;t[54]!==f||t[55]!==q?(Y=(0,Z.jsx)(y,{variant:`outline`,className:`font-mono uppercase`,onClick:q,disabled:f,children:J}),t[54]=f,t[55]=q,t[56]=Y):Y=t[56];let te;t[57]===P?te=t[58]:(te=()=>void P(),t[57]=P,t[58]=te);let ne=!M,re;t[59]===f?re=t[60]:(re=f?(0,Z.jsx)(s,{id:`tHKQ6j`}):(0,Z.jsx)(s,{id:`2wxgft`}),t[59]=f,t[60]=re);let ie;t[61]!==te||t[62]!==ne||t[63]!==re?(ie=(0,Z.jsx)(y,{onClick:te,disabled:ne,children:re}),t[61]=te,t[62]=ne,t[63]=re,t[64]=ie):ie=t[64];let ae;t[65]!==Y||t[66]!==ie?(ae=(0,Z.jsxs)(D,{children:[Y,ie]}),t[65]=Y,t[66]=ie,t[67]=ae):ae=t[67];let oe;t[68]!==K||t[69]!==ae?(oe=(0,Z.jsxs)(T,{children:[L,K,ae]}),t[68]=K,t[69]=ae,t[70]=oe):oe=t[70];let se;return t[71]!==c||t[72]!==oe||t[73]!==F?(se=(0,Z.jsx)(A,{open:c,onOpenChange:F,children:oe}),t[71]=c,t[72]=oe,t[73]=F,t[74]=se):se=t[74],se}function jr(){let e=(0,$.c)(7),{_:t}=c(),n=dt(),r=Qe(),{setSkillsSidebar:a,openTabs:o}=i(),s=kt(),l;return e[0]!==t||e[1]!==o||e[2]!==r||e[3]!==n||e[4]!==a||e[5]!==s?(l=async(e,i)=>{if(i===e.scope)return!1;He(e.scope,e.name),Be(e.scope,e.name);let c=await Ot({name:e.name,fromScope:e.scope,toScope:i});if(Re(e.scope,e.name),!c.ok)return We(e.scope,e.name),X.error(t({id:`07eGJB`,values:{0:c.error}})),!1;X.success(t({id:`yhI6P0`,values:{0:e.name,1:n[i]}}));let l=s.status===`ready`?s.data.find(t=>t.scope===e.scope&&t.name===e.name):void 0,u=o.map(Nr).filter(t=>{if(t.kind!==`doc`)return!1;let n=gr(t.docName);return n?.scope===e.scope&&n.name===e.name}),d=u.find(Mr)??u[0],f=d?.kind===`doc`?d.docName:l?ot(l):e.scope===`global`?de(e.scope,e.name):null,p=i===`project`&&c.path!==void 0?`${c.path.replace(/\/+$/,``)}/SKILL`:de(i,e.name);try{f!==null&&r(f,p)}catch(e){console.error(`[skill-move-scope] retarget failed after a successful move`,e)}return a(!0),We(e.scope,e.name),!0},e[0]=t,e[1]=o,e[2]=r,e[3]=n,e[4]=a,e[5]=s,e[6]=l):l=e[6],l}function Mr(e){return e.kind===`doc`&&gr(e.docName)?.rel===null}function Nr(e){return ct(e)}function Pr(e){let t=(0,$.c)(38),{target:n,onOpenChange:r}=e,i=dt(),a=jr(),[o,c]=(0,Q.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,Z.jsx)(w,{children:(0,Z.jsx)(s,{id:`SXEdCq`,values:{0:p}})}),t[3]=p,t[4]=m);let h=i[l],g=i[d],_=i[d],v;t[5]!==u||t[6]!==h||t[7]!==g||t[8]!==_?(v={0:h,1:g,2:_,name:u},t[5]=u,t[6]=h,t[7]=g,t[8]=_,t[9]=v):v=t[9];let b;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(b={0:(0,Z.jsx)(`code`,{className:`font-mono`})},t[10]=b):b=t[10];let x;t[11]===v?x=t[12]:(x=(0,Z.jsx)(C,{children:(0,Z.jsx)(s,{id:`7bIiJ7`,values:v,components:b})}),t[11]=v,t[12]=x);let S;t[13]!==m||t[14]!==x?(S=(0,Z.jsxs)(k,{children:[m,x]}),t[13]=m,t[14]=x,t[15]=S):S=t[15];let E;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,Z.jsx)(s,{id:`dEgA5A`}),t[16]=E):E=t[16];let j;t[17]===o?j=t[18]:(j=(0,Z.jsx)(O,{asChild:!0,children:(0,Z.jsx)(y,{variant:`outline`,disabled:o,children:E})}),t[17]=o,t[18]=j);let M;t[19]!==a||t[20]!==u||t[21]!==r||t[22]!==l||t[23]!==d?(M=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]=M):M=t[24];let N;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,Z.jsx)(s,{id:`QWdKwH`}),t[25]=N):N=t[25];let P;t[26]!==o||t[27]!==M?(P=(0,Z.jsx)(y,{"data-testid":`skill-scope-move-confirm`,disabled:o,onClick:M,children:N}),t[26]=o,t[27]=M,t[28]=P):P=t[28];let F;t[29]!==j||t[30]!==P?(F=(0,Z.jsxs)(D,{children:[j,P]}),t[29]=j,t[30]=P,t[31]=F):F=t[31];let I;t[32]!==S||t[33]!==F?(I=(0,Z.jsxs)(T,{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,Z.jsx)(A,{open:!0,onOpenChange:f,children:I}),t[35]=f,t[36]=I,t[37]=L):L=t[37],L}function Fr(){let e=(0,$.c)(50),{_:t}=c(),n=At(),[r,i]=(0,Q.useState)(null),[a,o]=(0,Q.useState)(null),[s,l]=(0,Q.useState)(null),[u,d]=(0,Q.useState)(null),[f,p]=(0,Q.useState)(null),[m,h]=(0,Q.useState)(null),[g,_]=(0,Q.useState)(null),[v,y]=(0,Q.useState)(null),b;e[0]===t?b=e[1]:(b=async function(e,n,r){y(e.name),He(e.scope,e.name);let i=await xt({scope:e.scope,name:e.name,...n?{targets:[...n]}:{},...r?.linkMode===void 0?{}:{linkMode:r.linkMode}});if(We(e.scope,e.name),y(null),!i.ok)return X.error(t({id:`Mj8R8K`,values:{0:i.error}})),i;let a=Ir,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 X.warning(u),i;if(s.length>0){let e=l(`scripts-present`);e&&X.warning(e);let t=l(`no-description`);t&&X.warning(t)}return i.hosts.length===0?X.success(t({id:`4pDZ2N`,values:{0:e.name}})):s.length>0&&c.length===0?X.success(t({id:`PPFQ3o`,values:{0:e.name,1:a(s)}})):c.length>0&&s.length===0?X.success(t({id:`OOIVJo`,values:{0:e.name,1:a(c)}})):s.length>0&&c.length>0?X.success(t({id:`OxplNM`,values:{0:e.name,1:a(s),2:a(c)}})):X.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),He(e.scope,e.name);for(let{target:n,mode:r}of t){let t=await wt({scope:e.scope,name:e.name,target:n,mode:r});if(!t.ok){X.error(t.error);break}}We(e.scope,e.name),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),He(e.scope,e.name);let n=await t();return We(e.scope,e.name),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 _t({scope:e.scope,name:e.name,existingNames:r});if(!i.ok){X.error(t({id:`UPjaXD`,values:{0:e.name,1:i.error}}));return}X.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,Z.jsx)(wr,{skill:r,onOpenChange:O,onDeleted:k}),e[9]=r,e[10]=A);let j=a?.skill??null,M=a?.existingNames??Rr,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,Z.jsx)(Ar,{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,Z.jsx)(Pr,{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,Z.jsx)(Or,{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,Z.jsx)(Dr,{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,Z.jsx)(Er,{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,Z.jsx)(kr,{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,Z.jsxs)(Z.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,ne,re;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}),ne=(e,t)=>h(t===void 0?{skill:e}:{skill:e,prefix:t}),re=(e,t)=>_({skill:e,editor:t}),e[39]=q,e[40]=J,e[41]=Y,e[42]=te,e[43]=ne,e[44]=re):(q=e[39],J=e[40],Y=e[41],te=e[42],ne=e[43],re=e[44]);let ie;return e[45]!==ee||e[46]!==D||e[47]!==x||e[48]!==v?(ie={installingName:v,install:x,convertLocations:C,runLocationWrite:T,duplicate:D,requestDelete:i,requestRename:q,requestScopeMove:J,requestFileRename:Y,requestFileDelete:te,requestFileCreate:ne,requestForkResolve:re,dialogs:ee},e[45]=ee,e[46]=D,e[47]=x,e[48]=v,e[49]=ie):ie=e[49],ie}function Ir(e){return e.map(Lr).join(`, `)}function Lr(e){return he[e]??e}var Rr=new Set;function zr(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,Z.jsx)(tt,{"aria-hidden":!0}),c=Nt(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,Z.jsxs)(Mn,{menuKind:i,onSelect:o,children:[s,c]}),t[4]=i,t[5]=o,t[6]=l):l=t[6],l}function Br(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?`${lt(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=lt(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 jt(e),X.success(l({id:`SXCSQd`}))}catch{X.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,Z.jsx)(kn,{"aria-hidden":!0}),v=(0,Z.jsx)(s,{id:`2wxgft`}),t[11]=_,t[12]=v):(_=t[11],v=t[12]);let y;t[13]!==o||t[14]!==g?(y=(0,Z.jsxs)(Mn,{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,Z.jsx)(zr,{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,Z.jsx)(et,{"aria-hidden":!0}),S=(0,Z.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,Z.jsxs)(Rn,{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,Z.jsx)(Mn,{menuKind:o,onSelect:()=>void h(d),children:(0,Z.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,Z.jsx)(s,{id:`xloBjn`}),t[30]=E):E=t[30];let D;t[31]!==o||t[32]!==T?(D=(0,Z.jsx)(Mn,{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,Z.jsxs)(jn,{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,Z.jsx)(Ln,{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,Z.jsxs)(In,{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,Z.jsxs)(jn,{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,Z.jsx)(Fn,{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,Z.jsx)(it,{"aria-hidden":!0}),F=(0,Z.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,Z.jsxs)(Mn,{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,Z.jsx)(jn,{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,Z.jsxs)(Z.Fragment,{children:[j,M,L]}),t[64]=j,t[65]=M,t[66]=L,t[67]=R):R=t[67],R}function Vr(e){let t=(0,$.c)(15),{skill:n,actions:r,existingNames:i,menuKind:a}=e,o=a===void 0?`dropdown`:a,s=Ye(),c=m().states,{dispatch:l}=En(),u=typeof window<`u`?window.okDesktop:void 0,d;t[0]!==n.name||t[1]!==n.scope||t[2]!==s?(d=ln({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,Z.jsx)(fr,{input:f,installStates:c,dispatch:l}):(0,Z.jsx)(mr,{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 h;return t[9]!==r||t[10]!==i||t[11]!==o||t[12]!==n||t[13]!==p?(h=(0,Z.jsx)(Hr,{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]=h):h=t[14],h}function Hr(e){let t=(0,$.c)(124),{actions:n,existingNames:i,menuKind:a,openWithAi:o,skill:l}=e,{_:u}=c(),d=dt(),f=Xn(l,n),m=l.absolutePath,h;t[0]===u?h=t[1]:(h=async function(e){try{await jt(e),X.success(u({id:`SXCSQd`}))}catch{X.error(u({id:`cRHuuI`}))}},t[0]=u,t[1]=h);let g=h,_;t[2]!==m||t[3]!==a?(_=(0,Z.jsx)(zr,{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,Z.jsx)(et,{"aria-hidden":!0}),y=(0,Z.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,Z.jsxs)(Rn,{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,Z.jsx)(Mn,{menuKind:a,onSelect:()=>void g(m),children:(0,Z.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,Z.jsx)(s,{id:`xloBjn`}),t[16]=C):C=t[16];let w;t[17]!==a||t[18]!==S?(w=(0,Z.jsx)(Mn,{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,Z.jsxs)(jn,{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,Z.jsx)(Ln,{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,Z.jsxs)(In,{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,Z.jsxs)(jn,{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,Z.jsx)(Fn,{menuKind:a}),t[36]=a,t[37]=k);let A;t[38]!==n||t[39]!==i||t[40]!==l?(A=()=>void n.duplicate(l,i),t[38]=n,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,Z.jsx)(r,{"aria-hidden":!0}),M=(0,Z.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,Z.jsxs)(Mn,{menuKind:a,onSelect:A,children:[j,M]}),t[44]=a,t[45]=A,t[46]=N):N=t[46];let P;t[47]!==n||t[48]!==i||t[49]!==l?(P=()=>n.requestRename(l,i),t[47]=n,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,Z.jsx)(kn,{"aria-hidden":!0}),I=(0,Z.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,Z.jsxs)(Mn,{menuKind:a,onSelect:P,children:[F,I]}),t[53]=a,t[54]=P,t[55]=L):L=t[55];let R;t[56]!==n||t[57]!==l?(R=()=>n.requestFileCreate(l),t[56]=n,t[57]=l,t[58]=R):R=t[58];let z,B;t[59]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,Z.jsx)(p,{"aria-hidden":!0}),B=(0,Z.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,Z.jsxs)(Mn,{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,Z.jsx)(On,{"aria-hidden":!0}),U=(0,Z.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,Z.jsxs)(Rn,{menuKind:a,children:[H,U]}),t[66]=a,t[67]=W);let G;t[68]!==n||t[69]!==l?(G=e=>n.requestForkResolve(l,e),t[68]=n,t[69]=l,t[70]=G):G=t[70];let K;t[71]!==f||t[72]!==a||t[73]!==l||t[74]!==G?(K=(0,Z.jsx)(tr,{toggles:f,skill:l,menuKind:a,onResolveFork:G}),t[71]=f,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,Z.jsx)(jn,{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,Z.jsx)(Ln,{menuKind:a,className:Yn,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,Z.jsxs)(In,{menuKind:a,children:[W,q]}),t[82]=a,t[83]=W,t[84]=q,t[85]=J):J=t[85];let Y;t[86]!==n||t[87]!==l?(Y=()=>n.requestScopeMove(l,l.scope===`project`?`global`:`project`),t[86]=n,t[87]=l,t[88]=Y):Y=t[88];let te;t[89]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,Z.jsx)(Dn,{"aria-hidden":!0}),t[89]=te):te=t[89];let ne;t[90]!==d.global||t[91]!==d.project||t[92]!==l.scope?(ne=l.scope===`project`?(0,Z.jsx)(s,{id:`bpytj4`,values:{0:d.global}}):(0,Z.jsx)(s,{id:`bpytj4`,values:{0:d.project}}),t[90]=d.global,t[91]=d.project,t[92]=l.scope,t[93]=ne):ne=t[93];let re;t[94]!==a||t[95]!==Y||t[96]!==ne?(re=(0,Z.jsxs)(Mn,{menuKind:a,onSelect:Y,children:[te,ne]}),t[94]=a,t[95]=Y,t[96]=ne,t[97]=re):re=t[97];let ie;t[98]!==a||t[99]!==N||t[100]!==L||t[101]!==V||t[102]!==J||t[103]!==re?(ie=(0,Z.jsxs)(jn,{menuKind:a,children:[N,L,V,J,re]}),t[98]=a,t[99]=N,t[100]=L,t[101]=V,t[102]=J,t[103]=re,t[104]=ie):ie=t[104];let ae;t[105]===a?ae=t[106]:(ae=(0,Z.jsx)(Fn,{menuKind:a}),t[105]=a,t[106]=ae);let oe;t[107]!==n||t[108]!==l?(oe=()=>n.requestDelete(l),t[107]=n,t[108]=l,t[109]=oe):oe=t[109];let se,ce;t[110]===Symbol.for(`react.memo_cache_sentinel`)?(se=(0,Z.jsx)(it,{"aria-hidden":!0}),ce=(0,Z.jsx)(s,{id:`cnGeoo`}),t[110]=se,t[111]=ce):(se=t[110],ce=t[111]);let le;t[112]!==a||t[113]!==oe?(le=(0,Z.jsxs)(Mn,{menuKind:a,variant:`destructive`,onSelect:oe,children:[se,ce]}),t[112]=a,t[113]=oe,t[114]=le):le=t[114];let ue;t[115]!==a||t[116]!==le?(ue=(0,Z.jsx)(jn,{menuKind:a,children:le}),t[115]=a,t[116]=le,t[117]=ue):ue=t[117];let de;return t[118]!==O||t[119]!==k||t[120]!==ie||t[121]!==ae||t[122]!==ue?(de=(0,Z.jsxs)(Z.Fragment,{children:[O,k,ie,ae,ue]}),t[118]=O,t[119]=k,t[120]=ie,t[121]=ae,t[122]=ue,t[123]=de):de=t[123],de}export{Cn as C,nn as D,En as E,_n as S,xn as T,un as _,Pr as a,rn as b,mr as c,Yn as d,tr as f,Dn as g,An as h,Fr as i,fr as l,Kn as m,Br as n,yr as o,Xn as p,zr as r,xr as s,Vr as t,lr as u,on as v,sn as w,an as x,cn as y};
@@ -1 +1 @@
1
- import{r as e}from"./dist-Nvb76hAm.js";import{Pa as t,Ua as n,Va as r,Vt as i,qa as a}from"./dist-GenOktAv.js";function o(e){return e.path.split(`/`).slice(0,-1).join(`/`)}var s=[`project`,`global`];function c(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 l(e){return e.startsWith(`open-knowledge-pack-`)?e.slice(a.length):e}function u(e){let t=e.path.replace(/\/SKILL\.mdx?$/i,``);return e.scope===`global`?`~/${t}`:t}function d(e){return e.replace(/^\/(?:Users|home)\/[^/]+/,`~`).replace(/^\/root/,`~`)}function f(e){let t=e.lastIndexOf(`/`);return t>0?e.slice(0,t):e}function p(){let{_:t}=e();return{project:t({id:`e0NrBM`}),global:t({id:`2GT3Hf`})}}function m(){let{_:t}=e();return{project:t({id:`Es3G-g`}),global:t({id:`fvrHin`})}}function h(e,i){if(e.includes(`/`))return i===`global`?`~/${e}`:e;let a=e===`agents`?t:(i===`global`?n:r)[e]??`.${e}/skills`;return i===`global`?`~/${a}`:a}function g(e,t){return!e||t===``?[]:Object.keys(e).filter(n=>e[n]===t)}function _(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=>h(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 v(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(u(e),t.has(e.hosts[0]??``));for(let n of e.hosts)i(`${h(n,e.scope)}/${e.name}`,t.has(n));for(let t of e.customPlacements??[])i(t.path,t.mode===`link`);return n}function y(e,t=e.hosts){let n=i.options,r=_(e);return[...t.includes(`agents`)?[`agents`]:[],...n.filter(e=>t.includes(e)||r.includes(e)),...(e.customPlacements??[]).map(e=>o(e))]}export{f as a,h as c,m as d,p as f,y as i,c as l,g as n,l as o,o as r,v as s,s as t,d as u};
1
+ import{r as e}from"./dist-Nvb76hAm.js";import{Ha as t,Vt as n,Ya as r,Za as i,to as a}from"./dist-ILlrHFKs.js";function o(e){return e.path.split(`/`).slice(0,-1).join(`/`)}var s=[`project`,`global`];function c(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 l(e){return e.startsWith(`open-knowledge-pack-`)?e.slice(a.length):e}function u(e){let t=e.path.replace(/\/SKILL\.mdx?$/i,``);return e.scope===`global`?`~/${t}`:t}function d(e){return e.replace(/^\/(?:Users|home)\/[^/]+/,`~`).replace(/^\/root/,`~`)}function f(e){let t=e.lastIndexOf(`/`);return t>0?e.slice(0,t):e}function p(){let{_:t}=e();return{project:t({id:`e0NrBM`}),global:t({id:`2GT3Hf`})}}function m(){let{_:t}=e();return{project:t({id:`Es3G-g`}),global:t({id:`fvrHin`})}}function h(e,n){if(e.includes(`/`))return n===`global`?`~/${e}`:e;let a=e===`agents`?t:(n===`global`?i:r)[e]??`.${e}/skills`;return n===`global`?`~/${a}`:a}function g(e,t){return!e||t===``?[]:Object.keys(e).filter(n=>e[n]===t)}function _(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=>h(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 v(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(u(e),t.has(e.hosts[0]??``));for(let n of e.hosts)i(`${h(n,e.scope)}/${e.name}`,t.has(n));for(let t of e.customPlacements??[])i(t.path,t.mode===`link`);return n}function y(e,t=e.hosts){let r=n.options,i=_(e);return[...t.includes(`agents`)?[`agents`]:[],...r.filter(e=>t.includes(e)||i.includes(e)),...(e.customPlacements??[]).map(e=>o(e))]}export{f as a,h as c,m as d,p as f,y as i,c as l,g as n,l as o,o as r,v as s,s as t,d as u};
@@ -1 +1 @@
1
- import{Ut as e}from"./dist-GenOktAv.js";import{t}from"./dist-DUfEoSbR.js";import{s as n}from"./documents-events-rgFBXE2Z.js";import{t as r}from"./parse-api-error-DfesE4Y7.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){return a(`/api/skills/publisher?source=${encodeURIComponent(e)}`)}async function m(e,t){return a(`/api/skills/discover?source=${encodeURIComponent(e)}`,t)}async function h(){return a(`/api/skills/installed`)}async function g(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 _(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 v(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 y(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 b(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 x(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 S(e){try{let r=x(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 C(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 w(e){try{let t=await fetch(`/api/skill/track-in-git`,{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.apply===!0&&n(),{ok:!0,line:r?.line??``,gitignorePath:r?.gitignorePath??`.gitignore`,applied:r?.applied===!0}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function T(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 E(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 D(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 O(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 k(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 A(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 j(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 M(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 N(e,t){return M({...e,signal:t}).then(e=>e.ok?{ok:!0,text:e.text}:{ok:!1,status:e.status})}async function P(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 F(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 I(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 L(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 R(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 z(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 B(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 V(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{w as A,k as C,_ as D,V as E,b as M,O as N,s as O,B as S,f as T,N as _,S as a,F as b,p as c,j as d,v as f,l as g,h,m as i,I as j,L as k,u as l,P as m,E as n,g as o,y as p,A as r,c as s,R as t,d as u,T as v,D as w,z as x,C as y};
1
+ import{Ut as e}from"./dist-ILlrHFKs.js";import{t}from"./dist-DUfEoSbR.js";import{s as n}from"./documents-events-CCW6R-r2.js";import{t as r}from"./parse-api-error-DfesE4Y7.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){return a(`/api/skills/publisher?source=${encodeURIComponent(e)}`)}async function m(e,t){return a(`/api/skills/discover?source=${encodeURIComponent(e)}`,t)}async function h(){return a(`/api/skills/installed`)}async function g(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 _(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 v(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 y(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 b(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 x(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 S(e){try{let r=x(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 C(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 w(e){try{let t=await fetch(`/api/skill/track-in-git`,{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.apply===!0&&n(),{ok:!0,line:r?.line??``,gitignorePath:r?.gitignorePath??`.gitignore`,applied:r?.applied===!0}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function T(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 E(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 D(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 O(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 k(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 A(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 j(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 M(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 N(e,t){return M({...e,signal:t}).then(e=>e.ok?{ok:!0,text:e.text}:{ok:!1,status:e.status})}async function P(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 F(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 I(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 L(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 R(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 z(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 B(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 V(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{w as A,k as C,_ as D,V as E,b as M,O as N,s as O,B as S,f as T,N as _,S as a,F as b,p as c,j as d,v as f,l as g,h,m as i,I as j,L as k,u as l,P as m,E as n,g as o,y as p,A as r,c as s,R as t,d as u,T as v,D as w,z as x,C as y};
@@ -1,2 +1,2 @@
1
- import{B as e}from"./CodeMirrorPropInput-Cydg0jHr.js";import{C as t,D as n,E as r,G as i,L as a,S as o,U as s,W as c,g as l,it as u,rt as d}from"./config-provider-DGQwNZtP.js";import{$ as f,At as p,Ct as m,Nt as h,Ot as g,Y as _,Z as v,et as y}from"./dist-DAqA-GDU.js";var b=class e{constructor(e,t){this.yanchor=e,this.yhead=t}toJSON(){return{yanchor:a(this.yanchor),yhead:a(this.yhead)}}static fromJSON(t){return new e(r(t.yanchor),r(t.yhead))}},x=class{constructor(e,t){this.ytext=e,this.awareness=t,this.undoManager=new l(e)}toYPos(e,t=0){return n(this.ytext,e,t)}fromYPos(e){let n=t(r(e),this.ytext.doc);if(n==null||n.type!==this.ytext)throw Error(`[y-codemirror] The position you want to retrieve was created by a different document`);return{pos:n.index,assoc:n.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?g.cursor(n.pos,n.assoc):g.range(t.pos,n.pos)}},S=p.define({combine(e){return e[e.length-1]}}),C=m.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{I as e}from"./CodeMirrorPropInput-DiDkBTg6.js";import{C as t,D as n,E as r,G as i,L as a,S as o,U as s,W as c,g as l,it as u,rt as d}from"./config-provider-B6fsarOv.js";import{$ as f,At as p,Ct as m,Nt as h,Ot as g,Y as _,Z as v,et as y}from"./dist-sSZdzHur.js";var b=class e{constructor(e,t){this.yanchor=e,this.yhead=t}toJSON(){return{yanchor:a(this.yanchor),yhead:a(this.yhead)}}static fromJSON(t){return new e(r(t.yanchor),r(t.yhead))}},x=class{constructor(e,t){this.ytext=e,this.awareness=t,this.undoManager=new l(e)}toYPos(e,t=0){return n(this.ytext,e,t)}fromYPos(e){let n=t(r(e),this.ytext.doc);if(n==null||n.type!==this.ytext)throw Error(`[y-codemirror] The position you want to retrieve was created by a different document`);return{pos:n.index,assoc:n.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?g.cursor(n.pos,n.assoc):g.range(t.pos,n.pos)}},S=p.define({combine(e){return e[e.length-1]}}),C=m.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=f.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=m.define(),O=class extends y{constructor(e,t){super(),this.color=e,this.name=t}toDOM(){return s(`span`,[i(`class`,`cm-ySelectionCaret`),i(`style`,`background-color: ${this.color}; border-color: ${this.color}`)],[c(`⁠`),s(`div`,[i(`class`,`cm-ySelectionCaretDot`)]),c(`⁠`),s(`div`,[i(`class`,`cm-ySelectionInfo`)],[c(this.name)]),c(`⁠`)])}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 i=this.conf.ytext,a=i.doc,s=this.conf.awareness,c=[],l=this.conf.awareness.getLocalState();if(l!=null){let t=e.view.hasFocus&&e.view.dom.ownerDocument.hasFocus(),a=t?e.state.selection.main:null,c=l.cursor==null?null:r(l.cursor.anchor),u=l.cursor==null?null:r(l.cursor.head);if(a!=null){let e=n(i,a.anchor),t=n(i,a.head);(l.cursor==null||!o(c,e)||!o(u,t))&&s.setLocalStateField(`cursor`,{anchor:e,head:t})}else l.cursor!=null&&t&&s.setLocalStateField(`cursor`,null)}s.getStates().forEach((n,r)=>{if(r===s.doc.clientID)return;let o=n.cursor;if(o==null||o.anchor==null||o.head==null)return;let l=t(o.anchor,a),f=t(o.head,a);if(l==null||f==null||l.type!==i||f.type!==i)return;let{color:p=`#30bced`,name:m=`Anonymous`}=n.user||{},h=n.user&&n.user.colorLight||p+`33`,g=u(l.index,f.index),v=d(l.index,f.index),y=e.view.state.doc.lineAt(g),b=e.view.state.doc.lineAt(v);if(y.number===b.number)c.push({from:g,to:v,value:_.mark({attributes:{style:`background-color: ${h}`},class:`cm-ySelection`})});else{c.push({from:g,to:y.from+y.length,value:_.mark({attributes:{style:`background-color: ${h}`},class:`cm-ySelection`})}),c.push({from:b.from,to:v,value:_.mark({attributes:{style:`background-color: ${h}`},class:`cm-ySelection`})});for(let t=y.number+1;t<b.number;t++){let n=e.view.state.doc.line(t).from;c.push({from:n,to:n,value:_.line({attributes:{style:`background-color: ${h}`,class:`cm-yLineSelection`}})})}}c.push({from:f.index,to:f.index,value:_.widget({side:f.index-l.index>0?-1:1,block:!1,widget:new O(p,m)})})}),this.decorations=_.set(c,!0)}},A=f.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=p.define({combine(e){return e[e.length-1]}});m.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=f.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 l(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-DHXgxWLL.js";import{Rr as ne}from"./dist-GenOktAv.js";import{t as re}from"./x-DS57FvHW.js";import{t as ie}from"./badge-DFX4S3a5.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-DHXgxWLL.js";import{Ur as ne}from"./dist-ILlrHFKs.js";import{t as re}from"./x-BaJrHZK_.js";import{t as ie}from"./badge-BYteLKha.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-CB3USVY1.js";import{s as t}from"./navigation-targets-iVnea4YK.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-DAh95jxf.js";import{s as t}from"./navigation-targets-C1boWExT.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 +1 @@
1
- import{n as e,t}from"./propagation-api-PBYTadVM.js";import{n}from"./startup-marks-Cdkh8q3E.js";import{getAppTracer as r}from"./telemetry-impl-Bvv5kEhb.js";var i;function a(){if(!i)try{let a=typeof window<`u`?window.okDesktop?.config.startupTraceparent:void 0;if(!a)return;let o=t.extract(e.active(),{traceparent:a}),s=r().startSpan(`ok.app-startup`,void 0,o);i=s,n(e=>{try{s.end(e)}catch{}i=void 0})}catch{}}export{a as initStartupTrace};
1
+ import{n as e,t}from"./propagation-api-PBYTadVM.js";import{n}from"./startup-marks-CTM7uDIJ.js";import{getAppTracer as r}from"./telemetry-impl-Bvv5kEhb.js";var i;function a(){if(!i)try{let a=typeof window<`u`?window.okDesktop?.config.startupTraceparent:void 0;if(!a)return;let o=t.extract(e.active(),{traceparent:a}),s=r().startSpan(`ok.app-startup`,void 0,o);i=s,n(e=>{try{s.end(e)}catch{}i=void 0})}catch{}}export{a as initStartupTrace};