@inkeep/open-knowledge 0.42.0-beta.11 → 0.42.0-beta.13
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-DBmMQ34A.mjs → acp-harness-probe-PwxCSk8L.mjs} +2 -2
- package/dist/assets/skills/discovery/SKILL.md +1 -1
- package/dist/assets/skills/project/SKILL.md +1 -1
- package/dist/cli.mjs +6 -6
- package/dist/constants-CcMCMPg3.mjs +2 -0
- package/dist/index.mjs +1 -1
- package/dist/{init-C_8c_GuV.mjs → init-C_ZFDDwH.mjs} +3 -3
- package/dist/init-lRVOzPU9.mjs +1 -0
- package/dist/{launch-json-removal-BgElVgLw.mjs → launch-json-removal-DPvJksib.mjs} +2 -2
- package/dist/{loader-CapxpoeG.mjs → loader-0YCBN4cH.mjs} +2 -2
- package/dist/loader-CSY1M15w.mjs +1 -0
- package/dist/preview-CiaBar1u.mjs +1 -0
- package/dist/{preview-BVUzeg2X.mjs → preview-Cjg4sLCV.mjs} +2 -2
- package/dist/public/assets/{ActivityModeContent-Cl6MVlKs.js → ActivityModeContent-Cj3BeHpK.js} +1 -1
- package/dist/public/assets/{AgentDiffPane-BiOqwTGD.js → AgentDiffPane-f8e9_JvG.js} +1 -1
- package/dist/public/assets/{AgentThreadClientBinder-Ci5b-Bik.js → AgentThreadClientBinder-UR-Kf4b1.js} +1 -1
- package/dist/public/assets/CodeMirrorPropInput-B34vnmpV.js +3 -0
- package/dist/public/assets/{DocumentContext-DmbxaZ31.js → DocumentContext-BiAlIaIL.js} +20 -20
- package/dist/public/assets/{EditorModeToggle-BUtGaXAa.js → EditorModeToggle-BjJNUMBS.js} +1 -1
- package/dist/public/assets/{EnableSyncConfirmDialog-FSvMamF-.js → EnableSyncConfirmDialog-B05Urde9.js} +1 -1
- package/dist/public/assets/FeedbackForm-BtLP5P4r.js +1 -0
- package/dist/public/assets/{GraphPanel-BhKDEhBK.js → GraphPanel-Bc99r1NG.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-Bphs6Vft.js → LintConfigEditor-gSyEWnW_.js} +1 -1
- package/dist/public/assets/{ManagedArtifactProperties-BICCproL.js → ManagedArtifactProperties-BHDbPsDj.js} +1 -1
- package/dist/public/assets/{McpConsentDialogBody-BUAdKJYA.js → McpConsentDialogBody-BT0tOjYc.js} +1 -1
- package/dist/public/assets/{MermaidDocEditor-CArQ2awe.js → MermaidDocEditor-ppbCwqCZ.js} +1 -1
- package/dist/public/assets/PropertyPanel-Bke_n9xy.js +2 -0
- package/dist/public/assets/ReportBugDialogBody-CkyHWZh9.js +3 -0
- package/dist/public/assets/{SchemaConfigEditor-ySQXN74w.js → SchemaConfigEditor-5fvtp9pn.js} +1 -1
- package/dist/public/assets/{SettingsDialogBody-BR90gqRV.js → SettingsDialogBody-DYHvNSXS.js} +3 -3
- package/dist/public/assets/{ShareBranchSwitchDialog-BLjQiqCJ.js → ShareBranchSwitchDialog-DEHPks5w.js} +1 -1
- package/dist/public/assets/{ShareReceiveDialog-DZnpGvOf.js → ShareReceiveDialog-IX_2OQ-z.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-fLmT0kSW.js → ShareReceiveMissDialog-BsHBuFKr.js} +1 -1
- package/dist/public/assets/{SkillEditorActions-DmTF2MeC.js → SkillEditorActions-Bg7DEmMN.js} +1 -1
- package/dist/public/assets/{SourceEditor-qMGOYJ3N.js → SourceEditor-rMBsqzFc.js} +1 -1
- package/dist/public/assets/{TerminalPanel-BdHIwJQ0.js → TerminalPanel-xzIwFtxc.js} +1 -1
- package/dist/public/assets/{TerminalSessionsHost-DEF-jaBw.js → TerminalSessionsHost-DPN4hpOi.js} +2 -2
- package/dist/public/assets/{TerminalWindowApp-DRYjIyfY.js → TerminalWindowApp-BEx4mQbz.js} +1 -1
- package/dist/public/assets/{ThreadView-Ui9528Sa.js → ThreadView-BEUMdycz.js} +1 -1
- package/dist/public/assets/{TimelineDiffPane-BKvmxd4S.js → TimelineDiffPane-60Mqrg_1.js} +1 -1
- package/dist/public/assets/{agent-diff-store-Dk_EMeDT.js → agent-diff-store-D9meLWbh.js} +1 -1
- package/dist/public/assets/{agent-visibility-lcX1lXPE.js → agent-visibility-CYbXZE0k.js} +1 -1
- package/dist/public/assets/auth-state-cache-B9EBu3Gl.js +11 -0
- package/dist/public/assets/{client-version-DsIiyH4R.js → client-version-D5pI6rXA.js} +1 -1
- package/dist/public/assets/{config-provider-KfXGhZGq.js → config-provider-DjoTPI46.js} +2 -2
- package/dist/public/assets/{dist-K2Lnb8ar.js → dist-DbWN0KUu.js} +1 -1
- package/dist/public/assets/{doc-hash-CrTlDYWN.js → doc-hash-Ds3Xt5sU.js} +1 -1
- package/dist/public/assets/{documents-events-DXGF-dAt.js → documents-events-CeD7Nm0E.js} +1 -1
- package/dist/public/assets/{file-tree-adapter-BGyAmOby.js → file-tree-adapter-UXgwHNRD.js} +1 -1
- package/dist/public/assets/{file-tree-utils-DYlxfHyR.js → file-tree-utils-CKB7vhwx.js} +1 -1
- package/dist/public/assets/{index-BcJJMb0u.js → index-CFaXQy8P.js} +101 -101
- package/dist/public/assets/{lint-config-client-Cs5xX92A.js → lint-config-client-CU8tKrUp.js} +1 -1
- package/dist/public/assets/{markdownlint-rule-browser-DWPAvaEE.js → markdownlint-rule-browser-D-lKa2AX.js} +1 -1
- package/dist/public/assets/{navigation-targets-DZ8qXZfO.js → navigation-targets-DlApq0F4.js} +1 -1
- package/dist/public/assets/{open-managed-artifact-tab-CN_5Yypp.js → open-managed-artifact-tab-C_zW-xH-.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-CoRTwByS.js → pending-receive-nav-store-CRA3584T.js} +1 -1
- package/dist/public/assets/{prop-types-BotQZR3O.js → prop-types-Bp7ajkYA.js} +1 -1
- package/dist/public/assets/{receive-store-BSouIIfb.js → receive-store-CmOFuJ5o.js} +1 -1
- package/dist/public/assets/{selection-context-Cw8sdnQt.js → selection-context-DJG3xvFp.js} +1 -1
- package/dist/public/assets/{skill-actions-ByOT1LF5.js → skill-actions-CnJP2Bcc.js} +1 -1
- package/dist/public/assets/{skills-api-DuuLwHP_.js → skills-api-CN8Hksry.js} +1 -1
- package/dist/public/assets/{src-JMYZQjfF.js → src-UzA84-l2.js} +1 -1
- package/dist/public/assets/{tag-pill-input-DEleMveu.js → tag-pill-input-DVEEYU9y.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-BjxDc1Ux.js → target-navigation-intent-DBKxmlEZ.js} +1 -1
- package/dist/public/assets/{terminal-launch-events-CB8W0l3G.js → terminal-launch-events-OZusAMc8.js} +1 -1
- package/dist/public/assets/{terminal-telemetry-DAmwFnDW.js → terminal-telemetry-1gUD9W57.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-DRTDYx9R.js → typing-burst-detector-CjeuhXb7.js} +1 -1
- package/dist/public/assets/{uninstall-DLWfGGM2.js → uninstall-Cp4M347z.js} +1 -1
- package/dist/public/assets/{use-activity-panel-BYuVH26E.js → use-activity-panel-CZ8r7sJr.js} +1 -1
- package/dist/public/assets/{use-apply-config-color-theme-CM2IyhSv.js → use-apply-config-color-theme-kT3YWc5p.js} +2 -2
- package/dist/public/assets/{use-collab-url-C1dCwPEb.js → use-collab-url-DPrY37Xq.js} +1 -1
- package/dist/public/assets/{use-live-xterm-theme-D5O8Rd4P.js → use-live-xterm-theme-BYn_alYX.js} +1 -1
- package/dist/public/assets/{use-settings-route-BA4-u6C_.js → use-settings-route-DbIUNQxX.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-DjCiM7M-.js → use-terminal-enabled-BPcyrJJU.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-D2WOIqNA.js → use-timeline-entry-diff-vG8YRtnb.js} +4 -4
- package/dist/public/assets/{use-workspace-CpQP9Zp4.js → use-workspace-BJkoTGFP.js} +1 -1
- package/dist/public/assets/{workspace-paths-DeAnYp7x.js → workspace-paths-BYp4HrI_.js} +1 -1
- package/dist/public/index.html +35 -35
- package/dist/public/uninstall.html +2 -2
- package/dist/{repair-launch-json-DZb9bXlv.mjs → repair-launch-json-CZawWAqd.mjs} +2 -2
- package/dist/{repair-mcp-configs-DUqMgq-Z.mjs → repair-mcp-configs-DpdVVhiU.mjs} +2 -2
- package/dist/src-9fqRbYyu.mjs +22 -0
- package/dist/{start-DS4_nvkv.mjs → start-FUQOcvoI.mjs} +2 -2
- package/dist/start-eE4o515K.mjs +1 -0
- package/package.json +4 -4
- package/dist/constants-BfFX3vAt.mjs +0 -2
- package/dist/init-3qum_Y1d.mjs +0 -1
- package/dist/loader-BqiMtLnR.mjs +0 -1
- package/dist/preview-DZjLklB1.mjs +0 -1
- package/dist/public/assets/CodeMirrorPropInput-Bf8nZ15E.js +0 -3
- package/dist/public/assets/FeedbackForm-DsrWQyTZ.js +0 -1
- package/dist/public/assets/PropertyPanel-BmYr8imb.js +0 -2
- package/dist/public/assets/ReportBugDialogBody-V-Yu4WZz.js +0 -2
- package/dist/public/assets/auth-state-cache-CDvpOBBF.js +0 -11
- package/dist/src-BaOq9MZ2.mjs +0 -22
- package/dist/start-CBgO44sG.mjs +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{o as e,t}from"./chunk-CYidjpOJ.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{n as r,p as i}from"./DocumentContext-DmbxaZ31.js";import{t as a}from"./react-f2sANaYj.js";import{t as o}from"./react-dom-DPxgxlDT.js";import{t as s}from"./compiler-runtime-BfE3aGVn.js";import{et as c,k as l,q as u}from"./CodeMirrorPropInput-Bf8nZ15E.js";import{Ei as d,Qi as f,Y as p,Zi as m,da as h,fa as g,ii as _,la as v,na as y,pa as b,ra as x,sa as S,zi as ee}from"./dist-K2Lnb8ar.js";import{t as te}from"./libesm-CHqp8owk.js";var C=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Pointer=void 0,e.unescapeToken=t,e.escapeToken=n;function t(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}function n(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}e.Pointer=function(){function e(e){e===void 0&&(e=[``]),this.tokens=e}return e.fromJSON=function(n){var r=n.split(`/`).map(t);if(r[0]!==``)throw Error(`Invalid JSON Pointer: ${n}`);return new e(r)},e.prototype.toString=function(){return this.tokens.map(n).join(`/`)},e.prototype.evaluate=function(e){for(var t=null,n=``,r=e,i=1,a=this.tokens.length;i<a;i++)t=r,n=this.tokens[i],!(n==`__proto__`||n==`constructor`||n==`prototype`)&&(r=(t||{})[n]);return{parent:t,key:n,value:r}},e.prototype.get=function(e){return this.evaluate(e).value},e.prototype.set=function(e,t){var n=this.evaluate(e);n.parent&&(n.parent[n.key]=t)},e.prototype.push=function(e){this.tokens.push(e)},e.prototype.add=function(t){return new e(this.tokens.concat(String(t)))},e.prototype.parent=function(){return new e(this.tokens.length>1?this.tokens.slice(0,-1):[``])},e}()})),w=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.hasOwnProperty=void 0,e.objectType=t,e.clone=r,e.hasOwnProperty=Object.prototype.hasOwnProperty;function t(e){return e===void 0?`undefined`:e===null?`null`:Array.isArray(e)?`array`:typeof e}function n(e){return typeof e==`object`&&!!e}function r(t){if(!n(t))return t;if(t.constructor==Array){for(var i=t.length,a=Array(i),o=0;o<i;o++)a[o]=r(t[o]);return a}if(t.constructor==Date)return new Date(+t);var s={};for(var c in t)e.hasOwnProperty.call(t,c)&&(s[c]=r(t[c]));return s}})),T=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.isDestructive=n,e.subtract=r,e.intersection=i,e.diffArrays=l,e.diffObjects=u,e.diffAny=d;var t=w();function n(e){var t=e.op;return t===`remove`||t===`replace`||t===`copy`||t===`move`}function r(e,n){var r=[];for(var i in e)t.hasOwnProperty.call(e,i)&&e[i]!==void 0&&!(t.hasOwnProperty.call(n,i)&&n[i]!==void 0)&&r.push(i);return r}function i(e){for(var n=e.length,r={},i=0;i<n;i++){var a=e[i];for(var o in a)t.hasOwnProperty.call(a,o)&&a[o]!==void 0&&(r[o]=(r[o]||0)+1)}for(var o in r)r[o]<n&&delete r[o];return Object.keys(r)}function a(e,n){var r=[];for(var i in e)t.hasOwnProperty.call(e,i)&&e[i]!==void 0&&t.hasOwnProperty.call(n,i)&&n[i]!==void 0&&r.push(i);return r}function o(e){return e.op===`add`}function s(e){return e.op===`remove`}function c(e,t){return{operations:e.operations.concat(t),cost:e.cost+1}}function l(e,t,n,r){r===void 0&&(r=d);var i=Math.max(e.length,t.length),a=new Map([[0,{operations:[],cost:0}]]);function l(o,s){var u=o*i+s,d=a.get(u);if(d===void 0){if(o>0&&s>0&&!r(e[o-1],t[s-1],n.add(String(o-1))).length)d=l(o-1,s-1);else{var f=[];if(o>0){var p=l(o-1,s),m={op:`remove`,index:o-1};f.push(c(p,m))}if(s>0){var h=l(o,s-1),g={op:`add`,index:o-1,value:t[s-1]};f.push(c(h,g))}if(o>0&&s>0){var _=l(o-1,s-1),v={op:`replace`,index:o-1,original:e[o-1],value:t[s-1]};f.push(c(_,v))}d=f.sort(function(e,t){return e.cost-t.cost})[0]}a.set(u,d)}return d}var u=isNaN(e.length)||e.length<=0?0:e.length;return l(u,isNaN(t.length)||t.length<=0?0:t.length).operations.reduce(function(e,t){var i=e[0],a=e[1];if(o(t)){var c=t.index+1+a,l=c<u+a?String(c):`-`,d={op:t.op,path:n.add(l).toString(),value:t.value};return[i.concat(d),a+1]}else if(s(t)){var d={op:t.op,path:n.add(String(t.index+a)).toString()};return[i.concat(d),a-1]}else{var f=n.add(String(t.index+a)),p=r(t.original,t.value,f);return[i.concat.apply(i,p),a]}},[[],0])[0]}function u(e,t,n,i){i===void 0&&(i=d);var o=[];return r(e,t).forEach(function(e){o.push({op:`remove`,path:n.add(e).toString()})}),r(t,e).forEach(function(e){o.push({op:`add`,path:n.add(e).toString(),value:t[e]})}),a(e,t).forEach(function(r){o.push.apply(o,i(e[r],t[r],n.add(r)))}),o}function d(e,n,r,i){if(i===void 0&&(i=d),e===n)return[];var a=(0,t.objectType)(e),o=(0,t.objectType)(n);return a==`array`&&o==`array`?l(e,n,r,i):a==`object`&&o==`object`?u(e,n,r,i):[{op:`replace`,path:r.toString(),value:n}]}})),ne=t((e=>{var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,`__esModule`,{value:!0}),e.InvalidOperationError=e.TestError=e.MissingError=void 0,e.add=l,e.remove=u,e.replace=d,e.move=f,e.copy=p,e.test=m,e.apply=g;var n=C(),r=w(),i=T(),a=function(e){t(n,e);function n(t){var n=e.call(this,`Value required at path: ${t}`)||this;return n.path=t,n.name=`MissingError`,n}return n}(Error);e.MissingError=a;var o=function(e){t(n,e);function n(t,n){var r=e.call(this,`Test failed: ${t} != ${n}`)||this;return r.actual=t,r.expected=n,r.name=`TestError`,r}return n}(Error);e.TestError=o;function s(e,t,n){if(Array.isArray(e))if(t==`-`)e.push(n);else{var r=parseInt(t,10);e.splice(r,0,n)}else e[t]=n}function c(e,t){if(Array.isArray(e)){var n=parseInt(t,10);e.splice(n,1)}else delete e[t]}function l(e,t,i){var o=n.Pointer.fromJSON(t.path);if(i?.implicitArrayCreation&&o.tokens[o.tokens.length-1]===`-`){var c=o.parent().evaluate(e);c.value===void 0&&(0,r.objectType)(c.parent)===`object`&&(c.parent[c.key]=[])}var l=o.evaluate(e);return l.parent===void 0||i?.implicitArrayCreation&&l.key===`-`&&!Array.isArray(l.parent)?new a(t.path):(s(l.parent,l.key,(0,r.clone)(t.value)),null)}function u(e,t,r){var i=n.Pointer.fromJSON(t.path).evaluate(e);return i.value===void 0?new a(t.path):(c(i.parent,i.key),null)}function d(e,t,i){var o=n.Pointer.fromJSON(t.path).evaluate(e);if(o.parent===null)return new a(t.path);if(Array.isArray(o.parent)){if(parseInt(o.key,10)>=o.parent.length)return new a(t.path)}else if(o.value===void 0)return new a(t.path);return o.parent[o.key]=(0,r.clone)(t.value),null}function f(e,t,r){var i=n.Pointer.fromJSON(t.from).evaluate(e);if(i.value===void 0)return new a(t.from);var o=n.Pointer.fromJSON(t.path).evaluate(e);return o.parent===void 0?new a(t.path):(c(i.parent,i.key),s(o.parent,o.key,i.value),null)}function p(e,t,i){var o=n.Pointer.fromJSON(t.from).evaluate(e);if(o.value===void 0)return new a(t.from);var c=n.Pointer.fromJSON(t.path).evaluate(e);return c.parent===void 0?new a(t.path):(s(c.parent,c.key,(0,r.clone)(o.value)),null)}function m(e,t,r){var a=n.Pointer.fromJSON(t.path).evaluate(e);return(0,i.diffAny)(a.value,t.value,new n.Pointer).length?new o(a.value,t.value):null}var h=function(e){t(n,e);function n(t){var n=e.call(this,`Invalid operation: ${t.op}`)||this;return n.operation=t,n.name=`InvalidOperationError`,n}return n}(Error);e.InvalidOperationError=h;function g(e,t,n){switch(t.op){case`add`:return l(e,t,n);case`remove`:return u(e,t,n);case`replace`:return d(e,t,n);case`move`:return f(e,t,n);case`copy`:return p(e,t,n);case`test`:return m(e,t,n)}return new h(t)}})),re=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Pointer=void 0,e.applyPatch=i,e.createPatch=o;var t=C();Object.defineProperty(e,`Pointer`,{enumerable:!0,get:function(){return t.Pointer}});var n=ne(),r=T();function i(e,t,r){return t.map(function(t){return(0,n.apply)(e,t,r)})}function a(e){function t(n,i,a){var o=e(n,i,a);return Array.isArray(o)?o:(0,r.diffAny)(n,i,a,t)}return t}function o(e,n,i){var o=new t.Pointer;return(i?a(i):r.diffAny)(e,n,o)}})),E=e(a(),1),ie=e(o(),1),D=s(),O=re();function k(){}k.prototype={diff:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.callback;typeof n==`function`&&(r=n,n={}),this.options=n;var i=this;function a(e){return r?(setTimeout(function(){r(void 0,e)},0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e)),t=this.removeEmpty(this.tokenize(t));var o=t.length,s=e.length,c=1,l=o+s;n.maxEditLength&&(l=Math.min(l,n.maxEditLength));var u=n.timeout??1/0,d=Date.now()+u,f=[{oldPos:-1,lastComponent:void 0}],p=this.extractCommon(f[0],t,e,0);if(f[0].oldPos+1>=s&&p+1>=o)return a([{value:this.join(t),count:t.length}]);var m=-1/0,h=1/0;function g(){for(var n=Math.max(m,-c);n<=Math.min(h,c);n+=2){var r=void 0,l=f[n-1],u=f[n+1];l&&(f[n-1]=void 0);var d=!1;if(u){var g=u.oldPos-n;d=u&&0<=g&&g<o}var _=l&&l.oldPos+1<s;if(!d&&!_){f[n]=void 0;continue}if(r=!_||d&&l.oldPos+1<u.oldPos?i.addToPath(u,!0,void 0,0):i.addToPath(l,void 0,!0,1),p=i.extractCommon(r,t,e,n),r.oldPos+1>=s&&p+1>=o)return a(ae(i,r.lastComponent,t,e,i.useLongestToken));f[n]=r,r.oldPos+1>=s&&(h=Math.min(h,n-1)),p+1>=o&&(m=Math.max(m,n+1))}c++}if(r)(function e(){setTimeout(function(){if(c>l||Date.now()>d)return r();g()||e()},0)})();else for(;c<=l&&Date.now()<=d;){var _=g();if(_)return _}},addToPath:function(e,t,n,r){var i=e.lastComponent;return i&&i.added===t&&i.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:i.count+1,added:t,removed:n,previousComponent:i.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:i}}},extractCommon:function(e,t,n,r){for(var i=t.length,a=n.length,o=e.oldPos,s=o-r,c=0;s+1<i&&o+1<a&&this.equals(t[s+1],n[o+1]);)s++,o++,c++;return c&&(e.lastComponent={count:c,previousComponent:e.lastComponent}),e.oldPos=o,s},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},castInput:function(e){return e},tokenize:function(e){return e.split(``)},join:function(e){return e.join(``)}};function ae(e,t,n,r,i){for(var a=[],o;t;)a.push(t),o=t.previousComponent,delete t.previousComponent,t=o;a.reverse();for(var s=0,c=a.length,l=0,u=0;s<c;s++){var d=a[s];if(!d.removed){if(!d.added&&i){var f=n.slice(l,l+d.count);f=f.map(function(e,t){var n=r[u+t];return n.length>e.length?n:e}),d.value=e.join(f)}else d.value=e.join(n.slice(l,l+d.count));l+=d.count,d.added||(u+=d.count)}else if(d.value=e.join(r.slice(u,u+d.count)),u+=d.count,s&&a[s-1].added){var p=a[s-1];a[s-1]=a[s],a[s]=p}}var m=a[c-1];return c>1&&typeof m.value==`string`&&(m.added||m.removed)&&e.equals(``,m.value)&&(a[c-2].value+=m.value,a.pop()),a}var A=new k;function oe(e,t,n){return A.diff(e,t,n)}var j=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,M=/\S/,N=new k;N.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!M.test(e)&&!M.test(t)},N.tokenize=function(e){for(var t=e.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),n=0;n<t.length-1;n++)!t[n+1]&&t[n+2]&&j.test(t[n])&&j.test(t[n+2])&&(t[n]+=t[n+2],t.splice(n+1,2),n--);return t};function se(e,t,n){return N.diff(e,t,n)}var P=new k;P.tokenize=function(e){this.options.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
2
|
-
`));var t=[],n=e.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var r=0;r<n.length;r++){var i=n[r];r%2&&!this.options.newlineIsToken?t[t.length-1]+=i:(this.options.ignoreWhitespace&&(i=i.trim()),t.push(i))}return t};var F=new k;F.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var ce=new k;ce.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function I(e){"@babel/helpers - typeof";return I=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},I(e)}var le=Object.prototype.toString,L=new k;L.useLongestToken=!0,L.tokenize=P.tokenize,L.castInput=function(e){var t=this.options,n=t.undefinedReplacement,r=t.stringifyReplacer,i=r===void 0?function(e,t){return t===void 0?n:t}:r;return typeof e==`string`?e:JSON.stringify(R(e,null,null,i),i,` `)},L.equals=function(e,t){return k.prototype.equals.call(L,e.replace(/,([\r\n])/g,`$1`),t.replace(/,([\r\n])/g,`$1`))};function R(e,t,n,r,i){t||=[],n||=[],r&&(e=r(i,e));var a;for(a=0;a<t.length;a+=1)if(t[a]===e)return n[a];var o;if(le.call(e)===`[object Array]`){for(t.push(e),o=Array(e.length),n.push(o),a=0;a<e.length;a+=1)o[a]=R(e[a],t,n,r,i);return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),I(e)===`object`&&e!==null){t.push(e),o={},n.push(o);var s=[],c;for(c in e)e.hasOwnProperty(c)&&s.push(c);for(s.sort(),a=0;a<s.length;a+=1)c=s[a],o[c]=R(e[c],t,n,r,c);t.pop(),n.pop()}else o=e;return o}var z=new k;z.tokenize=function(e){return e.slice()},z.join=z.removeEmpty=function(e){return e};function B(e,t){let n=t.content.findDiffStart(e.content);if(n===null)return!1;let{a:r,b:i}=t.content.findDiffEnd(e.content),a=n-Math.min(r,i);return a>0&&(e.resolve(n-a).depth<t.resolve(r+a).depth?n-=a:(r+=a,i+=a)),new h(n,i,t.slice(n,r))}function V(e){if(!e.steps.length)return;let t=new g(e.docs[0]),n=e.steps.slice();for(;n.length;){let e=n.shift();for(;n.length&&e.merge(n[0]);){let r=n.shift();e=e instanceof h&&r instanceof h?B(t.doc,r.apply(e.apply(t.doc).doc).doc):e.merge(r)}t.step(e)}return t}function H(e){let t=new g(e);return t.removeMark(0,e.nodeSize-2),t.doc}function U(e,t){let n=t.split(`/`);for(n.shift();n.length;){if(typeof e!=`object`)throw Error();let t=n.shift();e=e[t]}return e}function W(e){return JSON.parse(JSON.stringify(e))}var ue=class{fromDoc;toDoc;complexSteps;wordDiffs;simplifyDiff;schema;tr;currentJSON;finalJSON;ops;constructor(e,t,n={}){let r={complexSteps:!0,wordDiffs:!1,simplifyDiff:!0,...n};this.fromDoc=e,this.toDoc=t,this.complexSteps=r.complexSteps,this.wordDiffs=r.wordDiffs,this.simplifyDiff=r.simplifyDiff,this.schema=e.type.schema,this.tr=new g(e),this.currentJSON={},this.finalJSON={},this.ops=[]}init(){return this.complexSteps?(this.currentJSON=H(this.fromDoc).toJSON(),this.finalJSON=H(this.toDoc).toJSON(),this.ops=(0,O.createPatch)(this.currentJSON,this.finalJSON),this.recreateChangeContentSteps(),this.recreateChangeMarkSteps()):(this.currentJSON=this.fromDoc.toJSON(),this.finalJSON=this.toDoc.toJSON(),this.ops=(0,O.createPatch)(this.currentJSON,this.finalJSON),this.recreateChangeContentSteps()),this.simplifyDiff&&(this.tr=V(this.tr)||this.tr),this.tr}recreateChangeContentSteps(){let e=[];for(;this.ops.length;){let t=this.ops.shift();e.push(t);let n,r=W(this.currentJSON),i=t.path.split(`/`);for(;n==null;){(0,O.applyPatch)(r,[t]);try{n=this.schema.nodeFromJSON(r),n.check()}catch{if(n=null,this.ops.length>0)t=this.ops.shift(),e.push(t);else throw Error(`No valid diff possible applying ${t.path}`)}}this.complexSteps&&e.length===1&&(i.includes(`attrs`)||i.includes(`type`))?(this.addSetNodeMarkup(),e=[]):e.length===1&&t.op===`replace`&&i[i.length-1]===`text`?(this.addReplaceTextSteps(t,r),e=[]):this.addReplaceStep(n,r)&&(e=[])}}addSetNodeMarkup(){let e=this.schema.nodeFromJSON(this.currentJSON),t=this.schema.nodeFromJSON(this.finalJSON),n=t.content.findDiffStart(e.content),r=e.nodeAt(n),i=t.nodeAt(n);if(n!=null){let e=r.type===i.type?null:i.type;try{this.tr.setNodeMarkup(n,e,i.attrs,i.marks)}catch(t){if(e&&t.message.includes(`Invalid content`))this.tr.replaceWith(n,n+r.nodeSize,i);else throw t}return this.currentJSON=H(this.tr.doc).toJSON(),this.ops=(0,O.createPatch)(this.currentJSON,this.finalJSON),!0}return!1}recreateChangeMarkSteps(){this.toDoc.descendants((e,t)=>{if(!e.isInline)return!0;this.tr.doc.nodesBetween(t,t+e.nodeSize,(n,r)=>{if(!n.isInline)return!0;let i=Math.max(t,r),a=Math.min(t+e.nodeSize,r+n.nodeSize);n.marks.forEach(t=>{t.isInSet(e.marks)||this.tr.removeMark(i,a,t)}),e.marks.forEach(e=>{e.isInSet(n.marks)||this.tr.addMark(i,a,e)})})})}addReplaceStep(e,t){let n=B(this.schema.nodeFromJSON(this.currentJSON),e);if(!n)return!1;if(!this.tr.maybeStep(n).failed)return this.currentJSON=t,!0;throw Error(`No valid step found.`)}addReplaceTextSteps(e,t){let n={...e,value:`xx`},r={...e,value:`yy`},i=W(this.currentJSON),a=W(this.currentJSON);(0,O.applyPatch)(i,[n]),(0,O.applyPatch)(a,[r]);let o=this.schema.nodeFromJSON(i),s=this.schema.nodeFromJSON(a),c=e.value,l=U(this.currentJSON,e.path),u=this.wordDiffs?se(l,c):oe(l,c),d=o.content.findDiffStart(s.content),f=o.resolve(d+1).marks();for(;u.length;){let e=u.shift();if(e.added){let t=this.schema.nodeFromJSON({type:`text`,text:e.value}).mark(f);if(u.length&&u[0].removed){let e=u.shift();this.tr.replaceWith(d,d+e.value.length,t)}else this.tr.insert(d,t);d+=e.value.length}else if(e.removed)if(u.length&&u[0].added){let t=u.shift(),n=this.schema.nodeFromJSON({type:`text`,text:t.value}).mark(f);this.tr.replaceWith(d,d+e.value.length,n),d+=t.value.length}else this.tr.delete(d,d+e.value.length);else d+=e.value.length}this.currentJSON=t}};function de(e,t,n={}){return new ue(e,t,n).init()}var G=new Set([`list`,`bulletList`,`orderedList`,`taskList`]);function K(e){let t=[];return e.forEach((e,n)=>{if(G.has(e.type.name)){let r=n+1,i=0;e.forEach(e=>{let n=r+i;t.push({from:n,to:n+e.nodeSize,key:`${e.type.name}:${e.textContent}`}),i+=e.nodeSize})}else t.push({from:n,to:n+e.nodeSize,key:`${e.type.name}:${e.textContent}`})}),t}function fe(e,t){let n=e.length,r=t.length,i=Array.from({length:n+1},()=>Array(r+1).fill(0));for(let a=n-1;a>=0;a--)for(let n=r-1;n>=0;n--)i[a][n]=e[a].key===t[n].key?i[a+1][n+1]+1:Math.max(i[a+1][n],i[a][n+1]);let a=[],o=0,s=0;for(;o<n&&s<r;)e[o].key===t[s].key?(a.push({type:`same`,b:t[s]}),o++,s++):i[o+1][s]>=i[o][s+1]?(a.push({type:`del`,a:e[o]}),o++):(a.push({type:`ins`,b:t[s]}),s++);for(;o<n;)a.push({type:`del`,a:e[o++]});for(;s<r;)a.push({type:`ins`,b:t[s++]});return a}function pe(e,t){let n=fe(K(e),K(t)),r=[],i=0;for(let e of n)e.type===`same`?i=e.b.to:e.type===`ins`?(r.push({fromA:0,toA:0,fromB:e.b.from,toB:e.b.to}),i=e.b.to):r.push({fromA:e.a.from,toA:e.a.to,fromB:i,toB:i});return r}var me=400;function q(e,t,n){return t.nodeFromJSON(e.parseWithFallback(n))}function he(e,t){let n=t.filter(e=>e.toB>e.fromB),r=[];return e.steps.forEach((t,i)=>{let a=t instanceof S?`add`:t instanceof v?`remove`:null;if(a===null)return;let o=t,s=e.mapping.slice(i+1),c=s.map(o.from,-1),l=s.map(o.to,1);if(l<=c||n.some(e=>e.fromB<=c&&l<=e.toB))return;let u=e.mapping.slice(0,i).invert(),d=u.map(o.from),f=u.map(o.to);f<=d||r.push({fromA:d,toA:f,fromB:c,toB:l,markName:o.mark.type.name,kind:a})}),r}function ge(e,t,n,r){if(e.length>2e5||t.length>2e5)return{ok:!1,reason:`ceiling`};let i,a;try{i=q(r,n,e),a=q(r,n,t)}catch{return{ok:!1,reason:`parse`}}let o=a,s=null;try{s=de(i,a,{complexSteps:!0,wordDiffs:!0,simplifyDiff:!0}),o=s.doc}catch{}let c=pe(i,o),l=s?he(s,c):[];return c.length+l.length>me?{ok:!1,reason:`ceiling`}:{ok:!0,afterDoc:o,beforeDoc:i,changes:c,markChanges:l}}var _e=`.ok-diff-ins, .ok-diff-ins-block, [data-diff-deleted]`;function ve(e){return e.changes.length+2*e.markChanges.length}function J(e){let t=!1;return e.forEach(e=>{e.isBlock&&(t=!0)}),t}function ye(e){if(e.childCount===0)return!1;let t=!0;return e.forEach(e=>{e.type.name!==`listItem`&&e.type.name!==`taskItem`&&(t=!1)}),t}function Y(e,t,n){let r=document.createElement(n?`div`:`span`);r.className=n?`ok-diff-del ok-diff-del-block`:`ok-diff-del`,r.setAttribute(`data-diff-deleted`,``);let i=e.serializeFragment(t);if(n&&ye(t)){let e=document.createElement(`ul`);e.appendChild(i),r.appendChild(e)}else r.appendChild(i);return r}function be(e,t,n,r,i){let a=b.fromSchema(i),o=[];for(let e of r){let n=t.slice(e.fromA,e.toA),r=J(n.content);o.push(m.widget(e.fromB,()=>Y(a,n.content,r),{side:-1,ignoreSelection:!0,marks:[]})),o.push(m.inline(e.fromB,e.toB,{class:`ok-diff-ins`},{inclusiveEnd:!0}))}for(let e of n)if(e.toB>e.fromB&&o.push(m.node(e.fromB,e.toB,{class:`ok-diff-ins-block`})),e.toA>e.fromA){let n=t.slice(e.fromA,e.toA),r=J(n.content);o.push(m.widget(e.fromB,()=>Y(a,n.content,r),{side:-1,ignoreSelection:!0,marks:[]}))}return f.create(e,o)}var xe=new Set([`slashCommand`,`blockDragHandle`,`blockMover`,`tableInsertControls`,`fileHandler`,`gfmAutolink`,`inlineLinkInputRule`,`keyboardNav`,`tiptapFindReplace`,`selectionState`,`sourceDirtyObserver`,`tabFocusTrap`]),X=i.filter(e=>!xe.has(e.name)).map(e=>e.name===`jsxComponent`?p:e),Z=n(),Q=ee(X);function Se(e,t){return ge(e,t,Q,l())}var Ce=d.create({name:`renderedDiffDecorations`,addOptions(){return{decorations:f.empty}},addProseMirrorPlugins(){let e=this.options.decorations;return[new y({key:new x(`renderedDiffDecorations`),props:{decorations:()=>e}})]}});function we(e){let t=(0,D.c)(31),{diff:n}=e,r,i,a,o;if(t[0]!==n.afterDoc||t[1]!==n.beforeDoc||t[2]!==n.changes||t[3]!==n.markChanges){let e=be(n.afterDoc,n.beforeDoc,n.changes,n.markChanges,Q);o=c,a=!1,r=X,i=Ce.configure({decorations:e}),t[0]=n.afterDoc,t[1]=n.beforeDoc,t[2]=n.changes,t[3]=n.markChanges,t[4]=r,t[5]=i,t[6]=a,t[7]=o}else r=t[4],i=t[5],a=t[6],o=t[7];let s;t[8]!==r||t[9]!==i?(s=[...r,i],t[8]=r,t[9]=i,t[10]=s):s=t[10];let l;t[11]===n.afterDoc?l=t[12]:(l=n.afterDoc.toJSON(),t[11]=n.afterDoc,t[12]=l);let d;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(d={attributes:{class:`pt-4`}},t[13]=d):d=t[13];let f;t[14]!==a||t[15]!==s||t[16]!==l?(f={editable:a,extensions:s,content:l,editorProps:d},t[14]=a,t[15]=s,t[16]=l,t[17]=f):f=t[17];let p;t[18]===n?p=t[19]:(p=[n],t[18]=n,t[19]=p);let m=o(f,p),[h]=(0,E.useState)(Te),g=(0,E.useRef)(null),_,v;t[20]===h?(_=t[21],v=t[22]):(_=()=>{let e=g.current;if(e)return e.appendChild(h),()=>{h.parentNode===e&&e.removeChild(h)}},v=[h],t[20]=h,t[21]=_,t[22]=v),(0,E.useLayoutEffect)(_,v);let y;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Z.jsx)(`div`,{className:`tiptap-editor`,children:(0,Z.jsx)(`div`,{ref:g,style:{display:`contents`}})}),t[23]=y):y=t[23];let b;t[24]===m?b=t[25]:(b=(0,Z.jsx)(u,{editor:m,className:`tiptap-editor-portal-content`}),t[24]=m,t[25]=b);let x;t[26]!==h||t[27]!==b?(x=(0,ie.createPortal)(b,h),t[26]=h,t[27]=b,t[28]=x):x=t[28];let S;return t[29]===x?S=t[30]:(S=(0,Z.jsxs)(`div`,{className:`editor-doc-scroll min-h-0 flex-1`,"data-testid":`rendered-diff-view`,children:[y,x]}),t[29]=x,t[30]=S),S}function Te(){let e=document.createElement(`div`);return e.style.display=`contents`,e}function Ee(e){let t=0,n=!1;for(let r of e.split(`
|
|
1
|
+
import{o as e,t}from"./chunk-CYidjpOJ.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{n as r,p as i}from"./DocumentContext-BiAlIaIL.js";import{t as a}from"./react-f2sANaYj.js";import{t as o}from"./react-dom-DPxgxlDT.js";import{t as s}from"./compiler-runtime-BfE3aGVn.js";import{et as c,k as l,q as u}from"./CodeMirrorPropInput-B34vnmpV.js";import{$i as d,Bi as f,Di as p,Qi as m,Y as h,ca as g,fa as _,ia as v,ii as y,ma as b,pa as x,ra as S,ua as ee}from"./dist-DbWN0KUu.js";import{t as te}from"./libesm-CHqp8owk.js";var C=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Pointer=void 0,e.unescapeToken=t,e.escapeToken=n;function t(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}function n(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}e.Pointer=function(){function e(e){e===void 0&&(e=[``]),this.tokens=e}return e.fromJSON=function(n){var r=n.split(`/`).map(t);if(r[0]!==``)throw Error(`Invalid JSON Pointer: ${n}`);return new e(r)},e.prototype.toString=function(){return this.tokens.map(n).join(`/`)},e.prototype.evaluate=function(e){for(var t=null,n=``,r=e,i=1,a=this.tokens.length;i<a;i++)t=r,n=this.tokens[i],!(n==`__proto__`||n==`constructor`||n==`prototype`)&&(r=(t||{})[n]);return{parent:t,key:n,value:r}},e.prototype.get=function(e){return this.evaluate(e).value},e.prototype.set=function(e,t){var n=this.evaluate(e);n.parent&&(n.parent[n.key]=t)},e.prototype.push=function(e){this.tokens.push(e)},e.prototype.add=function(t){return new e(this.tokens.concat(String(t)))},e.prototype.parent=function(){return new e(this.tokens.length>1?this.tokens.slice(0,-1):[``])},e}()})),w=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.hasOwnProperty=void 0,e.objectType=t,e.clone=r,e.hasOwnProperty=Object.prototype.hasOwnProperty;function t(e){return e===void 0?`undefined`:e===null?`null`:Array.isArray(e)?`array`:typeof e}function n(e){return typeof e==`object`&&!!e}function r(t){if(!n(t))return t;if(t.constructor==Array){for(var i=t.length,a=Array(i),o=0;o<i;o++)a[o]=r(t[o]);return a}if(t.constructor==Date)return new Date(+t);var s={};for(var c in t)e.hasOwnProperty.call(t,c)&&(s[c]=r(t[c]));return s}})),T=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.isDestructive=n,e.subtract=r,e.intersection=i,e.diffArrays=l,e.diffObjects=u,e.diffAny=d;var t=w();function n(e){var t=e.op;return t===`remove`||t===`replace`||t===`copy`||t===`move`}function r(e,n){var r=[];for(var i in e)t.hasOwnProperty.call(e,i)&&e[i]!==void 0&&!(t.hasOwnProperty.call(n,i)&&n[i]!==void 0)&&r.push(i);return r}function i(e){for(var n=e.length,r={},i=0;i<n;i++){var a=e[i];for(var o in a)t.hasOwnProperty.call(a,o)&&a[o]!==void 0&&(r[o]=(r[o]||0)+1)}for(var o in r)r[o]<n&&delete r[o];return Object.keys(r)}function a(e,n){var r=[];for(var i in e)t.hasOwnProperty.call(e,i)&&e[i]!==void 0&&t.hasOwnProperty.call(n,i)&&n[i]!==void 0&&r.push(i);return r}function o(e){return e.op===`add`}function s(e){return e.op===`remove`}function c(e,t){return{operations:e.operations.concat(t),cost:e.cost+1}}function l(e,t,n,r){r===void 0&&(r=d);var i=Math.max(e.length,t.length),a=new Map([[0,{operations:[],cost:0}]]);function l(o,s){var u=o*i+s,d=a.get(u);if(d===void 0){if(o>0&&s>0&&!r(e[o-1],t[s-1],n.add(String(o-1))).length)d=l(o-1,s-1);else{var f=[];if(o>0){var p=l(o-1,s),m={op:`remove`,index:o-1};f.push(c(p,m))}if(s>0){var h=l(o,s-1),g={op:`add`,index:o-1,value:t[s-1]};f.push(c(h,g))}if(o>0&&s>0){var _=l(o-1,s-1),v={op:`replace`,index:o-1,original:e[o-1],value:t[s-1]};f.push(c(_,v))}d=f.sort(function(e,t){return e.cost-t.cost})[0]}a.set(u,d)}return d}var u=isNaN(e.length)||e.length<=0?0:e.length;return l(u,isNaN(t.length)||t.length<=0?0:t.length).operations.reduce(function(e,t){var i=e[0],a=e[1];if(o(t)){var c=t.index+1+a,l=c<u+a?String(c):`-`,d={op:t.op,path:n.add(l).toString(),value:t.value};return[i.concat(d),a+1]}else if(s(t)){var d={op:t.op,path:n.add(String(t.index+a)).toString()};return[i.concat(d),a-1]}else{var f=n.add(String(t.index+a)),p=r(t.original,t.value,f);return[i.concat.apply(i,p),a]}},[[],0])[0]}function u(e,t,n,i){i===void 0&&(i=d);var o=[];return r(e,t).forEach(function(e){o.push({op:`remove`,path:n.add(e).toString()})}),r(t,e).forEach(function(e){o.push({op:`add`,path:n.add(e).toString(),value:t[e]})}),a(e,t).forEach(function(r){o.push.apply(o,i(e[r],t[r],n.add(r)))}),o}function d(e,n,r,i){if(i===void 0&&(i=d),e===n)return[];var a=(0,t.objectType)(e),o=(0,t.objectType)(n);return a==`array`&&o==`array`?l(e,n,r,i):a==`object`&&o==`object`?u(e,n,r,i):[{op:`replace`,path:r.toString(),value:n}]}})),ne=t((e=>{var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,`__esModule`,{value:!0}),e.InvalidOperationError=e.TestError=e.MissingError=void 0,e.add=l,e.remove=u,e.replace=d,e.move=f,e.copy=p,e.test=m,e.apply=g;var n=C(),r=w(),i=T(),a=function(e){t(n,e);function n(t){var n=e.call(this,`Value required at path: ${t}`)||this;return n.path=t,n.name=`MissingError`,n}return n}(Error);e.MissingError=a;var o=function(e){t(n,e);function n(t,n){var r=e.call(this,`Test failed: ${t} != ${n}`)||this;return r.actual=t,r.expected=n,r.name=`TestError`,r}return n}(Error);e.TestError=o;function s(e,t,n){if(Array.isArray(e))if(t==`-`)e.push(n);else{var r=parseInt(t,10);e.splice(r,0,n)}else e[t]=n}function c(e,t){if(Array.isArray(e)){var n=parseInt(t,10);e.splice(n,1)}else delete e[t]}function l(e,t,i){var o=n.Pointer.fromJSON(t.path);if(i?.implicitArrayCreation&&o.tokens[o.tokens.length-1]===`-`){var c=o.parent().evaluate(e);c.value===void 0&&(0,r.objectType)(c.parent)===`object`&&(c.parent[c.key]=[])}var l=o.evaluate(e);return l.parent===void 0||i?.implicitArrayCreation&&l.key===`-`&&!Array.isArray(l.parent)?new a(t.path):(s(l.parent,l.key,(0,r.clone)(t.value)),null)}function u(e,t,r){var i=n.Pointer.fromJSON(t.path).evaluate(e);return i.value===void 0?new a(t.path):(c(i.parent,i.key),null)}function d(e,t,i){var o=n.Pointer.fromJSON(t.path).evaluate(e);if(o.parent===null)return new a(t.path);if(Array.isArray(o.parent)){if(parseInt(o.key,10)>=o.parent.length)return new a(t.path)}else if(o.value===void 0)return new a(t.path);return o.parent[o.key]=(0,r.clone)(t.value),null}function f(e,t,r){var i=n.Pointer.fromJSON(t.from).evaluate(e);if(i.value===void 0)return new a(t.from);var o=n.Pointer.fromJSON(t.path).evaluate(e);return o.parent===void 0?new a(t.path):(c(i.parent,i.key),s(o.parent,o.key,i.value),null)}function p(e,t,i){var o=n.Pointer.fromJSON(t.from).evaluate(e);if(o.value===void 0)return new a(t.from);var c=n.Pointer.fromJSON(t.path).evaluate(e);return c.parent===void 0?new a(t.path):(s(c.parent,c.key,(0,r.clone)(o.value)),null)}function m(e,t,r){var a=n.Pointer.fromJSON(t.path).evaluate(e);return(0,i.diffAny)(a.value,t.value,new n.Pointer).length?new o(a.value,t.value):null}var h=function(e){t(n,e);function n(t){var n=e.call(this,`Invalid operation: ${t.op}`)||this;return n.operation=t,n.name=`InvalidOperationError`,n}return n}(Error);e.InvalidOperationError=h;function g(e,t,n){switch(t.op){case`add`:return l(e,t,n);case`remove`:return u(e,t,n);case`replace`:return d(e,t,n);case`move`:return f(e,t,n);case`copy`:return p(e,t,n);case`test`:return m(e,t,n)}return new h(t)}})),re=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Pointer=void 0,e.applyPatch=i,e.createPatch=o;var t=C();Object.defineProperty(e,`Pointer`,{enumerable:!0,get:function(){return t.Pointer}});var n=ne(),r=T();function i(e,t,r){return t.map(function(t){return(0,n.apply)(e,t,r)})}function a(e){function t(n,i,a){var o=e(n,i,a);return Array.isArray(o)?o:(0,r.diffAny)(n,i,a,t)}return t}function o(e,n,i){var o=new t.Pointer;return(i?a(i):r.diffAny)(e,n,o)}})),E=e(a(),1),ie=e(o(),1),D=s(),O=re();function k(){}k.prototype={diff:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.callback;typeof n==`function`&&(r=n,n={}),this.options=n;var i=this;function a(e){return r?(setTimeout(function(){r(void 0,e)},0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e)),t=this.removeEmpty(this.tokenize(t));var o=t.length,s=e.length,c=1,l=o+s;n.maxEditLength&&(l=Math.min(l,n.maxEditLength));var u=n.timeout??1/0,d=Date.now()+u,f=[{oldPos:-1,lastComponent:void 0}],p=this.extractCommon(f[0],t,e,0);if(f[0].oldPos+1>=s&&p+1>=o)return a([{value:this.join(t),count:t.length}]);var m=-1/0,h=1/0;function g(){for(var n=Math.max(m,-c);n<=Math.min(h,c);n+=2){var r=void 0,l=f[n-1],u=f[n+1];l&&(f[n-1]=void 0);var d=!1;if(u){var g=u.oldPos-n;d=u&&0<=g&&g<o}var _=l&&l.oldPos+1<s;if(!d&&!_){f[n]=void 0;continue}if(r=!_||d&&l.oldPos+1<u.oldPos?i.addToPath(u,!0,void 0,0):i.addToPath(l,void 0,!0,1),p=i.extractCommon(r,t,e,n),r.oldPos+1>=s&&p+1>=o)return a(ae(i,r.lastComponent,t,e,i.useLongestToken));f[n]=r,r.oldPos+1>=s&&(h=Math.min(h,n-1)),p+1>=o&&(m=Math.max(m,n+1))}c++}if(r)(function e(){setTimeout(function(){if(c>l||Date.now()>d)return r();g()||e()},0)})();else for(;c<=l&&Date.now()<=d;){var _=g();if(_)return _}},addToPath:function(e,t,n,r){var i=e.lastComponent;return i&&i.added===t&&i.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:i.count+1,added:t,removed:n,previousComponent:i.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:i}}},extractCommon:function(e,t,n,r){for(var i=t.length,a=n.length,o=e.oldPos,s=o-r,c=0;s+1<i&&o+1<a&&this.equals(t[s+1],n[o+1]);)s++,o++,c++;return c&&(e.lastComponent={count:c,previousComponent:e.lastComponent}),e.oldPos=o,s},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},castInput:function(e){return e},tokenize:function(e){return e.split(``)},join:function(e){return e.join(``)}};function ae(e,t,n,r,i){for(var a=[],o;t;)a.push(t),o=t.previousComponent,delete t.previousComponent,t=o;a.reverse();for(var s=0,c=a.length,l=0,u=0;s<c;s++){var d=a[s];if(!d.removed){if(!d.added&&i){var f=n.slice(l,l+d.count);f=f.map(function(e,t){var n=r[u+t];return n.length>e.length?n:e}),d.value=e.join(f)}else d.value=e.join(n.slice(l,l+d.count));l+=d.count,d.added||(u+=d.count)}else if(d.value=e.join(r.slice(u,u+d.count)),u+=d.count,s&&a[s-1].added){var p=a[s-1];a[s-1]=a[s],a[s]=p}}var m=a[c-1];return c>1&&typeof m.value==`string`&&(m.added||m.removed)&&e.equals(``,m.value)&&(a[c-2].value+=m.value,a.pop()),a}var A=new k;function oe(e,t,n){return A.diff(e,t,n)}var j=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,M=/\S/,N=new k;N.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!M.test(e)&&!M.test(t)},N.tokenize=function(e){for(var t=e.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),n=0;n<t.length-1;n++)!t[n+1]&&t[n+2]&&j.test(t[n])&&j.test(t[n+2])&&(t[n]+=t[n+2],t.splice(n+1,2),n--);return t};function se(e,t,n){return N.diff(e,t,n)}var P=new k;P.tokenize=function(e){this.options.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
2
|
+
`));var t=[],n=e.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var r=0;r<n.length;r++){var i=n[r];r%2&&!this.options.newlineIsToken?t[t.length-1]+=i:(this.options.ignoreWhitespace&&(i=i.trim()),t.push(i))}return t};var F=new k;F.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var ce=new k;ce.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function I(e){"@babel/helpers - typeof";return I=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},I(e)}var le=Object.prototype.toString,L=new k;L.useLongestToken=!0,L.tokenize=P.tokenize,L.castInput=function(e){var t=this.options,n=t.undefinedReplacement,r=t.stringifyReplacer,i=r===void 0?function(e,t){return t===void 0?n:t}:r;return typeof e==`string`?e:JSON.stringify(R(e,null,null,i),i,` `)},L.equals=function(e,t){return k.prototype.equals.call(L,e.replace(/,([\r\n])/g,`$1`),t.replace(/,([\r\n])/g,`$1`))};function R(e,t,n,r,i){t||=[],n||=[],r&&(e=r(i,e));var a;for(a=0;a<t.length;a+=1)if(t[a]===e)return n[a];var o;if(le.call(e)===`[object Array]`){for(t.push(e),o=Array(e.length),n.push(o),a=0;a<e.length;a+=1)o[a]=R(e[a],t,n,r,i);return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),I(e)===`object`&&e!==null){t.push(e),o={},n.push(o);var s=[],c;for(c in e)e.hasOwnProperty(c)&&s.push(c);for(s.sort(),a=0;a<s.length;a+=1)c=s[a],o[c]=R(e[c],t,n,r,c);t.pop(),n.pop()}else o=e;return o}var z=new k;z.tokenize=function(e){return e.slice()},z.join=z.removeEmpty=function(e){return e};function B(e,t){let n=t.content.findDiffStart(e.content);if(n===null)return!1;let{a:r,b:i}=t.content.findDiffEnd(e.content),a=n-Math.min(r,i);return a>0&&(e.resolve(n-a).depth<t.resolve(r+a).depth?n-=a:(r+=a,i+=a)),new _(n,i,t.slice(n,r))}function V(e){if(!e.steps.length)return;let t=new x(e.docs[0]),n=e.steps.slice();for(;n.length;){let e=n.shift();for(;n.length&&e.merge(n[0]);){let r=n.shift();e=e instanceof _&&r instanceof _?B(t.doc,r.apply(e.apply(t.doc).doc).doc):e.merge(r)}t.step(e)}return t}function H(e){let t=new x(e);return t.removeMark(0,e.nodeSize-2),t.doc}function U(e,t){let n=t.split(`/`);for(n.shift();n.length;){if(typeof e!=`object`)throw Error();let t=n.shift();e=e[t]}return e}function W(e){return JSON.parse(JSON.stringify(e))}var ue=class{fromDoc;toDoc;complexSteps;wordDiffs;simplifyDiff;schema;tr;currentJSON;finalJSON;ops;constructor(e,t,n={}){let r={complexSteps:!0,wordDiffs:!1,simplifyDiff:!0,...n};this.fromDoc=e,this.toDoc=t,this.complexSteps=r.complexSteps,this.wordDiffs=r.wordDiffs,this.simplifyDiff=r.simplifyDiff,this.schema=e.type.schema,this.tr=new x(e),this.currentJSON={},this.finalJSON={},this.ops=[]}init(){return this.complexSteps?(this.currentJSON=H(this.fromDoc).toJSON(),this.finalJSON=H(this.toDoc).toJSON(),this.ops=(0,O.createPatch)(this.currentJSON,this.finalJSON),this.recreateChangeContentSteps(),this.recreateChangeMarkSteps()):(this.currentJSON=this.fromDoc.toJSON(),this.finalJSON=this.toDoc.toJSON(),this.ops=(0,O.createPatch)(this.currentJSON,this.finalJSON),this.recreateChangeContentSteps()),this.simplifyDiff&&(this.tr=V(this.tr)||this.tr),this.tr}recreateChangeContentSteps(){let e=[];for(;this.ops.length;){let t=this.ops.shift();e.push(t);let n,r=W(this.currentJSON),i=t.path.split(`/`);for(;n==null;){(0,O.applyPatch)(r,[t]);try{n=this.schema.nodeFromJSON(r),n.check()}catch{if(n=null,this.ops.length>0)t=this.ops.shift(),e.push(t);else throw Error(`No valid diff possible applying ${t.path}`)}}this.complexSteps&&e.length===1&&(i.includes(`attrs`)||i.includes(`type`))?(this.addSetNodeMarkup(),e=[]):e.length===1&&t.op===`replace`&&i[i.length-1]===`text`?(this.addReplaceTextSteps(t,r),e=[]):this.addReplaceStep(n,r)&&(e=[])}}addSetNodeMarkup(){let e=this.schema.nodeFromJSON(this.currentJSON),t=this.schema.nodeFromJSON(this.finalJSON),n=t.content.findDiffStart(e.content),r=e.nodeAt(n),i=t.nodeAt(n);if(n!=null){let e=r.type===i.type?null:i.type;try{this.tr.setNodeMarkup(n,e,i.attrs,i.marks)}catch(t){if(e&&t.message.includes(`Invalid content`))this.tr.replaceWith(n,n+r.nodeSize,i);else throw t}return this.currentJSON=H(this.tr.doc).toJSON(),this.ops=(0,O.createPatch)(this.currentJSON,this.finalJSON),!0}return!1}recreateChangeMarkSteps(){this.toDoc.descendants((e,t)=>{if(!e.isInline)return!0;this.tr.doc.nodesBetween(t,t+e.nodeSize,(n,r)=>{if(!n.isInline)return!0;let i=Math.max(t,r),a=Math.min(t+e.nodeSize,r+n.nodeSize);n.marks.forEach(t=>{t.isInSet(e.marks)||this.tr.removeMark(i,a,t)}),e.marks.forEach(e=>{e.isInSet(n.marks)||this.tr.addMark(i,a,e)})})})}addReplaceStep(e,t){let n=B(this.schema.nodeFromJSON(this.currentJSON),e);if(!n)return!1;if(!this.tr.maybeStep(n).failed)return this.currentJSON=t,!0;throw Error(`No valid step found.`)}addReplaceTextSteps(e,t){let n={...e,value:`xx`},r={...e,value:`yy`},i=W(this.currentJSON),a=W(this.currentJSON);(0,O.applyPatch)(i,[n]),(0,O.applyPatch)(a,[r]);let o=this.schema.nodeFromJSON(i),s=this.schema.nodeFromJSON(a),c=e.value,l=U(this.currentJSON,e.path),u=this.wordDiffs?se(l,c):oe(l,c),d=o.content.findDiffStart(s.content),f=o.resolve(d+1).marks();for(;u.length;){let e=u.shift();if(e.added){let t=this.schema.nodeFromJSON({type:`text`,text:e.value}).mark(f);if(u.length&&u[0].removed){let e=u.shift();this.tr.replaceWith(d,d+e.value.length,t)}else this.tr.insert(d,t);d+=e.value.length}else if(e.removed)if(u.length&&u[0].added){let t=u.shift(),n=this.schema.nodeFromJSON({type:`text`,text:t.value}).mark(f);this.tr.replaceWith(d,d+e.value.length,n),d+=t.value.length}else this.tr.delete(d,d+e.value.length);else d+=e.value.length}this.currentJSON=t}};function de(e,t,n={}){return new ue(e,t,n).init()}var G=new Set([`list`,`bulletList`,`orderedList`,`taskList`]);function K(e){let t=[];return e.forEach((e,n)=>{if(G.has(e.type.name)){let r=n+1,i=0;e.forEach(e=>{let n=r+i;t.push({from:n,to:n+e.nodeSize,key:`${e.type.name}:${e.textContent}`}),i+=e.nodeSize})}else t.push({from:n,to:n+e.nodeSize,key:`${e.type.name}:${e.textContent}`})}),t}function fe(e,t){let n=e.length,r=t.length,i=Array.from({length:n+1},()=>Array(r+1).fill(0));for(let a=n-1;a>=0;a--)for(let n=r-1;n>=0;n--)i[a][n]=e[a].key===t[n].key?i[a+1][n+1]+1:Math.max(i[a+1][n],i[a][n+1]);let a=[],o=0,s=0;for(;o<n&&s<r;)e[o].key===t[s].key?(a.push({type:`same`,b:t[s]}),o++,s++):i[o+1][s]>=i[o][s+1]?(a.push({type:`del`,a:e[o]}),o++):(a.push({type:`ins`,b:t[s]}),s++);for(;o<n;)a.push({type:`del`,a:e[o++]});for(;s<r;)a.push({type:`ins`,b:t[s++]});return a}function pe(e,t){let n=fe(K(e),K(t)),r=[],i=0;for(let e of n)e.type===`same`?i=e.b.to:e.type===`ins`?(r.push({fromA:0,toA:0,fromB:e.b.from,toB:e.b.to}),i=e.b.to):r.push({fromA:e.a.from,toA:e.a.to,fromB:i,toB:i});return r}var me=400;function q(e,t,n){return t.nodeFromJSON(e.parseWithFallback(n))}function he(e,t){let n=t.filter(e=>e.toB>e.fromB),r=[];return e.steps.forEach((t,i)=>{let a=t instanceof g?`add`:t instanceof ee?`remove`:null;if(a===null)return;let o=t,s=e.mapping.slice(i+1),c=s.map(o.from,-1),l=s.map(o.to,1);if(l<=c||n.some(e=>e.fromB<=c&&l<=e.toB))return;let u=e.mapping.slice(0,i).invert(),d=u.map(o.from),f=u.map(o.to);f<=d||r.push({fromA:d,toA:f,fromB:c,toB:l,markName:o.mark.type.name,kind:a})}),r}function ge(e,t,n,r){if(e.length>2e5||t.length>2e5)return{ok:!1,reason:`ceiling`};let i,a;try{i=q(r,n,e),a=q(r,n,t)}catch{return{ok:!1,reason:`parse`}}let o=a,s=null;try{s=de(i,a,{complexSteps:!0,wordDiffs:!0,simplifyDiff:!0}),o=s.doc}catch{}let c=pe(i,o),l=s?he(s,c):[];return c.length+l.length>me?{ok:!1,reason:`ceiling`}:{ok:!0,afterDoc:o,beforeDoc:i,changes:c,markChanges:l}}var _e=`.ok-diff-ins, .ok-diff-ins-block, [data-diff-deleted]`;function ve(e){return e.changes.length+2*e.markChanges.length}function J(e){let t=!1;return e.forEach(e=>{e.isBlock&&(t=!0)}),t}function ye(e){if(e.childCount===0)return!1;let t=!0;return e.forEach(e=>{e.type.name!==`listItem`&&e.type.name!==`taskItem`&&(t=!1)}),t}function Y(e,t,n){let r=document.createElement(n?`div`:`span`);r.className=n?`ok-diff-del ok-diff-del-block`:`ok-diff-del`,r.setAttribute(`data-diff-deleted`,``);let i=e.serializeFragment(t);if(n&&ye(t)){let e=document.createElement(`ul`);e.appendChild(i),r.appendChild(e)}else r.appendChild(i);return r}function be(e,t,n,r,i){let a=b.fromSchema(i),o=[];for(let e of r){let n=t.slice(e.fromA,e.toA),r=J(n.content);o.push(m.widget(e.fromB,()=>Y(a,n.content,r),{side:-1,ignoreSelection:!0,marks:[]})),o.push(m.inline(e.fromB,e.toB,{class:`ok-diff-ins`},{inclusiveEnd:!0}))}for(let e of n)if(e.toB>e.fromB&&o.push(m.node(e.fromB,e.toB,{class:`ok-diff-ins-block`})),e.toA>e.fromA){let n=t.slice(e.fromA,e.toA),r=J(n.content);o.push(m.widget(e.fromB,()=>Y(a,n.content,r),{side:-1,ignoreSelection:!0,marks:[]}))}return d.create(e,o)}var xe=new Set([`slashCommand`,`blockDragHandle`,`blockMover`,`tableInsertControls`,`fileHandler`,`gfmAutolink`,`inlineLinkInputRule`,`keyboardNav`,`tiptapFindReplace`,`selectionState`,`sourceDirtyObserver`,`tabFocusTrap`]),X=i.filter(e=>!xe.has(e.name)).map(e=>e.name===`jsxComponent`?h:e),Z=n(),Q=f(X);function Se(e,t){return ge(e,t,Q,l())}var Ce=p.create({name:`renderedDiffDecorations`,addOptions(){return{decorations:d.empty}},addProseMirrorPlugins(){let e=this.options.decorations;return[new S({key:new v(`renderedDiffDecorations`),props:{decorations:()=>e}})]}});function we(e){let t=(0,D.c)(31),{diff:n}=e,r,i,a,o;if(t[0]!==n.afterDoc||t[1]!==n.beforeDoc||t[2]!==n.changes||t[3]!==n.markChanges){let e=be(n.afterDoc,n.beforeDoc,n.changes,n.markChanges,Q);o=c,a=!1,r=X,i=Ce.configure({decorations:e}),t[0]=n.afterDoc,t[1]=n.beforeDoc,t[2]=n.changes,t[3]=n.markChanges,t[4]=r,t[5]=i,t[6]=a,t[7]=o}else r=t[4],i=t[5],a=t[6],o=t[7];let s;t[8]!==r||t[9]!==i?(s=[...r,i],t[8]=r,t[9]=i,t[10]=s):s=t[10];let l;t[11]===n.afterDoc?l=t[12]:(l=n.afterDoc.toJSON(),t[11]=n.afterDoc,t[12]=l);let d;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(d={attributes:{class:`pt-4`}},t[13]=d):d=t[13];let f;t[14]!==a||t[15]!==s||t[16]!==l?(f={editable:a,extensions:s,content:l,editorProps:d},t[14]=a,t[15]=s,t[16]=l,t[17]=f):f=t[17];let p;t[18]===n?p=t[19]:(p=[n],t[18]=n,t[19]=p);let m=o(f,p),[h]=(0,E.useState)(Te),g=(0,E.useRef)(null),_,v;t[20]===h?(_=t[21],v=t[22]):(_=()=>{let e=g.current;if(e)return e.appendChild(h),()=>{h.parentNode===e&&e.removeChild(h)}},v=[h],t[20]=h,t[21]=_,t[22]=v),(0,E.useLayoutEffect)(_,v);let y;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Z.jsx)(`div`,{className:`tiptap-editor`,children:(0,Z.jsx)(`div`,{ref:g,style:{display:`contents`}})}),t[23]=y):y=t[23];let b;t[24]===m?b=t[25]:(b=(0,Z.jsx)(u,{editor:m,className:`tiptap-editor-portal-content`}),t[24]=m,t[25]=b);let x;t[26]!==h||t[27]!==b?(x=(0,ie.createPortal)(b,h),t[26]=h,t[27]=b,t[28]=x):x=t[28];let S;return t[29]===x?S=t[30]:(S=(0,Z.jsxs)(`div`,{className:`editor-doc-scroll min-h-0 flex-1`,"data-testid":`rendered-diff-view`,children:[y,x]}),t[29]=x,t[30]=S),S}function Te(){let e=document.createElement(`div`);return e.style.display=`contents`,e}function Ee(e){let t=0,n=!1;for(let r of e.split(`
|
|
3
3
|
`)){let e=r.startsWith(`+`)&&!r.startsWith(`+++`)||r.startsWith(`-`)&&!r.startsWith(`---`);e&&!n&&(t+=1),n=e}return t}function De(e){let t=Array.from(e.querySelectorAll(`.diff-code-insert, .diff-code-delete`)),n=[],r=null;for(let e of t){let t=e.closest(`tr`);t&&((r===null||t.previousElementSibling!==r)&&n.push(e),r=t)}return n}function $(e){let t=0,n=0;for(let r of e.split(`
|
|
4
|
-
`))r.startsWith(`+`)&&!r.startsWith(`+++`)?t++:r.startsWith(`-`)&&!r.startsWith(`---`)&&n++;return{additions:t,deletions:n}}function Oe(e,t){return`${e}\u0000${t}`}function ke(e,t,n){let r=
|
|
4
|
+
`))r.startsWith(`+`)&&!r.startsWith(`+++`)?t++:r.startsWith(`-`)&&!r.startsWith(`---`)&&n++;return{additions:t,deletions:n}}function Oe(e,t){return`${e}\u0000${t}`}function ke(e,t,n){let r=y(e).body,i=y(t).body;return r===i?``:te(n,r,i,``,``,{context:Math.max(r.split(`
|
|
5
5
|
`).length,i.split(`
|
|
6
|
-
`).length)})}function Ae(e,t,n,i,a){let o=(0,D.c)(10),s=i===void 0?`vs-live`:i,c=a===void 0?null:a,{activeProvider:l}=r(),u;o[0]===Symbol.for(`react.memo_cache_sentinel`)?(u={status:`idle`,diff:null},o[0]=u):u=o[0];let[d,f]=(0,E.useState)(u),p=(0,E.useRef)(l),m;o[1]===l?m=o[2]:(m=()=>{p.current=l},o[1]=l,o[2]=m),(0,E.useEffect)(m);let h,g;return o[3]!==n||o[4]!==t||o[5]!==s||o[6]!==c||o[7]!==e?(h=()=>{if(!e){f({status:`idle`,diff:null});return}let r=e,i=!1;f({status:`loading`,diff:null});let a=async function(e){let r=Oe(t,e),i=n.get(r);if(i!==void 0)return i;let a=await fetch(`/api/history/${e}?docName=${encodeURIComponent(t)}`);if(!a.ok)return console.error(`[timeline-diff] history fetch returned non-ok response`,{sha:e,docName:t,status:a.status}),null;let o=(await a.json()).content??``;return n.set(r,o),o};return(async function(){try{let e=await a(r);if(i)return;if(e===null){f({status:`error`,diff:null});return}let n,o;if(s===`vs-parent`){let t=c?await a(c):``;if(i)return;if(t===null){f({status:`error`,diff:null});return}n=t,o=e}else n=e,o=p.current?.document.getText(`source`).toString()??``;let l=
|
|
6
|
+
`).length)})}function Ae(e,t,n,i,a){let o=(0,D.c)(10),s=i===void 0?`vs-live`:i,c=a===void 0?null:a,{activeProvider:l}=r(),u;o[0]===Symbol.for(`react.memo_cache_sentinel`)?(u={status:`idle`,diff:null},o[0]=u):u=o[0];let[d,f]=(0,E.useState)(u),p=(0,E.useRef)(l),m;o[1]===l?m=o[2]:(m=()=>{p.current=l},o[1]=l,o[2]=m),(0,E.useEffect)(m);let h,g;return o[3]!==n||o[4]!==t||o[5]!==s||o[6]!==c||o[7]!==e?(h=()=>{if(!e){f({status:`idle`,diff:null});return}let r=e,i=!1;f({status:`loading`,diff:null});let a=async function(e){let r=Oe(t,e),i=n.get(r);if(i!==void 0)return i;let a=await fetch(`/api/history/${e}?docName=${encodeURIComponent(t)}`);if(!a.ok)return console.error(`[timeline-diff] history fetch returned non-ok response`,{sha:e,docName:t,status:a.status}),null;let o=(await a.json()).content??``;return n.set(r,o),o};return(async function(){try{let e=await a(r);if(i)return;if(e===null){f({status:`error`,diff:null});return}let n,o;if(s===`vs-parent`){let t=c?await a(c):``;if(i)return;if(t===null){f({status:`error`,diff:null});return}n=t,o=e}else n=e,o=p.current?.document.getText(`source`).toString()??``;let l=y(n).body,u=y(o).body,d=ke(n,o,t);if(i)return;let{additions:m,deletions:h}=$(d);f({status:`ready`,diff:d,additions:m,deletions:h,before:l,after:u})}catch(e){i||(console.error(`[timeline-diff] failed to load entry diff`,{sha:r,docName:t,mode:s,err:e}),f({status:`error`,diff:null}))}})(),()=>{i=!0}},g=[e,t,n,s,c],o[3]=n,o[4]=t,o[5]=s,o[6]=c,o[7]=e,o[8]=h,o[9]=g):(h=o[8],g=o[9]),(0,E.useEffect)(h,g),d}export{we as a,ve as c,Ee as i,Ae as n,Se as o,De as r,_e as s,$ as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./react-f2sANaYj.js";import{t as n}from"./compiler-runtime-BfE3aGVn.js";import{Zt as r}from"./dist-
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./react-f2sANaYj.js";import{t as n}from"./compiler-runtime-BfE3aGVn.js";import{Zt as r}from"./dist-DbWN0KUu.js";var i=n(),a=e(t(),1);function o(){let e=(0,i.c)(3),[t,n]=(0,a.useState)(l),o,u;return e[0]===t?(o=e[1],u=e[2]):(o=()=>{if(t!==null||window.okDesktop)return;let e=!0;return fetch(`/api/workspace`).then(async t=>{let i=await t.json().catch(c);if(!e||!t.ok)return;let a=r.safeParse(i);a.success&&n({contentDir:a.data.contentDir,pathSeparator:a.data.pathSeparator})}).catch(s),()=>{e=!1}},u=[t],e[0]=t,e[1]=o,e[2]=u),(0,a.useEffect)(o,u),t}function s(e){console.warn(`[useWorkspace] /api/workspace fetch failed:`,e)}function c(){return null}function l(){return u()}function u(e=typeof window>`u`?void 0:window){if(!e)return null;let t=e.okDesktop;return t?{contentDir:t.config.projectPath,pathSeparator:t.platform===`win32`?`\\`:`/`}:null}export{o as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./react-f2sANaYj.js";import{r as n}from"./dist-Nvb76hAm.js";import{t as r}from"./createLucideIcon-DAkhoPjT.js";import{Pn as i}from"./dist-
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./react-f2sANaYj.js";import{r as n}from"./dist-Nvb76hAm.js";import{t as r}from"./createLucideIcon-DAkhoPjT.js";import{Pn as i}from"./dist-DbWN0KUu.js";var a=r(`copy-plus`,[[`line`,{x1:`15`,x2:`15`,y1:`12`,y2:`18`,key:`1p7wdc`}],[`line`,{x1:`12`,x2:`18`,y1:`15`,y2:`15`,key:`1nscbv`}],[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),o=r(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),s=r(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),c=[`global`,`project`];function l(e){return{project:new Set(e.filter(e=>e.scope===`project`).map(e=>e.name)),global:new Set(e.filter(e=>e.scope===`global`).map(e=>e.name))}}var u=`open-knowledge-pack-`;function d(e){return e.startsWith(u)?e.slice(20):e}function f(){let{_:e}=n();return{project:e({id:`e0NrBM`}),global:e({id:`2GT3Hf`})}}function p(){let{_:e}=n();return{project:e({id:`HyvSqq`}),global:e({id:`C7XjNB`})}}var m=e(t(),1);function h(){let[e]=(0,m.useState)(g);return e}function g(){return i()!=null}function _(e,t,n){let r=n===`\\`?t.replaceAll(`/`,`\\`):t;return`${e.endsWith(n)?e.slice(0,-1):e}${n}${r}`}var v=/\.(md|mdx)$/i;function y(e){return v.test(e)?e:`${e}.md`}export{d as a,p as c,a as d,c as i,s as l,_ as n,l as o,h as r,f as s,y as t,o as u};
|
package/dist/public/index.html
CHANGED
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
-->
|
|
59
59
|
<script>(() => { let t = 'system'; try { const r = localStorage.getItem('ok-theme-v1'); if (r === 'light' || r === 'dark' || r === 'system') t = r; } catch {} let ct = null; try { const c = localStorage.getItem('ok-color-theme-v1'); if (c && ['dracula', 'catppuccin-frappe', 'catppuccin-latte', 'monokai', 'gruvbox', 'solarized', 'custom'].includes(c)) ct = c; } catch {} let dark = t === 'dark'; if (t === 'system') { try { dark = window.matchMedia('(prefers-color-scheme: dark)').matches; } catch {} } let customCss = null; if (ct === 'custom') { try { const raw = localStorage.getItem('ok-custom-theme-v1'); if (raw) { const o = JSON.parse(raw); if (o?.css) { customCss = o.css; dark = !!o.dark; } } } catch {} if (!customCss) ct = null; } else if (ct) { dark = !['catppuccin-latte'].includes(ct); } if (dark) document.documentElement.classList.add('dark'); if (ct) document.documentElement.setAttribute('data-color-theme', ct); if (customCss) { const s = document.createElement('style'); s.id = 'ok-custom-theme'; s.textContent = customCss; document.head.appendChild(s); } if (window.okDesktop) { document.documentElement.classList.add('electron-mode'); document.documentElement.classList.add(`electron-platform-${window.okDesktop.platform}`); } })();</script>
|
|
60
60
|
<style>html { background-color: #fafafa } html.dark { background-color: #171717 }</style>
|
|
61
|
-
<script type="module" crossorigin src="./assets/index-
|
|
61
|
+
<script type="module" crossorigin src="./assets/index-CFaXQy8P.js"></script>
|
|
62
62
|
<link rel="modulepreload" crossorigin href="./assets/chunk-CYidjpOJ.js">
|
|
63
63
|
<link rel="modulepreload" crossorigin href="./assets/dist-q14fBS3T.js">
|
|
64
64
|
<link rel="modulepreload" crossorigin href="./assets/react-f2sANaYj.js">
|
|
@@ -80,14 +80,14 @@
|
|
|
80
80
|
<link rel="modulepreload" crossorigin href="./assets/trace-api-DHyWZzIa.js">
|
|
81
81
|
<link rel="modulepreload" crossorigin href="./assets/lib-Iu39CNZE.js">
|
|
82
82
|
<link rel="modulepreload" crossorigin href="./assets/markdownit-YwcN3EvW.js">
|
|
83
|
-
<link rel="modulepreload" crossorigin href="./assets/dist-
|
|
83
|
+
<link rel="modulepreload" crossorigin href="./assets/dist-DbWN0KUu.js">
|
|
84
84
|
<link rel="modulepreload" crossorigin href="./assets/dist-PQ5KMVDh.js">
|
|
85
85
|
<link rel="modulepreload" crossorigin href="./assets/compiler-runtime-BfE3aGVn.js">
|
|
86
86
|
<link rel="modulepreload" crossorigin href="./assets/jsx-runtime-BUgB2tll.js">
|
|
87
|
-
<link rel="modulepreload" crossorigin href="./assets/client-version-
|
|
88
|
-
<link rel="modulepreload" crossorigin href="./assets/use-apply-config-color-theme-
|
|
87
|
+
<link rel="modulepreload" crossorigin href="./assets/client-version-D5pI6rXA.js">
|
|
88
|
+
<link rel="modulepreload" crossorigin href="./assets/use-apply-config-color-theme-kT3YWc5p.js">
|
|
89
89
|
<link rel="modulepreload" crossorigin href="./assets/config-context-gd3BC-iY.js">
|
|
90
|
-
<link rel="modulepreload" crossorigin href="./assets/config-provider-
|
|
90
|
+
<link rel="modulepreload" crossorigin href="./assets/config-provider-DjoTPI46.js">
|
|
91
91
|
<link rel="modulepreload" crossorigin href="./assets/dist-Nvb76hAm.js">
|
|
92
92
|
<link rel="modulepreload" crossorigin href="./assets/bundle-mjs-SHeFpKGC.js">
|
|
93
93
|
<link rel="modulepreload" crossorigin href="./assets/createLucideIcon-DAkhoPjT.js">
|
|
@@ -125,20 +125,20 @@
|
|
|
125
125
|
<link rel="modulepreload" crossorigin href="./assets/folder-open-wLd69QUc.js">
|
|
126
126
|
<link rel="modulepreload" crossorigin href="./assets/trash-2-BUuL4OCw.js">
|
|
127
127
|
<link rel="modulepreload" crossorigin href="./assets/triangle-alert-Clgvyc7B.js">
|
|
128
|
-
<link rel="modulepreload" crossorigin href="./assets/file-tree-utils-
|
|
129
|
-
<link rel="modulepreload" crossorigin href="./assets/doc-hash-
|
|
130
|
-
<link rel="modulepreload" crossorigin href="./assets/navigation-targets-
|
|
128
|
+
<link rel="modulepreload" crossorigin href="./assets/file-tree-utils-CKB7vhwx.js">
|
|
129
|
+
<link rel="modulepreload" crossorigin href="./assets/doc-hash-Ds3Xt5sU.js">
|
|
130
|
+
<link rel="modulepreload" crossorigin href="./assets/navigation-targets-DlApq0F4.js">
|
|
131
131
|
<link rel="modulepreload" crossorigin href="./assets/external-link-T4Nj1gcG.js">
|
|
132
132
|
<link rel="modulepreload" crossorigin href="./assets/documents-fetch-CLL0O1of.js">
|
|
133
|
-
<link rel="modulepreload" crossorigin href="./assets/CodeMirrorPropInput-
|
|
133
|
+
<link rel="modulepreload" crossorigin href="./assets/CodeMirrorPropInput-B34vnmpV.js">
|
|
134
134
|
<link rel="modulepreload" crossorigin href="./assets/git-branch-CMJAiYLz.js">
|
|
135
135
|
<link rel="modulepreload" crossorigin href="./assets/copy-9EDFYcyR.js">
|
|
136
136
|
<link rel="modulepreload" crossorigin href="./assets/CopyButton-1Q6Wnnjb.js">
|
|
137
|
-
<link rel="modulepreload" crossorigin href="./assets/documents-events-
|
|
137
|
+
<link rel="modulepreload" crossorigin href="./assets/documents-events-CeD7Nm0E.js">
|
|
138
138
|
<link rel="modulepreload" crossorigin href="./assets/parse-api-error-C_gwkKmG.js">
|
|
139
139
|
<link rel="modulepreload" crossorigin href="./assets/startup-marks-CqVzdU1y.js">
|
|
140
|
-
<link rel="modulepreload" crossorigin href="./assets/prop-types-
|
|
141
|
-
<link rel="modulepreload" crossorigin href="./assets/workspace-paths-
|
|
140
|
+
<link rel="modulepreload" crossorigin href="./assets/prop-types-Bp7ajkYA.js">
|
|
141
|
+
<link rel="modulepreload" crossorigin href="./assets/workspace-paths-BYp4HrI_.js">
|
|
142
142
|
<link rel="modulepreload" crossorigin href="./assets/eye-CASw1HTi.js">
|
|
143
143
|
<link rel="modulepreload" crossorigin href="./assets/hash-DNKDqZ18.js">
|
|
144
144
|
<link rel="modulepreload" crossorigin href="./assets/info-yKMseklR.js">
|
|
@@ -149,15 +149,15 @@
|
|
|
149
149
|
<link rel="modulepreload" crossorigin href="./assets/file-tree-rename-validation-wADtjYEi.js">
|
|
150
150
|
<link rel="modulepreload" crossorigin href="./assets/badge-Dba4cvJR.js">
|
|
151
151
|
<link rel="modulepreload" crossorigin href="./assets/input-D0ZW0Opq.js">
|
|
152
|
-
<link rel="modulepreload" crossorigin href="./assets/use-collab-url-
|
|
153
|
-
<link rel="modulepreload" crossorigin href="./assets/DocumentContext-
|
|
152
|
+
<link rel="modulepreload" crossorigin href="./assets/use-collab-url-DPrY37Xq.js">
|
|
153
|
+
<link rel="modulepreload" crossorigin href="./assets/DocumentContext-BiAlIaIL.js">
|
|
154
154
|
<link rel="modulepreload" crossorigin href="./assets/format-BVhfvqw3.js">
|
|
155
155
|
<link rel="modulepreload" crossorigin href="./assets/braces-DwnwFx_V.js">
|
|
156
|
-
<link rel="modulepreload" crossorigin href="./assets/open-managed-artifact-tab-
|
|
157
|
-
<link rel="modulepreload" crossorigin href="./assets/lint-config-client-
|
|
158
|
-
<link rel="modulepreload" crossorigin href="./assets/selection-context-
|
|
159
|
-
<link rel="modulepreload" crossorigin href="./assets/PropertyPanel-
|
|
160
|
-
<link rel="modulepreload" crossorigin href="./assets/EnableSyncConfirmDialog-
|
|
156
|
+
<link rel="modulepreload" crossorigin href="./assets/open-managed-artifact-tab-C_zW-xH-.js">
|
|
157
|
+
<link rel="modulepreload" crossorigin href="./assets/lint-config-client-CU8tKrUp.js">
|
|
158
|
+
<link rel="modulepreload" crossorigin href="./assets/selection-context-DJG3xvFp.js">
|
|
159
|
+
<link rel="modulepreload" crossorigin href="./assets/PropertyPanel-Bke_n9xy.js">
|
|
160
|
+
<link rel="modulepreload" crossorigin href="./assets/EnableSyncConfirmDialog-B05Urde9.js">
|
|
161
161
|
<link rel="modulepreload" crossorigin href="./assets/arrow-up-right-obRIg3Sv.js">
|
|
162
162
|
<link rel="modulepreload" crossorigin href="./assets/cursor-C1n4GZG0.js">
|
|
163
163
|
<link rel="modulepreload" crossorigin href="./assets/RegisteredAgentIcon-8Tcfr3WP.js">
|
|
@@ -165,40 +165,40 @@
|
|
|
165
165
|
<link rel="modulepreload" crossorigin href="./assets/chevron-left-BQ6OM94c.js">
|
|
166
166
|
<link rel="modulepreload" crossorigin href="./assets/refresh-cw-BfeWGCsv.js">
|
|
167
167
|
<link rel="modulepreload" crossorigin href="./assets/copilot-BAzfPGty.js">
|
|
168
|
-
<link rel="modulepreload" crossorigin href="./assets/agent-visibility-
|
|
169
|
-
<link rel="modulepreload" crossorigin href="./assets/use-settings-route-
|
|
168
|
+
<link rel="modulepreload" crossorigin href="./assets/agent-visibility-CYbXZE0k.js">
|
|
169
|
+
<link rel="modulepreload" crossorigin href="./assets/use-settings-route-DbIUNQxX.js">
|
|
170
170
|
<link rel="modulepreload" crossorigin href="./assets/clipboard-adapter--Ja4oXEM.js">
|
|
171
|
-
<link rel="modulepreload" crossorigin href="./assets/skills-api-
|
|
172
|
-
<link rel="modulepreload" crossorigin href="./assets/use-workspace-
|
|
173
|
-
<link rel="modulepreload" crossorigin href="./assets/skill-actions-
|
|
171
|
+
<link rel="modulepreload" crossorigin href="./assets/skills-api-CN8Hksry.js">
|
|
172
|
+
<link rel="modulepreload" crossorigin href="./assets/use-workspace-BJkoTGFP.js">
|
|
173
|
+
<link rel="modulepreload" crossorigin href="./assets/skill-actions-CnJP2Bcc.js">
|
|
174
174
|
<link rel="modulepreload" crossorigin href="./assets/square-pen-C1vIlMAW.js">
|
|
175
175
|
<link rel="modulepreload" crossorigin href="./assets/field-DVIFAnvR.js">
|
|
176
176
|
<link rel="modulepreload" crossorigin href="./assets/textarea-RSYJwPz9.js">
|
|
177
|
-
<link rel="modulepreload" crossorigin href="./assets/auth-state-cache-
|
|
177
|
+
<link rel="modulepreload" crossorigin href="./assets/auth-state-cache-B9EBu3Gl.js">
|
|
178
178
|
<link rel="modulepreload" crossorigin href="./assets/miss-dialog-store-Bx4JLuKB.js">
|
|
179
|
-
<link rel="modulepreload" crossorigin href="./assets/pending-receive-nav-store-
|
|
180
|
-
<link rel="modulepreload" crossorigin href="./assets/terminal-launch-events-
|
|
179
|
+
<link rel="modulepreload" crossorigin href="./assets/pending-receive-nav-store-CRA3584T.js">
|
|
180
|
+
<link rel="modulepreload" crossorigin href="./assets/terminal-launch-events-OZusAMc8.js">
|
|
181
181
|
<link rel="modulepreload" crossorigin href="./assets/panel-right-open-B7ziq39V.js">
|
|
182
182
|
<link rel="modulepreload" crossorigin href="./assets/timeline-diff-store-CYckprSS.js">
|
|
183
183
|
<link rel="modulepreload" crossorigin href="./assets/form-D-z6QdLf.js">
|
|
184
|
-
<link rel="modulepreload" crossorigin href="./assets/EditorModeToggle-
|
|
184
|
+
<link rel="modulepreload" crossorigin href="./assets/EditorModeToggle-BjJNUMBS.js">
|
|
185
185
|
<link rel="modulepreload" crossorigin href="./assets/wrench-BfoTvqT9.js">
|
|
186
186
|
<link rel="modulepreload" crossorigin href="./assets/lint-plugin-meta-B3N1DKgL.js">
|
|
187
187
|
<link rel="modulepreload" crossorigin href="./assets/panel-Cyobla0Z.js">
|
|
188
188
|
<link rel="modulepreload" crossorigin href="./assets/skeleton-HLkcMp95.js">
|
|
189
|
-
<link rel="modulepreload" crossorigin href="./assets/typing-burst-detector-
|
|
189
|
+
<link rel="modulepreload" crossorigin href="./assets/typing-burst-detector-CjeuhXb7.js">
|
|
190
190
|
<link rel="modulepreload" crossorigin href="./assets/ConfigSharingInfoTooltip-DMbsfWD9.js">
|
|
191
191
|
<link rel="modulepreload" crossorigin href="./assets/project-paths-Dwo4Of8C.js">
|
|
192
192
|
<link rel="modulepreload" crossorigin href="./assets/follow-file-DBnmqlyk.js">
|
|
193
|
-
<link rel="modulepreload" crossorigin href="./assets/file-tree-adapter-
|
|
194
|
-
<link rel="modulepreload" crossorigin href="./assets/agent-diff-store-
|
|
195
|
-
<link rel="modulepreload" crossorigin href="./assets/target-navigation-intent-
|
|
196
|
-
<link rel="modulepreload" crossorigin href="./assets/use-live-xterm-theme-
|
|
193
|
+
<link rel="modulepreload" crossorigin href="./assets/file-tree-adapter-UXgwHNRD.js">
|
|
194
|
+
<link rel="modulepreload" crossorigin href="./assets/agent-diff-store-D9meLWbh.js">
|
|
195
|
+
<link rel="modulepreload" crossorigin href="./assets/target-navigation-intent-DBKxmlEZ.js">
|
|
196
|
+
<link rel="modulepreload" crossorigin href="./assets/use-live-xterm-theme-BYn_alYX.js">
|
|
197
197
|
<link rel="modulepreload" crossorigin href="./assets/use-installed-clis-B_nDAq7A.js">
|
|
198
|
-
<link rel="modulepreload" crossorigin href="./assets/terminal-telemetry-
|
|
198
|
+
<link rel="modulepreload" crossorigin href="./assets/terminal-telemetry-1gUD9W57.js">
|
|
199
199
|
<link rel="modulepreload" crossorigin href="./assets/agent-presence-CTJkQnoU.js">
|
|
200
200
|
<link rel="modulepreload" crossorigin href="./assets/mcp-consent-store-Xk9UA_MB.js">
|
|
201
|
-
<link rel="modulepreload" crossorigin href="./assets/receive-store-
|
|
201
|
+
<link rel="modulepreload" crossorigin href="./assets/receive-store-CmOFuJ5o.js">
|
|
202
202
|
<link rel="modulepreload" crossorigin href="./assets/worktree-store-LSx9q9Ga.js">
|
|
203
203
|
<link rel="stylesheet" crossorigin href="./assets/globals-DF_8aGgC.css">
|
|
204
204
|
<link rel="stylesheet" crossorigin href="./assets/DocumentContext-B0sQn39F.css">
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
script above.
|
|
33
33
|
-->
|
|
34
34
|
<style>html { background-color: #fafafa } html.dark { background-color: #171717 }</style>
|
|
35
|
-
<script type="module" crossorigin src="./assets/uninstall-
|
|
35
|
+
<script type="module" crossorigin src="./assets/uninstall-Cp4M347z.js"></script>
|
|
36
36
|
<link rel="modulepreload" crossorigin href="./assets/chunk-CYidjpOJ.js">
|
|
37
37
|
<link rel="modulepreload" crossorigin href="./assets/dist-q14fBS3T.js">
|
|
38
38
|
<link rel="modulepreload" crossorigin href="./assets/react-f2sANaYj.js">
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
<link rel="modulepreload" crossorigin href="./assets/lib-Iu39CNZE.js">
|
|
44
44
|
<link rel="modulepreload" crossorigin href="./assets/markdownit-YwcN3EvW.js">
|
|
45
45
|
<link rel="modulepreload" crossorigin href="./assets/w3c-keyname-DtWCia6R.js">
|
|
46
|
-
<link rel="modulepreload" crossorigin href="./assets/dist-
|
|
46
|
+
<link rel="modulepreload" crossorigin href="./assets/dist-DbWN0KUu.js">
|
|
47
47
|
<link rel="modulepreload" crossorigin href="./assets/jsx-runtime-BUgB2tll.js">
|
|
48
48
|
<link rel="modulepreload" crossorigin href="./assets/dist-Nvb76hAm.js">
|
|
49
49
|
<link rel="modulepreload" crossorigin href="./assets/bundle-mjs-SHeFpKGC.js">
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as e}from"./launch-json-removal-
|
|
2
|
-
//# sourceMappingURL=repair-launch-json-
|
|
1
|
+
import{t as e}from"./launch-json-removal-DPvJksib.mjs";import{join as t}from"node:path";function n(n){let i=n.logger??r,a=t(n.projectDir,`.claude`,`launch.json`);if(n.reclaimDisableEnv===`1`)return i({event:`launch-json-repair-skipped`,reason:`reclaim-disabled`}),{outcome:{configPath:a,outcome:`skipped-reclaim-disabled`},repairedCount:0};let o;try{o=e(n.projectDir)}catch(e){let t=e instanceof Error?e.message:String(e);return i({event:`launch-json-repair-write-failed`,configPath:a}),{outcome:{configPath:a,outcome:`write-failed`,error:t},repairedCount:0}}let s=o.kind===`removed`||o.kind===`removed-file`;return s&&i({event:`launch-json-repair-removed`,configPath:a}),{outcome:{configPath:a,outcome:o.kind},repairedCount:+!!s}}function r(e){process.stderr.write(`${JSON.stringify(e)}\n`)}export{n as repairLaunchJson};
|
|
2
|
+
//# sourceMappingURL=repair-launch-json-CZawWAqd.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as e,l as t,v as n}from"./write-project-skill-CeYehb7h.mjs";import{d as r,v as i}from"./init-
|
|
2
|
-
//# sourceMappingURL=repair-mcp-configs-
|
|
1
|
+
import{d as e,l as t,v as n}from"./write-project-skill-CeYehb7h.mjs";import{d as r,v as i}from"./init-C_ZFDDwH.mjs";import{t as a}from"./mcp-migrate-event-CWx0WLdE.mjs";import{homedir as o}from"node:os";function s(n){let r=n.logger??u,i=n.home??o(),a=[];if(n.reclaimDisableEnv===`1`)return r({event:`mcp-config-repair-skipped`,reason:`reclaim-disabled`}),{outcomes:a,repairedCount:0};for(let o of t){let t=e[o],s=c(()=>t.configPath(``,i));if(s!==null&&a.push(l({scope:`user`,editorId:o,target:t,home:i,cwd:``,configPath:s,configPathOverride:void 0,logger:r})),t.projectConfigPath){let e=t.projectConfigPath,i=c(()=>e(n.projectDir));i!==null&&a.push(l({scope:`project`,editorId:o,target:t,home:void 0,cwd:n.projectDir,configPath:i,configPathOverride:i,logger:r}))}}return{outcomes:a,repairedCount:a.filter(e=>e.outcome===`repaired`).length}}function c(e){try{return e()}catch{return null}}function l(e){let t={scope:e.scope,editorId:e.editorId,configPath:e.configPath},o=r(e.target,e.cwd,e.home,e.configPathOverride);if(o===null)return{...t,outcome:`no-entry`};if(n(o))return{...t,outcome:`canonical`};e.logger(a({scope:e.scope,surface:`cli-repair`,editorId:e.editorId,configPath:e.configPath,priorEntry:o}));let s=i(e.target,e.cwd,{mode:`published`,skipAvailabilityCheck:!0},e.home,e.configPathOverride);if(s.action===`failed`){let n=s.error??`unknown write failure`;return e.logger({event:`mcp-config-repair-write-failed`,scope:e.scope,editorId:e.editorId,configPath:e.configPath,error:n}),{...t,outcome:`write-failed`,error:n}}return s.action===`declined`?(e.logger({event:`mcp-config-repair-declined`,scope:e.scope,editorId:e.editorId,configPath:e.configPath,reason:s.declineReason}),{...t,outcome:`declined`}):{...t,outcome:`repaired`}}function u(e){process.stderr.write(`${JSON.stringify(e)}\n`)}export{s as repairMcpConfigs};
|
|
2
|
+
//# sourceMappingURL=repair-mcp-configs-DpdVVhiU.mjs.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import{o as e}from"./chunk-DTipWd-i.mjs";import{F as t,I as n,Pa as r}from"./src-CJ8mKCzo.mjs";import{Ai as i,ct as a,hn as o,lt as s,ot as c,st as l,ui as u,ya as d}from"./src-CIFd3tOE.mjs";import{K as f}from"./sleep-B2L0pvp4.mjs";import{O as p,P as m}from"./fs-traced-Cc6WsRtP.mjs";import{b as h,u as g,v as _,y as v}from"./server-lock-Cr23NqXF.mjs";import{t as y}from"./yazl-BafwB467.mjs";import{C as b,d as x,i as ee,v as te,y as S}from"./write-project-skill-CeYehb7h.mjs";import{c as C}from"./colors-BsmVIwfM.mjs";import"./acp-harness-probe-PwxCSk8L.mjs";import{D as ne,E as re,S as w,T,_ as ie,b as E,o as D,v as O}from"./init-C_ZFDDwH.mjs";import{n as k}from"./constants-CcMCMPg3.mjs";import{t as A}from"./is-object-ByG7RnjH.mjs";import"./loader-0YCBN4cH.mjs";import"./preview-Cjg4sLCV.mjs";import{execSync as ae,spawnSync as oe}from"node:child_process";import{basename as j,dirname as M,isAbsolute as se,join as N,relative as ce,resolve as P,sep as le}from"node:path";import{cpSync as ue,createWriteStream as de,existsSync as F,lstatSync as fe,mkdirSync as I,mkdtempSync as pe,readFileSync as L,readdirSync as R,readlinkSync as me,rmSync as z,statSync as he,writeFileSync as B}from"node:fs";import{arch as ge,freemem as _e,homedir as V,hostname as ve,platform as ye,release as be,tmpdir as xe,totalmem as Se,type as Ce,uptime as we}from"node:os";import{realpath as H}from"node:fs/promises";import{createHash as U}from"node:crypto";var Te=f();const Ee=new Set([`start`,`stop`,`status`,`clean`,`ui`,`mcp`,`preview`,`lint`,`deinit`,`auth`]);function De(e,t,n=o){if(e!==void 0&&!Ee.has(e))return null;let r=n(t);return r===null||r.distance===0?null:r.rootPath}let Oe=null;function ke(e){Oe=e}function Ae(){return Oe??process.cwd()}const je=[{name:`macos-home-path`,regex:/\/Users\/[^/]+\//g,replacement:`~/`},{name:`linux-home-path`,regex:/\/home\/[^/]+\//g,replacement:`~/`},{name:`github-pat`,regex:/\b(ghp_|gho_|ghu_|ghs_|ghr_)[A-Za-z0-9]{36,}\b/g,replacement:`[REDACTED-GH-PAT]`},{name:`aws-access-key`,regex:/\b(AKIA|ASIA|ABIA)[A-Z2-7]{16}\b/g,replacement:`[REDACTED-AWS-KEY]`},{name:`anthropic-key`,regex:/\bsk-ant-api03-[A-Za-z0-9_-]{20,}\b/g,replacement:`[REDACTED-ANTHROPIC]`},{name:`openai-key`,regex:/\bsk-[A-Za-z0-9]{20,}\b/g,replacement:`[REDACTED-OPENAI]`},{name:`bearer-token`,regex:/([Aa]uthorization:\s*[Bb]earer\s+)\S+/g,replacement:`$1[REDACTED]`},{name:`jwt`,regex:/eyJ[A-Za-z0-9_-]{8,}\.eyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}/g,replacement:`[REDACTED-JWT]`},{name:`url-credentials`,regex:/:\/\/[^/\s:@]+:[^/\s:@]+@/g,replacement:`://[REDACTED]@`}],Me=je.map(e=>e.name);function Ne(e){let t=new Set,n=0;return{redacted:e.split(`
|
|
2
|
+
`).map(e=>{let r=e;for(let{name:e,regex:i,replacement:a}of je)i.lastIndex=0,i.test(r)&&(t.add(e),n++,i.lastIndex=0,r=r.replace(i,a));return r}).join(`
|
|
3
|
+
`),patterns:[...t],lineCount:n}}function Pe(){return N(V(),`.ok`,`bug-reports`)}function Fe(e=new Date){let t=e.toISOString().replace(/[:.]/g,`-`),n=Pe(),r=`${t}-bugreport`,i=N(n,`${r}.zip`);for(let e=2;F(i);e+=1)i=N(n,`${r}-${e}.zip`);return i}function Ie(e,t){let n=N(e,`.ok`,`config.yml`);if(F(n))try{let e=L(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 F(N(e,`.ok`))?U(`sha256`).update(P(e)).digest(`hex`).slice(0,12):null}function Le(){let e={timestamp:new Date().toISOString(),platform:ye(),osType:Ce(),osRelease:be(),hostname:`[redacted]`,uptime:we(),freeMem:_e(),totalMem:Se(),nodeVersion:process.version,bunVersion:process.versions.bun??null,v8Version:process.versions.v8??null,pid:process.pid};try{e.macosVersion=ae(`sw_vers -productVersion 2>/dev/null`,u({encoding:`utf8`})).trim()}catch{}try{let t=N(__dirname,`..`,`..`,`package.json`);F(t)&&(e.okVersion=JSON.parse(L(t,`utf8`)).version)}catch{}return e}function Re(e,t){return ze(e,t).files}function ze(e,t){if(!F(t))return{files:[]};let n=R(t).filter(e=>e.endsWith(`.log`)||/\.log\.\d+$/.test(e)).map(e=>N(t,e));if(e&&n.length>0){let t=n.filter(t=>{try{return L(t,`utf8`).includes(`"project":"${e}"`)}catch{return!0}});t.length>0&&(n=t)}return{files:n}}function Be(e){let n=N(e,`.ok`,`local`);return F(n)?{files:[`server.lock`,`last-spawn-error.log`,t].map(e=>N(n,e)).filter(e=>F(e))}:{files:[]}}function Ve(e){let t=N(e,`.ok`,`local`,`logs`);return F(t)?{files:[`server-current.jsonl`,`server-prev.jsonl`].map(e=>N(t,e)).filter(e=>F(e))}:{files:[]}}function He(e){if(e.redact){let{redacted:t,patterns:n,lineCount:r}=Ne(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 Ue(e){for(let t of e.files)try{He({zipfile:e.zipfile,name:`${e.prefix}/${j(t)}`,content:L(t,`utf8`),redact:e.redact,bundleFiles:e.bundleFiles,redactions:e.redactions})}catch(n){e.logger?.warn({file:t,prefix:e.prefix,err:n},`bug-report: skipped unreadable file`)}}async function We(t){let{redact:n,outputPath:r,logger:i}=t,a=t.userLogsDir??N(V(),`.ok`,`logs`),o=t.projectDir?Ie(t.projectDir,i):null;I(M(r),{recursive:!0}),i?.info({projectSlug:o},`gathering diagnostic data`);let s=Le();s.desktop=t.desktop??null;let{files:c}=ze(o,a),{files:l}=t.projectDir?Be(t.projectDir):{files:[]},{files:u}=t.projectDir?Ve(t.projectDir):{files:[]};i?.info({logFileCount:c.length,lockFileCount:l.length,localSinkFileCount:u.length},`files collected`);let d=[],f=[],{ZipFile:p}=await import(`./yazl-vwTkB7U0.mjs`).then(t=>e(t.default,1)),m=new p;Ue({zipfile:m,files:c,prefix:`logs`,redact:n,bundleFiles:f,redactions:d,logger:i}),Ue({zipfile:m,files:l,prefix:`lockdir`,redact:n,bundleFiles:f,redactions:d,logger:i}),Ue({zipfile:m,files:u,prefix:`local-logs`,redact:n,bundleFiles:f,redactions:d,logger:i});for(let e of t.extraFiles??[])try{let t=L(e.sourcePath),n=`extra/${e.zipName??j(e.sourcePath)}`;m.addBuffer(t,n),f.push(n)}catch(t){i?.warn({sourcePath:e.sourcePath,err:t},`extra file unreadable; omitted from bundle`)}t.note&&He({zipfile:m,name:`note.txt`,content:t.note,redact:n,bundleFiles:f,redactions:d});let h=JSON.stringify(s,null,2);m.addBuffer(Buffer.from(h,`utf8`),`sysinfo.json`),f.push(`sysinfo.json`);let g={generatedAt:new Date().toISOString(),disciplineVersion:`1.0.0`,projectSlug:o,files:f,redactions:d,sysinfo:s};m.addBuffer(Buffer.from(JSON.stringify(g,null,2),`utf8`),`MANIFEST.json`);let _=d.reduce((e,t)=>e+t.lineCount,0),v=[`# Bug Report Bundle`,``,`Generated: ${g.generatedAt}`,`Project: ${o??`(unscoped)`}`,`Discipline version: ${g.disciplineVersion}`,``,`## Contents`,``,...f.map(e=>`- ${e}`),``,`## Privacy`,``,...n?[`This bundle was auto-redacted before packaging.`,`Patterns checked: ${Me.join(`, `)}`,_>0?`${_} line(s) were scrubbed across ${d.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(`
|
|
4
|
+
`);m.addBuffer(Buffer.from(v,`utf8`),`README.md`),m.end();let y=de(r);return m.outputStream.pipe(y),await new Promise((e,t)=>{y.on(`close`,e),y.on(`error`,t)}),i?.info({bundlePath:r,fileCount:f.length,redactionCount:_},`bundle written`),{zipPath:r,summary:{projectSlug:o,files:f,redactions:d,redactedLineCount:_,generatedAt:g.generatedAt}}}var Ge=e(y(),1),W=e(C(),1);const Ke=new Set([`doc.name`,`currentDoc`]);function qe(e){return`doc:${U(`sha256`).update(e).digest(`hex`).slice(0,8)}`}function Je(e,t,n){let r=e.docNameMap[n];if(r===void 0){e.docNameMap[n]=t;return}if(r===t)return;let i=e.docNameCollisions[n];i?i.includes(t)||i.push(t):e.docNameCollisions[n]=[t]}function Ye(e,t){let n=t.originalToHashed.get(e);if(n!==void 0)return n;let r=qe(e);return t.originalToHashed.set(e,r),Je(t,e,r),r}function Xe(e,t){return t.length===0||!e.includes(t)?e:e.split(t).join(`<CONTENT_DIR>`)}function G(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function K(e,t){if(typeof e==`string`)return Xe(e,t.contentDir);if(Array.isArray(e))return e.map(e=>K(e,t));if(!G(e))return e;let n=typeof e.key==`string`&&Ke.has(e.key)&&G(e.value)&&typeof e.value.stringValue==`string`?e.value.stringValue:null,r={};for(let[i,a]of Object.entries(e))if(n!==null&&i===`value`&&G(a)){let e=Ye(n,t);r[i]={...a,stringValue:e}}else Ke.has(i)&&typeof a==`string`?r[i]=Ye(a,t):r[i]=K(a,t);return r}function Ze(e,t){if(t.originalToHashed.size===0)return e;let n=Array.from(t.originalToHashed.entries()).sort(([e],[t])=>t.length-e.length),r=e;for(let[e,t]of n)e.length!==0&&r.includes(e)&&(r=r.split(e).join(t));return r}function Qe(e,t){let n=L(e,`utf-8`);if(n.length===0)return;let r=n.endsWith(`
|
|
5
|
+
`),i=n.split(`
|
|
6
|
+
`),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)}}}B(e,r?`${a.join(`
|
|
7
|
+
`)}\n`:a.join(`
|
|
8
|
+
`))}function $e(e,t){let n=L(e,`utf-8`);if(n.trim().length!==0)try{let r=K(JSON.parse(n),t),i=n.endsWith(`
|
|
9
|
+
`)?`
|
|
10
|
+
`:``;B(e,`${JSON.stringify(r,null,2)}${i}`)}catch{let r=Ze(Xe(n,t.contentDir),t);r!==n&&B(e,r)}}function et(e,t){let n=L(e,`utf-8`),r=Xe(n,t.contentDir);r!==n&&B(e,r)}function tt(e){try{return R(e,{withFileTypes:!0}).filter(e=>e.isFile()).map(t=>N(e,t.name))}catch{return[]}}const nt=new Set([`agent-presence.json`,`agent-effects.json`,`runtime.json`]);function rt(e){return/\.log\.\d+$/.test(e)}function it(e){return e.endsWith(`.jsonl`)||e.endsWith(`.log`)||rt(e)}function at(e){let t={contentDir:e.contentDir,docNameMap:{},originalToHashed:new Map,docNameCollisions:{}};for(let n of[`telemetry`,`logs`,`process`])for(let r of tt(N(e.stagingDir,n)))it(r)?Qe(r,t):r.endsWith(`.json`)?$e(r,t):et(r,t);for(let n of tt(N(e.stagingDir,`state`))){let e=j(n);n.endsWith(`.jsonl`)?Qe(n,t):nt.has(e)?$e(n,t):et(n,t)}return{docNameMap:t.docNameMap,docNameCollisions:t.docNameCollisions}}const ot=[`.ok`,`local`,`telemetry`],st=[`.ok`,`local`,`logs`],ct=`spans-current.jsonl`,lt=`spans-prev.jsonl`,ut=`server-current.jsonl`,dt=`server-prev.jsonl`;function ft(e){return N(e,...ot,ct)}function pt(e){return N(e,...ot,lt)}function mt(e){return N(e,...st,ut)}function ht(e){return N(e,...st,dt)}const gt=1e3;async function _t(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/agent-presence`,{signal:AbortSignal.timeout(gt)});return t.ok?await t.text():null}catch{return null}}async function vt(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/agent-effects`,{signal:AbortSignal.timeout(gt)});return t.ok?await t.text():null}catch{return null}}async function yt(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/watcher-recent`,{signal:AbortSignal.timeout(gt)});return t.ok?await t.text():null}catch{return null}}function bt(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(`
|
|
11
|
+
`)}\n`:null}catch{return null}}function xt(e){let t=N(e,`.git`,`ok`);if(!F(t))return null;let n=oe(`git`,[`-C`,t,`log`,`--oneline`,`-50`],u({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function St(e){let t=N(e,`.git`,`ok`);if(!F(t))return null;let n=oe(`git`,[`-C`,t,`for-each-ref`,`--sort=-creatordate`,`--count=50`,`--format=%(refname)%09%(creatordate:iso-strict)%09%(contents:subject)`,`refs/checkpoints/`],u({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function Ct(){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 wt(){return{nodeVersion:process.version,platform:ye(),arch:ge()}}function Tt(){return process.env.OTEL_SDK_DISABLED===`false`}function q(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Et(e){if(!F(e))return{};let t;try{t=(0,Te.parse)(L(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 Dt(e){return typeof e==`boolean`?e:void 0}function Ot(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:void 0}function J(e){if(q(e))return Ot(e.maxBytes)}function kt(e){let t=Et(p(`project`,e)),n=Et(p(`project-local`,e));return{enabled:Dt(n.enabled)??Dt(t.enabled)??!0,spansMaxBytes:J(n.spans)??J(t.spans)??52428800,logsMaxBytes:J(n.logs)??J(t.logs)??26214400}}function At(e){return U(`sha256`).update(e).digest(`hex`)}function jt(e){let t=L(e),n=0;for(let e=0;e<t.length;e++)t[e]===10&&n++;return n}function Mt(e){let t=L(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){return F(e)?(I(M(t),{recursive:!0}),ue(e,t),!0):!1}function Nt(e){let t=[],n=e=>{let r=R(e,{withFileTypes:!0});for(let i of r){let r=N(e,i.name);i.isDirectory()?n(r):i.isFile()&&t.push(r)}};return n(e),t.sort()}const Pt=new Set([`.jsonl`]);function Ft(e){let t=e.lastIndexOf(`.`);return t===-1?!1:Pt.has(e.slice(t))}const It=new Set([`.jsonl`,`.json`,`.txt`,`.log`,`.lock`]);function Lt(e){if(rt(e))return!0;let t=e.lastIndexOf(`.`);return t===-1?!1:It.has(e.slice(t))}function Rt(e){let t=[];for(let n of Nt(e)){let r=zt(e,n);if(!Lt(r))continue;let{redacted:i,patterns:a,lineCount:o}=Ne(L(n,`utf-8`));a.length!==0&&(B(n,i),t.push({file:r,lineCount:o,patterns:a}))}return{redactions:t,redactedLineCount:t.reduce((e,t)=>e+t.lineCount,0)}}function zt(e,t){return ce(e,t).split(le).join(`/`)}async function Bt(e){let r=P(e.contentDir),i=P(e.projectDir??e.contentDir),a=e.deps??{},o=a.fetchAgentPresence??_t,s=a.fetchAgentEffects??vt,c=a.fetchWatcherRecent??yt,l=a.readShadowHead??xt,u=a.readCheckpointRefs??St,d=a.now??(()=>new Date),f=a.okVersion??(()=>k),p=a.readDesktopEnv??Ct,m=a.readRuntime??wt,h=a.isOtlpPushEnabled??Tt,g=pe(N(xe(),`ok-bundle-`));try{I(N(g,`telemetry`),{recursive:!0}),I(N(g,`logs`),{recursive:!0}),I(N(g,`state`),{recursive:!0}),Y(ft(i),N(g,`telemetry`,ct)),Y(pt(i),N(g,`telemetry`,lt)),Y(mt(i),N(g,`logs`,ut)),Y(ht(i),N(g,`logs`,dt));for(let t of e.userLogFiles??[])Y(t,N(g,`logs`,j(t)));let _=N(i,`.ok`,`local`),v=N(_,`server.lock`),y=`not-running`,b=`no server.lock`,x=null;if(F(v)){Y(v,N(g,`state`,`server.lock`));try{let e=L(v,`utf-8`),t=JSON.parse(e);typeof t.port==`number`?x=t.port:b=`lock present but no port`}catch{b=`lock present but unparseable`}}if(x!==null){let e=await o(x);e===null?b=`agent-presence endpoint at :${x} unreachable`:(B(N(g,`state`,`agent-presence.json`),e),y=`running`,b=``);let t=await s(x);t!==null&&B(N(g,`state`,`agent-effects.json`),t);let n=await c(x);if(n!==null){let e=bt(n);e!==null&&B(N(g,`state`,`watcher-recent.jsonl`),e)}}let ee=l(r);ee!==null&&B(N(g,`state`,`shadow-head.txt`),ee);let te=u(r);te!==null&&B(N(g,`state`,`checkpoint-refs.txt`),te),Y(N(_,`last-spawn-error.log`),N(g,`state`,`last-spawn-error.log`)),Y(N(_,n),N(g,`state`,n)),Y(N(_,t),N(g,`state`,t));let S=m(),C=p(),ne={ok:{version:f(),nodeVersion:S.nodeVersion,platform:S.platform,arch:S.arch},host:{desktop:C}};B(N(g,`state`,`runtime.json`),`${JSON.stringify(ne,null,2)}\n`);let re=y===`running`?`running
|
|
12
|
+
`:`not-running (${b})\n`;if(B(N(g,`state`,`server-status.txt`),re),e.processDir&&F(e.processDir)){let t=N(g,`process`);I(t,{recursive:!0}),ue(e.processDir,t,{recursive:!0})}let w=null;e.redact===!0&&(w=at({stagingDir:g,contentDir:r})),e.note&&B(N(g,`note.txt`),e.note);let T=null;e.scrubSecrets===!0&&(T=Rt(g));for(let t of e.extraFiles??[])Y(t.sourcePath,N(g,`extra`,t.zipName??j(t.sourcePath)))||a.logger?.warn({sourcePath:t.sourcePath},`extra file missing; omitted from bundle`);let ie=kt(i),E=Nt(g),D=[],O=0,k=0;for(let e of E){let t=zt(g,e),n=he(e).size,r=Ft(t)?jt(e):0;D.push({path:t,bytes:n,lines:r}),O+=n,t.startsWith(`telemetry/`)&&Ft(t)&&(k+=Mt(e))}let A=w===null?{applied:!1,docNameMapSidecar:null}:Object.keys(w.docNameCollisions).length>0?{applied:!0,docNameMapSidecar:null,docNameCollisions:w.docNameCollisions}:{applied:!0,docNameMapSidecar:null};T!==null&&(A.secretScrub=T);let ae={schemaVersion:1,createdAt:d().toISOString(),ok:{version:f(),nodeVersion:S.nodeVersion,platform:S.platform,arch:S.arch},host:{desktop:C},contentDir:{pathSha256:At(r),absolutePath:w===null?r:`<CONTENT_DIR>`},telemetry:{localSink:ie,otlpPushEnabled:h()},redaction:A,serverStatus:y,files:D};B(N(g,`manifest.json`),`${JSON.stringify(ae,null,2)}\n`);let oe=E.some(e=>{try{return L(e,`utf-8`).includes(r)}catch{return!1}}),M={totalBytes:O,fileCount:D.length,docNameCount:k,contentDirVisible:oe,redacted:w!==null},se=!1;return{stagingDir:g,manifest:ae,summary:M,redactionMapPayload:w===null?null:{docNameMap:w.docNameMap,docNameCollisions:w.docNameCollisions},cleanup:()=>{se||(se=!0,z(g,{recursive:!0,force:!0}))}}}catch(e){throw z(g,{recursive:!0,force:!0}),e}}async function Vt(e){let{collected:t,outputPath:n}=e,r=M(n);if(!F(r))throw Error(`ok diagnose bundle: parent directory does not exist: ${r}. Create it or pass --out with an existing parent.`);if(t.redactionMapPayload!==null){let e=`${j(n,`.zip`)}.docnames.json`,r={...t.manifest,redaction:{...t.manifest.redaction,applied:!0,docNameMapSidecar:e}};B(N(t.stagingDir,`manifest.json`),`${JSON.stringify(r,null,2)}\n`)}let i=new Ge.ZipFile,a=Nt(t.stagingDir);for(let e of a){let n=zt(t.stagingDir,e);i.addFile(e,n)}i.end(),t.redactionMapPayload!==null&&B(N(r,`${j(n,`.zip`)}.docnames.json`),`${JSON.stringify({docNameMap:t.redactionMapPayload.docNameMap,docNameCollisions:t.redactionMapPayload.docNameCollisions},null,2)}\n`,{mode:384});let o=de(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 Ht(e,t){let n=N(e,`.ok`,`config.yml`);if(F(n))try{let t=(0,Te.parse)(L(n,`utf-8`)),r=A(t)?t.content:void 0,i=A(r)?r.dir:void 0;if(typeof i==`string`&&i.length>0)return P(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 P(e)}async function Ut(e,t,n){let r=Ie(t,e.logger),i=await Bt({contentDir:Ht(t,e.logger),projectDir:t,redact:e.redact,scrubSecrets:e.redact,note:e.note,extraFiles:e.extraFiles,userLogFiles:Re(r,e.userLogsDir??N(V(),`.ok`,`logs`)),deps:{readDesktopEnv:n,logger:e.logger}});try{I(M(e.outputPath),{recursive:!0}),await Vt({collected:i,outputPath:e.outputPath});let t=i.manifest.redaction.secretScrub;return{zipPath:e.outputPath,summary:{level:`full`,systemWide:!1,projectSlug:r,files:i.manifest.files.map(e=>e.path),redactions:t?.redactions??[],redactedLineCount:t?.redactedLineCount??0,generatedAt:i.manifest.createdAt}}}finally{i.cleanup()}}async function Wt(e){let{projectDir:t}=e,n=e.readDesktopEnv??Ct;if(e.level===`full`&&t!==void 0)return Ut(e,t,n);let{zipPath:r,summary:i}=await We({projectDir:t,redact:e.redact,outputPath:e.outputPath,userLogsDir:e.userLogsDir,logger:e.logger,note:e.note,extraFiles:e.extraFiles,desktop:n()});return{zipPath:r,summary:{level:e.level,systemWide:t===void 0,projectSlug:i.projectSlug,files:i.files,redactions:i.redactions,redactedLineCount:i.redactedLineCount,generatedAt:i.generatedAt}}}function X(e,t,n={}){let r=g(e,t);if(!F(r))return{status:`missing`,lockPath:r};let i;try{i=JSON.parse(L(r,`utf-8`))}catch{return{status:`corrupt`,lockPath:r}}if(!i||typeof i!=`object`||!v(i.pid))return{status:`corrupt`,lockPath:r};let a=i;if(!(n.isAlive??_)(a.pid))return{status:`dead-pid`,lockPath:r,lock:a};if(typeof a.machineId==`string`)return a.machineId===(n.machineId??h())?{status:`alive`,lockPath:r,lock:a}:{status:`foreign-host`,lockPath:r,lock:a};let o=n.host??ve();return a.hostname===o?{status:`alive`,lockPath:r,lock:a}:{status:`foreign-host`,lockPath:r,lock:a}}function Gt(e){return e.replace(/:\d+$/,``)}function Kt(e){let t=e.trim();if(!t)return null;{let e=/^https?:\/\/([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`https`,hostname:Gt(e[1]),owner:e[2],name:e[3]}}{let e=/^ssh:\/\/(?:[\w.-]+@)?([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`ssh`,hostname:Gt(e[1]),owner:e[2],name:e[3]}}{let e=/^git:\/\/([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`git`,hostname:Gt(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}function qt(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`https:`)return null;let n=r(t.hostname);if(n===null)return null;let i=t.pathname.split(`/`).filter(e=>e.length>0);if(i.length<5||i[2]!==`blob`)return null;let a,o,s,c;try{a=decodeURIComponent(i[0]),o=decodeURIComponent(i[1]),s=decodeURIComponent(i[3]),c=i.slice(4).map(e=>decodeURIComponent(e))}catch{return null}return!a||!o||!s||c.length===0||c.some(e=>e.length===0)?null:{host:n,owner:a,repo:o,branch:s,path:c.join(`/`)}}function Jt(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`https:`)return null;let n=r(t.hostname);if(n===null)return null;let i=t.pathname.split(`/`);if(i.length<5||i[0]!==``||i[3]!==`tree`)return null;let a=i.slice(5);a.length===1&&a[0]===``&&a.pop();let o,s,c,l;try{o=decodeURIComponent(i[1]),s=decodeURIComponent(i[2]),c=decodeURIComponent(i[4]),l=a.map(e=>decodeURIComponent(e))}catch{return null}return!o||!s||!c||l.some(e=>e.length===0)?null:{host:n,owner:o,repo:s,branch:c,path:l.join(`/`)}}function Yt(e){let t=qt(e);if(t)return{kind:`doc`,...t};let n=Jt(e);return n?{kind:`folder`,...n}:null}const Xt=`# >>> open-knowledge cli >>>`,Zt=`# <<< open-knowledge cli <<<`,Qt=/^# >>> open-knowledge cli >>>\n[\s\S]*?^# <<< open-knowledge cli <<<\n?/m;function $t(e){return N(e,`Library`,`Application Support`,`OpenKnowledge`,`path-install.json`)}const en={existsSync:e=>F(e),readFileSync:(e,t)=>L(e,t),lstatSync:e=>fe(e),readlinkSync:e=>me(e)};function tn(e,t=en){let n=$t(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 nn(e){let t=e.replace(Qt,``);return{text:t,changed:t!==e,emptyAfter:t.trim()===``}}function rn(e,t,n=en){try{return n.lstatSync(e).isSymbolicLink()?n.readlinkSync(e)===t:!1}catch{return!1}}function an(e){return te(e)||S(e)||w(e)}const on=10*1024*1024;function sn(e,t,n,r){let i=D(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(!an(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);return e.format===`file`?(z(a,{force:!0}),{kind:`removed`}):e.format===`toml`?un(a,o):e.format===`yaml`?ln(a,e.topLevelKey,o):cn(a,e.topLevelKey,e.serverMapSubKey,o)}function cn(e,t,n,r){let i;try{i=L(e,`utf-8`)}catch{return{kind:`declined`,reason:`unparseable`}}if(Buffer.byteLength(i,`utf-8`)>on)return{kind:`declined`,reason:`oversize`};let{text:a,changed:o}=ne(i,ie(t,n,r));return o?(m(e,a,{mode:T(e)}),{kind:`removed`}):{kind:`not-present`}}function ln(e,t,n){let r;try{r=L(e,`utf-8`)}catch{return{kind:`declined`,reason:`unparseable`}}if(Buffer.byteLength(r,`utf-8`)>on)return{kind:`declined`,reason:`oversize`};let i=r.charCodeAt(0)===65279,a=i?r.slice(1):r,o=(0,Te.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=re(a);a.trim()===``||a.endsWith(`
|
|
13
|
+
`)?c.endsWith(`
|
|
14
|
+
`)||(c=`${c}\n`):c=c.replace(/\n+$/,``),l&&(c=c.replace(/\r\n/g,`
|
|
15
|
+
`).replace(/\n/g,`\r
|
|
16
|
+
`));let u=`${i?``:``}${c}`;return u!==r&&m(e,u,{mode:T(e)}),{kind:`removed`}}function un(e,t){let n=E();if(n.backend===`fallback`)return{kind:`declined`,reason:`no-native-writer`};let r;try{r=L(e,`utf-8`)}catch{return{kind:`declined`,reason:`unparseable`}}let i=r.charCodeAt(0)===65279,a=i?r.slice(1):r,o=re(a),s=a.trim()===``||a.endsWith(`
|
|
17
|
+
`),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(`
|
|
18
|
+
`)||(l=`${l}\n`):l=l.replace(/\n+$/,``),o&&(l=l.replace(/\r\n/g,`
|
|
19
|
+
`).replace(/\n/g,`\r
|
|
20
|
+
`));let u=`${i?``:``}${l}`;return u!==r&&m(e,u,{mode:T(e)}),{kind:`removed`}}function dn(e){return e==null?!1:e.includes(`--type=utility`)&&e.includes(`--utility-sub-type=node.mojom.NodeService`)}function fn(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 pn(e,t,n,r,i,a){if(t.status===`missing`||t.status===`corrupt`)return null;let o=t.lock,s=null;if(n.status!==`missing`&&n.status!==`corrupt`){let e=n.lock;s={port:e.port,status:n.status,pid:e.pid,startedAt:e.startedAt,usage:a}}return{directory:o.worktreeRoot,server:{port:o.port,status:t.status,pid:o.pid,startedAt:o.startedAt,usage:i},ui:s,hostname:o.hostname,lockPath:t.lockPath,binary:r==null?null:l(r),command:r,isDesktop:dn(r)}}function mn(e){return e.ui==null?!1:e.ui.status===`alive`||e.ui.status===`foreign-host`}function Z(e){let t=e.server.status;return t===`alive`||t===`foreign-host`?e.isDesktop?`desktop`:t===`alive`?`running`:`foreign`:t===`dead-pid`&&mn(e)?`ui-orphan`:`stale`}const hn=new Set([`running`,`desktop`,`foreign`,`ui-orphan`]);function gn(e){switch(e){case`running`:return W.default.green(e);case`desktop`:return W.default.blue(e);case`foreign`:return W.default.cyan(e);case`ui-orphan`:return W.default.magenta(e);case`stale`:return W.default.yellow(e)}}function _n(e){return e==null?`—`:`${e.cpuPercent.toFixed(1)}% / ${e.memPercent.toFixed(1)}%`}function vn(e){return`${_n(e.server.usage)} | ${_n(e.ui?.usage??null)}`}function yn(e){return`${e.server.port===0?`(starting)`:String(e.server.port)} / ${e.ui==null||e.ui.status===`dead-pid`?`—`:String(e.ui.port)}`}function bn(e){if(e.length===0)return`No open-knowledge servers found.`;let t=[`DIRECTORY`,`PORTS (API/UI)`,`CPU/MEM (API | UI)`,`STATUS`,`PID`,`STARTED`,`BINARY`],n=e.map(e=>{let t=Z(e),n=t===`ui-orphan`&&e.ui!=null?e.ui.pid:e.server.pid;return[e.directory,yn(e),vn(e),t,String(n),fn(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=gn(Z(e))+` `.repeat(Math.max(0,(i[t]??0)-r.length))}o.push(n)}return o.join(` `).trimEnd()}),s=W.default.dim(`To stop a server: ok stop <port|pid|directory|all>`);return[a,...o,``,s].join(`
|
|
21
|
+
`)}async function xn(e={}){let t=e.discover??c,n=e.inspect??X,r=e.log??(e=>console.log(e)),i=e.resolveCommand??a,o=e.resolveUsage??s,l=await t(),u=[];for(let e of l){let t=n(e,`server`),r=n(e,`ui`),a=pn(e,t,r,t.status===`missing`||t.status===`corrupt`?null:i(t.lock.pid),t.status===`missing`||t.status===`corrupt`?null:o(t.lock.pid),r.status===`missing`||r.status===`corrupt`?null:o(r.lock.pid));a!=null&&u.push(a)}if(e.json){let e=u.map(e=>({...e,displayStatus:Z(e)}));r(JSON.stringify(e,null,2));return}r(bn(e.all?u:u.filter(e=>hn.has(Z(e)))))}function Sn(){return new b(`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 xn({all:t.all===!0||e===`all`,json:t.json===!0})})}function Cn(e,t,n={}){let r=n.isAlive??_,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 wn(e){let t=e.inspect??(t=>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=Cn(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 Q(e,t){return e.status===`alive`?!0:e.status===`foreign-host`?t(e.lock.pid):!1}async function Tn(e,t=_){let n=await c(),r=null;for(let i of n){let n=X(i,`server`),a=X(i,`ui`);if(Q(n,t)&&n.lock.port===e||Q(a,t)&&a.lock.port===e)return i;r===null&&(Q(n,t)&&n.lock.pid===e||Q(a,t)&&a.lock.pid===e)&&(r=i)}return r}function $(e){let t=wn({lockDir:e});return t.failed.length>0&&(process.exitCode=1),t}function En(e){return new b(`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=wn({lockDir:i(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 xn({});return}if(n===`all`){let e=await c();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=X(n,`ui`);!Q(e,_)&&!Q(r,_)||($(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 Tn(e);if(t===null){console.log(`No running open-knowledge server found with port or PID ${e}.`);return}$(t);return}$(i(P(Ae(),n)))})}function Dn(e){return{event:`mcp-config-decline`,scope:e.scope,surface:e.surface,editorId:e.editorId,reason:e.reason}}async function On(e,t){let n,i;try{n=await H(P(e)),i=await H(P(M(e)))}catch{return{kind:`not-git`}}if(!kn(n,i))return{kind:`symlink-escape`};let a=N(n,`.git`),o;try{o=he(a)}catch{return{kind:`not-git`}}if(o.isDirectory()){let e;try{e=await H(a)}catch{return{kind:`not-git`}}if(!kn(e,n))return{kind:`symlink-escape`}}else if(!o.isFile())return{kind:`not-git`};let s=d(n);if(s.kind!==`repository`)return{kind:`not-git`};let c=s.repository.readRemoteUrl(`origin`);if(c.kind===`unreadable`)return{kind:`not-git`};if(c.kind===`absent`)return c.reason===`config-missing`?{kind:`not-git`}:{kind:`no-origin`};let l=c.url,u=Kt(l);if(u===null)return{kind:`non-github`};let f=r(u.hostname);if(f===null)return{kind:`non-github`};let p=f===t.host.toLowerCase(),m=u.owner.toLowerCase()===t.owner.toLowerCase(),h=u.name.toLowerCase()===t.repo.toLowerCase();return!p&&m&&h?{kind:`wrong-host`,actualHost:f}:!p||!m||!h?{kind:`wrong-repo`,actualOwner:u.owner,actualRepo:u.name}:{kind:`ok`,gitRemoteUrl:`https://${f}/${u.owner}/${u.name}.git`}}function kn(e,t){if(e===t)return!0;let n=ce(t,e);return n.length>0&&!n.startsWith(`..`)&&!se(n)}const An=[{id:`mcp-config`,write(e,t,n){let r=e.projectConfigPath?.(t);if(!r)return{integration:`mcp-config`,editorId:e.id,action:`skipped-unsupported`};try{let i=O(e,t,n,void 0,r);return i.action===`written`||i.action===`overwritten`?{integration:`mcp-config`,editorId:e.id,action:i.action,path:i.configPath}:i.action===`failed`?{integration:`mcp-config`,editorId:e.id,action:`failed`,path:i.configPath,error:i.error??`unknown failure`}:i.action===`declined`?{integration:`mcp-config`,editorId:e.id,action:`declined`,path:i.configPath,...i.declineReason===void 0?{}:{reason:i.declineReason}}:{integration:`mcp-config`,editorId:e.id,action:`failed`,path:i.configPath,error:`unexpected project-scope action: ${i.action}`}}catch(t){return{integration:`mcp-config`,editorId:e.id,action:`failed`,path:r,error:t instanceof Error?t.message:String(t)}}}},{id:`project-skill`,write(e,t,n){try{let r=ee(e,t,{home:n.home});return{integration:`project-skill`,editorId:e.id,action:r.action,...r.path?{path:r.path}:{},...r.error?{error:r.error}:{}}}catch(t){return{integration:`project-skill`,editorId:e.id,action:`failed`,error:t instanceof Error?t.message:String(t)}}}}];function jn(e,t,n={},r=An){let i=[];for(let a of t){let t=x[a];for(let a of r)i.push(a.write(t,e,n))}return i}function Mn(e,t,n={}){return{integrations:jn(e,t,n)}}export{Fe as C,ke as D,Ae as E,De as O,Vt as S,Ne as T,Jt as _,En as a,Wt as b,Xt as c,rn as d,$t as f,Yt as g,qt as h,wn as i,Qt as l,nn as m,On as n,Sn as o,tn as p,Dn as r,sn as s,Mn as t,Zt as u,Kt as v,Pe as w,Bt as x,X as y};
|
|
22
|
+
//# sourceMappingURL=src-9fqRbYyu.mjs.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{L as e,P as t}from"./src-CJ8mKCzo.mjs";import{_i as n,a as r,gn as i,ui as a}from"./src-CIFd3tOE.mjs";import{C as o,w as s}from"./write-project-skill-CeYehb7h.mjs";import{a as c,n as l,t as u}from"./acp-harness-probe-DBmMQ34A.mjs";import{n as d}from"./constants-BfFX3vAt.mjs";import{spawn as f}from"node:child_process";import{basename as p,dirname as m,join as h,win32 as g}from"node:path";import{closeSync as _,existsSync as v,mkdirSync as y,openSync as b,statSync as x}from"node:fs";import{homedir as S}from"node:os";import{rm as C}from"node:fs/promises";import{setTimeout as w}from"node:timers/promises";function T(e){let t={...e};return delete t.ELECTRON_RUN_AS_NODE,t}function E(e,t,n={}){let r=(n.spawn??f)(e,[...t],a({detached:!0,stdio:`ignore`,env:T(n.env??process.env)}));return r.unref(),r}const D=`OpenKnowledge.app`,O=`/Applications/${D}`;function k(){return{platform:process.platform,env:process.env,execPath:process.execPath,isTTY:process.stdout.isTTY,statSync:e=>{try{return x(e,{throwIfNoEntry:!1})??null}catch{return null}}}}function A(e){if(e.env.ELECTRON_RUN_AS_NODE===`1`){let t=/(.+?\.app)\/Contents\/MacOS\//.exec(e.execPath);if(t?.[1])return t[1]}if(j(e,O))return O;let t=h(e.homeDir??S(),`Applications`,D);return j(e,t)?t:null}function j(e,t){return M(e,h(t,`Contents`,`MacOS`,`OpenKnowledge`))}function M(e,t){try{let n=e.statSync(t);return n&&typeof n.isFile==`function`?n.isFile():!1}catch{return!1}}const N=[`@inkeepopen-knowledge-desktop`,`OpenKnowledge`];function P(e){if(e.env.ELECTRON_RUN_AS_NODE===`1`&&/\\OpenKnowledge\.exe$/i.test(e.execPath))return e.execPath;let t=e.env.LOCALAPPDATA;if(t)for(let n of N){let r=g.join(t,`Programs`,n,`OpenKnowledge.exe`);if(M(e,r))return r}return null}function F(e){if(e.env.ELECTRON_RUN_AS_NODE===`1`&&e.execPath.endsWith(`/openknowledge`))return e.execPath;let t=`/opt/OpenKnowledge/openknowledge`;return M(e,t)?t:null}function I(e){if(e.env.OK_FORCE_BROWSER===`1`)return{available:!1,reason:`force-browser`};if(e.platform!==`darwin`&&e.platform!==`win32`&&e.platform!==`linux`)return{available:!1,reason:`unsupported-platform`};let t;try{t=e.platform===`darwin`?A(e):e.platform===`win32`?P(e):F(e)}catch{return{available:!1,reason:`stat-error`}}return t?e.env.OK_FORCE_DESKTOP===`1`?{available:!0,reason:`available`,bundlePath:t}:!(e.isTTY===!0||e.platform===`win32`&&e.isTTY===void 0&&!e.env.CI)||e.env.SSH_CONNECTION||e.env.SSH_TTY||e.platform===`linux`&&!e.env.DISPLAY&&!e.env.WAYLAND_DISPLAY?{available:!1,reason:`headless`,bundlePath:t}:{available:!0,reason:`available`,bundlePath:t}:{available:!1,reason:`no-bundle`}}function L(e,t){let n=e.log??(e=>console.error(e)),r=e.platform??process.platform;if(n("Launching OpenKnowledge desktop (use `ok start` for the browser server, or `OK_FORCE_BROWSER=1` to always skip)"),r===`darwin`){E(`open`,[`-b`,`com.inkeep.open-knowledge`],{spawn:e.spawn});return}let i=t?.bundlePath;if(!i){n(`Desktop launch skipped: no resolved desktop executable (caller bug).`);return}E(i,[],{spawn:e.spawn})}function R(e=`no-bundle`){switch(e){case`no-bundle`:return`Desktop app not found (checked the standard install locations for this OS). Install it, or omit --mode for browser mode.`;case`darwin-only`:case`unsupported-platform`:return`Desktop app is not available on this platform. Use --mode=browser, or omit --mode for the server fallback.`;case`headless`:return`Desktop launch is gated in headless contexts (CI, SSH, non-TTY stdout). Set OK_FORCE_DESKTOP=1 to override, or use --mode=browser.`;case`force-browser`:return`OK_FORCE_BROWSER=1 is set — desktop dispatch is disabled. Unset it to use --mode=app.`;case`stat-error`:return`Failed to inspect the desktop install (filesystem error). Check permissions or use --mode=browser.`;case`available`:return`Desktop app appears available but launch dispatch did not fire (caller bug).`}}function z(e){return h(m(e),`..`,`Frameworks`,`OpenKnowledge Server.app`,`Contents`,`MacOS`,`OpenKnowledge Helper`)}const B=/\/[^/]+\.app\/Contents\/MacOS\/[^/]+$/;function ee(e){if(e.platform!==`darwin`||!B.test(e.execPath))return null;let t=z(e.execPath);return e.exists(t)?t:null}function V(e={}){let t=e.execPath??process.execPath,n=e.platform??process.platform,r=e.argv??process.argv,i=e.exists??v,a=r[1];return a?{command:ee({execPath:t,platform:n,exists:i})??t,prefixArgs:[a]}:(console.warn(`[self-spawn] process.argv[1] is empty — falling back to \`npx -y @inkeep/open-knowledge@latest\`. This re-introduces the registry-fetch surface that re-exec was fixing. Observed argv: ${JSON.stringify(r)}`),{command:`npx`,prefixArgs:[`-y`,`@inkeep/open-knowledge@latest`]})}function te(e,t){return e.host??t.HOST??`127.0.0.1`}function H(e){let t=p(e).replace(/[^\x20-\x7E]/g,``).trim().slice(0,64);return`open-knowledge-server ${t.length>0?t:`unknown`}`}var U=class extends Error{cwd;constructor(e){super("This directory isn't set up yet. Run `ok init` first, then `ok start` again."),this.name=`OkDirMissingError`,this.cwd=e}};function W(e){return e.uiLock?e.isAlive(e.uiLock.pid)?{action:`skip`,reason:`alive`,pid:e.uiLock.pid,port:e.uiLock.port}:{action:`spawn`,reason:`stale`,stalePid:e.uiLock.pid}:{action:`spawn`,reason:`absent`}}function G(t){v(t.lockDir)||y(t.lockDir,{recursive:!0});let n=b(h(t.lockDir,e),`w`),r=t.spawn??f,{PORT:i,...a}=process.env,o=V();try{let e=r(o.command,[...o.prefixArgs,...t.args??[`ui`]],{detached:!0,stdio:[`ignore`,`ignore`,n],windowsHide:!0,cwd:t.cwd,env:{...a,ELECTRON_RUN_AS_NODE:`1`}});return e.unref(),e}finally{try{_(n)}catch{}}}function K(e,t,n){return e??(n===void 0?t:void 0)}function q(e,t){return e!==void 0&&t!==null&&t.port>0&&t.draining!==!0}function J(e,t,n){return e??+(t!=null&&!n)}async function Y(e){let t=e.spawn??f,n=V(),{PORT:r,...i}=process.env,a=t(n.command,[...n.prefixArgs,`ui`,`--port`,String(e.uiPort)],{cwd:e.cwd,stdio:`inherit`,windowsHide:!0,env:{...i,ELECTRON_RUN_AS_NODE:`1`}}),o=!1,s=e=>{o=!0;try{a.kill(e)}catch{}},c=()=>s(`SIGINT`),l=()=>s(`SIGTERM`);process.once(`SIGINT`,c),process.once(`SIGTERM`,l),await new Promise(e=>{a.on(`exit`,(t,n)=>{process.exitCode=J(t,n,o),e()}),a.on(`error`,t=>{console.error(`[start] connect fallback: failed to spawn ok ui — ${t instanceof Error?t.message:String(t)}`),process.exitCode=1,e()})}),process.removeListener(`SIGINT`,c),process.removeListener(`SIGTERM`,l)}async function X(e){let t=e.now()+e.timeoutMs;for(;e.now()<t;){let t=e.readUiLock();if(t&&t.port>0)return t.port;await e.sleep(e.pollIntervalMs)}let n=e.readUiLock();return n&&n.port>0?n.port:null}const ne=t;function Z(e,t,n=e=>C(e,{recursive:!0,force:!0})){return async()=>{try{await e()}finally{try{await n(t)}catch(e){process.stderr.write(`[start] ephemeral temp dir reap failed for ${t}: ${e instanceof Error?e.message:String(e)}\n`)}}}}function Q(e,t={}){let n=t.exit??(e=>process.exit(e)),r=t.getActiveHandles??(()=>{let e=process._getActiveHandles;return e?e.call(process):null});return async()=>{let i=!1;try{await e()}catch(e){i=!0,t.log?.error({err:e},`idle-shutdown: destroy failed — exiting anyway`)}finally{let e=null;try{let t=r();if(t!==null){e={};for(let n of t){let t=n?.constructor?.name??`unknown`;e[t]=(e[t]??0)+1}}}catch{e=null}t.log?.info({event:`idle-shutdown-exit`,exitCode:+!!i,openHandles:e??{},handlesAvailable:e!==null},`idle-shutdown: teardown finished — exiting process`),n(+!!i)}}}async function $(e){let t=e.sigtermGraceMs??ne,n=e.sigtermPollIntervalMs??200,r=e.sleep??(e=>w(e)),i=e.reason??`teardown`;try{let a=e.readUiLock(),o=e.spawnedUiPid();if(a&&e.isAlive(a.pid)&&a.pid!==o)e.log?.info({pid:a.pid,port:a.port,spawnedUiPid:o},`${i}: ui.lock holder is not our spawned sibling — leaving it alone`);else if(a&&e.isAlive(a.pid))try{e.killPid(a.pid,`SIGTERM`),e.log?.info({pid:a.pid,port:a.port},`${i}: SIGTERM UI sibling`);let o=Date.now()+t;for(;Date.now()<o&&e.isAlive(a.pid);)await r(n);if(e.isAlive(a.pid))try{e.killPid(a.pid,`SIGKILL`),e.log?.warn({pid:a.pid,graceMs:t},`${i}: SIGTERM grace expired — escalated to SIGKILL`)}catch(t){e.log?.error({pid:a.pid,err:t},`${i}: SIGKILL failed`)}}catch(t){e.log?.warn({pid:a.pid,err:t},`${i}: failed to SIGTERM UI sibling`)}}catch(t){e.log?.warn({err:t},`${i}: UI lookup failed; proceeding`)}}function re(e){let{destroy:t,...n}=e;return async()=>{await $({...n,reason:`idle-shutdown`}),await t()}}async function ie(e){let{config:t,cwd:a,host:o}=e,s=e.skipAutoInit??!1,d=e.skipUiAutoSpawn??!1,f=e.idleThresholdMs??18e5,{existsSync:p,mkdirSync:m}=await import(`node:fs`),{basename:h,dirname:g}=await import(`node:path`),{bootServer:_,getLogger:v,isProcessAlive:y,readUiLock:b,resolveContentDir:x,resolveLockDir:S,waitForServerLockDrain:C}=await import(`./src-DHVO9P4d.mjs`),T=e.log??v(`start`),E=e.singleFile!==void 0,D=e.projectDir??a,O=E?r(e.singleFile).canonicalFilePath:void 0,k=O?g(O):void 0,A=O?h(O):void 0;if(!E){if(!s&&!i(a))throw new U(a);let t=process.env.OK_RECLAIM_DISABLE??null,n=e=>{let t=typeof e.event==`string`?e.event:``;(t.endsWith(`-failed`)||t.endsWith(`-error`)||t.endsWith(`-missing`))&&T.warn({event:e},`[start] reclaim sweep reported a problem`)};try{(e.repairMcpConfigsFn??(await import(`./repair-mcp-configs-DUqMgq-Z.mjs`)).repairMcpConfigs)({projectDir:a,reclaimDisableEnv:t,logger:n})}catch(e){T.warn({err:e},`[start] mcp-config repair sweep failed; continuing`)}try{(e.repairLaunchJsonFn??(await import(`./repair-launch-json-DZb9bXlv.mjs`)).repairLaunchJson)({projectDir:a,reclaimDisableEnv:t,logger:n})}catch(e){T.warn({err:e},`[start] launch.json repair sweep failed; continuing`)}try{await(e.repairSkillsFn??(await import(`./repair-skills-Buq5QlSJ.mjs`)).repairSkills)({projectDir:a,reclaimDisableEnv:t,logger:n})}catch(e){T.warn({err:e},`[start] skill repair sweep failed; continuing`)}}let j=k??x(t,a);!E&&!p(j)&&(m(j,{recursive:!0}),T.info({contentDir:j},`Created content directory`));let M=null,N=null,P=async({lockDir:t})=>{if(M=W({uiLock:b(t),isAlive:y}),M.action===`spawn`&&!d)try{let n=e.uiPort===void 0?void 0:[`ui`,`--port`,String(e.uiPort)];N=G({lockDir:t,cwd:a,spawn:e.spawn,args:n}).pid??null,T.info({reason:M.reason,uiPort:e.uiPort},`[start] auto-spawned ok ui sibling`)}catch(e){console.warn(`[start] failed to auto-spawn ok ui: ${e instanceof Error?e.message:String(e)}`)}else M.action===`skip`&&T.info({port:M.port,pid:M.pid},`UI already running at port ${M.port}`)},F=e.reactShellDistDir===void 0,I=c(),L=n();{let e=S(E?D:a),t=Date.now(),n=await C(e);n!==`no-drain`&&T.info({event:`start-waited-for-draining-predecessor`,outcome:n,waitedMs:Date.now()-t,drainLockDir:e},n===`released`?`[start] predecessor server finished draining — proceeding`:`[start] predecessor server still draining after wait — proceeding to collide`)}let R=await _({config:t,contentDir:j,projectDir:E?D:a,contentRoot:E?void 0:t.content.dir,port:e.port,host:o,quiet:!1,detectGh:l,tokenStore:I,embeddingsKeyStore:L,...E?{ephemeral:!0,singleDocRelPath:A,gitEnabled:!1,gitPreflight:()=>({ok:!0,version:`0.0.0`,resolvedPath:`git`,source:`PATH`})}:{},localOpCliArgs:[process.execPath,process.argv[1]],probeHarnessManagedMcpEntry:(e,t)=>u(e,t),attachUiSibling:F,idleShutdownMs:f,skipAutoInit:!0,...F?{spawnUiSiblingFn:P}:{},idleShutdownHandler:t=>{let n=re({readUiLock:()=>b(R.lockDir),spawnedUiPid:()=>N,isAlive:y,killPid:(e,t)=>{process.kill(e,t)},destroy:t,log:T});return Q(E?Z(n,D):n,{log:T,exit:e.idleExit})},log:T,...e.serveContentAssets===void 0?{}:{serveContentAssets:e.serveContentAssets},...e.reactShellDistDir?{reactShellDistDir:e.reactShellDistDir}:{}});M||={action:`skip`,reason:`alive`,pid:0,port:0};let z=M,B=null;if(z.action===`skip`)B=z.port>0?z.port:null;else if(!d){let t=e.uiBindTimeoutMs??3e3;B=await X({readUiLock:()=>b(R.lockDir),now:Date.now,sleep:e=>w(e),timeoutMs:t,pollIntervalMs:50}),B===null&&T.warn({timeoutMs:t},`[start] ok ui did not bind within timeout — banner falls back to API URL`)}return{httpServer:R.httpServer,destroy:R.destroy,lockDir:R.lockDir,contentDir:j,port:R.port,ready:R.ready,degraded:R.degraded,uiSpawnDecision:M,spawnedUiPid:N,resolvedUiPort:B}}function ae(e){if(e===`browser`||e===`app`)return e;throw new s(`--mode must be 'browser' or 'app'`)}function oe(e){let t=Number.parseInt(e,10);if(Number.isNaN(t)||t<1||t>65535)throw new s(`--ui-port must be a port number between 1 and 65535`);return t}function se(e){return e.OK_CONSOLE_LEVEL!==void 0||e.LOG_LEVEL!==void 0?null:`warn`}function ce(e){let t=[`Stopping OpenKnowledge…`,`Saving pending changes and releasing the server lock — this can take a few seconds.`];return e===`SIGINT`&&t.push(`Press Ctrl+C again to force quit.`),t}async function le(e,t){let n=se(process.env);n!==null&&(process.env.OK_CONSOLE_LEVEL=n);let{renderBanner:r}=await import(`./banner--DGfdMN8.mjs`),{accent:i,dim:a,error:o,warning:s}=await import(`./colors-MGDi6UGf.mjs`),c=process.cwd(),l=e;process.title=H(c);let u=te(t,process.env),f=t.port===void 0?void 0:Number(t.port),p=process.env.PORT?Number(process.env.PORT):void 0,m=t.uiPort===void 0?void 0:Number(t.uiPort),h=K(f,p,m);if(m!==void 0){let{readServerLock:e,resolveLockDir:t}=await import(`./src-DHVO9P4d.mjs`);if(q(m,e(t(c)))){await Y({cwd:c,uiPort:m});return}}let g;try{g=await ie({config:l,cwd:c,host:u,port:h,...m===void 0?{}:{uiPort:m},...t.serveContentAssets===void 0?{}:{serveContentAssets:t.serveContentAssets},...t.reactShellDistDir?{reactShellDistDir:t.reactShellDistDir}:{},...t.singleFile?{singleFile:t.singleFile}:{},...t.projectDir?{projectDir:t.projectDir}:{}})}catch(e){e instanceof U&&(console.error(o(e.message)),process.exit(1));let t=await import(`./src-DHVO9P4d.mjs`);if((e instanceof t.GitNotAvailableError||e instanceof t.GitTooOldError)&&process.exit(78),(e instanceof t.SingleFileNotFoundError||e instanceof t.SingleFileNotAFileError||e instanceof t.SingleFileNotMarkdownError)&&(console.error(o(e.message)),process.exit(1)),m!==void 0&&ue(e,t)){await Y({cwd:c,uiPort:m});return}let n=de(e,c,t);n!==null&&(console.error(o(n)),process.exit(1)),console.error(`${o(`Failed to start:`)} ${e instanceof Error?e.stack??e.message:String(e)}`),process.exit(1)}let _=!1,v=async e=>{if(_)return;_=!0;let[t,...n]=ce(e);console.log(i(`\n${t}`));for(let e of n)console.log(a(` ${e}`));if(g.spawnedUiPid!==null)try{let{getLogger:e,isProcessAlive:t,readUiLock:n}=await import(`./src-DHVO9P4d.mjs`);await $({readUiLock:()=>n(g.lockDir),spawnedUiPid:()=>g.spawnedUiPid,isAlive:t,killPid:(e,t)=>process.kill(e,t),log:e(`start`),reason:`shutdown`})}catch(e){console.error(`${o(`ui sibling teardown failed:`)} ${e instanceof Error?e.stack??e.message:String(e)}`)}try{await g.destroy()}catch(e){console.error(`${o(`destroy() failed:`)} ${e instanceof Error?e.stack??e.message:String(e)}`),process.exitCode=1}process.exit(process.exitCode??0)};process.once(`SIGINT`,()=>{v(`SIGINT`)}),process.once(`SIGTERM`,()=>{v(`SIGTERM`)});let y=`http://${u}:${g.port}`,b=u===`0.0.0.0`||u===`::`?`http://0.0.0.0:${g.port}`:void 0,x=g.resolvedUiPort,S=x!==null&&x>0?`http://${u}:${x}`:y;console.log(r({name:`open-knowledge`,version:d,localUrl:S,apiUrl:S===y?void 0:y,networkUrl:b,nextSteps:[`Open the Editor URL in your browser to start editing.`]}));let C={"shadow-repo":`Version history and branch-switch safety unavailable`,"file-watcher":`External file changes will not sync to the editor`,"head-watcher":`Git branch switches may cause document inconsistency`};g.ready.then(async()=>{if(g.degraded.length>0){console.log();for(let e of g.degraded){let t=C[e]??`${e} (check server logs for details)`;console.warn(` ${s(`⚠`)} ${s(e)}: ${a(t)}`)}console.log()}if(t.open){let{openBrowser:e}=await import(`./open-browser-CXby8R3t.mjs`);e(S)}}).catch(e=>{console.error(` ${o(`Server initialization failed:`)} ${e instanceof Error?e.message:String(e)}`)})}function ue(e,t){let n=t.ServerLockCollisionError;return n!==void 0&&e instanceof n}function de(e,t,n){let r=n.ServerLockCollisionError;if(r===void 0||!(e instanceof r))return null;try{let e=h(t,`.ok`),r=n.readServerLock(e);return r?r.kind===`interactive`?`OpenKnowledge desktop is currently running on this project. Quit it or use --cwd to point elsewhere.`:r.kind===`mcp-spawned`?"An MCP-spawned server holds this lock; it should release on idle-shutdown (~30 min). Or run `ok stop`.":"OpenKnowledge server is already running on this project — check `ok status` or `ok stop`.":"OpenKnowledge server is already running on this project — check `ok status` or `ok stop`."}catch{return null}}function fe(e){return new o(`start`).description(`Start the knowledge base collab server`).option(`-p, --port <port>`,`Server port`,void 0).option(`--ui-port <port>`,`Pin the ok ui sibling to <port> and connect (not exit) if a server already runs here — the worktree-preview recipe path`,oe).option(`-H, --host <host>`,`Server host`,void 0).option(`--open`,`Open browser after start`).option(`--mode <mode>`,`Force dispatch mode: 'browser' or 'app'`,ae).option(`--serve-content-assets`,`Serve content assets from this server (now the default; kept for compatibility)`).option(`--react-shell-dist-dir <path>`,`Serve React shell from <path> (suppresses ok ui sibling)`).option(`--single-file <path>`,`No-project ephemeral single-file mode: scope the server to one markdown file (git + MCP off)`).option(`--project-dir <dir>`,`Throwaway project root for --single-file (where ephemeral .ok/ state lives)`).action(async t=>{let n=e();if(t.mode===`app`){t.open&&(process.stderr.write(`error: option '--mode=app' cannot be combined with '--open' (--open opens a browser tab against the local server, which app mode does not boot)
|
|
1
|
+
import{L as e,P as t}from"./src-CJ8mKCzo.mjs";import{_i as n,a as r,gn as i,ui as a}from"./src-CIFd3tOE.mjs";import{C as o,w as s}from"./write-project-skill-CeYehb7h.mjs";import{a as c,n as l,t as u}from"./acp-harness-probe-PwxCSk8L.mjs";import{n as d}from"./constants-CcMCMPg3.mjs";import{spawn as f}from"node:child_process";import{basename as p,dirname as m,join as h,win32 as g}from"node:path";import{closeSync as _,existsSync as v,mkdirSync as y,openSync as b,statSync as x}from"node:fs";import{homedir as S}from"node:os";import{rm as C}from"node:fs/promises";import{setTimeout as w}from"node:timers/promises";function T(e){let t={...e};return delete t.ELECTRON_RUN_AS_NODE,t}function E(e,t,n={}){let r=(n.spawn??f)(e,[...t],a({detached:!0,stdio:`ignore`,env:T(n.env??process.env)}));return r.unref(),r}const D=`OpenKnowledge.app`,O=`/Applications/${D}`;function k(){return{platform:process.platform,env:process.env,execPath:process.execPath,isTTY:process.stdout.isTTY,statSync:e=>{try{return x(e,{throwIfNoEntry:!1})??null}catch{return null}}}}function A(e){if(e.env.ELECTRON_RUN_AS_NODE===`1`){let t=/(.+?\.app)\/Contents\/MacOS\//.exec(e.execPath);if(t?.[1])return t[1]}if(j(e,O))return O;let t=h(e.homeDir??S(),`Applications`,D);return j(e,t)?t:null}function j(e,t){return M(e,h(t,`Contents`,`MacOS`,`OpenKnowledge`))}function M(e,t){try{let n=e.statSync(t);return n&&typeof n.isFile==`function`?n.isFile():!1}catch{return!1}}const N=[`@inkeepopen-knowledge-desktop`,`OpenKnowledge`];function P(e){if(e.env.ELECTRON_RUN_AS_NODE===`1`&&/\\OpenKnowledge\.exe$/i.test(e.execPath))return e.execPath;let t=e.env.LOCALAPPDATA;if(t)for(let n of N){let r=g.join(t,`Programs`,n,`OpenKnowledge.exe`);if(M(e,r))return r}return null}function F(e){if(e.env.ELECTRON_RUN_AS_NODE===`1`&&e.execPath.endsWith(`/openknowledge`))return e.execPath;let t=`/opt/OpenKnowledge/openknowledge`;return M(e,t)?t:null}function I(e){if(e.env.OK_FORCE_BROWSER===`1`)return{available:!1,reason:`force-browser`};if(e.platform!==`darwin`&&e.platform!==`win32`&&e.platform!==`linux`)return{available:!1,reason:`unsupported-platform`};let t;try{t=e.platform===`darwin`?A(e):e.platform===`win32`?P(e):F(e)}catch{return{available:!1,reason:`stat-error`}}return t?e.env.OK_FORCE_DESKTOP===`1`?{available:!0,reason:`available`,bundlePath:t}:!(e.isTTY===!0||e.platform===`win32`&&e.isTTY===void 0&&!e.env.CI)||e.env.SSH_CONNECTION||e.env.SSH_TTY||e.platform===`linux`&&!e.env.DISPLAY&&!e.env.WAYLAND_DISPLAY?{available:!1,reason:`headless`,bundlePath:t}:{available:!0,reason:`available`,bundlePath:t}:{available:!1,reason:`no-bundle`}}function L(e,t){let n=e.log??(e=>console.error(e)),r=e.platform??process.platform;if(n("Launching OpenKnowledge desktop (use `ok start` for the browser server, or `OK_FORCE_BROWSER=1` to always skip)"),r===`darwin`){E(`open`,[`-b`,`com.inkeep.open-knowledge`],{spawn:e.spawn});return}let i=t?.bundlePath;if(!i){n(`Desktop launch skipped: no resolved desktop executable (caller bug).`);return}E(i,[],{spawn:e.spawn})}function R(e=`no-bundle`){switch(e){case`no-bundle`:return`Desktop app not found (checked the standard install locations for this OS). Install it, or omit --mode for browser mode.`;case`darwin-only`:case`unsupported-platform`:return`Desktop app is not available on this platform. Use --mode=browser, or omit --mode for the server fallback.`;case`headless`:return`Desktop launch is gated in headless contexts (CI, SSH, non-TTY stdout). Set OK_FORCE_DESKTOP=1 to override, or use --mode=browser.`;case`force-browser`:return`OK_FORCE_BROWSER=1 is set — desktop dispatch is disabled. Unset it to use --mode=app.`;case`stat-error`:return`Failed to inspect the desktop install (filesystem error). Check permissions or use --mode=browser.`;case`available`:return`Desktop app appears available but launch dispatch did not fire (caller bug).`}}function z(e){return h(m(e),`..`,`Frameworks`,`OpenKnowledge Server.app`,`Contents`,`MacOS`,`OpenKnowledge Helper`)}const B=/\/[^/]+\.app\/Contents\/MacOS\/[^/]+$/;function ee(e){if(e.platform!==`darwin`||!B.test(e.execPath))return null;let t=z(e.execPath);return e.exists(t)?t:null}function V(e={}){let t=e.execPath??process.execPath,n=e.platform??process.platform,r=e.argv??process.argv,i=e.exists??v,a=r[1];return a?{command:ee({execPath:t,platform:n,exists:i})??t,prefixArgs:[a]}:(console.warn(`[self-spawn] process.argv[1] is empty — falling back to \`npx -y @inkeep/open-knowledge@latest\`. This re-introduces the registry-fetch surface that re-exec was fixing. Observed argv: ${JSON.stringify(r)}`),{command:`npx`,prefixArgs:[`-y`,`@inkeep/open-knowledge@latest`]})}function te(e,t){return e.host??t.HOST??`127.0.0.1`}function H(e){let t=p(e).replace(/[^\x20-\x7E]/g,``).trim().slice(0,64);return`open-knowledge-server ${t.length>0?t:`unknown`}`}var U=class extends Error{cwd;constructor(e){super("This directory isn't set up yet. Run `ok init` first, then `ok start` again."),this.name=`OkDirMissingError`,this.cwd=e}};function W(e){return e.uiLock?e.isAlive(e.uiLock.pid)?{action:`skip`,reason:`alive`,pid:e.uiLock.pid,port:e.uiLock.port}:{action:`spawn`,reason:`stale`,stalePid:e.uiLock.pid}:{action:`spawn`,reason:`absent`}}function G(t){v(t.lockDir)||y(t.lockDir,{recursive:!0});let n=b(h(t.lockDir,e),`w`),r=t.spawn??f,{PORT:i,...a}=process.env,o=V();try{let e=r(o.command,[...o.prefixArgs,...t.args??[`ui`]],{detached:!0,stdio:[`ignore`,`ignore`,n],windowsHide:!0,cwd:t.cwd,env:{...a,ELECTRON_RUN_AS_NODE:`1`}});return e.unref(),e}finally{try{_(n)}catch{}}}function K(e,t,n){return e??(n===void 0?t:void 0)}function q(e,t){return e!==void 0&&t!==null&&t.port>0&&t.draining!==!0}function J(e,t,n){return e??+(t!=null&&!n)}async function Y(e){let t=e.spawn??f,n=V(),{PORT:r,...i}=process.env,a=t(n.command,[...n.prefixArgs,`ui`,`--port`,String(e.uiPort)],{cwd:e.cwd,stdio:`inherit`,windowsHide:!0,env:{...i,ELECTRON_RUN_AS_NODE:`1`}}),o=!1,s=e=>{o=!0;try{a.kill(e)}catch{}},c=()=>s(`SIGINT`),l=()=>s(`SIGTERM`);process.once(`SIGINT`,c),process.once(`SIGTERM`,l),await new Promise(e=>{a.on(`exit`,(t,n)=>{process.exitCode=J(t,n,o),e()}),a.on(`error`,t=>{console.error(`[start] connect fallback: failed to spawn ok ui — ${t instanceof Error?t.message:String(t)}`),process.exitCode=1,e()})}),process.removeListener(`SIGINT`,c),process.removeListener(`SIGTERM`,l)}async function X(e){let t=e.now()+e.timeoutMs;for(;e.now()<t;){let t=e.readUiLock();if(t&&t.port>0)return t.port;await e.sleep(e.pollIntervalMs)}let n=e.readUiLock();return n&&n.port>0?n.port:null}const ne=t;function Z(e,t,n=e=>C(e,{recursive:!0,force:!0})){return async()=>{try{await e()}finally{try{await n(t)}catch(e){process.stderr.write(`[start] ephemeral temp dir reap failed for ${t}: ${e instanceof Error?e.message:String(e)}\n`)}}}}function Q(e,t={}){let n=t.exit??(e=>process.exit(e)),r=t.getActiveHandles??(()=>{let e=process._getActiveHandles;return e?e.call(process):null});return async()=>{let i=!1;try{await e()}catch(e){i=!0,t.log?.error({err:e},`idle-shutdown: destroy failed — exiting anyway`)}finally{let e=null;try{let t=r();if(t!==null){e={};for(let n of t){let t=n?.constructor?.name??`unknown`;e[t]=(e[t]??0)+1}}}catch{e=null}t.log?.info({event:`idle-shutdown-exit`,exitCode:+!!i,openHandles:e??{},handlesAvailable:e!==null},`idle-shutdown: teardown finished — exiting process`),n(+!!i)}}}async function $(e){let t=e.sigtermGraceMs??ne,n=e.sigtermPollIntervalMs??200,r=e.sleep??(e=>w(e)),i=e.reason??`teardown`;try{let a=e.readUiLock(),o=e.spawnedUiPid();if(a&&e.isAlive(a.pid)&&a.pid!==o)e.log?.info({pid:a.pid,port:a.port,spawnedUiPid:o},`${i}: ui.lock holder is not our spawned sibling — leaving it alone`);else if(a&&e.isAlive(a.pid))try{e.killPid(a.pid,`SIGTERM`),e.log?.info({pid:a.pid,port:a.port},`${i}: SIGTERM UI sibling`);let o=Date.now()+t;for(;Date.now()<o&&e.isAlive(a.pid);)await r(n);if(e.isAlive(a.pid))try{e.killPid(a.pid,`SIGKILL`),e.log?.warn({pid:a.pid,graceMs:t},`${i}: SIGTERM grace expired — escalated to SIGKILL`)}catch(t){e.log?.error({pid:a.pid,err:t},`${i}: SIGKILL failed`)}}catch(t){e.log?.warn({pid:a.pid,err:t},`${i}: failed to SIGTERM UI sibling`)}}catch(t){e.log?.warn({err:t},`${i}: UI lookup failed; proceeding`)}}function re(e){let{destroy:t,...n}=e;return async()=>{await $({...n,reason:`idle-shutdown`}),await t()}}async function ie(e){let{config:t,cwd:a,host:o}=e,s=e.skipAutoInit??!1,d=e.skipUiAutoSpawn??!1,f=e.idleThresholdMs??18e5,{existsSync:p,mkdirSync:m}=await import(`node:fs`),{basename:h,dirname:g}=await import(`node:path`),{bootServer:_,getLogger:v,isProcessAlive:y,readUiLock:b,resolveContentDir:x,resolveLockDir:S,waitForServerLockDrain:C}=await import(`./src-DHVO9P4d.mjs`),T=e.log??v(`start`),E=e.singleFile!==void 0,D=e.projectDir??a,O=E?r(e.singleFile).canonicalFilePath:void 0,k=O?g(O):void 0,A=O?h(O):void 0;if(!E){if(!s&&!i(a))throw new U(a);let t=process.env.OK_RECLAIM_DISABLE??null,n=e=>{let t=typeof e.event==`string`?e.event:``;(t.endsWith(`-failed`)||t.endsWith(`-error`)||t.endsWith(`-missing`))&&T.warn({event:e},`[start] reclaim sweep reported a problem`)};try{(e.repairMcpConfigsFn??(await import(`./repair-mcp-configs-DpdVVhiU.mjs`)).repairMcpConfigs)({projectDir:a,reclaimDisableEnv:t,logger:n})}catch(e){T.warn({err:e},`[start] mcp-config repair sweep failed; continuing`)}try{(e.repairLaunchJsonFn??(await import(`./repair-launch-json-CZawWAqd.mjs`)).repairLaunchJson)({projectDir:a,reclaimDisableEnv:t,logger:n})}catch(e){T.warn({err:e},`[start] launch.json repair sweep failed; continuing`)}try{await(e.repairSkillsFn??(await import(`./repair-skills-Buq5QlSJ.mjs`)).repairSkills)({projectDir:a,reclaimDisableEnv:t,logger:n})}catch(e){T.warn({err:e},`[start] skill repair sweep failed; continuing`)}}let j=k??x(t,a);!E&&!p(j)&&(m(j,{recursive:!0}),T.info({contentDir:j},`Created content directory`));let M=null,N=null,P=async({lockDir:t})=>{if(M=W({uiLock:b(t),isAlive:y}),M.action===`spawn`&&!d)try{let n=e.uiPort===void 0?void 0:[`ui`,`--port`,String(e.uiPort)];N=G({lockDir:t,cwd:a,spawn:e.spawn,args:n}).pid??null,T.info({reason:M.reason,uiPort:e.uiPort},`[start] auto-spawned ok ui sibling`)}catch(e){console.warn(`[start] failed to auto-spawn ok ui: ${e instanceof Error?e.message:String(e)}`)}else M.action===`skip`&&T.info({port:M.port,pid:M.pid},`UI already running at port ${M.port}`)},F=e.reactShellDistDir===void 0,I=c(),L=n();{let e=S(E?D:a),t=Date.now(),n=await C(e);n!==`no-drain`&&T.info({event:`start-waited-for-draining-predecessor`,outcome:n,waitedMs:Date.now()-t,drainLockDir:e},n===`released`?`[start] predecessor server finished draining — proceeding`:`[start] predecessor server still draining after wait — proceeding to collide`)}let R=await _({config:t,contentDir:j,projectDir:E?D:a,contentRoot:E?void 0:t.content.dir,port:e.port,host:o,quiet:!1,detectGh:l,tokenStore:I,embeddingsKeyStore:L,...E?{ephemeral:!0,singleDocRelPath:A,gitEnabled:!1,gitPreflight:()=>({ok:!0,version:`0.0.0`,resolvedPath:`git`,source:`PATH`})}:{},localOpCliArgs:[process.execPath,process.argv[1]],probeHarnessManagedMcpEntry:(e,t)=>u(e,t),attachUiSibling:F,idleShutdownMs:f,skipAutoInit:!0,...F?{spawnUiSiblingFn:P}:{},idleShutdownHandler:t=>{let n=re({readUiLock:()=>b(R.lockDir),spawnedUiPid:()=>N,isAlive:y,killPid:(e,t)=>{process.kill(e,t)},destroy:t,log:T});return Q(E?Z(n,D):n,{log:T,exit:e.idleExit})},log:T,...e.serveContentAssets===void 0?{}:{serveContentAssets:e.serveContentAssets},...e.reactShellDistDir?{reactShellDistDir:e.reactShellDistDir}:{}});M||={action:`skip`,reason:`alive`,pid:0,port:0};let z=M,B=null;if(z.action===`skip`)B=z.port>0?z.port:null;else if(!d){let t=e.uiBindTimeoutMs??3e3;B=await X({readUiLock:()=>b(R.lockDir),now:Date.now,sleep:e=>w(e),timeoutMs:t,pollIntervalMs:50}),B===null&&T.warn({timeoutMs:t},`[start] ok ui did not bind within timeout — banner falls back to API URL`)}return{httpServer:R.httpServer,destroy:R.destroy,lockDir:R.lockDir,contentDir:j,port:R.port,ready:R.ready,degraded:R.degraded,uiSpawnDecision:M,spawnedUiPid:N,resolvedUiPort:B}}function ae(e){if(e===`browser`||e===`app`)return e;throw new s(`--mode must be 'browser' or 'app'`)}function oe(e){let t=Number.parseInt(e,10);if(Number.isNaN(t)||t<1||t>65535)throw new s(`--ui-port must be a port number between 1 and 65535`);return t}function se(e){return e.OK_CONSOLE_LEVEL!==void 0||e.LOG_LEVEL!==void 0?null:`warn`}function ce(e){let t=[`Stopping OpenKnowledge…`,`Saving pending changes and releasing the server lock — this can take a few seconds.`];return e===`SIGINT`&&t.push(`Press Ctrl+C again to force quit.`),t}async function le(e,t){let n=se(process.env);n!==null&&(process.env.OK_CONSOLE_LEVEL=n);let{renderBanner:r}=await import(`./banner--DGfdMN8.mjs`),{accent:i,dim:a,error:o,warning:s}=await import(`./colors-MGDi6UGf.mjs`),c=process.cwd(),l=e;process.title=H(c);let u=te(t,process.env),f=t.port===void 0?void 0:Number(t.port),p=process.env.PORT?Number(process.env.PORT):void 0,m=t.uiPort===void 0?void 0:Number(t.uiPort),h=K(f,p,m);if(m!==void 0){let{readServerLock:e,resolveLockDir:t}=await import(`./src-DHVO9P4d.mjs`);if(q(m,e(t(c)))){await Y({cwd:c,uiPort:m});return}}let g;try{g=await ie({config:l,cwd:c,host:u,port:h,...m===void 0?{}:{uiPort:m},...t.serveContentAssets===void 0?{}:{serveContentAssets:t.serveContentAssets},...t.reactShellDistDir?{reactShellDistDir:t.reactShellDistDir}:{},...t.singleFile?{singleFile:t.singleFile}:{},...t.projectDir?{projectDir:t.projectDir}:{}})}catch(e){e instanceof U&&(console.error(o(e.message)),process.exit(1));let t=await import(`./src-DHVO9P4d.mjs`);if((e instanceof t.GitNotAvailableError||e instanceof t.GitTooOldError)&&process.exit(78),(e instanceof t.SingleFileNotFoundError||e instanceof t.SingleFileNotAFileError||e instanceof t.SingleFileNotMarkdownError)&&(console.error(o(e.message)),process.exit(1)),m!==void 0&&ue(e,t)){await Y({cwd:c,uiPort:m});return}let n=de(e,c,t);n!==null&&(console.error(o(n)),process.exit(1)),console.error(`${o(`Failed to start:`)} ${e instanceof Error?e.stack??e.message:String(e)}`),process.exit(1)}let _=!1,v=async e=>{if(_)return;_=!0;let[t,...n]=ce(e);console.log(i(`\n${t}`));for(let e of n)console.log(a(` ${e}`));if(g.spawnedUiPid!==null)try{let{getLogger:e,isProcessAlive:t,readUiLock:n}=await import(`./src-DHVO9P4d.mjs`);await $({readUiLock:()=>n(g.lockDir),spawnedUiPid:()=>g.spawnedUiPid,isAlive:t,killPid:(e,t)=>process.kill(e,t),log:e(`start`),reason:`shutdown`})}catch(e){console.error(`${o(`ui sibling teardown failed:`)} ${e instanceof Error?e.stack??e.message:String(e)}`)}try{await g.destroy()}catch(e){console.error(`${o(`destroy() failed:`)} ${e instanceof Error?e.stack??e.message:String(e)}`),process.exitCode=1}process.exit(process.exitCode??0)};process.once(`SIGINT`,()=>{v(`SIGINT`)}),process.once(`SIGTERM`,()=>{v(`SIGTERM`)});let y=`http://${u}:${g.port}`,b=u===`0.0.0.0`||u===`::`?`http://0.0.0.0:${g.port}`:void 0,x=g.resolvedUiPort,S=x!==null&&x>0?`http://${u}:${x}`:y;console.log(r({name:`open-knowledge`,version:d,localUrl:S,apiUrl:S===y?void 0:y,networkUrl:b,nextSteps:[`Open the Editor URL in your browser to start editing.`]}));let C={"shadow-repo":`Version history and branch-switch safety unavailable`,"file-watcher":`External file changes will not sync to the editor`,"head-watcher":`Git branch switches may cause document inconsistency`};g.ready.then(async()=>{if(g.degraded.length>0){console.log();for(let e of g.degraded){let t=C[e]??`${e} (check server logs for details)`;console.warn(` ${s(`⚠`)} ${s(e)}: ${a(t)}`)}console.log()}if(t.open){let{openBrowser:e}=await import(`./open-browser-CXby8R3t.mjs`);e(S)}}).catch(e=>{console.error(` ${o(`Server initialization failed:`)} ${e instanceof Error?e.message:String(e)}`)})}function ue(e,t){let n=t.ServerLockCollisionError;return n!==void 0&&e instanceof n}function de(e,t,n){let r=n.ServerLockCollisionError;if(r===void 0||!(e instanceof r))return null;try{let e=h(t,`.ok`),r=n.readServerLock(e);return r?r.kind===`interactive`?`OpenKnowledge desktop is currently running on this project. Quit it or use --cwd to point elsewhere.`:r.kind===`mcp-spawned`?"An MCP-spawned server holds this lock; it should release on idle-shutdown (~30 min). Or run `ok stop`.":"OpenKnowledge server is already running on this project — check `ok status` or `ok stop`.":"OpenKnowledge server is already running on this project — check `ok status` or `ok stop`."}catch{return null}}function fe(e){return new o(`start`).description(`Start the knowledge base collab server`).option(`-p, --port <port>`,`Server port`,void 0).option(`--ui-port <port>`,`Pin the ok ui sibling to <port> and connect (not exit) if a server already runs here — the worktree-preview recipe path`,oe).option(`-H, --host <host>`,`Server host`,void 0).option(`--open`,`Open browser after start`).option(`--mode <mode>`,`Force dispatch mode: 'browser' or 'app'`,ae).option(`--serve-content-assets`,`Serve content assets from this server (now the default; kept for compatibility)`).option(`--react-shell-dist-dir <path>`,`Serve React shell from <path> (suppresses ok ui sibling)`).option(`--single-file <path>`,`No-project ephemeral single-file mode: scope the server to one markdown file (git + MCP off)`).option(`--project-dir <dir>`,`Throwaway project root for --single-file (where ephemeral .ok/ state lives)`).action(async t=>{let n=e();if(t.mode===`app`){t.open&&(process.stderr.write(`error: option '--mode=app' cannot be combined with '--open' (--open opens a browser tab against the local server, which app mode does not boot)
|
|
2
2
|
`),process.exit(2));let e=[];if(t.port!==void 0&&e.push(`--port`),t.uiPort!==void 0&&e.push(`--ui-port`),t.host!==void 0&&e.push(`--host`),e.length>0){let t=process.env.OK_LOG_LEVEL??`info`;(t===`debug`||t===`trace`)&&console.error(`--mode=app: ignoring ${e.join(`, `)}`)}let n=I(k());if(n.available){L({spawn:f},n);return}console.error(R(n.reason)),process.exit(1)}await le(n,t)})}export{k as C,E,V as S,L as T,fe as _,J as a,Z as b,H as c,K as d,te as f,G as g,q as h,re as i,ce as l,le as m,X as n,Y as o,se as p,ie as r,W as s,U as t,ue as u,$ as v,I as w,Q as x,de as y};
|
|
3
|
-
//# sourceMappingURL=start-
|
|
3
|
+
//# sourceMappingURL=start-FUQOcvoI.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e,f as t,r as n}from"./start-FUQOcvoI.mjs";export{n as bootStartServer,t as resolveHost,e as startCommand};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/open-knowledge",
|
|
3
|
-
"version": "0.42.0-beta.
|
|
3
|
+
"version": "0.42.0-beta.13",
|
|
4
4
|
"license": "GPL-3.0-or-later",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -61,10 +61,10 @@
|
|
|
61
61
|
"ajv-formats": "^3.0.1",
|
|
62
62
|
"tsdown": "^0.21.7",
|
|
63
63
|
"typescript": "^5.9.3",
|
|
64
|
-
"@inkeep/open-knowledge-
|
|
65
|
-
"@inkeep/open-knowledge-
|
|
64
|
+
"@inkeep/open-knowledge-core": "0.42.0-beta.13",
|
|
65
|
+
"@inkeep/open-knowledge-app": "0.42.0-beta.13",
|
|
66
66
|
"@inkeep/open-knowledge-native-config": "0.0.0",
|
|
67
|
-
"@inkeep/open-knowledge-server": "0.42.0-beta.
|
|
67
|
+
"@inkeep/open-knowledge-server": "0.42.0-beta.13"
|
|
68
68
|
},
|
|
69
69
|
"scripts": {
|
|
70
70
|
"build:cli": "tsdown",
|
package/dist/init-3qum_Y1d.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as e}from"./init-C_8c_GuV.mjs";export{e as runInit};
|
package/dist/loader-BqiMtLnR.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./loader-CapxpoeG.mjs";export{e as loadConfig};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./preview-BVUzeg2X.mjs";export{t as formatPreviewBlock,e as previewContent};
|