@inkeep/open-knowledge 0.59.0-beta.40 → 0.59.0-beta.42
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-CqyXU5gq.mjs +6 -0
- package/dist/cli.mjs +60 -60
- package/dist/constants-C8qimQe2.mjs +2 -0
- package/dist/index.d.mts +112 -1
- package/dist/index.mjs +206 -203
- package/dist/{init-DJQw_oSo.mjs → init-BALL45ev.mjs} +43 -43
- package/dist/init-XQ5681Ov.mjs +1 -0
- package/dist/{launch-json-removal-D9jr3Cym.mjs → launch-json-removal-TNatfsf_.mjs} +2 -2
- package/dist/{loader-lM2dlAdG.mjs → loader-7-3iPTYi.mjs} +2 -2
- package/dist/loader-D_O3xgpG.mjs +1 -0
- package/dist/{open-browser-CldvWM5B.mjs → open-browser-Ch6OlrUp.mjs} +2 -2
- package/dist/{preview-P4lIN2Xz.mjs → preview-BFzV6mP_.mjs} +2 -2
- package/dist/preview-cfoQaK2M.mjs +1 -0
- package/dist/public/assets/{ActivityModeContent-B6cXYk7E.js → ActivityModeContent-x8iSkUrB.js} +1 -1
- package/dist/public/assets/{AgentDiffPane-Bh5zJLhI.js → AgentDiffPane-DIfBCWO1.js} +1 -1
- package/dist/public/assets/{AgentThreadClientBinder-DXqc9G_d.js → AgentThreadClientBinder-C1JrAGMt.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-ONJdKGBm.js → CodeMirrorPropInput-BM_u3lg7.js} +1 -1
- package/dist/public/assets/{DocumentContext-CoYCdUTn.js → DocumentContext-D4Y47Klw.js} +1 -1
- package/dist/public/assets/EditorModeToggle-bPu1-wXx.js +1 -0
- package/dist/public/assets/EnableSyncConfirmDialog-B8vwEx-G.js +1 -0
- package/dist/public/assets/{ExcalidrawDocEditor-DESqJPaH.js → ExcalidrawDocEditor-CZaikE7U.js} +1 -1
- package/dist/public/assets/FeedbackForm-DficBQ0g.js +1 -0
- package/dist/public/assets/{ImportSkillDialog-CUfIX2Eq.js → ImportSkillDialog-bAaKE04j.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-DeQ2Zl6N.js → LintConfigEditor-CdU9ili0.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-BnpBJJIl.js +1 -0
- package/dist/public/assets/{ManagedArtifactProperties-C0w77LVG.js → ManagedArtifactProperties-L9Q_a2lq.js} +1 -1
- package/dist/public/assets/McpConsentDialogBody-BFXgHBtR.js +1 -0
- package/dist/public/assets/{MermaidDocEditor-DxmG30L8.js → MermaidDocEditor-Ck0DClOn.js} +1 -1
- package/dist/public/assets/{PropertyDisplayRow-B6rCTA9W.js → PropertyDisplayRow-D9vgrQxy.js} +1 -1
- package/dist/public/assets/{SchemaConfigEditor-C1OVUId-.js → SchemaConfigEditor-BJraSvhl.js} +1 -1
- package/dist/public/assets/{SessionsHost-DfN_SR22.js → SessionsHost-DnEPyu0P.js} +2 -2
- package/dist/public/assets/SettingsDialogBody-D6iWh9MU.js +13 -0
- package/dist/public/assets/{ShareReceiveMissDialog-Dv1AenCZ.js → ShareReceiveMissDialog-CZn_-Jit.js} +1 -1
- package/dist/public/assets/{SkillInstallMenu-ChmuKg2U.js → SkillInstallMenu-DJppC3wU.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-CfDZO8oD.js → SkillToolbarControls-z2sLIYRw.js} +1 -1
- package/dist/public/assets/SourceEditor-0j1ZvL-h.js +1 -0
- package/dist/public/assets/{TerminalPanel-03FSZaXv.js → TerminalPanel-DboHU8Nj.js} +1 -1
- package/dist/public/assets/{TerminalWindowApp-D243fYSc.js → TerminalWindowApp-BxcVh58X.js} +1 -1
- package/dist/public/assets/{TextDocEditor-CKfjEUc-.js → TextDocEditor-qBjuCIxn.js} +1 -1
- package/dist/public/assets/ThemePicker-BEO3X5aw.js +1 -0
- package/dist/public/assets/{ThreadView-D9vhfjoU.js → ThreadView-DE0GIwNP.js} +4 -4
- package/dist/public/assets/{TimelineDiffPane-DpxUnCr7.js → TimelineDiffPane-hXIZ6EEv.js} +1 -1
- package/dist/public/assets/{agent-diff-store-S2i2o6of.js → agent-diff-store-CSsM5NtK.js} +1 -1
- package/dist/public/assets/{auth-state-cache-CyUM6zjr.js → auth-state-cache-VX6Ik25_.js} +2 -2
- package/dist/public/assets/{comment-chips-CoL6Cjh4.js → comment-chips-D64XvN0P.js} +1 -1
- package/dist/public/assets/config-provider-GSYWEpD8.js +5 -0
- package/dist/public/assets/i18n-BILgtwZc.js +1 -0
- package/dist/public/assets/{index-BEbGyHpc.js → index-DBGm6kcd.js} +9 -9
- package/dist/public/assets/messages-BBOavCsg.js +1 -0
- package/dist/public/assets/messages-BLwf6BPC.js +1 -0
- package/dist/public/assets/messages-BWoDaP3l.js +1 -0
- package/dist/public/assets/messages-CJc6Fwhy.js +1 -0
- package/dist/public/assets/messages-CVX6T0zf.js +1 -0
- package/dist/public/assets/messages-Cctjaczm.js +1 -0
- package/dist/public/assets/messages-D7ueLI0N.js +1 -0
- package/dist/public/assets/messages-Do2GOztj.js +1 -0
- package/dist/public/assets/messages-DpWEt-bz.js +1 -0
- package/dist/public/assets/messages-QZSRIG9j.js +1 -0
- package/dist/public/assets/messages-_lezxuNr.js +1 -0
- package/dist/public/assets/messages-fK0eB8Up.js +1 -0
- package/dist/public/assets/{pending-receive-nav-store-BmPJ0hig.js → pending-receive-nav-store-BOj8hp8p.js} +1 -1
- package/dist/public/assets/{progress-BI1WoFwX.js → progress-D4lLincY.js} +1 -1
- package/dist/public/assets/{selection-context-BIBH9g3O.js → selection-context-rll1jeSE.js} +1 -1
- package/dist/public/assets/skill-actions-B9TcWw8x.js +1 -0
- package/dist/public/assets/{src-7zCAXVHf.js → src-DKz7yeHs.js} +1 -1
- package/dist/public/assets/thread-client-BUOJIDSk.js +1 -0
- package/dist/public/assets/{typing-burst-detector-BNdl6EaU.js → typing-burst-detector-DOvugHVv.js} +1 -1
- package/dist/public/assets/{uninstall-nSAdScfe.js → uninstall-ByzOPpbn.js} +1 -1
- package/dist/public/assets/{use-activity-panel-BUNW6oNK.js → use-activity-panel-Dqy4KlBO.js} +1 -1
- package/dist/public/assets/use-apply-config-color-theme-Nqcqbuav.js +1 -0
- package/dist/public/assets/use-apply-config-theme-B1eLRQeV.js +1 -0
- package/dist/public/assets/{use-live-xterm-theme-DuH9FKgs.js → use-live-xterm-theme-CxDATY-d.js} +1 -1
- package/dist/public/assets/{use-open-skill-Bjriumns.js → use-open-skill-CQShwRGi.js} +1 -1
- package/dist/public/assets/{use-popular-skills-HmcJCaX6.js → use-popular-skills-B1364QHD.js} +1 -1
- package/dist/public/assets/use-terminal-enabled-7wVxmd56.js +1 -0
- package/dist/public/assets/{use-timeline-entry-diff-DijUR0V_.js → use-timeline-entry-diff-Vvj7EP3T.js} +1 -1
- package/dist/public/index.html +24 -24
- package/dist/public/uninstall.html +3 -3
- package/dist/{repair-launch-json-CdSGcXNS.mjs → repair-launch-json-BOo07iVX.mjs} +2 -2
- package/dist/{repair-mcp-configs-6T3iELeJ.mjs → repair-mcp-configs-CFosU-ui.mjs} +2 -2
- package/dist/{repair-skills-DdLknuYw.mjs → repair-skills-BzH72pUo.mjs} +3 -3
- package/dist/repair-skills-Drrx-xv7.mjs +1 -0
- package/dist/{resolve-project-root-CHFE5Tp7.mjs → resolve-project-root-CXTFWDeF.mjs} +3 -3
- package/dist/{skill-teardown-DcAF7q_b.mjs → skill-teardown-D5P-vpe_.mjs} +2 -2
- package/dist/src-67yUma5a.mjs +20 -0
- package/dist/src-CNeIF6hC.mjs +1 -0
- package/dist/src-CpD0HabK.mjs +2029 -0
- package/dist/src-Cqd_6rOD.mjs +1 -0
- package/dist/start-2NeresgM.mjs +1 -0
- package/dist/start-Dl3pKcwO.mjs +4 -0
- package/package.json +4 -4
- package/dist/acp-harness-probe-BXaEG9XN.mjs +0 -3
- package/dist/constants-DzwYLdlF.mjs +0 -2
- package/dist/init-DiyB7t8-.mjs +0 -1
- package/dist/loader-DN5VV8rd.mjs +0 -1
- package/dist/preview-DfNrt9nH.mjs +0 -1
- package/dist/public/assets/EditorModeToggle-Cvt1TW83.js +0 -1
- package/dist/public/assets/EnableSyncConfirmDialog-CAa7STLG.js +0 -1
- package/dist/public/assets/FeedbackForm-Be8PVK4s.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-C-2tXobc.js +0 -1
- package/dist/public/assets/McpConsentDialogBody-sqWpWPQc.js +0 -1
- package/dist/public/assets/SettingsDialogBody-zm5oYc1W.js +0 -13
- package/dist/public/assets/SourceEditor-CmjhgcpS.js +0 -1
- package/dist/public/assets/config-context-BH8hj2sg.js +0 -1
- package/dist/public/assets/config-provider-BEy0uWv0.js +0 -5
- package/dist/public/assets/i18n-DgDGD96k.js +0 -1
- package/dist/public/assets/messages-CUxjY1bg.js +0 -1
- package/dist/public/assets/messages-CbJcA1a-.js +0 -1
- package/dist/public/assets/messages-CcamDXr_.js +0 -1
- package/dist/public/assets/messages-CoC8VCIg.js +0 -1
- package/dist/public/assets/messages-DBHRMUAC.js +0 -1
- package/dist/public/assets/messages-DayldphK.js +0 -1
- package/dist/public/assets/messages-NxV5iFe4.js +0 -1
- package/dist/public/assets/messages-TD09LIiN.js +0 -1
- package/dist/public/assets/messages-_8bTGBiH.js +0 -1
- package/dist/public/assets/messages-eTs_IzNw.js +0 -1
- package/dist/public/assets/messages-j2csGD4E.js +0 -1
- package/dist/public/assets/messages-lFIWwgmW.js +0 -1
- package/dist/public/assets/skill-actions-D5hCSoeU.js +0 -1
- package/dist/public/assets/sun-D7hLUh5f.js +0 -1
- package/dist/public/assets/thread-client-BprEkf79.js +0 -1
- package/dist/public/assets/use-apply-config-color-theme-DPzjfJfO.js +0 -1
- package/dist/public/assets/use-terminal-enabled-UtVaQQM1.js +0 -1
- package/dist/repair-skills-CS2_jKX3.mjs +0 -1
- package/dist/src-B8QX7oNJ.mjs +0 -20
- package/dist/src-BoSNO_uo.mjs +0 -1
- package/dist/src-CKvbaaFV.mjs +0 -2029
- package/dist/src-nk8WfDCB.mjs +0 -1
- package/dist/start-CoLYZ46p.mjs +0 -1
- package/dist/start-DzgWu5RH.mjs +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e,o as t,t as n}from"./chunk-DTipWd-i.mjs";import{As as r,Ps as i,Rs as a,ks as o,xs as s}from"./src-BD1wHyiU.mjs";import{
|
|
1
|
+
import{i as e,o as t,t as n}from"./chunk-DTipWd-i.mjs";import{As as r,Ps as i,Rs as a,ks as o,xs as s}from"./src-BD1wHyiU.mjs";import{Dn as c,Mi as l,Pr as u,mn as d,pr as f}from"./src-CpD0HabK.mjs";import{execFileSync as p}from"node:child_process";import{basename as m,dirname as h,isAbsolute as g,join as _,posix as v,relative as y,resolve as b,sep as x,win32 as S}from"node:path";import{cpSync as ee,existsSync as C,lstatSync as te,mkdirSync as ne,readFileSync as re,realpathSync as w,rmSync as ie,statSync as ae}from"node:fs";import{homedir as T}from"node:os";var E=n((e=>{var t=class extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},n=class extends t{constructor(e){super(1,`commander.invalidArgument`,e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};e.CommanderError=t,e.InvalidArgumentError=n})),D=n((e=>{let{InvalidArgumentError:t}=E();var n=class{constructor(e,t){switch(this.description=t||``,this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case`<`:this.required=!0,this._name=e.slice(1,-1);break;case`[`:this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.endsWith(`...`)&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,n)=>{if(!this.argChoices.includes(e))throw new t(`Allowed choices are ${this.argChoices.join(`, `)}.`);return this.variadic?this._collectValue(e,n):e},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function r(e){let t=e.name()+(e.variadic===!0?`...`:``);return e.required?`<`+t+`>`:`[`+t+`]`}e.Argument=n,e.humanReadableArgName=r})),O=n((e=>{let{humanReadableArgName:t}=D();var n=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let t=e.commands.filter(e=>!e._hidden),n=e._getHelpCommand();return n&&!n._hidden&&t.push(n),this.sortSubcommands&&t.sort((e,t)=>e.name().localeCompare(t.name())),t}compareOptions(e,t){let n=e=>e.short?e.short.replace(/^-/,``):e.long.replace(/^--/,``);return n(e).localeCompare(n(t))}visibleOptions(e){let t=e.options.filter(e=>!e.hidden),n=e._getHelpOption();if(n&&!n.hidden){let r=n.short&&e._findOption(n.short),i=n.long&&e._findOption(n.long);!r&&!i?t.push(n):n.long&&!i?t.push(e.createOption(n.long,n.description)):n.short&&!r&&t.push(e.createOption(n.short,n.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let n=e.parent;n;n=n.parent){let e=n.options.filter(e=>!e.hidden);t.push(...e)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||``}),e.registeredArguments.find(e=>e.description)?e.registeredArguments:[]}subcommandTerm(e){let n=e.registeredArguments.map(e=>t(e)).join(` `);return e._name+(e._aliases[0]?`|`+e._aliases[0]:``)+(e.options.length?` [options]`:``)+(n?` `+n:``)}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(n)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(n)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+`|`+e._aliases[0]);let n=``;for(let t=e.parent;t;t=t.parent)n=t.name()+` `+n;return n+t+` `+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue==`boolean`)&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,t,n){return t.length===0?[]:[n.styleTitle(e),...t,``]}groupItems(e,t,n){let r=new Map;return e.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[])}),t.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[]),r.get(t).push(e)}),r}formatHelp(e,t){let n=t.padWidth(e,t),r=t.helpWidth??80;function i(e,r){return t.formatItem(e,n,r,t)}let a=[`${t.styleTitle(`Usage:`)} ${t.styleUsage(t.commandUsage(e))}`,``],o=t.commandDescription(e);o.length>0&&(a=a.concat([t.boxWrap(t.styleCommandDescription(o),r),``]));let s=t.visibleArguments(e).map(e=>i(t.styleArgumentTerm(t.argumentTerm(e)),t.styleArgumentDescription(t.argumentDescription(e))));if(a=a.concat(this.formatItemList(`Arguments:`,s,t)),this.groupItems(e.options,t.visibleOptions(e),e=>e.helpGroupHeading??`Options:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),t.showGlobalOptions){let n=t.visibleGlobalOptions(e).map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(`Global Options:`,n,t))}return this.groupItems(e.commands,t.visibleCommands(e),e=>e.helpGroup()||`Commands:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleSubcommandTerm(t.subcommandTerm(e)),t.styleSubcommandDescription(t.subcommandDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),a.join(`
|
|
2
2
|
`)}displayWidth(e){return r(e).length}styleTitle(e){return e}styleUsage(e){return e.split(` `).map(e=>e===`[options]`?this.styleOptionText(e):e===`[command]`?this.styleSubcommandText(e):e[0]===`[`||e[0]===`<`?this.styleArgumentText(e):this.styleCommandText(e)).join(` `)}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(` `).map(e=>e===`[options]`?this.styleOptionText(e):e[0]===`[`||e[0]===`<`?this.styleArgumentText(e):this.styleSubcommandText(e)).join(` `)}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,t,n,r){let i=` `.repeat(2);if(!n)return i+e;let a=e.padEnd(t+e.length-r.displayWidth(e)),o=(this.helpWidth??80)-t-2-2,s;return s=o<this.minWidthToWrap||r.preformatted(n)?n:r.boxWrap(n,o).replace(/\n/g,`
|
|
3
3
|
`+` `.repeat(t+2)),i+a+` `.repeat(2)+s.replace(/\n/g,`\n${i}`)}boxWrap(e,t){if(t<this.minWidthToWrap)return e;let n=e.split(/\r\n|\n/),r=/[\s]*[^\s]+/g,i=[];return n.forEach(e=>{let n=e.match(r);if(n===null){i.push(``);return}let a=[n.shift()],o=this.displayWidth(a[0]);n.forEach(e=>{let n=this.displayWidth(e);if(o+n<=t){a.push(e),o+=n;return}i.push(a.join(``));let r=e.trimStart();a=[r],o=this.displayWidth(r)}),i.push(a.join(``))}),i.join(`
|
|
4
4
|
`)}};function r(e){return e.replace(/\x1b\[\d*(;\d*)*m/g,``)}e.Help=n,e.stripColor=r})),k=n((e=>{let{InvalidArgumentError:t}=E();var n=class{constructor(e,t){this.flags=e,this.description=t||``,this.required=e.includes(`<`),this.optional=e.includes(`[`),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=a(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith(`--no-`)),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return typeof e==`string`&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,n)=>{if(!this.argChoices.includes(e))throw new t(`Allowed choices are ${this.argChoices.join(`, `)}.`);return this.variadic?this._collectValue(e,n):e},this}name(){return this.long?this.long.replace(/^--/,``):this.short.replace(/^-/,``)}attributeName(){return this.negate?i(this.name().replace(/^no-/,``)):i(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},r=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(e=>{e.negate?this.negativeOptions.set(e.attributeName(),e):this.positiveOptions.set(e.attributeName(),e)}),this.negativeOptions.forEach((e,t)=>{this.positiveOptions.has(t)&&this.dualOptions.add(t)})}valueFromOption(e,t){let n=t.attributeName();if(!this.dualOptions.has(n))return!0;let r=this.negativeOptions.get(n).presetArg,i=r===void 0?!1:r;return t.negate===(i===e)}};function i(e){return e.split(`-`).reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function a(e){let t,n,r=/^-[^-]$/,i=/^--[^-]/,a=e.split(/[ |,]+/).concat(`guard`);if(r.test(a[0])&&(t=a.shift()),i.test(a[0])&&(n=a.shift()),!t&&r.test(a[0])&&(t=a.shift()),!t&&i.test(a[0])&&(t=n,n=a.shift()),a[0].startsWith(`-`)){let t=a[0],n=`option creation failed due to '${t}' in option flags '${e}'`;throw/^-[^-][^-]/.test(t)?Error(`${n}
|
|
@@ -52,5 +52,5 @@ foreach ($d in $dirs) {
|
|
|
52
52
|
if (Test-Path -LiteralPath $probe -PathType Leaf) { & $probe -y '@inkeep/open-knowledge@latest' mcp; exit $LASTEXITCODE }
|
|
53
53
|
}
|
|
54
54
|
[Console]::Error.WriteLine('OpenKnowledge: install Node.js 24+ (npm i -g @inkeep/open-knowledge), then restart your editor')
|
|
55
|
-
exit 127`,I=`// ok-pi-bridge`,L=`${I}-v1`,be=`ok-pi-managed-extension`;function xe(e){if(typeof e!=`object`||!e)return!1;let t=e;if(t.command===`/bin/sh`){if(!Array.isArray(t.args)||t.args[0]!==`-l`||t.args[1]!==`-c`)return!1;let e=t.args[2];return typeof e==`string`&&e.includes(`# ok-mcp-v2`)}if(t.command===`powershell`){if(!Array.isArray(t.args)||t.args[0]!==`-NoProfile`||t.args[1]!==`-NonInteractive`||t.args[2]!==`-Command`)return!1;let e=t.args[3];return typeof e==`string`&&e.includes(`# ok-mcp-win-v1`)}if(t.type===`local`&&Array.isArray(t.command)){if(t.command[0]===`/bin/sh`){if(t.command[1]!==`-l`||t.command[2]!==`-c`)return!1;let e=t.command[3];return typeof e==`string`&&e.includes(`# ok-mcp-v2`)}if(t.command[0]===`powershell`){if(t.command[1]!==`-NoProfile`||t.command[2]!==`-NonInteractive`||t.command[3]!==`-Command`)return!1;let e=t.command[4];return typeof e==`string`&&e.includes(`# ok-mcp-win-v1`)}return!1}if(t.command===`ok-pi-managed-extension`){if(!Array.isArray(t.args))return!1;let e=t.args[0];return typeof e==`string`&&e.startsWith(L)}return!1}function R(e=process.argv[1]){if(!e)throw Error(`Cannot infer the local CLI entry for --dev-mcp because process.argv[1] is empty.`);let t=b(e);if(m(t)===`cli.mjs`&&m(h(t))===`dist`)return t;let n=t.split(x),r=n.lastIndexOf(`packages`);if(r===-1||n[r+1]!==`cli`)throw Error(`Cannot infer the repo root for --dev-mcp from ${t}. Run the local CLI from this repo so the built dist path can be derived.`);let i=n.slice(0,r);return _(i.length===0?x:i.join(x),`packages`,`cli`,`dist`,`cli.mjs`)}function z(e={}){return e.mode===`dev`?{command:M,args:[R(),`mcp`],env:{...N}}:(e.platformName??process.platform)===`win32`?{command:`powershell`,args:[`-NoProfile`,`-NonInteractive`,`-Command`,F]}:{command:`/bin/sh`,args:[`-l`,`-c`,P]}}function Se(e={}){return e.mode===`dev`?{type:`local`,enabled:!0,command:[M,R(),`mcp`],environment:{...N}}:(e.platformName??process.platform)===`win32`?{type:`local`,enabled:!0,command:[`powershell`,`-NoProfile`,`-NonInteractive`,`-Command`,F]}:{type:`local`,enabled:!0,command:[`/bin/sh`,`-l`,`-c`,P]}}function Ce(e){if(typeof e!=`object`||!e)return!1;let t=e;return B(t,z({mode:`published`,platformName:`darwin`}))||B(t,z({mode:`published`,platformName:`win32`}))}function B(e,t){return Object.keys(e).length===Object.keys(t).length?we(e,t):!1}function we(e,t){if(e.command!==t.command)return!1;let n=t.args;return!Array.isArray(n)||!Array.isArray(e.args)||e.args.length!==n.length?!1:e.args.every((e,t)=>e===n[t])}function V(e,t){let n=e=>typeof e==`string`&&e.includes(`# ok-mcp`);return t===`/bin/sh`?e[0]===`-l`&&e[1]===`-c`&&n(e[2]):t===`powershell`?e[0]===`-NoProfile`&&e[1]===`-NonInteractive`&&e[2]===`-Command`&&n(e[3]):!1}function Te(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.enabled===!1||typeof t.command!=`string`||!Array.isArray(t.args)?!1:V(t.args,t.command)}function Ee(e){if(typeof e!=`object`||!e)return!1;let t=e;if(t.type!==`local`||t.enabled===!1||!Array.isArray(t.command))return!1;let[n,...r]=t.command;return typeof n==`string`&&V(r,n)}function H(e){return e===`win32`?S:v}function De(e={}){let t=e.platformName??process.platform,n=e.home??T(),r=e.env??process.env,i=H(t);return t===`darwin`?i.join(n,`Library`,`Application Support`):t===`win32`?r.APPDATA||i.join(n,`AppData`,`Roaming`):r.XDG_CONFIG_HOME||i.join(n,`.config`)}function U(e={}){let t=e.platformName??process.platform,n=e.home??T();return H(t).join(n,`.claude.json`)}function W(e={}){let t=e.platformName??process.platform,n=e.home??T(),r=e.env??process.env;if(t===`darwin`)return v.join(n,`Library`,`Application Support`,`Claude`,`claude_desktop_config.json`);if(t===`win32`){let e=r.APPDATA??S.join(n,`AppData`,`Roaming`);return S.join(e,`Claude`,`claude_desktop_config.json`)}throw Error(`Claude Desktop is not available on ${t}. Supported: macOS, Windows.`)}function G(e={}){let t=e.platformName??process.platform,n=e.home??T();return H(t).join(n,`.cursor`,`mcp.json`)}function Oe(e={}){let t=e.platformName??process.platform,n=e.home??T();return(e.env??process.env).CODEX_HOME??H(t).join(n,`.codex`)}function K(e={}){return H(e.platformName??process.platform).join(Oe(e),`config.toml`)}function q(e={}){let t=e.platformName??process.platform,n=e.home??T(),r=(e.env??process.env).COPILOT_HOME??H(t).join(n,`.copilot`);return H(t).join(r,`mcp-config.json`)}function ke(e={}){let t=e.platformName??process.platform,n=e.home??T(),r=e.env??process.env,i=H(t);if(t===`win32`){let e=r.APPDATA??i.join(n,`AppData`,`Roaming`);return i.join(e,`opencode`)}let a=r.XDG_CONFIG_HOME??i.join(n,`.config`);return i.join(a,`opencode`)}function J(e={}){return H(e.platformName??process.platform).join(ke(e),`opencode.json`)}function Ae(e={}){let t=e.platformName??process.platform,n=e.home??T();return H(t).join(n,`.openclaw`,`openclaw.json`)}function je(e={}){let t=e.platformName??process.platform,n=e.home??T();return H(t).join(n,`.hermes`,`config.yaml`)}function Me(e={}){let t=e.platformName??process.platform,n=e.home??T();return(e.env??process.env).PI_CODING_AGENT_DIR??H(t).join(n,`.pi`,`agent`)}function Ne(e={}){let t=e.platformName??process.platform,n=e.home??T();return H(t).join(n,`.gemini`,`config`,`mcp_config.json`)}function Pe(e,t){let n=H(t),r=n.join(e,`.lmstudio`,`mcp.json`),i=n.join(e,`.cache`,`lm-studio`,`mcp.json`);return t===`darwin`?[i,r]:[r,i]}function Y(e={}){let t=e.platformName??process.platform,n=Pe(e.home??T(),t);return n.find(e=>C(e))||n.find(e=>C(h(e)))||n[0]}const X={claude:{id:`claude`,label:j.claude,configPath:(e,t)=>U({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>s,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>_(t??T(),`.claude`),projectConfigPath:e=>_(e,`.mcp.json`),projectSkillPath:e=>_(e,`.claude`,`skills`,`open-knowledge`,`SKILL.md`)},"claude-desktop":{id:`claude-desktop`,label:j[`claude-desktop`],configPath:(e,t)=>W({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>s,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>h(W({home:t}))},cursor:{id:`cursor`,label:j.cursor,configPath:(e,t)=>G({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>s,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>h(G({home:t})),projectConfigPath:e=>_(e,`.cursor`,`mcp.json`),projectSkillPath:e=>_(e,`.cursor`,`skills`,`open-knowledge`,`SKILL.md`)},codex:{id:`codex`,label:j.codex,configPath:(e,t)=>K({home:t}),format:`toml`,topLevelKey:`mcp_servers`,serverName:()=>s,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>h(K({home:t})),projectConfigPath:e=>_(e,`.codex`,`config.toml`),projectSkillPath:e=>_(e,`.codex`,`skills`,`open-knowledge`,`SKILL.md`)},copilot:{id:`copilot`,label:j.copilot,configPath:(e,t)=>q({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>s,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>h(q({home:t})),projectSkillPath:e=>_(e,`.github`,`skills`,`open-knowledge`,`SKILL.md`)},opencode:{id:`opencode`,label:j.opencode,configPath:(e,t)=>J({home:t}),format:`json`,topLevelKey:`mcp`,serverName:()=>s,buildEntry:(e,t)=>Se(t),scope:`global`,detectPath:(e,t)=>h(J({home:t})),projectConfigPath:e=>_(e,`opencode.json`),projectSkillPath:e=>_(e,`.opencode`,`skills`,`open-knowledge`,`SKILL.md`)},openclaw:{id:`openclaw`,label:j.openclaw,configPath:(e,t)=>Ae({home:t}),format:`json`,topLevelKey:`mcp`,serverMapSubKey:`servers`,serverName:()=>s,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>_(t??T(),`.openclaw`),offerOnlyWhenDetected:!0},pi:{id:`pi`,label:j.pi,configPath:()=>{throw Error("Pi has no user-global MCP config; OK's integration is the project-scoped bridge extension at .pi/extensions/open-knowledge.ts (run `ok init` in the project).")},format:`file`,topLevelKey:`mcpServers`,serverName:()=>s,buildEntry:()=>{throw Error(`Pi has no MCP entry shape; the managed bridge file is built by buildPiExtensionSource (integrations/pi-extension.ts).`)},scope:`project`,detectPath:(e,t)=>Me({home:t}),projectConfigPath:e=>_(e,`.pi`,`extensions`,`open-knowledge.ts`),projectSkillPath:e=>_(e,`.pi`,`skills`,`open-knowledge`,`SKILL.md`)},antigravity:{id:`antigravity`,label:j.antigravity,configPath:(e,t)=>Ne({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>s,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>_(t??T(),`.gemini`),offerOnlyWhenDetected:!0},"lm-studio":{id:`lm-studio`,label:j[`lm-studio`],configPath:(e,t)=>Y({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>s,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>h(Y({home:t})),offerOnlyWhenDetected:!0},hermes:{id:`hermes`,label:j.hermes,configPath:(e,t)=>je({home:t}),format:`yaml`,topLevelKey:`mcp_servers`,serverName:()=>s,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>_(t??T(),`.hermes`),offerOnlyWhenDetected:!0}};function Fe(e){let t=e.filter(e=>!Object.hasOwn(X,e));if(t.length>0)throw Error(`Unknown editor(s): ${t.join(`, `)}. Valid options: ${A.join(`, `)}`);return e.map(e=>X[e])}function Z(e,t){let n;try{n=te(e)}catch(e){if(e.code!==`ENOENT`)throw e}if(n?.isSymbolicLink())throw Error(`Refusing to write through a symbolic link at ${e}. Remove the symlink and re-run project setup.`);Q(e,t)}function Ie(e,t){Q(e,t)}function Q(e,t){let n;try{n=w(t)}catch{n=b(t)}let r=h(e);for(;r.length>1&&r!==x;){let t;try{t=w(r)}catch(e){if(e.code===`ENOENT`){r=h(r);continue}throw e}let i=y(n,t);if(i===``||!i.startsWith(`..`)&&!g(i))return;throw Error(`Refusing to write at ${e}: ancestor ${r} resolves to ${t}, which is outside the project directory ${n}. A symbolic link in the path likely escapes the project. Remove the symlink and re-run project setup.`)}}function $(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Le(e,t,n){try{if(ae(n).size>10485760)return!1}catch{return!1}let r;try{r=re(n,`utf-8`)}catch{return!1}let i=[],a=l(r.charCodeAt(0)===65279?r.slice(1):r,i,{allowTrailingComma:!0,disallowComments:!1});if(i.length>0||!$(a))return!1;let o=a[e.topLevelKey];if(!$(o))return!1;let s=e.serverMapSubKey?o[e.serverMapSubKey]:o;return $(s)?$(s[e.serverName(t)]):!1}function Re(e,t,n={}){if(!a.includes(e.id))return!0;try{return Le(e,t,e.configPath(t,n.home))}catch{return!1}}function ze(e,t,n={}){let r=e.projectSkillPath?.(t);if(!r)return{editorId:e.id,label:e.label,action:`skipped-unsupported`,path:``};if(!Re(e,t,n))return{editorId:e.id,label:e.label,action:`skipped-prerequisite`,path:r};try{let n=f(`project`,{checkDesktop:!0}),i=h(r);Z(i,t);let a=C(r)?`overwritten`:`written`;return ie(i,{recursive:!0,force:!0}),ne(h(i),{recursive:!0}),ee(n,i,{recursive:!0}),{editorId:e.id,label:e.label,action:a,path:r}}catch(t){return{editorId:e.id,label:e.label,action:`failed`,path:r,error:t instanceof Error?t.message:String(t)}}}function Be(e,t){let n=y(u(t),u(e));return n.length>0&&!n.startsWith(`..`)&&!g(n)}const Ve=e=>{try{let t=p(`git`,[`rev-parse`,`--show-toplevel`],d({cwd:e,encoding:`utf8`,stdio:[`ignore`,`pipe`,`ignore`]})).trim();return t.length>0?t:null}catch{return null}};function He(e,t={}){let n=t.homeDir??T(),r=t.gitTopLevel??Ve,i=b(e),a;try{a=w(i)}catch{a=i}let o=a,s=0;for(;s<30&&!(o===n||o===`/`||o===``);){if(c(o))return{projectRoot:o,defaultContentDir:`.`,ancestorPromoted:o!==a,gitRootPromoted:!1};let e=h(o);if(e===o)break;o=e,s+=1}let l=r(a);return l!==null&&Be(l,n)?l===a?{projectRoot:i,defaultContentDir:`.`,ancestorPromoted:!1,gitRootPromoted:!1}:{projectRoot:l,defaultContentDir:`.`,ancestorPromoted:!1,gitRootPromoted:!0}:{projectRoot:i,defaultContentDir:`.`,ancestorPromoted:!1,gitRootPromoted:!1}}export{_e as S,H as _,A as a,he as b,ye as c,be as d,z as f,Ee as g,Ce as h,ze as i,I as l,xe as m,Z as n,j as o,Te as p,Ie as r,X as s,He as t,L as u,De as v,pe as x,Fe as y};
|
|
56
|
-
//# sourceMappingURL=resolve-project-root-
|
|
55
|
+
exit 127`,I=`// ok-pi-bridge`,L=`${I}-v1`,be=`ok-pi-managed-extension`;function xe(e){if(typeof e!=`object`||!e)return!1;let t=e;if(t.command===`/bin/sh`){if(!Array.isArray(t.args)||t.args[0]!==`-l`||t.args[1]!==`-c`)return!1;let e=t.args[2];return typeof e==`string`&&e.includes(`# ok-mcp-v2`)}if(t.command===`powershell`){if(!Array.isArray(t.args)||t.args[0]!==`-NoProfile`||t.args[1]!==`-NonInteractive`||t.args[2]!==`-Command`)return!1;let e=t.args[3];return typeof e==`string`&&e.includes(`# ok-mcp-win-v1`)}if(t.type===`local`&&Array.isArray(t.command)){if(t.command[0]===`/bin/sh`){if(t.command[1]!==`-l`||t.command[2]!==`-c`)return!1;let e=t.command[3];return typeof e==`string`&&e.includes(`# ok-mcp-v2`)}if(t.command[0]===`powershell`){if(t.command[1]!==`-NoProfile`||t.command[2]!==`-NonInteractive`||t.command[3]!==`-Command`)return!1;let e=t.command[4];return typeof e==`string`&&e.includes(`# ok-mcp-win-v1`)}return!1}if(t.command===`ok-pi-managed-extension`){if(!Array.isArray(t.args))return!1;let e=t.args[0];return typeof e==`string`&&e.startsWith(L)}return!1}function R(e=process.argv[1]){if(!e)throw Error(`Cannot infer the local CLI entry for --dev-mcp because process.argv[1] is empty.`);let t=b(e);if(m(t)===`cli.mjs`&&m(h(t))===`dist`)return t;let n=t.split(x),r=n.lastIndexOf(`packages`);if(r===-1||n[r+1]!==`cli`)throw Error(`Cannot infer the repo root for --dev-mcp from ${t}. Run the local CLI from this repo so the built dist path can be derived.`);let i=n.slice(0,r);return _(i.length===0?x:i.join(x),`packages`,`cli`,`dist`,`cli.mjs`)}function z(e={}){return e.mode===`dev`?{command:M,args:[R(),`mcp`],env:{...N}}:(e.platformName??process.platform)===`win32`?{command:`powershell`,args:[`-NoProfile`,`-NonInteractive`,`-Command`,F]}:{command:`/bin/sh`,args:[`-l`,`-c`,P]}}function Se(e={}){return e.mode===`dev`?{type:`local`,enabled:!0,command:[M,R(),`mcp`],environment:{...N}}:(e.platformName??process.platform)===`win32`?{type:`local`,enabled:!0,command:[`powershell`,`-NoProfile`,`-NonInteractive`,`-Command`,F]}:{type:`local`,enabled:!0,command:[`/bin/sh`,`-l`,`-c`,P]}}function Ce(e){if(typeof e!=`object`||!e)return!1;let t=e;return B(t,z({mode:`published`,platformName:`darwin`}))||B(t,z({mode:`published`,platformName:`win32`}))}function B(e,t){return Object.keys(e).length===Object.keys(t).length?we(e,t):!1}function we(e,t){if(e.command!==t.command)return!1;let n=t.args;return!Array.isArray(n)||!Array.isArray(e.args)||e.args.length!==n.length?!1:e.args.every((e,t)=>e===n[t])}function V(e,t){let n=e=>typeof e==`string`&&e.includes(`# ok-mcp`);return t===`/bin/sh`?e[0]===`-l`&&e[1]===`-c`&&n(e[2]):t===`powershell`?e[0]===`-NoProfile`&&e[1]===`-NonInteractive`&&e[2]===`-Command`&&n(e[3]):!1}function Te(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.enabled===!1||typeof t.command!=`string`||!Array.isArray(t.args)?!1:V(t.args,t.command)}function Ee(e){if(typeof e!=`object`||!e)return!1;let t=e;if(t.type!==`local`||t.enabled===!1||!Array.isArray(t.command))return!1;let[n,...r]=t.command;return typeof n==`string`&&V(r,n)}function H(e){return e===`win32`?S:v}function De(e={}){let t=e.platformName??process.platform,n=e.home??T(),r=e.env??process.env,i=H(t);return t===`darwin`?i.join(n,`Library`,`Application Support`):t===`win32`?r.APPDATA||i.join(n,`AppData`,`Roaming`):r.XDG_CONFIG_HOME||i.join(n,`.config`)}function Oe(e={}){let t=e.platformName??process.platform,n=e.home??T();return H(t).join(n,`.claude.json`)}function U(e={}){let t=e.platformName??process.platform,n=e.home??T(),r=e.env??process.env;if(t===`darwin`)return v.join(n,`Library`,`Application Support`,`Claude`,`claude_desktop_config.json`);if(t===`win32`){let e=r.APPDATA??S.join(n,`AppData`,`Roaming`);return S.join(e,`Claude`,`claude_desktop_config.json`)}throw Error(`Claude Desktop is not available on ${t}. Supported: macOS, Windows.`)}function W(e={}){let t=e.platformName??process.platform,n=e.home??T();return H(t).join(n,`.cursor`,`mcp.json`)}function ke(e={}){let t=e.platformName??process.platform,n=e.home??T();return(e.env??process.env).CODEX_HOME??H(t).join(n,`.codex`)}function G(e={}){return H(e.platformName??process.platform).join(ke(e),`config.toml`)}function K(e={}){let t=e.platformName??process.platform,n=e.home??T(),r=(e.env??process.env).COPILOT_HOME??H(t).join(n,`.copilot`);return H(t).join(r,`mcp-config.json`)}function Ae(e={}){let t=e.platformName??process.platform,n=e.home??T(),r=e.env??process.env,i=H(t);if(t===`win32`){let e=r.APPDATA??i.join(n,`AppData`,`Roaming`);return i.join(e,`opencode`)}let a=r.XDG_CONFIG_HOME??i.join(n,`.config`);return i.join(a,`opencode`)}function q(e={}){return H(e.platformName??process.platform).join(Ae(e),`opencode.json`)}function je(e={}){let t=e.platformName??process.platform,n=e.home??T();return H(t).join(n,`.openclaw`,`openclaw.json`)}function Me(e={}){let t=e.platformName??process.platform,n=e.home??T();return H(t).join(n,`.hermes`,`config.yaml`)}function J(e={}){let t=e.platformName??process.platform,n=e.home??T();return(e.env??process.env).PI_CODING_AGENT_DIR??H(t).join(n,`.pi`,`agent`)}function Ne(e={}){let t=e.platformName??process.platform,n=e.home??T();return H(t).join(n,`.gemini`,`config`,`mcp_config.json`)}function Pe(e,t){let n=H(t),r=n.join(e,`.lmstudio`,`mcp.json`),i=n.join(e,`.cache`,`lm-studio`,`mcp.json`);return t===`darwin`?[i,r]:[r,i]}function Y(e={}){let t=e.platformName??process.platform,n=Pe(e.home??T(),t);return n.find(e=>C(e))||n.find(e=>C(h(e)))||n[0]}const X={claude:{id:`claude`,label:j.claude,configPath:(e,t)=>Oe({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>s,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>_(t??T(),`.claude`),projectConfigPath:e=>_(e,`.mcp.json`),projectSkillPath:e=>_(e,`.claude`,`skills`,`open-knowledge`,`SKILL.md`)},"claude-desktop":{id:`claude-desktop`,label:j[`claude-desktop`],configPath:(e,t)=>U({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>s,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>h(U({home:t}))},cursor:{id:`cursor`,label:j.cursor,configPath:(e,t)=>W({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>s,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>h(W({home:t})),projectConfigPath:e=>_(e,`.cursor`,`mcp.json`),projectSkillPath:e=>_(e,`.cursor`,`skills`,`open-knowledge`,`SKILL.md`)},codex:{id:`codex`,label:j.codex,configPath:(e,t)=>G({home:t}),format:`toml`,topLevelKey:`mcp_servers`,serverName:()=>s,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>h(G({home:t})),projectConfigPath:e=>_(e,`.codex`,`config.toml`),projectSkillPath:e=>_(e,`.codex`,`skills`,`open-knowledge`,`SKILL.md`)},copilot:{id:`copilot`,label:j.copilot,configPath:(e,t)=>K({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>s,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>h(K({home:t})),projectSkillPath:e=>_(e,`.github`,`skills`,`open-knowledge`,`SKILL.md`)},opencode:{id:`opencode`,label:j.opencode,configPath:(e,t)=>q({home:t}),format:`json`,topLevelKey:`mcp`,serverName:()=>s,buildEntry:(e,t)=>Se(t),scope:`global`,detectPath:(e,t)=>h(q({home:t})),projectConfigPath:e=>_(e,`opencode.json`),projectSkillPath:e=>_(e,`.opencode`,`skills`,`open-knowledge`,`SKILL.md`)},openclaw:{id:`openclaw`,label:j.openclaw,configPath:(e,t)=>je({home:t}),format:`json`,topLevelKey:`mcp`,serverMapSubKey:`servers`,serverName:()=>s,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>_(t??T(),`.openclaw`),offerOnlyWhenDetected:!0},pi:{id:`pi`,label:j.pi,configPath:()=>{throw Error("Pi has no user-global MCP config; OK's integration is the project-scoped bridge extension at .pi/extensions/open-knowledge.ts (run `ok init` in the project).")},format:`file`,topLevelKey:`mcpServers`,serverName:()=>s,buildEntry:()=>{throw Error(`Pi has no MCP entry shape; the managed bridge file is built by buildPiExtensionSource (integrations/pi-extension.ts).`)},scope:`project`,detectPath:(e,t)=>J({home:t}),projectConfigPath:e=>_(e,`.pi`,`extensions`,`open-knowledge.ts`),projectSkillPath:e=>_(e,`.pi`,`skills`,`open-knowledge`,`SKILL.md`)},antigravity:{id:`antigravity`,label:j.antigravity,configPath:(e,t)=>Ne({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>s,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>_(t??T(),`.gemini`),offerOnlyWhenDetected:!0},"lm-studio":{id:`lm-studio`,label:j[`lm-studio`],configPath:(e,t)=>Y({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>s,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>h(Y({home:t})),offerOnlyWhenDetected:!0},hermes:{id:`hermes`,label:j.hermes,configPath:(e,t)=>Me({home:t}),format:`yaml`,topLevelKey:`mcp_servers`,serverName:()=>s,buildEntry:(e,t)=>z(t),scope:`global`,detectPath:(e,t)=>_(t??T(),`.hermes`),offerOnlyWhenDetected:!0}};function Fe(e){let t=e.filter(e=>!Object.hasOwn(X,e));if(t.length>0)throw Error(`Unknown editor(s): ${t.join(`, `)}. Valid options: ${A.join(`, `)}`);return e.map(e=>X[e])}function Z(e,t){let n;try{n=te(e)}catch(e){if(e.code!==`ENOENT`)throw e}if(n?.isSymbolicLink())throw Error(`Refusing to write through a symbolic link at ${e}. Remove the symlink and re-run project setup.`);Q(e,t)}function Ie(e,t){Q(e,t)}function Q(e,t){let n;try{n=w(t)}catch{n=b(t)}let r=h(e);for(;r.length>1&&r!==x;){let t;try{t=w(r)}catch(e){if(e.code===`ENOENT`){r=h(r);continue}throw e}let i=y(n,t);if(i===``||!i.startsWith(`..`)&&!g(i))return;throw Error(`Refusing to write at ${e}: ancestor ${r} resolves to ${t}, which is outside the project directory ${n}. A symbolic link in the path likely escapes the project. Remove the symlink and re-run project setup.`)}}function $(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Le(e,t,n){try{if(ae(n).size>10485760)return!1}catch{return!1}let r;try{r=re(n,`utf-8`)}catch{return!1}let i=[],a=u(r.charCodeAt(0)===65279?r.slice(1):r,i,{allowTrailingComma:!0,disallowComments:!1});if(i.length>0||!$(a))return!1;let o=a[e.topLevelKey];if(!$(o))return!1;let s=e.serverMapSubKey?o[e.serverMapSubKey]:o;return $(s)?$(s[e.serverName(t)]):!1}function Re(e,t,n={}){if(!a.includes(e.id))return!0;try{return Le(e,t,e.configPath(t,n.home))}catch{return!1}}function ze(e,t,n={}){let r=e.projectSkillPath?.(t);if(!r)return{editorId:e.id,label:e.label,action:`skipped-unsupported`,path:``};if(!Re(e,t,n))return{editorId:e.id,label:e.label,action:`skipped-prerequisite`,path:r};try{let n=f(`project`,{checkDesktop:!0}),i=h(r);Z(i,t);let a=C(r)?`overwritten`:`written`;return ie(i,{recursive:!0,force:!0}),ne(h(i),{recursive:!0}),ee(n,i,{recursive:!0}),{editorId:e.id,label:e.label,action:a,path:r}}catch(t){return{editorId:e.id,label:e.label,action:`failed`,path:r,error:t instanceof Error?t.message:String(t)}}}function Be(e,t){let n=y(d(t),d(e));return n.length>0&&!n.startsWith(`..`)&&!g(n)}const Ve=e=>{try{let t=p(`git`,[`rev-parse`,`--show-toplevel`],l({cwd:e,encoding:`utf8`,stdio:[`ignore`,`pipe`,`ignore`]})).trim();return t.length>0?t:null}catch{return null}};function He(e,t={}){let n=t.homeDir??T(),r=t.gitTopLevel??Ve,i=b(e),a;try{a=w(i)}catch{a=i}let o=a,s=0;for(;s<30&&!(o===n||o===`/`||o===``);){if(c(o))return{projectRoot:o,defaultContentDir:`.`,ancestorPromoted:o!==a,gitRootPromoted:!1};let e=h(o);if(e===o)break;o=e,s+=1}let l=r(a);return l!==null&&Be(l,n)?l===a?{projectRoot:i,defaultContentDir:`.`,ancestorPromoted:!1,gitRootPromoted:!1}:{projectRoot:l,defaultContentDir:`.`,ancestorPromoted:!1,gitRootPromoted:!0}:{projectRoot:i,defaultContentDir:`.`,ancestorPromoted:!1,gitRootPromoted:!1}}export{_e as C,pe as S,H as _,A as a,J as b,ye as c,be as d,z as f,Ee as g,Ce as h,ze as i,I as l,xe as m,Z as n,j as o,Te as p,Ie as r,X as s,He as t,L as u,De as v,he as x,Fe as y};
|
|
56
|
+
//# sourceMappingURL=resolve-project-root-CXTFWDeF.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{zs as e}from"./src-BD1wHyiU.mjs";import{
|
|
2
|
-
//# sourceMappingURL=skill-teardown-
|
|
1
|
+
import{zs as e}from"./src-BD1wHyiU.mjs";import{_r as t,yr as n}from"./src-CpD0HabK.mjs";import{dirname as r,isAbsolute as i,join as a,relative as o,resolve as s,sep as c}from"node:path";import{existsSync as l,lstatSync as u,readdirSync as d,rmSync as f,rmdirSync as p}from"node:fs";const m=[{hostDir:`.adal`,pruneRoot:`.adal`},{hostDir:`.aider-desk`,pruneRoot:`.aider-desk`},{hostDir:`.astrbot/data`,pruneRoot:`.astrbot`},{hostDir:`.augment`,pruneRoot:`.augment`},{hostDir:`.autohand`,pruneRoot:`.autohand`},{hostDir:`.bob`,pruneRoot:`.bob`},{hostDir:`.codeartsdoer`,pruneRoot:`.codeartsdoer`},{hostDir:`.codebuddy`,pruneRoot:`.codebuddy`},{hostDir:`.codeium/windsurf`,pruneRoot:`.codeium`},{hostDir:`.codemaker`,pruneRoot:`.codemaker`},{hostDir:`.codestudio`,pruneRoot:`.codestudio`},{hostDir:`.commandcode`,pruneRoot:`.commandcode`},{hostDir:`.config/crush`,pruneRoot:`.config/crush`},{hostDir:`.config/devin`,pruneRoot:`.config/devin`},{hostDir:`.config/goose`,pruneRoot:`.config/goose`},{hostDir:`.config/kimchi/harness`,pruneRoot:`.config/kimchi`},{hostDir:`.continue`,pruneRoot:`.continue`},{hostDir:`.factory`,pruneRoot:`.factory`},{hostDir:`.forge`,pruneRoot:`.forge`},{hostDir:`.grok`,pruneRoot:`.grok`},{hostDir:`.iflow`,pruneRoot:`.iflow`},{hostDir:`.inferencesh`,pruneRoot:`.inferencesh`},{hostDir:`.jazz`,pruneRoot:`.jazz`},{hostDir:`.junie`,pruneRoot:`.junie`},{hostDir:`.kilocode`,pruneRoot:`.kilocode`},{hostDir:`.kiro`,pruneRoot:`.kiro`},{hostDir:`.kode`,pruneRoot:`.kode`},{hostDir:`.lingma`,pruneRoot:`.lingma`},{hostDir:`.mcpjam`,pruneRoot:`.mcpjam`},{hostDir:`.moxby`,pruneRoot:`.moxby`},{hostDir:`.mux`,pruneRoot:`.mux`},{hostDir:`.neovate`,pruneRoot:`.neovate`},{hostDir:`.ona`,pruneRoot:`.ona`},{hostDir:`.openhands`,pruneRoot:`.openhands`},{hostDir:`.pochi`,pruneRoot:`.pochi`},{hostDir:`.qoder`,pruneRoot:`.qoder`},{hostDir:`.qoder-cn`,pruneRoot:`.qoder-cn`},{hostDir:`.qwen`,pruneRoot:`.qwen`},{hostDir:`.reasonix`,pruneRoot:`.reasonix`},{hostDir:`.roo`,pruneRoot:`.roo`},{hostDir:`.rovodev`,pruneRoot:`.rovodev`},{hostDir:`.snowflake/cortex`,pruneRoot:`.snowflake`},{hostDir:`.tabnine/agent`,pruneRoot:`.tabnine`},{hostDir:`.terramind`,pruneRoot:`.terramind`},{hostDir:`.tinycloud`,pruneRoot:`.tinycloud`},{hostDir:`.trae`,pruneRoot:`.trae`},{hostDir:`.trae-cn`,pruneRoot:`.trae-cn`},{hostDir:`.vibe`,pruneRoot:`.vibe`},{hostDir:`.zcode`,pruneRoot:`.zcode`},{hostDir:`.zencoder`,pruneRoot:`.zencoder`}],h=[...n.map(e=>t[e]),`open-knowledge`];function g(e){if(!i(e))throw Error(`skill cleanup requires an absolute home directory; got ${JSON.stringify(e)}`);let t=s(e);if(t===c||r(t)===t)throw Error(`skill cleanup refuses to operate on the filesystem root (${t})`);return t}function _(e,t){let n=o(e,t);if(n.startsWith(`..`)||i(n))return!1;let r=e;for(let e of n.split(c)){r=a(r,e);try{if(!u(r).isDirectory())return!1}catch{return!1}}return!0}function v(e,t){try{return d(e).every(n=>t.has(a(e,n)))}catch{return!1}}function y(e){let t=g(e),n=[],i=[],o=new Set;for(let e of m){let s=a(t,e.hostDir,`skills`);if(!_(t,s))continue;let u=h.map(e=>a(s,e)).filter(e=>l(e));n.push(...u);for(let e of u)o.add(e);let d=a(t,e.pruneRoot),f=s;for(;v(f,o)&&(i.push(f),o.add(f),f!==d);){let e=r(f);if(e===f||e===t||!e.startsWith(t+c))break;f=e}}return{skillDirs:n,emptyDirs:i}}function b(e){try{if(!u(e).isDirectory())return!1;let t=d(e);return t.length===0||t.includes(`SKILL.md`)}catch{return!1}}function x(e){let t=new Set,n=new Set;for(let i of m){let o=a(e,i.hostDir,`skills`);for(let e of h)t.add(a(o,e));let s=a(e,i.pruneRoot),l=o;for(;n.add(l),l!==s;){let t=r(l);if(t===l||t===e||!t.startsWith(e+c))break;l=t}}return{skillDirs:t,emptyDirs:n}}function S(e,t){let n=g(e),r=x(n),i=[...t.skillDirs.filter(e=>!r.skillDirs.has(e)),...t.emptyDirs.filter(e=>!r.emptyDirs.has(e))];if(i.length>0)throw Error(`refusing skill cleanup — ${i.length} path(s) outside the known legacy set: ${i.join(`, `)}`);let a=[];for(let e of t.skillDirs)if(_(n,e)&&b(e))try{f(e,{recursive:!0,force:!0}),a.push(e)}catch{}for(let e of t.emptyDirs)if(_(n,e))try{p(e),a.push(e)}catch{}return a}function C(r){let i=g(r),o=[];for(let r of n){let n=t[r];o.push({path:a(i,`.agents`,`skills`,n),bundleId:r,scope:`central`});for(let t of e)o.push({path:a(i,t.skillsRoot,n),bundleId:r,scope:`host`,hostDir:t.hostDir})}return o}function w(e,t){let n=[];for(let r of C(e))if(r.bundleId===t)try{f(r.path,{recursive:!0,force:!0})}catch(e){n.push(e instanceof Error?e:Error(String(e)))}if(n.length>0)throw AggregateError(n,`Failed to remove ${n.length} path(s) for ${t}`)}export{C as i,y as n,w as r,S as t};
|
|
2
|
+
//# sourceMappingURL=skill-teardown-D5P-vpe_.mjs.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import{o as e}from"./chunk-DTipWd-i.mjs";import{K as t,pt as n,q as r}from"./sleep-DhRrtbfG.mjs";import{Dc as i,Ec as a,bo as o,ct as s,jc as c,lt as l}from"./src-BD1wHyiU.mjs";import{En as u,Mi as d,at as f,it as p,mi as m,ot as h,rt as g}from"./src-CpD0HabK.mjs";import{D as ee,F as _,I as v,k as y}from"./fs-traced-2B_-YK-g.mjs";import{C as b,S as x,_ as S,f as C,r as w}from"./server-lock-RKPNHNqb.mjs";import{t as T}from"./yazl-DZr4PyKA.mjs";import{h as E,m as D,x as te}from"./resolve-project-root-CXTFWDeF.mjs";import{c as ne}from"./colors-DSyAT9Cz.mjs";import{a as O,i as k}from"./acp-harness-probe-CqyXU5gq.mjs";import{D as re,E as A,S as j,T as M,_ as ie,b as ae,o as oe}from"./init-BALL45ev.mjs";import{n as se}from"./constants-C8qimQe2.mjs";import{t as ce}from"./is-object-Bw0-z8qH.mjs";import"./loader-7-3iPTYi.mjs";import"./skill-teardown-D5P-vpe_.mjs";import"./preview-BFzV6mP_.mjs";import{execSync as le,spawnSync as ue}from"node:child_process";import{basename as N,dirname as P,join as F,relative as de,resolve as I,sep as fe}from"node:path";import{cpSync as pe,createWriteStream as me,existsSync as L,lstatSync as he,mkdirSync as R,mkdtempSync as ge,readFileSync as z,readdirSync as B,readlinkSync as _e,rmSync as ve,statSync as ye,writeFileSync as V}from"node:fs";import{arch as be,freemem as xe,homedir as H,hostname as Se,platform as Ce,release as we,tmpdir as Te,totalmem as Ee,type as De,uptime as Oe}from"node:os";import"node:fs/promises";import{createHash as ke}from"node:crypto";var Ae=n();const je=new Set([`start`,`stop`,`status`,`clean`,`ui`,`mcp`,`preview`,`lint`,`deinit`,`auth`]);function Me(e,t,n=u){if(e!==void 0&&!je.has(e))return null;let r=n(t);return r===null||r.distance===0?null:r.rootPath}let Ne=null;function Pe(e){Ne=e}function Fe(){return Ne??process.cwd()}function U(){return F(H(),`.ok`,`bug-reports`)}function Ie(e=new Date){let t=e.toISOString().replace(/[:.]/g,`-`),n=U(),r=`${t}-bugreport`,i=F(n,`${r}.zip`);for(let e=2;L(i);e+=1)i=F(n,`${r}-${e}.zip`);return i}function Le(e,t){let n=F(e,`.ok`,`config.yml`);if(L(n))try{let e=z(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 L(F(e,`.ok`))?ke(`sha256`).update(I(e)).digest(`hex`).slice(0,12):null}function Re(){let e={timestamp:new Date().toISOString(),platform:Ce(),osType:De(),osRelease:we(),hostname:`[redacted]`,uptime:Oe(),freeMem:xe(),totalMem:Ee(),nodeVersion:process.version,bunVersion:process.versions.bun??null,v8Version:process.versions.v8??null,pid:process.pid};try{e.macosVersion=le(`sw_vers -productVersion 2>/dev/null`,d({encoding:`utf8`})).trim()}catch{}try{let t=F(__dirname,`..`,`..`,`package.json`);L(t)&&(e.okVersion=JSON.parse(z(t,`utf8`)).version)}catch{}return e}const ze=[{prefix:`cli`,projectTagged:!0},{prefix:`desktop`,projectTagged:!1},{prefix:`mcp`,projectTagged:!1}];function Be(e){let t=N(e);return ze.some(e=>e.projectTagged&&t.startsWith(`${e.prefix}.`))}function Ve(e,t){return Ge(e,t).files}const He=[`ShipIt_stderr.log`,`ShipIt_stdout.log`];function Ue(e,t=O){let n=F(e,`${t}.ShipIt`);return L(n)?He.map(e=>F(n,e)).filter(e=>L(e)):[]}function We(e){if(!L(e))return[];try{return B(e).filter(e=>e.endsWith(`.yaml`)).sort().slice(-25).map(t=>F(e,t))}catch{return[]}}function Ge(e,t){if(!L(t))return{files:[],excludedByProjectSlug:0};let n=B(t).filter(e=>e.endsWith(`.log`)||/\.log\.\d+$/.test(e)).map(e=>F(t,e));if(!e)return{files:n,excludedByProjectSlug:0};let r=n.filter(Be),i=[],a=r.filter(t=>{try{return z(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=>!Be(e)||o.has(e)),excludedByProjectSlug:r.length-o.size}}function Ke(e){let t=F(e,`.ok`,`local`);return L(t)?{files:[`server.lock`,`last-spawn-error.log`,s].map(e=>F(t,e)).filter(e=>L(e))}:{files:[]}}function qe(e){let t=F(e,`.ok`,`local`,`logs`);return L(t)?{files:[`server-current.jsonl`,`server-prev.jsonl`].map(e=>F(t,e)).filter(e=>L(e))}:{files:[]}}function Je(e){if(e.redact){let{redacted:t,patterns:n,lineCount:r}=i(e.content);e.zipfile.addBuffer(Buffer.from(t,`utf8`),e.name),e.bundleFiles.push(e.name),n.length>0&&e.redactions.push({file:e.name,lineCount:r,patterns:n})}else e.zipfile.addBuffer(Buffer.from(e.content,`utf8`),e.name),e.bundleFiles.push(e.name)}function W(e){for(let t of e.files)try{Je({zipfile:e.zipfile,name:`${e.prefix}/${N(t)}`,content:z(t,`utf8`),redact:e.redact,bundleFiles:e.bundleFiles,redactions:e.redactions})}catch(n){e.logger?.warn({file:t,prefix:e.prefix,err:n},`bug-report: skipped unreadable file`)}}async function Ye(t){let{redact:n,outputPath:r,logger:i}=t,o=t.userLogsDir??F(H(),`.ok`,`logs`),s=t.projectDir?Le(t.projectDir,i):null;R(P(r),{recursive:!0}),i?.info({projectSlug:s},`gathering diagnostic data`);let l=Re();l.desktop=t.desktop??null,l.language=t.language??null;let{files:u,excludedByProjectSlug:d}=Ge(s,o),{files:f}=t.projectDir?Ke(t.projectDir):{files:[]},{files:p}=t.projectDir?qe(t.projectDir):{files:[]},m=t.shipItLogFiles??[];i?.info({logFileCount:u.length,logFilesExcludedByProjectSlug:d,lockFileCount:f.length,localSinkFileCount:p.length,shipItLogFileCount:m.length},`files collected`);let h=[],g=[],{ZipFile:ee}=await import(`./yazl-jVENrf5i.mjs`).then(t=>e(t.default,1)),_=new ee;W({zipfile:_,files:[...u,...m],prefix:`logs`,redact:n,bundleFiles:g,redactions:h,logger:i}),W({zipfile:_,files:f,prefix:`lockdir`,redact:n,bundleFiles:g,redactions:h,logger:i}),W({zipfile:_,files:p,prefix:`local-logs`,redact:n,bundleFiles:g,redactions:h,logger:i}),W({zipfile:_,files:t.bugReportLedgerFiles??[],prefix:c,redact:n,bundleFiles:g,redactions:h,logger:i});for(let e of t.extraFiles??[])try{let t=z(e.sourcePath),n=`extra/${e.zipName??N(e.sourcePath)}`;_.addBuffer(t,n),g.push(n)}catch(t){i?.warn({sourcePath:e.sourcePath,err:t},`extra file unreadable; omitted from bundle`)}t.note&&Je({zipfile:_,name:`note.txt`,content:t.note,redact:n,bundleFiles:g,redactions:h});let v=JSON.stringify(l,null,2);_.addBuffer(Buffer.from(v,`utf8`),`sysinfo.json`),g.push(`sysinfo.json`);let y={generatedAt:new Date().toISOString(),disciplineVersion:`1.0.0`,projectSlug:s,files:g,redactions:h,sysinfo:l};_.addBuffer(Buffer.from(JSON.stringify(y,null,2),`utf8`),`MANIFEST.json`);let b=h.reduce((e,t)=>e+t.lineCount,0),x=new Set(m.map(e=>`logs/${N(e)}`)),S=g.filter(e=>x.has(e)),C=new Set((t.bugReportLedgerFiles??[]).map(e=>`${c}/${N(e)}`)),w=g.filter(e=>C.has(e)),T=s?g.filter(e=>e.startsWith(`logs/`)&&!Be(e)&&!x.has(e)):[],E=[`# Bug Report Bundle`,``,`Generated: ${y.generatedAt}`,`Project: ${s??`(unscoped)`}`,`Discipline version: ${y.disciplineVersion}`,``,`## Contents`,``,...g.map(e=>`- ${e}`),``,`## Privacy`,``,...T.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:`,...T.map(e=>`- ${e}`),``]:[],...S.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:`,...S.map(e=>`- ${e}`),``]:[],...w.length>0?[`Send history: one small record per 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:`,...w.map(e=>`- ${e}`),``]:[],...n?[`This bundle was auto-redacted before packaging.`,`Patterns checked: ${a.join(`, `)}`,b>0?`${b} line(s) were scrubbed across ${h.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
|
+
`);_.addBuffer(Buffer.from(E,`utf8`),`README.md`),_.end();let D=me(r);return _.outputStream.pipe(D),await new Promise((e,t)=>{D.on(`close`,e),D.on(`error`,t)}),i?.info({bundlePath:r,fileCount:g.length,redactionCount:b},`bundle written`),{zipPath:r,summary:{projectSlug:s,files:g,redactions:h,redactedLineCount:b,generatedAt:y.generatedAt}}}var Xe=e(T(),1),G=e(ne(),1);function Ze(e){return v({absPath:y(`user`,e,e),sideline:!1,warn:()=>{}}).value.appearance?.language??`system`}function Qe({home:e=H(),env:n=process.env}={}){let i=Ze(e),{override:a,preferenceList:s}=ee(n),{locale:c,source:l}=o({override:a,storedPreference:i,supportedLocales:r,preferenceList:s,autoDetectableLocales:t});return{preference:i,locale:c,source:l,systemLanguages:s}}function $e(e,t){return t.length===0||!e.includes(t)?e:e.split(t).join(`<CONTENT_DIR>`)}function et(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function K(e,t){if(typeof e==`string`)return $e(e,t.contentDir);if(Array.isArray(e))return e.map(e=>K(e,t));if(!et(e))return e;let n={};for(let[r,i]of Object.entries(e))n[r]=K(i,t);return n}function tt(e,t){let n=z(e,`utf-8`);if(n.length===0)return;let r=n.endsWith(`
|
|
3
|
+
`),i=n.split(`
|
|
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=K(JSON.parse(n),t);a.push(JSON.stringify(e))}catch{a.push(n)}}}V(e,r?`${a.join(`
|
|
5
|
+
`)}\n`:a.join(`
|
|
6
|
+
`))}function nt(e,t){let n=z(e,`utf-8`);if(n.trim().length!==0)try{let r=K(JSON.parse(n),t),i=n.endsWith(`
|
|
7
|
+
`)?`
|
|
8
|
+
`:``;V(e,`${JSON.stringify(r,null,2)}${i}`)}catch{let r=$e(n,t.contentDir);r!==n&&V(e,r)}}function rt(e,t){let n=z(e,`utf-8`),r=$e(n,t.contentDir);r!==n&&V(e,r)}function it(e){try{return B(e,{withFileTypes:!0}).filter(e=>e.isFile()).map(t=>F(e,t.name))}catch{return[]}}const at=new Set([`agent-presence.json`,`agent-effects.json`,`runtime.json`]);function ot(e){return/\.log\.\d+$/.test(e)}function st(e){return e.endsWith(`.jsonl`)||e.endsWith(`.log`)||ot(e)}function ct(e){let t={contentDir:e.contentDir};for(let n of[`telemetry`,`logs`,`process`])for(let r of it(F(e.stagingDir,n)))st(r)?tt(r,t):r.endsWith(`.json`)?nt(r,t):rt(r,t);for(let n of it(F(e.stagingDir,`state`))){let e=N(n);n.endsWith(`.jsonl`)?tt(n,t):at.has(e)?nt(n,t):rt(n,t)}}const lt=[`.ok`,`local`,`telemetry`],ut=[`.ok`,`local`,`logs`],dt=[`.ok`,`local`,`loss-capture`],ft=`spans-current.jsonl`,pt=`spans-prev.jsonl`,mt=`server-current.jsonl`,ht=`server-prev.jsonl`,gt=`loss-current.jsonl`,_t=`loss-prev.jsonl`;function vt(e){return F(e,...lt,ft)}function yt(e){return F(e,...lt,pt)}function bt(e){return F(e,...ut,mt)}function xt(e){return F(e,...ut,ht)}function St(e){return F(e,...dt,gt)}function Ct(e){return F(e,...dt,_t)}const wt=1e3;async function Tt(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/agent-presence`,{signal:AbortSignal.timeout(wt)});return t.ok?await t.text():null}catch{return null}}async function Et(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/agent-effects`,{signal:AbortSignal.timeout(wt)});return t.ok?await t.text():null}catch{return null}}async function Dt(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/watcher-recent`,{signal:AbortSignal.timeout(wt)});return t.ok?await t.text():null}catch{return null}}function Ot(e){try{let t=JSON.parse(e);if(typeof t!=`object`||!t)return null;let n=t.decisions;return Array.isArray(n)?n.length===0?``:`${n.map(e=>JSON.stringify(e)).join(`
|
|
9
|
+
`)}\n`:null}catch{return null}}function kt(e){let t=F(e,`.git`,`ok`);if(!L(t))return null;let n=ue(`git`,[`-C`,t,`log`,`--oneline`,`-50`],d({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function At(e){let t=F(e,`.git`,`ok`);if(!L(t))return null;let n=ue(`git`,[`-C`,t,`for-each-ref`,`--sort=-creatordate`,`--count=50`,`--format=%(refname)%09%(creatordate:iso-strict)%09%(contents:subject)`,`refs/checkpoints/`],d({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function jt(){let e=process.env.OK_DESKTOP_VERSION,t=process.env.OK_DESKTOP_PACKAGED,n=process.env.OK_DESKTOP_CHANNEL;return e===void 0||t===void 0||n===void 0?null:{electronVersion:e,packaged:t===`1`||t.toLowerCase()===`true`,channel:n}}function Mt(){return{nodeVersion:process.version,platform:Ce(),arch:be()}}function Nt(){return process.env.OTEL_SDK_DISABLED===`false`}function q(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Pt(e){if(!L(e))return{};let t;try{t=(0,Ae.parse)(z(e,`utf-8`))}catch(t){return console.warn(`[ok diagnose bundle] failed to parse ${e} for manifest config; manifest will report schema defaults. Reason: ${t instanceof Error?t.message:String(t)}`),{}}if(!q(t))return{};let n=t.telemetry;if(!q(n))return{};let r=n.localSink;return q(r)?r:{}}function Ft(e){return typeof e==`boolean`?e:void 0}function It(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:void 0}function J(e){if(q(e))return It(e.maxBytes)}function Lt(e){let t=Pt(y(`project`,e)),n=Pt(y(`project-local`,e));return{enabled:Ft(n.enabled)??Ft(t.enabled)??!0,spansMaxBytes:J(n.spans)??J(t.spans)??52428800,logsMaxBytes:J(n.logs)??J(t.logs)??26214400}}function Rt(e){return ke(`sha256`).update(e).digest(`hex`)}function zt(e){let t=z(e),n=0;for(let e=0;e<t.length;e++)t[e]===10&&n++;return n}function Bt(e){let t=z(e,`utf-8`),n=`"doc.name"`,r=0,i=t.indexOf(n);for(;i!==-1;)r++,i=t.indexOf(n,i+10);return r}function Y(e,t){if(!L(e))return!1;try{return R(P(t),{recursive:!0}),pe(e,t),!0}catch{return!1}}function Vt(e){let t=[],n=e=>{let r=B(e,{withFileTypes:!0});for(let i of r){let r=F(e,i.name);i.isDirectory()?n(r):i.isFile()&&t.push(r)}};return n(e),t.sort()}const Ht=new Set([`.jsonl`]);function Ut(e){let t=e.lastIndexOf(`.`);return t===-1?!1:Ht.has(e.slice(t))}const Wt=new Set([`.jsonl`,`.json`,`.txt`,`.log`,`.lock`,`.yaml`,`.yml`]);function Gt(e){if(ot(e))return!0;let t=e.lastIndexOf(`.`);return t===-1?!1:Wt.has(e.slice(t))}function Kt(e){let t=[];for(let n of Vt(e)){let r=qt(e,n);if(!Gt(r))continue;let{redacted:a,patterns:o,lineCount:s}=i(z(n,`utf-8`));o.length!==0&&(V(n,a),t.push({file:r,lineCount:s,patterns:o}))}return{redactions:t,redactedLineCount:t.reduce((e,t)=>e+t.lineCount,0)}}function qt(e,t){return de(e,t).split(fe).join(`/`)}async function Jt(e){let t=I(e.contentDir),n=I(e.projectDir??e.contentDir),r=e.deps??{},i=r.fetchAgentPresence??Tt,a=r.fetchAgentEffects??Et,o=r.fetchWatcherRecent??Dt,u=r.readShadowHead??kt,d=r.readCheckpointRefs??At,f=r.now??(()=>new Date),p=r.okVersion??(()=>se),m=r.readDesktopEnv??jt,h=r.readLanguage??Qe,g=r.readRuntime??Mt,ee=r.isOtlpPushEnabled??Nt,_=ge(F(Te(),`ok-bundle-`));try{R(F(_,`telemetry`),{recursive:!0}),R(F(_,`logs`),{recursive:!0}),R(F(_,`state`),{recursive:!0}),Y(vt(n),F(_,`telemetry`,ft)),Y(yt(n),F(_,`telemetry`,pt)),Y(bt(n),F(_,`logs`,mt)),Y(xt(n),F(_,`logs`,ht));for(let t of e.userLogFiles??[])Y(t,F(_,`logs`,N(t)));for(let t of e.userStateFiles??[])Y(t,F(_,c,N(t)));let v=F(n,`.ok`,`local`),y=F(v,`server.lock`),b=`not-running`,x=`no server.lock`,S=null;if(L(y)){Y(y,F(_,`state`,`server.lock`));try{let e=z(y,`utf-8`),t=JSON.parse(e);typeof t.port==`number`?S=t.port:x=`lock present but no port`}catch{x=`lock present but unparseable`}}if(S!==null){let e=await i(S);e===null?x=`agent-presence endpoint at :${S} unreachable`:(V(F(_,`state`,`agent-presence.json`),e),b=`running`,x=``);let t=await a(S);t!==null&&V(F(_,`state`,`agent-effects.json`),t);let n=await o(S);if(n!==null){let e=Ot(n);e!==null&&V(F(_,`state`,`watcher-recent.jsonl`),e)}}let C=u(t);C!==null&&V(F(_,`state`,`shadow-head.txt`),C);let w=d(t);w!==null&&V(F(_,`state`,`checkpoint-refs.txt`),w),Y(St(n),F(_,`state`,gt)),Y(Ct(n),F(_,`state`,_t)),Y(F(v,`last-spawn-error.log`),F(_,`state`,`last-spawn-error.log`)),Y(F(v,l),F(_,`state`,l)),Y(F(v,s),F(_,`state`,s));let T=g(),E=m(),D=h(),te={ok:{version:p(),nodeVersion:T.nodeVersion,platform:T.platform,arch:T.arch},host:{desktop:E,language:D}};V(F(_,`state`,`runtime.json`),`${JSON.stringify(te,null,2)}\n`);let ne=b===`running`?`running
|
|
10
|
+
`:`not-running (${x})\n`;if(V(F(_,`state`,`server-status.txt`),ne),e.processDir&&L(e.processDir)){let t=F(_,`process`);R(t,{recursive:!0}),pe(e.processDir,t,{recursive:!0})}let O=e.redact===!0;O&&ct({stagingDir:_,contentDir:t}),e.note&&V(F(_,`note.txt`),e.note);let k=null;e.scrubSecrets===!0&&(k=Kt(_));for(let t of e.extraFiles??[])Y(t.sourcePath,F(_,`extra`,t.zipName??N(t.sourcePath)))||r.logger?.warn({sourcePath:t.sourcePath},`extra file missing; omitted from bundle`);let re=Lt(n),A=Vt(_),j=[],M=0,ie=0;for(let e of A){let t=qt(_,e),n=ye(e).size,r=Ut(t)?zt(e):0;j.push({path:t,bytes:n,lines:r}),M+=n,t.startsWith(`telemetry/`)&&Ut(t)&&(ie+=Bt(e))}let ae={applied:O};k!==null&&(ae.secretScrub=k);let oe={schemaVersion:2,createdAt:f().toISOString(),ok:{version:p(),nodeVersion:T.nodeVersion,platform:T.platform,arch:T.arch},host:{desktop:E,language:D},contentDir:{pathSha256:Rt(t),absolutePath:O?`<CONTENT_DIR>`:t},telemetry:{localSink:re,otlpPushEnabled:ee()},redaction:ae,serverStatus:b,files:j};V(F(_,`manifest.json`),`${JSON.stringify(oe,null,2)}\n`);let se=A.some(e=>{try{return z(e,`utf-8`).includes(t)}catch{return!1}}),ce={totalBytes:M,fileCount:j.length,docNameCount:ie,contentDirVisible:se,redacted:O},le=!1;return{stagingDir:_,manifest:oe,summary:ce,cleanup:()=>{le||(le=!0,ve(_,{recursive:!0,force:!0}))}}}catch(e){throw ve(_,{recursive:!0,force:!0}),e}}async function Yt(e){let{collected:t,outputPath:n}=e,r=P(n);if(!L(r))throw Error(`ok diagnose bundle: parent directory does not exist: ${r}. Create it or pass --out with an existing parent.`);let i=new Xe.ZipFile,a=Vt(t.stagingDir);for(let e of a){let n=qt(t.stagingDir,e);i.addFile(e,n)}i.end();let o=me(n);return i.outputStream.pipe(o),await new Promise((e,t)=>{o.on(`close`,e),o.on(`error`,t),i.outputStream.on(`error`,t)}),n}function Xt(e,t){let n=F(e,`.ok`,`config.yml`);if(L(n))try{let t=(0,Ae.parse)(z(n,`utf-8`)),r=ce(t)?t.content:void 0,i=ce(r)?r.dir:void 0;if(typeof i==`string`&&i.length>0)return I(e,i)}catch(e){t?.warn({configPath:n,err:e},`bug-report: failed to read .ok/config.yml; falling back to project root as content dir`)}return I(e)}async function Zt(e,t,n,r){let i=Le(t,e.logger),a=await Jt({contentDir:Xt(t,e.logger),projectDir:t,redact:e.redact,scrubSecrets:e.redact,note:e.note,extraFiles:e.extraFiles,userLogFiles:[...Ve(i,e.userLogsDir??F(H(),`.ok`,`logs`)),...Ue(e.cachesDir??F(H(),`Library`,`Caches`))],userStateFiles:We(e.bugReportsDir??U()),deps:{readDesktopEnv:n,readLanguage:r,logger:e.logger}});try{R(P(e.outputPath),{recursive:!0}),await Yt({collected:a,outputPath:e.outputPath});let t=a.manifest.redaction.secretScrub;return{zipPath:e.outputPath,summary:{level:`full`,systemWide:!1,projectSlug:i,files:a.manifest.files.map(e=>e.path),redactions:t?.redactions??[],redactedLineCount:t?.redactedLineCount??0,generatedAt:a.manifest.createdAt}}}finally{a.cleanup()}}async function Qt(e){let{projectDir:t}=e,n=e.readDesktopEnv??jt,r=e.readLanguage??Qe;if(e.level===`full`&&t!==void 0)return Zt(e,t,n,r);let{zipPath:i,summary:a}=await Ye({projectDir:t,redact:e.redact,outputPath:e.outputPath,userLogsDir:e.userLogsDir,shipItLogFiles:Ue(e.cachesDir??F(H(),`Library`,`Caches`)),bugReportLedgerFiles:We(e.bugReportsDir??U()),logger:e.logger,note:e.note,extraFiles:e.extraFiles,desktop:n(),language:r()});return{zipPath:i,summary:{level:e.level,systemWide:t===void 0,projectSlug:a.projectSlug,files:a.files,redactions:a.redactions,redactedLineCount:a.redactedLineCount,generatedAt:a.generatedAt}}}function $t(e,t){if(!L(e))return{status:`missing`,lockPath:e};let n;try{n=JSON.parse(z(e,`utf-8`))}catch{return{status:`corrupt`,lockPath:e}}if(!n||typeof n!=`object`||!b(n.pid))return{status:`corrupt`,lockPath:e};let r=n;if(!(t.isAlive??x)(r.pid))return{status:`dead-pid`,lockPath:e,lock:r};if(typeof r.machineId==`string`)return r.machineId===(t.machineId??S())?{status:`alive`,lockPath:e,lock:r}:{status:`foreign-host`,lockPath:e,lock:r};let i=t.host??Se();return r.hostname===i?{status:`alive`,lockPath:e,lock:r}:{status:`foreign-host`,lockPath:e,lock:r}}function X(e,t,n={}){return $t(C(e,t),n)}function Z(e,t={}){return $t(F(e,`ui.lock`),t)}function en(e){return e.replace(/:\d+$/,``)}function tn(e){let t=e.trim();if(!t)return null;{let e=/^https?:\/\/([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`https`,hostname:en(e[1]),owner:e[2],name:e[3]}}{let e=/^ssh:\/\/(?:[\w.-]+@)?([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`ssh`,hostname:en(e[1]),owner:e[2],name:e[3]}}{let e=/^git:\/\/([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`git`,hostname:en(e[1]),owner:e[2],name:e[3]}}{let e=/^(?:[\w.-]+@)?([\w.-]+):([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?$/.exec(t);if(e?.[1].includes(`.`)||e&&t.startsWith(`git@`))return{protocol:`ssh`,hostname:e[1],owner:e[2],name:e[3]}}{let e=/^git:([\w.-]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`git`,hostname:e[1],owner:e[2],name:e[3]}}if(!t.includes(`://`)&&!t.includes(`@`)&&!t.startsWith(`/`)){let e=/^([\w.-]+)\/([\w.\-~%]+?)(?:\.git)?$/.exec(t);if(e)return{protocol:`https`,hostname:`github.com`,owner:e[1],name:e[2]}}return null}const nn=/^# >>> open-knowledge cli >>>\n[\s\S]*?^# <<< open-knowledge cli <<<\n?/m;function rn(e){return F(e,`Library`,`Application Support`,`OpenKnowledge`,`path-install.json`)}const an={existsSync:e=>L(e),readFileSync:(e,t)=>z(e,t),lstatSync:e=>he(e),readlinkSync:e=>_e(e)};function on(e,t=an){let n=rn(e);if(!t.existsSync(n))return null;try{let e=JSON.parse(t.readFileSync(n,`utf8`));return e?.version===1?e:null}catch{return null}}function sn(e){let t=e.replace(nn,``);return{text:t,changed:t!==e,emptyAfter:t.trim()===``}}function cn(e,t,n=an){try{return n.lstatSync(e).isSymbolicLink()?n.readlinkSync(e)===t:!1}catch{return!1}}function ln(e){return D(e)||E(e)||j(e)}const un=10*1024*1024;function dn(e,t,n,r){let i=oe(e,t,n,r);if(i.kind===`absent`||i.kind===`no-entry`)return{kind:`not-present`};if(i.kind===`decline`)return{kind:`declined`,reason:i.reason};if(!ln(i.entry))return{kind:`left-foreign`};let a;try{a=r??e.configPath(t,n)}catch{return{kind:`not-present`}}let o=e.serverName(t);if(e.format===`file`){ve(a,{force:!0});let e=k(t,n);return{kind:`removed`,trust:e.action,...e.error===void 0?{}:{trustError:e.error}}}return e.format===`toml`?mn(a,o):e.format===`yaml`?pn(a,e.topLevelKey,o):fn(a,e.topLevelKey,e.serverMapSubKey,o)}function fn(e,t,n,r){let i;try{i=z(e,`utf-8`)}catch{return{kind:`declined`,reason:`unparseable`}}if(Buffer.byteLength(i,`utf-8`)>un)return{kind:`declined`,reason:`oversize`};let{text:a,changed:o}=re(i,ie(t,n,r));return o?(_(e,a,{mode:M(e)}),{kind:`removed`}):{kind:`not-present`}}function pn(e,t,n){let r;try{r=z(e,`utf-8`)}catch{return{kind:`declined`,reason:`unparseable`}}if(Buffer.byteLength(r,`utf-8`)>un)return{kind:`declined`,reason:`oversize`};let i=r.charCodeAt(0)===65279,a=i?r.slice(1):r,o=(0,Ae.parseDocument)(a);if(o.errors.length>0)return{kind:`declined`,reason:`unparseable`};let s=[t,n];if(!o.hasIn(s))return{kind:`not-present`};o.deleteIn(s);let c=o.toString(),l=A(a);a.trim()===``||a.endsWith(`
|
|
11
|
+
`)?c.endsWith(`
|
|
12
|
+
`)||(c=`${c}\n`):c=c.replace(/\n+$/,``),l&&(c=c.replace(/\r\n/g,`
|
|
13
|
+
`).replace(/\n/g,`\r
|
|
14
|
+
`));let u=`${i?``:``}${c}`;return u!==r&&_(e,u,{mode:M(e)}),{kind:`removed`}}function mn(e,t){let n=ae();if(n.backend===`fallback`)return{kind:`declined`,reason:`no-native-writer`};let r;try{r=z(e,`utf-8`)}catch{return{kind:`declined`,reason:`unparseable`}}let i=r.charCodeAt(0)===65279,a=i?r.slice(1):r,o=A(a),s=a.trim()===``||a.endsWith(`
|
|
15
|
+
`),c;try{c=n.removeEntry(a,t)}catch{return{kind:`declined`,reason:`unparseable`}}if(!c.existed)return{kind:`not-present`};let l=c.text;s?l.endsWith(`
|
|
16
|
+
`)||(l=`${l}\n`):l=l.replace(/\n+$/,``),o&&(l=l.replace(/\r\n/g,`
|
|
17
|
+
`).replace(/\n/g,`\r
|
|
18
|
+
`));let u=`${i?``:``}${l}`;return u!==r&&_(e,u,{mode:M(e)}),{kind:`removed`}}function hn(e){return e==null?!1:e.includes(`--type=utility`)&&e.includes(`--utility-sub-type=node.mojom.NodeService`)}function gn(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 _n(e,t,n,r){if(t.status===`missing`||t.status===`corrupt`)return null;let i=t.lock,a=t.status===`alive`&&w(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:hn(n)}}function Q(e){let t=e.server.status;return t===`alive`||t===`foreign-host`?e.isDesktop?`desktop`:t===`alive`?`running`:`foreign`:`stale`}const vn=new Set([`running`,`desktop`,`foreign`]);function yn(e){switch(e){case`running`:return G.default.green(e);case`desktop`:return G.default.blue(e);case`foreign`:return G.default.cyan(e);case`stale`:return G.default.yellow(e)}}function bn(e){return e==null?`—`:`${e.cpuPercent.toFixed(1)}% / ${e.memPercent.toFixed(1)}%`}function xn(e){return`${bn(e.server.usage)} | ${bn(e.ui?.usage??null)}`}function Sn(e){return`${e.server.port===0?`(starting)`:String(e.server.port)} / ${e.ui==null?`—`:String(e.ui.port)}`}function Cn(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,Sn(e),xn(e),Q(e),String(e.server.pid),gn(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=yn(Q(e))+` `.repeat(Math.max(0,(i[t]??0)-r.length))}o.push(n)}return o.join(` `).trimEnd()}),s=G.default.dim(`To stop a server: ok stop <port|pid|directory|all>`);return[a,...o,``,s].join(`
|
|
19
|
+
`)}async function wn(e={}){let t=e.discover??g,n=e.inspect??X,r=e.log??(e=>console.log(e)),i=e.resolveCommand??f,a=e.resolveUsage??h,o=await t(),s=[];for(let e of o){let t=n(e,`server`),r=_n(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:Q(e)}));r(JSON.stringify(e,null,2));return}r(Cn(e.all?s:s.filter(e=>vn.has(Q(e)))))}function Tn(){return new te(`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 wn({all:t.all===!0||e===`all`,json:t.json===!0})})}function En(e,t,n={}){let r=n.isAlive??x,i=[];for(let[n,a]of[[`server`,e],[`ui`,t]])(a.status===`alive`||a.status===`foreign-host`&&r(a.lock.pid))&&i.push({name:n,pid:a.lock.pid,port:a.lock.port});return{targets:i}}function Dn(e){let t=e.inspect??(t=>t===`ui`?Z(e.lockDir):X(e.lockDir,t)),n=e.kill??((e,t)=>process.kill(e,t)),r=e.log??(e=>console.log(e)),i=e.error??(e=>console.error(e)),a=En(t(`server`),t(`ui`),{isAlive:e.isAlive});if(a.targets.length===0)return r(`No running open-knowledge processes.`),{stopped:[],failed:[],hadTargets:!1};let o=[],s=[];for(let e of a.targets)try{n(e.pid,`SIGTERM`),o.push(e)}catch(t){s.push({target:e,error:t instanceof Error?t.message:String(t)})}return o.length>0&&r(`Stopped: ${o.map(e=>`${e.name} (pid=${e.pid}, port=${e.port})`).join(`, `)}`),s.length>0&&i(`Failed to stop: ${s.map(({target:e,error:t})=>`${e.name} (pid=${e.pid}): ${t}`).join(`; `)}`),{stopped:o,failed:s,hadTargets:!0}}function $(e,t){return e.status===`alive`?!0:e.status===`foreign-host`?t(e.lock.pid):!1}async function On(e,t=x){let n=await g(),r=null;for(let i of n){let n=X(i,`server`),a=Z(i);if($(n,t)&&n.lock.port===e||$(a,t)&&a.lock.port===e)return i;r===null&&($(n,t)&&n.lock.pid===e||$(a,t)&&a.lock.pid===e)&&(r=i)}return r}function kn(e){let t=Dn({lockDir:e});return t.failed.length>0&&(process.exitCode=1),t}function An(e){return new te(`stop`).description(`Stop open-knowledge server(s). With no argument: stops the server for the current directory. Pass a port number, a directory path, or "all" to target globally.`).argument(`[target...]`,`port number, directory path (spaces OK), or "all"`).action(async t=>{let n=t.length===0?void 0:t.join(` `);if(n===void 0){e();let t=Dn({lockDir:m(process.cwd()),log:()=>{}});if(t.hadTargets){if(t.stopped.length>0){let e=t.stopped.map(e=>`${e.name} (pid=${e.pid}, port=${e.port})`).join(`, `);console.log(`Stopped: ${e}`)}t.failed.length>0&&(process.exitCode=1)}else await wn({});return}if(n===`all`){let e=await g();if(e.length===0){console.log(`No running open-knowledge servers found.`);return}let t=0;for(let n of e){let e=X(n,`server`),r=Z(n);!$(e,x)&&!$(r,x)||(kn(n),t++)}t===0&&console.log(`No running open-knowledge servers found.`);return}if(/^\d+$/.test(n)){let e=Number.parseInt(n,10),t=await On(e);if(t===null){console.log(`No running open-knowledge server found with port or PID ${e}.`);return}kn(t);return}kn(m(I(Fe(),n)))})}export{U as _,nn as a,Me as b,on as c,Z as d,X as f,Ie as g,Yt as h,dn as i,sn as l,Jt as m,An as n,cn as o,Qt as p,Tn as r,rn as s,Dn as t,tn as u,Fe as v,Pe as y};
|
|
20
|
+
//# sourceMappingURL=src-67yUma5a.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Ac as e,Hs as t,Ts as n,U as r,Ws as i,ec as a,q as o,ws as s,x as c,xs as l,y as u}from"./src-BD1wHyiU.mjs";import{$ as d,$i as f,$n as p,$r as m,$t as h,A as g,Ai as _,An as v,Ar 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,Ci as O,Cn as k,Cr as A,Ct as j,D 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,Ft as K,G as q,Gi as J,Gn as Y,Gr as X,Gt as Z,H as Q,Hi as $,Hn as ee,Hr as te,Ht as ne,I as re,Ii as ie,In as ae,Ir as oe,It as se,J as ce,Ji as le,Jn as ue,Jr as de,Jt as fe,K as pe,Ki as me,Kn as he,Kr as ge,Kt as _e,L as ve,Li as ye,Ln as be,Lr as xe,Lt as Se,M as Ce,Mi as we,Mn as Te,Mt as Ee,N as De,Ni as Oe,Nn as ke,Nt as Ae,O as je,Oi as Me,On as Ne,Or as Pe,Ot as Fe,P as Ie,Pi as Le,Pn as Re,Pt as ze,Q as Be,Qi as Ve,Qn as He,Qr as Ue,Qt as We,R as Ge,Ri as Ke,Rn as qe,Rr as Je,Rt as Ye,S as Xe,Sa as Ze,Si as Qe,Sn as $e,Sr as et,St as tt,T as nt,Ta as rt,Ti as it,Tn as at,Tr as ot,Tt as st,U as ct,Ui as lt,Un as ut,Ur as dt,Ut as ft,V as pt,Vi as mt,Vn as ht,Vr as gt,Vt as _t,W as vt,Wi as yt,Wn as bt,Wr as xt,Wt as St,X as Ct,Xi as wt,Xn as Tt,Xr as Et,Xt as Dt,Y as Ot,Yi as kt,Yn as At,Yr as jt,Yt as Mt,Z as Nt,Zi as Pt,Zn as Ft,Zr as It,Zt as Lt,_ as Rt,_a as zt,_i as Bt,_n as Vt,_r as Ht,_t as Ut,a as Wt,aa as Gt,ai as Kt,an as qt,ar as Jt,at as Yt,b as Xt,ba as Zt,bi as Qt,bn as $t,br as en,bt as tn,c as nn,ca as rn,ci as an,cn as on,cr as sn,ct as cn,d as ln,da as un,di as dn,dn as fn,dr as pn,ea as mn,ei as hn,en as gn,er as _n,et as vn,f as yn,fa as bn,fi as xn,fn as Sn,fr as Cn,g as wn,ga as Tn,gi as En,gn as Dn,gr as On,gt as kn,h as An,ha as jn,hn as Mn,hr as Nn,i as Pn,ia as Fn,ii as In,in as Ln,ir as Rn,it as zn,j as Bn,ji as Vn,jn as Hn,jt as Un,k as Wn,ki as Gn,kn as Kn,kr as qn,kt as Jn,l as Yn,la as Xn,li as Zn,ln as Qn,lr as $n,lt as er,m as tr,ma as nr,mi as rr,mn as ir,mr as ar,n as or,na as sr,ni as cr,nn as lr,nr as ur,nt as dr,o as fr,oa as pr,oi as mr,on as hr,or as gr,ot as _r,p as vr,pa as yr,pi as br,pn as xr,pr as Sr,q as Cr,qi as wr,qn as Tr,qr as Er,qt as Dr,r as Or,ra as kr,ri as Ar,rn as jr,rr as Mr,rt as Nr,s as Pr,sa as Fr,si as Ir,sn as Lr,sr as Rr,st as zr,t as Br,ta as Vr,ti as Hr,tn as Ur,tr as Wr,tt as Gr,u as Kr,ua as qr,ui as Jr,un as Yr,ur as Xr,v as Zr,va as Qr,vi as $r,vn as ei,vr as ti,vt as ni,w as ri,wa as ii,wi as ai,wn as oi,wr as si,wt as ci,x as li,xa as ui,xi as di,xn as fi,xr as pi,xt as mi,y as hi,ya as gi,yi as _i,yn as vi,yr as yi,yt as bi,z as xi,zi as Si,zn as Ci,zr as wi,zt as Ti}from"./src-CpD0HabK.mjs";import{C as Ei,E as Di,T as Oi,_ as ki,b as Ai,c as ji,d as Mi,g as Ni,i as Pi,l as Fi,m as Ii,n as Li,p as Ri,s as zi,t as Bi,u as Vi,v as Hi,w as Ui,x as Wi,y as Gi}from"./fs-traced-2B_-YK-g.mjs";import{a as Ki,d as qi,f as Ji,i as Yi,l as Xi,n as Zi,r as Qi,t as $i,u as ea}from"./logger-Dq-cRhcP.mjs";import{C as ta,S as na,_ as ra,a as ia,b as aa,c as oa,d as sa,f as ca,g as la,h as ua,i as da,l as fa,m as pa,n as ma,o as ha,p as ga,r as _a,s as va,t as ya,u as ba,x as xa}from"./server-lock-RKPNHNqb.mjs";export{zt as AGENT_ID_MAX_LEN,Qr as AGENT_ID_RE,Oe as AGENT_WRITE_ORIGIN,ii as AcpPermissionStore,ui as AcpRegistry,_i as AcpThreadManager,Bt as AgentFocusBroadcaster,En as AgentPresenceBroadcaster,Le as AgentSessionCapacityError,W as AgentSessionManager,Ut as AutoStartDisabledError,Nn as BUNDLE_IDS,On as BUNDLE_SCOPE,Ht as BUNDLE_SKILL_NAME,ue as BacklinkIndex,J as CC1Broadcaster,i as CC1_CONTRACT_VERSION,Ln as CONFIG_FILENAME,ee as CONFLICT_MARKER_RE,Je as CURSOR_BUNDLE_PATHS_BY_PLATFORM,Rt as ConfigSchema,Pt as DEFAULT_CHECKPOINT_RETENTION,cr as DEFAULT_EMBEDDINGS_DIMENSIONS,Se as DEFAULT_PACK_ID,pt as DocumentDurabilityState,Ar as EMBEDDINGS_API_KEY_ENV,Dn as ExposureConsentError,Ze as FEATURED_AGENT_IDS,Ve as FILE_SYSTEM_WRITER,he as FILE_WATCHER_ORIGIN,Et as FileEmbeddingsBackend,h as GIT_PREFLIGHT_FAIL_SPAN_NAME,f as GIT_UPSTREAM_WRITER,rt as GitDirAccessError,ai as GitNotAvailableError,it as GitTooOldError,ni as HOCUSPOCUS_AUTH_REJECTION_REASONS,bi as HocuspocusAuthRejection,tn as HocuspocusAuthTokenSchema,Sn as HomeProjectRootError,xt as INSTALLED_AGENTS_SCHEMES,cn as JSON_SCHEMA_DIALECT_2020_12,t as LINEAGE_EPOCH_KEY,Ge as LIVE_DERIVED_INDEX_DEBOUNCE_MS,Ye as LOG_MD_TEMPLATE,I as MANAGED_RENAME_ORIGIN,Qt as MAX_ACP_THREADS,ie as MAX_AGENT_SESSIONS,Qe as MCP_CONNECTION_ID_HEADER,l as MCP_SERVER_NAME,ye as MIN_EVICTABLE_IDLE_MS,z as MIN_GIT_VERSION,Q as MISSING_OK_CONFIG_MESSAGE,R as MalformedGitPointerError,vn as McpLogger,ct as MissingOkConfigError,Si as OBSERVER_SYNC_ORIGIN,qt as OK_OKIGNORE_TEMPLATE,ti as ONBOARDING_BUNDLE_IDS,s as ORPHAN_MODES,e as PROTOCOL_VERSION,$i as PinoLogger,fa as ProcessLockCollisionError,Yn as ProjectGitInitError,Fe as ROLLBACK_ORIGIN,hr as ROOT_GITIGNORE_TEMPLATE,aa as RUNTIME_VERSION,mn as SERVICE_WRITER,Xr as SKILL_INSTALL_EVENTS_FILE_REL,r as SKILL_STATE_TARGETS,Ti as STARTER_FOLDERS,T as STARTER_FOLDER_FRONTMATTER_FILENAME,_t as STARTER_PACKS,ne as STARTER_PACK_IDS,ft as STARTER_TEMPLATES,nt as STATE_MANIFEST_FILENAME,xa as STATE_SCHEMA_VERSION,a as SYSTEM_DOC_NAME,Mt as SeedPrerequisiteError,Dt as SeedRootDirError,ya as ServerLockCollisionError,Br as SingleFileNotAFileError,or as SingleFileNotFoundError,Or as SingleFileNotMarkdownError,L as StateManifestError,Tr as TagIndex,yi as USER_GLOBAL_BUNDLE_IDS,Jn as __getShowAllWalkStatsForTesting,b as __resetShowAllWalkStatsForTesting,ba as acquireProcessLock,ma as acquireServerLock,Ke as applyAgentMarkdownWrite,C as applyExternalChange,se as applySeed,M as assertCompatibleStateManifest,N as assertGitAvailable,Ne as assertNeverDiskEvent,xr as assertNotHomeProjectRoot,$r as attachAcpThreadSocket,kn as attachIdleShutdown,Zr as bootServer,Tt as buildAndOpenSkill,Lr as buildConfigYmlContent,Ot as buildExecResult,Vt as buildIngressPolicy,di as buildOkMcpStdioCommand,Cn as buildSkillZip,St as buildStarterFolderFrontmatterYaml,Vr as buildWipTree,en as bundleSkillMdPath,It as canonicalProjectKey,ir as canonicalizeForCompare,Kn as classifyEvents,Bi as classifyFsPath,Ue as clearAllEmbeddingsKeys,Kt as clearContributors,Z as coercePackId,u as colorFromSeed,sr as commitUpstreamImport,kr as commitWip,Fn as commitWipFromTree,Me as compareSemver,A as composeEffectiveLinterConfig,si as composeFrontmatterSchemasConfig,ut as containsConflictMarkers,v as contentHash,mr as contributorCount,Ie as countShadowObjects,U as countStaleAgentWipRefs,re as countWipRefs,Un as createApiExtension,H as createAssetServeMiddleware,q as createCollaborationHost,oe as createContentFilter,xe as createContentFilterAsync,m as createEmbeddingsSecretStore,Pn as createEphemeralProjectDir,ht as createExternalChangeHandler,yn as createFileLogger,xi as createLiveDerivedIndexExtension,Cr as createMcpHttpHandler,X as createOsProbe,De as createPersistenceExtension,E as createServer,Bn as createServerObserverExtension,$ as createStreamingErrorWriter,Zi as createTestLogger,hn as describeStoredEmbeddingsKey,wn as detectClaudeDesktopPresence,Gn as detectGit,je as detectProjectShape,Ft as detectUserSkillHosts,Nr as discoverLockDirs,F as discoverMarkdownlintConfig,gn as emitPreflightFailureSpan,Ct as encodeDocName,Nt as encodeFolderRoute,Be as encodeSkillRoute,Kr as ensureProjectGit,on as ensureProjectSkillGitignore,lt as errorResponse,Hn as evictStaleTrackerEntries,Ee as extractHeadings,zn as extractOkBinaryPath,At as extractWikiLinksFromMarkdown,_ as fallbackPaths,ln as findEnclosingGitRoot,B as findEnclosingProjectRoot,Pe as findNativeMarkdownlintFile,vr as flushFileLogger,mi as formatAuthRejectionWire,Ir as formatContributors,an as formatContributorsFrom,ze as formatPackRationale,Gt as gcCheckpointRefs,Gr as getCurrentMcpLogger,ei as getIngressContext,xn as getLocalDir,tr as getLogFilePath,Qi as getLogger,An as getLogsDir,ra as getMachineId,Gi as getMeter,bn as getMetrics,Ai as getTracer,yr as handleCollabSocketError,wi as handleSpawnCursor,vi as hasForwardingHeaders,ve as hasGcLogLatch,c as iconFromClientName,nr as incrementCollabSocketFilteredError,jn as incrementServerObserverFire,Qn as initContent,pr as initShadowRepo,Wi as initTelemetry,Xt as initToleranceTelemetryWriter,er as installJsonSchemaDialect,zr as installPrettyZodErrors,Yi as installTestLoggers,He as installUserSkill,at as isAllowedApiOrigin,k as isAllowedWorkspaceHostHeader,me as isConfigDoc,tt as isHocuspocusAuthRejectionReason,Mn as isHomeDir,$t as isHostAdmitted,_e as isKnownPackId,wr as isLinkIndexExcludedDoc,oi as isLoopbackAddress,le as isManagedArtifactDoc,fi as isOriginAdmitted,n as isOrphanMode,S as isPairedWriteOrigin,w as isPathWithinDir,$e as isPeerAdmitted,na as isProcessAlive,P as isProjectRoot,kt as isReservedForUserTree,Te as isSelfWrite,wt as isSystemDoc,li as isToleranceTelemetryEnabled,ta as isValidLockPid,ke as lastKnownHash,Fr as listRescueCheckpoints,Dr as listStarterPacks,D as loadCustomAgents,Ce as loadPrincipal,_a as lockAdvertisesUi,sa as lockBaseUrl,ca as lockFilePath,Ki as loggerFactory,Xi as logsCurrentPath,ea as logsPreviousPath,Hr as makeLazyEmbeddingsKeyStore,da as markServerLockDraining,vt as mountMcpAndApi,Li as normalizeFsPath,pi as originGitHubHost,Yr as packageVersionMajorMinor,j as parseAuthRejectionWire,Vn as parseGitVersion,ci as parseHocuspocusAuthToken,pe as parseKeepaliveConnectionId,Re as pathToDocName,K as planSeed,Wt as prepareSingleFileOpen,Yt as processCommand,_r as processUsage,Wr as readAllTargets,ur as readBundleDecision,qn as readOwnNativeRules,ga as readProcessLock,pa as readProcessLockDetailed,x as readProjectHeadState,jt as readProjectLocalSemanticConfig,ia as readServerLock,Mr as readServerPackageVersion,Rn as readSkillInstallStateSnapshot,Wn as readStateManifest,Jt as readTargetRecordedAt,gr as readTargetVersion,bt as reconcile,Zn as recordContributor,pn as recordSkillInstallEvent,ce as registerAllTools,G as registerWrite,ua as releaseProcessLock,ha as releaseServerLock,ae as removeLastKnownHash,_n as reportSkillInstall,Tn as resetMetrics,p as resolveBuiltinSkillHosts,o as resolveBundleEnabled,Sr as resolveBundledSkillDir,br as resolveContentDir,gt as resolveCursorBinaryDefault,te as resolveCursorSpawnInvocation,ot as resolveEffectiveLinterConfig,In as resolveEmbeddingsCredential,rr as resolveLockDir,V as resolveNativeConfigForDoc,y as resolveNativeMarkdownlintConfig,fe as resolvePack,Pr as resolvePackageVersion,$n as resolveSkillInstallReportSettings,d as resolveUiInfo,Jr as restoreContributors,hi as restoreLifecycleFromConflictsJson,Er as rewriteMarkdownLinksForDocumentRename,de as rewriteWikiLinksForDocumentRename,Ur as runAuthReposSubprocess,lr as runAuthStatusSubprocess,Lt as runCloneSubprocess,jr as runDeviceFlowSubprocess,dr as runWithMcpLogger,ge as safeContentPath,Ae as safeSubdir,rn as safetyCheckpoint,O as sanitizeClientName,Xn as saveInMemoryCheckpoint,qr as saveVersion,st as seedBasenameIndex,fr as serializeError,Ei as setActiveSpanAttributes,mt as setupServerObservers,un as shadowGit,Ui as shutdownTelemetry,qi as spansCurrentPath,Ji as spansPreviousPath,dt as spawnDetached,Y as splitMarkdownBlocks,be as startWatcher,yt as streamingProblemEvent,dn as swapContributors,Xe as teardownToleranceTelemetryWriter,gi as toBroadcasterKey,Pi as tracedAppendFileSync,zi as tracedLinkSync,ji as tracedMkdir,Fi as tracedMkdirSync,Vi as tracedRename,Mi as tracedRenameSync,Ri as tracedRmSync,Ii as tracedRmdirSync,Ni as tracedUnlinkSync,ki as tracedWriteFile,Hi as tracedWriteFileSync,ri as trustSystemCertificates,nn as untrackTrackedProjectSkillProjection,qe as updateLastKnownHash,la as updateProcessLockPort,va as updateServerLockPort,Zt as validateAgentId,We as validateCloneInputs,ar as validateSkillZip,oa as waitForServerLockDrain,we as withHiddenWindowsConsole,Oi as withSpan,Di as withSpanSync,Rr as writeBundleDecision,et as writeMarkdownlintRule,fn as writeRootGitignoreForNewRepo,g as writeStateManifest,sn as writeTargetVersion,Ci as writeTracker};
|