@inkeep/open-knowledge 0.77.9-beta.1 → 0.77.9-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. package/dist/{chunk-XKWWSDBF-D2uvTQ0O.mjs → chunk-XKWWSDBF-CiyukTrj.mjs} +2 -2
  2. package/dist/cli.mjs +55 -55
  3. package/dist/config-schema.json +1 -1
  4. package/dist/config.user.schema.json +1 -1
  5. package/dist/constants-D7ISUGXs.mjs +1 -0
  6. package/dist/{dist-DcJArHq7.mjs → dist-CdMoMubk.mjs} +483 -479
  7. package/dist/{dist-DEDXRbh0.mjs → dist-CupHag_I.mjs} +1 -1
  8. package/dist/{flag-coverage-6JEX67RU-DTi4Xp7_.mjs → flag-coverage-6JEX67RU-Byy8DkC9.mjs} +1 -1
  9. package/dist/index.mjs +190 -190
  10. package/dist/init-BnNTdvEi.mjs +1 -0
  11. package/dist/{init-CbXAMIbD.mjs → init-Co_mDPzI.mjs} +34 -34
  12. package/dist/{js-exec-VXN6TZ7U-CMKRxSof.mjs → js-exec-VXN6TZ7U-D--44jnh.mjs} +3 -3
  13. package/dist/{js-exec-VXN6TZ7U-DW1z0_f3.mjs → js-exec-VXN6TZ7U-Z8_USGOo.mjs} +4 -4
  14. package/dist/{launch-json-removal-CP7tSZPj.mjs → launch-json-removal-BAhghBP0.mjs} +1 -1
  15. package/dist/loader-DpmPmZs_.mjs +1 -0
  16. package/dist/{loader-D2-o7csT.mjs → loader-RbdwxE-e.mjs} +1 -1
  17. package/dist/{md-manager-BGnqyqi1-CofDfbRH.mjs → md-manager-BGnqyqi1-RmPtbV-6.mjs} +153 -153
  18. package/dist/{open-browser-CxyHo50J.mjs → open-browser-yaMqhpHT.mjs} +1 -1
  19. package/dist/parse-worker.mjs +1 -1
  20. package/dist/{preview-SCS9uRyV.mjs → preview-D4W9ISBt.mjs} +1 -1
  21. package/dist/preview-h82xr4fS.mjs +1 -0
  22. package/dist/public/assets/{ActivityModeContent-CKuIA-vj.js → ActivityModeContent-BATxSUxv.js} +1 -1
  23. package/dist/public/assets/AddPropertiesButton-Bhz5D_tP.js +2 -0
  24. package/dist/public/assets/{AgentDiffPane-B5RiGMoL.js → AgentDiffPane-BcLct3Tk.js} +1 -1
  25. package/dist/public/assets/{AgentIconCluster-0UCRKo29.js → AgentIconCluster-DOtER7-F.js} +1 -1
  26. package/dist/public/assets/{AgentThreadClientBinder-CCxqYyJC.js → AgentThreadClientBinder-DadOvih9.js} +1 -1
  27. package/dist/public/assets/{BugReportHistory-DxvYMoq8.js → BugReportHistory-D_OEmcqh.js} +1 -1
  28. package/dist/public/assets/{BugReportHistoryDialog-T_quySbG.js → BugReportHistoryDialog-ZGMDK7sk.js} +1 -1
  29. package/dist/public/assets/{CodeMirrorPropInput-zaXO57hT.js → CodeMirrorPropInput-Dvk3snLM.js} +1 -1
  30. package/dist/public/assets/{ConsentDialogBody-D3s62I9H.js → ConsentDialogBody-CDquCfjj.js} +1 -1
  31. package/dist/public/assets/{DeleteConfirmationDialog-C5r0h_Ud.js → DeleteConfirmationDialog-DaZfyQd8.js} +1 -1
  32. package/dist/public/assets/{DiffViewBoundary-C6M7WbN7.js → DiffViewBoundary-DbhDbXy8.js} +1 -1
  33. package/dist/public/assets/{DocumentContext-UFOE2JWI.js → DocumentContext-MH9fqXuW.js} +11 -11
  34. package/dist/public/assets/{EditorModeToggle-of13PGw3.js → EditorModeToggle-DClfDUEr.js} +1 -1
  35. package/dist/public/assets/{EnableSyncConfirmDialog-CyQt5yIK.js → EnableSyncConfirmDialog-Cdv3n1kf.js} +1 -1
  36. package/dist/public/assets/{ExcalidrawDocEditor-w-ELObJ2.js → ExcalidrawDocEditor-DngKrGvf.js} +1 -1
  37. package/dist/public/assets/FeedbackForm-XP78idFj.js +1 -0
  38. package/dist/public/assets/{GraphPanel-DXdturwZ.js → GraphPanel--beNjRT-.js} +1 -1
  39. package/dist/public/assets/{ImageAttachments-CiNpc4OD.js → ImageAttachments-CIihp_JJ.js} +1 -1
  40. package/dist/public/assets/{ImportSkillDialog-DzwS-_gT.js → ImportSkillDialog-DFsIu8AB.js} +1 -1
  41. package/dist/public/assets/{LintConfigEditor-3-bEQ38f.js → LintConfigEditor-OucnKI9n.js} +1 -1
  42. package/dist/public/assets/{ManagedArtifactProperties-BvP7p4Fn.js → ManagedArtifactProperties-CJpHReke.js} +1 -1
  43. package/dist/public/assets/ManagedArtifactProperties-dVdeWrTE.js +1 -0
  44. package/dist/public/assets/{MermaidDocEditor-DGUB9_es.js → MermaidDocEditor-DAQKQTIg.js} +1 -1
  45. package/dist/public/assets/{OpenInAgentMenuItem-CIgeKbxm.js → OpenInAgentMenuItem-BzgmEFwX.js} +1 -1
  46. package/dist/public/assets/{PropertyDisplayRow-Ca_QJFFO.js → PropertyDisplayRow-CR4LTYHm.js} +1 -1
  47. package/dist/public/assets/{RegisteredAgentIcon-Dt6m0JWd.js → RegisteredAgentIcon-2cwevuRg.js} +1 -1
  48. package/dist/public/assets/{ReportBugDialogBody-3mxOVavv.js → ReportBugDialogBody-B4etLNwK.js} +1 -1
  49. package/dist/public/assets/{ReportBugMenuTrigger-BOQJthK2.js → ReportBugMenuTrigger-Bc5z0-Fu.js} +2 -2
  50. package/dist/public/assets/{SchemaConfigEditor-Cva8N_Vx.js → SchemaConfigEditor-DfMcNdGA.js} +1 -1
  51. package/dist/public/assets/{SessionsHost-BEdlvzTb.js → SessionsHost-DS7-1kuO.js} +2 -2
  52. package/dist/public/assets/SettingsDialogBody-BFPgfIw-.js +12 -0
  53. package/dist/public/assets/{ShareBranchSwitchDialog-CqSvdNYn.js → ShareBranchSwitchDialog-CGaCBOnF.js} +1 -1
  54. package/dist/public/assets/{ShareReceiveDialog-DjUoZWSP.js → ShareReceiveDialog-DFRKvuQJ.js} +1 -1
  55. package/dist/public/assets/{ShareReceiveMissDialog-Bmm-LBUo.js → ShareReceiveMissDialog-BXrtIcx4.js} +1 -1
  56. package/dist/public/assets/{SkillCostValue-B1jRndjn.js → SkillCostValue-CaXVQav1.js} +1 -1
  57. package/dist/public/assets/{SkillEditBanner-Dg8_RY9w.js → SkillEditBanner-D_7WTsJ7.js} +1 -1
  58. package/dist/public/assets/{SkillForkDialog-BmygC534.js → SkillForkDialog-DQQGuXv8.js} +1 -1
  59. package/dist/public/assets/{SkillInstallMenu-BvdiguPV.js → SkillInstallMenu-UGZNOesd.js} +1 -1
  60. package/dist/public/assets/{SkillOriginInline-CtSexbCD.js → SkillOriginInline-wHAllLhh.js} +1 -1
  61. package/dist/public/assets/{SkillToolbarControls-BnOTw0g5.js → SkillToolbarControls-dPfL3r5J.js} +1 -1
  62. package/dist/public/assets/{SlidesToolbarControls-DxXFhc_a.js → SlidesToolbarControls-C_5MgL5R.js} +1 -1
  63. package/dist/public/assets/{SourceEditor-Do6LuSl-.js → SourceEditor-DgBYiBut.js} +1 -1
  64. package/dist/public/assets/{TerminalPanel-CsFd9pep.js → TerminalPanel-CXjN_98-.js} +3 -3
  65. package/dist/public/assets/{TerminalWindowApp-Cvu8cLGl.js → TerminalWindowApp-CQzuZYuY.js} +1 -1
  66. package/dist/public/assets/{TextDocEditor-Bfu8j-OT.js → TextDocEditor-Gj93hBqH.js} +1 -1
  67. package/dist/public/assets/ThreadView-C7sqK0is.js +21 -0
  68. package/dist/public/assets/{TimelineDiffPane-D64_zZAN.js → TimelineDiffPane-CRlgrJ2D.js} +1 -1
  69. package/dist/public/assets/{agent-connection-status-DHhTS7mm.js → agent-connection-status-DSp5AbZq.js} +1 -1
  70. package/dist/public/assets/{auth-state-cache-BoBofHh-.js → auth-state-cache-CglXQ28p.js} +1 -1
  71. package/dist/public/assets/{bug-report-send-manager-pKm1r3MP.js → bug-report-send-manager-IdWBPFHN.js} +1 -1
  72. package/dist/public/assets/{client-version-VcA1CS9y.js → client-version-Cfeq3w2f.js} +1 -1
  73. package/dist/public/assets/{comment-chips-B2XxLI4U.js → comment-chips-BDBYUGDo.js} +1 -1
  74. package/dist/public/assets/{config-provider-KvgyFqbI.js → config-provider-CB8Idy6z.js} +1 -1
  75. package/dist/public/assets/{css-color-to-hex-Dn6DirAJ.js → css-color-to-hex-CMHRbt5X.js} +1 -1
  76. package/dist/public/assets/{diagnostic-breadcrumb-BK7w-wbl.js → diagnostic-breadcrumb-DtVIthxV.js} +1 -1
  77. package/dist/public/assets/{dist-C-xa487z.js → dist-DDq2bd0-.js} +10 -10
  78. package/dist/public/assets/{doc-paths-CiKYU4qz.js → doc-paths-CWMCOiOb.js} +1 -1
  79. package/dist/public/assets/{doc-undo-manager-xnWvYKmd.js → doc-undo-manager-Dgd_R1wH.js} +1 -1
  80. package/dist/public/assets/{documents-events-BzjTnFaj.js → documents-events-BNOxHubi.js} +1 -1
  81. package/dist/public/assets/{file-tree-adapter-Cvq5dIQn.js → file-tree-adapter-CQyVXMVG.js} +1 -1
  82. package/dist/public/assets/{file-tree-utils-tm22NIqT.js → file-tree-utils-BgnPOQNb.js} +1 -1
  83. package/dist/public/assets/{folder-config-api-BYHJ-2CJ.js → folder-config-api-CnTUk9rh.js} +1 -1
  84. package/dist/public/assets/{index-BoV4ZgCO.js → index-C-M9IPeM.js} +18 -18
  85. package/dist/public/assets/{launch-agent-thread-BTIPj2wd.js → launch-agent-thread-CE4umI5d.js} +1 -1
  86. package/dist/public/assets/{lint-config-client-Dutmij5k.js → lint-config-client-D_KJIdJ0.js} +1 -1
  87. package/dist/public/assets/{markdownlint-rule-browser-BcpMbocU.js → markdownlint-rule-browser-Dbi_T41A.js} +1 -1
  88. package/dist/public/assets/{messages-D_JXKK6K.js → messages-BBniyOLF.js} +1 -1
  89. package/dist/public/assets/{messages-Dba8d9Jv.js → messages-C-1V9628.js} +1 -1
  90. package/dist/public/assets/{messages-CTHXCi99.js → messages-C-ujGeuR.js} +1 -1
  91. package/dist/public/assets/{messages-OAfaaxsv.js → messages-CK2HIOIp.js} +1 -1
  92. package/dist/public/assets/{messages-C2RvwrlQ.js → messages-CNb9VVVF.js} +1 -1
  93. package/dist/public/assets/{messages-BNMfFbl0.js → messages-CP9Uo9SK.js} +1 -1
  94. package/dist/public/assets/{messages-BaRzw5BK.js → messages-CXQO0cdG.js} +1 -1
  95. package/dist/public/assets/{messages-zt85fQDE.js → messages-CduVnYUK.js} +1 -1
  96. package/dist/public/assets/{messages-BHhMAkK_.js → messages-CzRStuhZ.js} +1 -1
  97. package/dist/public/assets/{messages-DQRWgXkq.js → messages-DlYEa7go.js} +1 -1
  98. package/dist/public/assets/{messages-D7fA0LQr.js → messages-Dmkb0uPj.js} +1 -1
  99. package/dist/public/assets/{messages-DPPth-dJ.js → messages-G0BZY30Q.js} +1 -1
  100. package/dist/public/assets/{navigation-targets-BL5wW6Pq.js → navigation-targets-Czs2lfGZ.js} +1 -1
  101. package/dist/public/assets/{page-list-cache-D3JYubhG.js → page-list-cache-C-TRKOCs.js} +1 -1
  102. package/dist/public/assets/{pending-receive-nav-store-CuH4lWq3.js → pending-receive-nav-store-DU0fd5HG.js} +1 -1
  103. package/dist/public/assets/{preferred-session-events-5P5vFEmA.js → preferred-session-events-DmNk8hX1.js} +1 -1
  104. package/dist/public/assets/{progress-01dDXuWD.js → progress-92g2HE0r.js} +3 -3
  105. package/dist/public/assets/{project-paths-DJMqNt89.js → project-paths-D5u5ETp2.js} +1 -1
  106. package/dist/public/assets/{prop-types-CN6SItze.js → prop-types-DrIWG3Gx.js} +1 -1
  107. package/dist/public/assets/{receive-store-mjPNDOwU.js → receive-store-KjyHtK2Z.js} +1 -1
  108. package/dist/public/assets/{selection-context-3hqQN4uG.js → selection-context-Dr8Dwtss.js} +1 -1
  109. package/dist/public/assets/{skill-scope-DQRx7jdL.js → skill-scope-PQ-EaBPe.js} +1 -1
  110. package/dist/public/assets/{skills-api-CA8SmuDI.js → skills-api-Bp10td_R.js} +1 -1
  111. package/dist/public/assets/{src-BHYeoZko.js → src-D45teqFC.js} +1 -1
  112. package/dist/public/assets/{startup-marks-B-g3E2Nd.js → startup-marks-CrtY-I8L.js} +1 -1
  113. package/dist/public/assets/{tag-pill-input-zmNsl2tf.js → tag-pill-input-ChT0p3uH.js} +1 -1
  114. package/dist/public/assets/{target-navigation-intent-CRrGgZfN.js → target-navigation-intent-Dxn3CEpi.js} +1 -1
  115. package/dist/public/assets/{telemetry-startup-06i4tjpG.js → telemetry-startup-CNWCAxA7.js} +1 -1
  116. package/dist/public/assets/{terminal-command-events-BKSe5MpD.js → terminal-command-events-BtEB1nJF.js} +1 -1
  117. package/dist/public/assets/{terminal-launch-events-BN3VcLCe.js → terminal-launch-events-z128lGYy.js} +1 -1
  118. package/dist/public/assets/{terminal-telemetry-tq_aM2-R.js → terminal-telemetry-DWYzbPMs.js} +1 -1
  119. package/dist/public/assets/thread-client-DWy51KvB.js +3 -0
  120. package/dist/public/assets/{typing-burst-detector-BRbbn7RW.js → typing-burst-detector-C5hbfIC1.js} +1 -1
  121. package/dist/public/assets/{uninstall-CzGXcf8z.js → uninstall-BJ0ruD6y.js} +1 -1
  122. package/dist/public/assets/{use-activity-panel-BAF-Ucz2.js → use-activity-panel-B0hBttlz.js} +1 -1
  123. package/dist/public/assets/{use-apply-config-language-DlfoA7DK.js → use-apply-config-language-B0buol98.js} +2 -2
  124. package/dist/public/assets/{use-collab-url-DBIPcV7i.js → use-collab-url-oh5407bM.js} +1 -1
  125. package/dist/public/assets/{use-conflicts-DPj0GwSi.js → use-conflicts-DlwnAZby.js} +1 -1
  126. package/dist/public/assets/{use-live-xterm-theme-Cg6WeiJo.js → use-live-xterm-theme-kTh86ROJ.js} +1 -1
  127. package/dist/public/assets/{use-open-skill-Cio74U1q.js → use-open-skill-CfG5l4pa.js} +1 -1
  128. package/dist/public/assets/{use-settings-route-CyhF9ifY.js → use-settings-route-kXDIfwuP.js} +1 -1
  129. package/dist/public/assets/{use-skill-origin-DuSzEzyo.js → use-skill-origin-nNSEYBhk.js} +1 -1
  130. package/dist/public/assets/{use-skills-BpBiRwqs.js → use-skills-BjbaVkdM.js} +1 -1
  131. package/dist/public/assets/{use-terminal-enabled-CW9xf1Ty.js → use-terminal-enabled-Bz_EEFKW.js} +1 -1
  132. package/dist/public/assets/{use-timeline-entry-diff-595jKiGo.js → use-timeline-entry-diff-CxWiRlcf.js} +1 -1
  133. package/dist/public/assets/{use-workspace-B6pir6UE.js → use-workspace-B5fRmw0K.js} +1 -1
  134. package/dist/public/index.html +58 -58
  135. package/dist/public/uninstall.html +4 -4
  136. package/dist/{python3-DNGS4G3E-Dpff_XiH.mjs → python3-DNGS4G3E-CRyO5yp1.mjs} +2 -2
  137. package/dist/{python3-DNGS4G3E-DSWx_2Ia.mjs → python3-DNGS4G3E-CixyRGKv.mjs} +3 -3
  138. package/dist/{registry-probes-DcQmklSR.mjs → registry-probes-BjsDFB65.mjs} +2 -2
  139. package/dist/{removal-file-path-Bm-2uQPi.mjs → removal-file-path-D6OEqNBM.mjs} +1 -1
  140. package/dist/{repair-launch-json-b1UC0Z9Y.mjs → repair-launch-json-BLnKg19X.mjs} +1 -1
  141. package/dist/{repair-mcp-configs-Boh7ga7s.mjs → repair-mcp-configs-hy238Kt4.mjs} +1 -1
  142. package/dist/schemas/v0/config.user.schema.json +1 -1
  143. package/dist/{sqlite3-TE5AIOTF-ButYCorg.mjs → sqlite3-TE5AIOTF-BK092fD6.mjs} +1 -1
  144. package/dist/{sqlite3-TE5AIOTF-D4yhY7wL.mjs → sqlite3-TE5AIOTF-DVwda1Ow.mjs} +3 -3
  145. package/dist/src-DUyBP196.mjs +1 -0
  146. package/dist/src-tuHpjXRh.mjs +11 -0
  147. package/dist/start-BWVT5n3j.mjs +1 -0
  148. package/dist/{start-B81qeDBS.mjs → start-DWDyuoi5.mjs} +3 -3
  149. package/package.json +4 -4
  150. package/dist/constants-DjcsE1aU.mjs +0 -1
  151. package/dist/init-B-sAo7zD.mjs +0 -1
  152. package/dist/loader-D1l3w-4T.mjs +0 -1
  153. package/dist/preview-CmAl4v3q.mjs +0 -1
  154. package/dist/public/assets/AddPropertiesButton-DO1jEnTz.js +0 -2
  155. package/dist/public/assets/FeedbackForm-BTos6Q47.js +0 -1
  156. package/dist/public/assets/ManagedArtifactProperties-Boovg5M3.js +0 -1
  157. package/dist/public/assets/SettingsDialogBody-J6zZfbkq.js +0 -12
  158. package/dist/public/assets/ThreadView-BupzJ5yH.js +0 -20
  159. package/dist/public/assets/thread-client-BS0s_MKD.js +0 -4
  160. package/dist/src-73Vc4tlm.mjs +0 -11
  161. package/dist/src-uidD5ZLv.mjs +0 -1
  162. package/dist/start-Rczs5F9g.mjs +0 -1
@@ -1,4 +1,4 @@
1
- import"./chunk-R6VWJ2ZL-DJY9gweS.mjs";import"./chunk-CWQS3NFK-BbpS-dVt.mjs";import"./chunk-DXB73IDG-DFy9txNR.mjs";import{t as e}from"./chunk-5QMZ5MUS-BuB3i_B5.mjs";import{n as t,t as n}from"./chunk-A5O5YHGN-BRMz0iFo.mjs";import{r}from"./chunk-OJDRYQWQ-JGMWNwO9.mjs";import{n as i,t as a}from"./chunk-3THT3N7L-DVKHLRUO.mjs";import{t as o}from"./chunk-44UOCSGV-CeGMLWmo.mjs";import{t as s}from"./chunk-74CEPOFO-BuzahJu2.mjs";import{n as c,t as l}from"./chunk-I57KEIP3-C90kULU7.mjs";import{fileURLToPath as u}from"node:url";import{Worker as d}from"node:worker_threads";import{randomBytes as f}from"node:crypto";import{AsyncLocalStorage as p}from"node:async_hooks";var m=1e4,h=6e4,g=new p,_=`js-exec - Sandboxed JavaScript/TypeScript runtime with Node.js-compatible APIs
1
+ import"./chunk-R6VWJ2ZL-DJY9gweS.mjs";import"./chunk-CWQS3NFK-BbpS-dVt.mjs";import"./chunk-DXB73IDG-DFy9txNR.mjs";import{t as e}from"./chunk-5QMZ5MUS-BuB3i_B5.mjs";import{n as t,t as n}from"./chunk-A5O5YHGN-BRMz0iFo.mjs";import{r}from"./chunk-OJDRYQWQ-JGMWNwO9.mjs";import{n as i,t as a}from"./chunk-3THT3N7L-DVKHLRUO.mjs";import{t as o}from"./chunk-44UOCSGV-CeGMLWmo.mjs";import{t as s}from"./chunk-74CEPOFO-BuzahJu2.mjs";import{n as c,t as l}from"./chunk-I57KEIP3-C90kULU7.mjs";import{fileURLToPath as u}from"node:url";import{randomBytes as d}from"node:crypto";import{Worker as f}from"node:worker_threads";import{AsyncLocalStorage as p}from"node:async_hooks";var m=1e4,h=6e4,g=new p,_=`js-exec - Sandboxed JavaScript/TypeScript runtime with Node.js-compatible APIs
2
2
 
3
3
  Usage: js-exec [OPTIONS] [-c CODE | FILE] [ARGS...]
4
4
 
@@ -85,8 +85,8 @@ Limits:
85
85
  Engine: QuickJS (compiled to WebAssembly)
86
86
  `;function v(e){let t={code:null,scriptFile:null,showVersion:!1,scriptArgs:[],isModule:!1,stripTypes:!1};if(e.length===0)return t;for(let n=0;n<e.length;n++){let r=e[n];if(r===`-m`||r===`--module`){t.isModule=!0;continue}if(r===`--strip-types`){t.stripTypes=!0;continue}if(r===`-c`)return n+1>=e.length?{stdout:``,stderr:`js-exec: option requires an argument -- 'c'
87
87
  `,exitCode:2}:(t.code=e[n+1],t.scriptArgs=e.slice(n+2),t);if(r===`--version`||r===`-V`)return t.showVersion=!0,t;if(r.startsWith(`-`)&&r!==`-`&&r!==`--`)return{stdout:``,stderr:`js-exec: unrecognized option '${r}'
88
- `,exitCode:2};if(r===`--`)return n+1<e.length&&(t.scriptFile=e[n+1],t.scriptArgs=e.slice(n+2)),t;if(!r.startsWith(`-`))return t.scriptFile=r,t.scriptArgs=e.slice(n+1),t}return t}var y=null,b=null,x=[],S=null,C=u(new URL(`./js-exec-worker.js`,import.meta.url));function w(){for(;x.length>0&&x[0].canceled;)x.shift();if(S||x.length===0)return;let e=x.shift();e&&(S=e,E().postMessage(S.input))}function T(e,t){if(!e||typeof e!=`object`)return{success:!1,error:`Malformed worker response`};let n=e;return typeof n.protocolToken!=`string`||n.protocolToken!==t?{success:!1,error:`Malformed worker response: invalid protocol token`}:typeof n.success==`boolean`?n.success?{success:!0}:{success:!1,error:typeof n.error==`string`&&n.error.length>0?n.error:`Worker execution failed`}:{success:!1,error:`Malformed worker response: missing success flag`}}function E(){if(b&&=(t(b),null),y)return y;let n=e.runTrusted(()=>new d(C));return y=n,n.on(`message`,e=>{if(y===n){if(S){let t=T(e,S.input.protocolToken);S.resolve(t),S=null}x.length>0?w():D()}}),n.on(`error`,e=>{if(y===n){if(S){let t=a(o(e));S.resolve({success:!1,error:t}),S=null}for(let e of x)e.resolve({success:!1,error:`Worker crashed`});x.length=0,y=null}}),n.on(`exit`,()=>{y===n&&(y=null,S&&=(S.resolve({success:!1,error:`Worker exited unexpectedly`}),null),x.length>0&&w())}),n}function D(){b=n(()=>{y&&!S&&x.length===0&&(y.terminate(),y=null)},5e3)}async function O(e,t,n,r=[],i,a,o){return g.getStore()?{stdout:``,stderr:`js-exec: recursive invocation is not supported
89
- `,exitCode:1}:k(e,t,n,r,i,a,o)}async function k(e,i,s,u=[],d,p,_){let v=c(),b=i.exec,C=b?(e,t)=>g.run(!0,()=>b(e,t)):void 0,T=new l(v,i.fs,i.cwd,`js-exec`,i.fetch,i.limits?.maxOutputSize??0,C),E=i.limits?.maxJsTimeoutMs??m,D=i.fetch?Math.max(E,h):E,O={protocolToken:f(16).toString(`hex`),sharedBuffer:v,jsCode:e,cwd:i.cwd,env:r(i.env),args:u,scriptPath:s,bootstrapCode:d,isModule:p,stripTypes:_,timeoutMs:D},k,A=new Promise(e=>{k=e}),j={input:O,resolve:()=>{}},M=n(()=>{if(S===j){let e=y;e&&(y=null,e.terminate()),S=null,w()}else j.canceled=!0,S||w();j.resolve({success:!1,error:`Execution timeout: exceeded ${D}ms limit`})},D);j.resolve=e=>{t(M),k(e)},x.push(j),w();let[N,P]=await Promise.all([T.run(D),A.catch(e=>({success:!1,error:a(o(e))}))]);return!P.success&&P.error?{stdout:N.stdout,stderr:`${N.stderr}js-exec: ${a(P.error)}
88
+ `,exitCode:2};if(r===`--`)return n+1<e.length&&(t.scriptFile=e[n+1],t.scriptArgs=e.slice(n+2)),t;if(!r.startsWith(`-`))return t.scriptFile=r,t.scriptArgs=e.slice(n+1),t}return t}var y=null,b=null,x=[],S=null,C=u(new URL(`./js-exec-worker.js`,import.meta.url));function w(){for(;x.length>0&&x[0].canceled;)x.shift();if(S||x.length===0)return;let e=x.shift();e&&(S=e,E().postMessage(S.input))}function T(e,t){if(!e||typeof e!=`object`)return{success:!1,error:`Malformed worker response`};let n=e;return typeof n.protocolToken!=`string`||n.protocolToken!==t?{success:!1,error:`Malformed worker response: invalid protocol token`}:typeof n.success==`boolean`?n.success?{success:!0}:{success:!1,error:typeof n.error==`string`&&n.error.length>0?n.error:`Worker execution failed`}:{success:!1,error:`Malformed worker response: missing success flag`}}function E(){if(b&&=(t(b),null),y)return y;let n=e.runTrusted(()=>new f(C));return y=n,n.on(`message`,e=>{if(y===n){if(S){let t=T(e,S.input.protocolToken);S.resolve(t),S=null}x.length>0?w():D()}}),n.on(`error`,e=>{if(y===n){if(S){let t=a(o(e));S.resolve({success:!1,error:t}),S=null}for(let e of x)e.resolve({success:!1,error:`Worker crashed`});x.length=0,y=null}}),n.on(`exit`,()=>{y===n&&(y=null,S&&=(S.resolve({success:!1,error:`Worker exited unexpectedly`}),null),x.length>0&&w())}),n}function D(){b=n(()=>{y&&!S&&x.length===0&&(y.terminate(),y=null)},5e3)}async function O(e,t,n,r=[],i,a,o){return g.getStore()?{stdout:``,stderr:`js-exec: recursive invocation is not supported
89
+ `,exitCode:1}:k(e,t,n,r,i,a,o)}async function k(e,i,s,u=[],f,p,_){let v=c(),b=i.exec,C=b?(e,t)=>g.run(!0,()=>b(e,t)):void 0,T=new l(v,i.fs,i.cwd,`js-exec`,i.fetch,i.limits?.maxOutputSize??0,C),E=i.limits?.maxJsTimeoutMs??m,D=i.fetch?Math.max(E,h):E,O={protocolToken:d(16).toString(`hex`),sharedBuffer:v,jsCode:e,cwd:i.cwd,env:r(i.env),args:u,scriptPath:s,bootstrapCode:f,isModule:p,stripTypes:_,timeoutMs:D},k,A=new Promise(e=>{k=e}),j={input:O,resolve:()=>{}},M=n(()=>{if(S===j){let e=y;e&&(y=null,e.terminate()),S=null,w()}else j.canceled=!0,S||w();j.resolve({success:!1,error:`Execution timeout: exceeded ${D}ms limit`})},D);j.resolve=e=>{t(M),k(e)},x.push(j),w();let[N,P]=await Promise.all([T.run(D),A.catch(e=>({success:!1,error:a(o(e))}))]);return!P.success&&P.error?{stdout:N.stdout,stderr:`${N.stderr}js-exec: ${a(P.error)}
90
90
  `,exitCode:N.exitCode||1}:N}var A={name:`js-exec`,async execute(e,t){if(s(e))return{stdout:_,stderr:``,exitCode:0};let n=v(e);if(`exitCode`in n)return n;if(n.showVersion)return{stdout:`QuickJS (quickjs-emscripten)
91
91
  `,stderr:``,exitCode:0};let r,a;if(n.code!==null)r=n.code,a=`-c`;else if(n.scriptFile!==null){let e=t.fs.resolvePath(t.cwd,n.scriptFile);if(!await t.fs.exists(e))return{stdout:``,stderr:`js-exec: can't open file '${n.scriptFile}': No such file or directory
92
92
  `,exitCode:2};try{r=await t.fs.readFile(e),a=e}catch(e){return{stdout:``,stderr:`js-exec: can't open file '${n.scriptFile}': ${i(e.message)}
@@ -1,4 +1,4 @@
1
- import"./chunk-R6VWJ2ZL-Cu1kOJ3f.mjs";import"./chunk-CWQS3NFK-Dma10iZG.mjs";import"./chunk-DXB73IDG-MLBj3lvC.mjs";import{t as e}from"./chunk-5QMZ5MUS-B37CnsNb.mjs";import{n as t,t as n}from"./chunk-A5O5YHGN-2_dxLAd1.mjs";import{n as r}from"./chunk-OJDRYQWQ-DOhqJ55-.mjs";import{n as i,t as a}from"./chunk-3THT3N7L-DVKHLRUO.mjs";import{t as o}from"./chunk-44UOCSGV-CeGMLWmo.mjs";import{t as s}from"./chunk-74CEPOFO-BuzahJu2.mjs";import{n as c,t as l}from"./chunk-I57KEIP3-CtKTv_KT.mjs";import{fileURLToPath as u}from"node:url";import{Worker as d}from"node:worker_threads";import{randomBytes as f}from"node:crypto";import{AsyncLocalStorage as p}from"node:async_hooks";var m=1e4,h=6e4,g=new p,_=`js-exec - Sandboxed JavaScript/TypeScript runtime with Node.js-compatible APIs
1
+ import"./chunk-R6VWJ2ZL-Cu1kOJ3f.mjs";import"./chunk-CWQS3NFK-Dma10iZG.mjs";import"./chunk-DXB73IDG-MLBj3lvC.mjs";import{t as e}from"./chunk-5QMZ5MUS-B37CnsNb.mjs";import{n as t,t as n}from"./chunk-A5O5YHGN-2_dxLAd1.mjs";import{n as r}from"./chunk-OJDRYQWQ-DOhqJ55-.mjs";import{n as i,t as a}from"./chunk-3THT3N7L-DVKHLRUO.mjs";import{t as o}from"./chunk-44UOCSGV-CeGMLWmo.mjs";import{t as s}from"./chunk-74CEPOFO-BuzahJu2.mjs";import{n as c,t as l}from"./chunk-I57KEIP3-CtKTv_KT.mjs";import{fileURLToPath as u}from"node:url";import{randomBytes as d}from"node:crypto";import{Worker as f}from"node:worker_threads";import{AsyncLocalStorage as p}from"node:async_hooks";var m=1e4,h=6e4,g=new p,_=`js-exec - Sandboxed JavaScript/TypeScript runtime with Node.js-compatible APIs
2
2
 
3
3
  Usage: js-exec [OPTIONS] [-c CODE | FILE] [ARGS...]
4
4
 
@@ -85,8 +85,8 @@ Limits:
85
85
  Engine: QuickJS (compiled to WebAssembly)
86
86
  `;function v(e){let t={code:null,scriptFile:null,showVersion:!1,scriptArgs:[],isModule:!1,stripTypes:!1};if(e.length===0)return t;for(let n=0;n<e.length;n++){let r=e[n];if(r===`-m`||r===`--module`){t.isModule=!0;continue}if(r===`--strip-types`){t.stripTypes=!0;continue}if(r===`-c`)return n+1>=e.length?{stdout:``,stderr:`js-exec: option requires an argument -- 'c'
87
87
  `,exitCode:2}:(t.code=e[n+1],t.scriptArgs=e.slice(n+2),t);if(r===`--version`||r===`-V`)return t.showVersion=!0,t;if(r.startsWith(`-`)&&r!==`-`&&r!==`--`)return{stdout:``,stderr:`js-exec: unrecognized option '${r}'
88
- `,exitCode:2};if(r===`--`)return n+1<e.length&&(t.scriptFile=e[n+1],t.scriptArgs=e.slice(n+2)),t;if(!r.startsWith(`-`))return t.scriptFile=r,t.scriptArgs=e.slice(n+1),t}return t}var y=null,b=null,x=[],S=null,C=u(new URL(`./js-exec-worker.js`,import.meta.url));function w(){for(;x.length>0&&x[0].canceled;)x.shift();if(S||x.length===0)return;let e=x.shift();e&&(S=e,E().postMessage(S.input))}function T(e,t){if(!e||typeof e!=`object`)return{success:!1,error:`Malformed worker response`};let n=e;return typeof n.protocolToken!=`string`||n.protocolToken!==t?{success:!1,error:`Malformed worker response: invalid protocol token`}:typeof n.success==`boolean`?n.success?{success:!0}:{success:!1,error:typeof n.error==`string`&&n.error.length>0?n.error:`Worker execution failed`}:{success:!1,error:`Malformed worker response: missing success flag`}}function E(){if(b&&=(t(b),null),y)return y;let n=e.runTrusted(()=>new d(C));return y=n,n.on(`message`,e=>{if(y===n){if(S){let t=T(e,S.input.protocolToken);S.resolve(t),S=null}x.length>0?w():D()}}),n.on(`error`,e=>{if(y===n){if(S){let t=a(o(e));S.resolve({success:!1,error:t}),S=null}for(let e of x)e.resolve({success:!1,error:`Worker crashed`});x.length=0,y=null}}),n.on(`exit`,()=>{y===n&&(y=null,S&&=(S.resolve({success:!1,error:`Worker exited unexpectedly`}),null),x.length>0&&w())}),n}function D(){b=n(()=>{y&&!S&&x.length===0&&(y.terminate(),y=null)},5e3)}async function O(e,t,n,r=[],i,a,o){return g.getStore()?{stdout:``,stderr:`js-exec: recursive invocation is not supported
89
- `,exitCode:1}:k(e,t,n,r,i,a,o)}async function k(e,i,s,u=[],d,p,_){let v=c(),b=i.exec,C=b?(e,t)=>g.run(!0,()=>b(e,t)):void 0,T=new l(v,i.fs,i.cwd,`js-exec`,i.fetch,i.limits?.maxOutputSize??0,C),E=i.limits?.maxJsTimeoutMs??m,D=i.fetch?Math.max(E,h):E,O={protocolToken:f(16).toString(`hex`),sharedBuffer:v,jsCode:e,cwd:i.cwd,env:r(i.env),args:u,scriptPath:s,bootstrapCode:d,isModule:p,stripTypes:_,timeoutMs:D},k,A=new Promise(e=>{k=e}),j={input:O,resolve:()=>{}},M=n(()=>{if(S===j){let e=y;e&&(y=null,e.terminate()),S=null,w()}else j.canceled=!0,S||w();j.resolve({success:!1,error:`Execution timeout: exceeded ${D}ms limit`})},D);j.resolve=e=>{t(M),k(e)},x.push(j),w();let[N,P]=await Promise.all([T.run(D),A.catch(e=>({success:!1,error:a(o(e))}))]);return!P.success&&P.error?{stdout:N.stdout,stderr:`${N.stderr}js-exec: ${a(P.error)}
88
+ `,exitCode:2};if(r===`--`)return n+1<e.length&&(t.scriptFile=e[n+1],t.scriptArgs=e.slice(n+2)),t;if(!r.startsWith(`-`))return t.scriptFile=r,t.scriptArgs=e.slice(n+1),t}return t}var y=null,b=null,x=[],S=null,C=u(new URL(`./js-exec-worker.js`,import.meta.url));function w(){for(;x.length>0&&x[0].canceled;)x.shift();if(S||x.length===0)return;let e=x.shift();e&&(S=e,E().postMessage(S.input))}function T(e,t){if(!e||typeof e!=`object`)return{success:!1,error:`Malformed worker response`};let n=e;return typeof n.protocolToken!=`string`||n.protocolToken!==t?{success:!1,error:`Malformed worker response: invalid protocol token`}:typeof n.success==`boolean`?n.success?{success:!0}:{success:!1,error:typeof n.error==`string`&&n.error.length>0?n.error:`Worker execution failed`}:{success:!1,error:`Malformed worker response: missing success flag`}}function E(){if(b&&=(t(b),null),y)return y;let n=e.runTrusted(()=>new f(C));return y=n,n.on(`message`,e=>{if(y===n){if(S){let t=T(e,S.input.protocolToken);S.resolve(t),S=null}x.length>0?w():D()}}),n.on(`error`,e=>{if(y===n){if(S){let t=a(o(e));S.resolve({success:!1,error:t}),S=null}for(let e of x)e.resolve({success:!1,error:`Worker crashed`});x.length=0,y=null}}),n.on(`exit`,()=>{y===n&&(y=null,S&&=(S.resolve({success:!1,error:`Worker exited unexpectedly`}),null),x.length>0&&w())}),n}function D(){b=n(()=>{y&&!S&&x.length===0&&(y.terminate(),y=null)},5e3)}async function O(e,t,n,r=[],i,a,o){return g.getStore()?{stdout:``,stderr:`js-exec: recursive invocation is not supported
89
+ `,exitCode:1}:k(e,t,n,r,i,a,o)}async function k(e,i,s,u=[],f,p,_){let v=c(),b=i.exec,C=b?(e,t)=>g.run(!0,()=>b(e,t)):void 0,T=new l(v,i.fs,i.cwd,`js-exec`,i.fetch,i.limits?.maxOutputSize??0,C),E=i.limits?.maxJsTimeoutMs??m,D=i.fetch?Math.max(E,h):E,O={protocolToken:d(16).toString(`hex`),sharedBuffer:v,jsCode:e,cwd:i.cwd,env:r(i.env),args:u,scriptPath:s,bootstrapCode:f,isModule:p,stripTypes:_,timeoutMs:D},k,A=new Promise(e=>{k=e}),j={input:O,resolve:()=>{}},M=n(()=>{if(S===j){let e=y;e&&(y=null,e.terminate()),S=null,w()}else j.canceled=!0,S||w();j.resolve({success:!1,error:`Execution timeout: exceeded ${D}ms limit`})},D);j.resolve=e=>{t(M),k(e)},x.push(j),w();let[N,P]=await Promise.all([T.run(D),A.catch(e=>({success:!1,error:a(o(e))}))]);return!P.success&&P.error?{stdout:N.stdout,stderr:`${N.stderr}js-exec: ${a(P.error)}
90
90
  `,exitCode:N.exitCode||1}:N}var A={name:`js-exec`,async execute(e,t){if(s(e))return{stdout:_,stderr:``,exitCode:0};let n=v(e);if(`exitCode`in n)return n;if(n.showVersion)return{stdout:`QuickJS (quickjs-emscripten)
91
91
  `,stderr:``,exitCode:0};let r,a;if(n.code!==null)r=n.code,a=`-c`;else if(n.scriptFile!==null){let e=t.fs.resolvePath(t.cwd,n.scriptFile);if(!await t.fs.exists(e))return{stdout:``,stderr:`js-exec: can't open file '${n.scriptFile}': No such file or directory
92
92
  `,exitCode:2};try{r=await t.fs.readFile(e),a=e}catch(e){return{stdout:``,stderr:`js-exec: can't open file '${n.scriptFile}': ${i(e.message)}
@@ -94,4 +94,4 @@ Limits:
94
94
  `,exitCode:2};let o=n.isModule,c=n.stripTypes;a&&a!==`-c`&&a!==`<stdin>`&&((a.endsWith(`.mjs`)||a.endsWith(`.mts`)||a.endsWith(`.ts`))&&(o=!0),(a.endsWith(`.ts`)||a.endsWith(`.mts`))&&(c=!0)),!o&&/\bawait\s+[\w([`]/.test(r)&&(o=!0);let l=t.jsBootstrapCode;return O(r,t,a,n.scriptArgs,l,o,c)}},j={name:`node`,async execute(){return{stdout:``,stderr:`node: this sandbox uses js-exec instead of node
95
95
 
96
96
  ${_}`,exitCode:1}}};export{A as jsExecCommand,j as nodeStubCommand};
97
- //# sourceMappingURL=js-exec-VXN6TZ7U-DW1z0_f3.mjs.map
97
+ //# sourceMappingURL=js-exec-VXN6TZ7U-Z8_USGOo.mjs.map
@@ -1 +1 @@
1
- import{Do as e,jo as t,wo as n}from"./dist-DcJArHq7.mjs";import{A as r,M as i,O as a}from"./init-CbXAMIbD.mjs";import{t as o}from"./is-object-BGze3w87.mjs";import{t as s}from"./removal-file-path-Bm-2uQPi.mjs";import{join as c}from"node:path";import{readFileSync as l}from"node:fs";const u={allowTrailingComma:!0,disallowComments:!1};function d(e,t){return e.error===1&&e.offset===0&&t.charCodeAt(0)===65279}function f(o){let f=s(c(o,`.claude`,`launch.json`));if(f.kind!==`ready`)return f;let m=f.path,h;try{h=l(m,`utf-8`)}catch(e){return{kind:`declined`,reason:i(e)}}let g=[],_=e(h,g,u)??void 0;if(g.some(e=>!d(e,h))||_?.type!==`object`)return{kind:`declined`,reason:`unparseable`};let v=n(_).configurations;if(!Array.isArray(v))return{kind:`not-present`};let y=v.findIndex(p);if(y===-1)return{kind:`not-present`};let{text:b,changed:x}=r(h,[`configurations`,y]);return x?(t(m,b,{mode:a(m)}),{kind:`removed`}):{kind:`not-present`}}function p(e){if(!o(e))return!1;let t=e;if(t.name!==`open-knowledge-ui`||!Array.isArray(t.runtimeArgs))return!1;let n=t.runtimeArgs;return t.runtimeExecutable===`/bin/sh`?n.length===3&&n[0]===`-l`&&n[1]===`-c`&&typeof n[2]==`string`&&/^# ok-ui-v[1-9]\d*$/.test(n[2].split(/\r?\n/,1)[0]??``):t.runtimeExecutable===`npx`?m.some(e=>h(n,e)):t.runtimeExecutable===`powershell`&&n.length===4&&n[0]===`-NoProfile`&&n[1]===`-NonInteractive`&&n[2]===`-Command`&&typeof n[3]==`string`&&/^# ok-ui-win-v[1-9]\d*$/.test(n[3].split(/\r?\n/,1)[0]??``)}const m=[[`@inkeep/open-knowledge`,`ui`],[`-y`,`@inkeep/open-knowledge`,`ui`],[`-y`,`@inkeep/open-knowledge@latest`,`ui`]];function h(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}export{f as t};
1
+ import{Do as e,jo as t,wo as n}from"./dist-CdMoMubk.mjs";import{A as r,M as i,O as a}from"./init-Co_mDPzI.mjs";import{t as o}from"./is-object-BGze3w87.mjs";import{t as s}from"./removal-file-path-D6OEqNBM.mjs";import{join as c}from"node:path";import{readFileSync as l}from"node:fs";const u={allowTrailingComma:!0,disallowComments:!1};function d(e,t){return e.error===1&&e.offset===0&&t.charCodeAt(0)===65279}function f(o){let f=s(c(o,`.claude`,`launch.json`));if(f.kind!==`ready`)return f;let m=f.path,h;try{h=l(m,`utf-8`)}catch(e){return{kind:`declined`,reason:i(e)}}let g=[],_=e(h,g,u)??void 0;if(g.some(e=>!d(e,h))||_?.type!==`object`)return{kind:`declined`,reason:`unparseable`};let v=n(_).configurations;if(!Array.isArray(v))return{kind:`not-present`};let y=v.findIndex(p);if(y===-1)return{kind:`not-present`};let{text:b,changed:x}=r(h,[`configurations`,y]);return x?(t(m,b,{mode:a(m)}),{kind:`removed`}):{kind:`not-present`}}function p(e){if(!o(e))return!1;let t=e;if(t.name!==`open-knowledge-ui`||!Array.isArray(t.runtimeArgs))return!1;let n=t.runtimeArgs;return t.runtimeExecutable===`/bin/sh`?n.length===3&&n[0]===`-l`&&n[1]===`-c`&&typeof n[2]==`string`&&/^# ok-ui-v[1-9]\d*$/.test(n[2].split(/\r?\n/,1)[0]??``):t.runtimeExecutable===`npx`?m.some(e=>h(n,e)):t.runtimeExecutable===`powershell`&&n.length===4&&n[0]===`-NoProfile`&&n[1]===`-NonInteractive`&&n[2]===`-Command`&&typeof n[3]==`string`&&/^# ok-ui-win-v[1-9]\d*$/.test(n[3].split(/\r?\n/,1)[0]??``)}const m=[[`@inkeep/open-knowledge`,`ui`],[`-y`,`@inkeep/open-knowledge`,`ui`],[`-y`,`@inkeep/open-knowledge@latest`,`ui`]];function h(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}export{f as t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./loader-RbdwxE-e.mjs";export{e as loadConfig};
@@ -1 +1 @@
1
- import{Pu as e,cs as t,il as n,io as r,ol as i,pl as a,wl as o}from"./md-manager-BGnqyqi1-CofDfbRH.mjs";import{Fo as s,No as c,x as l}from"./dist-DcJArHq7.mjs";import{t as u}from"./is-object-BGze3w87.mjs";import{t as d}from"./constants-DjcsE1aU.mjs";import{resolve as f}from"node:path";import{existsSync as p,readFileSync as m}from"node:fs";import{realpath as h}from"node:fs/promises";var g=e();async function _(e){let t=f(e);try{return await h(t)}catch(e){if(e.code!==`ENOENT`){let n=e instanceof Error?e.message:String(e);console.warn(`[normalize-cwd] realpath failed for ${t}: ${n}`)}return t}}function v(e){if(!p(e))return{value:null,path:e,source:null,doc:null};let t;try{t=m(e,`utf-8`)}catch(t){let n=t instanceof Error?t.message:String(t);return console.warn(`[config] Failed to read ${e}: ${n}`),{value:null,path:e,source:null,doc:null,diagnostic:{code:`UNREADABLE`,detail:`${e}: ${n}`}}}let n=(0,g.parseDocument)(t);if(n.errors.length>0){let r=n.errors.map(e=>e.message).join(`; `);return console.warn(`[config] Failed to parse ${e}: ${r}`),{value:null,path:e,source:t,doc:null,diagnostic:{code:`YAML_PARSE`,detail:`${e}: ${r}`}}}let r=n.toJSON();return u(r)?{value:r,path:e,source:t,doc:n}:{value:null,path:e,source:t,doc:n}}function y(e,t){return e.map(e=>{let n=e.path.map(e=>typeof e==`symbol`?String(e):e),r={path:n,message:e.message,issueCode:e.code};if(t.doc!==null&&t.source!==null){let e=a({file:t.path,source:t.source,doc:t.doc,path:n});if(e!==void 0)return{...r,source:e}}return r})}function b(e){let a=e??process.cwd(),u=[],p=[],m=[],h=[],g=s(`user`,a),_=c({absPath:g});p.push(..._.diagnostics),!_.valid&&_.sidelinedTo!==void 0&&m.push({from:g,to:_.sidelinedTo}),_.valid&&_.source!==void 0&&u.push(g);let b=(e,t=!1)=>{let i=v(e);if(i.diagnostic!==void 0&&p.push(i.diagnostic),i.value===null)return{};let a=n({value:i.value,file:i.path,source:i.source,doc:i.doc});p.push(...a),u.push(e);let s=a.length>0?o(i.value):i.value;return t&&h.push(...r({value:s,file:i.path,source:i.source,doc:i.doc})),s},x=f(a,`.ok`,d),S=b(x,!0),C=b(s(`project-local`,a)),w=t(_.value,S,C),T=l.safeParse(w);if(!T.success){let e=v(x),t={code:`SCHEMA_INVALID`,issues:y(T.error.issues,e)};throw Error(i(t))}return{config:T.data,sources:u,diagnostics:p,sidelined:m,ignoredCommittedKeys:h}}function x(e){let t=e.cacheMs??1e3,n=e.loadConfigFn??b,r=new Map,i=new Map,a=_(e.startupCwd);return async o=>{let s=await _(o??e.startupCwd),c=Date.now(),l=r.get(s);if(l&&l.expiresAt>c)return l.config;let u=i.get(s);if(u)return await u;let d=(async()=>{if(s===await a)return r.set(s,{config:e.startupConfig,expiresAt:Date.now()+t}),e.startupConfig;let i=n(s).config;return r.set(s,{config:i,expiresAt:Date.now()+t}),i})();i.set(s,d);try{return await d}finally{i.delete(s)}}}export{b as n,x as t};
1
+ import{Pu as e,cs as t,il as n,io as r,ol as i,pl as a,wl as o}from"./md-manager-BGnqyqi1-RmPtbV-6.mjs";import{Fo as s,No as c,x as l}from"./dist-CdMoMubk.mjs";import{t as u}from"./is-object-BGze3w87.mjs";import{t as d}from"./constants-D7ISUGXs.mjs";import{resolve as f}from"node:path";import{existsSync as p,readFileSync as m}from"node:fs";import{realpath as h}from"node:fs/promises";var g=e();async function _(e){let t=f(e);try{return await h(t)}catch(e){if(e.code!==`ENOENT`){let n=e instanceof Error?e.message:String(e);console.warn(`[normalize-cwd] realpath failed for ${t}: ${n}`)}return t}}function v(e){if(!p(e))return{value:null,path:e,source:null,doc:null};let t;try{t=m(e,`utf-8`)}catch(t){let n=t instanceof Error?t.message:String(t);return console.warn(`[config] Failed to read ${e}: ${n}`),{value:null,path:e,source:null,doc:null,diagnostic:{code:`UNREADABLE`,detail:`${e}: ${n}`}}}let n=(0,g.parseDocument)(t);if(n.errors.length>0){let r=n.errors.map(e=>e.message).join(`; `);return console.warn(`[config] Failed to parse ${e}: ${r}`),{value:null,path:e,source:t,doc:null,diagnostic:{code:`YAML_PARSE`,detail:`${e}: ${r}`}}}let r=n.toJSON();return u(r)?{value:r,path:e,source:t,doc:n}:{value:null,path:e,source:t,doc:n}}function y(e,t){return e.map(e=>{let n=e.path.map(e=>typeof e==`symbol`?String(e):e),r={path:n,message:e.message,issueCode:e.code};if(t.doc!==null&&t.source!==null){let e=a({file:t.path,source:t.source,doc:t.doc,path:n});if(e!==void 0)return{...r,source:e}}return r})}function b(e){let a=e??process.cwd(),u=[],p=[],m=[],h=[],g=s(`user`,a),_=c({absPath:g});p.push(..._.diagnostics),!_.valid&&_.sidelinedTo!==void 0&&m.push({from:g,to:_.sidelinedTo}),_.valid&&_.source!==void 0&&u.push(g);let b=(e,t=!1)=>{let i=v(e);if(i.diagnostic!==void 0&&p.push(i.diagnostic),i.value===null)return{};let a=n({value:i.value,file:i.path,source:i.source,doc:i.doc});p.push(...a),u.push(e);let s=a.length>0?o(i.value):i.value;return t&&h.push(...r({value:s,file:i.path,source:i.source,doc:i.doc})),s},x=f(a,`.ok`,d),S=b(x,!0),C=b(s(`project-local`,a)),w=t(_.value,S,C),T=l.safeParse(w);if(!T.success){let e=v(x),t={code:`SCHEMA_INVALID`,issues:y(T.error.issues,e)};throw Error(i(t))}return{config:T.data,sources:u,diagnostics:p,sidelined:m,ignoredCommittedKeys:h}}function x(e){let t=e.cacheMs??1e3,n=e.loadConfigFn??b,r=new Map,i=new Map,a=_(e.startupCwd);return async o=>{let s=await _(o??e.startupCwd),c=Date.now(),l=r.get(s);if(l&&l.expiresAt>c)return l.config;let u=i.get(s);if(u)return await u;let d=(async()=>{if(s===await a)return r.set(s,{config:e.startupConfig,expiresAt:Date.now()+t}),e.startupConfig;let i=n(s).config;return r.set(s,{config:i,expiresAt:Date.now()+t}),i})();i.set(s,d);try{return await d}finally{i.delete(s)}}}export{b as n,x as t};