@inkeep/open-knowledge 0.38.0-beta.5 → 0.38.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{acp-harness-probe-BNlbeFpR.mjs → acp-harness-probe-CD3DPSei.mjs} +2 -2
- package/dist/assets/skills/discovery/SKILL.md +1 -1
- package/dist/assets/skills/project/SKILL.md +1 -1
- package/dist/cli.mjs +64 -62
- package/dist/constants-XB7Gbn8b.mjs +2 -0
- package/dist/{git-handle-DnLoe9hy.mjs → git-handle-B30Z3S49.mjs} +2 -2
- package/dist/git-handle-RhB108wn.mjs +1 -0
- package/dist/index.mjs +1 -1
- package/dist/init-CEo2uEMy.mjs +1 -0
- package/dist/{init-CloPMHMk.mjs → init-DTQvzEMW.mjs} +5 -5
- package/dist/{launch-json-removal-BdwZNPxR.mjs → launch-json-removal-CSzqpsW_.mjs} +2 -2
- package/dist/{loader-L0RG68Di.mjs → loader-CAo4CIDz.mjs} +2 -2
- package/dist/loader-wEc1RSer.mjs +1 -0
- package/dist/md-manager-DqdW_K1F.mjs +2 -0
- package/dist/{open-browser-Bbzq7Z7d.mjs → open-browser-D6esrKJP.mjs} +2 -2
- package/dist/parse-worker.mjs +1 -1
- package/dist/{preview-mobXnBPo.mjs → preview-C5HzJLxE.mjs} +2 -2
- package/dist/preview-CcMnlzBn.mjs +1 -0
- package/dist/public/assets/{ActivityModeContent-BQeZuILy.js → ActivityModeContent-BRQiz7Gg.js} +1 -1
- package/dist/public/assets/{AgentDiffPane-QEI9IvTx.js → AgentDiffPane-D_m8Olga.js} +1 -1
- package/dist/public/assets/{AgentThreadClientBinder-poPjsQXP.js → AgentThreadClientBinder-CTB6pLJ7.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-BDpilu8K.js → CodeMirrorPropInput-D0RRvxEm.js} +1 -1
- package/dist/public/assets/{DocumentContext-C4eewS75.js → DocumentContext-B_zqYuAI.js} +1 -1
- package/dist/public/assets/{EnableSyncConfirmDialog-CLtmD52b.js → EnableSyncConfirmDialog-D7Zyqovd.js} +1 -1
- package/dist/public/assets/{FeedbackForm-DH4DaXLD.js → FeedbackForm-D_BU9MqU.js} +1 -1
- package/dist/public/assets/{GraphPanel-BjCltqW1.js → GraphPanel-DZuVLVOw.js} +1 -1
- package/dist/public/assets/{ManagedArtifactProperties-DroX_qbT.js → ManagedArtifactProperties-DzfhF4o0.js} +1 -1
- package/dist/public/assets/{McpConsentDialogBody-B0VkhB1e.js → McpConsentDialogBody-CxKyNN1f.js} +1 -1
- package/dist/public/assets/{MermaidDocEditor-BgRVEFx4.js → MermaidDocEditor-xXyuXJXZ.js} +1 -1
- package/dist/public/assets/{PropertyPanel-CjAWmcMG.js → PropertyPanel-Cogbrfkl.js} +1 -1
- package/dist/public/assets/{ReportBugDialogBody-hPmCfQyc.js → ReportBugDialogBody-CEUi8lPt.js} +1 -1
- package/dist/public/assets/{SettingsDialogBody-0nrbk-EZ.js → SettingsDialogBody-CsFAzGUM.js} +1 -1
- package/dist/public/assets/{ShareBranchSwitchDialog-GXTPAgND.js → ShareBranchSwitchDialog-CEAr3I9Q.js} +1 -1
- package/dist/public/assets/{ShareReceiveDialog-IVAS4xf8.js → ShareReceiveDialog-B7OvGQHd.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-CHR2clGS.js → ShareReceiveMissDialog-B5udBca5.js} +1 -1
- package/dist/public/assets/{SkillEditorActions-BEtnBlep.js → SkillEditorActions-Be8i-jaa.js} +1 -1
- package/dist/public/assets/{SourceEditor-DYIbaxIY.js → SourceEditor-B6XV44St.js} +1 -1
- package/dist/public/assets/{TerminalPanel-CUoZt7C0.js → TerminalPanel-C_3duhgQ.js} +1 -1
- package/dist/public/assets/{TerminalSessionsHost-BjojawIi.js → TerminalSessionsHost-CAO8SF-D.js} +2 -2
- package/dist/public/assets/{TerminalWindowApp-jhlpCVAO.js → TerminalWindowApp-CzguEKor.js} +1 -1
- package/dist/public/assets/{ThreadView-myy5nXD-.js → ThreadView-CuepCUyH.js} +1 -1
- package/dist/public/assets/{TimelineDiffPane-BEQVtkis.js → TimelineDiffPane-udPd9-Yt.js} +1 -1
- package/dist/public/assets/{agent-diff-store-D6N0WX_4.js → agent-diff-store-Dhae8oo2.js} +1 -1
- package/dist/public/assets/{agent-visibility-Z2AQQ5Ce.js → agent-visibility-DiHdMcdh.js} +1 -1
- package/dist/public/assets/{auth-state-cache-BUoG-O4E.js → auth-state-cache-Dw5cv-Re.js} +1 -1
- package/dist/public/assets/{client-version-nevRUfmx.js → client-version-C6us3zHK.js} +1 -1
- package/dist/public/assets/{config-provider-CD9uoQQz.js → config-provider-DNXd8psn.js} +1 -1
- package/dist/public/assets/{dist-BigQ5-K5.js → dist-CM-z5Mlq.js} +1 -1
- package/dist/public/assets/{dist-Vm1kQiqo.js → dist-Ca38G5U3.js} +64 -64
- package/dist/public/assets/{doc-hash-B8kD24Kw.js → doc-hash-Bs2ss-ac.js} +1 -1
- package/dist/public/assets/{documents-events-DQ6Iario.js → documents-events-CVeZVUoq.js} +1 -1
- package/dist/public/assets/{file-tree-adapter-eftmn56d.js → file-tree-adapter-Bc2We8C-.js} +1 -1
- package/dist/public/assets/{index-IkUUpMh3.js → index-C3xDGGXT.js} +8 -8
- package/dist/public/assets/{keyboard-shortcuts-DZ9kTSZ4.js → keyboard-shortcuts-CndBRPor.js} +1 -1
- package/dist/public/assets/{lint-config-client-Bg-6mquJ.js → lint-config-client-DMUkUIUK.js} +1 -1
- package/dist/public/assets/{navigation-targets-4J3F85tT.js → navigation-targets-BFURDxV-.js} +1 -1
- package/dist/public/assets/{open-managed-artifact-tab-ze9HkqWn.js → open-managed-artifact-tab-DiXXqIwr.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-Dqowl8LB.js → pending-receive-nav-store-Cbz7Kdas.js} +1 -1
- package/dist/public/assets/{prop-types-B0l6ZN6O.js → prop-types-IIZw7u0n.js} +1 -1
- package/dist/public/assets/{receive-store-jfaprLyZ.js → receive-store-Dcra48Oz.js} +1 -1
- package/dist/public/assets/{selection-context-DIZSdbRw.js → selection-context-CNyRDPes.js} +1 -1
- package/dist/public/assets/{skill-actions-s_ATobEI.js → skill-actions-DknvAoZT.js} +1 -1
- package/dist/public/assets/{skills-api-CYoD9FQt.js → skills-api-BfzuhumH.js} +1 -1
- package/dist/public/assets/{src-7sFVeKSR.js → src-bqPreb6w.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-95GTKrco.js → target-navigation-intent-I4UM-x6n.js} +1 -1
- package/dist/public/assets/{terminal-launch-events-D0NkBM4g.js → terminal-launch-events-BHwqFf2t.js} +1 -1
- package/dist/public/assets/{terminal-telemetry-DxZXlrf4.js → terminal-telemetry-D1aeGl-R.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-CmSynwPq.js → typing-burst-detector-CDZ6YHeV.js} +1 -1
- package/dist/public/assets/{use-activity-panel-BsQxJQD5.js → use-activity-panel-BQma_v27.js} +1 -1
- package/dist/public/assets/{use-apply-config-color-theme-DBdIMwiU.js → use-apply-config-color-theme-C0Cek6NJ.js} +1 -1
- package/dist/public/assets/{use-collab-url-CwAStsIj.js → use-collab-url-BaNZ7sdp.js} +1 -1
- package/dist/public/assets/{use-live-xterm-theme-oqXGh0AM.js → use-live-xterm-theme-Dz6hvjuv.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-jZPkRHXb.js → use-terminal-enabled-qFZ8rXL0.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-B9JmhzBH.js → use-timeline-entry-diff-aNFtV2Jq.js} +1 -1
- package/dist/public/assets/{use-workspace-DyAcZSjY.js → use-workspace-BLr9vvf6.js} +1 -1
- package/dist/public/assets/{workspace-paths-B_ozK4P-.js → workspace-paths-Dgj2u8bQ.js} +1 -1
- package/dist/public/assets/{zod-CCGVCn6n.js → zod-BtDPLTDt.js} +1 -1
- package/dist/public/index.html +35 -35
- package/dist/{repair-launch-json-BpJsHMl7.mjs → repair-launch-json-DdKhQjo_.mjs} +2 -2
- package/dist/{repair-mcp-configs-DIouVxbz.mjs → repair-mcp-configs-CR7okbjl.mjs} +2 -2
- package/dist/{repair-skills-DaVaOiQC.mjs → repair-skills-B7V4_S1t.mjs} +2 -2
- package/dist/repair-skills-OJT-GLmM.mjs +1 -0
- package/dist/server-lock-BjmrAQDi.mjs +1 -0
- package/dist/{server-lock-DzWMWbLN.mjs → server-lock-CSEWSPO0.mjs} +2 -2
- package/dist/{src-BjPwa-U8.mjs → src-2rFtUPmd.mjs} +6 -6
- package/dist/src-DBW4MhVj.mjs +3264 -0
- package/dist/{src-eVRfK1KK.mjs → src-DuSq_ZD1.mjs} +1 -1
- package/dist/{src-Cwu3lS3D.mjs → src-FuRMJntf.mjs} +107 -107
- package/dist/{start-DGgc0XwY.mjs → start-CSxxyep8.mjs} +2 -2
- package/dist/start-OWnhXqlM.mjs +1 -0
- package/dist/{write-project-skill-DtERurRT.mjs → write-project-skill-BD-Ei4Cn.mjs} +4 -4
- package/package.json +5 -5
- package/dist/constants-t3FhJ5kj.mjs +0 -2
- package/dist/git-handle-DluCIpMR.mjs +0 -1
- package/dist/init-BRJ-t8Lu.mjs +0 -1
- package/dist/loader-0o0M5iTR.mjs +0 -1
- package/dist/md-manager-DtA0LK6p.mjs +0 -2
- package/dist/preview-CPKzfpkN.mjs +0 -1
- package/dist/repair-skills-vw_jVt0o.mjs +0 -1
- package/dist/server-lock-DZZ64TDY.mjs +0 -1
- package/dist/src-DxAg43k_.mjs +0 -3264
- package/dist/start-DEFBseHT.mjs +0 -1
package/dist/public/assets/{terminal-telemetry-DxZXlrf4.js → terminal-telemetry-D1aeGl-R.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./react-JNybMug3.js";import{t as n}from"./useQuery-NsPxD6kI.js";import{t as r}from"./compiler-runtime-dQcBxOhn.js";import{S as i}from"./agent-visibility-
|
|
1
|
+
import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./react-JNybMug3.js";import{t as n}from"./useQuery-NsPxD6kI.js";import{t as r}from"./compiler-runtime-dQcBxOhn.js";import{S as i}from"./agent-visibility-DiHdMcdh.js";import{t as a}from"./trace-api-CXljsYUC.js";var o=r(),s=e(t(),1);function c(e){let t=[`claude-acp`,`codex-acp`,`cursor`,`opencode`],n=e=>{let n=t.indexOf(e);return n===-1?t.length:n};return e.filter(e=>e.supported&&e.harness?.availability===`present`).sort((e,t)=>n(e.id)-n(t.id))}async function l(e){let t=await fetch(`/api/acp/catalog`,{signal:e??AbortSignal.timeout(2e4)});if(!t.ok)throw Error(`agent catalog request failed: HTTP ${t.status}`);let n=await t.json();return{agents:Array.isArray(n.agents)?n.agents:[],stale:n.stale===!0,maxThreads:typeof n.maxThreads==`number`?n.maxThreads:8}}function u(){let e=(0,o.c)(4),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={queryKey:[`acp-catalog`],queryFn:f,staleTime:3e5},e[0]=t):t=e[0];let{data:r}=n(t),a=r?.agents,c,l;e[1]===a?(c=e[2],l=e[3]):(c=()=>{a&&i(a.map(d))},l=[a],e[1]=a,e[2]=c,e[3]=l),(0,s.useEffect)(c,l)}function d(e){return{source:e.source,id:e.id,name:e.name,supported:e.supported,...e.iconUrl===void 0?{}:{iconUrl:e.iconUrl}}}function f(e){let{signal:t}=e;return l(t)}var p=`open-knowledge-app`;function m(e){try{a.getTracer(p).startSpan(e).end()}catch(e){console.warn(`[terminal-telemetry] span emit failed:`,e instanceof Error?e:String(e))}}function h(){m(`ok.desktop.terminalOpened`)}function g(){m(`ok.desktop.shellConsentGranted`)}export{u as a,l as i,h as n,c as r,g as t};
|
package/dist/public/assets/{typing-burst-detector-CmSynwPq.js → typing-burst-detector-CDZ6YHeV.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./jsx-runtime-DyiINK0N.js";import{n}from"./DocumentContext-C4eewS75.js";import{t as r}from"./react-JNybMug3.js";import{n as i,r as a}from"./dist-DBENJeML.js";import{r as o,t as s}from"./useQuery-NsPxD6kI.js";import{t as c}from"./compiler-runtime-dQcBxOhn.js";import{s as l}from"./createLucideIcon-BUb14crZ.js";import{t as u}from"./button-DHE6Sx02.js";import{n as d,r as f,t as p}from"./collapsible-BIzY37go.js";import{B as m,I as h}from"./CodeMirrorPropInput-BDpilu8K.js";import{n as g,t as _}from"./toggle-group-CxrQL99E.js";import{Yr as v,fr as y,gt as b,pt as x}from"./dist-Vm1kQiqo.js";import{t as S}from"./chevron-right-zaL9JagC.js";import{n as C}from"./CopyButton-D0gTyMvW.js";import{i as w}from"./prop-types-B0l6ZN6O.js";import{l as T}from"./workspace-paths-B_ozK4P-.js";import{t as E}from"./refresh-cw-DSH9Of_0.js";import{t as D}from"./triangle-alert-DpxK7pzx.js";import{t as O}from"./wrench-BDWKT3wQ.js";import{n as k}from"./dist-DwCd6eR-.js";import{t as A}from"./dist-BD3698ve.js";import{i as j}from"./startup-marks-CytO17UM.js";import{a as M,s as N}from"./doc-hash-B8kD24Kw.js";import{t as P}from"./badge-BDZGi1Ks.js";import{a as ee,i as F,n as te,o as ne,r as re,s as ie,t as ae}from"./panel-DLUMbyPl.js";import{t as I}from"./skeleton-CA6hvjst.js";import{i as L,r as R}from"./lint-config-client-Bg-6mquJ.js";var z=e(r(),1),B=c(),V=3e4,H=new Map;function U(e){return e?Date.now()-e.rememberedAt>V?null:e.navigation:null}function W(e,t){H.set(e,{navigation:t,rememberedAt:Date.now()})}function G(e){return U(H.get(e))}function K(e){let t=H.get(e);return H.delete(e),U(t)}function q(e){H.delete(e)}function oe(e,t){let n=(0,B.c)(4),r=t===void 0?!1:t,[i,a]=(0,z.useState)(void 0),o=(0,z.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,z.useEffect)(s,c),i}var J=t(),se=300;async function ce(e){let t=await fetch(`/api/page-headings?docName=${encodeURIComponent(e)}`),n;try{n=await t.json()}catch(e){throw new m(A._({id:`qAQVSD`}),{cause:e,status:t.status})}if(!t.ok){let e=b.safeParse(n);throw e.success?Error(e.data.title):new m(A._({id:`zlErBl`}),{status:t.status})}let r=x.safeParse(n);if(!r.success)throw new m(A._({id:`XW18jo`}),{status:t.status});return r.data.headings??[]}var le=32,Y=12,X=6,ue=`open-knowledge:outline-nav`;function Z(e){let t=(0,B.c)(2),n;return t[0]===e?n=t[1]:(n=(0,J.jsx)(j,{name:`outline-panel`,children:(0,J.jsx)(de,{...e})}),t[0]=e,t[1]=n),n}function de(e){let t=(0,B.c)(50),{docName:r,isSourceMode:c,className:u}=e,d=u===void 0?``:u,{_:f}=a(),{pages:p,loading:m}=w(),h=o(),{activeProvider:g,activeDocName:_}=n(),v,b;t[0]===r?(v=t[1],b=t[2]):(v=[`page-headings`,r],b=()=>ce(r),t[0]=r,t[1]=v,t[2]=b);let x;t[3]!==r||t[4]!==m||t[5]!==p?(x=!m&&(p.has(r)||y(r)),t[3]=r,t[4]=m,t[5]=p,t[6]=x):x=t[6];let S;t[7]!==v||t[8]!==b||t[9]!==x?(S={queryKey:v,queryFn:b,enabled:x,staleTime:1/0},t[7]=v,t[8]=b,t[9]=x,t[10]=S):S=t[10];let{data:C,isLoading:T,error:E}=s(S),D;t[11]===C?D=t[12]:(D=C===void 0?[]:C,t[11]=C,t[12]=D);let O=D,k,A;t[13]!==_||t[14]!==g||t[15]!==r||t[16]!==h?(k=()=>{if(!g||_!==r)return;let e=g.document,t=null,n=()=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{t=null,h.invalidateQueries({queryKey:[`page-headings`,r]})},se)};return e.on(`update`,n),()=>{e.off(`update`,n),t!==null&&clearTimeout(t)}},A=[g,_,r,h],t[13]=_,t[14]=g,t[15]=r,t[16]=h,t[17]=k,t[18]=A):(k=t[17],A=t[18]),(0,z.useEffect)(k,A);let j;t[19]===O?j=t[20]:(j=O.map(fe),t[19]=O,t[20]=j);let M=oe(j,c),N;t[21]!==M||t[22]!==O?(N=M?O.findIndex(e=>e.slug===M):-1,t[21]=M,t[22]=O,t[23]=N):N=t[23];let P=N,I;t[24]!==r||t[25]!==c?(I=function(e,t){let n={index:e,slug:t,mode:c?`source`:`wysiwyg`};n.mode===`source`&&W(r,{kind:`outline`,detail:n}),window.dispatchEvent(new CustomEvent(ue,{detail:n}))},t[24]=r,t[25]=c,t[26]=I):I=t[26];let L=I,R=((P>=0?O[P].level:1)-1)*Y+(Y-X)/2,V=P*le+(le-X)/2,H;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,J.jsx)(ie,{children:(0,J.jsx)(i,{id:`dD7NPy`})}),t[27]=H):H=t[27];let U;t[28]!==O.length||t[29]!==T?(U=!T&&(0,J.jsx)(re,{children:O.length}),t[28]=O.length,t[29]=T,t[30]=U):U=t[30];let G;t[31]===U?G=t[32]:(G=(0,J.jsxs)(ne,{children:[H,U]}),t[31]=U,t[32]=G);let K;t[33]!==f||t[34]!==P||t[35]!==M||t[36]!==E||t[37]!==L||t[38]!==O||t[39]!==T||t[40]!==R||t[41]!==V?(K=E?(0,J.jsx)(ee,{className:`px-2`,children:E instanceof Error?E.message:f({id:`GuqOb1`})}):O.length===0&&!T?(0,J.jsx)(F,{className:`px-2`,children:(0,J.jsx)(i,{id:`0BB9ID`})}):(0,J.jsxs)(`nav`,{"aria-label":f({id:`BymzO4`}),className:`relative`,children:[P>=0&&(0,J.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:X,height:X,transform:`translate(${R}px, ${V}px)`}}),O.map((e,t)=>{let n=e.slug===M;return(0,J.jsx)(`button`,{type:`button`,"aria-current":n?`location`:void 0,onClick:()=>L(t,e.slug),className:l(`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)*Y+20}px`},title:e.text,children:e.text},t)})]}),t[33]=f,t[34]=P,t[35]=M,t[36]=E,t[37]=L,t[38]=O,t[39]=T,t[40]=R,t[41]=V,t[42]=K):K=t[42];let q;t[43]!==T||t[44]!==K?(q=(0,J.jsx)(te,{className:`px-3 py-2`,"aria-busy":T,children:K}),t[43]=T,t[44]=K,t[45]=q):q=t[45];let Z;return t[46]!==d||t[47]!==G||t[48]!==q?(Z=(0,J.jsxs)(ae,{className:d,children:[G,q]}),t[46]=d,t[47]=G,t[48]=q,t[49]=Z):Z=t[49],Z}function fe(e){return e.slug}function pe(e){let t=(0,B.c)(10),{scope:n,onScopeChange:r}=e,{_:o}=a(),s;t[0]===r?s=t[1]:(s=e=>{e&&r(e)},t[0]=r,t[1]=s);let c;t[2]===o?c=t[3]:(c=o({id:`aBgwis`}),t[2]=o,t[3]=c);let l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,J.jsx)(g,{value:`doc`,className:`flex-1`,"data-testid":`panel-scope-doc`,children:(0,J.jsx)(i,{id:`UpCz01`})}),t[4]=l):l=t[4];let u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,J.jsx)(g,{value:`project`,className:`flex-1`,"data-testid":`panel-scope-project`,children:(0,J.jsx)(i,{id:`e0NrBM`})}),t[5]=u):u=t[5];let d;return t[6]!==n||t[7]!==s||t[8]!==c?(d=(0,J.jsx)(`div`,{className:`shrink-0 px-4 pb-2`,children:(0,J.jsxs)(_,{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 me=`open-knowledge:lint-nav`;function he(e,t){return e.range.start.line-t.range.start.line||e.range.start.character-t.range.start.character}function ge(e){return{line:e.range.start.line+1,column:e.range.start.character+1}}function _e(e){let t=(0,B.c)(19),{diagnostic:n}=e,{_:r}=a(),i=n.severity===`error`?C:D,o=`${n.source}/${n.code}`,s=n.range.start.line+1,c=n.severity===`error`?`text-destructive`:`text-amber-500`,u;t[0]===c?u=t[1]:(u=l(`mt-0.5 size-3.5 shrink-0`,c),t[0]=c,t[1]=u);let d;t[2]!==i||t[3]!==u?(d=(0,J.jsx)(i,{"aria-hidden":`true`,className:u}),t[2]=i,t[3]=u,t[4]=d):d=t[4];let f;t[5]===n.message?f=t[6]:(f=(0,J.jsx)(`span`,{className:`text-foreground`,children:n.message}),t[5]=n.message,t[6]=f);let p;t[7]!==d||t[8]!==f?(p=(0,J.jsxs)(`span`,{className:`flex items-start gap-1.5 text-sm`,children:[d,f]}),t[7]=d,t[8]=f,t[9]=p):p=t[9];let m;t[10]!==r||t[11]!==s?(m=r({id:`enPTnx`,values:{displayLine:s}}),t[10]=r,t[11]=s,t[12]=m):m=t[12];let h;t[13]!==o||t[14]!==m?(h=(0,J.jsxs)(`span`,{className:`ps-5 font-mono text-xs text-muted-foreground`,children:[o,` · `,m]}),t[13]=o,t[14]=m,t[15]=h):h=t[15];let g;return t[16]!==p||t[17]!==h?(g=(0,J.jsxs)(J.Fragment,{children:[p,h]}),t[16]=p,t[17]=h,t[18]=g):g=t[18],g}function ve(e){return`${e.source}/${e.code}-${e.range.start.line}-${e.range.start.character}-${e.message}`}function ye(e){return e.reduce((e,t)=>e+ +((t.fixes?.length??0)>0),0)}function be(e){let t=(0,B.c)(13),{count:n,disabled:r,onClick:o,children:s}=e,{_:c}=a(),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 d;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,J.jsx)(O,{"aria-hidden":`true`,className:`size-3`}),t[4]=d):d=t[4];let f;t[5]!==s||t[6]!==n?(f=s??(0,J.jsx)(i,{id:`5_8TCr`,values:{count:n}}),t[5]=s,t[6]=n,t[7]=f):f=t[7];let p;return t[8]!==r||t[9]!==o||t[10]!==l||t[11]!==f?(p=(0,J.jsxs)(u,{size:`sm`,variant:`ghost`,className:`h-6 shrink-0 px-2 text-xs`,disabled:r,onClick:o,"aria-label":l,"data-testid":`problems-fix-all`,children:[d,f]}),t[8]=r,t[9]=o,t[10]=l,t[11]=f,t[12]=p):p=t[12],p}function xe(e){let t=(0,B.c)(21),{docName:n,diagnostics:r,onFix:o,onFixAll:s,onAskAi:c}=e,{_:l}=a(),[d,f]=(0,z.useState)(`doc`),p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(p={status:`idle`},t[0]=p):p=t[0];let[m,h]=(0,z.useState)(p),[g,_]=(0,z.useState)(null),v=(0,z.useRef)(!0),y,b;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(y=()=>(v.current=!0,()=>{v.current=!1}),b=[],t[1]=y,t[2]=b):(y=t[1],b=t[2]),(0,z.useEffect)(y,b);let x;if(t[3]!==l||t[4]!==m||t[5]!==r||t[6]!==n||t[7]!==c||t[8]!==o||t[9]!==s||t[10]!==g||t[11]!==d){let e=[...r].sort(he),a=async function(){h({status:`loading`});let e=await L();v.current&&h(e===null?{status:`failed`}:{status:`loaded`,result:e})},p=m.status===`loaded`?m.result.files.filter(we):[],y=async function(){if(g!==null||p.length===0)return;_({done:0,total:p.length});let e=[];for(let t of p){let n=await R(M(t.file));if(!v.current)return;n.ok||e.push({file:t.file,detail:n.errorDetail}),_(Ce)}if(_(null),e.length>0){let t=e[0];k.error(l({id:`fru3T7`,values:{0:e.length,1:p.length}}),{description:t===void 0?void 0:`${t.file}${t.detail===null?``:` — ${t.detail}`}`})}try{await a()}catch{v.current&&h({status:`failed`})}},b=function(e){f(e),e===`project`&&m.status===`idle`&&a()},S;t[13]===n?S=t[14]:(S=function(e){let t=ge(e);W(n,{kind:`lint`,detail:t}),window.dispatchEvent(new CustomEvent(me,{detail:t}))},t[13]=n,t[14]=S);let C=S,w;t[15]!==n||t[16]!==C?(w=function(e,t){let r=M(e);if(r===n){C(t);return}W(r,{kind:`lint`,detail:ge(t)}),window.location.hash=N(r)},t[15]=n,t[16]=C,t[17]=w):w=t[17];let E=w,D;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,J.jsx)(ie,{children:(0,J.jsx)(i,{id:`OXdGnd`})}),t[18]=D):D=t[18];let A=d===`doc`&&e.length>0&&(0,J.jsx)(re,{children:e.length}),j;t[19]===A?j=t[20]:(j=(0,J.jsxs)(ne,{children:[D,A]}),t[19]=A,t[20]=j),x=(0,J.jsxs)(ae,{children:[j,(0,J.jsx)(pe,{scope:d,onScopeChange:b}),d===`doc`?(0,J.jsx)(te,{className:`px-2 py-2`,children:e.length===0?(0,J.jsx)(F,{className:`px-2`,children:(0,J.jsx)(i,{id:`ZI8uvA`})}):(0,J.jsxs)(J.Fragment,{children:[s!==void 0&&(0,J.jsx)(`div`,{className:`flex items-center justify-end gap-2 px-2 pb-1`,children:(0,J.jsx)(be,{count:ye(e),disabled:ye(e)===0,onClick:s})}),(0,J.jsx)(`ul`,{"aria-label":l({id:`OXdGnd`}),className:`flex flex-col gap-0.5`,children:e.map(e=>{let t=e.range.start.line+1,n=o!==void 0&&(e.fixes?.length??0)>0,r=`${e.source}/${e.code}`;return(0,J.jsxs)(`li`,{className:`group relative rounded transition-colors hover:bg-muted`,children:[(0,J.jsx)(`button`,{type:`button`,onClick:()=>C(e),className:`flex w-full cursor-pointer flex-col gap-0.5 rounded px-2 py-1.5 text-left`,title:l({id:`aHPdYV`,values:{displayLine:t}}),children:(0,J.jsx)(_e,{diagnostic:e})}),n||c!==void 0?(0,J.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,J.jsxs)(u,{size:`sm`,variant:`ghost`,className:`h-6 shrink-0 px-2 text-xs`,onClick:()=>o?.(e),"aria-label":l({id:`fZj9em`,values:{flatId:r}}),"data-testid":`problems-fix`,children:[(0,J.jsx)(O,{"aria-hidden":`true`,className:`size-3`}),(0,J.jsx)(i,{id:`c4fVUV`})]}):null,c===void 0?null:(0,J.jsxs)(u,{size:`sm`,variant:`ghost`,className:`h-6 shrink-0 px-2 text-xs`,onClick:()=>c(e),"aria-label":l({id:`hh4mVC`,values:{flatId:r}}),"data-testid":`problems-ask-ai`,children:[(0,J.jsx)(T,{"aria-hidden":`true`,className:`size-3`}),(0,J.jsx)(i,{id:`xWEvuo`})]})]}):null]},ve(e))})})]})}):(0,J.jsx)(Ee,{audit:m,onRefresh:()=>void a(),onNavigate:E,fixableCount:p.reduce(Se,0),fixing:g,onFixAll:()=>void y()})]}),t[3]=l,t[4]=m,t[5]=r,t[6]=n,t[7]=c,t[8]=o,t[9]=s,t[10]=g,t[11]=d,t[12]=x}else x=t[12];return x}function Se(e,t){return e+ye(t.diagnostics)}function Ce(e){return e===null?e:{...e,done:e.done+1}}function we(e){return e.diagnostics.some(Te)}function Te(e){return(e.fixes?.length??0)>0}function Ee(e){let t=(0,B.c)(43),{audit:n,onRefresh:r,onNavigate:o,fixableCount:s,fixing:c,onFixAll:l}=e,{_:d}=a(),f=n.status===`loading`||n.status===`idle`,p;t[0]!==n.result||t[1]!==n.status?(p=n.status===`loaded`&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(i,{id:`DsDwR-`,values:{0:n.result.errorCount}}),` · `,(0,J.jsx)(i,{id:`W1SI2K`,values:{0:n.result.warningCount}})]}),t[0]=n.result,t[1]=n.status,t[2]=p):p=t[2];let m;t[3]===p?m=t[4]:(m=(0,J.jsx)(`p`,{className:`text-xs text-muted-foreground`,"data-testid":`problems-audit-summary`,children:p}),t[3]=p,t[4]=m);let h;t[5]!==d||t[6]!==c?(h=c===null?null:(0,J.jsx)(`span`,{className:`sr-only`,role:`status`,children:d({id:`gZElfU`,values:{0:c.done,1:c.total}})}),t[5]=d,t[6]=c,t[7]=h):h=t[7];let g=f||c!==null||s===0,_;t[8]===c?_=t[9]:(_=c===null?void 0:(0,J.jsx)(i,{id:`S9t1PI`,values:{0:c.done,1:c.total}}),t[8]=c,t[9]=_);let v;t[10]!==s||t[11]!==l||t[12]!==g||t[13]!==_?(v=(0,J.jsx)(be,{count:s,disabled:g,onClick:l,children:_}),t[10]=s,t[11]=l,t[12]=g,t[13]=_,t[14]=v):v=t[14];let y;t[15]===d?y=t[16]:(y=d({id:`WRdYfS`}),t[15]=d,t[16]=y);let b=f||c!==null,x;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,J.jsx)(E,{"aria-hidden":`true`,className:`size-3.5`}),t[17]=x):x=t[17];let S;t[18]!==r||t[19]!==y||t[20]!==b?(S=(0,J.jsx)(u,{variant:`ghost`,size:`icon`,className:`size-6 shrink-0 text-muted-foreground`,"aria-label":y,"data-testid":`problems-audit-refresh`,disabled:b,onClick:r,children:x}),t[18]=r,t[19]=y,t[20]=b,t[21]=S):S=t[21];let C;t[22]!==S||t[23]!==h||t[24]!==v?(C=(0,J.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[h,v,S]}),t[22]=S,t[23]=h,t[24]=v,t[25]=C):C=t[25];let w;t[26]!==C||t[27]!==m?(w=(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-2 pb-1`,children:[m,C]}),t[26]=C,t[27]=m,t[28]=w):w=t[28];let T;t[29]!==d||t[30]!==f?(T=f&&(0,J.jsx)(`div`,{className:`flex flex-col gap-1`,role:`status`,"aria-busy":`true`,"aria-label":d({id:`dx-TwN`}),children:[1,2,3].map(De)}),t[29]=d,t[30]=f,t[31]=T):T=t[31];let D;t[32]===n.status?D=t[33]:(D=n.status===`failed`&&(0,J.jsx)(ee,{className:`px-2 text-xs`,children:(0,J.jsx)(i,{id:`IFezUv`})}),t[32]=n.status,t[33]=D);let O;t[34]!==n.result||t[35]!==n.status||t[36]!==o?(O=n.status===`loaded`&&(0,J.jsx)(Oe,{result:n.result,onNavigate:o}),t[34]=n.result,t[35]=n.status,t[36]=o,t[37]=O):O=t[37];let k;return t[38]!==w||t[39]!==T||t[40]!==D||t[41]!==O?(k=(0,J.jsxs)(te,{className:`px-2 py-2`,"data-testid":`problems-project-scope`,children:[w,T,D,O]}),t[38]=w,t[39]=T,t[40]=D,t[41]=O,t[42]=k):k=t[42],k}function De(e){return(0,J.jsxs)(`div`,{className:`flex items-start gap-2.5 rounded px-2 py-1.5`,children:[(0,J.jsx)(I,{className:`mt-0.5 size-3.5 shrink-0 rounded`}),(0,J.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,J.jsx)(I,{className:`h-3 w-28`}),(0,J.jsx)(I,{className:`h-3 w-40`})]})]},e)}function Oe(e){let t=(0,B.c)(10),{result:n,onNavigate:r}=e,{_:o}=a(),s;t[0]!==o||t[1]!==n.warnings?(s=n.warnings.length>0&&(0,J.jsx)(`ul`,{"aria-label":o({id:`Rsdhj9`}),className:`flex flex-col gap-0.5 pb-1`,children:n.warnings.map(ke)}),t[0]=o,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,J.jsx)(F,{className:`px-2`,children:(0,J.jsx)(i,{id:`k_Dqw1`,values:{0:n.fileCount}})}):n.files.map(e=>(0,J.jsx)(Ae,{file:e,onNavigate:r},e.file)),t[3]=r,t[4]=n.fileCount,t[5]=n.files,t[6]=c):c=t[6];let l;return t[7]!==s||t[8]!==c?(l=(0,J.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[s,c]}),t[7]=s,t[8]=c,t[9]=l):l=t[9],l}function ke(e,t){return(0,J.jsxs)(`li`,{className:`flex items-start gap-1.5 px-2 text-xs`,children:[(0,J.jsx)(D,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-amber-500`}),(0,J.jsx)(`span`,{className:`min-w-0 text-foreground`,children:e})]},`${t}-${e}`)}function Ae(e){let t=(0,B.c)(37),{file:n,onNavigate:r}=e,{_:i}=a(),o,s,c,l,u,m,h,g,_;if(t[0]!==i||t[1]!==n.diagnostics||t[2]!==n.file||t[3]!==r){let e=[...n.diagnostics].sort(he);s=p,h=!0,g=`problems-audit-group`;let a;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,J.jsx)(S,{"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]=a):a=t[13];let v;t[14]===n.file?v=t[15]:(v=(0,J.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]=v),_=(0,J.jsxs)(f,{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:[a,v,(0,J.jsx)(P,{variant:`gray`,"data-testid":`problems-audit-file-count`,className:`shrink-0`,children:e.length})]}),o=d,m=`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 y;t[19]!==i||t[20]!==n.file||t[21]!==r?(y=e=>{let t=e.range.start.line+1;return(0,J.jsx)(`li`,{children:(0,J.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,J.jsx)(_e,{diagnostic:e})})},ve(e))},t[19]=i,t[20]=n.file,t[21]=r,t[22]=y):y=t[22],u=e.map(y),t[0]=i,t[1]=n.diagnostics,t[2]=n.file,t[3]=r,t[4]=o,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=m,t[10]=h,t[11]=g,t[12]=_}else o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],m=t[9],h=t[10],g=t[11],_=t[12];let v;t[23]!==c||t[24]!==l||t[25]!==u?(v=(0,J.jsx)(`ul`,{"aria-label":c,className:l,children:u}),t[23]=c,t[24]=l,t[25]=u,t[26]=v):v=t[26];let y;t[27]!==o||t[28]!==m||t[29]!==v?(y=(0,J.jsx)(o,{className:m,children:v}),t[27]=o,t[28]=m,t[29]=v,t[30]=y):y=t[30];let b;return t[31]!==s||t[32]!==h||t[33]!==g||t[34]!==_||t[35]!==y?(b=(0,J.jsxs)(s,{defaultOpen:h,"data-testid":g,children:[_,y]}),t[31]=s,t[32]=h,t[33]=g,t[34]=_,t[35]=y,t[36]=b):b=t[36],b}var je={words:0,chars:0,tokens:0},Me=/[ -〿-ゟ゠-ヿ㐀-䶿一-鿿豈---ក-]/,Ne=/[\p{L}\p{N}]/u,Pe=new Set([`text`,`inlineCode`,`code`,`tag`]),Fe=new Set([`html`,`definition`,`footnoteDefinition`,`yaml`,`toml`,`image`,`imageReference`,`mdxFlowExpression`,`mdxTextExpression`,`mdxjsEsm`,`rawMdxFallback`,`rawMdxFallbackMdast`]),Ie=new Set([`paragraph`,`heading`,`blockquote`,`list`,`listItem`,`thematicBreak`,`table`,`tableRow`,`tableCell`,`mdxJsxFlowElement`,`commentBlock`]);function Le(e,t){if(!e)return;let n=e.type;if(!Fe.has(n)){if(Pe.has(n)){e.value&&(t.push(e.value),n===`code`&&t.push(`
|
|
1
|
+
import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./jsx-runtime-DyiINK0N.js";import{n}from"./DocumentContext-B_zqYuAI.js";import{t as r}from"./react-JNybMug3.js";import{n as i,r as a}from"./dist-DBENJeML.js";import{r as o,t as s}from"./useQuery-NsPxD6kI.js";import{t as c}from"./compiler-runtime-dQcBxOhn.js";import{s as l}from"./createLucideIcon-BUb14crZ.js";import{t as u}from"./button-DHE6Sx02.js";import{n as d,r as f,t as p}from"./collapsible-BIzY37go.js";import{B as m,I as h}from"./CodeMirrorPropInput-D0RRvxEm.js";import{n as g,t as _}from"./toggle-group-CxrQL99E.js";import{Yr as v,fr as y,gt as b,pt as x}from"./dist-Ca38G5U3.js";import{t as S}from"./chevron-right-zaL9JagC.js";import{n as C}from"./CopyButton-D0gTyMvW.js";import{i as w}from"./prop-types-IIZw7u0n.js";import{l as T}from"./workspace-paths-Dgj2u8bQ.js";import{t as E}from"./refresh-cw-DSH9Of_0.js";import{t as D}from"./triangle-alert-DpxK7pzx.js";import{t as O}from"./wrench-BDWKT3wQ.js";import{n as k}from"./dist-DwCd6eR-.js";import{t as A}from"./dist-BD3698ve.js";import{i as j}from"./startup-marks-CytO17UM.js";import{a as M,s as N}from"./doc-hash-Bs2ss-ac.js";import{t as P}from"./badge-BDZGi1Ks.js";import{a as ee,i as F,n as te,o as ne,r as re,s as ie,t as ae}from"./panel-DLUMbyPl.js";import{t as I}from"./skeleton-CA6hvjst.js";import{i as L,r as R}from"./lint-config-client-DMUkUIUK.js";var z=e(r(),1),B=c(),V=3e4,H=new Map;function U(e){return e?Date.now()-e.rememberedAt>V?null:e.navigation:null}function W(e,t){H.set(e,{navigation:t,rememberedAt:Date.now()})}function G(e){return U(H.get(e))}function K(e){let t=H.get(e);return H.delete(e),U(t)}function q(e){H.delete(e)}function oe(e,t){let n=(0,B.c)(4),r=t===void 0?!1:t,[i,a]=(0,z.useState)(void 0),o=(0,z.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,z.useEffect)(s,c),i}var J=t(),se=300;async function ce(e){let t=await fetch(`/api/page-headings?docName=${encodeURIComponent(e)}`),n;try{n=await t.json()}catch(e){throw new m(A._({id:`qAQVSD`}),{cause:e,status:t.status})}if(!t.ok){let e=b.safeParse(n);throw e.success?Error(e.data.title):new m(A._({id:`zlErBl`}),{status:t.status})}let r=x.safeParse(n);if(!r.success)throw new m(A._({id:`XW18jo`}),{status:t.status});return r.data.headings??[]}var le=32,Y=12,X=6,ue=`open-knowledge:outline-nav`;function Z(e){let t=(0,B.c)(2),n;return t[0]===e?n=t[1]:(n=(0,J.jsx)(j,{name:`outline-panel`,children:(0,J.jsx)(de,{...e})}),t[0]=e,t[1]=n),n}function de(e){let t=(0,B.c)(50),{docName:r,isSourceMode:c,className:u}=e,d=u===void 0?``:u,{_:f}=a(),{pages:p,loading:m}=w(),h=o(),{activeProvider:g,activeDocName:_}=n(),v,b;t[0]===r?(v=t[1],b=t[2]):(v=[`page-headings`,r],b=()=>ce(r),t[0]=r,t[1]=v,t[2]=b);let x;t[3]!==r||t[4]!==m||t[5]!==p?(x=!m&&(p.has(r)||y(r)),t[3]=r,t[4]=m,t[5]=p,t[6]=x):x=t[6];let S;t[7]!==v||t[8]!==b||t[9]!==x?(S={queryKey:v,queryFn:b,enabled:x,staleTime:1/0},t[7]=v,t[8]=b,t[9]=x,t[10]=S):S=t[10];let{data:C,isLoading:T,error:E}=s(S),D;t[11]===C?D=t[12]:(D=C===void 0?[]:C,t[11]=C,t[12]=D);let O=D,k,A;t[13]!==_||t[14]!==g||t[15]!==r||t[16]!==h?(k=()=>{if(!g||_!==r)return;let e=g.document,t=null,n=()=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{t=null,h.invalidateQueries({queryKey:[`page-headings`,r]})},se)};return e.on(`update`,n),()=>{e.off(`update`,n),t!==null&&clearTimeout(t)}},A=[g,_,r,h],t[13]=_,t[14]=g,t[15]=r,t[16]=h,t[17]=k,t[18]=A):(k=t[17],A=t[18]),(0,z.useEffect)(k,A);let j;t[19]===O?j=t[20]:(j=O.map(fe),t[19]=O,t[20]=j);let M=oe(j,c),N;t[21]!==M||t[22]!==O?(N=M?O.findIndex(e=>e.slug===M):-1,t[21]=M,t[22]=O,t[23]=N):N=t[23];let P=N,I;t[24]!==r||t[25]!==c?(I=function(e,t){let n={index:e,slug:t,mode:c?`source`:`wysiwyg`};n.mode===`source`&&W(r,{kind:`outline`,detail:n}),window.dispatchEvent(new CustomEvent(ue,{detail:n}))},t[24]=r,t[25]=c,t[26]=I):I=t[26];let L=I,R=((P>=0?O[P].level:1)-1)*Y+(Y-X)/2,V=P*le+(le-X)/2,H;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,J.jsx)(ie,{children:(0,J.jsx)(i,{id:`dD7NPy`})}),t[27]=H):H=t[27];let U;t[28]!==O.length||t[29]!==T?(U=!T&&(0,J.jsx)(re,{children:O.length}),t[28]=O.length,t[29]=T,t[30]=U):U=t[30];let G;t[31]===U?G=t[32]:(G=(0,J.jsxs)(ne,{children:[H,U]}),t[31]=U,t[32]=G);let K;t[33]!==f||t[34]!==P||t[35]!==M||t[36]!==E||t[37]!==L||t[38]!==O||t[39]!==T||t[40]!==R||t[41]!==V?(K=E?(0,J.jsx)(ee,{className:`px-2`,children:E instanceof Error?E.message:f({id:`GuqOb1`})}):O.length===0&&!T?(0,J.jsx)(F,{className:`px-2`,children:(0,J.jsx)(i,{id:`0BB9ID`})}):(0,J.jsxs)(`nav`,{"aria-label":f({id:`BymzO4`}),className:`relative`,children:[P>=0&&(0,J.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:X,height:X,transform:`translate(${R}px, ${V}px)`}}),O.map((e,t)=>{let n=e.slug===M;return(0,J.jsx)(`button`,{type:`button`,"aria-current":n?`location`:void 0,onClick:()=>L(t,e.slug),className:l(`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)*Y+20}px`},title:e.text,children:e.text},t)})]}),t[33]=f,t[34]=P,t[35]=M,t[36]=E,t[37]=L,t[38]=O,t[39]=T,t[40]=R,t[41]=V,t[42]=K):K=t[42];let q;t[43]!==T||t[44]!==K?(q=(0,J.jsx)(te,{className:`px-3 py-2`,"aria-busy":T,children:K}),t[43]=T,t[44]=K,t[45]=q):q=t[45];let Z;return t[46]!==d||t[47]!==G||t[48]!==q?(Z=(0,J.jsxs)(ae,{className:d,children:[G,q]}),t[46]=d,t[47]=G,t[48]=q,t[49]=Z):Z=t[49],Z}function fe(e){return e.slug}function pe(e){let t=(0,B.c)(10),{scope:n,onScopeChange:r}=e,{_:o}=a(),s;t[0]===r?s=t[1]:(s=e=>{e&&r(e)},t[0]=r,t[1]=s);let c;t[2]===o?c=t[3]:(c=o({id:`aBgwis`}),t[2]=o,t[3]=c);let l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,J.jsx)(g,{value:`doc`,className:`flex-1`,"data-testid":`panel-scope-doc`,children:(0,J.jsx)(i,{id:`UpCz01`})}),t[4]=l):l=t[4];let u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,J.jsx)(g,{value:`project`,className:`flex-1`,"data-testid":`panel-scope-project`,children:(0,J.jsx)(i,{id:`e0NrBM`})}),t[5]=u):u=t[5];let d;return t[6]!==n||t[7]!==s||t[8]!==c?(d=(0,J.jsx)(`div`,{className:`shrink-0 px-4 pb-2`,children:(0,J.jsxs)(_,{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 me=`open-knowledge:lint-nav`;function he(e,t){return e.range.start.line-t.range.start.line||e.range.start.character-t.range.start.character}function ge(e){return{line:e.range.start.line+1,column:e.range.start.character+1}}function _e(e){let t=(0,B.c)(19),{diagnostic:n}=e,{_:r}=a(),i=n.severity===`error`?C:D,o=`${n.source}/${n.code}`,s=n.range.start.line+1,c=n.severity===`error`?`text-destructive`:`text-amber-500`,u;t[0]===c?u=t[1]:(u=l(`mt-0.5 size-3.5 shrink-0`,c),t[0]=c,t[1]=u);let d;t[2]!==i||t[3]!==u?(d=(0,J.jsx)(i,{"aria-hidden":`true`,className:u}),t[2]=i,t[3]=u,t[4]=d):d=t[4];let f;t[5]===n.message?f=t[6]:(f=(0,J.jsx)(`span`,{className:`text-foreground`,children:n.message}),t[5]=n.message,t[6]=f);let p;t[7]!==d||t[8]!==f?(p=(0,J.jsxs)(`span`,{className:`flex items-start gap-1.5 text-sm`,children:[d,f]}),t[7]=d,t[8]=f,t[9]=p):p=t[9];let m;t[10]!==r||t[11]!==s?(m=r({id:`enPTnx`,values:{displayLine:s}}),t[10]=r,t[11]=s,t[12]=m):m=t[12];let h;t[13]!==o||t[14]!==m?(h=(0,J.jsxs)(`span`,{className:`ps-5 font-mono text-xs text-muted-foreground`,children:[o,` · `,m]}),t[13]=o,t[14]=m,t[15]=h):h=t[15];let g;return t[16]!==p||t[17]!==h?(g=(0,J.jsxs)(J.Fragment,{children:[p,h]}),t[16]=p,t[17]=h,t[18]=g):g=t[18],g}function ve(e){return`${e.source}/${e.code}-${e.range.start.line}-${e.range.start.character}-${e.message}`}function ye(e){return e.reduce((e,t)=>e+ +((t.fixes?.length??0)>0),0)}function be(e){let t=(0,B.c)(13),{count:n,disabled:r,onClick:o,children:s}=e,{_:c}=a(),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 d;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,J.jsx)(O,{"aria-hidden":`true`,className:`size-3`}),t[4]=d):d=t[4];let f;t[5]!==s||t[6]!==n?(f=s??(0,J.jsx)(i,{id:`5_8TCr`,values:{count:n}}),t[5]=s,t[6]=n,t[7]=f):f=t[7];let p;return t[8]!==r||t[9]!==o||t[10]!==l||t[11]!==f?(p=(0,J.jsxs)(u,{size:`sm`,variant:`ghost`,className:`h-6 shrink-0 px-2 text-xs`,disabled:r,onClick:o,"aria-label":l,"data-testid":`problems-fix-all`,children:[d,f]}),t[8]=r,t[9]=o,t[10]=l,t[11]=f,t[12]=p):p=t[12],p}function xe(e){let t=(0,B.c)(21),{docName:n,diagnostics:r,onFix:o,onFixAll:s,onAskAi:c}=e,{_:l}=a(),[d,f]=(0,z.useState)(`doc`),p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(p={status:`idle`},t[0]=p):p=t[0];let[m,h]=(0,z.useState)(p),[g,_]=(0,z.useState)(null),v=(0,z.useRef)(!0),y,b;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(y=()=>(v.current=!0,()=>{v.current=!1}),b=[],t[1]=y,t[2]=b):(y=t[1],b=t[2]),(0,z.useEffect)(y,b);let x;if(t[3]!==l||t[4]!==m||t[5]!==r||t[6]!==n||t[7]!==c||t[8]!==o||t[9]!==s||t[10]!==g||t[11]!==d){let e=[...r].sort(he),a=async function(){h({status:`loading`});let e=await L();v.current&&h(e===null?{status:`failed`}:{status:`loaded`,result:e})},p=m.status===`loaded`?m.result.files.filter(we):[],y=async function(){if(g!==null||p.length===0)return;_({done:0,total:p.length});let e=[];for(let t of p){let n=await R(M(t.file));if(!v.current)return;n.ok||e.push({file:t.file,detail:n.errorDetail}),_(Ce)}if(_(null),e.length>0){let t=e[0];k.error(l({id:`fru3T7`,values:{0:e.length,1:p.length}}),{description:t===void 0?void 0:`${t.file}${t.detail===null?``:` — ${t.detail}`}`})}try{await a()}catch{v.current&&h({status:`failed`})}},b=function(e){f(e),e===`project`&&m.status===`idle`&&a()},S;t[13]===n?S=t[14]:(S=function(e){let t=ge(e);W(n,{kind:`lint`,detail:t}),window.dispatchEvent(new CustomEvent(me,{detail:t}))},t[13]=n,t[14]=S);let C=S,w;t[15]!==n||t[16]!==C?(w=function(e,t){let r=M(e);if(r===n){C(t);return}W(r,{kind:`lint`,detail:ge(t)}),window.location.hash=N(r)},t[15]=n,t[16]=C,t[17]=w):w=t[17];let E=w,D;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,J.jsx)(ie,{children:(0,J.jsx)(i,{id:`OXdGnd`})}),t[18]=D):D=t[18];let A=d===`doc`&&e.length>0&&(0,J.jsx)(re,{children:e.length}),j;t[19]===A?j=t[20]:(j=(0,J.jsxs)(ne,{children:[D,A]}),t[19]=A,t[20]=j),x=(0,J.jsxs)(ae,{children:[j,(0,J.jsx)(pe,{scope:d,onScopeChange:b}),d===`doc`?(0,J.jsx)(te,{className:`px-2 py-2`,children:e.length===0?(0,J.jsx)(F,{className:`px-2`,children:(0,J.jsx)(i,{id:`ZI8uvA`})}):(0,J.jsxs)(J.Fragment,{children:[s!==void 0&&(0,J.jsx)(`div`,{className:`flex items-center justify-end gap-2 px-2 pb-1`,children:(0,J.jsx)(be,{count:ye(e),disabled:ye(e)===0,onClick:s})}),(0,J.jsx)(`ul`,{"aria-label":l({id:`OXdGnd`}),className:`flex flex-col gap-0.5`,children:e.map(e=>{let t=e.range.start.line+1,n=o!==void 0&&(e.fixes?.length??0)>0,r=`${e.source}/${e.code}`;return(0,J.jsxs)(`li`,{className:`group relative rounded transition-colors hover:bg-muted`,children:[(0,J.jsx)(`button`,{type:`button`,onClick:()=>C(e),className:`flex w-full cursor-pointer flex-col gap-0.5 rounded px-2 py-1.5 text-left`,title:l({id:`aHPdYV`,values:{displayLine:t}}),children:(0,J.jsx)(_e,{diagnostic:e})}),n||c!==void 0?(0,J.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,J.jsxs)(u,{size:`sm`,variant:`ghost`,className:`h-6 shrink-0 px-2 text-xs`,onClick:()=>o?.(e),"aria-label":l({id:`fZj9em`,values:{flatId:r}}),"data-testid":`problems-fix`,children:[(0,J.jsx)(O,{"aria-hidden":`true`,className:`size-3`}),(0,J.jsx)(i,{id:`c4fVUV`})]}):null,c===void 0?null:(0,J.jsxs)(u,{size:`sm`,variant:`ghost`,className:`h-6 shrink-0 px-2 text-xs`,onClick:()=>c(e),"aria-label":l({id:`hh4mVC`,values:{flatId:r}}),"data-testid":`problems-ask-ai`,children:[(0,J.jsx)(T,{"aria-hidden":`true`,className:`size-3`}),(0,J.jsx)(i,{id:`xWEvuo`})]})]}):null]},ve(e))})})]})}):(0,J.jsx)(Ee,{audit:m,onRefresh:()=>void a(),onNavigate:E,fixableCount:p.reduce(Se,0),fixing:g,onFixAll:()=>void y()})]}),t[3]=l,t[4]=m,t[5]=r,t[6]=n,t[7]=c,t[8]=o,t[9]=s,t[10]=g,t[11]=d,t[12]=x}else x=t[12];return x}function Se(e,t){return e+ye(t.diagnostics)}function Ce(e){return e===null?e:{...e,done:e.done+1}}function we(e){return e.diagnostics.some(Te)}function Te(e){return(e.fixes?.length??0)>0}function Ee(e){let t=(0,B.c)(43),{audit:n,onRefresh:r,onNavigate:o,fixableCount:s,fixing:c,onFixAll:l}=e,{_:d}=a(),f=n.status===`loading`||n.status===`idle`,p;t[0]!==n.result||t[1]!==n.status?(p=n.status===`loaded`&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(i,{id:`DsDwR-`,values:{0:n.result.errorCount}}),` · `,(0,J.jsx)(i,{id:`W1SI2K`,values:{0:n.result.warningCount}})]}),t[0]=n.result,t[1]=n.status,t[2]=p):p=t[2];let m;t[3]===p?m=t[4]:(m=(0,J.jsx)(`p`,{className:`text-xs text-muted-foreground`,"data-testid":`problems-audit-summary`,children:p}),t[3]=p,t[4]=m);let h;t[5]!==d||t[6]!==c?(h=c===null?null:(0,J.jsx)(`span`,{className:`sr-only`,role:`status`,children:d({id:`gZElfU`,values:{0:c.done,1:c.total}})}),t[5]=d,t[6]=c,t[7]=h):h=t[7];let g=f||c!==null||s===0,_;t[8]===c?_=t[9]:(_=c===null?void 0:(0,J.jsx)(i,{id:`S9t1PI`,values:{0:c.done,1:c.total}}),t[8]=c,t[9]=_);let v;t[10]!==s||t[11]!==l||t[12]!==g||t[13]!==_?(v=(0,J.jsx)(be,{count:s,disabled:g,onClick:l,children:_}),t[10]=s,t[11]=l,t[12]=g,t[13]=_,t[14]=v):v=t[14];let y;t[15]===d?y=t[16]:(y=d({id:`WRdYfS`}),t[15]=d,t[16]=y);let b=f||c!==null,x;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,J.jsx)(E,{"aria-hidden":`true`,className:`size-3.5`}),t[17]=x):x=t[17];let S;t[18]!==r||t[19]!==y||t[20]!==b?(S=(0,J.jsx)(u,{variant:`ghost`,size:`icon`,className:`size-6 shrink-0 text-muted-foreground`,"aria-label":y,"data-testid":`problems-audit-refresh`,disabled:b,onClick:r,children:x}),t[18]=r,t[19]=y,t[20]=b,t[21]=S):S=t[21];let C;t[22]!==S||t[23]!==h||t[24]!==v?(C=(0,J.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[h,v,S]}),t[22]=S,t[23]=h,t[24]=v,t[25]=C):C=t[25];let w;t[26]!==C||t[27]!==m?(w=(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-2 pb-1`,children:[m,C]}),t[26]=C,t[27]=m,t[28]=w):w=t[28];let T;t[29]!==d||t[30]!==f?(T=f&&(0,J.jsx)(`div`,{className:`flex flex-col gap-1`,role:`status`,"aria-busy":`true`,"aria-label":d({id:`dx-TwN`}),children:[1,2,3].map(De)}),t[29]=d,t[30]=f,t[31]=T):T=t[31];let D;t[32]===n.status?D=t[33]:(D=n.status===`failed`&&(0,J.jsx)(ee,{className:`px-2 text-xs`,children:(0,J.jsx)(i,{id:`IFezUv`})}),t[32]=n.status,t[33]=D);let O;t[34]!==n.result||t[35]!==n.status||t[36]!==o?(O=n.status===`loaded`&&(0,J.jsx)(Oe,{result:n.result,onNavigate:o}),t[34]=n.result,t[35]=n.status,t[36]=o,t[37]=O):O=t[37];let k;return t[38]!==w||t[39]!==T||t[40]!==D||t[41]!==O?(k=(0,J.jsxs)(te,{className:`px-2 py-2`,"data-testid":`problems-project-scope`,children:[w,T,D,O]}),t[38]=w,t[39]=T,t[40]=D,t[41]=O,t[42]=k):k=t[42],k}function De(e){return(0,J.jsxs)(`div`,{className:`flex items-start gap-2.5 rounded px-2 py-1.5`,children:[(0,J.jsx)(I,{className:`mt-0.5 size-3.5 shrink-0 rounded`}),(0,J.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,J.jsx)(I,{className:`h-3 w-28`}),(0,J.jsx)(I,{className:`h-3 w-40`})]})]},e)}function Oe(e){let t=(0,B.c)(10),{result:n,onNavigate:r}=e,{_:o}=a(),s;t[0]!==o||t[1]!==n.warnings?(s=n.warnings.length>0&&(0,J.jsx)(`ul`,{"aria-label":o({id:`Rsdhj9`}),className:`flex flex-col gap-0.5 pb-1`,children:n.warnings.map(ke)}),t[0]=o,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,J.jsx)(F,{className:`px-2`,children:(0,J.jsx)(i,{id:`k_Dqw1`,values:{0:n.fileCount}})}):n.files.map(e=>(0,J.jsx)(Ae,{file:e,onNavigate:r},e.file)),t[3]=r,t[4]=n.fileCount,t[5]=n.files,t[6]=c):c=t[6];let l;return t[7]!==s||t[8]!==c?(l=(0,J.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[s,c]}),t[7]=s,t[8]=c,t[9]=l):l=t[9],l}function ke(e,t){return(0,J.jsxs)(`li`,{className:`flex items-start gap-1.5 px-2 text-xs`,children:[(0,J.jsx)(D,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-amber-500`}),(0,J.jsx)(`span`,{className:`min-w-0 text-foreground`,children:e})]},`${t}-${e}`)}function Ae(e){let t=(0,B.c)(37),{file:n,onNavigate:r}=e,{_:i}=a(),o,s,c,l,u,m,h,g,_;if(t[0]!==i||t[1]!==n.diagnostics||t[2]!==n.file||t[3]!==r){let e=[...n.diagnostics].sort(he);s=p,h=!0,g=`problems-audit-group`;let a;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,J.jsx)(S,{"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]=a):a=t[13];let v;t[14]===n.file?v=t[15]:(v=(0,J.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]=v),_=(0,J.jsxs)(f,{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:[a,v,(0,J.jsx)(P,{variant:`gray`,"data-testid":`problems-audit-file-count`,className:`shrink-0`,children:e.length})]}),o=d,m=`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 y;t[19]!==i||t[20]!==n.file||t[21]!==r?(y=e=>{let t=e.range.start.line+1;return(0,J.jsx)(`li`,{children:(0,J.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,J.jsx)(_e,{diagnostic:e})})},ve(e))},t[19]=i,t[20]=n.file,t[21]=r,t[22]=y):y=t[22],u=e.map(y),t[0]=i,t[1]=n.diagnostics,t[2]=n.file,t[3]=r,t[4]=o,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=m,t[10]=h,t[11]=g,t[12]=_}else o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],m=t[9],h=t[10],g=t[11],_=t[12];let v;t[23]!==c||t[24]!==l||t[25]!==u?(v=(0,J.jsx)(`ul`,{"aria-label":c,className:l,children:u}),t[23]=c,t[24]=l,t[25]=u,t[26]=v):v=t[26];let y;t[27]!==o||t[28]!==m||t[29]!==v?(y=(0,J.jsx)(o,{className:m,children:v}),t[27]=o,t[28]=m,t[29]=v,t[30]=y):y=t[30];let b;return t[31]!==s||t[32]!==h||t[33]!==g||t[34]!==_||t[35]!==y?(b=(0,J.jsxs)(s,{defaultOpen:h,"data-testid":g,children:[_,y]}),t[31]=s,t[32]=h,t[33]=g,t[34]=_,t[35]=y,t[36]=b):b=t[36],b}var je={words:0,chars:0,tokens:0},Me=/[ -〿-ゟ゠-ヿ㐀-䶿一-鿿豈---ក-]/,Ne=/[\p{L}\p{N}]/u,Pe=new Set([`text`,`inlineCode`,`code`,`tag`]),Fe=new Set([`html`,`definition`,`footnoteDefinition`,`yaml`,`toml`,`image`,`imageReference`,`mdxFlowExpression`,`mdxTextExpression`,`mdxjsEsm`,`rawMdxFallback`,`rawMdxFallbackMdast`]),Ie=new Set([`paragraph`,`heading`,`blockquote`,`list`,`listItem`,`thematicBreak`,`table`,`tableRow`,`tableCell`,`mdxJsxFlowElement`,`commentBlock`]);function Le(e,t){if(!e)return;let n=e.type;if(!Fe.has(n)){if(Pe.has(n)){e.value&&(t.push(e.value),n===`code`&&t.push(`
|
|
2
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)Le(n,t);if(Ie.has(n)&&t.length>0){let e=t[t.length-1];e&&!e.endsWith(`
|
|
3
3
|
`)&&t.push(`
|
|
4
4
|
`)}}}}function Re(e){try{let t=h().parseToMdast(e),n=[];return Le(t,n),n.join(``).trim()}catch(t){return console.warn(`[document-stats] mdast parse failed, falling back to raw text`,t),e.trim()}}function ze(e){if(!e)return 0;let t=0;for(let n of e.split(/\s+/))Ne.test(n)&&t++;return t}function Be(e){let t=globalThis.Intl.Segmenter;if(!t)return ze(e);let n=new t(void 0,{granularity:`word`}),r=0;for(let t of n.segment(e))t.isWordLike&&r++;return r}function Ve(e){let t=Me.test(e)?1.5:4;return Math.ceil(e.length/t)}function He(e){return e?{words:Me.test(e)?Be(e):ze(e),chars:e.length,tokens:Ve(e)}:{words:0,chars:0,tokens:0}}function Ue(e){if(!e)return{words:0,chars:0,tokens:0};let{body:t}=v(e);return t.trim()?He(Re(t)):{words:0,chars:0,tokens:0}}function We(e,{isMarkdown:t}){let n=e.trim();return n?He(t?Re(e):n):je}var Q=new Map,$=new Set,Ge=(e,t)=>`${t}:${e}`;function Ke(){for(let e of $)e()}function qe(e,t,n){let r=Ge(e,t);if(n===null){Q.delete(r)&&Ke();return}let i=Q.get(r);i&&i.words===n.words&&i.chars===n.chars&&i.tokens===n.tokens||(Q.set(r,n),Ke())}function Je(e,t){return e===null?null:Q.get(Ge(e,t))??null}function Ye(e){return $.add(e),()=>{$.delete(e)}}function Xe(e){let{from:t,to:n,empty:r}=e.state.selection;if(r)return null;let i=e.state.doc.textBetween(t,n,`
|
package/dist/public/assets/{use-activity-panel-BsQxJQD5.js → use-activity-panel-BQma_v27.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./chunk-DseTPa7n.js";import{n as t}from"./DocumentContext-
|
|
1
|
+
import{i as e}from"./chunk-DseTPa7n.js";import{n as t}from"./DocumentContext-B_zqYuAI.js";import{t as n}from"./react-JNybMug3.js";import{t as r}from"./compiler-runtime-dQcBxOhn.js";import{B as i}from"./CodeMirrorPropInput-D0RRvxEm.js";import{a,gt as o,i as s}from"./dist-Ca38G5U3.js";import{o as c}from"./documents-events-CVeZVUoq.js";import{n as l}from"./agent-presence-DdJtLtJ1.js";import{t as u}from"./lru-string-cache-D19dwCKJ.js";var d=r(),f=e(n(),1),p=500,m=64;async function h(e){let t=`/api/agent-activity?agentId=${encodeURIComponent(e)}`,n=await fetch(t),r;try{r=await n.json()}catch(e){throw new i(`Could not parse /api/agent-activity response.`,{cause:e,status:n.status})}if(!n.ok){let e=o.safeParse(r);throw e.success?Error(e.data.title):new i(`/api/agent-activity returned a non-RFC-9457 error response.`,{cause:e.error,status:n.status})}let a=s.safeParse(r);if(!a.success)throw new i(`/api/agent-activity returned a body that did not match AgentActivitySuccessSchema.`,{cause:a.error,status:n.status});return a.data}async function g(e,t,n){let r=`/api/agent-burst-diff?agentId=${encodeURIComponent(e)}&docName=${encodeURIComponent(t)}&keptCount=${n}`,s=await fetch(r),c;try{c=await s.json()}catch(e){throw new i(`Could not parse /api/agent-burst-diff response.`,{cause:e,status:s.status})}if(!s.ok){let e=o.safeParse(c);throw e.success?Error(e.data.title):new i(`/api/agent-burst-diff returned a non-RFC-9457 error response.`,{cause:e.error,status:s.status})}let l=a.safeParse(c);if(!l.success)throw new i(`/api/agent-burst-diff returned a body that did not match AgentBurstDiffSuccessSchema.`,{cause:l.error,status:s.status});let{diff:u,before:d,after:f}=l.data;return{diff:u,before:d,after:f}}function _(e){let n=(0,d.c)(23),{systemProvider:r}=t(),[i,a]=(0,f.useState)(null),[o,s]=(0,f.useState)(`idle`),[l,_]=(0,f.useState)(null),b;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(b=new u(m),n[0]=b):b=n[0];let x=(0,f.useRef)(b),S=(0,f.useRef)(0),C;n[1]===r?C=n[2]:(C=e=>{let t=S.current+=1;s(`loading`),_(null),h(e).then(n=>{if(S.current!==t)return;let i=y(r,e);a({...n,writingDocs:i}),s(`ready`)}).catch(e=>{S.current===t&&(_(e instanceof Error?e.message:String(e)),s(`error`))})},n[1]=r,n[2]=C);let w=C,T;n[3]!==e||n[4]!==w?(T=()=>{if(!e){S.current+=1,a(null),s(`idle`),_(null),x.current.clear();return}x.current.clear(),w(e);let t=null,n=c(n=>{n.includes(`session-activity`)&&(t&&clearTimeout(t),t=setTimeout(()=>{t=null,w(e)},p))});return()=>{t&&clearTimeout(t),n()}},n[3]=e,n[4]=w,n[5]=T):T=n[5];let E;n[6]===e?E=n[7]:(E=[e],n[6]=e,n[7]=E),(0,f.useEffect)(T,E);let D,O;n[8]!==e||n[9]!==r?(D=()=>{if(!e||!r)return;let t=()=>{if(!r.awareness)return;let t=y(r,e);a(e=>!e||v(e.writingDocs,t)?e:{...e,writingDocs:t})},n=r.awareness;if(!n||typeof n.on!=`function`){t();return}n.on(`update`,t),t();let i=setInterval(t,1e3);return()=>{clearInterval(i),typeof n.off==`function`&&n.off(`update`,t)}},O=[e,r],n[8]=e,n[9]=r,n[10]=D,n[11]=O):(D=n[10],O=n[11]),(0,f.useEffect)(D,O);let k;n[12]===e?k=n[13]:(k=async(t,n)=>{if(!e)return``;let r=`${t}\0${n}`,i=x.current.get(r);if(i!==void 0)return i;let{diff:a}=await g(e,t,n);return x.current.set(r,a),a},n[12]=e,n[13]=k);let A=k,j;n[14]!==e||n[15]!==w?(j=()=>{e&&w(e)},n[14]=e,n[15]=w,n[16]=j):j=n[16];let M=j,N;return n[17]!==i||n[18]!==l||n[19]!==A||n[20]!==M||n[21]!==o?(N={data:i,status:o,error:l,reload:M,fetchBurstDiff:A},n[17]=i,n[18]=l,n[19]=A,n[20]=M,n[21]=o,n[22]=N):N=n[22],N}function v(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function y(e,t){let n=new Set;if(!e)return n;let r=e.awareness;if(!l(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}export{_ as n,g as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./react-JNybMug3.js";import{t as n}from"./compiler-runtime-dQcBxOhn.js";import{Oa as r,ba as i}from"./dist-
|
|
1
|
+
import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./react-JNybMug3.js";import{t as n}from"./compiler-runtime-dQcBxOhn.js";import{Oa as r,ba as i}from"./dist-Ca38G5U3.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=i(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
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=r(n?e:`default`),a=document.documentElement;i.id===`default`?a.removeAttribute(v):a.setAttribute(v,i.id);let o=null;if(i.id===`custom`){let e=u(t),n=h(e);b(n),o=JSON.stringify({css:n,dark:f(e)===`dark`})}else x();try{i.id===`default`?localStorage.removeItem(g):localStorage.setItem(g,i.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{t}from"./react-JNybMug3.js";import{t as n}from"./compiler-runtime-dQcBxOhn.js";import{d as r,f as i,l as a,m as o,p as s,u as c}from"./dist-
|
|
1
|
+
import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./react-JNybMug3.js";import{t as n}from"./compiler-runtime-dQcBxOhn.js";import{d as r,f as i,l as a,m as o,p as s,u as c}from"./dist-Ca38G5U3.js";var l=e(t(),1),u=n();async function d(e){let t;try{t=await fetch(`/api/config`,{signal:e,headers:{Accept:`application/json`}})}catch(e){if(e.name===`AbortError`)throw e;return{status:`error`,code:`network`}}if(t.status===404||t.status===501)return{status:`absent`};if(!t.ok)return{status:`error`,code:t.status};let n;try{n=await t.json()}catch{return{status:`error`,code:`invalid-body`}}if(typeof n!=`object`||!n||Array.isArray(n))return{status:`error`,code:`invalid-body`};let r=n;return{status:`ok`,config:{collabUrl:typeof r.collabUrl==`string`?r.collabUrl:null,previewUrl:typeof r.previewUrl==`string`?r.previewUrl:null,port:typeof r.port==`number`?r.port:0,singleFile:r.singleFile===!0}}}function f(e){return b(e,i)}function p(e){return b(e,o)}function m(e){return b(e,a)}function h(e){return b(e,r)}function g(e){return b(e,c)}function _(e){let t=b(e,s);if(!t)return null;try{return{docName:t.docName,sv:v(t.sv)}}catch{return null}}function v(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}function y(e,t){let n=p(e);if(n){t.onServerInfo?.(n);return}let r=m(e);if(r){t.onBranchSwitched?.(r);return}let i=_(e);if(i){t.onDiskAck?.(i);return}let a=f(e);if(a){t.onDerivedView?.(a);return}let o=h(e);if(o){t.onConfigValidationRejected?.(o);return}let s=g(e);if(s){t.onConfigIgnoreNestedError?.(s);return}t.onUnknown?.(e)}function b(e,t){let n;try{n=JSON.parse(e)}catch{return null}let r=t.safeParse(n);return r.success?r.data:null}function x(){return typeof location>`u`?`ws://localhost/collab`:`${location.protocol===`https:`?`wss`:`ws`}://${location.host}/collab`}function S(e){if(e===void 0)return null;let t=e.okDesktop;return!t||!t.config.collabUrl||t.config.collabUrl.length===0?null:t}function C(e){return{collabUrl:e.collabUrl,attempts:0,terminal:!1,lastError:null}}var w=2e3,T=15e3;function E(e){let t=e.terminalAfterMs??3e4,n=e.initialDelayMs??w,r=e.maxDelayMs??T,i=e.log??{info:console.info,warn:console.warn},a=new AbortController,o=null,s=n,c=0,l=!1,u=!1,d=null,f=e.now(),p=async()=>{c+=1;let n=null;try{let t=await e.fetchConfig(a.signal);t.status===`absent`?(n=e.fallbackUrl(),d=null):t.status===`ok`&&t.config.collabUrl!==null?(n=t.config.collabUrl,d=null):t.status===`ok`?(u||(u=!0,i.info(`[collab-url] ok ui responded but server.lock has no port yet — retrying`)),d={kind:`null-collab`}):t.status===`error`&&(i.warn(`[collab-url] /api/config error (${t.code}) — retrying in ${s}ms`),d={kind:`error`,code:t.code})}catch(e){if(e.name===`AbortError`)return;d={kind:`error`,code:`network`}}if(!l){if(n!==null){e.onStateChange({collabUrl:n,attempts:c,terminal:!1,lastError:null});return}if(e.now()-f>=t){e.onStateChange({collabUrl:null,attempts:c,terminal:!0,lastError:d});return}e.onStateChange({collabUrl:null,attempts:c,terminal:!1,lastError:d}),o=e.setTimeout(()=>{p()},s),s=Math.min(s*2,r)}};return p(),{cancel:()=>{l=!0,a.abort(),o!==null&&(e.clearTimeout(o),o=null)}}}function D(){let e=(0,u.c)(8),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={collabUrl:null,attempts:0,terminal:!1,lastError:null},e[0]=t):t=e[0];let[n,r]=(0,l.useState)(t),i;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(i={token:0},e[1]=i):i=e[1];let a=(0,l.useRef)(i),[o,s]=(0,l.useState)(0),c;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>{let e=a.current.token=a.current.token+1,t=S(window);if(t){r(C(t.config));let n=t.onProjectSwitched(t=>{e===a.current.token&&r(C(t))});return()=>{n()}}let n=E({fetchConfig:d,fallbackUrl:x,now:Date.now,setTimeout:j,clearTimeout:A,onStateChange:t=>{e===a.current.token&&r(t)}});return()=>{n.cancel()}},e[2]=c):c=e[2];let f;e[3]===o?f=e[4]:(f=[o],e[3]=o,e[4]=f),(0,l.useEffect)(c,f);let p;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=()=>{a.current.token=a.current.token+1,r(k),s(O)},e[5]=p):p=e[5];let m=p,h;return e[6]===n?h=e[7]:(h={...n,retry:m},e[6]=n,e[7]=h),h}function O(e){return e+1}function k(e){return{...e,terminal:!1,lastError:null}}function A(e){return globalThis.clearTimeout(e)}function j(e,t){return globalThis.setTimeout(e,t)}export{d as i,D as n,y as r,S as t};
|
package/dist/public/assets/{use-live-xterm-theme-oqXGh0AM.js → use-live-xterm-theme-Dz6hvjuv.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./react-JNybMug3.js";import{t as n}from"./compiler-runtime-dQcBxOhn.js";import{t as r}from"./use-apply-config-color-theme-
|
|
1
|
+
import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./react-JNybMug3.js";import{t as n}from"./compiler-runtime-dQcBxOhn.js";import{t as r}from"./use-apply-config-color-theme-C0Cek6NJ.js";var i=e(t(),1),a=n(),o={background:`#171717`,foreground:`#e5e5e5`,cursor:`#e5e5e5`,cursorAccent:`#171717`,selectionBackground:`#3a3d41`,black:`#000000`,red:`#cd3131`,green:`#0dbc79`,yellow:`#e5e510`,blue:`#2472c8`,magenta:`#bc3fbc`,cyan:`#11a8cd`,white:`#e5e5e5`,brightBlack:`#666666`,brightRed:`#f14c4c`,brightGreen:`#23d18b`,brightYellow:`#f5f543`,brightBlue:`#3b8eea`,brightMagenta:`#d670d6`,brightCyan:`#29b8db`,brightWhite:`#ffffff`},s={background:`#ffffff`,foreground:`#262626`,cursor:`#262626`,cursorAccent:`#ffffff`,selectionBackground:`#add6ff`,black:`#000000`,red:`#cd3131`,green:`#00bc00`,yellow:`#949800`,blue:`#0451a5`,magenta:`#bc05bc`,cyan:`#0598bc`,white:`#555555`,brightBlack:`#666666`,brightRed:`#cd3131`,brightGreen:`#14ce14`,brightYellow:`#b5ba00`,brightBlue:`#0451a5`,brightMagenta:`#bc05bc`,brightCyan:`#0598bc`,brightWhite:`#a5a5a5`};function c(e){return e===`dark`?o:s}function l(e){try{let t=document.createElement(`span`);t.style.display=`none`,t.style.backgroundColor=`var(${e})`,document.body.appendChild(t);try{let e=getComputedStyle(t).backgroundColor;return!e||e===`rgba(0, 0, 0, 0)`||e===`transparent`||e.includes(`var(`)?null:e}finally{t.remove()}}catch{return null}}function u(e,t=l){let n=c(e),r=t(`--background`)??n.background,i=t(`--foreground`)??n.foreground;return{...n,background:r,foreground:i,cursor:i,cursorAccent:r,selectionBackground:t(`--selection-soft`)??n.selectionBackground}}function d(e,t){let n=new Set([...Object.keys(e),...Object.keys(t)]);for(let r of n)if(e[r]!==t[r])return!1;return!0}function f(e){let t=(0,a.c)(5),n;t[0]===e?n=t[1]:(n=()=>u(e),t[0]=e,t[1]=n);let[o,s]=(0,i.useState)(n),c,l;return t[2]===e?(c=t[3],l=t[4]):(c=()=>{let t=()=>{let t=u(e);s(e=>d(e,t)?e:t)};t();let n=new MutationObserver(t);return n.observe(document.documentElement,{attributes:!0,attributeFilter:[r,`class`]}),n.observe(document.head,{childList:!0,subtree:!0,characterData:!0}),()=>n.disconnect()},l=[e],t[2]=e,t[3]=c,t[4]=l),(0,i.useEffect)(c,l),o}export{f as t};
|
package/dist/public/assets/{use-terminal-enabled-jZPkRHXb.js → use-terminal-enabled-qFZ8rXL0.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./compiler-runtime-dQcBxOhn.js";import{t}from"./terminal-telemetry-
|
|
1
|
+
import{t as e}from"./compiler-runtime-dQcBxOhn.js";import{t}from"./terminal-telemetry-D1aeGl-R.js";import{Sa as n}from"./dist-Ca38G5U3.js";import"./config-provider-DNXd8psn.js";import{n as r}from"./config-context-C5AosGyi.js";var i=e();function a(){let e=(0,i.c)(3),{projectLocalConfig:t,projectLocalSynced:n}=r(),a=t?.terminal?.enabled??null,o;return e[0]!==n||e[1]!==a?(o={enabled:a,synced:n},e[0]=n,e[1]=a,e[2]=o):o=e[2],o}function o(){let e=(0,i.c)(2),{projectLocalBinding:a}=r();if(a===null)return null;let o;return e[0]===a?o=e[1]:(o=e=>{let r=a.patch({terminal:{enabled:e}});return r.ok&&e&&t(),r.ok?{ok:!0}:{ok:!1,error:n(r.error)}},e[0]=a,e[1]=o),o}export{o as n,a as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e,t}from"./chunk-DseTPa7n.js";import{t as n}from"./jsx-runtime-DyiINK0N.js";import{n as r,p as i}from"./DocumentContext-C4eewS75.js";import{t as a}from"./react-JNybMug3.js";import{t as o}from"./react-dom-Db7zF7dM.js";import{t as s}from"./compiler-runtime-dQcBxOhn.js";import{I as c,et as l,st as u}from"./CodeMirrorPropInput-BDpilu8K.js";import{Bi as d,Gi as f,K as p,Ki as m,Oi as h,Qi as g,Vi as _,Xi as v,Yr as y,ea as b,hi as x,na as S,ta as C}from"./dist-Vm1kQiqo.js";import{t as ee}from"./libesm-BUX1Jc4h.js";var w=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Pointer=void 0,e.unescapeToken=t,e.escapeToken=n;function t(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}function n(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}e.Pointer=function(){function e(e){e===void 0&&(e=[``]),this.tokens=e}return e.fromJSON=function(n){var r=n.split(`/`).map(t);if(r[0]!==``)throw Error(`Invalid JSON Pointer: ${n}`);return new e(r)},e.prototype.toString=function(){return this.tokens.map(n).join(`/`)},e.prototype.evaluate=function(e){for(var t=null,n=``,r=e,i=1,a=this.tokens.length;i<a;i++)t=r,n=this.tokens[i],!(n==`__proto__`||n==`constructor`||n==`prototype`)&&(r=(t||{})[n]);return{parent:t,key:n,value:r}},e.prototype.get=function(e){return this.evaluate(e).value},e.prototype.set=function(e,t){var n=this.evaluate(e);n.parent&&(n.parent[n.key]=t)},e.prototype.push=function(e){this.tokens.push(e)},e.prototype.add=function(t){return new e(this.tokens.concat(String(t)))},e.prototype.parent=function(){return new e(this.tokens.length>1?this.tokens.slice(0,-1):[``])},e}()})),T=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.hasOwnProperty=void 0,e.objectType=t,e.clone=r,e.hasOwnProperty=Object.prototype.hasOwnProperty;function t(e){return e===void 0?`undefined`:e===null?`null`:Array.isArray(e)?`array`:typeof e}function n(e){return typeof e==`object`&&!!e}function r(t){if(!n(t))return t;if(t.constructor==Array){for(var i=t.length,a=Array(i),o=0;o<i;o++)a[o]=r(t[o]);return a}if(t.constructor==Date)return new Date(+t);var s={};for(var c in t)e.hasOwnProperty.call(t,c)&&(s[c]=r(t[c]));return s}})),E=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.isDestructive=n,e.subtract=r,e.intersection=i,e.diffArrays=l,e.diffObjects=u,e.diffAny=d;var t=T();function n(e){var t=e.op;return t===`remove`||t===`replace`||t===`copy`||t===`move`}function r(e,n){var r=[];for(var i in e)t.hasOwnProperty.call(e,i)&&e[i]!==void 0&&!(t.hasOwnProperty.call(n,i)&&n[i]!==void 0)&&r.push(i);return r}function i(e){for(var n=e.length,r={},i=0;i<n;i++){var a=e[i];for(var o in a)t.hasOwnProperty.call(a,o)&&a[o]!==void 0&&(r[o]=(r[o]||0)+1)}for(var o in r)r[o]<n&&delete r[o];return Object.keys(r)}function a(e,n){var r=[];for(var i in e)t.hasOwnProperty.call(e,i)&&e[i]!==void 0&&t.hasOwnProperty.call(n,i)&&n[i]!==void 0&&r.push(i);return r}function o(e){return e.op===`add`}function s(e){return e.op===`remove`}function c(e,t){return{operations:e.operations.concat(t),cost:e.cost+1}}function l(e,t,n,r){r===void 0&&(r=d);var i=Math.max(e.length,t.length),a=new Map([[0,{operations:[],cost:0}]]);function l(o,s){var u=o*i+s,d=a.get(u);if(d===void 0){if(o>0&&s>0&&!r(e[o-1],t[s-1],n.add(String(o-1))).length)d=l(o-1,s-1);else{var f=[];if(o>0){var p=l(o-1,s),m={op:`remove`,index:o-1};f.push(c(p,m))}if(s>0){var h=l(o,s-1),g={op:`add`,index:o-1,value:t[s-1]};f.push(c(h,g))}if(o>0&&s>0){var _=l(o-1,s-1),v={op:`replace`,index:o-1,original:e[o-1],value:t[s-1]};f.push(c(_,v))}d=f.sort(function(e,t){return e.cost-t.cost})[0]}a.set(u,d)}return d}var u=isNaN(e.length)||e.length<=0?0:e.length;return l(u,isNaN(t.length)||t.length<=0?0:t.length).operations.reduce(function(e,t){var i=e[0],a=e[1];if(o(t)){var c=t.index+1+a,l=c<u+a?String(c):`-`,d={op:t.op,path:n.add(l).toString(),value:t.value};return[i.concat(d),a+1]}else if(s(t)){var d={op:t.op,path:n.add(String(t.index+a)).toString()};return[i.concat(d),a-1]}else{var f=n.add(String(t.index+a)),p=r(t.original,t.value,f);return[i.concat.apply(i,p),a]}},[[],0])[0]}function u(e,t,n,i){i===void 0&&(i=d);var o=[];return r(e,t).forEach(function(e){o.push({op:`remove`,path:n.add(e).toString()})}),r(t,e).forEach(function(e){o.push({op:`add`,path:n.add(e).toString(),value:t[e]})}),a(e,t).forEach(function(r){o.push.apply(o,i(e[r],t[r],n.add(r)))}),o}function d(e,n,r,i){if(i===void 0&&(i=d),e===n)return[];var a=(0,t.objectType)(e),o=(0,t.objectType)(n);return a==`array`&&o==`array`?l(e,n,r,i):a==`object`&&o==`object`?u(e,n,r,i):[{op:`replace`,path:r.toString(),value:n}]}})),te=t((e=>{var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,`__esModule`,{value:!0}),e.InvalidOperationError=e.TestError=e.MissingError=void 0,e.add=l,e.remove=u,e.replace=d,e.move=f,e.copy=p,e.test=m,e.apply=g;var n=w(),r=T(),i=E(),a=function(e){t(n,e);function n(t){var n=e.call(this,`Value required at path: ${t}`)||this;return n.path=t,n.name=`MissingError`,n}return n}(Error);e.MissingError=a;var o=function(e){t(n,e);function n(t,n){var r=e.call(this,`Test failed: ${t} != ${n}`)||this;return r.actual=t,r.expected=n,r.name=`TestError`,r}return n}(Error);e.TestError=o;function s(e,t,n){if(Array.isArray(e))if(t==`-`)e.push(n);else{var r=parseInt(t,10);e.splice(r,0,n)}else e[t]=n}function c(e,t){if(Array.isArray(e)){var n=parseInt(t,10);e.splice(n,1)}else delete e[t]}function l(e,t,i){var o=n.Pointer.fromJSON(t.path);if(i?.implicitArrayCreation&&o.tokens[o.tokens.length-1]===`-`){var c=o.parent().evaluate(e);c.value===void 0&&(0,r.objectType)(c.parent)===`object`&&(c.parent[c.key]=[])}var l=o.evaluate(e);return l.parent===void 0||i?.implicitArrayCreation&&l.key===`-`&&!Array.isArray(l.parent)?new a(t.path):(s(l.parent,l.key,(0,r.clone)(t.value)),null)}function u(e,t,r){var i=n.Pointer.fromJSON(t.path).evaluate(e);return i.value===void 0?new a(t.path):(c(i.parent,i.key),null)}function d(e,t,i){var o=n.Pointer.fromJSON(t.path).evaluate(e);if(o.parent===null)return new a(t.path);if(Array.isArray(o.parent)){if(parseInt(o.key,10)>=o.parent.length)return new a(t.path)}else if(o.value===void 0)return new a(t.path);return o.parent[o.key]=(0,r.clone)(t.value),null}function f(e,t,r){var i=n.Pointer.fromJSON(t.from).evaluate(e);if(i.value===void 0)return new a(t.from);var o=n.Pointer.fromJSON(t.path).evaluate(e);return o.parent===void 0?new a(t.path):(c(i.parent,i.key),s(o.parent,o.key,i.value),null)}function p(e,t,i){var o=n.Pointer.fromJSON(t.from).evaluate(e);if(o.value===void 0)return new a(t.from);var c=n.Pointer.fromJSON(t.path).evaluate(e);return c.parent===void 0?new a(t.path):(s(c.parent,c.key,(0,r.clone)(o.value)),null)}function m(e,t,r){var a=n.Pointer.fromJSON(t.path).evaluate(e);return(0,i.diffAny)(a.value,t.value,new n.Pointer).length?new o(a.value,t.value):null}var h=function(e){t(n,e);function n(t){var n=e.call(this,`Invalid operation: ${t.op}`)||this;return n.operation=t,n.name=`InvalidOperationError`,n}return n}(Error);e.InvalidOperationError=h;function g(e,t,n){switch(t.op){case`add`:return l(e,t,n);case`remove`:return u(e,t,n);case`replace`:return d(e,t,n);case`move`:return f(e,t,n);case`copy`:return p(e,t,n);case`test`:return m(e,t,n)}return new h(t)}})),ne=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Pointer=void 0,e.applyPatch=i,e.createPatch=o;var t=w();Object.defineProperty(e,`Pointer`,{enumerable:!0,get:function(){return t.Pointer}});var n=te(),r=E();function i(e,t,r){return t.map(function(t){return(0,n.apply)(e,t,r)})}function a(e){function t(n,i,a){var o=e(n,i,a);return Array.isArray(o)?o:(0,r.diffAny)(n,i,a,t)}return t}function o(e,n,i){var o=new t.Pointer;return(i?a(i):r.diffAny)(e,n,o)}})),D=e(a(),1),re=e(o(),1),O=s(),k=ne();function A(){}A.prototype={diff:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.callback;typeof n==`function`&&(r=n,n={}),this.options=n;var i=this;function a(e){return r?(setTimeout(function(){r(void 0,e)},0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e)),t=this.removeEmpty(this.tokenize(t));var o=t.length,s=e.length,c=1,l=o+s;n.maxEditLength&&(l=Math.min(l,n.maxEditLength));var u=n.timeout??1/0,d=Date.now()+u,f=[{oldPos:-1,lastComponent:void 0}],p=this.extractCommon(f[0],t,e,0);if(f[0].oldPos+1>=s&&p+1>=o)return a([{value:this.join(t),count:t.length}]);var m=-1/0,h=1/0;function g(){for(var n=Math.max(m,-c);n<=Math.min(h,c);n+=2){var r=void 0,l=f[n-1],u=f[n+1];l&&(f[n-1]=void 0);var d=!1;if(u){var g=u.oldPos-n;d=u&&0<=g&&g<o}var _=l&&l.oldPos+1<s;if(!d&&!_){f[n]=void 0;continue}if(r=!_||d&&l.oldPos+1<u.oldPos?i.addToPath(u,!0,void 0,0):i.addToPath(l,void 0,!0,1),p=i.extractCommon(r,t,e,n),r.oldPos+1>=s&&p+1>=o)return a(ie(i,r.lastComponent,t,e,i.useLongestToken));f[n]=r,r.oldPos+1>=s&&(h=Math.min(h,n-1)),p+1>=o&&(m=Math.max(m,n+1))}c++}if(r)(function e(){setTimeout(function(){if(c>l||Date.now()>d)return r();g()||e()},0)})();else for(;c<=l&&Date.now()<=d;){var _=g();if(_)return _}},addToPath:function(e,t,n,r){var i=e.lastComponent;return i&&i.added===t&&i.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:i.count+1,added:t,removed:n,previousComponent:i.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:i}}},extractCommon:function(e,t,n,r){for(var i=t.length,a=n.length,o=e.oldPos,s=o-r,c=0;s+1<i&&o+1<a&&this.equals(t[s+1],n[o+1]);)s++,o++,c++;return c&&(e.lastComponent={count:c,previousComponent:e.lastComponent}),e.oldPos=o,s},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},castInput:function(e){return e},tokenize:function(e){return e.split(``)},join:function(e){return e.join(``)}};function ie(e,t,n,r,i){for(var a=[],o;t;)a.push(t),o=t.previousComponent,delete t.previousComponent,t=o;a.reverse();for(var s=0,c=a.length,l=0,u=0;s<c;s++){var d=a[s];if(!d.removed){if(!d.added&&i){var f=n.slice(l,l+d.count);f=f.map(function(e,t){var n=r[u+t];return n.length>e.length?n:e}),d.value=e.join(f)}else d.value=e.join(n.slice(l,l+d.count));l+=d.count,d.added||(u+=d.count)}else if(d.value=e.join(r.slice(u,u+d.count)),u+=d.count,s&&a[s-1].added){var p=a[s-1];a[s-1]=a[s],a[s]=p}}var m=a[c-1];return c>1&&typeof m.value==`string`&&(m.added||m.removed)&&e.equals(``,m.value)&&(a[c-2].value+=m.value,a.pop()),a}var j=new A;function ae(e,t,n){return j.diff(e,t,n)}var M=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,N=/\S/,P=new A;P.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!N.test(e)&&!N.test(t)},P.tokenize=function(e){for(var t=e.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),n=0;n<t.length-1;n++)!t[n+1]&&t[n+2]&&M.test(t[n])&&M.test(t[n+2])&&(t[n]+=t[n+2],t.splice(n+1,2),n--);return t};function oe(e,t,n){return P.diff(e,t,n)}var F=new A;F.tokenize=function(e){this.options.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
1
|
+
import{i as e,t}from"./chunk-DseTPa7n.js";import{t as n}from"./jsx-runtime-DyiINK0N.js";import{n as r,p as i}from"./DocumentContext-B_zqYuAI.js";import{t as a}from"./react-JNybMug3.js";import{t as o}from"./react-dom-Db7zF7dM.js";import{t as s}from"./compiler-runtime-dQcBxOhn.js";import{I as c,et as l,st as u}from"./CodeMirrorPropInput-D0RRvxEm.js";import{Bi as d,Gi as f,K as p,Ki as m,Oi as h,Qi as g,Vi as _,Xi as v,Yr as y,ea as b,hi as x,na as S,ta as C}from"./dist-Ca38G5U3.js";import{t as ee}from"./libesm-BUX1Jc4h.js";var w=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Pointer=void 0,e.unescapeToken=t,e.escapeToken=n;function t(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}function n(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}e.Pointer=function(){function e(e){e===void 0&&(e=[``]),this.tokens=e}return e.fromJSON=function(n){var r=n.split(`/`).map(t);if(r[0]!==``)throw Error(`Invalid JSON Pointer: ${n}`);return new e(r)},e.prototype.toString=function(){return this.tokens.map(n).join(`/`)},e.prototype.evaluate=function(e){for(var t=null,n=``,r=e,i=1,a=this.tokens.length;i<a;i++)t=r,n=this.tokens[i],!(n==`__proto__`||n==`constructor`||n==`prototype`)&&(r=(t||{})[n]);return{parent:t,key:n,value:r}},e.prototype.get=function(e){return this.evaluate(e).value},e.prototype.set=function(e,t){var n=this.evaluate(e);n.parent&&(n.parent[n.key]=t)},e.prototype.push=function(e){this.tokens.push(e)},e.prototype.add=function(t){return new e(this.tokens.concat(String(t)))},e.prototype.parent=function(){return new e(this.tokens.length>1?this.tokens.slice(0,-1):[``])},e}()})),T=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.hasOwnProperty=void 0,e.objectType=t,e.clone=r,e.hasOwnProperty=Object.prototype.hasOwnProperty;function t(e){return e===void 0?`undefined`:e===null?`null`:Array.isArray(e)?`array`:typeof e}function n(e){return typeof e==`object`&&!!e}function r(t){if(!n(t))return t;if(t.constructor==Array){for(var i=t.length,a=Array(i),o=0;o<i;o++)a[o]=r(t[o]);return a}if(t.constructor==Date)return new Date(+t);var s={};for(var c in t)e.hasOwnProperty.call(t,c)&&(s[c]=r(t[c]));return s}})),E=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.isDestructive=n,e.subtract=r,e.intersection=i,e.diffArrays=l,e.diffObjects=u,e.diffAny=d;var t=T();function n(e){var t=e.op;return t===`remove`||t===`replace`||t===`copy`||t===`move`}function r(e,n){var r=[];for(var i in e)t.hasOwnProperty.call(e,i)&&e[i]!==void 0&&!(t.hasOwnProperty.call(n,i)&&n[i]!==void 0)&&r.push(i);return r}function i(e){for(var n=e.length,r={},i=0;i<n;i++){var a=e[i];for(var o in a)t.hasOwnProperty.call(a,o)&&a[o]!==void 0&&(r[o]=(r[o]||0)+1)}for(var o in r)r[o]<n&&delete r[o];return Object.keys(r)}function a(e,n){var r=[];for(var i in e)t.hasOwnProperty.call(e,i)&&e[i]!==void 0&&t.hasOwnProperty.call(n,i)&&n[i]!==void 0&&r.push(i);return r}function o(e){return e.op===`add`}function s(e){return e.op===`remove`}function c(e,t){return{operations:e.operations.concat(t),cost:e.cost+1}}function l(e,t,n,r){r===void 0&&(r=d);var i=Math.max(e.length,t.length),a=new Map([[0,{operations:[],cost:0}]]);function l(o,s){var u=o*i+s,d=a.get(u);if(d===void 0){if(o>0&&s>0&&!r(e[o-1],t[s-1],n.add(String(o-1))).length)d=l(o-1,s-1);else{var f=[];if(o>0){var p=l(o-1,s),m={op:`remove`,index:o-1};f.push(c(p,m))}if(s>0){var h=l(o,s-1),g={op:`add`,index:o-1,value:t[s-1]};f.push(c(h,g))}if(o>0&&s>0){var _=l(o-1,s-1),v={op:`replace`,index:o-1,original:e[o-1],value:t[s-1]};f.push(c(_,v))}d=f.sort(function(e,t){return e.cost-t.cost})[0]}a.set(u,d)}return d}var u=isNaN(e.length)||e.length<=0?0:e.length;return l(u,isNaN(t.length)||t.length<=0?0:t.length).operations.reduce(function(e,t){var i=e[0],a=e[1];if(o(t)){var c=t.index+1+a,l=c<u+a?String(c):`-`,d={op:t.op,path:n.add(l).toString(),value:t.value};return[i.concat(d),a+1]}else if(s(t)){var d={op:t.op,path:n.add(String(t.index+a)).toString()};return[i.concat(d),a-1]}else{var f=n.add(String(t.index+a)),p=r(t.original,t.value,f);return[i.concat.apply(i,p),a]}},[[],0])[0]}function u(e,t,n,i){i===void 0&&(i=d);var o=[];return r(e,t).forEach(function(e){o.push({op:`remove`,path:n.add(e).toString()})}),r(t,e).forEach(function(e){o.push({op:`add`,path:n.add(e).toString(),value:t[e]})}),a(e,t).forEach(function(r){o.push.apply(o,i(e[r],t[r],n.add(r)))}),o}function d(e,n,r,i){if(i===void 0&&(i=d),e===n)return[];var a=(0,t.objectType)(e),o=(0,t.objectType)(n);return a==`array`&&o==`array`?l(e,n,r,i):a==`object`&&o==`object`?u(e,n,r,i):[{op:`replace`,path:r.toString(),value:n}]}})),te=t((e=>{var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,`__esModule`,{value:!0}),e.InvalidOperationError=e.TestError=e.MissingError=void 0,e.add=l,e.remove=u,e.replace=d,e.move=f,e.copy=p,e.test=m,e.apply=g;var n=w(),r=T(),i=E(),a=function(e){t(n,e);function n(t){var n=e.call(this,`Value required at path: ${t}`)||this;return n.path=t,n.name=`MissingError`,n}return n}(Error);e.MissingError=a;var o=function(e){t(n,e);function n(t,n){var r=e.call(this,`Test failed: ${t} != ${n}`)||this;return r.actual=t,r.expected=n,r.name=`TestError`,r}return n}(Error);e.TestError=o;function s(e,t,n){if(Array.isArray(e))if(t==`-`)e.push(n);else{var r=parseInt(t,10);e.splice(r,0,n)}else e[t]=n}function c(e,t){if(Array.isArray(e)){var n=parseInt(t,10);e.splice(n,1)}else delete e[t]}function l(e,t,i){var o=n.Pointer.fromJSON(t.path);if(i?.implicitArrayCreation&&o.tokens[o.tokens.length-1]===`-`){var c=o.parent().evaluate(e);c.value===void 0&&(0,r.objectType)(c.parent)===`object`&&(c.parent[c.key]=[])}var l=o.evaluate(e);return l.parent===void 0||i?.implicitArrayCreation&&l.key===`-`&&!Array.isArray(l.parent)?new a(t.path):(s(l.parent,l.key,(0,r.clone)(t.value)),null)}function u(e,t,r){var i=n.Pointer.fromJSON(t.path).evaluate(e);return i.value===void 0?new a(t.path):(c(i.parent,i.key),null)}function d(e,t,i){var o=n.Pointer.fromJSON(t.path).evaluate(e);if(o.parent===null)return new a(t.path);if(Array.isArray(o.parent)){if(parseInt(o.key,10)>=o.parent.length)return new a(t.path)}else if(o.value===void 0)return new a(t.path);return o.parent[o.key]=(0,r.clone)(t.value),null}function f(e,t,r){var i=n.Pointer.fromJSON(t.from).evaluate(e);if(i.value===void 0)return new a(t.from);var o=n.Pointer.fromJSON(t.path).evaluate(e);return o.parent===void 0?new a(t.path):(c(i.parent,i.key),s(o.parent,o.key,i.value),null)}function p(e,t,i){var o=n.Pointer.fromJSON(t.from).evaluate(e);if(o.value===void 0)return new a(t.from);var c=n.Pointer.fromJSON(t.path).evaluate(e);return c.parent===void 0?new a(t.path):(s(c.parent,c.key,(0,r.clone)(o.value)),null)}function m(e,t,r){var a=n.Pointer.fromJSON(t.path).evaluate(e);return(0,i.diffAny)(a.value,t.value,new n.Pointer).length?new o(a.value,t.value):null}var h=function(e){t(n,e);function n(t){var n=e.call(this,`Invalid operation: ${t.op}`)||this;return n.operation=t,n.name=`InvalidOperationError`,n}return n}(Error);e.InvalidOperationError=h;function g(e,t,n){switch(t.op){case`add`:return l(e,t,n);case`remove`:return u(e,t,n);case`replace`:return d(e,t,n);case`move`:return f(e,t,n);case`copy`:return p(e,t,n);case`test`:return m(e,t,n)}return new h(t)}})),ne=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Pointer=void 0,e.applyPatch=i,e.createPatch=o;var t=w();Object.defineProperty(e,`Pointer`,{enumerable:!0,get:function(){return t.Pointer}});var n=te(),r=E();function i(e,t,r){return t.map(function(t){return(0,n.apply)(e,t,r)})}function a(e){function t(n,i,a){var o=e(n,i,a);return Array.isArray(o)?o:(0,r.diffAny)(n,i,a,t)}return t}function o(e,n,i){var o=new t.Pointer;return(i?a(i):r.diffAny)(e,n,o)}})),D=e(a(),1),re=e(o(),1),O=s(),k=ne();function A(){}A.prototype={diff:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.callback;typeof n==`function`&&(r=n,n={}),this.options=n;var i=this;function a(e){return r?(setTimeout(function(){r(void 0,e)},0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e)),t=this.removeEmpty(this.tokenize(t));var o=t.length,s=e.length,c=1,l=o+s;n.maxEditLength&&(l=Math.min(l,n.maxEditLength));var u=n.timeout??1/0,d=Date.now()+u,f=[{oldPos:-1,lastComponent:void 0}],p=this.extractCommon(f[0],t,e,0);if(f[0].oldPos+1>=s&&p+1>=o)return a([{value:this.join(t),count:t.length}]);var m=-1/0,h=1/0;function g(){for(var n=Math.max(m,-c);n<=Math.min(h,c);n+=2){var r=void 0,l=f[n-1],u=f[n+1];l&&(f[n-1]=void 0);var d=!1;if(u){var g=u.oldPos-n;d=u&&0<=g&&g<o}var _=l&&l.oldPos+1<s;if(!d&&!_){f[n]=void 0;continue}if(r=!_||d&&l.oldPos+1<u.oldPos?i.addToPath(u,!0,void 0,0):i.addToPath(l,void 0,!0,1),p=i.extractCommon(r,t,e,n),r.oldPos+1>=s&&p+1>=o)return a(ie(i,r.lastComponent,t,e,i.useLongestToken));f[n]=r,r.oldPos+1>=s&&(h=Math.min(h,n-1)),p+1>=o&&(m=Math.max(m,n+1))}c++}if(r)(function e(){setTimeout(function(){if(c>l||Date.now()>d)return r();g()||e()},0)})();else for(;c<=l&&Date.now()<=d;){var _=g();if(_)return _}},addToPath:function(e,t,n,r){var i=e.lastComponent;return i&&i.added===t&&i.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:i.count+1,added:t,removed:n,previousComponent:i.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:i}}},extractCommon:function(e,t,n,r){for(var i=t.length,a=n.length,o=e.oldPos,s=o-r,c=0;s+1<i&&o+1<a&&this.equals(t[s+1],n[o+1]);)s++,o++,c++;return c&&(e.lastComponent={count:c,previousComponent:e.lastComponent}),e.oldPos=o,s},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},castInput:function(e){return e},tokenize:function(e){return e.split(``)},join:function(e){return e.join(``)}};function ie(e,t,n,r,i){for(var a=[],o;t;)a.push(t),o=t.previousComponent,delete t.previousComponent,t=o;a.reverse();for(var s=0,c=a.length,l=0,u=0;s<c;s++){var d=a[s];if(!d.removed){if(!d.added&&i){var f=n.slice(l,l+d.count);f=f.map(function(e,t){var n=r[u+t];return n.length>e.length?n:e}),d.value=e.join(f)}else d.value=e.join(n.slice(l,l+d.count));l+=d.count,d.added||(u+=d.count)}else if(d.value=e.join(r.slice(u,u+d.count)),u+=d.count,s&&a[s-1].added){var p=a[s-1];a[s-1]=a[s],a[s]=p}}var m=a[c-1];return c>1&&typeof m.value==`string`&&(m.added||m.removed)&&e.equals(``,m.value)&&(a[c-2].value+=m.value,a.pop()),a}var j=new A;function ae(e,t,n){return j.diff(e,t,n)}var M=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,N=/\S/,P=new A;P.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!N.test(e)&&!N.test(t)},P.tokenize=function(e){for(var t=e.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),n=0;n<t.length-1;n++)!t[n+1]&&t[n+2]&&M.test(t[n])&&M.test(t[n+2])&&(t[n]+=t[n+2],t.splice(n+1,2),n--);return t};function oe(e,t,n){return P.diff(e,t,n)}var F=new A;F.tokenize=function(e){this.options.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
2
2
|
`));var t=[],n=e.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var r=0;r<n.length;r++){var i=n[r];r%2&&!this.options.newlineIsToken?t[t.length-1]+=i:(this.options.ignoreWhitespace&&(i=i.trim()),t.push(i))}return t};var I=new A;I.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var se=new A;se.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function L(e){"@babel/helpers - typeof";return L=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},L(e)}var ce=Object.prototype.toString,R=new A;R.useLongestToken=!0,R.tokenize=F.tokenize,R.castInput=function(e){var t=this.options,n=t.undefinedReplacement,r=t.stringifyReplacer,i=r===void 0?function(e,t){return t===void 0?n:t}:r;return typeof e==`string`?e:JSON.stringify(z(e,null,null,i),i,` `)},R.equals=function(e,t){return A.prototype.equals.call(R,e.replace(/,([\r\n])/g,`$1`),t.replace(/,([\r\n])/g,`$1`))};function z(e,t,n,r,i){t||=[],n||=[],r&&(e=r(i,e));var a;for(a=0;a<t.length;a+=1)if(t[a]===e)return n[a];var o;if(ce.call(e)===`[object Array]`){for(t.push(e),o=Array(e.length),n.push(o),a=0;a<e.length;a+=1)o[a]=z(e[a],t,n,r,i);return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),L(e)===`object`&&e!==null){t.push(e),o={},n.push(o);var s=[],c;for(c in e)e.hasOwnProperty(c)&&s.push(c);for(s.sort(),a=0;a<s.length;a+=1)c=s[a],o[c]=z(e[c],t,n,r,c);t.pop(),n.pop()}else o=e;return o}var B=new A;B.tokenize=function(e){return e.slice()},B.join=B.removeEmpty=function(e){return e};function V(e,t){let n=t.content.findDiffStart(e.content);if(n===null)return!1;let{a:r,b:i}=t.content.findDiffEnd(e.content),a=n-Math.min(r,i);return a>0&&(e.resolve(n-a).depth<t.resolve(r+a).depth?n-=a:(r+=a,i+=a)),new b(n,i,t.slice(n,r))}function le(e){if(!e.steps.length)return;let t=new C(e.docs[0]),n=e.steps.slice();for(;n.length;){let e=n.shift();for(;n.length&&e.merge(n[0]);){let r=n.shift();e=e instanceof b&&r instanceof b?V(t.doc,r.apply(e.apply(t.doc).doc).doc):e.merge(r)}t.step(e)}return t}function H(e){let t=new C(e);return t.removeMark(0,e.nodeSize-2),t.doc}function U(e,t){let n=t.split(`/`);for(n.shift();n.length;){if(typeof e!=`object`)throw Error();let t=n.shift();e=e[t]}return e}function W(e){return JSON.parse(JSON.stringify(e))}var ue=class{fromDoc;toDoc;complexSteps;wordDiffs;simplifyDiff;schema;tr;currentJSON;finalJSON;ops;constructor(e,t,n={}){let r={complexSteps:!0,wordDiffs:!1,simplifyDiff:!0,...n};this.fromDoc=e,this.toDoc=t,this.complexSteps=r.complexSteps,this.wordDiffs=r.wordDiffs,this.simplifyDiff=r.simplifyDiff,this.schema=e.type.schema,this.tr=new C(e),this.currentJSON={},this.finalJSON={},this.ops=[]}init(){return this.complexSteps?(this.currentJSON=H(this.fromDoc).toJSON(),this.finalJSON=H(this.toDoc).toJSON(),this.ops=(0,k.createPatch)(this.currentJSON,this.finalJSON),this.recreateChangeContentSteps(),this.recreateChangeMarkSteps()):(this.currentJSON=this.fromDoc.toJSON(),this.finalJSON=this.toDoc.toJSON(),this.ops=(0,k.createPatch)(this.currentJSON,this.finalJSON),this.recreateChangeContentSteps()),this.simplifyDiff&&(this.tr=le(this.tr)||this.tr),this.tr}recreateChangeContentSteps(){let e=[];for(;this.ops.length;){let t=this.ops.shift();e.push(t);let n,r=W(this.currentJSON),i=t.path.split(`/`);for(;n==null;){(0,k.applyPatch)(r,[t]);try{n=this.schema.nodeFromJSON(r),n.check()}catch{if(n=null,this.ops.length>0)t=this.ops.shift(),e.push(t);else throw Error(`No valid diff possible applying ${t.path}`)}}this.complexSteps&&e.length===1&&(i.includes(`attrs`)||i.includes(`type`))?(this.addSetNodeMarkup(),e=[]):e.length===1&&t.op===`replace`&&i[i.length-1]===`text`?(this.addReplaceTextSteps(t,r),e=[]):this.addReplaceStep(n,r)&&(e=[])}}addSetNodeMarkup(){let e=this.schema.nodeFromJSON(this.currentJSON),t=this.schema.nodeFromJSON(this.finalJSON),n=t.content.findDiffStart(e.content),r=e.nodeAt(n),i=t.nodeAt(n);if(n!=null){let e=r.type===i.type?null:i.type;try{this.tr.setNodeMarkup(n,e,i.attrs,i.marks)}catch(t){if(e&&t.message.includes(`Invalid content`))this.tr.replaceWith(n,n+r.nodeSize,i);else throw t}return this.currentJSON=H(this.tr.doc).toJSON(),this.ops=(0,k.createPatch)(this.currentJSON,this.finalJSON),!0}return!1}recreateChangeMarkSteps(){this.toDoc.descendants((e,t)=>{if(!e.isInline)return!0;this.tr.doc.nodesBetween(t,t+e.nodeSize,(n,r)=>{if(!n.isInline)return!0;let i=Math.max(t,r),a=Math.min(t+e.nodeSize,r+n.nodeSize);n.marks.forEach(t=>{t.isInSet(e.marks)||this.tr.removeMark(i,a,t)}),e.marks.forEach(e=>{e.isInSet(n.marks)||this.tr.addMark(i,a,e)})})})}addReplaceStep(e,t){let n=V(this.schema.nodeFromJSON(this.currentJSON),e);if(!n)return!1;if(!this.tr.maybeStep(n).failed)return this.currentJSON=t,!0;throw Error(`No valid step found.`)}addReplaceTextSteps(e,t){let n={...e,value:`xx`},r={...e,value:`yy`},i=W(this.currentJSON),a=W(this.currentJSON);(0,k.applyPatch)(i,[n]),(0,k.applyPatch)(a,[r]);let o=this.schema.nodeFromJSON(i),s=this.schema.nodeFromJSON(a),c=e.value,l=U(this.currentJSON,e.path),u=this.wordDiffs?oe(l,c):ae(l,c),d=o.content.findDiffStart(s.content),f=o.resolve(d+1).marks();for(;u.length;){let e=u.shift();if(e.added){let t=this.schema.nodeFromJSON({type:`text`,text:e.value}).mark(f);if(u.length&&u[0].removed){let e=u.shift();this.tr.replaceWith(d,d+e.value.length,t)}else this.tr.insert(d,t);d+=e.value.length}else if(e.removed)if(u.length&&u[0].added){let t=u.shift(),n=this.schema.nodeFromJSON({type:`text`,text:t.value}).mark(f);this.tr.replaceWith(d,d+e.value.length,n),d+=t.value.length}else this.tr.delete(d,d+e.value.length);else d+=e.value.length}this.currentJSON=t}};function de(e,t,n={}){return new ue(e,t,n).init()}var G=new Set([`list`,`bulletList`,`orderedList`,`taskList`]);function K(e){let t=[];return e.forEach((e,n)=>{if(G.has(e.type.name)){let r=n+1,i=0;e.forEach(e=>{let n=r+i;t.push({from:n,to:n+e.nodeSize,key:`${e.type.name}:${e.textContent}`}),i+=e.nodeSize})}else t.push({from:n,to:n+e.nodeSize,key:`${e.type.name}:${e.textContent}`})}),t}function fe(e,t){let n=e.length,r=t.length,i=Array.from({length:n+1},()=>Array(r+1).fill(0));for(let a=n-1;a>=0;a--)for(let n=r-1;n>=0;n--)i[a][n]=e[a].key===t[n].key?i[a+1][n+1]+1:Math.max(i[a+1][n],i[a][n+1]);let a=[],o=0,s=0;for(;o<n&&s<r;)e[o].key===t[s].key?(a.push({type:`same`,b:t[s]}),o++,s++):i[o+1][s]>=i[o][s+1]?(a.push({type:`del`,a:e[o]}),o++):(a.push({type:`ins`,b:t[s]}),s++);for(;o<n;)a.push({type:`del`,a:e[o++]});for(;s<r;)a.push({type:`ins`,b:t[s++]});return a}function pe(e,t){let n=fe(K(e),K(t)),r=[],i=0;for(let e of n)e.type===`same`?i=e.b.to:e.type===`ins`?(r.push({fromA:0,toA:0,fromB:e.b.from,toB:e.b.to}),i=e.b.to):r.push({fromA:e.a.from,toA:e.a.to,fromB:i,toB:i});return r}var me=400;function q(e,t,n){return t.nodeFromJSON(e.parseWithFallback(n))}function he(e,t){let n=t.filter(e=>e.toB>e.fromB),r=[];return e.steps.forEach((t,i)=>{let a=t instanceof v?`add`:t instanceof g?`remove`:null;if(a===null)return;let o=t,s=e.mapping.slice(i+1),c=s.map(o.from,-1),l=s.map(o.to,1);if(l<=c||n.some(e=>e.fromB<=c&&l<=e.toB))return;let u=e.mapping.slice(0,i).invert(),d=u.map(o.from),f=u.map(o.to);f<=d||r.push({fromA:d,toA:f,fromB:c,toB:l,markName:o.mark.type.name,kind:a})}),r}function ge(e,t,n,r){if(e.length>2e5||t.length>2e5)return{ok:!1,reason:`ceiling`};let i,a;try{i=q(r,n,e),a=q(r,n,t)}catch{return{ok:!1,reason:`parse`}}let o=a,s=null;try{s=de(i,a,{complexSteps:!0,wordDiffs:!0,simplifyDiff:!0}),o=s.doc}catch{}let c=pe(i,o),l=s?he(s,c):[];return c.length+l.length>me?{ok:!1,reason:`ceiling`}:{ok:!0,afterDoc:o,beforeDoc:i,changes:c,markChanges:l}}var _e=`.ok-diff-ins, .ok-diff-ins-block, [data-diff-deleted]`;function ve(e){return e.changes.length+2*e.markChanges.length}function J(e){let t=!1;return e.forEach(e=>{e.isBlock&&(t=!0)}),t}function ye(e){if(e.childCount===0)return!1;let t=!0;return e.forEach(e=>{e.type.name!==`listItem`&&e.type.name!==`taskItem`&&(t=!1)}),t}function Y(e,t,n){let r=document.createElement(n?`div`:`span`);r.className=n?`ok-diff-del ok-diff-del-block`:`ok-diff-del`,r.setAttribute(`data-diff-deleted`,``);let i=e.serializeFragment(t);if(n&&ye(t)){let e=document.createElement(`ul`);e.appendChild(i),r.appendChild(e)}else r.appendChild(i);return r}function be(e,t,n,r,i){let a=S.fromSchema(i),o=[];for(let e of r){let n=t.slice(e.fromA,e.toA),r=J(n.content);o.push(d.widget(e.fromB,()=>Y(a,n.content,r),{side:-1,ignoreSelection:!0,marks:[]})),o.push(d.inline(e.fromB,e.toB,{class:`ok-diff-ins`},{inclusiveEnd:!0}))}for(let e of n)if(e.toB>e.fromB&&o.push(d.node(e.fromB,e.toB,{class:`ok-diff-ins-block`})),e.toA>e.fromA){let n=t.slice(e.fromA,e.toA),r=J(n.content);o.push(d.widget(e.fromB,()=>Y(a,n.content,r),{side:-1,ignoreSelection:!0,marks:[]}))}return _.create(e,o)}var xe=new Set([`slashCommand`,`blockDragHandle`,`blockMover`,`tableInsertControls`,`fileHandler`,`gfmAutolink`,`inlineLinkInputRule`,`keyboardNav`,`tiptapFindReplace`,`selectionState`,`sourceDirtyObserver`,`tabFocusTrap`]),X=i.filter(e=>!xe.has(e.name)).map(e=>e.name===`jsxComponent`?p:e),Z=n(),Q=h(X);function Se(e,t){return ge(e,t,Q,c())}var Ce=x.create({name:`renderedDiffDecorations`,addOptions(){return{decorations:_.empty}},addProseMirrorPlugins(){let e=this.options.decorations;return[new f({key:new m(`renderedDiffDecorations`),props:{decorations:()=>e}})]}});function we(e){let t=(0,O.c)(31),{diff:n}=e,r,i,a,o;if(t[0]!==n.afterDoc||t[1]!==n.beforeDoc||t[2]!==n.changes||t[3]!==n.markChanges){let e=be(n.afterDoc,n.beforeDoc,n.changes,n.markChanges,Q);o=u,a=!1,r=X,i=Ce.configure({decorations:e}),t[0]=n.afterDoc,t[1]=n.beforeDoc,t[2]=n.changes,t[3]=n.markChanges,t[4]=r,t[5]=i,t[6]=a,t[7]=o}else r=t[4],i=t[5],a=t[6],o=t[7];let s;t[8]!==r||t[9]!==i?(s=[...r,i],t[8]=r,t[9]=i,t[10]=s):s=t[10];let c;t[11]===n.afterDoc?c=t[12]:(c=n.afterDoc.toJSON(),t[11]=n.afterDoc,t[12]=c);let d;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(d={attributes:{class:`pt-4`}},t[13]=d):d=t[13];let f;t[14]!==a||t[15]!==s||t[16]!==c?(f={editable:a,extensions:s,content:c,editorProps:d},t[14]=a,t[15]=s,t[16]=c,t[17]=f):f=t[17];let p;t[18]===n?p=t[19]:(p=[n],t[18]=n,t[19]=p);let m=o(f,p),[h]=(0,D.useState)(Te),g=(0,D.useRef)(null),_,v;t[20]===h?(_=t[21],v=t[22]):(_=()=>{let e=g.current;if(e)return e.appendChild(h),()=>{h.parentNode===e&&e.removeChild(h)}},v=[h],t[20]=h,t[21]=_,t[22]=v),(0,D.useLayoutEffect)(_,v);let y;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Z.jsx)(`div`,{className:`tiptap-editor`,children:(0,Z.jsx)(`div`,{ref:g,style:{display:`contents`}})}),t[23]=y):y=t[23];let b;t[24]===m?b=t[25]:(b=(0,Z.jsx)(l,{editor:m,className:`tiptap-editor-portal-content`}),t[24]=m,t[25]=b);let x;t[26]!==h||t[27]!==b?(x=(0,re.createPortal)(b,h),t[26]=h,t[27]=b,t[28]=x):x=t[28];let S;return t[29]===x?S=t[30]:(S=(0,Z.jsxs)(`div`,{className:`editor-doc-scroll min-h-0 flex-1`,"data-testid":`rendered-diff-view`,children:[y,x]}),t[29]=x,t[30]=S),S}function Te(){let e=document.createElement(`div`);return e.style.display=`contents`,e}function Ee(e){let t=0,n=!1;for(let r of e.split(`
|
|
3
3
|
`)){let e=r.startsWith(`+`)&&!r.startsWith(`+++`)||r.startsWith(`-`)&&!r.startsWith(`---`);e&&!n&&(t+=1),n=e}return t}function De(e){let t=Array.from(e.querySelectorAll(`.diff-code-insert, .diff-code-delete`)),n=[],r=null;for(let e of t){let t=e.closest(`tr`);t&&((r===null||t.previousElementSibling!==r)&&n.push(e),r=t)}return n}function $(e){let t=0,n=0;for(let r of e.split(`
|
|
4
4
|
`))r.startsWith(`+`)&&!r.startsWith(`+++`)?t++:r.startsWith(`-`)&&!r.startsWith(`---`)&&n++;return{additions:t,deletions:n}}function Oe(e,t){return`${e}\u0000${t}`}function ke(e,t,n){let r=y(e).body,i=y(t).body;return r===i?``:ee(n,r,i,``,``,{context:Math.max(r.split(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./react-JNybMug3.js";import{t as n}from"./compiler-runtime-dQcBxOhn.js";import{Gt as r}from"./dist-
|
|
1
|
+
import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./react-JNybMug3.js";import{t as n}from"./compiler-runtime-dQcBxOhn.js";import{Gt as r}from"./dist-Ca38G5U3.js";var i=n(),a=e(t(),1);function o(){let e=(0,i.c)(3),[t,n]=(0,a.useState)(l),o,u;return e[0]===t?(o=e[1],u=e[2]):(o=()=>{if(t!==null||window.okDesktop)return;let e=!0;return fetch(`/api/workspace`).then(async t=>{let i=await t.json().catch(c);if(!e||!t.ok)return;let a=r.safeParse(i);a.success&&n({contentDir:a.data.contentDir,pathSeparator:a.data.pathSeparator})}).catch(s),()=>{e=!1}},u=[t],e[0]=t,e[1]=o,e[2]=u),(0,a.useEffect)(o,u),t}function s(e){console.warn(`[useWorkspace] /api/workspace fetch failed:`,e)}function c(){return null}function l(){return u()}function u(e=typeof window>`u`?void 0:window){if(!e)return null;let t=e.okDesktop;return t?{contentDir:t.config.projectPath,pathSeparator:t.platform===`win32`?`\\`:`/`}:null}export{o as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./react-JNybMug3.js";import{r as n}from"./dist-DBENJeML.js";import{t as r}from"./createLucideIcon-BUb14crZ.js";import{On as i}from"./dist-
|
|
1
|
+
import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./react-JNybMug3.js";import{r as n}from"./dist-DBENJeML.js";import{t as r}from"./createLucideIcon-BUb14crZ.js";import{On as i}from"./dist-Ca38G5U3.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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{La as e,Ra as t,za as n}from"./dist-
|
|
1
|
+
import{La as e,Ra as t,za as n}from"./dist-Ca38G5U3.js";import{a as r,i,r as a}from"./index.esm-DRU91WyY.js";var o=(e,t,n)=>{if(e&&`reportValidity`in e){let r=i(n,t);e.setCustomValidity(r&&r.message||``),e.reportValidity()}},s=(e,t)=>{for(let n in t.fields){let r=t.fields[n];r&&r.ref&&`reportValidity`in r.ref?o(r.ref,n,e):r&&r.refs&&r.refs.forEach(t=>o(t,n,e))}},c=(e,t)=>{t.shouldUseNativeValidation&&s(e,t);let n={};for(let a in e){let o=i(t.fields,a),s=Object.assign(e[a]||{},{ref:o&&o.ref});if(l(t.names||Object.keys(e),a)){let e=Object.assign({},i(n,a));r(e,`root`,s),r(n,a,e)}else r(n,a,s)}return n},l=(e,t)=>{let n=u(t).replace(/[.*+?^${}()|\\]/g,`\\$&`);return e.some(e=>u(e).match(`^${n}\\.\\d+`))};function u(e){return e.replace(/[\[\]]/g,``)}function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},d.apply(null,arguments)}function f(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}function p(e,t){for(var n={};e.length;){var r=e[0],i=r.code,o=r.message,s=r.path.join(`.`);if(!n[s])if(`unionErrors`in r){var c=r.unionErrors[0].errors[0];n[s]={message:c.message,type:c.code}}else n[s]={message:o,type:i};if(`unionErrors`in r&&r.unionErrors.forEach(function(t){return t.errors.forEach(function(t){return e.push(t)})}),t){var l=n[s].types,u=l&&l[r.code];n[s]=a(s,t,n,i,u?[].concat(u,r.message):r.message)}e.shift()}return n}function m(e,t){for(var n={},r=function(){var r=e[0],i=r.code,o=r.message,s=r.path.join(`.`);if(!n[s])if(r.code===`invalid_union`&&r.errors.length>0){var c=r.errors[0][0];n[s]={message:c.message,type:c.code}}else n[s]={message:o,type:i};if(r.code===`invalid_union`&&r.errors.forEach(function(t){return t.forEach(function(t){return e.push(d({},t,{path:[].concat(r.path,t.path)}))})}),t){var l=n[s].types,u=l&&l[r.code];n[s]=a(s,t,n,i,u?[].concat(u,r.message):r.message)}e.shift()};e.length;)r();return n}function h(r,i,a){if(a===void 0&&(a={}),function(e){return`_def`in e&&typeof e._def==`object`&&`typeName`in e._def}(r))return function(e,t,n){try{return Promise.resolve(f(function(){return Promise.resolve(r[a.mode===`sync`?`parse`:`parseAsync`](e,i)).then(function(t){return n.shouldUseNativeValidation&&s({},n),{errors:{},values:a.raw?Object.assign({},e):t}})},function(e){if(function(e){return Array.isArray(e?.issues)}(e))return{values:{},errors:c(p(e.errors,!n.shouldUseNativeValidation&&n.criteriaMode===`all`),n)};throw e}))}catch(e){return Promise.reject(e)}};if(function(e){return`_zod`in e&&typeof e._zod==`object`}(r))return function(o,l,u){try{return Promise.resolve(f(function(){return Promise.resolve((a.mode===`sync`?e:t)(r,o,i)).then(function(e){return u.shouldUseNativeValidation&&s({},u),{errors:{},values:a.raw?Object.assign({},o):e}})},function(e){if(function(e){return e instanceof n}(e))return{values:{},errors:c(m(e.issues,!u.shouldUseNativeValidation&&u.criteriaMode===`all`),u)};throw e}))}catch(e){return Promise.reject(e)}};throw Error(`Invalid input: not a Zod schema`)}export{h as t};
|
package/dist/public/index.html
CHANGED
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
-->
|
|
59
59
|
<script>(() => { let t = 'system'; try { const r = localStorage.getItem('ok-theme-v1'); if (r === 'light' || r === 'dark' || r === 'system') t = r; } catch {} let ct = null; try { const c = localStorage.getItem('ok-color-theme-v1'); if (c && ['dracula', 'catppuccin-frappe', 'catppuccin-latte', 'monokai', 'gruvbox', 'solarized', 'custom'].includes(c)) ct = c; } catch {} let dark = t === 'dark'; if (t === 'system') { try { dark = window.matchMedia('(prefers-color-scheme: dark)').matches; } catch {} } let customCss = null; if (ct === 'custom') { try { const raw = localStorage.getItem('ok-custom-theme-v1'); if (raw) { const o = JSON.parse(raw); if (o?.css) { customCss = o.css; dark = !!o.dark; } } } catch {} if (!customCss) ct = null; } else if (ct) { dark = !['catppuccin-latte'].includes(ct); } if (dark) document.documentElement.classList.add('dark'); if (ct) document.documentElement.setAttribute('data-color-theme', ct); if (customCss) { const s = document.createElement('style'); s.id = 'ok-custom-theme'; s.textContent = customCss; document.head.appendChild(s); } if (window.okDesktop) { document.documentElement.classList.add('electron-mode'); document.documentElement.classList.add(`electron-platform-${window.okDesktop.platform}`); } })();</script>
|
|
60
60
|
<style>html { background-color: #fafafa } html.dark { background-color: #171717 }</style>
|
|
61
|
-
<script type="module" crossorigin src="./assets/index-
|
|
61
|
+
<script type="module" crossorigin src="./assets/index-C3xDGGXT.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-Daddi42S.js">
|
|
@@ -76,15 +76,15 @@
|
|
|
76
76
|
<link rel="modulepreload" crossorigin href="./assets/trace-api-CXljsYUC.js">
|
|
77
77
|
<link rel="modulepreload" crossorigin href="./assets/lib-9ZUh4rh4.js">
|
|
78
78
|
<link rel="modulepreload" crossorigin href="./assets/markdownit-BEubyjFu.js">
|
|
79
|
-
<link rel="modulepreload" crossorigin href="./assets/dist-
|
|
79
|
+
<link rel="modulepreload" crossorigin href="./assets/dist-Ca38G5U3.js">
|
|
80
80
|
<link rel="modulepreload" crossorigin href="./assets/react-JNybMug3.js">
|
|
81
81
|
<link rel="modulepreload" crossorigin href="./assets/dist-COAuqNbv.js">
|
|
82
82
|
<link rel="modulepreload" crossorigin href="./assets/compiler-runtime-dQcBxOhn.js">
|
|
83
83
|
<link rel="modulepreload" crossorigin href="./assets/jsx-runtime-DyiINK0N.js">
|
|
84
|
-
<link rel="modulepreload" crossorigin href="./assets/client-version-
|
|
85
|
-
<link rel="modulepreload" crossorigin href="./assets/use-apply-config-color-theme-
|
|
84
|
+
<link rel="modulepreload" crossorigin href="./assets/client-version-C6us3zHK.js">
|
|
85
|
+
<link rel="modulepreload" crossorigin href="./assets/use-apply-config-color-theme-C0Cek6NJ.js">
|
|
86
86
|
<link rel="modulepreload" crossorigin href="./assets/config-context-C5AosGyi.js">
|
|
87
|
-
<link rel="modulepreload" crossorigin href="./assets/config-provider-
|
|
87
|
+
<link rel="modulepreload" crossorigin href="./assets/config-provider-DNXd8psn.js">
|
|
88
88
|
<link rel="modulepreload" crossorigin href="./assets/dist-BD3698ve.js">
|
|
89
89
|
<link rel="modulepreload" crossorigin href="./assets/dist-DBENJeML.js">
|
|
90
90
|
<link rel="modulepreload" crossorigin href="./assets/bundle-mjs-Dy8bHgkj.js">
|
|
@@ -94,15 +94,15 @@
|
|
|
94
94
|
<link rel="modulepreload" crossorigin href="./assets/trash-2-DpF__0y9.js">
|
|
95
95
|
<link rel="modulepreload" crossorigin href="./assets/triangle-alert-DpxK7pzx.js">
|
|
96
96
|
<link rel="modulepreload" crossorigin href="./assets/react-dom-Db7zF7dM.js">
|
|
97
|
-
<link rel="modulepreload" crossorigin href="./assets/doc-hash-
|
|
98
|
-
<link rel="modulepreload" crossorigin href="./assets/navigation-targets-
|
|
97
|
+
<link rel="modulepreload" crossorigin href="./assets/doc-hash-Bs2ss-ac.js">
|
|
98
|
+
<link rel="modulepreload" crossorigin href="./assets/navigation-targets-BFURDxV-.js">
|
|
99
99
|
<link rel="modulepreload" crossorigin href="./assets/external-link-BtglP1zb.js">
|
|
100
100
|
<link rel="modulepreload" crossorigin href="./assets/documents-fetch-CyAk_i-3.js">
|
|
101
|
-
<link rel="modulepreload" crossorigin href="./assets/CodeMirrorPropInput-
|
|
102
|
-
<link rel="modulepreload" crossorigin href="./assets/dist-
|
|
101
|
+
<link rel="modulepreload" crossorigin href="./assets/CodeMirrorPropInput-D0RRvxEm.js">
|
|
102
|
+
<link rel="modulepreload" crossorigin href="./assets/dist-CM-z5Mlq.js">
|
|
103
103
|
<link rel="modulepreload" crossorigin href="./assets/sortable.esm-DcjmFgta.js">
|
|
104
104
|
<link rel="modulepreload" crossorigin href="./assets/index.esm-DRU91WyY.js">
|
|
105
|
-
<link rel="modulepreload" crossorigin href="./assets/zod-
|
|
105
|
+
<link rel="modulepreload" crossorigin href="./assets/zod-BtDPLTDt.js">
|
|
106
106
|
<link rel="modulepreload" crossorigin href="./assets/dist-Bv-DNDka.js">
|
|
107
107
|
<link rel="modulepreload" crossorigin href="./assets/dist-93kZXTH1.js">
|
|
108
108
|
<link rel="modulepreload" crossorigin href="./assets/propagation-api-yIIm019t.js">
|
|
@@ -120,11 +120,11 @@
|
|
|
120
120
|
<link rel="modulepreload" crossorigin href="./assets/chevron-right-zaL9JagC.js">
|
|
121
121
|
<link rel="modulepreload" crossorigin href="./assets/copy-Dwat-rG5.js">
|
|
122
122
|
<link rel="modulepreload" crossorigin href="./assets/CopyButton-D0gTyMvW.js">
|
|
123
|
-
<link rel="modulepreload" crossorigin href="./assets/documents-events-
|
|
123
|
+
<link rel="modulepreload" crossorigin href="./assets/documents-events-CVeZVUoq.js">
|
|
124
124
|
<link rel="modulepreload" crossorigin href="./assets/parse-api-error-DucXvNZh.js">
|
|
125
125
|
<link rel="modulepreload" crossorigin href="./assets/startup-marks-CytO17UM.js">
|
|
126
|
-
<link rel="modulepreload" crossorigin href="./assets/prop-types-
|
|
127
|
-
<link rel="modulepreload" crossorigin href="./assets/workspace-paths-
|
|
126
|
+
<link rel="modulepreload" crossorigin href="./assets/prop-types-IIZw7u0n.js">
|
|
127
|
+
<link rel="modulepreload" crossorigin href="./assets/workspace-paths-Dgj2u8bQ.js">
|
|
128
128
|
<link rel="modulepreload" crossorigin href="./assets/eye-CmnH89UE.js">
|
|
129
129
|
<link rel="modulepreload" crossorigin href="./assets/info-DV3bzhzI.js">
|
|
130
130
|
<link rel="modulepreload" crossorigin href="./assets/loader-circle-K7Xwpjny.js">
|
|
@@ -134,57 +134,57 @@
|
|
|
134
134
|
<link rel="modulepreload" crossorigin href="./assets/file-tree-rename-validation-DMHa94fr.js">
|
|
135
135
|
<link rel="modulepreload" crossorigin href="./assets/badge-BDZGi1Ks.js">
|
|
136
136
|
<link rel="modulepreload" crossorigin href="./assets/input-CsXmpyZP.js">
|
|
137
|
-
<link rel="modulepreload" crossorigin href="./assets/use-collab-url-
|
|
138
|
-
<link rel="modulepreload" crossorigin href="./assets/DocumentContext-
|
|
137
|
+
<link rel="modulepreload" crossorigin href="./assets/use-collab-url-BaNZ7sdp.js">
|
|
138
|
+
<link rel="modulepreload" crossorigin href="./assets/DocumentContext-B_zqYuAI.js">
|
|
139
139
|
<link rel="modulepreload" crossorigin href="./assets/checkbox-Cn88M3G6.js">
|
|
140
140
|
<link rel="modulepreload" crossorigin href="./assets/dist-BJxDYUHt.js">
|
|
141
141
|
<link rel="modulepreload" crossorigin href="./assets/dist-Cx2QCt5k.js">
|
|
142
142
|
<link rel="modulepreload" crossorigin href="./assets/dropdown-menu-CcKe8PiU.js">
|
|
143
143
|
<link rel="modulepreload" crossorigin href="./assets/label-bn6BDr7p.js">
|
|
144
144
|
<link rel="modulepreload" crossorigin href="./assets/radio-group-DW_ypmKx.js">
|
|
145
|
-
<link rel="modulepreload" crossorigin href="./assets/EnableSyncConfirmDialog-
|
|
145
|
+
<link rel="modulepreload" crossorigin href="./assets/EnableSyncConfirmDialog-D7Zyqovd.js">
|
|
146
146
|
<link rel="modulepreload" crossorigin href="./assets/arrow-up-right-BKliW282.js">
|
|
147
147
|
<link rel="modulepreload" crossorigin href="./assets/cursor-AolWKuZw.js">
|
|
148
148
|
<link rel="modulepreload" crossorigin href="./assets/RegisteredAgentIcon--E1135hW.js">
|
|
149
149
|
<link rel="modulepreload" crossorigin href="./assets/refresh-cw-DSH9Of_0.js">
|
|
150
150
|
<link rel="modulepreload" crossorigin href="./assets/copilot-Be7YOjJF.js">
|
|
151
|
-
<link rel="modulepreload" crossorigin href="./assets/keyboard-shortcuts-
|
|
152
|
-
<link rel="modulepreload" crossorigin href="./assets/agent-visibility-
|
|
151
|
+
<link rel="modulepreload" crossorigin href="./assets/keyboard-shortcuts-CndBRPor.js">
|
|
152
|
+
<link rel="modulepreload" crossorigin href="./assets/agent-visibility-DiHdMcdh.js">
|
|
153
153
|
<link rel="modulepreload" crossorigin href="./assets/clipboard-adapter-BGIXxhKQ.js">
|
|
154
|
-
<link rel="modulepreload" crossorigin href="./assets/skills-api-
|
|
155
|
-
<link rel="modulepreload" crossorigin href="./assets/use-workspace-
|
|
156
|
-
<link rel="modulepreload" crossorigin href="./assets/skill-actions-
|
|
154
|
+
<link rel="modulepreload" crossorigin href="./assets/skills-api-BfzuhumH.js">
|
|
155
|
+
<link rel="modulepreload" crossorigin href="./assets/use-workspace-BLr9vvf6.js">
|
|
156
|
+
<link rel="modulepreload" crossorigin href="./assets/skill-actions-DknvAoZT.js">
|
|
157
157
|
<link rel="modulepreload" crossorigin href="./assets/download-wdc_OGNY.js">
|
|
158
|
-
<link rel="modulepreload" crossorigin href="./assets/open-managed-artifact-tab-
|
|
158
|
+
<link rel="modulepreload" crossorigin href="./assets/open-managed-artifact-tab-DiXXqIwr.js">
|
|
159
159
|
<link rel="modulepreload" crossorigin href="./assets/skeleton-CA6hvjst.js">
|
|
160
160
|
<link rel="modulepreload" crossorigin href="./assets/textarea-DwJR-19i.js">
|
|
161
|
-
<link rel="modulepreload" crossorigin href="./assets/lint-config-client-
|
|
162
|
-
<link rel="modulepreload" crossorigin href="./assets/auth-state-cache-
|
|
161
|
+
<link rel="modulepreload" crossorigin href="./assets/lint-config-client-DMUkUIUK.js">
|
|
162
|
+
<link rel="modulepreload" crossorigin href="./assets/auth-state-cache-Dw5cv-Re.js">
|
|
163
163
|
<link rel="modulepreload" crossorigin href="./assets/toggle-group-CxrQL99E.js">
|
|
164
164
|
<link rel="modulepreload" crossorigin href="./assets/useQuery-NsPxD6kI.js">
|
|
165
165
|
<link rel="modulepreload" crossorigin href="./assets/format-Dn5VT_ew.js">
|
|
166
|
-
<link rel="modulepreload" crossorigin href="./assets/selection-context-
|
|
167
|
-
<link rel="modulepreload" crossorigin href="./assets/PropertyPanel-
|
|
166
|
+
<link rel="modulepreload" crossorigin href="./assets/selection-context-CNyRDPes.js">
|
|
167
|
+
<link rel="modulepreload" crossorigin href="./assets/PropertyPanel-Cogbrfkl.js">
|
|
168
168
|
<link rel="modulepreload" crossorigin href="./assets/miss-dialog-store-81J1GwFD.js">
|
|
169
|
-
<link rel="modulepreload" crossorigin href="./assets/pending-receive-nav-store-
|
|
169
|
+
<link rel="modulepreload" crossorigin href="./assets/pending-receive-nav-store-Cbz7Kdas.js">
|
|
170
170
|
<link rel="modulepreload" crossorigin href="./assets/chevron-left-fiDaD9J4.js">
|
|
171
|
-
<link rel="modulepreload" crossorigin href="./assets/terminal-launch-events-
|
|
171
|
+
<link rel="modulepreload" crossorigin href="./assets/terminal-launch-events-BHwqFf2t.js">
|
|
172
172
|
<link rel="modulepreload" crossorigin href="./assets/panel-right-open-CBweAP43.js">
|
|
173
173
|
<link rel="modulepreload" crossorigin href="./assets/follow-file-Db721Zx6.js">
|
|
174
174
|
<link rel="modulepreload" crossorigin href="./assets/timeline-diff-store-dt1fl2gd.js">
|
|
175
175
|
<link rel="modulepreload" crossorigin href="./assets/wrench-BDWKT3wQ.js">
|
|
176
176
|
<link rel="modulepreload" crossorigin href="./assets/panel-DLUMbyPl.js">
|
|
177
|
-
<link rel="modulepreload" crossorigin href="./assets/typing-burst-detector-
|
|
177
|
+
<link rel="modulepreload" crossorigin href="./assets/typing-burst-detector-CDZ6YHeV.js">
|
|
178
178
|
<link rel="modulepreload" crossorigin href="./assets/project-paths-DcJ4HDNl.js">
|
|
179
|
-
<link rel="modulepreload" crossorigin href="./assets/file-tree-adapter-
|
|
180
|
-
<link rel="modulepreload" crossorigin href="./assets/agent-diff-store-
|
|
181
|
-
<link rel="modulepreload" crossorigin href="./assets/target-navigation-intent-
|
|
182
|
-
<link rel="modulepreload" crossorigin href="./assets/use-live-xterm-theme-
|
|
179
|
+
<link rel="modulepreload" crossorigin href="./assets/file-tree-adapter-Bc2We8C-.js">
|
|
180
|
+
<link rel="modulepreload" crossorigin href="./assets/agent-diff-store-Dhae8oo2.js">
|
|
181
|
+
<link rel="modulepreload" crossorigin href="./assets/target-navigation-intent-I4UM-x6n.js">
|
|
182
|
+
<link rel="modulepreload" crossorigin href="./assets/use-live-xterm-theme-Dz6hvjuv.js">
|
|
183
183
|
<link rel="modulepreload" crossorigin href="./assets/use-installed-clis-DmVWBoog.js">
|
|
184
|
-
<link rel="modulepreload" crossorigin href="./assets/terminal-telemetry-
|
|
184
|
+
<link rel="modulepreload" crossorigin href="./assets/terminal-telemetry-D1aeGl-R.js">
|
|
185
185
|
<link rel="modulepreload" crossorigin href="./assets/agent-presence-DdJtLtJ1.js">
|
|
186
186
|
<link rel="modulepreload" crossorigin href="./assets/mcp-consent-store-rBVJ88Wy.js">
|
|
187
|
-
<link rel="modulepreload" crossorigin href="./assets/receive-store-
|
|
187
|
+
<link rel="modulepreload" crossorigin href="./assets/receive-store-Dcra48Oz.js">
|
|
188
188
|
<link rel="modulepreload" crossorigin href="./assets/worktree-store-1tC864Do.js">
|
|
189
189
|
<link rel="stylesheet" crossorigin href="./assets/DocumentContext-B0sQn39F.css">
|
|
190
190
|
<link rel="stylesheet" crossorigin href="./assets/index-Cj5Hm4v5.css">
|
|
@@ -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-CSzqpsW_.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-DdKhQjo_.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{g as e,l as t,s as n}from"./write-project-skill-
|
|
2
|
-
//# sourceMappingURL=repair-mcp-configs-
|
|
1
|
+
import{g as e,l as t,s as n}from"./write-project-skill-BD-Ei4Cn.mjs";import{d as r,v as i}from"./init-DTQvzEMW.mjs";import{t as a}from"./mcp-migrate-event-CWx0WLdE.mjs";import{homedir as o}from"node:os";function s(e){let r=e.logger??u,i=e.home??o(),a=[];if(e.reclaimDisableEnv===`1`)return r({event:`mcp-config-repair-skipped`,reason:`reclaim-disabled`}),{outcomes:a,repairedCount:0};for(let o of n){let n=t[o],s=c(()=>n.configPath(``,i));if(s!==null&&a.push(l({scope:`user`,editorId:o,target:n,home:i,cwd:``,configPath:s,configPathOverride:void 0,logger:r})),n.projectConfigPath){let t=n.projectConfigPath,i=c(()=>t(e.projectDir));i!==null&&a.push(l({scope:`project`,editorId:o,target:n,home:void 0,cwd:e.projectDir,configPath:i,configPathOverride:i,logger:r}))}}return{outcomes:a,repairedCount:a.filter(e=>e.outcome===`repaired`).length}}function c(e){try{return e()}catch{return null}}function l(t){let n={scope:t.scope,editorId:t.editorId,configPath:t.configPath},o=r(t.target,t.cwd,t.home,t.configPathOverride);if(o===null)return{...n,outcome:`no-entry`};if(e(o))return{...n,outcome:`canonical`};t.logger(a({scope:t.scope,surface:`cli-repair`,editorId:t.editorId,configPath:t.configPath,priorEntry:o}));let s=i(t.target,t.cwd,{mode:`published`,skipAvailabilityCheck:!0},t.home,t.configPathOverride);if(s.action===`failed`){let e=s.error??`unknown write failure`;return t.logger({event:`mcp-config-repair-write-failed`,scope:t.scope,editorId:t.editorId,configPath:t.configPath,error:e}),{...n,outcome:`write-failed`,error:e}}return s.action===`declined`?(t.logger({event:`mcp-config-repair-declined`,scope:t.scope,editorId:t.editorId,configPath:t.configPath,reason:s.declineReason}),{...n,outcome:`declined`}):{...n,outcome:`repaired`}}function u(e){process.stderr.write(`${JSON.stringify(e)}\n`)}export{s as repairMcpConfigs};
|
|
2
|
+
//# sourceMappingURL=repair-mcp-configs-CR7okbjl.mjs.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{C as e}from"./src-
|
|
1
|
+
import{C as e}from"./src-FuRMJntf.mjs";import{Dn as t,Fn as n,Hn as r,Ln as i,Mn as a,Nn as o,On as s,Vn as c,jn as l}from"./src-DBW4MhVj.mjs";import{a as u,l as d,t as f,u as p,x as m}from"./write-project-skill-BD-Ei4Cn.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:()=>i(`project`,{checkDesktop:!1}),resolveUserBundledSkillDir:e=>i(e,{checkDesktop:!1}),readBundledVersion:()=>s(),readRecordedVersion:e=>l(e,`cli-hosts`),writeRecordedVersion:(e,t)=>o(e,`cli-hosts`,t,`cli-start`),recordEvent:e=>n(e),readBundleDecision:(e,n)=>t(e,n),writeBundleDecision:(e,t,n)=>a(e,t,n),removeBundleFromDisk:(e,t)=>u(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{return t.existsSync(e)?t.readFileSync(e).toString(`utf8`).includes(`# ok-mcp-`):!1}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=d[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{f(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,n,i,a){let o=e=>{n.recordEvent(e).catch(()=>{})},s=()=>new Date().toISOString(),l;try{l=await n.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 n.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 r)try{d.push({id:e,sourceDir:n.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 r of d){let o=c[r.id],s=i.existsSync(g(t,`.agents`,`skills`,o)),l=await n.readBundleDecision(t,o).catch(()=>null);if(!e(l,{installedOnDisk:s})){if(s)try{n.removeBundleFromDisk(t,r.id),a({event:`user-skill-reclaim-bundle-declined-removed`,scope:`user`,bundle:r.id})}catch(e){a({event:`user-skill-reclaim-bundle-remove-failed`,scope:`user`,bundle:r.id,error:e instanceof Error?e.message:String(e)})}continue}if(l===null&&s)try{await n.writeBundleDecision(t,o,!0)}catch(e){a({event:`user-skill-reclaim-grandfather-write-failed`,scope:`user`,bundle:r.id,error:e instanceof Error?e.message:String(e)})}p.push(r)}if(p.length===0)return{outcome:`skipped`,reason:`all-bundles-declined`};let m=p.every(e=>i.existsSync(g(t,`.agents`,`skills`,c[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===r.length,v=!0;for(let{id:e,sourceDir:n}of p){let r=j(t,c[e],n,i,a,l);h.push(...r.entries),r.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 n.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 m(`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-B7V4_S1t.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./repair-skills-B7V4_S1t.mjs";export{e as repairSkills};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,o as t,r as n}from"./server-lock-CSEWSPO0.mjs";export{n as markServerLockDraining,e as releaseServerLock,t as updateServerLockPort};
|