@inkeep/open-knowledge 0.84.0-beta.0 → 0.84.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +71 -71
- package/dist/config-schema.json +4 -4
- package/dist/config.project.schema.json +1 -1
- package/dist/config.user.schema.json +4 -4
- package/dist/constants-CYVYQ2Ib.mjs +1 -0
- package/dist/{dist-BmMYmJrU.mjs → dist-Bc3_Wt6N.mjs} +487 -487
- package/dist/dist-CvUzxHSS.mjs +1 -0
- package/dist/index.d.mts +12 -3
- package/dist/index.mjs +213 -213
- package/dist/init-B1y8bkga.mjs +1 -0
- package/dist/{init-D29QcTZq.mjs → init-ZiC_qPS2.mjs} +59 -59
- package/dist/{launch-json-removal-5ndYNGXL.mjs → launch-json-removal-AkSL-k1w.mjs} +1 -1
- package/dist/loader-CQKOpKdM.mjs +1 -0
- package/dist/{loader-CUPoyzHp.mjs → loader-DXV01FEG.mjs} +1 -1
- package/dist/{md-manager-BGnqyqi1-BfETHApY.mjs → md-manager-BGnqyqi1-BTvqIsKE.mjs} +137 -137
- package/dist/{open-browser-BM0E2IrX.mjs → open-browser-tzVDF1eD.mjs} +1 -1
- package/dist/parse-worker.mjs +1 -1
- package/dist/preview-CXeJgzGh.mjs +1 -0
- package/dist/{preview-BfxmnsOn.mjs → preview-CfRTddxX.mjs} +1 -1
- package/dist/public/assets/AccountSection-DzdMuT_J.js +1 -0
- package/dist/public/assets/{ActivityModeContent-DZbyWBlo.js → ActivityModeContent-DoZnuYGa.js} +1 -1
- package/dist/public/assets/{AddPropertiesButton-DvtOOL5J.js → AddPropertiesButton-DD0OBA-l.js} +2 -2
- package/dist/public/assets/AgentConnectionsSection-uSC5Wl25.js +1 -0
- package/dist/public/assets/{AgentDiffPane-D9olUVts.js → AgentDiffPane-BDig4K3J.js} +1 -1
- package/dist/public/assets/{AgentIconCluster-BRpsTDMH.js → AgentIconCluster-Qf_VPGzc.js} +1 -1
- package/dist/public/assets/{AgentThreadClientBinder-BTlP3z2T.js → AgentThreadClientBinder-DEy57m8m.js} +1 -1
- package/dist/public/assets/AppMenubar-CnD-jxNS.js +1 -0
- package/dist/public/assets/{AttachmentsSection-DdqsNOtE.js → AttachmentsSection-BWJyVXgH.js} +1 -1
- package/dist/public/assets/{AuthModal-CkHLmy_N.js → AuthModal-SudaNBin.js} +1 -1
- package/dist/public/assets/{BugReportHistory-BPO915fE.js → BugReportHistory-DXLqvyNw.js} +1 -1
- package/dist/public/assets/{BugReportHistoryDialog-CY6vlR_h.js → BugReportHistoryDialog-CkyHUUkn.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-BTCkQ8gy.js → CodeMirrorPropInput-DrSmujd5.js} +1 -1
- package/dist/public/assets/{ConsentDialogBody-CGhUvR3J.js → ConsentDialogBody-BRj-qPxP.js} +1 -1
- package/dist/public/assets/{ContentRulesSection-BPc0bEex.js → ContentRulesSection-CffRuHfA.js} +1 -1
- package/dist/public/assets/{DiffViewBoundary-BVzts2c4.js → DiffViewBoundary-DyfPtl_S.js} +1 -1
- package/dist/public/assets/{DocumentContext-Cgpe7PUq.js → DocumentContext-D8TnLZMo.js} +1 -1
- package/dist/public/assets/{EditorModeToggle-8PbuUKPX.js → EditorModeToggle-DFb9s9P6.js} +1 -1
- package/dist/public/assets/{ExcalidrawDocEditor-DPjKh0Z6.js → ExcalidrawDocEditor-0C73ad4N.js} +1 -1
- package/dist/public/assets/FeedbackForm-BLpLr_CW.js +1 -0
- package/dist/public/assets/{GraphPanel-COpuyFxT.js → GraphPanel-K91KgPSG.js} +1 -1
- package/dist/public/assets/{ImageAttachments-By1ZcRNT.js → ImageAttachments-Dovmnniy.js} +1 -1
- package/dist/public/assets/{ImportSkillDialog-BRMCNFIO.js → ImportSkillDialog-CNeazF-G.js} +1 -1
- package/dist/public/assets/{LinkPreviewsSection-DrVzxhzA.js → LinkPreviewsSection-BH7oUnak.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-CYgb3HLw.js → LintConfigEditor-CBDD_tLD.js} +1 -1
- package/dist/public/assets/{LintingSection-DwEExyYA.js → LintingSection-BHt8QqtA.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-DevwE2aa.js +1 -0
- package/dist/public/assets/{ManagedArtifactProperties-Cejw-D7l.js → ManagedArtifactProperties-IjwB8-yG.js} +1 -1
- package/dist/public/assets/{MermaidDocEditor-TV8MQtbb.js → MermaidDocEditor-L8DaX5Id.js} +1 -1
- package/dist/public/assets/{NetworkAccessSection-G-tyEPOW.js → NetworkAccessSection-DnVCXfdh.js} +1 -1
- package/dist/public/assets/{OkignoreSection-DUIPj4Vl.js → OkignoreSection-CK7dC70g.js} +1 -1
- package/dist/public/assets/{PageListContext-CYKNvec7.js → PageListContext-aYEmqTv4.js} +1 -1
- package/dist/public/assets/{ProjectTemplatesSection-Ctdx9_AL.js → ProjectTemplatesSection-C1cqcdG5.js} +1 -1
- package/dist/public/assets/{PropertyDisplayRow-DULpBoN1.js → PropertyDisplayRow-i2I1A0Ba.js} +2 -2
- package/dist/public/assets/{PublishToGitHubDialog-BcpO5RKl.js → PublishToGitHubDialog-C9dpKyMf.js} +1 -1
- package/dist/public/assets/RegisteredAgentIcon-DjlAkIlP.js +1 -0
- package/dist/public/assets/ReportBugDialogBody-DLBMwSqE.js +3 -0
- package/dist/public/assets/{ReportBugMenuTrigger-DwuaKFu1.js → ReportBugMenuTrigger-AJRYHH_Y.js} +1 -1
- package/dist/public/assets/{SchemaConfigEditor-D79vqFmf.js → SchemaConfigEditor-C6HvOFuV.js} +1 -1
- package/dist/public/assets/{SearchSection-Dx8-C7aO.js → SearchSection-Cj1r4r7t.js} +1 -1
- package/dist/public/assets/SessionsHost-BIQfFpNX.js +2 -0
- package/dist/public/assets/{SettingsDialogBody-BmlfRDFb.js → SettingsDialogBody-CNDQb7sY.js} +2 -2
- package/dist/public/assets/{ShareReceiveMissDialog-0PE01E7W.js → ShareReceiveMissDialog-D9rmTdNf.js} +1 -1
- package/dist/public/assets/{SharingSection-BvdibR47.js → SharingSection-Bjl_f8Kj.js} +1 -1
- package/dist/public/assets/{SkillCostValue-Bajv3P86.js → SkillCostValue-Cxzi3vI1.js} +1 -1
- package/dist/public/assets/{SkillEditBanner-B0ZxQBAN.js → SkillEditBanner-VIoAHWvy.js} +1 -1
- package/dist/public/assets/{SkillForkDialog-BKGY1iRx.js → SkillForkDialog-bphSE5Zm.js} +1 -1
- package/dist/public/assets/{SkillInstallMenu-CuOKJ4_n.js → SkillInstallMenu-taqzd9mr.js} +1 -1
- package/dist/public/assets/{SkillOriginInline-BrUb4Fgy.js → SkillOriginInline-oYxSvlYQ.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-CT26YXuL.js → SkillToolbarControls-Bncu3tVe.js} +1 -1
- package/dist/public/assets/{SkillsManagerSection-dqXRCM3C.js → SkillsManagerSection-B5fmoY8R.js} +1 -1
- package/dist/public/assets/{SlidesPluginSection-Bk1073RP.js → SlidesPluginSection-gB_5IAe_.js} +1 -1
- package/dist/public/assets/{SlidesToolbarControls-D-0pa5F-.js → SlidesToolbarControls-DUmYa_3C.js} +1 -1
- package/dist/public/assets/{SourceEditor-DghQVHvX.js → SourceEditor-DPM24wFV.js} +1 -1
- package/dist/public/assets/{SpellingSettings-C3y5UjRC.js → SpellingSettings-BJoBhzez.js} +1 -1
- package/dist/public/assets/SyncSection-BXL3vVGV.js +1 -0
- package/dist/public/assets/SyncStatusBadge-BY0dbdUl.js +1 -0
- package/dist/public/assets/{TemplateRow-C8tLmbrb.js → TemplateRow-BxUG6C5_.js} +1 -1
- package/dist/public/assets/{TerminalLaunchContext-58PQDilg.js → TerminalLaunchContext-CJTkwtCs.js} +1 -1
- package/dist/public/assets/{TerminalPanel-DOYDhObX.js → TerminalPanel-DVlVrgmd.js} +1 -1
- package/dist/public/assets/{TerminalSection-BBA8y3S1.js → TerminalSection-C2iU1i4h.js} +1 -1
- package/dist/public/assets/{TerminalWindowApp-DFmcq1vG.js → TerminalWindowApp-Cl41lh1g.js} +1 -1
- package/dist/public/assets/{TextDocEditor-DxghXof_.js → TextDocEditor-Cfgoa8Ap.js} +1 -1
- package/dist/public/assets/{ThemePluginSection-rW_Rhi3t.js → ThemePluginSection-BK71Plgj.js} +1 -1
- package/dist/public/assets/{ThreadView-BcdaDwyX.js → ThreadView-EM0ArHvn.js} +3 -3
- package/dist/public/assets/{TimelineDiffPane-DbgES6nK.js → TimelineDiffPane-Bcrv-3ap.js} +1 -1
- package/dist/public/assets/{agent-connections-Bc1t_U_m.js → agent-connections-D2w6claM.js} +1 -1
- package/dist/public/assets/agent-registry-B4dxoiaL.js +1 -0
- package/dist/public/assets/{bridge-BqL-1MyE.js → bridge-DsUUjTsy.js} +1 -1
- package/dist/public/assets/{calendar-U3XIfpfI.js → calendar-B94KcaTl.js} +1 -1
- package/dist/public/assets/{card-CHd8wMSS.js → card-CBVFHVPp.js} +1 -1
- package/dist/public/assets/{catalog-nXBoyoEn.js → catalog-Bdh906tM.js} +1 -1
- package/dist/public/assets/{comment-chips-D7PAXgFJ.js → comment-chips-Dc9AyaeT.js} +1 -1
- package/dist/public/assets/{config-errors-DCSQBhyj.js → config-errors-tVoeK4OC.js} +1 -1
- package/dist/public/assets/{config-provider-DBgrt1kx.js → config-provider-BpDfgoSI.js} +1 -1
- package/dist/public/assets/config-schema-CQminH5Z.js +1 -0
- package/dist/public/assets/{constants-editors-05BNhhVl.js → constants-editors-DLxv8SuP.js} +1 -1
- package/dist/public/assets/constants-product-C4Nt9vD3.js +1 -0
- package/dist/public/assets/{css-color-to-hex-Dk3DSeEK.js → css-color-to-hex-D-oM_f97.js} +1 -1
- package/dist/public/assets/{doc-undo-manager-DGQuNlgn.js → doc-undo-manager-Cl0eevTV.js} +1 -1
- package/dist/public/assets/{documents-events-C04vpPEp.js → documents-events-C7Jq0Exs.js} +1 -1
- package/dist/public/assets/field-controls-DPAPGMXV.js +1 -0
- package/dist/public/assets/{field-controls-BqsFU6aY.js → field-controls-DpJXxyPk.js} +1 -1
- package/dist/public/assets/{folder-config-api-bwKmZWh2.js → folder-config-api-z8QlaVAB.js} +1 -1
- package/dist/public/assets/{frontmatter-tags-B7FS--Ga.js → frontmatter-tags-DIPhIb6q.js} +1 -1
- package/dist/public/assets/index-BMLZ69to.js +2205 -0
- package/dist/public/assets/{input-group-D_ozMCmW.js → input-group-CvtNBDpz.js} +1 -1
- package/dist/public/assets/{lint-config-client-C0cPUFg9.js → lint-config-client-Cj3Jt5m2.js} +1 -1
- package/dist/public/assets/{lint-plugins-24yMjYos.js → lint-plugins-RYXoVRXF.js} +1 -1
- package/dist/public/assets/{markdown-lint-DxrbxECW.js → markdown-lint-BVkEhglC.js} +1 -1
- package/dist/public/assets/{markdownlint-rule-browser-C-vo_WXw.js → markdownlint-rule-browser-ldRZcg6r.js} +1 -1
- package/dist/public/assets/messages-BGmazN_U.js +1 -0
- package/dist/public/assets/messages-B_44cpaN.js +1 -0
- package/dist/public/assets/messages-BcrGi_eE.js +1 -0
- package/dist/public/assets/messages-CLW4C_8a.js +1 -0
- package/dist/public/assets/messages-CfPKtrVG.js +1 -0
- package/dist/public/assets/messages-Cqjl8Mn1.js +1 -0
- package/dist/public/assets/messages-CrST-PfZ.js +1 -0
- package/dist/public/assets/messages-Crqxy7un.js +1 -0
- package/dist/public/assets/messages-Cs1spxzv.js +1 -0
- package/dist/public/assets/messages-D9RqT3Hq.js +1 -0
- package/dist/public/assets/messages-DNPfTsXY.js +1 -0
- package/dist/public/assets/messages-DidnvYXX.js +1 -0
- package/dist/public/assets/messages-VaXD108f.js +1 -0
- package/dist/public/assets/pending-receive-nav-store-CBvL7hAw.js +1 -0
- package/dist/public/assets/platform-labels-jdatkx8d.js +1 -0
- package/dist/public/assets/{preferred-session-events-DZS0rMoL.js → preferred-session-events-BMXrfZPQ.js} +1 -1
- package/dist/public/assets/{progress-BXjvg4DI.js → progress-76173s7V.js} +1 -1
- package/dist/public/assets/{project-paths-B82COK8C.js → project-paths-DhRV4pus.js} +1 -1
- package/dist/public/assets/{restart-collab-server-C16c-Ep9.js → restart-collab-server-BLCoCY2a.js} +1 -1
- package/dist/public/assets/saved-themes-client-CeB36dNr.js +1 -0
- package/dist/public/assets/{schema-section-eljmMDBb.js → schema-section-CYDmXwKv.js} +1 -1
- package/dist/public/assets/{schemas-api-BM3O7zA1.js → schemas-api-BbYGQuTW.js} +1 -1
- package/dist/public/assets/{schemas-cc1-hKlHTZpE.js → schemas-cc1-CR2ooa34.js} +1 -1
- package/dist/public/assets/{selection-context-C68gF2Oq.js → selection-context-BUZTIeDP.js} +1 -1
- package/dist/public/assets/{sign-in-terminal-events-Uy8J-zPE.js → sign-in-terminal-events-B_AuVu-u.js} +1 -1
- package/dist/public/assets/{skill-scope-CxuIje2Y.js → skill-scope-N3jmnGIX.js} +1 -1
- package/dist/public/assets/{skill-targets-schema-BqGbUdGW.js → skill-targets-schema-BujW07bM.js} +1 -1
- package/dist/public/assets/{skills-api-Cwv39pKK.js → skills-api-C4z5vWyd.js} +1 -1
- package/dist/public/assets/{src-COG_7U42.js → src-D7rCHhfK.js} +1 -1
- package/dist/public/assets/storage-scope-DSPgNqch.js +1 -0
- package/dist/public/assets/{tag-pill-input-DoehfrBo.js → tag-pill-input-C0Dbn5VR.js} +1 -1
- package/dist/public/assets/{terminal-launch-events-vPUm3fxK.js → terminal-launch-events-C-sad7ou.js} +1 -1
- package/dist/public/assets/{thread-client-BoGcOSf9.js → thread-client-CHIeG-eB.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-BKuWOIaA.js → typing-burst-detector-iu7L-hA6.js} +1 -1
- package/dist/public/assets/{uninstall-DiNfurw6.js → uninstall-D2-KYdsO.js} +1 -1
- package/dist/public/assets/{use-activity-panel-BgzoGLEn.js → use-activity-panel-WtogOEEi.js} +1 -1
- package/dist/public/assets/{use-apply-config-color-theme-DsCyuU3O.js → use-apply-config-color-theme-DiRXrQH-.js} +1 -1
- package/dist/public/assets/{use-apply-config-language-BvXQKexF.js → use-apply-config-language-COUD5OO7.js} +2 -2
- package/dist/public/assets/{use-collab-url-CEI12fca.js → use-collab-url-BPJukLUh.js} +1 -1
- package/dist/public/assets/{use-conflicts-CpABgIGI.js → use-conflicts-DgaZPKZv.js} +1 -1
- package/dist/public/assets/{use-git-sync-status-BQYF2F5Z.js → use-git-sync-status-BwJMuoUW.js} +1 -1
- package/dist/public/assets/use-installed-clis-DlMKIYvM.js +2 -0
- package/dist/public/assets/{use-live-xterm-theme-CkVAs5Ql.js → use-live-xterm-theme-D4uCjklq.js} +1 -1
- package/dist/public/assets/{use-open-skill-CDNmRdpj.js → use-open-skill-Bl-rypEG.js} +1 -1
- package/dist/public/assets/{use-semantic-search-status-BYu4PoVz.js → use-semantic-search-status-CrlWLidR.js} +1 -1
- package/dist/public/assets/{use-skill-origin-Be1NTkgW.js → use-skill-origin-E-sT1iHg.js} +1 -1
- package/dist/public/assets/{use-skill-targets-Cf23drqO.js → use-skill-targets-DtHz-14o.js} +1 -1
- package/dist/public/assets/{use-skills-gbn1t63C.js → use-skills-C6ZneXh8.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-CYPFWXCG.js → use-terminal-enabled-DeBsOZ1A.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-Cb24Bjqb.js → use-timeline-entry-diff-nEONCY6R.js} +1 -1
- package/dist/public/assets/{use-workspace-BafUpQnS.js → use-workspace-Dyz_XHeI.js} +1 -1
- package/dist/public/index.html +74 -74
- package/dist/public/uninstall.html +4 -4
- package/dist/registry-probes-DNaU56kl.mjs +17 -0
- package/dist/{removal-file-path-BdSClBgZ.mjs → removal-file-path-BuLpw6F5.mjs} +1 -1
- package/dist/{repair-launch-json-C-OCcoOV.mjs → repair-launch-json-CtAdQsRf.mjs} +1 -1
- package/dist/{repair-mcp-configs-Ck7wXNVg.mjs → repair-mcp-configs-Bfys7jKY.mjs} +1 -1
- package/dist/schemas/v0/config.project.schema.json +1 -1
- package/dist/schemas/v0/config.user.schema.json +4 -4
- package/dist/src-C6syC3v6.mjs +11 -0
- package/dist/src-LtjCkl-j.mjs +1 -0
- package/dist/start-BcbkXw2n.mjs +5 -0
- package/dist/start-DdmSNHh0.mjs +1 -0
- package/package.json +4 -4
- package/dist/constants-CJTSHFDQ.mjs +0 -1
- package/dist/dist-BUsVlOD-.mjs +0 -1
- package/dist/init-6eE8auCX.mjs +0 -1
- package/dist/loader-CisLPZPW.mjs +0 -1
- package/dist/preview-DQ-4J61L.mjs +0 -1
- package/dist/public/assets/AccountSection-BsoknTRm.js +0 -1
- package/dist/public/assets/AgentConnectionsSection-D_gmSJG4.js +0 -1
- package/dist/public/assets/AppMenubar-D7u5sV7t.js +0 -1
- package/dist/public/assets/FeedbackForm-w2RNhl0R.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-sO6f840l.js +0 -1
- package/dist/public/assets/RegisteredAgentIcon-Begcc-nC.js +0 -1
- package/dist/public/assets/ReportBugDialogBody-CPjEs_zr.js +0 -3
- package/dist/public/assets/SessionsHost-DhB6vMF-.js +0 -2
- package/dist/public/assets/SyncSection-DmMPCcrO.js +0 -1
- package/dist/public/assets/SyncStatusBadge-7CGaFHUk.js +0 -1
- package/dist/public/assets/agent-registry-3ko3YkCm.js +0 -1
- package/dist/public/assets/config-schema-xOnB5jc5.js +0 -1
- package/dist/public/assets/constants-product-DhAo-666.js +0 -1
- package/dist/public/assets/field-controls-CnF_w0df.js +0 -1
- package/dist/public/assets/index-C_8iI96N.js +0 -2205
- package/dist/public/assets/messages-9pu0eKMD.js +0 -1
- package/dist/public/assets/messages-BCv3uDH5.js +0 -1
- package/dist/public/assets/messages-BGib4TMp.js +0 -1
- package/dist/public/assets/messages-BOWt1g5R.js +0 -1
- package/dist/public/assets/messages-BtwWpZz0.js +0 -1
- package/dist/public/assets/messages-BtzlQnhk.js +0 -1
- package/dist/public/assets/messages-BxPgHAGT.js +0 -1
- package/dist/public/assets/messages-C_IQGWPh.js +0 -1
- package/dist/public/assets/messages-CgvGzWvU.js +0 -1
- package/dist/public/assets/messages-CmBBJ_lX.js +0 -1
- package/dist/public/assets/messages-D07eucGp.js +0 -1
- package/dist/public/assets/messages-DHQmHLsP.js +0 -1
- package/dist/public/assets/messages-R6IvK1vE.js +0 -1
- package/dist/public/assets/pending-receive-nav-store-ge0q0US7.js +0 -1
- package/dist/public/assets/platform-labels-CtgIRyUl.js +0 -1
- package/dist/public/assets/saved-themes-client-CmQnQ6kY.js +0 -1
- package/dist/public/assets/storage-scope-67lIepq6.js +0 -1
- package/dist/public/assets/use-installed-clis-CXwm5pk2.js +0 -2
- package/dist/registry-probes-NShX9Gbx.mjs +0 -17
- package/dist/src-BPKOub-z.mjs +0 -11
- package/dist/src-CZcP6UNX.mjs +0 -1
- package/dist/start-CPHxqFwe.mjs +0 -5
- package/dist/start-s51e4yCV.mjs +0 -1
- /package/dist/public/assets/{ChangedOutsideBadge-BB-SCUmw.js → ChangedOutsideBadge-Dzr-p6dI.js} +0 -0
- /package/dist/public/assets/{DeleteConfirmationDialog-DrwlL-Hc.js → DeleteConfirmationDialog-BXUDIZYO.js} +0 -0
- /package/dist/public/assets/{SkillModeBanner-DaZYmbfZ.js → SkillModeBanner-DcxGGSM7.js} +0 -0
- /package/dist/public/assets/{alert-BY4HHcfV.js → alert-rmEQg7oS.js} +0 -0
- /package/dist/public/assets/{format-Yv4YAHdV.js → format-INdUJq6M.js} +0 -0
- /package/dist/public/assets/{sortable.esm-DuJVOTXv.js → sortable.esm-k5B4BkZq.js} +0 -0
- /package/dist/public/assets/{textarea-qPZDtk8V.js → textarea-CWb90goJ.js} +0 -0
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
script above.
|
|
33
33
|
-->
|
|
34
34
|
<style>html { background-color: #fafafa } html.dark { background-color: #171717 }</style>
|
|
35
|
-
<script type="module" crossorigin src="./assets/uninstall-
|
|
35
|
+
<script type="module" crossorigin src="./assets/uninstall-D2-KYdsO.js"></script>
|
|
36
36
|
<link rel="modulepreload" crossorigin href="./assets/chunk-CYidjpOJ.js">
|
|
37
37
|
<link rel="modulepreload" crossorigin href="./assets/react-f2sANaYj.js">
|
|
38
38
|
<link rel="modulepreload" crossorigin href="./assets/react-dom-DPxgxlDT.js">
|
|
@@ -60,11 +60,11 @@
|
|
|
60
60
|
<link rel="modulepreload" crossorigin href="./assets/badge-DmdA1C7r.js">
|
|
61
61
|
<link rel="modulepreload" crossorigin href="./assets/button-DzgjsZzC.js">
|
|
62
62
|
<link rel="modulepreload" crossorigin href="./assets/input-C-Qm8YDT.js">
|
|
63
|
-
<link rel="modulepreload" crossorigin href="./assets/textarea-
|
|
63
|
+
<link rel="modulepreload" crossorigin href="./assets/textarea-CWb90goJ.js">
|
|
64
64
|
<link rel="modulepreload" crossorigin href="./assets/preload-helper-Chd9yIcd.js">
|
|
65
65
|
<link rel="modulepreload" crossorigin href="./assets/dist-BGzUo_18.js">
|
|
66
|
-
<link rel="modulepreload" crossorigin href="./assets/messages-
|
|
67
|
-
<link rel="modulepreload" crossorigin href="./assets/use-apply-config-language-
|
|
66
|
+
<link rel="modulepreload" crossorigin href="./assets/messages-D9RqT3Hq.js">
|
|
67
|
+
<link rel="modulepreload" crossorigin href="./assets/use-apply-config-language-COUD5OO7.js">
|
|
68
68
|
<link rel="stylesheet" crossorigin href="./assets/globals-B1rEv4ky.css">
|
|
69
69
|
</head>
|
|
70
70
|
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import{i as e,o as t,t as n}from"./rolldown-runtime-tZXQYakl.mjs";import{$d as r,Bc as i,Fc as a,La as o,Vu as s,Zd as c,bf as l,ef as u,gf as d,mf as f,nf as p,pf as m,sd as h,vf as g,xf as _,yf as v}from"./md-manager-BGnqyqi1-BTvqIsKE.mjs";import{$o as y,Do as ee,Ho as b,In as te,Qo as x,Xn as ne,as as re,dr as ie,ha as ae,is as S,m as oe}from"./dist-Bc3_Wt6N.mjs";import{$ as se,A as ce,J as le,M as C,O as w,P as ue,R as de,T as fe,X as T,at as pe,ct as me,d as he,dt as ge,f as _e,it as ve,j as ye,k as be,lt as xe,nt as Se,o as Ce,rt as we,tt as Te,v as Ee,w as De,x as Oe,y as ke}from"./init-ZiC_qPS2.mjs";import{t as Ae}from"./is-object-BGze3w87.mjs";import{t as je}from"./removal-file-path-BuLpw6F5.mjs";import{spawn as Me}from"node:child_process";import{basename as E,dirname as D,join as O,resolve as k,win32 as Ne}from"node:path";import{accessSync as Pe,constants as A,existsSync as j,lstatSync as M,mkdirSync as Fe,readFileSync as N,readdirSync as P,realpathSync as F,rmSync as Ie,rmdirSync as Le,statSync as I,unlinkSync as Re}from"node:fs";import{homedir as L}from"node:os";import{createHash as ze}from"node:crypto";import{isDeepStrictEqual as Be}from"node:util";import{setTimeout as Ve}from"node:timers/promises";var He=s();let Ue;function We(){return Ue}function Ge(e,t){if(t!==void 0&&t.length>0)return t;try{return ie(e)?.rootPath}catch{return}}function Ke(e){let t=Ge(e.cwd,e.configuredProjectName),n=te({name:`cli`,project:t});return Ue=n,n.info({command:e.command,cwd:e.cwd,project:t},`cli command started`),n}function R(){return i(a)}function z(){return d().keyringService}function B(e){try{e()}catch{}}var qe=class{backend=`keyring`;onKeychainRead;constructor(e){this.onKeychainRead=e}async get(e){let{Entry:t}=await import(`@napi-rs/keyring`),n;try{n=new t(z(),e).getPassword()}catch(t){return B(()=>this.onKeychainRead?.({kind:`read-error`,host:e,error:t instanceof Error?t.name:`unknown`})),null}if(n==null)return B(()=>this.onKeychainRead?.({kind:`absent`,host:e})),null;try{return JSON.parse(n)}catch{return B(()=>this.onKeychainRead?.({kind:`corrupt-entry`,host:e,error:`corrupt-entry`})),null}}async set(e,t,n,r){let{Entry:i}=await import(`@napi-rs/keyring`),a=new i(z(),e),o={login:t,token:n,...r};a.setPassword(JSON.stringify(o))}async clear(e){let{Entry:t}=await import(`@napi-rs/keyring`);try{new t(z(),e).deletePassword()}catch{}}},V=class{backend=`file`;authFile;constructor(e){this.authFile=e??O(y(),`auth.yml`)}read(){if(!j(this.authFile))return{};try{let e=N(this.authFile,`utf-8`);return(0,He.parse)(e)??{}}catch(e){let t=e instanceof Error?e.message:`unknown error`;return process.stderr.write(`[auth] Failed to parse ${this.authFile}: ${t}. Starting with empty credentials.\n`),{}}}write(e){let t=D(this.authFile);j(t)||Fe(t,{recursive:!0,mode:448}),x(this.authFile,(0,He.stringify)(e),{mode:384})}async get(e){return this.read()[e]??null}async set(e,t,n,r){let i=this.read();i[e]={login:t,token:n,...r},this.write(i)}async clear(e){let t=this.read();delete t[e],this.write(t)}},Je=class{backend=`keyring`;keychain;file;constructor(e,t){this.keychain=e,this.file=t}async get(e){let t=await this.keychain.get(e);if(t!=null)return t;let n=await this.file.get(e);if(n==null)return null;try{await this.keychain.set(e,n.login,n.token,{gitProtocol:n.gitProtocol,name:n.name,email:n.email}),await this.file.clear(e),process.stderr.write(`[auth] migrated ${e} credential from ${R()} to the OS keychain\n`)}catch{}return n}set(e,t,n,r){return this.keychain.set(e,t,n,r)}async clear(e){await this.keychain.clear(e),await this.file.get(e)!=null&&await this.file.clear(e)}};async function Ye(e,t){try{let{Entry:n}=await import(`@napi-rs/keyring`);return new n(z(),`__probe__`),process.stderr.write(`[auth] token storage: OS keychain
|
|
2
|
+
`),B(()=>t?.onBackendSelected?.({backend:`keyring`})),new Je(new qe(t?.onKeychainRead),new V(e))}catch(n){let r=n instanceof Error?`${n.name}: ${n.message}`:String(n);return process.stderr.write(`[auth] token storage: file (${R()}) — OS keychain unavailable: ${r}\n`),B(()=>t?.onBackendSelected?.({backend:`file`,reason:r})),new V(e)}}function Xe(e){let t=null;return function(){if(t)return t;let n=2e3;return t=(async()=>{let t=null,r=new Promise(r=>{t=setTimeout(()=>{process.stderr.write(`[auth] token storage: keyring init exceeded ${n}ms; falling back to file (${R()})\n`),r(new V(e))},n)});try{return await Promise.race([Ye(e),r])}catch{return new V(e)}finally{t!==null&&clearTimeout(t)}})(),t}}function Ze(e){let t=Xe(e);return{async get(e){let n=await(await t()).get(e);return n===null?null:{token:n.token,login:n.login}}}}function Qe(e){let t=Xe(e);return{backend:`file`,async get(e){return(await t()).get(e)},async set(e,n,r,i){return(await t()).set(e,n,r,i)},async clear(e){return(await t()).clear(e)}}}async function $e(e,t){let n=[],r=new V(t);await r.get(e)!=null&&(await r.clear(e),n.push(`file`));let i;try{let{Entry:t}=await import(`@napi-rs/keyring`);new t(z(),`__probe__`);let r,a=await new qe(e=>{e.kind===`read-error`&&(r=e.error??`read-error`)}).get(e);if(r!==void 0)i=r;else if(a!=null)try{new t(z(),e).deletePassword(),n.push(`keychain`)}catch(e){i=e instanceof Error?e.name:`delete-error`}}catch{}return{touched:n,keychainError:i}}function et(e){let t={...e};return delete t.ELECTRON_RUN_AS_NODE,t}function tt(e){let t=e?.code;return t===`ENOENT`||t===`EACCES`||t===`EPERM`?{ok:!1,reason:`not-installed`}:{ok:!1,reason:`spawn-error`}}function nt(e){return ee({detached:!0,stdio:`ignore`,shell:!1,env:et(e)})}function rt(e,t,n={}){let r=(n.spawn??Me)(e,[...t],nt(n.env??process.env));return r.unref(),r}function it(e,t,n={}){let r=n.spawn??Me,i=n.timeoutMs??2e3;return new Promise(a=>{let o=!1,s=e=>{o||(o=!0,a(e))},c=setTimeout(()=>s({ok:!1,reason:`timeout`}),i);try{let i=r(e,[...t],nt(n.env??process.env));i.once(`error`,e=>{clearTimeout(c),s(tt(e))}),i.once(`spawn`,()=>{clearTimeout(c),s({ok:!0})});try{i.unref()}catch{}}catch(e){clearTimeout(c),s(tt(e))}})}const at=m.stable.appId,ot=Object.keys(m),st=[`stable`,`beta`];function ct(e,t,n=e=>console.error(e)){try{return _(e,t)}catch(r){let i=_({...e,[f]:void 0},t);return n(`Treating this CLI as ${g(i)} for this command: ${r instanceof Error?r.message:String(r)}`),i}}function H(e){return st.includes(e)?st:[e,...st]}function lt(e){return e.bundlePath===void 0?null:{bundlePath:e.bundlePath,protocolScheme:m[e.product].protocolScheme}}function ut(){return{platform:process.platform,env:process.env,execPath:process.execPath,isTTY:process.stdout.isTTY,statSync:e=>{try{return I(e,{throwIfNoEntry:!1})??null}catch{return null}}}}function dt(e,t){if(e.env.ELECTRON_RUN_AS_NODE===`1`){let n=/(.+?\.app)\/Contents\/MacOS\//.exec(e.execPath);if(n?.[1]){let e=n[1];return{path:e,product:ot.find(t=>e.endsWith(`/${m[t].productName}.app`))??t}}}let n=e.homeDir??L();for(let r of H(t)){let{productName:t}=m[r];for(let i of[O(n,`Applications`),`/Applications`]){let n=O(i,`${t}.app`);if(ft(e,O(n,`Contents`,`MacOS`,t)))return{path:n,product:r}}}return null}function ft(e,t){try{let n=e.statSync(t);return n?typeof n.isFile==`function`&&n.isFile():!1}catch{return!1}}function pt(e,t){if(e.env.ELECTRON_RUN_AS_NODE===`1`){let t=ot.find(t=>e.execPath.toLowerCase().endsWith(`\\${v(m[t]).toLowerCase()}`));if(t)return{path:e.execPath,product:t}}let n=e.env.LOCALAPPDATA;if(n)for(let r of H(t))for(let t of l(m[r])){let i=Ne.join(n,`Programs`,t,v(m[r]));if(ft(e,i))return{path:i,product:r}}return null}function mt(e,t){if(e.env.ELECTRON_RUN_AS_NODE===`1`){let t=ot.find(t=>e.execPath.endsWith(`/${m[t].linuxExecutableName}`));if(t)return{path:e.execPath,product:t}}for(let n of H(t)){let{productName:t,linuxExecutableName:r}=m[n],i=`/opt/${t}/${r}`;if(ft(e,i))return{path:i,product:n}}return null}function ht(e){let t=ct(e.env,e.execPath,e.warn);if(e.env.OK_FORCE_BROWSER===`1`)return{available:!1,reason:`force-browser`,cliProduct:t};if(e.platform!==`darwin`&&e.platform!==`win32`&&e.platform!==`linux`)return{available:!1,reason:`unsupported-platform`,cliProduct:t};let n;try{n=e.platform===`darwin`?dt(e,t):e.platform===`win32`?pt(e,t):mt(e,t)}catch{return{available:!1,reason:`stat-error`,cliProduct:t}}if(!n)return{available:!1,reason:`no-bundle`,cliProduct:t};let r={bundlePath:n.path,product:n.product,cliProduct:t};return e.env.OK_FORCE_DESKTOP===`1`?{available:!0,reason:`available`,...r}:!(e.isTTY===!0||e.platform===`win32`&&e.isTTY===void 0&&!e.env.CI)||e.env.SSH_CONNECTION||e.env.SSH_TTY||e.platform===`linux`&&!e.env.DISPLAY&&!e.env.WAYLAND_DISPLAY?{available:!1,reason:`headless`,...r}:{available:!0,reason:`available`,...r}}function gt(e,t){let n=e.log??(e=>console.error(e)),r=e.platform??process.platform;if(t.bundlePath===void 0){n(`Desktop launch skipped: no resolved desktop executable (caller bug).`);return}let{productName:i}=m[t.product],[a]=m[t.cliProduct].cliCommandNames;n(`Launching ${i} desktop (use \`${a} start\` for the browser server, or \`OK_FORCE_BROWSER=1\` to always skip)`);let o=t.bundlePath;if(r===`darwin`){rt(`open`,[`-a`,o],{spawn:e.spawn});return}rt(o,[],{spawn:e.spawn})}function _t(e=`no-bundle`){switch(e){case`no-bundle`:return`Desktop app not found (checked the standard install locations for this OS). Install it from https://openknowledge.ai/download, or omit --mode for browser mode.`;case`darwin-only`:case`unsupported-platform`:return`Desktop app is not available on this platform. Use --mode=browser, or omit --mode for the server fallback.`;case`headless`:return`Desktop launch is gated in headless contexts (CI, SSH, non-TTY stdout). Set OK_FORCE_DESKTOP=1 to override, or use --mode=browser.`;case`force-browser`:return`OK_FORCE_BROWSER=1 is set — desktop dispatch is disabled. Unset it to use --mode=app.`;case`stat-error`:return`Failed to inspect the desktop install (filesystem error). Check permissions or use --mode=browser.`;case`available`:return`Desktop app appears available but launch dispatch did not fire (caller bug).`}}function U(e){return e.replace(/[\p{Cc}\p{Zl}\p{Zp}\p{Bidi_Control}\u200b\ufeff]/gu,e=>`\\u${e.charCodeAt(0).toString(16).padStart(4,`0`)}`)}function vt(e){return ze(`sha256`).update(e).digest(`hex`)}function W(e){return O(y(k(e)),`pi-trust`)}function yt(e,t){return O(W(e),vt(k(t)))}function bt(e,t,n){return O(yt(e,t),`${vt(n)}.json`)}var G=class extends Error{constructor(e,t,n,r){super(`Pi trust receipt at ${U(e)} ${U(t)}; ${U(n)}`,{cause:r}),this.name=`PiTrustReceiptError`}};function K(e,t,n){let r=n.code,i=n instanceof Error?n.message:String(n),a;switch(r){case`EACCES`:case`EPERM`:a=`check receipt and parent-directory permissions, then retry`;break;case`ENOENT`:a=`the location no longer exists; restore access to its expected location, then retry`;break;default:a=`check the path and available storage, then retry`}return new G(e,`could not ${t}: ${i}`,a,n)}function q(e){let t;try{t=M(e)}catch(t){if(t.code===`ENOENT`)return!1;throw K(e,`be inspected`,t)}if(!t.isDirectory())throw new G(e,`is not a regular directory`,`restore the intended receipt directory without a symlink, then retry`);return!0}function xt(e,t){return Object.keys(e).length===t.length&&t.every(t=>Object.hasOwn(e,t))}function St(e,t){if(!Ae(e)||!xt(e,[`version`,`cwd`,`configuredTrustPath`,`canonicalTrustPath`,`state`,`previous`])||e.version!==1||typeof e.cwd!=`string`||e.cwd!==k(e.cwd)||typeof e.configuredTrustPath!=`string`||e.configuredTrustPath!==k(e.configuredTrustPath)||typeof e.canonicalTrustPath!=`string`||e.canonicalTrustPath!==k(e.canonicalTrustPath)||e.state!==`pending`&&e.state!==`committed`||!Ae(e.previous))throw new G(t,`has invalid contents`,`restore a valid ownership record from a backup without guessing its trust decision, then retry`);let n;if(e.previous.present===!1&&xt(e.previous,[`present`]))n={present:!1};else if(e.previous.present===!0&&xt(e.previous,[`present`,`value`]))n={present:!0,value:e.previous.value};else throw new G(t,`has an invalid previous decision`,`restore the recorded previous decision from a backup without guessing its value, then retry`);return{version:1,cwd:e.cwd,configuredTrustPath:e.configuredTrustPath,canonicalTrustPath:e.canonicalTrustPath,state:e.state,previous:n}}function Ct(e,t,n){let r;try{r=M(n)}catch(e){throw K(n,`be inspected`,e)}if(!r.isFile())throw new G(n,`is not a regular file`,`restore the intended receipt as a regular file without a symlink, then retry`);let i;try{i=N(n,`utf8`)}catch(e){throw K(n,`be read`,e)}let a;try{a=JSON.parse(i)}catch(e){throw new G(n,`is not valid JSON`,`repair its JSON syntax without changing the recorded decision, then retry`,e)}let o=St(a,n);if(o.cwd!==k(t)||n!==bt(e,t,o.canonicalTrustPath))throw new G(n,`does not match its project or trust-store location`,`restore the ownership record to its original project and trust-store location, then retry`);return{path:n,record:o}}function wt(e,t){let{record:n,path:r}=t;for(let t of[W(e),yt(e,n.cwd)])if(!q(t))throw new G(t,`no longer exists`,`restore access to the expected receipt directory, then retry`);let i=Ct(e,n.cwd,r);if(!Be(i.record,n))throw new G(r,`changed while its trust decision was being updated`,`retry to read its current ownership record`);return i}function Tt(e,t,n,r,i){let a={version:1,cwd:k(t),configuredTrustPath:k(n),canonicalTrustPath:k(r),state:`pending`,previous:i},o=bt(e,a.cwd,a.canonicalTrustPath),s=`${JSON.stringify(a,null,2)}\n`;if(!Be(St(JSON.parse(s),o),a))throw new G(o,`cannot preserve the previous decision as JSON`,`provide the original decision as a JSON value before retrying`);q(W(e)),q(D(o));try{Fe(D(o),{recursive:!0,mode:448})}catch(e){throw K(D(o),`be created`,e)}let c;try{c=M(o,{throwIfNoEntry:!1})}catch(e){throw K(o,`be inspected`,e)}if(c)throw new G(o,`already exists`,`reconcile the existing ownership record before recording another grant`);try{x(o,s,{mode:384})}catch(e){throw K(o,`be written`,e)}return{path:o,record:a}}function Et(e,t){let n=wt(e,t);if(n.record.state!==`pending`)throw new G(n.path,`is already committed`,`use the current ownership record without committing it again`);let r={...n.record,state:`committed`};try{x(n.path,`${JSON.stringify(r,null,2)}\n`,{mode:384})}catch(e){throw K(n.path,`be committed`,e)}return{path:n.path,record:r}}function J(e,t){if(!q(W(e)))return[];let n=yt(e,t);if(!q(n))return[];let r;try{r=P(n).sort()}catch(e){throw K(n,`be listed`,e)}return r.filter(e=>/^[a-f0-9]{64}\.json$/.test(e)).map(r=>Ct(e,t,O(n,r)))}function Y(e,t){let n=wt(e,t);try{Re(n.path)}catch(e){throw K(n.path,`be removed after reconciling its grant`,e)}for(let t of[D(n.path),W(e)])try{Le(t)}catch(e){let n=e.code;if(n!==`ENOTEMPTY`&&n!==`EEXIST`&&n!==`ENOENT`)throw K(t,`be removed after reconciling its grant`,e)}}var Dt=n(((t,n)=>{var r=e(`constants`),i=process.cwd,a=null,o=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return a||=i.call(process),a};try{process.cwd()}catch{}if(typeof process.chdir==`function`){var s=process.chdir;process.chdir=function(e){a=null,s.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,s)}n.exports=c;function c(e){r.hasOwnProperty(`O_SYMLINK`)&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&t(e),e.lutimes||n(e),e.chown=s(e.chown),e.fchown=s(e.fchown),e.lchown=s(e.lchown),e.chmod=i(e.chmod),e.fchmod=i(e.fchmod),e.lchmod=i(e.lchmod),e.chownSync=c(e.chownSync),e.fchownSync=c(e.fchownSync),e.lchownSync=c(e.lchownSync),e.chmodSync=a(e.chmodSync),e.fchmodSync=a(e.fchmodSync),e.lchmodSync=a(e.lchmodSync),e.stat=l(e.stat),e.fstat=l(e.fstat),e.lstat=l(e.lstat),e.statSync=u(e.statSync),e.fstatSync=u(e.fstatSync),e.lstatSync=u(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(e,t,n){n&&process.nextTick(n)},e.lchmodSync=function(){}),e.chown&&!e.lchown&&(e.lchown=function(e,t,n,r){r&&process.nextTick(r)},e.lchownSync=function(){}),o===`win32`&&(e.rename=typeof e.rename==`function`?(function(t){function n(n,r,i){var a=Date.now(),o=0;t(n,r,function s(c){if(c&&(c.code===`EACCES`||c.code===`EPERM`||c.code===`EBUSY`)&&Date.now()-a<6e4){setTimeout(function(){e.stat(r,function(e,a){e&&e.code===`ENOENT`?t(n,r,s):i(c)})},o),o<100&&(o+=10);return}i&&i(c)})}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n})(e.rename):e.rename),e.read=typeof e.read==`function`?(function(t){function n(n,r,i,a,o,s){var c;if(s&&typeof s==`function`){var l=0;c=function(u,d,f){if(u&&u.code===`EAGAIN`&&l<10)return l++,t.call(e,n,r,i,a,o,c);s.apply(this,arguments)}}return t.call(e,n,r,i,a,o,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n})(e.read):e.read,e.readSync=typeof e.readSync==`function`?(function(t){return function(n,r,i,a,o){for(var s=0;;)try{return t.call(e,n,r,i,a,o)}catch(e){if(e.code===`EAGAIN`&&s<10){s++;continue}throw e}}})(e.readSync):e.readSync;function t(e){e.lchmod=function(t,n,i){e.open(t,r.O_WRONLY|r.O_SYMLINK,n,function(t,r){if(t){i&&i(t);return}e.fchmod(r,n,function(t){e.close(r,function(e){i&&i(t||e)})})})},e.lchmodSync=function(t,n){var i=e.openSync(t,r.O_WRONLY|r.O_SYMLINK,n),a=!0,o;try{o=e.fchmodSync(i,n),a=!1}finally{if(a)try{e.closeSync(i)}catch{}else e.closeSync(i)}return o}}function n(e){r.hasOwnProperty(`O_SYMLINK`)&&e.futimes?(e.lutimes=function(t,n,i,a){e.open(t,r.O_SYMLINK,function(t,r){if(t){a&&a(t);return}e.futimes(r,n,i,function(t){e.close(r,function(e){a&&a(t||e)})})})},e.lutimesSync=function(t,n,i){var a=e.openSync(t,r.O_SYMLINK),o,s=!0;try{o=e.futimesSync(a,n,i),s=!1}finally{if(s)try{e.closeSync(a)}catch{}else e.closeSync(a)}return o}):e.futimes&&(e.lutimes=function(e,t,n,r){r&&process.nextTick(r)},e.lutimesSync=function(){})}function i(t){return t&&function(n,r,i){return t.call(e,n,r,function(e){d(e)&&(e=null),i&&i.apply(this,arguments)})}}function a(t){return t&&function(n,r){try{return t.call(e,n,r)}catch(e){if(!d(e))throw e}}}function s(t){return t&&function(n,r,i,a){return t.call(e,n,r,i,function(e){d(e)&&(e=null),a&&a.apply(this,arguments)})}}function c(t){return t&&function(n,r,i){try{return t.call(e,n,r,i)}catch(e){if(!d(e))throw e}}}function l(t){return t&&function(n,r,i){typeof r==`function`&&(i=r,r=null);function a(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),i&&i.apply(this,arguments)}return r?t.call(e,n,r,a):t.call(e,n,a)}}function u(t){return t&&function(n,r){var i=r?t.call(e,n,r):t.call(e,n);return i&&(i.uid<0&&(i.uid+=4294967296),i.gid<0&&(i.gid+=4294967296)),i}}function d(e){return!e||e.code===`ENOSYS`||(!process.getuid||process.getuid()!==0)&&(e.code===`EINVAL`||e.code===`EPERM`)}}})),Ot=n(((t,n)=>{var r=e(`stream`).Stream;n.exports=i;function i(e){return{ReadStream:t,WriteStream:n};function t(n,i){if(!(this instanceof t))return new t(n,i);r.call(this);var a=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags=`r`,this.mode=438,this.bufferSize=65536,i||={};for(var o=Object.keys(i),s=0,c=o.length;s<c;s++){var l=o[s];this[l]=i[l]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!=`number`)throw TypeError(`start must be a Number`);if(this.end===void 0)this.end=1/0;else if(typeof this.end!=`number`)throw TypeError(`end must be a Number`);if(this.start>this.end)throw Error(`start must be <= end`);this.pos=this.start}if(this.fd!==null){process.nextTick(function(){a._read()});return}e.open(this.path,this.flags,this.mode,function(e,t){if(e){a.emit(`error`,e),a.readable=!1;return}a.fd=t,a.emit(`open`,t),a._read()})}function n(t,i){if(!(this instanceof n))return new n(t,i);r.call(this),this.path=t,this.fd=null,this.writable=!0,this.flags=`w`,this.encoding=`binary`,this.mode=438,this.bytesWritten=0,i||={};for(var a=Object.keys(i),o=0,s=a.length;o<s;o++){var c=a[o];this[c]=i[c]}if(this.start!==void 0){if(typeof this.start!=`number`)throw TypeError(`start must be a Number`);if(this.start<0)throw Error(`start must be >= zero`);this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}})),kt=n(((e,t)=>{t.exports=r;var n=Object.getPrototypeOf||function(e){return e.__proto__};function r(e){if(typeof e!=`object`||!e)return e;if(e instanceof Object)var t={__proto__:n(e)};else var t=Object.create(null);return Object.getOwnPropertyNames(e).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}),t}})),At=n(((t,n)=>{var r=e(`fs`),i=Dt(),a=Ot(),o=kt(),s=e(`util`),c,l;typeof Symbol==`function`&&typeof Symbol.for==`function`?(c=Symbol.for(`graceful-fs.queue`),l=Symbol.for(`graceful-fs.previous`)):(c=`___graceful-fs.queue`,l=`___graceful-fs.previous`);function u(){}function d(e,t){Object.defineProperty(e,c,{get:function(){return t}})}var f=u;s.debuglog?f=s.debuglog(`gfs4`):/\bgfs4\b/i.test(process.env.NODE_DEBUG||``)&&(f=function(){var e=s.format.apply(s,arguments);e=`GFS4: `+e.split(/\n/).join(`
|
|
3
|
+
GFS4: `),console.error(e)}),r[c]||(d(r,global[c]||[]),r.close=(function(e){function t(t,n){return e.call(r,t,function(e){e||g(),typeof n==`function`&&n.apply(this,arguments)})}return Object.defineProperty(t,l,{value:e}),t})(r.close),r.closeSync=(function(e){function t(t){e.apply(r,arguments),g()}return Object.defineProperty(t,l,{value:e}),t})(r.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||``)&&process.on(`exit`,function(){f(r[c]),e(`assert`).equal(r[c].length,0)})),global[c]||d(global,r[c]),n.exports=p(o(r)),process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!r.__patched&&(n.exports=p(r),r.__patched=!0);function p(e){i(e),e.gracefulify=p,e.createReadStream=re,e.createWriteStream=ie;var t=e.readFile;e.readFile=n;function n(e,n,r){return typeof n==`function`&&(r=n,n=null),i(e,n,r);function i(e,n,r,a){return t(e,n,function(t){t&&(t.code===`EMFILE`||t.code===`ENFILE`)?m([i,[e,n,r],t,a||Date.now(),Date.now()]):typeof r==`function`&&r.apply(this,arguments)})}}var r=e.writeFile;e.writeFile=o;function o(e,t,n,i){return typeof n==`function`&&(i=n,n=null),a(e,t,n,i);function a(e,t,n,i,o){return r(e,t,n,function(r){r&&(r.code===`EMFILE`||r.code===`ENFILE`)?m([a,[e,t,n,i],r,o||Date.now(),Date.now()]):typeof i==`function`&&i.apply(this,arguments)})}}var s=e.appendFile;s&&(e.appendFile=c);function c(e,t,n,r){return typeof n==`function`&&(r=n,n=null),i(e,t,n,r);function i(e,t,n,r,a){return s(e,t,n,function(o){o&&(o.code===`EMFILE`||o.code===`ENFILE`)?m([i,[e,t,n,r],o,a||Date.now(),Date.now()]):typeof r==`function`&&r.apply(this,arguments)})}}var l=e.copyFile;l&&(e.copyFile=u);function u(e,t,n,r){return typeof n==`function`&&(r=n,n=0),i(e,t,n,r);function i(e,t,n,r,a){return l(e,t,n,function(o){o&&(o.code===`EMFILE`||o.code===`ENFILE`)?m([i,[e,t,n,r],o,a||Date.now(),Date.now()]):typeof r==`function`&&r.apply(this,arguments)})}}var d=e.readdir;e.readdir=h;var f=/^v[0-5]\./;function h(e,t,n){typeof t==`function`&&(n=t,t=null);var r=f.test(process.version)?function(e,t,n,r){return d(e,i(e,t,n,r))}:function(e,t,n,r){return d(e,t,i(e,t,n,r))};return r(e,t,n);function i(e,t,n,i){return function(a,o){a&&(a.code===`EMFILE`||a.code===`ENFILE`)?m([r,[e,t,n],a,i||Date.now(),Date.now()]):(o&&o.sort&&o.sort(),typeof n==`function`&&n.call(this,a,o))}}}if(process.version.substr(0,4)===`v0.8`){var g=a(e);b=g.ReadStream,x=g.WriteStream}var _=e.ReadStream;_&&(b.prototype=Object.create(_.prototype),b.prototype.open=te);var v=e.WriteStream;v&&(x.prototype=Object.create(v.prototype),x.prototype.open=ne),Object.defineProperty(e,"ReadStream",{get:function(){return b},set:function(e){b=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return x},set:function(e){x=e},enumerable:!0,configurable:!0});var y=b;Object.defineProperty(e,"FileReadStream",{get:function(){return y},set:function(e){y=e},enumerable:!0,configurable:!0});var ee=x;Object.defineProperty(e,"FileWriteStream",{get:function(){return ee},set:function(e){ee=e},enumerable:!0,configurable:!0});function b(e,t){return this instanceof b?(_.apply(this,arguments),this):b.apply(Object.create(b.prototype),arguments)}function te(){var e=this;S(e.path,e.flags,e.mode,function(t,n){t?(e.autoClose&&e.destroy(),e.emit(`error`,t)):(e.fd=n,e.emit(`open`,n),e.read())})}function x(e,t){return this instanceof x?(v.apply(this,arguments),this):x.apply(Object.create(x.prototype),arguments)}function ne(){var e=this;S(e.path,e.flags,e.mode,function(t,n){t?(e.destroy(),e.emit(`error`,t)):(e.fd=n,e.emit(`open`,n))})}function re(t,n){return new e.ReadStream(t,n)}function ie(t,n){return new e.WriteStream(t,n)}var ae=e.open;e.open=S;function S(e,t,n,r){return typeof n==`function`&&(r=n,n=null),i(e,t,n,r);function i(e,t,n,r,a){return ae(e,t,n,function(o,s){o&&(o.code===`EMFILE`||o.code===`ENFILE`)?m([i,[e,t,n,r],o,a||Date.now(),Date.now()]):typeof r==`function`&&r.apply(this,arguments)})}}return e}function m(e){f(`ENQUEUE`,e[0].name,e[1]),r[c].push(e),_()}var h;function g(){for(var e=Date.now(),t=0;t<r[c].length;++t)r[c][t].length>2&&(r[c][t][3]=e,r[c][t][4]=e);_()}function _(){if(clearTimeout(h),h=void 0,r[c].length!==0){var e=r[c].shift(),t=e[0],n=e[1],i=e[2],a=e[3],o=e[4];if(a===void 0)f(`RETRY`,t.name,n),t.apply(null,n);else if(Date.now()-a>=6e4){f(`TIMEOUT`,t.name,n);var s=n.pop();typeof s==`function`&&s.call(null,i)}else{var l=Date.now()-o,u=Math.max(o-a,1);l>=Math.min(u*1.2,100)?(f(`RETRY`,t.name,n),t.apply(null,n.concat([a]))):r[c].push(e)}h===void 0&&(h=setTimeout(_,0))}}})),jt=n(((e,t)=>{function n(e,t){typeof t==`boolean`&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}t.exports=n,n.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts},n.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null},n.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=new Date().getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.unshift(Error(`RetryOperation timeout occurred`)),!1;this._errors.push(e);var n=this._timeouts.shift();if(n===void 0){if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),n=this._timeouts.shift();else return!1}var r=this,i=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},n);return this._options.unref&&i.unref(),!0},n.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var n=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){n._operationTimeoutCb()},n._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)},n.prototype.try=function(e){console.log(`Using RetryOperation.try() is deprecated`),this.attempt(e)},n.prototype.start=function(e){console.log(`Using RetryOperation.start() is deprecated`),this.attempt(e)},n.prototype.start=n.prototype.try,n.prototype.errors=function(){return this._errors},n.prototype.attempts=function(){return this._attempts},n.prototype.mainError=function(){if(this._errors.length===0)return null;for(var e={},t=null,n=0,r=0;r<this._errors.length;r++){var i=this._errors[r],a=i.message,o=(e[a]||0)+1;e[a]=o,o>=n&&(t=i,n=o)}return t}})),Mt=n((e=>{var t=jt();e.operation=function(n){return new t(e.timeouts(n),{forever:n&&n.forever,unref:n&&n.unref,maxRetryTime:n&&n.maxRetryTime})},e.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1e3,maxTimeout:1/0,randomize:!1};for(var n in e)t[n]=e[n];if(t.minTimeout>t.maxTimeout)throw Error(`minTimeout is greater than maxTimeout`);for(var r=[],i=0;i<t.retries;i++)r.push(this.createTimeout(i,t));return e&&e.forever&&!r.length&&r.push(this.createTimeout(i,t)),r.sort(function(e,t){return e-t}),r},e.createTimeout=function(e,t){var n=t.randomize?Math.random()+1:1,r=Math.round(n*t.minTimeout*t.factor**+e);return r=Math.min(r,t.maxTimeout),r},e.wrap=function(t,n,r){if(n instanceof Array&&(r=n,n=null),!r)for(var i in r=[],t)typeof t[i]==`function`&&r.push(i);for(var a=0;a<r.length;a++){var o=r[a],s=t[o];t[o]=function(r){var i=e.operation(n),a=Array.prototype.slice.call(arguments,1),o=a.pop();a.push(function(e){i.retry(e)||(e&&(arguments[0]=i.mainError()),o.apply(this,arguments))}),i.attempt(function(){r.apply(t,a)})}.bind(t,s),t[o].options=n}}})),Nt=n(((e,t)=>{t.exports=Mt()})),Pt=n(((e,t)=>{t.exports=[`SIGABRT`,`SIGALRM`,`SIGHUP`,`SIGINT`,`SIGTERM`],process.platform!==`win32`&&t.exports.push(`SIGVTALRM`,`SIGXCPU`,`SIGXFSZ`,`SIGUSR2`,`SIGTRAP`,`SIGSYS`,`SIGQUIT`,`SIGIOT`),process.platform===`linux`&&t.exports.push(`SIGIO`,`SIGPOLL`,`SIGPWR`,`SIGSTKFLT`,`SIGUNUSED`)})),Ft=n(((t,n)=>{var r=global.process;let i=function(e){return e&&typeof e==`object`&&typeof e.removeListener==`function`&&typeof e.emit==`function`&&typeof e.reallyExit==`function`&&typeof e.listeners==`function`&&typeof e.kill==`function`&&typeof e.pid==`number`&&typeof e.on==`function`};if(!i(r))n.exports=function(){return function(){}};else{var a=e(`assert`),o=Pt(),s=/^win/i.test(r.platform),c=e(`events`);typeof c!=`function`&&(c=c.EventEmitter);var l;r.__signal_exit_emitter__?l=r.__signal_exit_emitter__:(l=r.__signal_exit_emitter__=new c,l.count=0,l.emitted={}),l.infinite||(l.setMaxListeners(1/0),l.infinite=!0),n.exports=function(e,t){if(!i(global.process))return function(){};a.equal(typeof e,`function`,`a callback must be provided for exit handler`),p===!1&&m();var n=`exit`;return t&&t.alwaysLast&&(n=`afterexit`),l.on(n,e),function(){l.removeListener(n,e),l.listeners(`exit`).length===0&&l.listeners(`afterexit`).length===0&&u()}};var u=function(){!p||!i(global.process)||(p=!1,o.forEach(function(e){try{r.removeListener(e,f[e])}catch{}}),r.emit=_,r.reallyExit=h,--l.count)};n.exports.unload=u;var d=function(e,t,n){l.emitted[e]||(l.emitted[e]=!0,l.emit(e,t,n))},f={};o.forEach(function(e){f[e]=function(){i(global.process)&&r.listeners(e).length===l.count&&(u(),d(`exit`,null,e),d(`afterexit`,null,e),s&&e===`SIGHUP`&&(e=`SIGINT`),r.kill(r.pid,e))}}),n.exports.signals=function(){return o};var p=!1,m=function(){p||!i(global.process)||(p=!0,l.count+=1,o=o.filter(function(e){try{return r.on(e,f[e]),!0}catch{return!1}}),r.emit=v,r.reallyExit=g)};n.exports.load=m;var h=r.reallyExit,g=function(e){i(global.process)&&(r.exitCode=e||0,d(`exit`,r.exitCode,null),d(`afterexit`,r.exitCode,null),h.call(r,r.exitCode))},_=r.emit,v=function(e,t){if(e===`exit`&&i(global.process)){t!==void 0&&(r.exitCode=t);var n=_.apply(this,arguments);return d(`exit`,r.exitCode,null),d(`afterexit`,r.exitCode,null),n}return _.apply(this,arguments)}}})),It=n(((e,t)=>{let n=Symbol();function r(e,t,r){let i=t[n];if(i)return t.stat(e,(e,t)=>{if(e)return r(e);r(null,t.mtime,i)});let a=new Date(Math.ceil(Date.now()/1e3)*1e3+5);t.utimes(e,a,a,i=>{if(i)return r(i);t.stat(e,(e,i)=>{if(e)return r(e);let a=i.mtime.getTime()%1e3==0?`s`:`ms`;Object.defineProperty(t,n,{value:a}),r(null,i.mtime,a)})})}function i(e){let t=Date.now();return e===`s`&&(t=Math.ceil(t/1e3)*1e3),new Date(t)}t.exports.probe=r,t.exports.getMtime=i})),Lt=n(((t,n)=>{let r=e(`path`),i=At(),a=Nt(),o=Ft(),s=It(),c={};function l(e,t){return t.lockfilePath||`${e}.lock`}function u(e,t,n){if(!t.realpath)return n(null,r.resolve(e));t.fs.realpath(e,n)}function d(e,t,n){let r=l(e,t);t.fs.mkdir(r,i=>{if(!i)return s.probe(r,t.fs,(e,i,a)=>{if(e)return t.fs.rmdir(r,()=>{}),n(e);n(null,i,a)});if(i.code!==`EEXIST`)return n(i);if(t.stale<=0)return n(Object.assign(Error(`Lock file is already being held`),{code:`ELOCKED`,file:e}));t.fs.stat(r,(r,i)=>{if(r)return r.code===`ENOENT`?d(e,{...t,stale:0},n):n(r);if(!f(i,t))return n(Object.assign(Error(`Lock file is already being held`),{code:`ELOCKED`,file:e}));p(e,t,r=>{if(r)return n(r);d(e,{...t,stale:0},n)})})})}function f(e,t){return e.mtime.getTime()<Date.now()-t.stale}function p(e,t,n){t.fs.rmdir(l(e,t),e=>{if(e&&e.code!==`ENOENT`)return n(e);n()})}function m(e,t){let n=c[e];n.updateTimeout||(n.updateDelay=n.updateDelay||t.update,n.updateTimeout=setTimeout(()=>{n.updateTimeout=null,t.fs.stat(n.lockfilePath,(r,i)=>{let a=n.lastUpdate+t.stale<Date.now();if(r)return r.code===`ENOENT`||a?h(e,n,Object.assign(r,{code:`ECOMPROMISED`})):(n.updateDelay=1e3,m(e,t));if(n.mtime.getTime()!==i.mtime.getTime())return h(e,n,Object.assign(Error(`Unable to update lock within the stale threshold`),{code:`ECOMPROMISED`}));let o=s.getMtime(n.mtimePrecision);t.fs.utimes(n.lockfilePath,o,o,r=>{let i=n.lastUpdate+t.stale<Date.now();if(!n.released){if(r)return r.code===`ENOENT`||i?h(e,n,Object.assign(r,{code:`ECOMPROMISED`})):(n.updateDelay=1e3,m(e,t));n.mtime=o,n.lastUpdate=Date.now(),n.updateDelay=null,m(e,t)}})})},n.updateDelay),n.updateTimeout.unref&&n.updateTimeout.unref())}function h(e,t,n){t.released=!0,t.updateTimeout&&clearTimeout(t.updateTimeout),c[e]===t&&delete c[e],t.options.onCompromised(n)}function g(e,t,n){t={stale:1e4,update:null,realpath:!0,retries:0,fs:i,onCompromised:e=>{throw e},...t},t.retries=t.retries||0,t.retries=typeof t.retries==`number`?{retries:t.retries}:t.retries,t.stale=Math.max(t.stale||0,2e3),t.update=t.update==null?t.stale/2:t.update||0,t.update=Math.max(Math.min(t.update,t.stale/2),1e3),u(e,t,(e,r)=>{if(e)return n(e);let i=a.operation(t.retries);i.attempt(()=>{d(r,t,(e,a,o)=>{if(i.retry(e))return;if(e)return n(i.mainError());let s=c[r]={lockfilePath:l(r,t),mtime:a,mtimePrecision:o,options:t,lastUpdate:Date.now()};m(r,t),n(null,e=>{if(s.released)return e&&e(Object.assign(Error(`Lock is already released`),{code:`ERELEASED`}));_(r,{...t,realpath:!1},e)})})})})}function _(e,t,n){t={fs:i,realpath:!0,...t},u(e,t,(e,r)=>{if(e)return n(e);let i=c[r];if(!i)return n(Object.assign(Error(`Lock is not acquired/owned by you`),{code:`ENOTACQUIRED`}));i.updateTimeout&&clearTimeout(i.updateTimeout),i.released=!0,delete c[r],p(r,t,n)})}function v(e,t,n){t={stale:1e4,realpath:!0,fs:i,...t},t.stale=Math.max(t.stale||0,2e3),u(e,t,(e,r)=>{if(e)return n(e);t.fs.stat(l(r,t),(e,r)=>e?e.code===`ENOENT`?n(null,!1):n(e):n(null,!f(r,t)))})}function y(){return c}o(()=>{for(let e in c){let t=c[e].options;try{t.fs.rmdirSync(l(e,t))}catch{}}}),n.exports.lock=g,n.exports.unlock=_,n.exports.check=v,n.exports.getLocks=y})),Rt=n(((e,t)=>{let n=At();function r(e){let t=[`mkdir`,`realpath`,`stat`,`rmdir`,`utimes`],n={...e};return t.forEach(t=>{n[t]=(...n)=>{let r=n.pop(),i;try{i=e[`${t}Sync`](...n)}catch(e){return r(e)}r(null,i)}}),n}function i(e){return(...t)=>new Promise((n,r)=>{t.push((e,t)=>{e?r(e):n(t)}),e(...t)})}function a(e){return(...t)=>{let n,r;if(t.push((e,t)=>{n=e,r=t}),e(...t),n)throw n;return r}}function o(e){if(e={...e},e.fs=r(e.fs||n),typeof e.retries==`number`&&e.retries>0||e.retries&&typeof e.retries.retries==`number`&&e.retries.retries>0)throw Object.assign(Error(`Cannot use retries with the sync api`),{code:`ESYNC`});return e}t.exports={toPromise:i,toSync:a,toSyncOptions:o}})),zt=t(n(((e,t)=>{let n=Lt(),{toPromise:r,toSync:i,toSyncOptions:a}=Rt();async function o(e,t){let i=await r(n.lock)(e,t);return r(i)}function s(e,t){let r=i(n.lock)(e,a(t));return i(r)}function c(e,t){return r(n.unlock)(e,t)}function l(e,t){return i(n.unlock)(e,a(t))}function u(e,t){return r(n.check)(e,t)}function d(e,t){return i(n.check)(e,a(t))}t.exports=o,t.exports.lock=o,t.exports.unlock=c,t.exports.lockSync=s,t.exports.unlockSync=l,t.exports.check=u,t.exports.checkSync=d}))(),1);const Bt=5e3;function Vt(e,t,n){if(!(e instanceof Error)||!(`code`in e)||e.code!==`ELOCKED`)throw e;let r=t-performance.now();if(r<=0)throw Object.assign(Error(`Could not acquire Pi trust lock at ${n}.lock within ${Bt}ms`,{cause:e}),{code:`ELOCKED`});return Math.min(25,r)}function Ht(e,t){We()?.warn(t,e)}function Ut(e,t){if(e.length===0)return;if(e.length===1)throw e[0];let[n,r]=e,i=n instanceof Error?n.message:String(n),a=r instanceof Error?r.message:String(r);throw AggregateError(e,`Pi trust update failed: ${i}\nReleasing Pi trust lock ${t}.lock also failed: ${a}`)}async function Wt(e,t,n){await S(`${t}.ok.lock`,async()=>{let t=performance.now()+Bt,r;for(;;)try{r=await zt.default.lock(D(e),{realpath:!1,lockfilePath:`${e}.lock`});break}catch(n){await Ve(Vt(n,t,e))}let i=[];try{n()}catch(e){i.push(e)}finally{try{await r()}catch(e){i.push(e)}}Ut(i,e)},{onWarn:Ht})}function Gt(e,t,n){re(`${t}.ok.lock`,()=>{let t=performance.now()+Bt,r=new Int32Array(new SharedArrayBuffer(4)),i;for(;;)try{i=zt.default.lockSync(D(e),{realpath:!1,lockfilePath:`${e}.lock`});break}catch(n){Atomics.wait(r,0,0,Vt(n,t,e))}let a=[];try{n()}catch(e){a.push(e)}finally{try{i()}catch(e){a.push(e)}}Ut(a,e)},{onWarn:Ht})}const Kt=[`settings.json`,`prompts`,`themes`,`SYSTEM.md`,`APPEND_SYSTEM.md`];var qt=class extends Error{name=`PiResourceInspectionError`};function X(e){let t;try{t=M(e)}catch(e){if(e.code===`ENOENT`)return!1;throw e}let n;try{n=I(e)}catch(e){throw t.isSymbolicLink()&&e.code===`ENOENT`?new qt(ye(`missing-symlink-target`),{cause:e}):e}return Pe(e,A.R_OK|(n.isDirectory()?A.X_OK:0)),!0}function Jt(e){return e===`open-knowledge`||e.startsWith(`open-knowledge-`)}function Yt(e,t,n){let r=e;try{let i=F(e),a;r=t;try{a=F(t)}catch(e){if(e.code!==`ENOENT`)throw e;a=k(t)}let o=O(a,`.agents`,`skills`),s=[];for(let e of Kt)r=O(i,`.pi`,e),X(r)&&s.push(r);if(r=O(i,`.pi`,`extensions`),X(r))for(let t of P(r).sort()){let i=O(r,t);k(n)!==O(k(e),`.pi`,`extensions`,t)&&s.push(i)}for(let e of[O(i,`.pi`,`skills`),O(i,`.agents`,`skills`)])if(e!==o&&(r=e,X(e)))for(let t of P(e).sort())Jt(t)||s.push(O(e,t));let c=D(i);for(;c!==i;){r=O(c,`.agents`,`skills`),r!==o&&X(r)&&s.push(r);let e=D(c);if(e===c)break;c=e}return s.length===0?{kind:`none`}:{kind:`shared`,paths:s.sort()}}catch(e){return{kind:`unreadable`,error:`Could not inspect Pi project resources at ${U(r)}: ${e instanceof qt?e.message:ye(C(e))}`}}}function Xt(e,t,n){let r=k(e),i=me({home:t,env:n??(t===void 0?process.env:{})});return{cwd:r,bridgePath:T.pi.projectConfigPath(r),trustPath:O(i,`trust.json`)}}function Z(e){try{let t=F(e);return I(t).isDirectory()?(Pe(t,A.X_OK),{kind:`ready`,project:{path:e,canonical:t}}):{kind:`refused`,error:`Pi project path ${U(e)} is not a directory; restore the intended project directory, then retry`}}catch(t){return{kind:`refused`,error:`Pi project directory ${U(e)} could not be resolved or accessed: ${U(t instanceof Error?t.message:String(t))}; restore the directory or symlink and check its permissions, then retry`}}}function Zt(e){let t=Z(e.path);if(t.kind===`refused`)return t.error;if(t.project.canonical!==e.canonical)return`Pi project path ${U(e.path)} changed while waiting for its trust lock; restore the intended project location, then retry`}function Qt(e,t,n){let r=Ce(T.pi,e,n,t);if(r.kind===`absent`)return{state:`absent`,text:null};if(r.kind!==`present`)return{state:`unreadable`,text:null};let i=r.entry,a=Array.isArray(i.args)&&typeof i.args[0]==`string`?i.args[0]:null;return we(i)?{state:`own-current`,text:a}:fe(i)?{state:`own-stale`,text:a}:{state:`foreign`,text:a}}function $t(e,t){let n;try{n=N(e.path,`utf-8`)}catch(t){let n=t.code;return e.kind===`missing`&&n===`ENOENT`?{state:`untrusted`,entries:{},trailingNewline:!1}:{state:`unreadable`,reason:C(t)}}if(n.trim()===``)return{state:`untrusted`,entries:{},trailingNewline:!1};let r;try{r=JSON.parse(n)}catch{return{state:`unreadable`,reason:`invalid-json`}}return Ae(r)?{state:r[t]===!0?`trusted`:`untrusted`,entries:r,trailingNewline:n.endsWith(`
|
|
4
|
+
`)}:{state:`unreadable`,reason:`invalid-json`}}function en(e){switch(e){case`invalid-json`:return`the file is not a valid JSON object; repair its JSON, then retry`;case`path-changed`:return`the path changed while waiting for its lock; retry to check its current state`;case`unavailable-root`:return`the filesystem root is unavailable; reconnect the drive or network share, then retry`;default:return ye(e)}}function Q(e,t){return{kind:`refused`,error:`trust store ${U(e)}: ${en(t)}`}}function tn(e){let t=je(e);try{switch(t.kind){case`declined`:return Q(e,t.reason);case`ready`:return{kind:`ready`,path:F(t.path)};case`not-present`:break;default:throw Error(`unhandled trust file resolution: ${t}`)}let n=D(e),r=[E(e)],i=M(n,{throwIfNoEntry:!1});for(;!i;){let t=D(n);if(t===n)return Q(e,`unavailable-root`);r.unshift(E(n)),n=t,i=M(n,{throwIfNoEntry:!1})}try{return{kind:`missing`,path:O(F(n),...r)}}catch(t){return Q(e,i.isSymbolicLink()&&t.code===`ENOENT`?`missing-symlink-target`:C(t))}}catch(t){return Q(e,C(t))}}function nn(e,t){let n=tn(e);return n.kind===`refused`?n:n.path!==t.path||t.kind===`ready`&&n.kind===`missing`?Q(e,`path-changed`):n}function rn(e,t,n){let r=Xt(e,t,n),i=Z(r.cwd);if(i.kind===`refused`)return{...r,project:`unavailable`,error:i.error};let a=Qt(r.cwd,r.bridgePath,t).state,o=tn(r.trustPath),s=o.kind===`refused`?`unreadable`:o.kind===`missing`?`untrusted`:$t(o,i.project.canonical).state;return{...r,project:`ready`,canonicalCwd:i.project.canonical,bridge:a,trust:s,bridgeLoadable:(a===`own-current`||a===`own-stale`)&&s===`trusted`,otherExtensions:an(r.bridgePath).displayNames}}function an(e){let t=D(e),n=E(e);try{return{displayNames:P(t).filter(e=>e!==n&&e.endsWith(`.ts`)).sort().map(e=>U(JSON.stringify(e)))}}catch{return{displayNames:[]}}}async function on(e,t={mode:`published`},n,r,i){let a=Xt(e,n,r),o=Z(a.cwd);if(o.kind===`refused`)return{...a,ok:!1,bridge:`refused-project-path`,trust:`skipped`,error:o.error};if(i!==void 0&&o.project.canonical!==i)return{...a,ok:!1,bridge:`refused-project-path`,trust:`skipped`,error:`The approved Pi project directory ${U(i)} no longer matches the current directory ${U(o.project.canonical)}. Reopen the intended project and approve the Pi integration again; no bridge or trust settings were changed.`};let s=Qt(a.cwd,a.bridgePath,n);if(s.state===`foreign`)return{...a,ok:!1,bridge:`refused-foreign`,trust:`skipped`};if(s.state===`unreadable`)return{...a,ok:!1,bridge:`refused-unreadable`,trust:`skipped`};let c;if(s.state===`absent`)c=`written`;else{let e;try{e=De(t)}catch{e=void 0}c=e!==void 0&&s.text===e?`unchanged`:`refreshed`}if(c!==`unchanged`){let e=ke(T.pi,a.cwd,t,n,a.bridgePath);if(e.action!==`written`&&e.action!==`overwritten`)return{...a,ok:!1,bridge:`failed`,trust:`skipped`,error:e.error===void 0?`bridge write ${e.action}`:U(e.error)}}let l=await sn(a.trustPath,o.project,n??L());return{...a,ok:l.action===`already-trusted`||l.action===`added`,bridge:c,trust:l.action,...l.error===void 0?{}:{error:l.error}}}async function sn(e,t,n){let r=t.canonical,i=tn(e);if(i.kind===`refused`)return{action:`refused-unreadable`,error:i.error};try{Fe(D(i.path),{recursive:!0})}catch(e){return{action:`failed`,error:U(e instanceof Error?e.message:String(e))}}let a={action:`added`};try{await Wt(e,i.path,()=>{let o=Zt(t);if(o){a.action=`refused-unreadable`,a.error=o;return}let s=nn(e,i);if(s.kind===`refused`){a.action=`refused-unreadable`,a.error=s.error;return}let c=$t(s,r);if(c.state===`trusted`){a.action=`already-trusted`;return}if(c.state===`unreadable`){a.action=`refused-unreadable`,a.error=Q(e,c.reason).error;return}let l=$(n,()=>{let t=J(n,r).find(e=>e.record.canonicalTrustPath===s.path);return t&&Y(n,t),Tt(n,r,e,s.path,Object.hasOwn(c.entries,r)?{present:!0,value:c.entries[r]}:{present:!1})}),u={...c.entries,[r]:!0},d=JSON.stringify(u,null,2)+(c.trailingNewline?`
|
|
5
|
+
`:``),f=w(s.path);x(s.path,d,f===void 0?void 0:{mode:f}),$(n,()=>Et(n,l)),a.action=`added`})}catch(e){return{action:`failed`,error:U(e instanceof Error?e.message:String(e))}}return a}function cn(e){let t=[],n=e;try{for(;;){if(M(n,{throwIfNoEntry:!1})){if(t.length===0)return;let e=F(n);return I(e).isDirectory()?(Pe(e,A.X_OK),O(e,...t)):void 0}let e=D(n);if(e===n)return;t.unshift(E(n)),n=e}}catch{return}}function ln(e){let t={"not-present":0,removed:1,"kept-unowned":2,"kept-shared":3,"kept-unverified":4,"refused-unreadable":5,failed:6},n=e.reduce((e,n)=>t[n.action]>t[e.action]?n:e,{action:`not-present`}),r=e.flatMap(e=>e.error??[]),i=e.flatMap(e=>e.detail??[]);return r.length>0?{action:n.error===void 0?`failed`:n.action,error:[...r,...i].join(`
|
|
6
|
+
`)}:n.detail===void 0?n:{...n,detail:i.join(`
|
|
7
|
+
`)}}function un(e,t,n,r={}){let i=Xt(e,t,n),a=t??L(),o=Z(i.cwd),s=o.kind===`refused`&&r.recordedOnly?cn(i.cwd):void 0,c=o.kind===`ready`?o.project.canonical:s,l;try{l=$(a,()=>{let e=J(a,i.cwd);return c===void 0||c===i.cwd?e:[...J(a,c),...e]})}catch(e){return{action:`failed`,error:U(e instanceof Error?e.message:String(e))}}if(l.length===0&&r.recordedOnly)return o.kind===`ready`||s!==void 0?{action:`not-present`}:{action:`kept-unverified`,error:`${o.error}. OpenKnowledge could not verify whether this path refers to a project with recorded Pi trust; cleanup was left pending. Retry once the project path can be resolved to check again.`};if(o.kind===`refused`){if(l.length===0)return{action:`kept-unverified`,error:o.error};let e=l.map(({path:e,record:t})=>`key ${U(JSON.stringify(t.cwd))}; configured store ${U(JSON.stringify(t.configuredTrustPath))}; recorded destination ${U(JSON.stringify(t.canonicalTrustPath))}; ownership record ${U(JSON.stringify(e))} (${t.state})`);return{action:`kept-unverified`,error:[`${o.error}. OpenKnowledge kept these Pi trust ownership records; current trust decisions were not checked:`,...e,`To review manually, close Pi, verify the intended store against its recorded destination, and inspect only the exact key. A pending record does not prove setup completed or ownership of a current grant. If you choose to undo a current true decision, restore the recorded previous value, or remove that key only when no previous entry was recorded. Preserve other current decisions; parent-folder and global trust settings still apply.`].join(`
|
|
8
|
+
`)}}let u=Yt(o.project.canonical,a,T.pi.projectConfigPath(o.project.canonical));if(u.kind===`unreadable`)return{action:`kept-unverified`,error:u.error};let d=u.kind===`shared`?u.paths:[],f=[],p=new Map,m=(e,t)=>{let n=p.get(e);if(!n){let t=tn(e);if(t.kind===`refused`){f.push({action:`refused-unreadable`,error:t.error});return}n={trustPath:e,resolved:t,keys:new Map},p.set(e,n)}if(t){if(n.resolved.path!==t.record.canonicalTrustPath){f.push({action:`refused-unreadable`,error:`Pi trust store ${U(e)} no longer points to its recorded destination ${U(t.record.canonicalTrustPath)}; restore the intended file location or symlink, then retry`});return}n.keys.set(t.record.cwd,{cwd:t.record.cwd,mode:`recorded`,receipt:t})}};for(let e of l)m(e.record.configuredTrustPath,e);m(i.trustPath);for(let e of p.values()){for(let t of[o.project.canonical,i.cwd])e.keys.has(t)||e.keys.set(t,{cwd:t,mode:`inspect`,receipt:l.find(n=>n.record.cwd===t&&n.record.canonicalTrustPath===e.resolved.path)});f.push(dn(e,a,d,o.project))}return ln(f)}function $(e,t){try{return t()}catch(t){throw t instanceof G?t:Error(`Could not access OpenKnowledge's Pi trust ownership records at ${U(O(y(e),`pi-trust`))}: ${U(t instanceof Error?t.message:String(t))}. Check the records and their permissions, then retry.`,{cause:t})}}function dn(e,t,n,r){let{trustPath:i,resolved:a}=e,o=[...e.keys.values()];if(!o.some(e=>e.mode===`recorded`)&&a.kind===`missing`)return{action:`not-present`};if(a.kind===`missing`)try{M(D(a.path))}catch(e){return{action:`failed`,error:`The recorded Pi trust directory ${U(D(a.path))} is unavailable: ${U(e instanceof Error?e.message:String(e))}. Restore access to its parent directory or mounted drive, then retry; the ownership record was kept.`}}let s=[],c={result:{action:`not-present`}};try{Gt(i,a.path,()=>{let e=Zt(r);if(e){c.result={action:`kept-unverified`,error:e};return}let l=nn(i,a);if(l.kind===`refused`){c.result={action:`refused-unreadable`,error:l.error};return}let u=$t(l,r.canonical);if(u.state===`unreadable`){c.result={action:`refused-unreadable`,error:Q(i,u.reason).error};return}let d=o.map(e=>({cwd:e.cwd,mode:e.mode,expectedConfiguredPath:e.receipt?.record.configuredTrustPath,receipt:$(t,()=>J(t,e.cwd).find(e=>e.record.canonicalTrustPath===l.path))}));if(d.some(e=>e.receipt&&e.receipt.record.configuredTrustPath!==e.expectedConfiguredPath)){c.result={action:`failed`,error:`The Pi trust ownership record changed during cleanup; retry to read its current location.`};return}for(let e of d){try{fn(e,t,i,l.path,u,n,r,c)}catch(t){let n=U(t instanceof Error?t.message:String(t)),r=t instanceof G?``:`; retry to check its current state.`;s.push({action:`failed`,error:`Pi trust entry ${U(JSON.stringify(e.cwd))} in ${U(i)} could not be reconciled: ${n}${r}`})}s.push(c.result),c.result={action:`not-present`}}})}catch(e){s.push({action:`failed`,error:U(e instanceof Error?e.message:String(e))})}return ln([...s,c.result])}function fn(e,t,n,r,i,a,o,s){let{cwd:c,receipt:l}=e;if(i.entries[c]!==!0){l&&e.mode===`recorded`&&$(t,()=>Y(t,l)),s.result={action:`not-present`};return}let u=`To remove this grant manually, close Pi and remove only the ${U(JSON.stringify(c))} entry from ${U(n)}; parent-folder and global trust settings still apply.`;if(a.length>0&&c===o.canonical){let n=`kept Pi's folder trust because other resources still need it: ${a.slice(0,3).map(e=>U(JSON.stringify(e))).join(`, `)}${a.length>3?` (+${a.length-3} more)`:``}. ${u} Removing this grant may stop Pi from loading those resources, including any not listed here.`;s.result={action:`kept-shared`,detail:n},l&&e.mode===`recorded`&&$(t,()=>Y(t,l)),s.result={action:`kept-shared`,detail:`${n} ${l?e.mode===`recorded`?`OpenKnowledge has relinquished this grant and will not revoke it on later cleanup runs.`:`OpenKnowledge kept the existing ownership record; cleanup of its recorded location remains incomplete.`:`OpenKnowledge has no ownership record for this grant and will not revoke it on later cleanup runs.`}`};return}if(e.mode===`inspect`||!l||l.record.state===`pending`){let e=l?l.record.state===`pending`?`its ownership record is pending after an interrupted setup; completion cannot be verified. Re-running setup or cleanup does not reconcile this record while the folder remains trusted.`:`OpenKnowledge must reconcile its recorded location at ${U(l.record.configuredTrustPath)} before removing it.`:`no OpenKnowledge ownership record exists; this includes every grant made before ownership recording was introduced.`;s.result={action:`kept-unowned`,detail:`${c===o.canonical?`kept Pi's folder trust because ${e}`:`kept a Pi trust entry under a non-canonical project path because ${e} Pi uses the real project directory instead of this key.`} ${u}`};return}let d={...i.entries};l.record.previous.present?d[c]=l.record.previous.value:delete d[c];let f=JSON.stringify(d,null,2)+(i.trailingNewline?`
|
|
9
|
+
`:``),p=w(r);x(r,f,p===void 0?void 0:{mode:p}),i.entries=d,$(t,()=>Y(t,l)),s.result={action:`removed`}}function pn(e){return we(e)||ve(e)||fe(e)}const mn=10485760;function hn(e,t,n,r=!1){let i=un(e,t,n,{recordedOnly:r});switch(i.action){case`removed`:case`not-present`:return{trust:i.action};case`kept-shared`:case`kept-unowned`:return{trust:i.action,trustDetail:i.detail};case`failed`:case`refused-unreadable`:case`kept-unverified`:{let e=r?`Trust cleanup remains incomplete`:`The bridge file was left untouched`;throw Error(`Pi trust cleanup failed (${i.action}):\n${i.error}\n${e} so cleanup can be retried.`)}default:throw Error(`unhandled Pi trust cleanup result: ${i}`)}}function gn(e,t,n,r){if(e.id!==`pi`)return{kind:`not-present`};let i=hn(t,n,r,!0);return i.trust===`not-present`?{kind:`not-present`}:{kind:`removed`,...i}}function _n(e,t,n,r,i){let a;try{a=r??e.configPath(t,n)}catch{return{kind:`not-present`}}let o=je(a);if(o.kind===`not-present`)return gn(e,t,n,i);if(o.kind===`declined`)return o;let s=Ce(e,t,n,o.path);if(s.kind===`absent`||s.kind===`no-entry`)return gn(e,t,n,i);if(s.kind===`decline`)return{kind:`declined`,reason:s.reason};if(!pn(s.entry))return{kind:`left-foreign`};let c=e.serverName(t);if(e.format===`file`){let e=hn(t,n,i);try{Ie(a,{force:!0})}catch(t){throw e.trustDetail?Error(`${t instanceof Error?t.message:String(t)}\n${e.trustDetail}`,{cause:t}):t}return{kind:`removed`,...e}}return e.format===`toml`?bn(o.path,c):e.format===`yaml`?yn(o.path,e.topLevelKey,c):vn(o.path,e.topLevelKey,e.serverMapSubKey,c)}function vn(e,t,n,r){let i;try{i=N(e,`utf-8`)}catch(e){return{kind:`declined`,reason:C(e)}}if(Buffer.byteLength(i,`utf-8`)>mn)return{kind:`declined`,reason:`oversize`};let{text:a,changed:o}=ce(i,Ee(t,n,r));return o?(x(e,a,{mode:w(e)}),{kind:`removed`}):{kind:`not-present`}}function yn(e,t,n){let r;try{r=N(e,`utf-8`)}catch(e){return{kind:`declined`,reason:C(e)}}if(Buffer.byteLength(r,`utf-8`)>mn)return{kind:`declined`,reason:`oversize`};let i=r.charCodeAt(0)===65279,a=i?r.slice(1):r,o=(0,He.parseDocument)(a);if(o.errors.length>0)return{kind:`declined`,reason:`unparseable`};let s=[t,n];if(!o.hasIn(s))return{kind:`not-present`};o.deleteIn(s);let c=o.toString(),l=be(a);a.trim()===``||a.endsWith(`
|
|
10
|
+
`)?c.endsWith(`
|
|
11
|
+
`)||(c=`${c}\n`):c=c.replace(/\n+$/,``),l&&(c=c.replace(/\r\n/g,`
|
|
12
|
+
`).replace(/\n/g,`\r
|
|
13
|
+
`));let u=`${i?``:``}${c}`;return u!==r&&x(e,u,{mode:w(e)}),{kind:`removed`}}function bn(e,t){let n=ge();if(n.backend===`fallback`)return{kind:`declined`,reason:`no-native-writer`};let r;try{r=N(e,`utf-8`)}catch(e){return{kind:`declined`,reason:C(e)}}let i=r.charCodeAt(0)===65279,a=i?r.slice(1):r,o=be(a),s=a.trim()===``||a.endsWith(`
|
|
14
|
+
`),c;try{c=n.removeEntry(a,t)}catch{return{kind:`declined`,reason:`unparseable`}}if(!c.existed)return{kind:`not-present`};let l=c.text;s?l.endsWith(`
|
|
15
|
+
`)||(l=`${l}\n`):l=l.replace(/\n+$/,``),o&&(l=l.replace(/\r\n/g,`
|
|
16
|
+
`).replace(/\n/g,`\r
|
|
17
|
+
`));let u=`${i?``:``}${l}`;return u!==r&&x(e,u,{mode:w(e)}),{kind:`removed`}}function xn(e,t){let n=u[e];return n===null?null:O(t,...n.split(`/`),oe.discovery,`SKILL.md`)}function Sn(e,t){let n=xn(e,t);if(n===null)return{editorId:e,label:e,action:`skipped-unsupported`,path:``};if(!ne(t).some(t=>t.editorId===e))return{editorId:e,label:e,action:`skipped-unsupported`,path:n};try{let r=ae(`discovery`,{checkDesktop:!0});return ue(D(n),t),{editorId:e,label:e,action:de(r,n),path:n}}catch(t){return{editorId:e,label:e,action:`failed`,path:n,error:t instanceof Error?t.message:String(t)}}}function Cn(e){return j(O(e,...`.agents/skills`.split(`/`),oe.discovery))?!0:c.some(t=>{let n=xn(t,e);return n!==null&&j(D(n))})}function wn(e,t){let n=xn(e,t);if(n===null)return{editorId:e,label:e,action:`skipped-unsupported`,path:``};let r=D(n);try{return j(n)?(ue(r,t),Ie(r,{recursive:!0,force:!0}),{editorId:e,label:e,action:`removed`,path:n}):{editorId:e,label:e,action:`not-present`,path:n}}catch(t){return{editorId:e,label:e,action:`failed`,path:n,error:t instanceof Error?t.message:String(t)}}}function Tn(e){return e===`opencode`?pe:Se}function En(e,t,n){let r=T[e],i=Tn(e),a=[],o=r.projectConfigPath?.(t);o!==void 0&&a.push({scope:`project`,configPath:o});try{a.push({scope:`user`,configPath:r.configPath(t,n)})}catch{}for(let o of a){let a=_e(r,t,n,o.configPath);if(a!==null&&i(a))return{editorId:e,scope:o.scope,configPath:o.configPath}}return null}function Dn(e,t,n=[]){let r=j(O(e,oe[t]))?`satisfied`:`absent`;return{...r===`satisfied`?{state:r,strictness:[`reclaim-permissive`]}:{state:r},...n.length===0?{}:{sharedWith:n}}}function On(e,t){let n=le.flatMap(t=>{let n=e[t];return n===null?[]:[{editor:t,root:n}]}),r=p.filter(e=>e.scope===t).map(e=>({editor:e.editorId,root:o}));return[...n,...r]}function kn(e,t,n,r){let i=b(e,On(t,r)),a=i.find(e=>e.host===n);if(a===void 0||a.state===`absent`)return[];let o=a.real;return i.filter(e=>e.host!==n&&e.state!==`absent`&&e.real===o).map(e=>e.host)}function An(e,t){let n=(t??L()).replace(/[\\/]+$/,``);if(!n.includes(`\\`))return e.startsWith(`${n}/`)?`~/${e.slice(n.length+1)}`:e;let r=e=>e.replace(/\\/g,`/`),i=r(n),a=r(e);return a.startsWith(`${i}/`)?`~/${a.slice(i.length+1)}`:e}function jn(e,t){let n=T[e];return Oe(n,``,t)&&!he(n,``,t)}function Mn(e,t,n,r,i){let a=T[e],o;if(i===void 0)try{o=a.configPath(n,r)}catch{return{state:`structural-na`}}else o=i;let s=i===void 0?An(o,r):void 0,c=Ce(a,n,r,i);switch(c.kind){case`absent`:case`no-entry`:return i===void 0&&jn(e,r)?{state:`structural-na`}:{state:`absent`,path:s};case`decline`:return{state:`unprobed`};case`present`:{let{entry:r}=c,i=[];we(r)&&i.push(`reclaim-permissive`),ve(r)&&i.push(`pre-approval-exact`),Tn(e)(r)&&i.push(`injection-functional`);let o=se(a,n);return i.length>0&&(o!==null&&Te(r,o)||t.includes(`pre-approval-exact`)&&i.includes(`reclaim-permissive`)&&!i.includes(`pre-approval-exact`))?{state:`drifted`,strictness:i,path:s}:i.length>0?{state:`satisfied`,strictness:i,path:s}:xe(a)?{state:`foreign-replaceable`,path:s}:{state:`foreign`,path:s}}}}function Nn(e){let{cwd:t,home:n}=e;return e=>{if(e.pathId===null)return null;let i=h(e.pathId);if(i===null)return null;if(i.kind===`central-skill-store`)return n===void 0?null:Dn(O(n,o),`discovery`,kn(n,u,e.agent,`global`));let a=i.editor;switch(i.kind){case`editor-user-skill-root`:{let e=u[a];return e===null||n===void 0?null:ne(n).some(e=>e.editorId===a)?Dn(O(n,e),`discovery`,kn(n,u,a,`global`)):{state:`structural-na`}}case`editor-project-skill-root`:{let e=r[a];return e===null?null:Dn(O(t,e),`project`,kn(t,r,a,`project`))}case`editor-user-config`:return Mn(a,e.strictness,t,n);case`editor-project-config`:{let r=T[a].projectConfigPath?.(t);return r===void 0?null:Mn(a,e.strictness,t,n,r)}}}}export{Qe as C,Ze as S,Ke as T,rt as _,Sn as a,$e as b,rn as c,lt as d,H as f,ct as g,_t as h,Cn as i,at as l,gt as m,En as n,_n as o,ht as p,wn as r,on as s,Nn as t,ut as u,it as v,We as w,Ye as x,R as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{M as e,S as t}from"./init-
|
|
1
|
+
import{M as e,S as t}from"./init-ZiC_qPS2.mjs";import{lstatSync as n,statSync as r}from"node:fs";function i(i){let a;try{a=n(i).isSymbolicLink()}catch(t){return t.code===`ENOENT`?{kind:`not-present`}:{kind:`declined`,reason:e(t)}}let o=t(i);if(o.readPath===null)return{kind:`declined`,reason:`unresolved-symlink`};try{if(!r(o.readPath).isFile())return{kind:`declined`,reason:`not-a-file`}}catch(t){return{kind:`declined`,reason:a&&t.code===`ENOENT`?`missing-symlink-target`:e(t)}}return{kind:`ready`,path:o.writePath,symlink:a}}export{i as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./launch-json-removal-
|
|
1
|
+
import{t as e}from"./launch-json-removal-AkSL-k1w.mjs";import{join as t}from"node:path";function n(n){let i=n.logger??r,a=t(n.projectDir,`.claude`,`launch.json`);if(n.reclaimDisableEnv===`1`)return i({event:`launch-json-repair-skipped`,severity:`info`,reason:`reclaim-disabled`}),{outcome:{configPath:a,outcome:`skipped-reclaim-disabled`},repairedCount:0};let o;try{o=(n.removeOwnLaunchEntryFn??e)(n.projectDir)}catch(e){let t=e instanceof Error?e.message:String(e);return i({event:`launch-json-repair-write-failed`,severity:`warn`,configPath:a}),{outcome:{configPath:a,outcome:`write-failed`,error:t},repairedCount:0}}let s=o.kind===`removed`;return s&&i({event:`launch-json-repair-removed`,severity:`info`,configPath:a}),{outcome:{configPath:a,outcome:o.kind},repairedCount:+!!s}}function r(e){process.stderr.write(`${JSON.stringify(e)}\n`)}export{n as repairLaunchJson};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{T as e}from"./md-manager-BGnqyqi1-
|
|
1
|
+
import{T as e}from"./md-manager-BGnqyqi1-BTvqIsKE.mjs";import{J as t,X as n,et as r,f as i,rt as a,y as o}from"./init-ZiC_qPS2.mjs";import{homedir as s}from"node:os";function c(e){let{priorCommand:t,priorArgs:n}=l(e.priorEntry);return{event:`mcp-config-migrate`,scope:e.scope,surface:e.surface,editorId:e.editorId,configPath:e.configPath,priorCommand:t,priorArgs:n}}function l(e){return{priorCommand:typeof e.command==`string`?e.command.slice(0,200):null,priorArgs:Array.isArray(e.args)?e.args.slice(0,10).map(e=>typeof e==`string`?e.slice(0,200):e):null}}function u(e){let r=e.logger??m,i=e.home??s(),a=[];if(e.reclaimDisableEnv===`1`)return r({event:`mcp-config-repair-skipped`,severity:`info`,reason:`reclaim-disabled`}),{outcomes:a,repairedCount:0};for(let o of t){let t=n[o],s=d(()=>t.configPath(``,i));if(s!==null&&a.push(f({scope:`user`,editorId:o,target:t,home:i,cwd:``,configPath:s,configPathOverride:void 0,logger:r})),t.projectConfigPath){let n=t.projectConfigPath,i=d(()=>n(e.projectDir));i!==null&&a.push(f({scope:`project`,editorId:o,target:t,home:void 0,cwd:e.projectDir,configPath:i,configPathOverride:i,logger:r}))}}return{outcomes:a,repairedCount:a.filter(e=>e.outcome===`repaired`).length}}function d(e){try{return e()}catch{return null}}function f(t){let n={scope:t.scope,editorId:t.editorId,configPath:t.configPath},s=i(t.target,t.cwd,t.home,t.configPathOverride);if(s===null)return{...n,outcome:`no-entry`};if(t.target.format===`file`){if(a(s))return{...n,outcome:`canonical`}}else{let i=e(s);if(i.kind===`recognized`&&i.disposition===`keep`){let e=r(s,t.target.buildEntry(t.cwd,{}));if(e.length===0)return{...n,outcome:`canonical`};let i=p(t,n,o(t.target,t.cwd,{mode:`published`,skipAvailabilityCheck:!0,pruneOnly:!0},t.home,t.configPathOverride));return(i.outcome===`repaired`||i.outcome===`canonical`)&&t.logger({event:i.outcome===`repaired`?`mcp-config-repair-pruned`:`mcp-config-repair-prune-unchanged`,severity:i.outcome===`repaired`?`info`:`warn`,scope:t.scope,editorId:t.editorId,configPath:t.configPath,keys:e}),i.outcome===`canonical`?{...n,outcome:`prune-unchanged`}:i}if(i.kind===`declined`&&t.scope===`project`)return t.logger({event:`mcp-config-repair-skipped-foreign`,severity:`info`,scope:t.scope,editorId:t.editorId,configPath:t.configPath,reason:i.reason}),{...n,outcome:`foreign`,reason:i.reason}}return t.logger({...c({scope:t.scope,surface:`cli-repair`,editorId:t.editorId,configPath:t.configPath,priorEntry:s}),severity:`info`}),p(t,n,o(t.target,t.cwd,{mode:`published`,skipAvailabilityCheck:!0},t.home,t.configPathOverride))}function p(e,t,n){if(n.action===`failed`){let r=n.error??`unknown write failure`;return e.logger({event:`mcp-config-repair-write-failed`,severity:`warn`,scope:e.scope,editorId:e.editorId,configPath:e.configPath,error:r}),{...t,outcome:`write-failed`,error:r}}return n.action===`declined`?(e.logger({event:`mcp-config-repair-declined`,severity:`warn`,scope:e.scope,editorId:e.editorId,configPath:e.configPath,reason:n.declineReason}),{...t,outcome:`declined`,reason:n.declineReason}):n.action===`skipped-flag`?{...t,outcome:`canonical`}:{...t,outcome:`repaired`}}function m(e){process.stderr.write(`${JSON.stringify(e)}\n`)}export{l as n,u as repairMcpConfigs,c as t};
|
|
@@ -521,25 +521,25 @@
|
|
|
521
521
|
]
|
|
522
522
|
},
|
|
523
523
|
"skillInstallReports": {
|
|
524
|
-
"enabled":
|
|
524
|
+
"enabled": false
|
|
525
525
|
}
|
|
526
526
|
},
|
|
527
527
|
"type": "object",
|
|
528
528
|
"properties": {
|
|
529
529
|
"skillInstallReports": {
|
|
530
530
|
"default": {
|
|
531
|
-
"enabled":
|
|
531
|
+
"enabled": false
|
|
532
532
|
},
|
|
533
533
|
"type": "object",
|
|
534
534
|
"properties": {
|
|
535
535
|
"enabled": {
|
|
536
|
-
"default":
|
|
536
|
+
"default": false,
|
|
537
537
|
"type": "boolean",
|
|
538
538
|
"scope": "user",
|
|
539
539
|
"agentSettable": false,
|
|
540
540
|
"reload": "live",
|
|
541
541
|
"defaultScope": "user",
|
|
542
|
-
"description": "Report skill installs to skills.sh so a published skill shows an accurate install count. Sends the skill name, its source repo, and which agent tools it was installed for — never file contents, and never for a private or local source. One report per skill per machine. Default
|
|
542
|
+
"description": "Report skill installs to skills.sh so a published skill shows an accurate install count. Sends the skill name, its source repo, and which agent tools it was installed for — never file contents, and never for a private or local source. One report per skill per machine. Default off; when it is on, the DO_NOT_TRACK and DISABLE_TELEMETRY environment variables still turn it off."
|
|
543
543
|
}
|
|
544
544
|
},
|
|
545
545
|
"additionalProperties": {}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{o as e}from"./rolldown-runtime-tZXQYakl.mjs";import{Gc as t,H as n,Kc as r,Ml as i,Nl as a,U as o,Vc as s,Vu as c,W as l,_a as u,cf as d,ga as ee,gf as f,l as p,u as te,vf as m,xf as h}from"./md-manager-BGnqyqi1-BTvqIsKE.mjs";import{$o as g,Ca as _,Do as v,Fi as y,Ii as b,Ss as x,Zn as S,ai as C,bi as w,dr as T,fi as E,kt as D,m as O,ns as k,rs as A,sr as j,ts as M,vi as N,wr as P,yi as ne}from"./dist-Bc3_Wt6N.mjs";import{t as F}from"./yazl-BBz29IQN.mjs";import{Ct as re,ot as ie,st as ae}from"./init-ZiC_qPS2.mjs";import{l as oe,w as se}from"./registry-probes-DNaU56kl.mjs";import{c as ce}from"./colors-r_owlCuY.mjs";import{t as le}from"./is-object-BGze3w87.mjs";import{n as ue}from"./constants-CYVYQ2Ib.mjs";import"./loader-DXV01FEG.mjs";import"./preview-CfRTddxX.mjs";import{execSync as de,spawnSync as fe}from"node:child_process";import{basename as I,dirname as L,isAbsolute as pe,join as R,relative as me,resolve as z,sep as B}from"node:path";import{closeSync as he,cpSync as ge,createWriteStream as _e,existsSync as V,lstatSync as ve,mkdirSync as H,mkdtempSync as ye,openSync as be,readFileSync as U,readSync as xe,readdirSync as W,readlinkSync as Se,realpathSync as Ce,rmSync as G,rmdirSync as we,statSync as Te,writeFileSync as K}from"node:fs";import{arch as Ee,freemem as De,homedir as q,hostname as Oe,platform as ke,release as Ae,tmpdir as je,totalmem as Me,type as Ne,uptime as Pe}from"node:os";import"node:fs/promises";import{createHash as Fe}from"node:crypto";function Ie(e,t){let n=t.map(e=>[x(e),e]);for(let t of e){let e=x(t);if(e===null)continue;let r=n.find(([t])=>t===e);if(r!==void 0)return r[1]}}function Le(e){let{override:t,storedPreference:n,preferenceList:r,supportedLocales:i}=e,a=e.autoDetectableLocales??i;if(t!==void 0){let e=Ie([t],i);if(e!==void 0)return{locale:e,source:`override`}}if(n!==void 0&&n!==`system`&&i.includes(n))return{locale:n,source:`explicit`};let o=Ie(r,a);return o===void 0?{locale:`en`,source:`fallback`}:{locale:o,source:`system`}}function Re(e,t=Date.now()){let n=Date.parse(e);if(!Number.isFinite(n))return`unknown`;let r=Math.floor(Math.max(0,t-n)/1e3);if(r<60)return`${r}s ago`;let i=Math.floor(r/60);if(i<60)return`${i}m ago`;let a=Math.floor(i/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}const ze=new Set([`start`,`stop`,`status`,`clean`,`ui`,`mcp`,`preview`,`lint`,`audit`,`deinit`,`auth`]);function Be(e,t,n=T){if(e!==void 0&&!ze.has(e))return null;let r=n(t);return r===null||r.distance===0?null:r.rootPath}let Ve=null;function He(e){Ve=e}function Ue(){return Ve??process.cwd()}const We=`Open Knowledge`;function Ge(e={}){let t=e.platformName??process.platform,n=e.productName??f().productName;return ie(t).join(ae({...e,platformName:t}),n)}function Ke(e={}){let t=e.platformName??process.platform,n=e.home??q(),r=e.env??process.env,i=ie(t),a;return a=t===`win32`?r.LOCALAPPDATA||i.join(n,`AppData`,`Local`):t===`darwin`?i.join(n,`Library`,`Caches`):r.XDG_CACHE_HOME||i.join(n,`.cache`),i.join(a,`${f().packageName.replaceAll(`/`,``)}-updater`)}function qe(e){if(typeof e!=`object`||!e)return null;let t=e.recentProjects;if(!Array.isArray(t))return null;let n=[];for(let e of t){if(typeof e!=`object`||!e)continue;let t=e;typeof t.path==`string`&&typeof t.name==`string`&&n.push({path:t.path,name:t.name})}return n}function Je(e){let t=R(e,`state.json`);if(!V(t))return[];let n;try{n=JSON.parse(U(t,`utf-8`))}catch{return[]}return qe(n)??[]}function Ye(e){let t=R(e,`state.json`);if(!V(t))return!1;try{return qe(JSON.parse(U(t,`utf-8`)))!==null}catch{return!1}}const Xe=8192;function Ze(e,t){if(e.outcome===`not-present`)return`not-present (no DiagnosticReports directory)`;if(e.outcome===`unreadable-directory`)return`unreadable (${e.directoryErrorCode??`unknown`} reading DiagnosticReports)`;let n=[`${e.windowDays}d`,`${e.foreignIgnored} other-process report(s) ignored`,`${e.unparseable} unparseable`];e.droppedOverCap>0&&n.push(`${e.droppedOverCap} older dropped over cap`);let r=e.files.length-t;return r>0&&n.push(`${r} vanished before staging`),e.outcome===`none-in-window`?`none found in window (${n.join(`; `)})`:`${t} collected (${n.join(`; `)})`}function Qe(e){return e.replace(/\\+\/?/g,e=>{if(!e.endsWith(`/`))return e;let t=e.length-1;return`${`\\`.repeat(t-t%2)}/`})}const $e=RegExp(`("(?:${[`crashReporterKey`,`bootSessionUUID`,`deviceIdentifierForVendor`].join(`|`)})"\\s*:\\s*)"[^"]*"`,`g`);function et(e){return e.replace($e,`$1"[REDACTED-DEVICE-ID]"`)}function tt(e){return et(Qe(e))}const nt=/^(\d{4}-\d{2}-\d{2}) (\d{2}:\d{2}:\d{2})(\.\d+)? ([+-]\d{2})(\d{2})$/;function rt(e){if(typeof e!=`string`)return null;let t=nt.exec(e.trim());if(t===null)return null;let[,n,r,i=``,a,o]=t,s=Date.parse(`${n}T${r}${i}${a}:${o}`);return Number.isNaN(s)?null:s}function it(e){let t=be(e,`r`);try{let e=Buffer.alloc(Xe),n=0,r=!1;for(;n<Xe;){let i=xe(t,e,n,Xe-n,n);if(i===0){r=!0;break}let a=n;n+=i;let o=e.subarray(0,n).indexOf(10,a);if(o!==-1)return e.subarray(0,o).toString(`utf-8`)}return r?e.subarray(0,n).toString(`utf-8`):null}finally{he(t)}}function at(e){try{let t=it(e);if(t===null)return{kind:`unreadable`};let n=JSON.parse(t);if(typeof n!=`object`||!n)return{kind:`unreadable`};let{name:r,app_name:i,timestamp:a}=n,o=typeof r==`string`?r:typeof i==`string`?i:null;return o===null?{kind:`unreadable`}:{kind:`named`,name:o,timestampMs:rt(a)}}catch{return{kind:`unreadable`}}}function ot(e){return e===`OpenKnowledge`||e.startsWith(`OpenKnowledge `)}function st(e,t){let n={files:[],foreignIgnored:0,unparseable:0,droppedOverCap:0,windowDays:7},r;try{r=W(e,{withFileTypes:!0})}catch(e){let t=e.code;return t===`ENOENT`?{...n,outcome:`not-present`}:{...n,outcome:`unreadable-directory`,directoryErrorCode:t??`unknown`}}let i=t.getTime()-6048e5,a=[],o=0,s=0;for(let t of r){if(!t.isFile()||!t.name.endsWith(`.ips`))continue;let n=R(e,t.name),r;try{r=Te(n).mtimeMs}catch{continue}if(r<i)continue;let c=at(n),l=c.kind===`named`&&c.timestampMs!==null?c.timestampMs:r;if(c.kind===`unreadable`){s+=1;continue}if(!ot(c.name)){o+=1;continue}a.push({path:n,atMs:l})}a.sort((e,t)=>t.atMs-e.atMs);let c=a.slice(0,25),l={foreignIgnored:o,unparseable:s,droppedOverCap:a.length-c.length,windowDays:7};return c.length===0?{...l,files:[],outcome:`none-in-window`}:{...l,files:c.map(e=>e.path),outcome:`collected`}}function J(){return R(g(),`bug-reports`)}function ct(e=new Date){let t=e.toISOString().replace(/[:.]/g,`-`),n=J(),r=`${t}-bugreport`,i=R(n,`${r}.zip`);for(let e=2;V(i);e+=1)i=R(n,`${r}-${e}.zip`);return i}function lt(e,t){let{scrubbed:n}=e;return n!==void 0&&n.patterns.length>0?{file:t,lineCount:n.lineCount,patterns:[...n.patterns]}:null}function ut(e,t){let n=R(e,`.ok`,`config.yml`);if(V(n))try{let e=U(n,`utf8`).match(/^\s*name:\s*['"]?(.+?)['"]?\s*$/m);if(e?.[1])return e[1]}catch(e){t?.warn({configPath:n,err:e},`bug-report: failed to read .ok/config.yml for project slug; using path-hash fallback`)}return V(R(e,`.ok`))?Fe(`sha256`).update(z(e)).digest(`hex`).slice(0,12):null}function dt(){let e={timestamp:new Date().toISOString(),platform:ke(),osType:Ne(),osRelease:Ae(),hostname:`[redacted]`,uptime:Pe(),freeMem:De(),totalMem:Me(),nodeVersion:process.version,bunVersion:process.versions.bun??null,v8Version:process.versions.v8??null,pid:process.pid};try{e.macosVersion=de(`sw_vers -productVersion 2>/dev/null`,v({encoding:`utf8`})).trim()}catch{}try{let t=R(__dirname,`..`,`..`,`package.json`);V(t)&&(e.okVersion=JSON.parse(U(t,`utf8`)).version)}catch{}return e}const ft=[{prefix:`cli`,projectTagged:!0},{prefix:`desktop`,projectTagged:!1},{prefix:`mcp`,projectTagged:!1}];function pt(e){let t=I(e);return ft.some(e=>e.projectTagged&&t.startsWith(`${e.prefix}.`))}function mt(e,t){return vt(e,t).files}const ht=[`ShipIt_stderr.log`,`ShipIt_stdout.log`];function gt(e,t=oe){let n=R(e,`${t}.ShipIt`);if(!V(n))return[];let r;try{r=W(n)}catch{return[]}return ht.flatMap(e=>r.map(t=>{if(t===e)return{entry:t,suffix:-1};if(!t.startsWith(`${e}.`))return null;let n=t.slice(e.length+1);return/^\d+$/.test(n)?{entry:t,suffix:Number(n)}:null}).filter(e=>e!==null).sort((e,t)=>e.suffix-t.suffix).slice(0,4).map(e=>R(n,e.entry)))}function _t(e){if(!V(e))return[];try{let t=new Map;for(let n of W(e).filter(e=>e.endsWith(`.yaml`)).sort()){let e=n.endsWith(`.sent.yaml`)?n.slice(0,-p.length):n.slice(0,-5),r=t.get(e);r===void 0?t.set(e,[n]):r.push(n)}return[...t.values()].slice(-25).flat().map(t=>R(e,t))}catch{return[]}}function vt(e,t){if(!V(t))return{files:[],excludedByProjectSlug:0};let n=W(t).filter(e=>e.endsWith(`.log`)||/\.log\.\d+$/.test(e)).map(e=>R(t,e));if(!e)return{files:n,excludedByProjectSlug:0};let r=n.filter(pt),i=[],a=r.filter(t=>{try{return U(t,`utf8`).includes(`"project":"${e}"`)}catch{return i.push(t),!1}});if(a.length===0)return{files:n,excludedByProjectSlug:0};let o=new Set([...a,...i]);return{files:n.filter(e=>!pt(e)||o.has(e)),excludedByProjectSlug:r.length-o.size}}function yt(e){let n=R(e,`.ok`,`local`);return V(n)?{files:[`server.lock`,`last-spawn-error.log`,t,s].map(e=>R(n,e)).filter(e=>V(e))}:{files:[]}}function bt(e){let t=R(e,`.ok`,`local`,`logs`);return V(t)?{files:[`server-current.jsonl`,`server-prev.jsonl`].map(e=>R(t,e)).filter(e=>V(e))}:{files:[]}}function xt(e){let t=0,n=new Map,r=e.replace(/("(?:docName|doc\.name|documentName)"\s*:\s*")((?:[^"\\]|\\.)*)"/g,(e,r,i)=>{t+=1;let a=n.get(i);return a===void 0&&(a=`doc#${Fe(`sha256`).update(i).digest(`hex`).slice(0,12)}`,n.set(i,a)),`${r}${a}"`});for(let[e,i]of[...n].sort(([e],[t])=>t.length-e.length)){if(e.length===0||!r.includes(e))continue;let n=r.split(e);t+=n.length-1,r=n.join(i)}return{text:r,count:t}}function St(e){let t=e.revealDocNames?e.content:xt(e.content).text;if(e.redact){let{redacted:n,patterns:r,lineCount:i}=u(t);e.zipfile.addBuffer(Buffer.from(n,`utf8`),e.name),e.bundleFiles.push(e.name),r.length>0&&e.redactions.push({file:e.name,lineCount:i,patterns:r})}else e.zipfile.addBuffer(Buffer.from(t,`utf8`),e.name),e.bundleFiles.push(e.name)}function Y(e){for(let t of e.files)try{let n=U(t,`utf8`);St({zipfile:e.zipfile,name:`${e.prefix}/${I(t)}`,content:t.endsWith(`.ips`)?tt(n):n,redact:e.redact,revealDocNames:e.revealDocNames,bundleFiles:e.bundleFiles,redactions:e.redactions})}catch(n){e.logger?.warn({file:t,prefix:e.prefix,err:n},`bug-report: skipped unreadable file`)}}async function Ct(t){let{redact:n,outputPath:r,logger:i}=t,a=t.revealDocNames??!1,o=t.userLogsDir??R(g(),`logs`),s=t.projectDir?ut(t.projectDir,i):null;H(L(r),{recursive:!0}),i?.info({projectSlug:s},`gathering diagnostic data`);let c=dt();c.desktop=t.desktop??null,c.language=t.language??null;let{files:l,excludedByProjectSlug:u}=vt(s,o),{files:d}=t.projectDir?yt(t.projectDir):{files:[]},{files:f}=t.projectDir?bt(t.projectDir):{files:[]},p=t.shipItLogFiles??[],m=t.diagnosticReports?.files??[];i?.info({logFileCount:l.length,logFilesExcludedByProjectSlug:u,lockFileCount:d.length,localSinkFileCount:f.length,shipItLogFileCount:p.length,diagnosticReportCount:m.length},`files collected`);let h=[],_=[],{ZipFile:v}=await import(`./yazl-BsCX6KWo.mjs`).then(t=>e(t.default,1)),y=new v;Y({zipfile:y,files:[...l,...p],prefix:`logs`,redact:n,revealDocNames:a,bundleFiles:_,redactions:h,logger:i}),Y({zipfile:y,files:d,prefix:`lockdir`,redact:n,revealDocNames:a,bundleFiles:_,redactions:h,logger:i}),Y({zipfile:y,files:f,prefix:`local-logs`,redact:n,revealDocNames:a,bundleFiles:_,redactions:h,logger:i}),Y({zipfile:y,files:t.bugReportLedgerFiles??[],prefix:te,redact:n,revealDocNames:a,bundleFiles:_,redactions:h,logger:i}),Y({zipfile:y,files:m,prefix:`diagnostic-reports`,redact:n,revealDocNames:a,bundleFiles:_,redactions:h,logger:i});for(let e of t.extraFiles??[])try{let t=U(e.sourcePath),n=`extra/${e.zipName??I(e.sourcePath)}`;y.addBuffer(t,n),_.push(n);let r=lt(e,n);r!==null&&h.push(r)}catch(t){i?.warn({sourcePath:e.sourcePath,err:t},`extra file unreadable; omitted from bundle`)}t.note&&St({zipfile:y,name:`note.txt`,content:t.note,redact:n,revealDocNames:a,bundleFiles:_,redactions:h});let b=new Set(m.map(e=>`diagnostic-reports/${I(e)}`)),x=_.filter(e=>b.has(e)),S=t.diagnosticReports===void 0?`not-collected (no collection attempted)`:Ze(t.diagnosticReports,x.length);y.addBuffer(Buffer.from(`${S}\n`,`utf8`),`state/diagnostic-reports-status.txt`),_.push(`state/diagnostic-reports-status.txt`);let C=JSON.stringify(c,null,2);y.addBuffer(Buffer.from(C,`utf8`),`sysinfo.json`),_.push(`sysinfo.json`);let w={generatedAt:new Date().toISOString(),disciplineVersion:`1.0.0`,projectSlug:s,files:_,redactions:h,sysinfo:c};y.addBuffer(Buffer.from(JSON.stringify(w,null,2),`utf8`),`MANIFEST.json`);let T=h.reduce((e,t)=>e+t.lineCount,0),E=new Set(p.map(e=>`logs/${I(e)}`)),D=_.filter(e=>E.has(e)),O=new Set((t.bugReportLedgerFiles??[]).map(e=>`${te}/${I(e)}`)),k=_.filter(e=>O.has(e)),A=s?_.filter(e=>e.startsWith(`logs/`)&&!pt(e)&&!E.has(e)):[],j=x.length>0?[`Crash reports under diagnostic-reports/ are rewritten on the way in,`,`independently of this setting: escaped path separators are normalised`,`so the scrub above can read them, and the identifiers that link this`,`machine's bundles to each other are replaced. Nothing else is changed;`,`they are not byte-identical to the files macOS wrote.`]:[],M=j.length>0?[`Redaction was disabled for this bundle; file contents are unmodified,`,`with one exception.`,...j]:[`Redaction was disabled for this bundle; file contents are unmodified.`],N=[`# Bug Report Bundle`,``,`Generated: ${w.generatedAt}`,`Project: ${s??`(unscoped)`}`,`Discipline version: ${w.disciplineVersion}`,``,`## Contents`,``,..._.map(e=>`- ${e}`),``,`## Privacy`,``,...A.length>0?[`Scope: some collected logs are user-wide rather than project-scoped.`,`These are written once per machine per day and can contain activity`,`from other projects open on this machine, including captured console`,`output:`,...A.map(e=>`- ${e}`),``]:[],...D.length>0?[`Installer logs: written by the macOS update helper rather than by`,`OpenKnowledge itself, and machine-wide rather than scoped to any one`,`project. They record the install and update history of this app on`,`this machine. Only this app is collected, never other applications`,`that use the same update mechanism:`,...D.map(e=>`- ${e}`),``]:[],...x.length>0?[`Crash reports: written by macOS itself rather than by OpenKnowledge,`,`and machine-wide rather than scoped to any one project. They record`,`why the operating system ended a process of this app — the signal or`,`exception, the code-signing verdict, and whatever text the process`,`left behind as it died. They also carry machine details the OS puts`,`in every report: the account uid, the Mac model, and the name of the`,`process that launched this app, which on a managed machine can be`,`internal tooling. The identifiers that would link this machine's`,`bundles to each other are replaced before bundling. Only this`,`app's own reports are collected, never another application's, though`,`a report of ours still names the processes it ran alongside:`,...x.map(e=>`- ${e}`),``]:[],...k.length>0?[`Send history: a small record for each bug report previously generated`,`on this machine — when it was generated, whether sending it`,`succeeded, and why it failed if it did. This is what makes a failed`,`send diagnosable at all. It is machine-wide rather than scoped to`,`this project, so it names the other projects reports were filed`,`from. It carries no document content:`,...k.map(e=>`- ${e}`),``]:[],...n?[`This bundle was auto-redacted before packaging.`,`Patterns checked: ${ee.join(`, `)}`,T>0?`${T} line(s) were scrubbed across ${h.length} file(s).`:`No redactions were needed.`,`See MANIFEST.json for the full redaction audit report.`,...j,``,`This bundle is safe to attach to a GitHub issue.`]:M].join(`
|
|
2
|
+
`);y.addBuffer(Buffer.from(N,`utf8`),`README.md`),y.end();let P=_e(r);return y.outputStream.pipe(P),await new Promise((e,t)=>{P.on(`close`,e),P.on(`error`,t)}),i?.info({bundlePath:r,fileCount:_.length,redactionCount:T},`bundle written`),{zipPath:r,summary:{projectSlug:s,files:_,redactions:h,redactedLineCount:T,generatedAt:w.generatedAt}}}var wt=c(),Tt=e(F(),1),X=e(ce(),1);function Et(e){let t=A(`user`,e,e);return M({absPath:t,sideline:!1,warn:()=>{}}).value.appearance?.language??`system`}function Dt({home:e=q(),env:t=process.env}={}){let n=Et(e),{override:r,preferenceList:o}=k(t),{locale:s,source:c}=Le({override:r,storedPreference:n,supportedLocales:a,preferenceList:o,autoDetectableLocales:i});return{preference:n,locale:s,source:c,systemLanguages:o}}function Ot(e){let t=new Set([e]);try{t.add(Ce.native(e))}catch{return[e].filter(e=>e.length>0)}return[...t].filter(e=>e.length>0).sort((e,t)=>t.length-e.length)}function kt(e,t){let n=e;for(let e of t)n.includes(e)&&(n=n.split(e).join(`<CONTENT_DIR>`));return n}function At(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Z(e,t){if(typeof e==`string`)return kt(e,t.contentDirSpellings);if(Array.isArray(e))return e.map(e=>Z(e,t));if(!At(e))return e;let n={};for(let[r,i]of Object.entries(e))n[r]=Z(i,t);return n}function jt(e,t){let n=U(e,`utf-8`);if(n.length===0)return;let r=n.endsWith(`
|
|
3
|
+
`),i=n.split(`
|
|
4
|
+
`),a=[];for(let e=0;e<i.length;e++){let n=i[e]??``;if(e!==i.length-1||n!==``){if(n.length===0){a.push(``);continue}try{let e=Z(JSON.parse(n),t);a.push(JSON.stringify(e))}catch{a.push(n)}}}let o=r?`${a.join(`
|
|
5
|
+
`)}\n`:a.join(`
|
|
6
|
+
`);K(e,o)}function Mt(e,t){let n=U(e,`utf-8`);if(n.trim().length!==0)try{let r=Z(JSON.parse(n),t),i=n.endsWith(`
|
|
7
|
+
`)?`
|
|
8
|
+
`:``;K(e,`${JSON.stringify(r,null,2)}${i}`)}catch{let r=kt(n,t.contentDirSpellings);r!==n&&K(e,r)}}function Nt(e,t){let n=U(e,`utf-8`),r=kt(n,t.contentDirSpellings);r!==n&&K(e,r)}function Pt(e){try{return W(e,{withFileTypes:!0}).filter(e=>e.isFile()).map(t=>R(e,t.name))}catch{return[]}}const Ft=new Set([`agent-presence.json`,`agent-effects.json`,`runtime.json`]);function It(e){return/\.log\.\d+$/.test(e)}function Lt(e){return e.endsWith(`.jsonl`)||e.endsWith(`.log`)||It(e)}const Rt=[`telemetry`,`logs`,`process`,`diagnostic-reports`];function zt(e){let t={contentDirSpellings:Ot(e.contentDir)};for(let n of Rt)for(let r of Pt(R(e.stagingDir,n)))Lt(r)?jt(r,t):r.endsWith(`.json`)?Mt(r,t):Nt(r,t);for(let n of Pt(R(e.stagingDir,`state`))){let e=I(n);n.endsWith(`.jsonl`)?jt(n,t):Ft.has(e)?Mt(n,t):Nt(n,t)}}const Bt=[`.ok`,`local`,`telemetry`],Vt=[`.ok`,`local`,`logs`],Ht=[`.ok`,`local`,`loss-capture`],Ut=`spans-current.jsonl`,Wt=`spans-prev.jsonl`,Gt=`server-current.jsonl`,Kt=`server-prev.jsonl`,qt=`loss-current.jsonl`,Jt=`loss-prev.jsonl`;function Yt(e){return R(e,...Bt,Ut)}function Xt(e){return R(e,...Bt,Wt)}function Zt(e){return R(e,...Vt,Gt)}function Qt(e){return R(e,...Vt,Kt)}function $t(e){return R(e,...Ht,qt)}function en(e){return R(e,...Ht,Jt)}const tn=1e3;async function nn(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/agent-presence`,{signal:AbortSignal.timeout(tn)});return t.ok?await t.text():null}catch{return null}}async function rn(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/agent-effects`,{signal:AbortSignal.timeout(tn)});return t.ok?await t.text():null}catch{return null}}async function an(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/watcher-recent`,{signal:AbortSignal.timeout(tn)});return t.ok?await t.text():null}catch{return null}}function on(e){try{let t=JSON.parse(e);if(typeof t!=`object`||!t)return null;let n=t.decisions;return Array.isArray(n)?n.length===0?``:`${n.map(e=>JSON.stringify(e)).join(`
|
|
9
|
+
`)}\n`:null}catch{return null}}function sn(e){let t=R(e,`.git`,`ok`);if(!V(t))return null;let n=fe(`git`,[`-C`,t,`log`,`--oneline`,`-50`],v({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function cn(e){let t=R(e,`.git`,`ok`);if(!V(t))return null;let n=fe(`git`,[`-C`,t,`for-each-ref`,`--sort=-creatordate`,`--count=50`,`--format=%(refname)%09%(creatordate:iso-strict)%09%(contents:subject)`,`refs/checkpoints/`],v({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function ln(){let e=process.env.OK_DESKTOP_VERSION,t=process.env.OK_DESKTOP_PACKAGED,n=process.env.OK_DESKTOP_CHANNEL;return e===void 0||t===void 0||n===void 0?null:{electronVersion:e,packaged:t===`1`||t.toLowerCase()===`true`,channel:n}}function un(){return{nodeVersion:process.version,platform:ke(),arch:Ee()}}function dn(){return process.env.OTEL_SDK_DISABLED===`false`}function fn(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function pn(e){if(!V(e))return{};let t;try{t=(0,wt.parse)(U(e,`utf-8`))}catch(t){return console.warn(`[ok diagnose bundle] failed to parse ${e} for manifest config; manifest will report schema defaults. Reason: ${t instanceof Error?t.message:String(t)}`),{}}if(!fn(t))return{};let n=t.telemetry;if(!fn(n))return{};let r=n.localSink;return fn(r)?r:{}}function mn(e){return typeof e==`boolean`?e:void 0}function hn(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:void 0}function gn(e){if(fn(e))return hn(e.maxBytes)}function _n(e){let t=pn(A(`project`,e)),n=pn(A(`project-local`,e));return{enabled:mn(n.enabled)??mn(t.enabled)??!0,spansMaxBytes:gn(n.spans)??gn(t.spans)??52428800,logsMaxBytes:gn(n.logs)??gn(t.logs)??26214400}}function vn(e){return Fe(`sha256`).update(e).digest(`hex`)}function yn(e){let t=U(e),n=0;for(let e=0;e<t.length;e++)t[e]===10&&n++;return n}const bn=[`"doc.name"`,`"docName"`];function xn(e){let t=U(e,`utf-8`),n=0;for(let e of bn){let r=t.indexOf(e);for(;r!==-1;)n++,r=t.indexOf(e,r+e.length)}return n}function Q(e,t){if(!V(e))return!1;try{return H(L(t),{recursive:!0}),e.endsWith(`.ips`)?K(t,tt(U(e,`utf-8`))):ge(e,t),!0}catch{return!1}}function Sn(e){let t=[],n=e=>{let r=W(e,{withFileTypes:!0});for(let i of r){let r=R(e,i.name);i.isDirectory()?n(r):i.isFile()&&t.push(r)}};return n(e),t.sort()}const Cn=new Set([`.jsonl`]);function wn(e){let t=e.lastIndexOf(`.`);return t!==-1&&Cn.has(e.slice(t))}const Tn=new Set([`.jsonl`,`.json`,`.txt`,`.log`,`.lock`,`.yaml`,`.yml`,`.ips`]);function En(e){if(It(e))return!0;let t=e.lastIndexOf(`.`);return t!==-1&&Tn.has(e.slice(t))}function Dn(e){let t=[];for(let n of Sn(e)){let r=On(e,n);if(!En(r))continue;let{redacted:i,patterns:a,lineCount:o}=u(U(n,`utf-8`));a.length!==0&&(K(n,i),t.push({file:r,lineCount:o,patterns:a}))}return{redactions:t,redactedLineCount:t.reduce((e,t)=>e+t.lineCount,0)}}function On(e,t){return me(e,t).split(B).join(`/`)}async function kn(e){let n=z(e.contentDir),i=z(e.projectDir??e.contentDir),a=e.deps??{},o=a.fetchAgentPresence??nn,c=a.fetchAgentEffects??rn,l=a.fetchWatcherRecent??an,u=a.readShadowHead??sn,d=a.readCheckpointRefs??cn,ee=a.now??(()=>new Date),f=a.okVersion??(()=>ue),p=a.readDesktopEnv??ln,m=a.readLanguage??Dt,h=a.readRuntime??un,g=a.isOtlpPushEnabled??dn,_=ye(R(je(),`ok-bundle-`));try{H(R(_,`telemetry`),{recursive:!0}),H(R(_,`logs`),{recursive:!0}),H(R(_,`state`),{recursive:!0}),Q(Yt(i),R(_,`telemetry`,Ut)),Q(Xt(i),R(_,`telemetry`,Wt)),Q(Zt(i),R(_,`logs`,Gt)),Q(Qt(i),R(_,`logs`,Kt));for(let t of e.userLogFiles??[])Q(t,R(_,`logs`,I(t)));for(let t of e.userStateFiles??[])Q(t,R(_,te,I(t)));let v=0;for(let t of e.diagnosticReports?.files??[])Q(t,R(_,`diagnostic-reports`,I(t)))&&(v+=1);let y=R(i,`.ok`,`local`),b=R(y,`server.lock`),x=`not-running`,S=`no server.lock`,C=null;if(V(b)){Q(b,R(_,`state`,`server.lock`));try{let e=U(b,`utf-8`),t=JSON.parse(e);typeof t.port==`number`?C=t.port:S=`lock present but no port`}catch{S=`lock present but unparseable`}}if(C!==null){let e=await o(C);e===null?S=`agent-presence endpoint at :${C} unreachable`:(K(R(_,`state`,`agent-presence.json`),e),x=`running`,S=``);let t=await c(C);t!==null&&K(R(_,`state`,`agent-effects.json`),t);let n=await l(C);if(n!==null){let e=on(n);e!==null&&K(R(_,`state`,`watcher-recent.jsonl`),e)}}let w=u(n);w!==null&&K(R(_,`state`,`shadow-head.txt`),w);let T=d(n);T!==null&&K(R(_,`state`,`checkpoint-refs.txt`),T),Q($t(i),R(_,`state`,qt)),Q(en(i),R(_,`state`,Jt)),Q(R(y,`last-spawn-error.log`),R(_,`state`,`last-spawn-error.log`)),Q(R(y,r),R(_,`state`,r)),Q(R(y,t),R(_,`state`,t)),Q(R(y,s),R(_,`state`,s));let E=h(),D=p(),O=m(),k={ok:{version:f(),nodeVersion:E.nodeVersion,platform:E.platform,arch:E.arch},host:{desktop:D,language:O}};K(R(_,`state`,`runtime.json`),`${JSON.stringify(k,null,2)}\n`);let A=x===`running`?`running
|
|
10
|
+
`:`not-running (${S})\n`;K(R(_,`state`,`server-status.txt`),A);let j=e.diagnosticReports===void 0?`not-collected (no collection attempted)`:Ze(e.diagnosticReports,v);if(K(R(_,`state`,`diagnostic-reports-status.txt`),`${j}\n`),e.processDir&&V(e.processDir)){let t=R(_,`process`);H(t,{recursive:!0}),ge(e.processDir,t,{recursive:!0})}let M=e.redact===!0;M&&zt({stagingDir:_,contentDir:n}),e.note&&K(R(_,`note.txt`),e.note);let N=null;e.scrubSecrets===!0&&(N=Dn(_));for(let t of e.extraFiles??[]){let e=t.zipName??I(t.sourcePath);if(!Q(t.sourcePath,R(_,`extra`,e))){a.logger?.warn({sourcePath:t.sourcePath},`extra file missing; omitted from bundle`);continue}let n=lt(t,`extra/${e}`);n!==null&&(N??={redactions:[],redactedLineCount:0},N.redactions.push(n),N.redactedLineCount+=n.lineCount)}let P=_n(i),ne=Sn(_),F=[],re=0,ie=0;for(let e of ne){let t=On(_,e),n=Te(e).size,r=wn(t)?yn(e):0;F.push({path:t,bytes:n,lines:r}),re+=n,(t.startsWith(`telemetry/`)||t.startsWith(`logs/`))&&(ie+=xn(e))}let ae={applied:M};N!==null&&(ae.secretScrub=N);let oe={schemaVersion:2,createdAt:ee().toISOString(),ok:{version:f(),nodeVersion:E.nodeVersion,platform:E.platform,arch:E.arch},host:{desktop:D,language:O},contentDir:{pathSha256:vn(n),absolutePath:M?`<CONTENT_DIR>`:n},telemetry:{localSink:P,otlpPushEnabled:g()},redaction:ae,serverStatus:x,files:F};K(R(_,`manifest.json`),`${JSON.stringify(oe,null,2)}\n`);let se=Ot(n),ce=ne.some(e=>{try{let t=U(e,`utf-8`);return se.some(e=>t.includes(e))}catch{return!1}}),le={stagedDiagnosticReports:v,totalBytes:re,fileCount:F.length,docNameCount:ie,contentDirVisible:ce,redacted:M},ue=!1;return{stagingDir:_,manifest:oe,summary:le,cleanup:()=>{ue||(ue=!0,G(_,{recursive:!0,force:!0}))}}}catch(e){throw G(_,{recursive:!0,force:!0}),e}}async function An(e){let{collected:t,outputPath:n}=e,r=L(n);if(!V(r))throw Error(`ok diagnose bundle: parent directory does not exist: ${r}. Create it or pass --out with an existing parent.`);let i=new Tt.ZipFile,a=Sn(t.stagingDir);for(let e of a){let n=On(t.stagingDir,e);i.addFile(e,n)}i.end();let o=_e(n);return i.outputStream.pipe(o),await new Promise((e,t)=>{o.on(`close`,e),o.on(`error`,t),i.outputStream.on(`error`,t)}),n}function jn(e,t){let n=R(e,`.ok`,`config.yml`);if(V(n))try{let t=(0,wt.parse)(U(n,`utf-8`)),r=le(t)?t.content:void 0,i=le(r)?r.dir:void 0;if(typeof i==`string`&&i.length>0)return z(e,i)}catch(e){t?.warn({configPath:n,err:e},`bug-report: failed to read .ok/config.yml; falling back to project root as content dir`)}return z(e)}async function Mn(e,t,n,r,i){let a=ut(t,e.logger),o=await kn({contentDir:jn(t,e.logger),projectDir:t,redact:e.redact,scrubSecrets:e.redact,note:e.note,extraFiles:e.extraFiles,userLogFiles:[...mt(a,e.userLogsDir??R(g(),`logs`)),...gt(e.cachesDir??R(q(),`Library`,`Caches`))],userStateFiles:_t(e.bugReportsDir??J()),diagnosticReports:i,deps:{readDesktopEnv:n,readLanguage:r,logger:e.logger}});try{H(L(e.outputPath),{recursive:!0}),await An({collected:o,outputPath:e.outputPath});let t=o.manifest.redaction.secretScrub;return{zipPath:e.outputPath,summary:{level:`full`,systemWide:!1,projectSlug:a,files:o.manifest.files.map(e=>e.path),redactions:t?.redactions??[],redactedLineCount:t?.redactedLineCount??0,generatedAt:o.manifest.createdAt}}}finally{o.cleanup()}}async function Nn(e){let{projectDir:t}=e,n=e.readDesktopEnv??ln,r=e.readLanguage??Dt,i=()=>st(e.diagnosticReportsDir??R(q(),`Library`,`Logs`,`DiagnosticReports`),new Date);if(e.level===`full`&&t!==void 0)return Mn(e,t,n,r,i());let{zipPath:a,summary:o}=await Ct({projectDir:t,redact:e.redact,revealDocNames:e.level===`full`,outputPath:e.outputPath,userLogsDir:e.userLogsDir,shipItLogFiles:gt(e.cachesDir??R(q(),`Library`,`Caches`)),bugReportLedgerFiles:_t(e.bugReportsDir??J()),diagnosticReports:e.level===`full`?i():void 0,logger:e.logger,note:e.note,extraFiles:e.extraFiles,desktop:n(),language:r()});return{zipPath:a,summary:{level:e.level,systemWide:t===void 0,projectSlug:o.projectSlug,files:o.files,redactions:o.redactions,redactedLineCount:o.redactedLineCount,generatedAt:o.generatedAt}}}function $(e,t,n={}){let r=w(e,t),i;try{i=U(r,`utf-8`)}catch(e){return e&&typeof e==`object`&&`code`in e&&e.code===`ENOENT`?{status:`missing`,lockPath:r}:{status:`read-error`,lockPath:r,error:e instanceof Error?e.message:String(e)}}let a;try{a=JSON.parse(i)}catch{return{status:`corrupt`,lockPath:r}}let o=a&&typeof a==`object`?a:{},s=`machineId`in o&&typeof o.machineId==`string`?o.machineId!==(n.machineId??P()):`hostname`in o&&typeof o.hostname==`string`&&o.hostname!==(n.host??Oe());if(!a||typeof a!=`object`||!E(a.pid))return{status:`corrupt`,lockPath:r,...s?{foreignHost:!0}:{}};let c=a.pid,l=`machineId`in o&&typeof o.machineId==`string`||`hostname`in o&&typeof o.hostname==`string`;return s?{status:`foreign-host`,lockPath:r,lock:a}:(n.isAlive??C)(c)?l?{status:`alive`,lockPath:r,lock:a}:{status:`unverified-owner`,lockPath:r,pid:c}:{status:`dead-pid`,lockPath:r,lock:a}}function Pn(e){return e.status===`unverified-owner`?`Cannot verify shutdown: the server lock at ${e.lockPath} does not record its owning machine, and its recorded process ${e.pid} is still running on this machine. Check whether process ${e.pid} is an OpenKnowledge server. If it is, stop it and retry. Do not remove the lock file while that process is running.`:`Cannot verify shutdown: the server lock at ${e.lockPath} belongs to another machine. Stop OpenKnowledge on the owning machine. Confirm that no OpenKnowledge server is using this directory on the owning machine or any other machine sharing it. Only then remove the stale lock file at ${e.lockPath} and retry cleanup.`}function Fn(e){return e.replace(/:\d+$/,``)}function In(e){let t=e.trim();if(!t)return null;{let e=/^https?:\/\/(?:[^/?#]*@)?([^@/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`https`,hostname:Fn(e[1]),owner:e[2],name:e[3]}}{let e=/^ssh:\/\/(?:[^/?#]*@)?([^@/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`ssh`,hostname:Fn(e[1]),owner:e[2],name:e[3]}}{let e=/^git:\/\/([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`git`,hostname:Fn(e[1]),owner:e[2],name:e[3]}}{let e=/^(?:[\w.\-~%]+@)?([\w.-]+):([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?$/.exec(t);if(e?.[1].includes(`.`)||e&&t.startsWith(`git@`))return{protocol:`ssh`,hostname:e[1],owner:e[2],name:e[3]}}{let e=/^git:([\w.-]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`git`,hostname:e[1],owner:e[2],name:e[3]}}if(!t.includes(`://`)&&!t.includes(`@`)&&!t.startsWith(`/`)){let e=/^([\w.-]+)\/([\w.\-~%]+?)(?:\.git)?$/.exec(t);if(e)return{protocol:`https`,hostname:`github.com`,owner:e[1],name:e[2]}}return null}const Ln=/^# >>> open-knowledge cli >>>\n[\s\S]*?^# <<< open-knowledge cli <<<\n?/m;function Rn(e){return l(h(),e)}function zn(){return o(h())}function Bn(){let e=h();if(e===`stable`)return Ln;let t=n(e);return RegExp(`^# >>> ${t} >>>\\n[\\s\\S]*?^# <<< ${t} <<<\\n?`,`m`)}const Vn={existsSync:e=>V(e),readFileSync:(e,t)=>U(e,t),lstatSync:e=>ve(e),readlinkSync:e=>Se(e)};function Hn(e,t=Vn){let n=Rn(e);if(!t.existsSync(n))return null;try{let e=JSON.parse(t.readFileSync(n,`utf8`));return e?.version===1?e:null}catch{return null}}function Un(e){let t=e.replace(Bn(),``);return{text:t,changed:t!==e,emptyAfter:t.trim()===``}}function Wn(e,t,n=Vn){try{return n.lstatSync(e).isSymbolicLink()?n.readlinkSync(e)===t:!1}catch{return!1}}const Gn=[{hostDir:`.adal`,pruneRoot:`.adal`},{hostDir:`.aider-desk`,pruneRoot:`.aider-desk`},{hostDir:`.astrbot/data`,pruneRoot:`.astrbot`},{hostDir:`.augment`,pruneRoot:`.augment`},{hostDir:`.autohand`,pruneRoot:`.autohand`},{hostDir:`.bob`,pruneRoot:`.bob`},{hostDir:`.codeartsdoer`,pruneRoot:`.codeartsdoer`},{hostDir:`.codebuddy`,pruneRoot:`.codebuddy`},{hostDir:`.codeium/windsurf`,pruneRoot:`.codeium`},{hostDir:`.codemaker`,pruneRoot:`.codemaker`},{hostDir:`.codestudio`,pruneRoot:`.codestudio`},{hostDir:`.commandcode`,pruneRoot:`.commandcode`},{hostDir:`.config/crush`,pruneRoot:`.config/crush`},{hostDir:`.config/devin`,pruneRoot:`.config/devin`},{hostDir:`.config/goose`,pruneRoot:`.config/goose`},{hostDir:`.config/kimchi/harness`,pruneRoot:`.config/kimchi`},{hostDir:`.continue`,pruneRoot:`.continue`},{hostDir:`.factory`,pruneRoot:`.factory`},{hostDir:`.forge`,pruneRoot:`.forge`},{hostDir:`.grok`,pruneRoot:`.grok`},{hostDir:`.iflow`,pruneRoot:`.iflow`},{hostDir:`.inferencesh`,pruneRoot:`.inferencesh`},{hostDir:`.jazz`,pruneRoot:`.jazz`},{hostDir:`.junie`,pruneRoot:`.junie`},{hostDir:`.kilocode`,pruneRoot:`.kilocode`},{hostDir:`.kiro`,pruneRoot:`.kiro`},{hostDir:`.kode`,pruneRoot:`.kode`},{hostDir:`.lingma`,pruneRoot:`.lingma`},{hostDir:`.mcpjam`,pruneRoot:`.mcpjam`},{hostDir:`.moxby`,pruneRoot:`.moxby`},{hostDir:`.mux`,pruneRoot:`.mux`},{hostDir:`.neovate`,pruneRoot:`.neovate`},{hostDir:`.ona`,pruneRoot:`.ona`},{hostDir:`.openhands`,pruneRoot:`.openhands`},{hostDir:`.pochi`,pruneRoot:`.pochi`},{hostDir:`.qoder`,pruneRoot:`.qoder`},{hostDir:`.qoder-cn`,pruneRoot:`.qoder-cn`},{hostDir:`.qwen`,pruneRoot:`.qwen`},{hostDir:`.reasonix`,pruneRoot:`.reasonix`},{hostDir:`.roo`,pruneRoot:`.roo`},{hostDir:`.rovodev`,pruneRoot:`.rovodev`},{hostDir:`.snowflake/cortex`,pruneRoot:`.snowflake`},{hostDir:`.tabnine/agent`,pruneRoot:`.tabnine`},{hostDir:`.terramind`,pruneRoot:`.terramind`},{hostDir:`.tinycloud`,pruneRoot:`.tinycloud`},{hostDir:`.trae`,pruneRoot:`.trae`},{hostDir:`.trae-cn`,pruneRoot:`.trae-cn`},{hostDir:`.vibe`,pruneRoot:`.vibe`},{hostDir:`.zcode`,pruneRoot:`.zcode`},{hostDir:`.zencoder`,pruneRoot:`.zencoder`}],Kn=[...D.map(e=>O[e]),`open-knowledge`];function qn(e){if(!pe(e))throw Error(`skill cleanup requires an absolute home directory; got ${JSON.stringify(e)}`);let t=z(e);if(t===B||L(t)===t)throw Error(`skill cleanup refuses to operate on the filesystem root (${t})`);return t}function Jn(e,t){let n=me(e,t);if(n.startsWith(`..`)||pe(n))return!1;let r=e;for(let e of n.split(B)){r=R(r,e);try{if(!ve(r).isDirectory())return!1}catch{return!1}}return!0}function Yn(e,t){try{return W(e).every(n=>t.has(R(e,n)))}catch{return!1}}function Xn(e){let t=qn(e),n=[],r=[],i=new Set;for(let e of Gn){let a=R(t,e.hostDir,`skills`);if(!Jn(t,a))continue;let o=Kn.map(e=>R(a,e)).filter(e=>V(e));n.push(...o);for(let e of o)i.add(e);let s=R(t,e.pruneRoot),c=a;for(;Yn(c,i)&&(r.push(c),i.add(c),c!==s);){let e=L(c);if(e===c||e===t||!e.startsWith(t+B))break;c=e}}return{skillDirs:n,emptyDirs:r}}function Zn(e){try{if(!ve(e).isDirectory())return!1;let t=W(e);return t.length===0||t.includes(`SKILL.md`)}catch{return!1}}function Qn(e){let t=new Set,n=new Set;for(let r of Gn){let i=R(e,r.hostDir,`skills`);for(let e of Kn)t.add(R(i,e));let a=R(e,r.pruneRoot),o=i;for(;n.add(o),o!==a;){let t=L(o);if(t===o||t===e||!t.startsWith(e+B))break;o=t}}return{skillDirs:t,emptyDirs:n}}function $n(e,t){let n=qn(e),r=Qn(n),i=[...t.skillDirs.filter(e=>!r.skillDirs.has(e)),...t.emptyDirs.filter(e=>!r.emptyDirs.has(e))];if(i.length>0)throw Error(`refusing skill cleanup — ${i.length} path(s) outside the known legacy set: ${i.join(`, `)}`);let a=[];for(let e of t.skillDirs)if(Jn(n,e)&&Zn(e))try{G(e,{recursive:!0,force:!0}),a.push(e)}catch{}for(let e of t.emptyDirs)if(Jn(n,e))try{we(e),a.push(e)}catch{}return a}function er(e){let t=qn(e),n=[];for(let e of D){let r=O[e];n.push({path:R(t,`.agents`,`skills`,r),bundleId:e,scope:`central`});for(let i of d)n.push({path:R(t,i.skillsRoot,r),bundleId:e,scope:`host`,hostDir:i.hostDir})}return n}function tr(e,t){let n=[];for(let r of er(e))if(r.bundleId===t)try{G(r.path,{recursive:!0,force:!0})}catch(e){n.push(e instanceof Error?e:Error(String(e)))}if(n.length>0)throw AggregateError(n,`Failed to remove ${n.length} path(s) for ${t}`)}function nr(e){return e!=null&&e.includes(`--type=utility`)&&e.includes(`--utility-sub-type=node.mojom.NodeService`)}function rr(e,t=Date.now()){if(e===null)return`—`;let n=Re(e,t);return n===`unknown`?`—`:n}function ir(e){let t=L(e);return I(e)===`local`&&I(t)===`.ok`?L(t):I(e)===`.ok`?t:null}function ar(e,t,n,r){if(t.status===`missing`||t.status===`corrupt`||t.status===`read-error`)return null;if(t.status===`unverified-owner`)return{directory:ir(e),server:{port:null,status:t.status,pid:t.pid,startedAt:null,usage:null},ui:null,hostname:null,lockPath:t.lockPath,binary:null,command:null,isDesktop:!1};let i=t.lock,a=t.status===`alive`&&N(i)?{port:i.port,status:t.status,pid:i.pid,startedAt:i.startedAt,usage:r}:null;return{directory:i.worktreeRoot,server:{port:i.port,status:t.status,pid:i.pid,startedAt:i.startedAt,usage:r},ui:a,hostname:i.hostname,lockPath:t.lockPath,binary:n==null?null:j(n),command:n,isDesktop:nr(n)}}function or(e){let t=e.server.status;switch(t){case`unverified-owner`:return`unverified`;case`alive`:return e.isDesktop?`desktop`:`running`;case`foreign-host`:return e.isDesktop?`desktop`:`foreign`;case`dead-pid`:return`stale`;default:return t}}const sr=new Set([`running`,`desktop`,`foreign`,`unverified`]);function cr(e){switch(e){case`running`:return X.default.green(e);case`desktop`:return X.default.blue(e);case`foreign`:return X.default.cyan(e);case`unverified`:case`stale`:return X.default.yellow(e)}}function lr(e){return e==null?`—`:`${e.cpuPercent.toFixed(1)}% / ${e.memPercent.toFixed(1)}%`}function ur(e){return`${lr(e.server.usage)} | ${lr(e.ui?.usage??null)}`}function dr(e){return`${e.server.port===null?`—`:e.server.port===0?`(starting)`:String(e.server.port)} / ${e.ui==null?`—`:String(e.ui.port)}`}function fr(e){if(e.length===0)return`No open-knowledge servers found.`;let t=[`DIRECTORY`,`PORTS (API/UI)`,`CPU/MEM (API | UI)`,`STATUS`,`PID`,`STARTED`,`BINARY`],n=e.map(e=>[e.directory??`—`,dr(e),ur(e),or(e),String(e.server.pid),rr(e.server.startedAt),e.binary??`—`]),r=t.length,i=t.map(e=>e.length);for(let e of n)for(let t=0;t<r;t++)i[t]=Math.max(i[t]??0,(e[t]??``).length);let a=t.map((e,t)=>e.padEnd(i[t]??0)).join(` `).trimEnd(),o=e.map((e,t)=>{let a=n[t]??[],o=[];for(let t=0;t<r;t++){let n=(a[t]??``).padEnd(i[t]??0);if(t===3){let r=a[t]??``;n=cr(or(e))+` `.repeat(Math.max(0,(i[t]??0)-r.length))}o.push(n)}return o.join(` `).trimEnd()}),s=X.default.dim(`To stop a server: ok stop <port|pid|directory|all>`);return[a,...o,``,s].join(`
|
|
11
|
+
`)}async function pr(e={}){let t=e.discover??S,n=e.inspect??(e=>$(e,`server`)),r=e.log??(e=>console.log(e)),i=e.resolveCommand??y,a=e.resolveUsage??b,o=await t(),s=[];for(let e of o){let t=n(e),r=ar(e,t,t.status===`missing`||t.status===`corrupt`||t.status===`read-error`||t.status===`unverified-owner`?null:i(t.lock.pid),t.status===`missing`||t.status===`corrupt`||t.status===`read-error`||t.status===`unverified-owner`?null:a(t.lock.pid));r!=null&&s.push(r)}if(e.json){let e=s.map(e=>({...e,displayStatus:or(e)}));r(JSON.stringify(e,null,2));return}r(fr(e.all?s:s.filter(e=>sr.has(or(e)))))}function mr(){return new re(`ps`).description(`List all running open-knowledge servers`).argument(`[modifier]`,`"all" to include stale (dead-pid) entries`).option(`--all`,`Include stale entries (foreign and unverified entries already show)`).option(`--json`,`Emit structured JSON (always includes all statuses)`).action(async(e,t)=>{await pr({all:t.all===!0||e===`all`,json:t.json===!0})})}async function hr(e,t=se()){let n=$(e,`server`);if(n.status!==`alive`&&n.status!==`foreign-host`)return null;let r=ne(n.lock);if(r===null)return null;try{let n=await fetch(`${r}/api/server-info`,{signal:AbortSignal.timeout(1500),redirect:`manual`});if(!n.ok)return t?.warn({lockDir:e,baseUrl:r,outcome:`http-error`,status:n.status},`stop client-probe failed`),null;let i=(await n.json())?.collabClients;return typeof i==`number`&&Number.isFinite(i)?i:(t?.warn({lockDir:e,baseUrl:r,outcome:`no-client-count`,received:typeof i},`stop client-probe failed`),null)}catch(n){return t?.warn({lockDir:e,baseUrl:r,outcome:`unreachable`,err:n},`stop client-probe failed`),null}}function gr(e,t={}){return{targets:yr(e,t.isAlive??C)?[{name:`server`,pid:e.lock.pid,port:e.lock.port}]:[]}}function _r(e){try{return h()}catch(t){e?.warn({err:t},`stop channel check skipped: ${t instanceof Error?t.message:String(t)}`);return}}async function vr(e){let t=e.inspect??(()=>$(e.lockDir,`server`)),n=e.kill??((e,t)=>process.kill(e,t)),r=e.log??(e=>console.log(e)),i=e.error??(e=>console.error(e)),a=e.probeClients??hr,o=e.logger??se(),s=t(),c=gr(s,{isAlive:e.isAlive});if(c.targets.length===0)return r(`No running open-knowledge processes.`),o?.info({lockDir:e.lockDir,targets:0},`stop found nothing to signal`),{stopped:[],failed:[],hadTargets:!1};let l=s.status===`alive`||s.status===`foreign-host`?s.lock.channel:void 0;if(e.force!==!0&&typeof l==`string`&&l.length>0){let t=e.selfChannel??_r(o);if(t!==void 0&&l!==t)return i(`Not stopping: the server at ${e.lockDir} belongs to ${m(l)}. Stop it from that app or its CLI, or re-run with --force to terminate anyway.`),o?.warn({lockDir:e.lockDir,holderChannel:l,selfChannel:t,pids:c.targets.map(e=>e.pid)},`stop declined: server belongs to another channel`),{stopped:[],failed:[],hadTargets:!0,declined:{otherChannel:l}}}if(e.force!==!0){let t=await a(e.lockDir,o);if(t!==null&&t>0)return i(`Not stopping: ${t} collaboration client${t===1?``:`s`} (editor window${t===1?``:`s`} or agents) still connected to the server at ${e.lockDir}. Close them, or re-run with --force to terminate anyway.`),o?.warn({lockDir:e.lockDir,clients:t,pids:c.targets.map(e=>e.pid)},`stop declined: live collaboration clients`),{stopped:[],failed:[],hadTargets:!0,declined:{clients:t}}}let u=[],d=[];for(let e of c.targets)try{n(e.pid,`SIGTERM`),u.push(e)}catch(t){d.push({target:e,error:t instanceof Error?t.message:String(t)})}return u.length>0&&r(`Stopped: ${u.map(e=>`${e.name} (pid=${e.pid}, port=${e.port})`).join(`, `)}`),o?.info({lockDir:e.lockDir,signalled:u.map(e=>({name:e.name,pid:e.pid,port:e.port})),failed:d.map(({target:e,error:t})=>({pid:e.pid,error:t})),forced:e.force===!0},`stop signalled processes`),d.length>0&&i(`Failed to stop: ${d.map(({target:e,error:t})=>`${e.name} (pid=${e.pid}): ${t}`).join(`; `)}`),{stopped:u,failed:d,hadTargets:!0}}function yr(e,t){return e.status===`alive`||e.status===`foreign-host`&&t(e.lock.pid)}async function br(e,t=C){let n=await S(),r=null;for(let i of n){let n=$(i,`server`);if(yr(n,t)){if(n.lock.port===e)return i;r===null&&n.lock.pid===e&&(r=i)}}return r}async function xr(e,t){let n=await vr({lockDir:e,force:t});return(n.failed.length>0||n.declined!==void 0)&&(process.exitCode=1),n}function Sr(e,t,n={}){return t===0?`Nothing was running for ${e}, and no other open-knowledge servers are running.`:`Nothing was running for ${e}. ${t} other open-knowledge server${t===1?` is`:`s are`} running${n.listingFollows===!0?``:" — run `ok ps` to list them"}.`}async function Cr(e){let t=await S(),n=0;for(let r of t)r!==e&&yr($(r,`server`),C)&&n++;return n}function wr(e){return new re(`stop`).description(`Stop open-knowledge server(s). With no argument: stops the server for the enclosing project — run it from anywhere inside the project. Pass a port number, a directory path, or "all" to target globally.`).argument(`[target...]`,`port number, directory path (spaces OK), or "all"`).option(`--force`,`Stop even when the server belongs to another OpenKnowledge app (Stable or Beta) or editor windows or agents are still connected to it`).action(async(t,n)=>{let r=n.force===!0,i=t.length===0?void 0:t.join(` `);if(i===void 0){e();let t=_(process.cwd()),n=await vr({lockDir:t,force:r,log:()=>{}});if(n.hadTargets){if(n.stopped.length>0){let e=n.stopped.map(e=>`${e.name} (pid=${e.pid}, port=${e.port})`).join(`, `);console.log(`Stopped: ${e}`)}(n.failed.length>0||n.declined!==void 0)&&(process.exitCode=1)}else{let e=await Cr(t);console.log(Sr(process.cwd(),e,{listingFollows:e>0})),e>0&&await pr({})}return}if(i===`all`){let e=await S();if(e.length===0){console.log(`No running open-knowledge servers found.`);return}let t=0;for(let n of e)yr($(n,`server`),C)&&(await xr(n,r),t++);t===0&&console.log(`No running open-knowledge servers found.`);return}if(/^\d+$/.test(i)){let e=Number.parseInt(i,10),t=await br(e);if(t===null){console.log(`No running open-knowledge server found with port or PID ${e}.`);return}await xr(t,r);return}let a=z(Ue(),i),o=_(a),s=[],c=await vr({lockDir:o,force:r,log:e=>s.push(e)});if((c.failed.length>0||c.declined!==void 0)&&(process.exitCode=1),c.hadTargets)for(let e of s)console.log(e);else console.log(Sr(a,await Cr(o)))})}export{Ue as A,st as C,Ge as D,Ke as E,Be as M,Je as O,J as S,We as T,$ as _,$n as a,An as b,er as c,Rn as d,zn as f,Pn as g,In as h,mr as i,He as j,Ye as k,Ln as l,Un as m,vr as n,Xn as o,Hn as p,wr as r,tr as s,hr as t,Wn as u,Nn as v,Ze as w,ct as x,kn as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./md-manager-BGnqyqi1-BTvqIsKE.mjs";import"./src-C6syC3v6.mjs";import"./init-ZiC_qPS2.mjs";import"./registry-probes-DNaU56kl.mjs";import"./start-BcbkXw2n.mjs";import{n as e}from"./loader-DXV01FEG.mjs";import"./preview-CfRTddxX.mjs";import"./repair-mcp-configs-Bfys7jKY.mjs";export{e as loadConfig};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{F as e,S as t,X as n,Z as r,hl as i,i as a,sd as o}from"./md-manager-BGnqyqi1-BTvqIsKE.mjs";import{Pi as s,Si as c,k as l,ms as u,oi as d,rs as f,ts as p,vi as m}from"./dist-Bc3_Wt6N.mjs";import{Ct as h,L as g,Tt as _,X as v,b as y,ut as b,wt as x,y as S,z as C}from"./init-ZiC_qPS2.mjs";import{S as w,a as T,c as E,h as D,i as O,m as k,n as A,o as j,p as M,r as N,s as P,t as ee,u as F}from"./registry-probes-DNaU56kl.mjs";import{n as I}from"./constants-CYVYQ2Ib.mjs";import{execFileSync as L,spawn as R}from"node:child_process";import{basename as z,dirname as B,resolve as V}from"node:path";import{existsSync as H,realpathSync as te}from"node:fs";import{homedir as ne,tmpdir as re}from"node:os";import{rm as ie}from"node:fs/promises";import{setTimeout as ae}from"node:timers/promises";const oe=[`/opt/homebrew/bin/gh`,`/usr/local/bin/gh`,`/opt/local/bin/gh`,`/snap/bin/gh`,`/usr/bin/gh`],se={encoding:`utf-8`,stdio:[`ignore`,`pipe`,`pipe`],timeout:5e3,windowsHide:!0};function ce(e,t={}){let{login:n}=t,r=t._exec??L,i=le(t._fileExists??H),a=e?[`--hostname`,e]:[];if(n){let e=U(r,i,[`auth`,`token`,...a,`--user`,n]);if(e)return{available:!0,token:e,resolvedLogin:n,fallback:!1}}let o=U(r,i,[`auth`,`token`,...a]);return o?n?{available:!0,token:o,fallback:!0}:{available:!0,token:o}:{available:!1}}function le(e){return[`gh`,...oe.filter(e)]}function U(e,t,n){for(let r of t)try{let t=e(r,n,se).toString().trim();if(t.length>0)return t}catch{}}function W(e,t={}){let n=t._exec??L,r=le(t._fileExists??H),i=[`auth`,`status`,...e?[`--hostname`,e]:[]],a=U(n,r,[...i,`--json`,`hosts`]);if(a!==void 0){let t=ue(a,e);if(t)return t}let o=U(n,r,i);if(o!==void 0){let e=he(o);if(e.length>0)return e}}function G(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}function ue(e,t){let n;try{n=JSON.parse(e)}catch{return}let r=G(G(n)?.hosts);if(!r||t!==void 0&&r[t]===void 0)return;let i=t===void 0?Object.values(r):[r[t]],a=[];for(let e of i){if(!Array.isArray(e))return;for(let t of e){let e=G(t);if(!e)continue;let n=e.login;typeof n==`string`&&n.length!==0&&a.push({login:n,active:e.active===!0})}}return a}const de=/Logged in to \S+ account (\S+) \(/,fe=/(?:Failed to log in to|Timeout trying to log in to) \S+/,pe=/^\s*-\s*Active account:\s*true\s*$/,me=/\u001b\[[0-9;]*m/g;function he(e){let t=[],n;for(let r of e.split(`
|
|
2
|
+
`)){let e=r.replace(me,``),i=de.exec(e)?.[1];if(i){n={login:i,active:!1},t.push(n);continue}if(fe.test(e)){n=void 0;continue}n&&pe.test(e)&&(n.active=!0)}return t}const ge={mode:`published`,skipAvailabilityCheck:!0,replaceEntry:!0};function K(){return{action:`failed`,errorId:`write-failed`}}function q(){return{action:`skipped-missing`,errorId:`surface-missing`}}function J(e,t,n){u(`agent-integrations-apply`).warn({editor:e,path:t,reason:n},`skill write failed`)}function Y(){return{action:`skipped-unsupported`,errorId:`no-writer`}}function _e(e){switch(e){case`removed`:return{action:`removed`};case`not-present`:return{action:`no-op`};case`left-foreign`:return{action:`skipped-foreign`,errorId:`foreign-artifact`};case`declined`:return{action:`declined`,errorId:`write-declined`}}}function ve(e,t,n,r,i){let a=v[e];try{let o=j(a,t,n,r,i);return o.kind===`removed`&&o.trustDetail&&u(`agent-integrations-apply`).warn({editor:e,path:r??a.configPath(t,n),trust:o.trust,trustDetail:o.trustDetail},`MCP config removal retained Pi folder trust`),_e(o.kind)}catch(i){return u(`agent-integrations-apply`).warn({editor:e,path:r??a.configPath(t,n),reason:i instanceof Error?i.message:String(i)},`MCP config removal failed`),K()}}async function ye(e,t,n){if(v[e].scope!==`global`)return q();if(n===`absent`)return ve(e,``,t.home,void 0,t.env);let r=(await y({editors:[e],home:t.home,replaceEntry:!0})).find(t=>t.editorId===e);if(r===void 0)return K();switch(r.action){case`written`:case`overwritten`:return{action:r.action};case`declined`:return{action:`declined`,errorId:`write-declined`};case`skipped-missing`:return q();case`skipped-flag`:return Y();default:return K()}}function be(e,t,n){let r=v[e].projectConfigPath?.(t.cwd);if(r===void 0)return q();if(n===`absent`)return ve(e,t.cwd,t.home,r,t.env);let i=S(v[e],t.cwd,ge,void 0,r);switch(i.action){case`written`:case`overwritten`:return{action:i.action};case`declined`:return{action:`declined`,errorId:`write-declined`};default:return K()}}function xe(e,t,n){let r=t.home??ne();if(n===`absent`){let t=N(e,r);switch(t.action){case`removed`:return{action:`removed`};case`not-present`:return{action:`no-op`};case`skipped-unsupported`:return q();case`failed`:return J(e,t.path,t.error),K()}}let i=T(e,r);switch(i.action){case`written`:return{action:`written`};case`overwritten`:return{action:`overwritten`};case`skipped-unsupported`:return q();case`failed`:return J(e,i.path,i.error),K()}}function Se(e,t,n){if(n===`absent`){let n=g(v[e],t.cwd);switch(n.action){case`removed`:return{action:`removed`};case`not-present`:return{action:`no-op`};case`skipped-unsupported`:return q();case`failed`:return J(e,n.path,n.error),K()}}let r=C(v[e],t.cwd);switch(r.action){case`written`:return{action:`written`};case`overwritten`:return{action:`overwritten`};case`skipped-unsupported`:return q();case`skipped-prerequisite`:return{action:`skipped-prerequisite`,errorId:`dependency-failed`};case`failed`:return J(e,r.path,r.error),K()}}function Ce(e){return t=>{if(t.pathId===void 0)return Y();let n=o(t.pathId);if(n===null||n.kind===`central-skill-store`)return Y();switch(n.kind){case`editor-user-config`:return ye(n.editor,e,t.desired);case`editor-project-config`:return be(n.editor,e,t.desired);case`editor-project-skill-root`:return Se(n.editor,e,t.desired);case`editor-user-skill-root`:return xe(n.editor,e,t.desired)}}}function we(e,t){return e.bind?.[0]??t.HOST??`127.0.0.1`}function Te(e){if(e===`server`)return e;throw new x(`--only must be 'server'`)}function Ee(e=H){let t=import.meta.dirname??new URL(`.`,import.meta.url).pathname;return[V(t,`public`),V(t,`../../app/dist`),V(t,`../../../app/dist`)].find(t=>e(t))}function De(e){if(e.explicitDir!==void 0)return{dir:e.explicitDir,missingBundle:!1};if(e.only===`server`)return{dir:void 0,missingBundle:!1};let t=e.findBundledDir();return{dir:t,missingBundle:t===void 0}}function Oe(e){if(e===`off`)return`off`;if(!i.test(e))throw new x(`--idle-shutdown must be 'off' or a duration like 90s, 30m, 2h`);return e}function ke(e){return e===`localhost`||e===`::1`||e===`[::1]`||e.startsWith(`127.`)}function Ae(e){return!e.flagBindSet&&!e.okBindSet&&e.hostEnvSet&&e.fileBindCount>1}function je(e){return!e.openBrowser||e.ephemeral||e.only===`server`||!e.servesUi?!1:(e.explicitOn||ke(e.host))&&e.isTTY}function Me(e,t){let n;try{n=new URL(t)}catch{throw new x(`${e} is not a valid URL: ${t}`)}if(n.protocol!==`http:`&&n.protocol!==`https:`)throw new x(`${e} must be an http(s) origin (got: ${t})`);return t}function Ne(e){return Me(`--external-url`,e)}function Pe(e){let t=z(e).replace(/[^\x20-\x7E]/g,``).trim().slice(0,64);return`open-knowledge-server ${t.length>0?t:`unknown`}`}var X=class extends Error{cwd;constructor(e){super("This directory isn't set up yet. Run `ok init` first, then `ok start` again."),this.name=`OkDirMissingError`,this.cwd=e}},Z=class extends Error{projectDir;constructor(e){super(`--project-dir must be a throwaway ${l}* directory under the OS temp dir. Refusing to write ephemeral session state into ${e}. Omit --project-dir to let ok start create (and clean up) its own.`),this.name=`EphemeralProjectDirNotThrowawayError`,this.projectDir=e}};function Q(e,t={}){let n=t.tmpdirFn??re,r=t.realpathFn??te,i=e=>{try{return r(e)}catch(t){return t.code===`ENOENT`?V(e):null}},a=V(e),o;try{o=r(a)}catch(e){if(e.code===`ENOENT`){let e=i(B(a));o=e===null?null:V(e,z(a))}else o=null}if(o===null)return!1;let s=i(n());return s!==null&&B(o)===s&&z(o).startsWith(`ok-ephemeral-`)}function $(e,t,n=e=>ie(e,{recursive:!0,force:!0})){return async()=>{try{await e()}finally{if(Q(t))try{await n(t)}catch(e){process.stderr.write(`[start] ephemeral temp dir reap failed for ${t}: ${e instanceof Error?e.message:String(e)}\n`)}else process.stderr.write(`[start] leaving ${t} in place: only ${l}* dirs under the OS temp dir are removed on ephemeral teardown\n`)}}}function Fe(e,t={}){let n=t.exit??(e=>process.exit(e)),r=t.getActiveHandles??(()=>{let e=process._getActiveHandles;return e?e.call(process):null});return async()=>{let i=!1;try{await e()}catch(e){i=!0,t.log?.error({err:e},`idle-shutdown: destroy failed — exiting anyway`)}finally{let e=null;try{let t=r();if(t!==null){e={};for(let n of t){let t=n?.constructor?.name??`unknown`;e[t]=(e[t]??0)+1}}}catch{e=null}t.log?.info({event:`idle-shutdown-exit`,exitCode:+!!i,openHandles:e??{},handlesAvailable:e!==null},`idle-shutdown: teardown finished — exiting process`),n(+!!i)}}}async function Ie(e){let{config:t,cwd:n,host:r}=e,i=e.skipAutoInit??!1,a=e.idleThresholdMs===void 0?18e5:e.idleThresholdMs,{existsSync:o,mkdirSync:l}=await import(`node:fs`),{basename:u,dirname:f,resolve:p}=await import(`node:path`),{bootServer:m,createEphemeralProjectDir:h,getLogger:g,resolveContentDir:_,resolveLockDir:v,seedEphemeralProjectDir:y,waitForServerLockDrain:x}=await import(`./dist-CvUzxHSS.mjs`),S=e.log??g(`start`),C=e.singleFile!==void 0,T=C?s(e.singleFile).canonicalFilePath:void 0,D=T?f(T):void 0,k=T?u(T):void 0,j,M=!1;if(D!==void 0){if(e.projectDir!==void 0){if(j=e.projectDir,!Q(j))throw new Z(j);o(p(j,`.ok`,`config.yml`))||y(j,D)}else j=h(D),M=!0}let N=async()=>{if(!(!M||j===void 0)){if(!Q(j)){S.warn({ephemeralProjectDir:j},`[start] refusing to reap self-provisioned ephemeral dir: no longer resolves to an ok-ephemeral-* temp dir`);return}try{await ie(j,{recursive:!0,force:!0})}catch(e){S.warn({err:e,ephemeralProjectDir:j},`[start] failed to reap self-provisioned ephemeral temp dir`)}}},F=j;if(!C){if(!i&&!d(n))throw new X(n);let t=process.env.OK_RECLAIM_DISABLE??null,r=e=>{e.severity===`info`?S.debug({event:e},`[start] reclaim sweep event`):S.warn({event:e},`[start] reclaim sweep reported a problem`)};try{let i=(e.repairMcpConfigsFn??(await import(`./repair-mcp-configs-Bfys7jKY.mjs`)).repairMcpConfigs)({projectDir:n,reclaimDisableEnv:t,logger:r}).outcomes.filter(e=>e.outcome!==`no-entry`&&e.outcome!==`canonical`&&e.outcome!==`repaired`&&e.outcome!==`foreign`);i.length>0&&S.warn({unhealed:i},`[start] reclaim sweep left entries it could not heal`)}catch(e){S.warn({err:e},`[start] mcp-config repair sweep failed; continuing`)}try{(e.repairLaunchJsonFn??(await import(`./repair-launch-json-CtAdQsRf.mjs`)).repairLaunchJson)({projectDir:n,reclaimDisableEnv:t,logger:r})}catch(e){S.warn({err:e},`[start] launch.json repair sweep failed; continuing`)}}let I=D??_(t,n);!C&&!o(I)&&(l(I,{recursive:!0}),S.info({contentDir:I},`Created content directory`));let L=w(),R=c(),z;try{{let e=v(j??n),t=Date.now(),r=await x(e);r!==`no-drain`&&S.info({event:`start-waited-for-draining-predecessor`,outcome:r,waitedMs:Date.now()-t,drainLockDir:e},r===`released`?`[start] predecessor server finished draining — proceeding`:`[start] predecessor server still draining after wait — proceeding to collide`)}z=await m({config:t,contentDir:I,projectDir:j??n,contentRoot:C?void 0:t.content.dir,port:e.port,host:r,quiet:!1,detectGh:ce,detectGhAccounts:W,tokenStore:L,embeddingsKeyStore:R,mcpTomlEditor:b(),...C?{ephemeral:!0,singleDocRelPath:k,gitEnabled:!1,gitPreflight:()=>({ok:!0,version:`0.0.0`,resolvedPath:`git`,source:`PATH`})}:{},localOpCliArgs:[process.execPath,process.argv[1]],probeHarnessManagedMcpEntry:(e,t)=>A(e,t),probePiAcpBridge:e=>E(e),ensurePiAcpBridge:(e,t)=>P(e,void 0,void 0,void 0,t),agentIntegrations:(()=>{let e={cwd:j??n,home:ne(),env:process.env};return{probe:ee(e),execute:Ce(e),userSkillPresentAnywhere:O}})(),idleShutdownMs:a,...e.serverRuntime===void 0?{}:{serverRuntime:e.serverRuntime},...e.bind===void 0?{}:{bind:e.bind},skipAutoInit:!0,idleShutdownHandler:t=>{let n=t;return Fe(F===void 0?n:$(n,F),{log:S,exit:e.idleExit})},log:S,...e.serveContentAssets===void 0?{}:{serveContentAssets:e.serveContentAssets},...e.reactShellDistDir?{reactShellDistDir:e.reactShellDistDir}:{},...e.terminalAuthAvailable===!0?{terminalAuthAvailable:!0}:{}})}catch(e){throw await N(),e}let B=z.destroy,V=M?async()=>{try{await B()}finally{await N()}}:B;return{httpServer:z.httpServer,destroy:V,lockDir:z.lockDir,contentDir:I,port:z.port,ready:z.ready,degraded:z.degraded}}function Le(e,t,n=()=>p({absPath:f(`user`,process.cwd()),sideline:!1,warn:()=>{}}).value){return t===void 0?e:n()}function Re(e){if(e===`browser`||e===`app`)return e;throw new x(`--mode must be 'browser' or 'app'`)}function ze(e){return e.OK_CONSOLE_LEVEL!==void 0||e.LOG_LEVEL!==void 0?null:`warn`}function Be(e){let t=[`Stopping OpenKnowledge…`,`Saving pending changes and releasing the server lock — this can take a few seconds.`];return e===`SIGINT`&&t.push(`Press Ctrl+C again to force quit.`),t}async function Ve(i,o){let s=Le(i,o.singleFile),c=ze(process.env);c!==null&&(process.env.OK_CONSOLE_LEVEL=c);let{renderBanner:l}=await import(`./banner-kywHhVaC.mjs`),{accent:u,dim:d,error:f,warning:p}=await import(`./colors-SgU3JHQu.mjs`),m=process.cwd();process.title=Pe(m);let h;try{h=n(process.env)}catch(e){throw e instanceof a&&(console.error(f(e.message)),process.exit(78)),e}for(let e of h.diagnostics)console.warn(p(`[config] ${e.message}`));let g=t(s,h.layer),_=h.overrides.some(e=>e.envVar===`OK_BIND`),v=o.bind!==void 0&&o.bind.length>0?o.bind:void 0,y=process.env.HOST,b=y!==void 0&&y.trim()!==``?y:void 0,x=r(g),S=v??(_||b===void 0?[...x.bind]:[b]);Ae({flagBindSet:v!==void 0,okBindSet:_,hostEnvSet:b!==void 0,fileBindCount:x.bind.length})&&console.warn(p(`[config] HOST=${b} overrides server.bind — dropping the file-configured addresses (${x.bind.join(`, `)}). Use OK_BIND with a space-separated list to keep multiple binds.`));let C=S[0]??`127.0.0.1`,w=S,T=o.externalUrl,E=r(t(g,{server:{bind:w,...T===void 0?{}:{externalUrl:T}}}));if(E.allowExternal&&(!E.loopbackOnly||E.externalUrl)){let e=E.externalUrl??E.bind.join(`, `);console.warn(p([``,`⚠ EXTERNAL ACCESS ENABLED (server.allowExternal) — no server-side authentication.`,` This server is reachable beyond this machine (${e}). Anyone who can`,` reach it has FULL control of this knowledge base — sync, publishing, GitHub`,` credentials, and local operations (clone, sign-in, repo spawn).`,` Restrict who can reach it at the edge: a Tailscale ACL, a reverse proxy with`,` auth (Cloudflare Access, oauth2-proxy), or a firewall.`,``].join(`
|
|
3
|
+
`)))}let D=o.port===void 0?void 0:Number(o.port),O=h.overrides.find(e=>e.envVar===`PORT`)?.value,k=D??O??s.server?.port,A=De({explicitDir:o.reactShellDistDir,only:o.only,findBundledDir:Ee}),j=A.dir;A.missingBundle&&console.warn(`bundled web UI not found — serving /api and /mcp only. Reinstall @inkeep/open-knowledge, or build packages/app in a source checkout.`);let M;try{M=await Ie({config:s,cwd:m,host:C,port:k,bind:w,...o.serveContentAssets===void 0?{}:{serveContentAssets:o.serveContentAssets},...j?{reactShellDistDir:j}:{},idleThresholdMs:e(o.idleShutdown??E.idleShutdown),serverRuntime:E,...o.singleFile?{singleFile:o.singleFile}:{},...o.projectDir?{projectDir:o.projectDir}:{},...o.terminalAuth===!0?{terminalAuthAvailable:!0}:{}})}catch(e){e instanceof X&&(console.error(f(e.message)),process.exit(1)),e instanceof Z&&(console.error(f(e.message)),process.exit(1));let t=await import(`./dist-CvUzxHSS.mjs`);if((e instanceof t.GitNotAvailableError||e instanceof t.GitTooOldError)&&process.exit(78),e instanceof t.ExposureConsentError&&(console.error(f(e.message)),process.exit(78)),(e instanceof t.SingleFileNotFoundError||e instanceof t.SingleFileNotAFileError||e instanceof t.SingleFileNotMarkdownError)&&(console.error(f(e.message)),process.exit(1)),(e instanceof t.MissingOkConfigError||e instanceof t.DocumentDurabilityStateError)&&(console.error(f(e.message)),process.exit(1)),We(e,t,m)){let e=t.resolveLockDir(m),n=null;try{n=await He({readServerLock:()=>t.readServerLock(e),now:Date.now,sleep:e=>ae(e),timeoutMs:3e3,pollIntervalMs:50})}catch(e){process.stderr.write(`[start] spawn-or-reuse: lock poll failed (${e instanceof Error?e.message:String(e)}) — falling back to the collision message\n`)}if(n!==null){let[e,...t]=Ue(n);console.log(u(e));for(let e of t)console.log(d(e));process.exit(0)}}let n=Ge(e,m,t);n!==null&&(console.error(f(n)),process.exit(1)),console.error(`${f(`Failed to start:`)} ${e instanceof Error?e.stack??e.message:String(e)}`),process.exit(1)}let N=!1,P=async e=>{if(N)return;N=!0;let[t,...n]=Be(e);console.log(u(`\n${t}`));for(let e of n)console.log(d(` ${e}`));try{await M.destroy(`external-signal`)}catch(e){console.error(`${f(`destroy() failed:`)} ${e instanceof Error?e.stack??e.message:String(e)}`),process.exitCode=1}process.exit(process.exitCode??0)};process.once(`SIGINT`,()=>{P(`SIGINT`)}),process.once(`SIGTERM`,()=>{P(`SIGTERM`)});let ee=`http://${C.includes(`:`)&&!C.startsWith(`[`)?`[${C}]`:C}:${M.port}`,F=C===`0.0.0.0`||C===`::`?`http://0.0.0.0:${M.port}`:void 0,L=ee;console.log(l({name:`open-knowledge`,version:I,localUrl:L,networkUrl:F,nextSteps:[`Open the Editor URL in your browser to start editing.`]}));let R={"shadow-repo":`Version history and branch-switch safety unavailable`,"file-watcher":`External file changes will not sync to the editor`,"head-watcher":`Git branch switches may cause document inconsistency`};M.ready.then(async()=>{if(M.degraded.length>0){console.log();for(let e of M.degraded){let t=R[e]??`${e} (check server logs for details)`;console.warn(` ${p(`⚠`)} ${p(e)}: ${d(t)}`)}console.log()}if(je({openBrowser:o.openBrowser!==!1&&E.openBrowser,explicitOn:o.openBrowser!==!1&&g.server?.openBrowser===!0,host:C,isTTY:process.stdout.isTTY===!0,ephemeral:o.singleFile!==void 0,only:o.only,servesUi:j!==void 0})){let{openBrowser:e}=await import(`./open-browser-tzVDF1eD.mjs`);e(L)}}).catch(e=>{console.error(` ${f(`Server initialization failed:`)} ${e instanceof Error?e.message:String(e)}`)})}async function He(e){let t=e.now()+e.timeoutMs,n=e.readServerLock();for(;n!==null&&n.draining!==!0&&n.port<=0&&e.now()<t;)await e.sleep(e.pollIntervalMs),n=e.readServerLock();return n===null||n.draining===!0||n.port<=0?null:m(n)&&n.url!==void 0?{url:n.url,kind:n.kind,pid:n.pid,servesUi:!0}:{url:n.url??`http://127.0.0.1:${n.port}`,kind:n.kind,pid:n.pid,servesUi:!1}}function Ue(e){return[`${e.kind===`mcp-spawned`?`An MCP-spawned OpenKnowledge server is already running on this project`:`OpenKnowledge is already running on this project`} (pid ${e.pid}).`,` ${e.url}`,"Leaving it running — run `ok stop` first if you want a fresh server."]}function We(e,t,n){let r=t.ServerLockCollisionError;if(r!==void 0&&e instanceof r)return!0;let i=t.ServerAuthorityCollisionError;if(i===void 0||!(e instanceof i))return!1;try{return e.existing.scope.kind===`tree`&&te.native(n)===e.existing.projectDir}catch{return!1}}function Ge(e,t,n){let r=n.ServerAuthorityCollisionError;if(r!==void 0&&e instanceof r)return e.message;let i=n.ServerAuthorityRegistryError;if(i!==void 0&&e instanceof i)return e.message;let a=n.ServerLockCollisionError;if(a===void 0||!(e instanceof a))return null;try{let e=n.readServerLock(n.resolveLockDir(t));return e&&e.kind===`mcp-spawned`?"An MCP-spawned server holds this lock; it should release on idle-shutdown (~30 min). Or run `ok stop`.":"OpenKnowledge server is already running on this project — check `ok status` or `ok stop`."}catch{return null}}function Ke(e){return new h(`start`).description(`Start the OpenKnowledge server (UI + API + MCP + collab on one port)`).option(`-p, --port <port>`,`Server port`,void 0).option(`--bind <address>`,`Bind address (repeatable; default 127.0.0.1 — loopback only)`,(e,t)=>[...t??[],e]).option(`--no-open-browser`,`Do not open the browser after start (interactive loopback starts open it by default)`).option(`--only <module>`,`Serve one module: 'server' (API + MCP only, no shell or browser)`,Te).option(`--idle-shutdown <duration>`,`Shut the server down after this long with no connected clients ('off', or a duration like 90s, 30m, 2h; default 30m)`,Oe).option(`--mode <mode>`,`Force dispatch mode: 'browser' or 'app'`,Re).option(`--serve-content-assets`,`Serve content assets from this server (now the default; kept for compatibility)`).option(`--react-shell-dist-dir <path>`,`Serve React shell from <path>`).addOption(new _(`--single-file <path>`,`No-project ephemeral single-file mode: scope the server to one markdown file (git + MCP off)`).hideHelp()).addOption(new _(`--project-dir <dir>`,`Throwaway project root for --single-file (where ephemeral .ok/ state lives)`).hideHelp()).addOption(new _(`--terminal-auth`,`Tell in-app agents that this server's client can run terminal sign-ins (the desktop app passes it when it has a terminal)`).hideHelp()).option(`--external-url <url>`,`Canonical external origin clients dial (sets server.externalUrl for this run) — its host joins the Host/Origin allowlists (CORS + external-Host admission). External exposure additionally requires consent (OK_ALLOW_EXTERNAL=1 or server.allowExternal).`,Ne).action(async t=>{let n=e();if(t.only===`server`&&t.reactShellDistDir!==void 0&&(process.stderr.write(`error: option '--only server' cannot be combined with '--react-shell-dist-dir'
|
|
4
|
+
`),process.exit(2)),t.projectDir!==void 0&&t.singleFile===void 0&&(process.stderr.write(`error: option '--project-dir' requires '--single-file'
|
|
5
|
+
`),process.exit(2)),t.mode===`app`){let e=[];if(t.port!==void 0&&e.push(`--port`),t.bind!==void 0&&e.push(`--bind`),t.only!==void 0&&e.push(`--only`),t.idleShutdown!==void 0&&e.push(`--idle-shutdown`),t.openBrowser===!1&&e.push(`--no-open-browser`),t.externalUrl!==void 0&&e.push(`--external-url`),e.length>0){let t=process.env.OK_LOG_LEVEL??`info`;(t===`debug`||t===`trace`)&&console.error(`--mode=app: ignoring ${e.join(`, `)}`)}let n=M(F());if(n.available){k({spawn:R},n);return}console.error(D(n.reason)),process.exit(1)}await Ve(n,t)})}export{Ge as C,W as D,ce as E,Ke as S,Fe as T,ze as _,Ue as a,je as b,Q as c,Oe as d,Te as f,Le as g,He as h,Pe as i,We as l,we as m,X as n,Be as o,Ee as p,Ie as r,ke as s,Z as t,Ne as u,De as v,$ as w,Ae as x,Ve as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{S as e,m as t,p as n,r}from"./start-BcbkXw2n.mjs";export{r as bootStartServer,n as resolveBundledReactShellDir,t as resolveHost,e as startCommand};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/open-knowledge",
|
|
3
|
-
"version": "0.84.0-beta.
|
|
3
|
+
"version": "0.84.0-beta.10",
|
|
4
4
|
"description": "Local-first, agent-friendly Markdown knowledge base with a cross-platform CLI and web editor",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"knowledge-base",
|
|
@@ -65,10 +65,10 @@
|
|
|
65
65
|
"@parcel/watcher": "^2.5.6"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@inkeep/open-knowledge-app": "0.84.0-beta.
|
|
69
|
-
"@inkeep/open-knowledge-core": "0.84.0-beta.
|
|
68
|
+
"@inkeep/open-knowledge-app": "0.84.0-beta.10",
|
|
69
|
+
"@inkeep/open-knowledge-core": "0.84.0-beta.10",
|
|
70
70
|
"@inkeep/open-knowledge-native-config": "0.0.0",
|
|
71
|
-
"@inkeep/open-knowledge-server": "0.84.0-beta.
|
|
71
|
+
"@inkeep/open-knowledge-server": "0.84.0-beta.10",
|
|
72
72
|
"@types/node": "^24.7.0",
|
|
73
73
|
"@types/proper-lockfile": "^4.1.4",
|
|
74
74
|
"@types/yazl": "^3.3.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./md-manager-BGnqyqi1-BfETHApY.mjs";var e=`0.84.0-beta.0`;const t=`config.yml`,n=e;export{n,t};
|
package/dist/dist-BUsVlOD-.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Dt as e,Qs as t,Tt as n,Wa as r,Y as i,ac as a,hc as o,v as s}from"./md-manager-BGnqyqi1-BfETHApY.mjs";import{$ as c,$a as l,$i as u,$n as d,$r as f,$t as p,A as m,Aa as h,Ai as g,An as _,Ao as v,Ar as y,At as b,B as x,Ba as S,Bi as C,Bn as w,Br as T,Bt as E,C as D,Ca as O,Ci as k,Cn as A,Co as j,Cr as M,Cs as N,Ct as P,D as F,Da as I,Di as L,Dn as R,Do as z,Dr as B,Dt as V,E as H,Ea as U,Ei as W,En as G,Eo as K,Er as q,Et as J,F as Y,Fa as X,Fi as Z,Fn as Q,Fr as $,Ft as ee,G as te,Ga as ne,Gi as re,Gn as ie,Gr as ae,Gt as oe,H as se,Ha as ce,Hi as le,Hn as ue,Hr as de,Ht as fe,I as pe,Ia as me,Ii as he,In as ge,Ir as _e,It as ve,J as ye,Ja as be,Ji as xe,Jn as Se,Jr as Ce,Jt as we,K as Te,Ka as Ee,Ki as De,Kn as Oe,Kr as ke,Kt as Ae,L as je,La as Me,Li as Ne,Ln as Pe,Lr as Fe,Lt as Ie,M as Le,Ma as Re,Mi as ze,Mn as Be,Mo as Ve,Mr as He,Mt as Ue,N as We,Na as Ge,Ni as Ke,Nn as qe,No as Je,Nr as Ye,Nt as Xe,O as Ze,Oa as Qe,Oi as $e,On as et,Oo as tt,Or as nt,Ot as rt,P as it,Pa as at,Pi as ot,Pn as st,Po as ct,Pr as lt,Pt as ut,Q as dt,Qa as ft,Qi as pt,Qn as mt,Qr as ht,Qt as gt,R as _t,Ra as vt,Ri as yt,Rn as bt,Rr as xt,Rt as St,S as Ct,Sa as wt,Si as Tt,Sn as Et,So as Dt,Sr as Ot,Ss as kt,St as At,T as jt,Ta as Mt,Ti as Nt,Tn as Pt,To as Ft,Tr as It,Ts as Lt,Tt as Rt,U as zt,Ua as Bt,Ui as Vt,Un as Ht,Ur as Ut,Ut as Wt,V as Gt,Va as Kt,Vi as qt,Vn as Jt,Vr as Yt,Vt as Xt,W as Zt,Wa as Qt,Wi as $t,Wn as en,Wr as tn,Wt as nn,X as rn,Xa as an,Xi as on,Xn as sn,Xr as cn,Xt as ln,Y as un,Ya as dn,Yi as fn,Yn as pn,Yr as mn,Yt as hn,Z as gn,Za as _n,Zi as vn,Zn as yn,Zr as bn,Zt as xn,_ as Sn,_a as Cn,_i as wn,_n as Tn,_o as En,_r as Dn,_s as On,_t as kn,a as An,aa as jn,ai as Mn,an as Nn,ao as Pn,ar as Fn,at as In,b as Ln,ba as Rn,bi as zn,bn as Bn,bo as Vn,br as Hn,bt as Un,c as Wn,ca as Gn,ci as Kn,cn as qn,co as Jn,cr as Yn,ct as Xn,d as Zn,da as Qn,di as $n,dn as er,do as tr,dr as nr,ds as rr,dt as ir,ea as ar,ei as or,en as sr,eo as cr,er as lr,et as ur,f as dr,fa as fr,fi as pr,fn as mr,fo as hr,fr as gr,fs as _r,ft as vr,g as yr,ga as br,gi as xr,gn as Sr,go as Cr,gr as wr,gs as Tr,gt as Er,h as Dr,ha as Or,hi as kr,hn as Ar,ho as jr,hr as Mr,hs as Nr,ht as Pr,i as Fr,ia as Ir,ii as Lr,in as Rr,io as zr,ir as Br,it as Vr,j as Hr,ja as Ur,ji as Wr,jn as Gr,jo as Kr,jr as qr,jt as Jr,k as Yr,ka as Xr,ki as Zr,kn as Qr,ko as $r,kr as ei,kt as ti,l as ni,la as ri,li as ii,ln as ai,lo as oi,lr as si,lt as ci,m as li,ma as ui,mi as di,mn as fi,mo as pi,mr as mi,ms as hi,mt as gi,n as _i,na as vi,ni as yi,nn as bi,no as xi,nr as Si,nt as Ci,o as wi,oa as Ti,oi as Ei,on as Di,oo as Oi,or as ki,os as Ai,ot as ji,p as Mi,pa as Ni,pi as Pi,pn as Fi,po as Ii,pr as Li,ps as Ri,pt as zi,q as Bi,qa as Vi,qi as Hi,qn as Ui,qr as Wi,qt as Gi,r as Ki,ra as qi,ri as Ji,rn as Yi,ro as Xi,rr as Zi,rt as Qi,s as $i,sa as ea,si as ta,sn as na,so as ra,sr as ia,ss as aa,st as oa,t as sa,ta as ca,ti as la,tn as ua,to as da,tr as fa,tt as pa,u as ma,ua as ha,ui as ga,un as _a,uo as va,ur as ya,ut as ba,v as xa,va as Sa,vi as Ca,vn as wa,vo as Ta,vr as Ea,vs as Da,vt as Oa,w as ka,wa as Aa,wi as ja,wn as Ma,wo as Na,wr as Pa,ws as Fa,wt as Ia,x as La,xa as Ra,xi as za,xn as Ba,xo as Va,xr as Ha,xt as Ua,y as Wa,ya as Ga,yi as Ka,yn as qa,yo as Ja,yr as Ya,ys as Xa,yt as Za,z as Qa,za as $a,zi as eo,zn as to,zr as no,zt as ro}from"./dist-BmMYmJrU.mjs";export{sa as AGENT_ID_MAX_LEN,_i as AGENT_ID_RE,Ki as AGENT_WRITE_ORIGIN,r as AUDIT_EMPTY_SCOPE_WARNING,Fr as AcpPermissionStore,An as AcpRegistry,wi as AcpThreadManager,$i as AgentFocusBroadcaster,Wn as AgentPresenceBroadcaster,ni as AgentSessionCapacityError,ma as AgentSessionManager,Zn as AutoStartDisabledError,dr as BUNDLE_IDS,Mi as BUNDLE_SCOPE,li as BUNDLE_SKILL_NAME,Dr as BacklinkIndex,yr as CC1Broadcaster,a as CC1_CONTRACT_VERSION,Sn as CONCURRENT_REPLACE_WINDOW_MS,xa as CONFIG_FILENAME,Wa as CONFLICT_MARKER_RE,Ln as CURSOR_BUNDLE_PATHS_BY_PLATFORM,La as ConfigSchema,Ct as ConflictAuthority,D as DEFAULT_CHECKPOINT_RETENTION,ka as DEFAULT_EMBEDDINGS_DIMENSIONS,jt as DEFAULT_PACK_ID,H as DocumentDurabilityState,F as DocumentDurabilityStateError,Ze as EMBEDDINGS_API_KEY_ENV,Yr as EPHEMERAL_PROJECT_DIR_PREFIX,m as ExposureConsentError,Hr as FEATURED_AGENT_IDS,Le as FILE_SYSTEM_WRITER,We as FILE_WATCHER_ORIGIN,it as FileEmbeddingsBackend,Y as GIT_PREFLIGHT_FAIL_SPAN_NAME,pe as GIT_UPSTREAM_WRITER,Ai as GitDirAccessError,je as GitNotAvailableError,_t as GitTooOldError,Qa as HOCUSPOCUS_AUTH_REJECTION_REASONS,x as HocuspocusAuthRejection,Gt as HocuspocusAuthTokenSchema,se as HomeProjectRootError,zt as INSTALLED_AGENTS_SCHEMES,Zt as JSON_SCHEMA_DIALECT_2020_12,Fa as LINEAGE_EPOCH_KEY,te as LIVE_DERIVED_INDEX_DEBOUNCE_MS,Te as MANAGED_RENAME_ORIGIN,Bi as MAX_ACP_THREADS,ye as MAX_AGENT_SESSIONS,un as MCP_CONNECTION_ID_HEADER,t as MCP_SERVER_NAME,rn as MIN_EVICTABLE_IDLE_MS,gn as MIN_GIT_VERSION,dt as MISSING_OK_CONFIG_MESSAGE,aa as MalformedGitPointerError,c as McpLogger,ur as MissingOkConfigError,pa as OBSERVER_SYNC_ORIGIN,Ci as OK_OKIGNORE_TEMPLATE,Qi as ONBOARDING_BUNDLE_IDS,kt as ORPHAN_MODES,Lt as PROTOCOL_VERSION,rr as PinoLogger,Vr as ProcessLockCollisionError,In as ProjectGitInitError,ji as ROLLBACK_ORIGIN,oa as ROOT_GITIGNORE_TEMPLATE,Xn as RUNTIME_VERSION,ci as SERVICE_WRITER,ba as SKILL_INSTALL_EVENTS_FILENAME,s as SKILL_STATE_TARGETS,ir as STARTER_FOLDER_FRONTMATTER_FILENAME,vr as STARTER_PACKS,zi as STARTER_PACK_IDS,gi as STATE_MANIFEST_FILENAME,Pr as STATE_SCHEMA_VERSION,Er as SYMLINK_MERGE_MIN_GIT_LABEL,kn as SYMLINK_MERGE_MIN_GIT_VERSION,o as SYSTEM_DOC_NAME,Oa as SeedPrerequisiteError,Za as SeedRootDirError,Un as ServerAuthorityCollisionError,Ua as ServerAuthorityRegistryError,At as ServerLockCollisionError,P as SingleFileNotAFileError,Ia as SingleFileNotFoundError,Rt as SingleFileNotMarkdownError,J as SingleFileProjectOverrideError,V as StateManifestError,rt as TagIndex,ti as USER_GLOBAL_BUNDLE_IDS,b as UnsafeIncomingSymlinkError,Jr as __getShowAllWalkStatsForTesting,Ue as __resetShowAllWalkStatsForTesting,Xe as acpThreadStoreRoots,ut as acpThreadsDir,ee as acquireProcessLock,ve as acquireServerLock,Ie as applyAgentMarkdownWrite,St as applyExternalChange,ro as applySeed,E as assertCheckoutSymlinksSafe,Xt as assertCompatibleStateManifest,fe as assertGitAvailable,Wt as assertIncomingSymlinksSafe,nn as assertMergeNameResolvesTo,oe as assertNeverDiskEvent,Ae as assertNotHomeProjectRoot,Gi as assertRepoCheckoutSymlinksSafe,we as attachAcpThreadSocket,hn as attachCollabClientCounter,ln as attachIdleShutdown,xn as auditScopeNotFoundTitle,gt as bindConflictAuthority,p as bootServer,sr as buildAndOpenSkill,ua as buildConfigYmlContent,bi as buildExecResult,Yi as buildIngressPolicy,Rr as buildOkMcpStdioCommand,Nn as buildSkillZip,Di as buildStarterFolderFrontmatterYaml,na as buildWipTree,qn as bundleSkillMdPath,ai as canonicalProjectKey,_a as canonicalizeForCompare,er as classifyEvents,mr as classifyFsPath,Fi as clearAllEmbeddingsKeys,fi as coercePackId,Ar as collectServerHostSnapshot,n as colorFromSeed,Sr as commitUpstreamImport,Tn as commitWip,wa as commitWipFromTree,qa as compareSemver,Bn as composeEffectiveLinterConfig,Ba as composeFrontmatterSchemasConfig,Et as containsConflictMarkers,A as contentHash,Ma as contributorCount,Pt as countShadowObjects,G as countStaleAgentWipRefs,R as countWipRefs,et as createApiExtension,Qr as createAssetServeMiddleware,_ as createCollaborationHost,Gr as createContentFilter,Be as createContentFilterAsync,qe as createEmbeddingsSecretStore,st as createEphemeralProjectDir,Q as createExternalChangeHandler,ge as createFileLogger,Pe as createLiveDerivedIndexExtension,bt as createMcpHttpHandler,to as createOsProbe,w as createPersistenceExtension,Jt as createProbeFailureReporter,ue as createServer,Ht as createServerObserverExtension,en as createServerProbeResolver,ie as createStreamingErrorWriter,_r as createTestLogger,Oe as describeStoredEmbeddingsKey,Ui as detectClaudeDesktopPresence,Se as detectGit,pn as detectProjectShape,sn as detectUserSkillHosts,yn as discoverLockDirs,mt as discoverMarkdownlintConfig,d as emitPreflightFailureSpan,lr as encodeDocName,fa as encodeFolderRoute,Si as encodeSkillRoute,Zi as ensureProjectGit,Br as errorResponse,Fn as evictStaleTrackerEntries,ki as extractHeadings,ia as extractOkBinaryPath,Yn as extractWikiLinksFromMarkdown,si as fallbackPaths,ya as findEnclosingGitRoot,nr as findEnclosingProjectRoot,gr as findNativeMarkdownlintFile,Li as flushFileLogger,mi as formatAuditBrokenLinkSuppressionLine,Mr as formatAuthRejectionWire,wr as formatContributorsFrom,Dn as formatPackRationale,Ea as gcCheckpointRefs,Ya as getCurrentMcpLogger,Hn as getIngressContext,Ha as getLocalDir,Ot as getLogFilePath,Ri as getLogger,M as getLogsDir,Pa as getMachineId,It as getMeter,q as getMetrics,B as getTracer,nt as handleCollabSocketError,ei as handleSpawnCursor,y as hasForwardingHeaders,qr as hasGcLogLatch,e as iconFromClientName,He as incrementCollabSocketFilteredError,Ye as incrementServerObserverFire,lt as initContent,$ as initShadowRepo,_e as initTelemetry,Fe as initToleranceTelemetryWriter,xt as installJsonSchemaDialect,no as installPrettyZodErrors,hi as installTestLoggers,T as installUserSkill,Yt as isAllowedApiOrigin,de as isAllowedWorkspaceHostHeader,Ut as isConfigDoc,tn as isDefunctProcess,ae as isDocInConflict,ke as isHocuspocusAuthRejectionReason,Wi as isHomeDir,Ce as isHostAdmitted,mn as isKnownPackId,cn as isLinkIndexExcludedDoc,bn as isLockProcessRunning,ht as isLoopbackAddress,f as isManagedArtifactDoc,or as isMintedThreadId,la as isOriginAdmitted,N as isOrphanMode,yi as isPairedWriteOrigin,Ji as isPathWithinDir,Lr as isPeerAdmitted,Mn as isProcessAlive,Ei as isProjectRoot,ta as isReservedForUserTree,Kn as isSelfWrite,ii as isSystemDoc,ga as isToleranceTelemetryEnabled,$n as isValidLockPid,pr as lastKnownHash,Pi as listRescueCheckpoints,di as listStarterPacks,kr as loadCustomAgents,xr as loadPrincipal,wn as lockAdvertisesUi,Ca as lockBaseUrl,Ka as lockFilePath,Nr as loggerFactory,zn as loginShapedUserinfoUser,Tr as logsCurrentPath,On as logsPreviousPath,za as makeLazyEmbeddingsKeyStore,Tt as markServerLockDraining,k as mountMcpAndApi,ja as normalizeFsPath,Nt as observeReadiness,W as packageVersionMajorMinor,L as parseAuthRejectionWire,$e as parseGitVersion,Zr as parseHocuspocusAuthToken,g as parseKeepaliveConnectionId,Wr as pathToDocName,ze as planSeed,Ke as prepareSingleFileOpen,ot as processCommand,Z as processUsage,he as readAgentBrowserTools,Ne as readAllTargets,yt as readBundleDecision,eo as readDeclaredGitHubHosts,C as readOriginCredentialHost,qt as readOriginGitHubRepo,le as readOwnNativeRules,Vt as readProcessLock,$t as readProcessLockDetailed,re as readProcessState,De as readProjectHeadState,Hi as readProjectLocalSemanticConfig,xe as readServerLock,fn as readServerPackageVersion,on as readSkillInstallStateSnapshot,vn as readStateManifest,pt as readTargetRecordedAt,u as readTargetVersion,ar as reconcile,ca as recordContributor,vi as recordSkillInstallEvent,qi as redactShareSubprocessStderr,Ir as registerAllTools,jn as registerWrite,Ti as releaseProcessLock,ea as releaseServerLock,Gn as removeLastKnownHash,ri as removeProjectSkillGitignoreBlock,ha as reportSkillInstall,Qn as resetMetrics,fr as resolveAuditScope,Ni as resolveBuiltinSkillHosts,i as resolveBundleEnabled,ui as resolveBundledSkillDir,Or as resolveContentDir,br as resolveCursorBinaryDefault,Cn as resolveCursorSpawnInvocation,Sa as resolveEffectiveLinterConfig,Ga as resolveEmbeddingsCredential,Rn as resolveGitHubAccountFromUrl,Ra as resolveGitHubAuthHost,wt as resolveLockDir,O as resolveNativeConfigForDoc,Aa as resolveNativeMarkdownlintConfig,Mt as resolvePack,U as resolvePackageVersion,I as resolveSkillInstallReportSettings,Qe as resolveUiInfo,Xr as restoreContributors,h as rewriteMarkdownLinksForDocumentRename,Ur as rewriteWikiLinksForDocumentRename,Re as runAuthReposSubprocess,Ge as runAuthStatusSubprocess,at as runCloneSubprocess,X as runDeviceFlowSubprocess,me as runWithMcpLogger,Me as safeContentPath,vt as safeSubdir,$a as safetyCheckpoint,S as sameGitHubLogin,Kt as sanitizeClientName,ce as saveInMemoryCheckpoint,Bt as saveVersion,Qt as scanLockProcesses,ne as seedBasenameIndex,Ee as seedEphemeralProjectDir,Vi as serializeError,be as setActiveSpanAttributes,dn as setupServerObservers,an as shadowGit,_n as shutdownTelemetry,Da as spansCurrentPath,Xa as spansPreviousPath,ft as spawnDetached,l as splitMarkdownBlocks,cr as startWatcher,da as strategiesFor,xi as streamedChunkOf,Xi as streamingProblemEvent,zr as swapContributors,Pn as teardownToleranceTelemetryWriter,Oi as toBroadcasterKey,ra as tracedAppendFileSync,Jn as tracedLinkSync,oi as tracedMkdir,va as tracedMkdirSync,tr as tracedRename,hr as tracedRenameSync,Ii as tracedRmSync,pi as tracedRmdirSync,jr as tracedUnlinkSync,Cr as tracedWriteFile,En as tracedWriteFileSync,Ta as trustSystemCertificates,Ja as updateLastKnownHash,Vn as updateProcessLockPort,Va as updateServerLockPort,Dt as validateAgentId,j as validateCloneInputs,Na as validateSkillZip,Ft as waitForServerLockDrain,K as withHiddenWindowsConsole,z as withSpan,tt as withSpanSync,$r as writeBundleDecision,v as writeMarkdownlintRule,Kr as writeRootGitignoreForNewRepo,Ve as writeStateManifest,Je as writeTargetVersion,ct as writeTracker};
|
package/dist/init-6eE8auCX.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./dist-BmMYmJrU.mjs";import{_ as e}from"./init-D29QcTZq.mjs";export{e as runInit};
|
package/dist/loader-CisLPZPW.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./loader-CUPoyzHp.mjs";export{e as loadConfig};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./preview-BfxmnsOn.mjs";export{t as formatPreviewBlock,e as previewContent};
|
|
@@ -1 +0,0 @@
|
|
|
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{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./label-CvMpFFbN.js";import{t as s}from"./button-DzgjsZzC.js";import{n as c}from"./config-errors-DCSQBhyj.js";import{n as l,r as u}from"./constants-github-DOek7bCt.js";import{f as d,l as f}from"./SyncStatusBadge-7CGaFHUk.js";import{t as p}from"./trash-2-CchZ0T47.js";import{t as m}from"./input-C-Qm8YDT.js";import{t as h}from"./use-git-sync-status-BQYF2F5Z.js";import{a as g,n as _,t as v}from"./AuthModal-CkHLmy_N.js";import{t as y}from"./skeleton-BPb29aFG.js";import{n as b}from"./auth-state-cache-cHC7MUdm.js";import{t as x}from"./SettingsSectionHeader-XnGFBVeB.js";var S=e(n(),1),ee=a(),C=`[a-z0-9](?:[a-z0-9-]*[a-z0-9])?`,w=RegExp(`^${C}(?:\\.${C})*$`),T=/^[a-z][a-z0-9+.-]*:\/\//i;function E(e){if(T.test(e))try{return new URL(e).host}catch{return null}let t=e.split(`/`)[0]??``;return t.slice(t.lastIndexOf(`@`)+1).replace(/:(?!\d+$).*$/,``)}function D(e,t){let n=e.trim();if(n===``)return{ok:!1,reason:`empty`};let r=E(n);if(r===null||r===``)return{ok:!1,reason:`invalid`};let i=u(r);return w.test(i)?i===`github.com`?{ok:!1,reason:`github-com`}:t.has(i)?{ok:!1,reason:`duplicate`}:{ok:!0,host:i}:{ok:!1,reason:`invalid`}}function O(e){let t=e.git?.hosts??{};return Object.entries(t).filter(([,e])=>e?.provider===`github`).map(([e])=>e).sort((e,t)=>e.localeCompare(t))}var k=t();function A(e){let t=(0,ee.c)(59),{binding:n}=e,{_:a}=i(),o=(0,S.useId)(),l=(0,S.useId)(),u;t[0]===n?u=t[1]:(u=()=>O(n.current()),t[0]=n,t[1]=u);let[d,f]=(0,S.useState)(u),[h,g]=(0,S.useState)(``),[_,v]=(0,S.useState)(null),[y,b]=(0,S.useState)(!1),[x,C]=(0,S.useState)(null),w;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(w=new Map,t[2]=w):w=t[2];let T=(0,S.useRef)(w),E=(0,S.useRef)(null),A,j;t[3]===x?(A=t[4],j=t[5]):(A=()=>{x!==null&&(((x.host===null?null:T.current.get(x.host))??E.current)?.focus(),C(null))},j=[x],t[3]=x,t[4]=A,t[5]=j),(0,S.useEffect)(A,j);let M,N;t[6]===n?(M=t[7],N=t[8]):(M=()=>n.subscribe(e=>f(O(e))),N=[n],t[6]=n,t[7]=M,t[8]=N),(0,S.useEffect)(M,N);let P;t[9]===a?P=t[10]:(P=function(e){switch(e){case`empty`:return a({id:`cFONFy`});case`invalid`:return a({id:`QsnBxE`});case`github-com`:return a({id:`UK3GW4`});case`duplicate`:return a({id:`DEkRZA`})}},t[9]=a,t[10]=P);let ne=P,F;t[11]!==n||t[12]!==h||t[13]!==d||t[14]!==ne?(F=function(e){e.preventDefault();let t=D(h,new Set(d.map(te)));if(!t.ok){v(ne(t.reason));return}let r=n.patch({git:{hosts:{[t.host]:{provider:`github`}}}});if(!r.ok){v(c(r.error));return}f(O(r.effective)),g(``),v(null),b(!0)},t[11]=n,t[12]=h,t[13]=d,t[14]=ne,t[15]=F):F=t[15];let re=F,I;t[16]!==n||t[17]!==d?(I=function(e){let t=d.indexOf(e),r=d[t+1]??d[t-1]??null,i=n.patch({git:{hosts:{[e]:null}}});if(!i.ok){v(c(i.error));return}f(O(i.effective)),C({host:r}),v(null),b(!0)},t[16]=n,t[17]=d,t[18]=I):I=t[18];let L=I,R;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,k.jsx)(`h4`,{id:`settings-enterprise-hosts-title`,className:`text-sm font-medium`,children:(0,k.jsx)(r,{id:`J2-D_a`})}),t[19]=R):R=t[19];let z;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,k.jsx)(r,{id:`PgY2nN`}),t[20]=z):z=t[20];let B;t[21]===o?B=t[22]:(B=(0,k.jsxs)(`div`,{children:[R,(0,k.jsx)(`p`,{id:o,className:`text-1sm text-muted-foreground`,children:z})]}),t[21]=o,t[22]=B);let V;t[23]!==a||t[24]!==L||t[25]!==d?(V=d.length>0?(0,k.jsx)(`ul`,{className:`space-y-1`,"data-testid":`settings-enterprise-hosts-list`,children:d.map(e=>(0,k.jsxs)(`li`,{className:`flex items-center justify-between gap-3`,children:[(0,k.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs`,children:e}),(0,k.jsx)(s,{variant:`ghost`,size:`icon`,className:`size-7`,"aria-label":a({id:`xVMoYb`,values:{host:e}}),ref:t=>{t?T.current.set(e,t):T.current.delete(e)},onClick:()=>L(e),children:(0,k.jsx)(p,{"aria-hidden":`true`})})]},e))}):(0,k.jsx)(`p`,{className:`text-1sm text-muted-foreground`,"data-testid":`settings-enterprise-hosts-empty`,children:(0,k.jsx)(r,{id:`HK2eIK`})}),t[23]=a,t[24]=L,t[25]=d,t[26]=V):V=t[26];let H;t[27]===a?H=t[28]:(H=a({id:`Qbf7Q4`}),t[27]=a,t[28]=H);let U=_!==null,W=_===null?o:`${o} ${l}`,G;t[29]===_?G=t[30]:(G=e=>{g(e.target.value),_!==null&&v(null)},t[29]=_,t[30]=G);let K;t[31]!==h||t[32]!==H||t[33]!==U||t[34]!==W||t[35]!==G?(K=(0,k.jsx)(m,{ref:E,value:h,"aria-label":H,placeholder:`github.example.com`,autoComplete:`off`,spellCheck:!1,inputMode:`url`,className:`h-7 flex-1 font-mono text-xs`,"aria-invalid":U,"aria-describedby":W,onChange:G}),t[31]=h,t[32]=H,t[33]=U,t[34]=W,t[35]=G,t[36]=K):K=t[36];let q;t[37]===h?q=t[38]:(q=h.trim(),t[37]=h,t[38]=q);let J=q===``,Y;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(Y=(0,k.jsx)(r,{id:`ALFlyF`}),t[39]=Y):Y=t[39];let X;t[40]===J?X=t[41]:(X=(0,k.jsx)(s,{type:`submit`,size:`sm`,variant:`secondary`,disabled:J,className:`h-7 px-2 font-normal text-xs`,children:Y}),t[40]=J,t[41]=X);let Z;t[42]!==re||t[43]!==K||t[44]!==X?(Z=(0,k.jsxs)(`form`,{className:`flex items-center gap-2 pt-1`,onSubmit:re,noValidate:!0,children:[K,X]}),t[42]=re,t[43]=K,t[44]=X,t[45]=Z):Z=t[45];let Q;t[46]!==_||t[47]!==l?(Q=_===null?null:(0,k.jsx)(`p`,{id:l,role:`alert`,className:`text-1sm text-destructive`,children:_}),t[46]=_,t[47]=l,t[48]=Q):Q=t[48];let $;t[49]===y?$=t[50]:($=y?(0,k.jsx)(`p`,{role:`status`,className:`text-1sm text-muted-foreground`,children:(0,k.jsx)(r,{id:`3LuFP-`})}):null,t[49]=y,t[50]=$);let ie;t[51]!==V||t[52]!==Z||t[53]!==Q||t[54]!==$?(ie=(0,k.jsxs)(`div`,{className:`space-y-2 rounded-lg border bg-card p-3`,children:[V,Z,Q,$]}),t[51]=V,t[52]=Z,t[53]=Q,t[54]=$,t[55]=ie):ie=t[55];let ae;return t[56]!==B||t[57]!==ie?(ae=(0,k.jsxs)(`section`,{"aria-labelledby":`settings-enterprise-hosts-title`,className:`space-y-4`,"data-field":`section:enterprise-hosts`,"data-testid":`settings-enterprise-hosts`,children:[B,ie]}),t[56]=B,t[57]=ie,t[58]=ae):ae=t[58],ae}function te(e){return u(e)}function j(e){let t=(0,ee.c)(44),{authQueryTransport:n,authTransport:a,userBinding:o}=e,{_:c}=i(),l;t[0]===n?l=t[1]:(l=n??g(),t[0]=n,t[1]=l);let u=l,d=h()?.remote??null,f;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(f={phase:`loading`},t[2]=f):f=t[2];let[p,m]=(0,S.useState)(f),[_,C]=(0,S.useState)(!1),[w,T]=(0,S.useState)(!1),[E,D]=(0,S.useState)(null),O=(0,S.useRef)(!1),te;t[3]===u?te=t[4]:(te=async function(){m({phase:`loading`});try{let e=await u.status();m({phase:`loaded`,result:e}),b(e)}catch(e){console.warn(`[AccountSection] GitHub status check failed`,e),m({phase:`check-failed`})}},t[3]=u,t[4]=te);let j=te,M;t[5]===j?M=t[6]:(M=()=>{j()},t[5]=j,t[6]=M);let N;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(N=[],t[7]=N):N=t[7],(0,S.useEffect)(M,N);let P;t[8]!==c||t[9]!==j||t[10]!==u?(P=async function(){if(O.current)return;O.current=!0,C(!1),T(!0),D(null);let e=null;try{let t=u.signout?await u.signout():{ok:!1,error:c({id:`8cpOa8`})};t.ok||(e=t.error??c({id:`8cpOa8`}))}catch(t){console.warn(`[AccountSection] GitHub disconnect failed`,t),e=c({id:`8cpOa8`})}await j(),e&&D(e),T(!1),O.current=!1},t[8]=c,t[9]=j,t[10]=u,t[11]=P):P=t[11];let L=P,R;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,k.jsx)(r,{id:`MpZRQy`}),t[12]=R):R=t[12];let z;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,k.jsx)(x,{titleId:`settings-account-title`,title:R,scope:`user`,children:(0,k.jsx)(r,{id:`pd6t3G`})}),t[13]=z):z=t[13];let B;t[14]!==E||t[15]!==w||t[16]!==L||t[17]!==j||t[18]!==p.phase||t[19]!==p.result?(B=p.phase===`loading`?(0,k.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"aria-busy":`true`,className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-loading`,children:[(0,k.jsx)(`span`,{className:`sr-only`,children:(0,k.jsx)(r,{id:`IWGfGF`})}),(0,k.jsx)(y,{className:`h-4 w-40`}),(0,k.jsx)(y,{className:`h-8 w-32`})]}):p.phase===`check-failed`?(0,k.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-check-failed`,children:[(0,k.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:(0,k.jsx)(r,{id:`T_wG4n`})}),(0,k.jsx)(s,{variant:`outline`,size:`sm`,onClick:()=>void j(),children:(0,k.jsx)(r,{id:`KDw4GX`})})]}):p.result.authenticated?p.result.tier===`A`?(0,k.jsx)(re,{login:p.result.login}):(0,k.jsx)(F,{login:p.result.login,disconnecting:w,error:E,onDisconnect:()=>void L()}):p.result.unsupportedOrigin===void 0?(0,k.jsx)(I,{onConnect:()=>C(!0)}):null,t[14]=E,t[15]=w,t[16]=L,t[17]=j,t[18]=p.phase,t[19]=p.result,t[20]=B):B=t[20];let V;t[21]===o?V=t[22]:(V=(0,k.jsx)(A,{binding:o}),t[21]=o,t[22]=V);let H;t[23]!==a||t[24]!==d?(H=(0,k.jsx)(ne,{authTransport:a,remote:d}),t[23]=a,t[24]=d,t[25]=H):H=t[25];let U;t[26]!==V||t[27]!==H||t[28]!==B?(U=(0,k.jsxs)(`div`,{className:`space-y-8`,children:[B,V,H]}),t[26]=V,t[27]=H,t[28]=B,t[29]=U):U=t[29];let W;t[30]===j?W=t[31]:(W=e=>{C(e),e||j()},t[30]=j,t[31]=W);let G=p.phase===`loaded`?p.result.host:void 0,K=p.phase===`loaded`?p.result.ghAvailable:void 0,q;t[32]===j?q=t[33]:(q=()=>{j()},t[32]=j,t[33]=q);let J;t[34]!==_||t[35]!==a||t[36]!==W||t[37]!==G||t[38]!==K||t[39]!==q?(J=(0,k.jsx)(v,{open:_,onOpenChange:W,transport:a,host:G,ghAvailable:K,onSuccess:q}),t[34]=_,t[35]=a,t[36]=W,t[37]=G,t[38]=K,t[39]=q,t[40]=J):J=t[40];let Y;return t[41]!==U||t[42]!==J?(Y=(0,k.jsxs)(`section`,{"aria-labelledby":`settings-account-title`,className:`space-y-5`,"data-testid":`settings-account`,children:[z,U,J]}),t[41]=U,t[42]=J,t[43]=Y):Y=t[43],Y}function M(e){let t=e.split(`/`)[0]??``;return l(t)?t:``}function N(e){let t=(0,ee.c)(6),{login:n,host:i}=e,a;t[0]!==i||t[1]!==n?(a={login:n,host:i},t[0]=i,t[1]=n,t[2]=a):a=t[2];let o;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(o={0:(0,k.jsx)(`code`,{translate:`no`})},t[3]=o):o=t[3];let s;return t[4]===a?s=t[5]:(s=(0,k.jsx)(`p`,{role:`status`,className:`text-1sm text-muted-foreground`,"data-testid":`settings-account-host-token-success`,children:(0,k.jsx)(r,{id:`4p8Baj`,values:a,components:o})}),t[4]=a,t[5]=s),s}var P={"data-1p-ignore":!0,"data-lpignore":`true`,"data-bwignore":!0,"data-form-type":`other`};function ne(e){let t=(0,ee.c)(89),{authTransport:n,remote:a}=e,{_:c}=i(),u;t[0]===n?u=t[1]:(u=n??_(),t[0]=n,t[1]=u);let p=u,h=a?.label??null,g;t[2]===a?g=t[3]:(g=a?f(a):!1,t[2]=a,t[3]=g);let v=g,y;t[4]===a?y=t[5]:(y=d(a),t[4]=a,t[5]=y);let b=y,x=(0,S.useId)(),C=(0,S.useId)(),w=(0,S.useId)(),T=(0,S.useId)(),E=(0,S.useId)(),[D,O]=(0,S.useState)(``),[A,te]=(0,S.useState)(``),[j,ne]=(0,S.useState)(``),[F,re]=(0,S.useState)(!1),[I,L]=(0,S.useState)(null),[R,z]=(0,S.useState)(!1),[B,V]=(0,S.useState)(null),H=(0,S.useRef)(!1),U=(0,S.useRef)(!1),W,G;t[6]!==v||t[7]!==h||t[8]!==b?(W=()=>{if(U.current||h===null||v||!b)return;let e=M(h);e&&(U.current=!0,O(e))},G=[h,v,b],t[6]=v,t[7]=h,t[8]=b,t[9]=W,t[10]=G):(W=t[9],G=t[10]),(0,S.useEffect)(W,G);let K;t[11]!==c||t[12]!==D||t[13]!==p||t[14]!==j||t[15]!==A?(K=async function(){if(H.current)return;let e=D.trim(),t=A.trim(),n=j.trim();if(!e||!t||!n)return;if(!l(e)){V(null),z(!0),L(c({id:`rZFxkH`}));return}if(z(!1),!p.hostToken){L(c({id:`iMYFJM`}));return}H.current=!0,re(!0),L(null),V(null);let r=await p.hostToken(e,t,n).catch(e=>(console.warn(`[AccountSection] storing a host token failed`,e),{ok:!1,login:void 0,error:c({id:`Q5fqMz`})}));re(!1),H.current=!1,r.ok?(ne(``),V({login:r.login||t,host:e})):L(r.error??c({id:`sNeKjP`}))},t[11]=c,t[12]=D,t[13]=p,t[14]=j,t[15]=A,t[16]=K):K=t[16];let q=K,J;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,k.jsx)(`h4`,{id:`settings-host-tokens-title`,className:`text-sm font-medium`,children:(0,k.jsx)(r,{id:`jbhCDS`})}),t[17]=J):J=t[17];let Y;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(Y=(0,k.jsxs)(`div`,{children:[J,(0,k.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,k.jsx)(r,{id:`-nA68n`})})]}),t[18]=Y):Y=t[18];let X;t[19]===q?X=t[20]:(X=e=>{e.preventDefault(),q()},t[19]=q,t[20]=X);let Z;t[21]!==v||t[22]!==h||t[23]!==b?(Z=h!==null&&!v&&!b?(0,k.jsx)(`p`,{className:`text-1sm text-muted-foreground`,"data-testid":`settings-account-host-token-not-https`,children:(0,k.jsx)(r,{id:`OWs-8P`})}):null,t[21]=v,t[22]=h,t[23]=b,t[24]=Z):Z=t[24];let Q;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(Q=(0,k.jsx)(r,{id:`Ai2U7L`}),t[25]=Q):Q=t[25];let $;t[26]===x?$=t[27]:($=(0,k.jsx)(o,{htmlFor:x,children:Q}),t[26]=x,t[27]=$);let ie=R||void 0,ae=R&&I?C:void 0,oe;t[28]===R?oe=t[29]:(oe=e=>{U.current=!0,O(e.target.value),R&&(z(!1),L(null))},t[28]=R,t[29]=oe);let se;t[30]!==D||t[31]!==x||t[32]!==ie||t[33]!==ae||t[34]!==oe?(se=(0,k.jsx)(m,{id:x,type:`text`,placeholder:`git.example.com`,autoComplete:`off`,...P,"aria-invalid":ie,"aria-describedby":ae,value:D,onChange:oe}),t[30]=D,t[31]=x,t[32]=ie,t[33]=ae,t[34]=oe,t[35]=se):se=t[35];let ce;t[36]!==$||t[37]!==se?(ce=(0,k.jsxs)(`div`,{className:`space-y-1`,children:[$,se]}),t[36]=$,t[37]=se,t[38]=ce):ce=t[38];let le;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(le=(0,k.jsx)(r,{id:`7sNhEz`}),t[39]=le):le=t[39];let ue;t[40]===w?ue=t[41]:(ue=(0,k.jsx)(o,{htmlFor:w,children:le}),t[40]=w,t[41]=ue);let de;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(de=e=>te(e.target.value),t[42]=de):de=t[42];let fe;t[43]!==A||t[44]!==T||t[45]!==w?(fe=(0,k.jsx)(m,{id:w,type:`text`,autoComplete:`off`,...P,"aria-describedby":T,value:A,onChange:de}),t[43]=A,t[44]=T,t[45]=w,t[46]=fe):fe=t[46];let pe;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(pe=(0,k.jsx)(r,{id:`azrR7I`,components:{0:(0,k.jsx)(`code`,{translate:`no`}),1:(0,k.jsx)(`code`,{translate:`no`}),2:(0,k.jsx)(`code`,{translate:`no`})}}),t[47]=pe):pe=t[47];let me;t[48]===T?me=t[49]:(me=(0,k.jsx)(`p`,{id:T,className:`text-1sm text-muted-foreground`,"data-testid":`settings-account-host-token-username-hint`,children:pe}),t[48]=T,t[49]=me);let he;t[50]!==ue||t[51]!==fe||t[52]!==me?(he=(0,k.jsxs)(`div`,{className:`space-y-1`,children:[ue,fe,me]}),t[50]=ue,t[51]=fe,t[52]=me,t[53]=he):he=t[53];let ge;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(ge=(0,k.jsx)(r,{id:`SkUcEr`}),t[54]=ge):ge=t[54];let _e;t[55]===E?_e=t[56]:(_e=(0,k.jsx)(o,{htmlFor:E,children:ge}),t[55]=E,t[56]=_e);let ve;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(ve=e=>ne(e.target.value),t[57]=ve):ve=t[57];let ye;t[58]!==j||t[59]!==E?(ye=(0,k.jsx)(m,{id:E,type:`password`,autoComplete:`off`,...P,value:j,onChange:ve}),t[58]=j,t[59]=E,t[60]=ye):ye=t[60];let be;t[61]!==_e||t[62]!==ye?(be=(0,k.jsxs)(`div`,{className:`space-y-1`,children:[_e,ye]}),t[61]=_e,t[62]=ye,t[63]=be):be=t[63];let xe;t[64]!==D||t[65]!==F||t[66]!==j||t[67]!==A?(xe=F||!D.trim()||!A.trim()||!j.trim(),t[64]=D,t[65]=F,t[66]=j,t[67]=A,t[68]=xe):xe=t[68];let Se;t[69]===F?Se=t[70]:(Se=F?(0,k.jsx)(r,{id:`1yHVE-`}):(0,k.jsx)(r,{id:`zXZJoN`}),t[69]=F,t[70]=Se);let Ce;t[71]!==xe||t[72]!==Se?(Ce=(0,k.jsx)(s,{type:`submit`,"data-testid":`settings-account-host-token-submit`,disabled:xe,children:Se}),t[71]=xe,t[72]=Se,t[73]=Ce):Ce=t[73];let we;t[74]===B?we=t[75]:(we=B?(0,k.jsx)(N,{login:B.login,host:B.host}):null,t[74]=B,t[75]=we);let Te;t[76]!==I||t[77]!==C||t[78]!==R?(Te=I?(0,k.jsx)(`p`,{id:R?C:void 0,role:`alert`,className:`text-sm text-destructive`,"data-testid":`settings-account-host-token-error`,children:I}):null,t[76]=I,t[77]=C,t[78]=R,t[79]=Te):Te=t[79];let Ee;return t[80]!==Z||t[81]!==ce||t[82]!==he||t[83]!==be||t[84]!==Ce||t[85]!==we||t[86]!==Te||t[87]!==X?(Ee=(0,k.jsxs)(`section`,{"aria-labelledby":`settings-host-tokens-title`,className:`space-y-4`,"data-field":`section:host-tokens`,children:[Y,(0,k.jsxs)(`form`,{className:`space-y-3 rounded-lg border bg-card p-3`,"data-testid":`settings-account-host-token`,"aria-labelledby":`settings-host-tokens-title`,autoComplete:`off`,onSubmit:X,children:[Z,ce,he,be,Ce,we,Te]})]}),t[80]=Z,t[81]=ce,t[82]=he,t[83]=be,t[84]=Ce,t[85]=we,t[86]=Te,t[87]=X,t[88]=Ee):Ee=t[88],Ee}function F(e){let t=(0,ee.c)(20),{login:n,disconnecting:i,error:a,onDisconnect:o}=e,c;t[0]===n?c=t[1]:(c=(0,k.jsx)(`div`,{className:`text-sm font-medium`,children:(0,k.jsx)(r,{id:`E_tNGD`,values:{login:n}})}),t[0]=n,t[1]=c);let l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,k.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,k.jsx)(r,{id:`nxlOpL`})}),t[2]=l):l=t[2];let u;t[3]===c?u=t[4]:(u=(0,k.jsxs)(`div`,{className:`min-w-0`,children:[c,l]}),t[3]=c,t[4]=u);let d;t[5]===i?d=t[6]:(d=i?(0,k.jsx)(r,{id:`rppgXF`}):(0,k.jsx)(r,{id:`-K0AvT`}),t[5]=i,t[6]=d);let f;t[7]!==i||t[8]!==o||t[9]!==d?(f=(0,k.jsx)(s,{variant:`outline`,onClick:o,disabled:i,"aria-describedby":`settings-account-disconnect-caveat`,"data-testid":`settings-account-disconnect`,children:d}),t[7]=i,t[8]=o,t[9]=d,t[10]=f):f=t[10];let p;t[11]!==u||t[12]!==f?(p=(0,k.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[u,f]}),t[11]=u,t[12]=f,t[13]=p):p=t[13];let m;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,k.jsx)(`p`,{id:`settings-account-disconnect-caveat`,className:`text-muted-foreground text-1sm`,"data-testid":`settings-account-disconnect-caveat`,children:(0,k.jsx)(r,{id:`msOK6I`})}),t[14]=m):m=t[14];let h;t[15]===a?h=t[16]:(h=a?(0,k.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,"data-testid":`settings-account-disconnect-error`,children:a}):null,t[15]=a,t[16]=h);let g;return t[17]!==p||t[18]!==h?(g=(0,k.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-connected`,children:[p,m,h]}),t[17]=p,t[18]=h,t[19]=g):g=t[19],g}function re(e){let t=(0,ee.c)(5),{login:n}=e,i;t[0]===n?i=t[1]:(i=(0,k.jsx)(`div`,{className:`text-sm font-medium`,children:(0,k.jsx)(r,{id:`E_tNGD`,values:{login:n}})}),t[0]=n,t[1]=i);let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,k.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,k.jsx)(r,{id:`ny6vNn`})}),t[2]=a):a=t[2];let o;return t[3]===i?o=t[4]:(o=(0,k.jsx)(`div`,{className:`rounded-md border p-3`,"data-testid":`settings-account-gh-cli`,children:(0,k.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[i,a]})}),t[3]=i,t[4]=o),o}function I(e){let t=(0,ee.c)(5),{onConnect:n}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,k.jsx)(`div`,{className:`text-sm font-medium`,children:(0,k.jsx)(r,{id:`S33tz3`})}),t[0]=i):i=t[0];let a;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,k.jsxs)(`div`,{className:`min-w-0`,children:[i,(0,k.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,k.jsx)(r,{id:`9djC8C`})})]}),t[1]=a):a=t[1];let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,k.jsx)(r,{id:`5lWFkC`}),t[2]=o):o=t[2];let c;return t[3]===n?c=t[4]:(c=(0,k.jsx)(`div`,{className:`rounded-md border p-3`,"data-testid":`settings-account-disconnected`,children:(0,k.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[a,(0,k.jsx)(s,{onClick:n,"data-testid":`settings-account-connect`,children:o})]})}),t[3]=n,t[4]=c),c}export{j as AccountSection};
|