@inkeep/open-knowledge 0.0.0-dev-20260424235440 → 0.0.0-dev-20260425193248
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/{banner-CI3--er0.mjs → banner-B9XXjTZc.mjs} +2 -2
- package/dist/{chokidar-Z9-8o-jG.mjs → chokidar-DhL3M6Oj.mjs} +1 -1
- package/dist/cli.mjs +14 -14
- package/dist/colors-CMt7h9Vn.mjs +1 -0
- package/dist/{colors-Cmha5EZJ.mjs → colors-Jf5QUiX2.mjs} +1 -1
- package/dist/constants-BQaeExTr.mjs +2 -0
- package/dist/dist-Bx295PM_.mjs +1 -0
- package/dist/{src-CB-sXsMW.mjs → dist-h83E8Lop.mjs} +75 -75
- package/dist/{src-H34RCSr9.mjs → dist-wAieHPG9.mjs} +23 -23
- package/dist/{esm-BbkJd7ro.mjs → esm-DcyORBXm.mjs} +1 -1
- package/dist/{execAsync-CUbOIvpN.mjs → execAsync-CUVyYd50.mjs} +1 -1
- package/dist/{execAsync-CjzNx_Wg.mjs → execAsync-DXwNXlSG.mjs} +1 -1
- package/dist/{execAsync-xymjJFLm.mjs → execAsync-r1zz6x3t.mjs} +1 -1
- package/dist/{getMachineId-bsd-B_JlAoG9.mjs → getMachineId-bsd-BrpAo1fJ.mjs} +2 -2
- package/dist/{getMachineId-bsd-CMAUw13R.mjs → getMachineId-bsd-DZHdCHYD.mjs} +2 -2
- package/dist/{getMachineId-bsd-DrOrzTD2.mjs → getMachineId-bsd-o7HphUWK.mjs} +2 -2
- package/dist/{getMachineId-darwin-BQcf5peQ.mjs → getMachineId-darwin-3D3eRDVl.mjs} +2 -2
- package/dist/{getMachineId-darwin-DC2qb-xd.mjs → getMachineId-darwin-CsteOFjK.mjs} +2 -2
- package/dist/{getMachineId-darwin-DTGIdpu7.mjs → getMachineId-darwin-D-BjJUXV.mjs} +2 -2
- package/dist/{getMachineId-linux-CMta7vmz.mjs → getMachineId-linux-BELE5feP.mjs} +2 -2
- package/dist/{getMachineId-linux-nez-pYOw.mjs → getMachineId-linux-C-EpqTRh.mjs} +2 -2
- package/dist/{getMachineId-linux-C3A6DqVu.mjs → getMachineId-linux-CceeieLZ.mjs} +2 -2
- package/dist/{getMachineId-unsupported-gFGrtRr7.mjs → getMachineId-unsupported-C9qPEPHy.mjs} +2 -2
- package/dist/{getMachineId-unsupported-j-7WDfTT.mjs → getMachineId-unsupported-CUPNvbj5.mjs} +2 -2
- package/dist/{getMachineId-unsupported-BrxgPAkN.mjs → getMachineId-unsupported-CrmDv6SC.mjs} +2 -2
- package/dist/{getMachineId-win-CfF1zVez.mjs → getMachineId-win-AH3HxM3-.mjs} +2 -2
- package/dist/{getMachineId-win-D8Js6D_D.mjs → getMachineId-win-BHtOEO59.mjs} +2 -2
- package/dist/{getMachineId-win-DsIEIIis.mjs → getMachineId-win-CFHq48vo.mjs} +2 -2
- package/dist/git-handle-BhGnmvTB-BLKTZ5Yk.mjs +1 -0
- package/dist/git-handle-BhGnmvTB-DnqwJBAv.mjs +2 -0
- package/dist/index.mjs +1 -1
- package/dist/init-B8Nr-WHf.mjs +1 -0
- package/dist/init-DaTddrbM.mjs +1 -0
- package/dist/{init-0LxWJ-6l.mjs → init-Itm712r0.mjs} +2 -2
- package/dist/{init-CUmfZczR.mjs → init-NMjOmrTP.mjs} +5 -5
- package/dist/{is-object-7k010cEq.mjs → is-object-CEU0BgQ5.mjs} +1 -1
- package/dist/{keepalive-CfaIYv9f.mjs → keepalive-DCcA7pmC.mjs} +1 -1
- package/dist/loader-DW8bVj-Z.mjs +1 -0
- package/dist/loader-DkbY6ZLN.mjs +3 -0
- package/dist/{open-browser-T-bOz6ZQ.mjs → open-browser-ryHU9Kmc.mjs} +1 -1
- package/dist/paths-B8oV95O5.mjs +1 -0
- package/dist/paths-SX6F7bew.mjs +2 -0
- package/dist/preview-QqXnlaPm.mjs +1 -0
- package/dist/preview-RWJaR_PK.mjs +3 -0
- package/dist/public/assets/ActivityModeContent-DgzyXqn2.js +2 -0
- package/dist/public/assets/DocumentContext-sx4y_fGB.js +5 -0
- package/dist/public/assets/GraphPanel-D8k5I70O.js +46 -0
- package/dist/public/assets/McpConsentDialogBody-DnEgm77n.js +1 -0
- package/dist/public/assets/{PageListContext-DdGQSVEJ.js → PageListContext-BMPOeSCn.js} +72 -72
- package/dist/public/assets/{SourceEditor-C2oyeI25.js → SourceEditor-Buo7XU1f.js} +3 -3
- package/dist/public/assets/{clipboard-DRhtxu43.js → clipboard-Cww2W4TE.js} +7 -7
- package/dist/public/assets/{index-D_7iKKj-.js → index-CSqyIoHN.js} +13 -13
- package/dist/public/assets/index-DLJBF2zC.css +1 -0
- package/dist/public/assets/propagation-api-Bugyj7xy.js +1 -0
- package/dist/public/assets/telemetry-impl-D8K_lJGH.js +2 -0
- package/dist/public/assets/{toggle-group-B86VAmbm.js → toggle-group-DHcz1Spj.js} +1 -1
- package/dist/public/assets/tooltip-Be1xrEel.js +1 -0
- package/dist/public/index.html +19 -19
- package/dist/rolldown-runtime-wcPFST8Q-DriDJLQM.mjs +2 -0
- package/dist/server-lock-CH0GCP_4-DCYOtKMW.mjs +2 -0
- package/dist/server-lock-CH0GCP_4-DHiJeSSV.mjs +1 -0
- package/dist/src-D7CWqlQk.mjs +1 -0
- package/dist/start-CJe8n54q.mjs +1 -0
- package/dist/start-D5z6-Rq6.mjs +2 -0
- package/dist/{wrapper-BlhyhsXg.mjs → wrapper-DDHUdYtj.mjs} +1 -1
- package/package.json +2 -2
- package/dist/colors-CxLEz90E.mjs +0 -1
- package/dist/constants-Bp2eH26E.mjs +0 -2
- package/dist/git-handle-C7se1dk0.mjs +0 -2
- package/dist/git-handle-DmfLnwyi.mjs +0 -1
- package/dist/init-CQtHg31y.mjs +0 -1
- package/dist/init-EmyViDSm.mjs +0 -1
- package/dist/loader-5fUYhvT7.mjs +0 -3
- package/dist/loader-CLKYIpRM.mjs +0 -1
- package/dist/paths-Bmv6OTgc.mjs +0 -1
- package/dist/paths-D7eyE9c-.mjs +0 -2
- package/dist/preview-Bwvil0xG.mjs +0 -1
- package/dist/preview-DW48ZUVb.mjs +0 -3
- package/dist/public/assets/ActivityModeContent-DER5Nogg.js +0 -2
- package/dist/public/assets/DocumentContext--jj-O3yz.js +0 -5
- package/dist/public/assets/GraphPanel-CBqnoz3m.js +0 -46
- package/dist/public/assets/McpConsentDialogBody-D_7y-PBs.js +0 -1
- package/dist/public/assets/index-CIIADYsi.css +0 -1
- package/dist/public/assets/propagation-api-CQodqriD.js +0 -1
- package/dist/public/assets/telemetry-impl-BTqkcpTj.js +0 -2
- package/dist/public/assets/tooltip-C2q723j6.js +0 -1
- package/dist/server-lock-4vgF5yho.mjs +0 -2
- package/dist/server-lock-CJkiM3qX.mjs +0 -1
- package/dist/src-CO-0JWV1.mjs +0 -1
- package/dist/src-DNH9XQcP.mjs +0 -1
- package/dist/start-D22sG9zf.mjs +0 -1
- package/dist/start-DbI7KgzR.mjs +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{n as e,r as t}from"./chunk-FK9Q3tQk.mjs";var n,r=e((()=>{n=`1.9.1`}));function i(e){let t=new Set([e]),n=new Set,r=e.match(a);if(!r)return()=>!1;let i={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(i.prerelease!=null)return function(t){return t===e};function o(e){return n.add(e),!1}function s(e){return t.add(e),!0}return function(e){if(t.has(e))return!0;if(n.has(e))return!1;let r=e.match(a);if(!r)return o(e);let c={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};return c.prerelease!=null||i.major!==c.major?o(e):i.major===0?i.minor===c.minor&&i.patch<=c.patch?s(e):o(e):i.minor<=c.minor?s(e):o(e)}}var a,o,s=e((()=>{r(),a=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/,o=i(n)}));function c(e,t,r,i=!1){let a=f[d]=f[d]??{version:n};if(!i&&a[e]){let t=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return r.error(t.stack||t.message),!1}if(a.version!==`1.9.1`){let t=Error(`@opentelemetry/api: Registration of version v${a.version} for ${e} does not match previously registered API v${n}`);return r.error(t.stack||t.message),!1}return a[e]=t,r.debug(`@opentelemetry/api: Registered a global for ${e} v${n}.`),!0}function l(e){let t=f[d]?.version;if(!(!t||!o(t)))return f[d]?.[e]}function u(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${n}.`);let r=f[d];r&&delete r[e]}var ee,d,f,p=e((()=>{r(),s(),ee=n.split(`.`)[0],d=Symbol.for(`opentelemetry.js.api.${ee}`),f=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{}}));function m(e,t,n){let r=l(`diag`);if(r)return r[e](t,...n)}var te,ne=e((()=>{p(),te=class{constructor(e){this._namespace=e.namespace||`DiagComponentLogger`}debug(...e){return m(`debug`,this._namespace,e)}error(...e){return m(`error`,this._namespace,e)}info(...e){return m(`info`,this._namespace,e)}warn(...e){return m(`warn`,this._namespace,e)}verbose(...e){return m(`verbose`,this._namespace,e)}}})),h,g=e((()=>{(function(e){e[e.NONE=0]=`NONE`,e[e.ERROR=30]=`ERROR`,e[e.WARN=50]=`WARN`,e[e.INFO=60]=`INFO`,e[e.DEBUG=70]=`DEBUG`,e[e.VERBOSE=80]=`VERBOSE`,e[e.ALL=9999]=`ALL`})(h||={})}));function re(e,t){e<h.NONE?e=h.NONE:e>h.ALL&&(e=h.ALL),t||={};function n(n,r){let i=t[n];return typeof i==`function`&&e>=r?i.bind(t):function(){}}return{error:n(`error`,h.ERROR),warn:n(`warn`,h.WARN),info:n(`info`,h.INFO),debug:n(`debug`,h.DEBUG),verbose:n(`verbose`,h.VERBOSE)}}var ie=e((()=>{g()})),ae,_,v=e((()=>{ne(),ie(),g(),p(),ae=`diag`,_=class e{static instance(){return this._instance||=new e,this._instance}constructor(){function e(e){return function(...t){let n=l(`diag`);if(n)return n[e](...t)}}let t=this;t.setLogger=(e,n={logLevel:h.INFO})=>{if(e===t){let e=Error(`Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation`);return t.error(e.stack??e.message),!1}typeof n==`number`&&(n={logLevel:n});let r=l(`diag`),i=re(n.logLevel??h.INFO,e);if(r&&!n.suppressOverrideMessage){let e=Error().stack??`<failed to generate stacktrace>`;r.warn(`Current logger will be overwritten from ${e}`),i.warn(`Current logger will overwrite one already registered from ${e}`)}return c(`diag`,i,t,!0)},t.disable=()=>{u(ae,t)},t.createComponentLogger=e=>new te(e),t.verbose=e(`verbose`),t.debug=e(`debug`),t.info=e(`info`),t.warn=e(`warn`),t.error=e(`error`)}}})),oe,se=e((()=>{oe=class e{constructor(e){this._entries=e?new Map(e):new Map}getEntry(e){let t=this._entries.get(e);if(t)return Object.assign({},t)}getAllEntries(){return Array.from(this._entries.entries())}setEntry(t,n){let r=new e(this._entries);return r._entries.set(t,n),r}removeEntry(t){let n=new e(this._entries);return n._entries.delete(t),n}removeEntries(...t){let n=new e(this._entries);for(let e of t)n._entries.delete(e);return n}clear(){return new e}}})),ce,le=e((()=>{ce=Symbol(`BaggageEntryMetadata`)}));function ue(e={}){return new oe(new Map(Object.entries(e)))}function de(e){return typeof e!=`string`&&(fe.error(`Cannot create baggage metadata from unknown type: ${typeof e}`),e=``),{__TYPE__:ce,toString(){return e}}}var fe,pe=e((()=>{v(),se(),le(),fe=_.instance()}));function me(e){return Symbol.for(e)}var he,y,b=e((()=>{he=class e{constructor(t){let n=this;n._currentContext=t?new Map(t):new Map,n.getValue=e=>n._currentContext.get(e),n.setValue=(t,r)=>{let i=new e(n._currentContext);return i._currentContext.set(t,r),i},n.deleteValue=t=>{let r=new e(n._currentContext);return r._currentContext.delete(t),r}}},y=new he})),x,S,ge,_e=e((()=>{if(x=[{n:`error`,c:`error`},{n:`warn`,c:`warn`},{n:`info`,c:`info`},{n:`debug`,c:`debug`},{n:`verbose`,c:`trace`}],S={},typeof console<`u`)for(let e of[`error`,`warn`,`info`,`debug`,`trace`,`log`])typeof console[e]==`function`&&(S[e]=console[e]);ge=class{constructor(){function e(e){return function(...t){let n=S[e];if(typeof n!=`function`&&(n=S.log),typeof n!=`function`&&console&&(n=console[e],typeof n!=`function`&&(n=console.log)),typeof n==`function`)return n.apply(console,t)}}for(let t=0;t<x.length;t++)this[x[t].n]=e(x[t].c)}}}));function ve(){return T}var ye,C,be,xe,Se,Ce,w,we,Te,Ee,T,De,Oe,ke,Ae,je,Me,Ne,Pe=e((()=>{ye=class{constructor(){}createGauge(e,t){return Oe}createHistogram(e,t){return ke}createCounter(e,t){return De}createUpDownCounter(e,t){return Ae}createObservableGauge(e,t){return Me}createObservableCounter(e,t){return je}createObservableUpDownCounter(e,t){return Ne}addBatchObservableCallback(e,t){}removeBatchObservableCallback(e){}},C=class{},be=class extends C{add(e,t){}},xe=class extends C{add(e,t){}},Se=class extends C{record(e,t){}},Ce=class extends C{record(e,t){}},w=class{addCallback(e){}removeCallback(e){}},we=class extends w{},Te=class extends w{},Ee=class extends w{},T=new ye,De=new be,Oe=new Se,ke=new Ce,Ae=new xe,je=new we,Me=new Te,Ne=new Ee})),Fe,Ie=e((()=>{(function(e){e[e.INT=0]=`INT`,e[e.DOUBLE=1]=`DOUBLE`})(Fe||={})})),E,D,Le=e((()=>{E={get(e,t){if(e!=null)return e[t]},keys(e){return e==null?[]:Object.keys(e)}},D={set(e,t,n){e!=null&&(e[t]=n)}}})),Re,ze=e((()=>{b(),Re=class{active(){return y}with(e,t,n,...r){return t.call(n,...r)}bind(e,t){return t}enable(){return this}disable(){return this}}})),O,Be,k,A=e((()=>{ze(),p(),v(),O=`context`,Be=new Re,k=class e{constructor(){}static getInstance(){return this._instance||=new e,this._instance}setGlobalContextManager(e){return c(O,e,_.instance())}active(){return this._getContextManager().active()}with(e,t,n,...r){return this._getContextManager().with(e,t,n,...r)}bind(e,t){return this._getContextManager().bind(e,t)}_getContextManager(){return l(O)||Be}disable(){this._getContextManager().disable(),u(O,_.instance())}}})),j,Ve=e((()=>{(function(e){e[e.NONE=0]=`NONE`,e[e.SAMPLED=1]=`SAMPLED`})(j||={})})),M,N,P,F=e((()=>{Ve(),M=`0000000000000000`,N=`00000000000000000000000000000000`,P={traceId:N,spanId:M,traceFlags:j.NONE}})),I,L=e((()=>{F(),I=class{constructor(e=P){this._spanContext=e}spanContext(){return this._spanContext}setAttribute(e,t){return this}setAttributes(e){return this}addEvent(e,t){return this}addLink(e){return this}addLinks(e){return this}setStatus(e){return this}updateName(e){return this}end(e){}isRecording(){return!1}recordException(e,t){}}}));function R(e){return e.getValue(z)||void 0}function He(){return R(k.getInstance().active())}function Ue(e,t){return e.setValue(z,t)}function We(e){return e.deleteValue(z)}function Ge(e,t){return Ue(e,new I(t))}function Ke(e){return R(e)?.spanContext()}var z,qe=e((()=>{b(),L(),A(),z=me(`OpenTelemetry Context Key SPAN`)}));function Je(e,t){if(typeof e!=`string`||e.length!==t)return!1;let n=0;for(let t=0;t<e.length;t+=4)n+=(V[e.charCodeAt(t)]|0)+(V[e.charCodeAt(t+1)]|0)+(V[e.charCodeAt(t+2)]|0)+(V[e.charCodeAt(t+3)]|0);return n===t}function Ye(e){return Je(e,32)&&e!==`00000000000000000000000000000000`}function Xe(e){return Je(e,16)&&e!==`0000000000000000`}function B(e){return Ye(e.traceId)&&Xe(e.spanId)}function Ze(e){return new I(e)}var V,Qe=e((()=>{F(),L(),V=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1])}));function $e(e){return typeof e==`object`&&!!e&&`spanId`in e&&typeof e.spanId==`string`&&`traceId`in e&&typeof e.traceId==`string`&&`traceFlags`in e&&typeof e.traceFlags==`number`}var H,et,tt=e((()=>{A(),qe(),L(),Qe(),H=k.getInstance(),et=class{startSpan(e,t,n=H.active()){if(t?.root)return new I;let r=n&&Ke(n);return $e(r)&&B(r)?new I(r):new I}startActiveSpan(e,t,n,r){let i,a,o;if(arguments.length<2)return;arguments.length===2?o=t:arguments.length===3?(i=t,o=n):(i=t,a=n,o=r);let s=a??H.active(),c=this.startSpan(e,i,s),l=Ue(s,c);return H.with(l,o,void 0,c)}}})),nt,rt,it=e((()=>{tt(),nt=new et,rt=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}startSpan(e,t,n){return this._getTracer().startSpan(e,t,n)}startActiveSpan(e,t,n,r){let i=this._getTracer();return Reflect.apply(i.startActiveSpan,i,arguments)}_getTracer(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):nt}}})),at,ot=e((()=>{tt(),at=class{getTracer(e,t,n){return new et}}})),st,U,ct=e((()=>{it(),ot(),st=new at,U=class{getTracer(e,t,n){return this.getDelegateTracer(e,t,n)??new rt(this,e,t,n)}getDelegate(){return this._delegate??st}setDelegate(e){this._delegate=e}getDelegateTracer(e,t,n){return this._delegate?.getTracer(e,t,n)}}})),lt,ut=e((()=>{(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(lt||={})})),dt,ft=e((()=>{(function(e){e[e.INTERNAL=0]=`INTERNAL`,e[e.SERVER=1]=`SERVER`,e[e.CLIENT=2]=`CLIENT`,e[e.PRODUCER=3]=`PRODUCER`,e[e.CONSUMER=4]=`CONSUMER`})(dt||={})})),pt,mt=e((()=>{(function(e){e[e.UNSET=0]=`UNSET`,e[e.OK=1]=`OK`,e[e.ERROR=2]=`ERROR`})(pt||={})}));function ht(e){return yt.test(e)}function gt(e){return bt.test(e)&&!xt.test(e)}var W,_t,vt,yt,bt,xt,St=e((()=>{W=`[_0-9a-z-*/]`,_t=`[a-z]${W}{0,255}`,vt=`[a-z0-9]${W}{0,240}@[a-z]${W}{0,13}`,yt=RegExp(`^(?:${_t}|${vt})$`),bt=/^[ -~]{0,255}[!-~]$/,xt=/,|=/})),Ct,wt,Tt,Et,Dt,Ot=e((()=>{St(),Ct=32,wt=512,Tt=`,`,Et=`=`,Dt=class e{constructor(e){this._internalState=new Map,e&&this._parse(e)}set(e,t){let n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,t),n}unset(e){let t=this._clone();return t._internalState.delete(e),t}get(e){return this._internalState.get(e)}serialize(){return Array.from(this._internalState.keys()).reduceRight((e,t)=>(e.push(t+Et+this.get(t)),e),[]).join(Tt)}_parse(e){e.length>wt||(this._internalState=e.split(Tt).reduceRight((e,t)=>{let n=t.trim(),r=n.indexOf(Et);if(r!==-1){let i=n.slice(0,r),a=n.slice(r+1,t.length);ht(i)&>(a)&&e.set(i,a)}return e},new Map),this._internalState.size>Ct&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,Ct))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let t=new e;return t._internalState=new Map(this._internalState),t}}}));function kt(e){return new Dt(e)}var At=e((()=>{Ot()})),G,jt=e((()=>{A(),G=k.getInstance()})),K,Mt=e((()=>{v(),K=_.instance()})),Nt,Pt,Ft=e((()=>{Pe(),Nt=class{getMeter(e,t,n){return T}},Pt=new Nt})),q,It,Lt=e((()=>{Ft(),p(),v(),q=`metrics`,It=class e{constructor(){}static getInstance(){return this._instance||=new e,this._instance}setGlobalMeterProvider(e){return c(q,e,_.instance())}getMeterProvider(){return l(q)||Pt}getMeter(e,t,n){return this.getMeterProvider().getMeter(e,t,n)}disable(){u(q,_.instance())}}})),J,Rt=e((()=>{Lt(),J=It.getInstance()})),zt,Bt=e((()=>{zt=class{inject(e,t){}extract(e,t){return e}fields(){return[]}}}));function Vt(e){return e.getValue(Y)||void 0}function Ht(){return Vt(k.getInstance().active())}function Ut(e,t){return e.setValue(Y,t)}function Wt(e){return e.deleteValue(Y)}var Y,Gt=e((()=>{A(),b(),Y=me(`OpenTelemetry Baggage Key`)})),X,Kt,qt,Jt=e((()=>{p(),Bt(),Le(),Gt(),pe(),v(),X=`propagation`,Kt=new zt,qt=class e{constructor(){this.createBaggage=ue,this.getBaggage=Vt,this.getActiveBaggage=Ht,this.setBaggage=Ut,this.deleteBaggage=Wt}static getInstance(){return this._instance||=new e,this._instance}setGlobalPropagator(e){return c(X,e,_.instance())}inject(e,t,n=D){return this._getGlobalPropagator().inject(e,t,n)}extract(e,t,n=E){return this._getGlobalPropagator().extract(e,t,n)}fields(){return this._getGlobalPropagator().fields()}disable(){u(X,_.instance())}_getGlobalPropagator(){return l(X)||Kt}}})),Z,Yt=e((()=>{Jt(),Z=qt.getInstance()})),Q,Xt,Zt=e((()=>{p(),ct(),Qe(),qe(),v(),Q=`trace`,Xt=class e{constructor(){this._proxyTracerProvider=new U,this.wrapSpanContext=Ze,this.isSpanContextValid=B,this.deleteSpan=We,this.getSpan=R,this.getActiveSpan=He,this.getSpanContext=Ke,this.setSpan=Ue,this.setSpanContext=Ge}static getInstance(){return this._instance||=new e,this._instance}setGlobalTracerProvider(e){let t=c(Q,this._proxyTracerProvider,_.instance());return t&&this._proxyTracerProvider.setDelegate(e),t}getTracerProvider(){return l(Q)||this._proxyTracerProvider}getTracer(e,t){return this.getTracerProvider().getTracer(e,t)}disable(){u(Q,_.instance()),this._proxyTracerProvider=new U}}})),$,Qt=e((()=>{Zt(),$=Xt.getInstance()})),$t=t({DiagConsoleLogger:()=>ge,DiagLogLevel:()=>h,INVALID_SPANID:()=>M,INVALID_SPAN_CONTEXT:()=>P,INVALID_TRACEID:()=>N,ProxyTracer:()=>rt,ProxyTracerProvider:()=>U,ROOT_CONTEXT:()=>y,SamplingDecision:()=>lt,SpanKind:()=>dt,SpanStatusCode:()=>pt,TraceFlags:()=>j,ValueType:()=>Fe,baggageEntryMetadataFromString:()=>de,context:()=>G,createContextKey:()=>me,createNoopMeter:()=>ve,createTraceState:()=>kt,default:()=>en,defaultTextMapGetter:()=>E,defaultTextMapSetter:()=>D,diag:()=>K,isSpanContextValid:()=>B,isValidSpanId:()=>Xe,isValidTraceId:()=>Ye,metrics:()=>J,propagation:()=>Z,trace:()=>$}),en,tn=e((()=>{pe(),b(),_e(),g(),Pe(),Ie(),Le(),it(),ct(),ut(),ft(),mt(),Ve(),At(),Qe(),F(),jt(),Mt(),Rt(),Yt(),Qt(),en={context:G,diag:K,metrics:J,propagation:Z,trace:$}}));export{J as a,pt as c,Z as i,dt as l,tn as n,K as o,$ as r,G as s,$t as t};
|
|
2
|
-
//# sourceMappingURL=esm-
|
|
2
|
+
//# sourceMappingURL=esm-DcyORBXm.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{i as e,t}from"./chunk-FK9Q3tQk.mjs";var n=t((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.execAsync=void 0;let n=e(`child_process`);t.execAsync=e(`util`).promisify(n.exec)}));export{n as t};
|
|
2
|
-
//# sourceMappingURL=execAsync-
|
|
2
|
+
//# sourceMappingURL=execAsync-CUVyYd50.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{i as e,t}from"./chunk-FK9Q3tQk.mjs";var n=t((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.execAsync=void 0;let n=e(`child_process`);t.execAsync=e(`util`).promisify(n.exec)}));export{n as t};
|
|
2
|
-
//# sourceMappingURL=execAsync-
|
|
2
|
+
//# sourceMappingURL=execAsync-DXwNXlSG.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{i as e,t}from"./chunk-FK9Q3tQk.mjs";var n=t((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.execAsync=void 0;let n=e(`child_process`);t.execAsync=e(`util`).promisify(n.exec)}));export{n as t};
|
|
2
|
-
//# sourceMappingURL=execAsync-
|
|
2
|
+
//# sourceMappingURL=execAsync-r1zz6x3t.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,i as t,t as n}from"./chunk-FK9Q3tQk.mjs";import{n as r,t as i}from"./esm-
|
|
2
|
-
//# sourceMappingURL=getMachineId-bsd-
|
|
1
|
+
import{a as e,i as t,t as n}from"./chunk-FK9Q3tQk.mjs";import{n as r,t as i}from"./esm-DcyORBXm.mjs";import{t as a}from"./execAsync-r1zz6x3t.mjs";var o=n((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.getMachineId=void 0;let o=t(`fs`),s=a(),c=(r(),e(i));async function l(){try{return(await o.promises.readFile(`/etc/hostid`,{encoding:`utf8`})).trim()}catch(e){c.diag.debug(`error reading machine id: ${e}`)}try{return(await(0,s.execAsync)(`kenv -q smbios.system.uuid`)).stdout.trim()}catch(e){c.diag.debug(`error reading machine id: ${e}`)}}n.getMachineId=l}));export default o();export{};
|
|
2
|
+
//# sourceMappingURL=getMachineId-bsd-BrpAo1fJ.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,i as t,t as n}from"./chunk-FK9Q3tQk.mjs";import{n as r,t as i}from"./esm-
|
|
2
|
-
//# sourceMappingURL=getMachineId-bsd-
|
|
1
|
+
import{a as e,i as t,t as n}from"./chunk-FK9Q3tQk.mjs";import{n as r,t as i}from"./esm-DcyORBXm.mjs";import{t as a}from"./execAsync-DXwNXlSG.mjs";var o=n((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.getMachineId=void 0;let o=t(`fs`),s=a(),c=(r(),e(i));async function l(){try{return(await o.promises.readFile(`/etc/hostid`,{encoding:`utf8`})).trim()}catch(e){c.diag.debug(`error reading machine id: ${e}`)}try{return(await(0,s.execAsync)(`kenv -q smbios.system.uuid`)).stdout.trim()}catch(e){c.diag.debug(`error reading machine id: ${e}`)}}n.getMachineId=l}));export default o();export{};
|
|
2
|
+
//# sourceMappingURL=getMachineId-bsd-DZHdCHYD.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,i as t,t as n}from"./chunk-FK9Q3tQk.mjs";import{n as r,t as i}from"./esm-
|
|
2
|
-
//# sourceMappingURL=getMachineId-bsd-
|
|
1
|
+
import{a as e,i as t,t as n}from"./chunk-FK9Q3tQk.mjs";import{n as r,t as i}from"./esm-DcyORBXm.mjs";import{t as a}from"./execAsync-CUVyYd50.mjs";var o=n((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.getMachineId=void 0;let o=t(`fs`),s=a(),c=(r(),e(i));async function l(){try{return(await o.promises.readFile(`/etc/hostid`,{encoding:`utf8`})).trim()}catch(e){c.diag.debug(`error reading machine id: ${e}`)}try{return(await(0,s.execAsync)(`kenv -q smbios.system.uuid`)).stdout.trim()}catch(e){c.diag.debug(`error reading machine id: ${e}`)}}n.getMachineId=l}));export default o();export{};
|
|
2
|
+
//# sourceMappingURL=getMachineId-bsd-o7HphUWK.mjs.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as e,t}from"./chunk-FK9Q3tQk.mjs";import{n,t as r}from"./esm-
|
|
1
|
+
import{a as e,t}from"./chunk-FK9Q3tQk.mjs";import{n,t as r}from"./esm-DcyORBXm.mjs";import{t as i}from"./execAsync-DXwNXlSG.mjs";var a=t((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.getMachineId=void 0;let a=i(),o=(n(),e(r));async function s(){try{let e=(await(0,a.execAsync)(`ioreg -rd1 -c "IOPlatformExpertDevice"`)).stdout.split(`
|
|
2
2
|
`).find(e=>e.includes(`IOPlatformUUID`));if(!e)return;let t=e.split(`" = "`);if(t.length===2)return t[1].slice(0,-1)}catch(e){o.diag.debug(`error reading machine id: ${e}`)}}t.getMachineId=s}));export default a();export{};
|
|
3
|
-
//# sourceMappingURL=getMachineId-darwin-
|
|
3
|
+
//# sourceMappingURL=getMachineId-darwin-3D3eRDVl.mjs.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as e,t}from"./chunk-FK9Q3tQk.mjs";import{n,t as r}from"./esm-
|
|
1
|
+
import{a as e,t}from"./chunk-FK9Q3tQk.mjs";import{n,t as r}from"./esm-DcyORBXm.mjs";import{t as i}from"./execAsync-r1zz6x3t.mjs";var a=t((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.getMachineId=void 0;let a=i(),o=(n(),e(r));async function s(){try{let e=(await(0,a.execAsync)(`ioreg -rd1 -c "IOPlatformExpertDevice"`)).stdout.split(`
|
|
2
2
|
`).find(e=>e.includes(`IOPlatformUUID`));if(!e)return;let t=e.split(`" = "`);if(t.length===2)return t[1].slice(0,-1)}catch(e){o.diag.debug(`error reading machine id: ${e}`)}}t.getMachineId=s}));export default a();export{};
|
|
3
|
-
//# sourceMappingURL=getMachineId-darwin-
|
|
3
|
+
//# sourceMappingURL=getMachineId-darwin-CsteOFjK.mjs.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as e,t}from"./chunk-FK9Q3tQk.mjs";import{n,t as r}from"./esm-
|
|
1
|
+
import{a as e,t}from"./chunk-FK9Q3tQk.mjs";import{n,t as r}from"./esm-DcyORBXm.mjs";import{t as i}from"./execAsync-CUVyYd50.mjs";var a=t((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.getMachineId=void 0;let a=i(),o=(n(),e(r));async function s(){try{let e=(await(0,a.execAsync)(`ioreg -rd1 -c "IOPlatformExpertDevice"`)).stdout.split(`
|
|
2
2
|
`).find(e=>e.includes(`IOPlatformUUID`));if(!e)return;let t=e.split(`" = "`);if(t.length===2)return t[1].slice(0,-1)}catch(e){o.diag.debug(`error reading machine id: ${e}`)}}t.getMachineId=s}));export default a();export{};
|
|
3
|
-
//# sourceMappingURL=getMachineId-darwin-
|
|
3
|
+
//# sourceMappingURL=getMachineId-darwin-D-BjJUXV.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,i as t,t as n}from"./chunk-FK9Q3tQk.mjs";import{n as r,t as i}from"./esm-
|
|
2
|
-
//# sourceMappingURL=getMachineId-linux-
|
|
1
|
+
import{a as e,i as t,t as n}from"./chunk-FK9Q3tQk.mjs";import{n as r,t as i}from"./esm-DcyORBXm.mjs";var a=n((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.getMachineId=void 0;let a=t(`fs`),o=(r(),e(i));async function s(){for(let e of[`/etc/machine-id`,`/var/lib/dbus/machine-id`])try{return(await a.promises.readFile(e,{encoding:`utf8`})).trim()}catch(e){o.diag.debug(`error reading machine id: ${e}`)}}n.getMachineId=s}));export default a();export{};
|
|
2
|
+
//# sourceMappingURL=getMachineId-linux-BELE5feP.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,i as t,t as n}from"./chunk-FK9Q3tQk.mjs";import{n as r,t as i}from"./esm-
|
|
2
|
-
//# sourceMappingURL=getMachineId-linux-
|
|
1
|
+
import{a as e,i as t,t as n}from"./chunk-FK9Q3tQk.mjs";import{n as r,t as i}from"./esm-DcyORBXm.mjs";var a=n((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.getMachineId=void 0;let a=t(`fs`),o=(r(),e(i));async function s(){for(let e of[`/etc/machine-id`,`/var/lib/dbus/machine-id`])try{return(await a.promises.readFile(e,{encoding:`utf8`})).trim()}catch(e){o.diag.debug(`error reading machine id: ${e}`)}}n.getMachineId=s}));export default a();export{};
|
|
2
|
+
//# sourceMappingURL=getMachineId-linux-C-EpqTRh.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,i as t,t as n}from"./chunk-FK9Q3tQk.mjs";import{n as r,t as i}from"./esm-
|
|
2
|
-
//# sourceMappingURL=getMachineId-linux-
|
|
1
|
+
import{a as e,i as t,t as n}from"./chunk-FK9Q3tQk.mjs";import{n as r,t as i}from"./esm-DcyORBXm.mjs";var a=n((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.getMachineId=void 0;let a=t(`fs`),o=(r(),e(i));async function s(){for(let e of[`/etc/machine-id`,`/var/lib/dbus/machine-id`])try{return(await a.promises.readFile(e,{encoding:`utf8`})).trim()}catch(e){o.diag.debug(`error reading machine id: ${e}`)}}n.getMachineId=s}));export default a();export{};
|
|
2
|
+
//# sourceMappingURL=getMachineId-linux-CceeieLZ.mjs.map
|
package/dist/{getMachineId-unsupported-gFGrtRr7.mjs → getMachineId-unsupported-C9qPEPHy.mjs}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,t}from"./chunk-FK9Q3tQk.mjs";import{n,t as r}from"./esm-
|
|
2
|
-
//# sourceMappingURL=getMachineId-unsupported-
|
|
1
|
+
import{a as e,t}from"./chunk-FK9Q3tQk.mjs";import{n,t as r}from"./esm-DcyORBXm.mjs";var i=t((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.getMachineId=void 0;let i=(n(),e(r));async function a(){i.diag.debug(`could not read machine-id: unsupported platform`)}t.getMachineId=a}));export default i();export{};
|
|
2
|
+
//# sourceMappingURL=getMachineId-unsupported-C9qPEPHy.mjs.map
|
package/dist/{getMachineId-unsupported-j-7WDfTT.mjs → getMachineId-unsupported-CUPNvbj5.mjs}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,t}from"./chunk-FK9Q3tQk.mjs";import{n,t as r}from"./esm-
|
|
2
|
-
//# sourceMappingURL=getMachineId-unsupported-
|
|
1
|
+
import{a as e,t}from"./chunk-FK9Q3tQk.mjs";import{n,t as r}from"./esm-DcyORBXm.mjs";var i=t((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.getMachineId=void 0;let i=(n(),e(r));async function a(){i.diag.debug(`could not read machine-id: unsupported platform`)}t.getMachineId=a}));export default i();export{};
|
|
2
|
+
//# sourceMappingURL=getMachineId-unsupported-CUPNvbj5.mjs.map
|
package/dist/{getMachineId-unsupported-BrxgPAkN.mjs → getMachineId-unsupported-CrmDv6SC.mjs}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,t}from"./chunk-FK9Q3tQk.mjs";import{n,t as r}from"./esm-
|
|
2
|
-
//# sourceMappingURL=getMachineId-unsupported-
|
|
1
|
+
import{a as e,t}from"./chunk-FK9Q3tQk.mjs";import{n,t as r}from"./esm-DcyORBXm.mjs";var i=t((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.getMachineId=void 0;let i=(n(),e(r));async function a(){i.diag.debug(`could not read machine-id: unsupported platform`)}t.getMachineId=a}));export default i();export{};
|
|
2
|
+
//# sourceMappingURL=getMachineId-unsupported-CrmDv6SC.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,i as t,t as n}from"./chunk-FK9Q3tQk.mjs";import{n as r,t as i}from"./esm-
|
|
2
|
-
//# sourceMappingURL=getMachineId-win-
|
|
1
|
+
import{a as e,i as t,t as n}from"./chunk-FK9Q3tQk.mjs";import{n as r,t as i}from"./esm-DcyORBXm.mjs";import{t as a}from"./execAsync-r1zz6x3t.mjs";var o=n((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.getMachineId=void 0;let o=t(`process`),s=a(),c=(r(),e(i));async function l(){let e=`%windir%\\System32\\REG.exe`;o.arch===`ia32`&&`PROCESSOR_ARCHITEW6432`in o.env&&(e=`%windir%\\sysnative\\cmd.exe /c `+e);try{let t=(await(0,s.execAsync)(`${e} QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid`)).stdout.split(`REG_SZ`);if(t.length===2)return t[1].trim()}catch(e){c.diag.debug(`error reading machine id: ${e}`)}}n.getMachineId=l}));export default o();export{};
|
|
2
|
+
//# sourceMappingURL=getMachineId-win-AH3HxM3-.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,i as t,t as n}from"./chunk-FK9Q3tQk.mjs";import{n as r,t as i}from"./esm-
|
|
2
|
-
//# sourceMappingURL=getMachineId-win-
|
|
1
|
+
import{a as e,i as t,t as n}from"./chunk-FK9Q3tQk.mjs";import{n as r,t as i}from"./esm-DcyORBXm.mjs";import{t as a}from"./execAsync-DXwNXlSG.mjs";var o=n((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.getMachineId=void 0;let o=t(`process`),s=a(),c=(r(),e(i));async function l(){let e=`%windir%\\System32\\REG.exe`;o.arch===`ia32`&&`PROCESSOR_ARCHITEW6432`in o.env&&(e=`%windir%\\sysnative\\cmd.exe /c `+e);try{let t=(await(0,s.execAsync)(`${e} QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid`)).stdout.split(`REG_SZ`);if(t.length===2)return t[1].trim()}catch(e){c.diag.debug(`error reading machine id: ${e}`)}}n.getMachineId=l}));export default o();export{};
|
|
2
|
+
//# sourceMappingURL=getMachineId-win-BHtOEO59.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,i as t,t as n}from"./chunk-FK9Q3tQk.mjs";import{n as r,t as i}from"./esm-
|
|
2
|
-
//# sourceMappingURL=getMachineId-win-
|
|
1
|
+
import{a as e,i as t,t as n}from"./chunk-FK9Q3tQk.mjs";import{n as r,t as i}from"./esm-DcyORBXm.mjs";import{t as a}from"./execAsync-CUVyYd50.mjs";var o=n((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.getMachineId=void 0;let o=t(`process`),s=a(),c=(r(),e(i));async function l(){let e=`%windir%\\System32\\REG.exe`;o.arch===`ia32`&&`PROCESSOR_ARCHITEW6432`in o.env&&(e=`%windir%\\sysnative\\cmd.exe /c `+e);try{let t=(await(0,s.execAsync)(`${e} QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid`)).stdout.split(`REG_SZ`);if(t.length===2)return t[1].trim()}catch(e){c.diag.debug(`error reading machine id: ${e}`)}}n.getMachineId=l}));export default o();export{};
|
|
2
|
+
//# sourceMappingURL=getMachineId-win-CFHq48vo.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./git-handle-BhGnmvTB-DnqwJBAv.mjs";export{e as n};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{t as e}from"./rolldown-runtime-wcPFST8Q-DriDJLQM.mjs";import{resolve as t}from"node:path";import n from"simple-git";const r=new class{_tail=Promise.resolve();enqueue(e){let t=this._tail.then(()=>e());return this._tail=t.catch(()=>void 0),t}};function i(e){return r.enqueue(e)}var a=e({createGitInstance:()=>o});function o(e,r={}){let{credentialArgs:i=[],gitIndexFile:a}=r,o={};return a&&(o.GIT_INDEX_FILE=t(e,a)),{git:n({baseDir:e,config:i.length>=2?[i[1]]:[],unsafe:{allowUnsafeCredentialHelper:!0}}).env(o),projectDir:e,credentialArgs:i}}export{a as n,i as r,o as t};
|
|
2
|
+
//# sourceMappingURL=git-handle-BhGnmvTB-DnqwJBAv.mjs.map
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e,i as t,l as n,o as r,s as i,t as a}from"./init-
|
|
1
|
+
import{c as e,i as t,l as n,o as r,s as i,t as a}from"./init-NMjOmrTP.mjs";import{n as o,r as s}from"./loader-DkbY6ZLN.mjs";import"./src-D7CWqlQk.mjs";export{e as ALL_EDITOR_IDS,s as ConfigSchema,n as EDITOR_TARGETS,a as detectInstalledEditors,o as loadConfig,t as readExistingMcpEntry,r as writeEditorMcpConfig,i as writeUserMcpConfigs};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./init-Itm712r0.mjs";export{t as ensureOkGitignoredAtRoot,e as initContent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,i as t,n,o as r,r as i,s as a,t as o}from"./init-NMjOmrTP.mjs";export{o as detectInstalledEditors,n as formatInitResult,i as initCommand,t as readExistingMcpEntry,e as runInit,r as writeEditorMcpConfig,a as writeUserMcpConfigs};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e,t}from"./constants-
|
|
1
|
+
import{n as e,t}from"./constants-BQaeExTr.mjs";import{o as n}from"./dist-h83E8Lop.mjs";import{existsSync as r,mkdirSync as i,readFileSync as a,writeFileSync as o}from"node:fs";import{join as s,resolve as c}from"node:path";const l=`# Open Knowledge — workspace configuration
|
|
2
2
|
#
|
|
3
3
|
# This file overrides built-in defaults for this workspace. Every key below
|
|
4
4
|
# is commented out and shows its current default value. Uncomment any key
|
|
@@ -117,4 +117,4 @@ import{n as e,t}from"./constants-Bp2eH26E.mjs";import{O as n}from"./src-CB-sXsMW
|
|
|
117
117
|
|
|
118
118
|
`)?`
|
|
119
119
|
`:``}${i}`,`utf-8`),`appended`)}const f=[{name:`.gitignore`,content:`${t}/\nserver.lock\nui.lock\nsync-state.json\n`},{name:e,content:l}];function p(e){let r=c(e,n),a=[],o=[];i(r,{recursive:!0}),i(s(r,t),{recursive:!0});for(let e of f)u(s(r,e.name),e.content)?a.push(e.name):o.push(e.name);return{created:a,skipped:o}}export{p as n,d as t};
|
|
120
|
-
//# sourceMappingURL=init-
|
|
120
|
+
//# sourceMappingURL=init-Itm712r0.mjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{r as e}from"./constants-
|
|
2
|
-
`)?n:`${n}\n`,`utf-8`)}const K=`0.0.1`,q=`open-knowledge-ui`;function J(e,t={}){let n=y(e,`.claude`,`launch.json`),r=t.mode===`dev`?{name:q,runtimeExecutable:`node`,runtimeArgs:[E(t.cliEntryPath),`ui`],port:3e3}:{name:q,runtimeExecutable:`npx`,runtimeArgs:[`@inkeep/open-knowledge`,`ui`],port:3e3};try{if(!f(n))return p(v(n),{recursive:!0}),h(n,`${JSON.stringify({version:K,configurations:[r]},null,2)}\n`,`utf-8`),{action:`created`,configPath:n};let e=m(n,`utf-8`).trim(),t=e?JSON.parse(e):{};if(!u(t))return{action:`failed`,configPath:n,error:`launch.json root is not an object`};let i=Array.isArray(t.configurations)?t.configurations:[],a=i.findIndex(e=>u(e)&&e.name===q);a>=0?i[a]=r:i.push(r);let o={...t,version:t.version??K,configurations:i};return h(n,`${JSON.stringify(o,null,2)}\n`,`utf-8`),{action:a>=0?`merged`:`created`,configPath:n}}catch(e){return{action:`failed`,configPath:n,error:e instanceof Error?e.message:String(e)}}}function Y(e,t,n){try{return f(e.detectPath?.(t,n)??v(e.configPath(t,n)))}catch{return!1}}function X(e,t,n,r){let i=e.serverName(t),a;try{a=e.configPath(t,r)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:``,serverName:i,error:t instanceof Error?t.message:String(t)}}if(!n.skipAvailabilityCheck&&!Y(e,t,r))return{editorId:e.id,label:e.label,action:`skipped-missing`,configPath:a,serverName:i};let o;try{o=e.format===`toml`?U(a):H(a)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:a,serverName:i,error:t instanceof Error?t.message:String(t)}}let s=o[e.topLevelKey]??{},c=s[i],l;try{l=e.buildEntry(t,n)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:a,serverName:i,error:t instanceof Error?t.message:String(t)}}let u={...o,[e.topLevelKey]:{...s,[i]:l}};try{e.format===`toml`?G(a,u):W(a,u)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:a,serverName:i,error:t instanceof Error?t.message:String(t)}}return{editorId:e.id,label:e.label,action:c===void 0?`written`:`overwritten`,configPath:a,serverName:i}}function ae(e,t){let n=e.legacyProjectConfigPath?.(t);if(!(!n||!f(n)))return{editorId:e.id,label:e.label,path:n}}async function oe(e){let t=V(e.editors),n={mode:`published`,cliPath:e.cliPath,skipAvailabilityCheck:!0};return t.map(t=>X(t,``,n,e.home))}function se(e,t,n){let r;try{r=e.configPath(t,n)}catch{return null}let i;try{i=e.format===`toml`?U(r):H(r)}catch{return null}let a=i[e.topLevelKey];if(!u(a))return null;let o=a[e.serverName(t)];return u(o)?o:null}async function Z(e={}){let t=S(e.cwd??process.cwd()),
|
|
3
|
-
`)}function $(e,t){let n=[];for(let r of T)Y(B[r],e,t)&&n.push(r);return n}function ce(){return new d(`init`).description(`Scaffold ${t}/ in the current directory and register the MCP server for your editor(s)`).option(`--mcp`,`Register the MCP server for selected editors (default: true)`,!0).option(`--no-mcp`,`Scaffold the ${t}/ directory but do not touch MCP config`).option(`--dev-mcp`,`Register a local dev MCP entry using node + packages/cli/dist/cli.mjs with debug logging`).action(async e=>{let t=process.cwd(),n;try{n=await Z({cwd:t,mcp:e.mcp,devMcp:e.devMcp})}catch(e){if(e instanceof
|
|
4
|
-
`),e.stderr&&process.stderr.write(`${e.stderr.trim()}\n`),process.exitCode=1;return}throw e}try{let{previewContent:e}=await import(`./preview-
|
|
5
|
-
//# sourceMappingURL=init-
|
|
1
|
+
import{r as e}from"./constants-BQaeExTr.mjs";import{o as t}from"./dist-h83E8Lop.mjs";import{U as n,W as r,h as i,nt as a}from"./dist-wAieHPG9.mjs";import{n as o}from"./init-Itm712r0.mjs";import{t as s}from"./preview-RWJaR_PK.mjs";import{s as c,t as l}from"./colors-Jf5QUiX2.mjs";import{t as u}from"./is-object-CEU0BgQ5.mjs";import{Command as d}from"commander";import{existsSync as f,mkdirSync as p,readFileSync as m,writeFileSync as h}from"node:fs";import{homedir as g}from"node:os";import{basename as _,dirname as v,join as y,posix as b,relative as x,resolve as S,sep as C,win32 as w}from"node:path";import{parse as ee,stringify as te}from"smol-toml";const T=[`claude`,`claude-desktop`,`cursor`,`vscode`,`windsurf`,`codex`],ne=[`@inkeep/open-knowledge`,`mcp`],re={MCP_DEBUG:`1`,OK_LOG_FILE:`/tmp/ok-mcp.log`};function E(e=process.argv[1]){if(!e)throw Error(`Cannot infer the local CLI entry for --dev-mcp because process.argv[1] is empty.`);let t=S(e);if(_(t)===`cli.mjs`&&_(v(t))===`dist`)return t;let n=t.split(C),r=n.lastIndexOf(`packages`);if(r===-1||n[r+1]!==`cli`)throw Error(`Cannot infer the repo root for --dev-mcp from ${t}. Run the local CLI from this repo so the built dist path can be derived.`);let i=n.slice(0,r);return y(i.length===0?C:i.join(C),`packages`,`cli`,`dist`,`cli.mjs`)}function D(e={}){return e.cliPath?{command:e.cliPath,args:[`mcp`]}:e.mode===`dev`?{command:`node`,args:[E(e.cliEntryPath),`mcp`],env:{...re}}:{command:`npx`,args:[...ne]}}function O(e){return e===`win32`?w:b}function k(e={}){let t=e.platformName??process.platform,n=e.home??g(),r=e.env??process.env,i=O(t);return t===`darwin`?i.join(n,`Library`,`Application Support`):t===`win32`?r.APPDATA??i.join(n,`AppData`,`Roaming`):r.XDG_CONFIG_HOME??i.join(n,`.config`)}function A(e={}){let t=e.platformName??process.platform,n=e.home??g();return O(t).join(n,`.claude.json`)}function j(e={}){let t=e.platformName??process.platform,n=e.home??g(),r=e.env??process.env;if(t===`darwin`)return b.join(n,`Library`,`Application Support`,`Claude`,`claude_desktop_config.json`);if(t===`win32`){let e=r.APPDATA??w.join(n,`AppData`,`Roaming`);return w.join(e,`Claude`,`claude_desktop_config.json`)}throw Error(`Claude Desktop is not available on ${t}. Supported: macOS, Windows.`)}function M(e={}){let t=e.platformName??process.platform,n=e.home??g();return O(t).join(n,`.cursor`,`mcp.json`)}function N(e={}){return O(e.platformName??process.platform).join(k(e),`Code`,`User`,`mcp.json`)}function P(e={}){let t=e.platformName??process.platform,n=e.home??g();return O(t).join(n,`.codeium`,`windsurf`,`mcp_config.json`)}function F(e={}){let t=e.platformName??process.platform,n=e.home??g();return(e.env??process.env).CODEX_HOME??O(t).join(n,`.codex`)}function I(e={}){return O(e.platformName??process.platform).join(F(e),`config.toml`)}function L(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((e,n)=>L(e,t[n]));if(u(e)&&u(t)){let n=Object.keys(e).sort(),r=Object.keys(t).sort();return n.length===r.length&&n.every((e,t)=>e===r[t])&&n.every(n=>L(e[n],t[n]))}return!1}function R(e,t){return Object.entries(t).every(([t,n])=>L(e[t],n))}function ie(e,t){return{...e,...t}}function z(e){return{...e,isCompatible(t,n,r){return R(t,e.buildEntry(n,r))},mergeManagedFields(t,n,r){return ie(t,e.buildEntry(n,r))}}}const B={claude:z({id:`claude`,label:`Claude Code`,configPath:(e,t)=>A({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>e,buildEntry:(e,t)=>D(t),scope:`global`,detectPath:(e,t)=>y(t??g(),`.claude`),legacyProjectConfigPath:e=>y(e,`.mcp.json`)}),"claude-desktop":z({id:`claude-desktop`,label:`Claude Desktop`,configPath:(e,t)=>j({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>e,buildEntry:(e,t)=>D(t),scope:`global`,detectPath:(e,t)=>v(j({home:t}))}),cursor:z({id:`cursor`,label:`Cursor`,configPath:(e,t)=>M({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>e,buildEntry:(e,t)=>D(t),scope:`global`,detectPath:(e,t)=>v(M({home:t})),legacyProjectConfigPath:e=>y(e,`.cursor`,`mcp.json`)}),vscode:z({id:`vscode`,label:`VS Code`,configPath:(e,t)=>N({home:t}),format:`json`,topLevelKey:`servers`,serverName:()=>e,buildEntry:(e,t)=>({type:`stdio`,...D(t)}),scope:`global`,detectPath:(e,t)=>v(N({home:t})),legacyProjectConfigPath:e=>y(e,`.vscode`,`mcp.json`)}),windsurf:z({id:`windsurf`,label:`Windsurf`,configPath:(e,t)=>P({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>e,buildEntry:(e,t)=>D(t),scope:`global`,detectPath:(e,t)=>v(P({home:t}))}),codex:z({id:`codex`,label:`Codex`,configPath:(e,t)=>I({home:t}),format:`toml`,topLevelKey:`mcp_servers`,serverName:()=>e,buildEntry:(e,t)=>D(t),scope:`global`,detectPath:(e,t)=>v(I({home:t})),legacyProjectConfigPath:e=>y(e,`.codex`,`config.toml`)})};function V(e){let t=e.filter(e=>!(e in B));if(t.length>0)throw Error(`Unknown editor(s): ${t.join(`, `)}. Valid options: ${T.join(`, `)}`);return e.map(e=>B[e])}function H(e){if(!f(e))return{};let t=m(e,`utf-8`).trim();if(t===``)return{};try{let n=JSON.parse(t);if(u(n))return n;throw Error(`${e} root must be a JSON object`)}catch(t){throw t instanceof SyntaxError?Error(`${e} contains invalid JSON: ${t.message}`):t}}function U(e){if(!f(e))return{};let t=m(e,`utf-8`).trim();if(t===``)return{};try{let n=ee(t);if(u(n))return n;throw Error(`${e} root must be a TOML table`)}catch(t){throw Error(`${e} contains invalid TOML: ${t instanceof Error?t.message:String(t)}`)}}function W(e,t){p(v(e),{recursive:!0}),h(e,`${JSON.stringify(t,null,2)}\n`,`utf-8`)}function G(e,t){p(v(e),{recursive:!0});let n=te(t);h(e,n.endsWith(`
|
|
2
|
+
`)?n:`${n}\n`,`utf-8`)}const K=`0.0.1`,q=`open-knowledge-ui`;function J(e,t={}){let n=y(e,`.claude`,`launch.json`),r=t.mode===`dev`?{name:q,runtimeExecutable:`node`,runtimeArgs:[E(t.cliEntryPath),`ui`],port:3e3}:{name:q,runtimeExecutable:`npx`,runtimeArgs:[`@inkeep/open-knowledge`,`ui`],port:3e3};try{if(!f(n))return p(v(n),{recursive:!0}),h(n,`${JSON.stringify({version:K,configurations:[r]},null,2)}\n`,`utf-8`),{action:`created`,configPath:n};let e=m(n,`utf-8`).trim(),t=e?JSON.parse(e):{};if(!u(t))return{action:`failed`,configPath:n,error:`launch.json root is not an object`};let i=Array.isArray(t.configurations)?t.configurations:[],a=i.findIndex(e=>u(e)&&e.name===q);a>=0?i[a]=r:i.push(r);let o={...t,version:t.version??K,configurations:i};return h(n,`${JSON.stringify(o,null,2)}\n`,`utf-8`),{action:a>=0?`merged`:`created`,configPath:n}}catch(e){return{action:`failed`,configPath:n,error:e instanceof Error?e.message:String(e)}}}function Y(e,t,n){try{return f(e.detectPath?.(t,n)??v(e.configPath(t,n)))}catch{return!1}}function X(e,t,n,r){let i=e.serverName(t),a;try{a=e.configPath(t,r)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:``,serverName:i,error:t instanceof Error?t.message:String(t)}}if(!n.skipAvailabilityCheck&&!Y(e,t,r))return{editorId:e.id,label:e.label,action:`skipped-missing`,configPath:a,serverName:i};let o;try{o=e.format===`toml`?U(a):H(a)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:a,serverName:i,error:t instanceof Error?t.message:String(t)}}let s=o[e.topLevelKey]??{},c=s[i],l;try{l=e.buildEntry(t,n)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:a,serverName:i,error:t instanceof Error?t.message:String(t)}}let u={...o,[e.topLevelKey]:{...s,[i]:l}};try{e.format===`toml`?G(a,u):W(a,u)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:a,serverName:i,error:t instanceof Error?t.message:String(t)}}return{editorId:e.id,label:e.label,action:c===void 0?`written`:`overwritten`,configPath:a,serverName:i}}function ae(e,t){let n=e.legacyProjectConfigPath?.(t);if(!(!n||!f(n)))return{editorId:e.id,label:e.label,path:n}}async function oe(e){let t=V(e.editors),n={mode:`published`,cliPath:e.cliPath,skipAvailabilityCheck:!0};return t.map(t=>X(t,``,n,e.home))}function se(e,t,n){let r;try{r=e.configPath(t,n)}catch{return null}let i;try{i=e.format===`toml`?U(r):H(r)}catch{return null}let a=i[e.topLevelKey];if(!u(a))return null;let o=a[e.serverName(t)];return u(o)?o:null}async function Z(e={}){let t=S(e.cwd??process.cwd()),i={mode:e.devMcp?`dev`:`published`,cliEntryPath:e.cliEntryPath},s=await r(t),c;try{c=o(t)}catch(n){let r=B.claude.configPath(t,e.home);return{contentCreated:[],contentSkipped:[],editors:[],legacyProjectConfigs:[],didGitInit:s.didInit,claudeDesktopDetected:!1,mcpAction:`failed`,mcpPath:r,mcpError:`Content scaffolding failed: ${n instanceof Error?n.message:String(n)}`}}let l=V(e.editors??$(t,e.home)),u=l.filter(n=>Y(n,t,e.home)),d=[];for(let n of l){if(e.mcp===!1){let r=``;try{r=n.configPath(t,e.home)}catch{}d.push({editorId:n.id,label:n.label,action:`skipped-flag`,configPath:r,serverName:n.serverName(t)});continue}d.push(X(n,t,i,e.home))}let f=e.mcp===!1?[]:u.map(e=>ae(e,t)).filter(e=>e!==void 0),p=u.some(e=>e.id===`claude`)&&e.mcp!==!1?J(t,i):void 0,m=await(e.installUserSkill??a)({home:e.home}),h=n({home:e.home}),g=e.mcp===!1?`skipped-flag`:`skipped-missing`,_=d.find(e=>e.editorId===`claude`)??d[0]??{action:g,configPath:B.claude.configPath(t,e.home)};return{contentCreated:c.created,contentSkipped:c.skipped,editors:d,legacyProjectConfigs:f,launchJson:p,skillInstall:m,didGitInit:s.didInit,claudeDesktopDetected:h,mcpAction:_.action,mcpPath:_.configPath,mcpError:`error`in _?_.error:void 0}}function Q(e,n){let r=[],i=e.editors.some(e=>e.action===`written`||e.action===`overwritten`),a=e.editors.some(e=>e.action===`failed`),o=e.editors.length>0&&e.editors.every(e=>e.action===`skipped-flag`),u=e.editors.length>0&&e.editors.every(e=>e.action===`skipped-missing`),d=e=>{let t=e.configPath.startsWith(n)?x(n,e.configPath):e.configPath;switch(e.action){case`created`:return` app preview server ${t} configured for Claude Code Desktop embedded browser`;case`merged`:return` app preview server ${t} updated for Claude Code Desktop embedded browser`;case`failed`:return` app preview server ${t} FAILED: ${e.error}`}};e.didGitInit&&r.push(`Initialized git repo at ${n}/.git/ (default branch: main)`);let f=y(n,t);if(e.contentCreated.length>0?(r.push(`Content scaffolded at ${f}/`),r.push(` Created: ${e.contentCreated.join(`, `)}`)):r.push(`Content already present at ${f}/`),e.contentSkipped.length>0&&r.push(` Skipped (already exist): ${e.contentSkipped.join(`, `)}`),r.push(``),e.mcpError&&e.editors.length===0)r.push(`Warning: ${e.mcpError}`);else if(e.editors.length===0)r.push(`MCP server configuration:`),r.push(e.mcpAction===`skipped-flag`?` MCP config not written — use without --no-mcp to configure editors`:` No supported editor config directories detected; skipped MCP registration`);else if(o)r.push(`MCP config not written — use without --no-mcp to configure editors`);else if(u)r.push(`MCP server configuration:`),r.push(` No supported editor config directories detected; skipped MCP registration`);else{r.push(`MCP server configuration:`);for(let t of e.editors){let i=t.configPath.startsWith(n)?x(n,t.configPath):t.configPath.replace(/^\/Users\/[^/]+/,`~`),a=t.serverName===`open-knowledge`?``:` (${t.serverName})`,o=` `.repeat(Math.max(1,14-t.label.length)),s=t.editorId===`claude-desktop`&&(t.action===`written`||t.action===`overwritten`)?` — quit and relaunch Claude Desktop to activate`:``;switch(t.action){case`written`:r.push(` ${t.label}${o}${i} registered${a}${s}`);break;case`overwritten`:r.push(` ${t.label}${o}${i} updated${a}${s}`);break;case`skipped-missing`:r.push(` ${t.label}${o}${i} config root missing; skipped`);break;case`failed`:r.push(` ${t.label}${o}${i} FAILED: ${t.error}`);break;case`skipped-flag`:break}t.editorId===`claude`&&e.launchJson&&r.push(d(e.launchJson))}}if(a&&(r.push(``),r.push(`For failed editors, add the MCP server entry manually. See:`),r.push(` https://github.com/inkeep/open-knowledge#mcp-setup`)),e.legacyProjectConfigs.length>0){r.push(``),r.push(`Legacy project MCP configs detected:`);for(let t of e.legacyProjectConfigs)r.push(` ${t.label} ${x(n,t.path)}`);r.push(` These project-local files may override the new global config. Remove them if you want fully user-scoped MCP setup in this project.`)}if(e.skillInstall)switch(r.push(``),r.push(`User-global skill:`),e.skillInstall){case`installed`:r.push(" open-knowledge installed to detected agent hosts via `npx skills`");break;case`skip-current`:r.push(` open-knowledge already installed at current version`);break;case`failed`:r.push(` ${c(`open-knowledge install failed — MCP still configured; run manually:`)}`),r.push(` ${c(` npx skills@~1.5.0 add <bundled-path> --agent '*' -g -y --copy`)}`);break}if(e.claudeDesktopDetected&&(r.push(``),r.push(`Claude Desktop App detected. To enable in Claude Chat & Cowork, run: ${l(`ok install-skill`)}`)),e.preview?(r.push(``),r.push(s(e.preview,n))):e.previewWarning&&(r.push(``),r.push(`Content preview unavailable: ${e.previewWarning}`)),i){let t=e.editors.filter(e=>e.action===`written`||e.action===`overwritten`).map(e=>e.label);r.push(``),r.push(`Next steps:`),r.push(` 1. Open your editor (${t.join(` / `)})`),r.push(` 2. Approve the MCP server when prompted`),r.push(` 3. (Optional) scaffold the starter knowledge-base structure:`),r.push(` - ok seed`),r.push(` 4. Use the three MCP workflow tools as you build the wiki:`),r.push(` - mcp__open-knowledge__ingest — capture an external source`),r.push(` - mcp__open-knowledge__research — gather sources and write findings`),r.push(` - mcp__open-knowledge__consolidate — promote research to canonical articles`)}return r.join(`
|
|
3
|
+
`)}function $(e,t){let n=[];for(let r of T)Y(B[r],e,t)&&n.push(r);return n}function ce(){return new d(`init`).description(`Scaffold ${t}/ in the current directory and register the MCP server for your editor(s)`).option(`--mcp`,`Register the MCP server for selected editors (default: true)`,!0).option(`--no-mcp`,`Scaffold the ${t}/ directory but do not touch MCP config`).option(`--dev-mcp`,`Register a local dev MCP entry using node + packages/cli/dist/cli.mjs with debug logging`).action(async e=>{let t=process.cwd(),n;try{n=await Z({cwd:t,mcp:e.mcp,devMcp:e.devMcp})}catch(e){if(e instanceof i){process.stderr.write(`open-knowledge requires git to initialize a parent repo. Install git or run 'git init' yourself, then re-run.
|
|
4
|
+
`),e.stderr&&process.stderr.write(`${e.stderr.trim()}\n`),process.exitCode=1;return}throw e}try{let{previewContent:e}=await import(`./preview-QqXnlaPm.mjs`),{loadConfig:r}=await import(`./loader-DW8bVj-Z.mjs`),{resolveContentDir:i}=await import(`./paths-B8oV95O5.mjs`),{config:a}=r(t),o=i(a,t);n.preview=e({projectDir:t,contentDir:o,include:a.content.include,exclude:a.content.exclude})}catch(e){n.previewWarning=e instanceof Error?e.message:String(e)}process.stdout.write(`${Q(n,t)}\n`),(n.editors.some(e=>e.action===`failed`)||n.mcpAction===`failed`)&&(process.exitCode=1)})}export{Z as a,T as c,se as i,B as l,Q as n,X as o,ce as r,oe as s,$ as t};
|
|
5
|
+
//# sourceMappingURL=init-NMjOmrTP.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
function e(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}export{e as t};
|
|
2
|
-
//# sourceMappingURL=is-object-
|
|
2
|
+
//# sourceMappingURL=is-object-CEU0BgQ5.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
function e(e){let t=e.scheduler??{setTimeout:(e,t)=>globalThis.setTimeout(e,t),clearTimeout:e=>globalThis.clearTimeout(e)},n=e.initialBackoffMs??1e3,r=e.maxBackoffMs??3e4,i=e.createWebSocket??(e=>new WebSocket(e)),a=e.logger??null,o=e.log,s=null,c=null,l=!1,u=n;function d(e,t,n){try{a?a[e](t,n):o?.(t)}catch{}}function f(){if(l)return;c!==null&&t.clearTimeout(c);let e=u;u=Math.min(u*2,r),d(`debug`,`scheduling reconnect`,{backoffMs:e}),c=t.setTimeout(()=>{c=null,p().catch(e=>d(`warn`,`reconnect failed`,{error:String(e)}))},e)}async function p(){if(l)return;let t;try{t=await e.resolveWsUrl()}catch(e){d(`warn`,`resolveWsUrl threw`,{error:String(e)}),f();return}if(!t){f();return}let r=e.connectionId?`&connectionId=${encodeURIComponent(e.connectionId)}`:``,a=`${t}/collab/keepalive?pid=${process.pid}${r}`;try{s=i(a)}catch(e){d(`warn`,`WebSocket constructor failed`,{url:a,error:String(e)}),s=null,f();return}s.addEventListener(`open`,()=>{d(`info`,`connected`,{url:t}),u=n}),s.addEventListener(`close`,()=>{l||(d(`info`,`disconnected`,{url:t}),s=null,f())}),s.addEventListener(`error`,()=>{d(`debug`,`websocket error observed`,{url:t,readyState:s?.readyState,reason:`error-event`})})}return queueMicrotask(()=>{p().catch(e=>d(`warn`,`initial connect failed`,{error:String(e)}))}),{close:()=>{if(!l&&(l=!0,c!==null&&(t.clearTimeout(c),c=null),s)){try{s.close()}catch{}s=null}},isConnected:()=>s!==null&&s.readyState===1}}export{e as startKeepalive};
|
|
2
|
-
//# sourceMappingURL=keepalive-
|
|
2
|
+
//# sourceMappingURL=keepalive-DCcA7pmC.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./loader-DkbY6ZLN.mjs";export{e as loadConfig};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{n as e}from"./constants-BQaeExTr.mjs";import{o as t}from"./dist-h83E8Lop.mjs";import{t as n}from"./is-object-CEU0BgQ5.mjs";import{existsSync as r,readFileSync as i}from"node:fs";import{homedir as a}from"node:os";import{resolve as o}from"node:path";import{parse as s}from"yaml";import{realpath as c}from"node:fs/promises";import{z as l}from"zod";async function u(e){let t=o(e);try{return await c(t)}catch(e){if(e.code!==`ENOENT`){let n=e instanceof Error?e.message:String(e);console.warn(`[normalize-cwd] realpath failed for ${t}: ${n}`)}return t}}const d=l.object({title:l.string().optional(),description:l.string().optional(),tags:l.array(l.string()).optional()}).strict(),f=l.object({match:l.string().min(1,"`match` must be a non-empty glob pattern (e.g. 'specs/**' or 'reports/*/**')"),frontmatter:d}).strict(),p=l.object({content:l.object({dir:l.string().default(`.`),include:l.array(l.string()).min(1).default([`**/*.md`,`**/*.mdx`]),exclude:l.array(l.string()).default([])}).default({dir:`.`,include:[`**/*.md`,`**/*.mdx`],exclude:[]}),github:l.object({oauthAppClientId:l.string().default(`Ov23liqlSd0V1MwR6rhI`)}).default({oauthAppClientId:`Ov23liqlSd0V1MwR6rhI`}),sync:l.object({enabled:l.boolean().optional(),pushIntervalSeconds:l.number().int().min(1).default(60),pullIntervalSeconds:l.number().int().min(1).default(30),autoCommit:l.boolean().default(!0),autoPush:l.boolean().default(!0),autoPull:l.boolean().default(!0),commitMessage:l.string().default(`auto`)}).default({pushIntervalSeconds:60,pullIntervalSeconds:30,autoCommit:!0,autoPush:!0,autoPull:!0,commitMessage:`auto`}),server:l.object({port:l.number().int().min(0).max(65535).default(0),host:l.string().regex(/^[\w.\-:]+$/,`Invalid hostname`).default(`localhost`),openOnAgentEdit:l.boolean().default(!1)}).default({port:0,host:`localhost`,openOnAgentEdit:!1}),persistence:l.object({debounceMs:l.number().int().min(0).default(2e3),maxDebounceMs:l.number().int().min(0).default(1e4)}).default({debounceMs:2e3,maxDebounceMs:1e4}),preview:l.object({baseUrl:l.url().optional()}).default({}),folders:l.array(f).default([]),mcp:l.object({autoStart:l.boolean().default(!0),tools:l.object({read_document:l.object({historyDepth:l.number().int().min(0).default(5)}).default({historyDepth:5}),search:l.object({maxResults:l.number().int().min(1).default(50)}).default({maxResults:50})}).default({read_document:{historyDepth:5},search:{maxResults:50}})}).default({autoStart:!0,tools:{read_document:{historyDepth:5},search:{maxResults:50}}})});function m(e,t){let r={...e};for(let i of Object.keys(t)){let a=e[i],o=t[i];n(o)&&n(a)?r[i]=m(a,o):o!==void 0&&(r[i]=o)}return r}function h(e){if(!r(e))return null;try{let t=s(i(e,`utf-8`));return n(t)?t:null}catch(t){return console.warn(`[config] Failed to parse ${e}: ${t instanceof Error?t.message:t}`),null}}function g(n){let r=n??process.cwd(),i=[],s=o(a(),t,e),c={},l=h(s);l&&(c=m(c,l),i.push(s));let u=o(r,t,e),d=h(u);d&&(c=m(c,d),i.push(u));let f=p.safeParse(c);if(!f.success){let e=f.error.issues.map(e=>` ${e.path.join(`.`)}: ${e.message}`);throw Error(`Invalid configuration:\n${e.join(`
|
|
2
|
+
`)}`)}return{config:f.data,sources:i}}function _(e,t=process.env){let n=e;return t.PORT&&(n={...n,server:{...n.server,port:Number(t.PORT)}}),t.HOST&&(n={...n,server:{...n.server,host:t.HOST}}),n}function v(e){let t=e.env??process.env,n=e.cacheMs??1e3,r=e.loadConfigFn??g,i=new Map,a=new Map,o=u(e.startupCwd);return async s=>{let c=await u(s??e.startupCwd),l=Date.now(),d=i.get(c);if(d&&d.expiresAt>l)return d.config;let f=a.get(c);if(f)return await f;let p=(async()=>{if(c===await o){let r=_(e.startupConfig,t);return i.set(c,{config:r,expiresAt:Date.now()+n}),r}let a=_(r(c).config,t);return i.set(c,{config:a,expiresAt:Date.now()+n}),a})();a.set(c,p);try{return await p}finally{a.delete(c)}}}export{u as i,g as n,p as r,v as t};
|
|
3
|
+
//# sourceMappingURL=loader-DkbY6ZLN.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{execFile as e}from"node:child_process";function t(t){e(process.platform===`darwin`?`open`:process.platform===`win32`?`cmd`:`xdg-open`,process.platform===`win32`?[`/c`,`start`,``,t]:[t],e=>{e&&console.warn(`Could not auto-open browser (${e.message}); visit ${t} manually`)})}export{t as openBrowser};
|
|
2
|
-
//# sourceMappingURL=open-browser-
|
|
2
|
+
//# sourceMappingURL=open-browser-ryHU9Kmc.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./paths-SX6F7bew.mjs";export{t as resolveContentDir,e as resolveLockDir};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./preview-RWJaR_PK.mjs";export{t as formatPreviewBlock,e as previewContent};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import"./constants-BQaeExTr.mjs";import{o as e}from"./dist-h83E8Lop.mjs";import{R as t}from"./dist-wAieHPG9.mjs";import{existsSync as n,lstatSync as r,readdirSync as i,realpathSync as a,statSync as o}from"node:fs";import{join as s,relative as c}from"node:path";function l(e){let{projectDir:n,contentDir:l,include:u,exclude:d,sampleCap:f=5}=e,p=[],m=[];try{r(l)}catch(e){return{totalCount:0,sample:[],contentDir:l,include:u,exclude:d,warnings:[`cannot access content directory ${l}: ${e instanceof Error?e.message:String(e)}`]}}let h;try{h=t({projectDir:n,contentDir:l,includePatterns:u,excludePatterns:d})}catch(e){return{totalCount:0,sample:[],contentDir:l,include:u,exclude:d,warnings:[e instanceof Error?e.message:String(e)]}}function g(e){let t;try{t=i(e,{withFileTypes:!0})}catch(t){let n=t instanceof Error?t.message:String(t);p.push(`could not read directory ${c(l,e)||`.`}: ${n}`);return}for(let n of t){let t=s(e,n.name);if(n.isSymbolicLink()){let e;try{e=a(t)}catch(e){let n=e.code;n===`ENOENT`||n===`ELOOP`?p.push(`broken or cyclic symlink: ${c(l,t)}`):p.push(`cannot resolve symlink ${c(l,t)}: ${n??`unknown error`}`);continue}let n;try{n=o(e)}catch{continue}if(n.isDirectory()){let e=c(l,t);if(h.isDirExcluded(e))continue;g(t)}else if(n.isFile()){let e=c(l,t);if(h.isExcluded(e))continue;m.push(e)}}else if(n.isDirectory()){let e=c(l,t);if(h.isDirExcluded(e))continue;g(t)}else if(n.isFile()){let e=c(l,t);if(h.isExcluded(e))continue;m.push(e)}}}return g(l),{totalCount:m.length,sample:m.slice(0,f),contentDir:l,include:u,exclude:d,warnings:p}}function u(t,r){let i=[],a=c(r,t.contentDir),o=a===``?`./`:`./${a}`;i.push(`Content:`),i.push(` Found ${t.totalCount} markdown files in ${o}`);let l=t.include.join(`, `),u=t.exclude.length>0?t.exclude.join(`, `):`(none)`;if(i.push(` Scope: include=${l} exclude=${u}`),t.sample.length>0){let e=t.sample.join(`, `),n=t.totalCount>t.sample.length?`, …`:``;i.push(` Sample: ${e}${n}`)}if(t.warnings.length>0)for(let e of t.warnings)i.push(` Warning: ${e}`);return i.push(``),n(s(r,`.open-knowledge`,`config.yml`))?(i.push(` To adjust, edit ${e}/config.yml:`),i.push(` content:`),i.push(` include: ${JSON.stringify(t.include)}`),i.push(` exclude: ${JSON.stringify(t.exclude)}`)):(i.push(" Run `open-knowledge init` to scaffold config, then adjust:"),i.push(` ${e}/config.yml → content.include / content.exclude`)),i.push(``),i.push(` Re-check anytime: open-knowledge preview`),i.join(`
|
|
2
|
+
`)}export{l as n,u as t};
|
|
3
|
+
//# sourceMappingURL=preview-RWJaR_PK.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ActivityPanelDiffView-DVyTW-J7.js","./chunk-DECur_0Z.js","./compiler-runtime-Y11fyRVL.js","./ActivityPanelDiffView-legcy4jI.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./chunk-DECur_0Z.js";import{d as t}from"./propagation-api-Bugyj7xy.js";import{n,r,t as i}from"./compiler-runtime-Y11fyRVL.js";import{t as a,x as o}from"./button-B1XQHQcX.js";import{d as s,f as c,p as l,r as u,t as d}from"./agent-presence-BQu9C0ej.js";import{n as f,r as p,st as m,vt as h}from"./DocumentContext-sx4y_fGB.js";import{C as g,a as _,i as v,o as y,r as b,s as x,t as S}from"./dialog-xzAlDsHy.js";import{i as C,n as w,t as T}from"./tooltip-Be1xrEel.js";import{i as E}from"./PageListContext-BMPOeSCn.js";var D=o(`rewind`,[[`path`,{d:`M12 6a2 2 0 0 0-3.414-1.414l-6 6a2 2 0 0 0 0 2.828l6 6A2 2 0 0 0 12 18z`,key:`2a1g8i`}],[`path`,{d:`M22 6a2 2 0 0 0-3.414-1.414l-6 6a2 2 0 0 0 0 2.828l6 6A2 2 0 0 0 22 18z`,key:`rg3s36`}]]),O=o(`undo-2`,[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]),k=i(),A=e(n(),1),j=500,M=64,ee=class{map=new Map;get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}set(e,t){for(this.map.has(e)&&this.map.delete(e),this.map.set(e,t);this.map.size>M;){let e=this.map.keys().next().value;if(e===void 0)break;this.map.delete(e)}}clear(){this.map.clear()}get size(){return this.map.size}};async function te(e){let t=`/api/agent-activity?agentId=${encodeURIComponent(e)}`,n=await fetch(t);if(!n.ok)throw Error(`agent-activity fetch failed: HTTP ${n.status}`);let r=await n.json();if(!r.ok)throw Error(r.error??`agent-activity fetch not ok`);return{sessionAlive:r.sessionAlive??!1,agent:r.agent??null,files:r.files??[]}}async function N(e,t,n){let r=`/api/agent-burst-diff?agentId=${encodeURIComponent(e)}&docName=${encodeURIComponent(t)}&stackIndex=${n}`,i=await fetch(r);if(!i.ok)throw Error(`agent-burst-diff fetch failed: HTTP ${i.status}`);let a=await i.json();if(!a.ok)throw Error(a.error??`agent-burst-diff fetch not ok`);return a.diff??``}function ne(e){let t=(0,k.c)(23),{systemProvider:n}=f(),[r,i]=(0,A.useState)(null),[a,o]=(0,A.useState)(`idle`),[s,c]=(0,A.useState)(null),l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=new ee,t[0]=l):l=t[0];let u=(0,A.useRef)(l),d=(0,A.useRef)(0),p;t[1]===n?p=t[2]:(p=e=>{let t=d.current+=1;o(`loading`),c(null),te(e).then(r=>{if(d.current!==t)return;let a=ie(n,e);i({...r,writingDocs:a}),o(`ready`)}).catch(e=>{d.current===t&&(c(e instanceof Error?e.message:String(e)),o(`error`))})},t[1]=n,t[2]=p);let m=p,h;t[3]!==e||t[4]!==m?(h=()=>{if(!e){d.current+=1,i(null),o(`idle`),c(null),u.current.clear();return}u.current.clear(),m(e);let t=null,n=E(n=>{n.includes(`session-activity`)&&(t&&clearTimeout(t),t=setTimeout(()=>{t=null,m(e)},j))});return()=>{t&&clearTimeout(t),n()}},t[3]=e,t[4]=m,t[5]=h):h=t[5];let g;t[6]===e?g=t[7]:(g=[e],t[6]=e,t[7]=g),(0,A.useEffect)(h,g);let _,v;t[8]!==e||t[9]!==n?(_=()=>{if(!e||!n)return;let t=()=>{if(!n.awareness)return;let t=ie(n,e);i(e=>!e||re(e.writingDocs,t)?e:{...e,writingDocs:t})},r=n.awareness;if(!r||typeof r.on!=`function`){t();return}r.on(`update`,t),t();let a=setInterval(t,1e3);return()=>{clearInterval(a),typeof r.off==`function`&&r.off(`update`,t)}},v=[e,n],t[8]=e,t[9]=n,t[10]=_,t[11]=v):(_=t[10],v=t[11]),(0,A.useEffect)(_,v);let y;t[12]===e?y=t[13]:(y=async(t,n)=>{if(!e)return``;let r=`${t}\0${n}`,i=u.current.get(r);if(i!==void 0)return i;let a=await N(e,t,n);return u.current.set(r,a),a},t[12]=e,t[13]=y);let b=y,x;t[14]!==e||t[15]!==m?(x=()=>{e&&m(e)},t[14]=e,t[15]=m,t[16]=x):x=t[16];let S=x,C;return t[17]!==r||t[18]!==s||t[19]!==b||t[20]!==S||t[21]!==a?(C={data:r,status:a,error:s,reload:S,fetchBurstDiff:b},t[17]=r,t[18]=s,t[19]=b,t[20]=S,t[21]=a,t[22]=C):C=t[22],C}function re(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function ie(e,t){let n=new Set;if(!e)return n;let r=e.awareness;if(!d(r))return n;let i=[t,t.startsWith(`agent-`)?t.slice(6):`agent-${t}`];for(let e of r.getStates().values()){let t=e.agentPresence;if(t)for(let e of i){let r=t[e];r&&r.mode===`writing`&&r.currentDoc&&n.add(r.currentDoc)}}return n}var P=r(),ae=(0,A.lazy)(async()=>({default:(await t(()=>import(`./ActivityPanelDiffView-DVyTW-J7.js`),__vite__mapDeps([0,1,2,3]),import.meta.url)).ActivityPanelDiffView}));function oe(e,t){let n=Math.max(0,t-e);return n<6e4?`${Math.round(n/1e3)}s ago`:n<36e5?`${Math.round(n/6e4)}m ago`:new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}function se(e){let t=(0,k.c)(38),{burst:n,docName:r,fetchBurstDiff:i}=e,[a,o]=(0,A.useState)(!1),[l,u]=(0,A.useState)(null),[d,f]=(0,A.useState)(null),[p,m]=(0,A.useState)(!1),[h,g]=(0,A.useState)(ce),_,v;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(_=()=>{let e=setInterval(()=>g(Date.now()),3e4);return()=>clearInterval(e)},v=[],t[0]=_,t[1]=v):(_=t[0],v=t[1]),(0,A.useEffect)(_,v);let y;t[2]!==n.stackIndex||t[3]!==l||t[4]!==r||t[5]!==a||t[6]!==i||t[7]!==p?(y=()=>{let e=!a;o(e),e&&l===null&&!p&&(m(!0),f(null),i(r,n.stackIndex).then(e=>{u(e),m(!1)}).catch(e=>{f(e instanceof Error?e.message:String(e)),m(!1)}))},t[2]=n.stackIndex,t[3]=l,t[4]=r,t[5]=a,t[6]=i,t[7]=p,t[8]=y):y=t[8];let b=y,x=`${a?`Collapse`:`Expand`} burst ${n.stackIndex+1} diff`,S;t[9]===a?S=t[10]:(S=a?(0,P.jsx)(c,{className:`size-3 shrink-0`,"aria-hidden":`true`}):(0,P.jsx)(s,{className:`size-3 shrink-0`,"aria-hidden":`true`}),t[9]=a,t[10]=S);let C;t[11]!==n.ts||t[12]!==h?(C=oe(n.ts,h),t[11]=n.ts,t[12]=h,t[13]=C):C=t[13];let w;t[14]===C?w=t[15]:(w=(0,P.jsx)(`span`,{className:`font-mono`,children:C}),t[14]=C,t[15]=w);let T;t[16]===n.additions?T=t[17]:(T=(0,P.jsxs)(`span`,{className:`text-green-600 dark:text-green-400`,children:[`+`,n.additions]}),t[16]=n.additions,t[17]=T);let E;t[18]===n.deletions?E=t[19]:(E=(0,P.jsxs)(`span`,{className:`text-red-600 dark:text-red-400`,children:[`−`,n.deletions]}),t[18]=n.deletions,t[19]=E);let D;t[20]!==T||t[21]!==E?(D=(0,P.jsxs)(`span`,{className:`ml-auto font-mono`,children:[T,` `,E]}),t[20]=T,t[21]=E,t[22]=D):D=t[22];let O;t[23]!==a||t[24]!==D||t[25]!==x||t[26]!==S||t[27]!==w||t[28]!==b?(O=(0,P.jsxs)(`button`,{type:`button`,onClick:b,className:`flex w-full items-center gap-2 px-4 py-1.5 text-xs text-muted-foreground hover:bg-muted/40`,"aria-expanded":a,"aria-label":x,children:[S,w,D]}),t[23]=a,t[24]=D,t[25]=x,t[26]=S,t[27]=w,t[28]=b,t[29]=O):O=t[29];let j;t[30]!==l||t[31]!==a||t[32]!==d||t[33]!==p?(j=a?(0,P.jsx)(`div`,{className:`bg-muted/20`,children:p?(0,P.jsx)(`div`,{className:`px-4 py-2 text-xs text-muted-foreground italic`,children:`Loading diff…`}):d?(0,P.jsxs)(`div`,{className:`px-4 py-2 text-xs text-destructive`,children:[`Failed: `,d]}):l===null?(0,P.jsx)(`div`,{className:`px-4 py-2 text-xs text-muted-foreground italic`,children:`No diff.`}):(0,P.jsx)(A.Suspense,{fallback:(0,P.jsx)(`div`,{className:`px-4 py-2 text-xs text-muted-foreground italic`,children:`Loading diff…`}),children:(0,P.jsx)(ae,{diff:l})})}):null,t[30]=l,t[31]=a,t[32]=d,t[33]=p,t[34]=j):j=t[34];let M;return t[35]!==O||t[36]!==j?(M=(0,P.jsxs)(`div`,{className:`border-t border-border/50`,children:[O,j]}),t[35]=O,t[36]=j,t[37]=M):M=t[37],M}function ce(){return Date.now()}function le(e,t){let n=Math.max(0,t-e);return n<6e4?`${Math.round(n/1e3)}s ago`:n<36e5?`${Math.round(n/6e4)}m ago`:`${Math.round(n/36e5)}h ago`}function ue(e){let t=(0,k.c)(93),{file:n,sessionAlive:r,isWriting:i,onNavigate:o,onUndoLast:l,onUndoAll:u,fetchBurstDiff:d}=e,[f,p]=(0,A.useState)(!1),[m,h]=(0,A.useState)(!1),[g,E]=(0,A.useState)(!1),[j,M]=(0,A.useState)(fe),ee,te;if(t[0]===Symbol.for(`react.memo_cache_sentinel`)?(ee=()=>{let e=setInterval(()=>M(Date.now()),3e4);return()=>clearInterval(e)},te=[],t[0]=ee,t[1]=te):(ee=t[0],te=t[1]),(0,A.useEffect)(ee,te),n.bursts.length===0)return null;let N=!r||n.bursts.length===0||g,ne=r?n.bursts.length===0?`Nothing to undo on this file`:null:`Session ended — undo unavailable`,re;t[2]!==N||t[3]!==n.docName||t[4]!==l?(re=e=>{e.stopPropagation(),!N&&(E(!0),Promise.resolve(l(n.docName)).finally(()=>E(!1)))},t[2]=N,t[3]=n.docName,t[4]=l,t[5]=re):re=t[5];let ie=re,ae;t[6]===N?ae=t[7]:(ae=e=>{e.stopPropagation(),!N&&h(!0)},t[6]=N,t[7]=ae);let oe=ae,ce;t[8]!==N||t[9]!==n.docName||t[10]!==u?(ce=()=>{h(!1),!N&&(E(!0),Promise.resolve(u(n.docName)).finally(()=>E(!1)))},t[8]=N,t[9]=n.docName,t[10]=u,t[11]=ce):ce=t[11];let ue=ce,F;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(F=()=>p(de),t[12]=F):F=t[12];let pe=f?`Collapse ${n.docName}`:`Expand ${n.docName}`,I;t[13]===f?I=t[14]:(I=f?(0,P.jsx)(c,{className:`size-4`,"aria-hidden":`true`}):(0,P.jsx)(s,{className:`size-4`,"aria-hidden":`true`}),t[13]=f,t[14]=I);let L;t[15]!==f||t[16]!==pe||t[17]!==I?(L=(0,P.jsx)(`button`,{type:`button`,onClick:F,className:`flex size-5 shrink-0 items-center justify-center rounded hover:bg-muted`,"aria-expanded":f,"aria-label":pe,"data-testid":`activity-panel-file-row-carrot`,children:I}),t[15]=f,t[16]=pe,t[17]=I,t[18]=L):L=t[18];let R;t[19]!==n.docName||t[20]!==o?(R=()=>o(n.docName),t[19]=n.docName,t[20]=o,t[21]=R):R=t[21];let me=`Navigate to ${n.docName}`,z;t[22]!==n.docName||t[23]!==R||t[24]!==me?(z=(0,P.jsx)(`button`,{type:`button`,onClick:R,className:`min-w-0 flex-1 truncate text-left text-foreground hover:underline focus-visible:outline-ring`,"aria-label":me,"data-testid":`activity-panel-file-row-filename`,title:n.docName,children:n.docName}),t[22]=n.docName,t[23]=R,t[24]=me,t[25]=z):z=t[25];let he=`Undo last edit on ${n.docName}`,ge;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(ge=(0,P.jsx)(O,{className:`size-3.5`,"aria-hidden":`true`}),t[26]=ge):ge=t[26];let B;t[27]!==N||t[28]!==ie||t[29]!==he?(B=(0,P.jsx)(C,{asChild:!0,children:(0,P.jsx)(a,{type:`button`,variant:`ghost`,size:`icon`,className:`size-6 shrink-0`,onClick:ie,disabled:N,"aria-label":he,"data-testid":`activity-panel-undo-last`,children:ge})}),t[27]=N,t[28]=ie,t[29]=he,t[30]=B):B=t[30];let _e=ne??`Undo last edit`,V;t[31]===_e?V=t[32]:(V=(0,P.jsx)(w,{side:`bottom`,children:_e}),t[31]=_e,t[32]=V);let H;t[33]!==B||t[34]!==V?(H=(0,P.jsxs)(T,{children:[B,V]}),t[33]=B,t[34]=V,t[35]=H):H=t[35];let ve=`Undo all edits on ${n.docName}`,ye;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(ye=(0,P.jsx)(D,{className:`size-3.5`,"aria-hidden":`true`}),t[36]=ye):ye=t[36];let be;t[37]!==N||t[38]!==oe||t[39]!==ve?(be=(0,P.jsx)(C,{asChild:!0,children:(0,P.jsx)(a,{type:`button`,variant:`ghost`,size:`icon`,className:`size-6 shrink-0`,onClick:oe,disabled:N,"aria-label":ve,"data-testid":`activity-panel-undo-all`,children:ye})}),t[37]=N,t[38]=oe,t[39]=ve,t[40]=be):be=t[40];let xe=ne??`Undo all edits`,U;t[41]===xe?U=t[42]:(U=(0,P.jsx)(w,{side:`bottom`,children:xe}),t[41]=xe,t[42]=U);let W;t[43]!==be||t[44]!==U?(W=(0,P.jsxs)(T,{children:[be,U]}),t[43]=be,t[44]=U,t[45]=W):W=t[45];let G;t[46]===n.additionsTotal?G=t[47]:(G=(0,P.jsxs)(`span`,{className:`text-green-600 dark:text-green-400`,children:[`+`,n.additionsTotal]}),t[46]=n.additionsTotal,t[47]=G);let K;t[48]===n.deletionsTotal?K=t[49]:(K=(0,P.jsxs)(`span`,{className:`text-red-600 dark:text-red-400`,children:[`−`,n.deletionsTotal]}),t[48]=n.deletionsTotal,t[49]=K);let q;t[50]!==G||t[51]!==K?(q=(0,P.jsxs)(`span`,{className:`shrink-0 font-mono text-xs`,children:[G,` `,K]}),t[50]=G,t[51]=K,t[52]=q):q=t[52];let J;t[53]!==n.lastTs||t[54]!==j?(J=le(n.lastTs,j),t[53]=n.lastTs,t[54]=j,t[55]=J):J=t[55];let Y;t[56]===J?Y=t[57]:(Y=(0,P.jsx)(`span`,{className:`shrink-0 font-mono text-[11px] text-muted-foreground`,children:J}),t[56]=J,t[57]=Y);let X;t[58]===i?X=t[59]:(X=i?(0,P.jsx)(`span`,{className:`shrink-0 text-[11px] text-primary animate-pulse`,role:`status`,children:`writing…`}):null,t[58]=i,t[59]=X);let Z;t[60]!==z||t[61]!==H||t[62]!==W||t[63]!==q||t[64]!==Y||t[65]!==X||t[66]!==L?(Z=(0,P.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2 text-sm`,children:[L,z,H,W,q,Y,X]}),t[60]=z,t[61]=H,t[62]=W,t[63]=q,t[64]=Y,t[65]=X,t[66]=L,t[67]=Z):Z=t[67];let Q;t[68]!==f||t[69]!==d||t[70]!==n.bursts||t[71]!==n.docName?(Q=f?(0,P.jsx)(`div`,{children:n.bursts.map(e=>(0,P.jsx)(se,{burst:e,docName:n.docName,fetchBurstDiff:d},`${n.docName}:${e.stackIndex}`))}):null,t[68]=f,t[69]=d,t[70]=n.bursts,t[71]=n.docName,t[72]=Q):Q=t[72];let Se;t[73]===Symbol.for(`react.memo_cache_sentinel`)?(Se=(0,P.jsx)(x,{children:`Undo all edits on this file?`}),t[73]=Se):Se=t[73];let Ce;t[74]===n.docName?Ce=t[75]:(Ce=(0,P.jsx)(`span`,{className:`font-mono text-foreground`,children:n.docName}),t[74]=n.docName,t[75]=Ce);let we=n.bursts.length===1?``:`s`,Te;t[76]!==n.bursts.length||t[77]!==Ce||t[78]!==we?(Te=(0,P.jsxs)(y,{children:[Se,(0,P.jsxs)(v,{children:[`This will revert every change this agent has made to`,` `,Ce,` in their current session (`,n.bursts.length,` burst`,we,`). Other files and other writers are not affected.`]})]}),t[76]=n.bursts.length,t[77]=Ce,t[78]=we,t[79]=Te):Te=t[79];let Ee;t[80]===Symbol.for(`react.memo_cache_sentinel`)?(Ee=(0,P.jsx)(a,{type:`button`,variant:`outline`,onClick:()=>h(!1),"data-testid":`activity-panel-undo-all-cancel`,children:`Cancel`}),t[80]=Ee):Ee=t[80];let De;t[81]===ue?De=t[82]:(De=(0,P.jsxs)(_,{children:[Ee,(0,P.jsx)(a,{type:`button`,variant:`destructive`,onClick:ue,"data-testid":`activity-panel-undo-all-confirm`,children:`Undo all`})]}),t[81]=ue,t[82]=De);let Oe;t[83]!==Te||t[84]!==De?(Oe=(0,P.jsxs)(b,{className:`sm:max-w-md`,children:[Te,De]}),t[83]=Te,t[84]=De,t[85]=Oe):Oe=t[85];let $;t[86]!==m||t[87]!==Oe?($=(0,P.jsx)(S,{open:m,onOpenChange:h,children:Oe}),t[86]=m,t[87]=Oe,t[88]=$):$=t[88];let ke;return t[89]!==Z||t[90]!==Q||t[91]!==$?(ke=(0,P.jsxs)(`div`,{className:`border-b border-border`,"data-testid":`activity-panel-file-row`,children:[Z,Q,$]}),t[89]=Z,t[90]=Q,t[91]=$,t[92]=ke):ke=t[92],ke}function de(e){return!e}function fe(){return Date.now()}async function F(e){let t=await fetch(`/api/agent-undo`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({...e,agentId:e.connectionId})});if(!t.ok)throw Error(`agent-undo failed: HTTP ${t.status}`)}function pe(e){return`#/${e.split(`/`).map(e=>encodeURIComponent(e)).join(`/`)}`}function I(e){typeof window>`u`||(window.location.hash=pe(e))}function L(){let e=(0,k.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,P.jsxs)(`div`,{className:`flex h-full items-center justify-center p-6 text-muted-foreground`,role:`status`,"aria-busy":`true`,children:[(0,P.jsx)(m,{className:`mr-2 size-4 animate-spin`,"aria-hidden":`true`}),(0,P.jsx)(`span`,{className:`text-sm`,children:`Loading agent activity…`})]}),e[0]=t):t=e[0],t}function R(e){let t=(0,k.c)(9),{error:n,onRetry:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,P.jsx)(h,{className:`size-6 text-destructive`,"aria-hidden":`true`}),t[0]=i):i=t[0];let o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,P.jsx)(`p`,{className:`text-sm font-medium`,children:`Failed to load activity`}),t[1]=o):o=t[1];let s;t[2]===n?s=t[3]:(s=(0,P.jsxs)(`div`,{className:`space-y-1`,children:[o,(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n})]}),t[2]=n,t[3]=s);let c;t[4]===r?c=t[5]:(c=(0,P.jsx)(a,{type:`button`,variant:`outline`,size:`sm`,onClick:r,children:`Retry`}),t[4]=r,t[5]=c);let l;return t[6]!==s||t[7]!==c?(l=(0,P.jsxs)(`div`,{className:`flex flex-col items-center gap-3 p-6 text-center`,role:`alert`,"data-testid":`activity-panel-error`,children:[i,s,c]}),t[6]=s,t[7]=c,t[8]=l):l=t[8],l}function me(){let e=(0,k.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,P.jsx)(`div`,{className:`flex h-full items-center justify-center p-6 text-muted-foreground`,"data-testid":`activity-panel-empty`,children:(0,P.jsx)(`p`,{className:`text-sm italic`,children:`No edits yet.`})}),e[0]=t):t=e[0],t}function z(e){let t=(0,k.c)(8),{onExit:n}=e,r;t[0]===n?r=t[1]:(r=(0,P.jsx)(he,{onClick:n}),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,P.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:`Agent activity`}),t[2]=i):i=t[2];let a;t[3]===r?a=t[4]:(a=(0,P.jsxs)(`div`,{className:`flex shrink-0 flex-row items-center gap-2 border-b border-border px-3 py-2`,children:[r,i]}),t[3]=r,t[4]=a);let o;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,P.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-6 text-muted-foreground`,children:(0,P.jsx)(`p`,{className:`text-center text-sm italic`,children:`Click an agent's avatar in the presence bar to view their session.`})}),t[5]=o):o=t[5];let s;return t[6]===a?s=t[7]:(s=(0,P.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col`,"data-testid":`activity-panel-no-agent`,"aria-label":`Agent activity`,children:[a,o]}),t[6]=a,t[7]=s),s}function he(e){let t=(0,k.c)(6),{onClick:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,P.jsx)(l,{}),t[0]=r):r=t[0];let i;t[1]===n?i=t[2]:(i=(0,P.jsx)(C,{asChild:!0,children:(0,P.jsx)(a,{type:`button`,variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,onClick:n,"aria-label":`Back to document view`,"data-testid":`docpanel-exit-agent-mode`,children:r})}),t[1]=n,t[2]=i);let o;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,P.jsx)(w,{side:`bottom`,children:`Back to document view`}),t[3]=o):o=t[3];let s;return t[4]===i?s=t[5]:(s=(0,P.jsxs)(T,{children:[i,o]}),t[4]=i,t[5]=s),s}function ge(e){let t=(0,k.c)(9),{lastTs:n}=e,[r]=(0,A.useState)(B),i;t[0]!==n||t[1]!==r?(i=n?_e(r-n):null,t[0]=n,t[1]=r,t[2]=i):i=t[2];let a=i,o;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,P.jsx)(`span`,{className:`font-medium`,children:`Session ended`}),t[3]=o):o=t[3];let s;t[4]===a?s=t[5]:(s=a?(0,P.jsxs)(`span`,{children:[` · `,a]}):null,t[4]=a,t[5]=s);let c;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,P.jsx)(`div`,{className:`mt-1 opacity-80`,children:`Undo buttons are disabled — per-session state has been garbage-collected.`}),t[6]=c):c=t[6];let l;return t[7]===s?l=t[8]:(l=(0,P.jsxs)(`div`,{className:`border-b border-border bg-muted/40 px-4 py-3 text-xs text-muted-foreground`,"data-testid":`activity-panel-session-ended`,children:[o,s,c]}),t[7]=s,t[8]=l),l}function B(){return Date.now()}function _e(e){let t=Math.max(0,e);return t<6e4?`${Math.round(t/1e3)}s ago`:t<36e5?`${Math.round(t/6e4)}m ago`:`${Math.round(t/36e5)}h ago`}function V(e){let t=(0,k.c)(10),{agent:n,size:r}=e,i=r===void 0?28:r,a;t[0]!==n.color||t[1]!==i?(a={backgroundColor:n.color,width:i,height:i},t[0]=n.color,t[1]=i,t[2]=a):a=t[2];let o=i*.57,s=i*.57,c;t[3]!==n.icon||t[4]!==o||t[5]!==s?(c=(0,P.jsx)(u,{icon:n.icon,width:o,height:s}),t[3]=n.icon,t[4]=o,t[5]=s,t[6]=c):c=t[6];let l;return t[7]!==a||t[8]!==c?(l=(0,P.jsx)(`span`,{className:`inline-flex shrink-0 items-center justify-center rounded-full text-white ring-2 ring-background`,style:a,"aria-hidden":`true`,children:c}),t[7]=a,t[8]=c,t[9]=l):l=t[9],l}function H(e){let t=(0,k.c)(20),{data:n,status:r,error:i,reload:a,fetchBurstDiff:o,onExit:s,onNavigate:c,onUndoLast:l,onUndoAll:u}=e,d=n?.files?.[0]?.lastTs??null,f;t[0]===s?f=t[1]:(f=(0,P.jsx)(he,{onClick:s}),t[0]=s,t[1]=f);let p;t[2]===n?p=t[3]:(p=n?.agent?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(V,{agent:n.agent}),(0,P.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,P.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:n.agent.displayName}),(0,P.jsxs)(`p`,{className:`truncate text-xs text-muted-foreground`,children:[n.sessionAlive?`Active`:`Ended`,n.files.length>0?` · ${n.files.length} file${n.files.length===1?``:`s`}`:``]})]})]}):(0,P.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,P.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:`Agent activity`})}),t[2]=n,t[3]=p);let m;t[4]!==f||t[5]!==p?(m=(0,P.jsxs)(`div`,{className:`flex flex-row items-center gap-2 border-b border-border px-3 py-2 shrink-0`,children:[f,p]}),t[4]=f,t[5]=p,t[6]=m):m=t[6];let h;t[7]!==n||t[8]!==i||t[9]!==o||t[10]!==d||t[11]!==c||t[12]!==u||t[13]!==l||t[14]!==a||t[15]!==r?(h=(0,P.jsx)(`div`,{className:`flex-1 overflow-y-auto`,"data-testid":`activity-panel-body`,children:r===`loading`&&n===null?(0,P.jsx)(L,{}):r===`error`&&i?(0,P.jsx)(R,{error:i,onRetry:a}):n===null?(0,P.jsx)(me,{}):(0,P.jsxs)(P.Fragment,{children:[n.sessionAlive?null:(0,P.jsx)(ge,{lastTs:d}),n.files.length===0?(0,P.jsx)(me,{}):n.files.map(e=>(0,P.jsx)(ue,{file:e,sessionAlive:n.sessionAlive,isWriting:n.writingDocs.has(e.docName),onNavigate:c,onUndoLast:l,onUndoAll:u,fetchBurstDiff:o},e.docName))]})}),t[7]=n,t[8]=i,t[9]=o,t[10]=d,t[11]=c,t[12]=u,t[13]=l,t[14]=a,t[15]=r,t[16]=h):h=t[16];let g;return t[17]!==m||t[18]!==h?(g=(0,P.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col`,"data-testid":`activity-panel`,"aria-label":`Agent activity`,children:[m,h]}),t[17]=m,t[18]=h,t[19]=g):g=t[19],g}function ve(){let e=(0,k.c)(22),{docPanelAgentId:t,closeActivityPanel:n}=f(),{openDocumentTransition:r}=p(),{data:i,status:a,error:o,reload:s,fetchBurstDiff:c}=ne(t);if(t===null){let t;return e[0]===n?t=e[1]:(t=(0,P.jsx)(z,{onExit:n}),e[0]=n,e[1]=t),t}let l;e[2]===r?l=e[3]:(l=e=>{r(e),I(e)},e[2]=r,e[3]=l);let u=l,d;e[4]!==i||e[5]!==t||e[6]!==s?(d=async e=>{try{await F({connectionId:t,docName:e,scope:`last`,agentName:i?.agent?.displayName}),s()}catch(e){let t=e,n=t instanceof Error?t.message:String(t);g.error(`Undo failed: ${n}`),s()}},e[4]=i,e[5]=t,e[6]=s,e[7]=d):d=e[7];let m=d,h;e[8]!==i||e[9]!==t||e[10]!==s?(h=async e=>{try{await F({connectionId:t,docName:e,scope:`file`,agentName:i?.agent?.displayName}),g.success(`Undone all edits on ${e}`),s()}catch(e){let t=e,n=t instanceof Error?t.message:String(t);g.error(`Undo all failed: ${n}`),s()}},e[8]=i,e[9]=t,e[10]=s,e[11]=h):h=e[11];let _=h,v;return e[12]!==n||e[13]!==i||e[14]!==o||e[15]!==c||e[16]!==u||e[17]!==_||e[18]!==m||e[19]!==s||e[20]!==a?(v=(0,P.jsx)(H,{data:i,status:a,error:o,reload:s,fetchBurstDiff:c,onExit:n,onNavigate:u,onUndoLast:m,onUndoAll:_}),e[12]=n,e[13]=i,e[14]=o,e[15]=c,e[16]=u,e[17]=_,e[18]=m,e[19]=s,e[20]=a,e[21]=v):v=e[21],v}export{ve as ActivityModeContent};
|