@inkeep/open-knowledge 0.58.6 → 0.58.8
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/{acp-harness-probe-DEQm0Br1.mjs → acp-harness-probe-C2IHuVgy.mjs} +2 -2
- package/dist/cli.mjs +6 -6
- package/dist/constants-CaZ6pf_w.mjs +2 -0
- package/dist/fs-traced-C1nHpvFb.mjs +1 -0
- package/dist/{fs-traced-CJ0NSnI0.mjs → fs-traced-Dy67FR5_.mjs} +2 -2
- package/dist/git-handle-BPPRdjZZ.mjs +1 -0
- package/dist/{git-handle-DGgEJR3Q.mjs → git-handle-KDk0khh5.mjs} +3 -3
- package/dist/index.mjs +2 -2
- package/dist/{init-EhW5JPIO.mjs → init-097BT-JV.mjs} +3 -3
- package/dist/init-wif6tBNp.mjs +1 -0
- package/dist/{launch-json-removal-Chb0Mac8.mjs → launch-json-removal-CmteoVKJ.mjs} +2 -2
- package/dist/{loader-Cs_Rkp0K.mjs → loader-C7KxwdAY.mjs} +2 -2
- package/dist/loader-CihrsBwk.mjs +1 -0
- package/dist/md-manager-CdRw_aqi.mjs +2 -0
- package/dist/{open-browser-B-Kf-THH.mjs → open-browser-BklPlV75.mjs} +2 -2
- package/dist/parse-worker.mjs +1 -1
- package/dist/{preview-AQkB3qEL.mjs → preview-ByTvhfy1.mjs} +2 -2
- package/dist/preview-CbPgjt4U.mjs +1 -0
- package/dist/public/assets/{ActivityModeContent-7I3FAqNa.js → ActivityModeContent-BIn008__.js} +1 -1
- package/dist/public/assets/{AgentDiffPane-BQC85Rn1.js → AgentDiffPane-3GMOCb2c.js} +1 -1
- package/dist/public/assets/{AgentThreadClientBinder-q7HjbS_V.js → AgentThreadClientBinder-Di2dPu4h.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-Bf5PV704.js → CodeMirrorPropInput-BKSuOOVi.js} +1 -1
- package/dist/public/assets/{DocumentContext-YI07j2yc.js → DocumentContext-C-X4T4d9.js} +1 -1
- package/dist/public/assets/{EditorModeToggle-B3XSSPCP.js → EditorModeToggle-CPKSIpqP.js} +1 -1
- package/dist/public/assets/{EnableSyncConfirmDialog-DrBUTfFU.js → EnableSyncConfirmDialog-B9GQfDxa.js} +1 -1
- package/dist/public/assets/{ExcalidrawDocEditor-T3TL3VQu.js → ExcalidrawDocEditor-CiuG3mW7.js} +1 -1
- package/dist/public/assets/FeedbackForm-DYjADexF.js +1 -0
- package/dist/public/assets/{GraphPanel-B_Mg9p1O.js → GraphPanel-DT-1F3b4.js} +1 -1
- package/dist/public/assets/{ImportSkillDialog-B5zHicwe.js → ImportSkillDialog-d6lkfU9h.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-D5Dg5HLZ.js → LintConfigEditor-BEaCP-Xa.js} +1 -1
- package/dist/public/assets/{ManagedArtifactProperties-WOaAexG2.js → ManagedArtifactProperties-CI77JvTy.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-RawOG82I.js +1 -0
- package/dist/public/assets/{MermaidDocEditor-CwD8mOHB.js → MermaidDocEditor-3Qy_xxrY.js} +1 -1
- package/dist/public/assets/{PropertyDisplayRow-CKXJ3p74.js → PropertyDisplayRow-jv0QSvvc.js} +1 -1
- package/dist/public/assets/{ReportBugDialogBody-CVQgnZSP.js → ReportBugDialogBody-CD42zSIE.js} +1 -1
- package/dist/public/assets/{SchemaConfigEditor-kvdPUUAX.js → SchemaConfigEditor-DRPb60r3.js} +1 -1
- package/dist/public/assets/{SessionsHost-x_FfXVKL.js → SessionsHost-0wztntvc.js} +2 -2
- package/dist/public/assets/{SettingsDialogBody-CgHSjRrN.js → SettingsDialogBody-CguEJilL.js} +2 -2
- package/dist/public/assets/{ShareBranchSwitchDialog-DIQmuIkz.js → ShareBranchSwitchDialog-DD3l5H06.js} +1 -1
- package/dist/public/assets/{ShareReceiveDialog-BWuqWxsw.js → ShareReceiveDialog-D5BGQzdA.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-DBLKwZ22.js → ShareReceiveMissDialog-QiuppiTF.js} +1 -1
- package/dist/public/assets/{SkillCostValue-6xiHOBnl.js → SkillCostValue-D8ebP6Zc.js} +1 -1
- package/dist/public/assets/{SkillEditBanner-BqzwArWv.js → SkillEditBanner-BkzopHHR.js} +1 -1
- package/dist/public/assets/{SkillInstallMenu-BXOomxqv.js → SkillInstallMenu-B7luagyu.js} +1 -1
- package/dist/public/assets/{SkillOriginInline-B1B3kTSz.js → SkillOriginInline-BvpULx0r.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-NUcxAczC.js → SkillToolbarControls-Dzsdm7PA.js} +1 -1
- package/dist/public/assets/{SlidesToolbarControls-BZvu5Syj.js → SlidesToolbarControls-CoX9pn5-.js} +1 -1
- package/dist/public/assets/{SourceEditor-DYdjbyzp.js → SourceEditor-QZM8qnoP.js} +1 -1
- package/dist/public/assets/{TerminalPanel-DkxYnA6s.js → TerminalPanel-gvD8j_Io.js} +1 -1
- package/dist/public/assets/{TerminalWindowApp-CEKKfG52.js → TerminalWindowApp-CAceqDR9.js} +1 -1
- package/dist/public/assets/{TextDocEditor-CaNNKmLz.js → TextDocEditor-tkRGKEq5.js} +1 -1
- package/dist/public/assets/ThreadView-BMvSxzC4.js +14 -0
- package/dist/public/assets/{TimelineDiffPane-yi7kMXSo.js → TimelineDiffPane-DDkbig_i.js} +1 -1
- package/dist/public/assets/{agent-diff-store-SkFUI7rS.js → agent-diff-store-kz-Y8I6f.js} +1 -1
- package/dist/public/assets/{auth-state-cache-DbD6wjBD.js → auth-state-cache-CXBlrCdD.js} +2 -2
- package/dist/public/assets/client-version-B1ECEFiM.js +1 -0
- package/dist/public/assets/{comment-chips-DiZPWTPl.js → comment-chips-ZBz8P1qB.js} +1 -1
- package/dist/public/assets/{config-provider-USxiO_wH.js → config-provider-j9ER9l4W.js} +3 -3
- package/dist/public/assets/{dist-DGemBD_J.js → dist-7P3QNiAv.js} +2 -2
- package/dist/public/assets/{doc-paths-BkpejoFL.js → doc-paths-DPQCXAM6.js} +1 -1
- package/dist/public/assets/{documents-events-B2g_1xMi.js → documents-events-DSYMSbrh.js} +1 -1
- package/dist/public/assets/{file-tree-adapter-Bo3rGytc.js → file-tree-adapter-DWQqMzJU.js} +1 -1
- package/dist/public/assets/{file-tree-utils-CzXn1zjH.js → file-tree-utils-CCGJg4dv.js} +1 -1
- package/dist/public/assets/{folder-config-api-DPWmRi8a.js → folder-config-api-BFcRWayL.js} +1 -1
- package/dist/public/assets/{follow-file-DWqYp0pE.js → follow-file-DInAFQK_.js} +2 -2
- package/dist/public/assets/globals-DZLrtRra.css +1 -0
- package/dist/public/assets/i18n-8WVAXtMP.js +1 -0
- package/dist/public/assets/{index-C6Xk875v.js → index-CW5V3fEN.js} +8 -8
- package/dist/public/assets/{lint-config-client-sK38eqbj.js → lint-config-client-D0R0SOyp.js} +1 -1
- package/dist/public/assets/{markdownlint-rule-browser-T68WxSIo.js → markdownlint-rule-browser-C-ng_hpW.js} +1 -1
- package/dist/public/assets/{messages-D2-S61MT.js → messages-B1AtMu4g.js} +1 -1
- package/dist/public/assets/{messages-CgyRKo5g.js → messages-BOin2R2m.js} +1 -1
- package/dist/public/assets/{messages-Cdv9hd10.js → messages-BSAPNWhz.js} +1 -1
- package/dist/public/assets/{messages-Fy0K5qZm.js → messages-CHMN5vzg.js} +1 -1
- package/dist/public/assets/{messages-BFlTGREq.js → messages-CVdYp7oq.js} +1 -1
- package/dist/public/assets/{messages-Daexf5KZ.js → messages-CrhnZzfX.js} +1 -1
- package/dist/public/assets/{messages-D_5Iek_V.js → messages-D1a_S47U.js} +1 -1
- package/dist/public/assets/{messages-BP5GGrRC.js → messages-D7G9yvga.js} +1 -1
- package/dist/public/assets/{messages-BN7zDSVo.js → messages-DFzggSxO.js} +1 -1
- package/dist/public/assets/{messages-DQkd1f5c.js → messages-DQUtt-5a.js} +1 -1
- package/dist/public/assets/{messages-D13EOsYw.js → messages-QRz1xKWv.js} +1 -1
- package/dist/public/assets/{messages-DvC9XHhc.js → messages-ugbFvlbF.js} +1 -1
- package/dist/public/assets/{navigation-targets-D6rHX3Pq.js → navigation-targets-BI4fIUSN.js} +1 -1
- package/dist/public/assets/{open-managed-artifact-tab-ENQgQOde.js → open-managed-artifact-tab-DUwaeWfA.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-BaBTyiLf.js → pending-receive-nav-store-Crc_XCGA.js} +1 -1
- package/dist/public/assets/{prop-types-CizsurD0.js → prop-types-tU6-fOmD.js} +1 -1
- package/dist/public/assets/{receive-store-DHalgzeU.js → receive-store-BzLz5gZK.js} +1 -1
- package/dist/public/assets/{selection-context-DV36ssJQ.js → selection-context-CnpF-Ed9.js} +1 -1
- package/dist/public/assets/{skill-actions-ayyLVAw5.js → skill-actions-BdLNV2ET.js} +1 -1
- package/dist/public/assets/{skill-scope-gUkJkFRO.js → skill-scope-CRZYtnmj.js} +1 -1
- package/dist/public/assets/{skills-api-DO54o34O.js → skills-api-DT1cIHsu.js} +1 -1
- package/dist/public/assets/{src-B3OD2BqU.js → src-BHnBKao9.js} +1 -1
- package/dist/public/assets/{tag-pill-input-D2qVy9HA.js → tag-pill-input-Bcant_jp.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-BqElNT05.js → target-navigation-intent-Bd_1P8q5.js} +1 -1
- package/dist/public/assets/{telemetry-impl-DhefnhPq.js → telemetry-impl-u08eIZFn.js} +1 -1
- package/dist/public/assets/{telemetry-startup--1E51CEj.js → telemetry-startup-PYGQzY-J.js} +1 -1
- package/dist/public/assets/{terminal-cli-display-BTQdEy1j.js → terminal-cli-display-Dcm1esjR.js} +1 -1
- package/dist/public/assets/{terminal-launch-events-DNmxO4ft.js → terminal-launch-events-D8ytCf2E.js} +1 -1
- package/dist/public/assets/{terminal-telemetry-BC3JNC05.js → terminal-telemetry-LPAWl6sJ.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-cZASYUag.js → typing-burst-detector-MvNJwskd.js} +1 -1
- package/dist/public/assets/{uninstall-D9_hPyyW.js → uninstall-ACcONsCi.js} +1 -1
- package/dist/public/assets/{use-activity-panel-Drw3hRT0.js → use-activity-panel-DO4-UumZ.js} +1 -1
- package/dist/public/assets/{use-apply-config-color-theme-DZRctrdg.js → use-apply-config-color-theme-DpUYtbRe.js} +1 -1
- package/dist/public/assets/{use-collab-url-B7oEo69p.js → use-collab-url-B1V6TiLU.js} +1 -1
- package/dist/public/assets/{use-live-xterm-theme-C1EtEd_i.js → use-live-xterm-theme-DYp4WjiU.js} +1 -1
- package/dist/public/assets/{use-open-skill-C-OW-Q9z.js → use-open-skill-8o6IZoY2.js} +1 -1
- package/dist/public/assets/{use-popular-skills-BIvBkMNA.js → use-popular-skills-CC2urVQ6.js} +1 -1
- package/dist/public/assets/{use-settings-route-BrzzIll2.js → use-settings-route-DYSuZnve.js} +1 -1
- package/dist/public/assets/{use-skill-origin-FTbTIS5Y.js → use-skill-origin-Cd9ipAH-.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-CSNDVdz8.js → use-terminal-enabled-pw2WV2qk.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-DGCq_9Hl.js → use-timeline-entry-diff-B3StRSt9.js} +1 -1
- package/dist/public/assets/{use-workspace-8Sxb8Z6Q.js → use-workspace-BP0fuu9O.js} +1 -1
- package/dist/public/index.html +48 -48
- package/dist/public/uninstall.html +6 -6
- package/dist/{repair-launch-json-76uIe_qp.mjs → repair-launch-json-BSlvdEhG.mjs} +2 -2
- package/dist/{repair-mcp-configs-DCGK6f2H.mjs → repair-mcp-configs-MWY28hax.mjs} +2 -2
- package/dist/{repair-skills-CI9y4QbJ.mjs → repair-skills-BoMh5uOr.mjs} +2 -2
- package/dist/repair-skills-D3qrrU25.mjs +1 -0
- package/dist/{resolve-project-root-CRcZU2OU.mjs → resolve-project-root-DpSmoodv.mjs} +2 -2
- package/dist/{server-lock-BmwIVWMl.mjs → server-lock-CSO3K0Ok.mjs} +2 -2
- package/dist/server-lock-D_MF6GOb.mjs +1 -0
- package/dist/{skill-teardown-DLV1OiQx.mjs → skill-teardown-D66Xjjil.mjs} +2 -2
- package/dist/{sleep-B416PNUo.mjs → sleep-CEs13Om_.mjs} +2 -2
- package/dist/src-8LdfqLwC.mjs +2029 -0
- package/dist/{src-oUs-bI25.mjs → src-BZ35NJ2E.mjs} +2 -2
- package/dist/{src-BxdlvOrw.mjs → src-BimG4LM6.mjs} +3 -3
- package/dist/src-D_5cigYC.mjs +1 -0
- package/dist/{src-DCqESfWX.mjs → src-DorV8gmN.mjs} +1 -1
- package/dist/{start-fPBBfex-.mjs → start-BCpGrVds.mjs} +4 -4
- package/dist/start-C7xEQnkW.mjs +1 -0
- package/dist/{ui-DZeKrf4E.mjs → ui-DRrmB9yI.mjs} +3 -3
- package/package.json +4 -4
- package/dist/constants-DvdDvomC.mjs +0 -2
- package/dist/fs-traced-Bmqe7SqT.mjs +0 -1
- package/dist/git-handle-CNjG3dz9.mjs +0 -1
- package/dist/init-BVDvLU9L.mjs +0 -1
- package/dist/loader-Cv3I0nwf.mjs +0 -1
- package/dist/md-manager-30E0O9b-.mjs +0 -2
- package/dist/preview-MbWqxt0X.mjs +0 -1
- package/dist/public/assets/FeedbackForm-bekuqqT1.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-DXXsE5wd.js +0 -1
- package/dist/public/assets/ThreadView-Bt_MQTAE.js +0 -14
- package/dist/public/assets/client-version-p4OJ2Mf5.js +0 -1
- package/dist/public/assets/globals-CStTfhCT.css +0 -1
- package/dist/public/assets/i18n-DLbGfWG4.js +0 -1
- package/dist/repair-skills-QaEJT3NL.mjs +0 -1
- package/dist/server-lock-e6dYuoeq.mjs +0 -1
- package/dist/src-Bv3AQs0Q.mjs +0 -1
- package/dist/src-_fp0S8Pp.mjs +0 -2029
- package/dist/start-o40el4J9.mjs +0 -1
- /package/dist/public/assets/{globals-tNjN0wSq.js → globals-CQk8qCgW.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e}from"./chunk-DTipWd-i.mjs";import{K as t,pt as n,q as r}from"./sleep-
|
|
1
|
+
import{o as e}from"./chunk-DTipWd-i.mjs";import{K as t,pt as n,q as r}from"./sleep-CEs13Om_.mjs";import{bc as i,ho as a,it as o,rt as s,yc as c}from"./src-BimG4LM6.mjs";import{Oi as l,ai as u,at as d,it as f,ot as p,rt as m,zn as h}from"./src-8LdfqLwC.mjs";import{D as ee,F as g,I as _,k as v}from"./fs-traced-Dy67FR5_.mjs";import{C as y,S as b,_ as x,d as S}from"./server-lock-CSO3K0Ok.mjs";import{t as C}from"./yazl-DZr4PyKA.mjs";import{b as w,h as te,m as ne}from"./resolve-project-root-DpSmoodv.mjs";import{c as re}from"./colors-BsmVIwfM.mjs";import{n as ie}from"./acp-harness-probe-C2IHuVgy.mjs";import{E as T,T as E,_ as ae,b as D,o as O,w as k,x as oe}from"./init-097BT-JV.mjs";import{n as se}from"./constants-CaZ6pf_w.mjs";import{t as A}from"./is-object-ByG7RnjH.mjs";import"./loader-C7KxwdAY.mjs";import"./skill-teardown-D66Xjjil.mjs";import"./preview-ByTvhfy1.mjs";import{execSync as ce,spawnSync as j}from"node:child_process";import{basename as M,dirname as N,join as P,relative as le,resolve as F,sep as ue}from"node:path";import{cpSync as de,createWriteStream as fe,existsSync as I,lstatSync as pe,mkdirSync as L,mkdtempSync as me,readFileSync as R,readdirSync as z,readlinkSync as he,rmSync as B,statSync as ge,writeFileSync as V}from"node:fs";import{arch as _e,freemem as ve,homedir as H,hostname as ye,platform as be,release as xe,tmpdir as Se,totalmem as Ce,type as we,uptime as Te}from"node:os";import"node:fs/promises";import{createHash as Ee}from"node:crypto";var U=n();const De=new Set([`start`,`stop`,`status`,`clean`,`ui`,`mcp`,`preview`,`lint`,`deinit`,`auth`]);function Oe(e,t,n=h){if(e!==void 0&&!De.has(e))return null;let r=n(t);return r===null||r.distance===0?null:r.rootPath}let ke=null;function Ae(e){ke=e}function je(){return ke??process.cwd()}function Me(){return P(H(),`.ok`,`bug-reports`)}function Ne(e=new Date){let t=e.toISOString().replace(/[:.]/g,`-`),n=Me(),r=`${t}-bugreport`,i=P(n,`${r}.zip`);for(let e=2;I(i);e+=1)i=P(n,`${r}-${e}.zip`);return i}function Pe(e,t){let n=P(e,`.ok`,`config.yml`);if(I(n))try{let e=R(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 I(P(e,`.ok`))?Ee(`sha256`).update(F(e)).digest(`hex`).slice(0,12):null}function Fe(){let e={timestamp:new Date().toISOString(),platform:be(),osType:we(),osRelease:xe(),hostname:`[redacted]`,uptime:Te(),freeMem:ve(),totalMem:Ce(),nodeVersion:process.version,bunVersion:process.versions.bun??null,v8Version:process.versions.v8??null,pid:process.pid};try{e.macosVersion=ce(`sw_vers -productVersion 2>/dev/null`,u({encoding:`utf8`})).trim()}catch{}try{let t=P(__dirname,`..`,`..`,`package.json`);I(t)&&(e.okVersion=JSON.parse(R(t,`utf8`)).version)}catch{}return e}const Ie=[{prefix:`cli`,projectTagged:!0},{prefix:`desktop`,projectTagged:!1},{prefix:`mcp`,projectTagged:!1}];function W(e){let t=M(e);return Ie.some(e=>e.projectTagged&&t.startsWith(`${e.prefix}.`))}function Le(e,t){return Be(e,t).files}const Re=[`ShipIt_stderr.log`,`ShipIt_stdout.log`];function ze(e,t=ie){let n=P(e,`${t}.ShipIt`);return I(n)?Re.map(e=>P(n,e)).filter(e=>I(e)):[]}function Be(e,t){if(!I(t))return{files:[],excludedByProjectSlug:0};let n=z(t).filter(e=>e.endsWith(`.log`)||/\.log\.\d+$/.test(e)).map(e=>P(t,e));if(!e)return{files:n,excludedByProjectSlug:0};let r=n.filter(W),i=[],a=r.filter(t=>{try{return R(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=>!W(e)||o.has(e)),excludedByProjectSlug:r.length-o.size}}function Ve(e){let t=P(e,`.ok`,`local`);return I(t)?{files:[`server.lock`,`last-spawn-error.log`,s].map(e=>P(t,e)).filter(e=>I(e))}:{files:[]}}function He(e){let t=P(e,`.ok`,`local`,`logs`);return I(t)?{files:[`server-current.jsonl`,`server-prev.jsonl`].map(e=>P(t,e)).filter(e=>I(e))}:{files:[]}}function Ue(e){if(e.redact){let{redacted:t,patterns:n,lineCount:r}=i(e.content);e.zipfile.addBuffer(Buffer.from(t,`utf8`),e.name),e.bundleFiles.push(e.name),n.length>0&&e.redactions.push({file:e.name,lineCount:r,patterns:n})}else e.zipfile.addBuffer(Buffer.from(e.content,`utf8`),e.name),e.bundleFiles.push(e.name)}function G(e){for(let t of e.files)try{Ue({zipfile:e.zipfile,name:`${e.prefix}/${M(t)}`,content:R(t,`utf8`),redact:e.redact,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 We(t){let{redact:n,outputPath:r,logger:i}=t,a=t.userLogsDir??P(H(),`.ok`,`logs`),o=t.projectDir?Pe(t.projectDir,i):null;L(N(r),{recursive:!0}),i?.info({projectSlug:o},`gathering diagnostic data`);let s=Fe();s.desktop=t.desktop??null,s.language=t.language??null;let{files:l,excludedByProjectSlug:u}=Be(o,a),{files:d}=t.projectDir?Ve(t.projectDir):{files:[]},{files:f}=t.projectDir?He(t.projectDir):{files:[]},p=t.shipItLogFiles??[];i?.info({logFileCount:l.length,logFilesExcludedByProjectSlug:u,lockFileCount:d.length,localSinkFileCount:f.length,shipItLogFileCount:p.length},`files collected`);let m=[],h=[],{ZipFile:ee}=await import(`./yazl-jVENrf5i.mjs`).then(t=>e(t.default,1)),g=new ee;G({zipfile:g,files:[...l,...p],prefix:`logs`,redact:n,bundleFiles:h,redactions:m,logger:i}),G({zipfile:g,files:d,prefix:`lockdir`,redact:n,bundleFiles:h,redactions:m,logger:i}),G({zipfile:g,files:f,prefix:`local-logs`,redact:n,bundleFiles:h,redactions:m,logger:i});for(let e of t.extraFiles??[])try{let t=R(e.sourcePath),n=`extra/${e.zipName??M(e.sourcePath)}`;g.addBuffer(t,n),h.push(n)}catch(t){i?.warn({sourcePath:e.sourcePath,err:t},`extra file unreadable; omitted from bundle`)}t.note&&Ue({zipfile:g,name:`note.txt`,content:t.note,redact:n,bundleFiles:h,redactions:m});let _=JSON.stringify(s,null,2);g.addBuffer(Buffer.from(_,`utf8`),`sysinfo.json`),h.push(`sysinfo.json`);let v={generatedAt:new Date().toISOString(),disciplineVersion:`1.0.0`,projectSlug:o,files:h,redactions:m,sysinfo:s};g.addBuffer(Buffer.from(JSON.stringify(v,null,2),`utf8`),`MANIFEST.json`);let y=m.reduce((e,t)=>e+t.lineCount,0),b=new Set(p.map(e=>`logs/${M(e)}`)),x=h.filter(e=>b.has(e)),S=o?h.filter(e=>e.startsWith(`logs/`)&&!W(e)&&!b.has(e)):[],C=[`# Bug Report Bundle`,``,`Generated: ${v.generatedAt}`,`Project: ${o??`(unscoped)`}`,`Discipline version: ${v.disciplineVersion}`,``,`## Contents`,``,...h.map(e=>`- ${e}`),``,`## Privacy`,``,...S.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:`,...S.map(e=>`- ${e}`),``]:[],...x.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:`,...x.map(e=>`- ${e}`),``]:[],...n?[`This bundle was auto-redacted before packaging.`,`Patterns checked: ${c.join(`, `)}`,y>0?`${y} line(s) were scrubbed across ${m.length} file(s).`:`No redactions were needed.`,`See MANIFEST.json for the full redaction audit report.`,``,`This bundle is safe to attach to a GitHub issue.`]:[`Redaction was disabled for this bundle; file contents are unmodified.`]].join(`
|
|
2
2
|
`);g.addBuffer(Buffer.from(C,`utf8`),`README.md`),g.end();let w=fe(r);return g.outputStream.pipe(w),await new Promise((e,t)=>{w.on(`close`,e),w.on(`error`,t)}),i?.info({bundlePath:r,fileCount:h.length,redactionCount:y},`bundle written`),{zipPath:r,summary:{projectSlug:o,files:h,redactions:m,redactedLineCount:y,generatedAt:v.generatedAt}}}var Ge=e(C(),1),K=e(re(),1);function Ke(e){return _({absPath:v(`user`,e,e),sideline:!1,warn:()=>{}}).value.appearance?.language??`system`}function qe({home:e=H(),env:n=process.env}={}){let i=Ke(e),{override:o,preferenceList:s}=ee(n),{locale:c,source:l}=a({override:o,storedPreference:i,supportedLocales:r,preferenceList:s,autoDetectableLocales:t});return{preference:i,locale:c,source:l,systemLanguages:s}}function Je(e,t){return t.length===0||!e.includes(t)?e:e.split(t).join(`<CONTENT_DIR>`)}function Ye(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function q(e,t){if(typeof e==`string`)return Je(e,t.contentDir);if(Array.isArray(e))return e.map(e=>q(e,t));if(!Ye(e))return e;let n={};for(let[r,i]of Object.entries(e))n[r]=q(i,t);return n}function Xe(e,t){let n=R(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=q(JSON.parse(n),t);a.push(JSON.stringify(e))}catch{a.push(n)}}}V(e,r?`${a.join(`
|
|
@@ -17,4 +17,4 @@ import{o as e}from"./chunk-DTipWd-i.mjs";import{K as t,pt as n,q as r}from"./sle
|
|
|
17
17
|
`).replace(/\n/g,`\r
|
|
18
18
|
`));let u=`${i?``:``}${l}`;return u!==r&&g(e,u,{mode:k(e)}),{kind:`removed`}}function ln(e){return e==null?!1:e.includes(`--type=utility`)&&e.includes(`--utility-sub-type=node.mojom.NodeService`)}function un(e,t=Date.now()){let n=new Date(e).getTime();if(Number.isNaN(n))return`—`;let r=t-n,i=Math.floor(r/1e3);if(i<60)return`${i}s`;let a=Math.floor(i/60);if(a<60)return`${a}m ago`;let o=Math.floor(a/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}function dn(e,t,n,r,i,a){if(t.status===`missing`||t.status===`corrupt`)return null;let o=t.lock,s=null;if(n.status!==`missing`&&n.status!==`corrupt`){let e=n.lock;s={port:e.port,status:n.status,pid:e.pid,startedAt:e.startedAt,usage:a}}return{directory:o.worktreeRoot,server:{port:o.port,status:t.status,pid:o.pid,startedAt:o.startedAt,usage:i},ui:s,hostname:o.hostname,lockPath:t.lockPath,binary:r==null?null:f(r),command:r,isDesktop:ln(r)}}function fn(e){return e.ui==null?!1:e.ui.status===`alive`||e.ui.status===`foreign-host`}function Q(e){let t=e.server.status;return t===`alive`||t===`foreign-host`?e.isDesktop?`desktop`:t===`alive`?`running`:`foreign`:t===`dead-pid`&&fn(e)?`ui-orphan`:`stale`}const pn=new Set([`running`,`desktop`,`foreign`,`ui-orphan`]);function mn(e){switch(e){case`running`:return K.default.green(e);case`desktop`:return K.default.blue(e);case`foreign`:return K.default.cyan(e);case`ui-orphan`:return K.default.magenta(e);case`stale`:return K.default.yellow(e)}}function hn(e){return e==null?`—`:`${e.cpuPercent.toFixed(1)}% / ${e.memPercent.toFixed(1)}%`}function gn(e){return`${hn(e.server.usage)} | ${hn(e.ui?.usage??null)}`}function _n(e){return`${e.server.port===0?`(starting)`:String(e.server.port)} / ${e.ui==null||e.ui.status===`dead-pid`?`—`:String(e.ui.port)}`}function vn(e){if(e.length===0)return`No open-knowledge servers found.`;let t=[`DIRECTORY`,`PORTS (API/UI)`,`CPU/MEM (API | UI)`,`STATUS`,`PID`,`STARTED`,`BINARY`],n=e.map(e=>{let t=Q(e),n=t===`ui-orphan`&&e.ui!=null?e.ui.pid:e.server.pid;return[e.directory,_n(e),gn(e),t,String(n),un(e.server.startedAt),e.binary??`—`]}),r=t.length,i=t.map(e=>e.length);for(let e of n)for(let t=0;t<r;t++)i[t]=Math.max(i[t]??0,(e[t]??``).length);let a=t.map((e,t)=>e.padEnd(i[t]??0)).join(` `).trimEnd(),o=e.map((e,t)=>{let a=n[t]??[],o=[];for(let t=0;t<r;t++){let n=(a[t]??``).padEnd(i[t]??0);if(t===3){let r=a[t]??``;n=mn(Q(e))+` `.repeat(Math.max(0,(i[t]??0)-r.length))}o.push(n)}return o.join(` `).trimEnd()}),s=K.default.dim(`To stop a server: ok stop <port|pid|directory|all>`);return[a,...o,``,s].join(`
|
|
19
19
|
`)}async function yn(e={}){let t=e.discover??m,n=e.inspect??Z,r=e.log??(e=>console.log(e)),i=e.resolveCommand??d,a=e.resolveUsage??p,o=await t(),s=[];for(let e of o){let t=n(e,`server`),r=n(e,`ui`),o=dn(e,t,r,t.status===`missing`||t.status===`corrupt`?null:i(t.lock.pid),t.status===`missing`||t.status===`corrupt`?null:a(t.lock.pid),r.status===`missing`||r.status===`corrupt`?null:a(r.lock.pid));o!=null&&s.push(o)}if(e.json){let e=s.map(e=>({...e,displayStatus:Q(e)}));r(JSON.stringify(e,null,2));return}r(vn(e.all?s:s.filter(e=>pn.has(Q(e)))))}function bn(){return new w(`ps`).description(`List all running open-knowledge servers`).argument(`[modifier]`,`"all" to include stale (dead-pid) entries`).option(`--all`,`Include stale (dead-pid) entries (foreign-host shows by default)`).option(`--json`,`Emit structured JSON (always includes all statuses)`).action(async(e,t)=>{await yn({all:t.all===!0||e===`all`,json:t.json===!0})})}function xn(e,t,n={}){let r=n.isAlive??b,i=[];for(let[n,a]of[[`server`,e],[`ui`,t]])(a.status===`alive`||a.status===`foreign-host`&&r(a.lock.pid))&&i.push({name:n,pid:a.lock.pid,port:a.lock.port});return{targets:i}}function Sn(e){let t=e.inspect??(t=>Z(e.lockDir,t)),n=e.kill??((e,t)=>process.kill(e,t)),r=e.log??(e=>console.log(e)),i=e.error??(e=>console.error(e)),a=xn(t(`server`),t(`ui`),{isAlive:e.isAlive});if(a.targets.length===0)return r(`No running open-knowledge processes.`),{stopped:[],failed:[],hadTargets:!1};let o=[],s=[];for(let e of a.targets)try{n(e.pid,`SIGTERM`),o.push(e)}catch(t){s.push({target:e,error:t instanceof Error?t.message:String(t)})}return o.length>0&&r(`Stopped: ${o.map(e=>`${e.name} (pid=${e.pid}, port=${e.port})`).join(`, `)}`),s.length>0&&i(`Failed to stop: ${s.map(({target:e,error:t})=>`${e.name} (pid=${e.pid}): ${t}`).join(`; `)}`),{stopped:o,failed:s,hadTargets:!0}}function $(e,t){return e.status===`alive`?!0:e.status===`foreign-host`?t(e.lock.pid):!1}async function Cn(e,t=b){let n=await m(),r=null;for(let i of n){let n=Z(i,`server`),a=Z(i,`ui`);if($(n,t)&&n.lock.port===e||$(a,t)&&a.lock.port===e)return i;r===null&&($(n,t)&&n.lock.pid===e||$(a,t)&&a.lock.pid===e)&&(r=i)}return r}function wn(e){let t=Sn({lockDir:e});return t.failed.length>0&&(process.exitCode=1),t}function Tn(e){return new w(`stop`).description(`Stop open-knowledge server(s). With no argument: stops the server for the current directory. Pass a port number, a directory path, or "all" to target globally.`).argument(`[target...]`,`port number, directory path (spaces OK), or "all"`).action(async t=>{let n=t.length===0?void 0:t.join(` `);if(n===void 0){e();let t=Sn({lockDir:l(process.cwd()),log:()=>{}});if(t.hadTargets){if(t.stopped.length>0){let e=t.stopped.map(e=>`${e.name} (pid=${e.pid}, port=${e.port})`).join(`, `);console.log(`Stopped: ${e}`)}t.failed.length>0&&(process.exitCode=1)}else await yn({});return}if(n===`all`){let e=await m();if(e.length===0){console.log(`No running open-knowledge servers found.`);return}let t=0;for(let n of e){let e=Z(n,`server`),r=Z(n,`ui`);!$(e,b)&&!$(r,b)||(wn(n),t++)}t===0&&console.log(`No running open-knowledge servers found.`);return}if(/^\d+$/.test(n)){let e=Number.parseInt(n,10),t=await Cn(e);if(t===null){console.log(`No running open-knowledge server found with port or PID ${e}.`);return}wn(t);return}wn(l(F(je(),n)))})}export{je as _,Xt as a,$t as c,Z as d,qt as f,Me as g,Ne as h,an as i,en as l,Wt as m,Tn as n,tn as o,Ut as p,bn as r,Zt as s,Sn as t,Yt as u,Ae as v,Oe as y};
|
|
20
|
-
//# sourceMappingURL=src-
|
|
20
|
+
//# sourceMappingURL=src-BZ35NJ2E.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e,o as t,r as n,t as r}from"./chunk-DTipWd-i.mjs";import{$ as i,At as a,B as o,Ct as s,Ft as c,G as l,H as u,It as d,J as f,Lt as p,M as m,Mt as h,Ot as g,Pt as _,Rt as v,St as y,Tt as b,Vt as x,Wt as S,X as C,Y as w,Z as T,b as E,bt as D,ct as O,f as ee,h as te,jt as k,k as ne,kt as A,mt as re,nt as ie,pt as ae,r as j,rt as oe,w as se,wt as ce,y as M,yt as N,zt as le}from"./sleep-
|
|
1
|
+
import{i as e,o as t,r as n,t as r}from"./chunk-DTipWd-i.mjs";import{$ as i,At as a,B as o,Ct as s,Ft as c,G as l,H as u,It as d,J as f,Lt as p,M as m,Mt as h,Ot as g,Pt as _,Rt as v,St as y,Tt as b,Vt as x,Wt as S,X as C,Y as w,Z as T,b as E,bt as D,ct as O,f as ee,h as te,jt as k,k as ne,kt as A,mt as re,nt as ie,pt as ae,r as j,rt as oe,w as se,wt as ce,y as M,yt as N,zt as le}from"./sleep-CEs13Om_.mjs";import{n as ue,t as de}from"./markdownit-BNz2xGu4.mjs";import fe from"node:path";import pe from"node:process";import{fileURLToPath as me}from"node:url";import{access as he,accessSync as ge,readFile as _e,readFileSync as P}from"node:fs";import{EOL as ve,homedir as ye}from"node:os";const be=a({at:d(),transport:d(),outcome:d(),reference:d().optional(),error:d().optional()}),xe=a({reason:d(),at:d()});a({version:k().int().catch(1),id:d(),createdAt:d(),bundleLevel:d(),zipBytes:k().int().nonnegative().catch(0),zipDeleted:s().optional(),state:d(),systemWide:s().optional(),projectSlug:d().nullable().optional(),reference:d().optional(),lastError:xe.optional(),attempts:y(be).optional(),note:d().optional()});const Se=1,Ce={protocol:`x-ok-client-protocol`,runtime:`x-ok-client-runtime`,kind:`x-ok-client-kind`};function we({kind:e,runtimeVersion:t}){return{[Ce.protocol]:`1`,[Ce.runtime]:t,[Ce.kind]:e}}const Te=[{name:`macos-home-path`,regex:/\/Users\/[^/]+\//g,replacement:`~/`},{name:`linux-home-path`,regex:/\/home\/[^/]+\//g,replacement:`~/`},{name:`github-pat`,regex:/\b(ghp_|gho_|ghu_|ghs_|ghr_)[A-Za-z0-9]{36,}\b/g,replacement:`[REDACTED-GH-PAT]`},{name:`aws-access-key`,regex:/\b(AKIA|ASIA|ABIA)[A-Z2-7]{16}\b/g,replacement:`[REDACTED-AWS-KEY]`},{name:`anthropic-key`,regex:/\bsk-ant-api03-[A-Za-z0-9_-]{20,}\b/g,replacement:`[REDACTED-ANTHROPIC]`},{name:`openai-key`,regex:/\bsk-[A-Za-z0-9]{20,}\b/g,replacement:`[REDACTED-OPENAI]`},{name:`bearer-token`,regex:/([Aa]uthorization:\s*[Bb]earer\s+)\S+/g,replacement:`$1[REDACTED]`},{name:`jwt`,regex:/eyJ[A-Za-z0-9_-]{8,}\.eyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}/g,replacement:`[REDACTED-JWT]`},{name:`url-credentials`,regex:/:\/\/[^/\s:@]+:[^/\s:@]+@/g,replacement:`://[REDACTED]@`},{name:`github-pat-fine-grained`,regex:/\bgithub_pat_[0-9A-Za-z_]{20,}/g,replacement:`[REDACTED-GH-PAT]`},{name:`openai-key-modern`,regex:/\bsk-(?:proj|svcacct|admin|None)-[A-Za-z0-9_-]{20,}/g,replacement:`[REDACTED-OPENAI]`},{name:`slack-token`,regex:/\bxox[a-z]-[A-Za-z0-9-]{10,}/g,replacement:`[REDACTED-SLACK]`},{name:`google-api-key`,regex:/\bAIza[0-9A-Za-z_-]{35}/g,replacement:`[REDACTED-GOOGLE]`},{name:`stripe-secret-key`,regex:/\b(?:sk|rk)_live_[0-9A-Za-z]{16,}\b/g,replacement:`[REDACTED-STRIPE]`},{name:`gitlab-pat`,regex:/\bglpat-[0-9A-Za-z_-]{20,}/g,replacement:`[REDACTED-GITLAB]`},{name:`bearer-token-json`,regex:/("[Aa]uthorization"\s*:\s*"[Bb]earer\s+)[^"]+/g,replacement:`$1[REDACTED]`}],Ee=Te.map(e=>e.name);function De(e){let t=new Set,n=0;return{redacted:e.split(`
|
|
2
2
|
`).map(e=>{let r=e,i=!1;for(let{name:e,regex:n,replacement:a}of Te)n.lastIndex=0,n.test(r)&&(t.add(e),i=!0,n.lastIndex=0,r=r.replace(n,a));return i&&n++,r}).join(`
|
|
3
3
|
`),patterns:[...t],lineCount:n}}function Oe(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Ae(e.position):`start`in e||`end`in e?Ae(e):`line`in e||`column`in e?ke(e):``}function ke(e){return je(e&&e.line)+`:`+je(e&&e.column)}function Ae(e){return ke(e&&e.start)+`-`+ke(e&&e.end)}function je(e){return e&&typeof e==`number`?e:1}var Me=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=Oe(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};Me.prototype.file=``,Me.prototype.name=``,Me.prototype.reason=``,Me.prototype.message=``,Me.prototype.stack=``,Me.prototype.column=void 0,Me.prototype.line=void 0,Me.prototype.ancestors=void 0,Me.prototype.cause=void 0,Me.prototype.fatal=void 0,Me.prototype.place=void 0,Me.prototype.ruleId=void 0,Me.prototype.source=void 0;const Ne=new Set([`*`,`_`,"`",`~`,`\\`,`$`]),Pe=/^={2,}/,Fe=/^<(?:[A-Za-z][A-Za-z0-9+.-]*:[^<>\s]*|[^\s<>@]+@[^\s<>]+)>/;function Ie(e,t){return Fe.test(e.slice(t,t+512))}function Le(e,t){let n=e.lastIndexOf(`<`,t);return n<0||t-n>512?!1:Fe.exec(e.slice(n,t+1))?.[0].length===t+1-n}const Re=/^<\/?[A-Za-z][A-Za-z0-9-]*(?:\s[^>]*?)?\/?>/,ze=/^!(?=\[)/,Be=/^\[\^/,Ve=/^\]\[[^\]]*\]/,He=/^\[\[[^\][|]*\|/,Ue=/^#[^\][|]*(?=\]\])/,We=/^\]\([^)]*\)/,Ge=/^(?:#{1,6}[ \t]+|>[ \t]?|(?:[-*+]|\d{1,9}[.)])[ \t]+(?:\[[ xX]\][ \t]+)?)/,Ke=/^(?:`{3,}[^`\n]*|~{3,}[^\n]*)$/,qe=/^(?:(?:[-*_][ \t]*){3,}|=+[ \t]*|[|\-: \t]*-[|\-: \t]*)$/;function Je(e,t){let n=e.indexOf(`
|
|
4
4
|
`,t),r=n===-1?e.length:n;if(r>t&&e[r-1]===`\r`&&--r,r-t>1024)return 0;let i=e.slice(t,r);return i.length===0||!Ke.test(i)&&!qe.test(i)?0:i.length}function Ye(e){return e===` `||e===` `||e===`
|
|
@@ -66,7 +66,7 @@ import{i as e,o as t,r as n,t as r}from"./chunk-DTipWd-i.mjs";import{$ as i,At a
|
|
|
66
66
|
});
|
|
67
67
|
<\/script>
|
|
68
68
|
</div>`}];function zn(e){return["```html preview",e.html,"```"].join(`
|
|
69
|
-
`)}const Bn=[{name:`--chart-1`,light:`oklch(0.62 0.19 259)`,dark:`oklch(0.72 0.14 259)`},{name:`--chart-2`,light:`oklch(0.58 0.14 145)`,dark:`oklch(0.73 0.13 145)`},{name:`--chart-3`,light:`oklch(0.62 0.15 70)`,dark:`oklch(0.77 0.14 70)`},{name:`--chart-4`,light:`oklch(0.55 0.18 290)`,dark:`oklch(0.72 0.16 290)`},{name:`--chart-5`,light:`oklch(0.58 0.21 25)`,dark:`oklch(0.72 0.2 25)`},{name:`--primary`,light:`oklch(0.6321 0.1983 259.59)`,dark:`#69a3ff`},{name:`--primary-foreground`,light:`oklch(0.985 0 0)`,dark:`oklch(0.205 0 0)`},{name:`--foreground`,light:`oklch(0.145 0 0)`,dark:`oklch(0.985 0 0)`},{name:`--background`,light:`oklch(1 0 0)`,dark:`oklch(0.145 0 0)`},{name:`--card`,light:`oklch(1 0 0)`,dark:`oklch(0.205 0 0)`},{name:`--card-foreground`,light:`oklch(0.145 0 0)`,dark:`oklch(0.985 0 0)`},{name:`--muted-foreground`,light:`oklch(0.556 0 0)`,dark:`oklch(0.708 0 0)`},{name:`--border`,light:`oklch(0.922 0 0)`,dark:`oklch(1 0 0 / 10%)`},{name:`--destructive`,light:`oklch(0.577 0.245 27.325)`,dark:`oklch(0.704 0.191 22.216)`},{name:`--radius`,light:`0.625rem`,dark:`0.625rem`}],Vn=`127.0.0.1`,Hn=`.agents/skills`,Un=`open-knowledge-pack-`;function Wn(e){let t=e.trim();if(t===`inkeep/open-knowledge-skills`)return!0;if(!t.includes(`://`)&&!t.includes(`@`))return!1;if(t.includes(`://`))try{let e=new URL(t);return Gn.has(e.hostname.toLowerCase())&&Kn(e.pathname)}catch{return!1}let n=/^(?:[\w.-]+@)?([\w.-]+):(.+)$/.exec(t);return n?Gn.has(n[1].toLowerCase())&&Kn(n[2]):!1}const Gn=new Set([`skills.sh`,`www.skills.sh`,`github.com`,`www.github.com`,`raw.githubusercontent.com`]);function Kn(e){let t=e.replace(/^\/+/,``).replace(/\.git$/,``);return t===`inkeep/open-knowledge-skills`||t.startsWith(`inkeep/open-knowledge-skills/`)}const qn={"open-knowledge-pack-plain-notes":`note-taking`,"open-knowledge-pack-worldbuilding":`worldbuilding`,"open-knowledge-pack-writing-pipeline":`writing-workflow`,"open-knowledge-pack-codebase-wiki":`codebase-wiki`,"open-knowledge-pack-knowledge-base":`knowledge-base`,"open-knowledge-pack-software-lifecycle":`software-lifecycle`,"open-knowledge-pack-entity-vault":`personal-crm`,"open-knowledge-pack-okf":`okf-knowledge-base`,"open-knowledge-pack-software-lifecycle-frame-a-proposal":`frame-a-proposal`,"open-knowledge-pack-software-lifecycle-record-a-decision":`record-a-decision`,"open-knowledge-pack-software-lifecycle-write-a-spec":`write-a-spec`,"open-knowledge-pack-software-lifecycle-review-a-design":`review-a-design`,"open-knowledge-pack-software-lifecycle-write-a-postmortem":`write-a-postmortem`,"open-knowledge-pack-knowledge-base-research":`research-with-sources`,"open-knowledge-pack-knowledge-base-consolidate":`consolidate-notes`},Jn=`inkeep/open-knowledge-skills`;function Yn(e,t){return e.startsWith(`open-knowledge-pack-`)&&Wn(t)}const Xn=/(^|[\s([])\/([a-z0-9][a-z0-9-]{1,63})(?=$|[\s.,;:!?)\]])/g,Zn=new Set([`tmp`,`usr`,`etc`,`var`,`dev`,`opt`,`bin`,`api`,`home`,`root`]);function Qn(e){return!Zn.has(e)}const $n=/`\/([a-z0-9][a-z0-9-]{1,63})`/g;function er(e){let t=new Set;Xn.lastIndex=0;for(let n=Xn.exec(e);n!==null;n=Xn.exec(e)){let e=n[2];Qn(e)&&t.add(e)}$n.lastIndex=0;for(let n=$n.exec(e);n!==null;n=$n.exec(e)){let e=n[1];Qn(e)&&t.add(e)}return[...t]}function tr(e,t,n){if(t===n||!Qn(t)||!e.includes(`/${t}`))return e;Xn.lastIndex=0;let r=e.replace(Xn,(e,r,i)=>i===t?`${r}/${n}`:e);return $n.lastIndex=0,r.replace($n,(e,r)=>r===t?`\`/${n}\``:e)}const nr=Object.freeze([{value:`workflow-fit`,label:`It didn't fit into my workflow`},{value:`missing-feature`,label:`It was missing a feature I needed`},{value:`hard-to-start`,label:`It was too hard to set up or get started`},{value:`unreliable`,label:`Bugs, crashes, or it felt unreliable`},{value:`switched-tool`,label:`I'm switching to another tool`},{value:`one-off`,label:`It was a trial or one-off project`},{value:`other`,label:`Something else`}]);new Set(nr.map(e=>e.value));function rr(e){this.content=e}rr.prototype={constructor:rr,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new rr(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new rr(n)},addToStart:function(e,t){return new rr([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new rr(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new rr(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=rr.from(e),e.size?new rr(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=rr.from(e),e.size?new rr(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=rr.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},rr.from=function(e){if(e instanceof rr)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new rr(t)};function ir(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){for(let e=0;i.text[e]==a.text[e];e++)n++;return n}if(i.content.size||a.content.size){let e=ir(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function ar(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s){n-=c,r-=c;continue}if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=0,t=Math.min(o.text.length,s.text.length);for(;e<t&&o.text[o.text.length-e-1]==s.text[s.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(o.content.size||s.content.size){let e=ar(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}var F=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return ir(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return ar(this,e,t,n)}findIndex(e){if(e==0)return sr(0,e);if(e==this.size)return sr(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?sr(t+1,i):sr(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return new e(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};F.empty=new F([],0);const or={index:0,offset:0};function sr(e,t){return or.index=e,or.offset=t,or}function cr(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!cr(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!cr(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var lr=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else !n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&cr(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};lr.none=[];var ur=class extends Error{},I=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=fr(this.content,t+this.openStart,n);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(dr(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(F.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};I.empty=new I(F.empty,0,0);function dr(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(dr(a.content,t-i-1,n-i-1)))}function fr(e,t,n,r){let{index:i,offset:a}=e.findIndex(t),o=e.maybeChild(i);if(a==t||o.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let s=fr(o.content,t-a-1,n,o);return s&&e.replaceChild(i,o.copy(s))}function pr(e,t,n){if(n.openStart>e.depth)throw new ur(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new ur(`Inconsistent open depths`);return mr(e,t,n,0)}function mr(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=mr(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}else if(!n.content.size)return yr(a,xr(e,t,r));else if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return yr(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}else{let{start:i,end:o}=Sr(n,e);return yr(a,br(e,i,o,t,r))}}function hr(e,t){if(!t.type.compatibleContent(e.type))throw new ur(`Cannot join `+t.type.name+` onto `+e.type.name)}function gr(e,t,n){let r=e.node(n);return hr(r,t.node(n)),r}function _r(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function vr(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(_r(e.nodeAfter,r),a++));for(let e=a;e<o;e++)_r(i.child(e),r);t&&t.depth==n&&t.textOffset&&_r(t.nodeBefore,r)}function yr(e,t){return e.type.checkContent(t),e.copy(t)}function br(e,t,n,r,i){let a=e.depth>i&&gr(e,t,i+1),o=r.depth>i&&gr(n,r,i+1),s=[];return vr(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(hr(a,o),_r(yr(a,br(e,t,n,r,i+1)),s)):(a&&_r(yr(a,xr(e,t,i+1)),s),vr(t,n,i,s),o&&_r(yr(o,xr(n,r,i+1)),s)),vr(r,null,i,s),new F(s)}function xr(e,t,n){let r=[];return vr(null,e,n,r),e.depth>n&&_r(yr(gr(e,t,n+1),xr(e,t,n+1)),r),vr(t,null,n,r),new F(r)}function Sr(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(F.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var Cr=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return lr.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new Dr(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=Er.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else Er.set(t,r=new wr);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%Tr,i}},wr=class{constructor(){this.elts=[],this.i=0}};const Tr=12,Er=new WeakMap;var Dr=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}};const Or=Object.create(null);var kr=class e{constructor(e,t,n,r=lr.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||F.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&cr(this.attrs,t||e.defaultAttrs||Or)&&lr.sameSet(this.marks,n||lr.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return I.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new I(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return pr(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return Cr.resolveCached(this,e)}resolveNoCache(e){return Cr.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),jr(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=F.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=lr.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!lr.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=F.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}};kr.prototype.text=void 0;var Ar=class e extends kr{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):jr(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function jr(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}var Mr=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new Nr(t,n);if(r.next==null)return e.empty;let i=Pr(r);r.next&&r.err(`Unexpected trailing text`);let a=Wr(Vr(i));return Gr(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return F.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
|
|
69
|
+
`)}const Bn=[{name:`--chart-1`,light:`oklch(0.62 0.19 259)`,dark:`oklch(0.72 0.14 259)`},{name:`--chart-2`,light:`oklch(0.58 0.14 145)`,dark:`oklch(0.73 0.13 145)`},{name:`--chart-3`,light:`oklch(0.62 0.15 70)`,dark:`oklch(0.77 0.14 70)`},{name:`--chart-4`,light:`oklch(0.55 0.18 290)`,dark:`oklch(0.72 0.16 290)`},{name:`--chart-5`,light:`oklch(0.58 0.21 25)`,dark:`oklch(0.72 0.2 25)`},{name:`--primary`,light:`oklch(0.5621 0.1983 259.59)`,dark:`#69a3ff`},{name:`--primary-foreground`,light:`oklch(0.985 0 0)`,dark:`oklch(0.205 0 0)`},{name:`--foreground`,light:`oklch(0.145 0 0)`,dark:`oklch(0.985 0 0)`},{name:`--background`,light:`oklch(1 0 0)`,dark:`oklch(0.145 0 0)`},{name:`--card`,light:`oklch(1 0 0)`,dark:`oklch(0.205 0 0)`},{name:`--card-foreground`,light:`oklch(0.145 0 0)`,dark:`oklch(0.985 0 0)`},{name:`--muted-foreground`,light:`oklch(0.556 0 0)`,dark:`oklch(0.708 0 0)`},{name:`--border`,light:`oklch(0.922 0 0)`,dark:`oklch(1 0 0 / 10%)`},{name:`--destructive`,light:`oklch(0.577 0.245 27.325)`,dark:`oklch(0.704 0.191 22.216)`},{name:`--radius`,light:`0.625rem`,dark:`0.625rem`}],Vn=`127.0.0.1`,Hn=`.agents/skills`,Un=`open-knowledge-pack-`;function Wn(e){let t=e.trim();if(t===`inkeep/open-knowledge-skills`)return!0;if(!t.includes(`://`)&&!t.includes(`@`))return!1;if(t.includes(`://`))try{let e=new URL(t);return Gn.has(e.hostname.toLowerCase())&&Kn(e.pathname)}catch{return!1}let n=/^(?:[\w.-]+@)?([\w.-]+):(.+)$/.exec(t);return n?Gn.has(n[1].toLowerCase())&&Kn(n[2]):!1}const Gn=new Set([`skills.sh`,`www.skills.sh`,`github.com`,`www.github.com`,`raw.githubusercontent.com`]);function Kn(e){let t=e.replace(/^\/+/,``).replace(/\.git$/,``);return t===`inkeep/open-knowledge-skills`||t.startsWith(`inkeep/open-knowledge-skills/`)}const qn={"open-knowledge-pack-plain-notes":`note-taking`,"open-knowledge-pack-worldbuilding":`worldbuilding`,"open-knowledge-pack-writing-pipeline":`writing-workflow`,"open-knowledge-pack-codebase-wiki":`codebase-wiki`,"open-knowledge-pack-knowledge-base":`knowledge-base`,"open-knowledge-pack-software-lifecycle":`software-lifecycle`,"open-knowledge-pack-entity-vault":`personal-crm`,"open-knowledge-pack-okf":`okf-knowledge-base`,"open-knowledge-pack-software-lifecycle-frame-a-proposal":`frame-a-proposal`,"open-knowledge-pack-software-lifecycle-record-a-decision":`record-a-decision`,"open-knowledge-pack-software-lifecycle-write-a-spec":`write-a-spec`,"open-knowledge-pack-software-lifecycle-review-a-design":`review-a-design`,"open-knowledge-pack-software-lifecycle-write-a-postmortem":`write-a-postmortem`,"open-knowledge-pack-knowledge-base-research":`research-with-sources`,"open-knowledge-pack-knowledge-base-consolidate":`consolidate-notes`},Jn=`inkeep/open-knowledge-skills`;function Yn(e,t){return e.startsWith(`open-knowledge-pack-`)&&Wn(t)}const Xn=/(^|[\s([])\/([a-z0-9][a-z0-9-]{1,63})(?=$|[\s.,;:!?)\]])/g,Zn=new Set([`tmp`,`usr`,`etc`,`var`,`dev`,`opt`,`bin`,`api`,`home`,`root`]);function Qn(e){return!Zn.has(e)}const $n=/`\/([a-z0-9][a-z0-9-]{1,63})`/g;function er(e){let t=new Set;Xn.lastIndex=0;for(let n=Xn.exec(e);n!==null;n=Xn.exec(e)){let e=n[2];Qn(e)&&t.add(e)}$n.lastIndex=0;for(let n=$n.exec(e);n!==null;n=$n.exec(e)){let e=n[1];Qn(e)&&t.add(e)}return[...t]}function tr(e,t,n){if(t===n||!Qn(t)||!e.includes(`/${t}`))return e;Xn.lastIndex=0;let r=e.replace(Xn,(e,r,i)=>i===t?`${r}/${n}`:e);return $n.lastIndex=0,r.replace($n,(e,r)=>r===t?`\`/${n}\``:e)}const nr=Object.freeze([{value:`workflow-fit`,label:`It didn't fit into my workflow`},{value:`missing-feature`,label:`It was missing a feature I needed`},{value:`hard-to-start`,label:`It was too hard to set up or get started`},{value:`unreliable`,label:`Bugs, crashes, or it felt unreliable`},{value:`switched-tool`,label:`I'm switching to another tool`},{value:`one-off`,label:`It was a trial or one-off project`},{value:`other`,label:`Something else`}]);new Set(nr.map(e=>e.value));function rr(e){this.content=e}rr.prototype={constructor:rr,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new rr(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new rr(n)},addToStart:function(e,t){return new rr([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new rr(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new rr(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=rr.from(e),e.size?new rr(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=rr.from(e),e.size?new rr(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=rr.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},rr.from=function(e){if(e instanceof rr)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new rr(t)};function ir(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){for(let e=0;i.text[e]==a.text[e];e++)n++;return n}if(i.content.size||a.content.size){let e=ir(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function ar(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s){n-=c,r-=c;continue}if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=0,t=Math.min(o.text.length,s.text.length);for(;e<t&&o.text[o.text.length-e-1]==s.text[s.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(o.content.size||s.content.size){let e=ar(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}var F=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return ir(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return ar(this,e,t,n)}findIndex(e){if(e==0)return sr(0,e);if(e==this.size)return sr(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?sr(t+1,i):sr(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return new e(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};F.empty=new F([],0);const or={index:0,offset:0};function sr(e,t){return or.index=e,or.offset=t,or}function cr(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!cr(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!cr(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var lr=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else !n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&cr(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};lr.none=[];var ur=class extends Error{},I=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=fr(this.content,t+this.openStart,n);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(dr(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(F.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};I.empty=new I(F.empty,0,0);function dr(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(dr(a.content,t-i-1,n-i-1)))}function fr(e,t,n,r){let{index:i,offset:a}=e.findIndex(t),o=e.maybeChild(i);if(a==t||o.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let s=fr(o.content,t-a-1,n,o);return s&&e.replaceChild(i,o.copy(s))}function pr(e,t,n){if(n.openStart>e.depth)throw new ur(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new ur(`Inconsistent open depths`);return mr(e,t,n,0)}function mr(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=mr(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}else if(!n.content.size)return yr(a,xr(e,t,r));else if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return yr(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}else{let{start:i,end:o}=Sr(n,e);return yr(a,br(e,i,o,t,r))}}function hr(e,t){if(!t.type.compatibleContent(e.type))throw new ur(`Cannot join `+t.type.name+` onto `+e.type.name)}function gr(e,t,n){let r=e.node(n);return hr(r,t.node(n)),r}function _r(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function vr(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(_r(e.nodeAfter,r),a++));for(let e=a;e<o;e++)_r(i.child(e),r);t&&t.depth==n&&t.textOffset&&_r(t.nodeBefore,r)}function yr(e,t){return e.type.checkContent(t),e.copy(t)}function br(e,t,n,r,i){let a=e.depth>i&&gr(e,t,i+1),o=r.depth>i&&gr(n,r,i+1),s=[];return vr(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(hr(a,o),_r(yr(a,br(e,t,n,r,i+1)),s)):(a&&_r(yr(a,xr(e,t,i+1)),s),vr(t,n,i,s),o&&_r(yr(o,xr(n,r,i+1)),s)),vr(r,null,i,s),new F(s)}function xr(e,t,n){let r=[];return vr(null,e,n,r),e.depth>n&&_r(yr(gr(e,t,n+1),xr(e,t,n+1)),r),vr(t,null,n,r),new F(r)}function Sr(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(F.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var Cr=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return lr.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new Dr(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=Er.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else Er.set(t,r=new wr);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%Tr,i}},wr=class{constructor(){this.elts=[],this.i=0}};const Tr=12,Er=new WeakMap;var Dr=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}};const Or=Object.create(null);var kr=class e{constructor(e,t,n,r=lr.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||F.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&cr(this.attrs,t||e.defaultAttrs||Or)&&lr.sameSet(this.marks,n||lr.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return I.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new I(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return pr(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return Cr.resolveCached(this,e)}resolveNoCache(e){return Cr.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),jr(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=F.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=lr.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!lr.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=F.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}};kr.prototype.text=void 0;var Ar=class e extends kr{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):jr(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function jr(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}var Mr=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new Nr(t,n);if(r.next==null)return e.empty;let i=Pr(r);r.next&&r.err(`Unexpected trailing text`);let a=Wr(Vr(i));return Gr(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return F.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
|
|
70
70
|
`)}};Mr.empty=new Mr(!0);var Nr=class{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==``&&this.tokens.pop(),this.tokens[0]==``&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+` (in content expression '`+this.string+`')`)}};function Pr(e){let t=[];do t.push(Fr(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function Fr(e){let t=[];do t.push(Ir(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function Ir(e){let t=Br(e);for(;;)if(e.eat(`+`))t={type:`plus`,expr:t};else if(e.eat(`*`))t={type:`star`,expr:t};else if(e.eat(`?`))t={type:`opt`,expr:t};else if(e.eat(`{`))t=Rr(e,t);else break;return t}function Lr(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function Rr(e,t){let n=Lr(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:Lr(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function zr(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return i.length==0&&e.err(`No node type or group '`+t+`' found`),i}function Br(e){if(e.eat(`(`)){let t=Pr(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}else if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=zr(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline&&e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function Vr(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t<e.min;t++){let t=n();i(a(e.expr,o),t),o=t}if(e.max==-1)i(a(e.expr,o),o);else for(let t=e.min;t<e.max;t++){let t=n();r(o,t),i(a(e.expr,o),t),o=t}return[r(o)]}else if(e.type==`name`)return[r(t,void 0,e.value)];else throw Error(`Unknown expr type`)}}function Hr(e,t){return t-e}function Ur(e,t){let n=[];return r(t),n.sort(Hr);function r(t){let i=e[t];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(t);for(let e=0;e<i.length;e++){let{term:t,to:a}=i[e];!t&&n.indexOf(a)==-1&&r(a)}}}function Wr(e){let t=Object.create(null);return n(Ur(e,0));function n(r){let i=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);Ur(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new Mr(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(Hr);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function Gr(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,a=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];a.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),r.indexOf(o)==-1&&r.push(o)}i&&t.err(`Only non-generatable nodes (`+a.join(`, `)+`) in a required position (see https://prosemirror.net/docs/guide/#generatable)`)}}function Kr(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function qr(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let t=e[r];if(t.hasDefault)i=t.default;else throw RangeError(`No value supplied for attribute `+r)}n[r]=i}return n}function Jr(e,t,n,r){for(let r in t)if(!(r in e))throw RangeError(`Unsupported attribute ${r} for ${n} of type ${r}`);for(let n in e){let r=e[n];r.validate&&r.validate(t[n])}}function Yr(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new Qr(e,r,t[r]);return n}var Xr=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(` `):[],this.attrs=Yr(e,n.attrs),this.defaultAttrs=Kr(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e==`text`),this.isText=e==`text`}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Mr.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?`pre`:`normal`)}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:qr(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new kr(this,this.computeAttrs(e),F.from(t),lr.setFrom(n))}createChecked(e=null,t,n){return t=F.from(t),this.checkContent(t),new kr(this,this.computeAttrs(e),t,lr.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=F.from(t),t.size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(F.empty,!0);return i?new kr(this,e,t.append(i),lr.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Jr(this.attrs,e,`node`,this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||=e.slice(0,n);return t?t.length?t:lr.none:e}static compile(t,n){let r=Object.create(null);t.forEach((t,i)=>r[t]=new e(t,n,i));let i=n.spec.topNode||`doc`;if(!r[i])throw RangeError(`Schema is missing its top node type ('`+i+`')`);if(!r.text)throw RangeError(`Every schema needs a 'text' type`);for(let e in r.text.attrs)throw RangeError(`The text node type should not have attributes`);return r}};function Zr(e,t,n){let r=n.split(`|`);return n=>{let i=n===null?`null`:typeof n;if(r.indexOf(i)<0)throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}var Qr=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,`default`),this.default=n.default,this.validate=typeof n.validate==`string`?Zr(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},$r=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=Yr(e,r.attrs),this.excluded=null;let i=Kr(this.attrs);this.instance=i?new lr(this,i):null}create(e=null){return!e&&this.instance?this.instance:new lr(this,qr(this.attrs,e))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,a)=>r[t]=new e(t,i++,n,a)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){Jr(this.attrs,e,`mark`,this.name)}excludes(e){return this.excluded.indexOf(e)>-1}},ei=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=rr.from(e.nodes),t.marks=rr.from(e.marks||{}),this.nodes=Xr.compile(this.spec.nodes,this),this.marks=$r.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+` can not be both a node and a mark`);let t=this.nodes[e],r=t.spec.content||``,i=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=Mr.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError(`Multiple linebreak nodes defined`);if(!t.isInline||!t.isLeaf)throw RangeError(`Linebreak replacement nodes must be inline leaf nodes`);this.linebreakReplacement=t}t.markSet=i==`_`?null:i?ti(this,i.split(` `)):i==``||!t.inlineContent?[]:null}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=n==null?[t]:n==``?[]:ti(this,n.split(` `))}this.nodeFromJSON=e=>kr.fromJSON(this,e),this.markFromJSON=e=>lr.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||`doc`],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if(typeof e==`string`)e=this.nodeType(e);else if(!(e instanceof Xr))throw RangeError(`Invalid node type: `+e);else if(e.schema!=this)throw RangeError(`Node type from different schema used (`+e.name+`)`);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new Ar(n,n.defaultAttrs,e,lr.setFrom(t))}mark(e,t){return typeof e==`string`&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError(`Unknown node type: `+e);return t}};function ti(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],a=e.marks[i],o=a;if(a)n.push(a);else for(let t in e.marks){let r=e.marks[t];(i==`_`||r.spec.group&&r.spec.group.split(` `).indexOf(i)>-1)&&n.push(o=r)}if(!o)throw SyntaxError(`Unknown mark type: '`+t[r]+`'`)}return n}function ni(e){return e.tag!=null}function ri(e){return e.style!=null}var ii=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(ni(e))this.tags.push(e);else if(ri(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new ui(this,t,!1);return n.addAll(e,lr.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new ui(this,t,!0);return n.addAll(e,lr.none,t.from,t.to),I.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(fi(e,n.tag)&&(n.namespace===void 0||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(t===!1)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],a=r.style;if(!(a.indexOf(e)!=0||r.context&&!n.matchesContext(r.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(e===!1)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=e.priority==null?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((e.priority==null?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=pi(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=pi(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}};const ai={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},oi={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},si={ol:!0,ul:!0};function ci(e,t,n){return t==null?e&&e.whitespace==`pre`?3:n&-5:!!t|(t===`full`?2:0)}var li=class{constructor(e,t,n,r,i,a){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=a,this.content=[],this.activeMarks=lr.none,this.match=i||(a&4?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(F.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&1)){let e=this.content[this.content.length-1],t;if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let t=F.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(F.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!ai.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},ui=class{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,a=ci(null,t.preserveWhitespace,0)|(n?4:0);i=r?new li(r.type,r.attrs,lr.none,!0,t.topMatch||r.type.contentMatch,a):n?new li(null,null,lr.none,!0,null,a):new li(e.schema.topNodeType,null,lr.none,!0,null,a),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=r.options&2?`full`:this.localPreserveWS||(r.options&1)>0,{schema:a}=this.parser;if(i===`full`||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(!i){if(n=n.replace(/[ \t\r\n\u000c]+/g,` `),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&i.nodeName==`BR`||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}}else if(i===`full`)n=n.replace(/\r\n?/g,`
|
|
71
71
|
`);else if(a.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(a.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(a.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(a.text(e[n]),t,!/\S/.test(e[n]));n=``}else n=n.replace(/\r?\n|\r/g,` `);n&&this.insertNode(a.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;(e.tagName==`PRE`||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),o;si.hasOwnProperty(a)&&this.parser.normalizeLists&&di(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));out:if(s?s.ignore:oi.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,t);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let n,r=this.needsBlock;if(ai.hasOwnProperty(a))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break out}let o=s&&s.skip?t:this.readStyles(e,t);o&&this.addAll(e,o),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,s,n,s.consuming===!1?o:void 0)}this.localPreserveWS=r}leafFallback(e,t){e.nodeName==`BR`&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
72
72
|
`),t)}ignoreFallback(e,t){e.nodeName==`BR`&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text(`-`),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e;;){let n=this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),n.consuming===!1)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,a;if(t.node)if(a=this.parser.schema.nodes[t.node],a.isLeaf)this.insertNode(a.create(t.attrs),n,e.nodeName==`BR`)||this.leafFallback(e,n);else{let e=this.enter(a,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;typeof t.contentElement==`string`?r=e.querySelector(t.contentElement):typeof t.contentElement==`function`?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(o)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let a=n?e.childNodes[n]:e.firstChild,o=r==null?null:e.childNodes[r];a!=o;a=a.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(a,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,a=0;t>=0;t--){let o=this.nodes[t],s=o.findWrapping(e);if(s&&(!r||r.length>s.length+a)&&(r=s,i=o,!s.length))break;if(o.solid){if(n)break;a+=2}}if(!r)return null;this.sync(i);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&=t.match.matchType(e.type);let n=lr.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):mi(i.type,e.type))&&(n=i.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let i=this.findPlace(e.create(t),n,!1);return i&&=this.enterInner(e,t,n,!0,r),i}enterInner(e,t,n,r=!1,i){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let o=ci(e,i,a.options);a.options&4&&a.content.length==0&&(o|=4);let s=lr.none;return n=n.filter(t=>(a.type?a.type.allowsMarkType(t.type):mi(t.type,e))?(s=t.addToSet(s),!1):!0),this.nodes.push(new li(e,t,s,r,null,o)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=1);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf(`|`)>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split(`/`),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+ +!r,a=(e,o)=>{for(;e>=0;e--){let s=t[e];if(s==``){if(e==t.length-1||e==0)continue;for(;o>=i;o--)if(a(e-1,o))return!0;return!1}else{let e=o>0||o==0&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!e||e.name!=s&&!e.isInGroup(s))return!1;o--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}};function di(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=t.nodeType==1?t.nodeName.toLowerCase():null;e&&si.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):e==`li`?n=t:e&&(n=null)}}function fi(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function pi(e){let t={};for(let n in e)t[n]=e[n];return t}function mi(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let a=[],o=e=>{a.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||a.indexOf(i)<0&&o(i))return!0}};if(o(i.contentMatch))return!0}}var hi=class e{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||=_i(t).createDocumentFragment();let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,a=0;for(;n<i.length&&a<e.marks.length;){let t=e.marks[a];if(!this.marks[t.type.name]){a++;continue}if(!t.eq(i[n][0])||t.type.spec.spanning===!1)break;n++,a++}for(;n<i.length;)r=i.pop()[1];for(;a<e.marks.length;){let n=e.marks[a++],o=this.serializeMark(n,e.isInline,t);o&&(i.push([n,r]),r.appendChild(o.dom),r=o.contentDOM||o.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){let{dom:n,contentDOM:r}=xi(_i(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw RangeError(`Content hole not allowed in a leaf node spec`);this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&xi(_i(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return xi(e,t,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(e){let t=gi(e.nodes);return t.text||=e=>e.text,t}static marksFromSchema(e){return gi(e.marks)}};function gi(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function _i(e){return e.document||window.document}const vi=new WeakMap;function yi(e){let t=vi.get(e);return t===void 0&&vi.set(e,t=bi(e)),t}function bi(e){let t=null;function n(e){if(e&&typeof e==`object`)if(Array.isArray(e))if(typeof e[0]==`string`)t||=[],t.push(e);else for(let t=0;t<e.length;t++)n(e[t]);else for(let t in e)n(e[t])}return n(e),t}function xi(e,t,n,r){if(typeof t==`string`)return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],a;if(typeof i!=`string`)throw RangeError(`Invalid array passed to renderSpec`);if(r&&(a=yi(r))&&a.indexOf(t)>-1)throw RangeError(`Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.`);let o=i.indexOf(` `);o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s,c=n?e.createElementNS(n,i):e.createElement(i),l=t[1],u=1;if(l&&typeof l==`object`&&l.nodeType==null&&!Array.isArray(l)){u=2;for(let e in l)if(l[e]!=null){let t=e.indexOf(` `);t>0?c.setAttributeNS(e.slice(0,t),e.slice(t+1),l[e]):e==`style`&&c.style?c.style.cssText=l[e]:c.setAttribute(e,l[e])}}for(let i=u;i<t.length;i++){let a=t[i];if(a===0){if(i<t.length-1||i>u)throw RangeError(`Content hole must be the only child of its parent node`);return{dom:c,contentDOM:c}}else{let{dom:t,contentDOM:i}=xi(e,a,n,r);if(c.appendChild(t),i){if(s)throw RangeError(`Multiple content holes`);s=i}}}return{dom:c,contentDOM:s}}const Si=65535,Ci=2**16;function wi(e,t){return e+t*Ci}function Ti(e){return e&Si}function Ei(e){return(e-(e&Si))/Ci}var Di=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&8)>0}get deletedBefore(){return(this.delInfo&5)>0}get deletedAfter(){return(this.delInfo&6)>0}get deletedAcross(){return(this.delInfo&4)>0}},Oi=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(e){let t=0,n=Ti(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[e*3+2]-this.ranges[e*3+1];return this.ranges[n*3]+t+Ei(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let s=this.ranges[o]-(this.inverted?r:0);if(s>e)break;let c=this.ranges[o+i],l=this.ranges[o+a],u=s+c;if(e<=u){let i=c?e==s?-1:e==u?1:t:t,a=s+r+(i<0?0:l);if(n)return a;let d=e==(t<0?s:u)?null:wi(o/3,e-s),f=e==s?2:e==u?1:4;return(t<0?e!=s:e!=u)&&(f|=8),new Di(a,f,d)}r+=l-c}return n?e+r:new Di(e+r,0,null)}touches(e,t){let n=0,r=Ti(t),i=this.inverted?2:1,a=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let o=this.ranges[t]-(this.inverted?n:0);if(o>e)break;let s=this.ranges[t+i];if(e<=o+s&&t==r*3)return!0;n+=this.ranges[t+a]-s}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let a=this.ranges[r],o=a-(this.inverted?i:0),s=a+(this.inverted?0:i),c=this.ranges[r+t],l=this.ranges[r+n];e(o,o+c,s,s+l),i+=l-c}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?`-`:``)+JSON.stringify(this.ranges)}static offset(t){return t==0?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}};Oi.empty=new Oi([]);var ki=class e{constructor(e,t,n=0,r=e?e.length:0){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new e(this._maps,this.mirror,t,n)}appendMap(e,t){this.ownData||=(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],r!=null&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||=[],this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),r!=null&&r>t?n-r-1:void 0)}}invert(){let t=new e;return t.appendMappingInverted(this),t}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this._maps[n].mapResult(e,t);if(i.recover!=null){let t=this.getMirror(n);if(t!=null&&t>n&&t<this.to){n=t,e=this._maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new Di(e,r,null)}};const Ai=Object.create(null);var ji=class{getMap(){return Oi.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError(`Invalid input for Step.fromJSON`);let n=Ai[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Ai)throw RangeError(`Duplicate use of step JSON ID `+e);return Ai[e]=t,t.prototype.jsonID=e,t}},Mi=class e{constructor(e,t){this.doc=e,this.failed=t}static ok(t){return new e(t,null)}static fail(t){return new e(null,t)}static fromReplace(t,n,r,i){try{return e.ok(t.replace(n,r,i))}catch(t){if(t instanceof ur)return e.fail(t.message);throw t}}};function Ni(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let a=e.child(i);a.content.size&&(a=a.copy(Ni(a.content,t,a))),a.isInline&&(a=t(a,n,i)),r.push(a)}return F.fromArray(r)}var Pi=class e extends ji{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new I(Ni(t.content,(e,t)=>!e.isAtom||!t.type.allowsMarkType(this.mark.type)?e:e.mark(this.mark.addToSet(e.marks)),r),t.openStart,t.openEnd);return Mi.fromReplace(e,this.from,this.to,i)}invert(){return new Fi(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`addMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for AddMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};ji.jsonID(`addMark`,Pi);var Fi=class e extends ji{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new I(Ni(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return Mi.fromReplace(e,this.from,this.to,n)}invert(){return new Pi(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`removeMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for RemoveMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};ji.jsonID(`removeMark`,Fi);var Ii=class e extends ji{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Mi.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Mi.fromReplace(e,this.pos,this.pos+1,new I(F.from(n),0,+!t.isLeaf))}invert(t){let n=t.nodeAt(this.pos);if(n){let t=this.mark.addToSet(n.marks);if(t.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(t))return new e(this.pos,n.marks[r]);return new e(this.pos,this.mark)}}return new Li(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`addNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for AddNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};ji.jsonID(`addNodeMark`,Ii);var Li=class e extends ji{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Mi.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Mi.fromReplace(e,this.pos,this.pos+1,new I(F.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Ii(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`removeNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for RemoveNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};ji.jsonID(`removeNodeMark`,Li);var Ri=class e extends ji{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&Bi(e,this.from,this.to)?Mi.fail(`Structure replace would overwrite content`):Mi.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Oi([this.from,this.to-this.from,this.slice.size])}invert(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.to,-1),r=this.from==this.to&&e.MAP_BIAS<0?n:t.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new e(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?I.empty:new I(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?I.empty:new I(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:`replace`,from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for ReplaceStep.fromJSON`);return new e(n.from,n.to,I.fromJSON(t,n.slice),!!n.structure)}};Ri.MAP_BIAS=1,ji.jsonID(`replace`,Ri);var zi=class e extends ji{constructor(e,t,n,r,i,a,o=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=a,this.structure=o}apply(e){if(this.structure&&(Bi(e,this.from,this.gapFrom)||Bi(e,this.gapTo,this.to)))return Mi.fail(`Structure gap-replace would overwrite content`);let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Mi.fail(`Gap is not a flat range`);let n=this.slice.insertAt(this.insert,t.content);return n?Mi.fromReplace(e,this.from,this.to,n):Mi.fail(`Content does not fit in gap`)}getMap(){return new Oi([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),a=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||a>r.pos?null:new e(n.pos,r.pos,i,a,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:`replaceAround`,from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`||typeof n.gapFrom!=`number`||typeof n.gapTo!=`number`||typeof n.insert!=`number`)throw RangeError(`Invalid input for ReplaceAroundStep.fromJSON`);return new e(n.from,n.to,n.gapFrom,n.gapTo,I.fromJSON(t,n.slice),n.insert,!!n.structure)}};ji.jsonID(`replaceAround`,zi);function Bi(e,t,n){let r=e.resolve(t),i=n-t,a=r.depth;for(;i>0&&a>0&&r.indexAfter(a)==r.node(a).childCount;)a--,i--;if(i>0){let e=r.node(a).maybeChild(r.indexAfter(a));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function Vi(e,t,n,r){let i=[],a=[],o,s;e.doc.nodesBetween(t,n,(e,c,l)=>{if(!e.isInline)return;let u=e.marks;if(!r.isInSet(u)&&l.type.allowsMarkType(r.type)){let l=Math.max(c,t),d=Math.min(c+e.nodeSize,n),f=r.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(f)||(o&&o.to==l&&o.mark.eq(u[e])?o.to=d:i.push(o=new Fi(l,d,u[e])));s&&s.to==l?s.to=d:a.push(s=new Pi(l,d,r))}}),i.forEach(t=>e.step(t)),a.forEach(t=>e.step(t))}function Hi(e,t,n,r){let i=[],a=0;e.doc.nodesBetween(t,n,(e,o)=>{if(!e.isInline)return;a++;let s=null;if(r instanceof $r){let t=e.marks,n;for(;n=r.isInSet(t);)(s||=[]).push(n),t=n.removeFromSet(t)}else r?r.isInSet(e.marks)&&(s=[r]):s=e.marks;if(s&&s.length){let r=Math.min(o+e.nodeSize,n);for(let e=0;e<s.length;e++){let n=s[e],c;for(let e=0;e<i.length;e++){let t=i[e];t.step==a-1&&n.eq(i[e].style)&&(c=t)}c?(c.to=r,c.step=a):i.push({style:n,from:Math.max(o,t),to:r,step:a})}}}),i.forEach(t=>e.step(new Fi(t.from,t.to,t.style)))}function Ui(e,t,n,r=n.contentMatch,i=!0){let a=e.doc.nodeAt(t),o=[],s=t+1;for(let t=0;t<a.childCount;t++){let c=a.child(t),l=s+c.nodeSize,u=r.matchType(c.type);if(!u)o.push(new Ri(s,l,I.empty));else{r=u;for(let t=0;t<c.marks.length;t++)n.allowsMarkType(c.marks[t].type)||e.step(new Fi(s,l,c.marks[t]));if(i&&c.isText&&n.whitespace!=`pre`){let e,t=/\r?\n|\r/g,r;for(;e=t.exec(c.text);)r||=new I(F.from(n.schema.text(` `,n.allowedMarks(c.marks))),0,0),o.push(new Ri(s+e.index,s+e.index+e[0].length,r))}}s=l}if(!r.validEnd){let t=r.fillBefore(F.empty,!0);e.replace(s,s,new I(t,0,0))}for(let t=o.length-1;t>=0;t--)e.step(o[t])}function Wi(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Gi(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,i=0;;--n){let a=e.$from.node(n),o=e.$from.index(n)+r,s=e.$to.indexAfter(n)-i;if(n<e.depth&&a.canReplace(o,s,t))return n;if(n==0||a.type.spec.isolating||!Wi(a,o,s))break;o&&(r=1),s<a.childCount&&(i=1)}return null}function Ki(e,t,n){let{$from:r,$to:i,depth:a}=t,o=r.before(a+1),s=i.after(a+1),c=o,l=s,u=F.empty,d=0;for(let e=a,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=F.from(r.node(e).copy(u)),d++):c--;let f=F.empty,p=0;for(let e=a,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,f=F.from(i.node(e).copy(f)),p++):l++;e.step(new zi(c,l,o,s,new I(u.append(f),d,p),u.size-d,!0))}function qi(e,t,n=null,r=e){let i=Yi(e,t),a=i&&Xi(r,t);return a?i.map(Ji).concat({type:t,attrs:n}).concat(a.map(Ji)):null}function Ji(e){return{type:e,attrs:null}}function Yi(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.contentMatchAt(r).findWrapping(t);if(!a)return null;let o=a.length?a[0]:t;return n.canReplaceWith(r,i,o)?a:null}function Xi(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.child(r),o=t.contentMatch.findWrapping(a.type);if(!o)return null;let s=(o.length?o[o.length-1]:t).contentMatch;for(let e=r;s&&e<i;e++)s=s.matchType(n.child(e).type);return!s||!s.validEnd?null:o}function Zi(e,t,n){let r=F.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw RangeError(`Wrapper type given to Transform.wrap does not form valid content of its parent wrapper`)}r=F.from(n[e].type.create(n[e].attrs,r))}let i=t.start,a=t.end;e.step(new zi(i,a,i,a,new I(r,0,0),n.length,!0))}function Qi(e,t,n,r,i){if(!r.isTextblock)throw RangeError(`Type given to setBlockType should be a textblock`);let a=e.steps.length;e.doc.nodesBetween(t,n,(t,n)=>{let o=typeof i==`function`?i(t):i;if(t.isTextblock&&!t.hasMarkup(r,o)&&ta(e.doc,e.mapping.slice(a).map(n),r)){let i=null;if(r.schema.linebreakReplacement){let e=r.whitespace==`pre`,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?i=!1:!e&&t&&(i=!0)}i===!1&&ea(e,t,n,a),Ui(e,e.mapping.slice(a).map(n,1),r,void 0,i===null);let s=e.mapping.slice(a),c=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new zi(c,l,c+1,l-1,new I(F.from(r.create(o,null,t.marks)),0,0),1,!0)),i===!0&&$i(e,t,n,a),!1}})}function $i(e,t,n,r){t.forEach((i,a)=>{if(i.isText){let o,s=/\r?\n|\r/g;for(;o=s.exec(i.text);){let i=e.mapping.slice(r).map(n+1+a+o.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}})}function ea(e,t,n,r){t.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+a);e.replaceWith(i,i+1,t.type.schema.text(`
|
|
@@ -354,4 +354,4 @@ Read more at https://docs.orama.com/docs/orama-js/plugins/plugin-secure-proxy#pl
|
|
|
354
354
|
`);if(!(t[0]??``).startsWith(`template:`))return null;let n=[t[0]??``],r=1;for(;r<t.length;){let e=t[r]??``;if(/^[ \t]/.test(e)){n.push(e),r++;continue}if(e.trim()===``){let i=r+1;for(;i<t.length&&(t[i]??``).trim()===``;)i++;if(i<t.length&&/^[ \t]/.test(t[i]??``)){n.push(e),r++;continue}}break}let i=F9(n.join(`
|
|
355
355
|
`))[P9];return{identity:typeof i==`object`&&i&&!Array.isArray(i)?i:{},docFrontmatterText:t.slice(r).join(`
|
|
356
356
|
`).replace(/\n+$/,``)}}function L9(e){let t=e.charCodeAt(0)===65279?e.slice(1):e,{frontmatter:n,body:r}=Qm(t);if(n===``)return{identity:{},starterContent:t};let i=eh(n),a=Ite(i);if(a)return{identity:a.identity,starterContent:I9(a.docFrontmatterText,r)};let{frontmatter:o}=Qm(r);if(o!==``)return{identity:F9(i),starterContent:r};let s=F9(i);return typeof s.title==`string`?{identity:s,starterContent:r}:{identity:{},starterContent:I9(i,r)}}function Lte(e,t){let{docFrontmatterText:n,markdown:r}=Fte(t),i={};for(let[t,n]of Object.entries(e))n!==void 0&&(i[t]=n);let a=(0,at.stringify)({[P9]:i});return`---\n${n.trim()===``?a:`${a}${n}\n`}---\n${r}`}function Rte(e){return L9(e).starterContent}const R9=e=>e*8+4;R9(92),R9(40);const zte=/^(#{1,6})\s+(.+)$/;function Bte(e,t){let n=(e.endsWith(`\r`)?e.slice(0,-1):e).match(zte);if(!n)return null;let r=n[2].trim(),i=KZ(r,t);return i?{level:n[1].length,text:r,slug:i}:null}Array.from({length:256},(e,t)=>(t+256).toString(16).slice(1));const Vte={fileSystem:`File System`,gitUpstream:`Git (upstream)`,service:`OpenKnowledge (service)`,generator:`OpenKnowledge (generated)`},Hte=[`#D97757`,`#1B1912`,`#F9F3E9`,`#7A9DFF`,`#8534F3`,`#9663F0`,`#727CF3`],Ute={claude:`#D97757`,cursor:`#1B1912`,windsurf:`#0B100F`,openai:`#7A9DFF`,github:`#8534F3`,cline:`#9663F0`,bot:`#727CF3`};function Wte(e,t=Hte){let n=0;for(let t of e)n=(n<<5)-n+t.charCodeAt(0)|0;return t[Math.abs(n)%t.length]}const Gte={"claude-code":`claude`,"claude-ai":`claude`,cursor:`cursor`,"cursor-vscode":`cursor`,cascade:`windsurf`,codex:`openai`,"codex-mcp-client":`openai`,copilot:`github`,cline:`cline`,"claude-acp":`claude`,"codex-acp":`openai`,"github-copilot-cli":`github`};function z9(e){return e?Gte[e]||(e.startsWith(`local-agent-mode-`)?`claude`:`bot`):`bot`}const Kte={claude:`Claude`,cursor:`Cursor`,windsurf:`Windsurf`,openai:`Codex`,github:`Copilot`,cline:`Cline`};function qte(e){let t=e?.trim();return t?Kte[z9(t)]??t:`Agent`}function B9(e,t){let n=e.trim();if(!n||/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n)||n.startsWith(`//`)||n.startsWith(`#`))return null;let r=n.indexOf(`#`),i=r>=0?n.slice(0,r):n,a=r>=0?n.slice(r+1):null,o=(i.split(`?`)[0]??``).trim();if(!o)return null;let s=(o.split(`/`).pop()??``).match(/\.([a-z0-9]+)$/i);if(s){let e=(s[1]??``).toLowerCase();if(e!==`md`&&e!==`mdx`)return null}let c=o.toLowerCase(),l=c.endsWith(`.mdx`)?o.slice(0,-4):c.endsWith(`.md`)?o.slice(0,-3):o,u=l.startsWith(`/`),d=u?l.slice(1):l,f=u?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of d.split(`/`))if(e===`..`){if(f.length===0)return null;f.pop()}else e!==`.`&&e!==``&&f.push(e);return f.length===0?null:{docName:f.join(`/`),anchor:a||null}}function Jte(e){throw Error(`Unhandled ClassifiedLinkTarget variant: ${JSON.stringify(e)}`)}const V9=/^[a-zA-Z][a-zA-Z\d+\-.]*:/;function H9(e){let t=(e.split(/[?#]/)[0]??e).match(/\.([a-z0-9]+)$/i);return t?(t[1]??``).toLowerCase():null}function U9(e){let t=e.trim();return V9.test(t)||t.startsWith(`//`)}function Yte(e,t){let n=e.trim();if(!n)return null;if(n.startsWith(`#`)){let e=n.slice(1).trim();return e?{kind:`anchor`,anchor:e}:null}if(U9(n))return{kind:`external`,url:n};let r=n.indexOf(`#`),i=r<0?n:n.slice(0,r),a=Qt(i,t);if(a)return{kind:`doc`,docName:a,anchor:r<0?null:n.slice(r+1)};let o=tee(i,t);if(o)return{kind:`doc`,docName:o,anchor:r<0?null:n.slice(r+1)};let s=B9(n,t);if(s)return{kind:`doc`,docName:s.docName,anchor:s.anchor};let c=H9(n);return c&&c!==`md`&&c!==`mdx`?{kind:`asset`,url:n,ext:c}:null}function W9(e,t){let n=e.trim();if(!n)return null;if(U9(n))return{kind:`external`,url:t?`${n}#${t}`:n};let r=H9(n);return r&&r!==`md`&&r!==`mdx`?{kind:`asset`,url:n,ext:r}:{kind:`doc`,docName:n,anchor:t?.trim()||null}}function Xte(e,t){let n=e.trim();if(!n||V9.test(n)||n.startsWith(`//`)||n.startsWith(`#`))return null;let r=n.indexOf(`#`),i=((r>=0?n.slice(0,r):n).split(`?`)[0]??``).trim();if(!i)return null;let a=i.startsWith(`/`),o=a?i.slice(1):i,s=a?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of o.split(`/`))if(e===`..`){if(s.length===0)return null;s.pop()}else e!==`.`&&e!==``&&s.push(e);return s.length===0?null:s.join(`/`)}function G9(e){let t=e;return t.startsWith(`./`)&&(t=t.slice(2)),t.startsWith(`/`)&&(t=t.slice(1)),t}function K9(e){let t=e.lastIndexOf(`/`);return t===-1?e:e.slice(t+1)}function q9(e){let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function J9(e){return e.split(`/`).filter(e=>e!==``)}function Zte(e,t){let n=q9(t);return e===``||n===e?!0:n.startsWith(`${e}/`)}function Y9(e,t){let n=q9(t);if(e===n)return 0;let r=e===``?n:n.slice(e.length+1);return r===``?0:J9(r).length}function X9(e,t){let n=J9(e),r=J9(t),i=0;for(;i<n.length&&i<r.length&&n[i]===r[i];)i++;return n.length-i+(r.length-i)}function Qte(){let e=new Map;function t(t){let n=G9(t);if(n===``)return;let r=K9(n);if(r===``)return;let i=r.toLowerCase(),a=e.get(i);if(!a){e.set(i,[n]);return}a.includes(n)||a.push(n)}function n(t){let n=G9(t),r=K9(n).toLowerCase(),i=e.get(r);if(!i)return;let a=i.indexOf(n);a!==-1&&(i.splice(a,1),i.length===0&&e.delete(r))}function r(e,r){n(e),t(r)}function i(t,n){let r=t.toLowerCase(),i=e.get(r);if(!i||i.length===0)return null;if(i.length===1)return i[0];let a=q9(G9(n)),o=[],s=[];for(let e of i)Zte(a,e)?o.push(e):s.push(e);return o.length>0?(e=>{let t=e[0],n=Y9(a,t);for(let r=1;r<e.length;r++){let i=e[r],o=Y9(a,i);(o<n||o===n&&i<t)&&(t=i,n=o)}return t})(o):(e=>{let t=e[0],n=X9(a,q9(t));for(let r=1;r<e.length;r++){let i=e[r],o=X9(a,q9(i));(o<n||o===n&&i<t)&&(t=i,n=o)}return t})(s)}function a(){let t=new Map;for(let[n,r]of e)t.set(n,[...r]);return t}function o(){e.clear()}return{add:t,remove:n,rename:r,resolveEmbed:i,clear:o,snapshot:a,size:()=>e.size}}function $te(e){if(!e)return[];let t=e.split(`/`),n=[],r=``;for(let e of t)r=r?`${r}/${e}`:e,n.push(r);return n}function ene(e,t){if(e.size===0)return new Set;if(t===``)return new Set(e);let n=new Set,r=`${t}/`;for(let i of e)(i===t||i.startsWith(r))&&n.add(i);return n}function Z9(e){return`pagesBySlug`in e}function tne(e){return Z9(e)?e.pages:e}function nne(e,t){return Z9(e)?e.assetPaths??new Set:t??new Set}function rne(e,t){return Z9(e)?e.filePaths??new Set:t??new Set}function Q9(e,t){return e<t?-1:+(e>t)}function ine(e,t){let n=new Map;for(let r of e){let e=t(r);e&&!n.has(e)&&n.set(e,r)}return n}function ane(e,t){let n=new Map,r=[...e].sort(Q9);for(let e of r){let r=e.lastIndexOf(`/`),i=t(r===-1?e:e.slice(r+1));i&&!n.has(i)&&n.set(i,e)}return n}function one(e,t){let n=WZ(e);if(n){if(Z9(t))return t.pagesBySlug.get(n);for(let e of t)if(WZ(e)===n)return e}}function sne(e,t){if(e.includes(`/`))return;let n=WZ(e);if(!n)return;if(Z9(t))return t.pagesByBasename?.get(n);let r;for(let e of t){let t=e.lastIndexOf(`/`);WZ(t===-1?e:e.slice(t+1))===n&&(r===void 0||Q9(e,r)<0)&&(r=e)}return r}function cne(e){let t=e.trim();if(!t)return[];let n=WZ(t);return n.length>0&&n!==t?[n]:[]}function $9(e,t){let n=e.trim();if(!n)return;let r=tne(t);if(r.has(n))return n;let i=one(n,t);if(i)return i;for(let e of cne(n))if(r.has(e))return e;return lne(n,r)||sne(n,t)}function lne(e,t){let n=`${e}/index`;if(t.has(n))return n;let r=e.lastIndexOf(`/`),i=r===-1?e:e.slice(r+1),a=i?`${e}/${i}`:null;if(a&&t.has(a))return a}function une(e){let t=((e.trim().split(`#`)[0]??``).trim().split(`?`)[0]??``).trim();return t.startsWith(`/`)?t.slice(1):t}function dne(e,t,n){let r=une(e);if(!r)return null;let i=r.toLowerCase(),a=n?[t,n]:[t];for(let e of a){if(e.has(r))return r;for(let t of e)if(t.toLowerCase()===i)return t}if(r.includes(`/`))return null;let o=[];for(let e of a)for(let t of e){let e=t.lastIndexOf(`/`);(e===-1?t:t.slice(e+1)).toLowerCase()===i&&o.push(t)}return o.length===0?null:o.sort(Q9)[0]??null}function fne(e,t,n){let r=W9(e,t);return r===null||r.kind!==`asset`||dne(r.url,nne(n),rne(n))!==null||$9(e,n)===void 0?r:{kind:`doc`,docName:e.trim(),anchor:t?.trim()||null}}export{n6 as $,DG as $a,dQ as $i,b0 as $n,F as $o,Z$ as $r,en as $s,p0 as $t,kte as A,OX as Aa,ZQ as Ai,R0 as An,zb as Ao,o1 as Ar,vn as As,T4 as At,ite as B,BX as Ba,MQ as Bi,N0 as Bn,Xb as Bo,p1 as Br,Rt as Bs,H2 as Bt,L9 as C,mZ as Ca,Se as Cc,a$ as Ci,o2 as Cn,bx as Co,k1 as Cr,fn as Cs,J4 as Ct,Pte as D,dZ as Da,n$ as Di,W0 as Dn,ux as Do,O1 as Dr,bn as Ds,B4 as Dt,Mte as E,pZ as Ea,QQ as Ei,K0 as En,cx as Eo,D1 as Er,mn as Es,H4 as Et,_te as F,YX as Fa,UQ as Fi,V0 as Fn,dx as Fo,s1 as Fr,ln as Fs,_4 as Ft,Yee as G,_X as Ga,gQ as Gi,M2 as Gn,xb as Go,v1 as Gr,Wt as Gs,V2 as Gt,ste as H,ZX as Ha,DQ as Hi,u2 as Hn,Eb as Ho,y1 as Hr,zt as Hs,G2 as Ht,vte as I,DX as Ia,qQ as Ii,w0 as In,fx as Io,c1 as Ir,cn as Is,a4 as It,X7 as J,kY as Ja,wQ as Ji,u0 as Jn,$m as Jo,Q$ as Jr,qt as Js,R2 as Jt,Kee as K,zY as Ka,TQ as Ki,F0 as Kn,vb as Ko,z$ as Kr,Gt as Ks,I2 as Kt,ute as L,UX as La,VQ as Li,f2 as Ln,ix as Lo,n1 as Lr,Lt as Ls,i4 as Lt,bte as M,kX as Ma,KQ as Mi,x2 as Mn,Wb as Mo,i1 as Mr,xn as Ms,y4 as Mt,Tte as N,GX as Na,JQ as Ni,S2 as Nn,qb as No,h1 as Nr,gn as Ns,v4 as Nt,M9 as O,QX as Oa,YQ as Oi,I0 as On,Lb as Oo,A1 as Or,_n as Os,k4 as Ot,xte as P,KX as Pa,HQ as Pi,B0 as Pn,Yb as Po,g1 as Pr,un as Ps,g4 as Pt,t6 as Q,mG as Qa,uQ as Qi,y0 as Qn,Ka as Qo,G$ as Qr,on as Qs,f0 as Qt,dte as R,EX as Ra,jQ as Ri,v2 as Rn,Qb as Ro,d1 as Rr,Ht as Rs,J2 as Rt,Rte as S,cZ as Sa,we as Sc,r$ as Si,l2 as Sn,xx as So,z1 as Sr,dn as Ss,q4 as St,N9 as T,nZ as Ta,$Q as Ti,G0 as Tn,sx as To,E1 as Tr,pn as Ts,F4 as Tt,lte as U,xX as Ua,FQ as Ui,d2 as Un,wb as Uo,b1 as Ur,Xt as Us,U2 as Ut,A9 as V,XX as Va,OQ as Vi,P0 as Vn,Ab as Vo,m1 as Vr,Bt as Vs,K2 as Vt,cte as W,wX as Wa,RQ as Wi,j2 as Wn,Cb as Wo,_1 as Wr,Ut as Ws,W2 as Wt,a9 as X,pG as Xa,xQ as Xi,x0 as Xn,eh as Xo,J$ as Xr,Jt as Xs,F2 as Xt,Wee as Y,OY as Ya,CQ as Yi,c0 as Yn,Qm as Yo,X$ as Yr,Kt as Ys,L2 as Yt,Q3 as Z,hG as Za,bQ as Zi,h0 as Zn,np as Zo,K$ as Zr,nn as Zs,d0 as Zt,qte as _,OZ as _a,Qe as _c,p$ as _i,A0 as _n,Sx as _o,B1 as _r,On as _s,T3 as _t,$te as a,BZ as aa,Nt as ac,F$ as ai,H0 as an,tU as ao,D0 as ar,er as as,W3 as at,P9 as b,lZ as ba,De as bc,l$ as bi,s2 as bn,mx as bo,L1 as br,En as bs,e3 as bt,Jte as c,IZ as ca,Pt as cc,D$ as ci,Y0 as cn,Oz as co,Q1 as cr,tr as cs,z3 as ct,U9 as d,kZ as da,Ct as dc,S$ as di,n2 as dn,uz as do,K1 as dr,Rn as ds,R3 as dt,QZ as ea,Zt as ec,$$ as ei,c2 as en,yG as eo,S0 as er,nr as es,r6 as et,Xte as f,yZ as fa,ot as fc,h$ as fi,Q0 as fn,$R as fo,q1 as fr,zn as fs,I3 as ft,Wte as g,DZ as ga,nt as gc,c$ as gi,_2 as gn,gx as go,U1 as gr,Mn as gs,O3 as gt,Vte as h,vZ as ha,rt as hc,s$ as hi,t2 as hn,Tx as ho,W1 as hr,jn as hs,D3 as ht,$9 as i,WZ as ia,Ft as ic,V$ as ii,E2 as in,gW as io,g0 as ir,qn as is,G3 as it,yte as j,WX as ja,GQ as ji,z0 as jn,Gb as jo,r1 as jr,Cn as js,b4 as jt,Ote as k,RX as ka,XQ as ki,L0 as kn,Bb as ko,a1 as kr,yn as ks,E4 as kt,Yte as l,LZ as la,wt as lc,v$ as li,X0 as ln,Dz as lo,e0 as lr,Vn as ls,U3 as lt,Ute as m,gZ as ma,bt as mc,o$ as mi,e2 as mn,BN as mo,Z1 as mr,An as ms,F3 as mt,ine as n,lQ as na,rn as nc,H$ as ni,C2 as nn,dG as no,_0 as nr,Jn as ns,q3 as nt,ene as o,zZ as oa,jt as oc,M$ as oi,q0 as on,UH as oo,s0 as or,Wn as os,V3 as ot,B9 as p,SZ as pa,vt as pc,g$ as pi,$0 as pn,YP as po,J1 as pr,Ln as ps,k3 as pt,t9 as q,VY as qa,SQ as qi,O0 as qn,mb as qo,B$ as qr,It as qs,z2 as qt,fne as r,cQ as ra,sn as rc,U$ as ri,D2 as rn,ZW as ro,v0 as rr,Un as rs,K3 as rt,Qte as s,RZ as sa,Mt as sc,w$ as si,J0 as sn,HH as so,n0 as sr,Yn as ss,B3 as st,ane as t,sQ as ta,Qt as tc,W$ as ti,T0 as tn,uG as to,C0 as tr,Hn as ts,Z3 as tt,W9 as u,NZ as ua,St as uc,y$ as ui,r2 as un,xz as uo,G1 as ur,Bn as us,H3 as ut,z9 as v,rZ as va,it as vc,m$ as vi,A2 as vn,hx as vo,V1 as vr,kn as vs,i3 as vt,Nte as w,hZ as wa,t$ as wi,U0 as wn,vx as wo,T1 as wr,Sn as ws,G4 as wt,Lte as x,eZ as xa,Ce as xc,f$ as xi,k2 as xn,Cx as xo,R1 as xr,wn as xs,n3 as xt,Bte as y,iZ as ya,Ee as yc,u$ as yi,P2 as yn,yx as yo,H1 as yr,Tn as ys,c3 as yt,rte as z,HX as za,AQ as zi,b2 as zn,ax as zo,l1 as zr,Vt as zs,$2 as zt};
|
|
357
|
-
//# sourceMappingURL=src-
|
|
357
|
+
//# sourceMappingURL=src-BimG4LM6.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./src-BimG4LM6.mjs";import"./resolve-project-root-DpSmoodv.mjs";import"./src-BZ35NJ2E.mjs";import"./acp-harness-probe-C2IHuVgy.mjs";import"./init-097BT-JV.mjs";import{n as e}from"./loader-C7KxwdAY.mjs";import"./skill-teardown-D66Xjjil.mjs";import"./preview-ByTvhfy1.mjs";import"./mcp-migrate-event-B1gJf6bG.mjs";export{e as loadConfig};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as e,Cc as t,Fs as n,Ls as r,W as i,_s as a,g as o,ms as s,qs as c,v as l,vs as u}from"./src-BxdlvOrw.mjs";import{$ as d,$i as f,$n as p,$r as m,$t as h,A as g,Aa as _,Ai as v,An as y,Ar as b,At as x,B as S,Bi as C,Bn as w,Br as T,Bt as E,C as D,Ca as O,Ci as k,Cn as A,Cr as j,Ct as M,D as N,Da as P,Di as F,Dn as I,Dr as L,Dt as R,E as z,Ea as B,Ei as V,En as H,Er as U,Et as W,F as G,Fi as K,Fn as q,Fr as J,Ft as Y,G as X,Gi as Z,Gn as Q,Gt as $,H as ee,Hi as te,Hn as ne,Hr as re,Ht as ie,I as ae,Ii as oe,In as se,Ir as ce,It as le,J as ue,Ji as de,Jn as fe,Jt as pe,K as me,Ki as he,Kn as ge,Kt as _e,L as ve,Li as ye,Ln as be,Lr as xe,Lt as Se,M as Ce,Mi as we,Mn as Te,Mr as Ee,Mt as De,N as Oe,Ni as ke,Nn as Ae,Nr as je,Nt as Me,O as Ne,Oa as Pe,Oi as Fe,On as Ie,Or as Le,Ot as Re,P as ze,Pi as Be,Pn as Ve,Pr as He,Pt as Ue,Q as We,Qi as Ge,Qn as Ke,Qr as qe,Qt as Je,R as Ye,Ri as Xe,Rn as Ze,Rr as Qe,Rt as $e,S as et,Sa as tt,Si as nt,Sn as rt,Sr as it,St as at,T as ot,Ta as st,Ti as ct,Tn as lt,Tr as ut,Tt as dt,U as ft,Ui as pt,Un as mt,Ur as ht,Ut as gt,V as _t,Vi as vt,Vn as yt,Vr as bt,Vt as xt,W as St,Wi as Ct,Wn as wt,Wt as Tt,X as Et,Xi as Dt,Xn as Ot,Xr as kt,Xt as At,Y as jt,Yi as Mt,Yn as Nt,Yr as Pt,Yt as Ft,Z as It,Zi as Lt,Zn as Rt,Zr as zt,Zt as Bt,_ as Vt,_a as Ht,_i as Ut,_n as Wt,_r as Gt,_t as Kt,a as qt,aa as Jt,ai as Yt,an as Xt,ar as Zt,at as Qt,b as $t,ba as en,bi as tn,bn as nn,br as rn,bt as an,c as on,ca as sn,ci as cn,cn as ln,cr as un,ct as dn,d as fn,da as pn,di as mn,dn as hn,dr as gn,ea as _n,ei as vn,en as yn,er as bn,et as xn,f as Sn,fa as Cn,fi as wn,fn as Tn,fr as En,g as Dn,ga as On,gi as kn,gn as An,gr as jn,gt as Mn,h as Nn,ha as Pn,hi as Fn,hn as In,hr as Ln,i as Rn,ia as zn,ii as Bn,in as Vn,ir as Hn,it as Un,j as Wn,ja as Gn,ji as Kn,jn as qn,jr as Jn,jt as Yn,k as Xn,ka as Zn,kn as Qn,kr as $n,kt as er,l as tr,la as nr,li as rr,ln as ir,lr as ar,lt as or,m as sr,ma as cr,mi as lr,mn as ur,mr as dr,n as fr,na as pr,ni as mr,nn as hr,nr as gr,nt as _r,o as vr,oa as yr,oi as br,on as xr,or as Sr,ot as Cr,p as wr,pa as Tr,pi as Er,pn as Dr,pr as Or,q as kr,qi as Ar,qn as jr,qt as Mr,r as Nr,ra as Pr,ri as Fr,rn as Ir,rr as Lr,rt as Rr,s as zr,sa as Br,si as Vr,sn as Hr,sr as Ur,st as Wr,t as Gr,ta as Kr,ti as qr,tn as Jr,tr as Yr,tt as Xr,u as Zr,ua as Qr,ui as $r,un as ei,ur as ti,v as ni,va as ri,vi as ii,vn as ai,vr as oi,vt as si,w as ci,wa as li,wi as ui,wn as di,wr as fi,wt as pi,x as mi,xa as hi,xi as gi,xn as _i,xr as vi,xt as yi,y as bi,ya as xi,yi as Si,yn as Ci,yr as wi,yt as Ti,z as Ei,zi as Di,zn as Oi,zr as ki,zt as Ai}from"./src-_fp0S8Pp.mjs";import{C as ji,E as Mi,T as Ni,_ as Pi,b as Fi,c as Ii,d as Li,g as Ri,i as zi,l as Bi,m as Vi,n as Hi,p as Ui,s as Wi,t as Gi,u as Ki,v as qi,w as Ji,x as Yi,y as Xi}from"./fs-traced-CJ0NSnI0.mjs";import{a as Zi,d as Qi,f as $i,i as ea,l as ta,n as na,r as ra,t as ia,u as aa}from"./logger-DFxEUjvj.mjs";import{C as oa,S as sa,_ as ca,a as la,b as ua,c as da,d as fa,g as pa,h as ma,i as ha,l as ga,m as _a,n as va,o as ya,p as ba,r as xa,s as Sa,t as Ca,u as wa,x as Ta}from"./server-lock-BmwIVWMl.mjs";export{tt as AGENT_ID_MAX_LEN,O as AGENT_ID_RE,Xe as AGENT_WRITE_ORIGIN,Zn as AcpPermissionStore,B as AcpRegistry,ke as AcpThreadManager,Kn as AgentFocusBroadcaster,v as AgentPresenceBroadcaster,Di as AgentSessionCapacityError,C as AgentSessionManager,Kt as AutoStartDisabledError,Le as BUNDLE_IDS,$n as BUNDLE_SCOPE,b as BUNDLE_SKILL_NAME,Ur as BacklinkIndex,Dt as CC1Broadcaster,r as CC1_CONTRACT_VERSION,Wt as CONFIG_FILENAME,Yr as CONFLICT_MARKER_RE,zt as CURSOR_BUNDLE_PATHS_BY_PLATFORM,Vt as ConfigSchema,pr as DEFAULT_CHECKPOINT_RETENTION,kn as DEFAULT_EMBEDDINGS_DIMENSIONS,ie as DEFAULT_PACK_ID,_t as DocumentDurabilityState,Ut as EMBEDDINGS_API_KEY_ENV,Qn as ExposureConsentError,P as FEATURED_AGENT_IDS,Pr as FILE_SYSTEM_WRITER,Zt as FILE_WATCHER_ORIGIN,$r as FileEmbeddingsBackend,Vn as GIT_PREFLIGHT_FAIL_SPAN_NAME,zn as GIT_UPSTREAM_WRITER,_ as GitDirAccessError,xr as GitNotAvailableError,Hr as GitTooOldError,si as HOCUSPOCUS_AUTH_REJECTION_REASONS,Ti as HocuspocusAuthRejection,an as HocuspocusAuthTokenSchema,lt as HomeProjectRootError,Fr as INSTALLED_AGENTS_SCHEMES,dn as JSON_SCHEMA_DIALECT_2020_12,n as LINEAGE_EPOCH_KEY,Ye as LIVE_DERIVED_INDEX_DEBOUNCE_MS,gt as LOG_MD_TEMPLATE,R as MANAGED_RENAME_ORIGIN,Be as MAX_ACP_THREADS,vt as MAX_AGENT_SESSIONS,oe as MCP_CONNECTION_ID_HEADER,s as MCP_SERVER_NAME,te as MIN_EVICTABLE_IDLE_MS,ln as MIN_GIT_VERSION,ee as MISSING_OK_CONFIG_MESSAGE,Gn as MalformedGitPointerError,xn as McpLogger,ft as MissingOkConfigError,Ct as OBSERVER_SYNC_ORIGIN,ai as OK_OKIGNORE_TEMPLATE,Jn as ONBOARDING_BUNDLE_IDS,a as ORPHAN_MODES,t as PROTOCOL_VERSION,ia as PinoLogger,da as ProcessLockCollisionError,tr as ProjectGitInitError,Re as ROLLBACK_ORIGIN,Ci as ROOT_GITIGNORE_TEMPLATE,ua as RUNTIME_VERSION,Jt as SERVICE_WRITER,j as SKILL_INSTALL_EVENTS_FILE_REL,e as SKILL_STATE_TARGETS,Tt as STARTER_FOLDERS,$ as STARTER_FOLDER_FRONTMATTER_FILENAME,_e as STARTER_PACKS,Mr as STARTER_PACK_IDS,pe as STARTER_TEMPLATES,ot as STATE_MANIFEST_FILENAME,Ta as STATE_SCHEMA_VERSION,c as SYSTEM_DOC_NAME,yn as SeedPrerequisiteError,Jr as SeedRootDirError,Ca as ServerLockCollisionError,Gr as SingleFileNotAFileError,fr as SingleFileNotFoundError,Nr as SingleFileNotMarkdownError,z as StateManifestError,Sr as TagIndex,Ee as USER_GLOBAL_BUNDLE_IDS,Ue as UiLockCollisionError,er as __getShowAllWalkStatsForTesting,x as __resetShowAllWalkStatsForTesting,ga as acquireProcessLock,va as acquireServerLock,Y as acquireUiLock,pt as applyAgentMarkdownWrite,p as applyExternalChange,xt as applySeed,N as assertCompatibleStateManifest,ir as assertGitAvailable,yt as assertNeverDiskEvent,H as assertNotHomeProjectRoot,we as attachAcpThreadSocket,Mn as attachIdleShutdown,ni as bootServer,ar as buildAndOpenSkill,nn as buildConfigYmlContent,jt as buildExecResult,y as buildIngressPolicy,K as buildOkMcpStdioCommand,ut as buildSkillZip,Ft as buildStarterFolderFrontmatterYaml,yr as buildWipTree,je as bundleSkillMdPath,mn as canonicalProjectKey,I as canonicalizeForCompare,ne as classifyEvents,Gi as classifyFsPath,wn as clearAllEmbeddingsKeys,Si as clearContributors,At as coercePackId,o as colorFromSeed,Br as commitUpstreamImport,sn as commitWip,nr as commitWipFromTree,ei as compareSemver,ce as composeEffectiveLinterConfig,xe as composeFrontmatterSchemasConfig,gr as containsConflictMarkers,mt as contentHash,tn as contributorCount,ze as countShadowObjects,G as countStaleAgentWipRefs,ae as countWipRefs,Yn as createApiExtension,W as createAssetServeMiddleware,X as createCollaborationHost,Pt as createContentFilter,kt as createContentFilterAsync,Er as createEmbeddingsSecretStore,Rn as createEphemeralProjectDir,bn as createExternalChangeHandler,Sn as createFileLogger,Ei as createLiveDerivedIndexExtension,kr as createMcpHttpHandler,Bn as createOsProbe,Oe as createPersistenceExtension,D as createServer,Wn as createServerObserverExtension,Ar as createStreamingErrorWriter,na as createTestLogger,lr as describeStoredEmbeddingsKey,Dn as detectClaudeDesktopPresence,hn as detectGit,Ne as detectProjectShape,ti as detectUserSkillHosts,Rr as discoverLockDirs,T as discoverMarkdownlintConfig,Xt as emitPreflightFailureSpan,Et as encodeDocName,It as encodeFolderRoute,We as encodeSkillRoute,Zr as ensureProjectGit,_i as ensureProjectSkillGitignore,de as errorResponse,wt as evictStaleTrackerEntries,De as extractHeadings,Un as extractOkBinaryPath,un as extractWikiLinksFromMarkdown,Tn as fallbackPaths,fn as findEnclosingGitRoot,Oi as findEnclosingProjectRoot,bt as findNativeMarkdownlintFile,wr as flushFileLogger,yi as formatAuthRejectionWire,gi as formatContributors,nt as formatContributorsFrom,Ai as formatPackRationale,Qr as gcCheckpointRefs,Xr as getCurrentMcpLogger,qn as getIngressContext,V as getLocalDir,sr as getLogFilePath,ra as getLogger,Nn as getLogsDir,ca as getMachineId,Xi as getMeter,Ht as getMetrics,Fi as getTracer,ri as handleCollabSocketError,qe as handleSpawnCursor,Te as hasForwardingHeaders,ve as hasGcLogLatch,l as iconFromClientName,xi as incrementCollabSocketFilteredError,en as incrementServerObserverFire,rt as initContent,pn as initShadowRepo,Yi as initTelemetry,$t as initToleranceTelemetryWriter,or as installJsonSchemaDialect,Wr as installPrettyZodErrors,ea as installTestLoggers,gn as installUserSkill,Ze as isAllowedApiOrigin,se as isAllowedWorkspaceHostHeader,Lt as isConfigDoc,at as isHocuspocusAuthRejectionReason,Ie as isHomeDir,Ae as isHostAdmitted,Bt as isKnownPackId,Ge as isLinkIndexExcludedDoc,be as isLoopbackAddress,f as isManagedArtifactDoc,Ve as isOriginAdmitted,u as isOrphanMode,Z as isPairedWriteOrigin,m as isPathWithinDir,q as isPeerAdmitted,sa as isProcessAlive,w as isProjectRoot,_n as isReservedForUserTree,Q as isSelfWrite,Kr as isSystemDoc,mi as isToleranceTelemetryEnabled,oa as isValidLockPid,ge as lastKnownHash,Cn as listRescueCheckpoints,Je as listStarterPacks,Pe as loadCustomAgents,Ce as loadPrincipal,wa as lockBaseUrl,fa as lockFilePath,Zi as loggerFactory,ta as logsCurrentPath,aa as logsPreviousPath,Fn as makeLazyEmbeddingsKeyStore,xa as markServerLockDraining,St as mountMcpAndApi,Hi as normalizeFsPath,He as originGitHubHost,A as packageVersionMajorMinor,M as parseAuthRejectionWire,Dr as parseGitVersion,pi as parseHocuspocusAuthToken,me as parseKeepaliveConnectionId,jr as pathToDocName,E as planSeed,qt as prepareSingleFileOpen,Qt as processCommand,Cr as processUsage,dr as readAllTargets,Ln as readBundleDecision,re as readOwnNativeRules,ba as readProcessLock,_a as readProcessLockDetailed,S as readProjectHeadState,rr as readProjectLocalSemanticConfig,ha as readServerLock,jn as readServerPackageVersion,Gt as readSkillInstallStateSnapshot,Xn as readStateManifest,oi as readTargetRecordedAt,wi as readTargetVersion,le as readUiLock,Lr as reconcile,k as recordContributor,fi as recordSkillInstallEvent,ue as registerAllTools,fe as registerWrite,ma as releaseProcessLock,la as releaseServerLock,Se as releaseUiLock,Nt as removeLastKnownHash,Or as reportSkillInstall,hi as resetMetrics,En as resolveBuiltinSkillHosts,i as resolveBundleEnabled,U as resolveBundledSkillDir,F as resolveContentDir,vn as resolveCursorBinaryDefault,qr as resolveCursorSpawnInvocation,Qe as resolveEffectiveLinterConfig,ii as resolveEmbeddingsCredential,Fe as resolveLockDir,ki as resolveNativeConfigForDoc,ht as resolveNativeMarkdownlintConfig,h as resolvePack,zr as resolvePackageVersion,it as resolveSkillInstallReportSettings,d as resolveUiInfo,ui as restoreContributors,bi as restoreLifecycleFromConflictsJson,Vr as rewriteMarkdownLinksForDocumentRename,cn as rewriteWikiLinksForDocumentRename,ur as runAuthReposSubprocess,In as runAuthStatusSubprocess,hr as runCloneSubprocess,An as runDeviceFlowSubprocess,_r as runWithMcpLogger,br as safeContentPath,Me as safeSubdir,Tr as safetyCheckpoint,ye as sanitizeClientName,cr as saveInMemoryCheckpoint,Pn as saveVersion,dt as seedBasenameIndex,vr as serializeError,ji as setActiveSpanAttributes,he as setupServerObservers,On as shadowGit,Ji as shutdownTelemetry,Qi as spansCurrentPath,$i as spansPreviousPath,mr as spawnDetached,Hn as splitMarkdownBlocks,Ot as startWatcher,Mt as streamingProblemEvent,ct as swapContributors,et as teardownToleranceTelemetryWriter,li as toBroadcasterKey,zi as tracedAppendFileSync,Wi as tracedLinkSync,Ii as tracedMkdir,Bi as tracedMkdirSync,Ki as tracedRename,Li as tracedRenameSync,Ui as tracedRmSync,Vi as tracedRmdirSync,Ri as tracedUnlinkSync,Pi as tracedWriteFile,qi as tracedWriteFileSync,ci as trustSystemCertificates,on as untrackTrackedProjectSkillProjection,Rt as updateLastKnownHash,pa as updateProcessLockPort,ya as updateServerLockPort,$e as updateUiLockPort,st as validateAgentId,Ir as validateCloneInputs,L as validateSkillZip,Sa as waitForServerLockDrain,Yt as withHiddenWindowsConsole,Ni as withSpan,Mi as withSpanSync,rn as writeBundleDecision,J as writeMarkdownlintRule,di as writeRootGitignoreForNewRepo,g as writeStateManifest,vi as writeTargetVersion,Ke as writeTracker};
|
|
1
|
+
import{B as e,Cc as t,Fs as n,Ls as r,W as i,_s as a,g as o,ms as s,qs as c,v as l,vs as u}from"./src-BimG4LM6.mjs";import{$ as d,$i as f,$n as p,$r as m,$t as h,A as g,Aa as _,Ai as v,An as y,Ar as b,At as x,B as S,Bi as C,Bn as w,Br as T,Bt as E,C as D,Ca as O,Ci as k,Cn as A,Cr as j,Ct as M,D as N,Da as P,Di as F,Dn as I,Dr as L,Dt as R,E as z,Ea as B,Ei as V,En as H,Er as U,Et as W,F as G,Fi as K,Fn as q,Fr as J,Ft as Y,G as X,Gi as Z,Gn as Q,Gt as $,H as ee,Hi as te,Hn as ne,Hr as re,Ht as ie,I as ae,Ii as oe,In as se,Ir as ce,It as le,J as ue,Ji as de,Jn as fe,Jt as pe,K as me,Ki as he,Kn as ge,Kt as _e,L as ve,Li as ye,Ln as be,Lr as xe,Lt as Se,M as Ce,Mi as we,Mn as Te,Mr as Ee,Mt as De,N as Oe,Ni as ke,Nn as Ae,Nr as je,Nt as Me,O as Ne,Oa as Pe,Oi as Fe,On as Ie,Or as Le,Ot as Re,P as ze,Pi as Be,Pn as Ve,Pr as He,Pt as Ue,Q as We,Qi as Ge,Qn as Ke,Qr as qe,Qt as Je,R as Ye,Ri as Xe,Rn as Ze,Rr as Qe,Rt as $e,S as et,Sa as tt,Si as nt,Sn as rt,Sr as it,St as at,T as ot,Ta as st,Ti as ct,Tn as lt,Tr as ut,Tt as dt,U as ft,Ui as pt,Un as mt,Ur as ht,Ut as gt,V as _t,Vi as vt,Vn as yt,Vr as bt,Vt as xt,W as St,Wi as Ct,Wn as wt,Wt as Tt,X as Et,Xi as Dt,Xn as Ot,Xr as kt,Xt as At,Y as jt,Yi as Mt,Yn as Nt,Yr as Pt,Yt as Ft,Z as It,Zi as Lt,Zn as Rt,Zr as zt,Zt as Bt,_ as Vt,_a as Ht,_i as Ut,_n as Wt,_r as Gt,_t as Kt,a as qt,aa as Jt,ai as Yt,an as Xt,ar as Zt,at as Qt,b as $t,ba as en,bi as tn,bn as nn,br as rn,bt as an,c as on,ca as sn,ci as cn,cn as ln,cr as un,ct as dn,d as fn,da as pn,di as mn,dn as hn,dr as gn,ea as _n,ei as vn,en as yn,er as bn,et as xn,f as Sn,fa as Cn,fi as wn,fn as Tn,fr as En,g as Dn,ga as On,gi as kn,gn as An,gr as jn,gt as Mn,h as Nn,ha as Pn,hi as Fn,hn as In,hr as Ln,i as Rn,ia as zn,ii as Bn,in as Vn,ir as Hn,it as Un,j as Wn,ja as Gn,ji as Kn,jn as qn,jr as Jn,jt as Yn,k as Xn,ka as Zn,kn as Qn,kr as $n,kt as er,l as tr,la as nr,li as rr,ln as ir,lr as ar,lt as or,m as sr,ma as cr,mi as lr,mn as ur,mr as dr,n as fr,na as pr,ni as mr,nn as hr,nr as gr,nt as _r,o as vr,oa as yr,oi as br,on as xr,or as Sr,ot as Cr,p as wr,pa as Tr,pi as Er,pn as Dr,pr as Or,q as kr,qi as Ar,qn as jr,qt as Mr,r as Nr,ra as Pr,ri as Fr,rn as Ir,rr as Lr,rt as Rr,s as zr,sa as Br,si as Vr,sn as Hr,sr as Ur,st as Wr,t as Gr,ta as Kr,ti as qr,tn as Jr,tr as Yr,tt as Xr,u as Zr,ua as Qr,ui as $r,un as ei,ur as ti,v as ni,va as ri,vi as ii,vn as ai,vr as oi,vt as si,w as ci,wa as li,wi as ui,wn as di,wr as fi,wt as pi,x as mi,xa as hi,xi as gi,xn as _i,xr as vi,xt as yi,y as bi,ya as xi,yi as Si,yn as Ci,yr as wi,yt as Ti,z as Ei,zi as Di,zn as Oi,zr as ki,zt as Ai}from"./src-8LdfqLwC.mjs";import{C as ji,E as Mi,T as Ni,_ as Pi,b as Fi,c as Ii,d as Li,g as Ri,i as zi,l as Bi,m as Vi,n as Hi,p as Ui,s as Wi,t as Gi,u as Ki,v as qi,w as Ji,x as Yi,y as Xi}from"./fs-traced-Dy67FR5_.mjs";import{a as Zi,d as Qi,f as $i,i as ea,l as ta,n as na,r as ra,t as ia,u as aa}from"./logger-DFxEUjvj.mjs";import{C as oa,S as sa,_ as ca,a as la,b as ua,c as da,d as fa,g as pa,h as ma,i as ha,l as ga,m as _a,n as va,o as ya,p as ba,r as xa,s as Sa,t as Ca,u as wa,x as Ta}from"./server-lock-CSO3K0Ok.mjs";export{tt as AGENT_ID_MAX_LEN,O as AGENT_ID_RE,Xe as AGENT_WRITE_ORIGIN,Zn as AcpPermissionStore,B as AcpRegistry,ke as AcpThreadManager,Kn as AgentFocusBroadcaster,v as AgentPresenceBroadcaster,Di as AgentSessionCapacityError,C as AgentSessionManager,Kt as AutoStartDisabledError,Le as BUNDLE_IDS,$n as BUNDLE_SCOPE,b as BUNDLE_SKILL_NAME,Ur as BacklinkIndex,Dt as CC1Broadcaster,r as CC1_CONTRACT_VERSION,Wt as CONFIG_FILENAME,Yr as CONFLICT_MARKER_RE,zt as CURSOR_BUNDLE_PATHS_BY_PLATFORM,Vt as ConfigSchema,pr as DEFAULT_CHECKPOINT_RETENTION,kn as DEFAULT_EMBEDDINGS_DIMENSIONS,ie as DEFAULT_PACK_ID,_t as DocumentDurabilityState,Ut as EMBEDDINGS_API_KEY_ENV,Qn as ExposureConsentError,P as FEATURED_AGENT_IDS,Pr as FILE_SYSTEM_WRITER,Zt as FILE_WATCHER_ORIGIN,$r as FileEmbeddingsBackend,Vn as GIT_PREFLIGHT_FAIL_SPAN_NAME,zn as GIT_UPSTREAM_WRITER,_ as GitDirAccessError,xr as GitNotAvailableError,Hr as GitTooOldError,si as HOCUSPOCUS_AUTH_REJECTION_REASONS,Ti as HocuspocusAuthRejection,an as HocuspocusAuthTokenSchema,lt as HomeProjectRootError,Fr as INSTALLED_AGENTS_SCHEMES,dn as JSON_SCHEMA_DIALECT_2020_12,n as LINEAGE_EPOCH_KEY,Ye as LIVE_DERIVED_INDEX_DEBOUNCE_MS,gt as LOG_MD_TEMPLATE,R as MANAGED_RENAME_ORIGIN,Be as MAX_ACP_THREADS,vt as MAX_AGENT_SESSIONS,oe as MCP_CONNECTION_ID_HEADER,s as MCP_SERVER_NAME,te as MIN_EVICTABLE_IDLE_MS,ln as MIN_GIT_VERSION,ee as MISSING_OK_CONFIG_MESSAGE,Gn as MalformedGitPointerError,xn as McpLogger,ft as MissingOkConfigError,Ct as OBSERVER_SYNC_ORIGIN,ai as OK_OKIGNORE_TEMPLATE,Jn as ONBOARDING_BUNDLE_IDS,a as ORPHAN_MODES,t as PROTOCOL_VERSION,ia as PinoLogger,da as ProcessLockCollisionError,tr as ProjectGitInitError,Re as ROLLBACK_ORIGIN,Ci as ROOT_GITIGNORE_TEMPLATE,ua as RUNTIME_VERSION,Jt as SERVICE_WRITER,j as SKILL_INSTALL_EVENTS_FILE_REL,e as SKILL_STATE_TARGETS,Tt as STARTER_FOLDERS,$ as STARTER_FOLDER_FRONTMATTER_FILENAME,_e as STARTER_PACKS,Mr as STARTER_PACK_IDS,pe as STARTER_TEMPLATES,ot as STATE_MANIFEST_FILENAME,Ta as STATE_SCHEMA_VERSION,c as SYSTEM_DOC_NAME,yn as SeedPrerequisiteError,Jr as SeedRootDirError,Ca as ServerLockCollisionError,Gr as SingleFileNotAFileError,fr as SingleFileNotFoundError,Nr as SingleFileNotMarkdownError,z as StateManifestError,Sr as TagIndex,Ee as USER_GLOBAL_BUNDLE_IDS,Ue as UiLockCollisionError,er as __getShowAllWalkStatsForTesting,x as __resetShowAllWalkStatsForTesting,ga as acquireProcessLock,va as acquireServerLock,Y as acquireUiLock,pt as applyAgentMarkdownWrite,p as applyExternalChange,xt as applySeed,N as assertCompatibleStateManifest,ir as assertGitAvailable,yt as assertNeverDiskEvent,H as assertNotHomeProjectRoot,we as attachAcpThreadSocket,Mn as attachIdleShutdown,ni as bootServer,ar as buildAndOpenSkill,nn as buildConfigYmlContent,jt as buildExecResult,y as buildIngressPolicy,K as buildOkMcpStdioCommand,ut as buildSkillZip,Ft as buildStarterFolderFrontmatterYaml,yr as buildWipTree,je as bundleSkillMdPath,mn as canonicalProjectKey,I as canonicalizeForCompare,ne as classifyEvents,Gi as classifyFsPath,wn as clearAllEmbeddingsKeys,Si as clearContributors,At as coercePackId,o as colorFromSeed,Br as commitUpstreamImport,sn as commitWip,nr as commitWipFromTree,ei as compareSemver,ce as composeEffectiveLinterConfig,xe as composeFrontmatterSchemasConfig,gr as containsConflictMarkers,mt as contentHash,tn as contributorCount,ze as countShadowObjects,G as countStaleAgentWipRefs,ae as countWipRefs,Yn as createApiExtension,W as createAssetServeMiddleware,X as createCollaborationHost,Pt as createContentFilter,kt as createContentFilterAsync,Er as createEmbeddingsSecretStore,Rn as createEphemeralProjectDir,bn as createExternalChangeHandler,Sn as createFileLogger,Ei as createLiveDerivedIndexExtension,kr as createMcpHttpHandler,Bn as createOsProbe,Oe as createPersistenceExtension,D as createServer,Wn as createServerObserverExtension,Ar as createStreamingErrorWriter,na as createTestLogger,lr as describeStoredEmbeddingsKey,Dn as detectClaudeDesktopPresence,hn as detectGit,Ne as detectProjectShape,ti as detectUserSkillHosts,Rr as discoverLockDirs,T as discoverMarkdownlintConfig,Xt as emitPreflightFailureSpan,Et as encodeDocName,It as encodeFolderRoute,We as encodeSkillRoute,Zr as ensureProjectGit,_i as ensureProjectSkillGitignore,de as errorResponse,wt as evictStaleTrackerEntries,De as extractHeadings,Un as extractOkBinaryPath,un as extractWikiLinksFromMarkdown,Tn as fallbackPaths,fn as findEnclosingGitRoot,Oi as findEnclosingProjectRoot,bt as findNativeMarkdownlintFile,wr as flushFileLogger,yi as formatAuthRejectionWire,gi as formatContributors,nt as formatContributorsFrom,Ai as formatPackRationale,Qr as gcCheckpointRefs,Xr as getCurrentMcpLogger,qn as getIngressContext,V as getLocalDir,sr as getLogFilePath,ra as getLogger,Nn as getLogsDir,ca as getMachineId,Xi as getMeter,Ht as getMetrics,Fi as getTracer,ri as handleCollabSocketError,qe as handleSpawnCursor,Te as hasForwardingHeaders,ve as hasGcLogLatch,l as iconFromClientName,xi as incrementCollabSocketFilteredError,en as incrementServerObserverFire,rt as initContent,pn as initShadowRepo,Yi as initTelemetry,$t as initToleranceTelemetryWriter,or as installJsonSchemaDialect,Wr as installPrettyZodErrors,ea as installTestLoggers,gn as installUserSkill,Ze as isAllowedApiOrigin,se as isAllowedWorkspaceHostHeader,Lt as isConfigDoc,at as isHocuspocusAuthRejectionReason,Ie as isHomeDir,Ae as isHostAdmitted,Bt as isKnownPackId,Ge as isLinkIndexExcludedDoc,be as isLoopbackAddress,f as isManagedArtifactDoc,Ve as isOriginAdmitted,u as isOrphanMode,Z as isPairedWriteOrigin,m as isPathWithinDir,q as isPeerAdmitted,sa as isProcessAlive,w as isProjectRoot,_n as isReservedForUserTree,Q as isSelfWrite,Kr as isSystemDoc,mi as isToleranceTelemetryEnabled,oa as isValidLockPid,ge as lastKnownHash,Cn as listRescueCheckpoints,Je as listStarterPacks,Pe as loadCustomAgents,Ce as loadPrincipal,wa as lockBaseUrl,fa as lockFilePath,Zi as loggerFactory,ta as logsCurrentPath,aa as logsPreviousPath,Fn as makeLazyEmbeddingsKeyStore,xa as markServerLockDraining,St as mountMcpAndApi,Hi as normalizeFsPath,He as originGitHubHost,A as packageVersionMajorMinor,M as parseAuthRejectionWire,Dr as parseGitVersion,pi as parseHocuspocusAuthToken,me as parseKeepaliveConnectionId,jr as pathToDocName,E as planSeed,qt as prepareSingleFileOpen,Qt as processCommand,Cr as processUsage,dr as readAllTargets,Ln as readBundleDecision,re as readOwnNativeRules,ba as readProcessLock,_a as readProcessLockDetailed,S as readProjectHeadState,rr as readProjectLocalSemanticConfig,ha as readServerLock,jn as readServerPackageVersion,Gt as readSkillInstallStateSnapshot,Xn as readStateManifest,oi as readTargetRecordedAt,wi as readTargetVersion,le as readUiLock,Lr as reconcile,k as recordContributor,fi as recordSkillInstallEvent,ue as registerAllTools,fe as registerWrite,ma as releaseProcessLock,la as releaseServerLock,Se as releaseUiLock,Nt as removeLastKnownHash,Or as reportSkillInstall,hi as resetMetrics,En as resolveBuiltinSkillHosts,i as resolveBundleEnabled,U as resolveBundledSkillDir,F as resolveContentDir,vn as resolveCursorBinaryDefault,qr as resolveCursorSpawnInvocation,Qe as resolveEffectiveLinterConfig,ii as resolveEmbeddingsCredential,Fe as resolveLockDir,ki as resolveNativeConfigForDoc,ht as resolveNativeMarkdownlintConfig,h as resolvePack,zr as resolvePackageVersion,it as resolveSkillInstallReportSettings,d as resolveUiInfo,ui as restoreContributors,bi as restoreLifecycleFromConflictsJson,Vr as rewriteMarkdownLinksForDocumentRename,cn as rewriteWikiLinksForDocumentRename,ur as runAuthReposSubprocess,In as runAuthStatusSubprocess,hr as runCloneSubprocess,An as runDeviceFlowSubprocess,_r as runWithMcpLogger,br as safeContentPath,Me as safeSubdir,Tr as safetyCheckpoint,ye as sanitizeClientName,cr as saveInMemoryCheckpoint,Pn as saveVersion,dt as seedBasenameIndex,vr as serializeError,ji as setActiveSpanAttributes,he as setupServerObservers,On as shadowGit,Ji as shutdownTelemetry,Qi as spansCurrentPath,$i as spansPreviousPath,mr as spawnDetached,Hn as splitMarkdownBlocks,Ot as startWatcher,Mt as streamingProblemEvent,ct as swapContributors,et as teardownToleranceTelemetryWriter,li as toBroadcasterKey,zi as tracedAppendFileSync,Wi as tracedLinkSync,Ii as tracedMkdir,Bi as tracedMkdirSync,Ki as tracedRename,Li as tracedRenameSync,Ui as tracedRmSync,Vi as tracedRmdirSync,Ri as tracedUnlinkSync,Pi as tracedWriteFile,qi as tracedWriteFileSync,ci as trustSystemCertificates,on as untrackTrackedProjectSkillProjection,Rt as updateLastKnownHash,pa as updateProcessLockPort,ya as updateServerLockPort,$e as updateUiLockPort,st as validateAgentId,Ir as validateCloneInputs,L as validateSkillZip,Sa as waitForServerLockDrain,Yt as withHiddenWindowsConsole,Ni as withSpan,Mi as withSpanSync,rn as writeBundleDecision,J as writeMarkdownlintRule,di as writeRootGitignoreForNewRepo,g as writeStateManifest,vi as writeTargetVersion,Ke as writeTracker};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import{M as e}from"./sleep-
|
|
1
|
+
import{M as e}from"./sleep-CEs13Om_.mjs";import{ac as t,cc as n,fc as r,mc as i,oc as a,pc as o}from"./src-BimG4LM6.mjs";import{Bn as s,a as ee,hi as c}from"./src-8LdfqLwC.mjs";import{S as l,b as u,x as d}from"./resolve-project-root-DpSmoodv.mjs";import{a as f,f as p,i as m,l as h,o as g,r as _,t as v}from"./acp-harness-probe-C2IHuVgy.mjs";import{y}from"./init-097BT-JV.mjs";import{n as b}from"./constants-CaZ6pf_w.mjs";import{spawn as x}from"node:child_process";import{basename as S,resolve as C}from"node:path";import{existsSync as w}from"node:fs";import{rm as T}from"node:fs/promises";import{setTimeout as E}from"node:timers/promises";function D(e,t){return e.bind?.[0]??e.host??t.HOST??`127.0.0.1`}function O(e){if(e===`ui`||e===`server`)return e;throw new d(`--only must be 'ui' or 'server'`)}function k(e=w){let t=import.meta.dirname??new URL(`.`,import.meta.url).pathname;return[C(t,`public`),C(t,`../../app/dist`),C(t,`../../../app/dist`)].find(t=>e(t))}function A(e){if(e.explicitDir!==void 0)return{dir:e.explicitDir,missingBundle:!1};if(e.only===`server`)return{dir:void 0,missingBundle:!1};let t=e.findBundledDir();return{dir:t,missingBundle:t===void 0}}function j(t){if(t===`off`)return`off`;if(!e.test(t))throw new d(`--idle-shutdown must be 'off' or a duration like 90s, 30m, 2h`);return t}function M(e){return e===`localhost`||e===`::1`||e===`[::1]`||e.startsWith(`127.`)}function N(e){return!e.flagBindSet&&!e.okBindSet&&e.hostEnvSet&&e.fileBindCount>1}function P(e){return!e.openBrowser||e.remoteEnabled||e.ephemeral||e.only===`server`||!e.servesUi?!1:e.legacyOpen?!0:(e.explicitOn||M(e.host))&&e.isTTY}function F(e,t){return t&&(e===`::`||e===`::1`||e===`[::1]`||e===`localhost`||e===`0.0.0.0`)?{host:`127.0.0.1`,coerced:!0}:{host:e,coerced:!1}}function I(e,t){return a(t)?e:{externalUrl:e.externalUrl,idleShutdown:e.idleShutdown}}function L(e,t){if(e===void 0||e===!1)return null;let n=typeof e==`string`?e:t;if(n===void 0||n===``)return{ok:!1,errorMessage:"--remote requires a public tunnel URL — pass it (`ok start --remote https://<your-tunnel-host>`) or set remote.url in .ok/config.yml."};let r;try{r=new URL(n)}catch{return{ok:!1,errorMessage:`remote.url is not a valid URL: ${n}`}}if(r.protocol!==`https:`)return{ok:!1,errorMessage:`remote.url must be https — it is the public tunnel URL remote clients connect to (got: ${n})`};let i=n.replace(/\/+$/,``);return{ok:!0,url:i,serverOverlay:{externalUrl:i,allowExternal:!0,idleShutdown:`off`}}}function R(e,t){let n;try{n=new URL(t)}catch{throw new d(`${e} is not a valid URL: ${t}`)}if(n.protocol!==`http:`&&n.protocol!==`https:`)throw new d(`${e} must be an http(s) origin (got: ${t})`);return t}function z(e){return R(`--external-url`,e)}function te(e){return e.externalUrl??e.publicUrl}function B(e){return R(`--public-url`,e)}function V(e){let t=S(e).replace(/[^\x20-\x7E]/g,``).trim().slice(0,64);return`open-knowledge-server ${t.length>0?t:`unknown`}`}var H=class extends Error{cwd;constructor(e){super("This directory isn't set up yet. Run `ok init` first, then `ok start` again."),this.name=`OkDirMissingError`,this.cwd=e}};function U(e,t,n=!1){return e??(n?void 0:t)}function W(e,t,n=e=>T(e,{recursive:!0,force:!0})){return async()=>{try{await e()}finally{try{await n(t)}catch(e){process.stderr.write(`[start] ephemeral temp dir reap failed for ${t}: ${e instanceof Error?e.message:String(e)}\n`)}}}}function G(e,t={}){let n=t.exit??(e=>process.exit(e)),r=t.getActiveHandles??(()=>{let e=process._getActiveHandles;return e?e.call(process):null});return async()=>{let i=!1;try{await e()}catch(e){i=!0,t.log?.error({err:e},`idle-shutdown: destroy failed — exiting anyway`)}finally{let e=null;try{let t=r();if(t!==null){e={};for(let n of t){let t=n?.constructor?.name??`unknown`;e[t]=(e[t]??0)+1}}}catch{e=null}t.log?.info({event:`idle-shutdown-exit`,exitCode:+!!i,openHandles:e??{},handlesAvailable:e!==null},`idle-shutdown: teardown finished — exiting process`),n(+!!i)}}}async function K(e){let{config:t,cwd:n,host:r}=e,i=e.skipAutoInit??!1,a=e.idleThresholdMs===void 0?18e5:e.idleThresholdMs,{existsSync:o,mkdirSync:l}=await import(`node:fs`),{basename:u,dirname:d}=await import(`node:path`),{bootServer:f,getLogger:m,resolveContentDir:g,resolveLockDir:_,waitForServerLockDrain:b}=await import(`./src-DorV8gmN.mjs`),x=e.log??m(`start`),S=e.singleFile!==void 0,C=e.projectDir??n,w=S?ee(e.singleFile).canonicalFilePath:void 0,T=w?d(w):void 0,E=w?u(w):void 0;if(!S){if(!i&&!s(n))throw new H(n);let t=process.env.OK_RECLAIM_DISABLE??null,r=e=>{let t=typeof e.event==`string`?e.event:``;(t.endsWith(`-failed`)||t.endsWith(`-error`)||t.endsWith(`-missing`))&&x.warn({event:e},`[start] reclaim sweep reported a problem`)};try{(e.repairMcpConfigsFn??(await import(`./repair-mcp-configs-MWY28hax.mjs`)).repairMcpConfigs)({projectDir:n,reclaimDisableEnv:t,logger:r})}catch(e){x.warn({err:e},`[start] mcp-config repair sweep failed; continuing`)}try{(e.repairLaunchJsonFn??(await import(`./repair-launch-json-BSlvdEhG.mjs`)).repairLaunchJson)({projectDir:n,reclaimDisableEnv:t,logger:r})}catch(e){x.warn({err:e},`[start] launch.json repair sweep failed; continuing`)}try{await(e.repairSkillsFn??(await import(`./repair-skills-D3qrrU25.mjs`)).repairSkills)({projectDir:n,reclaimDisableEnv:t,logger:r})}catch(e){x.warn({err:e},`[start] skill repair sweep failed; continuing`)}}let D=T??g(t,n);!S&&!o(D)&&(l(D,{recursive:!0}),x.info({contentDir:D},`Created content directory`));let O=p(),k=c();{let e=_(S?C:n),t=Date.now(),r=await b(e);r!==`no-drain`&&x.info({event:`start-waited-for-draining-predecessor`,outcome:r,waitedMs:Date.now()-t,drainLockDir:e},r===`released`?`[start] predecessor server finished draining — proceeding`:`[start] predecessor server still draining after wait — proceeding to collide`)}let A=await f({config:t,contentDir:D,projectDir:S?C:n,contentRoot:S?void 0:t.content.dir,port:e.port,host:r,quiet:!1,detectGh:h,tokenStore:O,embeddingsKeyStore:k,mcpTomlEditor:y(),...S?{ephemeral:!0,singleDocRelPath:E,gitEnabled:!1,gitPreflight:()=>({ok:!0,version:`0.0.0`,resolvedPath:`git`,source:`PATH`})}:{},localOpCliArgs:[process.execPath,process.argv[1]],probeHarnessManagedMcpEntry:(e,t)=>v(e,t),idleShutdownMs:a,...e.serverRuntime===void 0?{}:{serverRuntime:e.serverRuntime},...e.bind===void 0?{}:{bind:e.bind},skipAutoInit:!0,idleShutdownHandler:t=>{let n=t;return G(S?W(n,C):n,{log:x,exit:e.idleExit})},log:x,...e.serveContentAssets===void 0?{}:{serveContentAssets:e.serveContentAssets},...e.reactShellDistDir?{reactShellDistDir:e.reactShellDistDir}:{}});return{httpServer:A.httpServer,destroy:A.destroy,lockDir:A.lockDir,contentDir:D,port:A.port,ready:A.ready,degraded:A.degraded}}function q(e){if(e===`browser`||e===`app`)return e;throw new d(`--mode must be 'browser' or 'app'`)}function J(e){return e.OK_CONSOLE_LEVEL!==void 0||e.LOG_LEVEL!==void 0?null:`warn`}function Y(e){let t=[`Stopping OpenKnowledge…`,`Saving pending changes and releasing the server lock — this can take a few seconds.`];return e===`SIGINT`&&t.push(`Press Ctrl+C again to force quit.`),t}async function X(e,a){let s=J(process.env);s!==null&&(process.env.OK_CONSOLE_LEVEL=s);let{renderBanner:ee}=await import(`./banner-Ev4hKBM4.mjs`),{accent:c,dim:l,error:u,warning:d}=await import(`./colors-MGDi6UGf.mjs`),f=process.cwd(),p=a.remote!==void 0&&a.remote!==!1;process.title=V(f),p&&console.warn(d("--remote is deprecated — use `OK_IDLE_SHUTDOWN=off OK_ALLOW_EXTERNAL=1 ok start --external-url <url>` instead (add --bind to serve a non-loopback address; keep OK_IDLE_SHUTDOWN=off — the idle timer only counts WS clients and would tear the server down under a live remote MCP client). The flag now just expands to those server.* keys and will be removed in a later release.")),a.publicUrl!==void 0&&console.warn(d(`--public-url is deprecated — use --external-url <url> (same value and semantics; the key was renamed to server.externalUrl). The old spelling will be removed in a later release.`)),n(e).externalUrlFromDeprecatedKey&&console.warn(d(`[config] server.publicUrl is deprecated — use server.externalUrl instead (same value and semantics). If this config is committed and shared, keep both keys until every collaborator has upgraded — older versions read only server.publicUrl; see https://openknowledge.ai/docs/reference/configuration. The old key will be removed in a later release.`));let m=L(a.remote,e.remote?.url);m!==null&&!m.ok&&(console.error(u(m.errorMessage)),process.exit(78));let h=m?.ok?m:null,g=h!==null;h!==null&&console.warn(d([``,`⚠ REMOTE ACCESS ENABLED — no server-side authentication.`,` Anyone who can reach ${h.url} has FULL control of this`,` knowledge base, including sync, publishing, credentials, and local operations.`,` Restrict who can reach it at the tunnel: ngrok OAuth, Cloudflare Access,`,` Tailscale ACLs, or equivalent edge auth.`,``].join(`
|
|
2
2
|
`)));let _;try{_=i(process.env)}catch(e){throw e instanceof r&&(console.error(u(e.message)),process.exit(78)),e}for(let e of _.diagnostics)console.warn(d(`[config] ${e.message}`));let v=o(e,_.layer),y=_.overrides.some(e=>e.envVar===`OK_BIND`),x=a.bind!==void 0&&a.bind.length>0?a.bind:a.host===void 0?void 0:[a.host],S=process.env.HOST,C=S!==void 0&&S.trim()!==``?S:void 0,w=n(v),T=x??(y||C===void 0?[...w.bind]:[C]);N({flagBindSet:x!==void 0,okBindSet:y,hostEnvSet:C!==void 0,fileBindCount:w.bind.length})&&console.warn(d(`[config] HOST=${C} overrides server.bind — dropping the file-configured addresses (${w.bind.join(`, `)}). Use OK_BIND with a space-separated list to keep multiple binds.`));let D=T[0]??`127.0.0.1`,O=F(D,g);O.coerced&&console.warn(`remote access is enabled and ${D} is not an IPv4 loopback bind — tunnels proxy to 127.0.0.1, so binding ${D} would leave the tunnel dialing a dead port. Using 127.0.0.1.`);let j=O.host,M=g?[j]:T,R=h===null?{}:I(h.serverOverlay,M);h!==null&&!(`allowExternal`in R)&&console.warn(d(`--remote does not consent to exposing a non-loopback bind (${M.join(`, `)}) — the tunnel is the only ingress the alias vouches for. Consent explicitly with OK_ALLOW_EXTERNAL=1 (or server.allowExternal in .ok/local/config.yml), or drop the non-loopback bind.`));let z=te(a),B=n(o(v,{server:{bind:M,...R,...z===void 0?{}:{externalUrl:z}}}));if(!g&&B.allowExternal&&(!B.loopbackOnly||B.externalUrl)){let e=B.externalUrl??B.bind.join(`, `);console.warn(d([``,`⚠ EXTERNAL ACCESS ENABLED (server.allowExternal) — no server-side authentication.`,` This server is reachable beyond this machine (${e}). Anyone who can`,` reach it has FULL control of this knowledge base — sync, publishing, GitHub`,` credentials, and local operations (clone, sign-in, repo spawn).`,` Restrict who can reach it at the edge: a Tailscale ACL, a reverse proxy with`,` auth (Cloudflare Access, oauth2-proxy), or a firewall.`,``].join(`
|
|
3
|
-
`)))}let W=a.port===void 0?void 0:Number(a.port),G=_.overrides.find(e=>e.envVar===`PORT`)?.value,q=n(e).port,X=e.server?.port;g&&W===void 0&&G!==void 0&&console.warn(`remote access is enabled — ignoring env PORT=${process.env.PORT}; the tunnel's port mapping targets the stable remote port (${q??24550}). Pass --port to override deliberately.`);let ae=U(W,G,g)??(g?q??24550:X),oe=A({explicitDir:a.reactShellDistDir,only:a.only,findBundledDir:k}),Q=oe.dir;oe.missingBundle&&console.warn(g?`remote access: bundled web UI not found — serving /mcp and /api only over the tunnel.`:`bundled web UI not found — serving /api and /mcp only. Reinstall @inkeep/open-knowledge, or build packages/app in a source checkout.`);let $;try{$=await K({config:e,cwd:f,host:j,port:ae,bind:M,...a.serveContentAssets===void 0?{}:{serveContentAssets:a.serveContentAssets},...Q?{reactShellDistDir:Q}:{},idleThresholdMs:t((g?void 0:a.idleShutdown)??B.idleShutdown),serverRuntime:B,...a.singleFile?{singleFile:a.singleFile}:{},...a.projectDir?{projectDir:a.projectDir}:{}})}catch(e){e instanceof H&&(console.error(u(e.message)),process.exit(1));let t=await import(`./src-
|
|
3
|
+
`)))}let W=a.port===void 0?void 0:Number(a.port),G=_.overrides.find(e=>e.envVar===`PORT`)?.value,q=n(e).port,X=e.server?.port;g&&W===void 0&&G!==void 0&&console.warn(`remote access is enabled — ignoring env PORT=${process.env.PORT}; the tunnel's port mapping targets the stable remote port (${q??24550}). Pass --port to override deliberately.`);let ae=U(W,G,g)??(g?q??24550:X),oe=A({explicitDir:a.reactShellDistDir,only:a.only,findBundledDir:k}),Q=oe.dir;oe.missingBundle&&console.warn(g?`remote access: bundled web UI not found — serving /mcp and /api only over the tunnel.`:`bundled web UI not found — serving /api and /mcp only. Reinstall @inkeep/open-knowledge, or build packages/app in a source checkout.`);let $;try{$=await K({config:e,cwd:f,host:j,port:ae,bind:M,...a.serveContentAssets===void 0?{}:{serveContentAssets:a.serveContentAssets},...Q?{reactShellDistDir:Q}:{},idleThresholdMs:t((g?void 0:a.idleShutdown)??B.idleShutdown),serverRuntime:B,...a.singleFile?{singleFile:a.singleFile}:{},...a.projectDir?{projectDir:a.projectDir}:{}})}catch(e){e instanceof H&&(console.error(u(e.message)),process.exit(1));let t=await import(`./src-DorV8gmN.mjs`);if((e instanceof t.GitNotAvailableError||e instanceof t.GitTooOldError)&&process.exit(78),e instanceof t.ExposureConsentError&&(console.error(u(e.message)),process.exit(78)),(e instanceof t.SingleFileNotFoundError||e instanceof t.SingleFileNotAFileError||e instanceof t.SingleFileNotMarkdownError)&&(console.error(u(e.message)),process.exit(1)),re(e,t)){let e=t.resolveLockDir(f),n=null;try{n=await Z({readServerLock:()=>t.readServerLock(e),readUiLock:()=>t.readUiLock(e),now:Date.now,sleep:e=>E(e),timeoutMs:3e3,pollIntervalMs:50})}catch(e){process.stderr.write(`[start] spawn-or-reuse: lock poll failed (${e instanceof Error?e.message:String(e)}) — falling back to the collision message\n`)}if(n!==null){let[e,...t]=ne(n);console.log(c(e));for(let e of t)console.log(l(e));process.exit(0)}}let n=ie(e,f,t);n!==null&&(console.error(u(n)),process.exit(1)),console.error(`${u(`Failed to start:`)} ${e instanceof Error?e.stack??e.message:String(e)}`),process.exit(1)}let se=!1,ce=async e=>{if(se)return;se=!0;let[t,...n]=Y(e);console.log(c(`\n${t}`));for(let e of n)console.log(l(` ${e}`));try{await $.destroy()}catch(e){console.error(`${u(`destroy() failed:`)} ${e instanceof Error?e.stack??e.message:String(e)}`),process.exitCode=1}process.exit(process.exitCode??0)};process.once(`SIGINT`,()=>{ce(`SIGINT`)}),process.once(`SIGTERM`,()=>{ce(`SIGTERM`)});let le=`http://${j.includes(`:`)&&!j.startsWith(`[`)?`[${j}]`:j}:${$.port}`,ue=j===`0.0.0.0`||j===`::`?`http://0.0.0.0:${$.port}`:void 0,de=le;console.log(ee({name:`open-knowledge`,version:b,localUrl:de,networkUrl:ue,nextSteps:[`Open the Editor URL in your browser to start editing.`]}));let fe={"shadow-repo":`Version history and branch-switch safety unavailable`,"file-watcher":`External file changes will not sync to the editor`,"head-watcher":`Git branch switches may cause document inconsistency`};$.ready.then(async()=>{if($.degraded.length>0){console.log();for(let e of $.degraded){let t=fe[e]??`${e} (check server logs for details)`;console.warn(` ${d(`⚠`)} ${d(e)}: ${l(t)}`)}console.log()}if(P({openBrowser:a.openBrowser!==!1&&B.openBrowser,explicitOn:a.openBrowser!==!1&&v.server?.openBrowser===!0,legacyOpen:a.open===!0,host:j,isTTY:process.stdout.isTTY===!0,remoteEnabled:g,ephemeral:a.singleFile!==void 0,only:a.only,servesUi:Q!==void 0})){let{openBrowser:e}=await import(`./open-browser-BklPlV75.mjs`);e(de)}}).catch(e=>{console.error(` ${u(`Server initialization failed:`)} ${e instanceof Error?e.message:String(e)}`)})}async function Z(e){let t=e.now()+e.timeoutMs,n=e.readServerLock();for(;n!==null&&n.draining!==!0&&n.port<=0&&e.now()<t;)await e.sleep(e.pollIntervalMs),n=e.readServerLock();if(n===null||n.draining===!0||n.port<=0)return null;if(n.capabilities?.includes(`ui`)===!0&&n.url!==void 0)return{url:n.url,kind:n.kind,pid:n.pid,servesUi:!0};let r=e.readUiLock();return r!==null&&r.port>0?{url:r.url??`http://localhost:${r.port}`,kind:n.kind,pid:n.pid,servesUi:!1}:{url:n.url??`http://127.0.0.1:${n.port}`,kind:n.kind,pid:n.pid,servesUi:!1}}function ne(e){return[`${e.kind===`mcp-spawned`?`An MCP-spawned OpenKnowledge server is already running on this project`:`OpenKnowledge is already running on this project`} (pid ${e.pid}).`,` ${e.url}`,"Leaving it running — run `ok stop` first if you want a fresh server."]}function re(e,t){let n=t.ServerLockCollisionError;return n!==void 0&&e instanceof n}function ie(e,t,n){let r=n.ServerLockCollisionError;if(r===void 0||!(e instanceof r))return null;try{let e=n.readServerLock(n.resolveLockDir(t));return e&&e.kind===`mcp-spawned`?"An MCP-spawned server holds this lock; it should release on idle-shutdown (~30 min). Or run `ok stop`.":"OpenKnowledge server is already running on this project — check `ok status` or `ok stop`."}catch{return null}}function ae(e){return new u(`start`).description(`Start the OpenKnowledge server (UI + API + MCP + collab on one port)`).option(`-p, --port <port>`,`Server port`,void 0).option(`--bind <address>`,`Bind address (repeatable; default 127.0.0.1 — loopback only)`,(e,t)=>[...t??[],e]).addOption(new l(`-H, --host <host>`,`Deprecated alias of --bind`).hideHelp()).option(`--no-open-browser`,`Do not open the browser after start (interactive loopback starts open it by default)`).addOption(new l(`--open`,`Deprecated: force-open the browser after start`).hideHelp()).option(`--only <module>`,`Serve one module: 'server' (API + MCP only, no shell or browser) or 'ui' (shell + proxy only; requires --server-url)`,O).option(`--server-url <url>`,`Project-server URL the --only ui process proxies to (e.g. http://127.0.0.1:24550)`).option(`--idle-shutdown <duration>`,`Shut the server down after this long with no connected clients ('off', or a duration like 90s, 30m, 2h; default 30m)`,j).option(`--mode <mode>`,`Force dispatch mode: 'browser' or 'app'`,q).option(`--serve-content-assets`,`Serve content assets from this server (now the default; kept for compatibility)`).option(`--react-shell-dist-dir <path>`,`Serve React shell from <path>`).option(`--single-file <path>`,`No-project ephemeral single-file mode: scope the server to one markdown file (git + MCP off)`).option(`--project-dir <dir>`,`Throwaway project root for --single-file (where ephemeral .ok/ state lives)`).option(`--external-url <url>`,`Canonical external origin clients dial (sets server.externalUrl for this run) — its host joins the Host/Origin allowlists (CORS + external-Host admission). External exposure additionally requires consent (OK_ALLOW_EXTERNAL=1 or server.allowExternal).`,z).option(`--public-url <url>`,`Deprecated alias of --external-url (the former name of that flag) — same value and semantics.`,B).option(`--remote [url]`,`Deprecated alias: expands to --external-url <url> + OK_ALLOW_EXTERNAL consent on a loopback bind. Serves through a tunnel with NO server-side auth (anyone who can reach the URL has full control — restrict access at the tunnel with edge auth). Bare --remote uses remote.url from .ok/config.yml; --remote <url> supplies it for this run.`).action(async t=>{let n=e();if(t.serverUrl!==void 0&&t.only!==`ui`&&(process.stderr.write(`error: option '--server-url' requires '--only ui'
|
|
4
4
|
`),process.exit(2)),t.externalUrl!==void 0&&t.publicUrl!==void 0&&(process.stderr.write(`error: option '--public-url' cannot be combined with '--external-url' (--public-url is a deprecated alias of --external-url)
|
|
5
5
|
`),process.exit(2)),(t.externalUrl!==void 0||t.publicUrl!==void 0)&&t.remote!==void 0&&t.remote!==!1){let e=t.externalUrl===void 0?`--public-url`:`--external-url`;process.stderr.write(`error: option '--remote' cannot be combined with '${e}' (--remote is a deprecated alias that sets server.externalUrl)\n`),process.exit(2)}if(t.singleFile!==void 0&&t.remote!==void 0&&t.remote!==!1&&(process.stderr.write(`error: option '--single-file' cannot be combined with '--remote' — ephemeral single-file mode has no project and no consented root to serve remotely
|
|
6
6
|
`),process.exit(2)),t.only===`server`&&t.reactShellDistDir!==void 0&&(process.stderr.write(`error: option '--only server' cannot be combined with '--react-shell-dist-dir'
|
|
7
7
|
`),process.exit(2)),t.only===`ui`){{let{warning:e}=await import(`./colors-MGDi6UGf.mjs`);console.error(e("[start] `--only ui` is deprecated — plain `ok start` serves the editor UI, API, and MCP on one port. The split-mode proxy will be removed in a future release."))}t.serverUrl===void 0&&(process.stderr.write(`error: '--only ui' requires '--server-url <url>' (where the project server runs)
|
|
8
8
|
`),process.exit(2)),t.mode===`app`&&(process.stderr.write(`error: option '--only ui' cannot be combined with '--mode app'
|
|
9
9
|
`),process.exit(2)),t.remote!==void 0&&t.remote!==!1&&(process.stderr.write(`error: option '--only ui' cannot be combined with '--remote'
|
|
10
|
-
`),process.exit(2));let{runUiCommand:e}=await import(`./ui-
|
|
10
|
+
`),process.exit(2));let{runUiCommand:e}=await import(`./ui-DRrmB9yI.mjs`);await e(n,{...t.port===void 0?{}:{port:String(t.port)},...t.bind?.[0]===void 0?t.host===void 0?{}:{host:t.host}:{host:t.bind[0]},upstreamUrl:t.serverUrl});return}if(t.mode===`app`){t.open&&(process.stderr.write(`error: option '--mode=app' cannot be combined with '--open' (--open opens a browser tab against the local server, which app mode does not boot)
|
|
11
11
|
`),process.exit(2));let e=[];if(t.port!==void 0&&e.push(`--port`),t.bind!==void 0&&e.push(`--bind`),t.host!==void 0&&e.push(`--host`),t.only!==void 0&&e.push(`--only`),t.serverUrl!==void 0&&e.push(`--server-url`),t.idleShutdown!==void 0&&e.push(`--idle-shutdown`),t.openBrowser===!1&&e.push(`--no-open-browser`),t.externalUrl!==void 0&&e.push(`--external-url`),t.publicUrl!==void 0&&e.push(`--public-url`),t.remote!==void 0&&t.remote!==!1&&e.push(`--remote`),e.length>0){let t=process.env.OK_LOG_LEVEL??`info`;(t===`debug`||t===`trace`)&&console.error(`--mode=app: ignoring ${e.join(`, `)}`)}let n=m(_());if(n.available){f({spawn:x},n);return}console.error(g(n.reason)),process.exit(1)}await X(n,t)})}export{P as C,W as D,ie as E,G as O,I as S,ae as T,D as _,L as a,A as b,M as c,j as d,O as f,te as g,U as h,V as i,re as l,k as m,K as n,ne as o,B as p,F as r,Y as s,H as t,z as u,Z as v,N as w,X as x,J as y};
|
|
12
|
-
//# sourceMappingURL=start-
|
|
12
|
+
//# sourceMappingURL=start-BCpGrVds.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{T as e,_ as t,m as n,n as r}from"./start-BCpGrVds.mjs";export{r as bootStartServer,n as resolveBundledReactShellDir,t as resolveHost,e as startCommand};
|