@inkeep/open-knowledge 0.82.0-beta.4 → 0.82.0-beta.5
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 +6 -6
- package/dist/constants-ChfpQjIj.mjs +1 -0
- package/dist/{dist-DdoZ294B.mjs → dist-BKMK4uhh.mjs} +224 -224
- package/dist/{dist-C1WwDYOU.mjs → dist-DX-OB6FC.mjs} +1 -1
- package/dist/index.mjs +4 -4
- package/dist/{init-vgeY_wHD.mjs → init-Bvmrrn6M.mjs} +2 -2
- package/dist/init-kMgqplOQ.mjs +1 -0
- package/dist/{launch-json-removal-D4FuJ2Te.mjs → launch-json-removal-DGgpI_Jz.mjs} +1 -1
- package/dist/loader-DgBlR4_N.mjs +1 -0
- package/dist/{loader-DYbtvtxH.mjs → loader-DyhgFxyu.mjs} +1 -1
- package/dist/{md-manager-BGnqyqi1-D77IwxHB.mjs → md-manager-BGnqyqi1-CnT_8Ivp.mjs} +2 -2
- package/dist/{open-browser-Dg3gcrHM.mjs → open-browser-CuuJWVs1.mjs} +1 -1
- package/dist/parse-worker.mjs +1 -1
- package/dist/preview-3fHrsz6g.mjs +1 -0
- package/dist/{preview-1EGVW00C.mjs → preview-CS-ZP7yP.mjs} +1 -1
- package/dist/public/assets/{ActivityModeContent-qim4zFx-.js → ActivityModeContent-CVkgwfSl.js} +1 -1
- package/dist/public/assets/{AddPropertiesButton-DKXiB5hC.js → AddPropertiesButton-D16oCS_N.js} +2 -2
- package/dist/public/assets/{AgentDiffPane-BD8yOgrS.js → AgentDiffPane-HH8jeegf.js} +1 -1
- package/dist/public/assets/{AgentThreadClientBinder-18BD6ihn.js → AgentThreadClientBinder-BeRtMFJl.js} +1 -1
- package/dist/public/assets/{BugReportHistory-C2kxTgHh.js → BugReportHistory-B-6LLHxx.js} +1 -1
- package/dist/public/assets/{BugReportHistoryDialog-DgtiL-NP.js → BugReportHistoryDialog-CNK92-ge.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-D7ODqRwE.js → CodeMirrorPropInput-DF3sY_TW.js} +1 -1
- package/dist/public/assets/{ConsentDialogBody-CD7KM28d.js → ConsentDialogBody-c59kzsDd.js} +1 -1
- package/dist/public/assets/{DeleteConfirmationDialog-C1zIx9Bd.js → DeleteConfirmationDialog-CW-EDwBk.js} +1 -1
- package/dist/public/assets/{DiffViewBoundary-DGNf5H84.js → DiffViewBoundary-BCeCuRF4.js} +1 -1
- package/dist/public/assets/{DocumentContext-BHjfklWj.js → DocumentContext-Be48_bAF.js} +1 -1
- package/dist/public/assets/{EditorModeToggle-XKuoOdJs.js → EditorModeToggle-DtMDf2MQ.js} +1 -1
- package/dist/public/assets/{ExcalidrawDocEditor-I2eQXX7E.js → ExcalidrawDocEditor-BJ2A3QGa.js} +1 -1
- package/dist/public/assets/FeedbackForm-Ap-gvcmO.js +1 -0
- package/dist/public/assets/{GraphPanel-nDzxbZwr.js → GraphPanel-BCNpJurX.js} +1 -1
- package/dist/public/assets/{ImageAttachments-Dob2zdX6.js → ImageAttachments-DaSjleMs.js} +1 -1
- package/dist/public/assets/{ImportSkillDialog-CU7KSDgH.js → ImportSkillDialog-BldGupBv.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-81_fDdG_.js → LintConfigEditor-DnD5pFzI.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-BsdnBIW1.js +1 -0
- package/dist/public/assets/{ManagedArtifactProperties-DTfJaeLZ.js → ManagedArtifactProperties-BtTz8dwV.js} +1 -1
- package/dist/public/assets/{MermaidDocEditor-Dw5SypSn.js → MermaidDocEditor-CkwkPZvu.js} +1 -1
- package/dist/public/assets/{OpenInAgentMenuItem-BMo7aLCS.js → OpenInAgentMenuItem-tMDoc20x.js} +1 -1
- package/dist/public/assets/{PropertyDisplayRow-Bn0kgK3p.js → PropertyDisplayRow-FgvNazvo.js} +1 -1
- package/dist/public/assets/{RegisteredAgentIcon-DbL9sShX.js → RegisteredAgentIcon-XDCjRE4q.js} +1 -1
- package/dist/public/assets/{ReportBugDialogBody-DEETk9Jo.js → ReportBugDialogBody-bsGBQfHH.js} +1 -1
- package/dist/public/assets/{ReportBugMenuTrigger-B1WREGjA.js → ReportBugMenuTrigger-BAbnNfBU.js} +1 -1
- package/dist/public/assets/{SchemaConfigEditor-BLXTxBGL.js → SchemaConfigEditor-BU8wFtDN.js} +1 -1
- package/dist/public/assets/{SessionsHost-DquHUp9T.js → SessionsHost-BdpjIit2.js} +2 -2
- package/dist/public/assets/{SettingsDialogBody-DKEUH63t.js → SettingsDialogBody-DmPhthSq.js} +1 -1
- package/dist/public/assets/{ShareBranchSwitchDialog-BUS2my96.js → ShareBranchSwitchDialog-CPn3XsGL.js} +1 -1
- package/dist/public/assets/{ShareReceiveDialog-BKgD7Duc.js → ShareReceiveDialog-CavmNNtc.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-_8dejDWk.js → ShareReceiveMissDialog-C6Yv1L_L.js} +1 -1
- package/dist/public/assets/{SkillCostValue-CmCcSYjJ.js → SkillCostValue-CxnOdbgc.js} +1 -1
- package/dist/public/assets/{SkillEditBanner-DFdS9BhL.js → SkillEditBanner-DFTQUggR.js} +1 -1
- package/dist/public/assets/{SkillForkDialog-D5Aha7ke.js → SkillForkDialog-Bl0Maun5.js} +1 -1
- package/dist/public/assets/{SkillInstallMenu-Cju9gFSt.js → SkillInstallMenu-BW2fj8iT.js} +1 -1
- package/dist/public/assets/{SkillOriginInline-DPQ0UfdG.js → SkillOriginInline-Bo9-sZlU.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-SRsQowBm.js → SkillToolbarControls-xd9ybWt3.js} +1 -1
- package/dist/public/assets/{SlidesToolbarControls-8Tu4pV-S.js → SlidesToolbarControls-CDqPA4DN.js} +1 -1
- package/dist/public/assets/{SourceEditor-DUhZs5yo.js → SourceEditor-xUkiBN-x.js} +1 -1
- package/dist/public/assets/{SyncStatusBadge-B9wP5KjD.js → SyncStatusBadge-CMEBaJDA.js} +1 -1
- package/dist/public/assets/{TerminalPanel-Db-Lo-iL.js → TerminalPanel-BAdFCbjj.js} +1 -1
- package/dist/public/assets/{TerminalWindowApp-CAjzSiBI.js → TerminalWindowApp-D8Gswz-L.js} +1 -1
- package/dist/public/assets/{TextDocEditor-C7dpFdVd.js → TextDocEditor-CjRA_0cY.js} +1 -1
- package/dist/public/assets/{ThreadView-CsZKSzs5.js → ThreadView-CKZltO5Y.js} +1 -1
- package/dist/public/assets/{TimelineDiffPane-DcChEu2J.js → TimelineDiffPane-BxiAJgWC.js} +1 -1
- package/dist/public/assets/{agent-connections-iuaYc-Gk.js → agent-connections-B2xlqiAt.js} +1 -1
- package/dist/public/assets/{auth-state-cache-Dz-Yvu70.js → auth-state-cache-DkvW2mTJ.js} +1 -1
- package/dist/public/assets/{bug-report-send-manager-0DIkaLj0.js → bug-report-send-manager-Ep6NupAy.js} +1 -1
- package/dist/public/assets/{client-version-DJFCNOKL.js → client-version-aG92qoP2.js} +1 -1
- package/dist/public/assets/{comment-chips-jwrddJ4n.js → comment-chips-C8z94Yh3.js} +1 -1
- package/dist/public/assets/{config-provider-B4cgjuAt.js → config-provider-myFxAeZJ.js} +1 -1
- package/dist/public/assets/{css-color-to-hex-oO6GoCcb.js → css-color-to-hex-B1w0Vq2i.js} +1 -1
- package/dist/public/assets/{diagnostic-breadcrumb-DK-Cqae0.js → diagnostic-breadcrumb-YcMRmDMq.js} +1 -1
- package/dist/public/assets/{dist-CUgbgEDy.js → dist-DmvVdMAc.js} +2 -2
- package/dist/public/assets/{doc-paths-DaHerw67.js → doc-paths-CU5xFEmw.js} +1 -1
- package/dist/public/assets/{doc-undo-manager-ZAJ7EhHf.js → doc-undo-manager-Bb2wXN7B.js} +1 -1
- package/dist/public/assets/{documents-events-AGLgPGQa.js → documents-events-DChefUoE.js} +1 -1
- package/dist/public/assets/{file-tree-adapter--GNP_kR2.js → file-tree-adapter-CrwKZd5V.js} +1 -1
- package/dist/public/assets/{file-tree-utils-lPpxK5Yq.js → file-tree-utils-B-KHAA0w.js} +1 -1
- package/dist/public/assets/{folder-config-api-DDOXhGdo.js → folder-config-api-y_2lDcJg.js} +1 -1
- package/dist/public/assets/{index-BdhkBLck.js → index-Xs-rHCdv.js} +8 -8
- package/dist/public/assets/{lint-config-client-B_xNfTBy.js → lint-config-client-kGMpwF3X.js} +1 -1
- package/dist/public/assets/{markdownlint-rule-browser-DzjG_qoM.js → markdownlint-rule-browser-BZlDsCDj.js} +1 -1
- package/dist/public/assets/{navigation-targets-DV1dMVAb.js → navigation-targets-BX0D_UPk.js} +1 -1
- package/dist/public/assets/{page-list-cache-BaKlIcC-.js → page-list-cache-DRXLxcuB.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-4xt56kJR.js → pending-receive-nav-store-C6LJ2Kzv.js} +1 -1
- package/dist/public/assets/{preferred-session-events-CeCXvWmc.js → preferred-session-events-B7RLIJvY.js} +1 -1
- package/dist/public/assets/{progress-D6YLD7xV.js → progress-Dutcigeg.js} +1 -1
- package/dist/public/assets/{project-paths-Cs2SPmYR.js → project-paths-Rt7fORWq.js} +1 -1
- package/dist/public/assets/{prop-types-Dv_cZRA5.js → prop-types-B2w_fFJW.js} +1 -1
- package/dist/public/assets/{receive-store-CvglCO2B.js → receive-store-VACJKx3F.js} +1 -1
- package/dist/public/assets/{selection-context-CDv7YpZ_.js → selection-context-Cq2VCQBg.js} +1 -1
- package/dist/public/assets/{sign-in-terminal-events-BigKQgqQ.js → sign-in-terminal-events-DXTC0inU.js} +1 -1
- package/dist/public/assets/{skill-scope-BGcfBWlz.js → skill-scope-DX2Q9lzh.js} +1 -1
- package/dist/public/assets/{skills-api-mYKB0zDh.js → skills-api-Cpwwq_FO.js} +1 -1
- package/dist/public/assets/{src-xGMvMbEd.js → src-CGPFfpcu.js} +1 -1
- package/dist/public/assets/{startup-marks-yQqTMBm5.js → startup-marks-CJJqLRKP.js} +1 -1
- package/dist/public/assets/{tag-pill-input-BQLv6DZ1.js → tag-pill-input-DLQqKzbN.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-BIFEl4OT.js → target-navigation-intent-BwAGdOsi.js} +1 -1
- package/dist/public/assets/{telemetry-startup-DyEWsvUO.js → telemetry-startup-CMJw54MN.js} +1 -1
- package/dist/public/assets/{terminal-command-events-CoTkNESn.js → terminal-command-events-CoI7bIgQ.js} +1 -1
- package/dist/public/assets/{terminal-launch-events-BBjjknBw.js → terminal-launch-events-BMFqKHQ8.js} +1 -1
- package/dist/public/assets/{terminal-telemetry-CGR3Wr8L.js → terminal-telemetry-C0nwSvRH.js} +1 -1
- package/dist/public/assets/{thread-client-V2_Sw10t.js → thread-client-2zOGI06i.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-Bwb8vXQS.js → typing-burst-detector-SGbZpXed.js} +1 -1
- package/dist/public/assets/{uninstall-BcI5d3jC.js → uninstall-Bqv6A4OL.js} +1 -1
- package/dist/public/assets/{use-activity-panel-Bm-_7omz.js → use-activity-panel-D3mCupUz.js} +1 -1
- package/dist/public/assets/{use-apply-config-language-Bzn7Rbw_.js → use-apply-config-language--jTlcFWU.js} +1 -1
- package/dist/public/assets/{use-collab-url-D3j3svaH.js → use-collab-url-Bs4wUHQ8.js} +1 -1
- package/dist/public/assets/{use-conflicts-8sSRJ_Uy.js → use-conflicts-Due_s21R.js} +1 -1
- package/dist/public/assets/{use-git-sync-status-CBlTkWfK.js → use-git-sync-status-CLv7EZOq.js} +1 -1
- package/dist/public/assets/{use-installed-clis-ClKL7RtP.js → use-installed-clis-L2RDjEtc.js} +2 -2
- package/dist/public/assets/{use-live-xterm-theme-bJiLIpxd.js → use-live-xterm-theme-XZgq5LKh.js} +1 -1
- package/dist/public/assets/{use-open-skill-BpW3ZhuK.js → use-open-skill-DV5hhMVO.js} +1 -1
- package/dist/public/assets/{use-settings-route-DL25HSeL.js → use-settings-route-DI6YfB7r.js} +1 -1
- package/dist/public/assets/{use-skill-origin-Cts8svd2.js → use-skill-origin-ChIkNH5y.js} +1 -1
- package/dist/public/assets/{use-skills-DXlhkRBq.js → use-skills-B1b-aZeu.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-Br80VTvl.js → use-terminal-enabled-Djcq-lbC.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-l604pHZz.js → use-timeline-entry-diff-BGpMCJkj.js} +1 -1
- package/dist/public/assets/{use-workspace-DtyUPSZ4.js → use-workspace-Byr5yIN5.js} +1 -1
- package/dist/public/index.html +59 -59
- package/dist/public/uninstall.html +3 -3
- package/dist/{registry-probes-BXgdIidc.mjs → registry-probes-BqQhP0ax.mjs} +1 -1
- package/dist/{removal-file-path-Ce-oxAGQ.mjs → removal-file-path-BeRPeEws.mjs} +1 -1
- package/dist/{repair-launch-json-CtsInz2s.mjs → repair-launch-json-CzMEUN6E.mjs} +1 -1
- package/dist/{repair-mcp-configs-BESnoIPY.mjs → repair-mcp-configs-DiEzfN1-.mjs} +1 -1
- package/dist/src-C_P2wuNq.mjs +1 -0
- package/dist/{src-KNAqsxPK.mjs → src-DwoFHSWS.mjs} +1 -1
- package/dist/start-Ct8veQKD.mjs +1 -0
- package/dist/{start-B8iic9V_.mjs → start-jgWvvxuy.mjs} +3 -3
- package/package.json +4 -4
- package/dist/constants-W9G4vRvJ.mjs +0 -1
- package/dist/init-DaBUbh8G.mjs +0 -1
- package/dist/loader-YyyVC5zh.mjs +0 -1
- package/dist/preview-BQhr7b8a.mjs +0 -1
- package/dist/public/assets/FeedbackForm-BQ8aBBom.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-yEjDaTS8.js +0 -1
- package/dist/src-BPwbNxCr.mjs +0 -1
- package/dist/start-BXE7aaH4.mjs +0 -1
package/dist/public/index.html
CHANGED
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
-->
|
|
95
95
|
<script>(() => { try { const raw = localStorage.getItem('ok-language-v1'); if (!raw) return; const o = JSON.parse(raw); if (typeof o?.locale !== 'string' || !/^[a-zA-Z]{2,8}(-[a-zA-Z0-9]{2,8})*$/.test(o.locale)) return; document.documentElement.lang = o.locale; document.documentElement.dir = o.dir === 'rtl' ? 'rtl' : 'ltr'; } catch {} })();</script>
|
|
96
96
|
<style>html { background-color: #fafafa } html.dark { background-color: #171717 }</style>
|
|
97
|
-
<script type="module" crossorigin src="./assets/index-
|
|
97
|
+
<script type="module" crossorigin src="./assets/index-Xs-rHCdv.js"></script>
|
|
98
98
|
<link rel="modulepreload" crossorigin href="./assets/chunk-CYidjpOJ.js">
|
|
99
99
|
<link rel="modulepreload" crossorigin href="./assets/react-f2sANaYj.js">
|
|
100
100
|
<link rel="modulepreload" crossorigin href="./assets/react-dom-DPxgxlDT.js">
|
|
@@ -108,19 +108,19 @@
|
|
|
108
108
|
<link rel="modulepreload" crossorigin href="./assets/lib-DmueaA5E.js">
|
|
109
109
|
<link rel="modulepreload" crossorigin href="./assets/markdownit-CugClK-K.js">
|
|
110
110
|
<link rel="modulepreload" crossorigin href="./assets/w3c-keyname-C7Rznu6R.js">
|
|
111
|
-
<link rel="modulepreload" crossorigin href="./assets/dist-
|
|
111
|
+
<link rel="modulepreload" crossorigin href="./assets/dist-DmvVdMAc.js">
|
|
112
112
|
<link rel="modulepreload" crossorigin href="./assets/dist-PQ5KMVDh.js">
|
|
113
113
|
<link rel="modulepreload" crossorigin href="./assets/compiler-runtime-BfE3aGVn.js">
|
|
114
114
|
<link rel="modulepreload" crossorigin href="./assets/jsx-runtime-BUgB2tll.js">
|
|
115
115
|
<link rel="modulepreload" crossorigin href="./assets/dist-Cr4-nBVI.js">
|
|
116
116
|
<link rel="modulepreload" crossorigin href="./assets/dist-CJhtNlOm2.js">
|
|
117
117
|
<link rel="modulepreload" crossorigin href="./assets/messages-B_Wv5APO.js">
|
|
118
|
-
<link rel="modulepreload" crossorigin href="./assets/use-apply-config-language
|
|
119
|
-
<link rel="modulepreload" crossorigin href="./assets/client-version-
|
|
118
|
+
<link rel="modulepreload" crossorigin href="./assets/use-apply-config-language--jTlcFWU.js">
|
|
119
|
+
<link rel="modulepreload" crossorigin href="./assets/client-version-aG92qoP2.js">
|
|
120
120
|
<link rel="modulepreload" crossorigin href="./assets/dist-Nvb76hAm.js">
|
|
121
121
|
<link rel="modulepreload" crossorigin href="./assets/use-apply-config-theme-B5w38X1P.js">
|
|
122
|
-
<link rel="modulepreload" crossorigin href="./assets/css-color-to-hex-
|
|
123
|
-
<link rel="modulepreload" crossorigin href="./assets/config-provider-
|
|
122
|
+
<link rel="modulepreload" crossorigin href="./assets/css-color-to-hex-B1w0Vq2i.js">
|
|
123
|
+
<link rel="modulepreload" crossorigin href="./assets/config-provider-myFxAeZJ.js">
|
|
124
124
|
<link rel="modulepreload" crossorigin href="./assets/dist-BHv-mziD.js">
|
|
125
125
|
<link rel="modulepreload" crossorigin href="./assets/dist-BcvirUWL.js">
|
|
126
126
|
<link rel="modulepreload" crossorigin href="./assets/dist-BDna-dOq.js">
|
|
@@ -160,15 +160,15 @@
|
|
|
160
160
|
<link rel="modulepreload" crossorigin href="./assets/folder-open-dlosmFj2.js">
|
|
161
161
|
<link rel="modulepreload" crossorigin href="./assets/trash-2-CYyUeKpx.js">
|
|
162
162
|
<link rel="modulepreload" crossorigin href="./assets/with-selector-PRoyWQiu.js">
|
|
163
|
-
<link rel="modulepreload" crossorigin href="./assets/file-tree-utils-
|
|
164
|
-
<link rel="modulepreload" crossorigin href="./assets/doc-paths-
|
|
165
|
-
<link rel="modulepreload" crossorigin href="./assets/navigation-targets-
|
|
163
|
+
<link rel="modulepreload" crossorigin href="./assets/file-tree-utils-B-KHAA0w.js">
|
|
164
|
+
<link rel="modulepreload" crossorigin href="./assets/doc-paths-CU5xFEmw.js">
|
|
165
|
+
<link rel="modulepreload" crossorigin href="./assets/navigation-targets-BX0D_UPk.js">
|
|
166
166
|
<link rel="modulepreload" crossorigin href="./assets/cm-theme-DIOYj0kt.js">
|
|
167
|
-
<link rel="modulepreload" crossorigin href="./assets/page-list-cache-
|
|
167
|
+
<link rel="modulepreload" crossorigin href="./assets/page-list-cache-DRXLxcuB.js">
|
|
168
168
|
<link rel="modulepreload" crossorigin href="./assets/external-link-C41LkPrP.js">
|
|
169
169
|
<link rel="modulepreload" crossorigin href="./assets/documents-fetch-Dk9WlEKH.js">
|
|
170
170
|
<link rel="modulepreload" crossorigin href="./assets/note-window-mode-CsmLTxU_.js">
|
|
171
|
-
<link rel="modulepreload" crossorigin href="./assets/CodeMirrorPropInput-
|
|
171
|
+
<link rel="modulepreload" crossorigin href="./assets/CodeMirrorPropInput-DF3sY_TW.js">
|
|
172
172
|
<link rel="modulepreload" crossorigin href="./assets/git-branch-B_QTfwFA.js">
|
|
173
173
|
<link rel="modulepreload" crossorigin href="./assets/arrow-up-DfayW9xu.js">
|
|
174
174
|
<link rel="modulepreload" crossorigin href="./assets/maximize-2-Cyl0M-S4.js">
|
|
@@ -178,11 +178,11 @@
|
|
|
178
178
|
<link rel="modulepreload" crossorigin href="./assets/Mermaid-bW_7Lznj.js">
|
|
179
179
|
<link rel="modulepreload" crossorigin href="./assets/chevron-right-By2JkAgT.js">
|
|
180
180
|
<link rel="modulepreload" crossorigin href="./assets/circle-alert-_EpKBna4.js">
|
|
181
|
-
<link rel="modulepreload" crossorigin href="./assets/documents-events-
|
|
181
|
+
<link rel="modulepreload" crossorigin href="./assets/documents-events-DChefUoE.js">
|
|
182
182
|
<link rel="modulepreload" crossorigin href="./assets/parse-api-error-BtEdpaFC.js">
|
|
183
|
-
<link rel="modulepreload" crossorigin href="./assets/diagnostic-breadcrumb-
|
|
184
|
-
<link rel="modulepreload" crossorigin href="./assets/startup-marks-
|
|
185
|
-
<link rel="modulepreload" crossorigin href="./assets/prop-types-
|
|
183
|
+
<link rel="modulepreload" crossorigin href="./assets/diagnostic-breadcrumb-YcMRmDMq.js">
|
|
184
|
+
<link rel="modulepreload" crossorigin href="./assets/startup-marks-CJJqLRKP.js">
|
|
185
|
+
<link rel="modulepreload" crossorigin href="./assets/prop-types-B2w_fFJW.js">
|
|
186
186
|
<link rel="modulepreload" crossorigin href="./assets/eye-off-giYOTXzo.js">
|
|
187
187
|
<link rel="modulepreload" crossorigin href="./assets/settings-2-BKfqsbgc.js">
|
|
188
188
|
<link rel="modulepreload" crossorigin href="./assets/hash-DS6MhZ8c.js">
|
|
@@ -197,82 +197,82 @@
|
|
|
197
197
|
<link rel="modulepreload" crossorigin href="./assets/input-FC65XODQ.js">
|
|
198
198
|
<link rel="modulepreload" crossorigin href="./assets/dist-zcYT-cpc.js">
|
|
199
199
|
<link rel="modulepreload" crossorigin href="./assets/popover-D9P6t6oT.js">
|
|
200
|
-
<link rel="modulepreload" crossorigin href="./assets/use-collab-url-
|
|
200
|
+
<link rel="modulepreload" crossorigin href="./assets/use-collab-url-Bs4wUHQ8.js">
|
|
201
201
|
<link rel="modulepreload" crossorigin href="./assets/excalidraw-scene-2-0xTCIN.js">
|
|
202
202
|
<link rel="modulepreload" crossorigin href="./assets/known-skill-dirs-DJLt2Gvv.js">
|
|
203
|
-
<link rel="modulepreload" crossorigin href="./assets/skill-scope-
|
|
204
|
-
<link rel="modulepreload" crossorigin href="./assets/skills-api-
|
|
205
|
-
<link rel="modulepreload" crossorigin href="./assets/use-workspace-
|
|
206
|
-
<link rel="modulepreload" crossorigin href="./assets/DocumentContext-
|
|
203
|
+
<link rel="modulepreload" crossorigin href="./assets/skill-scope-DX2Q9lzh.js">
|
|
204
|
+
<link rel="modulepreload" crossorigin href="./assets/skills-api-Cpwwq_FO.js">
|
|
205
|
+
<link rel="modulepreload" crossorigin href="./assets/use-workspace-Byr5yIN5.js">
|
|
206
|
+
<link rel="modulepreload" crossorigin href="./assets/DocumentContext-Be48_bAF.js">
|
|
207
207
|
<link rel="modulepreload" crossorigin href="./assets/dist-Dhtu02232.js">
|
|
208
208
|
<link rel="modulepreload" crossorigin href="./assets/dist-tLQ-ULW1.js">
|
|
209
209
|
<link rel="modulepreload" crossorigin href="./assets/dist-BX7qfUal.js">
|
|
210
210
|
<link rel="modulepreload" crossorigin href="./assets/dropdown-menu-57MhAniC.js">
|
|
211
|
-
<link rel="modulepreload" crossorigin href="./assets/comment-chips-
|
|
212
|
-
<link rel="modulepreload" crossorigin href="./assets/file-tree-adapter
|
|
211
|
+
<link rel="modulepreload" crossorigin href="./assets/comment-chips-C8z94Yh3.js">
|
|
212
|
+
<link rel="modulepreload" crossorigin href="./assets/file-tree-adapter-CrwKZd5V.js">
|
|
213
213
|
<link rel="modulepreload" crossorigin href="./assets/acp-thread-protocol-CWS8alqr.js">
|
|
214
|
-
<link rel="modulepreload" crossorigin href="./assets/thread-client-
|
|
214
|
+
<link rel="modulepreload" crossorigin href="./assets/thread-client-2zOGI06i.js">
|
|
215
215
|
<link rel="modulepreload" crossorigin href="./assets/tool-list-format-BBT_vsDw.js">
|
|
216
216
|
<link rel="modulepreload" crossorigin href="./assets/image-attachment-Zzw38Bxb.js">
|
|
217
217
|
<link rel="modulepreload" crossorigin href="./assets/workspace-paths-B4HZ2xXF.js">
|
|
218
|
-
<link rel="modulepreload" crossorigin href="./assets/progress-
|
|
218
|
+
<link rel="modulepreload" crossorigin href="./assets/progress-Dutcigeg.js">
|
|
219
219
|
<link rel="modulepreload" crossorigin href="./assets/radio-group-npdxiS6E.js">
|
|
220
220
|
<link rel="modulepreload" crossorigin href="./assets/separator-CcvvqzEJ.js">
|
|
221
221
|
<link rel="modulepreload" crossorigin href="./assets/toggle-group-BxIyZnUJ.js">
|
|
222
222
|
<link rel="modulepreload" crossorigin href="./assets/useQuery-ZeEDLtxh.js">
|
|
223
223
|
<link rel="modulepreload" crossorigin href="./assets/format-fztcbowR.js">
|
|
224
224
|
<link rel="modulepreload" crossorigin href="./assets/braces-DqMTfPnb.js">
|
|
225
|
-
<link rel="modulepreload" crossorigin href="./assets/PropertyDisplayRow-
|
|
226
|
-
<link rel="modulepreload" crossorigin href="./assets/folder-config-api-
|
|
227
|
-
<link rel="modulepreload" crossorigin href="./assets/SkillCostValue-
|
|
225
|
+
<link rel="modulepreload" crossorigin href="./assets/PropertyDisplayRow-FgvNazvo.js">
|
|
226
|
+
<link rel="modulepreload" crossorigin href="./assets/folder-config-api-y_2lDcJg.js">
|
|
227
|
+
<link rel="modulepreload" crossorigin href="./assets/SkillCostValue-CxnOdbgc.js">
|
|
228
228
|
<link rel="modulepreload" crossorigin href="./assets/textarea-3qB7PlP7.js">
|
|
229
|
-
<link rel="modulepreload" crossorigin href="./assets/selection-context-
|
|
230
|
-
<link rel="modulepreload" crossorigin href="./assets/lint-config-client-
|
|
231
|
-
<link rel="modulepreload" crossorigin href="./assets/use-skills-
|
|
232
|
-
<link rel="modulepreload" crossorigin href="./assets/ManagedArtifactProperties-
|
|
229
|
+
<link rel="modulepreload" crossorigin href="./assets/selection-context-Cq2VCQBg.js">
|
|
230
|
+
<link rel="modulepreload" crossorigin href="./assets/lint-config-client-kGMpwF3X.js">
|
|
231
|
+
<link rel="modulepreload" crossorigin href="./assets/use-skills-B1b-aZeu.js">
|
|
232
|
+
<link rel="modulepreload" crossorigin href="./assets/ManagedArtifactProperties-BtTz8dwV.js">
|
|
233
233
|
<link rel="modulepreload" crossorigin href="./assets/arrow-up-right-BSqX8NAd.js">
|
|
234
|
-
<link rel="modulepreload" crossorigin href="./assets/use-git-sync-status-
|
|
234
|
+
<link rel="modulepreload" crossorigin href="./assets/use-git-sync-status-CLv7EZOq.js">
|
|
235
235
|
<link rel="modulepreload" crossorigin href="./assets/refresh-cw-DzVIxe7z.js">
|
|
236
|
-
<link rel="modulepreload" crossorigin href="./assets/terminal-command-events-
|
|
237
|
-
<link rel="modulepreload" crossorigin href="./assets/use-conflicts-
|
|
238
|
-
<link rel="modulepreload" crossorigin href="./assets/use-settings-route-
|
|
239
|
-
<link rel="modulepreload" crossorigin href="./assets/SyncStatusBadge-
|
|
236
|
+
<link rel="modulepreload" crossorigin href="./assets/terminal-command-events-CoI7bIgQ.js">
|
|
237
|
+
<link rel="modulepreload" crossorigin href="./assets/use-conflicts-Due_s21R.js">
|
|
238
|
+
<link rel="modulepreload" crossorigin href="./assets/use-settings-route-DI6YfB7r.js">
|
|
239
|
+
<link rel="modulepreload" crossorigin href="./assets/SyncStatusBadge-CMEBaJDA.js">
|
|
240
240
|
<link rel="modulepreload" crossorigin href="./assets/cursor-C1n4GZG0.js">
|
|
241
|
-
<link rel="modulepreload" crossorigin href="./assets/RegisteredAgentIcon-
|
|
241
|
+
<link rel="modulepreload" crossorigin href="./assets/RegisteredAgentIcon-XDCjRE4q.js">
|
|
242
242
|
<link rel="modulepreload" crossorigin href="./assets/folder-C4F4ia-z.js">
|
|
243
243
|
<link rel="modulepreload" crossorigin href="./assets/monitor-CO0O7e7H.js">
|
|
244
244
|
<link rel="modulepreload" crossorigin href="./assets/copilot-BCybAoDg.js">
|
|
245
|
-
<link rel="modulepreload" crossorigin href="./assets/OpenInAgentMenuItem-
|
|
245
|
+
<link rel="modulepreload" crossorigin href="./assets/OpenInAgentMenuItem-tMDoc20x.js">
|
|
246
246
|
<link rel="modulepreload" crossorigin href="./assets/mascot-outline-CtS592mc.js">
|
|
247
247
|
<link rel="modulepreload" crossorigin href="./assets/field-Bp-wqfBg.js">
|
|
248
|
-
<link rel="modulepreload" crossorigin href="./assets/agent-connections-
|
|
248
|
+
<link rel="modulepreload" crossorigin href="./assets/agent-connections-B2xlqiAt.js">
|
|
249
249
|
<link rel="modulepreload" crossorigin href="./assets/dist-CsrrNdnj.js">
|
|
250
|
-
<link rel="modulepreload" crossorigin href="./assets/DeleteConfirmationDialog-
|
|
250
|
+
<link rel="modulepreload" crossorigin href="./assets/DeleteConfirmationDialog-CW-EDwBk.js">
|
|
251
251
|
<link rel="modulepreload" crossorigin href="./assets/bool-pref-CsGYPtxX.js">
|
|
252
|
-
<link rel="modulepreload" crossorigin href="./assets/SkillInstallMenu-
|
|
252
|
+
<link rel="modulepreload" crossorigin href="./assets/SkillInstallMenu-BW2fj8iT.js">
|
|
253
253
|
<link rel="modulepreload" crossorigin href="./assets/list-plus-M50FahtU.js">
|
|
254
254
|
<link rel="modulepreload" crossorigin href="./assets/agent-launcher-labels-BHzDTCf3.js">
|
|
255
|
-
<link rel="modulepreload" crossorigin href="./assets/use-open-skill-
|
|
255
|
+
<link rel="modulepreload" crossorigin href="./assets/use-open-skill-DV5hhMVO.js">
|
|
256
256
|
<link rel="modulepreload" crossorigin href="./assets/platform-labels-CJqpi0rm.js">
|
|
257
257
|
<link rel="modulepreload" crossorigin href="./assets/clipboard-adapter-C5fPzs7J.js">
|
|
258
|
-
<link rel="modulepreload" crossorigin href="./assets/AddPropertiesButton-
|
|
258
|
+
<link rel="modulepreload" crossorigin href="./assets/AddPropertiesButton-D16oCS_N.js">
|
|
259
259
|
<link rel="modulepreload" crossorigin href="./assets/case-sensitive-B2EOcNRm.js">
|
|
260
260
|
<link rel="modulepreload" crossorigin href="./assets/chevron-left-CwmjVBVO.js">
|
|
261
261
|
<link rel="modulepreload" crossorigin href="./assets/lint-plugin-meta-DmtRmLsN.js">
|
|
262
262
|
<link rel="modulepreload" crossorigin href="./assets/wrench-Bdv4BpnC.js">
|
|
263
263
|
<link rel="modulepreload" crossorigin href="./assets/panel-BkNbYJAl.js">
|
|
264
264
|
<link rel="modulepreload" crossorigin href="./assets/skeleton-8MBf7Lwj.js">
|
|
265
|
-
<link rel="modulepreload" crossorigin href="./assets/typing-burst-detector-
|
|
265
|
+
<link rel="modulepreload" crossorigin href="./assets/typing-burst-detector-SGbZpXed.js">
|
|
266
266
|
<link rel="modulepreload" crossorigin href="./assets/miss-dialog-store-CWiUu3y7.js">
|
|
267
|
-
<link rel="modulepreload" crossorigin href="./assets/pending-receive-nav-store-
|
|
268
|
-
<link rel="modulepreload" crossorigin href="./assets/target-navigation-intent-
|
|
269
|
-
<link rel="modulepreload" crossorigin href="./assets/terminal-launch-events-
|
|
267
|
+
<link rel="modulepreload" crossorigin href="./assets/pending-receive-nav-store-C6LJ2Kzv.js">
|
|
268
|
+
<link rel="modulepreload" crossorigin href="./assets/target-navigation-intent-BwAGdOsi.js">
|
|
269
|
+
<link rel="modulepreload" crossorigin href="./assets/terminal-launch-events-BMFqKHQ8.js">
|
|
270
270
|
<link rel="modulepreload" crossorigin href="./assets/contact-email-store-Dr7t8OOM.js">
|
|
271
|
-
<link rel="modulepreload" crossorigin href="./assets/bug-report-send-manager-
|
|
272
|
-
<link rel="modulepreload" crossorigin href="./assets/auth-state-cache-
|
|
271
|
+
<link rel="modulepreload" crossorigin href="./assets/bug-report-send-manager-Ep6NupAy.js">
|
|
272
|
+
<link rel="modulepreload" crossorigin href="./assets/auth-state-cache-DkvW2mTJ.js">
|
|
273
273
|
<link rel="modulepreload" crossorigin href="./assets/package-BNfLHbeO.js">
|
|
274
274
|
<link rel="modulepreload" crossorigin href="./assets/overlay-layers-Bj-TVfKw.js">
|
|
275
|
-
<link rel="modulepreload" crossorigin href="./assets/preferred-session-events-
|
|
275
|
+
<link rel="modulepreload" crossorigin href="./assets/preferred-session-events-B7RLIJvY.js">
|
|
276
276
|
<link rel="modulepreload" crossorigin href="./assets/panel-right-open-CdgWL6-U.js">
|
|
277
277
|
<link rel="modulepreload" crossorigin href="./assets/rotate-ccw-B_k-Metp.js">
|
|
278
278
|
<link rel="modulepreload" crossorigin href="./assets/square-pen-BTtb6SXV.js">
|
|
@@ -281,25 +281,25 @@
|
|
|
281
281
|
<link rel="modulepreload" crossorigin href="./assets/dist-DKMRgj642.js">
|
|
282
282
|
<link rel="modulepreload" crossorigin href="./assets/dist-BYVRCbTc2.js">
|
|
283
283
|
<link rel="modulepreload" crossorigin href="./assets/text-viewer-languages-1v_XShKJ.js">
|
|
284
|
-
<link rel="modulepreload" crossorigin href="./assets/EditorModeToggle-
|
|
285
|
-
<link rel="modulepreload" crossorigin href="./assets/ImageAttachments-
|
|
284
|
+
<link rel="modulepreload" crossorigin href="./assets/EditorModeToggle-DtMDf2MQ.js">
|
|
285
|
+
<link rel="modulepreload" crossorigin href="./assets/ImageAttachments-DaSjleMs.js">
|
|
286
286
|
<link rel="modulepreload" crossorigin href="./assets/ConfigSharingInfoTooltip-BTe9yAD7.js">
|
|
287
287
|
<link rel="modulepreload" crossorigin href="./assets/RowDisclosure-De6OueU6.js">
|
|
288
|
-
<link rel="modulepreload" crossorigin href="./assets/project-paths-
|
|
289
|
-
<link rel="modulepreload" crossorigin href="./assets/use-installed-clis-
|
|
290
|
-
<link rel="modulepreload" crossorigin href="./assets/ReportBugMenuTrigger-
|
|
288
|
+
<link rel="modulepreload" crossorigin href="./assets/project-paths-Rt7fORWq.js">
|
|
289
|
+
<link rel="modulepreload" crossorigin href="./assets/use-installed-clis-L2RDjEtc.js">
|
|
290
|
+
<link rel="modulepreload" crossorigin href="./assets/ReportBugMenuTrigger-BAbnNfBU.js">
|
|
291
291
|
<link rel="modulepreload" crossorigin href="./assets/SkillModeBanner-DVnoLQe8.js">
|
|
292
292
|
<link rel="modulepreload" crossorigin href="./assets/app-menubar-gate-mWENz_mY.js">
|
|
293
293
|
<link rel="modulepreload" crossorigin href="./assets/agent-diff-store-DMz0pg8b.js">
|
|
294
294
|
<link rel="modulepreload" crossorigin href="./assets/ok-BZZhmXMO.js">
|
|
295
|
-
<link rel="modulepreload" crossorigin href="./assets/use-live-xterm-theme-
|
|
295
|
+
<link rel="modulepreload" crossorigin href="./assets/use-live-xterm-theme-XZgq5LKh.js">
|
|
296
296
|
<link rel="modulepreload" crossorigin href="./assets/alert-BqbcHIOE.js">
|
|
297
297
|
<link rel="modulepreload" crossorigin href="./assets/input-group-BOzKjVFi.js">
|
|
298
|
-
<link rel="modulepreload" crossorigin href="./assets/use-skill-origin-
|
|
299
|
-
<link rel="modulepreload" crossorigin href="./assets/terminal-telemetry-
|
|
298
|
+
<link rel="modulepreload" crossorigin href="./assets/use-skill-origin-ChIkNH5y.js">
|
|
299
|
+
<link rel="modulepreload" crossorigin href="./assets/terminal-telemetry-C0nwSvRH.js">
|
|
300
300
|
<link rel="modulepreload" crossorigin href="./assets/agent-presence-D_1Ywcg7.js">
|
|
301
301
|
<link rel="modulepreload" crossorigin href="./assets/auth-prompt-store-DKA-QhmR.js">
|
|
302
|
-
<link rel="modulepreload" crossorigin href="./assets/receive-store-
|
|
302
|
+
<link rel="modulepreload" crossorigin href="./assets/receive-store-VACJKx3F.js">
|
|
303
303
|
<link rel="modulepreload" crossorigin href="./assets/timeline-diff-store-DSbvMtnu.js">
|
|
304
304
|
<link rel="stylesheet" crossorigin href="./assets/globals-Bx4DAP1K.css">
|
|
305
305
|
<link rel="stylesheet" crossorigin href="./assets/DocumentContext-B0sQn39F.css">
|
|
@@ -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-Bqv6A4OL.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">
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
<link rel="modulepreload" crossorigin href="./assets/lib-DmueaA5E.js">
|
|
45
45
|
<link rel="modulepreload" crossorigin href="./assets/markdownit-CugClK-K.js">
|
|
46
46
|
<link rel="modulepreload" crossorigin href="./assets/w3c-keyname-C7Rznu6R.js">
|
|
47
|
-
<link rel="modulepreload" crossorigin href="./assets/dist-
|
|
47
|
+
<link rel="modulepreload" crossorigin href="./assets/dist-DmvVdMAc.js">
|
|
48
48
|
<link rel="modulepreload" crossorigin href="./assets/dist-Cr4-nBVI.js">
|
|
49
49
|
<link rel="modulepreload" crossorigin href="./assets/jsx-runtime-BUgB2tll.js">
|
|
50
50
|
<link rel="modulepreload" crossorigin href="./assets/dist-Nvb76hAm.js">
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
<link rel="modulepreload" crossorigin href="./assets/textarea-3qB7PlP7.js">
|
|
71
71
|
<link rel="modulepreload" crossorigin href="./assets/dist-CJhtNlOm2.js">
|
|
72
72
|
<link rel="modulepreload" crossorigin href="./assets/messages-B_Wv5APO.js">
|
|
73
|
-
<link rel="modulepreload" crossorigin href="./assets/use-apply-config-language
|
|
73
|
+
<link rel="modulepreload" crossorigin href="./assets/use-apply-config-language--jTlcFWU.js">
|
|
74
74
|
<link rel="stylesheet" crossorigin href="./assets/globals-Bx4DAP1K.css">
|
|
75
75
|
</head>
|
|
76
76
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e,o as t,t as n}from"./rolldown-runtime-tZXQYakl.mjs";import{Af as r,Df as i,Yl as a,cf as o,df as s,fd as c,kf as l,pf as u,sd as d,td as f,uf as p,wf as m,xd as h}from"./md-manager-BGnqyqi1-
|
|
1
|
+
import{i as e,o as t,t as n}from"./rolldown-runtime-tZXQYakl.mjs";import{Af as r,Df as i,Yl as a,cf as o,df as s,fd as c,kf as l,pf as u,sd as d,td as f,uf as p,wf as m,xd as h}from"./md-manager-BGnqyqi1-CnT_8Ivp.mjs";import{Co as g,Jn as _,Jo as v,Pn as y,Ro as ee,Yo as b,da as te,es as x,lr as ne,m as S,ts as re}from"./dist-BKMK4uhh.mjs";import{$ as ie,A as C,J as ae,M as w,O as T,P as oe,R as se,T as ce,X as E,at as le,ct as ue,d as de,dt as fe,f as pe,it as me,j as he,k as ge,lt as _e,nt as ve,o as ye,rt as be,tt as xe,v as Se,w as Ce,x as we,y as Te}from"./init-Bvmrrn6M.mjs";import{t as Ee}from"./is-object-BGze3w87.mjs";import{t as De}from"./removal-file-path-BeRPeEws.mjs";import{spawn as Oe}from"node:child_process";import{basename as D,dirname as O,join as k,resolve as A,win32 as ke}from"node:path";import{accessSync as Ae,constants as j,existsSync as M,lstatSync as N,mkdirSync as je,readFileSync as P,readdirSync as F,realpathSync as I,rmSync as Me,rmdirSync as Ne,statSync as L,unlinkSync as Pe}from"node:fs";import{homedir as R}from"node:os";import{createHash as Fe}from"node:crypto";import{isDeepStrictEqual as Ie}from"node:util";import{setTimeout as Le}from"node:timers/promises";var Re=f();let ze;function Be(){return ze}function Ve(e,t){if(t!==void 0&&t.length>0)return t;try{return ne(e)?.rootPath}catch{return}}function He(e){let t=Ve(e.cwd,e.configuredProjectName),n=y({name:`cli`,project:t});return ze=n,n.info({command:e.command,cwd:e.cwd,project:t},`cli command started`),n}function z(){return c(d)}function B(){return i().keyringService}function V(e){try{e()}catch{}}var Ue=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(B(),e).getPassword()}catch(t){return V(()=>this.onKeychainRead?.({kind:`read-error`,host:e,error:t instanceof Error?t.name:`unknown`})),null}if(n==null)return V(()=>this.onKeychainRead?.({kind:`absent`,host:e})),null;try{return JSON.parse(n)}catch{return V(()=>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(B(),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(B(),e).deletePassword()}catch{}}},H=class{backend=`file`;authFile;constructor(e){this.authFile=e??k(b(),`auth.yml`)}read(){if(!M(this.authFile))return{};try{let e=P(this.authFile,`utf-8`);return(0,Re.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=O(this.authFile);M(t)||je(t,{recursive:!0,mode:448}),v(this.authFile,(0,Re.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)}},We=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 ${z()} 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 Ge(e,t){try{let{Entry:n}=await import(`@napi-rs/keyring`);return new n(B(),`__probe__`),process.stderr.write(`[auth] token storage: OS keychain
|
|
2
2
|
`),V(()=>t?.onBackendSelected?.({backend:`keyring`})),new We(new Ue(t?.onKeychainRead),new H(e))}catch(n){let r=n instanceof Error?`${n.name}: ${n.message}`:String(n);return process.stderr.write(`[auth] token storage: file (${z()}) — OS keychain unavailable: ${r}\n`),V(()=>t?.onBackendSelected?.({backend:`file`,reason:r})),new H(e)}}function Ke(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 (${z()})\n`),r(new H(e))},n)});try{return await Promise.race([Ge(e),r])}catch{return new H(e)}finally{t!==null&&clearTimeout(t)}})(),t}}function qe(e){let t=Ke(e);return{async get(e){let n=await(await t()).get(e);return n===null?null:{token:n.token,login:n.login}}}}function Je(e){let t=Ke(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 Ye(e,t){let n=[],r=new H(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(B(),`__probe__`);let r,a=await new Ue(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(B(),e).deletePassword(),n.push(`keychain`)}catch(e){i=e instanceof Error?e.name:`delete-error`}}catch{}return{touched:n,keychainError:i}}function Xe(e){let t={...e};return delete t.ELECTRON_RUN_AS_NODE,t}function Ze(e){let t=e?.code;return t===`ENOENT`||t===`EACCES`||t===`EPERM`?{ok:!1,reason:`not-installed`}:{ok:!1,reason:`spawn-error`}}function Qe(e){return g({detached:!0,stdio:`ignore`,shell:!1,env:Xe(e)})}function $e(e,t,n={}){let r=(n.spawn??Oe)(e,[...t],Qe(n.env??process.env));return r.unref(),r}function et(e,t,n={}){let r=n.spawn??Oe,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],Qe(n.env??process.env));i.once(`error`,e=>{clearTimeout(c),s(Ze(e))}),i.once(`spawn`,()=>{clearTimeout(c),s({ok:!0})});try{i.unref()}catch{}}catch(e){clearTimeout(c),s(Ze(e))}})}const tt=m.stable.appId,U=[m.stable,m.beta];function nt(){return{platform:process.platform,env:process.env,execPath:process.execPath,isTTY:process.stdout.isTTY,statSync:e=>{try{return L(e,{throwIfNoEntry:!1})??null}catch{return null}}}}function rt(e){if(e.env.ELECTRON_RUN_AS_NODE===`1`){let t=/(.+?\.app)\/Contents\/MacOS\//.exec(e.execPath);if(t?.[1])return t[1]}let t=e.homeDir??R();for(let n of U)for(let r of[k(t,`Applications`),`/Applications`]){let t=k(r,`${n.productName}.app`);if(it(e,k(t,`Contents`,`MacOS`,n.productName)))return t}return null}function it(e,t){try{let n=e.statSync(t);return n?typeof n.isFile==`function`&&n.isFile():!1}catch{return!1}}function at(e){if(e.env.ELECTRON_RUN_AS_NODE===`1`&&U.find(t=>e.execPath.toLowerCase().endsWith(`\\${l(t).toLowerCase()}`)))return e.execPath;let t=e.env.LOCALAPPDATA;if(t)for(let n of U)for(let i of r(n)){let r=ke.join(t,`Programs`,i,l(n));if(it(e,r))return r}return null}function ot(e){if(e.env.ELECTRON_RUN_AS_NODE===`1`&&U.find(t=>e.execPath.endsWith(`/${t.linuxExecutableName}`)))return e.execPath;for(let t of U){let n=`/opt/${t.productName}/${t.linuxExecutableName}`;if(it(e,n))return n}return null}function st(e){if(e.env.OK_FORCE_BROWSER===`1`)return{available:!1,reason:`force-browser`};if(e.platform!==`darwin`&&e.platform!==`win32`&&e.platform!==`linux`)return{available:!1,reason:`unsupported-platform`};let t;try{t=e.platform===`darwin`?rt(e):e.platform===`win32`?at(e):ot(e)}catch{return{available:!1,reason:`stat-error`}}return t?e.env.OK_FORCE_DESKTOP===`1`?{available:!0,reason:`available`,bundlePath:t}:!(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`,bundlePath:t}:{available:!0,reason:`available`,bundlePath:t}:{available:!1,reason:`no-bundle`}}function ct(e,t){let n=e.log??(e=>console.error(e)),r=e.platform??process.platform;n("Launching OpenKnowledge desktop (use `ok start` for the browser server, or `OK_FORCE_BROWSER=1` to always skip)");let i=t?.bundlePath;if(!i){n(`Desktop launch skipped: no resolved desktop executable (caller bug).`);return}if(r===`darwin`){$e(`open`,[`-a`,i],{spawn:e.spawn});return}$e(i,[],{spawn:e.spawn})}function lt(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 W(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 ut(e){return Fe(`sha256`).update(e).digest(`hex`)}function G(e){return k(b(A(e)),`pi-trust`)}function dt(e,t){return k(G(e),ut(A(t)))}function ft(e,t,n){return k(dt(e,t),`${ut(n)}.json`)}var K=class extends Error{constructor(e,t,n,r){super(`Pi trust receipt at ${W(e)} ${W(t)}; ${W(n)}`,{cause:r}),this.name=`PiTrustReceiptError`}};function q(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 K(e,`could not ${t}: ${i}`,a,n)}function J(e){let t;try{t=N(e)}catch(t){if(t.code===`ENOENT`)return!1;throw q(e,`be inspected`,t)}if(!t.isDirectory())throw new K(e,`is not a regular directory`,`restore the intended receipt directory without a symlink, then retry`);return!0}function pt(e,t){return Object.keys(e).length===t.length&&t.every(t=>Object.hasOwn(e,t))}function mt(e,t){if(!Ee(e)||!pt(e,[`version`,`cwd`,`configuredTrustPath`,`canonicalTrustPath`,`state`,`previous`])||e.version!==1||typeof e.cwd!=`string`||e.cwd!==A(e.cwd)||typeof e.configuredTrustPath!=`string`||e.configuredTrustPath!==A(e.configuredTrustPath)||typeof e.canonicalTrustPath!=`string`||e.canonicalTrustPath!==A(e.canonicalTrustPath)||e.state!==`pending`&&e.state!==`committed`||!Ee(e.previous))throw new K(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&&pt(e.previous,[`present`]))n={present:!1};else if(e.previous.present===!0&&pt(e.previous,[`present`,`value`]))n={present:!0,value:e.previous.value};else throw new K(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 ht(e,t,n){let r;try{r=N(n)}catch(e){throw q(n,`be inspected`,e)}if(!r.isFile())throw new K(n,`is not a regular file`,`restore the intended receipt as a regular file without a symlink, then retry`);let i;try{i=P(n,`utf8`)}catch(e){throw q(n,`be read`,e)}let a;try{a=JSON.parse(i)}catch(e){throw new K(n,`is not valid JSON`,`repair its JSON syntax without changing the recorded decision, then retry`,e)}let o=mt(a,n);if(o.cwd!==A(t)||n!==ft(e,t,o.canonicalTrustPath))throw new K(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 gt(e,t){let{record:n,path:r}=t;for(let t of[G(e),dt(e,n.cwd)])if(!J(t))throw new K(t,`no longer exists`,`restore access to the expected receipt directory, then retry`);let i=ht(e,n.cwd,r);if(!Ie(i.record,n))throw new K(r,`changed while its trust decision was being updated`,`retry to read its current ownership record`);return i}function _t(e,t,n,r,i){let a={version:1,cwd:A(t),configuredTrustPath:A(n),canonicalTrustPath:A(r),state:`pending`,previous:i},o=ft(e,a.cwd,a.canonicalTrustPath),s=`${JSON.stringify(a,null,2)}\n`;if(!Ie(mt(JSON.parse(s),o),a))throw new K(o,`cannot preserve the previous decision as JSON`,`provide the original decision as a JSON value before retrying`);J(G(e)),J(O(o));try{je(O(o),{recursive:!0,mode:448})}catch(e){throw q(O(o),`be created`,e)}let c;try{c=N(o,{throwIfNoEntry:!1})}catch(e){throw q(o,`be inspected`,e)}if(c)throw new K(o,`already exists`,`reconcile the existing ownership record before recording another grant`);try{v(o,s,{mode:384})}catch(e){throw q(o,`be written`,e)}return{path:o,record:a}}function vt(e,t){let n=gt(e,t);if(n.record.state!==`pending`)throw new K(n.path,`is already committed`,`use the current ownership record without committing it again`);let r={...n.record,state:`committed`};try{v(n.path,`${JSON.stringify(r,null,2)}\n`,{mode:384})}catch(e){throw q(n.path,`be committed`,e)}return{path:n.path,record:r}}function Y(e,t){if(!J(G(e)))return[];let n=dt(e,t);if(!J(n))return[];let r;try{r=F(n).sort()}catch(e){throw q(n,`be listed`,e)}return r.filter(e=>/^[a-f0-9]{64}\.json$/.test(e)).map(r=>ht(e,t,k(n,r)))}function X(e,t){let n=gt(e,t);try{Pe(n.path)}catch(e){throw q(n.path,`be removed after reconciling its grant`,e)}for(let t of[O(n.path),G(e)])try{Ne(t)}catch(e){let n=e.code;if(n!==`ENOTEMPTY`&&n!==`EEXIST`&&n!==`ENOENT`)throw q(t,`be removed after reconciling its grant`,e)}}var yt=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`)}}})),bt=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())}}})),xt=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}})),St=n(((t,n)=>{var r=e(`fs`),i=yt(),a=bt(),o=xt(),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
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=S,e.createWriteStream=re;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;C(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;C(e.path,e.flags,e.mode,function(t,n){t?(e.destroy(),e.emit(`error`,t)):(e.fd=n,e.emit(`open`,n))})}function S(t,n){return new e.ReadStream(t,n)}function re(t,n){return new e.WriteStream(t,n)}var ie=e.open;e.open=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 ie(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))}}})),Ct=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}})),wt=n((e=>{var t=Ct();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}}})),Tt=n(((e,t)=>{t.exports=wt()})),Et=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`)})),Dt=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=Et(),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)}}})),Ot=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})),kt=n(((t,n)=>{let r=e(`path`),i=St(),a=Tt(),o=Dt(),s=Ot(),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})),At=n(((e,t)=>{let n=St();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}})),jt=t(n(((e,t)=>{let n=kt(),{toPromise:r,toSync:i,toSyncOptions:a}=At();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 Mt=5e3;function Nt(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 ${Mt}ms`,{cause:e}),{code:`ELOCKED`});return Math.min(25,r)}function Pt(e,t){Be()?.warn(t,e)}function Ft(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 It(e,t,n){await x(`${t}.ok.lock`,async()=>{let t=performance.now()+Mt,r;for(;;)try{r=await jt.default.lock(O(e),{realpath:!1,lockfilePath:`${e}.lock`});break}catch(n){await Le(Nt(n,t,e))}let i=[];try{n()}catch(e){i.push(e)}finally{try{await r()}catch(e){i.push(e)}}Ft(i,e)},{onWarn:Pt})}function Lt(e,t,n){re(`${t}.ok.lock`,()=>{let t=performance.now()+Mt,r=new Int32Array(new SharedArrayBuffer(4)),i;for(;;)try{i=jt.default.lockSync(O(e),{realpath:!1,lockfilePath:`${e}.lock`});break}catch(n){Atomics.wait(r,0,0,Nt(n,t,e))}let a=[];try{n()}catch(e){a.push(e)}finally{try{i()}catch(e){a.push(e)}}Ft(a,e)},{onWarn:Pt})}const Rt=[`settings.json`,`prompts`,`themes`,`SYSTEM.md`,`APPEND_SYSTEM.md`];var zt=class extends Error{name=`PiResourceInspectionError`};function Z(e){let t;try{t=N(e)}catch(e){if(e.code===`ENOENT`)return!1;throw e}let n;try{n=L(e)}catch(e){throw t.isSymbolicLink()&&e.code===`ENOENT`?new zt(he(`missing-symlink-target`),{cause:e}):e}return Ae(e,j.R_OK|(n.isDirectory()?j.X_OK:0)),!0}function Bt(e){return e===`open-knowledge`||e.startsWith(`open-knowledge-`)}function Vt(e,t,n){let r=e;try{let i=I(e),a;r=t;try{a=I(t)}catch(e){if(e.code!==`ENOENT`)throw e;a=A(t)}let o=k(a,`.agents`,`skills`),s=[];for(let e of Rt)r=k(i,`.pi`,e),Z(r)&&s.push(r);if(r=k(i,`.pi`,`extensions`),Z(r))for(let t of F(r).sort()){let i=k(r,t);A(n)!==k(A(e),`.pi`,`extensions`,t)&&s.push(i)}for(let e of[k(i,`.pi`,`skills`),k(i,`.agents`,`skills`)])if(e!==o&&(r=e,Z(e)))for(let t of F(e).sort())Bt(t)||s.push(k(e,t));let c=O(i);for(;c!==i;){r=k(c,`.agents`,`skills`),r!==o&&Z(r)&&s.push(r);let e=O(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 ${W(r)}: ${e instanceof zt?e.message:he(w(e))}`}}}function Ht(e,t,n){let r=A(e),i=ue({home:t,env:n??(t===void 0?process.env:{})});return{cwd:r,bridgePath:E.pi.projectConfigPath(r),trustPath:k(i,`trust.json`)}}function Ut(e){try{let t=I(e);return L(t).isDirectory()?(Ae(t,j.X_OK),{kind:`ready`,project:{path:e,canonical:t}}):{kind:`refused`,error:`Pi project path ${W(e)} is not a directory; restore the intended project directory, then retry`}}catch(t){return{kind:`refused`,error:`Pi project directory ${W(e)} could not be resolved or accessed: ${W(t instanceof Error?t.message:String(t))}; restore the directory or symlink and check its permissions, then retry`}}}function Wt(e){let t=Ut(e.path);if(t.kind===`refused`)return t.error;if(t.project.canonical!==e.canonical)return`Pi project path ${W(e.path)} changed while waiting for its trust lock; restore the intended project location, then retry`}function Gt(e,t,n){let r=ye(E.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 be(i)?{state:`own-current`,text:a}:ce(i)?{state:`own-stale`,text:a}:{state:`foreign`,text:a}}function Kt(e,t){let n;try{n=P(e.path,`utf-8`)}catch(t){let n=t.code;return e.kind===`missing`&&n===`ENOENT`?{state:`untrusted`,entries:{},trailingNewline:!1}:{state:`unreadable`,reason:w(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 Ee(r)?{state:r[t]===!0?`trusted`:`untrusted`,entries:r,trailingNewline:n.endsWith(`
|
|
4
4
|
`)}:{state:`unreadable`,reason:`invalid-json`}}function qt(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 he(e)}}function Q(e,t){return{kind:`refused`,error:`trust store ${W(e)}: ${qt(t)}`}}function Jt(e){let t=De(e);try{switch(t.kind){case`declined`:return Q(e,t.reason);case`ready`:return{kind:`ready`,path:I(t.path)};case`not-present`:break;default:throw Error(`unhandled trust file resolution: ${t}`)}let n=O(e),r=[D(e)],i=N(n,{throwIfNoEntry:!1});for(;!i;){let t=O(n);if(t===n)return Q(e,`unavailable-root`);r.unshift(D(n)),n=t,i=N(n,{throwIfNoEntry:!1})}try{return{kind:`missing`,path:k(I(n),...r)}}catch(t){return Q(e,i.isSymbolicLink()&&t.code===`ENOENT`?`missing-symlink-target`:w(t))}}catch(t){return Q(e,w(t))}}function Yt(e,t){let n=Jt(e);return n.kind===`refused`?n:n.path!==t.path||t.kind===`ready`&&n.kind===`missing`?Q(e,`path-changed`):n}function Xt(e,t,n){let r=Ht(e,t,n),i=Ut(r.cwd);if(i.kind===`refused`)return{...r,project:`unavailable`,error:i.error};let a=Gt(r.cwd,r.bridgePath,t).state,o=Jt(r.trustPath),s=o.kind===`refused`?`unreadable`:o.kind===`missing`?`untrusted`:Kt(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:Zt(r.bridgePath).displayNames}}function Zt(e){let t=O(e),n=D(e);try{return{displayNames:F(t).filter(e=>e!==n&&e.endsWith(`.ts`)).sort().map(e=>W(JSON.stringify(e)))}}catch{return{displayNames:[]}}}async function Qt(e,t={mode:`published`},n,r,i){let a=Ht(e,n,r),o=Ut(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 ${W(i)} no longer matches the current directory ${W(o.project.canonical)}. Reopen the intended project and approve the Pi integration again; no bridge or trust settings were changed.`};let s=Gt(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=Ce(t)}catch{e=void 0}c=e!==void 0&&s.text===e?`unchanged`:`refreshed`}if(c!==`unchanged`){let e=Te(E.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}`:W(e.error)}}let l=await $t(a.trustPath,o.project,n??R());return{...a,ok:l.action===`already-trusted`||l.action===`added`,bridge:c,trust:l.action,...l.error===void 0?{}:{error:l.error}}}async function $t(e,t,n){let r=t.canonical,i=Jt(e);if(i.kind===`refused`)return{action:`refused-unreadable`,error:i.error};try{je(O(i.path),{recursive:!0})}catch(e){return{action:`failed`,error:W(e instanceof Error?e.message:String(e))}}let a={action:`added`};try{await It(e,i.path,()=>{let o=Wt(t);if(o){a.action=`refused-unreadable`,a.error=o;return}let s=Yt(e,i);if(s.kind===`refused`){a.action=`refused-unreadable`,a.error=s.error;return}let c=Kt(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=Y(n,r).find(e=>e.record.canonicalTrustPath===s.path);return t&&X(n,t),_t(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?`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{M as e,S as t}from"./init-
|
|
1
|
+
import{M as e,S as t}from"./init-Bvmrrn6M.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-DGgpI_Jz.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{La as e}from"./md-manager-BGnqyqi1-
|
|
1
|
+
import{La as e}from"./md-manager-BGnqyqi1-CnT_8Ivp.mjs";import{J as t,X as n,et as r,f as i,rt as a,y as o}from"./init-Bvmrrn6M.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./md-manager-BGnqyqi1-CnT_8Ivp.mjs";import"./init-Bvmrrn6M.mjs";import"./registry-probes-BqQhP0ax.mjs";import"./src-DwoFHSWS.mjs";import"./start-jgWvvxuy.mjs";import{n as e}from"./loader-DyhgFxyu.mjs";import"./preview-CS-ZP7yP.mjs";import"./repair-mcp-configs-DiEzfN1-.mjs";export{e as loadConfig};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-tZXQYakl.mjs";import{Ac as t,Df as n,Ds as r,Es as i,Fn as a,Ks as o,Ls as s,Oc as c,Pn as l,Ts as ee,Un as te,al as ne,jf as u,jo as d,nl as f,rl as p,td as m,yf as h}from"./md-manager-BGnqyqi1-D77IwxHB.mjs";import{$o as g,Co as _,Dt as v,Mi as y,Ni as b,Qo as x,Sr as S,Yn as C,Yo as w,Zo as T,_i as E,ar as D,gi as re,hi as ie,li as O,lr as k,m as A,ri as j,ya as M}from"./dist-DdoZ294B.mjs";import{t as N}from"./yazl-BBz29IQN.mjs";import{Ct as P,ot as F,st as ae}from"./init-vgeY_wHD.mjs";import{l as oe,x as se}from"./registry-probes-BXgdIidc.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-W9G4vRvJ.mjs";import"./loader-DYbtvtxH.mjs";import"./preview-1EGVW00C.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,rmSync as G,rmdirSync as Ce,statSync as we,writeFileSync as K}from"node:fs";import{arch as Te,freemem as Ee,homedir as q,hostname as De,platform as Oe,release as ke,tmpdir as Ae,totalmem as je,type as Me,uptime as Ne}from"node:os";import"node:fs/promises";import{createHash as Pe}from"node:crypto";const Fe=new Set([`start`,`stop`,`status`,`clean`,`ui`,`mcp`,`preview`,`lint`,`audit`,`deinit`,`auth`]);function Ie(e,t,n=k){if(e!==void 0&&!Fe.has(e))return null;let r=n(t);return r===null||r.distance===0?null:r.rootPath}let Le=null;function Re(e){Le=e}function ze(){return Le??process.cwd()}const Be=`Open Knowledge`;function Ve(e={}){let t=e.platformName??process.platform,r=e.productName??n().productName;return F(t).join(ae({...e,platformName:t}),r)}function He(e={}){let t=e.platformName??process.platform,r=e.home??q(),i=e.env??process.env,a=F(t),o;return o=t===`win32`?i.LOCALAPPDATA||a.join(r,`AppData`,`Local`):t===`darwin`?a.join(r,`Library`,`Caches`):i.XDG_CACHE_HOME||a.join(r,`.cache`),a.join(o,`${n().packageName.replaceAll(`/`,``)}-updater`)}function Ue(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 We(e){let t=R(e,`state.json`);if(!V(t))return[];let n;try{n=JSON.parse(U(t,`utf-8`))}catch{return[]}return Ue(n)??[]}function Ge(e){let t=R(e,`state.json`);if(!V(t))return!1;try{return Ue(JSON.parse(U(t,`utf-8`)))!==null}catch{return!1}}const Ke=8192;function qe(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 Je(e){return e.replace(/\\+\/?/g,e=>{if(!e.endsWith(`/`))return e;let t=e.length-1;return`${`\\`.repeat(t-t%2)}/`})}const Ye=RegExp(`("(?:${[`crashReporterKey`,`bootSessionUUID`,`deviceIdentifierForVendor`].join(`|`)})"\\s*:\\s*)"[^"]*"`,`g`);function Xe(e){return e.replace(Ye,`$1"[REDACTED-DEVICE-ID]"`)}function Ze(e){return Xe(Je(e))}const Qe=/^(\d{4}-\d{2}-\d{2}) (\d{2}:\d{2}:\d{2})(\.\d+)? ([+-]\d{2})(\d{2})$/;function $e(e){if(typeof e!=`string`)return null;let t=Qe.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 et(e){let t=be(e,`r`);try{let e=Buffer.alloc(Ke),n=0,r=!1;for(;n<Ke;){let i=xe(t,e,n,Ke-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 tt(e){try{let t=et(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:$e(a)}}catch{return{kind:`unreadable`}}}function nt(e){return e===`OpenKnowledge`||e.startsWith(`OpenKnowledge `)}function rt(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=we(n).mtimeMs}catch{continue}if(r<i)continue;let c=tt(n),l=c.kind===`named`&&c.timestampMs!==null?c.timestampMs:r;if(c.kind===`unreadable`){s+=1;continue}if(!nt(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(w(),`bug-reports`)}function it(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 at(e,t){let{scrubbed:n}=e;return n!==void 0&&n.patterns.length>0?{file:t,lineCount:n.lineCount,patterns:[...n.patterns]}:null}function ot(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`))?Pe(`sha256`).update(z(e)).digest(`hex`).slice(0,12):null}function st(){let e={timestamp:new Date().toISOString(),platform:Oe(),osType:Me(),osRelease:ke(),hostname:`[redacted]`,uptime:Ne(),freeMem:Ee(),totalMem:je(),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`,_({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 ct=[{prefix:`cli`,projectTagged:!0},{prefix:`desktop`,projectTagged:!1},{prefix:`mcp`,projectTagged:!1}];function lt(e){let t=I(e);return ct.some(e=>e.projectTagged&&t.startsWith(`${e.prefix}.`))}function ut(e,t){return mt(e,t).files}const dt=[`ShipIt_stderr.log`,`ShipIt_stdout.log`];function ft(e,t=oe){let n=R(e,`${t}.ShipIt`);if(!V(n))return[];let r;try{r=W(n)}catch{return[]}return dt.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 pt(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,-l.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 mt(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(lt),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=>!lt(e)||o.has(e)),excludedByProjectSlug:r.length-o.size}}function ht(e){let t=R(e,`.ok`,`local`);return V(t)?{files:[`server.lock`,`last-spawn-error.log`,f,c].map(e=>R(t,e)).filter(e=>V(e))}:{files:[]}}function gt(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 _t(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#${Pe(`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 vt(e){let t=e.revealDocNames?e.content:_t(e.content).text;if(e.redact){let{redacted:n,patterns:r,lineCount:i}=s(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`);vt({zipfile:e.zipfile,name:`${e.prefix}/${I(t)}`,content:t.endsWith(`.ips`)?Ze(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 yt(t){let{redact:n,outputPath:r,logger:i}=t,o=t.revealDocNames??!1,s=t.userLogsDir??R(w(),`logs`),c=t.projectDir?ot(t.projectDir,i):null;H(L(r),{recursive:!0}),i?.info({projectSlug:c},`gathering diagnostic data`);let l=st();l.desktop=t.desktop??null,l.language=t.language??null;let{files:ee,excludedByProjectSlug:ne}=mt(c,s),{files:u}=t.projectDir?ht(t.projectDir):{files:[]},{files:d}=t.projectDir?gt(t.projectDir):{files:[]},f=t.shipItLogFiles??[],p=t.diagnosticReports?.files??[];i?.info({logFileCount:ee.length,logFilesExcludedByProjectSlug:ne,lockFileCount:u.length,localSinkFileCount:d.length,shipItLogFileCount:f.length,diagnosticReportCount:p.length},`files collected`);let m=[],h=[],{ZipFile:g}=await import(`./yazl-BsCX6KWo.mjs`).then(t=>e(t.default,1)),_=new g;Y({zipfile:_,files:[...ee,...f],prefix:`logs`,redact:n,revealDocNames:o,bundleFiles:h,redactions:m,logger:i}),Y({zipfile:_,files:u,prefix:`lockdir`,redact:n,revealDocNames:o,bundleFiles:h,redactions:m,logger:i}),Y({zipfile:_,files:d,prefix:`local-logs`,redact:n,revealDocNames:o,bundleFiles:h,redactions:m,logger:i}),Y({zipfile:_,files:t.bugReportLedgerFiles??[],prefix:a,redact:n,revealDocNames:o,bundleFiles:h,redactions:m,logger:i}),Y({zipfile:_,files:p,prefix:`diagnostic-reports`,redact:n,revealDocNames:o,bundleFiles:h,redactions:m,logger:i});for(let e of t.extraFiles??[])try{let t=U(e.sourcePath),n=`extra/${e.zipName??I(e.sourcePath)}`;_.addBuffer(t,n),h.push(n);let r=at(e,n);r!==null&&m.push(r)}catch(t){i?.warn({sourcePath:e.sourcePath,err:t},`extra file unreadable; omitted from bundle`)}t.note&&vt({zipfile:_,name:`note.txt`,content:t.note,redact:n,revealDocNames:o,bundleFiles:h,redactions:m});let v=new Set(p.map(e=>`diagnostic-reports/${I(e)}`)),y=h.filter(e=>v.has(e)),b=t.diagnosticReports===void 0?`not-collected (no collection attempted)`:qe(t.diagnosticReports,y.length);_.addBuffer(Buffer.from(`${b}\n`,`utf8`),`state/diagnostic-reports-status.txt`),h.push(`state/diagnostic-reports-status.txt`);let x=JSON.stringify(l,null,2);_.addBuffer(Buffer.from(x,`utf8`),`sysinfo.json`),h.push(`sysinfo.json`);let S={generatedAt:new Date().toISOString(),disciplineVersion:`1.0.0`,projectSlug:c,files:h,redactions:m,sysinfo:l};_.addBuffer(Buffer.from(JSON.stringify(S,null,2),`utf8`),`MANIFEST.json`);let C=m.reduce((e,t)=>e+t.lineCount,0),T=new Set(f.map(e=>`logs/${I(e)}`)),E=h.filter(e=>T.has(e)),D=new Set((t.bugReportLedgerFiles??[]).map(e=>`${a}/${I(e)}`)),re=h.filter(e=>D.has(e)),ie=c?h.filter(e=>e.startsWith(`logs/`)&&!lt(e)&&!T.has(e)):[],O=y.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.`]:[],k=O.length>0?[`Redaction was disabled for this bundle; file contents are unmodified,`,`with one exception.`,...O]:[`Redaction was disabled for this bundle; file contents are unmodified.`],A=[`# Bug Report Bundle`,``,`Generated: ${S.generatedAt}`,`Project: ${c??`(unscoped)`}`,`Discipline version: ${S.disciplineVersion}`,``,`## Contents`,``,...h.map(e=>`- ${e}`),``,`## Privacy`,``,...ie.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:`,...ie.map(e=>`- ${e}`),``]:[],...E.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:`,...E.map(e=>`- ${e}`),``]:[],...y.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:`,...y.map(e=>`- ${e}`),``]:[],...re.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:`,...re.map(e=>`- ${e}`),``]:[],...n?[`This bundle was auto-redacted before packaging.`,`Patterns checked: ${te.join(`, `)}`,C>0?`${C} line(s) were scrubbed across ${m.length} file(s).`:`No redactions were needed.`,`See MANIFEST.json for the full redaction audit report.`,...O,``,`This bundle is safe to attach to a GitHub issue.`]:k].join(`
|
|
1
|
+
import{o as e}from"./rolldown-runtime-tZXQYakl.mjs";import{Ac as t,Df as n,Ds as r,Es as i,Fn as a,Ks as o,Ls as s,Oc as c,Pn as l,Ts as ee,Un as te,al as ne,jf as u,jo as d,nl as f,rl as p,td as m,yf as h}from"./md-manager-BGnqyqi1-CnT_8Ivp.mjs";import{$o as g,Co as _,Dt as v,Mi as y,Ni as b,Qo as x,Sr as S,Yn as C,Yo as w,Zo as T,_i as E,ar as D,gi as re,hi as ie,li as O,lr as k,m as A,ri as j,ya as M}from"./dist-BKMK4uhh.mjs";import{t as N}from"./yazl-BBz29IQN.mjs";import{Ct as P,ot as F,st as ae}from"./init-Bvmrrn6M.mjs";import{l as oe,x as se}from"./registry-probes-BqQhP0ax.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-ChfpQjIj.mjs";import"./loader-DyhgFxyu.mjs";import"./preview-CS-ZP7yP.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,rmSync as G,rmdirSync as Ce,statSync as we,writeFileSync as K}from"node:fs";import{arch as Te,freemem as Ee,homedir as q,hostname as De,platform as Oe,release as ke,tmpdir as Ae,totalmem as je,type as Me,uptime as Ne}from"node:os";import"node:fs/promises";import{createHash as Pe}from"node:crypto";const Fe=new Set([`start`,`stop`,`status`,`clean`,`ui`,`mcp`,`preview`,`lint`,`audit`,`deinit`,`auth`]);function Ie(e,t,n=k){if(e!==void 0&&!Fe.has(e))return null;let r=n(t);return r===null||r.distance===0?null:r.rootPath}let Le=null;function Re(e){Le=e}function ze(){return Le??process.cwd()}const Be=`Open Knowledge`;function Ve(e={}){let t=e.platformName??process.platform,r=e.productName??n().productName;return F(t).join(ae({...e,platformName:t}),r)}function He(e={}){let t=e.platformName??process.platform,r=e.home??q(),i=e.env??process.env,a=F(t),o;return o=t===`win32`?i.LOCALAPPDATA||a.join(r,`AppData`,`Local`):t===`darwin`?a.join(r,`Library`,`Caches`):i.XDG_CACHE_HOME||a.join(r,`.cache`),a.join(o,`${n().packageName.replaceAll(`/`,``)}-updater`)}function Ue(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 We(e){let t=R(e,`state.json`);if(!V(t))return[];let n;try{n=JSON.parse(U(t,`utf-8`))}catch{return[]}return Ue(n)??[]}function Ge(e){let t=R(e,`state.json`);if(!V(t))return!1;try{return Ue(JSON.parse(U(t,`utf-8`)))!==null}catch{return!1}}const Ke=8192;function qe(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 Je(e){return e.replace(/\\+\/?/g,e=>{if(!e.endsWith(`/`))return e;let t=e.length-1;return`${`\\`.repeat(t-t%2)}/`})}const Ye=RegExp(`("(?:${[`crashReporterKey`,`bootSessionUUID`,`deviceIdentifierForVendor`].join(`|`)})"\\s*:\\s*)"[^"]*"`,`g`);function Xe(e){return e.replace(Ye,`$1"[REDACTED-DEVICE-ID]"`)}function Ze(e){return Xe(Je(e))}const Qe=/^(\d{4}-\d{2}-\d{2}) (\d{2}:\d{2}:\d{2})(\.\d+)? ([+-]\d{2})(\d{2})$/;function $e(e){if(typeof e!=`string`)return null;let t=Qe.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 et(e){let t=be(e,`r`);try{let e=Buffer.alloc(Ke),n=0,r=!1;for(;n<Ke;){let i=xe(t,e,n,Ke-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 tt(e){try{let t=et(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:$e(a)}}catch{return{kind:`unreadable`}}}function nt(e){return e===`OpenKnowledge`||e.startsWith(`OpenKnowledge `)}function rt(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=we(n).mtimeMs}catch{continue}if(r<i)continue;let c=tt(n),l=c.kind===`named`&&c.timestampMs!==null?c.timestampMs:r;if(c.kind===`unreadable`){s+=1;continue}if(!nt(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(w(),`bug-reports`)}function it(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 at(e,t){let{scrubbed:n}=e;return n!==void 0&&n.patterns.length>0?{file:t,lineCount:n.lineCount,patterns:[...n.patterns]}:null}function ot(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`))?Pe(`sha256`).update(z(e)).digest(`hex`).slice(0,12):null}function st(){let e={timestamp:new Date().toISOString(),platform:Oe(),osType:Me(),osRelease:ke(),hostname:`[redacted]`,uptime:Ne(),freeMem:Ee(),totalMem:je(),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`,_({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 ct=[{prefix:`cli`,projectTagged:!0},{prefix:`desktop`,projectTagged:!1},{prefix:`mcp`,projectTagged:!1}];function lt(e){let t=I(e);return ct.some(e=>e.projectTagged&&t.startsWith(`${e.prefix}.`))}function ut(e,t){return mt(e,t).files}const dt=[`ShipIt_stderr.log`,`ShipIt_stdout.log`];function ft(e,t=oe){let n=R(e,`${t}.ShipIt`);if(!V(n))return[];let r;try{r=W(n)}catch{return[]}return dt.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 pt(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,-l.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 mt(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(lt),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=>!lt(e)||o.has(e)),excludedByProjectSlug:r.length-o.size}}function ht(e){let t=R(e,`.ok`,`local`);return V(t)?{files:[`server.lock`,`last-spawn-error.log`,f,c].map(e=>R(t,e)).filter(e=>V(e))}:{files:[]}}function gt(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 _t(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#${Pe(`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 vt(e){let t=e.revealDocNames?e.content:_t(e.content).text;if(e.redact){let{redacted:n,patterns:r,lineCount:i}=s(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`);vt({zipfile:e.zipfile,name:`${e.prefix}/${I(t)}`,content:t.endsWith(`.ips`)?Ze(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 yt(t){let{redact:n,outputPath:r,logger:i}=t,o=t.revealDocNames??!1,s=t.userLogsDir??R(w(),`logs`),c=t.projectDir?ot(t.projectDir,i):null;H(L(r),{recursive:!0}),i?.info({projectSlug:c},`gathering diagnostic data`);let l=st();l.desktop=t.desktop??null,l.language=t.language??null;let{files:ee,excludedByProjectSlug:ne}=mt(c,s),{files:u}=t.projectDir?ht(t.projectDir):{files:[]},{files:d}=t.projectDir?gt(t.projectDir):{files:[]},f=t.shipItLogFiles??[],p=t.diagnosticReports?.files??[];i?.info({logFileCount:ee.length,logFilesExcludedByProjectSlug:ne,lockFileCount:u.length,localSinkFileCount:d.length,shipItLogFileCount:f.length,diagnosticReportCount:p.length},`files collected`);let m=[],h=[],{ZipFile:g}=await import(`./yazl-BsCX6KWo.mjs`).then(t=>e(t.default,1)),_=new g;Y({zipfile:_,files:[...ee,...f],prefix:`logs`,redact:n,revealDocNames:o,bundleFiles:h,redactions:m,logger:i}),Y({zipfile:_,files:u,prefix:`lockdir`,redact:n,revealDocNames:o,bundleFiles:h,redactions:m,logger:i}),Y({zipfile:_,files:d,prefix:`local-logs`,redact:n,revealDocNames:o,bundleFiles:h,redactions:m,logger:i}),Y({zipfile:_,files:t.bugReportLedgerFiles??[],prefix:a,redact:n,revealDocNames:o,bundleFiles:h,redactions:m,logger:i}),Y({zipfile:_,files:p,prefix:`diagnostic-reports`,redact:n,revealDocNames:o,bundleFiles:h,redactions:m,logger:i});for(let e of t.extraFiles??[])try{let t=U(e.sourcePath),n=`extra/${e.zipName??I(e.sourcePath)}`;_.addBuffer(t,n),h.push(n);let r=at(e,n);r!==null&&m.push(r)}catch(t){i?.warn({sourcePath:e.sourcePath,err:t},`extra file unreadable; omitted from bundle`)}t.note&&vt({zipfile:_,name:`note.txt`,content:t.note,redact:n,revealDocNames:o,bundleFiles:h,redactions:m});let v=new Set(p.map(e=>`diagnostic-reports/${I(e)}`)),y=h.filter(e=>v.has(e)),b=t.diagnosticReports===void 0?`not-collected (no collection attempted)`:qe(t.diagnosticReports,y.length);_.addBuffer(Buffer.from(`${b}\n`,`utf8`),`state/diagnostic-reports-status.txt`),h.push(`state/diagnostic-reports-status.txt`);let x=JSON.stringify(l,null,2);_.addBuffer(Buffer.from(x,`utf8`),`sysinfo.json`),h.push(`sysinfo.json`);let S={generatedAt:new Date().toISOString(),disciplineVersion:`1.0.0`,projectSlug:c,files:h,redactions:m,sysinfo:l};_.addBuffer(Buffer.from(JSON.stringify(S,null,2),`utf8`),`MANIFEST.json`);let C=m.reduce((e,t)=>e+t.lineCount,0),T=new Set(f.map(e=>`logs/${I(e)}`)),E=h.filter(e=>T.has(e)),D=new Set((t.bugReportLedgerFiles??[]).map(e=>`${a}/${I(e)}`)),re=h.filter(e=>D.has(e)),ie=c?h.filter(e=>e.startsWith(`logs/`)&&!lt(e)&&!T.has(e)):[],O=y.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.`]:[],k=O.length>0?[`Redaction was disabled for this bundle; file contents are unmodified,`,`with one exception.`,...O]:[`Redaction was disabled for this bundle; file contents are unmodified.`],A=[`# Bug Report Bundle`,``,`Generated: ${S.generatedAt}`,`Project: ${c??`(unscoped)`}`,`Discipline version: ${S.disciplineVersion}`,``,`## Contents`,``,...h.map(e=>`- ${e}`),``,`## Privacy`,``,...ie.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:`,...ie.map(e=>`- ${e}`),``]:[],...E.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:`,...E.map(e=>`- ${e}`),``]:[],...y.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:`,...y.map(e=>`- ${e}`),``]:[],...re.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:`,...re.map(e=>`- ${e}`),``]:[],...n?[`This bundle was auto-redacted before packaging.`,`Patterns checked: ${te.join(`, `)}`,C>0?`${C} line(s) were scrubbed across ${m.length} file(s).`:`No redactions were needed.`,`See MANIFEST.json for the full redaction audit report.`,...O,``,`This bundle is safe to attach to a GitHub issue.`]:k].join(`
|
|
2
2
|
`);_.addBuffer(Buffer.from(A,`utf8`),`README.md`),_.end();let j=_e(r);return _.outputStream.pipe(j),await new Promise((e,t)=>{j.on(`close`,e),j.on(`error`,t)}),i?.info({bundlePath:r,fileCount:h.length,redactionCount:C},`bundle written`),{zipPath:r,summary:{projectSlug:c,files:h,redactions:m,redactedLineCount:C,generatedAt:S.generatedAt}}}var bt=m(),xt=e(N(),1),X=e(ce(),1);function St(e){let t=g(`user`,e,e);return T({absPath:t,sideline:!1,warn:()=>{}}).value.appearance?.language??`system`}function Ct({home:e=q(),env:n=process.env}={}){let r=St(e),{override:i,preferenceList:a}=x(n),{locale:s,source:c}=o({override:i,storedPreference:r,supportedLocales:ne,preferenceList:a,autoDetectableLocales:t});return{preference:r,locale:s,source:c,systemLanguages:a}}function wt(e,t){return t.length===0||!e.includes(t)?e:e.split(t).join(`<CONTENT_DIR>`)}function Tt(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Et(e,t){if(typeof e==`string`)return wt(e,t.contentDir);if(Array.isArray(e))return e.map(e=>Et(e,t));if(!Tt(e))return e;let n={};for(let[r,i]of Object.entries(e))n[r]=Et(i,t);return n}function Dt(e,t){let n=U(e,`utf-8`);if(n.length===0)return;let r=n.endsWith(`
|
|
3
3
|
`),i=n.split(`
|
|
4
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=Et(JSON.parse(n),t);a.push(JSON.stringify(e))}catch{a.push(n)}}}let o=r?`${a.join(`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{S as e,m as t,p as n,r}from"./start-jgWvvxuy.mjs";export{r as bootStartServer,n as resolveBundledReactShellDir,t as resolveHost,e as startCommand};
|