@inkeep/open-knowledge 0.71.2 → 0.71.3

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 (166) hide show
  1. package/dist/assets/skills/project/SKILL.md +3 -3
  2. package/dist/cli.mjs +54 -54
  3. package/dist/constants-DFWxgBEu.mjs +1 -0
  4. package/dist/{dist-Bxzi66b7.mjs → dist-Dz_-5lHS.mjs} +1 -1
  5. package/dist/dist-k83QDjQ5.mjs +2098 -0
  6. package/dist/index.mjs +202 -202
  7. package/dist/init-BGApkGms.mjs +1 -0
  8. package/dist/{init-D_gjDHTf.mjs → init-DtHFYuX-.mjs} +7 -7
  9. package/dist/{launch-json-removal-IMDkZJTs.mjs → launch-json-removal-B4EmblXJ.mjs} +1 -1
  10. package/dist/loader-DV0t6yZX.mjs +1 -0
  11. package/dist/{loader-bj3vZ227.mjs → loader-DYelT5yv.mjs} +1 -1
  12. package/dist/{md-manager-BGnqyqi1-C0-0a_4T.mjs → md-manager-BGnqyqi1-I1w3knRG.mjs} +159 -159
  13. package/dist/{open-browser-D9Sv9-6K.mjs → open-browser-BwRuV7d-.mjs} +1 -1
  14. package/dist/parse-worker.mjs +1 -1
  15. package/dist/{preview-DdwEHHFb.mjs → preview-B7MgXnmG.mjs} +1 -1
  16. package/dist/preview-vt8JYeOs.mjs +1 -0
  17. package/dist/public/assets/{ActivityModeContent-B_Re3sCO.js → ActivityModeContent-iDxJ5FGg.js} +1 -1
  18. package/dist/public/assets/AddPropertiesButton-Bay5F8or.js +2 -0
  19. package/dist/public/assets/{AgentDiffPane-CnwENM87.js → AgentDiffPane-B8oCPp-C.js} +1 -1
  20. package/dist/public/assets/{AgentThreadClientBinder-Cpxd_y8o.js → AgentThreadClientBinder-CcixiWZP.js} +1 -1
  21. package/dist/public/assets/{BugReportHistory-BFBxSZGO.js → BugReportHistory-1xBoxjRe.js} +1 -1
  22. package/dist/public/assets/{BugReportHistoryDialog-B9iSu7kb.js → BugReportHistoryDialog-B98PsL3_.js} +1 -1
  23. package/dist/public/assets/CodeMirrorPropInput-DE3arJ1h.js +3 -0
  24. package/dist/public/assets/{ConsentDialogBody-Da3QcM9i.js → ConsentDialogBody-CvvS7sW_.js} +1 -1
  25. package/dist/public/assets/{DiffViewBoundary-DoYnI8ZQ.js → DiffViewBoundary-D6P65lBv.js} +1 -1
  26. package/dist/public/assets/DocumentContext-BAxdqFVX.js +38 -0
  27. package/dist/public/assets/{EditorModeToggle-CL0A-pdT.js → EditorModeToggle-BluS6O1Q.js} +1 -1
  28. package/dist/public/assets/{EnableSyncConfirmDialog-D0sbHn3C.js → EnableSyncConfirmDialog-CkasK117.js} +1 -1
  29. package/dist/public/assets/{ExcalidrawDocEditor-4A61s0Od.js → ExcalidrawDocEditor-X2eM4iDr.js} +1 -1
  30. package/dist/public/assets/FeedbackForm-BFZhjaiS.js +1 -0
  31. package/dist/public/assets/{GraphPanel-bSfesBVN.js → GraphPanel-Riqs8zY_.js} +1 -1
  32. package/dist/public/assets/{ImageAttachments-DCnmCMwy.js → ImageAttachments-DYcvX-9j.js} +1 -1
  33. package/dist/public/assets/{ImportSkillDialog-CUgeolEZ.js → ImportSkillDialog-CxGilGp5.js} +1 -1
  34. package/dist/public/assets/{LintConfigEditor-BkHxS4Z2.js → LintConfigEditor-CmMDsms4.js} +1 -1
  35. package/dist/public/assets/{ManagedArtifactProperties-B8izvHBO.js → ManagedArtifactProperties-CqzCmoEx.js} +1 -1
  36. package/dist/public/assets/ManagedArtifactProperties-CzRsToV2.js +1 -0
  37. package/dist/public/assets/{MermaidDocEditor-DCaIz0MV.js → MermaidDocEditor-C8G_89pT.js} +1 -1
  38. package/dist/public/assets/{PropertyDisplayRow-DONEJphz.js → PropertyDisplayRow-PHFT-0x9.js} +1 -1
  39. package/dist/public/assets/{RegisteredAgentIcon-uzdinNgX.js → RegisteredAgentIcon-1u8OPkzG.js} +1 -1
  40. package/dist/public/assets/{ReportBugDialogBody-E6Fob_yR.js → ReportBugDialogBody-BIvbsbMW.js} +2 -2
  41. package/dist/public/assets/{ReportBugMenuTrigger-vfXhqEcn.js → ReportBugMenuTrigger-4rfqK2yi.js} +2 -2
  42. package/dist/public/assets/{SchemaConfigEditor-C6TJAzlP.js → SchemaConfigEditor-BYFOLs6T.js} +1 -1
  43. package/dist/public/assets/{SessionsHost-mxsP8VBT.js → SessionsHost-BPLpNeOF.js} +2 -2
  44. package/dist/public/assets/SettingsDialogBody-yu166pCI.js +12 -0
  45. package/dist/public/assets/{ShareBranchSwitchDialog-gKoCKNmm.js → ShareBranchSwitchDialog-CeS2pq46.js} +1 -1
  46. package/dist/public/assets/{ShareReceiveDialog-ZNb37P07.js → ShareReceiveDialog-ClHpnUYc.js} +1 -1
  47. package/dist/public/assets/{ShareReceiveMissDialog-B3EB6YQR.js → ShareReceiveMissDialog-CQua0iOr.js} +1 -1
  48. package/dist/public/assets/{SkillCostValue-Bz5nwKsQ.js → SkillCostValue-CBjvYNMu.js} +1 -1
  49. package/dist/public/assets/{SkillEditBanner-BCuondXM.js → SkillEditBanner-BsHna4Hf.js} +1 -1
  50. package/dist/public/assets/{SkillForkDialog-DuMxFnIM.js → SkillForkDialog-CMuFvog_.js} +1 -1
  51. package/dist/public/assets/{SkillInstallMenu-Ya-6FZjF.js → SkillInstallMenu-u16nqzKP.js} +1 -1
  52. package/dist/public/assets/{SkillOriginInline-DeZR5fKf.js → SkillOriginInline-CSk_F2pn.js} +1 -1
  53. package/dist/public/assets/{SkillToolbarControls-BvrdkOsH.js → SkillToolbarControls-DB1-0BlP.js} +1 -1
  54. package/dist/public/assets/{SlidesToolbarControls-BL0Efw2b.js → SlidesToolbarControls-B_8qlRKc.js} +1 -1
  55. package/dist/public/assets/SourceEditor-C_0RrAPT.js +1 -0
  56. package/dist/public/assets/{TerminalPanel-B8KnX1Qb.js → TerminalPanel-D8MvMzrY.js} +3 -3
  57. package/dist/public/assets/{TerminalWindowApp-Xgzsyfd2.js → TerminalWindowApp-CLhhvaw6.js} +1 -1
  58. package/dist/public/assets/{TextDocEditor-BplISC3q.js → TextDocEditor-DVa_kn_3.js} +1 -1
  59. package/dist/public/assets/{ThreadView-C3tePmSt.js → ThreadView-D9tYQaPU.js} +3 -3
  60. package/dist/public/assets/{TimelineDiffPane-BUxav6uZ.js → TimelineDiffPane-CXL9hH7j.js} +1 -1
  61. package/dist/public/assets/{agent-diff-store-CEBg54c-.js → agent-diff-store-CKshhmPv.js} +1 -1
  62. package/dist/public/assets/{auth-state-cache-CBNus4S0.js → auth-state-cache-BdZn1_cl.js} +4 -4
  63. package/dist/public/assets/{bug-report-send-manager-MWas6qro.js → bug-report-send-manager-D0BmAaF4.js} +1 -1
  64. package/dist/public/assets/{client-version-D207g_G2.js → client-version-Cod5-Jxl.js} +1 -1
  65. package/dist/public/assets/{comment-chips-DToBb3F4.js → comment-chips-Cum7N2VU.js} +1 -1
  66. package/dist/public/assets/{config-provider-DFYIVc9V.js → config-provider-c07bs_5K.js} +3 -3
  67. package/dist/public/assets/{css-color-to-hex-DTpyOuFo.js → css-color-to-hex-B1xnsn4W.js} +1 -1
  68. package/dist/public/assets/{dist-DyIzmB4e.js → dist-CKA2_wgb.js} +100 -100
  69. package/dist/public/assets/{doc-hash-lEZL1-60.js → doc-hash-BwLoJO7y.js} +1 -1
  70. package/dist/public/assets/{doc-undo-manager-p-u-ggv3.js → doc-undo-manager-OzcyE_Ep.js} +1 -1
  71. package/dist/public/assets/{documents-events-BhD4StGH.js → documents-events-Ceh_cp-f.js} +1 -1
  72. package/dist/public/assets/{file-tree-adapter-BW1mzcZg.js → file-tree-adapter-qcduIPf8.js} +1 -1
  73. package/dist/public/assets/{file-tree-utils-PzrGlJAG.js → file-tree-utils-BNJ3ROpz.js} +1 -1
  74. package/dist/public/assets/{folder-config-api-DnX5Sb8v.js → folder-config-api-D-7YhE42.js} +1 -1
  75. package/dist/public/assets/i18n-C59x9sec.js +1 -0
  76. package/dist/public/assets/index-DBmvy3-g.js +2205 -0
  77. package/dist/public/assets/{launcher-selection-C_llHRjt.js → launcher-selection-DTogNqZQ.js} +1 -1
  78. package/dist/public/assets/{lint-config-client-BWUce3vG.js → lint-config-client-4uUvkVug.js} +1 -1
  79. package/dist/public/assets/{markdownlint-rule-browser-ElUlIFqV.js → markdownlint-rule-browser-EGFSJU47.js} +1 -1
  80. package/dist/public/assets/messages-Bl9zNYXZ.js +1 -0
  81. package/dist/public/assets/messages-CC9zekFL.js +1 -0
  82. package/dist/public/assets/messages-CEvM7K61.js +1 -0
  83. package/dist/public/assets/messages-CaXLQsR1.js +1 -0
  84. package/dist/public/assets/messages-DEZS0xwS.js +1 -0
  85. package/dist/public/assets/messages-DOOCOiOK.js +1 -0
  86. package/dist/public/assets/messages-DjzrsPDj.js +1 -0
  87. package/dist/public/assets/messages-DsUGWxjP.js +1 -0
  88. package/dist/public/assets/messages-Nh73KzC1.js +1 -0
  89. package/dist/public/assets/messages-Q0vAhMus.js +1 -0
  90. package/dist/public/assets/messages-UsePQeMV.js +1 -0
  91. package/dist/public/assets/messages-Wag_mfpX.js +1 -0
  92. package/dist/public/assets/navigation-targets-CNqjrVcs.js +1 -0
  93. package/dist/public/assets/{page-list-cache-BMYenCYz.js → page-list-cache-B6WtCC89.js} +1 -1
  94. package/dist/public/assets/{pending-receive-nav-store-Cr1LCQbQ.js → pending-receive-nav-store-DP3X3oln.js} +1 -1
  95. package/dist/public/assets/progress-D5Cdpohn.js +9 -0
  96. package/dist/public/assets/{project-paths-Doyo5LKO.js → project-paths-ByU0abNG.js} +1 -1
  97. package/dist/public/assets/{prop-types-BIbPZaOa.js → prop-types-BYV_mZe-.js} +1 -1
  98. package/dist/public/assets/{receive-store-DlTlJ5XT.js → receive-store-CUo7D3Xg.js} +1 -1
  99. package/dist/public/assets/{selection-context-BYpSRLhW.js → selection-context-2PG-nVIE.js} +1 -1
  100. package/dist/public/assets/{skill-scope-DUOFVFOe.js → skill-scope-B5R2BWWQ.js} +1 -1
  101. package/dist/public/assets/skills-api-B6xK8Waz.js +1 -0
  102. package/dist/public/assets/{src-CBDDC_H3.js → src-BSwEHFwp.js} +1 -1
  103. package/dist/public/assets/{startup-marks-BltEnhgt.js → startup-marks-RiT1uPCY.js} +1 -1
  104. package/dist/public/assets/{tag-pill-input-DW91XTBS.js → tag-pill-input-vnQTl5Dh.js} +1 -1
  105. package/dist/public/assets/{target-navigation-intent-fdxlfpay.js → target-navigation-intent-CzpSqGnJ.js} +1 -1
  106. package/dist/public/assets/{telemetry-startup-BW_bNXmx.js → telemetry-startup-BVYbVSoJ.js} +1 -1
  107. package/dist/public/assets/{terminal-cli-display-DEakOmBF.js → terminal-cli-display-NSjvCThF.js} +1 -1
  108. package/dist/public/assets/{terminal-command-events-C6UXBdNc.js → terminal-command-events-DPijQAJx.js} +1 -1
  109. package/dist/public/assets/{terminal-telemetry-D03uka1-.js → terminal-telemetry-CRxhTPje.js} +1 -1
  110. package/dist/public/assets/typing-burst-detector-Cn1gPE6t.js +8 -0
  111. package/dist/public/assets/{uninstall-DBe4o9pX.js → uninstall-B_uZBJon.js} +1 -1
  112. package/dist/public/assets/{use-activity-panel-Bj2Xj0ox.js → use-activity-panel-Bu3fEgsA.js} +1 -1
  113. package/dist/public/assets/{use-collab-url-Bu5itY1E.js → use-collab-url-CW1NMjbl.js} +1 -1
  114. package/dist/public/assets/{use-conflicts-mW2O3q7A.js → use-conflicts-CSAQWQnv.js} +1 -1
  115. package/dist/public/assets/{use-live-xterm-theme-BPZA1eWT.js → use-live-xterm-theme-DJkq2DHU.js} +1 -1
  116. package/dist/public/assets/{use-open-skill-B_ahDNz1.js → use-open-skill-B5Z1erlx.js} +1 -1
  117. package/dist/public/assets/{use-settings-route-BCi5InHC.js → use-settings-route-DEECvMaD.js} +1 -1
  118. package/dist/public/assets/{use-skill-origin-Cs9rE0v_.js → use-skill-origin-Diow_PUB.js} +1 -1
  119. package/dist/public/assets/{use-skills-CgQB8nRT.js → use-skills-BQB8u19K.js} +1 -1
  120. package/dist/public/assets/{use-terminal-enabled-DYI9ZQgY.js → use-terminal-enabled-BpsH2Enh.js} +1 -1
  121. package/dist/public/assets/{use-timeline-entry-diff-D8pEgQ0K.js → use-timeline-entry-diff-rU0FYIUw.js} +4 -4
  122. package/dist/public/assets/{use-workspace-BrVq04zg.js → use-workspace-Bk-cOozB.js} +1 -1
  123. package/dist/public/index.html +54 -54
  124. package/dist/public/uninstall.html +4 -4
  125. package/dist/{registry-probes-CSYVvHU1.mjs → registry-probes-C06jcN5e.mjs} +2 -2
  126. package/dist/{removal-file-path-9sxva5U4.mjs → removal-file-path-YH-AVi_2.mjs} +1 -1
  127. package/dist/{repair-launch-json-tEgdkgQB.mjs → repair-launch-json-DKAIkn75.mjs} +1 -1
  128. package/dist/{repair-mcp-configs-DYgybbpP.mjs → repair-mcp-configs-DNEcMx8E.mjs} +1 -1
  129. package/dist/src--_0iRq3A.mjs +11 -0
  130. package/dist/src-BF23l0Vl.mjs +1 -0
  131. package/dist/{start-BK63C5S4.mjs → start-CUAm2ks1.mjs} +3 -3
  132. package/dist/start-CjoyEuJ9.mjs +1 -0
  133. package/package.json +5 -5
  134. package/dist/constants-BirNT126.mjs +0 -1
  135. package/dist/dist-D1HfouVm.mjs +0 -2097
  136. package/dist/init-Bt-Gd0Of.mjs +0 -1
  137. package/dist/loader-CdcKuBwQ.mjs +0 -1
  138. package/dist/preview-CEgkalQZ.mjs +0 -1
  139. package/dist/public/assets/AddPropertiesButton-DBIbNQMb.js +0 -2
  140. package/dist/public/assets/CodeMirrorPropInput-D-iWWvft.js +0 -3
  141. package/dist/public/assets/DocumentContext-qHxlPFgu.js +0 -38
  142. package/dist/public/assets/FeedbackForm-41B5VbyM.js +0 -1
  143. package/dist/public/assets/ManagedArtifactProperties-C0k10C6t.js +0 -1
  144. package/dist/public/assets/SettingsDialogBody-CBr9NTCP.js +0 -12
  145. package/dist/public/assets/SourceEditor-XVY6g4ls.js +0 -1
  146. package/dist/public/assets/i18n-6dHpFTP1.js +0 -1
  147. package/dist/public/assets/index-CS26J6l3.js +0 -2205
  148. package/dist/public/assets/messages-BNcdAJdj.js +0 -1
  149. package/dist/public/assets/messages-BQW2dr4q.js +0 -1
  150. package/dist/public/assets/messages-CC4OPnXO.js +0 -1
  151. package/dist/public/assets/messages-CZ6CbfUL.js +0 -1
  152. package/dist/public/assets/messages-CgcohXjC.js +0 -1
  153. package/dist/public/assets/messages-CwHjht3E.js +0 -1
  154. package/dist/public/assets/messages-DDMCaNZg.js +0 -1
  155. package/dist/public/assets/messages-DhU_MMo_.js +0 -1
  156. package/dist/public/assets/messages-DxTTA4B9.js +0 -1
  157. package/dist/public/assets/messages-l-GCh3wD.js +0 -1
  158. package/dist/public/assets/messages-p3H-WbVc.js +0 -1
  159. package/dist/public/assets/messages-upO1XdxK.js +0 -1
  160. package/dist/public/assets/navigation-targets-DfspBQqI.js +0 -1
  161. package/dist/public/assets/progress-BTAR0ta6.js +0 -9
  162. package/dist/public/assets/skills-api-CQ5y7Hxj.js +0 -1
  163. package/dist/public/assets/typing-burst-detector-DdbPTV6s.js +0 -8
  164. package/dist/src-DNTPYKMh.mjs +0 -1
  165. package/dist/src-VCAYQpty.mjs +0 -11
  166. package/dist/start-xHCpCQLR.mjs +0 -1
@@ -1 +1 @@
1
- import{Mn as e,Xi as t,fi as n}from"./dist-DyIzmB4e.js";import{c as r,t as i}from"./trace-api-BP9dN1Hz.js";import{t as a}from"./propagation-api-DC5404fy.js";import{t as o}from"./createLucideIcon-B6ULg5PN.js";import{n as s}from"./contact-email-store-D9SgN2yN.js";var c=o(`mail`,[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]),l=`support@inkeep.com`;function u(e){return`mailto:${l}?subject=${encodeURIComponent(e)}`}function d(e){return e.split(/[\\/]/).pop()??e}function f(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:e>=1024?`${Math.max(1,Math.round(e/1024))} KB`:`${e} B`}var p=200,m=/^(?:#{1,6}|>)(?:[ \t]+|$)/;function h(r){if(typeof r==`string`)for(let i of r.split(/\r\n|\r|\n/)){let r=n(i);for(r=t(r).replace(/\s+/g,` `).trim();m.test(r);)r=r.replace(m,``).trim();if(r!==``)return e(r,p).trimEnd()}}var g=`open-knowledge-app`,_=`ok.bug-report.send.attempt`,v={traceparent:()=>void 0,end:()=>{}},y=v;function b(e={}){try{let t=i.getTracer(g).startSpan(_,{attributes:e});return t.isRecording()?x(t,i.setSpan(r,t)):(t.end(),y)}catch(e){return console.warn(`[bug-report-send-otel] span start failed:`,e instanceof Error?e:String(e)),y}}function x(e,t){let n=!1;return{traceparent(){try{let e={};return a.inject(t,e),e.traceparent}catch{return}},end(t,r){if(!n){n=!0;try{r&&e.setAttributes(r),e.setAttribute(`ok.bug_report.renderer_outcome`,t),e.end()}catch{}}}}}var S=200,C=3,w=.9;function T(e,t=s){if(e.kind===`history-row`){let{row:n}=e,r=t.getSnapshot().email;return{zipPath:n.zipPath,zipSizeBytes:n.zipBytes,metadata:{level:n.bundleLevel===`unknown`?`standard`:n.bundleLevel,systemWide:n.systemWide,projectSlug:n.projectSlug,...n.note===void 0?{}:{note:n.note},...r===null?{}:{email:r}}}}let{report:n,note:r,includeScreenshot:i,includeAttachments:a,email:o}=e;return{zipPath:n.zipPath,zipSizeBytes:n.zipSizeBytes,metadata:{level:n.summary.level,systemWide:n.summary.systemWide,projectSlug:n.summary.projectSlug,note:r,...o===void 0?{}:{email:o}},includeScreenshot:i,...a===void 0?{}:{includeAttachments:a}}}function E(e,t=s){let n=new Map,r=new Set,i=null;function a(){for(let e of r)try{e()}catch(e){console.warn(`[bug-report-send] subscriber threw:`,e)}}function o(e,t){e.state=t,i=null,a()}function c(e){return{operationId:e.operationId,zipPath:e.zipPath,zipSizeBytes:e.zipSizeBytes,requestSeq:e.requestSeq}}function l(e){e.fillTimer!==null&&(clearInterval(e.fillTimer),e.fillTimer=null)}function u(e){l(e);let t=Date.now();e.fillTimer=setInterval(()=>{if(e.state.status!==`sending`){l(e);return}let n=(Date.now()-t)/1e3,r=Math.min(w,1-Math.exp(-n/C)),i=Math.round(r*100);i!==e.state.fillPercent&&o(e,{...c(e),status:`sending`,fillPercent:i})},S)}function f(e,t){l(e),e.span.end(t.status===`email-draft`?`email-drafted`:t.status===`already-sending`?`joined`:t.status,{"ok.bug_report.request_seq":e.requestSeq}),o(e,{...c(e),...t})}function p(e,t){if(t.ok){f(e,{status:`sent`,reference:t.reference});return}if(t.reason===`email-draft`){f(e,{status:`email-draft`,mailtoUrl:t.fallback.mailtoUrl});return}if(t.reason===`send-in-flight`){f(e,{status:`already-sending`});return}f(e,{status:`failed`,mailtoUrl:t.fallback.mailtoUrl})}function m(e){e.span=b({"ok.bug_report.zip_bytes":e.input.zipSizeBytes,"ok.bug_report.include_screenshot":e.input.includeScreenshot===!0,"ok.bug_report.attempt":e.requestSeq}),o(e,{...c(e),status:`sending`,fillPercent:0}),u(e),g(e,e.input)}function h(e){return e.requestSeq+=1,e.state.status===`sending`?(o(e,{...c(e),status:`sending`,fillPercent:e.state.fillPercent}),e.state):(m(e),e.state)}async function g(t,n){try{let r=e();if(r===void 0){console.warn(`[bug-report-send] no desktop bridge; send cannot be dispatched`),f(t,{status:`failed`});return}let i=t.span.traceparent();p(t,await r.send({zipPath:n.zipPath,metadata:n.metadata,...n.includeScreenshot===void 0?{}:{includeScreenshot:n.includeScreenshot},...n.includeAttachments===void 0?{}:{includeAttachments:n.includeAttachments},...i===void 0?{}:{traceparent:i}}))}catch(e){console.warn(`[bug-report-send] IPC dispatch threw:`,e),f(t,{status:`failed`})}}return{startBugReportSend(e){let r=T(e,t),i=d(r.zipPath),a=n.get(i);if(a!==void 0)return a.input=r,h(a);let o={operationId:i,zipPath:r.zipPath,zipSizeBytes:r.zipSizeBytes,requestSeq:1},s={...o,input:r,fillTimer:null,state:{...o,status:`sending`,fillPercent:0},span:v};return n.set(i,s),m(s),s.state},retryBugReportSend(e){let t=n.get(e);t!==void 0&&h(t)},get(e){return n.get(e)?.state},getSnapshot(){return i??=[...n.values()].map(e=>e.state),i},subscribe(e){return r.add(e),()=>{r.delete(e)}}}}var D=E(()=>window.okDesktop?.bugReport);export{d as a,u as i,h as n,c as o,f as r,D as t};
1
+ import{$i as e,Mn as t,mi as n}from"./dist-CKA2_wgb.js";import{c as r,t as i}from"./trace-api-BP9dN1Hz.js";import{t as a}from"./propagation-api-DC5404fy.js";import{t as o}from"./createLucideIcon-B6ULg5PN.js";import{n as s}from"./contact-email-store-D9SgN2yN.js";var c=o(`mail`,[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]),l=`support@inkeep.com`;function u(e){return`mailto:${l}?subject=${encodeURIComponent(e)}`}function d(e){return e.split(/[\\/]/).pop()??e}function f(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:e>=1024?`${Math.max(1,Math.round(e/1024))} KB`:`${e} B`}var p=200,m=/^(?:#{1,6}|>)(?:[ \t]+|$)/;function h(r){if(typeof r==`string`)for(let i of r.split(/\r\n|\r|\n/)){let r=n(i);for(r=e(r).replace(/\s+/g,` `).trim();m.test(r);)r=r.replace(m,``).trim();if(r!==``)return t(r,p).trimEnd()}}var g=`open-knowledge-app`,_=`ok.bug-report.send.attempt`,v={traceparent:()=>void 0,end:()=>{}},y=v;function b(e={}){try{let t=i.getTracer(g).startSpan(_,{attributes:e});return t.isRecording()?x(t,i.setSpan(r,t)):(t.end(),y)}catch(e){return console.warn(`[bug-report-send-otel] span start failed:`,e instanceof Error?e:String(e)),y}}function x(e,t){let n=!1;return{traceparent(){try{let e={};return a.inject(t,e),e.traceparent}catch{return}},end(t,r){if(!n){n=!0;try{r&&e.setAttributes(r),e.setAttribute(`ok.bug_report.renderer_outcome`,t),e.end()}catch{}}}}}var S=200,C=3,w=.9;function T(e,t=s){if(e.kind===`history-row`){let{row:n}=e,r=t.getSnapshot().email;return{zipPath:n.zipPath,zipSizeBytes:n.zipBytes,metadata:{level:n.bundleLevel===`unknown`?`standard`:n.bundleLevel,systemWide:n.systemWide,projectSlug:n.projectSlug,...n.note===void 0?{}:{note:n.note},...r===null?{}:{email:r}}}}let{report:n,note:r,includeScreenshot:i,includeAttachments:a,email:o}=e;return{zipPath:n.zipPath,zipSizeBytes:n.zipSizeBytes,metadata:{level:n.summary.level,systemWide:n.summary.systemWide,projectSlug:n.summary.projectSlug,note:r,...o===void 0?{}:{email:o}},includeScreenshot:i,...a===void 0?{}:{includeAttachments:a}}}function E(e,t=s){let n=new Map,r=new Set,i=null;function a(){for(let e of r)try{e()}catch(e){console.warn(`[bug-report-send] subscriber threw:`,e)}}function o(e,t){e.state=t,i=null,a()}function c(e){return{operationId:e.operationId,zipPath:e.zipPath,zipSizeBytes:e.zipSizeBytes,requestSeq:e.requestSeq}}function l(e){e.fillTimer!==null&&(clearInterval(e.fillTimer),e.fillTimer=null)}function u(e){l(e);let t=Date.now();e.fillTimer=setInterval(()=>{if(e.state.status!==`sending`){l(e);return}let n=(Date.now()-t)/1e3,r=Math.min(w,1-Math.exp(-n/C)),i=Math.round(r*100);i!==e.state.fillPercent&&o(e,{...c(e),status:`sending`,fillPercent:i})},S)}function f(e,t){l(e),e.span.end(t.status===`email-draft`?`email-drafted`:t.status===`already-sending`?`joined`:t.status,{"ok.bug_report.request_seq":e.requestSeq}),o(e,{...c(e),...t})}function p(e,t){if(t.ok){f(e,{status:`sent`,reference:t.reference});return}if(t.reason===`email-draft`){f(e,{status:`email-draft`,mailtoUrl:t.fallback.mailtoUrl});return}if(t.reason===`send-in-flight`){f(e,{status:`already-sending`});return}f(e,{status:`failed`,mailtoUrl:t.fallback.mailtoUrl})}function m(e){e.span=b({"ok.bug_report.zip_bytes":e.input.zipSizeBytes,"ok.bug_report.include_screenshot":e.input.includeScreenshot===!0,"ok.bug_report.attempt":e.requestSeq}),o(e,{...c(e),status:`sending`,fillPercent:0}),u(e),g(e,e.input)}function h(e){return e.requestSeq+=1,e.state.status===`sending`?(o(e,{...c(e),status:`sending`,fillPercent:e.state.fillPercent}),e.state):(m(e),e.state)}async function g(t,n){try{let r=e();if(r===void 0){console.warn(`[bug-report-send] no desktop bridge; send cannot be dispatched`),f(t,{status:`failed`});return}let i=t.span.traceparent();p(t,await r.send({zipPath:n.zipPath,metadata:n.metadata,...n.includeScreenshot===void 0?{}:{includeScreenshot:n.includeScreenshot},...n.includeAttachments===void 0?{}:{includeAttachments:n.includeAttachments},...i===void 0?{}:{traceparent:i}}))}catch(e){console.warn(`[bug-report-send] IPC dispatch threw:`,e),f(t,{status:`failed`})}}return{startBugReportSend(e){let r=T(e,t),i=d(r.zipPath),a=n.get(i);if(a!==void 0)return a.input=r,h(a);let o={operationId:i,zipPath:r.zipPath,zipSizeBytes:r.zipSizeBytes,requestSeq:1},s={...o,input:r,fillTimer:null,state:{...o,status:`sending`,fillPercent:0},span:v};return n.set(i,s),m(s),s.state},retryBugReportSend(e){let t=n.get(e);t!==void 0&&h(t)},get(e){return n.get(e)?.state},getSnapshot(){return i??=[...n.values()].map(e=>e.state),i},subscribe(e){return r.add(e),()=>{r.delete(e)}}}}var D=E(()=>window.okDesktop?.bugReport);export{d as a,u as i,h as n,c as o,f as r,D as t};
@@ -1 +1 @@
1
- import{Fn as e,In as t}from"./dist-DyIzmB4e.js";var n={BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_APP_VERSION:`0.70.4`}?.VITE_APP_VERSION??`0.0.0-unknown`;function r(){return e({kind:`web`,runtimeVersion:n})}function i(){return t({kind:`web`,runtimeVersion:n})}export{r as n,i as r,n as t};
1
+ import{Fn as e,In as t}from"./dist-CKA2_wgb.js";var n={BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_APP_VERSION:`0.70.4`}?.VITE_APP_VERSION??`0.0.0-unknown`;function r(){return e({kind:`web`,runtimeVersion:n})}function i(){return t({kind:`web`,runtimeVersion:n})}export{r as n,i as r,n as t};
@@ -1,4 +1,4 @@
1
- import{t as e}from"./jsx-runtime-BUgB2tll.js";import{Br as t,Nn as n,Nr as r,Pr as i,Yn as a,oi as o,qn as s,ri as c,ui as l}from"./DocumentContext-qHxlPFgu.js";import{n as u,r as d}from"./dist-Nvb76hAm.js";import{t as f}from"./compiler-runtime-BfE3aGVn.js";import{t as p}from"./utils-CPqDy6Hr.js";import{t as m}from"./button-Cym3gapE.js";import{i as h,n as g,t as _}from"./tooltip-DttaCTqz.js";import{Bi as v,Bn as y,nr as b,tr as x,yr as S,zn as C}from"./dist-DyIzmB4e.js";import{n as w}from"./dist-CJhtNlOm2.js";import{t as T}from"./dist-Cr4-nBVI.js";import{i as ee}from"./local-menu-action-bus-4I1Xm40D.js";import{t as E}from"./createLucideIcon-B6ULg5PN.js";import{Et as D}from"./CodeMirrorPropInput-D-iWWvft.js";import{t as te}from"./x-CnGRb1ER.js";import{l as ne}from"./doc-hash-lEZL1-60.js";var O=E(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),k=f(),re=`var(--ok-comment-hue, rgb(37 99 235))`,ie={fill:.22,line:.7},ae={fill:.45,line:1},oe=.45;function A(e){return`color-mix(in srgb,${re} ${e*100}%,transparent)`}function se(e,t){let{fill:n,line:r}=t?ae:ie;return[`border-radius:2px`,`padding-bottom:1px`,...e.id===null?[]:[`cursor:pointer`],`background-color:${A(n)}`,`box-shadow:inset 0 -2px 0 ${A(r)}`,``].join(`;`)}function j(e){return e.map(e=>e.id??`·`).join(`|`)}function M(e){let t=null;for(let n of e)n.id!==null&&(t===null||n.to-n.from<t.to-t.from)&&(t=n);return t?.id??null}function N(e,t){return e.id===null||e.id===t}function ce(e,t=null){let n=[...e].filter(e=>e.from<e.to).sort((e,t)=>e.from-t.from||e.to-t.to||(e.id??``).localeCompare(t.id??``));if(n.length===0)return[];let r=[...new Set(n.flatMap(e=>[e.from,e.to]))].sort((e,t)=>e-t),i=[],a=null,o=()=>{if(a===null)return;let e=a.covering.find(e=>N(e,t));i.push({from:a.from,to:a.to,style:se(e??a.covering[0],e!==void 0),threadId:M(a.covering)}),a=null};for(let e=0;e<r.length-1;e++){let t=r[e],i=r[e+1],s=n.filter(e=>e.from<=t&&e.to>=i);if(s.length===0){o();continue}if(a!==null&&a.to===t&&j(a.covering)===j(s)){a.to=i;continue}o(),a={from:t,to:i,covering:s}}return o(),i}var P=`data-comment-reveal`;function F(e){return typeof CSS<`u`&&CSS.escape?CSS.escape(e):e}function I(e){return e===``?null:document.querySelector(`[data-testid="property-row"][data-key="${F(e)}"]`)}function le(e){let t=I(e);if(t===null)return null;let n=t.getBoundingClientRect();return n.height===0&&n.width===0?null:n}function ue(e){I(e)?.scrollIntoView({block:`center`,behavior:`smooth`})}function L(e){if(e.quote===``)return!1;let t=e.path.length===0?e.key:e.path[e.path.length-1],n=Array.from(document.querySelectorAll(`[data-testid="property-row"][data-key="${F(String(t))}"]`)),r=Array.from(document.querySelectorAll(`[data-testid="property-row"]`));for(let t of[...n,...r]){let n=t.querySelector(`textarea, input`);if(n===null)continue;let r=R(n.value,e.quote,e.start,e.end);if(r!==null)return t.scrollIntoView({block:`center`,behavior:`smooth`}),n.focus(),n.setSelectionRange(r.start,r.end),de(n),!0}return!1}function R(e,t,n,r){if(n!==void 0&&r!==void 0&&e.slice(n,r)===t)return{start:n,end:r};let i=e.indexOf(t);return i<0?null:{start:i,end:i+t.length}}function de(e){e.style.setProperty(`--comment-reveal-fill`,A(oe)),e.setAttribute(P,`true`);let t=()=>{e.removeAttribute(P),e.style.removeProperty(`--comment-reveal-fill`)};e.addEventListener(`blur`,t,{once:!0}),e.addEventListener(`pointerdown`,t,{once:!0}),e.addEventListener(`keydown`,t,{once:!0})}function z(e,{includeBlockComponents:t=!1}={}){let n=``,r=[];return e.descendants((e,i)=>{if(e.isText&&e.text){for(let t=0;t<e.text.length;t++)n+=e.text[t],r.push(i+t);return!0}if(e.isBlock&&!t)return!0;let a=C(e);if(a.length>0){let t=i+e.nodeSize-1;for(let e=0;e<a.length;e++)n+=a[e],r.push(e===a.length-1?t:i)}return!0}),{text:n,positions:r}}function fe(e,t){let n=[];if(t===``)return n;let r=e.indexOf(t);for(;r!==-1;)n.push(r),r=e.indexOf(t,r+1);return n}function B(e,t,n){let r=n?.prefix??``,i=n?.suffix??``;if(r===``&&i===``)return null;let a=r===``?[0]:S(e,r,{syntaxIn:`needle`}).map(e=>e.end),o=i===``?[e.length]:S(e,i,{syntaxIn:`needle`}).map(e=>e.start);if(a.length!==1||o.length!==1)return null;let s=a[0],c=o[0];for(;s<c&&/\s/.test(e[s]??``);)s+=1;for(;c>s&&/\s/.test(e[c-1]??``);)--c;if(c<=s)return null;let l=v(t.length);return c-s>l?null:{start:s,end:c}}function V(e,t){let n=e.positions[t.start],r=e.positions[t.end-1];return n==null||r==null?null:{from:n,to:r+1}}function H(e,t,n){if(t.length===0)return null;let r=fe(e.text,t).map(e=>({start:e,end:e+t.length}));if(r.length===0&&(r=S(e.text,t,{syntaxIn:`needle`})),r.length===0){let r=B(e.text,t,n);return r===null?null:V(e,r)}let i=n?.prefix??``,a=n?.suffix??``,o=t=>e.text.includes(t)||S(e.text,t,{syntaxIn:`needle`}).length>0;if(i!==``&&a!==``&&!o(i+t+a)&&o(i+a))return null;let s=x({prefix:i,suffix:a},{syntaxInContext:!0}),c=t=>s===0||b(e.text,t,{prefix:i,suffix:a},{syntaxIn:`none`,syntaxInContext:!0})>=s;if(r.length===1){if(!c(r[0])){let r=B(e.text,t,n);return r===null?null:V(e,r)}return V(e,r[0])}let l=[],u=-1;for(let t of r){let n=b(e.text,t,{prefix:i,suffix:a},{syntaxIn:`none`,syntaxInContext:!0});n>u?(u=n,l=[t]):n===u&&l.push(t)}if(!c(l[0])){let r=B(e.text,t,n);return r===null?null:V(e,r)}return V(e,l[0])}var U=64;function pe(e,t,n){return{prefix:y(e,Math.max(0,t-U),t),suffix:y(e,n,Math.min(e.content.size,n+U))}}function W(e,t,n){return G(e)(t,n)}function G(e){let t=z(e),n=null;return(r,i)=>{let a=H(t,r,i);return a===null?(n??=z(e,{includeBlockComponents:!0}),H(n,r,i)):a}}var me=220,he=24;function ge(e){let t=e.viewTop+e.insetTop,n=e.viewBottom-me;return e.anchorTop>=t&&e.anchorBottom<=n?0:e.anchorTop-(t+he)}function K(e){let t=e?.parentElement??null;for(;t;){let e=getComputedStyle(t).overflowY;if(e===`auto`||e===`scroll`)return t;t=t.parentElement}return null}function q(e){let t=Number.parseFloat(getComputedStyle(e).scrollPaddingTop);return Number.isFinite(t)?t:0}function J(e,t,r,i){let a=D(e);if(!a)return!1;let o=K(a.dom);if(!o)return n(r,`comment-reveal`,()=>e.commands.scrollIntoView());let s,c;try{s=a.coordsAtPos(t.from),c=a.coordsAtPos(t.to)}catch{return!1}let l=o.getBoundingClientRect(),u=ge({anchorTop:s.top,anchorBottom:Math.max(s.bottom,c.bottom),viewTop:l.top,viewBottom:l.bottom,insetTop:q(o)});if(u===0)return!0;let d=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;return n(r,`comment-reveal`,()=>o.scrollTo({top:o.scrollTop+u,behavior:i?.instant||d?`auto`:`smooth`}))}var _e=1e4,Y=80,ve=1500,X=[`wheel`,`touchstart`,`mousedown`,`keydown`];function ye(e){let t=!1,n=null,o=null,c=-1,u=()=>{let a=s(e.docName);if(!a||a.isDestroyed)return!1;if(t||(t=!0,r(e.threadId)),e.quote===``)return n===null&&(n=Date.now(),i(e.threadId)),!0;let l=a.state.doc.content.size;return(o===null||l!==c)&&(o=W(a.state.doc,e.quote,e.context),c=l),!o||!J(a,o,e.docName,{instant:!0})?!1:(n===null&&(n=Date.now(),i(e.threadId)),!0)};l(`comments`),u(),s(e.docName)===null&&window.location.assign(ne(e.docName));let d=!1,f=()=>{if(!d){d=!0,h(),window.clearInterval(g),window.clearTimeout(_);for(let e of X)window.removeEventListener(e,p,!0)}},p=()=>f(),m=()=>{u()&&n!==null&&Date.now()-n>=ve&&f()},h=a(m),g=window.setInterval(m,Y),_=window.setTimeout(()=>{n===null&&w.error(t?T._({id:`KeXgA-`}):T._({id:`JDQ5I5`})),f()},_e);for(let e of X)window.addEventListener(e,p,!0);m()}var Z=e();function be(){return c().length}function xe(){let e=(0,k.c)(4),n=c(),r;if(e[0]!==n){r=new Map;for(let e of n){let n=t(e)?.docName;n!==void 0&&r.set(n,(r.get(n)??0)+1)}e[0]=n,e[1]=r}else r=e[1];let i;return e[2]===r?i=e[3]:(i=[...r].map(Se),e[2]=r,e[3]=i),i}function Se(e){let[t,n]=e;return{docName:t,count:n}}function Ce(e){let t=(0,k.c)(34),{count:n,docs:r,attached:i,onAttach:a,onDismiss:o}=e,s;t[0]===r?s=t[1]:(s=r===void 0?[]:r,t[0]=r,t[1]=s);let c=s,{_:l}=d();if(n===0)return null;if(!i){let e;t[2]===l?e=t[3]:(e=l({id:`UpOct_`}),t[2]=l,t[3]=e);let n,r,i;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(n=p(`h-auto min-h-0 gap-1 rounded-md border border-dashed bg-transparent px-1.5 py-0.5`,`text-xs font-normal text-muted-foreground hover:bg-muted/60 hover:text-foreground`),r=(0,Z.jsx)(ee,{className:`size-3`}),i=(0,Z.jsx)(u,{id:`VbyRUy`}),t[4]=n,t[5]=r,t[6]=i):(n=t[4],r=t[5],i=t[6]);let o;return t[7]!==a||t[8]!==e?(o=(0,Z.jsxs)(m,{type:`button`,size:`sm`,variant:`ghost`,"aria-pressed":!1,"aria-label":e,onClick:a,"data-testid":`composer-context-chip-comments`,className:n,children:[r,i]}),t[7]=a,t[8]=e,t[9]=o):o=t[9],o}let f;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(f=p(`inline-flex items-center gap-1 rounded-md border bg-muted/60 py-0.5 pr-0.5 pl-1.5`,`text-xs text-muted-foreground`),t[10]=f):f=t[10];let v;t[11]===l?v=t[12]:(v=l({id:`2zvUIK`}),t[11]=l,t[12]=v);let y;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Z.jsx)(O,{className:`size-3`}),t[13]=y):y=t[13];let b;t[14]!==n||t[15]!==c.length?(b=c.length>1?(0,Z.jsx)(u,{id:`5TmrYN`,values:{0:c.length,count:n}}):(0,Z.jsx)(u,{id:`eiUA4k`,values:{count:n}}),t[14]=n,t[15]=c.length,t[16]=b):b=t[16];let x;t[17]!==v||t[18]!==b?(x=(0,Z.jsx)(h,{asChild:!0,children:(0,Z.jsxs)(m,{type:`button`,size:`sm`,variant:`ghost`,"aria-label":v,onClick:Te,"data-testid":`composer-comments-open-panel`,className:`h-auto min-h-0 gap-1 px-0.5 py-0 text-xs font-normal text-muted-foreground hover:text-foreground`,children:[y,b]})}),t[17]=v,t[18]=b,t[19]=x):x=t[19];let S;t[20]===c?S=t[21]:(S=(0,Z.jsx)(g,{className:`max-w-64`,children:c.length>1?(0,Z.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:c.map(we)}):(0,Z.jsx)(u,{id:`2zvUIK`})}),t[20]=c,t[21]=S);let C;t[22]!==x||t[23]!==S?(C=(0,Z.jsxs)(_,{children:[x,S]}),t[22]=x,t[23]=S,t[24]=C):C=t[24];let w;t[25]===l?w=t[26]:(w=l({id:`pFRz_E`}),t[25]=l,t[26]=w);let T;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,Z.jsx)(te,{className:`size-3`}),t[27]=T):T=t[27];let E;t[28]!==o||t[29]!==w?(E=(0,Z.jsx)(m,{type:`button`,size:`sm`,variant:`ghost`,"aria-label":w,onClick:o,className:`size-4 p-0 text-muted-foreground hover:text-foreground`,children:T}),t[28]=o,t[29]=w,t[30]=E):E=t[30];let D;return t[31]!==E||t[32]!==C?(D=(0,Z.jsxs)(`span`,{"data-testid":`composer-context-chip-comments`,className:f,children:[C,E]}),t[31]=E,t[32]=C,t[33]=D):D=t[33],D}function we(e){return(0,Z.jsxs)(`li`,{className:`flex items-baseline gap-1.5`,children:[(0,Z.jsx)(`span`,{className:`tabular-nums`,children:e.count}),(0,Z.jsx)(`span`,{className:`truncate`,children:Q(e.docName)})]},e.docName)}function Te(){return o()}function Q(e){let t=e.lastIndexOf(`/`);return t>=0?e.slice(t+1):e}function Ee(e,t){let n=e;for(let e of t)n+=typeof e==`number`?`[${e}]`:`.${e}`;return n}function De(e){ye({docName:e.docName,quote:e.target.kind===`property`?``:e.anchor?.quote??``,threadId:e.id,context:e.anchor??void 0});let{target:t,anchor:n}=e;if(t.kind!==`property`||n===null)return;let r=0,i=()=>{L({key:t.key,path:t.path,quote:n.quote,start:n.start,end:n.end})||(r+=1,!(r>=Oe)&&requestAnimationFrame(i))};requestAnimationFrame(i)}var Oe=30;function ke(e){return{docName:e.docName,body:e.instruction,propertyKey:e.property,quote:e.passage?.exact??``,anchorLost:e.anchorLost,prefix:e.passage?.prefix??``,suffix:e.passage?.suffix??``,repeats:e.passageRepeats}}var $=48;function Ae(e){let t=e.replace(/\s+/g,` `).trimStart();return t.length>$?`…${t.slice(-$)}`:t}function je(e){let t=e.replace(/\s+/g,` `).trimEnd();return t.length>$?`${t.slice(0,$)}…`:t}function Me(e){if(!e.repeats)return null;let t=Ae(e.prefix),n=je(e.suffix);return t===``&&n===``?null:`(This text appears more than once in the file. The one meant is ${t===``?`at the start of the file, followed by "${n}"`:n===``?`at the end of the file, preceded by "${t}"`:`between "${t}" and "${n}"`} — match that context rather than the first occurrence.)`}function Ne(e,t,n){let r=t.trim(),i=[];if(i.push(r.length>0?r:`Address the following review comments by editing the documents directly.`),i.push(``),i.push(e.length===1?`The comment:`:`The ${e.length} comments:`),e.forEach((e,t)=>{if(i.push(``),e.propertyKey){let n=e.quote.trim();if(n===``)i.push(`${t+1}. In \`${e.docName}\`, on the \`${e.propertyKey}\` property (frontmatter):`),i.push(``),i.push(` ${e.body.trim()}`);else{i.push(`${t+1}. In \`${e.docName}\`, on this text within the \`${e.propertyKey}\` property (frontmatter):`),i.push(``);for(let e of n.split(`
1
+ import{t as e}from"./jsx-runtime-BUgB2tll.js";import{Br as t,Nn as n,Nr as r,Pr as i,Yn as a,oi as o,qn as s,ri as c,ui as l}from"./DocumentContext-BAxdqFVX.js";import{n as u,r as d}from"./dist-Nvb76hAm.js";import{t as f}from"./compiler-runtime-BfE3aGVn.js";import{t as p}from"./utils-CPqDy6Hr.js";import{t as m}from"./button-Cym3gapE.js";import{i as h,n as g,t as _}from"./tooltip-DttaCTqz.js";import{Bn as v,Ui as y,nr as b,tr as x,yr as S,zn as C}from"./dist-CKA2_wgb.js";import{n as w}from"./dist-CJhtNlOm2.js";import{t as T}from"./dist-Cr4-nBVI.js";import{i as ee}from"./local-menu-action-bus-4I1Xm40D.js";import{t as E}from"./createLucideIcon-B6ULg5PN.js";import{Et as D}from"./CodeMirrorPropInput-DE3arJ1h.js";import{t as te}from"./x-CnGRb1ER.js";import{l as ne}from"./doc-hash-BwLoJO7y.js";var O=E(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),k=f(),re=`var(--ok-comment-hue, rgb(37 99 235))`,ie={fill:.22,line:.7},ae={fill:.45,line:1},oe=.45;function A(e){return`color-mix(in srgb,${re} ${e*100}%,transparent)`}function se(e,t){let{fill:n,line:r}=t?ae:ie;return[`border-radius:2px`,`padding-bottom:1px`,...e.id===null?[]:[`cursor:pointer`],`background-color:${A(n)}`,`box-shadow:inset 0 -2px 0 ${A(r)}`,``].join(`;`)}function j(e){return e.map(e=>e.id??`·`).join(`|`)}function M(e){let t=null;for(let n of e)n.id!==null&&(t===null||n.to-n.from<t.to-t.from)&&(t=n);return t?.id??null}function N(e,t){return e.id===null||e.id===t}function ce(e,t=null){let n=[...e].filter(e=>e.from<e.to).sort((e,t)=>e.from-t.from||e.to-t.to||(e.id??``).localeCompare(t.id??``));if(n.length===0)return[];let r=[...new Set(n.flatMap(e=>[e.from,e.to]))].sort((e,t)=>e-t),i=[],a=null,o=()=>{if(a===null)return;let e=a.covering.find(e=>N(e,t));i.push({from:a.from,to:a.to,style:se(e??a.covering[0],e!==void 0),threadId:M(a.covering)}),a=null};for(let e=0;e<r.length-1;e++){let t=r[e],i=r[e+1],s=n.filter(e=>e.from<=t&&e.to>=i);if(s.length===0){o();continue}if(a!==null&&a.to===t&&j(a.covering)===j(s)){a.to=i;continue}o(),a={from:t,to:i,covering:s}}return o(),i}var P=`data-comment-reveal`;function F(e){return typeof CSS<`u`&&CSS.escape?CSS.escape(e):e}function I(e){return e===``?null:document.querySelector(`[data-testid="property-row"][data-key="${F(e)}"]`)}function le(e){let t=I(e);if(t===null)return null;let n=t.getBoundingClientRect();return n.height===0&&n.width===0?null:n}function ue(e){I(e)?.scrollIntoView({block:`center`,behavior:`smooth`})}function L(e){if(e.quote===``)return!1;let t=e.path.length===0?e.key:e.path[e.path.length-1],n=Array.from(document.querySelectorAll(`[data-testid="property-row"][data-key="${F(String(t))}"]`)),r=Array.from(document.querySelectorAll(`[data-testid="property-row"]`));for(let t of[...n,...r]){let n=t.querySelector(`textarea, input`);if(n===null)continue;let r=R(n.value,e.quote,e.start,e.end);if(r!==null)return t.scrollIntoView({block:`center`,behavior:`smooth`}),n.focus(),n.setSelectionRange(r.start,r.end),de(n),!0}return!1}function R(e,t,n,r){if(n!==void 0&&r!==void 0&&e.slice(n,r)===t)return{start:n,end:r};let i=e.indexOf(t);return i<0?null:{start:i,end:i+t.length}}function de(e){e.style.setProperty(`--comment-reveal-fill`,A(oe)),e.setAttribute(P,`true`);let t=()=>{e.removeAttribute(P),e.style.removeProperty(`--comment-reveal-fill`)};e.addEventListener(`blur`,t,{once:!0}),e.addEventListener(`pointerdown`,t,{once:!0}),e.addEventListener(`keydown`,t,{once:!0})}function z(e,{includeBlockComponents:t=!1}={}){let n=``,r=[];return e.descendants((e,i)=>{if(e.isText&&e.text){for(let t=0;t<e.text.length;t++)n+=e.text[t],r.push(i+t);return!0}if(e.isBlock&&!t)return!0;let a=C(e);if(a.length>0){let t=i+e.nodeSize-1;for(let e=0;e<a.length;e++)n+=a[e],r.push(e===a.length-1?t:i)}return!0}),{text:n,positions:r}}function fe(e,t){let n=[];if(t===``)return n;let r=e.indexOf(t);for(;r!==-1;)n.push(r),r=e.indexOf(t,r+1);return n}function B(e,t,n){let r=n?.prefix??``,i=n?.suffix??``;if(r===``&&i===``)return null;let a=r===``?[0]:S(e,r,{syntaxIn:`needle`}).map(e=>e.end),o=i===``?[e.length]:S(e,i,{syntaxIn:`needle`}).map(e=>e.start);if(a.length!==1||o.length!==1)return null;let s=a[0],c=o[0];for(;s<c&&/\s/.test(e[s]??``);)s+=1;for(;c>s&&/\s/.test(e[c-1]??``);)--c;if(c<=s)return null;let l=y(t.length);return c-s>l?null:{start:s,end:c}}function V(e,t){let n=e.positions[t.start],r=e.positions[t.end-1];return n==null||r==null?null:{from:n,to:r+1}}function H(e,t,n){if(t.length===0)return null;let r=fe(e.text,t).map(e=>({start:e,end:e+t.length}));if(r.length===0&&(r=S(e.text,t,{syntaxIn:`needle`})),r.length===0){let r=B(e.text,t,n);return r===null?null:V(e,r)}let i=n?.prefix??``,a=n?.suffix??``,o=t=>e.text.includes(t)||S(e.text,t,{syntaxIn:`needle`}).length>0;if(i!==``&&a!==``&&!o(i+t+a)&&o(i+a))return null;let s=x({prefix:i,suffix:a},{syntaxInContext:!0}),c=t=>s===0||b(e.text,t,{prefix:i,suffix:a},{syntaxIn:`none`,syntaxInContext:!0})>=s;if(r.length===1){if(!c(r[0])){let r=B(e.text,t,n);return r===null?null:V(e,r)}return V(e,r[0])}let l=[],u=-1;for(let t of r){let n=b(e.text,t,{prefix:i,suffix:a},{syntaxIn:`none`,syntaxInContext:!0});n>u?(u=n,l=[t]):n===u&&l.push(t)}if(!c(l[0])){let r=B(e.text,t,n);return r===null?null:V(e,r)}return V(e,l[0])}var U=64;function pe(e,t,n){return{prefix:v(e,Math.max(0,t-U),t),suffix:v(e,n,Math.min(e.content.size,n+U))}}function W(e,t,n){return G(e)(t,n)}function G(e){let t=z(e),n=null;return(r,i)=>{let a=H(t,r,i);return a===null?(n??=z(e,{includeBlockComponents:!0}),H(n,r,i)):a}}var me=220,he=24;function ge(e){let t=e.viewTop+e.insetTop,n=e.viewBottom-me;return e.anchorTop>=t&&e.anchorBottom<=n?0:e.anchorTop-(t+he)}function K(e){let t=e?.parentElement??null;for(;t;){let e=getComputedStyle(t).overflowY;if(e===`auto`||e===`scroll`)return t;t=t.parentElement}return null}function q(e){let t=Number.parseFloat(getComputedStyle(e).scrollPaddingTop);return Number.isFinite(t)?t:0}function J(e,t,r,i){let a=D(e);if(!a)return!1;let o=K(a.dom);if(!o)return n(r,`comment-reveal`,()=>e.commands.scrollIntoView());let s,c;try{s=a.coordsAtPos(t.from),c=a.coordsAtPos(t.to)}catch{return!1}let l=o.getBoundingClientRect(),u=ge({anchorTop:s.top,anchorBottom:Math.max(s.bottom,c.bottom),viewTop:l.top,viewBottom:l.bottom,insetTop:q(o)});if(u===0)return!0;let d=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;return n(r,`comment-reveal`,()=>o.scrollTo({top:o.scrollTop+u,behavior:i?.instant||d?`auto`:`smooth`}))}var _e=1e4,Y=80,ve=1500,X=[`wheel`,`touchstart`,`mousedown`,`keydown`];function ye(e){let t=!1,n=null,o=null,c=-1,u=()=>{let a=s(e.docName);if(!a||a.isDestroyed)return!1;if(t||(t=!0,r(e.threadId)),e.quote===``)return n===null&&(n=Date.now(),i(e.threadId)),!0;let l=a.state.doc.content.size;return(o===null||l!==c)&&(o=W(a.state.doc,e.quote,e.context),c=l),!o||!J(a,o,e.docName,{instant:!0})?!1:(n===null&&(n=Date.now(),i(e.threadId)),!0)};l(`comments`),u(),s(e.docName)===null&&window.location.assign(ne(e.docName));let d=!1,f=()=>{if(!d){d=!0,h(),window.clearInterval(g),window.clearTimeout(_);for(let e of X)window.removeEventListener(e,p,!0)}},p=()=>f(),m=()=>{u()&&n!==null&&Date.now()-n>=ve&&f()},h=a(m),g=window.setInterval(m,Y),_=window.setTimeout(()=>{n===null&&w.error(t?T._({id:`KeXgA-`}):T._({id:`JDQ5I5`})),f()},_e);for(let e of X)window.addEventListener(e,p,!0);m()}var Z=e();function be(){return c().length}function xe(){let e=(0,k.c)(4),n=c(),r;if(e[0]!==n){r=new Map;for(let e of n){let n=t(e)?.docName;n!==void 0&&r.set(n,(r.get(n)??0)+1)}e[0]=n,e[1]=r}else r=e[1];let i;return e[2]===r?i=e[3]:(i=[...r].map(Se),e[2]=r,e[3]=i),i}function Se(e){let[t,n]=e;return{docName:t,count:n}}function Ce(e){let t=(0,k.c)(34),{count:n,docs:r,attached:i,onAttach:a,onDismiss:o}=e,s;t[0]===r?s=t[1]:(s=r===void 0?[]:r,t[0]=r,t[1]=s);let c=s,{_:l}=d();if(n===0)return null;if(!i){let e;t[2]===l?e=t[3]:(e=l({id:`UpOct_`}),t[2]=l,t[3]=e);let n,r,i;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(n=p(`h-auto min-h-0 gap-1 rounded-md border border-dashed bg-transparent px-1.5 py-0.5`,`text-xs font-normal text-muted-foreground hover:bg-muted/60 hover:text-foreground`),r=(0,Z.jsx)(ee,{className:`size-3`}),i=(0,Z.jsx)(u,{id:`VbyRUy`}),t[4]=n,t[5]=r,t[6]=i):(n=t[4],r=t[5],i=t[6]);let o;return t[7]!==a||t[8]!==e?(o=(0,Z.jsxs)(m,{type:`button`,size:`sm`,variant:`ghost`,"aria-pressed":!1,"aria-label":e,onClick:a,"data-testid":`composer-context-chip-comments`,className:n,children:[r,i]}),t[7]=a,t[8]=e,t[9]=o):o=t[9],o}let f;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(f=p(`inline-flex items-center gap-1 rounded-md border bg-muted/60 py-0.5 pr-0.5 pl-1.5`,`text-xs text-muted-foreground`),t[10]=f):f=t[10];let v;t[11]===l?v=t[12]:(v=l({id:`2zvUIK`}),t[11]=l,t[12]=v);let y;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Z.jsx)(O,{className:`size-3`}),t[13]=y):y=t[13];let b;t[14]!==n||t[15]!==c.length?(b=c.length>1?(0,Z.jsx)(u,{id:`5TmrYN`,values:{0:c.length,count:n}}):(0,Z.jsx)(u,{id:`eiUA4k`,values:{count:n}}),t[14]=n,t[15]=c.length,t[16]=b):b=t[16];let x;t[17]!==v||t[18]!==b?(x=(0,Z.jsx)(h,{asChild:!0,children:(0,Z.jsxs)(m,{type:`button`,size:`sm`,variant:`ghost`,"aria-label":v,onClick:Te,"data-testid":`composer-comments-open-panel`,className:`h-auto min-h-0 gap-1 px-0.5 py-0 text-xs font-normal text-muted-foreground hover:text-foreground`,children:[y,b]})}),t[17]=v,t[18]=b,t[19]=x):x=t[19];let S;t[20]===c?S=t[21]:(S=(0,Z.jsx)(g,{className:`max-w-64`,children:c.length>1?(0,Z.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:c.map(we)}):(0,Z.jsx)(u,{id:`2zvUIK`})}),t[20]=c,t[21]=S);let C;t[22]!==x||t[23]!==S?(C=(0,Z.jsxs)(_,{children:[x,S]}),t[22]=x,t[23]=S,t[24]=C):C=t[24];let w;t[25]===l?w=t[26]:(w=l({id:`pFRz_E`}),t[25]=l,t[26]=w);let T;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,Z.jsx)(te,{className:`size-3`}),t[27]=T):T=t[27];let E;t[28]!==o||t[29]!==w?(E=(0,Z.jsx)(m,{type:`button`,size:`sm`,variant:`ghost`,"aria-label":w,onClick:o,className:`size-4 p-0 text-muted-foreground hover:text-foreground`,children:T}),t[28]=o,t[29]=w,t[30]=E):E=t[30];let D;return t[31]!==E||t[32]!==C?(D=(0,Z.jsxs)(`span`,{"data-testid":`composer-context-chip-comments`,className:f,children:[C,E]}),t[31]=E,t[32]=C,t[33]=D):D=t[33],D}function we(e){return(0,Z.jsxs)(`li`,{className:`flex items-baseline gap-1.5`,children:[(0,Z.jsx)(`span`,{className:`tabular-nums`,children:e.count}),(0,Z.jsx)(`span`,{className:`truncate`,children:Q(e.docName)})]},e.docName)}function Te(){return o()}function Q(e){let t=e.lastIndexOf(`/`);return t>=0?e.slice(t+1):e}function Ee(e,t){let n=e;for(let e of t)n+=typeof e==`number`?`[${e}]`:`.${e}`;return n}function De(e){ye({docName:e.docName,quote:e.target.kind===`property`?``:e.anchor?.quote??``,threadId:e.id,context:e.anchor??void 0});let{target:t,anchor:n}=e;if(t.kind!==`property`||n===null)return;let r=0,i=()=>{L({key:t.key,path:t.path,quote:n.quote,start:n.start,end:n.end})||(r+=1,!(r>=Oe)&&requestAnimationFrame(i))};requestAnimationFrame(i)}var Oe=30;function ke(e){return{docName:e.docName,body:e.instruction,propertyKey:e.property,quote:e.passage?.exact??``,anchorLost:e.anchorLost,prefix:e.passage?.prefix??``,suffix:e.passage?.suffix??``,repeats:e.passageRepeats}}var $=48;function Ae(e){let t=e.replace(/\s+/g,` `).trimStart();return t.length>$?`…${t.slice(-$)}`:t}function je(e){let t=e.replace(/\s+/g,` `).trimEnd();return t.length>$?`${t.slice(0,$)}…`:t}function Me(e){if(!e.repeats)return null;let t=Ae(e.prefix),n=je(e.suffix);return t===``&&n===``?null:`(This text appears more than once in the file. The one meant is ${t===``?`at the start of the file, followed by "${n}"`:n===``?`at the end of the file, preceded by "${t}"`:`between "${t}" and "${n}"`} — match that context rather than the first occurrence.)`}function Ne(e,t,n){let r=t.trim(),i=[];if(i.push(r.length>0?r:`Address the following review comments by editing the documents directly.`),i.push(``),i.push(e.length===1?`The comment:`:`The ${e.length} comments:`),e.forEach((e,t)=>{if(i.push(``),e.propertyKey){let n=e.quote.trim();if(n===``)i.push(`${t+1}. In \`${e.docName}\`, on the \`${e.propertyKey}\` property (frontmatter):`),i.push(``),i.push(` ${e.body.trim()}`);else{i.push(`${t+1}. In \`${e.docName}\`, on this text within the \`${e.propertyKey}\` property (frontmatter):`),i.push(``);for(let e of n.split(`
2
2
  `))i.push(` > ${e}`);i.push(``),i.push(` ${e.body.trim()}`)}e.anchorLost&&(i.push(``),i.push(n===``?` (Note: \`${e.propertyKey}\` is no longer in this document's frontmatter — it was renamed or removed since the comment was written. Do not apply this to a different property; if you cannot tell what it now refers to, say so instead of guessing.)`:` (Note: that text is no longer in \`${e.propertyKey}\` — the value was edited, reshaped, or removed since the comment was written. Do not apply this to a different property or a different part of the value; if you cannot tell what it now refers to, say so instead of guessing.)`));return}i.push(`${t+1}. In \`${e.docName}\`, on this passage:`),i.push(``);for(let t of e.quote.split(`
3
3
  `))i.push(` > ${t}`);i.push(``),i.push(` ${e.body.trim()}`);let n=Me(e);n!==null&&(i.push(``),i.push(` ${n}`)),e.anchorLost&&(i.push(``),i.push(` (Note: this passage is no longer in the document — it was edited or removed since the comment was written. Do not apply this to a different passage; if you cannot tell what it now refers to, say so instead of guessing.)`))}),n&&n.markdown.trim().length>0){i.push(``),i.push(`Also in scope, selected in \`${n.docName}\` (not a comment):`),i.push(``);for(let e of n.markdown.trim().split(`
4
4
  `))i.push(`> ${e}`)}return i.join(`