@inkeep/open-knowledge 0.35.0-beta.0 → 0.35.0-beta.2
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/assets/skills/discovery/SKILL.md +1 -1
- package/dist/assets/skills/project/SKILL.md +1 -1
- package/dist/cli.mjs +61 -61
- package/dist/constants-DpyZcZY8.mjs +2 -0
- package/dist/index.d.mts +30 -1
- package/dist/index.mjs +1 -1
- package/dist/init-B9aBCKfN.mjs +1 -0
- package/dist/init-Djn0N_zk.mjs +643 -0
- package/dist/{launch-json-removal-CUWDqJP_.mjs → launch-json-removal-CP7Ar6Ob.mjs} +2 -2
- package/dist/{loader-B1iUCvBP.mjs → loader-BXG_Ue4t.mjs} +2 -2
- package/dist/loader-irKuAg3E.mjs +1 -0
- package/dist/{open-browser-BgoSoXxW.mjs → open-browser-nDAvg8ub.mjs} +2 -2
- package/dist/preview-CrLp2V_V.mjs +1 -0
- package/dist/{preview-B0uDtWSM.mjs → preview-Dhq40nJ_.mjs} +2 -2
- package/dist/public/assets/{ActivityModeContent-DR9f5yD2.js → ActivityModeContent-BNz82usM.js} +1 -1
- package/dist/public/assets/CodeMirrorPropInput-DKUgIQit.js +3 -0
- package/dist/public/assets/{DocumentContext-CZbRup3E.js → DocumentContext-s7Qfd8iz.js} +19 -19
- package/dist/public/assets/{EnableSyncConfirmDialog-DmwwBOqo.js → EnableSyncConfirmDialog-BFsmDIV-.js} +1 -1
- package/dist/public/assets/{GraphPanel-DXHTsrXS.js → GraphPanel-C5V7tN6C.js} +3 -3
- package/dist/public/assets/{ManagedArtifactProperties-BfuADyBS.js → ManagedArtifactProperties-CgjKuRi_.js} +1 -1
- package/dist/public/assets/{McpConsentDialogBody-CSFTjJ_1.js → McpConsentDialogBody-BwgO2quE.js} +1 -1
- package/dist/public/assets/{MermaidDocEditor-fpCSGKJk.js → MermaidDocEditor-dbbj76iW.js} +1 -1
- package/dist/public/assets/PropertyPanel-Dnh_rOsE.js +2 -0
- package/dist/public/assets/{ReportBugDialogBody-BY3AL0yE.js → ReportBugDialogBody-memFSmPS.js} +1 -1
- package/dist/public/assets/{SettingsDialogBody-Dvm6wIza.js → SettingsDialogBody-BrRjDYgY.js} +2 -2
- package/dist/public/assets/{ShareBranchSwitchDialog-B45Ur2hQ.js → ShareBranchSwitchDialog-DI52ZkaG.js} +1 -1
- package/dist/public/assets/{ShareReceiveDialog-BqSpfMk9.js → ShareReceiveDialog-C8u6PgdG.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-CBp9VwKF.js → ShareReceiveMissDialog-PR-XSxN1.js} +1 -1
- package/dist/public/assets/SkillEditorActions-DG7dmv6Z.js +1 -0
- package/dist/public/assets/{SourceEditor-B4kYPJBZ.js → SourceEditor-dylchaTN.js} +1 -1
- package/dist/public/assets/{TerminalPanel-Ba3Z23bi.js → TerminalPanel-N3nlUpP9.js} +3 -3
- package/dist/public/assets/{agent-presence-Br6X9ZdO.js → agent-presence-CTUYlsSf.js} +1 -1
- package/dist/public/assets/auth-state-cache-DebyEMGy.js +11 -0
- package/dist/public/assets/{config-provider-r_jEkHK-.js → config-provider-CBrCc3Qp.js} +4 -4
- package/dist/public/assets/{dist-CLCs7mVU.js → dist-Cub6hBx7.js} +1 -1
- package/dist/public/assets/{dist-H6nXpN5y.js → dist-GfBYAWEU.js} +128 -127
- package/dist/public/assets/doc-hash-BMXWNo_I.js +1 -0
- package/dist/public/assets/{documents-events-Ce8maND0.js → documents-events-DJ1GG23v.js} +1 -1
- package/dist/public/assets/{file-tree-adapter-DDfH4Jl4.js → file-tree-adapter-DDhSPjxf.js} +1 -1
- package/dist/public/assets/{index-BxeOg6H0.js → index-BgzB1Mj8.js} +103 -102
- package/dist/public/assets/index-Zwl7lo8a.css +1 -0
- package/dist/public/assets/lint-config-client-BGM5HIsf.js +1 -0
- package/dist/public/assets/{navigation-targets-eUQMk9uD.js → navigation-targets-CW61_XIz.js} +1 -1
- package/dist/public/assets/{open-managed-artifact-tab-7RoXy4IS.js → open-managed-artifact-tab-BGW4m9f4.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-ByvpFZ2d.js → pending-receive-nav-store-9viWJ9VV.js} +1 -1
- package/dist/public/assets/{prop-types-CL1xIIwL.js → prop-types-BvMtVAeG.js} +1 -1
- package/dist/public/assets/{receive-store-DYKCLsPp.js → receive-store-B3-FInQ9.js} +1 -1
- package/dist/public/assets/{selection-context-BIE5_MkH.js → selection-context-CkCMxiY8.js} +1 -1
- package/dist/public/assets/skill-actions-6AAhO9zY.js +1 -0
- package/dist/public/assets/{skills-api-C_ShrZHV.js → skills-api-BhEjmNIn.js} +1 -1
- package/dist/public/assets/{src-DqYZW1sy.js → src-G334Yrxd.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-Ds095QOz.js → target-navigation-intent-oLHFF9_D.js} +1 -1
- package/dist/public/assets/typing-burst-detector-DBCESRMW.js +6 -0
- package/dist/public/assets/{use-apply-config-color-theme-x3LjnYOt.js → use-apply-config-color-theme-JH4tQfHA.js} +2 -2
- package/dist/public/assets/{workspace-paths-BY-2uufu.js → workspace-paths-DtvYoBMA.js} +1 -1
- package/dist/public/index.html +27 -27
- package/dist/{repair-launch-json-CgMAUaAY.mjs → repair-launch-json-CdPB4PAo.mjs} +2 -2
- package/dist/{repair-mcp-configs-BKQlAFB9.mjs → repair-mcp-configs-OwymJ26_.mjs} +2 -2
- package/dist/repair-skills-Drky8zkq.mjs +1 -0
- package/dist/{repair-skills-CFabpG6D.mjs → repair-skills-tJI8shk3.mjs} +2 -2
- package/dist/{src-CuYNuDEi.mjs → src-3qc3R4lD.mjs} +2 -2
- package/dist/{src-ddPUyd9u.mjs → src-BI8S8yWC.mjs} +301 -301
- package/dist/{src-CsJd4hD1.mjs → src-Z2z9ztGi.mjs} +1 -1
- package/dist/start-BnLtN72x.mjs +1 -0
- package/dist/{start-OtsNv252.mjs → start-CHvIBqjW.mjs} +2 -2
- package/dist/{write-project-skill-D59YsAqA.mjs → write-project-skill-Bg3yDMEj.mjs} +2 -2
- package/package.json +5 -5
- package/dist/constants-CcwGXqRZ.mjs +0 -2
- package/dist/init-D97Spx8d.mjs +0 -638
- package/dist/init-DQiXmAkQ.mjs +0 -1
- package/dist/loader-Bo77me0d.mjs +0 -1
- package/dist/preview-DgAWAvTf.mjs +0 -1
- package/dist/public/assets/CodeMirrorPropInput-FosFFMS2.js +0 -3
- package/dist/public/assets/PropertyPanel-DUAGh6oO.js +0 -2
- package/dist/public/assets/SkillEditorActions-Du4hCmH_.js +0 -1
- package/dist/public/assets/auth-state-cache-BriJQlFg.js +0 -11
- package/dist/public/assets/doc-hash-B3BQzSL7.js +0 -1
- package/dist/public/assets/index-F5i20SPk.css +0 -1
- package/dist/public/assets/lint-config-client-DcsqWOgs.js +0 -1
- package/dist/public/assets/skill-actions-Dispz1uc.js +0 -1
- package/dist/public/assets/typing-burst-detector-BcuHrVCs.js +0 -6
- package/dist/repair-skills-BuztBrD_.mjs +0 -1
- package/dist/start-t9AhW8gS.mjs +0 -1
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{i as e}from"./chunk-DseTPa7n.js";import{n as t,r as n,t as r}from"./compiler-runtime-DrcePeIl.js";import{n as i}from"./DocumentContext-s7Qfd8iz.js";import{n as a,r as o}from"./dist-CSDjUb5q.js";import{a as s,c,i as l,n as u,o as d,r as f,s as p,t as m,u as h}from"./panel-BGYdvxEm.js";import{n as g,t as _,u as v}from"./createLucideIcon-Wgamzz8_.js";import{n as y,r as b,t as x}from"./collapsible-UIgt0pSO.js";import{B as S,I as C}from"./CodeMirrorPropInput-DKUgIQit.js";import{n as w,t as T}from"./toggle-group-B30vKHKs.js";import{dt as E,mt as D,sr as O,zr as k}from"./dist-GfBYAWEU.js";import{t as A}from"./chevron-right-B2thM4kG.js";import{n as j,r as M}from"./CopyButton-B8lE78wK.js";import{i as ee}from"./prop-types-BvMtVAeG.js";import{l as N}from"./workspace-paths-DtvYoBMA.js";import{t as P}from"./refresh-cw-FMnveNBD.js";import{t as F}from"./triangle-alert-VZ_Cki-r.js";import{n as I}from"./dist-Qabe7wDM.js";import{t as L}from"./dist-o9cVHl8Q.js";import{i as R}from"./startup-marks-Dq0rZGD-.js";import{a as z,s as B}from"./doc-hash-BMXWNo_I.js";import{i as V,l as H,r as U}from"./lint-config-client-BGM5HIsf.js";var W=_(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),G=e(t(),1),K=r(),q=3e4,J=new Map;function Y(e){return e?Date.now()-e.rememberedAt>q?null:e.navigation:null}function te(e,t){J.set(e,{navigation:t,rememberedAt:Date.now()})}function X(e){return Y(J.get(e))}function Z(e){let t=J.get(e);return J.delete(e),Y(t)}function Q(e){J.delete(e)}function ne(e,t){let n=(0,K.c)(4),r=t===void 0?!1:t,[i,a]=(0,G.useState)(void 0),o=(0,G.useRef)(null),s,c;return n[0]!==r||n[1]!==e?(s=()=>{if(r||e.length===0){a(void 0);return}let t=function(){let t=window.innerHeight/2,n,r;for(let i of e){let e=document.getElementById(i);if(!e)continue;let a=e.getBoundingClientRect().top;a<0?n=i:r===void 0&&a<t&&(r=i)}a(r??n??e[0])},n=function(){o.current===null&&(o.current=requestAnimationFrame(()=>{o.current=null,t()}))};return document.addEventListener(`scroll`,n,{capture:!0,passive:!0}),t(),()=>{document.removeEventListener(`scroll`,n,{capture:!0}),o.current!==null&&(cancelAnimationFrame(o.current),o.current=null)}},c=[e,r],n[0]=r,n[1]=e,n[2]=s,n[3]=c):(s=n[2],c=n[3]),(0,G.useEffect)(s,c),i}var $=n(),re=300;async function ie(e){let t=await fetch(`/api/page-headings?docName=${encodeURIComponent(e)}`),n;try{n=await t.json()}catch(e){throw new S(L._({id:`qAQVSD`}),{cause:e,status:t.status})}if(!t.ok){let e=D.safeParse(n);throw e.success?Error(e.data.title):new S(L._({id:`zlErBl`}),{status:t.status})}let r=E.safeParse(n);if(!r.success)throw new S(L._({id:`XW18jo`}),{status:t.status});return r.data.headings??[]}var ae=32,oe=12,se=6,ce=`open-knowledge:outline-nav`;function le(e){let t=(0,K.c)(2),n;return t[0]===e?n=t[1]:(n=(0,$.jsx)(R,{name:`outline-panel`,children:(0,$.jsx)(ue,{...e})}),t[0]=e,t[1]=n),n}function ue(e){let t=(0,K.c)(50),{docName:n,isSourceMode:r,className:g}=e,_=g===void 0?``:g,{_:y}=o(),{pages:b,loading:x}=ee(),S=h(),{activeProvider:C,activeDocName:w}=i(),T,E;t[0]===n?(T=t[1],E=t[2]):(T=[`page-headings`,n],E=()=>ie(n),t[0]=n,t[1]=T,t[2]=E);let D;t[3]!==n||t[4]!==x||t[5]!==b?(D=!x&&(b.has(n)||O(n)),t[3]=n,t[4]=x,t[5]=b,t[6]=D):D=t[6];let k;t[7]!==T||t[8]!==E||t[9]!==D?(k={queryKey:T,queryFn:E,enabled:D,staleTime:1/0},t[7]=T,t[8]=E,t[9]=D,t[10]=k):k=t[10];let{data:A,isLoading:j,error:M}=c(k),N;t[11]===A?N=t[12]:(N=A===void 0?[]:A,t[11]=A,t[12]=N);let P=N,F,I;t[13]!==w||t[14]!==C||t[15]!==n||t[16]!==S?(F=()=>{if(!C||w!==n)return;let e=C.document,t=null,r=()=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{t=null,S.invalidateQueries({queryKey:[`page-headings`,n]})},re)};return e.on(`update`,r),()=>{e.off(`update`,r),t!==null&&clearTimeout(t)}},I=[C,w,n,S],t[13]=w,t[14]=C,t[15]=n,t[16]=S,t[17]=F,t[18]=I):(F=t[17],I=t[18]),(0,G.useEffect)(F,I);let L;t[19]===P?L=t[20]:(L=P.map(de),t[19]=P,t[20]=L);let R=ne(L,r),z;t[21]!==R||t[22]!==P?(z=R?P.findIndex(e=>e.slug===R):-1,t[21]=R,t[22]=P,t[23]=z):z=t[23];let B=z,V;t[24]!==n||t[25]!==r?(V=function(e,t){let i={index:e,slug:t,mode:r?`source`:`wysiwyg`};i.mode===`source`&&te(n,{kind:`outline`,detail:i}),window.dispatchEvent(new CustomEvent(ce,{detail:i}))},t[24]=n,t[25]=r,t[26]=V):V=t[26];let H=V,U=((B>=0?P[B].level:1)-1)*oe+(oe-se)/2,W=B*ae+(ae-se)/2,q;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,$.jsx)(p,{children:(0,$.jsx)(a,{id:`dD7NPy`})}),t[27]=q):q=t[27];let J;t[28]!==P.length||t[29]!==j?(J=!j&&(0,$.jsx)(f,{children:P.length}),t[28]=P.length,t[29]=j,t[30]=J):J=t[30];let Y;t[31]===J?Y=t[32]:(Y=(0,$.jsxs)(d,{children:[q,J]}),t[31]=J,t[32]=Y);let X;t[33]!==y||t[34]!==B||t[35]!==R||t[36]!==M||t[37]!==H||t[38]!==P||t[39]!==j||t[40]!==U||t[41]!==W?(X=M?(0,$.jsx)(s,{className:`px-2`,children:M instanceof Error?M.message:y({id:`GuqOb1`})}):P.length===0&&!j?(0,$.jsx)(l,{className:`px-2`,children:(0,$.jsx)(a,{id:`0BB9ID`})}):(0,$.jsxs)(`nav`,{"aria-label":y({id:`BymzO4`}),className:`relative`,children:[B>=0&&(0,$.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute left-0 top-0 rounded-full bg-primary motion-safe:[transition:transform_0.25s_var(--ease-out-strong)]`,style:{width:se,height:se,transform:`translate(${U}px, ${W}px)`}}),P.map((e,t)=>{let n=e.slug===R;return(0,$.jsx)(`button`,{type:`button`,"aria-current":n?`location`:void 0,onClick:()=>H(t,e.slug),className:v(`w-full cursor-pointer truncate py-1.5 pe-2 text-left text-sm transition-colors`,n?`font-medium text-primary`:`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${(e.level-1)*oe+20}px`},title:e.text,children:e.text},t)})]}),t[33]=y,t[34]=B,t[35]=R,t[36]=M,t[37]=H,t[38]=P,t[39]=j,t[40]=U,t[41]=W,t[42]=X):X=t[42];let Z;t[43]!==j||t[44]!==X?(Z=(0,$.jsx)(u,{className:`px-3 py-2`,"aria-busy":j,children:X}),t[43]=j,t[44]=X,t[45]=Z):Z=t[45];let Q;return t[46]!==_||t[47]!==Y||t[48]!==Z?(Q=(0,$.jsxs)(m,{className:_,children:[Y,Z]}),t[46]=_,t[47]=Y,t[48]=Z,t[49]=Q):Q=t[49],Q}function de(e){return e.slug}function fe(e){let t=(0,K.c)(10),{scope:n,onScopeChange:r}=e,{_:i}=o(),s;t[0]===r?s=t[1]:(s=e=>{e&&r(e)},t[0]=r,t[1]=s);let c;t[2]===i?c=t[3]:(c=i({id:`aBgwis`}),t[2]=i,t[3]=c);let l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsx)(w,{value:`doc`,className:`flex-1`,"data-testid":`panel-scope-doc`,children:(0,$.jsx)(a,{id:`UpCz01`})}),t[4]=l):l=t[4];let u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(w,{value:`project`,className:`flex-1`,"data-testid":`panel-scope-project`,children:(0,$.jsx)(a,{id:`e0NrBM`})}),t[5]=u):u=t[5];let d;return t[6]!==n||t[7]!==s||t[8]!==c?(d=(0,$.jsx)(`div`,{className:`shrink-0 px-4 pb-2`,children:(0,$.jsxs)(T,{type:`single`,variant:`segmented`,size:`sm`,spacing:1,value:n,onValueChange:s,"aria-label":c,className:`w-full rounded-md bg-muted p-0.5 dark:bg-background`,children:[l,u]})}),t[6]=n,t[7]=s,t[8]=c,t[9]=d):d=t[9],d}var pe=`open-knowledge:lint-nav`;function me(e,t){return e.range.start.line-t.range.start.line||e.range.start.character-t.range.start.character}function he(e){return{line:e.range.start.line+1,column:e.range.start.character+1}}function ge(e){let t=(0,K.c)(19),{diagnostic:n}=e,{_:r}=o(),i=n.severity===`error`?M:F,a=`${n.source}/${n.code}`,s=n.range.start.line+1,c=n.severity===`error`?`text-destructive`:`text-amber-500`,l;t[0]===c?l=t[1]:(l=v(`mt-0.5 size-3.5 shrink-0`,c),t[0]=c,t[1]=l);let u;t[2]!==i||t[3]!==l?(u=(0,$.jsx)(i,{"aria-hidden":`true`,className:l}),t[2]=i,t[3]=l,t[4]=u):u=t[4];let d;t[5]===n.message?d=t[6]:(d=(0,$.jsx)(`span`,{className:`text-foreground`,children:n.message}),t[5]=n.message,t[6]=d);let f;t[7]!==u||t[8]!==d?(f=(0,$.jsxs)(`span`,{className:`flex items-start gap-1.5 text-sm`,children:[u,d]}),t[7]=u,t[8]=d,t[9]=f):f=t[9];let p;t[10]!==r||t[11]!==s?(p=r({id:`enPTnx`,values:{displayLine:s}}),t[10]=r,t[11]=s,t[12]=p):p=t[12];let m;t[13]!==a||t[14]!==p?(m=(0,$.jsxs)(`span`,{className:`ps-5 font-mono text-xs text-muted-foreground`,children:[a,` · `,p]}),t[13]=a,t[14]=p,t[15]=m):m=t[15];let h;return t[16]!==f||t[17]!==m?(h=(0,$.jsxs)($.Fragment,{children:[f,m]}),t[16]=f,t[17]=m,t[18]=h):h=t[18],h}function _e(e){return`${e.source}/${e.code}-${e.range.start.line}-${e.range.start.character}-${e.message}`}function ve(e){return e.reduce((e,t)=>e+ +((t.fixes?.length??0)>0),0)}function ye(e){let t=(0,K.c)(13),{count:n,disabled:r,onClick:i,children:s}=e,{_:c}=o(),l;t[0]!==c||t[1]!==s||t[2]!==n?(l=s===void 0?c({id:`Izb10l`,values:{count:n}}):void 0,t[0]=c,t[1]=s,t[2]=n,t[3]=l):l=t[3];let u;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(W,{"aria-hidden":`true`,className:`size-3`}),t[4]=u):u=t[4];let d;t[5]!==s||t[6]!==n?(d=s??(0,$.jsx)(a,{id:`5_8TCr`,values:{count:n}}),t[5]=s,t[6]=n,t[7]=d):d=t[7];let f;return t[8]!==r||t[9]!==i||t[10]!==l||t[11]!==d?(f=(0,$.jsxs)(g,{size:`sm`,variant:`ghost`,className:`h-6 shrink-0 px-2 text-xs`,disabled:r,onClick:i,"aria-label":l,"data-testid":`problems-fix-all`,children:[u,d]}),t[8]=r,t[9]=i,t[10]=l,t[11]=d,t[12]=f):f=t[12],f}function be(e){let t=(0,K.c)(21),{docName:n,diagnostics:r,onFix:i,onFixAll:s,onAskAi:c}=e,{_:h}=o(),[_,v]=(0,G.useState)(`doc`),y;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(y={status:`idle`},t[0]=y):y=t[0];let[b,x]=(0,G.useState)(y),[S,C]=(0,G.useState)(null),w=(0,G.useRef)(!0),T,E;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(T=()=>(w.current=!0,()=>{w.current=!1}),E=[],t[1]=T,t[2]=E):(T=t[1],E=t[2]),(0,G.useEffect)(T,E);let D;if(t[3]!==h||t[4]!==b||t[5]!==r||t[6]!==n||t[7]!==c||t[8]!==i||t[9]!==s||t[10]!==S||t[11]!==_){let e=[...r].sort(me),o=async function(){x({status:`loading`});let e=await V();w.current&&x(e===null?{status:`failed`}:{status:`loaded`,result:e})},y=b.status===`loaded`?b.result.files.filter(Ce):[],T=async function(){if(S!==null||y.length===0)return;C({done:0,total:y.length});let e=[];for(let t of y){let n=await U(z(t.file));if(!w.current)return;n.ok||e.push({file:t.file,detail:n.errorDetail}),C(Se)}if(C(null),e.length>0){let t=e[0];I.error(h({id:`fru3T7`,values:{0:e.length,1:y.length}}),{description:t===void 0?void 0:`${t.file}${t.detail===null?``:` — ${t.detail}`}`})}try{await o()}catch{w.current&&x({status:`failed`})}},E=function(e){v(e),e===`project`&&b.status===`idle`&&o()},O;t[13]===n?O=t[14]:(O=function(e){let t=he(e);te(n,{kind:`lint`,detail:t}),window.dispatchEvent(new CustomEvent(pe,{detail:t}))},t[13]=n,t[14]=O);let k=O,A;t[15]!==n||t[16]!==k?(A=function(e,t){let r=z(e);if(r===n){k(t);return}te(r,{kind:`lint`,detail:he(t)}),window.location.hash=B(r)},t[15]=n,t[16]=k,t[17]=A):A=t[17];let j=A,M;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,$.jsx)(p,{children:(0,$.jsx)(a,{id:`OXdGnd`})}),t[18]=M):M=t[18];let ee=_===`doc`&&e.length>0&&(0,$.jsx)(f,{children:e.length}),P;t[19]===ee?P=t[20]:(P=(0,$.jsxs)(d,{children:[M,ee]}),t[19]=ee,t[20]=P),D=(0,$.jsxs)(m,{children:[P,(0,$.jsx)(fe,{scope:_,onScopeChange:E}),_===`doc`?(0,$.jsx)(u,{className:`px-2 py-2`,children:e.length===0?(0,$.jsx)(l,{className:`px-2`,children:(0,$.jsx)(a,{id:`ZI8uvA`})}):(0,$.jsxs)($.Fragment,{children:[s!==void 0&&(0,$.jsx)(`div`,{className:`flex items-center justify-end gap-2 px-2 pb-1`,children:(0,$.jsx)(ye,{count:ve(e),disabled:ve(e)===0,onClick:s})}),(0,$.jsx)(`ul`,{"aria-label":h({id:`OXdGnd`}),className:`flex flex-col gap-0.5`,children:e.map(e=>{let t=e.range.start.line+1,n=i!==void 0&&(e.fixes?.length??0)>0,r=`${e.source}/${e.code}`;return(0,$.jsxs)(`li`,{className:`group relative rounded transition-colors hover:bg-muted`,children:[(0,$.jsx)(`button`,{type:`button`,onClick:()=>k(e),className:`flex w-full cursor-pointer flex-col gap-0.5 rounded px-2 py-1.5 text-left`,title:h({id:`aHPdYV`,values:{displayLine:t}}),children:(0,$.jsx)(ge,{diagnostic:e})}),n||c!==void 0?(0,$.jsxs)(`div`,{className:`absolute bottom-1 right-1 flex items-center gap-1 rounded bg-muted opacity-0 transition-opacity focus-within:opacity-100 group-hover:opacity-100 motion-reduce:transition-none`,children:[n?(0,$.jsxs)(g,{size:`sm`,variant:`ghost`,className:`h-6 shrink-0 px-2 text-xs`,onClick:()=>i?.(e),"aria-label":h({id:`fZj9em`,values:{flatId:r}}),"data-testid":`problems-fix`,children:[(0,$.jsx)(W,{"aria-hidden":`true`,className:`size-3`}),(0,$.jsx)(a,{id:`c4fVUV`})]}):null,c===void 0?null:(0,$.jsxs)(g,{size:`sm`,variant:`ghost`,className:`h-6 shrink-0 px-2 text-xs`,onClick:()=>c(e),"aria-label":h({id:`hh4mVC`,values:{flatId:r}}),"data-testid":`problems-ask-ai`,children:[(0,$.jsx)(N,{"aria-hidden":`true`,className:`size-3`}),(0,$.jsx)(a,{id:`xWEvuo`})]})]}):null]},_e(e))})})]})}):(0,$.jsx)(Te,{audit:b,onRefresh:()=>void o(),onNavigate:j,fixableCount:y.reduce(xe,0),fixing:S,onFixAll:()=>void T()})]}),t[3]=h,t[4]=b,t[5]=r,t[6]=n,t[7]=c,t[8]=i,t[9]=s,t[10]=S,t[11]=_,t[12]=D}else D=t[12];return D}function xe(e,t){return e+ve(t.diagnostics)}function Se(e){return e===null?e:{...e,done:e.done+1}}function Ce(e){return e.diagnostics.some(we)}function we(e){return(e.fixes?.length??0)>0}function Te(e){let t=(0,K.c)(43),{audit:n,onRefresh:r,onNavigate:i,fixableCount:c,fixing:l,onFixAll:d}=e,{_:f}=o(),p=n.status===`loading`||n.status===`idle`,m;t[0]!==n.result||t[1]!==n.status?(m=n.status===`loaded`&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(a,{id:`DsDwR-`,values:{0:n.result.errorCount}}),` · `,(0,$.jsx)(a,{id:`W1SI2K`,values:{0:n.result.warningCount}})]}),t[0]=n.result,t[1]=n.status,t[2]=m):m=t[2];let h;t[3]===m?h=t[4]:(h=(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,"data-testid":`problems-audit-summary`,children:m}),t[3]=m,t[4]=h);let _;t[5]!==f||t[6]!==l?(_=l===null?null:(0,$.jsx)(`span`,{className:`sr-only`,role:`status`,children:f({id:`gZElfU`,values:{0:l.done,1:l.total}})}),t[5]=f,t[6]=l,t[7]=_):_=t[7];let v=p||l!==null||c===0,y;t[8]===l?y=t[9]:(y=l===null?void 0:(0,$.jsx)(a,{id:`S9t1PI`,values:{0:l.done,1:l.total}}),t[8]=l,t[9]=y);let b;t[10]!==c||t[11]!==d||t[12]!==v||t[13]!==y?(b=(0,$.jsx)(ye,{count:c,disabled:v,onClick:d,children:y}),t[10]=c,t[11]=d,t[12]=v,t[13]=y,t[14]=b):b=t[14];let x;t[15]===f?x=t[16]:(x=f({id:`WRdYfS`}),t[15]=f,t[16]=x);let S=p||l!==null,C;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,$.jsx)(P,{"aria-hidden":`true`,className:`size-3.5`}),t[17]=C):C=t[17];let w;t[18]!==r||t[19]!==x||t[20]!==S?(w=(0,$.jsx)(g,{variant:`ghost`,size:`icon`,className:`size-6 shrink-0 text-muted-foreground`,"aria-label":x,"data-testid":`problems-audit-refresh`,disabled:S,onClick:r,children:C}),t[18]=r,t[19]=x,t[20]=S,t[21]=w):w=t[21];let T;t[22]!==w||t[23]!==_||t[24]!==b?(T=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[_,b,w]}),t[22]=w,t[23]=_,t[24]=b,t[25]=T):T=t[25];let E;t[26]!==T||t[27]!==h?(E=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-2 pb-1`,children:[h,T]}),t[26]=T,t[27]=h,t[28]=E):E=t[28];let D;t[29]!==f||t[30]!==p?(D=p&&(0,$.jsx)(`div`,{className:`flex flex-col gap-1`,role:`status`,"aria-busy":`true`,"aria-label":f({id:`dx-TwN`}),children:[1,2,3].map(Ee)}),t[29]=f,t[30]=p,t[31]=D):D=t[31];let O;t[32]===n.status?O=t[33]:(O=n.status===`failed`&&(0,$.jsx)(s,{className:`px-2 text-xs`,children:(0,$.jsx)(a,{id:`IFezUv`})}),t[32]=n.status,t[33]=O);let k;t[34]!==n.result||t[35]!==n.status||t[36]!==i?(k=n.status===`loaded`&&(0,$.jsx)(De,{result:n.result,onNavigate:i}),t[34]=n.result,t[35]=n.status,t[36]=i,t[37]=k):k=t[37];let A;return t[38]!==E||t[39]!==D||t[40]!==O||t[41]!==k?(A=(0,$.jsxs)(u,{className:`px-2 py-2`,"data-testid":`problems-project-scope`,children:[E,D,O,k]}),t[38]=E,t[39]=D,t[40]=O,t[41]=k,t[42]=A):A=t[42],A}function Ee(e){return(0,$.jsxs)(`div`,{className:`flex items-start gap-2.5 rounded px-2 py-1.5`,children:[(0,$.jsx)(H,{className:`mt-0.5 size-3.5 shrink-0 rounded`}),(0,$.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,$.jsx)(H,{className:`h-3 w-28`}),(0,$.jsx)(H,{className:`h-3 w-40`})]})]},e)}function De(e){let t=(0,K.c)(10),{result:n,onNavigate:r}=e,{_:i}=o(),s;t[0]!==i||t[1]!==n.warnings?(s=n.warnings.length>0&&(0,$.jsx)(`ul`,{"aria-label":i({id:`Rsdhj9`}),className:`flex flex-col gap-0.5 pb-1`,children:n.warnings.map(Oe)}),t[0]=i,t[1]=n.warnings,t[2]=s):s=t[2];let c;t[3]!==r||t[4]!==n.fileCount||t[5]!==n.files?(c=n.files.length===0?(0,$.jsx)(l,{className:`px-2`,children:(0,$.jsx)(a,{id:`k_Dqw1`,values:{0:n.fileCount}})}):n.files.map(e=>(0,$.jsx)(ke,{file:e,onNavigate:r},e.file)),t[3]=r,t[4]=n.fileCount,t[5]=n.files,t[6]=c):c=t[6];let u;return t[7]!==s||t[8]!==c?(u=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[s,c]}),t[7]=s,t[8]=c,t[9]=u):u=t[9],u}function Oe(e,t){return(0,$.jsxs)(`li`,{className:`flex items-start gap-1.5 px-2 text-xs`,children:[(0,$.jsx)(F,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-amber-500`}),(0,$.jsx)(`span`,{className:`min-w-0 text-foreground`,children:e})]},`${t}-${e}`)}function ke(e){let t=(0,K.c)(37),{file:n,onNavigate:r}=e,{_:i}=o(),a,s,c,l,u,d,f,p,m;if(t[0]!==i||t[1]!==n.diagnostics||t[2]!==n.file||t[3]!==r){let e=[...n.diagnostics].sort(me);s=x,f=!0,p=`problems-audit-group`;let o;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(A,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground transition-transform group-data-[state=open]:rotate-90 motion-reduce:transition-none`}),t[13]=o):o=t[13];let h;t[14]===n.file?h=t[15]:(h=(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs text-foreground`,title:n.file,children:n.file}),t[14]=n.file,t[15]=h),m=(0,$.jsxs)(b,{className:`group flex w-full cursor-pointer items-center gap-1.5 rounded px-2 py-1.5 text-left transition-colors hover:bg-muted`,children:[o,h,(0,$.jsx)(j,{variant:`gray`,"data-testid":`problems-audit-file-count`,className:`shrink-0`,children:e.length})]}),a=y,d=`overflow-hidden data-[state=open]:animate-[collapsible-down_150ms_ease-out] data-[state=closed]:animate-[collapsible-up_150ms_ease-in]`,t[16]!==i||t[17]!==n.file?(c=i({id:`zAJzIg`,values:{0:n.file}}),t[16]=i,t[17]=n.file,t[18]=c):c=t[18],l=`flex flex-col gap-0.5 pb-1 ps-3`;let g;t[19]!==i||t[20]!==n.file||t[21]!==r?(g=e=>{let t=e.range.start.line+1;return(0,$.jsx)(`li`,{children:(0,$.jsx)(`button`,{type:`button`,onClick:()=>r(n.file,e),className:`flex w-full cursor-pointer flex-col gap-0.5 rounded px-2 py-1.5 text-left transition-colors hover:bg-muted`,title:i({id:`kDwcbW`,values:{0:n.file,displayLine:t}}),children:(0,$.jsx)(ge,{diagnostic:e})})},_e(e))},t[19]=i,t[20]=n.file,t[21]=r,t[22]=g):g=t[22],u=e.map(g),t[0]=i,t[1]=n.diagnostics,t[2]=n.file,t[3]=r,t[4]=a,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d,t[10]=f,t[11]=p,t[12]=m}else a=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12];let h;t[23]!==c||t[24]!==l||t[25]!==u?(h=(0,$.jsx)(`ul`,{"aria-label":c,className:l,children:u}),t[23]=c,t[24]=l,t[25]=u,t[26]=h):h=t[26];let g;t[27]!==a||t[28]!==d||t[29]!==h?(g=(0,$.jsx)(a,{className:d,children:h}),t[27]=a,t[28]=d,t[29]=h,t[30]=g):g=t[30];let _;return t[31]!==s||t[32]!==f||t[33]!==p||t[34]!==m||t[35]!==g?(_=(0,$.jsxs)(s,{defaultOpen:f,"data-testid":p,children:[m,g]}),t[31]=s,t[32]=f,t[33]=p,t[34]=m,t[35]=g,t[36]=_):_=t[36],_}var Ae={words:0,chars:0,tokens:0},je=/[ -〿-ゟ゠-ヿ㐀-䶿一-鿿豈---ក-]/,Me=/[\p{L}\p{N}]/u,Ne=new Set([`text`,`inlineCode`,`code`,`tag`]),Pe=new Set([`html`,`definition`,`footnoteDefinition`,`yaml`,`toml`,`image`,`imageReference`,`mdxFlowExpression`,`mdxTextExpression`,`mdxjsEsm`,`rawMdxFallback`,`rawMdxFallbackMdast`]),Fe=new Set([`paragraph`,`heading`,`blockquote`,`list`,`listItem`,`thematicBreak`,`table`,`tableRow`,`tableCell`,`mdxJsxFlowElement`,`commentBlock`]);function Ie(e,t){if(!e)return;let n=e.type;if(!Pe.has(n)){if(Ne.has(n)){e.value&&(t.push(e.value),n===`code`&&t.push(`
|
|
2
|
+
`));return}if(n===`wikiLink`||n===`wikiLinkEmbed`){let n=e.data?.alias??e.value??``;n&&t.push(n);return}if(Array.isArray(e.children)){for(let n of e.children)Ie(n,t);if(Fe.has(n)&&t.length>0){let e=t[t.length-1];e&&!e.endsWith(`
|
|
3
|
+
`)&&t.push(`
|
|
4
|
+
`)}}}}function Le(e){try{let t=C().parseToMdast(e),n=[];return Ie(t,n),n.join(``).trim()}catch(t){return console.warn(`[document-stats] mdast parse failed, falling back to raw text`,t),e.trim()}}function Re(e){if(!e)return 0;let t=0;for(let n of e.split(/\s+/))Me.test(n)&&t++;return t}function ze(e){let t=globalThis.Intl.Segmenter;if(!t)return Re(e);let n=new t(void 0,{granularity:`word`}),r=0;for(let t of n.segment(e))t.isWordLike&&r++;return r}function Be(e){let t=je.test(e)?1.5:4;return Math.ceil(e.length/t)}function Ve(e){return e?{words:je.test(e)?ze(e):Re(e),chars:e.length,tokens:Be(e)}:{words:0,chars:0,tokens:0}}function He(e){if(!e)return{words:0,chars:0,tokens:0};let{body:t}=k(e);return t.trim()?Ve(Le(t)):{words:0,chars:0,tokens:0}}function Ue(e,{isMarkdown:t}){let n=e.trim();return n?Ve(t?Le(e):n):Ae}var We=new Map,Ge=new Set,Ke=(e,t)=>`${t}:${e}`;function qe(){for(let e of Ge)e()}function Je(e,t,n){let r=Ke(e,t);if(n===null){We.delete(r)&&qe();return}let i=We.get(r);i&&i.words===n.words&&i.chars===n.chars&&i.tokens===n.tokens||(We.set(r,n),qe())}function Ye(e,t){return e===null?null:We.get(Ke(e,t))??null}function Xe(e){return Ge.add(e),()=>{Ge.delete(e)}}function Ze(e){let{from:t,to:n,empty:r}=e.state.selection;if(r)return null;let i=e.state.doc.textBetween(t,n,`
|
|
5
|
+
`,` `);return i.trim()?Ue(i,{isMarkdown:!1}):null}function Qe(e){let t=[];for(let n of e.state.selection.ranges)n.empty||t.push(e.state.sliceDoc(n.from,n.to));if(t.length===0)return null;let n=t.join(`
|
|
6
|
+
`);return n.trim()?Ue(n,{isMarkdown:!0}):null}export{Xe as a,pe as c,le as d,Q as f,te as h,Ze as i,be as l,X as m,Je as n,Ae as o,Z as p,Qe as r,He as s,Ye as t,ce as u};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{i as e}from"./chunk-DseTPa7n.js";import{n as t,t as n}from"./compiler-runtime-DrcePeIl.js";import{
|
|
2
|
-
`)}\n}`}var g=`ok-color-theme-v1`,_=`ok-custom-theme-v1`,v=`data-color-theme`,y=`ok-custom-theme`;function b(e){let t=document.getElementById(y);t||(t=document.createElement(`style`),t.id=y,document.head.appendChild(t)),t.textContent!==e&&(t.textContent=e)}function x(){document.getElementById(y)?.remove()}function S(e,t,n=!0){if(typeof document>`u`)return;let i
|
|
1
|
+
import{i as e}from"./chunk-DseTPa7n.js";import{n as t,t as n}from"./compiler-runtime-DrcePeIl.js";import{ca as r,ga as i}from"./dist-GfBYAWEU.js";var a=e(t(),1),o=n(),s=/^#[0-9a-fA-F]{6}$/,c={background:`#0f172a`,surface:`#1e293b`,foreground:`#e2e8f0`,primary:`#6366f1`,accent:`#22d3ee`,border:`#334155`};function l(e){return typeof e==`string`&&s.test(e)}function u(e){let t={...c};if(e)for(let n of Object.keys(c)){let r=e[n];l(r)&&(t[n]=r)}return t}function d(e){let t=l(e)?e:`#000000`,n=e=>{let n=Number.parseInt(t.slice(1+e*2,3+e*2),16)/255;return n<=.03928?n/12.92:((n+.055)/1.055)**2.4};return .2126*n(0)+.7152*n(1)+.0722*n(2)}function f(e){return d(e.background)<.5?`dark`:`light`}function p(e){return d(e)<.5?`#ffffff`:`#0a0a0a`}function m(e){return{bg:e.background,bgElevated:e.surface,bgSubtle:e.surface,fg:e.foreground,fgMuted:`color-mix(in oklab, ${e.foreground} 55%, ${e.background})`,border:e.border,primary:e.primary,primaryFg:p(e.primary),red:`#e5534b`,green:`#3fb950`,yellow:`#d29922`,blue:e.accent,cyan:e.accent,orange:`#db8d3f`,purple:e.accent}}function h(e){let t=r(m(e)),n=Object.entries(t).map(([e,t])=>` --${e}: ${t};`);return`html[data-color-theme="custom"] {\n color-scheme: ${f(e)};\n${n.join(`
|
|
2
|
+
`)}\n}`}var g=`ok-color-theme-v1`,_=`ok-custom-theme-v1`,v=`data-color-theme`,y=`ok-custom-theme`;function b(e){let t=document.getElementById(y);t||(t=document.createElement(`style`),t.id=y,document.head.appendChild(t)),t.textContent!==e&&(t.textContent=e)}function x(){document.getElementById(y)?.remove()}function S(e,t,n=!0){if(typeof document>`u`)return;let r=i(n?e:`default`),a=document.documentElement;r.id===`default`?a.removeAttribute(v):a.setAttribute(v,r.id);let o=null;if(r.id===`custom`){let e=u(t),n=h(e);b(n),o=JSON.stringify({css:n,dark:f(e)===`dark`})}else x();try{r.id===`default`?localStorage.removeItem(g):localStorage.setItem(g,r.id),o?localStorage.setItem(_,o):localStorage.removeItem(_)}catch{}}function C(e,t,n){let r=(0,o.c)(12),i=n===void 0?!0:n,s;r[0]!==e||r[1]!==t||r[2]!==i?(s=i&&e===`custom`?JSON.stringify(t??null):``,r[0]=e,r[1]=t,r[2]=i,r[3]=s):s=r[3];let c=s,l;r[4]!==e||r[5]!==t||r[6]!==i?(l=()=>{S(e,t,i)},r[4]=e,r[5]=t,r[6]=i,r[7]=l):l=r[7];let u;r[8]!==e||r[9]!==i||r[10]!==c?(u=[e,c,i],r[8]=e,r[9]=i,r[10]=c,r[11]=u):u=r[11],(0,a.useEffect)(l,u)}export{f as a,u as c,c as i,S as n,m as o,C as r,l as s,v as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./chunk-DseTPa7n.js";import{n as t}from"./compiler-runtime-DrcePeIl.js";import{r as n}from"./dist-CSDjUb5q.js";import{t as r}from"./createLucideIcon-Wgamzz8_.js";import{
|
|
1
|
+
import{i as e}from"./chunk-DseTPa7n.js";import{n as t}from"./compiler-runtime-DrcePeIl.js";import{r as n}from"./dist-CSDjUb5q.js";import{t as r}from"./createLucideIcon-Wgamzz8_.js";import{wn as i}from"./dist-GfBYAWEU.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'); })();</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-BgzB1Mj8.js"></script>
|
|
62
62
|
<link rel="modulepreload" crossorigin href="./assets/chunk-DseTPa7n.js">
|
|
63
63
|
<link rel="modulepreload" crossorigin href="./assets/preload-helper-2ej06EnG.js">
|
|
64
64
|
<link rel="modulepreload" crossorigin href="./assets/w3c-keyname-CRPBoZED.js">
|
|
@@ -75,12 +75,12 @@
|
|
|
75
75
|
<link rel="modulepreload" crossorigin href="./assets/floating-ui.dom-B3TJy2Tg.js">
|
|
76
76
|
<link rel="modulepreload" crossorigin href="./assets/trace-api-BIWqyPc9.js">
|
|
77
77
|
<link rel="modulepreload" crossorigin href="./assets/markdownit-DyWy6cMj.js">
|
|
78
|
-
<link rel="modulepreload" crossorigin href="./assets/dist-
|
|
78
|
+
<link rel="modulepreload" crossorigin href="./assets/dist-GfBYAWEU.js">
|
|
79
79
|
<link rel="modulepreload" crossorigin href="./assets/compiler-runtime-DrcePeIl.js">
|
|
80
80
|
<link rel="modulepreload" crossorigin href="./assets/dist-DGbq0bSp.js">
|
|
81
|
-
<link rel="modulepreload" crossorigin href="./assets/use-apply-config-color-theme-
|
|
81
|
+
<link rel="modulepreload" crossorigin href="./assets/use-apply-config-color-theme-JH4tQfHA.js">
|
|
82
82
|
<link rel="modulepreload" crossorigin href="./assets/config-context-BbS_JaHs.js">
|
|
83
|
-
<link rel="modulepreload" crossorigin href="./assets/config-provider-
|
|
83
|
+
<link rel="modulepreload" crossorigin href="./assets/config-provider-CBrCc3Qp.js">
|
|
84
84
|
<link rel="modulepreload" crossorigin href="./assets/dist-o9cVHl8Q.js">
|
|
85
85
|
<link rel="modulepreload" crossorigin href="./assets/dist-CSDjUb5q.js">
|
|
86
86
|
<link rel="modulepreload" crossorigin href="./assets/createLucideIcon-Wgamzz8_.js">
|
|
@@ -88,15 +88,15 @@
|
|
|
88
88
|
<link rel="modulepreload" crossorigin href="./assets/trash-2-Cgf308yS.js">
|
|
89
89
|
<link rel="modulepreload" crossorigin href="./assets/triangle-alert-VZ_Cki-r.js">
|
|
90
90
|
<link rel="modulepreload" crossorigin href="./assets/react-dom-CMNLH3L-.js">
|
|
91
|
-
<link rel="modulepreload" crossorigin href="./assets/doc-hash-
|
|
92
|
-
<link rel="modulepreload" crossorigin href="./assets/navigation-targets-
|
|
91
|
+
<link rel="modulepreload" crossorigin href="./assets/doc-hash-BMXWNo_I.js">
|
|
92
|
+
<link rel="modulepreload" crossorigin href="./assets/navigation-targets-CW61_XIz.js">
|
|
93
93
|
<link rel="modulepreload" crossorigin href="./assets/external-link-BfiFPJEx.js">
|
|
94
94
|
<link rel="modulepreload" crossorigin href="./assets/documents-fetch-YrVYNlaU.js">
|
|
95
|
-
<link rel="modulepreload" crossorigin href="./assets/CodeMirrorPropInput-
|
|
96
|
-
<link rel="modulepreload" crossorigin href="./assets/dist-
|
|
97
|
-
<link rel="modulepreload" crossorigin href="./assets/documents-events-
|
|
95
|
+
<link rel="modulepreload" crossorigin href="./assets/CodeMirrorPropInput-DKUgIQit.js">
|
|
96
|
+
<link rel="modulepreload" crossorigin href="./assets/dist-Cub6hBx7.js">
|
|
97
|
+
<link rel="modulepreload" crossorigin href="./assets/documents-events-DJ1GG23v.js">
|
|
98
98
|
<link rel="modulepreload" crossorigin href="./assets/parse-api-error-BcfaIWfX.js">
|
|
99
|
-
<link rel="modulepreload" crossorigin href="./assets/open-managed-artifact-tab-
|
|
99
|
+
<link rel="modulepreload" crossorigin href="./assets/open-managed-artifact-tab-BGW4m9f4.js">
|
|
100
100
|
<link rel="modulepreload" crossorigin href="./assets/dist-DivkR5AO.js">
|
|
101
101
|
<link rel="modulepreload" crossorigin href="./assets/dist-DGkUVO6K.js">
|
|
102
102
|
<link rel="modulepreload" crossorigin href="./assets/propagation-api-M_AcuP6N.js">
|
|
@@ -113,47 +113,47 @@
|
|
|
113
113
|
<link rel="modulepreload" crossorigin href="./assets/copy-CfDOH9N1.js">
|
|
114
114
|
<link rel="modulepreload" crossorigin href="./assets/CopyButton-B8lE78wK.js">
|
|
115
115
|
<link rel="modulepreload" crossorigin href="./assets/startup-marks-Dq0rZGD-.js">
|
|
116
|
-
<link rel="modulepreload" crossorigin href="./assets/prop-types-
|
|
117
|
-
<link rel="modulepreload" crossorigin href="./assets/workspace-paths-
|
|
116
|
+
<link rel="modulepreload" crossorigin href="./assets/prop-types-BvMtVAeG.js">
|
|
117
|
+
<link rel="modulepreload" crossorigin href="./assets/workspace-paths-DtvYoBMA.js">
|
|
118
118
|
<link rel="modulepreload" crossorigin href="./assets/eye-Cq1_8-Tk.js">
|
|
119
119
|
<link rel="modulepreload" crossorigin href="./assets/info-CVuSDi5Y.js">
|
|
120
120
|
<link rel="modulepreload" crossorigin href="./assets/loader-circle-BrJhrTc7.js">
|
|
121
121
|
<link rel="modulepreload" crossorigin href="./assets/dist-Qabe7wDM.js">
|
|
122
122
|
<link rel="modulepreload" crossorigin href="./assets/file-tree-rename-validation-DgUQ0I0S.js">
|
|
123
123
|
<link rel="modulepreload" crossorigin href="./assets/input-BX4UDDMJ.js">
|
|
124
|
-
<link rel="modulepreload" crossorigin href="./assets/DocumentContext-
|
|
124
|
+
<link rel="modulepreload" crossorigin href="./assets/DocumentContext-s7Qfd8iz.js">
|
|
125
125
|
<link rel="modulepreload" crossorigin href="./assets/checkbox-Ds7GA0j4.js">
|
|
126
126
|
<link rel="modulepreload" crossorigin href="./assets/dist-Ly1ZfY-Y.js">
|
|
127
|
-
<link rel="modulepreload" crossorigin href="./assets/skills-api-
|
|
127
|
+
<link rel="modulepreload" crossorigin href="./assets/skills-api-BhEjmNIn.js">
|
|
128
128
|
<link rel="modulepreload" crossorigin href="./assets/label-CveCqKNR.js">
|
|
129
129
|
<link rel="modulepreload" crossorigin href="./assets/radio-group-D9Wp487Q.js">
|
|
130
|
-
<link rel="modulepreload" crossorigin href="./assets/EnableSyncConfirmDialog-
|
|
130
|
+
<link rel="modulepreload" crossorigin href="./assets/EnableSyncConfirmDialog-BFsmDIV-.js">
|
|
131
131
|
<link rel="modulepreload" crossorigin href="./assets/arrow-up-right-BnJZWj8r.js">
|
|
132
132
|
<link rel="modulepreload" crossorigin href="./assets/refresh-cw-FMnveNBD.js">
|
|
133
133
|
<link rel="modulepreload" crossorigin href="./assets/cursor-Rw-XIAht.js">
|
|
134
134
|
<link rel="modulepreload" crossorigin href="./assets/clipboard-adapter-BHfhAZ-n.js">
|
|
135
|
-
<link rel="modulepreload" crossorigin href="./assets/skill-actions-
|
|
136
|
-
<link rel="modulepreload" crossorigin href="./assets/lint-config-client-
|
|
135
|
+
<link rel="modulepreload" crossorigin href="./assets/skill-actions-6AAhO9zY.js">
|
|
136
|
+
<link rel="modulepreload" crossorigin href="./assets/lint-config-client-BGM5HIsf.js">
|
|
137
137
|
<link rel="modulepreload" crossorigin href="./assets/textarea--26Ac0EI.js">
|
|
138
|
-
<link rel="modulepreload" crossorigin href="./assets/auth-state-cache-
|
|
138
|
+
<link rel="modulepreload" crossorigin href="./assets/auth-state-cache-DebyEMGy.js">
|
|
139
139
|
<link rel="modulepreload" crossorigin href="./assets/toggle-group-B30vKHKs.js">
|
|
140
140
|
<link rel="modulepreload" crossorigin href="./assets/panel-BGYdvxEm.js">
|
|
141
141
|
<link rel="modulepreload" crossorigin href="./assets/format-DJS8_tfZ.js">
|
|
142
|
-
<link rel="modulepreload" crossorigin href="./assets/selection-context-
|
|
143
|
-
<link rel="modulepreload" crossorigin href="./assets/PropertyPanel-
|
|
142
|
+
<link rel="modulepreload" crossorigin href="./assets/selection-context-CkCMxiY8.js">
|
|
143
|
+
<link rel="modulepreload" crossorigin href="./assets/PropertyPanel-Dnh_rOsE.js">
|
|
144
144
|
<link rel="modulepreload" crossorigin href="./assets/miss-dialog-store-b0Uwu1ZT.js">
|
|
145
|
-
<link rel="modulepreload" crossorigin href="./assets/pending-receive-nav-store-
|
|
145
|
+
<link rel="modulepreload" crossorigin href="./assets/pending-receive-nav-store-9viWJ9VV.js">
|
|
146
146
|
<link rel="modulepreload" crossorigin href="./assets/chevron-left-rxhGFFOu.js">
|
|
147
|
-
<link rel="modulepreload" crossorigin href="./assets/agent-presence-
|
|
148
|
-
<link rel="modulepreload" crossorigin href="./assets/typing-burst-detector-
|
|
147
|
+
<link rel="modulepreload" crossorigin href="./assets/agent-presence-CTUYlsSf.js">
|
|
148
|
+
<link rel="modulepreload" crossorigin href="./assets/typing-burst-detector-DBCESRMW.js">
|
|
149
149
|
<link rel="modulepreload" crossorigin href="./assets/project-paths-DJDWBB-8.js">
|
|
150
|
-
<link rel="modulepreload" crossorigin href="./assets/file-tree-adapter-
|
|
151
|
-
<link rel="modulepreload" crossorigin href="./assets/target-navigation-intent-
|
|
150
|
+
<link rel="modulepreload" crossorigin href="./assets/file-tree-adapter-DDhSPjxf.js">
|
|
151
|
+
<link rel="modulepreload" crossorigin href="./assets/target-navigation-intent-oLHFF9_D.js">
|
|
152
152
|
<link rel="modulepreload" crossorigin href="./assets/mcp-consent-store-O7e02Mi1.js">
|
|
153
|
-
<link rel="modulepreload" crossorigin href="./assets/receive-store-
|
|
153
|
+
<link rel="modulepreload" crossorigin href="./assets/receive-store-B3-FInQ9.js">
|
|
154
154
|
<link rel="modulepreload" crossorigin href="./assets/worktree-store-DFmh2OE1.js">
|
|
155
155
|
<link rel="stylesheet" crossorigin href="./assets/DocumentContext-B0sQn39F.css">
|
|
156
|
-
<link rel="stylesheet" crossorigin href="./assets/index-
|
|
156
|
+
<link rel="stylesheet" crossorigin href="./assets/index-Zwl7lo8a.css">
|
|
157
157
|
</head>
|
|
158
158
|
|
|
159
159
|
<body class="antialiased">
|
|
@@ -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-CP7Ar6Ob.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-CdPB4PAo.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as e,v as t}from"./init-
|
|
2
|
-
//# sourceMappingURL=repair-mcp-configs-
|
|
1
|
+
import{d as e,v as t}from"./init-Djn0N_zk.mjs";import{_ as n,d as r,s as i}from"./write-project-skill-Bg3yDMEj.mjs";import{t as a}from"./mcp-migrate-event-C35ikoh2.mjs";import{homedir as o}from"node:os";function s(e){let t=e.logger??u,n=e.home??o(),a=[];if(e.reclaimDisableEnv===`1`)return t({event:`mcp-config-repair-skipped`,reason:`reclaim-disabled`}),{outcomes:a,repairedCount:0};for(let o of i){let i=r[o],s=c(()=>i.configPath(``,n));if(s!==null&&a.push(l({scope:`user`,editorId:o,target:i,home:n,cwd:``,configPath:s,configPathOverride:void 0,logger:t})),i.projectConfigPath){let n=i.projectConfigPath,r=c(()=>n(e.projectDir));r!==null&&a.push(l({scope:`project`,editorId:o,target:i,home:void 0,cwd:e.projectDir,configPath:r,configPathOverride:r,logger:t}))}}return{outcomes:a,repairedCount:a.filter(e=>e.outcome===`repaired`).length}}function c(e){try{return e()}catch{return null}}function l(r){let i={scope:r.scope,editorId:r.editorId,configPath:r.configPath},o=e(r.target,r.cwd,r.home,r.configPathOverride);if(o===null)return{...i,outcome:`no-entry`};if(n(o))return{...i,outcome:`canonical`};r.logger(a({scope:r.scope,surface:`cli-repair`,editorId:r.editorId,configPath:r.configPath,priorEntry:o}));let s=t(r.target,r.cwd,{mode:`published`,skipAvailabilityCheck:!0},r.home,r.configPathOverride);if(s.action===`failed`){let e=s.error??`unknown write failure`;return r.logger({event:`mcp-config-repair-write-failed`,scope:r.scope,editorId:r.editorId,configPath:r.configPath,error:e}),{...i,outcome:`write-failed`,error:e}}return s.action===`declined`?(r.logger({event:`mcp-config-repair-declined`,scope:r.scope,editorId:r.editorId,configPath:r.configPath,reason:s.declineReason}),{...i,outcome:`declined`}):{...i,outcome:`repaired`}}function u(e){process.stderr.write(`${JSON.stringify(e)}\n`)}export{s as repairMcpConfigs};
|
|
2
|
+
//# sourceMappingURL=repair-mcp-configs-OwymJ26_.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./repair-skills-tJI8shk3.mjs";export{e as repairSkills};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{S as e}from"./src-CFHcsBtV.mjs";import{An as t,Bn as n,Dn as r,En as i,In as a,Mn as o,Pn as s,Vn as c,jn as l}from"./src-
|
|
1
|
+
import{S as e}from"./src-CFHcsBtV.mjs";import{An as t,Bn as n,Dn as r,En as i,In as a,Mn as o,Pn as s,Vn as c,jn as l}from"./src-BI8S8yWC.mjs";import{t as u}from"./esm-EvSEzE_V.mjs";import{a as d,d as f,f as p,t as m}from"./write-project-skill-Bg3yDMEj.mjs";import{dirname as h,join as g,resolve as _}from"node:path";import{existsSync as v,mkdirSync as y,readFileSync as b,readdirSync as x,rmSync as S,statSync as C,writeFileSync as w}from"node:fs";import{homedir as T}from"node:os";const E={existsSync:e=>v(e),isDirectory:e=>{try{return C(e).isDirectory()}catch(e){if(e.code===`ENOENT`)return!1;throw e}},readdirSync:e=>x(e),readFileSync:e=>b(e),writeFileSync:(e,t)=>{w(e,t)},mkdirSync:(e,t)=>{y(e,t)},rmSync:(e,t)=>{S(e,t)}},D={resolveProjectBundledSkillDir:()=>a(`project`,{checkDesktop:!1}),resolveUserBundledSkillDir:e=>a(e,{checkDesktop:!1}),readBundledVersion:()=>r(),readRecordedVersion:e=>t(e,`cli-hosts`),writeRecordedVersion:(e,t)=>o(e,`cli-hosts`,t,`cli-start`),recordEvent:e=>s(e),readBundleDecision:(e,t)=>i(e,t),writeBundleDecision:(e,t,n)=>l(e,t,n),removeBundleFromDisk:(e,t)=>d(e,t)};function O(e){process.stderr.write(`${JSON.stringify(e)}\n`)}function k(e,t,n){n.rmSync(t,{recursive:!0,force:!0}),n.mkdirSync(h(t),{recursive:!0}),A(e,t,n)}function A(e,t,n){n.mkdirSync(t,{recursive:!0});for(let r of n.readdirSync(e)){let i=g(e,r),a=g(t,r);n.isDirectory(i)?A(i,a,n):n.writeFileSync(a,n.readFileSync(i))}}function j(e,t,n,r,i,a){let o=[],s=g(e,`.agents`,`skills`,t),c=r.existsSync(s),l=!1;try{k(n,s,r),l=!0,o.push({kind:`central`,path:s,outcome:c?`overwritten`:`written`}),i({event:`user-skill-reclaim-central-written`,scope:`user`,path:s,preexisting:c,version:a})}catch(e){let t=e instanceof Error?e.message:String(e);o.push({kind:`central`,path:s,outcome:`failed`,error:t}),i({event:`user-skill-reclaim-central-failed`,scope:`user`,path:s,error:t})}for(let c of p){let l=g(e,c.hostDir),u=g(l,`skills`,t);if(u===s){o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:`skipped-collapsed-with-central`});continue}if(!r.existsSync(l)){o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:`skipped-host-absent`});continue}let d=r.existsSync(u);try{k(n,u,r),o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:d?`overwritten`:`written`}),i({event:`user-skill-reclaim-host-written`,scope:`user`,editorId:c.editorId,hostDir:c.hostDir,path:u,preexisting:d,version:a})}catch(e){let t=e instanceof Error?e.message:String(e);o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:`failed`,error:t}),i({event:`user-skill-reclaim-host-failed`,scope:`user`,editorId:c.editorId,hostDir:c.hostDir,path:u,error:t})}}return{entries:o,centralWritten:l}}function M(e,t){if(!e)return!1;try{if(!t.existsSync(e))return!1;let n=t.readFileSync(e).toString(`utf8`);return n.includes(`# ok-mcp-v1`)||n.includes(`# ok-mcp-win-v1`)}catch{return!1}}function N(e,t,n,r){let i;try{i=t.resolveProjectBundledSkillDir()}catch(e){return r({event:`project-skill-reclaim-bundle-missing`,scope:`project`,error:e instanceof Error?e.message:String(e)}),{outcome:`skipped`,reason:`bundle-missing`}}let a=[];for(let t of p){let o=g(e,t.hostDir,`skills`,`open-knowledge`),s=g(o,`SKILL.md`),c=n.existsSync(s),l=f[t.editorId]?.projectConfigPath?.(e),u=!c&&M(l,n);if(!c&&!u){a.push({editorId:t.editorId,hostDir:t.hostDir,path:o,outcome:`no-token`}),r({event:`project-skill-reclaim-no-token`,scope:`project`,editorId:t.editorId,path:o});continue}try{m(o,e),k(i,o,n);let s=c?`reclaimed`:`created`;a.push({editorId:t.editorId,hostDir:t.hostDir,path:o,outcome:s}),r({event:c?`project-skill-reclaim-reclaimed`:`project-skill-reclaim-created`,scope:`project`,editorId:t.editorId,path:o})}catch(e){let n=e instanceof Error?e.message:String(e);a.push({editorId:t.editorId,hostDir:t.hostDir,path:o,outcome:`failed`,error:n}),r({event:`project-skill-reclaim-failed`,scope:`project`,editorId:t.editorId,path:o,error:n})}}return{outcome:`done`,entries:a}}async function P(t,r,i,a){let o=e=>{r.recordEvent(e).catch(()=>{})},s=()=>new Date().toISOString(),l;try{l=await r.readBundledVersion()}catch(e){let t=e instanceof Error?e.message:String(e);return a({event:`user-skill-reclaim-version-read-failed`,scope:`user`,error:t}),o({ts:s(),surface:`cli-start`,target:`cli-hosts`,bundle:`discovery`,outcome:`failed`,reason:`version-read-failed:${t}`}),{outcome:`skipped`,reason:`version-read-failed`}}let u;try{u=await r.readRecordedVersion(t)}catch(e){a({event:`user-skill-reclaim-version-read-error`,scope:`user`,error:e instanceof Error?e.message:String(e)}),u=null}let d=[],f=null;for(let e of c)try{d.push({id:e,sourceDir:r.resolveUserBundledSkillDir(e)})}catch(e){f=e instanceof Error?e.message:String(e)}if(d.length===0)return a({event:`user-skill-reclaim-bundle-missing`,scope:`user`,error:f??`no user-global bundles`}),o({ts:s(),surface:`cli-start`,target:`cli-hosts`,outcome:`failed`,reason:`bundle-missing:${f}`}),{outcome:`skipped`,reason:`bundle-missing`};let p=[];for(let o of d){let s=n[o.id],c=i.existsSync(g(t,`.agents`,`skills`,s)),l=await r.readBundleDecision(t,s).catch(()=>null);if(!e(l,{installedOnDisk:c})){if(c)try{r.removeBundleFromDisk(t,o.id),a({event:`user-skill-reclaim-bundle-declined-removed`,scope:`user`,bundle:o.id})}catch(e){a({event:`user-skill-reclaim-bundle-remove-failed`,scope:`user`,bundle:o.id,error:e instanceof Error?e.message:String(e)})}continue}if(l===null&&c)try{await r.writeBundleDecision(t,s,!0)}catch(e){a({event:`user-skill-reclaim-grandfather-write-failed`,scope:`user`,bundle:o.id,error:e instanceof Error?e.message:String(e)})}p.push(o)}if(p.length===0)return{outcome:`skipped`,reason:`all-bundles-declined`};let m=p.every(e=>i.existsSync(g(t,`.agents`,`skills`,n[e.id])));if(u!==null&&u===l&&m)return a({event:`user-skill-reclaim-skipped-version-current`,scope:`user`,version:l}),{outcome:`skipped`,reason:`version-current`};let h=[],_=d.length===c.length,v=!0;for(let{id:e,sourceDir:r}of p){let o=j(t,n[e],r,i,a,l);h.push(...o.entries),o.centralWritten||(v=!1)}let y=h.some(e=>e.kind===`central`&&(e.outcome===`written`||e.outcome===`overwritten`));if(_&&v&&y){let e=null;try{await r.writeRecordedVersion(t,l),a({event:`user-skill-reclaim-version-recorded`,scope:`user`,version:l})}catch(t){e=t instanceof Error?t.message:String(t),a({event:`user-skill-reclaim-version-record-failed`,scope:`user`,version:l,error:e})}for(let{id:t}of p)o({ts:s(),surface:`cli-start`,target:`cli-hosts`,bundle:t,outcome:e===null?`installed`:`failed`,version:l,...e===null?{}:{reason:`state-write-failed:${e}`}})}else{let e=h.some(e=>e.kind===`host`&&e.outcome===`failed`);o({ts:s(),surface:`cli-start`,target:`cli-hosts`,outcome:`failed`,version:l,reason:e?`all-writes-failed`:`no-hosts-installed`})}return{outcome:`done`,version:l,entries:h}}async function F(e){let t=e.logger??O,n=e.fs??E,r=e.home??T(),i={...D,...e.deps};return e.reclaimDisableEnv===`1`?(t({event:`skill-repair-skipped`,reason:`reclaim-disabled`}),{status:`skipped`,reason:`reclaim-disabled`}):{status:`done`,project:N(e.projectDir,i,n,t),user:await P(r,i,n,t)}}function I(e){return e.status===`skipped`?e.reason===`reclaim-disabled`?0:1:e.project.outcome===`skipped`||e.user.outcome===`skipped`&&e.user.reason!==`version-current`&&e.user.reason!==`all-bundles-declined`||e.project.entries.some(e=>e.outcome===`failed`)||e.user.outcome===`done`&&e.user.entries.some(e=>e.outcome===`failed`)?1:0}function L(e){if(e.status===`skipped`)return`Skipped: ${e.reason}`;let t=[`Skill reclaim complete.`];if(e.project.outcome===`done`){let n=e.project.entries.filter(e=>e.outcome===`reclaimed`).length,r=e.project.entries.filter(e=>e.outcome===`created`).length,i=e.project.entries.filter(e=>e.outcome===`no-token`).length,a=e.project.entries.filter(e=>e.outcome===`failed`).length;t.push(` Project: ${n} reclaimed, ${r} created, ${i} no-token, ${a} failed.`)}else t.push(` Project: skipped (${e.project.reason}).`);if(e.user.outcome===`done`){let n=e.user.entries.filter(e=>e.outcome===`written`||e.outcome===`overwritten`).length,r=e.user.entries.filter(e=>e.outcome===`skipped-host-absent`||e.outcome===`skipped-collapsed-with-central`).length,i=e.user.entries.filter(e=>e.outcome===`failed`).length;t.push(` User (${e.user.version}): ${n} written, ${r} skipped, ${i} failed.`)}else t.push(` User: skipped (${e.user.reason}).`);return t.join(`
|
|
2
2
|
`)}function R(){return new u(`repair-skills`).description("Refresh bundled SKILL.md files for installed AI editors (project-local + user-global). Runs automatically during `ok start`; this command forces an explicit sweep.").action(async()=>{let e=await F({projectDir:_(process.cwd()),reclaimDisableEnv:process.env.OK_RECLAIM_DISABLE??null});process.stdout.write(`${L(e)}\n`),process.exitCode=I(e)})}export{R as n,F as t};
|
|
3
|
-
//# sourceMappingURL=repair-skills-
|
|
3
|
+
//# sourceMappingURL=repair-skills-tJI8shk3.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e}from"./chunk-DTipWd-i.mjs";import{Ho as t,M as n}from"./src-CFHcsBtV.mjs";import{Mr as r,Tr as i,et as a,fa as o,la as s,nn as c,nt as l,rt as u,tt as d}from"./src-
|
|
1
|
+
import{o as e}from"./chunk-DTipWd-i.mjs";import{Ho as t,M as n}from"./src-CFHcsBtV.mjs";import{Mr as r,Tr as i,et as a,fa as o,la as s,nn as c,nt as l,rt as u,tt as d}from"./src-BI8S8yWC.mjs";import{b as f,u as p,v as m,y as h}from"./server-lock-CRw6jjM3.mjs";import{t as g}from"./yazl-BucAN8Ez.mjs";import{t as _}from"./esm-EvSEzE_V.mjs";import"./gh-detect-DRUIjmmd.mjs";import{E as v,S as y,T as b,_ as ee,b as te,o as x,v as S,w as C}from"./init-Djn0N_zk.mjs";import{n as ne}from"./constants-DpyZcZY8.mjs";import{t as w}from"./is-object-DYBErO9v.mjs";import{_ as T,d as E,i as D,v as O}from"./write-project-skill-Bg3yDMEj.mjs";import"./loader-BXG_Ue4t.mjs";import{c as re}from"./colors-CpVsnmzb.mjs";import"./preview-Dhq40nJ_.mjs";import{execSync as ie,spawnSync as ae}from"node:child_process";import{basename as k,dirname as A,isAbsolute as oe,join as j,relative as se,resolve as M,sep as ce}from"node:path";import{cpSync as le,createWriteStream as ue,existsSync as N,lstatSync as de,mkdirSync as P,mkdtempSync as fe,readFileSync as F,readdirSync as I,readlinkSync as pe,rmSync as L,statSync as me,writeFileSync as R}from"node:fs";import{arch as he,freemem as ge,homedir as _e,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{readFile as z,realpath as B}from"node:fs/promises";import{createHash as V}from"node:crypto";const Te=[{name:`macos-home-path`,regex:/\/Users\/[^/]+\//g,replacement:`~/`},{name:`linux-home-path`,regex:/\/home\/[^/]+\//g,replacement:`~/`},{name:`github-pat`,regex:/\b(ghp_|gho_|ghu_|ghs_|ghr_)[A-Za-z0-9]{36,}\b/g,replacement:`[REDACTED-GH-PAT]`},{name:`aws-access-key`,regex:/\b(AKIA|ASIA|ABIA)[A-Z2-7]{16}\b/g,replacement:`[REDACTED-AWS-KEY]`},{name:`anthropic-key`,regex:/\bsk-ant-api03-[A-Za-z0-9_-]{20,}\b/g,replacement:`[REDACTED-ANTHROPIC]`},{name:`openai-key`,regex:/\bsk-[A-Za-z0-9]{20,}\b/g,replacement:`[REDACTED-OPENAI]`},{name:`bearer-token`,regex:/([Aa]uthorization:\s*[Bb]earer\s+)\S+/g,replacement:`$1[REDACTED]`},{name:`jwt`,regex:/eyJ[A-Za-z0-9_-]{8,}\.eyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}/g,replacement:`[REDACTED-JWT]`},{name:`url-credentials`,regex:/:\/\/[^/\s:@]+:[^/\s:@]+@/g,replacement:`://[REDACTED]@`}],Ee=Te.map(e=>e.name);function H(e){let t=new Set,n=0;return{redacted:e.split(`
|
|
2
2
|
`).map(e=>{let r=e;for(let{name:e,regex:i,replacement:a}of Te)i.lastIndex=0,i.test(r)&&(t.add(e),n++,i.lastIndex=0,r=r.replace(i,a));return r}).join(`
|
|
3
3
|
`),patterns:[...t],lineCount:n}}function De(){return j(_e(),`.ok`,`bug-reports`)}function Oe(e=new Date){let t=e.toISOString().replace(/[:.]/g,`-`);return j(De(),`${t}-bugreport.zip`)}function ke(e,t){let n=j(e,`.ok`,`config.yml`);if(N(n))try{let e=F(n,`utf8`).match(/^\s*name:\s*['"]?(.+?)['"]?\s*$/m);if(e?.[1])return e[1]}catch(e){t?.warn({configPath:n,err:e instanceof Error?e.message:String(e)},`bug-report: failed to read .ok/config.yml for project slug; using path-hash fallback`)}return N(j(e,`.ok`))?V(`sha256`).update(M(e)).digest(`hex`).slice(0,12):null}function Ae(){let e={timestamp:new Date().toISOString(),platform:ye(),osType:Ce(),osRelease:be(),hostname:`[redacted]`,uptime:we(),freeMem:ge(),totalMem:Se(),nodeVersion:process.version,bunVersion:process.versions.bun??null,v8Version:process.versions.v8??null,pid:process.pid};try{e.macosVersion=ie(`sw_vers -productVersion 2>/dev/null`,r({encoding:`utf8`})).trim()}catch{}try{let t=j(__dirname,`..`,`..`,`package.json`);N(t)&&(e.okVersion=JSON.parse(F(t,`utf8`)).version)}catch{}return e}function je(e,t){if(!N(t))return{files:[]};let n=I(t).filter(e=>e.endsWith(`.log`)||/\.log\.\d+$/.test(e)).map(e=>j(t,e));if(e&&n.length>0){let t=n.filter(t=>{try{return F(t,`utf8`).includes(`"project":"${e}"`)}catch{return!0}});t.length>0&&(n=t)}return{files:n}}function Me(e){let t=j(e,`.ok`,`local`);return N(t)?{files:[`server.lock`,`last-spawn-error.log`].map(e=>j(t,e)).filter(e=>N(e))}:{files:[]}}function Ne(e){let t=j(e,`.ok`,`local`,`logs`);return N(t)?{files:[`server-current.jsonl`,`server-prev.jsonl`].map(e=>j(t,e)).filter(e=>N(e))}:{files:[]}}function Pe(e){if(e.redact){let{redacted:t,patterns:n,lineCount:r}=H(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 U(e){for(let t of e.files)try{Pe({zipfile:e.zipfile,name:`${e.prefix}/${k(t)}`,content:F(t,`utf8`),redact:e.redact,bundleFiles:e.bundleFiles,redactions:e.redactions})}catch(n){e.logger?.warn({file:t,prefix:e.prefix,err:n instanceof Error?n.message:String(n)},`bug-report: skipped unreadable file`)}}async function Fe(t){let{redact:n,outputPath:r,logger:i}=t,a=t.userLogsDir??j(_e(),`.ok`,`logs`),o=t.projectDir?ke(t.projectDir,i):null;P(A(r),{recursive:!0}),i?.info({projectSlug:o},`gathering diagnostic data`);let s=Ae();s.desktop=t.desktop??null;let{files:c}=je(o,a),{files:l}=t.projectDir?Me(t.projectDir):{files:[]},{files:u}=t.projectDir?Ne(t.projectDir):{files:[]};i?.info({logFileCount:c.length,lockFileCount:l.length,localSinkFileCount:u.length},`files collected`);let d=[],f=[],{ZipFile:p}=await import(`./yazl-DvlathRc.mjs`).then(t=>e(t.default,1)),m=new p;U({zipfile:m,files:c,prefix:`logs`,redact:n,bundleFiles:f,redactions:d,logger:i}),U({zipfile:m,files:l,prefix:`lockdir`,redact:n,bundleFiles:f,redactions:d,logger:i}),U({zipfile:m,files:u,prefix:`local-logs`,redact:n,bundleFiles:f,redactions:d,logger:i});for(let e of t.extraFiles??[])try{let t=F(e.sourcePath),n=`extra/${e.zipName??k(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&&Pe({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: ${Ee.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
4
|
`);m.addBuffer(Buffer.from(v,`utf8`),`README.md`),m.end();let y=ue(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 W=t(),Ie=e(g(),1);const Le=new Set([`doc.name`]);function Re(e){return`doc:${V(`sha256`).update(e).digest(`hex`).slice(0,8)}`}function ze(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 Be(e,t){let n=t.originalToHashed.get(e);if(n!==void 0)return n;let r=Re(e);return t.originalToHashed.set(e,r),ze(t,e,r),r}function G(e,t){return t.length===0||!e.includes(t)?e:e.split(t).join(`<CONTENT_DIR>`)}function Ve(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function K(e,t){if(typeof e==`string`)return G(e,t.contentDir);if(Array.isArray(e))return e.map(e=>K(e,t));if(!Ve(e))return e;let n=typeof e.key==`string`&&Le.has(e.key)&&Ve(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`&&Ve(a)){let e=Be(n,t);r[i]={...a,stringValue:e}}else Le.has(i)&&typeof a==`string`?r[i]=Be(a,t):r[i]=K(a,t);return r}function He(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 Ue(e,t){let n=F(e,`utf-8`);if(n.length===0)return;let r=n.endsWith(`
|
|
@@ -18,4 +18,4 @@ import{o as e}from"./chunk-DTipWd-i.mjs";import{Ho as t,M as n}from"./src-CFHcsB
|
|
|
18
18
|
`).replace(/\n/g,`\r
|
|
19
19
|
`));let d=`${i?``:``}${u}`;return d!==r&&o(e,d,{mode:C(e)}),{kind:`removed`}}const Jt=new Set([`start`,`stop`,`status`,`clean`,`ui`,`mcp`,`preview`,`lint`,`deinit`,`auth`]);function Yt(e,t,n=c){if(e!==void 0&&!Jt.has(e))return null;let r=n(t);return r===null||r.distance===0?null:r.rootPath}let Xt=null;function Zt(e){Xt=e}function Qt(){return Xt??process.cwd()}function $t(e){return e==null?!1:e.includes(`--type=utility`)&&e.includes(`--utility-sub-type=node.mojom.NodeService`)}function en(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 tn(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:d(r),command:r,isDesktop:$t(r)}}function nn(e){return e.ui==null?!1:e.ui.status===`alive`||e.ui.status===`foreign-host`}function Q(e){let t=e.server.status;return t===`alive`||t===`foreign-host`?e.isDesktop?`desktop`:t===`alive`?`running`:`foreign`:t===`dead-pid`&&nn(e)?`ui-orphan`:`stale`}const rn=new Set([`running`,`desktop`,`foreign`,`ui-orphan`]);function an(e){switch(e){case`running`:return Z.default.green(e);case`desktop`:return Z.default.blue(e);case`foreign`:return Z.default.cyan(e);case`ui-orphan`:return Z.default.magenta(e);case`stale`:return Z.default.yellow(e)}}function on(e){return e==null?`—`:`${e.cpuPercent.toFixed(1)}% / ${e.memPercent.toFixed(1)}%`}function sn(e){return`${on(e.server.usage)} | ${on(e.ui?.usage??null)}`}function cn(e){return`${e.server.port===0?`(starting)`:String(e.server.port)} / ${e.ui==null||e.ui.status===`dead-pid`?`—`:String(e.ui.port)}`}function ln(e){if(e.length===0)return`No open-knowledge servers found.`;let t=[`DIRECTORY`,`PORTS (API/UI)`,`CPU/MEM (API | UI)`,`STATUS`,`PID`,`STARTED`,`BINARY`],n=e.map(e=>{let t=Q(e),n=t===`ui-orphan`&&e.ui!=null?e.ui.pid:e.server.pid;return[e.directory,cn(e),sn(e),t,String(n),en(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=an(Q(e))+` `.repeat(Math.max(0,(i[t]??0)-r.length))}o.push(n)}return o.join(` `).trimEnd()}),s=Z.default.dim(`To stop a server: ok stop <port|pid|directory|all>`);return[a,...o,``,s].join(`
|
|
20
20
|
`)}async function un(e={}){let t=e.discover??a,n=e.inspect??X,r=e.log??(e=>console.log(e)),i=e.resolveCommand??l,o=e.resolveUsage??u,s=await t(),c=[];for(let e of s){let t=n(e,`server`),r=n(e,`ui`),a=tn(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&&c.push(a)}if(e.json){let e=c.map(e=>({...e,displayStatus:Q(e)}));r(JSON.stringify(e,null,2));return}r(ln(e.all?c:c.filter(e=>rn.has(Q(e)))))}function dn(){return new _(`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 un({all:t.all===!0||e===`all`,json:t.json===!0})})}function fn(e,t,n={}){let r=n.isAlive??h,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 pn(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=fn(t(`server`),t(`ui`),{isAlive:e.isAlive});if(a.targets.length===0)return r(`No running open-knowledge processes.`),{stopped:[],failed:[],hadTargets:!1};let o=[],s=[];for(let e of a.targets)try{n(e.pid,`SIGTERM`),o.push(e)}catch(t){s.push({target:e,error:t instanceof Error?t.message:String(t)})}return o.length>0&&r(`Stopped: ${o.map(e=>`${e.name} (pid=${e.pid}, port=${e.port})`).join(`, `)}`),s.length>0&&i(`Failed to stop: ${s.map(({target:e,error:t})=>`${e.name} (pid=${e.pid}): ${t}`).join(`; `)}`),{stopped:o,failed:s,hadTargets:!0}}function $(e,t){return e.status===`alive`?!0:e.status===`foreign-host`?t(e.lock.pid):!1}async function mn(e,t=h){let n=await a(),r=null;for(let i of n){let n=X(i,`server`),a=X(i,`ui`);if($(n,t)&&n.lock.port===e||$(a,t)&&a.lock.port===e)return i;r===null&&($(n,t)&&n.lock.pid===e||$(a,t)&&a.lock.pid===e)&&(r=i)}return r}function hn(e){let t=pn({lockDir:e});return t.failed.length>0&&(process.exitCode=1),t}function gn(e){return new _(`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=pn({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 un({});return}if(n===`all`){let e=await a();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`);!$(e,h)&&!$(r,h)||(hn(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 mn(e);if(t===null){console.log(`No running open-knowledge server found with port or PID ${e}.`);return}hn(t);return}hn(i(M(Qt(),n)))})}function _n(e){return{event:`mcp-config-decline`,scope:e.scope,surface:e.surface,editorId:e.editorId,reason:e.reason}}async function vn(e,t){let n,r;try{n=await B(M(e)),r=await B(M(A(e)))}catch{return{kind:`not-git`}}if(!bn(n,r))return{kind:`symlink-escape`};let i=j(n,`.git`),a;try{a=me(i)}catch{return{kind:`not-git`}}let o;if(a.isDirectory()){let e;try{e=await B(i)}catch{return{kind:`not-git`}}if(!bn(e,n))return{kind:`symlink-escape`};o=e}else if(a.isFile()){let e;try{e=await z(i,`utf-8`)}catch{return{kind:`not-git`}}let t=/^gitdir:\s*(.+)$/m.exec(e.trim());if(!t)return{kind:`not-git`};let r=t[1].trim(),a=oe(r)?r:M(n,r);try{o=await B(a)}catch{return{kind:`not-git`}}}else return{kind:`not-git`};let s=j(await yn(o),`config`),c;try{c=await z(s,`utf-8`)}catch{return{kind:`not-git`}}let l=Sn(c);if(l===null)return{kind:`no-origin`};let u=At(l);if(u===null||u.hostname!==`github.com`)return{kind:`non-github`};let d=u.owner.toLowerCase()===t.owner.toLowerCase(),f=u.name.toLowerCase()===t.repo.toLowerCase();return!d||!f?{kind:`wrong-repo`,actualOwner:u.owner,actualRepo:u.name}:{kind:`ok`,gitRemoteUrl:`https://github.com/${u.owner}/${u.name}.git`}}async function yn(e){let t;try{t=(await z(j(e,`commondir`),`utf-8`)).trim()}catch{return e}if(t.length===0)return e;let n=oe(t)?t:M(e,t);try{return await B(n)}catch{return n}}function bn(e,t){if(e===t)return!0;let n=se(t,e);return n.length>0&&!n.startsWith(`..`)&&!oe(n)}function xn(e){let t=e.indexOf(`#`),n=e.indexOf(`;`),r=-1;return t>=0&&n>=0?r=Math.min(t,n):t>=0?r=t:n>=0&&(r=n),(r===-1?e:e.slice(0,r)).trim()}function Sn(e){let t=!1;for(let n of e.split(/\r?\n/)){let e=xn(n);if(e.length===0)continue;if(e.startsWith(`[`)){t=/^\[\s*remote\s+["']origin["']\s*\]$/.test(e);continue}if(!t)continue;let r=/^url\s*=\s*(.+)$/.exec(e);if(r)return Cn(r[1])}return null}function Cn(e){let t=e.trim();return t.startsWith(`"`)&&t.endsWith(`"`)||t.startsWith(`'`)&&t.endsWith(`'`)?t.slice(1,-1):t}const wn=[{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=S(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=D(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 Tn(e,t,n={},r=wn){let i=[];for(let a of t){let t=E[a];for(let a of r)i.push(a.write(t,e,n))}return i}function En(e,t,n={}){return{integrations:Tn(e,t,n)}}export{Ot as C,H as D,Oe as E,X as S,Tt as T,Bt as _,gn as a,Mt as b,Zt as c,Pt as d,It as f,zt as g,Lt as h,pn as i,Yt as l,Vt as m,vn as n,dn as o,Ft as p,_n as r,Qt as s,En as t,Wt as u,jt as v,wt as w,At as x,Nt as y};
|
|
21
|
-
//# sourceMappingURL=src-
|
|
21
|
+
//# sourceMappingURL=src-3qc3R4lD.mjs.map
|