@inkeep/open-knowledge 0.65.0-beta.8 → 0.67.0-beta.0
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-B1Zu9x_o.mjs → acp-harness-probe-BejSsqhT.mjs} +2 -2
- package/dist/cli.mjs +6 -6
- package/dist/config-schema.json +8 -0
- package/dist/config.project-local.schema.json +8 -0
- package/dist/constants-Dvng6btw.mjs +2 -0
- package/dist/fs-traced-ByTZUu6k.mjs +1 -0
- package/dist/{fs-traced-DcgvOGgW.mjs → fs-traced-C5AXyho0.mjs} +2 -2
- package/dist/{git-handle-C9RPCwJN.mjs → git-handle-CubiDUWd.mjs} +2 -2
- package/dist/git-handle-DfRqwphs.mjs +1 -0
- package/dist/index.d.mts +69 -18
- package/dist/index.mjs +137 -137
- package/dist/init-6L4BlCbd.mjs +1 -0
- package/dist/{init-ODj0IQUv.mjs → init-CobW3CM5.mjs} +3 -3
- package/dist/{launch-json-removal-DWPJ5oEN.mjs → launch-json-removal-CLv_nSdk.mjs} +2 -2
- package/dist/loader-3c7J6186.mjs +1 -0
- package/dist/{loader-8lpy3ej6.mjs → loader-Dd7ZEVPD.mjs} +2 -2
- package/dist/md-manager-BT335Cuq.mjs +2 -0
- package/dist/{open-browser-Bzfc84xQ.mjs → open-browser-Cb5VzK0U.mjs} +2 -2
- package/dist/parse-worker.mjs +1 -1
- package/dist/preview-BCYX7ahJ.mjs +1 -0
- package/dist/{preview-aUVAY38y.mjs → preview-oUN7zWZf.mjs} +2 -2
- package/dist/public/assets/{ActivityModeContent-xON2KhOz.js → ActivityModeContent-ByXqC9L3.js} +1 -1
- package/dist/public/assets/{AddPropertiesButton-CC1Bimpt.js → AddPropertiesButton-CqCAMlcp.js} +1 -1
- package/dist/public/assets/{AgentDiffPane-BPGzdN_g.js → AgentDiffPane-C9GoSC-q.js} +1 -1
- package/dist/public/assets/{AgentThreadClientBinder-Sg80UfOQ.js → AgentThreadClientBinder-Cg5dQ9cS.js} +1 -1
- package/dist/public/assets/{BugReportHistory-BOcChnxP.js → BugReportHistory-Dt38bVey.js} +1 -1
- package/dist/public/assets/{BugReportHistoryDialog-BgcEcCCO.js → BugReportHistoryDialog-DSaJZmYG.js} +1 -1
- package/dist/public/assets/CodeMirrorPropInput-CNOmjwDY.js +3 -0
- package/dist/public/assets/{ConsentDialogBody-DQlUb8Vu.js → ConsentDialogBody-O_9Rl15O.js} +1 -1
- package/dist/public/assets/{DocumentContext-Ak51fAXi.js → DocumentContext-Cn9NAraV.js} +9 -9
- package/dist/public/assets/{EditorModeToggle-DpkS50Z0.js → EditorModeToggle-BeDZXvd_.js} +1 -1
- package/dist/public/assets/{EnableSyncConfirmDialog-DyPeGiVT.js → EnableSyncConfirmDialog-hP1wc7LI.js} +1 -1
- package/dist/public/assets/{ExcalidrawDocEditor-BKndnS9g.js → ExcalidrawDocEditor-ClthqreF.js} +1 -1
- package/dist/public/assets/FeedbackForm-B7ug6jnh.js +1 -0
- package/dist/public/assets/{GraphPanel-BdWJsnt-.js → GraphPanel-ntuiBBeL.js} +2 -2
- package/dist/public/assets/{ImportSkillDialog-C5f6Lj0b.js → ImportSkillDialog-g0Me0o-H.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-C21DnP0H.js → LintConfigEditor-CYyjfaBp.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-CdTzEPrj.js +1 -0
- package/dist/public/assets/ManagedArtifactProperties-DitPP-q6.js +1 -0
- package/dist/public/assets/{MermaidDocEditor-CftOutDD.js → MermaidDocEditor-ClkK048c.js} +1 -1
- package/dist/public/assets/{PropertyDisplayRow-B3tLCY9W.js → PropertyDisplayRow-Def1JttE.js} +1 -1
- package/dist/public/assets/{ReportBugDialogBody-DRDozPGc.js → ReportBugDialogBody-CId7-dwY.js} +1 -1
- package/dist/public/assets/{ReportBugMenuTrigger-Sbn4B06b.js → ReportBugMenuTrigger-CAXh2fEG.js} +2 -2
- package/dist/public/assets/{SchemaConfigEditor-DXhpWbEp.js → SchemaConfigEditor-BsSIHFLn.js} +1 -1
- package/dist/public/assets/SessionsHost-Bv3fhM-M.js +2 -0
- package/dist/public/assets/SettingsDialogBody-BG7DqQki.js +12 -0
- package/dist/public/assets/{ShareBranchSwitchDialog-DgKD1FWp.js → ShareBranchSwitchDialog-Da1iuVDe.js} +1 -1
- package/dist/public/assets/{ShareReceiveDialog-BsGWPO5t.js → ShareReceiveDialog-CqHxcyC_.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-DX4YDzpC.js → ShareReceiveMissDialog-CWaSiJx3.js} +1 -1
- package/dist/public/assets/{SkillCostValue-B4D7Ysdc.js → SkillCostValue-CDdrvFDP.js} +1 -1
- package/dist/public/assets/{SkillEditBanner-BruoXTh-.js → SkillEditBanner-BW1TCaRv.js} +1 -1
- package/dist/public/assets/{SkillInstallMenu-QBcuRLjh.js → SkillInstallMenu-Df4JpyWk.js} +1 -1
- package/dist/public/assets/{SkillOriginInline-Dshp1Rdi.js → SkillOriginInline-BPTgPRkC.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-BCXxl3_M.js → SkillToolbarControls-CZypNkFH.js} +1 -1
- package/dist/public/assets/{SlidesToolbarControls-CJxgVynH.js → SlidesToolbarControls-DM156XS4.js} +1 -1
- package/dist/public/assets/SourceEditor-Ck_H1DDk.js +1 -0
- package/dist/public/assets/TerminalPanel-sSG3GNge.js +146 -0
- package/dist/public/assets/{TerminalWindowApp-VUZguLdJ.js → TerminalWindowApp-Dp8CBJpK.js} +1 -1
- package/dist/public/assets/{TextDocEditor-Cb7BPpJA.js → TextDocEditor-DE1ymchO.js} +1 -1
- package/dist/public/assets/{ThreadView-Bf53-ggV.js → ThreadView-BWANvVeU.js} +1 -1
- package/dist/public/assets/{TimelineDiffPane-B1HLCcW9.js → TimelineDiffPane-CBKYuQbD.js} +1 -1
- package/dist/public/assets/{agent-diff-store-XWhp_hqN.js → agent-diff-store-DbjoIx-K.js} +1 -1
- package/dist/public/assets/{auth-state-cache-D22yWCCz.js → auth-state-cache-BCm3dF10.js} +4 -4
- package/dist/public/assets/{bug-report-send-manager-BBNXam8A.js → bug-report-send-manager-DTTI84PJ.js} +1 -1
- package/dist/public/assets/client-version-BB0KWeQx.js +1 -0
- package/dist/public/assets/{comment-chips-D0prCEAx.js → comment-chips-C6TlNYJv.js} +1 -1
- package/dist/public/assets/config-provider-5mfcXWZE.js +5 -0
- package/dist/public/assets/{dist-D1GzYuCD.js → dist-DDaNJUu-.js} +183 -183
- package/dist/public/assets/{doc-paths-ByyIE836.js → doc-paths-fAVLMRFJ.js} +1 -1
- package/dist/public/assets/{documents-events-DPqTvBXn.js → documents-events-BqZkZJ84.js} +1 -1
- package/dist/public/assets/{file-tree-adapter-Ccbih42A.js → file-tree-adapter-pQQItB89.js} +1 -1
- package/dist/public/assets/{file-tree-utils-Jz2v-e9t.js → file-tree-utils-8UB6_UsJ.js} +1 -1
- package/dist/public/assets/{folder-config-api-BddKQIga.js → folder-config-api-BIhsMUMX.js} +1 -1
- package/dist/public/assets/i18n-0rwym6w8.js +1 -0
- package/dist/public/assets/{index-nJnxhQRq.js → index-BRe3Iox-.js} +14 -14
- package/dist/public/assets/{launcher-selection-CUAKUPGW.js → launcher-selection-CD-WIt8v.js} +1 -1
- package/dist/public/assets/{lint-config-client-DeGP10La.js → lint-config-client-BfKBoGee.js} +1 -1
- package/dist/public/assets/{markdownlint-rule-browser-Bir8KkrK.js → markdownlint-rule-browser-hBIkb0IC.js} +1 -1
- package/dist/public/assets/messages-B1y9my2y.js +1 -0
- package/dist/public/assets/messages-BLPbK3hY.js +1 -0
- package/dist/public/assets/messages-BXcet8bS.js +1 -0
- package/dist/public/assets/messages-BwTBQu-G.js +1 -0
- package/dist/public/assets/messages-CkfMXdXE.js +1 -0
- package/dist/public/assets/messages-CuLYOX5w.js +1 -0
- package/dist/public/assets/messages-Dea4EQjg.js +1 -0
- package/dist/public/assets/messages-IxOupfHQ.js +1 -0
- package/dist/public/assets/messages-Pn_9kcf-.js +1 -0
- package/dist/public/assets/messages-S6T9NAt6.js +1 -0
- package/dist/public/assets/messages-TF1JDcwi.js +1 -0
- package/dist/public/assets/messages-rf4KfpqB.js +1 -0
- package/dist/public/assets/page-list-cache-ChtYcEqy.js +1 -0
- package/dist/public/assets/{pending-receive-nav-store-sErL2uzl.js → pending-receive-nav-store-Bil-TrUm.js} +1 -1
- package/dist/public/assets/progress-BWvwixl5.js +9 -0
- package/dist/public/assets/{project-paths-DX_YsFET.js → project-paths-DwqAceR7.js} +1 -1
- package/dist/public/assets/prop-types-DYpnFUiA.js +1 -0
- package/dist/public/assets/{receive-store-6Dih24L8.js → receive-store-SlaWPUgN.js} +1 -1
- package/dist/public/assets/{selection-context-C95IJZrT.js → selection-context-0DjyTppC.js} +1 -1
- package/dist/public/assets/{skill-scope-4RF9DbEf.js → skill-scope-CAMwaRxe.js} +1 -1
- package/dist/public/assets/{skills-api-D5W0J2dk.js → skills-api-Da5ufkZ1.js} +1 -1
- package/dist/public/assets/{src-qGi8ucyG.js → src-B7bHTKA-.js} +1 -1
- package/dist/public/assets/{startup-marks-Bvho0uc6.js → startup-marks-DVUO0HfK.js} +1 -1
- package/dist/public/assets/{tag-pill-input-CtA1wFQO.js → tag-pill-input-CoW3e63I.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-BFUFQkcA.js → target-navigation-intent-DvYaaxCM.js} +1 -1
- package/dist/public/assets/{telemetry-impl-BQYAUKok.js → telemetry-impl-D-zg8Gl0.js} +1 -1
- package/dist/public/assets/{telemetry-startup-C_zn8gFF.js → telemetry-startup-DMvERSQi.js} +1 -1
- package/dist/public/assets/{terminal-cli-display-ZGFW9kw3.js → terminal-cli-display-CEfA2KWv.js} +1 -1
- package/dist/public/assets/terminal-command-events-CtYgivdH.js +1 -0
- package/dist/public/assets/typing-burst-detector-CI3fVplu.js +8 -0
- package/dist/public/assets/{uninstall-BkDWS7iv.js → uninstall-Klg4azur.js} +1 -1
- package/dist/public/assets/{use-activity-panel-CuqTH-mx.js → use-activity-panel-yVeOux9s.js} +1 -1
- package/dist/public/assets/{use-apply-config-color-theme-Ba8Smkdy.js → use-apply-config-color-theme-7S7gMxJq.js} +1 -1
- package/dist/public/assets/{use-collab-url-DFpuF-wX.js → use-collab-url-CWBIa4EB.js} +1 -1
- package/dist/public/assets/{use-live-xterm-theme-c1fyCaal.js → use-live-xterm-theme-ucRLrThh.js} +1 -1
- package/dist/public/assets/{use-open-skill-DJmjKHgr.js → use-open-skill-Dbe6vAB2.js} +1 -1
- package/dist/public/assets/{use-settings-route-BQW0aTo0.js → use-settings-route-D_8dUaRF.js} +1 -1
- package/dist/public/assets/{use-skill-origin-WyyVjfzt.js → use-skill-origin-CIQYqYzE.js} +1 -1
- package/dist/public/assets/{use-skills-BOMFaoLg.js → use-skills-B5njDWLJ.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-T9hbZCmo.js → use-terminal-enabled-DmsVlrSD.js} +1 -1
- package/dist/public/assets/use-timeline-entry-diff-wtkvob0i.js +6 -0
- package/dist/public/assets/{use-workspace-BeSzHXgL.js → use-workspace-Cc5rq4SR.js} +1 -1
- package/dist/public/index.html +49 -49
- package/dist/public/uninstall.html +4 -4
- package/dist/{repair-launch-json-bFAvu0ON.mjs → repair-launch-json-CmoG33qB.mjs} +2 -2
- package/dist/{repair-mcp-configs-CH2x7EWB.mjs → repair-mcp-configs-BK8o68jh.mjs} +2 -2
- package/dist/repair-skills-CTbArNbs.mjs +1 -0
- package/dist/{repair-skills-AGXJVKE-.mjs → repair-skills-J4OgaMJp.mjs} +2 -2
- package/dist/{resolve-project-root-XrNPFGNY.mjs → resolve-project-root-CRLZdY7g.mjs} +2 -2
- package/dist/schemas/v0/config.project-local.schema.json +8 -0
- package/dist/{server-lock-DaOXwt6C.mjs → server-lock-BYM-gfLh.mjs} +2 -2
- package/dist/server-lock-CtqxpUJw.mjs +1 -0
- package/dist/{skill-teardown-BEnDXQv2.mjs → skill-teardown-DqjQIBvp.mjs} +2 -2
- package/dist/{sleep-CKSyI4wt.mjs → sleep-BZCw-NJO.mjs} +2 -2
- package/dist/src-B7csdcod.mjs +1 -0
- package/dist/{src-D79M3x9g.mjs → src-B7qoUiWQ.mjs} +1 -1
- package/dist/{src-CvPOFepk.mjs → src-BiHf8piw.mjs} +2 -2
- package/dist/{src-Dyk9iCzv.mjs → src-CYk60p3w.mjs} +6 -6
- package/dist/{src-BUfAkcnU.mjs → src-Z_TMwYvr.mjs} +125 -125
- package/dist/start-B_SdfHu4.mjs +1 -0
- package/dist/{start-BzznmZaq.mjs → start-D9zTs11o.mjs} +3 -3
- package/package.json +4 -4
- package/dist/constants-BrL6nEnL.mjs +0 -2
- package/dist/fs-traced-CJauRo0X.mjs +0 -1
- package/dist/git-handle-pDdbSsMj.mjs +0 -1
- package/dist/init-B_ONX7Fc.mjs +0 -1
- package/dist/loader-DApHaIJS.mjs +0 -1
- package/dist/md-manager-BUn7RZOJ.mjs +0 -2
- package/dist/preview-CyiVHmAg.mjs +0 -1
- package/dist/public/assets/CodeMirrorPropInput-Dp0ghtC3.js +0 -3
- package/dist/public/assets/FeedbackForm-BNeQXmJD.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-AGHZbLhh.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-Dd9YEu9g.js +0 -1
- package/dist/public/assets/SessionsHost-CGbrz5ge.js +0 -2
- package/dist/public/assets/SettingsDialogBody-GRqpQyOX.js +0 -12
- package/dist/public/assets/SourceEditor-D9_q6g5_.js +0 -1
- package/dist/public/assets/TerminalPanel-Lt1-XHX1.js +0 -146
- package/dist/public/assets/client-version-B_H8duw7.js +0 -1
- package/dist/public/assets/config-provider-D-Y4Wg0x.js +0 -5
- package/dist/public/assets/i18n-BFtoQNCd.js +0 -1
- package/dist/public/assets/messages-4RkxHe2V.js +0 -1
- package/dist/public/assets/messages-B2mYVhA4.js +0 -1
- package/dist/public/assets/messages-B66IfJmC.js +0 -1
- package/dist/public/assets/messages-BnuH_5SE.js +0 -1
- package/dist/public/assets/messages-C6nB3b-S.js +0 -1
- package/dist/public/assets/messages-CruCvJrt.js +0 -1
- package/dist/public/assets/messages-DHU55TlV.js +0 -1
- package/dist/public/assets/messages-DXoOD1yT.js +0 -1
- package/dist/public/assets/messages-DlIZYdug.js +0 -1
- package/dist/public/assets/messages-Tw_xE_s7.js +0 -1
- package/dist/public/assets/messages-W1AArZV6.js +0 -1
- package/dist/public/assets/messages-v9AyC868.js +0 -1
- package/dist/public/assets/page-list-cache-D2OX_WDU.js +0 -1
- package/dist/public/assets/progress-DfDRMpm4.js +0 -9
- package/dist/public/assets/prop-types-NHOECtyl.js +0 -1
- package/dist/public/assets/terminal-command-events-D0gJ8NJs.js +0 -1
- package/dist/public/assets/typing-burst-detector-B0lg7vla.js +0 -8
- package/dist/public/assets/use-timeline-entry-diff-Blkn7mx5.js +0 -6
- package/dist/repair-skills-DUxV_xLI.mjs +0 -1
- package/dist/server-lock-VtTnds5h.mjs +0 -1
- package/dist/src-CXxM2X1c.mjs +0 -1
- package/dist/start-DvcwdtWv.mjs +0 -1
|
@@ -177,7 +177,7 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
|
|
|
177
177
|
`,e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(this.onKeyLine=!1,t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){u(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,r=n&&(t.sep||t.explicitKey)&&this.type!==`seq-item-ind`,i=[];if(r&&t.sep&&!t.value){let n=[];for(let r=0;r<t.sep.length;++r){let i=t.sep[r];switch(i.type){case`newline`:n.push(r);break;case`space`:break;case`comment`:i.indent>e.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=t.sep.splice(n[1]))}switch(this.type){case`anchor`:case`tag`:r||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`explicit-key-ind`:!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case`map-value-ind`:if(t.explicitKey)if(!t.sep)if(a(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=l(t.start);this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(a(t.sep,`map-value-ind`))this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(s(t.key)&&!a(t.sep,`newline`)){let e=l(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken);else t.sep?t.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):a(t.sep,`map-value-ind`)?this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);r||t.value?(e.items.push({start:i,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0);return}default:{let r=this.startBlockValue(e);if(r){if(r.type===`block-seq`){if(!t.explicitKey&&t.sep&&!a(t.sep,`newline`)){yield*this.pop({type:`error`,offset:this.offset,message:`Unexpected block-seq-ind on same line with key`,source:this.source});return}}else n&&e.items.push({start:i});this.stack.push(r);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){u(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case`anchor`:case`tag`:if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case`seq-item-ind`:if(this.indent!==e.indent)break;t.value||a(t.start,`seq-item-ind`)?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t){this.stack.push(t);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type===`flow-error-end`){let e;do yield*this.pop(),e=this.peek(1);while(e?.type===`flow-collection`)}else if(e.end.length===0){switch(this.type){case`comma`:case`explicit-key-ind`:!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case`map-value-ind`:!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case`space`:case`comment`:case`newline`:case`anchor`:case`tag`:!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:n,sep:[]}):t.sep?this.stack.push(n):Object.assign(t,{key:n,sep:[]});return}case`flow-map-end`:case`flow-seq-end`:e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let t=this.peek(2);if(t.type===`block-map`&&(this.type===`map-value-ind`&&t.indent===e.indent||this.type===`newline`&&!t.items[t.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type===`map-value-ind`&&t.type!==`flow-collection`){let n=l(c(t));d(e);let r=e.end.splice(1,e.end.length);r.push(this.sourceToken);let i={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf(`
|
|
178
178
|
`)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
|
|
179
179
|
`,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=l(c(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=l(c(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}}})),mc=t((e=>{var t=oc(),n=Us(),r=Ws(),i=gs(),a=q(),o=fc(),s=pc();function c(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new o.LineCounter||null,prettyErrors:t}}function l(e,n={}){let{lineCounter:i,prettyErrors:a}=c(n),o=new s.Parser(i?.addNewLine),l=new t.Composer(n),u=Array.from(l.compose(o.parse(e)));if(a&&i)for(let t of u)t.errors.forEach(r.prettifyError(e,i)),t.warnings.forEach(r.prettifyError(e,i));return u.length>0?u:Object.assign([],{empty:!0},l.streamInfo())}function u(e,n={}){let{lineCounter:i,prettyErrors:a}=c(n),o=new s.Parser(i?.addNewLine),l=new t.Composer(n),u=null;for(let t of l.compose(o.parse(e),!0,e.length))if(!u)u=t;else if(u.options.logLevel!==`silent`){u.errors.push(new r.YAMLParseError(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return a&&i&&(u.errors.forEach(r.prettifyError(e,i)),u.warnings.forEach(r.prettifyError(e,i))),u}function d(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let a=u(e,n);if(!a)return null;if(a.warnings.forEach(e=>i.warn(a.options.logLevel,e)),a.errors.length>0){if(a.options.logLevel!==`silent`)throw a.errors[0];a.errors=[]}return a.toJS(Object.assign({reviver:r},n))}function f(e,t,r){let i=null;if(typeof t==`function`||Array.isArray(t)?i=t:r===void 0&&t&&(r=t),typeof r==`string`&&(r=r.length),typeof r==`number`){let e=Math.round(r);r=e<1?void 0:e>8?{indent:8}:{indent:e}}if(e===void 0){let{keepUndefined:e}=r??t??{};if(!e)return}return a.isDocument(e)&&!i?e.toString(r):new n.Document(e,i,r).toString(r)}e.parse=d,e.parseAllDocuments=l,e.parseDocument=u,e.stringify=f})),hc=t((e=>{var t=oc(),n=Us(),r=Vs(),i=Ws(),a=cs(),o=q(),s=X(),c=Y(),l=Z(),u=xs();uc();var d=dc(),f=fc(),p=pc(),m=mc(),h=rs();e.Composer=t.Composer,e.Document=n.Document,e.Schema=r.Schema,e.YAMLError=i.YAMLError,e.YAMLParseError=i.YAMLParseError,e.YAMLWarning=i.YAMLWarning,e.Alias=a.Alias,e.isAlias=o.isAlias,e.isCollection=o.isCollection,e.isDocument=o.isDocument,e.isMap=o.isMap,e.isNode=o.isNode,e.isPair=o.isPair,e.isScalar=o.isScalar,e.isSeq=o.isSeq,e.Pair=s.Pair,e.Scalar=c.Scalar,e.YAMLMap=l.YAMLMap,e.YAMLSeq=u.YAMLSeq,e.Lexer=d.Lexer,e.LineCounter=f.LineCounter,e.Parser=p.Parser,e.parse=m.parse,e.parseAllDocuments=m.parseAllDocuments,e.parseDocument=m.parseDocument,e.stringify=m.stringify,e.visit=h.visit,e.visitAsync=h.visitAsync}));const gc=new Set(Object.keys({sh:`bash`,zsh:`bash`,bash:`bash`,c:`c`,cc:`cpp`,cpp:`cpp`,cxx:`cpp`,"c++":`cpp`,h:`c`,hh:`cpp`,hpp:`cpp`,cs:`csharp`,css:`css`,less:`less`,scss:`scss`,sass:`scss`,diff:`diff`,patch:`diff`,feature:`gherkin`,go:`go`,gql:`graphql`,graphql:`graphql`,ini:`ini`,cfg:`ini`,conf:`ini`,properties:`ini`,java:`java`,js:`javascript`,jsx:`javascript`,mjs:`javascript`,cjs:`javascript`,json:`json`,jsonc:`json`,kt:`kotlin`,kts:`kotlin`,lua:`lua`,makefile:`makefile`,md:`markdown`,mdx:`markdown`,m:`objectivec`,mm:`objectivec`,pl:`perl`,pm:`perl`,php:`php`,phtml:`php`,py:`python`,pyi:`python`,pyx:`python`,r:`r`,rb:`ruby`,rs:`rust`,sql:`sql`,swift:`swift`,ts:`typescript`,tsx:`typescript`,xml:`xml`,yaml:`yaml`,yml:`yaml`})),_c=new Set([`md`,`mdx`,`mmd`,`mermaid`]),vc=new Set([...gc,`txt`,`text`,`csv`,`tsv`,`log`,`toml`,`html`,`htm`,`svg`,`vue`,`svelte`,`astro`,`lock`].filter(e=>!_c.has(e)));function yc(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return n<=0?!1:vc.has(t.slice(n+1).toLowerCase())}const bc=[`image/jpeg`,`image/png`,`image/gif`,`image/webp`,`image/svg+xml`],xc=[`video/mp4`,`video/webm`,`video/ogg`],Sc=[`audio/mpeg`,`audio/wav`,`audio/ogg`],Cc=[`application/pdf`],wc=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`avif`,`svg`]),Tc=new Set([`mp4`,`webm`,`mov`,`m4v`,`mkv`]),Ec=new Set([`pdf`]),Dc=new Set([`mp3`,`wav`,`ogg`,`m4a`,`flac`,`aac`,`opus`]),Oc=new Set(`pdf.docx.xlsx.pptx.doc.xls.ppt.zip.7z.tar.gz.rar.csv.tsv.rtf.json.yaml.yml.xml.txt.pages.numbers.key.odt.ods.odp.epub.mobi`.split(`.`)),kc=new Set(`exe.bat.cmd.ps1.com.msi.vbs.js.jse.wsf.wsh.hta.sh.command.csh.ksh.bash.zsh.fish.desktop.action.workflow.html.htm.svg.xml.mhtml.svgz.dmg.pkg.mpkg.scpt.applescript.terminal.prefpane.webloc.inetloc.fileloc.jar.appimage.deb.rpm.msix.appx.ipa.apk.pif.scr.lnk.url`.split(`.`)),Ac=new Set(`png.jpg.jpeg.gif.webp.avif.svg.apng.heic.heif.tiff.bmp.ico.pdf.mp4.webm.mov.m4v.mkv.avi.flv.wmv.mpeg.mpg.mp3.wav.ogg.m4a.flac.aac.opus.zip.7z.tar.gz.rar.woff.woff2.ttf.otf.eot.docx.xlsx.pptx.doc.xls.ppt.odt.ods.odp.pages.numbers.key.epub.mobi.csv.tsv.txt.rtf.json.yaml.yml.xml.toml.lock.gpx.html.htm`.split(`.`)),jc=new Set([`html`,`htm`]),Mc=`sandbox allow-scripts; connect-src 'none'`,Nc=new Set(`png.jpg.jpeg.gif.webp.avif.apng.heic.heif.tiff.bmp.ico.svg.pdf.mp4.webm.mov.m4v.mkv.mp3.wav.ogg.m4a.flac.aac.opus.json.toml.lock`.split(`.`)),Pc=`same-dir`,Fc=new Set(`png.jpg.jpeg.gif.webp.avif.svg.pdf.mp4.webm.mov.m4v.mkv.mp3.wav.ogg.m4a.flac.aac.opus.docx.xlsx.pptx.doc.xls.ppt.zip.7z.tar.gz.rar.csv.tsv.rtf.json.yaml.yml.xml.txt.pages.numbers.key.odt.ods.odp.epub.mobi`.split(`.`)),Ic=[`png`,`jpg`,`jpeg`,`gif`,`webp`,`avif`],Lc=[`mp4`,`webm`,`mov`,`m4v`],Rc=[`mp3`,`wav`,`ogg`,`m4a`,`flac`,`aac`,`opus`],zc=[`pdf`],Bc=[`json`,`toml`,`lock`];function Vc(e,t,n){for(let r of t)if(!n.has(r))throw Error(`${e}: ${r} is not present in canonical upload constants`)}Vc(`SIDEBAR_IMAGE_ASSET_EXTENSIONS`,Ic,wc),Vc(`SIDEBAR_VIDEO_ASSET_EXTENSIONS`,Lc,Tc),Vc(`SIDEBAR_AUDIO_ASSET_EXTENSIONS`,Rc,Dc),Vc(`SIDEBAR_PDF_ASSET_EXTENSIONS`,zc,Ec),Vc(`FILE_ATTACHMENT_EXTENSIONS`,[...Oc],Fc),Vc(`WIKI_EMBED_EXTENSIONS`,[...Fc],Ac);const Hc=new Set(Ic),Uc=new Set(Lc),Wc=new Set(Rc),Gc=new Set(zc),Kc=new Set(Bc);Vc(`SIDEBAR_RENDERABLE_ASSET_EXTENSIONS`,[...new Set([...Ic,...Lc,...Rc,...zc,...Bc])],Nc);const qc=new Set([`base`,`canvas`]),Jc=new Set([`mmd`,`mermaid`]);function Yc(e){let t=e.lastIndexOf(`.`);return t<0?!1:Jc.has(e.slice(t+1).toLowerCase())}const Xc=new Set([`excalidraw`]);function Zc(e){let t=e.lastIndexOf(`.`);return t<0?!1:Xc.has(e.slice(t+1).toLowerCase())}const Qc=new Set([...Ac,...qc,...Jc,...Xc]);function $c(e){let t=e.toLowerCase().replace(/^\./,``);return Hc.has(t)?`image`:Uc.has(t)?`video`:Wc.has(t)?`audio`:Gc.has(t)?`pdf`:Kc.has(t)||qc.has(t)?`text`:Jc.has(t)?`mermaid`:Xc.has(t)?`excalidraw`:gc.has(t)?`text`:null}const el=[`en`,`zh-Hans`,`zh-Hant`,`hi`,`es`,`ar`,`fr`,`bn`,`pt-BR`,`id`,`ur`,`ko`],tl=new Set([`ar`,`ur`]),nl=el.filter(e=>!tl.has(e)),rl=[`markdownlint`,`frontmatter`,`okf`],il=[`missing`,`invalid`];[...rl];const al=[`off`,`warning`,`error`],ol=`warning`,sl=[`error`,`warning`];var cl=hc();const ll=[`base00`,`base01`,`base02`,`base03`,`base04`,`base05`,`base06`,`base07`,`base08`,`base09`,`base0A`,`base0B`,`base0C`,`base0D`,`base0E`,`base0F`],ul={base00:`default background`,base01:`alt background — cards, popovers, sidebar`,base02:`selection background, borders`,base03:`comments, invisibles`,base04:`secondary text`,base05:`default foreground`,base06:`light foreground`,base07:`lightest foreground`,base08:`red — variables, tags, diff deleted`,base09:`orange — numbers, constants`,base0A:`yellow — classes, search highlight`,base0B:`green — strings, diff inserted`,base0C:`cyan — support, escapes, quotes`,base0D:`blue — functions, headings, accent`,base0E:`magenta — keywords, storage`,base0F:`deprecated markers, embedded tags`},dl=/^#[0-9a-fA-F]{6}$/,fl=/\P{White_Space}/u;function pl(e){return fl.test(e)}function ml(e){return typeof e==`string`&&dl.test(e)}function hl(e){let t=e.palette;return{background:t.base00,foreground:t.base05,card:t.base01,"card-foreground":t.base05,popover:t.base01,"popover-foreground":t.base05,primary:t.base0D,"primary-foreground":t.base00,secondary:t.base01,"secondary-foreground":t.base05,muted:t.base01,"muted-foreground":t.base04,accent:t.base02,"accent-foreground":t.base05,destructive:t.base08,border:t.base02,input:t.base02,ring:t.base0D,"selection-soft":t.base02,"chart-1":t.base0D,"chart-2":t.base0B,"chart-3":t.base0A,"chart-4":t.base0E,"chart-5":t.base08,sidebar:t.base01,"sidebar-foreground":t.base05,"sidebar-primary":t.base0D,"sidebar-primary-foreground":t.base00,"sidebar-accent":t.base02,"sidebar-accent-foreground":t.base0D,"sidebar-hover":t.base02,"sidebar-border":t.base02,"sidebar-ring":t.base0D,"syntax-keyword":t.base0E,"syntax-tag":t.base08,"syntax-attr":t.base0D,"syntax-string":t.base0B,"syntax-number":t.base09,"syntax-atom":t.base0C,"syntax-comment":t.base03,"syntax-func":t.base0D,"syntax-var":t.base08,"syntax-type":t.base0A,"syntax-operator":t.base05,"syntax-meta":t.base0F,"syntax-bg":t.base01,"link-color":t.base0D,"broken-link-color":t.base08,"lint-warning-color":t.base0A,"lint-error-color":t.base08,"diff-added":t.base0B,"diff-removed":t.base08,"callout-note-color":t.base0D,"callout-info-color":t.base0D,"callout-todo-color":t.base0D,"callout-abstract-color":t.base0C,"callout-tip-color":t.base0B,"callout-success-color":t.base0B,"callout-important-color":t.base0E,"callout-example-color":t.base0E,"callout-question-color":t.base0E,"callout-warning-color":t.base0A,"callout-caution-color":t.base09,"callout-danger-color":t.base09,"callout-failure-color":t.base08,"callout-bug-color":t.base08,"callout-quote-color":t.base03,...vl(t)}}const gl={black:`base00`,red:`base08`,green:`base0B`,yellow:`base0A`,blue:`base0D`,magenta:`base0E`,cyan:`base0C`,white:`base05`,brightBlack:`base03`,brightRed:`base08`,brightGreen:`base0B`,brightYellow:`base0A`,brightBlue:`base0D`,brightMagenta:`base0E`,brightCyan:`base0C`,brightWhite:`base07`},_l=Object.keys(gl);function vl(e){let t={};for(let n of _l)t[`ansi-${yl(n)}`]=e[gl[n]];return t}function yl(e){return e.replace(/([a-z])([A-Z])/g,`$1-$2`).toLowerCase()}function bl(e){return JSON.stringify(e).replace(/[\u007f-\u009f\u2028\u2029\ufffe\uffff]/g,e=>`\\u${e.charCodeAt(0).toString(16).padStart(4,`0`)}`)}function xl(e){return`${[`system: "base16"`,`name: ${bl(e.name)}`,...e.author?[`author: ${bl(e.author)}`]:[],`variant: ${bl(e.variant)}`,`palette:`,...ll.map(t=>` ${t}: ${bl(e.palette[t])}`)].join(`
|
|
180
|
-
`)}\n`}function Sl(e){let t;try{t=(0,cl.parse)(e,{schema:`failsafe`})}catch(e){let t=e?.linePos;return{ok:!1,error:{kind:`unparseable`,line:typeof t?.[0]?.line==`number`?t[0].line:void 0}}}if(!t||typeof t!=`object`||Array.isArray(t))return{ok:!1,error:{kind:`not-a-scheme`}};let n=t,r=n.palette,i=r&&typeof r==`object`&&!Array.isArray(r)?r:n,a={},o=[],s=[];for(let e of ll){let t=i[e]??i[e.toLowerCase()];if(t==null){o.push(e);continue}let n=Cl(t);if(!n){s.push(e);continue}a[e]=n}return o.length?{ok:!1,error:{kind:`missing-slots`,slots:o}}:s.length?{ok:!1,error:{kind:`bad-hex`,slots:s}}:typeof n.name==`string`&&!pl(n.name)||typeof n.author==`string`&&!pl(n.author)?{ok:!1,error:{kind:`not-a-scheme`}}:{ok:!0,scheme:{name:typeof n.name==`string`?n.name:`Imported`,author:typeof n.author==`string`?n.author:void 0,variant:n.variant===`light`||n.variant===`dark`?n.variant:Tl(a),palette:a}}}function Cl(e){if(typeof e!=`string`)return null;let t=e.trim();return t.startsWith(`#`)||(t=`#${t}`),/^#[0-9a-fA-F]{3}$/.test(t)&&(t=`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}`),dl.test(t)?t.toLowerCase():null}function wl(e){let t=ml(e)?e:`#000000`,n=e=>{let n=Number.parseInt(t.slice(1+e*2,3+e*2),16)/255;return n<=.03928?n/12.92:((n+.055)/1.055)**2.4};return .2126*n(0)+.7152*n(1)+.0722*n(2)}function Tl(e){return wl(e.base00)<wl(e.base05)?`dark`:`light`}const El={name:`Dracula`,author:`clach04 (https://github.com/clach04)`,variant:`dark`,palette:{base00:`#282a36`,base01:`#21222c`,base02:`#44475a`,base03:`#6272a4`,base04:`#9ea8c7`,base05:`#f8f8f2`,base06:`#f8f8f2`,base07:`#ffffff`,base08:`#ff5555`,base09:`#ffb86c`,base0A:`#f1fa8c`,base0B:`#50fa7b`,base0C:`#8be9fd`,base0D:`#bd93f9`,base0E:`#ff79c6`,base0F:`#993333`}},Dl={name:`Catppuccin Frappé`,author:`https://github.com/catppuccin/catppuccin`,variant:`dark`,palette:{base00:`#303446`,base01:`#292c3c`,base02:`#414559`,base03:`#51576d`,base04:`#626880`,base05:`#c6d0f5`,base06:`#f2d5cf`,base07:`#babbf1`,base08:`#e78284`,base09:`#ef9f76`,base0A:`#e5c890`,base0B:`#a6d189`,base0C:`#81c8be`,base0D:`#8caaee`,base0E:`#ca9ee6`,base0F:`#eebebe`}},Ol={name:`Catppuccin Latte`,author:`https://github.com/catppuccin/catppuccin`,variant:`light`,palette:{base00:`#eff1f5`,base01:`#e6e9ef`,base02:`#ccd0da`,base03:`#bcc0cc`,base04:`#acb0be`,base05:`#4c4f69`,base06:`#dc8a78`,base07:`#7287fd`,base08:`#d20f39`,base09:`#fe640b`,base0A:`#df8e1d`,base0B:`#40a02b`,base0C:`#179299`,base0D:`#1d62ec`,base0E:`#8839ef`,base0F:`#dd7878`}},kl={name:`Monokai`,author:`Wimer Hazenberg (http://www.monokai.nl)`,variant:`dark`,palette:{base00:`#272822`,base01:`#383830`,base02:`#49483e`,base03:`#75715e`,base04:`#a59f85`,base05:`#f8f8f2`,base06:`#f5f4f1`,base07:`#f9f8f5`,base08:`#f92672`,base09:`#fd971f`,base0A:`#f4bf75`,base0B:`#a6e22e`,base0C:`#a1efe4`,base0D:`#66d9ef`,base0E:`#ae81ff`,base0F:`#cc6633`}},Al={name:`Gruvbox dark, medium`,author:`Dawid Kurek, morhetz (https://github.com/morhetz/gruvbox)`,variant:`dark`,palette:{base00:`#282828`,base01:`#3c3836`,base02:`#504945`,base03:`#665c54`,base04:`#bdae93`,base05:`#d5c4a1`,base06:`#ebdbb2`,base07:`#fbf1c7`,base08:`#fb4934`,base09:`#fe8019`,base0A:`#fabd2f`,base0B:`#b8bb26`,base0C:`#8ec07c`,base0D:`#83a598`,base0E:`#d3869b`,base0F:`#d65d0e`}},jl={name:`Solarized Dark`,author:`Ethan Schoonover (modified by aramisgithub)`,variant:`dark`,palette:{base00:`#002b36`,base01:`#073642`,base02:`#586e75`,base03:`#657b83`,base04:`#839496`,base05:`#93a1a1`,base06:`#eee8d5`,base07:`#fdf6e3`,base08:`#dc322f`,base09:`#cb4b16`,base0A:`#b58900`,base0B:`#859900`,base0C:`#2aa198`,base0D:`#2995e1`,base0E:`#6c71c4`,base0F:`#d33682`}};function Ml(e,t,n){return{id:e,label:t,kind:n.variant,scheme:n,toTokens:()=>hl(n)}}function Nl(e,t){return{id:e,label:t,kind:`system`}}const Pl=[Nl(`default`,`Default`),Ml(`dracula`,`Dracula`,El),Ml(`catppuccin-frappe`,`Catppuccin Frappé`,Dl),Ml(`catppuccin-latte`,`Catppuccin Latte`,Ol),Ml(`monokai`,`Monokai`,kl),Ml(`gruvbox`,`Gruvbox`,Al),Ml(`solarized`,`Solarized`,jl),Nl(`custom`,`Custom`)],Fl=Pl.map(e=>e.id),Il=/^[a-z0-9-]{1,32}$/,Ll=/\p{M}+/gu,Rl=/['\u2019\u02bc]+/gu,zl=/[^a-z0-9]+/g;function Bl(e){let t=2166136261;for(let n of e)t^=n.codePointAt(0)??0,t=Math.imul(t,16777619);return(t>>>0).toString(16).padStart(8,`0`)}function Vl(e){let t=e.trim();if(t.length===0)return{ok:!1,code:`empty`};let n=t.normalize(`NFKD`).replace(Ll,``).toLowerCase().replace(Rl,``).replace(zl,`-`).replace(/^-+|-+$/g,``),r=Bl(t),i=n.length===0?`theme-${r}`:n.length<=26?n:`${n.slice(0,26-r.length-1).replace(/-+$/g,``)}-${r}`,a=Hl(i);if(!a.ok)throw Error(`Saved theme name derivation produced an invalid id`);return{ok:!0,name:t,stem:i,id:a.id}}function Hl(e){if(e.length===0)return{ok:!1,code:`empty`};let t=`saved-`+e;return Il.test(t)?{ok:!0,id:t}:{ok:!1,code:/^[a-z0-9-]+$/.test(t)?`too-long`:`invalid-chars`}}function Ul(e){if(!Il.test(e)||!e.startsWith(`saved-`))return{ok:!1};let t=e.slice(6);return t.length===0?{ok:!1}:{ok:!0,stem:t}}new Map(Pl.map(e=>[e.id,e]));const Wl=Symbol.for(`@inkeep/open-knowledge/field-registry`),Gl=globalThis;Gl[Wl]===void 0&&(Gl[Wl]=tr());const Q=Gl[Wl];function Kl(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=ql(t)?Q.get(t):void 0;if(e!==void 0)return e;let n=t._zod?.def?.innerType;if(n===void 0)return;t=n}}function ql(e){return typeof e==`object`&&!!e&&`_zod`in e&&`parse`in e}function Jl(){return Object.fromEntries(ll.map(e=>[e,L().register(Q,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Custom theme: base16 ${e} — ${ul[e]}, as a #rrggbb hex string.`}).optional()]))}function Yl(){return Fl.filter(e=>e!==`default`&&e!==`custom`).map(e=>`'${e}'`).join(`, `)}const Xl=Object.freeze([`authorization`,`auth.token`,`auth.bearer`,`cookie`,`set-cookie`,`x-api-key`,`password`,`secret`]),Zl=52428800,Ql=26214400,$l=12582912,eu=`https://api.openai.com/v1`,tu=`text-embedding-3-small`,nu=Object.freeze([`127.0.0.1`]),ru=/^[1-9]\d*(s|m|h)$/,iu=/^https?:\/\//;function au(e){let t;try{t=new URL(e)}catch{return!1}let n=t.hostname.toLowerCase();return n===`localhost`||n===`127.0.0.1`||n===`[::1]`}function ou(e){let t;try{t=new URL(e)}catch{return`invalid-url`}return t.protocol===`https:`||t.protocol===`http:`&&au(e)?null:`insecure-scheme`}function su(e){let t=e.trim();return t===``?`./`:t}function cu(e){let t=su(e);return t.includes(`\0`)||t.includes(`\\`)?!1:t===`/`?!0:!(t.startsWith(`/`)||/^[A-Za-z]:/.test(t)||t.split(`/`).some(e=>e===`..`))}const lu=U({content:U({dir:L().register(Q,{scope:`project`,agentSettable:!1,reload:`boot`,defaultScope:`project`,description:`Folder OpenKnowledge reads and writes documents under, relative to the project root (the folder that contains .ok/). Defaults to the project root. Exclude paths with .okignore. Read at server start; changing it requires a restart.`}).default(`.`),attachmentFolderPath:L().register(Q,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Where pasted and dropped assets are stored, relative to the content root. './' colocates beside the current document (default); '/' targets the content root; './subdir' targets a subfolder under the current document folder; 'folder' targets a fixed folder under the content root. Whitespace-only values are treated as './'.`}).refine(cu,{message:`Invalid attachment folder path: must not contain '..' segments, NUL bytes, backslashes, or OS absolute paths (use '/' for the content root).`}).default(`./`)}).default({dir:`.`,attachmentFolderPath:`./`}),appearance:U({theme:G([`light`,`dark`,`system`]).register(Q,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Editor color theme: 'light', 'dark', or 'system' (follow the OS). A personal preference (user scope) — not shared with the project.`}).optional(),language:G([`system`,...el]).register(Q,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Interface language. 'system' follows the operating system. A personal preference (user scope) — not shared with the project, and never applied to document content.`}).optional(),colorThemeLight:L().register(Q,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`IDE color palette applied in light mode: 'default' (no palette), 'custom' (your own colors from appearance.customTheme), one of ${Yl()}, or the id of a saved theme. A short id of lowercase letters, digits, and hyphens (max 32 characters); an id no palette matches falls back to 'default' for this mode only, leaving the rest of your config untouched. A personal preference (user scope) — not shared with the project.`}).regex(Il,{message:`Theme id must be lowercase letters, digits, and hyphens, 1–32 characters (e.g. 'dracula', 'custom', or a saved theme id).`}).optional(),colorThemeDark:L().register(Q,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`IDE color palette applied in dark mode: 'default' (no palette), 'custom' (your own colors from appearance.customTheme), one of ${Yl()}, or the id of a saved theme. A short id of lowercase letters, digits, and hyphens (max 32 characters); an id no palette matches falls back to 'default' for this mode only, leaving the rest of your config untouched. A personal preference (user scope) — not shared with the project.`}).regex(Il,{message:`Theme id must be lowercase letters, digits, and hyphens, 1–32 characters (e.g. 'dracula', 'custom', or a saved theme id).`}).optional(),colorTheme:L().register(Q,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Superseded by appearance.colorThemeLight / appearance.colorThemeDark. Read as the palette for both modes while neither of those is set. A short theme id (lowercase letters, digits, and hyphens; max 32 characters); an id no palette matches falls back to 'default'. A personal preference (user scope) — not shared with the project.`}).regex(Il,{message:`Theme id must be lowercase letters, digits, and hyphens, 1–32 characters (e.g. 'dracula', 'custom', or a saved theme id).`}).optional(),colorThemeEnabled:B().register(Q,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Whether the Themes plugin appears in Settings → Plugins. A personal preference (user scope). Default on.`}).optional(),customTheme:U({name:L().register(Q,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Custom theme: the scheme's display name.`}).optional(),author:L().register(Q,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Custom theme: the scheme's author credit, carried through from an imported base16 scheme.`}).optional(),variant:G([`dark`,`light`]).register(Q,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Custom theme: whether the scheme is 'dark' or 'light'. Auto-detected from the palette when omitted.`}).optional(),...Jl()}).optional(),preview:U({autoOpen:B().register(Q,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`When on, the agent opens or refreshes the live preview after each edit. Turn off if you manage your own preview window. A personal preference (user scope).`}).default(!0)}).default({autoOpen:!0}),sidebar:U({showHiddenFiles:B().register(Q,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Show dot-prefixed entries (e.g. .ok/, .okignore) in the file tree. Per-machine (project-local) — not shared with collaborators.`}).default(!1),showOnlyMarkdownFiles:B().register(Q,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Show only markdown documents (.md/.mdx) and folders in the file tree, hiding other file types from view. View-only: hidden files stay on disk and remain reachable via links and search. Per-machine (project-local) — not shared with collaborators.`}).default(!1),showSkillsSection:B().register(Q,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Show the Skills section in the sidebar. Skill documents remain reachable via links and search while the section is hidden. Per-machine (project-local) — not shared with collaborators.`}).default(!0),showOkFolders:B().register(Q,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Show .ok folders (skills, templates, and other OpenKnowledge-managed state) in the file tree as read-only entries. .ok/worktrees and .ok/local never appear. Per-machine (project-local) — not shared with collaborators.`}).default(!1),showSkillGroups:B().register(Q,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Group skills in the sidebar by where they came from — the publisher they were imported from, or the plugin that ships them. Skills you authored stay ungrouped at the top of their scope. Per-machine (project-local) — not shared with collaborators.`}).default(!0),pinnedProjectSkills:V(L()).register(Q,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Project-scope skills pinned to the top of the Skills sidebar, by name. A pinned skill also keeps its normal row, so a provenance group still lists everything from its source. Per-machine (project-local) — not shared with collaborators.`}).default([]),pinnedGlobalSkills:V(L()).register(Q,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Global-scope skills pinned to the top of the Skills sidebar, by name. Stored per USER rather than per project, so a pinned global skill follows you into every project.`}).default([])}).optional()}).default({preview:{autoOpen:!0}}),editor:U({wordWrap:B().register(Q,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Soft-wrap long lines in the source (CodeMirror) editor. A personal preference (user scope).`}).default(!0),previewTabs:B().register(Q,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Reuse one tab when clicking through the Files and Skills sidebars, the way an editor preview tab works. Turn off to open every click in its own tab. Pinned tabs keep their own tab either way. A personal preference (user scope).`}).default(!0)}).default({wordWrap:!0,previewTabs:!0}),agents:U({autoApproveOkTools:B().register(Q,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:"Auto-approve OpenKnowledge's own tools (and `ok open` on Claude) for agents launched from the built-in terminal. Destructive tools (delete/move/share/install) still prompt. Per-machine personal preference (user scope)."}).default(!0)}).default({autoApproveOkTools:!0}),autoSync:U({mode:G(qo).register(Q,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`What this machine syncs on a schedule for this project: 'off' (Manual — nothing scheduled; the manual pull/push actions still work), 'follow' (Auto, pull only — scheduled pulls, never a scheduled push; 'pull' is accepted as a legacy alias), or 'full' (Auto, pull and push — bidirectional). Explicit user-triggered pushes work in every mode. null = not chosen yet (onboarding asks). Per-machine (project-local) — not shared. Supersedes the legacy autoSync.enabled boolean.`}).nullable().default(null),enabled:B().register(Q,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Legacy per-machine sync toggle, superseded by autoSync.mode. Read only when mode is absent (true = full, false = off). null = not chosen yet. Per-machine (project-local) — not shared.`}).nullable().default(null),resumeMode:G(Jo).register(Q,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`When sync is paused (autoSync.mode 'off') after having been enabled, the active mode to resume into ('follow' | 'full'). Per-machine UI memory; ignored while a mode is active. Not shared.`}).optional(),pullIntervalSeconds:z().int().min(30).max(es).register(Q,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Seconds between scheduled pulls while autoSync.mode is follow or full (default 30). An unauthenticated follower is additionally floored to the anonymous poll minimum, so a lower value there has no effect. Per-machine (project-local) — not shared.`}).optional().catch(void 0),pushIntervalSeconds:z().int().min(30).max(es).register(Q,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Seconds between scheduled pushes while autoSync.mode is full (default 60). Ignored in every other mode, which never pushes on a schedule. Each cycle with pending edits authors a commit, so a shorter interval means more, smaller commits in the repo's shared history. Per-machine (project-local) — not shared.`}).optional().catch(void 0),default:W([B(),G(qo)]).register(Q,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Committed project default for a machine's sync mode on first open: 'off' | 'follow' | 'full', or the legacy boolean (true = full, false = off). null = ask (show the onboarding prompt). Shared via git. A per-machine autoSync.mode choice overrides it.`}).nullable().default(null)}).default({mode:null,enabled:null,default:null}),terminal:U({enabled:B().register(Q,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Opt-out for the in-app terminal (a real OS shell at full user privilege). The terminal is on by default; set false to disable it for this project on this machine. Per-machine (project-local) — never shared via git, clone, or sync.`}).nullable().default(null)}).default({enabled:null}),slides:U({enabled:B().register(Q,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:"Whether the Slides plugin appears in Settings → Plugins. When on, a document whose frontmatter has `slides: true` offers an action that opens the deck in a dedicated window (desktop only, requires a resolvable slidev). A personal preference (user scope). Default off."}).default(!1)}).default({enabled:!1}),telemetry:U({localSink:U({enabled:B().register(Q,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:"Write local diagnostic spans + logs under .ok/local/ for `ok diagnose bundle`. Local-only — never leaves the machine until you run bundle. Set false for sensitive workspaces. Shared across collaborators."}).default(!0),spans:U({maxBytes:z().register(Q,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Maximum size, in bytes, of the local diagnostic spans file before it rotates (default ~50 MB).`}).default(Zl)}).default({maxBytes:Zl}),logs:U({maxBytes:z().register(Q,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Maximum size, in bytes, of the local diagnostic logs file before it rotates (default ~25 MB).`}).default(Ql)}).default({maxBytes:Ql}),attributeDenylist:V(L()).register(Q,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Telemetry attribute keys whose values are redacted before any local span/log is written (credential / secret guard). Extends the built-in denylist.`}).default([...Xl])}).default({enabled:!0,spans:{maxBytes:Zl},logs:{maxBytes:Ql},attributeDenylist:[...Xl]}),skillInstallReports:U({enabled:B().register(Q,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Report skill installs to skills.sh so a published skill shows an accurate install count. Sends the skill name, its source repo, and which agent tools it was installed for — never file contents, and never for a private or local source. One report per skill per machine. Default on; the DO_NOT_TRACK and DISABLE_TELEMETRY environment variables also turn it off.`}).default(!0)}).default({enabled:!0})}).default({localSink:{enabled:!0,spans:{maxBytes:Zl},logs:{maxBytes:Ql},attributeDenylist:[...Xl]},skillInstallReports:{enabled:!0}}),lossCapture:U({enabled:B().register(Q,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:"Record bridge loss-class events (content-free) under .ok/local/loss-capture/ for `ok diagnose bundle`. Local-only — never leaves the machine until you run bundle. Set false for sensitive workspaces. Shared across collaborators."}).default(!0),maxBytes:z().register(Q,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Maximum size, in bytes, of the local loss-capture file before it rotates (default ~12 MB).`}).default($l)}).default({enabled:!0,maxBytes:$l}),bridge:U({backgroundThrottle:U({enabled:B().register(Q,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Keep the desktop window's timers running at full rate while it holds unsynced work, so backgrounding the app never starves sync or recovery; when the window is idle the OS-default background throttling is restored (battery). Honored by the desktop app. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0}),deferGuard:U({enabled:B().register(Q,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Defer a drain-shaped Observer B re-derive when the WYSIWYG fragment holds an un-propagated keystroke Y.Text lacks, so the keystroke survives instead of being stomped. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0}),lossDetector:U({enabled:B().register(Q,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Detect content the bridge silently dropped at its reconciliation boundary (an Observer-A apply arm or a paired agent-undo derive) and write a recovery checkpoint plus a content-free loss event. Detection only — never blocks a write. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0}),fixedPoint:U({enabled:B().register(Q,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Bound the Y.Text→WYSIWYG re-derive loop with a drain-count backstop: a run of re-derive drains that never reaches a raw-byte fixed point freezes the re-derive loop and writes a recovery checkpoint plus a content-free loss event, instead of churning unbounded. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0}),preDrain:U({enabled:B().register(Q,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Before an agent write or undo rebuilds the WYSIWYG fragment, flush an un-propagated keystroke that provably does not overlap the operation into Y.Text so the keystroke survives instead of needing recovery; overlapping or unmodellable cases fall back to the checkpoint floor. Scope: appending writes and single-frame undos — a write that replaces the whole body (replace / edit) overwrites the keystroke either way, so those always take the checkpoint floor. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0}),flushOnHide:U({enabled:B().register(Q,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`On tab hide/unload, force-send each doc's unsynced work to the server and commit its local cache, and re-sync on return to foreground, so a backgrounded tab never strands edits that IndexedDB alone would lose on recycle. Honored client-side. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0})}).default({backgroundThrottle:{enabled:!0},deferGuard:{enabled:!0},lossDetector:{enabled:!0},fixedPoint:{enabled:!0},preDrain:{enabled:!0},flushOnHide:{enabled:!0}}),search:U({semantic:U({enabled:B().register(Q,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:"Add semantic (embeddings) ranking to the MCP search tool, fused with the lexical engine so conceptually-related pages surface even with no shared keywords. When ON and an API key is set (`ok embeddings set-key`), the search query and matching document content are sent to the configured embeddings provider — content egress. Default OFF. Per-machine (project-local) — not shared with collaborators."}).default(!1),baseUrl:L().register(Q,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:"Base URL of the OpenAI-compatible embeddings API (default https://api.openai.com/v1). Override to point at a self-hosted server (Ollama / vLLM / LM Studio) or another provider. The API key is NOT stored here — set it with `ok embeddings set-key` (`~/.ok/secrets.yml`); it is sent to whichever endpoint this names."}).default(eu),model:L().register(Q,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Embeddings model id (default text-embedding-3-small). Must be served by the provider at baseUrl. Changing it re-embeds the corpus (the cache is keyed by provider + model + dimensions).`}).default(tu),dimensions:z().int().positive().register(Q,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Optional output vector dimensions. Omit (recommended) to detect the model's native size from its first response — that is what lets a non-OpenAI model work without knowing its size up front. Set a smaller value (text-embedding-3 supports e.g. 512 / 1024) to shrink the on-disk cache, trading a little retrieval quality; a server that ignores the request param then fails loudly instead of silently. Changing it re-embeds the corpus.`}).optional(),similarityFloor:z().min(0).max(1).register(Q,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Optional hard cutoff: drop any "by meaning" match whose cosine similarity is below this value. Off by default (0) because retrieval is rank-based (the closest pages are returned regardless of absolute score) and the right cutoff is model-specific. Set it only to suppress weak matches for a specific provider/model whose cosine scale you know. Most setups should leave it unset and rely on the result-count cap.`}).optional()}).default({enabled:!1,baseUrl:eu,model:tu})}).default({semantic:{enabled:!1,baseUrl:eu,model:tu}}),contentRules:U({markdownlint:H({enabled:B().register(Q,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether the markdownlint plugin (body rules) contributes diagnostics.`}).default(!1)}).default({enabled:!1}),frontmatter:H({enabled:B().register(Q,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether the frontmatter plugin (JSON-Schema validation of document frontmatter) contributes diagnostics.`}).default(!1),schemas:V(H({appliesTo:W([L(),V(L())]).optional(),file:L(),enabled:B().optional()})).register(Q,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Frontmatter schema mappings: which docs (appliesTo globs) validate against which JSON Schema file (project-root-relative path).`}).default([])}).default({enabled:!1,schemas:[]}),okf:H({enabled:B().register(Q,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether the OKF plugin (Open Knowledge Format portability + conformance rules) contributes diagnostics. Advisory warnings; never blocks a write.`}).default(!1),rules:mo(L(),B()).register(Q,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Per-rule opt-outs for the OKF plugin, keyed by rule id (e.g. no-wiki-links). Omit a rule to leave it enabled; set false to silence it while keeping the plugin on.`}).optional(),generate:H({index:B().register(Q,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether OK generates and maintains a navigation index.md in every folder that contains Markdown, each listing the documents in that folder grouped by frontmatter type and linking to its subfolders. OK owns these files: edits to them are replaced on the next rebuild.`}).default(!1)}).default({index:!1})}).default({enabled:!1,generate:{index:!1}})}).default({markdownlint:{enabled:!1},frontmatter:{enabled:!1,schemas:[]},okf:{enabled:!1,generate:{index:!1}}}),validation:U({links:G(al).register(Q,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`How broken internal links are reported on the validation plane: 'off' hides them, 'warning' (default) or 'error' sets their severity.`}).default(ol),fileTreeIndicators:B().register(Q,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether the file tree tints and badges files that have validation problems.`}).default(!0)}).default({links:ol,fileTreeIndicators:!0}),linkPreviews:U({enabled:B().register(Q,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Show a rich preview card (site name, page title, description, favicon) when you hover an external link in the editor. When ON, hovering an external link sends that link's URL to the destination site to fetch its preview metadata — outbound egress, one request per previewed link. Default ON; set to false to turn external previews off. Per-machine (project-local) — not shared with collaborators. Previews of links to other documents in this project are read from the local index with no network request and are always on.`}).default(!0)}).default({enabled:!0}),server:U({port:z().int().min(1).max(65535).register(Q,{scope:`project`,agentSettable:!1,reload:`boot`,defaultScope:`project`,description:`TCP port the server listens on. Unset by default: a local start picks a free port dynamically, and deployment platforms inject the PORT environment variable instead. Read at server start; changing it requires a restart.`}).optional(),bind:V(L().min(1)).min(1).register(Q,{scope:`project-local`,agentSettable:!1,reload:`boot`,defaultScope:`project-local`,description:`Addresses the server binds, e.g. [127.0.0.1] or [0.0.0.0]. Default loopback-only ([127.0.0.1]): nothing off this machine can connect. A non-loopback bind additionally requires the server.allowExternal consent interlock. Per-machine (project-local): a value committed to .ok/config.yml is ignored, so one machine exposing the server can never break local clones for the rest of the team — the exposing host sets it via OK_BIND, --bind, or .ok/local/config.yml. Lists replace, never merge. Read at server start; changing it requires a restart.`}).default([...nu]),externalUrl:ja({protocol:/^https?$/}).regex(iu).register(Q,{scope:`project`,agentSettable:!1,reload:`boot`,defaultScope:`project`,description:`Canonical external origin the server is reached at, e.g. https://kb.example.com — its host joins the Host/Origin allowlists (external-Host + CORS admission). Unset by default: the server admits only loopback Hosts. Setting it declares external exposure, which additionally requires the server.allowExternal consent interlock. Read at server start; changing it requires a restart.`}).optional(),allowExternal:B().register(Q,{scope:`project-local`,agentSettable:!1,reload:`boot`,defaultScope:`project-local`,description:`Exposure consent interlock. Once the unified server boot lands, a non-loopback server.bind or a server.externalUrl without allowExternal: true will be refused at boot with a one-line fix. Default off. Per-machine (project-local) — consent never travels via git, clone, or share; containers consent via the environment instead.`}).default(!1),openBrowser:B().register(Q,{scope:`project-local`,agentSettable:!1,reload:`boot`,defaultScope:`project-local`,description:`Open the UI in a browser when the server starts. Default derived: true when every bind address is loopback (a laptop start pops the UI), false otherwise (a container or exposed bind is headless and must never try). Acts once at start. Per-machine (project-local) — not shared.`}).optional(),idleShutdown:W([K(`off`),L().regex(ru)]).register(Q,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Shut the server down after this long with no activity: a duration like '30m' (positive integer with unit s, m, or h), or 'off'. Default derived: '30m' for a loopback-only, unexposed server; 'off' otherwise — a non-loopback bind, or a loopback bind declared externally reachable (server.allowExternal + server.externalUrl), stays up, because a remote agent keeps it busy over /mcp, which the idle timer does not count. Residual case the derivation cannot see: a loopback server reached by remote agents with no server.externalUrl (e.g. behind a same-box reverse proxy) still idles at 30m — set 'off' by hand. Reloadable — a valid change applies without a restart. Per-machine (project-local) — not shared.`}).optional()}).default({bind:[...nu],allowExternal:!1})});r();const uu=`open-knowledge-config`;async function du(e,t,r){let a=i.getTracer(uu),o=t?{attributes:t}:{};return a.startActiveSpan(e,o,async e=>{try{return await r(e)}catch(t){throw e.recordException(t),e.setStatus({code:n.ERROR,message:t instanceof Error?t.message:String(t)}),t}finally{e.end()}})}function fu(e,t,r){let a=i.getTracer(uu),o=t?{attributes:t}:{};return a.startActiveSpan(e,o,e=>{try{return r(e)}catch(t){throw e.recordException(t),e.setStatus({code:n.ERROR,message:t instanceof Error?t.message:String(t)}),t}finally{e.end()}})}function pu(e,t){let n=i.getActiveSpan();n&&n.addEvent(e,t)}function mu(e){let t=e;for(let e=0;e<16;e++){if(t==null||t?._zod?.def?.shape!==void 0)return t;let e=t?._zod?.def?.innerType;if(e===void 0)return t;t=e}return t}function hu(e,t){let n=e;for(let e of t){n=mu(n);let t=n?._zod?.def?.shape;if(!t||(n=t[String(e)],n===void 0))return}return n}function gu(e,t){let n=hu(e,t);if(n!==void 0)return Kl(n)}function _u(e,t){return e===`either`?!0:e===t}function vu(e,t){let n=null;function r(e,i){if(n!==null||e===void 0)return;if(typeof e==`object`&&e&&!Array.isArray(e)){for(let[t,a]of Object.entries(e))if(r(a,[...i,t]),n!==null)return;return}let a=gu(lu,i);a?.scope!==void 0&&(_u(a.scope,t)||(n={code:`SCOPE_VIOLATION`,path:i,expectedScope:a.scope,actualScope:t}))}for(let[t,i]of Object.entries(e))if(r(i,[t]),n!==null)break;return n}function yu(e,t){for(let n=1;n<t.length;n++){let r=t.slice(0,n);e.hasIn(r)&&((0,cl.isCollection)(e.getIn(r,!0))||e.deleteIn(r))}}function bu(e,t){let n=[];function r(t,i){if(t!==void 0){if(t===null){e.deleteIn(i),n.push(i.join(`.`));return}if(Array.isArray(t)){yu(e,i),e.setIn(i,t),n.push(i.join(`.`));return}if(typeof t==`object`){for(let[e,n]of Object.entries(t))r(n,[...i,e]);return}yu(e,i),e.setIn(i,t),n.push(i.join(`.`))}}for(let[e,n]of Object.entries(t))r(n,[e]);return n}function xu(e){return{path:e.path.map(e=>typeof e==`symbol`?String(e):e),message:e.message,issueCode:e.code}}function Su(e,t){if(t.length===0)return e.contents??null;let n=e.getIn(t,!0);if((0,cl.isNode)(n))return n;for(let n=t.length-1;n>=0;n--){let r=e.getIn(t.slice(0,n),!0);if((0,cl.isNode)(r))return r}return e.contents??null}function Cu(e,t){let n=1,r=1,i=Math.min(t,e.length);for(let t=0;t<i;t++)e.charCodeAt(t)===10?(n++,r=1):r++;return{line:n,column:r}}function wu(e,t,n,r,i){let a=e.split(`
|
|
180
|
+
`)}\n`}function Sl(e){let t;try{t=(0,cl.parse)(e,{schema:`failsafe`})}catch(e){let t=e?.linePos;return{ok:!1,error:{kind:`unparseable`,line:typeof t?.[0]?.line==`number`?t[0].line:void 0}}}if(!t||typeof t!=`object`||Array.isArray(t))return{ok:!1,error:{kind:`not-a-scheme`}};let n=t,r=n.palette,i=r&&typeof r==`object`&&!Array.isArray(r)?r:n,a={},o=[],s=[];for(let e of ll){let t=i[e]??i[e.toLowerCase()];if(t==null){o.push(e);continue}let n=Cl(t);if(!n){s.push(e);continue}a[e]=n}return o.length?{ok:!1,error:{kind:`missing-slots`,slots:o}}:s.length?{ok:!1,error:{kind:`bad-hex`,slots:s}}:typeof n.name==`string`&&!pl(n.name)||typeof n.author==`string`&&!pl(n.author)?{ok:!1,error:{kind:`not-a-scheme`}}:{ok:!0,scheme:{name:typeof n.name==`string`?n.name:`Imported`,author:typeof n.author==`string`?n.author:void 0,variant:n.variant===`light`||n.variant===`dark`?n.variant:Tl(a),palette:a}}}function Cl(e){if(typeof e!=`string`)return null;let t=e.trim();return t.startsWith(`#`)||(t=`#${t}`),/^#[0-9a-fA-F]{3}$/.test(t)&&(t=`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}`),dl.test(t)?t.toLowerCase():null}function wl(e){let t=ml(e)?e:`#000000`,n=e=>{let n=Number.parseInt(t.slice(1+e*2,3+e*2),16)/255;return n<=.03928?n/12.92:((n+.055)/1.055)**2.4};return .2126*n(0)+.7152*n(1)+.0722*n(2)}function Tl(e){return wl(e.base00)<wl(e.base05)?`dark`:`light`}const El={name:`Dracula`,author:`clach04 (https://github.com/clach04)`,variant:`dark`,palette:{base00:`#282a36`,base01:`#21222c`,base02:`#44475a`,base03:`#6272a4`,base04:`#9ea8c7`,base05:`#f8f8f2`,base06:`#f8f8f2`,base07:`#ffffff`,base08:`#ff5555`,base09:`#ffb86c`,base0A:`#f1fa8c`,base0B:`#50fa7b`,base0C:`#8be9fd`,base0D:`#bd93f9`,base0E:`#ff79c6`,base0F:`#993333`}},Dl={name:`Catppuccin Frappé`,author:`https://github.com/catppuccin/catppuccin`,variant:`dark`,palette:{base00:`#303446`,base01:`#292c3c`,base02:`#414559`,base03:`#51576d`,base04:`#626880`,base05:`#c6d0f5`,base06:`#f2d5cf`,base07:`#babbf1`,base08:`#e78284`,base09:`#ef9f76`,base0A:`#e5c890`,base0B:`#a6d189`,base0C:`#81c8be`,base0D:`#8caaee`,base0E:`#ca9ee6`,base0F:`#eebebe`}},Ol={name:`Catppuccin Latte`,author:`https://github.com/catppuccin/catppuccin`,variant:`light`,palette:{base00:`#eff1f5`,base01:`#e6e9ef`,base02:`#ccd0da`,base03:`#bcc0cc`,base04:`#acb0be`,base05:`#4c4f69`,base06:`#dc8a78`,base07:`#7287fd`,base08:`#d20f39`,base09:`#fe640b`,base0A:`#df8e1d`,base0B:`#40a02b`,base0C:`#179299`,base0D:`#1d62ec`,base0E:`#8839ef`,base0F:`#dd7878`}},kl={name:`Monokai`,author:`Wimer Hazenberg (http://www.monokai.nl)`,variant:`dark`,palette:{base00:`#272822`,base01:`#383830`,base02:`#49483e`,base03:`#75715e`,base04:`#a59f85`,base05:`#f8f8f2`,base06:`#f5f4f1`,base07:`#f9f8f5`,base08:`#f92672`,base09:`#fd971f`,base0A:`#f4bf75`,base0B:`#a6e22e`,base0C:`#a1efe4`,base0D:`#66d9ef`,base0E:`#ae81ff`,base0F:`#cc6633`}},Al={name:`Gruvbox dark, medium`,author:`Dawid Kurek, morhetz (https://github.com/morhetz/gruvbox)`,variant:`dark`,palette:{base00:`#282828`,base01:`#3c3836`,base02:`#504945`,base03:`#665c54`,base04:`#bdae93`,base05:`#d5c4a1`,base06:`#ebdbb2`,base07:`#fbf1c7`,base08:`#fb4934`,base09:`#fe8019`,base0A:`#fabd2f`,base0B:`#b8bb26`,base0C:`#8ec07c`,base0D:`#83a598`,base0E:`#d3869b`,base0F:`#d65d0e`}},jl={name:`Solarized Dark`,author:`Ethan Schoonover (modified by aramisgithub)`,variant:`dark`,palette:{base00:`#002b36`,base01:`#073642`,base02:`#586e75`,base03:`#657b83`,base04:`#839496`,base05:`#93a1a1`,base06:`#eee8d5`,base07:`#fdf6e3`,base08:`#dc322f`,base09:`#cb4b16`,base0A:`#b58900`,base0B:`#859900`,base0C:`#2aa198`,base0D:`#2995e1`,base0E:`#6c71c4`,base0F:`#d33682`}};function Ml(e,t,n){return{id:e,label:t,kind:n.variant,scheme:n,toTokens:()=>hl(n)}}function Nl(e,t){return{id:e,label:t,kind:`system`}}const Pl=[Nl(`default`,`Default`),Ml(`dracula`,`Dracula`,El),Ml(`catppuccin-frappe`,`Catppuccin Frappé`,Dl),Ml(`catppuccin-latte`,`Catppuccin Latte`,Ol),Ml(`monokai`,`Monokai`,kl),Ml(`gruvbox`,`Gruvbox`,Al),Ml(`solarized`,`Solarized`,jl),Nl(`custom`,`Custom`)],Fl=Pl.map(e=>e.id),Il=/^[a-z0-9-]{1,32}$/,Ll=/\p{M}+/gu,Rl=/['\u2019\u02bc]+/gu,zl=/[^a-z0-9]+/g;function Bl(e){let t=2166136261;for(let n of e)t^=n.codePointAt(0)??0,t=Math.imul(t,16777619);return(t>>>0).toString(16).padStart(8,`0`)}function Vl(e){let t=e.trim();if(t.length===0)return{ok:!1,code:`empty`};let n=t.normalize(`NFKD`).replace(Ll,``).toLowerCase().replace(Rl,``).replace(zl,`-`).replace(/^-+|-+$/g,``),r=Bl(t),i=n.length===0?`theme-${r}`:n.length<=26?n:`${n.slice(0,26-r.length-1).replace(/-+$/g,``)}-${r}`,a=Hl(i);if(!a.ok)throw Error(`Saved theme name derivation produced an invalid id`);return{ok:!0,name:t,stem:i,id:a.id}}function Hl(e){if(e.length===0)return{ok:!1,code:`empty`};let t=`saved-`+e;return Il.test(t)?{ok:!0,id:t}:{ok:!1,code:/^[a-z0-9-]+$/.test(t)?`too-long`:`invalid-chars`}}function Ul(e){if(!Il.test(e)||!e.startsWith(`saved-`))return{ok:!1};let t=e.slice(6);return t.length===0?{ok:!1}:{ok:!0,stem:t}}new Map(Pl.map(e=>[e.id,e]));const Wl=Symbol.for(`@inkeep/open-knowledge/field-registry`),Gl=globalThis;Gl[Wl]===void 0&&(Gl[Wl]=tr());const Q=Gl[Wl];function Kl(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=ql(t)?Q.get(t):void 0;if(e!==void 0)return e;let n=t._zod?.def?.innerType;if(n===void 0)return;t=n}}function ql(e){return typeof e==`object`&&!!e&&`_zod`in e&&`parse`in e}function Jl(){return Object.fromEntries(ll.map(e=>[e,L().register(Q,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Custom theme: base16 ${e} — ${ul[e]}, as a #rrggbb hex string.`}).optional()]))}function Yl(){return Fl.filter(e=>e!==`default`&&e!==`custom`).map(e=>`'${e}'`).join(`, `)}const Xl=Object.freeze([`authorization`,`auth.token`,`auth.bearer`,`cookie`,`set-cookie`,`x-api-key`,`password`,`secret`]),Zl=52428800,Ql=26214400,$l=12582912,eu=`https://api.openai.com/v1`,tu=`text-embedding-3-small`,nu=Object.freeze([`127.0.0.1`]),ru=/^[1-9]\d*(s|m|h)$/,iu=/^https?:\/\//;function au(e){let t;try{t=new URL(e)}catch{return!1}let n=t.hostname.toLowerCase();return n===`localhost`||n===`127.0.0.1`||n===`[::1]`}function ou(e){let t;try{t=new URL(e)}catch{return`invalid-url`}return t.protocol===`https:`||t.protocol===`http:`&&au(e)?null:`insecure-scheme`}function su(e){let t=e.trim();return t===``?`./`:t}function cu(e){let t=su(e);return t.includes(`\0`)||t.includes(`\\`)?!1:t===`/`?!0:!(t.startsWith(`/`)||/^[A-Za-z]:/.test(t)||t.split(`/`).some(e=>e===`..`))}const lu=U({content:U({dir:L().register(Q,{scope:`project`,agentSettable:!1,reload:`boot`,defaultScope:`project`,description:`Folder OpenKnowledge reads and writes documents under, relative to the project root (the folder that contains .ok/). Defaults to the project root. Exclude paths with .okignore. Read at server start; changing it requires a restart.`}).default(`.`),attachmentFolderPath:L().register(Q,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Where pasted and dropped assets are stored, relative to the content root. './' colocates beside the current document (default); '/' targets the content root; './subdir' targets a subfolder under the current document folder; 'folder' targets a fixed folder under the content root. Whitespace-only values are treated as './'.`}).refine(cu,{message:`Invalid attachment folder path: must not contain '..' segments, NUL bytes, backslashes, or OS absolute paths (use '/' for the content root).`}).default(`./`)}).default({dir:`.`,attachmentFolderPath:`./`}),appearance:U({theme:G([`light`,`dark`,`system`]).register(Q,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Editor color theme: 'light', 'dark', or 'system' (follow the OS). A personal preference (user scope) — not shared with the project.`}).optional(),language:G([`system`,...el]).register(Q,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Interface language. 'system' follows the operating system. A personal preference (user scope) — not shared with the project, and never applied to document content.`}).optional(),colorThemeLight:L().register(Q,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`IDE color palette applied in light mode: 'default' (no palette), 'custom' (your own colors from appearance.customTheme), one of ${Yl()}, or the id of a saved theme. A short id of lowercase letters, digits, and hyphens (max 32 characters); an id no palette matches falls back to 'default' for this mode only, leaving the rest of your config untouched. A personal preference (user scope) — not shared with the project.`}).regex(Il,{message:`Theme id must be lowercase letters, digits, and hyphens, 1–32 characters (e.g. 'dracula', 'custom', or a saved theme id).`}).optional(),colorThemeDark:L().register(Q,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`IDE color palette applied in dark mode: 'default' (no palette), 'custom' (your own colors from appearance.customTheme), one of ${Yl()}, or the id of a saved theme. A short id of lowercase letters, digits, and hyphens (max 32 characters); an id no palette matches falls back to 'default' for this mode only, leaving the rest of your config untouched. A personal preference (user scope) — not shared with the project.`}).regex(Il,{message:`Theme id must be lowercase letters, digits, and hyphens, 1–32 characters (e.g. 'dracula', 'custom', or a saved theme id).`}).optional(),colorTheme:L().register(Q,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Superseded by appearance.colorThemeLight / appearance.colorThemeDark. Read as the palette for both modes while neither of those is set. A short theme id (lowercase letters, digits, and hyphens; max 32 characters); an id no palette matches falls back to 'default'. A personal preference (user scope) — not shared with the project.`}).regex(Il,{message:`Theme id must be lowercase letters, digits, and hyphens, 1–32 characters (e.g. 'dracula', 'custom', or a saved theme id).`}).optional(),colorThemeEnabled:B().register(Q,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Whether the Themes plugin appears in Settings → Plugins. A personal preference (user scope). Default on.`}).optional(),customTheme:U({name:L().register(Q,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Custom theme: the scheme's display name.`}).optional(),author:L().register(Q,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Custom theme: the scheme's author credit, carried through from an imported base16 scheme.`}).optional(),variant:G([`dark`,`light`]).register(Q,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Custom theme: whether the scheme is 'dark' or 'light'. Auto-detected from the palette when omitted.`}).optional(),...Jl()}).optional(),preview:U({autoOpen:B().register(Q,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`When on, the agent opens or refreshes the live preview after each edit. Turn off if you manage your own preview window. A personal preference (user scope).`}).default(!0)}).default({autoOpen:!0}),sidebar:U({showHiddenFiles:B().register(Q,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Show dot-prefixed entries (e.g. .ok/, .okignore) in the file tree. Per-machine (project-local) — not shared with collaborators.`}).default(!1),showOnlyMarkdownFiles:B().register(Q,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Show only markdown documents (.md/.mdx) and folders in the file tree, hiding other file types from view. View-only: hidden files stay on disk and remain reachable via links and search. Per-machine (project-local) — not shared with collaborators.`}).default(!1),showSkillsSection:B().register(Q,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Show the Skills section in the sidebar. Skill documents remain reachable via links and search while the section is hidden. Per-machine (project-local) — not shared with collaborators.`}).default(!0),showOkFolders:B().register(Q,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Show .ok folders (skills, templates, and other OpenKnowledge-managed state) in the file tree as read-only entries. .ok/worktrees and .ok/local never appear. Per-machine (project-local) — not shared with collaborators.`}).default(!1),showSkillGroups:B().register(Q,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Group skills in the sidebar by where they came from — the publisher they were imported from, or the plugin that ships them. Skills you authored stay ungrouped at the top of their scope. Per-machine (project-local) — not shared with collaborators.`}).default(!0),pinnedProjectSkills:V(L()).register(Q,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Project-scope skills pinned to the top of the Skills sidebar, by name. A pinned skill also keeps its normal row, so a provenance group still lists everything from its source. Per-machine (project-local) — not shared with collaborators.`}).default([]),pinnedGlobalSkills:V(L()).register(Q,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Global-scope skills pinned to the top of the Skills sidebar, by name. Stored per USER rather than per project, so a pinned global skill follows you into every project.`}).default([])}).optional()}).default({preview:{autoOpen:!0}}),editor:U({wordWrap:B().register(Q,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Soft-wrap long lines in the source (CodeMirror) editor. A personal preference (user scope).`}).default(!0),previewTabs:B().register(Q,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Reuse one tab when clicking through the Files and Skills sidebars, the way an editor preview tab works. Turn off to open every click in its own tab. Pinned tabs keep their own tab either way. A personal preference (user scope).`}).default(!0)}).default({wordWrap:!0,previewTabs:!0}),agents:U({autoApproveOkTools:B().register(Q,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:"Auto-approve OpenKnowledge's own tools (and `ok open` on Claude) for agents launched from the built-in terminal. Destructive tools (delete/move/share/install) still prompt. Per-machine personal preference (user scope)."}).default(!0)}).default({autoApproveOkTools:!0}),autoSync:U({mode:G(qo).register(Q,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`What this machine syncs on a schedule for this project: 'off' (Manual — nothing scheduled; the manual pull/push actions still work), 'follow' (Auto, pull only — scheduled pulls, never a scheduled push; 'pull' is accepted as a legacy alias), or 'full' (Auto, pull and push — bidirectional). Explicit user-triggered pushes work in every mode. null = not chosen yet (onboarding asks). Per-machine (project-local) — not shared. Supersedes the legacy autoSync.enabled boolean.`}).nullable().default(null),enabled:B().register(Q,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Legacy per-machine sync toggle, superseded by autoSync.mode. Read only when mode is absent (true = full, false = off). null = not chosen yet. Per-machine (project-local) — not shared.`}).nullable().default(null),resumeMode:G(Jo).register(Q,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`When sync is paused (autoSync.mode 'off') after having been enabled, the active mode to resume into ('follow' | 'full'). Per-machine UI memory; ignored while a mode is active. Not shared.`}).optional(),pullIntervalSeconds:z().int().min(30).max(es).register(Q,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Seconds between scheduled pulls while autoSync.mode is follow or full (default 30). An unauthenticated follower is additionally floored to the anonymous poll minimum, so a lower value there has no effect. Per-machine (project-local) — not shared.`}).optional().catch(void 0),pushIntervalSeconds:z().int().min(30).max(es).register(Q,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Seconds between scheduled pushes while autoSync.mode is full (default 60). Ignored in every other mode, which never pushes on a schedule. Each cycle with pending edits authors a commit, so a shorter interval means more, smaller commits in the repo's shared history. Per-machine (project-local) — not shared.`}).optional().catch(void 0),default:W([B(),G(qo)]).register(Q,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Committed project default for a machine's sync mode on first open: 'off' | 'follow' | 'full', or the legacy boolean (true = full, false = off). null = ask (show the onboarding prompt). Shared via git. A per-machine autoSync.mode choice overrides it.`}).nullable().default(null)}).default({mode:null,enabled:null,default:null}),terminal:U({enabled:B().register(Q,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Opt-out for the in-app terminal (a real OS shell at full user privilege). The terminal is on by default; set false to disable it for this project on this machine. Per-machine (project-local) — never shared via git, clone, or sync.`}).nullable().default(null),shell:L().register(Q,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Absolute Windows shell executable override for the in-app terminal. PowerShell, cmd.exe, and Git Bash support OpenKnowledge-managed launches (agent chat tabs and fixed commands such as Resolve in terminal or Install Slidev) and dropped-file path insertion. A different existing executable remains usable for plain terminal tabs and shows a capability notice; requested agent and command launches open only the plain shell without running the agent or command, and dropped-file paths are refused. Empty values use automatic shell discovery. Per-machine (project-local), human-managed, and never shared via git, clone, or sync.`}).optional()}).default({enabled:null}),slides:U({enabled:B().register(Q,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:"Whether the Slides plugin appears in Settings → Plugins. When on, a document whose frontmatter has `slides: true` offers an action that opens the deck in a dedicated window (desktop only, requires a resolvable slidev). A personal preference (user scope). Default off."}).default(!1)}).default({enabled:!1}),telemetry:U({localSink:U({enabled:B().register(Q,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:"Write local diagnostic spans + logs under .ok/local/ for `ok diagnose bundle`. Local-only — never leaves the machine until you run bundle. Set false for sensitive workspaces. Shared across collaborators."}).default(!0),spans:U({maxBytes:z().register(Q,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Maximum size, in bytes, of the local diagnostic spans file before it rotates (default ~50 MB).`}).default(Zl)}).default({maxBytes:Zl}),logs:U({maxBytes:z().register(Q,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Maximum size, in bytes, of the local diagnostic logs file before it rotates (default ~25 MB).`}).default(Ql)}).default({maxBytes:Ql}),attributeDenylist:V(L()).register(Q,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Telemetry attribute keys whose values are redacted before any local span/log is written (credential / secret guard). Extends the built-in denylist.`}).default([...Xl])}).default({enabled:!0,spans:{maxBytes:Zl},logs:{maxBytes:Ql},attributeDenylist:[...Xl]}),skillInstallReports:U({enabled:B().register(Q,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Report skill installs to skills.sh so a published skill shows an accurate install count. Sends the skill name, its source repo, and which agent tools it was installed for — never file contents, and never for a private or local source. One report per skill per machine. Default on; the DO_NOT_TRACK and DISABLE_TELEMETRY environment variables also turn it off.`}).default(!0)}).default({enabled:!0})}).default({localSink:{enabled:!0,spans:{maxBytes:Zl},logs:{maxBytes:Ql},attributeDenylist:[...Xl]},skillInstallReports:{enabled:!0}}),lossCapture:U({enabled:B().register(Q,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:"Record bridge loss-class events (content-free) under .ok/local/loss-capture/ for `ok diagnose bundle`. Local-only — never leaves the machine until you run bundle. Set false for sensitive workspaces. Shared across collaborators."}).default(!0),maxBytes:z().register(Q,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Maximum size, in bytes, of the local loss-capture file before it rotates (default ~12 MB).`}).default($l)}).default({enabled:!0,maxBytes:$l}),bridge:U({backgroundThrottle:U({enabled:B().register(Q,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Keep the desktop window's timers running at full rate while it holds unsynced work, so backgrounding the app never starves sync or recovery; when the window is idle the OS-default background throttling is restored (battery). Honored by the desktop app. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0}),deferGuard:U({enabled:B().register(Q,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Defer a drain-shaped Observer B re-derive when the WYSIWYG fragment holds an un-propagated keystroke Y.Text lacks, so the keystroke survives instead of being stomped. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0}),lossDetector:U({enabled:B().register(Q,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Detect content the bridge silently dropped at its reconciliation boundary (an Observer-A apply arm or a paired agent-undo derive) and write a recovery checkpoint plus a content-free loss event. Detection only — never blocks a write. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0}),fixedPoint:U({enabled:B().register(Q,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Bound the Y.Text→WYSIWYG re-derive loop with a drain-count backstop: a run of re-derive drains that never reaches a raw-byte fixed point freezes the re-derive loop and writes a recovery checkpoint plus a content-free loss event, instead of churning unbounded. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0}),preDrain:U({enabled:B().register(Q,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Before an agent write or undo rebuilds the WYSIWYG fragment, flush an un-propagated keystroke that provably does not overlap the operation into Y.Text so the keystroke survives instead of needing recovery; overlapping or unmodellable cases fall back to the checkpoint floor. Scope: appending writes and single-frame undos — a write that replaces the whole body (replace / edit) overwrites the keystroke either way, so those always take the checkpoint floor. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0}),flushOnHide:U({enabled:B().register(Q,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`On tab hide/unload, force-send each doc's unsynced work to the server and commit its local cache, and re-sync on return to foreground, so a backgrounded tab never strands edits that IndexedDB alone would lose on recycle. Honored client-side. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0})}).default({backgroundThrottle:{enabled:!0},deferGuard:{enabled:!0},lossDetector:{enabled:!0},fixedPoint:{enabled:!0},preDrain:{enabled:!0},flushOnHide:{enabled:!0}}),search:U({semantic:U({enabled:B().register(Q,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:"Add semantic (embeddings) ranking to the MCP search tool, fused with the lexical engine so conceptually-related pages surface even with no shared keywords. When ON and an API key is set (`ok embeddings set-key`), the search query and matching document content are sent to the configured embeddings provider — content egress. Default OFF. Per-machine (project-local) — not shared with collaborators."}).default(!1),baseUrl:L().register(Q,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:"Base URL of the OpenAI-compatible embeddings API (default https://api.openai.com/v1). Override to point at a self-hosted server (Ollama / vLLM / LM Studio) or another provider. The API key is NOT stored here — set it with `ok embeddings set-key` (`~/.ok/secrets.yml`); it is sent to whichever endpoint this names."}).default(eu),model:L().register(Q,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Embeddings model id (default text-embedding-3-small). Must be served by the provider at baseUrl. Changing it re-embeds the corpus (the cache is keyed by provider + model + dimensions).`}).default(tu),dimensions:z().int().positive().register(Q,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Optional output vector dimensions. Omit (recommended) to detect the model's native size from its first response — that is what lets a non-OpenAI model work without knowing its size up front. Set a smaller value (text-embedding-3 supports e.g. 512 / 1024) to shrink the on-disk cache, trading a little retrieval quality; a server that ignores the request param then fails loudly instead of silently. Changing it re-embeds the corpus.`}).optional(),similarityFloor:z().min(0).max(1).register(Q,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Optional hard cutoff: drop any "by meaning" match whose cosine similarity is below this value. Off by default (0) because retrieval is rank-based (the closest pages are returned regardless of absolute score) and the right cutoff is model-specific. Set it only to suppress weak matches for a specific provider/model whose cosine scale you know. Most setups should leave it unset and rely on the result-count cap.`}).optional()}).default({enabled:!1,baseUrl:eu,model:tu})}).default({semantic:{enabled:!1,baseUrl:eu,model:tu}}),contentRules:U({markdownlint:H({enabled:B().register(Q,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether the markdownlint plugin (body rules) contributes diagnostics.`}).default(!1)}).default({enabled:!1}),frontmatter:H({enabled:B().register(Q,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether the frontmatter plugin (JSON-Schema validation of document frontmatter) contributes diagnostics.`}).default(!1),schemas:V(H({appliesTo:W([L(),V(L())]).optional(),file:L(),enabled:B().optional()})).register(Q,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Frontmatter schema mappings: which docs (appliesTo globs) validate against which JSON Schema file (project-root-relative path).`}).default([])}).default({enabled:!1,schemas:[]}),okf:H({enabled:B().register(Q,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether the OKF plugin (Open Knowledge Format portability + conformance rules) contributes diagnostics. Advisory warnings; never blocks a write.`}).default(!1),rules:mo(L(),B()).register(Q,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Per-rule opt-outs for the OKF plugin, keyed by rule id (e.g. no-wiki-links). Omit a rule to leave it enabled; set false to silence it while keeping the plugin on.`}).optional(),generate:H({index:B().register(Q,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether OK generates and maintains a navigation index.md in every folder that contains Markdown, each listing the documents in that folder grouped by frontmatter type and linking to its subfolders. OK owns these files: edits to them are replaced on the next rebuild.`}).default(!1)}).default({index:!1})}).default({enabled:!1,generate:{index:!1}})}).default({markdownlint:{enabled:!1},frontmatter:{enabled:!1,schemas:[]},okf:{enabled:!1,generate:{index:!1}}}),validation:U({links:G(al).register(Q,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`How broken internal links are reported on the validation plane: 'off' hides them, 'warning' (default) or 'error' sets their severity.`}).default(ol),fileTreeIndicators:B().register(Q,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether the file tree tints and badges files that have validation problems.`}).default(!0)}).default({links:ol,fileTreeIndicators:!0}),linkPreviews:U({enabled:B().register(Q,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Show a rich preview card (site name, page title, description, favicon) when you hover an external link in the editor. When ON, hovering an external link sends that link's URL to the destination site to fetch its preview metadata — outbound egress, one request per previewed link. Default ON; set to false to turn external previews off. Per-machine (project-local) — not shared with collaborators. Previews of links to other documents in this project are read from the local index with no network request and are always on.`}).default(!0)}).default({enabled:!0}),server:U({port:z().int().min(1).max(65535).register(Q,{scope:`project`,agentSettable:!1,reload:`boot`,defaultScope:`project`,description:`TCP port the server listens on. Unset by default: a local start picks a free port dynamically, and deployment platforms inject the PORT environment variable instead. Read at server start; changing it requires a restart.`}).optional(),bind:V(L().min(1)).min(1).register(Q,{scope:`project-local`,agentSettable:!1,reload:`boot`,defaultScope:`project-local`,description:`Addresses the server binds, e.g. [127.0.0.1] or [0.0.0.0]. Default loopback-only ([127.0.0.1]): nothing off this machine can connect. A non-loopback bind additionally requires the server.allowExternal consent interlock. Per-machine (project-local): a value committed to .ok/config.yml is ignored, so one machine exposing the server can never break local clones for the rest of the team — the exposing host sets it via OK_BIND, --bind, or .ok/local/config.yml. Lists replace, never merge. Read at server start; changing it requires a restart.`}).default([...nu]),externalUrl:ja({protocol:/^https?$/}).regex(iu).register(Q,{scope:`project`,agentSettable:!1,reload:`boot`,defaultScope:`project`,description:`Canonical external origin the server is reached at, e.g. https://kb.example.com — its host joins the Host/Origin allowlists (external-Host + CORS admission). Unset by default: the server admits only loopback Hosts. Setting it declares external exposure, which additionally requires the server.allowExternal consent interlock. Read at server start; changing it requires a restart.`}).optional(),allowExternal:B().register(Q,{scope:`project-local`,agentSettable:!1,reload:`boot`,defaultScope:`project-local`,description:`Exposure consent interlock. Once the unified server boot lands, a non-loopback server.bind or a server.externalUrl without allowExternal: true will be refused at boot with a one-line fix. Default off. Per-machine (project-local) — consent never travels via git, clone, or share; containers consent via the environment instead.`}).default(!1),openBrowser:B().register(Q,{scope:`project-local`,agentSettable:!1,reload:`boot`,defaultScope:`project-local`,description:`Open the UI in a browser when the server starts. Default derived: true when every bind address is loopback (a laptop start pops the UI), false otherwise (a container or exposed bind is headless and must never try). Acts once at start. Per-machine (project-local) — not shared.`}).optional(),idleShutdown:W([K(`off`),L().regex(ru)]).register(Q,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Shut the server down after this long with no activity: a duration like '30m' (positive integer with unit s, m, or h), or 'off'. Default derived: '30m' for a loopback-only, unexposed server; 'off' otherwise — a non-loopback bind, or a loopback bind declared externally reachable (server.allowExternal + server.externalUrl), stays up, because a remote agent keeps it busy over /mcp, which the idle timer does not count. Residual case the derivation cannot see: a loopback server reached by remote agents with no server.externalUrl (e.g. behind a same-box reverse proxy) still idles at 30m — set 'off' by hand. Reloadable — a valid change applies without a restart. Per-machine (project-local) — not shared.`}).optional()}).default({bind:[...nu],allowExternal:!1})});r();const uu=`open-knowledge-config`;async function du(e,t,r){let a=i.getTracer(uu),o=t?{attributes:t}:{};return a.startActiveSpan(e,o,async e=>{try{return await r(e)}catch(t){throw e.recordException(t),e.setStatus({code:n.ERROR,message:t instanceof Error?t.message:String(t)}),t}finally{e.end()}})}function fu(e,t,r){let a=i.getTracer(uu),o=t?{attributes:t}:{};return a.startActiveSpan(e,o,e=>{try{return r(e)}catch(t){throw e.recordException(t),e.setStatus({code:n.ERROR,message:t instanceof Error?t.message:String(t)}),t}finally{e.end()}})}function pu(e,t){let n=i.getActiveSpan();n&&n.addEvent(e,t)}function mu(e){let t=e;for(let e=0;e<16;e++){if(t==null||t?._zod?.def?.shape!==void 0)return t;let e=t?._zod?.def?.innerType;if(e===void 0)return t;t=e}return t}function hu(e,t){let n=e;for(let e of t){n=mu(n);let t=n?._zod?.def?.shape;if(!t||(n=t[String(e)],n===void 0))return}return n}function gu(e,t){let n=hu(e,t);if(n!==void 0)return Kl(n)}function _u(e,t){return e===`either`?!0:e===t}function vu(e,t){let n=null;function r(e,i){if(n!==null||e===void 0)return;if(typeof e==`object`&&e&&!Array.isArray(e)){for(let[t,a]of Object.entries(e))if(r(a,[...i,t]),n!==null)return;return}let a=gu(lu,i);a?.scope!==void 0&&(_u(a.scope,t)||(n={code:`SCOPE_VIOLATION`,path:i,expectedScope:a.scope,actualScope:t}))}for(let[t,i]of Object.entries(e))if(r(i,[t]),n!==null)break;return n}function yu(e,t){for(let n=1;n<t.length;n++){let r=t.slice(0,n);e.hasIn(r)&&((0,cl.isCollection)(e.getIn(r,!0))||e.deleteIn(r))}}function bu(e,t){let n=[];function r(t,i){if(t!==void 0){if(t===null){e.deleteIn(i),n.push(i.join(`.`));return}if(Array.isArray(t)){yu(e,i),e.setIn(i,t),n.push(i.join(`.`));return}if(typeof t==`object`){for(let[e,n]of Object.entries(t))r(n,[...i,e]);return}yu(e,i),e.setIn(i,t),n.push(i.join(`.`))}}for(let[e,n]of Object.entries(t))r(n,[e]);return n}function xu(e){return{path:e.path.map(e=>typeof e==`symbol`?String(e):e),message:e.message,issueCode:e.code}}function Su(e,t){if(t.length===0)return e.contents??null;let n=e.getIn(t,!0);if((0,cl.isNode)(n))return n;for(let n=t.length-1;n>=0;n--){let r=e.getIn(t.slice(0,n),!0);if((0,cl.isNode)(r))return r}return e.contents??null}function Cu(e,t){let n=1,r=1,i=Math.min(t,e.length);for(let t=0;t<i;t++)e.charCodeAt(t)===10?(n++,r=1):r++;return{line:n,column:r}}function wu(e,t,n,r,i){let a=e.split(`
|
|
181
181
|
`),o=r-1;if(o<0||o>=a.length)return``;let s=a[o]??``,c=t-(i-1)+s.length,l=Math.max(1,Math.min(n,c)-t),u=[],d=String(o+2).length;for(let e=Math.max(0,o-1);e<=Math.min(a.length-1,o+1);e++){let t=e===o,n=t?`>`:` `,r=String(e+1).padStart(d,` `);if(u.push(`${n} ${r} | ${a[e]??``}`),t){let e=` `.repeat(2+d+3+i-1);u.push(`${e}${`^`.repeat(l)}`)}}return u.join(`
|
|
182
182
|
`)}function Tu(e){let t=Su(e.doc,e.path);if(!t)return;let n=t.range;if(!n)return;let[r,,i=r]=n,{line:a,column:o}=Cu(e.source,r),s=(0,cl.isCollection)(t)?wu(e.source,r,r+1,a,o):wu(e.source,r,i,a,o);return{file:e.file,line:a,column:o,snippet:s.length>0?s:void 0}}const Eu=H({file:L(),line:z().int().min(1),column:z().int().min(1),snippet:L().optional()}),Du=H({path:V(W([L(),z()])),message:L(),issueCode:L(),params:mo(L(),no()).optional(),source:Eu.optional()}),Ou=G([`user`,`project`,`project-local`,`either`]),ku=G([`user`,`project`,`project-local`]),Au=H({code:K(`YAML_PARSE`),detail:L()}),ju=H({code:K(`UNREADABLE`),detail:L()}),Mu=H({code:K(`SCHEMA_INVALID`),issues:V(Du)}),Nu=H({code:K(`REMOVED_KEY`),path:V(L()),redirect:L(),source:Eu.optional()}),Pu=lo(`code`,[Au,Mu,ju,H({code:K(`SCOPE_VIOLATION`),path:V(L()),expectedScope:Ou,actualScope:ku}),H({code:K(`NOT_AGENT_SETTABLE`),path:V(L())}),H({code:K(`MIXED_SCOPE`),paths:V(H({path:V(L()),scope:ku}))}),Nu,H({code:K(`WRITE_ERROR`),detail:L()}),H({code:K(`OKIGNORE_INVALID`),detail:L(),lineNumber:z().int().min(1).optional()}),H({code:K(`UNKNOWN`),message:L().optional()})]);lo(`code`,[Nu,Au,Mu,ju]);const Fu=H({diagnostics:V(lo(`code`,[H({code:K(`REMOVED_KEY`),scope:ku,file:L(),path:V(L()),redirect:L()}),H({code:K(`YAML_PARSE`),scope:ku,file:L()}),H({code:K(`SCHEMA_INVALID`),scope:ku,file:L()}),H({code:K(`UNREADABLE`),scope:ku,file:L()})]))}),Iu=new Set(Pu.options.map(e=>e.shape.code.value)),Lu=W([Pu,U({code:L(),message:L().optional()})]);function Ru(e){return Iu.has(e.code)}function zu(e){switch(e){case`user`:return`~/.ok/global.yml`;case`project`:return`.ok/config.yml`;case`project-local`:return`.ok/local/config.yml`;case`either`:return`.ok/config.yml or ~/.ok/global.yml`}}function Bu(e){switch(e){case`user`:return`personal to you, across all projects`;case`project`:return`shared with your team via git`;case`project-local`:return`this machine only, not shared`;case`either`:return`user or project`}}function Vu(e){if(!Ru(e))return e.message??`Unknown error (${e.code}).`;switch(e.code){case`YAML_PARSE`:return`Failed to parse YAML: ${e.detail}`;case`UNREADABLE`:return`Could not read the file: ${e.detail}`;case`SCHEMA_INVALID`:{if(e.issues.length===0)return`Invalid configuration.`;let t=new Map;for(let n of e.issues){let e=n.source?.file??`<no source>`,r=t.get(e)??[];r.push(n),t.set(e,r)}let n=[];for(let[e,r]of t){e===`<no source>`?n.push(`Invalid configuration:`):n.push(`Invalid configuration at ${e}:`);for(let t of r){let r=t.path.length===0?`<root>`:t.path.join(`.`);if(t.source){if(n.push(` ${e}:${t.source.line}:${t.source.column}`),n.push(` ${r}: ${t.message}`),t.source.snippet&&t.source.snippet.length>0)for(let e of t.source.snippet.split(`
|
|
183
183
|
`))n.push(` ${e}`)}else n.push(` ${r}: ${t.message}`)}}return n.join(`
|
|
@@ -187,4 +187,4 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
|
|
|
187
187
|
`))n.push(` ${t}`);return n.join(`
|
|
188
188
|
`)}case`WRITE_ERROR`:return`Failed to write config file: ${e.detail}`;case`OKIGNORE_INVALID`:return e.lineNumber===void 0?`.okignore: ${e.detail}`:`.okignore line ${e.lineNumber}: ${e.detail}`;case`UNKNOWN`:return e.message??`Unknown error.`}}const $="Run `ok config migrate` to strip the obsolete key automatically, or remove it by hand.",Hu=[{path:[`content`,`include`],redirect:[`content.include has been removed.`,`For subdirectory scoping, set content.dir in .ok/config.yml instead.`,`For pattern-based filtering, use .okignore (gitignore syntax — exclude-only; do not copy include patterns directly).`,$].join(` `)},{path:[`content`,`exclude`],redirect:[`Move these patterns to .okignore at the project root (gitignore syntax, 1:1 migration).`,$].join(` `)},{path:[`folders`],redirect:[`folders is no longer a top-level config field.`,"A folder's own frontmatter (open-shape, like a doc's) lives in nested `<folder>/.ok/frontmatter.yml`; new-doc starting properties come from templates in `<folder>/.ok/templates/`.","Edit via the folder overview in the editor sidebar, or `edit({ folder: { path, frontmatter } })` via the MCP.",$].join(` `)},{path:[`appearance`,`editorModeDefault`],redirect:[`appearance.editorModeDefault was removed and is never read — new docs always open in WYSIWYG; toggle mode via the editor mode button.`,$].join(` `)},{path:[`upload`,`maxBytes`],redirect:[`streaming uploads have no user-facing cap; the value is hardcoded in @inkeep/open-knowledge-core.`,$].join(` `)},{path:[`github`,`oauthAppClientId`],redirect:[`Use the OPEN_KNOWLEDGE_GITHUB_CLIENT_ID environment variable instead.`,$].join(` `)},{path:[`server`,`host`],redirect:[`Use server.bind in .ok/config.yml instead — a list of bind addresses, e.g. [127.0.0.1]; a non-loopback bind additionally requires server.allowExternal.`,`The --bind CLI flag and HOST environment variable also remain available.`,$].join(` `)},{path:[`remote`,`url`],redirect:[`remote.url has been removed. Use server.externalUrl in .ok/config.yml instead (the public origin your tunnel serves).`,$].join(` `)},{path:[`remote`,`port`],redirect:[`remote.port has been removed. Use server.port in .ok/config.yml instead.`,$].join(` `)},{path:[`server`,`publicUrl`],redirect:[`server.publicUrl has been removed. Use server.externalUrl in .ok/config.yml instead (the same key under its current name).`,$].join(` `)},{path:[`server`,`openOnAgentEdit`],redirect:[`This behavior was removed; the value is hardcoded.`,$].join(` `)},{path:[`mcp`,`autoStart`],redirect:[`To disable MCP auto-start, set OK_MCP_AUTOSTART=0.`,$].join(` `)},{path:[`mcp`,`tools`,`read_document`,`historyDepth`],redirect:[`This value is hardcoded in @inkeep/open-knowledge-core.`,$].join(` `)},{path:[`mcp`,`tools`,`grep`,`maxResults`],redirect:[`This value is hardcoded in @inkeep/open-knowledge-core.`,$].join(` `)},{path:[`mcp`,`tools`,`search`,`maxResults`],redirect:[`The search result cap is hardcoded in @inkeep/open-knowledge-core; this config key was removed.`,$].join(` `)},{path:[`preview`,`baseUrl`],redirect:["preview URLs now resolve only to the running server — start one with `ok start`.",$].join(` `)},{path:[`preview`,`scriptSrc`],redirect:[`preview.scriptSrc has been removed.`,`The code-block preview iframe now runs a fixed open network policy (it is no longer configurable).`,$].join(` `)},{path:[`appearance`,`sidebar`,`showAllFiles`],redirect:[`appearance.sidebar.showAllFiles has been removed.`,`The sidebar lists every file on disk by default; dot-prefixed entries are gated by appearance.sidebar.showHiddenFiles, and appearance.sidebar.showOnlyMarkdownFiles scopes the tree down to markdown documents as a per-machine view preference.`,$].join(` `)}];function Uu(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Wu(e,t){let n=e;for(let e=0;e<t.length-1;e++){if(!Uu(n))return!1;n=n[t[e]]}return Uu(n)?t[t.length-1]in n:!1}function Gu(e){let{value:t,file:n,source:r,doc:i}=e;if(!Uu(t))return[];let a=[];for(let e of Hu){if(!Wu(t,e.path))continue;let o;i!=null&&r!=null&&n!=null&&(o=Tu({file:n,source:r,doc:i,path:e.path})),a.push({code:`REMOVED_KEY`,path:e.path,redirect:e.redirect,...o===void 0?{}:{source:o}})}return a}function Ku(e,t){let[n,...r]=t;if(n===void 0)return e;let i={...e};if(r.length===0)return delete i[n],i;let a=i[n];return Uu(a)&&(i[n]=Ku(a,r)),i}function qu(e){if(!Uu(e))return e;let t=e;for(let e of Hu)Wu(t,e.path)&&(t=Ku(t,e.path));return t}const Ju=`v0`,Yu=`.ok/config.yml`,Xu=`local`,Zu=`themes`;function Qu(e){try{let t=Intl.getCanonicalLocales(e)[0];return t===void 0?null:t}catch{return null}}function $u(e){try{let t=Intl.getCanonicalLocales(e)[0];if(t===void 0)return null;let n=new Intl.Locale(t).maximize();return!n.language||!n.script?null:`${n.language}-${n.script}`}catch{return null}}const ed=`last-spawn-error.log`,td=`=== spawn attempt `;function nd(e){return e===void 0?`a`:e>=262144?`w`:`a`}function rd(e,t){return`\n${td}${e.toISOString()} pid=${t} ===\n`}function id(e){let t=e.lastIndexOf(td);if(t===-1)return e;let n=e.indexOf(`
|
|
189
189
|
`,t);return n===-1?``:e.slice(n+1)}const ad=`last-server-exit.json`,od=`last-server-crash.json`;function sd(e){return new Promise(t=>{setTimeout(t,e)})}export{el as $,j as $t,lu as A,B as At,cu as B,bo as Bt,xu as C,$o as Ct,pu as D,Qa as Dt,hu as E,G as Et,Zl as F,zo as Ft,ll as G,no as Gt,Hl as H,mo as Ht,Xl as I,K as It,Sl as J,ra as Jt,xl as K,ja as Kt,ru as L,U as Lt,tu as M,lo as Mt,Ql as N,Ya as Nt,du as O,eo as Ot,nu as P,fo as Pt,nl as Q,Cn as Qt,ou as R,z as Rt,bu as S,ns as St,gu as T,yo as Tt,Vl as U,L as Ut,su as V,Wo as Vt,Ul as W,W as Wt,il as X,jr as Xt,ol as Y,ta as Yt,sl as Z,tr as Zt,Fu as _,$c as _t,rd as a,D as an,Dc as at,Ru as b,Go as bt,Qu as c,s as cn,Oc as ct,Yu as d,Qc as dt,De as en,Sc as et,Zu as f,Mc as ft,qu as g,Yc as gt,Gu as h,Zc as ht,ed as i,Te as in,Ac as it,eu as j,Vo as jt,fu as k,V as kt,$u as l,o as ln,wc as lt,Hu as m,Tc as mt,od as n,je as nn,Cc as nt,id as o,y as on,Pc as ot,Ju as p,jc as pt,pl as q,ka as qt,ad as r,Ne as rn,xc as rt,nd as s,O as sn,kc as st,sd as t,ke as tn,bc as tt,Xu as u,Nc as ut,Lu as v,yc as vt,vu as w,qa as wt,Tu as x,Qo as xt,Vu as y,hc as yt,au as z,H as zt};
|
|
190
|
-
//# sourceMappingURL=sleep-
|
|
190
|
+
//# sourceMappingURL=sleep-BZCw-NJO.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./src-Z_TMwYvr.mjs";import"./resolve-project-root-CRLZdY7g.mjs";import"./src-BiHf8piw.mjs";import"./acp-harness-probe-BejSsqhT.mjs";import"./init-CobW3CM5.mjs";import{n as e}from"./loader-Dd7ZEVPD.mjs";import"./skill-teardown-DqjQIBvp.mjs";import"./preview-oUN7zWZf.mjs";import"./mcp-migrate-event-9DFnNzHa.mjs";export{e as loadConfig};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Bc as e,J as t,Ms as n,Ns as r,Qs as i,W as a,ec as o,ks as s,uc as c,x as l,y as u}from"./src-BUfAkcnU.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,At as b,B as x,Bi as S,Bn as C,Br as w,Bt as T,C as E,Ca as D,Cn as O,Cr as k,Ct as A,D as j,Da as M,Di as N,Dn as P,Dr as F,Dt as I,E as L,Ea as R,Ei as z,En as B,Er as V,Et as H,F as U,Fi as W,Fn as G,Fr as K,Ft as q,G as J,Gi as Y,Gn as X,Gr as Z,Gt as Q,H as $,Hi as ee,Hn as te,Hr as ne,Ht as re,I as ie,Ii as ae,In as oe,Ir as se,It as ce,J as le,Ji as ue,Jn as de,Jr as fe,Jt as pe,K as me,Ki as he,Kn as ge,Kr as _e,Kt as ve,L as ye,Li as be,Ln as xe,Lr as Se,Lt as Ce,M as we,Ma as Te,Mi as Ee,Mn as De,Mt as Oe,N as ke,Na as Ae,Ni as je,Nn as Me,Nr as Ne,Nt as Pe,O as Fe,Oa as Ie,Oi as Le,On as Re,Ot as ze,P as Be,Pa as Ve,Pi as He,Pn as Ue,Pr as We,Pt as Ge,Q as Ke,Qi as qe,Qn as Je,Qr as Ye,Qt as Xe,R as Ze,Ri as Qe,Rn as $e,Rr as et,Rt as tt,S as nt,Sa as rt,Si as it,Sn as at,Sr as ot,St as st,T as ct,Ta as lt,Ti as ut,Tn as dt,Tr as ft,Tt as pt,U as mt,Ui as ht,Un as gt,Ur as _t,Ut as vt,V as yt,Vi as bt,Vn as xt,Vr as St,Vt as Ct,W as wt,Wi as Tt,Wn as Et,Wr as Dt,Wt as Ot,X as kt,Xi as At,Xn as jt,Xr as Mt,Xt as Nt,Y as Pt,Yi as Ft,Yn as It,Yr as Lt,Yt as Rt,Z as zt,Zi as Bt,Zn as Vt,Zr as Ht,Zt as Ut,_ as Wt,_a as Gt,_i as Kt,_n as qt,_r as Jt,a as Yt,aa as Xt,ai as Zt,an as Qt,ar as $t,at as en,b as tn,ba as nn,bi as rn,bn as an,br as on,bt as sn,c as cn,ca as ln,ci as un,cn as dn,cr as fn,ct as pn,d as mn,da as hn,di as gn,dn as _n,dr as vn,dt as yn,ea as bn,ei as xn,en as Sn,er as Cn,et as wn,f as Tn,fa as En,fi as Dn,fn as On,fr as kn,ft as An,g as jn,ga as Mn,gi as Nn,gn as Pn,gr as Fn,h as In,ha as Ln,hi as Rn,hn as zn,hr as Bn,i as Vn,ia as Hn,ii as Un,in as Wn,ir as Gn,it as Kn,j as qn,ja as Jn,ji as Yn,jn as Xn,jt as Zn,k as Qn,ka as $n,ki as er,kn as tr,kt as nr,l as rr,la as ir,li as ar,ln as or,lr as sr,lt as cr,m as lr,ma as ur,mi as dr,mn as fr,mr as pr,n as mr,na as hr,ni as gr,nn as _r,nr as vr,nt as yr,o as br,oa as xr,oi as Sr,on as Cr,or as wr,ot as Tr,p as Er,pa as Dr,pi as Or,pn as kr,pr as Ar,pt as jr,q as Mr,qi as Nr,qn as Pr,qr as Fr,qt as Ir,r as Lr,ra as Rr,ri as zr,rn as Br,rr as Vr,rt as Hr,s as Ur,sa as Wr,si as Gr,sn as Kr,sr as qr,st as Jr,t as Yr,ta as Xr,ti as Zr,tn as Qr,tr as $r,tt as ei,u as ti,ua as ni,ui as ri,un as ii,ur as ai,ut as oi,v as si,va as ci,vi as li,vn as ui,vr as di,w as fi,wa as pi,wi as mi,wn as hi,wr as gi,wt as _i,x as vi,xa as yi,xi as bi,xn as xi,xr as Si,xt as Ci,y as wi,ya as Ti,yi as Ei,yn as Di,yr as Oi,z as ki,zi as Ai,zn as ji,zr as Mi,zt as Ni}from"./src-Dyk9iCzv.mjs";import{C as Pi,E as Fi,T as Ii,_ as Li,b as Ri,c as zi,d as Bi,g as Vi,i as Hi,l as Ui,m as Wi,n as Gi,p as Ki,s as qi,t as Ji,u as Yi,v as Xi,w as Zi,x as Qi,y as $i}from"./fs-traced-DcgvOGgW.mjs";import{a as ea,d as ta,f as na,i as ra,l as ia,n as aa,r as oa,t as sa,u as ca}from"./logger-Dq-cRhcP.mjs";import{C as la,S as ua,_ as da,a as fa,b as pa,c as ma,d as ha,f as ga,g as _a,h as va,i as ya,l as ba,m as xa,n as Sa,o as Ca,p as wa,r as Ta,s as Ea,t as Da,u as Oa,x as ka}from"./server-lock-DaOXwt6C.mjs";export{lt as AGENT_ID_MAX_LEN,R as AGENT_ID_RE,bt as AGENT_WRITE_ORIGIN,Te as AcpPermissionStore,$n as AcpRegistry,N as AcpThreadManager,ut as AgentFocusBroadcaster,mi as AgentPresenceBroadcaster,ee as AgentSessionCapacityError,ht as AgentSessionManager,st as AutoStartDisabledError,Kt as BUNDLE_IDS,li as BUNDLE_SCOPE,Ei as BUNDLE_SKILL_NAME,Vt as BacklinkIndex,f as CC1Broadcaster,o as CC1_CONTRACT_VERSION,or as CONFIG_FILENAME,X as CONFLICT_MARKER_RE,Se as CURSOR_BUNDLE_PATHS_BY_PLATFORM,tn as ConfigSchema,Xt as DEFAULT_CHECKPOINT_RETENTION,Zr as DEFAULT_EMBEDDINGS_DIMENSIONS,re as DEFAULT_PACK_ID,J as DocumentDurabilityState,gr as EMBEDDINGS_API_KEY_ENV,Yr as EPHEMERAL_PROJECT_DIR_PREFIX,xi as ExposureConsentError,_ as FEATURED_AGENT_IDS,xr as FILE_SYSTEM_WRITER,It as FILE_WATCHER_ORIGIN,Lt as FileEmbeddingsBackend,Wn as GIT_PREFLIGHT_FAIL_SPAN_NAME,Wr as GIT_UPSTREAM_WRITER,Ae as GitDirAccessError,Ee as GitNotAvailableError,je as GitTooOldError,A as HOCUSPOCUS_AUTH_REJECTION_REASONS,_i as HocuspocusAuthRejection,pt as HocuspocusAuthTokenSchema,qt as HomeProjectRootError,_t as INSTALLED_AGENTS_SCHEMES,An as JSON_SCHEMA_DIALECT_2020_12,i as LINEAGE_EPOCH_KEY,$ as LIVE_DERIVED_INDEX_DEBOUNCE_MS,vt as LOG_MD_TEMPLATE,Oe as MANAGED_RENAME_ORIGIN,Le as MAX_ACP_THREADS,Tt as MAX_AGENT_SESSIONS,v as MCP_CONNECTION_ID_HEADER,s as MCP_SERVER_NAME,Y as MIN_EVICTABLE_IDLE_MS,He as MIN_GIT_VERSION,me as MISSING_OK_CONFIG_MESSAGE,Ve as MalformedGitPointerError,Kn as McpLogger,Mr as MissingOkConfigError,Nr as OBSERVER_SYNC_ORIGIN,ii as OK_OKIGNORE_TEMPLATE,rn as ONBOARDING_BUNDLE_IDS,n as ORPHAN_MODES,e as PROTOCOL_VERSION,sa as PinoLogger,ba as ProcessLockCollisionError,Tn as ProjectGitInitError,Pe as ROLLBACK_ORIGIN,_n as ROOT_GITIGNORE_TEMPLATE,pa as RUNTIME_VERSION,ln as SERVICE_WRITER,Ar as SKILL_INSTALL_EVENTS_FILE_REL,a as SKILL_STATE_TARGETS,Ot as STARTER_FOLDERS,Q as STARTER_FOLDER_FRONTMATTER_FILENAME,ve as STARTER_PACKS,Ir as STARTER_PACK_IDS,pe as STARTER_TEMPLATES,Qn as STATE_MANIFEST_FILENAME,ka as STATE_SCHEMA_VERSION,c as SYSTEM_DOC_NAME,Sn as SeedPrerequisiteError,Qr as SeedRootDirError,Da as ServerLockCollisionError,mr as SingleFileNotAFileError,Lr as SingleFileNotFoundError,Vn as SingleFileNotMarkdownError,Yt as SingleFileProjectOverrideError,g as StateManifestError,jt as TagIndex,bi as USER_GLOBAL_BUNDLE_IDS,Ge as __getShowAllWalkStatsForTesting,q as __resetShowAllWalkStatsForTesting,Oa as acquireProcessLock,Sa as acquireServerLock,he as applyAgentMarkdownWrite,gt as applyExternalChange,Ct as applySeed,qn as assertCompatibleStateManifest,W as assertGitAvailable,Xn as assertNeverDiskEvent,ui as assertNotHomeProjectRoot,z as attachAcpThreadSocket,sn as attachCollabClientCounter,Ci as attachIdleShutdown,vi as bootServer,p as buildAndOpenSkill,On as buildConfigYmlContent,d as buildExecResult,at as buildIngressPolicy,er as buildOkMcpStdioCommand,dr as buildSkillZip,Rt as buildStarterFolderFrontmatterYaml,ir as buildWipTree,it as bundleSkillMdPath,Mt as canonicalProjectKey,Di as canonicalizeForCompare,De as classifyEvents,Ji as classifyFsPath,Ht as clearAllEmbeddingsKeys,Un as clearContributors,Nt as coercePackId,u as colorFromSeed,ni as commitUpstreamImport,hn as commitWip,En as commitWipFromTree,ae as compareSemver,on as composeEffectiveLinterConfig,Si as composeFrontmatterSchemasConfig,ge as containsConflictMarkers,Me as contentHash,Zt as contributorCount,Ze as countShadowObjects,ki as countStaleAgentWipRefs,x as countWipRefs,ce as createApiExtension,Zn as createAssetServeMiddleware,Pt as createCollaborationHost,Ne as createContentFilter,We as createContentFilterAsync,Ye as createEmbeddingsSecretStore,br as createEphemeralProjectDir,Et as createExternalChangeHandler,In as createFileLogger,mt as createLiveDerivedIndexExtension,zt as createMcpHttpHandler,Dt as createOsProbe,ye as createPersistenceExtension,L as createServer,U as createServerObserverExtension,At as createStreamingErrorWriter,aa as createTestLogger,m as describeStoredEmbeddingsKey,wi as detectClaudeDesktopPresence,be as detectGit,we as detectProjectShape,Cn as detectUserSkillHosts,Jr as discoverLockDirs,gi as discoverMarkdownlintConfig,Qt as emitPreflightFailureSpan,wn as encodeDocName,ei as encodeFolderRoute,yr as encodeSkillRoute,Er as ensureProjectGit,kr as ensureProjectSkillGitignore,Bt as errorResponse,Ue as evictStaleTrackerEntries,Ce as extractHeadings,pn as extractOkBinaryPath,Je as extractWikiLinksFromMarkdown,Qe as fallbackPaths,lr as findEnclosingGitRoot,K as findEnclosingProjectRoot,ft as findNativeMarkdownlintFile,jn as flushFileLogger,H as formatAuthRejectionWire,Sr as formatContributors,Gr as formatContributorsFrom,Ni as formatPackRationale,Dr as gcCheckpointRefs,en as getCurrentMcpLogger,O as getIngressContext,gn as getLocalDir,Wt as getLogFilePath,oa as getLogger,si as getLogsDir,da as getMachineId,$i as getMeter,nn as getMetrics,Ri as getTracer,yi as handleCollabSocketError,et as handleSpawnCursor,hi as hasForwardingHeaders,yt as hasGcLogLatch,l as iconFromClientName,rt as incrementCollabSocketFilteredError,D as incrementServerObserverFire,fr as initContent,ur as initShadowRepo,Qi as initTelemetry,E as initToleranceTelemetryWriter,jr as installJsonSchemaDialect,yn as installPrettyZodErrors,ra as installTestLoggers,$r as installUserSkill,y as isAllowedApiOrigin,Re as isAllowedWorkspaceHostHeader,bn as isConfigDoc,I as isHocuspocusAuthRejectionReason,an as isHomeDir,dt as isHostAdmitted,Ut as isKnownPackId,Xr as isLinkIndexExcludedDoc,tr as isLoopbackAddress,hr as isManagedArtifactDoc,B as isOriginAdmitted,r as isOrphanMode,ue as isPairedWriteOrigin,Mi as isPathWithinDir,P as isPeerAdmitted,ua as isProcessAlive,se as isProjectRoot,Rr as isReservedForUserTree,G as isSelfWrite,Hn as isSystemDoc,fi as isToleranceTelemetryEnabled,la as isValidLockPid,oe as lastKnownHash,Ln as listRescueCheckpoints,Xe as listStarterPacks,Jn as loadCustomAgents,ie as loadPrincipal,Ta as lockAdvertisesUi,ha as lockBaseUrl,ga as lockFilePath,ea as loggerFactory,Fn as loginShapedUserinfoUser,ia as logsCurrentPath,ca as logsPreviousPath,xn as makeLazyEmbeddingsKeyStore,ya as markServerLockDraining,le as mountMcpAndApi,Gi as normalizeFsPath,Jt as originGitHubHost,zn as packageVersionMajorMinor,ze as parseAuthRejectionWire,Ai as parseGitVersion,nr as parseHocuspocusAuthToken,kt as parseKeepaliveConnectionId,xe as pathToDocName,T as planSeed,Ur as prepareSingleFileOpen,cr as processCommand,oi as processUsage,Gn as readAllTargets,$t as readBundleDecision,V as readOwnNativeRules,wa as readProcessLock,xa as readProcessLockDetailed,wt as readProjectHeadState,fe as readProjectLocalSemanticConfig,fa as readServerLock,wr as readServerPackageVersion,qr as readSkillInstallStateSnapshot,ke as readStateManifest,fn as readTargetRecordedAt,sr as readTargetVersion,Pr as reconcile,un as recordContributor,pr as recordSkillInstallEvent,Bn as redactShareSubprocessStderr,Ke as registerAllTools,$e as registerWrite,va as releaseProcessLock,Ca as releaseServerLock,ji as removeLastKnownHash,Vr as reportSkillInstall,pi as resetMetrics,vr as resolveBuiltinSkillHosts,t as resolveBundleEnabled,Rn as resolveBundledSkillDir,Dn as resolveContentDir,w as resolveCursorBinaryDefault,St as resolveCursorSpawnInvocation,ot as resolveEffectiveLinterConfig,zr as resolveEmbeddingsCredential,Fe as resolveGitHubAccountFromUrl,Or as resolveLockDir,k as resolveNativeConfigForDoc,F as resolveNativeMarkdownlintConfig,h as resolvePack,ti as resolvePackageVersion,kn as resolveSkillInstallReportSettings,Hr as resolveUiInfo,ar as restoreContributors,nt as restoreLifecycleFromConflictsJson,_e as rewriteMarkdownLinksForDocumentRename,Fr as rewriteWikiLinksForDocumentRename,Cr as runAuthReposSubprocess,Kr as runAuthStatusSubprocess,_r as runCloneSubprocess,dn as runDeviceFlowSubprocess,Tr as runWithMcpLogger,Z as safeContentPath,tt as safeSubdir,Mn as safetyCheckpoint,di as sameGitHubLogin,Yn as sanitizeClientName,Gt as saveInMemoryCheckpoint,ci as saveVersion,b as seedBasenameIndex,cn as seedEphemeralProjectDir,rr as serializeError,Pi as setActiveSpanAttributes,Ft as setupServerObservers,Ti as shadowGit,Zi as shutdownTelemetry,ta as spansCurrentPath,na as spansPreviousPath,ne as spawnDetached,de as splitMarkdownBlocks,C as startWatcher,qe as streamingProblemEvent,ri as swapContributors,ct as teardownToleranceTelemetryWriter,M as toBroadcasterKey,Hi as tracedAppendFileSync,qi as tracedLinkSync,zi as tracedMkdir,Ui as tracedMkdirSync,Yi as tracedRename,Bi as tracedRenameSync,Ki as tracedRmSync,Wi as tracedRmdirSync,Vi as tracedUnlinkSync,Li as tracedWriteFile,Xi as tracedWriteFileSync,j as trustSystemCertificates,mn as untrackTrackedProjectSkillProjection,xt as updateLastKnownHash,_a as updateProcessLockPort,Ea as updateServerLockPort,Ie as validateAgentId,Br as validateCloneInputs,Nn as validateSkillZip,ma as waitForServerLockDrain,S as withHiddenWindowsConsole,Ii as withSpan,Fi as withSpanSync,ai as writeBundleDecision,Oi as writeMarkdownlintRule,Pn as writeRootGitignoreForNewRepo,Be as writeStateManifest,vn as writeTargetVersion,te as writeTracker};
|
|
1
|
+
import{Bc as e,J as t,Ms as n,Ns as r,Qs as i,W as a,ec as o,ks as s,uc as c,x as l,y as u}from"./src-Z_TMwYvr.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,At as b,B as x,Bi as S,Bn as C,Br as w,Bt as T,C as E,Ca as D,Cn as O,Cr as k,Ct as A,D as j,Da as M,Di as N,Dn as P,Dr as F,Dt as I,E as L,Ea as R,Ei as z,En as B,Er as V,Et as H,F as U,Fi as W,Fn as G,Fr as K,Ft as q,G as J,Gi as Y,Gn as X,Gr as Z,Gt as Q,H as $,Hi as ee,Hn as te,Hr as ne,Ht as re,I as ie,Ii as ae,In as oe,Ir as se,It as ce,J as le,Ji as ue,Jn as de,Jr as fe,Jt as pe,K as me,Ki as he,Kn as ge,Kr as _e,Kt as ve,L as ye,Li as be,Ln as xe,Lr as Se,Lt as Ce,M as we,Ma as Te,Mi as Ee,Mn as De,Mt as Oe,N as ke,Na as Ae,Ni as je,Nn as Me,Nr as Ne,Nt as Pe,O as Fe,Oa as Ie,Oi as Le,On as Re,Ot as ze,P as Be,Pa as Ve,Pi as He,Pn as Ue,Pr as We,Pt as Ge,Q as Ke,Qi as qe,Qn as Je,Qr as Ye,Qt as Xe,R as Ze,Ri as Qe,Rn as $e,Rr as et,Rt as tt,S as nt,Sa as rt,Si as it,Sn as at,Sr as ot,St as st,T as ct,Ta as lt,Ti as ut,Tn as dt,Tr as ft,Tt as pt,U as mt,Ui as ht,Un as gt,Ur as _t,Ut as vt,V as yt,Vi as bt,Vn as xt,Vr as St,Vt as Ct,W as wt,Wi as Tt,Wn as Et,Wr as Dt,Wt as Ot,X as kt,Xi as At,Xn as jt,Xr as Mt,Xt as Nt,Y as Pt,Yi as Ft,Yn as It,Yr as Lt,Yt as Rt,Z as zt,Zi as Bt,Zn as Vt,Zr as Ht,Zt as Ut,_ as Wt,_a as Gt,_i as Kt,_n as qt,_r as Jt,a as Yt,aa as Xt,ai as Zt,an as Qt,ar as $t,at as en,b as tn,ba as nn,bi as rn,bn as an,br as on,bt as sn,c as cn,ca as ln,ci as un,cn as dn,cr as fn,ct as pn,d as mn,da as hn,di as gn,dn as _n,dr as vn,dt as yn,ea as bn,ei as xn,en as Sn,er as Cn,et as wn,f as Tn,fa as En,fi as Dn,fn as On,fr as kn,ft as An,g as jn,ga as Mn,gi as Nn,gn as Pn,gr as Fn,h as In,ha as Ln,hi as Rn,hn as zn,hr as Bn,i as Vn,ia as Hn,ii as Un,in as Wn,ir as Gn,it as Kn,j as qn,ja as Jn,ji as Yn,jn as Xn,jt as Zn,k as Qn,ka as $n,ki as er,kn as tr,kt as nr,l as rr,la as ir,li as ar,ln as or,lr as sr,lt as cr,m as lr,ma as ur,mi as dr,mn as fr,mr as pr,n as mr,na as hr,ni as gr,nn as _r,nr as vr,nt as yr,o as br,oa as xr,oi as Sr,on as Cr,or as wr,ot as Tr,p as Er,pa as Dr,pi as Or,pn as kr,pr as Ar,pt as jr,q as Mr,qi as Nr,qn as Pr,qr as Fr,qt as Ir,r as Lr,ra as Rr,ri as zr,rn as Br,rr as Vr,rt as Hr,s as Ur,sa as Wr,si as Gr,sn as Kr,sr as qr,st as Jr,t as Yr,ta as Xr,ti as Zr,tn as Qr,tr as $r,tt as ei,u as ti,ua as ni,ui as ri,un as ii,ur as ai,ut as oi,v as si,va as ci,vi as li,vn as ui,vr as di,w as fi,wa as pi,wi as mi,wn as hi,wr as gi,wt as _i,x as vi,xa as yi,xi as bi,xn as xi,xr as Si,xt as Ci,y as wi,ya as Ti,yi as Ei,yn as Di,yr as Oi,z as ki,zi as Ai,zn as ji,zr as Mi,zt as Ni}from"./src-CYk60p3w.mjs";import{C as Pi,E as Fi,T as Ii,_ as Li,b as Ri,c as zi,d as Bi,g as Vi,i as Hi,l as Ui,m as Wi,n as Gi,p as Ki,s as qi,t as Ji,u as Yi,v as Xi,w as Zi,x as Qi,y as $i}from"./fs-traced-C5AXyho0.mjs";import{a as ea,d as ta,f as na,i as ra,l as ia,n as aa,r as oa,t as sa,u as ca}from"./logger-Dq-cRhcP.mjs";import{C as la,S as ua,_ as da,a as fa,b as pa,c as ma,d as ha,f as ga,g as _a,h as va,i as ya,l as ba,m as xa,n as Sa,o as Ca,p as wa,r as Ta,s as Ea,t as Da,u as Oa,x as ka}from"./server-lock-BYM-gfLh.mjs";export{lt as AGENT_ID_MAX_LEN,R as AGENT_ID_RE,bt as AGENT_WRITE_ORIGIN,Te as AcpPermissionStore,$n as AcpRegistry,N as AcpThreadManager,ut as AgentFocusBroadcaster,mi as AgentPresenceBroadcaster,ee as AgentSessionCapacityError,ht as AgentSessionManager,st as AutoStartDisabledError,Kt as BUNDLE_IDS,li as BUNDLE_SCOPE,Ei as BUNDLE_SKILL_NAME,Vt as BacklinkIndex,f as CC1Broadcaster,o as CC1_CONTRACT_VERSION,or as CONFIG_FILENAME,X as CONFLICT_MARKER_RE,Se as CURSOR_BUNDLE_PATHS_BY_PLATFORM,tn as ConfigSchema,Xt as DEFAULT_CHECKPOINT_RETENTION,Zr as DEFAULT_EMBEDDINGS_DIMENSIONS,re as DEFAULT_PACK_ID,J as DocumentDurabilityState,gr as EMBEDDINGS_API_KEY_ENV,Yr as EPHEMERAL_PROJECT_DIR_PREFIX,xi as ExposureConsentError,_ as FEATURED_AGENT_IDS,xr as FILE_SYSTEM_WRITER,It as FILE_WATCHER_ORIGIN,Lt as FileEmbeddingsBackend,Wn as GIT_PREFLIGHT_FAIL_SPAN_NAME,Wr as GIT_UPSTREAM_WRITER,Ae as GitDirAccessError,Ee as GitNotAvailableError,je as GitTooOldError,A as HOCUSPOCUS_AUTH_REJECTION_REASONS,_i as HocuspocusAuthRejection,pt as HocuspocusAuthTokenSchema,qt as HomeProjectRootError,_t as INSTALLED_AGENTS_SCHEMES,An as JSON_SCHEMA_DIALECT_2020_12,i as LINEAGE_EPOCH_KEY,$ as LIVE_DERIVED_INDEX_DEBOUNCE_MS,vt as LOG_MD_TEMPLATE,Oe as MANAGED_RENAME_ORIGIN,Le as MAX_ACP_THREADS,Tt as MAX_AGENT_SESSIONS,v as MCP_CONNECTION_ID_HEADER,s as MCP_SERVER_NAME,Y as MIN_EVICTABLE_IDLE_MS,He as MIN_GIT_VERSION,me as MISSING_OK_CONFIG_MESSAGE,Ve as MalformedGitPointerError,Kn as McpLogger,Mr as MissingOkConfigError,Nr as OBSERVER_SYNC_ORIGIN,ii as OK_OKIGNORE_TEMPLATE,rn as ONBOARDING_BUNDLE_IDS,n as ORPHAN_MODES,e as PROTOCOL_VERSION,sa as PinoLogger,ba as ProcessLockCollisionError,Tn as ProjectGitInitError,Pe as ROLLBACK_ORIGIN,_n as ROOT_GITIGNORE_TEMPLATE,pa as RUNTIME_VERSION,ln as SERVICE_WRITER,Ar as SKILL_INSTALL_EVENTS_FILE_REL,a as SKILL_STATE_TARGETS,Ot as STARTER_FOLDERS,Q as STARTER_FOLDER_FRONTMATTER_FILENAME,ve as STARTER_PACKS,Ir as STARTER_PACK_IDS,pe as STARTER_TEMPLATES,Qn as STATE_MANIFEST_FILENAME,ka as STATE_SCHEMA_VERSION,c as SYSTEM_DOC_NAME,Sn as SeedPrerequisiteError,Qr as SeedRootDirError,Da as ServerLockCollisionError,mr as SingleFileNotAFileError,Lr as SingleFileNotFoundError,Vn as SingleFileNotMarkdownError,Yt as SingleFileProjectOverrideError,g as StateManifestError,jt as TagIndex,bi as USER_GLOBAL_BUNDLE_IDS,Ge as __getShowAllWalkStatsForTesting,q as __resetShowAllWalkStatsForTesting,Oa as acquireProcessLock,Sa as acquireServerLock,he as applyAgentMarkdownWrite,gt as applyExternalChange,Ct as applySeed,qn as assertCompatibleStateManifest,W as assertGitAvailable,Xn as assertNeverDiskEvent,ui as assertNotHomeProjectRoot,z as attachAcpThreadSocket,sn as attachCollabClientCounter,Ci as attachIdleShutdown,vi as bootServer,p as buildAndOpenSkill,On as buildConfigYmlContent,d as buildExecResult,at as buildIngressPolicy,er as buildOkMcpStdioCommand,dr as buildSkillZip,Rt as buildStarterFolderFrontmatterYaml,ir as buildWipTree,it as bundleSkillMdPath,Mt as canonicalProjectKey,Di as canonicalizeForCompare,De as classifyEvents,Ji as classifyFsPath,Ht as clearAllEmbeddingsKeys,Un as clearContributors,Nt as coercePackId,u as colorFromSeed,ni as commitUpstreamImport,hn as commitWip,En as commitWipFromTree,ae as compareSemver,on as composeEffectiveLinterConfig,Si as composeFrontmatterSchemasConfig,ge as containsConflictMarkers,Me as contentHash,Zt as contributorCount,Ze as countShadowObjects,ki as countStaleAgentWipRefs,x as countWipRefs,ce as createApiExtension,Zn as createAssetServeMiddleware,Pt as createCollaborationHost,Ne as createContentFilter,We as createContentFilterAsync,Ye as createEmbeddingsSecretStore,br as createEphemeralProjectDir,Et as createExternalChangeHandler,In as createFileLogger,mt as createLiveDerivedIndexExtension,zt as createMcpHttpHandler,Dt as createOsProbe,ye as createPersistenceExtension,L as createServer,U as createServerObserverExtension,At as createStreamingErrorWriter,aa as createTestLogger,m as describeStoredEmbeddingsKey,wi as detectClaudeDesktopPresence,be as detectGit,we as detectProjectShape,Cn as detectUserSkillHosts,Jr as discoverLockDirs,gi as discoverMarkdownlintConfig,Qt as emitPreflightFailureSpan,wn as encodeDocName,ei as encodeFolderRoute,yr as encodeSkillRoute,Er as ensureProjectGit,kr as ensureProjectSkillGitignore,Bt as errorResponse,Ue as evictStaleTrackerEntries,Ce as extractHeadings,pn as extractOkBinaryPath,Je as extractWikiLinksFromMarkdown,Qe as fallbackPaths,lr as findEnclosingGitRoot,K as findEnclosingProjectRoot,ft as findNativeMarkdownlintFile,jn as flushFileLogger,H as formatAuthRejectionWire,Sr as formatContributors,Gr as formatContributorsFrom,Ni as formatPackRationale,Dr as gcCheckpointRefs,en as getCurrentMcpLogger,O as getIngressContext,gn as getLocalDir,Wt as getLogFilePath,oa as getLogger,si as getLogsDir,da as getMachineId,$i as getMeter,nn as getMetrics,Ri as getTracer,yi as handleCollabSocketError,et as handleSpawnCursor,hi as hasForwardingHeaders,yt as hasGcLogLatch,l as iconFromClientName,rt as incrementCollabSocketFilteredError,D as incrementServerObserverFire,fr as initContent,ur as initShadowRepo,Qi as initTelemetry,E as initToleranceTelemetryWriter,jr as installJsonSchemaDialect,yn as installPrettyZodErrors,ra as installTestLoggers,$r as installUserSkill,y as isAllowedApiOrigin,Re as isAllowedWorkspaceHostHeader,bn as isConfigDoc,I as isHocuspocusAuthRejectionReason,an as isHomeDir,dt as isHostAdmitted,Ut as isKnownPackId,Xr as isLinkIndexExcludedDoc,tr as isLoopbackAddress,hr as isManagedArtifactDoc,B as isOriginAdmitted,r as isOrphanMode,ue as isPairedWriteOrigin,Mi as isPathWithinDir,P as isPeerAdmitted,ua as isProcessAlive,se as isProjectRoot,Rr as isReservedForUserTree,G as isSelfWrite,Hn as isSystemDoc,fi as isToleranceTelemetryEnabled,la as isValidLockPid,oe as lastKnownHash,Ln as listRescueCheckpoints,Xe as listStarterPacks,Jn as loadCustomAgents,ie as loadPrincipal,Ta as lockAdvertisesUi,ha as lockBaseUrl,ga as lockFilePath,ea as loggerFactory,Fn as loginShapedUserinfoUser,ia as logsCurrentPath,ca as logsPreviousPath,xn as makeLazyEmbeddingsKeyStore,ya as markServerLockDraining,le as mountMcpAndApi,Gi as normalizeFsPath,Jt as originGitHubHost,zn as packageVersionMajorMinor,ze as parseAuthRejectionWire,Ai as parseGitVersion,nr as parseHocuspocusAuthToken,kt as parseKeepaliveConnectionId,xe as pathToDocName,T as planSeed,Ur as prepareSingleFileOpen,cr as processCommand,oi as processUsage,Gn as readAllTargets,$t as readBundleDecision,V as readOwnNativeRules,wa as readProcessLock,xa as readProcessLockDetailed,wt as readProjectHeadState,fe as readProjectLocalSemanticConfig,fa as readServerLock,wr as readServerPackageVersion,qr as readSkillInstallStateSnapshot,ke as readStateManifest,fn as readTargetRecordedAt,sr as readTargetVersion,Pr as reconcile,un as recordContributor,pr as recordSkillInstallEvent,Bn as redactShareSubprocessStderr,Ke as registerAllTools,$e as registerWrite,va as releaseProcessLock,Ca as releaseServerLock,ji as removeLastKnownHash,Vr as reportSkillInstall,pi as resetMetrics,vr as resolveBuiltinSkillHosts,t as resolveBundleEnabled,Rn as resolveBundledSkillDir,Dn as resolveContentDir,w as resolveCursorBinaryDefault,St as resolveCursorSpawnInvocation,ot as resolveEffectiveLinterConfig,zr as resolveEmbeddingsCredential,Fe as resolveGitHubAccountFromUrl,Or as resolveLockDir,k as resolveNativeConfigForDoc,F as resolveNativeMarkdownlintConfig,h as resolvePack,ti as resolvePackageVersion,kn as resolveSkillInstallReportSettings,Hr as resolveUiInfo,ar as restoreContributors,nt as restoreLifecycleFromConflictsJson,_e as rewriteMarkdownLinksForDocumentRename,Fr as rewriteWikiLinksForDocumentRename,Cr as runAuthReposSubprocess,Kr as runAuthStatusSubprocess,_r as runCloneSubprocess,dn as runDeviceFlowSubprocess,Tr as runWithMcpLogger,Z as safeContentPath,tt as safeSubdir,Mn as safetyCheckpoint,di as sameGitHubLogin,Yn as sanitizeClientName,Gt as saveInMemoryCheckpoint,ci as saveVersion,b as seedBasenameIndex,cn as seedEphemeralProjectDir,rr as serializeError,Pi as setActiveSpanAttributes,Ft as setupServerObservers,Ti as shadowGit,Zi as shutdownTelemetry,ta as spansCurrentPath,na as spansPreviousPath,ne as spawnDetached,de as splitMarkdownBlocks,C as startWatcher,qe as streamingProblemEvent,ri as swapContributors,ct as teardownToleranceTelemetryWriter,M as toBroadcasterKey,Hi as tracedAppendFileSync,qi as tracedLinkSync,zi as tracedMkdir,Ui as tracedMkdirSync,Yi as tracedRename,Bi as tracedRenameSync,Ki as tracedRmSync,Wi as tracedRmdirSync,Vi as tracedUnlinkSync,Li as tracedWriteFile,Xi as tracedWriteFileSync,j as trustSystemCertificates,mn as untrackTrackedProjectSkillProjection,xt as updateLastKnownHash,_a as updateProcessLockPort,Ea as updateServerLockPort,Ie as validateAgentId,Br as validateCloneInputs,Nn as validateSkillZip,ma as waitForServerLockDrain,S as withHiddenWindowsConsole,Ii as withSpan,Fi as withSpanSync,ai as writeBundleDecision,Oi as writeMarkdownlintRule,Pn as writeRootGitignoreForNewRepo,Be as writeStateManifest,vn as writeTargetVersion,te as writeTracker};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e}from"./chunk-DTipWd-i.mjs";import{$ as t,Q as n,n as r,r as i,yt as a}from"./sleep-
|
|
1
|
+
import{o as e}from"./chunk-DTipWd-i.mjs";import{$ as t,Q as n,n as r,r as i,yt as a}from"./sleep-BZCw-NJO.mjs";import{Hc as o,Ic as s,Lc as c,Oo as l,Vc as u}from"./src-Z_TMwYvr.mjs";import{Bi as d,Fr as f,ct as p,h as m,lt as h,pi as g,st as _,ut as v}from"./src-CYk60p3w.mjs";import{A as y,I as b,L as x,O as S}from"./fs-traced-C5AXyho0.mjs";import{C,S as w,_ as T,d as E,f as D,r as O}from"./server-lock-BYM-gfLh.mjs";import{t as k}from"./yazl-DejPO9b3.mjs";import{h as ee,m as A,x as j}from"./resolve-project-root-CRLZdY7g.mjs";import{c as te}from"./colors-DSyAT9Cz.mjs";import{a as ne,i as M}from"./acp-harness-probe-BejSsqhT.mjs";import{D as re,E as N,S as ie,T as P,_ as ae,b as oe,o as se}from"./init-CobW3CM5.mjs";import{n as ce}from"./constants-Dvng6btw.mjs";import{t as le}from"./is-object-Bw0-z8qH.mjs";import"./loader-Dd7ZEVPD.mjs";import"./skill-teardown-DqjQIBvp.mjs";import"./preview-oUN7zWZf.mjs";import{execSync as ue,spawnSync as de}from"node:child_process";import{basename as F,dirname as I,join as L,relative as fe,resolve as R,sep as pe}from"node:path";import{cpSync as me,createWriteStream as he,existsSync as z,lstatSync as ge,mkdirSync as B,mkdtempSync as _e,readFileSync as V,readdirSync as H,readlinkSync as ve,rmSync as ye,statSync as be,writeFileSync as U}from"node:fs";import{arch as xe,freemem as Se,homedir as W,hostname as Ce,platform as we,release as Te,tmpdir as Ee,totalmem as De,type as Oe,uptime as ke}from"node:os";import"node:fs/promises";import{createHash as Ae}from"node:crypto";var je=a();let Me;function Ne(){return Me}function Pe(e,t){if(t!==void 0&&t.length>0)return t;try{return f(e)?.rootPath}catch{return}}function Fe(e){let t=Pe(e.cwd,e.configuredProjectName),n=m({name:`cli`,project:t});return Me=n,n.info({command:e.command,cwd:e.cwd,project:t},`cli command started`),n}const Ie=new Set([`start`,`stop`,`status`,`clean`,`ui`,`mcp`,`preview`,`lint`,`deinit`,`auth`]);function Le(e,t,n=f){if(e!==void 0&&!Ie.has(e))return null;let r=n(t);return r===null||r.distance===0?null:r.rootPath}let Re=null;function ze(e){Re=e}function Be(){return Re??process.cwd()}function G(){return L(W(),`.ok`,`bug-reports`)}function Ve(e=new Date){let t=e.toISOString().replace(/[:.]/g,`-`),n=G(),r=`${t}-bugreport`,i=L(n,`${r}.zip`);for(let e=2;z(i);e+=1)i=L(n,`${r}-${e}.zip`);return i}function He(e,t){let n=L(e,`.ok`,`config.yml`);if(z(n))try{let e=V(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 z(L(e,`.ok`))?Ae(`sha256`).update(R(e)).digest(`hex`).slice(0,12):null}function Ue(){let e={timestamp:new Date().toISOString(),platform:we(),osType:Oe(),osRelease:Te(),hostname:`[redacted]`,uptime:ke(),freeMem:Se(),totalMem:De(),nodeVersion:process.version,bunVersion:process.versions.bun??null,v8Version:process.versions.v8??null,pid:process.pid};try{e.macosVersion=ue(`sw_vers -productVersion 2>/dev/null`,d({encoding:`utf8`})).trim()}catch{}try{let t=L(__dirname,`..`,`..`,`package.json`);z(t)&&(e.okVersion=JSON.parse(V(t,`utf8`)).version)}catch{}return e}const We=[{prefix:`cli`,projectTagged:!0},{prefix:`desktop`,projectTagged:!1},{prefix:`mcp`,projectTagged:!1}];function Ge(e){let t=F(e);return We.some(e=>e.projectTagged&&t.startsWith(`${e.prefix}.`))}function Ke(e,t){return Xe(e,t).files}const qe=[`ShipIt_stderr.log`,`ShipIt_stdout.log`];function Je(e,t=ne){let n=L(e,`${t}.ShipIt`);if(!z(n))return[];let r;try{r=H(n)}catch{return[]}return qe.flatMap(e=>r.map(t=>{if(t===e)return{entry:t,suffix:-1};if(!t.startsWith(`${e}.`))return null;let n=t.slice(e.length+1);return/^\d+$/.test(n)?{entry:t,suffix:Number(n)}:null}).filter(e=>e!==null).sort((e,t)=>e.suffix-t.suffix).slice(0,4).map(e=>L(n,e.entry)))}function Ye(e){if(!z(e))return[];try{let t=new Map;for(let n of H(e).filter(e=>e.endsWith(`.yaml`)).sort()){let e=n.endsWith(`.sent.yaml`)?n.slice(0,-u.length):n.slice(0,-5),r=t.get(e);r===void 0?t.set(e,[n]):r.push(n)}return[...t.values()].slice(-25).flat().map(t=>L(e,t))}catch{return[]}}function Xe(e,t){if(!z(t))return{files:[],excludedByProjectSlug:0};let n=H(t).filter(e=>e.endsWith(`.log`)||/\.log\.\d+$/.test(e)).map(e=>L(t,e));if(!e)return{files:n,excludedByProjectSlug:0};let r=n.filter(Ge),i=[],a=r.filter(t=>{try{return V(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=>!Ge(e)||o.has(e)),excludedByProjectSlug:r.length-o.size}}function Ze(e){let t=L(e,`.ok`,`local`);return z(t)?{files:[`server.lock`,`last-spawn-error.log`,r].map(e=>L(t,e)).filter(e=>z(e))}:{files:[]}}function Qe(e){let t=L(e,`.ok`,`local`,`logs`);return z(t)?{files:[`server-current.jsonl`,`server-prev.jsonl`].map(e=>L(t,e)).filter(e=>z(e))}:{files:[]}}function $e(e){let t=0,n=new Map,r=e.replace(/("(?:docName|doc\.name|documentName)"\s*:\s*")((?:[^"\\]|\\.)*)"/g,(e,r,i)=>{t+=1;let a=n.get(i);return a===void 0&&(a=`doc#${Ae(`sha256`).update(i).digest(`hex`).slice(0,12)}`,n.set(i,a)),`${r}${a}"`});for(let[e,i]of[...n].sort(([e],[t])=>t.length-e.length)){if(e.length===0||!r.includes(e))continue;let n=r.split(e);t+=n.length-1,r=n.join(i)}return{text:r,count:t}}function et(e){let t=e.revealDocNames?e.content:$e(e.content).text;if(e.redact){let{redacted:n,patterns:r,lineCount:i}=c(t);e.zipfile.addBuffer(Buffer.from(n,`utf8`),e.name),e.bundleFiles.push(e.name),r.length>0&&e.redactions.push({file:e.name,lineCount:i,patterns:r})}else e.zipfile.addBuffer(Buffer.from(t,`utf8`),e.name),e.bundleFiles.push(e.name)}function K(e){for(let t of e.files)try{et({zipfile:e.zipfile,name:`${e.prefix}/${F(t)}`,content:V(t,`utf8`),redact:e.redact,revealDocNames:e.revealDocNames,bundleFiles:e.bundleFiles,redactions:e.redactions})}catch(n){e.logger?.warn({file:t,prefix:e.prefix,err:n},`bug-report: skipped unreadable file`)}}async function tt(t){let{redact:n,outputPath:r,logger:i}=t,a=t.revealDocNames??!1,c=t.userLogsDir??L(W(),`.ok`,`logs`),l=t.projectDir?He(t.projectDir,i):null;B(I(r),{recursive:!0}),i?.info({projectSlug:l},`gathering diagnostic data`);let u=Ue();u.desktop=t.desktop??null,u.language=t.language??null;let{files:d,excludedByProjectSlug:f}=Xe(l,c),{files:p}=t.projectDir?Ze(t.projectDir):{files:[]},{files:m}=t.projectDir?Qe(t.projectDir):{files:[]},h=t.shipItLogFiles??[];i?.info({logFileCount:d.length,logFilesExcludedByProjectSlug:f,lockFileCount:p.length,localSinkFileCount:m.length,shipItLogFileCount:h.length},`files collected`);let g=[],_=[],{ZipFile:v}=await import(`./yazl-BwMlCqRQ.mjs`).then(t=>e(t.default,1)),y=new v;K({zipfile:y,files:[...d,...h],prefix:`logs`,redact:n,revealDocNames:a,bundleFiles:_,redactions:g,logger:i}),K({zipfile:y,files:p,prefix:`lockdir`,redact:n,revealDocNames:a,bundleFiles:_,redactions:g,logger:i}),K({zipfile:y,files:m,prefix:`local-logs`,redact:n,revealDocNames:a,bundleFiles:_,redactions:g,logger:i}),K({zipfile:y,files:t.bugReportLedgerFiles??[],prefix:o,redact:n,revealDocNames:a,bundleFiles:_,redactions:g,logger:i});for(let e of t.extraFiles??[])try{let t=V(e.sourcePath),n=`extra/${e.zipName??F(e.sourcePath)}`;y.addBuffer(t,n),_.push(n)}catch(t){i?.warn({sourcePath:e.sourcePath,err:t},`extra file unreadable; omitted from bundle`)}t.note&&et({zipfile:y,name:`note.txt`,content:t.note,redact:n,revealDocNames:a,bundleFiles:_,redactions:g});let b=JSON.stringify(u,null,2);y.addBuffer(Buffer.from(b,`utf8`),`sysinfo.json`),_.push(`sysinfo.json`);let x={generatedAt:new Date().toISOString(),disciplineVersion:`1.0.0`,projectSlug:l,files:_,redactions:g,sysinfo:u};y.addBuffer(Buffer.from(JSON.stringify(x,null,2),`utf8`),`MANIFEST.json`);let S=g.reduce((e,t)=>e+t.lineCount,0),C=new Set(h.map(e=>`logs/${F(e)}`)),w=_.filter(e=>C.has(e)),T=new Set((t.bugReportLedgerFiles??[]).map(e=>`${o}/${F(e)}`)),E=_.filter(e=>T.has(e)),D=l?_.filter(e=>e.startsWith(`logs/`)&&!Ge(e)&&!C.has(e)):[],O=[`# Bug Report Bundle`,``,`Generated: ${x.generatedAt}`,`Project: ${l??`(unscoped)`}`,`Discipline version: ${x.disciplineVersion}`,``,`## Contents`,``,..._.map(e=>`- ${e}`),``,`## Privacy`,``,...D.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:`,...D.map(e=>`- ${e}`),``]:[],...w.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:`,...w.map(e=>`- ${e}`),``]:[],...E.length>0?[`Send history: a small record for each bug report previously generated`,`on this machine — when it was generated, whether sending it`,`succeeded, and why it failed if it did. This is what makes a failed`,`send diagnosable at all. It is machine-wide rather than scoped to`,`this project, so it names the other projects reports were filed`,`from. It carries no document content:`,...E.map(e=>`- ${e}`),``]:[],...n?[`This bundle was auto-redacted before packaging.`,`Patterns checked: ${s.join(`, `)}`,S>0?`${S} line(s) were scrubbed across ${g.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
|
`);y.addBuffer(Buffer.from(O,`utf8`),`README.md`),y.end();let k=he(r);return y.outputStream.pipe(k),await new Promise((e,t)=>{k.on(`close`,e),k.on(`error`,t)}),i?.info({bundlePath:r,fileCount:_.length,redactionCount:S},`bundle written`),{zipPath:r,summary:{projectSlug:l,files:_,redactions:g,redactedLineCount:S,generatedAt:x.generatedAt}}}var nt=e(k(),1),q=e(te(),1);function rt(e){return x({absPath:y(`user`,e,e),sideline:!1,warn:()=>{}}).value.appearance?.language??`system`}function it({home:e=W(),env:r=process.env}={}){let i=rt(e),{override:a,preferenceList:o}=S(r),{locale:s,source:c}=l({override:a,storedPreference:i,supportedLocales:t,preferenceList:o,autoDetectableLocales:n});return{preference:i,locale:s,source:c,systemLanguages:o}}function at(e,t){return t.length===0||!e.includes(t)?e:e.split(t).join(`<CONTENT_DIR>`)}function ot(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function J(e,t){if(typeof e==`string`)return at(e,t.contentDir);if(Array.isArray(e))return e.map(e=>J(e,t));if(!ot(e))return e;let n={};for(let[r,i]of Object.entries(e))n[r]=J(i,t);return n}function st(e,t){let n=V(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=J(JSON.parse(n),t);a.push(JSON.stringify(e))}catch{a.push(n)}}}U(e,r?`${a.join(`
|
|
@@ -17,4 +17,4 @@ import{o as e}from"./chunk-DTipWd-i.mjs";import{$ as t,Q as n,n as r,r as i,yt a
|
|
|
17
17
|
`).replace(/\n/g,`\r
|
|
18
18
|
`));let u=`${i?``:``}${l}`;return u!==r&&b(e,u,{mode:P(e)}),{kind:`removed`}}function xn(e){return e==null?!1:e.includes(`--type=utility`)&&e.includes(`--utility-sub-type=node.mojom.NodeService`)}function Sn(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 Cn(e,t,n,r){if(t.status===`missing`||t.status===`corrupt`)return null;let i=t.lock,a=t.status===`alive`&&O(i)?{port:i.port,status:t.status,pid:i.pid,startedAt:i.startedAt,usage:r}:null;return{directory:i.worktreeRoot,server:{port:i.port,status:t.status,pid:i.pid,startedAt:i.startedAt,usage:r},ui:a,hostname:i.hostname,lockPath:t.lockPath,binary:n==null?null:p(n),command:n,isDesktop:xn(n)}}function $(e){let t=e.server.status;return t===`alive`||t===`foreign-host`?e.isDesktop?`desktop`:t===`alive`?`running`:`foreign`:`stale`}const wn=new Set([`running`,`desktop`,`foreign`]);function Tn(e){switch(e){case`running`:return q.default.green(e);case`desktop`:return q.default.blue(e);case`foreign`:return q.default.cyan(e);case`stale`:return q.default.yellow(e)}}function En(e){return e==null?`—`:`${e.cpuPercent.toFixed(1)}% / ${e.memPercent.toFixed(1)}%`}function Dn(e){return`${En(e.server.usage)} | ${En(e.ui?.usage??null)}`}function On(e){return`${e.server.port===0?`(starting)`:String(e.server.port)} / ${e.ui==null?`—`:String(e.ui.port)}`}function kn(e){if(e.length===0)return`No open-knowledge servers found.`;let t=[`DIRECTORY`,`PORTS (API/UI)`,`CPU/MEM (API | UI)`,`STATUS`,`PID`,`STARTED`,`BINARY`],n=e.map(e=>[e.directory,On(e),Dn(e),$(e),String(e.server.pid),Sn(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=Tn($(e))+` `.repeat(Math.max(0,(i[t]??0)-r.length))}o.push(n)}return o.join(` `).trimEnd()}),s=q.default.dim(`To stop a server: ok stop <port|pid|directory|all>`);return[a,...o,``,s].join(`
|
|
19
19
|
`)}async function An(e={}){let t=e.discover??_,n=e.inspect??(e=>Q(e,`server`)),r=e.log??(e=>console.log(e)),i=e.resolveCommand??h,a=e.resolveUsage??v,o=await t(),s=[];for(let e of o){let t=n(e),r=Cn(e,t,t.status===`missing`||t.status===`corrupt`?null:i(t.lock.pid),t.status===`missing`||t.status===`corrupt`?null:a(t.lock.pid));r!=null&&s.push(r)}if(e.json){let e=s.map(e=>({...e,displayStatus:$(e)}));r(JSON.stringify(e,null,2));return}r(kn(e.all?s:s.filter(e=>wn.has($(e)))))}function jn(){return new j(`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 An({all:t.all===!0||e===`all`,json:t.json===!0})})}async function Mn(e,t=Ne()){let n=Q(e,`server`);if(n.status!==`alive`&&n.status!==`foreign-host`)return null;let r=E(n.lock);if(r===null)return null;try{let n=await fetch(`${r}/api/server-info`,{signal:AbortSignal.timeout(1500)});if(!n.ok)return t?.warn({lockDir:e,baseUrl:r,outcome:`http-error`,status:n.status},`stop client-probe failed`),null;let i=(await n.json())?.collabClients;return typeof i==`number`&&Number.isFinite(i)?i:(t?.warn({lockDir:e,baseUrl:r,outcome:`no-client-count`,received:typeof i},`stop client-probe failed`),null)}catch(n){return t?.warn({lockDir:e,baseUrl:r,outcome:`unreachable`,err:n},`stop client-probe failed`),null}}function Nn(e,t={}){return{targets:Fn(e,t.isAlive??w)?[{name:`server`,pid:e.lock.pid,port:e.lock.port}]:[]}}async function Pn(e){let t=e.inspect??(()=>Q(e.lockDir,`server`)),n=e.kill??((e,t)=>process.kill(e,t)),r=e.log??(e=>console.log(e)),i=e.error??(e=>console.error(e)),a=e.probeClients??Mn,o=e.logger??Ne(),s=Nn(t(),{isAlive:e.isAlive});if(s.targets.length===0)return r(`No running open-knowledge processes.`),o?.info({lockDir:e.lockDir,targets:0},`stop found nothing to signal`),{stopped:[],failed:[],hadTargets:!1};if(e.force!==!0){let t=await a(e.lockDir,o);if(t!==null&&t>0)return i(`Not stopping: ${t} collaboration client${t===1?``:`s`} (editor window${t===1?``:`s`} or agents) still connected to the server at ${e.lockDir}. Close them, or re-run with --force to terminate anyway.`),o?.warn({lockDir:e.lockDir,clients:t,pids:s.targets.map(e=>e.pid)},`stop declined: live collaboration clients`),{stopped:[],failed:[],hadTargets:!0,declined:{clients:t}}}let c=[],l=[];for(let e of s.targets)try{n(e.pid,`SIGTERM`),c.push(e)}catch(t){l.push({target:e,error:t instanceof Error?t.message:String(t)})}return c.length>0&&r(`Stopped: ${c.map(e=>`${e.name} (pid=${e.pid}, port=${e.port})`).join(`, `)}`),o?.info({lockDir:e.lockDir,signalled:c.map(e=>({name:e.name,pid:e.pid,port:e.port})),failed:l.map(({target:e,error:t})=>({pid:e.pid,error:t})),forced:e.force===!0},`stop signalled processes`),l.length>0&&i(`Failed to stop: ${l.map(({target:e,error:t})=>`${e.name} (pid=${e.pid}): ${t}`).join(`; `)}`),{stopped:c,failed:l,hadTargets:!0}}function Fn(e,t){return e.status===`alive`?!0:e.status===`foreign-host`?t(e.lock.pid):!1}async function In(e,t=w){let n=await _(),r=null;for(let i of n){let n=Q(i,`server`);if(Fn(n,t)){if(n.lock.port===e)return i;r===null&&n.lock.pid===e&&(r=i)}}return r}async function Ln(e,t){let n=await Pn({lockDir:e,force:t});return(n.failed.length>0||n.declined!==void 0)&&(process.exitCode=1),n}function Rn(e,t,n={}){return t===0?`Nothing was running for ${e}, and no other open-knowledge servers are running.`:`Nothing was running for ${e}. ${t} other open-knowledge server${t===1?` is`:`s are`} running${n.listingFollows===!0?``:" — run `ok ps` to list them"}.`}async function zn(e){let t=await _(),n=0;for(let r of t)r!==e&&Fn(Q(r,`server`),w)&&n++;return n}function Bn(e){return new j(`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"`).option(`--force`,`Stop even when editor windows or agents are still connected to the server`).action(async(t,n)=>{let r=n.force===!0,i=t.length===0?void 0:t.join(` `);if(i===void 0){e();let t=g(process.cwd()),n=await Pn({lockDir:t,force:r,log:()=>{}});if(n.hadTargets){if(n.stopped.length>0){let e=n.stopped.map(e=>`${e.name} (pid=${e.pid}, port=${e.port})`).join(`, `);console.log(`Stopped: ${e}`)}(n.failed.length>0||n.declined!==void 0)&&(process.exitCode=1)}else{let e=await zn(t);console.log(Rn(process.cwd(),e,{listingFollows:e>0})),e>0&&await An({})}return}if(i===`all`){let e=await _();if(e.length===0){console.log(`No running open-knowledge servers found.`);return}let t=0;for(let n of e)Fn(Q(n,`server`),w)&&(await Ln(n,r),t++);t===0&&console.log(`No running open-knowledge servers found.`);return}if(/^\d+$/.test(i)){let e=Number.parseInt(i,10),t=await In(e);if(t===null){console.log(`No running open-knowledge server found with port or PID ${e}.`);return}await Ln(t,r);return}let a=R(Be(),i),o=g(a),s=[],c=await Pn({lockDir:o,force:r,log:e=>s.push(e)});if((c.failed.length>0||c.declined!==void 0)&&(process.exitCode=1),c.hadTargets)for(let e of s)console.log(e);else console.log(Rn(a,await zn(o)))})}export{Fe as S,G as _,_n as a,Le as b,un as c,cn as d,Q as f,Ve as g,nn as h,jn as i,fn as l,tn as m,Pn as n,ln as o,on as p,Bn as r,mn as s,Mn as t,pn as u,Be as v,Ne as x,ze as y};
|
|
20
|
-
//# sourceMappingURL=src-
|
|
20
|
+
//# sourceMappingURL=src-BiHf8piw.mjs.map
|